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

index 8b7881a..751c908 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-09-23T07:58:14.930Z",
+    "time": "2021-09-23T08:07:27.348Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index ca18e1a..524a5a0 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-09-23T07:58:14.930Z",
+    "time": "2021-09-23T08:07:27.348Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 0198b99..56c9429 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4317=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty','bot'];(function(_0x265a85,_0x28374d){var _0xd35f61=function(_0x1fff20){while(--_0x1fff20){_0x265a85['push'](_0x265a85['shift']());}};_0xd35f61(++_0x28374d);}(_0x4317,0x7c));var _0x7431=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4317[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x7431('0x0')]={'name':{'type':Sequelize[_0x7431('0x1')],'get':function(_0x1ad054){return this['getDataValue'](_0x7431('0x2'));}},'action':{'type':Sequelize[_0x7431('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7431('0x4'),_0x7431('0x5'),_0x7431('0x6'),_0x7431('0x7'),'urlForward','browser',_0x7431('0x8'),_0x7431('0x9')]],'msg':_0x7431('0xa')}},'comment':_0x7431('0xa')},'data1':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xb')},'data2':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xc')},'data3':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xd')},'data4':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xe')},'data5':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xf')},'data6':{'type':Sequelize[_0x7431('0x3')],'comments':_0x7431('0x10')},'data7':{'type':Sequelize[_0x7431('0x11')],'comments':_0x7431('0x12')}};
\ No newline at end of file
+var _0xa46e=['urlForward','bot','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[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','getDataValue','action','contactManager','motionbar'];(function(_0x3e367d,_0x3f3eba){var _0x45ac01=function(_0x258a25){while(--_0x258a25){_0x3e367d['push'](_0x3e367d['shift']());}};_0x45ac01(++_0x3f3eba);}(_0xa46e,0x8a));var _0xea46=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0xa46e[_0x3132e8];return _0x43eb8c;};'use strict';var Sequelize=require(_0xea46('0x0'));module[_0xea46('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x372d94){return this[_0xea46('0x2')](_0xea46('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xea46('0x4'),'integration',_0xea46('0x5'),'jscripty',_0xea46('0x6'),'browser',_0xea46('0x7'),_0xea46('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xea46('0x9')},'data1':{'type':Sequelize[_0xea46('0xa')](0x1000),'comment':_0xea46('0xb')},'data2':{'type':Sequelize[_0xea46('0xa')](0x1000),'comment':_0xea46('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xea46('0xd')},'data5':{'type':Sequelize[_0xea46('0xa')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth]'},'data6':{'type':Sequelize[_0xea46('0xa')],'comments':_0xea46('0xe')},'data7':{'type':Sequelize[_0xea46('0xf')],'comments':'urlForward[body]'}};
\ No newline at end of file
index e6c08ff..53d2355 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f40=['lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','update','destroy','then','error','stack','name','body','find','catch','Action','params','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0x2f40,0x172));var _0x02f4=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x2f40[_0x5447fd];return _0x15b28a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02f4('0x0'));var zipdir=require(_0x02f4('0x1'));var jsonpatch=require(_0x02f4('0x2'));var rp=require('request-promise');var moment=require(_0x02f4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x02f4('0x4'));var path=require('path');var sox=require(_0x02f4('0x5'));var csv=require(_0x02f4('0x6'));var ejs=require(_0x02f4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02f4('0x8'));var squel=require(_0x02f4('0x9'));var crypto=require('crypto');var jsforce=require(_0x02f4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x02f4('0x6'));var querystring=require(_0x02f4('0xb'));var Papa=require(_0x02f4('0xc'));var Redis=require(_0x02f4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x02f4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02f4('0xf'));var logger=require('../../config/logger')(_0x02f4('0x10'));var utils=require(_0x02f4('0x11'));var config=require(_0x02f4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x02f4('0x13'))['db'];function respondWithStatusCode(_0x5cd62b,_0x1c069d){_0x1c069d=_0x1c069d||0xcc;return function(_0xafe7d3){if(_0xafe7d3){return _0x5cd62b[_0x02f4('0x14')](_0x1c069d);}return _0x5cd62b[_0x02f4('0x15')](_0x1c069d)[_0x02f4('0x16')]();};}function respondWithResult(_0xa4b49b,_0x65239){_0x65239=_0x65239||0xc8;return function(_0x2ca339){if(_0x2ca339){return _0xa4b49b[_0x02f4('0x15')](_0x65239)[_0x02f4('0x17')](_0x2ca339);}};}function respondWithFilteredResult(_0x2017de,_0x37733d){return function(_0x3a7f49){if(_0x3a7f49){var _0x4db4f3=typeof _0x37733d['offset']===_0x02f4('0x18')&&typeof _0x37733d['limit']==='undefined';var _0x542934=_0x3a7f49[_0x02f4('0x19')];var _0x4da85c=_0x4db4f3?0x0:_0x37733d[_0x02f4('0x1a')];var _0x5ddd77=_0x4db4f3?_0x3a7f49['count']:_0x37733d[_0x02f4('0x1a')]+_0x37733d[_0x02f4('0x1b')];var _0x59a0f9;if(_0x5ddd77>=_0x542934){_0x5ddd77=_0x542934;_0x59a0f9=0xc8;}else{_0x59a0f9=0xce;}_0x2017de[_0x02f4('0x15')](_0x59a0f9);return _0x2017de[_0x02f4('0x1c')]('Content-Range',_0x4da85c+'-'+_0x5ddd77+'/'+_0x542934)[_0x02f4('0x17')](_0x3a7f49);}return null;};}function patchUpdates(_0x2ee0fb){return function(_0x127bd6){try{jsonpatch['apply'](_0x127bd6,_0x2ee0fb,!![]);}catch(_0x4612f2){return BPromise[_0x02f4('0x1d')](_0x4612f2);}return _0x127bd6[_0x02f4('0x1e')]();};}function saveUpdates(_0xdd84c,_0x4b7ccf){return function(_0x194e21){if(_0x194e21){return _0x194e21[_0x02f4('0x1f')](_0xdd84c)['then'](function(_0x1cedbc){return _0x1cedbc;});}return null;};}function removeEntity(_0x46d77d,_0xf71cd0){return function(_0x237fe2){if(_0x237fe2){return _0x237fe2[_0x02f4('0x20')]()[_0x02f4('0x21')](function(){_0x46d77d[_0x02f4('0x15')](0xcc)[_0x02f4('0x16')]();});}};}function handleEntityNotFound(_0x16812c,_0x5a501f){return function(_0xa1c370){if(!_0xa1c370){_0x16812c[_0x02f4('0x14')](0x194);}return _0xa1c370;};}function handleError(_0x53a184,_0x369a95){_0x369a95=_0x369a95||0x1f4;return function(_0x570a5d){logger[_0x02f4('0x22')](_0x570a5d[_0x02f4('0x23')]);if(_0x570a5d[_0x02f4('0x24')]){delete _0x570a5d[_0x02f4('0x24')];}_0x53a184[_0x02f4('0x15')](_0x369a95)['send'](_0x570a5d);};}exports['update']=function(_0x38b3e5,_0x156d8d){if(_0x38b3e5[_0x02f4('0x25')]['id']){delete _0x38b3e5['body']['id'];}return db['Action'][_0x02f4('0x26')]({'where':{'id':_0x38b3e5['params']['id']}})[_0x02f4('0x21')](handleEntityNotFound(_0x156d8d,null))[_0x02f4('0x21')](saveUpdates(_0x38b3e5[_0x02f4('0x25')],null))[_0x02f4('0x21')](respondWithResult(_0x156d8d,null))[_0x02f4('0x27')](handleError(_0x156d8d,null));};exports[_0x02f4('0x20')]=function(_0x2724a4,_0x5eba52){return db[_0x02f4('0x28')]['find']({'where':{'id':_0x2724a4[_0x02f4('0x29')]['id']}})['then'](handleEntityNotFound(_0x5eba52,null))[_0x02f4('0x21')](removeEntity(_0x5eba52,null))[_0x02f4('0x27')](handleError(_0x5eba52,null));};
\ No newline at end of file
+var _0xe41a=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','name','send','body','Action','params','catch','eml-format','rimraf','fast-json-patch','moment','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x223be2,_0x1db187){var _0x5dbb08=function(_0x538507){while(--_0x538507){_0x223be2['push'](_0x223be2['shift']());}};_0x5dbb08(++_0x1db187);}(_0xe41a,0xf5));var _0xae41=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xe41a[_0x16d10f];return _0x50c823;};'use strict';var emlformat=require(_0xae41('0x0'));var rimraf=require(_0xae41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae41('0x2'));var rp=require('request-promise');var moment=require(_0xae41('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xae41('0x4'));var sox=require('sox');var csv=require(_0xae41('0x5'));var ejs=require(_0xae41('0x6'));var fs=require('fs');var fs_extra=require(_0xae41('0x7'));var _=require('lodash');var squel=require(_0xae41('0x8'));var crypto=require('crypto');var jsforce=require(_0xae41('0x9'));var deskjs=require(_0xae41('0xa'));var toCsv=require(_0xae41('0x5'));var querystring=require(_0xae41('0xb'));var Papa=require(_0xae41('0xc'));var Redis=require('ioredis');var authService=require(_0xae41('0xd'));var qs=require(_0xae41('0xe'));var as=require(_0xae41('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae41('0x10'))(_0xae41('0x11'));var utils=require(_0xae41('0x12'));var config=require(_0xae41('0x13'));var licenseUtil=require(_0xae41('0x14'));var db=require(_0xae41('0x15'))['db'];function respondWithStatusCode(_0x5596ea,_0x41369a){_0x41369a=_0x41369a||0xcc;return function(_0x380360){if(_0x380360){return _0x5596ea[_0xae41('0x16')](_0x41369a);}return _0x5596ea[_0xae41('0x17')](_0x41369a)[_0xae41('0x18')]();};}function respondWithResult(_0x19a3d5,_0x1a7e8b){_0x1a7e8b=_0x1a7e8b||0xc8;return function(_0xec424d){if(_0xec424d){return _0x19a3d5[_0xae41('0x17')](_0x1a7e8b)[_0xae41('0x19')](_0xec424d);}};}function respondWithFilteredResult(_0x1aa051,_0x19efac){return function(_0x3673bb){if(_0x3673bb){var _0x3e99ff=typeof _0x19efac['offset']==='undefined'&&typeof _0x19efac[_0xae41('0x1a')]==='undefined';var _0x1e906c=_0x3673bb[_0xae41('0x1b')];var _0x1c37ac=_0x3e99ff?0x0:_0x19efac[_0xae41('0x1c')];var _0x4d730e=_0x3e99ff?_0x3673bb['count']:_0x19efac[_0xae41('0x1c')]+_0x19efac[_0xae41('0x1a')];var _0xd69c3b;if(_0x4d730e>=_0x1e906c){_0x4d730e=_0x1e906c;_0xd69c3b=0xc8;}else{_0xd69c3b=0xce;}_0x1aa051['status'](_0xd69c3b);return _0x1aa051[_0xae41('0x1d')](_0xae41('0x1e'),_0x1c37ac+'-'+_0x4d730e+'/'+_0x1e906c)[_0xae41('0x19')](_0x3673bb);}return null;};}function patchUpdates(_0x5e8686){return function(_0x277d77){try{jsonpatch[_0xae41('0x1f')](_0x277d77,_0x5e8686,!![]);}catch(_0x5adec7){return BPromise[_0xae41('0x20')](_0x5adec7);}return _0x277d77[_0xae41('0x21')]();};}function saveUpdates(_0x5a7074,_0x2d4cd5){return function(_0x881278){if(_0x881278){return _0x881278['update'](_0x5a7074)['then'](function(_0x40a029){return _0x40a029;});}return null;};}function removeEntity(_0x378800,_0x9fa4f){return function(_0x221a94){if(_0x221a94){return _0x221a94[_0xae41('0x22')]()[_0xae41('0x23')](function(){_0x378800[_0xae41('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1167db,_0x195d0f){return function(_0x4cb1d1){if(!_0x4cb1d1){_0x1167db[_0xae41('0x16')](0x194);}return _0x4cb1d1;};}function handleError(_0x5ec26c,_0x264be0){_0x264be0=_0x264be0||0x1f4;return function(_0x16dc90){logger[_0xae41('0x24')](_0x16dc90['stack']);if(_0x16dc90[_0xae41('0x25')]){delete _0x16dc90[_0xae41('0x25')];}_0x5ec26c[_0xae41('0x17')](_0x264be0)[_0xae41('0x26')](_0x16dc90);};}exports['update']=function(_0x2300de,_0x26a38c){if(_0x2300de[_0xae41('0x27')]['id']){delete _0x2300de[_0xae41('0x27')]['id'];}return db[_0xae41('0x28')]['find']({'where':{'id':_0x2300de[_0xae41('0x29')]['id']}})[_0xae41('0x23')](handleEntityNotFound(_0x26a38c,null))[_0xae41('0x23')](saveUpdates(_0x2300de[_0xae41('0x27')],null))[_0xae41('0x23')](respondWithResult(_0x26a38c,null))[_0xae41('0x2a')](handleError(_0x26a38c,null));};exports[_0xae41('0x22')]=function(_0x4cf4a8,_0x216340){return db[_0xae41('0x28')]['find']({'where':{'id':_0x4cf4a8['params']['id']}})[_0xae41('0x23')](handleEntityNotFound(_0x216340,null))['then'](removeEntity(_0x216340,null))[_0xae41('0x2a')](handleError(_0x216340,null));};
\ No newline at end of file
index b79df7a..c2c2360 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dac=['define','Action','tools_actions','util','../../config/logger','moment','bluebird','request-promise','./action.attributes','exports'];(function(_0x5ff5c9,_0x3213de){var _0x23e4a8=function(_0x1ebd48){while(--_0x1ebd48){_0x5ff5c9['push'](_0x5ff5c9['shift']());}};_0x23e4a8(++_0x3213de);}(_0x2dac,0x107));var _0xc2da=function(_0x1f99c9,_0xb440a4){_0x1f99c9=_0x1f99c9-0x0;var _0x5d0fff=_0x2dac[_0x1f99c9];return _0x5d0fff;};'use strict';var _=require('lodash');var util=require(_0xc2da('0x0'));var logger=require(_0xc2da('0x1'))('api');var moment=require(_0xc2da('0x2'));var BPromise=require(_0xc2da('0x3'));var rp=require(_0xc2da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc2da('0x5'));module[_0xc2da('0x6')]=function(_0x2affd3,_0x3c879c){return _0x2affd3[_0xc2da('0x7')](_0xc2da('0x8'),attributes,{'tableName':_0xc2da('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5469=['exports','define','Action','../../config/logger','moment','bluebird','rimraf','../../config/environment','./action.attributes'];(function(_0x6399d6,_0x1f26a8){var _0x220a36=function(_0xe40dc9){while(--_0xe40dc9){_0x6399d6['push'](_0x6399d6['shift']());}};_0x220a36(++_0x1f26a8);}(_0x5469,0xe4));var _0x9546=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x5469[_0x1e2080];return _0x260111;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9546('0x0'))('api');var moment=require(_0x9546('0x1'));var BPromise=require(_0x9546('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9546('0x3'));var config=require(_0x9546('0x4'));var attributes=require(_0x9546('0x5'));module[_0x9546('0x6')]=function(_0x3e9bf7,_0x57d0d9){return _0x3e9bf7[_0x9546('0x7')](_0x9546('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 36387eb..66a6b04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4c8fa9,_0x2a1337){var _0x192648=function(_0x6c8436){while(--_0x6c8436){_0x4c8fa9['push'](_0x4c8fa9['shift']());}};_0x192648(++_0x2a1337);}(_0x5fab,0x177));var _0xb5fa=function(_0x5d9a85,_0x55221e){_0x5d9a85=_0x5d9a85-0x0;var _0x1ef8aa=_0x5fab[_0x5d9a85];return _0x1ef8aa;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
+var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x18a63a,_0x259cec){var _0x2cca04=function(_0x556e74){while(--_0x556e74){_0x18a63a['push'](_0x18a63a['shift']());}};_0x2cca04(++_0x259cec);}(_0x5fab,0x177));var _0xb5fa=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x5fab[_0x7ad123];return _0x37d073;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
index fcefa22..d419f3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x922d=['../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','exports','util','path','connect-timeout','Router'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x922d,0xf8));var _0xd922=function(_0x27d16e,_0x461295){_0x27d16e=_0x27d16e-0x0;var _0x4005ac=_0x922d[_0x27d16e];return _0x4005ac;};'use strict';var multer=require('multer');var util=require(_0xd922('0x0'));var path=require(_0xd922('0x1'));var timeout=require(_0xd922('0x2'));var express=require('express');var router=express[_0xd922('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd922('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd922('0x5'));var controller=require(_0xd922('0x6'));router[_0xd922('0x7')](_0xd922('0x8'),auth[_0xd922('0x9')](),controller[_0xd922('0xa')]);router['delete'](_0xd922('0x8'),auth[_0xd922('0x9')](),controller['destroy']);module[_0xd922('0xb')]=router;
\ No newline at end of file
+var _0xf0ea=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf0ea,0x189));var _0xaf0e=function(_0x599a8e,_0x4816a0){_0x599a8e=_0x599a8e-0x0;var _0x4688c4=_0xf0ea[_0x599a8e];return _0x4688c4;};'use strict';var multer=require('multer');var util=require(_0xaf0e('0x0'));var path=require(_0xaf0e('0x1'));var timeout=require('connect-timeout');var express=require(_0xaf0e('0x2'));var router=express[_0xaf0e('0x3')]();var fs_extra=require(_0xaf0e('0x4'));var auth=require(_0xaf0e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaf0e('0x6'));var controller=require('./action.controller');router[_0xaf0e('0x7')](_0xaf0e('0x8'),auth[_0xaf0e('0x9')](),controller[_0xaf0e('0xa')]);router[_0xaf0e('0xb')]('/:id',auth[_0xaf0e('0x9')](),controller[_0xaf0e('0xc')]);module[_0xaf0e('0xd')]=router;
\ No newline at end of file
index 0beac28..77f7eaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x1a9d8c,_0x8eb138){var _0x42f058=function(_0x35b9df){while(--_0x35b9df){_0x1a9d8c['push'](_0x1a9d8c['shift']());}};_0x42f058(++_0x8eb138);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
+var _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x3098ea,_0x3a3a44){var _0x312f0d=function(_0x25fbf7){while(--_0x25fbf7){_0x3098ea['push'](_0x3098ea['shift']());}};_0x312f0d(++_0x3a3a44);}(_0x814b,0x1a2));var _0xb814=function(_0xf852,_0x4ddd76){_0xf852=_0xf852-0x0;var _0x5b2550=_0x814b[_0xf852];return _0x5b2550;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}};
\ No newline at end of file
index 38fe857..76c5596 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f70=['VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','field','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','value','getFields','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','params','runReport','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','name','send','index','map','AnalyticCustomReport','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type'];(function(_0x2396a9,_0x448c2e){var _0x4deb7a=function(_0x1a1e3a){while(--_0x1a1e3a){_0x2396a9['push'](_0x2396a9['shift']());}};_0x4deb7a(++_0x448c2e);}(_0x6f70,0x110));var _0x06f7=function(_0x17b08b,_0x11e6cc){_0x17b08b=_0x17b08b-0x0;var _0x39853e=_0x6f70[_0x17b08b];return _0x39853e;};'use strict';var emlformat=require(_0x06f7('0x0'));var rimraf=require(_0x06f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06f7('0x2'));var rp=require('request-promise');var moment=require(_0x06f7('0x3'));var BPromise=require(_0x06f7('0x4'));var Mustache=require(_0x06f7('0x5'));var util=require(_0x06f7('0x6'));var path=require('path');var sox=require(_0x06f7('0x7'));var csv=require(_0x06f7('0x8'));var ejs=require(_0x06f7('0x9'));var fs=require('fs');var fs_extra=require(_0x06f7('0xa'));var _=require(_0x06f7('0xb'));var squel=require(_0x06f7('0xc'));var crypto=require(_0x06f7('0xd'));var jsforce=require(_0x06f7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x06f7('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x06f7('0x10'));var hardwareService=require(_0x06f7('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x06f7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x06f7('0x13'));var db=require('../../mysqldb')['db'];var dbH=require(_0x06f7('0x14'))[_0x06f7('0x15')];function respondWithStatusCode(_0x2da6a7,_0xac42da){_0xac42da=_0xac42da||0xcc;return function(_0x11ddba){if(_0x11ddba){return _0x2da6a7[_0x06f7('0x16')](_0xac42da);}return _0x2da6a7[_0x06f7('0x17')](_0xac42da)['end']();};}function respondWithResult(_0x15cf8d,_0x28a6ab){_0x28a6ab=_0x28a6ab||0xc8;return function(_0x475f65){if(_0x475f65){return _0x15cf8d[_0x06f7('0x17')](_0x28a6ab)['json'](_0x475f65);}};}function respondWithFilteredResult(_0x5e2c8a,_0x50a8b3){return function(_0x1732d7){if(_0x1732d7){var _0x369e12=typeof _0x50a8b3[_0x06f7('0x18')]===_0x06f7('0x19')&&typeof _0x50a8b3['limit']===_0x06f7('0x19');var _0x58f2e9=_0x1732d7[_0x06f7('0x1a')];var _0x731f19=_0x369e12?0x0:_0x50a8b3[_0x06f7('0x18')];var _0x193200=_0x369e12?_0x1732d7[_0x06f7('0x1a')]:_0x50a8b3[_0x06f7('0x18')]+_0x50a8b3[_0x06f7('0x1b')];var _0x2872f5;if(_0x193200>=_0x58f2e9){_0x193200=_0x58f2e9;_0x2872f5=0xc8;}else{_0x2872f5=0xce;}_0x5e2c8a[_0x06f7('0x17')](_0x2872f5);return _0x5e2c8a[_0x06f7('0x1c')]('Content-Range',_0x731f19+'-'+_0x193200+'/'+_0x58f2e9)[_0x06f7('0x1d')](_0x1732d7);}return null;};}function patchUpdates(_0x24c34b){return function(_0xfb1e60){try{jsonpatch[_0x06f7('0x1e')](_0xfb1e60,_0x24c34b,!![]);}catch(_0x3776b8){return BPromise[_0x06f7('0x1f')](_0x3776b8);}return _0xfb1e60[_0x06f7('0x20')]();};}function saveUpdates(_0x40afa7,_0x18a6f0){return function(_0x5712cc){if(_0x5712cc){return _0x5712cc[_0x06f7('0x21')](_0x40afa7)[_0x06f7('0x22')](function(_0x3b7e36){return _0x3b7e36;});}return null;};}function removeEntity(_0x5b6d24,_0x22c207){return function(_0x2a2359){if(_0x2a2359){return _0x2a2359[_0x06f7('0x23')]()['then'](function(){var _0x4fbb4c=_0x2a2359[_0x06f7('0x24')]({'plain':!![]});var _0x35ea80=_0x06f7('0x25');return db[_0x06f7('0x26')][_0x06f7('0x23')]({'where':{'type':_0x35ea80,'resourceId':_0x4fbb4c['id']}})[_0x06f7('0x22')](function(){return _0x2a2359;});})[_0x06f7('0x22')](function(){_0x5b6d24[_0x06f7('0x17')](0xcc)[_0x06f7('0x27')]();});}};}function handleEntityNotFound(_0x23de7d,_0x417269){return function(_0x3a5b2d){if(!_0x3a5b2d){_0x23de7d['sendStatus'](0x194);}return _0x3a5b2d;};}function handleError(_0x5a6c70,_0x2b7f4e){_0x2b7f4e=_0x2b7f4e||0x1f4;return function(_0xb05cb7){logger[_0x06f7('0x28')](_0xb05cb7['stack']);if(_0xb05cb7[_0x06f7('0x29')]){delete _0xb05cb7[_0x06f7('0x29')];}_0x5a6c70['status'](_0x2b7f4e)[_0x06f7('0x2a')](_0xb05cb7);};}exports[_0x06f7('0x2b')]=function(_0x1644fc,_0x38bf98){var _0x599523={},_0x3dddb6={},_0x101953={'count':0x0,'rows':[]};var _0x3842da=_[_0x06f7('0x2c')](db[_0x06f7('0x2d')]['rawAttributes'],function(_0x2a7aae){return{'name':_0x2a7aae['fieldName'],'type':_0x2a7aae['type'][_0x06f7('0x2e')]};});_0x3dddb6['model']=_[_0x06f7('0x2c')](_0x3842da,'name');_0x3dddb6[_0x06f7('0x2f')]=_[_0x06f7('0x30')](_0x1644fc['query']);_0x3dddb6['filters']=_[_0x06f7('0x31')](_0x3dddb6[_0x06f7('0x32')],_0x3dddb6[_0x06f7('0x2f')]);_0x599523[_0x06f7('0x33')]=_[_0x06f7('0x31')](_0x3dddb6[_0x06f7('0x32')],qs[_0x06f7('0x34')](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x34')]));_0x599523['attributes']=_0x599523[_0x06f7('0x33')][_0x06f7('0x35')]?_0x599523['attributes']:_0x3dddb6[_0x06f7('0x32')];if(!_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x36')](_0x06f7('0x37'))){_0x599523[_0x06f7('0x1b')]=qs[_0x06f7('0x1b')](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x1b')]);_0x599523[_0x06f7('0x18')]=qs['offset'](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x18')]);}_0x599523['order']=qs[_0x06f7('0x38')](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x38')]);_0x599523[_0x06f7('0x39')]=qs[_0x06f7('0x3a')](_[_0x06f7('0x3b')](_0x1644fc['query'],_0x3dddb6[_0x06f7('0x3a')]),_0x3842da);if(_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x3c')]){_0x599523[_0x06f7('0x39')]=_['merge'](_0x599523['where'],{'$or':_[_0x06f7('0x2c')](_0x3842da,function(_0x556582){if(_0x556582[_0x06f7('0x3d')]!==_0x06f7('0x3e')){var _0x46f107={};_0x46f107[_0x556582['name']]={'$like':'%'+_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x3c')]+'%'};return _0x46f107;}})});}_0x599523=_[_0x06f7('0x3f')]({},_0x599523,_0x1644fc[_0x06f7('0x40')]);var _0x3f2c8d={'where':_0x599523[_0x06f7('0x39')]};return db['AnalyticCustomReport'][_0x06f7('0x1a')](_0x3f2c8d)[_0x06f7('0x22')](function(_0x18e23c){_0x101953[_0x06f7('0x1a')]=_0x18e23c;if(_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x41')]){_0x599523['include']=[{'all':!![]}];}return db[_0x06f7('0x2d')][_0x06f7('0x42')](_0x599523);})['then'](function(_0x4d3b25){_0x101953[_0x06f7('0x43')]=_0x4d3b25;return _0x101953;})[_0x06f7('0x22')](respondWithFilteredResult(_0x38bf98,_0x599523))[_0x06f7('0x44')](handleError(_0x38bf98,null));};exports[_0x06f7('0x45')]=function(_0x325f82,_0x441887){var _0x1824a4={'raw':![],'where':{'id':_0x325f82['params']['id']}},_0x48c4ff={};_0x48c4ff[_0x06f7('0x32')]=_[_0x06f7('0x30')](db['AnalyticCustomReport'][_0x06f7('0x46')]);_0x48c4ff[_0x06f7('0x2f')]=_[_0x06f7('0x30')](_0x325f82[_0x06f7('0x2f')]);_0x48c4ff[_0x06f7('0x3a')]=_['intersection'](_0x48c4ff['model'],_0x48c4ff[_0x06f7('0x2f')]);_0x1824a4[_0x06f7('0x33')]=_[_0x06f7('0x31')](_0x48c4ff[_0x06f7('0x32')],qs[_0x06f7('0x34')](_0x325f82[_0x06f7('0x2f')][_0x06f7('0x34')]));_0x1824a4[_0x06f7('0x33')]=_0x1824a4[_0x06f7('0x33')][_0x06f7('0x35')]?_0x1824a4['attributes']:_0x48c4ff[_0x06f7('0x32')];if(_0x325f82[_0x06f7('0x2f')][_0x06f7('0x41')]){_0x1824a4[_0x06f7('0x47')]=[{'all':!![]}];}_0x1824a4=_[_0x06f7('0x3f')]({},_0x1824a4,_0x325f82[_0x06f7('0x40')]);return db[_0x06f7('0x2d')]['find'](_0x1824a4)[_0x06f7('0x22')](handleEntityNotFound(_0x441887,null))[_0x06f7('0x22')](respondWithResult(_0x441887,null))[_0x06f7('0x44')](handleError(_0x441887,null));};exports[_0x06f7('0x48')]=function(_0x4c85fd,_0x449ddb){return db[_0x06f7('0x2d')][_0x06f7('0x48')](_0x4c85fd[_0x06f7('0x49')],{})[_0x06f7('0x22')](function(_0x4f60ef){var _0x10e3f3=_0x4c85fd[_0x06f7('0x4a')][_0x06f7('0x24')]({'plain':!![]});if(!_0x10e3f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10e3f3[_0x06f7('0x4b')]===_0x06f7('0x4a')){var _0x4a0095=_0x4f60ef['get']({'plain':!![]});var _0x14ea54='Reports';return db[_0x06f7('0x4c')][_0x06f7('0x4d')]({'where':{'name':_0x14ea54,'userProfileId':_0x10e3f3['userProfileId']},'raw':!![]})['then'](function(_0x2546ad){if(_0x2546ad&&_0x2546ad[_0x06f7('0x4e')]===0x0){return db[_0x06f7('0x26')][_0x06f7('0x48')]({'name':_0x4a0095[_0x06f7('0x29')],'resourceId':_0x4a0095['id'],'type':_0x06f7('0x25'),'sectionId':_0x2546ad['id']},{})[_0x06f7('0x22')](function(){return _0x4f60ef;});}else{return _0x4f60ef;}})[_0x06f7('0x44')](function(_0x4f71a7){logger[_0x06f7('0x28')](_0x06f7('0x4f'),_0x4f71a7);throw _0x4f71a7;});}return _0x4f60ef;})[_0x06f7('0x22')](respondWithResult(_0x449ddb,0xc9))[_0x06f7('0x44')](handleError(_0x449ddb,null));};exports['update']=function(_0x44e755,_0x36ccfd){if(_0x44e755[_0x06f7('0x49')]['id']){delete _0x44e755['body']['id'];}return db[_0x06f7('0x2d')][_0x06f7('0x4d')]({'where':{'id':_0x44e755['params']['id']}})[_0x06f7('0x22')](handleEntityNotFound(_0x36ccfd,null))[_0x06f7('0x22')](saveUpdates(_0x44e755[_0x06f7('0x49')],null))[_0x06f7('0x22')](respondWithResult(_0x36ccfd,null))[_0x06f7('0x44')](handleError(_0x36ccfd,null));};exports[_0x06f7('0x23')]=function(_0x5572a3,_0x2e5f48){return db[_0x06f7('0x2d')][_0x06f7('0x4d')]({'where':{'id':_0x5572a3['params']['id']}})[_0x06f7('0x22')](handleEntityNotFound(_0x2e5f48,null))[_0x06f7('0x22')](removeEntity(_0x2e5f48,null))[_0x06f7('0x44')](handleError(_0x2e5f48,null));};exports['preview']=function(_0x5b9049,_0x154ad4){var _0x5cd840=0xa;var _0x217283=['join',_0x06f7('0x50'),_0x06f7('0x51'),_0x06f7('0x52')];var _0x41518d={'SUM':_0x06f7('0x53'),'COUNT':_0x06f7('0x54'),'COUNT DISTINCT':_0x06f7('0x55'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x06f7('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x06f7('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4f9733={'SEC_TO_TIME':_0x06f7('0x58'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x06f7('0x59'),'UNIX_TIMESTAMP':_0x06f7('0x5a')};var _0x5112b7=function(_0x4b9aae){return!_[_0x06f7('0x5b')]([_0x06f7('0x5c'),_0x06f7('0x5d'),_0x06f7('0x5e'),_0x06f7('0x5f')],_0x4b9aae);};var _0x5666ab=function(_0x17bb46){if(!_0x17bb46||!_0x17bb46[_0x06f7('0x60')][_0x06f7('0x35')]){return'';}for(var _0x38df88='(',_0xfcd92a=0x0;_0xfcd92a<_0x17bb46['rules'][_0x06f7('0x35')];_0xfcd92a+=0x1){_0xfcd92a>0x0&&(_0x38df88+='\x20'+_0x17bb46[_0x06f7('0x61')]+'\x20');_0x38df88+=_0x17bb46[_0x06f7('0x60')][_0xfcd92a]['group']?_0x5666ab(_0x17bb46[_0x06f7('0x60')][_0xfcd92a][_0x06f7('0x62')]):_0x17bb46['rules'][_0xfcd92a]['field']+'\x20'+_0x17bb46[_0x06f7('0x60')][_0xfcd92a][_0x06f7('0x63')]+(_0x5112b7(_0x17bb46[_0x06f7('0x60')][_0xfcd92a][_0x06f7('0x63')])?'\x20'+_0x17bb46[_0x06f7('0x60')][_0xfcd92a]['value']:'');}return _0x38df88+')';};var _0xa43de5={'where':{'id':_0x5b9049['params']['id']}},_0x6113b4,_0x3b6eb1,_0xb6aead,_0x3f86f5,_0x5b364c;_0xa43de5=_[_0x06f7('0x3f')]({},_0xa43de5,_0x5b9049[_0x06f7('0x40')]);return db[_0x06f7('0x2d')][_0x06f7('0x4d')](_0xa43de5)[_0x06f7('0x22')](function(_0x5d0c4a){if(_0x5d0c4a){_0x6113b4=_0x5d0c4a;return _0x5d0c4a['getFields']();}return null;})[_0x06f7('0x22')](function(_0x4cff49){if(_0x4cff49){if(!_0x4cff49[_0x06f7('0x35')]){throw new db[(_0x06f7('0x64'))][(_0x06f7('0x65'))](_0x06f7('0x66'),0x193);}_0x3b6eb1=_0x4cff49;return db[_0x06f7('0x67')]['findAll']({'raw':!![]});}return null;})[_0x06f7('0x22')](function(_0x262237){if(_0x262237){_0xb6aead=_[_0x06f7('0x68')](_0x262237,'id');var _0x3e2be6;var _0x655f62=squel[_0x06f7('0x69')]();_0x655f62[_0x06f7('0x6a')](_0x6113b4['table']);for(var _0x9465c6=0x0;_0x9465c6<_0x3b6eb1[_0x06f7('0x35')];_0x9465c6+=0x1){_0x3e2be6=_0x3b6eb1[_0x9465c6]['MetricId']?_0xb6aead[_0x3b6eb1[_0x9465c6][_0x06f7('0x6b')]][_0x06f7('0x6c')]:_0x3b6eb1[_0x9465c6]['field'];_0x3e2be6=_0x3b6eb1[_0x9465c6][_0x06f7('0x6d')]?_[_0x06f7('0x6e')](_0x41518d[_0x3b6eb1[_0x9465c6]['function']],'%s',_0x3e2be6):_0x3e2be6;_0x3e2be6=_0x3b6eb1[_0x9465c6][_0x06f7('0x6f')]?_['replace'](_0x4f9733[_0x3b6eb1[_0x9465c6][_0x06f7('0x6f')]],'%s',_0x3e2be6):_0x3e2be6;if(_0x3b6eb1[_0x9465c6][_0x06f7('0x70')]){_0x655f62['group'](_0x3e2be6);}_0x3b6eb1[_0x9465c6][_0x06f7('0x71')]&&_0x655f62[_0x06f7('0x72')](_0x3e2be6,_0x3b6eb1[_0x9465c6]['orderBy']===_0x06f7('0x73')?![]:!![]);_0x655f62[_0x06f7('0x74')](_0x3e2be6,_0x3b6eb1[_0x9465c6][_0x06f7('0x75')]||_0x3e2be6);}if(_0x6113b4[_0x06f7('0x76')]){_0x6113b4[_0x06f7('0x76')]=JSON['parse'](_0x6113b4[_0x06f7('0x76')]);for(var _0x187d3e=0x0;_0x187d3e<_0x6113b4[_0x06f7('0x76')][_0x06f7('0x35')];_0x187d3e+=0x1){if(_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x3d')]&&_[_0x06f7('0x5b')](_0x217283,_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x3d')])&&_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x77')]&&_0x6113b4[_0x06f7('0x76')][_0x187d3e]['foreignTable']&&_0x6113b4[_0x06f7('0x76')][_0x187d3e]['foreignKey']){_0x655f62[_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x3d')]](_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x78')],null,util[_0x06f7('0x6f')](_0x06f7('0x79'),_0x6113b4[_0x06f7('0x7a')],_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x77')],_0x6113b4['joins'][_0x187d3e][_0x06f7('0x78')],_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x7b')]));}}}if(_0x6113b4['conditions']){_0x6113b4[_0x06f7('0x7c')]=JSON[_0x06f7('0x7d')](_0x6113b4[_0x06f7('0x7c')]);_0x655f62['where'](_0x5666ab(_0x6113b4[_0x06f7('0x7c')][_0x06f7('0x62')]));}_0x5b364c=_0x655f62[_0x06f7('0x7e')]();_0x655f62[_0x06f7('0x1b')](_0x5cd840);_0x655f62['offset'](0x0);logger[_0x06f7('0x7f')](_0x06f7('0x80'),_0x655f62[_0x06f7('0x81')]());return dbH['sequelize'][_0x06f7('0x2f')](_0x655f62[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')][_0x06f7('0x83')][_0x06f7('0x84')]});}})[_0x06f7('0x22')](respondWithResult(_0x154ad4,null))[_0x06f7('0x44')](handleError(_0x154ad4,null));};function runReport(_0x1c0dbf,_0x5cd68e,_0x169ead){var _0x1bb74d=_0x5cd68e[_0x06f7('0x29')];var _0x38e044=0xa;var _0x46b999=[_0x06f7('0x85'),_0x06f7('0x50'),_0x06f7('0x51'),_0x06f7('0x52')];var _0x3ae88f={'SUM':_0x06f7('0x53'),'COUNT':_0x06f7('0x54'),'COUNT DISTINCT':_0x06f7('0x55'),'MAX':_0x06f7('0x86'),'MIN':_0x06f7('0x87'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x06f7('0x88'),'GROUP_CONCAT ASC':_0x06f7('0x57'),'GROUP_CONCAT DESC':_0x06f7('0x89')};var _0x51f50a={'SEC_TO_TIME':_0x06f7('0x58'),'DATE':_0x06f7('0x8a'),'HOUR':_0x06f7('0x8b'),'ROUND':_0x06f7('0x59'),'UNIX_TIMESTAMP':_0x06f7('0x5a')};var _0x282a3b=function(_0x58150b){return!_[_0x06f7('0x5b')](['IS\x20NULL',_0x06f7('0x5d'),_0x06f7('0x5e'),_0x06f7('0x5f')],_0x58150b);};var _0x1b07e0=function(_0x361c1f){if(!_0x361c1f||!_0x361c1f[_0x06f7('0x60')][_0x06f7('0x35')]){return'';}for(var _0x386aa9='(',_0x44d669=0x0;_0x44d669<_0x361c1f[_0x06f7('0x60')][_0x06f7('0x35')];_0x44d669+=0x1){_0x44d669>0x0&&(_0x386aa9+='\x20'+_0x361c1f[_0x06f7('0x61')]+'\x20');_0x386aa9+=_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x62')]?_0x1b07e0(_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x62')]):_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x74')]+'\x20'+_0x361c1f['rules'][_0x44d669][_0x06f7('0x63')]+(_0x282a3b(_0x361c1f['rules'][_0x44d669]['condition'])?'\x20'+_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x8c')]:'');}return _0x386aa9+')';};var _0x30f1f0={'where':{'id':_0x1c0dbf['id']}},_0x246a1f,_0x502709,_0x469963,_0x361080,_0x1eaa8b;_0x30f1f0=_[_0x06f7('0x3f')]({},_0x30f1f0,_0x169ead);return db['AnalyticCustomReport'][_0x06f7('0x4d')](_0x30f1f0)['then'](function(_0x5b66a4){if(_0x5b66a4){_0x246a1f=_0x5b66a4;return _0x5b66a4[_0x06f7('0x8d')]();}return null;})[_0x06f7('0x22')](function(_0x4e8332){if(_0x4e8332){if(!_0x4e8332[_0x06f7('0x35')]){throw new db[(_0x06f7('0x64'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x502709=_0x4e8332;return db[_0x06f7('0x67')][_0x06f7('0x42')]({'raw':!![]});}return null;})[_0x06f7('0x22')](function(_0x185ad8){if(_0x185ad8){_0x469963=_[_0x06f7('0x68')](_0x185ad8,'id');var _0x528a76;var _0x33bfe8=squel[_0x06f7('0x69')]();_0x33bfe8['from'](_0x246a1f[_0x06f7('0x7a')]);for(var _0x131931=0x0;_0x131931<_0x502709[_0x06f7('0x35')];_0x131931+=0x1){_0x528a76=_0x502709[_0x131931][_0x06f7('0x6b')]?_0x469963[_0x502709[_0x131931]['MetricId']][_0x06f7('0x6c')]:_0x502709[_0x131931][_0x06f7('0x74')];_0x528a76=_0x502709[_0x131931][_0x06f7('0x6d')]?_['replace'](_0x3ae88f[_0x502709[_0x131931][_0x06f7('0x6d')]],'%s',_0x528a76):_0x528a76;_0x528a76=_0x502709[_0x131931]['format']?_['replace'](_0x51f50a[_0x502709[_0x131931][_0x06f7('0x6f')]],'%s',_0x528a76):_0x528a76;if(_0x502709[_0x131931][_0x06f7('0x70')]){_0x33bfe8['group'](_0x528a76);}_0x502709[_0x131931]['orderBy']&&_0x33bfe8[_0x06f7('0x72')](_0x528a76,_0x502709[_0x131931][_0x06f7('0x71')]===_0x06f7('0x73')?![]:!![]);_0x33bfe8[_0x06f7('0x74')](_0x528a76,_0x502709[_0x131931][_0x06f7('0x75')]||_0x528a76);}if(_0x246a1f['joins']){_0x246a1f[_0x06f7('0x76')]=JSON['parse'](_0x246a1f[_0x06f7('0x76')]);for(var _0x486c30=0x0;_0x486c30<_0x246a1f[_0x06f7('0x76')]['length'];_0x486c30+=0x1){if(_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x3d')]&&_[_0x06f7('0x5b')](_0x46b999,_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x3d')])&&_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x77')]&&_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x78')]&&_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x7b')]){_0x33bfe8[_0x246a1f[_0x06f7('0x76')][_0x486c30]['type']](_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x78')],null,util[_0x06f7('0x6f')](_0x06f7('0x79'),_0x246a1f[_0x06f7('0x7a')],_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x77')],_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x78')],_0x246a1f[_0x06f7('0x76')][_0x486c30]['foreignKey']));}}}if(_0x246a1f[_0x06f7('0x7c')]){_0x246a1f['conditions']=JSON['parse'](_0x246a1f['conditions']);_0x33bfe8['where'](_0x1b07e0(_0x246a1f[_0x06f7('0x7c')]['group']));}_0x1eaa8b=_0x33bfe8[_0x06f7('0x7e')]();_0x33bfe8[_0x06f7('0x1b')](_0x38e044);_0x33bfe8[_0x06f7('0x18')](0x0);return;}})[_0x06f7('0x22')](function(){if(_0x5cd68e[_0x06f7('0x8e')]===_0x06f7('0x8f')){return null;}var _0x5acaeb=_['merge'](_0x5cd68e,{'name':_0x5cd68e['fullPath']||_0x5cd68e[_0x06f7('0x29')]||_0x246a1f[_0x06f7('0x29')],'basename':_0x1bb74d,'savename':util[_0x06f7('0x6f')](_0x06f7('0x90'),_0x5cd68e['name']||_0x246a1f[_0x06f7('0x29')],require(_0x06f7('0x91'))[_0x06f7('0x92')](0x4),_0x5cd68e[_0x06f7('0x8e')]||_0x06f7('0x93')),'reportId':_0x246a1f['id'],'reportType':_0x06f7('0x94')});return db[_0x06f7('0x95')][_0x06f7('0x48')](_0x5acaeb,{'raw':!![]});})[_0x06f7('0x22')](function(_0x49e97e){if(_0x246a1f[_0x06f7('0x7a')]===_0x06f7('0x96')){_0x1eaa8b[_0x06f7('0x39')](_0x246a1f[_0x06f7('0x7a')]+_0x06f7('0x97'),_0x5cd68e[_0x06f7('0x98')],_0x5cd68e['endDate']);}else{_0x1eaa8b[_0x06f7('0x39')](_0x246a1f[_0x06f7('0x7a')]+_0x06f7('0x99'),_0x5cd68e[_0x06f7('0x98')],_0x5cd68e[_0x06f7('0x9a')]);}if(_0x49e97e){logger[_0x06f7('0x9b')](_0x06f7('0x9c'),_0x1eaa8b[_0x06f7('0x81')]());require(_0x06f7('0x9d'))[_0x06f7('0x9e')](path['join'](__dirname,_0x06f7('0x9f'),_0x49e97e[_0x06f7('0x8e')]),[_0x49e97e['id'],_0x1eaa8b[_0x06f7('0x81')](),path['join'](__dirname,_0x06f7('0xa0'),_0x49e97e[_0x06f7('0xa1')]),_0x1bb74d]);return _0x49e97e;}else{var _0x2b315f=squel[_0x06f7('0x69')]();_0x2b315f[_0x06f7('0x6a')]('('+_0x1eaa8b['toString']()+')',_0x06f7('0xa2'));_0x2b315f['field'](_0x06f7('0xa3'),_0x06f7('0x1a'));_0x1eaa8b[_0x06f7('0x1b')](_0x5cd68e[_0x06f7('0x1b')]||_0x38e044);_0x1eaa8b[_0x06f7('0x18')](_0x5cd68e[_0x06f7('0x18')]||0x0);return dbH['sequelize'][_0x06f7('0x2f')](_0x2b315f[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')][_0x06f7('0x83')][_0x06f7('0x84')]})['then'](function(_0x1873d3){if(!_0x1873d3[_0x06f7('0x35')]){_0x361080=0x0;}else{_0x361080=_0x1873d3[0x0][_0x06f7('0x1a')]||0x0;}return dbH[_0x06f7('0x82')]['query'](_0x1eaa8b[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')]['QueryTypes'][_0x06f7('0x84')]});})['then'](function(_0x4d82c4){return{'rows':_0x4d82c4||[],'count':_0x361080};});}});}exports[_0x06f7('0xa4')]=function(_0x8ae404,_0x12daf7){return runReport(_0x8ae404[_0x06f7('0xa5')],_0x8ae404[_0x06f7('0x2f')],_0x8ae404[_0x06f7('0x40')])[_0x06f7('0x22')](respondWithResult(_0x12daf7,null))[_0x06f7('0x44')](handleError(_0x12daf7,null));};exports[_0x06f7('0xa6')]=runReport;exports['query']=function(_0x3e2c25,_0x5efe03){var _0x2de4ec=0xa;var _0x21bddb=[_0x06f7('0x85'),_0x06f7('0x50'),_0x06f7('0x51'),_0x06f7('0x52')];var _0x457c31={'SUM':_0x06f7('0x53'),'COUNT':_0x06f7('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x06f7('0x86'),'MIN':'MIN(%s)','AVG':_0x06f7('0x56'),'GROUP_CONCAT':_0x06f7('0x88'),'GROUP_CONCAT ASC':_0x06f7('0x57'),'GROUP_CONCAT DESC':_0x06f7('0x89')};var _0x568888={'SEC_TO_TIME':_0x06f7('0x58'),'DATE':'DATE(%s)','HOUR':_0x06f7('0x8b'),'ROUND':_0x06f7('0x59'),'UNIX_TIMESTAMP':_0x06f7('0x5a')};var _0x4592c7=function(_0x21d1d){return!_[_0x06f7('0x5b')]([_0x06f7('0x5c'),_0x06f7('0x5d'),_0x06f7('0x5e'),_0x06f7('0x5f')],_0x21d1d);};var _0x5cc7a1=function(_0x1ecc4c){if(!_0x1ecc4c||!_0x1ecc4c[_0x06f7('0x60')][_0x06f7('0x35')]){return'';}for(var _0x447abd='(',_0x466a05=0x0;_0x466a05<_0x1ecc4c[_0x06f7('0x60')][_0x06f7('0x35')];_0x466a05+=0x1){_0x466a05>0x0&&(_0x447abd+='\x20'+_0x1ecc4c[_0x06f7('0x61')]+'\x20');_0x447abd+=_0x1ecc4c['rules'][_0x466a05]['group']?_0x5cc7a1(_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x62')]):_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x74')]+'\x20'+_0x1ecc4c['rules'][_0x466a05]['condition']+(_0x4592c7(_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x63')])?'\x20'+_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x8c')]:'');}return _0x447abd+')';};var _0x239735={'where':{'id':_0x3e2c25[_0x06f7('0xa5')]['id']}},_0x2d206f,_0x5bf1be,_0x18c530,_0xa7d33d,_0x501379;_0x239735=_[_0x06f7('0x3f')]({},_0x239735,_0x3e2c25[_0x06f7('0x40')]);return db[_0x06f7('0x2d')]['find'](_0x239735)[_0x06f7('0x22')](function(_0x221bf9){if(_0x221bf9){_0x2d206f=_0x221bf9;return _0x221bf9['getFields']();}return null;})[_0x06f7('0x22')](function(_0x37ef56){if(_0x37ef56){if(!_0x37ef56[_0x06f7('0x35')]){throw new db[(_0x06f7('0x64'))][(_0x06f7('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5bf1be=_0x37ef56;return db[_0x06f7('0x67')][_0x06f7('0x42')]({'raw':!![]});}return null;})[_0x06f7('0x22')](function(_0x4b1ab4){if(_0x4b1ab4){_0x18c530=_['keyBy'](_0x4b1ab4,'id');var _0x4bae37;var _0x4afb22=squel['select']();_0x4afb22[_0x06f7('0x6a')](_0x2d206f['table']);for(var _0x392f04=0x0;_0x392f04<_0x5bf1be[_0x06f7('0x35')];_0x392f04+=0x1){_0x4bae37=_0x5bf1be[_0x392f04][_0x06f7('0x6b')]?_0x18c530[_0x5bf1be[_0x392f04][_0x06f7('0x6b')]][_0x06f7('0x6c')]:_0x5bf1be[_0x392f04][_0x06f7('0x74')];_0x4bae37=_0x5bf1be[_0x392f04][_0x06f7('0x6d')]?_[_0x06f7('0x6e')](_0x457c31[_0x5bf1be[_0x392f04][_0x06f7('0x6d')]],'%s',_0x4bae37):_0x4bae37;_0x4bae37=_0x5bf1be[_0x392f04][_0x06f7('0x6f')]?_['replace'](_0x568888[_0x5bf1be[_0x392f04][_0x06f7('0x6f')]],'%s',_0x4bae37):_0x4bae37;if(_0x5bf1be[_0x392f04][_0x06f7('0x70')]){_0x4afb22['group'](_0x4bae37);}_0x5bf1be[_0x392f04][_0x06f7('0x71')]&&_0x4afb22['order'](_0x4bae37,_0x5bf1be[_0x392f04][_0x06f7('0x71')]===_0x06f7('0x73')?![]:!![]);_0x4afb22[_0x06f7('0x74')](_0x4bae37,_0x5bf1be[_0x392f04][_0x06f7('0x75')]||_0x4bae37);}if(_0x2d206f[_0x06f7('0x76')]){_0x2d206f[_0x06f7('0x76')]=JSON['parse'](_0x2d206f[_0x06f7('0x76')]);for(var _0x47ac66=0x0;_0x47ac66<_0x2d206f[_0x06f7('0x76')][_0x06f7('0x35')];_0x47ac66+=0x1){if(_0x2d206f['joins'][_0x47ac66][_0x06f7('0x3d')]&&_[_0x06f7('0x5b')](_0x21bddb,_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x3d')])&&_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x77')]&&_0x2d206f['joins'][_0x47ac66][_0x06f7('0x78')]&&_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x7b')]){_0x4afb22[_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x3d')]](_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x78')],null,util[_0x06f7('0x6f')](_0x06f7('0x79'),_0x2d206f[_0x06f7('0x7a')],_0x2d206f['joins'][_0x47ac66][_0x06f7('0x77')],_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x78')],_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x7b')]));}}}if(_0x2d206f[_0x06f7('0x7c')]){_0x2d206f['conditions']=JSON[_0x06f7('0x7d')](_0x2d206f[_0x06f7('0x7c')]);_0x4afb22['where'](_0x5cc7a1(_0x2d206f[_0x06f7('0x7c')]['group']));}_0x501379=_0x4afb22['clone']();_0x4afb22[_0x06f7('0x1b')](_0x2de4ec);_0x4afb22[_0x06f7('0x18')](0x0);logger[_0x06f7('0x7f')](_0x06f7('0x80'),_0x4afb22[_0x06f7('0x81')]());return dbH[_0x06f7('0x82')]['query'](_0x4afb22[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')][_0x06f7('0x83')]['SELECT']});}})[_0x06f7('0x22')](function(){return{'sql':_0x501379[_0x06f7('0x81')]()};})[_0x06f7('0x22')](respondWithResult(_0x5efe03,null))[_0x06f7('0x44')](handleError(_0x5efe03,null));};
\ No newline at end of file
+var _0x65c5=['Content-Range','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','group','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','includes','Sequelize','keyBy','from','order','foreignKey','clone','output','web','%s-%s.%s','generate','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','SEC_TO_TIME(%s)','operator','value','groupBy','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','limit','set'];(function(_0x326e79,_0x33dc91){var _0x37eb89=function(_0xbaef25){while(--_0xbaef25){_0x326e79['push'](_0x326e79['shift']());}};_0x37eb89(++_0x33dc91);}(_0x65c5,0x1c5));var _0x565c=function(_0x2c918a,_0x2e9338){_0x2c918a=_0x2c918a-0x0;var _0x43ff87=_0x65c5[_0x2c918a];return _0x43ff87;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x565c('0x0'));var jsonpatch=require(_0x565c('0x1'));var rp=require('request-promise');var moment=require(_0x565c('0x2'));var BPromise=require(_0x565c('0x3'));var Mustache=require(_0x565c('0x4'));var util=require('util');var path=require('path');var sox=require(_0x565c('0x5'));var csv=require(_0x565c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x565c('0x7'));var _=require(_0x565c('0x8'));var squel=require(_0x565c('0x9'));var crypto=require(_0x565c('0xa'));var jsforce=require(_0x565c('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x565c('0xc'));var Papa=require(_0x565c('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x565c('0xe'));var logger=require(_0x565c('0xf'))(_0x565c('0x10'));var utils=require(_0x565c('0x11'));var config=require(_0x565c('0x12'));var licenseUtil=require(_0x565c('0x13'));var db=require('../../mysqldb')['db'];var dbH=require(_0x565c('0x14'))['dbH'];function respondWithStatusCode(_0x438a38,_0x20abd8){_0x20abd8=_0x20abd8||0xcc;return function(_0x3a703b){if(_0x3a703b){return _0x438a38['sendStatus'](_0x20abd8);}return _0x438a38[_0x565c('0x15')](_0x20abd8)['end']();};}function respondWithResult(_0x5be86c,_0x5c1a53){_0x5c1a53=_0x5c1a53||0xc8;return function(_0x32da8d){if(_0x32da8d){return _0x5be86c[_0x565c('0x15')](_0x5c1a53)[_0x565c('0x16')](_0x32da8d);}};}function respondWithFilteredResult(_0x4624d0,_0x544292){return function(_0x491d4c){if(_0x491d4c){var _0x207135=typeof _0x544292[_0x565c('0x17')]==='undefined'&&typeof _0x544292['limit']==='undefined';var _0xc00936=_0x491d4c[_0x565c('0x18')];var _0x42bc0c=_0x207135?0x0:_0x544292[_0x565c('0x17')];var _0x32d6f0=_0x207135?_0x491d4c[_0x565c('0x18')]:_0x544292[_0x565c('0x17')]+_0x544292[_0x565c('0x19')];var _0x469a59;if(_0x32d6f0>=_0xc00936){_0x32d6f0=_0xc00936;_0x469a59=0xc8;}else{_0x469a59=0xce;}_0x4624d0[_0x565c('0x15')](_0x469a59);return _0x4624d0[_0x565c('0x1a')](_0x565c('0x1b'),_0x42bc0c+'-'+_0x32d6f0+'/'+_0xc00936)[_0x565c('0x16')](_0x491d4c);}return null;};}function patchUpdates(_0x358b6f){return function(_0x4d319c){try{jsonpatch[_0x565c('0x1c')](_0x4d319c,_0x358b6f,!![]);}catch(_0x5d38a4){return BPromise[_0x565c('0x1d')](_0x5d38a4);}return _0x4d319c['save']();};}function saveUpdates(_0x263ef4,_0x2e9943){return function(_0x4ce5e7){if(_0x4ce5e7){return _0x4ce5e7[_0x565c('0x1e')](_0x263ef4)[_0x565c('0x1f')](function(_0x1de035){return _0x1de035;});}return null;};}function removeEntity(_0xa0209d,_0xe2ad53){return function(_0x6cc7db){if(_0x6cc7db){return _0x6cc7db[_0x565c('0x20')]()[_0x565c('0x1f')](function(){var _0x5896ea=_0x6cc7db[_0x565c('0x21')]({'plain':!![]});var _0x84224a=_0x565c('0x22');return db[_0x565c('0x23')][_0x565c('0x20')]({'where':{'type':_0x84224a,'resourceId':_0x5896ea['id']}})[_0x565c('0x1f')](function(){return _0x6cc7db;});})[_0x565c('0x1f')](function(){_0xa0209d['status'](0xcc)[_0x565c('0x24')]();});}};}function handleEntityNotFound(_0x3a1064,_0x15e0a8){return function(_0x4dc101){if(!_0x4dc101){_0x3a1064[_0x565c('0x25')](0x194);}return _0x4dc101;};}function handleError(_0x3203a4,_0x4a12f2){_0x4a12f2=_0x4a12f2||0x1f4;return function(_0xc96ece){logger[_0x565c('0x26')](_0xc96ece[_0x565c('0x27')]);if(_0xc96ece['name']){delete _0xc96ece[_0x565c('0x28')];}_0x3203a4[_0x565c('0x15')](_0x4a12f2)[_0x565c('0x29')](_0xc96ece);};}exports[_0x565c('0x2a')]=function(_0x54aefc,_0x30ec79){var _0x1571c3={},_0x194f0d={},_0x465378={'count':0x0,'rows':[]};var _0x24c23b=_[_0x565c('0x2b')](db[_0x565c('0x2c')][_0x565c('0x2d')],function(_0x5cc78e){return{'name':_0x5cc78e[_0x565c('0x2e')],'type':_0x5cc78e['type'][_0x565c('0x2f')]};});_0x194f0d[_0x565c('0x30')]=_[_0x565c('0x2b')](_0x24c23b,'name');_0x194f0d['query']=_[_0x565c('0x31')](_0x54aefc[_0x565c('0x32')]);_0x194f0d[_0x565c('0x33')]=_[_0x565c('0x34')](_0x194f0d['model'],_0x194f0d['query']);_0x1571c3[_0x565c('0x35')]=_[_0x565c('0x34')](_0x194f0d[_0x565c('0x30')],qs[_0x565c('0x36')](_0x54aefc[_0x565c('0x32')][_0x565c('0x36')]));_0x1571c3[_0x565c('0x35')]=_0x1571c3[_0x565c('0x35')]['length']?_0x1571c3[_0x565c('0x35')]:_0x194f0d[_0x565c('0x30')];if(!_0x54aefc['query']['hasOwnProperty'](_0x565c('0x37'))){_0x1571c3[_0x565c('0x19')]=qs[_0x565c('0x19')](_0x54aefc[_0x565c('0x32')]['limit']);_0x1571c3['offset']=qs[_0x565c('0x17')](_0x54aefc['query'][_0x565c('0x17')]);}_0x1571c3['order']=qs['sort'](_0x54aefc[_0x565c('0x32')][_0x565c('0x38')]);_0x1571c3['where']=qs['filters'](_[_0x565c('0x39')](_0x54aefc[_0x565c('0x32')],_0x194f0d[_0x565c('0x33')]),_0x24c23b);if(_0x54aefc[_0x565c('0x32')][_0x565c('0x3a')]){_0x1571c3['where']=_[_0x565c('0x3b')](_0x1571c3[_0x565c('0x3c')],{'$or':_[_0x565c('0x2b')](_0x24c23b,function(_0x38ffcf){if(_0x38ffcf[_0x565c('0x3d')]!==_0x565c('0x3e')){var _0x1d8cf5={};_0x1d8cf5[_0x38ffcf[_0x565c('0x28')]]={'$like':'%'+_0x54aefc[_0x565c('0x32')]['filter']+'%'};return _0x1d8cf5;}})});}_0x1571c3=_['merge']({},_0x1571c3,_0x54aefc[_0x565c('0x3f')]);var _0x44dade={'where':_0x1571c3[_0x565c('0x3c')]};return db['AnalyticCustomReport'][_0x565c('0x18')](_0x44dade)[_0x565c('0x1f')](function(_0x7a6665){_0x465378[_0x565c('0x18')]=_0x7a6665;if(_0x54aefc[_0x565c('0x32')][_0x565c('0x40')]){_0x1571c3[_0x565c('0x41')]=[{'all':!![]}];}return db[_0x565c('0x2c')]['findAll'](_0x1571c3);})[_0x565c('0x1f')](function(_0x2faf19){_0x465378[_0x565c('0x42')]=_0x2faf19;return _0x465378;})[_0x565c('0x1f')](respondWithFilteredResult(_0x30ec79,_0x1571c3))[_0x565c('0x43')](handleError(_0x30ec79,null));};exports[_0x565c('0x44')]=function(_0x2ee727,_0xc9acb2){var _0x13e683={'raw':![],'where':{'id':_0x2ee727[_0x565c('0x45')]['id']}},_0x301b86={};_0x301b86[_0x565c('0x30')]=_[_0x565c('0x31')](db[_0x565c('0x2c')][_0x565c('0x2d')]);_0x301b86[_0x565c('0x32')]=_[_0x565c('0x31')](_0x2ee727[_0x565c('0x32')]);_0x301b86['filters']=_[_0x565c('0x34')](_0x301b86[_0x565c('0x30')],_0x301b86[_0x565c('0x32')]);_0x13e683[_0x565c('0x35')]=_[_0x565c('0x34')](_0x301b86['model'],qs[_0x565c('0x36')](_0x2ee727[_0x565c('0x32')][_0x565c('0x36')]));_0x13e683[_0x565c('0x35')]=_0x13e683[_0x565c('0x35')]['length']?_0x13e683[_0x565c('0x35')]:_0x301b86['model'];if(_0x2ee727[_0x565c('0x32')]['includeAll']){_0x13e683[_0x565c('0x41')]=[{'all':!![]}];}_0x13e683=_[_0x565c('0x3b')]({},_0x13e683,_0x2ee727[_0x565c('0x3f')]);return db[_0x565c('0x2c')][_0x565c('0x46')](_0x13e683)[_0x565c('0x1f')](handleEntityNotFound(_0xc9acb2,null))[_0x565c('0x1f')](respondWithResult(_0xc9acb2,null))[_0x565c('0x43')](handleError(_0xc9acb2,null));};exports['create']=function(_0x2f1d00,_0x422673){return db['AnalyticCustomReport'][_0x565c('0x47')](_0x2f1d00[_0x565c('0x48')],{})['then'](function(_0x50cd0d){var _0x25bfff=_0x2f1d00[_0x565c('0x49')][_0x565c('0x21')]({'plain':!![]});if(!_0x25bfff)throw new Error(_0x565c('0x4a'));if(_0x25bfff[_0x565c('0x4b')]===_0x565c('0x49')){var _0x1260cb=_0x50cd0d[_0x565c('0x21')]({'plain':!![]});var _0x2c94cf='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x2c94cf,'userProfileId':_0x25bfff[_0x565c('0x4c')]},'raw':!![]})[_0x565c('0x1f')](function(_0x45c509){if(_0x45c509&&_0x45c509[_0x565c('0x4d')]===0x0){return db['UserProfileResource'][_0x565c('0x47')]({'name':_0x1260cb[_0x565c('0x28')],'resourceId':_0x1260cb['id'],'type':'CustomReports','sectionId':_0x45c509['id']},{})[_0x565c('0x1f')](function(){return _0x50cd0d;});}else{return _0x50cd0d;}})[_0x565c('0x43')](function(_0x2f42ee){logger[_0x565c('0x26')](_0x565c('0x4e'),_0x2f42ee);throw _0x2f42ee;});}return _0x50cd0d;})['then'](respondWithResult(_0x422673,0xc9))[_0x565c('0x43')](handleError(_0x422673,null));};exports[_0x565c('0x1e')]=function(_0x107118,_0x47d842){if(_0x107118[_0x565c('0x48')]['id']){delete _0x107118[_0x565c('0x48')]['id'];}return db[_0x565c('0x2c')][_0x565c('0x46')]({'where':{'id':_0x107118[_0x565c('0x45')]['id']}})[_0x565c('0x1f')](handleEntityNotFound(_0x47d842,null))['then'](saveUpdates(_0x107118[_0x565c('0x48')],null))[_0x565c('0x1f')](respondWithResult(_0x47d842,null))[_0x565c('0x43')](handleError(_0x47d842,null));};exports[_0x565c('0x20')]=function(_0x518c21,_0x355585){return db[_0x565c('0x2c')][_0x565c('0x46')]({'where':{'id':_0x518c21[_0x565c('0x45')]['id']}})['then'](handleEntityNotFound(_0x355585,null))['then'](removeEntity(_0x355585,null))['catch'](handleError(_0x355585,null));};exports[_0x565c('0x4f')]=function(_0x4ab1cc,_0x250fe6){var _0x2b2f61=0xa;var _0x4d2617=[_0x565c('0x50'),_0x565c('0x51'),_0x565c('0x52'),_0x565c('0x53')];var _0x385b59={'SUM':_0x565c('0x54'),'COUNT':_0x565c('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x565c('0x56'),'MIN':_0x565c('0x57'),'AVG':_0x565c('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x565c('0x59'),'GROUP_CONCAT DESC':_0x565c('0x5a')};var _0x437b20={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x565c('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x565c('0x5c'),'UNIX_TIMESTAMP':_0x565c('0x5d')};var _0x2dfc07=function(_0x1c844e){return!_['includes']([_0x565c('0x5e'),_0x565c('0x5f'),_0x565c('0x60'),_0x565c('0x61')],_0x1c844e);};var _0x598dc9=function(_0xf51b17){if(!_0xf51b17||!_0xf51b17[_0x565c('0x62')][_0x565c('0x63')]){return'';}for(var _0x426755='(',_0x3f6b54=0x0;_0x3f6b54<_0xf51b17[_0x565c('0x62')][_0x565c('0x63')];_0x3f6b54+=0x1){_0x3f6b54>0x0&&(_0x426755+='\x20'+_0xf51b17['operator']+'\x20');_0x426755+=_0xf51b17[_0x565c('0x62')][_0x3f6b54][_0x565c('0x64')]?_0x598dc9(_0xf51b17[_0x565c('0x62')][_0x3f6b54]['group']):_0xf51b17[_0x565c('0x62')][_0x3f6b54]['field']+'\x20'+_0xf51b17[_0x565c('0x62')][_0x3f6b54][_0x565c('0x65')]+(_0x2dfc07(_0xf51b17['rules'][_0x3f6b54]['condition'])?'\x20'+_0xf51b17[_0x565c('0x62')][_0x3f6b54]['value']:'');}return _0x426755+')';};var _0x3b1c12={'where':{'id':_0x4ab1cc[_0x565c('0x45')]['id']}},_0x465016,_0x5c6bf9,_0x3bbb55,_0x1f7859,_0x189a7b;_0x3b1c12=_['merge']({},_0x3b1c12,_0x4ab1cc[_0x565c('0x3f')]);return db[_0x565c('0x2c')][_0x565c('0x46')](_0x3b1c12)[_0x565c('0x1f')](function(_0x2cad56){if(_0x2cad56){_0x465016=_0x2cad56;return _0x2cad56[_0x565c('0x66')]();}return null;})['then'](function(_0x331df5){if(_0x331df5){if(!_0x331df5['length']){throw new db['Sequelize'][(_0x565c('0x67'))](_0x565c('0x68'),0x193);}_0x5c6bf9=_0x331df5;return db[_0x565c('0x69')][_0x565c('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x5bbdde){if(_0x5bbdde){_0x3bbb55=_['keyBy'](_0x5bbdde,'id');var _0x239549;var _0x3c6394=squel[_0x565c('0x6b')]();_0x3c6394['from'](_0x465016[_0x565c('0x6c')]);for(var _0x31495a=0x0;_0x31495a<_0x5c6bf9['length'];_0x31495a+=0x1){_0x239549=_0x5c6bf9[_0x31495a][_0x565c('0x6d')]?_0x3bbb55[_0x5c6bf9[_0x31495a][_0x565c('0x6d')]][_0x565c('0x6e')]:_0x5c6bf9[_0x31495a][_0x565c('0x6f')];_0x239549=_0x5c6bf9[_0x31495a][_0x565c('0x70')]?_[_0x565c('0x71')](_0x385b59[_0x5c6bf9[_0x31495a]['function']],'%s',_0x239549):_0x239549;_0x239549=_0x5c6bf9[_0x31495a][_0x565c('0x72')]?_[_0x565c('0x71')](_0x437b20[_0x5c6bf9[_0x31495a][_0x565c('0x72')]],'%s',_0x239549):_0x239549;if(_0x5c6bf9[_0x31495a]['groupBy']){_0x3c6394[_0x565c('0x64')](_0x239549);}_0x5c6bf9[_0x31495a][_0x565c('0x73')]&&_0x3c6394['order'](_0x239549,_0x5c6bf9[_0x31495a][_0x565c('0x73')]===_0x565c('0x74')?![]:!![]);_0x3c6394['field'](_0x239549,_0x5c6bf9[_0x31495a][_0x565c('0x75')]||_0x239549);}if(_0x465016[_0x565c('0x76')]){_0x465016[_0x565c('0x76')]=JSON[_0x565c('0x77')](_0x465016['joins']);for(var _0x3288e3=0x0;_0x3288e3<_0x465016[_0x565c('0x76')][_0x565c('0x63')];_0x3288e3+=0x1){if(_0x465016[_0x565c('0x76')][_0x3288e3][_0x565c('0x3d')]&&_['includes'](_0x4d2617,_0x465016[_0x565c('0x76')][_0x3288e3]['type'])&&_0x465016[_0x565c('0x76')][_0x3288e3][_0x565c('0x78')]&&_0x465016[_0x565c('0x76')][_0x3288e3][_0x565c('0x79')]&&_0x465016[_0x565c('0x76')][_0x3288e3]['foreignKey']){_0x3c6394[_0x465016['joins'][_0x3288e3][_0x565c('0x3d')]](_0x465016[_0x565c('0x76')][_0x3288e3][_0x565c('0x79')],null,util[_0x565c('0x72')](_0x565c('0x7a'),_0x465016[_0x565c('0x6c')],_0x465016[_0x565c('0x76')][_0x3288e3][_0x565c('0x78')],_0x465016['joins'][_0x3288e3]['foreignTable'],_0x465016['joins'][_0x3288e3]['foreignKey']));}}}if(_0x465016[_0x565c('0x7b')]){_0x465016['conditions']=JSON[_0x565c('0x77')](_0x465016[_0x565c('0x7b')]);_0x3c6394[_0x565c('0x3c')](_0x598dc9(_0x465016[_0x565c('0x7b')][_0x565c('0x64')]));}_0x189a7b=_0x3c6394['clone']();_0x3c6394[_0x565c('0x19')](_0x2b2f61);_0x3c6394[_0x565c('0x17')](0x0);logger[_0x565c('0x7c')](_0x565c('0x7d'),_0x3c6394[_0x565c('0x7e')]());return dbH[_0x565c('0x7f')][_0x565c('0x32')](_0x3c6394[_0x565c('0x7e')](),{'type':dbH[_0x565c('0x7f')][_0x565c('0x80')][_0x565c('0x81')]});}})[_0x565c('0x1f')](respondWithResult(_0x250fe6,null))[_0x565c('0x43')](handleError(_0x250fe6,null));};function runReport(_0x5ee522,_0x36a860,_0x1be7cf){var _0x598f9b=_0x36a860[_0x565c('0x28')];var _0x2dd69e=0xa;var _0x270319=['join',_0x565c('0x51'),'right_join','cross_join'];var _0x8fa186={'SUM':_0x565c('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x565c('0x82'),'MAX':_0x565c('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x565c('0x83'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x21a956={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x565c('0x5b'),'HOUR':_0x565c('0x84'),'ROUND':_0x565c('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x29ef49=function(_0x4ba395){return!_[_0x565c('0x85')](['IS\x20NULL',_0x565c('0x5f'),_0x565c('0x60'),_0x565c('0x61')],_0x4ba395);};var _0x4fe4fc=function(_0x1c1e4a){if(!_0x1c1e4a||!_0x1c1e4a['rules']['length']){return'';}for(var _0x56e344='(',_0x64b33e=0x0;_0x64b33e<_0x1c1e4a[_0x565c('0x62')]['length'];_0x64b33e+=0x1){_0x64b33e>0x0&&(_0x56e344+='\x20'+_0x1c1e4a['operator']+'\x20');_0x56e344+=_0x1c1e4a['rules'][_0x64b33e][_0x565c('0x64')]?_0x4fe4fc(_0x1c1e4a['rules'][_0x64b33e]['group']):_0x1c1e4a[_0x565c('0x62')][_0x64b33e][_0x565c('0x6f')]+'\x20'+_0x1c1e4a[_0x565c('0x62')][_0x64b33e]['condition']+(_0x29ef49(_0x1c1e4a[_0x565c('0x62')][_0x64b33e]['condition'])?'\x20'+_0x1c1e4a[_0x565c('0x62')][_0x64b33e]['value']:'');}return _0x56e344+')';};var _0x3e2b3d={'where':{'id':_0x5ee522['id']}},_0x442281,_0x2bcc3a,_0x223a83,_0x66003d,_0x73b401;_0x3e2b3d=_[_0x565c('0x3b')]({},_0x3e2b3d,_0x1be7cf);return db[_0x565c('0x2c')][_0x565c('0x46')](_0x3e2b3d)[_0x565c('0x1f')](function(_0x15eb84){if(_0x15eb84){_0x442281=_0x15eb84;return _0x15eb84['getFields']();}return null;})[_0x565c('0x1f')](function(_0x1631f9){if(_0x1631f9){if(!_0x1631f9['length']){throw new db[(_0x565c('0x86'))]['ValidationErrorItem'](_0x565c('0x68'),0x193);}_0x2bcc3a=_0x1631f9;return db[_0x565c('0x69')][_0x565c('0x6a')]({'raw':!![]});}return null;})[_0x565c('0x1f')](function(_0x2315f5){if(_0x2315f5){_0x223a83=_[_0x565c('0x87')](_0x2315f5,'id');var _0x6602e2;var _0x3003a8=squel['select']();_0x3003a8[_0x565c('0x88')](_0x442281[_0x565c('0x6c')]);for(var _0x4f6ea4=0x0;_0x4f6ea4<_0x2bcc3a[_0x565c('0x63')];_0x4f6ea4+=0x1){_0x6602e2=_0x2bcc3a[_0x4f6ea4][_0x565c('0x6d')]?_0x223a83[_0x2bcc3a[_0x4f6ea4][_0x565c('0x6d')]][_0x565c('0x6e')]:_0x2bcc3a[_0x4f6ea4][_0x565c('0x6f')];_0x6602e2=_0x2bcc3a[_0x4f6ea4][_0x565c('0x70')]?_['replace'](_0x8fa186[_0x2bcc3a[_0x4f6ea4]['function']],'%s',_0x6602e2):_0x6602e2;_0x6602e2=_0x2bcc3a[_0x4f6ea4][_0x565c('0x72')]?_[_0x565c('0x71')](_0x21a956[_0x2bcc3a[_0x4f6ea4][_0x565c('0x72')]],'%s',_0x6602e2):_0x6602e2;if(_0x2bcc3a[_0x4f6ea4]['groupBy']){_0x3003a8[_0x565c('0x64')](_0x6602e2);}_0x2bcc3a[_0x4f6ea4][_0x565c('0x73')]&&_0x3003a8[_0x565c('0x89')](_0x6602e2,_0x2bcc3a[_0x4f6ea4]['orderBy']===_0x565c('0x74')?![]:!![]);_0x3003a8[_0x565c('0x6f')](_0x6602e2,_0x2bcc3a[_0x4f6ea4][_0x565c('0x75')]||_0x6602e2);}if(_0x442281[_0x565c('0x76')]){_0x442281[_0x565c('0x76')]=JSON[_0x565c('0x77')](_0x442281['joins']);for(var _0x5a5587=0x0;_0x5a5587<_0x442281[_0x565c('0x76')][_0x565c('0x63')];_0x5a5587+=0x1){if(_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x3d')]&&_[_0x565c('0x85')](_0x270319,_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x3d')])&&_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x78')]&&_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x79')]&&_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x8a')]){_0x3003a8[_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x3d')]](_0x442281[_0x565c('0x76')][_0x5a5587]['foreignTable'],null,util[_0x565c('0x72')](_0x565c('0x7a'),_0x442281['table'],_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x78')],_0x442281['joins'][_0x5a5587]['foreignTable'],_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x8a')]));}}}if(_0x442281['conditions']){_0x442281[_0x565c('0x7b')]=JSON[_0x565c('0x77')](_0x442281[_0x565c('0x7b')]);_0x3003a8[_0x565c('0x3c')](_0x4fe4fc(_0x442281[_0x565c('0x7b')]['group']));}_0x73b401=_0x3003a8[_0x565c('0x8b')]();_0x3003a8[_0x565c('0x19')](_0x2dd69e);_0x3003a8[_0x565c('0x17')](0x0);return;}})['then'](function(){if(_0x36a860[_0x565c('0x8c')]===_0x565c('0x8d')){return null;}var _0x460cd3=_[_0x565c('0x3b')](_0x36a860,{'name':_0x36a860['fullPath']||_0x36a860[_0x565c('0x28')]||_0x442281[_0x565c('0x28')],'basename':_0x598f9b,'savename':util['format'](_0x565c('0x8e'),_0x36a860[_0x565c('0x28')]||_0x442281[_0x565c('0x28')],require('randomstring')[_0x565c('0x8f')](0x4),_0x36a860['output']||_0x565c('0x90')),'reportId':_0x442281['id'],'reportType':'custom'});return db[_0x565c('0x91')][_0x565c('0x47')](_0x460cd3,{'raw':!![]});})[_0x565c('0x1f')](function(_0x2fefbd){if(_0x442281[_0x565c('0x6c')]==='cdr'){_0x73b401['where'](_0x442281[_0x565c('0x6c')]+_0x565c('0x92'),_0x36a860[_0x565c('0x93')],_0x36a860[_0x565c('0x94')]);}else{_0x73b401[_0x565c('0x3c')](_0x442281[_0x565c('0x6c')]+_0x565c('0x95'),_0x36a860[_0x565c('0x93')],_0x36a860[_0x565c('0x94')]);}if(_0x2fefbd){logger[_0x565c('0x96')]('Run\x20Query:',_0x73b401[_0x565c('0x7e')]());require('child_process')[_0x565c('0x97')](path['join'](__dirname,_0x565c('0x98'),_0x2fefbd[_0x565c('0x8c')]),[_0x2fefbd['id'],_0x73b401[_0x565c('0x7e')](),path[_0x565c('0x50')](__dirname,_0x565c('0x99'),_0x2fefbd['savename']),_0x598f9b]);return _0x2fefbd;}else{var _0x4c9e39=squel['select']();_0x4c9e39['from']('('+_0x73b401[_0x565c('0x7e')]()+')',_0x565c('0x9a'));_0x4c9e39[_0x565c('0x6f')](_0x565c('0x9b'),_0x565c('0x18'));_0x73b401['limit'](_0x36a860['limit']||_0x2dd69e);_0x73b401[_0x565c('0x17')](_0x36a860['offset']||0x0);return dbH['sequelize'][_0x565c('0x32')](_0x4c9e39['toString'](),{'type':dbH[_0x565c('0x7f')]['QueryTypes'][_0x565c('0x81')]})['then'](function(_0x4e38d7){if(!_0x4e38d7[_0x565c('0x63')]){_0x66003d=0x0;}else{_0x66003d=_0x4e38d7[0x0]['count']||0x0;}return dbH[_0x565c('0x7f')][_0x565c('0x32')](_0x73b401['toString'](),{'type':dbH[_0x565c('0x7f')][_0x565c('0x80')][_0x565c('0x81')]});})[_0x565c('0x1f')](function(_0x459bd4){return{'rows':_0x459bd4||[],'count':_0x66003d};});}});}exports['run']=function(_0x38dd27,_0x21058f){return runReport(_0x38dd27[_0x565c('0x45')],_0x38dd27['query'],_0x38dd27[_0x565c('0x3f')])[_0x565c('0x1f')](respondWithResult(_0x21058f,null))[_0x565c('0x43')](handleError(_0x21058f,null));};exports['runReport']=runReport;exports[_0x565c('0x32')]=function(_0x17db4e,_0x35a84d){var _0x4194a2=0xa;var _0x3076af=['join',_0x565c('0x51'),'right_join',_0x565c('0x53')];var _0x57ba46={'SUM':_0x565c('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x565c('0x82'),'MAX':_0x565c('0x56'),'MIN':_0x565c('0x57'),'AVG':_0x565c('0x58'),'GROUP_CONCAT':_0x565c('0x83'),'GROUP_CONCAT ASC':_0x565c('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x404065={'SEC_TO_TIME':_0x565c('0x9c'),'DATE':_0x565c('0x5b'),'HOUR':_0x565c('0x84'),'ROUND':_0x565c('0x5c'),'UNIX_TIMESTAMP':_0x565c('0x5d')};var _0x3a1bf4=function(_0x133143){return!_[_0x565c('0x85')]([_0x565c('0x5e'),_0x565c('0x5f'),_0x565c('0x60'),'IS\x20NOT\x20EMPTY'],_0x133143);};var _0x20272e=function(_0x128de5){if(!_0x128de5||!_0x128de5['rules'][_0x565c('0x63')]){return'';}for(var _0xb654b5='(',_0xd38e6f=0x0;_0xd38e6f<_0x128de5['rules'][_0x565c('0x63')];_0xd38e6f+=0x1){_0xd38e6f>0x0&&(_0xb654b5+='\x20'+_0x128de5[_0x565c('0x9d')]+'\x20');_0xb654b5+=_0x128de5['rules'][_0xd38e6f][_0x565c('0x64')]?_0x20272e(_0x128de5[_0x565c('0x62')][_0xd38e6f][_0x565c('0x64')]):_0x128de5[_0x565c('0x62')][_0xd38e6f][_0x565c('0x6f')]+'\x20'+_0x128de5[_0x565c('0x62')][_0xd38e6f][_0x565c('0x65')]+(_0x3a1bf4(_0x128de5[_0x565c('0x62')][_0xd38e6f][_0x565c('0x65')])?'\x20'+_0x128de5[_0x565c('0x62')][_0xd38e6f][_0x565c('0x9e')]:'');}return _0xb654b5+')';};var _0x5a2442={'where':{'id':_0x17db4e[_0x565c('0x45')]['id']}},_0x2427de,_0x20dc84,_0x5602ba,_0x53d00e,_0xcbb13d;_0x5a2442=_[_0x565c('0x3b')]({},_0x5a2442,_0x17db4e[_0x565c('0x3f')]);return db[_0x565c('0x2c')]['find'](_0x5a2442)[_0x565c('0x1f')](function(_0x3f2c87){if(_0x3f2c87){_0x2427de=_0x3f2c87;return _0x3f2c87[_0x565c('0x66')]();}return null;})[_0x565c('0x1f')](function(_0x50dad8){if(_0x50dad8){if(!_0x50dad8[_0x565c('0x63')]){throw new db[(_0x565c('0x86'))][(_0x565c('0x67'))](_0x565c('0x68'),0x193);}_0x20dc84=_0x50dad8;return db[_0x565c('0x69')][_0x565c('0x6a')]({'raw':!![]});}return null;})[_0x565c('0x1f')](function(_0x57c008){if(_0x57c008){_0x5602ba=_['keyBy'](_0x57c008,'id');var _0xf8ccc2;var _0x4f75c3=squel[_0x565c('0x6b')]();_0x4f75c3[_0x565c('0x88')](_0x2427de['table']);for(var _0x498005=0x0;_0x498005<_0x20dc84[_0x565c('0x63')];_0x498005+=0x1){_0xf8ccc2=_0x20dc84[_0x498005][_0x565c('0x6d')]?_0x5602ba[_0x20dc84[_0x498005][_0x565c('0x6d')]][_0x565c('0x6e')]:_0x20dc84[_0x498005]['field'];_0xf8ccc2=_0x20dc84[_0x498005]['function']?_[_0x565c('0x71')](_0x57ba46[_0x20dc84[_0x498005][_0x565c('0x70')]],'%s',_0xf8ccc2):_0xf8ccc2;_0xf8ccc2=_0x20dc84[_0x498005][_0x565c('0x72')]?_[_0x565c('0x71')](_0x404065[_0x20dc84[_0x498005][_0x565c('0x72')]],'%s',_0xf8ccc2):_0xf8ccc2;if(_0x20dc84[_0x498005][_0x565c('0x9f')]){_0x4f75c3[_0x565c('0x64')](_0xf8ccc2);}_0x20dc84[_0x498005]['orderBy']&&_0x4f75c3[_0x565c('0x89')](_0xf8ccc2,_0x20dc84[_0x498005][_0x565c('0x73')]===_0x565c('0x74')?![]:!![]);_0x4f75c3[_0x565c('0x6f')](_0xf8ccc2,_0x20dc84[_0x498005][_0x565c('0x75')]||_0xf8ccc2);}if(_0x2427de[_0x565c('0x76')]){_0x2427de[_0x565c('0x76')]=JSON[_0x565c('0x77')](_0x2427de[_0x565c('0x76')]);for(var _0x380d38=0x0;_0x380d38<_0x2427de[_0x565c('0x76')]['length'];_0x380d38+=0x1){if(_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x3d')]&&_[_0x565c('0x85')](_0x3076af,_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x3d')])&&_0x2427de['joins'][_0x380d38][_0x565c('0x78')]&&_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x79')]&&_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x8a')]){_0x4f75c3[_0x2427de['joins'][_0x380d38][_0x565c('0x3d')]](_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x79')],null,util[_0x565c('0x72')](_0x565c('0x7a'),_0x2427de[_0x565c('0x6c')],_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x78')],_0x2427de['joins'][_0x380d38]['foreignTable'],_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x8a')]));}}}if(_0x2427de[_0x565c('0x7b')]){_0x2427de[_0x565c('0x7b')]=JSON['parse'](_0x2427de[_0x565c('0x7b')]);_0x4f75c3[_0x565c('0x3c')](_0x20272e(_0x2427de[_0x565c('0x7b')][_0x565c('0x64')]));}_0xcbb13d=_0x4f75c3[_0x565c('0x8b')]();_0x4f75c3['limit'](_0x4194a2);_0x4f75c3['offset'](0x0);logger[_0x565c('0x7c')](_0x565c('0x7d'),_0x4f75c3[_0x565c('0x7e')]());return dbH['sequelize']['query'](_0x4f75c3[_0x565c('0x7e')](),{'type':dbH[_0x565c('0x7f')][_0x565c('0x80')][_0x565c('0x81')]});}})[_0x565c('0x1f')](function(){return{'sql':_0xcbb13d[_0x565c('0x7e')]()};})[_0x565c('0x1f')](respondWithResult(_0x35a84d,null))['catch'](handleError(_0x35a84d,null));};
\ No newline at end of file
index 7cbed83..8caf665 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28f9=['analytics_custom_reports','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','AnalyticCustomReport'];(function(_0x183964,_0x2dd9ac){var _0x311d8f=function(_0x1b8f9b){while(--_0x1b8f9b){_0x183964['push'](_0x183964['shift']());}};_0x311d8f(++_0x2dd9ac);}(_0x28f9,0x7a));var _0x928f=function(_0x158db6,_0x1ea45d){_0x158db6=_0x158db6-0x0;var _0x200753=_0x28f9[_0x158db6];return _0x200753;};'use strict';var _=require('lodash');var util=require(_0x928f('0x0'));var logger=require(_0x928f('0x1'))(_0x928f('0x2'));var moment=require(_0x928f('0x3'));var BPromise=require(_0x928f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x928f('0x5'));var rimraf=require(_0x928f('0x6'));var config=require(_0x928f('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x928f('0x8')]=function(_0x59794b,_0x1772f3){return _0x59794b['define'](_0x928f('0x9'),attributes,{'tableName':_0x928f('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3a2=['./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x521930,_0x2db99){var _0x340de4=function(_0x4fe715){while(--_0x4fe715){_0x521930['push'](_0x521930['shift']());}};_0x340de4(++_0x2db99);}(_0xf3a2,0xe1));var _0x2f3a=function(_0x1051d8,_0x1996ea){_0x1051d8=_0x1051d8-0x0;var _0x524ed6=_0xf3a2[_0x1051d8];return _0x524ed6;};'use strict';var _=require(_0x2f3a('0x0'));var util=require(_0x2f3a('0x1'));var logger=require('../../config/logger')(_0x2f3a('0x2'));var moment=require(_0x2f3a('0x3'));var BPromise=require(_0x2f3a('0x4'));var rp=require(_0x2f3a('0x5'));var fs=require('fs');var path=require(_0x2f3a('0x6'));var rimraf=require(_0x2f3a('0x7'));var config=require(_0x2f3a('0x8'));var attributes=require(_0x2f3a('0x9'));module[_0x2f3a('0xa')]=function(_0x40d8ee,_0x427d10){return _0x40d8ee[_0x2f3a('0xb')]('AnalyticCustomReport',attributes,{'tableName':_0x2f3a('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b2d78f1..935bb1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6bd=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x206794,_0x26fd02){var _0x38a75b=function(_0x208082){while(--_0x208082){_0x206794['push'](_0x206794['shift']());}};_0x38a75b(++_0x26fd02);}(_0xf6bd,0x7b));var _0xdf6b=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0xf6bd[_0x4a8418];return _0x390174;};'use strict';var _=require('lodash');var util=require(_0xdf6b('0x0'));var moment=require(_0xdf6b('0x1'));var BPromise=require(_0xdf6b('0x2'));var rs=require(_0xdf6b('0x3'));var fs=require('fs');var Redis=require(_0xdf6b('0x4'));var db=require(_0xdf6b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf6b('0x6'))(_0xdf6b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdf6b('0x8')][_0xdf6b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36cbd0,_0x2b31b8,_0x388f1a){return new BPromise(function(_0x1bbbb6,_0x63dc28){return client[_0xdf6b('0xa')](_0x36cbd0,_0x388f1a)[_0xdf6b('0xb')](function(_0x97aee1){logger[_0xdf6b('0xc')](_0xdf6b('0xd'),_0x2b31b8,_0xdf6b('0xe'));logger[_0xdf6b('0xf')](_0xdf6b('0x10'),_0x2b31b8,'request\x20sent',JSON[_0xdf6b('0x11')](_0x97aee1));if(_0x97aee1['error']){if(_0x97aee1[_0xdf6b('0x12')][_0xdf6b('0x13')]===0x1f4){logger[_0xdf6b('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2b31b8,_0x97aee1[_0xdf6b('0x12')][_0xdf6b('0x14')]);return _0x63dc28(_0x97aee1['error'][_0xdf6b('0x14')]);}logger[_0xdf6b('0x12')](_0xdf6b('0xd'),_0x2b31b8,_0x97aee1[_0xdf6b('0x12')]['message']);return _0x1bbbb6(_0x97aee1['error'][_0xdf6b('0x14')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2b31b8,_0xdf6b('0xe'));_0x1bbbb6(_0x97aee1['result']['message']);}})[_0xdf6b('0x15')](function(_0x45bc66){logger[_0xdf6b('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2b31b8,_0x45bc66);_0x63dc28(_0x45bc66);});});}
\ No newline at end of file
+var _0x3a95=['error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0x3a95,0x1bd));var _0x53a9=function(_0x5a01fe,_0xf1fd07){_0x5a01fe=_0x5a01fe-0x0;var _0x68b31e=_0x3a95[_0x5a01fe];return _0x68b31e;};'use strict';var _=require(_0x53a9('0x0'));var util=require('util');var moment=require(_0x53a9('0x1'));var BPromise=require(_0x53a9('0x2'));var rs=require(_0x53a9('0x3'));var fs=require('fs');var Redis=require(_0x53a9('0x4'));var db=require(_0x53a9('0x5'))['db'];var utils=require(_0x53a9('0x6'));var logger=require('../../config/logger')(_0x53a9('0x7'));var config=require(_0x53a9('0x8'));var jayson=require(_0x53a9('0x9'));var client=jayson[_0x53a9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x307624,_0x322a43,_0x1c5497){return new BPromise(function(_0x9f5294,_0x41e596){return client[_0x53a9('0xb')](_0x307624,_0x1c5497)[_0x53a9('0xc')](function(_0x5bc51f){logger[_0x53a9('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x322a43,_0x53a9('0xe'));logger[_0x53a9('0xf')](_0x53a9('0x10'),_0x322a43,_0x53a9('0xe'),JSON['stringify'](_0x5bc51f));if(_0x5bc51f[_0x53a9('0x11')]){if(_0x5bc51f[_0x53a9('0x11')][_0x53a9('0x12')]===0x1f4){logger[_0x53a9('0x11')](_0x53a9('0x13'),_0x322a43,_0x5bc51f[_0x53a9('0x11')]['message']);return _0x41e596(_0x5bc51f['error'][_0x53a9('0x14')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x322a43,_0x5bc51f[_0x53a9('0x11')]['message']);return _0x9f5294(_0x5bc51f[_0x53a9('0x11')]['message']);}else{logger[_0x53a9('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x322a43,'request\x20sent');_0x9f5294(_0x5bc51f[_0x53a9('0x15')]['message']);}})['catch'](function(_0x4cb270){logger[_0x53a9('0x11')](_0x53a9('0x13'),_0x322a43,_0x4cb270);_0x41e596(_0x4cb270);});});}
\ No newline at end of file
index 82cd0f6..5537bb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cc8=['/:id','get','/:id/preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index'];(function(_0x4030ee,_0x41fadd){var _0x27f309=function(_0x506771){while(--_0x506771){_0x4030ee['push'](_0x4030ee['shift']());}};_0x27f309(++_0x41fadd);}(_0x4cc8,0x157));var _0x84cc=function(_0x178ddb,_0x44c400){_0x178ddb=_0x178ddb-0x0;var _0x12ce4c=_0x4cc8[_0x178ddb];return _0x12ce4c;};'use strict';var multer=require(_0x84cc('0x0'));var util=require(_0x84cc('0x1'));var path=require(_0x84cc('0x2'));var timeout=require(_0x84cc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x84cc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x84cc('0x5'));var controller=require(_0x84cc('0x6'));router['get']('/',auth[_0x84cc('0x7')](),controller[_0x84cc('0x8')]);router['get'](_0x84cc('0x9'),auth[_0x84cc('0x7')](),controller['show']);router[_0x84cc('0xa')](_0x84cc('0xb'),auth[_0x84cc('0x7')](),controller['preview']);router[_0x84cc('0xa')](_0x84cc('0xc'),auth[_0x84cc('0x7')](),controller[_0x84cc('0xd')]);router[_0x84cc('0xa')](_0x84cc('0xe'),auth[_0x84cc('0x7')](),controller[_0x84cc('0xf')]);router['post']('/',auth[_0x84cc('0x7')](),controller[_0x84cc('0x10')]);router[_0x84cc('0x11')](_0x84cc('0x9'),auth[_0x84cc('0x7')](),controller[_0x84cc('0x12')]);router[_0x84cc('0x13')](_0x84cc('0x9'),auth[_0x84cc('0x7')](),controller[_0x84cc('0x14')]);module[_0x84cc('0x15')]=router;
\ No newline at end of file
+var _0x52f1=['/:id/preview','preview','run','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id'];(function(_0xe6569c,_0x2e94cc){var _0x2157b0=function(_0x10c4af){while(--_0x10c4af){_0xe6569c['push'](_0xe6569c['shift']());}};_0x2157b0(++_0x2e94cc);}(_0x52f1,0x7c));var _0x152f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x52f1[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x152f('0x0'));var util=require(_0x152f('0x1'));var path=require(_0x152f('0x2'));var timeout=require(_0x152f('0x3'));var express=require(_0x152f('0x4'));var router=express[_0x152f('0x5')]();var fs_extra=require(_0x152f('0x6'));var auth=require(_0x152f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x152f('0x8'));var controller=require(_0x152f('0x9'));router['get']('/',auth[_0x152f('0xa')](),controller[_0x152f('0xb')]);router[_0x152f('0xc')](_0x152f('0xd'),auth[_0x152f('0xa')](),controller['show']);router[_0x152f('0xc')](_0x152f('0xe'),auth[_0x152f('0xa')](),controller[_0x152f('0xf')]);router['get']('/:id/run',auth[_0x152f('0xa')](),controller[_0x152f('0x10')]);router['get']('/:id/query',auth[_0x152f('0xa')](),controller['query']);router[_0x152f('0x11')]('/',auth['isAuthenticated'](),controller[_0x152f('0x12')]);router[_0x152f('0x13')]('/:id',auth[_0x152f('0xa')](),controller[_0x152f('0x14')]);router['delete'](_0x152f('0xd'),auth[_0x152f('0xa')](),controller[_0x152f('0x15')]);module[_0x152f('0x16')]=router;
\ No newline at end of file
index 4b89ece..adc94db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7da7,0x10d));var _0x77da=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x7da7[_0x3c4062];return _0x3f5bf3;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7217=['sequelize','STRING','TEXT'];(function(_0x506463,_0x1bacf7){var _0x67756f=function(_0x6d012a){while(--_0x6d012a){_0x506463['push'](_0x506463['shift']());}};_0x67756f(++_0x1bacf7);}(_0x7217,0x19e));var _0x7721=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x7217[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 4c4c1fa..e6ebdac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,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(_0x16ca39,_0x15abe3){var _0x5413d3=function(_0x17545f){while(--_0x17545f){_0x16ca39['push'](_0x16ca39['shift']());}};_0x5413d3(++_0x15abe3);}(_0xf494,0x1c6));var _0x4f49=function(_0x18455e,_0x19992e){_0x18455e=_0x18455e-0x0;var _0x3553bf=_0xf494[_0x18455e];return _0x3553bf;};'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 bbc4632..334c46a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdf0=['bluebird','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','api','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xbdf0,0x15b));var _0x0bdf=function(_0x18cfc7,_0x27371b){_0x18cfc7=_0x18cfc7-0x0;var _0x3d0e73=_0xbdf0[_0x18cfc7];return _0x3d0e73;};'use strict';var _=require(_0x0bdf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0bdf('0x1'));var moment=require(_0x0bdf('0x2'));var BPromise=require(_0x0bdf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0bdf('0x4'));var rimraf=require('rimraf');var config=require(_0x0bdf('0x5'));var attributes=require(_0x0bdf('0x6'));module[_0x0bdf('0x7')]=function(_0x49fa94,_0x4a4c72){return _0x49fa94[_0x0bdf('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x0bdf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x411b=['../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0x4195aa,_0x5be549){var _0x44b99e=function(_0xc827fc){while(--_0xc827fc){_0x4195aa['push'](_0x4195aa['shift']());}};_0x44b99e(++_0x5be549);}(_0x411b,0xcb));var _0xb411=function(_0x381e8f,_0x5dc623){_0x381e8f=_0x381e8f-0x0;var _0x3b84e5=_0x411b[_0x381e8f];return _0x3b84e5;};'use strict';var _=require(_0xb411('0x0'));var util=require(_0xb411('0x1'));var logger=require('../../config/logger')(_0xb411('0x2'));var moment=require('moment');var BPromise=require(_0xb411('0x3'));var rp=require(_0xb411('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb411('0x5'));var config=require(_0xb411('0x6'));var attributes=require(_0xb411('0x7'));module[_0xb411('0x8')]=function(_0x20c7bc,_0x36146a){return _0x20c7bc[_0xb411('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0xb411('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 57f9b09..e62458c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31d9=['stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0x31d9,0x1d4));var _0x931d=function(_0x48795e,_0x46c47d){_0x48795e=_0x48795e-0x0;var _0xeed653=_0x31d9[_0x48795e];return _0xeed653;};'use strict';var _=require(_0x931d('0x0'));var util=require(_0x931d('0x1'));var moment=require(_0x931d('0x2'));var BPromise=require(_0x931d('0x3'));var rs=require(_0x931d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x931d('0x5'));var logger=require(_0x931d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x931d('0x7'));var client=jayson[_0x931d('0x8')][_0x931d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x95c99c,_0x101c36,_0x5878df){return new BPromise(function(_0x530efe,_0x34e66d){return client[_0x931d('0xa')](_0x95c99c,_0x5878df)[_0x931d('0xb')](function(_0x3a24eb){logger[_0x931d('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x101c36,_0x931d('0xd'));logger['debug'](_0x931d('0xe'),_0x101c36,_0x931d('0xd'),JSON[_0x931d('0xf')](_0x3a24eb));if(_0x3a24eb[_0x931d('0x10')]){if(_0x3a24eb[_0x931d('0x10')][_0x931d('0x11')]===0x1f4){logger['error'](_0x931d('0x12'),_0x101c36,_0x3a24eb[_0x931d('0x10')]['message']);return _0x34e66d(_0x3a24eb[_0x931d('0x10')][_0x931d('0x13')]);}logger[_0x931d('0x10')](_0x931d('0x12'),_0x101c36,_0x3a24eb['error'][_0x931d('0x13')]);return _0x530efe(_0x3a24eb[_0x931d('0x10')][_0x931d('0x13')]);}else{logger['info'](_0x931d('0x12'),_0x101c36,_0x931d('0xd'));_0x530efe(_0x3a24eb[_0x931d('0x14')][_0x931d('0x13')]);}})['catch'](function(_0x1a50d5){logger[_0x931d('0x10')](_0x931d('0x12'),_0x101c36,_0x1a50d5);_0x34e66d(_0x1a50d5);});});}
\ No newline at end of file
+var _0x75ed=['info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x36a957,_0x238eb5){var _0x2a1fae=function(_0x1d99ac){while(--_0x1d99ac){_0x36a957['push'](_0x36a957['shift']());}};_0x2a1fae(++_0x238eb5);}(_0x75ed,0xaa));var _0xd75e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x75ed[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xd75e('0x0'));var moment=require('moment');var BPromise=require(_0xd75e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd75e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd75e('0x3'));var logger=require(_0xd75e('0x4'))(_0xd75e('0x5'));var config=require(_0xd75e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd75e('0x7')][_0xd75e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x124199,_0x7bc86b,_0x5823fe){return new BPromise(function(_0x120d8a,_0x100f9a){return client[_0xd75e('0x9')](_0x124199,_0x5823fe)['then'](function(_0x4862cc){logger[_0xd75e('0xa')](_0xd75e('0xb'),_0x7bc86b,_0xd75e('0xc'));logger[_0xd75e('0xd')](_0xd75e('0xe'),_0x7bc86b,_0xd75e('0xc'),JSON['stringify'](_0x4862cc));if(_0x4862cc[_0xd75e('0xf')]){if(_0x4862cc[_0xd75e('0xf')][_0xd75e('0x10')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x7bc86b,_0x4862cc[_0xd75e('0xf')][_0xd75e('0x11')]);return _0x100f9a(_0x4862cc[_0xd75e('0xf')][_0xd75e('0x11')]);}logger['error'](_0xd75e('0xb'),_0x7bc86b,_0x4862cc['error'][_0xd75e('0x11')]);return _0x120d8a(_0x4862cc[_0xd75e('0xf')][_0xd75e('0x11')]);}else{logger[_0xd75e('0xa')](_0xd75e('0xb'),_0x7bc86b,'request\x20sent');_0x120d8a(_0x4862cc[_0xd75e('0x12')][_0xd75e('0x11')]);}})[_0xd75e('0x13')](function(_0xc0bd9d){logger[_0xd75e('0xf')](_0xd75e('0xb'),_0x7bc86b,_0xc0bd9d);_0x100f9a(_0xc0bd9d);});});}
\ No newline at end of file
index 9c6bcf2..bf4ebc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3311=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','run','/:id/query','post','create','put','update','delete','destroy','exports'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x3311,0x1d4));var _0x1331=function(_0x2c9841,_0x1a7e07){_0x2c9841=_0x2c9841-0x0;var _0x4f5641=_0x3311[_0x2c9841];return _0x4f5641;};'use strict';var multer=require(_0x1331('0x0'));var util=require(_0x1331('0x1'));var path=require(_0x1331('0x2'));var timeout=require(_0x1331('0x3'));var express=require(_0x1331('0x4'));var router=express[_0x1331('0x5')]();var fs_extra=require(_0x1331('0x6'));var auth=require(_0x1331('0x7'));var interaction=require(_0x1331('0x8'));var config=require(_0x1331('0x9'));var controller=require(_0x1331('0xa'));router[_0x1331('0xb')]('/',auth[_0x1331('0xc')](),controller[_0x1331('0xd')]);router[_0x1331('0xb')](_0x1331('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x1331('0xb')](_0x1331('0xf'),auth[_0x1331('0xc')](),controller[_0x1331('0x10')]);router[_0x1331('0xb')]('/:id/run',auth[_0x1331('0xc')](),controller[_0x1331('0x11')]);router[_0x1331('0xb')](_0x1331('0x12'),auth[_0x1331('0xc')](),controller['query']);router[_0x1331('0x13')]('/',auth['isAuthenticated'](),controller[_0x1331('0x14')]);router[_0x1331('0x15')](_0x1331('0xe'),auth[_0x1331('0xc')](),controller[_0x1331('0x16')]);router[_0x1331('0x17')](_0x1331('0xe'),auth['isAuthenticated'](),controller[_0x1331('0x18')]);module[_0x1331('0x19')]=router;
\ No newline at end of file
+var _0xef27=['/:id','show','/:id/preview','preview','/:id/run','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x2be6d1,_0x3d31c9){var _0x19847a=function(_0x435507){while(--_0x435507){_0x2be6d1['push'](_0x2be6d1['shift']());}};_0x19847a(++_0x3d31c9);}(_0xef27,0x1c2));var _0x7ef2=function(_0x392cf9,_0x48512f){_0x392cf9=_0x392cf9-0x0;var _0x2ee970=_0xef27[_0x392cf9];return _0x2ee970;};'use strict';var multer=require(_0x7ef2('0x0'));var util=require(_0x7ef2('0x1'));var path=require(_0x7ef2('0x2'));var timeout=require(_0x7ef2('0x3'));var express=require('express');var router=express[_0x7ef2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7ef2('0x5'));var controller=require(_0x7ef2('0x6'));router[_0x7ef2('0x7')]('/',auth[_0x7ef2('0x8')](),controller[_0x7ef2('0x9')]);router[_0x7ef2('0x7')](_0x7ef2('0xa'),auth[_0x7ef2('0x8')](),controller[_0x7ef2('0xb')]);router[_0x7ef2('0x7')](_0x7ef2('0xc'),auth[_0x7ef2('0x8')](),controller[_0x7ef2('0xd')]);router[_0x7ef2('0x7')](_0x7ef2('0xe'),auth[_0x7ef2('0x8')](),controller['run']);router[_0x7ef2('0x7')]('/:id/query',auth[_0x7ef2('0x8')](),controller['query']);router['post']('/',auth[_0x7ef2('0x8')](),controller[_0x7ef2('0xf')]);router['put'](_0x7ef2('0xa'),auth[_0x7ef2('0x8')](),controller[_0x7ef2('0x10')]);router[_0x7ef2('0x11')]('/:id',auth[_0x7ef2('0x8')](),controller[_0x7ef2('0x12')]);module[_0x7ef2('0x13')]=router;
\ No newline at end of file
index 19791f1..50c42bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e14=['xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf'];(function(_0x5e6352,_0x3232f5){var _0x1e6f46=function(_0x4f2729){while(--_0x4f2729){_0x5e6352['push'](_0x5e6352['shift']());}};_0x1e6f46(++_0x3232f5);}(_0x2e14,0x77));var _0x42e1=function(_0x3356c5,_0x20a150){_0x3356c5=_0x3356c5-0x0;var _0x556859=_0x2e14[_0x3356c5];return _0x556859;};'use strict';var Sequelize=require(_0x42e1('0x0'));var moment=require(_0x42e1('0x1'));module[_0x42e1('0x2')]={'name':{'type':Sequelize[_0x42e1('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x42e1('0x4')](_0x42e1('0x5'),_0x42e1('0x6'),_0x42e1('0x7')),'allowNull':![],'defaultValue':_0x42e1('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x42e1('0x8')]},'endDate':{'type':Sequelize[_0x42e1('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x42e1('0x9')},'type':{'type':Sequelize[_0x42e1('0x4')](_0x42e1('0xa'),_0x42e1('0xb')),'allowNull':![],'defaultValue':_0x42e1('0xa')},'reportId':{'type':Sequelize[_0x42e1('0xc')](0xb)[_0x42e1('0xd')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6bf9=['pdf','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv'];(function(_0xd9abae,_0x5172db){var _0x2a1b13=function(_0x2f2e13){while(--_0x2f2e13){_0xd9abae['push'](_0xd9abae['shift']());}};_0x2a1b13(++_0x5172db);}(_0x6bf9,0x1db));var _0x96bf=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x6bf9[_0x4b73a2];return _0x383c66;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x96bf('0x0'));module[_0x96bf('0x1')]={'name':{'type':Sequelize[_0x96bf('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x96bf('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x96bf('0x3')](_0x96bf('0x4'),_0x96bf('0x5'),_0x96bf('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x96bf('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x96bf('0x7')]},'endDate':{'type':Sequelize[_0x96bf('0x7')]},'status':{'type':Sequelize[_0x96bf('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x96bf('0x8'),_0x96bf('0x9')),'allowNull':![],'defaultValue':_0x96bf('0x8')},'reportId':{'type':Sequelize[_0x96bf('0xa')](0xb)[_0x96bf('0xb')]},'reportType':{'type':Sequelize[_0x96bf('0x2')]}};
\ No newline at end of file
index bb9c873..199b423 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfe8=['exists','format','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','get','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','keys','find','catch','create','body','user','role','ExtractedReports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','existsSync','join','root','server/files/reports','ValidationError'];(function(_0x5598ed,_0x366268){var _0x5368a4=function(_0x308473){while(--_0x308473){_0x5598ed['push'](_0x5598ed['shift']());}};_0x5368a4(++_0x366268);}(_0xdfe8,0x66));var _0x8dfe=function(_0x77d286,_0x1ddc6d){_0x77d286=_0x77d286-0x0;var _0x5446a5=_0xdfe8[_0x77d286];return _0x5446a5;};'use strict';var emlformat=require(_0x8dfe('0x0'));var rimraf=require(_0x8dfe('0x1'));var zipdir=require(_0x8dfe('0x2'));var jsonpatch=require(_0x8dfe('0x3'));var rp=require(_0x8dfe('0x4'));var moment=require(_0x8dfe('0x5'));var BPromise=require(_0x8dfe('0x6'));var Mustache=require(_0x8dfe('0x7'));var util=require(_0x8dfe('0x8'));var path=require(_0x8dfe('0x9'));var sox=require('sox');var csv=require(_0x8dfe('0xa'));var ejs=require(_0x8dfe('0xb'));var fs=require('fs');var fs_extra=require(_0x8dfe('0xc'));var _=require('lodash');var squel=require(_0x8dfe('0xd'));var crypto=require(_0x8dfe('0xe'));var jsforce=require(_0x8dfe('0xf'));var deskjs=require(_0x8dfe('0x10'));var toCsv=require(_0x8dfe('0xa'));var querystring=require(_0x8dfe('0x11'));var Papa=require(_0x8dfe('0x12'));var Redis=require('ioredis');var authService=require(_0x8dfe('0x13'));var qs=require(_0x8dfe('0x14'));var as=require(_0x8dfe('0x15'));var hardwareService=require(_0x8dfe('0x16'));var logger=require(_0x8dfe('0x17'))(_0x8dfe('0x18'));var utils=require(_0x8dfe('0x19'));var config=require(_0x8dfe('0x1a'));var licenseUtil=require(_0x8dfe('0x1b'));var db=require(_0x8dfe('0x1c'))['db'];function respondWithStatusCode(_0x3304e5,_0x5aa0b8){_0x5aa0b8=_0x5aa0b8||0xcc;return function(_0x45d203){if(_0x45d203){return _0x3304e5[_0x8dfe('0x1d')](_0x5aa0b8);}return _0x3304e5['status'](_0x5aa0b8)[_0x8dfe('0x1e')]();};}function respondWithResult(_0x2da34a,_0x1e9898){_0x1e9898=_0x1e9898||0xc8;return function(_0x4f1142){if(_0x4f1142){return _0x2da34a[_0x8dfe('0x1f')](_0x1e9898)[_0x8dfe('0x20')](_0x4f1142);}};}function respondWithFilteredResult(_0x194071,_0x164337){return function(_0x146846){if(_0x146846){var _0x3b8f5a=typeof _0x164337['offset']===_0x8dfe('0x21')&&typeof _0x164337[_0x8dfe('0x22')]===_0x8dfe('0x21');var _0x2ee5a1=_0x146846['count'];var _0x2b61ba=_0x3b8f5a?0x0:_0x164337[_0x8dfe('0x23')];var _0xc6d867=_0x3b8f5a?_0x146846[_0x8dfe('0x24')]:_0x164337[_0x8dfe('0x23')]+_0x164337[_0x8dfe('0x22')];var _0x2aad52;if(_0xc6d867>=_0x2ee5a1){_0xc6d867=_0x2ee5a1;_0x2aad52=0xc8;}else{_0x2aad52=0xce;}_0x194071['status'](_0x2aad52);return _0x194071[_0x8dfe('0x25')](_0x8dfe('0x26'),_0x2b61ba+'-'+_0xc6d867+'/'+_0x2ee5a1)['json'](_0x146846);}return null;};}function patchUpdates(_0xaa9b2f){return function(_0x5b33a0){try{jsonpatch[_0x8dfe('0x27')](_0x5b33a0,_0xaa9b2f,!![]);}catch(_0x2aeb06){return BPromise['reject'](_0x2aeb06);}return _0x5b33a0[_0x8dfe('0x28')]();};}function saveUpdates(_0x19c20a,_0x13f561){return function(_0x57b5d9){if(_0x57b5d9){return _0x57b5d9[_0x8dfe('0x29')](_0x19c20a)['then'](function(_0x54a31e){return _0x54a31e;});}return null;};}function removeEntity(_0x50b245,_0x2cb868){return function(_0x3c1694){if(_0x3c1694){return _0x3c1694[_0x8dfe('0x2a')]()[_0x8dfe('0x2b')](function(){var _0x576cef=_0x3c1694[_0x8dfe('0x2c')]({'plain':!![]});var _0x5098b8='ExtractedReports';return db[_0x8dfe('0x2d')]['destroy']({'where':{'type':_0x5098b8,'resourceId':_0x576cef['id']}})['then'](function(){return _0x3c1694;});})['then'](function(){_0x50b245['status'](0xcc)[_0x8dfe('0x1e')]();});}};}function handleEntityNotFound(_0x9a507d,_0x1e4d05){return function(_0x4f1859){if(!_0x4f1859){_0x9a507d[_0x8dfe('0x1d')](0x194);}return _0x4f1859;};}function handleError(_0x21ea6c,_0x50da9f){_0x50da9f=_0x50da9f||0x1f4;return function(_0x51d892){logger[_0x8dfe('0x2e')](_0x51d892['stack']);if(_0x51d892['name']){delete _0x51d892[_0x8dfe('0x2f')];}_0x21ea6c[_0x8dfe('0x1f')](_0x50da9f)[_0x8dfe('0x30')](_0x51d892);};}exports[_0x8dfe('0x31')]=function(_0x57e48a,_0x567ffa){var _0x37e59b={},_0x390068={},_0xdb23ab={'count':0x0,'rows':[]};var _0x448717=_[_0x8dfe('0x32')](db[_0x8dfe('0x33')][_0x8dfe('0x34')],function(_0x46d250){return{'name':_0x46d250[_0x8dfe('0x35')],'type':_0x46d250[_0x8dfe('0x36')][_0x8dfe('0x37')]};});_0x390068[_0x8dfe('0x38')]=_[_0x8dfe('0x32')](_0x448717,'name');_0x390068[_0x8dfe('0x39')]=_['keys'](_0x57e48a[_0x8dfe('0x39')]);_0x390068[_0x8dfe('0x3a')]=_['intersection'](_0x390068[_0x8dfe('0x38')],_0x390068[_0x8dfe('0x39')]);_0x37e59b[_0x8dfe('0x3b')]=_[_0x8dfe('0x3c')](_0x390068[_0x8dfe('0x38')],qs[_0x8dfe('0x3d')](_0x57e48a[_0x8dfe('0x39')]['fields']));_0x37e59b['attributes']=_0x37e59b[_0x8dfe('0x3b')][_0x8dfe('0x3e')]?_0x37e59b[_0x8dfe('0x3b')]:_0x390068[_0x8dfe('0x38')];if(!_0x57e48a['query'][_0x8dfe('0x3f')](_0x8dfe('0x40'))){_0x37e59b['limit']=qs[_0x8dfe('0x22')](_0x57e48a[_0x8dfe('0x39')][_0x8dfe('0x22')]);_0x37e59b[_0x8dfe('0x23')]=qs[_0x8dfe('0x23')](_0x57e48a[_0x8dfe('0x39')][_0x8dfe('0x23')]);}_0x37e59b['order']=qs['sort'](_0x57e48a[_0x8dfe('0x39')]['sort']);_0x37e59b['where']=qs[_0x8dfe('0x3a')](_[_0x8dfe('0x41')](_0x57e48a[_0x8dfe('0x39')],_0x390068[_0x8dfe('0x3a')]),_0x448717);if(_0x57e48a[_0x8dfe('0x39')][_0x8dfe('0x42')]){_0x37e59b[_0x8dfe('0x43')]=_[_0x8dfe('0x44')](_0x37e59b[_0x8dfe('0x43')],{'$or':_['map'](_0x448717,function(_0x134959){if(_0x134959['type']!==_0x8dfe('0x45')){var _0x3e956b={};_0x3e956b[_0x134959[_0x8dfe('0x2f')]]={'$like':'%'+_0x57e48a['query']['filter']+'%'};return _0x3e956b;}})});}_0x37e59b=_[_0x8dfe('0x44')]({},_0x37e59b,_0x57e48a[_0x8dfe('0x46')]);var _0x153510={'where':_0x37e59b['where']};return db['AnalyticExtractedReport'][_0x8dfe('0x24')](_0x153510)[_0x8dfe('0x2b')](function(_0x1aacaf){_0xdb23ab[_0x8dfe('0x24')]=_0x1aacaf;if(_0x57e48a['query'][_0x8dfe('0x47')]){_0x37e59b[_0x8dfe('0x48')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x37e59b);})[_0x8dfe('0x2b')](function(_0xac7a89){_0xdb23ab[_0x8dfe('0x49')]=_0xac7a89;return _0xdb23ab;})[_0x8dfe('0x2b')](respondWithFilteredResult(_0x567ffa,_0x37e59b))['catch'](handleError(_0x567ffa,null));};exports['show']=function(_0x1233e9,_0x148a3b){var _0xde276={'raw':!![],'where':{'id':_0x1233e9['params']['id']}},_0x48323c={};_0x48323c['model']=_[_0x8dfe('0x4a')](db[_0x8dfe('0x33')]['rawAttributes']);_0x48323c[_0x8dfe('0x39')]=_[_0x8dfe('0x4a')](_0x1233e9[_0x8dfe('0x39')]);_0x48323c[_0x8dfe('0x3a')]=_[_0x8dfe('0x3c')](_0x48323c[_0x8dfe('0x38')],_0x48323c['query']);_0xde276['attributes']=_[_0x8dfe('0x3c')](_0x48323c['model'],qs[_0x8dfe('0x3d')](_0x1233e9[_0x8dfe('0x39')][_0x8dfe('0x3d')]));_0xde276[_0x8dfe('0x3b')]=_0xde276[_0x8dfe('0x3b')][_0x8dfe('0x3e')]?_0xde276[_0x8dfe('0x3b')]:_0x48323c['model'];if(_0x1233e9[_0x8dfe('0x39')][_0x8dfe('0x47')]){_0xde276[_0x8dfe('0x48')]=[{'all':!![]}];}_0xde276=_['merge']({},_0xde276,_0x1233e9[_0x8dfe('0x46')]);return db[_0x8dfe('0x33')][_0x8dfe('0x4b')](_0xde276)[_0x8dfe('0x2b')](handleEntityNotFound(_0x148a3b,null))[_0x8dfe('0x2b')](respondWithResult(_0x148a3b,null))[_0x8dfe('0x4c')](handleError(_0x148a3b,null));};exports[_0x8dfe('0x4d')]=function(_0x22ab6f,_0x2b5390){return db[_0x8dfe('0x33')][_0x8dfe('0x4d')](_0x22ab6f[_0x8dfe('0x4e')],{})[_0x8dfe('0x2b')](function(_0x2d5990){var _0x3210cd=_0x22ab6f[_0x8dfe('0x4f')]['get']({'plain':!![]});if(!_0x3210cd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3210cd[_0x8dfe('0x50')]==='user'){var _0x3c41fb=_0x2d5990['get']({'plain':!![]});var _0x17070d=_0x8dfe('0x51');return db[_0x8dfe('0x52')][_0x8dfe('0x4b')]({'where':{'name':_0x17070d,'userProfileId':_0x3210cd['userProfileId']},'raw':!![]})[_0x8dfe('0x2b')](function(_0x373d98){if(_0x373d98&&_0x373d98[_0x8dfe('0x53')]===0x0){return db[_0x8dfe('0x2d')][_0x8dfe('0x4d')]({'name':_0x3c41fb[_0x8dfe('0x2f')],'resourceId':_0x3c41fb['id'],'type':_0x373d98[_0x8dfe('0x2f')],'sectionId':_0x373d98['id']},{})[_0x8dfe('0x2b')](function(){return _0x2d5990;});}else{return _0x2d5990;}})['catch'](function(_0x4e2b05){logger['error'](_0x8dfe('0x54'),_0x4e2b05);throw _0x4e2b05;});}return _0x2d5990;})[_0x8dfe('0x2b')](respondWithResult(_0x2b5390,0xc9))[_0x8dfe('0x4c')](handleError(_0x2b5390,null));};exports[_0x8dfe('0x29')]=function(_0x5023f3,_0x85233d){if(_0x5023f3[_0x8dfe('0x4e')]['id']){delete _0x5023f3['body']['id'];}return db[_0x8dfe('0x33')][_0x8dfe('0x4b')]({'where':{'id':_0x5023f3[_0x8dfe('0x55')]['id']}})[_0x8dfe('0x2b')](handleEntityNotFound(_0x85233d,null))[_0x8dfe('0x2b')](saveUpdates(_0x5023f3[_0x8dfe('0x4e')],null))[_0x8dfe('0x2b')](respondWithResult(_0x85233d,null))['catch'](handleError(_0x85233d,null));};exports[_0x8dfe('0x2a')]=function(_0x1b9907,_0x59fba9){return db['AnalyticExtractedReport'][_0x8dfe('0x4b')]({'where':{'id':_0x1b9907[_0x8dfe('0x55')]['id']}})[_0x8dfe('0x2b')](handleEntityNotFound(_0x59fba9,null))['then'](removeEntity(_0x59fba9,null))[_0x8dfe('0x4c')](handleError(_0x59fba9,null));};exports[_0x8dfe('0x56')]=function(_0x970dda,_0x213cd0,_0x34362f){return db['AnalyticExtractedReport'][_0x8dfe('0x4b')]({'where':{'id':_0x970dda['params']['id']},'attributes':[_0x8dfe('0x2f'),'basename',_0x8dfe('0x57'),_0x8dfe('0x58')],'raw':!![]})[_0x8dfe('0x2b')](handleEntityNotFound(_0x213cd0,null))[_0x8dfe('0x2b')](function(_0x26a8d9){if(_0x26a8d9){if(!fs[_0x8dfe('0x59')](path[_0x8dfe('0x5a')](config[_0x8dfe('0x5b')],_0x8dfe('0x5c'),_0x26a8d9[_0x8dfe('0x57')]))){throw new db['Sequelize'][(_0x8dfe('0x5d'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x970dda[_0x8dfe('0x39')][_0x8dfe('0x5e')]){return _0x213cd0[_0x8dfe('0x1d')](0xc8);}return _0x213cd0[_0x8dfe('0x56')](path[_0x8dfe('0x5a')](config[_0x8dfe('0x5b')],_0x8dfe('0x5c'),_0x26a8d9['savename']),util[_0x8dfe('0x5f')]('%s.%s',_0x26a8d9[_0x8dfe('0x60')]||_0x26a8d9['name'],_0x26a8d9[_0x8dfe('0x58')][_0x8dfe('0x61')]()));}})[_0x8dfe('0x4c')](handleError(_0x213cd0,null));};
\ No newline at end of file
+var _0x6d0d=['include','findAll','rows','catch','show','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','ExtractedReports','UserProfileResource','error','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x6d0d,0x141));var _0xd6d0=function(_0x41e9a4,_0x307b90){_0x41e9a4=_0x41e9a4-0x0;var _0x454f90=_0x6d0d[_0x41e9a4];return _0x454f90;};'use strict';var emlformat=require(_0xd6d0('0x0'));var rimraf=require(_0xd6d0('0x1'));var zipdir=require(_0xd6d0('0x2'));var jsonpatch=require(_0xd6d0('0x3'));var rp=require(_0xd6d0('0x4'));var moment=require(_0xd6d0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd6d0('0x6'));var util=require(_0xd6d0('0x7'));var path=require(_0xd6d0('0x8'));var sox=require(_0xd6d0('0x9'));var csv=require('to-csv');var ejs=require(_0xd6d0('0xa'));var fs=require('fs');var fs_extra=require(_0xd6d0('0xb'));var _=require(_0xd6d0('0xc'));var squel=require(_0xd6d0('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd6d0('0xe'));var toCsv=require(_0xd6d0('0xf'));var querystring=require(_0xd6d0('0x10'));var Papa=require(_0xd6d0('0x11'));var Redis=require('ioredis');var authService=require(_0xd6d0('0x12'));var qs=require(_0xd6d0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6d0('0x14'));var logger=require(_0xd6d0('0x15'))('api');var utils=require(_0xd6d0('0x16'));var config=require(_0xd6d0('0x17'));var licenseUtil=require(_0xd6d0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32a830,_0x495515){_0x495515=_0x495515||0xcc;return function(_0xe85184){if(_0xe85184){return _0x32a830[_0xd6d0('0x19')](_0x495515);}return _0x32a830[_0xd6d0('0x1a')](_0x495515)[_0xd6d0('0x1b')]();};}function respondWithResult(_0x87a3b,_0x4d21c3){_0x4d21c3=_0x4d21c3||0xc8;return function(_0x284751){if(_0x284751){return _0x87a3b[_0xd6d0('0x1a')](_0x4d21c3)['json'](_0x284751);}};}function respondWithFilteredResult(_0x492982,_0x5edd26){return function(_0x297d18){if(_0x297d18){var _0x5654f0=typeof _0x5edd26[_0xd6d0('0x1c')]===_0xd6d0('0x1d')&&typeof _0x5edd26[_0xd6d0('0x1e')]===_0xd6d0('0x1d');var _0x4d74e3=_0x297d18[_0xd6d0('0x1f')];var _0xce8de2=_0x5654f0?0x0:_0x5edd26['offset'];var _0x3ff6be=_0x5654f0?_0x297d18[_0xd6d0('0x1f')]:_0x5edd26[_0xd6d0('0x1c')]+_0x5edd26[_0xd6d0('0x1e')];var _0x91f73c;if(_0x3ff6be>=_0x4d74e3){_0x3ff6be=_0x4d74e3;_0x91f73c=0xc8;}else{_0x91f73c=0xce;}_0x492982[_0xd6d0('0x1a')](_0x91f73c);return _0x492982[_0xd6d0('0x20')](_0xd6d0('0x21'),_0xce8de2+'-'+_0x3ff6be+'/'+_0x4d74e3)[_0xd6d0('0x22')](_0x297d18);}return null;};}function patchUpdates(_0x2bb517){return function(_0x479ab7){try{jsonpatch[_0xd6d0('0x23')](_0x479ab7,_0x2bb517,!![]);}catch(_0x587c9c){return BPromise[_0xd6d0('0x24')](_0x587c9c);}return _0x479ab7[_0xd6d0('0x25')]();};}function saveUpdates(_0x39265f,_0x3f7d05){return function(_0x1baa7c){if(_0x1baa7c){return _0x1baa7c[_0xd6d0('0x26')](_0x39265f)['then'](function(_0x3da08b){return _0x3da08b;});}return null;};}function removeEntity(_0x1cf98c,_0x38233f){return function(_0x42e4b6){if(_0x42e4b6){return _0x42e4b6[_0xd6d0('0x27')]()[_0xd6d0('0x28')](function(){var _0x29d500=_0x42e4b6[_0xd6d0('0x29')]({'plain':!![]});var _0x803e49=_0xd6d0('0x2a');return db[_0xd6d0('0x2b')][_0xd6d0('0x27')]({'where':{'type':_0x803e49,'resourceId':_0x29d500['id']}})[_0xd6d0('0x28')](function(){return _0x42e4b6;});})[_0xd6d0('0x28')](function(){_0x1cf98c[_0xd6d0('0x1a')](0xcc)[_0xd6d0('0x1b')]();});}};}function handleEntityNotFound(_0xff6bed,_0x2ce20f){return function(_0x5ea7ac){if(!_0x5ea7ac){_0xff6bed['sendStatus'](0x194);}return _0x5ea7ac;};}function handleError(_0x5c70e8,_0x360fef){_0x360fef=_0x360fef||0x1f4;return function(_0x151ed9){logger[_0xd6d0('0x2c')](_0x151ed9['stack']);if(_0x151ed9['name']){delete _0x151ed9[_0xd6d0('0x2d')];}_0x5c70e8[_0xd6d0('0x1a')](_0x360fef)[_0xd6d0('0x2e')](_0x151ed9);};}exports['index']=function(_0x575114,_0x552cb8){var _0x160a9a={},_0x20b33c={},_0x2a0d14={'count':0x0,'rows':[]};var _0x426792=_[_0xd6d0('0x2f')](db[_0xd6d0('0x30')][_0xd6d0('0x31')],function(_0x5e98b5){return{'name':_0x5e98b5[_0xd6d0('0x32')],'type':_0x5e98b5[_0xd6d0('0x33')][_0xd6d0('0x34')]};});_0x20b33c['model']=_['map'](_0x426792,_0xd6d0('0x2d'));_0x20b33c['query']=_[_0xd6d0('0x35')](_0x575114[_0xd6d0('0x36')]);_0x20b33c[_0xd6d0('0x37')]=_[_0xd6d0('0x38')](_0x20b33c['model'],_0x20b33c['query']);_0x160a9a[_0xd6d0('0x39')]=_[_0xd6d0('0x38')](_0x20b33c[_0xd6d0('0x3a')],qs[_0xd6d0('0x3b')](_0x575114[_0xd6d0('0x36')]['fields']));_0x160a9a[_0xd6d0('0x39')]=_0x160a9a['attributes']['length']?_0x160a9a['attributes']:_0x20b33c[_0xd6d0('0x3a')];if(!_0x575114[_0xd6d0('0x36')][_0xd6d0('0x3c')]('nolimit')){_0x160a9a[_0xd6d0('0x1e')]=qs[_0xd6d0('0x1e')](_0x575114[_0xd6d0('0x36')][_0xd6d0('0x1e')]);_0x160a9a[_0xd6d0('0x1c')]=qs['offset'](_0x575114[_0xd6d0('0x36')][_0xd6d0('0x1c')]);}_0x160a9a[_0xd6d0('0x3d')]=qs[_0xd6d0('0x3e')](_0x575114[_0xd6d0('0x36')][_0xd6d0('0x3e')]);_0x160a9a[_0xd6d0('0x3f')]=qs[_0xd6d0('0x37')](_['pick'](_0x575114[_0xd6d0('0x36')],_0x20b33c[_0xd6d0('0x37')]),_0x426792);if(_0x575114[_0xd6d0('0x36')][_0xd6d0('0x40')]){_0x160a9a['where']=_['merge'](_0x160a9a[_0xd6d0('0x3f')],{'$or':_['map'](_0x426792,function(_0x14b95c){if(_0x14b95c[_0xd6d0('0x33')]!==_0xd6d0('0x41')){var _0x5c02ef={};_0x5c02ef[_0x14b95c[_0xd6d0('0x2d')]]={'$like':'%'+_0x575114['query'][_0xd6d0('0x40')]+'%'};return _0x5c02ef;}})});}_0x160a9a=_[_0xd6d0('0x42')]({},_0x160a9a,_0x575114['options']);var _0x212518={'where':_0x160a9a[_0xd6d0('0x3f')]};return db[_0xd6d0('0x30')][_0xd6d0('0x1f')](_0x212518)['then'](function(_0x1f7b4f){_0x2a0d14[_0xd6d0('0x1f')]=_0x1f7b4f;if(_0x575114['query']['includeAll']){_0x160a9a[_0xd6d0('0x43')]=[{'all':!![]}];}return db[_0xd6d0('0x30')][_0xd6d0('0x44')](_0x160a9a);})[_0xd6d0('0x28')](function(_0x2acd7c){_0x2a0d14[_0xd6d0('0x45')]=_0x2acd7c;return _0x2a0d14;})[_0xd6d0('0x28')](respondWithFilteredResult(_0x552cb8,_0x160a9a))[_0xd6d0('0x46')](handleError(_0x552cb8,null));};exports[_0xd6d0('0x47')]=function(_0x304682,_0x47453e){var _0x109c38={'raw':!![],'where':{'id':_0x304682['params']['id']}},_0x2b0aeb={};_0x2b0aeb[_0xd6d0('0x3a')]=_['keys'](db[_0xd6d0('0x30')][_0xd6d0('0x31')]);_0x2b0aeb['query']=_[_0xd6d0('0x35')](_0x304682[_0xd6d0('0x36')]);_0x2b0aeb[_0xd6d0('0x37')]=_[_0xd6d0('0x38')](_0x2b0aeb[_0xd6d0('0x3a')],_0x2b0aeb[_0xd6d0('0x36')]);_0x109c38['attributes']=_['intersection'](_0x2b0aeb[_0xd6d0('0x3a')],qs[_0xd6d0('0x3b')](_0x304682[_0xd6d0('0x36')][_0xd6d0('0x3b')]));_0x109c38[_0xd6d0('0x39')]=_0x109c38[_0xd6d0('0x39')][_0xd6d0('0x48')]?_0x109c38[_0xd6d0('0x39')]:_0x2b0aeb[_0xd6d0('0x3a')];if(_0x304682[_0xd6d0('0x36')]['includeAll']){_0x109c38[_0xd6d0('0x43')]=[{'all':!![]}];}_0x109c38=_['merge']({},_0x109c38,_0x304682[_0xd6d0('0x49')]);return db['AnalyticExtractedReport']['find'](_0x109c38)['then'](handleEntityNotFound(_0x47453e,null))[_0xd6d0('0x28')](respondWithResult(_0x47453e,null))[_0xd6d0('0x46')](handleError(_0x47453e,null));};exports['create']=function(_0x599dde,_0x46c077){return db[_0xd6d0('0x30')][_0xd6d0('0x4a')](_0x599dde[_0xd6d0('0x4b')],{})['then'](function(_0x3c9844){var _0xb6a379=_0x599dde[_0xd6d0('0x4c')][_0xd6d0('0x29')]({'plain':!![]});if(!_0xb6a379)throw new Error(_0xd6d0('0x4d'));if(_0xb6a379[_0xd6d0('0x4e')]===_0xd6d0('0x4c')){var _0x4cce17=_0x3c9844[_0xd6d0('0x29')]({'plain':!![]});var _0x3102d0=_0xd6d0('0x2a');return db[_0xd6d0('0x4f')][_0xd6d0('0x50')]({'where':{'name':_0x3102d0,'userProfileId':_0xb6a379['userProfileId']},'raw':!![]})[_0xd6d0('0x28')](function(_0x108a96){if(_0x108a96&&_0x108a96[_0xd6d0('0x51')]===0x0){return db['UserProfileResource'][_0xd6d0('0x4a')]({'name':_0x4cce17[_0xd6d0('0x2d')],'resourceId':_0x4cce17['id'],'type':_0x108a96[_0xd6d0('0x2d')],'sectionId':_0x108a96['id']},{})[_0xd6d0('0x28')](function(){return _0x3c9844;});}else{return _0x3c9844;}})[_0xd6d0('0x46')](function(_0x409f28){logger[_0xd6d0('0x2c')](_0xd6d0('0x52'),_0x409f28);throw _0x409f28;});}return _0x3c9844;})[_0xd6d0('0x28')](respondWithResult(_0x46c077,0xc9))['catch'](handleError(_0x46c077,null));};exports[_0xd6d0('0x26')]=function(_0x5a905f,_0x339d97){if(_0x5a905f['body']['id']){delete _0x5a905f[_0xd6d0('0x4b')]['id'];}return db[_0xd6d0('0x30')][_0xd6d0('0x50')]({'where':{'id':_0x5a905f[_0xd6d0('0x53')]['id']}})[_0xd6d0('0x28')](handleEntityNotFound(_0x339d97,null))[_0xd6d0('0x28')](saveUpdates(_0x5a905f[_0xd6d0('0x4b')],null))[_0xd6d0('0x28')](respondWithResult(_0x339d97,null))['catch'](handleError(_0x339d97,null));};exports['destroy']=function(_0x34f8d4,_0x5a89cd){return db[_0xd6d0('0x30')]['find']({'where':{'id':_0x34f8d4[_0xd6d0('0x53')]['id']}})[_0xd6d0('0x28')](handleEntityNotFound(_0x5a89cd,null))['then'](removeEntity(_0x5a89cd,null))[_0xd6d0('0x46')](handleError(_0x5a89cd,null));};exports[_0xd6d0('0x54')]=function(_0x43e8ca,_0x5ddce3,_0x4f563e){return db['AnalyticExtractedReport'][_0xd6d0('0x50')]({'where':{'id':_0x43e8ca[_0xd6d0('0x53')]['id']},'attributes':[_0xd6d0('0x2d'),_0xd6d0('0x55'),_0xd6d0('0x56'),_0xd6d0('0x57')],'raw':!![]})[_0xd6d0('0x28')](handleEntityNotFound(_0x5ddce3,null))[_0xd6d0('0x28')](function(_0x169a63){if(_0x169a63){if(!fs[_0xd6d0('0x58')](path[_0xd6d0('0x59')](config[_0xd6d0('0x5a')],_0xd6d0('0x5b'),_0x169a63['savename']))){throw new db[(_0xd6d0('0x5c'))][(_0xd6d0('0x5d'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x43e8ca[_0xd6d0('0x36')][_0xd6d0('0x5e')]){return _0x5ddce3[_0xd6d0('0x19')](0xc8);}return _0x5ddce3[_0xd6d0('0x54')](path['join'](config[_0xd6d0('0x5a')],_0xd6d0('0x5b'),_0x169a63['savename']),util[_0xd6d0('0x5f')](_0xd6d0('0x60'),_0x169a63[_0xd6d0('0x55')]||_0x169a63[_0xd6d0('0x2d')],_0x169a63[_0xd6d0('0x57')]['toLowerCase']()));}})[_0xd6d0('0x46')](handleError(_0x5ddce3,null));};
\ No newline at end of file
index 5d1511a..8367444 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacec=['request-promise','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment'];(function(_0x3a3a46,_0x111874){var _0xe4acdb=function(_0x44b041){while(--_0x44b041){_0x3a3a46['push'](_0x3a3a46['shift']());}};_0xe4acdb(++_0x111874);}(_0xacec,0x88));var _0xcace=function(_0x3bd4e5,_0x33854f){_0x3bd4e5=_0x3bd4e5-0x0;var _0x2d1522=_0xacec[_0x3bd4e5];return _0x2d1522;};'use strict';var _=require(_0xcace('0x0'));var util=require('util');var logger=require(_0xcace('0x1'))(_0xcace('0x2'));var moment=require(_0xcace('0x3'));var BPromise=require('bluebird');var rp=require(_0xcace('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcace('0x5'));var config=require('../../config/environment');var attributes=require(_0xcace('0x6'));module['exports']=function(_0x491f14,_0x24dd13){return _0x491f14[_0xcace('0x7')](_0xcace('0x8'),attributes,{'tableName':_0xcace('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x075f=['../../config/environment','./analyticExtractedReport.attributes','exports','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x8d3262,_0x439e73){var _0x45561c=function(_0x36581f){while(--_0x36581f){_0x8d3262['push'](_0x8d3262['shift']());}};_0x45561c(++_0x439e73);}(_0x075f,0x13c));var _0xf075=function(_0xc41295,_0x5ef31e){_0xc41295=_0xc41295-0x0;var _0xdc7b03=_0x075f[_0xc41295];return _0xdc7b03;};'use strict';var _=require(_0xf075('0x0'));var util=require(_0xf075('0x1'));var logger=require(_0xf075('0x2'))('api');var moment=require(_0xf075('0x3'));var BPromise=require(_0xf075('0x4'));var rp=require(_0xf075('0x5'));var fs=require('fs');var path=require(_0xf075('0x6'));var rimraf=require(_0xf075('0x7'));var config=require(_0xf075('0x8'));var attributes=require(_0xf075('0x9'));module[_0xf075('0xa')]=function(_0x3d52dd,_0x4d08db){return _0x3d52dd['define']('AnalyticExtractedReport',attributes,{'tableName':_0xf075('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 09f29b3..5950fde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6633=['stringify','error','code','message','info','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0x6633,0xfd));var _0x3663=function(_0x1990f0,_0x427550){_0x1990f0=_0x1990f0-0x0;var _0x4b3cf7=_0x6633[_0x1990f0];return _0x4b3cf7;};'use strict';var _=require(_0x3663('0x0'));var util=require(_0x3663('0x1'));var moment=require(_0x3663('0x2'));var BPromise=require(_0x3663('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3663('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3663('0x5'))(_0x3663('0x6'));var config=require(_0x3663('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3663('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51604b,_0x47f3ad,_0x47f2a6){return new BPromise(function(_0x5c97fb,_0x418ba7){return client['request'](_0x51604b,_0x47f2a6)[_0x3663('0x9')](function(_0x1352e7){logger['info'](_0x3663('0xa'),_0x47f3ad,_0x3663('0xb'));logger['debug'](_0x3663('0xc'),_0x47f3ad,_0x3663('0xb'),JSON[_0x3663('0xd')](_0x1352e7));if(_0x1352e7['error']){if(_0x1352e7[_0x3663('0xe')][_0x3663('0xf')]===0x1f4){logger['error'](_0x3663('0xa'),_0x47f3ad,_0x1352e7[_0x3663('0xe')]['message']);return _0x418ba7(_0x1352e7['error'][_0x3663('0x10')]);}logger[_0x3663('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47f3ad,_0x1352e7[_0x3663('0xe')][_0x3663('0x10')]);return _0x5c97fb(_0x1352e7[_0x3663('0xe')][_0x3663('0x10')]);}else{logger[_0x3663('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47f3ad,_0x3663('0xb'));_0x5c97fb(_0x1352e7[_0x3663('0x12')][_0x3663('0x10')]);}})['catch'](function(_0x4e8086){logger[_0x3663('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47f3ad,_0x4e8086);_0x418ba7(_0x4e8086);});});}
\ No newline at end of file
+var _0x5c32=['http','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1a20ce,_0x229c68){var _0x44dda3=function(_0x26ec52){while(--_0x26ec52){_0x1a20ce['push'](_0x1a20ce['shift']());}};_0x44dda3(++_0x229c68);}(_0x5c32,0xd3));var _0x25c3=function(_0x412c06,_0x100bae){_0x412c06=_0x412c06-0x0;var _0x69caa0=_0x5c32[_0x412c06];return _0x69caa0;};'use strict';var _=require(_0x25c3('0x0'));var util=require(_0x25c3('0x1'));var moment=require(_0x25c3('0x2'));var BPromise=require(_0x25c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25c3('0x4'))['db'];var utils=require(_0x25c3('0x5'));var logger=require(_0x25c3('0x6'))(_0x25c3('0x7'));var config=require('../../config/environment');var jayson=require(_0x25c3('0x8'));var client=jayson['client'][_0x25c3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10bfad,_0x24f8d3,_0x5c47f){return new BPromise(function(_0x2ad066,_0x4b581a){return client['request'](_0x10bfad,_0x5c47f)['then'](function(_0x7dfd50){logger[_0x25c3('0xa')](_0x25c3('0xb'),_0x24f8d3,_0x25c3('0xc'));logger[_0x25c3('0xd')](_0x25c3('0xe'),_0x24f8d3,_0x25c3('0xc'),JSON[_0x25c3('0xf')](_0x7dfd50));if(_0x7dfd50['error']){if(_0x7dfd50[_0x25c3('0x10')][_0x25c3('0x11')]===0x1f4){logger[_0x25c3('0x10')](_0x25c3('0xb'),_0x24f8d3,_0x7dfd50[_0x25c3('0x10')]['message']);return _0x4b581a(_0x7dfd50['error'][_0x25c3('0x12')]);}logger[_0x25c3('0x10')](_0x25c3('0xb'),_0x24f8d3,_0x7dfd50[_0x25c3('0x10')][_0x25c3('0x12')]);return _0x2ad066(_0x7dfd50['error'][_0x25c3('0x12')]);}else{logger[_0x25c3('0xa')](_0x25c3('0xb'),_0x24f8d3,_0x25c3('0xc'));_0x2ad066(_0x7dfd50['result'][_0x25c3('0x12')]);}})[_0x25c3('0x13')](function(_0x27ab65){logger[_0x25c3('0x10')](_0x25c3('0xb'),_0x24f8d3,_0x27ab65);_0x4b581a(_0x27ab65);});});}
\ No newline at end of file
index 930ec1d..e550178 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf43c=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','post','create'];(function(_0x2e5fe4,_0x2889b8){var _0x1be065=function(_0x1e9cf5){while(--_0x1e9cf5){_0x2e5fe4['push'](_0x2e5fe4['shift']());}};_0x1be065(++_0x2889b8);}(_0xf43c,0xa4));var _0xcf43=function(_0x440178,_0x519854){_0x440178=_0x440178-0x0;var _0x22aa42=_0xf43c[_0x440178];return _0x22aa42;};'use strict';var multer=require(_0xcf43('0x0'));var util=require(_0xcf43('0x1'));var path=require(_0xcf43('0x2'));var timeout=require(_0xcf43('0x3'));var express=require('express');var router=express[_0xcf43('0x4')]();var fs_extra=require(_0xcf43('0x5'));var auth=require(_0xcf43('0x6'));var interaction=require(_0xcf43('0x7'));var config=require(_0xcf43('0x8'));var controller=require(_0xcf43('0x9'));router[_0xcf43('0xa')]('/',auth[_0xcf43('0xb')](),controller[_0xcf43('0xc')]);router[_0xcf43('0xa')]('/:id',auth[_0xcf43('0xb')](),controller[_0xcf43('0xd')]);router['get']('/:id/download',auth[_0xcf43('0xb')](),controller['download']);router[_0xcf43('0xe')]('/',auth[_0xcf43('0xb')](),controller[_0xcf43('0xf')]);router['put'](_0xcf43('0x10'),auth[_0xcf43('0xb')](),controller['update']);router[_0xcf43('0x11')](_0xcf43('0x10'),auth[_0xcf43('0xb')](),controller[_0xcf43('0x12')]);module[_0xcf43('0x13')]=router;
\ No newline at end of file
+var _0x5c09=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3f3f1f,_0x28b7ea){var _0x16872b=function(_0xb81b23){while(--_0xb81b23){_0x3f3f1f['push'](_0x3f3f1f['shift']());}};_0x16872b(++_0x28b7ea);}(_0x5c09,0x1a4));var _0x95c0=function(_0x52848c,_0x4fc7c9){_0x52848c=_0x52848c-0x0;var _0x336fa0=_0x5c09[_0x52848c];return _0x336fa0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x95c0('0x0'));var express=require('express');var router=express[_0x95c0('0x1')]();var fs_extra=require(_0x95c0('0x2'));var auth=require(_0x95c0('0x3'));var interaction=require(_0x95c0('0x4'));var config=require(_0x95c0('0x5'));var controller=require(_0x95c0('0x6'));router[_0x95c0('0x7')]('/',auth[_0x95c0('0x8')](),controller[_0x95c0('0x9')]);router[_0x95c0('0x7')](_0x95c0('0xa'),auth[_0x95c0('0x8')](),controller['show']);router[_0x95c0('0x7')](_0x95c0('0xb'),auth[_0x95c0('0x8')](),controller[_0x95c0('0xc')]);router['post']('/',auth[_0x95c0('0x8')](),controller[_0x95c0('0xd')]);router[_0x95c0('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x95c0('0xf')](_0x95c0('0xa'),auth[_0x95c0('0x8')](),controller['destroy']);module[_0x95c0('0x10')]=router;
\ No newline at end of file
index 19a520d..2501661 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0467=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x1c83c0,_0x196063){var _0x24a775=function(_0x5e0b6b){while(--_0x5e0b6b){_0x1c83c0['push'](_0x1c83c0['shift']());}};_0x24a775(++_0x196063);}(_0x0467,0x153));var _0x7046=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0467[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7046('0x0'));module[_0x7046('0x1')]={'field':{'type':Sequelize[_0x7046('0x2')]},'alias':{'type':Sequelize[_0x7046('0x3')]},'function':{'type':Sequelize[_0x7046('0x3')]},'format':{'type':Sequelize[_0x7046('0x3')]},'groupBy':{'type':Sequelize[_0x7046('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7046('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xbed8=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1829fd,_0x33b470){var _0x177d22=function(_0x595874){while(--_0x595874){_0x1829fd['push'](_0x1829fd['shift']());}};_0x177d22(++_0x33b470);}(_0xbed8,0x18a));var _0x8bed=function(_0x59aecc,_0x255014){_0x59aecc=_0x59aecc-0x0;var _0x46b112=_0xbed8[_0x59aecc];return _0x46b112;};'use strict';var Sequelize=require(_0x8bed('0x0'));module[_0x8bed('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x8bed('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x8bed('0x2')]},'groupBy':{'type':Sequelize[_0x8bed('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x8bed('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 93264f7..d4f846e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe30f=['length','order','sort','filter','where','merge','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','params','catch','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','update','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe30f,0x15c));var _0xfe30=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe30f[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xfe30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe30('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfe30('0x2'));var BPromise=require(_0xfe30('0x3'));var Mustache=require('mustache');var util=require(_0xfe30('0x4'));var path=require(_0xfe30('0x5'));var sox=require(_0xfe30('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe30('0x7'));var _=require(_0xfe30('0x8'));var squel=require(_0xfe30('0x9'));var crypto=require(_0xfe30('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfe30('0xb'));var toCsv=require(_0xfe30('0xc'));var querystring=require(_0xfe30('0xd'));var Papa=require('papaparse');var Redis=require(_0xfe30('0xe'));var authService=require(_0xfe30('0xf'));var qs=require(_0xfe30('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe30('0x11'));var logger=require(_0xfe30('0x12'))('api');var utils=require(_0xfe30('0x13'));var config=require(_0xfe30('0x14'));var licenseUtil=require(_0xfe30('0x15'));var db=require(_0xfe30('0x16'))['db'];function respondWithStatusCode(_0xd0f76f,_0x10710f){_0x10710f=_0x10710f||0xcc;return function(_0x2f17a1){if(_0x2f17a1){return _0xd0f76f[_0xfe30('0x17')](_0x10710f);}return _0xd0f76f['status'](_0x10710f)[_0xfe30('0x18')]();};}function respondWithResult(_0x3c52ed,_0x23638b){_0x23638b=_0x23638b||0xc8;return function(_0xfb5124){if(_0xfb5124){return _0x3c52ed['status'](_0x23638b)['json'](_0xfb5124);}};}function respondWithFilteredResult(_0x1e43ca,_0x47fbd6){return function(_0xdbc826){if(_0xdbc826){var _0x410fe3=typeof _0x47fbd6[_0xfe30('0x19')]===_0xfe30('0x1a')&&typeof _0x47fbd6[_0xfe30('0x1b')]===_0xfe30('0x1a');var _0x143144=_0xdbc826[_0xfe30('0x1c')];var _0x21b5ed=_0x410fe3?0x0:_0x47fbd6[_0xfe30('0x19')];var _0x47e21c=_0x410fe3?_0xdbc826['count']:_0x47fbd6['offset']+_0x47fbd6['limit'];var _0xe4dae4;if(_0x47e21c>=_0x143144){_0x47e21c=_0x143144;_0xe4dae4=0xc8;}else{_0xe4dae4=0xce;}_0x1e43ca[_0xfe30('0x1d')](_0xe4dae4);return _0x1e43ca['set'](_0xfe30('0x1e'),_0x21b5ed+'-'+_0x47e21c+'/'+_0x143144)[_0xfe30('0x1f')](_0xdbc826);}return null;};}function patchUpdates(_0x133a4d){return function(_0x2b85d9){try{jsonpatch[_0xfe30('0x20')](_0x2b85d9,_0x133a4d,!![]);}catch(_0x34ea1d){return BPromise[_0xfe30('0x21')](_0x34ea1d);}return _0x2b85d9['save']();};}function saveUpdates(_0x946589,_0x5d6be6){return function(_0x34800a){if(_0x34800a){return _0x34800a[_0xfe30('0x22')](_0x946589)['then'](function(_0x5fe62){return _0x5fe62;});}return null;};}function removeEntity(_0x5f1acd,_0x354006){return function(_0x152a39){if(_0x152a39){return _0x152a39[_0xfe30('0x23')]()[_0xfe30('0x24')](function(){_0x5f1acd[_0xfe30('0x1d')](0xcc)[_0xfe30('0x18')]();});}};}function handleEntityNotFound(_0x4763bd,_0x54e3ce){return function(_0x5a6d02){if(!_0x5a6d02){_0x4763bd[_0xfe30('0x17')](0x194);}return _0x5a6d02;};}function handleError(_0x26682a,_0x295040){_0x295040=_0x295040||0x1f4;return function(_0x57b8a6){logger['error'](_0x57b8a6[_0xfe30('0x25')]);if(_0x57b8a6[_0xfe30('0x26')]){delete _0x57b8a6[_0xfe30('0x26')];}_0x26682a[_0xfe30('0x1d')](_0x295040)['send'](_0x57b8a6);};}exports[_0xfe30('0x27')]=function(_0x5bf253,_0x5646c2){var _0x16747e={},_0x22878d={},_0x35326c={'count':0x0,'rows':[]};var _0x426c6e=_[_0xfe30('0x28')](db['AnalyticFieldReport'][_0xfe30('0x29')],function(_0x4a80c1){return{'name':_0x4a80c1[_0xfe30('0x2a')],'type':_0x4a80c1[_0xfe30('0x2b')][_0xfe30('0x2c')]};});_0x22878d['model']=_[_0xfe30('0x28')](_0x426c6e,_0xfe30('0x26'));_0x22878d['query']=_[_0xfe30('0x2d')](_0x5bf253['query']);_0x22878d[_0xfe30('0x2e')]=_[_0xfe30('0x2f')](_0x22878d[_0xfe30('0x30')],_0x22878d[_0xfe30('0x31')]);_0x16747e[_0xfe30('0x32')]=_['intersection'](_0x22878d['model'],qs['fields'](_0x5bf253[_0xfe30('0x31')][_0xfe30('0x33')]));_0x16747e[_0xfe30('0x32')]=_0x16747e[_0xfe30('0x32')][_0xfe30('0x34')]?_0x16747e[_0xfe30('0x32')]:_0x22878d[_0xfe30('0x30')];if(!_0x5bf253[_0xfe30('0x31')]['hasOwnProperty']('nolimit')){_0x16747e[_0xfe30('0x1b')]=qs[_0xfe30('0x1b')](_0x5bf253[_0xfe30('0x31')][_0xfe30('0x1b')]);_0x16747e[_0xfe30('0x19')]=qs[_0xfe30('0x19')](_0x5bf253[_0xfe30('0x31')][_0xfe30('0x19')]);}_0x16747e[_0xfe30('0x35')]=qs[_0xfe30('0x36')](_0x5bf253[_0xfe30('0x31')]['sort']);_0x16747e['where']=qs[_0xfe30('0x2e')](_['pick'](_0x5bf253[_0xfe30('0x31')],_0x22878d['filters']),_0x426c6e);if(_0x5bf253[_0xfe30('0x31')][_0xfe30('0x37')]){_0x16747e[_0xfe30('0x38')]=_[_0xfe30('0x39')](_0x16747e['where'],{'$or':_[_0xfe30('0x28')](_0x426c6e,function(_0x99a5d9){if(_0x99a5d9[_0xfe30('0x2b')]!==_0xfe30('0x3a')){var _0x5e657b={};_0x5e657b[_0x99a5d9['name']]={'$like':'%'+_0x5bf253['query'][_0xfe30('0x37')]+'%'};return _0x5e657b;}})});}_0x16747e=_[_0xfe30('0x39')]({},_0x16747e,_0x5bf253[_0xfe30('0x3b')]);var _0x4b81ac={'where':_0x16747e[_0xfe30('0x38')]};return db[_0xfe30('0x3c')]['count'](_0x4b81ac)[_0xfe30('0x24')](function(_0x92c9b4){_0x35326c[_0xfe30('0x1c')]=_0x92c9b4;if(_0x5bf253[_0xfe30('0x31')][_0xfe30('0x3d')]){_0x16747e[_0xfe30('0x3e')]=[{'all':!![]}];}return db[_0xfe30('0x3c')][_0xfe30('0x3f')](_0x16747e);})[_0xfe30('0x24')](function(_0x500310){_0x35326c[_0xfe30('0x40')]=_0x500310;return _0x35326c;})[_0xfe30('0x24')](respondWithFilteredResult(_0x5646c2,_0x16747e))['catch'](handleError(_0x5646c2,null));};exports[_0xfe30('0x41')]=function(_0x19663a,_0x3cd371){var _0x19f813={'raw':![],'where':{'id':_0x19663a[_0xfe30('0x42')]['id']}},_0x33a11b={};_0x33a11b[_0xfe30('0x30')]=_[_0xfe30('0x2d')](db[_0xfe30('0x3c')][_0xfe30('0x29')]);_0x33a11b['query']=_[_0xfe30('0x2d')](_0x19663a['query']);_0x33a11b[_0xfe30('0x2e')]=_[_0xfe30('0x2f')](_0x33a11b['model'],_0x33a11b[_0xfe30('0x31')]);_0x19f813[_0xfe30('0x32')]=_[_0xfe30('0x2f')](_0x33a11b[_0xfe30('0x30')],qs['fields'](_0x19663a[_0xfe30('0x31')]['fields']));_0x19f813[_0xfe30('0x32')]=_0x19f813['attributes']['length']?_0x19f813[_0xfe30('0x32')]:_0x33a11b[_0xfe30('0x30')];if(_0x19663a['query'][_0xfe30('0x3d')]){_0x19f813['include']=[{'all':!![]}];}_0x19f813=_['merge']({},_0x19f813,_0x19663a[_0xfe30('0x3b')]);return db[_0xfe30('0x3c')]['find'](_0x19f813)['then'](handleEntityNotFound(_0x3cd371,null))[_0xfe30('0x24')](respondWithResult(_0x3cd371,null))[_0xfe30('0x43')](handleError(_0x3cd371,null));};exports[_0xfe30('0x44')]=function(_0x4e6dff,_0x2ce642){return db[_0xfe30('0x3c')][_0xfe30('0x44')](_0x4e6dff[_0xfe30('0x45')],{})[_0xfe30('0x24')](respondWithResult(_0x2ce642,0xc9))[_0xfe30('0x43')](handleError(_0x2ce642,null));};exports[_0xfe30('0x46')]=function(_0x187486,_0x2c9500){return db[_0xfe30('0x3c')][_0xfe30('0x46')](_0x187486[_0xfe30('0x45')],{'raw':![],'individualHooks':!![]})[_0xfe30('0x24')](respondWithResult(_0x2c9500,0xc9))[_0xfe30('0x43')](handleError(_0x2c9500,null));};exports[_0xfe30('0x22')]=function(_0x2f5f25,_0x43d682){if(_0x2f5f25[_0xfe30('0x45')]['id']){delete _0x2f5f25[_0xfe30('0x45')]['id'];}return db[_0xfe30('0x3c')][_0xfe30('0x47')]({'where':{'id':_0x2f5f25[_0xfe30('0x42')]['id']}})[_0xfe30('0x24')](handleEntityNotFound(_0x43d682,null))[_0xfe30('0x24')](saveUpdates(_0x2f5f25['body'],null))['then'](respondWithResult(_0x43d682,null))[_0xfe30('0x43')](handleError(_0x43d682,null));};exports[_0xfe30('0x23')]=function(_0x3d535d,_0x1871c1){return db['AnalyticFieldReport'][_0xfe30('0x47')]({'where':{'id':_0x3d535d[_0xfe30('0x42')]['id']}})[_0xfe30('0x24')](handleEntityNotFound(_0x1871c1,null))[_0xfe30('0x24')](removeEntity(_0x1871c1,null))[_0xfe30('0x43')](handleError(_0x1871c1,null));};exports[_0xfe30('0x48')]=function(_0x211514,_0x1f29ad){return db['AnalyticFieldReport'][_0xfe30('0x23')]({'where':{'id':_0x211514[_0xfe30('0x31')][_0xfe30('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xfe30('0x24')](respondWithResult(_0x1f29ad,0xcc))['catch'](handleError(_0x1f29ad,null));};exports[_0xfe30('0x4a')]=function(_0xc61b6f,_0x1b9631,_0x2f6299){return db[_0xfe30('0x4b')][_0xfe30('0x4c')]({'where':{'id':_0xc61b6f[_0xfe30('0x42')]['id']}})[_0xfe30('0x24')](handleEntityNotFound(_0x1b9631,null))['then'](function(_0x2ef5ab){if(_0x2ef5ab){return db[_0xfe30('0x4d')][_0xfe30('0x4e')](function(_0x5527ba){return db[_0xfe30('0x3c')]['destroy']({'where':{'CustomReportId':_0xc61b6f['params']['id']},'transaction':_0x5527ba})['then'](function(_0x40180e){var _0x54cd13=_['map'](_0xc61b6f['body'],function(_0x15f216){delete _0x15f216['id'];_0x15f216[_0xfe30('0x4f')]=_0xc61b6f[_0xfe30('0x42')]['id'];return _0x15f216;});return db['AnalyticFieldReport'][_0xfe30('0x46')](_0x54cd13,{'transaction':_0x5527ba});});})['then'](function(){return db['AnalyticFieldReport'][_0xfe30('0x3f')]({'where':{'CustomReportId':_0xc61b6f[_0xfe30('0x42')]['id']}});});}})[_0xfe30('0x24')](respondWithResult(_0x1b9631,null))[_0xfe30('0x43')](handleError(_0x1b9631,null));};
\ No newline at end of file
+var _0xe2c7=['length','hasOwnProperty','nolimit','limit','sort','pick','where','filter','merge','options','include','findAll','rows','catch','show','params','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','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','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields'];(function(_0x43fb1b,_0x7b1161){var _0x347af3=function(_0xd612af){while(--_0xd612af){_0x43fb1b['push'](_0x43fb1b['shift']());}};_0x347af3(++_0x7b1161);}(_0xe2c7,0x69));var _0x7e2c=function(_0x10bf5d,_0x10a3a9){_0x10bf5d=_0x10bf5d-0x0;var _0x27f511=_0xe2c7[_0x10bf5d];return _0x27f511;};'use strict';var emlformat=require(_0x7e2c('0x0'));var rimraf=require(_0x7e2c('0x1'));var zipdir=require(_0x7e2c('0x2'));var jsonpatch=require(_0x7e2c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7e2c('0x4'));var util=require(_0x7e2c('0x5'));var path=require(_0x7e2c('0x6'));var sox=require(_0x7e2c('0x7'));var csv=require(_0x7e2c('0x8'));var ejs=require(_0x7e2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7e2c('0xa'));var _=require(_0x7e2c('0xb'));var squel=require('squel');var crypto=require(_0x7e2c('0xc'));var jsforce=require(_0x7e2c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7e2c('0x8'));var querystring=require('querystring');var Papa=require(_0x7e2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7e2c('0xf'));var qs=require(_0x7e2c('0x10'));var as=require(_0x7e2c('0x11'));var hardwareService=require(_0x7e2c('0x12'));var logger=require(_0x7e2c('0x13'))(_0x7e2c('0x14'));var utils=require(_0x7e2c('0x15'));var config=require(_0x7e2c('0x16'));var licenseUtil=require(_0x7e2c('0x17'));var db=require(_0x7e2c('0x18'))['db'];function respondWithStatusCode(_0x16c38a,_0xb1a4b7){_0xb1a4b7=_0xb1a4b7||0xcc;return function(_0x444074){if(_0x444074){return _0x16c38a['sendStatus'](_0xb1a4b7);}return _0x16c38a[_0x7e2c('0x19')](_0xb1a4b7)[_0x7e2c('0x1a')]();};}function respondWithResult(_0x56fea8,_0x37202e){_0x37202e=_0x37202e||0xc8;return function(_0x56f75d){if(_0x56f75d){return _0x56fea8[_0x7e2c('0x19')](_0x37202e)[_0x7e2c('0x1b')](_0x56f75d);}};}function respondWithFilteredResult(_0x5134e0,_0x4e881d){return function(_0x1fe8fc){if(_0x1fe8fc){var _0x4302af=typeof _0x4e881d[_0x7e2c('0x1c')]===_0x7e2c('0x1d')&&typeof _0x4e881d['limit']==='undefined';var _0x8d59ae=_0x1fe8fc[_0x7e2c('0x1e')];var _0x22f886=_0x4302af?0x0:_0x4e881d[_0x7e2c('0x1c')];var _0x104f30=_0x4302af?_0x1fe8fc['count']:_0x4e881d[_0x7e2c('0x1c')]+_0x4e881d['limit'];var _0x574b14;if(_0x104f30>=_0x8d59ae){_0x104f30=_0x8d59ae;_0x574b14=0xc8;}else{_0x574b14=0xce;}_0x5134e0[_0x7e2c('0x19')](_0x574b14);return _0x5134e0[_0x7e2c('0x1f')](_0x7e2c('0x20'),_0x22f886+'-'+_0x104f30+'/'+_0x8d59ae)[_0x7e2c('0x1b')](_0x1fe8fc);}return null;};}function patchUpdates(_0x3206df){return function(_0x545241){try{jsonpatch[_0x7e2c('0x21')](_0x545241,_0x3206df,!![]);}catch(_0x86a15e){return BPromise['reject'](_0x86a15e);}return _0x545241[_0x7e2c('0x22')]();};}function saveUpdates(_0x4a6743,_0x3416d5){return function(_0x1852f6){if(_0x1852f6){return _0x1852f6[_0x7e2c('0x23')](_0x4a6743)['then'](function(_0x20b04f){return _0x20b04f;});}return null;};}function removeEntity(_0x7afb1b,_0x29d621){return function(_0x27fc5e){if(_0x27fc5e){return _0x27fc5e[_0x7e2c('0x24')]()[_0x7e2c('0x25')](function(){_0x7afb1b['status'](0xcc)[_0x7e2c('0x1a')]();});}};}function handleEntityNotFound(_0x3a420c,_0x172a58){return function(_0x5459d7){if(!_0x5459d7){_0x3a420c[_0x7e2c('0x26')](0x194);}return _0x5459d7;};}function handleError(_0x215e8f,_0x7f6215){_0x7f6215=_0x7f6215||0x1f4;return function(_0x4a3307){logger[_0x7e2c('0x27')](_0x4a3307['stack']);if(_0x4a3307[_0x7e2c('0x28')]){delete _0x4a3307[_0x7e2c('0x28')];}_0x215e8f[_0x7e2c('0x19')](_0x7f6215)[_0x7e2c('0x29')](_0x4a3307);};}exports[_0x7e2c('0x2a')]=function(_0x508954,_0x464684){var _0x1d4b21={},_0x2f714b={},_0x3e6aac={'count':0x0,'rows':[]};var _0x24df06=_[_0x7e2c('0x2b')](db[_0x7e2c('0x2c')][_0x7e2c('0x2d')],function(_0x454cba){return{'name':_0x454cba[_0x7e2c('0x2e')],'type':_0x454cba[_0x7e2c('0x2f')]['key']};});_0x2f714b['model']=_['map'](_0x24df06,'name');_0x2f714b['query']=_[_0x7e2c('0x30')](_0x508954[_0x7e2c('0x31')]);_0x2f714b[_0x7e2c('0x32')]=_[_0x7e2c('0x33')](_0x2f714b[_0x7e2c('0x34')],_0x2f714b['query']);_0x1d4b21[_0x7e2c('0x35')]=_['intersection'](_0x2f714b['model'],qs[_0x7e2c('0x36')](_0x508954['query']['fields']));_0x1d4b21[_0x7e2c('0x35')]=_0x1d4b21['attributes'][_0x7e2c('0x37')]?_0x1d4b21['attributes']:_0x2f714b['model'];if(!_0x508954[_0x7e2c('0x31')][_0x7e2c('0x38')](_0x7e2c('0x39'))){_0x1d4b21[_0x7e2c('0x3a')]=qs['limit'](_0x508954[_0x7e2c('0x31')][_0x7e2c('0x3a')]);_0x1d4b21['offset']=qs['offset'](_0x508954[_0x7e2c('0x31')][_0x7e2c('0x1c')]);}_0x1d4b21['order']=qs[_0x7e2c('0x3b')](_0x508954[_0x7e2c('0x31')][_0x7e2c('0x3b')]);_0x1d4b21['where']=qs[_0x7e2c('0x32')](_[_0x7e2c('0x3c')](_0x508954['query'],_0x2f714b[_0x7e2c('0x32')]),_0x24df06);if(_0x508954['query']['filter']){_0x1d4b21[_0x7e2c('0x3d')]=_['merge'](_0x1d4b21[_0x7e2c('0x3d')],{'$or':_[_0x7e2c('0x2b')](_0x24df06,function(_0x2727ee){if(_0x2727ee['type']!=='VIRTUAL'){var _0x1c947c={};_0x1c947c[_0x2727ee[_0x7e2c('0x28')]]={'$like':'%'+_0x508954[_0x7e2c('0x31')][_0x7e2c('0x3e')]+'%'};return _0x1c947c;}})});}_0x1d4b21=_[_0x7e2c('0x3f')]({},_0x1d4b21,_0x508954[_0x7e2c('0x40')]);var _0x551ecc={'where':_0x1d4b21[_0x7e2c('0x3d')]};return db['AnalyticFieldReport']['count'](_0x551ecc)[_0x7e2c('0x25')](function(_0x310276){_0x3e6aac[_0x7e2c('0x1e')]=_0x310276;if(_0x508954[_0x7e2c('0x31')]['includeAll']){_0x1d4b21[_0x7e2c('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x7e2c('0x42')](_0x1d4b21);})['then'](function(_0x231244){_0x3e6aac[_0x7e2c('0x43')]=_0x231244;return _0x3e6aac;})[_0x7e2c('0x25')](respondWithFilteredResult(_0x464684,_0x1d4b21))[_0x7e2c('0x44')](handleError(_0x464684,null));};exports[_0x7e2c('0x45')]=function(_0x3f6dc1,_0x7316fd){var _0x2c0cea={'raw':![],'where':{'id':_0x3f6dc1[_0x7e2c('0x46')]['id']}},_0x7f847c={};_0x7f847c[_0x7e2c('0x34')]=_['keys'](db[_0x7e2c('0x2c')][_0x7e2c('0x2d')]);_0x7f847c[_0x7e2c('0x31')]=_[_0x7e2c('0x30')](_0x3f6dc1['query']);_0x7f847c[_0x7e2c('0x32')]=_['intersection'](_0x7f847c['model'],_0x7f847c[_0x7e2c('0x31')]);_0x2c0cea[_0x7e2c('0x35')]=_[_0x7e2c('0x33')](_0x7f847c['model'],qs[_0x7e2c('0x36')](_0x3f6dc1[_0x7e2c('0x31')][_0x7e2c('0x36')]));_0x2c0cea[_0x7e2c('0x35')]=_0x2c0cea['attributes']['length']?_0x2c0cea[_0x7e2c('0x35')]:_0x7f847c['model'];if(_0x3f6dc1['query']['includeAll']){_0x2c0cea[_0x7e2c('0x41')]=[{'all':!![]}];}_0x2c0cea=_[_0x7e2c('0x3f')]({},_0x2c0cea,_0x3f6dc1[_0x7e2c('0x40')]);return db[_0x7e2c('0x2c')]['find'](_0x2c0cea)[_0x7e2c('0x25')](handleEntityNotFound(_0x7316fd,null))['then'](respondWithResult(_0x7316fd,null))[_0x7e2c('0x44')](handleError(_0x7316fd,null));};exports['create']=function(_0x4da6b1,_0xd21687){return db[_0x7e2c('0x2c')]['create'](_0x4da6b1[_0x7e2c('0x47')],{})[_0x7e2c('0x25')](respondWithResult(_0xd21687,0xc9))[_0x7e2c('0x44')](handleError(_0xd21687,null));};exports['bulkCreate']=function(_0x20800e,_0x1adae0){return db[_0x7e2c('0x2c')][_0x7e2c('0x48')](_0x20800e[_0x7e2c('0x47')],{'raw':![],'individualHooks':!![]})[_0x7e2c('0x25')](respondWithResult(_0x1adae0,0xc9))[_0x7e2c('0x44')](handleError(_0x1adae0,null));};exports['update']=function(_0x280fe8,_0x2c2c24){if(_0x280fe8[_0x7e2c('0x47')]['id']){delete _0x280fe8[_0x7e2c('0x47')]['id'];}return db['AnalyticFieldReport'][_0x7e2c('0x49')]({'where':{'id':_0x280fe8[_0x7e2c('0x46')]['id']}})[_0x7e2c('0x25')](handleEntityNotFound(_0x2c2c24,null))[_0x7e2c('0x25')](saveUpdates(_0x280fe8[_0x7e2c('0x47')],null))[_0x7e2c('0x25')](respondWithResult(_0x2c2c24,null))[_0x7e2c('0x44')](handleError(_0x2c2c24,null));};exports[_0x7e2c('0x24')]=function(_0x5edc52,_0x39746b){return db[_0x7e2c('0x2c')]['find']({'where':{'id':_0x5edc52[_0x7e2c('0x46')]['id']}})['then'](handleEntityNotFound(_0x39746b,null))['then'](removeEntity(_0x39746b,null))[_0x7e2c('0x44')](handleError(_0x39746b,null));};exports[_0x7e2c('0x4a')]=function(_0x19bd82,_0x3b2bec){return db[_0x7e2c('0x2c')][_0x7e2c('0x24')]({'where':{'id':_0x19bd82[_0x7e2c('0x31')][_0x7e2c('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x7e2c('0x25')](respondWithResult(_0x3b2bec,0xcc))['catch'](handleError(_0x3b2bec,null));};exports[_0x7e2c('0x4c')]=function(_0x1ae70e,_0x3d11c8,_0xcb642c){return db[_0x7e2c('0x4d')][_0x7e2c('0x4e')]({'where':{'id':_0x1ae70e['params']['id']}})['then'](handleEntityNotFound(_0x3d11c8,null))['then'](function(_0x2da4fe){if(_0x2da4fe){return db['sequelize'][_0x7e2c('0x4f')](function(_0x457e37){return db[_0x7e2c('0x2c')]['destroy']({'where':{'CustomReportId':_0x1ae70e[_0x7e2c('0x46')]['id']},'transaction':_0x457e37})[_0x7e2c('0x25')](function(_0x36896b){var _0x52b759=_[_0x7e2c('0x2b')](_0x1ae70e[_0x7e2c('0x47')],function(_0x49ef7e){delete _0x49ef7e['id'];_0x49ef7e['CustomReportId']=_0x1ae70e[_0x7e2c('0x46')]['id'];return _0x49ef7e;});return db[_0x7e2c('0x2c')][_0x7e2c('0x48')](_0x52b759,{'transaction':_0x457e37});});})[_0x7e2c('0x25')](function(){return db[_0x7e2c('0x2c')][_0x7e2c('0x42')]({'where':{'CustomReportId':_0x1ae70e['params']['id']}});});}})[_0x7e2c('0x25')](respondWithResult(_0x3d11c8,null))[_0x7e2c('0x44')](handleError(_0x3d11c8,null));};
\ No newline at end of file
index aef0bf5..52408bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77bb=['api','request-promise','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x27fe0f,_0x39cb63){var _0x28b7d3=function(_0x52be6f){while(--_0x52be6f){_0x27fe0f['push'](_0x27fe0f['shift']());}};_0x28b7d3(++_0x39cb63);}(_0x77bb,0xbb));var _0xb77b=function(_0x145cf3,_0x3bf0da){_0x145cf3=_0x145cf3-0x0;var _0x5db0bf=_0x77bb[_0x145cf3];return _0x5db0bf;};'use strict';var _=require(_0xb77b('0x0'));var util=require(_0xb77b('0x1'));var logger=require(_0xb77b('0x2'))(_0xb77b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb77b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb77b('0x5'));var attributes=require(_0xb77b('0x6'));module[_0xb77b('0x7')]=function(_0x41d3f6,_0x276c50){return _0x41d3f6['define'](_0xb77b('0x8'),attributes,{'tableName':_0xb77b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd828=['exports','define','analytics_report_fields','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x560c4d,_0xe4f0ba){var _0x381de1=function(_0x180361){while(--_0x180361){_0x560c4d['push'](_0x560c4d['shift']());}};_0x381de1(++_0xe4f0ba);}(_0xd828,0x177));var _0x8d82=function(_0xc95c4b,_0x35b487){_0xc95c4b=_0xc95c4b-0x0;var _0x23dbfa=_0xd828[_0xc95c4b];return _0x23dbfa;};'use strict';var _=require(_0x8d82('0x0'));var util=require('util');var logger=require(_0x8d82('0x1'))(_0x8d82('0x2'));var moment=require(_0x8d82('0x3'));var BPromise=require('bluebird');var rp=require(_0x8d82('0x4'));var fs=require('fs');var path=require(_0x8d82('0x5'));var rimraf=require(_0x8d82('0x6'));var config=require(_0x8d82('0x7'));var attributes=require(_0x8d82('0x8'));module[_0x8d82('0x9')]=function(_0x1d61ed,_0x4cebbe){return _0x1d61ed[_0x8d82('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x8d82('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index edb6004..1a21db5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfeca=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x3007b2,_0x4d0027){var _0x4597a9=function(_0x493679){while(--_0x493679){_0x3007b2['push'](_0x3007b2['shift']());}};_0x4597a9(++_0x4d0027);}(_0xfeca,0xf4));var _0xafec=function(_0x1866b7,_0x243cf7){_0x1866b7=_0x1866b7-0x0;var _0x5a0a82=_0xfeca[_0x1866b7];return _0x5a0a82;};'use strict';var _=require(_0xafec('0x0'));var util=require(_0xafec('0x1'));var moment=require(_0xafec('0x2'));var BPromise=require(_0xafec('0x3'));var rs=require(_0xafec('0x4'));var fs=require('fs');var Redis=require(_0xafec('0x5'));var db=require(_0xafec('0x6'))['db'];var utils=require(_0xafec('0x7'));var logger=require('../../config/logger')(_0xafec('0x8'));var config=require(_0xafec('0x9'));var jayson=require(_0xafec('0xa'));var client=jayson[_0xafec('0xb')][_0xafec('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d9b88,_0x4080ea,_0x1248e9){return new BPromise(function(_0x1561be,_0xf6561b){return client[_0xafec('0xd')](_0x1d9b88,_0x1248e9)['then'](function(_0xe7c737){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x4080ea,_0xafec('0xe'));logger['debug'](_0xafec('0xf'),_0x4080ea,_0xafec('0xe'),JSON[_0xafec('0x10')](_0xe7c737));if(_0xe7c737[_0xafec('0x11')]){if(_0xe7c737[_0xafec('0x11')][_0xafec('0x12')]===0x1f4){logger['error'](_0xafec('0x13'),_0x4080ea,_0xe7c737['error']['message']);return _0xf6561b(_0xe7c737[_0xafec('0x11')][_0xafec('0x14')]);}logger['error'](_0xafec('0x13'),_0x4080ea,_0xe7c737[_0xafec('0x11')][_0xafec('0x14')]);return _0x1561be(_0xe7c737[_0xafec('0x11')][_0xafec('0x14')]);}else{logger[_0xafec('0x15')](_0xafec('0x13'),_0x4080ea,_0xafec('0xe'));_0x1561be(_0xe7c737[_0xafec('0x16')]['message']);}})[_0xafec('0x17')](function(_0x5331dc){logger[_0xafec('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4080ea,_0x5331dc);_0xf6561b(_0x5331dc);});});}
\ No newline at end of file
+var _0x1841=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x3e19fb,_0x3258e2){var _0x5b19bd=function(_0x1f5bbe){while(--_0x1f5bbe){_0x3e19fb['push'](_0x3e19fb['shift']());}};_0x5b19bd(++_0x3258e2);}(_0x1841,0x18b));var _0x1184=function(_0x9253b9,_0x551d23){_0x9253b9=_0x9253b9-0x0;var _0x1722b8=_0x1841[_0x9253b9];return _0x1722b8;};'use strict';var _=require(_0x1184('0x0'));var util=require(_0x1184('0x1'));var moment=require(_0x1184('0x2'));var BPromise=require('bluebird');var rs=require(_0x1184('0x3'));var fs=require('fs');var Redis=require(_0x1184('0x4'));var db=require(_0x1184('0x5'))['db'];var utils=require(_0x1184('0x6'));var logger=require(_0x1184('0x7'))(_0x1184('0x8'));var config=require(_0x1184('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf699cb,_0x120a4a,_0x49abc4){return new BPromise(function(_0x55f0f0,_0x1e969f){return client[_0x1184('0xa')](_0xf699cb,_0x49abc4)[_0x1184('0xb')](function(_0x452e25){logger['info'](_0x1184('0xc'),_0x120a4a,_0x1184('0xd'));logger[_0x1184('0xe')](_0x1184('0xf'),_0x120a4a,_0x1184('0xd'),JSON['stringify'](_0x452e25));if(_0x452e25[_0x1184('0x10')]){if(_0x452e25[_0x1184('0x10')][_0x1184('0x11')]===0x1f4){logger['error'](_0x1184('0xc'),_0x120a4a,_0x452e25[_0x1184('0x10')][_0x1184('0x12')]);return _0x1e969f(_0x452e25['error']['message']);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x120a4a,_0x452e25['error'][_0x1184('0x12')]);return _0x55f0f0(_0x452e25[_0x1184('0x10')][_0x1184('0x12')]);}else{logger[_0x1184('0x13')](_0x1184('0xc'),_0x120a4a,_0x1184('0xd'));_0x55f0f0(_0x452e25[_0x1184('0x14')][_0x1184('0x12')]);}})[_0x1184('0x15')](function(_0x49e934){logger[_0x1184('0x10')](_0x1184('0xc'),_0x120a4a,_0x49e934);_0x1e969f(_0x49e934);});});}
\ No newline at end of file
index 38d837c..7ba77fc 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(_0x974a42,_0x509392){var _0x1b801c=function(_0x37bb44){while(--_0x37bb44){_0x974a42['push'](_0x974a42['shift']());}};_0x1b801c(++_0x509392);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x2df5b6,_0x272dd1){var _0x1c1010=function(_0x539cab){while(--_0x539cab){_0x2df5b6['push'](_0x2df5b6['shift']());}};_0x1c1010(++_0x272dd1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 7b97241..c56d813 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd757=['name','sequelize','exports','STRING'];(function(_0x187e2c,_0x1f0899){var _0x214c94=function(_0x51325c){while(--_0x51325c){_0x187e2c['push'](_0x187e2c['shift']());}};_0x214c94(++_0x1f0899);}(_0xd757,0x1e5));var _0x7d75=function(_0x46c6b5,_0x23f130){_0x46c6b5=_0x46c6b5-0x0;var _0x429113=_0xd757[_0x46c6b5];return _0x429113;};'use strict';var Sequelize=require(_0x7d75('0x0'));module[_0x7d75('0x1')]={'name':{'type':Sequelize[_0x7d75('0x2')],'allowNull':![],'unique':_0x7d75('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7d75('0x2')]}};
\ No newline at end of file
+var _0x1bc6=['STRING','name','TEXT','sequelize','exports'];(function(_0x3f3c46,_0x33e972){var _0x7d1132=function(_0x2c7b56){while(--_0x2c7b56){_0x3f3c46['push'](_0x3f3c46['shift']());}};_0x7d1132(++_0x33e972);}(_0x1bc6,0x94));var _0x61bc=function(_0x5e0ac6,_0x40b94b){_0x5e0ac6=_0x5e0ac6-0x0;var _0x140494=_0x1bc6[_0x5e0ac6];return _0x140494;};'use strict';var Sequelize=require(_0x61bc('0x0'));module[_0x61bc('0x1')]={'name':{'type':Sequelize[_0x61bc('0x2')],'allowNull':![],'unique':_0x61bc('0x3')},'table':{'type':Sequelize[_0x61bc('0x2')]},'metric':{'type':Sequelize[_0x61bc('0x4')]},'description':{'type':Sequelize[_0x61bc('0x2')]}};
\ No newline at end of file
index 1564b10..e28b3d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x55279e,_0x52184e){var _0x2690c6=function(_0x2269c0){while(--_0x2269c0){_0x55279e['push'](_0x55279e['shift']());}};_0x2690c6(++_0x52184e);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2f00d7,_0x80b5e9){_0x2f00d7=_0x2f00d7-0x0;var _0x49a48f=_0xdc97[_0x2f00d7];return _0x49a48f;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
+var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x4d7a61,_0x3fb6e6){var _0x186f73=function(_0x4eeeeb){while(--_0x4eeeeb){_0x4d7a61['push'](_0x4d7a61['shift']());}};_0x186f73(++_0x3fb6e6);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0xc03ca6,_0x45a389){_0xc03ca6=_0xc03ca6-0x0;var _0x39d5a3=_0x8d0e[_0xc03ca6];return _0x39d5a3;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
index 5a7e938..fc554dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9865=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9865,0x1ba));var _0x5986=function(_0x2c2ab3,_0x593de1){_0x2c2ab3=_0x2c2ab3-0x0;var _0x1803f7=_0x9865[_0x2c2ab3];return _0x1803f7;};'use strict';var _=require(_0x5986('0x0'));var util=require(_0x5986('0x1'));var logger=require(_0x5986('0x2'))(_0x5986('0x3'));var moment=require(_0x5986('0x4'));var BPromise=require(_0x5986('0x5'));var rp=require(_0x5986('0x6'));var fs=require('fs');var path=require(_0x5986('0x7'));var rimraf=require(_0x5986('0x8'));var config=require(_0x5986('0x9'));var attributes=require('./analyticMetric.attributes');module[_0x5986('0xa')]=function(_0x35e6f8,_0x3ac862){return _0x35e6f8[_0x5986('0xb')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','lodash','util'];(function(_0x3848b5,_0x3c8688){var _0x2fbc5c=function(_0x3cf951){while(--_0x3cf951){_0x3848b5['push'](_0x3848b5['shift']());}};_0x2fbc5c(++_0x3c8688);}(_0xf494,0x1c6));var _0x4f49=function(_0x5b503b,_0xe75bbe){_0x5b503b=_0x5b503b-0x0;var _0x43b949=_0xf494[_0x5b503b];return _0x43b949;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 78216a5..2bce41a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5552=['stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x58c961,_0x15690a){var _0x1993bf=function(_0x5494e6){while(--_0x5494e6){_0x58c961['push'](_0x58c961['shift']());}};_0x1993bf(++_0x15690a);}(_0x5552,0x8a));var _0x2555=function(_0x352026,_0x14f939){_0x352026=_0x352026-0x0;var _0x1a3573=_0x5552[_0x352026];return _0x1a3573;};'use strict';var _=require(_0x2555('0x0'));var util=require(_0x2555('0x1'));var moment=require(_0x2555('0x2'));var BPromise=require(_0x2555('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2555('0x4'))['db'];var utils=require(_0x2555('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2555('0x6'));var jayson=require(_0x2555('0x7'));var client=jayson['client'][_0x2555('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32ad2c,_0x404070,_0x5c17e1){return new BPromise(function(_0x35c2f2,_0x23e68a){return client[_0x2555('0x9')](_0x32ad2c,_0x5c17e1)['then'](function(_0x440932){logger[_0x2555('0xa')](_0x2555('0xb'),_0x404070,_0x2555('0xc'));logger[_0x2555('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x404070,_0x2555('0xc'),JSON[_0x2555('0xe')](_0x440932));if(_0x440932[_0x2555('0xf')]){if(_0x440932['error'][_0x2555('0x10')]===0x1f4){logger['error'](_0x2555('0xb'),_0x404070,_0x440932[_0x2555('0xf')]['message']);return _0x23e68a(_0x440932[_0x2555('0xf')][_0x2555('0x11')]);}logger['error'](_0x2555('0xb'),_0x404070,_0x440932[_0x2555('0xf')][_0x2555('0x11')]);return _0x35c2f2(_0x440932['error'][_0x2555('0x11')]);}else{logger[_0x2555('0xa')](_0x2555('0xb'),_0x404070,_0x2555('0xc'));_0x35c2f2(_0x440932['result']['message']);}})[_0x2555('0x12')](function(_0x4c09e3){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x404070,_0x4c09e3);_0x23e68a(_0x4c09e3);});});}
\ No newline at end of file
+var _0xdef8=['http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0xf68ed,_0x44d25b){var _0x5a038d=function(_0x22fb59){while(--_0x22fb59){_0xf68ed['push'](_0xf68ed['shift']());}};_0x5a038d(++_0x44d25b);}(_0xdef8,0x8a));var _0x8def=function(_0x4ae172,_0x358493){_0x4ae172=_0x4ae172-0x0;var _0x2c93d8=_0xdef8[_0x4ae172];return _0x2c93d8;};'use strict';var _=require(_0x8def('0x0'));var util=require(_0x8def('0x1'));var moment=require(_0x8def('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8def('0x3'));var db=require(_0x8def('0x4'))['db'];var utils=require(_0x8def('0x5'));var logger=require(_0x8def('0x6'))(_0x8def('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8def('0x8')][_0x8def('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2284a0,_0xcabda,_0x30ae17){return new BPromise(function(_0x22c358,_0x560159){return client[_0x8def('0xa')](_0x2284a0,_0x30ae17)['then'](function(_0xc7145){logger[_0x8def('0xb')](_0x8def('0xc'),_0xcabda,_0x8def('0xd'));logger[_0x8def('0xe')](_0x8def('0xf'),_0xcabda,'request\x20sent',JSON[_0x8def('0x10')](_0xc7145));if(_0xc7145[_0x8def('0x11')]){if(_0xc7145[_0x8def('0x11')][_0x8def('0x12')]===0x1f4){logger[_0x8def('0x11')](_0x8def('0xc'),_0xcabda,_0xc7145[_0x8def('0x11')][_0x8def('0x13')]);return _0x560159(_0xc7145[_0x8def('0x11')][_0x8def('0x13')]);}logger[_0x8def('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0xcabda,_0xc7145[_0x8def('0x11')][_0x8def('0x13')]);return _0x22c358(_0xc7145['error']['message']);}else{logger['info'](_0x8def('0xc'),_0xcabda,'request\x20sent');_0x22c358(_0xc7145[_0x8def('0x14')][_0x8def('0x13')]);}})['catch'](function(_0x2bad21){logger[_0x8def('0x11')](_0x8def('0xc'),_0xcabda,_0x2bad21);_0x560159(_0x2bad21);});});}
\ No newline at end of file
index 232af2e..53b1d80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4dc=['put','/:id','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','show','post'];(function(_0x48ec16,_0x3536e0){var _0x272d42=function(_0x34051d){while(--_0x34051d){_0x48ec16['push'](_0x48ec16['shift']());}};_0x272d42(++_0x3536e0);}(_0xa4dc,0x16a));var _0xca4d=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xa4dc[_0x8a969d];return _0x1d8dc7;};'use strict';var multer=require(_0xca4d('0x0'));var util=require(_0xca4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xca4d('0x2'));var router=express[_0xca4d('0x3')]();var fs_extra=require(_0xca4d('0x4'));var auth=require(_0xca4d('0x5'));var interaction=require(_0xca4d('0x6'));var config=require('../../config/environment');var controller=require(_0xca4d('0x7'));router[_0xca4d('0x8')]('/',auth[_0xca4d('0x9')](),controller['index']);router[_0xca4d('0x8')]('/:id',auth[_0xca4d('0x9')](),controller[_0xca4d('0xa')]);router[_0xca4d('0xb')]('/',auth[_0xca4d('0x9')](),controller['create']);router[_0xca4d('0xc')](_0xca4d('0xd'),auth['isAuthenticated'](),controller[_0xca4d('0xe')]);router['delete'](_0xca4d('0xd'),auth[_0xca4d('0x9')](),controller[_0xca4d('0xf')]);module[_0xca4d('0x10')]=router;
\ No newline at end of file
+var _0x1115=['post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x3f29bd,_0x20215c){var _0x1e91df=function(_0x3f4f9c){while(--_0x3f4f9c){_0x3f29bd['push'](_0x3f29bd['shift']());}};_0x1e91df(++_0x20215c);}(_0x1115,0x1b6));var _0x5111=function(_0x49aefa,_0x1112d9){_0x49aefa=_0x49aefa-0x0;var _0x3d2b66=_0x1115[_0x49aefa];return _0x3d2b66;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var fs_extra=require(_0x5111('0x5'));var auth=require(_0x5111('0x6'));var interaction=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x5111('0x9')](),controller[_0x5111('0xa')]);router['get'](_0x5111('0xb'),auth[_0x5111('0x9')](),controller['show']);router[_0x5111('0xc')]('/',auth['isAuthenticated'](),controller[_0x5111('0xd')]);router[_0x5111('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5111('0xf')]);router['delete'](_0x5111('0xb'),auth['isAuthenticated'](),controller[_0x5111('0x10')]);module[_0x5111('0x11')]=router;
\ No newline at end of file
index 793ea75..2fd8487 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7be8=['sequelize','TEXT'];(function(_0x1c89c3,_0x3c2348){var _0x62d305=function(_0x5441a2){while(--_0x5441a2){_0x1c89c3['push'](_0x1c89c3['shift']());}};_0x62d305(++_0x3c2348);}(_0x7be8,0x80));var _0x87be=function(_0x555014,_0xf5b10b){_0x555014=_0x555014-0x0;var _0x2dbe09=_0x7be8[_0x555014];return _0x2dbe09;};'use strict';var Sequelize=require(_0x87be('0x0'));module['exports']={'tree':{'type':Sequelize[_0x87be('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x9cb2=['TEXT','sequelize','exports'];(function(_0x1ba7b6,_0x1b58bb){var _0x2f41b3=function(_0xc6e978){while(--_0xc6e978){_0x1ba7b6['push'](_0x1ba7b6['shift']());}};_0x2f41b3(++_0x1b58bb);}(_0x9cb2,0x16f));var _0x29cb=function(_0x19e7ce,_0x46462f){_0x19e7ce=_0x19e7ce-0x0;var _0xcc5a5b=_0x9cb2[_0x19e7ce];return _0xcc5a5b;};'use strict';var Sequelize=require(_0x29cb('0x0'));module[_0x29cb('0x1')]={'tree':{'type':Sequelize[_0x29cb('0x2')],'allowNull':![]}};
\ No newline at end of file
index 97159ce..8c94184 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc206=['fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xc206,0xae));var _0x6c20=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xc206[_0x1b6c6d];return _0x290d9d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c20('0x0'));var zipdir=require(_0x6c20('0x1'));var jsonpatch=require(_0x6c20('0x2'));var rp=require(_0x6c20('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6c20('0x4'));var util=require('util');var path=require(_0x6c20('0x5'));var sox=require(_0x6c20('0x6'));var csv=require('to-csv');var ejs=require(_0x6c20('0x7'));var fs=require('fs');var fs_extra=require(_0x6c20('0x8'));var _=require(_0x6c20('0x9'));var squel=require(_0x6c20('0xa'));var crypto=require(_0x6c20('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6c20('0xc'));var toCsv=require(_0x6c20('0xd'));var querystring=require(_0x6c20('0xe'));var Papa=require(_0x6c20('0xf'));var Redis=require(_0x6c20('0x10'));var authService=require(_0x6c20('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6c20('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6c20('0x13'));var utils=require(_0x6c20('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6c20('0x15'));var db=require(_0x6c20('0x16'))['db'];function respondWithStatusCode(_0x92280e,_0x484350){_0x484350=_0x484350||0xcc;return function(_0x5411f5){if(_0x5411f5){return _0x92280e['sendStatus'](_0x484350);}return _0x92280e[_0x6c20('0x17')](_0x484350)[_0x6c20('0x18')]();};}function respondWithResult(_0x456861,_0x2719df){_0x2719df=_0x2719df||0xc8;return function(_0x22805d){if(_0x22805d){return _0x456861['status'](_0x2719df)[_0x6c20('0x19')](_0x22805d);}};}function respondWithFilteredResult(_0x3634cc,_0x2eb939){return function(_0x37d4f8){if(_0x37d4f8){var _0x2bc2d3=typeof _0x2eb939[_0x6c20('0x1a')]==='undefined'&&typeof _0x2eb939[_0x6c20('0x1b')]===_0x6c20('0x1c');var _0x80ddea=_0x37d4f8[_0x6c20('0x1d')];var _0x22b0b2=_0x2bc2d3?0x0:_0x2eb939[_0x6c20('0x1a')];var _0x46ec47=_0x2bc2d3?_0x37d4f8[_0x6c20('0x1d')]:_0x2eb939['offset']+_0x2eb939[_0x6c20('0x1b')];var _0x7c88dd;if(_0x46ec47>=_0x80ddea){_0x46ec47=_0x80ddea;_0x7c88dd=0xc8;}else{_0x7c88dd=0xce;}_0x3634cc[_0x6c20('0x17')](_0x7c88dd);return _0x3634cc[_0x6c20('0x1e')](_0x6c20('0x1f'),_0x22b0b2+'-'+_0x46ec47+'/'+_0x80ddea)[_0x6c20('0x19')](_0x37d4f8);}return null;};}function patchUpdates(_0x2e77c6){return function(_0x510b6c){try{jsonpatch[_0x6c20('0x20')](_0x510b6c,_0x2e77c6,!![]);}catch(_0x2270bc){return BPromise['reject'](_0x2270bc);}return _0x510b6c['save']();};}function saveUpdates(_0x223c8f,_0x36da6e){return function(_0x767b77){if(_0x767b77){return _0x767b77[_0x6c20('0x21')](_0x223c8f)['then'](function(_0x1d865c){return _0x1d865c;});}return null;};}function removeEntity(_0x1f215a,_0x1b526f){return function(_0x4e8108){if(_0x4e8108){return _0x4e8108[_0x6c20('0x22')]()[_0x6c20('0x23')](function(){_0x1f215a[_0x6c20('0x17')](0xcc)[_0x6c20('0x18')]();});}};}function handleEntityNotFound(_0x4591d5,_0x457071){return function(_0x1665c8){if(!_0x1665c8){_0x4591d5[_0x6c20('0x24')](0x194);}return _0x1665c8;};}function handleError(_0x5d4695,_0x505ac1){_0x505ac1=_0x505ac1||0x1f4;return function(_0x533be1){logger[_0x6c20('0x25')](_0x533be1[_0x6c20('0x26')]);if(_0x533be1[_0x6c20('0x27')]){delete _0x533be1[_0x6c20('0x27')];}_0x5d4695['status'](_0x505ac1)[_0x6c20('0x28')](_0x533be1);};}exports[_0x6c20('0x29')]=function(_0x367491,_0x5791f7){var _0x461d2d={},_0x4892b6={},_0x246d82={'count':0x0,'rows':[]};var _0x84de8a=_[_0x6c20('0x2a')](db[_0x6c20('0x2b')][_0x6c20('0x2c')],function(_0x3b9739){return{'name':_0x3b9739[_0x6c20('0x2d')],'type':_0x3b9739[_0x6c20('0x2e')]['key']};});_0x4892b6[_0x6c20('0x2f')]=_['map'](_0x84de8a,_0x6c20('0x27'));_0x4892b6[_0x6c20('0x30')]=_['keys'](_0x367491[_0x6c20('0x30')]);_0x4892b6[_0x6c20('0x31')]=_['intersection'](_0x4892b6[_0x6c20('0x2f')],_0x4892b6['query']);_0x461d2d[_0x6c20('0x32')]=_[_0x6c20('0x33')](_0x4892b6[_0x6c20('0x2f')],qs[_0x6c20('0x34')](_0x367491[_0x6c20('0x30')][_0x6c20('0x34')]));_0x461d2d[_0x6c20('0x32')]=_0x461d2d[_0x6c20('0x32')][_0x6c20('0x35')]?_0x461d2d[_0x6c20('0x32')]:_0x4892b6['model'];if(!_0x367491['query'][_0x6c20('0x36')]('nolimit')){_0x461d2d[_0x6c20('0x1b')]=qs[_0x6c20('0x1b')](_0x367491[_0x6c20('0x30')]['limit']);_0x461d2d[_0x6c20('0x1a')]=qs['offset'](_0x367491['query'][_0x6c20('0x1a')]);}_0x461d2d[_0x6c20('0x37')]=qs[_0x6c20('0x38')](_0x367491[_0x6c20('0x30')][_0x6c20('0x38')]);_0x461d2d[_0x6c20('0x39')]=qs['filters'](_[_0x6c20('0x3a')](_0x367491[_0x6c20('0x30')],_0x4892b6[_0x6c20('0x31')]),_0x84de8a);if(_0x367491['query']['filter']){_0x461d2d[_0x6c20('0x39')]=_[_0x6c20('0x3b')](_0x461d2d[_0x6c20('0x39')],{'$or':_['map'](_0x84de8a,function(_0x2e4f93){if(_0x2e4f93[_0x6c20('0x2e')]!==_0x6c20('0x3c')){var _0x5cc0ff={};_0x5cc0ff[_0x2e4f93[_0x6c20('0x27')]]={'$like':'%'+_0x367491['query'][_0x6c20('0x3d')]+'%'};return _0x5cc0ff;}})});}_0x461d2d=_[_0x6c20('0x3b')]({},_0x461d2d,_0x367491[_0x6c20('0x3e')]);var _0x1d0669={'where':_0x461d2d[_0x6c20('0x39')]};return db['AnalyticTreeReport'][_0x6c20('0x1d')](_0x1d0669)[_0x6c20('0x23')](function(_0x40e716){_0x246d82[_0x6c20('0x1d')]=_0x40e716;if(_0x367491[_0x6c20('0x30')][_0x6c20('0x3f')]){_0x461d2d[_0x6c20('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x6c20('0x41')](_0x461d2d);})[_0x6c20('0x23')](function(_0x582922){_0x246d82['rows']=_0x582922;return _0x246d82;})[_0x6c20('0x23')](respondWithFilteredResult(_0x5791f7,_0x461d2d))['catch'](handleError(_0x5791f7,null));};exports[_0x6c20('0x42')]=function(_0x1d4e61,_0x51210f){var _0x5c2e51={'raw':!![],'where':{'id':_0x1d4e61[_0x6c20('0x43')]['id']}},_0x2c4d97={};_0x2c4d97[_0x6c20('0x2f')]=_[_0x6c20('0x44')](db[_0x6c20('0x2b')][_0x6c20('0x2c')]);_0x2c4d97[_0x6c20('0x30')]=_[_0x6c20('0x44')](_0x1d4e61[_0x6c20('0x30')]);_0x2c4d97['filters']=_[_0x6c20('0x33')](_0x2c4d97['model'],_0x2c4d97[_0x6c20('0x30')]);_0x5c2e51[_0x6c20('0x32')]=_['intersection'](_0x2c4d97[_0x6c20('0x2f')],qs[_0x6c20('0x34')](_0x1d4e61[_0x6c20('0x30')][_0x6c20('0x34')]));_0x5c2e51[_0x6c20('0x32')]=_0x5c2e51['attributes'][_0x6c20('0x35')]?_0x5c2e51[_0x6c20('0x32')]:_0x2c4d97[_0x6c20('0x2f')];if(_0x1d4e61[_0x6c20('0x30')][_0x6c20('0x3f')]){_0x5c2e51[_0x6c20('0x40')]=[{'all':!![]}];}_0x5c2e51=_['merge']({},_0x5c2e51,_0x1d4e61[_0x6c20('0x3e')]);return db[_0x6c20('0x2b')][_0x6c20('0x45')](_0x5c2e51)['then'](handleEntityNotFound(_0x51210f,null))['then'](respondWithResult(_0x51210f,null))[_0x6c20('0x46')](handleError(_0x51210f,null));};exports[_0x6c20('0x47')]=function(_0x20b386,_0xf11e7c){return db[_0x6c20('0x2b')][_0x6c20('0x47')](_0x20b386[_0x6c20('0x48')],{})[_0x6c20('0x23')](respondWithResult(_0xf11e7c,0xc9))[_0x6c20('0x46')](handleError(_0xf11e7c,null));};exports['update']=function(_0x181984,_0x44b973){if(_0x181984[_0x6c20('0x48')]['id']){delete _0x181984[_0x6c20('0x48')]['id'];}return db[_0x6c20('0x2b')][_0x6c20('0x45')]({'where':{'id':_0x181984[_0x6c20('0x43')]['id']}})[_0x6c20('0x23')](handleEntityNotFound(_0x44b973,null))['then'](saveUpdates(_0x181984[_0x6c20('0x48')],null))[_0x6c20('0x23')](respondWithResult(_0x44b973,null))['catch'](handleError(_0x44b973,null));};exports['destroy']=function(_0x8591c7,_0x22018b){return db[_0x6c20('0x2b')][_0x6c20('0x45')]({'where':{'id':_0x8591c7[_0x6c20('0x43')]['id']}})['then'](handleEntityNotFound(_0x22018b,null))[_0x6c20('0x23')](removeEntity(_0x22018b,null))['catch'](handleError(_0x22018b,null));};
\ No newline at end of file
+var _0x3f65=['destroy','error','stack','name','index','map','AnalyticTreeReport','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then'];(function(_0x1196b9,_0x15134a){var _0x405211=function(_0x55f78c){while(--_0x55f78c){_0x1196b9['push'](_0x1196b9['shift']());}};_0x405211(++_0x15134a);}(_0x3f65,0x70));var _0x53f6=function(_0x2d2906,_0x37ba99){_0x2d2906=_0x2d2906-0x0;var _0x5a62d3=_0x3f65[_0x2d2906];return _0x5a62d3;};'use strict';var emlformat=require(_0x53f6('0x0'));var rimraf=require(_0x53f6('0x1'));var zipdir=require(_0x53f6('0x2'));var jsonpatch=require(_0x53f6('0x3'));var rp=require(_0x53f6('0x4'));var moment=require(_0x53f6('0x5'));var BPromise=require(_0x53f6('0x6'));var Mustache=require(_0x53f6('0x7'));var util=require(_0x53f6('0x8'));var path=require(_0x53f6('0x9'));var sox=require('sox');var csv=require(_0x53f6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x53f6('0xb'));var _=require(_0x53f6('0xc'));var squel=require(_0x53f6('0xd'));var crypto=require(_0x53f6('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x53f6('0xa'));var querystring=require(_0x53f6('0xf'));var Papa=require(_0x53f6('0x10'));var Redis=require(_0x53f6('0x11'));var authService=require(_0x53f6('0x12'));var qs=require(_0x53f6('0x13'));var as=require(_0x53f6('0x14'));var hardwareService=require(_0x53f6('0x15'));var logger=require(_0x53f6('0x16'))(_0x53f6('0x17'));var utils=require(_0x53f6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x53f6('0x19'));var db=require(_0x53f6('0x1a'))['db'];function respondWithStatusCode(_0x457c4c,_0x2fb631){_0x2fb631=_0x2fb631||0xcc;return function(_0x4e6501){if(_0x4e6501){return _0x457c4c[_0x53f6('0x1b')](_0x2fb631);}return _0x457c4c['status'](_0x2fb631)[_0x53f6('0x1c')]();};}function respondWithResult(_0x3c732a,_0xcd3f91){_0xcd3f91=_0xcd3f91||0xc8;return function(_0x19fd6c){if(_0x19fd6c){return _0x3c732a[_0x53f6('0x1d')](_0xcd3f91)['json'](_0x19fd6c);}};}function respondWithFilteredResult(_0x29f0d1,_0x1dbdca){return function(_0x4cff5a){if(_0x4cff5a){var _0x2cc549=typeof _0x1dbdca[_0x53f6('0x1e')]===_0x53f6('0x1f')&&typeof _0x1dbdca[_0x53f6('0x20')]===_0x53f6('0x1f');var _0x5908d8=_0x4cff5a[_0x53f6('0x21')];var _0x15d615=_0x2cc549?0x0:_0x1dbdca[_0x53f6('0x1e')];var _0x56d70c=_0x2cc549?_0x4cff5a[_0x53f6('0x21')]:_0x1dbdca[_0x53f6('0x1e')]+_0x1dbdca[_0x53f6('0x20')];var _0x4880c7;if(_0x56d70c>=_0x5908d8){_0x56d70c=_0x5908d8;_0x4880c7=0xc8;}else{_0x4880c7=0xce;}_0x29f0d1[_0x53f6('0x1d')](_0x4880c7);return _0x29f0d1[_0x53f6('0x22')](_0x53f6('0x23'),_0x15d615+'-'+_0x56d70c+'/'+_0x5908d8)[_0x53f6('0x24')](_0x4cff5a);}return null;};}function patchUpdates(_0x17e96e){return function(_0x59a939){try{jsonpatch[_0x53f6('0x25')](_0x59a939,_0x17e96e,!![]);}catch(_0x341542){return BPromise['reject'](_0x341542);}return _0x59a939[_0x53f6('0x26')]();};}function saveUpdates(_0x42fd61,_0x2e7fba){return function(_0x266848){if(_0x266848){return _0x266848['update'](_0x42fd61)[_0x53f6('0x27')](function(_0x302bf6){return _0x302bf6;});}return null;};}function removeEntity(_0x208b02,_0x40681c){return function(_0x31b0fa){if(_0x31b0fa){return _0x31b0fa[_0x53f6('0x28')]()[_0x53f6('0x27')](function(){_0x208b02[_0x53f6('0x1d')](0xcc)[_0x53f6('0x1c')]();});}};}function handleEntityNotFound(_0x9614b3,_0x2563b9){return function(_0x4bb822){if(!_0x4bb822){_0x9614b3[_0x53f6('0x1b')](0x194);}return _0x4bb822;};}function handleError(_0x3a4905,_0x529a5d){_0x529a5d=_0x529a5d||0x1f4;return function(_0x3e67a1){logger[_0x53f6('0x29')](_0x3e67a1[_0x53f6('0x2a')]);if(_0x3e67a1[_0x53f6('0x2b')]){delete _0x3e67a1[_0x53f6('0x2b')];}_0x3a4905[_0x53f6('0x1d')](_0x529a5d)['send'](_0x3e67a1);};}exports[_0x53f6('0x2c')]=function(_0x37a078,_0x106e77){var _0x1fc93f={},_0x237919={},_0x47519e={'count':0x0,'rows':[]};var _0xaefca1=_[_0x53f6('0x2d')](db[_0x53f6('0x2e')]['rawAttributes'],function(_0x4b5685){return{'name':_0x4b5685[_0x53f6('0x2f')],'type':_0x4b5685['type']['key']};});_0x237919[_0x53f6('0x30')]=_[_0x53f6('0x2d')](_0xaefca1,_0x53f6('0x2b'));_0x237919[_0x53f6('0x31')]=_[_0x53f6('0x32')](_0x37a078[_0x53f6('0x31')]);_0x237919[_0x53f6('0x33')]=_[_0x53f6('0x34')](_0x237919[_0x53f6('0x30')],_0x237919[_0x53f6('0x31')]);_0x1fc93f[_0x53f6('0x35')]=_[_0x53f6('0x34')](_0x237919[_0x53f6('0x30')],qs['fields'](_0x37a078[_0x53f6('0x31')][_0x53f6('0x36')]));_0x1fc93f[_0x53f6('0x35')]=_0x1fc93f[_0x53f6('0x35')][_0x53f6('0x37')]?_0x1fc93f[_0x53f6('0x35')]:_0x237919['model'];if(!_0x37a078['query'][_0x53f6('0x38')]('nolimit')){_0x1fc93f['limit']=qs[_0x53f6('0x20')](_0x37a078[_0x53f6('0x31')][_0x53f6('0x20')]);_0x1fc93f[_0x53f6('0x1e')]=qs[_0x53f6('0x1e')](_0x37a078[_0x53f6('0x31')][_0x53f6('0x1e')]);}_0x1fc93f['order']=qs[_0x53f6('0x39')](_0x37a078[_0x53f6('0x31')][_0x53f6('0x39')]);_0x1fc93f[_0x53f6('0x3a')]=qs['filters'](_[_0x53f6('0x3b')](_0x37a078['query'],_0x237919[_0x53f6('0x33')]),_0xaefca1);if(_0x37a078[_0x53f6('0x31')][_0x53f6('0x3c')]){_0x1fc93f['where']=_[_0x53f6('0x3d')](_0x1fc93f[_0x53f6('0x3a')],{'$or':_[_0x53f6('0x2d')](_0xaefca1,function(_0x3c9f28){if(_0x3c9f28[_0x53f6('0x3e')]!==_0x53f6('0x3f')){var _0x54492c={};_0x54492c[_0x3c9f28[_0x53f6('0x2b')]]={'$like':'%'+_0x37a078[_0x53f6('0x31')][_0x53f6('0x3c')]+'%'};return _0x54492c;}})});}_0x1fc93f=_[_0x53f6('0x3d')]({},_0x1fc93f,_0x37a078['options']);var _0x1c0ddc={'where':_0x1fc93f[_0x53f6('0x3a')]};return db[_0x53f6('0x2e')][_0x53f6('0x21')](_0x1c0ddc)[_0x53f6('0x27')](function(_0x56c6a2){_0x47519e['count']=_0x56c6a2;if(_0x37a078[_0x53f6('0x31')][_0x53f6('0x40')]){_0x1fc93f['include']=[{'all':!![]}];}return db[_0x53f6('0x2e')][_0x53f6('0x41')](_0x1fc93f);})['then'](function(_0x2db9ce){_0x47519e[_0x53f6('0x42')]=_0x2db9ce;return _0x47519e;})['then'](respondWithFilteredResult(_0x106e77,_0x1fc93f))[_0x53f6('0x43')](handleError(_0x106e77,null));};exports[_0x53f6('0x44')]=function(_0x1f5fe4,_0x218eb8){var _0x219397={'raw':!![],'where':{'id':_0x1f5fe4[_0x53f6('0x45')]['id']}},_0x44e8a8={};_0x44e8a8[_0x53f6('0x30')]=_[_0x53f6('0x32')](db[_0x53f6('0x2e')][_0x53f6('0x46')]);_0x44e8a8[_0x53f6('0x31')]=_[_0x53f6('0x32')](_0x1f5fe4['query']);_0x44e8a8[_0x53f6('0x33')]=_[_0x53f6('0x34')](_0x44e8a8['model'],_0x44e8a8[_0x53f6('0x31')]);_0x219397[_0x53f6('0x35')]=_[_0x53f6('0x34')](_0x44e8a8['model'],qs[_0x53f6('0x36')](_0x1f5fe4[_0x53f6('0x31')]['fields']));_0x219397['attributes']=_0x219397[_0x53f6('0x35')][_0x53f6('0x37')]?_0x219397[_0x53f6('0x35')]:_0x44e8a8[_0x53f6('0x30')];if(_0x1f5fe4[_0x53f6('0x31')][_0x53f6('0x40')]){_0x219397[_0x53f6('0x47')]=[{'all':!![]}];}_0x219397=_[_0x53f6('0x3d')]({},_0x219397,_0x1f5fe4['options']);return db[_0x53f6('0x2e')][_0x53f6('0x48')](_0x219397)[_0x53f6('0x27')](handleEntityNotFound(_0x218eb8,null))['then'](respondWithResult(_0x218eb8,null))[_0x53f6('0x43')](handleError(_0x218eb8,null));};exports['create']=function(_0x2504d4,_0x581387){return db[_0x53f6('0x2e')][_0x53f6('0x49')](_0x2504d4[_0x53f6('0x4a')],{})[_0x53f6('0x27')](respondWithResult(_0x581387,0xc9))[_0x53f6('0x43')](handleError(_0x581387,null));};exports[_0x53f6('0x4b')]=function(_0x39d37b,_0x38027e){if(_0x39d37b[_0x53f6('0x4a')]['id']){delete _0x39d37b[_0x53f6('0x4a')]['id'];}return db[_0x53f6('0x2e')][_0x53f6('0x48')]({'where':{'id':_0x39d37b[_0x53f6('0x45')]['id']}})[_0x53f6('0x27')](handleEntityNotFound(_0x38027e,null))[_0x53f6('0x27')](saveUpdates(_0x39d37b[_0x53f6('0x4a')],null))[_0x53f6('0x27')](respondWithResult(_0x38027e,null))[_0x53f6('0x43')](handleError(_0x38027e,null));};exports[_0x53f6('0x28')]=function(_0x52737a,_0x28fcd3){return db['AnalyticTreeReport'][_0x53f6('0x48')]({'where':{'id':_0x52737a[_0x53f6('0x45')]['id']}})[_0x53f6('0x27')](handleEntityNotFound(_0x28fcd3,null))[_0x53f6('0x27')](removeEntity(_0x28fcd3,null))[_0x53f6('0x43')](handleError(_0x28fcd3,null));};
\ No newline at end of file
index 124b728..f8fa109 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x191d=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x4133fd,_0x1cd6ec){var _0x2365d6=function(_0x471734){while(--_0x471734){_0x4133fd['push'](_0x4133fd['shift']());}};_0x2365d6(++_0x1cd6ec);}(_0x191d,0x161));var _0xd191=function(_0x15a782,_0x25165f){_0x15a782=_0x15a782-0x0;var _0x376302=_0x191d[_0x15a782];return _0x376302;};'use strict';var _=require(_0xd191('0x0'));var util=require(_0xd191('0x1'));var logger=require(_0xd191('0x2'))(_0xd191('0x3'));var moment=require('moment');var BPromise=require(_0xd191('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd191('0x5'));var rimraf=require(_0xd191('0x6'));var config=require(_0xd191('0x7'));var attributes=require(_0xd191('0x8'));module[_0xd191('0x9')]=function(_0x4ffbd0,_0x56fe2c){return _0x4ffbd0[_0xd191('0xa')](_0xd191('0xb'),attributes,{'tableName':_0xd191('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9982=['exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes'];(function(_0x558abc,_0x58cc5b){var _0x2c0125=function(_0x85d138){while(--_0x85d138){_0x558abc['push'](_0x558abc['shift']());}};_0x2c0125(++_0x58cc5b);}(_0x9982,0x1b9));var _0x2998=function(_0x99bd01,_0x279ec8){_0x99bd01=_0x99bd01-0x0;var _0x228949=_0x9982[_0x99bd01];return _0x228949;};'use strict';var _=require(_0x2998('0x0'));var util=require(_0x2998('0x1'));var logger=require(_0x2998('0x2'))(_0x2998('0x3'));var moment=require(_0x2998('0x4'));var BPromise=require(_0x2998('0x5'));var rp=require(_0x2998('0x6'));var fs=require('fs');var path=require(_0x2998('0x7'));var rimraf=require('rimraf');var config=require(_0x2998('0x8'));var attributes=require(_0x2998('0x9'));module[_0x2998('0xa')]=function(_0x1ca6b4,_0x42266f){return _0x1ca6b4['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 57d5373..17c1d19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x41c87b,_0x52f73e){_0x41c87b=_0x41c87b-0x0;var _0x22506f=_0x7a54[_0x41c87b];return _0x22506f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x239bdb,_0x180517){var _0x406f33=function(_0x3eb497){while(--_0x3eb497){_0x239bdb['push'](_0x239bdb['shift']());}};_0x406f33(++_0x180517);}(_0x1261,0x144));var _0x1126=function(_0x270e46,_0x122174){_0x270e46=_0x270e46-0x0;var _0x18ca4e=_0x1261[_0x270e46];return _0x18ca4e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
index bb0b5e6..7182dd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60e4=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','post','create'];(function(_0xb2432a,_0x46ce8b){var _0x38ec39=function(_0x378ed7){while(--_0x378ed7){_0xb2432a['push'](_0xb2432a['shift']());}};_0x38ec39(++_0x46ce8b);}(_0x60e4,0xff));var _0x460e=function(_0x3e8096,_0xf1d389){_0x3e8096=_0x3e8096-0x0;var _0x3c2377=_0x60e4[_0x3e8096];return _0x3c2377;};'use strict';var multer=require(_0x460e('0x0'));var util=require(_0x460e('0x1'));var path=require(_0x460e('0x2'));var timeout=require(_0x460e('0x3'));var express=require(_0x460e('0x4'));var router=express[_0x460e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x460e('0x6'));var config=require(_0x460e('0x7'));var controller=require(_0x460e('0x8'));router['get']('/',auth[_0x460e('0x9')](),controller[_0x460e('0xa')]);router[_0x460e('0xb')](_0x460e('0xc'),auth[_0x460e('0x9')](),controller['show']);router[_0x460e('0xd')]('/',auth[_0x460e('0x9')](),controller[_0x460e('0xe')]);router['put'](_0x460e('0xc'),auth[_0x460e('0x9')](),controller['update']);router[_0x460e('0xf')]('/:id',auth[_0x460e('0x9')](),controller[_0x460e('0x10')]);module[_0x460e('0x11')]=router;
\ No newline at end of file
+var _0x0ca9=['get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ca9,0xc8));var _0x90ca=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ca9[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x90ca('0x0'));var util=require(_0x90ca('0x1'));var path=require(_0x90ca('0x2'));var timeout=require(_0x90ca('0x3'));var express=require('express');var router=express[_0x90ca('0x4')]();var fs_extra=require(_0x90ca('0x5'));var auth=require(_0x90ca('0x6'));var interaction=require(_0x90ca('0x7'));var config=require(_0x90ca('0x8'));var controller=require(_0x90ca('0x9'));router[_0x90ca('0xa')]('/',auth[_0x90ca('0xb')](),controller[_0x90ca('0xc')]);router[_0x90ca('0xa')]('/:id',auth[_0x90ca('0xb')](),controller['show']);router[_0x90ca('0xd')]('/',auth[_0x90ca('0xb')](),controller[_0x90ca('0xe')]);router[_0x90ca('0xf')](_0x90ca('0x10'),auth[_0x90ca('0xb')](),controller[_0x90ca('0x11')]);router[_0x90ca('0x12')]('/:id',auth[_0x90ca('0xb')](),controller[_0x90ca('0x13')]);module[_0x90ca('0x14')]=router;
\ No newline at end of file
index 4e1985b..201da1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89c3=['sequelize','exports','STRING'];(function(_0x2dcc80,_0x96b865){var _0x1289d9=function(_0x155eab){while(--_0x155eab){_0x2dcc80['push'](_0x2dcc80['shift']());}};_0x1289d9(++_0x96b865);}(_0x89c3,0xff));var _0x389c=function(_0x4a8829,_0x36f847){_0x4a8829=_0x4a8829-0x0;var _0x22dc42=_0x89c3[_0x4a8829];return _0x22dc42;};'use strict';var Sequelize=require(_0x389c('0x0'));module[_0x389c('0x1')]={'name':{'type':Sequelize[_0x389c('0x2')]},'basename':{'type':Sequelize[_0x389c('0x2')]},'type':{'type':Sequelize[_0x389c('0x2')]}};
\ No newline at end of file
+var _0x28a2=['sequelize','exports','STRING'];(function(_0x151eb9,_0x409e99){var _0x31fc56=function(_0x409ce9){while(--_0x409ce9){_0x151eb9['push'](_0x151eb9['shift']());}};_0x31fc56(++_0x409e99);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x228a('0x0'));module[_0x228a('0x1')]={'name':{'type':Sequelize[_0x228a('0x2')]},'basename':{'type':Sequelize[_0x228a('0x2')]},'type':{'type':Sequelize[_0x228a('0x2')]}};
\ No newline at end of file
index b8948a4..3efe258 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecd4=['keys','find','clone','include','get','omit','createdAt','body','create','originalname','basename','file','filename','mimetype','download','server/files/attachments/','join','offline-chat/','eml-format','rimraf','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','sendStatus','error','name','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params'];(function(_0x5c3526,_0x2a1e90){var _0xec27a2=function(_0x5ac4e1){while(--_0x5ac4e1){_0x5c3526['push'](_0x5c3526['shift']());}};_0xec27a2(++_0x2a1e90);}(_0xecd4,0xc6));var _0x4ecd=function(_0x4cb0e3,_0x5e0445){_0x4cb0e3=_0x4cb0e3-0x0;var _0x46ea93=_0xecd4[_0x4cb0e3];return _0x46ea93;};'use strict';var emlformat=require(_0x4ecd('0x0'));var rimraf=require(_0x4ecd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ecd('0x2'));var Mustache=require(_0x4ecd('0x3'));var util=require('util');var path=require(_0x4ecd('0x4'));var sox=require(_0x4ecd('0x5'));var csv=require(_0x4ecd('0x6'));var ejs=require(_0x4ecd('0x7'));var fs=require('fs');var fs_extra=require(_0x4ecd('0x8'));var _=require(_0x4ecd('0x9'));var squel=require('squel');var crypto=require(_0x4ecd('0xa'));var jsforce=require(_0x4ecd('0xb'));var deskjs=require(_0x4ecd('0xc'));var toCsv=require(_0x4ecd('0x6'));var querystring=require(_0x4ecd('0xd'));var Papa=require(_0x4ecd('0xe'));var Redis=require('ioredis');var authService=require(_0x4ecd('0xf'));var qs=require(_0x4ecd('0x10'));var as=require(_0x4ecd('0x11'));var hardwareService=require(_0x4ecd('0x12'));var logger=require(_0x4ecd('0x13'))(_0x4ecd('0x14'));var utils=require(_0x4ecd('0x15'));var config=require(_0x4ecd('0x16'));var licenseUtil=require(_0x4ecd('0x17'));var db=require(_0x4ecd('0x18'))['db'];function respondWithStatusCode(_0x1bdeca,_0x31f01e){_0x31f01e=_0x31f01e||0xcc;return function(_0x1b6600){if(_0x1b6600){return _0x1bdeca['sendStatus'](_0x31f01e);}return _0x1bdeca[_0x4ecd('0x19')](_0x31f01e)[_0x4ecd('0x1a')]();};}function respondWithResult(_0x1a7041,_0x3227b3){_0x3227b3=_0x3227b3||0xc8;return function(_0x211fbc){if(_0x211fbc){return _0x1a7041[_0x4ecd('0x19')](_0x3227b3)[_0x4ecd('0x1b')](_0x211fbc);}};}function respondWithFilteredResult(_0x32254e,_0x30c062){return function(_0x3dc5dc){if(_0x3dc5dc){var _0x4483a5=typeof _0x30c062[_0x4ecd('0x1c')]===_0x4ecd('0x1d')&&typeof _0x30c062[_0x4ecd('0x1e')]===_0x4ecd('0x1d');var _0x45ece2=_0x3dc5dc[_0x4ecd('0x1f')];var _0x1dbdf5=_0x4483a5?0x0:_0x30c062[_0x4ecd('0x1c')];var _0x43f2aa=_0x4483a5?_0x3dc5dc[_0x4ecd('0x1f')]:_0x30c062[_0x4ecd('0x1c')]+_0x30c062[_0x4ecd('0x1e')];var _0x390ded;if(_0x43f2aa>=_0x45ece2){_0x43f2aa=_0x45ece2;_0x390ded=0xc8;}else{_0x390ded=0xce;}_0x32254e[_0x4ecd('0x19')](_0x390ded);return _0x32254e[_0x4ecd('0x20')]('Content-Range',_0x1dbdf5+'-'+_0x43f2aa+'/'+_0x45ece2)['json'](_0x3dc5dc);}return null;};}function patchUpdates(_0x38fea7){return function(_0x263273){try{jsonpatch[_0x4ecd('0x21')](_0x263273,_0x38fea7,!![]);}catch(_0xb2c982){return BPromise[_0x4ecd('0x22')](_0xb2c982);}return _0x263273[_0x4ecd('0x23')]();};}function saveUpdates(_0x17a63f,_0x5494dc){return function(_0x1af18e){if(_0x1af18e){return _0x1af18e[_0x4ecd('0x24')](_0x17a63f)['then'](function(_0x3ffa29){return _0x3ffa29;});}return null;};}function removeEntity(_0x83bce5,_0x325f8a){return function(_0x38ab8b){if(_0x38ab8b){return _0x38ab8b[_0x4ecd('0x25')]()[_0x4ecd('0x26')](function(){_0x83bce5['status'](0xcc)[_0x4ecd('0x1a')]();});}};}function handleEntityNotFound(_0x239e22,_0x1719f0){return function(_0x113c7a){if(!_0x113c7a){_0x239e22[_0x4ecd('0x27')](0x194);}return _0x113c7a;};}function handleError(_0x3b11f1,_0x14d42f){_0x14d42f=_0x14d42f||0x1f4;return function(_0x1d0598){logger[_0x4ecd('0x28')](_0x1d0598['stack']);if(_0x1d0598[_0x4ecd('0x29')]){delete _0x1d0598[_0x4ecd('0x29')];}_0x3b11f1[_0x4ecd('0x19')](_0x14d42f)['send'](_0x1d0598);};}exports[_0x4ecd('0x2a')]=function(_0xe4402e,_0x13432b){var _0x4d18c4={},_0x2fd398={},_0x276794={'count':0x0,'rows':[]};var _0x2a025a=_['map'](db[_0x4ecd('0x2b')][_0x4ecd('0x2c')],function(_0x2ccebd){return{'name':_0x2ccebd[_0x4ecd('0x2d')],'type':_0x2ccebd[_0x4ecd('0x2e')][_0x4ecd('0x2f')]};});_0x2fd398[_0x4ecd('0x30')]=_[_0x4ecd('0x31')](_0x2a025a,_0x4ecd('0x29'));_0x2fd398[_0x4ecd('0x32')]=_['keys'](_0xe4402e[_0x4ecd('0x32')]);_0x2fd398['filters']=_[_0x4ecd('0x33')](_0x2fd398['model'],_0x2fd398[_0x4ecd('0x32')]);_0x4d18c4[_0x4ecd('0x34')]=_[_0x4ecd('0x33')](_0x2fd398['model'],qs[_0x4ecd('0x35')](_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x35')]));_0x4d18c4[_0x4ecd('0x34')]=_0x4d18c4[_0x4ecd('0x34')][_0x4ecd('0x36')]?_0x4d18c4[_0x4ecd('0x34')]:_0x2fd398[_0x4ecd('0x30')];if(!_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x37')](_0x4ecd('0x38'))){_0x4d18c4[_0x4ecd('0x1e')]=qs[_0x4ecd('0x1e')](_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x1e')]);_0x4d18c4[_0x4ecd('0x1c')]=qs['offset'](_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x1c')]);}_0x4d18c4[_0x4ecd('0x39')]=qs[_0x4ecd('0x3a')](_0xe4402e['query'][_0x4ecd('0x3a')]);_0x4d18c4['where']=qs[_0x4ecd('0x3b')](_[_0x4ecd('0x3c')](_0xe4402e[_0x4ecd('0x32')],_0x2fd398[_0x4ecd('0x3b')]),_0x2a025a);if(_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x3d')]){_0x4d18c4[_0x4ecd('0x3e')]=_[_0x4ecd('0x3f')](_0x4d18c4[_0x4ecd('0x3e')],{'$or':_[_0x4ecd('0x31')](_0x2a025a,function(_0x335602){if(_0x335602[_0x4ecd('0x2e')]!==_0x4ecd('0x40')){var _0x4fb543={};_0x4fb543[_0x335602[_0x4ecd('0x29')]]={'$like':'%'+_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x3d')]+'%'};return _0x4fb543;}})});}_0x4d18c4=_[_0x4ecd('0x3f')]({},_0x4d18c4,_0xe4402e[_0x4ecd('0x41')]);var _0x38f25d={'where':_0x4d18c4[_0x4ecd('0x3e')]};return db[_0x4ecd('0x2b')][_0x4ecd('0x1f')](_0x38f25d)[_0x4ecd('0x26')](function(_0x47103e){_0x276794[_0x4ecd('0x1f')]=_0x47103e;if(_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x42')]){_0x4d18c4['include']=[{'all':!![]}];}return db['Attachment'][_0x4ecd('0x43')](_0x4d18c4);})[_0x4ecd('0x26')](function(_0x3898c6){_0x276794[_0x4ecd('0x44')]=_0x3898c6;return _0x276794;})[_0x4ecd('0x26')](respondWithFilteredResult(_0x13432b,_0x4d18c4))[_0x4ecd('0x45')](handleError(_0x13432b,null));};exports[_0x4ecd('0x46')]=function(_0x166c94,_0x194118){var _0x805890={'raw':!![],'where':{'id':_0x166c94[_0x4ecd('0x47')]['id']}},_0x279c54={};_0x279c54['model']=_[_0x4ecd('0x48')](db[_0x4ecd('0x2b')][_0x4ecd('0x2c')]);_0x279c54[_0x4ecd('0x32')]=_['keys'](_0x166c94['query']);_0x279c54['filters']=_['intersection'](_0x279c54[_0x4ecd('0x30')],_0x279c54[_0x4ecd('0x32')]);_0x805890[_0x4ecd('0x34')]=_['intersection'](_0x279c54['model'],qs[_0x4ecd('0x35')](_0x166c94[_0x4ecd('0x32')]['fields']));_0x805890[_0x4ecd('0x34')]=_0x805890[_0x4ecd('0x34')][_0x4ecd('0x36')]?_0x805890[_0x4ecd('0x34')]:_0x279c54['model'];if(_0x166c94[_0x4ecd('0x32')][_0x4ecd('0x42')]){_0x805890['include']=[{'all':!![]}];}_0x805890=_['merge']({},_0x805890,_0x166c94[_0x4ecd('0x41')]);return db[_0x4ecd('0x2b')][_0x4ecd('0x49')](_0x805890)[_0x4ecd('0x26')](handleEntityNotFound(_0x194118,null))[_0x4ecd('0x26')](respondWithResult(_0x194118,null))['catch'](handleError(_0x194118,null));};exports[_0x4ecd('0x4a')]=function(_0x3210a8,_0x3aa2c9){var _0x4cc1a1={'where':{'id':_0x3210a8[_0x4ecd('0x47')]['id']}},_0x2ebbf2={};_0x2ebbf2['model']=_[_0x4ecd('0x48')](db[_0x4ecd('0x2b')][_0x4ecd('0x2c')]);_0x4cc1a1[_0x4ecd('0x34')]=_[_0x4ecd('0x33')](_0x2ebbf2[_0x4ecd('0x30')],qs[_0x4ecd('0x35')](_0x3210a8['query'][_0x4ecd('0x35')]));_0x4cc1a1[_0x4ecd('0x34')]=_0x4cc1a1[_0x4ecd('0x34')][_0x4ecd('0x36')]?_0x4cc1a1['attributes']:_0x2ebbf2[_0x4ecd('0x30')];if(_0x3210a8[_0x4ecd('0x32')][_0x4ecd('0x42')]){_0x4cc1a1[_0x4ecd('0x4b')]=[{'all':!![]}];}_0x4cc1a1=_[_0x4ecd('0x3f')]({},_0x4cc1a1,_0x3210a8[_0x4ecd('0x41')]);return db['Attachment'][_0x4ecd('0x49')](_0x4cc1a1)['then'](handleEntityNotFound(_0x3aa2c9,null))['then'](function(_0x2caded){if(_0x2caded){var _0x1280a5=_0x2caded[_0x4ecd('0x4c')]({'plain':!![]});_0x1280a5=qs[_0x4ecd('0x4d')](_0x1280a5,['id',_0x4ecd('0x4e'),'updatedAt']);_0x3210a8[_0x4ecd('0x4f')]=_['omit'](_0x3210a8['body'],['id',_0x4ecd('0x4e'),'updatedAt']);return db['Attachment'][_0x4ecd('0x50')](_[_0x4ecd('0x3f')](_0x1280a5,_0x3210a8['body']),{'include':_0x3210a8['query'][_0x4ecd('0x42')]?[{'all':!![]}]:undefined});}})[_0x4ecd('0x26')](respondWithResult(_0x3aa2c9,0xc9))[_0x4ecd('0x45')](handleError(_0x3aa2c9,null));};exports['update']=function(_0x289308,_0x1af643){if(_0x289308['body']['id']){delete _0x289308[_0x4ecd('0x4f')]['id'];}return db[_0x4ecd('0x2b')][_0x4ecd('0x49')]({'where':{'id':_0x289308[_0x4ecd('0x47')]['id']}})[_0x4ecd('0x26')](handleEntityNotFound(_0x1af643,null))[_0x4ecd('0x26')](saveUpdates(_0x289308[_0x4ecd('0x4f')],null))['then'](respondWithResult(_0x1af643,null))[_0x4ecd('0x45')](handleError(_0x1af643,null));};exports[_0x4ecd('0x25')]=function(_0x4fd831,_0x4ff466){return db[_0x4ecd('0x2b')][_0x4ecd('0x49')]({'where':{'id':_0x4fd831[_0x4ecd('0x47')]['id']}})[_0x4ecd('0x26')](handleEntityNotFound(_0x4ff466,null))['then'](removeEntity(_0x4ff466,null))[_0x4ecd('0x45')](handleError(_0x4ff466,null));};exports[_0x4ecd('0x50')]=function(_0x4a69f8,_0x2869cc,_0x12a0b3){_0x4a69f8[_0x4ecd('0x4f')]['name']=_0x4a69f8['file'][_0x4ecd('0x51')];_0x4a69f8[_0x4ecd('0x4f')][_0x4ecd('0x52')]=_0x4a69f8[_0x4ecd('0x53')][_0x4ecd('0x54')];_0x4a69f8[_0x4ecd('0x4f')][_0x4ecd('0x2e')]=_0x4a69f8['file'][_0x4ecd('0x55')];return db['Attachment'][_0x4ecd('0x50')](_0x4a69f8[_0x4ecd('0x4f')])[_0x4ecd('0x26')](respondWithResult(_0x2869cc,0xc9))[_0x4ecd('0x45')](handleError(_0x2869cc,null));};exports[_0x4ecd('0x56')]=function(_0x3ad04a,_0x3cb7da,_0x46d78d){return db['Attachment']['findOne']({'where':{'id':_0x3ad04a[_0x4ecd('0x47')]['id']},'raw':!![]})[_0x4ecd('0x26')](handleEntityNotFound(_0x3cb7da,null))[_0x4ecd('0x26')](function(_0x39b149){if(_0x39b149){var _0x39c1b2=_0x39b149['ChatOfflineMessageId']!==null;var _0x2be4be=path['join'](config['root'],_0x4ecd('0x57'));if(_0x39c1b2){_0x2be4be=path[_0x4ecd('0x58')](_0x2be4be,_0x4ecd('0x59'));}var _0x194b64=path[_0x4ecd('0x58')](_0x2be4be,_0x39b149[_0x4ecd('0x52')]);return _0x3cb7da['download'](_0x194b64);}})[_0x4ecd('0x45')](handleError(_0x3cb7da,null));};
\ No newline at end of file
+var _0xf9c3=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','then','includeAll','findAll','catch','show','include','options','find','params','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','name','send','map','Attachment','rawAttributes'];(function(_0x3c37e8,_0x2f7497){var _0xf03bf5=function(_0x3c1316){while(--_0x3c1316){_0x3c37e8['push'](_0x3c37e8['shift']());}};_0xf03bf5(++_0x2f7497);}(_0xf9c3,0x18c));var _0x3f9c=function(_0x4704dc,_0x575a5f){_0x4704dc=_0x4704dc-0x0;var _0x254d81=_0xf9c3[_0x4704dc];return _0x254d81;};'use strict';var emlformat=require(_0x3f9c('0x0'));var rimraf=require(_0x3f9c('0x1'));var zipdir=require(_0x3f9c('0x2'));var jsonpatch=require(_0x3f9c('0x3'));var rp=require(_0x3f9c('0x4'));var moment=require(_0x3f9c('0x5'));var BPromise=require(_0x3f9c('0x6'));var Mustache=require(_0x3f9c('0x7'));var util=require(_0x3f9c('0x8'));var path=require(_0x3f9c('0x9'));var sox=require(_0x3f9c('0xa'));var csv=require(_0x3f9c('0xb'));var ejs=require(_0x3f9c('0xc'));var fs=require('fs');var fs_extra=require(_0x3f9c('0xd'));var _=require(_0x3f9c('0xe'));var squel=require('squel');var crypto=require(_0x3f9c('0xf'));var jsforce=require(_0x3f9c('0x10'));var deskjs=require(_0x3f9c('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3f9c('0x12'));var Redis=require(_0x3f9c('0x13'));var authService=require(_0x3f9c('0x14'));var qs=require(_0x3f9c('0x15'));var as=require(_0x3f9c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f9c('0x17'))('api');var utils=require(_0x3f9c('0x18'));var config=require(_0x3f9c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f9c('0x1a'))['db'];function respondWithStatusCode(_0x7b8507,_0x3e73c5){_0x3e73c5=_0x3e73c5||0xcc;return function(_0x2d9ead){if(_0x2d9ead){return _0x7b8507[_0x3f9c('0x1b')](_0x3e73c5);}return _0x7b8507[_0x3f9c('0x1c')](_0x3e73c5)[_0x3f9c('0x1d')]();};}function respondWithResult(_0x4783e3,_0x5c743d){_0x5c743d=_0x5c743d||0xc8;return function(_0x4a83c5){if(_0x4a83c5){return _0x4783e3[_0x3f9c('0x1c')](_0x5c743d)['json'](_0x4a83c5);}};}function respondWithFilteredResult(_0x3149aa,_0x3e5f00){return function(_0x975dc1){if(_0x975dc1){var _0x5c04c0=typeof _0x3e5f00[_0x3f9c('0x1e')]===_0x3f9c('0x1f')&&typeof _0x3e5f00[_0x3f9c('0x20')]==='undefined';var _0x356e92=_0x975dc1[_0x3f9c('0x21')];var _0x5872fc=_0x5c04c0?0x0:_0x3e5f00[_0x3f9c('0x1e')];var _0x294efe=_0x5c04c0?_0x975dc1[_0x3f9c('0x21')]:_0x3e5f00[_0x3f9c('0x1e')]+_0x3e5f00[_0x3f9c('0x20')];var _0x53f8f3;if(_0x294efe>=_0x356e92){_0x294efe=_0x356e92;_0x53f8f3=0xc8;}else{_0x53f8f3=0xce;}_0x3149aa[_0x3f9c('0x1c')](_0x53f8f3);return _0x3149aa[_0x3f9c('0x22')](_0x3f9c('0x23'),_0x5872fc+'-'+_0x294efe+'/'+_0x356e92)['json'](_0x975dc1);}return null;};}function patchUpdates(_0x34ed5c){return function(_0x480774){try{jsonpatch[_0x3f9c('0x24')](_0x480774,_0x34ed5c,!![]);}catch(_0x500053){return BPromise['reject'](_0x500053);}return _0x480774['save']();};}function saveUpdates(_0x3a127b,_0xfc6ca5){return function(_0x5d97a4){if(_0x5d97a4){return _0x5d97a4[_0x3f9c('0x25')](_0x3a127b)['then'](function(_0x38f33b){return _0x38f33b;});}return null;};}function removeEntity(_0x3dbe3d,_0x532510){return function(_0x632a86){if(_0x632a86){return _0x632a86[_0x3f9c('0x26')]()['then'](function(){_0x3dbe3d[_0x3f9c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2120d2,_0x1b02f8){return function(_0x397910){if(!_0x397910){_0x2120d2[_0x3f9c('0x1b')](0x194);}return _0x397910;};}function handleError(_0x2284ef,_0x2cba4f){_0x2cba4f=_0x2cba4f||0x1f4;return function(_0xa30c69){logger['error'](_0xa30c69['stack']);if(_0xa30c69[_0x3f9c('0x27')]){delete _0xa30c69[_0x3f9c('0x27')];}_0x2284ef['status'](_0x2cba4f)[_0x3f9c('0x28')](_0xa30c69);};}exports['index']=function(_0x182191,_0x4666c4){var _0x488d15={},_0x1e88f9={},_0x3db04b={'count':0x0,'rows':[]};var _0x46cdc6=_[_0x3f9c('0x29')](db[_0x3f9c('0x2a')][_0x3f9c('0x2b')],function(_0x1158ab){return{'name':_0x1158ab[_0x3f9c('0x2c')],'type':_0x1158ab[_0x3f9c('0x2d')][_0x3f9c('0x2e')]};});_0x1e88f9[_0x3f9c('0x2f')]=_[_0x3f9c('0x29')](_0x46cdc6,_0x3f9c('0x27'));_0x1e88f9[_0x3f9c('0x30')]=_[_0x3f9c('0x31')](_0x182191[_0x3f9c('0x30')]);_0x1e88f9[_0x3f9c('0x32')]=_[_0x3f9c('0x33')](_0x1e88f9['model'],_0x1e88f9[_0x3f9c('0x30')]);_0x488d15[_0x3f9c('0x34')]=_['intersection'](_0x1e88f9[_0x3f9c('0x2f')],qs[_0x3f9c('0x35')](_0x182191[_0x3f9c('0x30')]['fields']));_0x488d15[_0x3f9c('0x34')]=_0x488d15[_0x3f9c('0x34')][_0x3f9c('0x36')]?_0x488d15['attributes']:_0x1e88f9[_0x3f9c('0x2f')];if(!_0x182191[_0x3f9c('0x30')][_0x3f9c('0x37')](_0x3f9c('0x38'))){_0x488d15['limit']=qs['limit'](_0x182191[_0x3f9c('0x30')]['limit']);_0x488d15[_0x3f9c('0x1e')]=qs[_0x3f9c('0x1e')](_0x182191[_0x3f9c('0x30')][_0x3f9c('0x1e')]);}_0x488d15[_0x3f9c('0x39')]=qs['sort'](_0x182191['query'][_0x3f9c('0x3a')]);_0x488d15[_0x3f9c('0x3b')]=qs[_0x3f9c('0x32')](_['pick'](_0x182191['query'],_0x1e88f9['filters']),_0x46cdc6);if(_0x182191[_0x3f9c('0x30')][_0x3f9c('0x3c')]){_0x488d15[_0x3f9c('0x3b')]=_[_0x3f9c('0x3d')](_0x488d15['where'],{'$or':_[_0x3f9c('0x29')](_0x46cdc6,function(_0x298bf6){if(_0x298bf6[_0x3f9c('0x2d')]!==_0x3f9c('0x3e')){var _0x4a8fc2={};_0x4a8fc2[_0x298bf6['name']]={'$like':'%'+_0x182191['query'][_0x3f9c('0x3c')]+'%'};return _0x4a8fc2;}})});}_0x488d15=_['merge']({},_0x488d15,_0x182191['options']);var _0x279eb9={'where':_0x488d15[_0x3f9c('0x3b')]};return db[_0x3f9c('0x2a')][_0x3f9c('0x21')](_0x279eb9)[_0x3f9c('0x3f')](function(_0x3214b6){_0x3db04b[_0x3f9c('0x21')]=_0x3214b6;if(_0x182191['query'][_0x3f9c('0x40')]){_0x488d15['include']=[{'all':!![]}];}return db[_0x3f9c('0x2a')][_0x3f9c('0x41')](_0x488d15);})['then'](function(_0x5e466a){_0x3db04b['rows']=_0x5e466a;return _0x3db04b;})[_0x3f9c('0x3f')](respondWithFilteredResult(_0x4666c4,_0x488d15))[_0x3f9c('0x42')](handleError(_0x4666c4,null));};exports[_0x3f9c('0x43')]=function(_0x27692b,_0x3c9aa9){var _0x5b6e85={'raw':!![],'where':{'id':_0x27692b['params']['id']}},_0x468b69={};_0x468b69['model']=_['keys'](db['Attachment'][_0x3f9c('0x2b')]);_0x468b69['query']=_[_0x3f9c('0x31')](_0x27692b['query']);_0x468b69[_0x3f9c('0x32')]=_[_0x3f9c('0x33')](_0x468b69['model'],_0x468b69[_0x3f9c('0x30')]);_0x5b6e85[_0x3f9c('0x34')]=_['intersection'](_0x468b69[_0x3f9c('0x2f')],qs['fields'](_0x27692b[_0x3f9c('0x30')][_0x3f9c('0x35')]));_0x5b6e85[_0x3f9c('0x34')]=_0x5b6e85[_0x3f9c('0x34')]['length']?_0x5b6e85['attributes']:_0x468b69[_0x3f9c('0x2f')];if(_0x27692b[_0x3f9c('0x30')][_0x3f9c('0x40')]){_0x5b6e85[_0x3f9c('0x44')]=[{'all':!![]}];}_0x5b6e85=_[_0x3f9c('0x3d')]({},_0x5b6e85,_0x27692b[_0x3f9c('0x45')]);return db['Attachment'][_0x3f9c('0x46')](_0x5b6e85)['then'](handleEntityNotFound(_0x3c9aa9,null))['then'](respondWithResult(_0x3c9aa9,null))[_0x3f9c('0x42')](handleError(_0x3c9aa9,null));};exports['clone']=function(_0x4ae2a9,_0x49eba5){var _0x1ccbb8={'where':{'id':_0x4ae2a9[_0x3f9c('0x47')]['id']}},_0x2df8e2={};_0x2df8e2[_0x3f9c('0x2f')]=_[_0x3f9c('0x31')](db[_0x3f9c('0x2a')][_0x3f9c('0x2b')]);_0x1ccbb8[_0x3f9c('0x34')]=_[_0x3f9c('0x33')](_0x2df8e2[_0x3f9c('0x2f')],qs[_0x3f9c('0x35')](_0x4ae2a9[_0x3f9c('0x30')][_0x3f9c('0x35')]));_0x1ccbb8[_0x3f9c('0x34')]=_0x1ccbb8['attributes']['length']?_0x1ccbb8[_0x3f9c('0x34')]:_0x2df8e2[_0x3f9c('0x2f')];if(_0x4ae2a9[_0x3f9c('0x30')][_0x3f9c('0x40')]){_0x1ccbb8['include']=[{'all':!![]}];}_0x1ccbb8=_[_0x3f9c('0x3d')]({},_0x1ccbb8,_0x4ae2a9['options']);return db[_0x3f9c('0x2a')][_0x3f9c('0x46')](_0x1ccbb8)[_0x3f9c('0x3f')](handleEntityNotFound(_0x49eba5,null))['then'](function(_0x5261d0){if(_0x5261d0){var _0x5ef6ac=_0x5261d0['get']({'plain':!![]});_0x5ef6ac=qs[_0x3f9c('0x48')](_0x5ef6ac,['id',_0x3f9c('0x49'),_0x3f9c('0x4a')]);_0x4ae2a9[_0x3f9c('0x4b')]=_[_0x3f9c('0x48')](_0x4ae2a9[_0x3f9c('0x4b')],['id',_0x3f9c('0x49'),_0x3f9c('0x4a')]);return db[_0x3f9c('0x2a')][_0x3f9c('0x4c')](_[_0x3f9c('0x3d')](_0x5ef6ac,_0x4ae2a9[_0x3f9c('0x4b')]),{'include':_0x4ae2a9['query'][_0x3f9c('0x40')]?[{'all':!![]}]:undefined});}})[_0x3f9c('0x3f')](respondWithResult(_0x49eba5,0xc9))[_0x3f9c('0x42')](handleError(_0x49eba5,null));};exports[_0x3f9c('0x25')]=function(_0xd20d2,_0xfdc48b){if(_0xd20d2[_0x3f9c('0x4b')]['id']){delete _0xd20d2[_0x3f9c('0x4b')]['id'];}return db[_0x3f9c('0x2a')]['find']({'where':{'id':_0xd20d2[_0x3f9c('0x47')]['id']}})[_0x3f9c('0x3f')](handleEntityNotFound(_0xfdc48b,null))[_0x3f9c('0x3f')](saveUpdates(_0xd20d2[_0x3f9c('0x4b')],null))[_0x3f9c('0x3f')](respondWithResult(_0xfdc48b,null))[_0x3f9c('0x42')](handleError(_0xfdc48b,null));};exports[_0x3f9c('0x26')]=function(_0x2355fc,_0x1d4b57){return db[_0x3f9c('0x2a')][_0x3f9c('0x46')]({'where':{'id':_0x2355fc['params']['id']}})[_0x3f9c('0x3f')](handleEntityNotFound(_0x1d4b57,null))[_0x3f9c('0x3f')](removeEntity(_0x1d4b57,null))[_0x3f9c('0x42')](handleError(_0x1d4b57,null));};exports[_0x3f9c('0x4c')]=function(_0x361974,_0x2db4bf,_0x5bdd99){_0x361974[_0x3f9c('0x4b')][_0x3f9c('0x27')]=_0x361974[_0x3f9c('0x4d')][_0x3f9c('0x4e')];_0x361974[_0x3f9c('0x4b')][_0x3f9c('0x4f')]=_0x361974[_0x3f9c('0x4d')][_0x3f9c('0x50')];_0x361974[_0x3f9c('0x4b')][_0x3f9c('0x2d')]=_0x361974[_0x3f9c('0x4d')][_0x3f9c('0x51')];return db[_0x3f9c('0x2a')][_0x3f9c('0x4c')](_0x361974[_0x3f9c('0x4b')])[_0x3f9c('0x3f')](respondWithResult(_0x2db4bf,0xc9))[_0x3f9c('0x42')](handleError(_0x2db4bf,null));};exports[_0x3f9c('0x52')]=function(_0x32bb4e,_0x68deed,_0x268031){return db['Attachment'][_0x3f9c('0x53')]({'where':{'id':_0x32bb4e[_0x3f9c('0x47')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x68deed,null))[_0x3f9c('0x3f')](function(_0x31f36f){if(_0x31f36f){var _0x311f64=_0x31f36f[_0x3f9c('0x54')]!==null;var _0x4a3f03=path[_0x3f9c('0x55')](config[_0x3f9c('0x56')],'server/files/attachments/');if(_0x311f64){_0x4a3f03=path[_0x3f9c('0x55')](_0x4a3f03,_0x3f9c('0x57'));}var _0x3bacdd=path['join'](_0x4a3f03,_0x31f36f[_0x3f9c('0x4f')]);return _0x68deed[_0x3f9c('0x52')](_0x3bacdd);}})[_0x3f9c('0x42')](handleError(_0x68deed,null));};
\ No newline at end of file
index 72c908b..fe613c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e73=['Attachment','attachments','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0x43f9cb,_0x395f16){var _0x56e717=function(_0x49fb96){while(--_0x49fb96){_0x43f9cb['push'](_0x43f9cb['shift']());}};_0x56e717(++_0x395f16);}(_0x3e73,0x122));var _0x33e7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3e73[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x33e7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x33e7('0x1'));var moment=require(_0x33e7('0x2'));var BPromise=require(_0x33e7('0x3'));var rp=require(_0x33e7('0x4'));var fs=require('fs');var path=require(_0x33e7('0x5'));var rimraf=require(_0x33e7('0x6'));var config=require(_0x33e7('0x7'));var attributes=require(_0x33e7('0x8'));module['exports']=function(_0x52b033,_0x4d31d4){return _0x52b033[_0x33e7('0x9')](_0x33e7('0xa'),attributes,{'tableName':_0x33e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde4b=['rimraf','../../config/environment','./attachment.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xde4b,0x130));var _0xbde4=function(_0x2b7804,_0x29f001){_0x2b7804=_0x2b7804-0x0;var _0x48811a=_0xde4b[_0x2b7804];return _0x48811a;};'use strict';var _=require(_0xbde4('0x0'));var util=require(_0xbde4('0x1'));var logger=require(_0xbde4('0x2'))(_0xbde4('0x3'));var moment=require(_0xbde4('0x4'));var BPromise=require(_0xbde4('0x5'));var rp=require(_0xbde4('0x6'));var fs=require('fs');var path=require(_0xbde4('0x7'));var rimraf=require(_0xbde4('0x8'));var config=require(_0xbde4('0x9'));var attributes=require(_0xbde4('0xa'));module['exports']=function(_0x1fcc5a,_0x1eab11){return _0x1fcc5a[_0xbde4('0xb')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c4744ac..4255f57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07c3=['debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','CreateAttachment','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x275e07,_0x3a2a1a){var _0x5b8eae=function(_0x3c1a99){while(--_0x3c1a99){_0x275e07['push'](_0x275e07['shift']());}};_0x5b8eae(++_0x3a2a1a);}(_0x07c3,0x1bf));var _0x307c=function(_0x46aaaa,_0x3af897){_0x46aaaa=_0x46aaaa-0x0;var _0x26d04e=_0x07c3[_0x46aaaa];return _0x26d04e;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var moment=require(_0x307c('0x2'));var BPromise=require(_0x307c('0x3'));var rs=require(_0x307c('0x4'));var fs=require('fs');var Redis=require(_0x307c('0x5'));var db=require(_0x307c('0x6'))['db'];var utils=require(_0x307c('0x7'));var logger=require('../../config/logger')(_0x307c('0x8'));var config=require(_0x307c('0x9'));var jayson=require(_0x307c('0xa'));var client=jayson[_0x307c('0xb')][_0x307c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410ae8,_0x39af52,_0x3f5d08){return new BPromise(function(_0xfb14bf,_0x166467){return client[_0x307c('0xd')](_0x410ae8,_0x3f5d08)[_0x307c('0xe')](function(_0x1af97f){logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,'request\x20sent');logger[_0x307c('0x11')](_0x307c('0x12'),_0x39af52,_0x307c('0x13'),JSON[_0x307c('0x14')](_0x1af97f));if(_0x1af97f['error']){if(_0x1af97f['error'][_0x307c('0x15')]===0x1f4){logger['error'](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')]['message']);return _0x166467(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);return _0xfb14bf(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}else{logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,_0x307c('0x13'));_0xfb14bf(_0x1af97f[_0x307c('0x18')]['message']);}})[_0x307c('0x19')](function(_0x364441){logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x364441);_0x166467(_0x364441);});});}exports[_0x307c('0x1a')]=function(_0x2e21a6){var _0x3e05e2=this;return new Promise(function(_0x13f03b,_0xbfe2b4){return db['Attachment']['create'](_0x2e21a6[_0x307c('0x1b')],{'raw':_0x2e21a6['options']?_0x2e21a6[_0x307c('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4bcc1a){logger[_0x307c('0xf')]('CreateAttachment',_0x2e21a6);logger[_0x307c('0x11')](_0x307c('0x1a'),_0x2e21a6,JSON['stringify'](_0x4bcc1a));_0x13f03b(_0x4bcc1a);})[_0x307c('0x19')](function(_0x45fe2){logger['error'](_0x307c('0x1a'),_0x45fe2[_0x307c('0x17')],_0x2e21a6);_0xbfe2b4(_0x3e05e2[_0x307c('0x16')](0x1f4,_0x45fe2[_0x307c('0x17')]));});});};
\ No newline at end of file
+var _0x1782=['code','Attachment,\x20%s,\x20%s','message','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x54887d,_0x252442){var _0x10099a=function(_0x1dc55e){while(--_0x1dc55e){_0x54887d['push'](_0x54887d['shift']());}};_0x10099a(++_0x252442);}(_0x1782,0x13e));var _0x2178=function(_0x143f66,_0xc137ba){_0x143f66=_0x143f66-0x0;var _0x52a5f3=_0x1782[_0x143f66];return _0x52a5f3;};'use strict';var _=require(_0x2178('0x0'));var util=require('util');var moment=require(_0x2178('0x1'));var BPromise=require(_0x2178('0x2'));var rs=require(_0x2178('0x3'));var fs=require('fs');var Redis=require(_0x2178('0x4'));var db=require(_0x2178('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2178('0x6'))(_0x2178('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2178('0x8')][_0x2178('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ad34,_0x53b9f9,_0x4cf22a){return new BPromise(function(_0x3b4115,_0x2b3991){return client[_0x2178('0xa')](_0x50ad34,_0x4cf22a)[_0x2178('0xb')](function(_0x1cb1e6){logger[_0x2178('0xc')]('Attachment,\x20%s,\x20%s',_0x53b9f9,_0x2178('0xd'));logger[_0x2178('0xe')](_0x2178('0xf'),_0x53b9f9,_0x2178('0xd'),JSON[_0x2178('0x10')](_0x1cb1e6));if(_0x1cb1e6[_0x2178('0x11')]){if(_0x1cb1e6[_0x2178('0x11')][_0x2178('0x12')]===0x1f4){logger[_0x2178('0x11')](_0x2178('0x13'),_0x53b9f9,_0x1cb1e6['error'][_0x2178('0x14')]);return _0x2b3991(_0x1cb1e6[_0x2178('0x11')]['message']);}logger[_0x2178('0x11')](_0x2178('0x13'),_0x53b9f9,_0x1cb1e6[_0x2178('0x11')][_0x2178('0x14')]);return _0x3b4115(_0x1cb1e6[_0x2178('0x11')]['message']);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x53b9f9,_0x2178('0xd'));_0x3b4115(_0x1cb1e6['result'][_0x2178('0x14')]);}})[_0x2178('0x15')](function(_0x5edc68){logger['error'](_0x2178('0x13'),_0x53b9f9,_0x5edc68);_0x2b3991(_0x5edc68);});});}exports[_0x2178('0x16')]=function(_0x561990){var _0x3d7e36=this;return new Promise(function(_0x39dd60,_0x1cece2){return db[_0x2178('0x17')][_0x2178('0x18')](_0x561990[_0x2178('0x19')],{'raw':_0x561990[_0x2178('0x1a')]?_0x561990[_0x2178('0x1a')][_0x2178('0x1b')]===undefined?!![]:![]:!![]})[_0x2178('0xb')](function(_0x1d2dd5){logger[_0x2178('0xc')]('CreateAttachment',_0x561990);logger[_0x2178('0xe')](_0x2178('0x16'),_0x561990,JSON[_0x2178('0x10')](_0x1d2dd5));_0x39dd60(_0x1d2dd5);})[_0x2178('0x15')](function(_0x4335f2){logger[_0x2178('0x11')](_0x2178('0x16'),_0x4335f2[_0x2178('0x14')],_0x561990);_0x1cece2(_0x3d7e36[_0x2178('0x11')](0x1f4,_0x4335f2[_0x2178('0x14')]));});});};
\ No newline at end of file
index b4aac6d..8018352 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x0b0e,0x187));var _0xe0b0=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0x0b0e[_0xf31767];return _0x24bd0c;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x217a49,_0x5d9c5f){_0x217a49=_0x217a49-0x0;var _0x33ae2b=_0xdb28[_0x217a49];return _0x33ae2b;};'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 3b7485b..49339c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe53=['disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','then','getLicense','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','authenticate','google','/login','email','use','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','User','map','emails','user','agent'];(function(_0x550eaa,_0x4302ab){var _0x4db477=function(_0x59820c){while(--_0x59820c){_0x550eaa['push'](_0x550eaa['shift']());}};_0x4db477(++_0x4302ab);}(_0xbe53,0x1ba));var _0x3be5=function(_0x4b7a91,_0x3d7cd2){_0x4b7a91=_0x4b7a91-0x0;var _0x2fd4b9=_0xbe53[_0x4b7a91];return _0x2fd4b9;};'use strict';var _=require('lodash');var passport=require(_0x3be5('0x0'));var GoogleStrategy=require(_0x3be5('0x1'))['Strategy'];var moment=require(_0x3be5('0x2'));var db=require(_0x3be5('0x3'))['db'];var config=require(_0x3be5('0x4'));var signToken=require('../../components/auth/service')[_0x3be5('0x5')];var utils=require(_0x3be5('0x6'));exports['login']=passport[_0x3be5('0x7')](_0x3be5('0x8'),{'failureRedirect':_0x3be5('0x9'),'scope':['profile',_0x3be5('0xa')],'session':![]});exports['callback']=passport[_0x3be5('0x7')](_0x3be5('0x8'),{'failureRedirect':_0x3be5('0x9'),'session':![]});passport[_0x3be5('0xb')](new GoogleStrategy({'clientID':config[_0x3be5('0x8')]?config['google']['clientID']:'id','clientSecret':config[_0x3be5('0x8')]?config[_0x3be5('0x8')][_0x3be5('0xc')]:_0x3be5('0xd'),'callbackURL':config['google']?config[_0x3be5('0x8')][_0x3be5('0xe')]:''},function(_0x52e48f,_0xa358f9,_0x55b7e7,_0x328516){var _0xa25786,_0x35c0de;return db[_0x3be5('0xf')]['findOne']({'where':{'id':0x1},'attributes':[_0x3be5('0x10'),_0x3be5('0x11')],'raw':!![]})['then'](function(_0x1439ff){_0xa25786=_0x1439ff;return db[_0x3be5('0x12')]['find']({'where':{'email':_[_0x3be5('0x13')](_0x55b7e7[_0x3be5('0x14')],'value'),'role':{'$or':['admin',_0x3be5('0x15'),_0x3be5('0x16')]}}});})['then'](function(_0x49acca){_0x35c0de=_0x49acca;if(_0x35c0de){if(_0x35c0de[_0x3be5('0x17')]){return _0x328516(_0x3be5('0x18'));}else if(_0xa25786[_0x3be5('0x11')]>0x0){if(_0x35c0de[_0x3be5('0x19')]){if(moment(_0x35c0de[_0x3be5('0x1a')])['add'](_0xa25786[_0x3be5('0x11')],_0x3be5('0x1b'))>moment()){return _0x328516(_0x3be5('0x18'));}else{return utils[_0x3be5('0x1c')](_0x35c0de,0x0,![],null)[_0x3be5('0x1d')](function(){return utils[_0x3be5('0x1e')](_0x35c0de);})[_0x3be5('0x1d')](function(){return _0x328516(null,_0x35c0de);});}}else{return utils[_0x3be5('0x1e')](_0x35c0de)[_0x3be5('0x1d')](function(){return _0x328516(null,_0x35c0de);});}}else{return utils['getLicense'](_0x35c0de)[_0x3be5('0x1d')](function(){return _0x328516(null,_0x35c0de);});}}return _0x328516(_0x3be5('0x18'));})['catch'](function(_0x2a1dd8){_0x328516(_0x2a1dd8);});}));
\ No newline at end of file
+var _0x7e27=['use','google','clientID','clientSecret','callbackURL','findOne','allowedLoginAttempts','then','User','find','map','emails','value','admin','user','disabled','blocked','add','blockDuration','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','getLicense','catch','lodash','passport-google-oauth20','Strategy','moment','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','/login','profile'];(function(_0x401ccd,_0x140815){var _0x5a57ad=function(_0x8ad698){while(--_0x8ad698){_0x401ccd['push'](_0x401ccd['shift']());}};_0x5a57ad(++_0x140815);}(_0x7e27,0x1f3));var _0x77e2=function(_0x33b95d,_0x58007a){_0x33b95d=_0x33b95d-0x0;var _0x48c1e7=_0x7e27[_0x33b95d];return _0x48c1e7;};'use strict';var _=require(_0x77e2('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x77e2('0x1'))[_0x77e2('0x2')];var moment=require(_0x77e2('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x77e2('0x4'));var signToken=require(_0x77e2('0x5'))[_0x77e2('0x6')];var utils=require(_0x77e2('0x7'));exports[_0x77e2('0x8')]=passport['authenticate']('google',{'failureRedirect':_0x77e2('0x9'),'scope':[_0x77e2('0xa'),'email'],'session':![]});exports['callback']=passport['authenticate']('google',{'failureRedirect':_0x77e2('0x9'),'session':![]});passport[_0x77e2('0xb')](new GoogleStrategy({'clientID':config[_0x77e2('0xc')]?config['google'][_0x77e2('0xd')]:'id','clientSecret':config['google']?config[_0x77e2('0xc')][_0x77e2('0xe')]:'secret','callbackURL':config['google']?config[_0x77e2('0xc')][_0x77e2('0xf')]:''},function(_0x4cc2c5,_0x4289f2,_0x4b518c,_0x1f1557){var _0x260e44,_0x487f52;return db['Setting'][_0x77e2('0x10')]({'where':{'id':0x1},'attributes':[_0x77e2('0x11'),'blockDuration'],'raw':!![]})[_0x77e2('0x12')](function(_0x517bfb){_0x260e44=_0x517bfb;return db[_0x77e2('0x13')][_0x77e2('0x14')]({'where':{'email':_[_0x77e2('0x15')](_0x4b518c[_0x77e2('0x16')],_0x77e2('0x17')),'role':{'$or':[_0x77e2('0x18'),_0x77e2('0x19'),'agent']}}});})[_0x77e2('0x12')](function(_0x52389c){_0x487f52=_0x52389c;if(_0x487f52){if(_0x487f52[_0x77e2('0x1a')]){return _0x1f1557('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x260e44['blockDuration']>0x0){if(_0x487f52[_0x77e2('0x1b')]){if(moment(_0x487f52['blockedAt'])[_0x77e2('0x1c')](_0x260e44[_0x77e2('0x1d')],_0x77e2('0x1e'))>moment()){return _0x1f1557(_0x77e2('0x1f'));}else{return utils['clearBlockUser'](_0x487f52,0x0,![],null)[_0x77e2('0x12')](function(){return utils['getLicense'](_0x487f52);})['then'](function(){return _0x1f1557(null,_0x487f52);});}}else{return utils[_0x77e2('0x20')](_0x487f52)[_0x77e2('0x12')](function(){return _0x1f1557(null,_0x487f52);});}}else{return utils[_0x77e2('0x20')](_0x487f52)[_0x77e2('0x12')](function(){return _0x1f1557(null,_0x487f52);});}}return _0x1f1557(_0x77e2('0x1f'));})[_0x77e2('0x21')](function(_0x5b1146){_0x1f1557(_0x5b1146);});}));
\ No newline at end of file
index 6a16d7d..423e2f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24d3=['isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x4efe2c,_0x4e01b0){var _0x146de7=function(_0x43216f){while(--_0x43216f){_0x4efe2c['push'](_0x4efe2c['shift']());}};_0x146de7(++_0x4e01b0);}(_0x24d3,0xcf));var _0x324d=function(_0x428751,_0x1eb9c3){_0x428751=_0x428751-0x0;var _0x147aff=_0x24d3[_0x428751];return _0x147aff;};'use strict';var express=require(_0x324d('0x0'));var passport=require(_0x324d('0x1'));var router=express[_0x324d('0x2')]();var controller=require(_0x324d('0x3'));var userController=require(_0x324d('0x4'));var authService=require(_0x324d('0x5'));router[_0x324d('0x6')]('/',controller[_0x324d('0x7')]);router['get'](_0x324d('0x8'),controller['callback'],authService[_0x324d('0x9')],userController[_0x324d('0x7')],authService[_0x324d('0xa')]);module[_0x324d('0xb')]=router;
\ No newline at end of file
+var _0xde88=['../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','Router','../user/user.controller.js'];(function(_0x40ef1f,_0x28e7a2){var _0x3a4704=function(_0x3b6878){while(--_0x3b6878){_0x40ef1f['push'](_0x40ef1f['shift']());}};_0x3a4704(++_0x28e7a2);}(_0xde88,0x8c));var _0x8de8=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0xde88[_0x3ef2d5];return _0x2fefb2;};'use strict';var express=require(_0x8de8('0x0'));var passport=require('passport');var router=express[_0x8de8('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x8de8('0x2'));var authService=require(_0x8de8('0x3'));router[_0x8de8('0x4')]('/',controller[_0x8de8('0x5')]);router[_0x8de8('0x4')](_0x8de8('0x6'),controller[_0x8de8('0x7')],authService[_0x8de8('0x8')],userController['login'],authService[_0x8de8('0x9')]);module[_0x8de8('0xa')]=router;
\ No newline at end of file
index a7c26a5..239b851 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2e3=['then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','clearBlockUser','blocked','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','send','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params','token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts'];(function(_0x38fe24,_0x239dd9){var _0x245a09=function(_0x58862a){while(--_0x58862a){_0x38fe24['push'](_0x38fe24['shift']());}};_0x245a09(++_0x239dd9);}(_0xb2e3,0xf9));var _0x3b2e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb2e3[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require(_0x3b2e('0x0'));var passport=require(_0x3b2e('0x1'));var LocalStrategy=require(_0x3b2e('0x2'))[_0x3b2e('0x3')];var jayson=require(_0x3b2e('0x4'));var _=require(_0x3b2e('0x5'));var rs=require(_0x3b2e('0x6'));var moment=require('moment');var db=require(_0x3b2e('0x7'))['db'];var authService=require(_0x3b2e('0x8'));var utils=require(_0x3b2e('0x9'));var client=jayson[_0x3b2e('0xa')][_0x3b2e('0xb')]({'port':0x232b});function localAuthenticate(_0x44a2f2,_0x52a011,_0x1b6c7b,_0x3f0b9b){var _0x1191c4,_0x3f8b69;return db[_0x3b2e('0xc')][_0x3b2e('0xd')]({'where':{'id':0x1},'attributes':[_0x3b2e('0xe'),'blockDuration'],'raw':!![]})[_0x3b2e('0xf')](function(_0x17d3f4){_0x1191c4=_0x17d3f4;return _0x44a2f2[_0x3b2e('0xd')]({'attributes':['id',_0x3b2e('0x10'),_0x3b2e('0x11'),_0x3b2e('0x12'),_0x3b2e('0x13'),_0x3b2e('0x14'),'blocked',_0x3b2e('0x15'),_0x3b2e('0x16')],'where':{'name':_0x52a011,'role':{'$or':[_0x3b2e('0x17'),_0x3b2e('0x18'),_0x3b2e('0x19')]}}});})[_0x3b2e('0xf')](function(_0x4e2ff0){if(!_0x4e2ff0||_0x4e2ff0&&_0x4e2ff0[_0x3b2e('0x10')]!==_0x52a011){throw new Error(_0x3b2e('0x1a'));}else{_0x3f8b69=_0x4e2ff0;return _0x3f8b69;}})[_0x3b2e('0xf')](function(){_0x3f8b69['authenticate'](_0x1b6c7b,function(_0x37591c,_0x467925){var _0x256658=_0x3f8b69['loginAttempts']+0x1;if(_0x37591c){return _0x3f0b9b(_0x37591c);}else if(!_0x467925){if(_0x3f8b69[_0x3b2e('0x14')]){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else if(_0x1191c4[_0x3b2e('0xe')]>0x0){if(_0x3f8b69['blocked']){if(_0x1191c4[_0x3b2e('0x1b')]>0x0){if(moment(_0x3f8b69[_0x3b2e('0x15')])['add'](_0x1191c4['blockDuration'],'minutes')>moment()){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,_0x256658,![],null)['then'](function(){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});});}}else{return _0x3f0b9b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x256658>=_0x1191c4[_0x3b2e('0xe')]){return utils[_0x3b2e('0x1c')](_0x3f8b69,0x0,!![],moment())[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});});}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,_0x256658,![],null)[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});});}}}else{return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}}else{if(_0x3f8b69['disabled']){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else if(_0x1191c4['allowedLoginAttempts']>0x0){if(_0x3f8b69[_0x3b2e('0x1d')]){if(_0x1191c4[_0x3b2e('0x1b')]>0x0){if(moment(_0x3f8b69[_0x3b2e('0x15')])['add'](_0x1191c4[_0x3b2e('0x1b')],_0x3b2e('0x1e'))>moment()){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,0x0,![],null)[_0x3b2e('0xf')](function(){return utils[_0x3b2e('0x1f')](_0x3f8b69);})[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,_0x3f8b69);});}}else{return _0x3f0b9b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,0x0,![],null)['then'](function(){return utils[_0x3b2e('0x1f')](_0x3f8b69);})['then'](function(){return _0x3f0b9b(null,_0x3f8b69);})[_0x3b2e('0x20')](function(_0xbbe540){return _0x3f0b9b(null,![],_0xbbe540);});}}else{if(_0x3f8b69[_0x3b2e('0x1d')]){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else{return utils[_0x3b2e('0x1f')](_0x3f8b69)[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,_0x3f8b69);});}}}});})[_0x3b2e('0x20')](function(_0xf119a4){return _0x3f0b9b(null,![],_0xf119a4);});}function sendServiceMail(_0x19d381){return db[_0x3b2e('0x21')][_0x3b2e('0x22')]({'where':{'service':!![]},'attributes':['id',_0x3b2e('0x10'),_0x3b2e('0x23')],'include':[{'model':db[_0x3b2e('0x24')],'as':'Smtp'}]})[_0x3b2e('0xf')](function(_0xf2a6f7){if(!_0xf2a6f7){throw new Error(_0x3b2e('0x25'));}var _0x434f52={'tls':{'rejectUnauthorized':![]}};if(_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x27')]){_0x434f52[_0x3b2e('0x27')]=_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x27')];}else{_0x434f52[_0x3b2e('0x28')]=_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x28')];_0x434f52[_0x3b2e('0x29')]=_0xf2a6f7['Smtp'][_0x3b2e('0x29')];_0x434f52[_0x3b2e('0x2a')]=_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x2a')];}if(_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x2b')]){_0x434f52[_0x3b2e('0x2c')]={'user':_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x18')],'pass':_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x2d')]};}var _0x2f107e={'account':_0x434f52,'message':_['merge']({'from':util['format'](_0x3b2e('0x2e'),_0xf2a6f7[_0x3b2e('0x10')],_0xf2a6f7[_0x3b2e('0x23')]||_0xf2a6f7[_0x3b2e('0x26')]['user'])},_0x19d381)};return client['request']('SendMail',_0x2f107e);})[_0x3b2e('0xf')](function(_0x1f0610){if(_0x1f0610[_0x3b2e('0x2f')]){throw new Error(util['format'](_0x3b2e('0x30'),_0x1f0610[_0x3b2e('0x2f')][_0x3b2e('0x31')]||JSON['stringify'](_0x1f0610[_0x3b2e('0x2f')])));}return!![];});}function handleError(_0xad25b2,_0x1d0a49,_0x811993){return _0xad25b2['status'](_0x1d0a49||0x1f4)[_0x3b2e('0x32')]({'message':_0x811993?_0x811993[_0x3b2e('0x31')]||_0x811993:''});}exports['login']=function(_0x57bf73,_0x487db1,_0x383bd1){passport[_0x3b2e('0x33')]('local',function(_0x3a281f,_0x58f05d,_0x421290){var _0x48ca40=_0x3a281f||_0x421290;if(_0x48ca40){return handleError(_0x487db1,0x191,_0x48ca40);}if(!_0x58f05d){return handleError(_0x487db1,0x194,{'message':_0x3b2e('0x34')});}else{var _0x899523={'payload':{'id':_0x58f05d['id'],'role':_0x58f05d[_0x3b2e('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0x3b2e('0x35')](_0x899523)[_0x3b2e('0xf')](function(_0x18808a){_0x487db1['json']({'id':_0x58f05d['id'],'token':_0x18808a,'statusCall':'','isAlreadyLogged':_0x58f05d[_0x3b2e('0x36')]});});}})(_0x57bf73,_0x487db1,_0x383bd1);};exports[_0x3b2e('0x37')]=function(_0x194609,_0x451f68,_0x2633ae){if(!_0x194609[_0x3b2e('0x38')][_0x3b2e('0x23')]){return handleError(_0x451f68,0x1f4,{'message':_0x3b2e('0x39')});}var _0x29498c=rs[_0x3b2e('0x3a')]();_0x194609['body'][_0x3b2e('0x23')]=_0x194609['body'][_0x3b2e('0x23')][_0x3b2e('0x3b')]()[_0x3b2e('0x3c')]();var _0x35549c;return db[_0x3b2e('0xc')][_0x3b2e('0xd')]({'where':{'id':0x1},'attributes':[_0x3b2e('0xe'),'blockDuration'],'raw':!![]})[_0x3b2e('0xf')](function(_0x249b3f){_0x35549c=_0x249b3f;return db[_0x3b2e('0x3d')][_0x3b2e('0x22')]({'where':{'email':_0x194609[_0x3b2e('0x38')][_0x3b2e('0x23')]}});})['then'](function(_0x3b3ee6){if(!_0x3b3ee6){throw new Error(_0x3b2e('0x3e'));}if(_0x3b3ee6[_0x3b2e('0x14')]){throw new Error(_0x3b2e('0x3f'));}if(_0x3b3ee6[_0x3b2e('0x1d')]){if(moment(_0x3b3ee6['blockedAt'])[_0x3b2e('0x40')](_0x35549c[_0x3b2e('0x1b')],'minutes')>moment()){throw new Error(_0x3b2e('0x41'));}else{_0x3b3ee6[_0x3b2e('0x1d')]=![];_0x3b3ee6[_0x3b2e('0x15')]=null;}}_0x3b3ee6[_0x3b2e('0x42')]=_0x29498c;_0x3b3ee6[_0x3b2e('0x43')]=Date['now']()+0x36ee80;return _0x3b3ee6['save']();})[_0x3b2e('0xf')](function(){return sendServiceMail({'to':_0x194609[_0x3b2e('0x38')]['email'],'subject':_0x3b2e('0x44'),'text':_0x3b2e('0x45')+_0x3b2e('0x46')+_0x3b2e('0x47')+_0x194609[_0x3b2e('0x48')][_0x3b2e('0x28')]+_0x3b2e('0x49')+_0x29498c+'\x0a\x0a'+_0x3b2e('0x4a')});})['then'](function(){_0x451f68[_0x3b2e('0x4b')](0xc8)[_0x3b2e('0x32')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x12cc5f){return handleError(_0x451f68,0x1f4,_0x12cc5f);});};exports['reset']=function(_0x42a43b,_0x1f05c1,_0x235c5a){return db[_0x3b2e('0x3d')][_0x3b2e('0x22')]({'where':{'resetPasswordToken':_0x42a43b[_0x3b2e('0x4c')][_0x3b2e('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x3b2e('0x4e')]()}}})[_0x3b2e('0xf')](function(_0x542b33){if(!_0x542b33){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x3b2e('0xc')][_0x3b2e('0xd')]({'attributes':['id',_0x3b2e('0x4f'),_0x3b2e('0x50'),_0x3b2e('0x51')]})[_0x3b2e('0xf')](function(_0x1f05b2){if(_0x1f05b2[_0x3b2e('0x4f')])authService[_0x3b2e('0x52')](_0x42a43b[_0x3b2e('0x38')]['password']);if(!_0x1f05b2['enforcePasswordHistory']||!_0x542b33[_0x3b2e('0x53')])return _0x542b33;authService[_0x3b2e('0x54')](_0x42a43b[_0x3b2e('0x38')][_0x3b2e('0x11')],_0x542b33[_0x3b2e('0x53')],_0x1f05b2['passwordHistoryLimit']);return _0x542b33;})[_0x3b2e('0xf')](function(){_0x542b33[_0x3b2e('0x11')]=_0x42a43b[_0x3b2e('0x38')][_0x3b2e('0x11')];_0x542b33[_0x3b2e('0x42')]=null;_0x542b33[_0x3b2e('0x43')]=null;return _0x542b33[_0x3b2e('0x55')]();});})[_0x3b2e('0xf')](function(){_0x1f05c1[_0x3b2e('0x4b')](0xc8)[_0x3b2e('0x32')]({'message':_0x3b2e('0x56')});})[_0x3b2e('0x20')](function(_0x3ece9f){return handleError(_0x1f05c1,0x1f4,_0x3ece9f);});};passport[_0x3b2e('0x57')](new LocalStrategy({'usernameField':_0x3b2e('0x10'),'passwordField':_0x3b2e('0x11')},function(_0x5033f2,_0x34869d,_0x5cfb10){return localAuthenticate(db['User'],_0x5033f2,_0x34869d,_0x5cfb10);}));
\ No newline at end of file
+var _0xe01d=['catch','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local','signToken','json','body','Email\x20parameter\x20is\x20missing','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','send','params','token','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','client','http','findOne','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blocked','add','minutes','clearBlockUser','getLicense'];(function(_0x23bf21,_0x284f3b){var _0x27636c=function(_0x533056){while(--_0x533056){_0x23bf21['push'](_0x23bf21['shift']());}};_0x27636c(++_0x284f3b);}(_0xe01d,0x1c2));var _0xde01=function(_0x29f6f8,_0x370292){_0x29f6f8=_0x29f6f8-0x0;var _0x379929=_0xe01d[_0x29f6f8];return _0x379929;};'use strict';var util=require(_0xde01('0x0'));var passport=require('passport');var LocalStrategy=require(_0xde01('0x1'))[_0xde01('0x2')];var jayson=require(_0xde01('0x3'));var _=require(_0xde01('0x4'));var rs=require(_0xde01('0x5'));var moment=require(_0xde01('0x6'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0xde01('0x7')][_0xde01('0x8')]({'port':0x232b});function localAuthenticate(_0x331de0,_0xfc08f3,_0x3f2872,_0x1cd33e){var _0x557d52,_0xa416aa;return db['Setting'][_0xde01('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xde01('0xa')],'raw':!![]})[_0xde01('0xb')](function(_0x1522c8){_0x557d52=_0x1522c8;return _0x331de0[_0xde01('0x9')]({'attributes':['id',_0xde01('0xc'),_0xde01('0xd'),_0xde01('0xe'),_0xde01('0xf'),_0xde01('0x10'),'blocked',_0xde01('0x11'),_0xde01('0x12')],'where':{'name':_0xfc08f3,'role':{'$or':[_0xde01('0x13'),_0xde01('0x14'),_0xde01('0x15')]}}});})[_0xde01('0xb')](function(_0x563b5a){if(!_0x563b5a||_0x563b5a&&_0x563b5a[_0xde01('0xc')]!==_0xfc08f3){throw new Error(_0xde01('0x16'));}else{_0xa416aa=_0x563b5a;return _0xa416aa;}})[_0xde01('0xb')](function(){_0xa416aa[_0xde01('0x17')](_0x3f2872,function(_0xe3a2d3,_0xeb9e67){var _0x4b471f=_0xa416aa[_0xde01('0x12')]+0x1;if(_0xe3a2d3){return _0x1cd33e(_0xe3a2d3);}else if(!_0xeb9e67){if(_0xa416aa[_0xde01('0x10')]){return _0x1cd33e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x557d52[_0xde01('0x18')]>0x0){if(_0xa416aa[_0xde01('0x19')]){if(_0x557d52[_0xde01('0xa')]>0x0){if(moment(_0xa416aa['blockedAt'])[_0xde01('0x1a')](_0x557d52[_0xde01('0xa')],_0xde01('0x1b'))>moment()){return _0x1cd33e(null,![],{'message':_0xde01('0x16')});}else{return utils[_0xde01('0x1c')](_0xa416aa,_0x4b471f,![],null)[_0xde01('0xb')](function(){return _0x1cd33e(null,![],{'message':_0xde01('0x16')});});}}else{return _0x1cd33e(null,![],{'message':_0xde01('0x16')});}}else{if(_0x4b471f>=_0x557d52[_0xde01('0x18')]){return utils[_0xde01('0x1c')](_0xa416aa,0x0,!![],moment())[_0xde01('0xb')](function(){return _0x1cd33e(null,![],{'message':_0xde01('0x16')});});}else{return utils['clearBlockUser'](_0xa416aa,_0x4b471f,![],null)[_0xde01('0xb')](function(){return _0x1cd33e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1cd33e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xa416aa['disabled']){return _0x1cd33e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x557d52[_0xde01('0x18')]>0x0){if(_0xa416aa[_0xde01('0x19')]){if(_0x557d52['blockDuration']>0x0){if(moment(_0xa416aa[_0xde01('0x11')])[_0xde01('0x1a')](_0x557d52[_0xde01('0xa')],_0xde01('0x1b'))>moment()){return _0x1cd33e(null,![],{'message':_0xde01('0x16')});}else{return utils[_0xde01('0x1c')](_0xa416aa,0x0,![],null)[_0xde01('0xb')](function(){return utils[_0xde01('0x1d')](_0xa416aa);})['then'](function(){return _0x1cd33e(null,_0xa416aa);});}}else{return _0x1cd33e(null,![],{'message':_0xde01('0x16')});}}else{return utils[_0xde01('0x1c')](_0xa416aa,0x0,![],null)[_0xde01('0xb')](function(){return utils[_0xde01('0x1d')](_0xa416aa);})[_0xde01('0xb')](function(){return _0x1cd33e(null,_0xa416aa);})[_0xde01('0x1e')](function(_0x3b2299){return _0x1cd33e(null,![],_0x3b2299);});}}else{if(_0xa416aa[_0xde01('0x19')]){return _0x1cd33e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0xa416aa)[_0xde01('0xb')](function(){return _0x1cd33e(null,_0xa416aa);});}}}});})[_0xde01('0x1e')](function(_0x25d259){return _0x1cd33e(null,![],_0x25d259);});}function sendServiceMail(_0x149652){return db[_0xde01('0x1f')][_0xde01('0x20')]({'where':{'service':!![]},'attributes':['id',_0xde01('0xc'),_0xde01('0x21')],'include':[{'model':db[_0xde01('0x22')],'as':'Smtp'}]})[_0xde01('0xb')](function(_0x2ac2d4){if(!_0x2ac2d4){throw new Error(_0xde01('0x23'));}var _0x55355e={'tls':{'rejectUnauthorized':![]}};if(_0x2ac2d4[_0xde01('0x24')]['service']){_0x55355e[_0xde01('0x25')]=_0x2ac2d4['Smtp'][_0xde01('0x25')];}else{_0x55355e['host']=_0x2ac2d4[_0xde01('0x24')][_0xde01('0x26')];_0x55355e[_0xde01('0x27')]=_0x2ac2d4[_0xde01('0x24')][_0xde01('0x27')];_0x55355e[_0xde01('0x28')]=_0x2ac2d4[_0xde01('0x24')][_0xde01('0x28')];}if(_0x2ac2d4['Smtp']['authentication']){_0x55355e[_0xde01('0x29')]={'user':_0x2ac2d4[_0xde01('0x24')]['user'],'pass':_0x2ac2d4[_0xde01('0x24')][_0xde01('0x2a')]};}var _0x1dda89={'account':_0x55355e,'message':_[_0xde01('0x2b')]({'from':util[_0xde01('0x2c')](_0xde01('0x2d'),_0x2ac2d4[_0xde01('0xc')],_0x2ac2d4[_0xde01('0x21')]||_0x2ac2d4['Smtp'][_0xde01('0x14')])},_0x149652)};return client['request'](_0xde01('0x2e'),_0x1dda89);})['then'](function(_0x372b57){if(_0x372b57[_0xde01('0x2f')]){throw new Error(util['format'](_0xde01('0x30'),_0x372b57[_0xde01('0x2f')][_0xde01('0x31')]||JSON[_0xde01('0x32')](_0x372b57[_0xde01('0x2f')])));}return!![];});}function handleError(_0x5450fd,_0x447744,_0x3e2be2){return _0x5450fd[_0xde01('0x33')](_0x447744||0x1f4)['send']({'message':_0x3e2be2?_0x3e2be2[_0xde01('0x31')]||_0x3e2be2:''});}exports[_0xde01('0x34')]=function(_0xf71815,_0x7d9daa,_0xc99983){passport[_0xde01('0x17')](_0xde01('0x35'),function(_0x4f3478,_0x3ae835,_0x4839d5){var _0x4ea1a9=_0x4f3478||_0x4839d5;if(_0x4ea1a9){return handleError(_0x7d9daa,0x191,_0x4ea1a9);}if(!_0x3ae835){return handleError(_0x7d9daa,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2f6d1b={'payload':{'id':_0x3ae835['id'],'role':_0x3ae835[_0xde01('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xde01('0x36')](_0x2f6d1b)[_0xde01('0xb')](function(_0x48f3a5){_0x7d9daa[_0xde01('0x37')]({'id':_0x3ae835['id'],'token':_0x48f3a5,'statusCall':'','isAlreadyLogged':_0x3ae835['online']});});}})(_0xf71815,_0x7d9daa,_0xc99983);};exports['forgot']=function(_0x5b87da,_0x1abd14,_0x2f0a07){if(!_0x5b87da[_0xde01('0x38')][_0xde01('0x21')]){return handleError(_0x1abd14,0x1f4,{'message':_0xde01('0x39')});}var _0x27863b=rs['generate']();_0x5b87da[_0xde01('0x38')]['email']=_0x5b87da[_0xde01('0x38')][_0xde01('0x21')]['trim']()[_0xde01('0x3a')]();var _0x5dad68;return db[_0xde01('0x3b')]['findOne']({'where':{'id':0x1},'attributes':[_0xde01('0x18'),_0xde01('0xa')],'raw':!![]})[_0xde01('0xb')](function(_0xb8cc6d){_0x5dad68=_0xb8cc6d;return db[_0xde01('0x3c')][_0xde01('0x20')]({'where':{'email':_0x5b87da[_0xde01('0x38')][_0xde01('0x21')]}});})[_0xde01('0xb')](function(_0x4428c6){if(!_0x4428c6){throw new Error(_0xde01('0x3d'));}if(_0x4428c6[_0xde01('0x10')]){throw new Error(_0xde01('0x3e'));}if(_0x4428c6['blocked']){if(moment(_0x4428c6[_0xde01('0x11')])['add'](_0x5dad68['blockDuration'],_0xde01('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4428c6[_0xde01('0x19')]=![];_0x4428c6[_0xde01('0x11')]=null;}}_0x4428c6[_0xde01('0x3f')]=_0x27863b;_0x4428c6[_0xde01('0x40')]=Date[_0xde01('0x41')]()+0x36ee80;return _0x4428c6['save']();})[_0xde01('0xb')](function(){return sendServiceMail({'to':_0x5b87da[_0xde01('0x38')][_0xde01('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xde01('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xde01('0x43')+_0x5b87da[_0xde01('0x44')]['host']+_0xde01('0x45')+_0x27863b+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xde01('0xb')](function(){_0x1abd14[_0xde01('0x33')](0xc8)[_0xde01('0x46')]({'message':'Reset\x20Email\x20sent!'});})[_0xde01('0x1e')](function(_0x1bcb6e){return handleError(_0x1abd14,0x1f4,_0x1bcb6e);});};exports['reset']=function(_0x56352e,_0x279502,_0x347903){return db[_0xde01('0x3c')][_0xde01('0x20')]({'where':{'resetPasswordToken':_0x56352e[_0xde01('0x47')][_0xde01('0x48')],'resetPasswordExpires':{'$gt':Date[_0xde01('0x41')]()}}})[_0xde01('0xb')](function(_0x198d80){if(!_0x198d80){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xde01('0x3b')][_0xde01('0x9')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xde01('0x49')]})['then'](function(_0x39503a){if(_0x39503a[_0xde01('0x4a')])authService['validatePasswordPattern'](_0x56352e['body'][_0xde01('0xd')]);if(!_0x39503a['enforcePasswordHistory']||!_0x198d80[_0xde01('0x4b')])return _0x198d80;authService[_0xde01('0x4c')](_0x56352e[_0xde01('0x38')][_0xde01('0xd')],_0x198d80[_0xde01('0x4b')],_0x39503a[_0xde01('0x49')]);return _0x198d80;})[_0xde01('0xb')](function(){_0x198d80[_0xde01('0xd')]=_0x56352e[_0xde01('0x38')]['password'];_0x198d80['resetPasswordToken']=null;_0x198d80[_0xde01('0x40')]=null;return _0x198d80[_0xde01('0x4d')]();});})[_0xde01('0xb')](function(){_0x279502[_0xde01('0x33')](0xc8)['send']({'message':_0xde01('0x4e')});})[_0xde01('0x1e')](function(_0x1d4425){return handleError(_0x279502,0x1f4,_0x1d4425);});};passport[_0xde01('0x4f')](new LocalStrategy({'usernameField':_0xde01('0xc'),'passwordField':_0xde01('0xd')},function(_0x57f025,_0x2c2913,_0x4c3e48){return localAuthenticate(db[_0xde01('0x3c')],_0x57f025,_0x2c2913,_0x4c3e48);}));
\ No newline at end of file
index a855aa6..5067479 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f46=['exports','express','Router','./authLocal.controller','post','login','forgot','/reset/:token','reset'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x6f46,0x10f));var _0x66f4=function(_0xda5c7c,_0x40f3b4){_0xda5c7c=_0xda5c7c-0x0;var _0x2bb2c2=_0x6f46[_0xda5c7c];return _0x2bb2c2;};'use strict';var express=require(_0x66f4('0x0'));var router=express[_0x66f4('0x1')]();var controller=require(_0x66f4('0x2'));router[_0x66f4('0x3')]('/',controller[_0x66f4('0x4')]);router[_0x66f4('0x3')]('/forgot',controller[_0x66f4('0x5')]);router[_0x66f4('0x3')](_0x66f4('0x6'),controller[_0x66f4('0x7')]);module[_0x66f4('0x8')]=router;
\ No newline at end of file
+var _0x494c=['Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x1d80ec,_0x4caf89){var _0x5561f0=function(_0x141a43){while(--_0x141a43){_0x1d80ec['push'](_0x1d80ec['shift']());}};_0x5561f0(++_0x4caf89);}(_0x494c,0x1c1));var _0xc494=function(_0x13122e,_0x5524a6){_0x13122e=_0x13122e-0x0;var _0x5f54a6=_0x494c[_0x13122e];return _0x5f54a6;};'use strict';var express=require(_0xc494('0x0'));var router=express[_0xc494('0x1')]();var controller=require(_0xc494('0x2'));router[_0xc494('0x3')]('/',controller[_0xc494('0x4')]);router['post'](_0xc494('0x5'),controller[_0xc494('0x6')]);router[_0xc494('0x3')](_0xc494('0x7'),controller[_0xc494('0x8')]);module[_0xc494('0x9')]=router;
\ No newline at end of file
index e160958..4daf49c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a3e=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x225c0b,_0x1cbbc5){var _0x37c039=function(_0x519219){while(--_0x519219){_0x225c0b['push'](_0x225c0b['shift']());}};_0x37c039(++_0x1cbbc5);}(_0x3a3e,0x13b));var _0xe3a3=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x3a3e[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require(_0xe3a3('0x0'));module['exports']={'name':{'type':Sequelize[_0xe3a3('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xe3a3('0x1')]},'description':{'type':Sequelize[_0xe3a3('0x1')]},'status':{'type':Sequelize[_0xe3a3('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe3a3('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x3016=['exports','STRING','BOOLEAN','sequelize'];(function(_0x29fc9f,_0x40409f){var _0xc7faad=function(_0x26ac31){while(--_0x26ac31){_0x29fc9f['push'](_0x29fc9f['shift']());}};_0xc7faad(++_0x40409f);}(_0x3016,0x143));var _0x6301=function(_0x27b156,_0x3b1c2c){_0x27b156=_0x27b156-0x0;var _0x15db45=_0x3016[_0x27b156];return _0x15db45;};'use strict';var Sequelize=require(_0x6301('0x0'));module[_0x6301('0x1')]={'name':{'type':Sequelize[_0x6301('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6301('0x2')]},'status':{'type':Sequelize[_0x6301('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
index f19cfc5..3008020 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8329=['filters','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','Condition','addConditions','ids','getConditions','findOne','addActions','Action','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','stack','name','send','index','map','Automation','rawAttributes','key','model','query','keys','intersection','fields','length','attributes','nolimit','limit','order','sort','where'];(function(_0x46032a,_0xaca6f8){var _0x12766f=function(_0x52cb8d){while(--_0x52cb8d){_0x46032a['push'](_0x46032a['shift']());}};_0x12766f(++_0xaca6f8);}(_0x8329,0x1c0));var _0x9832=function(_0x41cc65,_0x5760d4){_0x41cc65=_0x41cc65-0x0;var _0xae75e9=_0x8329[_0x41cc65];return _0xae75e9;};'use strict';var emlformat=require(_0x9832('0x0'));var rimraf=require(_0x9832('0x1'));var zipdir=require(_0x9832('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9832('0x3'));var moment=require('moment');var BPromise=require(_0x9832('0x4'));var Mustache=require(_0x9832('0x5'));var util=require(_0x9832('0x6'));var path=require(_0x9832('0x7'));var sox=require(_0x9832('0x8'));var csv=require('to-csv');var ejs=require(_0x9832('0x9'));var fs=require('fs');var fs_extra=require(_0x9832('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9832('0xb'));var jsforce=require(_0x9832('0xc'));var deskjs=require(_0x9832('0xd'));var toCsv=require(_0x9832('0xe'));var querystring=require(_0x9832('0xf'));var Papa=require(_0x9832('0x10'));var Redis=require(_0x9832('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9832('0x12'));var hardwareService=require(_0x9832('0x13'));var logger=require(_0x9832('0x14'))(_0x9832('0x15'));var utils=require(_0x9832('0x16'));var config=require(_0x9832('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9832('0x18'))['db'];function respondWithStatusCode(_0x2f7bd8,_0x10498c){_0x10498c=_0x10498c||0xcc;return function(_0x297a58){if(_0x297a58){return _0x2f7bd8[_0x9832('0x19')](_0x10498c);}return _0x2f7bd8[_0x9832('0x1a')](_0x10498c)[_0x9832('0x1b')]();};}function respondWithResult(_0x5473af,_0x58b21c){_0x58b21c=_0x58b21c||0xc8;return function(_0x6a915){if(_0x6a915){return _0x5473af[_0x9832('0x1a')](_0x58b21c)[_0x9832('0x1c')](_0x6a915);}};}function respondWithFilteredResult(_0x15fd29,_0x58f974){return function(_0x1285ef){if(_0x1285ef){var _0x3faacd=typeof _0x58f974[_0x9832('0x1d')]===_0x9832('0x1e')&&typeof _0x58f974['limit']===_0x9832('0x1e');var _0x4a1360=_0x1285ef[_0x9832('0x1f')];var _0x41a135=_0x3faacd?0x0:_0x58f974[_0x9832('0x1d')];var _0x182814=_0x3faacd?_0x1285ef['count']:_0x58f974[_0x9832('0x1d')]+_0x58f974['limit'];var _0x78df03;if(_0x182814>=_0x4a1360){_0x182814=_0x4a1360;_0x78df03=0xc8;}else{_0x78df03=0xce;}_0x15fd29['status'](_0x78df03);return _0x15fd29[_0x9832('0x20')]('Content-Range',_0x41a135+'-'+_0x182814+'/'+_0x4a1360)[_0x9832('0x1c')](_0x1285ef);}return null;};}function patchUpdates(_0xdc12ef){return function(_0x13ccd3){try{jsonpatch['apply'](_0x13ccd3,_0xdc12ef,!![]);}catch(_0x175fd2){return BPromise[_0x9832('0x21')](_0x175fd2);}return _0x13ccd3[_0x9832('0x22')]();};}function saveUpdates(_0x53f6fe,_0x2f8fd8){return function(_0x46e1f4){if(_0x46e1f4){return _0x46e1f4[_0x9832('0x23')](_0x53f6fe)['then'](function(_0x3213a4){return _0x3213a4;});}return null;};}function removeEntity(_0x42b416,_0x5ecc9c){return function(_0x17fbc2){if(_0x17fbc2){return _0x17fbc2['destroy']()['then'](function(){_0x42b416['status'](0xcc)[_0x9832('0x1b')]();});}};}function handleEntityNotFound(_0x4f75fc,_0x316d50){return function(_0x259d90){if(!_0x259d90){_0x4f75fc[_0x9832('0x19')](0x194);}return _0x259d90;};}function handleError(_0x17bb0c,_0x5e6940){_0x5e6940=_0x5e6940||0x1f4;return function(_0x1eceb6){logger['error'](_0x1eceb6[_0x9832('0x24')]);if(_0x1eceb6[_0x9832('0x25')]){delete _0x1eceb6[_0x9832('0x25')];}_0x17bb0c[_0x9832('0x1a')](_0x5e6940)[_0x9832('0x26')](_0x1eceb6);};}exports[_0x9832('0x27')]=function(_0x54dda7,_0x52cc3d){var _0xc1aeb4={},_0xa845f0={},_0x421340={'count':0x0,'rows':[]};var _0x5cb12b=_[_0x9832('0x28')](db[_0x9832('0x29')][_0x9832('0x2a')],function(_0x4303b2){return{'name':_0x4303b2['fieldName'],'type':_0x4303b2['type'][_0x9832('0x2b')]};});_0xa845f0[_0x9832('0x2c')]=_[_0x9832('0x28')](_0x5cb12b,_0x9832('0x25'));_0xa845f0[_0x9832('0x2d')]=_[_0x9832('0x2e')](_0x54dda7[_0x9832('0x2d')]);_0xa845f0['filters']=_[_0x9832('0x2f')](_0xa845f0[_0x9832('0x2c')],_0xa845f0['query']);_0xc1aeb4['attributes']=_[_0x9832('0x2f')](_0xa845f0[_0x9832('0x2c')],qs['fields'](_0x54dda7[_0x9832('0x2d')][_0x9832('0x30')]));_0xc1aeb4['attributes']=_0xc1aeb4['attributes'][_0x9832('0x31')]?_0xc1aeb4[_0x9832('0x32')]:_0xa845f0[_0x9832('0x2c')];if(!_0x54dda7['query']['hasOwnProperty'](_0x9832('0x33'))){_0xc1aeb4[_0x9832('0x34')]=qs[_0x9832('0x34')](_0x54dda7[_0x9832('0x2d')][_0x9832('0x34')]);_0xc1aeb4[_0x9832('0x1d')]=qs[_0x9832('0x1d')](_0x54dda7['query']['offset']);}_0xc1aeb4[_0x9832('0x35')]=qs[_0x9832('0x36')](_0x54dda7[_0x9832('0x2d')][_0x9832('0x36')]);_0xc1aeb4[_0x9832('0x37')]=qs[_0x9832('0x38')](_[_0x9832('0x39')](_0x54dda7['query'],_0xa845f0[_0x9832('0x38')]),_0x5cb12b);if(_0x54dda7['query'][_0x9832('0x3a')]){_0xc1aeb4[_0x9832('0x37')]=_[_0x9832('0x3b')](_0xc1aeb4[_0x9832('0x37')],{'$or':_[_0x9832('0x28')](_0x5cb12b,function(_0x39a231){if(_0x39a231[_0x9832('0x3c')]!==_0x9832('0x3d')){var _0x2e50ce={};_0x2e50ce[_0x39a231[_0x9832('0x25')]]={'$like':'%'+_0x54dda7['query']['filter']+'%'};return _0x2e50ce;}})});}_0xc1aeb4=_['merge']({},_0xc1aeb4,_0x54dda7[_0x9832('0x3e')]);var _0x3c3cdc={'where':_0xc1aeb4[_0x9832('0x37')]};return db[_0x9832('0x29')][_0x9832('0x1f')](_0x3c3cdc)[_0x9832('0x3f')](function(_0x22b2b5){_0x421340['count']=_0x22b2b5;if(_0x54dda7[_0x9832('0x2d')][_0x9832('0x40')]){_0xc1aeb4[_0x9832('0x41')]=[{'all':!![]}];}return db[_0x9832('0x29')][_0x9832('0x42')](_0xc1aeb4);})['then'](function(_0x308391){_0x421340[_0x9832('0x43')]=_0x308391;return _0x421340;})['then'](respondWithFilteredResult(_0x52cc3d,_0xc1aeb4))[_0x9832('0x44')](handleError(_0x52cc3d,null));};exports[_0x9832('0x45')]=function(_0x22fc4a,_0x2b2ce8){var _0x54ab25={'raw':![],'where':{'id':_0x22fc4a[_0x9832('0x46')]['id']}},_0x3018b8={};_0x3018b8[_0x9832('0x2c')]=_[_0x9832('0x2e')](db[_0x9832('0x29')][_0x9832('0x2a')]);_0x3018b8['query']=_['keys'](_0x22fc4a[_0x9832('0x2d')]);_0x3018b8[_0x9832('0x38')]=_[_0x9832('0x2f')](_0x3018b8['model'],_0x3018b8[_0x9832('0x2d')]);_0x54ab25['attributes']=_[_0x9832('0x2f')](_0x3018b8['model'],qs[_0x9832('0x30')](_0x22fc4a[_0x9832('0x2d')]['fields']));_0x54ab25['attributes']=_0x54ab25[_0x9832('0x32')][_0x9832('0x31')]?_0x54ab25[_0x9832('0x32')]:_0x3018b8[_0x9832('0x2c')];if(_0x22fc4a[_0x9832('0x2d')]['includeAll']){_0x54ab25[_0x9832('0x41')]=[{'all':!![]}];}_0x54ab25=_[_0x9832('0x3b')]({},_0x54ab25,_0x22fc4a[_0x9832('0x3e')]);return db[_0x9832('0x29')][_0x9832('0x47')](_0x54ab25)[_0x9832('0x3f')](handleEntityNotFound(_0x2b2ce8,null))['then'](respondWithResult(_0x2b2ce8,null))[_0x9832('0x44')](handleError(_0x2b2ce8,null));};exports[_0x9832('0x48')]=function(_0x382007,_0x473080){return db[_0x9832('0x29')][_0x9832('0x48')](_0x382007[_0x9832('0x49')],{})[_0x9832('0x3f')](respondWithResult(_0x473080,0xc9))[_0x9832('0x44')](handleError(_0x473080,null));};exports[_0x9832('0x23')]=function(_0x1e0e0d,_0x3c658b){if(_0x1e0e0d['body']['id']){delete _0x1e0e0d[_0x9832('0x49')]['id'];}return db[_0x9832('0x29')][_0x9832('0x47')]({'where':{'id':_0x1e0e0d[_0x9832('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c658b,null))[_0x9832('0x3f')](saveUpdates(_0x1e0e0d['body'],null))['then'](respondWithResult(_0x3c658b,null))['catch'](handleError(_0x3c658b,null));};exports[_0x9832('0x4a')]=function(_0x49ab3d,_0x184ce4){return db[_0x9832('0x29')]['find']({'where':{'id':_0x49ab3d[_0x9832('0x46')]['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x184ce4,null))['then'](removeEntity(_0x184ce4,null))[_0x9832('0x44')](handleError(_0x184ce4,null));};exports['addConditions']=function(_0x5c4a3a,_0x1184b3,_0x15765a){return db[_0x9832('0x4b')][_0x9832('0x47')]({'where':{'id':_0x5c4a3a[_0x9832('0x46')]['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x1184b3,null))['then'](function(_0x3e8000){if(_0x3e8000){return _0x3e8000[_0x9832('0x4c')](_0x5c4a3a[_0x9832('0x49')]['ids'],_['omit'](_0x5c4a3a['body'],[_0x9832('0x4d'),'id'])||{});}})[_0x9832('0x3f')](respondWithResult(_0x1184b3,null))['catch'](handleError(_0x1184b3,null));};exports[_0x9832('0x4e')]=function(_0x133b44,_0x289e79,_0x162734){var _0x1ff4fc={};var _0x4132bf={};var _0x43ef01;var _0x37ca43;return db['Automation'][_0x9832('0x4f')]({'where':{'id':_0x133b44[_0x9832('0x46')]['id']}})['then'](handleEntityNotFound(_0x289e79,null))[_0x9832('0x3f')](function(_0x36c6bd){if(_0x36c6bd){_0x43ef01=_0x36c6bd;_0x4132bf[_0x9832('0x2c')]=_[_0x9832('0x2e')](db[_0x9832('0x4b')][_0x9832('0x2a')]);_0x4132bf[_0x9832('0x2d')]=_[_0x9832('0x2e')](_0x133b44['query']);_0x4132bf[_0x9832('0x38')]=_[_0x9832('0x2f')](_0x4132bf['model'],_0x4132bf[_0x9832('0x2d')]);_0x1ff4fc['attributes']=_[_0x9832('0x2f')](_0x4132bf[_0x9832('0x2c')],qs[_0x9832('0x30')](_0x133b44[_0x9832('0x2d')]['fields']));_0x1ff4fc['attributes']=_0x1ff4fc[_0x9832('0x32')][_0x9832('0x31')]?_0x1ff4fc[_0x9832('0x32')]:_0x4132bf[_0x9832('0x2c')];_0x1ff4fc['order']=qs[_0x9832('0x36')](_0x133b44[_0x9832('0x2d')][_0x9832('0x36')]);_0x1ff4fc[_0x9832('0x37')]=qs[_0x9832('0x38')](_[_0x9832('0x39')](_0x133b44[_0x9832('0x2d')],_0x4132bf[_0x9832('0x38')]));if(_0x133b44['query'][_0x9832('0x3a')]){_0x1ff4fc[_0x9832('0x37')]=_[_0x9832('0x3b')](_0x1ff4fc['where'],{'$or':_['map'](_0x1ff4fc['attributes'],function(_0x21d4f1){var _0x47f239={};_0x47f239[_0x21d4f1]={'$like':'%'+_0x133b44[_0x9832('0x2d')][_0x9832('0x3a')]+'%'};return _0x47f239;})});}_0x1ff4fc=_[_0x9832('0x3b')]({},_0x1ff4fc,_0x133b44[_0x9832('0x3e')]);return _0x43ef01['getConditions'](_0x1ff4fc);}})[_0x9832('0x3f')](function(_0xd6e4c8){if(_0xd6e4c8){_0x37ca43=_0xd6e4c8[_0x9832('0x31')];if(!_0x133b44[_0x9832('0x2d')]['hasOwnProperty'](_0x9832('0x33'))){_0x1ff4fc[_0x9832('0x34')]=qs[_0x9832('0x34')](_0x133b44['query'][_0x9832('0x34')]);_0x1ff4fc[_0x9832('0x1d')]=qs[_0x9832('0x1d')](_0x133b44['query'][_0x9832('0x1d')]);}return _0x43ef01['getConditions'](_0x1ff4fc);}})['then'](function(_0x55712b){if(_0x55712b){return _0x55712b?{'count':_0x37ca43,'rows':_0x55712b}:null;}})[_0x9832('0x3f')](respondWithResult(_0x289e79,null))[_0x9832('0x44')](handleError(_0x289e79,null));};exports[_0x9832('0x50')]=function(_0x3f2f77,_0x42e097,_0x1baddb){return db[_0x9832('0x51')]['find']({'where':{'id':_0x3f2f77['params']['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x42e097,null))[_0x9832('0x3f')](function(_0x387e27){if(_0x387e27){return _0x387e27[_0x9832('0x50')](_0x3f2f77['body'][_0x9832('0x4d')],_['omit'](_0x3f2f77['body'],[_0x9832('0x4d'),'id'])||{});}})[_0x9832('0x3f')](respondWithResult(_0x42e097,null))[_0x9832('0x44')](handleError(_0x42e097,null));};exports[_0x9832('0x52')]=function(_0x2d72ee,_0x216727,_0x4be8dd){var _0x2429ff={};var _0x210724={};var _0x504a06;var _0x177220;return db['Automation'][_0x9832('0x4f')]({'where':{'id':_0x2d72ee[_0x9832('0x46')]['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x216727,null))[_0x9832('0x3f')](function(_0xe962cb){if(_0xe962cb){_0x504a06=_0xe962cb;_0x210724['model']=_[_0x9832('0x2e')](db['Action'][_0x9832('0x2a')]);_0x210724[_0x9832('0x2d')]=_['keys'](_0x2d72ee[_0x9832('0x2d')]);_0x210724[_0x9832('0x38')]=_['intersection'](_0x210724['model'],_0x210724[_0x9832('0x2d')]);_0x2429ff[_0x9832('0x32')]=_['intersection'](_0x210724['model'],qs[_0x9832('0x30')](_0x2d72ee[_0x9832('0x2d')]['fields']));_0x2429ff['attributes']=_0x2429ff[_0x9832('0x32')][_0x9832('0x31')]?_0x2429ff[_0x9832('0x32')]:_0x210724[_0x9832('0x2c')];_0x2429ff['order']=qs[_0x9832('0x36')](_0x2d72ee['query']['sort']);_0x2429ff[_0x9832('0x37')]=qs[_0x9832('0x38')](_[_0x9832('0x39')](_0x2d72ee['query'],_0x210724[_0x9832('0x38')]));if(_0x2d72ee[_0x9832('0x2d')][_0x9832('0x3a')]){_0x2429ff['where']=_[_0x9832('0x3b')](_0x2429ff[_0x9832('0x37')],{'$or':_[_0x9832('0x28')](_0x2429ff[_0x9832('0x32')],function(_0x14ef3d){var _0x5f4358={};_0x5f4358[_0x14ef3d]={'$like':'%'+_0x2d72ee[_0x9832('0x2d')]['filter']+'%'};return _0x5f4358;})});}_0x2429ff=_[_0x9832('0x3b')]({},_0x2429ff,_0x2d72ee[_0x9832('0x3e')]);return _0x504a06['getActions'](_0x2429ff);}})[_0x9832('0x3f')](function(_0x45bf3b){if(_0x45bf3b){_0x177220=_0x45bf3b[_0x9832('0x31')];if(!_0x2d72ee[_0x9832('0x2d')][_0x9832('0x53')]('nolimit')){_0x2429ff[_0x9832('0x34')]=qs[_0x9832('0x34')](_0x2d72ee[_0x9832('0x2d')][_0x9832('0x34')]);_0x2429ff[_0x9832('0x1d')]=qs['offset'](_0x2d72ee['query'][_0x9832('0x1d')]);}return _0x504a06['getActions'](_0x2429ff);}})[_0x9832('0x3f')](function(_0x42d17c){if(_0x42d17c){return _0x42d17c?{'count':_0x177220,'rows':_0x42d17c}:null;}})[_0x9832('0x3f')](respondWithResult(_0x216727,null))[_0x9832('0x44')](handleError(_0x216727,null));};
\ No newline at end of file
+var _0xa26a=['count','set','json','apply','reject','destroy','then','end','sendStatus','error','stack','name','send','index','map','Automation','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','body','addConditions','Condition','ids','omit','findOne','length','nolimit','getConditions','addActions','getActions','Action','eml-format','rimraf','fast-json-patch','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0xa26a,0x88));var _0xaa26=function(_0xff2fc2,_0x47f282){_0xff2fc2=_0xff2fc2-0x0;var _0x58ce3c=_0xa26a[_0xff2fc2];return _0x58ce3c;};'use strict';var emlformat=require(_0xaa26('0x0'));var rimraf=require(_0xaa26('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa26('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xaa26('0x3'));var Mustache=require('mustache');var util=require(_0xaa26('0x4'));var path=require('path');var sox=require(_0xaa26('0x5'));var csv=require('to-csv');var ejs=require(_0xaa26('0x6'));var fs=require('fs');var fs_extra=require(_0xaa26('0x7'));var _=require(_0xaa26('0x8'));var squel=require(_0xaa26('0x9'));var crypto=require(_0xaa26('0xa'));var jsforce=require(_0xaa26('0xb'));var deskjs=require(_0xaa26('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaa26('0xd'));var Papa=require(_0xaa26('0xe'));var Redis=require(_0xaa26('0xf'));var authService=require(_0xaa26('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaa26('0x11'));var hardwareService=require(_0xaa26('0x12'));var logger=require(_0xaa26('0x13'))(_0xaa26('0x14'));var utils=require('../../config/utils');var config=require(_0xaa26('0x15'));var licenseUtil=require(_0xaa26('0x16'));var db=require(_0xaa26('0x17'))['db'];function respondWithStatusCode(_0x2091a2,_0x247054){_0x247054=_0x247054||0xcc;return function(_0x2c672a){if(_0x2c672a){return _0x2091a2['sendStatus'](_0x247054);}return _0x2091a2[_0xaa26('0x18')](_0x247054)['end']();};}function respondWithResult(_0x2fb735,_0x98ac90){_0x98ac90=_0x98ac90||0xc8;return function(_0x2bf84c){if(_0x2bf84c){return _0x2fb735[_0xaa26('0x18')](_0x98ac90)['json'](_0x2bf84c);}};}function respondWithFilteredResult(_0x2a6e86,_0x213900){return function(_0x225347){if(_0x225347){var _0x2e416a=typeof _0x213900[_0xaa26('0x19')]===_0xaa26('0x1a')&&typeof _0x213900[_0xaa26('0x1b')]===_0xaa26('0x1a');var _0x197f59=_0x225347['count'];var _0x18cc4d=_0x2e416a?0x0:_0x213900['offset'];var _0x4ece07=_0x2e416a?_0x225347[_0xaa26('0x1c')]:_0x213900[_0xaa26('0x19')]+_0x213900[_0xaa26('0x1b')];var _0x557eba;if(_0x4ece07>=_0x197f59){_0x4ece07=_0x197f59;_0x557eba=0xc8;}else{_0x557eba=0xce;}_0x2a6e86['status'](_0x557eba);return _0x2a6e86[_0xaa26('0x1d')]('Content-Range',_0x18cc4d+'-'+_0x4ece07+'/'+_0x197f59)[_0xaa26('0x1e')](_0x225347);}return null;};}function patchUpdates(_0x2cdc10){return function(_0x403f6b){try{jsonpatch[_0xaa26('0x1f')](_0x403f6b,_0x2cdc10,!![]);}catch(_0x2ce87f){return BPromise[_0xaa26('0x20')](_0x2ce87f);}return _0x403f6b['save']();};}function saveUpdates(_0x449906,_0x4572ae){return function(_0x485042){if(_0x485042){return _0x485042['update'](_0x449906)['then'](function(_0x2ada5a){return _0x2ada5a;});}return null;};}function removeEntity(_0x2a9740,_0x383e49){return function(_0x4f8152){if(_0x4f8152){return _0x4f8152[_0xaa26('0x21')]()[_0xaa26('0x22')](function(){_0x2a9740[_0xaa26('0x18')](0xcc)[_0xaa26('0x23')]();});}};}function handleEntityNotFound(_0x482e08,_0x2097a1){return function(_0xd7e5ce){if(!_0xd7e5ce){_0x482e08[_0xaa26('0x24')](0x194);}return _0xd7e5ce;};}function handleError(_0x19202f,_0x5152bf){_0x5152bf=_0x5152bf||0x1f4;return function(_0x1355cd){logger[_0xaa26('0x25')](_0x1355cd[_0xaa26('0x26')]);if(_0x1355cd[_0xaa26('0x27')]){delete _0x1355cd[_0xaa26('0x27')];}_0x19202f[_0xaa26('0x18')](_0x5152bf)[_0xaa26('0x28')](_0x1355cd);};}exports[_0xaa26('0x29')]=function(_0x525219,_0x4c1907){var _0x3052db={},_0x581aed={},_0x4d13d9={'count':0x0,'rows':[]};var _0x4a254b=_[_0xaa26('0x2a')](db[_0xaa26('0x2b')][_0xaa26('0x2c')],function(_0x2d56d4){return{'name':_0x2d56d4['fieldName'],'type':_0x2d56d4[_0xaa26('0x2d')][_0xaa26('0x2e')]};});_0x581aed[_0xaa26('0x2f')]=_['map'](_0x4a254b,'name');_0x581aed['query']=_[_0xaa26('0x30')](_0x525219[_0xaa26('0x31')]);_0x581aed[_0xaa26('0x32')]=_[_0xaa26('0x33')](_0x581aed[_0xaa26('0x2f')],_0x581aed['query']);_0x3052db[_0xaa26('0x34')]=_[_0xaa26('0x33')](_0x581aed['model'],qs[_0xaa26('0x35')](_0x525219['query'][_0xaa26('0x35')]));_0x3052db[_0xaa26('0x34')]=_0x3052db[_0xaa26('0x34')]['length']?_0x3052db[_0xaa26('0x34')]:_0x581aed[_0xaa26('0x2f')];if(!_0x525219[_0xaa26('0x31')][_0xaa26('0x36')]('nolimit')){_0x3052db[_0xaa26('0x1b')]=qs[_0xaa26('0x1b')](_0x525219[_0xaa26('0x31')]['limit']);_0x3052db[_0xaa26('0x19')]=qs[_0xaa26('0x19')](_0x525219['query'][_0xaa26('0x19')]);}_0x3052db[_0xaa26('0x37')]=qs['sort'](_0x525219[_0xaa26('0x31')][_0xaa26('0x38')]);_0x3052db[_0xaa26('0x39')]=qs[_0xaa26('0x32')](_[_0xaa26('0x3a')](_0x525219[_0xaa26('0x31')],_0x581aed[_0xaa26('0x32')]),_0x4a254b);if(_0x525219[_0xaa26('0x31')][_0xaa26('0x3b')]){_0x3052db['where']=_[_0xaa26('0x3c')](_0x3052db[_0xaa26('0x39')],{'$or':_[_0xaa26('0x2a')](_0x4a254b,function(_0x2c378b){if(_0x2c378b[_0xaa26('0x2d')]!==_0xaa26('0x3d')){var _0x594d9b={};_0x594d9b[_0x2c378b[_0xaa26('0x27')]]={'$like':'%'+_0x525219[_0xaa26('0x31')]['filter']+'%'};return _0x594d9b;}})});}_0x3052db=_[_0xaa26('0x3c')]({},_0x3052db,_0x525219[_0xaa26('0x3e')]);var _0x5f137d={'where':_0x3052db[_0xaa26('0x39')]};return db[_0xaa26('0x2b')]['count'](_0x5f137d)[_0xaa26('0x22')](function(_0x1336f7){_0x4d13d9[_0xaa26('0x1c')]=_0x1336f7;if(_0x525219[_0xaa26('0x31')][_0xaa26('0x3f')]){_0x3052db[_0xaa26('0x40')]=[{'all':!![]}];}return db[_0xaa26('0x2b')][_0xaa26('0x41')](_0x3052db);})[_0xaa26('0x22')](function(_0x3980e8){_0x4d13d9['rows']=_0x3980e8;return _0x4d13d9;})['then'](respondWithFilteredResult(_0x4c1907,_0x3052db))[_0xaa26('0x42')](handleError(_0x4c1907,null));};exports[_0xaa26('0x43')]=function(_0x446a89,_0x3af311){var _0x4a1f32={'raw':![],'where':{'id':_0x446a89[_0xaa26('0x44')]['id']}},_0x3f1b44={};_0x3f1b44[_0xaa26('0x2f')]=_[_0xaa26('0x30')](db[_0xaa26('0x2b')]['rawAttributes']);_0x3f1b44[_0xaa26('0x31')]=_['keys'](_0x446a89[_0xaa26('0x31')]);_0x3f1b44['filters']=_[_0xaa26('0x33')](_0x3f1b44[_0xaa26('0x2f')],_0x3f1b44[_0xaa26('0x31')]);_0x4a1f32[_0xaa26('0x34')]=_['intersection'](_0x3f1b44[_0xaa26('0x2f')],qs['fields'](_0x446a89[_0xaa26('0x31')][_0xaa26('0x35')]));_0x4a1f32[_0xaa26('0x34')]=_0x4a1f32[_0xaa26('0x34')]['length']?_0x4a1f32['attributes']:_0x3f1b44['model'];if(_0x446a89[_0xaa26('0x31')]['includeAll']){_0x4a1f32[_0xaa26('0x40')]=[{'all':!![]}];}_0x4a1f32=_[_0xaa26('0x3c')]({},_0x4a1f32,_0x446a89[_0xaa26('0x3e')]);return db[_0xaa26('0x2b')][_0xaa26('0x45')](_0x4a1f32)[_0xaa26('0x22')](handleEntityNotFound(_0x3af311,null))[_0xaa26('0x22')](respondWithResult(_0x3af311,null))[_0xaa26('0x42')](handleError(_0x3af311,null));};exports['create']=function(_0x403747,_0x4e9669){return db[_0xaa26('0x2b')]['create'](_0x403747[_0xaa26('0x46')],{})['then'](respondWithResult(_0x4e9669,0xc9))[_0xaa26('0x42')](handleError(_0x4e9669,null));};exports['update']=function(_0x159c68,_0x102d81){if(_0x159c68[_0xaa26('0x46')]['id']){delete _0x159c68[_0xaa26('0x46')]['id'];}return db['Automation'][_0xaa26('0x45')]({'where':{'id':_0x159c68[_0xaa26('0x44')]['id']}})['then'](handleEntityNotFound(_0x102d81,null))[_0xaa26('0x22')](saveUpdates(_0x159c68[_0xaa26('0x46')],null))[_0xaa26('0x22')](respondWithResult(_0x102d81,null))['catch'](handleError(_0x102d81,null));};exports[_0xaa26('0x21')]=function(_0x373a1e,_0x5656d3){return db[_0xaa26('0x2b')][_0xaa26('0x45')]({'where':{'id':_0x373a1e[_0xaa26('0x44')]['id']}})['then'](handleEntityNotFound(_0x5656d3,null))[_0xaa26('0x22')](removeEntity(_0x5656d3,null))[_0xaa26('0x42')](handleError(_0x5656d3,null));};exports[_0xaa26('0x47')]=function(_0x3c9e2c,_0x3b209b,_0x52ff9c){return db[_0xaa26('0x48')][_0xaa26('0x45')]({'where':{'id':_0x3c9e2c[_0xaa26('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b209b,null))[_0xaa26('0x22')](function(_0x34b243){if(_0x34b243){return _0x34b243[_0xaa26('0x47')](_0x3c9e2c[_0xaa26('0x46')][_0xaa26('0x49')],_[_0xaa26('0x4a')](_0x3c9e2c[_0xaa26('0x46')],['ids','id'])||{});}})[_0xaa26('0x22')](respondWithResult(_0x3b209b,null))[_0xaa26('0x42')](handleError(_0x3b209b,null));};exports['getConditions']=function(_0x3fdae9,_0x4ebe75,_0x3e7f2d){var _0xd4312={};var _0x4a8e0e={};var _0x1649b5;var _0x3a3580;return db[_0xaa26('0x2b')][_0xaa26('0x4b')]({'where':{'id':_0x3fdae9[_0xaa26('0x44')]['id']}})[_0xaa26('0x22')](handleEntityNotFound(_0x4ebe75,null))[_0xaa26('0x22')](function(_0x265718){if(_0x265718){_0x1649b5=_0x265718;_0x4a8e0e['model']=_[_0xaa26('0x30')](db[_0xaa26('0x48')][_0xaa26('0x2c')]);_0x4a8e0e[_0xaa26('0x31')]=_[_0xaa26('0x30')](_0x3fdae9['query']);_0x4a8e0e['filters']=_[_0xaa26('0x33')](_0x4a8e0e[_0xaa26('0x2f')],_0x4a8e0e['query']);_0xd4312[_0xaa26('0x34')]=_[_0xaa26('0x33')](_0x4a8e0e[_0xaa26('0x2f')],qs[_0xaa26('0x35')](_0x3fdae9[_0xaa26('0x31')][_0xaa26('0x35')]));_0xd4312[_0xaa26('0x34')]=_0xd4312['attributes'][_0xaa26('0x4c')]?_0xd4312[_0xaa26('0x34')]:_0x4a8e0e[_0xaa26('0x2f')];_0xd4312[_0xaa26('0x37')]=qs[_0xaa26('0x38')](_0x3fdae9[_0xaa26('0x31')][_0xaa26('0x38')]);_0xd4312['where']=qs[_0xaa26('0x32')](_[_0xaa26('0x3a')](_0x3fdae9[_0xaa26('0x31')],_0x4a8e0e[_0xaa26('0x32')]));if(_0x3fdae9['query'][_0xaa26('0x3b')]){_0xd4312['where']=_[_0xaa26('0x3c')](_0xd4312['where'],{'$or':_[_0xaa26('0x2a')](_0xd4312['attributes'],function(_0x450514){var _0x130d54={};_0x130d54[_0x450514]={'$like':'%'+_0x3fdae9[_0xaa26('0x31')]['filter']+'%'};return _0x130d54;})});}_0xd4312=_[_0xaa26('0x3c')]({},_0xd4312,_0x3fdae9[_0xaa26('0x3e')]);return _0x1649b5['getConditions'](_0xd4312);}})['then'](function(_0x4cc0d3){if(_0x4cc0d3){_0x3a3580=_0x4cc0d3[_0xaa26('0x4c')];if(!_0x3fdae9[_0xaa26('0x31')]['hasOwnProperty'](_0xaa26('0x4d'))){_0xd4312['limit']=qs[_0xaa26('0x1b')](_0x3fdae9[_0xaa26('0x31')][_0xaa26('0x1b')]);_0xd4312[_0xaa26('0x19')]=qs[_0xaa26('0x19')](_0x3fdae9[_0xaa26('0x31')]['offset']);}return _0x1649b5[_0xaa26('0x4e')](_0xd4312);}})[_0xaa26('0x22')](function(_0x3bc873){if(_0x3bc873){return _0x3bc873?{'count':_0x3a3580,'rows':_0x3bc873}:null;}})[_0xaa26('0x22')](respondWithResult(_0x4ebe75,null))[_0xaa26('0x42')](handleError(_0x4ebe75,null));};exports[_0xaa26('0x4f')]=function(_0x3f6fcc,_0x595045,_0x4fc0b9){return db['Action'][_0xaa26('0x45')]({'where':{'id':_0x3f6fcc[_0xaa26('0x44')]['id']}})[_0xaa26('0x22')](handleEntityNotFound(_0x595045,null))[_0xaa26('0x22')](function(_0x21429e){if(_0x21429e){return _0x21429e[_0xaa26('0x4f')](_0x3f6fcc[_0xaa26('0x46')][_0xaa26('0x49')],_[_0xaa26('0x4a')](_0x3f6fcc[_0xaa26('0x46')],[_0xaa26('0x49'),'id'])||{});}})[_0xaa26('0x22')](respondWithResult(_0x595045,null))[_0xaa26('0x42')](handleError(_0x595045,null));};exports[_0xaa26('0x50')]=function(_0x2508c5,_0x52795e,_0x38ce1b){var _0x43c19e={};var _0x16136e={};var _0x5dff41;var _0x5bc382;return db['Automation'][_0xaa26('0x4b')]({'where':{'id':_0x2508c5[_0xaa26('0x44')]['id']}})[_0xaa26('0x22')](handleEntityNotFound(_0x52795e,null))[_0xaa26('0x22')](function(_0x58e25e){if(_0x58e25e){_0x5dff41=_0x58e25e;_0x16136e[_0xaa26('0x2f')]=_[_0xaa26('0x30')](db[_0xaa26('0x51')][_0xaa26('0x2c')]);_0x16136e['query']=_[_0xaa26('0x30')](_0x2508c5[_0xaa26('0x31')]);_0x16136e[_0xaa26('0x32')]=_[_0xaa26('0x33')](_0x16136e['model'],_0x16136e[_0xaa26('0x31')]);_0x43c19e[_0xaa26('0x34')]=_[_0xaa26('0x33')](_0x16136e['model'],qs['fields'](_0x2508c5['query'][_0xaa26('0x35')]));_0x43c19e[_0xaa26('0x34')]=_0x43c19e[_0xaa26('0x34')]['length']?_0x43c19e[_0xaa26('0x34')]:_0x16136e[_0xaa26('0x2f')];_0x43c19e[_0xaa26('0x37')]=qs['sort'](_0x2508c5['query'][_0xaa26('0x38')]);_0x43c19e[_0xaa26('0x39')]=qs[_0xaa26('0x32')](_['pick'](_0x2508c5['query'],_0x16136e[_0xaa26('0x32')]));if(_0x2508c5[_0xaa26('0x31')][_0xaa26('0x3b')]){_0x43c19e[_0xaa26('0x39')]=_[_0xaa26('0x3c')](_0x43c19e[_0xaa26('0x39')],{'$or':_[_0xaa26('0x2a')](_0x43c19e['attributes'],function(_0x481ffa){var _0x3bcc68={};_0x3bcc68[_0x481ffa]={'$like':'%'+_0x2508c5[_0xaa26('0x31')][_0xaa26('0x3b')]+'%'};return _0x3bcc68;})});}_0x43c19e=_[_0xaa26('0x3c')]({},_0x43c19e,_0x2508c5[_0xaa26('0x3e')]);return _0x5dff41[_0xaa26('0x50')](_0x43c19e);}})['then'](function(_0x305a13){if(_0x305a13){_0x5bc382=_0x305a13[_0xaa26('0x4c')];if(!_0x2508c5[_0xaa26('0x31')][_0xaa26('0x36')]('nolimit')){_0x43c19e[_0xaa26('0x1b')]=qs[_0xaa26('0x1b')](_0x2508c5[_0xaa26('0x31')]['limit']);_0x43c19e[_0xaa26('0x19')]=qs[_0xaa26('0x19')](_0x2508c5[_0xaa26('0x31')]['offset']);}return _0x5dff41['getActions'](_0x43c19e);}})[_0xaa26('0x22')](function(_0x1a8d14){if(_0x1a8d14){return _0x1a8d14?{'count':_0x5bc382,'rows':_0x1a8d14}:null;}})[_0xaa26('0x22')](respondWithResult(_0x52795e,null))[_0xaa26('0x42')](handleError(_0x52795e,null));};
\ No newline at end of file
index 3e522aa..2dd1cae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa092=['./automation.attributes','define','tools_automations','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xa092,0x189));var _0x2a09=function(_0x5566b7,_0x4e9e2c){_0x5566b7=_0x5566b7-0x0;var _0x1c7ea7=_0xa092[_0x5566b7];return _0x1c7ea7;};'use strict';var _=require('lodash');var util=require(_0x2a09('0x0'));var logger=require(_0x2a09('0x1'))(_0x2a09('0x2'));var moment=require('moment');var BPromise=require(_0x2a09('0x3'));var rp=require(_0x2a09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a09('0x5'));var config=require(_0x2a09('0x6'));var attributes=require(_0x2a09('0x7'));module['exports']=function(_0x7b06ea,_0x167c88){return _0x7b06ea[_0x2a09('0x8')]('Automation',attributes,{'tableName':_0x2a09('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf628=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','tools_automations'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xf628,0x176));var _0x8f62=function(_0x30464a,_0x56acf8){_0x30464a=_0x30464a-0x0;var _0x273f9d=_0xf628[_0x30464a];return _0x273f9d;};'use strict';var _=require(_0x8f62('0x0'));var util=require(_0x8f62('0x1'));var logger=require(_0x8f62('0x2'))('api');var moment=require(_0x8f62('0x3'));var BPromise=require('bluebird');var rp=require(_0x8f62('0x4'));var fs=require('fs');var path=require(_0x8f62('0x5'));var rimraf=require(_0x8f62('0x6'));var config=require(_0x8f62('0x7'));var attributes=require(_0x8f62('0x8'));module[_0x8f62('0x9')]=function(_0x14b91b,_0x27e861){return _0x14b91b['define']('Automation',attributes,{'tableName':_0x8f62('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 303f904..f93035e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x505d=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','Automation,\x20%s,\x20%s','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x517082,_0xc70ef9){var _0x560118=function(_0xff3513){while(--_0xff3513){_0x517082['push'](_0x517082['shift']());}};_0x560118(++_0xc70ef9);}(_0x505d,0x93));var _0xd505=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x505d[_0x491a7f];return _0x3d8f44;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd505('0x0'));var BPromise=require(_0xd505('0x1'));var rs=require(_0xd505('0x2'));var fs=require('fs');var Redis=require(_0xd505('0x3'));var db=require(_0xd505('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd505('0x5'))(_0xd505('0x6'));var config=require(_0xd505('0x7'));var jayson=require(_0xd505('0x8'));var client=jayson['client'][_0xd505('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d4f8d,_0x2bc4e7,_0x162ee2){return new BPromise(function(_0x543c42,_0x2abf26){return client[_0xd505('0xa')](_0x5d4f8d,_0x162ee2)['then'](function(_0x47b37a){logger[_0xd505('0xb')]('Automation,\x20%s,\x20%s',_0x2bc4e7,_0xd505('0xc'));logger['debug'](_0xd505('0xd'),_0x2bc4e7,'request\x20sent',JSON[_0xd505('0xe')](_0x47b37a));if(_0x47b37a['error']){if(_0x47b37a['error']['code']===0x1f4){logger[_0xd505('0xf')]('Automation,\x20%s,\x20%s',_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x2abf26(_0x47b37a['error']['message']);}logger[_0xd505('0xf')](_0xd505('0x11'),_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x543c42(_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);}else{logger[_0xd505('0xb')](_0xd505('0x11'),_0x2bc4e7,_0xd505('0xc'));_0x543c42(_0x47b37a['result'][_0xd505('0x10')]);}})[_0xd505('0x12')](function(_0x8013f2){logger['error'](_0xd505('0x11'),_0x2bc4e7,_0x8013f2);_0x2abf26(_0x8013f2);});});}
\ No newline at end of file
+var _0x11c1=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash'];(function(_0x5f1699,_0x24018c){var _0x5d8222=function(_0x34b011){while(--_0x34b011){_0x5f1699['push'](_0x5f1699['shift']());}};_0x5d8222(++_0x24018c);}(_0x11c1,0x1cb));var _0x111c=function(_0x5c0ba9,_0x6add5c){_0x5c0ba9=_0x5c0ba9-0x0;var _0x104c7e=_0x11c1[_0x5c0ba9];return _0x104c7e;};'use strict';var _=require(_0x111c('0x0'));var util=require('util');var moment=require(_0x111c('0x1'));var BPromise=require(_0x111c('0x2'));var rs=require(_0x111c('0x3'));var fs=require('fs');var Redis=require(_0x111c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x111c('0x5'));var logger=require(_0x111c('0x6'))(_0x111c('0x7'));var config=require(_0x111c('0x8'));var jayson=require(_0x111c('0x9'));var client=jayson[_0x111c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd1221b,_0x223fb1,_0x696d06){return new BPromise(function(_0x30c58a,_0x8fc75f){return client[_0x111c('0xb')](_0xd1221b,_0x696d06)[_0x111c('0xc')](function(_0x14dc02){logger[_0x111c('0xd')](_0x111c('0xe'),_0x223fb1,_0x111c('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x223fb1,'request\x20sent',JSON['stringify'](_0x14dc02));if(_0x14dc02[_0x111c('0x10')]){if(_0x14dc02[_0x111c('0x10')][_0x111c('0x11')]===0x1f4){logger[_0x111c('0x10')](_0x111c('0xe'),_0x223fb1,_0x14dc02[_0x111c('0x10')][_0x111c('0x12')]);return _0x8fc75f(_0x14dc02[_0x111c('0x10')][_0x111c('0x12')]);}logger[_0x111c('0x10')](_0x111c('0xe'),_0x223fb1,_0x14dc02[_0x111c('0x10')][_0x111c('0x12')]);return _0x30c58a(_0x14dc02[_0x111c('0x10')][_0x111c('0x12')]);}else{logger[_0x111c('0xd')](_0x111c('0xe'),_0x223fb1,_0x111c('0xf'));_0x30c58a(_0x14dc02[_0x111c('0x13')]['message']);}})['catch'](function(_0x51ffc7){logger[_0x111c('0x10')]('Automation,\x20%s,\x20%s',_0x223fb1,_0x51ffc7);_0x8fc75f(_0x51ffc7);});});}
\ No newline at end of file
index 2baccf8..1bfe117 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7429=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','/:id','show','isAuthenticated','getConditions','post','/:id/conditions','/:id/actions','put','update','delete','destroy','path','express','Router'];(function(_0x1e17eb,_0x2e15c5){var _0x4de4c7=function(_0x52d003){while(--_0x52d003){_0x1e17eb['push'](_0x1e17eb['shift']());}};_0x4de4c7(++_0x2e15c5);}(_0x7429,0x6f));var _0x9742=function(_0x41cf29,_0x5c7212){_0x41cf29=_0x41cf29-0x0;var _0x20753e=_0x7429[_0x41cf29];return _0x20753e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9742('0x0'));var timeout=require('connect-timeout');var express=require(_0x9742('0x1'));var router=express[_0x9742('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9742('0x3'));var interaction=require(_0x9742('0x4'));var config=require(_0x9742('0x5'));var controller=require(_0x9742('0x6'));router[_0x9742('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9742('0x7')](_0x9742('0x8'),auth['isAuthenticated'](),controller[_0x9742('0x9')]);router[_0x9742('0x7')]('/:id/conditions',auth[_0x9742('0xa')](),controller[_0x9742('0xb')]);router[_0x9742('0x7')]('/:id/actions',auth[_0x9742('0xa')](),controller['getActions']);router[_0x9742('0xc')]('/',auth[_0x9742('0xa')](),controller['create']);router[_0x9742('0xc')](_0x9742('0xd'),auth[_0x9742('0xa')](),controller['addConditions']);router[_0x9742('0xc')](_0x9742('0xe'),auth[_0x9742('0xa')](),controller['addActions']);router[_0x9742('0xf')](_0x9742('0x8'),auth['isAuthenticated'](),controller[_0x9742('0x10')]);router[_0x9742('0x11')](_0x9742('0x8'),auth[_0x9742('0xa')](),controller[_0x9742('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x6e16=['addConditions','addActions','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create'];(function(_0x108273,_0x5e4e06){var _0x58bd50=function(_0x2333bb){while(--_0x2333bb){_0x108273['push'](_0x108273['shift']());}};_0x58bd50(++_0x5e4e06);}(_0x6e16,0x1d3));var _0x66e1=function(_0x518ac4,_0x30dd4b){_0x518ac4=_0x518ac4-0x0;var _0x5f0090=_0x6e16[_0x518ac4];return _0x5f0090;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x66e1('0x0'));var timeout=require('connect-timeout');var express=require(_0x66e1('0x1'));var router=express['Router']();var fs_extra=require(_0x66e1('0x2'));var auth=require(_0x66e1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x66e1('0x4'));var controller=require('./automation.controller');router[_0x66e1('0x5')]('/',auth[_0x66e1('0x6')](),controller[_0x66e1('0x7')]);router['get'](_0x66e1('0x8'),auth[_0x66e1('0x6')](),controller[_0x66e1('0x9')]);router[_0x66e1('0x5')](_0x66e1('0xa'),auth[_0x66e1('0x6')](),controller[_0x66e1('0xb')]);router[_0x66e1('0x5')](_0x66e1('0xc'),auth[_0x66e1('0x6')](),controller[_0x66e1('0xd')]);router[_0x66e1('0xe')]('/',auth[_0x66e1('0x6')](),controller[_0x66e1('0xf')]);router['post']('/:id/conditions',auth[_0x66e1('0x6')](),controller[_0x66e1('0x10')]);router[_0x66e1('0xe')]('/:id/actions',auth['isAuthenticated'](),controller[_0x66e1('0x11')]);router['put'](_0x66e1('0x8'),auth[_0x66e1('0x6')](),controller['update']);router[_0x66e1('0x12')](_0x66e1('0x8'),auth['isAuthenticated'](),controller[_0x66e1('0x13')]);module[_0x66e1('0x14')]=router;
\ No newline at end of file
index 965747c..519c633 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e8d=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x310bd9,_0x27690d){var _0x438c67=function(_0x7ce348){while(--_0x7ce348){_0x310bd9['push'](_0x310bd9['shift']());}};_0x438c67(++_0x27690d);}(_0x8e8d,0x1d7));var _0xd8e8=function(_0x29f9ea,_0x68785d){_0x29f9ea=_0x29f9ea-0x0;var _0xe1819d=_0x8e8d[_0x29f9ea];return _0xe1819d;};'use strict';var Sequelize=require('sequelize');module[_0xd8e8('0x0')]={'name':{'type':Sequelize[_0xd8e8('0x1')],'unique':_0xd8e8('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd8e8('0x3')](_0xd8e8('0x4')),'allowNull':![],'defaultValue':_0xd8e8('0x4')},'description':{'type':Sequelize[_0xd8e8('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd8e8('0x5')},'limitCalls':{'type':Sequelize[_0xd8e8('0x6')](0x4)[_0xd8e8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd8e8('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd8e8('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd8e8('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd8e8('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd8e8('0x1')],'defaultValue':_0xd8e8('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xd8e8('0x3')](_0xd8e8('0x10'),_0xd8e8('0x11'),_0xd8e8('0x12')),'defaultValue':_0xd8e8('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd8e8('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd8e8('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xd8e8('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd8e8('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd8e8('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd8e8('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd8e8('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd8e8('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd8e8('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd8e8('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd8e8('0x3')](_0xd8e8('0x1b'),'ASC'),'defaultValue':_0xd8e8('0x1b')},'dialPrefix':{'type':Sequelize[_0xd8e8('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xd8e8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd8e8('0x1c')},'dialCutDigit':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd8e8('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x25')}};
\ No newline at end of file
+var _0xd81e=['Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#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)'];(function(_0x246890,_0x46b964){var _0x2b2a5a=function(_0x4f1232){while(--_0x4f1232){_0x246890['push'](_0x246890['shift']());}};_0x2b2a5a(++_0x46b964);}(_0xd81e,0x7b));var _0xed81=function(_0x4898bc,_0x505bf0){_0x4898bc=_0x4898bc-0x0;var _0x5d95a8=_0xd81e[_0x4898bc];return _0x5d95a8;};'use strict';var Sequelize=require(_0xed81('0x0'));module['exports']={'name':{'type':Sequelize[_0xed81('0x1')],'unique':_0xed81('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xed81('0x3')](_0xed81('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xed81('0x5')],'defaultValue':0x0,'comment':_0xed81('0x6')},'limitCalls':{'type':Sequelize[_0xed81('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xed81('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xed81('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xed81('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed81('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed81('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xed81('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)[_0xed81('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed81('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xed81('0x7')](0x5)[_0xed81('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)[_0xed81('0x9')],'defaultValue':0x3,'comment':_0xed81('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xed81('0x7')](0x5)[_0xed81('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xed81('0x10')},'dialTimezone':{'type':Sequelize[_0xed81('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xed81('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xed81('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xed81('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xed81('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xed81('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xed81('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xed81('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xed81('0x7')](0x9)[_0xed81('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xed81('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xed81('0x7')](0x9)[_0xed81('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xed81('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xed81('0x7')](0x9)[_0xed81('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xed81('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xed81('0x7')](0x9)[_0xed81('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xed81('0x7')](0x5)[_0xed81('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xed81('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xed81('0x17')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xed81('0x18'),'ASC'),'defaultValue':_0xed81('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xed81('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xed81('0x19')},'dialCutDigit':{'type':Sequelize[_0xed81('0x7')](0x3)[_0xed81('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xed81('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xed81('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xed81('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xed81('0x7')](0x5)[_0xed81('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed81('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xed81('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)[_0xed81('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed81('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xed81('0x7')](0x5)[_0xed81('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)[_0xed81('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed81('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xed81('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0x22')}};
\ No newline at end of file
index ed7ad37..9f8003e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1e7=['key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','find','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','CmHopper','nolimit','CampaignId','filter','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','select','field','phone','NOW()','ContactId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','fieldName','type'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xd1e7,0x1ee));var _0x7d1e=function(_0x2fc9d4,_0x14719f){_0x2fc9d4=_0x2fc9d4-0x0;var _0x1eff4b=_0xd1e7[_0x2fc9d4];return _0x1eff4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d1e('0x0'));var zipdir=require(_0x7d1e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d1e('0x2'));var moment=require(_0x7d1e('0x3'));var BPromise=require(_0x7d1e('0x4'));var Mustache=require(_0x7d1e('0x5'));var util=require(_0x7d1e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7d1e('0x7'));var ejs=require(_0x7d1e('0x8'));var fs=require('fs');var fs_extra=require(_0x7d1e('0x9'));var _=require(_0x7d1e('0xa'));var squel=require(_0x7d1e('0xb'));var crypto=require(_0x7d1e('0xc'));var jsforce=require(_0x7d1e('0xd'));var deskjs=require(_0x7d1e('0xe'));var toCsv=require(_0x7d1e('0x7'));var querystring=require(_0x7d1e('0xf'));var Papa=require(_0x7d1e('0x10'));var Redis=require(_0x7d1e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7d1e('0x12'));var as=require(_0x7d1e('0x13'));var hardwareService=require(_0x7d1e('0x14'));var logger=require(_0x7d1e('0x15'))(_0x7d1e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d1e('0x17'));var db=require(_0x7d1e('0x18'))['db'];function respondWithStatusCode(_0x26a589,_0x31b8e6){_0x31b8e6=_0x31b8e6||0xcc;return function(_0x57776a){if(_0x57776a){return _0x26a589[_0x7d1e('0x19')](_0x31b8e6);}return _0x26a589[_0x7d1e('0x1a')](_0x31b8e6)['end']();};}function respondWithResult(_0xc7b55e,_0xf740c4){_0xf740c4=_0xf740c4||0xc8;return function(_0x4a9ea){if(_0x4a9ea){return _0xc7b55e['status'](_0xf740c4)[_0x7d1e('0x1b')](_0x4a9ea);}};}function respondWithFilteredResult(_0x4fb9c3,_0x1404ac){return function(_0x384a51){if(_0x384a51){var _0x1e9e77=typeof _0x1404ac['offset']===_0x7d1e('0x1c')&&typeof _0x1404ac['limit']==='undefined';var _0xcc0868=_0x384a51[_0x7d1e('0x1d')];var _0x1861a3=_0x1e9e77?0x0:_0x1404ac[_0x7d1e('0x1e')];var _0x14b044=_0x1e9e77?_0x384a51[_0x7d1e('0x1d')]:_0x1404ac[_0x7d1e('0x1e')]+_0x1404ac[_0x7d1e('0x1f')];var _0x518db8;if(_0x14b044>=_0xcc0868){_0x14b044=_0xcc0868;_0x518db8=0xc8;}else{_0x518db8=0xce;}_0x4fb9c3['status'](_0x518db8);return _0x4fb9c3[_0x7d1e('0x20')]('Content-Range',_0x1861a3+'-'+_0x14b044+'/'+_0xcc0868)['json'](_0x384a51);}return null;};}function patchUpdates(_0x25a691){return function(_0x2cb5ec){try{jsonpatch[_0x7d1e('0x21')](_0x2cb5ec,_0x25a691,!![]);}catch(_0xf065e){return BPromise[_0x7d1e('0x22')](_0xf065e);}return _0x2cb5ec[_0x7d1e('0x23')]();};}function saveUpdates(_0x189427,_0x1392ab){return function(_0x5aba8b){if(_0x5aba8b){return _0x5aba8b['update'](_0x189427)[_0x7d1e('0x24')](function(_0x33c9b1){return _0x33c9b1;});}return null;};}function removeEntity(_0x2c8836,_0x573f1a){return function(_0x4fbc16){if(_0x4fbc16){return _0x4fbc16[_0x7d1e('0x25')]()[_0x7d1e('0x24')](function(){var _0x3abf36=_0x4fbc16['get']({'plain':!![]});var _0x524c00=_0x7d1e('0x26');return db[_0x7d1e('0x27')][_0x7d1e('0x25')]({'where':{'type':_0x524c00,'resourceId':_0x3abf36['id']}})[_0x7d1e('0x24')](function(){return _0x4fbc16;});})[_0x7d1e('0x24')](function(){_0x2c8836[_0x7d1e('0x1a')](0xcc)[_0x7d1e('0x28')]();});}};}function handleEntityNotFound(_0xdfc49e,_0x3d0ecd){return function(_0x124037){if(!_0x124037){_0xdfc49e[_0x7d1e('0x19')](0x194);}return _0x124037;};}function handleError(_0x4cefde,_0x36b982){_0x36b982=_0x36b982||0x1f4;return function(_0x206779){logger[_0x7d1e('0x29')](_0x206779[_0x7d1e('0x2a')]);if(_0x206779['name']){delete _0x206779[_0x7d1e('0x2b')];}_0x4cefde[_0x7d1e('0x1a')](_0x36b982)[_0x7d1e('0x2c')](_0x206779);};}exports[_0x7d1e('0x2d')]=function(_0x2cf4dc,_0x2a5bb7){var _0x3f99b={},_0x51265e={},_0x2d7e03={'count':0x0,'rows':[]};var _0xb853ff=_[_0x7d1e('0x2e')](db[_0x7d1e('0x2f')]['rawAttributes'],function(_0xc9e0dc){return{'name':_0xc9e0dc[_0x7d1e('0x30')],'type':_0xc9e0dc[_0x7d1e('0x31')][_0x7d1e('0x32')]};});_0x51265e['model']=_[_0x7d1e('0x2e')](_0xb853ff,'name');_0x51265e[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x2cf4dc[_0x7d1e('0x33')]);_0x51265e[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x51265e[_0x7d1e('0x37')],_0x51265e[_0x7d1e('0x33')]);_0x3f99b['attributes']=_[_0x7d1e('0x36')](_0x51265e[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x2cf4dc[_0x7d1e('0x33')]['fields']));_0x3f99b[_0x7d1e('0x39')]=_0x3f99b[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x3f99b[_0x7d1e('0x39')]:_0x51265e[_0x7d1e('0x37')];if(!_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x3b')]('nolimit')){_0x3f99b[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x2cf4dc['query'][_0x7d1e('0x1f')]);_0x3f99b['offset']=qs['offset'](_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x3f99b[_0x7d1e('0x3c')]=qs['sort'](_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x3f99b['where']=qs[_0x7d1e('0x35')](_[_0x7d1e('0x3e')](_0x2cf4dc[_0x7d1e('0x33')],_0x51265e['filters']),_0xb853ff);if(_0x2cf4dc[_0x7d1e('0x33')]['filter']){_0x3f99b[_0x7d1e('0x3f')]=_[_0x7d1e('0x40')](_0x3f99b['where'],{'$or':_[_0x7d1e('0x2e')](_0xb853ff,function(_0x361aa0){if(_0x361aa0[_0x7d1e('0x31')]!=='VIRTUAL'){var _0x3e2f71={};_0x3e2f71[_0x361aa0[_0x7d1e('0x2b')]]={'$like':'%'+_0x2cf4dc[_0x7d1e('0x33')]['filter']+'%'};return _0x3e2f71;}})});}_0x3f99b=_[_0x7d1e('0x40')]({},_0x3f99b,_0x2cf4dc[_0x7d1e('0x41')]);var _0x135953={'where':_0x3f99b[_0x7d1e('0x3f')]};return db[_0x7d1e('0x2f')][_0x7d1e('0x1d')](_0x135953)['then'](function(_0x12c67d){_0x2d7e03[_0x7d1e('0x1d')]=_0x12c67d;if(_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x42')]){_0x3f99b[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x2f')][_0x7d1e('0x44')](_0x3f99b);})[_0x7d1e('0x24')](function(_0x823b3){_0x2d7e03[_0x7d1e('0x45')]=_0x823b3;return _0x2d7e03;})[_0x7d1e('0x24')](respondWithFilteredResult(_0x2a5bb7,_0x3f99b))[_0x7d1e('0x46')](handleError(_0x2a5bb7,null));};exports[_0x7d1e('0x47')]=function(_0xdde30f,_0x24eadc){var _0xcfe0d4={'raw':![],'where':{'id':_0xdde30f[_0x7d1e('0x48')]['id']}},_0x2bcf2e={};_0x2bcf2e[_0x7d1e('0x37')]=_['keys'](db['Campaign'][_0x7d1e('0x49')]);_0x2bcf2e[_0x7d1e('0x33')]=_['keys'](_0xdde30f['query']);_0x2bcf2e[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x2bcf2e[_0x7d1e('0x37')],_0x2bcf2e['query']);_0xcfe0d4['attributes']=_['intersection'](_0x2bcf2e[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0xdde30f['query'][_0x7d1e('0x38')]));_0xcfe0d4[_0x7d1e('0x39')]=_0xcfe0d4[_0x7d1e('0x39')]['length']?_0xcfe0d4[_0x7d1e('0x39')]:_0x2bcf2e['model'];if(_0xdde30f['query']['includeAll']){_0xcfe0d4[_0x7d1e('0x43')]=[{'all':!![]}];}_0xcfe0d4=_[_0x7d1e('0x40')]({},_0xcfe0d4,_0xdde30f[_0x7d1e('0x41')]);return db[_0x7d1e('0x2f')]['find'](_0xcfe0d4)[_0x7d1e('0x24')](handleEntityNotFound(_0x24eadc,null))[_0x7d1e('0x24')](respondWithResult(_0x24eadc,null))[_0x7d1e('0x46')](handleError(_0x24eadc,null));};exports['create']=function(_0xd256e5,_0x14f008){return db[_0x7d1e('0x2f')][_0x7d1e('0x4a')](_0xd256e5[_0x7d1e('0x4b')],{})['then'](function(_0x530214){var _0xf860ef=_0xd256e5[_0x7d1e('0x4c')][_0x7d1e('0x4d')]({'plain':!![]});if(!_0xf860ef)throw new Error(_0x7d1e('0x4e'));if(_0xf860ef[_0x7d1e('0x4f')]===_0x7d1e('0x4c')){var _0x34b641=_0x530214[_0x7d1e('0x4d')]({'plain':!![]});var _0x446b82=_0x7d1e('0x26');return db[_0x7d1e('0x50')]['find']({'where':{'name':_0x446b82,'userProfileId':_0xf860ef[_0x7d1e('0x51')]},'raw':!![]})[_0x7d1e('0x24')](function(_0x1bc8f6){if(_0x1bc8f6&&_0x1bc8f6[_0x7d1e('0x52')]===0x0){return db[_0x7d1e('0x27')]['create']({'name':_0x34b641[_0x7d1e('0x2b')],'resourceId':_0x34b641['id'],'type':_0x1bc8f6[_0x7d1e('0x2b')],'sectionId':_0x1bc8f6['id']},{})[_0x7d1e('0x24')](function(){return _0x530214;});}else{return _0x530214;}})[_0x7d1e('0x46')](function(_0x38690a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38690a);throw _0x38690a;});}return _0x530214;})[_0x7d1e('0x24')](respondWithResult(_0x14f008,0xc9))['catch'](handleError(_0x14f008,null));};exports[_0x7d1e('0x53')]=function(_0x3f9a68,_0x211867){var _0x233512={'where':{'id':_0x3f9a68[_0x7d1e('0x48')]['id']}},_0x4361ee={};_0x4361ee[_0x7d1e('0x37')]=_['keys'](db[_0x7d1e('0x2f')][_0x7d1e('0x49')]);_0x233512['attributes']=_[_0x7d1e('0x36')](_0x4361ee[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x3f9a68['query'][_0x7d1e('0x38')]));_0x233512[_0x7d1e('0x39')]=_0x233512[_0x7d1e('0x39')]['length']?_0x233512['attributes']:_0x4361ee[_0x7d1e('0x37')];if(_0x3f9a68[_0x7d1e('0x33')]['includeAll']){_0x233512[_0x7d1e('0x43')]=[{'all':!![]}];}_0x233512=_[_0x7d1e('0x40')]({},_0x233512,_0x3f9a68[_0x7d1e('0x41')]);return db[_0x7d1e('0x2f')][_0x7d1e('0x54')](_0x233512)[_0x7d1e('0x24')](handleEntityNotFound(_0x211867,null))['then'](function(_0x2fc02f){if(_0x2fc02f){var _0x42007c=_0x2fc02f[_0x7d1e('0x4d')]({'plain':!![]});_0x42007c=qs[_0x7d1e('0x55')](_0x42007c,['id',_0x7d1e('0x56'),_0x7d1e('0x57')]);_0x3f9a68[_0x7d1e('0x4b')]=_[_0x7d1e('0x55')](_0x3f9a68[_0x7d1e('0x4b')],['id','createdAt','updatedAt']);return db[_0x7d1e('0x2f')]['create'](_[_0x7d1e('0x40')](_0x42007c,_0x3f9a68[_0x7d1e('0x4b')]),{'include':_0x3f9a68[_0x7d1e('0x33')][_0x7d1e('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x4e45d3){var _0x1a9f18=_0x3f9a68[_0x7d1e('0x4c')][_0x7d1e('0x4d')]({'plain':!![]});if(!_0x1a9f18)throw new Error(_0x7d1e('0x4e'));if(_0x1a9f18[_0x7d1e('0x4f')]===_0x7d1e('0x4c')){var _0x3538e1=_0x4e45d3[_0x7d1e('0x4d')]({'plain':!![]});var _0x29b8e2=_0x7d1e('0x26');return db[_0x7d1e('0x50')][_0x7d1e('0x54')]({'where':{'name':_0x29b8e2,'userProfileId':_0x1a9f18[_0x7d1e('0x51')]},'raw':!![]})[_0x7d1e('0x24')](function(_0x2e993c){if(_0x2e993c&&_0x2e993c[_0x7d1e('0x52')]===0x0){return db[_0x7d1e('0x27')][_0x7d1e('0x4a')]({'name':_0x3538e1[_0x7d1e('0x2b')],'resourceId':_0x3538e1['id'],'type':_0x2e993c[_0x7d1e('0x2b')],'sectionId':_0x2e993c['id']},{})['then'](function(){return _0x4e45d3;});}else{return _0x4e45d3;}})['catch'](function(_0x5a1750){logger[_0x7d1e('0x29')](_0x7d1e('0x58'),_0x5a1750);throw _0x5a1750;});}return _0x4e45d3;});}})['then'](respondWithResult(_0x211867,0xc9))[_0x7d1e('0x46')](handleError(_0x211867,null));};exports[_0x7d1e('0x59')]=function(_0x1bddd8,_0x16b79c){if(_0x1bddd8[_0x7d1e('0x4b')]['id']){delete _0x1bddd8[_0x7d1e('0x4b')]['id'];}return db['Campaign'][_0x7d1e('0x54')]({'where':{'id':_0x1bddd8[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x16b79c,null))[_0x7d1e('0x24')](saveUpdates(_0x1bddd8[_0x7d1e('0x4b')],null))[_0x7d1e('0x24')](respondWithResult(_0x16b79c,null))[_0x7d1e('0x46')](handleError(_0x16b79c,null));};exports[_0x7d1e('0x25')]=function(_0x2e60cf,_0x9dbd6c){return db[_0x7d1e('0x2f')]['find']({'where':{'id':_0x2e60cf[_0x7d1e('0x48')]['id']}})['then'](handleEntityNotFound(_0x9dbd6c,null))[_0x7d1e('0x24')](removeEntity(_0x9dbd6c,null))['catch'](handleError(_0x9dbd6c,null));};exports[_0x7d1e('0x5a')]=function(_0x313e0a,_0x35c59b,_0x18ee9b){var _0x41a378={'raw':!![],'where':{}};var _0x117cb7={};var _0x1ade85={'count':0x0,'rows':[]};return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x313e0a['params']['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x35c59b,null))[_0x7d1e('0x24')](function(_0x5ec93c){if(_0x5ec93c){_0x117cb7['model']=_[_0x7d1e('0x34')](db[_0x7d1e('0x5c')]['rawAttributes']);_0x117cb7['query']=_[_0x7d1e('0x34')](_0x313e0a[_0x7d1e('0x33')]);_0x117cb7[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x117cb7[_0x7d1e('0x37')],_0x117cb7['query']);_0x41a378[_0x7d1e('0x39')]=_[_0x7d1e('0x36')](_0x117cb7[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x38')]));_0x41a378[_0x7d1e('0x39')]=_0x41a378[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x41a378['attributes']:_0x117cb7['model'];if(!_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x3b')](_0x7d1e('0x5d'))){_0x41a378[_0x7d1e('0x1f')]=qs['limit'](_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x1f')]);_0x41a378['offset']=qs[_0x7d1e('0x1e')](_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x41a378['order']=qs[_0x7d1e('0x3d')](_0x313e0a[_0x7d1e('0x33')]['sort']);_0x41a378[_0x7d1e('0x3f')]=qs[_0x7d1e('0x35')](_['pick'](_0x313e0a['query'],_0x117cb7['filters']));_0x41a378[_0x7d1e('0x3f')][_0x7d1e('0x5e')]=_0x5ec93c['id'];if(_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x41a378['where']=_[_0x7d1e('0x40')](_0x41a378[_0x7d1e('0x3f')],{'$or':_[_0x7d1e('0x2e')](_0x41a378['attributes'],function(_0xb04b39){var _0x4b7efd={};_0x4b7efd[_0xb04b39]={'$like':'%'+_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x4b7efd;})});}_0x41a378=_[_0x7d1e('0x40')]({},_0x41a378,_0x313e0a[_0x7d1e('0x41')]);return db['CmHopper'][_0x7d1e('0x1d')]({'where':_0x41a378[_0x7d1e('0x3f')]})['then'](function(_0xaa428a){_0x1ade85['count']=_0xaa428a;if(_0x313e0a[_0x7d1e('0x33')]['includeAll']){_0x41a378[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x5c')][_0x7d1e('0x44')](_0x41a378);})[_0x7d1e('0x24')](function(_0xbd0e6b){_0x1ade85[_0x7d1e('0x45')]=_0xbd0e6b;return _0x1ade85;});}})['then'](respondWithFilteredResult(_0x35c59b,_0x41a378))[_0x7d1e('0x46')](handleError(_0x35c59b,null));};exports[_0x7d1e('0x60')]=function(_0x569a9c,_0x184673,_0x2f3f61){var _0x5cf758={'raw':!![],'where':{}};var _0x433fcf={};var _0x3ac15a={'count':0x0,'rows':[]};return db[_0x7d1e('0x2f')][_0x7d1e('0x5b')]({'where':{'id':_0x569a9c['params']['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x184673,null))[_0x7d1e('0x24')](function(_0x4b4f9f){if(_0x4b4f9f){_0x433fcf[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x61')][_0x7d1e('0x49')]);_0x433fcf['query']=_[_0x7d1e('0x34')](_0x569a9c[_0x7d1e('0x33')]);_0x433fcf[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x433fcf[_0x7d1e('0x37')],_0x433fcf[_0x7d1e('0x33')]);_0x5cf758[_0x7d1e('0x39')]=_[_0x7d1e('0x36')](_0x433fcf[_0x7d1e('0x37')],qs['fields'](_0x569a9c[_0x7d1e('0x33')]['fields']));_0x5cf758[_0x7d1e('0x39')]=_0x5cf758[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x5cf758[_0x7d1e('0x39')]:_0x433fcf[_0x7d1e('0x37')];if(!_0x569a9c[_0x7d1e('0x33')][_0x7d1e('0x3b')]('nolimit')){_0x5cf758['limit']=qs[_0x7d1e('0x1f')](_0x569a9c['query']['limit']);_0x5cf758[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x569a9c['query']['offset']);}_0x5cf758[_0x7d1e('0x3c')]=qs[_0x7d1e('0x3d')](_0x569a9c['query']['sort']);_0x5cf758['where']=qs[_0x7d1e('0x35')](_['pick'](_0x569a9c[_0x7d1e('0x33')],_0x433fcf[_0x7d1e('0x35')]));_0x5cf758['where'][_0x7d1e('0x5e')]=_0x4b4f9f['id'];if(_0x569a9c[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x5cf758['where']=_[_0x7d1e('0x40')](_0x5cf758[_0x7d1e('0x3f')],{'$or':_['map'](_0x5cf758['attributes'],function(_0x34a290){var _0x52be4c={};_0x52be4c[_0x34a290]={'$like':'%'+_0x569a9c[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x52be4c;})});}_0x5cf758=_[_0x7d1e('0x40')]({},_0x5cf758,_0x569a9c[_0x7d1e('0x41')]);return db[_0x7d1e('0x61')][_0x7d1e('0x1d')]({'where':_0x5cf758['where']})['then'](function(_0x3afad2){_0x3ac15a[_0x7d1e('0x1d')]=_0x3afad2;if(_0x569a9c[_0x7d1e('0x33')]['includeAll']){_0x5cf758[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x61')][_0x7d1e('0x44')](_0x5cf758);})[_0x7d1e('0x24')](function(_0x14fab5){_0x3ac15a['rows']=_0x14fab5;return _0x3ac15a;});}})[_0x7d1e('0x24')](respondWithFilteredResult(_0x184673,_0x5cf758))[_0x7d1e('0x46')](handleError(_0x184673,null));};exports['getHopperFinals']=function(_0x2debfb,_0x37048c,_0x3d00c6){var _0x3e33d1={'raw':!![],'where':{}};var _0x8a138a={};var _0x50526a={'count':0x0,'rows':[]};return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x2debfb[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x37048c,null))[_0x7d1e('0x24')](function(_0x1e9e26){if(_0x1e9e26){_0x8a138a[_0x7d1e('0x37')]=_['keys'](db[_0x7d1e('0x62')][_0x7d1e('0x49')]);_0x8a138a[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x2debfb[_0x7d1e('0x33')]);_0x8a138a[_0x7d1e('0x35')]=_['intersection'](_0x8a138a[_0x7d1e('0x37')],_0x8a138a[_0x7d1e('0x33')]);_0x3e33d1['attributes']=_[_0x7d1e('0x36')](_0x8a138a[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x2debfb['query'][_0x7d1e('0x38')]));_0x3e33d1[_0x7d1e('0x39')]=_0x3e33d1[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x3e33d1[_0x7d1e('0x39')]:_0x8a138a[_0x7d1e('0x37')];if(!_0x2debfb[_0x7d1e('0x33')]['hasOwnProperty'](_0x7d1e('0x5d'))){_0x3e33d1[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x1f')]);_0x3e33d1[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x3e33d1[_0x7d1e('0x3c')]=qs['sort'](_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x3e33d1['where']=qs[_0x7d1e('0x35')](_[_0x7d1e('0x3e')](_0x2debfb['query'],_0x8a138a['filters']));_0x3e33d1['where']['CampaignId']=_0x1e9e26['id'];if(_0x2debfb[_0x7d1e('0x33')]['filter']){_0x3e33d1['where']=_[_0x7d1e('0x40')](_0x3e33d1[_0x7d1e('0x3f')],{'$or':_[_0x7d1e('0x2e')](_0x3e33d1['attributes'],function(_0x3f906d){var _0x5f3d3c={};_0x5f3d3c[_0x3f906d]={'$like':'%'+_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x5f3d3c;})});}_0x3e33d1=_[_0x7d1e('0x40')]({},_0x3e33d1,_0x2debfb['options']);return db['CmHopperFinal']['count']({'where':_0x3e33d1[_0x7d1e('0x3f')]})[_0x7d1e('0x24')](function(_0x48cbd3){_0x50526a[_0x7d1e('0x1d')]=_0x48cbd3;if(_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x42')]){_0x3e33d1['include']=[{'all':!![]}];}return db[_0x7d1e('0x62')][_0x7d1e('0x44')](_0x3e33d1);})[_0x7d1e('0x24')](function(_0x288e3b){_0x50526a[_0x7d1e('0x45')]=_0x288e3b;return _0x50526a;});}})['then'](respondWithFilteredResult(_0x37048c,_0x3e33d1))['catch'](handleError(_0x37048c,null));};exports['getHopperBlacks']=function(_0x3a771f,_0x2d15f4,_0x38ec66){var _0x4589b9={'raw':!![],'where':{}};var _0x16cb78={};var _0x9a1c77={'count':0x0,'rows':[]};return db[_0x7d1e('0x2f')][_0x7d1e('0x5b')]({'where':{'id':_0x3a771f[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x2d15f4,null))['then'](function(_0x58dadc){if(_0x58dadc){_0x16cb78[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x63')][_0x7d1e('0x49')]);_0x16cb78[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x3a771f['query']);_0x16cb78['filters']=_[_0x7d1e('0x36')](_0x16cb78[_0x7d1e('0x37')],_0x16cb78[_0x7d1e('0x33')]);_0x4589b9['attributes']=_['intersection'](_0x16cb78['model'],qs['fields'](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x38')]));_0x4589b9[_0x7d1e('0x39')]=_0x4589b9['attributes'][_0x7d1e('0x3a')]?_0x4589b9[_0x7d1e('0x39')]:_0x16cb78[_0x7d1e('0x37')];if(!_0x3a771f[_0x7d1e('0x33')]['hasOwnProperty']('nolimit')){_0x4589b9[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x1f')]);_0x4589b9[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x4589b9['order']=qs[_0x7d1e('0x3d')](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x4589b9[_0x7d1e('0x3f')]=qs['filters'](_[_0x7d1e('0x3e')](_0x3a771f[_0x7d1e('0x33')],_0x16cb78[_0x7d1e('0x35')]));_0x4589b9[_0x7d1e('0x3f')][_0x7d1e('0x5e')]=_0x58dadc['id'];if(_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x4589b9[_0x7d1e('0x3f')]=_[_0x7d1e('0x40')](_0x4589b9[_0x7d1e('0x3f')],{'$or':_[_0x7d1e('0x2e')](_0x4589b9[_0x7d1e('0x39')],function(_0x59e232){var _0x29f5fb={};_0x29f5fb[_0x59e232]={'$like':'%'+_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x29f5fb;})});}_0x4589b9=_[_0x7d1e('0x40')]({},_0x4589b9,_0x3a771f['options']);return db[_0x7d1e('0x63')]['count']({'where':_0x4589b9['where']})[_0x7d1e('0x24')](function(_0x540bb3){_0x9a1c77['count']=_0x540bb3;if(_0x3a771f['query'][_0x7d1e('0x42')]){_0x4589b9[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x63')]['findAll'](_0x4589b9);})['then'](function(_0x2a7146){_0x9a1c77[_0x7d1e('0x45')]=_0x2a7146;return _0x9a1c77;});}})[_0x7d1e('0x24')](respondWithFilteredResult(_0x2d15f4,_0x4589b9))[_0x7d1e('0x46')](handleError(_0x2d15f4,null));};exports['getLists']=function(_0x2ce351,_0x144c94,_0x17e73e){var _0x3a0ff1={};var _0x4318d6={};var _0x4a5ab7;var _0x47315b;return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x2ce351[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x144c94,null))[_0x7d1e('0x24')](function(_0x2a6f86){if(_0x2a6f86){_0x4a5ab7=_0x2a6f86;_0x4318d6[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x64')][_0x7d1e('0x49')]);_0x4318d6[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x2ce351[_0x7d1e('0x33')]);_0x4318d6[_0x7d1e('0x35')]=_['intersection'](_0x4318d6[_0x7d1e('0x37')],_0x4318d6[_0x7d1e('0x33')]);_0x3a0ff1[_0x7d1e('0x39')]=_[_0x7d1e('0x36')](_0x4318d6[_0x7d1e('0x37')],qs['fields'](_0x2ce351['query'][_0x7d1e('0x38')]));_0x3a0ff1['attributes']=_0x3a0ff1[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x3a0ff1[_0x7d1e('0x39')]:_0x4318d6[_0x7d1e('0x37')];_0x3a0ff1[_0x7d1e('0x3c')]=qs[_0x7d1e('0x3d')](_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x3a0ff1[_0x7d1e('0x3f')]=qs[_0x7d1e('0x35')](_[_0x7d1e('0x3e')](_0x2ce351[_0x7d1e('0x33')],_0x4318d6[_0x7d1e('0x35')]));if(_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x3a0ff1[_0x7d1e('0x3f')]=_[_0x7d1e('0x40')](_0x3a0ff1['where'],{'$or':_[_0x7d1e('0x2e')](_0x3a0ff1[_0x7d1e('0x39')],function(_0x53f99e){var _0x9a1d6c={};_0x9a1d6c[_0x53f99e]={'$like':'%'+_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x9a1d6c;})});}_0x3a0ff1=_[_0x7d1e('0x40')]({},_0x3a0ff1,_0x2ce351[_0x7d1e('0x41')]);return _0x4a5ab7['getLists'](_0x3a0ff1);}})['then'](function(_0x48972b){if(_0x48972b){_0x47315b=_0x48972b['length'];if(!_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x3b')](_0x7d1e('0x5d'))){_0x3a0ff1[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x2ce351['query'][_0x7d1e('0x1f')]);_0x3a0ff1[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}return _0x4a5ab7['getLists'](_0x3a0ff1);}})[_0x7d1e('0x24')](function(_0x21bb17){if(_0x21bb17){return _0x21bb17?{'count':_0x47315b,'rows':_0x21bb17}:null;}})['then'](respondWithResult(_0x144c94,null))['catch'](handleError(_0x144c94,null));};exports[_0x7d1e('0x65')]=function(_0x5dd05f,_0x13698a,_0x4f9e21){var _0x4e5f78,_0xca93fd;return db[_0x7d1e('0x2f')][_0x7d1e('0x54')]({'where':{'id':_0x5dd05f[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x13698a,null))[_0x7d1e('0x24')](function(_0x4da334){if(_0x4da334){_0xca93fd=_0x4da334;return _0x4da334['addLists'](_0x5dd05f[_0x7d1e('0x4b')][_0x7d1e('0x66')],_[_0x7d1e('0x55')](_0x5dd05f[_0x7d1e('0x4b')],['ids','id'])||{});}return null;})['spread'](function(_0x22eb67){var _0x23790f;_0x4e5f78=_0x22eb67||[];var _0x53153f=[];if(_0x22eb67){for(var _0x5793a7=0x0;_0x5793a7<_0x22eb67[_0x7d1e('0x3a')];_0x5793a7+=0x1){var _0x51ed2c=_0x22eb67[_0x5793a7][_0x7d1e('0x4d')]({'plain':!![]});_0xca93fd[_0x7d1e('0x67')]=_0x5dd05f[_0x7d1e('0x4b')][_0x7d1e('0x67')]?_0x5dd05f[_0x7d1e('0x4b')][_0x7d1e('0x67')]:_0xca93fd[_0x7d1e('0x67')];switch(_0xca93fd[_0x7d1e('0x67')]){case _0x7d1e('0x68'):_0x23790f=squel[_0x7d1e('0x69')]()[_0x7d1e('0x6a')](_0x7d1e('0x6b'))[_0x7d1e('0x6c')](['phone',_0x7d1e('0x6d'),'ContactId',_0x7d1e('0x6e'),_0x7d1e('0x5e'),'createdAt',_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x71'),'phone')[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x6d'))[_0x7d1e('0x70')]('id',_0x7d1e('0x73'))['field'](_0x51ed2c['CmListId'][_0x7d1e('0x74')](),_0x7d1e('0x6e'))['field'](_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')](),'CampaignId')[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x56'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x57'))[_0x7d1e('0x75')](_0x7d1e('0x76'))['where'](_0x7d1e('0x77'))[_0x7d1e('0x3f')](_0x7d1e('0x78'),_0x51ed2c[_0x7d1e('0x79')][_0x7d1e('0x74')]())['where'](_0x7d1e('0x7a'))['where'](_0x7d1e('0x7b'),squel['select']()[_0x7d1e('0x70')](_0x7d1e('0x7c'))[_0x7d1e('0x75')]('cm_hopper_final')['where'](_0x7d1e('0x7d'),_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')]()))[_0x7d1e('0x3f')](_0x7d1e('0x7b'),squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x7e'))['from'](_0x7d1e('0x6b'))[_0x7d1e('0x3f')](_0x7d1e('0x7d'),_0x5dd05f['params']['id'][_0x7d1e('0x74')]())))[_0x7d1e('0x74')]();break;case _0x7d1e('0x7f'):_0x23790f=squel[_0x7d1e('0x69')]()['into'](_0x7d1e('0x6b'))['fromQuery'](['phone',_0x7d1e('0x6d'),'ContactId','ListId','CampaignId','createdAt',_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')]('phone',_0x7d1e('0x71'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x6d'))[_0x7d1e('0x70')]('id',_0x7d1e('0x73'))[_0x7d1e('0x70')](_0x51ed2c[_0x7d1e('0x79')][_0x7d1e('0x74')](),_0x7d1e('0x6e'))[_0x7d1e('0x70')](_0x5dd05f[_0x7d1e('0x48')]['id']['toString'](),'CampaignId')[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x56'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x57'))[_0x7d1e('0x75')](_0x7d1e('0x76'))['where'](_0x7d1e('0x77'))['where'](_0x7d1e('0x78'),_0x51ed2c['CmListId']['toString']())['where'](_0x7d1e('0x7a'))['where'](_0x7d1e('0x7b'),squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x7e'))[_0x7d1e('0x75')]('cm_hopper')[_0x7d1e('0x3f')]('CampaignId\x20=\x20?',_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')]())))[_0x7d1e('0x74')]();break;default:_0x23790f=squel['insert']()[_0x7d1e('0x6a')](_0x7d1e('0x6b'))[_0x7d1e('0x6c')](['phone',_0x7d1e('0x6d'),'ContactId',_0x7d1e('0x6e'),_0x7d1e('0x5e'),_0x7d1e('0x56'),_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x71'),_0x7d1e('0x71'))[_0x7d1e('0x70')](_0x7d1e('0x72'),'scheduledAt')['field']('id','ContactId')[_0x7d1e('0x70')](_0x51ed2c[_0x7d1e('0x79')]['toString'](),_0x7d1e('0x6e'))['field'](_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')](),_0x7d1e('0x5e'))['field'](_0x7d1e('0x72'),_0x7d1e('0x56'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x57'))[_0x7d1e('0x75')](_0x7d1e('0x76'))[_0x7d1e('0x3f')](_0x7d1e('0x77'))['where']('ListId\x20=\x20?',_0x51ed2c[_0x7d1e('0x79')][_0x7d1e('0x74')]())[_0x7d1e('0x3f')](_0x7d1e('0x7a')))[_0x7d1e('0x74')]();}_0x53153f[_0x7d1e('0x80')](db[_0x7d1e('0x81')][_0x7d1e('0x33')](_0x23790f));}return BPromise[_0x7d1e('0x82')](_0x53153f);}})[_0x7d1e('0x24')](function(){return _0x4e5f78;})['then'](respondWithResult(_0x13698a,null))['catch'](handleError(_0x13698a,null));};exports[_0x7d1e('0x83')]=function(_0x59e013,_0x2d5b74,_0x90b4aa){return db[_0x7d1e('0x2f')]['find']({'where':{'id':_0x59e013[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x2d5b74,null))[_0x7d1e('0x24')](function(_0x3c6843){if(_0x3c6843){return _0x3c6843[_0x7d1e('0x83')](_0x59e013[_0x7d1e('0x33')][_0x7d1e('0x66')]);}})['then'](function(_0x5a13d3){if(_0x5a13d3){return db[_0x7d1e('0x5c')][_0x7d1e('0x25')]({'where':{'ListId':_0x59e013[_0x7d1e('0x33')][_0x7d1e('0x66')],'CampaignId':_0x59e013['params']['id']}})[_0x7d1e('0x24')](function(){return _0x5a13d3;});}})[_0x7d1e('0x24')](respondWithStatusCode(_0x2d5b74,null))[_0x7d1e('0x46')](handleError(_0x2d5b74,null));};exports[_0x7d1e('0x84')]=function(_0x4af5ae,_0x34ad7c,_0x376cf8){var _0x50a9a2={};var _0x16e020={};var _0x5cb468;var _0x2c5390;return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x4af5ae[_0x7d1e('0x48')]['id']}})['then'](handleEntityNotFound(_0x34ad7c,null))[_0x7d1e('0x24')](function(_0x2eda37){if(_0x2eda37){_0x5cb468=_0x2eda37;_0x16e020[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x64')][_0x7d1e('0x49')]);_0x16e020[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x4af5ae[_0x7d1e('0x33')]);_0x16e020['filters']=_[_0x7d1e('0x36')](_0x16e020[_0x7d1e('0x37')],_0x16e020[_0x7d1e('0x33')]);_0x50a9a2[_0x7d1e('0x39')]=_['intersection'](_0x16e020[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x38')]));_0x50a9a2[_0x7d1e('0x39')]=_0x50a9a2[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x50a9a2['attributes']:_0x16e020['model'];_0x50a9a2['order']=qs[_0x7d1e('0x3d')](_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x50a9a2[_0x7d1e('0x3f')]=qs['filters'](_[_0x7d1e('0x3e')](_0x4af5ae['query'],_0x16e020[_0x7d1e('0x35')]));if(_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x50a9a2[_0x7d1e('0x3f')]=_['merge'](_0x50a9a2['where'],{'$or':_[_0x7d1e('0x2e')](_0x50a9a2[_0x7d1e('0x39')],function(_0x3a0bef){var _0x2befa2={};_0x2befa2[_0x3a0bef]={'$like':'%'+_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x2befa2;})});}_0x50a9a2=_[_0x7d1e('0x40')]({},_0x50a9a2,_0x4af5ae[_0x7d1e('0x41')]);return _0x5cb468['getBlackLists'](_0x50a9a2);}})[_0x7d1e('0x24')](function(_0x800fc1){if(_0x800fc1){_0x2c5390=_0x800fc1['length'];if(!_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x3b')]('nolimit')){_0x50a9a2['limit']=qs[_0x7d1e('0x1f')](_0x4af5ae[_0x7d1e('0x33')]['limit']);_0x50a9a2[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x4af5ae['query'][_0x7d1e('0x1e')]);}return _0x5cb468[_0x7d1e('0x84')](_0x50a9a2);}})[_0x7d1e('0x24')](function(_0x69beec){if(_0x69beec){return _0x69beec?{'count':_0x2c5390,'rows':_0x69beec}:null;}})[_0x7d1e('0x24')](respondWithResult(_0x34ad7c,null))['catch'](handleError(_0x34ad7c,null));};exports[_0x7d1e('0x85')]=function(_0x572649,_0x444dc4,_0x1dfe2a){var _0x31387a,_0x47c79f;return db[_0x7d1e('0x2f')][_0x7d1e('0x54')]({'where':{'id':_0x572649[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x444dc4,null))[_0x7d1e('0x24')](function(_0x1d0937){if(_0x1d0937){_0x47c79f=_0x1d0937;return _0x1d0937[_0x7d1e('0x85')](_0x572649['body'][_0x7d1e('0x66')],_[_0x7d1e('0x55')](_0x572649[_0x7d1e('0x4b')],[_0x7d1e('0x66'),'id'])||{});}return null;})[_0x7d1e('0x86')](function(_0x22617e){var _0x4b966c;_0x31387a=_0x22617e||[];var _0x381c29=[];if(_0x22617e){for(var _0x2439d5=0x0;_0x2439d5<_0x22617e[_0x7d1e('0x3a')];_0x2439d5+=0x1){var _0x419536=_0x22617e[_0x2439d5]['get']({'plain':!![]});_0x4b966c=squel[_0x7d1e('0x69')]()[_0x7d1e('0x6a')]('cm_hopper_black')[_0x7d1e('0x6c')](['phone',_0x7d1e('0x73'),_0x7d1e('0x6e'),_0x7d1e('0x5e'),_0x7d1e('0x56'),_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')]('phone','phone')[_0x7d1e('0x70')]('id',_0x7d1e('0x73'))['field'](_0x419536['CmListId'][_0x7d1e('0x74')](),_0x7d1e('0x6e'))['field'](_0x572649[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')](),_0x7d1e('0x5e'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x56'))['field'](_0x7d1e('0x72'),_0x7d1e('0x57'))['from'](_0x7d1e('0x76'))[_0x7d1e('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0x7d1e('0x78'),_0x419536[_0x7d1e('0x79')][_0x7d1e('0x74')]())[_0x7d1e('0x3f')](_0x7d1e('0x7a')))['toString']();_0x381c29['push'](db['sequelize'][_0x7d1e('0x33')](_0x4b966c));}return BPromise['all'](_0x381c29);}})['then'](function(){return _0x31387a;})[_0x7d1e('0x24')](respondWithResult(_0x444dc4,null))['catch'](handleError(_0x444dc4,null));};exports[_0x7d1e('0x87')]=function(_0x12adc0,_0x5da1e5,_0x378ee2){return db['Campaign'][_0x7d1e('0x54')]({'where':{'id':_0x12adc0[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x5da1e5,null))[_0x7d1e('0x24')](function(_0x9ea85b){if(_0x9ea85b){return _0x9ea85b[_0x7d1e('0x87')](_0x12adc0[_0x7d1e('0x33')][_0x7d1e('0x66')]);}})['then'](function(_0x39f005){if(_0x39f005){return db[_0x7d1e('0x63')][_0x7d1e('0x25')]({'where':{'ListId':_0x12adc0[_0x7d1e('0x33')][_0x7d1e('0x66')],'CampaignId':_0x12adc0[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](function(){return _0x39f005;});}})['then'](respondWithStatusCode(_0x5da1e5,null))[_0x7d1e('0x46')](handleError(_0x5da1e5,null));};
\ No newline at end of file
+var _0x51da=['model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','CampaignId','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','Campaign','rawAttributes','type','key'];(function(_0x43e511,_0x4b75f3){var _0xe2988c=function(_0x331106){while(--_0x331106){_0x43e511['push'](_0x43e511['shift']());}};_0xe2988c(++_0x4b75f3);}(_0x51da,0x168));var _0xa51d=function(_0x502966,_0x7a71b5){_0x502966=_0x502966-0x0;var _0x82ed3a=_0x51da[_0x502966];return _0x82ed3a;};'use strict';var emlformat=require(_0xa51d('0x0'));var rimraf=require(_0xa51d('0x1'));var zipdir=require(_0xa51d('0x2'));var jsonpatch=require(_0xa51d('0x3'));var rp=require(_0xa51d('0x4'));var moment=require('moment');var BPromise=require(_0xa51d('0x5'));var Mustache=require(_0xa51d('0x6'));var util=require(_0xa51d('0x7'));var path=require(_0xa51d('0x8'));var sox=require(_0xa51d('0x9'));var csv=require(_0xa51d('0xa'));var ejs=require(_0xa51d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa51d('0xc'));var squel=require('squel');var crypto=require(_0xa51d('0xd'));var jsforce=require(_0xa51d('0xe'));var deskjs=require(_0xa51d('0xf'));var toCsv=require(_0xa51d('0xa'));var querystring=require(_0xa51d('0x10'));var Papa=require(_0xa51d('0x11'));var Redis=require(_0xa51d('0x12'));var authService=require(_0xa51d('0x13'));var qs=require(_0xa51d('0x14'));var as=require(_0xa51d('0x15'));var hardwareService=require(_0xa51d('0x16'));var logger=require(_0xa51d('0x17'))(_0xa51d('0x18'));var utils=require(_0xa51d('0x19'));var config=require(_0xa51d('0x1a'));var licenseUtil=require(_0xa51d('0x1b'));var db=require(_0xa51d('0x1c'))['db'];function respondWithStatusCode(_0x53cb4e,_0x1539c6){_0x1539c6=_0x1539c6||0xcc;return function(_0x1db86f){if(_0x1db86f){return _0x53cb4e['sendStatus'](_0x1539c6);}return _0x53cb4e[_0xa51d('0x1d')](_0x1539c6)[_0xa51d('0x1e')]();};}function respondWithResult(_0x229996,_0x122be5){_0x122be5=_0x122be5||0xc8;return function(_0x1c8cd9){if(_0x1c8cd9){return _0x229996[_0xa51d('0x1d')](_0x122be5)[_0xa51d('0x1f')](_0x1c8cd9);}};}function respondWithFilteredResult(_0x262503,_0x36cc62){return function(_0x273103){if(_0x273103){var _0x1ca2f5=typeof _0x36cc62[_0xa51d('0x20')]===_0xa51d('0x21')&&typeof _0x36cc62[_0xa51d('0x22')]===_0xa51d('0x21');var _0x441d3e=_0x273103[_0xa51d('0x23')];var _0x22df22=_0x1ca2f5?0x0:_0x36cc62[_0xa51d('0x20')];var _0x576d4c=_0x1ca2f5?_0x273103[_0xa51d('0x23')]:_0x36cc62[_0xa51d('0x20')]+_0x36cc62[_0xa51d('0x22')];var _0x411921;if(_0x576d4c>=_0x441d3e){_0x576d4c=_0x441d3e;_0x411921=0xc8;}else{_0x411921=0xce;}_0x262503[_0xa51d('0x1d')](_0x411921);return _0x262503['set'](_0xa51d('0x24'),_0x22df22+'-'+_0x576d4c+'/'+_0x441d3e)[_0xa51d('0x1f')](_0x273103);}return null;};}function patchUpdates(_0x48bb9c){return function(_0x4acd99){try{jsonpatch['apply'](_0x4acd99,_0x48bb9c,!![]);}catch(_0x287b09){return BPromise[_0xa51d('0x25')](_0x287b09);}return _0x4acd99['save']();};}function saveUpdates(_0x53615a,_0x138eea){return function(_0x17c65c){if(_0x17c65c){return _0x17c65c[_0xa51d('0x26')](_0x53615a)[_0xa51d('0x27')](function(_0x2a8fde){return _0x2a8fde;});}return null;};}function removeEntity(_0x23c8a2,_0x2364ae){return function(_0xb59307){if(_0xb59307){return _0xb59307['destroy']()['then'](function(){var _0x411362=_0xb59307[_0xa51d('0x28')]({'plain':!![]});var _0x33c23b=_0xa51d('0x29');return db[_0xa51d('0x2a')][_0xa51d('0x2b')]({'where':{'type':_0x33c23b,'resourceId':_0x411362['id']}})[_0xa51d('0x27')](function(){return _0xb59307;});})[_0xa51d('0x27')](function(){_0x23c8a2[_0xa51d('0x1d')](0xcc)[_0xa51d('0x1e')]();});}};}function handleEntityNotFound(_0x8c7ed5,_0x8015ac){return function(_0x28c1a3){if(!_0x28c1a3){_0x8c7ed5[_0xa51d('0x2c')](0x194);}return _0x28c1a3;};}function handleError(_0x8da04,_0x1abda7){_0x1abda7=_0x1abda7||0x1f4;return function(_0x1f9fa2){logger['error'](_0x1f9fa2[_0xa51d('0x2d')]);if(_0x1f9fa2[_0xa51d('0x2e')]){delete _0x1f9fa2[_0xa51d('0x2e')];}_0x8da04[_0xa51d('0x1d')](_0x1abda7)[_0xa51d('0x2f')](_0x1f9fa2);};}exports[_0xa51d('0x30')]=function(_0x359f8c,_0x33f620){var _0x27ed59={},_0x1a7c5c={},_0x2f5aac={'count':0x0,'rows':[]};var _0x1e9dcb=_[_0xa51d('0x31')](db[_0xa51d('0x32')][_0xa51d('0x33')],function(_0x1888f5){return{'name':_0x1888f5['fieldName'],'type':_0x1888f5[_0xa51d('0x34')][_0xa51d('0x35')]};});_0x1a7c5c[_0xa51d('0x36')]=_[_0xa51d('0x31')](_0x1e9dcb,_0xa51d('0x2e'));_0x1a7c5c[_0xa51d('0x37')]=_['keys'](_0x359f8c[_0xa51d('0x37')]);_0x1a7c5c[_0xa51d('0x38')]=_[_0xa51d('0x39')](_0x1a7c5c[_0xa51d('0x36')],_0x1a7c5c[_0xa51d('0x37')]);_0x27ed59[_0xa51d('0x3a')]=_[_0xa51d('0x39')](_0x1a7c5c[_0xa51d('0x36')],qs['fields'](_0x359f8c[_0xa51d('0x37')]['fields']));_0x27ed59[_0xa51d('0x3a')]=_0x27ed59[_0xa51d('0x3a')][_0xa51d('0x3b')]?_0x27ed59[_0xa51d('0x3a')]:_0x1a7c5c[_0xa51d('0x36')];if(!_0x359f8c[_0xa51d('0x37')][_0xa51d('0x3c')]('nolimit')){_0x27ed59['limit']=qs[_0xa51d('0x22')](_0x359f8c[_0xa51d('0x37')][_0xa51d('0x22')]);_0x27ed59[_0xa51d('0x20')]=qs['offset'](_0x359f8c[_0xa51d('0x37')][_0xa51d('0x20')]);}_0x27ed59[_0xa51d('0x3d')]=qs[_0xa51d('0x3e')](_0x359f8c[_0xa51d('0x37')][_0xa51d('0x3e')]);_0x27ed59[_0xa51d('0x3f')]=qs['filters'](_[_0xa51d('0x40')](_0x359f8c[_0xa51d('0x37')],_0x1a7c5c['filters']),_0x1e9dcb);if(_0x359f8c[_0xa51d('0x37')][_0xa51d('0x41')]){_0x27ed59[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0x27ed59['where'],{'$or':_[_0xa51d('0x31')](_0x1e9dcb,function(_0x19eeeb){if(_0x19eeeb[_0xa51d('0x34')]!=='VIRTUAL'){var _0x17f27a={};_0x17f27a[_0x19eeeb[_0xa51d('0x2e')]]={'$like':'%'+_0x359f8c[_0xa51d('0x37')][_0xa51d('0x41')]+'%'};return _0x17f27a;}})});}_0x27ed59=_[_0xa51d('0x42')]({},_0x27ed59,_0x359f8c[_0xa51d('0x43')]);var _0x4f24b3={'where':_0x27ed59[_0xa51d('0x3f')]};return db['Campaign'][_0xa51d('0x23')](_0x4f24b3)['then'](function(_0x1c6b88){_0x2f5aac[_0xa51d('0x23')]=_0x1c6b88;if(_0x359f8c[_0xa51d('0x37')][_0xa51d('0x44')]){_0x27ed59[_0xa51d('0x45')]=[{'all':!![]}];}return db['Campaign'][_0xa51d('0x46')](_0x27ed59);})[_0xa51d('0x27')](function(_0x305f1b){_0x2f5aac[_0xa51d('0x47')]=_0x305f1b;return _0x2f5aac;})[_0xa51d('0x27')](respondWithFilteredResult(_0x33f620,_0x27ed59))[_0xa51d('0x48')](handleError(_0x33f620,null));};exports[_0xa51d('0x49')]=function(_0x23b504,_0x9b788){var _0x46665b={'raw':![],'where':{'id':_0x23b504[_0xa51d('0x4a')]['id']}},_0x390251={};_0x390251[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db[_0xa51d('0x32')][_0xa51d('0x33')]);_0x390251[_0xa51d('0x37')]=_[_0xa51d('0x4b')](_0x23b504['query']);_0x390251[_0xa51d('0x38')]=_[_0xa51d('0x39')](_0x390251['model'],_0x390251[_0xa51d('0x37')]);_0x46665b[_0xa51d('0x3a')]=_[_0xa51d('0x39')](_0x390251[_0xa51d('0x36')],qs[_0xa51d('0x4c')](_0x23b504[_0xa51d('0x37')]['fields']));_0x46665b[_0xa51d('0x3a')]=_0x46665b[_0xa51d('0x3a')]['length']?_0x46665b['attributes']:_0x390251[_0xa51d('0x36')];if(_0x23b504[_0xa51d('0x37')][_0xa51d('0x44')]){_0x46665b[_0xa51d('0x45')]=[{'all':!![]}];}_0x46665b=_[_0xa51d('0x42')]({},_0x46665b,_0x23b504['options']);return db[_0xa51d('0x32')]['find'](_0x46665b)[_0xa51d('0x27')](handleEntityNotFound(_0x9b788,null))[_0xa51d('0x27')](respondWithResult(_0x9b788,null))[_0xa51d('0x48')](handleError(_0x9b788,null));};exports[_0xa51d('0x4d')]=function(_0x1c90c7,_0xf14a4b){return db['Campaign'][_0xa51d('0x4d')](_0x1c90c7[_0xa51d('0x4e')],{})[_0xa51d('0x27')](function(_0x1e53cc){var _0x59d8a8=_0x1c90c7[_0xa51d('0x4f')]['get']({'plain':!![]});if(!_0x59d8a8)throw new Error(_0xa51d('0x50'));if(_0x59d8a8[_0xa51d('0x51')]===_0xa51d('0x4f')){var _0x1d2527=_0x1e53cc[_0xa51d('0x28')]({'plain':!![]});var _0x11d8e1=_0xa51d('0x29');return db[_0xa51d('0x52')][_0xa51d('0x53')]({'where':{'name':_0x11d8e1,'userProfileId':_0x59d8a8[_0xa51d('0x54')]},'raw':!![]})['then'](function(_0x3e423b){if(_0x3e423b&&_0x3e423b['autoAssociation']===0x0){return db['UserProfileResource'][_0xa51d('0x4d')]({'name':_0x1d2527[_0xa51d('0x2e')],'resourceId':_0x1d2527['id'],'type':_0x3e423b['name'],'sectionId':_0x3e423b['id']},{})[_0xa51d('0x27')](function(){return _0x1e53cc;});}else{return _0x1e53cc;}})[_0xa51d('0x48')](function(_0x1d0da7){logger[_0xa51d('0x55')](_0xa51d('0x56'),_0x1d0da7);throw _0x1d0da7;});}return _0x1e53cc;})[_0xa51d('0x27')](respondWithResult(_0xf14a4b,0xc9))[_0xa51d('0x48')](handleError(_0xf14a4b,null));};exports['clone']=function(_0x386ab6,_0x282ead){var _0x373aee={'where':{'id':_0x386ab6['params']['id']}},_0x156f59={};_0x156f59[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db[_0xa51d('0x32')]['rawAttributes']);_0x373aee[_0xa51d('0x3a')]=_['intersection'](_0x156f59[_0xa51d('0x36')],qs[_0xa51d('0x4c')](_0x386ab6[_0xa51d('0x37')][_0xa51d('0x4c')]));_0x373aee[_0xa51d('0x3a')]=_0x373aee[_0xa51d('0x3a')][_0xa51d('0x3b')]?_0x373aee[_0xa51d('0x3a')]:_0x156f59['model'];if(_0x386ab6[_0xa51d('0x37')][_0xa51d('0x44')]){_0x373aee[_0xa51d('0x45')]=[{'all':!![]}];}_0x373aee=_['merge']({},_0x373aee,_0x386ab6['options']);return db[_0xa51d('0x32')][_0xa51d('0x53')](_0x373aee)[_0xa51d('0x27')](handleEntityNotFound(_0x282ead,null))[_0xa51d('0x27')](function(_0x1f6a8b){if(_0x1f6a8b){var _0x359046=_0x1f6a8b[_0xa51d('0x28')]({'plain':!![]});_0x359046=qs[_0xa51d('0x57')](_0x359046,['id',_0xa51d('0x58'),_0xa51d('0x59')]);_0x386ab6[_0xa51d('0x4e')]=_['omit'](_0x386ab6[_0xa51d('0x4e')],['id',_0xa51d('0x58'),_0xa51d('0x59')]);return db[_0xa51d('0x32')]['create'](_[_0xa51d('0x42')](_0x359046,_0x386ab6[_0xa51d('0x4e')]),{'include':_0x386ab6[_0xa51d('0x37')][_0xa51d('0x44')]?[{'all':!![]}]:undefined})[_0xa51d('0x27')](function(_0x3d53a6){var _0x52bb04=_0x386ab6['user'][_0xa51d('0x28')]({'plain':!![]});if(!_0x52bb04)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52bb04[_0xa51d('0x51')]===_0xa51d('0x4f')){var _0x2b0016=_0x3d53a6[_0xa51d('0x28')]({'plain':!![]});var _0x38de46=_0xa51d('0x29');return db[_0xa51d('0x52')][_0xa51d('0x53')]({'where':{'name':_0x38de46,'userProfileId':_0x52bb04[_0xa51d('0x54')]},'raw':!![]})[_0xa51d('0x27')](function(_0x83a955){if(_0x83a955&&_0x83a955['autoAssociation']===0x0){return db[_0xa51d('0x2a')][_0xa51d('0x4d')]({'name':_0x2b0016['name'],'resourceId':_0x2b0016['id'],'type':_0x83a955[_0xa51d('0x2e')],'sectionId':_0x83a955['id']},{})[_0xa51d('0x27')](function(){return _0x3d53a6;});}else{return _0x3d53a6;}})[_0xa51d('0x48')](function(_0x28dd89){logger[_0xa51d('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28dd89);throw _0x28dd89;});}return _0x3d53a6;});}})[_0xa51d('0x27')](respondWithResult(_0x282ead,0xc9))[_0xa51d('0x48')](handleError(_0x282ead,null));};exports[_0xa51d('0x26')]=function(_0x109069,_0x1d0724){if(_0x109069[_0xa51d('0x4e')]['id']){delete _0x109069[_0xa51d('0x4e')]['id'];}return db[_0xa51d('0x32')]['find']({'where':{'id':_0x109069[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x1d0724,null))[_0xa51d('0x27')](saveUpdates(_0x109069[_0xa51d('0x4e')],null))[_0xa51d('0x27')](respondWithResult(_0x1d0724,null))[_0xa51d('0x48')](handleError(_0x1d0724,null));};exports[_0xa51d('0x2b')]=function(_0x34e2bf,_0x45b2ac){return db[_0xa51d('0x32')][_0xa51d('0x53')]({'where':{'id':_0x34e2bf[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x45b2ac,null))[_0xa51d('0x27')](removeEntity(_0x45b2ac,null))['catch'](handleError(_0x45b2ac,null));};exports[_0xa51d('0x5a')]=function(_0x5f13cb,_0x31139a,_0x53ee92){var _0x4f1d2f={'raw':!![],'where':{}};var _0x3c566e={};var _0x3c15a5={'count':0x0,'rows':[]};return db[_0xa51d('0x32')][_0xa51d('0x5b')]({'where':{'id':_0x5f13cb[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x31139a,null))['then'](function(_0x4a28c3){if(_0x4a28c3){_0x3c566e[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db['CmHopper'][_0xa51d('0x33')]);_0x3c566e[_0xa51d('0x37')]=_[_0xa51d('0x4b')](_0x5f13cb[_0xa51d('0x37')]);_0x3c566e['filters']=_[_0xa51d('0x39')](_0x3c566e[_0xa51d('0x36')],_0x3c566e[_0xa51d('0x37')]);_0x4f1d2f[_0xa51d('0x3a')]=_[_0xa51d('0x39')](_0x3c566e[_0xa51d('0x36')],qs[_0xa51d('0x4c')](_0x5f13cb[_0xa51d('0x37')][_0xa51d('0x4c')]));_0x4f1d2f[_0xa51d('0x3a')]=_0x4f1d2f['attributes'][_0xa51d('0x3b')]?_0x4f1d2f['attributes']:_0x3c566e['model'];if(!_0x5f13cb[_0xa51d('0x37')]['hasOwnProperty']('nolimit')){_0x4f1d2f[_0xa51d('0x22')]=qs[_0xa51d('0x22')](_0x5f13cb[_0xa51d('0x37')]['limit']);_0x4f1d2f[_0xa51d('0x20')]=qs[_0xa51d('0x20')](_0x5f13cb['query']['offset']);}_0x4f1d2f[_0xa51d('0x3d')]=qs['sort'](_0x5f13cb[_0xa51d('0x37')][_0xa51d('0x3e')]);_0x4f1d2f[_0xa51d('0x3f')]=qs[_0xa51d('0x38')](_[_0xa51d('0x40')](_0x5f13cb[_0xa51d('0x37')],_0x3c566e[_0xa51d('0x38')]));_0x4f1d2f[_0xa51d('0x3f')]['CampaignId']=_0x4a28c3['id'];if(_0x5f13cb[_0xa51d('0x37')][_0xa51d('0x41')]){_0x4f1d2f[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0x4f1d2f['where'],{'$or':_['map'](_0x4f1d2f[_0xa51d('0x3a')],function(_0x20c96d){var _0x1fadaf={};_0x1fadaf[_0x20c96d]={'$like':'%'+_0x5f13cb[_0xa51d('0x37')]['filter']+'%'};return _0x1fadaf;})});}_0x4f1d2f=_[_0xa51d('0x42')]({},_0x4f1d2f,_0x5f13cb[_0xa51d('0x43')]);return db['CmHopper'][_0xa51d('0x23')]({'where':_0x4f1d2f['where']})['then'](function(_0x52c02b){_0x3c15a5['count']=_0x52c02b;if(_0x5f13cb[_0xa51d('0x37')]['includeAll']){_0x4f1d2f['include']=[{'all':!![]}];}return db[_0xa51d('0x5c')][_0xa51d('0x46')](_0x4f1d2f);})[_0xa51d('0x27')](function(_0x2084d8){_0x3c15a5['rows']=_0x2084d8;return _0x3c15a5;});}})[_0xa51d('0x27')](respondWithFilteredResult(_0x31139a,_0x4f1d2f))['catch'](handleError(_0x31139a,null));};exports[_0xa51d('0x5d')]=function(_0x18fcf0,_0x919d9b,_0x6e8840){var _0x16df62={'raw':!![],'where':{}};var _0x5adcab={};var _0x1981af={'count':0x0,'rows':[]};return db[_0xa51d('0x32')][_0xa51d('0x5b')]({'where':{'id':_0x18fcf0[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x919d9b,null))[_0xa51d('0x27')](function(_0x199280){if(_0x199280){_0x5adcab[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db[_0xa51d('0x5e')][_0xa51d('0x33')]);_0x5adcab[_0xa51d('0x37')]=_[_0xa51d('0x4b')](_0x18fcf0['query']);_0x5adcab[_0xa51d('0x38')]=_[_0xa51d('0x39')](_0x5adcab[_0xa51d('0x36')],_0x5adcab['query']);_0x16df62['attributes']=_[_0xa51d('0x39')](_0x5adcab['model'],qs[_0xa51d('0x4c')](_0x18fcf0['query'][_0xa51d('0x4c')]));_0x16df62[_0xa51d('0x3a')]=_0x16df62[_0xa51d('0x3a')][_0xa51d('0x3b')]?_0x16df62[_0xa51d('0x3a')]:_0x5adcab[_0xa51d('0x36')];if(!_0x18fcf0['query']['hasOwnProperty'](_0xa51d('0x5f'))){_0x16df62[_0xa51d('0x22')]=qs[_0xa51d('0x22')](_0x18fcf0[_0xa51d('0x37')]['limit']);_0x16df62[_0xa51d('0x20')]=qs[_0xa51d('0x20')](_0x18fcf0[_0xa51d('0x37')][_0xa51d('0x20')]);}_0x16df62[_0xa51d('0x3d')]=qs['sort'](_0x18fcf0['query']['sort']);_0x16df62[_0xa51d('0x3f')]=qs[_0xa51d('0x38')](_[_0xa51d('0x40')](_0x18fcf0[_0xa51d('0x37')],_0x5adcab[_0xa51d('0x38')]));_0x16df62[_0xa51d('0x3f')]['CampaignId']=_0x199280['id'];if(_0x18fcf0[_0xa51d('0x37')]['filter']){_0x16df62[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0x16df62[_0xa51d('0x3f')],{'$or':_[_0xa51d('0x31')](_0x16df62[_0xa51d('0x3a')],function(_0x4dfcce){var _0x168083={};_0x168083[_0x4dfcce]={'$like':'%'+_0x18fcf0[_0xa51d('0x37')][_0xa51d('0x41')]+'%'};return _0x168083;})});}_0x16df62=_[_0xa51d('0x42')]({},_0x16df62,_0x18fcf0[_0xa51d('0x43')]);return db['CmHopperHistory'][_0xa51d('0x23')]({'where':_0x16df62['where']})['then'](function(_0x5d09c3){_0x1981af[_0xa51d('0x23')]=_0x5d09c3;if(_0x18fcf0[_0xa51d('0x37')][_0xa51d('0x44')]){_0x16df62[_0xa51d('0x45')]=[{'all':!![]}];}return db[_0xa51d('0x5e')]['findAll'](_0x16df62);})[_0xa51d('0x27')](function(_0x274a0b){_0x1981af[_0xa51d('0x47')]=_0x274a0b;return _0x1981af;});}})[_0xa51d('0x27')](respondWithFilteredResult(_0x919d9b,_0x16df62))[_0xa51d('0x48')](handleError(_0x919d9b,null));};exports[_0xa51d('0x60')]=function(_0x12e279,_0x496be2,_0x55c8cb){var _0xdb8728={'raw':!![],'where':{}};var _0x29ef97={};var _0x30691e={'count':0x0,'rows':[]};return db[_0xa51d('0x32')][_0xa51d('0x5b')]({'where':{'id':_0x12e279[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x496be2,null))['then'](function(_0x19cd13){if(_0x19cd13){_0x29ef97[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db[_0xa51d('0x61')][_0xa51d('0x33')]);_0x29ef97['query']=_[_0xa51d('0x4b')](_0x12e279[_0xa51d('0x37')]);_0x29ef97[_0xa51d('0x38')]=_[_0xa51d('0x39')](_0x29ef97[_0xa51d('0x36')],_0x29ef97['query']);_0xdb8728['attributes']=_[_0xa51d('0x39')](_0x29ef97[_0xa51d('0x36')],qs[_0xa51d('0x4c')](_0x12e279[_0xa51d('0x37')][_0xa51d('0x4c')]));_0xdb8728['attributes']=_0xdb8728[_0xa51d('0x3a')][_0xa51d('0x3b')]?_0xdb8728[_0xa51d('0x3a')]:_0x29ef97['model'];if(!_0x12e279[_0xa51d('0x37')][_0xa51d('0x3c')](_0xa51d('0x5f'))){_0xdb8728[_0xa51d('0x22')]=qs['limit'](_0x12e279['query'][_0xa51d('0x22')]);_0xdb8728[_0xa51d('0x20')]=qs['offset'](_0x12e279['query'][_0xa51d('0x20')]);}_0xdb8728[_0xa51d('0x3d')]=qs['sort'](_0x12e279['query'][_0xa51d('0x3e')]);_0xdb8728['where']=qs[_0xa51d('0x38')](_[_0xa51d('0x40')](_0x12e279[_0xa51d('0x37')],_0x29ef97['filters']));_0xdb8728[_0xa51d('0x3f')][_0xa51d('0x62')]=_0x19cd13['id'];if(_0x12e279[_0xa51d('0x37')][_0xa51d('0x41')]){_0xdb8728[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0xdb8728[_0xa51d('0x3f')],{'$or':_['map'](_0xdb8728[_0xa51d('0x3a')],function(_0x2fdb63){var _0x353ceb={};_0x353ceb[_0x2fdb63]={'$like':'%'+_0x12e279[_0xa51d('0x37')]['filter']+'%'};return _0x353ceb;})});}_0xdb8728=_['merge']({},_0xdb8728,_0x12e279[_0xa51d('0x43')]);return db[_0xa51d('0x61')][_0xa51d('0x23')]({'where':_0xdb8728['where']})[_0xa51d('0x27')](function(_0x277d86){_0x30691e['count']=_0x277d86;if(_0x12e279[_0xa51d('0x37')][_0xa51d('0x44')]){_0xdb8728[_0xa51d('0x45')]=[{'all':!![]}];}return db[_0xa51d('0x61')][_0xa51d('0x46')](_0xdb8728);})[_0xa51d('0x27')](function(_0x12dcb0){_0x30691e[_0xa51d('0x47')]=_0x12dcb0;return _0x30691e;});}})[_0xa51d('0x27')](respondWithFilteredResult(_0x496be2,_0xdb8728))[_0xa51d('0x48')](handleError(_0x496be2,null));};exports['getHopperBlacks']=function(_0x494d7b,_0x2d57eb,_0x7d7d2d){var _0x1f8233={'raw':!![],'where':{}};var _0x11f928={};var _0x1746f7={'count':0x0,'rows':[]};return db[_0xa51d('0x32')]['findOne']({'where':{'id':_0x494d7b['params']['id']}})['then'](handleEntityNotFound(_0x2d57eb,null))[_0xa51d('0x27')](function(_0x47b702){if(_0x47b702){_0x11f928['model']=_['keys'](db[_0xa51d('0x63')][_0xa51d('0x33')]);_0x11f928['query']=_[_0xa51d('0x4b')](_0x494d7b[_0xa51d('0x37')]);_0x11f928[_0xa51d('0x38')]=_['intersection'](_0x11f928[_0xa51d('0x36')],_0x11f928['query']);_0x1f8233[_0xa51d('0x3a')]=_[_0xa51d('0x39')](_0x11f928[_0xa51d('0x36')],qs[_0xa51d('0x4c')](_0x494d7b[_0xa51d('0x37')]['fields']));_0x1f8233[_0xa51d('0x3a')]=_0x1f8233[_0xa51d('0x3a')]['length']?_0x1f8233['attributes']:_0x11f928['model'];if(!_0x494d7b['query'][_0xa51d('0x3c')](_0xa51d('0x5f'))){_0x1f8233[_0xa51d('0x22')]=qs[_0xa51d('0x22')](_0x494d7b['query'][_0xa51d('0x22')]);_0x1f8233[_0xa51d('0x20')]=qs[_0xa51d('0x20')](_0x494d7b[_0xa51d('0x37')][_0xa51d('0x20')]);}_0x1f8233[_0xa51d('0x3d')]=qs[_0xa51d('0x3e')](_0x494d7b[_0xa51d('0x37')][_0xa51d('0x3e')]);_0x1f8233[_0xa51d('0x3f')]=qs[_0xa51d('0x38')](_[_0xa51d('0x40')](_0x494d7b[_0xa51d('0x37')],_0x11f928[_0xa51d('0x38')]));_0x1f8233['where']['CampaignId']=_0x47b702['id'];if(_0x494d7b[_0xa51d('0x37')][_0xa51d('0x41')]){_0x1f8233[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0x1f8233['where'],{'$or':_[_0xa51d('0x31')](_0x1f8233[_0xa51d('0x3a')],function(_0x336dea){var _0x57f0ad={};_0x57f0ad[_0x336dea]={'$like':'%'+_0x494d7b[_0xa51d('0x37')][_0xa51d('0x41')]+'%'};return _0x57f0ad;})});}_0x1f8233=_['merge']({},_0x1f8233,_0x494d7b[_0xa51d('0x43')]);return db[_0xa51d('0x63')]['count']({'where':_0x1f8233['where']})[_0xa51d('0x27')](function(_0x2ac61f){_0x1746f7[_0xa51d('0x23')]=_0x2ac61f;if(_0x494d7b[_0xa51d('0x37')]['includeAll']){_0x1f8233['include']=[{'all':!![]}];}return db[_0xa51d('0x63')]['findAll'](_0x1f8233);})[_0xa51d('0x27')](function(_0x3c0bac){_0x1746f7['rows']=_0x3c0bac;return _0x1746f7;});}})[_0xa51d('0x27')](respondWithFilteredResult(_0x2d57eb,_0x1f8233))[_0xa51d('0x48')](handleError(_0x2d57eb,null));};exports[_0xa51d('0x64')]=function(_0xa661bd,_0x41e5fb,_0x463d46){var _0x5d26c9={};var _0x69864f={};var _0x19bda0;var _0x52f20b;return db['Campaign']['findOne']({'where':{'id':_0xa661bd[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x41e5fb,null))[_0xa51d('0x27')](function(_0x1af715){if(_0x1af715){_0x19bda0=_0x1af715;_0x69864f[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db[_0xa51d('0x65')][_0xa51d('0x33')]);_0x69864f[_0xa51d('0x37')]=_['keys'](_0xa661bd[_0xa51d('0x37')]);_0x69864f['filters']=_[_0xa51d('0x39')](_0x69864f[_0xa51d('0x36')],_0x69864f[_0xa51d('0x37')]);_0x5d26c9[_0xa51d('0x3a')]=_[_0xa51d('0x39')](_0x69864f['model'],qs[_0xa51d('0x4c')](_0xa661bd[_0xa51d('0x37')][_0xa51d('0x4c')]));_0x5d26c9['attributes']=_0x5d26c9[_0xa51d('0x3a')][_0xa51d('0x3b')]?_0x5d26c9[_0xa51d('0x3a')]:_0x69864f[_0xa51d('0x36')];_0x5d26c9[_0xa51d('0x3d')]=qs[_0xa51d('0x3e')](_0xa661bd[_0xa51d('0x37')][_0xa51d('0x3e')]);_0x5d26c9[_0xa51d('0x3f')]=qs['filters'](_[_0xa51d('0x40')](_0xa661bd[_0xa51d('0x37')],_0x69864f[_0xa51d('0x38')]));if(_0xa661bd['query'][_0xa51d('0x41')]){_0x5d26c9[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0x5d26c9[_0xa51d('0x3f')],{'$or':_['map'](_0x5d26c9[_0xa51d('0x3a')],function(_0x586cf9){var _0x2e613f={};_0x2e613f[_0x586cf9]={'$like':'%'+_0xa661bd[_0xa51d('0x37')]['filter']+'%'};return _0x2e613f;})});}_0x5d26c9=_[_0xa51d('0x42')]({},_0x5d26c9,_0xa661bd[_0xa51d('0x43')]);return _0x19bda0['getLists'](_0x5d26c9);}})['then'](function(_0xe88f58){if(_0xe88f58){_0x52f20b=_0xe88f58['length'];if(!_0xa661bd[_0xa51d('0x37')][_0xa51d('0x3c')](_0xa51d('0x5f'))){_0x5d26c9[_0xa51d('0x22')]=qs[_0xa51d('0x22')](_0xa661bd['query'][_0xa51d('0x22')]);_0x5d26c9[_0xa51d('0x20')]=qs[_0xa51d('0x20')](_0xa661bd['query'][_0xa51d('0x20')]);}return _0x19bda0[_0xa51d('0x64')](_0x5d26c9);}})[_0xa51d('0x27')](function(_0x504b1f){if(_0x504b1f){return _0x504b1f?{'count':_0x52f20b,'rows':_0x504b1f}:null;}})[_0xa51d('0x27')](respondWithResult(_0x41e5fb,null))[_0xa51d('0x48')](handleError(_0x41e5fb,null));};exports['addLists']=function(_0x5a178e,_0x2d2009,_0x488ce9){var _0x1f6bf0,_0x10b5ff;return db[_0xa51d('0x32')][_0xa51d('0x53')]({'where':{'id':_0x5a178e['params']['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x2d2009,null))[_0xa51d('0x27')](function(_0x2a9473){if(_0x2a9473){_0x10b5ff=_0x2a9473;return _0x2a9473[_0xa51d('0x66')](_0x5a178e[_0xa51d('0x4e')][_0xa51d('0x67')],_[_0xa51d('0x57')](_0x5a178e[_0xa51d('0x4e')],[_0xa51d('0x67'),'id'])||{});}return null;})[_0xa51d('0x68')](function(_0x6613aa){var _0x351129;_0x1f6bf0=_0x6613aa||[];var _0x17d467=[];if(_0x6613aa){for(var _0x5d7648=0x0;_0x5d7648<_0x6613aa[_0xa51d('0x3b')];_0x5d7648+=0x1){var _0xfb60fa=_0x6613aa[_0x5d7648][_0xa51d('0x28')]({'plain':!![]});_0x10b5ff[_0xa51d('0x69')]=_0x5a178e[_0xa51d('0x4e')][_0xa51d('0x69')]?_0x5a178e[_0xa51d('0x4e')][_0xa51d('0x69')]:_0x10b5ff[_0xa51d('0x69')];switch(_0x10b5ff[_0xa51d('0x69')]){case _0xa51d('0x6a'):_0x351129=squel[_0xa51d('0x6b')]()[_0xa51d('0x6c')](_0xa51d('0x6d'))[_0xa51d('0x6e')](['phone',_0xa51d('0x6f'),_0xa51d('0x70'),_0xa51d('0x71'),_0xa51d('0x62'),'createdAt',_0xa51d('0x59')],squel['select']()['field'](_0xa51d('0x72'),_0xa51d('0x72'))[_0xa51d('0x73')](_0xa51d('0x74'),'scheduledAt')[_0xa51d('0x73')]('id',_0xa51d('0x70'))['field'](_0xfb60fa[_0xa51d('0x75')][_0xa51d('0x76')](),_0xa51d('0x71'))[_0xa51d('0x73')](_0x5a178e['params']['id'][_0xa51d('0x76')](),_0xa51d('0x62'))['field']('NOW()',_0xa51d('0x58'))[_0xa51d('0x73')]('NOW()',_0xa51d('0x59'))[_0xa51d('0x77')](_0xa51d('0x78'))[_0xa51d('0x3f')](_0xa51d('0x79'))[_0xa51d('0x3f')]('ListId\x20=\x20?',_0xfb60fa['CmListId'][_0xa51d('0x76')]())[_0xa51d('0x3f')](_0xa51d('0x7a'))[_0xa51d('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa51d('0x7b')]()['field'](_0xa51d('0x7c'))['from']('cm_hopper_final')['where'](_0xa51d('0x7d'),_0x5a178e['params']['id']['toString']()))[_0xa51d('0x3f')](_0xa51d('0x7e'),squel[_0xa51d('0x7b')]()[_0xa51d('0x73')](_0xa51d('0x7f'))[_0xa51d('0x77')](_0xa51d('0x6d'))[_0xa51d('0x3f')]('CampaignId\x20=\x20?',_0x5a178e['params']['id'][_0xa51d('0x76')]())))['toString']();break;case _0xa51d('0x80'):_0x351129=squel[_0xa51d('0x6b')]()['into'](_0xa51d('0x6d'))[_0xa51d('0x6e')]([_0xa51d('0x72'),_0xa51d('0x6f'),_0xa51d('0x70'),_0xa51d('0x71'),_0xa51d('0x62'),_0xa51d('0x58'),_0xa51d('0x59')],squel[_0xa51d('0x7b')]()['field']('phone',_0xa51d('0x72'))[_0xa51d('0x73')](_0xa51d('0x74'),_0xa51d('0x6f'))[_0xa51d('0x73')]('id',_0xa51d('0x70'))[_0xa51d('0x73')](_0xfb60fa['CmListId']['toString'](),_0xa51d('0x71'))[_0xa51d('0x73')](_0x5a178e['params']['id'][_0xa51d('0x76')](),'CampaignId')['field'](_0xa51d('0x74'),_0xa51d('0x58'))['field']('NOW()',_0xa51d('0x59'))[_0xa51d('0x77')]('cm_contacts')[_0xa51d('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0xa51d('0x81'),_0xfb60fa[_0xa51d('0x75')][_0xa51d('0x76')]())[_0xa51d('0x3f')](_0xa51d('0x7a'))[_0xa51d('0x3f')](_0xa51d('0x7e'),squel[_0xa51d('0x7b')]()[_0xa51d('0x73')](_0xa51d('0x7f'))[_0xa51d('0x77')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x5a178e[_0xa51d('0x4a')]['id'][_0xa51d('0x76')]())))[_0xa51d('0x76')]();break;default:_0x351129=squel[_0xa51d('0x6b')]()[_0xa51d('0x6c')](_0xa51d('0x6d'))[_0xa51d('0x6e')]([_0xa51d('0x72'),_0xa51d('0x6f'),_0xa51d('0x70'),'ListId',_0xa51d('0x62'),_0xa51d('0x58'),'updatedAt'],squel[_0xa51d('0x7b')]()[_0xa51d('0x73')](_0xa51d('0x72'),_0xa51d('0x72'))['field'](_0xa51d('0x74'),'scheduledAt')['field']('id',_0xa51d('0x70'))[_0xa51d('0x73')](_0xfb60fa['CmListId'][_0xa51d('0x76')](),'ListId')['field'](_0x5a178e[_0xa51d('0x4a')]['id'][_0xa51d('0x76')](),_0xa51d('0x62'))[_0xa51d('0x73')]('NOW()',_0xa51d('0x58'))['field'](_0xa51d('0x74'),_0xa51d('0x59'))['from'](_0xa51d('0x78'))[_0xa51d('0x3f')](_0xa51d('0x79'))[_0xa51d('0x3f')](_0xa51d('0x81'),_0xfb60fa['CmListId']['toString']())['where'](_0xa51d('0x7a')))[_0xa51d('0x76')]();}_0x17d467[_0xa51d('0x82')](db[_0xa51d('0x83')][_0xa51d('0x37')](_0x351129));}return BPromise['all'](_0x17d467);}})[_0xa51d('0x27')](function(){return _0x1f6bf0;})[_0xa51d('0x27')](respondWithResult(_0x2d2009,null))[_0xa51d('0x48')](handleError(_0x2d2009,null));};exports[_0xa51d('0x84')]=function(_0x5bc617,_0xba74fa,_0x521632){return db[_0xa51d('0x32')][_0xa51d('0x53')]({'where':{'id':_0x5bc617['params']['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0xba74fa,null))[_0xa51d('0x27')](function(_0x4ecbad){if(_0x4ecbad){return _0x4ecbad[_0xa51d('0x84')](_0x5bc617[_0xa51d('0x37')][_0xa51d('0x67')]);}})[_0xa51d('0x27')](function(_0xd69669){if(_0xd69669){return db[_0xa51d('0x5c')]['destroy']({'where':{'ListId':_0x5bc617['query'][_0xa51d('0x67')],'CampaignId':_0x5bc617[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](function(){return _0xd69669;});}})['then'](respondWithStatusCode(_0xba74fa,null))[_0xa51d('0x48')](handleError(_0xba74fa,null));};exports[_0xa51d('0x85')]=function(_0x491c29,_0x50ce5a,_0x26337e){var _0x5dad62={};var _0x455288={};var _0x30f0bf;var _0x58c8c5;return db['Campaign'][_0xa51d('0x5b')]({'where':{'id':_0x491c29[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x50ce5a,null))['then'](function(_0x115d9f){if(_0x115d9f){_0x30f0bf=_0x115d9f;_0x455288[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db[_0xa51d('0x65')][_0xa51d('0x33')]);_0x455288[_0xa51d('0x37')]=_[_0xa51d('0x4b')](_0x491c29['query']);_0x455288['filters']=_['intersection'](_0x455288[_0xa51d('0x36')],_0x455288[_0xa51d('0x37')]);_0x5dad62[_0xa51d('0x3a')]=_[_0xa51d('0x39')](_0x455288[_0xa51d('0x36')],qs[_0xa51d('0x4c')](_0x491c29[_0xa51d('0x37')]['fields']));_0x5dad62[_0xa51d('0x3a')]=_0x5dad62[_0xa51d('0x3a')][_0xa51d('0x3b')]?_0x5dad62['attributes']:_0x455288[_0xa51d('0x36')];_0x5dad62[_0xa51d('0x3d')]=qs[_0xa51d('0x3e')](_0x491c29[_0xa51d('0x37')]['sort']);_0x5dad62[_0xa51d('0x3f')]=qs[_0xa51d('0x38')](_[_0xa51d('0x40')](_0x491c29[_0xa51d('0x37')],_0x455288['filters']));if(_0x491c29[_0xa51d('0x37')][_0xa51d('0x41')]){_0x5dad62[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0x5dad62[_0xa51d('0x3f')],{'$or':_[_0xa51d('0x31')](_0x5dad62[_0xa51d('0x3a')],function(_0x1fc521){var _0x438dbe={};_0x438dbe[_0x1fc521]={'$like':'%'+_0x491c29['query'][_0xa51d('0x41')]+'%'};return _0x438dbe;})});}_0x5dad62=_['merge']({},_0x5dad62,_0x491c29[_0xa51d('0x43')]);return _0x30f0bf[_0xa51d('0x85')](_0x5dad62);}})[_0xa51d('0x27')](function(_0x20437c){if(_0x20437c){_0x58c8c5=_0x20437c[_0xa51d('0x3b')];if(!_0x491c29['query'][_0xa51d('0x3c')](_0xa51d('0x5f'))){_0x5dad62['limit']=qs['limit'](_0x491c29['query'][_0xa51d('0x22')]);_0x5dad62[_0xa51d('0x20')]=qs[_0xa51d('0x20')](_0x491c29[_0xa51d('0x37')]['offset']);}return _0x30f0bf[_0xa51d('0x85')](_0x5dad62);}})['then'](function(_0x59c8f7){if(_0x59c8f7){return _0x59c8f7?{'count':_0x58c8c5,'rows':_0x59c8f7}:null;}})[_0xa51d('0x27')](respondWithResult(_0x50ce5a,null))[_0xa51d('0x48')](handleError(_0x50ce5a,null));};exports[_0xa51d('0x86')]=function(_0x241af6,_0x367b69,_0x540767){var _0x5aa55c,_0x19b5e9;return db[_0xa51d('0x32')][_0xa51d('0x53')]({'where':{'id':_0x241af6[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x367b69,null))[_0xa51d('0x27')](function(_0x3d0e28){if(_0x3d0e28){_0x19b5e9=_0x3d0e28;return _0x3d0e28[_0xa51d('0x86')](_0x241af6[_0xa51d('0x4e')]['ids'],_[_0xa51d('0x57')](_0x241af6['body'],['ids','id'])||{});}return null;})['spread'](function(_0x2702df){var _0x26152e;_0x5aa55c=_0x2702df||[];var _0x57d3aa=[];if(_0x2702df){for(var _0x1aaf29=0x0;_0x1aaf29<_0x2702df['length'];_0x1aaf29+=0x1){var _0x3d083b=_0x2702df[_0x1aaf29][_0xa51d('0x28')]({'plain':!![]});_0x26152e=squel[_0xa51d('0x6b')]()[_0xa51d('0x6c')](_0xa51d('0x87'))[_0xa51d('0x6e')](['phone',_0xa51d('0x70'),_0xa51d('0x71'),_0xa51d('0x62'),_0xa51d('0x58'),'updatedAt'],squel[_0xa51d('0x7b')]()[_0xa51d('0x73')]('phone',_0xa51d('0x72'))['field']('id',_0xa51d('0x70'))[_0xa51d('0x73')](_0x3d083b[_0xa51d('0x75')][_0xa51d('0x76')](),_0xa51d('0x71'))[_0xa51d('0x73')](_0x241af6['params']['id']['toString'](),'CampaignId')[_0xa51d('0x73')](_0xa51d('0x74'),_0xa51d('0x58'))[_0xa51d('0x73')](_0xa51d('0x74'),'updatedAt')[_0xa51d('0x77')](_0xa51d('0x78'))[_0xa51d('0x3f')]('deletedAt\x20IS\x20NULL')[_0xa51d('0x3f')](_0xa51d('0x81'),_0x3d083b[_0xa51d('0x75')][_0xa51d('0x76')]())[_0xa51d('0x3f')](_0xa51d('0x7a')))[_0xa51d('0x76')]();_0x57d3aa[_0xa51d('0x82')](db[_0xa51d('0x83')][_0xa51d('0x37')](_0x26152e));}return BPromise[_0xa51d('0x88')](_0x57d3aa);}})[_0xa51d('0x27')](function(){return _0x5aa55c;})['then'](respondWithResult(_0x367b69,null))['catch'](handleError(_0x367b69,null));};exports['removeBlackLists']=function(_0x55c64c,_0x38805f,_0xb6341d){return db[_0xa51d('0x32')][_0xa51d('0x53')]({'where':{'id':_0x55c64c[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x38805f,null))[_0xa51d('0x27')](function(_0x4905a8){if(_0x4905a8){return _0x4905a8[_0xa51d('0x89')](_0x55c64c[_0xa51d('0x37')]['ids']);}})['then'](function(_0x4c97cd){if(_0x4c97cd){return db[_0xa51d('0x63')][_0xa51d('0x2b')]({'where':{'ListId':_0x55c64c[_0xa51d('0x37')][_0xa51d('0x67')],'CampaignId':_0x55c64c[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](function(){return _0x4c97cd;});}})[_0xa51d('0x27')](respondWithStatusCode(_0x38805f,null))[_0xa51d('0x48')](handleError(_0x38805f,null));};
\ No newline at end of file
index e1452f2..875349e 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(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x509203,_0x29af10){var _0x4a30ab=function(_0xa64aa5){while(--_0xa64aa5){_0x509203['push'](_0x509203['shift']());}};_0x4a30ab(++_0x29af10);}(_0x7a54,0x106));var _0x47a5=function(_0xda50c2,_0xc2599c){_0xda50c2=_0xda50c2-0x0;var _0xed24af=_0x7a54[_0xda50c2];return _0xed24af;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7a6baf3..238e1dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dba=['Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x17866f,_0x2bc389){var _0x5109ac=function(_0x191415){while(--_0x191415){_0x17866f['push'](_0x17866f['shift']());}};_0x5109ac(++_0x2bc389);}(_0x0dba,0x136));var _0xa0db=function(_0x40be2b,_0x2c77b4){_0x40be2b=_0x40be2b-0x0;var _0x5a4403=_0x0dba[_0x40be2b];return _0x5a4403;};'use strict';var _=require(_0xa0db('0x0'));var util=require(_0xa0db('0x1'));var moment=require(_0xa0db('0x2'));var BPromise=require(_0xa0db('0x3'));var rs=require(_0xa0db('0x4'));var fs=require('fs');var Redis=require(_0xa0db('0x5'));var db=require(_0xa0db('0x6'))['db'];var utils=require(_0xa0db('0x7'));var logger=require(_0xa0db('0x8'))(_0xa0db('0x9'));var config=require(_0xa0db('0xa'));var jayson=require(_0xa0db('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b77ce,_0x5a8cb2,_0x45fb6d){return new BPromise(function(_0x1fd7ed,_0x483ddf){return client[_0xa0db('0xc')](_0x5b77ce,_0x45fb6d)[_0xa0db('0xd')](function(_0x35445a){logger[_0xa0db('0xe')]('Campaign,\x20%s,\x20%s',_0x5a8cb2,_0xa0db('0xf'));logger[_0xa0db('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5a8cb2,'request\x20sent',JSON[_0xa0db('0x11')](_0x35445a));if(_0x35445a[_0xa0db('0x12')]){if(_0x35445a[_0xa0db('0x12')][_0xa0db('0x13')]===0x1f4){logger['error'](_0xa0db('0x14'),_0x5a8cb2,_0x35445a[_0xa0db('0x12')][_0xa0db('0x15')]);return _0x483ddf(_0x35445a[_0xa0db('0x12')][_0xa0db('0x15')]);}logger[_0xa0db('0x12')](_0xa0db('0x14'),_0x5a8cb2,_0x35445a[_0xa0db('0x12')][_0xa0db('0x15')]);return _0x1fd7ed(_0x35445a['error'][_0xa0db('0x15')]);}else{logger[_0xa0db('0xe')](_0xa0db('0x14'),_0x5a8cb2,_0xa0db('0xf'));_0x1fd7ed(_0x35445a[_0xa0db('0x16')][_0xa0db('0x15')]);}})[_0xa0db('0x17')](function(_0x12a3e8){logger[_0xa0db('0x12')]('Campaign,\x20%s,\x20%s',_0x5a8cb2,_0x12a3e8);_0x483ddf(_0x12a3e8);});});}exports[_0xa0db('0x18')]=function(_0x215658){var _0x4be2e2=this;return new Promise(function(_0x12766f,_0x2786ae){return db[_0xa0db('0x19')][_0xa0db('0x1a')]({'raw':_0x215658[_0xa0db('0x1b')]?_0x215658[_0xa0db('0x1b')][_0xa0db('0x1c')]===undefined?!![]:![]:!![],'where':_0x215658['options']?_0x215658['options']['where']||null:null,'attributes':_0x215658['options']?_0x215658[_0xa0db('0x1b')][_0xa0db('0x1d')]||null:null,'limit':_0x215658[_0xa0db('0x1b')]?_0x215658['options']['limit']||null:null,'include':_0x215658[_0xa0db('0x1b')]?_0x215658['options'][_0xa0db('0x1e')]?_[_0xa0db('0x1f')](_0x215658[_0xa0db('0x1b')][_0xa0db('0x1e')],function(_0x4e9a22){return{'model':db[_0x4e9a22[_0xa0db('0x20')]],'as':_0x4e9a22['as'],'attributes':_0x4e9a22[_0xa0db('0x1d')],'include':_0x4e9a22[_0xa0db('0x1e')]?_[_0xa0db('0x1f')](_0x4e9a22[_0xa0db('0x1e')],function(_0x362c30){return{'model':db[_0x362c30[_0xa0db('0x20')]],'as':_0x362c30['as'],'attributes':_0x362c30[_0xa0db('0x1d')],'include':_0x362c30[_0xa0db('0x1e')]?_[_0xa0db('0x1f')](_0x362c30['include'],function(_0x3652a1){return{'model':db[_0x3652a1[_0xa0db('0x20')]],'as':_0x3652a1['as'],'attributes':_0x3652a1[_0xa0db('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa0db('0xd')](function(_0xe3372c){logger[_0xa0db('0xe')](_0xa0db('0x18'),_0x215658);logger[_0xa0db('0x10')](_0xa0db('0x18'),_0x215658,JSON[_0xa0db('0x11')](_0xe3372c));_0x12766f(_0xe3372c);})[_0xa0db('0x17')](function(_0x3a3dba){logger[_0xa0db('0x12')](_0xa0db('0x18'),_0x3a3dba[_0xa0db('0x15')],_0x215658);_0x2786ae(_0x4be2e2[_0xa0db('0x12')](0x1f4,_0x3a3dba[_0xa0db('0x15')]));});});};
\ No newline at end of file
+var _0x0c6d=['Campaign','findAll','options','where','attributes','map','include','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetCampaign'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x31725d,_0xb5bf65){_0x31725d=_0x31725d-0x0;var _0x53da79=_0x0c6d[_0x31725d];return _0x53da79;};'use strict';var _=require('lodash');var util=require(_0xd0c6('0x0'));var moment=require(_0xd0c6('0x1'));var BPromise=require(_0xd0c6('0x2'));var rs=require(_0xd0c6('0x3'));var fs=require('fs');var Redis=require(_0xd0c6('0x4'));var db=require(_0xd0c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0c6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd0c6('0x7')][_0xd0c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d4a64,_0x5de1cd,_0x16c6da){return new BPromise(function(_0x534412,_0x2a14f1){return client[_0xd0c6('0x9')](_0x2d4a64,_0x16c6da)[_0xd0c6('0xa')](function(_0x184f65){logger[_0xd0c6('0xb')](_0xd0c6('0xc'),_0x5de1cd,_0xd0c6('0xd'));logger[_0xd0c6('0xe')](_0xd0c6('0xf'),_0x5de1cd,'request\x20sent',JSON[_0xd0c6('0x10')](_0x184f65));if(_0x184f65['error']){if(_0x184f65['error'][_0xd0c6('0x11')]===0x1f4){logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);return _0x2a14f1(_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);}logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);return _0x534412(_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);}else{logger[_0xd0c6('0xb')](_0xd0c6('0xc'),_0x5de1cd,_0xd0c6('0xd'));_0x534412(_0x184f65[_0xd0c6('0x14')][_0xd0c6('0x13')]);}})[_0xd0c6('0x15')](function(_0x19dd14){logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x19dd14);_0x2a14f1(_0x19dd14);});});}exports[_0xd0c6('0x16')]=function(_0x941021){var _0x336efd=this;return new Promise(function(_0x4f7e65,_0x479d38){return db[_0xd0c6('0x17')][_0xd0c6('0x18')]({'raw':_0x941021['options']?_0x941021['options']['raw']===undefined?!![]:![]:!![],'where':_0x941021[_0xd0c6('0x19')]?_0x941021[_0xd0c6('0x19')][_0xd0c6('0x1a')]||null:null,'attributes':_0x941021[_0xd0c6('0x19')]?_0x941021[_0xd0c6('0x19')][_0xd0c6('0x1b')]||null:null,'limit':_0x941021[_0xd0c6('0x19')]?_0x941021[_0xd0c6('0x19')]['limit']||null:null,'include':_0x941021[_0xd0c6('0x19')]?_0x941021[_0xd0c6('0x19')]['include']?_[_0xd0c6('0x1c')](_0x941021[_0xd0c6('0x19')][_0xd0c6('0x1d')],function(_0x5d9baa){return{'model':db[_0x5d9baa['model']],'as':_0x5d9baa['as'],'attributes':_0x5d9baa[_0xd0c6('0x1b')],'include':_0x5d9baa[_0xd0c6('0x1d')]?_['map'](_0x5d9baa[_0xd0c6('0x1d')],function(_0x13559f){return{'model':db[_0x13559f['model']],'as':_0x13559f['as'],'attributes':_0x13559f[_0xd0c6('0x1b')],'include':_0x13559f['include']?_['map'](_0x13559f[_0xd0c6('0x1d')],function(_0x15150d){return{'model':db[_0x15150d['model']],'as':_0x15150d['as'],'attributes':_0x15150d[_0xd0c6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd0c6('0xa')](function(_0x3802af){logger[_0xd0c6('0xb')](_0xd0c6('0x16'),_0x941021);logger[_0xd0c6('0xe')](_0xd0c6('0x16'),_0x941021,JSON['stringify'](_0x3802af));_0x4f7e65(_0x3802af);})[_0xd0c6('0x15')](function(_0xe5ae58){logger[_0xd0c6('0x12')](_0xd0c6('0x16'),_0xe5ae58[_0xd0c6('0x13')],_0x941021);_0x479d38(_0x336efd[_0xd0c6('0x12')](0x1f4,_0xe5ae58[_0xd0c6('0x13')]));});});};
\ No newline at end of file
index b9216e4..629130d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bc6=['addLists','addBlackLists','update','removeLists','removeBlackLists','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','isAuthenticated','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone'];(function(_0x3fda1e,_0x3f8d30){var _0x1126bc=function(_0x42774d){while(--_0x42774d){_0x3fda1e['push'](_0x3fda1e['shift']());}};_0x1126bc(++_0x3f8d30);}(_0x2bc6,0xf6));var _0x62bc=function(_0xaf95fa,_0xb0f101){_0xaf95fa=_0xaf95fa-0x0;var _0x11d293=_0x2bc6[_0xaf95fa];return _0x11d293;};'use strict';var multer=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var path=require(_0x62bc('0x2'));var timeout=require('connect-timeout');var express=require(_0x62bc('0x3'));var router=express[_0x62bc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x62bc('0x5'));var interaction=require(_0x62bc('0x6'));var config=require(_0x62bc('0x7'));var controller=require(_0x62bc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x62bc('0x9')]);router[_0x62bc('0xa')](_0x62bc('0xb'),auth['isAuthenticated'](),controller[_0x62bc('0xc')]);router[_0x62bc('0xa')](_0x62bc('0xd'),auth['isAuthenticated'](),controller[_0x62bc('0xe')]);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x62bc('0xa')](_0x62bc('0xf'),auth[_0x62bc('0x10')](),controller['getHopperFinals']);router[_0x62bc('0xa')](_0x62bc('0x11'),auth['isAuthenticated'](),controller[_0x62bc('0x12')]);router[_0x62bc('0xa')](_0x62bc('0x13'),auth[_0x62bc('0x10')](),controller['getLists']);router[_0x62bc('0xa')](_0x62bc('0x14'),auth[_0x62bc('0x10')](),controller['getBlackLists']);router[_0x62bc('0x15')]('/',auth[_0x62bc('0x10')](),controller[_0x62bc('0x16')]);router[_0x62bc('0x15')](_0x62bc('0x17'),auth[_0x62bc('0x10')](),controller['clone']);router[_0x62bc('0x15')](_0x62bc('0x13'),auth[_0x62bc('0x10')](),controller[_0x62bc('0x18')]);router[_0x62bc('0x15')](_0x62bc('0x14'),auth[_0x62bc('0x10')](),controller[_0x62bc('0x19')]);router['put'](_0x62bc('0xb'),auth['isAuthenticated'](),controller[_0x62bc('0x1a')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x62bc('0x13'),auth['isAuthenticated'](),controller[_0x62bc('0x1b')]);router['delete'](_0x62bc('0x14'),auth[_0x62bc('0x10')](),controller[_0x62bc('0x1c')]);module[_0x62bc('0x1d')]=router;
\ No newline at end of file
+var _0x6b6d=['getLists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists'];(function(_0x4fcbec,_0x90e467){var _0x275177=function(_0x1f706b){while(--_0x1f706b){_0x4fcbec['push'](_0x4fcbec['shift']());}};_0x275177(++_0x90e467);}(_0x6b6d,0xbd));var _0xd6b6=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0x6b6d[_0xa3463d];return _0x50fd67;};'use strict';var multer=require(_0xd6b6('0x0'));var util=require(_0xd6b6('0x1'));var path=require(_0xd6b6('0x2'));var timeout=require(_0xd6b6('0x3'));var express=require('express');var router=express[_0xd6b6('0x4')]();var fs_extra=require(_0xd6b6('0x5'));var auth=require(_0xd6b6('0x6'));var interaction=require(_0xd6b6('0x7'));var config=require('../../config/environment');var controller=require(_0xd6b6('0x8'));router[_0xd6b6('0x9')]('/',auth[_0xd6b6('0xa')](),controller['index']);router[_0xd6b6('0x9')](_0xd6b6('0xb'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0xc')]);router[_0xd6b6('0x9')](_0xd6b6('0xd'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xd6b6('0x9')](_0xd6b6('0xe'),auth['isAuthenticated'](),controller[_0xd6b6('0xf')]);router[_0xd6b6('0x9')](_0xd6b6('0x10'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x11')]);router[_0xd6b6('0x9')](_0xd6b6('0x12'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x13')]);router['get'](_0xd6b6('0x14'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x15')]);router[_0xd6b6('0x9')]('/:id/blacklists',auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x16')]);router[_0xd6b6('0x17')]('/',auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x18')]);router[_0xd6b6('0x17')](_0xd6b6('0x19'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x1a')]);router[_0xd6b6('0x17')](_0xd6b6('0x14'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x1b')]);router[_0xd6b6('0x17')](_0xd6b6('0x1c'),auth['isAuthenticated'](),controller[_0xd6b6('0x1d')]);router[_0xd6b6('0x1e')](_0xd6b6('0xb'),auth[_0xd6b6('0xa')](),controller['update']);router[_0xd6b6('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0xd6b6('0x20')]);router[_0xd6b6('0x1f')](_0xd6b6('0x14'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x21')]);router[_0xd6b6('0x1f')](_0xd6b6('0x1c'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x22')]);module['exports']=router;
\ No newline at end of file
index c79e903..a36d69d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd467=['VIRTUAL','getDataValue','sequelize','exports','STRING','TEXT'];(function(_0x4f7280,_0x3c30ff){var _0x5ea336=function(_0x4337de){while(--_0x4337de){_0x4f7280['push'](_0x4f7280['shift']());}};_0x5ea336(++_0x3c30ff);}(_0xd467,0xb6));var _0x7d46=function(_0x2fce58,_0x71e113){_0x2fce58=_0x2fce58-0x0;var _0xfa4b6a=_0xd467[_0x2fce58];return _0xfa4b6a;};'use strict';var Sequelize=require(_0x7d46('0x0'));module[_0x7d46('0x1')]={'key':{'type':Sequelize[_0x7d46('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x7d46('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7d46('0x4')],'get':function(){return this[_0x7d46('0x5')]('key');}}};
\ No newline at end of file
+var _0x23fa=['STRING','TEXT','getDataValue','exports'];(function(_0xf5b712,_0x5487bf){var _0x410413=function(_0x5209ce){while(--_0x5209ce){_0xf5b712['push'](_0xf5b712['shift']());}};_0x410413(++_0x5487bf);}(_0x23fa,0x16b));var _0xa23f=function(_0x5d9df,_0x4d02a1){_0x5d9df=_0x5d9df-0x0;var _0x59f5a8=_0x23fa[_0x5d9df];return _0x59f5a8;};'use strict';var Sequelize=require('sequelize');module[_0xa23f('0x0')]={'key':{'type':Sequelize[_0xa23f('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xa23f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa23f('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xa23f('0x3')]('key');}}};
\ No newline at end of file
index 4c35dbf..4d3165d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bef=['keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','findAll','rows','show','params','includeAll','include','find','body','catch','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','error','name','send','index','CannedAnswer','rawAttributes','key','query'];(function(_0x37c775,_0x160938){var _0x513a37=function(_0x2e285c){while(--_0x2e285c){_0x37c775['push'](_0x37c775['shift']());}};_0x513a37(++_0x160938);}(_0x1bef,0x177));var _0xf1be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bef[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf1be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf1be('0x1'));var jsonpatch=require(_0xf1be('0x2'));var rp=require(_0xf1be('0x3'));var moment=require('moment');var BPromise=require(_0xf1be('0x4'));var Mustache=require(_0xf1be('0x5'));var util=require(_0xf1be('0x6'));var path=require(_0xf1be('0x7'));var sox=require('sox');var csv=require(_0xf1be('0x8'));var ejs=require(_0xf1be('0x9'));var fs=require('fs');var fs_extra=require(_0xf1be('0xa'));var _=require(_0xf1be('0xb'));var squel=require(_0xf1be('0xc'));var crypto=require('crypto');var jsforce=require(_0xf1be('0xd'));var deskjs=require(_0xf1be('0xe'));var toCsv=require(_0xf1be('0x8'));var querystring=require('querystring');var Papa=require(_0xf1be('0xf'));var Redis=require('ioredis');var authService=require(_0xf1be('0x10'));var qs=require(_0xf1be('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1be('0x12'))(_0xf1be('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf1be('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23aa50,_0x362397){_0x362397=_0x362397||0xcc;return function(_0x5de63e){if(_0x5de63e){return _0x23aa50[_0xf1be('0x15')](_0x362397);}return _0x23aa50['status'](_0x362397)[_0xf1be('0x16')]();};}function respondWithResult(_0x472151,_0xc11cba){_0xc11cba=_0xc11cba||0xc8;return function(_0x1f5f7b){if(_0x1f5f7b){return _0x472151[_0xf1be('0x17')](_0xc11cba)['json'](_0x1f5f7b);}};}function respondWithFilteredResult(_0x5ae923,_0x8f25a9){return function(_0x11bf9f){if(_0x11bf9f){var _0x53ff08=typeof _0x8f25a9[_0xf1be('0x18')]===_0xf1be('0x19')&&typeof _0x8f25a9[_0xf1be('0x1a')]===_0xf1be('0x19');var _0x41dbcb=_0x11bf9f['count'];var _0x282312=_0x53ff08?0x0:_0x8f25a9[_0xf1be('0x18')];var _0x104141=_0x53ff08?_0x11bf9f[_0xf1be('0x1b')]:_0x8f25a9[_0xf1be('0x18')]+_0x8f25a9[_0xf1be('0x1a')];var _0xc777c3;if(_0x104141>=_0x41dbcb){_0x104141=_0x41dbcb;_0xc777c3=0xc8;}else{_0xc777c3=0xce;}_0x5ae923[_0xf1be('0x17')](_0xc777c3);return _0x5ae923['set'](_0xf1be('0x1c'),_0x282312+'-'+_0x104141+'/'+_0x41dbcb)[_0xf1be('0x1d')](_0x11bf9f);}return null;};}function patchUpdates(_0x443393){return function(_0x3b933e){try{jsonpatch[_0xf1be('0x1e')](_0x3b933e,_0x443393,!![]);}catch(_0x3fe46b){return BPromise[_0xf1be('0x1f')](_0x3fe46b);}return _0x3b933e['save']();};}function saveUpdates(_0x3be5d8,_0x4ddf1e){return function(_0x39d1ae){if(_0x39d1ae){return _0x39d1ae[_0xf1be('0x20')](_0x3be5d8)[_0xf1be('0x21')](function(_0xbcf3d9){return _0xbcf3d9;});}return null;};}function removeEntity(_0x27a7ce,_0x1dc282){return function(_0x40e2a0){if(_0x40e2a0){return _0x40e2a0[_0xf1be('0x22')]()[_0xf1be('0x21')](function(){var _0x4c2b82=_0x40e2a0[_0xf1be('0x23')]({'plain':!![]});var _0xca64ce=_0xf1be('0x24');return db['UserProfileResource'][_0xf1be('0x22')]({'where':{'type':_0xca64ce,'resourceId':_0x4c2b82['id']}})[_0xf1be('0x21')](function(){return _0x40e2a0;});})[_0xf1be('0x21')](function(){_0x27a7ce['status'](0xcc)[_0xf1be('0x16')]();});}};}function handleEntityNotFound(_0x3cb8d6,_0x497fdb){return function(_0x2c2899){if(!_0x2c2899){_0x3cb8d6[_0xf1be('0x15')](0x194);}return _0x2c2899;};}function handleError(_0x5b752c,_0x45b1ed){_0x45b1ed=_0x45b1ed||0x1f4;return function(_0x38c648){logger[_0xf1be('0x25')](_0x38c648['stack']);if(_0x38c648[_0xf1be('0x26')]){delete _0x38c648[_0xf1be('0x26')];}_0x5b752c['status'](_0x45b1ed)[_0xf1be('0x27')](_0x38c648);};}exports[_0xf1be('0x28')]=function(_0x237439,_0x4bddc3){var _0x37e8f9={},_0x119952={},_0xebcb90={'count':0x0,'rows':[]};var _0x4b8611=_['map'](db[_0xf1be('0x29')][_0xf1be('0x2a')],function(_0x2a4a36){return{'name':_0x2a4a36['fieldName'],'type':_0x2a4a36['type'][_0xf1be('0x2b')]};});_0x119952['model']=_['map'](_0x4b8611,'name');_0x119952[_0xf1be('0x2c')]=_[_0xf1be('0x2d')](_0x237439[_0xf1be('0x2c')]);_0x119952[_0xf1be('0x2e')]=_[_0xf1be('0x2f')](_0x119952['model'],_0x119952['query']);_0x37e8f9[_0xf1be('0x30')]=_[_0xf1be('0x2f')](_0x119952[_0xf1be('0x31')],qs['fields'](_0x237439[_0xf1be('0x2c')][_0xf1be('0x32')]));_0x37e8f9[_0xf1be('0x30')]=_0x37e8f9[_0xf1be('0x30')][_0xf1be('0x33')]?_0x37e8f9[_0xf1be('0x30')]:_0x119952[_0xf1be('0x31')];if(!_0x237439[_0xf1be('0x2c')][_0xf1be('0x34')](_0xf1be('0x35'))){_0x37e8f9[_0xf1be('0x1a')]=qs[_0xf1be('0x1a')](_0x237439[_0xf1be('0x2c')]['limit']);_0x37e8f9[_0xf1be('0x18')]=qs[_0xf1be('0x18')](_0x237439['query']['offset']);}_0x37e8f9[_0xf1be('0x36')]=qs[_0xf1be('0x37')](_0x237439[_0xf1be('0x2c')][_0xf1be('0x37')]);_0x37e8f9[_0xf1be('0x38')]=qs[_0xf1be('0x2e')](_[_0xf1be('0x39')](_0x237439[_0xf1be('0x2c')],_0x119952['filters']),_0x4b8611);if(_0x237439['query']['filter']){_0x37e8f9['where']=_[_0xf1be('0x3a')](_0x37e8f9['where'],{'$or':[{'key':{'$like':'%'+_0x237439[_0xf1be('0x2c')][_0xf1be('0x3b')]+'%'}},{'value':{'$like':'%'+_0x237439[_0xf1be('0x2c')]['filter']+'%'}}]});}_0x37e8f9=_['merge']({},_0x37e8f9,_0x237439[_0xf1be('0x3c')]);var _0x1093c4={'where':_0x37e8f9[_0xf1be('0x38')]};return db[_0xf1be('0x29')][_0xf1be('0x1b')](_0x1093c4)['then'](function(_0x4b0aa9){_0xebcb90['count']=_0x4b0aa9;if(_0x237439[_0xf1be('0x2c')]['includeAll']){_0x37e8f9['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xf1be('0x3d')](_0x37e8f9);})[_0xf1be('0x21')](function(_0x3c25b1){_0xebcb90[_0xf1be('0x3e')]=_0x3c25b1;return _0xebcb90;})[_0xf1be('0x21')](respondWithFilteredResult(_0x4bddc3,_0x37e8f9))['catch'](handleError(_0x4bddc3,null));};exports[_0xf1be('0x3f')]=function(_0x4750f0,_0x5b485a){var _0xa1294c={'raw':!![],'where':{'id':_0x4750f0[_0xf1be('0x40')]['id']}},_0x5822={};_0x5822[_0xf1be('0x31')]=_['keys'](db['CannedAnswer'][_0xf1be('0x2a')]);_0x5822[_0xf1be('0x2c')]=_['keys'](_0x4750f0['query']);_0x5822['filters']=_[_0xf1be('0x2f')](_0x5822[_0xf1be('0x31')],_0x5822['query']);_0xa1294c['attributes']=_['intersection'](_0x5822[_0xf1be('0x31')],qs[_0xf1be('0x32')](_0x4750f0[_0xf1be('0x2c')][_0xf1be('0x32')]));_0xa1294c['attributes']=_0xa1294c[_0xf1be('0x30')]['length']?_0xa1294c[_0xf1be('0x30')]:_0x5822['model'];if(_0x4750f0[_0xf1be('0x2c')][_0xf1be('0x41')]){_0xa1294c[_0xf1be('0x42')]=[{'all':!![]}];}_0xa1294c=_['merge']({},_0xa1294c,_0x4750f0[_0xf1be('0x3c')]);return db[_0xf1be('0x29')][_0xf1be('0x43')](_0xa1294c)[_0xf1be('0x21')](handleEntityNotFound(_0x5b485a,null))[_0xf1be('0x21')](respondWithResult(_0x5b485a,null))['catch'](handleError(_0x5b485a,null));};exports[_0xf1be('0x20')]=function(_0x53c934,_0x17c0e1){if(_0x53c934[_0xf1be('0x44')]['id']){delete _0x53c934['body']['id'];}return db[_0xf1be('0x29')][_0xf1be('0x43')]({'where':{'id':_0x53c934[_0xf1be('0x40')]['id']}})[_0xf1be('0x21')](handleEntityNotFound(_0x17c0e1,null))['then'](saveUpdates(_0x53c934['body'],null))[_0xf1be('0x21')](respondWithResult(_0x17c0e1,null))[_0xf1be('0x45')](handleError(_0x17c0e1,null));};exports['destroy']=function(_0x3b9178,_0x54a6ef){return db['CannedAnswer']['find']({'where':{'id':_0x3b9178[_0xf1be('0x40')]['id']}})[_0xf1be('0x21')](handleEntityNotFound(_0x54a6ef,null))[_0xf1be('0x21')](removeEntity(_0x54a6ef,null))[_0xf1be('0x45')](handleError(_0x54a6ef,null));};exports['create']=function(_0x39d9d4,_0x391a2e){var _0x1b6986={'key':_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x2b')]};if(_0x39d9d4[_0xf1be('0x44')]['MailAccountId']){_0x1b6986[_0xf1be('0x46')]=_0x39d9d4[_0xf1be('0x44')]['MailAccountId'];}else if(_0x39d9d4['body'][_0xf1be('0x47')]){_0x1b6986[_0xf1be('0x47')]=_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x47')];}else if(_0x39d9d4[_0xf1be('0x44')]['OpenchannelAccountId']){_0x1b6986[_0xf1be('0x48')]=_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x48')];}else if(_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x49')]){_0x1b6986[_0xf1be('0x49')]=_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x49')];}return db[_0xf1be('0x29')][_0xf1be('0x43')]({'where':_0x1b6986})[_0xf1be('0x21')](function(_0x199f6d){if(_0x199f6d){throw new db[(_0xf1be('0x4a'))][(_0xf1be('0x4b'))](_0xf1be('0x4c'));}return db['CannedAnswer'][_0xf1be('0x4d')](_0x39d9d4[_0xf1be('0x44')]);})[_0xf1be('0x21')](function(_0x3dd33f){var _0x21a374=_0x39d9d4[_0xf1be('0x4e')][_0xf1be('0x23')]({'plain':!![]});if(!_0x21a374)throw new Error(_0xf1be('0x4f'));if(_0x21a374[_0xf1be('0x50')]==='user'){var _0x341bcd=_0x3dd33f[_0xf1be('0x23')]({'plain':!![]});return db['UserProfileSection'][_0xf1be('0x43')]({'where':{'name':'CannedAnswers','userProfileId':_0x21a374['userProfileId']},'raw':!![]})[_0xf1be('0x21')](function(_0x468fce){if(_0x468fce&&_0x468fce[_0xf1be('0x51')]===0x0){return db[_0xf1be('0x52')][_0xf1be('0x4d')]({'name':_0x341bcd[_0xf1be('0x26')],'resourceId':_0x341bcd['id'],'type':_0x468fce[_0xf1be('0x26')],'sectionId':_0x468fce['id']},{})[_0xf1be('0x21')](function(){return _0x3dd33f;});}else{return _0x3dd33f;}})['catch'](function(_0xd17e9e){logger[_0xf1be('0x25')](_0xf1be('0x53'),_0xd17e9e);throw _0xd17e9e;});}return _0x3dd33f;})['then'](respondWithResult(_0x391a2e,0xc9))[_0xf1be('0x45')](handleError(_0x391a2e,null));};
\ No newline at end of file
+var _0x2b90=['rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','limit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','CannedAnswer','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map'];(function(_0x48bbd9,_0x34482b){var _0x10851a=function(_0x3d7bb5){while(--_0x3d7bb5){_0x48bbd9['push'](_0x48bbd9['shift']());}};_0x10851a(++_0x34482b);}(_0x2b90,0x190));var _0x02b9=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2b90[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x02b9('0x0'));var jsonpatch=require(_0x02b9('0x1'));var rp=require(_0x02b9('0x2'));var moment=require(_0x02b9('0x3'));var BPromise=require(_0x02b9('0x4'));var Mustache=require(_0x02b9('0x5'));var util=require('util');var path=require(_0x02b9('0x6'));var sox=require(_0x02b9('0x7'));var csv=require(_0x02b9('0x8'));var ejs=require(_0x02b9('0x9'));var fs=require('fs');var fs_extra=require(_0x02b9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x02b9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x02b9('0x8'));var querystring=require(_0x02b9('0xc'));var Papa=require(_0x02b9('0xd'));var Redis=require(_0x02b9('0xe'));var authService=require(_0x02b9('0xf'));var qs=require(_0x02b9('0x10'));var as=require(_0x02b9('0x11'));var hardwareService=require(_0x02b9('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x02b9('0x13'));var config=require(_0x02b9('0x14'));var licenseUtil=require(_0x02b9('0x15'));var db=require(_0x02b9('0x16'))['db'];function respondWithStatusCode(_0x4e0418,_0x4d8279){_0x4d8279=_0x4d8279||0xcc;return function(_0x4ea6a5){if(_0x4ea6a5){return _0x4e0418['sendStatus'](_0x4d8279);}return _0x4e0418[_0x02b9('0x17')](_0x4d8279)[_0x02b9('0x18')]();};}function respondWithResult(_0x55b319,_0x4abf59){_0x4abf59=_0x4abf59||0xc8;return function(_0x6a013e){if(_0x6a013e){return _0x55b319['status'](_0x4abf59)[_0x02b9('0x19')](_0x6a013e);}};}function respondWithFilteredResult(_0x362a4a,_0x4b8fa6){return function(_0x42ca2e){if(_0x42ca2e){var _0x13ab06=typeof _0x4b8fa6[_0x02b9('0x1a')]===_0x02b9('0x1b')&&typeof _0x4b8fa6['limit']===_0x02b9('0x1b');var _0x4e6409=_0x42ca2e[_0x02b9('0x1c')];var _0x3a45c6=_0x13ab06?0x0:_0x4b8fa6[_0x02b9('0x1a')];var _0x52d20f=_0x13ab06?_0x42ca2e[_0x02b9('0x1c')]:_0x4b8fa6['offset']+_0x4b8fa6['limit'];var _0xad3b4b;if(_0x52d20f>=_0x4e6409){_0x52d20f=_0x4e6409;_0xad3b4b=0xc8;}else{_0xad3b4b=0xce;}_0x362a4a[_0x02b9('0x17')](_0xad3b4b);return _0x362a4a[_0x02b9('0x1d')](_0x02b9('0x1e'),_0x3a45c6+'-'+_0x52d20f+'/'+_0x4e6409)['json'](_0x42ca2e);}return null;};}function patchUpdates(_0x1c9282){return function(_0x384b50){try{jsonpatch[_0x02b9('0x1f')](_0x384b50,_0x1c9282,!![]);}catch(_0x132a49){return BPromise['reject'](_0x132a49);}return _0x384b50[_0x02b9('0x20')]();};}function saveUpdates(_0x2c59c2,_0x40a05e){return function(_0x5671c9){if(_0x5671c9){return _0x5671c9[_0x02b9('0x21')](_0x2c59c2)[_0x02b9('0x22')](function(_0x3a9dc3){return _0x3a9dc3;});}return null;};}function removeEntity(_0x4f2374,_0x1ecb01){return function(_0x52f3a0){if(_0x52f3a0){return _0x52f3a0[_0x02b9('0x23')]()[_0x02b9('0x22')](function(){var _0x3fea6c=_0x52f3a0[_0x02b9('0x24')]({'plain':!![]});var _0x1b07e3=_0x02b9('0x25');return db[_0x02b9('0x26')][_0x02b9('0x23')]({'where':{'type':_0x1b07e3,'resourceId':_0x3fea6c['id']}})[_0x02b9('0x22')](function(){return _0x52f3a0;});})[_0x02b9('0x22')](function(){_0x4f2374[_0x02b9('0x17')](0xcc)[_0x02b9('0x18')]();});}};}function handleEntityNotFound(_0x17bd1c,_0x1b8ef8){return function(_0xc3220e){if(!_0xc3220e){_0x17bd1c['sendStatus'](0x194);}return _0xc3220e;};}function handleError(_0x57335f,_0x34fefb){_0x34fefb=_0x34fefb||0x1f4;return function(_0x503b33){logger[_0x02b9('0x27')](_0x503b33[_0x02b9('0x28')]);if(_0x503b33[_0x02b9('0x29')]){delete _0x503b33[_0x02b9('0x29')];}_0x57335f[_0x02b9('0x17')](_0x34fefb)[_0x02b9('0x2a')](_0x503b33);};}exports[_0x02b9('0x2b')]=function(_0x2c4e18,_0x5ec9cd){var _0x2e73c6={},_0x395e40={},_0x2fbad5={'count':0x0,'rows':[]};var _0x3a9b5a=_[_0x02b9('0x2c')](db['CannedAnswer'][_0x02b9('0x2d')],function(_0x25b3e7){return{'name':_0x25b3e7['fieldName'],'type':_0x25b3e7[_0x02b9('0x2e')][_0x02b9('0x2f')]};});_0x395e40[_0x02b9('0x30')]=_['map'](_0x3a9b5a,_0x02b9('0x29'));_0x395e40[_0x02b9('0x31')]=_[_0x02b9('0x32')](_0x2c4e18[_0x02b9('0x31')]);_0x395e40['filters']=_[_0x02b9('0x33')](_0x395e40[_0x02b9('0x30')],_0x395e40['query']);_0x2e73c6[_0x02b9('0x34')]=_[_0x02b9('0x33')](_0x395e40[_0x02b9('0x30')],qs[_0x02b9('0x35')](_0x2c4e18[_0x02b9('0x31')][_0x02b9('0x35')]));_0x2e73c6[_0x02b9('0x34')]=_0x2e73c6[_0x02b9('0x34')][_0x02b9('0x36')]?_0x2e73c6['attributes']:_0x395e40[_0x02b9('0x30')];if(!_0x2c4e18[_0x02b9('0x31')]['hasOwnProperty']('nolimit')){_0x2e73c6[_0x02b9('0x37')]=qs[_0x02b9('0x37')](_0x2c4e18['query'][_0x02b9('0x37')]);_0x2e73c6[_0x02b9('0x1a')]=qs['offset'](_0x2c4e18['query'][_0x02b9('0x1a')]);}_0x2e73c6[_0x02b9('0x38')]=qs[_0x02b9('0x39')](_0x2c4e18[_0x02b9('0x31')]['sort']);_0x2e73c6[_0x02b9('0x3a')]=qs[_0x02b9('0x3b')](_[_0x02b9('0x3c')](_0x2c4e18[_0x02b9('0x31')],_0x395e40[_0x02b9('0x3b')]),_0x3a9b5a);if(_0x2c4e18[_0x02b9('0x31')]['filter']){_0x2e73c6[_0x02b9('0x3a')]=_[_0x02b9('0x3d')](_0x2e73c6['where'],{'$or':[{'key':{'$like':'%'+_0x2c4e18[_0x02b9('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x2c4e18[_0x02b9('0x31')][_0x02b9('0x3e')]+'%'}}]});}_0x2e73c6=_['merge']({},_0x2e73c6,_0x2c4e18[_0x02b9('0x3f')]);var _0x3d10e9={'where':_0x2e73c6[_0x02b9('0x3a')]};return db['CannedAnswer'][_0x02b9('0x1c')](_0x3d10e9)['then'](function(_0x36d091){_0x2fbad5['count']=_0x36d091;if(_0x2c4e18[_0x02b9('0x31')][_0x02b9('0x40')]){_0x2e73c6[_0x02b9('0x41')]=[{'all':!![]}];}return db['CannedAnswer'][_0x02b9('0x42')](_0x2e73c6);})[_0x02b9('0x22')](function(_0x3380f6){_0x2fbad5[_0x02b9('0x43')]=_0x3380f6;return _0x2fbad5;})[_0x02b9('0x22')](respondWithFilteredResult(_0x5ec9cd,_0x2e73c6))[_0x02b9('0x44')](handleError(_0x5ec9cd,null));};exports[_0x02b9('0x45')]=function(_0x144fb0,_0x15efdd){var _0x3dbb02={'raw':!![],'where':{'id':_0x144fb0[_0x02b9('0x46')]['id']}},_0x53b53e={};_0x53b53e[_0x02b9('0x30')]=_[_0x02b9('0x32')](db[_0x02b9('0x47')][_0x02b9('0x2d')]);_0x53b53e[_0x02b9('0x31')]=_['keys'](_0x144fb0[_0x02b9('0x31')]);_0x53b53e[_0x02b9('0x3b')]=_[_0x02b9('0x33')](_0x53b53e[_0x02b9('0x30')],_0x53b53e['query']);_0x3dbb02['attributes']=_[_0x02b9('0x33')](_0x53b53e[_0x02b9('0x30')],qs[_0x02b9('0x35')](_0x144fb0['query'][_0x02b9('0x35')]));_0x3dbb02['attributes']=_0x3dbb02['attributes'][_0x02b9('0x36')]?_0x3dbb02[_0x02b9('0x34')]:_0x53b53e['model'];if(_0x144fb0['query'][_0x02b9('0x40')]){_0x3dbb02['include']=[{'all':!![]}];}_0x3dbb02=_[_0x02b9('0x3d')]({},_0x3dbb02,_0x144fb0[_0x02b9('0x3f')]);return db['CannedAnswer'][_0x02b9('0x48')](_0x3dbb02)[_0x02b9('0x22')](handleEntityNotFound(_0x15efdd,null))[_0x02b9('0x22')](respondWithResult(_0x15efdd,null))[_0x02b9('0x44')](handleError(_0x15efdd,null));};exports['update']=function(_0x2b559e,_0x1b9853){if(_0x2b559e[_0x02b9('0x49')]['id']){delete _0x2b559e['body']['id'];}return db[_0x02b9('0x47')][_0x02b9('0x48')]({'where':{'id':_0x2b559e[_0x02b9('0x46')]['id']}})[_0x02b9('0x22')](handleEntityNotFound(_0x1b9853,null))['then'](saveUpdates(_0x2b559e[_0x02b9('0x49')],null))[_0x02b9('0x22')](respondWithResult(_0x1b9853,null))[_0x02b9('0x44')](handleError(_0x1b9853,null));};exports['destroy']=function(_0xe99ba3,_0x3e91c3){return db[_0x02b9('0x47')][_0x02b9('0x48')]({'where':{'id':_0xe99ba3['params']['id']}})[_0x02b9('0x22')](handleEntityNotFound(_0x3e91c3,null))[_0x02b9('0x22')](removeEntity(_0x3e91c3,null))['catch'](handleError(_0x3e91c3,null));};exports[_0x02b9('0x4a')]=function(_0x5e1f3d,_0x1e1bcd){var _0x305493={'key':_0x5e1f3d[_0x02b9('0x49')][_0x02b9('0x2f')]};if(_0x5e1f3d[_0x02b9('0x49')][_0x02b9('0x4b')]){_0x305493[_0x02b9('0x4b')]=_0x5e1f3d[_0x02b9('0x49')]['MailAccountId'];}else if(_0x5e1f3d['body'][_0x02b9('0x4c')]){_0x305493['SmsAccountId']=_0x5e1f3d[_0x02b9('0x49')][_0x02b9('0x4c')];}else if(_0x5e1f3d[_0x02b9('0x49')]['OpenchannelAccountId']){_0x305493[_0x02b9('0x4d')]=_0x5e1f3d[_0x02b9('0x49')]['OpenchannelAccountId'];}else if(_0x5e1f3d[_0x02b9('0x49')][_0x02b9('0x4e')]){_0x305493[_0x02b9('0x4e')]=_0x5e1f3d[_0x02b9('0x49')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x02b9('0x48')]({'where':_0x305493})[_0x02b9('0x22')](function(_0x2e9b74){if(_0x2e9b74){throw new db[(_0x02b9('0x4f'))][(_0x02b9('0x50'))](_0x02b9('0x51'));}return db[_0x02b9('0x47')]['create'](_0x5e1f3d[_0x02b9('0x49')]);})[_0x02b9('0x22')](function(_0x52bd82){var _0x5773a7=_0x5e1f3d['user'][_0x02b9('0x24')]({'plain':!![]});if(!_0x5773a7)throw new Error(_0x02b9('0x52'));if(_0x5773a7[_0x02b9('0x53')]===_0x02b9('0x54')){var _0x11c4f8=_0x52bd82['get']({'plain':!![]});return db[_0x02b9('0x55')][_0x02b9('0x48')]({'where':{'name':_0x02b9('0x25'),'userProfileId':_0x5773a7[_0x02b9('0x56')]},'raw':!![]})[_0x02b9('0x22')](function(_0x59a912){if(_0x59a912&&_0x59a912[_0x02b9('0x57')]===0x0){return db[_0x02b9('0x26')][_0x02b9('0x4a')]({'name':_0x11c4f8['name'],'resourceId':_0x11c4f8['id'],'type':_0x59a912[_0x02b9('0x29')],'sectionId':_0x59a912['id']},{})[_0x02b9('0x22')](function(){return _0x52bd82;});}else{return _0x52bd82;}})['catch'](function(_0xb53ade){logger['error'](_0x02b9('0x58'),_0xb53ade);throw _0xb53ade;});}return _0x52bd82;})['then'](respondWithResult(_0x1e1bcd,0xc9))['catch'](handleError(_0x1e1bcd,null));};
\ No newline at end of file
index 77cf62b..309babb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x388a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x10f2e7,_0x491801){var _0x183060=function(_0x462680){while(--_0x462680){_0x10f2e7['push'](_0x10f2e7['shift']());}};_0x183060(++_0x491801);}(_0x388a,0xdc));var _0xa388=function(_0x18bb13,_0x4562e3){_0x18bb13=_0x18bb13-0x0;var _0x2192f3=_0x388a[_0x18bb13];return _0x2192f3;};'use strict';var _=require('lodash');var util=require(_0xa388('0x0'));var logger=require(_0xa388('0x1'))(_0xa388('0x2'));var moment=require(_0xa388('0x3'));var BPromise=require(_0xa388('0x4'));var rp=require(_0xa388('0x5'));var fs=require('fs');var path=require(_0xa388('0x6'));var rimraf=require(_0xa388('0x7'));var config=require(_0xa388('0x8'));var attributes=require(_0xa388('0x9'));module[_0xa388('0xa')]=function(_0x2d30c1,_0x297742){return _0x2d30c1['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb576=['../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','moment','request-promise','path','rimraf'];(function(_0x1b6f56,_0x4f44d2){var _0x2bbf0a=function(_0x30183d){while(--_0x30183d){_0x1b6f56['push'](_0x1b6f56['shift']());}};_0x2bbf0a(++_0x4f44d2);}(_0xb576,0x1cf));var _0x6b57=function(_0x2969ee,_0x5d77fe){_0x2969ee=_0x2969ee-0x0;var _0x288cce=_0xb576[_0x2969ee];return _0x288cce;};'use strict';var _=require('lodash');var util=require(_0x6b57('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x6b57('0x1'));var BPromise=require('bluebird');var rp=require(_0x6b57('0x2'));var fs=require('fs');var path=require(_0x6b57('0x3'));var rimraf=require(_0x6b57('0x4'));var config=require(_0x6b57('0x5'));var attributes=require(_0x6b57('0x6'));module[_0x6b57('0x7')]=function(_0x3d4304,_0x2d0452){return _0x3d4304['define'](_0x6b57('0x8'),attributes,{'tableName':_0x6b57('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b57('0xa'),'collate':_0x6b57('0xb')});};
\ No newline at end of file
index 15930be..842bd1b 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(_0x19a19c,_0x75752b){var _0x3e79bb=function(_0x277c7a){while(--_0x277c7a){_0x19a19c['push'](_0x19a19c['shift']());}};_0x3e79bb(++_0x75752b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var 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(_0x582b91,_0x2f1324){var _0x10741a=function(_0x98544e){while(--_0x98544e){_0x582b91['push'](_0x582b91['shift']());}};_0x10741a(++_0x2f1324);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 8876367..443268a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe095=['put','/:id','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','post','create'];(function(_0x1a9e39,_0x36d760){var _0x406407=function(_0x3a2de1){while(--_0x3a2de1){_0x1a9e39['push'](_0x1a9e39['shift']());}};_0x406407(++_0x36d760);}(_0xe095,0x1b5));var _0x5e09=function(_0x5b039d,_0x4306ba){_0x5b039d=_0x5b039d-0x0;var _0x2c64c2=_0xe095[_0x5b039d];return _0x2c64c2;};'use strict';var multer=require(_0x5e09('0x0'));var util=require(_0x5e09('0x1'));var path=require('path');var timeout=require(_0x5e09('0x2'));var express=require(_0x5e09('0x3'));var router=express['Router']();var fs_extra=require(_0x5e09('0x4'));var auth=require(_0x5e09('0x5'));var interaction=require(_0x5e09('0x6'));var config=require(_0x5e09('0x7'));var controller=require(_0x5e09('0x8'));router[_0x5e09('0x9')]('/',auth[_0x5e09('0xa')](),controller['index']);router[_0x5e09('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5e09('0xb')]('/',auth[_0x5e09('0xa')](),controller[_0x5e09('0xc')]);router[_0x5e09('0xd')](_0x5e09('0xe'),auth[_0x5e09('0xa')](),controller[_0x5e09('0xf')]);router[_0x5e09('0x10')](_0x5e09('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x5e09('0x11')]=router;
\ No newline at end of file
+var _0x0610=['index','/:id','show','create','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x17ee10,_0x2bc274){var _0x4c8cfa=function(_0x197cc4){while(--_0x197cc4){_0x17ee10['push'](_0x17ee10['shift']());}};_0x4c8cfa(++_0x2bc274);}(_0x0610,0x8f));var _0x0061=function(_0x168552,_0x564454){_0x168552=_0x168552-0x0;var _0x5a137a=_0x0610[_0x168552];return _0x5a137a;};'use strict';var multer=require(_0x0061('0x0'));var util=require(_0x0061('0x1'));var path=require(_0x0061('0x2'));var timeout=require('connect-timeout');var express=require(_0x0061('0x3'));var router=express[_0x0061('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0061('0x5'));var config=require(_0x0061('0x6'));var controller=require(_0x0061('0x7'));router[_0x0061('0x8')]('/',auth[_0x0061('0x9')](),controller[_0x0061('0xa')]);router[_0x0061('0x8')](_0x0061('0xb'),auth[_0x0061('0x9')](),controller[_0x0061('0xc')]);router['post']('/',auth[_0x0061('0x9')](),controller[_0x0061('0xd')]);router['put'](_0x0061('0xb'),auth[_0x0061('0x9')](),controller[_0x0061('0xe')]);router[_0x0061('0xf')](_0x0061('0xb'),auth[_0x0061('0x9')](),controller['destroy']);module[_0x0061('0x10')]=router;
\ No newline at end of file
index 3f16d42..32d2266 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3098=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x278b77,_0x34f7dd){var _0x2b07f2=function(_0x32e6bf){while(--_0x32e6bf){_0x278b77['push'](_0x278b77['shift']());}};_0x2b07f2(++_0x34f7dd);}(_0x3098,0x86));var _0x8309=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x3098[_0x4629ee];return _0x47fb5b;};'use strict';var Sequelize=require(_0x8309('0x0'));module[_0x8309('0x1')]={'calldate':{'type':Sequelize[_0x8309('0x2')],'allowNull':![],'defaultValue':_0x8309('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x8309('0x4')]},'dst':{'type':Sequelize[_0x8309('0x4')]},'dcontext':{'type':Sequelize[_0x8309('0x4')]},'channel':{'type':Sequelize[_0x8309('0x4')]},'dstchannel':{'type':Sequelize[_0x8309('0x4')]},'lastapp':{'type':Sequelize[_0x8309('0x4')]},'lastdata':{'type':Sequelize[_0x8309('0x4')]},'duration':{'type':Sequelize[_0x8309('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8309('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8309('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8309('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8309('0x4')]},'linkedid':{'type':Sequelize[_0x8309('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8309('0x4')]},'tag':{'type':Sequelize[_0x8309('0x4')]}};
\ No newline at end of file
+var _0x3360=['exports','STRING','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3360,0x1d7));var _0x0336=function(_0x243037,_0x4c5b74){_0x243037=_0x243037-0x0;var _0x37626d=_0x3360[_0x243037];return _0x37626d;};'use strict';var Sequelize=require(_0x0336('0x0'));module[_0x0336('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x0336('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0336('0x2')]},'dstchannel':{'type':Sequelize[_0x0336('0x2')]},'lastapp':{'type':Sequelize[_0x0336('0x2')]},'lastdata':{'type':Sequelize[_0x0336('0x2')]},'duration':{'type':Sequelize[_0x0336('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0336('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0336('0x2')]},'userfield':{'type':Sequelize[_0x0336('0x2')]},'uniqueid':{'type':Sequelize[_0x0336('0x2')]},'linkedid':{'type':Sequelize[_0x0336('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x0336('0x2')]},'type':{'type':Sequelize[_0x0336('0x2')]},'tag':{'type':Sequelize[_0x0336('0x2')]}};
\ No newline at end of file
index e74a9f1..9aaf1ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb94=['keys','find','create','body','destroy','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','sort','pick','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch'];(function(_0x142507,_0x51fb78){var _0x2a513c=function(_0x28050f){while(--_0x28050f){_0x142507['push'](_0x142507['shift']());}};_0x2a513c(++_0x51fb78);}(_0xdb94,0xe5));var _0x4db9=function(_0x36e567,_0xb4ba91){_0x36e567=_0x36e567-0x0;var _0x2df914=_0xdb94[_0x36e567];return _0x2df914;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4db9('0x0'));var zipdir=require(_0x4db9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4db9('0x2'));var moment=require(_0x4db9('0x3'));var BPromise=require(_0x4db9('0x4'));var Mustache=require(_0x4db9('0x5'));var util=require(_0x4db9('0x6'));var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require(_0x4db9('0x8'));var fs=require('fs');var fs_extra=require(_0x4db9('0x9'));var _=require(_0x4db9('0xa'));var squel=require(_0x4db9('0xb'));var crypto=require(_0x4db9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4db9('0xd'));var toCsv=require(_0x4db9('0xe'));var querystring=require(_0x4db9('0xf'));var Papa=require(_0x4db9('0x10'));var Redis=require(_0x4db9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4db9('0x12'));var as=require(_0x4db9('0x13'));var hardwareService=require(_0x4db9('0x14'));var logger=require(_0x4db9('0x15'))(_0x4db9('0x16'));var utils=require(_0x4db9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4db9('0x18'));var db=require(_0x4db9('0x19'))['db'];function respondWithStatusCode(_0x59f01c,_0x549c92){_0x549c92=_0x549c92||0xcc;return function(_0x19f2d3){if(_0x19f2d3){return _0x59f01c[_0x4db9('0x1a')](_0x549c92);}return _0x59f01c[_0x4db9('0x1b')](_0x549c92)['end']();};}function respondWithResult(_0x1a93be,_0x3dde55){_0x3dde55=_0x3dde55||0xc8;return function(_0x2018d2){if(_0x2018d2){return _0x1a93be[_0x4db9('0x1b')](_0x3dde55)[_0x4db9('0x1c')](_0x2018d2);}};}function respondWithFilteredResult(_0x585230,_0x1b1062){return function(_0x1a5a9c){if(_0x1a5a9c){var _0x5d4d70=typeof _0x1b1062[_0x4db9('0x1d')]===_0x4db9('0x1e')&&typeof _0x1b1062[_0x4db9('0x1f')]==='undefined';var _0xedc513=_0x1a5a9c[_0x4db9('0x20')];var _0x4c5f4f=_0x5d4d70?0x0:_0x1b1062['offset'];var _0x493923=_0x5d4d70?_0x1a5a9c[_0x4db9('0x20')]:_0x1b1062[_0x4db9('0x1d')]+_0x1b1062['limit'];var _0x375515;if(_0x493923>=_0xedc513){_0x493923=_0xedc513;_0x375515=0xc8;}else{_0x375515=0xce;}_0x585230[_0x4db9('0x1b')](_0x375515);return _0x585230[_0x4db9('0x21')](_0x4db9('0x22'),_0x4c5f4f+'-'+_0x493923+'/'+_0xedc513)[_0x4db9('0x1c')](_0x1a5a9c);}return null;};}function patchUpdates(_0x28b7f6){return function(_0x34a6ed){try{jsonpatch[_0x4db9('0x23')](_0x34a6ed,_0x28b7f6,!![]);}catch(_0x3256f4){return BPromise[_0x4db9('0x24')](_0x3256f4);}return _0x34a6ed[_0x4db9('0x25')]();};}function saveUpdates(_0x102402,_0x4d56a1){return function(_0x42cc40){if(_0x42cc40){return _0x42cc40[_0x4db9('0x26')](_0x102402)['then'](function(_0x37c81f){return _0x37c81f;});}return null;};}function removeEntity(_0x3f4931,_0x4419af){return function(_0x402898){if(_0x402898){return _0x402898['destroy']()[_0x4db9('0x27')](function(){_0x3f4931['status'](0xcc)[_0x4db9('0x28')]();});}};}function handleEntityNotFound(_0x1c82b6,_0x135aa7){return function(_0x47e89c){if(!_0x47e89c){_0x1c82b6[_0x4db9('0x1a')](0x194);}return _0x47e89c;};}function handleError(_0x622db6,_0x47464d){_0x47464d=_0x47464d||0x1f4;return function(_0x5e7d29){logger['error'](_0x5e7d29[_0x4db9('0x29')]);if(_0x5e7d29['name']){delete _0x5e7d29[_0x4db9('0x2a')];}_0x622db6[_0x4db9('0x1b')](_0x47464d)[_0x4db9('0x2b')](_0x5e7d29);};}exports[_0x4db9('0x2c')]=function(_0x384df5,_0x3c3fcf){var _0x1d0dc2={},_0x373a7d={},_0x4c4a47={'count':0x0,'rows':[]};var _0x35f757=_['map'](db[_0x4db9('0x2d')][_0x4db9('0x2e')],function(_0x1e7840){return{'name':_0x1e7840[_0x4db9('0x2f')],'type':_0x1e7840[_0x4db9('0x30')]['key']};});_0x373a7d[_0x4db9('0x31')]=_[_0x4db9('0x32')](_0x35f757,_0x4db9('0x2a'));_0x373a7d[_0x4db9('0x33')]=_['keys'](_0x384df5['query']);_0x373a7d[_0x4db9('0x34')]=_[_0x4db9('0x35')](_0x373a7d['model'],_0x373a7d['query']);_0x1d0dc2[_0x4db9('0x36')]=_['intersection'](_0x373a7d['model'],qs[_0x4db9('0x37')](_0x384df5[_0x4db9('0x33')]['fields']));_0x1d0dc2[_0x4db9('0x36')]=_0x1d0dc2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x1d0dc2[_0x4db9('0x36')]:_0x373a7d['model'];if(!_0x384df5[_0x4db9('0x33')]['hasOwnProperty']('nolimit')){_0x1d0dc2['limit']=qs[_0x4db9('0x1f')](_0x384df5[_0x4db9('0x33')]['limit']);_0x1d0dc2[_0x4db9('0x1d')]=qs[_0x4db9('0x1d')](_0x384df5['query']['offset']);}_0x1d0dc2['order']=qs[_0x4db9('0x39')](_0x384df5['query'][_0x4db9('0x39')]);_0x1d0dc2['where']=qs[_0x4db9('0x34')](_[_0x4db9('0x3a')](_0x384df5[_0x4db9('0x33')],_0x373a7d[_0x4db9('0x34')]),_0x35f757);if(_0x384df5[_0x4db9('0x33')]['filter']){_0x1d0dc2[_0x4db9('0x3b')]=_['merge'](_0x1d0dc2[_0x4db9('0x3b')],{'$or':_[_0x4db9('0x32')](_0x35f757,function(_0x15929e){if(_0x15929e[_0x4db9('0x30')]!==_0x4db9('0x3c')){var _0x4159d2={};_0x4159d2[_0x15929e['name']]={'$like':'%'+_0x384df5[_0x4db9('0x33')][_0x4db9('0x3d')]+'%'};return _0x4159d2;}})});}_0x1d0dc2=_['merge']({},_0x1d0dc2,_0x384df5['options']);var _0x404af3={'where':_0x1d0dc2[_0x4db9('0x3b')]};return db[_0x4db9('0x2d')][_0x4db9('0x20')](_0x404af3)[_0x4db9('0x27')](function(_0x36a648){_0x4c4a47[_0x4db9('0x20')]=_0x36a648;if(_0x384df5[_0x4db9('0x33')][_0x4db9('0x3e')]){_0x1d0dc2[_0x4db9('0x3f')]=[{'all':!![]}];}return db[_0x4db9('0x2d')][_0x4db9('0x40')](_0x1d0dc2);})['then'](function(_0x2716d6){_0x4c4a47[_0x4db9('0x41')]=_0x2716d6;return _0x4c4a47;})[_0x4db9('0x27')](respondWithFilteredResult(_0x3c3fcf,_0x1d0dc2))[_0x4db9('0x42')](handleError(_0x3c3fcf,null));};exports['show']=function(_0x57d32d,_0x248891){var _0x2b18a2={'raw':!![],'where':{'id':_0x57d32d['params']['id']}},_0x2fc233={};_0x2fc233[_0x4db9('0x31')]=_['keys'](db[_0x4db9('0x2d')][_0x4db9('0x2e')]);_0x2fc233[_0x4db9('0x33')]=_[_0x4db9('0x43')](_0x57d32d[_0x4db9('0x33')]);_0x2fc233['filters']=_[_0x4db9('0x35')](_0x2fc233[_0x4db9('0x31')],_0x2fc233[_0x4db9('0x33')]);_0x2b18a2[_0x4db9('0x36')]=_[_0x4db9('0x35')](_0x2fc233['model'],qs[_0x4db9('0x37')](_0x57d32d[_0x4db9('0x33')][_0x4db9('0x37')]));_0x2b18a2[_0x4db9('0x36')]=_0x2b18a2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x2b18a2[_0x4db9('0x36')]:_0x2fc233[_0x4db9('0x31')];if(_0x57d32d[_0x4db9('0x33')]['includeAll']){_0x2b18a2[_0x4db9('0x3f')]=[{'all':!![]}];}_0x2b18a2=_['merge']({},_0x2b18a2,_0x57d32d['options']);return db[_0x4db9('0x2d')][_0x4db9('0x44')](_0x2b18a2)['then'](handleEntityNotFound(_0x248891,null))['then'](respondWithResult(_0x248891,null))[_0x4db9('0x42')](handleError(_0x248891,null));};exports[_0x4db9('0x45')]=function(_0x3fc788,_0x7f0aac){return db[_0x4db9('0x2d')][_0x4db9('0x45')](_0x3fc788[_0x4db9('0x46')],{})[_0x4db9('0x27')](respondWithResult(_0x7f0aac,0xc9))[_0x4db9('0x42')](handleError(_0x7f0aac,null));};exports[_0x4db9('0x26')]=function(_0x43312c,_0x5495de){if(_0x43312c[_0x4db9('0x46')]['id']){delete _0x43312c[_0x4db9('0x46')]['id'];}return db['Cdr'][_0x4db9('0x44')]({'where':{'id':_0x43312c['params']['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x5495de,null))[_0x4db9('0x27')](saveUpdates(_0x43312c[_0x4db9('0x46')],null))[_0x4db9('0x27')](respondWithResult(_0x5495de,null))[_0x4db9('0x42')](handleError(_0x5495de,null));};exports[_0x4db9('0x47')]=function(_0x3f1aac,_0x3b8d8c){return db[_0x4db9('0x2d')][_0x4db9('0x44')]({'where':{'id':_0x3f1aac[_0x4db9('0x48')]['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x3b8d8c,null))[_0x4db9('0x27')](removeEntity(_0x3b8d8c,null))['catch'](handleError(_0x3b8d8c,null));};exports['describe']=function(_0x5ececc,_0x161e2e){return db['Cdr'][_0x4db9('0x49')]()['then'](respondWithResult(_0x161e2e,null))[_0x4db9('0x42')](handleError(_0x161e2e,null));};
\ No newline at end of file
+var _0x99c9=['merge','options','include','rows','catch','show','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','end','stack','name','map','Cdr','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','VIRTUAL','filter'];(function(_0x3b22d9,_0x1569bb){var _0x281a9a=function(_0x436e9a){while(--_0x436e9a){_0x3b22d9['push'](_0x3b22d9['shift']());}};_0x281a9a(++_0x1569bb);}(_0x99c9,0x13c));var _0x999c=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x99c9[_0x29d915];return _0x160f86;};'use strict';var emlformat=require(_0x999c('0x0'));var rimraf=require(_0x999c('0x1'));var zipdir=require(_0x999c('0x2'));var jsonpatch=require(_0x999c('0x3'));var rp=require(_0x999c('0x4'));var moment=require(_0x999c('0x5'));var BPromise=require(_0x999c('0x6'));var Mustache=require('mustache');var util=require(_0x999c('0x7'));var path=require(_0x999c('0x8'));var sox=require(_0x999c('0x9'));var csv=require(_0x999c('0xa'));var ejs=require(_0x999c('0xb'));var fs=require('fs');var fs_extra=require(_0x999c('0xc'));var _=require(_0x999c('0xd'));var squel=require(_0x999c('0xe'));var crypto=require(_0x999c('0xf'));var jsforce=require(_0x999c('0x10'));var deskjs=require(_0x999c('0x11'));var toCsv=require(_0x999c('0xa'));var querystring=require(_0x999c('0x12'));var Papa=require(_0x999c('0x13'));var Redis=require('ioredis');var authService=require(_0x999c('0x14'));var qs=require(_0x999c('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x999c('0x16'));var logger=require(_0x999c('0x17'))(_0x999c('0x18'));var utils=require(_0x999c('0x19'));var config=require(_0x999c('0x1a'));var licenseUtil=require(_0x999c('0x1b'));var db=require(_0x999c('0x1c'))['db'];function respondWithStatusCode(_0x3d7c6d,_0x2e5f7e){_0x2e5f7e=_0x2e5f7e||0xcc;return function(_0x44a5bc){if(_0x44a5bc){return _0x3d7c6d[_0x999c('0x1d')](_0x2e5f7e);}return _0x3d7c6d[_0x999c('0x1e')](_0x2e5f7e)['end']();};}function respondWithResult(_0x15f812,_0xd14862){_0xd14862=_0xd14862||0xc8;return function(_0x4f2916){if(_0x4f2916){return _0x15f812['status'](_0xd14862)['json'](_0x4f2916);}};}function respondWithFilteredResult(_0x161434,_0xb3e981){return function(_0x203a73){if(_0x203a73){var _0x116f08=typeof _0xb3e981[_0x999c('0x1f')]==='undefined'&&typeof _0xb3e981[_0x999c('0x20')]===_0x999c('0x21');var _0x2b6126=_0x203a73[_0x999c('0x22')];var _0x110486=_0x116f08?0x0:_0xb3e981['offset'];var _0x1b327f=_0x116f08?_0x203a73[_0x999c('0x22')]:_0xb3e981[_0x999c('0x1f')]+_0xb3e981[_0x999c('0x20')];var _0x32c66c;if(_0x1b327f>=_0x2b6126){_0x1b327f=_0x2b6126;_0x32c66c=0xc8;}else{_0x32c66c=0xce;}_0x161434['status'](_0x32c66c);return _0x161434[_0x999c('0x23')](_0x999c('0x24'),_0x110486+'-'+_0x1b327f+'/'+_0x2b6126)[_0x999c('0x25')](_0x203a73);}return null;};}function patchUpdates(_0x1ec406){return function(_0xceb421){try{jsonpatch[_0x999c('0x26')](_0xceb421,_0x1ec406,!![]);}catch(_0x4a2865){return BPromise[_0x999c('0x27')](_0x4a2865);}return _0xceb421[_0x999c('0x28')]();};}function saveUpdates(_0x24f637,_0x2bcfc9){return function(_0x1c6e55){if(_0x1c6e55){return _0x1c6e55[_0x999c('0x29')](_0x24f637)[_0x999c('0x2a')](function(_0x2a7986){return _0x2a7986;});}return null;};}function removeEntity(_0x4002d2,_0x281720){return function(_0x2cfd83){if(_0x2cfd83){return _0x2cfd83['destroy']()[_0x999c('0x2a')](function(){_0x4002d2[_0x999c('0x1e')](0xcc)[_0x999c('0x2b')]();});}};}function handleEntityNotFound(_0x2e9d58,_0x2256fd){return function(_0x15d102){if(!_0x15d102){_0x2e9d58['sendStatus'](0x194);}return _0x15d102;};}function handleError(_0x4755c2,_0x43293f){_0x43293f=_0x43293f||0x1f4;return function(_0x1c866f){logger['error'](_0x1c866f[_0x999c('0x2c')]);if(_0x1c866f[_0x999c('0x2d')]){delete _0x1c866f['name'];}_0x4755c2[_0x999c('0x1e')](_0x43293f)['send'](_0x1c866f);};}exports['index']=function(_0xedf57d,_0x42cb25){var _0x457df3={},_0x2de6d5={},_0x3737e9={'count':0x0,'rows':[]};var _0x42c2e8=_[_0x999c('0x2e')](db[_0x999c('0x2f')][_0x999c('0x30')],function(_0x3b836a){return{'name':_0x3b836a['fieldName'],'type':_0x3b836a[_0x999c('0x31')][_0x999c('0x32')]};});_0x2de6d5[_0x999c('0x33')]=_[_0x999c('0x2e')](_0x42c2e8,_0x999c('0x2d'));_0x2de6d5[_0x999c('0x34')]=_[_0x999c('0x35')](_0xedf57d[_0x999c('0x34')]);_0x2de6d5['filters']=_['intersection'](_0x2de6d5[_0x999c('0x33')],_0x2de6d5[_0x999c('0x34')]);_0x457df3[_0x999c('0x36')]=_[_0x999c('0x37')](_0x2de6d5['model'],qs[_0x999c('0x38')](_0xedf57d[_0x999c('0x34')][_0x999c('0x38')]));_0x457df3[_0x999c('0x36')]=_0x457df3['attributes']['length']?_0x457df3[_0x999c('0x36')]:_0x2de6d5[_0x999c('0x33')];if(!_0xedf57d[_0x999c('0x34')][_0x999c('0x39')](_0x999c('0x3a'))){_0x457df3[_0x999c('0x20')]=qs[_0x999c('0x20')](_0xedf57d['query']['limit']);_0x457df3['offset']=qs[_0x999c('0x1f')](_0xedf57d[_0x999c('0x34')]['offset']);}_0x457df3['order']=qs['sort'](_0xedf57d[_0x999c('0x34')][_0x999c('0x3b')]);_0x457df3[_0x999c('0x3c')]=qs[_0x999c('0x3d')](_['pick'](_0xedf57d[_0x999c('0x34')],_0x2de6d5[_0x999c('0x3d')]),_0x42c2e8);if(_0xedf57d['query']['filter']){_0x457df3[_0x999c('0x3c')]=_['merge'](_0x457df3[_0x999c('0x3c')],{'$or':_['map'](_0x42c2e8,function(_0x3605a3){if(_0x3605a3[_0x999c('0x31')]!==_0x999c('0x3e')){var _0xcd729={};_0xcd729[_0x3605a3['name']]={'$like':'%'+_0xedf57d['query'][_0x999c('0x3f')]+'%'};return _0xcd729;}})});}_0x457df3=_[_0x999c('0x40')]({},_0x457df3,_0xedf57d[_0x999c('0x41')]);var _0xf26ba3={'where':_0x457df3['where']};return db[_0x999c('0x2f')][_0x999c('0x22')](_0xf26ba3)[_0x999c('0x2a')](function(_0x5fa1de){_0x3737e9['count']=_0x5fa1de;if(_0xedf57d[_0x999c('0x34')]['includeAll']){_0x457df3[_0x999c('0x42')]=[{'all':!![]}];}return db[_0x999c('0x2f')]['findAll'](_0x457df3);})[_0x999c('0x2a')](function(_0x357915){_0x3737e9[_0x999c('0x43')]=_0x357915;return _0x3737e9;})[_0x999c('0x2a')](respondWithFilteredResult(_0x42cb25,_0x457df3))[_0x999c('0x44')](handleError(_0x42cb25,null));};exports[_0x999c('0x45')]=function(_0xa6b0f1,_0x3edf69){var _0x4ef478={'raw':!![],'where':{'id':_0xa6b0f1['params']['id']}},_0x563e11={};_0x563e11['model']=_[_0x999c('0x35')](db[_0x999c('0x2f')][_0x999c('0x30')]);_0x563e11[_0x999c('0x34')]=_[_0x999c('0x35')](_0xa6b0f1['query']);_0x563e11[_0x999c('0x3d')]=_[_0x999c('0x37')](_0x563e11[_0x999c('0x33')],_0x563e11[_0x999c('0x34')]);_0x4ef478[_0x999c('0x36')]=_['intersection'](_0x563e11[_0x999c('0x33')],qs[_0x999c('0x38')](_0xa6b0f1[_0x999c('0x34')][_0x999c('0x38')]));_0x4ef478[_0x999c('0x36')]=_0x4ef478[_0x999c('0x36')][_0x999c('0x46')]?_0x4ef478[_0x999c('0x36')]:_0x563e11[_0x999c('0x33')];if(_0xa6b0f1['query']['includeAll']){_0x4ef478[_0x999c('0x42')]=[{'all':!![]}];}_0x4ef478=_[_0x999c('0x40')]({},_0x4ef478,_0xa6b0f1[_0x999c('0x41')]);return db[_0x999c('0x2f')][_0x999c('0x47')](_0x4ef478)[_0x999c('0x2a')](handleEntityNotFound(_0x3edf69,null))[_0x999c('0x2a')](respondWithResult(_0x3edf69,null))[_0x999c('0x44')](handleError(_0x3edf69,null));};exports[_0x999c('0x48')]=function(_0x26ebd7,_0x3457d6){return db['Cdr'][_0x999c('0x48')](_0x26ebd7[_0x999c('0x49')],{})[_0x999c('0x2a')](respondWithResult(_0x3457d6,0xc9))[_0x999c('0x44')](handleError(_0x3457d6,null));};exports[_0x999c('0x29')]=function(_0x386be6,_0x11f3bf){if(_0x386be6[_0x999c('0x49')]['id']){delete _0x386be6['body']['id'];}return db[_0x999c('0x2f')][_0x999c('0x47')]({'where':{'id':_0x386be6[_0x999c('0x4a')]['id']}})[_0x999c('0x2a')](handleEntityNotFound(_0x11f3bf,null))[_0x999c('0x2a')](saveUpdates(_0x386be6[_0x999c('0x49')],null))[_0x999c('0x2a')](respondWithResult(_0x11f3bf,null))['catch'](handleError(_0x11f3bf,null));};exports['destroy']=function(_0x1139f6,_0x3f134a){return db[_0x999c('0x2f')][_0x999c('0x47')]({'where':{'id':_0x1139f6[_0x999c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f134a,null))[_0x999c('0x2a')](removeEntity(_0x3f134a,null))[_0x999c('0x44')](handleError(_0x3f134a,null));};exports[_0x999c('0x4b')]=function(_0x11cc72,_0x5c066e){return db[_0x999c('0x2f')]['describe']()[_0x999c('0x2a')](respondWithResult(_0x5c066e,null))[_0x999c('0x44')](handleError(_0x5c066e,null));};
\ No newline at end of file
index 198a701..f4a5677 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(_0x49f87b,_0x41908f){var _0x4ee2b6=function(_0x4b5fab){while(--_0x4b5fab){_0x49f87b['push'](_0x49f87b['shift']());}};_0x4ee2b6(++_0x41908f);}(_0x7a54,0x106));var _0x47a5=function(_0x514b5a,_0x1d05d8){_0x514b5a=_0x514b5a-0x0;var _0x29810a=_0x7a54[_0x514b5a];return _0x29810a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3f61c9,_0x35c04a){var _0xecf82=function(_0x33ccee){while(--_0x33ccee){_0x3f61c9['push'](_0x3f61c9['shift']());}};_0xecf82(++_0x35c04a);}(_0x7a54,0x106));var _0x47a5=function(_0x597357,_0x4a01cc){_0x597357=_0x597357-0x0;var _0x195f1d=_0x7a54[_0x597357];return _0x195f1d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
index 392e404..10c35c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeef8=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x404fb4,_0x508e6d){var _0x28992d=function(_0x56d9b7){while(--_0x56d9b7){_0x404fb4['push'](_0x404fb4['shift']());}};_0x28992d(++_0x508e6d);}(_0xeef8,0x1ad));var _0x8eef=function(_0x249bae,_0x39509a){_0x249bae=_0x249bae-0x0;var _0x5407f1=_0xeef8[_0x249bae];return _0x5407f1;};'use strict';var _=require(_0x8eef('0x0'));var util=require(_0x8eef('0x1'));var moment=require('moment');var BPromise=require(_0x8eef('0x2'));var rs=require(_0x8eef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8eef('0x4'))['db'];var utils=require(_0x8eef('0x5'));var logger=require(_0x8eef('0x6'))('rpc');var config=require(_0x8eef('0x7'));var jayson=require(_0x8eef('0x8'));var client=jayson[_0x8eef('0x9')][_0x8eef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381290,_0x478694,_0x489a90){return new BPromise(function(_0x5f4a83,_0x40b5f9){return client[_0x8eef('0xb')](_0x381290,_0x489a90)[_0x8eef('0xc')](function(_0x431b8c){logger[_0x8eef('0xd')]('Cdr,\x20%s,\x20%s',_0x478694,_0x8eef('0xe'));logger[_0x8eef('0xf')](_0x8eef('0x10'),_0x478694,_0x8eef('0xe'),JSON[_0x8eef('0x11')](_0x431b8c));if(_0x431b8c[_0x8eef('0x12')]){if(_0x431b8c[_0x8eef('0x12')][_0x8eef('0x13')]===0x1f4){logger[_0x8eef('0x12')]('Cdr,\x20%s,\x20%s',_0x478694,_0x431b8c[_0x8eef('0x12')]['message']);return _0x40b5f9(_0x431b8c[_0x8eef('0x12')]['message']);}logger[_0x8eef('0x12')]('Cdr,\x20%s,\x20%s',_0x478694,_0x431b8c[_0x8eef('0x12')]['message']);return _0x5f4a83(_0x431b8c['error'][_0x8eef('0x14')]);}else{logger['info'](_0x8eef('0x15'),_0x478694,_0x8eef('0xe'));_0x5f4a83(_0x431b8c[_0x8eef('0x16')][_0x8eef('0x14')]);}})[_0x8eef('0x17')](function(_0xf27091){logger[_0x8eef('0x12')]('Cdr,\x20%s,\x20%s',_0x478694,_0xf27091);_0x40b5f9(_0xf27091);});});}
\ No newline at end of file
+var _0xde4b=['../../config/logger','rpc','../../config/environment','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0xf36836,_0x5b3808){var _0x25cc8f=function(_0x29f834){while(--_0x29f834){_0xf36836['push'](_0xf36836['shift']());}};_0x25cc8f(++_0x5b3808);}(_0xde4b,0xca));var _0xbde4=function(_0x2ad5da,_0x31de5a){_0x2ad5da=_0x2ad5da-0x0;var _0x574d03=_0xde4b[_0x2ad5da];return _0x574d03;};'use strict';var _=require(_0xbde4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbde4('0x1'));var rs=require(_0xbde4('0x2'));var fs=require('fs');var Redis=require(_0xbde4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbde4('0x4'));var logger=require(_0xbde4('0x5'))(_0xbde4('0x6'));var config=require(_0xbde4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbde4('0x8')][_0xbde4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x172095,_0x13cc78,_0x2d92d0){return new BPromise(function(_0x13c764,_0x402ddf){return client[_0xbde4('0xa')](_0x172095,_0x2d92d0)[_0xbde4('0xb')](function(_0x333e13){logger['info'](_0xbde4('0xc'),_0x13cc78,_0xbde4('0xd'));logger[_0xbde4('0xe')](_0xbde4('0xf'),_0x13cc78,_0xbde4('0xd'),JSON[_0xbde4('0x10')](_0x333e13));if(_0x333e13['error']){if(_0x333e13[_0xbde4('0x11')][_0xbde4('0x12')]===0x1f4){logger[_0xbde4('0x11')](_0xbde4('0xc'),_0x13cc78,_0x333e13[_0xbde4('0x11')][_0xbde4('0x13')]);return _0x402ddf(_0x333e13['error'][_0xbde4('0x13')]);}logger['error'](_0xbde4('0xc'),_0x13cc78,_0x333e13[_0xbde4('0x11')][_0xbde4('0x13')]);return _0x13c764(_0x333e13[_0xbde4('0x11')][_0xbde4('0x13')]);}else{logger[_0xbde4('0x14')](_0xbde4('0xc'),_0x13cc78,_0xbde4('0xd'));_0x13c764(_0x333e13[_0xbde4('0x15')][_0xbde4('0x13')]);}})[_0xbde4('0x16')](function(_0x55c38f){logger[_0xbde4('0x11')](_0xbde4('0xc'),_0x13cc78,_0x55c38f);_0x402ddf(_0x55c38f);});});}
\ No newline at end of file
index a80baf7..c068263 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(_0x5cfaf5,_0x1c4530){var _0x30468e=function(_0x4b97ed){while(--_0x4b97ed){_0x5cfaf5['push'](_0x5cfaf5['shift']());}};_0x30468e(++_0x1c4530);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x27e2c8,_0x5f40a0){var _0x5454d4=function(_0x2cbef9){while(--_0x2cbef9){_0x27e2c8['push'](_0x27e2c8['shift']());}};_0x5454d4(++_0x5f40a0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
index ed058bc..bec1ada 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b7b=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x4add74,_0x41e997){var _0x64e1f2=function(_0x1c6985){while(--_0x1c6985){_0x4add74['push'](_0x4add74['shift']());}};_0x64e1f2(++_0x41e997);}(_0x4b7b,0x143));var _0xb4b7=function(_0x14fa9f,_0x4b9856){_0x14fa9f=_0x14fa9f-0x0;var _0x362f8d=_0x4b7b[_0x14fa9f];return _0x362f8d;};'use strict';var Sequelize=require('sequelize');module[_0xb4b7('0x0')]={'priority':{'type':Sequelize[_0xb4b7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb4b7('0x2')],'allowNull':![],'defaultValue':_0xb4b7('0x3')},'appdata':{'type':Sequelize[_0xb4b7('0x4')]()},'description':{'type':Sequelize[_0xb4b7('0x2')]},'interval':{'type':Sequelize[_0xb4b7('0x2')],'defaultValue':_0xb4b7('0x5')}};
\ No newline at end of file
+var _0xb73a=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb73a,0x177));var _0xab73=function(_0x1b7d22,_0x42b813){_0x1b7d22=_0x1b7d22-0x0;var _0x1e45ed=_0xb73a[_0x1b7d22];return _0x1e45ed;};'use strict';var Sequelize=require(_0xab73('0x0'));module[_0xab73('0x1')]={'priority':{'type':Sequelize[_0xab73('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xab73('0x3')],'allowNull':![],'defaultValue':_0xab73('0x4')},'appdata':{'type':Sequelize[_0xab73('0x5')]()},'description':{'type':Sequelize[_0xab73('0x3')]},'interval':{'type':Sequelize[_0xab73('0x3')],'defaultValue':_0xab73('0x6')}};
\ No newline at end of file
index 66dba03..0f67f90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19c3=['keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','include','merge','find','catch','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','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','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','show','params','model'];(function(_0x17b4cd,_0x428e1a){var _0x35449c=function(_0x3b0a1a){while(--_0x3b0a1a){_0x17b4cd['push'](_0x17b4cd['shift']());}};_0x35449c(++_0x428e1a);}(_0x19c3,0xf9));var _0x319c=function(_0x29b931,_0x109906){_0x29b931=_0x29b931-0x0;var _0xafbd90=_0x19c3[_0x29b931];return _0xafbd90;};'use strict';var emlformat=require(_0x319c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x319c('0x1'));var jsonpatch=require(_0x319c('0x2'));var rp=require('request-promise');var moment=require(_0x319c('0x3'));var BPromise=require(_0x319c('0x4'));var Mustache=require(_0x319c('0x5'));var util=require(_0x319c('0x6'));var path=require(_0x319c('0x7'));var sox=require(_0x319c('0x8'));var csv=require('to-csv');var ejs=require(_0x319c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x319c('0xa'));var squel=require(_0x319c('0xb'));var crypto=require(_0x319c('0xc'));var jsforce=require(_0x319c('0xd'));var deskjs=require(_0x319c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x319c('0xf'));var Papa=require(_0x319c('0x10'));var Redis=require(_0x319c('0x11'));var authService=require(_0x319c('0x12'));var qs=require(_0x319c('0x13'));var as=require(_0x319c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x319c('0x15'))('api');var utils=require(_0x319c('0x16'));var config=require(_0x319c('0x17'));var licenseUtil=require(_0x319c('0x18'));var db=require(_0x319c('0x19'))['db'];function respondWithStatusCode(_0x362f44,_0x3be537){_0x3be537=_0x3be537||0xcc;return function(_0x401fdb){if(_0x401fdb){return _0x362f44['sendStatus'](_0x3be537);}return _0x362f44['status'](_0x3be537)[_0x319c('0x1a')]();};}function respondWithResult(_0x2fb398,_0x4c246e){_0x4c246e=_0x4c246e||0xc8;return function(_0x372a50){if(_0x372a50){return _0x2fb398[_0x319c('0x1b')](_0x4c246e)[_0x319c('0x1c')](_0x372a50);}};}function respondWithFilteredResult(_0x2cd063,_0x23afe7){return function(_0xa9b5a7){if(_0xa9b5a7){var _0x29b26c=typeof _0x23afe7['offset']==='undefined'&&typeof _0x23afe7[_0x319c('0x1d')]===_0x319c('0x1e');var _0x53c939=_0xa9b5a7[_0x319c('0x1f')];var _0x49624c=_0x29b26c?0x0:_0x23afe7[_0x319c('0x20')];var _0x45a822=_0x29b26c?_0xa9b5a7[_0x319c('0x1f')]:_0x23afe7[_0x319c('0x20')]+_0x23afe7[_0x319c('0x1d')];var _0x1c11d3;if(_0x45a822>=_0x53c939){_0x45a822=_0x53c939;_0x1c11d3=0xc8;}else{_0x1c11d3=0xce;}_0x2cd063[_0x319c('0x1b')](_0x1c11d3);return _0x2cd063['set'](_0x319c('0x21'),_0x49624c+'-'+_0x45a822+'/'+_0x53c939)[_0x319c('0x1c')](_0xa9b5a7);}return null;};}function patchUpdates(_0x5bd273){return function(_0x500597){try{jsonpatch[_0x319c('0x22')](_0x500597,_0x5bd273,!![]);}catch(_0xc2e927){return BPromise[_0x319c('0x23')](_0xc2e927);}return _0x500597['save']();};}function saveUpdates(_0x3bc070,_0xe50337){return function(_0x386340){if(_0x386340){return _0x386340[_0x319c('0x24')](_0x3bc070)[_0x319c('0x25')](function(_0x4d2ace){return _0x4d2ace;});}return null;};}function removeEntity(_0x1d9dfd,_0x2444c8){return function(_0x4508a5){if(_0x4508a5){return _0x4508a5[_0x319c('0x26')]()[_0x319c('0x25')](function(){_0x1d9dfd['status'](0xcc)[_0x319c('0x1a')]();});}};}function handleEntityNotFound(_0x4f87f8,_0x2cf97b){return function(_0x5fcf3c){if(!_0x5fcf3c){_0x4f87f8['sendStatus'](0x194);}return _0x5fcf3c;};}function handleError(_0x46e747,_0x5d93b9){_0x5d93b9=_0x5d93b9||0x1f4;return function(_0x4273de){logger[_0x319c('0x27')](_0x4273de[_0x319c('0x28')]);if(_0x4273de[_0x319c('0x29')]){delete _0x4273de[_0x319c('0x29')];}_0x46e747[_0x319c('0x1b')](_0x5d93b9)[_0x319c('0x2a')](_0x4273de);};}exports[_0x319c('0x2b')]=function(_0x363362,_0x5cf5de){var _0x2a7421={'raw':!![],'where':{'id':_0x363362[_0x319c('0x2c')]['id']}},_0x2591c6={};_0x2591c6[_0x319c('0x2d')]=_[_0x319c('0x2e')](db[_0x319c('0x2f')][_0x319c('0x30')]);_0x2591c6[_0x319c('0x31')]=_[_0x319c('0x2e')](_0x363362['query']);_0x2591c6[_0x319c('0x32')]=_[_0x319c('0x33')](_0x2591c6[_0x319c('0x2d')],_0x2591c6[_0x319c('0x31')]);_0x2a7421['attributes']=_[_0x319c('0x33')](_0x2591c6[_0x319c('0x2d')],qs[_0x319c('0x34')](_0x363362['query'][_0x319c('0x34')]));_0x2a7421['attributes']=_0x2a7421[_0x319c('0x35')]['length']?_0x2a7421[_0x319c('0x35')]:_0x2591c6[_0x319c('0x2d')];if(_0x363362[_0x319c('0x31')]['includeAll']){_0x2a7421[_0x319c('0x36')]=[{'all':!![]}];}_0x2a7421=_[_0x319c('0x37')]({},_0x2a7421,_0x363362['options']);return db[_0x319c('0x2f')][_0x319c('0x38')](_0x2a7421)[_0x319c('0x25')](handleEntityNotFound(_0x5cf5de,null))[_0x319c('0x25')](respondWithResult(_0x5cf5de,null))[_0x319c('0x39')](handleError(_0x5cf5de,null));};exports['update']=function(_0x9c47df,_0x220a8c){if(_0x9c47df[_0x319c('0x3a')]['id']){delete _0x9c47df[_0x319c('0x3a')]['id'];}return db[_0x319c('0x2f')][_0x319c('0x38')]({'where':{'id':_0x9c47df[_0x319c('0x2c')]['id']}})[_0x319c('0x25')](handleEntityNotFound(_0x220a8c,null))[_0x319c('0x25')](saveUpdates(_0x9c47df['body'],null))[_0x319c('0x25')](respondWithResult(_0x220a8c,null))[_0x319c('0x39')](handleError(_0x220a8c,null));};exports[_0x319c('0x26')]=function(_0x176d3f,_0x5b280e){return db[_0x319c('0x2f')][_0x319c('0x38')]({'where':{'id':_0x176d3f[_0x319c('0x2c')]['id']}})[_0x319c('0x25')](handleEntityNotFound(_0x5b280e,null))[_0x319c('0x25')](removeEntity(_0x5b280e,null))[_0x319c('0x39')](handleError(_0x5b280e,null));};
\ No newline at end of file
+var _0x6427=['fast-json-patch','request-promise','moment','bluebird','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','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','status','stack','name','send','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','body','params','catch','rimraf','zip-dir'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x6427,0xbe));var _0x7642=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6427[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7642('0x0'));var zipdir=require(_0x7642('0x1'));var jsonpatch=require(_0x7642('0x2'));var rp=require(_0x7642('0x3'));var moment=require(_0x7642('0x4'));var BPromise=require(_0x7642('0x5'));var Mustache=require('mustache');var util=require(_0x7642('0x6'));var path=require(_0x7642('0x7'));var sox=require(_0x7642('0x8'));var csv=require(_0x7642('0x9'));var ejs=require(_0x7642('0xa'));var fs=require('fs');var fs_extra=require(_0x7642('0xb'));var _=require(_0x7642('0xc'));var squel=require(_0x7642('0xd'));var crypto=require(_0x7642('0xe'));var jsforce=require(_0x7642('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7642('0x10'));var Papa=require(_0x7642('0x11'));var Redis=require(_0x7642('0x12'));var authService=require(_0x7642('0x13'));var qs=require(_0x7642('0x14'));var as=require(_0x7642('0x15'));var hardwareService=require(_0x7642('0x16'));var logger=require(_0x7642('0x17'))(_0x7642('0x18'));var utils=require(_0x7642('0x19'));var config=require(_0x7642('0x1a'));var licenseUtil=require(_0x7642('0x1b'));var db=require(_0x7642('0x1c'))['db'];function respondWithStatusCode(_0x3e5f50,_0x3c1291){_0x3c1291=_0x3c1291||0xcc;return function(_0x32e5c9){if(_0x32e5c9){return _0x3e5f50[_0x7642('0x1d')](_0x3c1291);}return _0x3e5f50['status'](_0x3c1291)[_0x7642('0x1e')]();};}function respondWithResult(_0x3adb30,_0x4930f4){_0x4930f4=_0x4930f4||0xc8;return function(_0x146ef9){if(_0x146ef9){return _0x3adb30['status'](_0x4930f4)[_0x7642('0x1f')](_0x146ef9);}};}function respondWithFilteredResult(_0x506c94,_0x1aa890){return function(_0x37964a){if(_0x37964a){var _0x3b87aa=typeof _0x1aa890[_0x7642('0x20')]===_0x7642('0x21')&&typeof _0x1aa890[_0x7642('0x22')]===_0x7642('0x21');var _0x4b04a7=_0x37964a[_0x7642('0x23')];var _0x392686=_0x3b87aa?0x0:_0x1aa890[_0x7642('0x20')];var _0x96bc79=_0x3b87aa?_0x37964a['count']:_0x1aa890['offset']+_0x1aa890[_0x7642('0x22')];var _0x42db03;if(_0x96bc79>=_0x4b04a7){_0x96bc79=_0x4b04a7;_0x42db03=0xc8;}else{_0x42db03=0xce;}_0x506c94['status'](_0x42db03);return _0x506c94[_0x7642('0x24')](_0x7642('0x25'),_0x392686+'-'+_0x96bc79+'/'+_0x4b04a7)['json'](_0x37964a);}return null;};}function patchUpdates(_0x503c13){return function(_0xb6b0c4){try{jsonpatch[_0x7642('0x26')](_0xb6b0c4,_0x503c13,!![]);}catch(_0x580573){return BPromise['reject'](_0x580573);}return _0xb6b0c4[_0x7642('0x27')]();};}function saveUpdates(_0xc23c3,_0x37de2b){return function(_0x4f55d4){if(_0x4f55d4){return _0x4f55d4[_0x7642('0x28')](_0xc23c3)[_0x7642('0x29')](function(_0x508265){return _0x508265;});}return null;};}function removeEntity(_0x606a05,_0x812f9){return function(_0xf31489){if(_0xf31489){return _0xf31489[_0x7642('0x2a')]()['then'](function(){_0x606a05[_0x7642('0x2b')](0xcc)[_0x7642('0x1e')]();});}};}function handleEntityNotFound(_0x1b8eac,_0x15148a){return function(_0x5b74c3){if(!_0x5b74c3){_0x1b8eac[_0x7642('0x1d')](0x194);}return _0x5b74c3;};}function handleError(_0x5c2750,_0x1993e3){_0x1993e3=_0x1993e3||0x1f4;return function(_0x2083f6){logger['error'](_0x2083f6[_0x7642('0x2c')]);if(_0x2083f6[_0x7642('0x2d')]){delete _0x2083f6[_0x7642('0x2d')];}_0x5c2750['status'](_0x1993e3)[_0x7642('0x2e')](_0x2083f6);};}exports['show']=function(_0x3f4764,_0x6e04c5){var _0x4a4fee={'raw':!![],'where':{'id':_0x3f4764['params']['id']}},_0x788aa9={};_0x788aa9[_0x7642('0x2f')]=_[_0x7642('0x30')](db[_0x7642('0x31')][_0x7642('0x32')]);_0x788aa9[_0x7642('0x33')]=_[_0x7642('0x30')](_0x3f4764[_0x7642('0x33')]);_0x788aa9[_0x7642('0x34')]=_[_0x7642('0x35')](_0x788aa9[_0x7642('0x2f')],_0x788aa9[_0x7642('0x33')]);_0x4a4fee[_0x7642('0x36')]=_['intersection'](_0x788aa9['model'],qs[_0x7642('0x37')](_0x3f4764[_0x7642('0x33')][_0x7642('0x37')]));_0x4a4fee['attributes']=_0x4a4fee[_0x7642('0x36')][_0x7642('0x38')]?_0x4a4fee['attributes']:_0x788aa9[_0x7642('0x2f')];if(_0x3f4764['query'][_0x7642('0x39')]){_0x4a4fee[_0x7642('0x3a')]=[{'all':!![]}];}_0x4a4fee=_[_0x7642('0x3b')]({},_0x4a4fee,_0x3f4764['options']);return db['ChatApplication'][_0x7642('0x3c')](_0x4a4fee)['then'](handleEntityNotFound(_0x6e04c5,null))['then'](respondWithResult(_0x6e04c5,null))['catch'](handleError(_0x6e04c5,null));};exports['update']=function(_0x3dd01f,_0x160c10){if(_0x3dd01f[_0x7642('0x3d')]['id']){delete _0x3dd01f[_0x7642('0x3d')]['id'];}return db[_0x7642('0x31')][_0x7642('0x3c')]({'where':{'id':_0x3dd01f[_0x7642('0x3e')]['id']}})[_0x7642('0x29')](handleEntityNotFound(_0x160c10,null))[_0x7642('0x29')](saveUpdates(_0x3dd01f[_0x7642('0x3d')],null))['then'](respondWithResult(_0x160c10,null))['catch'](handleError(_0x160c10,null));};exports['destroy']=function(_0xc5edf3,_0x22ed74){return db[_0x7642('0x31')][_0x7642('0x3c')]({'where':{'id':_0xc5edf3[_0x7642('0x3e')]['id']}})[_0x7642('0x29')](handleEntityNotFound(_0x22ed74,null))[_0x7642('0x29')](removeEntity(_0x22ed74,null))[_0x7642('0x3f')](handleError(_0x22ed74,null));};
\ No newline at end of file
index 27b412b..0b4ce37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef28=['./chatApplication.attributes','define','ChatApplication','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xef28,0x71));var _0x8ef2=function(_0xf7077d,_0x309ea1){_0xf7077d=_0xf7077d-0x0;var _0x19ff53=_0xef28[_0xf7077d];return _0x19ff53;};'use strict';var _=require(_0x8ef2('0x0'));var util=require(_0x8ef2('0x1'));var logger=require(_0x8ef2('0x2'))(_0x8ef2('0x3'));var moment=require(_0x8ef2('0x4'));var BPromise=require(_0x8ef2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ef2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8ef2('0x7'));module['exports']=function(_0x354662,_0x61b5ee){return _0x354662[_0x8ef2('0x8')](_0x8ef2('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5f96=['exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatApplication.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f96,0x75));var _0x65f9=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x5f96[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x65f9('0x0'));var util=require(_0x65f9('0x1'));var logger=require(_0x65f9('0x2'))(_0x65f9('0x3'));var moment=require(_0x65f9('0x4'));var BPromise=require(_0x65f9('0x5'));var rp=require(_0x65f9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x65f9('0x7'));var config=require('../../config/environment');var attributes=require(_0x65f9('0x8'));module[_0x65f9('0x9')]=function(_0x5607f5,_0x41efdb){return _0x5607f5[_0x65f9('0xa')]('ChatApplication',attributes,{'tableName':_0x65f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x65f9('0xc'),'collate':_0x65f9('0xd')});};
\ No newline at end of file
index 813f9bf..b5e2927 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfbb=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xbfbb,0x1d7));var _0xbbfb=function(_0x43fbdb,_0x2bfc6e){_0x43fbdb=_0x43fbdb-0x0;var _0x3b6ab8=_0xbfbb[_0x43fbdb];return _0x3b6ab8;};'use strict';var _=require(_0xbbfb('0x0'));var util=require(_0xbbfb('0x1'));var moment=require('moment');var BPromise=require(_0xbbfb('0x2'));var rs=require(_0xbbfb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbfb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbbfb('0x5'))(_0xbbfb('0x6'));var config=require(_0xbbfb('0x7'));var jayson=require(_0xbbfb('0x8'));var client=jayson[_0xbbfb('0x9')][_0xbbfb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38f91a,_0x329b85,_0x30bd77){return new BPromise(function(_0x4e8da5,_0x233431){return client['request'](_0x38f91a,_0x30bd77)[_0xbbfb('0xb')](function(_0x26c49e){logger['info'](_0xbbfb('0xc'),_0x329b85,_0xbbfb('0xd'));logger[_0xbbfb('0xe')](_0xbbfb('0xf'),_0x329b85,_0xbbfb('0xd'),JSON[_0xbbfb('0x10')](_0x26c49e));if(_0x26c49e[_0xbbfb('0x11')]){if(_0x26c49e['error']['code']===0x1f4){logger['error'](_0xbbfb('0xc'),_0x329b85,_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);return _0x233431(_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);}logger[_0xbbfb('0x11')](_0xbbfb('0xc'),_0x329b85,_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);return _0x4e8da5(_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);}else{logger['info'](_0xbbfb('0xc'),_0x329b85,_0xbbfb('0xd'));_0x4e8da5(_0x26c49e[_0xbbfb('0x13')][_0xbbfb('0x12')]);}})[_0xbbfb('0x14')](function(_0x54a1f8){logger[_0xbbfb('0x11')](_0xbbfb('0xc'),_0x329b85,_0x54a1f8);_0x233431(_0x54a1f8);});});}
\ No newline at end of file
+var _0x968c=['client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2a43b9,_0x2aa7ea){var _0x3b6c90=function(_0x5be37f){while(--_0x5be37f){_0x2a43b9['push'](_0x2a43b9['shift']());}};_0x3b6c90(++_0x2aa7ea);}(_0x968c,0xc4));var _0xc968=function(_0x474b54,_0x4bc155){_0x474b54=_0x474b54-0x0;var _0x508117=_0x968c[_0x474b54];return _0x508117;};'use strict';var _=require(_0xc968('0x0'));var util=require(_0xc968('0x1'));var moment=require(_0xc968('0x2'));var BPromise=require(_0xc968('0x3'));var rs=require(_0xc968('0x4'));var fs=require('fs');var Redis=require(_0xc968('0x5'));var db=require(_0xc968('0x6'))['db'];var utils=require(_0xc968('0x7'));var logger=require(_0xc968('0x8'))(_0xc968('0x9'));var config=require(_0xc968('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc968('0xb')][_0xc968('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x421ac8,_0x2b0b22,_0x3b6da1){return new BPromise(function(_0x4b1eb8,_0x2e4c89){return client['request'](_0x421ac8,_0x3b6da1)[_0xc968('0xd')](function(_0x2e17b5){logger[_0xc968('0xe')](_0xc968('0xf'),_0x2b0b22,_0xc968('0x10'));logger['debug'](_0xc968('0x11'),_0x2b0b22,_0xc968('0x10'),JSON[_0xc968('0x12')](_0x2e17b5));if(_0x2e17b5[_0xc968('0x13')]){if(_0x2e17b5[_0xc968('0x13')]['code']===0x1f4){logger['error'](_0xc968('0xf'),_0x2b0b22,_0x2e17b5[_0xc968('0x13')]['message']);return _0x2e4c89(_0x2e17b5[_0xc968('0x13')][_0xc968('0x14')]);}logger['error'](_0xc968('0xf'),_0x2b0b22,_0x2e17b5['error'][_0xc968('0x14')]);return _0x4b1eb8(_0x2e17b5[_0xc968('0x13')][_0xc968('0x14')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x2b0b22,_0xc968('0x10'));_0x4b1eb8(_0x2e17b5[_0xc968('0x15')][_0xc968('0x14')]);}})[_0xc968('0x16')](function(_0x25cf93){logger[_0xc968('0x13')](_0xc968('0xf'),_0x2b0b22,_0x25cf93);_0x2e4c89(_0x25cf93);});});}
\ No newline at end of file
index a04092f..3a0e223 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x871d=['exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','/:id','update','delete','destroy'];(function(_0x541cf4,_0x38ea3c){var _0x2093ec=function(_0x5bd8d7){while(--_0x5bd8d7){_0x541cf4['push'](_0x541cf4['shift']());}};_0x2093ec(++_0x38ea3c);}(_0x871d,0x187));var _0xd871=function(_0x38f771,_0x4587dd){_0x38f771=_0x38f771-0x0;var _0x2c562c=_0x871d[_0x38f771];return _0x2c562c;};'use strict';var multer=require(_0xd871('0x0'));var util=require('util');var path=require(_0xd871('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd871('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd871('0x3'));var interaction=require(_0xd871('0x4'));var config=require(_0xd871('0x5'));var controller=require('./chatApplication.controller');router[_0xd871('0x6')]('/:id',auth[_0xd871('0x7')](),controller[_0xd871('0x8')]);router[_0xd871('0x9')](_0xd871('0xa'),auth[_0xd871('0x7')](),controller[_0xd871('0xb')]);router[_0xd871('0xc')](_0xd871('0xa'),auth[_0xd871('0x7')](),controller[_0xd871('0xd')]);module[_0xd871('0xe')]=router;
\ No newline at end of file
+var _0xa912=['multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x388722,_0x25f54f){var _0x310adb=function(_0x554898){while(--_0x554898){_0x388722['push'](_0x388722['shift']());}};_0x310adb(++_0x25f54f);}(_0xa912,0x1dc));var _0x2a91=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xa912[_0x5a776b];return _0xbbef59;};'use strict';var multer=require(_0x2a91('0x0'));var util=require(_0x2a91('0x1'));var path=require(_0x2a91('0x2'));var timeout=require(_0x2a91('0x3'));var express=require(_0x2a91('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2a91('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2a91('0x6'));var controller=require(_0x2a91('0x7'));router['get'](_0x2a91('0x8'),auth[_0x2a91('0x9')](),controller['show']);router['put'](_0x2a91('0x8'),auth[_0x2a91('0x9')](),controller[_0x2a91('0xa')]);router[_0x2a91('0xb')](_0x2a91('0x8'),auth[_0x2a91('0x9')](),controller[_0x2a91('0xc')]);module[_0x2a91('0xd')]=router;
\ No newline at end of file
index 96c2647..14930de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['STRING','sequelize','exports'];(function(_0x199bdf,_0x3daaf6){var _0x287fdc=function(_0x36b976){while(--_0x36b976){_0x199bdf['push'](_0x199bdf['shift']());}};_0x287fdc(++_0x3daaf6);}(_0x2542,0x169));var _0x2254=function(_0x10353c,_0x162dac){_0x10353c=_0x10353c-0x0;var _0x20300e=_0x2542[_0x10353c];return _0x20300e;};'use strict';var Sequelize=require(_0x2254('0x0'));module[_0x2254('0x1')]={'name':{'type':Sequelize[_0x2254('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2254('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x0094=['BOOLEAN','STRING'];(function(_0xb2ca31,_0x1afb56){var _0x127594=function(_0x30c294){while(--_0x30c294){_0xb2ca31['push'](_0xb2ca31['shift']());}};_0x127594(++_0x1afb56);}(_0x0094,0x161));var _0x4009=function(_0xddecf0,_0x45e0d4){_0xddecf0=_0xddecf0-0x0;var _0x3b23ed=_0x0094[_0xddecf0];return _0x3b23ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4009('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4009('0x0')]},'write':{'type':Sequelize[_0x4009('0x1')],'defaultValue':!![]}};
\ No newline at end of file
index c06e754..f536ade 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25b4=['VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','set','save','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where'];(function(_0x350bd9,_0x7ee684){var _0x460756=function(_0x564516){while(--_0x564516){_0x350bd9['push'](_0x350bd9['shift']());}};_0x460756(++_0x7ee684);}(_0x25b4,0xe0));var _0x425b=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0x25b4[_0x3c59fc];return _0x2b78d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x425b('0x0'));var zipdir=require(_0x425b('0x1'));var jsonpatch=require(_0x425b('0x2'));var rp=require(_0x425b('0x3'));var moment=require('moment');var BPromise=require(_0x425b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x425b('0x5'));var sox=require(_0x425b('0x6'));var csv=require(_0x425b('0x7'));var ejs=require(_0x425b('0x8'));var fs=require('fs');var fs_extra=require(_0x425b('0x9'));var _=require(_0x425b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x425b('0xb'));var deskjs=require(_0x425b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x425b('0xd'));var Papa=require(_0x425b('0xe'));var Redis=require(_0x425b('0xf'));var authService=require(_0x425b('0x10'));var qs=require(_0x425b('0x11'));var as=require(_0x425b('0x12'));var hardwareService=require(_0x425b('0x13'));var logger=require(_0x425b('0x14'))('api');var utils=require(_0x425b('0x15'));var config=require(_0x425b('0x16'));var licenseUtil=require(_0x425b('0x17'));var db=require(_0x425b('0x18'))['db'];config[_0x425b('0x19')]=_[_0x425b('0x1a')](config[_0x425b('0x19')],{'host':_0x425b('0x1b'),'port':0x18eb});var socket=require(_0x425b('0x1c'))(new Redis(config[_0x425b('0x19')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x3fec83,_0x3b811a){_0x3b811a=_0x3b811a||0xcc;return function(_0x1d020d){if(_0x1d020d){return _0x3fec83['sendStatus'](_0x3b811a);}return _0x3fec83[_0x425b('0x1d')](_0x3b811a)[_0x425b('0x1e')]();};}function respondWithResult(_0xc83b96,_0x56a434){_0x56a434=_0x56a434||0xc8;return function(_0xf237a9){if(_0xf237a9){return _0xc83b96['status'](_0x56a434)[_0x425b('0x1f')](_0xf237a9);}};}function respondWithFilteredResult(_0x15c07f,_0x37c80d){return function(_0x46d1dc){if(_0x46d1dc){var _0x3f81b4=typeof _0x37c80d['offset']===_0x425b('0x20')&&typeof _0x37c80d[_0x425b('0x21')]===_0x425b('0x20');var _0x403b58=_0x46d1dc[_0x425b('0x22')];var _0x1f993c=_0x3f81b4?0x0:_0x37c80d[_0x425b('0x23')];var _0xa6008b=_0x3f81b4?_0x46d1dc['count']:_0x37c80d['offset']+_0x37c80d[_0x425b('0x21')];var _0x124784;if(_0xa6008b>=_0x403b58){_0xa6008b=_0x403b58;_0x124784=0xc8;}else{_0x124784=0xce;}_0x15c07f[_0x425b('0x1d')](_0x124784);return _0x15c07f[_0x425b('0x24')]('Content-Range',_0x1f993c+'-'+_0xa6008b+'/'+_0x403b58)[_0x425b('0x1f')](_0x46d1dc);}return null;};}function patchUpdates(_0x2efef0){return function(_0x3745dd){try{jsonpatch['apply'](_0x3745dd,_0x2efef0,!![]);}catch(_0x43d2a9){return BPromise['reject'](_0x43d2a9);}return _0x3745dd[_0x425b('0x25')]();};}function saveUpdates(_0x5842e9,_0x13ff96){return function(_0xceaeed){if(_0xceaeed){return _0xceaeed['update'](_0x5842e9)[_0x425b('0x26')](function(_0x559a24){return _0x559a24;});}return null;};}function removeEntity(_0x4656f2,_0x33d8b8){return function(_0x35cdcd){if(_0x35cdcd){return _0x35cdcd[_0x425b('0x27')]()[_0x425b('0x26')](function(){_0x4656f2[_0x425b('0x1d')](0xcc)[_0x425b('0x1e')]();});}};}function handleEntityNotFound(_0xab8ad0,_0xeb0120){return function(_0x420e4d){if(!_0x420e4d){_0xab8ad0[_0x425b('0x28')](0x194);}return _0x420e4d;};}function handleError(_0x393296,_0x20ae70){_0x20ae70=_0x20ae70||0x1f4;return function(_0x5cd58b){logger[_0x425b('0x29')](_0x5cd58b[_0x425b('0x2a')]);if(_0x5cd58b[_0x425b('0x2b')]){delete _0x5cd58b[_0x425b('0x2b')];}_0x393296[_0x425b('0x1d')](_0x20ae70)[_0x425b('0x2c')](_0x5cd58b);};}exports[_0x425b('0x2d')]=function(_0xdd2906,_0x3b1c03){var _0x1f53f1={},_0x5bb1d1={},_0x511697={'count':0x0,'rows':[]};var _0x3bc1df=_[_0x425b('0x2e')](db[_0x425b('0x2f')][_0x425b('0x30')],function(_0x511020){return{'name':_0x511020['fieldName'],'type':_0x511020[_0x425b('0x31')][_0x425b('0x32')]};});_0x5bb1d1['model']=_[_0x425b('0x2e')](_0x3bc1df,_0x425b('0x2b'));_0x5bb1d1['query']=_[_0x425b('0x33')](_0xdd2906[_0x425b('0x34')]);_0x5bb1d1[_0x425b('0x35')]=_[_0x425b('0x36')](_0x5bb1d1[_0x425b('0x37')],_0x5bb1d1[_0x425b('0x34')]);_0x1f53f1[_0x425b('0x38')]=_[_0x425b('0x36')](_0x5bb1d1[_0x425b('0x37')],qs[_0x425b('0x39')](_0xdd2906[_0x425b('0x34')][_0x425b('0x39')]));_0x1f53f1[_0x425b('0x38')]=_0x1f53f1[_0x425b('0x38')][_0x425b('0x3a')]?_0x1f53f1[_0x425b('0x38')]:_0x5bb1d1[_0x425b('0x37')];if(!_0xdd2906[_0x425b('0x34')][_0x425b('0x3b')]('nolimit')){_0x1f53f1['limit']=qs[_0x425b('0x21')](_0xdd2906[_0x425b('0x34')]['limit']);_0x1f53f1[_0x425b('0x23')]=qs['offset'](_0xdd2906[_0x425b('0x34')][_0x425b('0x23')]);}_0x1f53f1[_0x425b('0x3c')]=qs['sort'](_0xdd2906[_0x425b('0x34')][_0x425b('0x3d')]);_0x1f53f1['where']=qs[_0x425b('0x35')](_['pick'](_0xdd2906['query'],_0x5bb1d1[_0x425b('0x35')]),_0x3bc1df);if(_0xdd2906['query'][_0x425b('0x3e')]){_0x1f53f1[_0x425b('0x3f')]=_['merge'](_0x1f53f1[_0x425b('0x3f')],{'$or':_['map'](_0x3bc1df,function(_0x358e45){if(_0x358e45[_0x425b('0x31')]!==_0x425b('0x40')){var _0x24fbfa={};_0x24fbfa[_0x358e45[_0x425b('0x2b')]]={'$like':'%'+_0xdd2906['query'][_0x425b('0x3e')]+'%'};return _0x24fbfa;}})});}_0x1f53f1=_[_0x425b('0x41')]({},_0x1f53f1,_0xdd2906[_0x425b('0x42')]);var _0x52d478={'where':_0x1f53f1['where']};return db[_0x425b('0x2f')]['count'](_0x52d478)['then'](function(_0x4419c6){_0x511697['count']=_0x4419c6;if(_0xdd2906[_0x425b('0x34')][_0x425b('0x43')]){_0x1f53f1[_0x425b('0x44')]=[{'all':!![]}];}return db['ChatGroup'][_0x425b('0x45')](_0x1f53f1);})['then'](function(_0x8798fe){_0x511697[_0x425b('0x46')]=_0x8798fe;return _0x511697;})[_0x425b('0x26')](respondWithFilteredResult(_0x3b1c03,_0x1f53f1))[_0x425b('0x47')](handleError(_0x3b1c03,null));};exports[_0x425b('0x48')]=function(_0x4e9e91,_0x21bdfd){var _0x2cb9e3={'raw':!![],'where':{'id':_0x4e9e91['params']['id']}},_0x3ca7e8={};_0x3ca7e8[_0x425b('0x37')]=_[_0x425b('0x33')](db[_0x425b('0x2f')][_0x425b('0x30')]);_0x3ca7e8[_0x425b('0x34')]=_[_0x425b('0x33')](_0x4e9e91[_0x425b('0x34')]);_0x3ca7e8[_0x425b('0x35')]=_[_0x425b('0x36')](_0x3ca7e8['model'],_0x3ca7e8[_0x425b('0x34')]);_0x2cb9e3['attributes']=_[_0x425b('0x36')](_0x3ca7e8[_0x425b('0x37')],qs['fields'](_0x4e9e91[_0x425b('0x34')][_0x425b('0x39')]));_0x2cb9e3[_0x425b('0x38')]=_0x2cb9e3[_0x425b('0x38')][_0x425b('0x3a')]?_0x2cb9e3[_0x425b('0x38')]:_0x3ca7e8[_0x425b('0x37')];if(_0x4e9e91[_0x425b('0x34')][_0x425b('0x43')]){_0x2cb9e3[_0x425b('0x44')]=[{'all':!![]}];}_0x2cb9e3=_[_0x425b('0x41')]({},_0x2cb9e3,_0x4e9e91['options']);return db['ChatGroup'][_0x425b('0x49')](_0x2cb9e3)[_0x425b('0x26')](handleEntityNotFound(_0x21bdfd,null))['then'](respondWithResult(_0x21bdfd,null))['catch'](handleError(_0x21bdfd,null));};exports[_0x425b('0x4a')]=function(_0x3a9b70,_0x34ad34){return db[_0x425b('0x2f')][_0x425b('0x4a')](_0x3a9b70[_0x425b('0x4b')],{})['then'](respondWithResult(_0x34ad34,0xc9))[_0x425b('0x47')](handleError(_0x34ad34,null));};exports['update']=function(_0x1e9cc1,_0x347674){if(_0x1e9cc1['body']['id']){delete _0x1e9cc1[_0x425b('0x4b')]['id'];}return db[_0x425b('0x2f')][_0x425b('0x49')]({'where':{'id':_0x1e9cc1[_0x425b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x347674,null))['then'](saveUpdates(_0x1e9cc1['body'],null))[_0x425b('0x26')](respondWithResult(_0x347674,null))[_0x425b('0x47')](handleError(_0x347674,null));};exports[_0x425b('0x27')]=function(_0x58391b,_0x48859d){return db[_0x425b('0x2f')][_0x425b('0x49')]({'where':{'id':_0x58391b[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x48859d,null))[_0x425b('0x26')](removeEntity(_0x48859d,null))[_0x425b('0x47')](handleError(_0x48859d,null));};exports[_0x425b('0x4d')]=function(_0x45693d,_0x586842){return db[_0x425b('0x2f')][_0x425b('0x4d')]()[_0x425b('0x26')](respondWithResult(_0x586842,null))['catch'](handleError(_0x586842,null));};exports[_0x425b('0x4e')]=function(_0x183e3a,_0x4348fe,_0x30fc77){return db[_0x425b('0x4f')][_0x425b('0x22')]({'where':{'ChatGroupId':_0x183e3a[_0x425b('0x4c')]['id'],'ToId':_0x183e3a[_0x425b('0x50')]['id'],'read':![]}})[_0x425b('0x26')](function(_0x1a9ad9){return{'id':_[_0x425b('0x51')](_0x183e3a[_0x425b('0x4c')]['id']),'count':_0x1a9ad9};})[_0x425b('0x26')](respondWithResult(_0x4348fe,null))[_0x425b('0x47')](handleError(_0x4348fe,null));};exports[_0x425b('0x52')]=function(_0x79075c,_0x296982,_0x5ac032){return db[_0x425b('0x2f')]['find']({'where':{'id':_0x79075c[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x296982,null))[_0x425b('0x26')](function(_0x1d2b8a){if(_0x1d2b8a){return _0x1d2b8a[_0x425b('0x52')](_0x79075c[_0x425b('0x4b')][_0x425b('0x53')],_['omit'](_0x79075c['body'],[_0x425b('0x53'),'id'])||{});}})[_0x425b('0x26')](respondWithResult(_0x296982,null))[_0x425b('0x47')](handleError(_0x296982,null));};exports[_0x425b('0x54')]=function(_0x42d8d6,_0x49dfbb,_0x201a41){var _0x141759={};var _0x537148={};var _0xacc558;var _0x5e0837;return db[_0x425b('0x2f')][_0x425b('0x55')]({'where':{'id':_0x42d8d6[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x49dfbb,null))[_0x425b('0x26')](function(_0x365e79){if(_0x365e79){_0xacc558=_0x365e79;_0x537148['model']=_[_0x425b('0x33')](db[_0x425b('0x56')][_0x425b('0x30')]);_0x537148[_0x425b('0x34')]=_[_0x425b('0x33')](_0x42d8d6[_0x425b('0x34')]);_0x537148[_0x425b('0x35')]=_[_0x425b('0x36')](_0x537148[_0x425b('0x37')],_0x537148[_0x425b('0x34')]);_0x141759[_0x425b('0x38')]=_[_0x425b('0x36')](_0x537148[_0x425b('0x37')],qs[_0x425b('0x39')](_0x42d8d6['query'][_0x425b('0x39')]));_0x141759[_0x425b('0x38')]=_0x141759[_0x425b('0x38')][_0x425b('0x3a')]?_0x141759[_0x425b('0x38')]:_0x537148['model'];_0x141759['order']=qs[_0x425b('0x3d')](_0x42d8d6[_0x425b('0x34')][_0x425b('0x3d')]);_0x141759[_0x425b('0x3f')]=qs[_0x425b('0x35')](_['pick'](_0x42d8d6[_0x425b('0x34')],_0x537148[_0x425b('0x35')]));if(_0x42d8d6[_0x425b('0x34')][_0x425b('0x3e')]){_0x141759['where']=_['merge'](_0x141759['where'],{'$or':_['map'](_0x141759[_0x425b('0x38')],function(_0x37addc){var _0x1e6193={};_0x1e6193[_0x37addc]={'$like':'%'+_0x42d8d6[_0x425b('0x34')][_0x425b('0x3e')]+'%'};return _0x1e6193;})});}_0x141759=_['merge']({},_0x141759,_0x42d8d6['options']);return _0xacc558[_0x425b('0x54')](_0x141759);}})['then'](function(_0x16a93b){if(_0x16a93b){_0x5e0837=_0x16a93b[_0x425b('0x3a')];if(!_0x42d8d6[_0x425b('0x34')][_0x425b('0x3b')](_0x425b('0x57'))){_0x141759[_0x425b('0x21')]=qs[_0x425b('0x21')](_0x42d8d6[_0x425b('0x34')][_0x425b('0x21')]);_0x141759[_0x425b('0x23')]=qs[_0x425b('0x23')](_0x42d8d6[_0x425b('0x34')][_0x425b('0x23')]);}return _0xacc558[_0x425b('0x54')](_0x141759);}})[_0x425b('0x26')](function(_0x4113d5){if(_0x4113d5){return _0x4113d5?{'count':_0x5e0837,'rows':_0x4113d5}:null;}})[_0x425b('0x26')](respondWithResult(_0x49dfbb,null))[_0x425b('0x47')](handleError(_0x49dfbb,null));};exports[_0x425b('0x58')]=function(_0x37d50e,_0x515060,_0x1ff2db){return db[_0x425b('0x2f')][_0x425b('0x49')]({'where':{'id':_0x37d50e[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x515060,null))['then'](function(_0x25fd63){if(_0x25fd63){return _0x25fd63[_0x425b('0x58')](_0x37d50e['query']['ids']);}})['then'](respondWithStatusCode(_0x515060,null))[_0x425b('0x47')](handleError(_0x515060,null));};exports[_0x425b('0x59')]=function(_0x4e5751,_0x12b617,_0x55dfcc){if(_0x4e5751[_0x425b('0x4b')]['id']){delete _0x4e5751[_0x425b('0x4b')]['id'];}return db['ChatGroup'][_0x425b('0x49')]({'where':{'id':_0x4e5751[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x12b617,null))[_0x425b('0x26')](function(_0x8c7b13){if(_0x8c7b13){_0x4e5751['body'][_0x425b('0x5a')]=_0x8c7b13['id'];return db['ChatInternalMessage'][_0x425b('0x4a')](_0x4e5751[_0x425b('0x4b')]);}})[_0x425b('0x26')](respondWithResult(_0x12b617,null))['catch'](handleError(_0x12b617,null));};exports[_0x425b('0x5b')]=function(_0x9458e0,_0x31ce02,_0x18772c){var _0x122b1f={};var _0xb35965={};var _0x1046e1;var _0x1a019f;return db[_0x425b('0x2f')][_0x425b('0x55')]({'where':{'id':_0x9458e0[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x31ce02,null))[_0x425b('0x26')](function(_0x50efb1){if(_0x50efb1){_0x1046e1=_0x50efb1;_0xb35965['model']=_['keys'](db[_0x425b('0x4f')][_0x425b('0x30')]);_0xb35965[_0x425b('0x34')]=_[_0x425b('0x33')](_0x9458e0[_0x425b('0x34')]);_0xb35965[_0x425b('0x35')]=_[_0x425b('0x36')](_0xb35965['model'],_0xb35965['query']);_0x122b1f['attributes']=_[_0x425b('0x36')](_0xb35965[_0x425b('0x37')],qs[_0x425b('0x39')](_0x9458e0['query']['fields']));_0x122b1f[_0x425b('0x38')]=_0x122b1f[_0x425b('0x38')][_0x425b('0x3a')]?_0x122b1f[_0x425b('0x38')]:_0xb35965[_0x425b('0x37')];_0x122b1f['order']=qs[_0x425b('0x3d')](_0x9458e0['query']['sort']);_0x122b1f[_0x425b('0x3f')]=qs[_0x425b('0x35')](_[_0x425b('0x5c')](_0x9458e0[_0x425b('0x34')],_0xb35965[_0x425b('0x35')]));if(_0x9458e0['query'][_0x425b('0x3e')]){_0x122b1f[_0x425b('0x3f')]=_[_0x425b('0x41')](_0x122b1f[_0x425b('0x3f')],{'$or':_[_0x425b('0x2e')](_0x122b1f['attributes'],function(_0x38f2c4){var _0x4366cb={};_0x4366cb[_0x38f2c4]={'$like':'%'+_0x9458e0[_0x425b('0x34')][_0x425b('0x3e')]+'%'};return _0x4366cb;})});}if(_0x9458e0[_0x425b('0x34')][_0x425b('0x5d')]){var _0x149aa1=_0x9458e0[_0x425b('0x34')][_0x425b('0x5d')]['split'](',');var _0xbcdc45={};_0xbcdc45[_0x149aa1[0x0]]={'$gte':moment(_0x149aa1[0x1])[_0x425b('0x5e')](_0x425b('0x5f'))};_0x122b1f[_0x425b('0x3f')]=_[_0x425b('0x41')](_0x122b1f[_0x425b('0x3f')],_0xbcdc45);}_0x122b1f=_['merge']({},_0x122b1f,_0x9458e0['options']);return _0x1046e1['getMessages'](_0x122b1f);}})['then'](function(_0x1693f4){if(_0x1693f4){_0x1a019f=_0x1693f4[_0x425b('0x3a')];if(!_0x9458e0[_0x425b('0x34')][_0x425b('0x3b')](_0x425b('0x57'))){_0x122b1f[_0x425b('0x21')]=qs[_0x425b('0x21')](_0x9458e0[_0x425b('0x34')][_0x425b('0x21')]);_0x122b1f[_0x425b('0x23')]=qs[_0x425b('0x23')](_0x9458e0[_0x425b('0x34')][_0x425b('0x23')]);}return _0x1046e1[_0x425b('0x5b')](_0x122b1f);}})['then'](function(_0xa01449){if(_0xa01449){return _0xa01449?{'count':_0x1a019f,'rows':_0xa01449}:null;}})[_0x425b('0x26')](respondWithResult(_0x31ce02,null))[_0x425b('0x47')](handleError(_0x31ce02,null));};
\ No newline at end of file
+var _0xc6b0=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','where','VIRTUAL','filter','merge','options','include','rows','catch','params','create','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','sort','pick','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x2e3846,_0x56ce25){var _0x306412=function(_0x109a1a){while(--_0x109a1a){_0x2e3846['push'](_0x2e3846['shift']());}};_0x306412(++_0x56ce25);}(_0xc6b0,0x16e));var _0x0c6b=function(_0x3c066e,_0x2b83a1){_0x3c066e=_0x3c066e-0x0;var _0x254c12=_0xc6b0[_0x3c066e];return _0x254c12;};'use strict';var emlformat=require(_0x0c6b('0x0'));var rimraf=require(_0x0c6b('0x1'));var zipdir=require(_0x0c6b('0x2'));var jsonpatch=require(_0x0c6b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0c6b('0x4'));var Mustache=require(_0x0c6b('0x5'));var util=require(_0x0c6b('0x6'));var path=require(_0x0c6b('0x7'));var sox=require('sox');var csv=require(_0x0c6b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c6b('0x9'));var _=require(_0x0c6b('0xa'));var squel=require('squel');var crypto=require(_0x0c6b('0xb'));var jsforce=require(_0x0c6b('0xc'));var deskjs=require(_0x0c6b('0xd'));var toCsv=require(_0x0c6b('0x8'));var querystring=require('querystring');var Papa=require(_0x0c6b('0xe'));var Redis=require(_0x0c6b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0c6b('0x10'));var as=require(_0x0c6b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c6b('0x12'))(_0x0c6b('0x13'));var utils=require(_0x0c6b('0x14'));var config=require(_0x0c6b('0x15'));var licenseUtil=require(_0x0c6b('0x16'));var db=require(_0x0c6b('0x17'))['db'];config[_0x0c6b('0x18')]=_[_0x0c6b('0x19')](config[_0x0c6b('0x18')],{'host':_0x0c6b('0x1a'),'port':0x18eb});var socket=require(_0x0c6b('0x1b'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x48bd85,_0x2ac34e){_0x2ac34e=_0x2ac34e||0xcc;return function(_0x1da5f9){if(_0x1da5f9){return _0x48bd85[_0x0c6b('0x1c')](_0x2ac34e);}return _0x48bd85['status'](_0x2ac34e)[_0x0c6b('0x1d')]();};}function respondWithResult(_0x379c39,_0x219fe5){_0x219fe5=_0x219fe5||0xc8;return function(_0x3f9bde){if(_0x3f9bde){return _0x379c39[_0x0c6b('0x1e')](_0x219fe5)['json'](_0x3f9bde);}};}function respondWithFilteredResult(_0x57345,_0x43e617){return function(_0x5c520f){if(_0x5c520f){var _0x451b13=typeof _0x43e617[_0x0c6b('0x1f')]===_0x0c6b('0x20')&&typeof _0x43e617[_0x0c6b('0x21')]===_0x0c6b('0x20');var _0x28cfed=_0x5c520f[_0x0c6b('0x22')];var _0x1769dd=_0x451b13?0x0:_0x43e617[_0x0c6b('0x1f')];var _0x305d93=_0x451b13?_0x5c520f['count']:_0x43e617[_0x0c6b('0x1f')]+_0x43e617['limit'];var _0xad2963;if(_0x305d93>=_0x28cfed){_0x305d93=_0x28cfed;_0xad2963=0xc8;}else{_0xad2963=0xce;}_0x57345[_0x0c6b('0x1e')](_0xad2963);return _0x57345['set'](_0x0c6b('0x23'),_0x1769dd+'-'+_0x305d93+'/'+_0x28cfed)[_0x0c6b('0x24')](_0x5c520f);}return null;};}function patchUpdates(_0x45bf56){return function(_0x3ef2ec){try{jsonpatch[_0x0c6b('0x25')](_0x3ef2ec,_0x45bf56,!![]);}catch(_0x1a9c9f){return BPromise[_0x0c6b('0x26')](_0x1a9c9f);}return _0x3ef2ec[_0x0c6b('0x27')]();};}function saveUpdates(_0x540e47,_0x312a1b){return function(_0x541ed0){if(_0x541ed0){return _0x541ed0[_0x0c6b('0x28')](_0x540e47)['then'](function(_0x1f3e9d){return _0x1f3e9d;});}return null;};}function removeEntity(_0x2d27ab,_0x148819){return function(_0x382035){if(_0x382035){return _0x382035[_0x0c6b('0x29')]()[_0x0c6b('0x2a')](function(){_0x2d27ab[_0x0c6b('0x1e')](0xcc)[_0x0c6b('0x1d')]();});}};}function handleEntityNotFound(_0x13acd2,_0x201f82){return function(_0x387262){if(!_0x387262){_0x13acd2[_0x0c6b('0x1c')](0x194);}return _0x387262;};}function handleError(_0x2f5a02,_0x9bd759){_0x9bd759=_0x9bd759||0x1f4;return function(_0x309f9b){logger['error'](_0x309f9b['stack']);if(_0x309f9b[_0x0c6b('0x2b')]){delete _0x309f9b['name'];}_0x2f5a02[_0x0c6b('0x1e')](_0x9bd759)[_0x0c6b('0x2c')](_0x309f9b);};}exports[_0x0c6b('0x2d')]=function(_0xd8c88d,_0x2f4574){var _0x31dc9f={},_0x6ba1f9={},_0x339868={'count':0x0,'rows':[]};var _0x581556=_[_0x0c6b('0x2e')](db[_0x0c6b('0x2f')][_0x0c6b('0x30')],function(_0x3ee0b4){return{'name':_0x3ee0b4[_0x0c6b('0x31')],'type':_0x3ee0b4[_0x0c6b('0x32')]['key']};});_0x6ba1f9[_0x0c6b('0x33')]=_[_0x0c6b('0x2e')](_0x581556,'name');_0x6ba1f9['query']=_[_0x0c6b('0x34')](_0xd8c88d[_0x0c6b('0x35')]);_0x6ba1f9[_0x0c6b('0x36')]=_[_0x0c6b('0x37')](_0x6ba1f9[_0x0c6b('0x33')],_0x6ba1f9['query']);_0x31dc9f['attributes']=_[_0x0c6b('0x37')](_0x6ba1f9[_0x0c6b('0x33')],qs[_0x0c6b('0x38')](_0xd8c88d['query']['fields']));_0x31dc9f['attributes']=_0x31dc9f['attributes'][_0x0c6b('0x39')]?_0x31dc9f[_0x0c6b('0x3a')]:_0x6ba1f9[_0x0c6b('0x33')];if(!_0xd8c88d[_0x0c6b('0x35')][_0x0c6b('0x3b')](_0x0c6b('0x3c'))){_0x31dc9f[_0x0c6b('0x21')]=qs[_0x0c6b('0x21')](_0xd8c88d[_0x0c6b('0x35')]['limit']);_0x31dc9f[_0x0c6b('0x1f')]=qs[_0x0c6b('0x1f')](_0xd8c88d[_0x0c6b('0x35')][_0x0c6b('0x1f')]);}_0x31dc9f[_0x0c6b('0x3d')]=qs['sort'](_0xd8c88d[_0x0c6b('0x35')]['sort']);_0x31dc9f[_0x0c6b('0x3e')]=qs[_0x0c6b('0x36')](_['pick'](_0xd8c88d['query'],_0x6ba1f9['filters']),_0x581556);if(_0xd8c88d[_0x0c6b('0x35')]['filter']){_0x31dc9f[_0x0c6b('0x3e')]=_['merge'](_0x31dc9f[_0x0c6b('0x3e')],{'$or':_[_0x0c6b('0x2e')](_0x581556,function(_0x3c7c39){if(_0x3c7c39['type']!==_0x0c6b('0x3f')){var _0x250f17={};_0x250f17[_0x3c7c39[_0x0c6b('0x2b')]]={'$like':'%'+_0xd8c88d[_0x0c6b('0x35')][_0x0c6b('0x40')]+'%'};return _0x250f17;}})});}_0x31dc9f=_[_0x0c6b('0x41')]({},_0x31dc9f,_0xd8c88d[_0x0c6b('0x42')]);var _0x569595={'where':_0x31dc9f[_0x0c6b('0x3e')]};return db['ChatGroup'][_0x0c6b('0x22')](_0x569595)['then'](function(_0x36b55f){_0x339868[_0x0c6b('0x22')]=_0x36b55f;if(_0xd8c88d['query']['includeAll']){_0x31dc9f[_0x0c6b('0x43')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x31dc9f);})['then'](function(_0xf551d9){_0x339868[_0x0c6b('0x44')]=_0xf551d9;return _0x339868;})[_0x0c6b('0x2a')](respondWithFilteredResult(_0x2f4574,_0x31dc9f))[_0x0c6b('0x45')](handleError(_0x2f4574,null));};exports['show']=function(_0x4deca9,_0x52bcde){var _0x97060c={'raw':!![],'where':{'id':_0x4deca9[_0x0c6b('0x46')]['id']}},_0x580d25={};_0x580d25['model']=_[_0x0c6b('0x34')](db[_0x0c6b('0x2f')][_0x0c6b('0x30')]);_0x580d25['query']=_[_0x0c6b('0x34')](_0x4deca9[_0x0c6b('0x35')]);_0x580d25[_0x0c6b('0x36')]=_[_0x0c6b('0x37')](_0x580d25[_0x0c6b('0x33')],_0x580d25[_0x0c6b('0x35')]);_0x97060c[_0x0c6b('0x3a')]=_[_0x0c6b('0x37')](_0x580d25[_0x0c6b('0x33')],qs['fields'](_0x4deca9[_0x0c6b('0x35')][_0x0c6b('0x38')]));_0x97060c[_0x0c6b('0x3a')]=_0x97060c[_0x0c6b('0x3a')][_0x0c6b('0x39')]?_0x97060c['attributes']:_0x580d25[_0x0c6b('0x33')];if(_0x4deca9[_0x0c6b('0x35')]['includeAll']){_0x97060c['include']=[{'all':!![]}];}_0x97060c=_[_0x0c6b('0x41')]({},_0x97060c,_0x4deca9[_0x0c6b('0x42')]);return db[_0x0c6b('0x2f')]['find'](_0x97060c)[_0x0c6b('0x2a')](handleEntityNotFound(_0x52bcde,null))['then'](respondWithResult(_0x52bcde,null))['catch'](handleError(_0x52bcde,null));};exports[_0x0c6b('0x47')]=function(_0xd15e4a,_0x2cf70a){return db['ChatGroup'][_0x0c6b('0x47')](_0xd15e4a[_0x0c6b('0x48')],{})[_0x0c6b('0x2a')](respondWithResult(_0x2cf70a,0xc9))[_0x0c6b('0x45')](handleError(_0x2cf70a,null));};exports[_0x0c6b('0x28')]=function(_0x377282,_0x2798c2){if(_0x377282['body']['id']){delete _0x377282[_0x0c6b('0x48')]['id'];}return db['ChatGroup'][_0x0c6b('0x49')]({'where':{'id':_0x377282[_0x0c6b('0x46')]['id']}})[_0x0c6b('0x2a')](handleEntityNotFound(_0x2798c2,null))[_0x0c6b('0x2a')](saveUpdates(_0x377282[_0x0c6b('0x48')],null))[_0x0c6b('0x2a')](respondWithResult(_0x2798c2,null))[_0x0c6b('0x45')](handleError(_0x2798c2,null));};exports['destroy']=function(_0x1f97a7,_0xa5c991){return db[_0x0c6b('0x2f')][_0x0c6b('0x49')]({'where':{'id':_0x1f97a7['params']['id']}})[_0x0c6b('0x2a')](handleEntityNotFound(_0xa5c991,null))[_0x0c6b('0x2a')](removeEntity(_0xa5c991,null))[_0x0c6b('0x45')](handleError(_0xa5c991,null));};exports[_0x0c6b('0x4a')]=function(_0x27e3de,_0x30d3c5){return db[_0x0c6b('0x2f')][_0x0c6b('0x4a')]()[_0x0c6b('0x2a')](respondWithResult(_0x30d3c5,null))['catch'](handleError(_0x30d3c5,null));};exports[_0x0c6b('0x4b')]=function(_0x39a1f7,_0xdc4d7c,_0x37157e){return db[_0x0c6b('0x4c')][_0x0c6b('0x22')]({'where':{'ChatGroupId':_0x39a1f7[_0x0c6b('0x46')]['id'],'ToId':_0x39a1f7[_0x0c6b('0x4d')]['id'],'read':![]}})[_0x0c6b('0x2a')](function(_0x487d1b){return{'id':_[_0x0c6b('0x4e')](_0x39a1f7[_0x0c6b('0x46')]['id']),'count':_0x487d1b};})[_0x0c6b('0x2a')](respondWithResult(_0xdc4d7c,null))[_0x0c6b('0x45')](handleError(_0xdc4d7c,null));};exports[_0x0c6b('0x4f')]=function(_0x54ffdd,_0x2e0f1b,_0x4a7203){return db[_0x0c6b('0x2f')]['find']({'where':{'id':_0x54ffdd[_0x0c6b('0x46')]['id']}})[_0x0c6b('0x2a')](handleEntityNotFound(_0x2e0f1b,null))[_0x0c6b('0x2a')](function(_0x11a848){if(_0x11a848){return _0x11a848[_0x0c6b('0x4f')](_0x54ffdd['body'][_0x0c6b('0x50')],_[_0x0c6b('0x51')](_0x54ffdd[_0x0c6b('0x48')],[_0x0c6b('0x50'),'id'])||{});}})['then'](respondWithResult(_0x2e0f1b,null))[_0x0c6b('0x45')](handleError(_0x2e0f1b,null));};exports[_0x0c6b('0x52')]=function(_0x3c095e,_0x482ed3,_0x740bcf){var _0x381105={};var _0x31c674={};var _0x210d2d;var _0x5d92d8;return db[_0x0c6b('0x2f')][_0x0c6b('0x53')]({'where':{'id':_0x3c095e[_0x0c6b('0x46')]['id']}})[_0x0c6b('0x2a')](handleEntityNotFound(_0x482ed3,null))[_0x0c6b('0x2a')](function(_0x1f88d0){if(_0x1f88d0){_0x210d2d=_0x1f88d0;_0x31c674[_0x0c6b('0x33')]=_[_0x0c6b('0x34')](db[_0x0c6b('0x54')]['rawAttributes']);_0x31c674[_0x0c6b('0x35')]=_[_0x0c6b('0x34')](_0x3c095e[_0x0c6b('0x35')]);_0x31c674[_0x0c6b('0x36')]=_[_0x0c6b('0x37')](_0x31c674[_0x0c6b('0x33')],_0x31c674[_0x0c6b('0x35')]);_0x381105[_0x0c6b('0x3a')]=_[_0x0c6b('0x37')](_0x31c674[_0x0c6b('0x33')],qs[_0x0c6b('0x38')](_0x3c095e[_0x0c6b('0x35')]['fields']));_0x381105[_0x0c6b('0x3a')]=_0x381105[_0x0c6b('0x3a')][_0x0c6b('0x39')]?_0x381105['attributes']:_0x31c674[_0x0c6b('0x33')];_0x381105['order']=qs[_0x0c6b('0x55')](_0x3c095e[_0x0c6b('0x35')][_0x0c6b('0x55')]);_0x381105[_0x0c6b('0x3e')]=qs[_0x0c6b('0x36')](_[_0x0c6b('0x56')](_0x3c095e[_0x0c6b('0x35')],_0x31c674[_0x0c6b('0x36')]));if(_0x3c095e[_0x0c6b('0x35')][_0x0c6b('0x40')]){_0x381105[_0x0c6b('0x3e')]=_[_0x0c6b('0x41')](_0x381105[_0x0c6b('0x3e')],{'$or':_[_0x0c6b('0x2e')](_0x381105[_0x0c6b('0x3a')],function(_0x166406){var _0x18f161={};_0x18f161[_0x166406]={'$like':'%'+_0x3c095e[_0x0c6b('0x35')][_0x0c6b('0x40')]+'%'};return _0x18f161;})});}_0x381105=_['merge']({},_0x381105,_0x3c095e[_0x0c6b('0x42')]);return _0x210d2d[_0x0c6b('0x52')](_0x381105);}})['then'](function(_0x278a82){if(_0x278a82){_0x5d92d8=_0x278a82[_0x0c6b('0x39')];if(!_0x3c095e[_0x0c6b('0x35')][_0x0c6b('0x3b')]('nolimit')){_0x381105[_0x0c6b('0x21')]=qs[_0x0c6b('0x21')](_0x3c095e[_0x0c6b('0x35')][_0x0c6b('0x21')]);_0x381105['offset']=qs[_0x0c6b('0x1f')](_0x3c095e[_0x0c6b('0x35')]['offset']);}return _0x210d2d[_0x0c6b('0x52')](_0x381105);}})[_0x0c6b('0x2a')](function(_0x31bfb5){if(_0x31bfb5){return _0x31bfb5?{'count':_0x5d92d8,'rows':_0x31bfb5}:null;}})[_0x0c6b('0x2a')](respondWithResult(_0x482ed3,null))[_0x0c6b('0x45')](handleError(_0x482ed3,null));};exports[_0x0c6b('0x57')]=function(_0x4329ac,_0x559d41,_0x4f887c){return db['ChatGroup']['find']({'where':{'id':_0x4329ac['params']['id']}})['then'](handleEntityNotFound(_0x559d41,null))[_0x0c6b('0x2a')](function(_0xe86b7){if(_0xe86b7){return _0xe86b7[_0x0c6b('0x57')](_0x4329ac[_0x0c6b('0x35')][_0x0c6b('0x50')]);}})[_0x0c6b('0x2a')](respondWithStatusCode(_0x559d41,null))['catch'](handleError(_0x559d41,null));};exports[_0x0c6b('0x58')]=function(_0x5de701,_0xc071a3,_0x28342c){if(_0x5de701[_0x0c6b('0x48')]['id']){delete _0x5de701[_0x0c6b('0x48')]['id'];}return db[_0x0c6b('0x2f')][_0x0c6b('0x49')]({'where':{'id':_0x5de701[_0x0c6b('0x46')]['id']}})[_0x0c6b('0x2a')](handleEntityNotFound(_0xc071a3,null))[_0x0c6b('0x2a')](function(_0x547e4d){if(_0x547e4d){_0x5de701['body'][_0x0c6b('0x59')]=_0x547e4d['id'];return db[_0x0c6b('0x4c')][_0x0c6b('0x47')](_0x5de701[_0x0c6b('0x48')]);}})[_0x0c6b('0x2a')](respondWithResult(_0xc071a3,null))[_0x0c6b('0x45')](handleError(_0xc071a3,null));};exports['getMessages']=function(_0x1ddf8b,_0x4bd9e6,_0x1bf422){var _0x1f760c={};var _0x399416={};var _0x4b9d3c;var _0x24734f;return db[_0x0c6b('0x2f')][_0x0c6b('0x53')]({'where':{'id':_0x1ddf8b[_0x0c6b('0x46')]['id']}})[_0x0c6b('0x2a')](handleEntityNotFound(_0x4bd9e6,null))[_0x0c6b('0x2a')](function(_0xbe6e24){if(_0xbe6e24){_0x4b9d3c=_0xbe6e24;_0x399416['model']=_[_0x0c6b('0x34')](db[_0x0c6b('0x4c')][_0x0c6b('0x30')]);_0x399416[_0x0c6b('0x35')]=_[_0x0c6b('0x34')](_0x1ddf8b['query']);_0x399416['filters']=_[_0x0c6b('0x37')](_0x399416[_0x0c6b('0x33')],_0x399416[_0x0c6b('0x35')]);_0x1f760c[_0x0c6b('0x3a')]=_[_0x0c6b('0x37')](_0x399416[_0x0c6b('0x33')],qs[_0x0c6b('0x38')](_0x1ddf8b['query'][_0x0c6b('0x38')]));_0x1f760c[_0x0c6b('0x3a')]=_0x1f760c[_0x0c6b('0x3a')][_0x0c6b('0x39')]?_0x1f760c[_0x0c6b('0x3a')]:_0x399416[_0x0c6b('0x33')];_0x1f760c[_0x0c6b('0x3d')]=qs[_0x0c6b('0x55')](_0x1ddf8b[_0x0c6b('0x35')][_0x0c6b('0x55')]);_0x1f760c[_0x0c6b('0x3e')]=qs[_0x0c6b('0x36')](_[_0x0c6b('0x56')](_0x1ddf8b[_0x0c6b('0x35')],_0x399416[_0x0c6b('0x36')]));if(_0x1ddf8b[_0x0c6b('0x35')][_0x0c6b('0x40')]){_0x1f760c['where']=_[_0x0c6b('0x41')](_0x1f760c['where'],{'$or':_[_0x0c6b('0x2e')](_0x1f760c[_0x0c6b('0x3a')],function(_0x22016f){var _0x17d701={};_0x17d701[_0x22016f]={'$like':'%'+_0x1ddf8b[_0x0c6b('0x35')][_0x0c6b('0x40')]+'%'};return _0x17d701;})});}if(_0x1ddf8b[_0x0c6b('0x35')]['$gte']){var _0x46f719=_0x1ddf8b['query'][_0x0c6b('0x5a')][_0x0c6b('0x5b')](',');var _0x37fc7c={};_0x37fc7c[_0x46f719[0x0]]={'$gte':moment(_0x46f719[0x1])[_0x0c6b('0x5c')](_0x0c6b('0x5d'))};_0x1f760c[_0x0c6b('0x3e')]=_[_0x0c6b('0x41')](_0x1f760c[_0x0c6b('0x3e')],_0x37fc7c);}_0x1f760c=_[_0x0c6b('0x41')]({},_0x1f760c,_0x1ddf8b[_0x0c6b('0x42')]);return _0x4b9d3c[_0x0c6b('0x5e')](_0x1f760c);}})[_0x0c6b('0x2a')](function(_0x47cf88){if(_0x47cf88){_0x24734f=_0x47cf88[_0x0c6b('0x39')];if(!_0x1ddf8b[_0x0c6b('0x35')][_0x0c6b('0x3b')](_0x0c6b('0x3c'))){_0x1f760c[_0x0c6b('0x21')]=qs[_0x0c6b('0x21')](_0x1ddf8b['query'][_0x0c6b('0x21')]);_0x1f760c['offset']=qs[_0x0c6b('0x1f')](_0x1ddf8b[_0x0c6b('0x35')]['offset']);}return _0x4b9d3c[_0x0c6b('0x5e')](_0x1f760c);}})[_0x0c6b('0x2a')](function(_0x4fa685){if(_0x4fa685){return _0x4fa685?{'count':_0x24734f,'rows':_0x4fa685}:null;}})[_0x0c6b('0x2a')](respondWithResult(_0x4bd9e6,null))[_0x0c6b('0x45')](handleError(_0x4bd9e6,null));};
\ No newline at end of file
index debfc6a..e32b4e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdb5=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xfdb5,0x18f));var _0x5fdb=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xfdb5[_0x12fc8d];return _0x3f9d04;};'use strict';var EventEmitter=require(_0x5fdb('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x5fdb('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5fdb('0x2')](0x0);var events={'afterCreate':_0x5fdb('0x3'),'afterUpdate':_0x5fdb('0x4'),'afterDestroy':_0x5fdb('0x5')};function emitEvent(_0x379f9b){return function(_0x24cbe7,_0x334e53,_0x5f3fc6){ChatGroupEvents[_0x5fdb('0x6')](_0x379f9b+':'+_0x24cbe7['id'],_0x24cbe7);ChatGroupEvents['emit'](_0x379f9b,_0x24cbe7);_0x5f3fc6(null);};}for(var e in events){if(events[_0x5fdb('0x7')](e)){var event=events[e];ChatGroup[_0x5fdb('0x8')](e,emitEvent(event));}}module[_0x5fdb('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x5659=['emit','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x37540c,_0x3315b6){var _0x503546=function(_0x1c2560){while(--_0x1c2560){_0x37540c['push'](_0x37540c['shift']());}};_0x503546(++_0x3315b6);}(_0x5659,0x168));var _0x9565=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0x5659[_0x3ba422];return _0x20b5dd;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x9565('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9565('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9565('0x2'),'afterDestroy':_0x9565('0x3')};function emitEvent(_0x502cd9){return function(_0xda6bac,_0x46e5c8,_0x30bd31){ChatGroupEvents['emit'](_0x502cd9+':'+_0xda6bac['id'],_0xda6bac);ChatGroupEvents[_0x9565('0x4')](_0x502cd9,_0xda6bac);_0x30bd31(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x9565('0x5')](e,emitEvent(event));}}module[_0x9565('0x6')]=ChatGroupEvents;
\ No newline at end of file
index f391bab..0790ec2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d89=['request-promise','path','../../config/environment','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x331052,_0x1bec7a){var _0x409de2=function(_0x305528){while(--_0x305528){_0x331052['push'](_0x331052['shift']());}};_0x409de2(++_0x1bec7a);}(_0x7d89,0x126));var _0x97d8=function(_0x2f1a48,_0x1fd155){_0x2f1a48=_0x2f1a48-0x0;var _0x4ff0b5=_0x7d89[_0x2f1a48];return _0x4ff0b5;};'use strict';var _=require(_0x97d8('0x0'));var util=require(_0x97d8('0x1'));var logger=require(_0x97d8('0x2'))(_0x97d8('0x3'));var moment=require(_0x97d8('0x4'));var BPromise=require(_0x97d8('0x5'));var rp=require(_0x97d8('0x6'));var fs=require('fs');var path=require(_0x97d8('0x7'));var rimraf=require('rimraf');var config=require(_0x97d8('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x2dd528,_0x2e2891){return _0x2dd528[_0x97d8('0x9')](_0x97d8('0xa'),attributes,{'tableName':_0x97d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc9d=['rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','api','moment','bluebird','request-promise','path'];(function(_0x437bb8,_0x507b1a){var _0x10bb89=function(_0x122927){while(--_0x122927){_0x437bb8['push'](_0x437bb8['shift']());}};_0x10bb89(++_0x507b1a);}(_0xdc9d,0x1e8));var _0xddc9=function(_0x2c528c,_0x289d92){_0x2c528c=_0x2c528c-0x0;var _0x22292d=_0xdc9d[_0x2c528c];return _0x22292d;};'use strict';var _=require(_0xddc9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xddc9('0x1'));var moment=require(_0xddc9('0x2'));var BPromise=require(_0xddc9('0x3'));var rp=require(_0xddc9('0x4'));var fs=require('fs');var path=require(_0xddc9('0x5'));var rimraf=require(_0xddc9('0x6'));var config=require(_0xddc9('0x7'));var attributes=require(_0xddc9('0x8'));module[_0xddc9('0x9')]=function(_0x1332e7,_0xf7dc06){return _0x1332e7[_0xddc9('0xa')](_0xddc9('0xb'),attributes,{'tableName':_0xddc9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e6d7250..d7f44ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ccc=['message','result','catch','lodash','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xd7de81,_0x35ca61){var _0x41c627=function(_0x10aeff){while(--_0x10aeff){_0xd7de81['push'](_0xd7de81['shift']());}};_0x41c627(++_0x35ca61);}(_0x8ccc,0x16f));var _0xc8cc=function(_0x332d62,_0x236139){_0x332d62=_0x332d62-0x0;var _0x3bd864=_0x8ccc[_0x332d62];return _0x3bd864;};'use strict';var _=require(_0xc8cc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc8cc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc8cc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xc8cc('0x3'))(_0xc8cc('0x4'));var config=require(_0xc8cc('0x5'));var jayson=require(_0xc8cc('0x6'));var client=jayson[_0xc8cc('0x7')]['http']({'port':0x232a});config['redis']=_[_0xc8cc('0x8')](config[_0xc8cc('0x9')],{'host':_0xc8cc('0xa'),'port':0x18eb});var socket=require(_0xc8cc('0xb'))(new Redis(config[_0xc8cc('0x9')]));require(_0xc8cc('0xc'))[_0xc8cc('0xd')](socket);function respondWithRpcPromise(_0x181d7d,_0x1913e0,_0x3fe1d8){return new BPromise(function(_0x479f74,_0x2cac96){return client['request'](_0x181d7d,_0x3fe1d8)[_0xc8cc('0xe')](function(_0x1d02fe){logger[_0xc8cc('0xf')](_0xc8cc('0x10'),_0x1913e0,'request\x20sent');logger[_0xc8cc('0x11')](_0xc8cc('0x12'),_0x1913e0,_0xc8cc('0x13'),JSON[_0xc8cc('0x14')](_0x1d02fe));if(_0x1d02fe[_0xc8cc('0x15')]){if(_0x1d02fe['error'][_0xc8cc('0x16')]===0x1f4){logger[_0xc8cc('0x15')](_0xc8cc('0x10'),_0x1913e0,_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);return _0x2cac96(_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);}logger[_0xc8cc('0x15')](_0xc8cc('0x10'),_0x1913e0,_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);return _0x479f74(_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);}else{logger[_0xc8cc('0xf')](_0xc8cc('0x10'),_0x1913e0,_0xc8cc('0x13'));_0x479f74(_0x1d02fe[_0xc8cc('0x18')][_0xc8cc('0x17')]);}})[_0xc8cc('0x19')](function(_0xb435db){logger[_0xc8cc('0x15')]('ChatGroup,\x20%s,\x20%s',_0x1913e0,_0xb435db);_0x2cac96(_0xb435db);});});}
\ No newline at end of file
+var _0x7764=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x5d3550,_0x107033){var _0x5d1299=function(_0x5edaa1){while(--_0x5edaa1){_0x5d3550['push'](_0x5d3550['shift']());}};_0x5d1299(++_0x107033);}(_0x7764,0xa4));var _0x4776=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x7764[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x4776('0x0'));var util=require(_0x4776('0x1'));var moment=require(_0x4776('0x2'));var BPromise=require(_0x4776('0x3'));var rs=require(_0x4776('0x4'));var fs=require('fs');var Redis=require(_0x4776('0x5'));var db=require(_0x4776('0x6'))['db'];var utils=require(_0x4776('0x7'));var logger=require(_0x4776('0x8'))(_0x4776('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4776('0xa')][_0x4776('0xb')]({'port':0x232a});config['redis']=_[_0x4776('0xc')](config[_0x4776('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4776('0xd')]));require('./chatGroup.socket')[_0x4776('0xe')](socket);function respondWithRpcPromise(_0x44ac53,_0x2ea7b1,_0x3baf2f){return new BPromise(function(_0x48c30c,_0x3a12da){return client[_0x4776('0xf')](_0x44ac53,_0x3baf2f)[_0x4776('0x10')](function(_0x1cd700){logger[_0x4776('0x11')](_0x4776('0x12'),_0x2ea7b1,_0x4776('0x13'));logger[_0x4776('0x14')](_0x4776('0x15'),_0x2ea7b1,_0x4776('0x13'),JSON[_0x4776('0x16')](_0x1cd700));if(_0x1cd700['error']){if(_0x1cd700['error'][_0x4776('0x17')]===0x1f4){logger[_0x4776('0x18')](_0x4776('0x12'),_0x2ea7b1,_0x1cd700[_0x4776('0x18')][_0x4776('0x19')]);return _0x3a12da(_0x1cd700[_0x4776('0x18')][_0x4776('0x19')]);}logger[_0x4776('0x18')](_0x4776('0x12'),_0x2ea7b1,_0x1cd700[_0x4776('0x18')]['message']);return _0x48c30c(_0x1cd700[_0x4776('0x18')]['message']);}else{logger[_0x4776('0x11')](_0x4776('0x12'),_0x2ea7b1,_0x4776('0x13'));_0x48c30c(_0x1cd700[_0x4776('0x1a')][_0x4776('0x19')]);}})['catch'](function(_0x1f6bb8){logger[_0x4776('0x18')]('ChatGroup,\x20%s,\x20%s',_0x2ea7b1,_0x1f6bb8);_0x3a12da(_0x1f6bb8);});});}
\ No newline at end of file
index acac911..e1a6b69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75b5=['emit','removeListener','register','chatGroup:','save','remove','update'];(function(_0x3ff33a,_0x32e7a5){var _0x43517f=function(_0x5f0f4a){while(--_0x5f0f4a){_0x3ff33a['push'](_0x3ff33a['shift']());}};_0x43517f(++_0x32e7a5);}(_0x75b5,0xd6));var _0x575b=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x75b5[_0x43d11d];return _0x38cd08;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x575b('0x0'),_0x575b('0x1'),_0x575b('0x2')];function createListener(_0x2c37ca,_0xf70335){return function(_0x22ccc9){_0xf70335[_0x575b('0x3')](_0x2c37ca,_0x22ccc9);};}function removeListener(_0x5b04db,_0x51759c){return function(){ChatGroupEvents[_0x575b('0x4')](_0x5b04db,_0x51759c);};}exports[_0x575b('0x5')]=function(_0x25db80){for(var _0x28fc02=0x0,_0x7ad9da=events['length'];_0x28fc02<_0x7ad9da;_0x28fc02++){var _0x49a6e4=events[_0x28fc02];var _0x420e73=createListener(_0x575b('0x6')+_0x49a6e4,_0x25db80);ChatGroupEvents['on'](_0x49a6e4,_0x420e73);}};
\ No newline at end of file
+var _0xa78c=['emit','removeListener','length','chatGroup:','remove','update'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xa78c,0xfa));var _0xca78=function(_0x38a511,_0x5860a5){_0x38a511=_0x38a511-0x0;var _0x60ab5d=_0xa78c[_0x38a511];return _0x60ab5d;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0xca78('0x0'),_0xca78('0x1')];function createListener(_0x22b06e,_0x5503ac){return function(_0x1a2cb4){_0x5503ac[_0xca78('0x2')](_0x22b06e,_0x1a2cb4);};}function removeListener(_0x1a4763,_0x2e8975){return function(){ChatGroupEvents[_0xca78('0x3')](_0x1a4763,_0x2e8975);};}exports['register']=function(_0x4ac5d2){for(var _0x2df4eb=0x0,_0x1e7da2=events[_0xca78('0x4')];_0x2df4eb<_0x1e7da2;_0x2df4eb++){var _0x13353e=events[_0x2df4eb];var _0x4fbb7d=createListener(_0xca78('0x5')+_0x13353e,_0x4ac5d2);ChatGroupEvents['on'](_0x13353e,_0x4fbb7d);}};
\ No newline at end of file
index 5089ab5..80a2969 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc791=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','update','delete','destroy','exports'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0xc791,0x8c));var _0x1c79=function(_0xa51ba0,_0x3bf58d){_0xa51ba0=_0xa51ba0-0x0;var _0x17f343=_0xc791[_0xa51ba0];return _0x17f343;};'use strict';var multer=require(_0x1c79('0x0'));var util=require(_0x1c79('0x1'));var path=require(_0x1c79('0x2'));var timeout=require(_0x1c79('0x3'));var express=require(_0x1c79('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1c79('0x5'));var interaction=require(_0x1c79('0x6'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x1c79('0x7')]('/',auth[_0x1c79('0x8')](),controller[_0x1c79('0x9')]);router[_0x1c79('0x7')](_0x1c79('0xa'),auth[_0x1c79('0x8')](),controller['describe']);router['get']('/:id',auth[_0x1c79('0x8')](),controller[_0x1c79('0xb')]);router[_0x1c79('0x7')](_0x1c79('0xc'),auth[_0x1c79('0x8')](),controller[_0x1c79('0xd')]);router['get'](_0x1c79('0xe'),auth[_0x1c79('0x8')](),controller[_0x1c79('0xf')]);router[_0x1c79('0x7')](_0x1c79('0x10'),auth[_0x1c79('0x8')](),controller[_0x1c79('0x11')]);router[_0x1c79('0x12')]('/',auth['isAuthenticated'](),controller[_0x1c79('0x13')]);router[_0x1c79('0x12')]('/:id/members',auth[_0x1c79('0x8')](),controller[_0x1c79('0x14')]);router['post'](_0x1c79('0x10'),auth['isAuthenticated'](),controller[_0x1c79('0x15')]);router[_0x1c79('0x16')](_0x1c79('0x17'),auth[_0x1c79('0x8')](),controller[_0x1c79('0x18')]);router[_0x1c79('0x19')]('/:id',auth[_0x1c79('0x8')](),controller[_0x1c79('0x1a')]);router['delete']('/:id/members',auth[_0x1c79('0x8')](),controller['removeMembers']);module[_0x1c79('0x1b')]=router;
\ No newline at end of file
+var _0x2556=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','addMembers','put','delete','destroy','/:id/members','removeMembers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x7cec94,_0x387e20){var _0x44226a=function(_0x5e0a77){while(--_0x5e0a77){_0x7cec94['push'](_0x7cec94['shift']());}};_0x44226a(++_0x387e20);}(_0x2556,0x8d));var _0x6255=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x2556[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0x6255('0x0'));var util=require('util');var path=require(_0x6255('0x1'));var timeout=require(_0x6255('0x2'));var express=require(_0x6255('0x3'));var router=express[_0x6255('0x4')]();var fs_extra=require(_0x6255('0x5'));var auth=require(_0x6255('0x6'));var interaction=require(_0x6255('0x7'));var config=require(_0x6255('0x8'));var controller=require('./chatGroup.controller');router[_0x6255('0x9')]('/',auth[_0x6255('0xa')](),controller[_0x6255('0xb')]);router[_0x6255('0x9')](_0x6255('0xc'),auth[_0x6255('0xa')](),controller[_0x6255('0xd')]);router[_0x6255('0x9')](_0x6255('0xe'),auth['isAuthenticated'](),controller[_0x6255('0xf')]);router[_0x6255('0x9')](_0x6255('0x10'),auth[_0x6255('0xa')](),controller[_0x6255('0x11')]);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x6255('0x12')]);router['get'](_0x6255('0x13'),auth[_0x6255('0xa')](),controller[_0x6255('0x14')]);router[_0x6255('0x15')]('/',auth[_0x6255('0xa')](),controller[_0x6255('0x16')]);router[_0x6255('0x15')]('/:id/members',auth[_0x6255('0xa')](),controller[_0x6255('0x17')]);router[_0x6255('0x15')]('/:id/messages',auth[_0x6255('0xa')](),controller['addMessage']);router[_0x6255('0x18')](_0x6255('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x6255('0x19')](_0x6255('0xe'),auth[_0x6255('0xa')](),controller[_0x6255('0x1a')]);router[_0x6255('0x19')](_0x6255('0x1b'),auth['isAuthenticated'](),controller[_0x6255('0x1c')]);module[_0x6255('0x1d')]=router;
\ No newline at end of file
index cbb75be..c054d63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee4e=['STRING','DATE','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT'];(function(_0x37846a,_0x42db81){var _0x401321=function(_0x376993){while(--_0x376993){_0x37846a['push'](_0x37846a['shift']());}};_0x401321(++_0x42db81);}(_0xee4e,0x122));var _0xeee4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xee4e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xeee4('0x0'));module[_0xeee4('0x1')]={'closed':{'type':Sequelize[_0xeee4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xeee4('0x3')](_0xeee4('0x4'),_0xeee4('0x5')),'defaultValue':_0xeee4('0x4')},'ratingMessage':{'type':Sequelize[_0xeee4('0x6')]},'pathTranscript':{'type':Sequelize[_0xeee4('0x6')]},'mailTranscript':{'type':Sequelize[_0xeee4('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xeee4('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xeee4('0x7')]},'thirdDisposition':{'type':Sequelize[_0xeee4('0x7')]},'note':{'type':Sequelize[_0xeee4('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xeee4('0x7')]},'osName':{'type':Sequelize[_0xeee4('0x7')]},'osVersion':{'type':Sequelize[_0xeee4('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xeee4('0x7')]},'deviceType':{'type':Sequelize[_0xeee4('0x7')]},'referer':{'type':Sequelize[_0xeee4('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xeee4('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xeee4('0x8')]},'lastMsgAt':{'type':Sequelize[_0xeee4('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xeee4('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeee4('0x7')]},'customerPort':{'type':Sequelize[_0xeee4('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xeee4('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xeee4('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6ae2=['TEXT','STRING','DATE','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb'];(function(_0x47ca1b,_0x1b5188){var _0x2b5eb4=function(_0x2b06ca){while(--_0x2b06ca){_0x47ca1b['push'](_0x47ca1b['shift']());}};_0x2b5eb4(++_0x1b5188);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x248048,_0x302c58){_0x248048=_0x248048-0x0;var _0x3144d2=_0x6ae2[_0x248048];return _0x3144d2;};'use strict';var Sequelize=require(_0x26ae('0x0'));module[_0x26ae('0x1')]={'closed':{'type':Sequelize[_0x26ae('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x26ae('0x3')]},'ratingType':{'type':Sequelize[_0x26ae('0x4')](_0x26ae('0x5'),_0x26ae('0x6')),'defaultValue':_0x26ae('0x5')},'ratingMessage':{'type':Sequelize[_0x26ae('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x26ae('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x26ae('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x26ae('0x8')]},'note':{'type':Sequelize[_0x26ae('0x8')]},'browserName':{'type':Sequelize[_0x26ae('0x8')]},'browserVersion':{'type':Sequelize[_0x26ae('0x8')]},'osName':{'type':Sequelize[_0x26ae('0x8')]},'osVersion':{'type':Sequelize[_0x26ae('0x8')]},'deviceModel':{'type':Sequelize[_0x26ae('0x8')]},'deviceVendor':{'type':Sequelize[_0x26ae('0x8')]},'deviceType':{'type':Sequelize[_0x26ae('0x8')]},'referer':{'type':Sequelize[_0x26ae('0x7')]},'customerIp':{'type':Sequelize[_0x26ae('0x8')]},'formData':{'type':Sequelize[_0x26ae('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x26ae('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x26ae('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x26ae('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x26ae('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x26ae('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 36b81c1..2f4be2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','spread','chatInteractionTags:save','removeTags','files','tmp','attachments','lastName','Account','Owner','get','mkdirSync','N.A.','browserName','customerIp','customerPort','createReadStream','pipe','createWriteStream','firstName','renderFile','server','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','then','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','send','merge','body','contact','interaction','account','Users','map','TagIds','split','forEach','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','name','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','field','color','from','tools_tags','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','isEmpty','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','null','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','ChatWebsiteId','sequelize','toString','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','filters','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','email','POST','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned'];(function(_0x529b89,_0x4c0cd6){var _0x5e7124=function(_0x477328){while(--_0x477328){_0x529b89['push'](_0x529b89['shift']());}};_0x5e7124(++_0x4c0cd6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x542da8,_0x509c26){_0x542da8=_0x542da8-0x0;var _0x533d7e=_0x0b0e[_0x542da8];return _0x533d7e;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var pdf=require(_0xe0b0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0b0('0x14'))(_0xe0b0('0x15'));var utils=require(_0xe0b0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe0b0('0x17'));var db=require(_0xe0b0('0x18'))['db'];config[_0xe0b0('0x19')]=_[_0xe0b0('0x1a')](config[_0xe0b0('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0b0('0x1b'))(new Redis(config[_0xe0b0('0x19')]));require(_0xe0b0('0x1c'))[_0xe0b0('0x1d')](socket);var jayson=require(_0xe0b0('0x1e'));var client=jayson['client'][_0xe0b0('0x1f')]({'port':0x232b});var client9004=jayson['client'][_0xe0b0('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0xadee6e,_0x519ae8,_0x11fdca,_0x4a4cc0){return new BPromise(function(_0x2d6fb6,_0x100204){var _0x56bcc7=_0x4a4cc0||client;return _0x56bcc7['request'](_0xadee6e,_0x11fdca)[_0xe0b0('0x20')](function(_0x50a441){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0xe0b0('0x21'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x519ae8,_0xe0b0('0x21'),JSON['stringify'](_0x50a441));if(_0x50a441[_0xe0b0('0x22')]){if(_0x50a441['error'][_0xe0b0('0x23')]===0x1f4){logger[_0xe0b0('0x22')](_0xe0b0('0x24'),_0x519ae8,_0x50a441[_0xe0b0('0x22')][_0xe0b0('0x25')]);return _0x100204(_0x50a441['error']['message']);}logger[_0xe0b0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0x50a441[_0xe0b0('0x22')][_0xe0b0('0x25')]);return _0x2d6fb6(_0x50a441['error'][_0xe0b0('0x25')]);}else{logger['info'](_0xe0b0('0x24'),_0x519ae8,'request\x20sent');_0x2d6fb6(_0x50a441[_0xe0b0('0x26')]['message']);}})[_0xe0b0('0x27')](function(_0x4de537){logger[_0xe0b0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0x4de537);_0x100204(_0x4de537);});});}function respondWithStatusCode(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0xcc;return function(_0x362aba){if(_0x362aba){return _0x3c221d[_0xe0b0('0x28')](_0x5c5317);}return _0x3c221d[_0xe0b0('0x29')](_0x5c5317)[_0xe0b0('0x2a')]();};}function respondWithResult(_0x3ec2,_0x10745d){_0x10745d=_0x10745d||0xc8;return function(_0x5200a6){if(_0x5200a6){return _0x3ec2[_0xe0b0('0x29')](_0x10745d)[_0xe0b0('0x2b')](_0x5200a6);}};}function respondWithFilteredResult(_0x5b7a64,_0x15e13b){return function(_0x419b1f){if(_0x419b1f){var _0x36d137=typeof _0x15e13b[_0xe0b0('0x2c')]===_0xe0b0('0x2d')&&typeof _0x15e13b[_0xe0b0('0x2e')]===_0xe0b0('0x2d');var _0x4fb3b7=_0x419b1f[_0xe0b0('0x2f')];var _0x3c0109=_0x36d137?0x0:_0x15e13b['offset'];var _0x4fe400=_0x36d137?_0x419b1f[_0xe0b0('0x2f')]:_0x15e13b[_0xe0b0('0x2c')]+_0x15e13b[_0xe0b0('0x2e')];var _0x3f81d5;if(_0x4fe400>=_0x4fb3b7){_0x4fe400=_0x4fb3b7;_0x3f81d5=0xc8;}else{_0x3f81d5=0xce;}_0x5b7a64[_0xe0b0('0x29')](_0x3f81d5);return _0x5b7a64['set'](_0xe0b0('0x30'),_0x3c0109+'-'+_0x4fe400+'/'+_0x4fb3b7)[_0xe0b0('0x2b')](_0x419b1f);}return null;};}function patchUpdates(_0x7867c4){return function(_0x29d725){try{jsonpatch[_0xe0b0('0x31')](_0x29d725,_0x7867c4,!![]);}catch(_0x4fe835){return BPromise[_0xe0b0('0x32')](_0x4fe835);}return _0x29d725[_0xe0b0('0x33')]();};}function saveUpdates(_0xfc51d3,_0x31c6f5){return function(_0x3575bc){if(_0x3575bc){return _0x3575bc[_0xe0b0('0x34')](_0xfc51d3)[_0xe0b0('0x20')](function(_0x20908f){return _0x20908f;});}return null;};}function removeEntity(_0x2125d5,_0x1dd010){return function(_0xd56467){if(_0xd56467){return _0xd56467[_0xe0b0('0x35')]()[_0xe0b0('0x20')](function(){_0x2125d5[_0xe0b0('0x29')](0xcc)[_0xe0b0('0x2a')]();});}};}function handleEntityNotFound(_0x4cf80c,_0x121608){return function(_0x135be5){if(!_0x135be5){_0x4cf80c[_0xe0b0('0x28')](0x194);}return _0x135be5;};}function handleError(_0x1eb3f9,_0x1a2d24){_0x1a2d24=_0x1a2d24||0x1f4;return function(_0x2c6e60){logger[_0xe0b0('0x22')](_0x2c6e60['stack']);if(_0x2c6e60['name']){delete _0x2c6e60['name'];}_0x1eb3f9['status'](_0x1a2d24)[_0xe0b0('0x36')](_0x2c6e60);};}function getMustacheRender(_0xc3d967,_0xe6f635){return Mustache['render'](_0xc3d967,_[_0xe0b0('0x37')](_0xe6f635[_0xe0b0('0x38')],{'contact':_0xe6f635[_0xe0b0('0x39')],'message':_0xe6f635[_0xe0b0('0x25')],'agent':_0xe6f635['agent'],'interaction':_0xe6f635[_0xe0b0('0x3a')],'account':_0xe6f635[_0xe0b0('0x3b')]}))||'';}function getInteractionUsers(_0x43d352,_0x30dcbb){return new BPromise(function(_0x4265e3,_0x1205db){try{if(_0x30dcbb[_0x43d352['id']]){_0x43d352[_0xe0b0('0x3c')]=_[_0xe0b0('0x3d')](_0x30dcbb[_0x43d352['id']],function(_0xeaffbb){return{'id':_0xeaffbb['id'],'fullname':_0xeaffbb['fullname']};});}}catch(_0x3e349b){_0x1205db(_0x3e349b);}_0x4265e3(_0x43d352);});}function getInteractionTags(_0x54f646,_0x34178d){return new BPromise(function(_0x2d5f47,_0x46c4ea){try{if(_0x54f646[_0xe0b0('0x3e')]){_0x54f646['Tags']=[];_0x54f646[_0xe0b0('0x3e')][_0xe0b0('0x3f')](',')[_0xe0b0('0x40')](function(_0x402a0e){_0x54f646[_0xe0b0('0x41')][_0xe0b0('0x42')](_0x34178d[_0x402a0e]);});}delete _0x54f646[_0xe0b0('0x3e')];}catch(_0x3bde8b){_0x46c4ea(_0x3bde8b);}_0x2d5f47(_0x54f646);});}function updateChatInteraction(_0x52ffe4,_0x2aad80,_0x309bbf){return new BPromise(function(_0x528818,_0x515bd2){return getInteractionUsers(_0x52ffe4,_0x309bbf)[_0xe0b0('0x20')](function(_0x247f8d){return getInteractionTags(_0x247f8d,_0x2aad80);})['then'](function(_0x18a59d){_0x528818(_0x18a59d);})[_0xe0b0('0x27')](function(_0x6bca5c){_0x515bd2(_0x6bca5c);});});}exports[_0xe0b0('0x43')]=function(_0x1a8cc7,_0x5c31b5){var _0x5d2fa2={},_0x51c580={},_0xc3235b={'count':0x0,'rows':[]};var _0x38e715=_['map'](db[_0xe0b0('0x44')][_0xe0b0('0x45')],function(_0x14197b){return{'name':_0x14197b[_0xe0b0('0x46')],'type':_0x14197b[_0xe0b0('0x47')]['key']};});_0x51c580['model']=_[_0xe0b0('0x3d')](_0x38e715,_0xe0b0('0x48'));_0x51c580[_0xe0b0('0x49')]=_[_0xe0b0('0x4a')](_0x1a8cc7[_0xe0b0('0x49')]);_0x51c580['filters']=_[_0xe0b0('0x4b')](_0x51c580[_0xe0b0('0x4c')],_0x51c580['query']);_0x5d2fa2['attributes']=_['intersection'](_0x51c580[_0xe0b0('0x4c')],qs[_0xe0b0('0x4d')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x4d')]));_0x5d2fa2['attributes']=_0x5d2fa2[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x5d2fa2['attributes']:_0x51c580['model'];if(!_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x50')]('nolimit')){_0x5d2fa2[_0xe0b0('0x2e')]=qs[_0xe0b0('0x2e')](_0x1a8cc7['query']['limit']);_0x5d2fa2[_0xe0b0('0x2c')]=qs['offset'](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x2c')]);}_0x5d2fa2[_0xe0b0('0x51')]=qs[_0xe0b0('0x52')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x52')]);_0x5d2fa2['where']=qs['filters'](_[_0xe0b0('0x53')](_0x1a8cc7['query'],_0x51c580['filters']),_0x38e715);var _0x249d9a=[];var _0x222174=squel['select']()['field']('id')[_0xe0b0('0x54')](_0xe0b0('0x48'))[_0xe0b0('0x54')](_0xe0b0('0x55'))[_0xe0b0('0x56')](_0xe0b0('0x57'));var _0x84fabb=squel['select']()[_0xe0b0('0x54')]('u.id')[_0xe0b0('0x54')]('u.fullname')['field'](_0xe0b0('0x58'))[_0xe0b0('0x56')](_0xe0b0('0x59'),'ui')[_0xe0b0('0x5a')](_0xe0b0('0x5b'),'u',_0xe0b0('0x5c'));var _0x4548da=squel[_0xe0b0('0x5d')]()[_0xe0b0('0x56')]('chat_interactions','i')[_0xe0b0('0x5a')]('cm_contacts','c',_0xe0b0('0x5e'))[_0xe0b0('0x5a')](_0xe0b0('0x5b'),'o',_0xe0b0('0x5f'))[_0xe0b0('0x5a')](_0xe0b0('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0xe0b0('0x5a')](_0xe0b0('0x61'),'me',_0xe0b0('0x62'))[_0xe0b0('0x5a')](_0xe0b0('0x63'),'it',_0xe0b0('0x64'))[_0xe0b0('0x5a')](_0xe0b0('0x57'),'t',_0xe0b0('0x65'));var _0xf331df=squel[_0xe0b0('0x66')]();var _0x18ab99=[];var _0xc719d2=squel[_0xe0b0('0x66')]();var _0xcdf97;if(_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x67')]){_0xcdf97=as[_0xe0b0('0x68')](_0x1a8cc7['query'][_0xe0b0('0x67')]);var _0xe7fbac=_0xcdf97[_0xe0b0('0x69')];for(var _0x2f24e6=0x0;_0x2f24e6<_0xcdf97[_0xe0b0('0x6a')][_0xe0b0('0x4f')];_0x2f24e6++){var _0x2bdb59=_0xcdf97['conditions'][_0x2f24e6];var _0x47dcc4='i';var _0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),_0x2bdb59['field']]);if(!_0x139014){switch(_0x2bdb59[_0xe0b0('0x54')]){case _0xe0b0('0x6c'):if(_0x2bdb59[_0xe0b0('0x6d')]==0x1){_0x4548da[_0xe0b0('0x6e')]('`'+_0x2bdb59[_0xe0b0('0x54')]+'`\x20=\x200');}else{_0x4548da[_0xe0b0('0x6e')]('`'+_0x2bdb59[_0xe0b0('0x54')]+_0xe0b0('0x6f'));}break;case'Contact':if(_0x2bdb59[_0xe0b0('0x70')]===_0xe0b0('0x71')){if(_0x2bdb59['value'][_0xe0b0('0x3f')]('\x20')['length']>0x1){_0xf331df[_0xe7fbac]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe0b0('0x72')](_0x2bdb59['value']),null);}else{var _0x4d75e4='%'+_0x2bdb59[_0xe0b0('0x6d')]+'%';_0xf331df[_0xe7fbac](_0xe0b0('0x73'),_0x4d75e4,_0x4d75e4,_0x4d75e4);}}else{_0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),'ContactId']);_0x2bdb59[_0xe0b0('0x54')]=_0xe0b0('0x74');_0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c[_0xe0b0('0x76')],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x77')],_0x14da9c[_0xe0b0('0x6d')]['end']);}break;case'Tag':var _0x4b41a=_0x2bdb59[_0xe0b0('0x6d')][_0xe0b0('0x3f')](',')['map'](function(_0x49b754){return Number(_0x49b754);});_0x4b41a[_0xe0b0('0x40')](function(_0x26f36f){_0xc719d2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x26f36f+',%');});_0x18ab99=_['union'](_0x18ab99,_0x4b41a);break;case _0xe0b0('0x78'):if(_0x2bdb59[_0xe0b0('0x70')]===_0xe0b0('0x71')){_0xf331df[_0xe7fbac](_0xe0b0('0x79'),'%'+_0x2bdb59[_0xe0b0('0x6d')]+'%',null);}else{_0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),_0xe0b0('0x7a')]);_0x2bdb59['field']=_0xe0b0('0x7a');_0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c['text'],_0x14da9c['value']['start'],_0x14da9c['value']['end']);}break;case'body':_0x14da9c=as[_0xe0b0('0x75')]('me',null,_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c['text'],_0x14da9c['value'][_0xe0b0('0x77')],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x2a')]);break;}}else{var _0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c[_0xe0b0('0x76')],_0x14da9c[_0xe0b0('0x6d')]['start'],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x2a')]);}}}else{var _0x86e90=_(_0x1a8cc7[_0xe0b0('0x49')])[_0xe0b0('0x4a')]()[_0xe0b0('0x3d')](function(_0x16a2ae){return _['some'](_0x38e715,[_0xe0b0('0x48'),_0x16a2ae])?_0x16a2ae:undefined;})['compact']()[_0xe0b0('0x6d')]();if(!_[_0xe0b0('0x7b')](_0x86e90)){_0x86e90[_0xe0b0('0x40')](function(_0x9c7221){if(_0x9c7221==='ChatWebsiteId'){_0x4548da[_0xe0b0('0x7c')](_0xe0b0('0x7d'),[]['concat'](_0x1a8cc7['query'][_0x9c7221]));}else if(_0x9c7221===_0xe0b0('0x7e')){var _0x30adc5=JSON[_0xe0b0('0x7f')](_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221])[_0xe0b0('0x80')];var _0x31dd21=JSON[_0xe0b0('0x7f')](_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221])[_0xe0b0('0x81')];_0x4548da[_0xe0b0('0x7c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x30adc5,_0x31dd21);}else{if(_0x1a8cc7['query'][_0x9c7221]===_0xe0b0('0x82')){_0x4548da['where']('i.'+_0x9c7221+'\x20IS\x20NULL');}else{_0x4548da['where']('i.'+_0x9c7221+'\x20=\x20?',_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221]);}}});}if(_0x1a8cc7['query'][_0xe0b0('0x83')]){if(_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x83')]==0x1){_0x4548da[_0xe0b0('0x6e')]('`unreadMessages`\x20=\x200');}else{_0x4548da[_0xe0b0('0x6e')](_0xe0b0('0x84'));}}if(_0x1a8cc7['query'][_0xe0b0('0x85')]){_0x18ab99=_[_0xe0b0('0x86')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x85')])?_0x1a8cc7[_0xe0b0('0x49')]['tag']:new Array(_0x1a8cc7['query']['tag']);_0x18ab99['forEach'](function(_0x5c258b){_0xc719d2['or'](_0xe0b0('0x87'),'%,'+_0x5c258b+',%');});}if(_0x1a8cc7['query'][_0xe0b0('0x88')]){var _0x5f4aaf=_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x88')][_0xe0b0('0x89')]('\x5c','\x5c\x5c')[_0xe0b0('0x89')](/'/g,'\x27\x27');if(qs[_0xe0b0('0x8a')](_0x5f4aaf)){_0xf331df['or'](_0xe0b0('0x8b'),_0x5f4aaf+'%');}else{_0xf331df['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5f4aaf))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5f4aaf+'%');}}}_0x4548da['where'](_0xf331df);_0x4548da[_0xe0b0('0x8c')](_0xe0b0('0x8d'));var _0x264363={'type':db[_0xe0b0('0x8e')][_0xe0b0('0x8f')]['SELECT'],'raw':!![]};var _0x234716=_0x4548da[_0xe0b0('0x90')]();_0x234716[_0xe0b0('0x54')](_0xe0b0('0x8d'));_0x234716[_0xe0b0('0x54')](_0xe0b0('0x91'),_0xe0b0('0x6c'));if(_0x5d2fa2[_0xe0b0('0x51')]){_0x5d2fa2[_0xe0b0('0x51')]['forEach'](function(_0x589c47){var _0x6e0e9=_0x589c47[0x0]===_0xe0b0('0x92')?_0x589c47[0x0]:'i.'+_0x589c47[0x0];_0x4548da['order'](_0x6e0e9,_0x589c47[0x1]===_0xe0b0('0x93')?![]:!![]);});}if(!_[_0xe0b0('0x7b')](_0x18ab99)){_0x4548da[_0xe0b0('0x6e')](_0xc719d2);_0x234716[_0xe0b0('0x7c')](_0xe0b0('0x94'),_0x18ab99);}BPromise[_0xe0b0('0x95')]()[_0xe0b0('0x20')](function(){if(!_0xcdf97){if(_0x1a8cc7[_0xe0b0('0x49')]['ChatWebsiteId'])return;_0x234716['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x4548da[_0xe0b0('0x7c')](_0xe0b0('0x96'));return;}if(_0x1a8cc7['user'][_0xe0b0('0x97')]!==_0xe0b0('0x98'))return;return _0x1a8cc7[_0xe0b0('0x99')][_0xe0b0('0x9a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x56c4b9){if(_['isEmpty'](_0x56c4b9)){_0x234716[_0xe0b0('0x7c')](_0xe0b0('0x9b'));_0x4548da['where'](_0xe0b0('0x9b'));}else{_0x234716[_0xe0b0('0x7c')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x56c4b9,'id'));_0x4548da[_0xe0b0('0x7c')]('i.ChatWebsiteId\x20IN\x20?',_[_0xe0b0('0x3d')](_0x56c4b9,'id'));}});})['then'](function(){if(_0x1a8cc7[_0xe0b0('0x99')][_0xe0b0('0x97')]===_0xe0b0('0x98')&&!_0xcdf97&&!_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x9c')])return[];return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x234716[_0xe0b0('0x9e')](),_0x264363);})[_0xe0b0('0x20')](function(_0x48497e){_0xc3235b[_0xe0b0('0x2f')]=_0x48497e[_0xe0b0('0x4f')];if(_0xc3235b[_0xe0b0('0x2f')]===0x0)return[];return db['sequelize'][_0xe0b0('0x49')](_0x222174['toString'](),_0x264363)[_0xe0b0('0x20')](function(_0x350c40){_0x249d9a=_['keyBy'](_0x350c40,'id');_0x264363=_[_0xe0b0('0x37')](_0x264363,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1a8cc7['query'][_0xe0b0('0x4d')]){_0x5d2fa2['attributes']['forEach'](function(_0x4f027c){_0x4548da[_0xe0b0('0x54')]('i.'+_0x4f027c);});}else{_0x4548da[_0xe0b0('0x54')](_0xe0b0('0x91'),_0xe0b0('0x6c'));_0x4548da[_0xe0b0('0x54')]('a.key',_0xe0b0('0x9f'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa0'),'Account.mandatoryDisposition');_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa1'),'contactName');_0x4548da['field'](_0xe0b0('0xa2'));_0x4548da['field'](_0xe0b0('0xa3'),_0xe0b0('0xa4'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa5'),_0xe0b0('0xa6'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa7'),'Contact.email');_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa8'),_0xe0b0('0xa9'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xaa'),'Contact.mobile');_0x4548da['field'](_0xe0b0('0xab'),_0xe0b0('0xac'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xad'),_0xe0b0('0xae'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xaf'),_0xe0b0('0xb0'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xb1'),'TagIds');}if(_0x5d2fa2[_0xe0b0('0x2e')])_0x4548da[_0xe0b0('0x2e')](_0x5d2fa2[_0xe0b0('0x2e')]);if(_0x5d2fa2[_0xe0b0('0x2c')])_0x4548da['offset'](_0x5d2fa2[_0xe0b0('0x2c')]);return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x4548da[_0xe0b0('0x9e')](),_0x264363);})[_0xe0b0('0x20')](function(_0x484cb2){if(_0x484cb2[_0xe0b0('0x4f')]>0x0)_0x84fabb['where'](_0xe0b0('0xb2'),_[_0xe0b0('0x3d')](_0x484cb2,'id'));return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x84fabb[_0xe0b0('0x9e')](),_0x264363)['then'](function(_0x567e42){var _0x3822e4=_['groupBy'](_0x567e42,_0xe0b0('0xb3'));var _0x4c82d6=[];_0x484cb2[_0xe0b0('0x40')](function(_0x474fbb){_0x4c82d6[_0xe0b0('0x42')](updateChatInteraction(_0x474fbb,_0x249d9a,_0x3822e4));});return BPromise[_0xe0b0('0xb4')](_0x4c82d6);});});})[_0xe0b0('0x20')](function(_0x1bb4da){_0xc3235b[_0xe0b0('0xb5')]=_0x1bb4da;return _0xc3235b;})['then'](respondWithFilteredResult(_0x5c31b5,_0x5d2fa2))['catch'](handleError(_0x5c31b5,null));};exports[_0xe0b0('0xb6')]=function(_0x717e74,_0x184938){var _0x20d6bd={'raw':![],'where':{'id':_0x717e74[_0xe0b0('0xb7')]['id']}},_0xd83992={};_0xd83992[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db[_0xe0b0('0x44')][_0xe0b0('0x45')]);_0xd83992['query']=_['keys'](_0x717e74[_0xe0b0('0x49')]);_0xd83992[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0xd83992[_0xe0b0('0x4c')],_0xd83992[_0xe0b0('0x49')]);_0x20d6bd[_0xe0b0('0x4e')]=_[_0xe0b0('0x4b')](_0xd83992['model'],qs['fields'](_0x717e74[_0xe0b0('0x49')][_0xe0b0('0x4d')]));_0x20d6bd[_0xe0b0('0x4e')]=_0x20d6bd[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x20d6bd[_0xe0b0('0x4e')]:_0xd83992[_0xe0b0('0x4c')];if(_0x717e74[_0xe0b0('0x49')][_0xe0b0('0xb9')]){_0x20d6bd[_0xe0b0('0xba')]=[{'all':!![]}];}_0x20d6bd=_['merge']({},_0x20d6bd,_0x717e74[_0xe0b0('0xbb')]);return db[_0xe0b0('0x44')]['find'](_0x20d6bd)[_0xe0b0('0x20')](handleEntityNotFound(_0x184938,null))[_0xe0b0('0x20')](respondWithResult(_0x184938,null))[_0xe0b0('0x27')](handleError(_0x184938,null));};exports[_0xe0b0('0xbc')]=function(_0x41fdef,_0x594f91){return db[_0xe0b0('0x44')][_0xe0b0('0xbc')](_0x41fdef[_0xe0b0('0x38')],{})[_0xe0b0('0x20')](respondWithResult(_0x594f91,0xc9))[_0xe0b0('0x27')](handleError(_0x594f91,null));};exports['update']=function(_0x475404,_0x58d61b){if(_0x475404[_0xe0b0('0x38')]['id']){delete _0x475404[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')]['find']({'where':{'id':_0x475404['params']['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x58d61b,null))[_0xe0b0('0x20')](saveUpdates(_0x475404[_0xe0b0('0x38')],null))['then'](respondWithResult(_0x58d61b,null))['catch'](handleError(_0x58d61b,null));};exports['destroy']=function(_0x5175e1,_0x57694c){return db['ChatInteraction'][_0xe0b0('0x6b')]({'where':{'id':_0x5175e1[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x57694c,null))[_0xe0b0('0x20')](removeEntity(_0x57694c,null))[_0xe0b0('0x27')](handleError(_0x57694c,null));};exports[_0xe0b0('0xbd')]=function(_0xd73b8a,_0x437588){return db['ChatInteraction']['describe']()[_0xe0b0('0x20')](respondWithResult(_0x437588,null))[_0xe0b0('0x27')](handleError(_0x437588,null));};exports[_0xe0b0('0xbe')]=function(_0x52dfd8,_0x6ab413){var _0x395083=_0x52dfd8[_0xe0b0('0xb7')]['id'];var _0xd231c4;var _0x35ca4e;var _0x1b8d4a;return db['ChatInteraction']['findOne']({'where':{'id':_0x395083}})['then'](function(_0x1ce027){_0xd231c4=_0x1ce027;return db[_0xe0b0('0xbf')][_0xe0b0('0xc0')]({'where':{'id':_0x1ce027[_0xe0b0('0x9c')]},'attributes':['id',_0xe0b0('0xc1'),_0xe0b0('0xc2'),_0xe0b0('0xc3'),_0xe0b0('0xc4'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x28ba25){if(_0x28ba25&&_0x28ba25[_0xe0b0('0xc1')]&&_0x28ba25[_0xe0b0('0xc2')]){_0x35ca4e=_0x28ba25;var _0x5451e7={'interaction':{'id':_0x395083},'agent':{'id':_0x52dfd8[_0xe0b0('0x99')]['id'],'name':_0x52dfd8[_0xe0b0('0x99')][_0xe0b0('0x48')],'fullname':_0x52dfd8['user'][_0xe0b0('0xc5')],'email':_0x52dfd8['user'][_0xe0b0('0xc6')]},'contact':_0x52dfd8[_0xe0b0('0x38')][_0xe0b0('0x39')],'account':_0x52dfd8[_0xe0b0('0x38')][_0xe0b0('0x3b')]};var _0x26df60={'rejectUnauthorized':![],'method':_0xe0b0('0xc7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x28ba25[_0xe0b0('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x52dfd8[_0xe0b0('0x99')]['email']],'buttons':null,'topic':_0x35ca4e[_0xe0b0('0xc3')],'note':_[_0xe0b0('0xc8')](_0x35ca4e[_0xe0b0('0xc4')])?null:getMustacheRender(_0x35ca4e['vidaooNote'],_0x5451e7),'metadata':null},'redirect':_0xe0b0('0xc9'),'json':!![]};try{if(!_[_0xe0b0('0xc8')](_0x35ca4e[_0xe0b0('0xca')])){var _0x566a6e=getMustacheRender(_0x35ca4e[_0xe0b0('0xca')],_0x5451e7);var _0x32f67b=JSON[_0xe0b0('0x7f')](_0x566a6e);_0x26df60[_0xe0b0('0x38')][_0xe0b0('0xcb')]=_0x32f67b;}}catch(_0x15be52){throw new db['Sequelize'][(_0xe0b0('0xcc'))](_0xe0b0('0xcd'));}return rp(_0x26df60);}else{throw new db[(_0xe0b0('0x8e'))][(_0xe0b0('0xcc'))](_0xe0b0('0xce'));}})[_0xe0b0('0x20')](function(_0x38b2cf){_0x1b8d4a=_0x38b2cf;if(_0x1b8d4a['id']){var _0x31b01a={'body':_0x1b8d4a[_0xe0b0('0xcf')],'ChatWebsiteId':_0x35ca4e['id'],'ChatInteractionId':_0xd231c4['id'],'direction':_0xe0b0('0xd0'),'UserId':_0x52dfd8[_0xe0b0('0x99')]['id']};return db['ChatMessage'][_0xe0b0('0xbc')](_0x31b01a,{});}else{throw new db['Sequelize']['ValidationError'](_0xe0b0('0xd1'));}})[_0xe0b0('0x20')](function(){return _0xd231c4['updateAttributes']({'vidaooSessionId':_0x1b8d4a['id']});})[_0xe0b0('0x20')](respondWithResult(_0x6ab413,null))[_0xe0b0('0x27')](handleError(_0x6ab413,null));};exports[_0xe0b0('0xd2')]=function(_0x11e969,_0xa18619){if(_0x11e969[_0xe0b0('0x38')]['id']){delete _0x11e969[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x11e969['params']['id']},'include':[{'model':db[_0xe0b0('0xd3')],'as':_0xe0b0('0xd4')}]})[_0xe0b0('0x20')](handleEntityNotFound(_0xa18619,null))[_0xe0b0('0x20')](saveUpdates(_0x11e969['body'],null))['then'](respondWithResult(_0xa18619,null))[_0xe0b0('0x27')](handleError(_0xa18619,null));};exports[_0xe0b0('0xd5')]=function(_0x333c2a,_0x2cd7db,_0x308d03){if(_0x333c2a[_0xe0b0('0x38')]['id']){delete _0x333c2a[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x333c2a[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](function(_0xaa7a71){if(!_0xaa7a71){logger[_0xe0b0('0x22')](_0xe0b0('0xd6'),_0xe0b0('0xd5'),0x194,_0xe0b0('0xd7'));_0x2cd7db[_0xe0b0('0x28')](0x194);}else{if(_0xaa7a71[_0xe0b0('0x7a')]){throw new db[(_0xe0b0('0x8e'))]['ValidationError'](_0xe0b0('0xd8'));}}return _0xaa7a71;})[_0xe0b0('0x20')](function(_0x36a006){if(_0x36a006){return _0x36a006['update']({'closed':_0x333c2a[_0xe0b0('0x38')][_0xe0b0('0xd9')],'disposition':_0x333c2a[_0xe0b0('0x38')][_0xe0b0('0xda')]})[_0xe0b0('0x20')](function(_0x3532f1){return _0x3532f1;});}})[_0xe0b0('0x20')](function(_0x581ae9){return respondWithRpcPromise(_0xe0b0('0xdb'),'abandon',_0x333c2a[_0xe0b0('0x38')],client9004);})['then'](respondWithResult(_0x2cd7db,null))[_0xe0b0('0x27')](handleError(_0x2cd7db,null));};exports[_0xe0b0('0xdc')]=function(_0x4bd799,_0x2102bc,_0x4f0cbe){_0x4bd799[_0xe0b0('0x38')][_0xe0b0('0x48')]=_0x4bd799[_0xe0b0('0xdd')][_0xe0b0('0xde')];_0x4bd799[_0xe0b0('0x38')][_0xe0b0('0xdf')]=_0x4bd799[_0xe0b0('0xdd')][_0xe0b0('0xe0')];_0x4bd799['body'][_0xe0b0('0x47')]=_0x4bd799['file']['mimetype'];return db[_0xe0b0('0xe1')][_0xe0b0('0xbc')](_0x4bd799[_0xe0b0('0x38')])['then'](respondWithResult(_0x2102bc,0xc9))['catch'](handleError(_0x2102bc,null));};exports[_0xe0b0('0xe2')]=function(_0x3c207e,_0x4fc379,_0x98e7c9){return db[_0xe0b0('0x44')][_0xe0b0('0xc0')]({'where':{'id':_0x3c207e[_0xe0b0('0xb7')]['id']},'raw':!![]})[_0xe0b0('0x20')](handleEntityNotFound(_0x4fc379,null))[_0xe0b0('0x20')](function(_0x4074bb){if(_0x4074bb){if(_0x4074bb[_0xe0b0('0xd9')]){return _0x4fc379[_0xe0b0('0x29')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xe0b0('0xe1')][_0xe0b0('0xc0')]({'where':{'id':_0x3c207e[_0xe0b0('0x49')][_0xe0b0('0xe3')]},'raw':!![]})[_0xe0b0('0x20')](handleEntityNotFound(_0x4fc379,null));}})[_0xe0b0('0x20')](function(_0x54f90a){if(_0x54f90a){var _0x1aa40b=_0x54f90a[_0xe0b0('0xe4')]!==null;var _0x22c8a2=path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],'server/files/attachments/');if(_0x1aa40b){_0x22c8a2=path[_0xe0b0('0xe5')](_0x22c8a2,_0xe0b0('0xe7'));}var _0x321b0b=path[_0xe0b0('0xe5')](_0x22c8a2,_0x54f90a[_0xe0b0('0xdf')]);return _0x4fc379[_0xe0b0('0xe8')](_0x321b0b);}})[_0xe0b0('0x27')](handleError(_0x4fc379,null));};exports[_0xe0b0('0xe9')]=function(_0x1ccfc1,_0x2b1474){var _0x574f0a=null;var _0x108371=null;var _0x3f2ec=null;var _0x4f0db7=null;if(_0x1ccfc1[_0xe0b0('0x38')]['id']){delete _0x1ccfc1['body']['id'];}if(_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')]){_0x4f0db7=path['join'](config[_0xe0b0('0xe6')],_0xe0b0('0xeb'),util[_0xe0b0('0xec')](_0xe0b0('0xed'),Date[_0xe0b0('0xee')]()));_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xef')]=_0x4f0db7;}return db['ChatInteraction']['find']({'where':{'id':_0x1ccfc1[_0xe0b0('0xb7')]['id']},'include':[{'model':db[_0xe0b0('0xf0')],'as':_0xe0b0('0xf1'),'include':[{'model':db['User'],'as':_0xe0b0('0x78')}]}]})[_0xe0b0('0x20')](handleEntityNotFound(_0x2b1474,null))[_0xe0b0('0x20')](saveUpdates(_0x1ccfc1[_0xe0b0('0x38')],null))[_0xe0b0('0x20')](function(_0x117d00){if(_0x117d00){_0x574f0a=_0x117d00;return db[_0xe0b0('0xbf')][_0xe0b0('0x6b')]({'where':{'id':_0x574f0a[_0xe0b0('0x9c')]}});}})[_0xe0b0('0x20')](function(_0x5aa313){if(_0x5aa313){_0x3f2ec=_0x5aa313;return db['CmContact'][_0xe0b0('0x6b')]({'where':{'id':_0x574f0a[_0xe0b0('0x74')]}});}})[_0xe0b0('0x20')](function(_0x3c93c6){if(_0x3c93c6){_0x108371=_0x3c93c6;if(_0x4f0db7){var _0x203351=null;for(var _0x343409=0x1;_0x343409<_0x574f0a[_0xe0b0('0xf1')]['length'];++_0x343409){_0x203351=_0x574f0a[_0xe0b0('0xf1')][_0x343409];var _0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?util['format'](_0xe0b0('0xf2'),_0x3f2ec[_0xe0b0('0xf3')],_0x203351['UserId']):'System';var _0x3b3473=_0x1ccfc1['body'][_0xe0b0('0xf4')]||util['format'](_0xe0b0('0xf2'),_0xe0b0('0xf5'),_0x203351['ContactId']);switch(_0x3f2ec[_0xe0b0('0xf6')]){case _0xe0b0('0xf7'):_0x2e7fe2=_0x203351['UserId']?util[_0xe0b0('0xec')]('%s%d',_0x3f2ec[_0xe0b0('0xf3')],_0x203351[_0xe0b0('0x7a')]):_0xe0b0('0xf8');break;case _0xe0b0('0xf9'):_0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?_0x203351[_0xe0b0('0x78')][_0xe0b0('0xfa')]||_0x203351['User'][_0xe0b0('0xc5')]:_0xe0b0('0xf8');break;case'agent_fullname':_0x2e7fe2=_0x203351['UserId']?_0x203351[_0xe0b0('0x78')]['fullname']:_0xe0b0('0xf8');break;default:_0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?util[_0xe0b0('0xec')](_0xe0b0('0xf2'),_0x3f2ec[_0xe0b0('0xf3')],_0x203351[_0xe0b0('0x7a')]):_0xe0b0('0xf8');}var _0x8364b0=util[_0xe0b0('0xec')](_0xe0b0('0xfb'),moment(_0x203351[_0xe0b0('0x7e')])[_0xe0b0('0xec')](_0xe0b0('0xfc')),_0x203351[_0xe0b0('0xfd')]==='in'?_0x3b3473:_0x2e7fe2,_0x203351['body']);if(!_0x203351[_0xe0b0('0xfe')]){fs[_0xe0b0('0xff')](_0x4f0db7,_0x8364b0);}}return db[_0xe0b0('0x100')][_0xe0b0('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0xe0b0('0x101')],'as':'Smtp','raw':!![]}]});}}})[_0xe0b0('0x20')](function(_0x3a75d8){if(_0x3a75d8&&_0x3a75d8[_0xe0b0('0x102')]&&_0x1ccfc1[_0xe0b0('0x38')]){var _0x1e2ef8={'tls':{'rejectUnauthorized':![]}};if(_0x3a75d8[_0xe0b0('0x102')]['service']){_0x1e2ef8[_0xe0b0('0x103')]=_0x3a75d8['Smtp'][_0xe0b0('0x103')];}else{_0x1e2ef8[_0xe0b0('0x104')]=_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x104')];_0x1e2ef8[_0xe0b0('0x105')]=_0x3a75d8[_0xe0b0('0x102')]['port'];_0x1e2ef8[_0xe0b0('0x106')]=_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x106')];}if(_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x107')]){_0x1e2ef8[_0xe0b0('0x108')]={'user':_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x99')],'pass':_0x3a75d8['Smtp']['pass']};}return respondWithRpcPromise(_0xe0b0('0x109'),'sendMail',{'account':_0x1e2ef8,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x3a75d8['name'],_0x3a75d8[_0xe0b0('0xc6')]||_0x3a75d8['Smtp']['user']),'to':_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')],'subject':_0xe0b0('0x10a'),'text':util[_0xe0b0('0xec')](_0xe0b0('0x10b'),_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')]),'attachments':[{'path':_0x4f0db7}]}})[_0xe0b0('0x20')](function(){return _0x574f0a;})[_0xe0b0('0x27')](function(_0x43f1b1){console['error'](_0x43f1b1);});}else{return _0x574f0a;}})['then'](respondWithStatusCode(_0x2b1474,0xc8))[_0xe0b0('0x27')](handleError(_0x2b1474,null));};exports[_0xe0b0('0x10c')]=function(_0x2b8a03,_0x4f784a,_0x4b5a48){return db[_0xe0b0('0xf0')]['find']({'where':{'id':_0x2b8a03[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x4f784a,null))['then'](function(_0x2e393e){if(_0x2e393e){return _0x2e393e[_0xe0b0('0x10c')](_0x2b8a03[_0xe0b0('0x38')][_0xe0b0('0x10d')],_[_0xe0b0('0x10e')](_0x2b8a03[_0xe0b0('0x38')],[_0xe0b0('0x10d'),'id'])||{});}})['then'](respondWithResult(_0x4f784a,null))[_0xe0b0('0x27')](handleError(_0x4f784a,null));};exports[_0xe0b0('0x10f')]=function(_0x1f3162,_0x22da3a,_0x2b2c68){var _0x5c5c2d={'raw':![],'where':{}};var _0x4d6429={};var _0x322d1b={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x1f3162[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x22da3a,null))[_0xe0b0('0x20')](function(_0x151da2){if(_0x151da2){_0x4d6429[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db['ChatMessage']['rawAttributes']);_0x4d6429[_0xe0b0('0x49')]=_[_0xe0b0('0x4a')](_0x1f3162[_0xe0b0('0x49')]);_0x4d6429[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0x4d6429[_0xe0b0('0x4c')],_0x4d6429[_0xe0b0('0x49')]);_0x5c5c2d[_0xe0b0('0x4e')]=_['intersection'](_0x4d6429[_0xe0b0('0x4c')],qs[_0xe0b0('0x4d')](_0x1f3162[_0xe0b0('0x49')]['fields']));_0x5c5c2d[_0xe0b0('0x4e')]=_0x5c5c2d[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x5c5c2d[_0xe0b0('0x4e')]:_0x4d6429[_0xe0b0('0x4c')];if(!_0x1f3162[_0xe0b0('0x49')]['hasOwnProperty'](_0xe0b0('0x110'))){_0x5c5c2d[_0xe0b0('0x2e')]=qs[_0xe0b0('0x2e')](_0x1f3162['query'][_0xe0b0('0x2e')]);_0x5c5c2d[_0xe0b0('0x2c')]=qs[_0xe0b0('0x2c')](_0x1f3162[_0xe0b0('0x49')]['offset']);}_0x5c5c2d[_0xe0b0('0x51')]=qs[_0xe0b0('0x52')](_0x1f3162[_0xe0b0('0x49')][_0xe0b0('0x52')]);_0x5c5c2d[_0xe0b0('0x7c')]=qs[_0xe0b0('0xb8')](_[_0xe0b0('0x53')](_0x1f3162[_0xe0b0('0x49')],_0x4d6429['filters']));_0x5c5c2d[_0xe0b0('0x7c')]['ChatInteractionId']=_0x151da2['id'];if(_0x1f3162['query'][_0xe0b0('0x88')]){_0x5c5c2d[_0xe0b0('0x7c')]=_[_0xe0b0('0x37')](_0x5c5c2d['where'],{'$or':_[_0xe0b0('0x3d')](_0x5c5c2d['attributes'],function(_0xf0c217){var _0x4c5406={};_0x4c5406[_0xf0c217]={'$like':'%'+_0x1f3162['query']['filter']+'%'};return _0x4c5406;})});}if(_0x1f3162[_0xe0b0('0x49')][_0xe0b0('0x80')]){var _0x55e013=_0x1f3162[_0xe0b0('0x49')]['$gte']['split'](',');var _0x31fa9d={};_0x31fa9d[_0x55e013[0x0]]={'$gte':moment(_0x55e013[0x1])['format'](_0xe0b0('0x111'))};_0x5c5c2d[_0xe0b0('0x7c')]=_[_0xe0b0('0x37')](_0x5c5c2d[_0xe0b0('0x7c')],_0x31fa9d);}_0x5c5c2d=_['merge']({},_0x5c5c2d,_0x1f3162[_0xe0b0('0xbb')]);return db[_0xe0b0('0xf0')][_0xe0b0('0x2f')]({'where':_0x5c5c2d[_0xe0b0('0x7c')]})[_0xe0b0('0x20')](function(_0x51600e){_0x322d1b[_0xe0b0('0x2f')]=_0x51600e;if(_0x1f3162[_0xe0b0('0x49')]['includeAll']){_0x5c5c2d[_0xe0b0('0xba')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b0('0x112')](_0x5c5c2d);})[_0xe0b0('0x20')](function(_0x1e0374){_0x322d1b[_0xe0b0('0xb5')]=_0x1e0374;return _0x322d1b;});}})[_0xe0b0('0x20')](respondWithFilteredResult(_0x22da3a,_0x5c5c2d))[_0xe0b0('0x27')](handleError(_0x22da3a,null));};exports[_0xe0b0('0x113')]=function(_0x5b7b02,_0x565f67,_0x2853bf){var _0x4c0d9d={'where':{}},_0x38dd79={},_0x2dc446={'count':0x0,'rows':[]};return db[_0xe0b0('0x44')][_0xe0b0('0xc0')]({'where':{'id':_0x5b7b02[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x565f67,null))['then'](function(_0x5996a6){if(_0x5996a6){_0x38dd79[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db['ChatMessage'][_0xe0b0('0x45')]);_0x38dd79[_0xe0b0('0x49')]=_['keys'](_0x5b7b02[_0xe0b0('0x49')]);_0x38dd79[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0x38dd79['model'],_0x38dd79[_0xe0b0('0x49')]);_0x4c0d9d[_0xe0b0('0x4e')]=_[_0xe0b0('0x4b')](_0x38dd79[_0xe0b0('0x4c')],qs['fields'](_0x5b7b02[_0xe0b0('0x49')]['fields']));_0x4c0d9d[_0xe0b0('0x4e')]=_0x4c0d9d[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x4c0d9d['attributes']:_0x38dd79[_0xe0b0('0x4c')];if(!_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x50')](_0xe0b0('0x110'))){_0x4c0d9d['limit']=qs[_0xe0b0('0x2e')](_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x2e')]);_0x4c0d9d[_0xe0b0('0x2c')]=qs[_0xe0b0('0x2c')](_0x5b7b02[_0xe0b0('0x49')]['offset']);}_0x4c0d9d['order']=qs['sort'](_0x5b7b02[_0xe0b0('0x49')]['sort']);_0x4c0d9d[_0xe0b0('0x7c')]=qs['filters'](_['pick'](_0x5b7b02[_0xe0b0('0x49')],_0x38dd79[_0xe0b0('0xb8')]));_0x4c0d9d[_0xe0b0('0x7c')][_0xe0b0('0xb3')]=_0x5996a6['id'];if(_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x88')]){_0x4c0d9d[_0xe0b0('0x7c')]=_['merge'](_0x4c0d9d[_0xe0b0('0x7c')],{'$or':_[_0xe0b0('0x3d')](_0x4c0d9d[_0xe0b0('0x4e')],function(_0x15033e){var _0x14ba21={};_0x14ba21[_0x15033e]={'$like':'%'+_0x5b7b02[_0xe0b0('0x49')]['filter']+'%'};return _0x14ba21;})});}_0x4c0d9d['where'][_0xe0b0('0xfe')]=![];if(_0x5b7b02[_0xe0b0('0x49')]['id']){_0x4c0d9d[_0xe0b0('0x7c')]['id']={'$gt':_0x5b7b02[_0xe0b0('0x49')]['id']};}_0x4c0d9d=_[_0xe0b0('0x37')]({},_0x4c0d9d,_0x5b7b02[_0xe0b0('0xbb')]);return db[_0xe0b0('0xf0')]['count']({'where':_0x4c0d9d['where']})[_0xe0b0('0x20')](function(_0x16386b){_0x2dc446[_0xe0b0('0x2f')]=_0x16386b;_0x4c0d9d['include']=[];if(_0x5b7b02['query'][_0xe0b0('0x114')]){_0x4c0d9d[_0xe0b0('0xba')][_0xe0b0('0x42')]({'model':db[_0xe0b0('0x78')],'as':_0xe0b0('0x78'),'attributes':['id',_0xe0b0('0xc5'),_0xe0b0('0xfa')]});}if(_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0xb9')]){_0x4c0d9d[_0xe0b0('0xba')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b0('0x112')](_0x4c0d9d);})['then'](function(_0x2df3df){_0x2dc446['rows']=_0x2df3df;return _0x2dc446;});}})[_0xe0b0('0x20')](respondWithFilteredResult(_0x565f67,_0x4c0d9d))[_0xe0b0('0x27')](handleError(_0x565f67,null));};exports['addTags']=function(_0x236966,_0x41fd0e,_0x17e7d4){return db['ChatInteraction'][_0xe0b0('0x6b')]({'where':{'id':_0x236966[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x41fd0e,null))[_0xe0b0('0x20')](function(_0x19dafb){if(_0x19dafb){return _0x19dafb['setTags'](_0x236966['body'][_0xe0b0('0x10d')],_[_0xe0b0('0x10e')](_0x236966['body'],['ids','id'])||{})[_0xe0b0('0x115')](function(){return db['Tag'][_0xe0b0('0x112')]({'attributes':['id',_0xe0b0('0x48'),_0xe0b0('0x55')],'where':{'id':_0x236966[_0xe0b0('0x38')][_0xe0b0('0x10d')]}});})[_0xe0b0('0x20')](function(_0x36106e){socket['emit'](_0xe0b0('0x116'),{'id':Number(_0x236966['params']['id']),'tags':_0x36106e||[]});return{'id':Number(_0x236966['params']['id']),'tags':_0x36106e||[]};});}})['then'](respondWithResult(_0x41fd0e,null))[_0xe0b0('0x27')](handleError(_0x41fd0e,null));};exports[_0xe0b0('0x117')]=function(_0x263288,_0x7117ca,_0x21ccfe){return db['ChatInteraction']['find']({'where':{'id':_0x263288['params']['id']}})['then'](handleEntityNotFound(_0x7117ca,null))[_0xe0b0('0x20')](function(_0x1bd420){if(_0x1bd420){return _0x1bd420[_0xe0b0('0x117')](_0x263288['query'][_0xe0b0('0x10d')]);}})[_0xe0b0('0x20')](respondWithStatusCode(_0x7117ca,null))[_0xe0b0('0x27')](handleError(_0x7117ca,null));};exports[_0xe0b0('0xe8')]=function(_0x2d2852,_0x16a02b){var _0x125ead=moment()['unix']()[_0xe0b0('0x9e')]();var _0x380fe1=path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],'server',_0xe0b0('0x118'),_0xe0b0('0x119'));var _0x3eb643=path[_0xe0b0('0xe5')](config['root'],'server',_0xe0b0('0x118'),_0xe0b0('0x11a'));var _0x26bd6c=path[_0xe0b0('0xe5')](_0x380fe1,_0x125ead);var _0x104409=util[_0xe0b0('0xec')]('transcript-%d-%s.zip',_0x2d2852[_0xe0b0('0xb7')]['id'],_0x125ead);var _0x6f9dbd=path[_0xe0b0('0xe5')](_0x380fe1,_0x104409);var _0x4c6646=[];_0x4c6646[_0xe0b0('0x42')]({'model':db['User'],'as':_0xe0b0('0x78'),'attributes':['id',_0xe0b0('0xc5')],'raw':!![]});_0x4c6646['push']({'model':db[_0xe0b0('0xd3')],'as':'Contact','attributes':['id','firstName',_0xe0b0('0x11b')],'raw':!![]});if(_0x2d2852['query']['attachments']){_0x4c6646['push']({'model':db[_0xe0b0('0xe1')],'as':_0xe0b0('0xe1'),'raw':!![]});}var _0x573ca9=[{'model':db[_0xe0b0('0xf0')],'as':'Messages','attributes':['id',_0xe0b0('0x38'),_0xe0b0('0x7e'),_0xe0b0('0xfd'),_0xe0b0('0xfe'),'read'],'include':_0x4c6646}];_0x573ca9['push']({'model':db['ChatWebsite'],'as':_0xe0b0('0x11c'),'attributes':['id',_0xe0b0('0x48')]});_0x573ca9['push']({'model':db['User'],'as':_0xe0b0('0x11d'),'attributes':['id',_0xe0b0('0xc5')]});return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x2d2852['params']['id']},'include':_0x573ca9})['then'](handleEntityNotFound(_0x16a02b,null))[_0xe0b0('0x20')](function(_0x329684){if(_0x329684){var _0x5b1bb7=_0x329684[_0xe0b0('0x11e')]({'plain':!![]});fs[_0xe0b0('0x11f')](_0x26bd6c);var _0x5b7df1={'channel':'Chat','account':_0x5b1bb7['Account'][_0xe0b0('0x48')],'agent':_0x5b1bb7[_0xe0b0('0x11d')]?_0x5b1bb7['Owner'][_0xe0b0('0xc5')]:_0xe0b0('0x120'),'createdAt':moment(_0x5b1bb7[_0xe0b0('0x7e')])[_0xe0b0('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')](),'closedAt':_0x5b1bb7[_0xe0b0('0xd9')]?moment(_0x5b1bb7['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')]():'','disposition':_0x5b1bb7['disposition'],'chatInfo':{'browser':_0x5b1bb7[_0xe0b0('0x121')],'os':_0x5b1bb7['osName'],'referer':_0x5b1bb7['referer'],'customerIp':_0x5b1bb7[_0xe0b0('0x122')],'customerPort':_0x5b1bb7[_0xe0b0('0x123')]?_0x5b1bb7[_0xe0b0('0x123')]:_0xe0b0('0x120')},'messages':_(_0x5b1bb7['Messages'])['tail']()['filter']({'secret':![]})['map'](function(_0x26a916){if(_0x26a916[_0xe0b0('0xe1')]){var _0x5b5bb2=path['join'](_0x3eb643,_0x26a916[_0xe0b0('0xe1')][_0xe0b0('0xdf')]);if(fs['existsSync'](_0x5b5bb2)){fs[_0xe0b0('0x124')](_0x5b5bb2)[_0xe0b0('0x125')](fs[_0xe0b0('0x126')](path[_0xe0b0('0xe5')](_0x26bd6c,_0x26a916['Attachment'][_0xe0b0('0xdf')])));}}return{'date':moment(_0x26a916[_0xe0b0('0x7e')])[_0xe0b0('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')](),'sender':_0x26a916[_0xe0b0('0xfd')]===_0xe0b0('0xd0')?_0x26a916[_0xe0b0('0x78')]?_0x26a916['User'][_0xe0b0('0xc5')]:_0xe0b0('0xf8'):_0x26a916[_0xe0b0('0xd4')][_0xe0b0('0x127')]+(_0x26a916[_0xe0b0('0xd4')]['lastName']?'\x20'+_0x26a916[_0xe0b0('0xd4')][_0xe0b0('0x11b')]:''),'body':_0x26a916['Attachment']?_0x26a916[_0xe0b0('0xe1')][_0xe0b0('0xdf')]:_0x26a916[_0xe0b0('0x38')],'direction':_0x26a916[_0xe0b0('0xfd')]===_0xe0b0('0xd0')?'A':'C','secret':_0x26a916[_0xe0b0('0xfe')],'read':_0x26a916['read'],'attachment':_0x26a916[_0xe0b0('0xe1')]};})[_0xe0b0('0x6d')]()};return ejs[_0xe0b0('0x128')](path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],_0xe0b0('0x129'),_0xe0b0('0x12a'),_0xe0b0('0x12b')),{'interaction':_0x5b7df1})[_0xe0b0('0x20')](function(_0x1f5871){var _0x4d12b2=path[_0xe0b0('0xe5')](_0x26bd6c,'transcript-'+_0x5b1bb7['id']+'-'+_0x125ead+_0xe0b0('0x12c'));var _0x4b655d={'path':_0x4d12b2,'channel':'Chat','interactionId':_0x5b1bb7['id']};return pdf[_0xe0b0('0x12d')](_0x1f5871,_0x4b655d);})[_0xe0b0('0x20')](function(){return new BPromise(function(_0x5b8cef,_0x4d4eae){zipdir(_0x26bd6c,{'saveTo':_0x6f9dbd},function(_0x388f0d,_0x317dee){if(_0x388f0d)return _0x4d4eae(_0x388f0d);return _0x5b8cef(_0x317dee);});})['then'](function(){return new BPromise(function(_0x5501c2,_0xa7f2cf){rimraf(_0x26bd6c,function(_0x2c61b3){if(_0x2c61b3)_0xa7f2cf(_0x2c61b3);return _0x5501c2();});});})['then'](function(){return _0x16a02b[_0xe0b0('0xe8')](_0x6f9dbd,_0x104409,function(_0x465315){if(_0x465315){console[_0xe0b0('0x12e')](_0xe0b0('0x12f'),_0x465315);}else{fs['unlinkSync'](_0x6f9dbd);}});});});}else{return _0x16a02b[_0xe0b0('0x28')](0xc8);}})[_0xe0b0('0x27')](handleError(_0x16a02b,null));};
\ No newline at end of file
+var _0x0abf=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags','user_has_chat_interactions','users','chat_interactions','left_join','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','parse','$lte','where','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)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SELECT','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','include','options','params','describe','ChatWebsite','findOne','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','download','mailTranscript','format','transcript-%s.txt','now','User','CmContact','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','root','attachments','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','firstName','views','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','count','reject','update','destroy','end','stack','name','render','merge','body','contact','agent','account','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','rawAttributes','fieldName','type','key','model'];(function(_0x43de77,_0x4c5bee){var _0x3feda3=function(_0x10df0c){while(--_0x10df0c){_0x43de77['push'](_0x43de77['shift']());}};_0x3feda3(++_0x4c5bee);}(_0x0abf,0xe8));var _0xf0ab=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0abf[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xf0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ab('0x1'));var jsonpatch=require(_0xf0ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ab('0x3'));var Mustache=require('mustache');var util=require(_0xf0ab('0x4'));var path=require(_0xf0ab('0x5'));var sox=require(_0xf0ab('0x6'));var csv=require(_0xf0ab('0x7'));var ejs=require(_0xf0ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ab('0x9'));var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf0ab('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0ab('0x12'))(_0xf0ab('0x13'));var utils=require(_0xf0ab('0x14'));var config=require(_0xf0ab('0x15'));var licenseUtil=require(_0xf0ab('0x16'));var db=require(_0xf0ab('0x17'))['db'];config[_0xf0ab('0x18')]=_['defaults'](config[_0xf0ab('0x18')],{'host':_0xf0ab('0x19'),'port':0x18eb});var socket=require(_0xf0ab('0x1a'))(new Redis(config[_0xf0ab('0x18')]));require(_0xf0ab('0x1b'))[_0xf0ab('0x1c')](socket);var jayson=require(_0xf0ab('0x1d'));var client=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232b});var client9004=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x221bac,_0x200cf5,_0x2f4618,_0x230f40){return new BPromise(function(_0x54b0ce,_0x457465){var _0x9e3b47=_0x230f40||client;return _0x9e3b47[_0xf0ab('0x20')](_0x221bac,_0x2f4618)[_0xf0ab('0x21')](function(_0x776619){logger[_0xf0ab('0x22')](_0xf0ab('0x23'),_0x200cf5,_0xf0ab('0x24'));logger[_0xf0ab('0x25')](_0xf0ab('0x26'),_0x200cf5,_0xf0ab('0x24'),JSON[_0xf0ab('0x27')](_0x776619));if(_0x776619[_0xf0ab('0x28')]){if(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x29')]===0x1f4){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x457465(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}logger[_0xf0ab('0x28')](_0xf0ab('0x23'),_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x54b0ce(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}else{logger[_0xf0ab('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,'request\x20sent');_0x54b0ce(_0x776619['result'][_0xf0ab('0x2a')]);}})['catch'](function(_0x3eca32){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x3eca32);_0x457465(_0x3eca32);});});}function respondWithStatusCode(_0x163078,_0x22671e){_0x22671e=_0x22671e||0xcc;return function(_0x10bf5f){if(_0x10bf5f){return _0x163078[_0xf0ab('0x2b')](_0x22671e);}return _0x163078[_0xf0ab('0x2c')](_0x22671e)['end']();};}function respondWithResult(_0x2d0da7,_0x574ce7){_0x574ce7=_0x574ce7||0xc8;return function(_0x55d799){if(_0x55d799){return _0x2d0da7[_0xf0ab('0x2c')](_0x574ce7)[_0xf0ab('0x2d')](_0x55d799);}};}function respondWithFilteredResult(_0x1b223d,_0x445160){return function(_0x43476c){if(_0x43476c){var _0x174052=typeof _0x445160[_0xf0ab('0x2e')]===_0xf0ab('0x2f')&&typeof _0x445160[_0xf0ab('0x30')]===_0xf0ab('0x2f');var _0x21e8ac=_0x43476c[_0xf0ab('0x31')];var _0x58cbe1=_0x174052?0x0:_0x445160[_0xf0ab('0x2e')];var _0x35973a=_0x174052?_0x43476c['count']:_0x445160['offset']+_0x445160[_0xf0ab('0x30')];var _0x1dc84e;if(_0x35973a>=_0x21e8ac){_0x35973a=_0x21e8ac;_0x1dc84e=0xc8;}else{_0x1dc84e=0xce;}_0x1b223d[_0xf0ab('0x2c')](_0x1dc84e);return _0x1b223d['set']('Content-Range',_0x58cbe1+'-'+_0x35973a+'/'+_0x21e8ac)[_0xf0ab('0x2d')](_0x43476c);}return null;};}function patchUpdates(_0x58fa03){return function(_0x1cfd52){try{jsonpatch['apply'](_0x1cfd52,_0x58fa03,!![]);}catch(_0x3f66fa){return BPromise[_0xf0ab('0x32')](_0x3f66fa);}return _0x1cfd52['save']();};}function saveUpdates(_0x56e728,_0x469f42){return function(_0x27c6f9){if(_0x27c6f9){return _0x27c6f9[_0xf0ab('0x33')](_0x56e728)[_0xf0ab('0x21')](function(_0x2519c7){return _0x2519c7;});}return null;};}function removeEntity(_0x36195d,_0x17f3b3){return function(_0xf8f0f4){if(_0xf8f0f4){return _0xf8f0f4[_0xf0ab('0x34')]()[_0xf0ab('0x21')](function(){_0x36195d[_0xf0ab('0x2c')](0xcc)[_0xf0ab('0x35')]();});}};}function handleEntityNotFound(_0x22dcfe,_0x437fdb){return function(_0x5d8443){if(!_0x5d8443){_0x22dcfe[_0xf0ab('0x2b')](0x194);}return _0x5d8443;};}function handleError(_0x45c449,_0xc575ed){_0xc575ed=_0xc575ed||0x1f4;return function(_0x5c9192){logger[_0xf0ab('0x28')](_0x5c9192[_0xf0ab('0x36')]);if(_0x5c9192[_0xf0ab('0x37')]){delete _0x5c9192['name'];}_0x45c449[_0xf0ab('0x2c')](_0xc575ed)['send'](_0x5c9192);};}function getMustacheRender(_0xda3971,_0x492d7c){return Mustache[_0xf0ab('0x38')](_0xda3971,_[_0xf0ab('0x39')](_0x492d7c[_0xf0ab('0x3a')],{'contact':_0x492d7c[_0xf0ab('0x3b')],'message':_0x492d7c[_0xf0ab('0x2a')],'agent':_0x492d7c[_0xf0ab('0x3c')],'interaction':_0x492d7c['interaction'],'account':_0x492d7c[_0xf0ab('0x3d')]}))||'';}function getInteractionUsers(_0x683d08,_0x5a6df5){return new BPromise(function(_0x207fbb,_0xce89bc){try{if(_0x5a6df5[_0x683d08['id']]){_0x683d08[_0xf0ab('0x3e')]=_[_0xf0ab('0x3f')](_0x5a6df5[_0x683d08['id']],function(_0x31fa72){return{'id':_0x31fa72['id'],'fullname':_0x31fa72[_0xf0ab('0x40')]};});}}catch(_0x28c20c){_0xce89bc(_0x28c20c);}_0x207fbb(_0x683d08);});}function getInteractionTags(_0x528d4b,_0x406a1d){return new BPromise(function(_0x4f6e93,_0x7c4629){try{if(_0x528d4b['TagIds']){_0x528d4b[_0xf0ab('0x41')]=[];_0x528d4b[_0xf0ab('0x42')][_0xf0ab('0x43')](',')[_0xf0ab('0x44')](function(_0x2b7ed5){_0x528d4b['Tags'][_0xf0ab('0x45')](_0x406a1d[_0x2b7ed5]);});}delete _0x528d4b[_0xf0ab('0x42')];}catch(_0x28e7a4){_0x7c4629(_0x28e7a4);}_0x4f6e93(_0x528d4b);});}function updateChatInteraction(_0x197955,_0x191caf,_0x17a73){return new BPromise(function(_0x45849c,_0x413f5c){return getInteractionUsers(_0x197955,_0x17a73)[_0xf0ab('0x21')](function(_0x3b214a){return getInteractionTags(_0x3b214a,_0x191caf);})[_0xf0ab('0x21')](function(_0x32ec93){_0x45849c(_0x32ec93);})[_0xf0ab('0x46')](function(_0x5e6b6b){_0x413f5c(_0x5e6b6b);});});}exports['index']=function(_0x2fc677,_0x4e6c41){var _0x1fc766={},_0x2d50c0={},_0x4bbdf6={'count':0x0,'rows':[]};var _0x8c2d2c=_[_0xf0ab('0x3f')](db['ChatInteraction'][_0xf0ab('0x47')],function(_0x29cc6a){return{'name':_0x29cc6a[_0xf0ab('0x48')],'type':_0x29cc6a[_0xf0ab('0x49')][_0xf0ab('0x4a')]};});_0x2d50c0[_0xf0ab('0x4b')]=_[_0xf0ab('0x3f')](_0x8c2d2c,_0xf0ab('0x37'));_0x2d50c0[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x2fc677[_0xf0ab('0x4c')]);_0x2d50c0[_0xf0ab('0x4e')]=_[_0xf0ab('0x4f')](_0x2d50c0[_0xf0ab('0x4b')],_0x2d50c0['query']);_0x1fc766['attributes']=_[_0xf0ab('0x4f')](_0x2d50c0['model'],qs['fields'](_0x2fc677['query'][_0xf0ab('0x50')]));_0x1fc766[_0xf0ab('0x51')]=_0x1fc766[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x1fc766[_0xf0ab('0x51')]:_0x2d50c0[_0xf0ab('0x4b')];if(!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x1fc766[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x2fc677[_0xf0ab('0x4c')]['limit']);_0x1fc766[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x1fc766[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x1fc766['where']=qs['filters'](_['pick'](_0x2fc677[_0xf0ab('0x4c')],_0x2d50c0[_0xf0ab('0x4e')]),_0x8c2d2c);var _0x577c85=[];var _0xa1a416=squel[_0xf0ab('0x57')]()['field']('id')[_0xf0ab('0x58')](_0xf0ab('0x37'))[_0xf0ab('0x58')](_0xf0ab('0x59'))[_0xf0ab('0x5a')](_0xf0ab('0x5b'));var _0x26508b=squel['select']()[_0xf0ab('0x58')]('u.id')[_0xf0ab('0x58')]('u.fullname')[_0xf0ab('0x58')]('ui.ChatInteractionId')['from'](_0xf0ab('0x5c'),'ui')['left_join'](_0xf0ab('0x5d'),'u','u.id\x20=\x20ui.UserId');var _0x2eff07=squel['select']()[_0xf0ab('0x5a')](_0xf0ab('0x5e'),'i')[_0xf0ab('0x5f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xf0ab('0x5d'),'o',_0xf0ab('0x60'))['left_join']('chat_websites','a',_0xf0ab('0x61'))[_0xf0ab('0x5f')](_0xf0ab('0x62'),'me',_0xf0ab('0x63'))[_0xf0ab('0x5f')](_0xf0ab('0x64'),'it',_0xf0ab('0x65'))[_0xf0ab('0x5f')](_0xf0ab('0x5b'),'t',_0xf0ab('0x66'));var _0x1e6a4e=squel['expr']();var _0x41ed17=[];var _0x5b24e3=squel[_0xf0ab('0x67')]();var _0x61d3db;if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]){_0x61d3db=as[_0xf0ab('0x69')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]);var _0x1f11aa=_0x61d3db[_0xf0ab('0x6a')];for(var _0x180ee6=0x0;_0x180ee6<_0x61d3db['conditions'][_0xf0ab('0x52')];_0x180ee6++){var _0x2266f3=_0x61d3db[_0xf0ab('0x6b')][_0x180ee6];var _0x1d4a72='i';var _0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0x2266f3[_0xf0ab('0x58')]]);if(!_0x2232eb){switch(_0x2266f3[_0xf0ab('0x58')]){case'unreadMessages':if(_0x2266f3['value']==0x1){_0x2eff07[_0xf0ab('0x6d')]('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6e'));}else{_0x2eff07['having']('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6f'));}break;case _0xf0ab('0x70'):if(_0x2266f3['operator']===_0xf0ab('0x71')){if(_0x2266f3[_0xf0ab('0x72')][_0xf0ab('0x43')]('\x20')[_0xf0ab('0x52')]>0x1){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x73'),qs['getFullTextValue'](_0x2266f3[_0xf0ab('0x72')]),null);}else{var _0x70b02d='%'+_0x2266f3[_0xf0ab('0x72')]+'%';_0x1e6a4e[_0x1f11aa](_0xf0ab('0x74'),_0x70b02d,_0x70b02d,_0x70b02d);}}else{_0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x75')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x75');_0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')]['start'],_0x5154f5['value'][_0xf0ab('0x35')]);}break;case _0xf0ab('0x78'):var _0x325ad6=_0x2266f3['value'][_0xf0ab('0x43')](',')['map'](function(_0x1a32dc){return Number(_0x1a32dc);});_0x325ad6[_0xf0ab('0x44')](function(_0x1787e2){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1787e2+',%');});_0x41ed17=_[_0xf0ab('0x79')](_0x41ed17,_0x325ad6);break;case'User':if(_0x2266f3['operator']===_0xf0ab('0x71')){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x7a'),'%'+_0x2266f3[_0xf0ab('0x72')]+'%',null);}else{_0x2232eb=_['find'](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x7b')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x7b');_0x5154f5=as['buildExpression'](_0x1d4a72,_0x2232eb['type'],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5['text'],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}break;case _0xf0ab('0x3a'):_0x5154f5=as[_0xf0ab('0x76')]('me',null,_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);break;}}else{var _0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}}}else{var _0x42f067=_(_0x2fc677['query'])[_0xf0ab('0x4d')]()[_0xf0ab('0x3f')](function(_0x4c8e95){return _['some'](_0x8c2d2c,['name',_0x4c8e95])?_0x4c8e95:undefined;})[_0xf0ab('0x7d')]()[_0xf0ab('0x72')]();if(!_[_0xf0ab('0x7e')](_0x42f067)){_0x42f067[_0xf0ab('0x44')](function(_0x15aa78){if(_0x15aa78===_0xf0ab('0x7f')){_0x2eff07['where'](_0xf0ab('0x80'),[]['concat'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]));}else if(_0x15aa78==='createdAt'){var _0x2978a9=JSON['parse'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])['$gte'];var _0x58ca28=JSON[_0xf0ab('0x81')](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])[_0xf0ab('0x82')];_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x84'),_0x2978a9,_0x58ca28);}else{if(_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]===_0xf0ab('0x85')){_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x86'));}else{_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x87'),_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]);}}});}if(_0x2fc677[_0xf0ab('0x4c')]['read']){if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x88')]==0x1){_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x89'));}else{_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x8a'));}}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]){_0x41ed17=_[_0xf0ab('0x8c')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')])?_0x2fc677[_0xf0ab('0x4c')]['tag']:new Array(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]);_0x41ed17[_0xf0ab('0x44')](function(_0x2196a7){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2196a7+',%');});}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]){var _0x4463cc=_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]['replace']('\x5c','\x5c\x5c')[_0xf0ab('0x8e')](/'/g,'\x27\x27');if(qs[_0xf0ab('0x8f')](_0x4463cc)){_0x1e6a4e['or']('i.id\x20LIKE\x20?',_0x4463cc+'%');}else{_0x1e6a4e['or'](_0xf0ab('0x90'),qs['getFullTextValue'](_0x4463cc))['or'](_0xf0ab('0x91'),_0x4463cc+'%');}}}_0x2eff07[_0xf0ab('0x83')](_0x1e6a4e);_0x2eff07['group'](_0xf0ab('0x92'));var _0x148a72={'type':db['Sequelize']['QueryTypes'][_0xf0ab('0x93')],'raw':!![]};var _0x58140c=_0x2eff07[_0xf0ab('0x94')]();_0x58140c[_0xf0ab('0x58')]('i.id');_0x58140c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf0ab('0x95'));if(_0x1fc766[_0xf0ab('0x55')]){_0x1fc766[_0xf0ab('0x55')][_0xf0ab('0x44')](function(_0x49c89f){var _0x272f9c=_0x49c89f[0x0]===_0xf0ab('0x96')?_0x49c89f[0x0]:'i.'+_0x49c89f[0x0];_0x2eff07[_0xf0ab('0x55')](_0x272f9c,_0x49c89f[0x1]===_0xf0ab('0x97')?![]:!![]);});}if(!_[_0xf0ab('0x7e')](_0x41ed17)){_0x2eff07['having'](_0x5b24e3);_0x58140c['where'](_0xf0ab('0x98'),_0x41ed17);}BPromise[_0xf0ab('0x99')]()['then'](function(){if(!_0x61d3db){if(_0x2fc677['query'][_0xf0ab('0x7f')])return;_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x9a'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9a'));return;}if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]!==_0xf0ab('0x3c'))return;return _0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9d')]({'attributes':['id'],'raw':!![]})[_0xf0ab('0x21')](function(_0x52eca9){if(_['isEmpty'](_0x52eca9)){_0x58140c[_0xf0ab('0x83')]('i.ChatWebsiteId\x20IS\x20NULL');_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9e'));}else{_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x80'),_['map'](_0x52eca9,'id'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x80'),_[_0xf0ab('0x3f')](_0x52eca9,'id'));}});})[_0xf0ab('0x21')](function(){if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]===_0xf0ab('0x3c')&&!_0x61d3db&&!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x7f')])return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x58140c[_0xf0ab('0xa0')](),_0x148a72);})[_0xf0ab('0x21')](function(_0x4211a1){_0x4bbdf6['count']=_0x4211a1[_0xf0ab('0x52')];if(_0x4bbdf6[_0xf0ab('0x31')]===0x0)return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0xa1a416[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x611cf7){_0x577c85=_['keyBy'](_0x611cf7,'id');_0x148a72=_['merge'](_0x148a72,{'model':db[_0xf0ab('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x50')]){_0x1fc766['attributes'][_0xf0ab('0x44')](function(_0x405b34){_0x2eff07[_0xf0ab('0x58')]('i.'+_0x405b34);});}else{_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa2'),'unreadMessages');_0x2eff07['field'](_0xf0ab('0xa3'),'Account.key');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa4'),'Account.mandatoryDisposition');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa5'),_0xf0ab('0x96'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa6'));_0x2eff07['field'](_0xf0ab('0xa7'),_0xf0ab('0xa8'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa9'),_0xf0ab('0xaa'));_0x2eff07['field'](_0xf0ab('0xab'),_0xf0ab('0xac'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xad'),_0xf0ab('0xae'));_0x2eff07['field'](_0xf0ab('0xaf'),_0xf0ab('0xb0'));_0x2eff07[_0xf0ab('0x58')]('c.fax',_0xf0ab('0xb1'));_0x2eff07['field'](_0xf0ab('0xb2'),_0xf0ab('0xb3'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xb4'),'Owner.internal');_0x2eff07[_0xf0ab('0x58')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1fc766[_0xf0ab('0x30')])_0x2eff07['limit'](_0x1fc766['limit']);if(_0x1fc766[_0xf0ab('0x2e')])_0x2eff07[_0xf0ab('0x2e')](_0x1fc766['offset']);return db['sequelize']['query'](_0x2eff07['toString'](),_0x148a72);})[_0xf0ab('0x21')](function(_0x12d9b6){if(_0x12d9b6[_0xf0ab('0x52')]>0x0)_0x26508b[_0xf0ab('0x83')](_0xf0ab('0xb5'),_['map'](_0x12d9b6,'id'));return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x26508b[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x84eab9){var _0x27cd98=_[_0xf0ab('0xb6')](_0x84eab9,'ChatInteractionId');var _0x16dca7=[];_0x12d9b6[_0xf0ab('0x44')](function(_0x39633a){_0x16dca7[_0xf0ab('0x45')](updateChatInteraction(_0x39633a,_0x577c85,_0x27cd98));});return BPromise[_0xf0ab('0xb7')](_0x16dca7);});});})[_0xf0ab('0x21')](function(_0x527a4b){_0x4bbdf6[_0xf0ab('0xb8')]=_0x527a4b;return _0x4bbdf6;})[_0xf0ab('0x21')](respondWithFilteredResult(_0x4e6c41,_0x1fc766))[_0xf0ab('0x46')](handleError(_0x4e6c41,null));};exports[_0xf0ab('0xb9')]=function(_0x4ca7a3,_0x426419){var _0x395bf6={'raw':![],'where':{'id':_0x4ca7a3['params']['id']}},_0x5b7744={};_0x5b7744[_0xf0ab('0x4b')]=_[_0xf0ab('0x4d')](db[_0xf0ab('0xa1')][_0xf0ab('0x47')]);_0x5b7744[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4ca7a3[_0xf0ab('0x4c')]);_0x5b7744[_0xf0ab('0x4e')]=_['intersection'](_0x5b7744[_0xf0ab('0x4b')],_0x5b7744['query']);_0x395bf6['attributes']=_[_0xf0ab('0x4f')](_0x5b7744[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x395bf6[_0xf0ab('0x51')]=_0x395bf6[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x395bf6['attributes']:_0x5b7744[_0xf0ab('0x4b')];if(_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x395bf6[_0xf0ab('0xbb')]=[{'all':!![]}];}_0x395bf6=_[_0xf0ab('0x39')]({},_0x395bf6,_0x4ca7a3[_0xf0ab('0xbc')]);return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')](_0x395bf6)[_0xf0ab('0x21')](handleEntityNotFound(_0x426419,null))[_0xf0ab('0x21')](respondWithResult(_0x426419,null))['catch'](handleError(_0x426419,null));};exports['create']=function(_0x58946c,_0x2f339d){return db['ChatInteraction']['create'](_0x58946c[_0xf0ab('0x3a')],{})[_0xf0ab('0x21')](respondWithResult(_0x2f339d,0xc9))[_0xf0ab('0x46')](handleError(_0x2f339d,null));};exports[_0xf0ab('0x33')]=function(_0xdf495,_0x55a296){if(_0xdf495[_0xf0ab('0x3a')]['id']){delete _0xdf495[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0xdf495[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x55a296,null))[_0xf0ab('0x21')](saveUpdates(_0xdf495[_0xf0ab('0x3a')],null))['then'](respondWithResult(_0x55a296,null))[_0xf0ab('0x46')](handleError(_0x55a296,null));};exports['destroy']=function(_0x3c1a2c,_0x17a3b6){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3c1a2c[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x17a3b6,null))[_0xf0ab('0x21')](removeEntity(_0x17a3b6,null))[_0xf0ab('0x46')](handleError(_0x17a3b6,null));};exports[_0xf0ab('0xbe')]=function(_0x1f2efa,_0x1d12fb){return db[_0xf0ab('0xa1')]['describe']()[_0xf0ab('0x21')](respondWithResult(_0x1d12fb,null))[_0xf0ab('0x46')](handleError(_0x1d12fb,null));};exports['createVidaooSession']=function(_0x35486d,_0x3f5ade){var _0x135a10=_0x35486d[_0xf0ab('0xbd')]['id'];var _0x48fc7e;var _0x5f55d2;var _0x7c7c3b;return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x135a10}})[_0xf0ab('0x21')](function(_0x2beaaa){_0x48fc7e=_0x2beaaa;return db[_0xf0ab('0xbf')][_0xf0ab('0xc0')]({'where':{'id':_0x2beaaa[_0xf0ab('0x7f')]},'attributes':['id',_0xf0ab('0xc1'),'vidaooEscalation',_0xf0ab('0xc2'),'vidaooNote',_0xf0ab('0xc3')],'raw':!![]});})[_0xf0ab('0x21')](function(_0x354e18){if(_0x354e18&&_0x354e18['vidaooApiKey']&&_0x354e18[_0xf0ab('0xc4')]){_0x5f55d2=_0x354e18;var _0x2068d6={'interaction':{'id':_0x135a10},'agent':{'id':_0x35486d[_0xf0ab('0x9b')]['id'],'name':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x37')],'fullname':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x40')],'email':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]},'contact':_0x35486d['body']['contact'],'account':_0x35486d[_0xf0ab('0x3a')][_0xf0ab('0x3d')]};var _0x35b480={'rejectUnauthorized':![],'method':_0xf0ab('0xc6'),'url':_0xf0ab('0xc7'),'headers':{'X-APIKEY':_0x354e18[_0xf0ab('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]],'buttons':null,'topic':_0x5f55d2[_0xf0ab('0xc2')],'note':_[_0xf0ab('0xc8')](_0x5f55d2['vidaooNote'])?null:getMustacheRender(_0x5f55d2[_0xf0ab('0xc9')],_0x2068d6),'metadata':null},'redirect':_0xf0ab('0xca'),'json':!![]};try{if(!_[_0xf0ab('0xc8')](_0x5f55d2[_0xf0ab('0xc3')])){var _0x41e2d8=getMustacheRender(_0x5f55d2[_0xf0ab('0xc3')],_0x2068d6);var _0x57f44d=JSON[_0xf0ab('0x81')](_0x41e2d8);_0x35b480[_0xf0ab('0x3a')][_0xf0ab('0xcb')]=_0x57f44d;}}catch(_0x533b37){throw new db[(_0xf0ab('0xcc'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x35b480);}else{throw new db[(_0xf0ab('0xcc'))][(_0xf0ab('0xcd'))](_0xf0ab('0xce'));}})['then'](function(_0x1697ca){_0x7c7c3b=_0x1697ca;if(_0x7c7c3b['id']){var _0x15da8a={'body':_0x7c7c3b[_0xf0ab('0xcf')],'ChatWebsiteId':_0x5f55d2['id'],'ChatInteractionId':_0x48fc7e['id'],'direction':'out','UserId':_0x35486d[_0xf0ab('0x9b')]['id']};return db[_0xf0ab('0xd0')][_0xf0ab('0xd1')](_0x15da8a,{});}else{throw new db['Sequelize'][(_0xf0ab('0xcd'))](_0xf0ab('0xd2'));}})[_0xf0ab('0x21')](function(){return _0x48fc7e[_0xf0ab('0xd3')]({'vidaooSessionId':_0x7c7c3b['id']});})[_0xf0ab('0x21')](respondWithResult(_0x3f5ade,null))[_0xf0ab('0x46')](handleError(_0x3f5ade,null));};exports[_0xf0ab('0xd4')]=function(_0x115e3d,_0x2d0f9c){if(_0x115e3d[_0xf0ab('0x3a')]['id']){delete _0x115e3d[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x115e3d[_0xf0ab('0xbd')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x2d0f9c,null))[_0xf0ab('0x21')](saveUpdates(_0x115e3d['body'],null))[_0xf0ab('0x21')](respondWithResult(_0x2d0f9c,null))['catch'](handleError(_0x2d0f9c,null));};exports[_0xf0ab('0xd5')]=function(_0x1e9768,_0x4398a3,_0x4195d9){if(_0x1e9768[_0xf0ab('0x3a')]['id']){delete _0x1e9768[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x1e9768[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](function(_0x5f10a5){if(!_0x5f10a5){logger[_0xf0ab('0x28')](_0xf0ab('0xd6'),_0xf0ab('0xd5'),0x194,_0xf0ab('0xd7'));_0x4398a3[_0xf0ab('0x2b')](0x194);}else{if(_0x5f10a5[_0xf0ab('0x7b')]){throw new db['Sequelize']['ValidationError'](_0xf0ab('0xd8'));}}return _0x5f10a5;})[_0xf0ab('0x21')](function(_0x564124){if(_0x564124){return _0x564124[_0xf0ab('0x33')]({'closed':_0x1e9768[_0xf0ab('0x3a')][_0xf0ab('0xd9')],'disposition':_0x1e9768['body'][_0xf0ab('0xda')]})[_0xf0ab('0x21')](function(_0x2d9046){return _0x2d9046;});}})[_0xf0ab('0x21')](function(_0x4e5f1e){return respondWithRpcPromise(_0xf0ab('0xdb'),_0xf0ab('0xd5'),_0x1e9768[_0xf0ab('0x3a')],client9004);})['then'](respondWithResult(_0x4398a3,null))['catch'](handleError(_0x4398a3,null));};exports['attachmentUpload']=function(_0x581cb1,_0x22251d,_0x2b5993){_0x581cb1[_0xf0ab('0x3a')]['name']=_0x581cb1[_0xf0ab('0xdc')]['originalname'];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0xdd')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xde')];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0x49')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xdf')];return db[_0xf0ab('0xe0')][_0xf0ab('0xd1')](_0x581cb1[_0xf0ab('0x3a')])[_0xf0ab('0x21')](respondWithResult(_0x22251d,0xc9))[_0xf0ab('0x46')](handleError(_0x22251d,null));};exports[_0xf0ab('0xe1')]=function(_0x4d09bf,_0x415b9d,_0x11ed58){return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x4d09bf[_0xf0ab('0xbd')]['id']},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null))[_0xf0ab('0x21')](function(_0x278e32){if(_0x278e32){if(_0x278e32['closed']){return _0x415b9d[_0xf0ab('0x2c')](0x193)[_0xf0ab('0x2d')]({'status':0x193,'message':_0xf0ab('0xe2')});}return db[_0xf0ab('0xe0')][_0xf0ab('0xc0')]({'where':{'id':_0x4d09bf[_0xf0ab('0x4c')][_0xf0ab('0xe3')]},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null));}})['then'](function(_0xadae03){if(_0xadae03){var _0x550b00=_0xadae03[_0xf0ab('0xe4')]!==null;var _0x2bfb6a=path[_0xf0ab('0xe5')](config['root'],_0xf0ab('0xe6'));if(_0x550b00){_0x2bfb6a=path[_0xf0ab('0xe5')](_0x2bfb6a,'offline-chat/');}var _0x5d62e4=path['join'](_0x2bfb6a,_0xadae03['basename']);return _0x415b9d[_0xf0ab('0xe7')](_0x5d62e4);}})['catch'](handleError(_0x415b9d,null));};exports['close']=function(_0x3b8bbe,_0x7e24c4){var _0x2d0ea3=null;var _0x4a18ad=null;var _0x57aaae=null;var _0x2ab0be=null;if(_0x3b8bbe[_0xf0ab('0x3a')]['id']){delete _0x3b8bbe['body']['id'];}if(_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')]){_0x2ab0be=path['join'](config['root'],'server/files/chat/upload/',util[_0xf0ab('0xe9')](_0xf0ab('0xea'),Date[_0xf0ab('0xeb')]()));_0x3b8bbe[_0xf0ab('0x3a')]['pathTranscript']=_0x2ab0be;}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x3b8bbe['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xf0ab('0xec')],'as':'User'}]}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x7e24c4,null))[_0xf0ab('0x21')](saveUpdates(_0x3b8bbe[_0xf0ab('0x3a')],null))[_0xf0ab('0x21')](function(_0x116c84){if(_0x116c84){_0x2d0ea3=_0x116c84;return db[_0xf0ab('0xbf')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3[_0xf0ab('0x7f')]}});}})[_0xf0ab('0x21')](function(_0x1d6e15){if(_0x1d6e15){_0x57aaae=_0x1d6e15;return db[_0xf0ab('0xed')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3['ContactId']}});}})[_0xf0ab('0x21')](function(_0x29427c){if(_0x29427c){_0x4a18ad=_0x29427c;if(_0x2ab0be){var _0x29d4a1=null;for(var _0x50e996=0x1;_0x50e996<_0x2d0ea3['Messages'][_0xf0ab('0x52')];++_0x50e996){_0x29d4a1=_0x2d0ea3[_0xf0ab('0xee')][_0x50e996];var _0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');var _0xc1537e=_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xf2')]||util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0xf0ab('0xf3'),_0x29d4a1[_0xf0ab('0x75')]);switch(_0x57aaae[_0xf0ab('0xf4')]){case _0xf0ab('0xf5'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae['agentAlias'],_0x29d4a1[_0xf0ab('0x7b')]):'System';break;case _0xf0ab('0xf6'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0xf7')]||_0x29d4a1['User'][_0xf0ab('0x40')]:'System';break;case'agent_fullname':_0x8e04bb=_0x29d4a1['UserId']?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0x40')]:_0xf0ab('0xf1');break;default:_0x8e04bb=_0x29d4a1['UserId']?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');}var _0x2c39f0=util[_0xf0ab('0xe9')](_0xf0ab('0xf8'),moment(_0x29d4a1[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0xfa')),_0x29d4a1[_0xf0ab('0xfb')]==='in'?_0xc1537e:_0x8e04bb,_0x29d4a1['body']);if(!_0x29d4a1[_0xf0ab('0xfc')]){fs[_0xf0ab('0xfd')](_0x2ab0be,_0x2c39f0);}}return db[_0xf0ab('0xfe')][_0xf0ab('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf0ab('0xff'),'raw':!![]}]});}}})['then'](function(_0x21eb2b){if(_0x21eb2b&&_0x21eb2b['Smtp']&&_0x3b8bbe[_0xf0ab('0x3a')]){var _0x262659={'tls':{'rejectUnauthorized':![]}};if(_0x21eb2b['Smtp'][_0xf0ab('0x100')]){_0x262659[_0xf0ab('0x100')]=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x100')];}else{_0x262659[_0xf0ab('0x101')]=_0x21eb2b['Smtp'][_0xf0ab('0x101')];_0x262659[_0xf0ab('0x102')]=_0x21eb2b[_0xf0ab('0xff')]['port'];_0x262659['secure']=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x103')];}if(_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x104')]){_0x262659['auth']={'user':_0x21eb2b['Smtp'][_0xf0ab('0x9b')],'pass':_0x21eb2b[_0xf0ab('0xff')]['pass']};}return respondWithRpcPromise('SendMail',_0xf0ab('0x105'),{'account':_0x262659,'message':{'from':util['format'](_0xf0ab('0x106'),_0x21eb2b['name'],_0x21eb2b[_0xf0ab('0xc5')]||_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x9b')]),'to':_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')],'subject':_0xf0ab('0x107'),'text':util[_0xf0ab('0xe9')](_0xf0ab('0x108'),_0x3b8bbe['body'][_0xf0ab('0xe8')]),'attachments':[{'path':_0x2ab0be}]}})[_0xf0ab('0x21')](function(){return _0x2d0ea3;})[_0xf0ab('0x46')](function(_0x15f041){console[_0xf0ab('0x28')](_0x15f041);});}else{return _0x2d0ea3;}})['then'](respondWithStatusCode(_0x7e24c4,0xc8))[_0xf0ab('0x46')](handleError(_0x7e24c4,null));};exports[_0xf0ab('0x109')]=function(_0x5eda4b,_0x57a8ab,_0x3cee1d){return db[_0xf0ab('0xd0')][_0xf0ab('0x6c')]({'where':{'id':_0x5eda4b[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x57a8ab,null))[_0xf0ab('0x21')](function(_0x4dff6e){if(_0x4dff6e){return _0x4dff6e[_0xf0ab('0x109')](_0x5eda4b[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_[_0xf0ab('0x10b')](_0x5eda4b[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{});}})['then'](respondWithResult(_0x57a8ab,null))[_0xf0ab('0x46')](handleError(_0x57a8ab,null));};exports['getMessages']=function(_0x283bf5,_0x1afcea,_0x22a9f8){var _0x33dbfc={'raw':![],'where':{}};var _0x487318={};var _0x546e13={'count':0x0,'rows':[]};return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x283bf5[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x1afcea,null))[_0xf0ab('0x21')](function(_0xa3b903){if(_0xa3b903){_0x487318['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x487318[_0xf0ab('0x4c')]=_['keys'](_0x283bf5[_0xf0ab('0x4c')]);_0x487318[_0xf0ab('0x4e')]=_['intersection'](_0x487318[_0xf0ab('0x4b')],_0x487318[_0xf0ab('0x4c')]);_0x33dbfc[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x487318[_0xf0ab('0x4b')],qs['fields'](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x33dbfc[_0xf0ab('0x51')]=_0x33dbfc['attributes'][_0xf0ab('0x52')]?_0x33dbfc[_0xf0ab('0x51')]:_0x487318[_0xf0ab('0x4b')];if(!_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x33dbfc[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x33dbfc['offset']=qs['offset'](_0x283bf5[_0xf0ab('0x4c')]['offset']);}_0x33dbfc['order']=qs[_0xf0ab('0x56')](_0x283bf5[_0xf0ab('0x4c')]['sort']);_0x33dbfc[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x283bf5['query'],_0x487318[_0xf0ab('0x4e')]));_0x33dbfc['where'][_0xf0ab('0x10d')]=_0xa3b903['id'];if(_0x283bf5['query'][_0xf0ab('0x8d')]){_0x33dbfc[_0xf0ab('0x83')]=_[_0xf0ab('0x39')](_0x33dbfc['where'],{'$or':_[_0xf0ab('0x3f')](_0x33dbfc[_0xf0ab('0x51')],function(_0x2ddc1d){var _0x3cef14={};_0x3cef14[_0x2ddc1d]={'$like':'%'+_0x283bf5['query'][_0xf0ab('0x8d')]+'%'};return _0x3cef14;})});}if(_0x283bf5[_0xf0ab('0x4c')]['$gte']){var _0x38ea18=_0x283bf5[_0xf0ab('0x4c')]['$gte']['split'](',');var _0x7ee6b3={};_0x7ee6b3[_0x38ea18[0x0]]={'$gte':moment(_0x38ea18[0x1])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))};_0x33dbfc['where']=_[_0xf0ab('0x39')](_0x33dbfc['where'],_0x7ee6b3);}_0x33dbfc=_[_0xf0ab('0x39')]({},_0x33dbfc,_0x283bf5['options']);return db[_0xf0ab('0xd0')]['count']({'where':_0x33dbfc['where']})['then'](function(_0x1d1451){_0x546e13['count']=_0x1d1451;if(_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x33dbfc[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x33dbfc);})['then'](function(_0x16a1d2){_0x546e13[_0xf0ab('0xb8')]=_0x16a1d2;return _0x546e13;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x1afcea,_0x33dbfc))[_0xf0ab('0x46')](handleError(_0x1afcea,null));};exports[_0xf0ab('0x110')]=function(_0x4b91de,_0x3a602f,_0x47788a){var _0x3592f1={'where':{}},_0x577f13={},_0x2f99c2={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf0ab('0xc0')]({'where':{'id':_0x4b91de[_0xf0ab('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3a602f,null))['then'](function(_0x43c6b8){if(_0x43c6b8){_0x577f13['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x577f13[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4b91de[_0xf0ab('0x4c')]);_0x577f13['filters']=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],_0x577f13[_0xf0ab('0x4c')]);_0x3592f1[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4b91de['query'][_0xf0ab('0x50')]));_0x3592f1[_0xf0ab('0x51')]=_0x3592f1['attributes'][_0xf0ab('0x52')]?_0x3592f1['attributes']:_0x577f13[_0xf0ab('0x4b')];if(!_0x4b91de['query']['hasOwnProperty']('nolimit')){_0x3592f1[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x3592f1[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x3592f1[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x3592f1[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x4b91de[_0xf0ab('0x4c')],_0x577f13[_0xf0ab('0x4e')]));_0x3592f1['where'][_0xf0ab('0x10d')]=_0x43c6b8['id'];if(_0x4b91de['query'][_0xf0ab('0x8d')]){_0x3592f1['where']=_[_0xf0ab('0x39')](_0x3592f1[_0xf0ab('0x83')],{'$or':_[_0xf0ab('0x3f')](_0x3592f1['attributes'],function(_0x58f64c){var _0x5dc7d4={};_0x5dc7d4[_0x58f64c]={'$like':'%'+_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x8d')]+'%'};return _0x5dc7d4;})});}_0x3592f1['where'][_0xf0ab('0xfc')]=![];if(_0x4b91de[_0xf0ab('0x4c')]['id']){_0x3592f1[_0xf0ab('0x83')]['id']={'$gt':_0x4b91de[_0xf0ab('0x4c')]['id']};}_0x3592f1=_['merge']({},_0x3592f1,_0x4b91de['options']);return db[_0xf0ab('0xd0')][_0xf0ab('0x31')]({'where':_0x3592f1[_0xf0ab('0x83')]})[_0xf0ab('0x21')](function(_0x2ab983){_0x2f99c2['count']=_0x2ab983;_0x3592f1[_0xf0ab('0xbb')]=[];if(_0x4b91de['query'][_0xf0ab('0x111')]){_0x3592f1[_0xf0ab('0xbb')][_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id',_0xf0ab('0x40'),_0xf0ab('0xf7')]});}if(_0x4b91de[_0xf0ab('0x4c')]['includeAll']){_0x3592f1[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x3592f1);})[_0xf0ab('0x21')](function(_0x3d70c0){_0x2f99c2[_0xf0ab('0xb8')]=_0x3d70c0;return _0x2f99c2;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x3a602f,_0x3592f1))[_0xf0ab('0x46')](handleError(_0x3a602f,null));};exports['addTags']=function(_0x4d10af,_0x5cf4bd,_0x368523){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x4d10af['params']['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x5cf4bd,null))[_0xf0ab('0x21')](function(_0x46a38a){if(_0x46a38a){return _0x46a38a[_0xf0ab('0x112')](_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_['omit'](_0x4d10af[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{})[_0xf0ab('0x113')](function(){return db['Tag'][_0xf0ab('0x10f')]({'attributes':['id',_0xf0ab('0x37'),_0xf0ab('0x59')],'where':{'id':_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')]}});})[_0xf0ab('0x21')](function(_0x1df97b){socket[_0xf0ab('0x114')](_0xf0ab('0x115'),{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]});return{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]};});}})[_0xf0ab('0x21')](respondWithResult(_0x5cf4bd,null))['catch'](handleError(_0x5cf4bd,null));};exports[_0xf0ab('0x116')]=function(_0x3ca465,_0x4e379d,_0x122e66){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3ca465[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x4e379d,null))[_0xf0ab('0x21')](function(_0x5c56e0){if(_0x5c56e0){return _0x5c56e0[_0xf0ab('0x116')](_0x3ca465[_0xf0ab('0x4c')][_0xf0ab('0x10a')]);}})['then'](respondWithStatusCode(_0x4e379d,null))[_0xf0ab('0x46')](handleError(_0x4e379d,null));};exports[_0xf0ab('0xe7')]=function(_0x2baa40,_0x4ff52d){var _0x2a2fea=moment()[_0xf0ab('0x117')]()[_0xf0ab('0xa0')]();var _0x4eccbd=path['join'](config['root'],_0xf0ab('0x118'),_0xf0ab('0x119'),_0xf0ab('0x11a'));var _0x5b6475=path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],'server',_0xf0ab('0x119'),_0xf0ab('0x11c'));var _0x595bda=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2a2fea);var _0x2bd3e3=util['format']('transcript-%d-%s.zip',_0x2baa40[_0xf0ab('0xbd')]['id'],_0x2a2fea);var _0x25242e=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2bd3e3);var _0x3d8794=[];_0x3d8794[_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id','fullname'],'raw':!![]});_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xed')],'as':_0xf0ab('0x70'),'attributes':['id','firstName',_0xf0ab('0x11d')],'raw':!![]});if(_0x2baa40[_0xf0ab('0x4c')][_0xf0ab('0x11c')]){_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xe0')],'as':'Attachment','raw':!![]});}var _0x243763=[{'model':db[_0xf0ab('0xd0')],'as':_0xf0ab('0xee'),'attributes':['id',_0xf0ab('0x3a'),'createdAt',_0xf0ab('0xfb'),_0xf0ab('0xfc'),_0xf0ab('0x88')],'include':_0x3d8794}];_0x243763['push']({'model':db[_0xf0ab('0xbf')],'as':_0xf0ab('0x11e'),'attributes':['id',_0xf0ab('0x37')]});_0x243763['push']({'model':db[_0xf0ab('0xec')],'as':_0xf0ab('0x11f'),'attributes':['id',_0xf0ab('0x40')]});return db[_0xf0ab('0xa1')]['find']({'where':{'id':_0x2baa40[_0xf0ab('0xbd')]['id']},'include':_0x243763})[_0xf0ab('0x21')](handleEntityNotFound(_0x4ff52d,null))[_0xf0ab('0x21')](function(_0x2c2e20){if(_0x2c2e20){var _0x57bd77=_0x2c2e20[_0xf0ab('0x120')]({'plain':!![]});fs[_0xf0ab('0x121')](_0x595bda);var _0x169b02={'channel':_0xf0ab('0x122'),'account':_0x57bd77[_0xf0ab('0x11e')]['name'],'agent':_0x57bd77[_0xf0ab('0x11f')]?_0x57bd77['Owner'][_0xf0ab('0x40')]:_0xf0ab('0x123'),'createdAt':moment(_0x57bd77[_0xf0ab('0xf9')])['format'](_0xf0ab('0x10e'))['toString'](),'closedAt':_0x57bd77['closed']?moment(_0x57bd77['closedAt'])[_0xf0ab('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x57bd77[_0xf0ab('0xda')],'chatInfo':{'browser':_0x57bd77[_0xf0ab('0x124')],'os':_0x57bd77[_0xf0ab('0x125')],'referer':_0x57bd77[_0xf0ab('0x126')],'customerIp':_0x57bd77[_0xf0ab('0x127')],'customerPort':_0x57bd77['customerPort']?_0x57bd77[_0xf0ab('0x128')]:_0xf0ab('0x123')},'messages':_(_0x57bd77['Messages'])[_0xf0ab('0x129')]()[_0xf0ab('0x8d')]({'secret':![]})[_0xf0ab('0x3f')](function(_0x2aa512){if(_0x2aa512['Attachment']){var _0x26009e=path[_0xf0ab('0xe5')](_0x5b6475,_0x2aa512['Attachment'][_0xf0ab('0xdd')]);if(fs[_0xf0ab('0x12a')](_0x26009e)){fs['createReadStream'](_0x26009e)[_0xf0ab('0x12b')](fs[_0xf0ab('0x12c')](path['join'](_0x595bda,_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')])));}}return{'date':moment(_0x2aa512[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))['toString'](),'sender':_0x2aa512[_0xf0ab('0xfb')]==='out'?_0x2aa512[_0xf0ab('0xec')]?_0x2aa512['User'][_0xf0ab('0x40')]:_0xf0ab('0xf1'):_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x12d')]+(_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x11d')]?'\x20'+_0x2aa512[_0xf0ab('0x70')]['lastName']:''),'body':_0x2aa512[_0xf0ab('0xe0')]?_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')]:_0x2aa512[_0xf0ab('0x3a')],'direction':_0x2aa512[_0xf0ab('0xfb')]==='out'?'A':'C','secret':_0x2aa512[_0xf0ab('0xfc')],'read':_0x2aa512[_0xf0ab('0x88')],'attachment':_0x2aa512[_0xf0ab('0xe0')]};})[_0xf0ab('0x72')]()};return ejs['renderFile'](path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],_0xf0ab('0x118'),_0xf0ab('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x169b02})['then'](function(_0x3ad886){var _0x3df4a2=path['join'](_0x595bda,'transcript-'+_0x57bd77['id']+'-'+_0x2a2fea+_0xf0ab('0x12f'));var _0x378d44={'path':_0x3df4a2,'channel':_0xf0ab('0x122'),'interactionId':_0x57bd77['id']};return pdf[_0xf0ab('0x130')](_0x3ad886,_0x378d44);})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x1e4acb,_0x25a1eb){zipdir(_0x595bda,{'saveTo':_0x25242e},function(_0x406090,_0x414d09){if(_0x406090)return _0x25a1eb(_0x406090);return _0x1e4acb(_0x414d09);});})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x235528,_0x581c80){rimraf(_0x595bda,function(_0x14332a){if(_0x14332a)_0x581c80(_0x14332a);return _0x235528();});});})[_0xf0ab('0x21')](function(){return _0x4ff52d[_0xf0ab('0xe7')](_0x25242e,_0x2bd3e3,function(_0x4f9211){if(_0x4f9211){console[_0xf0ab('0x131')](_0xf0ab('0x132'),_0x4f9211);}else{fs[_0xf0ab('0x133')](_0x25242e);}});});});}else{return _0x4ff52d['sendStatus'](0xc8);}})[_0xf0ab('0x46')](handleError(_0x4ff52d,null));};
\ No newline at end of file
index d2c0006..bb60c0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4804=['save','update','remove','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x8e74c4,_0x4c3b72){var _0x50e53f=function(_0x2a4eef){while(--_0x2a4eef){_0x8e74c4['push'](_0x8e74c4['shift']());}};_0x50e53f(++_0x4c3b72);}(_0x4804,0x15b));var _0x4480=function(_0x531598,_0x3db452){_0x531598=_0x531598-0x0;var _0x47be54=_0x4804[_0x531598];return _0x47be54;};'use strict';var EventEmitter=require(_0x4480('0x0'));var ChatInteraction=require(_0x4480('0x1'))['db'][_0x4480('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x4480('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4480('0x4')](0x0);var events={'afterCreate':_0x4480('0x5'),'afterUpdate':_0x4480('0x6'),'afterDestroy':_0x4480('0x7')};function emitEvent(_0x386300){return function(_0x5ad808,_0x8a023e,_0x16e840){_0x5ad808['getUsers']({'attributes':['id'],'raw':!![]})[_0x4480('0x8')](function(_0x1d8d1c){_0x5ad808[_0x4480('0x9')](_0x4480('0xa'),_0x1d8d1c['map'](function(_0x5508c7){return{'id':_0x5508c7['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5ad808['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4480('0x8')](function(_0x2587c3){_0x5ad808[_0x4480('0x9')](_0x4480('0xb'),_0x2587c3[_0x4480('0xc')]);ChatInteractionEvents[_0x4480('0xd')](_0x386300+':'+_0x5ad808['id'],_0x5ad808);ChatInteractionEvents[_0x4480('0xd')](_0x386300,_0x5ad808);_0x16e840(null);})[_0x4480('0xe')](_0x16e840(null));};}for(var e in events){if(events[_0x4480('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x5896=['save','remove','getUsers','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x3a512f,_0x1d792e){var _0x1914c8=function(_0x1403da){while(--_0x1403da){_0x3a512f['push'](_0x3a512f['shift']());}};_0x1914c8(++_0x1d792e);}(_0x5896,0x16b));var _0x6589=function(_0x2ae293,_0x554e92){_0x2ae293=_0x2ae293-0x0;var _0x39fb6d=_0x5896[_0x2ae293];return _0x39fb6d;};'use strict';var EventEmitter=require(_0x6589('0x0'));var ChatInteraction=require(_0x6589('0x1'))['db'][_0x6589('0x2')];var ChatMessage=require(_0x6589('0x1'))['db'][_0x6589('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6589('0x4')](0x0);var events={'afterCreate':_0x6589('0x5'),'afterUpdate':'update','afterDestroy':_0x6589('0x6')};function emitEvent(_0x49b6e8){return function(_0x211f8f,_0x27a152,_0x27e5df){_0x211f8f[_0x6589('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xde4003){_0x211f8f[_0x6589('0x8')]('Users',_0xde4003[_0x6589('0x9')](function(_0x36e11a){return{'id':_0x36e11a['id']};}));return ChatMessage[_0x6589('0xa')]({'where':{'ChatInteractionId':_0x211f8f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3d336d){_0x211f8f[_0x6589('0x8')](_0x6589('0xb'),_0x3d336d[_0x6589('0xc')]);ChatInteractionEvents['emit'](_0x49b6e8+':'+_0x211f8f['id'],_0x211f8f);ChatInteractionEvents[_0x6589('0xd')](_0x49b6e8,_0x211f8f);_0x27e5df(null);})[_0x6589('0xe')](_0x27e5df(null));};}for(var e in events){if(events[_0x6589('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
index 2b15116..d080fe1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0d2=['utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5ad781,_0x27573a){var _0x82d137=function(_0x4369e2){while(--_0x4369e2){_0x5ad781['push'](_0x5ad781['shift']());}};_0x82d137(++_0x27573a);}(_0xd0d2,0x191));var _0x2d0d=function(_0x585e84,_0x1d8489){_0x585e84=_0x585e84-0x0;var _0x39f3c4=_0xd0d2[_0x585e84];return _0x39f3c4;};'use strict';var _=require(_0x2d0d('0x0'));var util=require(_0x2d0d('0x1'));var logger=require(_0x2d0d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d0d('0x3'));var fs=require('fs');var path=require(_0x2d0d('0x4'));var rimraf=require(_0x2d0d('0x5'));var config=require(_0x2d0d('0x6'));var attributes=require(_0x2d0d('0x7'));module[_0x2d0d('0x8')]=function(_0x50e279,_0xa3fc37){return _0x50e279['define'](_0x2d0d('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3eb451,_0x5875a8,_0x3163e6){if(_0x3eb451[_0x2d0d('0xa')](_0x2d0d('0xb'))){_0x3eb451[_0x2d0d('0xc')]=moment()[_0x2d0d('0xd')](_0x2d0d('0xe'));}_0x3163e6(null,_0x3eb451);}},'charset':'utf8mb4','collate':_0x2d0d('0xf')});};
\ No newline at end of file
+var _0x2f1e=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x2f1e,0xce));var _0xe2f1=function(_0x59db37,_0x14464c){_0x59db37=_0x59db37-0x0;var _0x3a4d97=_0x2f1e[_0x59db37];return _0x3a4d97;};'use strict';var _=require(_0xe2f1('0x0'));var util=require(_0xe2f1('0x1'));var logger=require(_0xe2f1('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe2f1('0x3'));var rp=require(_0xe2f1('0x4'));var fs=require('fs');var path=require(_0xe2f1('0x5'));var rimraf=require(_0xe2f1('0x6'));var config=require(_0xe2f1('0x7'));var attributes=require(_0xe2f1('0x8'));module[_0xe2f1('0x9')]=function(_0x14fd36,_0x4771a2){return _0x14fd36[_0xe2f1('0xa')](_0xe2f1('0xb'),attributes,{'tableName':_0xe2f1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3cea84,_0x433a0a,_0x37ea65){if(_0x3cea84[_0xe2f1('0xd')](_0xe2f1('0xe'))){_0x3cea84[_0xe2f1('0xf')]=moment()[_0xe2f1('0x10')](_0xe2f1('0x11'));}_0x37ea65(null,_0x3cea84);}},'charset':_0xe2f1('0x12'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 180c7bc..5db4c1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x062b=['catch','ChatInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','UpdateChatInteraction','update','options','raw','where','attributes','limit'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x062b,0xdf));var _0xb062=function(_0x62628,_0x35b586){_0x62628=_0x62628-0x0;var _0x50c4f4=_0x062b[_0x62628];return _0x50c4f4;};'use strict';var _=require(_0xb062('0x0'));var util=require(_0xb062('0x1'));var moment=require(_0xb062('0x2'));var BPromise=require('bluebird');var rs=require(_0xb062('0x3'));var fs=require('fs');var Redis=require(_0xb062('0x4'));var db=require(_0xb062('0x5'))['db'];var utils=require(_0xb062('0x6'));var logger=require(_0xb062('0x7'))(_0xb062('0x8'));var config=require(_0xb062('0x9'));var jayson=require(_0xb062('0xa'));var client=jayson[_0xb062('0xb')][_0xb062('0xc')]({'port':0x232a});config[_0xb062('0xd')]=_[_0xb062('0xe')](config[_0xb062('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb062('0xd')]));require(_0xb062('0xf'))[_0xb062('0x10')](socket);function respondWithRpcPromise(_0x52f824,_0x26b15f,_0x298a4b){return new BPromise(function(_0x30719a,_0x516d96){return client[_0xb062('0x11')](_0x52f824,_0x298a4b)[_0xb062('0x12')](function(_0x5ae9c8){logger['info'](_0xb062('0x13'),_0x26b15f,'request\x20sent');logger[_0xb062('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x26b15f,_0xb062('0x15'),JSON[_0xb062('0x16')](_0x5ae9c8));if(_0x5ae9c8[_0xb062('0x17')]){if(_0x5ae9c8[_0xb062('0x17')][_0xb062('0x18')]===0x1f4){logger[_0xb062('0x17')](_0xb062('0x13'),_0x26b15f,_0x5ae9c8[_0xb062('0x17')][_0xb062('0x19')]);return _0x516d96(_0x5ae9c8['error'][_0xb062('0x19')]);}logger[_0xb062('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x26b15f,_0x5ae9c8[_0xb062('0x17')]['message']);return _0x30719a(_0x5ae9c8[_0xb062('0x17')][_0xb062('0x19')]);}else{logger[_0xb062('0x1a')](_0xb062('0x13'),_0x26b15f,'request\x20sent');_0x30719a(_0x5ae9c8[_0xb062('0x1b')][_0xb062('0x19')]);}})['catch'](function(_0x2501ca){logger[_0xb062('0x17')](_0xb062('0x13'),_0x26b15f,_0x2501ca);_0x516d96(_0x2501ca);});});}exports[_0xb062('0x1c')]=function(_0x9a68f0){var _0x3eb4ad=this;return new Promise(function(_0x3c3356,_0x496f7f){return db['ChatInteraction'][_0xb062('0x1d')](_0x9a68f0['body'],{'raw':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0[_0xb062('0x1e')][_0xb062('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0[_0xb062('0x1e')][_0xb062('0x20')]||null:null,'attributes':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0[_0xb062('0x1e')][_0xb062('0x21')]||null:null,'limit':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0['options'][_0xb062('0x22')]||null:null})[_0xb062('0x12')](function(_0x7bc93a){logger['info'](_0xb062('0x1c'),_0x9a68f0);logger['debug'](_0xb062('0x1c'),_0x9a68f0,JSON['stringify'](_0x7bc93a));_0x3c3356(_0x7bc93a);})[_0xb062('0x23')](function(_0x480b83){logger[_0xb062('0x17')](_0xb062('0x1c'),_0x480b83[_0xb062('0x19')],_0x9a68f0);_0x496f7f(_0x3eb4ad[_0xb062('0x17')](0x1f4,_0x480b83[_0xb062('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x460a96){return new Promise(function(_0x2acca0,_0x23c8e9){return db[_0xb062('0x24')]['find']({'where':_0x460a96[_0xb062('0x1e')]?_0x460a96[_0xb062('0x1e')][_0xb062('0x20')]||null:null})[_0xb062('0x12')](function(_0x2ba9f0){if(_0x2ba9f0){return _0x2ba9f0[_0xb062('0x25')](_0x460a96[_0xb062('0x26')][_0xb062('0x27')],_[_0xb062('0x28')](_0x460a96[_0xb062('0x26')],[_0xb062('0x27'),'id'])||{});}})[_0xb062('0x29')](function(_0x4a0783){logger[_0xb062('0x1a')](_0xb062('0x2a'),_0x460a96);logger[_0xb062('0x14')](_0xb062('0x2a'),_0x460a96,JSON[_0xb062('0x16')](_0x4a0783));_0x2acca0(_0x4a0783);})[_0xb062('0x23')](function(_0xca353d){logger[_0xb062('0x17')](_0xb062('0x2a'),_0xca353d[_0xb062('0x19')],_0x460a96);_0x23c8e9(_this['error'](0x1f4,_0xca353d[_0xb062('0x19')]));});});};
\ No newline at end of file
+var _0x8a72=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','spread','AddTags','moment','bluebird','randomstring'];(function(_0x3c1861,_0x134353){var _0x2dfeff=function(_0x2817c8){while(--_0x2817c8){_0x3c1861['push'](_0x3c1861['shift']());}};_0x2dfeff(++_0x134353);}(_0x8a72,0xcf));var _0x28a7=function(_0x2aabab,_0x1c0121){_0x2aabab=_0x2aabab-0x0;var _0x38fdb9=_0x8a72[_0x2aabab];return _0x38fdb9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x28a7('0x0'));var BPromise=require(_0x28a7('0x1'));var rs=require(_0x28a7('0x2'));var fs=require('fs');var Redis=require(_0x28a7('0x3'));var db=require(_0x28a7('0x4'))['db'];var utils=require(_0x28a7('0x5'));var logger=require(_0x28a7('0x6'))('rpc');var config=require(_0x28a7('0x7'));var jayson=require(_0x28a7('0x8'));var client=jayson[_0x28a7('0x9')][_0x28a7('0xa')]({'port':0x232a});config['redis']=_[_0x28a7('0xb')](config[_0x28a7('0xc')],{'host':_0x28a7('0xd'),'port':0x18eb});var socket=require(_0x28a7('0xe'))(new Redis(config['redis']));require(_0x28a7('0xf'))['register'](socket);function respondWithRpcPromise(_0x5a39e8,_0x1efe69,_0x545c1d){return new BPromise(function(_0x13b015,_0x4cf537){return client['request'](_0x5a39e8,_0x545c1d)[_0x28a7('0x10')](function(_0x31a741){logger['info'](_0x28a7('0x11'),_0x1efe69,_0x28a7('0x12'));logger[_0x28a7('0x13')](_0x28a7('0x14'),_0x1efe69,_0x28a7('0x12'),JSON[_0x28a7('0x15')](_0x31a741));if(_0x31a741[_0x28a7('0x16')]){if(_0x31a741[_0x28a7('0x16')][_0x28a7('0x17')]===0x1f4){logger[_0x28a7('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x1efe69,_0x31a741[_0x28a7('0x16')][_0x28a7('0x18')]);return _0x4cf537(_0x31a741['error'][_0x28a7('0x18')]);}logger[_0x28a7('0x16')](_0x28a7('0x11'),_0x1efe69,_0x31a741[_0x28a7('0x16')][_0x28a7('0x18')]);return _0x13b015(_0x31a741[_0x28a7('0x16')]['message']);}else{logger[_0x28a7('0x19')](_0x28a7('0x11'),_0x1efe69,_0x28a7('0x12'));_0x13b015(_0x31a741[_0x28a7('0x1a')][_0x28a7('0x18')]);}})[_0x28a7('0x1b')](function(_0x333db6){logger[_0x28a7('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x1efe69,_0x333db6);_0x4cf537(_0x333db6);});});}exports[_0x28a7('0x1c')]=function(_0x1b81dd){var _0x460d4b=this;return new Promise(function(_0x45b1db,_0x432617){return db['ChatInteraction'][_0x28a7('0x1d')](_0x1b81dd[_0x28a7('0x1e')],{'raw':_0x1b81dd[_0x28a7('0x1f')]?_0x1b81dd[_0x28a7('0x1f')][_0x28a7('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b81dd[_0x28a7('0x1f')]?_0x1b81dd[_0x28a7('0x1f')][_0x28a7('0x21')]||null:null,'attributes':_0x1b81dd[_0x28a7('0x1f')]?_0x1b81dd['options'][_0x28a7('0x22')]||null:null,'limit':_0x1b81dd[_0x28a7('0x1f')]?_0x1b81dd[_0x28a7('0x1f')]['limit']||null:null})[_0x28a7('0x10')](function(_0xd01ada){logger['info']('UpdateChatInteraction',_0x1b81dd);logger[_0x28a7('0x13')](_0x28a7('0x1c'),_0x1b81dd,JSON[_0x28a7('0x15')](_0xd01ada));_0x45b1db(_0xd01ada);})[_0x28a7('0x1b')](function(_0x578189){logger['error'](_0x28a7('0x1c'),_0x578189[_0x28a7('0x18')],_0x1b81dd);_0x432617(_0x460d4b['error'](0x1f4,_0x578189[_0x28a7('0x18')]));});});};exports[_0x28a7('0x23')]=function(_0x1344ed){return new Promise(function(_0x1844c6,_0x4ad175){return db[_0x28a7('0x24')][_0x28a7('0x25')]({'where':_0x1344ed[_0x28a7('0x1f')]?_0x1344ed['options']['where']||null:null})[_0x28a7('0x10')](function(_0x37197d){if(_0x37197d){return _0x37197d[_0x28a7('0x26')](_0x1344ed['body'][_0x28a7('0x27')],_['omit'](_0x1344ed[_0x28a7('0x1e')],[_0x28a7('0x27'),'id'])||{});}})[_0x28a7('0x28')](function(_0x969f2a){logger['info'](_0x28a7('0x29'),_0x1344ed);logger[_0x28a7('0x13')](_0x28a7('0x29'),_0x1344ed,JSON[_0x28a7('0x15')](_0x969f2a));_0x1844c6(_0x969f2a);})[_0x28a7('0x1b')](function(_0x242e37){logger['error']('AddTags',_0x242e37[_0x28a7('0x18')],_0x1344ed);_0x4ad175(_this['error'](0x1f4,_0x242e37[_0x28a7('0x18')]));});});};
\ No newline at end of file
index b437a39..5185d15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc86c=['removeListener','chatInteraction:','./chatInteraction.events','save','emit'];(function(_0x20634c,_0x5534fc){var _0x5d8936=function(_0x6b45f2){while(--_0x6b45f2){_0x20634c['push'](_0x20634c['shift']());}};_0x5d8936(++_0x5534fc);}(_0xc86c,0x138));var _0xcc86=function(_0x42e03b,_0x110aea){_0x42e03b=_0x42e03b-0x0;var _0x3ba84b=_0xc86c[_0x42e03b];return _0x3ba84b;};'use strict';var ChatInteractionEvents=require(_0xcc86('0x0'));var events=[_0xcc86('0x1'),'remove','update'];function createListener(_0x3012b1,_0x3c4260){return function(_0x14639c){_0x3c4260[_0xcc86('0x2')](_0x3012b1,_0x14639c);};}function removeListener(_0x4ee129,_0x5d41db){return function(){ChatInteractionEvents[_0xcc86('0x3')](_0x4ee129,_0x5d41db);};}exports['register']=function(_0x55c925){for(var _0x1f39c4=0x0,_0x501fca=events['length'];_0x1f39c4<_0x501fca;_0x1f39c4++){var _0x2d301a=events[_0x1f39c4];var _0x2b08dd=createListener(_0xcc86('0x4')+_0x2d301a,_0x55c925);ChatInteractionEvents['on'](_0x2d301a,_0x2b08dd);}};
\ No newline at end of file
+var _0x1790=['update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x1f076d,_0xda472b){var _0x58f888=function(_0x502d6f){while(--_0x502d6f){_0x1f076d['push'](_0x1f076d['shift']());}};_0x58f888(++_0xda472b);}(_0x1790,0x11e));var _0x0179=function(_0x361185,_0x372570){_0x361185=_0x361185-0x0;var _0x3f1acb=_0x1790[_0x361185];return _0x3f1acb;};'use strict';var ChatInteractionEvents=require(_0x0179('0x0'));var events=[_0x0179('0x1'),'remove',_0x0179('0x2')];function createListener(_0x14261b,_0x3d721f){return function(_0x5ba01d){_0x3d721f[_0x0179('0x3')](_0x14261b,_0x5ba01d);};}function removeListener(_0x3bd152,_0x1082c8){return function(){ChatInteractionEvents[_0x0179('0x4')](_0x3bd152,_0x1082c8);};}exports[_0x0179('0x5')]=function(_0x36d212){for(var _0x3b310c=0x0,_0x43c0e7=events[_0x0179('0x6')];_0x3b310c<_0x43c0e7;_0x3b310c++){var _0x25f63e=events[_0x3b310c];var _0x20b2fd=createListener(_0x0179('0x7')+_0x25f63e,_0x36d212);ChatInteractionEvents['on'](_0x25f63e,_0x20b2fd);}};
\ No newline at end of file
index 8ff7c7c..08f7111 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaab=['diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession'];(function(_0x344d0a,_0x32bb71){var _0x58a652=function(_0xcda1a7){while(--_0xcda1a7){_0x344d0a['push'](_0x344d0a['shift']());}};_0x58a652(++_0x32bb71);}(_0xcaab,0x10b));var _0xbcaa=function(_0x3f30a5,_0x180083){_0x3f30a5=_0x3f30a5-0x0;var _0x18d972=_0xcaab[_0x3f30a5];return _0x18d972;};'use strict';var multer=require(_0xbcaa('0x0'));var util=require('util');var path=require(_0xbcaa('0x1'));var timeout=require('connect-timeout');var express=require(_0xbcaa('0x2'));var router=express[_0xbcaa('0x3')]();var fs_extra=require(_0xbcaa('0x4'));var auth=require(_0xbcaa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbcaa('0x6'));var controller=require(_0xbcaa('0x7'));router[_0xbcaa('0x8')]('/',auth[_0xbcaa('0x9')](),controller[_0xbcaa('0xa')]);router['get'](_0xbcaa('0xb'),auth[_0xbcaa('0x9')](),controller[_0xbcaa('0xc')]);router[_0xbcaa('0x8')](_0xbcaa('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xbcaa('0xe')]);router[_0xbcaa('0x8')](_0xbcaa('0xf'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x11')]);router[_0xbcaa('0x8')](_0xbcaa('0x12'),auth['isAuthenticated'](),controller[_0xbcaa('0x13')]);router[_0xbcaa('0x8')](_0xbcaa('0x14'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x15')]);router[_0xbcaa('0x8')](_0xbcaa('0x16'),auth[_0xbcaa('0x9')](),controller[_0xbcaa('0x17')]);router['post']('/',auth[_0xbcaa('0x9')](),controller[_0xbcaa('0x18')]);router[_0xbcaa('0x19')](_0xbcaa('0x1a'),auth[_0xbcaa('0x9')](),controller[_0xbcaa('0x1b')]);var upload=multer({'storage':multer[_0xbcaa('0x1c')]({'destination':function(_0x1d7ddd,_0x486a75,_0x1377be){_0x1377be(null,path[_0xbcaa('0x1d')](config[_0xbcaa('0x1e')],_0xbcaa('0x1f')));},'filename':function(_0x437c8c,_0x43379e,_0x5b1613){_0x5b1613(null,util['format'](_0xbcaa('0x20'),Date[_0xbcaa('0x21')](),_0x43379e[_0xbcaa('0x22')][_0xbcaa('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xbcaa('0x24'),upload[_0xbcaa('0x25')](_0xbcaa('0x26')),controller[_0xbcaa('0x27')]);router[_0xbcaa('0x19')](_0xbcaa('0x12'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x28')]);router['post'](_0xbcaa('0x29'),auth[_0xbcaa('0x9')](),interaction[_0xbcaa('0x2a')](_0xbcaa('0x2b'),_0xbcaa('0x2c')),controller[_0xbcaa('0x2d')]);router['put'](_0xbcaa('0xd'),auth[_0xbcaa('0x9')](),interaction[_0xbcaa('0x2a')](_0xbcaa('0x2b'),_0xbcaa('0x2e')),controller[_0xbcaa('0x2f')]);router[_0xbcaa('0x30')](_0xbcaa('0x31'),controller[_0xbcaa('0x32')]);router[_0xbcaa('0x30')](_0xbcaa('0x33'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x34')]);router[_0xbcaa('0x30')](_0xbcaa('0x35'),controller[_0xbcaa('0x36')]);router[_0xbcaa('0x37')]('/:id',auth[_0xbcaa('0x9')](),interaction['tracked']('chat',_0xbcaa('0x38')),controller[_0xbcaa('0x39')]);router[_0xbcaa('0x37')](_0xbcaa('0x29'),auth[_0xbcaa('0x9')](),controller['removeTags']);module[_0xbcaa('0x3a')]=router;
\ No newline at end of file
+var _0x40e3=['/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','originalname','replace','single','/:id/tags','tracked','chat','addTags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMyMessages','download','post','create'];(function(_0x4f207b,_0x21ccd7){var _0x3e3bc5=function(_0x346050){while(--_0x346050){_0x4f207b['push'](_0x4f207b['shift']());}};_0x3e3bc5(++_0x21ccd7);}(_0x40e3,0x1ab));var _0x340e=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0x40e3[_0x593564];return _0x211a89;};'use strict';var multer=require(_0x340e('0x0'));var util=require(_0x340e('0x1'));var path=require(_0x340e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x340e('0x3')]();var fs_extra=require(_0x340e('0x4'));var auth=require(_0x340e('0x5'));var interaction=require(_0x340e('0x6'));var config=require(_0x340e('0x7'));var controller=require(_0x340e('0x8'));router[_0x340e('0x9')]('/',auth[_0x340e('0xa')](),controller[_0x340e('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x340e('0xc')]);router[_0x340e('0x9')](_0x340e('0xd'),auth[_0x340e('0xe')](),controller[_0x340e('0xf')]);router['get'](_0x340e('0x10'),auth[_0x340e('0xe')](),controller[_0x340e('0x11')]);router[_0x340e('0x9')](_0x340e('0x12'),auth[_0x340e('0xa')](),controller['getMessages']);router[_0x340e('0x9')]('/:id/my_messages',auth[_0x340e('0xe')](),controller[_0x340e('0x13')]);router[_0x340e('0x9')]('/:id/download',auth[_0x340e('0xa')](),controller[_0x340e('0x14')]);router[_0x340e('0x15')]('/',auth['isAuthenticated'](),controller[_0x340e('0x16')]);router[_0x340e('0x15')](_0x340e('0x17'),auth[_0x340e('0xa')](),controller[_0x340e('0x18')]);var upload=multer({'storage':multer[_0x340e('0x19')]({'destination':function(_0x38d3fa,_0x5b15e0,_0x5d7c26){_0x5d7c26(null,path['join'](config[_0x340e('0x1a')],_0x340e('0x1b')));},'filename':function(_0x5299be,_0x37750d,_0x4d991e){_0x4d991e(null,util[_0x340e('0x1c')](_0x340e('0x1d'),Date['now'](),_0x37750d[_0x340e('0x1e')][_0x340e('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x340e('0x15')]('/:id/attachment_upload',upload[_0x340e('0x20')]('file'),controller['attachmentUpload']);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x340e('0x15')](_0x340e('0x21'),auth[_0x340e('0xa')](),interaction[_0x340e('0x22')](_0x340e('0x23'),'chatinteraction:addtags'),controller[_0x340e('0x24')]);router['put'](_0x340e('0xd'),auth[_0x340e('0xa')](),interaction['tracked']('chat',_0x340e('0x25')),controller[_0x340e('0x26')]);router[_0x340e('0x27')](_0x340e('0x28'),controller[_0x340e('0x29')]);router[_0x340e('0x27')](_0x340e('0x2a'),auth[_0x340e('0xe')](),controller[_0x340e('0x2b')]);router[_0x340e('0x27')]('/:id/close',controller['close']);router['delete'](_0x340e('0xd'),auth['isAuthenticated'](),interaction[_0x340e('0x22')]('chat','chatinteraction:destroy'),controller['destroy']);router['delete']('/:id/tags',auth[_0x340e('0xa')](),controller['removeTags']);module[_0x340e('0x2c')]=router;
\ No newline at end of file
index 6a744ea..544f807 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a3b=['sequelize','TEXT','BOOLEAN','INTEGER'];(function(_0x3fb392,_0x4259ad){var _0x49b16e=function(_0x5aec73){while(--_0x5aec73){_0x3fb392['push'](_0x3fb392['shift']());}};_0x49b16e(++_0x4259ad);}(_0x1a3b,0x138));var _0xb1a3=function(_0x2970f7,_0x2cbd32){_0x2970f7=_0x2970f7-0x0;var _0x263211=_0x1a3b[_0x2970f7];return _0x263211;};'use strict';var Sequelize=require(_0xb1a3('0x0'));module['exports']={'body':{'type':Sequelize[_0xb1a3('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb1a3('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb1a3('0x3')]}};
\ No newline at end of file
+var _0x0057=['medium','sequelize','TEXT'];(function(_0x15a833,_0x5092d6){var _0x371593=function(_0x53b66b){while(--_0x53b66b){_0x15a833['push'](_0x15a833['shift']());}};_0x371593(++_0x5092d6);}(_0x0057,0xd9));var _0x7005=function(_0x3003fc,_0x5ac5de){_0x3003fc=_0x3003fc-0x0;var _0x22cb43=_0x0057[_0x3003fc];return _0x22cb43;};'use strict';var Sequelize=require(_0x7005('0x0'));module['exports']={'body':{'type':Sequelize[_0x7005('0x1')](_0x7005('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 2ee7d6f..3c5eb43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc96=['then','destroy','error','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','ChatInternalMessage','include','findAll','rows','catch','show','fields','length','includeAll','find','create','body','params','describe','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','fullname','role','userpic','online','lastLoginAt','allowmessenger','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','isEmpty','agent','push','messages','FromId','all','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update'];(function(_0x3a6c6d,_0x2dda5c){var _0x4868ed=function(_0x3f3682){while(--_0x3f3682){_0x3a6c6d['push'](_0x3a6c6d['shift']());}};_0x4868ed(++_0x2dda5c);}(_0xcc96,0x17c));var _0x6cc9=function(_0x279b5b,_0x49641e){_0x279b5b=_0x279b5b-0x0;var _0x220f80=_0xcc96[_0x279b5b];return _0x220f80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6cc9('0x0'));var zipdir=require(_0x6cc9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cc9('0x2'));var moment=require(_0x6cc9('0x3'));var BPromise=require(_0x6cc9('0x4'));var Mustache=require(_0x6cc9('0x5'));var util=require(_0x6cc9('0x6'));var path=require(_0x6cc9('0x7'));var sox=require(_0x6cc9('0x8'));var csv=require(_0x6cc9('0x9'));var ejs=require(_0x6cc9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cc9('0xb'));var squel=require(_0x6cc9('0xc'));var crypto=require(_0x6cc9('0xd'));var jsforce=require(_0x6cc9('0xe'));var deskjs=require(_0x6cc9('0xf'));var toCsv=require(_0x6cc9('0x9'));var querystring=require(_0x6cc9('0x10'));var Papa=require(_0x6cc9('0x11'));var Redis=require('ioredis');var authService=require(_0x6cc9('0x12'));var qs=require(_0x6cc9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6cc9('0x14'))(_0x6cc9('0x15'));var utils=require(_0x6cc9('0x16'));var config=require(_0x6cc9('0x17'));var licenseUtil=require(_0x6cc9('0x18'));var db=require('../../mysqldb')['db'];config[_0x6cc9('0x19')]=_[_0x6cc9('0x1a')](config[_0x6cc9('0x19')],{'host':_0x6cc9('0x1b'),'port':0x18eb});var socket=require(_0x6cc9('0x1c'))(new Redis(config['redis']));require(_0x6cc9('0x1d'))[_0x6cc9('0x1e')](socket);function respondWithStatusCode(_0x5e4412,_0x3b3be7){_0x3b3be7=_0x3b3be7||0xcc;return function(_0x27c7cc){if(_0x27c7cc){return _0x5e4412[_0x6cc9('0x1f')](_0x3b3be7);}return _0x5e4412[_0x6cc9('0x20')](_0x3b3be7)[_0x6cc9('0x21')]();};}function respondWithResult(_0x1757a3,_0x129053){_0x129053=_0x129053||0xc8;return function(_0x5bc0e1){if(_0x5bc0e1){return _0x1757a3[_0x6cc9('0x20')](_0x129053)[_0x6cc9('0x22')](_0x5bc0e1);}};}function respondWithFilteredResult(_0x46fdb9,_0x533c1c){return function(_0x584c06){if(_0x584c06){var _0x3fea9d=typeof _0x533c1c[_0x6cc9('0x23')]===_0x6cc9('0x24')&&typeof _0x533c1c[_0x6cc9('0x25')]===_0x6cc9('0x24');var _0x12b1ed=_0x584c06[_0x6cc9('0x26')];var _0x163a54=_0x3fea9d?0x0:_0x533c1c['offset'];var _0x15865b=_0x3fea9d?_0x584c06[_0x6cc9('0x26')]:_0x533c1c['offset']+_0x533c1c['limit'];var _0x2bd696;if(_0x15865b>=_0x12b1ed){_0x15865b=_0x12b1ed;_0x2bd696=0xc8;}else{_0x2bd696=0xce;}_0x46fdb9['status'](_0x2bd696);return _0x46fdb9[_0x6cc9('0x27')](_0x6cc9('0x28'),_0x163a54+'-'+_0x15865b+'/'+_0x12b1ed)[_0x6cc9('0x22')](_0x584c06);}return null;};}function patchUpdates(_0x54db34){return function(_0x227d6d){try{jsonpatch['apply'](_0x227d6d,_0x54db34,!![]);}catch(_0x2b2901){return BPromise[_0x6cc9('0x29')](_0x2b2901);}return _0x227d6d[_0x6cc9('0x2a')]();};}function saveUpdates(_0x4c31e8,_0x192d03){return function(_0x2293c0){if(_0x2293c0){return _0x2293c0[_0x6cc9('0x2b')](_0x4c31e8)[_0x6cc9('0x2c')](function(_0x2f47c6){return _0x2f47c6;});}return null;};}function removeEntity(_0x1c8a36,_0x8e5686){return function(_0x3e2263){if(_0x3e2263){return _0x3e2263[_0x6cc9('0x2d')]()[_0x6cc9('0x2c')](function(){_0x1c8a36[_0x6cc9('0x20')](0xcc)[_0x6cc9('0x21')]();});}};}function handleEntityNotFound(_0x619a4d,_0x2ecda8){return function(_0x3dca84){if(!_0x3dca84){_0x619a4d['sendStatus'](0x194);}return _0x3dca84;};}function handleError(_0x2fa1b6,_0x91a7dd){_0x91a7dd=_0x91a7dd||0x1f4;return function(_0x5627f7){logger[_0x6cc9('0x2e')](_0x5627f7[_0x6cc9('0x2f')]);if(_0x5627f7[_0x6cc9('0x30')]){delete _0x5627f7['name'];}_0x2fa1b6[_0x6cc9('0x20')](_0x91a7dd)['send'](_0x5627f7);};}exports['index']=function(_0x573408,_0xc76fa7){var _0x504474={},_0x4d64f3={},_0x46dfc0={'count':0x0,'rows':[]};var _0x5bd243=_['map'](db['ChatInternalMessage'][_0x6cc9('0x31')],function(_0x264a91){return{'name':_0x264a91[_0x6cc9('0x32')],'type':_0x264a91[_0x6cc9('0x33')][_0x6cc9('0x34')]};});_0x4d64f3[_0x6cc9('0x35')]=_['map'](_0x5bd243,_0x6cc9('0x30'));_0x4d64f3[_0x6cc9('0x36')]=_[_0x6cc9('0x37')](_0x573408[_0x6cc9('0x36')]);_0x4d64f3[_0x6cc9('0x38')]=_[_0x6cc9('0x39')](_0x4d64f3[_0x6cc9('0x35')],_0x4d64f3[_0x6cc9('0x36')]);_0x504474[_0x6cc9('0x3a')]=_[_0x6cc9('0x39')](_0x4d64f3[_0x6cc9('0x35')],qs['fields'](_0x573408[_0x6cc9('0x36')]['fields']));_0x504474[_0x6cc9('0x3a')]=_0x504474[_0x6cc9('0x3a')]['length']?_0x504474[_0x6cc9('0x3a')]:_0x4d64f3[_0x6cc9('0x35')];if(!_0x573408['query']['hasOwnProperty'](_0x6cc9('0x3b'))){_0x504474[_0x6cc9('0x25')]=qs[_0x6cc9('0x25')](_0x573408['query'][_0x6cc9('0x25')]);_0x504474[_0x6cc9('0x23')]=qs['offset'](_0x573408['query'][_0x6cc9('0x23')]);}_0x504474[_0x6cc9('0x3c')]=qs[_0x6cc9('0x3d')](_0x573408[_0x6cc9('0x36')][_0x6cc9('0x3d')]);_0x504474[_0x6cc9('0x3e')]=qs[_0x6cc9('0x38')](_[_0x6cc9('0x3f')](_0x573408[_0x6cc9('0x36')],_0x4d64f3[_0x6cc9('0x38')]),_0x5bd243);if(_0x573408[_0x6cc9('0x36')][_0x6cc9('0x40')]){_0x504474[_0x6cc9('0x3e')]=_[_0x6cc9('0x41')](_0x504474[_0x6cc9('0x3e')],{'$or':_[_0x6cc9('0x42')](_0x5bd243,function(_0x3335ee){if(_0x3335ee[_0x6cc9('0x33')]!==_0x6cc9('0x43')){var _0x1a5cf8={};_0x1a5cf8[_0x3335ee[_0x6cc9('0x30')]]={'$like':'%'+_0x573408[_0x6cc9('0x36')]['filter']+'%'};return _0x1a5cf8;}})});}_0x504474=_['merge']({},_0x504474,_0x573408[_0x6cc9('0x44')]);var _0x99d42b={'where':_0x504474[_0x6cc9('0x3e')]};return db[_0x6cc9('0x45')]['count'](_0x99d42b)[_0x6cc9('0x2c')](function(_0x576087){_0x46dfc0['count']=_0x576087;if(_0x573408[_0x6cc9('0x36')]['includeAll']){_0x504474[_0x6cc9('0x46')]=[{'all':!![]}];}return db[_0x6cc9('0x45')][_0x6cc9('0x47')](_0x504474);})['then'](function(_0xf68238){_0x46dfc0[_0x6cc9('0x48')]=_0xf68238;return _0x46dfc0;})[_0x6cc9('0x2c')](respondWithFilteredResult(_0xc76fa7,_0x504474))[_0x6cc9('0x49')](handleError(_0xc76fa7,null));};exports[_0x6cc9('0x4a')]=function(_0x4621f0,_0x16abce){var _0x190d44={'raw':!![],'where':{'id':_0x4621f0['params']['id']}},_0x1c64b9={};_0x1c64b9['model']=_['keys'](db['ChatInternalMessage'][_0x6cc9('0x31')]);_0x1c64b9[_0x6cc9('0x36')]=_['keys'](_0x4621f0['query']);_0x1c64b9[_0x6cc9('0x38')]=_[_0x6cc9('0x39')](_0x1c64b9[_0x6cc9('0x35')],_0x1c64b9[_0x6cc9('0x36')]);_0x190d44[_0x6cc9('0x3a')]=_[_0x6cc9('0x39')](_0x1c64b9[_0x6cc9('0x35')],qs[_0x6cc9('0x4b')](_0x4621f0[_0x6cc9('0x36')][_0x6cc9('0x4b')]));_0x190d44['attributes']=_0x190d44[_0x6cc9('0x3a')][_0x6cc9('0x4c')]?_0x190d44[_0x6cc9('0x3a')]:_0x1c64b9[_0x6cc9('0x35')];if(_0x4621f0[_0x6cc9('0x36')][_0x6cc9('0x4d')]){_0x190d44[_0x6cc9('0x46')]=[{'all':!![]}];}_0x190d44=_[_0x6cc9('0x41')]({},_0x190d44,_0x4621f0[_0x6cc9('0x44')]);return db['ChatInternalMessage'][_0x6cc9('0x4e')](_0x190d44)[_0x6cc9('0x2c')](handleEntityNotFound(_0x16abce,null))[_0x6cc9('0x2c')](respondWithResult(_0x16abce,null))[_0x6cc9('0x49')](handleError(_0x16abce,null));};exports[_0x6cc9('0x4f')]=function(_0x5373fe,_0x3adea4){return db[_0x6cc9('0x45')][_0x6cc9('0x4f')](_0x5373fe['body'],{})[_0x6cc9('0x2c')](respondWithResult(_0x3adea4,0xc9))['catch'](handleError(_0x3adea4,null));};exports['update']=function(_0x3c0271,_0x9626c){if(_0x3c0271[_0x6cc9('0x50')]['id']){delete _0x3c0271[_0x6cc9('0x50')]['id'];}return db[_0x6cc9('0x45')][_0x6cc9('0x4e')]({'where':{'id':_0x3c0271[_0x6cc9('0x51')]['id']}})[_0x6cc9('0x2c')](handleEntityNotFound(_0x9626c,null))[_0x6cc9('0x2c')](saveUpdates(_0x3c0271[_0x6cc9('0x50')],null))[_0x6cc9('0x2c')](respondWithResult(_0x9626c,null))[_0x6cc9('0x49')](handleError(_0x9626c,null));};exports[_0x6cc9('0x2d')]=function(_0x24fa53,_0x2527c1){return db['ChatInternalMessage'][_0x6cc9('0x4e')]({'where':{'id':_0x24fa53[_0x6cc9('0x51')]['id']}})['then'](handleEntityNotFound(_0x2527c1,null))[_0x6cc9('0x2c')](removeEntity(_0x2527c1,null))['catch'](handleError(_0x2527c1,null));};exports[_0x6cc9('0x52')]=function(_0x202ec3,_0x544580){return db[_0x6cc9('0x45')][_0x6cc9('0x52')]()[_0x6cc9('0x2c')](respondWithResult(_0x544580,null))[_0x6cc9('0x49')](handleError(_0x544580,null));};function wrapUser(_0x13dc12){return function(_0x5ee8c9){var _0x702778=_0x13dc12[_0x6cc9('0x53')]({'plain':!![]});_0x702778['messages']=[];if(_0x5ee8c9){_0x702778[_0x6cc9('0x54')]=_0x5ee8c9[_0x6cc9('0x55')];_0x702778[_0x6cc9('0x56')]=_0x5ee8c9;}else{_0x702778[_0x6cc9('0x54')]=moment(0x0)['format'](_0x6cc9('0x57'));_0x702778[_0x6cc9('0x56')]={};}return _0x702778;};}exports['getUsers']=function(_0x2d2905,_0x1e5671,_0x44d37c){var _0x23caa0=[];return db[_0x6cc9('0x58')][_0x6cc9('0x47')]({'where':{'role':['agent','admin','user']},'attributes':['id',_0x6cc9('0x59'),'name',_0x6cc9('0x5a'),_0x6cc9('0x5b'),'internal',_0x6cc9('0x5c'),_0x6cc9('0x5d'),_0x6cc9('0x5e'),'showWebBar'],'order':qs[_0x6cc9('0x3d')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x6cc9('0x5f'),'attributes':['id',_0x6cc9('0x30'),'type'],'through':{'attributes':[]}}]})[_0x6cc9('0x2c')](function(_0x41386a){if(_0x41386a){var _0x37cc83=_0x2d2905[_0x6cc9('0x60')][_0x6cc9('0x53')]({'plain':!![]});if(!_0x37cc83)throw new Error(_0x6cc9('0x61'));if(_0x37cc83['role']===_0x6cc9('0x60')){return db['UserProfileSection'][_0x6cc9('0x4e')]({'where':{'name':_0x6cc9('0x62'),'userProfileId':_0x37cc83[_0x6cc9('0x63')]},'raw':!![]})[_0x6cc9('0x2c')](function(_0x2ed8f9){if(_0x2ed8f9){if(_0x2ed8f9['autoAssociation']===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2ed8f9['id']},'raw':!![]})[_0x6cc9('0x2c')](function(_0x1721c3){var _0x3ab218=[];if(_[_0x6cc9('0x64')](_0x1721c3)){_0x3ab218=_[_0x6cc9('0x40')](_0x41386a,function(_0x53b07f){if(_0x53b07f[_0x6cc9('0x5a')]!==_0x6cc9('0x65')){return _0x53b07f;}});return _0x3ab218;}else{for(var _0x86df85=0x0;_0x86df85<_0x41386a[_0x6cc9('0x4c')];_0x86df85++){var _0x5e24ba=_0x41386a[_0x86df85];if(_0x5e24ba[_0x6cc9('0x5a')]===_0x6cc9('0x65')){var _0x254e6e=_[_0x6cc9('0x4e')](_0x1721c3,function(_0x27244d){return _0x27244d['resourceId']===_0x5e24ba['id'];});if(_0x254e6e)_0x3ab218[_0x6cc9('0x66')](_0x5e24ba);}else{_0x3ab218[_0x6cc9('0x66')](_0x5e24ba);}}return _0x3ab218;}});}else{return _0x41386a;}}else{var _0x44af76=_[_0x6cc9('0x40')](_0x41386a,function(_0x36b06e){if(_0x36b06e['role']!==_0x6cc9('0x65')){return _0x36b06e;}});return _0x44af76;}});}else{return _0x41386a;}}})[_0x6cc9('0x2c')](function(_0x419c75){var _0x5c3d25=[];if(_0x419c75){_0x23caa0=_0x419c75;for(var _0x12123f=0x0;_0x12123f<_0x419c75[_0x6cc9('0x4c')];_0x12123f+=0x1){_0x23caa0[_0x12123f][_0x6cc9('0x67')]=[];_0x5c3d25['push'](db[_0x6cc9('0x45')][_0x6cc9('0x4e')]({'where':{'FromId':[_0x2d2905[_0x6cc9('0x60')]['id'],_0x419c75[_0x12123f]['id']],'ToId':[_0x2d2905[_0x6cc9('0x60')]['id'],_0x419c75[_0x12123f]['id']],'ChatGroupId':null},'attributes':['id',_0x6cc9('0x55'),_0x6cc9('0x68'),'ToId','read','body'],'order':qs[_0x6cc9('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x6cc9('0x2c')](wrapUser(_0x419c75[_0x12123f])));}return BPromise[_0x6cc9('0x69')](_0x5c3d25);}return[];})[_0x6cc9('0x2c')](function(_0x46b2f9){return{'rows':_0x46b2f9,'count':_0x46b2f9[_0x6cc9('0x4c')]};})[_0x6cc9('0x2c')](respondWithResult(_0x1e5671,null))[_0x6cc9('0x49')](handleError(_0x1e5671,null));};
\ No newline at end of file
+var _0x5db3=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','stack','name','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','agent','push','FromId','read','-createdAt','all','eml-format','rimraf'];(function(_0x1ded0f,_0x2c82a9){var _0x1ad47a=function(_0x5b745b){while(--_0x5b745b){_0x1ded0f['push'](_0x1ded0f['shift']());}};_0x1ad47a(++_0x2c82a9);}(_0x5db3,0xd6));var _0x35db=function(_0x42bfb7,_0x25a3ec){_0x42bfb7=_0x42bfb7-0x0;var _0x5c497d=_0x5db3[_0x42bfb7];return _0x5c497d;};'use strict';var emlformat=require(_0x35db('0x0'));var rimraf=require(_0x35db('0x1'));var zipdir=require(_0x35db('0x2'));var jsonpatch=require(_0x35db('0x3'));var rp=require(_0x35db('0x4'));var moment=require('moment');var BPromise=require(_0x35db('0x5'));var Mustache=require(_0x35db('0x6'));var util=require(_0x35db('0x7'));var path=require(_0x35db('0x8'));var sox=require('sox');var csv=require(_0x35db('0x9'));var ejs=require(_0x35db('0xa'));var fs=require('fs');var fs_extra=require(_0x35db('0xb'));var _=require(_0x35db('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x35db('0xd'));var deskjs=require(_0x35db('0xe'));var toCsv=require(_0x35db('0x9'));var querystring=require(_0x35db('0xf'));var Papa=require(_0x35db('0x10'));var Redis=require(_0x35db('0x11'));var authService=require(_0x35db('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x35db('0x13'));var hardwareService=require(_0x35db('0x14'));var logger=require(_0x35db('0x15'))(_0x35db('0x16'));var utils=require(_0x35db('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x35db('0x18'));var db=require(_0x35db('0x19'))['db'];config[_0x35db('0x1a')]=_[_0x35db('0x1b')](config[_0x35db('0x1a')],{'host':_0x35db('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35db('0x1a')]));require(_0x35db('0x1d'))[_0x35db('0x1e')](socket);function respondWithStatusCode(_0x31913d,_0x1689e2){_0x1689e2=_0x1689e2||0xcc;return function(_0x26b878){if(_0x26b878){return _0x31913d['sendStatus'](_0x1689e2);}return _0x31913d['status'](_0x1689e2)[_0x35db('0x1f')]();};}function respondWithResult(_0x4daf9f,_0x5094c5){_0x5094c5=_0x5094c5||0xc8;return function(_0x177f1e){if(_0x177f1e){return _0x4daf9f[_0x35db('0x20')](_0x5094c5)[_0x35db('0x21')](_0x177f1e);}};}function respondWithFilteredResult(_0x1fb434,_0x4950fe){return function(_0x28808d){if(_0x28808d){var _0x13984f=typeof _0x4950fe[_0x35db('0x22')]==='undefined'&&typeof _0x4950fe['limit']===_0x35db('0x23');var _0x34f9f2=_0x28808d[_0x35db('0x24')];var _0x215e9a=_0x13984f?0x0:_0x4950fe[_0x35db('0x22')];var _0x3594f9=_0x13984f?_0x28808d[_0x35db('0x24')]:_0x4950fe[_0x35db('0x22')]+_0x4950fe[_0x35db('0x25')];var _0x2df1b6;if(_0x3594f9>=_0x34f9f2){_0x3594f9=_0x34f9f2;_0x2df1b6=0xc8;}else{_0x2df1b6=0xce;}_0x1fb434[_0x35db('0x20')](_0x2df1b6);return _0x1fb434[_0x35db('0x26')]('Content-Range',_0x215e9a+'-'+_0x3594f9+'/'+_0x34f9f2)[_0x35db('0x21')](_0x28808d);}return null;};}function patchUpdates(_0x632f5e){return function(_0x10df39){try{jsonpatch[_0x35db('0x27')](_0x10df39,_0x632f5e,!![]);}catch(_0x447c46){return BPromise[_0x35db('0x28')](_0x447c46);}return _0x10df39[_0x35db('0x29')]();};}function saveUpdates(_0x3fb4d7,_0x122d19){return function(_0x4bf00a){if(_0x4bf00a){return _0x4bf00a[_0x35db('0x2a')](_0x3fb4d7)[_0x35db('0x2b')](function(_0x31e298){return _0x31e298;});}return null;};}function removeEntity(_0x50cf95,_0x420457){return function(_0x505617){if(_0x505617){return _0x505617['destroy']()['then'](function(){_0x50cf95[_0x35db('0x20')](0xcc)[_0x35db('0x1f')]();});}};}function handleEntityNotFound(_0xa3a22c,_0x45e185){return function(_0x1ec570){if(!_0x1ec570){_0xa3a22c['sendStatus'](0x194);}return _0x1ec570;};}function handleError(_0x15e97a,_0x4051da){_0x4051da=_0x4051da||0x1f4;return function(_0x12e2ba){logger[_0x35db('0x2c')](_0x12e2ba[_0x35db('0x2d')]);if(_0x12e2ba[_0x35db('0x2e')]){delete _0x12e2ba['name'];}_0x15e97a[_0x35db('0x20')](_0x4051da)['send'](_0x12e2ba);};}exports['index']=function(_0xdde4d8,_0xabe6bf){var _0x18a816={},_0x13e280={},_0x4a33fa={'count':0x0,'rows':[]};var _0x37d809=_['map'](db[_0x35db('0x2f')][_0x35db('0x30')],function(_0x3e137a){return{'name':_0x3e137a[_0x35db('0x31')],'type':_0x3e137a[_0x35db('0x32')][_0x35db('0x33')]};});_0x13e280[_0x35db('0x34')]=_[_0x35db('0x35')](_0x37d809,_0x35db('0x2e'));_0x13e280[_0x35db('0x36')]=_[_0x35db('0x37')](_0xdde4d8[_0x35db('0x36')]);_0x13e280[_0x35db('0x38')]=_[_0x35db('0x39')](_0x13e280[_0x35db('0x34')],_0x13e280[_0x35db('0x36')]);_0x18a816['attributes']=_[_0x35db('0x39')](_0x13e280['model'],qs[_0x35db('0x3a')](_0xdde4d8['query'][_0x35db('0x3a')]));_0x18a816['attributes']=_0x18a816[_0x35db('0x3b')][_0x35db('0x3c')]?_0x18a816['attributes']:_0x13e280[_0x35db('0x34')];if(!_0xdde4d8[_0x35db('0x36')][_0x35db('0x3d')](_0x35db('0x3e'))){_0x18a816[_0x35db('0x25')]=qs['limit'](_0xdde4d8['query'][_0x35db('0x25')]);_0x18a816[_0x35db('0x22')]=qs[_0x35db('0x22')](_0xdde4d8['query'][_0x35db('0x22')]);}_0x18a816['order']=qs[_0x35db('0x3f')](_0xdde4d8[_0x35db('0x36')][_0x35db('0x3f')]);_0x18a816[_0x35db('0x40')]=qs[_0x35db('0x38')](_[_0x35db('0x41')](_0xdde4d8[_0x35db('0x36')],_0x13e280[_0x35db('0x38')]),_0x37d809);if(_0xdde4d8[_0x35db('0x36')][_0x35db('0x42')]){_0x18a816[_0x35db('0x40')]=_[_0x35db('0x43')](_0x18a816[_0x35db('0x40')],{'$or':_['map'](_0x37d809,function(_0x28df3e){if(_0x28df3e['type']!==_0x35db('0x44')){var _0x480200={};_0x480200[_0x28df3e['name']]={'$like':'%'+_0xdde4d8[_0x35db('0x36')][_0x35db('0x42')]+'%'};return _0x480200;}})});}_0x18a816=_[_0x35db('0x43')]({},_0x18a816,_0xdde4d8[_0x35db('0x45')]);var _0x5e0f4a={'where':_0x18a816['where']};return db[_0x35db('0x2f')][_0x35db('0x24')](_0x5e0f4a)[_0x35db('0x2b')](function(_0x27ef25){_0x4a33fa['count']=_0x27ef25;if(_0xdde4d8[_0x35db('0x36')][_0x35db('0x46')]){_0x18a816[_0x35db('0x47')]=[{'all':!![]}];}return db[_0x35db('0x2f')][_0x35db('0x48')](_0x18a816);})[_0x35db('0x2b')](function(_0x56d562){_0x4a33fa['rows']=_0x56d562;return _0x4a33fa;})[_0x35db('0x2b')](respondWithFilteredResult(_0xabe6bf,_0x18a816))[_0x35db('0x49')](handleError(_0xabe6bf,null));};exports['show']=function(_0x210175,_0x474ae){var _0xdc54fd={'raw':!![],'where':{'id':_0x210175[_0x35db('0x4a')]['id']}},_0x5d14d2={};_0x5d14d2[_0x35db('0x34')]=_[_0x35db('0x37')](db[_0x35db('0x2f')][_0x35db('0x30')]);_0x5d14d2[_0x35db('0x36')]=_[_0x35db('0x37')](_0x210175['query']);_0x5d14d2['filters']=_[_0x35db('0x39')](_0x5d14d2['model'],_0x5d14d2[_0x35db('0x36')]);_0xdc54fd['attributes']=_[_0x35db('0x39')](_0x5d14d2[_0x35db('0x34')],qs[_0x35db('0x3a')](_0x210175['query'][_0x35db('0x3a')]));_0xdc54fd[_0x35db('0x3b')]=_0xdc54fd[_0x35db('0x3b')][_0x35db('0x3c')]?_0xdc54fd[_0x35db('0x3b')]:_0x5d14d2[_0x35db('0x34')];if(_0x210175[_0x35db('0x36')]['includeAll']){_0xdc54fd['include']=[{'all':!![]}];}_0xdc54fd=_[_0x35db('0x43')]({},_0xdc54fd,_0x210175['options']);return db[_0x35db('0x2f')][_0x35db('0x4b')](_0xdc54fd)['then'](handleEntityNotFound(_0x474ae,null))[_0x35db('0x2b')](respondWithResult(_0x474ae,null))['catch'](handleError(_0x474ae,null));};exports['create']=function(_0x48d2a6,_0xc8579b){return db[_0x35db('0x2f')][_0x35db('0x4c')](_0x48d2a6[_0x35db('0x4d')],{})[_0x35db('0x2b')](respondWithResult(_0xc8579b,0xc9))['catch'](handleError(_0xc8579b,null));};exports[_0x35db('0x2a')]=function(_0x159328,_0x5d2be8){if(_0x159328[_0x35db('0x4d')]['id']){delete _0x159328[_0x35db('0x4d')]['id'];}return db[_0x35db('0x2f')][_0x35db('0x4b')]({'where':{'id':_0x159328[_0x35db('0x4a')]['id']}})[_0x35db('0x2b')](handleEntityNotFound(_0x5d2be8,null))['then'](saveUpdates(_0x159328[_0x35db('0x4d')],null))['then'](respondWithResult(_0x5d2be8,null))[_0x35db('0x49')](handleError(_0x5d2be8,null));};exports['destroy']=function(_0x5cdd5d,_0x4ded34){return db['ChatInternalMessage'][_0x35db('0x4b')]({'where':{'id':_0x5cdd5d[_0x35db('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ded34,null))['then'](removeEntity(_0x4ded34,null))[_0x35db('0x49')](handleError(_0x4ded34,null));};exports[_0x35db('0x4e')]=function(_0x5356c0,_0x31e308){return db[_0x35db('0x2f')][_0x35db('0x4e')]()[_0x35db('0x2b')](respondWithResult(_0x31e308,null))['catch'](handleError(_0x31e308,null));};function wrapUser(_0x592b72){return function(_0xa89657){var _0x4d57ed=_0x592b72[_0x35db('0x4f')]({'plain':!![]});_0x4d57ed[_0x35db('0x50')]=[];if(_0xa89657){_0x4d57ed[_0x35db('0x51')]=_0xa89657[_0x35db('0x52')];_0x4d57ed[_0x35db('0x53')]=_0xa89657;}else{_0x4d57ed[_0x35db('0x51')]=moment(0x0)['format'](_0x35db('0x54'));_0x4d57ed[_0x35db('0x53')]={};}return _0x4d57ed;};}exports['getUsers']=function(_0x5fcf6f,_0x258075,_0x52e636){var _0x3ddafe=[];return db[_0x35db('0x55')][_0x35db('0x48')]({'where':{'role':['agent',_0x35db('0x56'),_0x35db('0x57')]},'attributes':['id',_0x35db('0x58'),'name',_0x35db('0x59'),_0x35db('0x5a'),_0x35db('0x5b'),_0x35db('0x5c'),_0x35db('0x5d'),_0x35db('0x5e'),_0x35db('0x5f')],'order':qs[_0x35db('0x3f')]('-online'),'include':[{'model':db[_0x35db('0x60')],'as':'VoiceQueues','attributes':['id','name',_0x35db('0x32')],'through':{'attributes':[]}}]})[_0x35db('0x2b')](function(_0x422ea7){if(_0x422ea7){var _0x1c31a0=_0x5fcf6f[_0x35db('0x57')]['get']({'plain':!![]});if(!_0x1c31a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c31a0['role']===_0x35db('0x57')){return db[_0x35db('0x61')][_0x35db('0x4b')]({'where':{'name':_0x35db('0x62'),'userProfileId':_0x1c31a0[_0x35db('0x63')]},'raw':!![]})[_0x35db('0x2b')](function(_0x592231){if(_0x592231){if(_0x592231[_0x35db('0x64')]===0x0){return db[_0x35db('0x65')][_0x35db('0x48')]({'where':{'sectionId':_0x592231['id']},'raw':!![]})[_0x35db('0x2b')](function(_0x21eec7){var _0x3d5fac=[];if(_['isEmpty'](_0x21eec7)){_0x3d5fac=_['filter'](_0x422ea7,function(_0x1520bf){if(_0x1520bf[_0x35db('0x59')]!=='agent'){return _0x1520bf;}});return _0x3d5fac;}else{for(var _0x1b695d=0x0;_0x1b695d<_0x422ea7['length'];_0x1b695d++){var _0x93ee4=_0x422ea7[_0x1b695d];if(_0x93ee4['role']===_0x35db('0x66')){var _0x4b212d=_[_0x35db('0x4b')](_0x21eec7,function(_0x18d36e){return _0x18d36e['resourceId']===_0x93ee4['id'];});if(_0x4b212d)_0x3d5fac['push'](_0x93ee4);}else{_0x3d5fac['push'](_0x93ee4);}}return _0x3d5fac;}});}else{return _0x422ea7;}}else{var _0x10a1f6=_[_0x35db('0x42')](_0x422ea7,function(_0x32e83a){if(_0x32e83a['role']!=='agent'){return _0x32e83a;}});return _0x10a1f6;}});}else{return _0x422ea7;}}})[_0x35db('0x2b')](function(_0x563f4f){var _0x339fc7=[];if(_0x563f4f){_0x3ddafe=_0x563f4f;for(var _0x385918=0x0;_0x385918<_0x563f4f[_0x35db('0x3c')];_0x385918+=0x1){_0x3ddafe[_0x385918][_0x35db('0x50')]=[];_0x339fc7[_0x35db('0x67')](db[_0x35db('0x2f')][_0x35db('0x4b')]({'where':{'FromId':[_0x5fcf6f['user']['id'],_0x563f4f[_0x385918]['id']],'ToId':[_0x5fcf6f[_0x35db('0x57')]['id'],_0x563f4f[_0x385918]['id']],'ChatGroupId':null},'attributes':['id',_0x35db('0x52'),_0x35db('0x68'),'ToId',_0x35db('0x69'),_0x35db('0x4d')],'order':qs['sort'](_0x35db('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x35db('0x2b')](wrapUser(_0x563f4f[_0x385918])));}return BPromise[_0x35db('0x6b')](_0x339fc7);}return[];})[_0x35db('0x2b')](function(_0x45ee60){return{'rows':_0x45ee60,'count':_0x45ee60[_0x35db('0x3c')]};})['then'](respondWithResult(_0x258075,null))[_0x35db('0x49')](handleError(_0x258075,null));};
\ No newline at end of file
index ad851a3..927c98d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa66e=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x505493,_0xa913c8){var _0x5604cc=function(_0x23f626){while(--_0x23f626){_0x505493['push'](_0x505493['shift']());}};_0x5604cc(++_0xa913c8);}(_0xa66e,0xf4));var _0xea66=function(_0x5d7a5a,_0x57c3d0){_0x5d7a5a=_0x5d7a5a-0x0;var _0x33c063=_0xa66e[_0x5d7a5a];return _0x33c063;};'use strict';var EventEmitter=require(_0xea66('0x0'));var ChatInternalMessage=require(_0xea66('0x1'))['db'][_0xea66('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xea66('0x3')](0x0);var events={'afterCreate':_0xea66('0x4'),'afterUpdate':_0xea66('0x5'),'afterDestroy':'remove'};function emitEvent(_0x37baa8){return function(_0x38638b,_0xc7fc47,_0x139ad2){ChatInternalMessageEvents['emit'](_0x37baa8+':'+_0x38638b['id'],_0x38638b);ChatInternalMessageEvents[_0xea66('0x6')](_0x37baa8,_0x38638b);_0x139ad2(null);};}for(var e in events){if(events[_0xea66('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xea66('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x27d6=['exports','events','../../mysqldb','save','remove','emit','hook'];(function(_0x55c784,_0x3ed253){var _0x13d1e5=function(_0x429745){while(--_0x429745){_0x55c784['push'](_0x55c784['shift']());}};_0x13d1e5(++_0x3ed253);}(_0x27d6,0x14a));var _0x627d=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x27d6[_0x565c49];return _0x20ca34;};'use strict';var EventEmitter=require(_0x627d('0x0'));var ChatInternalMessage=require(_0x627d('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x627d('0x2'),'afterUpdate':'update','afterDestroy':_0x627d('0x3')};function emitEvent(_0x2e0502){return function(_0x18f700,_0x156ce2,_0x3b8d20){ChatInternalMessageEvents[_0x627d('0x4')](_0x2e0502+':'+_0x18f700['id'],_0x18f700);ChatInternalMessageEvents[_0x627d('0x4')](_0x2e0502,_0x18f700);_0x3b8d20(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x627d('0x5')](e,emitEvent(event));}}module[_0x627d('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
index 5c8bf7e..c48ade9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63ec=['util','api','moment','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5115fe,_0x447a8e){var _0x64874d=function(_0x2f74a){while(--_0x2f74a){_0x5115fe['push'](_0x5115fe['shift']());}};_0x64874d(++_0x447a8e);}(_0x63ec,0xe9));var _0xc63e=function(_0x2fd770,_0x2bccac){_0x2fd770=_0x2fd770-0x0;var _0x184848=_0x63ec[_0x2fd770];return _0x184848;};'use strict';var _=require(_0xc63e('0x0'));var util=require(_0xc63e('0x1'));var logger=require('../../config/logger')(_0xc63e('0x2'));var moment=require(_0xc63e('0x3'));var BPromise=require('bluebird');var rp=require(_0xc63e('0x4'));var fs=require('fs');var path=require(_0xc63e('0x5'));var rimraf=require('rimraf');var config=require(_0xc63e('0x6'));var attributes=require(_0xc63e('0x7'));module[_0xc63e('0x8')]=function(_0x1ade60,_0x4ebc8d){return _0x1ade60[_0xc63e('0x9')](_0xc63e('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc63e('0xb'),'collate':_0xc63e('0xc')});};
\ No newline at end of file
+var _0x9a49=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9a49,0x75));var _0x99a4=function(_0x181c23,_0x5c5af5){_0x181c23=_0x181c23-0x0;var _0x496ae4=_0x9a49[_0x181c23];return _0x496ae4;};'use strict';var _=require(_0x99a4('0x0'));var util=require(_0x99a4('0x1'));var logger=require(_0x99a4('0x2'))(_0x99a4('0x3'));var moment=require(_0x99a4('0x4'));var BPromise=require(_0x99a4('0x5'));var rp=require(_0x99a4('0x6'));var fs=require('fs');var path=require(_0x99a4('0x7'));var rimraf=require(_0x99a4('0x8'));var config=require(_0x99a4('0x9'));var attributes=require(_0x99a4('0xa'));module[_0x99a4('0xb')]=function(_0x287ff1,_0x4ac218){return _0x287ff1[_0x99a4('0xc')](_0x99a4('0xd'),attributes,{'tableName':_0x99a4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x99a4('0xf')});};
\ No newline at end of file
index 13fabae..04fdf81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b92=['defaults','localhost','socket.io-emitter','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5b92,0xdf));var _0x25b9=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5b92[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x25b9('0x0'));var util=require(_0x25b9('0x1'));var moment=require('moment');var BPromise=require(_0x25b9('0x2'));var rs=require(_0x25b9('0x3'));var fs=require('fs');var Redis=require(_0x25b9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x25b9('0x5'));var logger=require(_0x25b9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x25b9('0x7'));var client=jayson[_0x25b9('0x8')][_0x25b9('0x9')]({'port':0x232a});config[_0x25b9('0xa')]=_[_0x25b9('0xb')](config[_0x25b9('0xa')],{'host':_0x25b9('0xc'),'port':0x18eb});var socket=require(_0x25b9('0xd'))(new Redis(config[_0x25b9('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x474970,_0xb8173,_0x51fcf1){return new BPromise(function(_0x482356,_0x37989e){return client[_0x25b9('0xe')](_0x474970,_0x51fcf1)[_0x25b9('0xf')](function(_0x3ed302){logger[_0x25b9('0x10')](_0x25b9('0x11'),_0xb8173,_0x25b9('0x12'));logger[_0x25b9('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xb8173,_0x25b9('0x12'),JSON[_0x25b9('0x14')](_0x3ed302));if(_0x3ed302[_0x25b9('0x15')]){if(_0x3ed302[_0x25b9('0x15')][_0x25b9('0x16')]===0x1f4){logger[_0x25b9('0x15')](_0x25b9('0x11'),_0xb8173,_0x3ed302['error']['message']);return _0x37989e(_0x3ed302[_0x25b9('0x15')][_0x25b9('0x17')]);}logger[_0x25b9('0x15')](_0x25b9('0x11'),_0xb8173,_0x3ed302[_0x25b9('0x15')][_0x25b9('0x17')]);return _0x482356(_0x3ed302['error'][_0x25b9('0x17')]);}else{logger[_0x25b9('0x10')](_0x25b9('0x11'),_0xb8173,_0x25b9('0x12'));_0x482356(_0x3ed302[_0x25b9('0x18')][_0x25b9('0x17')]);}})[_0x25b9('0x19')](function(_0x38c36f){logger[_0x25b9('0x15')](_0x25b9('0x11'),_0xb8173,_0x38c36f);_0x37989e(_0x38c36f);});});}
\ No newline at end of file
+var _0x4398=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','code','message','error','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x4398,0x121));var _0x8439=function(_0x3c06cf,_0x3c387c){_0x3c06cf=_0x3c06cf-0x0;var _0xf985c3=_0x4398[_0x3c06cf];return _0xf985c3;};'use strict';var _=require(_0x8439('0x0'));var util=require(_0x8439('0x1'));var moment=require(_0x8439('0x2'));var BPromise=require(_0x8439('0x3'));var rs=require(_0x8439('0x4'));var fs=require('fs');var Redis=require(_0x8439('0x5'));var db=require(_0x8439('0x6'))['db'];var utils=require(_0x8439('0x7'));var logger=require(_0x8439('0x8'))(_0x8439('0x9'));var config=require(_0x8439('0xa'));var jayson=require(_0x8439('0xb'));var client=jayson['client'][_0x8439('0xc')]({'port':0x232a});config[_0x8439('0xd')]=_[_0x8439('0xe')](config[_0x8439('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x8439('0xf'))(new Redis(config['redis']));require(_0x8439('0x10'))['register'](socket);function respondWithRpcPromise(_0x9044c0,_0x1938f9,_0x38b294){return new BPromise(function(_0x4e2c33,_0x2fa4fa){return client['request'](_0x9044c0,_0x38b294)[_0x8439('0x11')](function(_0x7cc98b){logger[_0x8439('0x12')](_0x8439('0x13'),_0x1938f9,_0x8439('0x14'));logger[_0x8439('0x15')](_0x8439('0x16'),_0x1938f9,_0x8439('0x14'),JSON['stringify'](_0x7cc98b));if(_0x7cc98b['error']){if(_0x7cc98b['error'][_0x8439('0x17')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x1938f9,_0x7cc98b['error']['message']);return _0x2fa4fa(_0x7cc98b['error'][_0x8439('0x18')]);}logger[_0x8439('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x1938f9,_0x7cc98b['error'][_0x8439('0x18')]);return _0x4e2c33(_0x7cc98b['error']['message']);}else{logger[_0x8439('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x1938f9,_0x8439('0x14'));_0x4e2c33(_0x7cc98b['result']['message']);}})[_0x8439('0x1a')](function(_0x300a87){logger['error'](_0x8439('0x13'),_0x1938f9,_0x300a87);_0x2fa4fa(_0x300a87);});});}
\ No newline at end of file
index 2f4bbff..484f07c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbab5=['length','./chatInternalMessage.events','save','remove','emit','removeListener'];(function(_0x2f81d2,_0x2fb23b){var _0x392650=function(_0x40d237){while(--_0x40d237){_0x2f81d2['push'](_0x2f81d2['shift']());}};_0x392650(++_0x2fb23b);}(_0xbab5,0xe5));var _0x5bab=function(_0x235f57,_0x3eeb52){_0x235f57=_0x235f57-0x0;var _0x4728f1=_0xbab5[_0x235f57];return _0x4728f1;};'use strict';var ChatInternalMessageEvents=require(_0x5bab('0x0'));var events=[_0x5bab('0x1'),_0x5bab('0x2'),'update'];function createListener(_0x12fb0f,_0x5f2141){return function(_0xbdec2f){_0x5f2141[_0x5bab('0x3')](_0x12fb0f,_0xbdec2f);};}function removeListener(_0x1282e5,_0x4de468){return function(){ChatInternalMessageEvents[_0x5bab('0x4')](_0x1282e5,_0x4de468);};}exports['register']=function(_0x83a500){for(var _0x272ee6=0x0,_0x331c69=events[_0x5bab('0x5')];_0x272ee6<_0x331c69;_0x272ee6++){var _0x454ddd=events[_0x272ee6];var _0x3e0116=createListener('chatInternalMessage:'+_0x454ddd,_0x83a500);ChatInternalMessageEvents['on'](_0x454ddd,_0x3e0116);}};
\ No newline at end of file
+var _0x0768=['update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','remove'];(function(_0x3cd7ee,_0x117b17){var _0x35f196=function(_0x19452f){while(--_0x19452f){_0x3cd7ee['push'](_0x3cd7ee['shift']());}};_0x35f196(++_0x117b17);}(_0x0768,0x1c5));var _0x8076=function(_0x6f2a91,_0x257004){_0x6f2a91=_0x6f2a91-0x0;var _0x4902a7=_0x0768[_0x6f2a91];return _0x4902a7;};'use strict';var ChatInternalMessageEvents=require(_0x8076('0x0'));var events=['save',_0x8076('0x1'),_0x8076('0x2')];function createListener(_0x3e2856,_0x49bb4a){return function(_0x5c4dbb){_0x49bb4a[_0x8076('0x3')](_0x3e2856,_0x5c4dbb);};}function removeListener(_0x2e29db,_0x51958f){return function(){ChatInternalMessageEvents[_0x8076('0x4')](_0x2e29db,_0x51958f);};}exports[_0x8076('0x5')]=function(_0x1ee1b5){for(var _0x391da7=0x0,_0x256408=events['length'];_0x391da7<_0x256408;_0x391da7++){var _0x3e989b=events[_0x391da7];var _0x337a2d=createListener(_0x8076('0x6')+_0x3e989b,_0x1ee1b5);ChatInternalMessageEvents['on'](_0x3e989b,_0x337a2d);}};
\ No newline at end of file
index 7c21f8c..06861a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5316=['create','put','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','get','describe','/users','getUsers','/:id','show','post'];(function(_0x29adb2,_0x48616f){var _0x250229=function(_0x22a883){while(--_0x22a883){_0x29adb2['push'](_0x29adb2['shift']());}};_0x250229(++_0x48616f);}(_0x5316,0x115));var _0x6531=function(_0x5743e3,_0x4a2aab){_0x5743e3=_0x5743e3-0x0;var _0x24d100=_0x5316[_0x5743e3];return _0x24d100;};'use strict';var multer=require(_0x6531('0x0'));var util=require('util');var path=require(_0x6531('0x1'));var timeout=require('connect-timeout');var express=require(_0x6531('0x2'));var router=express[_0x6531('0x3')]();var fs_extra=require(_0x6531('0x4'));var auth=require(_0x6531('0x5'));var interaction=require(_0x6531('0x6'));var config=require(_0x6531('0x7'));var controller=require(_0x6531('0x8'));router['get']('/',auth[_0x6531('0x9')](),controller['index']);router[_0x6531('0xa')]('/describe',auth[_0x6531('0x9')](),controller[_0x6531('0xb')]);router['get'](_0x6531('0xc'),auth[_0x6531('0x9')](),controller[_0x6531('0xd')]);router[_0x6531('0xa')](_0x6531('0xe'),auth[_0x6531('0x9')](),controller[_0x6531('0xf')]);router[_0x6531('0x10')]('/',auth[_0x6531('0x9')](),controller[_0x6531('0x11')]);router[_0x6531('0x12')](_0x6531('0xe'),controller[_0x6531('0x13')]);router['delete']('/:id',auth[_0x6531('0x9')](),controller[_0x6531('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x1b22=['post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show'];(function(_0x41c63f,_0x4c9d1e){var _0x217b29=function(_0x5bb86e){while(--_0x5bb86e){_0x41c63f['push'](_0x41c63f['shift']());}};_0x217b29(++_0x4c9d1e);}(_0x1b22,0x165));var _0x21b2=function(_0x2b84d5,_0x428914){_0x2b84d5=_0x2b84d5-0x0;var _0x51452a=_0x1b22[_0x2b84d5];return _0x51452a;};'use strict';var multer=require(_0x21b2('0x0'));var util=require('util');var path=require(_0x21b2('0x1'));var timeout=require(_0x21b2('0x2'));var express=require(_0x21b2('0x3'));var router=express[_0x21b2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x21b2('0x5'));var interaction=require(_0x21b2('0x6'));var config=require(_0x21b2('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x21b2('0x8')]('/',auth['isAuthenticated'](),controller[_0x21b2('0x9')]);router[_0x21b2('0x8')](_0x21b2('0xa'),auth[_0x21b2('0xb')](),controller[_0x21b2('0xc')]);router['get'](_0x21b2('0xd'),auth[_0x21b2('0xb')](),controller[_0x21b2('0xe')]);router[_0x21b2('0x8')](_0x21b2('0xf'),auth[_0x21b2('0xb')](),controller[_0x21b2('0x10')]);router[_0x21b2('0x11')]('/',auth[_0x21b2('0xb')](),controller['create']);router['put'](_0x21b2('0xf'),controller[_0x21b2('0x12')]);router[_0x21b2('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x21b2('0x14')]);module[_0x21b2('0x15')]=router;
\ No newline at end of file
index 87a2993..2227453 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1beb=['sequelize','exports','medium','BOOLEAN','out','STRING','TEXT'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x1beb,0x165));var _0xb1be=function(_0x12daf9,_0x4fbd4b){_0x12daf9=_0x12daf9-0x0;var _0x58c9f5=_0x1beb[_0x12daf9];return _0x58c9f5;};'use strict';var Sequelize=require(_0xb1be('0x0'));module[_0xb1be('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb1be('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb1be('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb1be('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb1be('0x4')),'defaultValue':_0xb1be('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xb1be('0x5')]},'providerResponse':{'type':Sequelize[_0xb1be('0x6')]}};
\ No newline at end of file
+var _0x47d6=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x46e57c,_0x2b52b1){var _0x255952=function(_0x11c79d){while(--_0x11c79d){_0x46e57c['push'](_0x46e57c['shift']());}};_0x255952(++_0x2b52b1);}(_0x47d6,0x13f));var _0x647d=function(_0x1a194e,_0x34abf7){_0x1a194e=_0x1a194e-0x0;var _0x28349e=_0x47d6[_0x1a194e];return _0x28349e;};'use strict';var Sequelize=require(_0x647d('0x0'));module[_0x647d('0x1')]={'body':{'type':Sequelize[_0x647d('0x2')](_0x647d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x647d('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x647d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x647d('0x5')]('in',_0x647d('0x6')),'defaultValue':_0x647d('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x647d('0x7')]},'providerName':{'type':Sequelize[_0x647d('0x8')]},'providerResponse':{'type':Sequelize[_0x647d('0x2')]}};
\ No newline at end of file
index 50ae247..b20f9f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0873=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','chat-interactions','accept','chat','read','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[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','SELECT','fullname','email','internal','manual','interface','channel','event','EventManager','parse','interaction','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','QueryTypes','User','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','query','filters'];(function(_0x35e9a8,_0x22bef3){var _0x470a34=function(_0x2e7c9d){while(--_0x2e7c9d){_0x35e9a8['push'](_0x35e9a8['shift']());}};_0x470a34(++_0x22bef3);}(_0x0873,0x153));var _0x3087=function(_0x1a231a,_0x3a0830){_0x1a231a=_0x1a231a-0x0;var _0x4a25e0=_0x0873[_0x1a231a];return _0x4a25e0;};'use strict';var emlformat=require(_0x3087('0x0'));var rimraf=require(_0x3087('0x1'));var zipdir=require(_0x3087('0x2'));var jsonpatch=require(_0x3087('0x3'));var rp=require(_0x3087('0x4'));var moment=require('moment');var BPromise=require(_0x3087('0x5'));var Mustache=require(_0x3087('0x6'));var util=require(_0x3087('0x7'));var path=require(_0x3087('0x8'));var sox=require(_0x3087('0x9'));var csv=require('to-csv');var ejs=require(_0x3087('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3087('0xb'));var crypto=require(_0x3087('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3087('0xd'));var toCsv=require(_0x3087('0xe'));var querystring=require(_0x3087('0xf'));var Papa=require('papaparse');var Redis=require(_0x3087('0x10'));var authService=require(_0x3087('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3087('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3087('0x13'))(_0x3087('0x14'));var utils=require(_0x3087('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3087('0x16'))['db'];config['redis']=_['defaults'](config[_0x3087('0x17')],{'host':_0x3087('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3087('0x17')]));require(_0x3087('0x19'))[_0x3087('0x1a')](socket);var jayson=require(_0x3087('0x1b'));var client=jayson[_0x3087('0x1c')][_0x3087('0x1d')]({'port':0x232c});var client9002=jayson[_0x3087('0x1c')][_0x3087('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x250764,_0x1f1691,_0x52a6a5,_0x333b4f){return new BPromise(function(_0x3c8cae,_0x3e879e){var _0xb919fd=_0x333b4f||client;return _0xb919fd[_0x3087('0x1e')](_0x250764,_0x52a6a5)[_0x3087('0x1f')](function(_0x2f40cc){logger[_0x3087('0x20')](_0x3087('0x21'),_0x1f1691,'request\x20sent');logger[_0x3087('0x22')](_0x3087('0x23'),_0x1f1691,_0x3087('0x24'),JSON[_0x3087('0x25')](_0x2f40cc));if(_0x2f40cc['error']){if(_0x2f40cc[_0x3087('0x26')][_0x3087('0x27')]===0x1f4){logger[_0x3087('0x26')]('ChatMessage,\x20%s,\x20%s',_0x1f1691,_0x2f40cc[_0x3087('0x26')][_0x3087('0x28')]);return _0x3e879e(_0x2f40cc[_0x3087('0x26')][_0x3087('0x28')]);}logger[_0x3087('0x26')](_0x3087('0x21'),_0x1f1691,_0x2f40cc[_0x3087('0x26')][_0x3087('0x28')]);return _0x3c8cae(_0x2f40cc['error'][_0x3087('0x28')]);}else{logger[_0x3087('0x20')](_0x3087('0x21'),_0x1f1691,_0x3087('0x24'));_0x3c8cae(_0x2f40cc['result'][_0x3087('0x28')]);}})['catch'](function(_0x402c58){logger[_0x3087('0x26')](_0x3087('0x21'),_0x1f1691,_0x402c58);_0x3e879e(_0x402c58);});});}function respondWithStatusCode(_0x4d83bf,_0x828590){_0x828590=_0x828590||0xcc;return function(_0x21681e){if(_0x21681e){return _0x4d83bf['sendStatus'](_0x828590);}return _0x4d83bf[_0x3087('0x29')](_0x828590)[_0x3087('0x2a')]();};}function respondWithResult(_0x1d5d1e,_0x39ba88){_0x39ba88=_0x39ba88||0xc8;return function(_0xf26d76){if(_0xf26d76){return _0x1d5d1e['status'](_0x39ba88)[_0x3087('0x2b')](_0xf26d76);}};}function respondWithFilteredResult(_0x4d8f9a,_0x2daac5){return function(_0x1306c9){if(_0x1306c9){var _0x406f97=typeof _0x2daac5[_0x3087('0x2c')]==='undefined'&&typeof _0x2daac5[_0x3087('0x2d')]===_0x3087('0x2e');var _0x353823=_0x1306c9[_0x3087('0x2f')];var _0x4c2d95=_0x406f97?0x0:_0x2daac5['offset'];var _0x2e084c=_0x406f97?_0x1306c9['count']:_0x2daac5[_0x3087('0x2c')]+_0x2daac5[_0x3087('0x2d')];var _0x5dbc57;if(_0x2e084c>=_0x353823){_0x2e084c=_0x353823;_0x5dbc57=0xc8;}else{_0x5dbc57=0xce;}_0x4d8f9a[_0x3087('0x29')](_0x5dbc57);return _0x4d8f9a[_0x3087('0x30')](_0x3087('0x31'),_0x4c2d95+'-'+_0x2e084c+'/'+_0x353823)[_0x3087('0x2b')](_0x1306c9);}return null;};}function patchUpdates(_0x5ad6bd){return function(_0x2984be){try{jsonpatch[_0x3087('0x32')](_0x2984be,_0x5ad6bd,!![]);}catch(_0x4fab88){return BPromise[_0x3087('0x33')](_0x4fab88);}return _0x2984be[_0x3087('0x34')]();};}function saveUpdates(_0x4233c9,_0x53a188){return function(_0x428436){if(_0x428436){return _0x428436[_0x3087('0x35')](_0x4233c9)['then'](function(_0x520af9){return _0x520af9;});}return null;};}function removeEntity(_0x28866a,_0xc8ca0a){return function(_0x4f38c0){if(_0x4f38c0){return _0x4f38c0[_0x3087('0x36')]()[_0x3087('0x1f')](function(){_0x28866a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c7b66,_0x272873){return function(_0x589ebd){if(!_0x589ebd){_0x4c7b66['sendStatus'](0x194);}return _0x589ebd;};}function handleError(_0x413311,_0x10176c){_0x10176c=_0x10176c||0x1f4;return function(_0x19bcee){logger[_0x3087('0x26')](_0x19bcee[_0x3087('0x37')]);if(_0x19bcee[_0x3087('0x38')]){delete _0x19bcee['name'];}_0x413311[_0x3087('0x29')](_0x10176c)[_0x3087('0x39')](_0x19bcee);};}exports[_0x3087('0x3a')]=function(_0x45a5b3,_0x1d6d48){var _0x42fcb0={},_0x574ef9={},_0x4343ef={'count':0x0,'rows':[]};var _0x54ff8e=_[_0x3087('0x3b')](db[_0x3087('0x3c')][_0x3087('0x3d')],function(_0x307c3c){return{'name':_0x307c3c[_0x3087('0x3e')],'type':_0x307c3c[_0x3087('0x3f')][_0x3087('0x40')]};});_0x574ef9[_0x3087('0x41')]=_['map'](_0x54ff8e,_0x3087('0x38'));_0x574ef9['query']=_[_0x3087('0x42')](_0x45a5b3[_0x3087('0x43')]);_0x574ef9[_0x3087('0x44')]=_['intersection'](_0x574ef9[_0x3087('0x41')],_0x574ef9['query']);_0x42fcb0[_0x3087('0x45')]=_[_0x3087('0x46')](_0x574ef9[_0x3087('0x41')],qs[_0x3087('0x47')](_0x45a5b3[_0x3087('0x43')][_0x3087('0x47')]));_0x42fcb0[_0x3087('0x45')]=_0x42fcb0['attributes'][_0x3087('0x48')]?_0x42fcb0[_0x3087('0x45')]:_0x574ef9[_0x3087('0x41')];if(!_0x45a5b3[_0x3087('0x43')][_0x3087('0x49')](_0x3087('0x4a'))){_0x42fcb0[_0x3087('0x2d')]=qs[_0x3087('0x2d')](_0x45a5b3[_0x3087('0x43')][_0x3087('0x2d')]);_0x42fcb0[_0x3087('0x2c')]=qs['offset'](_0x45a5b3['query'][_0x3087('0x2c')]);}_0x42fcb0[_0x3087('0x4b')]=qs[_0x3087('0x4c')](_0x45a5b3['query'][_0x3087('0x4c')]);_0x42fcb0['where']=qs[_0x3087('0x44')](_[_0x3087('0x4d')](_0x45a5b3[_0x3087('0x43')],_0x574ef9[_0x3087('0x44')]),_0x54ff8e);if(_0x45a5b3[_0x3087('0x43')][_0x3087('0x4e')]){_0x42fcb0[_0x3087('0x4f')]=_[_0x3087('0x50')](_0x42fcb0['where'],{'$or':_['map'](_0x54ff8e,function(_0xedc4f5){if(_0xedc4f5[_0x3087('0x3f')]!==_0x3087('0x51')){var _0x44a5c6={};_0x44a5c6[_0xedc4f5[_0x3087('0x38')]]={'$like':'%'+_0x45a5b3[_0x3087('0x43')][_0x3087('0x4e')]+'%'};return _0x44a5c6;}})});}_0x42fcb0=_[_0x3087('0x50')]({},_0x42fcb0,_0x45a5b3[_0x3087('0x52')]);var _0xd7825={'where':_0x42fcb0[_0x3087('0x4f')]};return db[_0x3087('0x3c')][_0x3087('0x2f')](_0xd7825)[_0x3087('0x1f')](function(_0xa2cd2e){_0x4343ef[_0x3087('0x2f')]=_0xa2cd2e;if(_0x45a5b3['query'][_0x3087('0x53')]){_0x42fcb0[_0x3087('0x54')]=[{'all':!![]}];}return db[_0x3087('0x3c')][_0x3087('0x55')](_0x42fcb0);})[_0x3087('0x1f')](function(_0x274c9c){_0x4343ef[_0x3087('0x56')]=_0x274c9c;return _0x4343ef;})[_0x3087('0x1f')](respondWithFilteredResult(_0x1d6d48,_0x42fcb0))[_0x3087('0x57')](handleError(_0x1d6d48,null));};exports['show']=function(_0x47f866,_0x50742e){var _0x1a28f8={'raw':!![],'where':{'id':_0x47f866['params']['id']}},_0x4043c0={};_0x4043c0['model']=_[_0x3087('0x42')](db[_0x3087('0x3c')]['rawAttributes']);_0x4043c0[_0x3087('0x43')]=_[_0x3087('0x42')](_0x47f866[_0x3087('0x43')]);_0x4043c0[_0x3087('0x44')]=_[_0x3087('0x46')](_0x4043c0[_0x3087('0x41')],_0x4043c0[_0x3087('0x43')]);_0x1a28f8[_0x3087('0x45')]=_[_0x3087('0x46')](_0x4043c0[_0x3087('0x41')],qs['fields'](_0x47f866[_0x3087('0x43')][_0x3087('0x47')]));_0x1a28f8[_0x3087('0x45')]=_0x1a28f8['attributes'][_0x3087('0x48')]?_0x1a28f8[_0x3087('0x45')]:_0x4043c0[_0x3087('0x41')];if(_0x47f866['query']['includeAll']){_0x1a28f8['include']=[{'all':!![]}];}_0x1a28f8=_['merge']({},_0x1a28f8,_0x47f866[_0x3087('0x52')]);return db['ChatMessage'][_0x3087('0x58')](_0x1a28f8)[_0x3087('0x1f')](handleEntityNotFound(_0x50742e,null))[_0x3087('0x1f')](respondWithResult(_0x50742e,null))[_0x3087('0x57')](handleError(_0x50742e,null));};exports[_0x3087('0x59')]=function(_0x171dbb,_0xfed153){return db['ChatMessage'][_0x3087('0x59')](_0x171dbb['body'],{})[_0x3087('0x1f')](respondWithResult(_0xfed153,0xc9))[_0x3087('0x57')](handleError(_0xfed153,null));};exports['update']=function(_0x2750e6,_0x11f25d){if(_0x2750e6[_0x3087('0x5a')]['id']){delete _0x2750e6['body']['id'];}return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x2750e6['params']['id']}})[_0x3087('0x1f')](handleEntityNotFound(_0x11f25d,null))[_0x3087('0x1f')](saveUpdates(_0x2750e6[_0x3087('0x5a')],null))['then'](respondWithResult(_0x11f25d,null))[_0x3087('0x57')](handleError(_0x11f25d,null));};exports[_0x3087('0x36')]=function(_0x5dce3d,_0xe4b846){return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x5dce3d[_0x3087('0x5b')]['id']}})[_0x3087('0x1f')](handleEntityNotFound(_0xe4b846,null))[_0x3087('0x1f')](removeEntity(_0xe4b846,null))[_0x3087('0x57')](handleError(_0xe4b846,null));};exports[_0x3087('0x5c')]=function(_0x3e1f6b,_0x8c570f){return db[_0x3087('0x3c')][_0x3087('0x5c')]()['then'](respondWithResult(_0x8c570f,null))['catch'](handleError(_0x8c570f,null));};var interaction_log=require(_0x3087('0x13'))(_0x3087('0x5d'));exports[_0x3087('0x5e')]=function(_0x2d2ce7,_0x29c5d8,_0x51f1ad){var _0x20c380={'agent':{},'channel':_0x3087('0x5f')};if(_0x2d2ce7[_0x3087('0x5a')]['id']){delete _0x2d2ce7[_0x3087('0x5a')]['id'];}_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x60')]=!![];_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x61')]=moment()[_0x3087('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')]=_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')]||_0x2d2ce7[_0x3087('0x64')]['id'];_0x20c380[_0x3087('0x65')]['id']=_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')];return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x2d2ce7[_0x3087('0x5b')]['id'],'UserId':null}})[_0x3087('0x1f')](handleEntityNotFound(_0x29c5d8,null))[_0x3087('0x1f')](saveUpdates(_0x2d2ce7[_0x3087('0x5a')],null))[_0x3087('0x1f')](function(_0x3c0bfc){if(_0x3c0bfc){_0x20c380[_0x3087('0x28')]=_0x3c0bfc[_0x3087('0x66')]({'plain':!![]});return db[_0x3087('0x67')][_0x3087('0x58')]({'where':{'id':_0x3c0bfc[_0x3087('0x68')]}});}return null;})[_0x3087('0x1f')](handleEntityNotFound(_0x29c5d8,null))['then'](function(_0x101216){if(_0x101216){return _0x101216[_0x3087('0x35')]({'UserId':_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')],'read1stAt':_[_0x3087('0x69')](_0x101216[_0x3087('0x6a')])?moment()[_0x3087('0x62')](_0x3087('0x6b')):undefined});}return null;})[_0x3087('0x1f')](function(_0xe75dfa){if(_0xe75dfa){_0x20c380['interaction']=_0xe75dfa[_0x3087('0x66')]({'plain':!![]});interaction_log['info'](_0x3087('0x6c'),_0x2d2ce7['user']['id'],_0x2d2ce7[_0x3087('0x64')]['name'],_0x2d2ce7['user']['role'],_0x20c380['interaction']['id'],_0x2d2ce7[_0x3087('0x5a')]?JSON[_0x3087('0x25')](_0x2d2ce7[_0x3087('0x5a')]):_0x3087('0x6d'));return respondWithRpcPromise(_0x3087('0x6e'),_0x3087('0x6f'),_0x20c380);}return null;})['then'](function(_0x47307b){var _0x136233=_0x3087('0x70')+_0x47307b[_0x3087('0x28')][_0x3087('0x71')];return db[_0x3087('0x72')][_0x3087('0x43')](_0x136233,{'type':db[_0x3087('0x73')]['QueryTypes'][_0x3087('0x74')],'raw':!![]})['then'](function(_0x2707ce){return _0x2707ce;});})[_0x3087('0x1f')](function(_0x72cf40){if(_0x72cf40){_0x20c380['message']['contact']=_0x72cf40[0x0];if(!_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')])return;return db['User'][_0x3087('0x58')]({'where':{'id':_0x2d2ce7['body']['UserId'],'role':_0x3087('0x65')},'attributes':['id',_0x3087('0x38'),_0x3087('0x75'),_0x3087('0x76'),_0x3087('0x77')],'raw':!![]});}return null;})[_0x3087('0x1f')](function(_0x5a7c12){if(!_0x5a7c12)return null;_0x20c380[_0x3087('0x28')][_0x3087('0x65')]=_0x5a7c12;return _0x20c380;})[_0x3087('0x1f')](function(_0x1c1968){if(_0x1c1968){if(_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x78')]){_0x20c380[_0x3087('0x28')][_0x3087('0x79')]=util[_0x3087('0x62')]('SIP/%s',_0x2d2ce7[_0x3087('0x64')]['name']);_0x20c380[_0x3087('0x28')]['channel']=_0x20c380[_0x3087('0x7a')];_0x20c380[_0x3087('0x28')]['motionChannel']=_0x20c380['channel'];_0x20c380[_0x3087('0x28')][_0x3087('0x7b')]=_0x3087('0x5e');return respondWithRpcPromise(_0x3087('0x7c'),'EventManager',{'event':'acceptmessage','message':_[_0x3087('0x50')](_0x20c380[_0x3087('0x28')],JSON[_0x3087('0x7d')](_0x20c380[_0x3087('0x7e')][_0x3087('0x7f')]))},client9002)[_0x3087('0x1f')](function(){return _0x20c380;});}return _0x20c380;}return null;})[_0x3087('0x1f')](respondWithResult(_0x29c5d8,null))[_0x3087('0x57')](handleError(_0x29c5d8,null));};var interaction_log=require(_0x3087('0x13'))('chat-interactions');exports['reject']=function(_0x2ad943,_0x41c440,_0xe73b11){var _0x3c0cc5={'agent':{},'channel':_0x3087('0x5f')};if(_0x2ad943['body']['id']){delete _0x2ad943[_0x3087('0x5a')]['id'];}_0x2ad943[_0x3087('0x5a')][_0x3087('0x63')]=_0x2ad943[_0x3087('0x5a')][_0x3087('0x63')]||_0x2ad943[_0x3087('0x64')]['id'];_0x3c0cc5[_0x3087('0x65')]['id']=_0x2ad943['body']['UserId'];return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x2ad943[_0x3087('0x5b')]['id'],'UserId':null}})[_0x3087('0x1f')](handleEntityNotFound(_0x41c440,null))[_0x3087('0x1f')](function(_0x103fbf){if(_0x103fbf){_0x3c0cc5['message']=_0x103fbf[_0x3087('0x66')]({'plain':!![]});return db[_0x3087('0x67')][_0x3087('0x58')]({'where':{'id':_0x103fbf[_0x3087('0x68')]}});}return null;})[_0x3087('0x1f')](handleEntityNotFound(_0x41c440,null))['then'](function(_0x4290a4){if(_0x4290a4){_0x3c0cc5['interaction']=_0x4290a4[_0x3087('0x66')]({'plain':!![]});interaction_log[_0x3087('0x20')](_0x3087('0x80'),_0x2ad943['user']['id'],_0x2ad943[_0x3087('0x64')]['name'],_0x2ad943[_0x3087('0x64')][_0x3087('0x81')],_0x3c0cc5[_0x3087('0x7e')]['id'],_0x2ad943[_0x3087('0x5a')]?JSON[_0x3087('0x25')](_0x2ad943[_0x3087('0x5a')]):'null');return respondWithRpcPromise(_0x3087('0x82'),_0x3087('0x83'),_0x3c0cc5);}return null;})[_0x3087('0x1f')](function(_0x5df46a){var _0x26c389=_0x3087('0x70')+_0x5df46a[_0x3087('0x28')][_0x3087('0x71')];return db[_0x3087('0x72')][_0x3087('0x43')](_0x26c389,{'type':db['Sequelize'][_0x3087('0x84')]['SELECT'],'raw':!![]})[_0x3087('0x1f')](function(_0x427a1d){return _0x427a1d;});})['then'](function(_0x29738e){if(_0x29738e){_0x3c0cc5[_0x3087('0x28')]['contact']=_0x29738e[0x0];if(!_0x2ad943['body']['UserId'])return;return db[_0x3087('0x85')][_0x3087('0x58')]({'where':{'id':_0x2ad943[_0x3087('0x5a')][_0x3087('0x63')],'role':'agent'},'attributes':['id','name',_0x3087('0x75'),'email',_0x3087('0x77')],'raw':!![]});}return null;})[_0x3087('0x1f')](function(_0x4f501b){if(!_0x4f501b)return null;_0x3c0cc5[_0x3087('0x28')][_0x3087('0x65')]=_0x4f501b;return _0x3c0cc5;})[_0x3087('0x1f')](function(_0x54c472){if(_0x54c472){_0x54c472['message'][_0x3087('0x79')]=util[_0x3087('0x62')]('SIP/%s',_0x2ad943[_0x3087('0x64')][_0x3087('0x38')]);_0x54c472[_0x3087('0x28')][_0x3087('0x7a')]=_0x3c0cc5[_0x3087('0x7a')];_0x54c472[_0x3087('0x28')][_0x3087('0x86')]=_0x3c0cc5['channel'];_0x54c472[_0x3087('0x28')][_0x3087('0x7b')]='reject';respondWithRpcPromise('EventManager',_0x3087('0x7c'),{'event':_0x3087('0x87'),'message':_[_0x3087('0x50')](_0x3c0cc5[_0x3087('0x28')],JSON['parse'](_0x3c0cc5[_0x3087('0x7e')][_0x3087('0x7f')]))},client9002);return _0x3c0cc5;}return null;})['then'](respondWithResult(_0x41c440,null))[_0x3087('0x57')](handleError(_0x41c440,null));};
\ No newline at end of file
+var _0x0864=['Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ChatMessage','include','show','params','includeAll','create','body','find','describe','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','format','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize'];(function(_0x426dd2,_0x4b0012){var _0x4bc76c=function(_0x4c0732){while(--_0x4c0732){_0x426dd2['push'](_0x426dd2['shift']());}};_0x4bc76c(++_0x4b0012);}(_0x0864,0x1a7));var _0x4086=function(_0x2275e0,_0x246f81){_0x2275e0=_0x2275e0-0x0;var _0xe75c14=_0x0864[_0x2275e0];return _0xe75c14;};'use strict';var emlformat=require(_0x4086('0x0'));var rimraf=require(_0x4086('0x1'));var zipdir=require(_0x4086('0x2'));var jsonpatch=require(_0x4086('0x3'));var rp=require(_0x4086('0x4'));var moment=require(_0x4086('0x5'));var BPromise=require(_0x4086('0x6'));var Mustache=require(_0x4086('0x7'));var util=require(_0x4086('0x8'));var path=require(_0x4086('0x9'));var sox=require(_0x4086('0xa'));var csv=require(_0x4086('0xb'));var ejs=require(_0x4086('0xc'));var fs=require('fs');var fs_extra=require(_0x4086('0xd'));var _=require(_0x4086('0xe'));var squel=require('squel');var crypto=require(_0x4086('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x4086('0x10'));var toCsv=require(_0x4086('0xb'));var querystring=require(_0x4086('0x11'));var Papa=require(_0x4086('0x12'));var Redis=require('ioredis');var authService=require(_0x4086('0x13'));var qs=require(_0x4086('0x14'));var as=require(_0x4086('0x15'));var hardwareService=require(_0x4086('0x16'));var logger=require(_0x4086('0x17'))(_0x4086('0x18'));var utils=require('../../config/utils');var config=require(_0x4086('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4086('0x1a')]=_['defaults'](config[_0x4086('0x1a')],{'host':_0x4086('0x1b'),'port':0x18eb});var socket=require(_0x4086('0x1c'))(new Redis(config['redis']));require(_0x4086('0x1d'))['register'](socket);var jayson=require(_0x4086('0x1e'));var client=jayson[_0x4086('0x1f')][_0x4086('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x4086('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1c35b1,_0xa0ad95,_0x4ecf07,_0x10945a){return new BPromise(function(_0x4b5ef7,_0x403cd1){var _0x849706=_0x10945a||client;return _0x849706[_0x4086('0x21')](_0x1c35b1,_0x4ecf07)[_0x4086('0x22')](function(_0x38287d){logger[_0x4086('0x23')](_0x4086('0x24'),_0xa0ad95,_0x4086('0x25'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0xa0ad95,_0x4086('0x25'),JSON[_0x4086('0x26')](_0x38287d));if(_0x38287d['error']){if(_0x38287d[_0x4086('0x27')]['code']===0x1f4){logger[_0x4086('0x27')](_0x4086('0x24'),_0xa0ad95,_0x38287d['error'][_0x4086('0x28')]);return _0x403cd1(_0x38287d[_0x4086('0x27')][_0x4086('0x28')]);}logger[_0x4086('0x27')](_0x4086('0x24'),_0xa0ad95,_0x38287d['error']['message']);return _0x4b5ef7(_0x38287d[_0x4086('0x27')][_0x4086('0x28')]);}else{logger[_0x4086('0x23')](_0x4086('0x24'),_0xa0ad95,_0x4086('0x25'));_0x4b5ef7(_0x38287d[_0x4086('0x29')][_0x4086('0x28')]);}})[_0x4086('0x2a')](function(_0x227004){logger[_0x4086('0x27')]('ChatMessage,\x20%s,\x20%s',_0xa0ad95,_0x227004);_0x403cd1(_0x227004);});});}function respondWithStatusCode(_0x30c70c,_0x5466e0){_0x5466e0=_0x5466e0||0xcc;return function(_0x30efee){if(_0x30efee){return _0x30c70c[_0x4086('0x2b')](_0x5466e0);}return _0x30c70c[_0x4086('0x2c')](_0x5466e0)[_0x4086('0x2d')]();};}function respondWithResult(_0x2da47f,_0x4abc1c){_0x4abc1c=_0x4abc1c||0xc8;return function(_0x1a1475){if(_0x1a1475){return _0x2da47f[_0x4086('0x2c')](_0x4abc1c)[_0x4086('0x2e')](_0x1a1475);}};}function respondWithFilteredResult(_0x37c68c,_0x21605b){return function(_0x35d031){if(_0x35d031){var _0x1f85f7=typeof _0x21605b[_0x4086('0x2f')]===_0x4086('0x30')&&typeof _0x21605b['limit']===_0x4086('0x30');var _0x29e275=_0x35d031['count'];var _0x20c0ec=_0x1f85f7?0x0:_0x21605b[_0x4086('0x2f')];var _0x1698b1=_0x1f85f7?_0x35d031[_0x4086('0x31')]:_0x21605b[_0x4086('0x2f')]+_0x21605b[_0x4086('0x32')];var _0x35b93d;if(_0x1698b1>=_0x29e275){_0x1698b1=_0x29e275;_0x35b93d=0xc8;}else{_0x35b93d=0xce;}_0x37c68c[_0x4086('0x2c')](_0x35b93d);return _0x37c68c[_0x4086('0x33')](_0x4086('0x34'),_0x20c0ec+'-'+_0x1698b1+'/'+_0x29e275)[_0x4086('0x2e')](_0x35d031);}return null;};}function patchUpdates(_0x154662){return function(_0x4f1941){try{jsonpatch[_0x4086('0x35')](_0x4f1941,_0x154662,!![]);}catch(_0x449ce2){return BPromise[_0x4086('0x36')](_0x449ce2);}return _0x4f1941[_0x4086('0x37')]();};}function saveUpdates(_0xbc130b,_0x397a47){return function(_0x38d377){if(_0x38d377){return _0x38d377[_0x4086('0x38')](_0xbc130b)[_0x4086('0x22')](function(_0x3c8ca3){return _0x3c8ca3;});}return null;};}function removeEntity(_0x5ef85c,_0x254e40){return function(_0x13e5e2){if(_0x13e5e2){return _0x13e5e2[_0x4086('0x39')]()[_0x4086('0x22')](function(){_0x5ef85c[_0x4086('0x2c')](0xcc)[_0x4086('0x2d')]();});}};}function handleEntityNotFound(_0x2f5fd1,_0x1ed68b){return function(_0x4d23e4){if(!_0x4d23e4){_0x2f5fd1['sendStatus'](0x194);}return _0x4d23e4;};}function handleError(_0x7550e6,_0xa7ed3c){_0xa7ed3c=_0xa7ed3c||0x1f4;return function(_0x899dbe){logger[_0x4086('0x27')](_0x899dbe['stack']);if(_0x899dbe['name']){delete _0x899dbe[_0x4086('0x3a')];}_0x7550e6[_0x4086('0x2c')](_0xa7ed3c)[_0x4086('0x3b')](_0x899dbe);};}exports[_0x4086('0x3c')]=function(_0x138aba,_0x4f4961){var _0x479a30={},_0x4f4152={},_0x5a0db4={'count':0x0,'rows':[]};var _0x38f7b0=_['map'](db['ChatMessage'][_0x4086('0x3d')],function(_0x173aed){return{'name':_0x173aed[_0x4086('0x3e')],'type':_0x173aed[_0x4086('0x3f')][_0x4086('0x40')]};});_0x4f4152[_0x4086('0x41')]=_[_0x4086('0x42')](_0x38f7b0,_0x4086('0x3a'));_0x4f4152[_0x4086('0x43')]=_[_0x4086('0x44')](_0x138aba['query']);_0x4f4152[_0x4086('0x45')]=_[_0x4086('0x46')](_0x4f4152[_0x4086('0x41')],_0x4f4152[_0x4086('0x43')]);_0x479a30[_0x4086('0x47')]=_[_0x4086('0x46')](_0x4f4152[_0x4086('0x41')],qs['fields'](_0x138aba[_0x4086('0x43')][_0x4086('0x48')]));_0x479a30[_0x4086('0x47')]=_0x479a30[_0x4086('0x47')][_0x4086('0x49')]?_0x479a30[_0x4086('0x47')]:_0x4f4152[_0x4086('0x41')];if(!_0x138aba['query'][_0x4086('0x4a')](_0x4086('0x4b'))){_0x479a30[_0x4086('0x32')]=qs['limit'](_0x138aba[_0x4086('0x43')][_0x4086('0x32')]);_0x479a30['offset']=qs[_0x4086('0x2f')](_0x138aba['query']['offset']);}_0x479a30[_0x4086('0x4c')]=qs[_0x4086('0x4d')](_0x138aba[_0x4086('0x43')][_0x4086('0x4d')]);_0x479a30['where']=qs[_0x4086('0x45')](_[_0x4086('0x4e')](_0x138aba['query'],_0x4f4152[_0x4086('0x45')]),_0x38f7b0);if(_0x138aba[_0x4086('0x43')][_0x4086('0x4f')]){_0x479a30[_0x4086('0x50')]=_[_0x4086('0x51')](_0x479a30[_0x4086('0x50')],{'$or':_['map'](_0x38f7b0,function(_0x5b1010){if(_0x5b1010[_0x4086('0x3f')]!==_0x4086('0x52')){var _0x4dd029={};_0x4dd029[_0x5b1010['name']]={'$like':'%'+_0x138aba[_0x4086('0x43')][_0x4086('0x4f')]+'%'};return _0x4dd029;}})});}_0x479a30=_['merge']({},_0x479a30,_0x138aba[_0x4086('0x53')]);var _0xcaa277={'where':_0x479a30['where']};return db[_0x4086('0x54')][_0x4086('0x31')](_0xcaa277)[_0x4086('0x22')](function(_0x313278){_0x5a0db4[_0x4086('0x31')]=_0x313278;if(_0x138aba['query']['includeAll']){_0x479a30[_0x4086('0x55')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x479a30);})[_0x4086('0x22')](function(_0x283e15){_0x5a0db4['rows']=_0x283e15;return _0x5a0db4;})[_0x4086('0x22')](respondWithFilteredResult(_0x4f4961,_0x479a30))[_0x4086('0x2a')](handleError(_0x4f4961,null));};exports[_0x4086('0x56')]=function(_0x3e30ad,_0x56957d){var _0xcb4134={'raw':!![],'where':{'id':_0x3e30ad[_0x4086('0x57')]['id']}},_0x1d2845={};_0x1d2845[_0x4086('0x41')]=_['keys'](db[_0x4086('0x54')][_0x4086('0x3d')]);_0x1d2845[_0x4086('0x43')]=_['keys'](_0x3e30ad[_0x4086('0x43')]);_0x1d2845['filters']=_[_0x4086('0x46')](_0x1d2845[_0x4086('0x41')],_0x1d2845[_0x4086('0x43')]);_0xcb4134[_0x4086('0x47')]=_[_0x4086('0x46')](_0x1d2845['model'],qs[_0x4086('0x48')](_0x3e30ad[_0x4086('0x43')][_0x4086('0x48')]));_0xcb4134[_0x4086('0x47')]=_0xcb4134[_0x4086('0x47')][_0x4086('0x49')]?_0xcb4134[_0x4086('0x47')]:_0x1d2845[_0x4086('0x41')];if(_0x3e30ad[_0x4086('0x43')][_0x4086('0x58')]){_0xcb4134[_0x4086('0x55')]=[{'all':!![]}];}_0xcb4134=_[_0x4086('0x51')]({},_0xcb4134,_0x3e30ad[_0x4086('0x53')]);return db['ChatMessage']['find'](_0xcb4134)[_0x4086('0x22')](handleEntityNotFound(_0x56957d,null))[_0x4086('0x22')](respondWithResult(_0x56957d,null))[_0x4086('0x2a')](handleError(_0x56957d,null));};exports[_0x4086('0x59')]=function(_0x61dd59,_0x52526b){return db[_0x4086('0x54')]['create'](_0x61dd59[_0x4086('0x5a')],{})['then'](respondWithResult(_0x52526b,0xc9))[_0x4086('0x2a')](handleError(_0x52526b,null));};exports['update']=function(_0x3e808f,_0x3ca31b){if(_0x3e808f['body']['id']){delete _0x3e808f['body']['id'];}return db[_0x4086('0x54')][_0x4086('0x5b')]({'where':{'id':_0x3e808f[_0x4086('0x57')]['id']}})[_0x4086('0x22')](handleEntityNotFound(_0x3ca31b,null))[_0x4086('0x22')](saveUpdates(_0x3e808f[_0x4086('0x5a')],null))['then'](respondWithResult(_0x3ca31b,null))[_0x4086('0x2a')](handleError(_0x3ca31b,null));};exports[_0x4086('0x39')]=function(_0x5a7f33,_0x5da42c){return db[_0x4086('0x54')][_0x4086('0x5b')]({'where':{'id':_0x5a7f33[_0x4086('0x57')]['id']}})['then'](handleEntityNotFound(_0x5da42c,null))[_0x4086('0x22')](removeEntity(_0x5da42c,null))['catch'](handleError(_0x5da42c,null));};exports['describe']=function(_0x4d4bd5,_0x379b28){return db[_0x4086('0x54')][_0x4086('0x5c')]()[_0x4086('0x22')](respondWithResult(_0x379b28,null))['catch'](handleError(_0x379b28,null));};var interaction_log=require(_0x4086('0x17'))('chat-interactions');exports[_0x4086('0x5d')]=function(_0x2b72ca,_0x12c391,_0x43bbda){var _0x41a10c={'agent':{},'channel':_0x4086('0x5e')};if(_0x2b72ca[_0x4086('0x5a')]['id']){delete _0x2b72ca[_0x4086('0x5a')]['id'];}_0x2b72ca[_0x4086('0x5a')][_0x4086('0x5f')]=!![];_0x2b72ca[_0x4086('0x5a')][_0x4086('0x60')]=moment()['format'](_0x4086('0x61'));_0x2b72ca[_0x4086('0x5a')]['UserId']=_0x2b72ca[_0x4086('0x5a')][_0x4086('0x62')]||_0x2b72ca['user']['id'];_0x41a10c[_0x4086('0x63')]['id']=_0x2b72ca['body'][_0x4086('0x62')];return db[_0x4086('0x54')]['find']({'where':{'id':_0x2b72ca['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x12c391,null))[_0x4086('0x22')](saveUpdates(_0x2b72ca['body'],null))[_0x4086('0x22')](function(_0x51ee79){if(_0x51ee79){_0x41a10c['message']=_0x51ee79[_0x4086('0x64')]({'plain':!![]});return db[_0x4086('0x65')][_0x4086('0x5b')]({'where':{'id':_0x51ee79[_0x4086('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x12c391,null))[_0x4086('0x22')](function(_0x22f9a9){if(_0x22f9a9){return _0x22f9a9[_0x4086('0x38')]({'UserId':_0x2b72ca[_0x4086('0x5a')][_0x4086('0x62')],'read1stAt':_['isNil'](_0x22f9a9['read1stAt'])?moment()[_0x4086('0x67')](_0x4086('0x61')):undefined});}return null;})[_0x4086('0x22')](function(_0x405687){if(_0x405687){_0x41a10c['interaction']=_0x405687['get']({'plain':!![]});interaction_log[_0x4086('0x23')](_0x4086('0x68'),_0x2b72ca['user']['id'],_0x2b72ca[_0x4086('0x69')][_0x4086('0x3a')],_0x2b72ca[_0x4086('0x69')][_0x4086('0x6a')],_0x41a10c[_0x4086('0x6b')]['id'],_0x2b72ca['body']?JSON[_0x4086('0x26')](_0x2b72ca[_0x4086('0x5a')]):_0x4086('0x6c'));return respondWithRpcPromise(_0x4086('0x6d'),_0x4086('0x6e'),_0x41a10c);}return null;})[_0x4086('0x22')](function(_0x36b163){var _0x54f41f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x36b163[_0x4086('0x28')][_0x4086('0x6f')];return db[_0x4086('0x70')]['query'](_0x54f41f,{'type':db[_0x4086('0x71')][_0x4086('0x72')][_0x4086('0x73')],'raw':!![]})[_0x4086('0x22')](function(_0x59a1fb){return _0x59a1fb;});})[_0x4086('0x22')](function(_0x47d580){if(_0x47d580){_0x41a10c[_0x4086('0x28')][_0x4086('0x74')]=_0x47d580[0x0];if(!_0x2b72ca[_0x4086('0x5a')]['UserId'])return;return db[_0x4086('0x75')]['find']({'where':{'id':_0x2b72ca[_0x4086('0x5a')][_0x4086('0x62')],'role':'agent'},'attributes':['id','name',_0x4086('0x76'),_0x4086('0x77'),_0x4086('0x78')],'raw':!![]});}return null;})[_0x4086('0x22')](function(_0x5a4269){if(!_0x5a4269)return null;_0x41a10c[_0x4086('0x28')][_0x4086('0x63')]=_0x5a4269;return _0x41a10c;})[_0x4086('0x22')](function(_0x14c9d4){if(_0x14c9d4){if(_0x2b72ca[_0x4086('0x5a')][_0x4086('0x79')]){_0x41a10c['message'][_0x4086('0x7a')]=util[_0x4086('0x67')](_0x4086('0x7b'),_0x2b72ca['user'][_0x4086('0x3a')]);_0x41a10c[_0x4086('0x28')][_0x4086('0x7c')]=_0x41a10c['channel'];_0x41a10c[_0x4086('0x28')][_0x4086('0x7d')]=_0x41a10c[_0x4086('0x7c')];_0x41a10c[_0x4086('0x28')]['event']=_0x4086('0x5d');return respondWithRpcPromise(_0x4086('0x7e'),'EventManager',{'event':'acceptmessage','message':_[_0x4086('0x51')](_0x41a10c[_0x4086('0x28')],JSON[_0x4086('0x7f')](_0x41a10c[_0x4086('0x6b')][_0x4086('0x80')]))},client9002)[_0x4086('0x22')](function(){return _0x41a10c;});}return _0x41a10c;}return null;})[_0x4086('0x22')](respondWithResult(_0x12c391,null))['catch'](handleError(_0x12c391,null));};var interaction_log=require(_0x4086('0x17'))(_0x4086('0x81'));exports['reject']=function(_0x9d911d,_0x1929a0,_0x35bc48){var _0x339e41={'agent':{},'channel':_0x4086('0x5e')};if(_0x9d911d[_0x4086('0x5a')]['id']){delete _0x9d911d[_0x4086('0x5a')]['id'];}_0x9d911d[_0x4086('0x5a')][_0x4086('0x62')]=_0x9d911d[_0x4086('0x5a')][_0x4086('0x62')]||_0x9d911d['user']['id'];_0x339e41[_0x4086('0x63')]['id']=_0x9d911d[_0x4086('0x5a')][_0x4086('0x62')];return db[_0x4086('0x54')]['find']({'where':{'id':_0x9d911d['params']['id'],'UserId':null}})[_0x4086('0x22')](handleEntityNotFound(_0x1929a0,null))['then'](function(_0x2eefcd){if(_0x2eefcd){_0x339e41[_0x4086('0x28')]=_0x2eefcd[_0x4086('0x64')]({'plain':!![]});return db[_0x4086('0x65')][_0x4086('0x5b')]({'where':{'id':_0x2eefcd[_0x4086('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x1929a0,null))[_0x4086('0x22')](function(_0xa5307b){if(_0xa5307b){_0x339e41['interaction']=_0xa5307b[_0x4086('0x64')]({'plain':!![]});interaction_log[_0x4086('0x23')](_0x4086('0x82'),_0x9d911d['user']['id'],_0x9d911d['user'][_0x4086('0x3a')],_0x9d911d[_0x4086('0x69')]['role'],_0x339e41['interaction']['id'],_0x9d911d[_0x4086('0x5a')]?JSON['stringify'](_0x9d911d[_0x4086('0x5a')]):_0x4086('0x6c'));return respondWithRpcPromise(_0x4086('0x83'),'rejectMessage',_0x339e41);}return null;})[_0x4086('0x22')](function(_0x4d8bc8){var _0x4f63d8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4d8bc8['message']['ContactId'];return db['sequelize'][_0x4086('0x43')](_0x4f63d8,{'type':db['Sequelize'][_0x4086('0x72')][_0x4086('0x73')],'raw':!![]})[_0x4086('0x22')](function(_0x218bee){return _0x218bee;});})[_0x4086('0x22')](function(_0x345ff2){if(_0x345ff2){_0x339e41[_0x4086('0x28')][_0x4086('0x74')]=_0x345ff2[0x0];if(!_0x9d911d[_0x4086('0x5a')][_0x4086('0x62')])return;return db[_0x4086('0x75')][_0x4086('0x5b')]({'where':{'id':_0x9d911d['body'][_0x4086('0x62')],'role':_0x4086('0x63')},'attributes':['id',_0x4086('0x3a'),_0x4086('0x76'),_0x4086('0x77'),_0x4086('0x78')],'raw':!![]});}return null;})[_0x4086('0x22')](function(_0x14f976){if(!_0x14f976)return null;_0x339e41[_0x4086('0x28')][_0x4086('0x63')]=_0x14f976;return _0x339e41;})['then'](function(_0x4ab5bc){if(_0x4ab5bc){_0x4ab5bc[_0x4086('0x28')][_0x4086('0x7a')]=util[_0x4086('0x67')](_0x4086('0x7b'),_0x9d911d[_0x4086('0x69')]['name']);_0x4ab5bc['message'][_0x4086('0x7c')]=_0x339e41[_0x4086('0x7c')];_0x4ab5bc[_0x4086('0x28')]['motionChannel']=_0x339e41['channel'];_0x4ab5bc[_0x4086('0x28')][_0x4086('0x84')]=_0x4086('0x36');respondWithRpcPromise(_0x4086('0x7e'),_0x4086('0x7e'),{'event':_0x4086('0x85'),'message':_[_0x4086('0x51')](_0x339e41[_0x4086('0x28')],JSON['parse'](_0x339e41['interaction'][_0x4086('0x80')]))},client9002);return _0x339e41;}return null;})[_0x4086('0x22')](respondWithResult(_0x1929a0,null))['catch'](handleError(_0x1929a0,null));};
\ No newline at end of file
index d5a11fe..92d7e65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4be=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x39635f,_0x45525d){var _0x340960=function(_0x2011a7){while(--_0x2011a7){_0x39635f['push'](_0x39635f['shift']());}};_0x340960(++_0x45525d);}(_0xd4be,0x9f));var _0xed4b=function(_0x2951fa,_0x9f3367){_0x2951fa=_0x2951fa-0x0;var _0x21e25b=_0xd4be[_0x2951fa];return _0x21e25b;};'use strict';var EventEmitter=require(_0xed4b('0x0'));var ChatMessage=require(_0xed4b('0x1'))['db'][_0xed4b('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xed4b('0x3')](0x0);var events={'afterCreate':_0xed4b('0x4'),'afterUpdate':_0xed4b('0x5'),'afterDestroy':_0xed4b('0x6')};function emitEvent(_0x37d4c3){return function(_0x5694a8,_0x2ce761,_0x550bb2){ChatMessageEvents[_0xed4b('0x7')](_0x37d4c3+':'+_0x5694a8['id'],_0x5694a8);ChatMessageEvents[_0xed4b('0x7')](_0x37d4c3,_0x5694a8);_0x550bb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xed4b('0x8')](e,emitEvent(event));}}module[_0xed4b('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xd3b5=['ChatMessage','setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x45963c,_0x5ca146){var _0x55c6f6=function(_0x25433c){while(--_0x25433c){_0x45963c['push'](_0x45963c['shift']());}};_0x55c6f6(++_0x5ca146);}(_0xd3b5,0x1b7));var _0x5d3b=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xd3b5[_0x48d6a3];return _0x38bfa0;};'use strict';var EventEmitter=require(_0x5d3b('0x0'));var ChatMessage=require(_0x5d3b('0x1'))['db'][_0x5d3b('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5d3b('0x3')](0x0);var events={'afterCreate':_0x5d3b('0x4'),'afterUpdate':_0x5d3b('0x5'),'afterDestroy':_0x5d3b('0x6')};function emitEvent(_0x127b3d){return function(_0x587166,_0x2fbbcb,_0xaaee2a){ChatMessageEvents[_0x5d3b('0x7')](_0x127b3d+':'+_0x587166['id'],_0x587166);ChatMessageEvents[_0x5d3b('0x7')](_0x127b3d,_0x587166);_0xaaee2a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x5d3b('0x8')]=ChatMessageEvents;
\ No newline at end of file
index 1881bfe..d848eba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x623e=['error','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','isNil','UserId','ChatInteraction','findOne','then','update','createdAt'];(function(_0x290818,_0x500c35){var _0x2cc668=function(_0x605dfb){while(--_0x605dfb){_0x290818['push'](_0x290818['shift']());}};_0x2cc668(++_0x500c35);}(_0x623e,0x65));var _0xe623=function(_0x503166,_0x32adbd){_0x503166=_0x503166-0x0;var _0x57535b=_0x623e[_0x503166];return _0x57535b;};'use strict';var _=require(_0xe623('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe623('0x1'));var moment=require('moment');var BPromise=require(_0xe623('0x2'));var rp=require(_0xe623('0x3'));var fs=require('fs');var path=require(_0xe623('0x4'));var rimraf=require(_0xe623('0x5'));var config=require(_0xe623('0x6'));var attributes=require('./chatMessage.attributes');module[_0xe623('0x7')]=function(_0x5ed775,_0x570056){return _0x5ed775[_0xe623('0x8')](_0xe623('0x9'),attributes,{'tableName':_0xe623('0xa'),'paranoid':![],'indexes':[{'name':_0xe623('0xb'),'fields':[_0xe623('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x511a5c,_0xaf269d,_0x5930e2){var _0x5645fe=_0x5ed775[_0xe623('0xd')];var _0x4300f6=_0x511a5c[_0xe623('0xe')]({'plain':!![]});if(_0x4300f6[_0xe623('0xf')][_0xe623('0x10')]()==='in'||_0x4300f6[_0xe623('0xf')][_0xe623('0x10')]()==='out'&&!_0x4300f6['secret']&&!_[_0xe623('0x11')](_0x4300f6[_0xe623('0x12')])){_0x5645fe[_0xe623('0x13')][_0xe623('0x14')]({'where':{'id':_0x4300f6['ChatInteractionId']}})[_0xe623('0x15')](function(_0x2d05a2){if(_0x2d05a2){_0x2d05a2[_0xe623('0x16')]({'lastMsgAt':_0x4300f6[_0xe623('0x17')],'lastMsgDirection':_0x4300f6[_0xe623('0xf')][_0xe623('0x10')]()});}})['catch'](function(_0x3bee29){console[_0xe623('0x18')](_0x3bee29);});}_0x5930e2();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb1b0=['ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','direction','catch','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports'];(function(_0x1b0b3a,_0x8a793d){var _0x1105a0=function(_0x2fd35d){while(--_0x2fd35d){_0x1b0b3a['push'](_0x1b0b3a['shift']());}};_0x1105a0(++_0x8a793d);}(_0xb1b0,0x1c6));var _0x0b1b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb1b0[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x0b1b('0x0'));var logger=require(_0x0b1b('0x1'))(_0x0b1b('0x2'));var moment=require(_0x0b1b('0x3'));var BPromise=require(_0x0b1b('0x4'));var rp=require(_0x0b1b('0x5'));var fs=require('fs');var path=require(_0x0b1b('0x6'));var rimraf=require(_0x0b1b('0x7'));var config=require('../../config/environment');var attributes=require(_0x0b1b('0x8'));module[_0x0b1b('0x9')]=function(_0x41eb89,_0x7047a1){return _0x41eb89['define'](_0x0b1b('0xa'),attributes,{'tableName':_0x0b1b('0xb'),'paranoid':![],'indexes':[{'name':_0x0b1b('0xc'),'fields':['body'],'type':_0x0b1b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1db22f,_0x3224d6,_0x57cbe8){var _0x26c9a9=_0x41eb89[_0x0b1b('0xe')];var _0x4ee018=_0x1db22f['get']({'plain':!![]});if(_0x4ee018['direction'][_0x0b1b('0xf')]()==='in'||_0x4ee018['direction'][_0x0b1b('0xf')]()===_0x0b1b('0x10')&&!_0x4ee018[_0x0b1b('0x11')]&&!_[_0x0b1b('0x12')](_0x4ee018[_0x0b1b('0x13')])){_0x26c9a9[_0x0b1b('0x14')][_0x0b1b('0x15')]({'where':{'id':_0x4ee018[_0x0b1b('0x16')]}})[_0x0b1b('0x17')](function(_0x1c0166){if(_0x1c0166){_0x1c0166['update']({'lastMsgAt':_0x4ee018[_0x0b1b('0x18')],'lastMsgDirection':_0x4ee018[_0x0b1b('0x19')][_0x0b1b('0xf')]()});}})[_0x0b1b('0x1a')](function(_0x44a464){console[_0x0b1b('0x1b')](_0x44a464);});}_0x57cbe8();}},'charset':_0x0b1b('0x1c'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index a751045..aa1ba11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f24=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','bluebird','randomstring'];(function(_0x1ae94c,_0x489198){var _0x91a500=function(_0x51a333){while(--_0x51a333){_0x1ae94c['push'](_0x1ae94c['shift']());}};_0x91a500(++_0x489198);}(_0x1f24,0x12f));var _0x41f2=function(_0x3877aa,_0x42bf1e){_0x3877aa=_0x3877aa-0x0;var _0x4e2e61=_0x1f24[_0x3877aa];return _0x4e2e61;};'use strict';var _=require(_0x41f2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x41f2('0x1'));var rs=require(_0x41f2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x41f2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x41f2('0x4'))('rpc');var config=require(_0x41f2('0x5'));var jayson=require(_0x41f2('0x6'));var client=jayson[_0x41f2('0x7')][_0x41f2('0x8')]({'port':0x232a});config[_0x41f2('0x9')]=_[_0x41f2('0xa')](config[_0x41f2('0x9')],{'host':_0x41f2('0xb'),'port':0x18eb});var socket=require(_0x41f2('0xc'))(new Redis(config['redis']));require(_0x41f2('0xd'))[_0x41f2('0xe')](socket);function respondWithRpcPromise(_0x34ea0a,_0x36e9ba,_0x38c5ef){return new BPromise(function(_0x3454f0,_0x5583da){return client[_0x41f2('0xf')](_0x34ea0a,_0x38c5ef)[_0x41f2('0x10')](function(_0x58642a){logger[_0x41f2('0x11')](_0x41f2('0x12'),_0x36e9ba,'request\x20sent');logger[_0x41f2('0x13')](_0x41f2('0x14'),_0x36e9ba,_0x41f2('0x15'),JSON[_0x41f2('0x16')](_0x58642a));if(_0x58642a['error']){if(_0x58642a[_0x41f2('0x17')][_0x41f2('0x18')]===0x1f4){logger[_0x41f2('0x17')](_0x41f2('0x12'),_0x36e9ba,_0x58642a[_0x41f2('0x17')]['message']);return _0x5583da(_0x58642a[_0x41f2('0x17')][_0x41f2('0x19')]);}logger[_0x41f2('0x17')]('ChatMessage,\x20%s,\x20%s',_0x36e9ba,_0x58642a[_0x41f2('0x17')][_0x41f2('0x19')]);return _0x3454f0(_0x58642a[_0x41f2('0x17')]['message']);}else{logger['info'](_0x41f2('0x12'),_0x36e9ba,'request\x20sent');_0x3454f0(_0x58642a[_0x41f2('0x1a')]['message']);}})['catch'](function(_0x3819cf){logger['error'](_0x41f2('0x12'),_0x36e9ba,_0x3819cf);_0x5583da(_0x3819cf);});});}exports[_0x41f2('0x1b')]=function(_0x3e7db5){var _0x42a9f2=this;return new Promise(function(_0x38d8c0,_0x26d0bc){return db[_0x41f2('0x1c')][_0x41f2('0x1d')](_0x3e7db5[_0x41f2('0x1e')],{'raw':_0x3e7db5[_0x41f2('0x1f')]?_0x3e7db5['options'][_0x41f2('0x20')]===undefined?!![]:![]:!![]})[_0x41f2('0x10')](function(_0x3dc07d){logger['info']('CreateChatMessage',_0x3e7db5);logger['debug'](_0x41f2('0x1b'),_0x3e7db5,JSON[_0x41f2('0x16')](_0x3dc07d));_0x38d8c0(_0x3dc07d);})[_0x41f2('0x21')](function(_0x3ba91e){logger['error'](_0x41f2('0x1b'),_0x3ba91e[_0x41f2('0x19')],_0x3e7db5);_0x26d0bc(_0x42a9f2[_0x41f2('0x17')](0x1f4,_0x3ba91e[_0x41f2('0x19')]));});});};
\ No newline at end of file
+var _0x2c42=['client','http','redis','localhost','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2c42,0x18b));var _0x22c4=function(_0x3ecd63,_0x59f3d2){_0x3ecd63=_0x3ecd63-0x0;var _0x51e2ee=_0x2c42[_0x3ecd63];return _0x51e2ee;};'use strict';var _=require(_0x22c4('0x0'));var util=require('util');var moment=require(_0x22c4('0x1'));var BPromise=require('bluebird');var rs=require(_0x22c4('0x2'));var fs=require('fs');var Redis=require(_0x22c4('0x3'));var db=require(_0x22c4('0x4'))['db'];var utils=require(_0x22c4('0x5'));var logger=require('../../config/logger')(_0x22c4('0x6'));var config=require(_0x22c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x22c4('0x8')][_0x22c4('0x9')]({'port':0x232a});config[_0x22c4('0xa')]=_['defaults'](config['redis'],{'host':_0x22c4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x22c4('0xa')]));require(_0x22c4('0xc'))[_0x22c4('0xd')](socket);function respondWithRpcPromise(_0xe515aa,_0x379a6f,_0x36c546){return new BPromise(function(_0x47a088,_0x4e635c){return client[_0x22c4('0xe')](_0xe515aa,_0x36c546)['then'](function(_0x2ee14a){logger[_0x22c4('0xf')](_0x22c4('0x10'),_0x379a6f,_0x22c4('0x11'));logger[_0x22c4('0x12')](_0x22c4('0x13'),_0x379a6f,_0x22c4('0x11'),JSON[_0x22c4('0x14')](_0x2ee14a));if(_0x2ee14a[_0x22c4('0x15')]){if(_0x2ee14a[_0x22c4('0x15')][_0x22c4('0x16')]===0x1f4){logger[_0x22c4('0x15')](_0x22c4('0x10'),_0x379a6f,_0x2ee14a[_0x22c4('0x15')]['message']);return _0x4e635c(_0x2ee14a['error'][_0x22c4('0x17')]);}logger[_0x22c4('0x15')]('ChatMessage,\x20%s,\x20%s',_0x379a6f,_0x2ee14a[_0x22c4('0x15')]['message']);return _0x47a088(_0x2ee14a[_0x22c4('0x15')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x379a6f,_0x22c4('0x11'));_0x47a088(_0x2ee14a[_0x22c4('0x18')]['message']);}})[_0x22c4('0x19')](function(_0x4eb48c){logger[_0x22c4('0x15')](_0x22c4('0x10'),_0x379a6f,_0x4eb48c);_0x4e635c(_0x4eb48c);});});}exports[_0x22c4('0x1a')]=function(_0x4907fb){var _0x295fec=this;return new Promise(function(_0x327264,_0x487f85){return db[_0x22c4('0x1b')][_0x22c4('0x1c')](_0x4907fb[_0x22c4('0x1d')],{'raw':_0x4907fb[_0x22c4('0x1e')]?_0x4907fb['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3bae7f){logger['info'](_0x22c4('0x1a'),_0x4907fb);logger['debug'](_0x22c4('0x1a'),_0x4907fb,JSON[_0x22c4('0x14')](_0x3bae7f));_0x327264(_0x3bae7f);})['catch'](function(_0x470356){logger[_0x22c4('0x15')](_0x22c4('0x1a'),_0x470356[_0x22c4('0x17')],_0x4907fb);_0x487f85(_0x295fec['error'](0x1f4,_0x470356[_0x22c4('0x17')]));});});};
\ No newline at end of file
index b1a3fef..51245c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b20=['removeListener','register','length','chatMessage:','save','remove','emit'];(function(_0x1ee294,_0xbba3f5){var _0x41d205=function(_0x529f07){while(--_0x529f07){_0x1ee294['push'](_0x1ee294['shift']());}};_0x41d205(++_0xbba3f5);}(_0x1b20,0x66));var _0x01b2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1b20[_0x4565bf];return _0x5610ba;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x01b2('0x0'),_0x01b2('0x1'),'update'];function createListener(_0x54eccf,_0x27a406){return function(_0x18e3ff){_0x27a406[_0x01b2('0x2')](_0x54eccf,_0x18e3ff);};}function removeListener(_0x1150fc,_0x1cf757){return function(){ChatMessageEvents[_0x01b2('0x3')](_0x1150fc,_0x1cf757);};}exports[_0x01b2('0x4')]=function(_0x28de4a){for(var _0x46e745=0x0,_0xa64ad1=events[_0x01b2('0x5')];_0x46e745<_0xa64ad1;_0x46e745++){var _0x323470=events[_0x46e745];var _0x508add=createListener(_0x01b2('0x6')+_0x323470,_0x28de4a);ChatMessageEvents['on'](_0x323470,_0x508add);}};
\ No newline at end of file
+var _0x2123=['./chatMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2616e7,_0x259402){var _0x1f9b56=function(_0xa30f7f){while(--_0xa30f7f){_0x2616e7['push'](_0x2616e7['shift']());}};_0x1f9b56(++_0x259402);}(_0x2123,0x190));var _0x3212=function(_0x327383,_0x236284){_0x327383=_0x327383-0x0;var _0x1efb9a=_0x2123[_0x327383];return _0x1efb9a;};'use strict';var ChatMessageEvents=require(_0x3212('0x0'));var events=[_0x3212('0x1'),_0x3212('0x2'),_0x3212('0x3')];function createListener(_0x7158b8,_0x2ff863){return function(_0x8c047){_0x2ff863[_0x3212('0x4')](_0x7158b8,_0x8c047);};}function removeListener(_0x304f80,_0x6ca653){return function(){ChatMessageEvents[_0x3212('0x5')](_0x304f80,_0x6ca653);};}exports[_0x3212('0x6')]=function(_0x5d9d36){for(var _0x3859e4=0x0,_0x2b1302=events[_0x3212('0x7')];_0x3859e4<_0x2b1302;_0x3859e4++){var _0x4b35e9=events[_0x3859e4];var _0x3e17a3=createListener('chatMessage:'+_0x4b35e9,_0x5d9d36);ChatMessageEvents['on'](_0x4b35e9,_0x3e17a3);}};
\ No newline at end of file
index ba0ad07..3000d39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe9e=['isAuthenticated','tracked','chat','chatmessage:create','create','put','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id'];(function(_0xd89f4e,_0x275d9){var _0x2bf51b=function(_0x68692a){while(--_0x68692a){_0xd89f4e['push'](_0xd89f4e['shift']());}};_0x2bf51b(++_0x275d9);}(_0xfe9e,0x177));var _0xefe9=function(_0x50c16c,_0x43b99e){_0x50c16c=_0x50c16c-0x0;var _0x24dc5f=_0xfe9e[_0x50c16c];return _0x24dc5f;};'use strict';var multer=require(_0xefe9('0x0'));var util=require(_0xefe9('0x1'));var path=require(_0xefe9('0x2'));var timeout=require(_0xefe9('0x3'));var express=require(_0xefe9('0x4'));var router=express[_0xefe9('0x5')]();var fs_extra=require(_0xefe9('0x6'));var auth=require(_0xefe9('0x7'));var interaction=require(_0xefe9('0x8'));var config=require(_0xefe9('0x9'));var controller=require('./chatMessage.controller');router[_0xefe9('0xa')]('/',auth['isAuthenticated'](),controller[_0xefe9('0xb')]);router[_0xefe9('0xa')](_0xefe9('0xc'),auth['isAuthenticated'](),controller[_0xefe9('0xd')]);router['get'](_0xefe9('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xefe9('0xf')](),interaction[_0xefe9('0x10')](_0xefe9('0x11'),_0xefe9('0x12')),controller[_0xefe9('0x13')]);router[_0xefe9('0x14')]('/:id',controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xefe9('0x15')]);router[_0xefe9('0x14')](_0xefe9('0x16'),auth[_0xefe9('0xf')](),controller['reject']);router[_0xefe9('0x17')](_0xefe9('0xe'),auth[_0xefe9('0xf')](),controller[_0xefe9('0x18')]);module[_0xefe9('0x19')]=router;
\ No newline at end of file
+var _0xd296=['describe','post','tracked','chat','chatmessage:create','create','put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd296,0x17a));var _0x6d29=function(_0x26e8c8,_0x156146){_0x26e8c8=_0x26e8c8-0x0;var _0x2a25e7=_0xd296[_0x26e8c8];return _0x2a25e7;};'use strict';var multer=require('multer');var util=require(_0x6d29('0x0'));var path=require('path');var timeout=require(_0x6d29('0x1'));var express=require(_0x6d29('0x2'));var router=express[_0x6d29('0x3')]();var fs_extra=require(_0x6d29('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6d29('0x5'));var config=require(_0x6d29('0x6'));var controller=require(_0x6d29('0x7'));router[_0x6d29('0x8')]('/',auth['isAuthenticated'](),controller[_0x6d29('0x9')]);router['get'](_0x6d29('0xa'),auth[_0x6d29('0xb')](),controller[_0x6d29('0xc')]);router[_0x6d29('0x8')]('/:id',auth[_0x6d29('0xb')](),controller['show']);router[_0x6d29('0xd')]('/',auth[_0x6d29('0xb')](),interaction[_0x6d29('0xe')](_0x6d29('0xf'),_0x6d29('0x10')),controller[_0x6d29('0x11')]);router[_0x6d29('0x12')](_0x6d29('0x13'),controller[_0x6d29('0x14')]);router[_0x6d29('0x12')](_0x6d29('0x15'),auth[_0x6d29('0xb')](),controller['accept']);router[_0x6d29('0x12')](_0x6d29('0x16'),auth[_0x6d29('0xb')](),controller[_0x6d29('0x17')]);router[_0x6d29('0x18')](_0x6d29('0x13'),auth[_0x6d29('0xb')](),controller[_0x6d29('0x19')]);module['exports']=router;
\ No newline at end of file
index 9f40e17..ec23c2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8d6=['exports','TEXT','medium','sequelize'];(function(_0x3c819e,_0x1d0c31){var _0x122739=function(_0x2deea9){while(--_0x2deea9){_0x3c819e['push'](_0x3c819e['shift']());}};_0x122739(++_0x1d0c31);}(_0xd8d6,0x177));var _0x6d8d=function(_0x349766,_0x1b7f7d){_0x349766=_0x349766-0x0;var _0xbfc0dd=_0xd8d6[_0x349766];return _0xbfc0dd;};'use strict';var Sequelize=require(_0x6d8d('0x0'));module[_0x6d8d('0x1')]={'body':{'type':Sequelize[_0x6d8d('0x2')](_0x6d8d('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x2ffc=['medium','sequelize','TEXT'];(function(_0x2945bf,_0x4b9ab4){var _0x1c78bb=function(_0xff0f4){while(--_0xff0f4){_0x2945bf['push'](_0x2945bf['shift']());}};_0x1c78bb(++_0x4b9ab4);}(_0x2ffc,0x100));var _0xc2ff=function(_0x32711b,_0x5534fd){_0x32711b=_0x32711b-0x0;var _0x1f23b2=_0x2ffc[_0x32711b];return _0x1f23b2;};'use strict';var Sequelize=require(_0xc2ff('0x0'));module['exports']={'body':{'type':Sequelize[_0xc2ff('0x1')](_0xc2ff('0x2')),'allowNull':![]}};
\ No newline at end of file
index 9ff4d0d..daa5cd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x7a54,0x106));var _0x47a5=function(_0x1e700b,_0x495c85){_0x1e700b=_0x1e700b-0x0;var _0x42ca03=_0x7a54[_0x1e700b];return _0x42ca03;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _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(_0x1104d5,_0x91b129){_0x1104d5=_0x1104d5-0x0;var _0x43e14c=_0x7a54[_0x1104d5];return _0x43e14c;};'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 f47c7f1..8c3c75d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ff9=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x398eb8,_0x4757d8){var _0x5aa1d6=function(_0x190a13){while(--_0x190a13){_0x398eb8['push'](_0x398eb8['shift']());}};_0x5aa1d6(++_0x4757d8);}(_0x0ff9,0x156));var _0x90ff=function(_0x1ce472,_0x5f5374){_0x1ce472=_0x1ce472-0x0;var _0x5414e7=_0x0ff9[_0x1ce472];return _0x5414e7;};'use strict';var _=require('lodash');var util=require(_0x90ff('0x0'));var logger=require(_0x90ff('0x1'))(_0x90ff('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x90ff('0x3'));var fs=require('fs');var path=require(_0x90ff('0x4'));var rimraf=require(_0x90ff('0x5'));var config=require(_0x90ff('0x6'));var attributes=require(_0x90ff('0x7'));module[_0x90ff('0x8')]=function(_0x46cacb,_0x2ee7dd){return _0x46cacb[_0x90ff('0x9')](_0x90ff('0xa'),attributes,{'tableName':_0x90ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x90ff('0xc'),'collate':_0x90ff('0xd')});};
\ No newline at end of file
+var _0x376f=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x10585d,_0x5b1571){var _0x1c7708=function(_0x32deae){while(--_0x32deae){_0x10585d['push'](_0x10585d['shift']());}};_0x1c7708(++_0x5b1571);}(_0x376f,0x186));var _0xf376=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x376f[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xf376('0x0'));var util=require(_0xf376('0x1'));var logger=require(_0xf376('0x2'))(_0xf376('0x3'));var moment=require(_0xf376('0x4'));var BPromise=require(_0xf376('0x5'));var rp=require(_0xf376('0x6'));var fs=require('fs');var path=require(_0xf376('0x7'));var rimraf=require(_0xf376('0x8'));var config=require(_0xf376('0x9'));var attributes=require(_0xf376('0xa'));module[_0xf376('0xb')]=function(_0x2836c7,_0x34b4e9){return _0x2836c7[_0xf376('0xc')](_0xf376('0xd'),attributes,{'tableName':_0xf376('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf376('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 735016e..1bcec7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5270=['error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5270,0xab));var _0x0527=function(_0x231c1e,_0xff1290){_0x231c1e=_0x231c1e-0x0;var _0x3a220a=_0x5270[_0x231c1e];return _0x3a220a;};'use strict';var _=require(_0x0527('0x0'));var util=require(_0x0527('0x1'));var moment=require('moment');var BPromise=require(_0x0527('0x2'));var rs=require(_0x0527('0x3'));var fs=require('fs');var Redis=require(_0x0527('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0527('0x5'));var logger=require(_0x0527('0x6'))(_0x0527('0x7'));var config=require(_0x0527('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0527('0x9')][_0x0527('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f6299,_0x3b2f09,_0x5b2929){return new BPromise(function(_0x42a07f,_0xd6cf99){return client[_0x0527('0xb')](_0x3f6299,_0x5b2929)[_0x0527('0xc')](function(_0x2f0a05){logger[_0x0527('0xd')](_0x0527('0xe'),_0x3b2f09,_0x0527('0xf'));logger[_0x0527('0x10')](_0x0527('0x11'),_0x3b2f09,_0x0527('0xf'),JSON['stringify'](_0x2f0a05));if(_0x2f0a05['error']){if(_0x2f0a05[_0x0527('0x12')]['code']===0x1f4){logger[_0x0527('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3b2f09,_0x2f0a05['error']['message']);return _0xd6cf99(_0x2f0a05['error']['message']);}logger['error'](_0x0527('0xe'),_0x3b2f09,_0x2f0a05['error'][_0x0527('0x13')]);return _0x42a07f(_0x2f0a05[_0x0527('0x12')][_0x0527('0x13')]);}else{logger[_0x0527('0xd')](_0x0527('0xe'),_0x3b2f09,_0x0527('0xf'));_0x42a07f(_0x2f0a05[_0x0527('0x14')][_0x0527('0x13')]);}})['catch'](function(_0x2bc699){logger['error'](_0x0527('0xe'),_0x3b2f09,_0x2bc699);_0xd6cf99(_0x2bc699);});});}
\ No newline at end of file
+var _0xa70f=['info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then'];(function(_0x42d673,_0xbbfd58){var _0x4311b2=function(_0x9ab2a4){while(--_0x9ab2a4){_0x42d673['push'](_0x42d673['shift']());}};_0x4311b2(++_0xbbfd58);}(_0xa70f,0xb4));var _0xfa70=function(_0x351207,_0x3fe17d){_0x351207=_0x351207-0x0;var _0xde3a05=_0xa70f[_0x351207];return _0xde3a05;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfa70('0x0'));var rs=require(_0xfa70('0x1'));var fs=require('fs');var Redis=require(_0xfa70('0x2'));var db=require(_0xfa70('0x3'))['db'];var utils=require(_0xfa70('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfa70('0x5'));var client=jayson[_0xfa70('0x6')][_0xfa70('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2fd406,_0xae7c5,_0x527aa1){return new BPromise(function(_0x5c5bb4,_0x46fbac){return client[_0xfa70('0x8')](_0x2fd406,_0x527aa1)[_0xfa70('0x9')](function(_0x210a44){logger[_0xfa70('0xa')](_0xfa70('0xb'),_0xae7c5,'request\x20sent');logger[_0xfa70('0xc')](_0xfa70('0xd'),_0xae7c5,'request\x20sent',JSON['stringify'](_0x210a44));if(_0x210a44[_0xfa70('0xe')]){if(_0x210a44['error'][_0xfa70('0xf')]===0x1f4){logger[_0xfa70('0xe')](_0xfa70('0xb'),_0xae7c5,_0x210a44[_0xfa70('0xe')][_0xfa70('0x10')]);return _0x46fbac(_0x210a44[_0xfa70('0xe')][_0xfa70('0x10')]);}logger[_0xfa70('0xe')](_0xfa70('0xb'),_0xae7c5,_0x210a44['error'][_0xfa70('0x10')]);return _0x5c5bb4(_0x210a44[_0xfa70('0xe')]['message']);}else{logger[_0xfa70('0xa')](_0xfa70('0xb'),_0xae7c5,'request\x20sent');_0x5c5bb4(_0x210a44[_0xfa70('0x11')][_0xfa70('0x10')]);}})[_0xfa70('0x12')](function(_0x3b4496){logger[_0xfa70('0xe')](_0xfa70('0xb'),_0xae7c5,_0x3b4496);_0x46fbac(_0x3b4496);});});}
\ No newline at end of file
index 028966e..2f49f3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf77b=['create','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0xf77b,0xa2));var _0xbf77=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xf77b[_0x3c8e9a];return _0x2d4c57;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xbf77('0x0'));var express=require(_0xbf77('0x1'));var router=express[_0xbf77('0x2')]();var fs_extra=require(_0xbf77('0x3'));var auth=require(_0xbf77('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbf77('0x5'));var controller=require(_0xbf77('0x6'));router[_0xbf77('0x7')]('/',auth[_0xbf77('0x8')](),controller[_0xbf77('0x9')]);router[_0xbf77('0x7')](_0xbf77('0xa'),auth[_0xbf77('0x8')](),controller[_0xbf77('0xb')]);router['get'](_0xbf77('0xc'),auth[_0xbf77('0x8')](),controller['show']);router[_0xbf77('0xd')]('/',auth[_0xbf77('0x8')](),controller[_0xbf77('0xe')]);router['put'](_0xbf77('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbf77('0xc'),auth[_0xbf77('0x8')](),controller['destroy']);module[_0xbf77('0xf')]=router;
\ No newline at end of file
+var _0x70c4=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','multer'];(function(_0x3ed9e8,_0x2ea173){var _0xd41c2c=function(_0x1927f0){while(--_0x1927f0){_0x3ed9e8['push'](_0x3ed9e8['shift']());}};_0xd41c2c(++_0x2ea173);}(_0x70c4,0x18f));var _0x470c=function(_0x1fab16,_0x20ea3c){_0x1fab16=_0x1fab16-0x0;var _0xb22c23=_0x70c4[_0x1fab16];return _0xb22c23;};'use strict';var multer=require(_0x470c('0x0'));var util=require(_0x470c('0x1'));var path=require(_0x470c('0x2'));var timeout=require(_0x470c('0x3'));var express=require(_0x470c('0x4'));var router=express[_0x470c('0x5')]();var fs_extra=require(_0x470c('0x6'));var auth=require(_0x470c('0x7'));var interaction=require(_0x470c('0x8'));var config=require(_0x470c('0x9'));var controller=require(_0x470c('0xa'));router[_0x470c('0xb')]('/',auth[_0x470c('0xc')](),controller['index']);router[_0x470c('0xb')]('/describe',auth[_0x470c('0xc')](),controller[_0x470c('0xd')]);router[_0x470c('0xb')](_0x470c('0xe'),auth[_0x470c('0xc')](),controller[_0x470c('0xf')]);router[_0x470c('0x10')]('/',auth[_0x470c('0xc')](),controller[_0x470c('0x11')]);router[_0x470c('0x12')](_0x470c('0xe'),auth[_0x470c('0xc')](),controller[_0x470c('0x13')]);router['delete'](_0x470c('0xe'),auth[_0x470c('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 1e9e612..7bcea82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ce=['timeout','STRING','exports','ENUM','mouseOver'];(function(_0x16fd27,_0x3b82ef){var _0x2539e9=function(_0x3be0e1){while(--_0x3be0e1){_0x16fd27['push'](_0x16fd27['shift']());}};_0x2539e9(++_0x3b82ef);}(_0x53ce,0x110));var _0xe53c=function(_0x353dfb,_0x4fcbcc){_0x353dfb=_0x353dfb-0x0;var _0x34fc15=_0x53ce[_0x353dfb];return _0x34fc15;};'use strict';var Sequelize=require('sequelize');module[_0xe53c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe53c('0x1')](_0xe53c('0x2'),_0xe53c('0x3')),'defaultValue':_0xe53c('0x2')},'selector':{'type':Sequelize[_0xe53c('0x4')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xc7b4=['ENUM','mouseOver','timeout','INTEGER','sequelize','STRING'];(function(_0x4dce85,_0x140ba9){var _0x5c9710=function(_0x4c3342){while(--_0x4c3342){_0x4dce85['push'](_0x4dce85['shift']());}};_0x5c9710(++_0x140ba9);}(_0xc7b4,0x1ea));var _0x4c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4c7b('0x0'));module['exports']={'name':{'type':Sequelize[_0x4c7b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4c7b('0x2')](_0x4c7b('0x3'),_0x4c7b('0x4')),'defaultValue':_0x4c7b('0x3')},'selector':{'type':Sequelize[_0x4c7b('0x1')]},'timeout':{'type':Sequelize[_0x4c7b('0x5')]}};
\ No newline at end of file
index 82e6afc..b3c144a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe314=['mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','then','error','stack','name','show','model','ChatProactiveAction','rawAttributes','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','update','body','destroy','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0xe314,0x7c));var _0x4e31=function(_0x5e1184,_0x22508c){_0x5e1184=_0x5e1184-0x0;var _0x4f6ef7=_0xe314[_0x5e1184];return _0x4f6ef7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e31('0x0'));var zipdir=require(_0x4e31('0x1'));var jsonpatch=require(_0x4e31('0x2'));var rp=require(_0x4e31('0x3'));var moment=require(_0x4e31('0x4'));var BPromise=require(_0x4e31('0x5'));var Mustache=require(_0x4e31('0x6'));var util=require(_0x4e31('0x7'));var path=require(_0x4e31('0x8'));var sox=require(_0x4e31('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e31('0xa'));var _=require(_0x4e31('0xb'));var squel=require(_0x4e31('0xc'));var crypto=require(_0x4e31('0xd'));var jsforce=require(_0x4e31('0xe'));var deskjs=require(_0x4e31('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4e31('0x10'));var Papa=require(_0x4e31('0x11'));var Redis=require(_0x4e31('0x12'));var authService=require(_0x4e31('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4e31('0x14'));var hardwareService=require(_0x4e31('0x15'));var logger=require(_0x4e31('0x16'))(_0x4e31('0x17'));var utils=require(_0x4e31('0x18'));var config=require(_0x4e31('0x19'));var licenseUtil=require(_0x4e31('0x1a'));var db=require(_0x4e31('0x1b'))['db'];function respondWithStatusCode(_0x278a3b,_0x3f8dff){_0x3f8dff=_0x3f8dff||0xcc;return function(_0x41abc8){if(_0x41abc8){return _0x278a3b[_0x4e31('0x1c')](_0x3f8dff);}return _0x278a3b[_0x4e31('0x1d')](_0x3f8dff)[_0x4e31('0x1e')]();};}function respondWithResult(_0x9d0d2,_0x3f7e56){_0x3f7e56=_0x3f7e56||0xc8;return function(_0x8389a9){if(_0x8389a9){return _0x9d0d2[_0x4e31('0x1d')](_0x3f7e56)['json'](_0x8389a9);}};}function respondWithFilteredResult(_0xee6bb9,_0x2e8651){return function(_0x551b8e){if(_0x551b8e){var _0x23dd30=typeof _0x2e8651[_0x4e31('0x1f')]===_0x4e31('0x20')&&typeof _0x2e8651['limit']===_0x4e31('0x20');var _0x14a367=_0x551b8e[_0x4e31('0x21')];var _0x5cdcba=_0x23dd30?0x0:_0x2e8651[_0x4e31('0x1f')];var _0x4264f7=_0x23dd30?_0x551b8e[_0x4e31('0x21')]:_0x2e8651['offset']+_0x2e8651[_0x4e31('0x22')];var _0x2c36f6;if(_0x4264f7>=_0x14a367){_0x4264f7=_0x14a367;_0x2c36f6=0xc8;}else{_0x2c36f6=0xce;}_0xee6bb9['status'](_0x2c36f6);return _0xee6bb9['set'](_0x4e31('0x23'),_0x5cdcba+'-'+_0x4264f7+'/'+_0x14a367)[_0x4e31('0x24')](_0x551b8e);}return null;};}function patchUpdates(_0x38dd6c){return function(_0x349594){try{jsonpatch[_0x4e31('0x25')](_0x349594,_0x38dd6c,!![]);}catch(_0x1b7968){return BPromise[_0x4e31('0x26')](_0x1b7968);}return _0x349594['save']();};}function saveUpdates(_0x41aaa7,_0x31c5dc){return function(_0x240d19){if(_0x240d19){return _0x240d19['update'](_0x41aaa7)[_0x4e31('0x27')](function(_0xcd5940){return _0xcd5940;});}return null;};}function removeEntity(_0x171a42,_0x3d4255){return function(_0x12efaf){if(_0x12efaf){return _0x12efaf['destroy']()[_0x4e31('0x27')](function(){_0x171a42[_0x4e31('0x1d')](0xcc)[_0x4e31('0x1e')]();});}};}function handleEntityNotFound(_0x53c3e0,_0x1a3435){return function(_0xe7e0f8){if(!_0xe7e0f8){_0x53c3e0[_0x4e31('0x1c')](0x194);}return _0xe7e0f8;};}function handleError(_0x182a4d,_0x20941d){_0x20941d=_0x20941d||0x1f4;return function(_0x1ee99c){logger[_0x4e31('0x28')](_0x1ee99c[_0x4e31('0x29')]);if(_0x1ee99c[_0x4e31('0x2a')]){delete _0x1ee99c[_0x4e31('0x2a')];}_0x182a4d[_0x4e31('0x1d')](_0x20941d)['send'](_0x1ee99c);};}exports[_0x4e31('0x2b')]=function(_0x3b74b0,_0x55cb05){var _0x32d9bf={'raw':!![],'where':{'id':_0x3b74b0['params']['id']}},_0x41d0eb={};_0x41d0eb[_0x4e31('0x2c')]=_['keys'](db[_0x4e31('0x2d')][_0x4e31('0x2e')]);_0x41d0eb['query']=_[_0x4e31('0x2f')](_0x3b74b0[_0x4e31('0x30')]);_0x41d0eb[_0x4e31('0x31')]=_[_0x4e31('0x32')](_0x41d0eb[_0x4e31('0x2c')],_0x41d0eb[_0x4e31('0x30')]);_0x32d9bf[_0x4e31('0x33')]=_[_0x4e31('0x32')](_0x41d0eb[_0x4e31('0x2c')],qs[_0x4e31('0x34')](_0x3b74b0['query'][_0x4e31('0x34')]));_0x32d9bf[_0x4e31('0x33')]=_0x32d9bf['attributes'][_0x4e31('0x35')]?_0x32d9bf[_0x4e31('0x33')]:_0x41d0eb[_0x4e31('0x2c')];if(_0x3b74b0['query'][_0x4e31('0x36')]){_0x32d9bf[_0x4e31('0x37')]=[{'all':!![]}];}_0x32d9bf=_[_0x4e31('0x38')]({},_0x32d9bf,_0x3b74b0[_0x4e31('0x39')]);return db['ChatProactiveAction'][_0x4e31('0x3a')](_0x32d9bf)['then'](handleEntityNotFound(_0x55cb05,null))['then'](respondWithResult(_0x55cb05,null))[_0x4e31('0x3b')](handleError(_0x55cb05,null));};exports[_0x4e31('0x3c')]=function(_0x5c2dcb,_0x4d82cc){return db[_0x4e31('0x2d')][_0x4e31('0x3c')](_0x5c2dcb['body'],{})['then'](respondWithResult(_0x4d82cc,0xc9))[_0x4e31('0x3b')](handleError(_0x4d82cc,null));};exports[_0x4e31('0x3d')]=function(_0x3b2e20,_0x34f11f){if(_0x3b2e20['body']['id']){delete _0x3b2e20[_0x4e31('0x3e')]['id'];}return db[_0x4e31('0x2d')][_0x4e31('0x3a')]({'where':{'id':_0x3b2e20['params']['id']}})['then'](handleEntityNotFound(_0x34f11f,null))[_0x4e31('0x27')](saveUpdates(_0x3b2e20[_0x4e31('0x3e')],null))[_0x4e31('0x27')](respondWithResult(_0x34f11f,null))[_0x4e31('0x3b')](handleError(_0x34f11f,null));};exports[_0x4e31('0x3f')]=function(_0x26c684,_0xf9c44b){return db[_0x4e31('0x2d')][_0x4e31('0x3a')]({'where':{'id':_0x26c684[_0x4e31('0x40')]['id']}})[_0x4e31('0x27')](handleEntityNotFound(_0xf9c44b,null))[_0x4e31('0x27')](removeEntity(_0xf9c44b,null))['catch'](handleError(_0xf9c44b,null));};
\ No newline at end of file
+var _0x6108=['fields','length','includeAll','include','merge','find','then','catch','create','ChatProactiveAction','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','name','send','show','params','keys','rawAttributes','query','filters','intersection','attributes','model'];(function(_0x2c6c4f,_0xefaadf){var _0x586e4d=function(_0x2f6aaa){while(--_0x2f6aaa){_0x2c6c4f['push'](_0x2c6c4f['shift']());}};_0x586e4d(++_0xefaadf);}(_0x6108,0xbc));var _0x8610=function(_0x404a64,_0x511dc8){_0x404a64=_0x404a64-0x0;var _0x3d6e59=_0x6108[_0x404a64];return _0x3d6e59;};'use strict';var emlformat=require(_0x8610('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8610('0x1'));var jsonpatch=require(_0x8610('0x2'));var rp=require(_0x8610('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8610('0x4'));var util=require(_0x8610('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8610('0x6'));var ejs=require(_0x8610('0x7'));var fs=require('fs');var fs_extra=require(_0x8610('0x8'));var _=require(_0x8610('0x9'));var squel=require('squel');var crypto=require(_0x8610('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8610('0xb'));var toCsv=require(_0x8610('0x6'));var querystring=require(_0x8610('0xc'));var Papa=require('papaparse');var Redis=require(_0x8610('0xd'));var authService=require(_0x8610('0xe'));var qs=require(_0x8610('0xf'));var as=require(_0x8610('0x10'));var hardwareService=require(_0x8610('0x11'));var logger=require(_0x8610('0x12'))('api');var utils=require(_0x8610('0x13'));var config=require(_0x8610('0x14'));var licenseUtil=require(_0x8610('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc18be9,_0x4bb57e){_0x4bb57e=_0x4bb57e||0xcc;return function(_0x7b0fa3){if(_0x7b0fa3){return _0xc18be9[_0x8610('0x16')](_0x4bb57e);}return _0xc18be9[_0x8610('0x17')](_0x4bb57e)[_0x8610('0x18')]();};}function respondWithResult(_0x3f5223,_0x4eacbf){_0x4eacbf=_0x4eacbf||0xc8;return function(_0x49edbe){if(_0x49edbe){return _0x3f5223[_0x8610('0x17')](_0x4eacbf)[_0x8610('0x19')](_0x49edbe);}};}function respondWithFilteredResult(_0x214015,_0x5526b5){return function(_0x5e1994){if(_0x5e1994){var _0x57e567=typeof _0x5526b5[_0x8610('0x1a')]===_0x8610('0x1b')&&typeof _0x5526b5[_0x8610('0x1c')]===_0x8610('0x1b');var _0x517a5c=_0x5e1994['count'];var _0x31f681=_0x57e567?0x0:_0x5526b5['offset'];var _0x5e945f=_0x57e567?_0x5e1994[_0x8610('0x1d')]:_0x5526b5['offset']+_0x5526b5['limit'];var _0x11daba;if(_0x5e945f>=_0x517a5c){_0x5e945f=_0x517a5c;_0x11daba=0xc8;}else{_0x11daba=0xce;}_0x214015[_0x8610('0x17')](_0x11daba);return _0x214015['set'](_0x8610('0x1e'),_0x31f681+'-'+_0x5e945f+'/'+_0x517a5c)[_0x8610('0x19')](_0x5e1994);}return null;};}function patchUpdates(_0x17fe4a){return function(_0x39ae24){try{jsonpatch[_0x8610('0x1f')](_0x39ae24,_0x17fe4a,!![]);}catch(_0x248343){return BPromise[_0x8610('0x20')](_0x248343);}return _0x39ae24[_0x8610('0x21')]();};}function saveUpdates(_0x4184f0,_0x19e38a){return function(_0x521823){if(_0x521823){return _0x521823[_0x8610('0x22')](_0x4184f0)['then'](function(_0x285f1a){return _0x285f1a;});}return null;};}function removeEntity(_0x2b8e7f,_0x8866a){return function(_0x5103ad){if(_0x5103ad){return _0x5103ad[_0x8610('0x23')]()['then'](function(){_0x2b8e7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5997da,_0x2e9cfd){return function(_0x43bd6a){if(!_0x43bd6a){_0x5997da['sendStatus'](0x194);}return _0x43bd6a;};}function handleError(_0x3cc4d2,_0x58daba){_0x58daba=_0x58daba||0x1f4;return function(_0xd97599){logger[_0x8610('0x24')](_0xd97599['stack']);if(_0xd97599[_0x8610('0x25')]){delete _0xd97599[_0x8610('0x25')];}_0x3cc4d2[_0x8610('0x17')](_0x58daba)[_0x8610('0x26')](_0xd97599);};}exports[_0x8610('0x27')]=function(_0x3ad532,_0x4e4c16){var _0x42a104={'raw':!![],'where':{'id':_0x3ad532[_0x8610('0x28')]['id']}},_0x2ccf6d={};_0x2ccf6d['model']=_[_0x8610('0x29')](db['ChatProactiveAction'][_0x8610('0x2a')]);_0x2ccf6d['query']=_['keys'](_0x3ad532[_0x8610('0x2b')]);_0x2ccf6d[_0x8610('0x2c')]=_[_0x8610('0x2d')](_0x2ccf6d['model'],_0x2ccf6d['query']);_0x42a104[_0x8610('0x2e')]=_[_0x8610('0x2d')](_0x2ccf6d[_0x8610('0x2f')],qs[_0x8610('0x30')](_0x3ad532[_0x8610('0x2b')][_0x8610('0x30')]));_0x42a104['attributes']=_0x42a104[_0x8610('0x2e')][_0x8610('0x31')]?_0x42a104[_0x8610('0x2e')]:_0x2ccf6d[_0x8610('0x2f')];if(_0x3ad532[_0x8610('0x2b')][_0x8610('0x32')]){_0x42a104[_0x8610('0x33')]=[{'all':!![]}];}_0x42a104=_[_0x8610('0x34')]({},_0x42a104,_0x3ad532['options']);return db['ChatProactiveAction'][_0x8610('0x35')](_0x42a104)[_0x8610('0x36')](handleEntityNotFound(_0x4e4c16,null))[_0x8610('0x36')](respondWithResult(_0x4e4c16,null))[_0x8610('0x37')](handleError(_0x4e4c16,null));};exports[_0x8610('0x38')]=function(_0x12f785,_0x21e6ef){return db[_0x8610('0x39')][_0x8610('0x38')](_0x12f785[_0x8610('0x3a')],{})[_0x8610('0x36')](respondWithResult(_0x21e6ef,0xc9))['catch'](handleError(_0x21e6ef,null));};exports[_0x8610('0x22')]=function(_0x573999,_0x29fb41){if(_0x573999['body']['id']){delete _0x573999['body']['id'];}return db[_0x8610('0x39')][_0x8610('0x35')]({'where':{'id':_0x573999[_0x8610('0x28')]['id']}})[_0x8610('0x36')](handleEntityNotFound(_0x29fb41,null))[_0x8610('0x36')](saveUpdates(_0x573999['body'],null))['then'](respondWithResult(_0x29fb41,null))[_0x8610('0x37')](handleError(_0x29fb41,null));};exports[_0x8610('0x23')]=function(_0x456fd8,_0x489928){return db['ChatProactiveAction'][_0x8610('0x35')]({'where':{'id':_0x456fd8[_0x8610('0x28')]['id']}})[_0x8610('0x36')](handleEntityNotFound(_0x489928,null))[_0x8610('0x36')](removeEntity(_0x489928,null))[_0x8610('0x37')](handleError(_0x489928,null));};
\ No newline at end of file
index 32a53e7..d254906 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8659=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util'];(function(_0x19c1ca,_0x881113){var _0x5960af=function(_0x3e568f){while(--_0x3e568f){_0x19c1ca['push'](_0x19c1ca['shift']());}};_0x5960af(++_0x881113);}(_0x8659,0x82));var _0x9865=function(_0x82d06e,_0xb52ffa){_0x82d06e=_0x82d06e-0x0;var _0x36de13=_0x8659[_0x82d06e];return _0x36de13;};'use strict';var _=require(_0x9865('0x0'));var util=require(_0x9865('0x1'));var logger=require(_0x9865('0x2'))(_0x9865('0x3'));var moment=require(_0x9865('0x4'));var BPromise=require(_0x9865('0x5'));var rp=require(_0x9865('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9865('0x7'));var attributes=require(_0x9865('0x8'));module[_0x9865('0x9')]=function(_0x492f0a,_0x31f3eb){return _0x492f0a[_0x9865('0xa')](_0x9865('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2649=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0x2649,0xd8));var _0x9264=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x2649[_0x459423];return _0x42ed14;};'use strict';var _=require(_0x9264('0x0'));var util=require(_0x9264('0x1'));var logger=require('../../config/logger')(_0x9264('0x2'));var moment=require(_0x9264('0x3'));var BPromise=require(_0x9264('0x4'));var rp=require(_0x9264('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9264('0x6'));var config=require(_0x9264('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x9264('0x8')]=function(_0x49f2f1,_0x1f53a2){return _0x49f2f1[_0x9264('0x9')](_0x9264('0xa'),attributes,{'tableName':_0x9264('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c6c602d..aed2072 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdf4=['result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x48317e,_0x5e222e){var _0xe34bde=function(_0x2e40f8){while(--_0x2e40f8){_0x48317e['push'](_0x48317e['shift']());}};_0xe34bde(++_0x5e222e);}(_0xbdf4,0xdd));var _0x4bdf=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xbdf4[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0x4bdf('0x0'));var util=require(_0x4bdf('0x1'));var moment=require(_0x4bdf('0x2'));var BPromise=require(_0x4bdf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4bdf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4bdf('0x5'));var logger=require(_0x4bdf('0x6'))('rpc');var config=require(_0x4bdf('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4bdf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x474cb7,_0x5ebc78,_0x2d57b7){return new BPromise(function(_0xd1b14f,_0x121d5f){return client[_0x4bdf('0x9')](_0x474cb7,_0x2d57b7)['then'](function(_0x25e6df){logger[_0x4bdf('0xa')](_0x4bdf('0xb'),_0x5ebc78,_0x4bdf('0xc'));logger[_0x4bdf('0xd')](_0x4bdf('0xe'),_0x5ebc78,_0x4bdf('0xc'),JSON[_0x4bdf('0xf')](_0x25e6df));if(_0x25e6df[_0x4bdf('0x10')]){if(_0x25e6df['error'][_0x4bdf('0x11')]===0x1f4){logger[_0x4bdf('0x10')](_0x4bdf('0xb'),_0x5ebc78,_0x25e6df[_0x4bdf('0x10')]['message']);return _0x121d5f(_0x25e6df['error'][_0x4bdf('0x12')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x5ebc78,_0x25e6df['error'][_0x4bdf('0x12')]);return _0xd1b14f(_0x25e6df['error']['message']);}else{logger[_0x4bdf('0xa')](_0x4bdf('0xb'),_0x5ebc78,_0x4bdf('0xc'));_0xd1b14f(_0x25e6df[_0x4bdf('0x13')][_0x4bdf('0x12')]);}})['catch'](function(_0x2927ec){logger[_0x4bdf('0x10')](_0x4bdf('0xb'),_0x5ebc78,_0x2927ec);_0x121d5f(_0x2927ec);});});}
\ No newline at end of file
+var _0x8ee2=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0x8ee2,0xcd));var _0x28ee=function(_0x36c800,_0x4ac042){_0x36c800=_0x36c800-0x0;var _0x482b3b=_0x8ee2[_0x36c800];return _0x482b3b;};'use strict';var _=require(_0x28ee('0x0'));var util=require(_0x28ee('0x1'));var moment=require('moment');var BPromise=require(_0x28ee('0x2'));var rs=require(_0x28ee('0x3'));var fs=require('fs');var Redis=require(_0x28ee('0x4'));var db=require(_0x28ee('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x28ee('0x6'))(_0x28ee('0x7'));var config=require('../../config/environment');var jayson=require(_0x28ee('0x8'));var client=jayson[_0x28ee('0x9')][_0x28ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe693e2,_0x53df5a,_0xfdfff9){return new BPromise(function(_0x5f0a4a,_0x552742){return client[_0x28ee('0xb')](_0xe693e2,_0xfdfff9)['then'](function(_0x3ad54a){logger[_0x28ee('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x53df5a,_0x28ee('0xd'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x53df5a,_0x28ee('0xd'),JSON[_0x28ee('0xe')](_0x3ad54a));if(_0x3ad54a[_0x28ee('0xf')]){if(_0x3ad54a[_0x28ee('0xf')][_0x28ee('0x10')]===0x1f4){logger[_0x28ee('0xf')](_0x28ee('0x11'),_0x53df5a,_0x3ad54a[_0x28ee('0xf')][_0x28ee('0x12')]);return _0x552742(_0x3ad54a[_0x28ee('0xf')][_0x28ee('0x12')]);}logger[_0x28ee('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x53df5a,_0x3ad54a['error'][_0x28ee('0x12')]);return _0x5f0a4a(_0x3ad54a['error'][_0x28ee('0x12')]);}else{logger[_0x28ee('0xc')](_0x28ee('0x11'),_0x53df5a,_0x28ee('0xd'));_0x5f0a4a(_0x3ad54a[_0x28ee('0x13')][_0x28ee('0x12')]);}})[_0x28ee('0x14')](function(_0x596a91){logger[_0x28ee('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x53df5a,_0x596a91);_0x552742(_0x596a91);});});}
\ No newline at end of file
index f03ac7d..bc8631d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x1415d3,_0x453d0a){var _0x5df6b2=function(_0x4274da){while(--_0x4274da){_0x1415d3['push'](_0x1415d3['shift']());}};_0x5df6b2(++_0x453d0a);}(_0x032e,0x124));var _0xe032=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x032e[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
+var _0x038b=['isAuthenticated','/:id','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','show','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x038b,0x114));var _0xb038=function(_0x2e1408,_0x4e4538){_0x2e1408=_0x2e1408-0x0;var _0x544ba1=_0x038b[_0x2e1408];return _0x544ba1;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb038('0x4'));var interaction=require(_0xb038('0x5'));var config=require('../../config/environment');var controller=require(_0xb038('0x6'));router[_0xb038('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0x8')]);router[_0xb038('0x9')]('/',auth[_0xb038('0xa')](),controller['create']);router['put'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['update']);router['delete'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['destroy']);module[_0xb038('0xc')]=router;
\ No newline at end of file
index 9a8a765..882d9af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa08e=['rrmemory','beepall','roundrobin','exports','STRING','name','ENUM'];(function(_0x2a3462,_0x2c8460){var _0x38b619=function(_0x616cab){while(--_0x616cab){_0x2a3462['push'](_0x2a3462['shift']());}};_0x38b619(++_0x2c8460);}(_0xa08e,0x1ca));var _0xea08=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0xa08e[_0x3f88bc];return _0x4df1c4;};'use strict';var Sequelize=require('sequelize');module[_0xea08('0x0')]={'name':{'type':Sequelize[_0xea08('0x1')],'unique':_0xea08('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xea08('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xea08('0x3')](_0xea08('0x4'),_0xea08('0x5'),_0xea08('0x6'))}};
\ No newline at end of file
+var _0x823c=['name','INTEGER','ENUM','rrmemory','exports','STRING'];(function(_0x143cfd,_0x1a336e){var _0x2cb5f5=function(_0x1523fa){while(--_0x1523fa){_0x143cfd['push'](_0x143cfd['shift']());}};_0x2cb5f5(++_0x1a336e);}(_0x823c,0x12a));var _0xc823=function(_0x33625f,_0x23285e){_0x33625f=_0x33625f-0x0;var _0x4c5070=_0x823c[_0x33625f];return _0x4c5070;};'use strict';var Sequelize=require('sequelize');module[_0xc823('0x0')]={'name':{'type':Sequelize[_0xc823('0x1')],'unique':_0xc823('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc823('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc823('0x4')](_0xc823('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
index 25ed7f4..eceda93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35f3=['getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','then','info','request\x20sent','stringify','error','message','ChatQueue,\x20%s,\x20%s','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','ChatQueue','includeAll','include','findAll','rows','params','rawAttributes','options','create','body','user','get','role','ChatQueues','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','findOne','ChatQueueId','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','union','compact','value','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove'];(function(_0x614c88,_0x184f02){var _0x1a768e=function(_0x4f204f){while(--_0x4f204f){_0x614c88['push'](_0x614c88['shift']());}};_0x1a768e(++_0x184f02);}(_0x35f3,0x98));var _0x335f=function(_0xbd4a35,_0x3eec3b){_0xbd4a35=_0xbd4a35-0x0;var _0x1da054=_0x35f3[_0xbd4a35];return _0x1da054;};'use strict';var emlformat=require(_0x335f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x335f('0x1'));var jsonpatch=require(_0x335f('0x2'));var rp=require(_0x335f('0x3'));var moment=require('moment');var BPromise=require(_0x335f('0x4'));var Mustache=require(_0x335f('0x5'));var util=require(_0x335f('0x6'));var path=require(_0x335f('0x7'));var sox=require(_0x335f('0x8'));var csv=require(_0x335f('0x9'));var ejs=require(_0x335f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x335f('0xb'));var squel=require(_0x335f('0xc'));var crypto=require('crypto');var jsforce=require(_0x335f('0xd'));var deskjs=require(_0x335f('0xe'));var toCsv=require(_0x335f('0x9'));var querystring=require(_0x335f('0xf'));var Papa=require(_0x335f('0x10'));var Redis=require(_0x335f('0x11'));var authService=require(_0x335f('0x12'));var qs=require(_0x335f('0x13'));var as=require(_0x335f('0x14'));var hardwareService=require(_0x335f('0x15'));var logger=require(_0x335f('0x16'))('api');var utils=require(_0x335f('0x17'));var config=require(_0x335f('0x18'));var licenseUtil=require(_0x335f('0x19'));var db=require(_0x335f('0x1a'))['db'];config[_0x335f('0x1b')]=_[_0x335f('0x1c')](config[_0x335f('0x1b')],{'host':_0x335f('0x1d'),'port':0x18eb});var socket=require(_0x335f('0x1e'))(new Redis(config[_0x335f('0x1b')]));require(_0x335f('0x1f'))[_0x335f('0x20')](socket);var jayson=require(_0x335f('0x21'));var client=jayson[_0x335f('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32ef1e,_0x27b886,_0x478a97,_0x288be2){return new BPromise(function(_0x5e3d8d,_0x2070c0){var _0x206630=_0x288be2||client;return _0x206630[_0x335f('0x23')](_0x32ef1e,_0x478a97)[_0x335f('0x24')](function(_0x41c6d2){logger[_0x335f('0x25')]('ChatQueue,\x20%s,\x20%s',_0x27b886,_0x335f('0x26'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x27b886,_0x335f('0x26'),JSON[_0x335f('0x27')](_0x41c6d2));if(_0x41c6d2['error']){if(_0x41c6d2['error']['code']===0x1f4){logger[_0x335f('0x28')]('ChatQueue,\x20%s,\x20%s',_0x27b886,_0x41c6d2[_0x335f('0x28')]['message']);return _0x2070c0(_0x41c6d2[_0x335f('0x28')][_0x335f('0x29')]);}logger[_0x335f('0x28')]('ChatQueue,\x20%s,\x20%s',_0x27b886,_0x41c6d2[_0x335f('0x28')][_0x335f('0x29')]);return _0x5e3d8d(_0x41c6d2['error']['message']);}else{logger[_0x335f('0x25')](_0x335f('0x2a'),_0x27b886,_0x335f('0x26'));_0x5e3d8d(_0x41c6d2['result'][_0x335f('0x29')]);}})[_0x335f('0x2b')](function(_0x1286a8){logger[_0x335f('0x28')](_0x335f('0x2a'),_0x27b886,_0x1286a8);_0x2070c0(_0x1286a8);});});}function respondWithStatusCode(_0x55787a,_0x583917){_0x583917=_0x583917||0xcc;return function(_0x178322){if(_0x178322){return _0x55787a[_0x335f('0x2c')](_0x583917);}return _0x55787a[_0x335f('0x2d')](_0x583917)[_0x335f('0x2e')]();};}function respondWithResult(_0x53fd7d,_0x2c92ec){_0x2c92ec=_0x2c92ec||0xc8;return function(_0x5c205b){if(_0x5c205b){return _0x53fd7d[_0x335f('0x2d')](_0x2c92ec)['json'](_0x5c205b);}};}function respondWithFilteredResult(_0x1d09a5,_0x4d7832){return function(_0x5d5bcf){if(_0x5d5bcf){var _0x497658=typeof _0x4d7832[_0x335f('0x2f')]===_0x335f('0x30')&&typeof _0x4d7832[_0x335f('0x31')]===_0x335f('0x30');var _0x1c55ee=_0x5d5bcf[_0x335f('0x32')];var _0x1b528b=_0x497658?0x0:_0x4d7832[_0x335f('0x2f')];var _0x57689c=_0x497658?_0x5d5bcf[_0x335f('0x32')]:_0x4d7832[_0x335f('0x2f')]+_0x4d7832[_0x335f('0x31')];var _0x429c6;if(_0x57689c>=_0x1c55ee){_0x57689c=_0x1c55ee;_0x429c6=0xc8;}else{_0x429c6=0xce;}_0x1d09a5[_0x335f('0x2d')](_0x429c6);return _0x1d09a5['set'](_0x335f('0x33'),_0x1b528b+'-'+_0x57689c+'/'+_0x1c55ee)[_0x335f('0x34')](_0x5d5bcf);}return null;};}function patchUpdates(_0x8b6651){return function(_0x50ffb2){try{jsonpatch[_0x335f('0x35')](_0x50ffb2,_0x8b6651,!![]);}catch(_0x1235a3){return BPromise[_0x335f('0x36')](_0x1235a3);}return _0x50ffb2['save']();};}function saveUpdates(_0x238975,_0xf01acf){return function(_0x3a094d){if(_0x3a094d){return _0x3a094d[_0x335f('0x37')](_0x238975)[_0x335f('0x24')](function(_0x30bcb8){return _0x30bcb8;});}return null;};}function removeEntity(_0x535df2,_0x5b28f0){return function(_0x287271){if(_0x287271){return _0x287271['destroy']()['then'](function(){var _0x24666d=_0x287271['get']({'plain':!![]});var _0x59ed5a='ChatQueues';return db['UserProfileResource'][_0x335f('0x38')]({'where':{'type':_0x59ed5a,'resourceId':_0x24666d['id']}})['then'](function(){return _0x287271;});})['then'](function(){_0x535df2[_0x335f('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f9b6a,_0x52e448){return function(_0x4278ec){if(!_0x4278ec){_0x2f9b6a[_0x335f('0x2c')](0x194);}return _0x4278ec;};}function handleError(_0x1aa4c5,_0x3d1f22){_0x3d1f22=_0x3d1f22||0x1f4;return function(_0x101ab2){logger[_0x335f('0x28')](_0x101ab2['stack']);if(_0x101ab2[_0x335f('0x39')]){delete _0x101ab2['name'];}_0x1aa4c5['status'](_0x3d1f22)[_0x335f('0x3a')](_0x101ab2);};}exports[_0x335f('0x3b')]=function(_0x221f9e,_0x14f0b7){var _0x221dc1={},_0xbe0bd9={},_0x517662={'count':0x0,'rows':[]};var _0x189b91=_['map'](db['ChatQueue']['rawAttributes'],function(_0x4f96af){return{'name':_0x4f96af[_0x335f('0x3c')],'type':_0x4f96af[_0x335f('0x3d')][_0x335f('0x3e')]};});_0xbe0bd9[_0x335f('0x3f')]=_[_0x335f('0x40')](_0x189b91,_0x335f('0x39'));_0xbe0bd9[_0x335f('0x41')]=_[_0x335f('0x42')](_0x221f9e[_0x335f('0x41')]);_0xbe0bd9[_0x335f('0x43')]=_[_0x335f('0x44')](_0xbe0bd9['model'],_0xbe0bd9[_0x335f('0x41')]);_0x221dc1['attributes']=_[_0x335f('0x44')](_0xbe0bd9['model'],qs['fields'](_0x221f9e[_0x335f('0x41')][_0x335f('0x45')]));_0x221dc1[_0x335f('0x46')]=_0x221dc1[_0x335f('0x46')][_0x335f('0x47')]?_0x221dc1['attributes']:_0xbe0bd9[_0x335f('0x3f')];if(!_0x221f9e['query'][_0x335f('0x48')](_0x335f('0x49'))){_0x221dc1[_0x335f('0x31')]=qs[_0x335f('0x31')](_0x221f9e[_0x335f('0x41')][_0x335f('0x31')]);_0x221dc1[_0x335f('0x2f')]=qs[_0x335f('0x2f')](_0x221f9e[_0x335f('0x41')][_0x335f('0x2f')]);}_0x221dc1[_0x335f('0x4a')]=qs[_0x335f('0x4b')](_0x221f9e[_0x335f('0x41')][_0x335f('0x4b')]);_0x221dc1['where']=qs[_0x335f('0x43')](_[_0x335f('0x4c')](_0x221f9e['query'],_0xbe0bd9[_0x335f('0x43')]),_0x189b91);if(_0x221f9e['query'][_0x335f('0x4d')]){_0x221dc1['where']=_[_0x335f('0x4e')](_0x221dc1[_0x335f('0x4f')],{'$or':_[_0x335f('0x40')](_0x189b91,function(_0x1540d2){if(_0x1540d2[_0x335f('0x3d')]!=='VIRTUAL'){var _0x2c14bf={};_0x2c14bf[_0x1540d2[_0x335f('0x39')]]={'$like':'%'+_0x221f9e[_0x335f('0x41')][_0x335f('0x4d')]+'%'};return _0x2c14bf;}})});}_0x221dc1=_[_0x335f('0x4e')]({},_0x221dc1,_0x221f9e['options']);var _0x1dbe27={'where':_0x221dc1[_0x335f('0x4f')]};return db[_0x335f('0x50')][_0x335f('0x32')](_0x1dbe27)[_0x335f('0x24')](function(_0x5d66d5){_0x517662[_0x335f('0x32')]=_0x5d66d5;if(_0x221f9e[_0x335f('0x41')][_0x335f('0x51')]){_0x221dc1[_0x335f('0x52')]=[{'all':!![]}];}return db[_0x335f('0x50')][_0x335f('0x53')](_0x221dc1);})[_0x335f('0x24')](function(_0x5c5228){_0x517662[_0x335f('0x54')]=_0x5c5228;return _0x517662;})[_0x335f('0x24')](respondWithFilteredResult(_0x14f0b7,_0x221dc1))['catch'](handleError(_0x14f0b7,null));};exports['show']=function(_0x1ab2e4,_0x4c0198){var _0xd654cf={'raw':!![],'where':{'id':_0x1ab2e4[_0x335f('0x55')]['id']}},_0x54c57a={};_0x54c57a[_0x335f('0x3f')]=_[_0x335f('0x42')](db['ChatQueue'][_0x335f('0x56')]);_0x54c57a['query']=_[_0x335f('0x42')](_0x1ab2e4[_0x335f('0x41')]);_0x54c57a[_0x335f('0x43')]=_[_0x335f('0x44')](_0x54c57a[_0x335f('0x3f')],_0x54c57a['query']);_0xd654cf[_0x335f('0x46')]=_[_0x335f('0x44')](_0x54c57a[_0x335f('0x3f')],qs[_0x335f('0x45')](_0x1ab2e4['query'][_0x335f('0x45')]));_0xd654cf[_0x335f('0x46')]=_0xd654cf[_0x335f('0x46')][_0x335f('0x47')]?_0xd654cf[_0x335f('0x46')]:_0x54c57a[_0x335f('0x3f')];if(_0x1ab2e4[_0x335f('0x41')]['includeAll']){_0xd654cf[_0x335f('0x52')]=[{'all':!![]}];}_0xd654cf=_[_0x335f('0x4e')]({},_0xd654cf,_0x1ab2e4[_0x335f('0x57')]);return db[_0x335f('0x50')]['find'](_0xd654cf)['then'](handleEntityNotFound(_0x4c0198,null))[_0x335f('0x24')](respondWithResult(_0x4c0198,null))['catch'](handleError(_0x4c0198,null));};exports[_0x335f('0x58')]=function(_0x32d049,_0x1d069c){return db[_0x335f('0x50')][_0x335f('0x58')](_0x32d049[_0x335f('0x59')],{})[_0x335f('0x24')](function(_0x2512fc){var _0x57ea09=_0x32d049[_0x335f('0x5a')][_0x335f('0x5b')]({'plain':!![]});if(!_0x57ea09)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57ea09[_0x335f('0x5c')]===_0x335f('0x5a')){var _0x102501=_0x2512fc[_0x335f('0x5b')]({'plain':!![]});var _0x284f2e=_0x335f('0x5d');return db[_0x335f('0x5e')]['find']({'where':{'name':_0x284f2e,'userProfileId':_0x57ea09['userProfileId']},'raw':!![]})[_0x335f('0x24')](function(_0x2157e3){if(_0x2157e3&&_0x2157e3[_0x335f('0x5f')]===0x0){return db[_0x335f('0x60')]['create']({'name':_0x102501[_0x335f('0x39')],'resourceId':_0x102501['id'],'type':_0x2157e3['name'],'sectionId':_0x2157e3['id']},{})[_0x335f('0x24')](function(){return _0x2512fc;});}else{return _0x2512fc;}})['catch'](function(_0x40b751){logger[_0x335f('0x28')](_0x335f('0x61'),_0x40b751);throw _0x40b751;});}return _0x2512fc;})[_0x335f('0x24')](respondWithResult(_0x1d069c,0xc9))[_0x335f('0x2b')](handleError(_0x1d069c,null));};exports['update']=function(_0x5ba1f5,_0x47e97a){if(_0x5ba1f5[_0x335f('0x59')]['id']){delete _0x5ba1f5['body']['id'];}return db['ChatQueue']['find']({'where':{'id':_0x5ba1f5[_0x335f('0x55')]['id']}})['then'](handleEntityNotFound(_0x47e97a,null))['then'](saveUpdates(_0x5ba1f5[_0x335f('0x59')],null))['then'](respondWithResult(_0x47e97a,null))[_0x335f('0x2b')](handleError(_0x47e97a,null));};exports[_0x335f('0x38')]=function(_0x468a4a,_0x5a1aa0){return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x468a4a['params']['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x5a1aa0,null))[_0x335f('0x24')](removeEntity(_0x5a1aa0,null))[_0x335f('0x2b')](handleError(_0x5a1aa0,null));};exports[_0x335f('0x63')]=function(_0x53eea1,_0x4ad269){return db[_0x335f('0x50')][_0x335f('0x63')]()['then'](respondWithResult(_0x4ad269,null))['catch'](handleError(_0x4ad269,null));};exports['getMembers']=function(_0x3efe13,_0x1cee05,_0x474c77){var _0xb35305={'raw':!![],'where':{}},_0x316f11={},_0x22f663;return db[_0x335f('0x50')][_0x335f('0x64')]({'where':{'id':_0x3efe13[_0x335f('0x55')]['id']}})['then'](handleEntityNotFound(_0x1cee05,null))[_0x335f('0x24')](function(_0x3e026b){if(_0x3e026b){_0x22f663=_0x3e026b[_0x335f('0x5b')]({'plain':!![]});_0x316f11['model']=_[_0x335f('0x42')](db['UserChatQueue']['rawAttributes']);_0x316f11['query']=_[_0x335f('0x42')](_0x3efe13['query']);_0x316f11[_0x335f('0x43')]=_['intersection'](_0x316f11[_0x335f('0x3f')],_0x316f11[_0x335f('0x41')]);_0xb35305[_0x335f('0x46')]=_[_0x335f('0x44')](_0x316f11['model'],qs[_0x335f('0x45')](_0x3efe13[_0x335f('0x41')][_0x335f('0x45')]));_0xb35305[_0x335f('0x46')]=_0xb35305[_0x335f('0x46')]['length']?_0xb35305[_0x335f('0x46')]:_0x316f11[_0x335f('0x3f')];if(!_0x3efe13['query'][_0x335f('0x48')]('nolimit')){_0xb35305[_0x335f('0x31')]=qs['limit'](_0x3efe13[_0x335f('0x41')][_0x335f('0x31')]);_0xb35305['offset']=qs['offset'](_0x3efe13[_0x335f('0x41')][_0x335f('0x2f')]);}_0xb35305['order']=qs[_0x335f('0x4b')](_0x3efe13[_0x335f('0x41')][_0x335f('0x4b')]);_0xb35305[_0x335f('0x4f')]=qs[_0x335f('0x43')](_['pick'](_0x3efe13[_0x335f('0x41')],_0x316f11['filters']));_0xb35305[_0x335f('0x4f')][_0x335f('0x65')]=_0x3e026b['id'];if(_0x3efe13['query']['filter']){_0xb35305[_0x335f('0x4f')]=_[_0x335f('0x4e')](_0xb35305['where'],{'$or':_[_0x335f('0x40')](_0xb35305['attributes'],function(_0x3795a1){var _0x32705c={};_0x32705c[_0x3795a1]={'$like':'%'+_0x3efe13[_0x335f('0x41')][_0x335f('0x4d')]+'%'};return _0x32705c;})});}_0xb35305=_[_0x335f('0x4e')]({},_0xb35305,_0x3efe13[_0x335f('0x57')]);return db['UserChatQueue'][_0x335f('0x53')](_0xb35305);}})[_0x335f('0x24')](function(_0x3ba5ff){if(_0x3ba5ff){return db['User'][_0x335f('0x66')]({'where':{'id':_[_0x335f('0x40')](_0x3ba5ff,'UserId'),'role':_0x335f('0x67')},'attributes':['id',_0x335f('0x39'),_0x335f('0x68'),_0x335f('0x69'),_0x335f('0x6a')]});}})[_0x335f('0x24')](function(_0x192d2d){if(_0x192d2d){return{'count':_0x192d2d['count'],'rows':_['map'](_0x192d2d[_0x335f('0x54')],function(_0x1872cd){return{'membername':_0x1872cd[_0x335f('0x39')],'UserId':_0x1872cd['id'],'queue_name':_0x22f663[_0x335f('0x39')],'ChatQueueId':_0x22f663['id'],'interface':util[_0x335f('0x6b')](_0x335f('0x6c'),'SIP',_0x1872cd['name']),'penalty':0x0,'paused':_0x1872cd[_0x335f('0x68')],'createdAt':_0x1872cd[_0x335f('0x6a')],'updatedAt':_0x1872cd[_0x335f('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x335f('0x24')](respondWithFilteredResult(_0x1cee05,_0xb35305))['catch'](handleError(_0x1cee05,null));};exports[_0x335f('0x6d')]=function(_0x2c52aa,_0x9c75a,_0x420ee9){var _0x1afb99={};var _0x108e7d={};var _0x3975a1;var _0x2809b0;return db[_0x335f('0x50')][_0x335f('0x64')]({'where':{'id':_0x2c52aa[_0x335f('0x55')]['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x9c75a,null))[_0x335f('0x24')](function(_0x430559){if(_0x430559){_0x3975a1=_0x430559;_0x108e7d[_0x335f('0x3f')]=_[_0x335f('0x42')](db[_0x335f('0x6e')][_0x335f('0x56')]);_0x108e7d[_0x335f('0x41')]=_[_0x335f('0x42')](_0x2c52aa[_0x335f('0x41')]);_0x108e7d[_0x335f('0x43')]=_['intersection'](_0x108e7d['model'],_0x108e7d[_0x335f('0x41')]);_0x1afb99[_0x335f('0x46')]=_[_0x335f('0x44')](_0x108e7d[_0x335f('0x3f')],qs[_0x335f('0x45')](_0x2c52aa[_0x335f('0x41')][_0x335f('0x45')]));_0x1afb99[_0x335f('0x46')]=_0x1afb99[_0x335f('0x46')]['length']?_0x1afb99['attributes']:_0x108e7d[_0x335f('0x3f')];_0x1afb99[_0x335f('0x4a')]=qs[_0x335f('0x4b')](_0x2c52aa['query'][_0x335f('0x4b')]);_0x1afb99['where']=qs[_0x335f('0x43')](_[_0x335f('0x4c')](_0x2c52aa[_0x335f('0x41')],_0x108e7d[_0x335f('0x43')]));if(_0x2c52aa[_0x335f('0x41')][_0x335f('0x4d')]){_0x1afb99[_0x335f('0x4f')]=_['merge'](_0x1afb99[_0x335f('0x4f')],{'$or':_[_0x335f('0x40')](_0x1afb99[_0x335f('0x46')],function(_0x22b328){var _0x204dcf={};_0x204dcf[_0x22b328]={'$like':'%'+_0x2c52aa[_0x335f('0x41')][_0x335f('0x4d')]+'%'};return _0x204dcf;})});}_0x1afb99=_[_0x335f('0x4e')]({},_0x1afb99,_0x2c52aa[_0x335f('0x57')]);return _0x3975a1[_0x335f('0x6d')](_0x1afb99);}})['then'](function(_0x5bf0dc){if(_0x5bf0dc){_0x2809b0=_0x5bf0dc[_0x335f('0x47')];if(!_0x2c52aa['query'][_0x335f('0x48')](_0x335f('0x49'))){_0x1afb99[_0x335f('0x31')]=qs['limit'](_0x2c52aa[_0x335f('0x41')]['limit']);_0x1afb99[_0x335f('0x2f')]=qs[_0x335f('0x2f')](_0x2c52aa['query'][_0x335f('0x2f')]);}return _0x3975a1['getTeams'](_0x1afb99);}})[_0x335f('0x24')](function(_0x3fb11d){if(_0x3fb11d){return _0x3fb11d?{'count':_0x2809b0,'rows':_0x3fb11d}:null;}})[_0x335f('0x24')](respondWithResult(_0x9c75a,null))['catch'](handleError(_0x9c75a,null));};exports[_0x335f('0x6f')]=function(_0x48393f,_0x21efc2,_0x6853fb){var _0xe5cd1d=_0x48393f[_0x335f('0x59')][_0x335f('0x70')];return db[_0x335f('0x6e')][_0x335f('0x53')]({'where':{'id':_0xe5cd1d},'attributes':['id'],'include':[{'model':db[_0x335f('0x71')],'as':_0x335f('0x72'),'attributes':['id','name',_0x335f('0x73'),_0x335f('0x74'),_0x335f('0x75')],'raw':!![]}]})[_0x335f('0x24')](function(_0x59b6cf){if(_0x59b6cf){var _0x4dd723=_[_0x335f('0x76')](_0x59b6cf,function(_0x126ab6){var _0x18521c=_0x126ab6[_0x335f('0x5b')]({'plain':!![]});return _0x18521c['Agents'];});return db[_0x335f('0x50')]['find']({'where':{'id':_0x48393f[_0x335f('0x55')]['id']}})[_0x335f('0x24')](function(_0x2a87b3){return db['sequelize']['transaction'](function(_0x1bb1db){return _0x2a87b3[_0x335f('0x6f')](_0xe5cd1d,{'transaction':_0x1bb1db})['then'](function(){return BPromise[_0x335f('0x77')](_0x4dd723,function(_0x167d0b){return db['UserChatQueue'][_0x335f('0x78')]({'where':{'UserId':_0x167d0b['id'],'ChatQueueId':_0x48393f[_0x335f('0x55')]['id']},'transaction':_0x1bb1db});});})[_0x335f('0x24')](function(){_0x4dd723[_0x335f('0x79')](function(_0x3b18af){socket[_0x335f('0x7a')](_0x335f('0x7b'),{'UserId':_0x3b18af['id'],'ChatQueueId':_0x2a87b3['id']});});});});});}})[_0x335f('0x24')](respondWithStatusCode(_0x21efc2,null))[_0x335f('0x2b')](handleError(_0x21efc2,null));};exports[_0x335f('0x7c')]=function(_0x515d77,_0x2918ec,_0x5424fb){return db[_0x335f('0x6e')][_0x335f('0x53')]({'where':{'id':_0x515d77[_0x335f('0x41')][_0x335f('0x70')]},'attributes':['id'],'include':[{'model':db[_0x335f('0x71')],'as':_0x335f('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2918ec,null))['then'](function(_0x3f7e2b){var _0x3013ae=_[_0x335f('0x40')](_0x3f7e2b,'id');var _0x2232e9=[];var _0x428abe=[];var _0x5ded24=squel[_0x335f('0x7d')]();_0x5ded24[_0x335f('0x7e')](_0x335f('0x7f'))[_0x335f('0x80')](_0x335f('0x81'),'tq')[_0x335f('0x82')](_0x335f('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x335f('0x84'),_0x515d77[_0x335f('0x55')]['id']);for(var _0x4c4629=0x0;_0x4c4629<_0x3f7e2b[_0x335f('0x47')];_0x4c4629+=0x1){let _0x1c6e0a=_0x3f7e2b[_0x4c4629];for(var _0x378506=0x0;_0x378506<_0x1c6e0a[_0x335f('0x72')][_0x335f('0x47')];_0x378506+=0x1){let _0x1a7fcf=_0x1c6e0a['Agents'][_0x378506];var _0x267cc9=_0x5ded24[_0x335f('0x85')]();_0x267cc9[_0x335f('0x4f')](_0x335f('0x86'),_0x1a7fcf['id']);_0x428abe[_0x335f('0x87')](db['sequelize'][_0x335f('0x41')](_0x267cc9['toString'](),{'type':db[_0x335f('0x88')]['QueryTypes'][_0x335f('0x89')]})['then'](function(_0x5ed752){if(_0x5ed752[_0x335f('0x47')]===0x1){return _0x1a7fcf['id'];}else{var _0x266fea=_[_0x335f('0x8a')](_[_0x335f('0x40')](_0x5ed752,'TeamId'),function(_0x49aec9){return _['includes'](_0x3013ae,_0x49aec9);});if(_0x266fea){return _0x1a7fcf['id'];}}}));}}return BPromise['all'](_0x428abe)[_0x335f('0x24')](function(_0x3f4c53){_0x2232e9=_(_0x2232e9)[_0x335f('0x8b')](_0x3f4c53)[_0x335f('0x8c')]()[_0x335f('0x8d')]();return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x515d77[_0x335f('0x55')]['id']}})['then'](function(_0x507de7){return db[_0x335f('0x88')][_0x335f('0x8e')](function(_0x40e02a){return _0x507de7[_0x335f('0x7c')](_0x515d77['query']['ids'],{'transaction':_0x40e02a})['then'](function(){if(!_[_0x335f('0x8f')](_0x2232e9)){return _0x507de7[_0x335f('0x90')](_0x2232e9,{'transaction':_0x40e02a});}})['then'](function(){_0x2232e9[_0x335f('0x79')](function(_0x1b0e22){socket['emit']('userChatQueue:remove',{'UserId':_0x1b0e22,'ChatQueueId':_0x507de7['id']});});});});});});})[_0x335f('0x24')](respondWithStatusCode(_0x2918ec,null))[_0x335f('0x2b')](handleError(_0x2918ec,null));};exports[_0x335f('0x91')]=function(_0x2c11dd,_0x488cc9,_0x11b57b){return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x2c11dd['params']['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x488cc9,null))[_0x335f('0x24')](function(_0x204cf8){if(_0x204cf8){return _0x204cf8[_0x335f('0x91')](_0x2c11dd['body'][_0x335f('0x70')],_[_0x335f('0x92')](_0x2c11dd[_0x335f('0x59')],[_0x335f('0x70'),'id'])||{})[_0x335f('0x93')](function(_0x4a5d8a){for(var _0x289dab=0x0;_0x289dab<_0x2c11dd['body'][_0x335f('0x70')][_0x335f('0x47')];_0x289dab+=0x1){socket['emit'](_0x335f('0x7b'),{'UserId':Number(_0x2c11dd['body'][_0x335f('0x70')][_0x289dab]),'ChatQueueId':Number(_0x2c11dd[_0x335f('0x55')]['id'])});}return _0x4a5d8a;});}})[_0x335f('0x24')](respondWithResult(_0x488cc9,null))['catch'](handleError(_0x488cc9,null));};exports[_0x335f('0x90')]=function(_0x111df1,_0x35dd30,_0x316948){return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x111df1[_0x335f('0x55')]['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x35dd30,null))[_0x335f('0x24')](function(_0x26b9ee){if(_0x26b9ee){return _0x26b9ee[_0x335f('0x90')](_0x111df1[_0x335f('0x41')][_0x335f('0x70')])[_0x335f('0x24')](function(){if(_[_0x335f('0x94')](_0x111df1['query'][_0x335f('0x70')])){for(var _0x27e4f0=0x0;_0x27e4f0<_0x111df1[_0x335f('0x41')][_0x335f('0x70')]['length'];_0x27e4f0+=0x1){socket[_0x335f('0x7a')](_0x335f('0x95'),{'UserId':Number(_0x111df1[_0x335f('0x41')][_0x335f('0x70')][_0x27e4f0]),'ChatQueueId':Number(_0x111df1[_0x335f('0x55')]['id'])});}}else{socket[_0x335f('0x7a')](_0x335f('0x95'),{'UserId':Number(_0x111df1[_0x335f('0x41')]['ids']),'ChatQueueId':Number(_0x111df1[_0x335f('0x55')]['id'])});}});}})[_0x335f('0x24')](respondWithStatusCode(_0x35dd30,null))[_0x335f('0x2b')](handleError(_0x35dd30,null));};exports[_0x335f('0x96')]=function(_0xd90543,_0x23f596,_0x3ca7e9){var _0x58af07={};var _0x2cf3ae={};var _0x211ac8;var _0x6970c0;return db[_0x335f('0x50')]['findOne']({'where':{'id':_0xd90543[_0x335f('0x55')]['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x23f596,null))['then'](function(_0x19aba3){if(_0x19aba3){_0x211ac8=_0x19aba3;_0x2cf3ae[_0x335f('0x3f')]=_[_0x335f('0x42')](db[_0x335f('0x71')][_0x335f('0x56')]);_0x2cf3ae[_0x335f('0x41')]=_[_0x335f('0x42')](_0xd90543[_0x335f('0x41')]);_0x2cf3ae[_0x335f('0x43')]=_[_0x335f('0x44')](_0x2cf3ae['model'],_0x2cf3ae[_0x335f('0x41')]);_0x58af07[_0x335f('0x46')]=_[_0x335f('0x44')](_0x2cf3ae[_0x335f('0x3f')],qs[_0x335f('0x45')](_0xd90543['query']['fields']));_0x58af07[_0x335f('0x46')]=_0x58af07[_0x335f('0x46')]['length']?_0x58af07[_0x335f('0x46')]:_0x2cf3ae[_0x335f('0x3f')];_0x58af07[_0x335f('0x4a')]=qs[_0x335f('0x4b')](_0xd90543['query'][_0x335f('0x4b')]);_0x58af07['where']=qs[_0x335f('0x43')](_[_0x335f('0x4c')](_0xd90543[_0x335f('0x41')],_0x2cf3ae['filters']));if(_0xd90543[_0x335f('0x41')][_0x335f('0x4d')]){_0x58af07['where']=_[_0x335f('0x4e')](_0x58af07['where'],{'$or':_[_0x335f('0x40')](_0x58af07[_0x335f('0x46')],function(_0x38755b){var _0x4c4bb8={};_0x4c4bb8[_0x38755b]={'$like':'%'+_0xd90543['query'][_0x335f('0x4d')]+'%'};return _0x4c4bb8;})});}_0x58af07=_[_0x335f('0x4e')]({},_0x58af07,_0xd90543[_0x335f('0x57')]);return _0x211ac8[_0x335f('0x96')](_0x58af07);}})['then'](function(_0x62806b){if(_0x62806b){_0x6970c0=_0x62806b[_0x335f('0x47')];if(!_0xd90543[_0x335f('0x41')][_0x335f('0x48')]('nolimit')){_0x58af07[_0x335f('0x31')]=qs[_0x335f('0x31')](_0xd90543[_0x335f('0x41')][_0x335f('0x31')]);_0x58af07['offset']=qs[_0x335f('0x2f')](_0xd90543[_0x335f('0x41')][_0x335f('0x2f')]);}return _0x211ac8[_0x335f('0x96')](_0x58af07);}})[_0x335f('0x24')](function(_0x4031ba){if(_0x4031ba){return _0x4031ba?{'count':_0x6970c0,'rows':_0x4031ba}:null;}})[_0x335f('0x24')](respondWithResult(_0x23f596,null))['catch'](handleError(_0x23f596,null));};
\ No newline at end of file
+var _0x23f8=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','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','UserChatQueue','hasOwnProperty','pick','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','emit','userChatQueue:save','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x4c4ef4,_0x2e02ac){var _0x5af4e0=function(_0x58bcb6){while(--_0x58bcb6){_0x4c4ef4['push'](_0x4c4ef4['shift']());}};_0x5af4e0(++_0x2e02ac);}(_0x23f8,0x8e));var _0x823f=function(_0x13d3a2,_0x174e4c){_0x13d3a2=_0x13d3a2-0x0;var _0x4a21b4=_0x23f8[_0x13d3a2];return _0x4a21b4;};'use strict';var emlformat=require(_0x823f('0x0'));var rimraf=require(_0x823f('0x1'));var zipdir=require(_0x823f('0x2'));var jsonpatch=require(_0x823f('0x3'));var rp=require(_0x823f('0x4'));var moment=require('moment');var BPromise=require(_0x823f('0x5'));var Mustache=require('mustache');var util=require(_0x823f('0x6'));var path=require(_0x823f('0x7'));var sox=require(_0x823f('0x8'));var csv=require(_0x823f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x823f('0xa'));var _=require(_0x823f('0xb'));var squel=require(_0x823f('0xc'));var crypto=require(_0x823f('0xd'));var jsforce=require(_0x823f('0xe'));var deskjs=require(_0x823f('0xf'));var toCsv=require(_0x823f('0x9'));var querystring=require(_0x823f('0x10'));var Papa=require(_0x823f('0x11'));var Redis=require(_0x823f('0x12'));var authService=require(_0x823f('0x13'));var qs=require(_0x823f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x823f('0x15'));var logger=require(_0x823f('0x16'))(_0x823f('0x17'));var utils=require(_0x823f('0x18'));var config=require(_0x823f('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x823f('0x1a')]=_[_0x823f('0x1b')](config[_0x823f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x823f('0x1c'))(new Redis(config['redis']));require(_0x823f('0x1d'))[_0x823f('0x1e')](socket);var jayson=require(_0x823f('0x1f'));var client=jayson['client'][_0x823f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x526cee,_0x5cb2a2,_0x5a4a76,_0x85e76e){return new BPromise(function(_0x5df7dc,_0x564265){var _0xa9f7ef=_0x85e76e||client;return _0xa9f7ef['request'](_0x526cee,_0x5a4a76)[_0x823f('0x21')](function(_0x42a5c0){logger['info'](_0x823f('0x22'),_0x5cb2a2,_0x823f('0x23'));logger['debug'](_0x823f('0x24'),_0x5cb2a2,'request\x20sent',JSON['stringify'](_0x42a5c0));if(_0x42a5c0[_0x823f('0x25')]){if(_0x42a5c0[_0x823f('0x25')][_0x823f('0x26')]===0x1f4){logger['error'](_0x823f('0x22'),_0x5cb2a2,_0x42a5c0[_0x823f('0x25')][_0x823f('0x27')]);return _0x564265(_0x42a5c0[_0x823f('0x25')][_0x823f('0x27')]);}logger[_0x823f('0x25')](_0x823f('0x22'),_0x5cb2a2,_0x42a5c0[_0x823f('0x25')][_0x823f('0x27')]);return _0x5df7dc(_0x42a5c0[_0x823f('0x25')]['message']);}else{logger[_0x823f('0x28')](_0x823f('0x22'),_0x5cb2a2,_0x823f('0x23'));_0x5df7dc(_0x42a5c0[_0x823f('0x29')]['message']);}})[_0x823f('0x2a')](function(_0x555742){logger[_0x823f('0x25')](_0x823f('0x22'),_0x5cb2a2,_0x555742);_0x564265(_0x555742);});});}function respondWithStatusCode(_0x5dd401,_0x51e335){_0x51e335=_0x51e335||0xcc;return function(_0x59e412){if(_0x59e412){return _0x5dd401['sendStatus'](_0x51e335);}return _0x5dd401[_0x823f('0x2b')](_0x51e335)['end']();};}function respondWithResult(_0x500976,_0x58080b){_0x58080b=_0x58080b||0xc8;return function(_0x5ecae5){if(_0x5ecae5){return _0x500976[_0x823f('0x2b')](_0x58080b)['json'](_0x5ecae5);}};}function respondWithFilteredResult(_0x3c4c1f,_0x46e465){return function(_0x3ef1ee){if(_0x3ef1ee){var _0x37ab64=typeof _0x46e465[_0x823f('0x2c')]===_0x823f('0x2d')&&typeof _0x46e465[_0x823f('0x2e')]===_0x823f('0x2d');var _0x5246c3=_0x3ef1ee[_0x823f('0x2f')];var _0x2a3605=_0x37ab64?0x0:_0x46e465[_0x823f('0x2c')];var _0x442c22=_0x37ab64?_0x3ef1ee[_0x823f('0x2f')]:_0x46e465[_0x823f('0x2c')]+_0x46e465[_0x823f('0x2e')];var _0x1dd7db;if(_0x442c22>=_0x5246c3){_0x442c22=_0x5246c3;_0x1dd7db=0xc8;}else{_0x1dd7db=0xce;}_0x3c4c1f[_0x823f('0x2b')](_0x1dd7db);return _0x3c4c1f['set'](_0x823f('0x30'),_0x2a3605+'-'+_0x442c22+'/'+_0x5246c3)[_0x823f('0x31')](_0x3ef1ee);}return null;};}function patchUpdates(_0x470140){return function(_0x2e5d2c){try{jsonpatch['apply'](_0x2e5d2c,_0x470140,!![]);}catch(_0x57fc73){return BPromise[_0x823f('0x32')](_0x57fc73);}return _0x2e5d2c[_0x823f('0x33')]();};}function saveUpdates(_0x16fbe3,_0x2325ae){return function(_0x55ac16){if(_0x55ac16){return _0x55ac16[_0x823f('0x34')](_0x16fbe3)[_0x823f('0x21')](function(_0x43aec5){return _0x43aec5;});}return null;};}function removeEntity(_0x44d9f0,_0x3c1613){return function(_0x2cc033){if(_0x2cc033){return _0x2cc033[_0x823f('0x35')]()[_0x823f('0x21')](function(){var _0x8fa585=_0x2cc033[_0x823f('0x36')]({'plain':!![]});var _0xd7ef4d=_0x823f('0x37');return db[_0x823f('0x38')]['destroy']({'where':{'type':_0xd7ef4d,'resourceId':_0x8fa585['id']}})[_0x823f('0x21')](function(){return _0x2cc033;});})['then'](function(){_0x44d9f0[_0x823f('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x160075,_0x455d8b){return function(_0x3c6890){if(!_0x3c6890){_0x160075['sendStatus'](0x194);}return _0x3c6890;};}function handleError(_0x46c247,_0x574def){_0x574def=_0x574def||0x1f4;return function(_0x304e21){logger['error'](_0x304e21[_0x823f('0x39')]);if(_0x304e21[_0x823f('0x3a')]){delete _0x304e21[_0x823f('0x3a')];}_0x46c247['status'](_0x574def)[_0x823f('0x3b')](_0x304e21);};}exports['index']=function(_0x2bdfd3,_0x218b6b){var _0x396113={},_0x56bb1b={},_0x4852d0={'count':0x0,'rows':[]};var _0x5b4312=_[_0x823f('0x3c')](db[_0x823f('0x3d')][_0x823f('0x3e')],function(_0x41307e){return{'name':_0x41307e[_0x823f('0x3f')],'type':_0x41307e[_0x823f('0x40')]['key']};});_0x56bb1b['model']=_[_0x823f('0x3c')](_0x5b4312,_0x823f('0x3a'));_0x56bb1b[_0x823f('0x41')]=_['keys'](_0x2bdfd3[_0x823f('0x41')]);_0x56bb1b[_0x823f('0x42')]=_[_0x823f('0x43')](_0x56bb1b['model'],_0x56bb1b[_0x823f('0x41')]);_0x396113['attributes']=_['intersection'](_0x56bb1b[_0x823f('0x44')],qs[_0x823f('0x45')](_0x2bdfd3[_0x823f('0x41')][_0x823f('0x45')]));_0x396113[_0x823f('0x46')]=_0x396113['attributes'][_0x823f('0x47')]?_0x396113[_0x823f('0x46')]:_0x56bb1b[_0x823f('0x44')];if(!_0x2bdfd3[_0x823f('0x41')]['hasOwnProperty'](_0x823f('0x48'))){_0x396113[_0x823f('0x2e')]=qs[_0x823f('0x2e')](_0x2bdfd3[_0x823f('0x41')][_0x823f('0x2e')]);_0x396113[_0x823f('0x2c')]=qs['offset'](_0x2bdfd3[_0x823f('0x41')]['offset']);}_0x396113[_0x823f('0x49')]=qs[_0x823f('0x4a')](_0x2bdfd3[_0x823f('0x41')][_0x823f('0x4a')]);_0x396113[_0x823f('0x4b')]=qs[_0x823f('0x42')](_['pick'](_0x2bdfd3['query'],_0x56bb1b[_0x823f('0x42')]),_0x5b4312);if(_0x2bdfd3[_0x823f('0x41')][_0x823f('0x4c')]){_0x396113[_0x823f('0x4b')]=_[_0x823f('0x4d')](_0x396113['where'],{'$or':_['map'](_0x5b4312,function(_0x5ca4a6){if(_0x5ca4a6[_0x823f('0x40')]!==_0x823f('0x4e')){var _0x28530a={};_0x28530a[_0x5ca4a6[_0x823f('0x3a')]]={'$like':'%'+_0x2bdfd3[_0x823f('0x41')]['filter']+'%'};return _0x28530a;}})});}_0x396113=_[_0x823f('0x4d')]({},_0x396113,_0x2bdfd3['options']);var _0x108213={'where':_0x396113[_0x823f('0x4b')]};return db[_0x823f('0x3d')][_0x823f('0x2f')](_0x108213)[_0x823f('0x21')](function(_0x1f735c){_0x4852d0[_0x823f('0x2f')]=_0x1f735c;if(_0x2bdfd3[_0x823f('0x41')][_0x823f('0x4f')]){_0x396113[_0x823f('0x50')]=[{'all':!![]}];}return db[_0x823f('0x3d')][_0x823f('0x51')](_0x396113);})[_0x823f('0x21')](function(_0x2336dc){_0x4852d0[_0x823f('0x52')]=_0x2336dc;return _0x4852d0;})[_0x823f('0x21')](respondWithFilteredResult(_0x218b6b,_0x396113))[_0x823f('0x2a')](handleError(_0x218b6b,null));};exports[_0x823f('0x53')]=function(_0xb541ec,_0x11ff7c){var _0x2195a8={'raw':!![],'where':{'id':_0xb541ec[_0x823f('0x54')]['id']}},_0x50fa02={};_0x50fa02[_0x823f('0x44')]=_[_0x823f('0x55')](db[_0x823f('0x3d')][_0x823f('0x3e')]);_0x50fa02[_0x823f('0x41')]=_[_0x823f('0x55')](_0xb541ec[_0x823f('0x41')]);_0x50fa02['filters']=_[_0x823f('0x43')](_0x50fa02[_0x823f('0x44')],_0x50fa02[_0x823f('0x41')]);_0x2195a8[_0x823f('0x46')]=_[_0x823f('0x43')](_0x50fa02['model'],qs[_0x823f('0x45')](_0xb541ec[_0x823f('0x41')]['fields']));_0x2195a8[_0x823f('0x46')]=_0x2195a8[_0x823f('0x46')][_0x823f('0x47')]?_0x2195a8[_0x823f('0x46')]:_0x50fa02['model'];if(_0xb541ec[_0x823f('0x41')][_0x823f('0x4f')]){_0x2195a8[_0x823f('0x50')]=[{'all':!![]}];}_0x2195a8=_[_0x823f('0x4d')]({},_0x2195a8,_0xb541ec[_0x823f('0x56')]);return db[_0x823f('0x3d')][_0x823f('0x57')](_0x2195a8)[_0x823f('0x21')](handleEntityNotFound(_0x11ff7c,null))[_0x823f('0x21')](respondWithResult(_0x11ff7c,null))[_0x823f('0x2a')](handleError(_0x11ff7c,null));};exports[_0x823f('0x58')]=function(_0x2363fd,_0x4566d5){return db[_0x823f('0x3d')][_0x823f('0x58')](_0x2363fd[_0x823f('0x59')],{})[_0x823f('0x21')](function(_0x275e33){var _0xe7268e=_0x2363fd[_0x823f('0x5a')][_0x823f('0x36')]({'plain':!![]});if(!_0xe7268e)throw new Error(_0x823f('0x5b'));if(_0xe7268e[_0x823f('0x5c')]===_0x823f('0x5a')){var _0x2258f3=_0x275e33[_0x823f('0x36')]({'plain':!![]});var _0x2cd156=_0x823f('0x37');return db[_0x823f('0x5d')][_0x823f('0x57')]({'where':{'name':_0x2cd156,'userProfileId':_0xe7268e[_0x823f('0x5e')]},'raw':!![]})[_0x823f('0x21')](function(_0x3ccb16){if(_0x3ccb16&&_0x3ccb16[_0x823f('0x5f')]===0x0){return db[_0x823f('0x38')]['create']({'name':_0x2258f3[_0x823f('0x3a')],'resourceId':_0x2258f3['id'],'type':_0x3ccb16[_0x823f('0x3a')],'sectionId':_0x3ccb16['id']},{})['then'](function(){return _0x275e33;});}else{return _0x275e33;}})[_0x823f('0x2a')](function(_0xb1666b){logger['error'](_0x823f('0x60'),_0xb1666b);throw _0xb1666b;});}return _0x275e33;})[_0x823f('0x21')](respondWithResult(_0x4566d5,0xc9))[_0x823f('0x2a')](handleError(_0x4566d5,null));};exports['update']=function(_0x3f14f9,_0x350360){if(_0x3f14f9['body']['id']){delete _0x3f14f9[_0x823f('0x59')]['id'];}return db[_0x823f('0x3d')][_0x823f('0x57')]({'where':{'id':_0x3f14f9[_0x823f('0x54')]['id']}})[_0x823f('0x21')](handleEntityNotFound(_0x350360,null))[_0x823f('0x21')](saveUpdates(_0x3f14f9[_0x823f('0x59')],null))[_0x823f('0x21')](respondWithResult(_0x350360,null))['catch'](handleError(_0x350360,null));};exports[_0x823f('0x35')]=function(_0x5f31c9,_0x562b54){return db[_0x823f('0x3d')][_0x823f('0x57')]({'where':{'id':_0x5f31c9[_0x823f('0x54')]['id']}})[_0x823f('0x21')](handleEntityNotFound(_0x562b54,null))['then'](removeEntity(_0x562b54,null))[_0x823f('0x2a')](handleError(_0x562b54,null));};exports[_0x823f('0x61')]=function(_0x1856d0,_0x4b78c2){return db['ChatQueue'][_0x823f('0x61')]()[_0x823f('0x21')](respondWithResult(_0x4b78c2,null))[_0x823f('0x2a')](handleError(_0x4b78c2,null));};exports[_0x823f('0x62')]=function(_0x31d286,_0x10650d,_0x96064e){var _0x10d28f={'raw':!![],'where':{}},_0x2fccc4={},_0x499361;return db[_0x823f('0x3d')][_0x823f('0x63')]({'where':{'id':_0x31d286[_0x823f('0x54')]['id']}})[_0x823f('0x21')](handleEntityNotFound(_0x10650d,null))['then'](function(_0xaf0462){if(_0xaf0462){_0x499361=_0xaf0462[_0x823f('0x36')]({'plain':!![]});_0x2fccc4[_0x823f('0x44')]=_[_0x823f('0x55')](db[_0x823f('0x64')][_0x823f('0x3e')]);_0x2fccc4[_0x823f('0x41')]=_[_0x823f('0x55')](_0x31d286[_0x823f('0x41')]);_0x2fccc4[_0x823f('0x42')]=_[_0x823f('0x43')](_0x2fccc4[_0x823f('0x44')],_0x2fccc4[_0x823f('0x41')]);_0x10d28f[_0x823f('0x46')]=_[_0x823f('0x43')](_0x2fccc4[_0x823f('0x44')],qs['fields'](_0x31d286[_0x823f('0x41')]['fields']));_0x10d28f[_0x823f('0x46')]=_0x10d28f[_0x823f('0x46')][_0x823f('0x47')]?_0x10d28f['attributes']:_0x2fccc4['model'];if(!_0x31d286['query'][_0x823f('0x65')](_0x823f('0x48'))){_0x10d28f[_0x823f('0x2e')]=qs[_0x823f('0x2e')](_0x31d286[_0x823f('0x41')][_0x823f('0x2e')]);_0x10d28f[_0x823f('0x2c')]=qs[_0x823f('0x2c')](_0x31d286[_0x823f('0x41')]['offset']);}_0x10d28f[_0x823f('0x49')]=qs[_0x823f('0x4a')](_0x31d286[_0x823f('0x41')]['sort']);_0x10d28f['where']=qs[_0x823f('0x42')](_[_0x823f('0x66')](_0x31d286[_0x823f('0x41')],_0x2fccc4['filters']));_0x10d28f[_0x823f('0x4b')][_0x823f('0x67')]=_0xaf0462['id'];if(_0x31d286['query'][_0x823f('0x4c')]){_0x10d28f[_0x823f('0x4b')]=_[_0x823f('0x4d')](_0x10d28f[_0x823f('0x4b')],{'$or':_[_0x823f('0x3c')](_0x10d28f['attributes'],function(_0x130301){var _0x517508={};_0x517508[_0x130301]={'$like':'%'+_0x31d286[_0x823f('0x41')][_0x823f('0x4c')]+'%'};return _0x517508;})});}_0x10d28f=_[_0x823f('0x4d')]({},_0x10d28f,_0x31d286['options']);return db['UserChatQueue'][_0x823f('0x51')](_0x10d28f);}})[_0x823f('0x21')](function(_0x371692){if(_0x371692){return db[_0x823f('0x68')][_0x823f('0x69')]({'where':{'id':_['map'](_0x371692,_0x823f('0x6a')),'role':_0x823f('0x6b')},'attributes':['id',_0x823f('0x3a'),_0x823f('0x6c'),_0x823f('0x6d'),_0x823f('0x6e')]});}})['then'](function(_0xeeab1d){if(_0xeeab1d){return{'count':_0xeeab1d[_0x823f('0x2f')],'rows':_[_0x823f('0x3c')](_0xeeab1d[_0x823f('0x52')],function(_0x246277){return{'membername':_0x246277[_0x823f('0x3a')],'UserId':_0x246277['id'],'queue_name':_0x499361[_0x823f('0x3a')],'ChatQueueId':_0x499361['id'],'interface':util['format'](_0x823f('0x6f'),'SIP',_0x246277['name']),'penalty':0x0,'paused':_0x246277[_0x823f('0x6c')],'createdAt':_0x246277[_0x823f('0x6e')],'updatedAt':_0x246277[_0x823f('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x823f('0x21')](respondWithFilteredResult(_0x10650d,_0x10d28f))[_0x823f('0x2a')](handleError(_0x10650d,null));};exports[_0x823f('0x70')]=function(_0x2e9e63,_0x4fde98,_0xbb0f00){var _0x42ae98={};var _0xeeabb0={};var _0x1566e9;var _0x539ee2;return db[_0x823f('0x3d')][_0x823f('0x63')]({'where':{'id':_0x2e9e63[_0x823f('0x54')]['id']}})[_0x823f('0x21')](handleEntityNotFound(_0x4fde98,null))[_0x823f('0x21')](function(_0x250175){if(_0x250175){_0x1566e9=_0x250175;_0xeeabb0[_0x823f('0x44')]=_['keys'](db[_0x823f('0x71')][_0x823f('0x3e')]);_0xeeabb0[_0x823f('0x41')]=_[_0x823f('0x55')](_0x2e9e63[_0x823f('0x41')]);_0xeeabb0[_0x823f('0x42')]=_[_0x823f('0x43')](_0xeeabb0[_0x823f('0x44')],_0xeeabb0[_0x823f('0x41')]);_0x42ae98[_0x823f('0x46')]=_[_0x823f('0x43')](_0xeeabb0[_0x823f('0x44')],qs[_0x823f('0x45')](_0x2e9e63[_0x823f('0x41')]['fields']));_0x42ae98['attributes']=_0x42ae98[_0x823f('0x46')]['length']?_0x42ae98[_0x823f('0x46')]:_0xeeabb0['model'];_0x42ae98['order']=qs[_0x823f('0x4a')](_0x2e9e63[_0x823f('0x41')]['sort']);_0x42ae98[_0x823f('0x4b')]=qs[_0x823f('0x42')](_[_0x823f('0x66')](_0x2e9e63[_0x823f('0x41')],_0xeeabb0[_0x823f('0x42')]));if(_0x2e9e63[_0x823f('0x41')]['filter']){_0x42ae98[_0x823f('0x4b')]=_['merge'](_0x42ae98[_0x823f('0x4b')],{'$or':_[_0x823f('0x3c')](_0x42ae98[_0x823f('0x46')],function(_0x181e5a){var _0xa8ada5={};_0xa8ada5[_0x181e5a]={'$like':'%'+_0x2e9e63[_0x823f('0x41')]['filter']+'%'};return _0xa8ada5;})});}_0x42ae98=_[_0x823f('0x4d')]({},_0x42ae98,_0x2e9e63[_0x823f('0x56')]);return _0x1566e9[_0x823f('0x70')](_0x42ae98);}})[_0x823f('0x21')](function(_0x19c720){if(_0x19c720){_0x539ee2=_0x19c720[_0x823f('0x47')];if(!_0x2e9e63['query'][_0x823f('0x65')](_0x823f('0x48'))){_0x42ae98['limit']=qs['limit'](_0x2e9e63[_0x823f('0x41')]['limit']);_0x42ae98[_0x823f('0x2c')]=qs[_0x823f('0x2c')](_0x2e9e63[_0x823f('0x41')][_0x823f('0x2c')]);}return _0x1566e9[_0x823f('0x70')](_0x42ae98);}})['then'](function(_0x55469c){if(_0x55469c){return _0x55469c?{'count':_0x539ee2,'rows':_0x55469c}:null;}})['then'](respondWithResult(_0x4fde98,null))[_0x823f('0x2a')](handleError(_0x4fde98,null));};exports[_0x823f('0x72')]=function(_0x45683b,_0x2a07c5,_0x4b81c6){var _0x5f5cce=_0x45683b[_0x823f('0x59')][_0x823f('0x73')];return db[_0x823f('0x71')]['findAll']({'where':{'id':_0x5f5cce},'attributes':['id'],'include':[{'model':db['User'],'as':_0x823f('0x74'),'attributes':['id',_0x823f('0x3a'),_0x823f('0x75'),_0x823f('0x76'),_0x823f('0x77')],'raw':!![]}]})['then'](function(_0xb9062d){if(_0xb9062d){var _0x33a532=_['flatMap'](_0xb9062d,function(_0x457aa2){var _0x3d7d4a=_0x457aa2[_0x823f('0x36')]({'plain':!![]});return _0x3d7d4a['Agents'];});return db['ChatQueue'][_0x823f('0x57')]({'where':{'id':_0x45683b[_0x823f('0x54')]['id']}})[_0x823f('0x21')](function(_0x58597e){return db[_0x823f('0x78')][_0x823f('0x79')](function(_0x351ae9){return _0x58597e[_0x823f('0x72')](_0x5f5cce,{'transaction':_0x351ae9})[_0x823f('0x21')](function(){return BPromise[_0x823f('0x7a')](_0x33a532,function(_0x535287){return db[_0x823f('0x64')]['findOrCreate']({'where':{'UserId':_0x535287['id'],'ChatQueueId':_0x45683b[_0x823f('0x54')]['id']},'transaction':_0x351ae9});});})[_0x823f('0x21')](function(){_0x33a532['forEach'](function(_0x4d3fdb){socket[_0x823f('0x7b')](_0x823f('0x7c'),{'UserId':_0x4d3fdb['id'],'ChatQueueId':_0x58597e['id']});});});});});}})[_0x823f('0x21')](respondWithStatusCode(_0x2a07c5,null))[_0x823f('0x2a')](handleError(_0x2a07c5,null));};exports['removeTeams']=function(_0x1b8f0f,_0x64c2a8,_0x5845c6){return db[_0x823f('0x71')][_0x823f('0x51')]({'where':{'id':_0x1b8f0f[_0x823f('0x41')][_0x823f('0x73')]},'attributes':['id'],'include':[{'model':db[_0x823f('0x68')],'as':_0x823f('0x74'),'attributes':['id'],'raw':!![]}]})[_0x823f('0x21')](handleEntityNotFound(_0x64c2a8,null))[_0x823f('0x21')](function(_0x39d0d2){var _0x4c622a=_[_0x823f('0x3c')](_0x39d0d2,'id');var _0x63af2d=[];var _0x5ab047=[];var _0x45c540=squel['select']();_0x45c540[_0x823f('0x7d')](_0x823f('0x7e'))[_0x823f('0x7f')](_0x823f('0x80'),'tq')[_0x823f('0x81')]('user_has_teams','ut',_0x823f('0x82'))[_0x823f('0x4b')]('ChatQueueId\x20=\x20?',_0x1b8f0f['params']['id']);for(var _0x692623=0x0;_0x692623<_0x39d0d2[_0x823f('0x47')];_0x692623+=0x1){let _0x1af44c=_0x39d0d2[_0x692623];for(var _0x175ab8=0x0;_0x175ab8<_0x1af44c['Agents'][_0x823f('0x47')];_0x175ab8+=0x1){let _0x4f35f0=_0x1af44c[_0x823f('0x74')][_0x175ab8];var _0x122d40=_0x45c540[_0x823f('0x83')]();_0x122d40['where']('ut.UserId\x20=\x20?',_0x4f35f0['id']);_0x5ab047[_0x823f('0x84')](db['sequelize'][_0x823f('0x41')](_0x122d40[_0x823f('0x85')](),{'type':db[_0x823f('0x78')][_0x823f('0x86')][_0x823f('0x87')]})[_0x823f('0x21')](function(_0x11eda7){if(_0x11eda7[_0x823f('0x47')]===0x1){return _0x4f35f0['id'];}else{var _0x510a9d=_['every'](_[_0x823f('0x3c')](_0x11eda7,_0x823f('0x88')),function(_0x429ae0){return _[_0x823f('0x89')](_0x4c622a,_0x429ae0);});if(_0x510a9d){return _0x4f35f0['id'];}}}));}}return BPromise[_0x823f('0x8a')](_0x5ab047)['then'](function(_0x2a640e){_0x63af2d=_(_0x63af2d)[_0x823f('0x8b')](_0x2a640e)[_0x823f('0x8c')]()[_0x823f('0x8d')]();return db[_0x823f('0x3d')][_0x823f('0x57')]({'where':{'id':_0x1b8f0f[_0x823f('0x54')]['id']}})[_0x823f('0x21')](function(_0x5a3401){return db['sequelize']['transaction'](function(_0x18d35d){return _0x5a3401[_0x823f('0x8e')](_0x1b8f0f[_0x823f('0x41')][_0x823f('0x73')],{'transaction':_0x18d35d})['then'](function(){if(!_[_0x823f('0x8f')](_0x63af2d)){return _0x5a3401[_0x823f('0x90')](_0x63af2d,{'transaction':_0x18d35d});}})[_0x823f('0x21')](function(){_0x63af2d[_0x823f('0x91')](function(_0x19402a){socket[_0x823f('0x7b')](_0x823f('0x92'),{'UserId':_0x19402a,'ChatQueueId':_0x5a3401['id']});});});});});});})[_0x823f('0x21')](respondWithStatusCode(_0x64c2a8,null))['catch'](handleError(_0x64c2a8,null));};exports[_0x823f('0x93')]=function(_0x3a9073,_0x436330,_0x23e18a){return db['ChatQueue'][_0x823f('0x57')]({'where':{'id':_0x3a9073[_0x823f('0x54')]['id']}})[_0x823f('0x21')](handleEntityNotFound(_0x436330,null))[_0x823f('0x21')](function(_0x1afba2){if(_0x1afba2){return _0x1afba2[_0x823f('0x93')](_0x3a9073[_0x823f('0x59')][_0x823f('0x73')],_[_0x823f('0x94')](_0x3a9073[_0x823f('0x59')],[_0x823f('0x73'),'id'])||{})[_0x823f('0x95')](function(_0x51feed){for(var _0x451a0d=0x0;_0x451a0d<_0x3a9073[_0x823f('0x59')]['ids'][_0x823f('0x47')];_0x451a0d+=0x1){socket[_0x823f('0x7b')]('userChatQueue:save',{'UserId':Number(_0x3a9073[_0x823f('0x59')][_0x823f('0x73')][_0x451a0d]),'ChatQueueId':Number(_0x3a9073[_0x823f('0x54')]['id'])});}return _0x51feed;});}})['then'](respondWithResult(_0x436330,null))[_0x823f('0x2a')](handleError(_0x436330,null));};exports[_0x823f('0x90')]=function(_0x2dc143,_0x48ada2,_0x432cbd){return db['ChatQueue'][_0x823f('0x57')]({'where':{'id':_0x2dc143[_0x823f('0x54')]['id']}})['then'](handleEntityNotFound(_0x48ada2,null))[_0x823f('0x21')](function(_0x508123){if(_0x508123){return _0x508123[_0x823f('0x90')](_0x2dc143[_0x823f('0x41')]['ids'])[_0x823f('0x21')](function(){if(_[_0x823f('0x96')](_0x2dc143[_0x823f('0x41')][_0x823f('0x73')])){for(var _0xf6051e=0x0;_0xf6051e<_0x2dc143[_0x823f('0x41')]['ids'][_0x823f('0x47')];_0xf6051e+=0x1){socket[_0x823f('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x2dc143['query'][_0x823f('0x73')][_0xf6051e]),'ChatQueueId':Number(_0x2dc143[_0x823f('0x54')]['id'])});}}else{socket['emit'](_0x823f('0x92'),{'UserId':Number(_0x2dc143['query'][_0x823f('0x73')]),'ChatQueueId':Number(_0x2dc143[_0x823f('0x54')]['id'])});}});}})[_0x823f('0x21')](respondWithStatusCode(_0x48ada2,null))[_0x823f('0x2a')](handleError(_0x48ada2,null));};exports['getAgents']=function(_0x3bcb15,_0x4a8918,_0x10d7fe){var _0x489c59={};var _0xbc96aa={};var _0x3fa011;var _0x243b65;return db['ChatQueue'][_0x823f('0x63')]({'where':{'id':_0x3bcb15[_0x823f('0x54')]['id']}})[_0x823f('0x21')](handleEntityNotFound(_0x4a8918,null))[_0x823f('0x21')](function(_0xd789f9){if(_0xd789f9){_0x3fa011=_0xd789f9;_0xbc96aa[_0x823f('0x44')]=_[_0x823f('0x55')](db[_0x823f('0x68')]['rawAttributes']);_0xbc96aa['query']=_[_0x823f('0x55')](_0x3bcb15[_0x823f('0x41')]);_0xbc96aa[_0x823f('0x42')]=_['intersection'](_0xbc96aa['model'],_0xbc96aa['query']);_0x489c59[_0x823f('0x46')]=_[_0x823f('0x43')](_0xbc96aa[_0x823f('0x44')],qs['fields'](_0x3bcb15['query'][_0x823f('0x45')]));_0x489c59[_0x823f('0x46')]=_0x489c59[_0x823f('0x46')][_0x823f('0x47')]?_0x489c59[_0x823f('0x46')]:_0xbc96aa[_0x823f('0x44')];_0x489c59[_0x823f('0x49')]=qs[_0x823f('0x4a')](_0x3bcb15['query'][_0x823f('0x4a')]);_0x489c59[_0x823f('0x4b')]=qs['filters'](_['pick'](_0x3bcb15[_0x823f('0x41')],_0xbc96aa[_0x823f('0x42')]));if(_0x3bcb15[_0x823f('0x41')][_0x823f('0x4c')]){_0x489c59[_0x823f('0x4b')]=_['merge'](_0x489c59['where'],{'$or':_[_0x823f('0x3c')](_0x489c59[_0x823f('0x46')],function(_0x51bd6c){var _0xc6dc7a={};_0xc6dc7a[_0x51bd6c]={'$like':'%'+_0x3bcb15[_0x823f('0x41')]['filter']+'%'};return _0xc6dc7a;})});}_0x489c59=_['merge']({},_0x489c59,_0x3bcb15[_0x823f('0x56')]);return _0x3fa011['getAgents'](_0x489c59);}})[_0x823f('0x21')](function(_0x3892de){if(_0x3892de){_0x243b65=_0x3892de[_0x823f('0x47')];if(!_0x3bcb15[_0x823f('0x41')][_0x823f('0x65')]('nolimit')){_0x489c59[_0x823f('0x2e')]=qs['limit'](_0x3bcb15[_0x823f('0x41')][_0x823f('0x2e')]);_0x489c59[_0x823f('0x2c')]=qs[_0x823f('0x2c')](_0x3bcb15['query'][_0x823f('0x2c')]);}return _0x3fa011[_0x823f('0x97')](_0x489c59);}})['then'](function(_0x4a648b){if(_0x4a648b){return _0x4a648b?{'count':_0x243b65,'rows':_0x4a648b}:null;}})[_0x823f('0x21')](respondWithResult(_0x4a8918,null))[_0x823f('0x2a')](handleError(_0x4a8918,null));};
\ No newline at end of file
index 8577b63..5ba2868 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc17=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x31ddea,_0x40de6d){var _0x12539b=function(_0x1d353b){while(--_0x1d353b){_0x31ddea['push'](_0x31ddea['shift']());}};_0x12539b(++_0x40de6d);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x361bb4,_0x411189){_0x361bb4=_0x361bb4-0x0;var _0x3e88c3=_0xbc17[_0x361bb4];return _0x3e88c3;};'use strict';var EventEmitter=require(_0x7bc1('0x0'));var ChatQueue=require(_0x7bc1('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7bc1('0x2')](0x0);var events={'afterCreate':_0x7bc1('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3ff36d){return function(_0x7aa41e,_0x5dfaa8,_0x2cd126){ChatQueueEvents['emit'](_0x3ff36d+':'+_0x7aa41e['id'],_0x7aa41e);ChatQueueEvents[_0x7bc1('0x4')](_0x3ff36d,_0x7aa41e);_0x2cd126(null);};}for(var e in events){if(events[_0x7bc1('0x5')](e)){var event=events[e];ChatQueue[_0x7bc1('0x6')](e,emitEvent(event));}}module[_0x7bc1('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xf53a=['remove','emit','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x353188,_0x3d5849){var _0x43d643=function(_0x25b8b2){while(--_0x25b8b2){_0x353188['push'](_0x353188['shift']());}};_0x43d643(++_0x3d5849);}(_0xf53a,0x1d3));var _0xaf53=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xf53a[_0x500419];return _0x241c1a;};'use strict';var EventEmitter=require(_0xaf53('0x0'));var ChatQueue=require(_0xaf53('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xaf53('0x2')](0x0);var events={'afterCreate':_0xaf53('0x3'),'afterUpdate':_0xaf53('0x4'),'afterDestroy':_0xaf53('0x5')};function emitEvent(_0x582758){return function(_0x2e3e90,_0x4bee19,_0x2a32d7){ChatQueueEvents[_0xaf53('0x6')](_0x582758+':'+_0x2e3e90['id'],_0x2e3e90);ChatQueueEvents[_0xaf53('0x6')](_0x582758,_0x2e3e90);_0x2a32d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xaf53('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
index b5957f8..93366a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ac7=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x3ab7a7,_0x3d421d){var _0x3f7a31=function(_0x4d2c0d){while(--_0x4d2c0d){_0x3ab7a7['push'](_0x3ab7a7['shift']());}};_0x3f7a31(++_0x3d421d);}(_0x9ac7,0xdb));var _0x79ac=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9ac7[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x79ac('0x0'));var util=require(_0x79ac('0x1'));var logger=require(_0x79ac('0x2'))(_0x79ac('0x3'));var moment=require(_0x79ac('0x4'));var BPromise=require('bluebird');var rp=require(_0x79ac('0x5'));var fs=require('fs');var path=require(_0x79ac('0x6'));var rimraf=require(_0x79ac('0x7'));var config=require(_0x79ac('0x8'));var attributes=require(_0x79ac('0x9'));module[_0x79ac('0xa')]=function(_0x29a9b8,_0xae1f63){return _0x29a9b8[_0x79ac('0xb')](_0x79ac('0xc'),attributes,{'tableName':_0x79ac('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1113=['define','ChatQueue','chat_queues','../../config/logger','api','moment','bluebird','path','rimraf','./chatQueue.attributes','exports'];(function(_0x3a3c3d,_0x3b8542){var _0xf3142f=function(_0x479bb0){while(--_0x479bb0){_0x3a3c3d['push'](_0x3a3c3d['shift']());}};_0xf3142f(++_0x3b8542);}(_0x1113,0x1a5));var _0x3111=function(_0x4da3b6,_0x233aff){_0x4da3b6=_0x4da3b6-0x0;var _0x574d38=_0x1113[_0x4da3b6];return _0x574d38;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3111('0x0'))(_0x3111('0x1'));var moment=require(_0x3111('0x2'));var BPromise=require(_0x3111('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3111('0x4'));var rimraf=require(_0x3111('0x5'));var config=require('../../config/environment');var attributes=require(_0x3111('0x6'));module[_0x3111('0x7')]=function(_0x7aa627,_0x2fba74){return _0x7aa627[_0x3111('0x8')](_0x3111('0x9'),attributes,{'tableName':_0x3111('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3e68862..d64f76b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7cf=['ShowChatQueue','ChatQueue','find','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetChatQueue','findAll','options','where','attributes','limit','include','map','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7cf,0x12b));var _0xfd7c=function(_0x14102c,_0x1cb214){_0x14102c=_0x14102c-0x0;var _0x13297b=_0xd7cf[_0x14102c];return _0x13297b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfd7c('0x0'));var BPromise=require(_0xfd7c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd7c('0x2'));var db=require(_0xfd7c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd7c('0x4'));var config=require(_0xfd7c('0x5'));var jayson=require(_0xfd7c('0x6'));var client=jayson[_0xfd7c('0x7')]['http']({'port':0x232a});config[_0xfd7c('0x8')]=_[_0xfd7c('0x9')](config[_0xfd7c('0x8')],{'host':_0xfd7c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd7c('0x8')]));require(_0xfd7c('0xb'))[_0xfd7c('0xc')](socket);function respondWithRpcPromise(_0x4e7912,_0x156d02,_0x24e717){return new BPromise(function(_0x1adb82,_0x4d4395){return client[_0xfd7c('0xd')](_0x4e7912,_0x24e717)[_0xfd7c('0xe')](function(_0x34e894){logger[_0xfd7c('0xf')](_0xfd7c('0x10'),_0x156d02,'request\x20sent');logger[_0xfd7c('0x11')](_0xfd7c('0x12'),_0x156d02,_0xfd7c('0x13'),JSON[_0xfd7c('0x14')](_0x34e894));if(_0x34e894[_0xfd7c('0x15')]){if(_0x34e894['error'][_0xfd7c('0x16')]===0x1f4){logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x34e894[_0xfd7c('0x15')]['message']);return _0x4d4395(_0x34e894['error']['message']);}logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x34e894['error'][_0xfd7c('0x17')]);return _0x1adb82(_0x34e894[_0xfd7c('0x15')]['message']);}else{logger[_0xfd7c('0xf')](_0xfd7c('0x10'),_0x156d02,_0xfd7c('0x13'));_0x1adb82(_0x34e894['result'][_0xfd7c('0x17')]);}})[_0xfd7c('0x18')](function(_0x52d2d2){logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x52d2d2);_0x4d4395(_0x52d2d2);});});}exports[_0xfd7c('0x19')]=function(_0x484adc){var _0x58a155=this;return new Promise(function(_0x4d86c4,_0x483cc4){return db['ChatQueue'][_0xfd7c('0x1a')]({'raw':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1c')]||null:null,'attributes':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1d')]||null:null,'limit':_0x484adc['options']?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1e')]||null:null,'include':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1f')],function(_0x285768){return{'model':db[_0x285768[_0xfd7c('0x21')]],'as':_0x285768['as'],'attributes':_0x285768[_0xfd7c('0x1d')],'include':_0x285768['include']?_[_0xfd7c('0x20')](_0x285768[_0xfd7c('0x1f')],function(_0x5276cc){return{'model':db[_0x5276cc[_0xfd7c('0x21')]],'as':_0x5276cc['as'],'attributes':_0x5276cc[_0xfd7c('0x1d')],'include':_0x5276cc[_0xfd7c('0x1f')]?_['map'](_0x5276cc['include'],function(_0x374dce){return{'model':db[_0x374dce[_0xfd7c('0x21')]],'as':_0x374dce['as'],'attributes':_0x374dce[_0xfd7c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfd7c('0xe')](function(_0x59ca9f){logger['info']('GetChatQueue',_0x484adc);logger[_0xfd7c('0x11')](_0xfd7c('0x19'),_0x484adc,JSON[_0xfd7c('0x14')](_0x59ca9f));_0x4d86c4(_0x59ca9f);})[_0xfd7c('0x18')](function(_0x2e9eaa){logger[_0xfd7c('0x15')](_0xfd7c('0x19'),_0x2e9eaa['message'],_0x484adc);_0x483cc4(_0x58a155[_0xfd7c('0x15')](0x1f4,_0x2e9eaa['message']));});});};exports[_0xfd7c('0x22')]=function(_0x4f6d24){var _0x383c43=this;return new Promise(function(_0x3e8d86,_0x4043dc){return db[_0xfd7c('0x23')][_0xfd7c('0x24')]({'raw':_0x4f6d24['options']?_0x4f6d24[_0xfd7c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4f6d24[_0xfd7c('0x1b')]?_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1c')]||null:null,'attributes':_0x4f6d24[_0xfd7c('0x1b')]?_0x4f6d24[_0xfd7c('0x1b')]['attributes']||null:null,'include':_0x4f6d24['options']?_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1f')]?_['map'](_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1f')],function(_0x490331){return{'model':db[_0x490331[_0xfd7c('0x21')]],'as':_0x490331['as'],'attributes':_0x490331[_0xfd7c('0x1d')],'include':_0x490331[_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x490331[_0xfd7c('0x1f')],function(_0x4cfbbd){return{'model':db[_0x4cfbbd[_0xfd7c('0x21')]],'as':_0x4cfbbd['as'],'attributes':_0x4cfbbd[_0xfd7c('0x1d')],'include':_0x4cfbbd[_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x4cfbbd[_0xfd7c('0x1f')],function(_0x154894){return{'model':db[_0x154894[_0xfd7c('0x21')]],'as':_0x154894['as'],'attributes':_0x154894[_0xfd7c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfd7c('0xe')](function(_0x5e3d23){logger[_0xfd7c('0xf')](_0xfd7c('0x22'),_0x4f6d24);logger['debug'](_0xfd7c('0x22'),_0x4f6d24,JSON[_0xfd7c('0x14')](_0x5e3d23));_0x3e8d86(_0x5e3d23);})[_0xfd7c('0x18')](function(_0x46cce7){logger[_0xfd7c('0x15')]('ShowChatQueue',_0x46cce7[_0xfd7c('0x17')],_0x4f6d24);_0x4043dc(_0x383c43[_0xfd7c('0x15')](0x1f4,_0x46cce7[_0xfd7c('0x17')]));});});};
\ No newline at end of file
+var _0x18a8=['client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','then','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','include','map','model','debug','stringify','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x18a8,0x127));var _0x818a=function(_0x14f29b,_0x46f764){_0x14f29b=_0x14f29b-0x0;var _0x3c4440=_0x18a8[_0x14f29b];return _0x3c4440;};'use strict';var _=require(_0x818a('0x0'));var util=require(_0x818a('0x1'));var moment=require('moment');var BPromise=require(_0x818a('0x2'));var rs=require(_0x818a('0x3'));var fs=require('fs');var Redis=require(_0x818a('0x4'));var db=require(_0x818a('0x5'))['db'];var utils=require(_0x818a('0x6'));var logger=require('../../config/logger')(_0x818a('0x7'));var config=require(_0x818a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x818a('0x9')][_0x818a('0xa')]({'port':0x232a});config[_0x818a('0xb')]=_[_0x818a('0xc')](config[_0x818a('0xb')],{'host':_0x818a('0xd'),'port':0x18eb});var socket=require(_0x818a('0xe'))(new Redis(config['redis']));require(_0x818a('0xf'))['register'](socket);function respondWithRpcPromise(_0x5af804,_0x569b7f,_0x4db0f1){return new BPromise(function(_0x41113a,_0xa667b4){return client['request'](_0x5af804,_0x4db0f1)[_0x818a('0x10')](function(_0x535d4e){logger['info'](_0x818a('0x11'),_0x569b7f,'request\x20sent');logger['debug'](_0x818a('0x12'),_0x569b7f,'request\x20sent',JSON['stringify'](_0x535d4e));if(_0x535d4e[_0x818a('0x13')]){if(_0x535d4e[_0x818a('0x13')]['code']===0x1f4){logger['error'](_0x818a('0x11'),_0x569b7f,_0x535d4e[_0x818a('0x13')][_0x818a('0x14')]);return _0xa667b4(_0x535d4e[_0x818a('0x13')]['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x569b7f,_0x535d4e[_0x818a('0x13')][_0x818a('0x14')]);return _0x41113a(_0x535d4e[_0x818a('0x13')][_0x818a('0x14')]);}else{logger[_0x818a('0x15')](_0x818a('0x11'),_0x569b7f,_0x818a('0x16'));_0x41113a(_0x535d4e[_0x818a('0x17')][_0x818a('0x14')]);}})[_0x818a('0x18')](function(_0x4b6b55){logger[_0x818a('0x13')](_0x818a('0x11'),_0x569b7f,_0x4b6b55);_0xa667b4(_0x4b6b55);});});}exports[_0x818a('0x19')]=function(_0x3ed542){var _0x373534=this;return new Promise(function(_0x463aa2,_0x659d41){return db[_0x818a('0x1a')][_0x818a('0x1b')]({'raw':_0x3ed542[_0x818a('0x1c')]?_0x3ed542[_0x818a('0x1c')][_0x818a('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ed542[_0x818a('0x1c')]?_0x3ed542[_0x818a('0x1c')][_0x818a('0x1e')]||null:null,'attributes':_0x3ed542[_0x818a('0x1c')]?_0x3ed542[_0x818a('0x1c')][_0x818a('0x1f')]||null:null,'limit':_0x3ed542[_0x818a('0x1c')]?_0x3ed542['options']['limit']||null:null,'include':_0x3ed542[_0x818a('0x1c')]?_0x3ed542['options'][_0x818a('0x20')]?_[_0x818a('0x21')](_0x3ed542[_0x818a('0x1c')]['include'],function(_0x5637f6){return{'model':db[_0x5637f6['model']],'as':_0x5637f6['as'],'attributes':_0x5637f6[_0x818a('0x1f')],'include':_0x5637f6['include']?_[_0x818a('0x21')](_0x5637f6[_0x818a('0x20')],function(_0x298a69){return{'model':db[_0x298a69['model']],'as':_0x298a69['as'],'attributes':_0x298a69[_0x818a('0x1f')],'include':_0x298a69[_0x818a('0x20')]?_['map'](_0x298a69['include'],function(_0x47d3bc){return{'model':db[_0x47d3bc[_0x818a('0x22')]],'as':_0x47d3bc['as'],'attributes':_0x47d3bc[_0x818a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x818a('0x10')](function(_0x129378){logger[_0x818a('0x15')](_0x818a('0x19'),_0x3ed542);logger[_0x818a('0x23')](_0x818a('0x19'),_0x3ed542,JSON[_0x818a('0x24')](_0x129378));_0x463aa2(_0x129378);})['catch'](function(_0x2b9a2f){logger[_0x818a('0x13')](_0x818a('0x19'),_0x2b9a2f[_0x818a('0x14')],_0x3ed542);_0x659d41(_0x373534[_0x818a('0x13')](0x1f4,_0x2b9a2f['message']));});});};exports[_0x818a('0x25')]=function(_0x49f0a5){var _0x4da577=this;return new Promise(function(_0x5be7cc,_0x311604){return db['ChatQueue']['find']({'raw':_0x49f0a5[_0x818a('0x1c')]?_0x49f0a5[_0x818a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x49f0a5['options']?_0x49f0a5[_0x818a('0x1c')][_0x818a('0x1e')]||null:null,'attributes':_0x49f0a5['options']?_0x49f0a5[_0x818a('0x1c')][_0x818a('0x1f')]||null:null,'include':_0x49f0a5[_0x818a('0x1c')]?_0x49f0a5[_0x818a('0x1c')][_0x818a('0x20')]?_['map'](_0x49f0a5[_0x818a('0x1c')][_0x818a('0x20')],function(_0x32c005){return{'model':db[_0x32c005[_0x818a('0x22')]],'as':_0x32c005['as'],'attributes':_0x32c005['attributes'],'include':_0x32c005['include']?_[_0x818a('0x21')](_0x32c005[_0x818a('0x20')],function(_0xac7288){return{'model':db[_0xac7288[_0x818a('0x22')]],'as':_0xac7288['as'],'attributes':_0xac7288[_0x818a('0x1f')],'include':_0xac7288[_0x818a('0x20')]?_[_0x818a('0x21')](_0xac7288['include'],function(_0x3d6717){return{'model':db[_0x3d6717[_0x818a('0x22')]],'as':_0x3d6717['as'],'attributes':_0x3d6717[_0x818a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f967a){logger[_0x818a('0x15')]('ShowChatQueue',_0x49f0a5);logger[_0x818a('0x23')](_0x818a('0x25'),_0x49f0a5,JSON[_0x818a('0x24')](_0x2f967a));_0x5be7cc(_0x2f967a);})[_0x818a('0x18')](function(_0x349e82){logger[_0x818a('0x13')](_0x818a('0x25'),_0x349e82[_0x818a('0x14')],_0x49f0a5);_0x311604(_0x4da577[_0x818a('0x13')](0x1f4,_0x349e82[_0x818a('0x14')]));});});};
\ No newline at end of file
index 79c308d..4fdaae1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa37e=['chatQueue:','remove','update','emit','removeListener','register'];(function(_0x4ad88a,_0x46411b){var _0x1af50a=function(_0x48190c){while(--_0x48190c){_0x4ad88a['push'](_0x4ad88a['shift']());}};_0x1af50a(++_0x46411b);}(_0xa37e,0x97));var _0xea37=function(_0x211c4c,_0x264156){_0x211c4c=_0x211c4c-0x0;var _0x464c20=_0xa37e[_0x211c4c];return _0x464c20;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xea37('0x0'),_0xea37('0x1')];function createListener(_0x204a22,_0x475c71){return function(_0x5430aa){_0x475c71[_0xea37('0x2')](_0x204a22,_0x5430aa);};}function removeListener(_0x537c5a,_0x360ed5){return function(){ChatQueueEvents[_0xea37('0x3')](_0x537c5a,_0x360ed5);};}exports[_0xea37('0x4')]=function(_0x4d380b){for(var _0x57135b=0x0,_0x36c489=events['length'];_0x57135b<_0x36c489;_0x57135b++){var _0x4ae081=events[_0x57135b];var _0x2c2890=createListener(_0xea37('0x5')+_0x4ae081,_0x4d380b);ChatQueueEvents['on'](_0x4ae081,_0x2c2890);}};
\ No newline at end of file
+var _0xa8a8=['length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x18c6c0,_0x4da3ff){var _0xb27152=function(_0x239070){while(--_0x239070){_0x18c6c0['push'](_0x18c6c0['shift']());}};_0xb27152(++_0x4da3ff);}(_0xa8a8,0xec));var _0x8a8a=function(_0x2e97d6,_0x65d243){_0x2e97d6=_0x2e97d6-0x0;var _0x12a91d=_0xa8a8[_0x2e97d6];return _0x12a91d;};'use strict';var ChatQueueEvents=require(_0x8a8a('0x0'));var events=[_0x8a8a('0x1'),_0x8a8a('0x2'),_0x8a8a('0x3')];function createListener(_0x5221bc,_0x2a2676){return function(_0x3296a6){_0x2a2676[_0x8a8a('0x4')](_0x5221bc,_0x3296a6);};}function removeListener(_0x3ed1de,_0x45515d){return function(){ChatQueueEvents[_0x8a8a('0x5')](_0x3ed1de,_0x45515d);};}exports[_0x8a8a('0x6')]=function(_0x12db82){for(var _0x2e8193=0x0,_0x315fe9=events[_0x8a8a('0x7')];_0x2e8193<_0x315fe9;_0x2e8193++){var _0x8e7aa0=events[_0x2e8193];var _0x4225b9=createListener(_0x8a8a('0x8')+_0x8e7aa0,_0x12db82);ChatQueueEvents['on'](_0x8e7aa0,_0x4225b9);}};
\ No newline at end of file
index 99378d6..90400aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x209cea,_0x9bcc6e){var _0x45521f=function(_0x5c99a0){while(--_0x5c99a0){_0x209cea['push'](_0x209cea['shift']());}};_0x45521f(++_0x9bcc6e);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x4aa1e0,_0x4c155d){var _0x45d0b=function(_0x461ca5){while(--_0x461ca5){_0x4aa1e0['push'](_0x4aa1e0['shift']());}};_0x45d0b(++_0x4c155d);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index bc8f087..1b78687 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64a1=['exports','DATE','STRING','moment','sequelize'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x64a1,0x13e));var _0x164a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x64a1[_0x57b54c];return _0x59cc19;};'use strict';var moment=require(_0x164a('0x0'));var Sequelize=require(_0x164a('0x1'));module[_0x164a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x164a('0x3')]},'leaveAt':{'type':Sequelize[_0x164a('0x3')]},'acceptAt':{'type':Sequelize[_0x164a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x164a('0x4')]}};
\ No newline at end of file
+var _0xcd0a=['exports','STRING','DATE','moment','sequelize'];(function(_0x17ce9c,_0x6db0a0){var _0x93265e=function(_0x42b5a3){while(--_0x42b5a3){_0x17ce9c['push'](_0x17ce9c['shift']());}};_0x93265e(++_0x6db0a0);}(_0xcd0a,0xee));var _0xacd0=function(_0x25a78d,_0x2b0f45){_0x25a78d=_0x25a78d-0x0;var _0xd54de8=_0xcd0a[_0x25a78d];return _0xd54de8;};'use strict';var moment=require(_0xacd0('0x0'));var Sequelize=require(_0xacd0('0x1'));module[_0xacd0('0x2')]={'uniqueid':{'type':Sequelize[_0xacd0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xacd0('0x3')]},'joinAt':{'type':Sequelize[_0xacd0('0x4')]},'leaveAt':{'type':Sequelize[_0xacd0('0x4')]},'acceptAt':{'type':Sequelize[_0xacd0('0x4')]},'exitAt':{'type':Sequelize[_0xacd0('0x4')]},'reason':{'type':Sequelize[_0xacd0('0x3')]}};
\ No newline at end of file
index b0fcecf..9fc2d2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c85=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x14aec3,_0x12f372){var _0x3b599a=function(_0x46133d){while(--_0x46133d){_0x14aec3['push'](_0x14aec3['shift']());}};_0x3b599a(++_0x12f372);}(_0x3c85,0x1a0));var _0x53c8=function(_0x1ded1f,_0x42bf0d){_0x1ded1f=_0x1ded1f-0x0;var _0x5dc380=_0x3c85[_0x1ded1f];return _0x5dc380;};'use strict';var emlformat=require(_0x53c8('0x0'));var rimraf=require(_0x53c8('0x1'));var zipdir=require(_0x53c8('0x2'));var jsonpatch=require(_0x53c8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x53c8('0x4'));var Mustache=require(_0x53c8('0x5'));var util=require(_0x53c8('0x6'));var path=require('path');var sox=require(_0x53c8('0x7'));var csv=require(_0x53c8('0x8'));var ejs=require(_0x53c8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x53c8('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x53c8('0xb'));var Papa=require(_0x53c8('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x53c8('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x53c8('0xe'));var utils=require(_0x53c8('0xf'));var config=require(_0x53c8('0x10'));var licenseUtil=require(_0x53c8('0x11'));var db=require(_0x53c8('0x12'))['db'];function respondWithStatusCode(_0x499ba8,_0x2ccf50){_0x2ccf50=_0x2ccf50||0xcc;return function(_0x3231f6){if(_0x3231f6){return _0x499ba8[_0x53c8('0x13')](_0x2ccf50);}return _0x499ba8['status'](_0x2ccf50)[_0x53c8('0x14')]();};}function respondWithResult(_0x31979e,_0x5a9f7f){_0x5a9f7f=_0x5a9f7f||0xc8;return function(_0x132777){if(_0x132777){return _0x31979e[_0x53c8('0x15')](_0x5a9f7f)[_0x53c8('0x16')](_0x132777);}};}function respondWithFilteredResult(_0xb13c1f,_0x30ff54){return function(_0x1c037f){if(_0x1c037f){var _0x385c39=typeof _0x30ff54[_0x53c8('0x17')]===_0x53c8('0x18')&&typeof _0x30ff54[_0x53c8('0x19')]===_0x53c8('0x18');var _0x44d6e4=_0x1c037f[_0x53c8('0x1a')];var _0x297f98=_0x385c39?0x0:_0x30ff54[_0x53c8('0x17')];var _0x4551b9=_0x385c39?_0x1c037f['count']:_0x30ff54['offset']+_0x30ff54[_0x53c8('0x19')];var _0x1a006c;if(_0x4551b9>=_0x44d6e4){_0x4551b9=_0x44d6e4;_0x1a006c=0xc8;}else{_0x1a006c=0xce;}_0xb13c1f[_0x53c8('0x15')](_0x1a006c);return _0xb13c1f[_0x53c8('0x1b')]('Content-Range',_0x297f98+'-'+_0x4551b9+'/'+_0x44d6e4)[_0x53c8('0x16')](_0x1c037f);}return null;};}function patchUpdates(_0x333990){return function(_0x40cc4c){try{jsonpatch[_0x53c8('0x1c')](_0x40cc4c,_0x333990,!![]);}catch(_0x12190e){return BPromise[_0x53c8('0x1d')](_0x12190e);}return _0x40cc4c[_0x53c8('0x1e')]();};}function saveUpdates(_0x54c1de,_0x1cf910){return function(_0x5b67d5){if(_0x5b67d5){return _0x5b67d5[_0x53c8('0x1f')](_0x54c1de)[_0x53c8('0x20')](function(_0xc329e8){return _0xc329e8;});}return null;};}function removeEntity(_0x2b024,_0x4cb9cb){return function(_0x3b2556){if(_0x3b2556){return _0x3b2556[_0x53c8('0x21')]()[_0x53c8('0x20')](function(){_0x2b024[_0x53c8('0x15')](0xcc)[_0x53c8('0x14')]();});}};}function handleEntityNotFound(_0x454bc5,_0x424211){return function(_0x11c6ca){if(!_0x11c6ca){_0x454bc5[_0x53c8('0x13')](0x194);}return _0x11c6ca;};}function handleError(_0x2821ad,_0x5e9265){_0x5e9265=_0x5e9265||0x1f4;return function(_0x1fe7e4){logger['error'](_0x1fe7e4['stack']);if(_0x1fe7e4[_0x53c8('0x22')]){delete _0x1fe7e4[_0x53c8('0x22')];}_0x2821ad[_0x53c8('0x15')](_0x5e9265)[_0x53c8('0x23')](_0x1fe7e4);};}exports[_0x53c8('0x24')]=function(_0x3f2c72,_0x320293){var _0x4031ba={},_0xf11181={},_0x6aa920={'count':0x0,'rows':[]};var _0x178992=_[_0x53c8('0x25')](db[_0x53c8('0x26')][_0x53c8('0x27')],function(_0x14e750){return{'name':_0x14e750[_0x53c8('0x28')],'type':_0x14e750[_0x53c8('0x29')][_0x53c8('0x2a')]};});_0xf11181[_0x53c8('0x2b')]=_['map'](_0x178992,_0x53c8('0x22'));_0xf11181[_0x53c8('0x2c')]=_[_0x53c8('0x2d')](_0x3f2c72['query']);_0xf11181[_0x53c8('0x2e')]=_[_0x53c8('0x2f')](_0xf11181[_0x53c8('0x2b')],_0xf11181[_0x53c8('0x2c')]);_0x4031ba['attributes']=_['intersection'](_0xf11181[_0x53c8('0x2b')],qs[_0x53c8('0x30')](_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x30')]));_0x4031ba[_0x53c8('0x31')]=_0x4031ba['attributes'][_0x53c8('0x32')]?_0x4031ba['attributes']:_0xf11181[_0x53c8('0x2b')];if(!_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x33')](_0x53c8('0x34'))){_0x4031ba['limit']=qs['limit'](_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x19')]);_0x4031ba[_0x53c8('0x17')]=qs[_0x53c8('0x17')](_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x17')]);}_0x4031ba[_0x53c8('0x35')]=qs[_0x53c8('0x36')](_0x3f2c72['query'][_0x53c8('0x36')]);_0x4031ba[_0x53c8('0x37')]=qs['filters'](_[_0x53c8('0x38')](_0x3f2c72[_0x53c8('0x2c')],_0xf11181[_0x53c8('0x2e')]),_0x178992);if(_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x39')]){_0x4031ba[_0x53c8('0x37')]=_[_0x53c8('0x3a')](_0x4031ba['where'],{'$or':_['map'](_0x178992,function(_0x5a3691){if(_0x5a3691[_0x53c8('0x29')]!==_0x53c8('0x3b')){var _0x13f787={};_0x13f787[_0x5a3691[_0x53c8('0x22')]]={'$like':'%'+_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x39')]+'%'};return _0x13f787;}})});}_0x4031ba=_[_0x53c8('0x3a')]({},_0x4031ba,_0x3f2c72[_0x53c8('0x3c')]);var _0xf4c9b={'where':_0x4031ba[_0x53c8('0x37')]};return db[_0x53c8('0x26')][_0x53c8('0x1a')](_0xf4c9b)[_0x53c8('0x20')](function(_0x1d61e9){_0x6aa920[_0x53c8('0x1a')]=_0x1d61e9;if(_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x3d')]){_0x4031ba[_0x53c8('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x53c8('0x3f')](_0x4031ba);})[_0x53c8('0x20')](function(_0x3f47a9){_0x6aa920[_0x53c8('0x40')]=_0x3f47a9;return _0x6aa920;})[_0x53c8('0x20')](respondWithFilteredResult(_0x320293,_0x4031ba))[_0x53c8('0x41')](handleError(_0x320293,null));};exports[_0x53c8('0x42')]=function(_0x146878,_0x4d772e){var _0x3ba6dd={'raw':!![],'where':{'id':_0x146878[_0x53c8('0x43')]['id']}},_0x284d91={};_0x284d91[_0x53c8('0x2b')]=_[_0x53c8('0x2d')](db[_0x53c8('0x26')][_0x53c8('0x27')]);_0x284d91[_0x53c8('0x2c')]=_[_0x53c8('0x2d')](_0x146878[_0x53c8('0x2c')]);_0x284d91[_0x53c8('0x2e')]=_[_0x53c8('0x2f')](_0x284d91[_0x53c8('0x2b')],_0x284d91[_0x53c8('0x2c')]);_0x3ba6dd['attributes']=_[_0x53c8('0x2f')](_0x284d91[_0x53c8('0x2b')],qs['fields'](_0x146878['query'][_0x53c8('0x30')]));_0x3ba6dd['attributes']=_0x3ba6dd[_0x53c8('0x31')]['length']?_0x3ba6dd[_0x53c8('0x31')]:_0x284d91[_0x53c8('0x2b')];if(_0x146878[_0x53c8('0x2c')][_0x53c8('0x3d')]){_0x3ba6dd['include']=[{'all':!![]}];}_0x3ba6dd=_['merge']({},_0x3ba6dd,_0x146878['options']);return db[_0x53c8('0x26')][_0x53c8('0x44')](_0x3ba6dd)[_0x53c8('0x20')](handleEntityNotFound(_0x4d772e,null))[_0x53c8('0x20')](respondWithResult(_0x4d772e,null))[_0x53c8('0x41')](handleError(_0x4d772e,null));};exports['create']=function(_0x3fe863,_0x13d1e0){return db[_0x53c8('0x26')][_0x53c8('0x45')](_0x3fe863[_0x53c8('0x46')],{})['then'](respondWithResult(_0x13d1e0,0xc9))[_0x53c8('0x41')](handleError(_0x13d1e0,null));};exports[_0x53c8('0x1f')]=function(_0x487189,_0x143a5a){if(_0x487189[_0x53c8('0x46')]['id']){delete _0x487189[_0x53c8('0x46')]['id'];}return db[_0x53c8('0x26')][_0x53c8('0x44')]({'where':{'id':_0x487189['params']['id']}})['then'](handleEntityNotFound(_0x143a5a,null))['then'](saveUpdates(_0x487189['body'],null))[_0x53c8('0x20')](respondWithResult(_0x143a5a,null))[_0x53c8('0x41')](handleError(_0x143a5a,null));};exports[_0x53c8('0x21')]=function(_0x4809e,_0x52de94){return db[_0x53c8('0x26')][_0x53c8('0x44')]({'where':{'id':_0x4809e[_0x53c8('0x43')]['id']}})[_0x53c8('0x20')](handleEntityNotFound(_0x52de94,null))[_0x53c8('0x20')](removeEntity(_0x52de94,null))[_0x53c8('0x41')](handleError(_0x52de94,null));};exports[_0x53c8('0x47')]=function(_0x3167ad,_0x10dd3e){return db[_0x53c8('0x26')][_0x53c8('0x47')]()[_0x53c8('0x20')](respondWithResult(_0x10dd3e,null))['catch'](handleError(_0x10dd3e,null));};
\ No newline at end of file
+var _0x68fd=['desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','save','then','destroy','sendStatus','stack','name','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','filter','merge','VIRTUAL','options','ChatQueueReport','include','catch','keys','includeAll','create','body','update','find','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x68fd,0x1e9));var _0xd68f=function(_0x19e211,_0x35e384){_0x19e211=_0x19e211-0x0;var _0x25973f=_0x68fd[_0x19e211];return _0x25973f;};'use strict';var emlformat=require(_0xd68f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd68f('0x1'));var jsonpatch=require(_0xd68f('0x2'));var rp=require('request-promise');var moment=require(_0xd68f('0x3'));var BPromise=require(_0xd68f('0x4'));var Mustache=require(_0xd68f('0x5'));var util=require(_0xd68f('0x6'));var path=require(_0xd68f('0x7'));var sox=require(_0xd68f('0x8'));var csv=require(_0xd68f('0x9'));var ejs=require(_0xd68f('0xa'));var fs=require('fs');var fs_extra=require(_0xd68f('0xb'));var _=require('lodash');var squel=require(_0xd68f('0xc'));var crypto=require(_0xd68f('0xd'));var jsforce=require(_0xd68f('0xe'));var deskjs=require(_0xd68f('0xf'));var toCsv=require(_0xd68f('0x9'));var querystring=require(_0xd68f('0x10'));var Papa=require(_0xd68f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd68f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd68f('0x13'));var logger=require(_0xd68f('0x14'))(_0xd68f('0x15'));var utils=require(_0xd68f('0x16'));var config=require(_0xd68f('0x17'));var licenseUtil=require(_0xd68f('0x18'));var db=require(_0xd68f('0x19'))['db'];function respondWithStatusCode(_0x52601f,_0x518883){_0x518883=_0x518883||0xcc;return function(_0x4b0be6){if(_0x4b0be6){return _0x52601f['sendStatus'](_0x518883);}return _0x52601f[_0xd68f('0x1a')](_0x518883)[_0xd68f('0x1b')]();};}function respondWithResult(_0x48f357,_0x9dbc9b){_0x9dbc9b=_0x9dbc9b||0xc8;return function(_0x8297c){if(_0x8297c){return _0x48f357[_0xd68f('0x1a')](_0x9dbc9b)[_0xd68f('0x1c')](_0x8297c);}};}function respondWithFilteredResult(_0x3a5bb2,_0x9a7fc6){return function(_0x203b3c){if(_0x203b3c){var _0x53aed0=typeof _0x9a7fc6[_0xd68f('0x1d')]==='undefined'&&typeof _0x9a7fc6['limit']===_0xd68f('0x1e');var _0x3115f3=_0x203b3c[_0xd68f('0x1f')];var _0x3fdfbf=_0x53aed0?0x0:_0x9a7fc6[_0xd68f('0x1d')];var _0xb01ed=_0x53aed0?_0x203b3c[_0xd68f('0x1f')]:_0x9a7fc6['offset']+_0x9a7fc6['limit'];var _0x14435f;if(_0xb01ed>=_0x3115f3){_0xb01ed=_0x3115f3;_0x14435f=0xc8;}else{_0x14435f=0xce;}_0x3a5bb2[_0xd68f('0x1a')](_0x14435f);return _0x3a5bb2[_0xd68f('0x20')](_0xd68f('0x21'),_0x3fdfbf+'-'+_0xb01ed+'/'+_0x3115f3)[_0xd68f('0x1c')](_0x203b3c);}return null;};}function patchUpdates(_0x4c192f){return function(_0x17d291){try{jsonpatch[_0xd68f('0x22')](_0x17d291,_0x4c192f,!![]);}catch(_0x3fbc0b){return BPromise['reject'](_0x3fbc0b);}return _0x17d291[_0xd68f('0x23')]();};}function saveUpdates(_0x1379e2,_0xeba444){return function(_0x590e04){if(_0x590e04){return _0x590e04['update'](_0x1379e2)[_0xd68f('0x24')](function(_0x5a3683){return _0x5a3683;});}return null;};}function removeEntity(_0x563cd3,_0x3cf02f){return function(_0x1ef099){if(_0x1ef099){return _0x1ef099[_0xd68f('0x25')]()[_0xd68f('0x24')](function(){_0x563cd3[_0xd68f('0x1a')](0xcc)[_0xd68f('0x1b')]();});}};}function handleEntityNotFound(_0x169dea,_0x277605){return function(_0xaceeb8){if(!_0xaceeb8){_0x169dea[_0xd68f('0x26')](0x194);}return _0xaceeb8;};}function handleError(_0x797b09,_0xea228d){_0xea228d=_0xea228d||0x1f4;return function(_0xee7d9d){logger['error'](_0xee7d9d[_0xd68f('0x27')]);if(_0xee7d9d[_0xd68f('0x28')]){delete _0xee7d9d['name'];}_0x797b09[_0xd68f('0x1a')](_0xea228d)['send'](_0xee7d9d);};}exports['index']=function(_0xcfadd4,_0x42f8d2){var _0x1eaebc={},_0x52a2dc={},_0xfee91c={'count':0x0,'rows':[]};var _0x4d3d2f=_[_0xd68f('0x29')](db['ChatQueueReport'][_0xd68f('0x2a')],function(_0x2dd737){return{'name':_0x2dd737[_0xd68f('0x2b')],'type':_0x2dd737[_0xd68f('0x2c')][_0xd68f('0x2d')]};});_0x52a2dc['model']=_[_0xd68f('0x29')](_0x4d3d2f,'name');_0x52a2dc[_0xd68f('0x2e')]=_['keys'](_0xcfadd4[_0xd68f('0x2e')]);_0x52a2dc[_0xd68f('0x2f')]=_[_0xd68f('0x30')](_0x52a2dc[_0xd68f('0x31')],_0x52a2dc['query']);_0x1eaebc[_0xd68f('0x32')]=_[_0xd68f('0x30')](_0x52a2dc[_0xd68f('0x31')],qs[_0xd68f('0x33')](_0xcfadd4['query'][_0xd68f('0x33')]));_0x1eaebc[_0xd68f('0x32')]=_0x1eaebc[_0xd68f('0x32')][_0xd68f('0x34')]?_0x1eaebc[_0xd68f('0x32')]:_0x52a2dc[_0xd68f('0x31')];if(!_0xcfadd4[_0xd68f('0x2e')][_0xd68f('0x35')]('nolimit')){_0x1eaebc[_0xd68f('0x36')]=qs[_0xd68f('0x36')](_0xcfadd4[_0xd68f('0x2e')][_0xd68f('0x36')]);_0x1eaebc[_0xd68f('0x1d')]=qs[_0xd68f('0x1d')](_0xcfadd4[_0xd68f('0x2e')][_0xd68f('0x1d')]);}_0x1eaebc['order']=qs[_0xd68f('0x37')](_0xcfadd4[_0xd68f('0x2e')][_0xd68f('0x37')]);_0x1eaebc[_0xd68f('0x38')]=qs[_0xd68f('0x2f')](_['pick'](_0xcfadd4[_0xd68f('0x2e')],_0x52a2dc[_0xd68f('0x2f')]),_0x4d3d2f);if(_0xcfadd4[_0xd68f('0x2e')][_0xd68f('0x39')]){_0x1eaebc[_0xd68f('0x38')]=_[_0xd68f('0x3a')](_0x1eaebc[_0xd68f('0x38')],{'$or':_[_0xd68f('0x29')](_0x4d3d2f,function(_0x582b38){if(_0x582b38[_0xd68f('0x2c')]!==_0xd68f('0x3b')){var _0x46c1be={};_0x46c1be[_0x582b38[_0xd68f('0x28')]]={'$like':'%'+_0xcfadd4[_0xd68f('0x2e')][_0xd68f('0x39')]+'%'};return _0x46c1be;}})});}_0x1eaebc=_['merge']({},_0x1eaebc,_0xcfadd4[_0xd68f('0x3c')]);var _0xb89fd3={'where':_0x1eaebc[_0xd68f('0x38')]};return db[_0xd68f('0x3d')][_0xd68f('0x1f')](_0xb89fd3)[_0xd68f('0x24')](function(_0x54cd1e){_0xfee91c[_0xd68f('0x1f')]=_0x54cd1e;if(_0xcfadd4[_0xd68f('0x2e')]['includeAll']){_0x1eaebc[_0xd68f('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x1eaebc);})[_0xd68f('0x24')](function(_0x2016f1){_0xfee91c['rows']=_0x2016f1;return _0xfee91c;})[_0xd68f('0x24')](respondWithFilteredResult(_0x42f8d2,_0x1eaebc))[_0xd68f('0x3f')](handleError(_0x42f8d2,null));};exports['show']=function(_0x66b7a0,_0x2e1a2e){var _0x3d2dac={'raw':!![],'where':{'id':_0x66b7a0['params']['id']}},_0x645928={};_0x645928['model']=_['keys'](db[_0xd68f('0x3d')][_0xd68f('0x2a')]);_0x645928[_0xd68f('0x2e')]=_[_0xd68f('0x40')](_0x66b7a0[_0xd68f('0x2e')]);_0x645928[_0xd68f('0x2f')]=_[_0xd68f('0x30')](_0x645928[_0xd68f('0x31')],_0x645928[_0xd68f('0x2e')]);_0x3d2dac[_0xd68f('0x32')]=_[_0xd68f('0x30')](_0x645928['model'],qs['fields'](_0x66b7a0[_0xd68f('0x2e')][_0xd68f('0x33')]));_0x3d2dac[_0xd68f('0x32')]=_0x3d2dac[_0xd68f('0x32')][_0xd68f('0x34')]?_0x3d2dac[_0xd68f('0x32')]:_0x645928['model'];if(_0x66b7a0[_0xd68f('0x2e')][_0xd68f('0x41')]){_0x3d2dac[_0xd68f('0x3e')]=[{'all':!![]}];}_0x3d2dac=_[_0xd68f('0x3a')]({},_0x3d2dac,_0x66b7a0[_0xd68f('0x3c')]);return db[_0xd68f('0x3d')]['find'](_0x3d2dac)[_0xd68f('0x24')](handleEntityNotFound(_0x2e1a2e,null))[_0xd68f('0x24')](respondWithResult(_0x2e1a2e,null))[_0xd68f('0x3f')](handleError(_0x2e1a2e,null));};exports[_0xd68f('0x42')]=function(_0x6e90a1,_0x314c18){return db[_0xd68f('0x3d')][_0xd68f('0x42')](_0x6e90a1[_0xd68f('0x43')],{})['then'](respondWithResult(_0x314c18,0xc9))[_0xd68f('0x3f')](handleError(_0x314c18,null));};exports[_0xd68f('0x44')]=function(_0xd98ba2,_0x5bfd21){if(_0xd98ba2[_0xd68f('0x43')]['id']){delete _0xd98ba2[_0xd68f('0x43')]['id'];}return db[_0xd68f('0x3d')][_0xd68f('0x45')]({'where':{'id':_0xd98ba2[_0xd68f('0x46')]['id']}})['then'](handleEntityNotFound(_0x5bfd21,null))['then'](saveUpdates(_0xd98ba2['body'],null))[_0xd68f('0x24')](respondWithResult(_0x5bfd21,null))[_0xd68f('0x3f')](handleError(_0x5bfd21,null));};exports['destroy']=function(_0x1f4bc6,_0x41bde1){return db[_0xd68f('0x3d')][_0xd68f('0x45')]({'where':{'id':_0x1f4bc6[_0xd68f('0x46')]['id']}})[_0xd68f('0x24')](handleEntityNotFound(_0x41bde1,null))[_0xd68f('0x24')](removeEntity(_0x41bde1,null))[_0xd68f('0x3f')](handleError(_0x41bde1,null));};exports[_0xd68f('0x47')]=function(_0x51b954,_0x28fb40){return db[_0xd68f('0x3d')][_0xd68f('0x47')]()[_0xd68f('0x24')](respondWithResult(_0x28fb40,null))[_0xd68f('0x3f')](handleError(_0x28fb40,null));};
\ No newline at end of file
index abbb32d..1735566 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x2b70f8,_0x361789){var _0x2f741e=function(_0x50d901){while(--_0x50d901){_0x2b70f8['push'](_0x2b70f8['shift']());}};_0x2f741e(++_0x361789);}(_0xb10b,0x12a));var _0xbb10=function(_0x4aa662,_0x1cc90c){_0x4aa662=_0x4aa662-0x0;var _0x336478=_0xb10b[_0x4aa662];return _0x336478;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x3fb214,_0x428d93){var _0x38d89c=function(_0x468ce9){while(--_0x468ce9){_0x3fb214['push'](_0x3fb214['shift']());}};_0x38d89c(++_0x428d93);}(_0xe706,0xa3));var _0x6e70=function(_0x197b38,_0x394a4d){_0x197b38=_0x197b38-0x0;var _0x20a23a=_0xe706[_0x197b38];return _0x20a23a;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 0b5e291..2a0e127 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ac6=['options','raw','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body'];(function(_0x4b038c,_0x57f2b4){var _0x1b9fe8=function(_0x30c9e0){while(--_0x30c9e0){_0x4b038c['push'](_0x4b038c['shift']());}};_0x1b9fe8(++_0x57f2b4);}(_0x9ac6,0x120));var _0x69ac=function(_0x49e130,_0x75a7e7){_0x49e130=_0x49e130-0x0;var _0x5e86eb=_0x9ac6[_0x49e130];return _0x5e86eb;};'use strict';var _=require(_0x69ac('0x0'));var util=require(_0x69ac('0x1'));var moment=require(_0x69ac('0x2'));var BPromise=require(_0x69ac('0x3'));var rs=require(_0x69ac('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69ac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x69ac('0x6'))(_0x69ac('0x7'));var config=require(_0x69ac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x69ac('0x9')][_0x69ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2db475,_0x29a38f,_0x4f5878){return new BPromise(function(_0x41ee01,_0x32391e){return client[_0x69ac('0xb')](_0x2db475,_0x4f5878)[_0x69ac('0xc')](function(_0x3505f2){logger[_0x69ac('0xd')](_0x69ac('0xe'),_0x29a38f,_0x69ac('0xf'));logger[_0x69ac('0x10')](_0x69ac('0x11'),_0x29a38f,'request\x20sent',JSON[_0x69ac('0x12')](_0x3505f2));if(_0x3505f2[_0x69ac('0x13')]){if(_0x3505f2[_0x69ac('0x13')][_0x69ac('0x14')]===0x1f4){logger[_0x69ac('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x29a38f,_0x3505f2[_0x69ac('0x13')][_0x69ac('0x15')]);return _0x32391e(_0x3505f2['error'][_0x69ac('0x15')]);}logger[_0x69ac('0x13')](_0x69ac('0xe'),_0x29a38f,_0x3505f2[_0x69ac('0x13')][_0x69ac('0x15')]);return _0x41ee01(_0x3505f2[_0x69ac('0x13')]['message']);}else{logger[_0x69ac('0xd')](_0x69ac('0xe'),_0x29a38f,_0x69ac('0xf'));_0x41ee01(_0x3505f2[_0x69ac('0x16')][_0x69ac('0x15')]);}})[_0x69ac('0x17')](function(_0x4d741d){logger[_0x69ac('0x13')](_0x69ac('0xe'),_0x29a38f,_0x4d741d);_0x32391e(_0x4d741d);});});}exports[_0x69ac('0x18')]=function(_0x4963ba){var _0x57df9a=this;return new Promise(function(_0x4a1950,_0x5e12cd){return db['ChatQueueReport'][_0x69ac('0x19')](_0x4963ba[_0x69ac('0x1a')],{'raw':_0x4963ba[_0x69ac('0x1b')]?_0x4963ba[_0x69ac('0x1b')][_0x69ac('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x802c5e){logger[_0x69ac('0xd')](_0x69ac('0x18'),_0x4963ba);logger[_0x69ac('0x10')]('CreateChatQueueReport',_0x4963ba,JSON[_0x69ac('0x12')](_0x802c5e));_0x4a1950(_0x802c5e);})['catch'](function(_0x48d98c){logger['error']('CreateChatQueueReport',_0x48d98c['message'],_0x4963ba);_0x5e12cd(_0x57df9a[_0x69ac('0x13')](0x1f4,_0x48d98c['message']));});});};exports[_0x69ac('0x1d')]=function(_0x5c53c2){var _0x4d4c17=this;return new Promise(function(_0x1c7c7d,_0x28782e){return db[_0x69ac('0x1e')][_0x69ac('0x1f')](_0x5c53c2[_0x69ac('0x1a')],{'raw':_0x5c53c2['options']?_0x5c53c2[_0x69ac('0x1b')][_0x69ac('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c53c2['options']?_0x5c53c2[_0x69ac('0x1b')][_0x69ac('0x20')]||null:null,'attributes':_0x5c53c2[_0x69ac('0x1b')]?_0x5c53c2['options'][_0x69ac('0x21')]||null:null,'limit':_0x5c53c2[_0x69ac('0x1b')]?_0x5c53c2[_0x69ac('0x1b')][_0x69ac('0x22')]||null:null})['then'](function(_0xdc4b40){logger[_0x69ac('0xd')](_0x69ac('0x1d'),_0x5c53c2);logger[_0x69ac('0x10')](_0x69ac('0x1d'),_0x5c53c2,JSON[_0x69ac('0x12')](_0xdc4b40));_0x1c7c7d(_0xdc4b40);})[_0x69ac('0x17')](function(_0x4bd1bf){logger[_0x69ac('0x13')]('UpdateChatQueueReport',_0x4bd1bf['message'],_0x5c53c2);_0x28782e(_0x4d4c17[_0x69ac('0x13')](0x1f4,_0x4bd1bf[_0x69ac('0x15')]));});});};
\ No newline at end of file
+var _0xf05c=['../../config/environment','jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body','options','UpdateChatQueueReport','ChatQueueReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xf05c,0x122));var _0xcf05=function(_0xf2eacb,_0x3b0fb0){_0xf2eacb=_0xf2eacb-0x0;var _0x25a3b4=_0xf05c[_0xf2eacb];return _0x25a3b4;};'use strict';var _=require(_0xcf05('0x0'));var util=require(_0xcf05('0x1'));var moment=require(_0xcf05('0x2'));var BPromise=require(_0xcf05('0x3'));var rs=require(_0xcf05('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf05('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcf05('0x6'));var config=require(_0xcf05('0x7'));var jayson=require(_0xcf05('0x8'));var client=jayson['client'][_0xcf05('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d8a3,_0x4ad9c9,_0x447fe4){return new BPromise(function(_0x153488,_0x41a790){return client['request'](_0x55d8a3,_0x447fe4)[_0xcf05('0xa')](function(_0x15c761){logger[_0xcf05('0xb')](_0xcf05('0xc'),_0x4ad9c9,'request\x20sent');logger[_0xcf05('0xd')](_0xcf05('0xe'),_0x4ad9c9,_0xcf05('0xf'),JSON[_0xcf05('0x10')](_0x15c761));if(_0x15c761[_0xcf05('0x11')]){if(_0x15c761[_0xcf05('0x11')][_0xcf05('0x12')]===0x1f4){logger[_0xcf05('0x11')](_0xcf05('0xc'),_0x4ad9c9,_0x15c761[_0xcf05('0x11')]['message']);return _0x41a790(_0x15c761[_0xcf05('0x11')][_0xcf05('0x13')]);}logger[_0xcf05('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x4ad9c9,_0x15c761[_0xcf05('0x11')][_0xcf05('0x13')]);return _0x153488(_0x15c761[_0xcf05('0x11')][_0xcf05('0x13')]);}else{logger[_0xcf05('0xb')](_0xcf05('0xc'),_0x4ad9c9,'request\x20sent');_0x153488(_0x15c761[_0xcf05('0x14')][_0xcf05('0x13')]);}})[_0xcf05('0x15')](function(_0xb58473){logger[_0xcf05('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x4ad9c9,_0xb58473);_0x41a790(_0xb58473);});});}exports[_0xcf05('0x16')]=function(_0x15484d){var _0xb33c17=this;return new Promise(function(_0x31cfd1,_0x553114){return db['ChatQueueReport'][_0xcf05('0x17')](_0x15484d[_0xcf05('0x18')],{'raw':_0x15484d['options']?_0x15484d[_0xcf05('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xcf05('0xa')](function(_0x5d8147){logger[_0xcf05('0xb')](_0xcf05('0x16'),_0x15484d);logger['debug'](_0xcf05('0x16'),_0x15484d,JSON[_0xcf05('0x10')](_0x5d8147));_0x31cfd1(_0x5d8147);})[_0xcf05('0x15')](function(_0x4dd1da){logger[_0xcf05('0x11')](_0xcf05('0x16'),_0x4dd1da[_0xcf05('0x13')],_0x15484d);_0x553114(_0xb33c17[_0xcf05('0x11')](0x1f4,_0x4dd1da['message']));});});};exports[_0xcf05('0x1a')]=function(_0x362a50){var _0x1d0749=this;return new Promise(function(_0x1299b8,_0x52b694){return db[_0xcf05('0x1b')][_0xcf05('0x1c')](_0x362a50[_0xcf05('0x18')],{'raw':_0x362a50[_0xcf05('0x19')]?_0x362a50[_0xcf05('0x19')][_0xcf05('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x362a50[_0xcf05('0x19')]?_0x362a50[_0xcf05('0x19')][_0xcf05('0x1e')]||null:null,'attributes':_0x362a50['options']?_0x362a50['options'][_0xcf05('0x1f')]||null:null,'limit':_0x362a50[_0xcf05('0x19')]?_0x362a50[_0xcf05('0x19')][_0xcf05('0x20')]||null:null})[_0xcf05('0xa')](function(_0x290591){logger[_0xcf05('0xb')](_0xcf05('0x1a'),_0x362a50);logger[_0xcf05('0xd')]('UpdateChatQueueReport',_0x362a50,JSON['stringify'](_0x290591));_0x1299b8(_0x290591);})['catch'](function(_0x42460f){logger[_0xcf05('0x11')](_0xcf05('0x1a'),_0x42460f[_0xcf05('0x13')],_0x362a50);_0x52b694(_0x1d0749[_0xcf05('0x11')](0x1f4,_0x42460f['message']));});});};
\ No newline at end of file
index 22ecb2a..d844141 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0826=['post','create','put','update','delete','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0826,0xcd));var _0x6082=function(_0x382410,_0x3f67c9){_0x382410=_0x382410-0x0;var _0x1a603d=_0x0826[_0x382410];return _0x1a603d;};'use strict';var multer=require(_0x6082('0x0'));var util=require(_0x6082('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6082('0x2'));var router=express[_0x6082('0x3')]();var fs_extra=require(_0x6082('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6082('0x5'));var config=require(_0x6082('0x6'));var controller=require(_0x6082('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6082('0x8')]);router[_0x6082('0x9')](_0x6082('0xa'),auth[_0x6082('0xb')](),controller[_0x6082('0xc')]);router[_0x6082('0x9')](_0x6082('0xd'),auth['isAuthenticated'](),controller[_0x6082('0xe')]);router[_0x6082('0xf')]('/',auth['isAuthenticated'](),controller[_0x6082('0x10')]);router[_0x6082('0x11')](_0x6082('0xd'),auth[_0x6082('0xb')](),controller[_0x6082('0x12')]);router[_0x6082('0x13')](_0x6082('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe2e5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','describe','get','/:id','show','post','create','update','delete','destroy','exports','path','express'];(function(_0x1744e1,_0x1d5cd9){var _0x5166a0=function(_0x5f28dd){while(--_0x5f28dd){_0x1744e1['push'](_0x1744e1['shift']());}};_0x5166a0(++_0x1d5cd9);}(_0xe2e5,0x1ae));var _0x5e2e=function(_0x343a85,_0x22aa4f){_0x343a85=_0x343a85-0x0;var _0x53cb93=_0xe2e5[_0x343a85];return _0x53cb93;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5e2e('0x0'));var timeout=require('connect-timeout');var express=require(_0x5e2e('0x1'));var router=express[_0x5e2e('0x2')]();var fs_extra=require(_0x5e2e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5e2e('0x4'));var config=require(_0x5e2e('0x5'));var controller=require(_0x5e2e('0x6'));router['get']('/',auth[_0x5e2e('0x7')](),controller['index']);router['get']('/describe',auth[_0x5e2e('0x7')](),controller[_0x5e2e('0x8')]);router[_0x5e2e('0x9')](_0x5e2e('0xa'),auth[_0x5e2e('0x7')](),controller[_0x5e2e('0xb')]);router[_0x5e2e('0xc')]('/',auth['isAuthenticated'](),controller[_0x5e2e('0xd')]);router['put'](_0x5e2e('0xa'),auth[_0x5e2e('0x7')](),controller[_0x5e2e('0xe')]);router[_0x5e2e('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x5e2e('0x10')]);module[_0x5e2e('0x11')]=router;
\ No newline at end of file
index cd11f5c..e4bd355 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x3feeec,_0x1bc0c8){var _0x2fcc54=function(_0x88a3f){while(--_0x88a3f){_0x3feeec['push'](_0x3feeec['shift']());}};_0x2fcc54(++_0x1bc0c8);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x00bb[_0x1d9aa0];return _0x226868;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0xb43b,0x1b2));var _0xbb43=function(_0xedfdf8,_0x222ee6){_0xedfdf8=_0xedfdf8-0x0;var _0x3e8d4c=_0xb43b[_0xedfdf8];return _0x3e8d4c;};'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 84d9d0f..b4e8aa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae2e=['to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox'];(function(_0x30b85d,_0x3dbb26){var _0x38b87f=function(_0x5e4fef){while(--_0x5e4fef){_0x30b85d['push'](_0x30b85d['shift']());}};_0x38b87f(++_0x3dbb26);}(_0xae2e,0x17e));var _0xeae2=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xae2e[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xeae2('0x0'));var rimraf=require(_0xeae2('0x1'));var zipdir=require(_0xeae2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeae2('0x3'));var BPromise=require(_0xeae2('0x4'));var Mustache=require('mustache');var util=require(_0xeae2('0x5'));var path=require(_0xeae2('0x6'));var sox=require(_0xeae2('0x7'));var csv=require(_0xeae2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeae2('0x9'));var _=require(_0xeae2('0xa'));var squel=require(_0xeae2('0xb'));var crypto=require('crypto');var jsforce=require(_0xeae2('0xc'));var deskjs=require(_0xeae2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xeae2('0xe'));var Papa=require('papaparse');var Redis=require(_0xeae2('0xf'));var authService=require(_0xeae2('0x10'));var qs=require(_0xeae2('0x11'));var as=require(_0xeae2('0x12'));var hardwareService=require(_0xeae2('0x13'));var logger=require(_0xeae2('0x14'))(_0xeae2('0x15'));var utils=require(_0xeae2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeae2('0x17'));var db=require(_0xeae2('0x18'))['db'];function respondWithStatusCode(_0xd4e7e8,_0x1491fc){_0x1491fc=_0x1491fc||0xcc;return function(_0x2e7a6b){if(_0x2e7a6b){return _0xd4e7e8[_0xeae2('0x19')](_0x1491fc);}return _0xd4e7e8[_0xeae2('0x1a')](_0x1491fc)[_0xeae2('0x1b')]();};}function respondWithResult(_0x4e1236,_0x58553c){_0x58553c=_0x58553c||0xc8;return function(_0x1caa39){if(_0x1caa39){return _0x4e1236[_0xeae2('0x1a')](_0x58553c)[_0xeae2('0x1c')](_0x1caa39);}};}function respondWithFilteredResult(_0x4f5b14,_0x590f8b){return function(_0x4871f4){if(_0x4871f4){var _0x16a6cb=typeof _0x590f8b[_0xeae2('0x1d')]===_0xeae2('0x1e')&&typeof _0x590f8b['limit']==='undefined';var _0x5a8a57=_0x4871f4[_0xeae2('0x1f')];var _0x5ebb74=_0x16a6cb?0x0:_0x590f8b[_0xeae2('0x1d')];var _0x1774d9=_0x16a6cb?_0x4871f4[_0xeae2('0x1f')]:_0x590f8b['offset']+_0x590f8b['limit'];var _0x2084f2;if(_0x1774d9>=_0x5a8a57){_0x1774d9=_0x5a8a57;_0x2084f2=0xc8;}else{_0x2084f2=0xce;}_0x4f5b14['status'](_0x2084f2);return _0x4f5b14[_0xeae2('0x20')](_0xeae2('0x21'),_0x5ebb74+'-'+_0x1774d9+'/'+_0x5a8a57)['json'](_0x4871f4);}return null;};}function patchUpdates(_0x2b838f){return function(_0x2e8019){try{jsonpatch[_0xeae2('0x22')](_0x2e8019,_0x2b838f,!![]);}catch(_0x1115e6){return BPromise[_0xeae2('0x23')](_0x1115e6);}return _0x2e8019[_0xeae2('0x24')]();};}function saveUpdates(_0x52f73e,_0x4263e8){return function(_0x12b828){if(_0x12b828){return _0x12b828[_0xeae2('0x25')](_0x52f73e)[_0xeae2('0x26')](function(_0x5e5eca){return _0x5e5eca;});}return null;};}function removeEntity(_0x516dc3,_0x4f083e){return function(_0x46f7fd){if(_0x46f7fd){return _0x46f7fd['destroy']()[_0xeae2('0x26')](function(){_0x516dc3[_0xeae2('0x1a')](0xcc)[_0xeae2('0x1b')]();});}};}function handleEntityNotFound(_0x1476bb,_0x290abd){return function(_0x7ff416){if(!_0x7ff416){_0x1476bb[_0xeae2('0x19')](0x194);}return _0x7ff416;};}function handleError(_0x2b6800,_0x432f8b){_0x432f8b=_0x432f8b||0x1f4;return function(_0x5060c3){logger[_0xeae2('0x27')](_0x5060c3[_0xeae2('0x28')]);if(_0x5060c3['name']){delete _0x5060c3[_0xeae2('0x29')];}_0x2b6800[_0xeae2('0x1a')](_0x432f8b)[_0xeae2('0x2a')](_0x5060c3);};}exports[_0xeae2('0x2b')]=function(_0x272966,_0x1f98e4){var _0x556271={},_0x14ea44={},_0x3f2036={'count':0x0,'rows':[]};var _0x4e99de=_[_0xeae2('0x2c')](db[_0xeae2('0x2d')][_0xeae2('0x2e')],function(_0x2d8941){return{'name':_0x2d8941[_0xeae2('0x2f')],'type':_0x2d8941[_0xeae2('0x30')]['key']};});_0x14ea44['model']=_[_0xeae2('0x2c')](_0x4e99de,_0xeae2('0x29'));_0x14ea44['query']=_[_0xeae2('0x31')](_0x272966[_0xeae2('0x32')]);_0x14ea44[_0xeae2('0x33')]=_[_0xeae2('0x34')](_0x14ea44[_0xeae2('0x35')],_0x14ea44[_0xeae2('0x32')]);_0x556271[_0xeae2('0x36')]=_[_0xeae2('0x34')](_0x14ea44[_0xeae2('0x35')],qs[_0xeae2('0x37')](_0x272966[_0xeae2('0x32')][_0xeae2('0x37')]));_0x556271['attributes']=_0x556271[_0xeae2('0x36')][_0xeae2('0x38')]?_0x556271[_0xeae2('0x36')]:_0x14ea44[_0xeae2('0x35')];if(!_0x272966['query'][_0xeae2('0x39')](_0xeae2('0x3a'))){_0x556271[_0xeae2('0x3b')]=qs[_0xeae2('0x3b')](_0x272966[_0xeae2('0x32')][_0xeae2('0x3b')]);_0x556271[_0xeae2('0x1d')]=qs[_0xeae2('0x1d')](_0x272966[_0xeae2('0x32')]['offset']);}_0x556271[_0xeae2('0x3c')]=qs['sort'](_0x272966[_0xeae2('0x32')][_0xeae2('0x3d')]);_0x556271[_0xeae2('0x3e')]=qs[_0xeae2('0x33')](_[_0xeae2('0x3f')](_0x272966['query'],_0x14ea44['filters']),_0x4e99de);if(_0x272966[_0xeae2('0x32')][_0xeae2('0x40')]){_0x556271[_0xeae2('0x3e')]=_[_0xeae2('0x41')](_0x556271[_0xeae2('0x3e')],{'$or':_['map'](_0x4e99de,function(_0x5a5218){if(_0x5a5218[_0xeae2('0x30')]!==_0xeae2('0x42')){var _0xa330bf={};_0xa330bf[_0x5a5218[_0xeae2('0x29')]]={'$like':'%'+_0x272966[_0xeae2('0x32')][_0xeae2('0x40')]+'%'};return _0xa330bf;}})});}_0x556271=_[_0xeae2('0x41')]({},_0x556271,_0x272966['options']);var _0x14bb5d={'where':_0x556271[_0xeae2('0x3e')]};return db[_0xeae2('0x2d')]['count'](_0x14bb5d)[_0xeae2('0x26')](function(_0x4e0da6){_0x3f2036['count']=_0x4e0da6;if(_0x272966[_0xeae2('0x32')][_0xeae2('0x43')]){_0x556271['include']=[{'all':!![]}];}return db[_0xeae2('0x2d')][_0xeae2('0x44')](_0x556271);})[_0xeae2('0x26')](function(_0x2b8bff){_0x3f2036['rows']=_0x2b8bff;return _0x3f2036;})['then'](respondWithFilteredResult(_0x1f98e4,_0x556271))[_0xeae2('0x45')](handleError(_0x1f98e4,null));};exports[_0xeae2('0x46')]=function(_0x4d795b,_0x4fa9ad){var _0x389f6c={'raw':!![],'where':{'id':_0x4d795b[_0xeae2('0x47')]['id']}},_0xc52ef={};_0xc52ef[_0xeae2('0x35')]=_[_0xeae2('0x31')](db['ChatTransferReport']['rawAttributes']);_0xc52ef[_0xeae2('0x32')]=_['keys'](_0x4d795b[_0xeae2('0x32')]);_0xc52ef['filters']=_['intersection'](_0xc52ef[_0xeae2('0x35')],_0xc52ef[_0xeae2('0x32')]);_0x389f6c[_0xeae2('0x36')]=_['intersection'](_0xc52ef['model'],qs[_0xeae2('0x37')](_0x4d795b[_0xeae2('0x32')][_0xeae2('0x37')]));_0x389f6c[_0xeae2('0x36')]=_0x389f6c[_0xeae2('0x36')][_0xeae2('0x38')]?_0x389f6c[_0xeae2('0x36')]:_0xc52ef['model'];if(_0x4d795b[_0xeae2('0x32')][_0xeae2('0x43')]){_0x389f6c[_0xeae2('0x48')]=[{'all':!![]}];}_0x389f6c=_[_0xeae2('0x41')]({},_0x389f6c,_0x4d795b[_0xeae2('0x49')]);return db[_0xeae2('0x2d')][_0xeae2('0x4a')](_0x389f6c)['then'](handleEntityNotFound(_0x4fa9ad,null))[_0xeae2('0x26')](respondWithResult(_0x4fa9ad,null))[_0xeae2('0x45')](handleError(_0x4fa9ad,null));};exports['create']=function(_0xbad9f8,_0x81bee0){return db[_0xeae2('0x2d')][_0xeae2('0x4b')](_0xbad9f8[_0xeae2('0x4c')],{})[_0xeae2('0x26')](respondWithResult(_0x81bee0,0xc9))[_0xeae2('0x45')](handleError(_0x81bee0,null));};exports[_0xeae2('0x25')]=function(_0x1fb98c,_0x1b321b){if(_0x1fb98c[_0xeae2('0x4c')]['id']){delete _0x1fb98c[_0xeae2('0x4c')]['id'];}return db[_0xeae2('0x2d')]['find']({'where':{'id':_0x1fb98c[_0xeae2('0x47')]['id']}})[_0xeae2('0x26')](handleEntityNotFound(_0x1b321b,null))[_0xeae2('0x26')](saveUpdates(_0x1fb98c[_0xeae2('0x4c')],null))['then'](respondWithResult(_0x1b321b,null))[_0xeae2('0x45')](handleError(_0x1b321b,null));};exports['destroy']=function(_0x4b1bdf,_0x203eae){return db[_0xeae2('0x2d')][_0xeae2('0x4a')]({'where':{'id':_0x4b1bdf[_0xeae2('0x47')]['id']}})['then'](handleEntityNotFound(_0x203eae,null))[_0xeae2('0x26')](removeEntity(_0x203eae,null))[_0xeae2('0x45')](handleError(_0x203eae,null));};exports[_0xeae2('0x4d')]=function(_0x2c9f3d,_0x5387e1){return db[_0xeae2('0x2d')][_0xeae2('0x4d')]()[_0xeae2('0x26')](respondWithResult(_0x5387e1,null))[_0xeae2('0x45')](handleError(_0x5387e1,null));};
\ No newline at end of file
+var _0x1134=['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','destroy','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1134,0x124));var _0x4113=function(_0x114abd,_0x2b4a83){_0x114abd=_0x114abd-0x0;var _0x5d6904=_0x1134[_0x114abd];return _0x5d6904;};'use strict';var emlformat=require(_0x4113('0x0'));var rimraf=require(_0x4113('0x1'));var zipdir=require(_0x4113('0x2'));var jsonpatch=require(_0x4113('0x3'));var rp=require(_0x4113('0x4'));var moment=require(_0x4113('0x5'));var BPromise=require(_0x4113('0x6'));var Mustache=require(_0x4113('0x7'));var util=require(_0x4113('0x8'));var path=require(_0x4113('0x9'));var sox=require('sox');var csv=require(_0x4113('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4113('0xb'));var squel=require('squel');var crypto=require(_0x4113('0xc'));var jsforce=require(_0x4113('0xd'));var deskjs=require(_0x4113('0xe'));var toCsv=require(_0x4113('0xa'));var querystring=require(_0x4113('0xf'));var Papa=require('papaparse');var Redis=require(_0x4113('0x10'));var authService=require(_0x4113('0x11'));var qs=require(_0x4113('0x12'));var as=require(_0x4113('0x13'));var hardwareService=require(_0x4113('0x14'));var logger=require(_0x4113('0x15'))(_0x4113('0x16'));var utils=require(_0x4113('0x17'));var config=require(_0x4113('0x18'));var licenseUtil=require(_0x4113('0x19'));var db=require(_0x4113('0x1a'))['db'];function respondWithStatusCode(_0x13fadf,_0x6e161e){_0x6e161e=_0x6e161e||0xcc;return function(_0x744ce7){if(_0x744ce7){return _0x13fadf[_0x4113('0x1b')](_0x6e161e);}return _0x13fadf[_0x4113('0x1c')](_0x6e161e)[_0x4113('0x1d')]();};}function respondWithResult(_0x42ea8d,_0x2cdfd4){_0x2cdfd4=_0x2cdfd4||0xc8;return function(_0x183748){if(_0x183748){return _0x42ea8d[_0x4113('0x1c')](_0x2cdfd4)[_0x4113('0x1e')](_0x183748);}};}function respondWithFilteredResult(_0x3ff39e,_0x424261){return function(_0x1ac352){if(_0x1ac352){var _0x387358=typeof _0x424261[_0x4113('0x1f')]===_0x4113('0x20')&&typeof _0x424261[_0x4113('0x21')]===_0x4113('0x20');var _0xebc932=_0x1ac352['count'];var _0x2966cb=_0x387358?0x0:_0x424261[_0x4113('0x1f')];var _0x146353=_0x387358?_0x1ac352[_0x4113('0x22')]:_0x424261[_0x4113('0x1f')]+_0x424261[_0x4113('0x21')];var _0x172ca6;if(_0x146353>=_0xebc932){_0x146353=_0xebc932;_0x172ca6=0xc8;}else{_0x172ca6=0xce;}_0x3ff39e[_0x4113('0x1c')](_0x172ca6);return _0x3ff39e[_0x4113('0x23')](_0x4113('0x24'),_0x2966cb+'-'+_0x146353+'/'+_0xebc932)[_0x4113('0x1e')](_0x1ac352);}return null;};}function patchUpdates(_0x3cda82){return function(_0x10df93){try{jsonpatch[_0x4113('0x25')](_0x10df93,_0x3cda82,!![]);}catch(_0x53c997){return BPromise[_0x4113('0x26')](_0x53c997);}return _0x10df93[_0x4113('0x27')]();};}function saveUpdates(_0x45a489,_0x33b103){return function(_0x894819){if(_0x894819){return _0x894819['update'](_0x45a489)['then'](function(_0x16d68b){return _0x16d68b;});}return null;};}function removeEntity(_0x5f5793,_0x58c033){return function(_0x5e22ce){if(_0x5e22ce){return _0x5e22ce[_0x4113('0x28')]()[_0x4113('0x29')](function(){_0x5f5793[_0x4113('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31d66a,_0x454380){return function(_0x4d4d4d){if(!_0x4d4d4d){_0x31d66a[_0x4113('0x1b')](0x194);}return _0x4d4d4d;};}function handleError(_0x3c9e0a,_0x3c5fcf){_0x3c5fcf=_0x3c5fcf||0x1f4;return function(_0x1f59d5){logger[_0x4113('0x2a')](_0x1f59d5[_0x4113('0x2b')]);if(_0x1f59d5[_0x4113('0x2c')]){delete _0x1f59d5['name'];}_0x3c9e0a[_0x4113('0x1c')](_0x3c5fcf)[_0x4113('0x2d')](_0x1f59d5);};}exports[_0x4113('0x2e')]=function(_0x5e3317,_0x27e10b){var _0x50e8b1={},_0x3e8e7c={},_0x21da53={'count':0x0,'rows':[]};var _0x96bf8e=_[_0x4113('0x2f')](db[_0x4113('0x30')][_0x4113('0x31')],function(_0x55d335){return{'name':_0x55d335[_0x4113('0x32')],'type':_0x55d335[_0x4113('0x33')][_0x4113('0x34')]};});_0x3e8e7c['model']=_[_0x4113('0x2f')](_0x96bf8e,_0x4113('0x2c'));_0x3e8e7c[_0x4113('0x35')]=_[_0x4113('0x36')](_0x5e3317['query']);_0x3e8e7c[_0x4113('0x37')]=_['intersection'](_0x3e8e7c[_0x4113('0x38')],_0x3e8e7c[_0x4113('0x35')]);_0x50e8b1[_0x4113('0x39')]=_[_0x4113('0x3a')](_0x3e8e7c[_0x4113('0x38')],qs[_0x4113('0x3b')](_0x5e3317[_0x4113('0x35')][_0x4113('0x3b')]));_0x50e8b1[_0x4113('0x39')]=_0x50e8b1[_0x4113('0x39')][_0x4113('0x3c')]?_0x50e8b1[_0x4113('0x39')]:_0x3e8e7c[_0x4113('0x38')];if(!_0x5e3317[_0x4113('0x35')]['hasOwnProperty']('nolimit')){_0x50e8b1['limit']=qs[_0x4113('0x21')](_0x5e3317['query'][_0x4113('0x21')]);_0x50e8b1[_0x4113('0x1f')]=qs['offset'](_0x5e3317[_0x4113('0x35')][_0x4113('0x1f')]);}_0x50e8b1['order']=qs[_0x4113('0x3d')](_0x5e3317[_0x4113('0x35')][_0x4113('0x3d')]);_0x50e8b1[_0x4113('0x3e')]=qs[_0x4113('0x37')](_[_0x4113('0x3f')](_0x5e3317[_0x4113('0x35')],_0x3e8e7c['filters']),_0x96bf8e);if(_0x5e3317[_0x4113('0x35')][_0x4113('0x40')]){_0x50e8b1[_0x4113('0x3e')]=_[_0x4113('0x41')](_0x50e8b1[_0x4113('0x3e')],{'$or':_['map'](_0x96bf8e,function(_0x101501){if(_0x101501[_0x4113('0x33')]!=='VIRTUAL'){var _0x1c0217={};_0x1c0217[_0x101501[_0x4113('0x2c')]]={'$like':'%'+_0x5e3317[_0x4113('0x35')]['filter']+'%'};return _0x1c0217;}})});}_0x50e8b1=_['merge']({},_0x50e8b1,_0x5e3317[_0x4113('0x42')]);var _0x528cca={'where':_0x50e8b1[_0x4113('0x3e')]};return db[_0x4113('0x30')][_0x4113('0x22')](_0x528cca)['then'](function(_0x4163b1){_0x21da53['count']=_0x4163b1;if(_0x5e3317[_0x4113('0x35')][_0x4113('0x43')]){_0x50e8b1[_0x4113('0x44')]=[{'all':!![]}];}return db[_0x4113('0x30')][_0x4113('0x45')](_0x50e8b1);})['then'](function(_0x5dfaad){_0x21da53[_0x4113('0x46')]=_0x5dfaad;return _0x21da53;})[_0x4113('0x29')](respondWithFilteredResult(_0x27e10b,_0x50e8b1))[_0x4113('0x47')](handleError(_0x27e10b,null));};exports[_0x4113('0x48')]=function(_0x5488e4,_0x3b87c9){var _0x500c83={'raw':!![],'where':{'id':_0x5488e4['params']['id']}},_0x2272ee={};_0x2272ee[_0x4113('0x38')]=_[_0x4113('0x36')](db[_0x4113('0x30')][_0x4113('0x31')]);_0x2272ee['query']=_[_0x4113('0x36')](_0x5488e4['query']);_0x2272ee['filters']=_['intersection'](_0x2272ee['model'],_0x2272ee[_0x4113('0x35')]);_0x500c83[_0x4113('0x39')]=_[_0x4113('0x3a')](_0x2272ee[_0x4113('0x38')],qs[_0x4113('0x3b')](_0x5488e4[_0x4113('0x35')][_0x4113('0x3b')]));_0x500c83[_0x4113('0x39')]=_0x500c83[_0x4113('0x39')]['length']?_0x500c83[_0x4113('0x39')]:_0x2272ee[_0x4113('0x38')];if(_0x5488e4[_0x4113('0x35')][_0x4113('0x43')]){_0x500c83[_0x4113('0x44')]=[{'all':!![]}];}_0x500c83=_[_0x4113('0x41')]({},_0x500c83,_0x5488e4['options']);return db[_0x4113('0x30')]['find'](_0x500c83)[_0x4113('0x29')](handleEntityNotFound(_0x3b87c9,null))[_0x4113('0x29')](respondWithResult(_0x3b87c9,null))[_0x4113('0x47')](handleError(_0x3b87c9,null));};exports['create']=function(_0xea8f94,_0x4c7536){return db['ChatTransferReport'][_0x4113('0x49')](_0xea8f94['body'],{})[_0x4113('0x29')](respondWithResult(_0x4c7536,0xc9))['catch'](handleError(_0x4c7536,null));};exports['update']=function(_0x1bebb4,_0x497120){if(_0x1bebb4['body']['id']){delete _0x1bebb4[_0x4113('0x4a')]['id'];}return db[_0x4113('0x30')][_0x4113('0x4b')]({'where':{'id':_0x1bebb4['params']['id']}})[_0x4113('0x29')](handleEntityNotFound(_0x497120,null))[_0x4113('0x29')](saveUpdates(_0x1bebb4[_0x4113('0x4a')],null))[_0x4113('0x29')](respondWithResult(_0x497120,null))[_0x4113('0x47')](handleError(_0x497120,null));};exports['destroy']=function(_0x464fae,_0x1280d0){return db[_0x4113('0x30')][_0x4113('0x4b')]({'where':{'id':_0x464fae[_0x4113('0x4c')]['id']}})[_0x4113('0x29')](handleEntityNotFound(_0x1280d0,null))[_0x4113('0x29')](removeEntity(_0x1280d0,null))[_0x4113('0x47')](handleError(_0x1280d0,null));};exports['describe']=function(_0x1c3c5a,_0x23623f){return db[_0x4113('0x30')]['describe']()[_0x4113('0x29')](respondWithResult(_0x23623f,null))[_0x4113('0x47')](handleError(_0x23623f,null));};
\ No newline at end of file
index b079391..644b45a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ac3=['../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x19691f,_0x159737){var _0x5677b6=function(_0x41a9b2){while(--_0x41a9b2){_0x19691f['push'](_0x19691f['shift']());}};_0x5677b6(++_0x159737);}(_0x5ac3,0x68));var _0x35ac=function(_0xdf0f2a,_0x382763){_0xdf0f2a=_0xdf0f2a-0x0;var _0x4000f8=_0x5ac3[_0xdf0f2a];return _0x4000f8;};'use strict';var _=require(_0x35ac('0x0'));var util=require(_0x35ac('0x1'));var logger=require('../../config/logger')(_0x35ac('0x2'));var moment=require(_0x35ac('0x3'));var BPromise=require(_0x35ac('0x4'));var rp=require(_0x35ac('0x5'));var fs=require('fs');var path=require(_0x35ac('0x6'));var rimraf=require(_0x35ac('0x7'));var config=require(_0x35ac('0x8'));var attributes=require(_0x35ac('0x9'));module[_0x35ac('0xa')]=function(_0x1ef8f9,_0x19b3cf){return _0x1ef8f9[_0x35ac('0xb')]('ChatTransferReport',attributes,{'tableName':_0x35ac('0xc'),'paranoid':![],'indexes':[{'name':_0x35ac('0xd'),'fields':[_0x35ac('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8bfa=['rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid','lodash','util','../../config/logger','moment','path'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x8bfa,0x7d));var _0xa8bf=function(_0x29d849,_0x209ceb){_0x29d849=_0x29d849-0x0;var _0x30b104=_0x8bfa[_0x29d849];return _0x30b104;};'use strict';var _=require(_0xa8bf('0x0'));var util=require(_0xa8bf('0x1'));var logger=require(_0xa8bf('0x2'))('api');var moment=require(_0xa8bf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8bf('0x4'));var rimraf=require(_0xa8bf('0x5'));var config=require('../../config/environment');var attributes=require(_0xa8bf('0x6'));module[_0xa8bf('0x7')]=function(_0x23ae8f,_0x3bb330){return _0x23ae8f['define'](_0xa8bf('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa8bf('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 32e9ba2..3672ae0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0841=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','request','then'];(function(_0x3b5775,_0x53eefd){var _0x4a241f=function(_0x5f424e){while(--_0x5f424e){_0x3b5775['push'](_0x3b5775['shift']());}};_0x4a241f(++_0x53eefd);}(_0x0841,0x9e));var _0x1084=function(_0x284328,_0x4d674e){_0x284328=_0x284328-0x0;var _0x6efdac=_0x0841[_0x284328];return _0x6efdac;};'use strict';var _=require(_0x1084('0x0'));var util=require(_0x1084('0x1'));var moment=require(_0x1084('0x2'));var BPromise=require(_0x1084('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1084('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1084('0x5'))(_0x1084('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1084('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x298c3f,_0x59869d,_0x341fc0){return new BPromise(function(_0x5b00d8,_0x19cac7){return client[_0x1084('0x8')](_0x298c3f,_0x341fc0)[_0x1084('0x9')](function(_0xdcaa33){logger['info'](_0x1084('0xa'),_0x59869d,_0x1084('0xb'));logger[_0x1084('0xc')](_0x1084('0xd'),_0x59869d,_0x1084('0xb'),JSON[_0x1084('0xe')](_0xdcaa33));if(_0xdcaa33['error']){if(_0xdcaa33[_0x1084('0xf')][_0x1084('0x10')]===0x1f4){logger['error'](_0x1084('0xa'),_0x59869d,_0xdcaa33['error'][_0x1084('0x11')]);return _0x19cac7(_0xdcaa33[_0x1084('0xf')][_0x1084('0x11')]);}logger['error'](_0x1084('0xa'),_0x59869d,_0xdcaa33['error'][_0x1084('0x11')]);return _0x5b00d8(_0xdcaa33[_0x1084('0xf')][_0x1084('0x11')]);}else{logger[_0x1084('0x12')](_0x1084('0xa'),_0x59869d,'request\x20sent');_0x5b00d8(_0xdcaa33[_0x1084('0x13')][_0x1084('0x11')]);}})[_0x1084('0x14')](function(_0x5912ce){logger[_0x1084('0xf')](_0x1084('0xa'),_0x59869d,_0x5912ce);_0x19cac7(_0x5912ce);});});}
\ No newline at end of file
+var _0x2be7=['request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x18959e,_0x24e830){var _0x308aba=function(_0x11ac72){while(--_0x11ac72){_0x18959e['push'](_0x18959e['shift']());}};_0x308aba(++_0x24e830);}(_0x2be7,0xa6));var _0x72be=function(_0x227c59,_0x575c83){_0x227c59=_0x227c59-0x0;var _0x35aeac=_0x2be7[_0x227c59];return _0x35aeac;};'use strict';var _=require('lodash');var util=require(_0x72be('0x0'));var moment=require('moment');var BPromise=require(_0x72be('0x1'));var rs=require(_0x72be('0x2'));var fs=require('fs');var Redis=require(_0x72be('0x3'));var db=require(_0x72be('0x4'))['db'];var utils=require(_0x72be('0x5'));var logger=require('../../config/logger')(_0x72be('0x6'));var config=require('../../config/environment');var jayson=require(_0x72be('0x7'));var client=jayson[_0x72be('0x8')][_0x72be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e4c64,_0x38f7cd,_0x37fffd){return new BPromise(function(_0x2e0b1d,_0x18670a){return client[_0x72be('0xa')](_0x4e4c64,_0x37fffd)[_0x72be('0xb')](function(_0x4fc77){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x38f7cd,_0x72be('0xc'));logger[_0x72be('0xd')](_0x72be('0xe'),_0x38f7cd,_0x72be('0xc'),JSON['stringify'](_0x4fc77));if(_0x4fc77['error']){if(_0x4fc77[_0x72be('0xf')][_0x72be('0x10')]===0x1f4){logger['error'](_0x72be('0x11'),_0x38f7cd,_0x4fc77[_0x72be('0xf')][_0x72be('0x12')]);return _0x18670a(_0x4fc77[_0x72be('0xf')][_0x72be('0x12')]);}logger[_0x72be('0xf')](_0x72be('0x11'),_0x38f7cd,_0x4fc77[_0x72be('0xf')][_0x72be('0x12')]);return _0x2e0b1d(_0x4fc77[_0x72be('0xf')]['message']);}else{logger[_0x72be('0x13')](_0x72be('0x11'),_0x38f7cd,'request\x20sent');_0x2e0b1d(_0x4fc77[_0x72be('0x14')]['message']);}})[_0x72be('0x15')](function(_0x215849){logger[_0x72be('0xf')](_0x72be('0x11'),_0x38f7cd,_0x215849);_0x18670a(_0x215849);});});}
\ No newline at end of file
index 2695c09..983557a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2000=['../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','index','get','/describe','isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x4f4b34,_0x47dda1){var _0xac9265=function(_0x5340fa){while(--_0x5340fa){_0x4f4b34['push'](_0x4f4b34['shift']());}};_0xac9265(++_0x47dda1);}(_0x2000,0x68));var _0x0200=function(_0x48ccaa,_0x118a60){_0x48ccaa=_0x48ccaa-0x0;var _0x3c11ab=_0x2000[_0x48ccaa];return _0x3c11ab;};'use strict';var multer=require(_0x0200('0x0'));var util=require(_0x0200('0x1'));var path=require(_0x0200('0x2'));var timeout=require(_0x0200('0x3'));var express=require(_0x0200('0x4'));var router=express['Router']();var fs_extra=require(_0x0200('0x5'));var auth=require(_0x0200('0x6'));var interaction=require(_0x0200('0x7'));var config=require('../../config/environment');var controller=require(_0x0200('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0200('0x9')]);router[_0x0200('0xa')](_0x0200('0xb'),auth[_0x0200('0xc')](),controller[_0x0200('0xd')]);router[_0x0200('0xa')]('/:id',auth[_0x0200('0xc')](),controller[_0x0200('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0200('0xf')]);router[_0x0200('0x10')](_0x0200('0x11'),auth[_0x0200('0xc')](),controller[_0x0200('0x12')]);router[_0x0200('0x13')](_0x0200('0x11'),auth[_0x0200('0xc')](),controller[_0x0200('0x14')]);module[_0x0200('0x15')]=router;
\ No newline at end of file
+var _0xd4d0=['isAuthenticated','index','describe','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x19a045,_0xdbce0e){var _0x5c3f19=function(_0x106aba){while(--_0x106aba){_0x19a045['push'](_0x19a045['shift']());}};_0x5c3f19(++_0xdbce0e);}(_0xd4d0,0xfa));var _0x0d4d=function(_0x529dba,_0x29b294){_0x529dba=_0x529dba-0x0;var _0x11e1f0=_0xd4d0[_0x529dba];return _0x11e1f0;};'use strict';var multer=require(_0x0d4d('0x0'));var util=require(_0x0d4d('0x1'));var path=require('path');var timeout=require(_0x0d4d('0x2'));var express=require(_0x0d4d('0x3'));var router=express[_0x0d4d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0d4d('0x5'));var interaction=require(_0x0d4d('0x6'));var config=require(_0x0d4d('0x7'));var controller=require(_0x0d4d('0x8'));router[_0x0d4d('0x9')]('/',auth[_0x0d4d('0xa')](),controller[_0x0d4d('0xb')]);router[_0x0d4d('0x9')]('/describe',auth[_0x0d4d('0xa')](),controller[_0x0d4d('0xc')]);router[_0x0d4d('0x9')](_0x0d4d('0xd'),auth[_0x0d4d('0xa')](),controller[_0x0d4d('0xe')]);router['post']('/',auth[_0x0d4d('0xa')](),controller['create']);router[_0x0d4d('0xf')](_0x0d4d('0xd'),auth['isAuthenticated'](),controller[_0x0d4d('0x10')]);router[_0x0d4d('0x11')](_0x0d4d('0xd'),auth['isAuthenticated'](),controller[_0x0d4d('0x12')]);module[_0x0d4d('0x13')]=router;
\ No newline at end of file
index d8e923c..c397d57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c5f=['Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','thumb','star','input','name','text','getDataValue','onlineForm','setDataValue','stringify','TEXT','textarea','Comments','offlineForm','parse','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted'];(function(_0x255b73,_0x5b2756){var _0x8f95dc=function(_0x396ed5){while(--_0x396ed5){_0x255b73['push'](_0x255b73['shift']());}};_0x8f95dc(++_0x5b2756);}(_0x8c5f,0xd3));var _0xf8c5=function(_0x1d5fd9,_0x39e853){_0x1d5fd9=_0x1d5fd9-0x0;var _0x3e11bc=_0x8c5f[_0x1d5fd9];return _0x3e11bc;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![]},'address':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'unique':_0xf8c5('0x1')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0x2')},'mapKeyOffline':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x2')},'key':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x3')},'customerAlias':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':_0xf8c5('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':_0xf8c5('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf8c5('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf8c5('0x0')]},'animation':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xf8c5('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x9')},'header_offline':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xa')},'download_transcript':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf8c5('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xb')},'defaultWhiteLabel':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0xc')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xd')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0xe')},'noteTitle':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xf')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x10')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0x9')},'skipMessageButton':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x11')},'conditionAgreement':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xf8c5('0x12')]('star',_0xf8c5('0x13')),'defaultValue':_0xf8c5('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf8c5('0x15'),'variable':null,'config':{'placeholder':_0xf8c5('0x16'),'type':_0xf8c5('0x17'),'required':!![]},'props':{'title':_0xf8c5('0x16'),'helpText':''}},{'type':_0xf8c5('0x15'),'props':{'title':_0xf8c5('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8c5('0x2'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf8c5('0x18')](_0xf8c5('0x19'))?JSON['parse'](this[_0xf8c5('0x18')]('onlineForm')):{};},'set':function(_0x3d1a1e){return this[_0xf8c5('0x1a')](_0xf8c5('0x19'),JSON[_0xf8c5('0x1b')](_0x3d1a1e));}},'offlineForm':{'type':Sequelize[_0xf8c5('0x1c')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf8c5('0x15'),'props':{'title':_0xf8c5('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8c5('0x2'),'type':'email'},'variable':null},{'type':_0xf8c5('0x1d'),'config':{'placeholder':_0xf8c5('0x1e')},'props':{'title':_0xf8c5('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xf8c5('0x18')](_0xf8c5('0x1f'))?JSON[_0xf8c5('0x20')](this[_0xf8c5('0x18')](_0xf8c5('0x1f'))):{};},'set':function(_0x2696e6){return this[_0xf8c5('0x1a')]('offlineForm',JSON['stringify'](_0x2696e6));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x23')},'skipUnmanaged':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x9')},'enableCustomerAttachment':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf8c5('0x1c')]},'showAgentAvatar':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf8c5('0x0')]},'notificationTemplate':{'type':Sequelize[_0xf8c5('0x1c')],'defaultValue':function(){return _0xf8c5('0x24');}},'notificationSound':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf8c5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x26')},'verticalAlignment':{'type':Sequelize[_0xf8c5('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x27')},'defaultTitle':{'type':Sequelize[_0xf8c5('0x0')]},'customerAvatar':{'type':Sequelize[_0xf8c5('0x1c')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':_0xf8c5('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf8c5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xf8c5('0x1c')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf8c5('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![],'comment':_0xf8c5('0x29'),'set':function(_0x20393f){if(!_0x20393f)this['setDataValue'](_0xf8c5('0x2a'),null);this['setDataValue'](_0xf8c5('0x2b'),_0x20393f);}},'vidaooEscalation':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf8c5('0x0')]},'vidaooTopic':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':function(){return _0xf8c5('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xf8c5('0x1c')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf8c5('0x1c')]}};
\ No newline at end of file
+var _0xc131=['STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','ENUM','star','thumb','input','name','text','getDataValue','parse','onlineForm','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','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:','Skip','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports'];(function(_0x36bcd3,_0x44f1c7){var _0x567c4f=function(_0x3fdf7f){while(--_0x3fdf7f){_0x36bcd3['push'](_0x36bcd3['shift']());}};_0x567c4f(++_0x44f1c7);}(_0xc131,0x15c));var _0x1c13=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc131[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x1c13('0x0'));var rs=require('randomstring');module[_0x1c13('0x1')]={'name':{'type':Sequelize[_0x1c13('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x1c13('0x2')],'allowNull':![],'unique':_0x1c13('0x3')},'description':{'type':Sequelize[_0x1c13('0x2')]},'mapKey':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x4')},'mapKeyOffline':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x4')},'key':{'type':Sequelize[_0x1c13('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1c13('0x5')},'customerAlias':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1c13('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1c13('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1c13('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1c13('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1c13('0x2')]},'animation':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x1c13('0xa'),_0x1c13('0xb')),'defaultValue':_0x1c13('0xa')},'header_online':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0xc')},'start_chat_button':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0xd')},'offline_chat_button':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x1c13('0xf')},'download_transcript':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x1c13('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1c13('0x11')]},'closingQuestion':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x14')},'noteTitle':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1c13('0x16')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1c13('0x17')},'closingMessageButton':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0xe')},'skipMessageButton':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x18')},'ratingType':{'type':Sequelize[_0x1c13('0x19')](_0x1c13('0x1a'),_0x1c13('0x1b')),'defaultValue':_0x1c13('0x1a')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1c13('0x1c'),'variable':null,'config':{'placeholder':_0x1c13('0x1d'),'type':_0x1c13('0x1e'),'required':!![]},'props':{'title':_0x1c13('0x1d'),'helpText':''}},{'type':_0x1c13('0x1c'),'props':{'title':_0x1c13('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1c13('0x4'),'type':_0x1c13('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1c13('0x1f')]('onlineForm')?JSON[_0x1c13('0x20')](this['getDataValue'](_0x1c13('0x21'))):{};},'set':function(_0x39ca31){return this['setDataValue']('onlineForm',JSON[_0x1c13('0x22')](_0x39ca31));}},'offlineForm':{'type':Sequelize[_0x1c13('0x11')],'defaultValue':function(){return JSON[_0x1c13('0x22')]({'items':[{'type':_0x1c13('0x1c'),'props':{'title':_0x1c13('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1c13('0x4'),'type':_0x1c13('0x4')},'variable':null},{'type':_0x1c13('0x23'),'config':{'placeholder':_0x1c13('0x24')},'props':{'title':_0x1c13('0x24'),'helpText':_0x1c13('0x25')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x1c13('0x20')](this[_0x1c13('0x1f')]('offlineForm')):{};},'set':function(_0xc02bb4){return this['setDataValue'](_0x1c13('0x26'),JSON[_0x1c13('0x22')](_0xc02bb4));}},'token':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1c13('0x2')]},'forwardOffline':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1c13('0x2')]},'waitingTitle':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x28')},'offlineMessageBody':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x29')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x2a')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1c13('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1c13('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1c13('0x2b');}},'notificationSound':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x1c13('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x1c13('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x2c')},'defaultTitle':{'type':Sequelize[_0x1c13('0x2')]},'customerAvatar':{'type':Sequelize[_0x1c13('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1c13('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1c13('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1c13('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1c13('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x1c13('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1c13('0x8')],'comment':_0x1c13('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xcffbb2){if(!_0xcffbb2)this['setDataValue'](_0x1c13('0x2f'),null);this['setDataValue'](_0x1c13('0x30'),_0xcffbb2);}},'vidaooEscalation':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x1c13('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x1c13('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x1c13('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1c13('0x11')]}};
\ No newline at end of file
index 16ac94c..a9db70f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7ea=['mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','textColor','backgroundColor','addApplications','findAndCountAll','priority','getApplications','addProactiveActions','omit','getProactiveActions','online','false','offlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','apply','save','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','ChatWebsite','includeAll','include','findAll','rows','show','params','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','join','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ChatApplication','Applications','List','account','applications','orderBy','Contacts','contact','customerIp','x-forwarded-for','first','split','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','lastName','messageId','created','autoclose','push','close','*,*,*,*','UserId','User','unshift','agent','Start','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb7ea,0x16c));var _0xab7e=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0xb7ea[_0x65c50e];return _0x4573e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab7e('0x0'));var zipdir=require(_0xab7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xab7e('0x2'));var BPromise=require(_0xab7e('0x3'));var Mustache=require(_0xab7e('0x4'));var util=require(_0xab7e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xab7e('0x6'));var ejs=require(_0xab7e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab7e('0x8'));var squel=require(_0xab7e('0x9'));var crypto=require(_0xab7e('0xa'));var jsforce=require(_0xab7e('0xb'));var deskjs=require(_0xab7e('0xc'));var toCsv=require(_0xab7e('0x6'));var querystring=require(_0xab7e('0xd'));var Papa=require(_0xab7e('0xe'));var Redis=require('ioredis');var authService=require(_0xab7e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab7e('0x10'));var hardwareService=require(_0xab7e('0x11'));var logger=require(_0xab7e('0x12'))(_0xab7e('0x13'));var utils=require(_0xab7e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xab7e('0x15'));var db=require(_0xab7e('0x16'))['db'];config[_0xab7e('0x17')]=_[_0xab7e('0x18')](config[_0xab7e('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xab7e('0x19'))(new Redis(config[_0xab7e('0x17')]));require(_0xab7e('0x1a'))[_0xab7e('0x1b')](socket);var jayson=require(_0xab7e('0x1c'));var client=jayson[_0xab7e('0x1d')][_0xab7e('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xab7e('0x1e')]({'port':0x232a});var client9003=jayson[_0xab7e('0x1d')][_0xab7e('0x1e')]({'port':0x232b});var client9001=jayson[_0xab7e('0x1d')][_0xab7e('0x1e')]({'port':0x2329});function respondWithRpcPromise(_0x5aadb8,_0xe7f6e9,_0x3c1799,_0x433072){return new BPromise(function(_0x58ffa0,_0x5ba2dd){var _0x64928=_0x433072||client;return _0x64928[_0xab7e('0x1f')](_0x5aadb8,_0x3c1799)[_0xab7e('0x20')](function(_0x58846b){logger['info'](_0xab7e('0x21'),_0xe7f6e9,'request\x20sent');logger[_0xab7e('0x22')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xe7f6e9,_0xab7e('0x23'),JSON[_0xab7e('0x24')](_0x58846b));if(_0x58846b[_0xab7e('0x25')]){if(_0x58846b[_0xab7e('0x25')][_0xab7e('0x26')]===0x1f4){logger[_0xab7e('0x25')](_0xab7e('0x21'),_0xe7f6e9,_0x58846b[_0xab7e('0x25')][_0xab7e('0x27')]);return _0x5ba2dd(_0x58846b['error'][_0xab7e('0x27')]);}logger[_0xab7e('0x25')](_0xab7e('0x21'),_0xe7f6e9,_0x58846b[_0xab7e('0x25')][_0xab7e('0x27')]);return _0x58ffa0(_0x58846b[_0xab7e('0x25')][_0xab7e('0x27')]);}else{logger[_0xab7e('0x28')]('ChatWebsite,\x20%s,\x20%s',_0xe7f6e9,_0xab7e('0x23'));_0x58ffa0(_0x58846b[_0xab7e('0x29')][_0xab7e('0x27')]);}})[_0xab7e('0x2a')](function(_0x5e6c68){logger[_0xab7e('0x25')](_0xab7e('0x21'),_0xe7f6e9,_0x5e6c68);_0x5ba2dd(_0x5e6c68);});});}function respondWithStatusCode(_0x1e1931,_0x26bef5){_0x26bef5=_0x26bef5||0xcc;return function(_0x1316ff){if(_0x1316ff){return _0x1e1931[_0xab7e('0x2b')](_0x26bef5);}return _0x1e1931[_0xab7e('0x2c')](_0x26bef5)[_0xab7e('0x2d')]();};}function respondWithResult(_0x5d2d1c,_0x537215){_0x537215=_0x537215||0xc8;return function(_0x48846d){if(_0x48846d){return _0x5d2d1c['status'](_0x537215)[_0xab7e('0x2e')](_0x48846d);}};}function respondWithFilteredResult(_0x4c268a,_0x35c507){return function(_0x5e8efa){if(_0x5e8efa){var _0x33d8a0=typeof _0x35c507[_0xab7e('0x2f')]===_0xab7e('0x30')&&typeof _0x35c507['limit']===_0xab7e('0x30');var _0x4bfcf0=_0x5e8efa['count'];var _0x409a8b=_0x33d8a0?0x0:_0x35c507[_0xab7e('0x2f')];var _0x1f621e=_0x33d8a0?_0x5e8efa[_0xab7e('0x31')]:_0x35c507[_0xab7e('0x2f')]+_0x35c507['limit'];var _0x47a322;if(_0x1f621e>=_0x4bfcf0){_0x1f621e=_0x4bfcf0;_0x47a322=0xc8;}else{_0x47a322=0xce;}_0x4c268a[_0xab7e('0x2c')](_0x47a322);return _0x4c268a['set']('Content-Range',_0x409a8b+'-'+_0x1f621e+'/'+_0x4bfcf0)['json'](_0x5e8efa);}return null;};}function patchUpdates(_0x30b442){return function(_0x175c9c){try{jsonpatch[_0xab7e('0x32')](_0x175c9c,_0x30b442,!![]);}catch(_0x299f06){return BPromise['reject'](_0x299f06);}return _0x175c9c[_0xab7e('0x33')]();};}function saveUpdates(_0x1ac8b3,_0x4fd262){return function(_0x4df546){if(_0x4df546){return _0x4df546['update'](_0x1ac8b3)[_0xab7e('0x20')](function(_0x472cbb){return _0x472cbb;});}return null;};}function removeEntity(_0x5f0abd,_0x25a4d7){return function(_0x421ed7){if(_0x421ed7){return _0x421ed7['destroy']()[_0xab7e('0x20')](function(){var _0x25960a=_0x421ed7[_0xab7e('0x34')]({'plain':!![]});var _0x28e6bb=_0xab7e('0x35');return db[_0xab7e('0x36')][_0xab7e('0x37')]({'where':{'type':_0x28e6bb,'resourceId':_0x25960a['id']}})[_0xab7e('0x20')](function(){return _0x421ed7;});})[_0xab7e('0x20')](function(){_0x5f0abd[_0xab7e('0x2c')](0xcc)[_0xab7e('0x2d')]();});}};}function handleEntityNotFound(_0x371d44,_0x275968){return function(_0x3444c6){if(!_0x3444c6){_0x371d44['sendStatus'](0x194);}return _0x3444c6;};}function handleError(_0x4772b7,_0x2ec77f){_0x2ec77f=_0x2ec77f||0x1f4;return function(_0x1cc44c){logger['error'](_0x1cc44c[_0xab7e('0x38')]);if(_0x1cc44c[_0xab7e('0x39')]){delete _0x1cc44c['name'];}_0x4772b7[_0xab7e('0x2c')](_0x2ec77f)[_0xab7e('0x3a')](_0x1cc44c);};}exports[_0xab7e('0x3b')]=function(_0x279b63,_0x399319){var _0x152245={'include':[{'model':db[_0xab7e('0x3c')],'as':_0xab7e('0x3d')}]},_0x27c493={},_0x4dfd7e={'count':0x0,'rows':[]};var _0xb4f340=_[_0xab7e('0x3e')](db['ChatWebsite'][_0xab7e('0x3f')],function(_0x41a2e0){return{'name':_0x41a2e0[_0xab7e('0x40')],'type':_0x41a2e0[_0xab7e('0x41')][_0xab7e('0x42')]};});_0x27c493[_0xab7e('0x43')]=_[_0xab7e('0x3e')](_0xb4f340,_0xab7e('0x39'));_0x27c493[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x279b63[_0xab7e('0x44')]);_0x27c493[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x27c493['model'],_0x27c493[_0xab7e('0x44')]);_0x152245['attributes']=_[_0xab7e('0x47')](_0x27c493[_0xab7e('0x43')],qs[_0xab7e('0x48')](_0x279b63[_0xab7e('0x44')][_0xab7e('0x48')]));_0x152245[_0xab7e('0x49')]=_0x152245[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x152245[_0xab7e('0x49')]:_0x27c493[_0xab7e('0x43')];if(!_0x279b63[_0xab7e('0x44')][_0xab7e('0x4b')](_0xab7e('0x4c'))){_0x152245['limit']=qs[_0xab7e('0x4d')](_0x279b63[_0xab7e('0x44')]['limit']);_0x152245[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x279b63[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x152245[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x279b63['query']['sort']);_0x152245[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x279b63['query'],_0x27c493[_0xab7e('0x46')]),_0xb4f340);if(_0x279b63['query']['filter']){_0x152245[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x152245[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0xb4f340,function(_0x197e8a){if(_0x197e8a[_0xab7e('0x41')]!==_0xab7e('0x53')){var _0x155f35={};_0x155f35[_0x197e8a[_0xab7e('0x39')]]={'$like':'%'+_0x279b63['query'][_0xab7e('0x54')]+'%'};return _0x155f35;}})});}_0x152245=_[_0xab7e('0x52')]({},_0x152245,_0x279b63[_0xab7e('0x55')]);var _0x1f62dd={'where':_0x152245['where']};return db[_0xab7e('0x56')]['count'](_0x1f62dd)[_0xab7e('0x20')](function(_0x2b7f8e){_0x4dfd7e[_0xab7e('0x31')]=_0x2b7f8e;if(_0x279b63['query'][_0xab7e('0x57')]){_0x152245[_0xab7e('0x58')]=[{'all':!![]}];}return db[_0xab7e('0x56')][_0xab7e('0x59')](_0x152245);})[_0xab7e('0x20')](function(_0x398ceb){_0x4dfd7e[_0xab7e('0x5a')]=_0x398ceb;return _0x4dfd7e;})[_0xab7e('0x20')](respondWithFilteredResult(_0x399319,_0x152245))['catch'](handleError(_0x399319,null));};exports[_0xab7e('0x5b')]=function(_0x2008f3,_0x38538b){var _0x42b5f6={'raw':![],'where':{'id':_0x2008f3[_0xab7e('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xab7e('0x3d')}]},_0x1599a2={};_0x1599a2[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatWebsite']['rawAttributes']);_0x1599a2[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x2008f3['query']);_0x1599a2[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x1599a2[_0xab7e('0x43')],_0x1599a2[_0xab7e('0x44')]);_0x42b5f6[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x1599a2[_0xab7e('0x43')],qs[_0xab7e('0x48')](_0x2008f3[_0xab7e('0x44')][_0xab7e('0x48')]));_0x42b5f6['attributes']=_0x42b5f6[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x42b5f6['attributes']:_0x1599a2[_0xab7e('0x43')];if(_0x2008f3[_0xab7e('0x44')][_0xab7e('0x57')]){_0x42b5f6[_0xab7e('0x58')]=[{'all':!![]}];}_0x42b5f6=_[_0xab7e('0x52')]({},_0x42b5f6,_0x2008f3[_0xab7e('0x55')]);return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x42b5f6)['then'](handleEntityNotFound(_0x38538b,null))[_0xab7e('0x20')](respondWithResult(_0x38538b,null))[_0xab7e('0x2a')](handleError(_0x38538b,null));};exports[_0xab7e('0x5e')]=function(_0x4b1163,_0x278068){return db['ChatWebsite'][_0xab7e('0x5e')](_0x4b1163[_0xab7e('0x5f')],{})[_0xab7e('0x20')](function(_0x15963b){var _0x3eec87=_0x4b1163[_0xab7e('0x60')][_0xab7e('0x34')]({'plain':!![]});if(!_0x3eec87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3eec87[_0xab7e('0x61')]==='user'){var _0x186803=_0x15963b[_0xab7e('0x34')]({'plain':!![]});var _0xb4a6c4=_0xab7e('0x35');return db['UserProfileSection'][_0xab7e('0x5d')]({'where':{'name':_0xb4a6c4,'userProfileId':_0x3eec87[_0xab7e('0x62')]},'raw':!![]})[_0xab7e('0x20')](function(_0x46298b){if(_0x46298b&&_0x46298b[_0xab7e('0x63')]===0x0){return db[_0xab7e('0x36')][_0xab7e('0x5e')]({'name':_0x186803[_0xab7e('0x39')],'resourceId':_0x186803['id'],'type':_0x46298b['name'],'sectionId':_0x46298b['id']},{})['then'](function(){return _0x15963b;});}else{return _0x15963b;}})[_0xab7e('0x2a')](function(_0x2e69b8){logger[_0xab7e('0x25')](_0xab7e('0x64'),_0x2e69b8);throw _0x2e69b8;});}return _0x15963b;})[_0xab7e('0x20')](respondWithResult(_0x278068,0xc9))[_0xab7e('0x2a')](handleError(_0x278068,null));};exports[_0xab7e('0x65')]=function(_0x52a48c,_0x589bdc){if(_0x52a48c[_0xab7e('0x5f')]['id']){delete _0x52a48c[_0xab7e('0x5f')]['id'];}return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x52a48c['params']['id']},'include':[{'model':db['Pause'],'as':_0xab7e('0x3d')}]})[_0xab7e('0x20')](handleEntityNotFound(_0x589bdc,null))['then'](saveUpdates(_0x52a48c['body'],null))[_0xab7e('0x20')](respondWithResult(_0x589bdc,null))[_0xab7e('0x2a')](handleError(_0x589bdc,null));};exports[_0xab7e('0x37')]=function(_0x8b9201,_0x5355d2){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x8b9201[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x5355d2,null))[_0xab7e('0x20')](removeEntity(_0x5355d2,null))[_0xab7e('0x2a')](handleError(_0x5355d2,null));};exports[_0xab7e('0x66')]=function(_0x4e4087,_0x1e2bc6){return db[_0xab7e('0x56')]['describe']()[_0xab7e('0x20')](respondWithResult(_0x1e2bc6,null))[_0xab7e('0x2a')](handleError(_0x1e2bc6,null));};exports[_0xab7e('0x67')]=function(_0x5f1af4,_0xf1c8df,_0x515a5c){if(_0x5f1af4[_0xab7e('0x5f')]['id']){delete _0x5f1af4['body']['id'];}return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x5f1af4[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0xf1c8df,null))['then'](function(_0x5dd194){if(_0x5dd194){_0x5f1af4[_0xab7e('0x5f')][_0xab7e('0x68')]=_0x5dd194['id'];return db[_0xab7e('0x69')]['create'](_0x5f1af4[_0xab7e('0x5f')]);}})[_0xab7e('0x20')](respondWithResult(_0xf1c8df,null))[_0xab7e('0x2a')](handleError(_0xf1c8df,null));};exports['getDispositions']=function(_0x13a5ab,_0xbb4e6f,_0x192d02){var _0x2089ff={'raw':![],'where':{}};var _0x22728e={};var _0x480d06={'count':0x0,'rows':[]};return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x13a5ab[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0xbb4e6f,null))[_0xab7e('0x20')](function(_0x3e57b6){if(_0x3e57b6){_0x22728e['model']=_[_0xab7e('0x45')](db['Disposition'][_0xab7e('0x3f')]);_0x22728e[_0xab7e('0x44')]=_['keys'](_0x13a5ab[_0xab7e('0x44')]);_0x22728e['filters']=_[_0xab7e('0x47')](_0x22728e['model'],_0x22728e[_0xab7e('0x44')]);_0x2089ff[_0xab7e('0x49')]=_['intersection'](_0x22728e[_0xab7e('0x43')],qs['fields'](_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x48')]));_0x2089ff[_0xab7e('0x49')]=_0x2089ff['attributes'][_0xab7e('0x4a')]?_0x2089ff[_0xab7e('0x49')]:_0x22728e[_0xab7e('0x43')];if(!_0x13a5ab['query'][_0xab7e('0x4b')]('nolimit')){_0x2089ff[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x13a5ab['query'][_0xab7e('0x4d')]);_0x2089ff[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x2089ff[_0xab7e('0x4e')]=qs['sort'](_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x2089ff[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x13a5ab[_0xab7e('0x44')],_0x22728e[_0xab7e('0x46')]));_0x2089ff[_0xab7e('0x50')][_0xab7e('0x68')]=_0x3e57b6['id'];if(_0x13a5ab[_0xab7e('0x44')]['filter']){_0x2089ff['where']=_[_0xab7e('0x52')](_0x2089ff[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x2089ff[_0xab7e('0x49')],function(_0x224fd8){var _0x3f3f23={};_0x3f3f23[_0x224fd8]={'$like':'%'+_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x3f3f23;})});}_0x2089ff=_[_0xab7e('0x52')]({},_0x2089ff,_0x13a5ab[_0xab7e('0x55')]);return db['Disposition'][_0xab7e('0x31')]({'where':_0x2089ff[_0xab7e('0x50')]})[_0xab7e('0x20')](function(_0x3f2190){_0x480d06[_0xab7e('0x31')]=_0x3f2190;if(_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x57')]){_0x2089ff[_0xab7e('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xab7e('0x59')](_0x2089ff);})[_0xab7e('0x20')](function(_0x5c817b){_0x480d06[_0xab7e('0x5a')]=_0x5c817b;return _0x480d06;});}})['then'](respondWithFilteredResult(_0xbb4e6f,_0x2089ff))[_0xab7e('0x2a')](handleError(_0xbb4e6f,null));};exports[_0xab7e('0x6b')]=function(_0x226459,_0x4a50b2,_0x5ddb61){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x226459[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4a50b2,null))[_0xab7e('0x20')](function(_0x4494fc){if(_0x4494fc){return _0x4494fc[_0xab7e('0x6b')](_0x226459[_0xab7e('0x44')]['ids']);}})[_0xab7e('0x20')](respondWithStatusCode(_0x4a50b2,null))[_0xab7e('0x2a')](handleError(_0x4a50b2,null));};exports[_0xab7e('0x6c')]=function(_0x5799ec,_0x3856f,_0x6d2fa1){if(_0x5799ec[_0xab7e('0x5f')]['id']){delete _0x5799ec[_0xab7e('0x5f')]['id'];}return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x5799ec['params']['id']}})['then'](handleEntityNotFound(_0x3856f,null))[_0xab7e('0x20')](function(_0x1cb6a9){if(_0x1cb6a9){_0x5799ec[_0xab7e('0x5f')][_0xab7e('0x68')]=_0x1cb6a9['id'];return db[_0xab7e('0x6d')]['create'](_0x5799ec['body']);}})[_0xab7e('0x20')](respondWithResult(_0x3856f,null))[_0xab7e('0x2a')](handleError(_0x3856f,null));};exports[_0xab7e('0x6e')]=function(_0x25b757,_0x11b5b8,_0x1deec7){var _0x56e5c1={'raw':![],'where':{}};var _0x49b647={};var _0x328388={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xab7e('0x6a')]({'where':{'id':_0x25b757[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x11b5b8,null))['then'](function(_0x46921a){if(_0x46921a){_0x49b647[_0xab7e('0x43')]=_['keys'](db[_0xab7e('0x6d')]['rawAttributes']);_0x49b647[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x25b757[_0xab7e('0x44')]);_0x49b647[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x49b647[_0xab7e('0x43')],_0x49b647[_0xab7e('0x44')]);_0x56e5c1[_0xab7e('0x49')]=_['intersection'](_0x49b647[_0xab7e('0x43')],qs['fields'](_0x25b757[_0xab7e('0x44')]['fields']));_0x56e5c1['attributes']=_0x56e5c1[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x56e5c1[_0xab7e('0x49')]:_0x49b647[_0xab7e('0x43')];if(!_0x25b757['query'][_0xab7e('0x4b')](_0xab7e('0x4c'))){_0x56e5c1[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x25b757[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x56e5c1['offset']=qs[_0xab7e('0x2f')](_0x25b757[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x56e5c1[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x25b757['query'][_0xab7e('0x4f')]);_0x56e5c1[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x25b757['query'],_0x49b647[_0xab7e('0x46')]));_0x56e5c1[_0xab7e('0x50')][_0xab7e('0x68')]=_0x46921a['id'];if(_0x25b757[_0xab7e('0x44')]['filter']){_0x56e5c1[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x56e5c1[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x56e5c1[_0xab7e('0x49')],function(_0x4440d4){var _0x22f476={};_0x22f476[_0x4440d4]={'$like':'%'+_0x25b757[_0xab7e('0x44')]['filter']+'%'};return _0x22f476;})});}_0x56e5c1=_[_0xab7e('0x52')]({},_0x56e5c1,_0x25b757['options']);return db[_0xab7e('0x6d')]['count']({'where':_0x56e5c1[_0xab7e('0x50')]})['then'](function(_0x6c3aa4){_0x328388['count']=_0x6c3aa4;if(_0x25b757[_0xab7e('0x44')][_0xab7e('0x57')]){_0x56e5c1[_0xab7e('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0xab7e('0x59')](_0x56e5c1);})['then'](function(_0x1c5184){_0x328388[_0xab7e('0x5a')]=_0x1c5184;return _0x328388;});}})[_0xab7e('0x20')](respondWithFilteredResult(_0x11b5b8,_0x56e5c1))[_0xab7e('0x2a')](handleError(_0x11b5b8,null));};exports['removeAnswers']=function(_0x2be82b,_0x4eaa76,_0x27ccbd){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x2be82b[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4eaa76,null))[_0xab7e('0x20')](function(_0x121145){if(_0x121145){return _0x121145[_0xab7e('0x6f')](_0x2be82b[_0xab7e('0x44')][_0xab7e('0x70')]);}})[_0xab7e('0x20')](respondWithStatusCode(_0x4eaa76,null))[_0xab7e('0x2a')](handleError(_0x4eaa76,null));};exports[_0xab7e('0x71')]=function(_0x51feee,_0x539916,_0xceec97){_0x51feee[_0xab7e('0x5f')][_0xab7e('0x72')]=_0x51feee[_0xab7e('0x73')][_0xab7e('0x74')];return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x51feee[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x539916,null))['then'](saveUpdates(_0x51feee['body'],null))[_0xab7e('0x20')](respondWithResult(_0x539916,null))[_0xab7e('0x2a')](handleError(_0x539916,null));};exports[_0xab7e('0x75')]=function(_0x2c9291,_0x2f71f1,_0x1f4270){_0x2c9291['body'][_0xab7e('0x76')]=_0x2c9291[_0xab7e('0x73')][_0xab7e('0x74')];return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x2c9291[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2f71f1,null))[_0xab7e('0x20')](saveUpdates(_0x2c9291[_0xab7e('0x5f')],null))[_0xab7e('0x20')](respondWithResult(_0x2f71f1,null))[_0xab7e('0x2a')](handleError(_0x2f71f1,null));};exports[_0xab7e('0x77')]=function(_0x387b59,_0x277306,_0x590358){_0x387b59[_0xab7e('0x5f')][_0xab7e('0x78')]=_0x387b59[_0xab7e('0x73')][_0xab7e('0x74')];return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x387b59[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x277306,null))[_0xab7e('0x20')](saveUpdates(_0x387b59['body'],null))[_0xab7e('0x20')](respondWithResult(_0x277306,null))['catch'](handleError(_0x277306,null));};exports[_0xab7e('0x79')]=function(_0x122c6a,_0x11e5a0,_0x5e3a99){_0x122c6a['body'][_0xab7e('0x7a')]=_0x122c6a[_0xab7e('0x73')][_0xab7e('0x74')];return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x122c6a[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x11e5a0,null))[_0xab7e('0x20')](saveUpdates(_0x122c6a['body'],null))[_0xab7e('0x20')](respondWithResult(_0x11e5a0,null))['catch'](handleError(_0x11e5a0,null));};exports[_0xab7e('0x7b')]=function(_0x1b212b,_0x333704,_0x13d84f){var _0x203565=path['join'](config[_0xab7e('0x7c')],_0xab7e('0x7d'));var _0x56dc0e={'where':{'id':_0x1b212b[_0xab7e('0x5c')]['id']},'attributes':['id',_0xab7e('0x72')],'raw':!![]};var _0x4dc744=![];return require('../../config/license/util')[_0xab7e('0x7e')]()['then'](function(_0x11fd8b){if(_0x11fd8b){_0x4dc744=_0x11fd8b[_0xab7e('0x7f')];}})[_0xab7e('0x20')](function(){return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x56dc0e);})['then'](handleEntityNotFound(_0x333704,null))[_0xab7e('0x20')](function(_0x7cf2f2){if(_0x7cf2f2){if(!_[_0xab7e('0x80')](_0x7cf2f2[_0xab7e('0x72')])){if(fs[_0xab7e('0x81')](path['join'](config['root'],'server/files/images/logos/',_0x7cf2f2[_0xab7e('0x72')]))&&_0x4dc744){_0x203565=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],'server/files/images/logos/',_0x7cf2f2[_0xab7e('0x72')]);}}return _0x333704['download'](_0x203565);}})[_0xab7e('0x2a')](handleError(_0x333704,null));};exports[_0xab7e('0x83')]=function(_0x4f15b0,_0x165395,_0x4ea43c){var _0x3ef0d9=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x84'));var _0x4f525b={'where':{'id':_0x4f15b0['params']['id']},'attributes':['id',_0xab7e('0x76')],'raw':!![]};return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x4f525b)[_0xab7e('0x20')](handleEntityNotFound(_0x165395,null))[_0xab7e('0x20')](function(_0x223908){if(_0x223908){if(!_[_0xab7e('0x80')](_0x223908['agentAvatar'])){if(fs[_0xab7e('0x81')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x223908[_0xab7e('0x76')]))){_0x3ef0d9=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x223908[_0xab7e('0x76')]);}}return _0x165395[_0xab7e('0x86')](_0x3ef0d9);}})['catch'](handleError(_0x165395,null));};exports[_0xab7e('0x87')]=function(_0x21bc1d,_0x44714d,_0x26029d){var _0x40e8b0=path[_0xab7e('0x82')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x1784ba={'where':{'id':_0x21bc1d[_0xab7e('0x5c')]['id']},'attributes':['id',_0xab7e('0x78'),_0xab7e('0x88')],'raw':!![]};return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x1784ba)[_0xab7e('0x20')](handleEntityNotFound(_0x44714d,null))[_0xab7e('0x20')](function(_0x45ab5e){if(_0x45ab5e){if(!_[_0xab7e('0x80')](_0x45ab5e[_0xab7e('0x78')])){if(fs[_0xab7e('0x81')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x45ab5e[_0xab7e('0x78')]))&&_0x45ab5e[_0xab7e('0x88')]){_0x40e8b0=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x45ab5e[_0xab7e('0x78')]);}}return _0x44714d[_0xab7e('0x86')](_0x40e8b0);}})[_0xab7e('0x2a')](handleError(_0x44714d,null));};exports['getSystemAvatar']=function(_0x37f4ec,_0x51ffec,_0x3e1ad0){var _0x36f5ab=path['join'](config[_0xab7e('0x7c')],_0xab7e('0x89'));var _0x8de24e={'where':{'id':_0x37f4ec[_0xab7e('0x5c')]['id']},'attributes':['id',_0xab7e('0x7a')],'raw':!![]};return db['ChatWebsite'][_0xab7e('0x5d')](_0x8de24e)[_0xab7e('0x20')](handleEntityNotFound(_0x51ffec,null))[_0xab7e('0x20')](function(_0xa9136a){if(_0xa9136a){if(!_[_0xab7e('0x80')](_0xa9136a['systemAvatar'])){if(fs[_0xab7e('0x81')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],'server/files/images/avatars/',_0xa9136a[_0xab7e('0x7a')]))){_0x36f5ab=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0xa9136a[_0xab7e('0x7a')]);}}return _0x51ffec[_0xab7e('0x86')](_0x36f5ab);}})[_0xab7e('0x2a')](handleError(_0x51ffec,null));};exports[_0xab7e('0x8a')]=function(_0x393b1d,_0x4a353d,_0x4d845e){var _0x3d7de6=require(_0xab7e('0x8b'));var _0x3373f0=new _0x3d7de6();var _0xa54467=_0x3373f0[_0xab7e('0x8c')](_0x393b1d[_0xab7e('0x8d')][_0xab7e('0x8e')])[_0xab7e('0x8f')]();var _0xbec26d={'body':_0x393b1d['body'],'channel':'chat'};var _0x4fc89d=[];var _0x50ad72=[];var _0x37577e={};var _0x2d7037=![];return db[_0xab7e('0x90')][_0xab7e('0x66')]()[_0xab7e('0x20')](function(_0x16c43a){if(!_0x16c43a){throw new db[(_0xab7e('0x91'))]['ValidationError'](_0xab7e('0x92'));}_0x4fc89d=_[_0xab7e('0x93')](_['keys'](_0x16c43a),[_0xab7e('0x94'),_0xab7e('0x95')]);_0x50ad72=_[_0xab7e('0x93')](_[_0xab7e('0x45')](_0x16c43a),[_0xab7e('0x94'),_0xab7e('0x95'),_0xab7e('0x96'),_0xab7e('0x97')]);if(_0x393b1d['body']['id']){delete _0x393b1d[_0xab7e('0x5f')]['id'];}if(_[_0xab7e('0x80')](_0x393b1d['body'][_0xab7e('0x98')])){throw new db[(_0xab7e('0x91'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xab7e('0x80')](_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x5f')])||_0x393b1d[_0xab7e('0x5f')]['body']===''){throw new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))](_0xab7e('0x9a'));}if(_[_0xab7e('0x80')](_0x393b1d['body']['mapKey'])){throw new db[(_0xab7e('0x91'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x50ad72);}if(!_['includes'](_0x50ad72,_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x9b')])){throw new db['Sequelize'][(_0xab7e('0x99'))](_0xab7e('0x9c')+_0x50ad72);}_0x37577e[_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x9b')]]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x98')];})[_0xab7e('0x20')](function(){return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x393b1d['params']['id']},'include':[{'model':db[_0xab7e('0x9d')],'as':'List','include':[{'model':db[_0xab7e('0x90')],'as':'Contacts','where':_0x37577e,'limit':0x1,'order':[[_0xab7e('0x95'),'DESC']]}]},{'model':db[_0xab7e('0x9e')],'as':_0xab7e('0x9f')}]});})['then'](handleEntityNotFound(_0x4a353d,null))[_0xab7e('0x20')](function(_0x4555a1){if(_0x4555a1&&_0x4555a1[_0xab7e('0xa0')]){_0xbec26d[_0xab7e('0xa1')]=_0x4555a1;_0xbec26d[_0xab7e('0xa2')]=_0x4555a1[_0xab7e('0x9f')];_0xbec26d['list']=_0x4555a1[_0xab7e('0xa0')];_0xbec26d[_0xab7e('0xa2')]=_[_0xab7e('0xa3')](_0xbec26d[_0xab7e('0xa2')],['priority'],['asc']);if(_0xbec26d[_0xab7e('0xa1')][_0xab7e('0x9f')]){delete _0xbec26d[_0xab7e('0xa1')][_0xab7e('0x9f')];}if(_0xbec26d[_0xab7e('0xa1')][_0xab7e('0xa0')]&&_0xbec26d[_0xab7e('0xa1')]['List'][_0xab7e('0xa4')]['length']){return _0xbec26d[_0xab7e('0xa1')][_0xab7e('0xa0')][_0xab7e('0xa4')][0x0];}var _0x5d3907=_[_0xab7e('0x18')](_0x393b1d[_0xab7e('0x5f')],{'firstName':_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x98')],'ListId':_0x4555a1['ListId']});_0x5d3907[_0x393b1d['body'][_0xab7e('0x9b')]]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x98')];return db[_0xab7e('0x90')][_0xab7e('0x5e')](_0x5d3907,{'fields':_0x4fc89d,'raw':!![]});}})[_0xab7e('0x20')](handleEntityNotFound(_0x4a353d,null))[_0xab7e('0x20')](function(_0x4d0c7a){_0xbec26d[_0xab7e('0xa5')]=_0x4d0c7a;var _0x10d586=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xa6')];if(_0x393b1d['headers']['cf-connecting-ip']){_0x10d586=_0x393b1d[_0xab7e('0x8d')]['cf-connecting-ip'];}else if(_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xa7')]){_0x10d586=_[_0xab7e('0xa8')](_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xa7')][_0xab7e('0xa9')](','));}if(_0x4d0c7a){var _0x1a4ce3={'ContactId':_0x4d0c7a['id'],'ChatWebsiteId':_0x393b1d[_0xab7e('0x5c')]['id'],'from':(_0x4d0c7a['firstName']||'')+'\x20'+(_0x4d0c7a['lastName']||''),'customerIp':_0x10d586,'customerPort':_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xaa')]?_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xaa')]:null,'referer':_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xab')],'browserName':_0xa54467[_0xab7e('0xac')][_0xab7e('0x39')]&&_0xa54467[_0xab7e('0xac')][_0xab7e('0xad')]?util[_0xab7e('0xae')]('%s\x20%s',_0xa54467[_0xab7e('0xac')][_0xab7e('0x39')],_0xa54467['browser'][_0xab7e('0xad')]):'unknown','browserVersion':_0xa54467[_0xab7e('0xac')][_0xab7e('0xad')]||_0xab7e('0xaf'),'osName':util[_0xab7e('0xae')](_0xab7e('0xb0'),_0xa54467['os'][_0xab7e('0x39')],_0xa54467['os'][_0xab7e('0xad')]),'osVersion':_0xa54467['os']['version'],'deviceModel':_0xa54467[_0xab7e('0xb1')]['model']&&_0xa54467[_0xab7e('0xb1')][_0xab7e('0xb2')]?util[_0xab7e('0xae')](_0xab7e('0xb3'),_0xa54467['device'][_0xab7e('0x43')],_0xa54467[_0xab7e('0xb1')][_0xab7e('0xb2')],_0xa54467[_0xab7e('0xb1')][_0xab7e('0x41')]):null,'deviceVendor':_0xa54467[_0xab7e('0xb1')][_0xab7e('0xb2')],'deviceType':_0xa54467[_0xab7e('0xb1')][_0xab7e('0x41')],'formData':JSON['stringify'](_0x393b1d[_0xab7e('0x5f')])};var _0x791f67={'ChatWebsiteId':_0x393b1d[_0xab7e('0x5c')]['id'],'closed':![]};if(_0x393b1d['body'][_0xab7e('0xb4')]){_0x791f67[_0xab7e('0xb4')]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb4')];return db[_0xab7e('0xb5')][_0xab7e('0x5d')]({'where':_0x791f67})[_0xab7e('0x20')](function(_0x5294b8){if(_0x5294b8){return[_0x5294b8,![]];}_0x1a4ce3[_0xab7e('0xb4')]=_0x393b1d[_0xab7e('0x5f')]['threadId'];_0x1a4ce3[_0xab7e('0xb6')]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb6')];return db['ChatInteraction']['create'](_0x1a4ce3)[_0xab7e('0x20')](function(_0x2e7f3c){return[_0x2e7f3c,!![]];});});}_0x791f67[_0xab7e('0xb7')]=_0x4d0c7a['id'];if(_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb8')]&&_0x393b1d[_0xab7e('0x5f')]['interaction']['id']){_0x791f67['id']=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb8')]['id'];return db[_0xab7e('0xb5')][_0xab7e('0x5d')]({'where':_0x791f67})[_0xab7e('0x20')](function(_0x222f8a){if(_0x222f8a){return[_0x222f8a,![]];}return db[_0xab7e('0xb5')][_0xab7e('0x5e')](_0x1a4ce3)[_0xab7e('0x20')](function(_0x195685){return[_0x195685,!![]];});});}return db[_0xab7e('0xb5')][_0xab7e('0x5e')](_0x1a4ce3)[_0xab7e('0x20')](function(_0x11c388){return[_0x11c388,!![]];});}})[_0xab7e('0xb9')](function(_0x5d7a03,_0x5f1ef5){if(_0x5d7a03){_0x2d7037=_0x5f1ef5;if(!_0x5f1ef5){var _0x84c1c9={'from':(_0xbec26d[_0xab7e('0xa5')][_0xab7e('0xba')]||'')+'\x20'+(_0xbec26d[_0xab7e('0xa5')][_0xab7e('0xbb')]||'')};if(_0x393b1d['body']['threadId']&&_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xbc')]&&_0x393b1d['body'][_0xab7e('0xb4')]!=_0x393b1d['body']['messageId']){_0x84c1c9[_0xab7e('0xb4')]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xbc')];}return _0x5d7a03[_0xab7e('0x65')](_0x84c1c9);}else{return _0x5d7a03;}}})[_0xab7e('0x20')](function(_0x25027f){_0xbec26d[_0xab7e('0xb8')]=_0x25027f['get']({'plain':!![]});_0xbec26d['interaction'][_0xab7e('0xbd')]=_0x2d7037;if(_0xbec26d[_0xab7e('0xb8')][_0xab7e('0xbd')]){if(_0xbec26d[_0xab7e('0xa1')][_0xab7e('0xbe')]){_0xbec26d['applications'][_0xab7e('0xbf')]({'id':0x0,'priority':_0xbec26d[_0xab7e('0xa2')][_0xab7e('0x4a')]+0x1,'app':_0xab7e('0xc0'),'appdata':'unmanaged','interval':_0xab7e('0xc1')});}}return db['ChatMessage'][_0xab7e('0x5e')]({'body':_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x5f')],'ChatWebsiteId':_0x393b1d[_0xab7e('0x5c')]['id'],'ChatInteractionId':_0x25027f['id'],'direction':'in','ContactId':_0xbec26d[_0xab7e('0xa5')]['id'],'AttachmentId':_0x393b1d['body']['AttachmentId']});})[_0xab7e('0x20')](function(_0x54d9aa){_0xbec26d[_0xab7e('0x27')]=_0x54d9aa;if(_0xbec26d[_0xab7e('0xb8')][_0xab7e('0xc2')]){return db[_0xab7e('0xc3')]['find']({'attributes':['id','name'],'where':{'id':_0xbec26d['interaction'][_0xab7e('0xc2')]}})[_0xab7e('0x20')](function(_0xa30c24){if(_0xa30c24){_0xbec26d[_0xab7e('0xa2')][_0xab7e('0xc4')]({'id':0x0,'priority':0x0,'app':_0xab7e('0xc5'),'appdata':_0xa30c24[_0xab7e('0x39')]+','+(_0xbec26d[_0xab7e('0xa1')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0xbec26d['forcedOwnership']=!![];}return respondWithRpcPromise(_0xab7e('0xc6'),'startRouting',_0xbec26d);});}return respondWithRpcPromise(_0xab7e('0xc6'),'startRouting',_0xbec26d);})[_0xab7e('0x20')](function(_0x2645a8){respondWithRpcPromise(_0xab7e('0xc7'),_0xab7e('0xc7'),{'event':'notify','message':_0x2645a8},client9002);return _0x2645a8;})['then'](respondWithResult(_0x4a353d,null))[_0xab7e('0x2a')](handleError(_0x4a353d,null));};exports[_0xab7e('0xc8')]=function(_0x598c63,_0x3e408d,_0xc1209e){var _0x1ad7b0,_0x39087d,_0x4bbe1e;var _0xe70b01=[];var _0x22ae01=[];var _0x3df878={};var _0x42ac81=_0x598c63[_0xab7e('0xc9')]||[];var _0x5911df=[];var _0x279351;return db['CmContact'][_0xab7e('0x66')]()[_0xab7e('0x20')](function(_0x4c1526){if(!_0x4c1526){throw new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))](_0xab7e('0x92'));}_0x22ae01=_[_0xab7e('0x93')](_[_0xab7e('0x45')](_0x4c1526),[_0xab7e('0x94'),_0xab7e('0x95')]);_0xe70b01=_[_0xab7e('0x93')](_[_0xab7e('0x45')](_0x4c1526),['createdAt',_0xab7e('0x95'),_0xab7e('0x96'),_0xab7e('0x97')]);if(_0x598c63[_0xab7e('0x5f')]['id']){delete _0x598c63[_0xab7e('0x5f')]['id'];}if(_[_0xab7e('0x80')](_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')])){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)[_0xab7e('0x3a')](new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))]('from\x20is\x20mandatory'));}if(_[_0xab7e('0x80')](_0x598c63['body']['body'])||_0x598c63['body'][_0xab7e('0x5f')]===''){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)['send'](new db[(_0xab7e('0x91'))]['ValidationError'](_0xab7e('0x9a')));}if(_[_0xab7e('0x80')](_0x598c63[_0xab7e('0x5f')][_0xab7e('0xca')])){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)[_0xab7e('0x3a')](new db['Sequelize'][(_0xab7e('0x99'))](_0xab7e('0xcb')+_0xe70b01));}if(!_['includes'](_0xe70b01,_0x598c63['body'][_0xab7e('0xca')])){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)[_0xab7e('0x3a')](new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe70b01));}_0x3df878[_0x598c63[_0xab7e('0x5f')][_0xab7e('0xca')]]=_0x598c63[_0xab7e('0x5f')]['from'];})['then'](function(){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x598c63[_0xab7e('0x5c')]['id']},'include':[{'model':db[_0xab7e('0x9d')],'as':_0xab7e('0xa0')},{'model':db[_0xab7e('0xcc')],'as':_0xab7e('0xcc')}]});})[_0xab7e('0x20')](handleEntityNotFound(_0x3e408d,null))[_0xab7e('0x20')](function(_0x5c9b98){if(_0x5c9b98&&_0x5c9b98[_0xab7e('0xa0')]){_0x39087d=_0x5c9b98;var _0x59f1d5=_['defaults'](_0x598c63[_0xab7e('0x5f')],{'firstName':_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')],'phone':_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')],'ListId':_0x5c9b98[_0xab7e('0x97')]});_0x59f1d5[_0x598c63['body'][_0xab7e('0xca')]]=_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')];return db['CmContact'][_0xab7e('0xcd')]({'where':_0x3df878,'defaults':_0x59f1d5});}})[_0xab7e('0xb9')](function(_0x5014c3){if(_0x5014c3){_0x4bbe1e=_0x5014c3;var _0x3a458b=fs[_0xab7e('0xce')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],'server/files/templates/chatOfflineMessage.ejs'),_0xab7e('0xcf'));var _0x1a34e4=ejs[_0xab7e('0xd0')](_0x3a458b,{'body':_[_0xab7e('0xd1')](_0x598c63['body'][_0xab7e('0x5f')]),'bodyTitle':_0x39087d[_0xab7e('0xd2')]});return db[_0xab7e('0xd3')][_0xab7e('0x5e')]({'body':_0x1a34e4,'ContactId':_0x5014c3['id'],'ChatWebsiteId':_0x39087d['id']});}})[_0xab7e('0x20')](function(_0x26ac22){_0x279351=_0x26ac22;if(_0x42ac81[_0xab7e('0x4a')]){var _0x1a2346=_0x42ac81[_0xab7e('0x3e')](function(_0x25b630){return{'name':_0x25b630[_0xab7e('0xd4')],'basename':_0x25b630[_0xab7e('0x74')],'type':_0x25b630[_0xab7e('0xd5')],'ChatOfflineMessageId':_0x26ac22['id']};});_0x5911df=_0x1a2346[_0xab7e('0x3e')](_0x482503=>{var _0x16ccc1={'filename':_0x482503[_0xab7e('0x39')],'path':path[_0xab7e('0x82')](config['root'],_0xab7e('0xd6'),'files',_0xab7e('0xd7'),_0xab7e('0xd8'),_0x482503['basename'])};return _0x16ccc1;});if(!_0x39087d[_0xab7e('0xd9')]){return db['sequelize'][_0xab7e('0xda')](function(_0x1dd8da){return db[_0xab7e('0xdb')][_0xab7e('0xdc')](_0x1a2346,{'transaction':_0x1dd8da});});}}})[_0xab7e('0x20')](function(){if(_0x279351){_0x1ad7b0=_0x279351;return db[_0xab7e('0xcc')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xab7e('0xdd')],'as':_0xab7e('0xde'),'raw':!![]}]});}})[_0xab7e('0x20')](function(_0x488142){if(_0x488142&&_0x488142['Smtp']&&_0x39087d[_0xab7e('0xdf')]&&_0x39087d[_0xab7e('0xe0')]){var _0x4523dd={'tls':{'rejectUnauthorized':![]}};if(_0x488142[_0xab7e('0xde')][_0xab7e('0xe1')]){_0x4523dd['service']=_0x488142['Smtp']['service'];}else{_0x4523dd['host']=_0x488142[_0xab7e('0xde')][_0xab7e('0xe2')];_0x4523dd[_0xab7e('0xe3')]=_0x488142[_0xab7e('0xde')][_0xab7e('0xe3')];_0x4523dd[_0xab7e('0xe4')]=_0x488142['Smtp'][_0xab7e('0xe4')];}if(_0x488142[_0xab7e('0xde')][_0xab7e('0xe5')]){_0x4523dd[_0xab7e('0xe6')]={'user':_0x488142[_0xab7e('0xde')][_0xab7e('0x60')],'pass':_0x488142[_0xab7e('0xde')][_0xab7e('0xe7')]};}return respondWithRpcPromise(_0xab7e('0xe8'),_0xab7e('0xe9'),{'account':_0x4523dd,'message':{'from':util['format'](_0xab7e('0xea'),_0x488142[_0xab7e('0x39')],_0x488142[_0xab7e('0xeb')]||_0x488142[_0xab7e('0xde')][_0xab7e('0x60')]),'to':_0x39087d[_0xab7e('0xe0')],'subject':_0x39087d[_0xab7e('0xec')],'html':_0x1ad7b0['body'],'attachments':_0x5911df}},client9003)[_0xab7e('0x20')](function(){return _0x1ad7b0;})[_0xab7e('0x2a')](function(_0x429dd3){console[_0xab7e('0x25')](_0x429dd3);});}})[_0xab7e('0x20')](function(){if(_0x39087d&&_0x39087d['openNewInteraction']&&_0x39087d[_0xab7e('0xed')]){var _0x3fe803=[];if(_0x42ac81[_0xab7e('0x4a')]){_0x3fe803=_0x42ac81[_0xab7e('0x3e')](function(_0x22c4bc){return{'name':_0x22c4bc[_0xab7e('0xd4')],'basename':_0x22c4bc[_0xab7e('0x74')],'type':_0x22c4bc[_0xab7e('0xd5')],'ChatOfflineMessageId':_0x279351['id']};});}var _0x7c85e8;if(!_[_0xab7e('0x80')](_0x39087d[_0xab7e('0xee')])){var _0x14e774=_[_0xab7e('0x3e')](_0x598c63['body'],function(_0x15f917){return _0x15f917;});var _0x19af67=_[_0xab7e('0xef')](_0x14e774)[0x0];var _0x17a2d1=_[_0xab7e('0xf0')](_0x19af67,function(_0x2fbe2e){return _0x2fbe2e;});_0x7c85e8=_0x17a2d1[0x1][_0x39087d[_0xab7e('0xee')]];}var _0xeba857={'from':_0x4bbe1e['email'],'firstName':_0x4bbe1e[_0xab7e('0xba')],'lastName':_0x4bbe1e['lastName'],'mapKey':_0xab7e('0xeb'),'message':{'from':_0x4bbe1e[_0xab7e('0xeb')],'to':_0x39087d[_0xab7e('0xcc')][_0xab7e('0xeb')],'cc':'','subject':_[_0xab7e('0x80')](_0x7c85e8)?_0x39087d[_0xab7e('0xec')]:_0x7c85e8,'messageId':'','sentAt':new Date(),'attach':_0x3fe803['length'],'attachments':_0x3fe803,'originChannel':'Chat','ChatWebsiteId':_0x39087d['id'],'ChatOfflineMessageId':_0x1ad7b0['id'],'originTo':_0x39087d[_0xab7e('0xcc')][_0xab7e('0xeb')]},'body':_0x1ad7b0[_0xab7e('0x5f')]};var _0x39b3bb={'account':{'id':_0x39087d[_0xab7e('0xed')]},'body':_0xeba857,'log':_0xab7e('0xf1')};return respondWithRpcPromise(_0xab7e('0xf1'),_0xab7e('0xf2'),_0x39b3bb,client9001)[_0xab7e('0x20')](function(){return _0x1ad7b0;})[_0xab7e('0x2a')](function(_0x2199f8){console[_0xab7e('0x25')](_0x2199f8);});}return;})[_0xab7e('0x20')](function(){if(_0x1ad7b0){return _0x1ad7b0;}})['then'](respondWithResult(_0x3e408d,null))[_0xab7e('0x2a')](function(_0x3e23c1){console[_0xab7e('0x25')]('catch',_0x3e23c1);for(var _0x269467 of _0x42ac81){var _0x2aa049=path[_0xab7e('0x82')](config['root'],'server',_0xab7e('0xc9'),_0xab7e('0xd7'),_0xab7e('0xd8'),_0x269467[_0xab7e('0x74')]);fs_extra[_0xab7e('0xf3')](_0x2aa049)[_0xab7e('0x2a')](function(_0x4b56fe){console[_0xab7e('0x25')](_0xab7e('0xf4'),_0x2aa049,_0x4b56fe);});}});};exports['addInteraction']=function(_0x468f81,_0x12ea06,_0xc02cdc){return db[_0xab7e('0xb5')]['find']({'where':{'id':_0x468f81['params']['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x12ea06,null))['then'](function(_0xa7b65b){if(_0xa7b65b){return _0xa7b65b[_0xab7e('0xf5')](_0x468f81['body'][_0xab7e('0x70')],_['omit'](_0x468f81[_0xab7e('0x5f')],['ids','id'])||{});}})[_0xab7e('0x20')](respondWithResult(_0x12ea06,null))['catch'](handleError(_0x12ea06,null));};exports[_0xab7e('0xf6')]=function(_0x2d1e5d,_0xe8f8b2,_0xd3d5cc){var _0x4402ad={'raw':![],'where':{}};var _0x3f2877={};var _0x1f4c61={'count':0x0,'rows':[]};return db[_0xab7e('0x56')]['findOne']({'where':{'id':_0x2d1e5d[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0xe8f8b2,null))[_0xab7e('0x20')](function(_0x3e5c21){if(_0x3e5c21){_0x3f2877[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatInteraction'][_0xab7e('0x3f')]);_0x3f2877[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x2d1e5d['query']);_0x3f2877['filters']=_['intersection'](_0x3f2877[_0xab7e('0x43')],_0x3f2877[_0xab7e('0x44')]);_0x4402ad[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x3f2877[_0xab7e('0x43')],qs['fields'](_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x48')]));_0x4402ad[_0xab7e('0x49')]=_0x4402ad['attributes'][_0xab7e('0x4a')]?_0x4402ad[_0xab7e('0x49')]:_0x3f2877['model'];if(!_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x4b')]('nolimit')){_0x4402ad['limit']=qs[_0xab7e('0x4d')](_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x4402ad[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x4402ad['order']=qs[_0xab7e('0x4f')](_0x2d1e5d[_0xab7e('0x44')]['sort']);_0x4402ad[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x2d1e5d['query'],_0x3f2877[_0xab7e('0x46')]));_0x4402ad[_0xab7e('0x50')][_0xab7e('0x68')]=_0x3e5c21['id'];if(_0x2d1e5d['query'][_0xab7e('0x54')]){_0x4402ad[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x4402ad[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x4402ad[_0xab7e('0x49')],function(_0x25f246){var _0x5cba7b={};_0x5cba7b[_0x25f246]={'$like':'%'+_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x5cba7b;})});}_0x4402ad=_[_0xab7e('0x52')]({},_0x4402ad,_0x2d1e5d['options']);return db[_0xab7e('0xb5')]['count']({'where':_0x4402ad[_0xab7e('0x50')]})[_0xab7e('0x20')](function(_0x236b95){_0x1f4c61[_0xab7e('0x31')]=_0x236b95;if(_0x2d1e5d['query'][_0xab7e('0x57')]){_0x4402ad[_0xab7e('0x58')]=[{'model':db[_0xab7e('0x90')],'as':'Contact','required':![]},{'model':db[_0xab7e('0xc3')],'as':'Owner','attributes':[_0xab7e('0x39'),_0xab7e('0xf7'),'internal'],'required':![]},{'model':db[_0xab7e('0xf8')],'as':_0xab7e('0xf9'),'attributes':['id',_0xab7e('0x39'),_0xab7e('0xfa')],'where':_0x2d1e5d[_0xab7e('0x44')]['tag']?{'id':_0x2d1e5d[_0xab7e('0x44')]['tag']}:undefined,'required':_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0xfb')]?!![]:![]}];}return db[_0xab7e('0xb5')][_0xab7e('0x59')](_0x4402ad);})[_0xab7e('0x20')](function(_0x329c00){_0x1f4c61['rows']=_0x329c00;return _0x1f4c61;});}})[_0xab7e('0x20')](respondWithFilteredResult(_0xe8f8b2,_0x4402ad))[_0xab7e('0x2a')](handleError(_0xe8f8b2,null));};function iftimePromise(_0x201a8c,_0x38b436){return respondWithRpcPromise(_0xab7e('0xfc'),_0xab7e('0xfd'),{'command':_0x38b436[_0xab7e('0xfe')]?util['format'](_0xab7e('0xff'),_0x201a8c[_0xab7e('0x100')],_0x38b436['timezone']):util[_0xab7e('0xae')](_0xab7e('0x101'),_0x201a8c[_0xab7e('0x100')])},client9002)[_0xab7e('0x20')](function(_0x201222){var _0x37a6a1=_0x201222&&_0x201222[_0xab7e('0x102')]('true')>=0x0?!![]:![];logger[_0xab7e('0x28')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x38b436['id'],_0x201a8c['id'],_0x201a8c['interval'],_0x37a6a1?_0xab7e('0x103'):_0xab7e('0x104'),_0x38b436['timezone']?_0x38b436[_0xab7e('0xfe')]:_0xab7e('0x105'));return _0x37a6a1;})[_0xab7e('0x2a')](function(_0x3ff952){logger[_0xab7e('0x25')](_0xab7e('0x106'),_0x38b436['id'],_0x201a8c['id'],_0x201a8c['interval'],util[_0xab7e('0x107')](_0x3ff952,{'showHidden':![],'depth':null}),_0x38b436[_0xab7e('0xfe')]?_0x38b436[_0xab7e('0xfe')]:'No\x20timezone');return![];});}exports[_0xab7e('0xfd')]=function(_0x38b44b,_0x20eacd,_0x47494b){var _0x417709=0x0;var _0x5a51ad=0x0;var _0x53a365=![];var _0x3cb9cb;var _0x5e4bd1;return db[_0xab7e('0x56')]['find']({'where':{'id':_0x38b44b[_0xab7e('0x5c')]['id']},'include':[{'model':db[_0xab7e('0x108')],'as':_0xab7e('0x108'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xab7e('0x100')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x20eacd,null))[_0xab7e('0x20')](function(_0x1fa7c2){if(_0x1fa7c2){_0x3cb9cb=_0x1fa7c2;return _0x1fa7c2['getProactiveActions']({'raw':!![]});}})[_0xab7e('0x20')](function(_0x145178){if(_0x3cb9cb){if(_0x145178){_0x5e4bd1=_0x145178;}}return require(_0xab7e('0x15'))[_0xab7e('0x7e')]();})[_0xab7e('0x20')](function(_0x1ec21e){if(_0x1ec21e){_0x5a51ad=_0x1ec21e[_0xab7e('0x109')];_0x53a365=_0x1ec21e[_0xab7e('0x7f')];}})['then'](function(){return db[_0xab7e('0xb5')][_0xab7e('0x31')]({'where':{'closed':![]}});})[_0xab7e('0x20')](function(_0x1bfec0){_0x417709=_0x1bfec0;if(_0x5a51ad&&_0x1bfec0>_0x5a51ad){return db[_0xab7e('0x10a')][_0xab7e('0x6a')]({'where':{'id':0x1}})[_0xab7e('0x20')](function(_0x2c41c7){if(_0x2c41c7){_0x2c41c7[_0xab7e('0x10b')](_0xab7e('0x10c'));}});}})[_0xab7e('0x20')](function(){if(_0x3cb9cb['Interval']&&_0x3cb9cb['Interval'][_0xab7e('0x10d')]){var _0x15cd95=[];for(var _0x50fe9a=0x0;_0x50fe9a<_0x3cb9cb[_0xab7e('0x108')][_0xab7e('0x10d')][_0xab7e('0x4a')];_0x50fe9a++){var _0x2f26da=_0x3cb9cb[_0xab7e('0x108')][_0xab7e('0x10d')][_0x50fe9a][_0xab7e('0x34')]({'plain':!![]});_0x15cd95[_0xab7e('0xbf')](iftimePromise(_0x2f26da,_0x3cb9cb));}return BPromise[_0xab7e('0x10e')](_0x15cd95)['then'](function(_0x37d156){return _[_0xab7e('0x10f')](_0x37d156);});}else{return!![];}})[_0xab7e('0x20')](function(_0x235688){var _0x30a3bf=fs['readFileSync'](path['join'](config[_0xab7e('0x7c')],_0xab7e('0x110')),_0xab7e('0xcf'));var _0x540e2c={'remote':_0x3cb9cb[_0xab7e('0x111')],'query':querystring[_0xab7e('0x24')](_['merge'](_0x3cb9cb['get']({'plain':!![]}),{'customerIp':_0x38b44b[_0xab7e('0x8d')]['x-forwarded-for']||_0x38b44b[_0xab7e('0x8d')][_0xab7e('0x112')]||_0x38b44b[_0xab7e('0x113')][_0xab7e('0x114')]||_0x38b44b['ip'],'referer':_0x38b44b[_0xab7e('0x8d')][_0xab7e('0xab')],'openedInteractions':_0x417709,'maxInteractions':_0x5a51ad,'virtual':_0x53a365[_0xab7e('0x109')],'online':_0x235688,'custom':_0x53a365}))[_0xab7e('0x115')](/'/g,'\x5c\x27')};_0x20eacd[_0xab7e('0x3a')](ejs['render'](Mustache[_0xab7e('0xd0')](_0x30a3bf,_0x540e2c),{'proactiveActions':_0x5e4bd1,'alignment':_0x3cb9cb[_0xab7e('0x116')],'verticalAlignment':_0x3cb9cb['verticalAlignment'],'div_color':_0x3cb9cb[_0xab7e('0xfa')],'text_color':_0x3cb9cb[_0xab7e('0x117')],'button_color':_0x3cb9cb['color_button'],'background_color':_0x3cb9cb[_0xab7e('0x118')]}));})[_0xab7e('0x2a')](handleError(_0x20eacd,null));};exports[_0xab7e('0x119')]=function(_0x4240c1,_0x5f16e8,_0x51a01d){return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x4240c1[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x5f16e8,null))['then'](function(_0x71534d){if(_0x71534d){return db['sequelize'][_0xab7e('0xda')](function(_0x532006){return db[_0xab7e('0x9e')][_0xab7e('0x37')]({'where':{'ChatWebsiteId':_0x4240c1[_0xab7e('0x5c')]['id']},'transaction':_0x532006})['then'](function(_0x45ea0a){var _0x5ae05f=_[_0xab7e('0x3e')](_0x4240c1[_0xab7e('0x5f')],function(_0x3c7eda){_0x3c7eda[_0xab7e('0x68')]=_0x4240c1[_0xab7e('0x5c')]['id'];return _0x3c7eda;});return db[_0xab7e('0x9e')]['bulkCreate'](_0x5ae05f,{'transaction':_0x532006});});})['then'](function(){return db['ChatApplication'][_0xab7e('0x11a')]({'where':{'ChatWebsiteId':_0x4240c1[_0xab7e('0x5c')]['id']},'order':_0xab7e('0x11b')});});}})[_0xab7e('0x20')](respondWithResult(_0x5f16e8,null))[_0xab7e('0x2a')](handleError(_0x5f16e8,null));};exports[_0xab7e('0x11c')]=function(_0x24d72e,_0x245169,_0x4fc3a1){var _0x187957={};var _0x2a3691={};var _0xcfb6a0;var _0x2c8e57;return db[_0xab7e('0x56')]['findOne']({'where':{'id':_0x24d72e[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x245169,null))[_0xab7e('0x20')](function(_0x41cf53){if(_0x41cf53){_0xcfb6a0=_0x41cf53;_0x2a3691[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatApplication'][_0xab7e('0x3f')]);_0x2a3691['query']=_[_0xab7e('0x45')](_0x24d72e[_0xab7e('0x44')]);_0x2a3691[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x2a3691[_0xab7e('0x43')],_0x2a3691[_0xab7e('0x44')]);_0x187957[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x2a3691['model'],qs[_0xab7e('0x48')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x48')]));_0x187957[_0xab7e('0x49')]=_0x187957[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x187957['attributes']:_0x2a3691[_0xab7e('0x43')];_0x187957[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x187957[_0xab7e('0x50')]=qs['filters'](_[_0xab7e('0x51')](_0x24d72e[_0xab7e('0x44')],_0x2a3691['filters']));if(_0x24d72e[_0xab7e('0x44')][_0xab7e('0x54')]){_0x187957[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x187957[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x187957[_0xab7e('0x49')],function(_0x45fab6){var _0x23d8c7={};_0x23d8c7[_0x45fab6]={'$like':'%'+_0x24d72e['query'][_0xab7e('0x54')]+'%'};return _0x23d8c7;})});}_0x187957=_[_0xab7e('0x52')]({},_0x187957,_0x24d72e[_0xab7e('0x55')]);return _0xcfb6a0[_0xab7e('0x11c')](_0x187957);}})[_0xab7e('0x20')](function(_0x19d388){if(_0x19d388){_0x2c8e57=_0x19d388[_0xab7e('0x4a')];if(!_0x24d72e[_0xab7e('0x44')]['hasOwnProperty'](_0xab7e('0x4c'))){_0x187957[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x187957[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x2f')]);}return _0xcfb6a0[_0xab7e('0x11c')](_0x187957);}})[_0xab7e('0x20')](function(_0xcda0c2){if(_0xcda0c2){return _0xcda0c2?{'count':_0x2c8e57,'rows':_0xcda0c2}:null;}})[_0xab7e('0x20')](respondWithResult(_0x245169,null))[_0xab7e('0x2a')](handleError(_0x245169,null));};exports[_0xab7e('0x11d')]=function(_0x4923f6,_0x1789fe,_0x290b52){return db['chatProactiveAction']['find']({'where':{'id':_0x4923f6[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1789fe,null))[_0xab7e('0x20')](function(_0x2e5937){if(_0x2e5937){return _0x2e5937[_0xab7e('0x11d')](_0x4923f6['body'][_0xab7e('0x70')],_[_0xab7e('0x11e')](_0x4923f6['body'],[_0xab7e('0x70'),'id'])||{});}})[_0xab7e('0x20')](respondWithResult(_0x1789fe,null))[_0xab7e('0x2a')](handleError(_0x1789fe,null));};exports[_0xab7e('0x11f')]=function(_0x59a5e4,_0x56b15e,_0x39242b){var _0x14e08b={};var _0x5b2b3a={};var _0x1a12bd;var _0x486986;return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x59a5e4['params']['id']}})['then'](handleEntityNotFound(_0x56b15e,null))[_0xab7e('0x20')](function(_0x431b78){if(_0x431b78){_0x1a12bd=_0x431b78;_0x5b2b3a[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatProactiveAction'][_0xab7e('0x3f')]);_0x5b2b3a[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x59a5e4[_0xab7e('0x44')]);_0x5b2b3a[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x5b2b3a[_0xab7e('0x43')],_0x5b2b3a[_0xab7e('0x44')]);_0x14e08b[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x5b2b3a[_0xab7e('0x43')],qs['fields'](_0x59a5e4[_0xab7e('0x44')][_0xab7e('0x48')]));_0x14e08b[_0xab7e('0x49')]=_0x14e08b[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x14e08b[_0xab7e('0x49')]:_0x5b2b3a['model'];_0x14e08b[_0xab7e('0x4e')]=qs['sort'](_0x59a5e4[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x14e08b[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x59a5e4[_0xab7e('0x44')],_0x5b2b3a[_0xab7e('0x46')]));if(_0x59a5e4['query'][_0xab7e('0x54')]){_0x14e08b[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x14e08b[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x14e08b[_0xab7e('0x49')],function(_0xe55f5b){var _0xaadb8e={};_0xaadb8e[_0xe55f5b]={'$like':'%'+_0x59a5e4[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0xaadb8e;})});}_0x14e08b=_[_0xab7e('0x52')]({},_0x14e08b,_0x59a5e4[_0xab7e('0x55')]);return _0x1a12bd[_0xab7e('0x11f')](_0x14e08b);}})['then'](function(_0x49b934){if(_0x49b934){_0x486986=_0x49b934[_0xab7e('0x4a')];if(!_0x59a5e4[_0xab7e('0x44')]['hasOwnProperty'](_0xab7e('0x4c'))){_0x14e08b[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x59a5e4['query'][_0xab7e('0x4d')]);_0x14e08b[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x59a5e4['query'][_0xab7e('0x2f')]);}return _0x1a12bd[_0xab7e('0x11f')](_0x14e08b);}})[_0xab7e('0x20')](function(_0x33b986){if(_0x33b986){return _0x33b986?{'count':_0x486986,'rows':_0x33b986}:null;}})[_0xab7e('0x20')](respondWithResult(_0x56b15e,null))['catch'](handleError(_0x56b15e,null));};exports['getFields']=function(_0x51dd89,_0x4b514d,_0x57b5f8){var _0x41ec3a=_0x51dd89[_0xab7e('0x44')][_0xab7e('0x120')]===_0xab7e('0x121')?_0xab7e('0x122'):'onlineForm';return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'attributes':['id',_0x41ec3a],'where':{'id':_0x51dd89[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4b514d,null))[_0xab7e('0x20')](function(_0x343ce5){if(_0x343ce5){var _0x3ab911=_0x343ce5[_0x41ec3a];var _0x1d4b2f=_0x3ab911&&_0x3ab911['items']?_0x3ab911[_0xab7e('0x123')]:[];_0x4b514d[_0xab7e('0x3a')]({'fromKey':_[_0xab7e('0x80')](_0x3ab911[_0xab7e('0x124')])?undefined:_0x3ab911[_0xab7e('0x124')],'count':_0x1d4b2f[_0xab7e('0x4a')],'rows':_0x1d4b2f});}})[_0xab7e('0x2a')](handleError(_0x4b514d,null));};exports[_0xab7e('0x125')]=function(_0x300372,_0x261d33,_0x1644b7){var _0x3a7b9d={'raw':![],'where':{}};var _0x4f49cc={};var _0x4fdfcc={'count':0x0,'rows':[]};return db[_0xab7e('0x56')]['findOne']({'where':{'id':_0x300372[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x261d33,null))[_0xab7e('0x20')](function(_0x49d4e7){if(_0x49d4e7){_0x4f49cc[_0xab7e('0x43')]=_[_0xab7e('0x45')](db[_0xab7e('0xd3')]['rawAttributes']);_0x4f49cc[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x300372[_0xab7e('0x44')]);_0x4f49cc['filters']=_[_0xab7e('0x47')](_0x4f49cc[_0xab7e('0x43')],_0x4f49cc[_0xab7e('0x44')]);_0x3a7b9d[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x4f49cc['model'],qs[_0xab7e('0x48')](_0x300372[_0xab7e('0x44')][_0xab7e('0x48')]));_0x3a7b9d[_0xab7e('0x49')]=_0x3a7b9d[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x3a7b9d[_0xab7e('0x49')]:_0x4f49cc[_0xab7e('0x43')];if(!_0x300372['query'][_0xab7e('0x4b')]('nolimit')){_0x3a7b9d[_0xab7e('0x4d')]=qs['limit'](_0x300372[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x3a7b9d[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x300372[_0xab7e('0x44')]['offset']);}_0x3a7b9d[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x300372[_0xab7e('0x44')]['sort']);_0x3a7b9d[_0xab7e('0x50')]=qs['filters'](_[_0xab7e('0x51')](_0x300372[_0xab7e('0x44')],_0x4f49cc[_0xab7e('0x46')]));_0x3a7b9d['where']['ChatWebsiteId']=_0x49d4e7['id'];if(_0x300372[_0xab7e('0x44')]['filter']){_0x3a7b9d[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x3a7b9d[_0xab7e('0x50')],{'$or':_['map'](_0x3a7b9d['attributes'],function(_0x53dcc3){var _0x71e39a={};_0x71e39a[_0x53dcc3]={'$like':'%'+_0x300372[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x71e39a;})});}_0x3a7b9d=_['merge']({},_0x3a7b9d,_0x300372[_0xab7e('0x55')]);return db[_0xab7e('0xd3')][_0xab7e('0x31')]({'where':_0x3a7b9d['where']})[_0xab7e('0x20')](function(_0x3fd9c7){_0x4fdfcc['count']=_0x3fd9c7;if(_0x300372['query'][_0xab7e('0x57')]){_0x3a7b9d[_0xab7e('0x58')]=[{'all':!![]}];}else{_0x3a7b9d['include']=[{'model':db[_0xab7e('0x90')],'as':_0xab7e('0x126'),'required':![]},{'model':db[_0xab7e('0xdb')],'as':'Attachments','required':![]}];}return db[_0xab7e('0xd3')]['findAll'](_0x3a7b9d);})[_0xab7e('0x20')](function(_0xa90a97){_0x4fdfcc[_0xab7e('0x5a')]=_0xa90a97;return _0x4fdfcc;});}})[_0xab7e('0x20')](respondWithFilteredResult(_0x261d33,_0x3a7b9d))[_0xab7e('0x2a')](handleError(_0x261d33,null));};exports[_0xab7e('0x127')]=function(_0x4fc0df,_0x27995c,_0x4e0e10){return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x4fc0df[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x27995c,null))[_0xab7e('0x20')](function(_0x5f10b0){if(_0x5f10b0){return _0x5f10b0[_0xab7e('0x127')](_0x4fc0df[_0xab7e('0x5f')][_0xab7e('0x70')],_[_0xab7e('0x11e')](_0x4fc0df['body'],['ids','id'])||{})[_0xab7e('0xb9')](function(_0xfc4710){for(var _0x661b99=0x0;_0x661b99<_0x4fc0df[_0xab7e('0x5f')][_0xab7e('0x70')][_0xab7e('0x4a')];_0x661b99+=0x1){socket[_0xab7e('0x128')](_0xab7e('0x129'),{'UserId':Number(_0x4fc0df[_0xab7e('0x5f')][_0xab7e('0x70')][_0x661b99]),'ChatWebsiteId':Number(_0x4fc0df['params']['id'])});}return _0xfc4710;});}})[_0xab7e('0x20')](respondWithResult(_0x27995c,null))[_0xab7e('0x2a')](handleError(_0x27995c,null));};exports['removeAgents']=function(_0x39f782,_0x54ef60,_0x30f4ae){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x39f782['params']['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x54ef60,null))[_0xab7e('0x20')](function(_0x378f37){if(_0x378f37){return _0x378f37[_0xab7e('0x12a')](_0x39f782[_0xab7e('0x44')][_0xab7e('0x70')])[_0xab7e('0x20')](function(){if(_[_0xab7e('0x12b')](_0x39f782[_0xab7e('0x44')]['ids'])){for(var _0x170ac4=0x0;_0x170ac4<_0x39f782[_0xab7e('0x44')][_0xab7e('0x70')]['length'];_0x170ac4+=0x1){socket[_0xab7e('0x128')](_0xab7e('0x12c'),{'UserId':Number(_0x39f782[_0xab7e('0x44')][_0xab7e('0x70')][_0x170ac4]),'ChatWebsiteId':Number(_0x39f782[_0xab7e('0x5c')]['id'])});}}else{socket[_0xab7e('0x128')](_0xab7e('0x12c'),{'UserId':Number(_0x39f782['query']['ids']),'ChatWebsiteId':Number(_0x39f782[_0xab7e('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x54ef60,null))[_0xab7e('0x2a')](handleError(_0x54ef60,null));};exports[_0xab7e('0x12d')]=function(_0x5c75c9,_0x4d7d6c,_0x4176d6){var _0x4de977={};var _0x1a9534={};var _0xf113a9;var _0x3a9c06;return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x5c75c9['params']['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4d7d6c,null))[_0xab7e('0x20')](function(_0x40575a){if(_0x40575a){_0xf113a9=_0x40575a;_0x1a9534[_0xab7e('0x43')]=_[_0xab7e('0x45')](db[_0xab7e('0xc3')]['rawAttributes']);_0x1a9534['query']=_['keys'](_0x5c75c9[_0xab7e('0x44')]);_0x1a9534['filters']=_[_0xab7e('0x47')](_0x1a9534[_0xab7e('0x43')],_0x1a9534[_0xab7e('0x44')]);_0x4de977[_0xab7e('0x49')]=_['intersection'](_0x1a9534[_0xab7e('0x43')],qs[_0xab7e('0x48')](_0x5c75c9['query'][_0xab7e('0x48')]));_0x4de977[_0xab7e('0x49')]=_0x4de977[_0xab7e('0x49')]['length']?_0x4de977[_0xab7e('0x49')]:_0x1a9534[_0xab7e('0x43')];_0x4de977[_0xab7e('0x4e')]=qs['sort'](_0x5c75c9[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x4de977[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x5c75c9[_0xab7e('0x44')],_0x1a9534[_0xab7e('0x46')]));if(_0x5c75c9[_0xab7e('0x44')][_0xab7e('0x54')]){_0x4de977['where']=_[_0xab7e('0x52')](_0x4de977[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x4de977[_0xab7e('0x49')],function(_0xd2a692){var _0x10c4be={};_0x10c4be[_0xd2a692]={'$like':'%'+_0x5c75c9[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x10c4be;})});}_0x4de977=_[_0xab7e('0x52')]({},_0x4de977,_0x5c75c9[_0xab7e('0x55')]);return _0xf113a9['getAgents'](_0x4de977);}})[_0xab7e('0x20')](function(_0x4e838a){if(_0x4e838a){_0x3a9c06=_0x4e838a[_0xab7e('0x4a')];if(!_0x5c75c9['query'][_0xab7e('0x4b')](_0xab7e('0x4c'))){_0x4de977['limit']=qs[_0xab7e('0x4d')](_0x5c75c9['query'][_0xab7e('0x4d')]);_0x4de977[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x5c75c9[_0xab7e('0x44')]['offset']);}return _0xf113a9[_0xab7e('0x12d')](_0x4de977);}})[_0xab7e('0x20')](function(_0x19eaf7){if(_0x19eaf7){return _0x19eaf7?{'count':_0x3a9c06,'rows':_0x19eaf7}:null;}})['then'](respondWithResult(_0x4d7d6c,null))['catch'](handleError(_0x4d7d6c,null));};
\ No newline at end of file
+var _0x5453=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','find','create','body','user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','Disposition','getDispositions','hasOwnProperty','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','describe','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','asc','account','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','ContactId','interaction','spread','contact','messageId','created','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','agent','*,*,*,*','forcedOwnership','Start','EventManager','offline','files','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','License','increment','push','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','color','textColor','addApplications','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','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','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','reject','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x1cd0cd,_0x3f10fa){var _0x46405d=function(_0x97dcc0){while(--_0x97dcc0){_0x1cd0cd['push'](_0x1cd0cd['shift']());}};_0x46405d(++_0x3f10fa);}(_0x5453,0xe9));var _0x3545=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x5453[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x3545('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3545('0x1'));var jsonpatch=require(_0x3545('0x2'));var rp=require(_0x3545('0x3'));var moment=require(_0x3545('0x4'));var BPromise=require(_0x3545('0x5'));var Mustache=require(_0x3545('0x6'));var util=require('util');var path=require(_0x3545('0x7'));var sox=require(_0x3545('0x8'));var csv=require('to-csv');var ejs=require(_0x3545('0x9'));var fs=require('fs');var fs_extra=require(_0x3545('0xa'));var _=require(_0x3545('0xb'));var squel=require(_0x3545('0xc'));var crypto=require(_0x3545('0xd'));var jsforce=require(_0x3545('0xe'));var deskjs=require(_0x3545('0xf'));var toCsv=require(_0x3545('0x10'));var querystring=require(_0x3545('0x11'));var Papa=require(_0x3545('0x12'));var Redis=require(_0x3545('0x13'));var authService=require(_0x3545('0x14'));var qs=require(_0x3545('0x15'));var as=require(_0x3545('0x16'));var hardwareService=require(_0x3545('0x17'));var logger=require(_0x3545('0x18'))(_0x3545('0x19'));var utils=require('../../config/utils');var config=require(_0x3545('0x1a'));var licenseUtil=require(_0x3545('0x1b'));var db=require('../../mysqldb')['db'];config[_0x3545('0x1c')]=_[_0x3545('0x1d')](config[_0x3545('0x1c')],{'host':_0x3545('0x1e'),'port':0x18eb});var socket=require(_0x3545('0x1f'))(new Redis(config[_0x3545('0x1c')]));require(_0x3545('0x20'))[_0x3545('0x21')](socket);var jayson=require(_0x3545('0x22'));var client=jayson[_0x3545('0x23')][_0x3545('0x24')]({'port':0x232c});var client9002=jayson['client'][_0x3545('0x24')]({'port':0x232a});var client9003=jayson[_0x3545('0x23')][_0x3545('0x24')]({'port':0x232b});var client9001=jayson[_0x3545('0x23')][_0x3545('0x24')]({'port':0x2329});function respondWithRpcPromise(_0x5e946f,_0x402e52,_0x2bc606,_0x503359){return new BPromise(function(_0x3b43c1,_0x378561){var _0x2e589e=_0x503359||client;return _0x2e589e[_0x3545('0x25')](_0x5e946f,_0x2bc606)[_0x3545('0x26')](function(_0x2d6965){logger[_0x3545('0x27')](_0x3545('0x28'),_0x402e52,_0x3545('0x29'));logger[_0x3545('0x2a')](_0x3545('0x2b'),_0x402e52,_0x3545('0x29'),JSON[_0x3545('0x2c')](_0x2d6965));if(_0x2d6965['error']){if(_0x2d6965[_0x3545('0x2d')][_0x3545('0x2e')]===0x1f4){logger[_0x3545('0x2d')](_0x3545('0x28'),_0x402e52,_0x2d6965[_0x3545('0x2d')][_0x3545('0x2f')]);return _0x378561(_0x2d6965[_0x3545('0x2d')]['message']);}logger[_0x3545('0x2d')]('ChatWebsite,\x20%s,\x20%s',_0x402e52,_0x2d6965[_0x3545('0x2d')]['message']);return _0x3b43c1(_0x2d6965[_0x3545('0x2d')][_0x3545('0x2f')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x402e52,_0x3545('0x29'));_0x3b43c1(_0x2d6965[_0x3545('0x30')][_0x3545('0x2f')]);}})[_0x3545('0x31')](function(_0x349f7a){logger[_0x3545('0x2d')](_0x3545('0x28'),_0x402e52,_0x349f7a);_0x378561(_0x349f7a);});});}function respondWithStatusCode(_0x228479,_0x2f5391){_0x2f5391=_0x2f5391||0xcc;return function(_0x259574){if(_0x259574){return _0x228479[_0x3545('0x32')](_0x2f5391);}return _0x228479['status'](_0x2f5391)[_0x3545('0x33')]();};}function respondWithResult(_0x8c3853,_0x8062de){_0x8062de=_0x8062de||0xc8;return function(_0x46b86c){if(_0x46b86c){return _0x8c3853[_0x3545('0x34')](_0x8062de)[_0x3545('0x35')](_0x46b86c);}};}function respondWithFilteredResult(_0x4a8443,_0x4000d5){return function(_0x38aa82){if(_0x38aa82){var _0x83a6f7=typeof _0x4000d5[_0x3545('0x36')]==='undefined'&&typeof _0x4000d5[_0x3545('0x37')]===_0x3545('0x38');var _0x33768b=_0x38aa82['count'];var _0x532c8b=_0x83a6f7?0x0:_0x4000d5[_0x3545('0x36')];var _0x10e1e2=_0x83a6f7?_0x38aa82[_0x3545('0x39')]:_0x4000d5[_0x3545('0x36')]+_0x4000d5[_0x3545('0x37')];var _0x25c0dd;if(_0x10e1e2>=_0x33768b){_0x10e1e2=_0x33768b;_0x25c0dd=0xc8;}else{_0x25c0dd=0xce;}_0x4a8443['status'](_0x25c0dd);return _0x4a8443['set'](_0x3545('0x3a'),_0x532c8b+'-'+_0x10e1e2+'/'+_0x33768b)[_0x3545('0x35')](_0x38aa82);}return null;};}function patchUpdates(_0x3ebeae){return function(_0x498025){try{jsonpatch['apply'](_0x498025,_0x3ebeae,!![]);}catch(_0x40c1fd){return BPromise[_0x3545('0x3b')](_0x40c1fd);}return _0x498025['save']();};}function saveUpdates(_0x42b834,_0x23a463){return function(_0x147b34){if(_0x147b34){return _0x147b34[_0x3545('0x3c')](_0x42b834)[_0x3545('0x26')](function(_0x11faf1){return _0x11faf1;});}return null;};}function removeEntity(_0x1ab8d2,_0x290210){return function(_0x31b46e){if(_0x31b46e){return _0x31b46e[_0x3545('0x3d')]()[_0x3545('0x26')](function(){var _0x4e6ff8=_0x31b46e[_0x3545('0x3e')]({'plain':!![]});var _0x120872=_0x3545('0x3f');return db[_0x3545('0x40')][_0x3545('0x3d')]({'where':{'type':_0x120872,'resourceId':_0x4e6ff8['id']}})[_0x3545('0x26')](function(){return _0x31b46e;});})[_0x3545('0x26')](function(){_0x1ab8d2['status'](0xcc)[_0x3545('0x33')]();});}};}function handleEntityNotFound(_0x6315b7,_0x1859b1){return function(_0x31cff2){if(!_0x31cff2){_0x6315b7[_0x3545('0x32')](0x194);}return _0x31cff2;};}function handleError(_0x1650ca,_0x457673){_0x457673=_0x457673||0x1f4;return function(_0xb52275){logger[_0x3545('0x2d')](_0xb52275[_0x3545('0x41')]);if(_0xb52275['name']){delete _0xb52275[_0x3545('0x42')];}_0x1650ca[_0x3545('0x34')](_0x457673)[_0x3545('0x43')](_0xb52275);};}exports[_0x3545('0x44')]=function(_0x9c1c7b,_0x20c73f){var _0x27fb48={'include':[{'model':db['Pause'],'as':_0x3545('0x45')}]},_0x89a442={},_0x9fa387={'count':0x0,'rows':[]};var _0x4765c8=_[_0x3545('0x46')](db[_0x3545('0x47')][_0x3545('0x48')],function(_0x35f972){return{'name':_0x35f972[_0x3545('0x49')],'type':_0x35f972[_0x3545('0x4a')]['key']};});_0x89a442[_0x3545('0x4b')]=_[_0x3545('0x46')](_0x4765c8,_0x3545('0x42'));_0x89a442[_0x3545('0x4c')]=_[_0x3545('0x4d')](_0x9c1c7b[_0x3545('0x4c')]);_0x89a442[_0x3545('0x4e')]=_[_0x3545('0x4f')](_0x89a442[_0x3545('0x4b')],_0x89a442['query']);_0x27fb48[_0x3545('0x50')]=_[_0x3545('0x4f')](_0x89a442['model'],qs['fields'](_0x9c1c7b[_0x3545('0x4c')][_0x3545('0x51')]));_0x27fb48[_0x3545('0x50')]=_0x27fb48['attributes'][_0x3545('0x52')]?_0x27fb48['attributes']:_0x89a442[_0x3545('0x4b')];if(!_0x9c1c7b[_0x3545('0x4c')]['hasOwnProperty'](_0x3545('0x53'))){_0x27fb48[_0x3545('0x37')]=qs['limit'](_0x9c1c7b[_0x3545('0x4c')]['limit']);_0x27fb48[_0x3545('0x36')]=qs[_0x3545('0x36')](_0x9c1c7b[_0x3545('0x4c')][_0x3545('0x36')]);}_0x27fb48[_0x3545('0x54')]=qs['sort'](_0x9c1c7b['query'][_0x3545('0x55')]);_0x27fb48[_0x3545('0x56')]=qs[_0x3545('0x4e')](_[_0x3545('0x57')](_0x9c1c7b[_0x3545('0x4c')],_0x89a442[_0x3545('0x4e')]),_0x4765c8);if(_0x9c1c7b[_0x3545('0x4c')][_0x3545('0x58')]){_0x27fb48[_0x3545('0x56')]=_[_0x3545('0x59')](_0x27fb48[_0x3545('0x56')],{'$or':_[_0x3545('0x46')](_0x4765c8,function(_0x52aa94){if(_0x52aa94['type']!==_0x3545('0x5a')){var _0x42eac6={};_0x42eac6[_0x52aa94['name']]={'$like':'%'+_0x9c1c7b['query']['filter']+'%'};return _0x42eac6;}})});}_0x27fb48=_[_0x3545('0x59')]({},_0x27fb48,_0x9c1c7b[_0x3545('0x5b')]);var _0x1e3c0e={'where':_0x27fb48[_0x3545('0x56')]};return db['ChatWebsite'][_0x3545('0x39')](_0x1e3c0e)['then'](function(_0x3a83e4){_0x9fa387[_0x3545('0x39')]=_0x3a83e4;if(_0x9c1c7b['query'][_0x3545('0x5c')]){_0x27fb48[_0x3545('0x5d')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x27fb48);})[_0x3545('0x26')](function(_0xa92e17){_0x9fa387[_0x3545('0x5e')]=_0xa92e17;return _0x9fa387;})[_0x3545('0x26')](respondWithFilteredResult(_0x20c73f,_0x27fb48))[_0x3545('0x31')](handleError(_0x20c73f,null));};exports['show']=function(_0x21a200,_0x4cd5cc){var _0x48f0b8={'raw':![],'where':{'id':_0x21a200[_0x3545('0x5f')]['id']},'include':[{'model':db['Pause'],'as':_0x3545('0x45')}]},_0x1b3369={};_0x1b3369[_0x3545('0x4b')]=_['keys'](db[_0x3545('0x47')][_0x3545('0x48')]);_0x1b3369[_0x3545('0x4c')]=_[_0x3545('0x4d')](_0x21a200['query']);_0x1b3369[_0x3545('0x4e')]=_[_0x3545('0x4f')](_0x1b3369[_0x3545('0x4b')],_0x1b3369['query']);_0x48f0b8[_0x3545('0x50')]=_[_0x3545('0x4f')](_0x1b3369['model'],qs[_0x3545('0x51')](_0x21a200['query'][_0x3545('0x51')]));_0x48f0b8[_0x3545('0x50')]=_0x48f0b8[_0x3545('0x50')][_0x3545('0x52')]?_0x48f0b8[_0x3545('0x50')]:_0x1b3369[_0x3545('0x4b')];if(_0x21a200[_0x3545('0x4c')][_0x3545('0x5c')]){_0x48f0b8['include']=[{'all':!![]}];}_0x48f0b8=_['merge']({},_0x48f0b8,_0x21a200[_0x3545('0x5b')]);return db[_0x3545('0x47')][_0x3545('0x60')](_0x48f0b8)['then'](handleEntityNotFound(_0x4cd5cc,null))['then'](respondWithResult(_0x4cd5cc,null))[_0x3545('0x31')](handleError(_0x4cd5cc,null));};exports[_0x3545('0x61')]=function(_0x282f5f,_0x1a11b3){return db['ChatWebsite'][_0x3545('0x61')](_0x282f5f[_0x3545('0x62')],{})[_0x3545('0x26')](function(_0x124692){var _0x5131ba=_0x282f5f[_0x3545('0x63')]['get']({'plain':!![]});if(!_0x5131ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5131ba[_0x3545('0x64')]===_0x3545('0x63')){var _0x42632f=_0x124692[_0x3545('0x3e')]({'plain':!![]});var _0x57e27c=_0x3545('0x3f');return db['UserProfileSection'][_0x3545('0x60')]({'where':{'name':_0x57e27c,'userProfileId':_0x5131ba['userProfileId']},'raw':!![]})[_0x3545('0x26')](function(_0x3635a6){if(_0x3635a6&&_0x3635a6['autoAssociation']===0x0){return db[_0x3545('0x40')][_0x3545('0x61')]({'name':_0x42632f[_0x3545('0x42')],'resourceId':_0x42632f['id'],'type':_0x3635a6[_0x3545('0x42')],'sectionId':_0x3635a6['id']},{})[_0x3545('0x26')](function(){return _0x124692;});}else{return _0x124692;}})[_0x3545('0x31')](function(_0x5f17c0){logger[_0x3545('0x2d')](_0x3545('0x65'),_0x5f17c0);throw _0x5f17c0;});}return _0x124692;})[_0x3545('0x26')](respondWithResult(_0x1a11b3,0xc9))[_0x3545('0x31')](handleError(_0x1a11b3,null));};exports[_0x3545('0x3c')]=function(_0x406c00,_0x45a20d){if(_0x406c00[_0x3545('0x62')]['id']){delete _0x406c00[_0x3545('0x62')]['id'];}return db[_0x3545('0x47')]['find']({'where':{'id':_0x406c00['params']['id']},'include':[{'model':db['Pause'],'as':_0x3545('0x45')}]})['then'](handleEntityNotFound(_0x45a20d,null))['then'](saveUpdates(_0x406c00['body'],null))[_0x3545('0x26')](respondWithResult(_0x45a20d,null))['catch'](handleError(_0x45a20d,null));};exports[_0x3545('0x3d')]=function(_0x2a03a5,_0x8fa4c3){return db['ChatWebsite'][_0x3545('0x60')]({'where':{'id':_0x2a03a5['params']['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x8fa4c3,null))[_0x3545('0x26')](removeEntity(_0x8fa4c3,null))[_0x3545('0x31')](handleError(_0x8fa4c3,null));};exports['describe']=function(_0x3a5562,_0x39557a){return db[_0x3545('0x47')]['describe']()[_0x3545('0x26')](respondWithResult(_0x39557a,null))['catch'](handleError(_0x39557a,null));};exports[_0x3545('0x66')]=function(_0x2e5eb1,_0x37a3f9,_0x7c6f39){if(_0x2e5eb1[_0x3545('0x62')]['id']){delete _0x2e5eb1['body']['id'];}return db[_0x3545('0x47')][_0x3545('0x60')]({'where':{'id':_0x2e5eb1[_0x3545('0x5f')]['id']}})['then'](handleEntityNotFound(_0x37a3f9,null))[_0x3545('0x26')](function(_0x2ab0e8){if(_0x2ab0e8){_0x2e5eb1['body']['ChatWebsiteId']=_0x2ab0e8['id'];return db[_0x3545('0x67')][_0x3545('0x61')](_0x2e5eb1[_0x3545('0x62')]);}})[_0x3545('0x26')](respondWithResult(_0x37a3f9,null))['catch'](handleError(_0x37a3f9,null));};exports[_0x3545('0x68')]=function(_0x34aab1,_0x23ab42,_0x39d94e){var _0x4820c8={'raw':![],'where':{}};var _0x1fb6af={};var _0x3cf321={'count':0x0,'rows':[]};return db[_0x3545('0x47')]['findOne']({'where':{'id':_0x34aab1[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x23ab42,null))[_0x3545('0x26')](function(_0x53c098){if(_0x53c098){_0x1fb6af['model']=_['keys'](db[_0x3545('0x67')][_0x3545('0x48')]);_0x1fb6af[_0x3545('0x4c')]=_['keys'](_0x34aab1[_0x3545('0x4c')]);_0x1fb6af[_0x3545('0x4e')]=_['intersection'](_0x1fb6af[_0x3545('0x4b')],_0x1fb6af[_0x3545('0x4c')]);_0x4820c8[_0x3545('0x50')]=_['intersection'](_0x1fb6af['model'],qs[_0x3545('0x51')](_0x34aab1[_0x3545('0x4c')][_0x3545('0x51')]));_0x4820c8[_0x3545('0x50')]=_0x4820c8[_0x3545('0x50')]['length']?_0x4820c8[_0x3545('0x50')]:_0x1fb6af[_0x3545('0x4b')];if(!_0x34aab1['query'][_0x3545('0x69')](_0x3545('0x53'))){_0x4820c8[_0x3545('0x37')]=qs[_0x3545('0x37')](_0x34aab1[_0x3545('0x4c')][_0x3545('0x37')]);_0x4820c8['offset']=qs[_0x3545('0x36')](_0x34aab1[_0x3545('0x4c')][_0x3545('0x36')]);}_0x4820c8[_0x3545('0x54')]=qs[_0x3545('0x55')](_0x34aab1['query']['sort']);_0x4820c8[_0x3545('0x56')]=qs['filters'](_[_0x3545('0x57')](_0x34aab1[_0x3545('0x4c')],_0x1fb6af[_0x3545('0x4e')]));_0x4820c8[_0x3545('0x56')][_0x3545('0x6a')]=_0x53c098['id'];if(_0x34aab1[_0x3545('0x4c')][_0x3545('0x58')]){_0x4820c8['where']=_[_0x3545('0x59')](_0x4820c8[_0x3545('0x56')],{'$or':_['map'](_0x4820c8['attributes'],function(_0x13d4bd){var _0x8caebf={};_0x8caebf[_0x13d4bd]={'$like':'%'+_0x34aab1[_0x3545('0x4c')][_0x3545('0x58')]+'%'};return _0x8caebf;})});}_0x4820c8=_[_0x3545('0x59')]({},_0x4820c8,_0x34aab1[_0x3545('0x5b')]);return db['Disposition'][_0x3545('0x39')]({'where':_0x4820c8[_0x3545('0x56')]})[_0x3545('0x26')](function(_0x2f7fa6){_0x3cf321[_0x3545('0x39')]=_0x2f7fa6;if(_0x34aab1[_0x3545('0x4c')][_0x3545('0x5c')]){_0x4820c8[_0x3545('0x5d')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4820c8);})['then'](function(_0x3ae794){_0x3cf321[_0x3545('0x5e')]=_0x3ae794;return _0x3cf321;});}})[_0x3545('0x26')](respondWithFilteredResult(_0x23ab42,_0x4820c8))[_0x3545('0x31')](handleError(_0x23ab42,null));};exports[_0x3545('0x6b')]=function(_0x4e6262,_0x3d540d,_0x28889a){return db[_0x3545('0x47')]['find']({'where':{'id':_0x4e6262[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x3d540d,null))[_0x3545('0x26')](function(_0x1a188c){if(_0x1a188c){return _0x1a188c[_0x3545('0x6b')](_0x4e6262[_0x3545('0x4c')][_0x3545('0x6c')]);}})[_0x3545('0x26')](respondWithStatusCode(_0x3d540d,null))[_0x3545('0x31')](handleError(_0x3d540d,null));};exports[_0x3545('0x6d')]=function(_0x483303,_0x813874,_0x49d44e){if(_0x483303[_0x3545('0x62')]['id']){delete _0x483303[_0x3545('0x62')]['id'];}return db[_0x3545('0x47')]['find']({'where':{'id':_0x483303['params']['id']}})['then'](handleEntityNotFound(_0x813874,null))[_0x3545('0x26')](function(_0x37bc94){if(_0x37bc94){_0x483303['body'][_0x3545('0x6a')]=_0x37bc94['id'];return db[_0x3545('0x6e')][_0x3545('0x61')](_0x483303[_0x3545('0x62')]);}})[_0x3545('0x26')](respondWithResult(_0x813874,null))[_0x3545('0x31')](handleError(_0x813874,null));};exports[_0x3545('0x6f')]=function(_0x1a80d9,_0x480caa,_0x2bf2cc){var _0x41b9a7={'raw':![],'where':{}};var _0x2a85d7={};var _0x1c17ed={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3545('0x70')]({'where':{'id':_0x1a80d9['params']['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x480caa,null))[_0x3545('0x26')](function(_0x30c319){if(_0x30c319){_0x2a85d7[_0x3545('0x4b')]=_[_0x3545('0x4d')](db['CannedAnswer'][_0x3545('0x48')]);_0x2a85d7['query']=_[_0x3545('0x4d')](_0x1a80d9[_0x3545('0x4c')]);_0x2a85d7['filters']=_[_0x3545('0x4f')](_0x2a85d7[_0x3545('0x4b')],_0x2a85d7['query']);_0x41b9a7[_0x3545('0x50')]=_[_0x3545('0x4f')](_0x2a85d7[_0x3545('0x4b')],qs[_0x3545('0x51')](_0x1a80d9[_0x3545('0x4c')][_0x3545('0x51')]));_0x41b9a7['attributes']=_0x41b9a7[_0x3545('0x50')][_0x3545('0x52')]?_0x41b9a7[_0x3545('0x50')]:_0x2a85d7[_0x3545('0x4b')];if(!_0x1a80d9[_0x3545('0x4c')]['hasOwnProperty'](_0x3545('0x53'))){_0x41b9a7['limit']=qs['limit'](_0x1a80d9['query']['limit']);_0x41b9a7[_0x3545('0x36')]=qs[_0x3545('0x36')](_0x1a80d9['query'][_0x3545('0x36')]);}_0x41b9a7[_0x3545('0x54')]=qs['sort'](_0x1a80d9['query']['sort']);_0x41b9a7[_0x3545('0x56')]=qs[_0x3545('0x4e')](_[_0x3545('0x57')](_0x1a80d9[_0x3545('0x4c')],_0x2a85d7[_0x3545('0x4e')]));_0x41b9a7[_0x3545('0x56')][_0x3545('0x6a')]=_0x30c319['id'];if(_0x1a80d9[_0x3545('0x4c')][_0x3545('0x58')]){_0x41b9a7['where']=_[_0x3545('0x59')](_0x41b9a7[_0x3545('0x56')],{'$or':_[_0x3545('0x46')](_0x41b9a7[_0x3545('0x50')],function(_0x3fed9e){var _0x8f4d6e={};_0x8f4d6e[_0x3fed9e]={'$like':'%'+_0x1a80d9[_0x3545('0x4c')][_0x3545('0x58')]+'%'};return _0x8f4d6e;})});}_0x41b9a7=_['merge']({},_0x41b9a7,_0x1a80d9['options']);return db['CannedAnswer'][_0x3545('0x39')]({'where':_0x41b9a7[_0x3545('0x56')]})[_0x3545('0x26')](function(_0x1ff319){_0x1c17ed[_0x3545('0x39')]=_0x1ff319;if(_0x1a80d9[_0x3545('0x4c')][_0x3545('0x5c')]){_0x41b9a7[_0x3545('0x5d')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3545('0x71')](_0x41b9a7);})[_0x3545('0x26')](function(_0x9a990){_0x1c17ed[_0x3545('0x5e')]=_0x9a990;return _0x1c17ed;});}})[_0x3545('0x26')](respondWithFilteredResult(_0x480caa,_0x41b9a7))[_0x3545('0x31')](handleError(_0x480caa,null));};exports[_0x3545('0x72')]=function(_0x5d93c8,_0x37bf90,_0x227528){return db[_0x3545('0x47')][_0x3545('0x60')]({'where':{'id':_0x5d93c8[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x37bf90,null))[_0x3545('0x26')](function(_0x5558ad){if(_0x5558ad){return _0x5558ad['removeAnswers'](_0x5d93c8[_0x3545('0x4c')][_0x3545('0x6c')]);}})[_0x3545('0x26')](respondWithStatusCode(_0x37bf90,null))['catch'](handleError(_0x37bf90,null));};exports[_0x3545('0x73')]=function(_0xaeaa5f,_0x25806c,_0x128d38){_0xaeaa5f[_0x3545('0x62')][_0x3545('0x74')]=_0xaeaa5f[_0x3545('0x75')][_0x3545('0x76')];return db['ChatWebsite'][_0x3545('0x60')]({'where':{'id':_0xaeaa5f[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x25806c,null))[_0x3545('0x26')](saveUpdates(_0xaeaa5f[_0x3545('0x62')],null))[_0x3545('0x26')](respondWithResult(_0x25806c,null))[_0x3545('0x31')](handleError(_0x25806c,null));};exports[_0x3545('0x77')]=function(_0xe8e7f8,_0x306ff3,_0x33186a){_0xe8e7f8[_0x3545('0x62')][_0x3545('0x78')]=_0xe8e7f8['file'][_0x3545('0x76')];return db[_0x3545('0x47')]['find']({'where':{'id':_0xe8e7f8[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x306ff3,null))['then'](saveUpdates(_0xe8e7f8[_0x3545('0x62')],null))[_0x3545('0x26')](respondWithResult(_0x306ff3,null))[_0x3545('0x31')](handleError(_0x306ff3,null));};exports[_0x3545('0x79')]=function(_0x738e45,_0x296df6,_0x5b2008){_0x738e45[_0x3545('0x62')][_0x3545('0x7a')]=_0x738e45[_0x3545('0x75')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x738e45[_0x3545('0x5f')]['id']}})['then'](handleEntityNotFound(_0x296df6,null))['then'](saveUpdates(_0x738e45[_0x3545('0x62')],null))[_0x3545('0x26')](respondWithResult(_0x296df6,null))[_0x3545('0x31')](handleError(_0x296df6,null));};exports[_0x3545('0x7b')]=function(_0x14b8f9,_0x437f56,_0x2d098d){_0x14b8f9[_0x3545('0x62')][_0x3545('0x7c')]=_0x14b8f9[_0x3545('0x75')]['filename'];return db['ChatWebsite'][_0x3545('0x60')]({'where':{'id':_0x14b8f9[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x437f56,null))['then'](saveUpdates(_0x14b8f9[_0x3545('0x62')],null))['then'](respondWithResult(_0x437f56,null))['catch'](handleError(_0x437f56,null));};exports[_0x3545('0x7d')]=function(_0x5f5cfd,_0x516e99,_0x124f48){var _0x217a08=path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x80'));var _0x168dce={'where':{'id':_0x5f5cfd[_0x3545('0x5f')]['id']},'attributes':['id',_0x3545('0x74')],'raw':!![]};var _0x761a1c=![];return require('../../config/license/util')['getLicense']()['then'](function(_0x48fbfc){if(_0x48fbfc){_0x761a1c=_0x48fbfc[_0x3545('0x81')];}})['then'](function(){return db[_0x3545('0x47')]['find'](_0x168dce);})[_0x3545('0x26')](handleEntityNotFound(_0x516e99,null))[_0x3545('0x26')](function(_0x1f4a33){if(_0x1f4a33){if(!_[_0x3545('0x82')](_0x1f4a33[_0x3545('0x74')])){if(fs[_0x3545('0x83')](path['join'](config[_0x3545('0x7f')],_0x3545('0x84'),_0x1f4a33[_0x3545('0x74')]))&&_0x761a1c){_0x217a08=path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x84'),_0x1f4a33['sitepic']);}}return _0x516e99[_0x3545('0x85')](_0x217a08);}})[_0x3545('0x31')](handleError(_0x516e99,null));};exports[_0x3545('0x86')]=function(_0x58b6f4,_0x3e363f,_0x3b7efe){var _0x2ae3e5=path[_0x3545('0x7e')](config['root'],_0x3545('0x87'));var _0x982759={'where':{'id':_0x58b6f4[_0x3545('0x5f')]['id']},'attributes':['id',_0x3545('0x78')],'raw':!![]};return db[_0x3545('0x47')][_0x3545('0x60')](_0x982759)[_0x3545('0x26')](handleEntityNotFound(_0x3e363f,null))[_0x3545('0x26')](function(_0x175058){if(_0x175058){if(!_['isNil'](_0x175058[_0x3545('0x78')])){if(fs[_0x3545('0x83')](path[_0x3545('0x7e')](config['root'],_0x3545('0x88'),_0x175058['agentAvatar']))){_0x2ae3e5=path[_0x3545('0x7e')](config['root'],_0x3545('0x88'),_0x175058[_0x3545('0x78')]);}}return _0x3e363f[_0x3545('0x85')](_0x2ae3e5);}})[_0x3545('0x31')](handleError(_0x3e363f,null));};exports[_0x3545('0x89')]=function(_0x3904ef,_0x42620d,_0x1f5367){var _0x5121ce=path['join'](config[_0x3545('0x7f')],_0x3545('0x8a'));var _0x4e27bc={'where':{'id':_0x3904ef['params']['id']},'attributes':['id',_0x3545('0x7a'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0x3545('0x60')](_0x4e27bc)[_0x3545('0x26')](handleEntityNotFound(_0x42620d,null))['then'](function(_0x2affab){if(_0x2affab){if(!_['isNil'](_0x2affab['customerAvatar'])){if(fs[_0x3545('0x83')](path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x88'),_0x2affab[_0x3545('0x7a')]))&&_0x2affab[_0x3545('0x8b')]){_0x5121ce=path['join'](config[_0x3545('0x7f')],'server/files/images/avatars/',_0x2affab[_0x3545('0x7a')]);}}return _0x42620d[_0x3545('0x85')](_0x5121ce);}})[_0x3545('0x31')](handleError(_0x42620d,null));};exports[_0x3545('0x8c')]=function(_0x465d54,_0x31823c,_0xa0dd57){var _0x231ef2=path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x8d'));var _0x4994cd={'where':{'id':_0x465d54[_0x3545('0x5f')]['id']},'attributes':['id',_0x3545('0x7c')],'raw':!![]};return db[_0x3545('0x47')][_0x3545('0x60')](_0x4994cd)[_0x3545('0x26')](handleEntityNotFound(_0x31823c,null))[_0x3545('0x26')](function(_0x19a3dc){if(_0x19a3dc){if(!_[_0x3545('0x82')](_0x19a3dc[_0x3545('0x7c')])){if(fs[_0x3545('0x83')](path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x88'),_0x19a3dc['systemAvatar']))){_0x231ef2=path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x88'),_0x19a3dc[_0x3545('0x7c')]);}}return _0x31823c[_0x3545('0x85')](_0x231ef2);}})[_0x3545('0x31')](handleError(_0x31823c,null));};exports[_0x3545('0x8e')]=function(_0x4538dd,_0x5ce078,_0x28f15e){var _0x2a61aa=require('user-agent-parser');var _0xe7877c=new _0x2a61aa();var _0x5875d9=_0xe7877c[_0x3545('0x8f')](_0x4538dd[_0x3545('0x90')][_0x3545('0x91')])['getResult']();var _0x1a410d={'body':_0x4538dd[_0x3545('0x62')],'channel':'chat'};var _0x5d5ccb=[];var _0x14d3b4=[];var _0x115adf={};var _0x5e98ee=![];return db['CmContact'][_0x3545('0x92')]()[_0x3545('0x26')](function(_0x5ece25){if(!_0x5ece25){throw new db[(_0x3545('0x93'))][(_0x3545('0x94'))]('no\x20available\x20attributes');}_0x5d5ccb=_[_0x3545('0x95')](_[_0x3545('0x4d')](_0x5ece25),[_0x3545('0x96'),_0x3545('0x97')]);_0x14d3b4=_[_0x3545('0x95')](_['keys'](_0x5ece25),[_0x3545('0x96'),_0x3545('0x97'),_0x3545('0x98'),'ListId']);if(_0x4538dd[_0x3545('0x62')]['id']){delete _0x4538dd[_0x3545('0x62')]['id'];}if(_[_0x3545('0x82')](_0x4538dd[_0x3545('0x62')]['from'])){throw new db[(_0x3545('0x93'))][(_0x3545('0x94'))](_0x3545('0x99'));}if(_[_0x3545('0x82')](_0x4538dd[_0x3545('0x62')][_0x3545('0x62')])||_0x4538dd[_0x3545('0x62')][_0x3545('0x62')]===''){throw new db[(_0x3545('0x93'))][(_0x3545('0x94'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4538dd['body'][_0x3545('0x9a')])){throw new db[(_0x3545('0x93'))][(_0x3545('0x94'))](_0x3545('0x9b')+_0x14d3b4);}if(!_['includes'](_0x14d3b4,_0x4538dd[_0x3545('0x62')][_0x3545('0x9a')])){throw new db['Sequelize'][(_0x3545('0x94'))](_0x3545('0x9c')+_0x14d3b4);}_0x115adf[_0x4538dd['body'][_0x3545('0x9a')]]=_0x4538dd[_0x3545('0x62')][_0x3545('0x9d')];})['then'](function(){return db[_0x3545('0x47')]['find']({'where':{'id':_0x4538dd[_0x3545('0x5f')]['id']},'include':[{'model':db[_0x3545('0x9e')],'as':_0x3545('0x9f'),'include':[{'model':db[_0x3545('0xa0')],'as':_0x3545('0xa1'),'where':_0x115adf,'limit':0x1,'order':[[_0x3545('0x97'),_0x3545('0xa2')]]}]},{'model':db[_0x3545('0xa3')],'as':_0x3545('0xa4')}]});})[_0x3545('0x26')](handleEntityNotFound(_0x5ce078,null))[_0x3545('0x26')](function(_0x31cf18){if(_0x31cf18&&_0x31cf18[_0x3545('0x9f')]){_0x1a410d['account']=_0x31cf18;_0x1a410d[_0x3545('0xa5')]=_0x31cf18['Applications'];_0x1a410d[_0x3545('0xa6')]=_0x31cf18[_0x3545('0x9f')];_0x1a410d[_0x3545('0xa5')]=_[_0x3545('0xa7')](_0x1a410d[_0x3545('0xa5')],['priority'],[_0x3545('0xa8')]);if(_0x1a410d[_0x3545('0xa9')][_0x3545('0xa4')]){delete _0x1a410d[_0x3545('0xa9')][_0x3545('0xa4')];}if(_0x1a410d[_0x3545('0xa9')][_0x3545('0x9f')]&&_0x1a410d[_0x3545('0xa9')][_0x3545('0x9f')][_0x3545('0xa1')][_0x3545('0x52')]){return _0x1a410d['account'][_0x3545('0x9f')][_0x3545('0xa1')][0x0];}var _0x506c69=_[_0x3545('0x1d')](_0x4538dd[_0x3545('0x62')],{'firstName':_0x4538dd[_0x3545('0x62')][_0x3545('0x9d')],'ListId':_0x31cf18[_0x3545('0xaa')]});_0x506c69[_0x4538dd[_0x3545('0x62')][_0x3545('0x9a')]]=_0x4538dd[_0x3545('0x62')][_0x3545('0x9d')];return db[_0x3545('0xa0')][_0x3545('0x61')](_0x506c69,{'fields':_0x5d5ccb,'raw':!![]});}})[_0x3545('0x26')](handleEntityNotFound(_0x5ce078,null))[_0x3545('0x26')](function(_0x45bf8d){_0x1a410d['contact']=_0x45bf8d;var _0x3745d9=_0x4538dd[_0x3545('0x62')][_0x3545('0xab')];if(_0x4538dd[_0x3545('0x90')][_0x3545('0xac')]){_0x3745d9=_0x4538dd[_0x3545('0x90')][_0x3545('0xac')];}else if(_0x4538dd[_0x3545('0x90')][_0x3545('0xad')]){_0x3745d9=_[_0x3545('0xae')](_0x4538dd['headers']['x-forwarded-for'][_0x3545('0xaf')](','));}if(_0x45bf8d){var _0x51ed6f={'ContactId':_0x45bf8d['id'],'ChatWebsiteId':_0x4538dd[_0x3545('0x5f')]['id'],'from':(_0x45bf8d[_0x3545('0xb0')]||'')+'\x20'+(_0x45bf8d[_0x3545('0xb1')]||''),'customerIp':_0x3745d9,'customerPort':_0x4538dd['headers'][_0x3545('0xb2')]?_0x4538dd['headers']['x-real-port']:null,'referer':_0x4538dd[_0x3545('0x62')][_0x3545('0xb3')],'browserName':_0x5875d9[_0x3545('0xb4')]['name']&&_0x5875d9[_0x3545('0xb4')][_0x3545('0xb5')]?util[_0x3545('0xb6')]('%s\x20%s',_0x5875d9['browser']['name'],_0x5875d9['browser']['version']):'unknown','browserVersion':_0x5875d9[_0x3545('0xb4')][_0x3545('0xb5')]||_0x3545('0xb7'),'osName':util['format']('%s\x20%s',_0x5875d9['os']['name'],_0x5875d9['os'][_0x3545('0xb5')]),'osVersion':_0x5875d9['os'][_0x3545('0xb5')],'deviceModel':_0x5875d9[_0x3545('0xb8')][_0x3545('0x4b')]&&_0x5875d9[_0x3545('0xb8')][_0x3545('0xb9')]?util[_0x3545('0xb6')](_0x3545('0xba'),_0x5875d9['device'][_0x3545('0x4b')],_0x5875d9[_0x3545('0xb8')][_0x3545('0xb9')],_0x5875d9[_0x3545('0xb8')][_0x3545('0x4a')]):null,'deviceVendor':_0x5875d9[_0x3545('0xb8')][_0x3545('0xb9')],'deviceType':_0x5875d9[_0x3545('0xb8')][_0x3545('0x4a')],'formData':JSON[_0x3545('0x2c')](_0x4538dd[_0x3545('0x62')])};var _0xbd4807={'ChatWebsiteId':_0x4538dd[_0x3545('0x5f')]['id'],'closed':![]};if(_0x4538dd[_0x3545('0x62')][_0x3545('0xbb')]){_0xbd4807[_0x3545('0xbb')]=_0x4538dd[_0x3545('0x62')][_0x3545('0xbb')];return db[_0x3545('0xbc')][_0x3545('0x60')]({'where':_0xbd4807})[_0x3545('0x26')](function(_0x45baae){if(_0x45baae){return[_0x45baae,![]];}_0x51ed6f['threadId']=_0x4538dd[_0x3545('0x62')][_0x3545('0xbb')];_0x51ed6f['externalUrl']=_0x4538dd['body']['externalUrl'];return db[_0x3545('0xbc')][_0x3545('0x61')](_0x51ed6f)['then'](function(_0x2c147c){return[_0x2c147c,!![]];});});}_0xbd4807[_0x3545('0xbd')]=_0x45bf8d['id'];if(_0x4538dd[_0x3545('0x62')][_0x3545('0xbe')]&&_0x4538dd[_0x3545('0x62')]['interaction']['id']){_0xbd4807['id']=_0x4538dd[_0x3545('0x62')][_0x3545('0xbe')]['id'];return db[_0x3545('0xbc')]['find']({'where':_0xbd4807})[_0x3545('0x26')](function(_0x489029){if(_0x489029){return[_0x489029,![]];}return db['ChatInteraction'][_0x3545('0x61')](_0x51ed6f)[_0x3545('0x26')](function(_0x307fd6){return[_0x307fd6,!![]];});});}return db['ChatInteraction'][_0x3545('0x61')](_0x51ed6f)[_0x3545('0x26')](function(_0x42ca7b){return[_0x42ca7b,!![]];});}})[_0x3545('0xbf')](function(_0x58de0d,_0x11edef){if(_0x58de0d){_0x5e98ee=_0x11edef;if(!_0x11edef){var _0x32451c={'from':(_0x1a410d[_0x3545('0xc0')][_0x3545('0xb0')]||'')+'\x20'+(_0x1a410d[_0x3545('0xc0')][_0x3545('0xb1')]||'')};if(_0x4538dd[_0x3545('0x62')][_0x3545('0xbb')]&&_0x4538dd['body'][_0x3545('0xc1')]&&_0x4538dd[_0x3545('0x62')]['threadId']!=_0x4538dd['body'][_0x3545('0xc1')]){_0x32451c[_0x3545('0xbb')]=_0x4538dd[_0x3545('0x62')][_0x3545('0xc1')];}return _0x58de0d['update'](_0x32451c);}else{return _0x58de0d;}}})[_0x3545('0x26')](function(_0x262584){_0x1a410d[_0x3545('0xbe')]=_0x262584['get']({'plain':!![]});_0x1a410d[_0x3545('0xbe')][_0x3545('0xc2')]=_0x5e98ee;if(_0x1a410d['interaction'][_0x3545('0xc2')]){if(_0x1a410d['account']['autoclose']){_0x1a410d[_0x3545('0xa5')]['push']({'id':0x0,'priority':_0x1a410d[_0x3545('0xa5')][_0x3545('0x52')]+0x1,'app':_0x3545('0xc3'),'appdata':_0x3545('0xc4'),'interval':'*,*,*,*'});}}return db[_0x3545('0xc5')][_0x3545('0x61')]({'body':_0x4538dd[_0x3545('0x62')][_0x3545('0x62')],'ChatWebsiteId':_0x4538dd[_0x3545('0x5f')]['id'],'ChatInteractionId':_0x262584['id'],'direction':'in','ContactId':_0x1a410d['contact']['id'],'AttachmentId':_0x4538dd[_0x3545('0x62')][_0x3545('0xc6')]});})['then'](function(_0x5cf088){_0x1a410d[_0x3545('0x2f')]=_0x5cf088;if(_0x1a410d[_0x3545('0xbe')]['UserId']){return db['User'][_0x3545('0x60')]({'attributes':['id',_0x3545('0x42')],'where':{'id':_0x1a410d[_0x3545('0xbe')][_0x3545('0xc7')]}})[_0x3545('0x26')](function(_0x49525e){if(_0x49525e){_0x1a410d[_0x3545('0xa5')][_0x3545('0xc8')]({'id':0x0,'priority':0x0,'app':_0x3545('0xc9'),'appdata':_0x49525e['name']+','+(_0x1a410d[_0x3545('0xa9')]['waitForTheAssignedAgent']||0xa),'interval':_0x3545('0xca')});_0x1a410d[_0x3545('0xcb')]=!![];}return respondWithRpcPromise(_0x3545('0xcc'),'startRouting',_0x1a410d);});}return respondWithRpcPromise(_0x3545('0xcc'),'startRouting',_0x1a410d);})[_0x3545('0x26')](function(_0x14e382){respondWithRpcPromise(_0x3545('0xcd'),_0x3545('0xcd'),{'event':'notify','message':_0x14e382},client9002);return _0x14e382;})[_0x3545('0x26')](respondWithResult(_0x5ce078,null))[_0x3545('0x31')](handleError(_0x5ce078,null));};exports[_0x3545('0xce')]=function(_0x176f14,_0x50e903,_0x516e62){var _0x1093a7,_0x50bcd2,_0x364d28;var _0x5497a9=[];var _0x3df0f1=[];var _0x2e82ef={};var _0x3393cc=_0x176f14[_0x3545('0xcf')]||[];var _0x4b6038=[];var _0x139cc4;return db[_0x3545('0xa0')][_0x3545('0x92')]()[_0x3545('0x26')](function(_0x61bc92){if(!_0x61bc92){throw new db[(_0x3545('0x93'))]['ValidationError'](_0x3545('0xd0'));}_0x3df0f1=_[_0x3545('0x95')](_[_0x3545('0x4d')](_0x61bc92),['createdAt',_0x3545('0x97')]);_0x5497a9=_['difference'](_[_0x3545('0x4d')](_0x61bc92),[_0x3545('0x96'),'updatedAt','CompanyId',_0x3545('0xaa')]);if(_0x176f14[_0x3545('0x62')]['id']){delete _0x176f14[_0x3545('0x62')]['id'];}if(_[_0x3545('0x82')](_0x176f14[_0x3545('0x62')][_0x3545('0x9d')])){throw _0x50e903[_0x3545('0x34')](0x1f4)[_0x3545('0x43')](new db[(_0x3545('0x93'))][(_0x3545('0x94'))](_0x3545('0x99')));}if(_[_0x3545('0x82')](_0x176f14[_0x3545('0x62')]['body'])||_0x176f14[_0x3545('0x62')]['body']===''){throw _0x50e903[_0x3545('0x34')](0x1f4)[_0x3545('0x43')](new db[(_0x3545('0x93'))]['ValidationError'](_0x3545('0xd1')));}if(_[_0x3545('0x82')](_0x176f14[_0x3545('0x62')][_0x3545('0xd2')])){throw _0x50e903['status'](0x1f4)[_0x3545('0x43')](new db[(_0x3545('0x93'))][(_0x3545('0x94'))](_0x3545('0xd3')+_0x5497a9));}if(!_[_0x3545('0xd4')](_0x5497a9,_0x176f14[_0x3545('0x62')]['mapKeyOffline'])){throw _0x50e903[_0x3545('0x34')](0x1f4)[_0x3545('0x43')](new db['Sequelize'][(_0x3545('0x94'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5497a9));}_0x2e82ef[_0x176f14[_0x3545('0x62')][_0x3545('0xd2')]]=_0x176f14[_0x3545('0x62')][_0x3545('0x9d')];})['then'](function(){return db[_0x3545('0x47')][_0x3545('0x60')]({'where':{'id':_0x176f14['params']['id']},'include':[{'model':db[_0x3545('0x9e')],'as':_0x3545('0x9f')},{'model':db[_0x3545('0xd5')],'as':_0x3545('0xd5')}]});})[_0x3545('0x26')](handleEntityNotFound(_0x50e903,null))['then'](function(_0x5e2181){if(_0x5e2181&&_0x5e2181[_0x3545('0x9f')]){_0x50bcd2=_0x5e2181;var _0x1e4d07=_[_0x3545('0x1d')](_0x176f14[_0x3545('0x62')],{'firstName':_0x176f14[_0x3545('0x62')]['from'],'phone':_0x176f14[_0x3545('0x62')]['from'],'ListId':_0x5e2181[_0x3545('0xaa')]});_0x1e4d07[_0x176f14[_0x3545('0x62')][_0x3545('0xd2')]]=_0x176f14[_0x3545('0x62')][_0x3545('0x9d')];return db[_0x3545('0xa0')]['findOrCreate']({'where':_0x2e82ef,'defaults':_0x1e4d07});}})[_0x3545('0xbf')](function(_0x38463e){if(_0x38463e){_0x364d28=_0x38463e;var _0x53910f=fs['readFileSync'](path[_0x3545('0x7e')](config['root'],_0x3545('0xd6')),_0x3545('0xd7'));var _0x2ce8d5=ejs['render'](_0x53910f,{'body':_['toPairs'](_0x176f14['body']['body']),'bodyTitle':_0x50bcd2['offlineMessageBody']});return db[_0x3545('0xd8')][_0x3545('0x61')]({'body':_0x2ce8d5,'ContactId':_0x38463e['id'],'ChatWebsiteId':_0x50bcd2['id']});}})['then'](function(_0x2deb8d){_0x139cc4=_0x2deb8d;if(_0x3393cc[_0x3545('0x52')]){var _0x555b52=_0x3393cc['map'](function(_0x4d5c11){return{'name':_0x4d5c11[_0x3545('0xd9')],'basename':_0x4d5c11[_0x3545('0x76')],'type':_0x4d5c11[_0x3545('0xda')],'ChatOfflineMessageId':_0x2deb8d['id']};});_0x4b6038=_0x555b52[_0x3545('0x46')](_0x19b835=>{var _0x23bffb={'filename':_0x19b835[_0x3545('0x42')],'path':path[_0x3545('0x7e')](config['root'],_0x3545('0xdb'),_0x3545('0xcf'),_0x3545('0xdc'),_0x3545('0xdd'),_0x19b835[_0x3545('0xde')])};return _0x23bffb;});if(!_0x50bcd2[_0x3545('0xdf')]){return db[_0x3545('0xe0')][_0x3545('0xe1')](function(_0x70873c){return db['Attachment'][_0x3545('0xe2')](_0x555b52,{'transaction':_0x70873c});});}}})['then'](function(){if(_0x139cc4){_0x1093a7=_0x139cc4;return db[_0x3545('0xd5')][_0x3545('0x70')]({'where':{'active':!![]},'include':[{'model':db[_0x3545('0xe3')],'as':_0x3545('0xe4'),'raw':!![]}]});}})['then'](function(_0x3c60a1){if(_0x3c60a1&&_0x3c60a1['Smtp']&&_0x50bcd2[_0x3545('0xe5')]&&_0x50bcd2[_0x3545('0xe6')]){var _0xf240b2={'tls':{'rejectUnauthorized':![]}};if(_0x3c60a1[_0x3545('0xe4')]['service']){_0xf240b2['service']=_0x3c60a1[_0x3545('0xe4')][_0x3545('0xe7')];}else{_0xf240b2[_0x3545('0xe8')]=_0x3c60a1['Smtp'][_0x3545('0xe8')];_0xf240b2['port']=_0x3c60a1[_0x3545('0xe4')][_0x3545('0xe9')];_0xf240b2[_0x3545('0xea')]=_0x3c60a1[_0x3545('0xe4')]['secure'];}if(_0x3c60a1[_0x3545('0xe4')][_0x3545('0xeb')]){_0xf240b2[_0x3545('0xec')]={'user':_0x3c60a1['Smtp']['user'],'pass':_0x3c60a1[_0x3545('0xe4')][_0x3545('0xed')]};}return respondWithRpcPromise(_0x3545('0xee'),_0x3545('0xef'),{'account':_0xf240b2,'message':{'from':util[_0x3545('0xb6')](_0x3545('0xf0'),_0x3c60a1[_0x3545('0x42')],_0x3c60a1[_0x3545('0xf1')]||_0x3c60a1[_0x3545('0xe4')][_0x3545('0x63')]),'to':_0x50bcd2[_0x3545('0xe6')],'subject':_0x50bcd2[_0x3545('0xf2')],'html':_0x1093a7['body'],'attachments':_0x4b6038}},client9003)[_0x3545('0x26')](function(){return _0x1093a7;})['catch'](function(_0x1a5e6d){console[_0x3545('0x2d')](_0x1a5e6d);});}})[_0x3545('0x26')](function(){if(_0x50bcd2&&_0x50bcd2[_0x3545('0xdf')]&&_0x50bcd2[_0x3545('0xf3')]){var _0x5eb15c=[];if(_0x3393cc['length']){_0x5eb15c=_0x3393cc[_0x3545('0x46')](function(_0x5557fc){return{'name':_0x5557fc['originalname'],'basename':_0x5557fc['filename'],'type':_0x5557fc[_0x3545('0xda')],'ChatOfflineMessageId':_0x139cc4['id']};});}var _0x3a4045;if(!_[_0x3545('0x82')](_0x50bcd2[_0x3545('0xf4')])){var _0x47ae60=_[_0x3545('0x46')](_0x176f14[_0x3545('0x62')],function(_0x2241af){return _0x2241af;});var _0x437c93=_[_0x3545('0xf5')](_0x47ae60)[0x0];var _0x1ca9ae=_[_0x3545('0xf6')](_0x437c93,function(_0x119fcf){return _0x119fcf;});_0x3a4045=_0x1ca9ae[0x1][_0x50bcd2['subjectOffline']];}var _0x58dd95={'from':_0x364d28['email'],'firstName':_0x364d28[_0x3545('0xb0')],'lastName':_0x364d28[_0x3545('0xb1')],'mapKey':_0x3545('0xf1'),'message':{'from':_0x364d28['email'],'to':_0x50bcd2[_0x3545('0xd5')][_0x3545('0xf1')],'cc':'','subject':_[_0x3545('0x82')](_0x3a4045)?_0x50bcd2['offlineMessageSubject']:_0x3a4045,'messageId':'','sentAt':new Date(),'attach':_0x5eb15c[_0x3545('0x52')],'attachments':_0x5eb15c,'originChannel':'Chat','ChatWebsiteId':_0x50bcd2['id'],'ChatOfflineMessageId':_0x1093a7['id'],'originTo':_0x50bcd2[_0x3545('0xd5')][_0x3545('0xf1')]},'body':_0x1093a7['body']};var _0x27d4a5={'account':{'id':_0x50bcd2[_0x3545('0xf3')]},'body':_0x58dd95,'log':_0x3545('0xf7')};return respondWithRpcPromise(_0x3545('0xf7'),_0x3545('0xf8'),_0x27d4a5,client9001)[_0x3545('0x26')](function(){return _0x1093a7;})[_0x3545('0x31')](function(_0x1f842b){console[_0x3545('0x2d')](_0x1f842b);});}return;})['then'](function(){if(_0x1093a7){return _0x1093a7;}})[_0x3545('0x26')](respondWithResult(_0x50e903,null))['catch'](function(_0x53268f){console[_0x3545('0x2d')](_0x3545('0x31'),_0x53268f);for(var _0xdd5603 of _0x3393cc){var _0x4d55db=path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0xdb'),_0x3545('0xcf'),_0x3545('0xdc'),_0x3545('0xdd'),_0xdd5603[_0x3545('0x76')]);fs_extra[_0x3545('0xf9')](_0x4d55db)[_0x3545('0x31')](function(_0xe2d73d){console[_0x3545('0x2d')](_0x3545('0xfa'),_0x4d55db,_0xe2d73d);});}});};exports[_0x3545('0xfb')]=function(_0x5162f4,_0x459f00,_0x39b855){return db[_0x3545('0xbc')]['find']({'where':{'id':_0x5162f4['params']['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x459f00,null))[_0x3545('0x26')](function(_0x1336d5){if(_0x1336d5){return _0x1336d5[_0x3545('0xfb')](_0x5162f4[_0x3545('0x62')][_0x3545('0x6c')],_[_0x3545('0xfc')](_0x5162f4['body'],[_0x3545('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x459f00,null))[_0x3545('0x31')](handleError(_0x459f00,null));};exports[_0x3545('0xfd')]=function(_0x159331,_0x571dae,_0x3ad3f2){var _0xe441cb={'raw':![],'where':{}};var _0x55ab23={};var _0x56ed97={'count':0x0,'rows':[]};return db[_0x3545('0x47')]['findOne']({'where':{'id':_0x159331[_0x3545('0x5f')]['id']}})['then'](handleEntityNotFound(_0x571dae,null))[_0x3545('0x26')](function(_0x376b19){if(_0x376b19){_0x55ab23['model']=_[_0x3545('0x4d')](db[_0x3545('0xbc')][_0x3545('0x48')]);_0x55ab23['query']=_[_0x3545('0x4d')](_0x159331['query']);_0x55ab23['filters']=_[_0x3545('0x4f')](_0x55ab23[_0x3545('0x4b')],_0x55ab23['query']);_0xe441cb[_0x3545('0x50')]=_[_0x3545('0x4f')](_0x55ab23[_0x3545('0x4b')],qs[_0x3545('0x51')](_0x159331[_0x3545('0x4c')][_0x3545('0x51')]));_0xe441cb['attributes']=_0xe441cb[_0x3545('0x50')][_0x3545('0x52')]?_0xe441cb[_0x3545('0x50')]:_0x55ab23['model'];if(!_0x159331['query'][_0x3545('0x69')]('nolimit')){_0xe441cb['limit']=qs[_0x3545('0x37')](_0x159331['query'][_0x3545('0x37')]);_0xe441cb[_0x3545('0x36')]=qs[_0x3545('0x36')](_0x159331['query'][_0x3545('0x36')]);}_0xe441cb[_0x3545('0x54')]=qs[_0x3545('0x55')](_0x159331[_0x3545('0x4c')][_0x3545('0x55')]);_0xe441cb['where']=qs[_0x3545('0x4e')](_[_0x3545('0x57')](_0x159331['query'],_0x55ab23[_0x3545('0x4e')]));_0xe441cb[_0x3545('0x56')][_0x3545('0x6a')]=_0x376b19['id'];if(_0x159331[_0x3545('0x4c')][_0x3545('0x58')]){_0xe441cb[_0x3545('0x56')]=_['merge'](_0xe441cb[_0x3545('0x56')],{'$or':_['map'](_0xe441cb[_0x3545('0x50')],function(_0x30a41c){var _0x5248b1={};_0x5248b1[_0x30a41c]={'$like':'%'+_0x159331['query'][_0x3545('0x58')]+'%'};return _0x5248b1;})});}_0xe441cb=_['merge']({},_0xe441cb,_0x159331[_0x3545('0x5b')]);return db['ChatInteraction']['count']({'where':_0xe441cb[_0x3545('0x56')]})[_0x3545('0x26')](function(_0x496d93){_0x56ed97[_0x3545('0x39')]=_0x496d93;if(_0x159331['query'][_0x3545('0x5c')]){_0xe441cb[_0x3545('0x5d')]=[{'model':db[_0x3545('0xa0')],'as':_0x3545('0xfe'),'required':![]},{'model':db[_0x3545('0xff')],'as':_0x3545('0x100'),'attributes':[_0x3545('0x42'),_0x3545('0x101'),'internal'],'required':![]},{'model':db[_0x3545('0x102')],'as':'Tags','attributes':['id',_0x3545('0x42'),'color'],'where':_0x159331[_0x3545('0x4c')][_0x3545('0x103')]?{'id':_0x159331[_0x3545('0x4c')][_0x3545('0x103')]}:undefined,'required':_0x159331[_0x3545('0x4c')]['tag']?!![]:![]}];}return db[_0x3545('0xbc')]['findAll'](_0xe441cb);})[_0x3545('0x26')](function(_0x593b0f){_0x56ed97[_0x3545('0x5e')]=_0x593b0f;return _0x56ed97;});}})[_0x3545('0x26')](respondWithFilteredResult(_0x571dae,_0xe441cb))[_0x3545('0x31')](handleError(_0x571dae,null));};function iftimePromise(_0x33a889,_0x179c80){return respondWithRpcPromise(_0x3545('0x104'),_0x3545('0x105'),{'command':_0x179c80[_0x3545('0x106')]?util[_0x3545('0xb6')]('iftime\x20%s,%s',_0x33a889[_0x3545('0x107')],_0x179c80[_0x3545('0x106')]):util[_0x3545('0xb6')](_0x3545('0x108'),_0x33a889[_0x3545('0x107')])},client9002)[_0x3545('0x26')](function(_0x2a3f95){var _0x5011f7=_0x2a3f95&&_0x2a3f95[_0x3545('0x109')](_0x3545('0x10a'))>=0x0?!![]:![];logger[_0x3545('0x27')](_0x3545('0x10b'),_0x179c80['id'],_0x33a889['id'],_0x33a889['interval'],_0x5011f7?_0x3545('0x10c'):_0x3545('0x10d'),_0x179c80[_0x3545('0x106')]?_0x179c80[_0x3545('0x106')]:_0x3545('0x10e'));return _0x5011f7;})[_0x3545('0x31')](function(_0x322444){logger[_0x3545('0x2d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x179c80['id'],_0x33a889['id'],_0x33a889[_0x3545('0x107')],util[_0x3545('0x10f')](_0x322444,{'showHidden':![],'depth':null}),_0x179c80[_0x3545('0x106')]?_0x179c80[_0x3545('0x106')]:_0x3545('0x10e'));return![];});}exports[_0x3545('0x105')]=function(_0x2b5c6e,_0x4221ea,_0x583685){var _0x2de118=0x0;var _0xbb40ad=0x0;var _0x2c2353=![];var _0xd0099e;var _0x1f4162;return db['ChatWebsite'][_0x3545('0x60')]({'where':{'id':_0x2b5c6e[_0x3545('0x5f')]['id']},'include':[{'model':db[_0x3545('0x110')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x3545('0x111'),'attributes':['id',_0x3545('0x107')],'raw':!![]}]}]})[_0x3545('0x26')](handleEntityNotFound(_0x4221ea,null))[_0x3545('0x26')](function(_0x5e8a87){if(_0x5e8a87){_0xd0099e=_0x5e8a87;return _0x5e8a87[_0x3545('0x112')]({'raw':!![]});}})['then'](function(_0x3bd91a){if(_0xd0099e){if(_0x3bd91a){_0x1f4162=_0x3bd91a;}}return require(_0x3545('0x1b'))[_0x3545('0x113')]();})[_0x3545('0x26')](function(_0x481bb2){if(_0x481bb2){_0xbb40ad=_0x481bb2[_0x3545('0x114')];_0x2c2353=_0x481bb2[_0x3545('0x81')];}})[_0x3545('0x26')](function(){return db[_0x3545('0xbc')][_0x3545('0x39')]({'where':{'closed':![]}});})[_0x3545('0x26')](function(_0x3b1e7b){_0x2de118=_0x3b1e7b;if(_0xbb40ad&&_0x3b1e7b>_0xbb40ad){return db[_0x3545('0x115')][_0x3545('0x70')]({'where':{'id':0x1}})[_0x3545('0x26')](function(_0x92fb8d){if(_0x92fb8d){_0x92fb8d[_0x3545('0x116')]('chatLicenseExceeded');}});}})[_0x3545('0x26')](function(){if(_0xd0099e[_0x3545('0x110')]&&_0xd0099e[_0x3545('0x110')][_0x3545('0x111')]){var _0x47a945=[];for(var _0x156039=0x0;_0x156039<_0xd0099e['Interval'][_0x3545('0x111')][_0x3545('0x52')];_0x156039++){var _0x114fc0=_0xd0099e[_0x3545('0x110')][_0x3545('0x111')][_0x156039][_0x3545('0x3e')]({'plain':!![]});_0x47a945[_0x3545('0x117')](iftimePromise(_0x114fc0,_0xd0099e));}return BPromise[_0x3545('0x118')](_0x47a945)['then'](function(_0x58803f){return _[_0x3545('0x119')](_0x58803f);});}else{return!![];}})[_0x3545('0x26')](function(_0x5d5d25){var _0x20e2a1=fs[_0x3545('0x11a')](path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x11b')),_0x3545('0xd7'));var _0x2b92f3={'remote':_0xd0099e[_0x3545('0x11c')],'query':querystring[_0x3545('0x2c')](_[_0x3545('0x59')](_0xd0099e['get']({'plain':!![]}),{'customerIp':_0x2b5c6e[_0x3545('0x90')][_0x3545('0xad')]||_0x2b5c6e[_0x3545('0x90')][_0x3545('0x11d')]||_0x2b5c6e[_0x3545('0x11e')][_0x3545('0x11f')]||_0x2b5c6e['ip'],'referer':_0x2b5c6e[_0x3545('0x90')]['referer'],'openedInteractions':_0x2de118,'maxInteractions':_0xbb40ad,'virtual':_0x2c2353['virtual'],'online':_0x5d5d25,'custom':_0x2c2353}))[_0x3545('0x120')](/'/g,'\x5c\x27')};_0x4221ea[_0x3545('0x43')](ejs[_0x3545('0x121')](Mustache[_0x3545('0x121')](_0x20e2a1,_0x2b92f3),{'proactiveActions':_0x1f4162,'alignment':_0xd0099e[_0x3545('0x122')],'verticalAlignment':_0xd0099e[_0x3545('0x123')],'div_color':_0xd0099e[_0x3545('0x124')],'text_color':_0xd0099e[_0x3545('0x125')],'button_color':_0xd0099e['color_button'],'background_color':_0xd0099e['backgroundColor']}));})[_0x3545('0x31')](handleError(_0x4221ea,null));};exports[_0x3545('0x126')]=function(_0x42478e,_0x5e55cb,_0x175700){return db[_0x3545('0x47')][_0x3545('0x70')]({'where':{'id':_0x42478e[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x5e55cb,null))[_0x3545('0x26')](function(_0x57afa6){if(_0x57afa6){return db[_0x3545('0xe0')][_0x3545('0xe1')](function(_0x566692){return db['ChatApplication'][_0x3545('0x3d')]({'where':{'ChatWebsiteId':_0x42478e[_0x3545('0x5f')]['id']},'transaction':_0x566692})['then'](function(_0x57dbb3){var _0x1b6809=_[_0x3545('0x46')](_0x42478e[_0x3545('0x62')],function(_0x36819f){_0x36819f[_0x3545('0x6a')]=_0x42478e['params']['id'];return _0x36819f;});return db[_0x3545('0xa3')][_0x3545('0xe2')](_0x1b6809,{'transaction':_0x566692});});})['then'](function(){return db['ChatApplication'][_0x3545('0x127')]({'where':{'ChatWebsiteId':_0x42478e[_0x3545('0x5f')]['id']},'order':_0x3545('0x128')});});}})[_0x3545('0x26')](respondWithResult(_0x5e55cb,null))[_0x3545('0x31')](handleError(_0x5e55cb,null));};exports['getApplications']=function(_0xb0f4be,_0x393699,_0x443902){var _0x8b3dfa={};var _0x4b4937={};var _0x5ebda9;var _0x2eabf7;return db['ChatWebsite'][_0x3545('0x70')]({'where':{'id':_0xb0f4be[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x393699,null))['then'](function(_0x1e1a4a){if(_0x1e1a4a){_0x5ebda9=_0x1e1a4a;_0x4b4937['model']=_[_0x3545('0x4d')](db[_0x3545('0xa3')][_0x3545('0x48')]);_0x4b4937[_0x3545('0x4c')]=_[_0x3545('0x4d')](_0xb0f4be['query']);_0x4b4937[_0x3545('0x4e')]=_[_0x3545('0x4f')](_0x4b4937[_0x3545('0x4b')],_0x4b4937[_0x3545('0x4c')]);_0x8b3dfa['attributes']=_['intersection'](_0x4b4937['model'],qs[_0x3545('0x51')](_0xb0f4be[_0x3545('0x4c')][_0x3545('0x51')]));_0x8b3dfa[_0x3545('0x50')]=_0x8b3dfa[_0x3545('0x50')][_0x3545('0x52')]?_0x8b3dfa['attributes']:_0x4b4937[_0x3545('0x4b')];_0x8b3dfa[_0x3545('0x54')]=qs[_0x3545('0x55')](_0xb0f4be[_0x3545('0x4c')][_0x3545('0x55')]);_0x8b3dfa['where']=qs['filters'](_['pick'](_0xb0f4be[_0x3545('0x4c')],_0x4b4937['filters']));if(_0xb0f4be[_0x3545('0x4c')][_0x3545('0x58')]){_0x8b3dfa[_0x3545('0x56')]=_['merge'](_0x8b3dfa['where'],{'$or':_[_0x3545('0x46')](_0x8b3dfa[_0x3545('0x50')],function(_0x2df8f1){var _0x3a97ee={};_0x3a97ee[_0x2df8f1]={'$like':'%'+_0xb0f4be['query'][_0x3545('0x58')]+'%'};return _0x3a97ee;})});}_0x8b3dfa=_[_0x3545('0x59')]({},_0x8b3dfa,_0xb0f4be[_0x3545('0x5b')]);return _0x5ebda9['getApplications'](_0x8b3dfa);}})[_0x3545('0x26')](function(_0xb13e7c){if(_0xb13e7c){_0x2eabf7=_0xb13e7c[_0x3545('0x52')];if(!_0xb0f4be[_0x3545('0x4c')][_0x3545('0x69')](_0x3545('0x53'))){_0x8b3dfa[_0x3545('0x37')]=qs[_0x3545('0x37')](_0xb0f4be[_0x3545('0x4c')][_0x3545('0x37')]);_0x8b3dfa[_0x3545('0x36')]=qs['offset'](_0xb0f4be[_0x3545('0x4c')][_0x3545('0x36')]);}return _0x5ebda9[_0x3545('0x129')](_0x8b3dfa);}})[_0x3545('0x26')](function(_0x3cae24){if(_0x3cae24){return _0x3cae24?{'count':_0x2eabf7,'rows':_0x3cae24}:null;}})[_0x3545('0x26')](respondWithResult(_0x393699,null))[_0x3545('0x31')](handleError(_0x393699,null));};exports[_0x3545('0x12a')]=function(_0x21742c,_0x34d4b4,_0x559381){return db[_0x3545('0x12b')][_0x3545('0x60')]({'where':{'id':_0x21742c[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x34d4b4,null))[_0x3545('0x26')](function(_0x44d7de){if(_0x44d7de){return _0x44d7de['addProactiveActions'](_0x21742c[_0x3545('0x62')]['ids'],_['omit'](_0x21742c[_0x3545('0x62')],[_0x3545('0x6c'),'id'])||{});}})[_0x3545('0x26')](respondWithResult(_0x34d4b4,null))[_0x3545('0x31')](handleError(_0x34d4b4,null));};exports[_0x3545('0x112')]=function(_0x235631,_0x32c0c8,_0x70962){var _0x334db2={};var _0x430490={};var _0x443f99;var _0x386693;return db['ChatWebsite'][_0x3545('0x70')]({'where':{'id':_0x235631[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x32c0c8,null))[_0x3545('0x26')](function(_0x75db4f){if(_0x75db4f){_0x443f99=_0x75db4f;_0x430490[_0x3545('0x4b')]=_[_0x3545('0x4d')](db[_0x3545('0x12c')][_0x3545('0x48')]);_0x430490['query']=_[_0x3545('0x4d')](_0x235631[_0x3545('0x4c')]);_0x430490['filters']=_[_0x3545('0x4f')](_0x430490[_0x3545('0x4b')],_0x430490[_0x3545('0x4c')]);_0x334db2['attributes']=_[_0x3545('0x4f')](_0x430490[_0x3545('0x4b')],qs[_0x3545('0x51')](_0x235631[_0x3545('0x4c')]['fields']));_0x334db2[_0x3545('0x50')]=_0x334db2[_0x3545('0x50')][_0x3545('0x52')]?_0x334db2[_0x3545('0x50')]:_0x430490[_0x3545('0x4b')];_0x334db2[_0x3545('0x54')]=qs[_0x3545('0x55')](_0x235631[_0x3545('0x4c')][_0x3545('0x55')]);_0x334db2[_0x3545('0x56')]=qs[_0x3545('0x4e')](_[_0x3545('0x57')](_0x235631[_0x3545('0x4c')],_0x430490[_0x3545('0x4e')]));if(_0x235631[_0x3545('0x4c')][_0x3545('0x58')]){_0x334db2[_0x3545('0x56')]=_[_0x3545('0x59')](_0x334db2[_0x3545('0x56')],{'$or':_[_0x3545('0x46')](_0x334db2[_0x3545('0x50')],function(_0x29465d){var _0x5e9b28={};_0x5e9b28[_0x29465d]={'$like':'%'+_0x235631[_0x3545('0x4c')][_0x3545('0x58')]+'%'};return _0x5e9b28;})});}_0x334db2=_[_0x3545('0x59')]({},_0x334db2,_0x235631[_0x3545('0x5b')]);return _0x443f99['getProactiveActions'](_0x334db2);}})[_0x3545('0x26')](function(_0x5f187c){if(_0x5f187c){_0x386693=_0x5f187c[_0x3545('0x52')];if(!_0x235631[_0x3545('0x4c')][_0x3545('0x69')](_0x3545('0x53'))){_0x334db2[_0x3545('0x37')]=qs[_0x3545('0x37')](_0x235631[_0x3545('0x4c')][_0x3545('0x37')]);_0x334db2[_0x3545('0x36')]=qs[_0x3545('0x36')](_0x235631[_0x3545('0x4c')][_0x3545('0x36')]);}return _0x443f99['getProactiveActions'](_0x334db2);}})['then'](function(_0x576419){if(_0x576419){return _0x576419?{'count':_0x386693,'rows':_0x576419}:null;}})['then'](respondWithResult(_0x32c0c8,null))[_0x3545('0x31')](handleError(_0x32c0c8,null));};exports[_0x3545('0x12d')]=function(_0x2478d2,_0x369b5e,_0x31f91a){var _0x5ac107=_0x2478d2[_0x3545('0x4c')][_0x3545('0x12e')]===_0x3545('0x12f')?_0x3545('0x130'):_0x3545('0x131');return db[_0x3545('0x47')][_0x3545('0x60')]({'attributes':['id',_0x5ac107],'where':{'id':_0x2478d2[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x369b5e,null))[_0x3545('0x26')](function(_0x351618){if(_0x351618){var _0x5cdcbe=_0x351618[_0x5ac107];var _0x8375e1=_0x5cdcbe&&_0x5cdcbe[_0x3545('0x132')]?_0x5cdcbe[_0x3545('0x132')]:[];_0x369b5e[_0x3545('0x43')]({'fromKey':_[_0x3545('0x82')](_0x5cdcbe['fromKey'])?undefined:_0x5cdcbe[_0x3545('0x133')],'count':_0x8375e1[_0x3545('0x52')],'rows':_0x8375e1});}})[_0x3545('0x31')](handleError(_0x369b5e,null));};exports[_0x3545('0x134')]=function(_0x37687a,_0x5eecfa,_0x3205ca){var _0x12fa61={'raw':![],'where':{}};var _0x1d83ba={};var _0x4a39db={'count':0x0,'rows':[]};return db[_0x3545('0x47')][_0x3545('0x70')]({'where':{'id':_0x37687a[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x5eecfa,null))[_0x3545('0x26')](function(_0x48d301){if(_0x48d301){_0x1d83ba[_0x3545('0x4b')]=_[_0x3545('0x4d')](db[_0x3545('0xd8')]['rawAttributes']);_0x1d83ba[_0x3545('0x4c')]=_[_0x3545('0x4d')](_0x37687a[_0x3545('0x4c')]);_0x1d83ba[_0x3545('0x4e')]=_['intersection'](_0x1d83ba['model'],_0x1d83ba['query']);_0x12fa61[_0x3545('0x50')]=_['intersection'](_0x1d83ba['model'],qs[_0x3545('0x51')](_0x37687a[_0x3545('0x4c')][_0x3545('0x51')]));_0x12fa61[_0x3545('0x50')]=_0x12fa61[_0x3545('0x50')]['length']?_0x12fa61[_0x3545('0x50')]:_0x1d83ba[_0x3545('0x4b')];if(!_0x37687a[_0x3545('0x4c')]['hasOwnProperty']('nolimit')){_0x12fa61[_0x3545('0x37')]=qs[_0x3545('0x37')](_0x37687a[_0x3545('0x4c')][_0x3545('0x37')]);_0x12fa61[_0x3545('0x36')]=qs[_0x3545('0x36')](_0x37687a[_0x3545('0x4c')][_0x3545('0x36')]);}_0x12fa61[_0x3545('0x54')]=qs[_0x3545('0x55')](_0x37687a[_0x3545('0x4c')][_0x3545('0x55')]);_0x12fa61[_0x3545('0x56')]=qs[_0x3545('0x4e')](_[_0x3545('0x57')](_0x37687a[_0x3545('0x4c')],_0x1d83ba[_0x3545('0x4e')]));_0x12fa61['where'][_0x3545('0x6a')]=_0x48d301['id'];if(_0x37687a[_0x3545('0x4c')][_0x3545('0x58')]){_0x12fa61[_0x3545('0x56')]=_[_0x3545('0x59')](_0x12fa61['where'],{'$or':_[_0x3545('0x46')](_0x12fa61[_0x3545('0x50')],function(_0x4f67b0){var _0x320e75={};_0x320e75[_0x4f67b0]={'$like':'%'+_0x37687a[_0x3545('0x4c')][_0x3545('0x58')]+'%'};return _0x320e75;})});}_0x12fa61=_['merge']({},_0x12fa61,_0x37687a[_0x3545('0x5b')]);return db[_0x3545('0xd8')][_0x3545('0x39')]({'where':_0x12fa61[_0x3545('0x56')]})[_0x3545('0x26')](function(_0x2d59a9){_0x4a39db[_0x3545('0x39')]=_0x2d59a9;if(_0x37687a['query'][_0x3545('0x5c')]){_0x12fa61[_0x3545('0x5d')]=[{'all':!![]}];}else{_0x12fa61[_0x3545('0x5d')]=[{'model':db[_0x3545('0xa0')],'as':'Contact','required':![]},{'model':db[_0x3545('0x135')],'as':_0x3545('0x136'),'required':![]}];}return db[_0x3545('0xd8')][_0x3545('0x71')](_0x12fa61);})['then'](function(_0x3b2234){_0x4a39db[_0x3545('0x5e')]=_0x3b2234;return _0x4a39db;});}})[_0x3545('0x26')](respondWithFilteredResult(_0x5eecfa,_0x12fa61))['catch'](handleError(_0x5eecfa,null));};exports[_0x3545('0x137')]=function(_0x5a31e9,_0x485b8b,_0x32e6a7){return db['ChatWebsite'][_0x3545('0x60')]({'where':{'id':_0x5a31e9[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x485b8b,null))['then'](function(_0x520498){if(_0x520498){return _0x520498[_0x3545('0x137')](_0x5a31e9[_0x3545('0x62')]['ids'],_[_0x3545('0xfc')](_0x5a31e9[_0x3545('0x62')],[_0x3545('0x6c'),'id'])||{})['spread'](function(_0xd411b2){for(var _0x3aacb7=0x0;_0x3aacb7<_0x5a31e9['body'][_0x3545('0x6c')][_0x3545('0x52')];_0x3aacb7+=0x1){socket[_0x3545('0x138')](_0x3545('0x139'),{'UserId':Number(_0x5a31e9['body'][_0x3545('0x6c')][_0x3aacb7]),'ChatWebsiteId':Number(_0x5a31e9['params']['id'])});}return _0xd411b2;});}})[_0x3545('0x26')](respondWithResult(_0x485b8b,null))[_0x3545('0x31')](handleError(_0x485b8b,null));};exports[_0x3545('0x13a')]=function(_0x596d35,_0x32603f,_0x36c0d2){return db[_0x3545('0x47')][_0x3545('0x60')]({'where':{'id':_0x596d35[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x32603f,null))[_0x3545('0x26')](function(_0x3d7872){if(_0x3d7872){return _0x3d7872[_0x3545('0x13a')](_0x596d35[_0x3545('0x4c')][_0x3545('0x6c')])[_0x3545('0x26')](function(){if(_[_0x3545('0x13b')](_0x596d35[_0x3545('0x4c')]['ids'])){for(var _0x159a5b=0x0;_0x159a5b<_0x596d35[_0x3545('0x4c')][_0x3545('0x6c')][_0x3545('0x52')];_0x159a5b+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x596d35[_0x3545('0x4c')][_0x3545('0x6c')][_0x159a5b]),'ChatWebsiteId':Number(_0x596d35[_0x3545('0x5f')]['id'])});}}else{socket[_0x3545('0x138')](_0x3545('0x13c'),{'UserId':Number(_0x596d35[_0x3545('0x4c')][_0x3545('0x6c')]),'ChatWebsiteId':Number(_0x596d35[_0x3545('0x5f')]['id'])});}});}})[_0x3545('0x26')](respondWithStatusCode(_0x32603f,null))[_0x3545('0x31')](handleError(_0x32603f,null));};exports[_0x3545('0x13d')]=function(_0x3d3c2e,_0x43d4ef,_0x1b4961){var _0x55aa45={};var _0x1ad787={};var _0x5ade40;var _0x40bb8e;return db[_0x3545('0x47')][_0x3545('0x70')]({'where':{'id':_0x3d3c2e['params']['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x43d4ef,null))[_0x3545('0x26')](function(_0x574d3b){if(_0x574d3b){_0x5ade40=_0x574d3b;_0x1ad787[_0x3545('0x4b')]=_[_0x3545('0x4d')](db['User'][_0x3545('0x48')]);_0x1ad787[_0x3545('0x4c')]=_[_0x3545('0x4d')](_0x3d3c2e[_0x3545('0x4c')]);_0x1ad787[_0x3545('0x4e')]=_[_0x3545('0x4f')](_0x1ad787[_0x3545('0x4b')],_0x1ad787[_0x3545('0x4c')]);_0x55aa45['attributes']=_['intersection'](_0x1ad787[_0x3545('0x4b')],qs[_0x3545('0x51')](_0x3d3c2e[_0x3545('0x4c')][_0x3545('0x51')]));_0x55aa45[_0x3545('0x50')]=_0x55aa45[_0x3545('0x50')]['length']?_0x55aa45[_0x3545('0x50')]:_0x1ad787['model'];_0x55aa45['order']=qs['sort'](_0x3d3c2e[_0x3545('0x4c')][_0x3545('0x55')]);_0x55aa45['where']=qs['filters'](_[_0x3545('0x57')](_0x3d3c2e[_0x3545('0x4c')],_0x1ad787[_0x3545('0x4e')]));if(_0x3d3c2e[_0x3545('0x4c')][_0x3545('0x58')]){_0x55aa45[_0x3545('0x56')]=_['merge'](_0x55aa45['where'],{'$or':_[_0x3545('0x46')](_0x55aa45[_0x3545('0x50')],function(_0x19188b){var _0x17c01c={};_0x17c01c[_0x19188b]={'$like':'%'+_0x3d3c2e[_0x3545('0x4c')][_0x3545('0x58')]+'%'};return _0x17c01c;})});}_0x55aa45=_['merge']({},_0x55aa45,_0x3d3c2e['options']);return _0x5ade40[_0x3545('0x13d')](_0x55aa45);}})[_0x3545('0x26')](function(_0x5987b5){if(_0x5987b5){_0x40bb8e=_0x5987b5[_0x3545('0x52')];if(!_0x3d3c2e[_0x3545('0x4c')][_0x3545('0x69')]('nolimit')){_0x55aa45['limit']=qs[_0x3545('0x37')](_0x3d3c2e[_0x3545('0x4c')][_0x3545('0x37')]);_0x55aa45[_0x3545('0x36')]=qs[_0x3545('0x36')](_0x3d3c2e['query'][_0x3545('0x36')]);}return _0x5ade40[_0x3545('0x13d')](_0x55aa45);}})['then'](function(_0x54a857){if(_0x54a857){return _0x54a857?{'count':_0x40bb8e,'rows':_0x54a857}:null;}})['then'](respondWithResult(_0x43d4ef,null))[_0x3545('0x31')](handleError(_0x43d4ef,null));};
\ No newline at end of file
index 08e08a3..b7fdf73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ee5=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatWebsite'];(function(_0x1a5631,_0x1af65a){var _0x4d0e02=function(_0x592e1f){while(--_0x592e1f){_0x1a5631['push'](_0x1a5631['shift']());}};_0x4d0e02(++_0x1af65a);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x4fffcf,_0x49b324){_0x4fffcf=_0x4fffcf-0x0;var _0x544752=_0x3ee5[_0x4fffcf];return _0x544752;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x53ee('0x0'))['db'][_0x53ee('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x53ee('0x2'),'afterUpdate':_0x53ee('0x3'),'afterDestroy':_0x53ee('0x4')};function emitEvent(_0x24e272){return function(_0x25e597,_0x119975,_0x21c99a){ChatWebsiteEvents[_0x53ee('0x5')](_0x24e272+':'+_0x25e597['id'],_0x25e597);ChatWebsiteEvents[_0x53ee('0x5')](_0x24e272,_0x25e597);_0x21c99a(null);};}for(var e in events){if(events[_0x53ee('0x6')](e)){var event=events[e];ChatWebsite[_0x53ee('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x4016=['ChatWebsite','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x416df5,_0x5cd9e7){var _0x53235b=function(_0xc8811e){while(--_0xc8811e){_0x416df5['push'](_0x416df5['shift']());}};_0x53235b(++_0x5cd9e7);}(_0x4016,0x131));var _0x6401=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4016[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x6401('0x0'))['db'][_0x6401('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6401('0x2')};function emitEvent(_0x4de6b1){return function(_0x4fc38,_0x27c82a,_0x5f37ea){ChatWebsiteEvents['emit'](_0x4de6b1+':'+_0x4fc38['id'],_0x4fc38);ChatWebsiteEvents[_0x6401('0x3')](_0x4de6b1,_0x4fc38);_0x5f37ea(null);};}for(var e in events){if(events[_0x6401('0x4')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x6401('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
index 7463e6b..0bbb066 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9581=['request-promise','path','rimraf','../../config/environment','chat_websites','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2bc293,_0x2749be){var _0x2f83ed=function(_0x1d53d1){while(--_0x1d53d1){_0x2bc293['push'](_0x2bc293['shift']());}};_0x2f83ed(++_0x2749be);}(_0x9581,0x191));var _0x1958=function(_0x1beebe,_0x5594ae){_0x1beebe=_0x1beebe-0x0;var _0x2bd4c3=_0x9581[_0x1beebe];return _0x2bd4c3;};'use strict';var _=require(_0x1958('0x0'));var util=require(_0x1958('0x1'));var logger=require(_0x1958('0x2'))(_0x1958('0x3'));var moment=require(_0x1958('0x4'));var BPromise=require(_0x1958('0x5'));var rp=require(_0x1958('0x6'));var fs=require('fs');var path=require(_0x1958('0x7'));var rimraf=require(_0x1958('0x8'));var config=require(_0x1958('0x9'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x9d2dab,_0x483514){return _0x9d2dab['define']('ChatWebsite',attributes,{'tableName':_0x1958('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e2b=['define','chat_websites','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x4657b4,_0x170028){var _0x547baf=function(_0x34b771){while(--_0x34b771){_0x4657b4['push'](_0x4657b4['shift']());}};_0x547baf(++_0x170028);}(_0x9e2b,0x120));var _0xb9e2=function(_0x2006e9,_0x4057f6){_0x2006e9=_0x2006e9-0x0;var _0x521bb7=_0x9e2b[_0x2006e9];return _0x521bb7;};'use strict';var _=require(_0xb9e2('0x0'));var util=require(_0xb9e2('0x1'));var logger=require('../../config/logger')(_0xb9e2('0x2'));var moment=require(_0xb9e2('0x3'));var BPromise=require('bluebird');var rp=require(_0xb9e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb9e2('0x5'));var config=require(_0xb9e2('0x6'));var attributes=require(_0xb9e2('0x7'));module[_0xb9e2('0x8')]=function(_0x399df8,_0x89c77b){return _0x399df8[_0xb9e2('0x9')]('ChatWebsite',attributes,{'tableName':_0xb9e2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 921bda5..d6f821b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5c4=['rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xb5c4,0xc8));var _0x4b5c=function(_0x12b4d4,_0x2134e9){_0x12b4d4=_0x12b4d4-0x0;var _0x32604e=_0xb5c4[_0x12b4d4];return _0x32604e;};'use strict';var _=require('lodash');var util=require(_0x4b5c('0x0'));var moment=require(_0x4b5c('0x1'));var BPromise=require(_0x4b5c('0x2'));var rs=require(_0x4b5c('0x3'));var fs=require('fs');var Redis=require(_0x4b5c('0x4'));var db=require(_0x4b5c('0x5'))['db'];var utils=require(_0x4b5c('0x6'));var logger=require(_0x4b5c('0x7'))(_0x4b5c('0x8'));var config=require(_0x4b5c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4b5c('0xa')][_0x4b5c('0xb')]({'port':0x232a});config[_0x4b5c('0xc')]=_[_0x4b5c('0xd')](config[_0x4b5c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b5c('0xe'))(new Redis(config[_0x4b5c('0xc')]));require(_0x4b5c('0xf'))[_0x4b5c('0x10')](socket);function respondWithRpcPromise(_0x558f41,_0x2b2aec,_0x441b52){return new BPromise(function(_0x3203e6,_0x2b75b8){return client[_0x4b5c('0x11')](_0x558f41,_0x441b52)['then'](function(_0x10aaa8){logger[_0x4b5c('0x12')](_0x4b5c('0x13'),_0x2b2aec,_0x4b5c('0x14'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2b2aec,_0x4b5c('0x14'),JSON[_0x4b5c('0x15')](_0x10aaa8));if(_0x10aaa8[_0x4b5c('0x16')]){if(_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x17')]===0x1f4){logger[_0x4b5c('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x2b2aec,_0x10aaa8[_0x4b5c('0x16')]['message']);return _0x2b75b8(_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x18')]);}logger[_0x4b5c('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x2b2aec,_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x18')]);return _0x3203e6(_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x18')]);}else{logger[_0x4b5c('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x2b2aec,_0x4b5c('0x14'));_0x3203e6(_0x10aaa8[_0x4b5c('0x19')]['message']);}})['catch'](function(_0x50b356){logger[_0x4b5c('0x16')](_0x4b5c('0x13'),_0x2b2aec,_0x50b356);_0x2b75b8(_0x50b356);});});}
\ No newline at end of file
+var _0x452b=['register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket'];(function(_0x514f8c,_0x149740){var _0x3fbf72=function(_0x55bb5a){while(--_0x55bb5a){_0x514f8c['push'](_0x514f8c['shift']());}};_0x3fbf72(++_0x149740);}(_0x452b,0x8e));var _0xb452=function(_0x3921db,_0x1420f1){_0x3921db=_0x3921db-0x0;var _0x309d29=_0x452b[_0x3921db];return _0x309d29;};'use strict';var _=require(_0xb452('0x0'));var util=require(_0xb452('0x1'));var moment=require(_0xb452('0x2'));var BPromise=require(_0xb452('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb452('0x4'))['db'];var utils=require(_0xb452('0x5'));var logger=require(_0xb452('0x6'))('rpc');var config=require(_0xb452('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb452('0x8')][_0xb452('0x9')]({'port':0x232a});config[_0xb452('0xa')]=_['defaults'](config[_0xb452('0xa')],{'host':_0xb452('0xb'),'port':0x18eb});var socket=require(_0xb452('0xc'))(new Redis(config[_0xb452('0xa')]));require(_0xb452('0xd'))[_0xb452('0xe')](socket);function respondWithRpcPromise(_0x66b959,_0x5ddf4c,_0x2ede7a){return new BPromise(function(_0x4c1c15,_0x9bef26){return client[_0xb452('0xf')](_0x66b959,_0x2ede7a)['then'](function(_0x25794d){logger[_0xb452('0x10')](_0xb452('0x11'),_0x5ddf4c,_0xb452('0x12'));logger['debug'](_0xb452('0x13'),_0x5ddf4c,_0xb452('0x12'),JSON[_0xb452('0x14')](_0x25794d));if(_0x25794d['error']){if(_0x25794d[_0xb452('0x15')][_0xb452('0x16')]===0x1f4){logger['error'](_0xb452('0x11'),_0x5ddf4c,_0x25794d['error'][_0xb452('0x17')]);return _0x9bef26(_0x25794d['error'][_0xb452('0x17')]);}logger['error'](_0xb452('0x11'),_0x5ddf4c,_0x25794d[_0xb452('0x15')][_0xb452('0x17')]);return _0x4c1c15(_0x25794d[_0xb452('0x15')]['message']);}else{logger[_0xb452('0x10')](_0xb452('0x11'),_0x5ddf4c,_0xb452('0x12'));_0x4c1c15(_0x25794d[_0xb452('0x18')][_0xb452('0x17')]);}})[_0xb452('0x19')](function(_0x2a5651){logger['error'](_0xb452('0x11'),_0x5ddf4c,_0x2a5651);_0x9bef26(_0x2a5651);});});}
\ No newline at end of file
index 8b29f5a..2ff856f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x455a=['removeListener','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x577722,_0xcaa9af){var _0x409f2d=function(_0x47f53c){while(--_0x47f53c){_0x577722['push'](_0x577722['shift']());}};_0x409f2d(++_0xcaa9af);}(_0x455a,0x10d));var _0xa455=function(_0x502eb0,_0x6d0814){_0x502eb0=_0x502eb0-0x0;var _0x4f78e4=_0x455a[_0x502eb0];return _0x4f78e4;};'use strict';var ChatWebsiteEvents=require(_0xa455('0x0'));var events=[_0xa455('0x1'),_0xa455('0x2'),_0xa455('0x3')];function createListener(_0xc10cfe,_0x27b956){return function(_0x1d00cf){_0x27b956['emit'](_0xc10cfe,_0x1d00cf);};}function removeListener(_0x1886b7,_0x559ff1){return function(){ChatWebsiteEvents[_0xa455('0x4')](_0x1886b7,_0x559ff1);};}exports['register']=function(_0x1bdd5f){for(var _0x36fa2b=0x0,_0x43a266=events[_0xa455('0x5')];_0x36fa2b<_0x43a266;_0x36fa2b++){var _0x2f368b=events[_0x36fa2b];var _0xb69dab=createListener(_0xa455('0x6')+_0x2f368b,_0x1bdd5f);ChatWebsiteEvents['on'](_0x2f368b,_0xb69dab);}};
\ No newline at end of file
+var _0x1d82=['register','chatWebsite:','./chatWebsite.events','save','remove','update','removeListener'];(function(_0x26f8a1,_0x2fb7c5){var _0xf4d492=function(_0x5e2008){while(--_0x5e2008){_0x26f8a1['push'](_0x26f8a1['shift']());}};_0xf4d492(++_0x2fb7c5);}(_0x1d82,0xaa));var _0x21d8=function(_0x9c866c,_0x3f89b4){_0x9c866c=_0x9c866c-0x0;var _0x695888=_0x1d82[_0x9c866c];return _0x695888;};'use strict';var ChatWebsiteEvents=require(_0x21d8('0x0'));var events=[_0x21d8('0x1'),_0x21d8('0x2'),_0x21d8('0x3')];function createListener(_0x5301e4,_0x3f8f01){return function(_0x407744){_0x3f8f01['emit'](_0x5301e4,_0x407744);};}function removeListener(_0x510528,_0x4ba535){return function(){ChatWebsiteEvents[_0x21d8('0x4')](_0x510528,_0x4ba535);};}exports[_0x21d8('0x5')]=function(_0x279a6c){for(var _0x3aa813=0x0,_0x175702=events['length'];_0x3aa813<_0x175702;_0x3aa813++){var _0x47f12a=events[_0x3aa813];var _0x21f783=createListener(_0x21d8('0x6')+_0x47f12a,_0x279a6c);ChatWebsiteEvents['on'](_0x47f12a,_0x21f783);}};
\ No newline at end of file
index b886a8a..1040ed1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5be5=['post','create','addAnswer','join','root','server/files/images/logos/','format','%s-%s','single','addLogo','diskStorage','server/files/images/avatars/','now','file','addAvatar','addCustomerAvatar','originalname','addSystemAvatar','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','offline','addApplications','addProactiveActions','update','delete','destroy','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents'];(function(_0x5eb447,_0xd7e005){var _0x1758f2=function(_0x2215d4){while(--_0x2215d4){_0x5eb447['push'](_0x5eb447['shift']());}};_0x1758f2(++_0xd7e005);}(_0x5be5,0xb0));var _0x55be=function(_0x39106d,_0x4d5fef){_0x39106d=_0x39106d-0x0;var _0x42d497=_0x5be5[_0x39106d];return _0x42d497;};'use strict';var multer=require(_0x55be('0x0'));var util=require(_0x55be('0x1'));var path=require(_0x55be('0x2'));var timeout=require(_0x55be('0x3'));var express=require(_0x55be('0x4'));var router=express[_0x55be('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x55be('0x6'));var interaction=require(_0x55be('0x7'));var config=require(_0x55be('0x8'));var controller=require(_0x55be('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x55be('0xa')]);router['get'](_0x55be('0xb'),auth[_0x55be('0xc')](),controller[_0x55be('0xd')]);router[_0x55be('0xe')](_0x55be('0xf'),auth['isAuthenticated'](),controller[_0x55be('0x10')]);router['get'](_0x55be('0x11'),auth[_0x55be('0xc')](),controller[_0x55be('0x12')]);router[_0x55be('0xe')](_0x55be('0x13'),auth[_0x55be('0xc')](),controller[_0x55be('0x14')]);router[_0x55be('0xe')](_0x55be('0x15'),controller[_0x55be('0x16')]);router[_0x55be('0xe')](_0x55be('0x17'),controller[_0x55be('0x18')]);router[_0x55be('0xe')](_0x55be('0x19'),controller['getCustomerAvatar']);router[_0x55be('0xe')](_0x55be('0x1a'),controller['getSystemAvatar']);router['get'](_0x55be('0x1b'),auth[_0x55be('0xc')](),controller[_0x55be('0x1c')]);router[_0x55be('0xe')](_0x55be('0x1d'),controller[_0x55be('0x1e')]);router['get'](_0x55be('0x1f'),auth[_0x55be('0xc')](),controller[_0x55be('0x20')]);router[_0x55be('0xe')](_0x55be('0x21'),auth['isAuthenticated'](),controller[_0x55be('0x22')]);router[_0x55be('0xe')](_0x55be('0x23'),controller[_0x55be('0x24')]);router['get'](_0x55be('0x25'),auth[_0x55be('0xc')](),controller['getOfflineMessages']);router[_0x55be('0xe')](_0x55be('0x26'),auth[_0x55be('0xc')](),controller[_0x55be('0x27')]);router[_0x55be('0x28')]('/',auth['isAuthenticated'](),controller[_0x55be('0x29')]);router[_0x55be('0x28')](_0x55be('0x11'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x55be('0x13'),auth['isAuthenticated'](),controller[_0x55be('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x82646f,_0xb0968b,_0x16d901){_0x16d901(null,path[_0x55be('0x2b')](config[_0x55be('0x2c')],_0x55be('0x2d')));},'filename':function(_0x35ebf8,_0x2d3292,_0x407e36){_0x407e36(null,util[_0x55be('0x2e')](_0x55be('0x2f'),Date['now'](),_0x2d3292['originalname']));}})});router[_0x55be('0x28')](_0x55be('0x15'),upload[_0x55be('0x30')]('file'),controller[_0x55be('0x31')]);var upload=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x12f185,_0x4b8abd,_0x4131fa){_0x4131fa(null,path[_0x55be('0x2b')](config['root'],_0x55be('0x33')));},'filename':function(_0xe6b580,_0x1c99b3,_0x2c75bd){_0x2c75bd(null,util[_0x55be('0x2e')](_0x55be('0x2f'),Date[_0x55be('0x34')](),_0x1c99b3['originalname']));}})});router[_0x55be('0x28')](_0x55be('0x17'),upload[_0x55be('0x30')](_0x55be('0x35')),controller[_0x55be('0x36')]);var upload=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x177c91,_0x1ce893,_0x254ade){_0x254ade(null,path[_0x55be('0x2b')](config[_0x55be('0x2c')],_0x55be('0x33')));},'filename':function(_0x360e3c,_0x2acf89,_0x37d290){_0x37d290(null,util['format'](_0x55be('0x2f'),Date['now'](),_0x2acf89['originalname']));}})});router[_0x55be('0x28')]('/:id/customer_avatar',upload['single']('file'),controller[_0x55be('0x37')]);var upload=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x25de52,_0x428f33,_0x569d07){_0x569d07(null,path[_0x55be('0x2b')](config[_0x55be('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x179cc3,_0x20a455,_0x49a9f4){_0x49a9f4(null,util[_0x55be('0x2e')](_0x55be('0x2f'),Date[_0x55be('0x34')](),_0x20a455[_0x55be('0x38')]));}})});router[_0x55be('0x28')](_0x55be('0x1a'),upload[_0x55be('0x30')](_0x55be('0x35')),controller[_0x55be('0x39')]);router[_0x55be('0x28')]('/:id/notify',controller[_0x55be('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x3114bc,_0x22f36f,_0x50112a){const _0x4852d0=path[_0x55be('0x2b')](config[_0x55be('0x2c')],_0x55be('0x3b'),'attachments',_0x55be('0x3c'));fs_extra[_0x55be('0x3d')](_0x4852d0,function(){_0x50112a(null,_0x4852d0);});},'filename':function(_0x273aaa,_0x300ea9,_0x40bdf1){const _0x415343=_0x300ea9[_0x55be('0x38')][_0x55be('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1fcbf7=path['extname'](_0x415343);const _0x4fe431=Date[_0x55be('0x34')]()+'-'+_0x415343[_0x55be('0x3e')](_0x1fcbf7,'')+_0x1fcbf7;_0x40bdf1(null,_0x4fe431);}})});router[_0x55be('0x28')](_0x55be('0x3f'),offlineUploadMulter['any'](),controller[_0x55be('0x40')]);router['post'](_0x55be('0x1b'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x55be('0x28')](_0x55be('0x1f'),auth[_0x55be('0xc')](),controller[_0x55be('0x41')]);router[_0x55be('0x28')](_0x55be('0x21'),auth['isAuthenticated'](),controller[_0x55be('0x42')]);router[_0x55be('0x28')](_0x55be('0x26'),auth[_0x55be('0xc')](),controller['addAgents']);router['put'](_0x55be('0xf'),auth[_0x55be('0xc')](),controller[_0x55be('0x43')]);router[_0x55be('0x44')]('/:id',auth[_0x55be('0xc')](),controller[_0x55be('0x45')]);router['delete'](_0x55be('0x11'),auth[_0x55be('0xc')](),controller['removeDispositions']);router[_0x55be('0x44')](_0x55be('0x13'),auth['isAuthenticated'](),controller[_0x55be('0x46')]);router[_0x55be('0x44')]('/:id/users',auth[_0x55be('0xc')](),controller['removeAgents']);module[_0x55be('0x47')]=router;
\ No newline at end of file
+var _0x0f98=['/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','/:id/users','post','create','/:id/canned_answers','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','diskStorage','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','replace','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','put','delete','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x54a9ec,_0x11342d){var _0x119de7=function(_0x418814){while(--_0x418814){_0x54a9ec['push'](_0x54a9ec['shift']());}};_0x119de7(++_0x11342d);}(_0x0f98,0x1c0));var _0x80f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f98[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x80f9('0x0'));var util=require(_0x80f9('0x1'));var path=require(_0x80f9('0x2'));var timeout=require(_0x80f9('0x3'));var express=require(_0x80f9('0x4'));var router=express[_0x80f9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x80f9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x80f9('0x7'));router[_0x80f9('0x8')]('/',auth[_0x80f9('0x9')](),controller[_0x80f9('0xa')]);router[_0x80f9('0x8')](_0x80f9('0xb'),auth[_0x80f9('0x9')](),controller[_0x80f9('0xc')]);router[_0x80f9('0x8')](_0x80f9('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x80f9('0x8')](_0x80f9('0xe'),auth[_0x80f9('0x9')](),controller[_0x80f9('0xf')]);router['get']('/:id/canned_answers',auth[_0x80f9('0x9')](),controller['getAnswers']);router[_0x80f9('0x8')](_0x80f9('0x10'),controller[_0x80f9('0x11')]);router[_0x80f9('0x8')](_0x80f9('0x12'),controller[_0x80f9('0x13')]);router[_0x80f9('0x8')](_0x80f9('0x14'),controller[_0x80f9('0x15')]);router[_0x80f9('0x8')](_0x80f9('0x16'),controller[_0x80f9('0x17')]);router[_0x80f9('0x8')](_0x80f9('0x18'),auth['isAuthenticated'](),controller[_0x80f9('0x19')]);router['get'](_0x80f9('0x1a'),controller[_0x80f9('0x1b')]);router[_0x80f9('0x8')](_0x80f9('0x1c'),auth[_0x80f9('0x9')](),controller['getApplications']);router[_0x80f9('0x8')](_0x80f9('0x1d'),auth[_0x80f9('0x9')](),controller['getProactiveActions']);router[_0x80f9('0x8')](_0x80f9('0x1e'),controller[_0x80f9('0x1f')]);router['get'](_0x80f9('0x20'),auth[_0x80f9('0x9')](),controller['getOfflineMessages']);router['get'](_0x80f9('0x21'),auth[_0x80f9('0x9')](),controller['getAgents']);router[_0x80f9('0x22')]('/',auth[_0x80f9('0x9')](),controller[_0x80f9('0x23')]);router[_0x80f9('0x22')](_0x80f9('0xe'),auth[_0x80f9('0x9')](),controller['addDisposition']);router[_0x80f9('0x22')](_0x80f9('0x24'),auth[_0x80f9('0x9')](),controller[_0x80f9('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x21624f,_0x482e91,_0x5eb1b5){_0x5eb1b5(null,path[_0x80f9('0x26')](config[_0x80f9('0x27')],_0x80f9('0x28')));},'filename':function(_0x1f1124,_0x3d2356,_0x1e2ab3){_0x1e2ab3(null,util[_0x80f9('0x29')](_0x80f9('0x2a'),Date[_0x80f9('0x2b')](),_0x3d2356[_0x80f9('0x2c')]));}})});router['post'](_0x80f9('0x10'),upload[_0x80f9('0x2d')](_0x80f9('0x2e')),controller[_0x80f9('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x181d9c,_0x1e9633,_0x54e4c3){_0x54e4c3(null,path['join'](config[_0x80f9('0x27')],_0x80f9('0x30')));},'filename':function(_0x536ea2,_0x4b0546,_0x48bb80){_0x48bb80(null,util['format'](_0x80f9('0x2a'),Date[_0x80f9('0x2b')](),_0x4b0546[_0x80f9('0x2c')]));}})});router['post'](_0x80f9('0x12'),upload[_0x80f9('0x2d')](_0x80f9('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0x80f9('0x31')]({'destination':function(_0x4d80ac,_0x54d9f8,_0x17ec9a){_0x17ec9a(null,path[_0x80f9('0x26')](config['root'],_0x80f9('0x30')));},'filename':function(_0x21fd0e,_0x7d8d1b,_0x480c00){_0x480c00(null,util[_0x80f9('0x29')](_0x80f9('0x2a'),Date[_0x80f9('0x2b')](),_0x7d8d1b[_0x80f9('0x2c')]));}})});router[_0x80f9('0x22')](_0x80f9('0x14'),upload[_0x80f9('0x2d')](_0x80f9('0x2e')),controller[_0x80f9('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54ea1f,_0x3cfbe1,_0x405085){_0x405085(null,path[_0x80f9('0x26')](config[_0x80f9('0x27')],_0x80f9('0x30')));},'filename':function(_0x3010b7,_0x46f523,_0x3f25a8){_0x3f25a8(null,util[_0x80f9('0x29')]('%s-%s',Date['now'](),_0x46f523[_0x80f9('0x2c')]));}})});router[_0x80f9('0x22')]('/:id/system_avatar',upload[_0x80f9('0x2d')]('file'),controller[_0x80f9('0x33')]);router[_0x80f9('0x22')](_0x80f9('0x34'),controller[_0x80f9('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x80f9('0x31')]({'destination':function(_0x3739fb,_0x58fcb6,_0x2ccaf2){const _0x47362b=path[_0x80f9('0x26')](config[_0x80f9('0x27')],_0x80f9('0x36'),'attachments','offline-chat');fs_extra[_0x80f9('0x37')](_0x47362b,function(){_0x2ccaf2(null,_0x47362b);});},'filename':function(_0x3cf737,_0x1090c7,_0x31c1af){const _0x15d60f=_0x1090c7[_0x80f9('0x2c')][_0x80f9('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x6ed2f1=path['extname'](_0x15d60f);const _0x12ac86=Date['now']()+'-'+_0x15d60f[_0x80f9('0x38')](_0x6ed2f1,'')+_0x6ed2f1;_0x31c1af(null,_0x12ac86);}})});router[_0x80f9('0x22')](_0x80f9('0x39'),offlineUploadMulter['any'](),controller[_0x80f9('0x3a')]);router[_0x80f9('0x22')]('/:id/interactions',auth[_0x80f9('0x9')](),controller[_0x80f9('0x3b')]);router['post'](_0x80f9('0x1c'),auth[_0x80f9('0x9')](),controller[_0x80f9('0x3c')]);router[_0x80f9('0x22')](_0x80f9('0x1d'),auth[_0x80f9('0x9')](),controller[_0x80f9('0x3d')]);router[_0x80f9('0x22')](_0x80f9('0x21'),auth[_0x80f9('0x9')](),controller['addAgents']);router[_0x80f9('0x3e')](_0x80f9('0xd'),auth[_0x80f9('0x9')](),controller['update']);router[_0x80f9('0x3f')]('/:id',auth[_0x80f9('0x9')](),controller['destroy']);router[_0x80f9('0x3f')](_0x80f9('0xe'),auth[_0x80f9('0x9')](),controller['removeDispositions']);router[_0x80f9('0x3f')]('/:id/canned_answers',auth[_0x80f9('0x9')](),controller[_0x80f9('0x40')]);router[_0x80f9('0x3f')](_0x80f9('0x21'),auth[_0x80f9('0x9')](),controller['removeAgents']);module[_0x80f9('0x41')]=router;
\ No newline at end of file
index 25246dc..ff9450d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x496e=['exports','STRING','ENUM','AmazonAWS'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x496e,0x1a0));var _0xe496=function(_0x91e3a4,_0x3af814){_0x91e3a4=_0x91e3a4-0x0;var _0x383bd5=_0x496e[_0x91e3a4];return _0x383bd5;};'use strict';var Sequelize=require('sequelize');module[_0xe496('0x0')]={'name':{'type':Sequelize[_0xe496('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe496('0x2')](_0xe496('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc9b0=['exports','STRING','ENUM','AmazonAWS','Google','sequelize'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xc9b0,0x143));var _0x0c9b=function(_0x50d353,_0x466e6f){_0x50d353=_0x50d353-0x0;var _0x4acc78=_0xc9b0[_0x50d353];return _0x4acc78;};'use strict';var Sequelize=require(_0x0c9b('0x0'));module[_0x0c9b('0x1')]={'name':{'type':Sequelize[_0x0c9b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0c9b('0x3')](_0x0c9b('0x4'),_0x0c9b('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x0c9b('0x2')]},'data2':{'type':Sequelize[_0x0c9b('0x2')]}};
\ No newline at end of file
index f0b2aeb..65b0aa2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x51c56c,_0x42c126){var _0x927019=function(_0x241547){while(--_0x241547){_0x51c56c['push'](_0x51c56c['shift']());}};_0x927019(++_0x42c126);}(_0x7a54,0x106));var _0x47a5=function(_0x183d92,_0x3699d7){_0x183d92=_0x183d92-0x0;var _0x4a59d2=_0x7a54[_0x183d92];return _0x4a59d2;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
+var _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0xb39ffe,_0x2387b2){var _0x398e83=function(_0x9941be){while(--_0x9941be){_0xb39ffe['push'](_0xb39ffe['shift']());}};_0x398e83(++_0x2387b2);}(_0x2032,0xd9));var _0x2203=function(_0x589bdc,_0x5421d0){_0x589bdc=_0x589bdc-0x0;var _0x2fff22=_0x2032[_0x589bdc];return _0x2fff22;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};
\ No newline at end of file
index 04a0483..b006549 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3210=['exports','define','CloudProvider','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x36cb61,_0x48ede7){var _0x22bb48=function(_0xed2888){while(--_0xed2888){_0x36cb61['push'](_0x36cb61['shift']());}};_0x22bb48(++_0x48ede7);}(_0x3210,0x142));var _0x0321=function(_0x202dbd,_0x515964){_0x202dbd=_0x202dbd-0x0;var _0x3edb3f=_0x3210[_0x202dbd];return _0x3edb3f;};'use strict';var _=require(_0x0321('0x0'));var util=require(_0x0321('0x1'));var logger=require('../../config/logger')(_0x0321('0x2'));var moment=require(_0x0321('0x3'));var BPromise=require(_0x0321('0x4'));var rp=require(_0x0321('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0321('0x6'));var config=require(_0x0321('0x7'));var attributes=require('./cloudProvider.attributes');module[_0x0321('0x8')]=function(_0x147df0,_0x186f9a){return _0x147df0[_0x0321('0x9')](_0x0321('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe5b4=['cloud_providers','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xe5b4,0x9d));var _0x4e5b=function(_0xb6fca9,_0x2b9836){_0xb6fca9=_0xb6fca9-0x0;var _0x155144=_0xe5b4[_0xb6fca9];return _0x155144;};'use strict';var _=require(_0x4e5b('0x0'));var util=require(_0x4e5b('0x1'));var logger=require(_0x4e5b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4e5b('0x3'));var rp=require(_0x4e5b('0x4'));var fs=require('fs');var path=require(_0x4e5b('0x5'));var rimraf=require(_0x4e5b('0x6'));var config=require(_0x4e5b('0x7'));var attributes=require(_0x4e5b('0x8'));module[_0x4e5b('0x9')]=function(_0xe2741d,_0x21899e){return _0xe2741d[_0x4e5b('0xa')](_0x4e5b('0xb'),attributes,{'tableName':_0x4e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 97549ad..86206df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b47=['result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x18483c,_0x33b067){var _0x4e0cf0=function(_0x418001){while(--_0x418001){_0x18483c['push'](_0x18483c['shift']());}};_0x4e0cf0(++_0x33b067);}(_0x2b47,0x177));var _0x72b4=function(_0x2f5ca2,_0x10f3e4){_0x2f5ca2=_0x2f5ca2-0x0;var _0x3c4041=_0x2b47[_0x2f5ca2];return _0x3c4041;};'use strict';var _=require(_0x72b4('0x0'));var util=require('util');var moment=require(_0x72b4('0x1'));var BPromise=require(_0x72b4('0x2'));var rs=require(_0x72b4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72b4('0x4'))['db'];var utils=require(_0x72b4('0x5'));var logger=require(_0x72b4('0x6'))(_0x72b4('0x7'));var config=require(_0x72b4('0x8'));var jayson=require(_0x72b4('0x9'));var client=jayson['client'][_0x72b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x480984,_0x104f08,_0x1c90aa){return new BPromise(function(_0xb1e42f,_0x1bdf7f){return client[_0x72b4('0xb')](_0x480984,_0x1c90aa)[_0x72b4('0xc')](function(_0x114a98){logger[_0x72b4('0xd')](_0x72b4('0xe'),_0x104f08,_0x72b4('0xf'));logger[_0x72b4('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x104f08,_0x72b4('0xf'),JSON[_0x72b4('0x11')](_0x114a98));if(_0x114a98[_0x72b4('0x12')]){if(_0x114a98[_0x72b4('0x12')][_0x72b4('0x13')]===0x1f4){logger[_0x72b4('0x12')](_0x72b4('0xe'),_0x104f08,_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);return _0x1bdf7f(_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);}logger['error'](_0x72b4('0xe'),_0x104f08,_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);return _0xb1e42f(_0x114a98[_0x72b4('0x12')]['message']);}else{logger['info'](_0x72b4('0xe'),_0x104f08,'request\x20sent');_0xb1e42f(_0x114a98[_0x72b4('0x15')][_0x72b4('0x14')]);}})['catch'](function(_0x2a9c37){logger[_0x72b4('0x12')](_0x72b4('0xe'),_0x104f08,_0x2a9c37);_0x1bdf7f(_0x2a9c37);});});}
\ No newline at end of file
+var _0x6d0c=['../../config/environment','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1f2308,_0x38dec9){var _0x45fbfe=function(_0x3eef51){while(--_0x3eef51){_0x1f2308['push'](_0x1f2308['shift']());}};_0x45fbfe(++_0x38dec9);}(_0x6d0c,0x8c));var _0xc6d0=function(_0x2127fe,_0x5b8eae){_0x2127fe=_0x2127fe-0x0;var _0x57b2e8=_0x6d0c[_0x2127fe];return _0x57b2e8;};'use strict';var _=require(_0xc6d0('0x0'));var util=require(_0xc6d0('0x1'));var moment=require(_0xc6d0('0x2'));var BPromise=require(_0xc6d0('0x3'));var rs=require(_0xc6d0('0x4'));var fs=require('fs');var Redis=require(_0xc6d0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc6d0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc6d0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc6d0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40ba33,_0xf1bb4f,_0x39e8be){return new BPromise(function(_0xbd2213,_0x1cf577){return client[_0xc6d0('0x9')](_0x40ba33,_0x39e8be)[_0xc6d0('0xa')](function(_0x1452b5){logger[_0xc6d0('0xb')](_0xc6d0('0xc'),_0xf1bb4f,_0xc6d0('0xd'));logger[_0xc6d0('0xe')](_0xc6d0('0xf'),_0xf1bb4f,_0xc6d0('0xd'),JSON[_0xc6d0('0x10')](_0x1452b5));if(_0x1452b5[_0xc6d0('0x11')]){if(_0x1452b5[_0xc6d0('0x11')][_0xc6d0('0x12')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0xf1bb4f,_0x1452b5[_0xc6d0('0x11')][_0xc6d0('0x13')]);return _0x1cf577(_0x1452b5['error'][_0xc6d0('0x13')]);}logger[_0xc6d0('0x11')](_0xc6d0('0xc'),_0xf1bb4f,_0x1452b5['error']['message']);return _0xbd2213(_0x1452b5[_0xc6d0('0x11')][_0xc6d0('0x13')]);}else{logger[_0xc6d0('0xb')]('CloudProvider,\x20%s,\x20%s',_0xf1bb4f,_0xc6d0('0xd'));_0xbd2213(_0x1452b5['result'][_0xc6d0('0x13')]);}})[_0xc6d0('0x14')](function(_0x34ea2f){logger[_0xc6d0('0x11')](_0xc6d0('0xc'),_0xf1bb4f,_0x34ea2f);_0x1cf577(_0x34ea2f);});});}
\ No newline at end of file
index 2455913..f0c928e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6348=['show','post','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','get','/:id'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x6348,0x1f3));var _0x8634=function(_0x24f5ad,_0x31ef05){_0x24f5ad=_0x24f5ad-0x0;var _0x455039=_0x6348[_0x24f5ad];return _0x455039;};'use strict';var multer=require('multer');var util=require(_0x8634('0x0'));var path=require(_0x8634('0x1'));var timeout=require(_0x8634('0x2'));var express=require('express');var router=express[_0x8634('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8634('0x4'));var interaction=require(_0x8634('0x5'));var config=require(_0x8634('0x6'));var controller=require(_0x8634('0x7'));router['get']('/',auth[_0x8634('0x8')](),controller['index']);router[_0x8634('0x9')](_0x8634('0xa'),auth['isAuthenticated'](),controller[_0x8634('0xb')]);router[_0x8634('0xc')]('/',auth[_0x8634('0x8')](),controller['create']);router['put'](_0x8634('0xa'),auth[_0x8634('0x8')](),controller['update']);router[_0x8634('0xd')](_0x8634('0xa'),auth[_0x8634('0x8')](),controller['destroy']);module[_0x8634('0xe')]=router;
\ No newline at end of file
+var _0x6ee9=['create','put','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0xd2cb45,_0x46892d){var _0x429082=function(_0x375404){while(--_0x375404){_0xd2cb45['push'](_0xd2cb45['shift']());}};_0x429082(++_0x46892d);}(_0x6ee9,0x9c));var _0x96ee=function(_0x178fd1,_0x47fabd){_0x178fd1=_0x178fd1-0x0;var _0x2c1ac2=_0x6ee9[_0x178fd1];return _0x2c1ac2;};'use strict';var multer=require('multer');var util=require(_0x96ee('0x0'));var path=require(_0x96ee('0x1'));var timeout=require('connect-timeout');var express=require(_0x96ee('0x2'));var router=express[_0x96ee('0x3')]();var fs_extra=require(_0x96ee('0x4'));var auth=require(_0x96ee('0x5'));var interaction=require(_0x96ee('0x6'));var config=require(_0x96ee('0x7'));var controller=require(_0x96ee('0x8'));router[_0x96ee('0x9')]('/',auth[_0x96ee('0xa')](),controller[_0x96ee('0xb')]);router[_0x96ee('0x9')](_0x96ee('0xc'),auth[_0x96ee('0xa')](),controller[_0x96ee('0xd')]);router[_0x96ee('0xe')]('/',auth[_0x96ee('0xa')](),controller[_0x96ee('0xf')]);router[_0x96ee('0x10')](_0x96ee('0xc'),auth[_0x96ee('0xa')](),controller['update']);router['delete'](_0x96ee('0xc'),auth[_0x96ee('0xa')](),controller[_0x96ee('0x11')]);module[_0x96ee('0x12')]=router;
\ No newline at end of file
index 747351a..65d7579 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x494a=['sequelize','exports','STRING','name'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0x494a,0x17c));var _0xa494=function(_0x19587b,_0x324fad){_0x19587b=_0x19587b-0x0;var _0x3aebb3=_0x494a[_0x19587b];return _0x3aebb3;};'use strict';var Sequelize=require(_0xa494('0x0'));module[_0xa494('0x1')]={'name':{'type':Sequelize[_0xa494('0x2')],'unique':_0xa494('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa494('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa494('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa494('0x2')]},'street':{'type':Sequelize[_0xa494('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa494('0x2')]},'country':{'type':Sequelize[_0xa494('0x2')]},'email':{'type':Sequelize[_0xa494('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa494('0x2')]},'sStreet':{'type':Sequelize[_0xa494('0x2')]},'sPostalCode':{'type':Sequelize[_0xa494('0x2')]},'sCity':{'type':Sequelize[_0xa494('0x2')]},'sCountry':{'type':Sequelize[_0xa494('0x2')]},'description':{'type':Sequelize[_0xa494('0x2')]}};
\ No newline at end of file
+var _0x7662=['sequelize','exports','STRING'];(function(_0x1f7f84,_0x45cd8d){var _0x2f889c=function(_0x639e4b){while(--_0x639e4b){_0x1f7f84['push'](_0x1f7f84['shift']());}};_0x2f889c(++_0x45cd8d);}(_0x7662,0xd2));var _0x2766=function(_0x599e92,_0xc4135c){_0x599e92=_0x599e92-0x0;var _0xe61a16=_0x7662[_0x599e92];return _0xe61a16;};'use strict';var Sequelize=require(_0x2766('0x0'));module[_0x2766('0x1')]={'name':{'type':Sequelize[_0x2766('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2766('0x2')]},'companyId':{'type':Sequelize[_0x2766('0x2')]},'website':{'type':Sequelize[_0x2766('0x2')]},'phone':{'type':Sequelize[_0x2766('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2766('0x2')]},'street':{'type':Sequelize[_0x2766('0x2')]},'postalCode':{'type':Sequelize[_0x2766('0x2')]},'city':{'type':Sequelize[_0x2766('0x2')]},'country':{'type':Sequelize[_0x2766('0x2')]},'email':{'type':Sequelize[_0x2766('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2766('0x2')]},'sStreet':{'type':Sequelize[_0x2766('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x2766('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index da7607e..72dccb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7437=['end','sendStatus','error','stack','name','index','describe','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','CmCompany','includeAll','include','findAll','rows','catch','show','rawAttributes','length','options','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','omit','ids','getContacts','findOne','CmContact','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Companies'];(function(_0x3cc57e,_0x29cd65){var _0x264316=function(_0x12992b){while(--_0x12992b){_0x3cc57e['push'](_0x3cc57e['shift']());}};_0x264316(++_0x29cd65);}(_0x7437,0xe6));var _0x7743=function(_0x3d0ab3,_0x2e1926){_0x3d0ab3=_0x3d0ab3-0x0;var _0x17fd2c=_0x7437[_0x3d0ab3];return _0x17fd2c;};'use strict';var emlformat=require(_0x7743('0x0'));var rimraf=require(_0x7743('0x1'));var zipdir=require(_0x7743('0x2'));var jsonpatch=require(_0x7743('0x3'));var rp=require(_0x7743('0x4'));var moment=require(_0x7743('0x5'));var BPromise=require(_0x7743('0x6'));var Mustache=require(_0x7743('0x7'));var util=require(_0x7743('0x8'));var path=require('path');var sox=require(_0x7743('0x9'));var csv=require(_0x7743('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7743('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7743('0xc'));var jsforce=require(_0x7743('0xd'));var deskjs=require(_0x7743('0xe'));var toCsv=require(_0x7743('0xa'));var querystring=require(_0x7743('0xf'));var Papa=require(_0x7743('0x10'));var Redis=require(_0x7743('0x11'));var authService=require(_0x7743('0x12'));var qs=require(_0x7743('0x13'));var as=require(_0x7743('0x14'));var hardwareService=require(_0x7743('0x15'));var logger=require(_0x7743('0x16'))(_0x7743('0x17'));var utils=require(_0x7743('0x18'));var config=require(_0x7743('0x19'));var licenseUtil=require(_0x7743('0x1a'));var db=require(_0x7743('0x1b'))['db'];function respondWithStatusCode(_0x2a1398,_0x58f989){_0x58f989=_0x58f989||0xcc;return function(_0x374c8e){if(_0x374c8e){return _0x2a1398['sendStatus'](_0x58f989);}return _0x2a1398[_0x7743('0x1c')](_0x58f989)['end']();};}function respondWithResult(_0x24ae63,_0x3a7cb7){_0x3a7cb7=_0x3a7cb7||0xc8;return function(_0x2a9bb6){if(_0x2a9bb6){return _0x24ae63[_0x7743('0x1c')](_0x3a7cb7)[_0x7743('0x1d')](_0x2a9bb6);}};}function respondWithFilteredResult(_0x5eb20e,_0x5c6744){return function(_0x471fe4){if(_0x471fe4){var _0x102f17=typeof _0x5c6744['offset']==='undefined'&&typeof _0x5c6744[_0x7743('0x1e')]===_0x7743('0x1f');var _0x1c7f26=_0x471fe4[_0x7743('0x20')];var _0x3f2702=_0x102f17?0x0:_0x5c6744[_0x7743('0x21')];var _0x4d0db2=_0x102f17?_0x471fe4[_0x7743('0x20')]:_0x5c6744['offset']+_0x5c6744['limit'];var _0x52f153;if(_0x4d0db2>=_0x1c7f26){_0x4d0db2=_0x1c7f26;_0x52f153=0xc8;}else{_0x52f153=0xce;}_0x5eb20e['status'](_0x52f153);return _0x5eb20e[_0x7743('0x22')]('Content-Range',_0x3f2702+'-'+_0x4d0db2+'/'+_0x1c7f26)['json'](_0x471fe4);}return null;};}function patchUpdates(_0x572485){return function(_0x16f155){try{jsonpatch[_0x7743('0x23')](_0x16f155,_0x572485,!![]);}catch(_0x3a20c3){return BPromise[_0x7743('0x24')](_0x3a20c3);}return _0x16f155[_0x7743('0x25')]();};}function saveUpdates(_0x1b6106,_0x455c9e){return function(_0x16f259){if(_0x16f259){return _0x16f259[_0x7743('0x26')](_0x1b6106)[_0x7743('0x27')](function(_0x22319d){return _0x22319d;});}return null;};}function removeEntity(_0x1272a2,_0x2a879a){return function(_0x46b67d){if(_0x46b67d){return _0x46b67d[_0x7743('0x28')]()[_0x7743('0x27')](function(){var _0x5ba375=_0x46b67d[_0x7743('0x29')]({'plain':!![]});var _0x28125d=_0x7743('0x2a');return db['UserProfileResource'][_0x7743('0x28')]({'where':{'type':_0x28125d,'resourceId':_0x5ba375['id']}})['then'](function(){return _0x46b67d;});})[_0x7743('0x27')](function(){_0x1272a2[_0x7743('0x1c')](0xcc)[_0x7743('0x2b')]();});}};}function handleEntityNotFound(_0x57ba34,_0xc634d8){return function(_0x48238d){if(!_0x48238d){_0x57ba34[_0x7743('0x2c')](0x194);}return _0x48238d;};}function handleError(_0x29eeb0,_0x30e386){_0x30e386=_0x30e386||0x1f4;return function(_0x1aac64){logger[_0x7743('0x2d')](_0x1aac64[_0x7743('0x2e')]);if(_0x1aac64['name']){delete _0x1aac64[_0x7743('0x2f')];}_0x29eeb0['status'](_0x30e386)['send'](_0x1aac64);};}exports[_0x7743('0x30')]=function(_0x49abc7,_0x1bbf54){var _0x1902da={},_0x5b7f14={},_0x27d7e6={'count':0x0,'rows':[]};return db['CmCompany'][_0x7743('0x31')]()[_0x7743('0x27')](function(_0x1a2ae0){_0x5b7f14[_0x7743('0x32')]=_[_0x7743('0x33')](_0x1a2ae0);_0x5b7f14['query']=_[_0x7743('0x33')](_0x49abc7[_0x7743('0x34')]);_0x5b7f14['filters']=_[_0x7743('0x35')](_0x5b7f14[_0x7743('0x32')],_0x5b7f14[_0x7743('0x34')]);_0x1902da[_0x7743('0x36')]=_['intersection'](_0x5b7f14[_0x7743('0x32')],qs[_0x7743('0x37')](_0x49abc7[_0x7743('0x34')]['fields']));_0x1902da[_0x7743('0x36')]=_0x1902da['attributes']['length']?_0x1902da[_0x7743('0x36')]:_0x5b7f14[_0x7743('0x32')];if(!_0x49abc7['query'][_0x7743('0x38')](_0x7743('0x39'))){_0x1902da[_0x7743('0x1e')]=qs[_0x7743('0x1e')](_0x49abc7[_0x7743('0x34')][_0x7743('0x1e')]);_0x1902da['offset']=qs[_0x7743('0x21')](_0x49abc7['query']['offset']);}_0x1902da[_0x7743('0x3a')]=qs[_0x7743('0x3b')](_0x49abc7[_0x7743('0x34')][_0x7743('0x3b')]);_0x1902da[_0x7743('0x3c')]=qs[_0x7743('0x3d')](_['pick'](_0x49abc7[_0x7743('0x34')],_0x5b7f14[_0x7743('0x3d')]),_0x1a2ae0);if(_0x49abc7[_0x7743('0x34')][_0x7743('0x3e')]){_0x1902da[_0x7743('0x3c')]=_[_0x7743('0x3f')](_0x1902da['where'],{'$or':_[_0x7743('0x40')](_0x1902da[_0x7743('0x36')],function(_0x106a2c){var _0xfa9c80={};_0xfa9c80[_0x106a2c]={'$like':'%'+_0x49abc7[_0x7743('0x34')][_0x7743('0x3e')]+'%'};return _0xfa9c80;})});}_0x1902da=_[_0x7743('0x3f')]({},_0x1902da,_0x49abc7['options']);var _0x37b6b8={'where':_0x1902da[_0x7743('0x3c')]};return db[_0x7743('0x41')][_0x7743('0x20')](_0x37b6b8)[_0x7743('0x27')](function(_0x5a7d7e){_0x27d7e6[_0x7743('0x20')]=_0x5a7d7e;if(_0x49abc7[_0x7743('0x34')][_0x7743('0x42')]){_0x1902da[_0x7743('0x43')]=[{'all':!![]}];}return db[_0x7743('0x41')][_0x7743('0x44')](_0x1902da);})[_0x7743('0x27')](function(_0x1a42c6){_0x27d7e6[_0x7743('0x45')]=_0x1a42c6;return _0x27d7e6;})[_0x7743('0x27')](respondWithFilteredResult(_0x1bbf54,_0x1902da))[_0x7743('0x46')](handleError(_0x1bbf54,null));})[_0x7743('0x46')](handleError(_0x1bbf54,null));};exports[_0x7743('0x47')]=function(_0x86ccaa,_0x47b171){var _0x145124={'raw':![],'where':{'id':_0x86ccaa['params']['id']}},_0x29dd36={};_0x29dd36[_0x7743('0x32')]=_[_0x7743('0x33')](db[_0x7743('0x41')][_0x7743('0x48')]);_0x29dd36[_0x7743('0x34')]=_[_0x7743('0x33')](_0x86ccaa[_0x7743('0x34')]);_0x29dd36[_0x7743('0x3d')]=_[_0x7743('0x35')](_0x29dd36[_0x7743('0x32')],_0x29dd36['query']);_0x145124[_0x7743('0x36')]=_[_0x7743('0x35')](_0x29dd36['model'],qs[_0x7743('0x37')](_0x86ccaa[_0x7743('0x34')][_0x7743('0x37')]));_0x145124['attributes']=_0x145124[_0x7743('0x36')][_0x7743('0x49')]?_0x145124[_0x7743('0x36')]:_0x29dd36[_0x7743('0x32')];if(_0x86ccaa[_0x7743('0x34')][_0x7743('0x42')]){_0x145124[_0x7743('0x43')]=[{'all':!![]}];}_0x145124=_[_0x7743('0x3f')]({},_0x145124,_0x86ccaa[_0x7743('0x4a')]);return db['CmCompany']['find'](_0x145124)[_0x7743('0x27')](handleEntityNotFound(_0x47b171,null))[_0x7743('0x27')](respondWithResult(_0x47b171,null))['catch'](handleError(_0x47b171,null));};exports[_0x7743('0x4b')]=function(_0x5cd6f4,_0x59cab8){return db[_0x7743('0x41')][_0x7743('0x4b')](_0x5cd6f4[_0x7743('0x4c')],{})[_0x7743('0x27')](function(_0x243cc4){var _0x536e50=_0x5cd6f4[_0x7743('0x4d')][_0x7743('0x29')]({'plain':!![]});if(!_0x536e50)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x536e50['role']===_0x7743('0x4d')){var _0x59fd91=_0x243cc4['get']({'plain':!![]});var _0x42ecbd=_0x7743('0x2a');return db[_0x7743('0x4e')][_0x7743('0x4f')]({'where':{'name':_0x42ecbd,'userProfileId':_0x536e50[_0x7743('0x50')]},'raw':!![]})[_0x7743('0x27')](function(_0x570a4c){if(_0x570a4c&&_0x570a4c[_0x7743('0x51')]===0x0){return db[_0x7743('0x52')]['create']({'name':_0x59fd91['name'],'resourceId':_0x59fd91['id'],'type':_0x570a4c[_0x7743('0x2f')],'sectionId':_0x570a4c['id']},{})[_0x7743('0x27')](function(){return _0x243cc4;});}else{return _0x243cc4;}})[_0x7743('0x46')](function(_0x5bdfe8){logger[_0x7743('0x2d')](_0x7743('0x53'),_0x5bdfe8);throw _0x5bdfe8;});}return _0x243cc4;})[_0x7743('0x27')](respondWithResult(_0x59cab8,0xc9))[_0x7743('0x46')](handleError(_0x59cab8,null));};exports[_0x7743('0x26')]=function(_0x215528,_0x37223d){if(_0x215528[_0x7743('0x4c')]['id']){delete _0x215528['body']['id'];}return db[_0x7743('0x41')][_0x7743('0x4f')]({'where':{'id':_0x215528[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x37223d,null))[_0x7743('0x27')](saveUpdates(_0x215528[_0x7743('0x4c')],null))[_0x7743('0x27')](respondWithResult(_0x37223d,null))[_0x7743('0x46')](handleError(_0x37223d,null));};exports['destroy']=function(_0xd47076,_0x6f93c3){return db[_0x7743('0x41')]['find']({'where':{'id':_0xd47076[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x6f93c3,null))[_0x7743('0x27')](removeEntity(_0x6f93c3,null))['catch'](handleError(_0x6f93c3,null));};exports[_0x7743('0x31')]=function(_0x14bbe7,_0xcc25bc){return db['CmCompany'][_0x7743('0x31')]()[_0x7743('0x27')](respondWithResult(_0xcc25bc,null))['catch'](handleError(_0xcc25bc,null));};exports[_0x7743('0x55')]=function(_0x27ea3f,_0x39c517,_0x909544){return db['CmContact'][_0x7743('0x4f')]({'where':{'id':_0x27ea3f[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x39c517,null))[_0x7743('0x27')](function(_0x406891){if(_0x406891){return _0x406891[_0x7743('0x55')](_0x27ea3f[_0x7743('0x4c')]['ids'],_[_0x7743('0x56')](_0x27ea3f[_0x7743('0x4c')],[_0x7743('0x57'),'id'])||{});}})[_0x7743('0x27')](respondWithResult(_0x39c517,null))[_0x7743('0x46')](handleError(_0x39c517,null));};exports[_0x7743('0x58')]=function(_0x408345,_0x94466b,_0x351046){var _0x46a8e3={};var _0x5c11af={};var _0x30e8ac;var _0x4c31f7;return db[_0x7743('0x41')][_0x7743('0x59')]({'where':{'id':_0x408345[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x94466b,null))['then'](function(_0x225121){if(_0x225121){_0x30e8ac=_0x225121;_0x5c11af['model']=_[_0x7743('0x33')](db[_0x7743('0x5a')][_0x7743('0x48')]);_0x5c11af[_0x7743('0x34')]=_[_0x7743('0x33')](_0x408345[_0x7743('0x34')]);_0x5c11af['filters']=_[_0x7743('0x35')](_0x5c11af[_0x7743('0x32')],_0x5c11af[_0x7743('0x34')]);_0x46a8e3[_0x7743('0x36')]=_[_0x7743('0x35')](_0x5c11af['model'],qs['fields'](_0x408345[_0x7743('0x34')][_0x7743('0x37')]));_0x46a8e3[_0x7743('0x36')]=_0x46a8e3['attributes'][_0x7743('0x49')]?_0x46a8e3['attributes']:_0x5c11af[_0x7743('0x32')];_0x46a8e3[_0x7743('0x3a')]=qs['sort'](_0x408345['query'][_0x7743('0x3b')]);_0x46a8e3[_0x7743('0x3c')]=qs[_0x7743('0x3d')](_['pick'](_0x408345[_0x7743('0x34')],_0x5c11af[_0x7743('0x3d')]));if(_0x408345[_0x7743('0x34')][_0x7743('0x3e')]){_0x46a8e3[_0x7743('0x3c')]=_[_0x7743('0x3f')](_0x46a8e3[_0x7743('0x3c')],{'$or':_[_0x7743('0x40')](_0x46a8e3['attributes'],function(_0x34066a){var _0x219074={};_0x219074[_0x34066a]={'$like':'%'+_0x408345[_0x7743('0x34')]['filter']+'%'};return _0x219074;})});}_0x46a8e3=_[_0x7743('0x3f')]({},_0x46a8e3,_0x408345[_0x7743('0x4a')]);return _0x30e8ac[_0x7743('0x58')](_0x46a8e3);}})[_0x7743('0x27')](function(_0x57a4d5){if(_0x57a4d5){_0x4c31f7=_0x57a4d5[_0x7743('0x49')];if(!_0x408345[_0x7743('0x34')][_0x7743('0x38')](_0x7743('0x39'))){_0x46a8e3['limit']=qs[_0x7743('0x1e')](_0x408345[_0x7743('0x34')][_0x7743('0x1e')]);_0x46a8e3[_0x7743('0x21')]=qs[_0x7743('0x21')](_0x408345[_0x7743('0x34')][_0x7743('0x21')]);}return _0x30e8ac[_0x7743('0x58')](_0x46a8e3);}})['then'](function(_0x3cf4e8){if(_0x3cf4e8){return _0x3cf4e8?{'count':_0x4c31f7,'rows':_0x3cf4e8}:null;}})['then'](respondWithResult(_0x94466b,null))[_0x7743('0x46')](handleError(_0x94466b,null));};
\ No newline at end of file
+var _0x3e18=['index','keys','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','merge','map','options','CmCompany','include','catch','show','params','rawAttributes','create','body','user','Companies','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','omit','ids','length','pick','filter','getContacts','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','get','destroy','stack','name','send'];(function(_0x28aeb2,_0x319b38){var _0x1d33e1=function(_0x651b59){while(--_0x651b59){_0x28aeb2['push'](_0x28aeb2['shift']());}};_0x1d33e1(++_0x319b38);}(_0x3e18,0x1d2));var _0x83e1=function(_0x2faa17,_0x2b3f70){_0x2faa17=_0x2faa17-0x0;var _0x2735c4=_0x3e18[_0x2faa17];return _0x2735c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x83e1('0x0'));var zipdir=require(_0x83e1('0x1'));var jsonpatch=require(_0x83e1('0x2'));var rp=require('request-promise');var moment=require(_0x83e1('0x3'));var BPromise=require(_0x83e1('0x4'));var Mustache=require('mustache');var util=require(_0x83e1('0x5'));var path=require('path');var sox=require(_0x83e1('0x6'));var csv=require(_0x83e1('0x7'));var ejs=require(_0x83e1('0x8'));var fs=require('fs');var fs_extra=require(_0x83e1('0x9'));var _=require(_0x83e1('0xa'));var squel=require(_0x83e1('0xb'));var crypto=require(_0x83e1('0xc'));var jsforce=require(_0x83e1('0xd'));var deskjs=require(_0x83e1('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x83e1('0xf'));var Redis=require(_0x83e1('0x10'));var authService=require(_0x83e1('0x11'));var qs=require(_0x83e1('0x12'));var as=require(_0x83e1('0x13'));var hardwareService=require(_0x83e1('0x14'));var logger=require(_0x83e1('0x15'))(_0x83e1('0x16'));var utils=require(_0x83e1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x83e1('0x18'));var db=require(_0x83e1('0x19'))['db'];function respondWithStatusCode(_0x41194e,_0x32f888){_0x32f888=_0x32f888||0xcc;return function(_0x5060d9){if(_0x5060d9){return _0x41194e[_0x83e1('0x1a')](_0x32f888);}return _0x41194e[_0x83e1('0x1b')](_0x32f888)[_0x83e1('0x1c')]();};}function respondWithResult(_0x214a4f,_0x9b6941){_0x9b6941=_0x9b6941||0xc8;return function(_0x4365b2){if(_0x4365b2){return _0x214a4f[_0x83e1('0x1b')](_0x9b6941)[_0x83e1('0x1d')](_0x4365b2);}};}function respondWithFilteredResult(_0x91ea81,_0x30a02a){return function(_0x549edc){if(_0x549edc){var _0x292695=typeof _0x30a02a[_0x83e1('0x1e')]===_0x83e1('0x1f')&&typeof _0x30a02a[_0x83e1('0x20')]===_0x83e1('0x1f');var _0x38dd16=_0x549edc[_0x83e1('0x21')];var _0x2071da=_0x292695?0x0:_0x30a02a[_0x83e1('0x1e')];var _0x3c0446=_0x292695?_0x549edc[_0x83e1('0x21')]:_0x30a02a[_0x83e1('0x1e')]+_0x30a02a['limit'];var _0x5f570f;if(_0x3c0446>=_0x38dd16){_0x3c0446=_0x38dd16;_0x5f570f=0xc8;}else{_0x5f570f=0xce;}_0x91ea81[_0x83e1('0x1b')](_0x5f570f);return _0x91ea81['set']('Content-Range',_0x2071da+'-'+_0x3c0446+'/'+_0x38dd16)['json'](_0x549edc);}return null;};}function patchUpdates(_0x3b9f11){return function(_0x13a85c){try{jsonpatch[_0x83e1('0x22')](_0x13a85c,_0x3b9f11,!![]);}catch(_0x2f4f61){return BPromise[_0x83e1('0x23')](_0x2f4f61);}return _0x13a85c[_0x83e1('0x24')]();};}function saveUpdates(_0x61de2,_0x25fdee){return function(_0x1f7266){if(_0x1f7266){return _0x1f7266[_0x83e1('0x25')](_0x61de2)[_0x83e1('0x26')](function(_0x300a91){return _0x300a91;});}return null;};}function removeEntity(_0x2fdb2d,_0x4891b0){return function(_0x45c790){if(_0x45c790){return _0x45c790['destroy']()[_0x83e1('0x26')](function(){var _0x494b96=_0x45c790[_0x83e1('0x27')]({'plain':!![]});var _0x553b99='Companies';return db['UserProfileResource'][_0x83e1('0x28')]({'where':{'type':_0x553b99,'resourceId':_0x494b96['id']}})[_0x83e1('0x26')](function(){return _0x45c790;});})[_0x83e1('0x26')](function(){_0x2fdb2d[_0x83e1('0x1b')](0xcc)[_0x83e1('0x1c')]();});}};}function handleEntityNotFound(_0x598770,_0x247e24){return function(_0x3ecf35){if(!_0x3ecf35){_0x598770[_0x83e1('0x1a')](0x194);}return _0x3ecf35;};}function handleError(_0x51ffb0,_0x4f99a6){_0x4f99a6=_0x4f99a6||0x1f4;return function(_0x10a704){logger['error'](_0x10a704[_0x83e1('0x29')]);if(_0x10a704[_0x83e1('0x2a')]){delete _0x10a704[_0x83e1('0x2a')];}_0x51ffb0[_0x83e1('0x1b')](_0x4f99a6)[_0x83e1('0x2b')](_0x10a704);};}exports[_0x83e1('0x2c')]=function(_0x5219dc,_0x201b32){var _0x26a858={},_0x2ca447={},_0x338670={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x83e1('0x26')](function(_0x1e8893){_0x2ca447['model']=_[_0x83e1('0x2d')](_0x1e8893);_0x2ca447['query']=_[_0x83e1('0x2d')](_0x5219dc[_0x83e1('0x2e')]);_0x2ca447[_0x83e1('0x2f')]=_['intersection'](_0x2ca447['model'],_0x2ca447[_0x83e1('0x2e')]);_0x26a858[_0x83e1('0x30')]=_[_0x83e1('0x31')](_0x2ca447[_0x83e1('0x32')],qs['fields'](_0x5219dc[_0x83e1('0x2e')][_0x83e1('0x33')]));_0x26a858[_0x83e1('0x30')]=_0x26a858[_0x83e1('0x30')]['length']?_0x26a858[_0x83e1('0x30')]:_0x2ca447[_0x83e1('0x32')];if(!_0x5219dc[_0x83e1('0x2e')][_0x83e1('0x34')](_0x83e1('0x35'))){_0x26a858[_0x83e1('0x20')]=qs['limit'](_0x5219dc[_0x83e1('0x2e')][_0x83e1('0x20')]);_0x26a858[_0x83e1('0x1e')]=qs[_0x83e1('0x1e')](_0x5219dc[_0x83e1('0x2e')][_0x83e1('0x1e')]);}_0x26a858[_0x83e1('0x36')]=qs['sort'](_0x5219dc[_0x83e1('0x2e')][_0x83e1('0x37')]);_0x26a858[_0x83e1('0x38')]=qs[_0x83e1('0x2f')](_['pick'](_0x5219dc['query'],_0x2ca447[_0x83e1('0x2f')]),_0x1e8893);if(_0x5219dc['query']['filter']){_0x26a858[_0x83e1('0x38')]=_[_0x83e1('0x39')](_0x26a858[_0x83e1('0x38')],{'$or':_[_0x83e1('0x3a')](_0x26a858['attributes'],function(_0x5ea8b0){var _0x4967ac={};_0x4967ac[_0x5ea8b0]={'$like':'%'+_0x5219dc['query']['filter']+'%'};return _0x4967ac;})});}_0x26a858=_[_0x83e1('0x39')]({},_0x26a858,_0x5219dc[_0x83e1('0x3b')]);var _0x3a323c={'where':_0x26a858[_0x83e1('0x38')]};return db[_0x83e1('0x3c')][_0x83e1('0x21')](_0x3a323c)[_0x83e1('0x26')](function(_0x18b894){_0x338670[_0x83e1('0x21')]=_0x18b894;if(_0x5219dc['query']['includeAll']){_0x26a858[_0x83e1('0x3d')]=[{'all':!![]}];}return db[_0x83e1('0x3c')]['findAll'](_0x26a858);})[_0x83e1('0x26')](function(_0xe90011){_0x338670['rows']=_0xe90011;return _0x338670;})[_0x83e1('0x26')](respondWithFilteredResult(_0x201b32,_0x26a858))['catch'](handleError(_0x201b32,null));})[_0x83e1('0x3e')](handleError(_0x201b32,null));};exports[_0x83e1('0x3f')]=function(_0x5958b0,_0x36fae6){var _0x2bea0e={'raw':![],'where':{'id':_0x5958b0[_0x83e1('0x40')]['id']}},_0x1fa023={};_0x1fa023[_0x83e1('0x32')]=_[_0x83e1('0x2d')](db[_0x83e1('0x3c')][_0x83e1('0x41')]);_0x1fa023['query']=_[_0x83e1('0x2d')](_0x5958b0[_0x83e1('0x2e')]);_0x1fa023[_0x83e1('0x2f')]=_[_0x83e1('0x31')](_0x1fa023[_0x83e1('0x32')],_0x1fa023[_0x83e1('0x2e')]);_0x2bea0e[_0x83e1('0x30')]=_[_0x83e1('0x31')](_0x1fa023[_0x83e1('0x32')],qs[_0x83e1('0x33')](_0x5958b0['query']['fields']));_0x2bea0e[_0x83e1('0x30')]=_0x2bea0e['attributes']['length']?_0x2bea0e[_0x83e1('0x30')]:_0x1fa023[_0x83e1('0x32')];if(_0x5958b0[_0x83e1('0x2e')]['includeAll']){_0x2bea0e[_0x83e1('0x3d')]=[{'all':!![]}];}_0x2bea0e=_[_0x83e1('0x39')]({},_0x2bea0e,_0x5958b0[_0x83e1('0x3b')]);return db['CmCompany']['find'](_0x2bea0e)[_0x83e1('0x26')](handleEntityNotFound(_0x36fae6,null))['then'](respondWithResult(_0x36fae6,null))['catch'](handleError(_0x36fae6,null));};exports[_0x83e1('0x42')]=function(_0x1e5916,_0x5b3af4){return db[_0x83e1('0x3c')][_0x83e1('0x42')](_0x1e5916[_0x83e1('0x43')],{})[_0x83e1('0x26')](function(_0x2f9e81){var _0x37a9d9=_0x1e5916[_0x83e1('0x44')][_0x83e1('0x27')]({'plain':!![]});if(!_0x37a9d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37a9d9['role']===_0x83e1('0x44')){var _0x36030b=_0x2f9e81['get']({'plain':!![]});var _0x222bb6=_0x83e1('0x45');return db[_0x83e1('0x46')][_0x83e1('0x47')]({'where':{'name':_0x222bb6,'userProfileId':_0x37a9d9[_0x83e1('0x48')]},'raw':!![]})['then'](function(_0x26c80c){if(_0x26c80c&&_0x26c80c[_0x83e1('0x49')]===0x0){return db[_0x83e1('0x4a')][_0x83e1('0x42')]({'name':_0x36030b['name'],'resourceId':_0x36030b['id'],'type':_0x26c80c[_0x83e1('0x2a')],'sectionId':_0x26c80c['id']},{})[_0x83e1('0x26')](function(){return _0x2f9e81;});}else{return _0x2f9e81;}})[_0x83e1('0x3e')](function(_0x40edbb){logger['error'](_0x83e1('0x4b'),_0x40edbb);throw _0x40edbb;});}return _0x2f9e81;})[_0x83e1('0x26')](respondWithResult(_0x5b3af4,0xc9))[_0x83e1('0x3e')](handleError(_0x5b3af4,null));};exports['update']=function(_0x10afff,_0x112c2a){if(_0x10afff['body']['id']){delete _0x10afff[_0x83e1('0x43')]['id'];}return db[_0x83e1('0x3c')][_0x83e1('0x47')]({'where':{'id':_0x10afff['params']['id']}})['then'](handleEntityNotFound(_0x112c2a,null))[_0x83e1('0x26')](saveUpdates(_0x10afff['body'],null))[_0x83e1('0x26')](respondWithResult(_0x112c2a,null))[_0x83e1('0x3e')](handleError(_0x112c2a,null));};exports[_0x83e1('0x28')]=function(_0x5ae890,_0x30fc68){return db['CmCompany'][_0x83e1('0x47')]({'where':{'id':_0x5ae890['params']['id']}})[_0x83e1('0x26')](handleEntityNotFound(_0x30fc68,null))['then'](removeEntity(_0x30fc68,null))[_0x83e1('0x3e')](handleError(_0x30fc68,null));};exports['describe']=function(_0x1bc74c,_0x2b8da5){return db[_0x83e1('0x3c')][_0x83e1('0x4c')]()['then'](respondWithResult(_0x2b8da5,null))[_0x83e1('0x3e')](handleError(_0x2b8da5,null));};exports[_0x83e1('0x4d')]=function(_0x229ccd,_0x5191b0,_0x27a2c9){return db[_0x83e1('0x4e')]['find']({'where':{'id':_0x229ccd['params']['id']}})[_0x83e1('0x26')](handleEntityNotFound(_0x5191b0,null))[_0x83e1('0x26')](function(_0x4bd404){if(_0x4bd404){return _0x4bd404[_0x83e1('0x4d')](_0x229ccd['body']['ids'],_[_0x83e1('0x4f')](_0x229ccd[_0x83e1('0x43')],[_0x83e1('0x50'),'id'])||{});}})['then'](respondWithResult(_0x5191b0,null))[_0x83e1('0x3e')](handleError(_0x5191b0,null));};exports['getContacts']=function(_0x53fc87,_0x5bd9af,_0x376e9b){var _0x38a7fc={};var _0x4c1e74={};var _0x2ba62c;var _0x3c0d26;return db[_0x83e1('0x3c')]['findOne']({'where':{'id':_0x53fc87['params']['id']}})[_0x83e1('0x26')](handleEntityNotFound(_0x5bd9af,null))[_0x83e1('0x26')](function(_0x314ced){if(_0x314ced){_0x2ba62c=_0x314ced;_0x4c1e74['model']=_[_0x83e1('0x2d')](db[_0x83e1('0x4e')][_0x83e1('0x41')]);_0x4c1e74['query']=_[_0x83e1('0x2d')](_0x53fc87['query']);_0x4c1e74[_0x83e1('0x2f')]=_[_0x83e1('0x31')](_0x4c1e74[_0x83e1('0x32')],_0x4c1e74['query']);_0x38a7fc[_0x83e1('0x30')]=_[_0x83e1('0x31')](_0x4c1e74[_0x83e1('0x32')],qs[_0x83e1('0x33')](_0x53fc87['query'][_0x83e1('0x33')]));_0x38a7fc[_0x83e1('0x30')]=_0x38a7fc[_0x83e1('0x30')][_0x83e1('0x51')]?_0x38a7fc[_0x83e1('0x30')]:_0x4c1e74[_0x83e1('0x32')];_0x38a7fc[_0x83e1('0x36')]=qs[_0x83e1('0x37')](_0x53fc87[_0x83e1('0x2e')]['sort']);_0x38a7fc[_0x83e1('0x38')]=qs[_0x83e1('0x2f')](_[_0x83e1('0x52')](_0x53fc87[_0x83e1('0x2e')],_0x4c1e74[_0x83e1('0x2f')]));if(_0x53fc87[_0x83e1('0x2e')][_0x83e1('0x53')]){_0x38a7fc[_0x83e1('0x38')]=_[_0x83e1('0x39')](_0x38a7fc[_0x83e1('0x38')],{'$or':_[_0x83e1('0x3a')](_0x38a7fc[_0x83e1('0x30')],function(_0x1ff972){var _0x3b3503={};_0x3b3503[_0x1ff972]={'$like':'%'+_0x53fc87[_0x83e1('0x2e')][_0x83e1('0x53')]+'%'};return _0x3b3503;})});}_0x38a7fc=_[_0x83e1('0x39')]({},_0x38a7fc,_0x53fc87[_0x83e1('0x3b')]);return _0x2ba62c[_0x83e1('0x54')](_0x38a7fc);}})[_0x83e1('0x26')](function(_0x5737cf){if(_0x5737cf){_0x3c0d26=_0x5737cf[_0x83e1('0x51')];if(!_0x53fc87[_0x83e1('0x2e')][_0x83e1('0x34')](_0x83e1('0x35'))){_0x38a7fc['limit']=qs[_0x83e1('0x20')](_0x53fc87[_0x83e1('0x2e')][_0x83e1('0x20')]);_0x38a7fc['offset']=qs[_0x83e1('0x1e')](_0x53fc87[_0x83e1('0x2e')][_0x83e1('0x1e')]);}return _0x2ba62c[_0x83e1('0x54')](_0x38a7fc);}})[_0x83e1('0x26')](function(_0x245416){if(_0x245416){return _0x245416?{'count':_0x3c0d26,'rows':_0x245416}:null;}})['then'](respondWithResult(_0x5bd9af,null))[_0x83e1('0x3e')](handleError(_0x5bd9af,null));};
\ No newline at end of file
index 55be2b1..8ae5731 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe420=['path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xe420,0xb0));var _0x0e42=function(_0xa272c4,_0x1cf585){_0xa272c4=_0xa272c4-0x0;var _0x555142=_0xe420[_0xa272c4];return _0x555142;};'use strict';var _=require(_0x0e42('0x0'));var util=require(_0x0e42('0x1'));var logger=require(_0x0e42('0x2'))(_0x0e42('0x3'));var moment=require(_0x0e42('0x4'));var BPromise=require('bluebird');var rp=require(_0x0e42('0x5'));var fs=require('fs');var path=require(_0x0e42('0x6'));var rimraf=require(_0x0e42('0x7'));var config=require(_0x0e42('0x8'));var attributes=require(_0x0e42('0x9'));module['exports']=function(_0x27b5f1,_0x33604f){return _0x27b5f1[_0x0e42('0xa')](_0x0e42('0xb'),attributes,{'tableName':_0x0e42('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x73f2=['./cmCompany.attributes','CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x73f2,0x116));var _0x273f=function(_0x12d8fb,_0x35487a){_0x12d8fb=_0x12d8fb-0x0;var _0x4b81dc=_0x73f2[_0x12d8fb];return _0x4b81dc;};'use strict';var _=require(_0x273f('0x0'));var util=require(_0x273f('0x1'));var logger=require(_0x273f('0x2'))(_0x273f('0x3'));var moment=require('moment');var BPromise=require(_0x273f('0x4'));var rp=require(_0x273f('0x5'));var fs=require('fs');var path=require(_0x273f('0x6'));var rimraf=require(_0x273f('0x7'));var config=require('../../config/environment');var attributes=require(_0x273f('0x8'));module['exports']=function(_0x4c6f65,_0x30bdf2){return _0x4c6f65['define'](_0x273f('0x9'),attributes,{'tableName':_0x273f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4af4b41..9e6c617 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b64=['request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1e5019,_0x516600){var _0x5bb93a=function(_0x4b4df4){while(--_0x4b4df4){_0x1e5019['push'](_0x1e5019['shift']());}};_0x5bb93a(++_0x516600);}(_0x5b64,0x66));var _0x45b6=function(_0x7cc4c4,_0x544d32){_0x7cc4c4=_0x7cc4c4-0x0;var _0x5d464b=_0x5b64[_0x7cc4c4];return _0x5d464b;};'use strict';var _=require(_0x45b6('0x0'));var util=require(_0x45b6('0x1'));var moment=require(_0x45b6('0x2'));var BPromise=require(_0x45b6('0x3'));var rs=require(_0x45b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45b6('0x5'))['db'];var utils=require(_0x45b6('0x6'));var logger=require(_0x45b6('0x7'))(_0x45b6('0x8'));var config=require(_0x45b6('0x9'));var jayson=require(_0x45b6('0xa'));var client=jayson[_0x45b6('0xb')][_0x45b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x272c8a,_0xf0ad47,_0x1d118a){return new BPromise(function(_0x239074,_0x536669){return client[_0x45b6('0xd')](_0x272c8a,_0x1d118a)['then'](function(_0x4891ff){logger[_0x45b6('0xe')]('CmCompany,\x20%s,\x20%s',_0xf0ad47,_0x45b6('0xf'));logger[_0x45b6('0x10')](_0x45b6('0x11'),_0xf0ad47,'request\x20sent',JSON[_0x45b6('0x12')](_0x4891ff));if(_0x4891ff[_0x45b6('0x13')]){if(_0x4891ff['error'][_0x45b6('0x14')]===0x1f4){logger[_0x45b6('0x13')](_0x45b6('0x15'),_0xf0ad47,_0x4891ff[_0x45b6('0x13')][_0x45b6('0x16')]);return _0x536669(_0x4891ff[_0x45b6('0x13')]['message']);}logger['error'](_0x45b6('0x15'),_0xf0ad47,_0x4891ff['error'][_0x45b6('0x16')]);return _0x239074(_0x4891ff[_0x45b6('0x13')]['message']);}else{logger[_0x45b6('0xe')](_0x45b6('0x15'),_0xf0ad47,'request\x20sent');_0x239074(_0x4891ff['result'][_0x45b6('0x16')]);}})['catch'](function(_0xebfc33){logger[_0x45b6('0x13')](_0x45b6('0x15'),_0xf0ad47,_0xebfc33);_0x536669(_0xebfc33);});});}
\ No newline at end of file
+var _0xceb4=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0xceb4,0x1a6));var _0x4ceb=function(_0x1605b0,_0x5c753c){_0x1605b0=_0x1605b0-0x0;var _0x1fcff5=_0xceb4[_0x1605b0];return _0x1fcff5;};'use strict';var _=require(_0x4ceb('0x0'));var util=require('util');var moment=require(_0x4ceb('0x1'));var BPromise=require(_0x4ceb('0x2'));var rs=require(_0x4ceb('0x3'));var fs=require('fs');var Redis=require(_0x4ceb('0x4'));var db=require(_0x4ceb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4ceb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4ceb('0x7'));var client=jayson[_0x4ceb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56b032,_0x297826,_0x2798b5){return new BPromise(function(_0x5cef93,_0x332c8a){return client[_0x4ceb('0x9')](_0x56b032,_0x2798b5)[_0x4ceb('0xa')](function(_0x103800){logger[_0x4ceb('0xb')](_0x4ceb('0xc'),_0x297826,_0x4ceb('0xd'));logger['debug'](_0x4ceb('0xe'),_0x297826,'request\x20sent',JSON[_0x4ceb('0xf')](_0x103800));if(_0x103800[_0x4ceb('0x10')]){if(_0x103800['error'][_0x4ceb('0x11')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x297826,_0x103800[_0x4ceb('0x10')]['message']);return _0x332c8a(_0x103800[_0x4ceb('0x10')][_0x4ceb('0x12')]);}logger[_0x4ceb('0x10')](_0x4ceb('0xc'),_0x297826,_0x103800[_0x4ceb('0x10')]['message']);return _0x5cef93(_0x103800[_0x4ceb('0x10')][_0x4ceb('0x12')]);}else{logger[_0x4ceb('0xb')]('CmCompany,\x20%s,\x20%s',_0x297826,'request\x20sent');_0x5cef93(_0x103800[_0x4ceb('0x13')][_0x4ceb('0x12')]);}})[_0x4ceb('0x14')](function(_0x4ffb7d){logger[_0x4ceb('0x10')](_0x4ceb('0xc'),_0x297826,_0x4ffb7d);_0x332c8a(_0x4ffb7d);});});}
\ No newline at end of file
index e8e522f..b5fbfcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d39=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','exports'];(function(_0x2f4c1c,_0x5a3dd4){var _0x25e0f2=function(_0x46ea31){while(--_0x46ea31){_0x2f4c1c['push'](_0x2f4c1c['shift']());}};_0x25e0f2(++_0x5a3dd4);}(_0x1d39,0x108));var _0x91d3=function(_0x10c4d6,_0x1cd56c){_0x10c4d6=_0x10c4d6-0x0;var _0x3a4a5f=_0x1d39[_0x10c4d6];return _0x3a4a5f;};'use strict';var multer=require(_0x91d3('0x0'));var util=require(_0x91d3('0x1'));var path=require(_0x91d3('0x2'));var timeout=require(_0x91d3('0x3'));var express=require(_0x91d3('0x4'));var router=express[_0x91d3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91d3('0x6'));var interaction=require(_0x91d3('0x7'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x91d3('0x8')]('/',auth[_0x91d3('0x9')](),controller[_0x91d3('0xa')]);router[_0x91d3('0x8')](_0x91d3('0xb'),auth[_0x91d3('0x9')](),controller[_0x91d3('0xc')]);router[_0x91d3('0x8')](_0x91d3('0xd'),auth['isAuthenticated'](),controller[_0x91d3('0xe')]);router['get'](_0x91d3('0xf'),auth[_0x91d3('0x9')](),controller[_0x91d3('0x10')]);router[_0x91d3('0x11')]('/',auth[_0x91d3('0x9')](),controller['create']);router[_0x91d3('0x11')](_0x91d3('0xf'),auth[_0x91d3('0x9')](),controller[_0x91d3('0x12')]);router[_0x91d3('0x13')](_0x91d3('0xd'),auth[_0x91d3('0x9')](),controller[_0x91d3('0x14')]);router[_0x91d3('0x15')](_0x91d3('0xd'),auth['isAuthenticated'](),controller[_0x91d3('0x16')]);module[_0x91d3('0x17')]=router;
\ No newline at end of file
+var _0x8481=['/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x8481,0xb0));var _0x1848=function(_0x1a72b8,_0x1e4f4b){_0x1a72b8=_0x1a72b8-0x0;var _0x39f72d=_0x8481[_0x1a72b8];return _0x39f72d;};'use strict';var multer=require('multer');var util=require(_0x1848('0x0'));var path=require(_0x1848('0x1'));var timeout=require(_0x1848('0x2'));var express=require(_0x1848('0x3'));var router=express[_0x1848('0x4')]();var fs_extra=require(_0x1848('0x5'));var auth=require(_0x1848('0x6'));var interaction=require(_0x1848('0x7'));var config=require(_0x1848('0x8'));var controller=require(_0x1848('0x9'));router[_0x1848('0xa')]('/',auth[_0x1848('0xb')](),controller[_0x1848('0xc')]);router['get']('/describe',auth[_0x1848('0xb')](),controller[_0x1848('0xd')]);router['get'](_0x1848('0xe'),auth[_0x1848('0xb')](),controller[_0x1848('0xf')]);router['get'](_0x1848('0x10'),auth[_0x1848('0xb')](),controller[_0x1848('0x11')]);router['post']('/',auth[_0x1848('0xb')](),controller['create']);router[_0x1848('0x12')](_0x1848('0x10'),auth[_0x1848('0xb')](),controller[_0x1848('0x13')]);router[_0x1848('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x1848('0x15')]);router[_0x1848('0x16')]('/:id',auth[_0x1848('0xb')](),controller[_0x1848('0x17')]);module['exports']=router;
\ No newline at end of file
index 263f971..df337cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeca1=['DATE','NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x3f830b,_0x493523){var _0x33f6f2=function(_0x1e2751){while(--_0x1e2751){_0x3f830b['push'](_0x3f830b['shift']());}};_0x33f6f2(++_0x493523);}(_0xeca1,0x10a));var _0x1eca=function(_0x142d26,_0x1920db){_0x142d26=_0x142d26-0x0;var _0x4aee13=_0xeca1[_0x142d26];return _0x4aee13;};'use strict';var _=require(_0x1eca('0x0'));var Sequelize=require('sequelize');module[_0x1eca('0x1')]={'firstName':{'type':Sequelize[_0x1eca('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1eca('0x2')]},'street':{'type':Sequelize[_0x1eca('0x2')]},'postalCode':{'type':Sequelize[_0x1eca('0x2')]},'city':{'type':Sequelize[_0x1eca('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x1eca('0x2')]},'description':{'type':Sequelize[_0x1eca('0x3')]},'phone':{'type':Sequelize[_0x1eca('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1eca('0x2')]},'email':{'type':Sequelize[_0x1eca('0x2')]},'url':{'type':Sequelize[_0x1eca('0x2')]},'facebook':{'type':Sequelize[_0x1eca('0x2')]},'fb_data':{'type':Sequelize[_0x1eca('0x2')]},'twitter':{'type':Sequelize[_0x1eca('0x2')]},'skype':{'type':Sequelize[_0x1eca('0x2')]},'teams':{'type':Sequelize[_0x1eca('0x2')]},'viber':{'type':Sequelize[_0x1eca('0x2')]},'line':{'type':Sequelize[_0x1eca('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x1eca('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x1eca('0x4')](0x2)[_0x1eca('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1eca('0x6')],'defaultValue':Sequelize[_0x1eca('0x7')]}};
\ No newline at end of file
+var _0x2520=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','lodash'];(function(_0x1ee0a1,_0x51058e){var _0x1d2d5b=function(_0x35cfb5){while(--_0x35cfb5){_0x1ee0a1['push'](_0x1ee0a1['shift']());}};_0x1d2d5b(++_0x51058e);}(_0x2520,0x156));var _0x0252=function(_0x362803,_0x177d1c){_0x362803=_0x362803-0x0;var _0x470744=_0x2520[_0x362803];return _0x470744;};'use strict';var _=require(_0x0252('0x0'));var Sequelize=require(_0x0252('0x1'));module[_0x0252('0x2')]={'firstName':{'type':Sequelize[_0x0252('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0252('0x3')]},'street':{'type':Sequelize[_0x0252('0x3')]},'postalCode':{'type':Sequelize[_0x0252('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0252('0x3')]},'dateOfBirth':{'type':Sequelize[_0x0252('0x3')]},'description':{'type':Sequelize[_0x0252('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x0252('0x3')]},'fax':{'type':Sequelize[_0x0252('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x0252('0x3')]},'facebook':{'type':Sequelize[_0x0252('0x3')]},'fb_data':{'type':Sequelize[_0x0252('0x3')]},'twitter':{'type':Sequelize[_0x0252('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x0252('0x3')]},'line':{'type':Sequelize[_0x0252('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x0252('0x3')]},'UserId':{'type':Sequelize[_0x0252('0x5')]},'priority':{'type':Sequelize[_0x0252('0x5')](0x2)[_0x0252('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index 30213c3..4257160 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6cc=['isEmpty','forEach','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','c.id','DESC','t.id\x20IN\x20?','resolve','user','agent','some','getLists','c.ListId\x20IS\x20NULL','role','sequelize','keyBy','merge','c.firstName','c.phone','c.email','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','toString','Tags','rows','catch','params','tags','columnName','displayName','CmCustomField','findAll','alias','custom','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappQueueReport','each','duplicates','ListId','show','$and','omit','format','cf_%d','pickBy','setFields','id\x20=\x20?','toParam','values','phone','getTags','rawAttributes','sort','options','setTags','ids','getHoppers','nolimit','ContactId','includeAll','include','getHopperFinals','getJscriptySessions','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','child_process','fork','../../components/import/cm/csv','CompanyId','pid','upload','createReadStream','parse','meta','import','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','mail','chat','fax','whatsapp','-createdAt','includes','toLowerCase','Invalid\x20channel','channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','voice','uniqueid','source','callerid','starttime','endtime','duration','userDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Website','Account','closed','closedAt','createdAt','note','disposition','secondDisposition','thirdDisposition','key','browserName','customerIp','customerPort','deviceModel','osName','ratingType','ratingValue','referer','subject','substatus','openchannel','Owner','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','end','error','name','send','CmContact','describe','keys','startsWith','cf_','push','findOne','trimStart','all','fieldType','type','query','intersection','model','attributes','fields','hasOwnProperty','order','where','filters','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','length','find','Tag','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','value','dateOfBirth','datetime','castTo','DATE','text','start','filter','Contact'];(function(_0x40b862,_0x2cbad7){var _0x54bd68=function(_0x193fbf){while(--_0x193fbf){_0x40b862['push'](_0x40b862['shift']());}};_0x54bd68(++_0x2cbad7);}(_0xe6cc,0xbf));var _0xce6c=function(_0xb76872,_0x20e04a){_0xb76872=_0xb76872-0x0;var _0x48f16e=_0xe6cc[_0xb76872];return _0x48f16e;};'use strict';var emlformat=require(_0xce6c('0x0'));var rimraf=require(_0xce6c('0x1'));var zipdir=require(_0xce6c('0x2'));var jsonpatch=require(_0xce6c('0x3'));var rp=require(_0xce6c('0x4'));var moment=require('moment');var BPromise=require(_0xce6c('0x5'));var Mustache=require('mustache');var util=require(_0xce6c('0x6'));var path=require(_0xce6c('0x7'));var sox=require(_0xce6c('0x8'));var csv=require(_0xce6c('0x9'));var ejs=require(_0xce6c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce6c('0xb'));var squel=require(_0xce6c('0xc'));var crypto=require(_0xce6c('0xd'));var jsforce=require(_0xce6c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xce6c('0x9'));var querystring=require(_0xce6c('0xf'));var Papa=require('papaparse');var Redis=require(_0xce6c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xce6c('0x11'));var hardwareService=require(_0xce6c('0x12'));var logger=require('../../config/logger')(_0xce6c('0x13'));var utils=require(_0xce6c('0x14'));var config=require(_0xce6c('0x15'));var licenseUtil=require(_0xce6c('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xce6c('0x17')](config[_0xce6c('0x18')],{'host':_0xce6c('0x19'),'port':0x18eb});var socket=require(_0xce6c('0x1a'))(new Redis(config[_0xce6c('0x18')]));require(_0xce6c('0x1b'))[_0xce6c('0x1c')](socket);function respondWithStatusCode(_0x114c77,_0x2ba32f){_0x2ba32f=_0x2ba32f||0xcc;return function(_0x404f67){if(_0x404f67){return _0x114c77[_0xce6c('0x1d')](_0x2ba32f);}return _0x114c77['status'](_0x2ba32f)['end']();};}function respondWithResult(_0x5baa9b,_0x40057f){_0x40057f=_0x40057f||0xc8;return function(_0x28ab7b){if(_0x28ab7b){return _0x5baa9b[_0xce6c('0x1e')](_0x40057f)['json'](_0x28ab7b);}};}function respondWithFilteredResult(_0x215286,_0x46b4c7){return function(_0xf55362){if(_0xf55362){var _0x1173d0=typeof _0x46b4c7[_0xce6c('0x1f')]==='undefined'&&typeof _0x46b4c7[_0xce6c('0x20')]==='undefined';var _0x1db1ed=_0xf55362[_0xce6c('0x21')];var _0x552717=_0x1173d0?0x0:_0x46b4c7[_0xce6c('0x1f')];var _0xb785bf=_0x1173d0?_0xf55362['count']:_0x46b4c7[_0xce6c('0x1f')]+_0x46b4c7[_0xce6c('0x20')];var _0xf1db22;if(_0xb785bf>=_0x1db1ed){_0xb785bf=_0x1db1ed;_0xf1db22=0xc8;}else{_0xf1db22=0xce;}_0x215286[_0xce6c('0x1e')](_0xf1db22);return _0x215286[_0xce6c('0x22')](_0xce6c('0x23'),_0x552717+'-'+_0xb785bf+'/'+_0x1db1ed)[_0xce6c('0x24')](_0xf55362);}return null;};}function patchUpdates(_0x53f736){return function(_0x497a91){try{jsonpatch[_0xce6c('0x25')](_0x497a91,_0x53f736,!![]);}catch(_0x336b87){return BPromise[_0xce6c('0x26')](_0x336b87);}return _0x497a91[_0xce6c('0x27')]();};}function saveUpdates(_0xb221c6,_0x2179ee){return function(_0x4e7666){if(_0x4e7666){return _0x4e7666['update'](_0xb221c6)[_0xce6c('0x28')](function(_0x438a0b){return _0x438a0b;});}return null;};}function removeEntity(_0x119fb9,_0x561cbb){return function(_0x330bad){if(_0x330bad){return _0x330bad[_0xce6c('0x29')]()[_0xce6c('0x28')](function(){_0x119fb9['status'](0xcc)[_0xce6c('0x2a')]();});}};}function handleEntityNotFound(_0x4cb444,_0x5c2433){return function(_0x23327e){if(!_0x23327e){_0x4cb444['sendStatus'](0x194);}return _0x23327e;};}function handleError(_0x1ecb80,_0x2a3f3b){_0x2a3f3b=_0x2a3f3b||0x1f4;return function(_0x569cc6){logger[_0xce6c('0x2b')](_0x569cc6['stack']);if(_0x569cc6[_0xce6c('0x2c')]){delete _0x569cc6[_0xce6c('0x2c')];}_0x1ecb80[_0xce6c('0x1e')](_0x2a3f3b)[_0xce6c('0x2d')](_0x569cc6);};}exports['index']=function(_0x27f686,_0x33e5e0){var _0x2cae07={},_0xa3257f={},_0x242ff3={'count':0x0,'rows':[]};return db[_0xce6c('0x2e')][_0xce6c('0x2f')]()[_0xce6c('0x28')](function(_0x2a0943){var _0x3f56e6=[];for(var _0x21654f=0x0;_0x21654f<Object[_0xce6c('0x30')](_0x2a0943)['length'];_0x21654f++){var _0x2ca46d=Object[_0xce6c('0x30')](_0x2a0943)[_0x21654f];if(_[_0xce6c('0x31')](_0x2ca46d,_0xce6c('0x32'))){_0x3f56e6[_0xce6c('0x33')](db['CmCustomField'][_0xce6c('0x34')]({'where':{'id':_[_0xce6c('0x35')](_0x2ca46d,'cf_')},'raw':!![]}));}}return BPromise[_0xce6c('0x36')](_0x3f56e6)[_0xce6c('0x28')](function(_0x31f04e){for(var _0xad5b9b=0x0;_0xad5b9b<_0x31f04e['length'];_0xad5b9b++){if(_0x31f04e[_0xad5b9b]){var _0x2bd484='cf_'+_0x31f04e[_0xad5b9b]['id'];var _0x194dfe=_0x2a0943[_0x2bd484];_0x194dfe[_0xce6c('0x37')]=_0x31f04e[_0xad5b9b][_0xce6c('0x38')];}}return _0x2a0943;});})[_0xce6c('0x28')](function(_0x2ebb17){_0xa3257f['model']=_['keys'](_0x2ebb17);_0xa3257f[_0xce6c('0x39')]=_[_0xce6c('0x30')](_0x27f686[_0xce6c('0x39')]);_0xa3257f['filters']=_[_0xce6c('0x3a')](_0xa3257f[_0xce6c('0x3b')],_0xa3257f[_0xce6c('0x39')]);_0x2cae07[_0xce6c('0x3c')]=_[_0xce6c('0x3a')](_0xa3257f[_0xce6c('0x3b')],qs[_0xce6c('0x3d')](_0x27f686[_0xce6c('0x39')][_0xce6c('0x3d')]));_0x2cae07[_0xce6c('0x3c')]=_0x2cae07['attributes']['length']?_0x2cae07[_0xce6c('0x3c')]:_0xa3257f[_0xce6c('0x3b')];if(!_0x27f686[_0xce6c('0x39')][_0xce6c('0x3e')]('nolimit')){_0x2cae07['limit']=qs[_0xce6c('0x20')](_0x27f686[_0xce6c('0x39')][_0xce6c('0x20')]);_0x2cae07[_0xce6c('0x1f')]=qs[_0xce6c('0x1f')](_0x27f686[_0xce6c('0x39')]['offset']);}_0x2cae07[_0xce6c('0x3f')]=qs['sort'](_0x27f686['query']['sort']);_0x2cae07[_0xce6c('0x40')]=qs[_0xce6c('0x41')](_[_0xce6c('0x42')](_0x27f686[_0xce6c('0x39')],_0xa3257f[_0xce6c('0x41')]),_0x2ebb17);var _0x4eb073=[];var _0x4bc4fe=squel[_0xce6c('0x43')]()[_0xce6c('0x44')]('id')[_0xce6c('0x44')]('name')['field'](_0xce6c('0x45'))[_0xce6c('0x46')](_0xce6c('0x47'));var _0x2ba2ef=squel['select']()[_0xce6c('0x46')](_0xce6c('0x48'),'c')[_0xce6c('0x49')](_0xce6c('0x4a'),'uc',_0xce6c('0x4b'))['left_join'](_0xce6c('0x4c'),'ct',_0xce6c('0x4d'))[_0xce6c('0x49')](_0xce6c('0x47'),'t',_0xce6c('0x4e'))['where'](_0xce6c('0x4f'));var _0x11b769=squel['expr']();var _0x1c379e=[];var _0x4ac253=squel[_0xce6c('0x50')]();var _0x4521e1;if(_0x27f686[_0xce6c('0x39')][_0xce6c('0x51')]){_0x4521e1=as[_0xce6c('0x52')](_0x27f686['query'][_0xce6c('0x51')]);var _0x3e1494=_0x4521e1[_0xce6c('0x53')];for(var _0x22a0ac=0x0;_0x22a0ac<_0x4521e1[_0xce6c('0x54')][_0xce6c('0x55')];_0x22a0ac++){var _0x5e0fa9=_0x4521e1[_0xce6c('0x54')][_0x22a0ac];var _0x76bb4a='c';var _0x203a5d=_(_0x2ebb17)[_0xce6c('0x30')]()[_0xce6c('0x56')](function(_0x35bc1c){return _0x35bc1c===_0x5e0fa9[_0xce6c('0x44')];});if(_0x203a5d)_0x203a5d=_0x2ebb17[_0x5e0fa9['field']];if(!_0x203a5d){if(_0x5e0fa9[_0xce6c('0x44')]===_0xce6c('0x57')){var _0x55926b=_0x5e0fa9['value'][_0xce6c('0x58')](',')[_0xce6c('0x59')](function(_0x436ef2){return Number(_0x436ef2);});_0x55926b['forEach'](function(_0x2e0256){_0x4ac253['or'](_0xce6c('0x5a'),'%,'+_0x2e0256+',%');});_0x1c379e=_['union'](_0x1c379e,_0x55926b);}else if(_0x5e0fa9[_0xce6c('0x44')]===_0xce6c('0x5b')){_0x11b769[_0xce6c('0x5c')]('uc.UserId\x20=\x20?',_0x5e0fa9[_0xce6c('0x5d')]);}}else{if(_0x5e0fa9['field']===_0xce6c('0x5e')||_0x203a5d[_0xce6c('0x37')]===_0xce6c('0x5f'))_0x5e0fa9[_0xce6c('0x60')]=_0xce6c('0x61');var _0x2818f5=as['buildExpression'](_0x76bb4a,_0x203a5d[_0xce6c('0x38')],_0x5e0fa9);_0x11b769[_0x3e1494](_0x2818f5[_0xce6c('0x62')],_0x2818f5[_0xce6c('0x5d')][_0xce6c('0x63')],_0x2818f5[_0xce6c('0x5d')][_0xce6c('0x2a')]);}}}else{var _0x38169e=_(Object[_0xce6c('0x30')](_0x27f686[_0xce6c('0x39')]))[_0xce6c('0x59')](function(_0x7369f9){return _0x2ebb17['hasOwnProperty'](_0x7369f9)?_0x7369f9:undefined;})[_0xce6c('0x64')](function(_0xf71402){return!_['isNil'](_0xf71402);})['value']();if(_0x27f686['query'][_0xce6c('0x65')])_0x38169e['push'](_0xce6c('0x65'));if(!_[_0xce6c('0x66')](_0x38169e)){_0x38169e[_0xce6c('0x67')](function(_0x1df930){if(_0x1df930==='ListId'){_0x2ba2ef[_0xce6c('0x40')](_0xce6c('0x68'),[][_0xce6c('0x69')](_0x27f686[_0xce6c('0x39')][_0x1df930]));}else if(_0x1df930===_0xce6c('0x65')){var _0x4464fb='%'+_0x27f686[_0xce6c('0x39')][_0x1df930]+'%';_0x2ba2ef[_0xce6c('0x40')](_0xce6c('0x6a'),_0x4464fb);}else{_0x2ba2ef[_0xce6c('0x40')]('c.'+_0x1df930+_0xce6c('0x6b'),_0x27f686[_0xce6c('0x39')][_0x1df930]);}});}if(_0x27f686['query'][_0xce6c('0x6c')]){_0x1c379e=_[_0xce6c('0x6d')](_0x27f686[_0xce6c('0x39')][_0xce6c('0x6c')])?_0x27f686[_0xce6c('0x39')][_0xce6c('0x6c')]:new Array(_0x27f686[_0xce6c('0x39')][_0xce6c('0x6c')]);_0x1c379e[_0xce6c('0x67')](function(_0xcebd07){_0x4ac253['or'](_0xce6c('0x5a'),'%,'+_0xcebd07+',%');});}if(_0x27f686[_0xce6c('0x39')][_0xce6c('0x64')]){var _0x58a80c=_0x27f686[_0xce6c('0x39')][_0xce6c('0x64')][_0xce6c('0x6e')]('\x5c','\x5c\x5c')[_0xce6c('0x6e')](/'/g,'\x27\x27');if(_0x58a80c[_0xce6c('0x58')]('\x20')[_0xce6c('0x55')]>0x1){_0x11b769['or'](_0xce6c('0x6f'),qs[_0xce6c('0x70')](_0x58a80c),null);}else{if(qs[_0xce6c('0x71')](_0x58a80c)){_0x11b769['or']('c.id\x20LIKE\x20?',_0x58a80c+'%');_0x11b769['or'](_0xce6c('0x72'),_0x58a80c+'%');_0x11b769['or']('c.mobile\x20LIKE\x20?',_0x58a80c+'%');_0x11b769['or'](_0xce6c('0x73'),_0x58a80c+'%');}else if(qs[_0xce6c('0x74')](_0x58a80c)){_0x11b769['or'](_0xce6c('0x75'),_0x58a80c+'%');}else{_0x11b769['or'](_0xce6c('0x76'),'%'+_0x58a80c+'%');_0x11b769['or'](_0xce6c('0x77'),'%'+_0x58a80c+'%');_0x11b769['or'](_0xce6c('0x75'),'%'+_0x58a80c+'%');}}}}_0x2ba2ef[_0xce6c('0x40')](_0x11b769);_0x2ba2ef['group']('c.id');var _0x3e6612={'type':db[_0xce6c('0x78')][_0xce6c('0x79')][_0xce6c('0x7a')],'raw':!![]};var _0x424201=_0x2ba2ef[_0xce6c('0x7b')]()[_0xce6c('0x44')](_0xce6c('0x7c'));if(_0x2cae07[_0xce6c('0x3f')]){_0x2cae07[_0xce6c('0x3f')][_0xce6c('0x67')](function(_0x22e0ad){_0x2ba2ef[_0xce6c('0x3f')]('c.'+_0x22e0ad[0x0],_0x22e0ad[0x1]===_0xce6c('0x7d')?![]:!![]);});}if(!_[_0xce6c('0x66')](_0x1c379e)){_0x2ba2ef['having'](_0x4ac253);_0x424201[_0xce6c('0x40')](_0xce6c('0x7e'),_0x1c379e);}BPromise[_0xce6c('0x7f')]()[_0xce6c('0x28')](function(){if(!_0x4521e1)return;if(_0x27f686[_0xce6c('0x80')]['role']!==_0xce6c('0x81'))return;if(!_[_0xce6c('0x82')](_0x4521e1['conditions'],[_0xce6c('0x44'),_0xce6c('0x5b')])){return _0x27f686[_0xce6c('0x80')][_0xce6c('0x83')]({'attributes':['id'],'raw':!![]})[_0xce6c('0x28')](function(_0x22763d){if(_[_0xce6c('0x66')](_0x22763d)){_0x424201[_0xce6c('0x40')](_0xce6c('0x84'));_0x2ba2ef[_0xce6c('0x40')]('c.ListId\x20IS\x20NULL');}else{_0x424201[_0xce6c('0x40')](_0xce6c('0x68'),_[_0xce6c('0x59')](_0x22763d,'id'));_0x2ba2ef[_0xce6c('0x40')](_0xce6c('0x68'),_['map'](_0x22763d,'id'));}});}})[_0xce6c('0x28')](function(){if(_0x27f686[_0xce6c('0x80')][_0xce6c('0x85')]==='agent'&&!_0x4521e1&&!_0x27f686[_0xce6c('0x39')]['ListId'])return[];return db[_0xce6c('0x86')]['query'](_0x424201['toString'](),_0x3e6612);})[_0xce6c('0x28')](function(_0x744d10){_0x242ff3[_0xce6c('0x21')]=_0x744d10[_0xce6c('0x55')];if(_0x242ff3[_0xce6c('0x21')]===0x0)return[];return db['sequelize']['query'](_0x4bc4fe['toString'](),_0x3e6612)[_0xce6c('0x28')](function(_0x56d0a){_0x4eb073=_[_0xce6c('0x87')](_0x56d0a,'id');_0x3e6612=_[_0xce6c('0x88')](_0x3e6612,{'model':db[_0xce6c('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x27f686[_0xce6c('0x39')][_0xce6c('0x3d')]){_0x2cae07['attributes'][_0xce6c('0x67')](function(_0x460661){_0x2ba2ef[_0xce6c('0x44')]('c.'+_0x460661);});}else{_0x2ba2ef['field'](_0xce6c('0x7c'));_0x2ba2ef[_0xce6c('0x44')](_0xce6c('0x89'));_0x2ba2ef['field']('c.lastName');_0x2ba2ef[_0xce6c('0x44')](_0xce6c('0x8a'));_0x2ba2ef['field']('c.mobile');_0x2ba2ef[_0xce6c('0x44')]('c.fax');_0x2ba2ef[_0xce6c('0x44')](_0xce6c('0x8b'));_0x2ba2ef[_0xce6c('0x44')]('c.ListId');_0x2ba2ef[_0xce6c('0x44')]('c.createdAt');_0x2ba2ef[_0xce6c('0x44')](_0xce6c('0x8c'));_0x2ba2ef[_0xce6c('0x44')](_0xce6c('0x8d'));_0x2ba2ef[_0xce6c('0x44')](_0xce6c('0x8e'),_0xce6c('0x8f'));}if(_0x2cae07['limit'])_0x2ba2ef[_0xce6c('0x20')](_0x2cae07[_0xce6c('0x20')]);if(_0x2cae07[_0xce6c('0x1f')])_0x2ba2ef[_0xce6c('0x1f')](_0x2cae07[_0xce6c('0x1f')]);return db[_0xce6c('0x86')][_0xce6c('0x39')](_0x2ba2ef[_0xce6c('0x90')](),_0x3e6612);});})['then'](function(_0x12c55c){_0x12c55c[_0xce6c('0x67')](function(_0x3a7bf4){if(_0x3a7bf4[_0xce6c('0x8f')]){_0x3a7bf4[_0xce6c('0x91')]=[];_0x3a7bf4[_0xce6c('0x8f')][_0xce6c('0x58')](',')[_0xce6c('0x67')](function(_0x42327b){_0x3a7bf4[_0xce6c('0x91')][_0xce6c('0x33')](_0x4eb073[_0x42327b]);});}delete _0x3a7bf4[_0xce6c('0x8f')];});_0x242ff3[_0xce6c('0x92')]=_0x12c55c;return _0x242ff3;})[_0xce6c('0x28')](respondWithFilteredResult(_0x33e5e0,_0x2cae07));})[_0xce6c('0x93')](handleError(_0x33e5e0,null));};exports[_0xce6c('0x29')]=function(_0x5c699c,_0x25a7da){return db[_0xce6c('0x2e')][_0xce6c('0x56')]({'where':{'id':_0x5c699c[_0xce6c('0x94')]['id']}})[_0xce6c('0x28')](handleEntityNotFound(_0x25a7da,null))[_0xce6c('0x28')](removeEntity(_0x25a7da,null))[_0xce6c('0x93')](handleError(_0x25a7da,null));};exports[_0xce6c('0x2f')]=function(_0x6df26d,_0x10639e){return db[_0xce6c('0x2e')]['describe']()[_0xce6c('0x28')](function(_0x400f3c){delete _0x400f3c[_0xce6c('0x95')];for(var _0x124d97=0x0;_0x124d97<Object['keys'](_0x400f3c)['length'];_0x124d97++){var _0x1597bb=Object[_0xce6c('0x30')](_0x400f3c)[_0x124d97];if(!_[_0xce6c('0x31')](_0x1597bb,_0xce6c('0x32'))){_0x400f3c[_0x1597bb][_0xce6c('0x96')]=_0x1597bb;_0x400f3c[_0x1597bb][_0xce6c('0x97')]=_0x1597bb;}}return _0x400f3c;})[_0xce6c('0x28')](function(_0x584502){var _0x4dd136={'where':{'$or':[{'ListId':_0x6df26d[_0xce6c('0x39')]['id']},{'ListId':null}]},'raw':!![]};return db[_0xce6c('0x98')][_0xce6c('0x99')](_0x4dd136)[_0xce6c('0x28')](function(_0x26c5d2){for(var _0x2d64bc=0x0;_0x2d64bc<_0x26c5d2['length'];_0x2d64bc++){var _0x29a73a='cf_'+_0x26c5d2[_0x2d64bc]['id'];_0x584502[_0x29a73a][_0xce6c('0x96')]=_0x29a73a;_0x584502[_0x29a73a][_0xce6c('0x97')]=_0x26c5d2[_0x2d64bc][_0xce6c('0x9a')];_0x584502[_0x29a73a][_0xce6c('0x9b')]={'type':_0x26c5d2[_0x2d64bc][_0xce6c('0x38')],'values':_0x26c5d2[_0x2d64bc]['values']};}Object[_0xce6c('0x30')](_0x584502)[_0xce6c('0x67')](function(_0x5544c9){if(!_0x584502[_0x5544c9][_0xce6c('0x3e')](_0xce6c('0x96'))){delete _0x584502[_0x5544c9];}});return _0x584502;});})['then'](respondWithResult(_0x10639e,null))[_0xce6c('0x93')](handleError(_0x10639e,null));};exports[_0xce6c('0x88')]=function(_0x7d24d6,_0x22cf01){var _0x1e6fd1;var _0x555d90;var _0x3d70dc;if(_0x7d24d6[_0xce6c('0x9c')]['id']){delete _0x7d24d6['body']['id'];}return db['CmContact'][_0xce6c('0x99')]({'where':{'id':[_0x7d24d6['body']['to'],_0x7d24d6[_0xce6c('0x9c')][_0xce6c('0x46')]]}})['then'](function(_0x1efad6){if(_0x1efad6){if(_0x1efad6[_0xce6c('0x55')]!==0x2){return null;}_0x1efad6[0x0]=_0x1efad6[0x0][_0xce6c('0x9d')]({'plain':!![]});_0x1efad6[0x1]=_0x1efad6[0x1]['get']({'plain':!![]});delete _0x1efad6[0x0]['id'];delete _0x1efad6[0x1]['id'];return _[_0xce6c('0x9e')](_0x1efad6[0x0],_0x1efad6[0x1],function(_0x1985b0,_0xe56385){if(Array['isArray'](_0xe56385)&&!_0xe56385['length']){return _0x1985b0;}else if(!_0xe56385){return _0x1985b0;}});}})[_0xce6c('0x28')](handleEntityNotFound(_0x22cf01,null))[_0xce6c('0x28')](function(_0x43ebf1){if(_0x43ebf1){if(_0x43ebf1['tags']&&_[_0xce6c('0x6d')](_0x43ebf1[_0xce6c('0x95')])){_0x43ebf1['tags']=_0x43ebf1[_0xce6c('0x95')][_0xce6c('0x9f')]();}logger[_0xce6c('0xa0')](_0xce6c('0xa1'),_0x7d24d6['body']['to'],_0x7d24d6[_0xce6c('0x9c')]['from']);return db[_0xce6c('0xa2')][_0xce6c('0x29')]({'where':{'ContactId':[_0x7d24d6[_0xce6c('0x9c')]['to'],_0x7d24d6['body'][_0xce6c('0x46')]]}})['then'](function(_0x55a563){logger['info'](_0xce6c('0xa3'),_0x55a563);return db['CmHopperBlack']['destroy']({'where':{'ContactId':[_0x7d24d6[_0xce6c('0x9c')]['to'],_0x7d24d6[_0xce6c('0x9c')][_0xce6c('0x46')]]}})['then'](function(_0x3c1a22){logger[_0xce6c('0xa0')](_0xce6c('0xa4'),_0x3c1a22);return db['CmContact'][_0xce6c('0xa5')](_0x43ebf1);});});}})[_0xce6c('0x28')](function(_0x4a479b){if(_0x4a479b){_0x1e6fd1=_0x4a479b;_0x555d90={'ContactId':_0x1e6fd1['id']};_0x3d70dc={'where':{'ContactId':[_0x7d24d6['body']['to'],_0x7d24d6['body']['from']]}};return db[_0xce6c('0xa6')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xa8')]['update'](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xa9')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xaa')]['update'](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xab')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db['MailInteraction']['update'](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db['MailMessage'][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xac')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})['then'](function(){if(_0x1e6fd1){return db[_0xce6c('0xad')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xae')]['update'](_0x555d90,_0x3d70dc);}})['then'](function(){if(_0x1e6fd1){return db[_0xce6c('0xaf')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xb0')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})['then'](function(){if(_0x1e6fd1){return db[_0xce6c('0xb1')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xb2')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xb3')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xb4')]['update'](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xb5')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xb6')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db['FaxQueueReport'][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})['then'](function(){if(_0x1e6fd1){return db[_0xce6c('0xb7')]['update'](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db['OpenchannelQueueReport']['update'](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xb8')]['update'](_0x555d90,_0x3d70dc);}})['then'](function(){if(_0x1e6fd1){return db[_0xce6c('0xb9')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})['then'](function(){if(_0x1e6fd1){return db['WhatsappInteraction'][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})['then'](function(){if(_0x1e6fd1){return db['WhatsappMessage'][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db[_0xce6c('0xba')][_0xce6c('0xa7')](_0x555d90,_0x3d70dc);}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return db['CmContact'][_0xce6c('0x29')]({'where':{'id':[_0x7d24d6[_0xce6c('0x9c')]['to'],_0x7d24d6[_0xce6c('0x9c')][_0xce6c('0x46')]]}});}})[_0xce6c('0x28')](function(){if(_0x1e6fd1){return _0x1e6fd1;}})[_0xce6c('0x28')](respondWithResult(_0x22cf01,null))[_0xce6c('0x93')](handleError(_0x22cf01,null));};exports['create']=function(_0x13d3ed,_0x3bed77){return db[_0xce6c('0x2e')][_0xce6c('0x2f')]()[_0xce6c('0x28')](function(_0x3a5b31){if(_0x13d3ed[_0xce6c('0x9c')][_0xce6c('0x95')]&&_['isArray'](_0x13d3ed['body'][_0xce6c('0x95')])){if(_0x13d3ed[_0xce6c('0x9c')][_0xce6c('0x95')][_0xce6c('0x55')]){_0x13d3ed[_0xce6c('0x9c')]['tags']=_0x13d3ed['body']['tags'][_0xce6c('0x9f')](';')+';';}else{_0x13d3ed[_0xce6c('0x9c')]['tags']=null;}}else{_0x13d3ed['body'][_0xce6c('0x95')]=null;}return db[_0xce6c('0x2e')]['create'](_0x13d3ed[_0xce6c('0x9c')],{'fields':_[_0xce6c('0x30')](_0x3a5b31),'raw':!![]});})[_0xce6c('0x28')](respondWithResult(_0x3bed77,0xc9))[_0xce6c('0x93')](handleError(_0x3bed77,null));};exports['bulkCreate']=function(_0x3d1db8,_0x4be7c6){var _0x334c75=[];var _0x2c6707=0x0;var _0x14f4e1=0x0;var _0x40d7a0=0x0;return db[_0xce6c('0x2e')][_0xce6c('0x2f')]()[_0xce6c('0x28')](function(_0x12a55d){return BPromise[_0xce6c('0xbb')](_0x3d1db8[_0xce6c('0x9c')],function(_0x31a39){var _0x1acbcd={'where':{'$or':[]},'defaults':_0x31a39,'fields':_['keys'](_0x12a55d),'raw':!![]};if(_0x31a39[_0xce6c('0xbc')]){for(var _0x369d13=0x0;_0x369d13<_0x31a39[_0xce6c('0xbc')]['length'];_0x369d13++){var _0x460a94={};_0x460a94[_0x31a39[_0xce6c('0xbc')][_0x369d13]]=_0x31a39[_0x31a39[_0xce6c('0xbc')][_0x369d13]];_0x1acbcd[_0xce6c('0x40')]['$or']['push'](_0x460a94);}_0x1acbcd[_0xce6c('0x40')]['ListId']=_0x31a39[_0xce6c('0xbd')];}return db[_0xce6c('0x2e')]['findOrCreate'](_0x1acbcd)['spread'](function(_0x6277eb,_0x5e3a33){if(_0x5e3a33){_0x2c6707++;}else{_0x40d7a0++;}})['catch'](function(_0x573d84){console[_0xce6c('0x2b')](_0x573d84);_0x14f4e1++;});});})['then'](function(_0x89f28e){if(_0x89f28e){return{'success':_0x2c6707,'failure':_0x14f4e1,'duplicates':_0x40d7a0};}})[_0xce6c('0x28')](respondWithResult(_0x4be7c6,0xc9))['catch'](handleError(_0x4be7c6,null));};exports[_0xce6c('0xbe')]=function(_0x1d38a2,_0x1627d9,_0x5bbc8c){var _0x59e4b4;return db[_0xce6c('0x2e')][_0xce6c('0x2f')]()[_0xce6c('0x28')](function(_0x2d6a6f){return db[_0xce6c('0x2e')]['find']({'where':{'id':_0x1d38a2[_0xce6c('0x94')]['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id',_0xce6c('0x2c'),_0xce6c('0x45')],'required':_0x1d38a2[_0xce6c('0x39')][_0xce6c('0x6c')]?!![]:![]}],'attributes':_[_0xce6c('0x30')](_0x2d6a6f)});})[_0xce6c('0x28')](function(_0xdcfb65){_0x59e4b4=_0xdcfb65[_0xce6c('0x9d')]({'plain':!![]});var _0x4bab95={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xdcfb65&&_0xdcfb65[_0xce6c('0xbd')]){if(_0xdcfb65['ListId']){_0x4bab95[_0xce6c('0x40')][_0xce6c('0xbf')][_0xce6c('0x33')]({'ListId':{'$ne':_0xdcfb65['ListId']}});}}return db[_0xce6c('0x98')][_0xce6c('0x99')](_0x4bab95);})[_0xce6c('0x28')](function(_0x257c45){return _[_0xce6c('0xc0')](_0x59e4b4,_[_0xce6c('0x59')](_0x257c45,function(_0x1ce266){return util[_0xce6c('0xc1')](_0xce6c('0xc2'),_0x1ce266['id']);}));})[_0xce6c('0x28')](handleEntityNotFound(_0x1627d9,null))[_0xce6c('0x28')](respondWithResult(_0x1627d9,null))['catch'](handleError(_0x1627d9,null));};exports[_0xce6c('0xa7')]=function(_0x15895c,_0x209cc4){var _0x524f96;if(_0x15895c[_0xce6c('0x9c')]['id']){delete _0x15895c['body']['id'];}return db[_0xce6c('0x2e')][_0xce6c('0x56')]({'where':{'id':_0x15895c[_0xce6c('0x94')]['id']}})['then'](handleEntityNotFound(_0x209cc4,null))[_0xce6c('0x28')](saveUpdates(_0x15895c[_0xce6c('0x9c')],null))[_0xce6c('0x28')](function(_0x50d908){_0x524f96=_0x50d908;var _0x19f833={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x50d908&&_0x50d908[_0xce6c('0xbd')]){if(_0x50d908[_0xce6c('0xbd')]){_0x19f833[_0xce6c('0x40')][_0xce6c('0xbf')][_0xce6c('0x33')]({'ListId':{'$ne':_0x50d908[_0xce6c('0xbd')]}});}}return db[_0xce6c('0x98')][_0xce6c('0x99')](_0x19f833);})['then'](function(_0x19146e){if(_0x19146e){return _[_0xce6c('0xc0')](_[_0xce6c('0xc3')](_0x15895c['body'],function(_0x5aedd0,_0x15c42a){return _[_0xce6c('0x31')](_0x15c42a,_0xce6c('0x32'));}),_[_0xce6c('0x59')](_0x19146e,function(_0x284bed){return util[_0xce6c('0xc1')](_0xce6c('0xc2'),_0x284bed['id']);}));}})[_0xce6c('0x28')](function(_0x3540ba){if(_0x3540ba&&!_[_0xce6c('0x66')](_0x3540ba)){var _0x56bf00=squel['update']()['table'](_0xce6c('0x48'))[_0xce6c('0xc4')](_0x3540ba)[_0xce6c('0x40')](_0xce6c('0xc5'),_0x15895c['params']['id'])[_0xce6c('0xc6')]();return db['sequelize']['query'](_0x56bf00['text'],{'replacements':_0x56bf00[_0xce6c('0xc7')]});}})[_0xce6c('0x28')](function(){if(_0x15895c[_0xce6c('0x9c')][_0xce6c('0xc8')]&&_0x524f96){return db['CmHopper'][_0xce6c('0xa7')]({'phone':_0x15895c[_0xce6c('0x9c')][_0xce6c('0xc8')]},{'where':{'ContactId':_0x524f96['id']}});}})['then'](function(){return _0x524f96;})['then'](respondWithResult(_0x209cc4,null))['catch'](handleError(_0x209cc4,null));};exports[_0xce6c('0xc9')]=function(_0x498632,_0x260b4e,_0x5ce2aa){var _0x12d9de={};var _0x262abf={};var _0x614fcc;var _0xa6888c;return db[_0xce6c('0x2e')][_0xce6c('0x34')]({'where':{'id':_0x498632[_0xce6c('0x94')]['id']}})[_0xce6c('0x28')](handleEntityNotFound(_0x260b4e,null))[_0xce6c('0x28')](function(_0x10bd44){if(_0x10bd44){_0x614fcc=_0x10bd44;_0x262abf[_0xce6c('0x3b')]=_[_0xce6c('0x30')](db[_0xce6c('0x57')][_0xce6c('0xca')]);_0x262abf['query']=_[_0xce6c('0x30')](_0x498632[_0xce6c('0x39')]);_0x262abf[_0xce6c('0x41')]=_['intersection'](_0x262abf[_0xce6c('0x3b')],_0x262abf['query']);_0x12d9de[_0xce6c('0x3c')]=_['intersection'](_0x262abf[_0xce6c('0x3b')],qs[_0xce6c('0x3d')](_0x498632[_0xce6c('0x39')]['fields']));_0x12d9de['attributes']=_0x12d9de[_0xce6c('0x3c')]['length']?_0x12d9de[_0xce6c('0x3c')]:_0x262abf[_0xce6c('0x3b')];_0x12d9de[_0xce6c('0x3f')]=qs[_0xce6c('0xcb')](_0x498632[_0xce6c('0x39')]['sort']);_0x12d9de[_0xce6c('0x40')]=qs['filters'](_[_0xce6c('0x42')](_0x498632[_0xce6c('0x39')],_0x262abf[_0xce6c('0x41')]));if(_0x498632[_0xce6c('0x39')][_0xce6c('0x64')]){_0x12d9de['where']=_[_0xce6c('0x88')](_0x12d9de[_0xce6c('0x40')],{'$or':_[_0xce6c('0x59')](_0x12d9de[_0xce6c('0x3c')],function(_0x526f05){var _0x3eb16c={};_0x3eb16c[_0x526f05]={'$like':'%'+_0x498632[_0xce6c('0x39')][_0xce6c('0x64')]+'%'};return _0x3eb16c;})});}_0x12d9de=_['merge']({},_0x12d9de,_0x498632[_0xce6c('0xcc')]);return _0x614fcc[_0xce6c('0xc9')](_0x12d9de);}})[_0xce6c('0x28')](function(_0x3b468f){if(_0x3b468f){_0xa6888c=_0x3b468f[_0xce6c('0x55')];if(!_0x498632[_0xce6c('0x39')]['hasOwnProperty']('nolimit')){_0x12d9de['limit']=qs[_0xce6c('0x20')](_0x498632[_0xce6c('0x39')][_0xce6c('0x20')]);_0x12d9de[_0xce6c('0x1f')]=qs[_0xce6c('0x1f')](_0x498632['query'][_0xce6c('0x1f')]);}return _0x614fcc['getTags'](_0x12d9de);}})['then'](function(_0x3540c4){if(_0x3540c4){return _0x3540c4?{'count':_0xa6888c,'rows':_0x3540c4}:null;}})['then'](respondWithResult(_0x260b4e,null))[_0xce6c('0x93')](handleError(_0x260b4e,null));};exports['setTags']=function(_0x22d700,_0xb387ba,_0x5895f3){if(_0x22d700[_0xce6c('0x9c')]['id']){delete _0x22d700['body']['id'];}return db[_0xce6c('0x2e')][_0xce6c('0x34')]({'where':{'id':_0x22d700[_0xce6c('0x94')]['id']}})['then'](handleEntityNotFound(_0xb387ba,null))[_0xce6c('0x28')](function(_0x36fb73){if(_0x36fb73){return _0x36fb73[_0xce6c('0xcd')](_0x22d700[_0xce6c('0x9c')][_0xce6c('0xce')]||[]);}return null;})[_0xce6c('0x28')](respondWithResult(_0xb387ba,null))[_0xce6c('0x93')](handleError(_0xb387ba,null));};exports[_0xce6c('0xcf')]=function(_0x3e5ca2,_0x1d05c4,_0x39ad06){var _0x30c766={'raw':![],'where':{}};var _0x493d59={};var _0x6c4894={'count':0x0,'rows':[]};return db[_0xce6c('0x2e')]['findOne']({'where':{'id':_0x3e5ca2['params']['id']}})[_0xce6c('0x28')](handleEntityNotFound(_0x1d05c4,null))[_0xce6c('0x28')](function(_0x34388d){if(_0x34388d){_0x493d59['model']=_[_0xce6c('0x30')](db[_0xce6c('0xa2')][_0xce6c('0xca')]);_0x493d59[_0xce6c('0x39')]=_[_0xce6c('0x30')](_0x3e5ca2[_0xce6c('0x39')]);_0x493d59['filters']=_[_0xce6c('0x3a')](_0x493d59[_0xce6c('0x3b')],_0x493d59[_0xce6c('0x39')]);_0x30c766[_0xce6c('0x3c')]=_[_0xce6c('0x3a')](_0x493d59[_0xce6c('0x3b')],qs[_0xce6c('0x3d')](_0x3e5ca2[_0xce6c('0x39')]['fields']));_0x30c766[_0xce6c('0x3c')]=_0x30c766[_0xce6c('0x3c')][_0xce6c('0x55')]?_0x30c766['attributes']:_0x493d59[_0xce6c('0x3b')];if(!_0x3e5ca2[_0xce6c('0x39')]['hasOwnProperty'](_0xce6c('0xd0'))){_0x30c766[_0xce6c('0x20')]=qs[_0xce6c('0x20')](_0x3e5ca2[_0xce6c('0x39')][_0xce6c('0x20')]);_0x30c766[_0xce6c('0x1f')]=qs[_0xce6c('0x1f')](_0x3e5ca2[_0xce6c('0x39')][_0xce6c('0x1f')]);}_0x30c766[_0xce6c('0x3f')]=qs[_0xce6c('0xcb')](_0x3e5ca2[_0xce6c('0x39')][_0xce6c('0xcb')]);_0x30c766[_0xce6c('0x40')]=qs[_0xce6c('0x41')](_['pick'](_0x3e5ca2[_0xce6c('0x39')],_0x493d59[_0xce6c('0x41')]));_0x30c766[_0xce6c('0x40')][_0xce6c('0xd1')]=_0x34388d['id'];if(_0x3e5ca2['query'][_0xce6c('0x64')]){_0x30c766[_0xce6c('0x40')]=_['merge'](_0x30c766[_0xce6c('0x40')],{'$or':_[_0xce6c('0x59')](_0x30c766[_0xce6c('0x3c')],function(_0x2792d2){var _0x46a046={};_0x46a046[_0x2792d2]={'$like':'%'+_0x3e5ca2[_0xce6c('0x39')][_0xce6c('0x64')]+'%'};return _0x46a046;})});}_0x30c766=_[_0xce6c('0x88')]({},_0x30c766,_0x3e5ca2[_0xce6c('0xcc')]);return db[_0xce6c('0xa2')]['count']({'where':_0x30c766['where']})['then'](function(_0x289b44){_0x6c4894[_0xce6c('0x21')]=_0x289b44;if(_0x3e5ca2['query'][_0xce6c('0xd2')]){_0x30c766[_0xce6c('0xd3')]=[{'all':!![]}];}return db[_0xce6c('0xa2')][_0xce6c('0x99')](_0x30c766);})['then'](function(_0x36eedf){_0x6c4894[_0xce6c('0x92')]=_0x36eedf;return _0x6c4894;});}})['then'](respondWithFilteredResult(_0x1d05c4,_0x30c766))[_0xce6c('0x93')](handleError(_0x1d05c4,null));};exports['getHopperHistories']=function(_0x1feb09,_0x428980,_0x4027ed){var _0x3b29b7={'raw':!![],'where':{}};var _0xd09f61={};var _0x274a47={'count':0x0,'rows':[]};return db[_0xce6c('0x2e')][_0xce6c('0x34')]({'where':{'id':_0x1feb09[_0xce6c('0x94')]['id']}})[_0xce6c('0x28')](handleEntityNotFound(_0x428980,null))[_0xce6c('0x28')](function(_0x397d78){if(_0x397d78){_0xd09f61[_0xce6c('0x3b')]=_[_0xce6c('0x30')](db[_0xce6c('0xb3')][_0xce6c('0xca')]);_0xd09f61['query']=_[_0xce6c('0x30')](_0x1feb09[_0xce6c('0x39')]);_0xd09f61[_0xce6c('0x41')]=_['intersection'](_0xd09f61[_0xce6c('0x3b')],_0xd09f61[_0xce6c('0x39')]);_0x3b29b7[_0xce6c('0x3c')]=_[_0xce6c('0x3a')](_0xd09f61[_0xce6c('0x3b')],qs[_0xce6c('0x3d')](_0x1feb09[_0xce6c('0x39')]['fields']));_0x3b29b7[_0xce6c('0x3c')]=_0x3b29b7['attributes'][_0xce6c('0x55')]?_0x3b29b7[_0xce6c('0x3c')]:_0xd09f61[_0xce6c('0x3b')];if(!_0x1feb09[_0xce6c('0x39')][_0xce6c('0x3e')](_0xce6c('0xd0'))){_0x3b29b7[_0xce6c('0x20')]=qs[_0xce6c('0x20')](_0x1feb09[_0xce6c('0x39')]['limit']);_0x3b29b7[_0xce6c('0x1f')]=qs[_0xce6c('0x1f')](_0x1feb09[_0xce6c('0x39')][_0xce6c('0x1f')]);}_0x3b29b7[_0xce6c('0x3f')]=qs[_0xce6c('0xcb')](_0x1feb09[_0xce6c('0x39')]['sort']);_0x3b29b7[_0xce6c('0x40')]=qs['filters'](_[_0xce6c('0x42')](_0x1feb09[_0xce6c('0x39')],_0xd09f61[_0xce6c('0x41')]));_0x3b29b7[_0xce6c('0x40')]['ContactId']=_0x397d78['id'];if(_0x1feb09[_0xce6c('0x39')][_0xce6c('0x64')]){_0x3b29b7[_0xce6c('0x40')]=_[_0xce6c('0x88')](_0x3b29b7[_0xce6c('0x40')],{'$or':_[_0xce6c('0x59')](_0x3b29b7[_0xce6c('0x3c')],function(_0x4426f4){var _0x371067={};_0x371067[_0x4426f4]={'$like':'%'+_0x1feb09[_0xce6c('0x39')][_0xce6c('0x64')]+'%'};return _0x371067;})});}_0x3b29b7=_[_0xce6c('0x88')]({},_0x3b29b7,_0x1feb09[_0xce6c('0xcc')]);return db[_0xce6c('0xb3')][_0xce6c('0x21')]({'where':_0x3b29b7[_0xce6c('0x40')]})[_0xce6c('0x28')](function(_0x195a2a){_0x274a47[_0xce6c('0x21')]=_0x195a2a;if(_0x1feb09[_0xce6c('0x39')][_0xce6c('0xd2')]){_0x3b29b7[_0xce6c('0xd3')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3b29b7);})['then'](function(_0xc6d1c1){_0x274a47['rows']=_0xc6d1c1;return _0x274a47;});}})[_0xce6c('0x28')](respondWithFilteredResult(_0x428980,_0x3b29b7))['catch'](handleError(_0x428980,null));};exports[_0xce6c('0xd4')]=function(_0x3b3cd5,_0x325f80,_0x5a4ddb){var _0x5f0881={'raw':!![],'where':{}};var _0x2c9aec={};var _0x4a19b2={'count':0x0,'rows':[]};return db[_0xce6c('0x2e')][_0xce6c('0x34')]({'where':{'id':_0x3b3cd5[_0xce6c('0x94')]['id']}})['then'](handleEntityNotFound(_0x325f80,null))[_0xce6c('0x28')](function(_0x5f026d){if(_0x5f026d){_0x2c9aec[_0xce6c('0x3b')]=_[_0xce6c('0x30')](db[_0xce6c('0xb2')][_0xce6c('0xca')]);_0x2c9aec[_0xce6c('0x39')]=_['keys'](_0x3b3cd5[_0xce6c('0x39')]);_0x2c9aec[_0xce6c('0x41')]=_[_0xce6c('0x3a')](_0x2c9aec[_0xce6c('0x3b')],_0x2c9aec[_0xce6c('0x39')]);_0x5f0881[_0xce6c('0x3c')]=_[_0xce6c('0x3a')](_0x2c9aec[_0xce6c('0x3b')],qs[_0xce6c('0x3d')](_0x3b3cd5['query'][_0xce6c('0x3d')]));_0x5f0881['attributes']=_0x5f0881[_0xce6c('0x3c')]['length']?_0x5f0881[_0xce6c('0x3c')]:_0x2c9aec[_0xce6c('0x3b')];if(!_0x3b3cd5[_0xce6c('0x39')]['hasOwnProperty'](_0xce6c('0xd0'))){_0x5f0881[_0xce6c('0x20')]=qs['limit'](_0x3b3cd5[_0xce6c('0x39')]['limit']);_0x5f0881[_0xce6c('0x1f')]=qs[_0xce6c('0x1f')](_0x3b3cd5[_0xce6c('0x39')][_0xce6c('0x1f')]);}_0x5f0881[_0xce6c('0x3f')]=qs['sort'](_0x3b3cd5[_0xce6c('0x39')][_0xce6c('0xcb')]);_0x5f0881[_0xce6c('0x40')]=qs[_0xce6c('0x41')](_[_0xce6c('0x42')](_0x3b3cd5[_0xce6c('0x39')],_0x2c9aec[_0xce6c('0x41')]));_0x5f0881[_0xce6c('0x40')][_0xce6c('0xd1')]=_0x5f026d['id'];if(_0x3b3cd5[_0xce6c('0x39')][_0xce6c('0x64')]){_0x5f0881[_0xce6c('0x40')]=_[_0xce6c('0x88')](_0x5f0881[_0xce6c('0x40')],{'$or':_[_0xce6c('0x59')](_0x5f0881[_0xce6c('0x3c')],function(_0x1ed956){var _0x313696={};_0x313696[_0x1ed956]={'$like':'%'+_0x3b3cd5[_0xce6c('0x39')][_0xce6c('0x64')]+'%'};return _0x313696;})});}_0x5f0881=_[_0xce6c('0x88')]({},_0x5f0881,_0x3b3cd5['options']);return db[_0xce6c('0xb2')][_0xce6c('0x21')]({'where':_0x5f0881[_0xce6c('0x40')]})[_0xce6c('0x28')](function(_0x52036d){_0x4a19b2[_0xce6c('0x21')]=_0x52036d;if(_0x3b3cd5['query']['includeAll']){_0x5f0881[_0xce6c('0xd3')]=[{'all':!![]}];}return db[_0xce6c('0xb2')][_0xce6c('0x99')](_0x5f0881);})[_0xce6c('0x28')](function(_0x40892f){_0x4a19b2[_0xce6c('0x92')]=_0x40892f;return _0x4a19b2;});}})[_0xce6c('0x28')](respondWithFilteredResult(_0x325f80,_0x5f0881))['catch'](handleError(_0x325f80,null));};exports[_0xce6c('0xd5')]=function(_0x4de266,_0x5b092e,_0x711c8){var _0x3eaf6a={'raw':!![],'where':{}};var _0x1826a4={};var _0x75b002={'count':0x0,'rows':[]};return db[_0xce6c('0x2e')][_0xce6c('0x34')]({'where':{'id':_0x4de266[_0xce6c('0x94')]['id']}})[_0xce6c('0x28')](handleEntityNotFound(_0x5b092e,null))['then'](function(_0x32cc7f){if(_0x32cc7f){_0x1826a4['model']=_[_0xce6c('0x30')](db[_0xce6c('0xb9')]['rawAttributes']);_0x1826a4[_0xce6c('0x39')]=_[_0xce6c('0x30')](_0x4de266['query']);_0x1826a4[_0xce6c('0x41')]=_['intersection'](_0x1826a4[_0xce6c('0x3b')],_0x1826a4[_0xce6c('0x39')]);_0x3eaf6a['attributes']=_[_0xce6c('0x3a')](_0x1826a4[_0xce6c('0x3b')],qs[_0xce6c('0x3d')](_0x4de266['query'][_0xce6c('0x3d')]));_0x3eaf6a['attributes']=_0x3eaf6a['attributes'][_0xce6c('0x55')]?_0x3eaf6a[_0xce6c('0x3c')]:_0x1826a4[_0xce6c('0x3b')];if(!_0x4de266[_0xce6c('0x39')][_0xce6c('0x3e')](_0xce6c('0xd0'))){_0x3eaf6a['limit']=qs[_0xce6c('0x20')](_0x4de266['query'][_0xce6c('0x20')]);_0x3eaf6a[_0xce6c('0x1f')]=qs[_0xce6c('0x1f')](_0x4de266[_0xce6c('0x39')]['offset']);}_0x3eaf6a[_0xce6c('0x3f')]=qs['sort'](_0x4de266[_0xce6c('0x39')][_0xce6c('0xcb')]);_0x3eaf6a[_0xce6c('0x40')]=qs[_0xce6c('0x41')](_[_0xce6c('0x42')](_0x4de266[_0xce6c('0x39')],_0x1826a4[_0xce6c('0x41')]));_0x3eaf6a[_0xce6c('0x40')][_0xce6c('0xd1')]=_0x32cc7f['id'];if(_0x4de266[_0xce6c('0x39')]['filter']){_0x3eaf6a[_0xce6c('0x40')]=_[_0xce6c('0x88')](_0x3eaf6a['where'],{'$or':_[_0xce6c('0x59')](_0x3eaf6a[_0xce6c('0x3c')],function(_0x1f84da){var _0x327a75={};_0x327a75[_0x1f84da]={'$like':'%'+_0x4de266['query'][_0xce6c('0x64')]+'%'};return _0x327a75;})});}_0x3eaf6a=_['merge']({},_0x3eaf6a,_0x4de266['options']);return db[_0xce6c('0xb9')][_0xce6c('0x21')]({'where':_0x3eaf6a[_0xce6c('0x40')]})[_0xce6c('0x28')](function(_0x31c082){_0x75b002[_0xce6c('0x21')]=_0x31c082;if(_0x4de266[_0xce6c('0x39')][_0xce6c('0xd2')]){_0x3eaf6a[_0xce6c('0xd3')]=[{'all':!![]}];}return db[_0xce6c('0xb9')][_0xce6c('0x99')](_0x3eaf6a);})['then'](function(_0x1b4aec){_0x75b002[_0xce6c('0x92')]=_0x1b4aec;return _0x75b002;});}})[_0xce6c('0x28')](respondWithFilteredResult(_0x5b092e,_0x3eaf6a))[_0xce6c('0x93')](handleError(_0x5b092e,null));};exports['uploadCsv']=function(_0x43712f,_0x269a54,_0x44a570){try{if(!_0x43712f[_0xce6c('0x9c')][_0xce6c('0xbd')]){throw new Error('No\x20ListId\x20specified');}if(!_0x43712f[_0xce6c('0x9c')][_0xce6c('0xd6')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x43712f[_0xce6c('0x9c')][_0xce6c('0xd7')]){throw new Error(_0xce6c('0xd8'));}if(!_0x43712f[_0xce6c('0x9c')][_0xce6c('0xd9')]){throw new Error(_0xce6c('0xda'));}var _0x1fd96c=_0x43712f[_0xce6c('0x9c')][_0xce6c('0xd6')][_0xce6c('0x58')](',');var _0x2f2bc2=_0x43712f[_0xce6c('0x9c')][_0xce6c('0xd7')]['split'](',');if(!_0x1fd96c['length']||!_0x2f2bc2['length']||_0x1fd96c['length']!==_0x2f2bc2[_0xce6c('0x55')]){throw new Error(_0xce6c('0xdb'));}_0x43712f[_0xce6c('0x9c')][_0xce6c('0x3d')]=_['zipObject'](_0x1fd96c,_0x2f2bc2);if(!_0x43712f['body'][_0xce6c('0x3d')][_0xce6c('0xc8')]){throw new Error(_0xce6c('0xdc'));}if(!_0x43712f[_0xce6c('0x9c')][_0xce6c('0x3d')][_0xce6c('0xdd')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x1b52f3=path[_0xce6c('0x9f')](config[_0xce6c('0xde')],_0xce6c('0xdf'),_0x43712f[_0xce6c('0xe0')][_0xce6c('0xe1')]);fs['chmodSync'](_0x1b52f3,parseInt('0777',0x8));var _0x404e9a=require(_0xce6c('0xe2'))[_0xce6c('0xe3')](path[_0xce6c('0x9f')](__dirname,_0xce6c('0xe4')),[_0x1b52f3,_0x43712f['body'][_0xce6c('0xd6')],_0x43712f['body'][_0xce6c('0xd7')],_0x43712f[_0xce6c('0x9c')][_0xce6c('0xbd')],_0x43712f[_0xce6c('0x9c')][_0xce6c('0xe5')],_0x43712f[_0xce6c('0x9c')][_0xce6c('0xbc')],_0x43712f['body']['socket_timestamp']]);return _0x269a54[_0xce6c('0x1e')](0xc8)[_0xce6c('0x24')]({'message':'File\x20uploaded\x20correctly!','pid':_0x404e9a[_0xce6c('0xe6')]});}catch(_0x315651){return _0x269a54[_0xce6c('0x1e')](0x1f4)['send'](_0x315651);}};exports[_0xce6c('0xe7')]=function(_0x148b19,_0x3d9939,_0x4cc50b){var _0x107238=fs[_0xce6c('0xe8')](_0x148b19[_0xce6c('0xe0')][_0xce6c('0x7')]);Papa[_0xce6c('0xe9')](_0x107238,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x452aff){return _0x3d9939[_0xce6c('0x1e')](0xc8)[_0xce6c('0x24')]({'file':_0x148b19[_0xce6c('0xe0')],'fields':_0x452aff[_0xce6c('0xea')]['fields']});}});};exports[_0xce6c('0xeb')]=function(_0x1b4b4a,_0x3c2e9e,_0x5356d8){return db[_0xce6c('0x5b')][_0xce6c('0x99')]({'raw':!![],'attributes':['id'],'where':{'role':_0xce6c('0x81')}})[_0xce6c('0x28')](function(_0x4e58eb){var _0x40404a=![];if(!_0x1b4b4a[_0xce6c('0x9c')][_0xce6c('0xbd')]){throw new Error(_0xce6c('0xec'));}if(!_0x1b4b4a[_0xce6c('0x9c')][_0xce6c('0xed')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x1b4b4a[_0xce6c('0x9c')][_0xce6c('0xed')][_0xce6c('0xdd')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x1b4b4a['body'][_0xce6c('0xd9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x219470=require(_0xce6c('0xe2'))['fork'](path[_0xce6c('0x9f')](__dirname,_0xce6c('0xee')),[_0x1b4b4a['params']['id'],JSON[_0xce6c('0xef')](_0x1b4b4a[_0xce6c('0x9c')]),JSON[_0xce6c('0xef')](_0x4e58eb)]);_0x219470['on'](_0xce6c('0xf0'),function(_0x3b9613){_0x40404a=!![];return _0x3c2e9e[_0xce6c('0x1e')](0xc8)[_0xce6c('0x24')]({'message':_0xce6c('0xf1'),'pid':_0x219470['pid']});});_0x219470['on'](_0xce6c('0xf2'),function(_0x299bff){if(_0x299bff&&!_0x40404a){return _0x3c2e9e[_0xce6c('0x1e')](0x1f4)[_0xce6c('0x24')]({'message':'error\x20child\x20process','pid':_0x219470['pid']});}});})[_0xce6c('0x93')](handleError(_0x3c2e9e,null));};exports['getJourney']=function(_0x2963c3,_0x4a73d1){var _0x55bf74=[_0xce6c('0xf3'),_0xce6c('0xf4'),'sms','openchannel',_0xce6c('0xf5'),_0xce6c('0xf6'),'voice'];var _0x5e3f82={'offset':0x0,'order':qs['sort'](_0xce6c('0xf7'))},_0x1a7421={'count':0x0,'rows':[]};Promise['resolve']()[_0xce6c('0x28')](function(){if(_0x2963c3[_0xce6c('0x39')]['channel']){if(!_[_0xce6c('0xf8')](_0x55bf74,_0x2963c3['query']['channel'][_0xce6c('0xf9')]())){throw new Error(_0xce6c('0xfa'));}_0x55bf74=[_0x2963c3[_0xce6c('0x39')][_0xce6c('0xfb')][_0xce6c('0xf9')]()];}if(_0x2963c3[_0xce6c('0x39')][_0xce6c('0xfc')]){try{var _0x110148=JSON['parse'](_0x2963c3[_0xce6c('0x39')][_0xce6c('0xfc')]);if(!moment(_0x110148[_0xce6c('0x46')])['isValid']()){throw new Error(_0xce6c('0xfd'));}if(!moment(_0x110148['to'])[_0xce6c('0xfe')]()){throw new Error(_0xce6c('0xff'));}}catch(_0x1f89d8){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x2963c3[_0xce6c('0x39')][_0xce6c('0x3e')](_0xce6c('0xd0'))){_0x5e3f82['limit']=qs[_0xce6c('0x20')](_0x2963c3[_0xce6c('0x39')][_0xce6c('0x20')]||0xa);_0x5e3f82[_0xce6c('0x1f')]=qs['offset'](_0x2963c3[_0xce6c('0x39')][_0xce6c('0x1f')]);}var _0x359bc2=_0x55bf74['map'](function(_0x4a3ecc){if(_0x4a3ecc===_0xce6c('0x100')){var _0x49a89d={'attributes':['id',_0xce6c('0x101'),_0xce6c('0x38'),_0xce6c('0x102'),'destination',_0xce6c('0x103'),_0xce6c('0x104'),_0xce6c('0x105'),_0xce6c('0x106'),'note','createdAt',_0xce6c('0x107'),'userSecondDisposition',_0xce6c('0x108'),_0xce6c('0x109')],'where':{'ContactId':_0x2963c3[_0xce6c('0x94')]['id']},'include':[{'model':db[_0xce6c('0x5b')],'as':_0xce6c('0x5b'),'attributes':['id',_0xce6c('0x2c'),_0xce6c('0x10a'),_0xce6c('0x9a')]}],'order':[['createdAt',_0xce6c('0x7d')]]};if(_0x2963c3[_0xce6c('0x39')][_0xce6c('0xfc')]){_0x49a89d[_0xce6c('0x40')]['createdAt']={'$gte':_0x110148['from'],'$lte':_0x110148['to']};}return db[_0xce6c('0xb5')][_0xce6c('0x10b')](_0x49a89d)['then'](function(_0x6f1181){_0x1a7421[_0xce6c('0x21')]+=_0x6f1181['count'];return _[_0xce6c('0x59')](_0x6f1181[_0xce6c('0x92')],function(_0x7c908d){var _0xecf2dc=_0x7c908d['get']({'plain':!![]});_0xecf2dc[_0xce6c('0xfb')]=_0x4a3ecc;if(_0xecf2dc['User']){_0xecf2dc[_0xce6c('0x5b')]={'id':_0xecf2dc['User']['id'],'name':_0xecf2dc[_0xce6c('0x5b')][_0xce6c('0x2c')],'fullname':_0xecf2dc[_0xce6c('0x5b')][_0xce6c('0x10a')],'alias':_0xecf2dc[_0xce6c('0x5b')]['alias']};}return _0xecf2dc;});});}else{var _0x4dbb9f=_[_0xce6c('0x10c')](_0x4a3ecc)+(_0x4a3ecc===_0xce6c('0xf4')?_0xce6c('0x10d'):_0xce6c('0x10e'));var _0x4fed07={'attributes':['id',_0xce6c('0x10f'),_0xce6c('0x110'),_0xce6c('0x111'),_0xce6c('0x112'),_0xce6c('0x113'),_0xce6c('0x114'),_0xce6c('0x115'),_0xce6c('0x109'),_0x4dbb9f+'Id'],'where':{'ContactId':_0x2963c3[_0xce6c('0x94')]['id']},'include':[{'model':db[_0x4dbb9f],'as':_0xce6c('0x10e'),'attributes':['id',_0xce6c('0x2c'),_0xce6c('0x116')]},{'model':db[_0xce6c('0x5b')],'as':'Owner','attributes':['id','name','fullname']},{'model':db[_0xce6c('0x57')],'as':_0xce6c('0x91'),'attributes':['id',_0xce6c('0x2c'),_0xce6c('0x45')],'through':{'attributes':[]}}],'order':[['createdAt',_0xce6c('0x7d')]]};if(_0x2963c3[_0xce6c('0x39')][_0xce6c('0xfc')]){_0x4fed07[_0xce6c('0x40')]['createdAt']={'$gte':_0x110148['from'],'$lte':_0x110148['to']};}switch(_0x4a3ecc){case _0xce6c('0xf4'):_0x4fed07[_0xce6c('0x3c')]['push'](_0xce6c('0x117'),_0xce6c('0x118'),_0xce6c('0x119'),_0xce6c('0x11a'),_0xce6c('0x11b'),'ratingMessage',_0xce6c('0x11c'),_0xce6c('0x11d'),_0xce6c('0x11e'));break;case _0xce6c('0xf3'):_0x4fed07[_0xce6c('0x3c')][_0xce6c('0x33')](_0xce6c('0x11f'),_0xce6c('0x120'));break;case _0xce6c('0x121'):_0x4fed07[_0xce6c('0x3c')][_0xce6c('0x33')]('externalUrl','threadId');break;}return db[_[_0xce6c('0x10c')](_0x4a3ecc)+'Interaction'][_0xce6c('0x10b')](_0x4fed07)['then'](function(_0x507ae3){_0x1a7421[_0xce6c('0x21')]+=_0x507ae3[_0xce6c('0x21')];return _['map'](_0x507ae3[_0xce6c('0x92')],function(_0x3adfd2){var _0x5768a8=_0x3adfd2[_0xce6c('0x9d')]({'plain':!![]});_0x5768a8[_0xce6c('0xfb')]=_0x4a3ecc;if(_0x5768a8[_0xce6c('0x122')]){_0x5768a8[_0xce6c('0x122')]={'id':_0x5768a8[_0xce6c('0x122')]['id'],'name':_0x5768a8[_0xce6c('0x122')][_0xce6c('0x2c')],'fullname':_0x5768a8['Owner']['fullname']};}return _0x5768a8;});});}});return Promise[_0xce6c('0x36')](_0x359bc2);})[_0xce6c('0x28')](function(_0x11244a){return _(_0x11244a)['flatten']()['sortBy'](_0xce6c('0x111'))[_0xce6c('0x123')]()[_0xce6c('0x5d')]();})[_0xce6c('0x28')](function(_0x3a94af){_0x1a7421[_0xce6c('0x92')]=_0x5e3f82[_0xce6c('0x20')]?_0x3a94af[_0xce6c('0x124')](_0x5e3f82['offset'],_0x5e3f82['offset']+_0x5e3f82[_0xce6c('0x20')]):_0x3a94af;return _0x1a7421;})[_0xce6c('0x28')](respondWithFilteredResult(_0x4a73d1,_0x5e3f82))['catch'](handleError(_0x4a73d1,null));};
\ No newline at end of file
+var _0xed4b=['dateOfBirth','datetime','DATE','type','text','start','hasOwnProperty','filter','isNil','Contact','forEach','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','replace','split','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','clone','isEmpty','t.id\x20IN\x20?','resolve','user','agent','some','User','getLists','role','ListId','toString','sequelize','keyBy','merge','CmContact','c.phone','c.mobile','c.email','c.createdAt','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','destroy','params','tags','columnName','displayName','CmCustomField','findAll','alias','values','body','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappQueueReport','bulkCreate','duplicates','$or','show','get','$and','omit','cf_%d','pickBy','format','table','setFields','id\x20=\x20?','toParam','phone','CmHopper','rawAttributes','pick','options','getTags','ContactId','include','getHopperHistories','CmHopperHistory','includeAll','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','binding_keys','binding_values','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','parse','meta','import','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','sms','openchannel','fax','whatsapp','voice','channel','includes','toLowerCase','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','callerid','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','range','chat','browserName','customerPort','deviceModel','ratingType','referer','mail','substatus','externalUrl','flatten','sortBy','reverse','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','index','describe','keys','startsWith','push','findOne','trimStart','cf_','all','length','fieldType','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','select','field','color','from','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and'];(function(_0x4acb28,_0x137b1e){var _0x24f028=function(_0x170479){while(--_0x170479){_0x4acb28['push'](_0x4acb28['shift']());}};_0x24f028(++_0x137b1e);}(_0xed4b,0x1ef));var _0xbed4=function(_0x8c66b1,_0x2df327){_0x8c66b1=_0x8c66b1-0x0;var _0x6bb9d2=_0xed4b[_0x8c66b1];return _0x6bb9d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbed4('0x0'));var zipdir=require(_0xbed4('0x1'));var jsonpatch=require(_0xbed4('0x2'));var rp=require('request-promise');var moment=require(_0xbed4('0x3'));var BPromise=require(_0xbed4('0x4'));var Mustache=require(_0xbed4('0x5'));var util=require(_0xbed4('0x6'));var path=require('path');var sox=require(_0xbed4('0x7'));var csv=require('to-csv');var ejs=require(_0xbed4('0x8'));var fs=require('fs');var fs_extra=require(_0xbed4('0x9'));var _=require(_0xbed4('0xa'));var squel=require(_0xbed4('0xb'));var crypto=require(_0xbed4('0xc'));var jsforce=require(_0xbed4('0xd'));var deskjs=require(_0xbed4('0xe'));var toCsv=require(_0xbed4('0xf'));var querystring=require(_0xbed4('0x10'));var Papa=require(_0xbed4('0x11'));var Redis=require(_0xbed4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbed4('0x13'));var as=require(_0xbed4('0x14'));var hardwareService=require(_0xbed4('0x15'));var logger=require(_0xbed4('0x16'))(_0xbed4('0x17'));var utils=require(_0xbed4('0x18'));var config=require(_0xbed4('0x19'));var licenseUtil=require(_0xbed4('0x1a'));var db=require('../../mysqldb')['db'];config[_0xbed4('0x1b')]=_[_0xbed4('0x1c')](config[_0xbed4('0x1b')],{'host':_0xbed4('0x1d'),'port':0x18eb});var socket=require(_0xbed4('0x1e'))(new Redis(config[_0xbed4('0x1b')]));require('./cmContact.socket')[_0xbed4('0x1f')](socket);function respondWithStatusCode(_0x5841a1,_0x22af31){_0x22af31=_0x22af31||0xcc;return function(_0x1e5819){if(_0x1e5819){return _0x5841a1['sendStatus'](_0x22af31);}return _0x5841a1[_0xbed4('0x20')](_0x22af31)[_0xbed4('0x21')]();};}function respondWithResult(_0x9d4148,_0x38bdfc){_0x38bdfc=_0x38bdfc||0xc8;return function(_0x4134dc){if(_0x4134dc){return _0x9d4148[_0xbed4('0x20')](_0x38bdfc)[_0xbed4('0x22')](_0x4134dc);}};}function respondWithFilteredResult(_0x4ce4e6,_0x34a732){return function(_0x4b6353){if(_0x4b6353){var _0x112875=typeof _0x34a732[_0xbed4('0x23')]===_0xbed4('0x24')&&typeof _0x34a732[_0xbed4('0x25')]===_0xbed4('0x24');var _0x1cc568=_0x4b6353[_0xbed4('0x26')];var _0x36a709=_0x112875?0x0:_0x34a732['offset'];var _0x58da44=_0x112875?_0x4b6353[_0xbed4('0x26')]:_0x34a732['offset']+_0x34a732['limit'];var _0x1906ae;if(_0x58da44>=_0x1cc568){_0x58da44=_0x1cc568;_0x1906ae=0xc8;}else{_0x1906ae=0xce;}_0x4ce4e6[_0xbed4('0x20')](_0x1906ae);return _0x4ce4e6[_0xbed4('0x27')](_0xbed4('0x28'),_0x36a709+'-'+_0x58da44+'/'+_0x1cc568)['json'](_0x4b6353);}return null;};}function patchUpdates(_0x23afdd){return function(_0xc79258){try{jsonpatch[_0xbed4('0x29')](_0xc79258,_0x23afdd,!![]);}catch(_0x25b886){return BPromise[_0xbed4('0x2a')](_0x25b886);}return _0xc79258['save']();};}function saveUpdates(_0x47fcae,_0x534d44){return function(_0x593405){if(_0x593405){return _0x593405[_0xbed4('0x2b')](_0x47fcae)[_0xbed4('0x2c')](function(_0xa95a95){return _0xa95a95;});}return null;};}function removeEntity(_0xc65d6e,_0x3ac307){return function(_0x37b559){if(_0x37b559){return _0x37b559['destroy']()[_0xbed4('0x2c')](function(){_0xc65d6e[_0xbed4('0x20')](0xcc)[_0xbed4('0x21')]();});}};}function handleEntityNotFound(_0x1490bd,_0x2da8ed){return function(_0x3dcfb0){if(!_0x3dcfb0){_0x1490bd['sendStatus'](0x194);}return _0x3dcfb0;};}function handleError(_0x18c540,_0x1451f9){_0x1451f9=_0x1451f9||0x1f4;return function(_0x3a40e9){logger[_0xbed4('0x2d')](_0x3a40e9['stack']);if(_0x3a40e9[_0xbed4('0x2e')]){delete _0x3a40e9[_0xbed4('0x2e')];}_0x18c540[_0xbed4('0x20')](_0x1451f9)[_0xbed4('0x2f')](_0x3a40e9);};}exports[_0xbed4('0x30')]=function(_0x1c34cd,_0x4cd279){var _0x52938e={},_0x30f753={},_0x131e07={'count':0x0,'rows':[]};return db['CmContact'][_0xbed4('0x31')]()[_0xbed4('0x2c')](function(_0x33c14d){var _0x28d2ab=[];for(var _0x5a27b1=0x0;_0x5a27b1<Object[_0xbed4('0x32')](_0x33c14d)['length'];_0x5a27b1++){var _0xe050cd=Object[_0xbed4('0x32')](_0x33c14d)[_0x5a27b1];if(_[_0xbed4('0x33')](_0xe050cd,'cf_')){_0x28d2ab[_0xbed4('0x34')](db['CmCustomField'][_0xbed4('0x35')]({'where':{'id':_[_0xbed4('0x36')](_0xe050cd,_0xbed4('0x37'))},'raw':!![]}));}}return BPromise[_0xbed4('0x38')](_0x28d2ab)[_0xbed4('0x2c')](function(_0x348210){for(var _0x5833f8=0x0;_0x5833f8<_0x348210[_0xbed4('0x39')];_0x5833f8++){if(_0x348210[_0x5833f8]){var _0x480b97=_0xbed4('0x37')+_0x348210[_0x5833f8]['id'];var _0x1462d5=_0x33c14d[_0x480b97];_0x1462d5[_0xbed4('0x3a')]=_0x348210[_0x5833f8]['type'];}}return _0x33c14d;});})[_0xbed4('0x2c')](function(_0x357b05){_0x30f753[_0xbed4('0x3b')]=_[_0xbed4('0x32')](_0x357b05);_0x30f753['query']=_[_0xbed4('0x32')](_0x1c34cd[_0xbed4('0x3c')]);_0x30f753[_0xbed4('0x3d')]=_[_0xbed4('0x3e')](_0x30f753[_0xbed4('0x3b')],_0x30f753['query']);_0x52938e[_0xbed4('0x3f')]=_[_0xbed4('0x3e')](_0x30f753[_0xbed4('0x3b')],qs[_0xbed4('0x40')](_0x1c34cd[_0xbed4('0x3c')]['fields']));_0x52938e[_0xbed4('0x3f')]=_0x52938e[_0xbed4('0x3f')][_0xbed4('0x39')]?_0x52938e['attributes']:_0x30f753[_0xbed4('0x3b')];if(!_0x1c34cd[_0xbed4('0x3c')]['hasOwnProperty'](_0xbed4('0x41'))){_0x52938e['limit']=qs['limit'](_0x1c34cd[_0xbed4('0x3c')]['limit']);_0x52938e[_0xbed4('0x23')]=qs[_0xbed4('0x23')](_0x1c34cd[_0xbed4('0x3c')][_0xbed4('0x23')]);}_0x52938e[_0xbed4('0x42')]=qs[_0xbed4('0x43')](_0x1c34cd[_0xbed4('0x3c')][_0xbed4('0x43')]);_0x52938e[_0xbed4('0x44')]=qs[_0xbed4('0x3d')](_['pick'](_0x1c34cd['query'],_0x30f753[_0xbed4('0x3d')]),_0x357b05);var _0x4b039e=[];var _0x331710=squel[_0xbed4('0x45')]()['field']('id')[_0xbed4('0x46')](_0xbed4('0x2e'))[_0xbed4('0x46')](_0xbed4('0x47'))['from']('tools_tags');var _0x3bd294=squel['select']()[_0xbed4('0x48')](_0xbed4('0x49'),'c')[_0xbed4('0x4a')]('cm_user_has_contacts','uc',_0xbed4('0x4b'))[_0xbed4('0x4a')](_0xbed4('0x4c'),'ct',_0xbed4('0x4d'))['left_join'](_0xbed4('0x4e'),'t',_0xbed4('0x4f'))['where'](_0xbed4('0x50'));var _0x1d8007=squel[_0xbed4('0x51')]();var _0x3095f9=[];var _0x593115=squel[_0xbed4('0x51')]();var _0x2e1934;if(_0x1c34cd[_0xbed4('0x3c')][_0xbed4('0x52')]){_0x2e1934=as[_0xbed4('0x53')](_0x1c34cd[_0xbed4('0x3c')][_0xbed4('0x52')]);var _0x4e9f77=_0x2e1934[_0xbed4('0x54')];for(var _0xcfeed=0x0;_0xcfeed<_0x2e1934[_0xbed4('0x55')][_0xbed4('0x39')];_0xcfeed++){var _0x28e9d5=_0x2e1934[_0xbed4('0x55')][_0xcfeed];var _0x4d3580='c';var _0x11bb45=_(_0x357b05)[_0xbed4('0x32')]()[_0xbed4('0x56')](function(_0x53d462){return _0x53d462===_0x28e9d5[_0xbed4('0x46')];});if(_0x11bb45)_0x11bb45=_0x357b05[_0x28e9d5['field']];if(!_0x11bb45){if(_0x28e9d5[_0xbed4('0x46')]===_0xbed4('0x57')){var _0x573097=_0x28e9d5[_0xbed4('0x58')]['split'](',')[_0xbed4('0x59')](function(_0x135bac){return Number(_0x135bac);});_0x573097['forEach'](function(_0x36a9d0){_0x593115['or'](_0xbed4('0x5a'),'%,'+_0x36a9d0+',%');});_0x3095f9=_[_0xbed4('0x5b')](_0x3095f9,_0x573097);}else if(_0x28e9d5[_0xbed4('0x46')]==='User'){_0x1d8007[_0xbed4('0x5c')]('uc.UserId\x20=\x20?',_0x28e9d5[_0xbed4('0x58')]);}}else{if(_0x28e9d5[_0xbed4('0x46')]===_0xbed4('0x5d')||_0x11bb45[_0xbed4('0x3a')]===_0xbed4('0x5e'))_0x28e9d5['castTo']=_0xbed4('0x5f');var _0x5219a9=as['buildExpression'](_0x4d3580,_0x11bb45[_0xbed4('0x60')],_0x28e9d5);_0x1d8007[_0x4e9f77](_0x5219a9[_0xbed4('0x61')],_0x5219a9['value'][_0xbed4('0x62')],_0x5219a9[_0xbed4('0x58')][_0xbed4('0x21')]);}}}else{var _0x36dd31=_(Object[_0xbed4('0x32')](_0x1c34cd[_0xbed4('0x3c')]))[_0xbed4('0x59')](function(_0x2e1b84){return _0x357b05[_0xbed4('0x63')](_0x2e1b84)?_0x2e1b84:undefined;})[_0xbed4('0x64')](function(_0x144ea1){return!_[_0xbed4('0x65')](_0x144ea1);})['value']();if(_0x1c34cd[_0xbed4('0x3c')][_0xbed4('0x66')])_0x36dd31[_0xbed4('0x34')](_0xbed4('0x66'));if(!_['isEmpty'](_0x36dd31)){_0x36dd31[_0xbed4('0x67')](function(_0x403f8c){if(_0x403f8c==='ListId'){_0x3bd294[_0xbed4('0x44')](_0xbed4('0x68'),[][_0xbed4('0x69')](_0x1c34cd[_0xbed4('0x3c')][_0x403f8c]));}else if(_0x403f8c===_0xbed4('0x66')){var _0x13a91b='%'+_0x1c34cd[_0xbed4('0x3c')][_0x403f8c]+'%';_0x3bd294['where']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x13a91b);}else{_0x3bd294[_0xbed4('0x44')]('c.'+_0x403f8c+_0xbed4('0x6a'),_0x1c34cd[_0xbed4('0x3c')][_0x403f8c]);}});}if(_0x1c34cd[_0xbed4('0x3c')][_0xbed4('0x6b')]){_0x3095f9=_[_0xbed4('0x6c')](_0x1c34cd[_0xbed4('0x3c')][_0xbed4('0x6b')])?_0x1c34cd['query']['tag']:new Array(_0x1c34cd[_0xbed4('0x3c')]['tag']);_0x3095f9['forEach'](function(_0x2d2c15){_0x593115['or'](_0xbed4('0x5a'),'%,'+_0x2d2c15+',%');});}if(_0x1c34cd['query'][_0xbed4('0x64')]){var _0x317a7f=_0x1c34cd[_0xbed4('0x3c')][_0xbed4('0x64')][_0xbed4('0x6d')]('\x5c','\x5c\x5c')[_0xbed4('0x6d')](/'/g,'\x27\x27');if(_0x317a7f[_0xbed4('0x6e')]('\x20')[_0xbed4('0x39')]>0x1){_0x1d8007['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbed4('0x6f')](_0x317a7f),null);}else{if(qs[_0xbed4('0x70')](_0x317a7f)){_0x1d8007['or'](_0xbed4('0x71'),_0x317a7f+'%');_0x1d8007['or'](_0xbed4('0x72'),_0x317a7f+'%');_0x1d8007['or']('c.mobile\x20LIKE\x20?',_0x317a7f+'%');_0x1d8007['or'](_0xbed4('0x73'),_0x317a7f+'%');}else if(qs[_0xbed4('0x74')](_0x317a7f)){_0x1d8007['or'](_0xbed4('0x75'),_0x317a7f+'%');}else{_0x1d8007['or'](_0xbed4('0x76'),'%'+_0x317a7f+'%');_0x1d8007['or'](_0xbed4('0x77'),'%'+_0x317a7f+'%');_0x1d8007['or'](_0xbed4('0x75'),'%'+_0x317a7f+'%');}}}}_0x3bd294[_0xbed4('0x44')](_0x1d8007);_0x3bd294[_0xbed4('0x78')](_0xbed4('0x79'));var _0x45f7e3={'type':db[_0xbed4('0x7a')][_0xbed4('0x7b')]['SELECT'],'raw':!![]};var _0x1aca6b=_0x3bd294[_0xbed4('0x7c')]()['field']('c.id');if(_0x52938e['order']){_0x52938e['order'][_0xbed4('0x67')](function(_0x5ec9c4){_0x3bd294[_0xbed4('0x42')]('c.'+_0x5ec9c4[0x0],_0x5ec9c4[0x1]==='DESC'?![]:!![]);});}if(!_[_0xbed4('0x7d')](_0x3095f9)){_0x3bd294['having'](_0x593115);_0x1aca6b[_0xbed4('0x44')](_0xbed4('0x7e'),_0x3095f9);}BPromise[_0xbed4('0x7f')]()[_0xbed4('0x2c')](function(){if(!_0x2e1934)return;if(_0x1c34cd[_0xbed4('0x80')]['role']!==_0xbed4('0x81'))return;if(!_[_0xbed4('0x82')](_0x2e1934[_0xbed4('0x55')],['field',_0xbed4('0x83')])){return _0x1c34cd[_0xbed4('0x80')][_0xbed4('0x84')]({'attributes':['id'],'raw':!![]})['then'](function(_0x28b736){if(_[_0xbed4('0x7d')](_0x28b736)){_0x1aca6b['where']('c.ListId\x20IS\x20NULL');_0x3bd294[_0xbed4('0x44')]('c.ListId\x20IS\x20NULL');}else{_0x1aca6b['where'](_0xbed4('0x68'),_['map'](_0x28b736,'id'));_0x3bd294['where']('c.ListId\x20IN\x20?',_['map'](_0x28b736,'id'));}});}})[_0xbed4('0x2c')](function(){if(_0x1c34cd[_0xbed4('0x80')][_0xbed4('0x85')]===_0xbed4('0x81')&&!_0x2e1934&&!_0x1c34cd[_0xbed4('0x3c')][_0xbed4('0x86')])return[];return db['sequelize'][_0xbed4('0x3c')](_0x1aca6b[_0xbed4('0x87')](),_0x45f7e3);})[_0xbed4('0x2c')](function(_0x4cf84f){_0x131e07[_0xbed4('0x26')]=_0x4cf84f['length'];if(_0x131e07[_0xbed4('0x26')]===0x0)return[];return db[_0xbed4('0x88')]['query'](_0x331710[_0xbed4('0x87')](),_0x45f7e3)[_0xbed4('0x2c')](function(_0x5bba45){_0x4b039e=_[_0xbed4('0x89')](_0x5bba45,'id');_0x45f7e3=_[_0xbed4('0x8a')](_0x45f7e3,{'model':db[_0xbed4('0x8b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1c34cd[_0xbed4('0x3c')][_0xbed4('0x40')]){_0x52938e[_0xbed4('0x3f')]['forEach'](function(_0xda3f36){_0x3bd294[_0xbed4('0x46')]('c.'+_0xda3f36);});}else{_0x3bd294[_0xbed4('0x46')](_0xbed4('0x79'));_0x3bd294['field']('c.firstName');_0x3bd294[_0xbed4('0x46')]('c.lastName');_0x3bd294[_0xbed4('0x46')](_0xbed4('0x8c'));_0x3bd294[_0xbed4('0x46')](_0xbed4('0x8d'));_0x3bd294['field']('c.fax');_0x3bd294[_0xbed4('0x46')](_0xbed4('0x8e'));_0x3bd294['field']('c.ListId');_0x3bd294[_0xbed4('0x46')](_0xbed4('0x8f'));_0x3bd294[_0xbed4('0x46')](_0xbed4('0x90'));_0x3bd294[_0xbed4('0x46')]('c.CompanyId');_0x3bd294[_0xbed4('0x46')](_0xbed4('0x91'),_0xbed4('0x92'));}if(_0x52938e[_0xbed4('0x25')])_0x3bd294[_0xbed4('0x25')](_0x52938e['limit']);if(_0x52938e['offset'])_0x3bd294[_0xbed4('0x23')](_0x52938e[_0xbed4('0x23')]);return db[_0xbed4('0x88')][_0xbed4('0x3c')](_0x3bd294['toString'](),_0x45f7e3);});})['then'](function(_0x2d40ef){_0x2d40ef['forEach'](function(_0x4f4a53){if(_0x4f4a53[_0xbed4('0x92')]){_0x4f4a53[_0xbed4('0x93')]=[];_0x4f4a53['TagIds'][_0xbed4('0x6e')](',')[_0xbed4('0x67')](function(_0x3c80e8){_0x4f4a53[_0xbed4('0x93')][_0xbed4('0x34')](_0x4b039e[_0x3c80e8]);});}delete _0x4f4a53[_0xbed4('0x92')];});_0x131e07[_0xbed4('0x94')]=_0x2d40ef;return _0x131e07;})[_0xbed4('0x2c')](respondWithFilteredResult(_0x4cd279,_0x52938e));})[_0xbed4('0x95')](handleError(_0x4cd279,null));};exports[_0xbed4('0x96')]=function(_0x1fd704,_0x3d5459){return db[_0xbed4('0x8b')][_0xbed4('0x56')]({'where':{'id':_0x1fd704[_0xbed4('0x97')]['id']}})['then'](handleEntityNotFound(_0x3d5459,null))['then'](removeEntity(_0x3d5459,null))[_0xbed4('0x95')](handleError(_0x3d5459,null));};exports[_0xbed4('0x31')]=function(_0x4d6ed5,_0x27b347){return db[_0xbed4('0x8b')]['describe']()[_0xbed4('0x2c')](function(_0x539e81){delete _0x539e81[_0xbed4('0x98')];for(var _0x37a59b=0x0;_0x37a59b<Object[_0xbed4('0x32')](_0x539e81)['length'];_0x37a59b++){var _0xb05f00=Object['keys'](_0x539e81)[_0x37a59b];if(!_[_0xbed4('0x33')](_0xb05f00,_0xbed4('0x37'))){_0x539e81[_0xb05f00][_0xbed4('0x99')]=_0xb05f00;_0x539e81[_0xb05f00][_0xbed4('0x9a')]=_0xb05f00;}}return _0x539e81;})['then'](function(_0xcd1d9d){var _0x2e920c={'where':{'$or':[{'ListId':_0x4d6ed5[_0xbed4('0x3c')]['id']},{'ListId':null}]},'raw':!![]};return db[_0xbed4('0x9b')][_0xbed4('0x9c')](_0x2e920c)[_0xbed4('0x2c')](function(_0x1c1fa7){for(var _0x19925a=0x0;_0x19925a<_0x1c1fa7['length'];_0x19925a++){var _0x3444c7=_0xbed4('0x37')+_0x1c1fa7[_0x19925a]['id'];_0xcd1d9d[_0x3444c7][_0xbed4('0x99')]=_0x3444c7;_0xcd1d9d[_0x3444c7][_0xbed4('0x9a')]=_0x1c1fa7[_0x19925a][_0xbed4('0x9d')];_0xcd1d9d[_0x3444c7]['custom']={'type':_0x1c1fa7[_0x19925a]['type'],'values':_0x1c1fa7[_0x19925a][_0xbed4('0x9e')]};}Object['keys'](_0xcd1d9d)['forEach'](function(_0x175db7){if(!_0xcd1d9d[_0x175db7][_0xbed4('0x63')](_0xbed4('0x99'))){delete _0xcd1d9d[_0x175db7];}});return _0xcd1d9d;});})[_0xbed4('0x2c')](respondWithResult(_0x27b347,null))[_0xbed4('0x95')](handleError(_0x27b347,null));};exports[_0xbed4('0x8a')]=function(_0x2ebd5e,_0x44518f){var _0x45613f;var _0xd4f629;var _0x270950;if(_0x2ebd5e[_0xbed4('0x9f')]['id']){delete _0x2ebd5e[_0xbed4('0x9f')]['id'];}return db[_0xbed4('0x8b')][_0xbed4('0x9c')]({'where':{'id':[_0x2ebd5e['body']['to'],_0x2ebd5e[_0xbed4('0x9f')][_0xbed4('0x48')]]}})[_0xbed4('0x2c')](function(_0x568e50){if(_0x568e50){if(_0x568e50[_0xbed4('0x39')]!==0x2){return null;}_0x568e50[0x0]=_0x568e50[0x0]['get']({'plain':!![]});_0x568e50[0x1]=_0x568e50[0x1]['get']({'plain':!![]});delete _0x568e50[0x0]['id'];delete _0x568e50[0x1]['id'];return _[_0xbed4('0xa0')](_0x568e50[0x0],_0x568e50[0x1],function(_0xcee7c4,_0x8827f1){if(Array[_0xbed4('0x6c')](_0x8827f1)&&!_0x8827f1['length']){return _0xcee7c4;}else if(!_0x8827f1){return _0xcee7c4;}});}})['then'](handleEntityNotFound(_0x44518f,null))[_0xbed4('0x2c')](function(_0x499b40){if(_0x499b40){if(_0x499b40['tags']&&_['isArray'](_0x499b40[_0xbed4('0x98')])){_0x499b40[_0xbed4('0x98')]=_0x499b40['tags'][_0xbed4('0xa1')]();}logger[_0xbed4('0xa2')](_0xbed4('0xa3'),_0x2ebd5e[_0xbed4('0x9f')]['to'],_0x2ebd5e[_0xbed4('0x9f')][_0xbed4('0x48')]);return db['CmHopper'][_0xbed4('0x96')]({'where':{'ContactId':[_0x2ebd5e[_0xbed4('0x9f')]['to'],_0x2ebd5e[_0xbed4('0x9f')][_0xbed4('0x48')]]}})[_0xbed4('0x2c')](function(_0x10891d){logger[_0xbed4('0xa2')](_0xbed4('0xa4'),_0x10891d);return db[_0xbed4('0xa5')][_0xbed4('0x96')]({'where':{'ContactId':[_0x2ebd5e[_0xbed4('0x9f')]['to'],_0x2ebd5e['body']['from']]}})['then'](function(_0x466126){logger[_0xbed4('0xa2')](_0xbed4('0xa6'),_0x466126);return db['CmContact'][_0xbed4('0xa7')](_0x499b40);});});}})[_0xbed4('0x2c')](function(_0x216573){if(_0x216573){_0x45613f=_0x216573;_0xd4f629={'ContactId':_0x45613f['id']};_0x270950={'where':{'ContactId':[_0x2ebd5e[_0xbed4('0x9f')]['to'],_0x2ebd5e[_0xbed4('0x9f')][_0xbed4('0x48')]]}};return db[_0xbed4('0xa8')][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xa9')][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xaa')][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})['then'](function(){if(_0x45613f){return db[_0xbed4('0xab')][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xac')][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xab')]['update'](_0xd4f629,_0x270950);}})['then'](function(){if(_0x45613f){return db[_0xbed4('0xac')]['update'](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xad')][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db['SmsMessage'][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})['then'](function(){if(_0x45613f){return db[_0xbed4('0xae')][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xaf')][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})['then'](function(){if(_0x45613f){return db['OpenchannelInteraction']['update'](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db['OpenchannelMessage'][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db['CmHopperFinal'][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db['CmHopperHistory'][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xb0')][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xb1')]['update'](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xb2')][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xb3')][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db['MailQueueReport'][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xb4')]['update'](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xb5')]['update'](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xb6')]['update'](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db['WhatsappInteraction'][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db['WhatsappMessage'][_0xbed4('0x2b')](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0xb7')]['update'](_0xd4f629,_0x270950);}})[_0xbed4('0x2c')](function(){if(_0x45613f){return db[_0xbed4('0x8b')]['destroy']({'where':{'id':[_0x2ebd5e[_0xbed4('0x9f')]['to'],_0x2ebd5e[_0xbed4('0x9f')][_0xbed4('0x48')]]}});}})[_0xbed4('0x2c')](function(){if(_0x45613f){return _0x45613f;}})[_0xbed4('0x2c')](respondWithResult(_0x44518f,null))[_0xbed4('0x95')](handleError(_0x44518f,null));};exports[_0xbed4('0xa7')]=function(_0x442e42,_0xfe9942){return db['CmContact'][_0xbed4('0x31')]()['then'](function(_0x1546c2){if(_0x442e42[_0xbed4('0x9f')][_0xbed4('0x98')]&&_[_0xbed4('0x6c')](_0x442e42['body'][_0xbed4('0x98')])){if(_0x442e42[_0xbed4('0x9f')]['tags']['length']){_0x442e42['body'][_0xbed4('0x98')]=_0x442e42['body'][_0xbed4('0x98')]['join'](';')+';';}else{_0x442e42[_0xbed4('0x9f')]['tags']=null;}}else{_0x442e42['body']['tags']=null;}return db[_0xbed4('0x8b')]['create'](_0x442e42['body'],{'fields':_[_0xbed4('0x32')](_0x1546c2),'raw':!![]});})['then'](respondWithResult(_0xfe9942,0xc9))[_0xbed4('0x95')](handleError(_0xfe9942,null));};exports[_0xbed4('0xb8')]=function(_0x565a32,_0x3d4463){var _0x25e81b=[];var _0x176cf0=0x0;var _0x215ad8=0x0;var _0x5206d8=0x0;return db[_0xbed4('0x8b')][_0xbed4('0x31')]()[_0xbed4('0x2c')](function(_0x814f7e){return BPromise['each'](_0x565a32[_0xbed4('0x9f')],function(_0x31fe4c){var _0x4d6584={'where':{'$or':[]},'defaults':_0x31fe4c,'fields':_['keys'](_0x814f7e),'raw':!![]};if(_0x31fe4c[_0xbed4('0xb9')]){for(var _0x8cf167=0x0;_0x8cf167<_0x31fe4c[_0xbed4('0xb9')][_0xbed4('0x39')];_0x8cf167++){var _0xb154b8={};_0xb154b8[_0x31fe4c[_0xbed4('0xb9')][_0x8cf167]]=_0x31fe4c[_0x31fe4c['duplicates'][_0x8cf167]];_0x4d6584['where'][_0xbed4('0xba')][_0xbed4('0x34')](_0xb154b8);}_0x4d6584[_0xbed4('0x44')][_0xbed4('0x86')]=_0x31fe4c[_0xbed4('0x86')];}return db['CmContact']['findOrCreate'](_0x4d6584)['spread'](function(_0x448ee3,_0x39919b){if(_0x39919b){_0x176cf0++;}else{_0x5206d8++;}})[_0xbed4('0x95')](function(_0x503de6){console[_0xbed4('0x2d')](_0x503de6);_0x215ad8++;});});})[_0xbed4('0x2c')](function(_0x51f5bf){if(_0x51f5bf){return{'success':_0x176cf0,'failure':_0x215ad8,'duplicates':_0x5206d8};}})[_0xbed4('0x2c')](respondWithResult(_0x3d4463,0xc9))[_0xbed4('0x95')](handleError(_0x3d4463,null));};exports[_0xbed4('0xbb')]=function(_0x4f06db,_0x2f0756,_0x55681f){var _0x348d19;return db['CmContact']['describe']()['then'](function(_0x1d4f04){return db[_0xbed4('0x8b')][_0xbed4('0x56')]({'where':{'id':_0x4f06db[_0xbed4('0x97')]['id']},'include':[{'model':db[_0xbed4('0x57')],'as':_0xbed4('0x93'),'attributes':['id',_0xbed4('0x2e'),_0xbed4('0x47')],'required':_0x4f06db[_0xbed4('0x3c')][_0xbed4('0x6b')]?!![]:![]}],'attributes':_[_0xbed4('0x32')](_0x1d4f04)});})[_0xbed4('0x2c')](function(_0x6e714){_0x348d19=_0x6e714[_0xbed4('0xbc')]({'plain':!![]});var _0x1bc8d8={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x6e714&&_0x6e714[_0xbed4('0x86')]){if(_0x6e714[_0xbed4('0x86')]){_0x1bc8d8[_0xbed4('0x44')][_0xbed4('0xbd')][_0xbed4('0x34')]({'ListId':{'$ne':_0x6e714['ListId']}});}}return db[_0xbed4('0x9b')]['findAll'](_0x1bc8d8);})['then'](function(_0x1fb2b0){return _[_0xbed4('0xbe')](_0x348d19,_[_0xbed4('0x59')](_0x1fb2b0,function(_0x494e9b){return util['format'](_0xbed4('0xbf'),_0x494e9b['id']);}));})['then'](handleEntityNotFound(_0x2f0756,null))[_0xbed4('0x2c')](respondWithResult(_0x2f0756,null))[_0xbed4('0x95')](handleError(_0x2f0756,null));};exports[_0xbed4('0x2b')]=function(_0xe6d4c7,_0x2875ea){var _0x12eafb;if(_0xe6d4c7[_0xbed4('0x9f')]['id']){delete _0xe6d4c7[_0xbed4('0x9f')]['id'];}return db['CmContact'][_0xbed4('0x56')]({'where':{'id':_0xe6d4c7[_0xbed4('0x97')]['id']}})[_0xbed4('0x2c')](handleEntityNotFound(_0x2875ea,null))[_0xbed4('0x2c')](saveUpdates(_0xe6d4c7[_0xbed4('0x9f')],null))[_0xbed4('0x2c')](function(_0x7017c0){_0x12eafb=_0x7017c0;var _0x503974={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x7017c0&&_0x7017c0[_0xbed4('0x86')]){if(_0x7017c0['ListId']){_0x503974[_0xbed4('0x44')][_0xbed4('0xbd')][_0xbed4('0x34')]({'ListId':{'$ne':_0x7017c0[_0xbed4('0x86')]}});}}return db['CmCustomField'][_0xbed4('0x9c')](_0x503974);})[_0xbed4('0x2c')](function(_0x238bd9){if(_0x238bd9){return _['omit'](_[_0xbed4('0xc0')](_0xe6d4c7[_0xbed4('0x9f')],function(_0x5bbf54,_0x3bd25d){return _[_0xbed4('0x33')](_0x3bd25d,_0xbed4('0x37'));}),_[_0xbed4('0x59')](_0x238bd9,function(_0x36c8c8){return util[_0xbed4('0xc1')](_0xbed4('0xbf'),_0x36c8c8['id']);}));}})['then'](function(_0x129337){if(_0x129337&&!_['isEmpty'](_0x129337)){var _0x18f3dd=squel[_0xbed4('0x2b')]()[_0xbed4('0xc2')](_0xbed4('0x49'))[_0xbed4('0xc3')](_0x129337)[_0xbed4('0x44')](_0xbed4('0xc4'),_0xe6d4c7[_0xbed4('0x97')]['id'])[_0xbed4('0xc5')]();return db['sequelize'][_0xbed4('0x3c')](_0x18f3dd[_0xbed4('0x61')],{'replacements':_0x18f3dd['values']});}})[_0xbed4('0x2c')](function(){if(_0xe6d4c7['body'][_0xbed4('0xc6')]&&_0x12eafb){return db[_0xbed4('0xc7')][_0xbed4('0x2b')]({'phone':_0xe6d4c7['body'][_0xbed4('0xc6')]},{'where':{'ContactId':_0x12eafb['id']}});}})['then'](function(){return _0x12eafb;})['then'](respondWithResult(_0x2875ea,null))['catch'](handleError(_0x2875ea,null));};exports['getTags']=function(_0x59a25f,_0x5ed769,_0x347824){var _0x5383f6={};var _0x48d8e1={};var _0x4b5cbf;var _0x1088df;return db[_0xbed4('0x8b')][_0xbed4('0x35')]({'where':{'id':_0x59a25f['params']['id']}})[_0xbed4('0x2c')](handleEntityNotFound(_0x5ed769,null))[_0xbed4('0x2c')](function(_0x4353cf){if(_0x4353cf){_0x4b5cbf=_0x4353cf;_0x48d8e1['model']=_[_0xbed4('0x32')](db[_0xbed4('0x57')][_0xbed4('0xc8')]);_0x48d8e1[_0xbed4('0x3c')]=_[_0xbed4('0x32')](_0x59a25f['query']);_0x48d8e1[_0xbed4('0x3d')]=_[_0xbed4('0x3e')](_0x48d8e1['model'],_0x48d8e1[_0xbed4('0x3c')]);_0x5383f6[_0xbed4('0x3f')]=_['intersection'](_0x48d8e1[_0xbed4('0x3b')],qs['fields'](_0x59a25f[_0xbed4('0x3c')][_0xbed4('0x40')]));_0x5383f6['attributes']=_0x5383f6[_0xbed4('0x3f')][_0xbed4('0x39')]?_0x5383f6['attributes']:_0x48d8e1[_0xbed4('0x3b')];_0x5383f6['order']=qs['sort'](_0x59a25f[_0xbed4('0x3c')][_0xbed4('0x43')]);_0x5383f6[_0xbed4('0x44')]=qs['filters'](_[_0xbed4('0xc9')](_0x59a25f[_0xbed4('0x3c')],_0x48d8e1[_0xbed4('0x3d')]));if(_0x59a25f['query'][_0xbed4('0x64')]){_0x5383f6[_0xbed4('0x44')]=_['merge'](_0x5383f6[_0xbed4('0x44')],{'$or':_['map'](_0x5383f6[_0xbed4('0x3f')],function(_0x6312d1){var _0x67ece={};_0x67ece[_0x6312d1]={'$like':'%'+_0x59a25f['query'][_0xbed4('0x64')]+'%'};return _0x67ece;})});}_0x5383f6=_[_0xbed4('0x8a')]({},_0x5383f6,_0x59a25f[_0xbed4('0xca')]);return _0x4b5cbf[_0xbed4('0xcb')](_0x5383f6);}})['then'](function(_0x20bc6b){if(_0x20bc6b){_0x1088df=_0x20bc6b['length'];if(!_0x59a25f[_0xbed4('0x3c')][_0xbed4('0x63')](_0xbed4('0x41'))){_0x5383f6[_0xbed4('0x25')]=qs[_0xbed4('0x25')](_0x59a25f[_0xbed4('0x3c')][_0xbed4('0x25')]);_0x5383f6[_0xbed4('0x23')]=qs['offset'](_0x59a25f[_0xbed4('0x3c')][_0xbed4('0x23')]);}return _0x4b5cbf[_0xbed4('0xcb')](_0x5383f6);}})[_0xbed4('0x2c')](function(_0x4dc103){if(_0x4dc103){return _0x4dc103?{'count':_0x1088df,'rows':_0x4dc103}:null;}})[_0xbed4('0x2c')](respondWithResult(_0x5ed769,null))[_0xbed4('0x95')](handleError(_0x5ed769,null));};exports['setTags']=function(_0x60d629,_0xe0bf75,_0x130d0e){if(_0x60d629[_0xbed4('0x9f')]['id']){delete _0x60d629[_0xbed4('0x9f')]['id'];}return db[_0xbed4('0x8b')][_0xbed4('0x35')]({'where':{'id':_0x60d629[_0xbed4('0x97')]['id']}})['then'](handleEntityNotFound(_0xe0bf75,null))['then'](function(_0x22b0f9){if(_0x22b0f9){return _0x22b0f9['setTags'](_0x60d629[_0xbed4('0x9f')]['ids']||[]);}return null;})[_0xbed4('0x2c')](respondWithResult(_0xe0bf75,null))[_0xbed4('0x95')](handleError(_0xe0bf75,null));};exports['getHoppers']=function(_0x13e47d,_0x2ef6e3,_0xf58e11){var _0x58c6a0={'raw':![],'where':{}};var _0x550571={};var _0x4def49={'count':0x0,'rows':[]};return db['CmContact'][_0xbed4('0x35')]({'where':{'id':_0x13e47d[_0xbed4('0x97')]['id']}})['then'](handleEntityNotFound(_0x2ef6e3,null))[_0xbed4('0x2c')](function(_0x3aff24){if(_0x3aff24){_0x550571[_0xbed4('0x3b')]=_[_0xbed4('0x32')](db[_0xbed4('0xc7')][_0xbed4('0xc8')]);_0x550571[_0xbed4('0x3c')]=_[_0xbed4('0x32')](_0x13e47d[_0xbed4('0x3c')]);_0x550571['filters']=_[_0xbed4('0x3e')](_0x550571['model'],_0x550571[_0xbed4('0x3c')]);_0x58c6a0[_0xbed4('0x3f')]=_[_0xbed4('0x3e')](_0x550571[_0xbed4('0x3b')],qs[_0xbed4('0x40')](_0x13e47d[_0xbed4('0x3c')][_0xbed4('0x40')]));_0x58c6a0[_0xbed4('0x3f')]=_0x58c6a0[_0xbed4('0x3f')][_0xbed4('0x39')]?_0x58c6a0[_0xbed4('0x3f')]:_0x550571[_0xbed4('0x3b')];if(!_0x13e47d['query']['hasOwnProperty'](_0xbed4('0x41'))){_0x58c6a0[_0xbed4('0x25')]=qs[_0xbed4('0x25')](_0x13e47d[_0xbed4('0x3c')][_0xbed4('0x25')]);_0x58c6a0[_0xbed4('0x23')]=qs[_0xbed4('0x23')](_0x13e47d[_0xbed4('0x3c')][_0xbed4('0x23')]);}_0x58c6a0[_0xbed4('0x42')]=qs[_0xbed4('0x43')](_0x13e47d[_0xbed4('0x3c')]['sort']);_0x58c6a0[_0xbed4('0x44')]=qs[_0xbed4('0x3d')](_['pick'](_0x13e47d[_0xbed4('0x3c')],_0x550571['filters']));_0x58c6a0[_0xbed4('0x44')][_0xbed4('0xcc')]=_0x3aff24['id'];if(_0x13e47d['query'][_0xbed4('0x64')]){_0x58c6a0[_0xbed4('0x44')]=_['merge'](_0x58c6a0[_0xbed4('0x44')],{'$or':_[_0xbed4('0x59')](_0x58c6a0['attributes'],function(_0x1c8e5b){var _0x35b658={};_0x35b658[_0x1c8e5b]={'$like':'%'+_0x13e47d[_0xbed4('0x3c')][_0xbed4('0x64')]+'%'};return _0x35b658;})});}_0x58c6a0=_['merge']({},_0x58c6a0,_0x13e47d[_0xbed4('0xca')]);return db[_0xbed4('0xc7')][_0xbed4('0x26')]({'where':_0x58c6a0[_0xbed4('0x44')]})[_0xbed4('0x2c')](function(_0x5d193a){_0x4def49[_0xbed4('0x26')]=_0x5d193a;if(_0x13e47d[_0xbed4('0x3c')]['includeAll']){_0x58c6a0[_0xbed4('0xcd')]=[{'all':!![]}];}return db[_0xbed4('0xc7')][_0xbed4('0x9c')](_0x58c6a0);})[_0xbed4('0x2c')](function(_0x313871){_0x4def49[_0xbed4('0x94')]=_0x313871;return _0x4def49;});}})[_0xbed4('0x2c')](respondWithFilteredResult(_0x2ef6e3,_0x58c6a0))[_0xbed4('0x95')](handleError(_0x2ef6e3,null));};exports[_0xbed4('0xce')]=function(_0xf353f8,_0xa9c6f5,_0x7ecc39){var _0x486349={'raw':!![],'where':{}};var _0x4211b3={};var _0x5222d7={'count':0x0,'rows':[]};return db[_0xbed4('0x8b')][_0xbed4('0x35')]({'where':{'id':_0xf353f8['params']['id']}})['then'](handleEntityNotFound(_0xa9c6f5,null))['then'](function(_0x2d7537){if(_0x2d7537){_0x4211b3[_0xbed4('0x3b')]=_[_0xbed4('0x32')](db[_0xbed4('0xcf')]['rawAttributes']);_0x4211b3['query']=_['keys'](_0xf353f8[_0xbed4('0x3c')]);_0x4211b3['filters']=_[_0xbed4('0x3e')](_0x4211b3[_0xbed4('0x3b')],_0x4211b3[_0xbed4('0x3c')]);_0x486349['attributes']=_[_0xbed4('0x3e')](_0x4211b3[_0xbed4('0x3b')],qs[_0xbed4('0x40')](_0xf353f8[_0xbed4('0x3c')][_0xbed4('0x40')]));_0x486349[_0xbed4('0x3f')]=_0x486349[_0xbed4('0x3f')][_0xbed4('0x39')]?_0x486349['attributes']:_0x4211b3['model'];if(!_0xf353f8[_0xbed4('0x3c')]['hasOwnProperty'](_0xbed4('0x41'))){_0x486349['limit']=qs[_0xbed4('0x25')](_0xf353f8[_0xbed4('0x3c')][_0xbed4('0x25')]);_0x486349['offset']=qs[_0xbed4('0x23')](_0xf353f8[_0xbed4('0x3c')][_0xbed4('0x23')]);}_0x486349[_0xbed4('0x42')]=qs[_0xbed4('0x43')](_0xf353f8[_0xbed4('0x3c')]['sort']);_0x486349[_0xbed4('0x44')]=qs['filters'](_[_0xbed4('0xc9')](_0xf353f8[_0xbed4('0x3c')],_0x4211b3[_0xbed4('0x3d')]));_0x486349[_0xbed4('0x44')][_0xbed4('0xcc')]=_0x2d7537['id'];if(_0xf353f8[_0xbed4('0x3c')][_0xbed4('0x64')]){_0x486349[_0xbed4('0x44')]=_['merge'](_0x486349['where'],{'$or':_[_0xbed4('0x59')](_0x486349[_0xbed4('0x3f')],function(_0x4839c7){var _0x1b07c8={};_0x1b07c8[_0x4839c7]={'$like':'%'+_0xf353f8['query'][_0xbed4('0x64')]+'%'};return _0x1b07c8;})});}_0x486349=_[_0xbed4('0x8a')]({},_0x486349,_0xf353f8[_0xbed4('0xca')]);return db['CmHopperHistory'][_0xbed4('0x26')]({'where':_0x486349['where']})['then'](function(_0x354a30){_0x5222d7['count']=_0x354a30;if(_0xf353f8[_0xbed4('0x3c')][_0xbed4('0xd0')]){_0x486349[_0xbed4('0xcd')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xbed4('0x9c')](_0x486349);})[_0xbed4('0x2c')](function(_0x19c867){_0x5222d7[_0xbed4('0x94')]=_0x19c867;return _0x5222d7;});}})[_0xbed4('0x2c')](respondWithFilteredResult(_0xa9c6f5,_0x486349))['catch'](handleError(_0xa9c6f5,null));};exports['getHopperFinals']=function(_0xab4b95,_0x1d29ef,_0x1508b5){var _0x4c2c2d={'raw':!![],'where':{}};var _0x2785d3={};var _0x218e8c={'count':0x0,'rows':[]};return db[_0xbed4('0x8b')][_0xbed4('0x35')]({'where':{'id':_0xab4b95[_0xbed4('0x97')]['id']}})['then'](handleEntityNotFound(_0x1d29ef,null))[_0xbed4('0x2c')](function(_0xe70855){if(_0xe70855){_0x2785d3[_0xbed4('0x3b')]=_['keys'](db[_0xbed4('0xd1')][_0xbed4('0xc8')]);_0x2785d3[_0xbed4('0x3c')]=_['keys'](_0xab4b95[_0xbed4('0x3c')]);_0x2785d3[_0xbed4('0x3d')]=_['intersection'](_0x2785d3[_0xbed4('0x3b')],_0x2785d3[_0xbed4('0x3c')]);_0x4c2c2d[_0xbed4('0x3f')]=_[_0xbed4('0x3e')](_0x2785d3[_0xbed4('0x3b')],qs[_0xbed4('0x40')](_0xab4b95[_0xbed4('0x3c')]['fields']));_0x4c2c2d['attributes']=_0x4c2c2d['attributes']['length']?_0x4c2c2d[_0xbed4('0x3f')]:_0x2785d3['model'];if(!_0xab4b95[_0xbed4('0x3c')][_0xbed4('0x63')](_0xbed4('0x41'))){_0x4c2c2d[_0xbed4('0x25')]=qs[_0xbed4('0x25')](_0xab4b95['query']['limit']);_0x4c2c2d[_0xbed4('0x23')]=qs[_0xbed4('0x23')](_0xab4b95['query'][_0xbed4('0x23')]);}_0x4c2c2d[_0xbed4('0x42')]=qs['sort'](_0xab4b95[_0xbed4('0x3c')]['sort']);_0x4c2c2d[_0xbed4('0x44')]=qs[_0xbed4('0x3d')](_[_0xbed4('0xc9')](_0xab4b95[_0xbed4('0x3c')],_0x2785d3[_0xbed4('0x3d')]));_0x4c2c2d['where'][_0xbed4('0xcc')]=_0xe70855['id'];if(_0xab4b95[_0xbed4('0x3c')][_0xbed4('0x64')]){_0x4c2c2d[_0xbed4('0x44')]=_[_0xbed4('0x8a')](_0x4c2c2d[_0xbed4('0x44')],{'$or':_[_0xbed4('0x59')](_0x4c2c2d[_0xbed4('0x3f')],function(_0x1b33ef){var _0x411d02={};_0x411d02[_0x1b33ef]={'$like':'%'+_0xab4b95[_0xbed4('0x3c')][_0xbed4('0x64')]+'%'};return _0x411d02;})});}_0x4c2c2d=_[_0xbed4('0x8a')]({},_0x4c2c2d,_0xab4b95[_0xbed4('0xca')]);return db[_0xbed4('0xd1')][_0xbed4('0x26')]({'where':_0x4c2c2d['where']})[_0xbed4('0x2c')](function(_0x548654){_0x218e8c[_0xbed4('0x26')]=_0x548654;if(_0xab4b95['query'][_0xbed4('0xd0')]){_0x4c2c2d['include']=[{'all':!![]}];}return db[_0xbed4('0xd1')][_0xbed4('0x9c')](_0x4c2c2d);})['then'](function(_0x3c7f2e){_0x218e8c['rows']=_0x3c7f2e;return _0x218e8c;});}})[_0xbed4('0x2c')](respondWithFilteredResult(_0x1d29ef,_0x4c2c2d))[_0xbed4('0x95')](handleError(_0x1d29ef,null));};exports[_0xbed4('0xd2')]=function(_0x53e362,_0x4a751e,_0x185beb){var _0x4e8770={'raw':!![],'where':{}};var _0x5738f0={};var _0x499241={'count':0x0,'rows':[]};return db[_0xbed4('0x8b')][_0xbed4('0x35')]({'where':{'id':_0x53e362[_0xbed4('0x97')]['id']}})[_0xbed4('0x2c')](handleEntityNotFound(_0x4a751e,null))[_0xbed4('0x2c')](function(_0x579771){if(_0x579771){_0x5738f0[_0xbed4('0x3b')]=_['keys'](db[_0xbed4('0xb6')][_0xbed4('0xc8')]);_0x5738f0['query']=_['keys'](_0x53e362['query']);_0x5738f0[_0xbed4('0x3d')]=_['intersection'](_0x5738f0[_0xbed4('0x3b')],_0x5738f0['query']);_0x4e8770['attributes']=_[_0xbed4('0x3e')](_0x5738f0['model'],qs['fields'](_0x53e362[_0xbed4('0x3c')][_0xbed4('0x40')]));_0x4e8770[_0xbed4('0x3f')]=_0x4e8770[_0xbed4('0x3f')]['length']?_0x4e8770['attributes']:_0x5738f0[_0xbed4('0x3b')];if(!_0x53e362[_0xbed4('0x3c')][_0xbed4('0x63')](_0xbed4('0x41'))){_0x4e8770[_0xbed4('0x25')]=qs[_0xbed4('0x25')](_0x53e362[_0xbed4('0x3c')][_0xbed4('0x25')]);_0x4e8770['offset']=qs[_0xbed4('0x23')](_0x53e362[_0xbed4('0x3c')][_0xbed4('0x23')]);}_0x4e8770['order']=qs['sort'](_0x53e362[_0xbed4('0x3c')][_0xbed4('0x43')]);_0x4e8770[_0xbed4('0x44')]=qs['filters'](_[_0xbed4('0xc9')](_0x53e362[_0xbed4('0x3c')],_0x5738f0['filters']));_0x4e8770[_0xbed4('0x44')][_0xbed4('0xcc')]=_0x579771['id'];if(_0x53e362['query'][_0xbed4('0x64')]){_0x4e8770[_0xbed4('0x44')]=_[_0xbed4('0x8a')](_0x4e8770[_0xbed4('0x44')],{'$or':_[_0xbed4('0x59')](_0x4e8770[_0xbed4('0x3f')],function(_0x3d1f5a){var _0x3f5f0e={};_0x3f5f0e[_0x3d1f5a]={'$like':'%'+_0x53e362[_0xbed4('0x3c')]['filter']+'%'};return _0x3f5f0e;})});}_0x4e8770=_[_0xbed4('0x8a')]({},_0x4e8770,_0x53e362[_0xbed4('0xca')]);return db[_0xbed4('0xb6')][_0xbed4('0x26')]({'where':_0x4e8770[_0xbed4('0x44')]})[_0xbed4('0x2c')](function(_0x3cc3ed){_0x499241['count']=_0x3cc3ed;if(_0x53e362['query'][_0xbed4('0xd0')]){_0x4e8770[_0xbed4('0xcd')]=[{'all':!![]}];}return db[_0xbed4('0xb6')][_0xbed4('0x9c')](_0x4e8770);})[_0xbed4('0x2c')](function(_0xa3f704){_0x499241[_0xbed4('0x94')]=_0xa3f704;return _0x499241;});}})[_0xbed4('0x2c')](respondWithFilteredResult(_0x4a751e,_0x4e8770))[_0xbed4('0x95')](handleError(_0x4a751e,null));};exports[_0xbed4('0xd3')]=function(_0x2a6a93,_0x200265,_0x30c5ca){try{if(!_0x2a6a93[_0xbed4('0x9f')][_0xbed4('0x86')]){throw new Error(_0xbed4('0xd4'));}if(!_0x2a6a93['body']['binding_keys']){throw new Error(_0xbed4('0xd5'));}if(!_0x2a6a93[_0xbed4('0x9f')]['binding_values']){throw new Error(_0xbed4('0xd6'));}if(!_0x2a6a93[_0xbed4('0x9f')][_0xbed4('0xd7')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x239b53=_0x2a6a93[_0xbed4('0x9f')][_0xbed4('0xd8')][_0xbed4('0x6e')](',');var _0x42623b=_0x2a6a93[_0xbed4('0x9f')][_0xbed4('0xd9')][_0xbed4('0x6e')](',');if(!_0x239b53[_0xbed4('0x39')]||!_0x42623b[_0xbed4('0x39')]||_0x239b53[_0xbed4('0x39')]!==_0x42623b[_0xbed4('0x39')]){throw new Error(_0xbed4('0xda'));}_0x2a6a93['body']['fields']=_['zipObject'](_0x239b53,_0x42623b);if(!_0x2a6a93[_0xbed4('0x9f')][_0xbed4('0x40')]['phone']){throw new Error(_0xbed4('0xdb'));}if(!_0x2a6a93['body'][_0xbed4('0x40')][_0xbed4('0xdc')]){throw new Error(_0xbed4('0xdd'));}var _0x4d6640=path['join'](config['root'],_0xbed4('0xde'),_0x2a6a93[_0xbed4('0xdf')][_0xbed4('0xe0')]);fs[_0xbed4('0xe1')](_0x4d6640,parseInt(_0xbed4('0xe2'),0x8));var _0x26eb21=require(_0xbed4('0xe3'))[_0xbed4('0xe4')](path['join'](__dirname,_0xbed4('0xe5')),[_0x4d6640,_0x2a6a93[_0xbed4('0x9f')][_0xbed4('0xd8')],_0x2a6a93['body'][_0xbed4('0xd9')],_0x2a6a93[_0xbed4('0x9f')][_0xbed4('0x86')],_0x2a6a93[_0xbed4('0x9f')][_0xbed4('0xe6')],_0x2a6a93['body'][_0xbed4('0xb9')],_0x2a6a93[_0xbed4('0x9f')][_0xbed4('0xd7')]]);return _0x200265[_0xbed4('0x20')](0xc8)[_0xbed4('0x22')]({'message':_0xbed4('0xe7'),'pid':_0x26eb21[_0xbed4('0xe8')]});}catch(_0x97ff9d){return _0x200265['status'](0x1f4)[_0xbed4('0x2f')](_0x97ff9d);}};exports[_0xbed4('0xe9')]=function(_0x18179e,_0x538d30,_0x3376db){var _0x2d39ab=fs[_0xbed4('0xea')](_0x18179e['file'][_0xbed4('0xeb')]);Papa[_0xbed4('0xec')](_0x2d39ab,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x56943a){return _0x538d30['status'](0xc8)['json']({'file':_0x18179e['file'],'fields':_0x56943a[_0xbed4('0xed')][_0xbed4('0x40')]});}});};exports[_0xbed4('0xee')]=function(_0x5c4005,_0x412764,_0x111455){return db[_0xbed4('0x83')][_0xbed4('0x9c')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xbed4('0x2c')](function(_0x3c5fdc){var _0x45897a=![];if(!_0x5c4005[_0xbed4('0x9f')][_0xbed4('0x86')]){throw new Error('No\x20ListId\x20specified');}if(!_0x5c4005[_0xbed4('0x9f')][_0xbed4('0xef')][_0xbed4('0xc6')]){throw new Error(_0xbed4('0xdb'));}if(!_0x5c4005['body'][_0xbed4('0xef')][_0xbed4('0xdc')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x5c4005['body'][_0xbed4('0xd7')]){throw new Error(_0xbed4('0xf0'));}var _0x5614ed=require('child_process')[_0xbed4('0xe4')](path[_0xbed4('0xa1')](__dirname,_0xbed4('0xf1')),[_0x5c4005[_0xbed4('0x97')]['id'],JSON['stringify'](_0x5c4005[_0xbed4('0x9f')]),JSON['stringify'](_0x3c5fdc)]);_0x5614ed['on'](_0xbed4('0xf2'),function(_0x54855a){_0x45897a=!![];return _0x412764[_0xbed4('0x20')](0xc8)[_0xbed4('0x22')]({'message':_0xbed4('0xf3'),'pid':_0x5614ed[_0xbed4('0xe8')]});});_0x5614ed['on'](_0xbed4('0xf4'),function(_0x599731){if(_0x599731&&!_0x45897a){return _0x412764[_0xbed4('0x20')](0x1f4)[_0xbed4('0x22')]({'message':_0xbed4('0xf5'),'pid':_0x5614ed[_0xbed4('0xe8')]});}});})[_0xbed4('0x95')](handleError(_0x412764,null));};exports[_0xbed4('0xf6')]=function(_0x7f4ff4,_0x1dd451){var _0x52c3e4=['mail','chat',_0xbed4('0xf7'),_0xbed4('0xf8'),_0xbed4('0xf9'),_0xbed4('0xfa'),_0xbed4('0xfb')];var _0x20c089={'offset':0x0,'order':qs[_0xbed4('0x43')]('-createdAt')},_0xe5a55={'count':0x0,'rows':[]};Promise['resolve']()[_0xbed4('0x2c')](function(){if(_0x7f4ff4['query'][_0xbed4('0xfc')]){if(!_[_0xbed4('0xfd')](_0x52c3e4,_0x7f4ff4[_0xbed4('0x3c')][_0xbed4('0xfc')][_0xbed4('0xfe')]())){throw new Error('Invalid\x20channel');}_0x52c3e4=[_0x7f4ff4[_0xbed4('0x3c')][_0xbed4('0xfc')][_0xbed4('0xfe')]()];}if(_0x7f4ff4['query']['range']){try{var _0x2da62c=JSON[_0xbed4('0xec')](_0x7f4ff4[_0xbed4('0x3c')]['range']);if(!moment(_0x2da62c[_0xbed4('0x48')])[_0xbed4('0xff')]()){throw new Error(_0xbed4('0x100'));}if(!moment(_0x2da62c['to'])[_0xbed4('0xff')]()){throw new Error(_0xbed4('0x101'));}}catch(_0x72e380){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x7f4ff4['query'][_0xbed4('0x63')]('nolimit')){_0x20c089[_0xbed4('0x25')]=qs[_0xbed4('0x25')](_0x7f4ff4[_0xbed4('0x3c')]['limit']||0xa);_0x20c089[_0xbed4('0x23')]=qs[_0xbed4('0x23')](_0x7f4ff4[_0xbed4('0x3c')][_0xbed4('0x23')]);}var _0x59dff0=_0x52c3e4['map'](function(_0x1192e7){if(_0x1192e7===_0xbed4('0xfb')){var _0x571e65={'attributes':['id',_0xbed4('0x102'),_0xbed4('0x60'),_0xbed4('0x103'),'destination',_0xbed4('0x104'),'starttime',_0xbed4('0x105'),_0xbed4('0x106'),_0xbed4('0x107'),_0xbed4('0x108'),_0xbed4('0x109'),_0xbed4('0x10a'),_0xbed4('0x10b'),_0xbed4('0x10c')],'where':{'ContactId':_0x7f4ff4['params']['id']},'include':[{'model':db[_0xbed4('0x83')],'as':_0xbed4('0x83'),'attributes':['id','name',_0xbed4('0x10d'),_0xbed4('0x9d')]}],'order':[[_0xbed4('0x108'),_0xbed4('0x10e')]]};if(_0x7f4ff4[_0xbed4('0x3c')]['range']){_0x571e65[_0xbed4('0x44')][_0xbed4('0x108')]={'$gte':_0x2da62c[_0xbed4('0x48')],'$lte':_0x2da62c['to']};}return db[_0xbed4('0xb1')][_0xbed4('0x10f')](_0x571e65)[_0xbed4('0x2c')](function(_0x232a99){_0xe5a55[_0xbed4('0x26')]+=_0x232a99[_0xbed4('0x26')];return _[_0xbed4('0x59')](_0x232a99[_0xbed4('0x94')],function(_0x5002cd){var _0x17389e=_0x5002cd[_0xbed4('0xbc')]({'plain':!![]});_0x17389e[_0xbed4('0xfc')]=_0x1192e7;if(_0x17389e[_0xbed4('0x83')]){_0x17389e[_0xbed4('0x83')]={'id':_0x17389e[_0xbed4('0x83')]['id'],'name':_0x17389e[_0xbed4('0x83')][_0xbed4('0x2e')],'fullname':_0x17389e['User'][_0xbed4('0x10d')],'alias':_0x17389e[_0xbed4('0x83')][_0xbed4('0x9d')]};}return _0x17389e;});});}else{var _0x4ce4f0=_[_0xbed4('0x110')](_0x1192e7)+(_0x1192e7==='chat'?_0xbed4('0x111'):_0xbed4('0x112'));var _0x15f161={'attributes':['id','closed',_0xbed4('0x113'),'createdAt',_0xbed4('0x107'),_0xbed4('0x114'),_0xbed4('0x115'),_0xbed4('0x116'),'UserId',_0x4ce4f0+'Id'],'where':{'ContactId':_0x7f4ff4[_0xbed4('0x97')]['id']},'include':[{'model':db[_0x4ce4f0],'as':_0xbed4('0x112'),'attributes':['id','name',_0xbed4('0x117')]},{'model':db[_0xbed4('0x83')],'as':_0xbed4('0x118'),'attributes':['id',_0xbed4('0x2e'),'fullname']},{'model':db['Tag'],'as':_0xbed4('0x93'),'attributes':['id',_0xbed4('0x2e'),_0xbed4('0x47')],'through':{'attributes':[]}}],'order':[['createdAt','DESC']]};if(_0x7f4ff4[_0xbed4('0x3c')][_0xbed4('0x119')]){_0x15f161[_0xbed4('0x44')][_0xbed4('0x108')]={'$gte':_0x2da62c['from'],'$lte':_0x2da62c['to']};}switch(_0x1192e7){case _0xbed4('0x11a'):_0x15f161[_0xbed4('0x3f')]['push'](_0xbed4('0x11b'),'customerIp',_0xbed4('0x11c'),_0xbed4('0x11d'),'osName','ratingMessage',_0xbed4('0x11e'),'ratingValue',_0xbed4('0x11f'));break;case _0xbed4('0x120'):_0x15f161[_0xbed4('0x3f')][_0xbed4('0x34')]('subject',_0xbed4('0x121'));break;case _0xbed4('0xf8'):_0x15f161[_0xbed4('0x3f')][_0xbed4('0x34')](_0xbed4('0x122'),'threadId');break;}return db[_['startCase'](_0x1192e7)+'Interaction']['findAndCountAll'](_0x15f161)[_0xbed4('0x2c')](function(_0x4ed5f5){_0xe5a55[_0xbed4('0x26')]+=_0x4ed5f5[_0xbed4('0x26')];return _['map'](_0x4ed5f5[_0xbed4('0x94')],function(_0x5f1ef9){var _0x321627=_0x5f1ef9['get']({'plain':!![]});_0x321627[_0xbed4('0xfc')]=_0x1192e7;if(_0x321627[_0xbed4('0x118')]){_0x321627[_0xbed4('0x118')]={'id':_0x321627[_0xbed4('0x118')]['id'],'name':_0x321627[_0xbed4('0x118')]['name'],'fullname':_0x321627[_0xbed4('0x118')][_0xbed4('0x10d')]};}return _0x321627;});});}});return Promise['all'](_0x59dff0);})['then'](function(_0x188d9d){return _(_0x188d9d)[_0xbed4('0x123')]()[_0xbed4('0x124')]('createdAt')[_0xbed4('0x125')]()[_0xbed4('0x58')]();})[_0xbed4('0x2c')](function(_0x5083e5){_0xe5a55[_0xbed4('0x94')]=_0x20c089[_0xbed4('0x25')]?_0x5083e5['slice'](_0x20c089[_0xbed4('0x23')],_0x20c089[_0xbed4('0x23')]+_0x20c089[_0xbed4('0x25')]):_0x5083e5;return _0xe5a55;})[_0xbed4('0x2c')](respondWithFilteredResult(_0x1dd451,_0x20c089))['catch'](handleError(_0x1dd451,null));};
\ No newline at end of file
index f566d10..473194e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf48=['save','emit','hasOwnProperty','exports','events','../../mysqldb','CmContact'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0xaf48,0x154));var _0x8af4=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xaf48[_0x474bc0];return _0x4b24cf;};'use strict';var EventEmitter=require(_0x8af4('0x0'));var CmContact=require(_0x8af4('0x1'))['db'][_0x8af4('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8af4('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3e80b6){return function(_0x24073c,_0x2d2b43,_0x568bcf){CmContactEvents[_0x8af4('0x4')](_0x3e80b6+':'+_0x24073c['id'],_0x24073c);CmContactEvents[_0x8af4('0x4')](_0x3e80b6,_0x24073c);_0x568bcf(null);};}for(var e in events){if(events[_0x8af4('0x5')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x8af4('0x6')]=CmContactEvents;
\ No newline at end of file
+var _0xd9a9=['exports','events','../../mysqldb','CmContact','save','update','emit','hasOwnProperty','hook'];(function(_0x10163c,_0x49fd84){var _0x53ca4b=function(_0x26dee9){while(--_0x26dee9){_0x10163c['push'](_0x10163c['shift']());}};_0x53ca4b(++_0x49fd84);}(_0xd9a9,0x1c3));var _0x9d9a=function(_0x115034,_0x334f4f){_0x115034=_0x115034-0x0;var _0x543c4a=_0xd9a9[_0x115034];return _0x543c4a;};'use strict';var EventEmitter=require(_0x9d9a('0x0'));var CmContact=require(_0x9d9a('0x1'))['db'][_0x9d9a('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9d9a('0x3'),'afterUpdate':_0x9d9a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4272ff){return function(_0x53d5ad,_0x4a2e54,_0x20f551){CmContactEvents[_0x9d9a('0x5')](_0x4272ff+':'+_0x53d5ad['id'],_0x53d5ad);CmContactEvents['emit'](_0x4272ff,_0x53d5ad);_0x20f551(null);};}for(var e in events){if(events[_0x9d9a('0x6')](e)){var event=events[e];CmContact[_0x9d9a('0x7')](e,emitEvent(event));}}module[_0x9d9a('0x8')]=CmContactEvents;
\ No newline at end of file
index a5b6d71..5acd8df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2575=['firstName','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','models','get','error','afterCreate','inspect','CmHopper','findOne','then','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','priority','scheduledat','format','callbackUniqueid','YYYY-MM-DD\x20HH:mm:ss','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','create','ListId','cmContact','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','BlackLists','CmHopperBlack','Campaign','message','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts'];(function(_0x2beb84,_0x419c93){var _0x495614=function(_0x5c8a07){while(--_0x5c8a07){_0x2beb84['push'](_0x2beb84['shift']());}};_0x495614(++_0x419c93);}(_0x2575,0x190));var _0x5257=function(_0x4f55c2,_0x5c29f6){_0x4f55c2=_0x4f55c2-0x0;var _0x48d5ab=_0x2575[_0x4f55c2];return _0x48d5ab;};'use strict';var _=require(_0x5257('0x0'));var util=require(_0x5257('0x1'));var logger=require(_0x5257('0x2'))(_0x5257('0x3'));var moment=require(_0x5257('0x4'));var BPromise=require(_0x5257('0x5'));var rp=require(_0x5257('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5257('0x7'));var config=require('../../config/environment');var attributes=require(_0x5257('0x8'));module[_0x5257('0x9')]=function(_0xee3217,_0x7b3982){return _0xee3217['define'](_0x5257('0xa'),attributes,{'tableName':_0x5257('0xb'),'paranoid':!![],'indexes':[{'name':_0x5257('0xc'),'fields':['phone']},{'name':_0x5257('0xd'),'fields':[_0x5257('0xe'),'lastName',_0x5257('0xc'),_0x5257('0xf'),_0x5257('0x10'),_0x5257('0x11')],'type':_0x5257('0x12')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x5257('0x13'),'hooks':{'afterCreate':function(_0x5ac38b,_0x191df7,_0x3f0cb9){var _0xbe91f4=_0xee3217[_0x5257('0x14')];var _0x2ed93c=_0x5ac38b[_0x5257('0x15')]({'plain':!![]});function _0x10ead3(){return function(_0x5b6130){logger[_0x5257('0x16')]('cmContact',_0x5257('0x17'),util[_0x5257('0x18')](_0x5b6130,{'showHidden':![],'depth':null}));};}var _0x3f40cb=function(_0x18ae2c){return new BPromise(function(_0x544438,_0x5eb9d1){_0xbe91f4[_0x5257('0x19')][_0x5257('0x1a')]({'where':{'phone':_0x2ed93c[_0x5257('0xc')],'VoiceQueueId':_0x18ae2c['id']}})[_0x5257('0x1b')](function(_0x483b17){if(!_[_0x5257('0x1c')](_0x483b17)){throw new Error(_0x5257('0x1d')+_0x2ed93c[_0x5257('0xc')]+_0x5257('0x1e')+_0x18ae2c['id']);}return _0xbe91f4['CmHopper']['create']({'phone':_0x2ed93c['phone'],'ContactId':_0x2ed93c['id'],'ListId':_0x2ed93c['ListId'],'priority':_0x2ed93c[_0x5257('0x1f')]?_0x2ed93c[_0x5257('0x1f')]:0x2,'scheduledat':_0x2ed93c['scheduledat']?_0x2ed93c[_0x5257('0x20')]:moment()[_0x5257('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2ed93c[_0x5257('0x22')]?!![]:![],'callbackuniqueid':_0x2ed93c[_0x5257('0x22')]?_0x2ed93c[_0x5257('0x22')]:undefined,'callbackat':_0x2ed93c['callbackUniqueid']?moment()[_0x5257('0x21')](_0x5257('0x23')):undefined,'VoiceQueueId':_0x18ae2c['id']});})[_0x5257('0x24')](function(_0x369443){_0x5eb9d1(_0x369443);});});};var _0x597af8=function(_0x59f721){return new BPromise(function(_0x58eff1,_0x4aa7e2){_0xbe91f4[_0x5257('0x19')][_0x5257('0x1a')]({'where':{'phone':_0x2ed93c[_0x5257('0xc')],'VoiceQueueId':_0x59f721['id']}})[_0x5257('0x1b')](function(_0x191b6a){if(!_[_0x5257('0x1c')](_0x191b6a)){throw new Error(_0x5257('0x1d')+_0x2ed93c[_0x5257('0xc')]+_0x5257('0x25')+_0x59f721['id']);}return _0xbe91f4['CmHopperFinal'][_0x5257('0x1a')]({'where':{'calleridnum':_0x2ed93c[_0x5257('0xc')],'VoiceQueueId':_0x59f721['id']}});})[_0x5257('0x1b')](function(_0x593c0f){if(!_[_0x5257('0x1c')](_0x593c0f)){throw new Error(_0x5257('0x26')+_0x2ed93c[_0x5257('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x59f721['id']);}return _0xbe91f4['CmHopper'][_0x5257('0x27')]({'phone':_0x2ed93c[_0x5257('0xc')],'ContactId':_0x2ed93c['id'],'ListId':_0x2ed93c[_0x5257('0x28')],'priority':_0x2ed93c['priority']?_0x2ed93c[_0x5257('0x1f')]:0x2,'scheduledat':_0x2ed93c[_0x5257('0x20')]?_0x2ed93c[_0x5257('0x20')]:moment()['format'](_0x5257('0x23')),'callback':_0x2ed93c[_0x5257('0x22')]?!![]:![],'callbackuniqueid':_0x2ed93c[_0x5257('0x22')]?_0x2ed93c[_0x5257('0x22')]:undefined,'callbackat':_0x2ed93c[_0x5257('0x22')]?moment()[_0x5257('0x21')](_0x5257('0x23')):undefined,'VoiceQueueId':_0x59f721['id']});})[_0x5257('0x24')](function(_0x40e27b){_0x4aa7e2(_0x40e27b);});});};function _0x1b3095(){return function(_0x5ebc9d){logger[_0x5257('0x16')](_0x5257('0x29'),_0x5257('0x17'),util[_0x5257('0x18')](_0x5ebc9d,{'showHidden':![],'depth':null}));};}var _0x1f33cd=function(_0x43c9c3){return new BPromise(function(_0x3eefeb,_0x4d6a94){_0xbe91f4[_0x5257('0x19')]['findOne']({'where':{'phone':_0x2ed93c[_0x5257('0xc')],'CampaignId':_0x43c9c3['id']}})[_0x5257('0x1b')](function(_0x590df0){if(!_[_0x5257('0x1c')](_0x590df0)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2ed93c[_0x5257('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x43c9c3['id']);}return _0xbe91f4[_0x5257('0x19')]['create']({'phone':_0x2ed93c[_0x5257('0xc')],'ContactId':_0x2ed93c['id'],'ListId':_0x2ed93c['ListId'],'priority':_0x2ed93c[_0x5257('0x1f')]?_0x2ed93c['priority']:0x2,'scheduledat':_0x2ed93c[_0x5257('0x20')]?_0x2ed93c['scheduledat']:moment()['format'](_0x5257('0x23')),'callback':_0x2ed93c[_0x5257('0x22')]?!![]:![],'callbackuniqueid':_0x2ed93c[_0x5257('0x22')]?_0x2ed93c[_0x5257('0x22')]:undefined,'callbackat':_0x2ed93c[_0x5257('0x22')]?moment()['format'](_0x5257('0x23')):undefined,'CampaignId':_0x43c9c3['id']});})[_0x5257('0x24')](function(_0x7c956a){_0x4d6a94(_0x7c956a);});});};var _0x8f74cc=function(_0x8b0f7a){return new BPromise(function(_0x3a4839,_0x4e4eab){_0xbe91f4[_0x5257('0x19')][_0x5257('0x1a')]({'where':{'phone':_0x2ed93c['phone'],'CampaignId':_0x8b0f7a['id']}})['then'](function(_0x94aea9){if(!_[_0x5257('0x1c')](_0x94aea9)){throw new Error(_0x5257('0x1d')+_0x2ed93c['phone']+_0x5257('0x2a')+_0x8b0f7a['id']);}return _0xbe91f4[_0x5257('0x2b')][_0x5257('0x1a')]({'where':{'calleridnum':_0x2ed93c[_0x5257('0xc')],'CampaignId':_0x8b0f7a['id']}});})[_0x5257('0x1b')](function(_0x4ae7af){if(!_[_0x5257('0x1c')](_0x4ae7af)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x2ed93c[_0x5257('0xc')]+_0x5257('0x2c')+_0x8b0f7a['id']);}return _0xbe91f4['CmHopper']['create']({'phone':_0x2ed93c[_0x5257('0xc')],'ContactId':_0x2ed93c['id'],'ListId':_0x2ed93c[_0x5257('0x28')],'priority':_0x2ed93c['priority']?_0x2ed93c['priority']:0x2,'scheduledat':_0x2ed93c[_0x5257('0x20')]?_0x2ed93c['scheduledat']:moment()[_0x5257('0x21')](_0x5257('0x23')),'callback':_0x2ed93c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2ed93c[_0x5257('0x22')]?_0x2ed93c['callbackUniqueid']:undefined,'callbackat':_0x2ed93c[_0x5257('0x22')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x8b0f7a['id']});})[_0x5257('0x24')](function(_0x400bf6){_0x4e4eab(_0x400bf6);});});};if(_0x2ed93c[_0x5257('0x28')]){_0xbe91f4['VoiceQueue'][_0x5257('0x2d')]({'where':{'type':_0x5257('0x2e')},'attributes':['id',_0x5257('0x2f')],'include':[{'model':_0xbe91f4[_0x5257('0x30')],'as':_0x5257('0x31'),'where':{'id':_0x2ed93c[_0x5257('0x28')]}}]})['then'](function(_0xb850e4){if(_0xb850e4){var _0x35aa92=[];for(var _0x2c5ad9=0x0,_0x1b5f1b;_0x2c5ad9<_0xb850e4[_0x5257('0x32')];_0x2c5ad9+=0x1){_0x1b5f1b=_0xb850e4[_0x2c5ad9]['get']({'plain':!![]});switch(_0x1b5f1b[_0x5257('0x2f')]){case _0x5257('0x33'):_0x597af8(_0x1b5f1b)[_0x5257('0x24')](_0x10ead3());break;case _0x5257('0x34'):_0x3f40cb(_0x1b5f1b)[_0x5257('0x24')](_0x10ead3());break;default:_0xbe91f4[_0x5257('0x19')][_0x5257('0x27')]({'phone':_0x2ed93c[_0x5257('0xc')],'ContactId':_0x2ed93c['id'],'ListId':_0x2ed93c[_0x5257('0x28')],'scheduledat':_0x2ed93c[_0x5257('0x20')]?_0x2ed93c[_0x5257('0x20')]:moment()[_0x5257('0x21')](_0x5257('0x23')),'priority':_0x2ed93c[_0x5257('0x1f')]?_0x2ed93c[_0x5257('0x1f')]:0x2,'callback':_0x2ed93c[_0x5257('0x22')]?!![]:![],'callbackuniqueid':_0x2ed93c[_0x5257('0x22')]?_0x2ed93c['callbackUniqueid']:undefined,'callbackat':_0x2ed93c[_0x5257('0x22')]?moment()['format'](_0x5257('0x23')):undefined,'VoiceQueueId':_0x1b5f1b['id']})[_0x5257('0x24')](_0x10ead3());}}}})['then'](function(){return _0xbe91f4['VoiceQueue'][_0x5257('0x2d')]({'where':{'type':_0x5257('0x2e')},'attributes':['id'],'include':[{'model':_0xbe91f4[_0x5257('0x30')],'as':_0x5257('0x35'),'where':{'id':_0x2ed93c['ListId']}}]})['then'](function(_0x2ae0ed){if(_0x2ae0ed){var _0x17e347=[];for(var _0x114c17=0x0,_0xd4b675;_0x114c17<_0x2ae0ed[_0x5257('0x32')];_0x114c17+=0x1){_0xd4b675=_0x2ae0ed[_0x114c17][_0x5257('0x15')]({'plain':!![]});_0xbe91f4[_0x5257('0x36')]['create']({'phone':_0x2ed93c[_0x5257('0xc')],'ContactId':_0x2ed93c['id'],'ListId':_0x2ed93c[_0x5257('0x28')],'VoiceQueueId':_0xd4b675['id']})[_0x5257('0x24')](function(_0x4a3f02){logger[_0x5257('0x16')]('cmContact,\x20%s,\x20%s',_0x5257('0x17'),_0x4a3f02['message']);});}}});})[_0x5257('0x1b')](function(){return _0xbe91f4[_0x5257('0x37')][_0x5257('0x2d')]({'attributes':['id',_0x5257('0x2f')],'include':[{'model':_0xbe91f4[_0x5257('0x30')],'as':_0x5257('0x31'),'where':{'id':_0x2ed93c[_0x5257('0x28')]}}]})['then'](function(_0x52923f){if(_0x52923f){var _0x2d0e7b=[];for(var _0x4ff618=0x0,_0x3ef13c;_0x4ff618<_0x52923f[_0x5257('0x32')];_0x4ff618+=0x1){_0x3ef13c=_0x52923f[_0x4ff618]['get']({'plain':!![]});switch(_0x3ef13c[_0x5257('0x2f')]){case'always':_0x8f74cc(_0x3ef13c)[_0x5257('0x24')](_0x1b3095());break;case _0x5257('0x34'):_0x1f33cd(_0x3ef13c)[_0x5257('0x24')](_0x1b3095());break;default:_0xbe91f4[_0x5257('0x19')][_0x5257('0x27')]({'phone':_0x2ed93c[_0x5257('0xc')],'ContactId':_0x2ed93c['id'],'ListId':_0x2ed93c[_0x5257('0x28')],'scheduledat':_0x2ed93c[_0x5257('0x20')]?_0x2ed93c[_0x5257('0x20')]:moment()[_0x5257('0x21')](_0x5257('0x23')),'priority':_0x2ed93c['priority']?_0x2ed93c[_0x5257('0x1f')]:0x2,'callback':_0x2ed93c[_0x5257('0x22')]?!![]:![],'callbackuniqueid':_0x2ed93c[_0x5257('0x22')]?_0x2ed93c['callbackUniqueid']:undefined,'callbackat':_0x2ed93c[_0x5257('0x22')]?moment()[_0x5257('0x21')](_0x5257('0x23')):undefined,'CampaignId':_0x3ef13c['id']})[_0x5257('0x24')](_0x1b3095());}}}});})[_0x5257('0x1b')](function(){return _0xbe91f4[_0x5257('0x37')][_0x5257('0x2d')]({'attributes':['id'],'include':[{'model':_0xbe91f4[_0x5257('0x30')],'as':'BlackLists','where':{'id':_0x2ed93c[_0x5257('0x28')]}}]})[_0x5257('0x1b')](function(_0x56915b){if(_0x56915b){var _0x271b82=[];for(var _0x19fff0=0x0,_0x4e5b59;_0x19fff0<_0x56915b[_0x5257('0x32')];_0x19fff0+=0x1){_0x4e5b59=_0x56915b[_0x19fff0][_0x5257('0x15')]({'plain':!![]});_0xbe91f4['CmHopperBlack'][_0x5257('0x27')]({'phone':_0x2ed93c['phone'],'ContactId':_0x2ed93c['id'],'ListId':_0x2ed93c[_0x5257('0x28')],'CampaignId':_0x4e5b59['id']})['catch'](function(_0x2356c9){logger['error']('cmContact,\x20%s,\x20%s',_0x5257('0x17'),_0x2356c9[_0x5257('0x38')]);});}}});})[_0x5257('0x1b')](function(){_0x3f0cb9();})[_0x5257('0x24')](function(_0xd1151){logger[_0x5257('0x16')](_0x5257('0x39'),_0x5257('0x17'),_0xd1151[_0x5257('0x38')]);_0x3f0cb9(_0xd1151);});}else{_0x3f0cb9(new Error(_0x5257('0x3a')));}},'afterDestroy':function(_0xe881da,_0x48b4ba,_0x2a85c3){var _0x2eaa68=_0xee3217['models'];var _0x86ccb6=_0xe881da[_0x5257('0x15')]({'plain':!![]});return _0x2eaa68[_0x5257('0x19')][_0x5257('0x2d')]({'raw':!![],'where':{'ListId':_0x86ccb6['ListId'],'ContactId':_0x86ccb6['id']}})[_0x5257('0x1b')](function(_0x1ffa82){if(!_[_0x5257('0x3b')](_0x1ffa82)){var _0x2a67e1=[];for(var _0x3db70a=0x0;_0x3db70a<_0x1ffa82[_0x5257('0x32')];_0x3db70a+=0x1){var _0x2f8619=_0x2eaa68['CmHopper'][_0x5257('0x3c')]({'where':{'ListId':_0x1ffa82[_0x3db70a][_0x5257('0x28')],'ContactId':_0x1ffa82[_0x3db70a][_0x5257('0x3d')],'VoiceQueueId':_0x1ffa82[_0x3db70a][_0x5257('0x3e')],'CampaignId':_0x1ffa82[_0x3db70a][_0x5257('0x3f')]}});_0x2a67e1[_0x5257('0x40')](_0x2f8619);}return BPromise[_0x5257('0x41')](_0x2a67e1);}})['then'](function(_0x2d6a6e){logger[_0x5257('0x42')](_0x5257('0x43'),util[_0x5257('0x18')](_0x2d6a6e,{'showHidden':![],'depth':null}));_0x2a85c3();})[_0x5257('0x24')](function(_0x3dc9b7){logger[_0x5257('0x16')](_0x5257('0x44'),util['inspect'](_0x3dc9b7,{'showHidden':![],'depth':null}));_0x2a85c3(_0x3dc9b7);});}}});};
\ No newline at end of file
+var _0x834c=['phone','fti_cm_contacts','firstName','lastName','mobile','FULLTEXT','models','get','cmContact','afterCreate','inspect','CmHopper','findOne','then','isNil','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','error','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','ContactId','VoiceQueueId','all','info','[CmContact][afterDestroy][Error]','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts'];(function(_0x4ea096,_0x44d8a8){var _0x50145a=function(_0x1f12ae){while(--_0x1f12ae){_0x4ea096['push'](_0x4ea096['shift']());}};_0x50145a(++_0x44d8a8);}(_0x834c,0x73));var _0xc834=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0x834c[_0x3df223];return _0x562d11;};'use strict';var _=require(_0xc834('0x0'));var util=require(_0xc834('0x1'));var logger=require('../../config/logger')(_0xc834('0x2'));var moment=require(_0xc834('0x3'));var BPromise=require(_0xc834('0x4'));var rp=require(_0xc834('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc834('0x6'));var config=require(_0xc834('0x7'));var attributes=require(_0xc834('0x8'));module[_0xc834('0x9')]=function(_0x4e474e,_0x18de30){return _0x4e474e[_0xc834('0xa')](_0xc834('0xb'),attributes,{'tableName':_0xc834('0xc'),'paranoid':!![],'indexes':[{'name':_0xc834('0xd'),'fields':['phone']},{'name':_0xc834('0xe'),'fields':[_0xc834('0xf'),_0xc834('0x10'),'phone',_0xc834('0x11'),'fax','email'],'type':_0xc834('0x12')}],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x57717f,_0x29aacf,_0x28520b){var _0x5703bc=_0x4e474e[_0xc834('0x13')];var _0x4c8d92=_0x57717f[_0xc834('0x14')]({'plain':!![]});function _0x2d4da5(){return function(_0x56d9cb){logger['error'](_0xc834('0x15'),_0xc834('0x16'),util[_0xc834('0x17')](_0x56d9cb,{'showHidden':![],'depth':null}));};}var _0x1b91f7=function(_0x5757d3){return new BPromise(function(_0x13d3b6,_0x4dc036){_0x5703bc[_0xc834('0x18')][_0xc834('0x19')]({'where':{'phone':_0x4c8d92[_0xc834('0xd')],'VoiceQueueId':_0x5757d3['id']}})[_0xc834('0x1a')](function(_0x450ca0){if(!_[_0xc834('0x1b')](_0x450ca0)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4c8d92[_0xc834('0xd')]+_0xc834('0x1c')+_0x5757d3['id']);}return _0x5703bc[_0xc834('0x18')][_0xc834('0x1d')]({'phone':_0x4c8d92[_0xc834('0xd')],'ContactId':_0x4c8d92['id'],'ListId':_0x4c8d92['ListId'],'priority':_0x4c8d92[_0xc834('0x1e')]?_0x4c8d92[_0xc834('0x1e')]:0x2,'scheduledat':_0x4c8d92[_0xc834('0x1f')]?_0x4c8d92[_0xc834('0x1f')]:moment()[_0xc834('0x20')](_0xc834('0x21')),'callback':_0x4c8d92[_0xc834('0x22')]?!![]:![],'callbackuniqueid':_0x4c8d92[_0xc834('0x22')]?_0x4c8d92[_0xc834('0x22')]:undefined,'callbackat':_0x4c8d92[_0xc834('0x22')]?moment()['format'](_0xc834('0x21')):undefined,'VoiceQueueId':_0x5757d3['id']});})[_0xc834('0x23')](function(_0xd83c59){_0x4dc036(_0xd83c59);});});};var _0x5896cf=function(_0x2a5470){return new BPromise(function(_0x5cddd4,_0x2f83cc){_0x5703bc['CmHopper']['findOne']({'where':{'phone':_0x4c8d92['phone'],'VoiceQueueId':_0x2a5470['id']}})[_0xc834('0x1a')](function(_0x4dccad){if(!_[_0xc834('0x1b')](_0x4dccad)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4c8d92['phone']+_0xc834('0x24')+_0x2a5470['id']);}return _0x5703bc[_0xc834('0x25')][_0xc834('0x19')]({'where':{'calleridnum':_0x4c8d92[_0xc834('0xd')],'VoiceQueueId':_0x2a5470['id']}});})['then'](function(_0x337771){if(!_[_0xc834('0x1b')](_0x337771)){throw new Error(_0xc834('0x26')+_0x4c8d92[_0xc834('0xd')]+_0xc834('0x27')+_0x2a5470['id']);}return _0x5703bc[_0xc834('0x18')]['create']({'phone':_0x4c8d92[_0xc834('0xd')],'ContactId':_0x4c8d92['id'],'ListId':_0x4c8d92[_0xc834('0x28')],'priority':_0x4c8d92[_0xc834('0x1e')]?_0x4c8d92[_0xc834('0x1e')]:0x2,'scheduledat':_0x4c8d92[_0xc834('0x1f')]?_0x4c8d92['scheduledat']:moment()[_0xc834('0x20')](_0xc834('0x21')),'callback':_0x4c8d92['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4c8d92['callbackUniqueid']?_0x4c8d92['callbackUniqueid']:undefined,'callbackat':_0x4c8d92[_0xc834('0x22')]?moment()[_0xc834('0x20')](_0xc834('0x21')):undefined,'VoiceQueueId':_0x2a5470['id']});})[_0xc834('0x23')](function(_0x2e89da){_0x2f83cc(_0x2e89da);});});};function _0x411139(){return function(_0xefc9d2){logger[_0xc834('0x29')]('cmContact',_0xc834('0x16'),util[_0xc834('0x17')](_0xefc9d2,{'showHidden':![],'depth':null}));};}var _0x6304a=function(_0x11dd84){return new BPromise(function(_0xbe4987,_0x361431){_0x5703bc[_0xc834('0x18')][_0xc834('0x19')]({'where':{'phone':_0x4c8d92['phone'],'CampaignId':_0x11dd84['id']}})[_0xc834('0x1a')](function(_0x2db352){if(!_[_0xc834('0x1b')](_0x2db352)){throw new Error(_0xc834('0x2a')+_0x4c8d92[_0xc834('0xd')]+_0xc834('0x2b')+_0x11dd84['id']);}return _0x5703bc[_0xc834('0x18')][_0xc834('0x1d')]({'phone':_0x4c8d92[_0xc834('0xd')],'ContactId':_0x4c8d92['id'],'ListId':_0x4c8d92['ListId'],'priority':_0x4c8d92['priority']?_0x4c8d92['priority']:0x2,'scheduledat':_0x4c8d92[_0xc834('0x1f')]?_0x4c8d92['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4c8d92[_0xc834('0x22')]?!![]:![],'callbackuniqueid':_0x4c8d92[_0xc834('0x22')]?_0x4c8d92[_0xc834('0x22')]:undefined,'callbackat':_0x4c8d92[_0xc834('0x22')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x11dd84['id']});})[_0xc834('0x23')](function(_0x585986){_0x361431(_0x585986);});});};var _0x227d95=function(_0x23b06c){return new BPromise(function(_0x556e62,_0x40613d){_0x5703bc[_0xc834('0x18')][_0xc834('0x19')]({'where':{'phone':_0x4c8d92['phone'],'CampaignId':_0x23b06c['id']}})['then'](function(_0x40ff58){if(!_[_0xc834('0x1b')](_0x40ff58)){throw new Error(_0xc834('0x2a')+_0x4c8d92[_0xc834('0xd')]+_0xc834('0x2c')+_0x23b06c['id']);}return _0x5703bc['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x4c8d92[_0xc834('0xd')],'CampaignId':_0x23b06c['id']}});})['then'](function(_0x496c5f){if(!_[_0xc834('0x1b')](_0x496c5f)){throw new Error(_0xc834('0x26')+_0x4c8d92[_0xc834('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x23b06c['id']);}return _0x5703bc[_0xc834('0x18')][_0xc834('0x1d')]({'phone':_0x4c8d92['phone'],'ContactId':_0x4c8d92['id'],'ListId':_0x4c8d92[_0xc834('0x28')],'priority':_0x4c8d92[_0xc834('0x1e')]?_0x4c8d92[_0xc834('0x1e')]:0x2,'scheduledat':_0x4c8d92[_0xc834('0x1f')]?_0x4c8d92[_0xc834('0x1f')]:moment()['format'](_0xc834('0x21')),'callback':_0x4c8d92[_0xc834('0x22')]?!![]:![],'callbackuniqueid':_0x4c8d92[_0xc834('0x22')]?_0x4c8d92[_0xc834('0x22')]:undefined,'callbackat':_0x4c8d92[_0xc834('0x22')]?moment()['format'](_0xc834('0x21')):undefined,'CampaignId':_0x23b06c['id']});})['catch'](function(_0x4f2919){_0x40613d(_0x4f2919);});});};if(_0x4c8d92[_0xc834('0x28')]){_0x5703bc[_0xc834('0x2d')][_0xc834('0x2e')]({'where':{'type':_0xc834('0x2f')},'attributes':['id',_0xc834('0x30')],'include':[{'model':_0x5703bc[_0xc834('0x31')],'as':_0xc834('0x32'),'where':{'id':_0x4c8d92['ListId']}}]})[_0xc834('0x1a')](function(_0x456895){if(_0x456895){var _0x5e8a4e=[];for(var _0x6623f=0x0,_0x1e78ed;_0x6623f<_0x456895[_0xc834('0x33')];_0x6623f+=0x1){_0x1e78ed=_0x456895[_0x6623f][_0xc834('0x14')]({'plain':!![]});switch(_0x1e78ed[_0xc834('0x30')]){case _0xc834('0x34'):_0x5896cf(_0x1e78ed)[_0xc834('0x23')](_0x2d4da5());break;case _0xc834('0x35'):_0x1b91f7(_0x1e78ed)['catch'](_0x2d4da5());break;default:_0x5703bc['CmHopper'][_0xc834('0x1d')]({'phone':_0x4c8d92[_0xc834('0xd')],'ContactId':_0x4c8d92['id'],'ListId':_0x4c8d92[_0xc834('0x28')],'scheduledat':_0x4c8d92[_0xc834('0x1f')]?_0x4c8d92['scheduledat']:moment()[_0xc834('0x20')](_0xc834('0x21')),'priority':_0x4c8d92[_0xc834('0x1e')]?_0x4c8d92[_0xc834('0x1e')]:0x2,'callback':_0x4c8d92['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4c8d92['callbackUniqueid']?_0x4c8d92[_0xc834('0x22')]:undefined,'callbackat':_0x4c8d92['callbackUniqueid']?moment()[_0xc834('0x20')](_0xc834('0x21')):undefined,'VoiceQueueId':_0x1e78ed['id']})['catch'](_0x2d4da5());}}}})['then'](function(){return _0x5703bc[_0xc834('0x2d')][_0xc834('0x2e')]({'where':{'type':_0xc834('0x2f')},'attributes':['id'],'include':[{'model':_0x5703bc[_0xc834('0x31')],'as':_0xc834('0x36'),'where':{'id':_0x4c8d92[_0xc834('0x28')]}}]})[_0xc834('0x1a')](function(_0x17c501){if(_0x17c501){var _0x2391c5=[];for(var _0x9d8371=0x0,_0xd29bcc;_0x9d8371<_0x17c501[_0xc834('0x33')];_0x9d8371+=0x1){_0xd29bcc=_0x17c501[_0x9d8371][_0xc834('0x14')]({'plain':!![]});_0x5703bc[_0xc834('0x37')][_0xc834('0x1d')]({'phone':_0x4c8d92[_0xc834('0xd')],'ContactId':_0x4c8d92['id'],'ListId':_0x4c8d92['ListId'],'VoiceQueueId':_0xd29bcc['id']})[_0xc834('0x23')](function(_0x5f4080){logger[_0xc834('0x29')](_0xc834('0x38'),_0xc834('0x16'),_0x5f4080[_0xc834('0x39')]);});}}});})[_0xc834('0x1a')](function(){return _0x5703bc[_0xc834('0x3a')][_0xc834('0x2e')]({'attributes':['id',_0xc834('0x30')],'include':[{'model':_0x5703bc[_0xc834('0x31')],'as':_0xc834('0x32'),'where':{'id':_0x4c8d92['ListId']}}]})['then'](function(_0x13d631){if(_0x13d631){var _0x56e945=[];for(var _0x4b0e4e=0x0,_0xa409fb;_0x4b0e4e<_0x13d631[_0xc834('0x33')];_0x4b0e4e+=0x1){_0xa409fb=_0x13d631[_0x4b0e4e][_0xc834('0x14')]({'plain':!![]});switch(_0xa409fb[_0xc834('0x30')]){case _0xc834('0x34'):_0x227d95(_0xa409fb)[_0xc834('0x23')](_0x411139());break;case _0xc834('0x35'):_0x6304a(_0xa409fb)['catch'](_0x411139());break;default:_0x5703bc['CmHopper']['create']({'phone':_0x4c8d92[_0xc834('0xd')],'ContactId':_0x4c8d92['id'],'ListId':_0x4c8d92['ListId'],'scheduledat':_0x4c8d92[_0xc834('0x1f')]?_0x4c8d92[_0xc834('0x1f')]:moment()[_0xc834('0x20')](_0xc834('0x21')),'priority':_0x4c8d92['priority']?_0x4c8d92[_0xc834('0x1e')]:0x2,'callback':_0x4c8d92[_0xc834('0x22')]?!![]:![],'callbackuniqueid':_0x4c8d92[_0xc834('0x22')]?_0x4c8d92[_0xc834('0x22')]:undefined,'callbackat':_0x4c8d92[_0xc834('0x22')]?moment()['format'](_0xc834('0x21')):undefined,'CampaignId':_0xa409fb['id']})[_0xc834('0x23')](_0x411139());}}}});})[_0xc834('0x1a')](function(){return _0x5703bc[_0xc834('0x3a')]['findAll']({'attributes':['id'],'include':[{'model':_0x5703bc[_0xc834('0x31')],'as':_0xc834('0x36'),'where':{'id':_0x4c8d92[_0xc834('0x28')]}}]})[_0xc834('0x1a')](function(_0x54f08d){if(_0x54f08d){var _0x429f56=[];for(var _0x8fecc8=0x0,_0x383b0e;_0x8fecc8<_0x54f08d[_0xc834('0x33')];_0x8fecc8+=0x1){_0x383b0e=_0x54f08d[_0x8fecc8][_0xc834('0x14')]({'plain':!![]});_0x5703bc[_0xc834('0x37')]['create']({'phone':_0x4c8d92[_0xc834('0xd')],'ContactId':_0x4c8d92['id'],'ListId':_0x4c8d92[_0xc834('0x28')],'CampaignId':_0x383b0e['id']})[_0xc834('0x23')](function(_0x656190){logger[_0xc834('0x29')]('cmContact,\x20%s,\x20%s',_0xc834('0x16'),_0x656190[_0xc834('0x39')]);});}}});})[_0xc834('0x1a')](function(){_0x28520b();})[_0xc834('0x23')](function(_0x42e45){logger[_0xc834('0x29')](_0xc834('0x38'),_0xc834('0x16'),_0x42e45[_0xc834('0x39')]);_0x28520b(_0x42e45);});}else{_0x28520b(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x350b9d,_0x3f20ec,_0x6f2ce4){var _0x1ae12c=_0x4e474e[_0xc834('0x13')];var _0x16f3a0=_0x350b9d[_0xc834('0x14')]({'plain':!![]});return _0x1ae12c[_0xc834('0x18')]['findAll']({'raw':!![],'where':{'ListId':_0x16f3a0[_0xc834('0x28')],'ContactId':_0x16f3a0['id']}})[_0xc834('0x1a')](function(_0x3d84ad){if(!_['isEmpty'](_0x3d84ad)){var _0xc9cdba=[];for(var _0x4440ad=0x0;_0x4440ad<_0x3d84ad[_0xc834('0x33')];_0x4440ad+=0x1){var _0x3aa098=_0x1ae12c['CmHopper']['destroy']({'where':{'ListId':_0x3d84ad[_0x4440ad][_0xc834('0x28')],'ContactId':_0x3d84ad[_0x4440ad][_0xc834('0x3b')],'VoiceQueueId':_0x3d84ad[_0x4440ad][_0xc834('0x3c')],'CampaignId':_0x3d84ad[_0x4440ad]['CampaignId']}});_0xc9cdba['push'](_0x3aa098);}return BPromise[_0xc834('0x3d')](_0xc9cdba);}})[_0xc834('0x1a')](function(_0x187c3e){logger[_0xc834('0x3e')]('[CmContact][afterDestroy][Succesfull]',util[_0xc834('0x17')](_0x187c3e,{'showHidden':![],'depth':null}));_0x6f2ce4();})[_0xc834('0x23')](function(_0x1b6ec6){logger['error'](_0xc834('0x3f'),util[_0xc834('0x17')](_0x1b6ec6,{'showHidden':![],'depth':null}));_0x6f2ce4(_0x1b6ec6);});}}});};
\ No newline at end of file
index 0cfa00d..1cd1258 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc0e=['include','map','model','then','stringify','GetCmContact','body','raw','length','keys','startsWith','cf_','update','table','set','id\x20=\x20?','toString','sequelize','CreateCmContact','lodash','util','moment','bluebird','randomstring','squel','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','request','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CmContact','findAll','options','where','attributes','limit'];(function(_0x25a42a,_0x3d489b){var _0x1129b1=function(_0x4ae61b){while(--_0x4ae61b){_0x25a42a['push'](_0x25a42a['shift']());}};_0x1129b1(++_0x3d489b);}(_0xbc0e,0x1bb));var _0xebc0=function(_0x1f7367,_0x2bc8e6){_0x1f7367=_0x1f7367-0x0;var _0xb41671=_0xbc0e[_0x1f7367];return _0xb41671;};'use strict';var _=require(_0xebc0('0x0'));var util=require(_0xebc0('0x1'));var moment=require(_0xebc0('0x2'));var BPromise=require(_0xebc0('0x3'));var rs=require(_0xebc0('0x4'));var fs=require('fs');var Redis=require('ioredis');var squel=require(_0xebc0('0x5'));var db=require(_0xebc0('0x6'))['db'];var utils=require(_0xebc0('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xebc0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xebc0('0x9')][_0xebc0('0xa')]({'port':0x232a});config[_0xebc0('0xb')]=_[_0xebc0('0xc')](config['redis'],{'host':_0xebc0('0xd'),'port':0x18eb});var socket=require(_0xebc0('0xe'))(new Redis(config[_0xebc0('0xb')]));require(_0xebc0('0xf'))[_0xebc0('0x10')](socket);function respondWithRpcPromise(_0x18633c,_0xae7967,_0x23997f){return new BPromise(function(_0x9f450e,_0x177fd2){return client[_0xebc0('0x11')](_0x18633c,_0x23997f)['then'](function(_0x41e5aa){logger[_0xebc0('0x12')](_0xebc0('0x13'),_0xae7967,_0xebc0('0x14'));logger[_0xebc0('0x15')](_0xebc0('0x16'),_0xae7967,_0xebc0('0x14'),JSON['stringify'](_0x41e5aa));if(_0x41e5aa[_0xebc0('0x17')]){if(_0x41e5aa[_0xebc0('0x17')][_0xebc0('0x18')]===0x1f4){logger[_0xebc0('0x17')]('CmContact,\x20%s,\x20%s',_0xae7967,_0x41e5aa['error'][_0xebc0('0x19')]);return _0x177fd2(_0x41e5aa[_0xebc0('0x17')][_0xebc0('0x19')]);}logger['error'](_0xebc0('0x13'),_0xae7967,_0x41e5aa[_0xebc0('0x17')]['message']);return _0x9f450e(_0x41e5aa[_0xebc0('0x17')]['message']);}else{logger[_0xebc0('0x12')](_0xebc0('0x13'),_0xae7967,_0xebc0('0x14'));_0x9f450e(_0x41e5aa[_0xebc0('0x1a')][_0xebc0('0x19')]);}})[_0xebc0('0x1b')](function(_0x48139d){logger[_0xebc0('0x17')](_0xebc0('0x13'),_0xae7967,_0x48139d);_0x177fd2(_0x48139d);});});}exports['GetCmContact']=function(_0x38bcf5){var _0x392b52=this;return new Promise(function(_0x8318f4,_0x53366b){return db[_0xebc0('0x1c')][_0xebc0('0x1d')]({'raw':_0x38bcf5['options']?_0x38bcf5[_0xebc0('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x38bcf5[_0xebc0('0x1e')]?_0x38bcf5['options'][_0xebc0('0x1f')]||null:null,'attributes':_0x38bcf5['options']?_0x38bcf5[_0xebc0('0x1e')][_0xebc0('0x20')]||null:null,'limit':_0x38bcf5[_0xebc0('0x1e')]?_0x38bcf5['options'][_0xebc0('0x21')]||null:null,'include':_0x38bcf5['options']?_0x38bcf5[_0xebc0('0x1e')][_0xebc0('0x22')]?_['map'](_0x38bcf5[_0xebc0('0x1e')][_0xebc0('0x22')],function(_0xa645a2){return{'model':db[_0xa645a2['model']],'as':_0xa645a2['as'],'attributes':_0xa645a2[_0xebc0('0x20')],'include':_0xa645a2[_0xebc0('0x22')]?_[_0xebc0('0x23')](_0xa645a2[_0xebc0('0x22')],function(_0x21a19d){return{'model':db[_0x21a19d[_0xebc0('0x24')]],'as':_0x21a19d['as'],'attributes':_0x21a19d[_0xebc0('0x20')],'include':_0x21a19d[_0xebc0('0x22')]?_[_0xebc0('0x23')](_0x21a19d[_0xebc0('0x22')],function(_0x11b4b7){return{'model':db[_0x11b4b7[_0xebc0('0x24')]],'as':_0x11b4b7['as'],'attributes':_0x11b4b7[_0xebc0('0x20')]};}):[]};}):[]};}):[]:[]})[_0xebc0('0x25')](function(_0x34eb4f){logger[_0xebc0('0x12')]('GetCmContact',_0x38bcf5);logger[_0xebc0('0x15')]('GetCmContact',_0x38bcf5,JSON[_0xebc0('0x26')](_0x34eb4f));_0x8318f4(_0x34eb4f);})[_0xebc0('0x1b')](function(_0x740e32){logger[_0xebc0('0x17')](_0xebc0('0x27'),_0x740e32[_0xebc0('0x19')],_0x38bcf5);_0x53366b(_0x392b52[_0xebc0('0x17')](0x1f4,_0x740e32[_0xebc0('0x19')]));});});};exports['CreateCmContact']=function(_0x3e89fb){var _0x2aafec=this;return new Promise(function(_0x2f6dd2,_0x1e4b7d){return db['CmContact']['create'](_0x3e89fb[_0xebc0('0x28')],{'raw':_0x3e89fb[_0xebc0('0x1e')]?_0x3e89fb[_0xebc0('0x1e')][_0xebc0('0x29')]===undefined?!![]:![]:!![]})[_0xebc0('0x25')](function(_0x34b635){var _0x46b142;for(var _0x4fd9f4=0x0;_0x4fd9f4<Object['keys'](_0x3e89fb[_0xebc0('0x28')])[_0xebc0('0x2a')];_0x4fd9f4++){var _0x276ca5=Object[_0xebc0('0x2b')](_0x3e89fb[_0xebc0('0x28')])[_0x4fd9f4];if(_0x276ca5[_0xebc0('0x2c')](_0xebc0('0x2d'))){_0x46b142=squel[_0xebc0('0x2e')]()[_0xebc0('0x2f')]('cm_contacts')[_0xebc0('0x30')](_0x276ca5,_0x3e89fb['body'][_0x276ca5])[_0xebc0('0x1f')](_0xebc0('0x31'),_0x34b635['id'])[_0xebc0('0x32')]();break;}}if(!_0x46b142)return _0x34b635;return db[_0xebc0('0x33')]['query'](_0x46b142)[_0xebc0('0x25')](function(){return _0x34b635;});})[_0xebc0('0x25')](function(_0x43883c){logger[_0xebc0('0x12')](_0xebc0('0x34'),_0x3e89fb);logger[_0xebc0('0x15')]('CreateCmContact',_0x3e89fb,JSON[_0xebc0('0x26')](_0x43883c));_0x2f6dd2(_0x43883c);})['catch'](function(_0x3f8d57){logger[_0xebc0('0x17')](_0xebc0('0x34'),_0x3f8d57['message'],_0x3e89fb);_0x1e4b7d(_0x2aafec[_0xebc0('0x17')](0x1f4,_0x3f8d57[_0xebc0('0x19')]));});});};
\ No newline at end of file
+var _0xdc74=['keys','length','startsWith','cf_','update','table','cm_contacts','set','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','randomstring','squel','../../mysqldb','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','debug','CmContact,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','options','where','include','map','model','attributes','GetCmContact','CreateCmContact','CmContact','create','body','raw'];(function(_0x5da1c1,_0x282ac6){var _0x500a32=function(_0x554618){while(--_0x554618){_0x5da1c1['push'](_0x5da1c1['shift']());}};_0x500a32(++_0x282ac6);}(_0xdc74,0x1d7));var _0x4dc7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xdc74[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x4dc7('0x0'));var util=require(_0x4dc7('0x1'));var moment=require(_0x4dc7('0x2'));var BPromise=require(_0x4dc7('0x3'));var rs=require(_0x4dc7('0x4'));var fs=require('fs');var Redis=require('ioredis');var squel=require(_0x4dc7('0x5'));var db=require(_0x4dc7('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4dc7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4dc7('0x8')]({'port':0x232a});config[_0x4dc7('0x9')]=_[_0x4dc7('0xa')](config[_0x4dc7('0x9')],{'host':_0x4dc7('0xb'),'port':0x18eb});var socket=require(_0x4dc7('0xc'))(new Redis(config[_0x4dc7('0x9')]));require(_0x4dc7('0xd'))[_0x4dc7('0xe')](socket);function respondWithRpcPromise(_0x4a29b5,_0x3f444d,_0x331838){return new BPromise(function(_0x446c11,_0x529b27){return client[_0x4dc7('0xf')](_0x4a29b5,_0x331838)[_0x4dc7('0x10')](function(_0x431297){logger[_0x4dc7('0x11')](_0x4dc7('0x12'),_0x3f444d,'request\x20sent');logger[_0x4dc7('0x13')](_0x4dc7('0x14'),_0x3f444d,_0x4dc7('0x15'),JSON[_0x4dc7('0x16')](_0x431297));if(_0x431297[_0x4dc7('0x17')]){if(_0x431297[_0x4dc7('0x17')][_0x4dc7('0x18')]===0x1f4){logger[_0x4dc7('0x17')](_0x4dc7('0x12'),_0x3f444d,_0x431297['error'][_0x4dc7('0x19')]);return _0x529b27(_0x431297[_0x4dc7('0x17')][_0x4dc7('0x19')]);}logger['error'](_0x4dc7('0x12'),_0x3f444d,_0x431297[_0x4dc7('0x17')][_0x4dc7('0x19')]);return _0x446c11(_0x431297[_0x4dc7('0x17')]['message']);}else{logger[_0x4dc7('0x11')](_0x4dc7('0x12'),_0x3f444d,'request\x20sent');_0x446c11(_0x431297['result'][_0x4dc7('0x19')]);}})[_0x4dc7('0x1a')](function(_0x4841d9){logger[_0x4dc7('0x17')](_0x4dc7('0x12'),_0x3f444d,_0x4841d9);_0x529b27(_0x4841d9);});});}exports['GetCmContact']=function(_0x452148){var _0x44e0c7=this;return new Promise(function(_0x1c84b1,_0x2f1787){return db['CmContact']['findAll']({'raw':_0x452148['options']?_0x452148[_0x4dc7('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x452148[_0x4dc7('0x1b')]?_0x452148[_0x4dc7('0x1b')][_0x4dc7('0x1c')]||null:null,'attributes':_0x452148['options']?_0x452148[_0x4dc7('0x1b')]['attributes']||null:null,'limit':_0x452148[_0x4dc7('0x1b')]?_0x452148['options']['limit']||null:null,'include':_0x452148[_0x4dc7('0x1b')]?_0x452148[_0x4dc7('0x1b')][_0x4dc7('0x1d')]?_[_0x4dc7('0x1e')](_0x452148[_0x4dc7('0x1b')]['include'],function(_0x5294f4){return{'model':db[_0x5294f4[_0x4dc7('0x1f')]],'as':_0x5294f4['as'],'attributes':_0x5294f4[_0x4dc7('0x20')],'include':_0x5294f4[_0x4dc7('0x1d')]?_[_0x4dc7('0x1e')](_0x5294f4[_0x4dc7('0x1d')],function(_0x321441){return{'model':db[_0x321441[_0x4dc7('0x1f')]],'as':_0x321441['as'],'attributes':_0x321441[_0x4dc7('0x20')],'include':_0x321441[_0x4dc7('0x1d')]?_[_0x4dc7('0x1e')](_0x321441[_0x4dc7('0x1d')],function(_0x480e98){return{'model':db[_0x480e98[_0x4dc7('0x1f')]],'as':_0x480e98['as'],'attributes':_0x480e98[_0x4dc7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4dc7('0x10')](function(_0x38fab4){logger[_0x4dc7('0x11')](_0x4dc7('0x21'),_0x452148);logger[_0x4dc7('0x13')](_0x4dc7('0x21'),_0x452148,JSON[_0x4dc7('0x16')](_0x38fab4));_0x1c84b1(_0x38fab4);})[_0x4dc7('0x1a')](function(_0x58bc25){logger['error']('GetCmContact',_0x58bc25['message'],_0x452148);_0x2f1787(_0x44e0c7[_0x4dc7('0x17')](0x1f4,_0x58bc25[_0x4dc7('0x19')]));});});};exports[_0x4dc7('0x22')]=function(_0x31a7d8){var _0x5be302=this;return new Promise(function(_0x36c1c6,_0x3d7093){return db[_0x4dc7('0x23')][_0x4dc7('0x24')](_0x31a7d8[_0x4dc7('0x25')],{'raw':_0x31a7d8[_0x4dc7('0x1b')]?_0x31a7d8[_0x4dc7('0x1b')][_0x4dc7('0x26')]===undefined?!![]:![]:!![]})[_0x4dc7('0x10')](function(_0x5996ab){var _0x100b3b;for(var _0x4ecb5a=0x0;_0x4ecb5a<Object[_0x4dc7('0x27')](_0x31a7d8[_0x4dc7('0x25')])[_0x4dc7('0x28')];_0x4ecb5a++){var _0x549601=Object[_0x4dc7('0x27')](_0x31a7d8['body'])[_0x4ecb5a];if(_0x549601[_0x4dc7('0x29')](_0x4dc7('0x2a'))){_0x100b3b=squel[_0x4dc7('0x2b')]()[_0x4dc7('0x2c')](_0x4dc7('0x2d'))[_0x4dc7('0x2e')](_0x549601,_0x31a7d8[_0x4dc7('0x25')][_0x549601])[_0x4dc7('0x1c')](_0x4dc7('0x2f'),_0x5996ab['id'])[_0x4dc7('0x30')]();break;}}if(!_0x100b3b)return _0x5996ab;return db[_0x4dc7('0x31')][_0x4dc7('0x32')](_0x100b3b)[_0x4dc7('0x10')](function(){return _0x5996ab;});})[_0x4dc7('0x10')](function(_0x597b48){logger[_0x4dc7('0x11')](_0x4dc7('0x22'),_0x31a7d8);logger[_0x4dc7('0x13')]('CreateCmContact',_0x31a7d8,JSON[_0x4dc7('0x16')](_0x597b48));_0x36c1c6(_0x597b48);})[_0x4dc7('0x1a')](function(_0x5d2ebe){logger['error'](_0x4dc7('0x22'),_0x5d2ebe['message'],_0x31a7d8);_0x3d7093(_0x5be302['error'](0x1f4,_0x5d2ebe[_0x4dc7('0x19')]));});});};
\ No newline at end of file
index a4446ec..73ea598 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 8d2473d..07b80bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687f=['now','/csv','single','file','uploadCsv','diskStorage','format','/upload','import','put','/:id','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','/describe','describe','show','/:id/tags','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','getJourney','post','/merge','merge','create','/create_many','bulkCreate','setTags','join','root','server/files/tmp','originalname','replace','%s-%s%s','basename','extname'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x687f,0xa3));var _0xf687=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0x687f[_0x4e170e];return _0x338291;};'use strict';var multer=require(_0xf687('0x0'));var util=require(_0xf687('0x1'));var path=require(_0xf687('0x2'));var timeout=require('connect-timeout');var express=require(_0xf687('0x3'));var router=express[_0xf687('0x4')]();var fs_extra=require(_0xf687('0x5'));var auth=require(_0xf687('0x6'));var interaction=require(_0xf687('0x7'));var config=require(_0xf687('0x8'));var controller=require(_0xf687('0x9'));router[_0xf687('0xa')]('/',auth[_0xf687('0xb')](),controller['index']);router[_0xf687('0xa')](_0xf687('0xc'),auth[_0xf687('0xb')](),controller[_0xf687('0xd')]);router[_0xf687('0xa')]('/:id',auth[_0xf687('0xb')](),controller[_0xf687('0xe')]);router['get'](_0xf687('0xf'),auth[_0xf687('0xb')](),controller['getTags']);router[_0xf687('0xa')]('/:id/hoppers',auth[_0xf687('0xb')](),controller[_0xf687('0x10')]);router[_0xf687('0xa')](_0xf687('0x11'),auth[_0xf687('0xb')](),controller['getHopperHistories']);router[_0xf687('0xa')]('/:id/hopper_finals',auth[_0xf687('0xb')](),controller[_0xf687('0x12')]);router[_0xf687('0xa')](_0xf687('0x13'),auth[_0xf687('0xb')](),controller[_0xf687('0x14')]);router[_0xf687('0xa')]('/:id/journey',auth[_0xf687('0xb')](),controller[_0xf687('0x15')]);router[_0xf687('0x16')](_0xf687('0x17'),auth[_0xf687('0xb')](),controller[_0xf687('0x18')]);router[_0xf687('0x16')]('/',auth[_0xf687('0xb')](),controller[_0xf687('0x19')]);router['post'](_0xf687('0x1a'),auth[_0xf687('0xb')](),controller[_0xf687('0x1b')]);router[_0xf687('0x16')](_0xf687('0xf'),auth['isAuthenticated'](),controller[_0xf687('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc53824,_0x2506a8,_0x18e1a1){_0x18e1a1(null,path[_0xf687('0x1d')](config[_0xf687('0x1e')],_0xf687('0x1f')));},'filename':function(_0x4d0408,_0xd5282c,_0xc8986b){_0xd5282c['originalname']=_0xd5282c[_0xf687('0x20')][_0xf687('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xc8986b(null,util['format'](_0xf687('0x22'),path[_0xf687('0x23')](_0xd5282c[_0xf687('0x20')],path[_0xf687('0x24')](_0xd5282c['originalname'])),Date[_0xf687('0x25')](),path[_0xf687('0x24')](_0xd5282c[_0xf687('0x20')])));}})});router['post'](_0xf687('0x26'),upload[_0xf687('0x27')](_0xf687('0x28')),controller[_0xf687('0x29')]);var upload=multer({'storage':multer[_0xf687('0x2a')]({'destination':function(_0x58017c,_0x399bec,_0x35df2e){_0x35df2e(null,path['join'](config[_0xf687('0x1e')],_0xf687('0x1f')));},'filename':function(_0x2ad272,_0x4f11ef,_0x5266b3){_0x4f11ef[_0xf687('0x20')]=_0x4f11ef[_0xf687('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5266b3(null,util[_0xf687('0x2b')]('%s-%s%s',path['basename'](_0x4f11ef[_0xf687('0x20')],path[_0xf687('0x24')](_0x4f11ef[_0xf687('0x20')])),Date[_0xf687('0x25')](),path['extname'](_0x4f11ef[_0xf687('0x20')])));}})});router[_0xf687('0x16')](_0xf687('0x2c'),upload[_0xf687('0x27')](_0xf687('0x28')),controller['upload']);router['post']('/upload/:id',auth[_0xf687('0xb')](),controller[_0xf687('0x2d')]);router[_0xf687('0x2e')](_0xf687('0x2f'),auth[_0xf687('0xb')](),controller['update']);router[_0xf687('0x30')](_0xf687('0x2f'),auth[_0xf687('0xb')](),controller[_0xf687('0x31')]);module['exports']=router;
\ No newline at end of file
+var _0xa9b8=['describe','/:id','show','getTags','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','now','extname','/csv','single','file','uploadCsv','server/files/tmp','/upload','upload','/upload/:id','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x1807c4,_0x3845a9){var _0x15ef39=function(_0x55c2e1){while(--_0x55c2e1){_0x1807c4['push'](_0x1807c4['shift']());}};_0x15ef39(++_0x3845a9);}(_0xa9b8,0x95));var _0x8a9b=function(_0x420ab0,_0x39b0c2){_0x420ab0=_0x420ab0-0x0;var _0x2bbb8d=_0xa9b8[_0x420ab0];return _0x2bbb8d;};'use strict';var multer=require(_0x8a9b('0x0'));var util=require(_0x8a9b('0x1'));var path=require(_0x8a9b('0x2'));var timeout=require(_0x8a9b('0x3'));var express=require(_0x8a9b('0x4'));var router=express[_0x8a9b('0x5')]();var fs_extra=require(_0x8a9b('0x6'));var auth=require(_0x8a9b('0x7'));var interaction=require(_0x8a9b('0x8'));var config=require('../../config/environment');var controller=require('./cmContact.controller');router[_0x8a9b('0x9')]('/',auth[_0x8a9b('0xa')](),controller[_0x8a9b('0xb')]);router[_0x8a9b('0x9')](_0x8a9b('0xc'),auth['isAuthenticated'](),controller[_0x8a9b('0xd')]);router['get'](_0x8a9b('0xe'),auth[_0x8a9b('0xa')](),controller[_0x8a9b('0xf')]);router[_0x8a9b('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8a9b('0x10')]);router[_0x8a9b('0x9')](_0x8a9b('0x11'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x8a9b('0x9')]('/:id/hopper_histories',auth[_0x8a9b('0xa')](),controller[_0x8a9b('0x12')]);router['get'](_0x8a9b('0x13'),auth['isAuthenticated'](),controller[_0x8a9b('0x14')]);router[_0x8a9b('0x9')](_0x8a9b('0x15'),auth[_0x8a9b('0xa')](),controller[_0x8a9b('0x16')]);router[_0x8a9b('0x9')](_0x8a9b('0x17'),auth[_0x8a9b('0xa')](),controller[_0x8a9b('0x18')]);router[_0x8a9b('0x19')](_0x8a9b('0x1a'),auth[_0x8a9b('0xa')](),controller[_0x8a9b('0x1b')]);router[_0x8a9b('0x19')]('/',auth[_0x8a9b('0xa')](),controller[_0x8a9b('0x1c')]);router['post'](_0x8a9b('0x1d'),auth[_0x8a9b('0xa')](),controller[_0x8a9b('0x1e')]);router[_0x8a9b('0x19')]('/:id/tags',auth[_0x8a9b('0xa')](),controller[_0x8a9b('0x1f')]);var upload=multer({'storage':multer[_0x8a9b('0x20')]({'destination':function(_0x25fe7d,_0xbce946,_0x1d61e1){_0x1d61e1(null,path[_0x8a9b('0x21')](config[_0x8a9b('0x22')],'server/files/tmp'));},'filename':function(_0x4fb0d5,_0xee5a7a,_0x47327c){_0xee5a7a['originalname']=_0xee5a7a[_0x8a9b('0x23')][_0x8a9b('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x47327c(null,util[_0x8a9b('0x25')](_0x8a9b('0x26'),path[_0x8a9b('0x27')](_0xee5a7a['originalname'],path['extname'](_0xee5a7a[_0x8a9b('0x23')])),Date[_0x8a9b('0x28')](),path[_0x8a9b('0x29')](_0xee5a7a[_0x8a9b('0x23')])));}})});router[_0x8a9b('0x19')](_0x8a9b('0x2a'),upload[_0x8a9b('0x2b')](_0x8a9b('0x2c')),controller[_0x8a9b('0x2d')]);var upload=multer({'storage':multer[_0x8a9b('0x20')]({'destination':function(_0x23b227,_0x4302be,_0x46cb59){_0x46cb59(null,path[_0x8a9b('0x21')](config[_0x8a9b('0x22')],_0x8a9b('0x2e')));},'filename':function(_0x3f91ba,_0x568116,_0x2b59e3){_0x568116[_0x8a9b('0x23')]=_0x568116['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2b59e3(null,util[_0x8a9b('0x25')](_0x8a9b('0x26'),path[_0x8a9b('0x27')](_0x568116['originalname'],path['extname'](_0x568116[_0x8a9b('0x23')])),Date[_0x8a9b('0x28')](),path[_0x8a9b('0x29')](_0x568116['originalname'])));}})});router[_0x8a9b('0x19')](_0x8a9b('0x2f'),upload[_0x8a9b('0x2b')](_0x8a9b('0x2c')),controller[_0x8a9b('0x30')]);router[_0x8a9b('0x19')](_0x8a9b('0x31'),auth[_0x8a9b('0xa')](),controller['import']);router[_0x8a9b('0x32')](_0x8a9b('0xe'),auth[_0x8a9b('0xa')](),controller[_0x8a9b('0x33')]);router[_0x8a9b('0x34')](_0x8a9b('0xe'),auth[_0x8a9b('0xa')](),controller['destroy']);module[_0x8a9b('0x35')]=router;
\ No newline at end of file
index eb60d92..f4279b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00ed=['alias','STRING','setDataValue','name','long','type','select','values','getDataValue','isArray','stringify','BOOLEAN','ENUM','sequelize','lodash','VIRTUAL'];(function(_0x5c6f53,_0x5f08f6){var _0x4b9fff=function(_0x34595f){while(--_0x34595f){_0x5c6f53['push'](_0x5c6f53['shift']());}};_0x4b9fff(++_0x5f08f6);}(_0x00ed,0x17d));var _0xd00e=function(_0x578b94,_0x4bcd37){_0x578b94=_0x578b94-0x0;var _0x2f670a=_0x00ed[_0x578b94];return _0x2f670a;};'use strict';var Sequelize=require(_0xd00e('0x0'));var _=require(_0xd00e('0x1'));module['exports']={'name':{'type':Sequelize[_0xd00e('0x2')],'get':function(_0x1d7a71){return this['getDataValue'](_0xd00e('0x3'));}},'alias':{'type':Sequelize[_0xd00e('0x4')],'allowNull':![],'set':function(_0x90de0a){this[_0xd00e('0x5')](_0xd00e('0x3'),_0x90de0a?_0x90de0a:this['getDataValue'](_0xd00e('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xd00e('0x7')),'get':function(){if(this['getDataValue'](_0xd00e('0x8'))===_0xd00e('0x9')){return JSON['parse'](this['getDataValue'](_0xd00e('0xa')));}else{return this[_0xd00e('0xb')](_0xd00e('0xa'));}},'set':function(_0x196287){if(Array[_0xd00e('0xc')](_0x196287)){this['setDataValue'](_0xd00e('0xa'),JSON[_0xd00e('0xd')](_0x196287));}else{this[_0xd00e('0x5')](_0xd00e('0xa'),_0x196287);}}},'required':{'type':Sequelize[_0xd00e('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xd00e('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xd00e('0xf')]('voice')}};
\ No newline at end of file
+var _0xc207=['getDataValue','alias','STRING','setDataValue','name','long','type','parse','values','isArray','BOOLEAN','ENUM','sequelize','lodash','exports','VIRTUAL'];(function(_0x407216,_0x326db5){var _0x4c7ff6=function(_0x58acc4){while(--_0x58acc4){_0x407216['push'](_0x407216['shift']());}};_0x4c7ff6(++_0x326db5);}(_0xc207,0x12c));var _0x7c20=function(_0x4c3f13,_0x4c1782){_0x4c3f13=_0x4c3f13-0x0;var _0x74adc6=_0xc207[_0x4c3f13];return _0x74adc6;};'use strict';var Sequelize=require(_0x7c20('0x0'));var _=require(_0x7c20('0x1'));module[_0x7c20('0x2')]={'name':{'type':Sequelize[_0x7c20('0x3')],'get':function(_0x6bfd43){return this[_0x7c20('0x4')](_0x7c20('0x5'));}},'alias':{'type':Sequelize[_0x7c20('0x6')],'allowNull':![],'set':function(_0x4c2b57){this[_0x7c20('0x7')]('alias',_0x4c2b57?_0x4c2b57:this[_0x7c20('0x4')](_0x7c20('0x8')));}},'type':{'type':Sequelize[_0x7c20('0x6')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x7c20('0x9')),'get':function(){if(this[_0x7c20('0x4')](_0x7c20('0xa'))==='select'){return JSON[_0x7c20('0xb')](this['getDataValue'](_0x7c20('0xc')));}else{return this[_0x7c20('0x4')](_0x7c20('0xc'));}},'set':function(_0x34f5e7){if(Array[_0x7c20('0xd')](_0x34f5e7)){this[_0x7c20('0x7')](_0x7c20('0xc'),JSON['stringify'](_0x34f5e7));}else{this[_0x7c20('0x7')](_0x7c20('0xc'),_0x34f5e7);}}},'required':{'type':Sequelize[_0x7c20('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7c20('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x7c20('0xf')]('voice')}};
\ No newline at end of file
index 255cb00..3638d78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5d1=['sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','CmCustomField','includeAll','include','rows','catch','show','params','rawAttributes','find','body','create','transaction','Sequelize','TEXT','INTEGER','defaultValue','sequelize','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x4105c5,_0x63f0af){var _0x5cfb55=function(_0x7ba13b){while(--_0x7ba13b){_0x4105c5['push'](_0x4105c5['shift']());}};_0x5cfb55(++_0x63f0af);}(_0xa5d1,0xfd));var _0x1a5d=function(_0x32c171,_0x5b06d7){_0x32c171=_0x32c171-0x0;var _0xe37209=_0xa5d1[_0x32c171];return _0xe37209;};'use strict';var emlformat=require(_0x1a5d('0x0'));var rimraf=require(_0x1a5d('0x1'));var zipdir=require(_0x1a5d('0x2'));var jsonpatch=require(_0x1a5d('0x3'));var rp=require(_0x1a5d('0x4'));var moment=require(_0x1a5d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1a5d('0x6'));var util=require(_0x1a5d('0x7'));var path=require('path');var sox=require(_0x1a5d('0x8'));var csv=require(_0x1a5d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a5d('0xa'));var _=require('lodash');var squel=require(_0x1a5d('0xb'));var crypto=require(_0x1a5d('0xc'));var jsforce=require(_0x1a5d('0xd'));var deskjs=require(_0x1a5d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1a5d('0xf'));var Papa=require(_0x1a5d('0x10'));var Redis=require(_0x1a5d('0x11'));var authService=require(_0x1a5d('0x12'));var qs=require(_0x1a5d('0x13'));var as=require(_0x1a5d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a5d('0x15'))(_0x1a5d('0x16'));var utils=require(_0x1a5d('0x17'));var config=require(_0x1a5d('0x18'));var licenseUtil=require(_0x1a5d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x250500,_0x12f8ec){_0x12f8ec=_0x12f8ec||0xcc;return function(_0x1d431c){if(_0x1d431c){return _0x250500[_0x1a5d('0x1a')](_0x12f8ec);}return _0x250500[_0x1a5d('0x1b')](_0x12f8ec)[_0x1a5d('0x1c')]();};}function respondWithResult(_0x4e5810,_0x5d585e){_0x5d585e=_0x5d585e||0xc8;return function(_0x3f698d){if(_0x3f698d){return _0x4e5810['status'](_0x5d585e)['json'](_0x3f698d);}};}function respondWithFilteredResult(_0x1e01c5,_0x5906bf){return function(_0x5c8473){if(_0x5c8473){var _0x2e1dea=typeof _0x5906bf['offset']==='undefined'&&typeof _0x5906bf[_0x1a5d('0x1d')]==='undefined';var _0x2387dc=_0x5c8473['count'];var _0x292cc3=_0x2e1dea?0x0:_0x5906bf[_0x1a5d('0x1e')];var _0x1dc572=_0x2e1dea?_0x5c8473[_0x1a5d('0x1f')]:_0x5906bf[_0x1a5d('0x1e')]+_0x5906bf[_0x1a5d('0x1d')];var _0xededc0;if(_0x1dc572>=_0x2387dc){_0x1dc572=_0x2387dc;_0xededc0=0xc8;}else{_0xededc0=0xce;}_0x1e01c5[_0x1a5d('0x1b')](_0xededc0);return _0x1e01c5[_0x1a5d('0x20')](_0x1a5d('0x21'),_0x292cc3+'-'+_0x1dc572+'/'+_0x2387dc)[_0x1a5d('0x22')](_0x5c8473);}return null;};}function patchUpdates(_0xb63f95){return function(_0x16d67e){try{jsonpatch[_0x1a5d('0x23')](_0x16d67e,_0xb63f95,!![]);}catch(_0x5a3c8c){return BPromise[_0x1a5d('0x24')](_0x5a3c8c);}return _0x16d67e[_0x1a5d('0x25')]();};}function saveUpdates(_0x3ef090,_0x33e13f){return function(_0xdf478f){if(_0xdf478f){return _0xdf478f[_0x1a5d('0x26')](_0x3ef090)[_0x1a5d('0x27')](function(_0x45f7a2){return _0x45f7a2;});}return null;};}function removeEntity(_0x1e0192,_0x4df58c){return function(_0x14730c){if(_0x14730c){return _0x14730c[_0x1a5d('0x28')]()[_0x1a5d('0x27')](function(){_0x1e0192[_0x1a5d('0x1b')](0xcc)[_0x1a5d('0x1c')]();});}};}function handleEntityNotFound(_0x15fb1e,_0x30fa77){return function(_0x4a927b){if(!_0x4a927b){_0x15fb1e[_0x1a5d('0x1a')](0x194);}return _0x4a927b;};}function handleError(_0x50493c,_0x5b922f){_0x5b922f=_0x5b922f||0x1f4;return function(_0x1d80c6){logger[_0x1a5d('0x29')](_0x1d80c6[_0x1a5d('0x2a')]);if(_0x1d80c6[_0x1a5d('0x2b')]){delete _0x1d80c6[_0x1a5d('0x2b')];}_0x50493c[_0x1a5d('0x1b')](_0x5b922f)[_0x1a5d('0x2c')](_0x1d80c6);};}exports[_0x1a5d('0x2d')]=function(_0x5c890,_0x55716c){var _0x48886c={},_0x16cb75={},_0x4658e6={'count':0x0,'rows':[]};var _0x1d839f=_[_0x1a5d('0x2e')](db['CmCustomField']['rawAttributes'],function(_0x543846){return{'name':_0x543846[_0x1a5d('0x2f')],'type':_0x543846[_0x1a5d('0x30')][_0x1a5d('0x31')]};});_0x16cb75[_0x1a5d('0x32')]=_['differenceBy'](_[_0x1a5d('0x2e')](_0x1d839f,_0x1a5d('0x2b')),[_0x1a5d('0x2b')]);_0x16cb75[_0x1a5d('0x33')]=_[_0x1a5d('0x34')](_0x5c890[_0x1a5d('0x33')]);_0x16cb75[_0x1a5d('0x35')]=_[_0x1a5d('0x36')](_0x16cb75[_0x1a5d('0x32')],_0x16cb75[_0x1a5d('0x33')]);_0x48886c[_0x1a5d('0x37')]=_[_0x1a5d('0x36')](_0x16cb75[_0x1a5d('0x32')],qs[_0x1a5d('0x38')](_0x5c890[_0x1a5d('0x33')][_0x1a5d('0x38')]));_0x48886c[_0x1a5d('0x37')]=_0x48886c[_0x1a5d('0x37')][_0x1a5d('0x39')]?_0x48886c['attributes']:_0x16cb75['model'];if(!_0x5c890['query'][_0x1a5d('0x3a')]('nolimit')){_0x48886c[_0x1a5d('0x1d')]=qs[_0x1a5d('0x1d')](_0x5c890[_0x1a5d('0x33')]['limit']);_0x48886c[_0x1a5d('0x1e')]=qs[_0x1a5d('0x1e')](_0x5c890['query'][_0x1a5d('0x1e')]);}_0x48886c[_0x1a5d('0x3b')]=qs[_0x1a5d('0x3c')](_0x5c890[_0x1a5d('0x33')][_0x1a5d('0x3c')]);_0x48886c[_0x1a5d('0x3d')]=qs['filters'](_[_0x1a5d('0x3e')](_0x5c890[_0x1a5d('0x33')],_0x16cb75[_0x1a5d('0x35')]),_0x1d839f);if(_0x5c890[_0x1a5d('0x33')]['filter']){_0x48886c[_0x1a5d('0x3d')]=_[_0x1a5d('0x3f')](_0x48886c[_0x1a5d('0x3d')],{'$or':_[_0x1a5d('0x2e')](_0x1d839f,function(_0x340893){if(_0x340893[_0x1a5d('0x30')]!==_0x1a5d('0x40')){var _0x1c04f7={};_0x1c04f7[_0x340893[_0x1a5d('0x2b')]]={'$like':'%'+_0x5c890[_0x1a5d('0x33')][_0x1a5d('0x41')]+'%'};return _0x1c04f7;}})});}_0x48886c=_[_0x1a5d('0x3f')]({},_0x48886c,_0x5c890[_0x1a5d('0x42')]);var _0x1e13e3={'where':_0x48886c[_0x1a5d('0x3d')]};return db[_0x1a5d('0x43')][_0x1a5d('0x1f')](_0x1e13e3)[_0x1a5d('0x27')](function(_0xfc09c8){_0x4658e6[_0x1a5d('0x1f')]=_0xfc09c8;if(_0x5c890['query'][_0x1a5d('0x44')]){_0x48886c[_0x1a5d('0x45')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x48886c);})['then'](function(_0x36934a){_0x4658e6[_0x1a5d('0x46')]=_0x36934a;return _0x4658e6;})[_0x1a5d('0x27')](respondWithFilteredResult(_0x55716c,_0x48886c))[_0x1a5d('0x47')](handleError(_0x55716c,null));};exports[_0x1a5d('0x48')]=function(_0x32d031,_0x38e8a4){var _0x49f9ef={'raw':!![],'where':{'id':_0x32d031[_0x1a5d('0x49')]['id']}},_0x21e586={};_0x21e586['model']=_[_0x1a5d('0x34')](db['CmCustomField'][_0x1a5d('0x4a')]);_0x21e586[_0x1a5d('0x33')]=_[_0x1a5d('0x34')](_0x32d031[_0x1a5d('0x33')]);_0x21e586[_0x1a5d('0x35')]=_[_0x1a5d('0x36')](_0x21e586[_0x1a5d('0x32')],_0x21e586[_0x1a5d('0x33')]);_0x49f9ef[_0x1a5d('0x37')]=_[_0x1a5d('0x36')](_0x21e586['model'],qs['fields'](_0x32d031['query'][_0x1a5d('0x38')]));_0x49f9ef[_0x1a5d('0x37')]=_0x49f9ef[_0x1a5d('0x37')]['length']?_0x49f9ef['attributes']:_0x21e586[_0x1a5d('0x32')];if(_0x32d031[_0x1a5d('0x33')][_0x1a5d('0x44')]){_0x49f9ef[_0x1a5d('0x45')]=[{'all':!![]}];}_0x49f9ef=_[_0x1a5d('0x3f')]({},_0x49f9ef,_0x32d031[_0x1a5d('0x42')]);return db[_0x1a5d('0x43')][_0x1a5d('0x4b')](_0x49f9ef)[_0x1a5d('0x27')](handleEntityNotFound(_0x38e8a4,null))[_0x1a5d('0x27')](respondWithResult(_0x38e8a4,null))[_0x1a5d('0x47')](handleError(_0x38e8a4,null));};exports[_0x1a5d('0x26')]=function(_0x3ec613,_0x264867){if(_0x3ec613[_0x1a5d('0x4c')]['id']){delete _0x3ec613[_0x1a5d('0x4c')]['id'];}return db[_0x1a5d('0x43')]['find']({'where':{'id':_0x3ec613['params']['id']}})[_0x1a5d('0x27')](handleEntityNotFound(_0x264867,null))['then'](saveUpdates(_0x3ec613[_0x1a5d('0x4c')],null))[_0x1a5d('0x27')](respondWithResult(_0x264867,null))[_0x1a5d('0x47')](handleError(_0x264867,null));};exports[_0x1a5d('0x28')]=function(_0x39b24c,_0x196acb){return db[_0x1a5d('0x43')][_0x1a5d('0x4b')]({'where':{'id':_0x39b24c[_0x1a5d('0x49')]['id']}})[_0x1a5d('0x27')](handleEntityNotFound(_0x196acb,null))[_0x1a5d('0x27')](removeEntity(_0x196acb,null))[_0x1a5d('0x47')](handleError(_0x196acb,null));};exports[_0x1a5d('0x4d')]=function(_0x49fb00,_0x1f5891){var _0x1fea06;return db['sequelize'][_0x1a5d('0x4e')](function(_0x1040cb){return db[_0x1a5d('0x43')]['create'](_0x49fb00['body'],{'transaction':_0x1040cb})['then'](function(_0x4a25ae){_0x1fea06=_0x4a25ae;var _0x4e8ed8={'type':db[_0x1a5d('0x4f')][_0x1a5d('0x50')],'transaction':_0x1040cb};switch(_0x49fb00[_0x1a5d('0x4c')][_0x1a5d('0x30')]){case'text':_0x4e8ed8[_0x1a5d('0x30')]=db[_0x1a5d('0x4f')]['TEXT'];break;case'number':_0x4e8ed8['type']=db[_0x1a5d('0x4f')][_0x1a5d('0x51')];break;case'switch':_0x4e8ed8[_0x1a5d('0x30')]=db[_0x1a5d('0x4f')]['BOOLEAN'];_0x4e8ed8[_0x1a5d('0x52')]=![];break;default:}return db[_0x1a5d('0x53')]['queryInterface']['addColumn'](_0x1a5d('0x54'),util[_0x1a5d('0x55')](_0x1a5d('0x56'),_0x1fea06['id']),_0x4e8ed8);})['then'](function(){return _0x1fea06;});})['then'](respondWithResult(_0x1f5891,0xc9))[_0x1a5d('0x47')](handleError(_0x1f5891,null));};
\ No newline at end of file
+var _0xaec1=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','find','catch','body','params','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','then','destroy','error','stack','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaec1,0x127));var _0x1aec=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0xaec1[_0x548627];return _0x844a84;};'use strict';var emlformat=require(_0x1aec('0x0'));var rimraf=require(_0x1aec('0x1'));var zipdir=require(_0x1aec('0x2'));var jsonpatch=require(_0x1aec('0x3'));var rp=require('request-promise');var moment=require(_0x1aec('0x4'));var BPromise=require(_0x1aec('0x5'));var Mustache=require(_0x1aec('0x6'));var util=require(_0x1aec('0x7'));var path=require(_0x1aec('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1aec('0x9'));var fs=require('fs');var fs_extra=require(_0x1aec('0xa'));var _=require(_0x1aec('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1aec('0xc'));var toCsv=require(_0x1aec('0xd'));var querystring=require(_0x1aec('0xe'));var Papa=require(_0x1aec('0xf'));var Redis=require(_0x1aec('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1aec('0x11'));var hardwareService=require(_0x1aec('0x12'));var logger=require(_0x1aec('0x13'))(_0x1aec('0x14'));var utils=require(_0x1aec('0x15'));var config=require(_0x1aec('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1aec('0x17'))['db'];function respondWithStatusCode(_0x2b03e7,_0x356d25){_0x356d25=_0x356d25||0xcc;return function(_0x2db0cd){if(_0x2db0cd){return _0x2b03e7[_0x1aec('0x18')](_0x356d25);}return _0x2b03e7[_0x1aec('0x19')](_0x356d25)[_0x1aec('0x1a')]();};}function respondWithResult(_0x331de6,_0x1c4f9f){_0x1c4f9f=_0x1c4f9f||0xc8;return function(_0x4d4993){if(_0x4d4993){return _0x331de6[_0x1aec('0x19')](_0x1c4f9f)['json'](_0x4d4993);}};}function respondWithFilteredResult(_0x186614,_0x556a82){return function(_0x53c7af){if(_0x53c7af){var _0x369b69=typeof _0x556a82['offset']===_0x1aec('0x1b')&&typeof _0x556a82[_0x1aec('0x1c')]==='undefined';var _0x5d5a23=_0x53c7af[_0x1aec('0x1d')];var _0x49eda1=_0x369b69?0x0:_0x556a82[_0x1aec('0x1e')];var _0x247033=_0x369b69?_0x53c7af[_0x1aec('0x1d')]:_0x556a82[_0x1aec('0x1e')]+_0x556a82[_0x1aec('0x1c')];var _0x44187f;if(_0x247033>=_0x5d5a23){_0x247033=_0x5d5a23;_0x44187f=0xc8;}else{_0x44187f=0xce;}_0x186614['status'](_0x44187f);return _0x186614[_0x1aec('0x1f')](_0x1aec('0x20'),_0x49eda1+'-'+_0x247033+'/'+_0x5d5a23)[_0x1aec('0x21')](_0x53c7af);}return null;};}function patchUpdates(_0x375f27){return function(_0x4a9d22){try{jsonpatch['apply'](_0x4a9d22,_0x375f27,!![]);}catch(_0x517c38){return BPromise[_0x1aec('0x22')](_0x517c38);}return _0x4a9d22['save']();};}function saveUpdates(_0x376248,_0x325669){return function(_0x1085ef){if(_0x1085ef){return _0x1085ef['update'](_0x376248)[_0x1aec('0x23')](function(_0x1eca69){return _0x1eca69;});}return null;};}function removeEntity(_0x306766,_0x35691c){return function(_0x3b50ed){if(_0x3b50ed){return _0x3b50ed[_0x1aec('0x24')]()[_0x1aec('0x23')](function(){_0x306766[_0x1aec('0x19')](0xcc)[_0x1aec('0x1a')]();});}};}function handleEntityNotFound(_0x496148,_0x10827e){return function(_0x336e1a){if(!_0x336e1a){_0x496148['sendStatus'](0x194);}return _0x336e1a;};}function handleError(_0x585ab9,_0x5c43ff){_0x5c43ff=_0x5c43ff||0x1f4;return function(_0xe2d04e){logger[_0x1aec('0x25')](_0xe2d04e[_0x1aec('0x26')]);if(_0xe2d04e['name']){delete _0xe2d04e['name'];}_0x585ab9[_0x1aec('0x19')](_0x5c43ff)['send'](_0xe2d04e);};}exports[_0x1aec('0x27')]=function(_0x204788,_0x42e20b){var _0x4271b9={},_0x7ea0f9={},_0x3b73aa={'count':0x0,'rows':[]};var _0x14b03a=_[_0x1aec('0x28')](db[_0x1aec('0x29')][_0x1aec('0x2a')],function(_0x104107){return{'name':_0x104107[_0x1aec('0x2b')],'type':_0x104107[_0x1aec('0x2c')][_0x1aec('0x2d')]};});_0x7ea0f9[_0x1aec('0x2e')]=_[_0x1aec('0x2f')](_['map'](_0x14b03a,_0x1aec('0x30')),[_0x1aec('0x30')]);_0x7ea0f9[_0x1aec('0x31')]=_[_0x1aec('0x32')](_0x204788[_0x1aec('0x31')]);_0x7ea0f9[_0x1aec('0x33')]=_[_0x1aec('0x34')](_0x7ea0f9[_0x1aec('0x2e')],_0x7ea0f9[_0x1aec('0x31')]);_0x4271b9['attributes']=_[_0x1aec('0x34')](_0x7ea0f9['model'],qs[_0x1aec('0x35')](_0x204788[_0x1aec('0x31')]['fields']));_0x4271b9['attributes']=_0x4271b9[_0x1aec('0x36')][_0x1aec('0x37')]?_0x4271b9['attributes']:_0x7ea0f9[_0x1aec('0x2e')];if(!_0x204788['query'][_0x1aec('0x38')](_0x1aec('0x39'))){_0x4271b9[_0x1aec('0x1c')]=qs[_0x1aec('0x1c')](_0x204788[_0x1aec('0x31')][_0x1aec('0x1c')]);_0x4271b9[_0x1aec('0x1e')]=qs['offset'](_0x204788[_0x1aec('0x31')][_0x1aec('0x1e')]);}_0x4271b9[_0x1aec('0x3a')]=qs[_0x1aec('0x3b')](_0x204788[_0x1aec('0x31')][_0x1aec('0x3b')]);_0x4271b9[_0x1aec('0x3c')]=qs['filters'](_[_0x1aec('0x3d')](_0x204788[_0x1aec('0x31')],_0x7ea0f9['filters']),_0x14b03a);if(_0x204788[_0x1aec('0x31')][_0x1aec('0x3e')]){_0x4271b9['where']=_[_0x1aec('0x3f')](_0x4271b9[_0x1aec('0x3c')],{'$or':_[_0x1aec('0x28')](_0x14b03a,function(_0x559877){if(_0x559877[_0x1aec('0x2c')]!=='VIRTUAL'){var _0x1dfccd={};_0x1dfccd[_0x559877[_0x1aec('0x30')]]={'$like':'%'+_0x204788[_0x1aec('0x31')][_0x1aec('0x3e')]+'%'};return _0x1dfccd;}})});}_0x4271b9=_[_0x1aec('0x3f')]({},_0x4271b9,_0x204788[_0x1aec('0x40')]);var _0x2c93f4={'where':_0x4271b9['where']};return db[_0x1aec('0x29')]['count'](_0x2c93f4)[_0x1aec('0x23')](function(_0x7e04b4){_0x3b73aa[_0x1aec('0x1d')]=_0x7e04b4;if(_0x204788['query'][_0x1aec('0x41')]){_0x4271b9['include']=[{'all':!![]}];}return db[_0x1aec('0x29')][_0x1aec('0x42')](_0x4271b9);})['then'](function(_0x42a493){_0x3b73aa[_0x1aec('0x43')]=_0x42a493;return _0x3b73aa;})[_0x1aec('0x23')](respondWithFilteredResult(_0x42e20b,_0x4271b9))['catch'](handleError(_0x42e20b,null));};exports['show']=function(_0x1ca717,_0x3cf391){var _0x161ba4={'raw':!![],'where':{'id':_0x1ca717['params']['id']}},_0x18b810={};_0x18b810[_0x1aec('0x2e')]=_['keys'](db['CmCustomField'][_0x1aec('0x2a')]);_0x18b810[_0x1aec('0x31')]=_[_0x1aec('0x32')](_0x1ca717['query']);_0x18b810[_0x1aec('0x33')]=_[_0x1aec('0x34')](_0x18b810[_0x1aec('0x2e')],_0x18b810[_0x1aec('0x31')]);_0x161ba4['attributes']=_[_0x1aec('0x34')](_0x18b810[_0x1aec('0x2e')],qs['fields'](_0x1ca717[_0x1aec('0x31')][_0x1aec('0x35')]));_0x161ba4[_0x1aec('0x36')]=_0x161ba4[_0x1aec('0x36')]['length']?_0x161ba4['attributes']:_0x18b810['model'];if(_0x1ca717[_0x1aec('0x31')][_0x1aec('0x41')]){_0x161ba4['include']=[{'all':!![]}];}_0x161ba4=_['merge']({},_0x161ba4,_0x1ca717[_0x1aec('0x40')]);return db[_0x1aec('0x29')][_0x1aec('0x44')](_0x161ba4)[_0x1aec('0x23')](handleEntityNotFound(_0x3cf391,null))[_0x1aec('0x23')](respondWithResult(_0x3cf391,null))[_0x1aec('0x45')](handleError(_0x3cf391,null));};exports['update']=function(_0x4d446f,_0x14d4bb){if(_0x4d446f[_0x1aec('0x46')]['id']){delete _0x4d446f[_0x1aec('0x46')]['id'];}return db['CmCustomField'][_0x1aec('0x44')]({'where':{'id':_0x4d446f[_0x1aec('0x47')]['id']}})[_0x1aec('0x23')](handleEntityNotFound(_0x14d4bb,null))[_0x1aec('0x23')](saveUpdates(_0x4d446f[_0x1aec('0x46')],null))[_0x1aec('0x23')](respondWithResult(_0x14d4bb,null))['catch'](handleError(_0x14d4bb,null));};exports[_0x1aec('0x24')]=function(_0x3f0910,_0x3ed630){return db[_0x1aec('0x29')][_0x1aec('0x44')]({'where':{'id':_0x3f0910[_0x1aec('0x47')]['id']}})[_0x1aec('0x23')](handleEntityNotFound(_0x3ed630,null))['then'](removeEntity(_0x3ed630,null))[_0x1aec('0x45')](handleError(_0x3ed630,null));};exports[_0x1aec('0x48')]=function(_0x41b198,_0x560ef8){var _0x4291ac;return db[_0x1aec('0x49')][_0x1aec('0x4a')](function(_0x5e0421){return db[_0x1aec('0x29')][_0x1aec('0x48')](_0x41b198[_0x1aec('0x46')],{'transaction':_0x5e0421})[_0x1aec('0x23')](function(_0x9ba96){_0x4291ac=_0x9ba96;var _0x57c29b={'type':db['Sequelize'][_0x1aec('0x4b')],'transaction':_0x5e0421};switch(_0x41b198[_0x1aec('0x46')]['type']){case _0x1aec('0x4c'):_0x57c29b[_0x1aec('0x2c')]=db[_0x1aec('0x4d')][_0x1aec('0x4b')];break;case _0x1aec('0x4e'):_0x57c29b['type']=db[_0x1aec('0x4d')][_0x1aec('0x4f')];break;case _0x1aec('0x50'):_0x57c29b['type']=db[_0x1aec('0x4d')]['BOOLEAN'];_0x57c29b[_0x1aec('0x51')]=![];break;default:}return db[_0x1aec('0x49')][_0x1aec('0x52')][_0x1aec('0x53')](_0x1aec('0x54'),util[_0x1aec('0x55')]('cf_%d',_0x4291ac['id']),_0x57c29b);})[_0x1aec('0x23')](function(){return _0x4291ac;});})[_0x1aec('0x23')](respondWithResult(_0x560ef8,0xc9))[_0x1aec('0x45')](handleError(_0x560ef8,null));};
\ No newline at end of file
index ad89e92..08fe07a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ca9=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ca9,0x18a));var _0x90ca=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ca9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x90ca('0x0'));var util=require(_0x90ca('0x1'));var logger=require(_0x90ca('0x2'))(_0x90ca('0x3'));var moment=require('moment');var BPromise=require(_0x90ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90ca('0x5'));var rimraf=require(_0x90ca('0x6'));var config=require(_0x90ca('0x7'));var attributes=require(_0x90ca('0x8'));module[_0x90ca('0x9')]=function(_0xf518d2,_0xab1da5){return _0xf518d2[_0x90ca('0xa')]('CmCustomField',attributes,{'tableName':_0x90ca('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa423=['api','request-promise','path','rimraf','./cmCustomField.attributes','exports','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa423,0xb6));var _0x3a42=function(_0x34e5a3,_0x4aacf6){_0x34e5a3=_0x34e5a3-0x0;var _0x294114=_0xa423[_0x34e5a3];return _0x294114;};'use strict';var _=require(_0x3a42('0x0'));var util=require(_0x3a42('0x1'));var logger=require('../../config/logger')(_0x3a42('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3a42('0x3'));var fs=require('fs');var path=require(_0x3a42('0x4'));var rimraf=require(_0x3a42('0x5'));var config=require('../../config/environment');var attributes=require(_0x3a42('0x6'));module[_0x3a42('0x7')]=function(_0x44285e,_0x395742){return _0x44285e['define']('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f3155f9..e861cb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3e6=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x5fc4f9,_0x75415d){var _0x3d82ab=function(_0x233903){while(--_0x233903){_0x5fc4f9['push'](_0x5fc4f9['shift']());}};_0x3d82ab(++_0x75415d);}(_0xe3e6,0x10f));var _0x6e3e=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe3e6[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x6e3e('0x0'));var moment=require(_0x6e3e('0x1'));var BPromise=require(_0x6e3e('0x2'));var rs=require(_0x6e3e('0x3'));var fs=require('fs');var Redis=require(_0x6e3e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e3e('0x5'));var logger=require(_0x6e3e('0x6'))('rpc');var config=require(_0x6e3e('0x7'));var jayson=require(_0x6e3e('0x8'));var client=jayson[_0x6e3e('0x9')][_0x6e3e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265fab,_0x3945bd,_0x54e127){return new BPromise(function(_0x296ced,_0x4141f0){return client[_0x6e3e('0xb')](_0x265fab,_0x54e127)['then'](function(_0x1f5b58){logger[_0x6e3e('0xc')](_0x6e3e('0xd'),_0x3945bd,_0x6e3e('0xe'));logger[_0x6e3e('0xf')](_0x6e3e('0x10'),_0x3945bd,'request\x20sent',JSON[_0x6e3e('0x11')](_0x1f5b58));if(_0x1f5b58['error']){if(_0x1f5b58[_0x6e3e('0x12')][_0x6e3e('0x13')]===0x1f4){logger[_0x6e3e('0x12')](_0x6e3e('0xd'),_0x3945bd,_0x1f5b58[_0x6e3e('0x12')][_0x6e3e('0x14')]);return _0x4141f0(_0x1f5b58[_0x6e3e('0x12')]['message']);}logger[_0x6e3e('0x12')](_0x6e3e('0xd'),_0x3945bd,_0x1f5b58[_0x6e3e('0x12')][_0x6e3e('0x14')]);return _0x296ced(_0x1f5b58['error'][_0x6e3e('0x14')]);}else{logger['info'](_0x6e3e('0xd'),_0x3945bd,_0x6e3e('0xe'));_0x296ced(_0x1f5b58[_0x6e3e('0x15')][_0x6e3e('0x14')]);}})[_0x6e3e('0x16')](function(_0xa2f710){logger[_0x6e3e('0x12')](_0x6e3e('0xd'),_0x3945bd,_0xa2f710);_0x4141f0(_0xa2f710);});});}
\ No newline at end of file
+var _0x2b44=['CmCustomField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','request\x20sent','debug','stringify','error'];(function(_0x364b99,_0x3c96fd){var _0x51916f=function(_0xd83e52){while(--_0xd83e52){_0x364b99['push'](_0x364b99['shift']());}};_0x51916f(++_0x3c96fd);}(_0x2b44,0xb7));var _0x42b4=function(_0x39a02e,_0x42e71e){_0x39a02e=_0x39a02e-0x0;var _0x40421d=_0x2b44[_0x39a02e];return _0x40421d;};'use strict';var _=require(_0x42b4('0x0'));var util=require(_0x42b4('0x1'));var moment=require(_0x42b4('0x2'));var BPromise=require(_0x42b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42b4('0x4'));var db=require(_0x42b4('0x5'))['db'];var utils=require(_0x42b4('0x6'));var logger=require(_0x42b4('0x7'))('rpc');var config=require(_0x42b4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x42b4('0x9')][_0x42b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3be9a5,_0x42a740,_0x452f6a){return new BPromise(function(_0x4a9f4e,_0x433ae9){return client['request'](_0x3be9a5,_0x452f6a)[_0x42b4('0xb')](function(_0x253011){logger[_0x42b4('0xc')]('CmCustomField,\x20%s,\x20%s',_0x42a740,_0x42b4('0xd'));logger[_0x42b4('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x42a740,_0x42b4('0xd'),JSON[_0x42b4('0xf')](_0x253011));if(_0x253011[_0x42b4('0x10')]){if(_0x253011['error']['code']===0x1f4){logger['error'](_0x42b4('0x11'),_0x42a740,_0x253011[_0x42b4('0x10')]['message']);return _0x433ae9(_0x253011[_0x42b4('0x10')][_0x42b4('0x12')]);}logger[_0x42b4('0x10')](_0x42b4('0x11'),_0x42a740,_0x253011[_0x42b4('0x10')]['message']);return _0x4a9f4e(_0x253011[_0x42b4('0x10')][_0x42b4('0x12')]);}else{logger[_0x42b4('0xc')](_0x42b4('0x11'),_0x42a740,'request\x20sent');_0x4a9f4e(_0x253011[_0x42b4('0x13')][_0x42b4('0x12')]);}})['catch'](function(_0x20d9b1){logger['error']('CmCustomField,\x20%s,\x20%s',_0x42a740,_0x20d9b1);_0x433ae9(_0x20d9b1);});});}
\ No newline at end of file
index 20ec4a1..b55bed6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8813=['index','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmCustomField.controller','get','isAuthenticated'];(function(_0x4e87f0,_0x5dbc5e){var _0x323eb5=function(_0x36af09){while(--_0x36af09){_0x4e87f0['push'](_0x4e87f0['shift']());}};_0x323eb5(++_0x5dbc5e);}(_0x8813,0x86));var _0x3881=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8813[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3881('0x0'));var util=require('util');var path=require(_0x3881('0x1'));var timeout=require(_0x3881('0x2'));var express=require(_0x3881('0x3'));var router=express[_0x3881('0x4')]();var fs_extra=require(_0x3881('0x5'));var auth=require(_0x3881('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3881('0x7'));router[_0x3881('0x8')]('/',auth[_0x3881('0x9')](),controller[_0x3881('0xa')]);router[_0x3881('0x8')](_0x3881('0xb'),auth[_0x3881('0x9')](),controller[_0x3881('0xc')]);router['post']('/',auth[_0x3881('0x9')](),controller[_0x3881('0xd')]);router[_0x3881('0xe')](_0x3881('0xb'),auth[_0x3881('0x9')](),controller[_0x3881('0xf')]);router[_0x3881('0x10')](_0x3881('0xb'),auth[_0x3881('0x9')](),controller[_0x3881('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xeff8=['isAuthenticated','index','get','/:id','show','post','create','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller'];(function(_0x3e41aa,_0x3b5f7e){var _0x28ab00=function(_0x2cb395){while(--_0x2cb395){_0x3e41aa['push'](_0x3e41aa['shift']());}};_0x28ab00(++_0x3b5f7e);}(_0xeff8,0x186));var _0x8eff=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0xeff8[_0x2a55f8];return _0x245efd;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get']('/',auth[_0x8eff('0x9')](),controller[_0x8eff('0xa')]);router[_0x8eff('0xb')](_0x8eff('0xc'),auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')]('/',auth[_0x8eff('0x9')](),controller[_0x8eff('0xf')]);router['put']('/:id',auth[_0x8eff('0x9')](),controller[_0x8eff('0x10')]);router[_0x8eff('0x11')]('/:id',auth[_0x8eff('0x9')](),controller[_0x8eff('0x12')]);module['exports']=router;
\ No newline at end of file
index b6a7bbd..c56b293 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf801=['DATE','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment','exports','STRING'];(function(_0x331639,_0x3ceeaa){var _0x5420ea=function(_0x175c36){while(--_0x175c36){_0x331639['push'](_0x331639['shift']());}};_0x5420ea(++_0x3ceeaa);}(_0xf801,0xc5));var _0x1f80=function(_0x466e89,_0x237ae3){_0x466e89=_0x466e89-0x0;var _0x580986=_0xf801[_0x466e89];return _0x580986;};'use strict';var moment=require(_0x1f80('0x0'));var Sequelize=require('sequelize');module[_0x1f80('0x1')]={'phone':{'type':Sequelize[_0x1f80('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x1f80('0x3')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x1f80('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1f80('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1f80('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x1f80('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1f80('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1f80('0x3')]},'priority':{'type':Sequelize[_0x1f80('0x4')](0x2)[_0x1f80('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x1f80('0x4')],'unique':_0x1f80('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x1f80('0x4')],'unique':_0x1f80('0x7')},'CampaignId':{'type':Sequelize[_0x1f80('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1f80('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1f80('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1f80('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x66a7=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','moment','sequelize'];(function(_0x10e74e,_0x1603ae){var _0x2198c1=function(_0x4b627c){while(--_0x4b627c){_0x10e74e['push'](_0x10e74e['shift']());}};_0x2198c1(++_0x1603ae);}(_0x66a7,0xf8));var _0x766a=function(_0x4a7b46,_0x5e916c){_0x4a7b46=_0x4a7b46-0x0;var _0x436bee=_0x66a7[_0x4a7b46];return _0x436bee;};'use strict';var moment=require(_0x766a('0x0'));var Sequelize=require(_0x766a('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x766a('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x766a('0x3')],'defaultValue':moment()[_0x766a('0x4')](_0x766a('0x5'))},'countbusyretry':{'type':Sequelize[_0x766a('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x766a('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x766a('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x766a('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x766a('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x766a('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x766a('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x766a('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x766a('0x9')},'UserId':{'type':Sequelize[_0x766a('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x766a('0x9')},'CampaignId':{'type':Sequelize[_0x766a('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x766a('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x766a('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x766a('0x6')],'defaultValue':0x0}};
\ No newline at end of file
index c7c2db0..bb6d03f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3065=['crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','index','CmHopper','rawAttributes','key','model','map','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','create','body','find','describe','destroy','params','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','createdAt','state','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','getPreview','outbound','preview','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','dialActive','getVoiceQueues','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','mustache','util','path','to-csv','ejs','fs-extra','squel'];(function(_0x594be4,_0x2de727){var _0x39ce1a=function(_0x1fa8e8){while(--_0x1fa8e8){_0x594be4['push'](_0x594be4['shift']());}};_0x39ce1a(++_0x2de727);}(_0x3065,0x88));var _0x5306=function(_0x22e19d,_0x121e11){_0x22e19d=_0x22e19d-0x0;var _0x412858=_0x3065[_0x22e19d];return _0x412858;};'use strict';var emlformat=require(_0x5306('0x0'));var rimraf=require(_0x5306('0x1'));var zipdir=require(_0x5306('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5306('0x3'));var util=require(_0x5306('0x4'));var path=require(_0x5306('0x5'));var sox=require('sox');var csv=require(_0x5306('0x6'));var ejs=require(_0x5306('0x7'));var fs=require('fs');var fs_extra=require(_0x5306('0x8'));var _=require('lodash');var squel=require(_0x5306('0x9'));var crypto=require(_0x5306('0xa'));var jsforce=require(_0x5306('0xb'));var deskjs=require(_0x5306('0xc'));var toCsv=require(_0x5306('0x6'));var querystring=require(_0x5306('0xd'));var Papa=require(_0x5306('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5306('0xf'));var as=require(_0x5306('0x10'));var hardwareService=require(_0x5306('0x11'));var logger=require(_0x5306('0x12'))('api');var utils=require(_0x5306('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5306('0x14'));var db=require(_0x5306('0x15'))['db'];function respondWithStatusCode(_0x481b1f,_0xe9efd){_0xe9efd=_0xe9efd||0xcc;return function(_0x3657ca){if(_0x3657ca){return _0x481b1f[_0x5306('0x16')](_0xe9efd);}return _0x481b1f[_0x5306('0x17')](_0xe9efd)['end']();};}function respondWithResult(_0x5062ae,_0x392467){_0x392467=_0x392467||0xc8;return function(_0x53e6f3){if(_0x53e6f3){return _0x5062ae[_0x5306('0x17')](_0x392467)['json'](_0x53e6f3);}};}function respondWithFilteredResult(_0x36018c,_0x609856){return function(_0x4db541){if(_0x4db541){var _0x44ce28=typeof _0x609856[_0x5306('0x18')]==='undefined'&&typeof _0x609856[_0x5306('0x19')]===_0x5306('0x1a');var _0x447fb4=_0x4db541[_0x5306('0x1b')];var _0x59e4db=_0x44ce28?0x0:_0x609856['offset'];var _0x6f3c0a=_0x44ce28?_0x4db541['count']:_0x609856[_0x5306('0x18')]+_0x609856[_0x5306('0x19')];var _0x151ae7;if(_0x6f3c0a>=_0x447fb4){_0x6f3c0a=_0x447fb4;_0x151ae7=0xc8;}else{_0x151ae7=0xce;}_0x36018c[_0x5306('0x17')](_0x151ae7);return _0x36018c[_0x5306('0x1c')](_0x5306('0x1d'),_0x59e4db+'-'+_0x6f3c0a+'/'+_0x447fb4)[_0x5306('0x1e')](_0x4db541);}return null;};}function patchUpdates(_0x5ec020){return function(_0x3b7b36){try{jsonpatch[_0x5306('0x1f')](_0x3b7b36,_0x5ec020,!![]);}catch(_0x5c980f){return BPromise[_0x5306('0x20')](_0x5c980f);}return _0x3b7b36['save']();};}function saveUpdates(_0x2f2100,_0x2e2465){return function(_0x533172){if(_0x533172){return _0x533172[_0x5306('0x21')](_0x2f2100)[_0x5306('0x22')](function(_0x45a4d8){return _0x45a4d8;});}return null;};}function removeEntity(_0x3913a9,_0x45574e){return function(_0x43df99){if(_0x43df99){return _0x43df99['destroy']()[_0x5306('0x22')](function(){_0x3913a9['status'](0xcc)[_0x5306('0x23')]();});}};}function handleEntityNotFound(_0x10db1a,_0x238752){return function(_0x1db57f){if(!_0x1db57f){_0x10db1a['sendStatus'](0x194);}return _0x1db57f;};}function handleError(_0x34cad5,_0x2733cc){_0x2733cc=_0x2733cc||0x1f4;return function(_0x5d80e4){logger['error'](_0x5d80e4[_0x5306('0x24')]);if(_0x5d80e4[_0x5306('0x25')]){delete _0x5d80e4[_0x5306('0x25')];}_0x34cad5[_0x5306('0x17')](_0x2733cc)[_0x5306('0x26')](_0x5d80e4);};}exports[_0x5306('0x27')]=function(_0x356e9a,_0x24aca1){var _0x4d000a={},_0x20016d={},_0x5c5220={'count':0x0,'rows':[]};var _0x34632a=_['map'](db[_0x5306('0x28')][_0x5306('0x29')],function(_0x27d751){return{'name':_0x27d751['fieldName'],'type':_0x27d751['type'][_0x5306('0x2a')]};});_0x20016d[_0x5306('0x2b')]=_[_0x5306('0x2c')](_0x34632a,_0x5306('0x25'));_0x20016d[_0x5306('0x2d')]=_[_0x5306('0x2e')](_0x356e9a['query']);_0x20016d[_0x5306('0x2f')]=_[_0x5306('0x30')](_0x20016d[_0x5306('0x2b')],_0x20016d[_0x5306('0x2d')]);_0x20016d[_0x5306('0x2f')]=_[_0x5306('0x31')](_0x20016d[_0x5306('0x2f')],[_0x5306('0x32'),_0x5306('0x33'),_0x5306('0x34'),_0x5306('0x35'),'$lt',_0x5306('0x36'),_0x5306('0x37'),_0x5306('0x38'),_0x5306('0x39'),_0x5306('0x3a'),_0x5306('0x3b'),'$in','$notIn',_0x5306('0x3c'),_0x5306('0x3d'),_0x5306('0x3e'),'$notILike','$like',_0x5306('0x3f'),_0x5306('0x40'),_0x5306('0x41'),_0x5306('0x42')]);_0x4d000a['attributes']=_[_0x5306('0x30')](_0x20016d[_0x5306('0x2b')],qs['fields'](_0x356e9a['query'][_0x5306('0x43')]));_0x4d000a[_0x5306('0x44')]=_0x4d000a['attributes'][_0x5306('0x45')]?_0x4d000a[_0x5306('0x44')]:_0x20016d[_0x5306('0x2b')];if(!_0x356e9a['query'][_0x5306('0x46')](_0x5306('0x47'))){_0x4d000a[_0x5306('0x19')]=qs[_0x5306('0x19')](_0x356e9a[_0x5306('0x2d')][_0x5306('0x19')]);_0x4d000a[_0x5306('0x18')]=qs['offset'](_0x356e9a[_0x5306('0x2d')][_0x5306('0x18')]);}_0x4d000a[_0x5306('0x48')]=qs[_0x5306('0x49')](_0x356e9a['query']['sort']);_0x4d000a[_0x5306('0x4a')]=qs[_0x5306('0x2f')](_[_0x5306('0x4b')](_0x356e9a[_0x5306('0x2d')],_0x20016d[_0x5306('0x2f')]),_0x34632a);if(_0x356e9a['query'][_0x5306('0x4c')]){_0x4d000a['where']=_[_0x5306('0x4d')](_0x4d000a['where'],{'$or':_[_0x5306('0x2c')](_0x34632a,function(_0x55914a){if(_0x55914a['type']!==_0x5306('0x4e')){var _0x837204={};_0x837204[_0x55914a[_0x5306('0x25')]]={'$like':'%'+_0x356e9a[_0x5306('0x2d')][_0x5306('0x4c')]+'%'};return _0x837204;}})});}_0x4d000a=_[_0x5306('0x4d')]({},_0x4d000a,_0x356e9a['options']);var _0x36833d={'where':_0x4d000a[_0x5306('0x4a')]};return db[_0x5306('0x28')][_0x5306('0x1b')](_0x36833d)[_0x5306('0x22')](function(_0x3e4de2){_0x5c5220[_0x5306('0x1b')]=_0x3e4de2;if(_0x356e9a[_0x5306('0x2d')][_0x5306('0x4f')]){_0x4d000a[_0x5306('0x50')]=[{'all':!![]}];}return db[_0x5306('0x28')][_0x5306('0x51')](_0x4d000a);})[_0x5306('0x22')](function(_0x158b27){_0x5c5220[_0x5306('0x52')]=_0x158b27;return _0x5c5220;})['then'](respondWithFilteredResult(_0x24aca1,_0x4d000a))[_0x5306('0x53')](handleError(_0x24aca1,null));};exports[_0x5306('0x54')]=function(_0x6666f1,_0x1be51b){var _0x474a08={'raw':!![],'where':{'id':_0x6666f1['params']['id']}},_0x239826={};_0x239826[_0x5306('0x2b')]=_[_0x5306('0x2e')](db[_0x5306('0x28')]['rawAttributes']);_0x239826['query']=_['keys'](_0x6666f1['query']);_0x239826[_0x5306('0x2f')]=_[_0x5306('0x30')](_0x239826['model'],_0x239826[_0x5306('0x2d')]);_0x474a08[_0x5306('0x44')]=_[_0x5306('0x30')](_0x239826['model'],qs['fields'](_0x6666f1[_0x5306('0x2d')]['fields']));_0x474a08[_0x5306('0x44')]=_0x474a08[_0x5306('0x44')][_0x5306('0x45')]?_0x474a08['attributes']:_0x239826[_0x5306('0x2b')];if(_0x6666f1[_0x5306('0x2d')][_0x5306('0x4f')]){_0x474a08['include']=[{'all':!![]}];}_0x474a08=_[_0x5306('0x4d')]({},_0x474a08,_0x6666f1['options']);return db[_0x5306('0x28')]['find'](_0x474a08)[_0x5306('0x22')](handleEntityNotFound(_0x1be51b,null))[_0x5306('0x22')](respondWithResult(_0x1be51b,null))['catch'](handleError(_0x1be51b,null));};exports[_0x5306('0x55')]=function(_0x4d2557,_0x3f236a){return db['CmHopper'][_0x5306('0x55')](_0x4d2557[_0x5306('0x56')],{})[_0x5306('0x22')](respondWithResult(_0x3f236a,0xc9))[_0x5306('0x53')](handleError(_0x3f236a,null));};exports['update']=function(_0x541afd,_0xd37118){if(_0x541afd['body']['id']){delete _0x541afd['body']['id'];}return db[_0x5306('0x28')][_0x5306('0x57')]({'where':{'id':_0x541afd['params']['id']}})[_0x5306('0x22')](handleEntityNotFound(_0xd37118,null))[_0x5306('0x22')](saveUpdates(_0x541afd[_0x5306('0x56')],null))['then'](respondWithResult(_0xd37118,null))['catch'](handleError(_0xd37118,null));};exports[_0x5306('0x58')]=function(_0x3dcd17,_0x29fda8){return db['CmHopper'][_0x5306('0x58')]()[_0x5306('0x22')](respondWithResult(_0x29fda8,null))[_0x5306('0x53')](handleError(_0x29fda8,null));};exports[_0x5306('0x59')]=function(_0x27f4fb,_0x2f74e7){var _0x14b0a0;return db['CmHopper'][_0x5306('0x57')]({'where':{'id':_0x27f4fb[_0x5306('0x5a')]['id']}})[_0x5306('0x22')](handleEntityNotFound(_0x2f74e7,null))['then'](function(_0x876ad4){if(_0x876ad4){return _0x876ad4[_0x5306('0x59')]()[_0x5306('0x22')](function(_0x48ee57){return _0x48ee57;});}})[_0x5306('0x22')](function(_0x13bfa1){_0x14b0a0=_0x13bfa1;if(_0x13bfa1){if(_0x13bfa1[_0x5306('0x5b')]||_0x13bfa1[_0x5306('0x5c')]){return db[_0x13bfa1[_0x5306('0x5b')]?_0x5306('0x5d'):_0x5306('0x5e')][_0x5306('0x57')]({'where':{'id':_0x13bfa1[_0x5306('0x5b')]?_0x13bfa1[_0x5306('0x5b')]:_0x13bfa1[_0x5306('0x5c')]},'attributes':['id',_0x5306('0x25')],'raw':!![]});}}})[_0x5306('0x22')](function(_0x26167f){var _0x10060c={};if(_0x26167f){_[_0x5306('0x4d')](_0x10060c,_[_0x5306('0x5f')](_0x14b0a0['dataValues'],[_0x5306('0x60'),'updatedAt','id']));_0x10060c[_0x5306('0x61')]=0x15;_0x10060c['statedesc']=_0x5306('0x62');_0x10060c['campaign']=_0x26167f[_0x5306('0x25')];_0x10060c[_0x5306('0x63')]=_0x27f4fb[_0x5306('0x64')][_0x5306('0x25')];_0x10060c[_0x5306('0x65')]=_0x27f4fb[_0x5306('0x64')]['id'];_0x10060c[_0x5306('0x62')]=!![];_0x10060c[_0x5306('0x66')]=moment()[_0x5306('0x67')](_0x5306('0x68'));_0x10060c[_0x5306('0x69')]=_0x14b0a0[_0x5306('0x6a')];_0x10060c['campaigntype']=_0x14b0a0[_0x5306('0x5b')]?_0x5306('0x6b'):_0x5306('0x6c');return db[_0x5306('0x6d')][_0x5306('0x57')]({'where':{'id':_0x10060c['ContactId']},'attributes':[_0x5306('0x6e'),'lastName']})['then'](function(_0x18bc29){if(!_[_0x5306('0x6f')](_0x2f74e7)&&!_[_0x5306('0x6f')](_0x18bc29[_0x5306('0x6e')])){_0x10060c[_0x5306('0x70')]=_0x18bc29[_0x5306('0x6e')];if(!_[_0x5306('0x6f')](_0x18bc29[_0x5306('0x71')])){_0x10060c[_0x5306('0x70')]+='\x20'+_0x18bc29[_0x5306('0x71')];}}})[_0x5306('0x72')](function(){return db[_0x5306('0x73')][_0x5306('0x55')](_0x10060c);});}})[_0x5306('0x22')](function(){return _0x2f74e7[_0x5306('0x17')](0xcc)[_0x5306('0x23')]();})[_0x5306('0x53')](handleError(_0x2f74e7,null));};exports[_0x5306('0x74')]=function(_0x171994,_0x5addf4,_0xc253a9){var _0x56ad0a=[];return db['CmContact']['describe']()['then'](function(_0x1e62dc){_0x56ad0a=_['keys'](_0x1e62dc);return _0x171994[_0x5306('0x64')]['getVoiceQueues']({'where':{'type':_0x5306('0x75'),'dialActive':!![],'dialMethod':_0x5306('0x76')},'attributes':['id',_0x5306('0x77')],'raw':!![]});})['then'](function(_0x59dbc6){if(_0x59dbc6&&_0x59dbc6[_0x5306('0x45')]){return db['sequelize'][_0x5306('0x78')](function(_0x269747){var _0x47169d={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5306('0x67')](_0x5306('0x68'))},'VoiceQueueId':{'$in':_[_0x5306('0x2c')](_0x59dbc6,'id')},'$or':[{'UserId':null},{'UserId':_0x171994[_0x5306('0x64')]['id']}]};var _0x11cc4e=[];if(_0x171994[_0x5306('0x56')][_0x5306('0x79')]&&_0x171994['body'][_0x5306('0x79')]===_0x5306('0x7a')){if(!_[_0x5306('0x7b')](_0x171994['body'][_0x5306('0x7c')])){_0x47169d['id']={'$in':_0x171994['body']['hopperIds']};}_0x11cc4e=[[_0x5306('0x7d'),_0x5306('0x7e')],[_0x5306('0x7f'),_0x59dbc6[0x0]['dialOrderByScheduledAt']===_0x5306('0x7e')?'DESC':_0x5306('0x7e')],db[_0x5306('0x80')]['literal'](_0x5306('0x81')),['id',_0x5306('0x82')]];}else{if(!_[_0x5306('0x7b')](_0x171994[_0x5306('0x56')]['hopperIds'])){_0x47169d['id']={'$notIn':_0x171994[_0x5306('0x56')]['hopperIds']};}_0x11cc4e=[[_0x5306('0x7d'),_0x5306('0x82')],['scheduledAt',_0x59dbc6[0x0][_0x5306('0x77')]],db[_0x5306('0x80')][_0x5306('0x83')](_0x5306('0x84')),['id',_0x5306('0x7e')]];}return db['CmHopper'][_0x5306('0x85')]({'attributes':['id','scheduledat'],'where':_0x47169d,'order':_0x11cc4e,'transaction':_0x269747,'lock':_0x269747[_0x5306('0x86')][_0x5306('0x87')],'include':[{'model':db[_0x5306('0x6d')],'as':_0x5306('0x88'),'attributes':_0x56ad0a,'include':[{'model':db[_0x5306('0x89')],'as':_0x5306('0x8a'),'attributes':['id',_0x5306('0x25')]}]},{'model':db[_0x5306('0x8b')],'as':_0x5306('0x8c'),'attributes':['id',_0x5306('0x25')]},{'model':db[_0x5306('0x5d')],'as':'Queue','attributes':['id','name',_0x5306('0x8d')]}]})[_0x5306('0x22')](function(_0x5587a1){if(_0x5587a1){return _0x5587a1[_0x5306('0x21')]({'UserId':_0x171994[_0x5306('0x64')]['id']},{'transaction':_0x269747});}});});}})[_0x5306('0x22')](handleEntityNotFound(_0x5addf4,null))['then'](respondWithResult(_0x5addf4,null))[_0x5306('0x53')](handleError(_0x5addf4,null));};exports['getOpenContacts']=function(_0x1373e8,_0x5ac241,_0x45b34e){return _0x1373e8[_0x5306('0x64')][_0x5306('0x8e')]({'where':{'type':_0x5306('0x75'),'dialActive':!![],'dialMethod':_0x5306('0x76')},'attributes':['id'],'raw':!![]})[_0x5306('0x22')](function(_0x46e79e){if(_0x46e79e&&_0x46e79e[_0x5306('0x45')]){return db['CmHopper'][_0x5306('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5306('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x5306('0x2c')](_0x46e79e,'id')},'$or':[{'UserId':null},{'UserId':_0x1373e8[_0x5306('0x64')]['id']}]}});}return 0x0;})[_0x5306('0x22')](function(_0x51478e){if(!_['isNil'](_0x51478e)&&_['isNumber'](_0x51478e)){return _0x5ac241[_0x5306('0x17')](0xc8)['json']({'contacts':_0x51478e});}else{logger[_0x5306('0x8f')](_0x5306('0x90'),'getOpenContacts',0x194,_0x5306('0x91'));_0x5ac241[_0x5306('0x16')](0x194);}})[_0x5306('0x53')](handleError(_0x5ac241,null));};
\ No newline at end of file
+var _0x326a=['YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','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','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','update','then','destroy','error','stack','name','send','map','CmHopper','fieldName','key','model','keys','query','filters','intersection','concat','$or','$gt','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','attributes','fields','length','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','CampaignId','VoiceQueueId','VoiceQueue','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','user','UserId','deletedat','format','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction'];(function(_0x1cffe2,_0x5383e8){var _0x57030e=function(_0xe9c73f){while(--_0xe9c73f){_0x1cffe2['push'](_0x1cffe2['shift']());}};_0x57030e(++_0x5383e8);}(_0x326a,0x1c9));var _0xa326=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x326a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xa326('0x0'));var rimraf=require(_0xa326('0x1'));var zipdir=require(_0xa326('0x2'));var jsonpatch=require(_0xa326('0x3'));var rp=require('request-promise');var moment=require(_0xa326('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa326('0x5'));var util=require(_0xa326('0x6'));var path=require(_0xa326('0x7'));var sox=require(_0xa326('0x8'));var csv=require('to-csv');var ejs=require(_0xa326('0x9'));var fs=require('fs');var fs_extra=require(_0xa326('0xa'));var _=require('lodash');var squel=require(_0xa326('0xb'));var crypto=require(_0xa326('0xc'));var jsforce=require(_0xa326('0xd'));var deskjs=require(_0xa326('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa326('0xf'));var Papa=require(_0xa326('0x10'));var Redis=require('ioredis');var authService=require(_0xa326('0x11'));var qs=require(_0xa326('0x12'));var as=require(_0xa326('0x13'));var hardwareService=require(_0xa326('0x14'));var logger=require('../../config/logger')(_0xa326('0x15'));var utils=require(_0xa326('0x16'));var config=require(_0xa326('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa326('0x18'))['db'];function respondWithStatusCode(_0x2c0f71,_0x1bbf04){_0x1bbf04=_0x1bbf04||0xcc;return function(_0x495412){if(_0x495412){return _0x2c0f71[_0xa326('0x19')](_0x1bbf04);}return _0x2c0f71[_0xa326('0x1a')](_0x1bbf04)[_0xa326('0x1b')]();};}function respondWithResult(_0x166850,_0x2c0099){_0x2c0099=_0x2c0099||0xc8;return function(_0xe92d2e){if(_0xe92d2e){return _0x166850[_0xa326('0x1a')](_0x2c0099)[_0xa326('0x1c')](_0xe92d2e);}};}function respondWithFilteredResult(_0x288854,_0x3f53f6){return function(_0x1bf347){if(_0x1bf347){var _0x5ea76d=typeof _0x3f53f6[_0xa326('0x1d')]==='undefined'&&typeof _0x3f53f6[_0xa326('0x1e')]===_0xa326('0x1f');var _0x3f9952=_0x1bf347[_0xa326('0x20')];var _0xbfade8=_0x5ea76d?0x0:_0x3f53f6[_0xa326('0x1d')];var _0x5720d6=_0x5ea76d?_0x1bf347[_0xa326('0x20')]:_0x3f53f6['offset']+_0x3f53f6[_0xa326('0x1e')];var _0x3ccd7d;if(_0x5720d6>=_0x3f9952){_0x5720d6=_0x3f9952;_0x3ccd7d=0xc8;}else{_0x3ccd7d=0xce;}_0x288854['status'](_0x3ccd7d);return _0x288854[_0xa326('0x21')]('Content-Range',_0xbfade8+'-'+_0x5720d6+'/'+_0x3f9952)['json'](_0x1bf347);}return null;};}function patchUpdates(_0x31399d){return function(_0x829683){try{jsonpatch['apply'](_0x829683,_0x31399d,!![]);}catch(_0x5a5815){return BPromise[_0xa326('0x22')](_0x5a5815);}return _0x829683['save']();};}function saveUpdates(_0x3917f3,_0x234c5d){return function(_0x2bdcc1){if(_0x2bdcc1){return _0x2bdcc1[_0xa326('0x23')](_0x3917f3)[_0xa326('0x24')](function(_0x1de082){return _0x1de082;});}return null;};}function removeEntity(_0xa4b791,_0x21286f){return function(_0x4094b0){if(_0x4094b0){return _0x4094b0[_0xa326('0x25')]()['then'](function(){_0xa4b791[_0xa326('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a183,_0x589be2){return function(_0x4d689e){if(!_0x4d689e){_0x47a183['sendStatus'](0x194);}return _0x4d689e;};}function handleError(_0x338666,_0x5ab2fa){_0x5ab2fa=_0x5ab2fa||0x1f4;return function(_0x1657aa){logger[_0xa326('0x26')](_0x1657aa[_0xa326('0x27')]);if(_0x1657aa[_0xa326('0x28')]){delete _0x1657aa['name'];}_0x338666[_0xa326('0x1a')](_0x5ab2fa)[_0xa326('0x29')](_0x1657aa);};}exports['index']=function(_0x19c345,_0x1e6f42){var _0x54537c={},_0x5de965={},_0x3541a4={'count':0x0,'rows':[]};var _0x1ce03a=_[_0xa326('0x2a')](db[_0xa326('0x2b')]['rawAttributes'],function(_0x5d9b40){return{'name':_0x5d9b40[_0xa326('0x2c')],'type':_0x5d9b40['type'][_0xa326('0x2d')]};});_0x5de965[_0xa326('0x2e')]=_['map'](_0x1ce03a,_0xa326('0x28'));_0x5de965['query']=_[_0xa326('0x2f')](_0x19c345[_0xa326('0x30')]);_0x5de965[_0xa326('0x31')]=_[_0xa326('0x32')](_0x5de965[_0xa326('0x2e')],_0x5de965[_0xa326('0x30')]);_0x5de965[_0xa326('0x31')]=_[_0xa326('0x33')](_0x5de965[_0xa326('0x31')],['$and',_0xa326('0x34'),_0xa326('0x35'),'$gte',_0xa326('0x36'),_0xa326('0x37'),_0xa326('0x38'),_0xa326('0x39'),_0xa326('0x3a'),'$between',_0xa326('0x3b'),_0xa326('0x3c'),_0xa326('0x3d'),_0xa326('0x3e'),_0xa326('0x3f'),'$iLike',_0xa326('0x40'),_0xa326('0x3e'),_0xa326('0x41'),_0xa326('0x42'),'$contained','$any']);_0x54537c[_0xa326('0x43')]=_[_0xa326('0x32')](_0x5de965[_0xa326('0x2e')],qs[_0xa326('0x44')](_0x19c345[_0xa326('0x30')][_0xa326('0x44')]));_0x54537c[_0xa326('0x43')]=_0x54537c['attributes'][_0xa326('0x45')]?_0x54537c[_0xa326('0x43')]:_0x5de965[_0xa326('0x2e')];if(!_0x19c345['query']['hasOwnProperty']('nolimit')){_0x54537c[_0xa326('0x1e')]=qs[_0xa326('0x1e')](_0x19c345[_0xa326('0x30')]['limit']);_0x54537c[_0xa326('0x1d')]=qs[_0xa326('0x1d')](_0x19c345[_0xa326('0x30')][_0xa326('0x1d')]);}_0x54537c['order']=qs['sort'](_0x19c345[_0xa326('0x30')]['sort']);_0x54537c[_0xa326('0x46')]=qs[_0xa326('0x31')](_[_0xa326('0x47')](_0x19c345[_0xa326('0x30')],_0x5de965['filters']),_0x1ce03a);if(_0x19c345[_0xa326('0x30')][_0xa326('0x48')]){_0x54537c[_0xa326('0x46')]=_[_0xa326('0x49')](_0x54537c['where'],{'$or':_[_0xa326('0x2a')](_0x1ce03a,function(_0x3d8e12){if(_0x3d8e12[_0xa326('0x4a')]!=='VIRTUAL'){var _0x152126={};_0x152126[_0x3d8e12[_0xa326('0x28')]]={'$like':'%'+_0x19c345[_0xa326('0x30')][_0xa326('0x48')]+'%'};return _0x152126;}})});}_0x54537c=_[_0xa326('0x49')]({},_0x54537c,_0x19c345[_0xa326('0x4b')]);var _0x470d90={'where':_0x54537c[_0xa326('0x46')]};return db['CmHopper'][_0xa326('0x20')](_0x470d90)['then'](function(_0x8beda1){_0x3541a4[_0xa326('0x20')]=_0x8beda1;if(_0x19c345[_0xa326('0x30')][_0xa326('0x4c')]){_0x54537c[_0xa326('0x4d')]=[{'all':!![]}];}return db[_0xa326('0x2b')]['findAll'](_0x54537c);})[_0xa326('0x24')](function(_0x209dc0){_0x3541a4[_0xa326('0x4e')]=_0x209dc0;return _0x3541a4;})[_0xa326('0x24')](respondWithFilteredResult(_0x1e6f42,_0x54537c))[_0xa326('0x4f')](handleError(_0x1e6f42,null));};exports[_0xa326('0x50')]=function(_0x413622,_0xf68ce2){var _0xf56144={'raw':!![],'where':{'id':_0x413622[_0xa326('0x51')]['id']}},_0x2db827={};_0x2db827['model']=_[_0xa326('0x2f')](db[_0xa326('0x2b')][_0xa326('0x52')]);_0x2db827[_0xa326('0x30')]=_[_0xa326('0x2f')](_0x413622[_0xa326('0x30')]);_0x2db827[_0xa326('0x31')]=_[_0xa326('0x32')](_0x2db827['model'],_0x2db827[_0xa326('0x30')]);_0xf56144[_0xa326('0x43')]=_['intersection'](_0x2db827['model'],qs[_0xa326('0x44')](_0x413622[_0xa326('0x30')][_0xa326('0x44')]));_0xf56144[_0xa326('0x43')]=_0xf56144[_0xa326('0x43')][_0xa326('0x45')]?_0xf56144['attributes']:_0x2db827['model'];if(_0x413622['query'][_0xa326('0x4c')]){_0xf56144[_0xa326('0x4d')]=[{'all':!![]}];}_0xf56144=_[_0xa326('0x49')]({},_0xf56144,_0x413622[_0xa326('0x4b')]);return db[_0xa326('0x2b')][_0xa326('0x53')](_0xf56144)[_0xa326('0x24')](handleEntityNotFound(_0xf68ce2,null))[_0xa326('0x24')](respondWithResult(_0xf68ce2,null))[_0xa326('0x4f')](handleError(_0xf68ce2,null));};exports[_0xa326('0x54')]=function(_0x4a1126,_0x36bc63){return db[_0xa326('0x2b')][_0xa326('0x54')](_0x4a1126[_0xa326('0x55')],{})['then'](respondWithResult(_0x36bc63,0xc9))[_0xa326('0x4f')](handleError(_0x36bc63,null));};exports['update']=function(_0x3a2f61,_0x55842f){if(_0x3a2f61['body']['id']){delete _0x3a2f61['body']['id'];}return db[_0xa326('0x2b')][_0xa326('0x53')]({'where':{'id':_0x3a2f61[_0xa326('0x51')]['id']}})[_0xa326('0x24')](handleEntityNotFound(_0x55842f,null))[_0xa326('0x24')](saveUpdates(_0x3a2f61['body'],null))[_0xa326('0x24')](respondWithResult(_0x55842f,null))[_0xa326('0x4f')](handleError(_0x55842f,null));};exports[_0xa326('0x56')]=function(_0x20f038,_0x35b6e7){return db['CmHopper'][_0xa326('0x56')]()[_0xa326('0x24')](respondWithResult(_0x35b6e7,null))['catch'](handleError(_0x35b6e7,null));};exports['destroy']=function(_0x3d5a5a,_0xec0482){var _0x59824b;return db[_0xa326('0x2b')][_0xa326('0x53')]({'where':{'id':_0x3d5a5a[_0xa326('0x51')]['id']}})[_0xa326('0x24')](handleEntityNotFound(_0xec0482,null))[_0xa326('0x24')](function(_0xf931de){if(_0xf931de){return _0xf931de[_0xa326('0x25')]()[_0xa326('0x24')](function(_0x6b8ae3){return _0x6b8ae3;});}})[_0xa326('0x24')](function(_0x472b7f){_0x59824b=_0x472b7f;if(_0x472b7f){if(_0x472b7f['VoiceQueueId']||_0x472b7f[_0xa326('0x57')]){return db[_0x472b7f[_0xa326('0x58')]?_0xa326('0x59'):'Campaign'][_0xa326('0x53')]({'where':{'id':_0x472b7f[_0xa326('0x58')]?_0x472b7f[_0xa326('0x58')]:_0x472b7f['CampaignId']},'attributes':['id',_0xa326('0x28')],'raw':!![]});}}})[_0xa326('0x24')](function(_0x757cd1){var _0x1915d6={};if(_0x757cd1){_[_0xa326('0x49')](_0x1915d6,_[_0xa326('0x5a')](_0x59824b[_0xa326('0x5b')],[_0xa326('0x5c'),_0xa326('0x5d'),'id']));_0x1915d6['state']=0x15;_0x1915d6[_0xa326('0x5e')]=_0xa326('0x5f');_0x1915d6[_0xa326('0x60')]=_0x757cd1[_0xa326('0x28')];_0x1915d6['membername']=_0x3d5a5a[_0xa326('0x61')][_0xa326('0x28')];_0x1915d6[_0xa326('0x62')]=_0x3d5a5a['user']['id'];_0x1915d6[_0xa326('0x5f')]=!![];_0x1915d6[_0xa326('0x63')]=moment()[_0xa326('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0x1915d6[_0xa326('0x65')]=_0x59824b[_0xa326('0x66')];_0x1915d6[_0xa326('0x67')]=_0x59824b['VoiceQueueId']?_0xa326('0x68'):'ivr';return db[_0xa326('0x69')]['find']({'where':{'id':_0x1915d6[_0xa326('0x6a')]},'attributes':[_0xa326('0x6b'),_0xa326('0x6c')]})[_0xa326('0x24')](function(_0x407397){if(!_[_0xa326('0x6d')](_0xec0482)&&!_[_0xa326('0x6d')](_0x407397[_0xa326('0x6b')])){_0x1915d6[_0xa326('0x6e')]=_0x407397[_0xa326('0x6b')];if(!_[_0xa326('0x6d')](_0x407397[_0xa326('0x6c')])){_0x1915d6[_0xa326('0x6e')]+='\x20'+_0x407397[_0xa326('0x6c')];}}})[_0xa326('0x6f')](function(){return db[_0xa326('0x70')][_0xa326('0x54')](_0x1915d6);});}})[_0xa326('0x24')](function(){return _0xec0482['status'](0xcc)[_0xa326('0x1b')]();})[_0xa326('0x4f')](handleError(_0xec0482,null));};exports[_0xa326('0x71')]=function(_0x5cb2b2,_0x5e9df9,_0x1d796c){var _0x16edf1=[];return db[_0xa326('0x69')][_0xa326('0x56')]()[_0xa326('0x24')](function(_0x403244){_0x16edf1=_[_0xa326('0x2f')](_0x403244);return _0x5cb2b2['user'][_0xa326('0x72')]({'where':{'type':_0xa326('0x73'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xa326('0x74')],'raw':!![]});})[_0xa326('0x24')](function(_0x16be4a){if(_0x16be4a&&_0x16be4a['length']){return db[_0xa326('0x75')][_0xa326('0x76')](function(_0x339626){var _0x216732={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa326('0x64')](_0xa326('0x77'))},'VoiceQueueId':{'$in':_[_0xa326('0x2a')](_0x16be4a,'id')},'$or':[{'UserId':null},{'UserId':_0x5cb2b2['user']['id']}]};var _0x1d2f0d=[];if(_0x5cb2b2['body'][_0xa326('0x78')]&&_0x5cb2b2[_0xa326('0x55')]['direction']===_0xa326('0x79')){if(!_[_0xa326('0x7a')](_0x5cb2b2[_0xa326('0x55')][_0xa326('0x7b')])){_0x216732['id']={'$in':_0x5cb2b2[_0xa326('0x55')][_0xa326('0x7b')]};}_0x1d2f0d=[['priority',_0xa326('0x7c')],[_0xa326('0x7d'),_0x16be4a[0x0]['dialOrderByScheduledAt']===_0xa326('0x7c')?_0xa326('0x7e'):'ASC'],db[_0xa326('0x75')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xa326('0x7e')]];}else{if(!_[_0xa326('0x7a')](_0x5cb2b2[_0xa326('0x55')][_0xa326('0x7b')])){_0x216732['id']={'$notIn':_0x5cb2b2[_0xa326('0x55')][_0xa326('0x7b')]};}_0x1d2f0d=[[_0xa326('0x7f'),_0xa326('0x7e')],[_0xa326('0x7d'),_0x16be4a[0x0][_0xa326('0x74')]],db['sequelize']['literal'](_0xa326('0x80')),['id','ASC']];}return db['CmHopper'][_0xa326('0x81')]({'attributes':['id',_0xa326('0x82')],'where':_0x216732,'order':_0x1d2f0d,'transaction':_0x339626,'lock':_0x339626[_0xa326('0x83')][_0xa326('0x84')],'include':[{'model':db[_0xa326('0x69')],'as':'Contact','attributes':_0x16edf1,'include':[{'model':db[_0xa326('0x85')],'as':_0xa326('0x86'),'attributes':['id',_0xa326('0x28')]}]},{'model':db[_0xa326('0x87')],'as':_0xa326('0x88'),'attributes':['id',_0xa326('0x28')]},{'model':db[_0xa326('0x59')],'as':_0xa326('0x89'),'attributes':['id',_0xa326('0x28'),_0xa326('0x8a')]}]})[_0xa326('0x24')](function(_0x54b961){if(_0x54b961){return _0x54b961[_0xa326('0x23')]({'UserId':_0x5cb2b2['user']['id']},{'transaction':_0x339626});}});});}})[_0xa326('0x24')](handleEntityNotFound(_0x5e9df9,null))[_0xa326('0x24')](respondWithResult(_0x5e9df9,null))[_0xa326('0x4f')](handleError(_0x5e9df9,null));};exports[_0xa326('0x8b')]=function(_0x5b3580,_0x1d6576,_0x92ec0b){return _0x5b3580['user'][_0xa326('0x72')]({'where':{'type':_0xa326('0x73'),'dialActive':!![],'dialMethod':_0xa326('0x8c')},'attributes':['id'],'raw':!![]})[_0xa326('0x24')](function(_0x39cf6e){if(_0x39cf6e&&_0x39cf6e[_0xa326('0x45')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa326('0x64')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xa326('0x2a')](_0x39cf6e,'id')},'$or':[{'UserId':null},{'UserId':_0x5b3580['user']['id']}]}});}return 0x0;})['then'](function(_0x684336){if(!_[_0xa326('0x6d')](_0x684336)&&_[_0xa326('0x8d')](_0x684336)){return _0x1d6576['status'](0xc8)[_0xa326('0x1c')]({'contacts':_0x684336});}else{logger[_0xa326('0x26')](_0xa326('0x8e'),_0xa326('0x8b'),0x194,_0xa326('0x8f'));_0x1d6576[_0xa326('0x19')](0x194);}})['catch'](handleError(_0x1d6576,null));};
\ No newline at end of file
index 6f2db5b..0fdf491 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x4f73be,_0x4c936a){var _0x248635=function(_0x401f68){while(--_0x401f68){_0x4f73be['push'](_0x4f73be['shift']());}};_0x248635(++_0x4c936a);}(_0x2542,0x169));var _0x2254=function(_0x2a7bac,_0x440dee){_0x2a7bac=_0x2a7bac-0x0;var _0x359f77=_0x2542[_0x2a7bac];return _0x359f77;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f47=['CmHopper','scheduledat','phone','priority','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define'];(function(_0x126f47,_0x2199e9){var _0x49508a=function(_0x20ba36){while(--_0x20ba36){_0x126f47['push'](_0x126f47['shift']());}};_0x49508a(++_0x2199e9);}(_0x6f47,0xc7));var _0x76f4=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x6f47[_0x2ec461];return _0x28603d;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require(_0x76f4('0x1'))('api');var moment=require(_0x76f4('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var attributes=require(_0x76f4('0x6'));module[_0x76f4('0x7')]=function(_0x5754ca,_0x35602f){return _0x5754ca[_0x76f4('0x8')](_0x76f4('0x9'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x76f4('0xa'),'fields':[_0x76f4('0xa')]},{'name':_0x76f4('0xb'),'fields':[_0x76f4('0xb')]},{'name':_0x76f4('0xc'),'fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
index 657b518..a49ce1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c0d=['update','body','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','name','voicePause','length','UserId','push','includes','MoveContactManagedDialer','CmHopperFinal','create','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','all','GetCmHopperPreview','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','CmHopper','findAll','options','raw','limit','include','map','attributes','model','GetCmHopper','debug','catch','ShowCmHopper','find','where','CreateCmHopper','UpdateCmHopper'];(function(_0x123a39,_0xce086c){var _0x1c9388=function(_0xe83cbf){while(--_0xe83cbf){_0x123a39['push'](_0x123a39['shift']());}};_0x1c9388(++_0xce086c);}(_0x9c0d,0x143));var _0xd9c0=function(_0xef18d2,_0x81b118){_0xef18d2=_0xef18d2-0x0;var _0x62141e=_0x9c0d[_0xef18d2];return _0x62141e;};'use strict';var _=require('lodash');var util=require(_0xd9c0('0x0'));var moment=require(_0xd9c0('0x1'));var BPromise=require(_0xd9c0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9c0('0x3'));var db=require(_0xd9c0('0x4'))['db'];var utils=require(_0xd9c0('0x5'));var logger=require(_0xd9c0('0x6'))(_0xd9c0('0x7'));var config=require(_0xd9c0('0x8'));var jayson=require(_0xd9c0('0x9'));var client=jayson[_0xd9c0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2eba8f,_0x12f323,_0x5c8eb2){return new BPromise(function(_0x27a2f7,_0x244b80){return client['request'](_0x2eba8f,_0x5c8eb2)[_0xd9c0('0xb')](function(_0x925660){logger['info'](_0xd9c0('0xc'),_0x12f323,'request\x20sent');logger['debug'](_0xd9c0('0xd'),_0x12f323,'request\x20sent',JSON[_0xd9c0('0xe')](_0x925660));if(_0x925660[_0xd9c0('0xf')]){if(_0x925660[_0xd9c0('0xf')]['code']===0x1f4){logger['error'](_0xd9c0('0xc'),_0x12f323,_0x925660['error'][_0xd9c0('0x10')]);return _0x244b80(_0x925660[_0xd9c0('0xf')][_0xd9c0('0x10')]);}logger['error'](_0xd9c0('0xc'),_0x12f323,_0x925660[_0xd9c0('0xf')][_0xd9c0('0x10')]);return _0x27a2f7(_0x925660[_0xd9c0('0xf')][_0xd9c0('0x10')]);}else{logger[_0xd9c0('0x11')](_0xd9c0('0xc'),_0x12f323,_0xd9c0('0x12'));_0x27a2f7(_0x925660[_0xd9c0('0x13')][_0xd9c0('0x10')]);}})['catch'](function(_0x197989){logger[_0xd9c0('0xf')](_0xd9c0('0xc'),_0x12f323,_0x197989);_0x244b80(_0x197989);});});}exports['GetCmHopper']=function(_0x4dca6d){var _0x37169b=this;return new Promise(function(_0x44d4a8,_0x3ce473){return db[_0xd9c0('0x14')][_0xd9c0('0x15')]({'raw':_0x4dca6d[_0xd9c0('0x16')]?_0x4dca6d['options'][_0xd9c0('0x17')]===undefined?!![]:![]:!![],'where':_0x4dca6d[_0xd9c0('0x16')]?_0x4dca6d[_0xd9c0('0x16')]['where']||null:null,'attributes':_0x4dca6d[_0xd9c0('0x16')]?_0x4dca6d[_0xd9c0('0x16')]['attributes']||null:null,'limit':_0x4dca6d['options']?_0x4dca6d[_0xd9c0('0x16')][_0xd9c0('0x18')]||null:null,'include':_0x4dca6d['options']?_0x4dca6d[_0xd9c0('0x16')][_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x4dca6d[_0xd9c0('0x16')][_0xd9c0('0x19')],function(_0x2e18b9){return{'model':db[_0x2e18b9['model']],'as':_0x2e18b9['as'],'attributes':_0x2e18b9[_0xd9c0('0x1b')],'include':_0x2e18b9[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x2e18b9[_0xd9c0('0x19')],function(_0x4cd90b){return{'model':db[_0x4cd90b[_0xd9c0('0x1c')]],'as':_0x4cd90b['as'],'attributes':_0x4cd90b[_0xd9c0('0x1b')],'include':_0x4cd90b[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x4cd90b[_0xd9c0('0x19')],function(_0x4e5e21){return{'model':db[_0x4e5e21['model']],'as':_0x4e5e21['as'],'attributes':_0x4e5e21[_0xd9c0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd9c0('0xb')](function(_0x2394fd){logger[_0xd9c0('0x11')](_0xd9c0('0x1d'),_0x4dca6d);logger[_0xd9c0('0x1e')](_0xd9c0('0x1d'),_0x4dca6d,JSON[_0xd9c0('0xe')](_0x2394fd));_0x44d4a8(_0x2394fd);})[_0xd9c0('0x1f')](function(_0x374ef0){logger[_0xd9c0('0xf')](_0xd9c0('0x1d'),_0x374ef0['message'],_0x4dca6d);_0x3ce473(_0x37169b[_0xd9c0('0xf')](0x1f4,_0x374ef0['message']));});});};exports[_0xd9c0('0x20')]=function(_0x284640){var _0x37fae0=this;return new Promise(function(_0x4cbe63,_0x1709a0){return db['CmHopper'][_0xd9c0('0x21')]({'raw':_0x284640[_0xd9c0('0x16')]?_0x284640['options'][_0xd9c0('0x17')]===undefined?!![]:![]:!![],'where':_0x284640[_0xd9c0('0x16')]?_0x284640['options'][_0xd9c0('0x22')]||null:null,'attributes':_0x284640['options']?_0x284640[_0xd9c0('0x16')]['attributes']||null:null,'include':_0x284640[_0xd9c0('0x16')]?_0x284640[_0xd9c0('0x16')][_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x284640[_0xd9c0('0x16')][_0xd9c0('0x19')],function(_0x3a7e7d){return{'model':db[_0x3a7e7d[_0xd9c0('0x1c')]],'as':_0x3a7e7d['as'],'attributes':_0x3a7e7d['attributes'],'include':_0x3a7e7d[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x3a7e7d[_0xd9c0('0x19')],function(_0x31b6c2){return{'model':db[_0x31b6c2['model']],'as':_0x31b6c2['as'],'attributes':_0x31b6c2['attributes'],'include':_0x31b6c2[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x31b6c2[_0xd9c0('0x19')],function(_0x5cec6e){return{'model':db[_0x5cec6e['model']],'as':_0x5cec6e['as'],'attributes':_0x5cec6e[_0xd9c0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd9c0('0xb')](function(_0x52c66b){logger[_0xd9c0('0x11')](_0xd9c0('0x20'),_0x284640);logger[_0xd9c0('0x1e')](_0xd9c0('0x20'),_0x284640,JSON[_0xd9c0('0xe')](_0x52c66b));_0x4cbe63(_0x52c66b);})[_0xd9c0('0x1f')](function(_0x561a20){logger['error'](_0xd9c0('0x20'),_0x561a20['message'],_0x284640);_0x1709a0(_0x37fae0['error'](0x1f4,_0x561a20[_0xd9c0('0x10')]));});});};exports[_0xd9c0('0x23')]=function(_0x2f28dd){var _0x251407=this;return new Promise(function(_0x27d0ad,_0x33ba8b){return db['CmHopper']['create'](_0x2f28dd['body'],{'raw':_0x2f28dd[_0xd9c0('0x16')]?_0x2f28dd[_0xd9c0('0x16')][_0xd9c0('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x10b34f){logger[_0xd9c0('0x11')](_0xd9c0('0x23'),_0x2f28dd);logger[_0xd9c0('0x1e')](_0xd9c0('0x23'),_0x2f28dd,JSON[_0xd9c0('0xe')](_0x10b34f));_0x27d0ad(_0x10b34f);})[_0xd9c0('0x1f')](function(_0x5cfecb){logger[_0xd9c0('0xf')]('CreateCmHopper',_0x5cfecb[_0xd9c0('0x10')],_0x2f28dd);_0x33ba8b(_0x251407[_0xd9c0('0xf')](0x1f4,_0x5cfecb[_0xd9c0('0x10')]));});});};exports[_0xd9c0('0x24')]=function(_0x1fb8db){var _0x19f140=this;return new Promise(function(_0x1fdfda,_0x3563a8){return db['CmHopper'][_0xd9c0('0x25')](_0x1fb8db[_0xd9c0('0x26')],{'raw':_0x1fb8db[_0xd9c0('0x16')]?_0x1fb8db['options'][_0xd9c0('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fb8db[_0xd9c0('0x16')]?_0x1fb8db[_0xd9c0('0x16')][_0xd9c0('0x22')]||null:null,'attributes':_0x1fb8db[_0xd9c0('0x16')]?_0x1fb8db[_0xd9c0('0x16')][_0xd9c0('0x1b')]||null:null,'limit':_0x1fb8db[_0xd9c0('0x16')]?_0x1fb8db['options'][_0xd9c0('0x18')]||null:null})['then'](function(_0x157fd4){logger[_0xd9c0('0x11')](_0xd9c0('0x24'),_0x1fb8db);logger[_0xd9c0('0x1e')]('UpdateCmHopper',_0x1fb8db,JSON[_0xd9c0('0xe')](_0x157fd4));_0x1fdfda(_0x157fd4);})[_0xd9c0('0x1f')](function(_0x5169b8){logger[_0xd9c0('0xf')](_0xd9c0('0x24'),_0x5169b8['message'],_0x1fb8db);_0x3563a8(_0x19f140[_0xd9c0('0xf')](0x1f4,_0x5169b8[_0xd9c0('0x10')]));});});};exports[_0xd9c0('0x27')]=function(_0x1f85bf){var _0x27037b=this;return new Promise(function(_0x8d8425,_0x3b3a72){return db[_0xd9c0('0x14')][_0xd9c0('0x28')]({'where':_0x1f85bf[_0xd9c0('0x16')]?_0x1f85bf[_0xd9c0('0x16')][_0xd9c0('0x22')]||null:null})['then'](function(_0xbebde1){logger[_0xd9c0('0x11')](_0xd9c0('0x27'),_0x1f85bf);logger[_0xd9c0('0x1e')](_0xd9c0('0x27'),_0x1f85bf,JSON[_0xd9c0('0xe')](_0xbebde1));_0x8d8425(_0xbebde1);})[_0xd9c0('0x1f')](function(_0x2e35f7){logger['error']('DestroyCmHopper',_0x2e35f7[_0xd9c0('0x10')],_0x1f85bf);_0x3b3a72(_0x27037b[_0xd9c0('0xf')](0x1f4,_0x2e35f7['message']));});});};exports[_0xd9c0('0x29')]=function(_0x5c1066){var _0x42f1a9=this;return new Promise(function(_0x24cfe5,_0x984dc4){return db[_0xd9c0('0x2a')][_0xd9c0('0x2b')]()['then'](function(_0xd29b2f){return db[_0xd9c0('0x2c')][_0xd9c0('0x2d')](function(_0xb164a2){return db[_0xd9c0('0x14')]['findAll']({'where':_0x5c1066[_0xd9c0('0x16')]?_0x5c1066[_0xd9c0('0x16')]['where']||null:null,'attributes':_0x5c1066['options']?_0x5c1066[_0xd9c0('0x16')][_0xd9c0('0x1b')]||null:null,'limit':_0x5c1066['options']?_0x5c1066[_0xd9c0('0x16')][_0xd9c0('0x18')]||null:null,'order':_0x5c1066[_0xd9c0('0x16')]?_0x5c1066[_0xd9c0('0x16')][_0xd9c0('0x2e')]||null:null,'transaction':_0xb164a2,'lock':_0xb164a2[_0xd9c0('0x2f')][_0xd9c0('0x30')],'include':[{'model':db[_0xd9c0('0x2a')],'as':_0xd9c0('0x31'),'attributes':_[_0xd9c0('0x32')](_0xd29b2f)},{'model':db[_0xd9c0('0x33')],'as':'Agent','attributes':['id',_0xd9c0('0x34'),_0xd9c0('0x35')]}]})[_0xd9c0('0xb')](function(_0x214035){var _0xc38d94=[];var _0x310681=[];for(var _0x3b9ca1=0x0;_0x3b9ca1<_0x214035[_0xd9c0('0x36')];_0x3b9ca1+=0x1){var _0x517d4a=_0x214035[_0x3b9ca1][_0xd9c0('0x37')];if(_0x517d4a===null){_0xc38d94[_0xd9c0('0x38')](_0x214035[_0x3b9ca1][_0xd9c0('0x25')](_0x5c1066[_0xd9c0('0x26')],{'transaction':_0xb164a2}));}else if(!_0x310681[_0xd9c0('0x39')](_0x517d4a)){_0x310681[_0xd9c0('0x38')](_0x517d4a);_0xc38d94[_0xd9c0('0x38')](_0x214035[_0x3b9ca1][_0xd9c0('0x25')](_0x5c1066[_0xd9c0('0x26')],{'transaction':_0xb164a2}));}}return BPromise['all'](_0xc38d94);});})[_0xd9c0('0xb')](function(_0x253c81){logger[_0xd9c0('0x11')](_0xd9c0('0x29'),_0x5c1066);logger['debug'](_0xd9c0('0x29'),_0x5c1066,JSON[_0xd9c0('0xe')](_0x253c81));_0x24cfe5(_0x253c81);})[_0xd9c0('0x1f')](function(_0x919cb2){logger[_0xd9c0('0xf')](_0xd9c0('0x29'),_0x919cb2[_0xd9c0('0x10')],_0x5c1066);_0x984dc4(_0x42f1a9[_0xd9c0('0xf')](0x1f4,_0x919cb2[_0xd9c0('0x10')]));});});});};exports[_0xd9c0('0x3a')]=function(_0x1e83ca){var _0x17a3ad=this;return new Promise(function(_0x2a8ec6,_0x1dab88){return db[_0xd9c0('0x2c')][_0xd9c0('0x2d')](function(_0x116a44){return db[_0xd9c0('0x3b')][_0xd9c0('0x3c')](_0x1e83ca[_0xd9c0('0x26')],{'raw':_0x1e83ca[_0xd9c0('0x16')]?_0x1e83ca[_0xd9c0('0x16')]['raw']===undefined?!![]:![]:!![],'transaction':_0x116a44})[_0xd9c0('0xb')](function(){return db[_0xd9c0('0x14')][_0xd9c0('0x28')]({'where':_0x1e83ca['options']?_0x1e83ca['options']['where']||null:null,'transaction':_0x116a44});});})[_0xd9c0('0xb')](function(_0x44d2ad){logger['info']('MoveContactManagedDialer',_0x1e83ca);logger[_0xd9c0('0x1e')](_0xd9c0('0x3a'),_0x1e83ca,JSON['stringify'](_0x44d2ad));_0x2a8ec6(_0x44d2ad);})[_0xd9c0('0x1f')](function(_0x5c3072){logger[_0xd9c0('0xf')](_0xd9c0('0x3a'),_0x5c3072['message'],_0x1e83ca);_0x1dab88(_0x17a3ad[_0xd9c0('0xf')](0x1f4,_0x5c3072['message']));});});};exports[_0xd9c0('0x3d')]=function(_0x2385b9){var _0x251dfd=this;return new Promise(function(_0x574b89,_0x5f343f){return db[_0xd9c0('0x14')][_0xd9c0('0x15')]({'raw':_0x2385b9[_0xd9c0('0x16')]?_0x2385b9[_0xd9c0('0x16')][_0xd9c0('0x17')]===undefined?!![]:![]:!![],'where':_0x2385b9['options']?_0x2385b9[_0xd9c0('0x16')][_0xd9c0('0x22')]||null:null,'attributes':[[db['sequelize']['fn'](_0xd9c0('0x3e'),db[_0xd9c0('0x2c')]['fn']('IF',db[_0xd9c0('0x2c')][_0xd9c0('0x3f')](_0xd9c0('0x40')+util[_0xd9c0('0x41')](_0xd9c0('0x42'),moment()[_0xd9c0('0x41')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xd9c0('0x43')))),_0xd9c0('0x44')]]})[_0xd9c0('0xb')](function(_0x26f28e){logger[_0xd9c0('0x11')](_0xd9c0('0x3d'),_0x2385b9);logger[_0xd9c0('0x1e')](_0xd9c0('0x3d'),_0x2385b9,JSON['stringify'](_0x26f28e));_0x574b89(_0x26f28e);})[_0xd9c0('0x1f')](function(_0x175033){logger[_0xd9c0('0xf')]('CountReScheduled',_0x175033[_0xd9c0('0x10')],_0x2385b9);_0x5f343f(_0x251dfd[_0xd9c0('0xf')](0x1f4,_0x175033['message']));});});};exports[_0xd9c0('0x45')]=function(_0x15f621){var _0x18e0d3=this;return new Promise(function(_0x2ebd92,_0x1d5112){return db[_0xd9c0('0x2a')][_0xd9c0('0x2b')]()[_0xd9c0('0xb')](function(_0x17a334){return db[_0xd9c0('0x2c')]['transaction'](function(_0x3c95a0){return db[_0xd9c0('0x14')][_0xd9c0('0x15')]({'where':_0x15f621[_0xd9c0('0x16')]?_0x15f621[_0xd9c0('0x16')][_0xd9c0('0x22')]||null:null,'attributes':_0x15f621['options']?_0x15f621[_0xd9c0('0x16')][_0xd9c0('0x1b')]||null:null,'limit':0x1,'order':_0x15f621[_0xd9c0('0x16')]?_0x15f621[_0xd9c0('0x16')]['order']||null:null,'group':db[_0xd9c0('0x14')]['UserId'],'transaction':_0x3c95a0,'lock':_0x3c95a0[_0xd9c0('0x2f')][_0xd9c0('0x30')],'include':_0x15f621['options']?_0x15f621[_0xd9c0('0x16')][_0xd9c0('0x19')]?_['map'](_0x15f621['options'][_0xd9c0('0x19')],function(_0x209012){return{'model':db[_0x209012[_0xd9c0('0x1c')]],'as':_0x209012['as'],'attributes':_0x209012[_0xd9c0('0x1b')],'include':_0x209012[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x209012['include'],function(_0x2847ce){return{'model':db[_0x2847ce[_0xd9c0('0x1c')]],'as':_0x2847ce['as'],'attributes':_0x2847ce[_0xd9c0('0x1b')],'include':_0x2847ce['include']?_[_0xd9c0('0x1a')](_0x2847ce[_0xd9c0('0x19')],function(_0x2d6ea2){return{'model':db[_0x2d6ea2[_0xd9c0('0x1c')]],'as':_0x2d6ea2['as'],'attributes':_0x2d6ea2[_0xd9c0('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ba01b){var _0x58d670=[];for(var _0xb70103=0x0;_0xb70103<_0x5ba01b[_0xd9c0('0x36')];_0xb70103+=0x1){_0x58d670[_0xd9c0('0x38')](_0x5ba01b[_0xb70103][_0xd9c0('0x25')](_0x15f621[_0xd9c0('0x26')],{'transaction':_0x3c95a0}));}return BPromise[_0xd9c0('0x46')](_0x58d670);});})[_0xd9c0('0xb')](function(_0xb278d3){logger[_0xd9c0('0x11')](_0xd9c0('0x45'),_0x15f621);logger[_0xd9c0('0x1e')](_0xd9c0('0x45'),_0x15f621,JSON[_0xd9c0('0xe')](_0xb278d3));_0x2ebd92(_0xb278d3);})[_0xd9c0('0x1f')](function(_0x21dbbb){logger['error'](_0xd9c0('0x45'),_0x21dbbb[_0xd9c0('0x10')],_0x15f621);_0x1d5112(_0x18e0d3[_0xd9c0('0xf')](0x1f4,_0x21dbbb['message']));});});});};exports[_0xd9c0('0x47')]=function(_0x3041b4){var _0x348326=this;return new Promise(function(_0xc92874,_0x3bc5d4){db[_0xd9c0('0x2a')][_0xd9c0('0x2b')]()[_0xd9c0('0xb')](function(_0x461b90){return db[_0xd9c0('0x14')][_0xd9c0('0x15')]({'raw':_0x3041b4['options']?_0x3041b4[_0xd9c0('0x16')][_0xd9c0('0x17')]===undefined?!![]:![]:!![],'where':_0x3041b4[_0xd9c0('0x16')]?_0x3041b4[_0xd9c0('0x16')][_0xd9c0('0x22')]||null:null,'attributes':_0x3041b4['options']?_0x3041b4[_0xd9c0('0x16')]['attributes']||null:null,'limit':_0x3041b4[_0xd9c0('0x16')]?_0x3041b4[_0xd9c0('0x16')][_0xd9c0('0x18')]||null:null,'include':_0x3041b4['options']?_0x3041b4[_0xd9c0('0x16')][_0xd9c0('0x19')]?_['map'](_0x3041b4[_0xd9c0('0x16')][_0xd9c0('0x19')],function(_0x5dac15){return{'model':db[_0x5dac15['model']],'as':_0x5dac15['as'],'attributes':_0x5dac15['as']===_0xd9c0('0x31')?_[_0xd9c0('0x32')](_0x461b90):_0x5dac15[_0xd9c0('0x1b')],'include':_0x5dac15[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x5dac15[_0xd9c0('0x19')],function(_0x82fc65){return{'model':db[_0x82fc65['model']],'as':_0x82fc65['as'],'attributes':_0x82fc65['attributes'],'include':_0x82fc65[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x82fc65[_0xd9c0('0x19')],function(_0xdcbca7){return{'model':db[_0xdcbca7['model']],'as':_0xdcbca7['as'],'attributes':_0xdcbca7[_0xd9c0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd9c0('0xb')](function(_0x51d9b6){logger[_0xd9c0('0x11')](_0xd9c0('0x1d'),_0x3041b4);logger[_0xd9c0('0x1e')](_0xd9c0('0x1d'),_0x3041b4,JSON[_0xd9c0('0xe')](_0x51d9b6));_0xc92874(_0x51d9b6);})[_0xd9c0('0x1f')](function(_0x3b117f){logger[_0xd9c0('0xf')](_0xd9c0('0x1d'),_0x3b117f[_0xd9c0('0x10')],_0x3041b4);_0x3bc5d4(_0x348326[_0xd9c0('0xf')](0x1f4,_0x3b117f['message']));});});});};
\ No newline at end of file
+var _0x6809=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','CmContact','Contact','keys','Agent','name','length','push','update','includes','all','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','order','UserId','UPDATE','lodash','moment','randomstring','ioredis'];(function(_0x55717d,_0x24d4db){var _0x544dba=function(_0x1b4bf8){while(--_0x1b4bf8){_0x55717d['push'](_0x55717d['shift']());}};_0x544dba(++_0x24d4db);}(_0x6809,0x7e));var _0x9680=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x6809[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x9680('0x0'));var util=require('util');var moment=require(_0x9680('0x1'));var BPromise=require('bluebird');var rs=require(_0x9680('0x2'));var fs=require('fs');var Redis=require(_0x9680('0x3'));var db=require(_0x9680('0x4'))['db'];var utils=require(_0x9680('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9680('0x6'));var jayson=require(_0x9680('0x7'));var client=jayson[_0x9680('0x8')][_0x9680('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b9887,_0x46aa48,_0x3c6f4d){return new BPromise(function(_0x452699,_0x23d1cf){return client['request'](_0x5b9887,_0x3c6f4d)[_0x9680('0xa')](function(_0x5d944e){logger[_0x9680('0xb')](_0x9680('0xc'),_0x46aa48,_0x9680('0xd'));logger[_0x9680('0xe')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x46aa48,_0x9680('0xd'),JSON[_0x9680('0xf')](_0x5d944e));if(_0x5d944e[_0x9680('0x10')]){if(_0x5d944e[_0x9680('0x10')]['code']===0x1f4){logger[_0x9680('0x10')]('CmHopper,\x20%s,\x20%s',_0x46aa48,_0x5d944e[_0x9680('0x10')][_0x9680('0x11')]);return _0x23d1cf(_0x5d944e[_0x9680('0x10')]['message']);}logger[_0x9680('0x10')]('CmHopper,\x20%s,\x20%s',_0x46aa48,_0x5d944e[_0x9680('0x10')][_0x9680('0x11')]);return _0x452699(_0x5d944e[_0x9680('0x10')]['message']);}else{logger[_0x9680('0xb')](_0x9680('0xc'),_0x46aa48,_0x9680('0xd'));_0x452699(_0x5d944e['result'][_0x9680('0x11')]);}})['catch'](function(_0x9e7e67){logger[_0x9680('0x10')]('CmHopper,\x20%s,\x20%s',_0x46aa48,_0x9e7e67);_0x23d1cf(_0x9e7e67);});});}exports[_0x9680('0x12')]=function(_0x34f9ef){var _0xc7b48=this;return new Promise(function(_0xa77933,_0x5d6345){return db[_0x9680('0x13')][_0x9680('0x14')]({'raw':_0x34f9ef[_0x9680('0x15')]?_0x34f9ef[_0x9680('0x15')][_0x9680('0x16')]===undefined?!![]:![]:!![],'where':_0x34f9ef[_0x9680('0x15')]?_0x34f9ef[_0x9680('0x15')][_0x9680('0x17')]||null:null,'attributes':_0x34f9ef['options']?_0x34f9ef[_0x9680('0x15')][_0x9680('0x18')]||null:null,'limit':_0x34f9ef[_0x9680('0x15')]?_0x34f9ef[_0x9680('0x15')][_0x9680('0x19')]||null:null,'include':_0x34f9ef[_0x9680('0x15')]?_0x34f9ef[_0x9680('0x15')][_0x9680('0x1a')]?_[_0x9680('0x1b')](_0x34f9ef[_0x9680('0x15')][_0x9680('0x1a')],function(_0x38479e){return{'model':db[_0x38479e[_0x9680('0x1c')]],'as':_0x38479e['as'],'attributes':_0x38479e[_0x9680('0x18')],'include':_0x38479e[_0x9680('0x1a')]?_[_0x9680('0x1b')](_0x38479e[_0x9680('0x1a')],function(_0x18025d){return{'model':db[_0x18025d['model']],'as':_0x18025d['as'],'attributes':_0x18025d[_0x9680('0x18')],'include':_0x18025d['include']?_[_0x9680('0x1b')](_0x18025d[_0x9680('0x1a')],function(_0x75f490){return{'model':db[_0x75f490[_0x9680('0x1c')]],'as':_0x75f490['as'],'attributes':_0x75f490[_0x9680('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x513e57){logger['info'](_0x9680('0x12'),_0x34f9ef);logger['debug'](_0x9680('0x12'),_0x34f9ef,JSON['stringify'](_0x513e57));_0xa77933(_0x513e57);})[_0x9680('0x1d')](function(_0x339e24){logger[_0x9680('0x10')]('GetCmHopper',_0x339e24[_0x9680('0x11')],_0x34f9ef);_0x5d6345(_0xc7b48[_0x9680('0x10')](0x1f4,_0x339e24[_0x9680('0x11')]));});});};exports[_0x9680('0x1e')]=function(_0x14c1a6){var _0x542630=this;return new Promise(function(_0x5baf5c,_0x14fd40){return db[_0x9680('0x13')][_0x9680('0x1f')]({'raw':_0x14c1a6['options']?_0x14c1a6['options'][_0x9680('0x16')]===undefined?!![]:![]:!![],'where':_0x14c1a6[_0x9680('0x15')]?_0x14c1a6[_0x9680('0x15')][_0x9680('0x17')]||null:null,'attributes':_0x14c1a6[_0x9680('0x15')]?_0x14c1a6[_0x9680('0x15')][_0x9680('0x18')]||null:null,'include':_0x14c1a6[_0x9680('0x15')]?_0x14c1a6['options'][_0x9680('0x1a')]?_[_0x9680('0x1b')](_0x14c1a6[_0x9680('0x15')]['include'],function(_0x40a705){return{'model':db[_0x40a705[_0x9680('0x1c')]],'as':_0x40a705['as'],'attributes':_0x40a705[_0x9680('0x18')],'include':_0x40a705[_0x9680('0x1a')]?_[_0x9680('0x1b')](_0x40a705[_0x9680('0x1a')],function(_0x1351f8){return{'model':db[_0x1351f8[_0x9680('0x1c')]],'as':_0x1351f8['as'],'attributes':_0x1351f8['attributes'],'include':_0x1351f8['include']?_[_0x9680('0x1b')](_0x1351f8[_0x9680('0x1a')],function(_0x5ef049){return{'model':db[_0x5ef049[_0x9680('0x1c')]],'as':_0x5ef049['as'],'attributes':_0x5ef049[_0x9680('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9680('0xa')](function(_0x339c4c){logger[_0x9680('0xb')](_0x9680('0x1e'),_0x14c1a6);logger[_0x9680('0xe')]('ShowCmHopper',_0x14c1a6,JSON[_0x9680('0xf')](_0x339c4c));_0x5baf5c(_0x339c4c);})['catch'](function(_0x4908ae){logger['error']('ShowCmHopper',_0x4908ae[_0x9680('0x11')],_0x14c1a6);_0x14fd40(_0x542630[_0x9680('0x10')](0x1f4,_0x4908ae[_0x9680('0x11')]));});});};exports[_0x9680('0x20')]=function(_0x598ebf){var _0x420019=this;return new Promise(function(_0x3291f3,_0x5d7546){return db[_0x9680('0x13')][_0x9680('0x21')](_0x598ebf[_0x9680('0x22')],{'raw':_0x598ebf['options']?_0x598ebf[_0x9680('0x15')][_0x9680('0x16')]===undefined?!![]:![]:!![]})[_0x9680('0xa')](function(_0x2769c1){logger['info'](_0x9680('0x20'),_0x598ebf);logger[_0x9680('0xe')](_0x9680('0x20'),_0x598ebf,JSON[_0x9680('0xf')](_0x2769c1));_0x3291f3(_0x2769c1);})[_0x9680('0x1d')](function(_0x6fb4fb){logger['error'](_0x9680('0x20'),_0x6fb4fb[_0x9680('0x11')],_0x598ebf);_0x5d7546(_0x420019[_0x9680('0x10')](0x1f4,_0x6fb4fb[_0x9680('0x11')]));});});};exports[_0x9680('0x23')]=function(_0x2a72f5){var _0x3854e2=this;return new Promise(function(_0x37507a,_0x438f53){return db[_0x9680('0x13')]['update'](_0x2a72f5['body'],{'raw':_0x2a72f5[_0x9680('0x15')]?_0x2a72f5['options'][_0x9680('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a72f5[_0x9680('0x15')]?_0x2a72f5['options'][_0x9680('0x17')]||null:null,'attributes':_0x2a72f5['options']?_0x2a72f5[_0x9680('0x15')][_0x9680('0x18')]||null:null,'limit':_0x2a72f5['options']?_0x2a72f5[_0x9680('0x15')][_0x9680('0x19')]||null:null})[_0x9680('0xa')](function(_0x270b4b){logger[_0x9680('0xb')](_0x9680('0x23'),_0x2a72f5);logger[_0x9680('0xe')]('UpdateCmHopper',_0x2a72f5,JSON['stringify'](_0x270b4b));_0x37507a(_0x270b4b);})[_0x9680('0x1d')](function(_0x113c07){logger['error']('UpdateCmHopper',_0x113c07[_0x9680('0x11')],_0x2a72f5);_0x438f53(_0x3854e2['error'](0x1f4,_0x113c07['message']));});});};exports[_0x9680('0x24')]=function(_0xd07d99){var _0x2f6209=this;return new Promise(function(_0x5ae07d,_0x3d5cdc){return db[_0x9680('0x13')]['destroy']({'where':_0xd07d99[_0x9680('0x15')]?_0xd07d99[_0x9680('0x15')][_0x9680('0x17')]||null:null})[_0x9680('0xa')](function(_0xb63ee2){logger[_0x9680('0xb')](_0x9680('0x24'),_0xd07d99);logger[_0x9680('0xe')](_0x9680('0x24'),_0xd07d99,JSON[_0x9680('0xf')](_0xb63ee2));_0x5ae07d(_0xb63ee2);})[_0x9680('0x1d')](function(_0x4d0b1f){logger[_0x9680('0x10')](_0x9680('0x24'),_0x4d0b1f[_0x9680('0x11')],_0xd07d99);_0x3d5cdc(_0x2f6209[_0x9680('0x10')](0x1f4,_0x4d0b1f[_0x9680('0x11')]));});});};exports[_0x9680('0x25')]=function(_0x2f02df){var _0x5e2460=this;return new Promise(function(_0x2de61d,_0x40ee5c){return db['CmContact'][_0x9680('0x26')]()[_0x9680('0xa')](function(_0x542dd9){return db[_0x9680('0x27')][_0x9680('0x28')](function(_0x4367c3){return db['CmHopper']['findAll']({'where':_0x2f02df[_0x9680('0x15')]?_0x2f02df[_0x9680('0x15')][_0x9680('0x17')]||null:null,'attributes':_0x2f02df[_0x9680('0x15')]?_0x2f02df['options']['attributes']||null:null,'limit':_0x2f02df[_0x9680('0x15')]?_0x2f02df[_0x9680('0x15')][_0x9680('0x19')]||null:null,'order':_0x2f02df[_0x9680('0x15')]?_0x2f02df[_0x9680('0x15')]['order']||null:null,'transaction':_0x4367c3,'lock':_0x4367c3['LOCK']['UPDATE'],'include':[{'model':db[_0x9680('0x29')],'as':_0x9680('0x2a'),'attributes':_[_0x9680('0x2b')](_0x542dd9)},{'model':db['User'],'as':_0x9680('0x2c'),'attributes':['id',_0x9680('0x2d'),'voicePause']}]})[_0x9680('0xa')](function(_0x3cbf5f){var _0x20cfe8=[];var _0x59ecc6=[];for(var _0x293076=0x0;_0x293076<_0x3cbf5f[_0x9680('0x2e')];_0x293076+=0x1){var _0x10583e=_0x3cbf5f[_0x293076]['UserId'];if(_0x10583e===null){_0x20cfe8[_0x9680('0x2f')](_0x3cbf5f[_0x293076][_0x9680('0x30')](_0x2f02df['body'],{'transaction':_0x4367c3}));}else if(!_0x59ecc6[_0x9680('0x31')](_0x10583e)){_0x59ecc6[_0x9680('0x2f')](_0x10583e);_0x20cfe8['push'](_0x3cbf5f[_0x293076]['update'](_0x2f02df[_0x9680('0x22')],{'transaction':_0x4367c3}));}}return BPromise[_0x9680('0x32')](_0x20cfe8);});})[_0x9680('0xa')](function(_0x98bebe){logger['info']('GetContactDialer',_0x2f02df);logger['debug'](_0x9680('0x25'),_0x2f02df,JSON['stringify'](_0x98bebe));_0x2de61d(_0x98bebe);})[_0x9680('0x1d')](function(_0x112e83){logger[_0x9680('0x10')](_0x9680('0x25'),_0x112e83[_0x9680('0x11')],_0x2f02df);_0x40ee5c(_0x5e2460[_0x9680('0x10')](0x1f4,_0x112e83[_0x9680('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x592f3a){var _0x40acd5=this;return new Promise(function(_0x57351b,_0xe25ce3){return db['sequelize'][_0x9680('0x28')](function(_0x4124e7){return db['CmHopperFinal'][_0x9680('0x21')](_0x592f3a['body'],{'raw':_0x592f3a[_0x9680('0x15')]?_0x592f3a['options'][_0x9680('0x16')]===undefined?!![]:![]:!![],'transaction':_0x4124e7})[_0x9680('0xa')](function(){return db[_0x9680('0x13')][_0x9680('0x33')]({'where':_0x592f3a['options']?_0x592f3a['options'][_0x9680('0x17')]||null:null,'transaction':_0x4124e7});});})[_0x9680('0xa')](function(_0x312c17){logger[_0x9680('0xb')](_0x9680('0x34'),_0x592f3a);logger[_0x9680('0xe')](_0x9680('0x34'),_0x592f3a,JSON[_0x9680('0xf')](_0x312c17));_0x57351b(_0x312c17);})[_0x9680('0x1d')](function(_0x47399f){logger[_0x9680('0x10')](_0x9680('0x34'),_0x47399f['message'],_0x592f3a);_0xe25ce3(_0x40acd5['error'](0x1f4,_0x47399f['message']));});});};exports[_0x9680('0x35')]=function(_0x4f365b){var _0x5a4842=this;return new Promise(function(_0x3e4f92,_0xa05b3c){return db[_0x9680('0x13')][_0x9680('0x14')]({'raw':_0x4f365b['options']?_0x4f365b['options'][_0x9680('0x16')]===undefined?!![]:![]:!![],'where':_0x4f365b[_0x9680('0x15')]?_0x4f365b['options'][_0x9680('0x17')]||null:null,'attributes':[[db[_0x9680('0x27')]['fn'](_0x9680('0x36'),db[_0x9680('0x27')]['fn']('IF',db['sequelize'][_0x9680('0x37')](_0x9680('0x38')+util['format'](_0x9680('0x39'),moment()[_0x9680('0x3a')](_0x9680('0x3b')))+_0x9680('0x3c')))),'contactsRescheduled']]})[_0x9680('0xa')](function(_0x1e28c4){logger[_0x9680('0xb')]('CountReScheduled',_0x4f365b);logger['debug'](_0x9680('0x35'),_0x4f365b,JSON[_0x9680('0xf')](_0x1e28c4));_0x3e4f92(_0x1e28c4);})['catch'](function(_0x171584){logger[_0x9680('0x10')](_0x9680('0x35'),_0x171584['message'],_0x4f365b);_0xa05b3c(_0x5a4842[_0x9680('0x10')](0x1f4,_0x171584[_0x9680('0x11')]));});});};exports[_0x9680('0x3d')]=function(_0xa1c96e){var _0x54bae4=this;return new Promise(function(_0x2c5c31,_0x102aed){return db[_0x9680('0x29')][_0x9680('0x26')]()[_0x9680('0xa')](function(_0x3714f9){return db['sequelize'][_0x9680('0x28')](function(_0x41d8d1){return db[_0x9680('0x13')][_0x9680('0x14')]({'where':_0xa1c96e[_0x9680('0x15')]?_0xa1c96e['options'][_0x9680('0x17')]||null:null,'attributes':_0xa1c96e[_0x9680('0x15')]?_0xa1c96e[_0x9680('0x15')][_0x9680('0x18')]||null:null,'limit':0x1,'order':_0xa1c96e[_0x9680('0x15')]?_0xa1c96e[_0x9680('0x15')][_0x9680('0x3e')]||null:null,'group':db[_0x9680('0x13')][_0x9680('0x3f')],'transaction':_0x41d8d1,'lock':_0x41d8d1['LOCK'][_0x9680('0x40')],'include':_0xa1c96e[_0x9680('0x15')]?_0xa1c96e[_0x9680('0x15')][_0x9680('0x1a')]?_[_0x9680('0x1b')](_0xa1c96e['options']['include'],function(_0x23b7b8){return{'model':db[_0x23b7b8[_0x9680('0x1c')]],'as':_0x23b7b8['as'],'attributes':_0x23b7b8['attributes'],'include':_0x23b7b8['include']?_[_0x9680('0x1b')](_0x23b7b8[_0x9680('0x1a')],function(_0x2fbeb1){return{'model':db[_0x2fbeb1[_0x9680('0x1c')]],'as':_0x2fbeb1['as'],'attributes':_0x2fbeb1[_0x9680('0x18')],'include':_0x2fbeb1[_0x9680('0x1a')]?_['map'](_0x2fbeb1[_0x9680('0x1a')],function(_0xc808ef){return{'model':db[_0xc808ef[_0x9680('0x1c')]],'as':_0xc808ef['as'],'attributes':_0xc808ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x9680('0xa')](function(_0x34331d){var _0x59d2ce=[];for(var _0x33e9b5=0x0;_0x33e9b5<_0x34331d[_0x9680('0x2e')];_0x33e9b5+=0x1){_0x59d2ce[_0x9680('0x2f')](_0x34331d[_0x33e9b5][_0x9680('0x30')](_0xa1c96e[_0x9680('0x22')],{'transaction':_0x41d8d1}));}return BPromise['all'](_0x59d2ce);});})[_0x9680('0xa')](function(_0x446da4){logger[_0x9680('0xb')](_0x9680('0x3d'),_0xa1c96e);logger['debug'](_0x9680('0x3d'),_0xa1c96e,JSON[_0x9680('0xf')](_0x446da4));_0x2c5c31(_0x446da4);})['catch'](function(_0x5952b8){logger[_0x9680('0x10')](_0x9680('0x3d'),_0x5952b8[_0x9680('0x11')],_0xa1c96e);_0x102aed(_0x54bae4['error'](0x1f4,_0x5952b8[_0x9680('0x11')]));});});});};exports['GetCmHopperPreview']=function(_0x85fdf2){var _0x3ed316=this;return new Promise(function(_0x11ce22,_0x40a386){db[_0x9680('0x29')][_0x9680('0x26')]()['then'](function(_0x35a19b){return db[_0x9680('0x13')][_0x9680('0x14')]({'raw':_0x85fdf2[_0x9680('0x15')]?_0x85fdf2[_0x9680('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x85fdf2['options']?_0x85fdf2[_0x9680('0x15')]['where']||null:null,'attributes':_0x85fdf2[_0x9680('0x15')]?_0x85fdf2[_0x9680('0x15')][_0x9680('0x18')]||null:null,'limit':_0x85fdf2[_0x9680('0x15')]?_0x85fdf2[_0x9680('0x15')]['limit']||null:null,'include':_0x85fdf2[_0x9680('0x15')]?_0x85fdf2[_0x9680('0x15')][_0x9680('0x1a')]?_[_0x9680('0x1b')](_0x85fdf2[_0x9680('0x15')][_0x9680('0x1a')],function(_0x9cc365){return{'model':db[_0x9cc365[_0x9680('0x1c')]],'as':_0x9cc365['as'],'attributes':_0x9cc365['as']===_0x9680('0x2a')?_[_0x9680('0x2b')](_0x35a19b):_0x9cc365[_0x9680('0x18')],'include':_0x9cc365['include']?_['map'](_0x9cc365[_0x9680('0x1a')],function(_0x83e3c0){return{'model':db[_0x83e3c0[_0x9680('0x1c')]],'as':_0x83e3c0['as'],'attributes':_0x83e3c0[_0x9680('0x18')],'include':_0x83e3c0[_0x9680('0x1a')]?_[_0x9680('0x1b')](_0x83e3c0[_0x9680('0x1a')],function(_0x496ba9){return{'model':db[_0x496ba9[_0x9680('0x1c')]],'as':_0x496ba9['as'],'attributes':_0x496ba9[_0x9680('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9680('0xa')](function(_0x58854e){logger[_0x9680('0xb')](_0x9680('0x12'),_0x85fdf2);logger['debug'](_0x9680('0x12'),_0x85fdf2,JSON['stringify'](_0x58854e));_0x11ce22(_0x58854e);})[_0x9680('0x1d')](function(_0x4404ae){logger['error']('GetCmHopper',_0x4404ae[_0x9680('0x11')],_0x85fdf2);_0x40a386(_0x3ed316[_0x9680('0x10')](0x1f4,_0x4404ae[_0x9680('0x11')]));});});});};
\ No newline at end of file
index ac88c6b..bf2c4e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x850c=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','isAuthenticated','index','get','/describe','/opencontacts','getOpenContacts','/:id','post','create','/preview','getPreview','put','delete','destroy','exports','multer'];(function(_0x2e8b7d,_0x58986c){var _0x23ed77=function(_0x39599f){while(--_0x39599f){_0x2e8b7d['push'](_0x2e8b7d['shift']());}};_0x23ed77(++_0x58986c);}(_0x850c,0x81));var _0xc850=function(_0x1ac7b6,_0x243f8){_0x1ac7b6=_0x1ac7b6-0x0;var _0x1a8af2=_0x850c[_0x1ac7b6];return _0x1a8af2;};'use strict';var multer=require(_0xc850('0x0'));var util=require(_0xc850('0x1'));var path=require(_0xc850('0x2'));var timeout=require(_0xc850('0x3'));var express=require(_0xc850('0x4'));var router=express[_0xc850('0x5')]();var fs_extra=require(_0xc850('0x6'));var auth=require(_0xc850('0x7'));var interaction=require(_0xc850('0x8'));var config=require(_0xc850('0x9'));var controller=require(_0xc850('0xa'));router['get']('/',auth[_0xc850('0xb')](),controller[_0xc850('0xc')]);router[_0xc850('0xd')](_0xc850('0xe'),auth[_0xc850('0xb')](),controller['describe']);router[_0xc850('0xd')](_0xc850('0xf'),auth[_0xc850('0xb')](),controller[_0xc850('0x10')]);router[_0xc850('0xd')](_0xc850('0x11'),auth[_0xc850('0xb')](),controller['show']);router[_0xc850('0x12')]('/',auth[_0xc850('0xb')](),controller[_0xc850('0x13')]);router[_0xc850('0x12')](_0xc850('0x14'),auth[_0xc850('0xb')](),controller[_0xc850('0x15')]);router[_0xc850('0x16')](_0xc850('0x11'),auth[_0xc850('0xb')](),controller['update']);router[_0xc850('0x17')](_0xc850('0x11'),auth[_0xc850('0xb')](),controller[_0xc850('0x18')]);module[_0xc850('0x19')]=router;
\ No newline at end of file
+var _0xbf29=['update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','/describe','/opencontacts','/:id','show','create','post','/preview','put'];(function(_0x4877f4,_0x29b0ff){var _0x2bd20f=function(_0x3cdb0d){while(--_0x3cdb0d){_0x4877f4['push'](_0x4877f4['shift']());}};_0x2bd20f(++_0x29b0ff);}(_0xbf29,0x12e));var _0x9bf2=function(_0x310e14,_0xf7dbcd){_0x310e14=_0x310e14-0x0;var _0x1c4f3c=_0xbf29[_0x310e14];return _0x1c4f3c;};'use strict';var multer=require(_0x9bf2('0x0'));var util=require('util');var path=require(_0x9bf2('0x1'));var timeout=require(_0x9bf2('0x2'));var express=require(_0x9bf2('0x3'));var router=express[_0x9bf2('0x4')]();var fs_extra=require(_0x9bf2('0x5'));var auth=require(_0x9bf2('0x6'));var interaction=require(_0x9bf2('0x7'));var config=require(_0x9bf2('0x8'));var controller=require(_0x9bf2('0x9'));router[_0x9bf2('0xa')]('/',auth[_0x9bf2('0xb')](),controller['index']);router[_0x9bf2('0xa')](_0x9bf2('0xc'),auth[_0x9bf2('0xb')](),controller['describe']);router[_0x9bf2('0xa')](_0x9bf2('0xd'),auth[_0x9bf2('0xb')](),controller['getOpenContacts']);router[_0x9bf2('0xa')](_0x9bf2('0xe'),auth[_0x9bf2('0xb')](),controller[_0x9bf2('0xf')]);router['post']('/',auth[_0x9bf2('0xb')](),controller[_0x9bf2('0x10')]);router[_0x9bf2('0x11')](_0x9bf2('0x12'),auth[_0x9bf2('0xb')](),controller['getPreview']);router[_0x9bf2('0x13')]('/:id',auth[_0x9bf2('0xb')](),controller[_0x9bf2('0x14')]);router[_0x9bf2('0x15')](_0x9bf2('0xe'),auth[_0x9bf2('0xb')](),controller['destroy']);module[_0x9bf2('0x16')]=router;
\ No newline at end of file
index 958b1dd..2d6eacb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x448a=['exports','INTEGER','contactListQueue','sequelize'];(function(_0x1059e2,_0x38542c){var _0x3009b0=function(_0x738792){while(--_0x738792){_0x1059e2['push'](_0x1059e2['shift']());}};_0x3009b0(++_0x38542c);}(_0x448a,0x1ef));var _0xa448=function(_0x1925f8,_0x545551){_0x1925f8=_0x1925f8-0x0;var _0x2fd553=_0x448a[_0x1925f8];return _0x2fd553;};'use strict';var moment=require('moment');var Sequelize=require(_0xa448('0x0'));module[_0xa448('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa448('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xa448('0x3')},'VoiceQueueId':{'type':Sequelize[_0xa448('0x2')],'unique':'contactListQueue'}};
\ No newline at end of file
+var _0x4c41=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x2ca63b,_0x2e8b0){var _0x14d053=function(_0x2f90f3){while(--_0x2f90f3){_0x2ca63b['push'](_0x2ca63b['shift']());}};_0x14d053(++_0x2e8b0);}(_0x4c41,0xda));var _0x14c4=function(_0x446681,_0x49733a){_0x446681=_0x446681-0x0;var _0x477e36=_0x4c41[_0x446681];return _0x477e36;};'use strict';var moment=require(_0x14c4('0x0'));var Sequelize=require(_0x14c4('0x1'));module[_0x14c4('0x2')]={'phone':{'type':Sequelize[_0x14c4('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x14c4('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x14c4('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x14c4('0x5')}};
\ No newline at end of file
index 17d6551..0fdd301 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32f4=['Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','fields','length','model','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set'];(function(_0x270f18,_0x8155e9){var _0x39d745=function(_0x294bdd){while(--_0x294bdd){_0x270f18['push'](_0x270f18['shift']());}};_0x39d745(++_0x8155e9);}(_0x32f4,0x154));var _0x432f=function(_0x43a571,_0x30fc65){_0x43a571=_0x43a571-0x0;var _0x5c53c4=_0x32f4[_0x43a571];return _0x5c53c4;};'use strict';var emlformat=require(_0x432f('0x0'));var rimraf=require(_0x432f('0x1'));var zipdir=require(_0x432f('0x2'));var jsonpatch=require(_0x432f('0x3'));var rp=require('request-promise');var moment=require(_0x432f('0x4'));var BPromise=require(_0x432f('0x5'));var Mustache=require('mustache');var util=require(_0x432f('0x6'));var path=require(_0x432f('0x7'));var sox=require(_0x432f('0x8'));var csv=require(_0x432f('0x9'));var ejs=require(_0x432f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x432f('0xb'));var crypto=require(_0x432f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x432f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x432f('0xe'));var Papa=require(_0x432f('0xf'));var Redis=require(_0x432f('0x10'));var authService=require(_0x432f('0x11'));var qs=require(_0x432f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x432f('0x13'));var logger=require('../../config/logger')(_0x432f('0x14'));var utils=require('../../config/utils');var config=require(_0x432f('0x15'));var licenseUtil=require(_0x432f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x457389,_0x29f7d2){_0x29f7d2=_0x29f7d2||0xcc;return function(_0x52e40f){if(_0x52e40f){return _0x457389[_0x432f('0x17')](_0x29f7d2);}return _0x457389[_0x432f('0x18')](_0x29f7d2)['end']();};}function respondWithResult(_0x48a4db,_0x28d9e9){_0x28d9e9=_0x28d9e9||0xc8;return function(_0x44756d){if(_0x44756d){return _0x48a4db[_0x432f('0x18')](_0x28d9e9)[_0x432f('0x19')](_0x44756d);}};}function respondWithFilteredResult(_0x419bfe,_0x4f91c5){return function(_0x175ba7){if(_0x175ba7){var _0x2f0708=typeof _0x4f91c5[_0x432f('0x1a')]===_0x432f('0x1b')&&typeof _0x4f91c5['limit']===_0x432f('0x1b');var _0x30f231=_0x175ba7[_0x432f('0x1c')];var _0x243cf=_0x2f0708?0x0:_0x4f91c5[_0x432f('0x1a')];var _0x129582=_0x2f0708?_0x175ba7['count']:_0x4f91c5[_0x432f('0x1a')]+_0x4f91c5['limit'];var _0x3d545d;if(_0x129582>=_0x30f231){_0x129582=_0x30f231;_0x3d545d=0xc8;}else{_0x3d545d=0xce;}_0x419bfe[_0x432f('0x18')](_0x3d545d);return _0x419bfe[_0x432f('0x1d')](_0x432f('0x1e'),_0x243cf+'-'+_0x129582+'/'+_0x30f231)[_0x432f('0x19')](_0x175ba7);}return null;};}function patchUpdates(_0xf1f5d){return function(_0x10f39b){try{jsonpatch[_0x432f('0x1f')](_0x10f39b,_0xf1f5d,!![]);}catch(_0x693eb3){return BPromise[_0x432f('0x20')](_0x693eb3);}return _0x10f39b[_0x432f('0x21')]();};}function saveUpdates(_0x3446fd,_0x4dd230){return function(_0x5940bd){if(_0x5940bd){return _0x5940bd[_0x432f('0x22')](_0x3446fd)['then'](function(_0x28968e){return _0x28968e;});}return null;};}function removeEntity(_0x5b9c70,_0x37f136){return function(_0x175d1b){if(_0x175d1b){return _0x175d1b[_0x432f('0x23')]()[_0x432f('0x24')](function(){_0x5b9c70[_0x432f('0x18')](0xcc)[_0x432f('0x25')]();});}};}function handleEntityNotFound(_0x59f352,_0x252b3b){return function(_0x33edec){if(!_0x33edec){_0x59f352['sendStatus'](0x194);}return _0x33edec;};}function handleError(_0x2cbde9,_0x3e37ec){_0x3e37ec=_0x3e37ec||0x1f4;return function(_0x2bcbb4){logger[_0x432f('0x26')](_0x2bcbb4[_0x432f('0x27')]);if(_0x2bcbb4[_0x432f('0x28')]){delete _0x2bcbb4[_0x432f('0x28')];}_0x2cbde9['status'](_0x3e37ec)[_0x432f('0x29')](_0x2bcbb4);};}exports['index']=function(_0x1f1fdd,_0x573cc5){var _0x20404d={},_0x5a2c14={},_0x3f768b={'count':0x0,'rows':[]};var _0x489ba6=_[_0x432f('0x2a')](db[_0x432f('0x2b')][_0x432f('0x2c')],function(_0x59c1ab){return{'name':_0x59c1ab[_0x432f('0x2d')],'type':_0x59c1ab[_0x432f('0x2e')]['key']};});_0x5a2c14['model']=_[_0x432f('0x2a')](_0x489ba6,_0x432f('0x28'));_0x5a2c14[_0x432f('0x2f')]=_[_0x432f('0x30')](_0x1f1fdd[_0x432f('0x2f')]);_0x5a2c14[_0x432f('0x31')]=_['intersection'](_0x5a2c14['model'],_0x5a2c14[_0x432f('0x2f')]);_0x20404d[_0x432f('0x32')]=_[_0x432f('0x33')](_0x5a2c14['model'],qs[_0x432f('0x34')](_0x1f1fdd[_0x432f('0x2f')][_0x432f('0x34')]));_0x20404d[_0x432f('0x32')]=_0x20404d[_0x432f('0x32')][_0x432f('0x35')]?_0x20404d[_0x432f('0x32')]:_0x5a2c14[_0x432f('0x36')];if(!_0x1f1fdd['query']['hasOwnProperty'](_0x432f('0x37'))){_0x20404d[_0x432f('0x38')]=qs['limit'](_0x1f1fdd['query']['limit']);_0x20404d[_0x432f('0x1a')]=qs[_0x432f('0x1a')](_0x1f1fdd['query'][_0x432f('0x1a')]);}_0x20404d[_0x432f('0x39')]=qs[_0x432f('0x3a')](_0x1f1fdd['query'][_0x432f('0x3a')]);_0x20404d[_0x432f('0x3b')]=qs['filters'](_[_0x432f('0x3c')](_0x1f1fdd[_0x432f('0x2f')],_0x5a2c14['filters']),_0x489ba6);if(_0x1f1fdd[_0x432f('0x2f')][_0x432f('0x3d')]){_0x20404d[_0x432f('0x3b')]=_[_0x432f('0x3e')](_0x20404d[_0x432f('0x3b')],{'$or':_[_0x432f('0x2a')](_0x489ba6,function(_0xbef36e){if(_0xbef36e[_0x432f('0x2e')]!==_0x432f('0x3f')){var _0x2545b7={};_0x2545b7[_0xbef36e[_0x432f('0x28')]]={'$like':'%'+_0x1f1fdd['query'][_0x432f('0x3d')]+'%'};return _0x2545b7;}})});}_0x20404d=_['merge']({},_0x20404d,_0x1f1fdd[_0x432f('0x40')]);var _0x3e8a0a={'where':_0x20404d['where']};return db[_0x432f('0x2b')]['count'](_0x3e8a0a)[_0x432f('0x24')](function(_0x3aca68){_0x3f768b['count']=_0x3aca68;if(_0x1f1fdd['query'][_0x432f('0x41')]){_0x20404d[_0x432f('0x42')]=[{'all':!![]}];}return db[_0x432f('0x2b')][_0x432f('0x43')](_0x20404d);})[_0x432f('0x24')](function(_0x513a57){_0x3f768b['rows']=_0x513a57;return _0x3f768b;})['then'](respondWithFilteredResult(_0x573cc5,_0x20404d))[_0x432f('0x44')](handleError(_0x573cc5,null));};exports[_0x432f('0x45')]=function(_0x55d64c,_0x1f58af){var _0x841572={'raw':!![],'where':{'id':_0x55d64c[_0x432f('0x46')]['id']}},_0x41c90c={};_0x41c90c[_0x432f('0x36')]=_[_0x432f('0x30')](db[_0x432f('0x2b')][_0x432f('0x2c')]);_0x41c90c[_0x432f('0x2f')]=_['keys'](_0x55d64c[_0x432f('0x2f')]);_0x41c90c[_0x432f('0x31')]=_['intersection'](_0x41c90c[_0x432f('0x36')],_0x41c90c[_0x432f('0x2f')]);_0x841572[_0x432f('0x32')]=_[_0x432f('0x33')](_0x41c90c[_0x432f('0x36')],qs[_0x432f('0x34')](_0x55d64c[_0x432f('0x2f')][_0x432f('0x34')]));_0x841572[_0x432f('0x32')]=_0x841572[_0x432f('0x32')][_0x432f('0x35')]?_0x841572[_0x432f('0x32')]:_0x41c90c[_0x432f('0x36')];if(_0x55d64c[_0x432f('0x2f')]['includeAll']){_0x841572['include']=[{'all':!![]}];}_0x841572=_[_0x432f('0x3e')]({},_0x841572,_0x55d64c[_0x432f('0x40')]);return db[_0x432f('0x2b')][_0x432f('0x47')](_0x841572)[_0x432f('0x24')](handleEntityNotFound(_0x1f58af,null))['then'](respondWithResult(_0x1f58af,null))[_0x432f('0x44')](handleError(_0x1f58af,null));};exports[_0x432f('0x22')]=function(_0x46c5ee,_0x2f88d6){if(_0x46c5ee[_0x432f('0x48')]['id']){delete _0x46c5ee[_0x432f('0x48')]['id'];}return db[_0x432f('0x2b')]['find']({'where':{'id':_0x46c5ee[_0x432f('0x46')]['id']}})[_0x432f('0x24')](handleEntityNotFound(_0x2f88d6,null))[_0x432f('0x24')](saveUpdates(_0x46c5ee['body'],null))[_0x432f('0x24')](respondWithResult(_0x2f88d6,null))[_0x432f('0x44')](handleError(_0x2f88d6,null));};exports['destroy']=function(_0x5997db,_0x3b2021){return db[_0x432f('0x2b')]['find']({'where':{'id':_0x5997db['params']['id']}})[_0x432f('0x24')](handleEntityNotFound(_0x3b2021,null))['then'](removeEntity(_0x3b2021,null))[_0x432f('0x44')](handleError(_0x3b2021,null));};exports[_0x432f('0x49')]=function(_0x5df9b3,_0x12f2f7){return db['CmHopperBlack'][_0x432f('0x49')]()[_0x432f('0x24')](respondWithResult(_0x12f2f7,null))[_0x432f('0x44')](handleError(_0x12f2f7,null));};
\ No newline at end of file
+var _0x6799=['../../mysqldb','status','end','offset','undefined','count','set','Content-Range','save','then','destroy','sendStatus','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','length','nolimit','limit','sort','where','pick','filter','merge','type','includeAll','include','rows','show','keys','options','find','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x3c2576,_0x10994b){var _0x3435d0=function(_0x50a737){while(--_0x50a737){_0x3c2576['push'](_0x3c2576['shift']());}};_0x3435d0(++_0x10994b);}(_0x6799,0x1bb));var _0x9679=function(_0x18416f,_0x26ce22){_0x18416f=_0x18416f-0x0;var _0x18a3a2=_0x6799[_0x18416f];return _0x18a3a2;};'use strict';var emlformat=require(_0x9679('0x0'));var rimraf=require(_0x9679('0x1'));var zipdir=require(_0x9679('0x2'));var jsonpatch=require(_0x9679('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9679('0x4'));var util=require('util');var path=require('path');var sox=require(_0x9679('0x5'));var csv=require(_0x9679('0x6'));var ejs=require(_0x9679('0x7'));var fs=require('fs');var fs_extra=require(_0x9679('0x8'));var _=require(_0x9679('0x9'));var squel=require('squel');var crypto=require(_0x9679('0xa'));var jsforce=require(_0x9679('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9679('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9679('0xc'));var authService=require(_0x9679('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x9679('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9679('0xf'))(_0x9679('0x10'));var utils=require('../../config/utils');var config=require(_0x9679('0x11'));var licenseUtil=require(_0x9679('0x12'));var db=require(_0x9679('0x13'))['db'];function respondWithStatusCode(_0xe893e,_0x2feec0){_0x2feec0=_0x2feec0||0xcc;return function(_0x2c56f2){if(_0x2c56f2){return _0xe893e['sendStatus'](_0x2feec0);}return _0xe893e[_0x9679('0x14')](_0x2feec0)[_0x9679('0x15')]();};}function respondWithResult(_0x4c91f7,_0x182be7){_0x182be7=_0x182be7||0xc8;return function(_0x515af2){if(_0x515af2){return _0x4c91f7['status'](_0x182be7)['json'](_0x515af2);}};}function respondWithFilteredResult(_0x3a2b46,_0x26dde7){return function(_0x423c89){if(_0x423c89){var _0x82d996=typeof _0x26dde7[_0x9679('0x16')]===_0x9679('0x17')&&typeof _0x26dde7['limit']===_0x9679('0x17');var _0x56e918=_0x423c89[_0x9679('0x18')];var _0x295ee1=_0x82d996?0x0:_0x26dde7[_0x9679('0x16')];var _0x222cba=_0x82d996?_0x423c89[_0x9679('0x18')]:_0x26dde7[_0x9679('0x16')]+_0x26dde7['limit'];var _0x40e463;if(_0x222cba>=_0x56e918){_0x222cba=_0x56e918;_0x40e463=0xc8;}else{_0x40e463=0xce;}_0x3a2b46['status'](_0x40e463);return _0x3a2b46[_0x9679('0x19')](_0x9679('0x1a'),_0x295ee1+'-'+_0x222cba+'/'+_0x56e918)['json'](_0x423c89);}return null;};}function patchUpdates(_0x4f92e7){return function(_0x52998c){try{jsonpatch['apply'](_0x52998c,_0x4f92e7,!![]);}catch(_0x511935){return BPromise['reject'](_0x511935);}return _0x52998c[_0x9679('0x1b')]();};}function saveUpdates(_0x5a4ec5,_0x49672b){return function(_0x3473bc){if(_0x3473bc){return _0x3473bc['update'](_0x5a4ec5)[_0x9679('0x1c')](function(_0x5ebaaf){return _0x5ebaaf;});}return null;};}function removeEntity(_0xa40b55,_0x5caf0b){return function(_0x50ec2e){if(_0x50ec2e){return _0x50ec2e[_0x9679('0x1d')]()['then'](function(){_0xa40b55[_0x9679('0x14')](0xcc)[_0x9679('0x15')]();});}};}function handleEntityNotFound(_0x203407,_0x3c176d){return function(_0x2b1056){if(!_0x2b1056){_0x203407[_0x9679('0x1e')](0x194);}return _0x2b1056;};}function handleError(_0x321a72,_0x52739a){_0x52739a=_0x52739a||0x1f4;return function(_0x46f25a){logger[_0x9679('0x1f')](_0x46f25a[_0x9679('0x20')]);if(_0x46f25a[_0x9679('0x21')]){delete _0x46f25a[_0x9679('0x21')];}_0x321a72['status'](_0x52739a)[_0x9679('0x22')](_0x46f25a);};}exports[_0x9679('0x23')]=function(_0x32c7fb,_0x499f95){var _0x15fb03={},_0x3d8a22={},_0x1d772e={'count':0x0,'rows':[]};var _0xb91349=_[_0x9679('0x24')](db[_0x9679('0x25')][_0x9679('0x26')],function(_0x485d84){return{'name':_0x485d84[_0x9679('0x27')],'type':_0x485d84['type']['key']};});_0x3d8a22[_0x9679('0x28')]=_[_0x9679('0x24')](_0xb91349,_0x9679('0x21'));_0x3d8a22['query']=_['keys'](_0x32c7fb[_0x9679('0x29')]);_0x3d8a22[_0x9679('0x2a')]=_['intersection'](_0x3d8a22['model'],_0x3d8a22[_0x9679('0x29')]);_0x15fb03[_0x9679('0x2b')]=_[_0x9679('0x2c')](_0x3d8a22[_0x9679('0x28')],qs[_0x9679('0x2d')](_0x32c7fb[_0x9679('0x29')][_0x9679('0x2d')]));_0x15fb03['attributes']=_0x15fb03[_0x9679('0x2b')][_0x9679('0x2e')]?_0x15fb03[_0x9679('0x2b')]:_0x3d8a22[_0x9679('0x28')];if(!_0x32c7fb[_0x9679('0x29')]['hasOwnProperty'](_0x9679('0x2f'))){_0x15fb03[_0x9679('0x30')]=qs['limit'](_0x32c7fb['query'][_0x9679('0x30')]);_0x15fb03[_0x9679('0x16')]=qs[_0x9679('0x16')](_0x32c7fb[_0x9679('0x29')][_0x9679('0x16')]);}_0x15fb03['order']=qs[_0x9679('0x31')](_0x32c7fb['query'][_0x9679('0x31')]);_0x15fb03[_0x9679('0x32')]=qs[_0x9679('0x2a')](_[_0x9679('0x33')](_0x32c7fb[_0x9679('0x29')],_0x3d8a22[_0x9679('0x2a')]),_0xb91349);if(_0x32c7fb[_0x9679('0x29')][_0x9679('0x34')]){_0x15fb03[_0x9679('0x32')]=_[_0x9679('0x35')](_0x15fb03[_0x9679('0x32')],{'$or':_['map'](_0xb91349,function(_0x12ee01){if(_0x12ee01[_0x9679('0x36')]!=='VIRTUAL'){var _0x22b5ac={};_0x22b5ac[_0x12ee01[_0x9679('0x21')]]={'$like':'%'+_0x32c7fb['query'][_0x9679('0x34')]+'%'};return _0x22b5ac;}})});}_0x15fb03=_[_0x9679('0x35')]({},_0x15fb03,_0x32c7fb['options']);var _0x127877={'where':_0x15fb03['where']};return db[_0x9679('0x25')][_0x9679('0x18')](_0x127877)[_0x9679('0x1c')](function(_0x1c7870){_0x1d772e[_0x9679('0x18')]=_0x1c7870;if(_0x32c7fb[_0x9679('0x29')][_0x9679('0x37')]){_0x15fb03[_0x9679('0x38')]=[{'all':!![]}];}return db[_0x9679('0x25')]['findAll'](_0x15fb03);})[_0x9679('0x1c')](function(_0x2a732a){_0x1d772e[_0x9679('0x39')]=_0x2a732a;return _0x1d772e;})[_0x9679('0x1c')](respondWithFilteredResult(_0x499f95,_0x15fb03))['catch'](handleError(_0x499f95,null));};exports[_0x9679('0x3a')]=function(_0x351e1d,_0x163d3f){var _0x25a60f={'raw':!![],'where':{'id':_0x351e1d['params']['id']}},_0x371c14={};_0x371c14[_0x9679('0x28')]=_['keys'](db[_0x9679('0x25')][_0x9679('0x26')]);_0x371c14[_0x9679('0x29')]=_[_0x9679('0x3b')](_0x351e1d[_0x9679('0x29')]);_0x371c14[_0x9679('0x2a')]=_[_0x9679('0x2c')](_0x371c14['model'],_0x371c14[_0x9679('0x29')]);_0x25a60f[_0x9679('0x2b')]=_[_0x9679('0x2c')](_0x371c14[_0x9679('0x28')],qs[_0x9679('0x2d')](_0x351e1d[_0x9679('0x29')][_0x9679('0x2d')]));_0x25a60f[_0x9679('0x2b')]=_0x25a60f[_0x9679('0x2b')][_0x9679('0x2e')]?_0x25a60f[_0x9679('0x2b')]:_0x371c14[_0x9679('0x28')];if(_0x351e1d[_0x9679('0x29')][_0x9679('0x37')]){_0x25a60f[_0x9679('0x38')]=[{'all':!![]}];}_0x25a60f=_[_0x9679('0x35')]({},_0x25a60f,_0x351e1d[_0x9679('0x3c')]);return db[_0x9679('0x25')][_0x9679('0x3d')](_0x25a60f)[_0x9679('0x1c')](handleEntityNotFound(_0x163d3f,null))[_0x9679('0x1c')](respondWithResult(_0x163d3f,null))[_0x9679('0x3e')](handleError(_0x163d3f,null));};exports['update']=function(_0x4672ab,_0x58ca12){if(_0x4672ab[_0x9679('0x3f')]['id']){delete _0x4672ab[_0x9679('0x3f')]['id'];}return db[_0x9679('0x25')][_0x9679('0x3d')]({'where':{'id':_0x4672ab[_0x9679('0x40')]['id']}})[_0x9679('0x1c')](handleEntityNotFound(_0x58ca12,null))[_0x9679('0x1c')](saveUpdates(_0x4672ab[_0x9679('0x3f')],null))[_0x9679('0x1c')](respondWithResult(_0x58ca12,null))[_0x9679('0x3e')](handleError(_0x58ca12,null));};exports[_0x9679('0x1d')]=function(_0x1d10eb,_0x269d41){return db['CmHopperBlack'][_0x9679('0x3d')]({'where':{'id':_0x1d10eb['params']['id']}})[_0x9679('0x1c')](handleEntityNotFound(_0x269d41,null))[_0x9679('0x1c')](removeEntity(_0x269d41,null))[_0x9679('0x3e')](handleError(_0x269d41,null));};exports[_0x9679('0x41')]=function(_0x56d470,_0x4cfec0){return db[_0x9679('0x25')][_0x9679('0x41')]()[_0x9679('0x1c')](respondWithResult(_0x4cfec0,null))['catch'](handleError(_0x4cfec0,null));};
\ No newline at end of file
index 5b2e146..d592f85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa80b=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x33ac0b,_0x3f6182){var _0x405ae5=function(_0x48a319){while(--_0x48a319){_0x33ac0b['push'](_0x33ac0b['shift']());}};_0x405ae5(++_0x3f6182);}(_0xa80b,0x1c0));var _0xba80=function(_0x4f81f6,_0x4d8c60){_0x4f81f6=_0x4f81f6-0x0;var _0x283e8e=_0xa80b[_0x4f81f6];return _0x283e8e;};'use strict';var _=require(_0xba80('0x0'));var util=require(_0xba80('0x1'));var logger=require(_0xba80('0x2'))('api');var moment=require(_0xba80('0x3'));var BPromise=require(_0xba80('0x4'));var rp=require(_0xba80('0x5'));var fs=require('fs');var path=require(_0xba80('0x6'));var rimraf=require(_0xba80('0x7'));var config=require(_0xba80('0x8'));var attributes=require(_0xba80('0x9'));module[_0xba80('0xa')]=function(_0x1faf8e,_0x4d3985){return _0x1faf8e['define'](_0xba80('0xb'),attributes,{'tableName':_0xba80('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe312=['path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5f46e7,_0x62f9f8){var _0x567e95=function(_0x5cb693){while(--_0x5cb693){_0x5f46e7['push'](_0x5f46e7['shift']());}};_0x567e95(++_0x62f9f8);}(_0xe312,0x118));var _0x2e31=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xe312[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x2e31('0x0'));var util=require(_0x2e31('0x1'));var logger=require('../../config/logger')(_0x2e31('0x2'));var moment=require(_0x2e31('0x3'));var BPromise=require(_0x2e31('0x4'));var rp=require(_0x2e31('0x5'));var fs=require('fs');var path=require(_0x2e31('0x6'));var rimraf=require('rimraf');var config=require(_0x2e31('0x7'));var attributes=require(_0x2e31('0x8'));module[_0x2e31('0x9')]=function(_0x3d5907,_0x5c81eb){return _0x3d5907[_0x2e31('0xa')](_0x2e31('0xb'),attributes,{'tableName':_0x2e31('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4d1d54b..d399020 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfae=['code','message','result','options','raw','attributes','limit','map','model','include','GetCmHopperBlack','UpdateCmHopperBlack','CmHopperBlack','update','body','debug','catch','destroy','where','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xdfae,0x17c));var _0xedfa=function(_0x3f9584,_0x5ab12c){_0x3f9584=_0x3f9584-0x0;var _0x9d54c=_0xdfae[_0x3f9584];return _0x9d54c;};'use strict';var _=require(_0xedfa('0x0'));var util=require('util');var moment=require(_0xedfa('0x1'));var BPromise=require(_0xedfa('0x2'));var rs=require(_0xedfa('0x3'));var fs=require('fs');var Redis=require(_0xedfa('0x4'));var db=require(_0xedfa('0x5'))['db'];var utils=require(_0xedfa('0x6'));var logger=require(_0xedfa('0x7'))(_0xedfa('0x8'));var config=require(_0xedfa('0x9'));var jayson=require(_0xedfa('0xa'));var client=jayson[_0xedfa('0xb')][_0xedfa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c428e,_0x44f47f,_0x503297){return new BPromise(function(_0x44f9fb,_0x38a6e3){return client['request'](_0x5c428e,_0x503297)[_0xedfa('0xd')](function(_0x534a6d){logger[_0xedfa('0xe')](_0xedfa('0xf'),_0x44f47f,_0xedfa('0x10'));logger['debug'](_0xedfa('0x11'),_0x44f47f,_0xedfa('0x10'),JSON[_0xedfa('0x12')](_0x534a6d));if(_0x534a6d[_0xedfa('0x13')]){if(_0x534a6d[_0xedfa('0x13')][_0xedfa('0x14')]===0x1f4){logger['error'](_0xedfa('0xf'),_0x44f47f,_0x534a6d[_0xedfa('0x13')][_0xedfa('0x15')]);return _0x38a6e3(_0x534a6d[_0xedfa('0x13')][_0xedfa('0x15')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x44f47f,_0x534a6d['error'][_0xedfa('0x15')]);return _0x44f9fb(_0x534a6d[_0xedfa('0x13')][_0xedfa('0x15')]);}else{logger[_0xedfa('0xe')](_0xedfa('0xf'),_0x44f47f,'request\x20sent');_0x44f9fb(_0x534a6d[_0xedfa('0x16')]['message']);}})['catch'](function(_0x27c1f3){logger[_0xedfa('0x13')](_0xedfa('0xf'),_0x44f47f,_0x27c1f3);_0x38a6e3(_0x27c1f3);});});}exports['GetCmHopperBlack']=function(_0x3c4760){var _0x1aee83=this;return new Promise(function(_0x5499e9,_0x3dfd51){return db['CmHopperBlack']['findAll']({'raw':_0x3c4760[_0xedfa('0x17')]?_0x3c4760[_0xedfa('0x17')][_0xedfa('0x18')]===undefined?!![]:![]:!![],'where':_0x3c4760[_0xedfa('0x17')]?_0x3c4760['options']['where']||null:null,'attributes':_0x3c4760[_0xedfa('0x17')]?_0x3c4760[_0xedfa('0x17')][_0xedfa('0x19')]||null:null,'limit':_0x3c4760['options']?_0x3c4760[_0xedfa('0x17')][_0xedfa('0x1a')]||null:null,'include':_0x3c4760['options']?_0x3c4760[_0xedfa('0x17')]['include']?_[_0xedfa('0x1b')](_0x3c4760[_0xedfa('0x17')]['include'],function(_0x270968){return{'model':db[_0x270968[_0xedfa('0x1c')]],'as':_0x270968['as'],'attributes':_0x270968['attributes'],'include':_0x270968[_0xedfa('0x1d')]?_[_0xedfa('0x1b')](_0x270968[_0xedfa('0x1d')],function(_0x3c1f77){return{'model':db[_0x3c1f77[_0xedfa('0x1c')]],'as':_0x3c1f77['as'],'attributes':_0x3c1f77['attributes'],'include':_0x3c1f77[_0xedfa('0x1d')]?_[_0xedfa('0x1b')](_0x3c1f77[_0xedfa('0x1d')],function(_0x578535){return{'model':db[_0x578535[_0xedfa('0x1c')]],'as':_0x578535['as'],'attributes':_0x578535[_0xedfa('0x19')]};}):[]};}):[]};}):[]:[]})[_0xedfa('0xd')](function(_0xd89257){logger['info'](_0xedfa('0x1e'),_0x3c4760);logger['debug'](_0xedfa('0x1e'),_0x3c4760,JSON[_0xedfa('0x12')](_0xd89257));_0x5499e9(_0xd89257);})['catch'](function(_0x347fe9){logger[_0xedfa('0x13')](_0xedfa('0x1e'),_0x347fe9[_0xedfa('0x15')],_0x3c4760);_0x3dfd51(_0x1aee83['error'](0x1f4,_0x347fe9[_0xedfa('0x15')]));});});};exports[_0xedfa('0x1f')]=function(_0x377a4a){var _0x30004b=this;return new Promise(function(_0x7b3a3d,_0xcfcfab){return db[_0xedfa('0x20')][_0xedfa('0x21')](_0x377a4a[_0xedfa('0x22')],{'raw':_0x377a4a[_0xedfa('0x17')]?_0x377a4a[_0xedfa('0x17')][_0xedfa('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x377a4a[_0xedfa('0x17')]?_0x377a4a[_0xedfa('0x17')]['where']||null:null,'attributes':_0x377a4a[_0xedfa('0x17')]?_0x377a4a[_0xedfa('0x17')]['attributes']||null:null,'limit':_0x377a4a[_0xedfa('0x17')]?_0x377a4a[_0xedfa('0x17')]['limit']||null:null})[_0xedfa('0xd')](function(_0x578de7){logger[_0xedfa('0xe')](_0xedfa('0x1f'),_0x377a4a);logger[_0xedfa('0x23')](_0xedfa('0x1f'),_0x377a4a,JSON[_0xedfa('0x12')](_0x578de7));_0x7b3a3d(_0x578de7);})[_0xedfa('0x24')](function(_0x56c25d){logger[_0xedfa('0x13')]('UpdateCmHopperBlack',_0x56c25d['message'],_0x377a4a);_0xcfcfab(_0x30004b[_0xedfa('0x13')](0x1f4,_0x56c25d['message']));});});};exports['DestroyCmHopperBlack']=function(_0x4dbc74){var _0x58c5d4=this;return new Promise(function(_0x4b8e6d,_0x1345ea){return db['CmHopperBlack'][_0xedfa('0x25')]({'where':_0x4dbc74[_0xedfa('0x17')]?_0x4dbc74['options'][_0xedfa('0x26')]||null:null})[_0xedfa('0xd')](function(_0x4ec836){logger['info']('DestroyCmHopperBlack',_0x4dbc74);logger[_0xedfa('0x23')](_0xedfa('0x27'),_0x4dbc74,JSON[_0xedfa('0x12')](_0x4ec836));_0x4b8e6d(_0x4ec836);})[_0xedfa('0x24')](function(_0xb7d12d){logger[_0xedfa('0x13')](_0xedfa('0x27'),_0xb7d12d[_0xedfa('0x15')],_0x4dbc74);_0x1345ea(_0x58c5d4['error'](0x1f4,_0xb7d12d[_0xedfa('0x15')]));});});};
\ No newline at end of file
+var _0x4e68=['model','map','then','update','body','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include'];(function(_0x5a4ad5,_0x4d83a7){var _0x44ebda=function(_0x3080b1){while(--_0x3080b1){_0x5a4ad5['push'](_0x5a4ad5['shift']());}};_0x44ebda(++_0x4d83a7);}(_0x4e68,0x1db));var _0x84e6=function(_0x24a6cc,_0x550d4e){_0x24a6cc=_0x24a6cc-0x0;var _0x3f4380=_0x4e68[_0x24a6cc];return _0x3f4380;};'use strict';var _=require(_0x84e6('0x0'));var util=require('util');var moment=require(_0x84e6('0x1'));var BPromise=require(_0x84e6('0x2'));var rs=require(_0x84e6('0x3'));var fs=require('fs');var Redis=require(_0x84e6('0x4'));var db=require(_0x84e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x84e6('0x6'))(_0x84e6('0x7'));var config=require(_0x84e6('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x84e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10d8f8,_0x8ebe5f,_0x26a691){return new BPromise(function(_0x3e107c,_0x4a955a){return client['request'](_0x10d8f8,_0x26a691)['then'](function(_0x519043){logger[_0x84e6('0xa')](_0x84e6('0xb'),_0x8ebe5f,_0x84e6('0xc'));logger[_0x84e6('0xd')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x8ebe5f,'request\x20sent',JSON[_0x84e6('0xe')](_0x519043));if(_0x519043[_0x84e6('0xf')]){if(_0x519043[_0x84e6('0xf')][_0x84e6('0x10')]===0x1f4){logger[_0x84e6('0xf')](_0x84e6('0xb'),_0x8ebe5f,_0x519043[_0x84e6('0xf')][_0x84e6('0x11')]);return _0x4a955a(_0x519043['error']['message']);}logger[_0x84e6('0xf')](_0x84e6('0xb'),_0x8ebe5f,_0x519043[_0x84e6('0xf')]['message']);return _0x3e107c(_0x519043[_0x84e6('0xf')][_0x84e6('0x11')]);}else{logger['info'](_0x84e6('0xb'),_0x8ebe5f,_0x84e6('0xc'));_0x3e107c(_0x519043[_0x84e6('0x12')][_0x84e6('0x11')]);}})[_0x84e6('0x13')](function(_0x117dc0){logger[_0x84e6('0xf')](_0x84e6('0xb'),_0x8ebe5f,_0x117dc0);_0x4a955a(_0x117dc0);});});}exports[_0x84e6('0x14')]=function(_0x22b35f){var _0x19c24c=this;return new Promise(function(_0x15dd5b,_0x3baf9b){return db[_0x84e6('0x15')][_0x84e6('0x16')]({'raw':_0x22b35f[_0x84e6('0x17')]?_0x22b35f[_0x84e6('0x17')][_0x84e6('0x18')]===undefined?!![]:![]:!![],'where':_0x22b35f['options']?_0x22b35f[_0x84e6('0x17')][_0x84e6('0x19')]||null:null,'attributes':_0x22b35f['options']?_0x22b35f[_0x84e6('0x17')][_0x84e6('0x1a')]||null:null,'limit':_0x22b35f[_0x84e6('0x17')]?_0x22b35f['options'][_0x84e6('0x1b')]||null:null,'include':_0x22b35f[_0x84e6('0x17')]?_0x22b35f[_0x84e6('0x17')][_0x84e6('0x1c')]?_['map'](_0x22b35f[_0x84e6('0x17')][_0x84e6('0x1c')],function(_0x1a689e){return{'model':db[_0x1a689e[_0x84e6('0x1d')]],'as':_0x1a689e['as'],'attributes':_0x1a689e[_0x84e6('0x1a')],'include':_0x1a689e['include']?_['map'](_0x1a689e[_0x84e6('0x1c')],function(_0x5ba41d){return{'model':db[_0x5ba41d[_0x84e6('0x1d')]],'as':_0x5ba41d['as'],'attributes':_0x5ba41d['attributes'],'include':_0x5ba41d[_0x84e6('0x1c')]?_[_0x84e6('0x1e')](_0x5ba41d['include'],function(_0x35d91c){return{'model':db[_0x35d91c[_0x84e6('0x1d')]],'as':_0x35d91c['as'],'attributes':_0x35d91c['attributes']};}):[]};}):[]};}):[]:[]})[_0x84e6('0x1f')](function(_0x391e1f){logger[_0x84e6('0xa')](_0x84e6('0x14'),_0x22b35f);logger[_0x84e6('0xd')](_0x84e6('0x14'),_0x22b35f,JSON[_0x84e6('0xe')](_0x391e1f));_0x15dd5b(_0x391e1f);})[_0x84e6('0x13')](function(_0xc790b6){logger[_0x84e6('0xf')](_0x84e6('0x14'),_0xc790b6[_0x84e6('0x11')],_0x22b35f);_0x3baf9b(_0x19c24c['error'](0x1f4,_0xc790b6[_0x84e6('0x11')]));});});};exports['UpdateCmHopperBlack']=function(_0x3a2c49){var _0x5b734c=this;return new Promise(function(_0x231fc4,_0x163718){return db[_0x84e6('0x15')][_0x84e6('0x20')](_0x3a2c49[_0x84e6('0x21')],{'raw':_0x3a2c49[_0x84e6('0x17')]?_0x3a2c49[_0x84e6('0x17')][_0x84e6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a2c49[_0x84e6('0x17')]?_0x3a2c49[_0x84e6('0x17')][_0x84e6('0x19')]||null:null,'attributes':_0x3a2c49[_0x84e6('0x17')]?_0x3a2c49[_0x84e6('0x17')]['attributes']||null:null,'limit':_0x3a2c49[_0x84e6('0x17')]?_0x3a2c49[_0x84e6('0x17')]['limit']||null:null})['then'](function(_0x261c7a){logger[_0x84e6('0xa')]('UpdateCmHopperBlack',_0x3a2c49);logger['debug']('UpdateCmHopperBlack',_0x3a2c49,JSON[_0x84e6('0xe')](_0x261c7a));_0x231fc4(_0x261c7a);})[_0x84e6('0x13')](function(_0xf87be9){logger[_0x84e6('0xf')](_0x84e6('0x22'),_0xf87be9['message'],_0x3a2c49);_0x163718(_0x5b734c['error'](0x1f4,_0xf87be9[_0x84e6('0x11')]));});});};exports[_0x84e6('0x23')]=function(_0x57663f){var _0x20c301=this;return new Promise(function(_0x17c623,_0xc9f40d){return db[_0x84e6('0x15')]['destroy']({'where':_0x57663f['options']?_0x57663f['options'][_0x84e6('0x19')]||null:null})['then'](function(_0x2d1771){logger[_0x84e6('0xa')]('DestroyCmHopperBlack',_0x57663f);logger[_0x84e6('0xd')](_0x84e6('0x23'),_0x57663f,JSON['stringify'](_0x2d1771));_0x17c623(_0x2d1771);})[_0x84e6('0x13')](function(_0x343751){logger[_0x84e6('0xf')]('DestroyCmHopperBlack',_0x343751[_0x84e6('0x11')],_0x57663f);_0xc9f40d(_0x20c301['error'](0x1f4,_0x343751[_0x84e6('0x11')]));});});};
\ No newline at end of file
index c7b0a2c..2e31231 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf55=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','delete','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x20600a,_0x599df7){var _0x1d6e13=function(_0x37eaea){while(--_0x37eaea){_0x20600a['push'](_0x20600a['shift']());}};_0x1d6e13(++_0x599df7);}(_0xdf55,0x83));var _0x5df5=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0xdf55[_0x2742db];return _0x18659e;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var fs_extra=require(_0x5df5('0x4'));var auth=require(_0x5df5('0x5'));var interaction=require(_0x5df5('0x6'));var config=require('../../config/environment');var controller=require(_0x5df5('0x7'));router[_0x5df5('0x8')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0xa')]);router[_0x5df5('0x8')](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xc')]);router['get'](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xe')]);router['put']('/:id',auth[_0x5df5('0x9')](),controller['update']);router[_0x5df5('0xf')](_0x5df5('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x5df5('0x10')]=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(_0x1decce,_0x1b1921){var _0x2e172f=function(_0x2d8716){while(--_0x2d8716){_0x1decce['push'](_0x1decce['shift']());}};_0x2e172f(++_0x1b1921);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x4103d6,_0x42e4f6){_0x4103d6=_0x4103d6-0x0;var _0x565ccb=_0xaa3f[_0x4103d6];return _0x565ccb;};'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 69c103f..c378339 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x415c=['STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','INTEGER'];(function(_0xf35bc1,_0x510803){var _0xa6b162=function(_0x1e5cc8){while(--_0x1e5cc8){_0xf35bc1['push'](_0xf35bc1['shift']());}};_0xa6b162(++_0x510803);}(_0x415c,0x1ba));var _0xc415=function(_0x35b628,_0x4859d3){_0x35b628=_0x35b628-0x0;var _0x259a43=_0x415c[_0x35b628];return _0x259a43;};'use strict';var Sequelize=require(_0xc415('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0xc415('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc415('0x2')]},'scheduledat':{'type':Sequelize[_0xc415('0x3')]},'countbusyretry':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc415('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xc415('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc415('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xc415('0x3')]},'responsetime':{'type':Sequelize[_0xc415('0x3')]},'answertime':{'type':Sequelize[_0xc415('0x3')]},'droptime':{'type':Sequelize[_0xc415('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc415('0x2')]},'campaign':{'type':Sequelize[_0xc415('0x2')]},'campaigntype':{'type':Sequelize[_0xc415('0x2')]},'membername':{'type':Sequelize[_0xc415('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xc415('0x2')]},'secondDisposition':{'type':Sequelize[_0xc415('0x2')]},'thirdDisposition':{'type':Sequelize[_0xc415('0x2')]},'dispositionat':{'type':Sequelize[_0xc415('0x3')],'set':function(_0x157b00){var _0x27e459=this[_0xc415('0x4')](_0xc415('0x5'));if(_0x27e459&&_0x157b00){this[_0xc415('0x6')](_0xc415('0x7'),moment(_0x157b00)[_0xc415('0x8')](moment(_0x27e459),_0xc415('0x9')));}return this[_0xc415('0x6')](_0xc415('0xa'),_0x157b00);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xc415('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xc415('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xc415('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xc415('0x3')]},'callback':{'type':Sequelize[_0xc415('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc415('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xc415('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xc415('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1d08=['setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','exports','INTEGER','STRING','DATE','getDataValue','endtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d08,0xc9));var _0x81d0=function(_0x2e3e4d,_0x321b3f){_0x2e3e4d=_0x2e3e4d-0x0;var _0x1f4a0f=_0x1d08[_0x2e3e4d];return _0x1f4a0f;};'use strict';var Sequelize=require(_0x81d0('0x0'));var moment=require('moment');module[_0x81d0('0x1')]={'state':{'type':Sequelize[_0x81d0('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x81d0('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x81d0('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x81d0('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x81d0('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x81d0('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x81d0('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x81d0('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x81d0('0x4')]},'responsetime':{'type':Sequelize[_0x81d0('0x4')]},'answertime':{'type':Sequelize[_0x81d0('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x81d0('0x4')]},'ringtime':{'type':Sequelize[_0x81d0('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x81d0('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x81d0('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x81d0('0x3')]},'campaigntype':{'type':Sequelize[_0x81d0('0x3')]},'membername':{'type':Sequelize[_0x81d0('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x81d0('0x3')]},'secondDisposition':{'type':Sequelize[_0x81d0('0x3')]},'thirdDisposition':{'type':Sequelize[_0x81d0('0x3')]},'dispositionat':{'type':Sequelize[_0x81d0('0x4')],'set':function(_0x45782e){var _0xf1ace6=this[_0x81d0('0x5')](_0x81d0('0x6'));if(_0xf1ace6&&_0x45782e){this[_0x81d0('0x7')](_0x81d0('0x8'),moment(_0x45782e)[_0x81d0('0x9')](moment(_0xf1ace6),_0x81d0('0xa')));}return this['setDataValue'](_0x81d0('0xb'),_0x45782e);}},'amd':{'type':Sequelize[_0x81d0('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x81d0('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x81d0('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x81d0('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x81d0('0x4')]},'deleted':{'type':Sequelize[_0x81d0('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x81d0('0x4')]},'recallme':{'type':Sequelize[_0x81d0('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x81d0('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x81d0('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x81d0('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x81d0('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x81d0('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index c3de8c5..753e370 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1623=['reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','phone','scheduledAt','ListId','createdAt','select','ANY_VALUE(calleridnum)','field','NOW()','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','from','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','updatedAt','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','CmHopperFinal','findAll','rows','catch','show','params','length','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts'];(function(_0x4453db,_0x237c53){var _0x35f82e=function(_0x2233b9){while(--_0x2233b9){_0x4453db['push'](_0x4453db['shift']());}};_0x35f82e(++_0x237c53);}(_0x1623,0xab));var _0x3162=function(_0x20430c,_0xd8f747){_0x20430c=_0x20430c-0x0;var _0x1f5df4=_0x1623[_0x20430c];return _0x1f5df4;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['CmHopperFinal'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':!![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')]()[_0x3162('0x24')](respondWithResult(_0x28865c,null))['catch'](handleError(_0x28865c,null));};exports[_0x3162('0x23')]=function(_0x48cb8f,_0x4f1dde){if(_0x48cb8f[_0x3162('0x48')][_0x3162('0x49')]){delete _0x48cb8f[_0x3162('0x48')][_0x3162('0x49')];}return db['CmHopperFinal'][_0x3162('0x46')]({'where':{'uniqueid':_0x48cb8f['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x4f1dde,null))[_0x3162('0x24')](saveUpdates(_0x48cb8f['body'],null))[_0x3162('0x24')](respondWithResult(_0x4f1dde,null))['catch'](handleError(_0x4f1dde,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x13e7c4,_0x22c0a2,_0x160364){return db[_0x3162('0x3f')][_0x3162('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x13e7c4[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3162('0x4c')))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x50')))),_0x3162('0x51')],[db['sequelize']['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db['sequelize'][_0x3162('0x4e')](_0x3162('0x54')))),'dropContacts'],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),_0x3162('0x56')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x3162('0x57')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x58')))),_0x3162('0x59')]]})[_0x3162('0x24')](handleEntityNotFound(_0x22c0a2,null))[_0x3162('0x24')](respondWithResult(_0x22c0a2,null))[_0x3162('0x42')](handleError(_0x22c0a2,null));};exports[_0x3162('0x5a')]=function(_0x4b5729,_0x4a42ea,_0x520b1a){return db[_0x3162('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x4b5729[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5b')))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x50')))),'busyContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x54')))),_0x3162('0x5c')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),'abandonedContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5d')))),'reCallContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x58')))),'answeringMachine']]})[_0x3162('0x24')](handleEntityNotFound(_0x4a42ea,null))[_0x3162('0x24')](respondWithResult(_0x4a42ea,null))[_0x3162('0x42')](handleError(_0x4a42ea,null));};exports[_0x3162('0x5e')]=function(_0x8a75ca,_0x33c39d,_0xb3d824){return db['VoiceQueue']['find']({'where':{'id':_0x8a75ca['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x33c39d,null))[_0x3162('0x24')](function(_0x59b3f7){var _0x129005;if(_0x59b3f7){_0x129005=squel[_0x3162('0x5f')]()[_0x3162('0x60')](_0x3162('0x61'))['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'VoiceQueueId',_0x3162('0x65'),'updatedAt'],squel[_0x3162('0x66')]()['field'](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))[_0x3162('0x68')]('ANY_VALUE(ContactId)',_0x3162('0x6a'))[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x6c'),_0x3162('0x6d'))[_0x3162('0x68')](_0x3162('0x69'),'createdAt')[_0x3162('0x68')](_0x3162('0x69'),'updatedAt')['from'](_0x3162('0x6e'))[_0x3162('0x3c')]('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x8a75ca[_0x3162('0x48')][_0x3162('0x71')][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3162('0x66')]()[_0x3162('0x68')]('phone')[_0x3162('0x73')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id']['toString']()))[_0x3162('0x3c')](_0x3162('0x74'),squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x76'),_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where'](_0x3162('0x77')))[_0x3162('0x78')](_0x3162('0x6a')))[_0x3162('0x6f')]();return db[_0x3162('0x4a')][_0x3162('0x31')](_0x129005);}return[];})[_0x3162('0x24')](respondWithResult(_0x33c39d,null))[_0x3162('0x42')](handleError(_0x33c39d,null));};exports[_0x3162('0x79')]=function(_0x3f37fa,_0x1d242f,_0x190f91){return db['Campaign'][_0x3162('0x46')]({'where':{'id':_0x3f37fa[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x1d242f,null))['then'](function(_0x3d7bd1){var _0x5cdbb0;if(_0x3d7bd1){_0x5cdbb0=squel[_0x3162('0x5f')]()[_0x3162('0x60')]('cm_hopper')['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'CampaignId',_0x3162('0x65'),_0x3162('0x7a')],squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))['field'](_0x3162('0x7b'),'ContactId')[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x7c'),_0x3162('0x7d'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x65'))[_0x3162('0x68')]('NOW()',_0x3162('0x7a'))[_0x3162('0x73')](_0x3162('0x6e'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x3f37fa[_0x3162('0x48')]['state'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))[_0x3162('0x3c')](_0x3162('0x74'),squel['select']()[_0x3162('0x68')]('phone')[_0x3162('0x73')](_0x3162('0x61'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]()))['where'](_0x3162('0x74'),squel['select']()['field'](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where']('state\x20=\x204'))['group'](_0x3162('0x6a')))[_0x3162('0x6f')]();return db['sequelize']['query'](_0x5cdbb0);}return[];})[_0x3162('0x24')](respondWithResult(_0x1d242f,null))['catch'](handleError(_0x1d242f,null));};exports[_0x3162('0x7f')]=function(_0x35d9f0,_0x4408db,_0x377edb){return db['CmHopper'][_0x3162('0x80')]({'where':{'VoiceQueueId':_0x35d9f0[_0x3162('0x48')][_0x3162('0x6d')],'CampaignId':_0x35d9f0['body'][_0x3162('0x7d')],'ContactId':_0x35d9f0['body'][_0x3162('0x6a')]}})['then'](handleEntityNotFound(_0x4408db,null))[_0x3162('0x24')](function(_0x3d414f){if(_0x3d414f){return _0x3d414f;}return null;})[_0x3162('0x24')](respondWithResult(_0x4408db,null))['catch'](handleError(_0x4408db,null));};
\ No newline at end of file
+var _0x5d58=['calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','CmHopperFinal','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','merge','describe','catch','body','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)'];(function(_0x5e72dc,_0xa12f95){var _0x197a74=function(_0xaa9cc0){while(--_0xaa9cc0){_0x5e72dc['push'](_0x5e72dc['shift']());}};_0x197a74(++_0xa12f95);}(_0x5d58,0x187));var _0x85d5=function(_0xab24aa,_0x545ad2){_0xab24aa=_0xab24aa-0x0;var _0x37f2ca=_0x5d58[_0xab24aa];return _0x37f2ca;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x85d5('0x0'));var BPromise=require(_0x85d5('0x1'));var Mustache=require('mustache');var util=require(_0x85d5('0x2'));var path=require(_0x85d5('0x3'));var sox=require('sox');var csv=require(_0x85d5('0x4'));var ejs=require(_0x85d5('0x5'));var fs=require('fs');var fs_extra=require(_0x85d5('0x6'));var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x4'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var utils=require(_0x85d5('0xf'));var config=require(_0x85d5('0x10'));var licenseUtil=require(_0x85d5('0x11'));var db=require(_0x85d5('0x12'))['db'];function respondWithStatusCode(_0x31409d,_0x5897af){_0x5897af=_0x5897af||0xcc;return function(_0x4bbf2a){if(_0x4bbf2a){return _0x31409d['sendStatus'](_0x5897af);}return _0x31409d[_0x85d5('0x13')](_0x5897af)[_0x85d5('0x14')]();};}function respondWithResult(_0x339d4f,_0x1704f0){_0x1704f0=_0x1704f0||0xc8;return function(_0x18a20c){if(_0x18a20c){return _0x339d4f[_0x85d5('0x13')](_0x1704f0)[_0x85d5('0x15')](_0x18a20c);}};}function respondWithFilteredResult(_0x586382,_0x18e977){return function(_0x2d7c95){if(_0x2d7c95){var _0x1621ed=typeof _0x18e977[_0x85d5('0x16')]===_0x85d5('0x17')&&typeof _0x18e977[_0x85d5('0x18')]===_0x85d5('0x17');var _0x12bef9=_0x2d7c95[_0x85d5('0x19')];var _0x17acb0=_0x1621ed?0x0:_0x18e977[_0x85d5('0x16')];var _0x432bd6=_0x1621ed?_0x2d7c95[_0x85d5('0x19')]:_0x18e977[_0x85d5('0x16')]+_0x18e977[_0x85d5('0x18')];var _0x26981b;if(_0x432bd6>=_0x12bef9){_0x432bd6=_0x12bef9;_0x26981b=0xc8;}else{_0x26981b=0xce;}_0x586382[_0x85d5('0x13')](_0x26981b);return _0x586382[_0x85d5('0x1a')]('Content-Range',_0x17acb0+'-'+_0x432bd6+'/'+_0x12bef9)[_0x85d5('0x15')](_0x2d7c95);}return null;};}function patchUpdates(_0x133fa9){return function(_0x5f5755){try{jsonpatch[_0x85d5('0x1b')](_0x5f5755,_0x133fa9,!![]);}catch(_0x1264ca){return BPromise['reject'](_0x1264ca);}return _0x5f5755['save']();};}function saveUpdates(_0x347337,_0x5a1b9a){return function(_0x2f2bae){if(_0x2f2bae){return _0x2f2bae['update'](_0x347337)[_0x85d5('0x1c')](function(_0x1f8d27){return _0x1f8d27;});}return null;};}function removeEntity(_0x560b3a,_0x4e11c4){return function(_0x4da71b){if(_0x4da71b){return _0x4da71b['destroy']()[_0x85d5('0x1c')](function(){_0x560b3a[_0x85d5('0x13')](0xcc)[_0x85d5('0x14')]();});}};}function handleEntityNotFound(_0x466bbd,_0x12fea3){return function(_0xef2405){if(!_0xef2405){_0x466bbd['sendStatus'](0x194);}return _0xef2405;};}function handleError(_0x7e9a11,_0x4f8c66){_0x4f8c66=_0x4f8c66||0x1f4;return function(_0x1b3fae){logger[_0x85d5('0x1d')](_0x1b3fae[_0x85d5('0x1e')]);if(_0x1b3fae['name']){delete _0x1b3fae[_0x85d5('0x1f')];}_0x7e9a11[_0x85d5('0x13')](_0x4f8c66)[_0x85d5('0x20')](_0x1b3fae);};}exports[_0x85d5('0x21')]=function(_0x4605c5,_0x56031f){var _0x1cbef1={},_0x476c8b={},_0x330f8a={'count':0x0,'rows':[]};var _0x22a961=_[_0x85d5('0x22')](db['CmHopperFinal']['rawAttributes'],function(_0x2ce7a9){return{'name':_0x2ce7a9[_0x85d5('0x23')],'type':_0x2ce7a9[_0x85d5('0x24')][_0x85d5('0x25')]};});_0x476c8b[_0x85d5('0x26')]=_['map'](_0x22a961,_0x85d5('0x1f'));_0x476c8b[_0x85d5('0x27')]=_['keys'](_0x4605c5['query']);_0x476c8b[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x476c8b['model'],_0x476c8b[_0x85d5('0x27')]);_0x1cbef1['attributes']=_[_0x85d5('0x29')](_0x476c8b[_0x85d5('0x26')],qs['fields'](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x1cbef1[_0x85d5('0x2b')]=_0x1cbef1[_0x85d5('0x2b')]['length']?_0x1cbef1['attributes']:_0x476c8b[_0x85d5('0x26')];if(!_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2c')](_0x85d5('0x2d'))){_0x1cbef1[_0x85d5('0x18')]=qs[_0x85d5('0x18')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x18')]);_0x1cbef1[_0x85d5('0x16')]=qs['offset'](_0x4605c5['query'][_0x85d5('0x16')]);}_0x1cbef1[_0x85d5('0x2e')]=qs[_0x85d5('0x2f')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2f')]);_0x1cbef1[_0x85d5('0x30')]=qs[_0x85d5('0x28')](_[_0x85d5('0x31')](_0x4605c5['query'],_0x476c8b[_0x85d5('0x28')]),_0x22a961);if(_0x4605c5[_0x85d5('0x27')][_0x85d5('0x32')]){_0x1cbef1[_0x85d5('0x30')]=_['merge'](_0x1cbef1[_0x85d5('0x30')],{'$or':_[_0x85d5('0x22')](_0x22a961,function(_0x3282d3){if(_0x3282d3[_0x85d5('0x24')]!=='VIRTUAL'){var _0x34caed={};_0x34caed[_0x3282d3['name']]={'$like':'%'+_0x4605c5['query'][_0x85d5('0x32')]+'%'};return _0x34caed;}})});}_0x1cbef1=_['merge']({},_0x1cbef1,_0x4605c5[_0x85d5('0x33')]);var _0x5ddba7={'where':_0x1cbef1['where']};return db[_0x85d5('0x34')][_0x85d5('0x19')](_0x5ddba7)[_0x85d5('0x1c')](function(_0x1beffc){_0x330f8a[_0x85d5('0x19')]=_0x1beffc;if(_0x4605c5['query']['includeAll']){_0x1cbef1[_0x85d5('0x35')]=[{'all':!![]}];}return db[_0x85d5('0x34')][_0x85d5('0x36')](_0x1cbef1);})[_0x85d5('0x1c')](function(_0xdd8b3e){_0x330f8a[_0x85d5('0x37')]=_0xdd8b3e;return _0x330f8a;})['then'](respondWithFilteredResult(_0x56031f,_0x1cbef1))['catch'](handleError(_0x56031f,null));};exports[_0x85d5('0x38')]=function(_0x52c99b,_0xfbf466){var _0x18e94d={'raw':!![],'where':{'id':_0x52c99b[_0x85d5('0x39')]['id']}},_0x7dd430={};_0x7dd430[_0x85d5('0x26')]=_['keys'](db['CmHopperFinal'][_0x85d5('0x3a')]);_0x7dd430[_0x85d5('0x27')]=_[_0x85d5('0x3b')](_0x52c99b[_0x85d5('0x27')]);_0x7dd430[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],_0x7dd430[_0x85d5('0x27')]);_0x18e94d[_0x85d5('0x2b')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],qs[_0x85d5('0x2a')](_0x52c99b[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x18e94d[_0x85d5('0x2b')]=_0x18e94d[_0x85d5('0x2b')][_0x85d5('0x3c')]?_0x18e94d['attributes']:_0x7dd430['model'];if(_0x52c99b[_0x85d5('0x27')][_0x85d5('0x3d')]){_0x18e94d[_0x85d5('0x35')]=[{'all':!![]}];}_0x18e94d=_[_0x85d5('0x3e')]({},_0x18e94d,_0x52c99b[_0x85d5('0x33')]);return db[_0x85d5('0x34')]['find'](_0x18e94d)[_0x85d5('0x1c')](handleEntityNotFound(_0xfbf466,null))['then'](respondWithResult(_0xfbf466,null))['catch'](handleError(_0xfbf466,null));};exports[_0x85d5('0x3f')]=function(_0x13ab32,_0x12a03){return db[_0x85d5('0x34')][_0x85d5('0x3f')]()['then'](respondWithResult(_0x12a03,null))[_0x85d5('0x40')](handleError(_0x12a03,null));};exports['update']=function(_0x1f2ef9,_0xd8db57){if(_0x1f2ef9[_0x85d5('0x41')]['uniqueid']){delete _0x1f2ef9['body']['uniqueid'];}return db[_0x85d5('0x34')][_0x85d5('0x42')]({'where':{'uniqueid':_0x1f2ef9[_0x85d5('0x39')]['id']}})['then'](handleEntityNotFound(_0xd8db57,null))['then'](saveUpdates(_0x1f2ef9[_0x85d5('0x41')],null))[_0x85d5('0x1c')](respondWithResult(_0xd8db57,null))[_0x85d5('0x40')](handleError(_0xd8db57,null));};exports[_0x85d5('0x43')]=function(_0x4b2dce,_0x3f69ea,_0x29442a){return db[_0x85d5('0x34')][_0x85d5('0x36')]({'raw':![],'where':{'VoiceQueueId':_0x4b2dce[_0x85d5('0x39')]['id']},'attributes':[[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),_0x85d5('0x48')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x85d5('0x4e')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4f')))),_0x85d5('0x50')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x2022,\x201,\x20null'))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x52')))),_0x85d5('0x53')]]})['then'](handleEntityNotFound(_0x3f69ea,null))[_0x85d5('0x1c')](respondWithResult(_0x3f69ea,null))[_0x85d5('0x40')](handleError(_0x3f69ea,null));};exports[_0x85d5('0x54')]=function(_0x561bde,_0x34aa42,_0x1c3e2c){return db['CmHopperFinal'][_0x85d5('0x36')]({'raw':![],'where':{'CampaignId':_0x561bde['params']['id']},'attributes':[[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),'noSuchContacts'],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85d5('0x44')]['literal'](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal'](_0x85d5('0x55')))),'dropContacts'],[db['sequelize']['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x85d5('0x50')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db['sequelize']['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x56')))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x85d5('0x53')]]})[_0x85d5('0x1c')](handleEntityNotFound(_0x34aa42,null))[_0x85d5('0x1c')](respondWithResult(_0x34aa42,null))['catch'](handleError(_0x34aa42,null));};exports[_0x85d5('0x57')]=function(_0x1fdefb,_0x496586,_0x2dbd18){return db[_0x85d5('0x58')][_0x85d5('0x42')]({'where':{'id':_0x1fdefb[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x496586,null))['then'](function(_0x35ba15){var _0x1b96eb;if(_0x35ba15){_0x1b96eb=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')](_0x85d5('0x5b'))['fromQuery']([_0x85d5('0x5c'),_0x85d5('0x5d'),_0x85d5('0x5e'),_0x85d5('0x5f'),_0x85d5('0x60'),_0x85d5('0x61'),_0x85d5('0x62')],squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x65'),'phone')[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x5d'))[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))['field'](_0x85d5('0x68'),'ListId')['field'](_0x85d5('0x69'),_0x85d5('0x60'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x61'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x62'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x1fdefb[_0x85d5('0x41')][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6f'))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('phone')['from'](_0x85d5('0x5b'))['where'](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x71'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb['params']['id'][_0x85d5('0x6c')]())['where'](_0x85d5('0x72')))[_0x85d5('0x73')](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db['sequelize'][_0x85d5('0x27')](_0x1b96eb);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x496586,null))['catch'](handleError(_0x496586,null));};exports[_0x85d5('0x74')]=function(_0x14e4e8,_0x57f26b,_0x45b1e2){return db[_0x85d5('0x75')][_0x85d5('0x42')]({'where':{'id':_0x14e4e8['params']['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x57f26b,null))[_0x85d5('0x1c')](function(_0x2dacf7){var _0x387a3b;if(_0x2dacf7){_0x387a3b=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')]('cm_hopper')[_0x85d5('0x76')]([_0x85d5('0x5c'),'scheduledAt',_0x85d5('0x5e'),'ListId',_0x85d5('0x77'),_0x85d5('0x61'),_0x85d5('0x62')],squel['select']()[_0x85d5('0x64')](_0x85d5('0x65'),_0x85d5('0x5c'))[_0x85d5('0x64')](_0x85d5('0x66'),'scheduledAt')[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))[_0x85d5('0x64')]('ANY_VALUE(ListId)',_0x85d5('0x5f'))[_0x85d5('0x64')](_0x85d5('0x78'),'CampaignId')[_0x85d5('0x64')]('NOW()',_0x85d5('0x61'))[_0x85d5('0x64')]('NOW()','updatedAt')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x14e4e8['body'][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x85d5('0x30')](_0x85d5('0x70'),squel['select']()[_0x85d5('0x64')](_0x85d5('0x5c'))[_0x85d5('0x6a')](_0x85d5('0x5b'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('calleridnum')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']())['where'](_0x85d5('0x72')))['group'](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db[_0x85d5('0x44')][_0x85d5('0x27')](_0x387a3b);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x57f26b,null))[_0x85d5('0x40')](handleError(_0x57f26b,null));};exports[_0x85d5('0x7b')]=function(_0x48553d,_0xedb32d,_0x5366bc){return db[_0x85d5('0x7c')][_0x85d5('0x7d')]({'where':{'VoiceQueueId':_0x48553d[_0x85d5('0x41')]['VoiceQueueId'],'CampaignId':_0x48553d[_0x85d5('0x41')][_0x85d5('0x77')],'ContactId':_0x48553d[_0x85d5('0x41')]['ContactId']}})['then'](handleEntityNotFound(_0xedb32d,null))[_0x85d5('0x1c')](function(_0x428fd4){if(_0x428fd4){return _0x428fd4;}return null;})['then'](respondWithResult(_0xedb32d,null))[_0x85d5('0x40')](handleError(_0xedb32d,null));};
\ No newline at end of file
index 873e064..0dd1584 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x659b=['CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','moment','bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','exports','define'];(function(_0x3e4006,_0x6690ec){var _0x2553c2=function(_0x1d4260){while(--_0x1d4260){_0x3e4006['push'](_0x3e4006['shift']());}};_0x2553c2(++_0x6690ec);}(_0x659b,0x149));var _0xb659=function(_0x433c4f,_0x2e2967){_0x433c4f=_0x433c4f-0x0;var _0x37c3d3=_0x659b[_0x433c4f];return _0x37c3d3;};'use strict';var _=require(_0xb659('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb659('0x1'));var BPromise=require(_0xb659('0x2'));var rp=require(_0xb659('0x3'));var fs=require('fs');var path=require(_0xb659('0x4'));var rimraf=require(_0xb659('0x5'));var config=require('../../config/environment');var attributes=require(_0xb659('0x6'));module[_0xb659('0x7')]=function(_0x184565,_0x206984){return _0x184565[_0xb659('0x8')](_0xb659('0x9'),attributes,{'tableName':_0xb659('0xa'),'paranoid':![],'indexes':[{'name':_0xb659('0xb'),'fields':[_0xb659('0xb')]},{'name':_0xb659('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb40d=['./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xb40d,0x9c));var _0xdb40=function(_0xea300d,_0x42f0ee){_0xea300d=_0xea300d-0x0;var _0x1016ec=_0xb40d[_0xea300d];return _0x1016ec;};'use strict';var _=require(_0xdb40('0x0'));var util=require(_0xdb40('0x1'));var logger=require(_0xdb40('0x2'))(_0xdb40('0x3'));var moment=require(_0xdb40('0x4'));var BPromise=require(_0xdb40('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb40('0x6'));var rimraf=require(_0xdb40('0x7'));var config=require(_0xdb40('0x8'));var attributes=require(_0xdb40('0x9'));module['exports']=function(_0x3280e1,_0xbf15b5){return _0x3280e1[_0xdb40('0xa')](_0xdb40('0xb'),attributes,{'tableName':_0xdb40('0xc'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xdb40('0xd')]},{'name':_0xdb40('0xe'),'fields':[_0xdb40('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index fabcdeb..d17e313 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(_0x488df1,_0x1bb1e3){var _0x467127=function(_0x1e3611){while(--_0x1e3611){_0x488df1['push'](_0x488df1['shift']());}};_0x467127(++_0x1bb1e3);}(_0xb10b,0x12a));var _0xbb10=function(_0xe1770a,_0x4fc5d6){_0xe1770a=_0xe1770a-0x0;var _0x3e6274=_0xb10b[_0xe1770a];return _0x3e6274;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x32e66f,_0x5b7777){var _0x13ef18=function(_0x231001){while(--_0x231001){_0x32e66f['push'](_0x32e66f['shift']());}};_0x13ef18(++_0x5b7777);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d92d0,_0x512de7){_0x2d92d0=_0x2d92d0-0x0;var _0x5752e4=_0xb10b[_0x2d92d0];return _0x5752e4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
index 01cf460..bb13cc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbed=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','util','path','connect-timeout','Router','get','isAuthenticated','index','/describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0xdbed,0xca));var _0xddbe=function(_0x654c61,_0x3db020){_0x654c61=_0x654c61-0x0;var _0x2b63b5=_0xdbed[_0x654c61];return _0x2b63b5;};'use strict';var multer=require(_0xddbe('0x0'));var util=require(_0xddbe('0x1'));var path=require(_0xddbe('0x2'));var timeout=require(_0xddbe('0x3'));var express=require('express');var router=express[_0xddbe('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('./cmHopperFinal.controller');router[_0xddbe('0x5')]('/',auth[_0xddbe('0x6')](),controller[_0xddbe('0x7')]);router[_0xddbe('0x5')](_0xddbe('0x8'),auth[_0xddbe('0x6')](),controller['describe']);router[_0xddbe('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xddbe('0x9')]);router[_0xddbe('0x5')](_0xddbe('0xa'),auth[_0xddbe('0x6')](),controller[_0xddbe('0xb')]);router['get']('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller[_0xddbe('0xc')]);router[_0xddbe('0xd')](_0xddbe('0xe'),auth['isAuthenticated'](),controller[_0xddbe('0xf')]);router[_0xddbe('0xd')](_0xddbe('0x10'),auth[_0xddbe('0x6')](),controller[_0xddbe('0x11')]);router[_0xddbe('0xd')](_0xddbe('0x12'),auth[_0xddbe('0x6')](),controller[_0xddbe('0x13')]);router[_0xddbe('0x14')](_0xddbe('0x15'),auth['isAuthenticated'](),controller[_0xddbe('0x16')]);module[_0xddbe('0x17')]=router;
\ No newline at end of file
+var _0x5081=['/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x12a927,_0x4770e9){var _0x13db9b=function(_0x14f7a9){while(--_0x14f7a9){_0x12a927['push'](_0x12a927['shift']());}};_0x13db9b(++_0x4770e9);}(_0x5081,0x1a0));var _0x1508=function(_0x3df498,_0x41cbb6){_0x3df498=_0x3df498-0x0;var _0x185eab=_0x5081[_0x3df498];return _0x185eab;};'use strict';var multer=require(_0x1508('0x0'));var util=require(_0x1508('0x1'));var path=require(_0x1508('0x2'));var timeout=require(_0x1508('0x3'));var express=require(_0x1508('0x4'));var router=express[_0x1508('0x5')]();var fs_extra=require(_0x1508('0x6'));var auth=require(_0x1508('0x7'));var interaction=require(_0x1508('0x8'));var config=require(_0x1508('0x9'));var controller=require(_0x1508('0xa'));router[_0x1508('0xb')]('/',auth['isAuthenticated'](),controller[_0x1508('0xc')]);router[_0x1508('0xb')](_0x1508('0xd'),auth[_0x1508('0xe')](),controller[_0x1508('0xf')]);router['get'](_0x1508('0x10'),auth[_0x1508('0xe')](),controller[_0x1508('0x11')]);router['get'](_0x1508('0x12'),auth[_0x1508('0xe')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x1508('0xb')](_0x1508('0x13'),auth[_0x1508('0xe')](),controller[_0x1508('0x14')]);router[_0x1508('0x15')](_0x1508('0x16'),auth[_0x1508('0xe')](),controller[_0x1508('0x17')]);router[_0x1508('0x15')](_0x1508('0x18'),auth['isAuthenticated'](),controller[_0x1508('0x19')]);router[_0x1508('0x15')](_0x1508('0x1a'),auth[_0x1508('0xe')](),controller[_0x1508('0x1b')]);router[_0x1508('0x1c')](_0x1508('0x10'),auth[_0x1508('0xe')](),controller[_0x1508('0x1d')]);module[_0x1508('0x1e')]=router;
\ No newline at end of file
index 18e6e6a..b20e0f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2914=['sequelize','exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x339e74,_0x514196){var _0x59c2fd=function(_0x37a84d){while(--_0x37a84d){_0x339e74['push'](_0x339e74['shift']());}};_0x59c2fd(++_0x514196);}(_0x2914,0x150));var _0x4291=function(_0x35b9b6,_0x23268f){_0x35b9b6=_0x35b9b6-0x0;var _0x376401=_0x2914[_0x35b9b6];return _0x376401;};'use strict';var Sequelize=require(_0x4291('0x0'));module[_0x4291('0x1')]={'state':{'type':Sequelize[_0x4291('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x4291('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4291('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x4291('0x4')]},'originatecalleridname':{'type':Sequelize[_0x4291('0x4')]},'calleridnum':{'type':Sequelize[_0x4291('0x4')]},'calleridname':{'type':Sequelize[_0x4291('0x4')]},'starttime':{'type':Sequelize[_0x4291('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x4291('0x3')]},'droptime':{'type':Sequelize[_0x4291('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x4291('0x4')]},'campaigntype':{'type':Sequelize[_0x4291('0x4')]},'membername':{'type':Sequelize[_0x4291('0x4')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x4291('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4291('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4291('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4291('0x3')]},'recallme':{'type':Sequelize[_0x4291('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x4291('0x3')]},'edited':{'type':Sequelize[_0x4291('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5e2a=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x5e2a,0xae));var _0xa5e2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e2a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa5e2('0x0'));module[_0xa5e2('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xa5e2('0x2')]},'scheduledat':{'type':Sequelize[_0xa5e2('0x3')]},'countbusyretry':{'type':Sequelize[_0xa5e2('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa5e2('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa5e2('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xa5e2('0x2')]},'calleridnum':{'type':Sequelize[_0xa5e2('0x2')]},'calleridname':{'type':Sequelize[_0xa5e2('0x2')]},'starttime':{'type':Sequelize[_0xa5e2('0x3')]},'responsetime':{'type':Sequelize[_0xa5e2('0x3')]},'answertime':{'type':Sequelize[_0xa5e2('0x3')]},'droptime':{'type':Sequelize[_0xa5e2('0x3')]},'endtime':{'type':Sequelize[_0xa5e2('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa5e2('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa5e2('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa5e2('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa5e2('0x2')]},'campaign':{'type':Sequelize[_0xa5e2('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xa5e2('0x2')]},'amd':{'type':Sequelize[_0xa5e2('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa5e2('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa5e2('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa5e2('0x3')]},'recallme':{'type':Sequelize[_0xa5e2('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xa5e2('0x3')]},'edited':{'type':Sequelize[_0xa5e2('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa5e2('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa5e2('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index fcd8c0d..53ff66d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5763=['fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','end','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','rows','catch','show','params','includeAll','include','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0xd80294,_0x47dd7d){var _0x58edc2=function(_0xbc2ac6){while(--_0xbc2ac6){_0xd80294['push'](_0xd80294['shift']());}};_0x58edc2(++_0x47dd7d);}(_0x5763,0x121));var _0x3576=function(_0x2c69a1,_0x30b54b){_0x2c69a1=_0x2c69a1-0x0;var _0x50e57d=_0x5763[_0x2c69a1];return _0x50e57d;};'use strict';var emlformat=require(_0x3576('0x0'));var rimraf=require(_0x3576('0x1'));var zipdir=require(_0x3576('0x2'));var jsonpatch=require(_0x3576('0x3'));var rp=require(_0x3576('0x4'));var moment=require(_0x3576('0x5'));var BPromise=require(_0x3576('0x6'));var Mustache=require(_0x3576('0x7'));var util=require(_0x3576('0x8'));var path=require(_0x3576('0x9'));var sox=require('sox');var csv=require(_0x3576('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3576('0xb'));var _=require(_0x3576('0xc'));var squel=require('squel');var crypto=require(_0x3576('0xd'));var jsforce=require(_0x3576('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3576('0xa'));var querystring=require(_0x3576('0xf'));var Papa=require(_0x3576('0x10'));var Redis=require(_0x3576('0x11'));var authService=require(_0x3576('0x12'));var qs=require(_0x3576('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3576('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3576('0x15'));var config=require(_0x3576('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3576('0x17'))['db'];function respondWithStatusCode(_0xa33ea7,_0x15316b){_0x15316b=_0x15316b||0xcc;return function(_0x5c9fad){if(_0x5c9fad){return _0xa33ea7['sendStatus'](_0x15316b);}return _0xa33ea7['status'](_0x15316b)[_0x3576('0x18')]();};}function respondWithResult(_0x53c594,_0x231342){_0x231342=_0x231342||0xc8;return function(_0x20fafc){if(_0x20fafc){return _0x53c594[_0x3576('0x19')](_0x231342)['json'](_0x20fafc);}};}function respondWithFilteredResult(_0xa0bbdf,_0x253871){return function(_0x305654){if(_0x305654){var _0x2b9eff=typeof _0x253871['offset']===_0x3576('0x1a')&&typeof _0x253871[_0x3576('0x1b')]===_0x3576('0x1a');var _0x5af413=_0x305654['count'];var _0x13e933=_0x2b9eff?0x0:_0x253871[_0x3576('0x1c')];var _0x4278f0=_0x2b9eff?_0x305654[_0x3576('0x1d')]:_0x253871['offset']+_0x253871['limit'];var _0xb5eeb9;if(_0x4278f0>=_0x5af413){_0x4278f0=_0x5af413;_0xb5eeb9=0xc8;}else{_0xb5eeb9=0xce;}_0xa0bbdf[_0x3576('0x19')](_0xb5eeb9);return _0xa0bbdf[_0x3576('0x1e')](_0x3576('0x1f'),_0x13e933+'-'+_0x4278f0+'/'+_0x5af413)[_0x3576('0x20')](_0x305654);}return null;};}function patchUpdates(_0x140705){return function(_0x2a0cac){try{jsonpatch[_0x3576('0x21')](_0x2a0cac,_0x140705,!![]);}catch(_0x283951){return BPromise[_0x3576('0x22')](_0x283951);}return _0x2a0cac[_0x3576('0x23')]();};}function saveUpdates(_0x499bdd,_0x15105b){return function(_0x7d9f84){if(_0x7d9f84){return _0x7d9f84[_0x3576('0x24')](_0x499bdd)[_0x3576('0x25')](function(_0x2cca00){return _0x2cca00;});}return null;};}function removeEntity(_0x441da3,_0x97aa13){return function(_0x738060){if(_0x738060){return _0x738060[_0x3576('0x26')]()[_0x3576('0x25')](function(){_0x441da3[_0x3576('0x19')](0xcc)[_0x3576('0x18')]();});}};}function handleEntityNotFound(_0x588e29,_0x2fa307){return function(_0x4d2cd2){if(!_0x4d2cd2){_0x588e29['sendStatus'](0x194);}return _0x4d2cd2;};}function handleError(_0x3085b1,_0x490baf){_0x490baf=_0x490baf||0x1f4;return function(_0x2f9b82){logger['error'](_0x2f9b82[_0x3576('0x27')]);if(_0x2f9b82[_0x3576('0x28')]){delete _0x2f9b82[_0x3576('0x28')];}_0x3085b1['status'](_0x490baf)[_0x3576('0x29')](_0x2f9b82);};}exports[_0x3576('0x2a')]=function(_0xc2e933,_0x35f087){var _0xc1570c={},_0xc1d168={},_0x9ea747={'count':0x0,'rows':[]};var _0x174dea=_[_0x3576('0x2b')](db[_0x3576('0x2c')][_0x3576('0x2d')],function(_0x5a54e5){return{'name':_0x5a54e5[_0x3576('0x2e')],'type':_0x5a54e5[_0x3576('0x2f')]['key']};});_0xc1d168['model']=_[_0x3576('0x2b')](_0x174dea,_0x3576('0x28'));_0xc1d168[_0x3576('0x30')]=_[_0x3576('0x31')](_0xc2e933['query']);_0xc1d168[_0x3576('0x32')]=_[_0x3576('0x33')](_0xc1d168['model'],_0xc1d168[_0x3576('0x30')]);_0xc1570c[_0x3576('0x34')]=_['intersection'](_0xc1d168[_0x3576('0x35')],qs[_0x3576('0x36')](_0xc2e933[_0x3576('0x30')][_0x3576('0x36')]));_0xc1570c['attributes']=_0xc1570c[_0x3576('0x34')][_0x3576('0x37')]?_0xc1570c[_0x3576('0x34')]:_0xc1d168[_0x3576('0x35')];if(!_0xc2e933[_0x3576('0x30')]['hasOwnProperty'](_0x3576('0x38'))){_0xc1570c[_0x3576('0x1b')]=qs[_0x3576('0x1b')](_0xc2e933[_0x3576('0x30')][_0x3576('0x1b')]);_0xc1570c[_0x3576('0x1c')]=qs['offset'](_0xc2e933[_0x3576('0x30')][_0x3576('0x1c')]);}_0xc1570c[_0x3576('0x39')]=qs[_0x3576('0x3a')](_0xc2e933['query']['sort']);_0xc1570c[_0x3576('0x3b')]=qs[_0x3576('0x32')](_['pick'](_0xc2e933[_0x3576('0x30')],_0xc1d168['filters']),_0x174dea);if(_0xc2e933['query'][_0x3576('0x3c')]){_0xc1570c[_0x3576('0x3b')]=_[_0x3576('0x3d')](_0xc1570c[_0x3576('0x3b')],{'$or':_['map'](_0x174dea,function(_0x532b3d){if(_0x532b3d[_0x3576('0x2f')]!==_0x3576('0x3e')){var _0x445434={};_0x445434[_0x532b3d[_0x3576('0x28')]]={'$like':'%'+_0xc2e933[_0x3576('0x30')][_0x3576('0x3c')]+'%'};return _0x445434;}})});}_0xc1570c=_[_0x3576('0x3d')]({},_0xc1570c,_0xc2e933[_0x3576('0x3f')]);var _0x40e81f={'where':_0xc1570c[_0x3576('0x3b')]};return db[_0x3576('0x2c')][_0x3576('0x1d')](_0x40e81f)[_0x3576('0x25')](function(_0x35d3fa){_0x9ea747['count']=_0x35d3fa;if(_0xc2e933[_0x3576('0x30')]['includeAll']){_0xc1570c['include']=[{'all':!![]}];}return db[_0x3576('0x2c')]['findAll'](_0xc1570c);})[_0x3576('0x25')](function(_0x4c1fc8){_0x9ea747[_0x3576('0x40')]=_0x4c1fc8;return _0x9ea747;})[_0x3576('0x25')](respondWithFilteredResult(_0x35f087,_0xc1570c))[_0x3576('0x41')](handleError(_0x35f087,null));};exports[_0x3576('0x42')]=function(_0x8468b4,_0x5a6c43){var _0x56d29f={'raw':!![],'where':{'id':_0x8468b4[_0x3576('0x43')]['id']}},_0x12e89e={};_0x12e89e[_0x3576('0x35')]=_[_0x3576('0x31')](db[_0x3576('0x2c')]['rawAttributes']);_0x12e89e[_0x3576('0x30')]=_['keys'](_0x8468b4['query']);_0x12e89e[_0x3576('0x32')]=_[_0x3576('0x33')](_0x12e89e[_0x3576('0x35')],_0x12e89e['query']);_0x56d29f[_0x3576('0x34')]=_[_0x3576('0x33')](_0x12e89e[_0x3576('0x35')],qs[_0x3576('0x36')](_0x8468b4[_0x3576('0x30')][_0x3576('0x36')]));_0x56d29f[_0x3576('0x34')]=_0x56d29f[_0x3576('0x34')][_0x3576('0x37')]?_0x56d29f[_0x3576('0x34')]:_0x12e89e['model'];if(_0x8468b4[_0x3576('0x30')][_0x3576('0x44')]){_0x56d29f[_0x3576('0x45')]=[{'all':!![]}];}_0x56d29f=_[_0x3576('0x3d')]({},_0x56d29f,_0x8468b4[_0x3576('0x3f')]);return db[_0x3576('0x2c')][_0x3576('0x46')](_0x56d29f)['then'](handleEntityNotFound(_0x5a6c43,null))[_0x3576('0x25')](respondWithResult(_0x5a6c43,null))['catch'](handleError(_0x5a6c43,null));};exports['create']=function(_0x3368f5,_0x29e775){return db['CmHopperHistory'][_0x3576('0x47')](_0x3368f5[_0x3576('0x48')],{})[_0x3576('0x25')](respondWithResult(_0x29e775,0xc9))[_0x3576('0x41')](handleError(_0x29e775,null));};exports[_0x3576('0x49')]=function(_0x55a23a,_0x4c55df){return db['CmHopperHistory'][_0x3576('0x49')]()[_0x3576('0x25')](respondWithResult(_0x4c55df,null))[_0x3576('0x41')](handleError(_0x4c55df,null));};exports[_0x3576('0x24')]=function(_0x2bb3a6,_0x388e25){if(_0x2bb3a6[_0x3576('0x48')][_0x3576('0x4a')]){delete _0x2bb3a6[_0x3576('0x48')][_0x3576('0x4a')];}return db['CmHopperHistory'][_0x3576('0x46')]({'where':{'uniqueid':_0x2bb3a6[_0x3576('0x43')]['id']}})[_0x3576('0x25')](handleEntityNotFound(_0x388e25,null))['then'](saveUpdates(_0x2bb3a6['body'],null))[_0x3576('0x25')](respondWithResult(_0x388e25,null))[_0x3576('0x41')](handleError(_0x388e25,null));};
\ No newline at end of file
+var _0xda86=['pick','filter','merge','where','VIRTUAL','options','includeAll','rows','catch','show','keys','length','include','find','create','body','describe','uniqueid','params','eml-format','rimraf','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','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','model','query','intersection','attributes','fields','hasOwnProperty','sort','filters'];(function(_0x4f4ca1,_0x425e96){var _0x227dc8=function(_0x8c8779){while(--_0x8c8779){_0x4f4ca1['push'](_0x4f4ca1['shift']());}};_0x227dc8(++_0x425e96);}(_0xda86,0x13b));var _0x6da8=function(_0x1721e3,_0x34cdcb){_0x1721e3=_0x1721e3-0x0;var _0x3a4766=_0xda86[_0x1721e3];return _0x3a4766;};'use strict';var emlformat=require(_0x6da8('0x0'));var rimraf=require(_0x6da8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6da8('0x2'));var rp=require(_0x6da8('0x3'));var moment=require(_0x6da8('0x4'));var BPromise=require(_0x6da8('0x5'));var Mustache=require(_0x6da8('0x6'));var util=require(_0x6da8('0x7'));var path=require(_0x6da8('0x8'));var sox=require(_0x6da8('0x9'));var csv=require(_0x6da8('0xa'));var ejs=require(_0x6da8('0xb'));var fs=require('fs');var fs_extra=require(_0x6da8('0xc'));var _=require('lodash');var squel=require(_0x6da8('0xd'));var crypto=require(_0x6da8('0xe'));var jsforce=require(_0x6da8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6da8('0xa'));var querystring=require(_0x6da8('0x10'));var Papa=require(_0x6da8('0x11'));var Redis=require(_0x6da8('0x12'));var authService=require(_0x6da8('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6da8('0x14'));var utils=require(_0x6da8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6da8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x357adc,_0x353eaf){_0x353eaf=_0x353eaf||0xcc;return function(_0x28484e){if(_0x28484e){return _0x357adc[_0x6da8('0x17')](_0x353eaf);}return _0x357adc['status'](_0x353eaf)['end']();};}function respondWithResult(_0x2907a1,_0x415d50){_0x415d50=_0x415d50||0xc8;return function(_0x46f354){if(_0x46f354){return _0x2907a1[_0x6da8('0x18')](_0x415d50)['json'](_0x46f354);}};}function respondWithFilteredResult(_0x959fb9,_0x184237){return function(_0x578053){if(_0x578053){var _0x244375=typeof _0x184237[_0x6da8('0x19')]===_0x6da8('0x1a')&&typeof _0x184237[_0x6da8('0x1b')]===_0x6da8('0x1a');var _0x30ac27=_0x578053[_0x6da8('0x1c')];var _0x126af1=_0x244375?0x0:_0x184237[_0x6da8('0x19')];var _0x26c387=_0x244375?_0x578053['count']:_0x184237['offset']+_0x184237['limit'];var _0x2e7c76;if(_0x26c387>=_0x30ac27){_0x26c387=_0x30ac27;_0x2e7c76=0xc8;}else{_0x2e7c76=0xce;}_0x959fb9[_0x6da8('0x18')](_0x2e7c76);return _0x959fb9['set'](_0x6da8('0x1d'),_0x126af1+'-'+_0x26c387+'/'+_0x30ac27)[_0x6da8('0x1e')](_0x578053);}return null;};}function patchUpdates(_0x316022){return function(_0x1b8010){try{jsonpatch[_0x6da8('0x1f')](_0x1b8010,_0x316022,!![]);}catch(_0x33af37){return BPromise[_0x6da8('0x20')](_0x33af37);}return _0x1b8010[_0x6da8('0x21')]();};}function saveUpdates(_0x34490b,_0x513659){return function(_0x126534){if(_0x126534){return _0x126534[_0x6da8('0x22')](_0x34490b)['then'](function(_0x4d939b){return _0x4d939b;});}return null;};}function removeEntity(_0x58d83c,_0x5e3af7){return function(_0x1cb41a){if(_0x1cb41a){return _0x1cb41a[_0x6da8('0x23')]()[_0x6da8('0x24')](function(){_0x58d83c[_0x6da8('0x18')](0xcc)[_0x6da8('0x25')]();});}};}function handleEntityNotFound(_0x33db89,_0x1355f0){return function(_0x20ab7f){if(!_0x20ab7f){_0x33db89[_0x6da8('0x17')](0x194);}return _0x20ab7f;};}function handleError(_0x58e88b,_0x3921b3){_0x3921b3=_0x3921b3||0x1f4;return function(_0x1f12ee){logger[_0x6da8('0x26')](_0x1f12ee[_0x6da8('0x27')]);if(_0x1f12ee[_0x6da8('0x28')]){delete _0x1f12ee['name'];}_0x58e88b[_0x6da8('0x18')](_0x3921b3)[_0x6da8('0x29')](_0x1f12ee);};}exports[_0x6da8('0x2a')]=function(_0x51c695,_0x4e1e4a){var _0x3c50df={},_0x57062c={},_0x1a0f94={'count':0x0,'rows':[]};var _0x548aee=_[_0x6da8('0x2b')](db[_0x6da8('0x2c')][_0x6da8('0x2d')],function(_0x4840a1){return{'name':_0x4840a1[_0x6da8('0x2e')],'type':_0x4840a1['type']['key']};});_0x57062c[_0x6da8('0x2f')]=_[_0x6da8('0x2b')](_0x548aee,_0x6da8('0x28'));_0x57062c[_0x6da8('0x30')]=_['keys'](_0x51c695['query']);_0x57062c['filters']=_[_0x6da8('0x31')](_0x57062c[_0x6da8('0x2f')],_0x57062c[_0x6da8('0x30')]);_0x3c50df[_0x6da8('0x32')]=_[_0x6da8('0x31')](_0x57062c[_0x6da8('0x2f')],qs[_0x6da8('0x33')](_0x51c695[_0x6da8('0x30')][_0x6da8('0x33')]));_0x3c50df['attributes']=_0x3c50df[_0x6da8('0x32')]['length']?_0x3c50df[_0x6da8('0x32')]:_0x57062c[_0x6da8('0x2f')];if(!_0x51c695[_0x6da8('0x30')][_0x6da8('0x34')]('nolimit')){_0x3c50df[_0x6da8('0x1b')]=qs[_0x6da8('0x1b')](_0x51c695[_0x6da8('0x30')]['limit']);_0x3c50df[_0x6da8('0x19')]=qs[_0x6da8('0x19')](_0x51c695[_0x6da8('0x30')][_0x6da8('0x19')]);}_0x3c50df['order']=qs[_0x6da8('0x35')](_0x51c695[_0x6da8('0x30')][_0x6da8('0x35')]);_0x3c50df['where']=qs[_0x6da8('0x36')](_[_0x6da8('0x37')](_0x51c695[_0x6da8('0x30')],_0x57062c[_0x6da8('0x36')]),_0x548aee);if(_0x51c695[_0x6da8('0x30')][_0x6da8('0x38')]){_0x3c50df['where']=_[_0x6da8('0x39')](_0x3c50df[_0x6da8('0x3a')],{'$or':_[_0x6da8('0x2b')](_0x548aee,function(_0x45b9a9){if(_0x45b9a9['type']!==_0x6da8('0x3b')){var _0x570a0a={};_0x570a0a[_0x45b9a9[_0x6da8('0x28')]]={'$like':'%'+_0x51c695[_0x6da8('0x30')][_0x6da8('0x38')]+'%'};return _0x570a0a;}})});}_0x3c50df=_[_0x6da8('0x39')]({},_0x3c50df,_0x51c695[_0x6da8('0x3c')]);var _0x336aaa={'where':_0x3c50df[_0x6da8('0x3a')]};return db[_0x6da8('0x2c')][_0x6da8('0x1c')](_0x336aaa)[_0x6da8('0x24')](function(_0x4c6f63){_0x1a0f94[_0x6da8('0x1c')]=_0x4c6f63;if(_0x51c695[_0x6da8('0x30')][_0x6da8('0x3d')]){_0x3c50df['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3c50df);})[_0x6da8('0x24')](function(_0x2ff55e){_0x1a0f94[_0x6da8('0x3e')]=_0x2ff55e;return _0x1a0f94;})[_0x6da8('0x24')](respondWithFilteredResult(_0x4e1e4a,_0x3c50df))[_0x6da8('0x3f')](handleError(_0x4e1e4a,null));};exports[_0x6da8('0x40')]=function(_0x4531f8,_0x465b50){var _0x42cf0d={'raw':!![],'where':{'id':_0x4531f8['params']['id']}},_0x1cfaad={};_0x1cfaad['model']=_[_0x6da8('0x41')](db[_0x6da8('0x2c')]['rawAttributes']);_0x1cfaad['query']=_[_0x6da8('0x41')](_0x4531f8[_0x6da8('0x30')]);_0x1cfaad[_0x6da8('0x36')]=_[_0x6da8('0x31')](_0x1cfaad[_0x6da8('0x2f')],_0x1cfaad['query']);_0x42cf0d['attributes']=_[_0x6da8('0x31')](_0x1cfaad[_0x6da8('0x2f')],qs[_0x6da8('0x33')](_0x4531f8[_0x6da8('0x30')][_0x6da8('0x33')]));_0x42cf0d[_0x6da8('0x32')]=_0x42cf0d['attributes'][_0x6da8('0x42')]?_0x42cf0d[_0x6da8('0x32')]:_0x1cfaad[_0x6da8('0x2f')];if(_0x4531f8['query'][_0x6da8('0x3d')]){_0x42cf0d[_0x6da8('0x43')]=[{'all':!![]}];}_0x42cf0d=_[_0x6da8('0x39')]({},_0x42cf0d,_0x4531f8[_0x6da8('0x3c')]);return db[_0x6da8('0x2c')][_0x6da8('0x44')](_0x42cf0d)[_0x6da8('0x24')](handleEntityNotFound(_0x465b50,null))[_0x6da8('0x24')](respondWithResult(_0x465b50,null))[_0x6da8('0x3f')](handleError(_0x465b50,null));};exports[_0x6da8('0x45')]=function(_0x2b3116,_0x4bda5a){return db[_0x6da8('0x2c')][_0x6da8('0x45')](_0x2b3116[_0x6da8('0x46')],{})[_0x6da8('0x24')](respondWithResult(_0x4bda5a,0xc9))['catch'](handleError(_0x4bda5a,null));};exports[_0x6da8('0x47')]=function(_0x11cee4,_0xce13f4){return db[_0x6da8('0x2c')][_0x6da8('0x47')]()[_0x6da8('0x24')](respondWithResult(_0xce13f4,null))['catch'](handleError(_0xce13f4,null));};exports['update']=function(_0x44ff44,_0x4de8af){if(_0x44ff44['body']['uniqueid']){delete _0x44ff44[_0x6da8('0x46')][_0x6da8('0x48')];}return db[_0x6da8('0x2c')][_0x6da8('0x44')]({'where':{'uniqueid':_0x44ff44[_0x6da8('0x49')]['id']}})[_0x6da8('0x24')](handleEntityNotFound(_0x4de8af,null))[_0x6da8('0x24')](saveUpdates(_0x44ff44[_0x6da8('0x46')],null))[_0x6da8('0x24')](respondWithResult(_0x4de8af,null))[_0x6da8('0x3f')](handleError(_0x4de8af,null));};
\ No newline at end of file
index a21d586..1a317c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2f1f62,_0x542a1f){var _0x4a1ff3=function(_0x104ffe){while(--_0x104ffe){_0x2f1f62['push'](_0x2f1f62['shift']());}};_0x4a1ff3(++_0x542a1f);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x34e3b8,_0x4b2600){_0x34e3b8=_0x34e3b8-0x0;var _0x52b0cf=_0xc6ac[_0x34e3b8];return _0x52b0cf;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[{'name':_0xcc6a('0xe'),'fields':['endtime']},{'name':_0xcc6a('0xf'),'fields':[_0xcc6a('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd9e=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x4a93bb,_0x495404){var _0x208468=function(_0x1d82b7){while(--_0x1d82b7){_0x4a93bb['push'](_0x4a93bb['shift']());}};_0x208468(++_0x495404);}(_0xbd9e,0x108));var _0xebd9=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xbd9e[_0x28947d];return _0x12d2ee;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xebd9('0x0'))('api');var moment=require(_0xebd9('0x1'));var BPromise=require(_0xebd9('0x2'));var rp=require(_0xebd9('0x3'));var fs=require('fs');var path=require(_0xebd9('0x4'));var rimraf=require(_0xebd9('0x5'));var config=require('../../config/environment');var attributes=require(_0xebd9('0x6'));module['exports']=function(_0x3b2ade,_0x17f877){return _0x3b2ade[_0xebd9('0x7')](_0xebd9('0x8'),attributes,{'tableName':_0xebd9('0x9'),'paranoid':![],'indexes':[{'name':_0xebd9('0xa'),'fields':['endtime']},{'name':_0xebd9('0xb'),'fields':[_0xebd9('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 1425b31..e77e254 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9173=['literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','catch','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','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','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','CreateCmHopperHistory','CmHopperHistory','body','options','raw','stringify','AvgHandleTime','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls'];(function(_0x42803a,_0x13cd0e){var _0x40fdfe=function(_0x4f056e){while(--_0x4f056e){_0x42803a['push'](_0x42803a['shift']());}};_0x40fdfe(++_0x13cd0e);}(_0x9173,0xb4));var _0x3917=function(_0x17a64c,_0x113c71){_0x17a64c=_0x17a64c-0x0;var _0x8f7748=_0x9173[_0x17a64c];return _0x8f7748;};'use strict';var _=require(_0x3917('0x0'));var util=require(_0x3917('0x1'));var moment=require('moment');var BPromise=require(_0x3917('0x2'));var rs=require(_0x3917('0x3'));var fs=require('fs');var Redis=require(_0x3917('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3917('0x5'));var logger=require('../../config/logger')(_0x3917('0x6'));var config=require(_0x3917('0x7'));var jayson=require(_0x3917('0x8'));var client=jayson[_0x3917('0x9')][_0x3917('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48d592,_0x181918,_0x27f513){return new BPromise(function(_0x11267b,_0x44d50e){return client[_0x3917('0xb')](_0x48d592,_0x27f513)[_0x3917('0xc')](function(_0x58282f){logger[_0x3917('0xd')](_0x3917('0xe'),_0x181918,'request\x20sent');logger[_0x3917('0xf')](_0x3917('0x10'),_0x181918,'request\x20sent',JSON['stringify'](_0x58282f));if(_0x58282f['error']){if(_0x58282f[_0x3917('0x11')][_0x3917('0x12')]===0x1f4){logger[_0x3917('0x11')](_0x3917('0xe'),_0x181918,_0x58282f[_0x3917('0x11')][_0x3917('0x13')]);return _0x44d50e(_0x58282f['error'][_0x3917('0x13')]);}logger[_0x3917('0x11')](_0x3917('0xe'),_0x181918,_0x58282f[_0x3917('0x11')]['message']);return _0x11267b(_0x58282f[_0x3917('0x11')][_0x3917('0x13')]);}else{logger[_0x3917('0xd')](_0x3917('0xe'),_0x181918,_0x3917('0x14'));_0x11267b(_0x58282f['result'][_0x3917('0x13')]);}})['catch'](function(_0x4912cd){logger[_0x3917('0x11')](_0x3917('0xe'),_0x181918,_0x4912cd);_0x44d50e(_0x4912cd);});});}exports[_0x3917('0x15')]=function(_0x509b2b){var _0x402d3c=this;return new Promise(function(_0x504934,_0x47da7e){return db[_0x3917('0x16')]['create'](_0x509b2b[_0x3917('0x17')],{'raw':_0x509b2b[_0x3917('0x18')]?_0x509b2b[_0x3917('0x18')][_0x3917('0x19')]===undefined?!![]:![]:!![]})[_0x3917('0xc')](function(_0x2f9f7d){logger[_0x3917('0xd')](_0x3917('0x15'),_0x509b2b);logger[_0x3917('0xf')](_0x3917('0x15'),_0x509b2b,JSON[_0x3917('0x1a')](_0x2f9f7d));_0x504934(_0x2f9f7d);})['catch'](function(_0x1e3d24){logger[_0x3917('0x11')]('CreateCmHopperHistory',_0x1e3d24['message'],_0x509b2b);_0x47da7e(_0x402d3c[_0x3917('0x11')](0x1f4,_0x1e3d24['message']));});});};exports[_0x3917('0x1b')]=function(_0x337aba){var _0x3ddc64=this;return new Promise(function(_0x5f16b7,_0x1e47a2){return db['CmHopperHistory'][_0x3917('0x1c')]({'raw':_0x337aba[_0x3917('0x18')]?_0x337aba[_0x3917('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x337aba[_0x3917('0x18')]?_0x337aba[_0x3917('0x18')][_0x3917('0x1d')]||null:null,'attributes':[[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db['sequelize']['col']('id')),_0x3917('0x20')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x22')))),_0x3917('0x23')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db['sequelize']['fn']('IF',db[_0x3917('0x1e')]['literal'](_0x3917('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db['sequelize']['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x25')))),_0x3917('0x26')],[db['sequelize']['fn'](_0x3917('0x27'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x28')))),_0x3917('0x29')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x27'),db['sequelize']['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x2a')))),_0x3917('0x2b')]]})[_0x3917('0xc')](function(_0x4b3378){logger[_0x3917('0xd')]('AvgHandleTime',_0x337aba);logger[_0x3917('0xf')](_0x3917('0x1b'),_0x337aba,JSON['stringify'](_0x4b3378));_0x5f16b7(_0x4b3378);})[_0x3917('0x2c')](function(_0x5e32ab){logger[_0x3917('0x11')](_0x3917('0x1b'),_0x5e32ab[_0x3917('0x13')],_0x337aba);_0x1e47a2(_0x3ddc64[_0x3917('0x11')](0x1f4,_0x5e32ab[_0x3917('0x13')]));});});};exports[_0x3917('0x2d')]=function(_0x1136ce){var _0x180886=this;return new Promise(function(_0x222618,_0x404325){return db['CmHopperHistory'][_0x3917('0x1c')]({'raw':_0x1136ce[_0x3917('0x18')]?_0x1136ce[_0x3917('0x18')][_0x3917('0x19')]===undefined?!![]:![]:!![],'where':_0x1136ce[_0x3917('0x18')]?_0x1136ce['options'][_0x3917('0x1d')]||null:null,'attributes':[[_0x3917('0x2e'),'name'],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')]['literal'](_0x3917('0x2f')))),_0x3917('0x30')],[db['sequelize']['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x3917('0x31')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')]('`state`\x20=\x205,\x201,\x20null'))),_0x3917('0x32')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x33')))),_0x3917('0x34')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x35')))),_0x3917('0x36')],[db['sequelize']['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x37')))),_0x3917('0x38')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db['sequelize']['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x39')))),'outboundUnknownCallsDay'],[db['sequelize']['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x3a')))),_0x3917('0x3b')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x3917('0x21')](_0x3917('0x3c')))),_0x3917('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x3917('0x1e')]['fn']('IF',db['sequelize'][_0x3917('0x21')](_0x3917('0x3e')))),_0x3917('0x3f')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x40')))),_0x3917('0x41')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0x3917('0x3f')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db['sequelize'][_0x3917('0x21')](_0x3917('0x42')))),_0x3917('0x43')]],'group':[_0x3917('0x2e')]})['then'](function(_0x4ff953){logger[_0x3917('0xd')](_0x3917('0x2d'),_0x1136ce);logger['debug'](_0x3917('0x2d'),_0x1136ce,JSON[_0x3917('0x1a')](_0x4ff953));_0x222618(_0x4ff953);})[_0x3917('0x2c')](function(_0x59a635){logger[_0x3917('0x11')](_0x3917('0x2d'),_0x59a635[_0x3917('0x13')],_0x1136ce);_0x404325(_0x180886[_0x3917('0x11')](0x1f4,_0x59a635[_0x3917('0x13')]));});});};exports[_0x3917('0x44')]=function(_0x1818c5){var _0x1ffb69=this;return new Promise(function(_0x45c669,_0x3f0799){return db['CmHopperHistory'][_0x3917('0x1c')]({'raw':_0x1818c5[_0x3917('0x18')]?_0x1818c5[_0x3917('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1818c5[_0x3917('0x18')]?_0x1818c5[_0x3917('0x18')][_0x3917('0x1d')]||null:null,'attributes':[['campaign','name'],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')][_0x3917('0x45')]('id')),'ivrTotalCallsDays'],[db[_0x3917('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x3917('0x46')]],'group':[_0x3917('0x2e')]})[_0x3917('0xc')](function(_0x4c2363){logger[_0x3917('0xd')]('GetCampaignHopperHistory',_0x1818c5);logger['debug']('GetCampaignHopperHistory',_0x1818c5,JSON[_0x3917('0x1a')](_0x4c2363));_0x45c669(_0x4c2363);})['catch'](function(_0x3de9e9){logger[_0x3917('0x11')](_0x3917('0x44'),_0x3de9e9['message'],_0x1818c5);_0x3f0799(_0x1ffb69[_0x3917('0x11')](0x1f4,_0x3de9e9[_0x3917('0x13')]));});});};
\ No newline at end of file
+var _0x6c38=['`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','client','request','then','request\x20sent','debug','error','code','CmHopperHistory,\x20%s,\x20%s','message','info','result','catch','CreateCmHopperHistory','body','options','raw','stringify','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay'];(function(_0x3252b1,_0x54e32d){var _0x5f189d=function(_0x57e83a){while(--_0x57e83a){_0x3252b1['push'](_0x3252b1['shift']());}};_0x5f189d(++_0x54e32d);}(_0x6c38,0x8f));var _0x86c3=function(_0x3b9d79,_0x42f721){_0x3b9d79=_0x3b9d79-0x0;var _0x16d93e=_0x6c38[_0x3b9d79];return _0x16d93e;};'use strict';var _=require(_0x86c3('0x0'));var util=require(_0x86c3('0x1'));var moment=require(_0x86c3('0x2'));var BPromise=require(_0x86c3('0x3'));var rs=require(_0x86c3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x86c3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86c3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49ff58,_0x3a8924,_0xbde89c){return new BPromise(function(_0x224109,_0x5e6afe){return client[_0x86c3('0x8')](_0x49ff58,_0xbde89c)[_0x86c3('0x9')](function(_0x4df76e){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x3a8924,_0x86c3('0xa'));logger[_0x86c3('0xb')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x3a8924,_0x86c3('0xa'),JSON['stringify'](_0x4df76e));if(_0x4df76e[_0x86c3('0xc')]){if(_0x4df76e[_0x86c3('0xc')][_0x86c3('0xd')]===0x1f4){logger[_0x86c3('0xc')](_0x86c3('0xe'),_0x3a8924,_0x4df76e[_0x86c3('0xc')]['message']);return _0x5e6afe(_0x4df76e[_0x86c3('0xc')][_0x86c3('0xf')]);}logger['error'](_0x86c3('0xe'),_0x3a8924,_0x4df76e[_0x86c3('0xc')]['message']);return _0x224109(_0x4df76e[_0x86c3('0xc')]['message']);}else{logger[_0x86c3('0x10')](_0x86c3('0xe'),_0x3a8924,_0x86c3('0xa'));_0x224109(_0x4df76e[_0x86c3('0x11')][_0x86c3('0xf')]);}})[_0x86c3('0x12')](function(_0x2153dc){logger['error'](_0x86c3('0xe'),_0x3a8924,_0x2153dc);_0x5e6afe(_0x2153dc);});});}exports[_0x86c3('0x13')]=function(_0x277c0e){var _0x1da025=this;return new Promise(function(_0x505453,_0x14f63f){return db['CmHopperHistory']['create'](_0x277c0e[_0x86c3('0x14')],{'raw':_0x277c0e[_0x86c3('0x15')]?_0x277c0e['options'][_0x86c3('0x16')]===undefined?!![]:![]:!![]})[_0x86c3('0x9')](function(_0x430b07){logger[_0x86c3('0x10')](_0x86c3('0x13'),_0x277c0e);logger['debug'](_0x86c3('0x13'),_0x277c0e,JSON[_0x86c3('0x17')](_0x430b07));_0x505453(_0x430b07);})['catch'](function(_0x3fac88){logger[_0x86c3('0xc')]('CreateCmHopperHistory',_0x3fac88[_0x86c3('0xf')],_0x277c0e);_0x14f63f(_0x1da025['error'](0x1f4,_0x3fac88['message']));});});};exports[_0x86c3('0x18')]=function(_0x33223d){var _0x3d55b0=this;return new Promise(function(_0x5fa481,_0x109e94){return db['CmHopperHistory'][_0x86c3('0x19')]({'raw':_0x33223d[_0x86c3('0x15')]?_0x33223d['options'][_0x86c3('0x16')]===undefined?!![]:![]:!![],'where':_0x33223d[_0x86c3('0x15')]?_0x33223d[_0x86c3('0x15')][_0x86c3('0x1a')]||null:null,'attributes':[[db[_0x86c3('0x1b')]['fn']('COUNT',db[_0x86c3('0x1b')][_0x86c3('0x1c')]('id')),_0x86c3('0x1d')],[db[_0x86c3('0x1b')]['fn'](_0x86c3('0x1e'),db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')]['literal'](_0x86c3('0x1f')))),_0x86c3('0x20')],[db[_0x86c3('0x1b')]['fn'](_0x86c3('0x1e'),db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')][_0x86c3('0x21')](_0x86c3('0x22')))),_0x86c3('0x23')],[db[_0x86c3('0x1b')]['fn'](_0x86c3('0x1e'),db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')][_0x86c3('0x21')](_0x86c3('0x24')))),_0x86c3('0x25')],[db['sequelize']['fn'](_0x86c3('0x26'),db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')][_0x86c3('0x21')](_0x86c3('0x27')))),_0x86c3('0x28')],[db[_0x86c3('0x1b')]['fn'](_0x86c3('0x26'),db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')][_0x86c3('0x21')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x86c3('0x29')]]})[_0x86c3('0x9')](function(_0x55e7f2){logger[_0x86c3('0x10')](_0x86c3('0x18'),_0x33223d);logger[_0x86c3('0xb')](_0x86c3('0x18'),_0x33223d,JSON[_0x86c3('0x17')](_0x55e7f2));_0x5fa481(_0x55e7f2);})[_0x86c3('0x12')](function(_0x4823dd){logger[_0x86c3('0xc')](_0x86c3('0x18'),_0x4823dd[_0x86c3('0xf')],_0x33223d);_0x109e94(_0x3d55b0['error'](0x1f4,_0x4823dd[_0x86c3('0xf')]));});});};exports[_0x86c3('0x2a')]=function(_0x1a126c){var _0xc274b2=this;return new Promise(function(_0x3f2184,_0x4d1f00){return db[_0x86c3('0x2b')][_0x86c3('0x19')]({'raw':_0x1a126c['options']?_0x1a126c['options']['raw']===undefined?!![]:![]:!![],'where':_0x1a126c[_0x86c3('0x15')]?_0x1a126c[_0x86c3('0x15')][_0x86c3('0x1a')]||null:null,'attributes':[[_0x86c3('0x2c'),_0x86c3('0x2d')],[db[_0x86c3('0x1b')]['fn'](_0x86c3('0x1e'),db[_0x86c3('0x1b')]['fn']('IF',db['sequelize'][_0x86c3('0x21')](_0x86c3('0x2e')))),'outboundNoSuchCallsDay'],[db[_0x86c3('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x86c3('0x21')](_0x86c3('0x2f')))),_0x86c3('0x30')],[db[_0x86c3('0x1b')]['fn']('COUNT',db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')][_0x86c3('0x21')](_0x86c3('0x1f')))),_0x86c3('0x31')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x86c3('0x1b')]['literal'](_0x86c3('0x32')))),_0x86c3('0x33')],[db[_0x86c3('0x1b')]['fn']('COUNT',db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')][_0x86c3('0x21')]('`state`\x20=\x208,\x201,\x20null'))),_0x86c3('0x34')],[db[_0x86c3('0x1b')]['fn']('COUNT',db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')][_0x86c3('0x21')](_0x86c3('0x35')))),_0x86c3('0x36')],[db[_0x86c3('0x1b')]['fn'](_0x86c3('0x1e'),db[_0x86c3('0x1b')]['fn']('IF',db['sequelize'][_0x86c3('0x21')](_0x86c3('0x37')))),'outboundDropCallsDayCallersExit'],[db[_0x86c3('0x1b')]['fn'](_0x86c3('0x1e'),db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')][_0x86c3('0x21')](_0x86c3('0x38')))),_0x86c3('0x39')],[db[_0x86c3('0x1b')]['fn'](_0x86c3('0x1e'),db[_0x86c3('0x1b')]['fn']('IF',db['sequelize'][_0x86c3('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),_0x86c3('0x3a')],[db[_0x86c3('0x1b')]['fn'](_0x86c3('0x1e'),db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')][_0x86c3('0x21')](_0x86c3('0x3b')))),_0x86c3('0x3c')],[db[_0x86c3('0x1b')]['fn'](_0x86c3('0x1e'),db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),_0x86c3('0x3d')],[db[_0x86c3('0x1b')]['fn'](_0x86c3('0x1e'),db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')][_0x86c3('0x21')](_0x86c3('0x3e')))),_0x86c3('0x3f')],[db[_0x86c3('0x1b')]['fn'](_0x86c3('0x1e'),db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')][_0x86c3('0x21')](_0x86c3('0x40')))),_0x86c3('0x3d')],[db['sequelize']['fn'](_0x86c3('0x1e'),db[_0x86c3('0x1b')]['fn']('IF',db['sequelize'][_0x86c3('0x21')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x86c3('0x41')]],'group':[_0x86c3('0x2c')]})[_0x86c3('0x9')](function(_0x2b45c7){logger[_0x86c3('0x10')](_0x86c3('0x2a'),_0x1a126c);logger[_0x86c3('0xb')](_0x86c3('0x2a'),_0x1a126c,JSON[_0x86c3('0x17')](_0x2b45c7));_0x3f2184(_0x2b45c7);})[_0x86c3('0x12')](function(_0x517635){logger[_0x86c3('0xc')]('GetVoiceQueueHopperHistory',_0x517635[_0x86c3('0xf')],_0x1a126c);_0x4d1f00(_0xc274b2[_0x86c3('0xc')](0x1f4,_0x517635[_0x86c3('0xf')]));});});};exports[_0x86c3('0x42')]=function(_0x3b85c4){var _0x502139=this;return new Promise(function(_0x4a7788,_0x587a90){return db[_0x86c3('0x2b')][_0x86c3('0x19')]({'raw':_0x3b85c4['options']?_0x3b85c4[_0x86c3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3b85c4[_0x86c3('0x15')]?_0x3b85c4[_0x86c3('0x15')][_0x86c3('0x1a')]||null:null,'attributes':[[_0x86c3('0x2c'),_0x86c3('0x2d')],[db['sequelize']['fn']('COUNT',db['sequelize'][_0x86c3('0x1c')]('id')),_0x86c3('0x43')],[db['sequelize']['fn'](_0x86c3('0x1e'),db[_0x86c3('0x1b')]['fn']('IF',db[_0x86c3('0x1b')][_0x86c3('0x21')](_0x86c3('0x1f')))),_0x86c3('0x44')]],'group':['campaign']})[_0x86c3('0x9')](function(_0x4abaa5){logger[_0x86c3('0x10')](_0x86c3('0x42'),_0x3b85c4);logger[_0x86c3('0xb')](_0x86c3('0x42'),_0x3b85c4,JSON[_0x86c3('0x17')](_0x4abaa5));_0x4a7788(_0x4abaa5);})[_0x86c3('0x12')](function(_0x276b45){logger[_0x86c3('0xc')](_0x86c3('0x42'),_0x276b45[_0x86c3('0xf')],_0x3b85c4);_0x587a90(_0x502139['error'](0x1f4,_0x276b45[_0x86c3('0xf')]));});});};
\ No newline at end of file
index cbe0b68..ff09969 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9785=['isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get'];(function(_0x14118a,_0x5ad55c){var _0x28106e=function(_0x21f5d2){while(--_0x21f5d2){_0x14118a['push'](_0x14118a['shift']());}};_0x28106e(++_0x5ad55c);}(_0x9785,0x19a));var _0x5978=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x9785[_0x92c450];return _0x2a9599;};'use strict';var multer=require('multer');var util=require(_0x5978('0x0'));var path=require(_0x5978('0x1'));var timeout=require('connect-timeout');var express=require(_0x5978('0x2'));var router=express[_0x5978('0x3')]();var fs_extra=require(_0x5978('0x4'));var auth=require(_0x5978('0x5'));var interaction=require(_0x5978('0x6'));var config=require(_0x5978('0x7'));var controller=require(_0x5978('0x8'));router[_0x5978('0x9')]('/',auth[_0x5978('0xa')](),controller[_0x5978('0xb')]);router['get'](_0x5978('0xc'),auth['isAuthenticated'](),controller[_0x5978('0xd')]);router['get']('/:id',auth[_0x5978('0xa')](),controller[_0x5978('0xe')]);router[_0x5978('0xf')]('/',auth[_0x5978('0xa')](),controller[_0x5978('0x10')]);router[_0x5978('0x11')](_0x5978('0x12'),auth[_0x5978('0xa')](),controller[_0x5978('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x9805=['/describe','describe','/:id','show','post','create','put','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x9805,0x8d));var _0x5980=function(_0x14dcc9,_0x19ac97){_0x14dcc9=_0x14dcc9-0x0;var _0x410bed=_0x9805[_0x14dcc9];return _0x410bed;};'use strict';var multer=require(_0x5980('0x0'));var util=require('util');var path=require(_0x5980('0x1'));var timeout=require(_0x5980('0x2'));var express=require('express');var router=express[_0x5980('0x3')]();var fs_extra=require(_0x5980('0x4'));var auth=require(_0x5980('0x5'));var interaction=require(_0x5980('0x6'));var config=require(_0x5980('0x7'));var controller=require('./cmHopperHistory.controller');router[_0x5980('0x8')]('/',auth[_0x5980('0x9')](),controller[_0x5980('0xa')]);router[_0x5980('0x8')](_0x5980('0xb'),auth[_0x5980('0x9')](),controller[_0x5980('0xc')]);router[_0x5980('0x8')](_0x5980('0xd'),auth['isAuthenticated'](),controller[_0x5980('0xe')]);router[_0x5980('0xf')]('/',auth[_0x5980('0x9')](),controller[_0x5980('0x10')]);router[_0x5980('0x11')]('/:id',auth[_0x5980('0x9')](),controller['update']);module[_0x5980('0x12')]=router;
\ No newline at end of file
index a047bd7..dfc95ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00b3=['STRING','sequelize','name'];(function(_0x1e9997,_0x4798c0){var _0x25feaa=function(_0xfedf78){while(--_0xfedf78){_0x1e9997['push'](_0x1e9997['shift']());}};_0x25feaa(++_0x4798c0);}(_0x00b3,0x97));var _0x300b=function(_0xc9059a,_0x3ba457){_0xc9059a=_0xc9059a-0x0;var _0x24fb72=_0x00b3[_0xc9059a];return _0x24fb72;};'use strict';var Sequelize=require(_0x300b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x300b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x300b('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb31a=['sequelize','exports','STRING','name'];(function(_0x3688e3,_0x171294){var _0x147f81=function(_0x10c6f5){while(--_0x10c6f5){_0x3688e3['push'](_0x3688e3['shift']());}};_0x147f81(++_0x171294);}(_0xb31a,0xd4));var _0xab31=function(_0x1e6822,_0x4bc45d){_0x1e6822=_0x1e6822-0x0;var _0x234dd4=_0xb31a[_0x1e6822];return _0x234dd4;};'use strict';var Sequelize=require(_0xab31('0x0'));module[_0xab31('0x1')]={'name':{'type':Sequelize[_0xab31('0x2')],'unique':_0xab31('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xab31('0x2')]},'dialPrefix':{'type':Sequelize[_0xab31('0x2')]}};
\ No newline at end of file
index ee4a322..587471e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff11=['attachment;\x20filename=','list_%d_%s.csv','Content-type','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','offset','limit','undefined','count','set','json','reject','save','update','then','Lists','UserProfileResource','end','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','destroy','describe','ListId','Disposition','create','getDispositions','findOne','sort','rows','removeDispositions','addContacts','isArray','tags','each','CmContact','omit','ids','success','push','dataValues','errors','Malformed\x20request\x20syntax','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContacts','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xff11,0xb3));var _0x1ff1=function(_0xeb8826,_0x13a812){_0xeb8826=_0xeb8826-0x0;var _0x4811c5=_0xff11[_0xeb8826];return _0x4811c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ff1('0x0'));var zipdir=require(_0x1ff1('0x1'));var jsonpatch=require(_0x1ff1('0x2'));var rp=require(_0x1ff1('0x3'));var moment=require(_0x1ff1('0x4'));var BPromise=require(_0x1ff1('0x5'));var Mustache=require(_0x1ff1('0x6'));var util=require(_0x1ff1('0x7'));var path=require(_0x1ff1('0x8'));var sox=require(_0x1ff1('0x9'));var csv=require('to-csv');var ejs=require(_0x1ff1('0xa'));var fs=require('fs');var fs_extra=require(_0x1ff1('0xb'));var _=require(_0x1ff1('0xc'));var squel=require(_0x1ff1('0xd'));var crypto=require(_0x1ff1('0xe'));var jsforce=require(_0x1ff1('0xf'));var deskjs=require(_0x1ff1('0x10'));var toCsv=require(_0x1ff1('0x11'));var querystring=require(_0x1ff1('0x12'));var Papa=require(_0x1ff1('0x13'));var Redis=require(_0x1ff1('0x14'));var authService=require(_0x1ff1('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x1ff1('0x16'));var hardwareService=require(_0x1ff1('0x17'));var logger=require(_0x1ff1('0x18'))(_0x1ff1('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1ff1('0x1a'));var db=require(_0x1ff1('0x1b'))['db'];config[_0x1ff1('0x1c')]=_[_0x1ff1('0x1d')](config['redis'],{'host':_0x1ff1('0x1e'),'port':0x18eb});var socket=require(_0x1ff1('0x1f'))(new Redis(config[_0x1ff1('0x1c')]));require(_0x1ff1('0x20'))['register'](socket);function respondWithStatusCode(_0x3016d0,_0x1ec70c){_0x1ec70c=_0x1ec70c||0xcc;return function(_0x25b03c){if(_0x25b03c){return _0x3016d0[_0x1ff1('0x21')](_0x1ec70c);}return _0x3016d0[_0x1ff1('0x22')](_0x1ec70c)['end']();};}function respondWithResult(_0x34c0a1,_0x477501){_0x477501=_0x477501||0xc8;return function(_0x22f8e5){if(_0x22f8e5){return _0x34c0a1[_0x1ff1('0x22')](_0x477501)['json'](_0x22f8e5);}};}function respondWithFilteredResult(_0x476f49,_0x7a3c1b){return function(_0x3ae658){if(_0x3ae658){var _0x19f76a=typeof _0x7a3c1b[_0x1ff1('0x23')]==='undefined'&&typeof _0x7a3c1b[_0x1ff1('0x24')]===_0x1ff1('0x25');var _0x306e34=_0x3ae658[_0x1ff1('0x26')];var _0x318e83=_0x19f76a?0x0:_0x7a3c1b[_0x1ff1('0x23')];var _0x46d422=_0x19f76a?_0x3ae658[_0x1ff1('0x26')]:_0x7a3c1b['offset']+_0x7a3c1b[_0x1ff1('0x24')];var _0x3ca592;if(_0x46d422>=_0x306e34){_0x46d422=_0x306e34;_0x3ca592=0xc8;}else{_0x3ca592=0xce;}_0x476f49[_0x1ff1('0x22')](_0x3ca592);return _0x476f49[_0x1ff1('0x27')]('Content-Range',_0x318e83+'-'+_0x46d422+'/'+_0x306e34)[_0x1ff1('0x28')](_0x3ae658);}return null;};}function patchUpdates(_0x4325f8){return function(_0x10a215){try{jsonpatch['apply'](_0x10a215,_0x4325f8,!![]);}catch(_0x504fb3){return BPromise[_0x1ff1('0x29')](_0x504fb3);}return _0x10a215[_0x1ff1('0x2a')]();};}function saveUpdates(_0x714581,_0x11549f){return function(_0x5bbde9){if(_0x5bbde9){return _0x5bbde9[_0x1ff1('0x2b')](_0x714581)[_0x1ff1('0x2c')](function(_0x57fca5){return _0x57fca5;});}return null;};}function removeEntity(_0xd3680e,_0x4807d9){return function(_0x1ddbe4){if(_0x1ddbe4){return _0x1ddbe4['destroy']()[_0x1ff1('0x2c')](function(){var _0x15cbaf=_0x1ddbe4['get']({'plain':!![]});var _0x43abc1=_0x1ff1('0x2d');return db[_0x1ff1('0x2e')]['destroy']({'where':{'type':_0x43abc1,'resourceId':_0x15cbaf['id']}})[_0x1ff1('0x2c')](function(){return _0x1ddbe4;});})[_0x1ff1('0x2c')](function(){_0xd3680e[_0x1ff1('0x22')](0xcc)[_0x1ff1('0x2f')]();});}};}function handleEntityNotFound(_0x5a48ef,_0x4f778b){return function(_0x267c52){if(!_0x267c52){_0x5a48ef[_0x1ff1('0x21')](0x194);}return _0x267c52;};}function handleError(_0x12c92c,_0x42ca8f){_0x42ca8f=_0x42ca8f||0x1f4;return function(_0x4b5b77){logger[_0x1ff1('0x30')](_0x4b5b77[_0x1ff1('0x31')]);if(_0x4b5b77['name']){delete _0x4b5b77[_0x1ff1('0x32')];}_0x12c92c[_0x1ff1('0x22')](_0x42ca8f)[_0x1ff1('0x33')](_0x4b5b77);};}exports[_0x1ff1('0x34')]=function(_0x36e2cf,_0x2648a4){var _0x8b4c25={},_0x113e2c={},_0x25ac58={'count':0x0,'rows':[]};var _0x272068=_[_0x1ff1('0x35')](db[_0x1ff1('0x36')][_0x1ff1('0x37')],function(_0x16cf6a){return{'name':_0x16cf6a[_0x1ff1('0x38')],'type':_0x16cf6a[_0x1ff1('0x39')][_0x1ff1('0x3a')]};});_0x113e2c[_0x1ff1('0x3b')]=_[_0x1ff1('0x35')](_0x272068,_0x1ff1('0x32'));_0x113e2c[_0x1ff1('0x3c')]=_[_0x1ff1('0x3d')](_0x36e2cf[_0x1ff1('0x3c')]);_0x113e2c[_0x1ff1('0x3e')]=_[_0x1ff1('0x3f')](_0x113e2c['model'],_0x113e2c['query']);_0x8b4c25[_0x1ff1('0x40')]=_[_0x1ff1('0x3f')](_0x113e2c[_0x1ff1('0x3b')],qs[_0x1ff1('0x41')](_0x36e2cf[_0x1ff1('0x3c')]['fields']));_0x8b4c25[_0x1ff1('0x40')]=_0x8b4c25[_0x1ff1('0x40')][_0x1ff1('0x42')]?_0x8b4c25[_0x1ff1('0x40')]:_0x113e2c[_0x1ff1('0x3b')];if(!_0x36e2cf[_0x1ff1('0x3c')][_0x1ff1('0x43')](_0x1ff1('0x44'))){_0x8b4c25[_0x1ff1('0x24')]=qs[_0x1ff1('0x24')](_0x36e2cf[_0x1ff1('0x3c')][_0x1ff1('0x24')]);_0x8b4c25[_0x1ff1('0x23')]=qs[_0x1ff1('0x23')](_0x36e2cf[_0x1ff1('0x3c')][_0x1ff1('0x23')]);}_0x8b4c25[_0x1ff1('0x45')]=qs['sort'](_0x36e2cf[_0x1ff1('0x3c')]['sort']);_0x8b4c25[_0x1ff1('0x46')]=qs[_0x1ff1('0x3e')](_[_0x1ff1('0x47')](_0x36e2cf[_0x1ff1('0x3c')],_0x113e2c[_0x1ff1('0x3e')]),_0x272068);if(_0x36e2cf['query'][_0x1ff1('0x48')]){_0x8b4c25[_0x1ff1('0x46')]=_[_0x1ff1('0x49')](_0x8b4c25[_0x1ff1('0x46')],{'$or':_[_0x1ff1('0x35')](_0x272068,function(_0x7f16e){if(_0x7f16e['type']!==_0x1ff1('0x4a')){var _0x2ce65={};_0x2ce65[_0x7f16e[_0x1ff1('0x32')]]={'$like':'%'+_0x36e2cf[_0x1ff1('0x3c')][_0x1ff1('0x48')]+'%'};return _0x2ce65;}})});}_0x8b4c25=_[_0x1ff1('0x49')]({},_0x8b4c25,_0x36e2cf[_0x1ff1('0x4b')]);var _0x5b20fe={'where':_0x8b4c25[_0x1ff1('0x46')]};return db[_0x1ff1('0x36')][_0x1ff1('0x26')](_0x5b20fe)[_0x1ff1('0x2c')](function(_0x49f143){_0x25ac58[_0x1ff1('0x26')]=_0x49f143;if(_0x36e2cf[_0x1ff1('0x3c')][_0x1ff1('0x4c')]){_0x8b4c25[_0x1ff1('0x4d')]=[{'all':!![]}];}return db[_0x1ff1('0x36')][_0x1ff1('0x4e')](_0x8b4c25);})[_0x1ff1('0x2c')](function(_0xcc1923){_0x25ac58['rows']=_0xcc1923;return _0x25ac58;})[_0x1ff1('0x2c')](respondWithFilteredResult(_0x2648a4,_0x8b4c25))[_0x1ff1('0x4f')](handleError(_0x2648a4,null));};exports[_0x1ff1('0x50')]=function(_0x12e76e,_0x114e87){var _0x9fc8fa={'raw':![],'where':{'id':_0x12e76e[_0x1ff1('0x51')]['id']}},_0x3bcdee={};_0x3bcdee['model']=_[_0x1ff1('0x3d')](db[_0x1ff1('0x36')][_0x1ff1('0x37')]);_0x3bcdee['query']=_[_0x1ff1('0x3d')](_0x12e76e['query']);_0x3bcdee[_0x1ff1('0x3e')]=_[_0x1ff1('0x3f')](_0x3bcdee[_0x1ff1('0x3b')],_0x3bcdee[_0x1ff1('0x3c')]);_0x9fc8fa[_0x1ff1('0x40')]=_[_0x1ff1('0x3f')](_0x3bcdee['model'],qs['fields'](_0x12e76e[_0x1ff1('0x3c')][_0x1ff1('0x41')]));_0x9fc8fa[_0x1ff1('0x40')]=_0x9fc8fa[_0x1ff1('0x40')][_0x1ff1('0x42')]?_0x9fc8fa[_0x1ff1('0x40')]:_0x3bcdee[_0x1ff1('0x3b')];if(_0x12e76e[_0x1ff1('0x3c')]['includeAll']){_0x9fc8fa[_0x1ff1('0x4d')]=[{'all':!![]}];}_0x9fc8fa=_['merge']({},_0x9fc8fa,_0x12e76e[_0x1ff1('0x4b')]);return db[_0x1ff1('0x36')][_0x1ff1('0x52')](_0x9fc8fa)[_0x1ff1('0x2c')](handleEntityNotFound(_0x114e87,null))[_0x1ff1('0x2c')](respondWithResult(_0x114e87,null))[_0x1ff1('0x4f')](handleError(_0x114e87,null));};exports['create']=function(_0x4f2eba,_0x558b63){return db[_0x1ff1('0x36')]['create'](_0x4f2eba[_0x1ff1('0x53')],{})[_0x1ff1('0x2c')](function(_0x38f6bb){var _0x3309ff=_0x4f2eba[_0x1ff1('0x54')][_0x1ff1('0x55')]({'plain':!![]});if(!_0x3309ff)throw new Error(_0x1ff1('0x56'));if(_0x3309ff[_0x1ff1('0x57')]==='user'){var _0x3285dc=_0x38f6bb[_0x1ff1('0x55')]({'plain':!![]});var _0x5e4287='Lists';return db[_0x1ff1('0x58')]['find']({'where':{'name':_0x5e4287,'userProfileId':_0x3309ff[_0x1ff1('0x59')]},'raw':!![]})[_0x1ff1('0x2c')](function(_0x737b8e){if(_0x737b8e&&_0x737b8e[_0x1ff1('0x5a')]===0x0){return db[_0x1ff1('0x2e')]['create']({'name':_0x3285dc[_0x1ff1('0x32')],'resourceId':_0x3285dc['id'],'type':_0x737b8e[_0x1ff1('0x32')],'sectionId':_0x737b8e['id']},{})[_0x1ff1('0x2c')](function(){return _0x38f6bb;});}else{return _0x38f6bb;}})['catch'](function(_0x4c2be8){logger[_0x1ff1('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c2be8);throw _0x4c2be8;});}return _0x38f6bb;})[_0x1ff1('0x2c')](respondWithResult(_0x558b63,0xc9))['catch'](handleError(_0x558b63,null));};exports[_0x1ff1('0x2b')]=function(_0x539fff,_0x2a6a9f){if(_0x539fff[_0x1ff1('0x53')]['id']){delete _0x539fff[_0x1ff1('0x53')]['id'];}return db[_0x1ff1('0x36')][_0x1ff1('0x52')]({'where':{'id':_0x539fff[_0x1ff1('0x51')]['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x2a6a9f,null))[_0x1ff1('0x2c')](saveUpdates(_0x539fff[_0x1ff1('0x53')],null))['then'](respondWithResult(_0x2a6a9f,null))[_0x1ff1('0x4f')](handleError(_0x2a6a9f,null));};exports[_0x1ff1('0x5b')]=function(_0x3ebb37,_0x34b77e){return db['CmList']['find']({'where':{'id':_0x3ebb37[_0x1ff1('0x51')]['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x34b77e,null))['then'](removeEntity(_0x34b77e,null))[_0x1ff1('0x4f')](handleError(_0x34b77e,null));};exports[_0x1ff1('0x5c')]=function(_0xfc288c,_0x52e189){return db['CmList'][_0x1ff1('0x5c')]()[_0x1ff1('0x2c')](respondWithResult(_0x52e189,null))['catch'](handleError(_0x52e189,null));};exports['addDisposition']=function(_0x2860fd,_0x284218,_0x4b82ba){if(_0x2860fd['body']['id']){delete _0x2860fd[_0x1ff1('0x53')]['id'];}return db[_0x1ff1('0x36')]['find']({'where':{'id':_0x2860fd[_0x1ff1('0x51')]['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x284218,null))[_0x1ff1('0x2c')](function(_0x3cd03f){if(_0x3cd03f){_0x2860fd['body'][_0x1ff1('0x5d')]=_0x3cd03f['id'];return db[_0x1ff1('0x5e')][_0x1ff1('0x5f')](_0x2860fd[_0x1ff1('0x53')]);}})[_0x1ff1('0x2c')](respondWithResult(_0x284218,null))[_0x1ff1('0x4f')](handleError(_0x284218,null));};exports[_0x1ff1('0x60')]=function(_0x1033c0,_0x4a6ad4,_0x120fb2){var _0x34115b={'raw':![],'where':{}};var _0x1186a7={};var _0x3ae55e={'count':0x0,'rows':[]};return db[_0x1ff1('0x36')][_0x1ff1('0x61')]({'where':{'id':_0x1033c0[_0x1ff1('0x51')]['id']}})['then'](handleEntityNotFound(_0x4a6ad4,null))[_0x1ff1('0x2c')](function(_0x2d1fc6){if(_0x2d1fc6){_0x1186a7[_0x1ff1('0x3b')]=_[_0x1ff1('0x3d')](db[_0x1ff1('0x5e')][_0x1ff1('0x37')]);_0x1186a7['query']=_[_0x1ff1('0x3d')](_0x1033c0['query']);_0x1186a7[_0x1ff1('0x3e')]=_[_0x1ff1('0x3f')](_0x1186a7[_0x1ff1('0x3b')],_0x1186a7['query']);_0x34115b['attributes']=_[_0x1ff1('0x3f')](_0x1186a7['model'],qs[_0x1ff1('0x41')](_0x1033c0[_0x1ff1('0x3c')][_0x1ff1('0x41')]));_0x34115b[_0x1ff1('0x40')]=_0x34115b[_0x1ff1('0x40')]['length']?_0x34115b[_0x1ff1('0x40')]:_0x1186a7['model'];if(!_0x1033c0['query'][_0x1ff1('0x43')](_0x1ff1('0x44'))){_0x34115b[_0x1ff1('0x24')]=qs[_0x1ff1('0x24')](_0x1033c0[_0x1ff1('0x3c')]['limit']);_0x34115b['offset']=qs[_0x1ff1('0x23')](_0x1033c0[_0x1ff1('0x3c')][_0x1ff1('0x23')]);}_0x34115b['order']=qs['sort'](_0x1033c0[_0x1ff1('0x3c')][_0x1ff1('0x62')]);_0x34115b[_0x1ff1('0x46')]=qs[_0x1ff1('0x3e')](_['pick'](_0x1033c0[_0x1ff1('0x3c')],_0x1186a7[_0x1ff1('0x3e')]));_0x34115b['where'][_0x1ff1('0x5d')]=_0x2d1fc6['id'];if(_0x1033c0[_0x1ff1('0x3c')]['filter']){_0x34115b[_0x1ff1('0x46')]=_['merge'](_0x34115b[_0x1ff1('0x46')],{'$or':_[_0x1ff1('0x35')](_0x34115b['attributes'],function(_0x80f09d){var _0x4f9c66={};_0x4f9c66[_0x80f09d]={'$like':'%'+_0x1033c0[_0x1ff1('0x3c')]['filter']+'%'};return _0x4f9c66;})});}_0x34115b=_[_0x1ff1('0x49')]({},_0x34115b,_0x1033c0[_0x1ff1('0x4b')]);return db[_0x1ff1('0x5e')]['count']({'where':_0x34115b['where']})[_0x1ff1('0x2c')](function(_0x55a3df){_0x3ae55e[_0x1ff1('0x26')]=_0x55a3df;if(_0x1033c0[_0x1ff1('0x3c')][_0x1ff1('0x4c')]){_0x34115b['include']=[{'all':!![]}];}return db[_0x1ff1('0x5e')][_0x1ff1('0x4e')](_0x34115b);})['then'](function(_0x2838f3){_0x3ae55e[_0x1ff1('0x63')]=_0x2838f3;return _0x3ae55e;});}})[_0x1ff1('0x2c')](respondWithFilteredResult(_0x4a6ad4,_0x34115b))[_0x1ff1('0x4f')](handleError(_0x4a6ad4,null));};exports['removeDispositions']=function(_0x4993d9,_0x58c436,_0x587041){return db[_0x1ff1('0x36')][_0x1ff1('0x52')]({'where':{'id':_0x4993d9[_0x1ff1('0x51')]['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x58c436,null))['then'](function(_0x2cc241){if(_0x2cc241){return _0x2cc241[_0x1ff1('0x64')](_0x4993d9['query']['ids']);}})['then'](respondWithStatusCode(_0x58c436,null))[_0x1ff1('0x4f')](handleError(_0x58c436,null));};exports[_0x1ff1('0x65')]=function(_0x5d24ea,_0x38022b,_0xa87d23){return db[_0x1ff1('0x36')][_0x1ff1('0x52')]({'where':{'id':_0x5d24ea['params']['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x38022b,null))[_0x1ff1('0x2c')](function(_0x2dad23){if(_0x2dad23){var _0x5b16c0=[];var _0x34fdad={'success':[],'errors':[]};return db['CmContact'][_0x1ff1('0x5c')]()['then'](function(_0x31abfd){if(_0x5d24ea[_0x1ff1('0x53')]['tags']&&_[_0x1ff1('0x66')](_0x5d24ea[_0x1ff1('0x53')][_0x1ff1('0x67')])){if(_0x5d24ea[_0x1ff1('0x53')][_0x1ff1('0x67')]['length']){_0x5d24ea[_0x1ff1('0x53')]['tags']=_0x5d24ea[_0x1ff1('0x53')][_0x1ff1('0x67')]['join'](';')+';';}else{_0x5d24ea[_0x1ff1('0x53')][_0x1ff1('0x67')]=null;}}else{_0x5d24ea['body'][_0x1ff1('0x67')]=null;}if(_0x5d24ea[_0x1ff1('0x53')]&&_[_0x1ff1('0x66')](_0x5d24ea[_0x1ff1('0x53')])){for(var _0x4c263c=0x0;_0x4c263c<_0x5d24ea['body'][_0x1ff1('0x42')];_0x4c263c+=0x1){_0x5d24ea[_0x1ff1('0x53')][_0x4c263c][_0x1ff1('0x5d')]=_0x5d24ea[_0x1ff1('0x51')]['id'];_0x5b16c0['push'](_0x5d24ea[_0x1ff1('0x53')][_0x4c263c]);}return BPromise[_0x1ff1('0x68')](_0x5b16c0,function(_0x5e2b83){return db[_0x1ff1('0x69')][_0x1ff1('0x5f')](_[_0x1ff1('0x6a')](_0x5e2b83,[_0x1ff1('0x6b'),'id'])||{},{'fields':_[_0x1ff1('0x3d')](_0x31abfd),'raw':!![]})[_0x1ff1('0x2c')](function(_0x1bf728){_0x34fdad[_0x1ff1('0x6c')][_0x1ff1('0x6d')](_0x1bf728[_0x1ff1('0x6e')]);})[_0x1ff1('0x4f')](function(_0x241be2){_0x34fdad[_0x1ff1('0x6f')]['push']({'data':_0x5e2b83,'error':_0x241be2['message']});});})['then'](function(_0x5e8d07){return _0x34fdad;})[_0x1ff1('0x4f')](function(_0x5f22fb){return _0x5f22fb;});}else{_0x38022b[_0x1ff1('0x22')](0x190)['json']({'message':_0x1ff1('0x70')});}});}})[_0x1ff1('0x2c')](respondWithResult(_0x38022b,null))[_0x1ff1('0x4f')](handleError(_0x38022b,null));};exports['getContacts']=function(_0x42bb66,_0x2527a0,_0x3797a8){var _0x4d1999;return db[_0x1ff1('0x36')][_0x1ff1('0x52')]({'where':{'id':_0x42bb66[_0x1ff1('0x51')]['id']},'include':[{'model':db[_0x1ff1('0x71')],'as':'CustomFields'}]})[_0x1ff1('0x2c')](handleEntityNotFound(_0x2527a0,null))['then'](function(_0x52c867){if(_0x52c867){_0x4d1999=_0x52c867;return db[_0x1ff1('0x69')][_0x1ff1('0x37')];}})[_0x1ff1('0x2c')](function(_0x53f316){if(_0x53f316){var _0x54aef6={};var _0x23a161={};_0x23a161[_0x1ff1('0x3b')]=_[_0x1ff1('0x72')](_['keys'](_0x53f316),_['map'](_0x4d1999[_0x1ff1('0x73')],function(_0x1e9c6a){return util[_0x1ff1('0x74')](_0x1ff1('0x75'),_0x1e9c6a['id']);}));_0x23a161[_0x1ff1('0x3c')]=_[_0x1ff1('0x3d')](_0x42bb66[_0x1ff1('0x3c')]);_0x23a161[_0x1ff1('0x3e')]=_[_0x1ff1('0x3f')](_0x23a161[_0x1ff1('0x3b')],_0x23a161[_0x1ff1('0x3c')]);_0x54aef6['attributes']=_[_0x1ff1('0x3f')](_0x23a161['model'],qs[_0x1ff1('0x41')](_0x42bb66[_0x1ff1('0x3c')][_0x1ff1('0x41')]));_0x54aef6[_0x1ff1('0x40')]=_0x54aef6[_0x1ff1('0x40')][_0x1ff1('0x42')]?_0x54aef6[_0x1ff1('0x40')]:_0x23a161[_0x1ff1('0x3b')];if(!_0x42bb66[_0x1ff1('0x3c')][_0x1ff1('0x43')]('nolimit')){_0x54aef6['limit']=qs[_0x1ff1('0x24')](_0x42bb66[_0x1ff1('0x3c')][_0x1ff1('0x24')]);_0x54aef6['offset']=qs[_0x1ff1('0x23')](_0x42bb66[_0x1ff1('0x3c')]['offset']);}_0x54aef6[_0x1ff1('0x45')]=qs[_0x1ff1('0x62')](_0x42bb66[_0x1ff1('0x3c')][_0x1ff1('0x62')]);_0x54aef6[_0x1ff1('0x46')]=qs[_0x1ff1('0x3e')](_[_0x1ff1('0x47')](_0x42bb66[_0x1ff1('0x3c')],_0x23a161[_0x1ff1('0x3e')]));_0x54aef6[_0x1ff1('0x76')]=!![];if(_0x42bb66[_0x1ff1('0x3c')]['filter']){_0x54aef6['where']=_[_0x1ff1('0x49')](_0x54aef6[_0x1ff1('0x46')],{'$or':_[_0x1ff1('0x35')](_0x54aef6['attributes'],function(_0x95d8b4){var _0x191c61={};_0x191c61[_0x95d8b4]={'$like':'%'+_0x42bb66['query'][_0x1ff1('0x48')]+'%'};return _0x191c61;})});}_0x54aef6=_[_0x1ff1('0x49')]({},_0x54aef6,_0x42bb66[_0x1ff1('0x4b')]);return _0x4d1999[_0x1ff1('0x77')](_0x54aef6);}})[_0x1ff1('0x2c')](respondWithResult(_0x2527a0,null))[_0x1ff1('0x4f')](handleError(_0x2527a0,null));};exports['getContactsCsv']=function(_0x156301,_0x1181de,_0x76abdb){var _0x39e01a;return db[_0x1ff1('0x36')]['find']({'where':{'id':_0x156301[_0x1ff1('0x51')]['id']},'include':[{'model':db[_0x1ff1('0x71')],'as':_0x1ff1('0x73')}]})['then'](handleEntityNotFound(_0x1181de,null))[_0x1ff1('0x2c')](function(_0x200c12){if(_0x200c12){_0x39e01a=_0x200c12;return db['CmContact']['rawAttributes'];}})[_0x1ff1('0x2c')](function(_0x23e51c){if(_0x23e51c){var _0x525d25={};var _0x3c3fbc={};_0x3c3fbc[_0x1ff1('0x3b')]=_[_0x1ff1('0x72')](_[_0x1ff1('0x3d')](_0x23e51c),_['map'](_0x39e01a[_0x1ff1('0x73')],function(_0x50ba76){return util[_0x1ff1('0x74')]('cf_%d',_0x50ba76['id']);}));_0x3c3fbc[_0x1ff1('0x3c')]=_['keys'](_0x156301[_0x1ff1('0x3c')]);_0x3c3fbc['filters']=_[_0x1ff1('0x3f')](_0x3c3fbc[_0x1ff1('0x3b')],_0x3c3fbc['query']);_0x525d25[_0x1ff1('0x40')]=_[_0x1ff1('0x3f')](_0x3c3fbc[_0x1ff1('0x3b')],qs[_0x1ff1('0x41')](_0x156301['query'][_0x1ff1('0x41')]));_0x525d25['attributes']=_0x525d25['attributes'][_0x1ff1('0x42')]?_0x525d25[_0x1ff1('0x40')]:_0x3c3fbc[_0x1ff1('0x3b')];if(!_0x156301['query'][_0x1ff1('0x43')](_0x1ff1('0x44'))){_0x525d25['limit']=qs[_0x1ff1('0x24')](_0x156301[_0x1ff1('0x3c')][_0x1ff1('0x24')]);_0x525d25[_0x1ff1('0x23')]=qs[_0x1ff1('0x23')](_0x156301['query'][_0x1ff1('0x23')]);}_0x525d25[_0x1ff1('0x45')]=qs[_0x1ff1('0x62')](_0x156301['query']['sort']);_0x525d25['where']=qs[_0x1ff1('0x3e')](_[_0x1ff1('0x47')](_0x156301['query'],_0x3c3fbc['filters']));_0x525d25[_0x1ff1('0x76')]=!![];if(_0x156301['query'][_0x1ff1('0x48')]){_0x525d25[_0x1ff1('0x46')]=_[_0x1ff1('0x49')](_0x525d25[_0x1ff1('0x46')],{'$or':_[_0x1ff1('0x35')](_0x525d25['attributes'],function(_0x19abef){var _0x494f80={};_0x494f80[_0x19abef]={'$like':'%'+_0x156301['query'][_0x1ff1('0x48')]+'%'};return _0x494f80;})});}_0x525d25=_['merge']({},_0x525d25,_0x156301[_0x1ff1('0x4b')]);return _0x39e01a[_0x1ff1('0x77')](_0x525d25);}})[_0x1ff1('0x2c')](function(_0x314d54){if(!_[_0x1ff1('0x78')](_0x314d54)){var _0x3f0ecb=toCsv(_0x314d54);var _0x125119=Date['now']();fs[_0x1ff1('0x79')](util['format'](_0x1ff1('0x7a'),_0x39e01a['id'],_0x125119),_0x3f0ecb);_0x1181de[_0x1ff1('0x7b')](_0x1ff1('0x7c'),_0x1ff1('0x7d')+util['format'](_0x1ff1('0x7e'),_0x39e01a['id'],_0x125119));_0x1181de[_0x1ff1('0x7b')](_0x1ff1('0x7f'),'text/csv');return _0x1181de[_0x1ff1('0x80')](util[_0x1ff1('0x74')](_0x1ff1('0x7a'),_0x39e01a['id'],_0x125119));}else{return _0x1181de[_0x1ff1('0x21')](0xcc);}})[_0x1ff1('0x4f')](handleError(_0x1181de,null));};exports[_0x1ff1('0x81')]=function(_0x1a6854,_0x4c6fa9,_0x3677d8){var _0xf3803e;delete _0x1a6854['body']['id'];return db['CmList'][_0x1ff1('0x61')]({'where':{'id':_0x1a6854['params']['id']}})['then'](handleEntityNotFound(_0x4c6fa9,null))[_0x1ff1('0x2c')](function(_0x42f869){if(_0x42f869){return db['sequelize'][_0x1ff1('0x82')](function(_0x5a1d94){return db[_0x1ff1('0x71')]['create'](_0x1a6854['body'],{'transaction':_0x5a1d94})[_0x1ff1('0x2c')](function(_0x1cf399){_0xf3803e=_0x1cf399;return _0x42f869[_0x1ff1('0x83')](_0x1cf399,{'transaction':_0x5a1d94});})[_0x1ff1('0x2c')](function(){var _0x44d8c3={'type':db[_0x1ff1('0x84')][_0x1ff1('0x85')],'transaction':_0x5a1d94};switch(_0x1a6854[_0x1ff1('0x53')]['type']){case _0x1ff1('0x86'):_0x44d8c3[_0x1ff1('0x39')]=db['Sequelize'][_0x1ff1('0x85')];break;case'number':_0x44d8c3[_0x1ff1('0x39')]=db[_0x1ff1('0x84')][_0x1ff1('0x87')];break;case'switch':_0x44d8c3[_0x1ff1('0x39')]=db[_0x1ff1('0x84')][_0x1ff1('0x88')];_0x44d8c3[_0x1ff1('0x89')]=![];break;default:}return db[_0x1ff1('0x8a')][_0x1ff1('0x8b')][_0x1ff1('0x8c')](_0x1ff1('0x8d'),util[_0x1ff1('0x74')](_0x1ff1('0x8e'),_0xf3803e['id']),_0x44d8c3);})[_0x1ff1('0x2c')](function(){return _0xf3803e;});});}})['then'](respondWithResult(_0x4c6fa9,null))[_0x1ff1('0x4f')](handleError(_0x4c6fa9,null));};exports[_0x1ff1('0x8f')]=function(_0x3cbc60,_0x19279d,_0x9a10ef){var _0x41d61a={};var _0x5a95fd={};var _0x1a731e;var _0x502514;return db['CmList'][_0x1ff1('0x61')]({'where':{'id':_0x3cbc60[_0x1ff1('0x51')]['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x19279d,null))['then'](function(_0x5dc223){if(_0x5dc223){_0x1a731e=_0x5dc223;_0x5a95fd[_0x1ff1('0x3b')]=_[_0x1ff1('0x3d')](db[_0x1ff1('0x71')]['rawAttributes']);_0x5a95fd[_0x1ff1('0x3c')]=_[_0x1ff1('0x3d')](_0x3cbc60['query']);_0x5a95fd[_0x1ff1('0x3e')]=_['intersection'](_0x5a95fd['model'],_0x5a95fd[_0x1ff1('0x3c')]);_0x41d61a[_0x1ff1('0x40')]=_[_0x1ff1('0x3f')](_0x5a95fd[_0x1ff1('0x3b')],qs[_0x1ff1('0x41')](_0x3cbc60[_0x1ff1('0x3c')][_0x1ff1('0x41')]));_0x41d61a['attributes']=_0x41d61a[_0x1ff1('0x40')][_0x1ff1('0x42')]?_0x41d61a[_0x1ff1('0x40')]:_0x5a95fd['model'];_0x41d61a[_0x1ff1('0x45')]=qs[_0x1ff1('0x62')](_0x3cbc60['query']['sort']);_0x41d61a['where']=qs[_0x1ff1('0x3e')](_[_0x1ff1('0x47')](_0x3cbc60[_0x1ff1('0x3c')],_0x5a95fd[_0x1ff1('0x3e')]));_0x41d61a[_0x1ff1('0x46')]=_[_0x1ff1('0x49')](_0x41d61a[_0x1ff1('0x46')],{'$or':[{'ListId':_0x5dc223['id']},{'ListId':null}]});if(_0x3cbc60['query'][_0x1ff1('0x48')]){_0x41d61a[_0x1ff1('0x46')]=_[_0x1ff1('0x49')](_0x41d61a[_0x1ff1('0x46')],{'$or':_['map'](_0x41d61a[_0x1ff1('0x40')],function(_0x5e1d4d){var _0x2b8117={};_0x2b8117[_0x5e1d4d]={'$like':'%'+_0x3cbc60[_0x1ff1('0x3c')]['filter']+'%'};return _0x2b8117;})});}_0x41d61a=_[_0x1ff1('0x49')]({},_0x41d61a,_0x3cbc60[_0x1ff1('0x4b')]);return db[_0x1ff1('0x71')]['findAndCountAll'](_0x41d61a);}})[_0x1ff1('0x2c')](respondWithResult(_0x19279d,null))[_0x1ff1('0x4f')](handleError(_0x19279d,null));};exports[_0x1ff1('0x90')]=function(_0x38f95e,_0x54cb00,_0x915834){return db[_0x1ff1('0x36')][_0x1ff1('0x52')]({'where':{'id':_0x38f95e['params']['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x54cb00,null))['then'](function(_0x1547e1){if(_0x1547e1){return _0x1547e1['addAgents'](_0x38f95e['body'][_0x1ff1('0x6b')],_['omit'](_0x38f95e[_0x1ff1('0x53')],[_0x1ff1('0x6b'),'id'])||{})[_0x1ff1('0x91')](function(_0x44f8ae){for(var _0x33d175=0x0;_0x33d175<_0x38f95e[_0x1ff1('0x53')]['ids']['length'];_0x33d175+=0x1){socket[_0x1ff1('0x92')](_0x1ff1('0x93'),{'UserId':Number(_0x38f95e['body'][_0x1ff1('0x6b')][_0x33d175]),'CmListId':Number(_0x38f95e[_0x1ff1('0x51')]['id'])});}return _0x44f8ae;});}})[_0x1ff1('0x2c')](respondWithResult(_0x54cb00,null))[_0x1ff1('0x4f')](handleError(_0x54cb00,null));};exports[_0x1ff1('0x94')]=function(_0x2c6fa9,_0x2081f9,_0x2a2cee){return db[_0x1ff1('0x36')][_0x1ff1('0x52')]({'where':{'id':_0x2c6fa9[_0x1ff1('0x51')]['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x2081f9,null))[_0x1ff1('0x2c')](function(_0x54183c){if(_0x54183c){return _0x54183c[_0x1ff1('0x94')](_0x2c6fa9['query'][_0x1ff1('0x6b')])[_0x1ff1('0x2c')](function(){if(_[_0x1ff1('0x66')](_0x2c6fa9[_0x1ff1('0x3c')][_0x1ff1('0x6b')])){for(var _0x5278c1=0x0;_0x5278c1<_0x2c6fa9['query'][_0x1ff1('0x6b')]['length'];_0x5278c1+=0x1){socket[_0x1ff1('0x92')](_0x1ff1('0x95'),{'UserId':Number(_0x2c6fa9['query'][_0x1ff1('0x6b')][_0x5278c1]),'CmListId':Number(_0x2c6fa9[_0x1ff1('0x51')]['id'])});}}else{socket[_0x1ff1('0x92')](_0x1ff1('0x95'),{'UserId':Number(_0x2c6fa9['query'][_0x1ff1('0x6b')]),'CmListId':Number(_0x2c6fa9['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2081f9,null))[_0x1ff1('0x4f')](handleError(_0x2081f9,null));};exports[_0x1ff1('0x96')]=function(_0x5b467f,_0x710f56,_0x14ca2e){var _0x3701a6={};var _0x4a8e04={};var _0x195972;var _0xa9af90;return db[_0x1ff1('0x36')][_0x1ff1('0x61')]({'where':{'id':_0x5b467f['params']['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x710f56,null))[_0x1ff1('0x2c')](function(_0x2c1351){if(_0x2c1351){_0x195972=_0x2c1351;_0x4a8e04[_0x1ff1('0x3b')]=_[_0x1ff1('0x3d')](db[_0x1ff1('0x97')]['rawAttributes']);_0x4a8e04[_0x1ff1('0x3c')]=_['keys'](_0x5b467f[_0x1ff1('0x3c')]);_0x4a8e04[_0x1ff1('0x3e')]=_[_0x1ff1('0x3f')](_0x4a8e04['model'],_0x4a8e04[_0x1ff1('0x3c')]);_0x3701a6[_0x1ff1('0x40')]=_[_0x1ff1('0x3f')](_0x4a8e04[_0x1ff1('0x3b')],qs[_0x1ff1('0x41')](_0x5b467f['query']['fields']));_0x3701a6[_0x1ff1('0x40')]=_0x3701a6[_0x1ff1('0x40')][_0x1ff1('0x42')]?_0x3701a6['attributes']:_0x4a8e04[_0x1ff1('0x3b')];_0x3701a6[_0x1ff1('0x45')]=qs[_0x1ff1('0x62')](_0x5b467f[_0x1ff1('0x3c')][_0x1ff1('0x62')]);_0x3701a6['where']=qs[_0x1ff1('0x3e')](_[_0x1ff1('0x47')](_0x5b467f[_0x1ff1('0x3c')],_0x4a8e04['filters']));if(_0x5b467f[_0x1ff1('0x3c')][_0x1ff1('0x48')]){_0x3701a6[_0x1ff1('0x46')]=_['merge'](_0x3701a6[_0x1ff1('0x46')],{'$or':_['map'](_0x3701a6[_0x1ff1('0x40')],function(_0x15c348){var _0x45c935={};_0x45c935[_0x15c348]={'$like':'%'+_0x5b467f['query'][_0x1ff1('0x48')]+'%'};return _0x45c935;})});}_0x3701a6=_[_0x1ff1('0x49')]({},_0x3701a6,_0x5b467f[_0x1ff1('0x4b')]);return _0x195972[_0x1ff1('0x96')](_0x3701a6);}})['then'](function(_0x45bfe0){if(_0x45bfe0){_0xa9af90=_0x45bfe0['length'];if(!_0x5b467f[_0x1ff1('0x3c')][_0x1ff1('0x43')](_0x1ff1('0x44'))){_0x3701a6[_0x1ff1('0x24')]=qs[_0x1ff1('0x24')](_0x5b467f['query'][_0x1ff1('0x24')]);_0x3701a6[_0x1ff1('0x23')]=qs[_0x1ff1('0x23')](_0x5b467f[_0x1ff1('0x3c')][_0x1ff1('0x23')]);}return _0x195972[_0x1ff1('0x96')](_0x3701a6);}})['then'](function(_0x5f4175){if(_0x5f4175){return _0x5f4175?{'count':_0xa9af90,'rows':_0x5f4175}:null;}})[_0x1ff1('0x2c')](respondWithResult(_0x710f56,null))[_0x1ff1('0x4f')](handleError(_0x710f56,null));};
\ No newline at end of file
+var _0x0051=['set','Content-Range','reject','save','update','then','Lists','UserProfileResource','destroy','error','stack','name','send','map','CmList','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','catch','params','describe','addDisposition','ListId','getDispositions','findOne','pick','Disposition','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','each','success','push','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','nolimit','raw','getContactsCsv','concat','cf_%d','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','text','Sequelize','INTEGER','switch','queryInterface','addColumn','cm_contacts','findAndCountAll','addAgents','omit','spread','userCmList:save','removeAgents','emit','userCmList:remove','User','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./cmList.socket','register','sendStatus','status','end','undefined','count','offset'];(function(_0x1d1d23,_0x15bbea){var _0x91f3fa=function(_0x10db52){while(--_0x10db52){_0x1d1d23['push'](_0x1d1d23['shift']());}};_0x91f3fa(++_0x15bbea);}(_0x0051,0x6d));var _0x1005=function(_0x12a890,_0x4f3cb5){_0x12a890=_0x12a890-0x0;var _0x1a79ef=_0x0051[_0x12a890];return _0x1a79ef;};'use strict';var emlformat=require(_0x1005('0x0'));var rimraf=require(_0x1005('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1005('0x2'));var moment=require(_0x1005('0x3'));var BPromise=require(_0x1005('0x4'));var Mustache=require(_0x1005('0x5'));var util=require(_0x1005('0x6'));var path=require('path');var sox=require(_0x1005('0x7'));var csv=require(_0x1005('0x8'));var ejs=require(_0x1005('0x9'));var fs=require('fs');var fs_extra=require(_0x1005('0xa'));var _=require(_0x1005('0xb'));var squel=require(_0x1005('0xc'));var crypto=require(_0x1005('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1005('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1005('0xf'));var Redis=require(_0x1005('0x10'));var authService=require(_0x1005('0x11'));var qs=require(_0x1005('0x12'));var as=require(_0x1005('0x13'));var hardwareService=require(_0x1005('0x14'));var logger=require(_0x1005('0x15'))(_0x1005('0x16'));var utils=require(_0x1005('0x17'));var config=require(_0x1005('0x18'));var licenseUtil=require(_0x1005('0x19'));var db=require(_0x1005('0x1a'))['db'];config['redis']=_['defaults'](config[_0x1005('0x1b')],{'host':_0x1005('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1005('0x1b')]));require(_0x1005('0x1d'))[_0x1005('0x1e')](socket);function respondWithStatusCode(_0x65d4f9,_0x10b66b){_0x10b66b=_0x10b66b||0xcc;return function(_0x1cb8c6){if(_0x1cb8c6){return _0x65d4f9[_0x1005('0x1f')](_0x10b66b);}return _0x65d4f9[_0x1005('0x20')](_0x10b66b)[_0x1005('0x21')]();};}function respondWithResult(_0x303890,_0x56a753){_0x56a753=_0x56a753||0xc8;return function(_0xcafdcb){if(_0xcafdcb){return _0x303890[_0x1005('0x20')](_0x56a753)['json'](_0xcafdcb);}};}function respondWithFilteredResult(_0x47a545,_0x27a2c3){return function(_0x5e3732){if(_0x5e3732){var _0x193a3c=typeof _0x27a2c3['offset']==='undefined'&&typeof _0x27a2c3['limit']===_0x1005('0x22');var _0xad7330=_0x5e3732[_0x1005('0x23')];var _0x116548=_0x193a3c?0x0:_0x27a2c3[_0x1005('0x24')];var _0x31b880=_0x193a3c?_0x5e3732[_0x1005('0x23')]:_0x27a2c3['offset']+_0x27a2c3['limit'];var _0x3d7caa;if(_0x31b880>=_0xad7330){_0x31b880=_0xad7330;_0x3d7caa=0xc8;}else{_0x3d7caa=0xce;}_0x47a545[_0x1005('0x20')](_0x3d7caa);return _0x47a545[_0x1005('0x25')](_0x1005('0x26'),_0x116548+'-'+_0x31b880+'/'+_0xad7330)['json'](_0x5e3732);}return null;};}function patchUpdates(_0x35a30a){return function(_0xf61830){try{jsonpatch['apply'](_0xf61830,_0x35a30a,!![]);}catch(_0x4ad179){return BPromise[_0x1005('0x27')](_0x4ad179);}return _0xf61830[_0x1005('0x28')]();};}function saveUpdates(_0x34aaac,_0x3501d5){return function(_0x42f38d){if(_0x42f38d){return _0x42f38d[_0x1005('0x29')](_0x34aaac)[_0x1005('0x2a')](function(_0x2ee840){return _0x2ee840;});}return null;};}function removeEntity(_0xec4c12,_0x1393d8){return function(_0x487b2d){if(_0x487b2d){return _0x487b2d['destroy']()[_0x1005('0x2a')](function(){var _0x4a0a20=_0x487b2d['get']({'plain':!![]});var _0x3d531a=_0x1005('0x2b');return db[_0x1005('0x2c')][_0x1005('0x2d')]({'where':{'type':_0x3d531a,'resourceId':_0x4a0a20['id']}})[_0x1005('0x2a')](function(){return _0x487b2d;});})[_0x1005('0x2a')](function(){_0xec4c12[_0x1005('0x20')](0xcc)[_0x1005('0x21')]();});}};}function handleEntityNotFound(_0x96aa8,_0x23df46){return function(_0x1bf135){if(!_0x1bf135){_0x96aa8[_0x1005('0x1f')](0x194);}return _0x1bf135;};}function handleError(_0xb200ba,_0x116867){_0x116867=_0x116867||0x1f4;return function(_0x5c5397){logger[_0x1005('0x2e')](_0x5c5397[_0x1005('0x2f')]);if(_0x5c5397[_0x1005('0x30')]){delete _0x5c5397[_0x1005('0x30')];}_0xb200ba[_0x1005('0x20')](_0x116867)[_0x1005('0x31')](_0x5c5397);};}exports['index']=function(_0x2dc9e1,_0x3fba9e){var _0x2f7591={},_0xa0029f={},_0x56cc8f={'count':0x0,'rows':[]};var _0x489ca6=_[_0x1005('0x32')](db[_0x1005('0x33')][_0x1005('0x34')],function(_0x5b0037){return{'name':_0x5b0037[_0x1005('0x35')],'type':_0x5b0037[_0x1005('0x36')]['key']};});_0xa0029f[_0x1005('0x37')]=_[_0x1005('0x32')](_0x489ca6,_0x1005('0x30'));_0xa0029f[_0x1005('0x38')]=_[_0x1005('0x39')](_0x2dc9e1[_0x1005('0x38')]);_0xa0029f[_0x1005('0x3a')]=_[_0x1005('0x3b')](_0xa0029f[_0x1005('0x37')],_0xa0029f[_0x1005('0x38')]);_0x2f7591[_0x1005('0x3c')]=_['intersection'](_0xa0029f['model'],qs[_0x1005('0x3d')](_0x2dc9e1[_0x1005('0x38')][_0x1005('0x3d')]));_0x2f7591[_0x1005('0x3c')]=_0x2f7591[_0x1005('0x3c')][_0x1005('0x3e')]?_0x2f7591['attributes']:_0xa0029f[_0x1005('0x37')];if(!_0x2dc9e1['query'][_0x1005('0x3f')]('nolimit')){_0x2f7591[_0x1005('0x40')]=qs[_0x1005('0x40')](_0x2dc9e1['query']['limit']);_0x2f7591[_0x1005('0x24')]=qs['offset'](_0x2dc9e1[_0x1005('0x38')][_0x1005('0x24')]);}_0x2f7591[_0x1005('0x41')]=qs[_0x1005('0x42')](_0x2dc9e1[_0x1005('0x38')][_0x1005('0x42')]);_0x2f7591['where']=qs['filters'](_['pick'](_0x2dc9e1[_0x1005('0x38')],_0xa0029f[_0x1005('0x3a')]),_0x489ca6);if(_0x2dc9e1[_0x1005('0x38')][_0x1005('0x43')]){_0x2f7591[_0x1005('0x44')]=_[_0x1005('0x45')](_0x2f7591[_0x1005('0x44')],{'$or':_[_0x1005('0x32')](_0x489ca6,function(_0x512dc8){if(_0x512dc8[_0x1005('0x36')]!==_0x1005('0x46')){var _0x2c34d4={};_0x2c34d4[_0x512dc8['name']]={'$like':'%'+_0x2dc9e1['query']['filter']+'%'};return _0x2c34d4;}})});}_0x2f7591=_[_0x1005('0x45')]({},_0x2f7591,_0x2dc9e1[_0x1005('0x47')]);var _0x576864={'where':_0x2f7591['where']};return db[_0x1005('0x33')]['count'](_0x576864)[_0x1005('0x2a')](function(_0x2a0a11){_0x56cc8f[_0x1005('0x23')]=_0x2a0a11;if(_0x2dc9e1[_0x1005('0x38')][_0x1005('0x48')]){_0x2f7591[_0x1005('0x49')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x2f7591);})['then'](function(_0x96a15b){_0x56cc8f[_0x1005('0x4a')]=_0x96a15b;return _0x56cc8f;})['then'](respondWithFilteredResult(_0x3fba9e,_0x2f7591))['catch'](handleError(_0x3fba9e,null));};exports['show']=function(_0x1d3a4a,_0x384ca2){var _0xb5430c={'raw':![],'where':{'id':_0x1d3a4a['params']['id']}},_0x1801b5={};_0x1801b5['model']=_[_0x1005('0x39')](db['CmList'][_0x1005('0x34')]);_0x1801b5[_0x1005('0x38')]=_['keys'](_0x1d3a4a[_0x1005('0x38')]);_0x1801b5[_0x1005('0x3a')]=_[_0x1005('0x3b')](_0x1801b5[_0x1005('0x37')],_0x1801b5[_0x1005('0x38')]);_0xb5430c['attributes']=_[_0x1005('0x3b')](_0x1801b5[_0x1005('0x37')],qs[_0x1005('0x3d')](_0x1d3a4a[_0x1005('0x38')][_0x1005('0x3d')]));_0xb5430c[_0x1005('0x3c')]=_0xb5430c[_0x1005('0x3c')][_0x1005('0x3e')]?_0xb5430c[_0x1005('0x3c')]:_0x1801b5[_0x1005('0x37')];if(_0x1d3a4a[_0x1005('0x38')][_0x1005('0x48')]){_0xb5430c[_0x1005('0x49')]=[{'all':!![]}];}_0xb5430c=_[_0x1005('0x45')]({},_0xb5430c,_0x1d3a4a[_0x1005('0x47')]);return db[_0x1005('0x33')]['find'](_0xb5430c)[_0x1005('0x2a')](handleEntityNotFound(_0x384ca2,null))[_0x1005('0x2a')](respondWithResult(_0x384ca2,null))['catch'](handleError(_0x384ca2,null));};exports[_0x1005('0x4b')]=function(_0x5aa218,_0x8a6a1d){return db[_0x1005('0x33')][_0x1005('0x4b')](_0x5aa218['body'],{})[_0x1005('0x2a')](function(_0x3d20b2){var _0x374062=_0x5aa218[_0x1005('0x4c')][_0x1005('0x4d')]({'plain':!![]});if(!_0x374062)throw new Error(_0x1005('0x4e'));if(_0x374062[_0x1005('0x4f')]===_0x1005('0x4c')){var _0x1227d7=_0x3d20b2[_0x1005('0x4d')]({'plain':!![]});var _0x535ce6=_0x1005('0x2b');return db[_0x1005('0x50')][_0x1005('0x51')]({'where':{'name':_0x535ce6,'userProfileId':_0x374062[_0x1005('0x52')]},'raw':!![]})['then'](function(_0x445525){if(_0x445525&&_0x445525[_0x1005('0x53')]===0x0){return db[_0x1005('0x2c')]['create']({'name':_0x1227d7['name'],'resourceId':_0x1227d7['id'],'type':_0x445525[_0x1005('0x30')],'sectionId':_0x445525['id']},{})['then'](function(){return _0x3d20b2;});}else{return _0x3d20b2;}})['catch'](function(_0x1d6673){logger[_0x1005('0x2e')](_0x1005('0x54'),_0x1d6673);throw _0x1d6673;});}return _0x3d20b2;})[_0x1005('0x2a')](respondWithResult(_0x8a6a1d,0xc9))['catch'](handleError(_0x8a6a1d,null));};exports[_0x1005('0x29')]=function(_0x88b8d0,_0xc20622){if(_0x88b8d0['body']['id']){delete _0x88b8d0['body']['id'];}return db[_0x1005('0x33')][_0x1005('0x51')]({'where':{'id':_0x88b8d0['params']['id']}})[_0x1005('0x2a')](handleEntityNotFound(_0xc20622,null))[_0x1005('0x2a')](saveUpdates(_0x88b8d0[_0x1005('0x55')],null))[_0x1005('0x2a')](respondWithResult(_0xc20622,null))[_0x1005('0x56')](handleError(_0xc20622,null));};exports[_0x1005('0x2d')]=function(_0x5a6720,_0x270df7){return db[_0x1005('0x33')][_0x1005('0x51')]({'where':{'id':_0x5a6720[_0x1005('0x57')]['id']}})[_0x1005('0x2a')](handleEntityNotFound(_0x270df7,null))[_0x1005('0x2a')](removeEntity(_0x270df7,null))[_0x1005('0x56')](handleError(_0x270df7,null));};exports[_0x1005('0x58')]=function(_0x22beb6,_0x4f79c0){return db['CmList'][_0x1005('0x58')]()[_0x1005('0x2a')](respondWithResult(_0x4f79c0,null))[_0x1005('0x56')](handleError(_0x4f79c0,null));};exports[_0x1005('0x59')]=function(_0x299782,_0x24924f,_0x556348){if(_0x299782[_0x1005('0x55')]['id']){delete _0x299782[_0x1005('0x55')]['id'];}return db['CmList'][_0x1005('0x51')]({'where':{'id':_0x299782[_0x1005('0x57')]['id']}})[_0x1005('0x2a')](handleEntityNotFound(_0x24924f,null))[_0x1005('0x2a')](function(_0x176957){if(_0x176957){_0x299782[_0x1005('0x55')][_0x1005('0x5a')]=_0x176957['id'];return db['Disposition']['create'](_0x299782['body']);}})[_0x1005('0x2a')](respondWithResult(_0x24924f,null))[_0x1005('0x56')](handleError(_0x24924f,null));};exports[_0x1005('0x5b')]=function(_0x1edce0,_0xbf3f0f,_0xc0d4f8){var _0x30b7b7={'raw':![],'where':{}};var _0x2468b1={};var _0x53d3e5={'count':0x0,'rows':[]};return db[_0x1005('0x33')][_0x1005('0x5c')]({'where':{'id':_0x1edce0[_0x1005('0x57')]['id']}})[_0x1005('0x2a')](handleEntityNotFound(_0xbf3f0f,null))[_0x1005('0x2a')](function(_0x530cd4){if(_0x530cd4){_0x2468b1['model']=_[_0x1005('0x39')](db['Disposition'][_0x1005('0x34')]);_0x2468b1[_0x1005('0x38')]=_[_0x1005('0x39')](_0x1edce0[_0x1005('0x38')]);_0x2468b1[_0x1005('0x3a')]=_['intersection'](_0x2468b1[_0x1005('0x37')],_0x2468b1[_0x1005('0x38')]);_0x30b7b7['attributes']=_['intersection'](_0x2468b1[_0x1005('0x37')],qs[_0x1005('0x3d')](_0x1edce0['query'][_0x1005('0x3d')]));_0x30b7b7[_0x1005('0x3c')]=_0x30b7b7['attributes'][_0x1005('0x3e')]?_0x30b7b7['attributes']:_0x2468b1[_0x1005('0x37')];if(!_0x1edce0[_0x1005('0x38')][_0x1005('0x3f')]('nolimit')){_0x30b7b7[_0x1005('0x40')]=qs[_0x1005('0x40')](_0x1edce0[_0x1005('0x38')][_0x1005('0x40')]);_0x30b7b7['offset']=qs[_0x1005('0x24')](_0x1edce0[_0x1005('0x38')][_0x1005('0x24')]);}_0x30b7b7[_0x1005('0x41')]=qs['sort'](_0x1edce0['query'][_0x1005('0x42')]);_0x30b7b7['where']=qs['filters'](_[_0x1005('0x5d')](_0x1edce0[_0x1005('0x38')],_0x2468b1[_0x1005('0x3a')]));_0x30b7b7['where'][_0x1005('0x5a')]=_0x530cd4['id'];if(_0x1edce0['query']['filter']){_0x30b7b7[_0x1005('0x44')]=_[_0x1005('0x45')](_0x30b7b7['where'],{'$or':_[_0x1005('0x32')](_0x30b7b7[_0x1005('0x3c')],function(_0x2e56d5){var _0x4b7ae4={};_0x4b7ae4[_0x2e56d5]={'$like':'%'+_0x1edce0['query'][_0x1005('0x43')]+'%'};return _0x4b7ae4;})});}_0x30b7b7=_[_0x1005('0x45')]({},_0x30b7b7,_0x1edce0[_0x1005('0x47')]);return db[_0x1005('0x5e')][_0x1005('0x23')]({'where':_0x30b7b7[_0x1005('0x44')]})[_0x1005('0x2a')](function(_0x15bcc6){_0x53d3e5[_0x1005('0x23')]=_0x15bcc6;if(_0x1edce0['query'][_0x1005('0x48')]){_0x30b7b7[_0x1005('0x49')]=[{'all':!![]}];}return db[_0x1005('0x5e')][_0x1005('0x5f')](_0x30b7b7);})[_0x1005('0x2a')](function(_0x1b734c){_0x53d3e5[_0x1005('0x4a')]=_0x1b734c;return _0x53d3e5;});}})['then'](respondWithFilteredResult(_0xbf3f0f,_0x30b7b7))[_0x1005('0x56')](handleError(_0xbf3f0f,null));};exports[_0x1005('0x60')]=function(_0x4548c4,_0x46f265,_0x3d338a){return db[_0x1005('0x33')][_0x1005('0x51')]({'where':{'id':_0x4548c4[_0x1005('0x57')]['id']}})[_0x1005('0x2a')](handleEntityNotFound(_0x46f265,null))[_0x1005('0x2a')](function(_0x5f5551){if(_0x5f5551){return _0x5f5551[_0x1005('0x60')](_0x4548c4['query'][_0x1005('0x61')]);}})[_0x1005('0x2a')](respondWithStatusCode(_0x46f265,null))[_0x1005('0x56')](handleError(_0x46f265,null));};exports[_0x1005('0x62')]=function(_0x56f976,_0x2b3a61,_0x31d12a){return db[_0x1005('0x33')]['find']({'where':{'id':_0x56f976['params']['id']}})[_0x1005('0x2a')](handleEntityNotFound(_0x2b3a61,null))[_0x1005('0x2a')](function(_0x25f714){if(_0x25f714){var _0x1b0ee2=[];var _0x2fa7a7={'success':[],'errors':[]};return db[_0x1005('0x63')][_0x1005('0x58')]()['then'](function(_0x1c16e6){if(_0x56f976[_0x1005('0x55')][_0x1005('0x64')]&&_[_0x1005('0x65')](_0x56f976[_0x1005('0x55')][_0x1005('0x64')])){if(_0x56f976['body']['tags'][_0x1005('0x3e')]){_0x56f976[_0x1005('0x55')][_0x1005('0x64')]=_0x56f976[_0x1005('0x55')][_0x1005('0x64')][_0x1005('0x66')](';')+';';}else{_0x56f976[_0x1005('0x55')]['tags']=null;}}else{_0x56f976[_0x1005('0x55')]['tags']=null;}if(_0x56f976[_0x1005('0x55')]&&_[_0x1005('0x65')](_0x56f976[_0x1005('0x55')])){for(var _0x33f2a4=0x0;_0x33f2a4<_0x56f976[_0x1005('0x55')][_0x1005('0x3e')];_0x33f2a4+=0x1){_0x56f976[_0x1005('0x55')][_0x33f2a4][_0x1005('0x5a')]=_0x56f976[_0x1005('0x57')]['id'];_0x1b0ee2['push'](_0x56f976[_0x1005('0x55')][_0x33f2a4]);}return BPromise[_0x1005('0x67')](_0x1b0ee2,function(_0x254aef){return db[_0x1005('0x63')][_0x1005('0x4b')](_['omit'](_0x254aef,[_0x1005('0x61'),'id'])||{},{'fields':_[_0x1005('0x39')](_0x1c16e6),'raw':!![]})[_0x1005('0x2a')](function(_0x1d0f2c){_0x2fa7a7[_0x1005('0x68')][_0x1005('0x69')](_0x1d0f2c['dataValues']);})[_0x1005('0x56')](function(_0x5e4239){_0x2fa7a7[_0x1005('0x6a')]['push']({'data':_0x254aef,'error':_0x5e4239['message']});});})[_0x1005('0x2a')](function(_0x1e9543){return _0x2fa7a7;})[_0x1005('0x56')](function(_0x20d743){return _0x20d743;});}else{_0x2b3a61[_0x1005('0x20')](0x190)['json']({'message':_0x1005('0x6b')});}});}})[_0x1005('0x2a')](respondWithResult(_0x2b3a61,null))[_0x1005('0x56')](handleError(_0x2b3a61,null));};exports[_0x1005('0x6c')]=function(_0x2c2cf3,_0x577cd8,_0x5a42f7){var _0xc66947;return db[_0x1005('0x33')][_0x1005('0x51')]({'where':{'id':_0x2c2cf3[_0x1005('0x57')]['id']},'include':[{'model':db[_0x1005('0x6d')],'as':_0x1005('0x6e')}]})['then'](handleEntityNotFound(_0x577cd8,null))[_0x1005('0x2a')](function(_0x1567c6){if(_0x1567c6){_0xc66947=_0x1567c6;return db[_0x1005('0x63')]['rawAttributes'];}})[_0x1005('0x2a')](function(_0x1f1c89){if(_0x1f1c89){var _0x550931={};var _0x458d05={};_0x458d05[_0x1005('0x37')]=_['concat'](_[_0x1005('0x39')](_0x1f1c89),_[_0x1005('0x32')](_0xc66947['CustomFields'],function(_0x347f2f){return util[_0x1005('0x6f')]('cf_%d',_0x347f2f['id']);}));_0x458d05[_0x1005('0x38')]=_[_0x1005('0x39')](_0x2c2cf3['query']);_0x458d05[_0x1005('0x3a')]=_[_0x1005('0x3b')](_0x458d05[_0x1005('0x37')],_0x458d05[_0x1005('0x38')]);_0x550931[_0x1005('0x3c')]=_[_0x1005('0x3b')](_0x458d05[_0x1005('0x37')],qs[_0x1005('0x3d')](_0x2c2cf3[_0x1005('0x38')][_0x1005('0x3d')]));_0x550931[_0x1005('0x3c')]=_0x550931[_0x1005('0x3c')]['length']?_0x550931['attributes']:_0x458d05['model'];if(!_0x2c2cf3[_0x1005('0x38')][_0x1005('0x3f')](_0x1005('0x70'))){_0x550931[_0x1005('0x40')]=qs[_0x1005('0x40')](_0x2c2cf3['query'][_0x1005('0x40')]);_0x550931[_0x1005('0x24')]=qs[_0x1005('0x24')](_0x2c2cf3[_0x1005('0x38')][_0x1005('0x24')]);}_0x550931['order']=qs['sort'](_0x2c2cf3[_0x1005('0x38')][_0x1005('0x42')]);_0x550931[_0x1005('0x44')]=qs[_0x1005('0x3a')](_[_0x1005('0x5d')](_0x2c2cf3[_0x1005('0x38')],_0x458d05[_0x1005('0x3a')]));_0x550931[_0x1005('0x71')]=!![];if(_0x2c2cf3[_0x1005('0x38')][_0x1005('0x43')]){_0x550931[_0x1005('0x44')]=_[_0x1005('0x45')](_0x550931[_0x1005('0x44')],{'$or':_['map'](_0x550931[_0x1005('0x3c')],function(_0x15732b){var _0x291bc6={};_0x291bc6[_0x15732b]={'$like':'%'+_0x2c2cf3['query'][_0x1005('0x43')]+'%'};return _0x291bc6;})});}_0x550931=_['merge']({},_0x550931,_0x2c2cf3[_0x1005('0x47')]);return _0xc66947[_0x1005('0x6c')](_0x550931);}})[_0x1005('0x2a')](respondWithResult(_0x577cd8,null))['catch'](handleError(_0x577cd8,null));};exports[_0x1005('0x72')]=function(_0x565159,_0x3ae91e,_0x23a354){var _0x7a7040;return db[_0x1005('0x33')][_0x1005('0x51')]({'where':{'id':_0x565159[_0x1005('0x57')]['id']},'include':[{'model':db[_0x1005('0x6d')],'as':_0x1005('0x6e')}]})['then'](handleEntityNotFound(_0x3ae91e,null))[_0x1005('0x2a')](function(_0x58229f){if(_0x58229f){_0x7a7040=_0x58229f;return db['CmContact'][_0x1005('0x34')];}})['then'](function(_0x330e79){if(_0x330e79){var _0xb57d34={};var _0x5d7ab6={};_0x5d7ab6[_0x1005('0x37')]=_[_0x1005('0x73')](_[_0x1005('0x39')](_0x330e79),_[_0x1005('0x32')](_0x7a7040[_0x1005('0x6e')],function(_0x2cebd3){return util[_0x1005('0x6f')](_0x1005('0x74'),_0x2cebd3['id']);}));_0x5d7ab6[_0x1005('0x38')]=_[_0x1005('0x39')](_0x565159[_0x1005('0x38')]);_0x5d7ab6[_0x1005('0x3a')]=_[_0x1005('0x3b')](_0x5d7ab6[_0x1005('0x37')],_0x5d7ab6[_0x1005('0x38')]);_0xb57d34[_0x1005('0x3c')]=_['intersection'](_0x5d7ab6[_0x1005('0x37')],qs[_0x1005('0x3d')](_0x565159[_0x1005('0x38')][_0x1005('0x3d')]));_0xb57d34[_0x1005('0x3c')]=_0xb57d34[_0x1005('0x3c')][_0x1005('0x3e')]?_0xb57d34[_0x1005('0x3c')]:_0x5d7ab6[_0x1005('0x37')];if(!_0x565159[_0x1005('0x38')]['hasOwnProperty'](_0x1005('0x70'))){_0xb57d34[_0x1005('0x40')]=qs[_0x1005('0x40')](_0x565159[_0x1005('0x38')]['limit']);_0xb57d34['offset']=qs[_0x1005('0x24')](_0x565159[_0x1005('0x38')]['offset']);}_0xb57d34[_0x1005('0x41')]=qs['sort'](_0x565159[_0x1005('0x38')]['sort']);_0xb57d34['where']=qs[_0x1005('0x3a')](_['pick'](_0x565159[_0x1005('0x38')],_0x5d7ab6[_0x1005('0x3a')]));_0xb57d34['raw']=!![];if(_0x565159[_0x1005('0x38')][_0x1005('0x43')]){_0xb57d34[_0x1005('0x44')]=_['merge'](_0xb57d34[_0x1005('0x44')],{'$or':_['map'](_0xb57d34[_0x1005('0x3c')],function(_0x140e49){var _0x4cd0fb={};_0x4cd0fb[_0x140e49]={'$like':'%'+_0x565159[_0x1005('0x38')][_0x1005('0x43')]+'%'};return _0x4cd0fb;})});}_0xb57d34=_['merge']({},_0xb57d34,_0x565159[_0x1005('0x47')]);return _0x7a7040[_0x1005('0x6c')](_0xb57d34);}})[_0x1005('0x2a')](function(_0x1c71b1){if(!_['isEmpty'](_0x1c71b1)){var _0x27e69f=toCsv(_0x1c71b1);var _0x3b653e=Date[_0x1005('0x75')]();fs['writeFileSync'](util[_0x1005('0x6f')](_0x1005('0x76'),_0x7a7040['id'],_0x3b653e),_0x27e69f);_0x3ae91e[_0x1005('0x77')](_0x1005('0x78'),_0x1005('0x79')+util['format'](_0x1005('0x7a'),_0x7a7040['id'],_0x3b653e));_0x3ae91e[_0x1005('0x77')](_0x1005('0x7b'),_0x1005('0x7c'));return _0x3ae91e['download'](util['format'](_0x1005('0x76'),_0x7a7040['id'],_0x3b653e));}else{return _0x3ae91e['sendStatus'](0xcc);}})[_0x1005('0x56')](handleError(_0x3ae91e,null));};exports[_0x1005('0x7d')]=function(_0x5df1eb,_0x4e7413,_0x1eaab1){var _0x206283;delete _0x5df1eb[_0x1005('0x55')]['id'];return db[_0x1005('0x33')][_0x1005('0x5c')]({'where':{'id':_0x5df1eb[_0x1005('0x57')]['id']}})[_0x1005('0x2a')](handleEntityNotFound(_0x4e7413,null))[_0x1005('0x2a')](function(_0x4b266d){if(_0x4b266d){return db[_0x1005('0x7e')][_0x1005('0x7f')](function(_0x3fe401){return db[_0x1005('0x6d')][_0x1005('0x4b')](_0x5df1eb[_0x1005('0x55')],{'transaction':_0x3fe401})['then'](function(_0x51d1af){_0x206283=_0x51d1af;return _0x4b266d[_0x1005('0x80')](_0x51d1af,{'transaction':_0x3fe401});})[_0x1005('0x2a')](function(){var _0x5f53c4={'type':db['Sequelize']['TEXT'],'transaction':_0x3fe401};switch(_0x5df1eb[_0x1005('0x55')]['type']){case _0x1005('0x81'):_0x5f53c4[_0x1005('0x36')]=db[_0x1005('0x82')]['TEXT'];break;case'number':_0x5f53c4['type']=db[_0x1005('0x82')][_0x1005('0x83')];break;case _0x1005('0x84'):_0x5f53c4[_0x1005('0x36')]=db[_0x1005('0x82')]['BOOLEAN'];_0x5f53c4['defaultValue']=![];break;default:}return db[_0x1005('0x7e')][_0x1005('0x85')][_0x1005('0x86')](_0x1005('0x87'),util[_0x1005('0x6f')]('cf_%s',_0x206283['id']),_0x5f53c4);})['then'](function(){return _0x206283;});});}})[_0x1005('0x2a')](respondWithResult(_0x4e7413,null))[_0x1005('0x56')](handleError(_0x4e7413,null));};exports['getCustomFields']=function(_0x27ee22,_0xf732a3,_0x409898){var _0x4c30bc={};var _0x48d23f={};var _0x5ecdfa;var _0x1cb0a4;return db[_0x1005('0x33')][_0x1005('0x5c')]({'where':{'id':_0x27ee22['params']['id']}})[_0x1005('0x2a')](handleEntityNotFound(_0xf732a3,null))['then'](function(_0x3ae8b3){if(_0x3ae8b3){_0x5ecdfa=_0x3ae8b3;_0x48d23f['model']=_['keys'](db['CmCustomField'][_0x1005('0x34')]);_0x48d23f[_0x1005('0x38')]=_[_0x1005('0x39')](_0x27ee22['query']);_0x48d23f['filters']=_[_0x1005('0x3b')](_0x48d23f[_0x1005('0x37')],_0x48d23f[_0x1005('0x38')]);_0x4c30bc[_0x1005('0x3c')]=_[_0x1005('0x3b')](_0x48d23f[_0x1005('0x37')],qs[_0x1005('0x3d')](_0x27ee22['query'][_0x1005('0x3d')]));_0x4c30bc[_0x1005('0x3c')]=_0x4c30bc[_0x1005('0x3c')][_0x1005('0x3e')]?_0x4c30bc[_0x1005('0x3c')]:_0x48d23f[_0x1005('0x37')];_0x4c30bc[_0x1005('0x41')]=qs[_0x1005('0x42')](_0x27ee22[_0x1005('0x38')][_0x1005('0x42')]);_0x4c30bc[_0x1005('0x44')]=qs['filters'](_[_0x1005('0x5d')](_0x27ee22[_0x1005('0x38')],_0x48d23f[_0x1005('0x3a')]));_0x4c30bc[_0x1005('0x44')]=_[_0x1005('0x45')](_0x4c30bc[_0x1005('0x44')],{'$or':[{'ListId':_0x3ae8b3['id']},{'ListId':null}]});if(_0x27ee22['query'][_0x1005('0x43')]){_0x4c30bc[_0x1005('0x44')]=_['merge'](_0x4c30bc[_0x1005('0x44')],{'$or':_['map'](_0x4c30bc[_0x1005('0x3c')],function(_0xf8d5d3){var _0x11a74d={};_0x11a74d[_0xf8d5d3]={'$like':'%'+_0x27ee22[_0x1005('0x38')][_0x1005('0x43')]+'%'};return _0x11a74d;})});}_0x4c30bc=_[_0x1005('0x45')]({},_0x4c30bc,_0x27ee22['options']);return db['CmCustomField'][_0x1005('0x88')](_0x4c30bc);}})[_0x1005('0x2a')](respondWithResult(_0xf732a3,null))[_0x1005('0x56')](handleError(_0xf732a3,null));};exports[_0x1005('0x89')]=function(_0xa99e0a,_0x37aa6b,_0x26ca47){return db[_0x1005('0x33')][_0x1005('0x51')]({'where':{'id':_0xa99e0a[_0x1005('0x57')]['id']}})[_0x1005('0x2a')](handleEntityNotFound(_0x37aa6b,null))[_0x1005('0x2a')](function(_0x4c9d40){if(_0x4c9d40){return _0x4c9d40[_0x1005('0x89')](_0xa99e0a[_0x1005('0x55')]['ids'],_[_0x1005('0x8a')](_0xa99e0a['body'],['ids','id'])||{})[_0x1005('0x8b')](function(_0x4ff687){for(var _0x4b0d90=0x0;_0x4b0d90<_0xa99e0a[_0x1005('0x55')][_0x1005('0x61')][_0x1005('0x3e')];_0x4b0d90+=0x1){socket['emit'](_0x1005('0x8c'),{'UserId':Number(_0xa99e0a['body'][_0x1005('0x61')][_0x4b0d90]),'CmListId':Number(_0xa99e0a['params']['id'])});}return _0x4ff687;});}})['then'](respondWithResult(_0x37aa6b,null))[_0x1005('0x56')](handleError(_0x37aa6b,null));};exports[_0x1005('0x8d')]=function(_0x2e0dfd,_0x3b0f10,_0x36bfa5){return db[_0x1005('0x33')][_0x1005('0x51')]({'where':{'id':_0x2e0dfd[_0x1005('0x57')]['id']}})[_0x1005('0x2a')](handleEntityNotFound(_0x3b0f10,null))[_0x1005('0x2a')](function(_0x5d7d9e){if(_0x5d7d9e){return _0x5d7d9e[_0x1005('0x8d')](_0x2e0dfd[_0x1005('0x38')][_0x1005('0x61')])[_0x1005('0x2a')](function(){if(_[_0x1005('0x65')](_0x2e0dfd[_0x1005('0x38')][_0x1005('0x61')])){for(var _0x4f7832=0x0;_0x4f7832<_0x2e0dfd[_0x1005('0x38')][_0x1005('0x61')][_0x1005('0x3e')];_0x4f7832+=0x1){socket[_0x1005('0x8e')]('userCmList:remove',{'UserId':Number(_0x2e0dfd[_0x1005('0x38')][_0x1005('0x61')][_0x4f7832]),'CmListId':Number(_0x2e0dfd[_0x1005('0x57')]['id'])});}}else{socket['emit'](_0x1005('0x8f'),{'UserId':Number(_0x2e0dfd['query']['ids']),'CmListId':Number(_0x2e0dfd[_0x1005('0x57')]['id'])});}});}})[_0x1005('0x2a')](respondWithStatusCode(_0x3b0f10,null))[_0x1005('0x56')](handleError(_0x3b0f10,null));};exports['getAgents']=function(_0x1ee0d8,_0x2077c8,_0x1bfbfb){var _0x40bde5={};var _0x3a03dc={};var _0x4672f6;var _0x5702ce;return db['CmList']['findOne']({'where':{'id':_0x1ee0d8[_0x1005('0x57')]['id']}})[_0x1005('0x2a')](handleEntityNotFound(_0x2077c8,null))[_0x1005('0x2a')](function(_0x1098eb){if(_0x1098eb){_0x4672f6=_0x1098eb;_0x3a03dc[_0x1005('0x37')]=_['keys'](db[_0x1005('0x90')][_0x1005('0x34')]);_0x3a03dc[_0x1005('0x38')]=_[_0x1005('0x39')](_0x1ee0d8[_0x1005('0x38')]);_0x3a03dc[_0x1005('0x3a')]=_['intersection'](_0x3a03dc['model'],_0x3a03dc[_0x1005('0x38')]);_0x40bde5[_0x1005('0x3c')]=_[_0x1005('0x3b')](_0x3a03dc['model'],qs['fields'](_0x1ee0d8['query'][_0x1005('0x3d')]));_0x40bde5[_0x1005('0x3c')]=_0x40bde5[_0x1005('0x3c')][_0x1005('0x3e')]?_0x40bde5['attributes']:_0x3a03dc[_0x1005('0x37')];_0x40bde5[_0x1005('0x41')]=qs[_0x1005('0x42')](_0x1ee0d8['query'][_0x1005('0x42')]);_0x40bde5[_0x1005('0x44')]=qs[_0x1005('0x3a')](_[_0x1005('0x5d')](_0x1ee0d8[_0x1005('0x38')],_0x3a03dc[_0x1005('0x3a')]));if(_0x1ee0d8[_0x1005('0x38')][_0x1005('0x43')]){_0x40bde5[_0x1005('0x44')]=_[_0x1005('0x45')](_0x40bde5[_0x1005('0x44')],{'$or':_[_0x1005('0x32')](_0x40bde5[_0x1005('0x3c')],function(_0x3bce56){var _0x9ef7e5={};_0x9ef7e5[_0x3bce56]={'$like':'%'+_0x1ee0d8['query'][_0x1005('0x43')]+'%'};return _0x9ef7e5;})});}_0x40bde5=_[_0x1005('0x45')]({},_0x40bde5,_0x1ee0d8[_0x1005('0x47')]);return _0x4672f6[_0x1005('0x91')](_0x40bde5);}})[_0x1005('0x2a')](function(_0x2ab6a2){if(_0x2ab6a2){_0x5702ce=_0x2ab6a2[_0x1005('0x3e')];if(!_0x1ee0d8[_0x1005('0x38')]['hasOwnProperty'](_0x1005('0x70'))){_0x40bde5[_0x1005('0x40')]=qs[_0x1005('0x40')](_0x1ee0d8[_0x1005('0x38')][_0x1005('0x40')]);_0x40bde5[_0x1005('0x24')]=qs[_0x1005('0x24')](_0x1ee0d8['query'][_0x1005('0x24')]);}return _0x4672f6['getAgents'](_0x40bde5);}})['then'](function(_0x54749c){if(_0x54749c){return _0x54749c?{'count':_0x5702ce,'rows':_0x54749c}:null;}})[_0x1005('0x2a')](respondWithResult(_0x2077c8,null))['catch'](handleError(_0x2077c8,null));};
\ No newline at end of file
index cbb95d1..df2406d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x55ca,0x126));var _0xa55c=function(_0x1058ed,_0x109d8d){_0x1058ed=_0x1058ed-0x0;var _0x4e4661=_0x55ca[_0x1058ed];return _0x4e4661;};'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 _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7217,0x19e));var _0x7721=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x7217[_0x3ce3c];return _0x55a2c9;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents;
\ No newline at end of file
index 5626454..3666052 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee5b=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x4b748f,_0x241a76){var _0x4ece40=function(_0x5f0322){while(--_0x5f0322){_0x4b748f['push'](_0x4b748f['shift']());}};_0x4ece40(++_0x241a76);}(_0xee5b,0x1f4));var _0xbee5=function(_0x36ffb7,_0x16fd5f){_0x36ffb7=_0x36ffb7-0x0;var _0x4a9e52=_0xee5b[_0x36ffb7];return _0x4a9e52;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var fs=require('fs');var path=require(_0xbee5('0x5'));var rimraf=require(_0xbee5('0x6'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','CmList','cm_lists','lodash'];(function(_0x1f79d9,_0x30cad9){var _0x2ad71d=function(_0x317607){while(--_0x317607){_0x1f79d9['push'](_0x1f79d9['shift']());}};_0x2ad71d(++_0x30cad9);}(_0xdace,0xc5));var _0xedac=function(_0x37e886,_0x17d0ad){_0x37e886=_0x37e886-0x0;var _0x57c5cd=_0xdace[_0x37e886];return _0x57c5cd;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./cmList.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7cf303a..ca15be5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x021d=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x021d,0x123));var _0xd021=function(_0x17302d,_0x8e578f){_0x17302d=_0x17302d-0x0;var _0x5b2d94=_0x021d[_0x17302d];return _0x5b2d94;};'use strict';var _=require('lodash');var util=require(_0xd021('0x0'));var moment=require(_0xd021('0x1'));var BPromise=require(_0xd021('0x2'));var rs=require(_0xd021('0x3'));var fs=require('fs');var Redis=require(_0xd021('0x4'));var db=require(_0xd021('0x5'))['db'];var utils=require(_0xd021('0x6'));var logger=require(_0xd021('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd021('0x8'));var client=jayson[_0xd021('0x9')][_0xd021('0xa')]({'port':0x232a});config[_0xd021('0xb')]=_['defaults'](config[_0xd021('0xb')],{'host':_0xd021('0xc'),'port':0x18eb});var socket=require(_0xd021('0xd'))(new Redis(config[_0xd021('0xb')]));require(_0xd021('0xe'))[_0xd021('0xf')](socket);function respondWithRpcPromise(_0x314324,_0x441fda,_0x5cd03f){return new BPromise(function(_0x5222cd,_0x39cf6a){return client['request'](_0x314324,_0x5cd03f)['then'](function(_0x2d9bfb){logger['info'](_0xd021('0x10'),_0x441fda,'request\x20sent');logger[_0xd021('0x11')](_0xd021('0x12'),_0x441fda,_0xd021('0x13'),JSON[_0xd021('0x14')](_0x2d9bfb));if(_0x2d9bfb[_0xd021('0x15')]){if(_0x2d9bfb[_0xd021('0x15')][_0xd021('0x16')]===0x1f4){logger[_0xd021('0x15')]('CmList,\x20%s,\x20%s',_0x441fda,_0x2d9bfb[_0xd021('0x15')][_0xd021('0x17')]);return _0x39cf6a(_0x2d9bfb[_0xd021('0x15')][_0xd021('0x17')]);}logger[_0xd021('0x15')]('CmList,\x20%s,\x20%s',_0x441fda,_0x2d9bfb['error'][_0xd021('0x17')]);return _0x5222cd(_0x2d9bfb[_0xd021('0x15')][_0xd021('0x17')]);}else{logger['info'](_0xd021('0x10'),_0x441fda,_0xd021('0x13'));_0x5222cd(_0x2d9bfb[_0xd021('0x18')][_0xd021('0x17')]);}})[_0xd021('0x19')](function(_0x46edf3){logger[_0xd021('0x15')](_0xd021('0x10'),_0x441fda,_0x46edf3);_0x39cf6a(_0x46edf3);});});}
\ No newline at end of file
+var _0x443e=['CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','socket.io-emitter','request'];(function(_0x4e8e2d,_0x2fa2e1){var _0x4edb2b=function(_0x4ee291){while(--_0x4ee291){_0x4e8e2d['push'](_0x4e8e2d['shift']());}};_0x4edb2b(++_0x2fa2e1);}(_0x443e,0xe5));var _0xe443=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0x443e[_0x263b0e];return _0x113fee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe443('0x0'));var BPromise=require('bluebird');var rs=require(_0xe443('0x1'));var fs=require('fs');var Redis=require(_0xe443('0x2'));var db=require(_0xe443('0x3'))['db'];var utils=require(_0xe443('0x4'));var logger=require(_0xe443('0x5'))(_0xe443('0x6'));var config=require(_0xe443('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe443('0x8')]['http']({'port':0x232a});config['redis']=_[_0xe443('0x9')](config[_0xe443('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe443('0xb'))(new Redis(config[_0xe443('0xa')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x3792d4,_0x48c235,_0x3b3a6e){return new BPromise(function(_0x2b4390,_0x27fbfc){return client[_0xe443('0xc')](_0x3792d4,_0x3b3a6e)['then'](function(_0x3feced){logger['info'](_0xe443('0xd'),_0x48c235,_0xe443('0xe'));logger[_0xe443('0xf')](_0xe443('0x10'),_0x48c235,_0xe443('0xe'),JSON[_0xe443('0x11')](_0x3feced));if(_0x3feced['error']){if(_0x3feced[_0xe443('0x12')]['code']===0x1f4){logger[_0xe443('0x12')]('CmList,\x20%s,\x20%s',_0x48c235,_0x3feced['error'][_0xe443('0x13')]);return _0x27fbfc(_0x3feced[_0xe443('0x12')][_0xe443('0x13')]);}logger['error']('CmList,\x20%s,\x20%s',_0x48c235,_0x3feced[_0xe443('0x12')]['message']);return _0x2b4390(_0x3feced['error'][_0xe443('0x13')]);}else{logger[_0xe443('0x14')](_0xe443('0xd'),_0x48c235,_0xe443('0xe'));_0x2b4390(_0x3feced['result'][_0xe443('0x13')]);}})[_0xe443('0x15')](function(_0x5a596a){logger[_0xe443('0x12')](_0xe443('0xd'),_0x48c235,_0x5a596a);_0x27fbfc(_0x5a596a);});});}
\ No newline at end of file
index abc46eb..da6bce2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86cc=['removeListener','register','cmList:','./cmList.events','save','remove','update','emit'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x86cc,0x1e3));var _0xc86c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x86cc[_0x20a584];return _0x4b41a8;};'use strict';var CmListEvents=require(_0xc86c('0x0'));var events=[_0xc86c('0x1'),_0xc86c('0x2'),_0xc86c('0x3')];function createListener(_0x2b18f2,_0x14ee6a){return function(_0x46af04){_0x14ee6a[_0xc86c('0x4')](_0x2b18f2,_0x46af04);};}function removeListener(_0x70ca45,_0xec0a78){return function(){CmListEvents[_0xc86c('0x5')](_0x70ca45,_0xec0a78);};}exports[_0xc86c('0x6')]=function(_0x33a2d5){for(var _0x10faca=0x0,_0x10200a=events['length'];_0x10faca<_0x10200a;_0x10faca++){var _0x407b68=events[_0x10faca];var _0x55fbec=createListener(_0xc86c('0x7')+_0x407b68,_0x33a2d5);CmListEvents['on'](_0x407b68,_0x55fbec);}};
\ No newline at end of file
+var _0x24e1=['remove','removeListener','register','length','cmList:','./cmList.events','save'];(function(_0x27f092,_0x23be66){var _0x416405=function(_0x51e9de){while(--_0x51e9de){_0x27f092['push'](_0x27f092['shift']());}};_0x416405(++_0x23be66);}(_0x24e1,0xfa));var _0x124e=function(_0x4e938e,_0x37dba9){_0x4e938e=_0x4e938e-0x0;var _0x47aacf=_0x24e1[_0x4e938e];return _0x47aacf;};'use strict';var CmListEvents=require(_0x124e('0x0'));var events=[_0x124e('0x1'),_0x124e('0x2'),'update'];function createListener(_0x1fd5b5,_0x3ba815){return function(_0x507cbf){_0x3ba815['emit'](_0x1fd5b5,_0x507cbf);};}function removeListener(_0x2a02d0,_0x103eee){return function(){CmListEvents[_0x124e('0x3')](_0x2a02d0,_0x103eee);};}exports[_0x124e('0x4')]=function(_0x9be2db){for(var _0x253a59=0x0,_0x1c65cc=events[_0x124e('0x5')];_0x253a59<_0x1c65cc;_0x253a59++){var _0x468e5f=events[_0x253a59];var _0x559964=createListener(_0x124e('0x6')+_0x468e5f,_0x9be2db);CmListEvents['on'](_0x468e5f,_0x559964);}};
\ No newline at end of file
index d728e8b..8e9981a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65ff=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','put','/:id','destroy','delete','removeAgents'];(function(_0x3efc8a,_0x577444){var _0x288cda=function(_0x24adea){while(--_0x24adea){_0x3efc8a['push'](_0x3efc8a['shift']());}};_0x288cda(++_0x577444);}(_0x65ff,0x13c));var _0xf65f=function(_0x17a0a0,_0x1befaa){_0x17a0a0=_0x17a0a0-0x0;var _0x4da752=_0x65ff[_0x17a0a0];return _0x4da752;};'use strict';var multer=require(_0xf65f('0x0'));var util=require(_0xf65f('0x1'));var path=require(_0xf65f('0x2'));var timeout=require(_0xf65f('0x3'));var express=require(_0xf65f('0x4'));var router=express[_0xf65f('0x5')]();var fs_extra=require(_0xf65f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf65f('0x7'));var config=require(_0xf65f('0x8'));var controller=require(_0xf65f('0x9'));router[_0xf65f('0xa')]('/',auth[_0xf65f('0xb')](),controller['index']);router['get'](_0xf65f('0xc'),auth[_0xf65f('0xb')](),controller[_0xf65f('0xd')]);router['get']('/:id',auth[_0xf65f('0xb')](),controller[_0xf65f('0xe')]);router[_0xf65f('0xa')](_0xf65f('0xf'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x10')]);router['get'](_0xf65f('0x11'),auth['isAuthenticated'](),controller[_0xf65f('0x12')]);router[_0xf65f('0xa')](_0xf65f('0x13'),auth[_0xf65f('0xb')](),controller['getContactsCsv']);router[_0xf65f('0xa')](_0xf65f('0x14'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x15')]);router[_0xf65f('0xa')](_0xf65f('0x16'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x17')]);router[_0xf65f('0x18')]('/',auth[_0xf65f('0xb')](),controller[_0xf65f('0x19')]);router[_0xf65f('0x18')](_0xf65f('0xf'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x1a')]);router[_0xf65f('0x18')](_0xf65f('0x11'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x1b')]);router[_0xf65f('0x18')](_0xf65f('0x14'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x1c')]);router[_0xf65f('0x18')](_0xf65f('0x16'),auth[_0xf65f('0xb')](),controller['addAgents']);router[_0xf65f('0x1d')](_0xf65f('0x1e'),auth[_0xf65f('0xb')](),controller['update']);router['delete'](_0xf65f('0x1e'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x1f')]);router[_0xf65f('0x20')]('/:id/dispositions',auth[_0xf65f('0xb')](),controller['removeDispositions']);router[_0xf65f('0x20')](_0xf65f('0x16'),auth['isAuthenticated'](),controller[_0xf65f('0x21')]);module[_0xf65f('0x22')]=router;
\ No newline at end of file
+var _0x65a0=['/:id/users','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','create','post','/:id/dispositions','addDisposition','addCustomField','addAgents','put','update','delete','destroy','removeDispositions'];(function(_0x454d76,_0x146a05){var _0x9759c4=function(_0x53a614){while(--_0x53a614){_0x454d76['push'](_0x454d76['shift']());}};_0x9759c4(++_0x146a05);}(_0x65a0,0x89));var _0x065a=function(_0x2a7887,_0x51098e){_0x2a7887=_0x2a7887-0x0;var _0x1ebb95=_0x65a0[_0x2a7887];return _0x1ebb95;};'use strict';var multer=require(_0x065a('0x0'));var util=require(_0x065a('0x1'));var path=require('path');var timeout=require(_0x065a('0x2'));var express=require(_0x065a('0x3'));var router=express[_0x065a('0x4')]();var fs_extra=require(_0x065a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x065a('0x6'));var config=require('../../config/environment');var controller=require(_0x065a('0x7'));router[_0x065a('0x8')]('/',auth[_0x065a('0x9')](),controller[_0x065a('0xa')]);router[_0x065a('0x8')](_0x065a('0xb'),auth['isAuthenticated'](),controller[_0x065a('0xc')]);router[_0x065a('0x8')](_0x065a('0xd'),auth[_0x065a('0x9')](),controller['show']);router[_0x065a('0x8')]('/:id/dispositions',auth[_0x065a('0x9')](),controller[_0x065a('0xe')]);router['get'](_0x065a('0xf'),auth['isAuthenticated'](),controller[_0x065a('0x10')]);router['get'](_0x065a('0x11'),auth[_0x065a('0x9')](),controller[_0x065a('0x12')]);router[_0x065a('0x8')](_0x065a('0x13'),auth[_0x065a('0x9')](),controller[_0x065a('0x14')]);router[_0x065a('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x065a('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x065a('0x16')]);router[_0x065a('0x17')](_0x065a('0x18'),auth[_0x065a('0x9')](),controller[_0x065a('0x19')]);router[_0x065a('0x17')](_0x065a('0xf'),auth['isAuthenticated'](),controller['addContacts']);router[_0x065a('0x17')]('/:id/fields',auth[_0x065a('0x9')](),controller[_0x065a('0x1a')]);router[_0x065a('0x17')]('/:id/users',auth[_0x065a('0x9')](),controller[_0x065a('0x1b')]);router[_0x065a('0x1c')](_0x065a('0xd'),auth['isAuthenticated'](),controller[_0x065a('0x1d')]);router[_0x065a('0x1e')](_0x065a('0xd'),auth[_0x065a('0x9')](),controller[_0x065a('0x1f')]);router[_0x065a('0x1e')](_0x065a('0x18'),auth['isAuthenticated'](),controller[_0x065a('0x20')]);router[_0x065a('0x1e')](_0x065a('0x21'),auth[_0x065a('0x9')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index a419146..8eba8b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbad=['field','STRING','exports'];(function(_0x3fc6e3,_0x1dcd17){var _0x581f41=function(_0x3d257a){while(--_0x3d257a){_0x3fc6e3['push'](_0x3fc6e3['shift']());}};_0x581f41(++_0x1dcd17);}(_0xdbad,0x140));var _0xddba=function(_0x34f546,_0x2434c2){_0x34f546=_0x34f546-0x0;var _0x4ef07e=_0xdbad[_0x34f546];return _0x4ef07e;};'use strict';var Sequelize=require('sequelize');module[_0xddba('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5d549e){return this['getDataValue'](_0xddba('0x1'));}},'field':{'type':Sequelize[_0xddba('0x2')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xddba('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x4fd2=['STRING','getDataValue','field'];(function(_0x5debd6,_0x554e98){var _0x458cb2=function(_0x2f64ee){while(--_0x2f64ee){_0x5debd6['push'](_0x5debd6['shift']());}};_0x458cb2(++_0x554e98);}(_0x4fd2,0x13f));var _0x24fd=function(_0x5b1e33,_0x29c73c){_0x5b1e33=_0x5b1e33-0x0;var _0x30d2a2=_0x4fd2[_0x5b1e33];return _0x30d2a2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3cd530){return this[_0x24fd('0x0')](_0x24fd('0x1'));}},'field':{'type':Sequelize[_0x24fd('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0x24fd('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x24fd('0x2')],'allowNull':![]}};
\ No newline at end of file
index 9f75008..6b58e44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x4af14c,_0x3f3e1f){var _0x1b38e3=function(_0xb4fda5){while(--_0xb4fda5){_0x4af14c['push'](_0x4af14c['shift']());}};_0x1b38e3(++_0x3f3e1f);}(_0x7a54,0x106));var _0x47a5=function(_0x10dd42,_0x215843){_0x10dd42=_0x10dd42-0x0;var _0x4fa741=_0x7a54[_0x10dd42];return _0x4fa741;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
+var _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(_0x503339,_0x5d6e44){var _0x40699b=function(_0x2ab94b){while(--_0x2ab94b){_0x503339['push'](_0x503339['shift']());}};_0x40699b(++_0x5d6e44);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
index 6902f44..47ea05c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x770d=['bluebird','request-promise','rimraf','./condition.attributes','exports','define','tools_conditions','lodash','util','../../config/logger','api','moment'];(function(_0x574c8f,_0x4051da){var _0x4de3c4=function(_0x586cbb){while(--_0x586cbb){_0x574c8f['push'](_0x574c8f['shift']());}};_0x4de3c4(++_0x4051da);}(_0x770d,0x73));var _0xd770=function(_0x59ac90,_0x2ff46b){_0x59ac90=_0x59ac90-0x0;var _0x304731=_0x770d[_0x59ac90];return _0x304731;};'use strict';var _=require(_0xd770('0x0'));var util=require(_0xd770('0x1'));var logger=require(_0xd770('0x2'))(_0xd770('0x3'));var moment=require(_0xd770('0x4'));var BPromise=require(_0xd770('0x5'));var rp=require(_0xd770('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd770('0x7'));var config=require('../../config/environment');var attributes=require(_0xd770('0x8'));module[_0xd770('0x9')]=function(_0x1e0680,_0x4c865b){return _0x1e0680[_0xd770('0xa')]('Condition',attributes,{'tableName':_0xd770('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa92d=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','tools_conditions'];(function(_0x5e3564,_0x5e0b3b){var _0x27f493=function(_0x185bbb){while(--_0x185bbb){_0x5e3564['push'](_0x5e3564['shift']());}};_0x27f493(++_0x5e0b3b);}(_0xa92d,0xcf));var _0xda92=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xa92d[_0x220f3f];return _0x1f170e;};'use strict';var _=require('lodash');var util=require(_0xda92('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xda92('0x1'));var BPromise=require(_0xda92('0x2'));var rp=require(_0xda92('0x3'));var fs=require('fs');var path=require(_0xda92('0x4'));var rimraf=require(_0xda92('0x5'));var config=require(_0xda92('0x6'));var attributes=require(_0xda92('0x7'));module['exports']=function(_0x277c82,_0x16614d){return _0x277c82['define']('Condition',attributes,{'tableName':_0xda92('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a5574b4..923d8c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x547c=['request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','Condition,\x20%s,\x20%s'];(function(_0x5ebea0,_0x590dfd){var _0x32434a=function(_0x12a3ca){while(--_0x12a3ca){_0x5ebea0['push'](_0x5ebea0['shift']());}};_0x32434a(++_0x590dfd);}(_0x547c,0x10b));var _0xc547=function(_0x321d21,_0x3854e7){_0x321d21=_0x321d21-0x0;var _0x460606=_0x547c[_0x321d21];return _0x460606;};'use strict';var _=require('lodash');var util=require(_0xc547('0x0'));var moment=require(_0xc547('0x1'));var BPromise=require(_0xc547('0x2'));var rs=require(_0xc547('0x3'));var fs=require('fs');var Redis=require(_0xc547('0x4'));var db=require(_0xc547('0x5'))['db'];var utils=require(_0xc547('0x6'));var logger=require('../../config/logger')(_0xc547('0x7'));var config=require(_0xc547('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc547('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f33f1,_0x52a74c,_0x54313e){return new BPromise(function(_0x22e300,_0x5b17f0){return client[_0xc547('0xa')](_0x3f33f1,_0x54313e)['then'](function(_0x183567){logger[_0xc547('0xb')](_0xc547('0xc'),_0x52a74c,_0xc547('0xd'));logger[_0xc547('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x52a74c,'request\x20sent',JSON[_0xc547('0xf')](_0x183567));if(_0x183567[_0xc547('0x10')]){if(_0x183567[_0xc547('0x10')][_0xc547('0x11')]===0x1f4){logger[_0xc547('0x10')]('Condition,\x20%s,\x20%s',_0x52a74c,_0x183567[_0xc547('0x10')]['message']);return _0x5b17f0(_0x183567[_0xc547('0x10')]['message']);}logger[_0xc547('0x10')](_0xc547('0xc'),_0x52a74c,_0x183567['error'][_0xc547('0x12')]);return _0x22e300(_0x183567[_0xc547('0x10')][_0xc547('0x12')]);}else{logger[_0xc547('0xb')](_0xc547('0xc'),_0x52a74c,_0xc547('0xd'));_0x22e300(_0x183567['result'][_0xc547('0x12')]);}})[_0xc547('0x13')](function(_0x574046){logger[_0xc547('0x10')]('Condition,\x20%s,\x20%s',_0x52a74c,_0x574046);_0x5b17f0(_0x574046);});});}
\ No newline at end of file
+var _0x055a=['bluebird','randomstring','../../mysqldb','../../config/utils','client','request','then','info','Condition,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x5ad568,_0x3651cb){var _0x54097d=function(_0x357b68){while(--_0x357b68){_0x5ad568['push'](_0x5ad568['shift']());}};_0x54097d(++_0x3651cb);}(_0x055a,0x1b5));var _0xa055=function(_0x2fff28,_0x540e58){_0x2fff28=_0x2fff28-0x0;var _0x1f68b9=_0x055a[_0x2fff28];return _0x1f68b9;};'use strict';var _=require(_0xa055('0x0'));var util=require(_0xa055('0x1'));var moment=require(_0xa055('0x2'));var BPromise=require(_0xa055('0x3'));var rs=require(_0xa055('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa055('0x5'))['db'];var utils=require(_0xa055('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa055('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x241e36,_0x408912,_0x21f5db){return new BPromise(function(_0x2e8bf9,_0x590be7){return client[_0xa055('0x8')](_0x241e36,_0x21f5db)[_0xa055('0x9')](function(_0x1f0fd4){logger[_0xa055('0xa')](_0xa055('0xb'),_0x408912,'request\x20sent');logger[_0xa055('0xc')]('Condition,\x20%s,\x20%s,\x20%s',_0x408912,_0xa055('0xd'),JSON[_0xa055('0xe')](_0x1f0fd4));if(_0x1f0fd4[_0xa055('0xf')]){if(_0x1f0fd4[_0xa055('0xf')][_0xa055('0x10')]===0x1f4){logger[_0xa055('0xf')]('Condition,\x20%s,\x20%s',_0x408912,_0x1f0fd4[_0xa055('0xf')][_0xa055('0x11')]);return _0x590be7(_0x1f0fd4[_0xa055('0xf')]['message']);}logger['error'](_0xa055('0xb'),_0x408912,_0x1f0fd4[_0xa055('0xf')][_0xa055('0x11')]);return _0x2e8bf9(_0x1f0fd4[_0xa055('0xf')]['message']);}else{logger[_0xa055('0xa')]('Condition,\x20%s,\x20%s',_0x408912,_0xa055('0xd'));_0x2e8bf9(_0x1f0fd4[_0xa055('0x12')]['message']);}})[_0xa055('0x13')](function(_0x39d462){logger['error']('Condition,\x20%s,\x20%s',_0x408912,_0x39d462);_0x590be7(_0x39d462);});});}
\ No newline at end of file
index e81d9b3..a0509ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x370f=['fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','multer','util','path','connect-timeout','express'];(function(_0x1a72b8,_0x1e4f4b){var _0x39f72d=function(_0x35aef1){while(--_0x35aef1){_0x1a72b8['push'](_0x1a72b8['shift']());}};_0x39f72d(++_0x1e4f4b);}(_0x370f,0x1e9));var _0xf370=function(_0x2394ca,_0x238f6b){_0x2394ca=_0x2394ca-0x0;var _0x138889=_0x370f[_0x2394ca];return _0x138889;};'use strict';var multer=require(_0xf370('0x0'));var util=require(_0xf370('0x1'));var path=require(_0xf370('0x2'));var timeout=require(_0xf370('0x3'));var express=require(_0xf370('0x4'));var router=express['Router']();var fs_extra=require(_0xf370('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf370('0x6'));var config=require(_0xf370('0x7'));var controller=require(_0xf370('0x8'));router['put'](_0xf370('0x9'),auth[_0xf370('0xa')](),controller[_0xf370('0xb')]);router[_0xf370('0xc')](_0xf370('0x9'),auth[_0xf370('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5298=['update','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./condition.controller','isAuthenticated'];(function(_0x16f4e8,_0x47790b){var _0x498197=function(_0x2f120b){while(--_0x2f120b){_0x16f4e8['push'](_0x16f4e8['shift']());}};_0x498197(++_0x47790b);}(_0x5298,0x163));var _0x8529=function(_0x310763,_0x21997b){_0x310763=_0x310763-0x0;var _0x3ba2d9=_0x5298[_0x310763];return _0x3ba2d9;};'use strict';var multer=require(_0x8529('0x0'));var util=require(_0x8529('0x1'));var path=require(_0x8529('0x2'));var timeout=require(_0x8529('0x3'));var express=require('express');var router=express[_0x8529('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8529('0x5'));var interaction=require(_0x8529('0x6'));var config=require('../../config/environment');var controller=require(_0x8529('0x7'));router['put']('/:id',auth[_0x8529('0x8')](),controller[_0x8529('0x9')]);router['delete'](_0x8529('0xa'),auth[_0x8529('0x8')](),controller[_0x8529('0xb')]);module[_0x8529('0xc')]=router;
\ No newline at end of file
index 0189fcd..c32921d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['STRING','sequelize'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xb7e7[_0x3ea913];return _0x2b4f28;};'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 _0x757a=['exports','STRING'];(function(_0x509d40,_0x3fd560){var _0x3aab9a=function(_0x471b6a){while(--_0x471b6a){_0x509d40['push'](_0x509d40['shift']());}};_0x3aab9a(++_0x3fd560);}(_0x757a,0xde));var _0xa757=function(_0xfd126a,_0x3f0e7d){_0xfd126a=_0xfd126a-0x0;var _0x3656f2=_0x757a[_0xfd126a];return _0x3656f2;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index e6f0e1c..daf4b8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3517=['attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','total','attrVoiceQueues','multibar-chart','pie-chart'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x3517,0xfd));var _0x7351=function(_0x92c933,_0x155cc9){_0x92c933=_0x92c933-0x0;var _0x5e47c3=_0x3517[_0x92c933];return _0x5e47c3;};'use strict';var emlformat=require(_0x7351('0x0'));var rimraf=require(_0x7351('0x1'));var zipdir=require(_0x7351('0x2'));var jsonpatch=require(_0x7351('0x3'));var rp=require('request-promise');var moment=require(_0x7351('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7351('0x5'));var util=require('util');var path=require(_0x7351('0x6'));var sox=require(_0x7351('0x7'));var csv=require(_0x7351('0x8'));var ejs=require(_0x7351('0x9'));var fs=require('fs');var fs_extra=require(_0x7351('0xa'));var _=require(_0x7351('0xb'));var squel=require('squel');var crypto=require(_0x7351('0xc'));var jsforce=require(_0x7351('0xd'));var deskjs=require(_0x7351('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7351('0xf'));var Papa=require(_0x7351('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7351('0x11'));var as=require(_0x7351('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7351('0x13'))(_0x7351('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7351('0x15'));var db=require(_0x7351('0x16'))['db'];config[_0x7351('0x17')]=_[_0x7351('0x18')](config[_0x7351('0x17')],{'host':_0x7351('0x19'),'port':0x18eb});var socket=require(_0x7351('0x1a'))(new Redis(config[_0x7351('0x17')]));require(_0x7351('0x1b'))[_0x7351('0x1c')](socket);function respondWithStatusCode(_0x50db3d,_0x4f465e){_0x4f465e=_0x4f465e||0xcc;return function(_0x10eced){if(_0x10eced){return _0x50db3d[_0x7351('0x1d')](_0x4f465e);}return _0x50db3d[_0x7351('0x1e')](_0x4f465e)[_0x7351('0x1f')]();};}function respondWithResult(_0x5ceefd,_0x3c0ced){_0x3c0ced=_0x3c0ced||0xc8;return function(_0x1ba0cf){if(_0x1ba0cf){return _0x5ceefd[_0x7351('0x1e')](_0x3c0ced)[_0x7351('0x20')](_0x1ba0cf);}};}function respondWithFilteredResult(_0x2dd4b3,_0x2ff22c){return function(_0x94e913){if(_0x94e913){var _0x3931ea=typeof _0x2ff22c[_0x7351('0x21')]===_0x7351('0x22')&&typeof _0x2ff22c[_0x7351('0x23')]==='undefined';var _0xd41491=_0x94e913[_0x7351('0x24')];var _0x10c0d8=_0x3931ea?0x0:_0x2ff22c[_0x7351('0x21')];var _0x375906=_0x3931ea?_0x94e913[_0x7351('0x24')]:_0x2ff22c['offset']+_0x2ff22c[_0x7351('0x23')];var _0x397355;if(_0x375906>=_0xd41491){_0x375906=_0xd41491;_0x397355=0xc8;}else{_0x397355=0xce;}_0x2dd4b3[_0x7351('0x1e')](_0x397355);return _0x2dd4b3['set'](_0x7351('0x25'),_0x10c0d8+'-'+_0x375906+'/'+_0xd41491)[_0x7351('0x20')](_0x94e913);}return null;};}function patchUpdates(_0x2d7a56){return function(_0x3fbb1b){try{jsonpatch[_0x7351('0x26')](_0x3fbb1b,_0x2d7a56,!![]);}catch(_0x579ad2){return BPromise[_0x7351('0x27')](_0x579ad2);}return _0x3fbb1b[_0x7351('0x28')]();};}function saveUpdates(_0x2b6d5e,_0x86ef96){return function(_0x1a0784){if(_0x1a0784){return _0x1a0784[_0x7351('0x29')](_0x2b6d5e)['then'](function(_0x994fd4){return _0x994fd4;});}return null;};}function removeEntity(_0x2e10be,_0x3148db){return function(_0x2d4c8c){if(_0x2d4c8c){return _0x2d4c8c[_0x7351('0x2a')]()[_0x7351('0x2b')](function(){var _0x425234=_0x2d4c8c[_0x7351('0x2c')]({'plain':!![]});var _0x19b4c1=_0x7351('0x2d');return db[_0x7351('0x2e')][_0x7351('0x2a')]({'where':{'type':_0x19b4c1,'resourceId':_0x425234['id']}})[_0x7351('0x2b')](function(){return _0x2d4c8c;});})[_0x7351('0x2b')](function(){_0x2e10be[_0x7351('0x1e')](0xcc)[_0x7351('0x1f')]();});}};}function handleEntityNotFound(_0x50ad69,_0x52b303){return function(_0x3523d4){if(!_0x3523d4){_0x50ad69[_0x7351('0x1d')](0x194);}return _0x3523d4;};}function handleError(_0x1230a9,_0xcde56){_0xcde56=_0xcde56||0x1f4;return function(_0x77f121){logger[_0x7351('0x2f')](_0x77f121[_0x7351('0x30')]);if(_0x77f121[_0x7351('0x31')]){delete _0x77f121['name'];}_0x1230a9[_0x7351('0x1e')](_0xcde56)[_0x7351('0x32')](_0x77f121);};}exports[_0x7351('0x33')]=function(_0x412eda,_0x4ed82c){var _0x23fca8={},_0xd1b619={},_0x36fd4c={'count':0x0,'rows':[]};var _0x1a284d=_[_0x7351('0x34')](db[_0x7351('0x35')][_0x7351('0x36')],function(_0x33afca){return{'name':_0x33afca['fieldName'],'type':_0x33afca[_0x7351('0x37')][_0x7351('0x38')]};});_0xd1b619[_0x7351('0x39')]=_[_0x7351('0x34')](_0x1a284d,_0x7351('0x31'));_0xd1b619[_0x7351('0x3a')]=_['keys'](_0x412eda[_0x7351('0x3a')]);_0xd1b619['filters']=_[_0x7351('0x3b')](_0xd1b619['model'],_0xd1b619[_0x7351('0x3a')]);_0x23fca8[_0x7351('0x3c')]=_[_0x7351('0x3b')](_0xd1b619['model'],qs[_0x7351('0x3d')](_0x412eda['query']['fields']));_0x23fca8['attributes']=_0x23fca8[_0x7351('0x3c')][_0x7351('0x3e')]?_0x23fca8['attributes']:_0xd1b619[_0x7351('0x39')];if(!_0x412eda[_0x7351('0x3a')][_0x7351('0x3f')]('nolimit')){_0x23fca8[_0x7351('0x23')]=qs[_0x7351('0x23')](_0x412eda[_0x7351('0x3a')][_0x7351('0x23')]);_0x23fca8[_0x7351('0x21')]=qs['offset'](_0x412eda['query'][_0x7351('0x21')]);}_0x23fca8[_0x7351('0x40')]=qs[_0x7351('0x41')](_0x412eda[_0x7351('0x3a')][_0x7351('0x41')]);_0x23fca8[_0x7351('0x42')]=qs[_0x7351('0x43')](_[_0x7351('0x44')](_0x412eda[_0x7351('0x3a')],_0xd1b619[_0x7351('0x43')]),_0x1a284d);if(_0x412eda[_0x7351('0x3a')][_0x7351('0x45')]){_0x23fca8[_0x7351('0x42')]=_[_0x7351('0x46')](_0x23fca8[_0x7351('0x42')],{'$or':_[_0x7351('0x34')](_0x1a284d,function(_0x275ec5){if(_0x275ec5[_0x7351('0x37')]!==_0x7351('0x47')){var _0x119162={};_0x119162[_0x275ec5[_0x7351('0x31')]]={'$like':'%'+_0x412eda[_0x7351('0x3a')][_0x7351('0x45')]+'%'};return _0x119162;}})});}_0x23fca8=_[_0x7351('0x46')]({},_0x23fca8,_0x412eda[_0x7351('0x48')]);var _0x5651e3={'where':_0x23fca8[_0x7351('0x42')]};return db[_0x7351('0x35')][_0x7351('0x24')](_0x5651e3)[_0x7351('0x2b')](function(_0x58242f){_0x36fd4c[_0x7351('0x24')]=_0x58242f;if(_0x412eda['query'][_0x7351('0x49')]){_0x23fca8[_0x7351('0x4a')]=[{'all':!![]}];}return db[_0x7351('0x35')]['findAll'](_0x23fca8);})[_0x7351('0x2b')](function(_0x54229a){_0x36fd4c[_0x7351('0x4b')]=_0x54229a;return _0x36fd4c;})[_0x7351('0x2b')](respondWithFilteredResult(_0x4ed82c,_0x23fca8))[_0x7351('0x4c')](handleError(_0x4ed82c,null));};exports[_0x7351('0x4d')]=function(_0x2b7d97,_0x427d81){var _0xe5fc16={'raw':![],'where':{'id':_0x2b7d97[_0x7351('0x4e')]['id']}},_0x594b9a={};_0x594b9a[_0x7351('0x39')]=_[_0x7351('0x4f')](db[_0x7351('0x35')]['rawAttributes']);_0x594b9a[_0x7351('0x3a')]=_[_0x7351('0x4f')](_0x2b7d97['query']);_0x594b9a[_0x7351('0x43')]=_[_0x7351('0x3b')](_0x594b9a[_0x7351('0x39')],_0x594b9a['query']);_0xe5fc16[_0x7351('0x3c')]=_['intersection'](_0x594b9a[_0x7351('0x39')],qs[_0x7351('0x3d')](_0x2b7d97[_0x7351('0x3a')][_0x7351('0x3d')]));_0xe5fc16['attributes']=_0xe5fc16['attributes'][_0x7351('0x3e')]?_0xe5fc16['attributes']:_0x594b9a[_0x7351('0x39')];if(_0x2b7d97['query']['includeAll']){_0xe5fc16[_0x7351('0x4a')]=[{'all':!![]}];}_0xe5fc16=_[_0x7351('0x46')]({},_0xe5fc16,_0x2b7d97[_0x7351('0x48')]);return db[_0x7351('0x35')][_0x7351('0x50')](_0xe5fc16)[_0x7351('0x2b')](handleEntityNotFound(_0x427d81,null))[_0x7351('0x2b')](respondWithResult(_0x427d81,null))['catch'](handleError(_0x427d81,null));};exports[_0x7351('0x51')]=function(_0x3ad73c,_0x24f206){return db['Dashboard'][_0x7351('0x51')](_0x3ad73c[_0x7351('0x52')],{})[_0x7351('0x2b')](function(_0x53c2cc){var _0x4034f3=_0x3ad73c['user'][_0x7351('0x2c')]({'plain':!![]});if(!_0x4034f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4034f3[_0x7351('0x53')]==='user'){var _0x5a5e1c=_0x53c2cc[_0x7351('0x2c')]({'plain':!![]});var _0x223f96=_0x7351('0x2d');return db[_0x7351('0x54')][_0x7351('0x50')]({'where':{'name':_0x223f96,'userProfileId':_0x4034f3['userProfileId']},'raw':!![]})[_0x7351('0x2b')](function(_0x414798){if(_0x414798&&_0x414798['autoAssociation']===0x0){return db['UserProfileResource'][_0x7351('0x51')]({'name':_0x5a5e1c[_0x7351('0x31')],'resourceId':_0x5a5e1c['id'],'type':_0x414798[_0x7351('0x31')],'sectionId':_0x414798['id']},{})[_0x7351('0x2b')](function(){return _0x53c2cc;});}else{return _0x53c2cc;}})[_0x7351('0x4c')](function(_0x2f0c62){logger[_0x7351('0x2f')](_0x7351('0x55'),_0x2f0c62);throw _0x2f0c62;});}return _0x53c2cc;})['then'](respondWithResult(_0x24f206,0xc9))[_0x7351('0x4c')](handleError(_0x24f206,null));};exports[_0x7351('0x56')]=function(_0xef1c90,_0x213885){var _0x331ff7={'where':{'id':_0xef1c90[_0x7351('0x4e')]['id']}},_0x442f68={};_0x442f68[_0x7351('0x39')]=_[_0x7351('0x4f')](db[_0x7351('0x35')][_0x7351('0x36')]);_0x331ff7[_0x7351('0x3c')]=_[_0x7351('0x3b')](_0x442f68[_0x7351('0x39')],qs[_0x7351('0x3d')](_0xef1c90[_0x7351('0x3a')]['fields']));_0x331ff7['attributes']=_0x331ff7[_0x7351('0x3c')][_0x7351('0x3e')]?_0x331ff7[_0x7351('0x3c')]:_0x442f68[_0x7351('0x39')];if(_0xef1c90[_0x7351('0x3a')][_0x7351('0x49')]){_0x331ff7[_0x7351('0x4a')]=[{'all':!![]}];}_0x331ff7=_[_0x7351('0x46')]({},_0x331ff7,_0xef1c90[_0x7351('0x48')]);return db['Dashboard'][_0x7351('0x50')](_0x331ff7)['then'](handleEntityNotFound(_0x213885,null))[_0x7351('0x2b')](function(_0x4a30db){if(_0x4a30db){var _0x33890d=_0x4a30db[_0x7351('0x2c')]({'plain':!![]});_0x33890d=qs[_0x7351('0x57')](_0x33890d,['id',_0x7351('0x58'),_0x7351('0x59')]);_0xef1c90[_0x7351('0x52')]=_[_0x7351('0x57')](_0xef1c90[_0x7351('0x52')],['id',_0x7351('0x58'),_0x7351('0x59')]);return db[_0x7351('0x35')][_0x7351('0x51')](_[_0x7351('0x46')](_0x33890d,_0xef1c90['body']),{'include':_0xef1c90['query'][_0x7351('0x49')]?[{'all':!![]}]:undefined})[_0x7351('0x2b')](function(_0x250e2a){var _0x3ac01b=_0xef1c90['user'][_0x7351('0x2c')]({'plain':!![]});if(!_0x3ac01b)throw new Error(_0x7351('0x5a'));if(_0x3ac01b['role']==='user'){var _0x26cac2=_0x250e2a[_0x7351('0x2c')]({'plain':!![]});var _0x2b8139=_0x7351('0x2d');return db[_0x7351('0x54')][_0x7351('0x50')]({'where':{'name':_0x2b8139,'userProfileId':_0x3ac01b['userProfileId']},'raw':!![]})[_0x7351('0x2b')](function(_0x294d58){if(_0x294d58&&_0x294d58[_0x7351('0x5b')]===0x0){return db[_0x7351('0x2e')][_0x7351('0x51')]({'name':_0x26cac2[_0x7351('0x31')],'resourceId':_0x26cac2['id'],'type':_0x294d58[_0x7351('0x31')],'sectionId':_0x294d58['id']},{})[_0x7351('0x2b')](function(){return _0x250e2a;});}else{return _0x250e2a;}})[_0x7351('0x4c')](function(_0x568ec4){logger['error'](_0x7351('0x55'),_0x568ec4);throw _0x568ec4;});}return _0x250e2a;});}})[_0x7351('0x2b')](respondWithResult(_0x213885,0xc9))[_0x7351('0x4c')](handleError(_0x213885,null));};exports['update']=function(_0x3a2114,_0x4a74ae){if(_0x3a2114[_0x7351('0x52')]['id']){delete _0x3a2114[_0x7351('0x52')]['id'];}return db[_0x7351('0x35')]['find']({'where':{'id':_0x3a2114[_0x7351('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4a74ae,null))[_0x7351('0x2b')](saveUpdates(_0x3a2114[_0x7351('0x52')],null))[_0x7351('0x2b')](respondWithResult(_0x4a74ae,null))['catch'](handleError(_0x4a74ae,null));};exports[_0x7351('0x2a')]=function(_0x345b30,_0x131eaa){return db[_0x7351('0x35')][_0x7351('0x50')]({'where':{'id':_0x345b30[_0x7351('0x4e')]['id']}})['then'](handleEntityNotFound(_0x131eaa,null))[_0x7351('0x2b')](removeEntity(_0x131eaa,null))[_0x7351('0x4c')](handleError(_0x131eaa,null));};function widgetAttributes(_0x206019){try{switch(_0x206019[_0x7351('0x37')]){case _0x7351('0x5c'):return[{'name':_0x7351('0x5d'),'value':_0x206019[_0x7351('0x5d')]||(_0x206019['attrs']&&_0x206019[_0x7351('0x5e')][0x0]?_0x206019['attrs'][0x0][_0x7351('0x5f')]:undefined)||'https://'}];case _0x7351('0x60'):return[{'name':_0x7351('0x61'),'value':_0x206019['attrPath']||(_0x206019['attrs']&&_0x206019[_0x7351('0x5e')][0x0]?_0x206019[_0x7351('0x5e')][0x0][_0x7351('0x5f')]:undefined)||''}];case _0x7351('0x62'):return[{'name':_0x7351('0x63'),'value':_0x206019[_0x7351('0x63')]||(_0x206019['attrs']&&_0x206019[_0x7351('0x5e')][0x0]?_0x206019[_0x7351('0x5e')][0x0][_0x7351('0x5f')]:undefined)||'HH:mm:ss'},{'name':_0x7351('0x64'),'value':_0x206019[_0x7351('0x64')]||(_0x206019[_0x7351('0x5e')]&&_0x206019[_0x7351('0x5e')][0x1]?_0x206019[_0x7351('0x5e')][0x1]['value']:undefined)||_0x7351('0x65')},{'name':_0x7351('0x66'),'value':_0x206019[_0x7351('0x66')]||(_0x206019[_0x7351('0x5e')]&&_0x206019[_0x7351('0x5e')][0x2]?_0x206019[_0x7351('0x5e')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x206019['attrMetric']||(_0x206019[_0x7351('0x5e')]&&_0x206019['attrs'][0x0]?_0x206019[_0x7351('0x5e')][0x0]['value']:undefined)||_0x7351('0x67')},{'name':_0x7351('0x68'),'value':_0x206019[_0x7351('0x68')]||(_0x206019['attrs']&&_0x206019['attrs'][0x1]?_0x206019[_0x7351('0x5e')][0x1][_0x7351('0x5f')]:undefined)||[]},{'name':_0x7351('0x66'),'value':_0x206019['attrFontSize']||(_0x206019[_0x7351('0x5e')]&&_0x206019[_0x7351('0x5e')][0x2]?_0x206019[_0x7351('0x5e')][0x2][_0x7351('0x5f')]:undefined)||0x14}];case _0x7351('0x69'):case _0x7351('0x6a'):return[{'name':'attrSerie1','value':_0x206019['attrSerie1']||(_0x206019[_0x7351('0x5e')]&&_0x206019[_0x7351('0x5e')][0x0]?_0x206019[_0x7351('0x5e')][0x0][_0x7351('0x5f')]:undefined)||_0x7351('0x67')},{'name':_0x7351('0x6b'),'value':_0x206019[_0x7351('0x6b')]||(_0x206019['attrs']&&_0x206019['attrs'][0x1]?_0x206019['attrs'][0x1][_0x7351('0x5f')]:undefined)||null},{'name':_0x7351('0x6c'),'value':_0x206019[_0x7351('0x6c')]||(_0x206019['attrs']&&_0x206019[_0x7351('0x5e')][0x2]?_0x206019[_0x7351('0x5e')][0x2][_0x7351('0x5f')]:undefined)||null},{'name':_0x7351('0x68'),'value':_0x206019[_0x7351('0x68')]||(_0x206019[_0x7351('0x5e')]&&_0x206019['attrs'][0x3]?_0x206019[_0x7351('0x5e')][0x3][_0x7351('0x5f')]:undefined)||[]}];case _0x7351('0x6d'):return[{'name':_0x7351('0x6e'),'type':_0x206019['reportType']||(_0x206019[_0x7351('0x5e')]&&_0x206019[_0x7351('0x5e')][0x0]?_0x206019['attrs'][0x0][_0x7351('0x37')]:undefined)||null,'value':_0x206019[_0x7351('0x6e')]||(_0x206019[_0x7351('0x5e')]&&_0x206019[_0x7351('0x5e')][0x0]?_0x206019[_0x7351('0x5e')][0x0]['value']:undefined)||null},{'name':_0x7351('0x6f'),'value':_0x206019[_0x7351('0x6f')]||(_0x206019[_0x7351('0x5e')]&&_0x206019['attrs'][0x1]?_0x206019[_0x7351('0x5e')][0x1][_0x7351('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x3e1964){logger[_0x7351('0x2f')](_0x7351('0x70'),JSON[_0x7351('0x71')](_0x3e1964));return[];}}exports[_0x7351('0x72')]=function(_0x11f5f1,_0x4ec3b6,_0x16a5f0){if(_0x11f5f1[_0x7351('0x52')]['id']){delete _0x11f5f1[_0x7351('0x52')]['id'];}return db[_0x7351('0x35')][_0x7351('0x50')]({'where':{'id':_0x11f5f1[_0x7351('0x4e')]['id']}})[_0x7351('0x2b')](handleEntityNotFound(_0x4ec3b6,null))['then'](function(_0x69064){if(_0x69064){_0x11f5f1[_0x7351('0x52')][_0x7351('0x73')]=_0x69064['id'];_0x11f5f1[_0x7351('0x52')]['attrs']=widgetAttributes(_0x11f5f1['body']);return db[_0x7351('0x74')][_0x7351('0x51')](_0x11f5f1[_0x7351('0x52')]);}})[_0x7351('0x2b')](respondWithResult(_0x4ec3b6,null))['catch'](handleError(_0x4ec3b6,null));};exports[_0x7351('0x75')]=function(_0x4b2753,_0x4fa4dc,_0x31daee){var _0x223233={};var _0x5d29cb={};var _0xa61637;var _0x217d52;return db[_0x7351('0x35')][_0x7351('0x76')]({'where':{'id':_0x4b2753[_0x7351('0x4e')]['id']}})[_0x7351('0x2b')](handleEntityNotFound(_0x4fa4dc,null))['then'](function(_0x564bd6){if(_0x564bd6){_0xa61637=_0x564bd6;_0x5d29cb['model']=_[_0x7351('0x4f')](db['DashboardItem']['rawAttributes']);_0x5d29cb[_0x7351('0x3a')]=_['keys'](_0x4b2753[_0x7351('0x3a')]);_0x5d29cb['filters']=_[_0x7351('0x3b')](_0x5d29cb[_0x7351('0x39')],_0x5d29cb['query']);_0x223233[_0x7351('0x3c')]=_['intersection'](_0x5d29cb[_0x7351('0x39')],qs[_0x7351('0x3d')](_0x4b2753['query'][_0x7351('0x3d')]));_0x223233[_0x7351('0x3c')]=_0x223233[_0x7351('0x3c')][_0x7351('0x3e')]?_0x223233['attributes']:_0x5d29cb[_0x7351('0x39')];_0x223233[_0x7351('0x40')]=qs['sort'](_0x4b2753[_0x7351('0x3a')][_0x7351('0x41')]);_0x223233[_0x7351('0x42')]=qs[_0x7351('0x43')](_[_0x7351('0x44')](_0x4b2753['query'],_0x5d29cb[_0x7351('0x43')]));if(_0x4b2753[_0x7351('0x3a')][_0x7351('0x45')]){_0x223233[_0x7351('0x42')]=_[_0x7351('0x46')](_0x223233[_0x7351('0x42')],{'$or':_[_0x7351('0x34')](_0x223233[_0x7351('0x3c')],function(_0x1e260e){var _0x45789d={};_0x45789d[_0x1e260e]={'$like':'%'+_0x4b2753['query']['filter']+'%'};return _0x45789d;})});}_0x223233=_['merge']({},_0x223233,_0x4b2753[_0x7351('0x48')]);return _0xa61637[_0x7351('0x75')](_0x223233);}})[_0x7351('0x2b')](function(_0x234c97){if(_0x234c97){_0x217d52=_0x234c97[_0x7351('0x3e')];if(!_0x4b2753[_0x7351('0x3a')]['hasOwnProperty'](_0x7351('0x77'))){_0x223233[_0x7351('0x23')]=qs[_0x7351('0x23')](_0x4b2753[_0x7351('0x3a')][_0x7351('0x23')]);_0x223233[_0x7351('0x21')]=qs[_0x7351('0x21')](_0x4b2753[_0x7351('0x3a')][_0x7351('0x21')]);}return _0xa61637[_0x7351('0x75')](_0x223233);}})[_0x7351('0x2b')](function(_0x19feda){if(_0x19feda){return _0x19feda?{'count':_0x217d52,'rows':_0x19feda}:null;}})['then'](respondWithResult(_0x4fa4dc,null))[_0x7351('0x4c')](handleError(_0x4fa4dc,null));};
\ No newline at end of file
+var _0xa521=['../../mysqldb','redis','localhost','register','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','get','CustomDashboards','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','intersection','length','Dashboard','find','create','body','user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','iframe','attrs','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','value','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','getItems','findOne','DashboardItem','hasOwnProperty','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','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x12738d,_0x4e23bd){var _0x2400b8=function(_0x163695){while(--_0x163695){_0x12738d['push'](_0x12738d['shift']());}};_0x2400b8(++_0x4e23bd);}(_0xa521,0x65));var _0x1a52=function(_0x22a378,_0xfd8ae3){_0x22a378=_0x22a378-0x0;var _0x2ea5da=_0xa521[_0x22a378];return _0x2ea5da;};'use strict';var emlformat=require(_0x1a52('0x0'));var rimraf=require(_0x1a52('0x1'));var zipdir=require(_0x1a52('0x2'));var jsonpatch=require(_0x1a52('0x3'));var rp=require('request-promise');var moment=require(_0x1a52('0x4'));var BPromise=require(_0x1a52('0x5'));var Mustache=require(_0x1a52('0x6'));var util=require(_0x1a52('0x7'));var path=require(_0x1a52('0x8'));var sox=require(_0x1a52('0x9'));var csv=require(_0x1a52('0xa'));var ejs=require(_0x1a52('0xb'));var fs=require('fs');var fs_extra=require(_0x1a52('0xc'));var _=require(_0x1a52('0xd'));var squel=require(_0x1a52('0xe'));var crypto=require(_0x1a52('0xf'));var jsforce=require(_0x1a52('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a52('0x11'));var Redis=require(_0x1a52('0x12'));var authService=require(_0x1a52('0x13'));var qs=require(_0x1a52('0x14'));var as=require(_0x1a52('0x15'));var hardwareService=require(_0x1a52('0x16'));var logger=require('../../config/logger')(_0x1a52('0x17'));var utils=require(_0x1a52('0x18'));var config=require(_0x1a52('0x19'));var licenseUtil=require(_0x1a52('0x1a'));var db=require(_0x1a52('0x1b'))['db'];config[_0x1a52('0x1c')]=_['defaults'](config[_0x1a52('0x1c')],{'host':_0x1a52('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x1a52('0x1e')](socket);function respondWithStatusCode(_0x4b9696,_0x9fb4da){_0x9fb4da=_0x9fb4da||0xcc;return function(_0x14f980){if(_0x14f980){return _0x4b9696['sendStatus'](_0x9fb4da);}return _0x4b9696[_0x1a52('0x1f')](_0x9fb4da)[_0x1a52('0x20')]();};}function respondWithResult(_0x3f75f1,_0x1b46c4){_0x1b46c4=_0x1b46c4||0xc8;return function(_0x375d87){if(_0x375d87){return _0x3f75f1[_0x1a52('0x1f')](_0x1b46c4)[_0x1a52('0x21')](_0x375d87);}};}function respondWithFilteredResult(_0x3b0dcb,_0x5d1ab2){return function(_0x574bf6){if(_0x574bf6){var _0x10250d=typeof _0x5d1ab2['offset']===_0x1a52('0x22')&&typeof _0x5d1ab2[_0x1a52('0x23')]===_0x1a52('0x22');var _0x5c8599=_0x574bf6['count'];var _0x386740=_0x10250d?0x0:_0x5d1ab2[_0x1a52('0x24')];var _0xe5f986=_0x10250d?_0x574bf6[_0x1a52('0x25')]:_0x5d1ab2[_0x1a52('0x24')]+_0x5d1ab2[_0x1a52('0x23')];var _0x3b383b;if(_0xe5f986>=_0x5c8599){_0xe5f986=_0x5c8599;_0x3b383b=0xc8;}else{_0x3b383b=0xce;}_0x3b0dcb[_0x1a52('0x1f')](_0x3b383b);return _0x3b0dcb[_0x1a52('0x26')](_0x1a52('0x27'),_0x386740+'-'+_0xe5f986+'/'+_0x5c8599)['json'](_0x574bf6);}return null;};}function patchUpdates(_0x4619ad){return function(_0x14d0ed){try{jsonpatch[_0x1a52('0x28')](_0x14d0ed,_0x4619ad,!![]);}catch(_0x596857){return BPromise['reject'](_0x596857);}return _0x14d0ed[_0x1a52('0x29')]();};}function saveUpdates(_0x5b15a6,_0x2b3d6a){return function(_0x43830c){if(_0x43830c){return _0x43830c[_0x1a52('0x2a')](_0x5b15a6)['then'](function(_0x46df8d){return _0x46df8d;});}return null;};}function removeEntity(_0x305dbe,_0x2ee275){return function(_0x95a43a){if(_0x95a43a){return _0x95a43a[_0x1a52('0x2b')]()[_0x1a52('0x2c')](function(){var _0x5215e5=_0x95a43a[_0x1a52('0x2d')]({'plain':!![]});var _0x3d85ce=_0x1a52('0x2e');return db[_0x1a52('0x2f')]['destroy']({'where':{'type':_0x3d85ce,'resourceId':_0x5215e5['id']}})[_0x1a52('0x2c')](function(){return _0x95a43a;});})[_0x1a52('0x2c')](function(){_0x305dbe[_0x1a52('0x1f')](0xcc)[_0x1a52('0x20')]();});}};}function handleEntityNotFound(_0x3ac87a,_0x1972d7){return function(_0xeb1cb8){if(!_0xeb1cb8){_0x3ac87a[_0x1a52('0x30')](0x194);}return _0xeb1cb8;};}function handleError(_0x8ef7fa,_0x46bc14){_0x46bc14=_0x46bc14||0x1f4;return function(_0x18f717){logger['error'](_0x18f717[_0x1a52('0x31')]);if(_0x18f717[_0x1a52('0x32')]){delete _0x18f717['name'];}_0x8ef7fa[_0x1a52('0x1f')](_0x46bc14)[_0x1a52('0x33')](_0x18f717);};}exports[_0x1a52('0x34')]=function(_0x85605f,_0x1c95c8){var _0x3ed268={},_0x27e6cf={},_0x489516={'count':0x0,'rows':[]};var _0x550540=_[_0x1a52('0x35')](db['Dashboard'][_0x1a52('0x36')],function(_0x2301e7){return{'name':_0x2301e7[_0x1a52('0x37')],'type':_0x2301e7[_0x1a52('0x38')][_0x1a52('0x39')]};});_0x27e6cf[_0x1a52('0x3a')]=_[_0x1a52('0x35')](_0x550540,_0x1a52('0x32'));_0x27e6cf['query']=_[_0x1a52('0x3b')](_0x85605f[_0x1a52('0x3c')]);_0x27e6cf[_0x1a52('0x3d')]=_['intersection'](_0x27e6cf['model'],_0x27e6cf[_0x1a52('0x3c')]);_0x3ed268[_0x1a52('0x3e')]=_['intersection'](_0x27e6cf[_0x1a52('0x3a')],qs[_0x1a52('0x3f')](_0x85605f[_0x1a52('0x3c')]['fields']));_0x3ed268['attributes']=_0x3ed268[_0x1a52('0x3e')]['length']?_0x3ed268[_0x1a52('0x3e')]:_0x27e6cf['model'];if(!_0x85605f[_0x1a52('0x3c')]['hasOwnProperty'](_0x1a52('0x40'))){_0x3ed268[_0x1a52('0x23')]=qs['limit'](_0x85605f[_0x1a52('0x3c')][_0x1a52('0x23')]);_0x3ed268[_0x1a52('0x24')]=qs[_0x1a52('0x24')](_0x85605f[_0x1a52('0x3c')]['offset']);}_0x3ed268[_0x1a52('0x41')]=qs['sort'](_0x85605f[_0x1a52('0x3c')][_0x1a52('0x42')]);_0x3ed268[_0x1a52('0x43')]=qs[_0x1a52('0x3d')](_[_0x1a52('0x44')](_0x85605f['query'],_0x27e6cf[_0x1a52('0x3d')]),_0x550540);if(_0x85605f['query'][_0x1a52('0x45')]){_0x3ed268['where']=_[_0x1a52('0x46')](_0x3ed268[_0x1a52('0x43')],{'$or':_[_0x1a52('0x35')](_0x550540,function(_0x123259){if(_0x123259[_0x1a52('0x38')]!==_0x1a52('0x47')){var _0x4f3ecb={};_0x4f3ecb[_0x123259['name']]={'$like':'%'+_0x85605f[_0x1a52('0x3c')][_0x1a52('0x45')]+'%'};return _0x4f3ecb;}})});}_0x3ed268=_[_0x1a52('0x46')]({},_0x3ed268,_0x85605f[_0x1a52('0x48')]);var _0x1c0c56={'where':_0x3ed268['where']};return db['Dashboard'][_0x1a52('0x25')](_0x1c0c56)[_0x1a52('0x2c')](function(_0x3400b4){_0x489516['count']=_0x3400b4;if(_0x85605f[_0x1a52('0x3c')][_0x1a52('0x49')]){_0x3ed268[_0x1a52('0x4a')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x3ed268);})[_0x1a52('0x2c')](function(_0x3b063d){_0x489516[_0x1a52('0x4b')]=_0x3b063d;return _0x489516;})[_0x1a52('0x2c')](respondWithFilteredResult(_0x1c95c8,_0x3ed268))[_0x1a52('0x4c')](handleError(_0x1c95c8,null));};exports[_0x1a52('0x4d')]=function(_0x392ab7,_0x41d646){var _0x296318={'raw':![],'where':{'id':_0x392ab7[_0x1a52('0x4e')]['id']}},_0x11801e={};_0x11801e[_0x1a52('0x3a')]=_['keys'](db['Dashboard'][_0x1a52('0x36')]);_0x11801e[_0x1a52('0x3c')]=_[_0x1a52('0x3b')](_0x392ab7[_0x1a52('0x3c')]);_0x11801e[_0x1a52('0x3d')]=_[_0x1a52('0x4f')](_0x11801e['model'],_0x11801e[_0x1a52('0x3c')]);_0x296318['attributes']=_[_0x1a52('0x4f')](_0x11801e['model'],qs['fields'](_0x392ab7[_0x1a52('0x3c')][_0x1a52('0x3f')]));_0x296318[_0x1a52('0x3e')]=_0x296318[_0x1a52('0x3e')][_0x1a52('0x50')]?_0x296318[_0x1a52('0x3e')]:_0x11801e[_0x1a52('0x3a')];if(_0x392ab7['query'][_0x1a52('0x49')]){_0x296318[_0x1a52('0x4a')]=[{'all':!![]}];}_0x296318=_[_0x1a52('0x46')]({},_0x296318,_0x392ab7[_0x1a52('0x48')]);return db[_0x1a52('0x51')][_0x1a52('0x52')](_0x296318)['then'](handleEntityNotFound(_0x41d646,null))[_0x1a52('0x2c')](respondWithResult(_0x41d646,null))[_0x1a52('0x4c')](handleError(_0x41d646,null));};exports[_0x1a52('0x53')]=function(_0x3edb64,_0x6cf832){return db[_0x1a52('0x51')][_0x1a52('0x53')](_0x3edb64[_0x1a52('0x54')],{})['then'](function(_0x1f64df){var _0x2ce764=_0x3edb64[_0x1a52('0x55')][_0x1a52('0x2d')]({'plain':!![]});if(!_0x2ce764)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ce764[_0x1a52('0x56')]==='user'){var _0x5e04e7=_0x1f64df['get']({'plain':!![]});var _0x29cc3b=_0x1a52('0x2e');return db['UserProfileSection'][_0x1a52('0x52')]({'where':{'name':_0x29cc3b,'userProfileId':_0x2ce764[_0x1a52('0x57')]},'raw':!![]})[_0x1a52('0x2c')](function(_0x1450b1){if(_0x1450b1&&_0x1450b1['autoAssociation']===0x0){return db[_0x1a52('0x2f')][_0x1a52('0x53')]({'name':_0x5e04e7[_0x1a52('0x32')],'resourceId':_0x5e04e7['id'],'type':_0x1450b1['name'],'sectionId':_0x1450b1['id']},{})['then'](function(){return _0x1f64df;});}else{return _0x1f64df;}})['catch'](function(_0x1fc391){logger[_0x1a52('0x58')](_0x1a52('0x59'),_0x1fc391);throw _0x1fc391;});}return _0x1f64df;})[_0x1a52('0x2c')](respondWithResult(_0x6cf832,0xc9))[_0x1a52('0x4c')](handleError(_0x6cf832,null));};exports[_0x1a52('0x5a')]=function(_0x508cbd,_0x4280d4){var _0x213f18={'where':{'id':_0x508cbd[_0x1a52('0x4e')]['id']}},_0x3015f7={};_0x3015f7['model']=_[_0x1a52('0x3b')](db[_0x1a52('0x51')][_0x1a52('0x36')]);_0x213f18['attributes']=_['intersection'](_0x3015f7[_0x1a52('0x3a')],qs['fields'](_0x508cbd[_0x1a52('0x3c')][_0x1a52('0x3f')]));_0x213f18['attributes']=_0x213f18['attributes'][_0x1a52('0x50')]?_0x213f18[_0x1a52('0x3e')]:_0x3015f7[_0x1a52('0x3a')];if(_0x508cbd[_0x1a52('0x3c')][_0x1a52('0x49')]){_0x213f18[_0x1a52('0x4a')]=[{'all':!![]}];}_0x213f18=_[_0x1a52('0x46')]({},_0x213f18,_0x508cbd[_0x1a52('0x48')]);return db['Dashboard'][_0x1a52('0x52')](_0x213f18)['then'](handleEntityNotFound(_0x4280d4,null))[_0x1a52('0x2c')](function(_0x3d1453){if(_0x3d1453){var _0x4226e2=_0x3d1453[_0x1a52('0x2d')]({'plain':!![]});_0x4226e2=qs['omit'](_0x4226e2,['id',_0x1a52('0x5b'),'updatedAt']);_0x508cbd['body']=_[_0x1a52('0x5c')](_0x508cbd[_0x1a52('0x54')],['id',_0x1a52('0x5b'),_0x1a52('0x5d')]);return db[_0x1a52('0x51')][_0x1a52('0x53')](_[_0x1a52('0x46')](_0x4226e2,_0x508cbd[_0x1a52('0x54')]),{'include':_0x508cbd['query'][_0x1a52('0x49')]?[{'all':!![]}]:undefined})[_0x1a52('0x2c')](function(_0x2b0541){var _0x7b64e0=_0x508cbd[_0x1a52('0x55')][_0x1a52('0x2d')]({'plain':!![]});if(!_0x7b64e0)throw new Error(_0x1a52('0x5e'));if(_0x7b64e0['role']==='user'){var _0x5f4319=_0x2b0541[_0x1a52('0x2d')]({'plain':!![]});var _0x2bfa86=_0x1a52('0x2e');return db[_0x1a52('0x5f')][_0x1a52('0x52')]({'where':{'name':_0x2bfa86,'userProfileId':_0x7b64e0[_0x1a52('0x57')]},'raw':!![]})['then'](function(_0x2ebeee){if(_0x2ebeee&&_0x2ebeee[_0x1a52('0x60')]===0x0){return db[_0x1a52('0x2f')]['create']({'name':_0x5f4319[_0x1a52('0x32')],'resourceId':_0x5f4319['id'],'type':_0x2ebeee[_0x1a52('0x32')],'sectionId':_0x2ebeee['id']},{})['then'](function(){return _0x2b0541;});}else{return _0x2b0541;}})['catch'](function(_0x39827e){logger[_0x1a52('0x58')](_0x1a52('0x59'),_0x39827e);throw _0x39827e;});}return _0x2b0541;});}})['then'](respondWithResult(_0x4280d4,0xc9))['catch'](handleError(_0x4280d4,null));};exports['update']=function(_0x49be03,_0xf8eaab){if(_0x49be03[_0x1a52('0x54')]['id']){delete _0x49be03['body']['id'];}return db[_0x1a52('0x51')]['find']({'where':{'id':_0x49be03[_0x1a52('0x4e')]['id']}})[_0x1a52('0x2c')](handleEntityNotFound(_0xf8eaab,null))[_0x1a52('0x2c')](saveUpdates(_0x49be03[_0x1a52('0x54')],null))['then'](respondWithResult(_0xf8eaab,null))[_0x1a52('0x4c')](handleError(_0xf8eaab,null));};exports[_0x1a52('0x2b')]=function(_0x381f69,_0x565604){return db[_0x1a52('0x51')]['find']({'where':{'id':_0x381f69[_0x1a52('0x4e')]['id']}})['then'](handleEntityNotFound(_0x565604,null))[_0x1a52('0x2c')](removeEntity(_0x565604,null))[_0x1a52('0x4c')](handleError(_0x565604,null));};function widgetAttributes(_0x745c17){try{switch(_0x745c17[_0x1a52('0x38')]){case _0x1a52('0x61'):return[{'name':'attrUrl','value':_0x745c17['attrUrl']||(_0x745c17['attrs']&&_0x745c17['attrs'][0x0]?_0x745c17[_0x1a52('0x62')][0x0]['value']:undefined)||_0x1a52('0x63')}];case _0x1a52('0x64'):return[{'name':'attrPath','value':_0x745c17[_0x1a52('0x65')]||(_0x745c17[_0x1a52('0x62')]&&_0x745c17[_0x1a52('0x62')][0x0]?_0x745c17[_0x1a52('0x62')][0x0]['value']:undefined)||''}];case _0x1a52('0x66'):return[{'name':_0x1a52('0x67'),'value':_0x745c17[_0x1a52('0x67')]||(_0x745c17[_0x1a52('0x62')]&&_0x745c17[_0x1a52('0x62')][0x0]?_0x745c17['attrs'][0x0]['value']:undefined)||_0x1a52('0x68')},{'name':_0x1a52('0x69'),'value':_0x745c17['attrTimezone']||(_0x745c17[_0x1a52('0x62')]&&_0x745c17[_0x1a52('0x62')][0x1]?_0x745c17[_0x1a52('0x62')][0x1][_0x1a52('0x6a')]:undefined)||_0x1a52('0x6b')},{'name':_0x1a52('0x6c'),'value':_0x745c17[_0x1a52('0x6c')]||(_0x745c17[_0x1a52('0x62')]&&_0x745c17[_0x1a52('0x62')][0x2]?_0x745c17[_0x1a52('0x62')][0x2]['value']:undefined)||0xc}];case _0x1a52('0x6d'):return[{'name':_0x1a52('0x6e'),'value':_0x745c17[_0x1a52('0x6e')]||(_0x745c17['attrs']&&_0x745c17[_0x1a52('0x62')][0x0]?_0x745c17['attrs'][0x0][_0x1a52('0x6a')]:undefined)||_0x1a52('0x6f')},{'name':_0x1a52('0x70'),'value':_0x745c17[_0x1a52('0x70')]||(_0x745c17['attrs']&&_0x745c17[_0x1a52('0x62')][0x1]?_0x745c17[_0x1a52('0x62')][0x1][_0x1a52('0x6a')]:undefined)||[]},{'name':'attrFontSize','value':_0x745c17[_0x1a52('0x6c')]||(_0x745c17['attrs']&&_0x745c17[_0x1a52('0x62')][0x2]?_0x745c17[_0x1a52('0x62')][0x2][_0x1a52('0x6a')]:undefined)||0x14}];case _0x1a52('0x71'):case _0x1a52('0x72'):return[{'name':_0x1a52('0x73'),'value':_0x745c17[_0x1a52('0x73')]||(_0x745c17['attrs']&&_0x745c17[_0x1a52('0x62')][0x0]?_0x745c17[_0x1a52('0x62')][0x0][_0x1a52('0x6a')]:undefined)||_0x1a52('0x6f')},{'name':_0x1a52('0x74'),'value':_0x745c17[_0x1a52('0x74')]||(_0x745c17[_0x1a52('0x62')]&&_0x745c17[_0x1a52('0x62')][0x1]?_0x745c17[_0x1a52('0x62')][0x1][_0x1a52('0x6a')]:undefined)||null},{'name':_0x1a52('0x75'),'value':_0x745c17['attrSerie3']||(_0x745c17[_0x1a52('0x62')]&&_0x745c17[_0x1a52('0x62')][0x2]?_0x745c17[_0x1a52('0x62')][0x2]['value']:undefined)||null},{'name':_0x1a52('0x70'),'value':_0x745c17[_0x1a52('0x70')]||(_0x745c17[_0x1a52('0x62')]&&_0x745c17[_0x1a52('0x62')][0x3]?_0x745c17[_0x1a52('0x62')][0x3]['value']:undefined)||[]}];case _0x1a52('0x76'):return[{'name':_0x1a52('0x77'),'type':_0x745c17['reportType']||(_0x745c17[_0x1a52('0x62')]&&_0x745c17[_0x1a52('0x62')][0x0]?_0x745c17[_0x1a52('0x62')][0x0][_0x1a52('0x38')]:undefined)||null,'value':_0x745c17[_0x1a52('0x77')]||(_0x745c17['attrs']&&_0x745c17[_0x1a52('0x62')][0x0]?_0x745c17['attrs'][0x0][_0x1a52('0x6a')]:undefined)||null},{'name':_0x1a52('0x78'),'value':_0x745c17[_0x1a52('0x78')]||(_0x745c17[_0x1a52('0x62')]&&_0x745c17['attrs'][0x1]?_0x745c17['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5a7bb3){logger['error'](_0x1a52('0x79'),JSON['stringify'](_0x5a7bb3));return[];}}exports[_0x1a52('0x7a')]=function(_0x4b581b,_0x21562a,_0x4eb5be){if(_0x4b581b['body']['id']){delete _0x4b581b[_0x1a52('0x54')]['id'];}return db[_0x1a52('0x51')][_0x1a52('0x52')]({'where':{'id':_0x4b581b[_0x1a52('0x4e')]['id']}})[_0x1a52('0x2c')](handleEntityNotFound(_0x21562a,null))[_0x1a52('0x2c')](function(_0x38c8f3){if(_0x38c8f3){_0x4b581b[_0x1a52('0x54')][_0x1a52('0x7b')]=_0x38c8f3['id'];_0x4b581b['body'][_0x1a52('0x62')]=widgetAttributes(_0x4b581b['body']);return db['DashboardItem']['create'](_0x4b581b['body']);}})[_0x1a52('0x2c')](respondWithResult(_0x21562a,null))[_0x1a52('0x4c')](handleError(_0x21562a,null));};exports[_0x1a52('0x7c')]=function(_0x3d94ed,_0x2095ec,_0x1aeffd){var _0x1ec084={};var _0x445a0b={};var _0x5bf655;var _0x20efce;return db['Dashboard'][_0x1a52('0x7d')]({'where':{'id':_0x3d94ed[_0x1a52('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2095ec,null))[_0x1a52('0x2c')](function(_0xfb317){if(_0xfb317){_0x5bf655=_0xfb317;_0x445a0b['model']=_['keys'](db[_0x1a52('0x7e')][_0x1a52('0x36')]);_0x445a0b[_0x1a52('0x3c')]=_[_0x1a52('0x3b')](_0x3d94ed[_0x1a52('0x3c')]);_0x445a0b[_0x1a52('0x3d')]=_['intersection'](_0x445a0b['model'],_0x445a0b[_0x1a52('0x3c')]);_0x1ec084[_0x1a52('0x3e')]=_[_0x1a52('0x4f')](_0x445a0b[_0x1a52('0x3a')],qs[_0x1a52('0x3f')](_0x3d94ed[_0x1a52('0x3c')][_0x1a52('0x3f')]));_0x1ec084['attributes']=_0x1ec084[_0x1a52('0x3e')]['length']?_0x1ec084[_0x1a52('0x3e')]:_0x445a0b[_0x1a52('0x3a')];_0x1ec084[_0x1a52('0x41')]=qs['sort'](_0x3d94ed['query'][_0x1a52('0x42')]);_0x1ec084[_0x1a52('0x43')]=qs[_0x1a52('0x3d')](_['pick'](_0x3d94ed['query'],_0x445a0b['filters']));if(_0x3d94ed[_0x1a52('0x3c')][_0x1a52('0x45')]){_0x1ec084[_0x1a52('0x43')]=_[_0x1a52('0x46')](_0x1ec084['where'],{'$or':_[_0x1a52('0x35')](_0x1ec084[_0x1a52('0x3e')],function(_0x1768f7){var _0x550cb9={};_0x550cb9[_0x1768f7]={'$like':'%'+_0x3d94ed['query']['filter']+'%'};return _0x550cb9;})});}_0x1ec084=_[_0x1a52('0x46')]({},_0x1ec084,_0x3d94ed[_0x1a52('0x48')]);return _0x5bf655[_0x1a52('0x7c')](_0x1ec084);}})['then'](function(_0x40f550){if(_0x40f550){_0x20efce=_0x40f550[_0x1a52('0x50')];if(!_0x3d94ed[_0x1a52('0x3c')][_0x1a52('0x7f')]('nolimit')){_0x1ec084[_0x1a52('0x23')]=qs['limit'](_0x3d94ed[_0x1a52('0x3c')][_0x1a52('0x23')]);_0x1ec084[_0x1a52('0x24')]=qs['offset'](_0x3d94ed[_0x1a52('0x3c')][_0x1a52('0x24')]);}return _0x5bf655[_0x1a52('0x7c')](_0x1ec084);}})[_0x1a52('0x2c')](function(_0x54908e){if(_0x54908e){return _0x54908e?{'count':_0x20efce,'rows':_0x54908e}:null;}})[_0x1a52('0x2c')](respondWithResult(_0x2095ec,null))['catch'](handleError(_0x2095ec,null));};
\ No newline at end of file
index 53e98a3..1b8201a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbff5=['setMaxListeners','save','update','remove','emit','exports','Dashboard'];(function(_0x18e599,_0x2280a6){var _0x2a7a2d=function(_0xd6c04c){while(--_0xd6c04c){_0x18e599['push'](_0x18e599['shift']());}};_0x2a7a2d(++_0x2280a6);}(_0xbff5,0x180));var _0x5bff=function(_0x1e357a,_0x1e5a1e){_0x1e357a=_0x1e357a-0x0;var _0x1bd35a=_0xbff5[_0x1e357a];return _0x1bd35a;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x5bff('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5bff('0x1')](0x0);var events={'afterCreate':_0x5bff('0x2'),'afterUpdate':_0x5bff('0x3'),'afterDestroy':_0x5bff('0x4')};function emitEvent(_0x2b781e){return function(_0x4b48df,_0x12ea0b,_0x4b0d90){DashboardEvents[_0x5bff('0x5')](_0x2b781e+':'+_0x4b48df['id'],_0x4b48df);DashboardEvents[_0x5bff('0x5')](_0x2b781e,_0x4b48df);_0x4b0d90(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x5bff('0x6')]=DashboardEvents;
\ No newline at end of file
+var _0x8f77=['Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x42bf74,_0x1bf7af){var _0x4b23a1=function(_0x5d0680){while(--_0x5d0680){_0x42bf74['push'](_0x42bf74['shift']());}};_0x4b23a1(++_0x1bf7af);}(_0x8f77,0x98));var _0x78f7=function(_0x4a68b4,_0x321868){_0x4a68b4=_0x4a68b4-0x0;var _0x195b4e=_0x8f77[_0x4a68b4];return _0x195b4e;};'use strict';var EventEmitter=require(_0x78f7('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x78f7('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x78f7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x78f7('0x3'),'afterDestroy':_0x78f7('0x4')};function emitEvent(_0x1030b4){return function(_0x142a72,_0x5bb6bc,_0x53433d){DashboardEvents[_0x78f7('0x5')](_0x1030b4+':'+_0x142a72['id'],_0x142a72);DashboardEvents['emit'](_0x1030b4,_0x142a72);_0x53433d(null);};}for(var e in events){if(events[_0x78f7('0x6')](e)){var event=events[e];Dashboard[_0x78f7('0x7')](e,emitEvent(event));}}module[_0x78f7('0x8')]=DashboardEvents;
\ No newline at end of file
index 03463db..c2d9979 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46f0=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','Dashboard'];(function(_0x56833d,_0x56e614){var _0x5e51e6=function(_0x563294){while(--_0x563294){_0x56833d['push'](_0x56833d['shift']());}};_0x5e51e6(++_0x56e614);}(_0x46f0,0x1a7));var _0x046f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46f0[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x046f('0x0'));var logger=require(_0x046f('0x1'))(_0x046f('0x2'));var moment=require(_0x046f('0x3'));var BPromise=require('bluebird');var rp=require(_0x046f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x046f('0x5'));var config=require(_0x046f('0x6'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x245939,_0x337388){return _0x245939[_0x046f('0x7')](_0x046f('0x8'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5328=['define','Dashboard','dashboards','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2614c5,_0x13449e){var _0x34504d=function(_0x4393c5){while(--_0x4393c5){_0x2614c5['push'](_0x2614c5['shift']());}};_0x34504d(++_0x13449e);}(_0x5328,0x87));var _0x8532=function(_0x5c5833,_0x1a95f5){_0x5c5833=_0x5c5833-0x0;var _0x457753=_0x5328[_0x5c5833];return _0x457753;};'use strict';var _=require('lodash');var util=require(_0x8532('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8532('0x1'));var BPromise=require(_0x8532('0x2'));var rp=require(_0x8532('0x3'));var fs=require('fs');var path=require(_0x8532('0x4'));var rimraf=require(_0x8532('0x5'));var config=require(_0x8532('0x6'));var attributes=require('./dashboard.attributes');module[_0x8532('0x7')]=function(_0x282437,_0x3a121f){return _0x282437[_0x8532('0x8')](_0x8532('0x9'),attributes,{'tableName':_0x8532('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 788dc3b..65a5f5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aeb=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','localhost','redis','register','request','info','request\x20sent','code','error','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x3aeb,0xc3));var _0xb3ae=function(_0x5a8f89,_0x5c5369){_0x5a8f89=_0x5a8f89-0x0;var _0x24dfe6=_0x3aeb[_0x5a8f89];return _0x24dfe6;};'use strict';var _=require(_0xb3ae('0x0'));var util=require(_0xb3ae('0x1'));var moment=require(_0xb3ae('0x2'));var BPromise=require('bluebird');var rs=require(_0xb3ae('0x3'));var fs=require('fs');var Redis=require(_0xb3ae('0x4'));var db=require(_0xb3ae('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb3ae('0x6'))('rpc');var config=require(_0xb3ae('0x7'));var jayson=require(_0xb3ae('0x8'));var client=jayson[_0xb3ae('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xb3ae('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb3ae('0xb')]));require('./dashboard.socket')[_0xb3ae('0xc')](socket);function respondWithRpcPromise(_0x5a5dfb,_0x9a7ea2,_0x2f55d2){return new BPromise(function(_0x24d2ba,_0x3f37b4){return client[_0xb3ae('0xd')](_0x5a5dfb,_0x2f55d2)['then'](function(_0x14d1cc){logger[_0xb3ae('0xe')]('Dashboard,\x20%s,\x20%s',_0x9a7ea2,_0xb3ae('0xf'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x9a7ea2,'request\x20sent',JSON['stringify'](_0x14d1cc));if(_0x14d1cc['error']){if(_0x14d1cc['error'][_0xb3ae('0x10')]===0x1f4){logger[_0xb3ae('0x11')](_0xb3ae('0x12'),_0x9a7ea2,_0x14d1cc[_0xb3ae('0x11')][_0xb3ae('0x13')]);return _0x3f37b4(_0x14d1cc[_0xb3ae('0x11')][_0xb3ae('0x13')]);}logger[_0xb3ae('0x11')]('Dashboard,\x20%s,\x20%s',_0x9a7ea2,_0x14d1cc[_0xb3ae('0x11')][_0xb3ae('0x13')]);return _0x24d2ba(_0x14d1cc[_0xb3ae('0x11')][_0xb3ae('0x13')]);}else{logger[_0xb3ae('0xe')](_0xb3ae('0x12'),_0x9a7ea2,_0xb3ae('0xf'));_0x24d2ba(_0x14d1cc[_0xb3ae('0x14')][_0xb3ae('0x13')]);}})[_0xb3ae('0x15')](function(_0x104023){logger[_0xb3ae('0x11')](_0xb3ae('0x12'),_0x9a7ea2,_0x104023);_0x3f37b4(_0x104023);});});}
\ No newline at end of file
+var _0x945e=['result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1b3a66,_0x579934){var _0x3b9f5d=function(_0x399cfc){while(--_0x399cfc){_0x1b3a66['push'](_0x1b3a66['shift']());}};_0x3b9f5d(++_0x579934);}(_0x945e,0xa4));var _0xe945=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x945e[_0x550d12];return _0x12103d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe945('0x0'));var BPromise=require(_0xe945('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe945('0x2'));var db=require(_0xe945('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe945('0x4'))(_0xe945('0x5'));var config=require(_0xe945('0x6'));var jayson=require(_0xe945('0x7'));var client=jayson[_0xe945('0x8')][_0xe945('0x9')]({'port':0x232a});config[_0xe945('0xa')]=_[_0xe945('0xb')](config[_0xe945('0xa')],{'host':_0xe945('0xc'),'port':0x18eb});var socket=require(_0xe945('0xd'))(new Redis(config['redis']));require(_0xe945('0xe'))['register'](socket);function respondWithRpcPromise(_0x2540d4,_0x14ac97,_0x4815b4){return new BPromise(function(_0x58e448,_0x27097b){return client[_0xe945('0xf')](_0x2540d4,_0x4815b4)[_0xe945('0x10')](function(_0x1979ba){logger[_0xe945('0x11')](_0xe945('0x12'),_0x14ac97,_0xe945('0x13'));logger[_0xe945('0x14')](_0xe945('0x15'),_0x14ac97,'request\x20sent',JSON[_0xe945('0x16')](_0x1979ba));if(_0x1979ba[_0xe945('0x17')]){if(_0x1979ba['error']['code']===0x1f4){logger['error'](_0xe945('0x12'),_0x14ac97,_0x1979ba[_0xe945('0x17')]['message']);return _0x27097b(_0x1979ba[_0xe945('0x17')][_0xe945('0x18')]);}logger[_0xe945('0x17')](_0xe945('0x12'),_0x14ac97,_0x1979ba[_0xe945('0x17')][_0xe945('0x18')]);return _0x58e448(_0x1979ba[_0xe945('0x17')][_0xe945('0x18')]);}else{logger[_0xe945('0x11')](_0xe945('0x12'),_0x14ac97,_0xe945('0x13'));_0x58e448(_0x1979ba[_0xe945('0x19')][_0xe945('0x18')]);}})[_0xe945('0x1a')](function(_0x433e03){logger['error'](_0xe945('0x12'),_0x14ac97,_0x433e03);_0x27097b(_0x433e03);});});}
\ No newline at end of file
index 2e677c7..c36b68c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25ed=['save','update','emit','removeListener','register','length','dashboard:','./dashboard.events'];(function(_0x44840a,_0x50b3b0){var _0x100272=function(_0x5f1ab1){while(--_0x5f1ab1){_0x44840a['push'](_0x44840a['shift']());}};_0x100272(++_0x50b3b0);}(_0x25ed,0x18f));var _0xd25e=function(_0x2b9af6,_0x475a9b){_0x2b9af6=_0x2b9af6-0x0;var _0x20ed39=_0x25ed[_0x2b9af6];return _0x20ed39;};'use strict';var DashboardEvents=require(_0xd25e('0x0'));var events=[_0xd25e('0x1'),'remove',_0xd25e('0x2')];function createListener(_0x467476,_0xa73adc){return function(_0x208d48){_0xa73adc[_0xd25e('0x3')](_0x467476,_0x208d48);};}function removeListener(_0x3bf233,_0xa729e2){return function(){DashboardEvents[_0xd25e('0x4')](_0x3bf233,_0xa729e2);};}exports[_0xd25e('0x5')]=function(_0x1fd785){for(var _0x512a3f=0x0,_0x32c65a=events[_0xd25e('0x6')];_0x512a3f<_0x32c65a;_0x512a3f++){var _0x263648=events[_0x512a3f];var _0x4355cb=createListener(_0xd25e('0x7')+_0x263648,_0x1fd785);DashboardEvents['on'](_0x263648,_0x4355cb);}};
\ No newline at end of file
+var _0x3229=['save','remove','emit','removeListener','register','length','dashboard:','./dashboard.events'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x3229,0x11f));var _0x9322=function(_0x5125cd,_0x1acb11){_0x5125cd=_0x5125cd-0x0;var _0x25777e=_0x3229[_0x5125cd];return _0x25777e;};'use strict';var DashboardEvents=require(_0x9322('0x0'));var events=[_0x9322('0x1'),_0x9322('0x2'),'update'];function createListener(_0x5cf124,_0x3f77f2){return function(_0x52a544){_0x3f77f2[_0x9322('0x3')](_0x5cf124,_0x52a544);};}function removeListener(_0xa59bfe,_0x83aa5a){return function(){DashboardEvents[_0x9322('0x4')](_0xa59bfe,_0x83aa5a);};}exports[_0x9322('0x5')]=function(_0x27a645){for(var _0x2a2e8a=0x0,_0x3a508a=events[_0x9322('0x6')];_0x2a2e8a<_0x3a508a;_0x2a2e8a++){var _0x48bd86=events[_0x2a2e8a];var _0x36b00f=createListener(_0x9322('0x7')+_0x48bd86,_0x27a645);DashboardEvents['on'](_0x48bd86,_0x36b00f);}};
\ No newline at end of file
index 62b120b..597aff4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5493=['destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/items','getItems','post','addItem','put','update','delete'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x5493,0x106));var _0x3549=function(_0x341894,_0x2feea1){_0x341894=_0x341894-0x0;var _0x4c7fb6=_0x5493[_0x341894];return _0x4c7fb6;};'use strict';var multer=require(_0x3549('0x0'));var util=require('util');var path=require(_0x3549('0x1'));var timeout=require('connect-timeout');var express=require(_0x3549('0x2'));var router=express[_0x3549('0x3')]();var fs_extra=require(_0x3549('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3549('0x5'));var config=require(_0x3549('0x6'));var controller=require('./dashboard.controller');router['get']('/',auth[_0x3549('0x7')](),controller[_0x3549('0x8')]);router[_0x3549('0x9')](_0x3549('0xa'),auth[_0x3549('0x7')](),controller['show']);router['get'](_0x3549('0xb'),auth[_0x3549('0x7')](),controller[_0x3549('0xc')]);router[_0x3549('0xd')]('/',auth[_0x3549('0x7')](),controller['create']);router['post']('/:id/clone',auth[_0x3549('0x7')](),controller['clone']);router[_0x3549('0xd')](_0x3549('0xb'),auth[_0x3549('0x7')](),controller[_0x3549('0xe')]);router[_0x3549('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3549('0x10')]);router[_0x3549('0x11')](_0x3549('0xa'),auth[_0x3549('0x7')](),controller[_0x3549('0x12')]);module[_0x3549('0x13')]=router;
\ No newline at end of file
+var _0xd32f=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getItems','post','/:id/items','addItem','delete','destroy','multer','util'];(function(_0x480385,_0x4e2ad1){var _0x3170ae=function(_0x17d531){while(--_0x17d531){_0x480385['push'](_0x480385['shift']());}};_0x3170ae(++_0x4e2ad1);}(_0xd32f,0x102));var _0xfd32=function(_0x5ab93a,_0x5905d3){_0x5ab93a=_0x5ab93a-0x0;var _0x3f5001=_0xd32f[_0x5ab93a];return _0x3f5001;};'use strict';var multer=require(_0xfd32('0x0'));var util=require(_0xfd32('0x1'));var path=require(_0xfd32('0x2'));var timeout=require(_0xfd32('0x3'));var express=require(_0xfd32('0x4'));var router=express[_0xfd32('0x5')]();var fs_extra=require(_0xfd32('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfd32('0x7'));var config=require(_0xfd32('0x8'));var controller=require('./dashboard.controller');router[_0xfd32('0x9')]('/',auth[_0xfd32('0xa')](),controller[_0xfd32('0xb')]);router[_0xfd32('0x9')](_0xfd32('0xc'),auth[_0xfd32('0xa')](),controller[_0xfd32('0xd')]);router['get']('/:id/items',auth[_0xfd32('0xa')](),controller[_0xfd32('0xe')]);router[_0xfd32('0xf')]('/',auth[_0xfd32('0xa')](),controller['create']);router[_0xfd32('0xf')]('/:id/clone',auth[_0xfd32('0xa')](),controller['clone']);router['post'](_0xfd32('0x10'),auth[_0xfd32('0xa')](),controller[_0xfd32('0x11')]);router['put']('/:id',auth[_0xfd32('0xa')](),controller['update']);router[_0xfd32('0x12')](_0xfd32('0xc'),auth[_0xfd32('0xa')](),controller[_0xfd32('0x13')]);module['exports']=router;
\ No newline at end of file
index 0d4911e..7fa82f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeff8=['sequelize','squel','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x34c49d,_0x31ee2d){var _0x837d50=function(_0x2e5cb3){while(--_0x2e5cb3){_0x34c49d['push'](_0x34c49d['shift']());}};_0x837d50(++_0x31ee2d);}(_0xeff8,0x186));var _0x8eff=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xeff8[_0x4914e2];return _0x2dcd07;};'use strict';var Sequelize=require(_0x8eff('0x0'));var squel=require(_0x8eff('0x1'));var _=require('lodash');module[_0x8eff('0x2')]={'title':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eff('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x8eff('0x4')),'get':function(){try{return JSON[_0x8eff('0x5')](this[_0x8eff('0x6')](_0x8eff('0x7')));}catch(_0x4ac51c){return[];}},'set':function(_0x469641){try{this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')](_0x469641));}catch(_0x491f01){this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x8eff('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x8eff('0xa')]},'background':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![],'defaultValue':_0x8eff('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8eff('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eff('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
+var _0x1623=['attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','exports','STRING','TEXT','long'];(function(_0x1602fb,_0x20b6b3){var _0x461831=function(_0x4a19f1){while(--_0x4a19f1){_0x1602fb['push'](_0x1602fb['shift']());}};_0x461831(++_0x20b6b3);}(_0x1623,0xab));var _0x3162=function(_0x6b5133,_0x26aeaa){_0x6b5133=_0x6b5133-0x0;var _0x4dc177=_0x1623[_0x6b5133];return _0x4dc177;};'use strict';var Sequelize=require(_0x3162('0x0'));var squel=require('squel');var _=require('lodash');module[_0x3162('0x1')]={'title':{'type':Sequelize[_0x3162('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3162('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3162('0x3')](_0x3162('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x3162('0x5')));}catch(_0x4b77c4){return[];}},'set':function(_0x1b55f2){try{this[_0x3162('0x6')]('attrs',JSON[_0x3162('0x7')](_0x1b55f2));}catch(_0x2dc07e){this[_0x3162('0x6')](_0x3162('0x5'),JSON[_0x3162('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x3162('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3162('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x3162('0x8')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3162('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3162('0x2')],'allowNull':![],'defaultValue':_0x3162('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3162('0x2')]},'titleFontSize':{'type':Sequelize[_0x3162('0x8')],'defaultValue':0xc}};
\ No newline at end of file
index cd977ce..649abca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cc1=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','clock','attrHourFormat','value','HH:mm:ss','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2cc1,0x1bd));var _0x12cc=function(_0x4f2d17,_0x13156c){_0x4f2d17=_0x4f2d17-0x0;var _0x277b0d=_0x2cc1[_0x4f2d17];return _0x277b0d;};'use strict';var emlformat=require(_0x12cc('0x0'));var rimraf=require(_0x12cc('0x1'));var zipdir=require(_0x12cc('0x2'));var jsonpatch=require(_0x12cc('0x3'));var rp=require(_0x12cc('0x4'));var moment=require(_0x12cc('0x5'));var BPromise=require(_0x12cc('0x6'));var Mustache=require(_0x12cc('0x7'));var util=require('util');var path=require('path');var sox=require(_0x12cc('0x8'));var csv=require(_0x12cc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12cc('0xa'));var squel=require(_0x12cc('0xb'));var crypto=require(_0x12cc('0xc'));var jsforce=require(_0x12cc('0xd'));var deskjs=require(_0x12cc('0xe'));var toCsv=require(_0x12cc('0x9'));var querystring=require(_0x12cc('0xf'));var Papa=require(_0x12cc('0x10'));var Redis=require(_0x12cc('0x11'));var authService=require(_0x12cc('0x12'));var qs=require(_0x12cc('0x13'));var as=require(_0x12cc('0x14'));var hardwareService=require(_0x12cc('0x15'));var logger=require('../../config/logger')(_0x12cc('0x16'));var utils=require('../../config/utils');var config=require(_0x12cc('0x17'));var licenseUtil=require(_0x12cc('0x18'));var db=require(_0x12cc('0x19'))['db'];config[_0x12cc('0x1a')]=_[_0x12cc('0x1b')](config[_0x12cc('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12cc('0x1a')]));require('./dashboardItem.socket')[_0x12cc('0x1c')](socket);function respondWithStatusCode(_0x57f008,_0x3451b5){_0x3451b5=_0x3451b5||0xcc;return function(_0xcc08c2){if(_0xcc08c2){return _0x57f008[_0x12cc('0x1d')](_0x3451b5);}return _0x57f008[_0x12cc('0x1e')](_0x3451b5)[_0x12cc('0x1f')]();};}function respondWithResult(_0x33753a,_0x511857){_0x511857=_0x511857||0xc8;return function(_0x47fa45){if(_0x47fa45){return _0x33753a[_0x12cc('0x1e')](_0x511857)['json'](_0x47fa45);}};}function respondWithFilteredResult(_0x16a709,_0x28134a){return function(_0x1ad81f){if(_0x1ad81f){var _0x33db40=typeof _0x28134a[_0x12cc('0x20')]===_0x12cc('0x21')&&typeof _0x28134a[_0x12cc('0x22')]===_0x12cc('0x21');var _0x3064d5=_0x1ad81f['count'];var _0x4deea0=_0x33db40?0x0:_0x28134a['offset'];var _0x450e54=_0x33db40?_0x1ad81f[_0x12cc('0x23')]:_0x28134a[_0x12cc('0x20')]+_0x28134a[_0x12cc('0x22')];var _0x23825f;if(_0x450e54>=_0x3064d5){_0x450e54=_0x3064d5;_0x23825f=0xc8;}else{_0x23825f=0xce;}_0x16a709[_0x12cc('0x1e')](_0x23825f);return _0x16a709[_0x12cc('0x24')](_0x12cc('0x25'),_0x4deea0+'-'+_0x450e54+'/'+_0x3064d5)[_0x12cc('0x26')](_0x1ad81f);}return null;};}function patchUpdates(_0x5c1fdf){return function(_0x3358a2){try{jsonpatch['apply'](_0x3358a2,_0x5c1fdf,!![]);}catch(_0x333e16){return BPromise[_0x12cc('0x27')](_0x333e16);}return _0x3358a2[_0x12cc('0x28')]();};}function saveUpdates(_0x2f5aab,_0x797a61){return function(_0x5170ec){if(_0x5170ec){return _0x5170ec['update'](_0x2f5aab)[_0x12cc('0x29')](function(_0x5ab109){return _0x5ab109;});}return null;};}function removeEntity(_0x3769b2,_0x11d4bc){return function(_0x1fb084){if(_0x1fb084){return _0x1fb084[_0x12cc('0x2a')]()[_0x12cc('0x29')](function(){_0x3769b2[_0x12cc('0x1e')](0xcc)[_0x12cc('0x1f')]();});}};}function handleEntityNotFound(_0x17a66b,_0x12c139){return function(_0x180cfe){if(!_0x180cfe){_0x17a66b[_0x12cc('0x1d')](0x194);}return _0x180cfe;};}function handleError(_0x102654,_0x420222){_0x420222=_0x420222||0x1f4;return function(_0x435a28){logger[_0x12cc('0x2b')](_0x435a28[_0x12cc('0x2c')]);if(_0x435a28['name']){delete _0x435a28[_0x12cc('0x2d')];}_0x102654[_0x12cc('0x1e')](_0x420222)[_0x12cc('0x2e')](_0x435a28);};}exports[_0x12cc('0x2f')]=function(_0x45fd2b,_0x3acd5c){var _0x363041={'raw':![],'where':{'id':_0x45fd2b[_0x12cc('0x30')]['id']}},_0x58ecda={};_0x58ecda[_0x12cc('0x31')]=_[_0x12cc('0x32')](db[_0x12cc('0x33')][_0x12cc('0x34')]);_0x58ecda['query']=_[_0x12cc('0x32')](_0x45fd2b[_0x12cc('0x35')]);_0x58ecda[_0x12cc('0x36')]=_[_0x12cc('0x37')](_0x58ecda[_0x12cc('0x31')],_0x58ecda[_0x12cc('0x35')]);_0x363041[_0x12cc('0x38')]=_[_0x12cc('0x37')](_0x58ecda[_0x12cc('0x31')],qs[_0x12cc('0x39')](_0x45fd2b[_0x12cc('0x35')][_0x12cc('0x39')]));_0x363041[_0x12cc('0x38')]=_0x363041[_0x12cc('0x38')][_0x12cc('0x3a')]?_0x363041['attributes']:_0x58ecda[_0x12cc('0x31')];if(_0x45fd2b[_0x12cc('0x35')][_0x12cc('0x3b')]){_0x363041[_0x12cc('0x3c')]=[{'all':!![]}];}_0x363041=_[_0x12cc('0x3d')]({},_0x363041,_0x45fd2b[_0x12cc('0x3e')]);return db['DashboardItem'][_0x12cc('0x3f')](_0x363041)[_0x12cc('0x29')](handleEntityNotFound(_0x3acd5c,null))[_0x12cc('0x29')](respondWithResult(_0x3acd5c,null))['catch'](handleError(_0x3acd5c,null));};exports[_0x12cc('0x2a')]=function(_0x30ddb9,_0x1f6aba){return db[_0x12cc('0x33')][_0x12cc('0x3f')]({'where':{'id':_0x30ddb9['params']['id']}})[_0x12cc('0x29')](handleEntityNotFound(_0x1f6aba,null))[_0x12cc('0x29')](removeEntity(_0x1f6aba,null))[_0x12cc('0x40')](handleError(_0x1f6aba,null));};function widgetAttributes(_0x1c17f8){try{switch(_0x1c17f8[_0x12cc('0x41')]){case _0x12cc('0x42'):return[{'name':_0x12cc('0x43'),'value':_0x1c17f8[_0x12cc('0x43')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x0]?_0x1c17f8[_0x12cc('0x44')][0x0]['value']:undefined)||_0x12cc('0x45')}];case _0x12cc('0x46'):return[{'name':_0x12cc('0x47'),'value':_0x1c17f8[_0x12cc('0x47')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8['attrs'][0x0]?_0x1c17f8[_0x12cc('0x44')][0x0]['value']:undefined)||''}];case _0x12cc('0x48'):return[{'name':_0x12cc('0x49'),'value':_0x1c17f8[_0x12cc('0x49')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x0]?_0x1c17f8[_0x12cc('0x44')][0x0][_0x12cc('0x4a')]:undefined)||_0x12cc('0x4b')},{'name':'attrTimezone','value':_0x1c17f8['attrTimezone']||(_0x1c17f8['attrs']&&_0x1c17f8['attrs'][0x1]?_0x1c17f8[_0x12cc('0x44')][0x1][_0x12cc('0x4a')]:undefined)||_0x12cc('0x4c')},{'name':_0x12cc('0x4d'),'value':_0x1c17f8[_0x12cc('0x4d')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x2]?_0x1c17f8[_0x12cc('0x44')][0x2][_0x12cc('0x4a')]:undefined)||0xc}];case'counter':return[{'name':_0x12cc('0x4e'),'value':_0x1c17f8[_0x12cc('0x4e')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x0]?_0x1c17f8['attrs'][0x0]['value']:undefined)||_0x12cc('0x4f')},{'name':_0x12cc('0x50'),'value':_0x1c17f8[_0x12cc('0x50')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x1]?_0x1c17f8[_0x12cc('0x44')][0x1][_0x12cc('0x4a')]:undefined)||[]},{'name':_0x12cc('0x4d'),'value':_0x1c17f8[_0x12cc('0x4d')]||(_0x1c17f8['attrs']&&_0x1c17f8[_0x12cc('0x44')][0x2]?_0x1c17f8[_0x12cc('0x44')][0x2]['value']:undefined)||0x14}];case _0x12cc('0x51'):case'pie-chart':return[{'name':_0x12cc('0x52'),'value':_0x1c17f8[_0x12cc('0x52')]||(_0x1c17f8['attrs']&&_0x1c17f8[_0x12cc('0x44')][0x0]?_0x1c17f8['attrs'][0x0][_0x12cc('0x4a')]:undefined)||'total'},{'name':_0x12cc('0x53'),'value':_0x1c17f8['attrSerie2']||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x1]?_0x1c17f8['attrs'][0x1][_0x12cc('0x4a')]:undefined)||null},{'name':_0x12cc('0x54'),'value':_0x1c17f8[_0x12cc('0x54')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x2]?_0x1c17f8[_0x12cc('0x44')][0x2][_0x12cc('0x4a')]:undefined)||null},{'name':_0x12cc('0x50'),'value':_0x1c17f8[_0x12cc('0x50')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8['attrs'][0x3]?_0x1c17f8[_0x12cc('0x44')][0x3]['value']:undefined)||[]}];case _0x12cc('0x55'):return[{'name':'attrReport','type':_0x1c17f8[_0x12cc('0x56')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x0]?_0x1c17f8[_0x12cc('0x44')][0x0][_0x12cc('0x41')]:undefined)||null,'value':_0x1c17f8[_0x12cc('0x57')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x0]?_0x1c17f8[_0x12cc('0x44')][0x0][_0x12cc('0x4a')]:undefined)||null},{'name':_0x12cc('0x58'),'value':_0x1c17f8[_0x12cc('0x58')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x1]?_0x1c17f8['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x31273b){logger[_0x12cc('0x2b')]('widgetAttributes:\x20%s',JSON[_0x12cc('0x59')](_0x31273b));return[];}}exports[_0x12cc('0x5a')]=function(_0x2a9239,_0x373c62){if(_0x2a9239[_0x12cc('0x5b')]){_0x2a9239[_0x12cc('0x5b')][_0x12cc('0x44')]=widgetAttributes(_0x2a9239[_0x12cc('0x5b')]);}return db[_0x12cc('0x33')][_0x12cc('0x5a')](_0x2a9239[_0x12cc('0x5b')],{})[_0x12cc('0x29')](respondWithResult(_0x373c62,0xc9))[_0x12cc('0x40')](handleError(_0x373c62,null));};exports[_0x12cc('0x5c')]=function(_0x4347f1,_0x61cd9){if(_0x4347f1[_0x12cc('0x5b')]['id']){delete _0x4347f1[_0x12cc('0x5b')]['id'];}_0x4347f1['body'][_0x12cc('0x44')]=widgetAttributes(_0x4347f1[_0x12cc('0x5b')]);return db[_0x12cc('0x33')][_0x12cc('0x3f')]({'where':{'id':_0x4347f1[_0x12cc('0x30')]['id']}})[_0x12cc('0x29')](handleEntityNotFound(_0x61cd9,null))[_0x12cc('0x29')](saveUpdates(_0x4347f1[_0x12cc('0x5b')],null))[_0x12cc('0x29')](respondWithResult(_0x61cd9,null))[_0x12cc('0x40')](handleError(_0x61cd9,null));};
\ No newline at end of file
+var _0x3c85=['value','HH:mm:ss','attrTimezone','counter','attrMetric','attrVoiceQueues','attrFontSize','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','error','name','send','rawAttributes','query','filters','model','attributes','intersection','fields','include','options','DashboardItem','catch','find','params','type','attrUrl','attrs','custom','attrPath','attrHourFormat'];(function(_0x5101e2,_0x27a5d7){var _0x4647ea=function(_0x170af1){while(--_0x170af1){_0x5101e2['push'](_0x5101e2['shift']());}};_0x4647ea(++_0x27a5d7);}(_0x3c85,0xb8));var _0x53c8=function(_0x2aed07,_0x3b49cc){_0x2aed07=_0x2aed07-0x0;var _0x23835b=_0x3c85[_0x2aed07];return _0x23835b;};'use strict';var emlformat=require(_0x53c8('0x0'));var rimraf=require(_0x53c8('0x1'));var zipdir=require(_0x53c8('0x2'));var jsonpatch=require(_0x53c8('0x3'));var rp=require('request-promise');var moment=require(_0x53c8('0x4'));var BPromise=require(_0x53c8('0x5'));var Mustache=require(_0x53c8('0x6'));var util=require(_0x53c8('0x7'));var path=require(_0x53c8('0x8'));var sox=require(_0x53c8('0x9'));var csv=require(_0x53c8('0xa'));var ejs=require(_0x53c8('0xb'));var fs=require('fs');var fs_extra=require(_0x53c8('0xc'));var _=require('lodash');var squel=require(_0x53c8('0xd'));var crypto=require('crypto');var jsforce=require(_0x53c8('0xe'));var deskjs=require(_0x53c8('0xf'));var toCsv=require(_0x53c8('0xa'));var querystring=require('querystring');var Papa=require(_0x53c8('0x10'));var Redis=require(_0x53c8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x53c8('0x12'));var as=require(_0x53c8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x53c8('0x14'))(_0x53c8('0x15'));var utils=require(_0x53c8('0x16'));var config=require(_0x53c8('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x53c8('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x53c8('0x19'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x53c8('0x1a')](socket);function respondWithStatusCode(_0x4c16a6,_0x3b738f){_0x3b738f=_0x3b738f||0xcc;return function(_0x4105bd){if(_0x4105bd){return _0x4c16a6[_0x53c8('0x1b')](_0x3b738f);}return _0x4c16a6[_0x53c8('0x1c')](_0x3b738f)[_0x53c8('0x1d')]();};}function respondWithResult(_0x56f7b8,_0x4e1dc6){_0x4e1dc6=_0x4e1dc6||0xc8;return function(_0xc727ed){if(_0xc727ed){return _0x56f7b8['status'](_0x4e1dc6)['json'](_0xc727ed);}};}function respondWithFilteredResult(_0x32cd76,_0x4bb789){return function(_0x20ed2a){if(_0x20ed2a){var _0x326f34=typeof _0x4bb789[_0x53c8('0x1e')]===_0x53c8('0x1f')&&typeof _0x4bb789[_0x53c8('0x20')]===_0x53c8('0x1f');var _0x13568d=_0x20ed2a[_0x53c8('0x21')];var _0x35af28=_0x326f34?0x0:_0x4bb789[_0x53c8('0x1e')];var _0x788e06=_0x326f34?_0x20ed2a[_0x53c8('0x21')]:_0x4bb789[_0x53c8('0x1e')]+_0x4bb789[_0x53c8('0x20')];var _0x3d753c;if(_0x788e06>=_0x13568d){_0x788e06=_0x13568d;_0x3d753c=0xc8;}else{_0x3d753c=0xce;}_0x32cd76['status'](_0x3d753c);return _0x32cd76[_0x53c8('0x22')](_0x53c8('0x23'),_0x35af28+'-'+_0x788e06+'/'+_0x13568d)[_0x53c8('0x24')](_0x20ed2a);}return null;};}function patchUpdates(_0x22b690){return function(_0x4d75cb){try{jsonpatch['apply'](_0x4d75cb,_0x22b690,!![]);}catch(_0x4504ea){return BPromise[_0x53c8('0x25')](_0x4504ea);}return _0x4d75cb[_0x53c8('0x26')]();};}function saveUpdates(_0x3025f6,_0x3a8eb2){return function(_0x3f8dac){if(_0x3f8dac){return _0x3f8dac['update'](_0x3025f6)['then'](function(_0x1818fc){return _0x1818fc;});}return null;};}function removeEntity(_0x50b5f6,_0x385dae){return function(_0xecf5d3){if(_0xecf5d3){return _0xecf5d3['destroy']()[_0x53c8('0x27')](function(){_0x50b5f6[_0x53c8('0x1c')](0xcc)[_0x53c8('0x1d')]();});}};}function handleEntityNotFound(_0x39a353,_0x5029ba){return function(_0x1375f1){if(!_0x1375f1){_0x39a353[_0x53c8('0x1b')](0x194);}return _0x1375f1;};}function handleError(_0x32bded,_0x1284c6){_0x1284c6=_0x1284c6||0x1f4;return function(_0x14ad49){logger[_0x53c8('0x28')](_0x14ad49['stack']);if(_0x14ad49[_0x53c8('0x29')]){delete _0x14ad49[_0x53c8('0x29')];}_0x32bded['status'](_0x1284c6)[_0x53c8('0x2a')](_0x14ad49);};}exports['show']=function(_0x501d26,_0x1fbac3){var _0x1dbb0d={'raw':![],'where':{'id':_0x501d26['params']['id']}},_0x2d0eb3={};_0x2d0eb3['model']=_['keys'](db['DashboardItem'][_0x53c8('0x2b')]);_0x2d0eb3['query']=_['keys'](_0x501d26[_0x53c8('0x2c')]);_0x2d0eb3[_0x53c8('0x2d')]=_['intersection'](_0x2d0eb3[_0x53c8('0x2e')],_0x2d0eb3[_0x53c8('0x2c')]);_0x1dbb0d[_0x53c8('0x2f')]=_[_0x53c8('0x30')](_0x2d0eb3[_0x53c8('0x2e')],qs['fields'](_0x501d26[_0x53c8('0x2c')][_0x53c8('0x31')]));_0x1dbb0d['attributes']=_0x1dbb0d[_0x53c8('0x2f')]['length']?_0x1dbb0d[_0x53c8('0x2f')]:_0x2d0eb3[_0x53c8('0x2e')];if(_0x501d26[_0x53c8('0x2c')]['includeAll']){_0x1dbb0d[_0x53c8('0x32')]=[{'all':!![]}];}_0x1dbb0d=_['merge']({},_0x1dbb0d,_0x501d26[_0x53c8('0x33')]);return db[_0x53c8('0x34')]['find'](_0x1dbb0d)[_0x53c8('0x27')](handleEntityNotFound(_0x1fbac3,null))[_0x53c8('0x27')](respondWithResult(_0x1fbac3,null))[_0x53c8('0x35')](handleError(_0x1fbac3,null));};exports['destroy']=function(_0x173578,_0x5d9632){return db[_0x53c8('0x34')][_0x53c8('0x36')]({'where':{'id':_0x173578[_0x53c8('0x37')]['id']}})['then'](handleEntityNotFound(_0x5d9632,null))[_0x53c8('0x27')](removeEntity(_0x5d9632,null))[_0x53c8('0x35')](handleError(_0x5d9632,null));};function widgetAttributes(_0x545fe2){try{switch(_0x545fe2[_0x53c8('0x38')]){case'iframe':return[{'name':_0x53c8('0x39'),'value':_0x545fe2[_0x53c8('0x39')]||(_0x545fe2[_0x53c8('0x3a')]&&_0x545fe2[_0x53c8('0x3a')][0x0]?_0x545fe2[_0x53c8('0x3a')][0x0]['value']:undefined)||'https://'}];case _0x53c8('0x3b'):return[{'name':_0x53c8('0x3c'),'value':_0x545fe2[_0x53c8('0x3c')]||(_0x545fe2[_0x53c8('0x3a')]&&_0x545fe2[_0x53c8('0x3a')][0x0]?_0x545fe2['attrs'][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x53c8('0x3d'),'value':_0x545fe2['attrHourFormat']||(_0x545fe2[_0x53c8('0x3a')]&&_0x545fe2[_0x53c8('0x3a')][0x0]?_0x545fe2[_0x53c8('0x3a')][0x0][_0x53c8('0x3e')]:undefined)||_0x53c8('0x3f')},{'name':'attrTimezone','value':_0x545fe2[_0x53c8('0x40')]||(_0x545fe2[_0x53c8('0x3a')]&&_0x545fe2[_0x53c8('0x3a')][0x1]?_0x545fe2['attrs'][0x1][_0x53c8('0x3e')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x545fe2['attrFontSize']||(_0x545fe2['attrs']&&_0x545fe2['attrs'][0x2]?_0x545fe2['attrs'][0x2][_0x53c8('0x3e')]:undefined)||0xc}];case _0x53c8('0x41'):return[{'name':'attrMetric','value':_0x545fe2[_0x53c8('0x42')]||(_0x545fe2['attrs']&&_0x545fe2['attrs'][0x0]?_0x545fe2[_0x53c8('0x3a')][0x0][_0x53c8('0x3e')]:undefined)||'total'},{'name':_0x53c8('0x43'),'value':_0x545fe2['attrVoiceQueues']||(_0x545fe2[_0x53c8('0x3a')]&&_0x545fe2[_0x53c8('0x3a')][0x1]?_0x545fe2[_0x53c8('0x3a')][0x1][_0x53c8('0x3e')]:undefined)||[]},{'name':_0x53c8('0x44'),'value':_0x545fe2['attrFontSize']||(_0x545fe2['attrs']&&_0x545fe2[_0x53c8('0x3a')][0x2]?_0x545fe2[_0x53c8('0x3a')][0x2][_0x53c8('0x3e')]:undefined)||0x14}];case _0x53c8('0x45'):case _0x53c8('0x46'):return[{'name':_0x53c8('0x47'),'value':_0x545fe2[_0x53c8('0x47')]||(_0x545fe2['attrs']&&_0x545fe2[_0x53c8('0x3a')][0x0]?_0x545fe2[_0x53c8('0x3a')][0x0][_0x53c8('0x3e')]:undefined)||_0x53c8('0x48')},{'name':'attrSerie2','value':_0x545fe2[_0x53c8('0x49')]||(_0x545fe2[_0x53c8('0x3a')]&&_0x545fe2[_0x53c8('0x3a')][0x1]?_0x545fe2[_0x53c8('0x3a')][0x1][_0x53c8('0x3e')]:undefined)||null},{'name':'attrSerie3','value':_0x545fe2[_0x53c8('0x4a')]||(_0x545fe2[_0x53c8('0x3a')]&&_0x545fe2[_0x53c8('0x3a')][0x2]?_0x545fe2[_0x53c8('0x3a')][0x2]['value']:undefined)||null},{'name':_0x53c8('0x43'),'value':_0x545fe2[_0x53c8('0x43')]||(_0x545fe2[_0x53c8('0x3a')]&&_0x545fe2['attrs'][0x3]?_0x545fe2[_0x53c8('0x3a')][0x3][_0x53c8('0x3e')]:undefined)||[]}];case _0x53c8('0x4b'):return[{'name':_0x53c8('0x4c'),'type':_0x545fe2[_0x53c8('0x4d')]||(_0x545fe2[_0x53c8('0x3a')]&&_0x545fe2[_0x53c8('0x3a')][0x0]?_0x545fe2[_0x53c8('0x3a')][0x0][_0x53c8('0x38')]:undefined)||null,'value':_0x545fe2[_0x53c8('0x4c')]||(_0x545fe2[_0x53c8('0x3a')]&&_0x545fe2['attrs'][0x0]?_0x545fe2['attrs'][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x545fe2[_0x53c8('0x4e')]||(_0x545fe2[_0x53c8('0x3a')]&&_0x545fe2[_0x53c8('0x3a')][0x1]?_0x545fe2['attrs'][0x1][_0x53c8('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x2a6e1e){logger['error']('widgetAttributes:\x20%s',JSON['stringify'](_0x2a6e1e));return[];}}exports[_0x53c8('0x4f')]=function(_0x1e3c51,_0x499836){if(_0x1e3c51[_0x53c8('0x50')]){_0x1e3c51[_0x53c8('0x50')]['attrs']=widgetAttributes(_0x1e3c51[_0x53c8('0x50')]);}return db[_0x53c8('0x34')][_0x53c8('0x4f')](_0x1e3c51['body'],{})[_0x53c8('0x27')](respondWithResult(_0x499836,0xc9))[_0x53c8('0x35')](handleError(_0x499836,null));};exports[_0x53c8('0x51')]=function(_0x5135f8,_0x384883){if(_0x5135f8[_0x53c8('0x50')]['id']){delete _0x5135f8[_0x53c8('0x50')]['id'];}_0x5135f8[_0x53c8('0x50')]['attrs']=widgetAttributes(_0x5135f8[_0x53c8('0x50')]);return db[_0x53c8('0x34')][_0x53c8('0x36')]({'where':{'id':_0x5135f8[_0x53c8('0x37')]['id']}})[_0x53c8('0x27')](handleEntityNotFound(_0x384883,null))[_0x53c8('0x27')](saveUpdates(_0x5135f8[_0x53c8('0x50')],null))[_0x53c8('0x27')](respondWithResult(_0x384883,null))[_0x53c8('0x35')](handleError(_0x384883,null));};
\ No newline at end of file
index bf888b2..71267eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3bb=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4b904f,_0x1080fd){var _0x4265c0=function(_0x1e7dcc){while(--_0x1e7dcc){_0x4b904f['push'](_0x4b904f['shift']());}};_0x4265c0(++_0x1080fd);}(_0xa3bb,0xd2));var _0xba3b=function(_0x71650c,_0x3f49d8){_0x71650c=_0x71650c-0x0;var _0x11c3cc=_0xa3bb[_0x71650c];return _0x11c3cc;};'use strict';var EventEmitter=require(_0xba3b('0x0'));var DashboardItem=require(_0xba3b('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xba3b('0x2')](0x0);var events={'afterCreate':_0xba3b('0x3'),'afterUpdate':_0xba3b('0x4'),'afterDestroy':_0xba3b('0x5')};function emitEvent(_0x115155){return function(_0x4b1d5f,_0x32bdad,_0xf4f32f){DashboardItemEvents[_0xba3b('0x6')](_0x115155+':'+_0x4b1d5f['id'],_0x4b1d5f);DashboardItemEvents[_0xba3b('0x6')](_0x115155,_0x4b1d5f);_0xf4f32f(null);};}for(var e in events){if(events[_0xba3b('0x7')](e)){var event=events[e];DashboardItem[_0xba3b('0x8')](e,emitEvent(event));}}module[_0xba3b('0x9')]=DashboardItemEvents;
\ No newline at end of file
+var _0x25a9=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','DashboardItem'];(function(_0x3e7f19,_0x53af06){var _0xa87c3d=function(_0x4a5ecc){while(--_0x4a5ecc){_0x3e7f19['push'](_0x3e7f19['shift']());}};_0xa87c3d(++_0x53af06);}(_0x25a9,0xf1));var _0x925a=function(_0x5a7244,_0x605a4){_0x5a7244=_0x5a7244-0x0;var _0x77ff1b=_0x25a9[_0x5a7244];return _0x77ff1b;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x925a('0x0'))['db'][_0x925a('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x925a('0x2')](0x0);var events={'afterCreate':_0x925a('0x3'),'afterUpdate':_0x925a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x240e80){return function(_0x405d00,_0x4c86fd,_0x53de6b){DashboardItemEvents[_0x925a('0x5')](_0x240e80+':'+_0x405d00['id'],_0x405d00);DashboardItemEvents['emit'](_0x240e80,_0x405d00);_0x53de6b(null);};}for(var e in events){if(events[_0x925a('0x6')](e)){var event=events[e];DashboardItem[_0x925a('0x7')](e,emitEvent(event));}}module[_0x925a('0x8')]=DashboardItemEvents;
\ No newline at end of file
index e92569c..152924a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8507=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','dashboard_items'];(function(_0x20d139,_0x419c49){var _0x48fcaa=function(_0x4de841){while(--_0x4de841){_0x20d139['push'](_0x20d139['shift']());}};_0x48fcaa(++_0x419c49);}(_0x8507,0xc0));var _0x7850=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8507[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7850('0x0'));var util=require('util');var logger=require(_0x7850('0x1'))(_0x7850('0x2'));var moment=require(_0x7850('0x3'));var BPromise=require(_0x7850('0x4'));var rp=require(_0x7850('0x5'));var fs=require('fs');var path=require(_0x7850('0x6'));var rimraf=require(_0x7850('0x7'));var config=require(_0x7850('0x8'));var attributes=require(_0x7850('0x9'));module[_0x7850('0xa')]=function(_0x2e78bf,_0x3e6a8f){return _0x2e78bf['define']('DashboardItem',attributes,{'tableName':_0x7850('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9af6=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','lodash'];(function(_0x3f4568,_0x9eb0ee){var _0xee2340=function(_0xdefabb){while(--_0xdefabb){_0x3f4568['push'](_0x3f4568['shift']());}};_0xee2340(++_0x9eb0ee);}(_0x9af6,0xb5));var _0x69af=function(_0x373b38,_0xf83009){_0x373b38=_0x373b38-0x0;var _0x536ad7=_0x9af6[_0x373b38];return _0x536ad7;};'use strict';var _=require(_0x69af('0x0'));var util=require(_0x69af('0x1'));var logger=require(_0x69af('0x2'))(_0x69af('0x3'));var moment=require(_0x69af('0x4'));var BPromise=require('bluebird');var rp=require(_0x69af('0x5'));var fs=require('fs');var path=require(_0x69af('0x6'));var rimraf=require(_0x69af('0x7'));var config=require(_0x69af('0x8'));var attributes=require(_0x69af('0x9'));module[_0x69af('0xa')]=function(_0x2e5ffe,_0x328987){return _0x2e5ffe['define'](_0x69af('0xb'),attributes,{'tableName':_0x69af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f008edb..2ce6f7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fa8=['DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent','debug'];(function(_0x145d5c,_0x30892d){var _0x82e0bb=function(_0x4d2b2d){while(--_0x4d2b2d){_0x145d5c['push'](_0x145d5c['shift']());}};_0x82e0bb(++_0x30892d);}(_0x8fa8,0xe0));var _0x88fa=function(_0x9ed5b5,_0x2652bf){_0x9ed5b5=_0x9ed5b5-0x0;var _0x4f68d1=_0x8fa8[_0x9ed5b5];return _0x4f68d1;};'use strict';var _=require(_0x88fa('0x0'));var util=require('util');var moment=require(_0x88fa('0x1'));var BPromise=require(_0x88fa('0x2'));var rs=require(_0x88fa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88fa('0x4'))['db'];var utils=require(_0x88fa('0x5'));var logger=require('../../config/logger')(_0x88fa('0x6'));var config=require('../../config/environment');var jayson=require(_0x88fa('0x7'));var client=jayson[_0x88fa('0x8')]['http']({'port':0x232a});config[_0x88fa('0x9')]=_['defaults'](config[_0x88fa('0x9')],{'host':_0x88fa('0xa'),'port':0x18eb});var socket=require(_0x88fa('0xb'))(new Redis(config[_0x88fa('0x9')]));require(_0x88fa('0xc'))[_0x88fa('0xd')](socket);function respondWithRpcPromise(_0x12c883,_0x5df65,_0x2c47e9){return new BPromise(function(_0x266ef9,_0x3508c8){return client[_0x88fa('0xe')](_0x12c883,_0x2c47e9)[_0x88fa('0xf')](function(_0xc170){logger[_0x88fa('0x10')]('DashboardItem,\x20%s,\x20%s',_0x5df65,_0x88fa('0x11'));logger[_0x88fa('0x12')](_0x88fa('0x13'),_0x5df65,_0x88fa('0x11'),JSON[_0x88fa('0x14')](_0xc170));if(_0xc170['error']){if(_0xc170[_0x88fa('0x15')][_0x88fa('0x16')]===0x1f4){logger[_0x88fa('0x15')](_0x88fa('0x17'),_0x5df65,_0xc170[_0x88fa('0x15')][_0x88fa('0x18')]);return _0x3508c8(_0xc170[_0x88fa('0x15')][_0x88fa('0x18')]);}logger[_0x88fa('0x15')](_0x88fa('0x17'),_0x5df65,_0xc170[_0x88fa('0x15')][_0x88fa('0x18')]);return _0x266ef9(_0xc170[_0x88fa('0x15')]['message']);}else{logger[_0x88fa('0x10')](_0x88fa('0x17'),_0x5df65,_0x88fa('0x11'));_0x266ef9(_0xc170[_0x88fa('0x19')][_0x88fa('0x18')]);}})[_0x88fa('0x1a')](function(_0x2787ba){logger['error']('DashboardItem,\x20%s,\x20%s',_0x5df65,_0x2787ba);_0x3508c8(_0x2787ba);});});}
\ No newline at end of file
+var _0x69b5=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69b5,0xf7));var _0x569b=function(_0x19eb43,_0x10c355){_0x19eb43=_0x19eb43-0x0;var _0x57598c=_0x69b5[_0x19eb43];return _0x57598c;};'use strict';var _=require(_0x569b('0x0'));var util=require(_0x569b('0x1'));var moment=require('moment');var BPromise=require(_0x569b('0x2'));var rs=require(_0x569b('0x3'));var fs=require('fs');var Redis=require(_0x569b('0x4'));var db=require(_0x569b('0x5'))['db'];var utils=require(_0x569b('0x6'));var logger=require(_0x569b('0x7'))('rpc');var config=require(_0x569b('0x8'));var jayson=require(_0x569b('0x9'));var client=jayson[_0x569b('0xa')][_0x569b('0xb')]({'port':0x232a});config[_0x569b('0xc')]=_['defaults'](config[_0x569b('0xc')],{'host':_0x569b('0xd'),'port':0x18eb});var socket=require(_0x569b('0xe'))(new Redis(config[_0x569b('0xc')]));require(_0x569b('0xf'))['register'](socket);function respondWithRpcPromise(_0x35a5b4,_0x115ddc,_0x22a94b){return new BPromise(function(_0x5bf4e8,_0x34d9c4){return client[_0x569b('0x10')](_0x35a5b4,_0x22a94b)[_0x569b('0x11')](function(_0x2e61a6){logger[_0x569b('0x12')](_0x569b('0x13'),_0x115ddc,'request\x20sent');logger['debug'](_0x569b('0x14'),_0x115ddc,_0x569b('0x15'),JSON[_0x569b('0x16')](_0x2e61a6));if(_0x2e61a6[_0x569b('0x17')]){if(_0x2e61a6[_0x569b('0x17')][_0x569b('0x18')]===0x1f4){logger[_0x569b('0x17')](_0x569b('0x13'),_0x115ddc,_0x2e61a6[_0x569b('0x17')][_0x569b('0x19')]);return _0x34d9c4(_0x2e61a6[_0x569b('0x17')][_0x569b('0x19')]);}logger['error'](_0x569b('0x13'),_0x115ddc,_0x2e61a6[_0x569b('0x17')]['message']);return _0x5bf4e8(_0x2e61a6['error'][_0x569b('0x19')]);}else{logger[_0x569b('0x12')](_0x569b('0x13'),_0x115ddc,_0x569b('0x15'));_0x5bf4e8(_0x2e61a6[_0x569b('0x1a')][_0x569b('0x19')]);}})[_0x569b('0x1b')](function(_0x1dfe7a){logger[_0x569b('0x17')](_0x569b('0x13'),_0x115ddc,_0x1dfe7a);_0x34d9c4(_0x1dfe7a);});});}
\ No newline at end of file
index bb2984b..91dfe30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6afb=['length','dashboardItem:','./dashboardItem.events','remove','update','emit'];(function(_0x13e0e8,_0x26d8bb){var _0x4812b7=function(_0x39d9ed){while(--_0x39d9ed){_0x13e0e8['push'](_0x13e0e8['shift']());}};_0x4812b7(++_0x26d8bb);}(_0x6afb,0x7a));var _0xb6af=function(_0x250669,_0xb15e88){_0x250669=_0x250669-0x0;var _0x131447=_0x6afb[_0x250669];return _0x131447;};'use strict';var DashboardItemEvents=require(_0xb6af('0x0'));var events=['save',_0xb6af('0x1'),_0xb6af('0x2')];function createListener(_0x3fc357,_0x918f3b){return function(_0x4362d9){_0x918f3b[_0xb6af('0x3')](_0x3fc357,_0x4362d9);};}function removeListener(_0x1c7699,_0x3ea148){return function(){DashboardItemEvents['removeListener'](_0x1c7699,_0x3ea148);};}exports['register']=function(_0x2ba987){for(var _0x4d8c03=0x0,_0x21f38f=events[_0xb6af('0x4')];_0x4d8c03<_0x21f38f;_0x4d8c03++){var _0x882898=events[_0x4d8c03];var _0x33c889=createListener(_0xb6af('0x5')+_0x882898,_0x2ba987);DashboardItemEvents['on'](_0x882898,_0x33c889);}};
\ No newline at end of file
+var _0xe017=['register','length','save','remove','update','emit'];(function(_0x3f74f8,_0x11648c){var _0xe6ff97=function(_0x19f67a){while(--_0x19f67a){_0x3f74f8['push'](_0x3f74f8['shift']());}};_0xe6ff97(++_0x11648c);}(_0xe017,0x9e));var _0x7e01=function(_0x4bd239,_0x160087){_0x4bd239=_0x4bd239-0x0;var _0x554ada=_0xe017[_0x4bd239];return _0x554ada;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x7e01('0x0'),_0x7e01('0x1'),_0x7e01('0x2')];function createListener(_0x21d8ec,_0x24de17){return function(_0x58ee28){_0x24de17[_0x7e01('0x3')](_0x21d8ec,_0x58ee28);};}function removeListener(_0x54771f,_0x4ca439){return function(){DashboardItemEvents['removeListener'](_0x54771f,_0x4ca439);};}exports[_0x7e01('0x4')]=function(_0x44abdb){for(var _0x3a404e=0x0,_0x2c66ea=events[_0x7e01('0x5')];_0x3a404e<_0x2c66ea;_0x3a404e++){var _0xbcd195=events[_0x3a404e];var _0x454abc=createListener('dashboardItem:'+_0xbcd195,_0x44abdb);DashboardItemEvents['on'](_0xbcd195,_0x454abc);}};
\ No newline at end of file
index 8a5cc10..9ed665f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x633a=['/:id','show','isAuthenticated','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x633a,0x1f3));var _0xa633=function(_0x39931b,_0x2204b6){_0x39931b=_0x39931b-0x0;var _0x5cbd66=_0x633a[_0x39931b];return _0x5cbd66;};'use strict';var multer=require(_0xa633('0x0'));var util=require(_0xa633('0x1'));var path=require(_0xa633('0x2'));var timeout=require(_0xa633('0x3'));var express=require(_0xa633('0x4'));var router=express[_0xa633('0x5')]();var fs_extra=require(_0xa633('0x6'));var auth=require(_0xa633('0x7'));var interaction=require(_0xa633('0x8'));var config=require(_0xa633('0x9'));var controller=require(_0xa633('0xa'));router['get'](_0xa633('0xb'),auth['isAuthenticated'](),controller[_0xa633('0xc')]);router['post']('/',auth[_0xa633('0xd')](),controller['create']);router[_0xa633('0xe')]('/:id',auth[_0xa633('0xd')](),controller['update']);router['delete'](_0xa633('0xb'),auth[_0xa633('0xd')](),controller[_0xa633('0xf')]);module[_0xa633('0x10')]=router;
\ No newline at end of file
+var _0xce28=['isAuthenticated','post','create','put','/:id','update','delete','destroy','util','connect-timeout','express','../../config/environment','./dashboardItem.controller','get'];(function(_0x4c4014,_0x16c1c3){var _0x38d1a3=function(_0x212c66){while(--_0x212c66){_0x4c4014['push'](_0x4c4014['shift']());}};_0x38d1a3(++_0x16c1c3);}(_0xce28,0x6a));var _0x8ce2=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xce28[_0x3305de];return _0x3b5a84;};'use strict';var multer=require('multer');var util=require(_0x8ce2('0x0'));var path=require('path');var timeout=require(_0x8ce2('0x1'));var express=require(_0x8ce2('0x2'));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(_0x8ce2('0x3'));var controller=require(_0x8ce2('0x4'));router[_0x8ce2('0x5')]('/:id',auth[_0x8ce2('0x6')](),controller['show']);router[_0x8ce2('0x7')]('/',auth[_0x8ce2('0x6')](),controller[_0x8ce2('0x8')]);router[_0x8ce2('0x9')](_0x8ce2('0xa'),auth[_0x8ce2('0x6')](),controller[_0x8ce2('0xb')]);router[_0x8ce2('0xc')](_0x8ce2('0xa'),auth[_0x8ce2('0x6')](),controller[_0x8ce2('0xd')]);module['exports']=router;
\ No newline at end of file
index 3ca7423..05d98c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2807=['sequelize','exports','STRING','ENUM','first','second','third'];(function(_0x11f0f8,_0x8dd421){var _0x2cd5e6=function(_0x4b428b){while(--_0x4b428b){_0x11f0f8['push'](_0x11f0f8['shift']());}};_0x2cd5e6(++_0x8dd421);}(_0x2807,0x19d));var _0x7280=function(_0x289549,_0x50a556){_0x289549=_0x289549-0x0;var _0x45ce94=_0x2807[_0x289549];return _0x45ce94;};'use strict';var Sequelize=require(_0x7280('0x0'));module[_0x7280('0x1')]={'name':{'type':Sequelize[_0x7280('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x7280('0x3')](_0x7280('0x4'),_0x7280('0x5'),_0x7280('0x6')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x7280('0x2')]}};
\ No newline at end of file
+var _0xc974=['ENUM','first','second','third'];(function(_0x426711,_0x12264c){var _0x592991=function(_0x564614){while(--_0x564614){_0x426711['push'](_0x426711['shift']());}};_0x592991(++_0x12264c);}(_0xc974,0x170));var _0x4c97=function(_0x1ae04a,_0x26db4a){_0x1ae04a=_0x1ae04a-0x0;var _0x57a3c6=_0xc974[_0x1ae04a];return _0x57a3c6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x4c97('0x0')](_0x4c97('0x1'),_0x4c97('0x2'),_0x4c97('0x3')),'allowNull':![],'defaultValue':_0x4c97('0x1')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index c44849d..76e2d5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5285=['include','findAll','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll'];(function(_0x123797,_0x5b187b){var _0x3a8f49=function(_0x5e3e1e){while(--_0x5e3e1e){_0x123797['push'](_0x123797['shift']());}};_0x3a8f49(++_0x5b187b);}(_0x5285,0x1a7));var _0x5528=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x5285[_0x4629ee];return _0x47fb5b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5528('0x0'));var jsonpatch=require(_0x5528('0x1'));var rp=require('request-promise');var moment=require(_0x5528('0x2'));var BPromise=require(_0x5528('0x3'));var Mustache=require(_0x5528('0x4'));var util=require('util');var path=require(_0x5528('0x5'));var sox=require(_0x5528('0x6'));var csv=require(_0x5528('0x7'));var ejs=require(_0x5528('0x8'));var fs=require('fs');var fs_extra=require(_0x5528('0x9'));var _=require('lodash');var squel=require(_0x5528('0xa'));var crypto=require(_0x5528('0xb'));var jsforce=require(_0x5528('0xc'));var deskjs=require(_0x5528('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5528('0xe'));var Redis=require(_0x5528('0xf'));var authService=require(_0x5528('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5528('0x11'));var hardwareService=require(_0x5528('0x12'));var logger=require(_0x5528('0x13'))(_0x5528('0x14'));var utils=require(_0x5528('0x15'));var config=require(_0x5528('0x16'));var licenseUtil=require(_0x5528('0x17'));var db=require(_0x5528('0x18'))['db'];function respondWithStatusCode(_0xec5227,_0x57bdd8){_0x57bdd8=_0x57bdd8||0xcc;return function(_0x1cc8eb){if(_0x1cc8eb){return _0xec5227[_0x5528('0x19')](_0x57bdd8);}return _0xec5227[_0x5528('0x1a')](_0x57bdd8)[_0x5528('0x1b')]();};}function respondWithResult(_0x36299b,_0x2bb748){_0x2bb748=_0x2bb748||0xc8;return function(_0x4bec28){if(_0x4bec28){return _0x36299b['status'](_0x2bb748)[_0x5528('0x1c')](_0x4bec28);}};}function respondWithFilteredResult(_0x5c8954,_0x1363f3){return function(_0x6bf6a0){if(_0x6bf6a0){var _0x5fac8=typeof _0x1363f3[_0x5528('0x1d')]===_0x5528('0x1e')&&typeof _0x1363f3[_0x5528('0x1f')]===_0x5528('0x1e');var _0x26be37=_0x6bf6a0[_0x5528('0x20')];var _0x3b5990=_0x5fac8?0x0:_0x1363f3[_0x5528('0x1d')];var _0x4b0620=_0x5fac8?_0x6bf6a0[_0x5528('0x20')]:_0x1363f3['offset']+_0x1363f3[_0x5528('0x1f')];var _0x4ea11b;if(_0x4b0620>=_0x26be37){_0x4b0620=_0x26be37;_0x4ea11b=0xc8;}else{_0x4ea11b=0xce;}_0x5c8954['status'](_0x4ea11b);return _0x5c8954[_0x5528('0x21')]('Content-Range',_0x3b5990+'-'+_0x4b0620+'/'+_0x26be37)['json'](_0x6bf6a0);}return null;};}function patchUpdates(_0x5a4a36){return function(_0x376800){try{jsonpatch['apply'](_0x376800,_0x5a4a36,!![]);}catch(_0x19e5f9){return BPromise[_0x5528('0x22')](_0x19e5f9);}return _0x376800[_0x5528('0x23')]();};}function saveUpdates(_0x40b118,_0x2cdd58){return function(_0x261adb){if(_0x261adb){return _0x261adb[_0x5528('0x24')](_0x40b118)[_0x5528('0x25')](function(_0x210a0c){return _0x210a0c;});}return null;};}function removeEntity(_0x43d4ae,_0x4f0c5f){return function(_0x10bf8d){if(_0x10bf8d){return _0x10bf8d[_0x5528('0x26')]()['then'](function(){var _0x17e281=_0x10bf8d[_0x5528('0x27')]({'plain':!![]});var _0x34dfcd=_0x5528('0x28');return db[_0x5528('0x29')]['destroy']({'where':{'type':_0x34dfcd,'resourceId':_0x17e281['id']}})[_0x5528('0x25')](function(){return _0x10bf8d;});})[_0x5528('0x25')](function(){_0x43d4ae[_0x5528('0x1a')](0xcc)[_0x5528('0x1b')]();});}};}function handleEntityNotFound(_0x45eebc,_0x1e1f55){return function(_0xbee7a7){if(!_0xbee7a7){_0x45eebc[_0x5528('0x19')](0x194);}return _0xbee7a7;};}function handleError(_0x5abcf9,_0x596926){_0x596926=_0x596926||0x1f4;return function(_0x4d954b){logger[_0x5528('0x2a')](_0x4d954b[_0x5528('0x2b')]);if(_0x4d954b[_0x5528('0x2c')]){delete _0x4d954b[_0x5528('0x2c')];}_0x5abcf9[_0x5528('0x1a')](_0x596926)[_0x5528('0x2d')](_0x4d954b);};}exports[_0x5528('0x2e')]=function(_0xe86f9b,_0x1f0dab){var _0x1a3f10={},_0x4ddd19={},_0x4f023e={'count':0x0,'rows':[]};var _0x62ab65=_[_0x5528('0x2f')](db[_0x5528('0x30')][_0x5528('0x31')],function(_0x4cbe62){return{'name':_0x4cbe62[_0x5528('0x32')],'type':_0x4cbe62['type'][_0x5528('0x33')]};});_0x4ddd19[_0x5528('0x34')]=_['map'](_0x62ab65,_0x5528('0x2c'));_0x4ddd19[_0x5528('0x35')]=_[_0x5528('0x36')](_0xe86f9b['query']);_0x4ddd19[_0x5528('0x37')]=_[_0x5528('0x38')](_0x4ddd19[_0x5528('0x34')],_0x4ddd19[_0x5528('0x35')]);_0x1a3f10[_0x5528('0x39')]=_['intersection'](_0x4ddd19[_0x5528('0x34')],qs[_0x5528('0x3a')](_0xe86f9b[_0x5528('0x35')][_0x5528('0x3a')]));_0x1a3f10[_0x5528('0x39')]=_0x1a3f10['attributes'][_0x5528('0x3b')]?_0x1a3f10[_0x5528('0x39')]:_0x4ddd19[_0x5528('0x34')];if(!_0xe86f9b[_0x5528('0x35')][_0x5528('0x3c')]('nolimit')){_0x1a3f10[_0x5528('0x1f')]=qs[_0x5528('0x1f')](_0xe86f9b[_0x5528('0x35')][_0x5528('0x1f')]);_0x1a3f10[_0x5528('0x1d')]=qs[_0x5528('0x1d')](_0xe86f9b[_0x5528('0x35')][_0x5528('0x1d')]);}_0x1a3f10[_0x5528('0x3d')]=qs[_0x5528('0x3e')](_0xe86f9b[_0x5528('0x35')][_0x5528('0x3e')]);_0x1a3f10[_0x5528('0x3f')]=qs['filters'](_[_0x5528('0x40')](_0xe86f9b['query'],_0x4ddd19[_0x5528('0x37')]),_0x62ab65);if(_0xe86f9b['query'][_0x5528('0x41')]){_0x1a3f10[_0x5528('0x3f')]=_[_0x5528('0x42')](_0x1a3f10[_0x5528('0x3f')],{'$or':_[_0x5528('0x2f')](_0x62ab65,function(_0x5bc4cf){if(_0x5bc4cf['type']!==_0x5528('0x43')){var _0x4b46d4={};_0x4b46d4[_0x5bc4cf['name']]={'$like':'%'+_0xe86f9b['query'][_0x5528('0x41')]+'%'};return _0x4b46d4;}})});}_0x1a3f10=_[_0x5528('0x42')]({},_0x1a3f10,_0xe86f9b['options']);var _0x43185b={'where':_0x1a3f10[_0x5528('0x3f')]};return db[_0x5528('0x30')][_0x5528('0x20')](_0x43185b)[_0x5528('0x25')](function(_0x1944bc){_0x4f023e[_0x5528('0x20')]=_0x1944bc;if(_0xe86f9b[_0x5528('0x35')][_0x5528('0x44')]){_0x1a3f10[_0x5528('0x45')]=[{'all':!![]}];}return db[_0x5528('0x30')][_0x5528('0x46')](_0x1a3f10);})[_0x5528('0x25')](function(_0x1c8ee4){_0x4f023e['rows']=_0x1c8ee4;return _0x4f023e;})[_0x5528('0x25')](respondWithFilteredResult(_0x1f0dab,_0x1a3f10))['catch'](handleError(_0x1f0dab,null));};exports['show']=function(_0x5cc905,_0x103315){var _0x57305d={'raw':!![],'where':{'id':_0x5cc905['params']['id']}},_0x546fb7={};_0x546fb7[_0x5528('0x34')]=_[_0x5528('0x36')](db[_0x5528('0x30')]['rawAttributes']);_0x546fb7['query']=_[_0x5528('0x36')](_0x5cc905['query']);_0x546fb7['filters']=_[_0x5528('0x38')](_0x546fb7[_0x5528('0x34')],_0x546fb7[_0x5528('0x35')]);_0x57305d[_0x5528('0x39')]=_[_0x5528('0x38')](_0x546fb7[_0x5528('0x34')],qs['fields'](_0x5cc905[_0x5528('0x35')]['fields']));_0x57305d[_0x5528('0x39')]=_0x57305d[_0x5528('0x39')]['length']?_0x57305d['attributes']:_0x546fb7[_0x5528('0x34')];if(_0x5cc905[_0x5528('0x35')][_0x5528('0x44')]){_0x57305d[_0x5528('0x45')]=[{'all':!![]}];}_0x57305d=_[_0x5528('0x42')]({},_0x57305d,_0x5cc905[_0x5528('0x47')]);return db['Disposition'][_0x5528('0x48')](_0x57305d)[_0x5528('0x25')](handleEntityNotFound(_0x103315,null))[_0x5528('0x25')](respondWithResult(_0x103315,null))[_0x5528('0x49')](handleError(_0x103315,null));};exports[_0x5528('0x4a')]=function(_0x18698c,_0x58fd3d){return db['Disposition'][_0x5528('0x4a')](_0x18698c[_0x5528('0x4b')],{})[_0x5528('0x25')](function(_0x4007eb){var _0x48c0bf=_0x18698c['user'][_0x5528('0x27')]({'plain':!![]});if(!_0x48c0bf)throw new Error(_0x5528('0x4c'));if(_0x48c0bf['role']===_0x5528('0x4d')){var _0x2134d0=_0x4007eb[_0x5528('0x27')]({'plain':!![]});var _0xd396b1='Dispositions';return db[_0x5528('0x4e')]['find']({'where':{'name':_0xd396b1,'userProfileId':_0x48c0bf[_0x5528('0x4f')]},'raw':!![]})[_0x5528('0x25')](function(_0x287a02){if(_0x287a02&&_0x287a02[_0x5528('0x50')]===0x0){return db['UserProfileResource'][_0x5528('0x4a')]({'name':_0x2134d0[_0x5528('0x2c')],'resourceId':_0x2134d0['id'],'type':_0x287a02[_0x5528('0x2c')],'sectionId':_0x287a02['id']},{})[_0x5528('0x25')](function(){return _0x4007eb;});}else{return _0x4007eb;}})['catch'](function(_0x564e31){logger[_0x5528('0x2a')](_0x5528('0x51'),_0x564e31);throw _0x564e31;});}return _0x4007eb;})['then'](respondWithResult(_0x58fd3d,0xc9))[_0x5528('0x49')](handleError(_0x58fd3d,null));};exports['update']=function(_0x48a2e0,_0x252d85){if(_0x48a2e0[_0x5528('0x4b')]['id']){delete _0x48a2e0['body']['id'];}return db[_0x5528('0x30')][_0x5528('0x48')]({'where':{'id':_0x48a2e0['params']['id']}})[_0x5528('0x25')](handleEntityNotFound(_0x252d85,null))[_0x5528('0x25')](saveUpdates(_0x48a2e0[_0x5528('0x4b')],null))['then'](respondWithResult(_0x252d85,null))[_0x5528('0x49')](handleError(_0x252d85,null));};exports[_0x5528('0x26')]=function(_0x192141,_0x329b65){return db[_0x5528('0x30')][_0x5528('0x48')]({'where':{'id':_0x192141['params']['id']}})['then'](handleEntityNotFound(_0x329b65,null))[_0x5528('0x25')](removeEntity(_0x329b65,null))['catch'](handleError(_0x329b65,null));};
\ No newline at end of file
+var _0x737c=['status','end','json','offset','undefined','count','limit','set','reject','update','then','destroy','Dispositions','UserProfileResource','stack','name','send','index','Disposition','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','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','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x28e946,_0x496246){var _0x135837=function(_0x1316c7){while(--_0x1316c7){_0x28e946['push'](_0x28e946['shift']());}};_0x135837(++_0x496246);}(_0x737c,0x1d2));var _0xc737=function(_0x1291b3,_0x54cc6b){_0x1291b3=_0x1291b3-0x0;var _0x48645f=_0x737c[_0x1291b3];return _0x48645f;};'use strict';var emlformat=require(_0xc737('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc737('0x1'));var jsonpatch=require(_0xc737('0x2'));var rp=require(_0xc737('0x3'));var moment=require(_0xc737('0x4'));var BPromise=require(_0xc737('0x5'));var Mustache=require(_0xc737('0x6'));var util=require(_0xc737('0x7'));var path=require('path');var sox=require(_0xc737('0x8'));var csv=require('to-csv');var ejs=require(_0xc737('0x9'));var fs=require('fs');var fs_extra=require(_0xc737('0xa'));var _=require('lodash');var squel=require(_0xc737('0xb'));var crypto=require(_0xc737('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc737('0xd'));var toCsv=require(_0xc737('0xe'));var querystring=require(_0xc737('0xf'));var Papa=require(_0xc737('0x10'));var Redis=require('ioredis');var authService=require(_0xc737('0x11'));var qs=require(_0xc737('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc737('0x13'));var logger=require(_0xc737('0x14'))(_0xc737('0x15'));var utils=require(_0xc737('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc737('0x17'));var db=require(_0xc737('0x18'))['db'];function respondWithStatusCode(_0x39e551,_0x21b9bc){_0x21b9bc=_0x21b9bc||0xcc;return function(_0x3e8954){if(_0x3e8954){return _0x39e551[_0xc737('0x19')](_0x21b9bc);}return _0x39e551[_0xc737('0x1a')](_0x21b9bc)[_0xc737('0x1b')]();};}function respondWithResult(_0x1e2dff,_0x5807bf){_0x5807bf=_0x5807bf||0xc8;return function(_0x4e5c19){if(_0x4e5c19){return _0x1e2dff[_0xc737('0x1a')](_0x5807bf)[_0xc737('0x1c')](_0x4e5c19);}};}function respondWithFilteredResult(_0x5da001,_0x3c0405){return function(_0x55efa0){if(_0x55efa0){var _0x4e0e2d=typeof _0x3c0405[_0xc737('0x1d')]===_0xc737('0x1e')&&typeof _0x3c0405['limit']===_0xc737('0x1e');var _0x53a03f=_0x55efa0['count'];var _0x52746f=_0x4e0e2d?0x0:_0x3c0405[_0xc737('0x1d')];var _0x12ed29=_0x4e0e2d?_0x55efa0[_0xc737('0x1f')]:_0x3c0405[_0xc737('0x1d')]+_0x3c0405[_0xc737('0x20')];var _0x116b6d;if(_0x12ed29>=_0x53a03f){_0x12ed29=_0x53a03f;_0x116b6d=0xc8;}else{_0x116b6d=0xce;}_0x5da001[_0xc737('0x1a')](_0x116b6d);return _0x5da001[_0xc737('0x21')]('Content-Range',_0x52746f+'-'+_0x12ed29+'/'+_0x53a03f)[_0xc737('0x1c')](_0x55efa0);}return null;};}function patchUpdates(_0xa2bef7){return function(_0x3e50bf){try{jsonpatch['apply'](_0x3e50bf,_0xa2bef7,!![]);}catch(_0x444f29){return BPromise[_0xc737('0x22')](_0x444f29);}return _0x3e50bf['save']();};}function saveUpdates(_0x5ab423,_0xa47ef8){return function(_0x4aae9d){if(_0x4aae9d){return _0x4aae9d[_0xc737('0x23')](_0x5ab423)[_0xc737('0x24')](function(_0x57be73){return _0x57be73;});}return null;};}function removeEntity(_0x5c8eea,_0x32677f){return function(_0x1cdfc6){if(_0x1cdfc6){return _0x1cdfc6[_0xc737('0x25')]()['then'](function(){var _0x50a7d1=_0x1cdfc6['get']({'plain':!![]});var _0x431496=_0xc737('0x26');return db[_0xc737('0x27')][_0xc737('0x25')]({'where':{'type':_0x431496,'resourceId':_0x50a7d1['id']}})[_0xc737('0x24')](function(){return _0x1cdfc6;});})[_0xc737('0x24')](function(){_0x5c8eea['status'](0xcc)[_0xc737('0x1b')]();});}};}function handleEntityNotFound(_0x378700,_0x50ff82){return function(_0xa271ef){if(!_0xa271ef){_0x378700[_0xc737('0x19')](0x194);}return _0xa271ef;};}function handleError(_0x1502d4,_0x2f46d9){_0x2f46d9=_0x2f46d9||0x1f4;return function(_0x5932d0){logger['error'](_0x5932d0[_0xc737('0x28')]);if(_0x5932d0[_0xc737('0x29')]){delete _0x5932d0[_0xc737('0x29')];}_0x1502d4['status'](_0x2f46d9)[_0xc737('0x2a')](_0x5932d0);};}exports[_0xc737('0x2b')]=function(_0x16b85d,_0x52f284){var _0x1699ce={},_0x44e093={},_0x16ea5e={'count':0x0,'rows':[]};var _0x132986=_['map'](db[_0xc737('0x2c')][_0xc737('0x2d')],function(_0x2a42e8){return{'name':_0x2a42e8[_0xc737('0x2e')],'type':_0x2a42e8[_0xc737('0x2f')]['key']};});_0x44e093[_0xc737('0x30')]=_[_0xc737('0x31')](_0x132986,_0xc737('0x29'));_0x44e093[_0xc737('0x32')]=_[_0xc737('0x33')](_0x16b85d[_0xc737('0x32')]);_0x44e093[_0xc737('0x34')]=_[_0xc737('0x35')](_0x44e093[_0xc737('0x30')],_0x44e093['query']);_0x1699ce[_0xc737('0x36')]=_[_0xc737('0x35')](_0x44e093['model'],qs[_0xc737('0x37')](_0x16b85d['query'][_0xc737('0x37')]));_0x1699ce[_0xc737('0x36')]=_0x1699ce[_0xc737('0x36')]['length']?_0x1699ce[_0xc737('0x36')]:_0x44e093[_0xc737('0x30')];if(!_0x16b85d['query'][_0xc737('0x38')](_0xc737('0x39'))){_0x1699ce[_0xc737('0x20')]=qs[_0xc737('0x20')](_0x16b85d[_0xc737('0x32')][_0xc737('0x20')]);_0x1699ce[_0xc737('0x1d')]=qs['offset'](_0x16b85d['query'][_0xc737('0x1d')]);}_0x1699ce[_0xc737('0x3a')]=qs[_0xc737('0x3b')](_0x16b85d[_0xc737('0x32')][_0xc737('0x3b')]);_0x1699ce['where']=qs['filters'](_[_0xc737('0x3c')](_0x16b85d[_0xc737('0x32')],_0x44e093[_0xc737('0x34')]),_0x132986);if(_0x16b85d[_0xc737('0x32')][_0xc737('0x3d')]){_0x1699ce[_0xc737('0x3e')]=_[_0xc737('0x3f')](_0x1699ce['where'],{'$or':_[_0xc737('0x31')](_0x132986,function(_0x56301c){if(_0x56301c[_0xc737('0x2f')]!==_0xc737('0x40')){var _0x5aab5a={};_0x5aab5a[_0x56301c['name']]={'$like':'%'+_0x16b85d[_0xc737('0x32')][_0xc737('0x3d')]+'%'};return _0x5aab5a;}})});}_0x1699ce=_[_0xc737('0x3f')]({},_0x1699ce,_0x16b85d['options']);var _0x133f22={'where':_0x1699ce[_0xc737('0x3e')]};return db['Disposition']['count'](_0x133f22)[_0xc737('0x24')](function(_0x28b9c4){_0x16ea5e[_0xc737('0x1f')]=_0x28b9c4;if(_0x16b85d['query'][_0xc737('0x41')]){_0x1699ce['include']=[{'all':!![]}];}return db[_0xc737('0x2c')][_0xc737('0x42')](_0x1699ce);})[_0xc737('0x24')](function(_0x340686){_0x16ea5e[_0xc737('0x43')]=_0x340686;return _0x16ea5e;})['then'](respondWithFilteredResult(_0x52f284,_0x1699ce))[_0xc737('0x44')](handleError(_0x52f284,null));};exports[_0xc737('0x45')]=function(_0x762689,_0x16ea50){var _0x1e4459={'raw':!![],'where':{'id':_0x762689[_0xc737('0x46')]['id']}},_0x130d1f={};_0x130d1f[_0xc737('0x30')]=_['keys'](db[_0xc737('0x2c')][_0xc737('0x2d')]);_0x130d1f[_0xc737('0x32')]=_[_0xc737('0x33')](_0x762689[_0xc737('0x32')]);_0x130d1f[_0xc737('0x34')]=_['intersection'](_0x130d1f['model'],_0x130d1f[_0xc737('0x32')]);_0x1e4459[_0xc737('0x36')]=_['intersection'](_0x130d1f[_0xc737('0x30')],qs['fields'](_0x762689['query']['fields']));_0x1e4459[_0xc737('0x36')]=_0x1e4459[_0xc737('0x36')]['length']?_0x1e4459['attributes']:_0x130d1f[_0xc737('0x30')];if(_0x762689[_0xc737('0x32')][_0xc737('0x41')]){_0x1e4459[_0xc737('0x47')]=[{'all':!![]}];}_0x1e4459=_[_0xc737('0x3f')]({},_0x1e4459,_0x762689['options']);return db[_0xc737('0x2c')][_0xc737('0x48')](_0x1e4459)[_0xc737('0x24')](handleEntityNotFound(_0x16ea50,null))[_0xc737('0x24')](respondWithResult(_0x16ea50,null))['catch'](handleError(_0x16ea50,null));};exports[_0xc737('0x49')]=function(_0x2c36c1,_0x270267){return db['Disposition']['create'](_0x2c36c1[_0xc737('0x4a')],{})[_0xc737('0x24')](function(_0x150984){var _0x2a8f7e=_0x2c36c1[_0xc737('0x4b')][_0xc737('0x4c')]({'plain':!![]});if(!_0x2a8f7e)throw new Error(_0xc737('0x4d'));if(_0x2a8f7e[_0xc737('0x4e')]===_0xc737('0x4b')){var _0x4ab567=_0x150984[_0xc737('0x4c')]({'plain':!![]});var _0x18c830=_0xc737('0x26');return db['UserProfileSection'][_0xc737('0x48')]({'where':{'name':_0x18c830,'userProfileId':_0x2a8f7e[_0xc737('0x4f')]},'raw':!![]})[_0xc737('0x24')](function(_0xe506a0){if(_0xe506a0&&_0xe506a0['autoAssociation']===0x0){return db[_0xc737('0x27')][_0xc737('0x49')]({'name':_0x4ab567[_0xc737('0x29')],'resourceId':_0x4ab567['id'],'type':_0xe506a0[_0xc737('0x29')],'sectionId':_0xe506a0['id']},{})[_0xc737('0x24')](function(){return _0x150984;});}else{return _0x150984;}})['catch'](function(_0x425723){logger[_0xc737('0x50')](_0xc737('0x51'),_0x425723);throw _0x425723;});}return _0x150984;})['then'](respondWithResult(_0x270267,0xc9))[_0xc737('0x44')](handleError(_0x270267,null));};exports[_0xc737('0x23')]=function(_0x28760c,_0x5c296d){if(_0x28760c[_0xc737('0x4a')]['id']){delete _0x28760c['body']['id'];}return db[_0xc737('0x2c')][_0xc737('0x48')]({'where':{'id':_0x28760c[_0xc737('0x46')]['id']}})[_0xc737('0x24')](handleEntityNotFound(_0x5c296d,null))['then'](saveUpdates(_0x28760c[_0xc737('0x4a')],null))['then'](respondWithResult(_0x5c296d,null))[_0xc737('0x44')](handleError(_0x5c296d,null));};exports[_0xc737('0x25')]=function(_0x1f91f9,_0xa7a19e){return db[_0xc737('0x2c')][_0xc737('0x48')]({'where':{'id':_0x1f91f9['params']['id']}})[_0xc737('0x24')](handleEntityNotFound(_0xa7a19e,null))[_0xc737('0x24')](removeEntity(_0xa7a19e,null))['catch'](handleError(_0xa7a19e,null));};
\ No newline at end of file
index 99f82b5..cb67324 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd560=['Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4e4061,_0x26503b){var _0x371dbd=function(_0x31a31f){while(--_0x31a31f){_0x4e4061['push'](_0x4e4061['shift']());}};_0x371dbd(++_0x26503b);}(_0xd560,0x167));var _0x0d56=function(_0x3b089c,_0xb6ceaa){_0x3b089c=_0x3b089c-0x0;var _0x479fc2=_0xd560[_0x3b089c];return _0x479fc2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0d56('0x0'))(_0x0d56('0x1'));var moment=require('moment');var BPromise=require(_0x0d56('0x2'));var rp=require(_0x0d56('0x3'));var fs=require('fs');var path=require(_0x0d56('0x4'));var rimraf=require(_0x0d56('0x5'));var config=require(_0x0d56('0x6'));var attributes=require('./disposition.attributes');module[_0x0d56('0x7')]=function(_0xc09af8,_0x2010ba){return _0xc09af8[_0x0d56('0x8')](_0x0d56('0x9'),attributes,{'tableName':_0x0d56('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x0d56('0xb'),'fields':[_0x0d56('0xc'),_0x0d56('0xd')]},{'unique':!![],'name':_0x0d56('0xe'),'fields':[_0x0d56('0xc'),_0x0d56('0xf')]},{'unique':!![],'name':_0x0d56('0x10'),'fields':[_0x0d56('0xc'),_0x0d56('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0x0d56('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x0d56('0x12'),'fields':[_0x0d56('0xc'),_0x0d56('0x13')]},{'unique':!![],'name':_0x0d56('0x14'),'fields':[_0x0d56('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':_0x0d56('0x15'),'fields':[_0x0d56('0xc'),_0x0d56('0x16')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9051=['tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId','name_sms','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','bluebird','rimraf','exports','define','Disposition'];(function(_0x5d25c1,_0x3e637f){var _0x37901d=function(_0x5bb6e4){while(--_0x5bb6e4){_0x5d25c1['push'](_0x5d25c1['shift']());}};_0x37901d(++_0x3e637f);}(_0x9051,0xf2));var _0x1905=function(_0x39b93c,_0x54fc94){_0x39b93c=_0x39b93c-0x0;var _0x4be668=_0x9051[_0x39b93c];return _0x4be668;};'use strict';var _=require(_0x1905('0x0'));var util=require(_0x1905('0x1'));var logger=require(_0x1905('0x2'))(_0x1905('0x3'));var moment=require(_0x1905('0x4'));var BPromise=require(_0x1905('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1905('0x6'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x1905('0x7')]=function(_0x4e39d4,_0x29c84a){return _0x4e39d4[_0x1905('0x8')](_0x1905('0x9'),attributes,{'tableName':_0x1905('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x1905('0xb'),'fields':['name',_0x1905('0xc')]},{'unique':!![],'name':_0x1905('0xd'),'fields':[_0x1905('0xe'),_0x1905('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x1905('0xe'),'MailAccountId']},{'unique':!![],'name':_0x1905('0x10'),'fields':[_0x1905('0xe'),'SmsAccountId']},{'unique':!![],'name':_0x1905('0x11'),'fields':[_0x1905('0xe'),'FaxAccountId']},{'unique':!![],'name':_0x1905('0x12'),'fields':[_0x1905('0xe'),_0x1905('0x13')]},{'unique':!![],'name':_0x1905('0x14'),'fields':[_0x1905('0xe'),'WhatsappAccountId']}],'timestamps':!![]});};
\ No newline at end of file
index 6c68d69..d16475b 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(_0x452947,_0x205a9d){var _0x1ab49f=function(_0x32d4ec){while(--_0x32d4ec){_0x452947['push'](_0x452947['shift']());}};_0x1ab49f(++_0x205a9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x469d07,_0x1958d2){var _0xaf3a61=function(_0x4d1ec8){while(--_0x4d1ec8){_0x469d07['push'](_0x469d07['shift']());}};_0xaf3a61(++_0x1958d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 063df1d..787bb12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a82=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','multer','util'];(function(_0x3f546d,_0x5353b9){var _0x5a1515=function(_0x5bb7a0){while(--_0x5bb7a0){_0x3f546d['push'](_0x3f546d['shift']());}};_0x5a1515(++_0x5353b9);}(_0x1a82,0xbb));var _0x21a8=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0x1a82[_0xc7348b];return _0x307cec;};'use strict';var multer=require(_0x21a8('0x0'));var util=require(_0x21a8('0x1'));var path=require(_0x21a8('0x2'));var timeout=require(_0x21a8('0x3'));var express=require(_0x21a8('0x4'));var router=express[_0x21a8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x21a8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x21a8('0x7'));var controller=require(_0x21a8('0x8'));router[_0x21a8('0x9')]('/',auth[_0x21a8('0xa')](),controller[_0x21a8('0xb')]);router[_0x21a8('0x9')]('/:id',auth[_0x21a8('0xa')](),controller[_0x21a8('0xc')]);router[_0x21a8('0xd')]('/',auth[_0x21a8('0xa')](),controller[_0x21a8('0xe')]);router[_0x21a8('0xf')]('/:id',auth[_0x21a8('0xa')](),controller[_0x21a8('0x10')]);router[_0x21a8('0x11')](_0x21a8('0x12'),auth[_0x21a8('0xa')](),controller[_0x21a8('0x13')]);module[_0x21a8('0x14')]=router;
\ No newline at end of file
+var _0x1054=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put','/:id','update','destroy','util'];(function(_0x1bd701,_0xbfdfdd){var _0x26f474=function(_0x2abfc2){while(--_0x2abfc2){_0x1bd701['push'](_0x1bd701['shift']());}};_0x26f474(++_0xbfdfdd);}(_0x1054,0x1e5));var _0x4105=function(_0x41f475,_0x1fcf9a){_0x41f475=_0x41f475-0x0;var _0x4bc0bf=_0x1054[_0x41f475];return _0x4bc0bf;};'use strict';var multer=require('multer');var util=require(_0x4105('0x0'));var path=require(_0x4105('0x1'));var timeout=require(_0x4105('0x2'));var express=require(_0x4105('0x3'));var router=express[_0x4105('0x4')]();var fs_extra=require(_0x4105('0x5'));var auth=require(_0x4105('0x6'));var interaction=require(_0x4105('0x7'));var config=require(_0x4105('0x8'));var controller=require('./disposition.controller');router[_0x4105('0x9')]('/',auth[_0x4105('0xa')](),controller[_0x4105('0xb')]);router[_0x4105('0x9')]('/:id',auth[_0x4105('0xa')](),controller[_0x4105('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4105('0xd')]);router[_0x4105('0xe')](_0x4105('0xf'),auth[_0x4105('0xa')](),controller[_0x4105('0x10')]);router['delete'](_0x4105('0xf'),auth['isAuthenticated'](),controller[_0x4105('0x11')]);module['exports']=router;
\ No newline at end of file
index 3a70a87..25cc75f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fa3=['9600','SIP','DADHI','KHOMP','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','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','yes','localstationid','ENUM','2400','7200','12000','14400','4800'];(function(_0x79142e,_0x183972){var _0x4503b3=function(_0x44a7c0){while(--_0x44a7c0){_0x79142e['push'](_0x79142e['shift']());}};_0x4503b3(++_0x183972);}(_0x1fa3,0xc4));var _0x31fa=function(_0xe24dd3,_0x34492b){_0xe24dd3=_0xe24dd3-0x0;var _0x107bd5=_0x1fa3[_0xe24dd3];return _0x107bd5;};'use strict';var Sequelize=require(_0x31fa('0x0'));module[_0x31fa('0x1')]={'name':{'type':Sequelize[_0x31fa('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x31fa('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x31fa('0x3'),'no'),'defaultValue':_0x31fa('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x31fa('0x4')},'minrate':{'type':Sequelize[_0x31fa('0x5')](_0x31fa('0x6'),'4800',_0x31fa('0x7'),'9600',_0x31fa('0x8'),_0x31fa('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x31fa('0x5')](_0x31fa('0x6'),_0x31fa('0xa'),_0x31fa('0x7'),_0x31fa('0xb'),'12000',_0x31fa('0x9')),'defaultValue':_0x31fa('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x31fa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x31fa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x31fa('0xc'),'IAX',_0x31fa('0xd'),_0x31fa('0xe')),'defaultValue':_0x31fa('0xc')},'key':{'type':Sequelize[_0x31fa('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x31fa('0xf')],'defaultValue':function(){return _0x31fa('0x10');}},'notificationSound':{'type':Sequelize[_0x31fa('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x31fa('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x31fa('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x31fa('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x31fa('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x31fa('0x12')],'allowNull':!![],'defaultValue':null,'comment':_0x31fa('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x31fa('0x11')],'defaultValue':![],'comment':_0x31fa('0x14'),'set':function(_0x226cac){if(!_0x226cac)this['setDataValue'](_0x31fa('0x15'),null);this[_0x31fa('0x16')]('mandatoryDisposition',_0x226cac);}}};
\ No newline at end of file
+var _0xe627=['sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','9600','12000','14400','INTEGER','SIP','IAX','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x42f848,_0x56514c){var _0x5e184f=function(_0x3a8c4d){while(--_0x3a8c4d){_0x42f848['push'](_0x42f848['shift']());}};_0x5e184f(++_0x56514c);}(_0xe627,0x73));var _0x7e62=function(_0x5278b9,_0x2ecf0b){_0x5278b9=_0x5278b9-0x0;var _0x53a611=_0xe627[_0x5278b9];return _0x53a611;};'use strict';var Sequelize=require(_0x7e62('0x0'));module[_0x7e62('0x1')]={'name':{'type':Sequelize[_0x7e62('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM'](_0x7e62('0x3'),'no'),'defaultValue':_0x7e62('0x3')},'headerinfo':{'type':Sequelize[_0x7e62('0x2')],'defaultValue':_0x7e62('0x4')},'localstationid':{'type':Sequelize[_0x7e62('0x2')],'unique':_0x7e62('0x5')},'minrate':{'type':Sequelize[_0x7e62('0x6')](_0x7e62('0x7'),_0x7e62('0x8'),_0x7e62('0x9'),_0x7e62('0xa'),_0x7e62('0xb'),_0x7e62('0xc')),'defaultValue':_0x7e62('0x8')},'maxrate':{'type':Sequelize[_0x7e62('0x6')](_0x7e62('0x7'),_0x7e62('0x8'),_0x7e62('0x9'),_0x7e62('0xa'),'12000','14400'),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x7e62('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x7e62('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x7e62('0x6')](_0x7e62('0xe'),_0x7e62('0xf'),'DADHI',_0x7e62('0x10')),'defaultValue':_0x7e62('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7e62('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7e62('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7e62('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7e62('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7e62('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7e62('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7e62('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x7e62('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7e62('0x14'),'set':function(_0x142618){if(!_0x142618)this['setDataValue'](_0x7e62('0x15'),null);this['setDataValue'](_0x7e62('0x16'),_0x142618);}}};
\ No newline at end of file
index 38048d2..ba4122c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf46a=['ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','sequelize','tech','createdAt','updatedAt','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','Contacts','ListId','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','FaxAccount','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','addDisposition','FaxAccountId','getDispositions','Disposition','rows','removeDispositions','addAnswer','CannedAnswer','findOne','removeAnswers','ids','addInteraction','FaxInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','maxrate','t38timeout','/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'];(function(_0x5227c4,_0x5d7483){var _0x1cea07=function(_0x207e8e){while(--_0x207e8e){_0x5227c4['push'](_0x5227c4['shift']());}};_0x1cea07(++_0x5d7483);}(_0xf46a,0xef));var _0xaf46=function(_0x289547,_0x82ec1b){_0x289547=_0x289547-0x0;var _0x54eb36=_0xf46a[_0x289547];return _0x54eb36;};'use strict';var emlformat=require(_0xaf46('0x0'));var rimraf=require(_0xaf46('0x1'));var zipdir=require(_0xaf46('0x2'));var jsonpatch=require(_0xaf46('0x3'));var rp=require(_0xaf46('0x4'));var moment=require(_0xaf46('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaf46('0x6'));var util=require(_0xaf46('0x7'));var path=require(_0xaf46('0x8'));var sox=require(_0xaf46('0x9'));var csv=require(_0xaf46('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf46('0xb'));var _=require(_0xaf46('0xc'));var squel=require(_0xaf46('0xd'));var crypto=require(_0xaf46('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xaf46('0xf'));var toCsv=require(_0xaf46('0xa'));var querystring=require('querystring');var Papa=require(_0xaf46('0x10'));var Redis=require('ioredis');var authService=require(_0xaf46('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaf46('0x12'));var hardwareService=require(_0xaf46('0x13'));var logger=require('../../config/logger')(_0xaf46('0x14'));var utils=require(_0xaf46('0x15'));var config=require(_0xaf46('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf46('0x17'))['db'];config[_0xaf46('0x18')]=_[_0xaf46('0x19')](config['redis'],{'host':_0xaf46('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf46('0x18')]));require('./faxAccount.socket')[_0xaf46('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xaf46('0x1c')][_0xaf46('0x1d')]({'port':0x232c});var client9002=jayson[_0xaf46('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43db11,_0x22da54,_0x25d525,_0xa33ed0){return new BPromise(function(_0x254521,_0x2904f4){var _0x4cb06=_0xa33ed0||client;return _0x4cb06[_0xaf46('0x1e')](_0x43db11,_0x25d525)[_0xaf46('0x1f')](function(_0x1aa3ee){logger[_0xaf46('0x20')](_0xaf46('0x21'),_0x22da54,'request\x20sent');logger[_0xaf46('0x22')](_0xaf46('0x23'),_0x22da54,_0xaf46('0x24'),JSON[_0xaf46('0x25')](_0x1aa3ee));if(_0x1aa3ee['error']){if(_0x1aa3ee[_0xaf46('0x26')][_0xaf46('0x27')]===0x1f4){logger[_0xaf46('0x26')](_0xaf46('0x21'),_0x22da54,_0x1aa3ee[_0xaf46('0x26')]['message']);return _0x2904f4(_0x1aa3ee[_0xaf46('0x26')][_0xaf46('0x28')]);}logger[_0xaf46('0x26')]('FaxAccount,\x20%s,\x20%s',_0x22da54,_0x1aa3ee[_0xaf46('0x26')][_0xaf46('0x28')]);return _0x254521(_0x1aa3ee[_0xaf46('0x26')][_0xaf46('0x28')]);}else{logger[_0xaf46('0x20')](_0xaf46('0x21'),_0x22da54,_0xaf46('0x24'));_0x254521(_0x1aa3ee[_0xaf46('0x29')]['message']);}})['catch'](function(_0x23d1df){logger['error'](_0xaf46('0x21'),_0x22da54,_0x23d1df);_0x2904f4(_0x23d1df);});});}function respondWithStatusCode(_0x4b3712,_0x425aa9){_0x425aa9=_0x425aa9||0xcc;return function(_0x5f76b0){if(_0x5f76b0){return _0x4b3712[_0xaf46('0x2a')](_0x425aa9);}return _0x4b3712[_0xaf46('0x2b')](_0x425aa9)[_0xaf46('0x2c')]();};}function respondWithResult(_0x35800e,_0xf56d7a){_0xf56d7a=_0xf56d7a||0xc8;return function(_0x4d0e4d){if(_0x4d0e4d){return _0x35800e['status'](_0xf56d7a)['json'](_0x4d0e4d);}};}function respondWithFilteredResult(_0x8ae3dd,_0x183e38){return function(_0x1f6784){if(_0x1f6784){var _0x1ddb4d=typeof _0x183e38[_0xaf46('0x2d')]===_0xaf46('0x2e')&&typeof _0x183e38['limit']===_0xaf46('0x2e');var _0x587e25=_0x1f6784[_0xaf46('0x2f')];var _0x4ec3a2=_0x1ddb4d?0x0:_0x183e38[_0xaf46('0x2d')];var _0x3535b1=_0x1ddb4d?_0x1f6784[_0xaf46('0x2f')]:_0x183e38[_0xaf46('0x2d')]+_0x183e38['limit'];var _0x97f523;if(_0x3535b1>=_0x587e25){_0x3535b1=_0x587e25;_0x97f523=0xc8;}else{_0x97f523=0xce;}_0x8ae3dd[_0xaf46('0x2b')](_0x97f523);return _0x8ae3dd[_0xaf46('0x30')](_0xaf46('0x31'),_0x4ec3a2+'-'+_0x3535b1+'/'+_0x587e25)[_0xaf46('0x32')](_0x1f6784);}return null;};}function patchUpdates(_0x5371d4){return function(_0x2d6fbc){try{jsonpatch[_0xaf46('0x33')](_0x2d6fbc,_0x5371d4,!![]);}catch(_0x1a29f7){return BPromise[_0xaf46('0x34')](_0x1a29f7);}return _0x2d6fbc[_0xaf46('0x35')]();};}function saveUpdates(_0x5a60b4,_0x106c2b){return function(_0x3fd79f){if(_0x3fd79f){return _0x3fd79f[_0xaf46('0x36')](_0x5a60b4)[_0xaf46('0x1f')](function(_0x23bd76){return _0x23bd76;});}return null;};}function removeEntity(_0x20dfd3,_0x36a7ed){return function(_0x208e81){if(_0x208e81){return _0x208e81[_0xaf46('0x37')]()[_0xaf46('0x1f')](function(){var _0x28a220=_0x208e81[_0xaf46('0x38')]({'plain':!![]});var _0x5407de='FaxAccounts';return db[_0xaf46('0x39')][_0xaf46('0x37')]({'where':{'type':_0x5407de,'resourceId':_0x28a220['id']}})[_0xaf46('0x1f')](function(){return _0x208e81;});})['then'](function(){_0x20dfd3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26a48a,_0x4b2f7a){return function(_0x4ad8a2){if(!_0x4ad8a2){_0x26a48a[_0xaf46('0x2a')](0x194);}return _0x4ad8a2;};}function handleError(_0x5e29c4,_0x44277c){_0x44277c=_0x44277c||0x1f4;return function(_0x23eea3){logger[_0xaf46('0x26')](_0x23eea3['stack']);if(_0x23eea3['name']){delete _0x23eea3[_0xaf46('0x3a')];}_0x5e29c4[_0xaf46('0x2b')](_0x44277c)[_0xaf46('0x3b')](_0x23eea3);};}exports[_0xaf46('0x3c')]=function(_0x3ee504,_0x3f69c1){var _0x4d741f={'include':[{'model':db[_0xaf46('0x3d')],'as':_0xaf46('0x3e')}]},_0x593597={},_0x15fe64={'count':0x0,'rows':[]};var _0xa8e8fb=_['map'](db['FaxAccount'][_0xaf46('0x3f')],function(_0x726bac){return{'name':_0x726bac[_0xaf46('0x40')],'type':_0x726bac['type'][_0xaf46('0x41')]};});_0x593597[_0xaf46('0x42')]=_[_0xaf46('0x43')](_0xa8e8fb,'name');_0x593597[_0xaf46('0x44')]=_[_0xaf46('0x45')](_0x3ee504[_0xaf46('0x44')]);_0x593597['filters']=_[_0xaf46('0x46')](_0x593597[_0xaf46('0x42')],_0x593597[_0xaf46('0x44')]);_0x4d741f[_0xaf46('0x47')]=_['intersection'](_0x593597[_0xaf46('0x42')],qs['fields'](_0x3ee504[_0xaf46('0x44')][_0xaf46('0x48')]));_0x4d741f[_0xaf46('0x47')]=_0x4d741f[_0xaf46('0x47')][_0xaf46('0x49')]?_0x4d741f[_0xaf46('0x47')]:_0x593597['model'];if(!_0x3ee504[_0xaf46('0x44')][_0xaf46('0x4a')](_0xaf46('0x4b'))){_0x4d741f['limit']=qs[_0xaf46('0x4c')](_0x3ee504[_0xaf46('0x44')][_0xaf46('0x4c')]);_0x4d741f[_0xaf46('0x2d')]=qs[_0xaf46('0x2d')](_0x3ee504[_0xaf46('0x44')]['offset']);}_0x4d741f[_0xaf46('0x4d')]=qs[_0xaf46('0x4e')](_0x3ee504['query'][_0xaf46('0x4e')]);_0x4d741f[_0xaf46('0x4f')]=qs[_0xaf46('0x50')](_[_0xaf46('0x51')](_0x3ee504[_0xaf46('0x44')],_0x593597[_0xaf46('0x50')]),_0xa8e8fb);if(_0x3ee504[_0xaf46('0x44')][_0xaf46('0x52')]){_0x4d741f[_0xaf46('0x4f')]=_['merge'](_0x4d741f[_0xaf46('0x4f')],{'$or':_[_0xaf46('0x43')](_0xa8e8fb,function(_0x279fd7){if(_0x279fd7['type']!==_0xaf46('0x53')){var _0x174d3d={};_0x174d3d[_0x279fd7[_0xaf46('0x3a')]]={'$like':'%'+_0x3ee504[_0xaf46('0x44')][_0xaf46('0x52')]+'%'};return _0x174d3d;}})});}_0x4d741f=_[_0xaf46('0x54')]({},_0x4d741f,_0x3ee504[_0xaf46('0x55')]);var _0x41951e={'where':_0x4d741f[_0xaf46('0x4f')]};return db['FaxAccount'][_0xaf46('0x2f')](_0x41951e)[_0xaf46('0x1f')](function(_0x2215d0){_0x15fe64[_0xaf46('0x2f')]=_0x2215d0;if(_0x3ee504[_0xaf46('0x44')][_0xaf46('0x56')]){_0x4d741f[_0xaf46('0x57')]=[{'all':!![]}];}return db[_0xaf46('0x58')][_0xaf46('0x59')](_0x4d741f);})[_0xaf46('0x1f')](function(_0x5ac99b){_0x15fe64['rows']=_0x5ac99b;return _0x15fe64;})[_0xaf46('0x1f')](respondWithFilteredResult(_0x3f69c1,_0x4d741f))[_0xaf46('0x5a')](handleError(_0x3f69c1,null));};exports[_0xaf46('0x5b')]=function(_0x39c667,_0x7dfbc7){var _0x180094={'raw':![],'where':{'id':_0x39c667[_0xaf46('0x5c')]['id']},'include':[{'model':db[_0xaf46('0x3d')],'as':'mandatoryDispositionPause'}]},_0x1481a={};_0x1481a[_0xaf46('0x42')]=_[_0xaf46('0x45')](db[_0xaf46('0x58')][_0xaf46('0x3f')]);_0x1481a['query']=_[_0xaf46('0x45')](_0x39c667['query']);_0x1481a[_0xaf46('0x50')]=_['intersection'](_0x1481a[_0xaf46('0x42')],_0x1481a[_0xaf46('0x44')]);_0x180094['attributes']=_[_0xaf46('0x46')](_0x1481a['model'],qs['fields'](_0x39c667['query'][_0xaf46('0x48')]));_0x180094[_0xaf46('0x47')]=_0x180094['attributes'][_0xaf46('0x49')]?_0x180094[_0xaf46('0x47')]:_0x1481a['model'];if(_0x39c667[_0xaf46('0x44')]['includeAll']){_0x180094['include']=[{'all':!![]}];}_0x180094=_['merge']({},_0x180094,_0x39c667[_0xaf46('0x55')]);return db[_0xaf46('0x58')][_0xaf46('0x5d')](_0x180094)['then'](handleEntityNotFound(_0x7dfbc7,null))[_0xaf46('0x1f')](respondWithResult(_0x7dfbc7,null))[_0xaf46('0x5a')](handleError(_0x7dfbc7,null));};exports['create']=function(_0xbcf3fc,_0x38e709){return db[_0xaf46('0x58')][_0xaf46('0x5e')](_0xbcf3fc[_0xaf46('0x5f')],{})[_0xaf46('0x1f')](function(_0x4b3386){var _0x4f32bb=_0xbcf3fc[_0xaf46('0x60')][_0xaf46('0x38')]({'plain':!![]});if(!_0x4f32bb)throw new Error(_0xaf46('0x61'));if(_0x4f32bb[_0xaf46('0x62')]===_0xaf46('0x60')){var _0xcedf71=_0x4b3386['get']({'plain':!![]});var _0x5bae27='FaxAccounts';return db[_0xaf46('0x63')][_0xaf46('0x5d')]({'where':{'name':_0x5bae27,'userProfileId':_0x4f32bb['userProfileId']},'raw':!![]})[_0xaf46('0x1f')](function(_0x327522){if(_0x327522&&_0x327522[_0xaf46('0x64')]===0x0){return db[_0xaf46('0x39')][_0xaf46('0x5e')]({'name':_0xcedf71['name'],'resourceId':_0xcedf71['id'],'type':_0x327522[_0xaf46('0x3a')],'sectionId':_0x327522['id']},{})[_0xaf46('0x1f')](function(){return _0x4b3386;});}else{return _0x4b3386;}})[_0xaf46('0x5a')](function(_0x46a5a0){logger[_0xaf46('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46a5a0);throw _0x46a5a0;});}return _0x4b3386;})[_0xaf46('0x1f')](respondWithResult(_0x38e709,0xc9))[_0xaf46('0x5a')](handleError(_0x38e709,null));};exports[_0xaf46('0x36')]=function(_0x3cd8c2,_0x4432e9){if(_0x3cd8c2['body']['id']){delete _0x3cd8c2[_0xaf46('0x5f')]['id'];}return db[_0xaf46('0x58')][_0xaf46('0x5d')]({'where':{'id':_0x3cd8c2['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4432e9,null))[_0xaf46('0x1f')](saveUpdates(_0x3cd8c2['body'],null))['then'](respondWithResult(_0x4432e9,null))[_0xaf46('0x5a')](handleError(_0x4432e9,null));};exports['destroy']=function(_0x111f6a,_0x8b1757){return db[_0xaf46('0x58')][_0xaf46('0x5d')]({'where':{'id':_0x111f6a[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x8b1757,null))[_0xaf46('0x1f')](removeEntity(_0x8b1757,null))[_0xaf46('0x5a')](handleError(_0x8b1757,null));};exports['describe']=function(_0x519565,_0x19d23e){return db[_0xaf46('0x58')][_0xaf46('0x65')]()[_0xaf46('0x1f')](respondWithResult(_0x19d23e,null))[_0xaf46('0x5a')](handleError(_0x19d23e,null));};exports[_0xaf46('0x66')]=function(_0x419ab3,_0x5ac966,_0x328108){if(_0x419ab3[_0xaf46('0x5f')]['id']){delete _0x419ab3[_0xaf46('0x5f')]['id'];}return db[_0xaf46('0x58')]['find']({'where':{'id':_0x419ab3[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x5ac966,null))[_0xaf46('0x1f')](function(_0x145504){if(_0x145504){_0x419ab3[_0xaf46('0x5f')][_0xaf46('0x67')]=_0x145504['id'];return db['Disposition'][_0xaf46('0x5e')](_0x419ab3['body']);}})[_0xaf46('0x1f')](respondWithResult(_0x5ac966,null))['catch'](handleError(_0x5ac966,null));};exports[_0xaf46('0x68')]=function(_0x3995f0,_0x478574,_0x3806b2){var _0x392310={'raw':![],'where':{}};var _0x2549c0={};var _0x203b99={'count':0x0,'rows':[]};return db[_0xaf46('0x58')]['findOne']({'where':{'id':_0x3995f0['params']['id']}})['then'](handleEntityNotFound(_0x478574,null))['then'](function(_0x2bdd32){if(_0x2bdd32){_0x2549c0[_0xaf46('0x42')]=_[_0xaf46('0x45')](db[_0xaf46('0x69')][_0xaf46('0x3f')]);_0x2549c0[_0xaf46('0x44')]=_[_0xaf46('0x45')](_0x3995f0['query']);_0x2549c0[_0xaf46('0x50')]=_['intersection'](_0x2549c0[_0xaf46('0x42')],_0x2549c0[_0xaf46('0x44')]);_0x392310[_0xaf46('0x47')]=_[_0xaf46('0x46')](_0x2549c0['model'],qs[_0xaf46('0x48')](_0x3995f0['query']['fields']));_0x392310[_0xaf46('0x47')]=_0x392310[_0xaf46('0x47')][_0xaf46('0x49')]?_0x392310['attributes']:_0x2549c0['model'];if(!_0x3995f0[_0xaf46('0x44')][_0xaf46('0x4a')]('nolimit')){_0x392310['limit']=qs[_0xaf46('0x4c')](_0x3995f0[_0xaf46('0x44')][_0xaf46('0x4c')]);_0x392310[_0xaf46('0x2d')]=qs[_0xaf46('0x2d')](_0x3995f0[_0xaf46('0x44')]['offset']);}_0x392310[_0xaf46('0x4d')]=qs[_0xaf46('0x4e')](_0x3995f0[_0xaf46('0x44')][_0xaf46('0x4e')]);_0x392310[_0xaf46('0x4f')]=qs['filters'](_['pick'](_0x3995f0[_0xaf46('0x44')],_0x2549c0[_0xaf46('0x50')]));_0x392310[_0xaf46('0x4f')][_0xaf46('0x67')]=_0x2bdd32['id'];if(_0x3995f0[_0xaf46('0x44')][_0xaf46('0x52')]){_0x392310[_0xaf46('0x4f')]=_[_0xaf46('0x54')](_0x392310['where'],{'$or':_[_0xaf46('0x43')](_0x392310[_0xaf46('0x47')],function(_0x1dde87){var _0x23df6c={};_0x23df6c[_0x1dde87]={'$like':'%'+_0x3995f0[_0xaf46('0x44')][_0xaf46('0x52')]+'%'};return _0x23df6c;})});}_0x392310=_[_0xaf46('0x54')]({},_0x392310,_0x3995f0[_0xaf46('0x55')]);return db['Disposition']['count']({'where':_0x392310['where']})[_0xaf46('0x1f')](function(_0x55902c){_0x203b99[_0xaf46('0x2f')]=_0x55902c;if(_0x3995f0[_0xaf46('0x44')][_0xaf46('0x56')]){_0x392310[_0xaf46('0x57')]=[{'all':!![]}];}return db[_0xaf46('0x69')][_0xaf46('0x59')](_0x392310);})['then'](function(_0x417f9c){_0x203b99[_0xaf46('0x6a')]=_0x417f9c;return _0x203b99;});}})[_0xaf46('0x1f')](respondWithFilteredResult(_0x478574,_0x392310))[_0xaf46('0x5a')](handleError(_0x478574,null));};exports[_0xaf46('0x6b')]=function(_0x2cf2fa,_0x2d6ba9,_0x595670){return db[_0xaf46('0x58')][_0xaf46('0x5d')]({'where':{'id':_0x2cf2fa[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x2d6ba9,null))[_0xaf46('0x1f')](function(_0xe024fc){if(_0xe024fc){return _0xe024fc[_0xaf46('0x6b')](_0x2cf2fa[_0xaf46('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x2d6ba9,null))['catch'](handleError(_0x2d6ba9,null));};exports[_0xaf46('0x6c')]=function(_0x2bf6f5,_0x396320,_0x30e5e5){if(_0x2bf6f5[_0xaf46('0x5f')]['id']){delete _0x2bf6f5[_0xaf46('0x5f')]['id'];}return db[_0xaf46('0x58')]['find']({'where':{'id':_0x2bf6f5[_0xaf46('0x5c')]['id']}})['then'](handleEntityNotFound(_0x396320,null))[_0xaf46('0x1f')](function(_0x5532cf){if(_0x5532cf){_0x2bf6f5[_0xaf46('0x5f')][_0xaf46('0x67')]=_0x5532cf['id'];return db[_0xaf46('0x6d')]['create'](_0x2bf6f5[_0xaf46('0x5f')]);}})[_0xaf46('0x1f')](respondWithResult(_0x396320,null))[_0xaf46('0x5a')](handleError(_0x396320,null));};exports['getAnswers']=function(_0x3c7764,_0x3fc058,_0x15f6a3){var _0x1a4eb9={'raw':![],'where':{}};var _0x5d85b8={};var _0x1238a8={'count':0x0,'rows':[]};return db[_0xaf46('0x58')][_0xaf46('0x6e')]({'where':{'id':_0x3c7764['params']['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x3fc058,null))[_0xaf46('0x1f')](function(_0x36ced3){if(_0x36ced3){_0x5d85b8[_0xaf46('0x42')]=_[_0xaf46('0x45')](db[_0xaf46('0x6d')][_0xaf46('0x3f')]);_0x5d85b8['query']=_[_0xaf46('0x45')](_0x3c7764[_0xaf46('0x44')]);_0x5d85b8[_0xaf46('0x50')]=_[_0xaf46('0x46')](_0x5d85b8[_0xaf46('0x42')],_0x5d85b8[_0xaf46('0x44')]);_0x1a4eb9['attributes']=_[_0xaf46('0x46')](_0x5d85b8[_0xaf46('0x42')],qs[_0xaf46('0x48')](_0x3c7764[_0xaf46('0x44')][_0xaf46('0x48')]));_0x1a4eb9[_0xaf46('0x47')]=_0x1a4eb9['attributes']['length']?_0x1a4eb9['attributes']:_0x5d85b8['model'];if(!_0x3c7764[_0xaf46('0x44')][_0xaf46('0x4a')](_0xaf46('0x4b'))){_0x1a4eb9[_0xaf46('0x4c')]=qs[_0xaf46('0x4c')](_0x3c7764['query'][_0xaf46('0x4c')]);_0x1a4eb9[_0xaf46('0x2d')]=qs[_0xaf46('0x2d')](_0x3c7764['query'][_0xaf46('0x2d')]);}_0x1a4eb9[_0xaf46('0x4d')]=qs[_0xaf46('0x4e')](_0x3c7764[_0xaf46('0x44')]['sort']);_0x1a4eb9[_0xaf46('0x4f')]=qs[_0xaf46('0x50')](_[_0xaf46('0x51')](_0x3c7764[_0xaf46('0x44')],_0x5d85b8[_0xaf46('0x50')]));_0x1a4eb9['where']['FaxAccountId']=_0x36ced3['id'];if(_0x3c7764[_0xaf46('0x44')][_0xaf46('0x52')]){_0x1a4eb9[_0xaf46('0x4f')]=_['merge'](_0x1a4eb9[_0xaf46('0x4f')],{'$or':_['map'](_0x1a4eb9['attributes'],function(_0x15a41c){var _0x54435e={};_0x54435e[_0x15a41c]={'$like':'%'+_0x3c7764[_0xaf46('0x44')]['filter']+'%'};return _0x54435e;})});}_0x1a4eb9=_[_0xaf46('0x54')]({},_0x1a4eb9,_0x3c7764['options']);return db['CannedAnswer']['count']({'where':_0x1a4eb9[_0xaf46('0x4f')]})['then'](function(_0xae5cbd){_0x1238a8[_0xaf46('0x2f')]=_0xae5cbd;if(_0x3c7764[_0xaf46('0x44')]['includeAll']){_0x1a4eb9[_0xaf46('0x57')]=[{'all':!![]}];}return db[_0xaf46('0x6d')][_0xaf46('0x59')](_0x1a4eb9);})[_0xaf46('0x1f')](function(_0x16acb7){_0x1238a8[_0xaf46('0x6a')]=_0x16acb7;return _0x1238a8;});}})[_0xaf46('0x1f')](respondWithFilteredResult(_0x3fc058,_0x1a4eb9))[_0xaf46('0x5a')](handleError(_0x3fc058,null));};exports['removeAnswers']=function(_0x54f087,_0x58f1c2,_0x300450){return db['FaxAccount'][_0xaf46('0x5d')]({'where':{'id':_0x54f087[_0xaf46('0x5c')]['id']}})['then'](handleEntityNotFound(_0x58f1c2,null))[_0xaf46('0x1f')](function(_0x502c09){if(_0x502c09){return _0x502c09[_0xaf46('0x6f')](_0x54f087['query'][_0xaf46('0x70')]);}})['then'](respondWithStatusCode(_0x58f1c2,null))['catch'](handleError(_0x58f1c2,null));};exports[_0xaf46('0x71')]=function(_0x5111c9,_0x152472,_0x2d988f){return db[_0xaf46('0x72')][_0xaf46('0x5d')]({'where':{'id':_0x5111c9[_0xaf46('0x5c')]['id']}})['then'](handleEntityNotFound(_0x152472,null))[_0xaf46('0x1f')](function(_0x315497){if(_0x315497){return _0x315497[_0xaf46('0x71')](_0x5111c9[_0xaf46('0x5f')][_0xaf46('0x70')],_[_0xaf46('0x73')](_0x5111c9[_0xaf46('0x5f')],[_0xaf46('0x70'),'id'])||{});}})[_0xaf46('0x1f')](respondWithResult(_0x152472,null))[_0xaf46('0x5a')](handleError(_0x152472,null));};exports['getInteractions']=function(_0x3bb8e5,_0x3e9664,_0x578046){var _0x2fe86b={'raw':![],'where':{}};var _0x183730={};var _0x5c9ce6={'count':0x0,'rows':[]};return db[_0xaf46('0x58')]['findOne']({'where':{'id':_0x3bb8e5[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x3e9664,null))[_0xaf46('0x1f')](function(_0x42fe9a){if(_0x42fe9a){_0x183730[_0xaf46('0x42')]=_[_0xaf46('0x45')](db[_0xaf46('0x72')][_0xaf46('0x3f')]);_0x183730[_0xaf46('0x44')]=_['keys'](_0x3bb8e5[_0xaf46('0x44')]);_0x183730[_0xaf46('0x50')]=_[_0xaf46('0x46')](_0x183730[_0xaf46('0x42')],_0x183730[_0xaf46('0x44')]);_0x2fe86b[_0xaf46('0x47')]=_[_0xaf46('0x46')](_0x183730[_0xaf46('0x42')],qs[_0xaf46('0x48')](_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x48')]));_0x2fe86b[_0xaf46('0x47')]=_0x2fe86b[_0xaf46('0x47')][_0xaf46('0x49')]?_0x2fe86b[_0xaf46('0x47')]:_0x183730['model'];if(!_0x3bb8e5[_0xaf46('0x44')]['hasOwnProperty'](_0xaf46('0x4b'))){_0x2fe86b['limit']=qs[_0xaf46('0x4c')](_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x4c')]);_0x2fe86b[_0xaf46('0x2d')]=qs[_0xaf46('0x2d')](_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x2d')]);}_0x2fe86b[_0xaf46('0x4d')]=qs[_0xaf46('0x4e')](_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x4e')]);_0x2fe86b[_0xaf46('0x4f')]=qs['filters'](_[_0xaf46('0x51')](_0x3bb8e5[_0xaf46('0x44')],_0x183730[_0xaf46('0x50')]));_0x2fe86b[_0xaf46('0x4f')][_0xaf46('0x67')]=_0x42fe9a['id'];if(_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x52')]){_0x2fe86b[_0xaf46('0x4f')]=_[_0xaf46('0x54')](_0x2fe86b[_0xaf46('0x4f')],{'$or':_[_0xaf46('0x43')](_0x2fe86b[_0xaf46('0x47')],function(_0x293bdc){var _0x980805={};_0x980805[_0x293bdc]={'$like':'%'+_0x3bb8e5[_0xaf46('0x44')]['filter']+'%'};return _0x980805;})});}_0x2fe86b=_['merge']({},_0x2fe86b,_0x3bb8e5[_0xaf46('0x55')]);return db[_0xaf46('0x72')]['count']({'where':_0x2fe86b[_0xaf46('0x4f')]})[_0xaf46('0x1f')](function(_0x2bee34){_0x5c9ce6[_0xaf46('0x2f')]=_0x2bee34;if(_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x56')]){_0x2fe86b[_0xaf46('0x57')]=[{'model':db[_0xaf46('0x74')],'as':_0xaf46('0x75'),'required':![]},{'model':db[_0xaf46('0x76')],'as':_0xaf46('0x77'),'attributes':[_0xaf46('0x3a'),_0xaf46('0x78'),_0xaf46('0x79')],'required':![]},{'model':db[_0xaf46('0x7a')],'as':'Tags','attributes':['id','name',_0xaf46('0x7b')],'where':_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x7c')]?{'id':_0x3bb8e5['query'][_0xaf46('0x7c')]}:undefined,'required':_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x7c')]?!![]:![]}];}return db[_0xaf46('0x72')][_0xaf46('0x59')](_0x2fe86b);})[_0xaf46('0x1f')](function(_0x44c3dc){_0x5c9ce6[_0xaf46('0x6a')]=_0x44c3dc;return _0x5c9ce6;});}})['then'](respondWithFilteredResult(_0x3e9664,_0x2fe86b))['catch'](handleError(_0x3e9664,null));};exports[_0xaf46('0x7d')]=function(_0x3e3d29,_0x1ff1a8,_0x4fe965){return db['FaxAccount']['findOne']({'where':{'id':_0x3e3d29['params']['id']}})['then'](handleEntityNotFound(_0x1ff1a8,null))[_0xaf46('0x1f')](function(_0x493091){if(_0x493091){return db['sequelize'][_0xaf46('0x7e')](function(_0x411466){return db['FaxApplication'][_0xaf46('0x37')]({'where':{'FaxAccountId':_0x3e3d29[_0xaf46('0x5c')]['id']},'transaction':_0x411466})['then'](function(_0x487c77){var _0x2d286c=_['map'](_0x3e3d29['body'],function(_0x30c410){_0x30c410[_0xaf46('0x67')]=_0x3e3d29[_0xaf46('0x5c')]['id'];return _0x30c410;});return db[_0xaf46('0x7f')][_0xaf46('0x80')](_0x2d286c,{'transaction':_0x411466});});})['then'](function(){return db[_0xaf46('0x7f')][_0xaf46('0x81')]({'where':{'FaxAccountId':_0x3e3d29['params']['id']},'order':_0xaf46('0x82')});});}})[_0xaf46('0x1f')](respondWithResult(_0x1ff1a8,null))[_0xaf46('0x5a')](handleError(_0x1ff1a8,null));};exports[_0xaf46('0x83')]=function(_0x46a8cf,_0x32e7ae,_0x12a5f5){var _0x321325={};var _0x367f40={};var _0x474d0f;var _0x4dae96;return db[_0xaf46('0x58')][_0xaf46('0x6e')]({'where':{'id':_0x46a8cf[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x32e7ae,null))[_0xaf46('0x1f')](function(_0x47c32a){if(_0x47c32a){_0x474d0f=_0x47c32a;_0x367f40[_0xaf46('0x42')]=_['keys'](db['FaxApplication'][_0xaf46('0x3f')]);_0x367f40[_0xaf46('0x44')]=_[_0xaf46('0x45')](_0x46a8cf[_0xaf46('0x44')]);_0x367f40[_0xaf46('0x50')]=_[_0xaf46('0x46')](_0x367f40['model'],_0x367f40[_0xaf46('0x44')]);_0x321325[_0xaf46('0x47')]=_['intersection'](_0x367f40[_0xaf46('0x42')],qs['fields'](_0x46a8cf[_0xaf46('0x44')][_0xaf46('0x48')]));_0x321325[_0xaf46('0x47')]=_0x321325[_0xaf46('0x47')][_0xaf46('0x49')]?_0x321325[_0xaf46('0x47')]:_0x367f40[_0xaf46('0x42')];_0x321325[_0xaf46('0x4d')]=qs['sort'](_0x46a8cf[_0xaf46('0x44')][_0xaf46('0x4e')]);_0x321325[_0xaf46('0x4f')]=qs[_0xaf46('0x50')](_[_0xaf46('0x51')](_0x46a8cf[_0xaf46('0x44')],_0x367f40[_0xaf46('0x50')]));if(_0x46a8cf[_0xaf46('0x44')]['filter']){_0x321325[_0xaf46('0x4f')]=_[_0xaf46('0x54')](_0x321325[_0xaf46('0x4f')],{'$or':_[_0xaf46('0x43')](_0x321325[_0xaf46('0x47')],function(_0x2756dc){var _0x18ceff={};_0x18ceff[_0x2756dc]={'$like':'%'+_0x46a8cf[_0xaf46('0x44')][_0xaf46('0x52')]+'%'};return _0x18ceff;})});}_0x321325=_[_0xaf46('0x54')]({},_0x321325,_0x46a8cf[_0xaf46('0x55')]);return _0x474d0f[_0xaf46('0x83')](_0x321325);}})[_0xaf46('0x1f')](function(_0x401982){if(_0x401982){_0x4dae96=_0x401982['length'];if(!_0x46a8cf[_0xaf46('0x44')][_0xaf46('0x4a')](_0xaf46('0x4b'))){_0x321325[_0xaf46('0x4c')]=qs[_0xaf46('0x4c')](_0x46a8cf['query'][_0xaf46('0x4c')]);_0x321325[_0xaf46('0x2d')]=qs['offset'](_0x46a8cf[_0xaf46('0x44')][_0xaf46('0x2d')]);}return _0x474d0f[_0xaf46('0x83')](_0x321325);}})[_0xaf46('0x1f')](function(_0x1bb9be){if(_0x1bb9be){return _0x1bb9be?{'count':_0x4dae96,'rows':_0x1bb9be}:null;}})[_0xaf46('0x1f')](respondWithResult(_0x32e7ae,null))['catch'](handleError(_0x32e7ae,null));};function Extension(_0xb3970e,_0x293926,_0x136733,_0x5e3e16){this['context']=_0xaf46('0x84');this[_0xaf46('0x85')]=_0xb3970e[_0xaf46('0x86')];this[_0xaf46('0x87')]=_0x5e3e16;this['type']=_0xaf46('0x88');this[_0xaf46('0x89')]=_0xaf46('0x8a');this['FaxAccountId']=_0xb3970e['id'];this[_0xaf46('0x82')]=_0x293926;this[_0xaf46('0x8b')]=_0x136733;}function createExtensionsReciveFax(_0x5779be){var _0x264f1c=0x1;var _0x18d163=[];_0x18d163['push'](new Extension(_0x5779be,_0x264f1c,'',_0xaf46('0x8c')));_0x264f1c+=0x1;_0x18d163[_0xaf46('0x8d')](new Extension(_0x5779be,_0x264f1c,_0xaf46('0x8e'),_0xaf46('0x8f')));_0x264f1c+=0x1;for(var _0x1415e6 in _0x5779be){if(_0x5779be[_0xaf46('0x4a')](_0x1415e6)&&(_0x1415e6===_0xaf46('0x90')||_0x1415e6===_0xaf46('0x86')||_0x1415e6===_0xaf46('0x91')||_0x1415e6==='faxdetect'||_0x1415e6==='headerinfo'||_0x1415e6===_0xaf46('0x92')||_0x1415e6==='minrate'||_0x1415e6==='modem'||_0x1415e6===_0xaf46('0x93'))){_0x18d163['push'](new Extension(_0x5779be,_0x264f1c,'FAXOPT('+_0x1415e6+')='+_0x5779be[_0x1415e6],'Set'));_0x264f1c+=0x1;}}_0x18d163[_0xaf46('0x8d')](new Extension(_0x5779be,_0x264f1c,'6','Wait'));_0x264f1c+=0x1;_0x18d163[_0xaf46('0x8d')](new Extension(_0x5779be,_0x264f1c,_0xaf46('0x94'),_0xaf46('0x95')));_0x264f1c=0x0;return _0x18d163;}exports[_0xaf46('0x96')]=function(_0x110ded,_0x12de6a,_0x555f75){var _0x38319e;return db['sequelize'][_0xaf46('0x7e')](function(_0x5d4e1a){return db[_0xaf46('0x58')][_0xaf46('0x5e')](_0x110ded[_0xaf46('0x5f')],{'transaction':_0x5d4e1a})['then'](function(_0xf2f120){_0x38319e=_0xf2f120['get']({'plain':!![]});return db[_0xaf46('0x97')][_0xaf46('0x80')](createExtensionsReciveFax(_0x38319e),{'transaction':_0x5d4e1a});});})[_0xaf46('0x1f')](function(){return _0x38319e;})[_0xaf46('0x1f')](respondWithResult(_0x12de6a,null))[_0xaf46('0x5a')](handleError(_0x12de6a,null));};exports[_0xaf46('0x98')]=function(_0x3fd0ae,_0x2ca115,_0x4b11cd){var _0x48e381;return db[_0xaf46('0x99')][_0xaf46('0x7e')](function(_0x562363){return db['FaxAccount'][_0xaf46('0x36')](_0x3fd0ae[_0xaf46('0x5f')],{'where':{'id':_0x3fd0ae['body']['id']},'transaction':_0x562363})[_0xaf46('0x1f')](function(_0x5bda64){return db[_0xaf46('0x97')][_0xaf46('0x37')]({'where':{'FaxAccountId':_0x3fd0ae[_0xaf46('0x5f')]['id']},'transaction':_0x562363})[_0xaf46('0x1f')](function(_0x23bb6e){return db[_0xaf46('0x97')][_0xaf46('0x80')](createExtensionsReciveFax(_[_0xaf46('0x73')](_0x3fd0ae[_0xaf46('0x5f')],[_0xaf46('0x9a'),_0xaf46('0x41'),_0xaf46('0x9b'),_0xaf46('0x9c'),'TrunkId','ListId'])),{'transaction':_0x562363});});});})[_0xaf46('0x1f')](function(){return db[_0xaf46('0x58')][_0xaf46('0x9d')](_0x3fd0ae[_0xaf46('0x5f')]['id']);})[_0xaf46('0x1f')](respondWithResult(_0x2ca115,null))[_0xaf46('0x5a')](handleError(_0x2ca115,null));};exports[_0xaf46('0x9e')]=function(_0x1466e2,_0xa6ce6e,_0x2b6f47){var _0x6b0f3f={'raw':!![],'where':{}};var _0x8f79d6={};var _0x31ab30={'count':0x0,'rows':[]};return db['FaxAccount'][_0xaf46('0x6e')]({'where':{'id':_0x1466e2[_0xaf46('0x5c')]['id']}})['then'](handleEntityNotFound(_0xa6ce6e,null))[_0xaf46('0x1f')](function(_0x50158c){if(_0x50158c){_0x8f79d6[_0xaf46('0x42')]=_[_0xaf46('0x45')](db[_0xaf46('0x9f')][_0xaf46('0x3f')]);_0x8f79d6[_0xaf46('0x44')]=_[_0xaf46('0x45')](_0x1466e2['query']);_0x8f79d6[_0xaf46('0x50')]=_[_0xaf46('0x46')](_0x8f79d6[_0xaf46('0x42')],_0x8f79d6[_0xaf46('0x44')]);_0x6b0f3f['attributes']=_[_0xaf46('0x46')](_0x8f79d6[_0xaf46('0x42')],qs[_0xaf46('0x48')](_0x1466e2[_0xaf46('0x44')][_0xaf46('0x48')]));_0x6b0f3f[_0xaf46('0x47')]=_0x6b0f3f[_0xaf46('0x47')]['length']?_0x6b0f3f[_0xaf46('0x47')]:_0x8f79d6[_0xaf46('0x42')];if(!_0x1466e2['query']['hasOwnProperty'](_0xaf46('0x4b'))){_0x6b0f3f['limit']=qs[_0xaf46('0x4c')](_0x1466e2[_0xaf46('0x44')][_0xaf46('0x4c')]);_0x6b0f3f[_0xaf46('0x2d')]=qs[_0xaf46('0x2d')](_0x1466e2[_0xaf46('0x44')]['offset']);}_0x6b0f3f[_0xaf46('0x4d')]=qs['sort'](_0x1466e2['query'][_0xaf46('0x4e')]);_0x6b0f3f[_0xaf46('0x4f')]=qs['filters'](_[_0xaf46('0x51')](_0x1466e2['query'],_0x8f79d6[_0xaf46('0x50')]));_0x6b0f3f[_0xaf46('0x4f')][_0xaf46('0x67')]=_0x50158c['id'];if(_0x1466e2[_0xaf46('0x44')]['filter']){_0x6b0f3f[_0xaf46('0x4f')]=_['merge'](_0x6b0f3f[_0xaf46('0x4f')],{'$or':_[_0xaf46('0x43')](_0x6b0f3f[_0xaf46('0x47')],function(_0x4b6eeb){var _0xdc136e={};_0xdc136e[_0x4b6eeb]={'$like':'%'+_0x1466e2[_0xaf46('0x44')][_0xaf46('0x52')]+'%'};return _0xdc136e;})});}if(_0x1466e2['query'][_0xaf46('0xa0')]){var _0x5d5178=_0x1466e2[_0xaf46('0x44')][_0xaf46('0xa0')][_0xaf46('0xa1')](',');var _0x353dd7={};_0x353dd7[_0x5d5178[0x0]]={'$gte':moment(_0x5d5178[0x1])[_0xaf46('0xa2')](_0xaf46('0xa3'))};_0x6b0f3f[_0xaf46('0x4f')]=_[_0xaf46('0x54')](_0x6b0f3f[_0xaf46('0x4f')],_0x353dd7);}_0x6b0f3f=_[_0xaf46('0x54')]({},_0x6b0f3f,_0x1466e2['options']);return db[_0xaf46('0x9f')][_0xaf46('0x2f')]({'where':_0x6b0f3f[_0xaf46('0x4f')]})[_0xaf46('0x1f')](function(_0x1a7817){_0x31ab30[_0xaf46('0x2f')]=_0x1a7817;if(_0x1466e2[_0xaf46('0x44')][_0xaf46('0x56')]){_0x6b0f3f['include']=[{'all':!![]}];}return db[_0xaf46('0x9f')]['findAll'](_0x6b0f3f);})['then'](function(_0x17d9b2){_0x31ab30[_0xaf46('0x6a')]=_0x17d9b2;return _0x31ab30;});}})['then'](respondWithFilteredResult(_0xa6ce6e,_0x6b0f3f))[_0xaf46('0x5a')](handleError(_0xa6ce6e,null));};exports[_0xaf46('0x3b')]=function(_0x57db18,_0x1b3975,_0x209793){var _0x31880b,_0x12cd6b={},_0x1583e5;if(_0x57db18[_0xaf46('0x5f')]['to']){_0x1583e5=_0x57db18['body']['to'][0x0];}return db[_0xaf46('0x58')][_0xaf46('0x5d')]({'where':{'id':_0x57db18[_0xaf46('0x5c')]['id']},'include':[{'model':db[_0xaf46('0xa4')],'as':'List','include':[{'model':db[_0xaf46('0x74')],'as':'Contacts','where':{'fax':_0x1583e5},'limit':0x1,'order':[[_0xaf46('0x9c'),'DESC']]}]}]})[_0xaf46('0x1f')](handleEntityNotFound(_0x1b3975,null))['then'](function(_0x4680ec){_0x31880b=_0x4680ec;if(_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')]&&_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')][_0xaf46('0x49')]){for(var _0x34ea96=0x0;_0x34ea96<_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')][_0xaf46('0x49')];_0x34ea96+=0x1){_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')][_0x34ea96]={'filename':_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')][_0x34ea96][_0xaf46('0x3a')],'id':_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')][_0x34ea96]['id'],'path':path[_0xaf46('0xa6')](config[_0xaf46('0xa7')],_0xaf46('0xa8'),_0x57db18[_0xaf46('0x5f')]['attachments'][_0x34ea96][_0xaf46('0xa9')])};}}return respondWithRpcPromise(_0xaf46('0xaa'),'CheckAfterSend',{'FaxAccountId':_[_0xaf46('0xab')](_0x57db18[_0xaf46('0x5c')]['id'])?undefined:_0x57db18[_0xaf46('0x5c')]['id'],'path':_[_0xaf46('0xab')](_0x57db18[_0xaf46('0x5f')]['attachments'][0x0][_0xaf46('0x8')])?undefined:_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')][0x0][_0xaf46('0x8')],'fax':_[_0xaf46('0xab')](_0x57db18[_0xaf46('0x5f')]['to'][0x0])?undefined:_0x57db18['body']['to'][0x0]},client9002);})['then'](function(){if(_0x31880b){if(_[_0xaf46('0xab')](_0x57db18[_0xaf46('0x5f')][_0xaf46('0xac')])){_0x57db18[_0xaf46('0x5f')][_0xaf46('0xac')]=util[_0xaf46('0xa2')](_0xaf46('0xad'),_0x31880b[_0xaf46('0x3a')],_0x31880b[_0xaf46('0xae')]);}if(_0x31880b[_0xaf46('0xaf')]){if(_0x31880b[_0xaf46('0xaf')][_0xaf46('0xb0')][_0xaf46('0x49')]){return _0x31880b[_0xaf46('0xaf')][_0xaf46('0xb0')][0x0];}else{return db[_0xaf46('0x74')][_0xaf46('0x5e')](_[_0xaf46('0x19')](_0x57db18[_0xaf46('0x5f')],{'firstName':_0x57db18[_0xaf46('0x5f')]['to'][0x0],'phone':_0x57db18[_0xaf46('0x5f')]['to'][0x0],'fax':_0x57db18[_0xaf46('0x5f')]['to'][0x0],'ListId':_0x31880b[_0xaf46('0xb1')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xaf46('0xb2'));}})['then'](function(_0x2b3a8d){if(_0x2b3a8d){return db[_0xaf46('0x72')][_0xaf46('0x5d')]({'where':{'ContactId':_0x2b3a8d['id'],'closed':![],'FaxAccountId':_0x31880b['id']}})[_0xaf46('0x1f')](function(_0x78c535){if(_0x78c535){return[_0x78c535,![]];}return db['FaxInteraction'][_0xaf46('0x5e')]({'UserId':_0x57db18[_0xaf46('0x60')]['id'],'ContactId':_0x2b3a8d['id'],'FaxAccountId':_0x31880b['id'],'fax':_0x57db18[_0xaf46('0x5f')]['to'][0x0],'firstMsgDirection':_0xaf46('0xb3'),'Messages':[_[_0xaf46('0x54')](_0x57db18[_0xaf46('0x5f')],{'read':![],'body':_0x57db18[_0xaf46('0x5f')]['attachments'][0x0]['filename'],'FaxAccountId':_0x31880b['id'],'UserId':_0x57db18['user']['id'],'ContactId':_0x2b3a8d['id'],'AttachmentId':_0x57db18['body'][_0xaf46('0xa5')][0x0]['id']})]},{'include':[{'model':db[_0xaf46('0x9f')],'as':_0xaf46('0xb4')}]})['then'](function(_0x123874){return[_0x123874,!![]];});});}else{throw new Error(_0xaf46('0xb5'));}})[_0xaf46('0xb6')](function(_0x5694ac,_0x59a767){if(_0x59a767){return _0x5694ac;}return db[_0xaf46('0x9f')]['create']({'direction':_0xaf46('0xb3'),'read':![],'body':_0x57db18['body'][_0xaf46('0xa5')][0x0][_0xaf46('0xb7')],'FaxAccountId':_0x31880b['id'],'FaxInteractionId':_0x5694ac['id'],'UserId':_0x57db18[_0xaf46('0x60')]['id'],'ContactId':_0x5694ac[_0xaf46('0xb8')],'AttachmentId':_0x57db18['body'][_0xaf46('0xa5')][0x0]['id']})[_0xaf46('0x1f')](function(_0x499943){_0x5694ac[_0xaf46('0xb9')][_0xaf46('0xb4')]=[];_0x5694ac['dataValues'][_0xaf46('0xb4')][_0xaf46('0x8d')](_0x499943['dataValues']);return _0x5694ac;});})['then'](function(_0x5ce56d){respondWithRpcPromise(_0xaf46('0xba'),_0xaf46('0xba'),{'FaxAccountId':_['isNil'](_0x57db18[_0xaf46('0x5c')]['id'])?undefined:_0x57db18[_0xaf46('0x5c')]['id'],'path':_[_0xaf46('0xab')](_0x57db18[_0xaf46('0x5f')]['attachments'][0x0][_0xaf46('0x8')])?undefined:_0x57db18['body']['attachments'][0x0][_0xaf46('0x8')],'fax':_['isNil'](_0x57db18['body']['to'][0x0])?undefined:_0x57db18[_0xaf46('0x5f')]['to'][0x0],'AttachmentId':_0x57db18[_0xaf46('0x5f')]['attachments'][0x0]['id']},client9002)[_0xaf46('0x1f')](function(_0x57dab0){logger['info'](_0xaf46('0xbb'),_0x57dab0);})['catch'](function(_0x3363f8){logger[_0xaf46('0x20')]('SendFaxRpc,\x20%s',_0x3363f8);});return _0x5ce56d;})['then'](respondWithResult(_0x1b3975,null))[_0xaf46('0x5a')](handleError(_0x1b3975,null));};exports[_0xaf46('0xbc')]=function(_0x530a86,_0x2c9e26,_0x4a409d){return db[_0xaf46('0x58')][_0xaf46('0x5d')]({'where':{'id':_0x530a86[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x2c9e26,null))[_0xaf46('0x1f')](function(_0x542abf){if(_0x542abf){return _0x542abf[_0xaf46('0xbc')](_0x530a86[_0xaf46('0x5f')]['ids'],_[_0xaf46('0x73')](_0x530a86[_0xaf46('0x5f')],[_0xaf46('0x70'),'id'])||{})[_0xaf46('0xb6')](function(_0x130dce){for(var _0x44f27e=0x0;_0x44f27e<_0x530a86[_0xaf46('0x5f')]['ids'][_0xaf46('0x49')];_0x44f27e+=0x1){socket[_0xaf46('0xbd')](_0xaf46('0xbe'),{'UserId':Number(_0x530a86[_0xaf46('0x5f')]['ids'][_0x44f27e]),'FaxAccountId':Number(_0x530a86[_0xaf46('0x5c')]['id'])});}return _0x130dce;});}})[_0xaf46('0x1f')](respondWithResult(_0x2c9e26,null))['catch'](handleError(_0x2c9e26,null));};exports[_0xaf46('0xbf')]=function(_0x2422ae,_0x399ab4,_0x23d1d9){return db[_0xaf46('0x58')][_0xaf46('0x5d')]({'where':{'id':_0x2422ae[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x399ab4,null))[_0xaf46('0x1f')](function(_0x1bf334){if(_0x1bf334){return _0x1bf334[_0xaf46('0xbf')](_0x2422ae[_0xaf46('0x44')][_0xaf46('0x70')])['then'](function(){if(_['isArray'](_0x2422ae['query'][_0xaf46('0x70')])){for(var _0x38645e=0x0;_0x38645e<_0x2422ae[_0xaf46('0x44')][_0xaf46('0x70')][_0xaf46('0x49')];_0x38645e+=0x1){socket[_0xaf46('0xbd')](_0xaf46('0xc0'),{'UserId':Number(_0x2422ae[_0xaf46('0x44')]['ids'][_0x38645e]),'FaxAccountId':Number(_0x2422ae['params']['id'])});}}else{socket['emit'](_0xaf46('0xc0'),{'UserId':Number(_0x2422ae['query'][_0xaf46('0x70')]),'FaxAccountId':Number(_0x2422ae[_0xaf46('0x5c')]['id'])});}});}})[_0xaf46('0x1f')](respondWithStatusCode(_0x399ab4,null))[_0xaf46('0x5a')](handleError(_0x399ab4,null));};exports[_0xaf46('0xc1')]=function(_0x3b14d6,_0x4f4359,_0x43c4e6){var _0x514770={};var _0x181adf={};var _0x16971a;var _0x54e3ef;return db[_0xaf46('0x58')]['findOne']({'where':{'id':_0x3b14d6[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x4f4359,null))[_0xaf46('0x1f')](function(_0x46cb47){if(_0x46cb47){_0x16971a=_0x46cb47;_0x181adf[_0xaf46('0x42')]=_[_0xaf46('0x45')](db[_0xaf46('0x76')][_0xaf46('0x3f')]);_0x181adf[_0xaf46('0x44')]=_[_0xaf46('0x45')](_0x3b14d6[_0xaf46('0x44')]);_0x181adf[_0xaf46('0x50')]=_['intersection'](_0x181adf['model'],_0x181adf['query']);_0x514770[_0xaf46('0x47')]=_[_0xaf46('0x46')](_0x181adf[_0xaf46('0x42')],qs[_0xaf46('0x48')](_0x3b14d6[_0xaf46('0x44')][_0xaf46('0x48')]));_0x514770['attributes']=_0x514770[_0xaf46('0x47')][_0xaf46('0x49')]?_0x514770['attributes']:_0x181adf[_0xaf46('0x42')];_0x514770['order']=qs['sort'](_0x3b14d6['query'][_0xaf46('0x4e')]);_0x514770[_0xaf46('0x4f')]=qs[_0xaf46('0x50')](_['pick'](_0x3b14d6[_0xaf46('0x44')],_0x181adf['filters']));if(_0x3b14d6[_0xaf46('0x44')][_0xaf46('0x52')]){_0x514770[_0xaf46('0x4f')]=_[_0xaf46('0x54')](_0x514770[_0xaf46('0x4f')],{'$or':_[_0xaf46('0x43')](_0x514770[_0xaf46('0x47')],function(_0x3ef149){var _0x1234eb={};_0x1234eb[_0x3ef149]={'$like':'%'+_0x3b14d6['query'][_0xaf46('0x52')]+'%'};return _0x1234eb;})});}_0x514770=_[_0xaf46('0x54')]({},_0x514770,_0x3b14d6[_0xaf46('0x55')]);return _0x16971a['getAgents'](_0x514770);}})[_0xaf46('0x1f')](function(_0xb46276){if(_0xb46276){_0x54e3ef=_0xb46276[_0xaf46('0x49')];if(!_0x3b14d6[_0xaf46('0x44')]['hasOwnProperty'](_0xaf46('0x4b'))){_0x514770[_0xaf46('0x4c')]=qs[_0xaf46('0x4c')](_0x3b14d6[_0xaf46('0x44')][_0xaf46('0x4c')]);_0x514770['offset']=qs[_0xaf46('0x2d')](_0x3b14d6[_0xaf46('0x44')]['offset']);}return _0x16971a['getAgents'](_0x514770);}})[_0xaf46('0x1f')](function(_0x1eab77){if(_0x1eab77){return _0x1eab77?{'count':_0x54e3ef,'rows':_0x1eab77}:null;}})['then'](respondWithResult(_0x4f4359,null))[_0xaf46('0x5a')](handleError(_0x4f4359,null));};
\ No newline at end of file
+var _0xb513=['push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Wait','addAccountApplications','transaction','VoiceExtension','omit','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','root','server/files/attachments','CheckAfterSend','path','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','lodash','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','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','get','FaxAccounts','sendStatus','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','Pause','length','includeAll','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','getAnswers','CannedAnswer','nolimit','order','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','internal','Tag','Tags','color','tag','sequelize','FaxApplication','bulkCreate','getApplications','context','app','system','description','Fax\x20Extension','appdata','Answer'];(function(_0x2b3044,_0xf50915){var _0x4e6ae1=function(_0x24bf8f){while(--_0x24bf8f){_0x2b3044['push'](_0x2b3044['shift']());}};_0x4e6ae1(++_0xf50915);}(_0xb513,0xf4));var _0x3b51=function(_0x3b154f,_0x14fd22){_0x3b154f=_0x3b154f-0x0;var _0xe53d42=_0xb513[_0x3b154f];return _0xe53d42;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b51('0x0'));var zipdir=require(_0x3b51('0x1'));var jsonpatch=require(_0x3b51('0x2'));var rp=require('request-promise');var moment=require(_0x3b51('0x3'));var BPromise=require(_0x3b51('0x4'));var Mustache=require(_0x3b51('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3b51('0x6'));var csv=require('to-csv');var ejs=require(_0x3b51('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b51('0x8'));var squel=require(_0x3b51('0x9'));var crypto=require(_0x3b51('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3b51('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3b51('0xc'));var Redis=require(_0x3b51('0xd'));var authService=require(_0x3b51('0xe'));var qs=require(_0x3b51('0xf'));var as=require(_0x3b51('0x10'));var hardwareService=require(_0x3b51('0x11'));var logger=require('../../config/logger')(_0x3b51('0x12'));var utils=require(_0x3b51('0x13'));var config=require(_0x3b51('0x14'));var licenseUtil=require(_0x3b51('0x15'));var db=require(_0x3b51('0x16'))['db'];config[_0x3b51('0x17')]=_[_0x3b51('0x18')](config['redis'],{'host':_0x3b51('0x19'),'port':0x18eb});var socket=require(_0x3b51('0x1a'))(new Redis(config[_0x3b51('0x17')]));require(_0x3b51('0x1b'))['register'](socket);var jayson=require(_0x3b51('0x1c'));var client=jayson[_0x3b51('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0x3b51('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1ba4d8,_0x5d2315,_0x17a3b2,_0x4baa84){return new BPromise(function(_0x24bd25,_0x5ea631){var _0x1c40c7=_0x4baa84||client;return _0x1c40c7[_0x3b51('0x1f')](_0x1ba4d8,_0x17a3b2)['then'](function(_0x10bfcc){logger[_0x3b51('0x20')](_0x3b51('0x21'),_0x5d2315,_0x3b51('0x22'));logger['debug'](_0x3b51('0x23'),_0x5d2315,_0x3b51('0x22'),JSON[_0x3b51('0x24')](_0x10bfcc));if(_0x10bfcc[_0x3b51('0x25')]){if(_0x10bfcc[_0x3b51('0x25')]['code']===0x1f4){logger[_0x3b51('0x25')]('FaxAccount,\x20%s,\x20%s',_0x5d2315,_0x10bfcc[_0x3b51('0x25')]['message']);return _0x5ea631(_0x10bfcc['error']['message']);}logger[_0x3b51('0x25')](_0x3b51('0x21'),_0x5d2315,_0x10bfcc['error']['message']);return _0x24bd25(_0x10bfcc[_0x3b51('0x25')][_0x3b51('0x26')]);}else{logger[_0x3b51('0x20')]('FaxAccount,\x20%s,\x20%s',_0x5d2315,'request\x20sent');_0x24bd25(_0x10bfcc[_0x3b51('0x27')][_0x3b51('0x26')]);}})['catch'](function(_0x4a4836){logger['error'](_0x3b51('0x21'),_0x5d2315,_0x4a4836);_0x5ea631(_0x4a4836);});});}function respondWithStatusCode(_0x4eeba7,_0x22ac61){_0x22ac61=_0x22ac61||0xcc;return function(_0x38c107){if(_0x38c107){return _0x4eeba7['sendStatus'](_0x22ac61);}return _0x4eeba7[_0x3b51('0x28')](_0x22ac61)[_0x3b51('0x29')]();};}function respondWithResult(_0x54a173,_0x4ea4fc){_0x4ea4fc=_0x4ea4fc||0xc8;return function(_0x365073){if(_0x365073){return _0x54a173[_0x3b51('0x28')](_0x4ea4fc)[_0x3b51('0x2a')](_0x365073);}};}function respondWithFilteredResult(_0x1e6deb,_0x119093){return function(_0x1c46a4){if(_0x1c46a4){var _0x34a2c1=typeof _0x119093[_0x3b51('0x2b')]===_0x3b51('0x2c')&&typeof _0x119093['limit']===_0x3b51('0x2c');var _0x3c2901=_0x1c46a4[_0x3b51('0x2d')];var _0x4436bb=_0x34a2c1?0x0:_0x119093[_0x3b51('0x2b')];var _0x1c5349=_0x34a2c1?_0x1c46a4[_0x3b51('0x2d')]:_0x119093['offset']+_0x119093[_0x3b51('0x2e')];var _0xcf0d50;if(_0x1c5349>=_0x3c2901){_0x1c5349=_0x3c2901;_0xcf0d50=0xc8;}else{_0xcf0d50=0xce;}_0x1e6deb[_0x3b51('0x28')](_0xcf0d50);return _0x1e6deb['set']('Content-Range',_0x4436bb+'-'+_0x1c5349+'/'+_0x3c2901)[_0x3b51('0x2a')](_0x1c46a4);}return null;};}function patchUpdates(_0x543495){return function(_0x3cdb7b){try{jsonpatch[_0x3b51('0x2f')](_0x3cdb7b,_0x543495,!![]);}catch(_0x495817){return BPromise[_0x3b51('0x30')](_0x495817);}return _0x3cdb7b[_0x3b51('0x31')]();};}function saveUpdates(_0x7c5f00,_0x10d4b6){return function(_0x1e3099){if(_0x1e3099){return _0x1e3099[_0x3b51('0x32')](_0x7c5f00)[_0x3b51('0x33')](function(_0x2af901){return _0x2af901;});}return null;};}function removeEntity(_0x9ad50e,_0xd87894){return function(_0x5cedad){if(_0x5cedad){return _0x5cedad['destroy']()[_0x3b51('0x33')](function(){var _0x4ee2f3=_0x5cedad[_0x3b51('0x34')]({'plain':!![]});var _0x52680a=_0x3b51('0x35');return db['UserProfileResource']['destroy']({'where':{'type':_0x52680a,'resourceId':_0x4ee2f3['id']}})[_0x3b51('0x33')](function(){return _0x5cedad;});})['then'](function(){_0x9ad50e['status'](0xcc)[_0x3b51('0x29')]();});}};}function handleEntityNotFound(_0x483c5f,_0x11d575){return function(_0x102961){if(!_0x102961){_0x483c5f[_0x3b51('0x36')](0x194);}return _0x102961;};}function handleError(_0x323327,_0x1fb394){_0x1fb394=_0x1fb394||0x1f4;return function(_0x368020){logger['error'](_0x368020['stack']);if(_0x368020['name']){delete _0x368020['name'];}_0x323327[_0x3b51('0x28')](_0x1fb394)[_0x3b51('0x37')](_0x368020);};}exports[_0x3b51('0x38')]=function(_0x385a4b,_0x527883){var _0x549905={'include':[{'model':db['Pause'],'as':_0x3b51('0x39')}]},_0x57395b={},_0x2b57fc={'count':0x0,'rows':[]};var _0x4234e6=_[_0x3b51('0x3a')](db[_0x3b51('0x3b')][_0x3b51('0x3c')],function(_0x168048){return{'name':_0x168048['fieldName'],'type':_0x168048[_0x3b51('0x3d')][_0x3b51('0x3e')]};});_0x57395b['model']=_['map'](_0x4234e6,_0x3b51('0x3f'));_0x57395b[_0x3b51('0x40')]=_[_0x3b51('0x41')](_0x385a4b['query']);_0x57395b[_0x3b51('0x42')]=_[_0x3b51('0x43')](_0x57395b[_0x3b51('0x44')],_0x57395b['query']);_0x549905[_0x3b51('0x45')]=_[_0x3b51('0x43')](_0x57395b['model'],qs['fields'](_0x385a4b['query'][_0x3b51('0x46')]));_0x549905[_0x3b51('0x45')]=_0x549905[_0x3b51('0x45')]['length']?_0x549905[_0x3b51('0x45')]:_0x57395b[_0x3b51('0x44')];if(!_0x385a4b[_0x3b51('0x40')][_0x3b51('0x47')]('nolimit')){_0x549905['limit']=qs['limit'](_0x385a4b[_0x3b51('0x40')][_0x3b51('0x2e')]);_0x549905[_0x3b51('0x2b')]=qs['offset'](_0x385a4b['query'][_0x3b51('0x2b')]);}_0x549905['order']=qs[_0x3b51('0x48')](_0x385a4b['query'][_0x3b51('0x48')]);_0x549905[_0x3b51('0x49')]=qs[_0x3b51('0x42')](_[_0x3b51('0x4a')](_0x385a4b[_0x3b51('0x40')],_0x57395b['filters']),_0x4234e6);if(_0x385a4b[_0x3b51('0x40')]['filter']){_0x549905[_0x3b51('0x49')]=_[_0x3b51('0x4b')](_0x549905[_0x3b51('0x49')],{'$or':_[_0x3b51('0x3a')](_0x4234e6,function(_0x5d7e41){if(_0x5d7e41[_0x3b51('0x3d')]!==_0x3b51('0x4c')){var _0x4c5d34={};_0x4c5d34[_0x5d7e41[_0x3b51('0x3f')]]={'$like':'%'+_0x385a4b[_0x3b51('0x40')][_0x3b51('0x4d')]+'%'};return _0x4c5d34;}})});}_0x549905=_[_0x3b51('0x4b')]({},_0x549905,_0x385a4b[_0x3b51('0x4e')]);var _0x1728e4={'where':_0x549905[_0x3b51('0x49')]};return db[_0x3b51('0x3b')][_0x3b51('0x2d')](_0x1728e4)['then'](function(_0x29657f){_0x2b57fc['count']=_0x29657f;if(_0x385a4b['query']['includeAll']){_0x549905['include']=[{'all':!![]}];}return db['FaxAccount'][_0x3b51('0x4f')](_0x549905);})[_0x3b51('0x33')](function(_0x350dd8){_0x2b57fc[_0x3b51('0x50')]=_0x350dd8;return _0x2b57fc;})[_0x3b51('0x33')](respondWithFilteredResult(_0x527883,_0x549905))[_0x3b51('0x51')](handleError(_0x527883,null));};exports['show']=function(_0x1eabf3,_0x94821b){var _0x4ed305={'raw':![],'where':{'id':_0x1eabf3['params']['id']},'include':[{'model':db[_0x3b51('0x52')],'as':_0x3b51('0x39')}]},_0x159aba={};_0x159aba[_0x3b51('0x44')]=_['keys'](db[_0x3b51('0x3b')][_0x3b51('0x3c')]);_0x159aba['query']=_['keys'](_0x1eabf3[_0x3b51('0x40')]);_0x159aba[_0x3b51('0x42')]=_[_0x3b51('0x43')](_0x159aba[_0x3b51('0x44')],_0x159aba[_0x3b51('0x40')]);_0x4ed305['attributes']=_[_0x3b51('0x43')](_0x159aba[_0x3b51('0x44')],qs[_0x3b51('0x46')](_0x1eabf3[_0x3b51('0x40')][_0x3b51('0x46')]));_0x4ed305[_0x3b51('0x45')]=_0x4ed305[_0x3b51('0x45')][_0x3b51('0x53')]?_0x4ed305[_0x3b51('0x45')]:_0x159aba[_0x3b51('0x44')];if(_0x1eabf3['query'][_0x3b51('0x54')]){_0x4ed305[_0x3b51('0x55')]=[{'all':!![]}];}_0x4ed305=_['merge']({},_0x4ed305,_0x1eabf3['options']);return db['FaxAccount']['find'](_0x4ed305)[_0x3b51('0x33')](handleEntityNotFound(_0x94821b,null))[_0x3b51('0x33')](respondWithResult(_0x94821b,null))[_0x3b51('0x51')](handleError(_0x94821b,null));};exports[_0x3b51('0x56')]=function(_0x13dd4e,_0x3c422f){return db[_0x3b51('0x3b')][_0x3b51('0x56')](_0x13dd4e['body'],{})['then'](function(_0x3d6ff6){var _0xc68d16=_0x13dd4e['user'][_0x3b51('0x34')]({'plain':!![]});if(!_0xc68d16)throw new Error(_0x3b51('0x57'));if(_0xc68d16[_0x3b51('0x58')]===_0x3b51('0x59')){var _0x18a0d0=_0x3d6ff6[_0x3b51('0x34')]({'plain':!![]});var _0x568b81=_0x3b51('0x35');return db[_0x3b51('0x5a')][_0x3b51('0x5b')]({'where':{'name':_0x568b81,'userProfileId':_0xc68d16[_0x3b51('0x5c')]},'raw':!![]})['then'](function(_0x1f0af4){if(_0x1f0af4&&_0x1f0af4[_0x3b51('0x5d')]===0x0){return db[_0x3b51('0x5e')][_0x3b51('0x56')]({'name':_0x18a0d0[_0x3b51('0x3f')],'resourceId':_0x18a0d0['id'],'type':_0x1f0af4['name'],'sectionId':_0x1f0af4['id']},{})[_0x3b51('0x33')](function(){return _0x3d6ff6;});}else{return _0x3d6ff6;}})['catch'](function(_0x1070b3){logger[_0x3b51('0x25')](_0x3b51('0x5f'),_0x1070b3);throw _0x1070b3;});}return _0x3d6ff6;})['then'](respondWithResult(_0x3c422f,0xc9))[_0x3b51('0x51')](handleError(_0x3c422f,null));};exports[_0x3b51('0x32')]=function(_0x2f44b5,_0x3578bd){if(_0x2f44b5[_0x3b51('0x60')]['id']){delete _0x2f44b5['body']['id'];}return db[_0x3b51('0x3b')][_0x3b51('0x5b')]({'where':{'id':_0x2f44b5['params']['id']},'include':[{'model':db[_0x3b51('0x52')],'as':'mandatoryDispositionPause'}]})[_0x3b51('0x33')](handleEntityNotFound(_0x3578bd,null))[_0x3b51('0x33')](saveUpdates(_0x2f44b5[_0x3b51('0x60')],null))['then'](respondWithResult(_0x3578bd,null))[_0x3b51('0x51')](handleError(_0x3578bd,null));};exports[_0x3b51('0x61')]=function(_0x4c54dc,_0x3dbd66){return db['FaxAccount']['find']({'where':{'id':_0x4c54dc[_0x3b51('0x62')]['id']}})[_0x3b51('0x33')](handleEntityNotFound(_0x3dbd66,null))['then'](removeEntity(_0x3dbd66,null))[_0x3b51('0x51')](handleError(_0x3dbd66,null));};exports[_0x3b51('0x63')]=function(_0x5d3ae7,_0x2b098e){return db['FaxAccount'][_0x3b51('0x63')]()['then'](respondWithResult(_0x2b098e,null))['catch'](handleError(_0x2b098e,null));};exports[_0x3b51('0x64')]=function(_0x1d2a4c,_0x5ea946,_0x402f08){if(_0x1d2a4c[_0x3b51('0x60')]['id']){delete _0x1d2a4c[_0x3b51('0x60')]['id'];}return db[_0x3b51('0x3b')][_0x3b51('0x5b')]({'where':{'id':_0x1d2a4c[_0x3b51('0x62')]['id']}})[_0x3b51('0x33')](handleEntityNotFound(_0x5ea946,null))[_0x3b51('0x33')](function(_0x2e1fcb){if(_0x2e1fcb){_0x1d2a4c[_0x3b51('0x60')][_0x3b51('0x65')]=_0x2e1fcb['id'];return db[_0x3b51('0x66')][_0x3b51('0x56')](_0x1d2a4c[_0x3b51('0x60')]);}})['then'](respondWithResult(_0x5ea946,null))[_0x3b51('0x51')](handleError(_0x5ea946,null));};exports[_0x3b51('0x67')]=function(_0x5889a8,_0x115ce6,_0x559cbc){var _0xaa5343={'raw':![],'where':{}};var _0x203b87={};var _0x55f0a5={'count':0x0,'rows':[]};return db[_0x3b51('0x3b')][_0x3b51('0x68')]({'where':{'id':_0x5889a8[_0x3b51('0x62')]['id']}})[_0x3b51('0x33')](handleEntityNotFound(_0x115ce6,null))['then'](function(_0x2434b7){if(_0x2434b7){_0x203b87[_0x3b51('0x44')]=_['keys'](db[_0x3b51('0x66')][_0x3b51('0x3c')]);_0x203b87[_0x3b51('0x40')]=_[_0x3b51('0x41')](_0x5889a8[_0x3b51('0x40')]);_0x203b87[_0x3b51('0x42')]=_[_0x3b51('0x43')](_0x203b87['model'],_0x203b87[_0x3b51('0x40')]);_0xaa5343['attributes']=_[_0x3b51('0x43')](_0x203b87[_0x3b51('0x44')],qs['fields'](_0x5889a8[_0x3b51('0x40')][_0x3b51('0x46')]));_0xaa5343[_0x3b51('0x45')]=_0xaa5343['attributes']['length']?_0xaa5343[_0x3b51('0x45')]:_0x203b87[_0x3b51('0x44')];if(!_0x5889a8[_0x3b51('0x40')][_0x3b51('0x47')]('nolimit')){_0xaa5343[_0x3b51('0x2e')]=qs[_0x3b51('0x2e')](_0x5889a8[_0x3b51('0x40')][_0x3b51('0x2e')]);_0xaa5343[_0x3b51('0x2b')]=qs[_0x3b51('0x2b')](_0x5889a8[_0x3b51('0x40')]['offset']);}_0xaa5343['order']=qs[_0x3b51('0x48')](_0x5889a8[_0x3b51('0x40')][_0x3b51('0x48')]);_0xaa5343[_0x3b51('0x49')]=qs['filters'](_['pick'](_0x5889a8[_0x3b51('0x40')],_0x203b87['filters']));_0xaa5343['where']['FaxAccountId']=_0x2434b7['id'];if(_0x5889a8[_0x3b51('0x40')][_0x3b51('0x4d')]){_0xaa5343['where']=_[_0x3b51('0x4b')](_0xaa5343[_0x3b51('0x49')],{'$or':_['map'](_0xaa5343['attributes'],function(_0x149de4){var _0x22a0df={};_0x22a0df[_0x149de4]={'$like':'%'+_0x5889a8[_0x3b51('0x40')][_0x3b51('0x4d')]+'%'};return _0x22a0df;})});}_0xaa5343=_['merge']({},_0xaa5343,_0x5889a8['options']);return db['Disposition'][_0x3b51('0x2d')]({'where':_0xaa5343[_0x3b51('0x49')]})[_0x3b51('0x33')](function(_0x119fe1){_0x55f0a5[_0x3b51('0x2d')]=_0x119fe1;if(_0x5889a8[_0x3b51('0x40')][_0x3b51('0x54')]){_0xaa5343[_0x3b51('0x55')]=[{'all':!![]}];}return db[_0x3b51('0x66')][_0x3b51('0x4f')](_0xaa5343);})[_0x3b51('0x33')](function(_0x8592ca){_0x55f0a5[_0x3b51('0x50')]=_0x8592ca;return _0x55f0a5;});}})[_0x3b51('0x33')](respondWithFilteredResult(_0x115ce6,_0xaa5343))[_0x3b51('0x51')](handleError(_0x115ce6,null));};exports[_0x3b51('0x69')]=function(_0x2fafbf,_0x42834f,_0x586ca5){return db[_0x3b51('0x3b')][_0x3b51('0x5b')]({'where':{'id':_0x2fafbf[_0x3b51('0x62')]['id']}})[_0x3b51('0x33')](handleEntityNotFound(_0x42834f,null))[_0x3b51('0x33')](function(_0x18ea6b){if(_0x18ea6b){return _0x18ea6b[_0x3b51('0x69')](_0x2fafbf[_0x3b51('0x40')][_0x3b51('0x6a')]);}})[_0x3b51('0x33')](respondWithStatusCode(_0x42834f,null))['catch'](handleError(_0x42834f,null));};exports['addAnswer']=function(_0x1e57c4,_0x9ecc96,_0x2382a1){if(_0x1e57c4[_0x3b51('0x60')]['id']){delete _0x1e57c4[_0x3b51('0x60')]['id'];}return db['FaxAccount'][_0x3b51('0x5b')]({'where':{'id':_0x1e57c4['params']['id']}})[_0x3b51('0x33')](handleEntityNotFound(_0x9ecc96,null))[_0x3b51('0x33')](function(_0x1f6c77){if(_0x1f6c77){_0x1e57c4['body']['FaxAccountId']=_0x1f6c77['id'];return db['CannedAnswer'][_0x3b51('0x56')](_0x1e57c4[_0x3b51('0x60')]);}})[_0x3b51('0x33')](respondWithResult(_0x9ecc96,null))[_0x3b51('0x51')](handleError(_0x9ecc96,null));};exports[_0x3b51('0x6b')]=function(_0x2869aa,_0x3a39ef,_0x454736){var _0x5817d1={'raw':![],'where':{}};var _0x3d879c={};var _0x220557={'count':0x0,'rows':[]};return db[_0x3b51('0x3b')][_0x3b51('0x68')]({'where':{'id':_0x2869aa[_0x3b51('0x62')]['id']}})[_0x3b51('0x33')](handleEntityNotFound(_0x3a39ef,null))[_0x3b51('0x33')](function(_0x26dd1d){if(_0x26dd1d){_0x3d879c[_0x3b51('0x44')]=_['keys'](db[_0x3b51('0x6c')][_0x3b51('0x3c')]);_0x3d879c[_0x3b51('0x40')]=_[_0x3b51('0x41')](_0x2869aa[_0x3b51('0x40')]);_0x3d879c[_0x3b51('0x42')]=_[_0x3b51('0x43')](_0x3d879c[_0x3b51('0x44')],_0x3d879c['query']);_0x5817d1[_0x3b51('0x45')]=_[_0x3b51('0x43')](_0x3d879c[_0x3b51('0x44')],qs[_0x3b51('0x46')](_0x2869aa['query']['fields']));_0x5817d1['attributes']=_0x5817d1['attributes']['length']?_0x5817d1['attributes']:_0x3d879c[_0x3b51('0x44')];if(!_0x2869aa[_0x3b51('0x40')]['hasOwnProperty'](_0x3b51('0x6d'))){_0x5817d1['limit']=qs[_0x3b51('0x2e')](_0x2869aa[_0x3b51('0x40')][_0x3b51('0x2e')]);_0x5817d1[_0x3b51('0x2b')]=qs[_0x3b51('0x2b')](_0x2869aa[_0x3b51('0x40')][_0x3b51('0x2b')]);}_0x5817d1[_0x3b51('0x6e')]=qs[_0x3b51('0x48')](_0x2869aa[_0x3b51('0x40')][_0x3b51('0x48')]);_0x5817d1[_0x3b51('0x49')]=qs[_0x3b51('0x42')](_['pick'](_0x2869aa[_0x3b51('0x40')],_0x3d879c['filters']));_0x5817d1['where'][_0x3b51('0x65')]=_0x26dd1d['id'];if(_0x2869aa[_0x3b51('0x40')][_0x3b51('0x4d')]){_0x5817d1['where']=_[_0x3b51('0x4b')](_0x5817d1['where'],{'$or':_[_0x3b51('0x3a')](_0x5817d1[_0x3b51('0x45')],function(_0x5b2ce4){var _0x47386d={};_0x47386d[_0x5b2ce4]={'$like':'%'+_0x2869aa[_0x3b51('0x40')]['filter']+'%'};return _0x47386d;})});}_0x5817d1=_[_0x3b51('0x4b')]({},_0x5817d1,_0x2869aa['options']);return db[_0x3b51('0x6c')][_0x3b51('0x2d')]({'where':_0x5817d1[_0x3b51('0x49')]})[_0x3b51('0x33')](function(_0x14eb6e){_0x220557[_0x3b51('0x2d')]=_0x14eb6e;if(_0x2869aa['query']['includeAll']){_0x5817d1[_0x3b51('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3b51('0x4f')](_0x5817d1);})['then'](function(_0x1ee285){_0x220557[_0x3b51('0x50')]=_0x1ee285;return _0x220557;});}})['then'](respondWithFilteredResult(_0x3a39ef,_0x5817d1))[_0x3b51('0x51')](handleError(_0x3a39ef,null));};exports[_0x3b51('0x6f')]=function(_0x28710d,_0x54313a,_0x378e17){return db['FaxAccount']['find']({'where':{'id':_0x28710d['params']['id']}})[_0x3b51('0x33')](handleEntityNotFound(_0x54313a,null))['then'](function(_0x45ca59){if(_0x45ca59){return _0x45ca59[_0x3b51('0x6f')](_0x28710d[_0x3b51('0x40')][_0x3b51('0x6a')]);}})[_0x3b51('0x33')](respondWithStatusCode(_0x54313a,null))['catch'](handleError(_0x54313a,null));};exports[_0x3b51('0x70')]=function(_0x487306,_0x344dd3,_0x4708b4){return db[_0x3b51('0x71')][_0x3b51('0x5b')]({'where':{'id':_0x487306[_0x3b51('0x62')]['id']}})[_0x3b51('0x33')](handleEntityNotFound(_0x344dd3,null))['then'](function(_0x32f0d8){if(_0x32f0d8){return _0x32f0d8['addInteraction'](_0x487306[_0x3b51('0x60')][_0x3b51('0x6a')],_['omit'](_0x487306[_0x3b51('0x60')],[_0x3b51('0x6a'),'id'])||{});}})[_0x3b51('0x33')](respondWithResult(_0x344dd3,null))[_0x3b51('0x51')](handleError(_0x344dd3,null));};exports[_0x3b51('0x72')]=function(_0x11d6c8,_0x39c05d,_0x4179e8){var _0x451a17={'raw':![],'where':{}};var _0x5d4b1d={};var _0x2f3e22={'count':0x0,'rows':[]};return db[_0x3b51('0x3b')][_0x3b51('0x68')]({'where':{'id':_0x11d6c8[_0x3b51('0x62')]['id']}})['then'](handleEntityNotFound(_0x39c05d,null))[_0x3b51('0x33')](function(_0x4e93fa){if(_0x4e93fa){_0x5d4b1d[_0x3b51('0x44')]=_[_0x3b51('0x41')](db['FaxInteraction'][_0x3b51('0x3c')]);_0x5d4b1d[_0x3b51('0x40')]=_[_0x3b51('0x41')](_0x11d6c8[_0x3b51('0x40')]);_0x5d4b1d[_0x3b51('0x42')]=_[_0x3b51('0x43')](_0x5d4b1d[_0x3b51('0x44')],_0x5d4b1d['query']);_0x451a17[_0x3b51('0x45')]=_[_0x3b51('0x43')](_0x5d4b1d[_0x3b51('0x44')],qs[_0x3b51('0x46')](_0x11d6c8['query'][_0x3b51('0x46')]));_0x451a17['attributes']=_0x451a17[_0x3b51('0x45')][_0x3b51('0x53')]?_0x451a17[_0x3b51('0x45')]:_0x5d4b1d[_0x3b51('0x44')];if(!_0x11d6c8['query'][_0x3b51('0x47')](_0x3b51('0x6d'))){_0x451a17[_0x3b51('0x2e')]=qs[_0x3b51('0x2e')](_0x11d6c8['query']['limit']);_0x451a17['offset']=qs[_0x3b51('0x2b')](_0x11d6c8[_0x3b51('0x40')][_0x3b51('0x2b')]);}_0x451a17['order']=qs[_0x3b51('0x48')](_0x11d6c8['query'][_0x3b51('0x48')]);_0x451a17['where']=qs['filters'](_[_0x3b51('0x4a')](_0x11d6c8[_0x3b51('0x40')],_0x5d4b1d[_0x3b51('0x42')]));_0x451a17[_0x3b51('0x49')][_0x3b51('0x65')]=_0x4e93fa['id'];if(_0x11d6c8['query'][_0x3b51('0x4d')]){_0x451a17[_0x3b51('0x49')]=_['merge'](_0x451a17[_0x3b51('0x49')],{'$or':_['map'](_0x451a17[_0x3b51('0x45')],function(_0x577fae){var _0x17d659={};_0x17d659[_0x577fae]={'$like':'%'+_0x11d6c8[_0x3b51('0x40')][_0x3b51('0x4d')]+'%'};return _0x17d659;})});}_0x451a17=_[_0x3b51('0x4b')]({},_0x451a17,_0x11d6c8[_0x3b51('0x4e')]);return db[_0x3b51('0x71')][_0x3b51('0x2d')]({'where':_0x451a17[_0x3b51('0x49')]})[_0x3b51('0x33')](function(_0x13b7f5){_0x2f3e22[_0x3b51('0x2d')]=_0x13b7f5;if(_0x11d6c8[_0x3b51('0x40')][_0x3b51('0x54')]){_0x451a17[_0x3b51('0x55')]=[{'model':db[_0x3b51('0x73')],'as':_0x3b51('0x74'),'required':![]},{'model':db[_0x3b51('0x75')],'as':'Owner','attributes':[_0x3b51('0x3f'),'fullname',_0x3b51('0x76')],'required':![]},{'model':db[_0x3b51('0x77')],'as':_0x3b51('0x78'),'attributes':['id',_0x3b51('0x3f'),_0x3b51('0x79')],'where':_0x11d6c8[_0x3b51('0x40')]['tag']?{'id':_0x11d6c8['query'][_0x3b51('0x7a')]}:undefined,'required':_0x11d6c8[_0x3b51('0x40')][_0x3b51('0x7a')]?!![]:![]}];}return db[_0x3b51('0x71')][_0x3b51('0x4f')](_0x451a17);})['then'](function(_0x409ba3){_0x2f3e22['rows']=_0x409ba3;return _0x2f3e22;});}})[_0x3b51('0x33')](respondWithFilteredResult(_0x39c05d,_0x451a17))[_0x3b51('0x51')](handleError(_0x39c05d,null));};exports['addApplications']=function(_0x36a2ea,_0x42af54,_0xb78ab6){return db['FaxAccount'][_0x3b51('0x68')]({'where':{'id':_0x36a2ea[_0x3b51('0x62')]['id']}})[_0x3b51('0x33')](handleEntityNotFound(_0x42af54,null))['then'](function(_0x252c14){if(_0x252c14){return db[_0x3b51('0x7b')]['transaction'](function(_0x557067){return db[_0x3b51('0x7c')][_0x3b51('0x61')]({'where':{'FaxAccountId':_0x36a2ea[_0x3b51('0x62')]['id']},'transaction':_0x557067})[_0x3b51('0x33')](function(_0x578ad4){var _0x120270=_[_0x3b51('0x3a')](_0x36a2ea[_0x3b51('0x60')],function(_0x41975d){_0x41975d[_0x3b51('0x65')]=_0x36a2ea[_0x3b51('0x62')]['id'];return _0x41975d;});return db['FaxApplication'][_0x3b51('0x7d')](_0x120270,{'transaction':_0x557067});});})['then'](function(){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x36a2ea['params']['id']},'order':'priority'});});}})[_0x3b51('0x33')](respondWithResult(_0x42af54,null))[_0x3b51('0x51')](handleError(_0x42af54,null));};exports[_0x3b51('0x7e')]=function(_0x2d67fb,_0x682c47,_0x1d132a){var _0x25e33d={};var _0x404e0c={};var _0x417cef;var _0x2557d0;return db[_0x3b51('0x3b')][_0x3b51('0x68')]({'where':{'id':_0x2d67fb[_0x3b51('0x62')]['id']}})[_0x3b51('0x33')](handleEntityNotFound(_0x682c47,null))['then'](function(_0x449e9d){if(_0x449e9d){_0x417cef=_0x449e9d;_0x404e0c['model']=_[_0x3b51('0x41')](db[_0x3b51('0x7c')][_0x3b51('0x3c')]);_0x404e0c[_0x3b51('0x40')]=_['keys'](_0x2d67fb[_0x3b51('0x40')]);_0x404e0c[_0x3b51('0x42')]=_['intersection'](_0x404e0c[_0x3b51('0x44')],_0x404e0c['query']);_0x25e33d[_0x3b51('0x45')]=_[_0x3b51('0x43')](_0x404e0c[_0x3b51('0x44')],qs[_0x3b51('0x46')](_0x2d67fb[_0x3b51('0x40')][_0x3b51('0x46')]));_0x25e33d[_0x3b51('0x45')]=_0x25e33d['attributes'][_0x3b51('0x53')]?_0x25e33d['attributes']:_0x404e0c[_0x3b51('0x44')];_0x25e33d['order']=qs[_0x3b51('0x48')](_0x2d67fb['query'][_0x3b51('0x48')]);_0x25e33d[_0x3b51('0x49')]=qs['filters'](_[_0x3b51('0x4a')](_0x2d67fb['query'],_0x404e0c[_0x3b51('0x42')]));if(_0x2d67fb[_0x3b51('0x40')][_0x3b51('0x4d')]){_0x25e33d['where']=_[_0x3b51('0x4b')](_0x25e33d['where'],{'$or':_[_0x3b51('0x3a')](_0x25e33d[_0x3b51('0x45')],function(_0xf7df3a){var _0x11b2bc={};_0x11b2bc[_0xf7df3a]={'$like':'%'+_0x2d67fb[_0x3b51('0x40')][_0x3b51('0x4d')]+'%'};return _0x11b2bc;})});}_0x25e33d=_[_0x3b51('0x4b')]({},_0x25e33d,_0x2d67fb[_0x3b51('0x4e')]);return _0x417cef[_0x3b51('0x7e')](_0x25e33d);}})['then'](function(_0x471e92){if(_0x471e92){_0x2557d0=_0x471e92[_0x3b51('0x53')];if(!_0x2d67fb[_0x3b51('0x40')][_0x3b51('0x47')](_0x3b51('0x6d'))){_0x25e33d[_0x3b51('0x2e')]=qs[_0x3b51('0x2e')](_0x2d67fb['query'][_0x3b51('0x2e')]);_0x25e33d[_0x3b51('0x2b')]=qs[_0x3b51('0x2b')](_0x2d67fb[_0x3b51('0x40')]['offset']);}return _0x417cef[_0x3b51('0x7e')](_0x25e33d);}})[_0x3b51('0x33')](function(_0x342305){if(_0x342305){return _0x342305?{'count':_0x2557d0,'rows':_0x342305}:null;}})[_0x3b51('0x33')](respondWithResult(_0x682c47,null))[_0x3b51('0x51')](handleError(_0x682c47,null));};function Extension(_0x230468,_0x11e3dc,_0x56ab54,_0x542d67){this[_0x3b51('0x7f')]='from-voip-provider';this['exten']=_0x230468['localstationid'];this[_0x3b51('0x80')]=_0x542d67;this[_0x3b51('0x3d')]=_0x3b51('0x81');this[_0x3b51('0x82')]=_0x3b51('0x83');this['FaxAccountId']=_0x230468['id'];this['priority']=_0x11e3dc;this[_0x3b51('0x84')]=_0x56ab54;}function createExtensionsReciveFax(_0x437e53){var _0x254dfb=0x1;var _0x4d7af7=[];_0x4d7af7['push'](new Extension(_0x437e53,_0x254dfb,'',_0x3b51('0x85')));_0x254dfb+=0x1;_0x4d7af7[_0x3b51('0x86')](new Extension(_0x437e53,_0x254dfb,_0x3b51('0x87'),_0x3b51('0x88')));_0x254dfb+=0x1;for(var _0x1421ca in _0x437e53){if(_0x437e53[_0x3b51('0x47')](_0x1421ca)&&(_0x1421ca==='ecm'||_0x1421ca==='localstationid'||_0x1421ca===_0x3b51('0x89')||_0x1421ca===_0x3b51('0x8a')||_0x1421ca===_0x3b51('0x8b')||_0x1421ca===_0x3b51('0x8c')||_0x1421ca===_0x3b51('0x8d')||_0x1421ca===_0x3b51('0x8e')||_0x1421ca===_0x3b51('0x8f'))){_0x4d7af7[_0x3b51('0x86')](new Extension(_0x437e53,_0x254dfb,'FAXOPT('+_0x1421ca+')='+_0x437e53[_0x1421ca],'Set'));_0x254dfb+=0x1;}}_0x4d7af7['push'](new Extension(_0x437e53,_0x254dfb,'6',_0x3b51('0x90')));_0x254dfb+=0x1;_0x4d7af7[_0x3b51('0x86')](new Extension(_0x437e53,_0x254dfb,'/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'));_0x254dfb=0x0;return _0x4d7af7;}exports[_0x3b51('0x91')]=function(_0x5360e6,_0x10d761,_0x1bdd61){var _0x316e16;return db[_0x3b51('0x7b')][_0x3b51('0x92')](function(_0x43c89c){return db[_0x3b51('0x3b')][_0x3b51('0x56')](_0x5360e6[_0x3b51('0x60')],{'transaction':_0x43c89c})['then'](function(_0x2407f9){_0x316e16=_0x2407f9[_0x3b51('0x34')]({'plain':!![]});return db[_0x3b51('0x93')][_0x3b51('0x7d')](createExtensionsReciveFax(_0x316e16),{'transaction':_0x43c89c});});})[_0x3b51('0x33')](function(){return _0x316e16;})[_0x3b51('0x33')](respondWithResult(_0x10d761,null))['catch'](handleError(_0x10d761,null));};exports['updateAccountApplications']=function(_0x2af71e,_0x513fe7,_0x5f3094){var _0x3ff2d1;return db[_0x3b51('0x7b')][_0x3b51('0x92')](function(_0x464a80){return db[_0x3b51('0x3b')][_0x3b51('0x32')](_0x2af71e['body'],{'where':{'id':_0x2af71e[_0x3b51('0x60')]['id']},'transaction':_0x464a80})['then'](function(_0x36eaff){return db['VoiceExtension'][_0x3b51('0x61')]({'where':{'FaxAccountId':_0x2af71e[_0x3b51('0x60')]['id']},'transaction':_0x464a80})[_0x3b51('0x33')](function(_0x74a5ee){return db[_0x3b51('0x93')][_0x3b51('0x7d')](createExtensionsReciveFax(_[_0x3b51('0x94')](_0x2af71e['body'],['tech',_0x3b51('0x3e'),'createdAt',_0x3b51('0x95'),_0x3b51('0x96'),_0x3b51('0x97')])),{'transaction':_0x464a80});});});})['then'](function(){return db[_0x3b51('0x3b')][_0x3b51('0x98')](_0x2af71e[_0x3b51('0x60')]['id']);})[_0x3b51('0x33')](respondWithResult(_0x513fe7,null))['catch'](handleError(_0x513fe7,null));};exports[_0x3b51('0x99')]=function(_0x56e123,_0x1c0035,_0x55453f){var _0x498a7b={'raw':!![],'where':{}};var _0x3385b5={};var _0x51a066={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3b51('0x68')]({'where':{'id':_0x56e123[_0x3b51('0x62')]['id']}})['then'](handleEntityNotFound(_0x1c0035,null))[_0x3b51('0x33')](function(_0x28287b){if(_0x28287b){_0x3385b5[_0x3b51('0x44')]=_[_0x3b51('0x41')](db[_0x3b51('0x9a')]['rawAttributes']);_0x3385b5['query']=_['keys'](_0x56e123['query']);_0x3385b5['filters']=_[_0x3b51('0x43')](_0x3385b5[_0x3b51('0x44')],_0x3385b5[_0x3b51('0x40')]);_0x498a7b[_0x3b51('0x45')]=_['intersection'](_0x3385b5[_0x3b51('0x44')],qs[_0x3b51('0x46')](_0x56e123[_0x3b51('0x40')][_0x3b51('0x46')]));_0x498a7b[_0x3b51('0x45')]=_0x498a7b[_0x3b51('0x45')][_0x3b51('0x53')]?_0x498a7b['attributes']:_0x3385b5[_0x3b51('0x44')];if(!_0x56e123[_0x3b51('0x40')][_0x3b51('0x47')](_0x3b51('0x6d'))){_0x498a7b[_0x3b51('0x2e')]=qs[_0x3b51('0x2e')](_0x56e123[_0x3b51('0x40')]['limit']);_0x498a7b[_0x3b51('0x2b')]=qs[_0x3b51('0x2b')](_0x56e123[_0x3b51('0x40')][_0x3b51('0x2b')]);}_0x498a7b[_0x3b51('0x6e')]=qs[_0x3b51('0x48')](_0x56e123[_0x3b51('0x40')][_0x3b51('0x48')]);_0x498a7b[_0x3b51('0x49')]=qs[_0x3b51('0x42')](_['pick'](_0x56e123[_0x3b51('0x40')],_0x3385b5[_0x3b51('0x42')]));_0x498a7b[_0x3b51('0x49')][_0x3b51('0x65')]=_0x28287b['id'];if(_0x56e123['query']['filter']){_0x498a7b[_0x3b51('0x49')]=_[_0x3b51('0x4b')](_0x498a7b['where'],{'$or':_[_0x3b51('0x3a')](_0x498a7b[_0x3b51('0x45')],function(_0x16e284){var _0x173196={};_0x173196[_0x16e284]={'$like':'%'+_0x56e123[_0x3b51('0x40')][_0x3b51('0x4d')]+'%'};return _0x173196;})});}if(_0x56e123[_0x3b51('0x40')]['$gte']){var _0x743e26=_0x56e123['query'][_0x3b51('0x9b')][_0x3b51('0x9c')](',');var _0x18d37c={};_0x18d37c[_0x743e26[0x0]]={'$gte':moment(_0x743e26[0x1])[_0x3b51('0x9d')](_0x3b51('0x9e'))};_0x498a7b[_0x3b51('0x49')]=_[_0x3b51('0x4b')](_0x498a7b[_0x3b51('0x49')],_0x18d37c);}_0x498a7b=_[_0x3b51('0x4b')]({},_0x498a7b,_0x56e123[_0x3b51('0x4e')]);return db[_0x3b51('0x9a')][_0x3b51('0x2d')]({'where':_0x498a7b[_0x3b51('0x49')]})['then'](function(_0x2cbfec){_0x51a066[_0x3b51('0x2d')]=_0x2cbfec;if(_0x56e123[_0x3b51('0x40')][_0x3b51('0x54')]){_0x498a7b[_0x3b51('0x55')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x498a7b);})[_0x3b51('0x33')](function(_0x56112e){_0x51a066[_0x3b51('0x50')]=_0x56112e;return _0x51a066;});}})[_0x3b51('0x33')](respondWithFilteredResult(_0x1c0035,_0x498a7b))[_0x3b51('0x51')](handleError(_0x1c0035,null));};exports[_0x3b51('0x37')]=function(_0x3c63f0,_0x352c3b,_0x39738f){var _0x372b55,_0x153bbd={},_0xae3b8c;if(_0x3c63f0['body']['to']){_0xae3b8c=_0x3c63f0[_0x3b51('0x60')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x3c63f0['params']['id']},'include':[{'model':db[_0x3b51('0x9f')],'as':_0x3b51('0xa0'),'include':[{'model':db[_0x3b51('0x73')],'as':_0x3b51('0xa1'),'where':{'fax':_0xae3b8c},'limit':0x1,'order':[[_0x3b51('0x95'),'DESC']]}]}]})[_0x3b51('0x33')](handleEntityNotFound(_0x352c3b,null))['then'](function(_0x47df0a){_0x372b55=_0x47df0a;if(_0x3c63f0['body'][_0x3b51('0xa2')]&&_0x3c63f0[_0x3b51('0x60')][_0x3b51('0xa2')][_0x3b51('0x53')]){for(var _0x49fa11=0x0;_0x49fa11<_0x3c63f0['body'][_0x3b51('0xa2')][_0x3b51('0x53')];_0x49fa11+=0x1){_0x3c63f0[_0x3b51('0x60')][_0x3b51('0xa2')][_0x49fa11]={'filename':_0x3c63f0['body'][_0x3b51('0xa2')][_0x49fa11][_0x3b51('0x3f')],'id':_0x3c63f0['body'][_0x3b51('0xa2')][_0x49fa11]['id'],'path':path[_0x3b51('0xa3')](config[_0x3b51('0xa4')],_0x3b51('0xa5'),_0x3c63f0[_0x3b51('0x60')][_0x3b51('0xa2')][_0x49fa11]['basename'])};}}return respondWithRpcPromise(_0x3b51('0xa6'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x3c63f0[_0x3b51('0x62')]['id'])?undefined:_0x3c63f0[_0x3b51('0x62')]['id'],'path':_['isNil'](_0x3c63f0['body'][_0x3b51('0xa2')][0x0][_0x3b51('0xa7')])?undefined:_0x3c63f0[_0x3b51('0x60')]['attachments'][0x0][_0x3b51('0xa7')],'fax':_[_0x3b51('0xa8')](_0x3c63f0['body']['to'][0x0])?undefined:_0x3c63f0[_0x3b51('0x60')]['to'][0x0]},client9002);})[_0x3b51('0x33')](function(){if(_0x372b55){if(_[_0x3b51('0xa8')](_0x3c63f0[_0x3b51('0x60')][_0x3b51('0xa9')])){_0x3c63f0[_0x3b51('0x60')][_0x3b51('0xa9')]=util[_0x3b51('0x9d')](_0x3b51('0xaa'),_0x372b55['name'],_0x372b55[_0x3b51('0xab')]);}if(_0x372b55[_0x3b51('0xa0')]){if(_0x372b55[_0x3b51('0xa0')][_0x3b51('0xa1')]['length']){return _0x372b55['List']['Contacts'][0x0];}else{return db[_0x3b51('0x73')][_0x3b51('0x56')](_['defaults'](_0x3c63f0[_0x3b51('0x60')],{'firstName':_0x3c63f0[_0x3b51('0x60')]['to'][0x0],'phone':_0x3c63f0[_0x3b51('0x60')]['to'][0x0],'fax':_0x3c63f0[_0x3b51('0x60')]['to'][0x0],'ListId':_0x372b55['ListId']}));}}else{throw new Error(_0x3b51('0xac'));}}else{throw new Error(_0x3b51('0xad'));}})[_0x3b51('0x33')](function(_0x395c41){if(_0x395c41){return db[_0x3b51('0x71')]['find']({'where':{'ContactId':_0x395c41['id'],'closed':![],'FaxAccountId':_0x372b55['id']}})[_0x3b51('0x33')](function(_0x1d80a5){if(_0x1d80a5){return[_0x1d80a5,![]];}return db['FaxInteraction'][_0x3b51('0x56')]({'UserId':_0x3c63f0['user']['id'],'ContactId':_0x395c41['id'],'FaxAccountId':_0x372b55['id'],'fax':_0x3c63f0[_0x3b51('0x60')]['to'][0x0],'firstMsgDirection':_0x3b51('0xae'),'Messages':[_[_0x3b51('0x4b')](_0x3c63f0[_0x3b51('0x60')],{'read':![],'body':_0x3c63f0[_0x3b51('0x60')]['attachments'][0x0][_0x3b51('0xaf')],'FaxAccountId':_0x372b55['id'],'UserId':_0x3c63f0[_0x3b51('0x59')]['id'],'ContactId':_0x395c41['id'],'AttachmentId':_0x3c63f0[_0x3b51('0x60')][_0x3b51('0xa2')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x3b51('0xb0')}]})[_0x3b51('0x33')](function(_0x5e0d8d){return[_0x5e0d8d,!![]];});});}else{throw new Error(_0x3b51('0xb1'));}})[_0x3b51('0xb2')](function(_0x21962f,_0x5d4621){if(_0x5d4621){return _0x21962f;}return db[_0x3b51('0x9a')][_0x3b51('0x56')]({'direction':_0x3b51('0xae'),'read':![],'body':_0x3c63f0[_0x3b51('0x60')]['attachments'][0x0][_0x3b51('0xaf')],'FaxAccountId':_0x372b55['id'],'FaxInteractionId':_0x21962f['id'],'UserId':_0x3c63f0[_0x3b51('0x59')]['id'],'ContactId':_0x21962f[_0x3b51('0xb3')],'AttachmentId':_0x3c63f0['body'][_0x3b51('0xa2')][0x0]['id']})[_0x3b51('0x33')](function(_0x360b9c){_0x21962f[_0x3b51('0xb4')][_0x3b51('0xb0')]=[];_0x21962f['dataValues'][_0x3b51('0xb0')]['push'](_0x360b9c[_0x3b51('0xb4')]);return _0x21962f;});})[_0x3b51('0x33')](function(_0xf341b0){respondWithRpcPromise(_0x3b51('0xb5'),_0x3b51('0xb5'),{'FaxAccountId':_[_0x3b51('0xa8')](_0x3c63f0[_0x3b51('0x62')]['id'])?undefined:_0x3c63f0[_0x3b51('0x62')]['id'],'path':_[_0x3b51('0xa8')](_0x3c63f0[_0x3b51('0x60')][_0x3b51('0xa2')][0x0][_0x3b51('0xa7')])?undefined:_0x3c63f0[_0x3b51('0x60')][_0x3b51('0xa2')][0x0][_0x3b51('0xa7')],'fax':_[_0x3b51('0xa8')](_0x3c63f0[_0x3b51('0x60')]['to'][0x0])?undefined:_0x3c63f0[_0x3b51('0x60')]['to'][0x0],'AttachmentId':_0x3c63f0[_0x3b51('0x60')]['attachments'][0x0]['id']},client9002)[_0x3b51('0x33')](function(_0x3c75fe){logger['info'](_0x3b51('0xb6'),_0x3c75fe);})[_0x3b51('0x51')](function(_0x5579bd){logger[_0x3b51('0x20')](_0x3b51('0xb6'),_0x5579bd);});return _0xf341b0;})['then'](respondWithResult(_0x352c3b,null))[_0x3b51('0x51')](handleError(_0x352c3b,null));};exports['addAgents']=function(_0xa74a85,_0x261d67,_0x3dbc04){return db['FaxAccount'][_0x3b51('0x5b')]({'where':{'id':_0xa74a85[_0x3b51('0x62')]['id']}})[_0x3b51('0x33')](handleEntityNotFound(_0x261d67,null))[_0x3b51('0x33')](function(_0x1c343c){if(_0x1c343c){return _0x1c343c[_0x3b51('0xb7')](_0xa74a85['body'][_0x3b51('0x6a')],_[_0x3b51('0x94')](_0xa74a85[_0x3b51('0x60')],[_0x3b51('0x6a'),'id'])||{})[_0x3b51('0xb2')](function(_0x54bf97){for(var _0x3a41ce=0x0;_0x3a41ce<_0xa74a85[_0x3b51('0x60')][_0x3b51('0x6a')]['length'];_0x3a41ce+=0x1){socket[_0x3b51('0xb8')]('userFaxAccount:save',{'UserId':Number(_0xa74a85[_0x3b51('0x60')][_0x3b51('0x6a')][_0x3a41ce]),'FaxAccountId':Number(_0xa74a85[_0x3b51('0x62')]['id'])});}return _0x54bf97;});}})[_0x3b51('0x33')](respondWithResult(_0x261d67,null))[_0x3b51('0x51')](handleError(_0x261d67,null));};exports[_0x3b51('0xb9')]=function(_0x1b43f1,_0x4a2892,_0x297da4){return db['FaxAccount'][_0x3b51('0x5b')]({'where':{'id':_0x1b43f1[_0x3b51('0x62')]['id']}})[_0x3b51('0x33')](handleEntityNotFound(_0x4a2892,null))['then'](function(_0x5022c6){if(_0x5022c6){return _0x5022c6[_0x3b51('0xb9')](_0x1b43f1['query'][_0x3b51('0x6a')])['then'](function(){if(_[_0x3b51('0xba')](_0x1b43f1[_0x3b51('0x40')][_0x3b51('0x6a')])){for(var _0xce09a9=0x0;_0xce09a9<_0x1b43f1[_0x3b51('0x40')]['ids'][_0x3b51('0x53')];_0xce09a9+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x1b43f1['query'][_0x3b51('0x6a')][_0xce09a9]),'FaxAccountId':Number(_0x1b43f1[_0x3b51('0x62')]['id'])});}}else{socket[_0x3b51('0xb8')](_0x3b51('0xbb'),{'UserId':Number(_0x1b43f1[_0x3b51('0x40')][_0x3b51('0x6a')]),'FaxAccountId':Number(_0x1b43f1[_0x3b51('0x62')]['id'])});}});}})[_0x3b51('0x33')](respondWithStatusCode(_0x4a2892,null))[_0x3b51('0x51')](handleError(_0x4a2892,null));};exports[_0x3b51('0xbc')]=function(_0x46c9bd,_0x36f92c,_0x2e0af2){var _0x22deed={};var _0x405f98={};var _0x32d761;var _0x71ffc5;return db['FaxAccount'][_0x3b51('0x68')]({'where':{'id':_0x46c9bd[_0x3b51('0x62')]['id']}})['then'](handleEntityNotFound(_0x36f92c,null))[_0x3b51('0x33')](function(_0x5cffd0){if(_0x5cffd0){_0x32d761=_0x5cffd0;_0x405f98[_0x3b51('0x44')]=_[_0x3b51('0x41')](db[_0x3b51('0x75')]['rawAttributes']);_0x405f98[_0x3b51('0x40')]=_[_0x3b51('0x41')](_0x46c9bd[_0x3b51('0x40')]);_0x405f98['filters']=_['intersection'](_0x405f98[_0x3b51('0x44')],_0x405f98[_0x3b51('0x40')]);_0x22deed[_0x3b51('0x45')]=_[_0x3b51('0x43')](_0x405f98['model'],qs[_0x3b51('0x46')](_0x46c9bd['query']['fields']));_0x22deed[_0x3b51('0x45')]=_0x22deed[_0x3b51('0x45')][_0x3b51('0x53')]?_0x22deed[_0x3b51('0x45')]:_0x405f98[_0x3b51('0x44')];_0x22deed[_0x3b51('0x6e')]=qs[_0x3b51('0x48')](_0x46c9bd[_0x3b51('0x40')][_0x3b51('0x48')]);_0x22deed[_0x3b51('0x49')]=qs[_0x3b51('0x42')](_[_0x3b51('0x4a')](_0x46c9bd['query'],_0x405f98[_0x3b51('0x42')]));if(_0x46c9bd[_0x3b51('0x40')][_0x3b51('0x4d')]){_0x22deed[_0x3b51('0x49')]=_[_0x3b51('0x4b')](_0x22deed[_0x3b51('0x49')],{'$or':_[_0x3b51('0x3a')](_0x22deed[_0x3b51('0x45')],function(_0x301c1b){var _0xb30d50={};_0xb30d50[_0x301c1b]={'$like':'%'+_0x46c9bd[_0x3b51('0x40')][_0x3b51('0x4d')]+'%'};return _0xb30d50;})});}_0x22deed=_[_0x3b51('0x4b')]({},_0x22deed,_0x46c9bd[_0x3b51('0x4e')]);return _0x32d761[_0x3b51('0xbc')](_0x22deed);}})[_0x3b51('0x33')](function(_0x4c7ba7){if(_0x4c7ba7){_0x71ffc5=_0x4c7ba7[_0x3b51('0x53')];if(!_0x46c9bd[_0x3b51('0x40')][_0x3b51('0x47')]('nolimit')){_0x22deed[_0x3b51('0x2e')]=qs['limit'](_0x46c9bd[_0x3b51('0x40')][_0x3b51('0x2e')]);_0x22deed[_0x3b51('0x2b')]=qs[_0x3b51('0x2b')](_0x46c9bd[_0x3b51('0x40')][_0x3b51('0x2b')]);}return _0x32d761[_0x3b51('0xbc')](_0x22deed);}})[_0x3b51('0x33')](function(_0x18b45b){if(_0x18b45b){return _0x18b45b?{'count':_0x71ffc5,'rows':_0x18b45b}:null;}})[_0x3b51('0x33')](respondWithResult(_0x36f92c,null))[_0x3b51('0x51')](handleError(_0x36f92c,null));};
\ No newline at end of file
index 33269a6..f720219 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x754a=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save','update'];(function(_0x1e89a2,_0x377290){var _0x436508=function(_0xa9c987){while(--_0xa9c987){_0x1e89a2['push'](_0x1e89a2['shift']());}};_0x436508(++_0x377290);}(_0x754a,0x127));var _0xa754=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x754a[_0x3511d3];return _0x5d6321;};'use strict';var EventEmitter=require(_0xa754('0x0'));var FaxAccount=require(_0xa754('0x1'))['db'][_0xa754('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa754('0x3'),'afterUpdate':_0xa754('0x4'),'afterDestroy':_0xa754('0x5')};function emitEvent(_0x4292b7){return function(_0x2180dc,_0x16f2b6,_0x9eb10c){FaxAccountEvents[_0xa754('0x6')](_0x4292b7+':'+_0x2180dc['id'],_0x2180dc);FaxAccountEvents[_0xa754('0x6')](_0x4292b7,_0x2180dc);_0x9eb10c(null);};}for(var e in events){if(events[_0xa754('0x7')](e)){var event=events[e];FaxAccount[_0xa754('0x8')](e,emitEvent(event));}}module[_0xa754('0x9')]=FaxAccountEvents;
\ No newline at end of file
+var _0x11f3=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save'];(function(_0x1de06d,_0x269cbf){var _0x2bb149=function(_0xaea187){while(--_0xaea187){_0x1de06d['push'](_0x1de06d['shift']());}};_0x2bb149(++_0x269cbf);}(_0x11f3,0x149));var _0x311f=function(_0x1db7fb,_0x525b9d){_0x1db7fb=_0x1db7fb-0x0;var _0x451ade=_0x11f3[_0x1db7fb];return _0x451ade;};'use strict';var EventEmitter=require(_0x311f('0x0'));var FaxAccount=require(_0x311f('0x1'))['db'][_0x311f('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x311f('0x3'),'afterUpdate':'update','afterDestroy':_0x311f('0x4')};function emitEvent(_0x3f8433){return function(_0x14ae97,_0x5efe46,_0x5cb8aa){FaxAccountEvents[_0x311f('0x5')](_0x3f8433+':'+_0x14ae97['id'],_0x14ae97);FaxAccountEvents['emit'](_0x3f8433,_0x14ae97);_0x5cb8aa(null);};}for(var e in events){if(events[_0x311f('0x6')](e)){var event=events[e];FaxAccount[_0x311f('0x7')](e,emitEvent(event));}}module[_0x311f('0x8')]=FaxAccountEvents;
\ No newline at end of file
index 54ca25e..2a52251 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3262=['../../config/logger','api','request-promise','path','rimraf','./faxAccount.attributes','exports','define','lodash','util'];(function(_0x10b06,_0x58d200){var _0x56d0f2=function(_0x5a3078){while(--_0x5a3078){_0x10b06['push'](_0x10b06['shift']());}};_0x56d0f2(++_0x58d200);}(_0x3262,0x1e8));var _0x2326=function(_0x5b9d3a,_0x1f1842){_0x5b9d3a=_0x5b9d3a-0x0;var _0x383375=_0x3262[_0x5b9d3a];return _0x383375;};'use strict';var _=require(_0x2326('0x0'));var util=require(_0x2326('0x1'));var logger=require(_0x2326('0x2'))(_0x2326('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2326('0x4'));var fs=require('fs');var path=require(_0x2326('0x5'));var rimraf=require(_0x2326('0x6'));var config=require('../../config/environment');var attributes=require(_0x2326('0x7'));module[_0x2326('0x8')]=function(_0x597ef6,_0x44ba57){return _0x597ef6[_0x2326('0x9')]('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7805=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxAccount.attributes','FaxAccount','fax_accounts','../../config/logger'];(function(_0x3fd50c,_0x5b1e4b){var _0x55e690=function(_0x280442){while(--_0x280442){_0x3fd50c['push'](_0x3fd50c['shift']());}};_0x55e690(++_0x5b1e4b);}(_0x7805,0x103));var _0x5780=function(_0x1646fa,_0x4e5bd7){_0x1646fa=_0x1646fa-0x0;var _0x5a47a5=_0x7805[_0x1646fa];return _0x5a47a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5780('0x0'))(_0x5780('0x1'));var moment=require(_0x5780('0x2'));var BPromise=require(_0x5780('0x3'));var rp=require(_0x5780('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5780('0x5'));var config=require(_0x5780('0x6'));var attributes=require(_0x5780('0x7'));module['exports']=function(_0x1e31d2,_0x15283a){return _0x1e31d2['define'](_0x5780('0x8'),attributes,{'tableName':_0x5780('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3bbf14e..e0168b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6723=['create','contact','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','body','fax','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','ValidationError','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmContact','FaxApplication','Applications','List','get','applications','orderBy','priority','asc','Contacts','length'];(function(_0x57a50d,_0x2871f8){var _0x1b25b3=function(_0x45691e){while(--_0x45691e){_0x57a50d['push'](_0x57a50d['shift']());}};_0x1b25b3(++_0x2871f8);}(_0x6723,0x184));var _0x3672=function(_0x67bbb5,_0x97de12){_0x67bbb5=_0x67bbb5-0x0;var _0x1050ce=_0x6723[_0x67bbb5];return _0x1050ce;};'use strict';var _=require(_0x3672('0x0'));var util=require(_0x3672('0x1'));var moment=require(_0x3672('0x2'));var BPromise=require('bluebird');var rs=require(_0x3672('0x3'));var fs=require('fs');var Redis=require(_0x3672('0x4'));var db=require(_0x3672('0x5'))['db'];var utils=require(_0x3672('0x6'));var logger=require(_0x3672('0x7'))(_0x3672('0x8'));var config=require(_0x3672('0x9'));var jayson=require(_0x3672('0xa'));var client=jayson[_0x3672('0xb')][_0x3672('0xc')]({'port':0x232c});config['redis']=_[_0x3672('0xd')](config[_0x3672('0xe')],{'host':_0x3672('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3672('0xe')]));require(_0x3672('0x10'))[_0x3672('0x11')](socket);function respondWithRpcPromise(_0x5aef45,_0x5a139c,_0x3924e7){return new BPromise(function(_0x570efc,_0x9e9d8a){return client[_0x3672('0x12')](_0x5aef45,_0x3924e7)[_0x3672('0x13')](function(_0x4ec963){logger[_0x3672('0x14')](_0x3672('0x15'),_0x5a139c,'request\x20sent');logger[_0x3672('0x16')](_0x3672('0x17'),_0x5a139c,_0x3672('0x18'),JSON['stringify'](_0x4ec963));if(_0x4ec963[_0x3672('0x19')]){if(_0x4ec963[_0x3672('0x19')][_0x3672('0x1a')]===0x1f4){logger[_0x3672('0x19')](_0x3672('0x15'),_0x5a139c,_0x4ec963[_0x3672('0x19')][_0x3672('0x1b')]);return _0x9e9d8a(_0x4ec963[_0x3672('0x19')][_0x3672('0x1b')]);}logger[_0x3672('0x19')](_0x3672('0x15'),_0x5a139c,_0x4ec963['error'][_0x3672('0x1b')]);return _0x570efc(_0x4ec963[_0x3672('0x19')][_0x3672('0x1b')]);}else{logger[_0x3672('0x14')](_0x3672('0x15'),_0x5a139c,_0x3672('0x18'));_0x570efc(_0x4ec963['result'][_0x3672('0x1b')]);}})['catch'](function(_0xa8bfab){logger[_0x3672('0x19')](_0x3672('0x15'),_0x5a139c,_0xa8bfab);_0x9e9d8a(_0xa8bfab);});});}exports[_0x3672('0x1c')]=function(_0x219092){var _0x502065=this;return new Promise(function(_0x34b4c4,_0x40524d){return db[_0x3672('0x1d')][_0x3672('0x1e')]({'raw':_0x219092[_0x3672('0x1f')]?_0x219092[_0x3672('0x1f')][_0x3672('0x20')]===undefined?!![]:![]:!![],'where':_0x219092[_0x3672('0x1f')]?_0x219092[_0x3672('0x1f')][_0x3672('0x21')]||null:null,'attributes':_0x219092[_0x3672('0x1f')]?_0x219092[_0x3672('0x1f')][_0x3672('0x22')]||null:null,'limit':_0x219092[_0x3672('0x1f')]?_0x219092[_0x3672('0x1f')][_0x3672('0x23')]||null:null,'include':_0x219092[_0x3672('0x1f')]?_0x219092[_0x3672('0x1f')][_0x3672('0x24')]?_[_0x3672('0x25')](_0x219092[_0x3672('0x1f')][_0x3672('0x24')],function(_0x38778b){return{'model':db[_0x38778b[_0x3672('0x26')]],'as':_0x38778b['as'],'attributes':_0x38778b['attributes'],'include':_0x38778b[_0x3672('0x24')]?_[_0x3672('0x25')](_0x38778b[_0x3672('0x24')],function(_0x14d938){return{'model':db[_0x14d938['model']],'as':_0x14d938['as'],'attributes':_0x14d938[_0x3672('0x22')],'include':_0x14d938[_0x3672('0x24')]?_[_0x3672('0x25')](_0x14d938[_0x3672('0x24')],function(_0x5b9efd){return{'model':db[_0x5b9efd['model']],'as':_0x5b9efd['as'],'attributes':_0x5b9efd['attributes']};}):[]};}):[]};}):[]:[]})[_0x3672('0x13')](function(_0x566595){logger['info'](_0x3672('0x1c'),_0x219092);logger['debug'](_0x3672('0x1c'),_0x219092,JSON[_0x3672('0x27')](_0x566595));_0x34b4c4(_0x566595);})[_0x3672('0x28')](function(_0x4d23be){logger[_0x3672('0x19')](_0x3672('0x1c'),_0x4d23be[_0x3672('0x1b')],_0x219092);_0x40524d(_0x502065[_0x3672('0x19')](0x1f4,_0x4d23be[_0x3672('0x1b')]));});});};exports['NotifyFaxAccount']=function(_0x36a2a3,_0x184b89,_0x5f5494){var _0x1343b3=this;return new Promise(function(_0x19e65a,_0x4d3992){var _0xc297d6={'body':_0x36a2a3[_0x3672('0x29')],'channel':_0x3672('0x2a')};var _0x444802=[];var _0x84ffd5=[];var _0x8771e1={};return db['CmContact']['describe']()[_0x3672('0x13')](function(_0x59a73b){if(!_0x59a73b){throw new db[(_0x3672('0x2b'))]['ValidationError'](_0x3672('0x2c'));}_0x444802=_[_0x3672('0x2d')](_[_0x3672('0x2e')](_0x59a73b),['createdAt','updatedAt']);_0x84ffd5=_['difference'](_['keys'](_0x59a73b),[_0x3672('0x2f'),_0x3672('0x30'),_0x3672('0x31'),_0x3672('0x32')]);if(_0x36a2a3['body']['id']){delete _0x36a2a3[_0x3672('0x29')]['id'];}if(_['isNil'](_0x36a2a3['body'][_0x3672('0x33')])){throw new db[(_0x3672('0x2b'))]['ValidationError'](_0x3672('0x34'));}if(_['isNil'](_0x36a2a3[_0x3672('0x29')][_0x3672('0x29')])||_0x36a2a3['body'][_0x3672('0x29')]===''){throw new db[(_0x3672('0x2b'))]['ValidationError'](_0x3672('0x35'));}if(_[_0x3672('0x36')](_0x36a2a3['body'][_0x3672('0x37')])){throw new db[(_0x3672('0x2b'))]['ValidationError'](_0x3672('0x38')+_0x84ffd5);}if(!_['includes'](_0x84ffd5,_0x36a2a3[_0x3672('0x29')][_0x3672('0x37')])){throw new db['Sequelize'][(_0x3672('0x39'))](_0x3672('0x3a')+_0x84ffd5);}_0x8771e1[_0x36a2a3['body']['mapKey']]=_0x36a2a3['body'][_0x3672('0x33')];})[_0x3672('0x13')](function(){return db['FaxAccount'][_0x3672('0x3b')]({'where':{'id':_0x36a2a3[_0x3672('0x3c')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x3672('0x3d')],'as':'Contacts','where':_0x8771e1,'limit':0x1,'order':[[_0x3672('0x30'),'DESC']]}]},{'model':db[_0x3672('0x3e')],'as':_0x3672('0x3f')}]});})[_0x3672('0x13')](function(_0xc1b29){if(_0xc1b29&&_0xc1b29[_0x3672('0x40')]){var _0x1f0caf=_0xc1b29[_0x3672('0x41')]({'plain':!![]});_0xc297d6[_0x3672('0x3c')]=_0x1f0caf;_0xc297d6[_0x3672('0x42')]=_0x1f0caf[_0x3672('0x3f')];_0xc297d6['list']=_0x1f0caf[_0x3672('0x40')];_0xc297d6[_0x3672('0x42')]=_[_0x3672('0x43')](_0xc297d6[_0x3672('0x42')],[_0x3672('0x44')],[_0x3672('0x45')]);if(_0xc297d6[_0x3672('0x3c')][_0x3672('0x3f')]){delete _0xc297d6[_0x3672('0x3c')]['Applications'];}if(_0xc297d6[_0x3672('0x3c')][_0x3672('0x40')]&&_0xc297d6[_0x3672('0x3c')]['List'][_0x3672('0x46')][_0x3672('0x47')]){return _0xc297d6[_0x3672('0x3c')]['List'][_0x3672('0x46')][0x0];}var _0x110b34=_['defaults'](_0x36a2a3['body'],{'firstName':_0x36a2a3['body']['from'],'ListId':_0x1f0caf['ListId']});_0x110b34[_0x36a2a3[_0x3672('0x29')][_0x3672('0x37')]]=_0x36a2a3[_0x3672('0x29')]['from'];return db[_0x3672('0x3d')][_0x3672('0x48')](_0x110b34,{'fields':_0x444802,'raw':!![]});}})[_0x3672('0x13')](function(_0x922c9e){_0xc297d6[_0x3672('0x49')]=_0x922c9e;if(_0x922c9e){var _0x52c42e={'ContactId':_0x922c9e['id'],'FaxAccountId':_0x36a2a3[_0x3672('0x3c')]['id'],'fax':_0x922c9e[_0x3672('0x2a')]};return db['FaxInteraction'][_0x3672('0x3b')]({'where':{'ContactId':_0x922c9e['id'],'closed':![],'FaxAccountId':_0x36a2a3[_0x3672('0x3c')]['id']}})[_0x3672('0x13')](function(_0x540623){if(_0x540623){return[_0x540623,![]];}return db['FaxInteraction'][_0x3672('0x48')](_0x52c42e)['then'](function(_0x5e8d10){return[_0x5e8d10,!![]];});});}else{throw new Error(_0x3672('0x4a'));}})[_0x3672('0x4b')](function(_0x7da25,_0x55fe45){var _0x17d382=_0x7da25['get']({'plain':!![]});if(_0x55fe45){if(_0xc297d6['account']['autoclose']){_0xc297d6[_0x3672('0x42')][_0x3672('0x4c')]({'id':0x0,'priority':_0xc297d6['applications'][_0x3672('0x47')]+0x1,'app':_0x3672('0x4d'),'appdata':_0x3672('0x4e'),'interval':_0x3672('0x4f')});}_0x17d382[_0x3672('0x50')]=!![];}else{_0x17d382[_0x3672('0x50')]=![];}_0xc297d6[_0x3672('0x51')]=_0x17d382;return db[_0x3672('0x52')][_0x3672('0x48')]({'body':_0x36a2a3['body']['body'],'FaxAccountId':_0x36a2a3[_0x3672('0x3c')]['id'],'FaxInteractionId':_0x7da25['id'],'direction':'in','ContactId':_0x7da25[_0x3672('0x53')],'AttachmentId':_0x36a2a3['body'][_0x3672('0x54')]});})[_0x3672('0x13')](function(_0x70fca4){_0xc297d6[_0x3672('0x1b')]=_0x70fca4;if(_0xc297d6[_0x3672('0x51')][_0x3672('0x55')]){return db['User'][_0x3672('0x3b')]({'attributes':['id',_0x3672('0x56')],'where':{'id':_0xc297d6[_0x3672('0x51')][_0x3672('0x55')]}})[_0x3672('0x13')](function(_0x46466a){if(_0x46466a){_0xc297d6[_0x3672('0x42')][_0x3672('0x57')]({'id':0x0,'priority':0x0,'app':_0x3672('0x58'),'appdata':_0x46466a[_0x3672('0x56')]+','+(_0xc297d6[_0x3672('0x3c')][_0x3672('0x59')]||0xa),'interval':_0x3672('0x4f')});}return respondWithRpcPromise(_0x3672('0x5a'),'startRouting',_0xc297d6);});}return respondWithRpcPromise(_0x3672('0x5a'),_0x3672('0x5b'),_0xc297d6);})[_0x3672('0x13')](function(_0xaffeb1){_0x19e65a(_0xaffeb1);})[_0x3672('0x28')](function(_0x21fd44){_0x4d3992(_0x1343b3[_0x3672('0x19')](0x1f4,_0x21fd44[_0x3672('0x1b')]));});});};
\ No newline at end of file
+var _0xdb23=['close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','map','include','model','attributes','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','difference','keys','updatedAt','ListId','isNil','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','create','FaxInteraction','spread','autoclose','push','length'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdb23,0xbd));var _0x3db2=function(_0x4a7824,_0x468224){_0x4a7824=_0x4a7824-0x0;var _0x49ab83=_0xdb23[_0x4a7824];return _0x49ab83;};'use strict';var _=require(_0x3db2('0x0'));var util=require(_0x3db2('0x1'));var moment=require(_0x3db2('0x2'));var BPromise=require(_0x3db2('0x3'));var rs=require(_0x3db2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3db2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3db2('0x6'));var config=require(_0x3db2('0x7'));var jayson=require(_0x3db2('0x8'));var client=jayson[_0x3db2('0x9')]['http']({'port':0x232c});config[_0x3db2('0xa')]=_[_0x3db2('0xb')](config[_0x3db2('0xa')],{'host':_0x3db2('0xc'),'port':0x18eb});var socket=require(_0x3db2('0xd'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x3db2('0xe')](socket);function respondWithRpcPromise(_0x258c97,_0x5d03e1,_0x2fc4af){return new BPromise(function(_0x1e969c,_0x528680){return client[_0x3db2('0xf')](_0x258c97,_0x2fc4af)[_0x3db2('0x10')](function(_0x26d885){logger['info'](_0x3db2('0x11'),_0x5d03e1,_0x3db2('0x12'));logger[_0x3db2('0x13')](_0x3db2('0x14'),_0x5d03e1,_0x3db2('0x12'),JSON[_0x3db2('0x15')](_0x26d885));if(_0x26d885[_0x3db2('0x16')]){if(_0x26d885[_0x3db2('0x16')][_0x3db2('0x17')]===0x1f4){logger[_0x3db2('0x16')]('FaxAccount,\x20%s,\x20%s',_0x5d03e1,_0x26d885['error'][_0x3db2('0x18')]);return _0x528680(_0x26d885[_0x3db2('0x16')][_0x3db2('0x18')]);}logger['error'](_0x3db2('0x11'),_0x5d03e1,_0x26d885[_0x3db2('0x16')][_0x3db2('0x18')]);return _0x1e969c(_0x26d885['error']['message']);}else{logger[_0x3db2('0x19')](_0x3db2('0x11'),_0x5d03e1,_0x3db2('0x12'));_0x1e969c(_0x26d885['result'][_0x3db2('0x18')]);}})[_0x3db2('0x1a')](function(_0x3b1652){logger[_0x3db2('0x16')](_0x3db2('0x11'),_0x5d03e1,_0x3b1652);_0x528680(_0x3b1652);});});}exports[_0x3db2('0x1b')]=function(_0x2551be){var _0x118050=this;return new Promise(function(_0x34adf3,_0x51bc2e){return db[_0x3db2('0x1c')][_0x3db2('0x1d')]({'raw':_0x2551be[_0x3db2('0x1e')]?_0x2551be[_0x3db2('0x1e')][_0x3db2('0x1f')]===undefined?!![]:![]:!![],'where':_0x2551be[_0x3db2('0x1e')]?_0x2551be[_0x3db2('0x1e')][_0x3db2('0x20')]||null:null,'attributes':_0x2551be['options']?_0x2551be['options']['attributes']||null:null,'limit':_0x2551be[_0x3db2('0x1e')]?_0x2551be[_0x3db2('0x1e')]['limit']||null:null,'include':_0x2551be[_0x3db2('0x1e')]?_0x2551be[_0x3db2('0x1e')]['include']?_[_0x3db2('0x21')](_0x2551be[_0x3db2('0x1e')][_0x3db2('0x22')],function(_0x2ef918){return{'model':db[_0x2ef918[_0x3db2('0x23')]],'as':_0x2ef918['as'],'attributes':_0x2ef918[_0x3db2('0x24')],'include':_0x2ef918['include']?_[_0x3db2('0x21')](_0x2ef918[_0x3db2('0x22')],function(_0x28fa7a){return{'model':db[_0x28fa7a[_0x3db2('0x23')]],'as':_0x28fa7a['as'],'attributes':_0x28fa7a[_0x3db2('0x24')],'include':_0x28fa7a[_0x3db2('0x22')]?_['map'](_0x28fa7a[_0x3db2('0x22')],function(_0x40cd3c){return{'model':db[_0x40cd3c['model']],'as':_0x40cd3c['as'],'attributes':_0x40cd3c[_0x3db2('0x24')]};}):[]};}):[]};}):[]:[]})[_0x3db2('0x10')](function(_0x4989c5){logger[_0x3db2('0x19')](_0x3db2('0x1b'),_0x2551be);logger[_0x3db2('0x13')](_0x3db2('0x1b'),_0x2551be,JSON['stringify'](_0x4989c5));_0x34adf3(_0x4989c5);})[_0x3db2('0x1a')](function(_0x26741b){logger[_0x3db2('0x16')](_0x3db2('0x1b'),_0x26741b[_0x3db2('0x18')],_0x2551be);_0x51bc2e(_0x118050[_0x3db2('0x16')](0x1f4,_0x26741b[_0x3db2('0x18')]));});});};exports[_0x3db2('0x25')]=function(_0x28c397,_0x272a3b,_0x5633f7){var _0x3155cf=this;return new Promise(function(_0x4abfc7,_0x4cab1e){var _0x316324={'body':_0x28c397[_0x3db2('0x26')],'channel':_0x3db2('0x27')};var _0x265671=[];var _0x14facc=[];var _0x4e48c3={};return db[_0x3db2('0x28')][_0x3db2('0x29')]()[_0x3db2('0x10')](function(_0x34a0a1){if(!_0x34a0a1){throw new db['Sequelize'][(_0x3db2('0x2a'))]('no\x20available\x20attributes');}_0x265671=_[_0x3db2('0x2b')](_[_0x3db2('0x2c')](_0x34a0a1),['createdAt',_0x3db2('0x2d')]);_0x14facc=_[_0x3db2('0x2b')](_[_0x3db2('0x2c')](_0x34a0a1),['createdAt',_0x3db2('0x2d'),'CompanyId',_0x3db2('0x2e')]);if(_0x28c397['body']['id']){delete _0x28c397[_0x3db2('0x26')]['id'];}if(_[_0x3db2('0x2f')](_0x28c397['body'][_0x3db2('0x30')])){throw new db[(_0x3db2('0x31'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x28c397[_0x3db2('0x26')][_0x3db2('0x26')])||_0x28c397[_0x3db2('0x26')][_0x3db2('0x26')]===''){throw new db[(_0x3db2('0x31'))][(_0x3db2('0x2a'))](_0x3db2('0x32'));}if(_[_0x3db2('0x2f')](_0x28c397[_0x3db2('0x26')][_0x3db2('0x33')])){throw new db[(_0x3db2('0x31'))][(_0x3db2('0x2a'))](_0x3db2('0x34')+_0x14facc);}if(!_[_0x3db2('0x35')](_0x14facc,_0x28c397[_0x3db2('0x26')][_0x3db2('0x33')])){throw new db['Sequelize'][(_0x3db2('0x2a'))](_0x3db2('0x36')+_0x14facc);}_0x4e48c3[_0x28c397[_0x3db2('0x26')][_0x3db2('0x33')]]=_0x28c397[_0x3db2('0x26')][_0x3db2('0x30')];})['then'](function(){return db[_0x3db2('0x1c')][_0x3db2('0x37')]({'where':{'id':_0x28c397[_0x3db2('0x38')]['id']},'include':[{'model':db[_0x3db2('0x39')],'as':_0x3db2('0x3a'),'include':[{'model':db[_0x3db2('0x28')],'as':_0x3db2('0x3b'),'where':_0x4e48c3,'limit':0x1,'order':[[_0x3db2('0x2d'),_0x3db2('0x3c')]]}]},{'model':db[_0x3db2('0x3d')],'as':_0x3db2('0x3e')}]});})[_0x3db2('0x10')](function(_0x3613bc){if(_0x3613bc&&_0x3613bc[_0x3db2('0x3a')]){var _0x34cf76=_0x3613bc[_0x3db2('0x3f')]({'plain':!![]});_0x316324[_0x3db2('0x38')]=_0x34cf76;_0x316324[_0x3db2('0x40')]=_0x34cf76[_0x3db2('0x3e')];_0x316324[_0x3db2('0x41')]=_0x34cf76['List'];_0x316324[_0x3db2('0x40')]=_[_0x3db2('0x42')](_0x316324[_0x3db2('0x40')],[_0x3db2('0x43')],[_0x3db2('0x44')]);if(_0x316324[_0x3db2('0x38')][_0x3db2('0x3e')]){delete _0x316324[_0x3db2('0x38')]['Applications'];}if(_0x316324[_0x3db2('0x38')][_0x3db2('0x3a')]&&_0x316324[_0x3db2('0x38')][_0x3db2('0x3a')][_0x3db2('0x3b')]['length']){return _0x316324[_0x3db2('0x38')][_0x3db2('0x3a')][_0x3db2('0x3b')][0x0];}var _0x55f31c=_[_0x3db2('0xb')](_0x28c397[_0x3db2('0x26')],{'firstName':_0x28c397[_0x3db2('0x26')][_0x3db2('0x30')],'ListId':_0x34cf76[_0x3db2('0x2e')]});_0x55f31c[_0x28c397[_0x3db2('0x26')]['mapKey']]=_0x28c397[_0x3db2('0x26')]['from'];return db[_0x3db2('0x28')][_0x3db2('0x45')](_0x55f31c,{'fields':_0x265671,'raw':!![]});}})[_0x3db2('0x10')](function(_0x141403){_0x316324['contact']=_0x141403;if(_0x141403){var _0x1c086f={'ContactId':_0x141403['id'],'FaxAccountId':_0x28c397[_0x3db2('0x38')]['id'],'fax':_0x141403[_0x3db2('0x27')]};return db['FaxInteraction'][_0x3db2('0x37')]({'where':{'ContactId':_0x141403['id'],'closed':![],'FaxAccountId':_0x28c397[_0x3db2('0x38')]['id']}})[_0x3db2('0x10')](function(_0x37f893){if(_0x37f893){return[_0x37f893,![]];}return db[_0x3db2('0x46')][_0x3db2('0x45')](_0x1c086f)[_0x3db2('0x10')](function(_0x3dc1e2){return[_0x3dc1e2,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x3db2('0x47')](function(_0x86c631,_0x32acf4){var _0x1acc80=_0x86c631['get']({'plain':!![]});if(_0x32acf4){if(_0x316324['account'][_0x3db2('0x48')]){_0x316324[_0x3db2('0x40')][_0x3db2('0x49')]({'id':0x0,'priority':_0x316324[_0x3db2('0x40')][_0x3db2('0x4a')]+0x1,'app':_0x3db2('0x4b'),'appdata':_0x3db2('0x4c'),'interval':_0x3db2('0x4d')});}_0x1acc80[_0x3db2('0x4e')]=!![];}else{_0x1acc80[_0x3db2('0x4e')]=![];}_0x316324[_0x3db2('0x4f')]=_0x1acc80;return db[_0x3db2('0x50')][_0x3db2('0x45')]({'body':_0x28c397[_0x3db2('0x26')]['body'],'FaxAccountId':_0x28c397[_0x3db2('0x38')]['id'],'FaxInteractionId':_0x86c631['id'],'direction':'in','ContactId':_0x86c631[_0x3db2('0x51')],'AttachmentId':_0x28c397['body'][_0x3db2('0x52')]});})['then'](function(_0x5783ba){_0x316324[_0x3db2('0x18')]=_0x5783ba;if(_0x316324['interaction'][_0x3db2('0x53')]){return db['User'][_0x3db2('0x37')]({'attributes':['id',_0x3db2('0x54')],'where':{'id':_0x316324[_0x3db2('0x4f')][_0x3db2('0x53')]}})[_0x3db2('0x10')](function(_0x4c4108){if(_0x4c4108){_0x316324['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4c4108[_0x3db2('0x54')]+','+(_0x316324['account'][_0x3db2('0x55')]||0xa),'interval':_0x3db2('0x4d')});}return respondWithRpcPromise(_0x3db2('0x56'),_0x3db2('0x57'),_0x316324);});}return respondWithRpcPromise('Start',_0x3db2('0x57'),_0x316324);})[_0x3db2('0x10')](function(_0x5cd897){_0x4abfc7(_0x5cd897);})[_0x3db2('0x1a')](function(_0x3e94dc){_0x4cab1e(_0x3155cf[_0x3db2('0x16')](0x1f4,_0x3e94dc['message']));});});};
\ No newline at end of file
index 0b7c170..5671136 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x231a=['./faxAccount.events','save','remove','update','emit','removeListener','register','length','faxAccount:'];(function(_0x4ace79,_0x3f948e){var _0x44f300=function(_0xfcd09d){while(--_0xfcd09d){_0x4ace79['push'](_0x4ace79['shift']());}};_0x44f300(++_0x3f948e);}(_0x231a,0xb4));var _0xa231=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x231a[_0x20a584];return _0x4b41a8;};'use strict';var FaxAccountEvents=require(_0xa231('0x0'));var events=[_0xa231('0x1'),_0xa231('0x2'),_0xa231('0x3')];function createListener(_0x3f0c61,_0x58b18e){return function(_0x308bf6){_0x58b18e[_0xa231('0x4')](_0x3f0c61,_0x308bf6);};}function removeListener(_0x30fac9,_0x5732c6){return function(){FaxAccountEvents[_0xa231('0x5')](_0x30fac9,_0x5732c6);};}exports[_0xa231('0x6')]=function(_0x5cd1c3){for(var _0x3d1af7=0x0,_0x5a470f=events[_0xa231('0x7')];_0x3d1af7<_0x5a470f;_0x3d1af7++){var _0x3949cb=events[_0x3d1af7];var _0x37f63c=createListener(_0xa231('0x8')+_0x3949cb,_0x5cd1c3);FaxAccountEvents['on'](_0x3949cb,_0x37f63c);}};
\ No newline at end of file
+var _0xe994=['removeListener','register','faxAccount:','save','update','emit'];(function(_0x44cb23,_0x3bdc98){var _0x4552df=function(_0x46d72d){while(--_0x46d72d){_0x44cb23['push'](_0x44cb23['shift']());}};_0x4552df(++_0x3bdc98);}(_0xe994,0x69));var _0x4e99=function(_0x108db1,_0x89896d){_0x108db1=_0x108db1-0x0;var _0x16848d=_0xe994[_0x108db1];return _0x16848d;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x4e99('0x0'),'remove',_0x4e99('0x1')];function createListener(_0x3ce5a3,_0x52d1eb){return function(_0x15e85a){_0x52d1eb[_0x4e99('0x2')](_0x3ce5a3,_0x15e85a);};}function removeListener(_0x1e05e7,_0x5b085d){return function(){FaxAccountEvents[_0x4e99('0x3')](_0x1e05e7,_0x5b085d);};}exports[_0x4e99('0x4')]=function(_0x2b1f8b){for(var _0x8ef61d=0x0,_0x52f509=events['length'];_0x8ef61d<_0x52f509;_0x8ef61d++){var _0x395aaf=events[_0x8ef61d];var _0x5eec6b=createListener(_0x4e99('0x5')+_0x395aaf,_0x2b1f8b);FaxAccountEvents['on'](_0x395aaf,_0x5eec6b);}};
\ No newline at end of file
index f0511f2..c44c0c7 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(_0x483c0a,_0xcc3bc1){var _0x312228=function(_0x7c6585){while(--_0x7c6585){_0x483c0a['push'](_0x483c0a['shift']());}};_0x312228(++_0xcc3bc1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x2dee2b,_0xfa3e3){var _0x5d51ed=function(_0x22050c){while(--_0x22050c){_0x2dee2b['push'](_0x2dee2b['shift']());}};_0x5d51ed(++_0xfa3e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 471f94e..e20ee95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc007=['STRING','*,*,*,*','sequelize','INTEGER','TEXT'];(function(_0xe616f4,_0x433679){var _0x259e56=function(_0x426364){while(--_0x426364){_0xe616f4['push'](_0xe616f4['shift']());}};_0x259e56(++_0x433679);}(_0xc007,0x183));var _0x7c00=function(_0x13a1ee,_0xb1f0bd){_0x13a1ee=_0x13a1ee-0x0;var _0x2544e1=_0xc007[_0x13a1ee];return _0x2544e1;};'use strict';var Sequelize=require(_0x7c00('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7c00('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7c00('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7c00('0x3')],'defaultValue':_0x7c00('0x4')}};
\ No newline at end of file
+var _0xd1b4=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x15542f,_0x3d79d6){var _0x3f2d03=function(_0x314be6){while(--_0x314be6){_0x15542f['push'](_0x15542f['shift']());}};_0x3f2d03(++_0x3d79d6);}(_0xd1b4,0x156));var _0x4d1b=function(_0x2e236e,_0x16a5ae){_0x2e236e=_0x2e236e-0x0;var _0x361d5b=_0xd1b4[_0x2e236e];return _0x361d5b;};'use strict';var Sequelize=require(_0x4d1b('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4d1b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4d1b('0x2')],'allowNull':![],'defaultValue':_0x4d1b('0x3')},'appdata':{'type':Sequelize[_0x4d1b('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4d1b('0x5')}};
\ No newline at end of file
index 1ed8eab..e237b00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f68=['body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','then','destroy','error','name','send','map','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','FaxApplication','includeAll','findAll','rows','show','params','find','catch'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0x3f68,0x1b2));var _0x83f6=function(_0x15a55d,_0x59b390){_0x15a55d=_0x15a55d-0x0;var _0x348fc9=_0x3f68[_0x15a55d];return _0x348fc9;};'use strict';var emlformat=require(_0x83f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x83f6('0x1'));var jsonpatch=require(_0x83f6('0x2'));var rp=require(_0x83f6('0x3'));var moment=require(_0x83f6('0x4'));var BPromise=require(_0x83f6('0x5'));var Mustache=require(_0x83f6('0x6'));var util=require(_0x83f6('0x7'));var path=require(_0x83f6('0x8'));var sox=require(_0x83f6('0x9'));var csv=require('to-csv');var ejs=require(_0x83f6('0xa'));var fs=require('fs');var fs_extra=require(_0x83f6('0xb'));var _=require('lodash');var squel=require(_0x83f6('0xc'));var crypto=require('crypto');var jsforce=require(_0x83f6('0xd'));var deskjs=require(_0x83f6('0xe'));var toCsv=require(_0x83f6('0xf'));var querystring=require(_0x83f6('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x83f6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x83f6('0x12'));var hardwareService=require(_0x83f6('0x13'));var logger=require(_0x83f6('0x14'))(_0x83f6('0x15'));var utils=require(_0x83f6('0x16'));var config=require(_0x83f6('0x17'));var licenseUtil=require(_0x83f6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x472371,_0x266759){_0x266759=_0x266759||0xcc;return function(_0x18a7db){if(_0x18a7db){return _0x472371[_0x83f6('0x19')](_0x266759);}return _0x472371[_0x83f6('0x1a')](_0x266759)[_0x83f6('0x1b')]();};}function respondWithResult(_0x456615,_0x272609){_0x272609=_0x272609||0xc8;return function(_0x382980){if(_0x382980){return _0x456615[_0x83f6('0x1a')](_0x272609)[_0x83f6('0x1c')](_0x382980);}};}function respondWithFilteredResult(_0x1e88cb,_0xd96953){return function(_0x268b16){if(_0x268b16){var _0x2529c9=typeof _0xd96953['offset']===_0x83f6('0x1d')&&typeof _0xd96953[_0x83f6('0x1e')]===_0x83f6('0x1d');var _0x388b0c=_0x268b16['count'];var _0x2fea39=_0x2529c9?0x0:_0xd96953[_0x83f6('0x1f')];var _0x50db54=_0x2529c9?_0x268b16[_0x83f6('0x20')]:_0xd96953[_0x83f6('0x1f')]+_0xd96953['limit'];var _0x335653;if(_0x50db54>=_0x388b0c){_0x50db54=_0x388b0c;_0x335653=0xc8;}else{_0x335653=0xce;}_0x1e88cb['status'](_0x335653);return _0x1e88cb[_0x83f6('0x21')](_0x83f6('0x22'),_0x2fea39+'-'+_0x50db54+'/'+_0x388b0c)[_0x83f6('0x1c')](_0x268b16);}return null;};}function patchUpdates(_0x36488a){return function(_0x329c96){try{jsonpatch['apply'](_0x329c96,_0x36488a,!![]);}catch(_0x3a998a){return BPromise[_0x83f6('0x23')](_0x3a998a);}return _0x329c96['save']();};}function saveUpdates(_0x42a63c,_0x275269){return function(_0x48d38f){if(_0x48d38f){return _0x48d38f['update'](_0x42a63c)[_0x83f6('0x24')](function(_0xa7b7ea){return _0xa7b7ea;});}return null;};}function removeEntity(_0x4870e3,_0x47e997){return function(_0x5aaa45){if(_0x5aaa45){return _0x5aaa45[_0x83f6('0x25')]()[_0x83f6('0x24')](function(){_0x4870e3[_0x83f6('0x1a')](0xcc)[_0x83f6('0x1b')]();});}};}function handleEntityNotFound(_0x27cb42,_0x3f5603){return function(_0x5cf8d3){if(!_0x5cf8d3){_0x27cb42['sendStatus'](0x194);}return _0x5cf8d3;};}function handleError(_0x1a58d4,_0x3d4bde){_0x3d4bde=_0x3d4bde||0x1f4;return function(_0x3b1a1e){logger[_0x83f6('0x26')](_0x3b1a1e['stack']);if(_0x3b1a1e[_0x83f6('0x27')]){delete _0x3b1a1e['name'];}_0x1a58d4['status'](_0x3d4bde)[_0x83f6('0x28')](_0x3b1a1e);};}exports['index']=function(_0x36dfdb,_0x489221){var _0x2f58d0={},_0x1251a7={},_0x4a3607={'count':0x0,'rows':[]};var _0x438003=_[_0x83f6('0x29')](db['FaxApplication']['rawAttributes'],function(_0x1c2890){return{'name':_0x1c2890[_0x83f6('0x2a')],'type':_0x1c2890['type'][_0x83f6('0x2b')]};});_0x1251a7[_0x83f6('0x2c')]=_[_0x83f6('0x29')](_0x438003,'name');_0x1251a7[_0x83f6('0x2d')]=_[_0x83f6('0x2e')](_0x36dfdb[_0x83f6('0x2d')]);_0x1251a7['filters']=_[_0x83f6('0x2f')](_0x1251a7['model'],_0x1251a7[_0x83f6('0x2d')]);_0x2f58d0[_0x83f6('0x30')]=_[_0x83f6('0x2f')](_0x1251a7['model'],qs[_0x83f6('0x31')](_0x36dfdb['query'][_0x83f6('0x31')]));_0x2f58d0[_0x83f6('0x30')]=_0x2f58d0[_0x83f6('0x30')][_0x83f6('0x32')]?_0x2f58d0[_0x83f6('0x30')]:_0x1251a7[_0x83f6('0x2c')];if(!_0x36dfdb[_0x83f6('0x2d')][_0x83f6('0x33')](_0x83f6('0x34'))){_0x2f58d0[_0x83f6('0x1e')]=qs[_0x83f6('0x1e')](_0x36dfdb[_0x83f6('0x2d')][_0x83f6('0x1e')]);_0x2f58d0[_0x83f6('0x1f')]=qs[_0x83f6('0x1f')](_0x36dfdb['query'][_0x83f6('0x1f')]);}_0x2f58d0[_0x83f6('0x35')]=qs[_0x83f6('0x36')](_0x36dfdb[_0x83f6('0x2d')][_0x83f6('0x36')]);_0x2f58d0['where']=qs['filters'](_[_0x83f6('0x37')](_0x36dfdb[_0x83f6('0x2d')],_0x1251a7[_0x83f6('0x38')]),_0x438003);if(_0x36dfdb['query'][_0x83f6('0x39')]){_0x2f58d0[_0x83f6('0x3a')]=_['merge'](_0x2f58d0[_0x83f6('0x3a')],{'$or':_['map'](_0x438003,function(_0x141533){if(_0x141533['type']!==_0x83f6('0x3b')){var _0x506bff={};_0x506bff[_0x141533[_0x83f6('0x27')]]={'$like':'%'+_0x36dfdb[_0x83f6('0x2d')][_0x83f6('0x39')]+'%'};return _0x506bff;}})});}_0x2f58d0=_[_0x83f6('0x3c')]({},_0x2f58d0,_0x36dfdb[_0x83f6('0x3d')]);var _0x298908={'where':_0x2f58d0[_0x83f6('0x3a')]};return db[_0x83f6('0x3e')][_0x83f6('0x20')](_0x298908)['then'](function(_0x56f0c8){_0x4a3607['count']=_0x56f0c8;if(_0x36dfdb[_0x83f6('0x2d')][_0x83f6('0x3f')]){_0x2f58d0['include']=[{'all':!![]}];}return db['FaxApplication'][_0x83f6('0x40')](_0x2f58d0);})[_0x83f6('0x24')](function(_0x6e9eee){_0x4a3607[_0x83f6('0x41')]=_0x6e9eee;return _0x4a3607;})[_0x83f6('0x24')](respondWithFilteredResult(_0x489221,_0x2f58d0))['catch'](handleError(_0x489221,null));};exports[_0x83f6('0x42')]=function(_0x28f18d,_0x2cd806){var _0x36c9bc={'raw':!![],'where':{'id':_0x28f18d[_0x83f6('0x43')]['id']}},_0xcde90f={};_0xcde90f[_0x83f6('0x2c')]=_['keys'](db[_0x83f6('0x3e')]['rawAttributes']);_0xcde90f[_0x83f6('0x2d')]=_[_0x83f6('0x2e')](_0x28f18d[_0x83f6('0x2d')]);_0xcde90f[_0x83f6('0x38')]=_[_0x83f6('0x2f')](_0xcde90f['model'],_0xcde90f['query']);_0x36c9bc[_0x83f6('0x30')]=_[_0x83f6('0x2f')](_0xcde90f[_0x83f6('0x2c')],qs[_0x83f6('0x31')](_0x28f18d[_0x83f6('0x2d')][_0x83f6('0x31')]));_0x36c9bc[_0x83f6('0x30')]=_0x36c9bc[_0x83f6('0x30')]['length']?_0x36c9bc[_0x83f6('0x30')]:_0xcde90f[_0x83f6('0x2c')];if(_0x28f18d['query'][_0x83f6('0x3f')]){_0x36c9bc['include']=[{'all':!![]}];}_0x36c9bc=_[_0x83f6('0x3c')]({},_0x36c9bc,_0x28f18d[_0x83f6('0x3d')]);return db[_0x83f6('0x3e')][_0x83f6('0x44')](_0x36c9bc)[_0x83f6('0x24')](handleEntityNotFound(_0x2cd806,null))[_0x83f6('0x24')](respondWithResult(_0x2cd806,null))[_0x83f6('0x45')](handleError(_0x2cd806,null));};exports['create']=function(_0x22a6c6,_0x31255d){return db[_0x83f6('0x3e')]['create'](_0x22a6c6[_0x83f6('0x46')],{})[_0x83f6('0x24')](respondWithResult(_0x31255d,0xc9))[_0x83f6('0x45')](handleError(_0x31255d,null));};exports[_0x83f6('0x47')]=function(_0xdc8d47,_0x3d2c29){if(_0xdc8d47[_0x83f6('0x46')]['id']){delete _0xdc8d47[_0x83f6('0x46')]['id'];}return db[_0x83f6('0x3e')][_0x83f6('0x44')]({'where':{'id':_0xdc8d47['params']['id']}})[_0x83f6('0x24')](handleEntityNotFound(_0x3d2c29,null))[_0x83f6('0x24')](saveUpdates(_0xdc8d47[_0x83f6('0x46')],null))['then'](respondWithResult(_0x3d2c29,null))[_0x83f6('0x45')](handleError(_0x3d2c29,null));};exports[_0x83f6('0x25')]=function(_0x5c8aa2,_0x52d701){return db[_0x83f6('0x3e')]['find']({'where':{'id':_0x5c8aa2['params']['id']}})[_0x83f6('0x24')](handleEntityNotFound(_0x52d701,null))[_0x83f6('0x24')](removeEntity(_0x52d701,null))[_0x83f6('0x45')](handleError(_0x52d701,null));};
\ No newline at end of file
+var _0x9e39=['FaxApplication','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','moment','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','name'];(function(_0x23a1f0,_0x36c8fd){var _0x2cf328=function(_0x4a0da0){while(--_0x4a0da0){_0x23a1f0['push'](_0x23a1f0['shift']());}};_0x2cf328(++_0x36c8fd);}(_0x9e39,0x138));var _0x99e3=function(_0x211e19,_0x4cb809){_0x211e19=_0x211e19-0x0;var _0x4e3f94=_0x9e39[_0x211e19];return _0x4e3f94;};'use strict';var emlformat=require(_0x99e3('0x0'));var rimraf=require(_0x99e3('0x1'));var zipdir=require(_0x99e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x99e3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x99e3('0x4'));var util=require('util');var path=require(_0x99e3('0x5'));var sox=require('sox');var csv=require(_0x99e3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99e3('0x7'));var _=require(_0x99e3('0x8'));var squel=require(_0x99e3('0x9'));var crypto=require('crypto');var jsforce=require(_0x99e3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x99e3('0x6'));var querystring=require(_0x99e3('0xb'));var Papa=require(_0x99e3('0xc'));var Redis=require(_0x99e3('0xd'));var authService=require(_0x99e3('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x99e3('0xf'));var hardwareService=require(_0x99e3('0x10'));var logger=require(_0x99e3('0x11'))(_0x99e3('0x12'));var utils=require(_0x99e3('0x13'));var config=require(_0x99e3('0x14'));var licenseUtil=require(_0x99e3('0x15'));var db=require(_0x99e3('0x16'))['db'];function respondWithStatusCode(_0x14f685,_0x39b703){_0x39b703=_0x39b703||0xcc;return function(_0x23bd8e){if(_0x23bd8e){return _0x14f685[_0x99e3('0x17')](_0x39b703);}return _0x14f685[_0x99e3('0x18')](_0x39b703)['end']();};}function respondWithResult(_0x4cb9a4,_0x1d41d1){_0x1d41d1=_0x1d41d1||0xc8;return function(_0x261974){if(_0x261974){return _0x4cb9a4[_0x99e3('0x18')](_0x1d41d1)['json'](_0x261974);}};}function respondWithFilteredResult(_0x4d56fa,_0x35152a){return function(_0x42e1b7){if(_0x42e1b7){var _0xe7c1bb=typeof _0x35152a[_0x99e3('0x19')]==='undefined'&&typeof _0x35152a[_0x99e3('0x1a')]==='undefined';var _0x7e292c=_0x42e1b7[_0x99e3('0x1b')];var _0x1ec377=_0xe7c1bb?0x0:_0x35152a[_0x99e3('0x19')];var _0x212506=_0xe7c1bb?_0x42e1b7[_0x99e3('0x1b')]:_0x35152a[_0x99e3('0x19')]+_0x35152a['limit'];var _0x36eb90;if(_0x212506>=_0x7e292c){_0x212506=_0x7e292c;_0x36eb90=0xc8;}else{_0x36eb90=0xce;}_0x4d56fa[_0x99e3('0x18')](_0x36eb90);return _0x4d56fa[_0x99e3('0x1c')](_0x99e3('0x1d'),_0x1ec377+'-'+_0x212506+'/'+_0x7e292c)['json'](_0x42e1b7);}return null;};}function patchUpdates(_0x49073d){return function(_0x4501a8){try{jsonpatch[_0x99e3('0x1e')](_0x4501a8,_0x49073d,!![]);}catch(_0x4c45be){return BPromise[_0x99e3('0x1f')](_0x4c45be);}return _0x4501a8['save']();};}function saveUpdates(_0x29ca03,_0x48c8b2){return function(_0x20202d){if(_0x20202d){return _0x20202d[_0x99e3('0x20')](_0x29ca03)[_0x99e3('0x21')](function(_0x257881){return _0x257881;});}return null;};}function removeEntity(_0x39a1d4,_0x452add){return function(_0xab101){if(_0xab101){return _0xab101[_0x99e3('0x22')]()[_0x99e3('0x21')](function(){_0x39a1d4[_0x99e3('0x18')](0xcc)[_0x99e3('0x23')]();});}};}function handleEntityNotFound(_0x5db27d,_0x441152){return function(_0x28f3e6){if(!_0x28f3e6){_0x5db27d[_0x99e3('0x17')](0x194);}return _0x28f3e6;};}function handleError(_0x5d954a,_0x4449e9){_0x4449e9=_0x4449e9||0x1f4;return function(_0x2c1d79){logger[_0x99e3('0x24')](_0x2c1d79['stack']);if(_0x2c1d79['name']){delete _0x2c1d79[_0x99e3('0x25')];}_0x5d954a[_0x99e3('0x18')](_0x4449e9)['send'](_0x2c1d79);};}exports['index']=function(_0x141b10,_0x316435){var _0x3fcfac={},_0x26f545={},_0x5763c5={'count':0x0,'rows':[]};var _0x323b2f=_['map'](db[_0x99e3('0x26')][_0x99e3('0x27')],function(_0x12d254){return{'name':_0x12d254['fieldName'],'type':_0x12d254[_0x99e3('0x28')][_0x99e3('0x29')]};});_0x26f545[_0x99e3('0x2a')]=_[_0x99e3('0x2b')](_0x323b2f,'name');_0x26f545[_0x99e3('0x2c')]=_['keys'](_0x141b10['query']);_0x26f545['filters']=_[_0x99e3('0x2d')](_0x26f545[_0x99e3('0x2a')],_0x26f545['query']);_0x3fcfac[_0x99e3('0x2e')]=_[_0x99e3('0x2d')](_0x26f545[_0x99e3('0x2a')],qs[_0x99e3('0x2f')](_0x141b10[_0x99e3('0x2c')]['fields']));_0x3fcfac[_0x99e3('0x2e')]=_0x3fcfac['attributes'][_0x99e3('0x30')]?_0x3fcfac['attributes']:_0x26f545[_0x99e3('0x2a')];if(!_0x141b10['query'][_0x99e3('0x31')](_0x99e3('0x32'))){_0x3fcfac[_0x99e3('0x1a')]=qs[_0x99e3('0x1a')](_0x141b10[_0x99e3('0x2c')][_0x99e3('0x1a')]);_0x3fcfac['offset']=qs[_0x99e3('0x19')](_0x141b10['query'][_0x99e3('0x19')]);}_0x3fcfac[_0x99e3('0x33')]=qs[_0x99e3('0x34')](_0x141b10[_0x99e3('0x2c')]['sort']);_0x3fcfac['where']=qs[_0x99e3('0x35')](_[_0x99e3('0x36')](_0x141b10[_0x99e3('0x2c')],_0x26f545[_0x99e3('0x35')]),_0x323b2f);if(_0x141b10[_0x99e3('0x2c')][_0x99e3('0x37')]){_0x3fcfac['where']=_[_0x99e3('0x38')](_0x3fcfac[_0x99e3('0x39')],{'$or':_['map'](_0x323b2f,function(_0xdeeaf8){if(_0xdeeaf8[_0x99e3('0x28')]!==_0x99e3('0x3a')){var _0x3df952={};_0x3df952[_0xdeeaf8[_0x99e3('0x25')]]={'$like':'%'+_0x141b10[_0x99e3('0x2c')][_0x99e3('0x37')]+'%'};return _0x3df952;}})});}_0x3fcfac=_[_0x99e3('0x38')]({},_0x3fcfac,_0x141b10[_0x99e3('0x3b')]);var _0x3c5ea2={'where':_0x3fcfac['where']};return db[_0x99e3('0x26')][_0x99e3('0x1b')](_0x3c5ea2)['then'](function(_0x42376e){_0x5763c5[_0x99e3('0x1b')]=_0x42376e;if(_0x141b10[_0x99e3('0x2c')][_0x99e3('0x3c')]){_0x3fcfac[_0x99e3('0x3d')]=[{'all':!![]}];}return db[_0x99e3('0x26')][_0x99e3('0x3e')](_0x3fcfac);})[_0x99e3('0x21')](function(_0x3dc0fc){_0x5763c5['rows']=_0x3dc0fc;return _0x5763c5;})[_0x99e3('0x21')](respondWithFilteredResult(_0x316435,_0x3fcfac))[_0x99e3('0x3f')](handleError(_0x316435,null));};exports[_0x99e3('0x40')]=function(_0x480839,_0x2cc4c8){var _0x48390d={'raw':!![],'where':{'id':_0x480839[_0x99e3('0x41')]['id']}},_0x13c7c0={};_0x13c7c0[_0x99e3('0x2a')]=_[_0x99e3('0x42')](db[_0x99e3('0x26')][_0x99e3('0x27')]);_0x13c7c0[_0x99e3('0x2c')]=_['keys'](_0x480839['query']);_0x13c7c0[_0x99e3('0x35')]=_[_0x99e3('0x2d')](_0x13c7c0['model'],_0x13c7c0[_0x99e3('0x2c')]);_0x48390d[_0x99e3('0x2e')]=_[_0x99e3('0x2d')](_0x13c7c0[_0x99e3('0x2a')],qs['fields'](_0x480839[_0x99e3('0x2c')]['fields']));_0x48390d['attributes']=_0x48390d['attributes']['length']?_0x48390d[_0x99e3('0x2e')]:_0x13c7c0[_0x99e3('0x2a')];if(_0x480839[_0x99e3('0x2c')][_0x99e3('0x3c')]){_0x48390d[_0x99e3('0x3d')]=[{'all':!![]}];}_0x48390d=_[_0x99e3('0x38')]({},_0x48390d,_0x480839[_0x99e3('0x3b')]);return db['FaxApplication'][_0x99e3('0x43')](_0x48390d)[_0x99e3('0x21')](handleEntityNotFound(_0x2cc4c8,null))[_0x99e3('0x21')](respondWithResult(_0x2cc4c8,null))['catch'](handleError(_0x2cc4c8,null));};exports[_0x99e3('0x44')]=function(_0x142a57,_0x205889){return db[_0x99e3('0x26')][_0x99e3('0x44')](_0x142a57['body'],{})[_0x99e3('0x21')](respondWithResult(_0x205889,0xc9))[_0x99e3('0x3f')](handleError(_0x205889,null));};exports[_0x99e3('0x20')]=function(_0x37fe67,_0x5abf64){if(_0x37fe67[_0x99e3('0x45')]['id']){delete _0x37fe67[_0x99e3('0x45')]['id'];}return db[_0x99e3('0x26')][_0x99e3('0x43')]({'where':{'id':_0x37fe67[_0x99e3('0x41')]['id']}})[_0x99e3('0x21')](handleEntityNotFound(_0x5abf64,null))[_0x99e3('0x21')](saveUpdates(_0x37fe67[_0x99e3('0x45')],null))[_0x99e3('0x21')](respondWithResult(_0x5abf64,null))[_0x99e3('0x3f')](handleError(_0x5abf64,null));};exports[_0x99e3('0x22')]=function(_0x24a188,_0x139929){return db['FaxApplication'][_0x99e3('0x43')]({'where':{'id':_0x24a188['params']['id']}})[_0x99e3('0x21')](handleEntityNotFound(_0x139929,null))['then'](removeEntity(_0x139929,null))[_0x99e3('0x3f')](handleError(_0x139929,null));};
\ No newline at end of file
index 4e70b4a..d2f443f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0b3=['../../config/environment','./faxApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x46bbf4,_0x24523b){var _0x19ce5d=function(_0x237ba4){while(--_0x237ba4){_0x46bbf4['push'](_0x46bbf4['shift']());}};_0x19ce5d(++_0x24523b);}(_0xd0b3,0xf0));var _0x3d0b=function(_0x980a08,_0x4e710a){_0x980a08=_0x980a08-0x0;var _0x49fcd2=_0xd0b3[_0x980a08];return _0x49fcd2;};'use strict';var _=require('lodash');var util=require(_0x3d0b('0x0'));var logger=require(_0x3d0b('0x1'))('api');var moment=require(_0x3d0b('0x2'));var BPromise=require(_0x3d0b('0x3'));var rp=require(_0x3d0b('0x4'));var fs=require('fs');var path=require(_0x3d0b('0x5'));var rimraf=require(_0x3d0b('0x6'));var config=require(_0x3d0b('0x7'));var attributes=require(_0x3d0b('0x8'));module[_0x3d0b('0x9')]=function(_0x4343b2,_0x252139){return _0x4343b2[_0x3d0b('0xa')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3d0b('0xb'),'collate':_0x3d0b('0xc')});};
\ No newline at end of file
+var _0x0929=['bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment'];(function(_0x5e5051,_0x1616a6){var _0x4551a7=function(_0x72cb79){while(--_0x72cb79){_0x5e5051['push'](_0x5e5051['shift']());}};_0x4551a7(++_0x1616a6);}(_0x0929,0x15d));var _0x9092=function(_0x19b00a,_0x1b0753){_0x19b00a=_0x19b00a-0x0;var _0x40eee6=_0x0929[_0x19b00a];return _0x40eee6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9092('0x0'))('api');var moment=require(_0x9092('0x1'));var BPromise=require(_0x9092('0x2'));var rp=require(_0x9092('0x3'));var fs=require('fs');var path=require(_0x9092('0x4'));var rimraf=require(_0x9092('0x5'));var config=require(_0x9092('0x6'));var attributes=require(_0x9092('0x7'));module[_0x9092('0x8')]=function(_0xcc269b,_0x2965ed){return _0xcc269b[_0x9092('0x9')](_0x9092('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9092('0xb'),'collate':_0x9092('0xc')});};
\ No newline at end of file
index 5ee4787..cc93912 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2016=['message','result','catch','UpdateFaxApplication','update','options','raw','where','attributes','limit','then','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x1e9e56,_0x34a74a){var _0x5d5e2e=function(_0x4bfcc2){while(--_0x4bfcc2){_0x1e9e56['push'](_0x1e9e56['shift']());}};_0x5d5e2e(++_0x34a74a);}(_0x2016,0xf5));var _0x6201=function(_0x5bda2e,_0x3b2d8e){_0x5bda2e=_0x5bda2e-0x0;var _0x547923=_0x2016[_0x5bda2e];return _0x547923;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6201('0x0'));var BPromise=require(_0x6201('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6201('0x2'));var db=require(_0x6201('0x3'))['db'];var utils=require(_0x6201('0x4'));var logger=require('../../config/logger')(_0x6201('0x5'));var config=require(_0x6201('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6201('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3af06e,_0x1d79c3,_0x227279){return new BPromise(function(_0x56583a,_0x3bd295){return client[_0x6201('0x8')](_0x3af06e,_0x227279)['then'](function(_0x403295){logger[_0x6201('0x9')](_0x6201('0xa'),_0x1d79c3,'request\x20sent');logger[_0x6201('0xb')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x1d79c3,_0x6201('0xc'),JSON[_0x6201('0xd')](_0x403295));if(_0x403295[_0x6201('0xe')]){if(_0x403295[_0x6201('0xe')]['code']===0x1f4){logger[_0x6201('0xe')](_0x6201('0xa'),_0x1d79c3,_0x403295['error']['message']);return _0x3bd295(_0x403295[_0x6201('0xe')]['message']);}logger[_0x6201('0xe')](_0x6201('0xa'),_0x1d79c3,_0x403295[_0x6201('0xe')][_0x6201('0xf')]);return _0x56583a(_0x403295[_0x6201('0xe')]['message']);}else{logger['info'](_0x6201('0xa'),_0x1d79c3,_0x6201('0xc'));_0x56583a(_0x403295[_0x6201('0x10')]['message']);}})[_0x6201('0x11')](function(_0x5b7fb3){logger['error'](_0x6201('0xa'),_0x1d79c3,_0x5b7fb3);_0x3bd295(_0x5b7fb3);});});}exports[_0x6201('0x12')]=function(_0x102c74){var _0x4d20be=this;return new Promise(function(_0xaa8642,_0x4e7c9a){return db['FaxApplication'][_0x6201('0x13')](_0x102c74['body'],{'raw':_0x102c74[_0x6201('0x14')]?_0x102c74[_0x6201('0x14')][_0x6201('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x102c74[_0x6201('0x14')]?_0x102c74[_0x6201('0x14')][_0x6201('0x16')]||null:null,'attributes':_0x102c74['options']?_0x102c74[_0x6201('0x14')][_0x6201('0x17')]||null:null,'limit':_0x102c74[_0x6201('0x14')]?_0x102c74[_0x6201('0x14')][_0x6201('0x18')]||null:null})[_0x6201('0x19')](function(_0x66084e){logger[_0x6201('0x9')](_0x6201('0x12'),_0x102c74);logger[_0x6201('0xb')](_0x6201('0x12'),_0x102c74,JSON['stringify'](_0x66084e));_0xaa8642(_0x66084e);})['catch'](function(_0x28d043){logger[_0x6201('0xe')](_0x6201('0x12'),_0x28d043[_0x6201('0xf')],_0x102c74);_0x4e7c9a(_0x4d20be[_0x6201('0xe')](0x1f4,_0x28d043[_0x6201('0xf')]));});});};
\ No newline at end of file
+var _0x4e6c=['UpdateFaxApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','FaxApplication','options','raw','where'];(function(_0x176994,_0x275369){var _0x3f7af0=function(_0x97731d){while(--_0x97731d){_0x176994['push'](_0x176994['shift']());}};_0x3f7af0(++_0x275369);}(_0x4e6c,0x8d));var _0xc4e6=function(_0x5907f6,_0x53b3e1){_0x5907f6=_0x5907f6-0x0;var _0x3654ee=_0x4e6c[_0x5907f6];return _0x3654ee;};'use strict';var _=require(_0xc4e6('0x0'));var util=require(_0xc4e6('0x1'));var moment=require(_0xc4e6('0x2'));var BPromise=require(_0xc4e6('0x3'));var rs=require(_0xc4e6('0x4'));var fs=require('fs');var Redis=require(_0xc4e6('0x5'));var db=require(_0xc4e6('0x6'))['db'];var utils=require(_0xc4e6('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc4e6('0x8'));var client=jayson[_0xc4e6('0x9')][_0xc4e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39b4ac,_0x490048,_0x5960df){return new BPromise(function(_0x311f74,_0x13e594){return client[_0xc4e6('0xb')](_0x39b4ac,_0x5960df)[_0xc4e6('0xc')](function(_0xf19a69){logger['info'](_0xc4e6('0xd'),_0x490048,_0xc4e6('0xe'));logger[_0xc4e6('0xf')](_0xc4e6('0x10'),_0x490048,_0xc4e6('0xe'),JSON[_0xc4e6('0x11')](_0xf19a69));if(_0xf19a69[_0xc4e6('0x12')]){if(_0xf19a69[_0xc4e6('0x12')][_0xc4e6('0x13')]===0x1f4){logger[_0xc4e6('0x12')](_0xc4e6('0xd'),_0x490048,_0xf19a69[_0xc4e6('0x12')]['message']);return _0x13e594(_0xf19a69['error']['message']);}logger[_0xc4e6('0x12')]('FaxApplication,\x20%s,\x20%s',_0x490048,_0xf19a69['error']['message']);return _0x311f74(_0xf19a69[_0xc4e6('0x12')][_0xc4e6('0x14')]);}else{logger[_0xc4e6('0x15')]('FaxApplication,\x20%s,\x20%s',_0x490048,_0xc4e6('0xe'));_0x311f74(_0xf19a69[_0xc4e6('0x16')]['message']);}})['catch'](function(_0x21fa05){logger[_0xc4e6('0x12')]('FaxApplication,\x20%s,\x20%s',_0x490048,_0x21fa05);_0x13e594(_0x21fa05);});});}exports['UpdateFaxApplication']=function(_0x56f155){var _0x18bf8e=this;return new Promise(function(_0x4be2de,_0x510539){return db[_0xc4e6('0x17')]['update'](_0x56f155['body'],{'raw':_0x56f155[_0xc4e6('0x18')]?_0x56f155[_0xc4e6('0x18')][_0xc4e6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56f155[_0xc4e6('0x18')]?_0x56f155['options'][_0xc4e6('0x1a')]||null:null,'attributes':_0x56f155[_0xc4e6('0x18')]?_0x56f155[_0xc4e6('0x18')]['attributes']||null:null,'limit':_0x56f155['options']?_0x56f155['options']['limit']||null:null})[_0xc4e6('0xc')](function(_0x306d14){logger[_0xc4e6('0x15')](_0xc4e6('0x1b'),_0x56f155);logger[_0xc4e6('0xf')](_0xc4e6('0x1b'),_0x56f155,JSON[_0xc4e6('0x11')](_0x306d14));_0x4be2de(_0x306d14);})['catch'](function(_0x5d0ea6){logger[_0xc4e6('0x12')](_0xc4e6('0x1b'),_0x5d0ea6[_0xc4e6('0x14')],_0x56f155);_0x510539(_0x18bf8e[_0xc4e6('0x12')](0x1f4,_0x5d0ea6[_0xc4e6('0x14')]));});});};
\ No newline at end of file
index 59e7880..e5c3ca0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x42c06b,_0x28cb52){var _0x3a84dd=function(_0x31aec4){while(--_0x31aec4){_0x42c06b['push'](_0x42c06b['shift']());}};_0x3a84dd(++_0x28cb52);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x1f7269,_0x460e49){_0x1f7269=_0x1f7269-0x0;var _0x32ee49=_0xf4f4[_0x1f7269];return _0x32ee49;};'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
+var _0x9354=['Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','util','path','express'];(function(_0x7ebfd8,_0x4bc07b){var _0x18aab4=function(_0x75f1f2){while(--_0x75f1f2){_0x7ebfd8['push'](_0x7ebfd8['shift']());}};_0x18aab4(++_0x4bc07b);}(_0x9354,0x96));var _0x4935=function(_0x1f5303,_0x354414){_0x1f5303=_0x1f5303-0x0;var _0x84ef1a=_0x9354[_0x1f5303];return _0x84ef1a;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['post']('/',auth[_0x4935('0x9')](),controller['create']);router[_0x4935('0xd')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xe')]);router[_0x4935('0xf')](_0x4935('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4935('0x10')]=router;
\ No newline at end of file
index cfa8854..fd9cc1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb214=['STRING','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x9fb13a,_0x17425f){var _0x3e7008=function(_0x1c1f0d){while(--_0x1c1f0d){_0x9fb13a['push'](_0x9fb13a['shift']());}};_0x3e7008(++_0x17425f);}(_0xb214,0xb0));var _0x4b21=function(_0x10d41d,_0x4a49ef){_0x10d41d=_0x10d41d-0x0;var _0x35011c=_0xb214[_0x10d41d];return _0x35011c;};'use strict';var Sequelize=require(_0x4b21('0x0'));module[_0x4b21('0x1')]={'closed':{'type':Sequelize[_0x4b21('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4b21('0x3')]},'disposition':{'type':Sequelize[_0x4b21('0x4')]},'secondDisposition':{'type':Sequelize[_0x4b21('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4b21('0x4')]},'read1stAt':{'type':Sequelize[_0x4b21('0x3')]},'fax':{'type':Sequelize[_0x4b21('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x4b21('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4b21('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x311e=['STRING','ENUM','out','exports','BOOLEAN','DATE'];(function(_0x391553,_0x27c949){var _0x11d65f=function(_0x544fa3){while(--_0x544fa3){_0x391553['push'](_0x391553['shift']());}};_0x11d65f(++_0x27c949);}(_0x311e,0x17d));var _0xe311=function(_0x3c947e,_0x22b6ee){_0x3c947e=_0x3c947e-0x0;var _0x2672a2=_0x311e[_0x3c947e];return _0x2672a2;};'use strict';var Sequelize=require('sequelize');module[_0xe311('0x0')]={'closed':{'type':Sequelize[_0xe311('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe311('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xe311('0x3')]},'thirdDisposition':{'type':Sequelize[_0xe311('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xe311('0x2')]},'fax':{'type':Sequelize[_0xe311('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xe311('0x4')]('in',_0xe311('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe311('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xe311('0x4')]('in',_0xe311('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index e4ea753..96a0964 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2e8=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','i.id','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','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','unreadMessages','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','FaxInteractionId','all','rows','show','params','includeAll','merge','create','body','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','nolimit','options','include','findAll','addTags','setTags','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','basename','createReadStream','log','err','unlinkSync','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','select','field','color','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User'];(function(_0x9bc85,_0x12b60b){var _0x4ba2ec=function(_0xc9afbd){while(--_0xc9afbd){_0x9bc85['push'](_0x9bc85['shift']());}};_0x4ba2ec(++_0x12b60b);}(_0xc2e8,0x66));var _0x8c2e=function(_0x311322,_0x5fd3ac){_0x311322=_0x311322-0x0;var _0xbb55e2=_0xc2e8[_0x311322];return _0xbb55e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c2e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c2e('0x1'));var rp=require(_0x8c2e('0x2'));var moment=require(_0x8c2e('0x3'));var BPromise=require(_0x8c2e('0x4'));var Mustache=require(_0x8c2e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8c2e('0x6'));var csv=require(_0x8c2e('0x7'));var ejs=require(_0x8c2e('0x8'));var fs=require('fs');var fs_extra=require(_0x8c2e('0x9'));var _=require(_0x8c2e('0xa'));var squel=require('squel');var crypto=require(_0x8c2e('0xb'));var jsforce=require(_0x8c2e('0xc'));var deskjs=require(_0x8c2e('0xd'));var toCsv=require(_0x8c2e('0x7'));var querystring=require(_0x8c2e('0xe'));var Papa=require(_0x8c2e('0xf'));var Redis=require(_0x8c2e('0x10'));var authService=require(_0x8c2e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8c2e('0x12'));var hardwareService=require(_0x8c2e('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8c2e('0x14'));var licenseUtil=require(_0x8c2e('0x15'));var db=require(_0x8c2e('0x16'))['db'];config[_0x8c2e('0x17')]=_[_0x8c2e('0x18')](config[_0x8c2e('0x17')],{'host':_0x8c2e('0x19'),'port':0x18eb});var socket=require(_0x8c2e('0x1a'))(new Redis(config[_0x8c2e('0x17')]));require(_0x8c2e('0x1b'))[_0x8c2e('0x1c')](socket);function respondWithStatusCode(_0x1c1c60,_0x46ec56){_0x46ec56=_0x46ec56||0xcc;return function(_0xb47411){if(_0xb47411){return _0x1c1c60[_0x8c2e('0x1d')](_0x46ec56);}return _0x1c1c60[_0x8c2e('0x1e')](_0x46ec56)[_0x8c2e('0x1f')]();};}function respondWithResult(_0x37cd83,_0x4b6848){_0x4b6848=_0x4b6848||0xc8;return function(_0x1b977a){if(_0x1b977a){return _0x37cd83['status'](_0x4b6848)[_0x8c2e('0x20')](_0x1b977a);}};}function respondWithFilteredResult(_0x4b4ead,_0x5f4277){return function(_0x4e9c0f){if(_0x4e9c0f){var _0x223442=typeof _0x5f4277[_0x8c2e('0x21')]===_0x8c2e('0x22')&&typeof _0x5f4277['limit']===_0x8c2e('0x22');var _0x45b833=_0x4e9c0f[_0x8c2e('0x23')];var _0x5d8d93=_0x223442?0x0:_0x5f4277[_0x8c2e('0x21')];var _0x3fb186=_0x223442?_0x4e9c0f['count']:_0x5f4277[_0x8c2e('0x21')]+_0x5f4277[_0x8c2e('0x24')];var _0x2d9a1f;if(_0x3fb186>=_0x45b833){_0x3fb186=_0x45b833;_0x2d9a1f=0xc8;}else{_0x2d9a1f=0xce;}_0x4b4ead[_0x8c2e('0x1e')](_0x2d9a1f);return _0x4b4ead[_0x8c2e('0x25')](_0x8c2e('0x26'),_0x5d8d93+'-'+_0x3fb186+'/'+_0x45b833)[_0x8c2e('0x20')](_0x4e9c0f);}return null;};}function patchUpdates(_0x500576){return function(_0x38cd40){try{jsonpatch[_0x8c2e('0x27')](_0x38cd40,_0x500576,!![]);}catch(_0x252713){return BPromise['reject'](_0x252713);}return _0x38cd40[_0x8c2e('0x28')]();};}function saveUpdates(_0x4cd424,_0x134212){return function(_0x40245f){if(_0x40245f){return _0x40245f[_0x8c2e('0x29')](_0x4cd424)[_0x8c2e('0x2a')](function(_0x5cc999){return _0x5cc999;});}return null;};}function removeEntity(_0x28c1fc,_0x3b22d5){return function(_0x2031d7){if(_0x2031d7){return _0x2031d7[_0x8c2e('0x2b')]()['then'](function(){_0x28c1fc[_0x8c2e('0x1e')](0xcc)[_0x8c2e('0x1f')]();});}};}function handleEntityNotFound(_0x27e487,_0xdc9cd4){return function(_0x311e2b){if(!_0x311e2b){_0x27e487['sendStatus'](0x194);}return _0x311e2b;};}function handleError(_0x1d1c35,_0x3cd602){_0x3cd602=_0x3cd602||0x1f4;return function(_0x392221){logger[_0x8c2e('0x2c')](_0x392221[_0x8c2e('0x2d')]);if(_0x392221['name']){delete _0x392221['name'];}_0x1d1c35['status'](_0x3cd602)[_0x8c2e('0x2e')](_0x392221);};}function getInteractionUsers(_0x38f0ce,_0x308a4a){return new BPromise(function(_0x433d6a,_0x15f80a){try{if(_0x308a4a[_0x38f0ce['id']]){_0x38f0ce[_0x8c2e('0x2f')]=_[_0x8c2e('0x30')](_0x308a4a[_0x38f0ce['id']],function(_0x522586){return{'id':_0x522586['id'],'fullname':_0x522586[_0x8c2e('0x31')]};});}}catch(_0x12c82f){_0x15f80a(_0x12c82f);}_0x433d6a(_0x38f0ce);});}function getInteractionTags(_0x4b30ed,_0x1187e3){return new BPromise(function(_0x2f07c4,_0x5be329){try{if(_0x4b30ed[_0x8c2e('0x32')]){_0x4b30ed[_0x8c2e('0x33')]=[];_0x4b30ed[_0x8c2e('0x32')][_0x8c2e('0x34')](',')[_0x8c2e('0x35')](function(_0x2fbaae){_0x4b30ed['Tags'][_0x8c2e('0x36')](_0x1187e3[_0x2fbaae]);});}delete _0x4b30ed[_0x8c2e('0x32')];}catch(_0x18fb8d){_0x5be329(_0x18fb8d);}_0x2f07c4(_0x4b30ed);});}function updateFaxInteraction(_0x2feaf0,_0x29540b,_0x388cfd){return new BPromise(function(_0x20b65c,_0x5369df){return getInteractionUsers(_0x2feaf0,_0x388cfd)[_0x8c2e('0x2a')](function(_0x46a03c){return getInteractionTags(_0x46a03c,_0x29540b);})[_0x8c2e('0x2a')](function(_0x1f1c73){_0x20b65c(_0x1f1c73);})[_0x8c2e('0x37')](function(_0x510e79){_0x5369df(_0x510e79);});});}exports[_0x8c2e('0x38')]=function(_0x5a2117,_0x4c44f8){var _0x2d31c0={},_0x508872={},_0x1967ef={'count':0x0,'rows':[]};var _0x28d651=_['map'](db[_0x8c2e('0x39')][_0x8c2e('0x3a')],function(_0x19fe01){return{'name':_0x19fe01[_0x8c2e('0x3b')],'type':_0x19fe01[_0x8c2e('0x3c')][_0x8c2e('0x3d')]};});_0x508872[_0x8c2e('0x3e')]=_[_0x8c2e('0x30')](_0x28d651,_0x8c2e('0x3f'));_0x508872[_0x8c2e('0x40')]=_[_0x8c2e('0x41')](_0x5a2117[_0x8c2e('0x40')]);_0x508872['filters']=_[_0x8c2e('0x42')](_0x508872[_0x8c2e('0x3e')],_0x508872['query']);_0x2d31c0['attributes']=_[_0x8c2e('0x42')](_0x508872['model'],qs[_0x8c2e('0x43')](_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x43')]));_0x2d31c0[_0x8c2e('0x44')]=_0x2d31c0[_0x8c2e('0x44')][_0x8c2e('0x45')]?_0x2d31c0[_0x8c2e('0x44')]:_0x508872[_0x8c2e('0x3e')];if(!_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x46')]('nolimit')){_0x2d31c0['limit']=qs['limit'](_0x5a2117['query'][_0x8c2e('0x24')]);_0x2d31c0[_0x8c2e('0x21')]=qs['offset'](_0x5a2117['query'][_0x8c2e('0x21')]);}_0x2d31c0[_0x8c2e('0x47')]=qs[_0x8c2e('0x48')](_0x5a2117[_0x8c2e('0x40')]['sort']);_0x2d31c0[_0x8c2e('0x49')]=qs['filters'](_[_0x8c2e('0x4a')](_0x5a2117[_0x8c2e('0x40')],_0x508872[_0x8c2e('0x4b')]),_0x28d651);var _0x304026=[];var _0x3d7a58=squel[_0x8c2e('0x4c')]()['field']('id')['field'](_0x8c2e('0x3f'))[_0x8c2e('0x4d')](_0x8c2e('0x4e'))[_0x8c2e('0x4f')](_0x8c2e('0x50'));var _0x1eb3c0=squel[_0x8c2e('0x4c')]()[_0x8c2e('0x4d')](_0x8c2e('0x51'))[_0x8c2e('0x4d')]('u.fullname')[_0x8c2e('0x4d')](_0x8c2e('0x52'))['from'](_0x8c2e('0x53'),'ui')[_0x8c2e('0x54')]('users','u',_0x8c2e('0x55'));var _0x4cea7b=squel[_0x8c2e('0x4c')]()[_0x8c2e('0x4f')](_0x8c2e('0x56'),'i')[_0x8c2e('0x54')](_0x8c2e('0x57'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x8c2e('0x54')](_0x8c2e('0x58'),'o',_0x8c2e('0x59'))[_0x8c2e('0x54')](_0x8c2e('0x5a'),'a',_0x8c2e('0x5b'))['left_join'](_0x8c2e('0x5c'),'me',_0x8c2e('0x5d'))[_0x8c2e('0x54')](_0x8c2e('0x5e'),'it','it.FaxInteractionId\x20=\x20i.id')['left_join'](_0x8c2e('0x50'),'t',_0x8c2e('0x5f'));var _0xb94370=squel[_0x8c2e('0x60')]();var _0x486784=[];var _0x57ebf9=squel['expr']();var _0xb4ae10;if(_0x5a2117['query']['search']){_0xb4ae10=as['parseSearch'](_0x5a2117[_0x8c2e('0x40')]['search']);var _0x704816=_0xb4ae10['sqlOperator'];for(var _0x4ae10a=0x0;_0x4ae10a<_0xb4ae10['conditions'][_0x8c2e('0x45')];_0x4ae10a++){var _0x57b4aa=_0xb4ae10['conditions'][_0x4ae10a];var _0x406ecd='i';var _0x668884=_[_0x8c2e('0x61')](_0x28d651,[_0x8c2e('0x3f'),_0x57b4aa[_0x8c2e('0x4d')]]);if(!_0x668884){switch(_0x57b4aa[_0x8c2e('0x4d')]){case'unreadMessages':if(_0x57b4aa[_0x8c2e('0x62')]==0x1){_0x4cea7b[_0x8c2e('0x63')]('`'+_0x57b4aa[_0x8c2e('0x4d')]+_0x8c2e('0x64'));}else{_0x4cea7b[_0x8c2e('0x63')]('`'+_0x57b4aa[_0x8c2e('0x4d')]+_0x8c2e('0x65'));}break;case _0x8c2e('0x66'):if(_0x57b4aa[_0x8c2e('0x67')]===_0x8c2e('0x68')){if(_0x57b4aa['value']['split']('\x20')['length']>0x1){_0xb94370[_0x704816](_0x8c2e('0x69'),qs[_0x8c2e('0x6a')](_0x57b4aa[_0x8c2e('0x62')]),null);}else{var _0x4ef6fb='%'+_0x57b4aa[_0x8c2e('0x62')]+'%';_0xb94370[_0x704816]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4ef6fb,_0x4ef6fb,_0x4ef6fb);}}else{_0x668884=_[_0x8c2e('0x61')](_0x28d651,[_0x8c2e('0x3f'),_0x8c2e('0x6b')]);_0x57b4aa[_0x8c2e('0x4d')]=_0x8c2e('0x6b');_0x5b2574=as[_0x8c2e('0x6c')](_0x406ecd,_0x668884[_0x8c2e('0x3c')],_0x57b4aa);_0xb94370[_0x704816](_0x5b2574[_0x8c2e('0x6d')],_0x5b2574[_0x8c2e('0x62')][_0x8c2e('0x6e')],_0x5b2574[_0x8c2e('0x62')]['end']);}break;case _0x8c2e('0x6f'):var _0x116ae2=_0x57b4aa[_0x8c2e('0x62')][_0x8c2e('0x34')](',')[_0x8c2e('0x30')](function(_0x548c5b){return Number(_0x548c5b);});_0x116ae2[_0x8c2e('0x35')](function(_0x3831ff){_0x57ebf9['or'](_0x8c2e('0x70'),'%,'+_0x3831ff+',%');});_0x486784=_[_0x8c2e('0x71')](_0x486784,_0x116ae2);break;case _0x8c2e('0x72'):if(_0x57b4aa['operator']===_0x8c2e('0x68')){_0xb94370[_0x704816](_0x8c2e('0x73'),'%'+_0x57b4aa[_0x8c2e('0x62')]+'%',null);}else{_0x668884=_[_0x8c2e('0x61')](_0x28d651,[_0x8c2e('0x3f'),_0x8c2e('0x74')]);_0x57b4aa[_0x8c2e('0x4d')]=_0x8c2e('0x74');_0x5b2574=as[_0x8c2e('0x6c')](_0x406ecd,_0x668884[_0x8c2e('0x3c')],_0x57b4aa);_0xb94370[_0x704816](_0x5b2574[_0x8c2e('0x6d')],_0x5b2574[_0x8c2e('0x62')][_0x8c2e('0x6e')],_0x5b2574[_0x8c2e('0x62')][_0x8c2e('0x1f')]);}break;case'body':_0x5b2574=as[_0x8c2e('0x6c')]('me',null,_0x57b4aa);_0xb94370[_0x704816](_0x5b2574['text'],_0x5b2574[_0x8c2e('0x62')][_0x8c2e('0x6e')],_0x5b2574[_0x8c2e('0x62')][_0x8c2e('0x1f')]);break;}}else{var _0x5b2574=as[_0x8c2e('0x6c')](_0x406ecd,_0x668884['type'],_0x57b4aa);_0xb94370[_0x704816](_0x5b2574[_0x8c2e('0x6d')],_0x5b2574[_0x8c2e('0x62')][_0x8c2e('0x6e')],_0x5b2574['value'][_0x8c2e('0x1f')]);}}}else{var _0x41aca9=_(_0x5a2117[_0x8c2e('0x40')])[_0x8c2e('0x41')]()[_0x8c2e('0x30')](function(_0x397540){return _[_0x8c2e('0x75')](_0x28d651,[_0x8c2e('0x3f'),_0x397540])?_0x397540:undefined;})[_0x8c2e('0x76')]()[_0x8c2e('0x62')]();if(!_[_0x8c2e('0x77')](_0x41aca9)){_0x41aca9[_0x8c2e('0x35')](function(_0x33695d){if(_0x33695d==='FaxAccountId'){_0x4cea7b[_0x8c2e('0x49')](_0x8c2e('0x78'),[][_0x8c2e('0x79')](_0x5a2117[_0x8c2e('0x40')][_0x33695d]));}else if(_0x33695d===_0x8c2e('0x7a')){var _0xf7bf29=JSON[_0x8c2e('0x7b')](_0x5a2117[_0x8c2e('0x40')][_0x33695d])[_0x8c2e('0x7c')];var _0x51ea34=JSON[_0x8c2e('0x7b')](_0x5a2117['query'][_0x33695d])[_0x8c2e('0x7d')];_0x4cea7b[_0x8c2e('0x49')](_0x8c2e('0x7e'),_0xf7bf29,_0x51ea34);}else{if(_0x5a2117[_0x8c2e('0x40')][_0x33695d]==='null'){_0x4cea7b[_0x8c2e('0x49')]('i.'+_0x33695d+_0x8c2e('0x7f'));}else{_0x4cea7b[_0x8c2e('0x49')]('i.'+_0x33695d+_0x8c2e('0x80'),_0x5a2117['query'][_0x33695d]);}}});}if(_0x5a2117['query'][_0x8c2e('0x81')]){if(_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x81')]==0x1){_0x4cea7b[_0x8c2e('0x63')]('`unreadMessages`\x20=\x200');}else{_0x4cea7b[_0x8c2e('0x63')](_0x8c2e('0x82'));}}if(_0x5a2117['query']['tag']){_0x486784=_['isArray'](_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x83')])?_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x83')]:new Array(_0x5a2117[_0x8c2e('0x40')]['tag']);_0x486784[_0x8c2e('0x35')](function(_0x14f6e4){_0x57ebf9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x14f6e4+',%');});}if(_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x84')]){var _0x3c559a=_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x84')][_0x8c2e('0x85')]('\x5c','\x5c\x5c')[_0x8c2e('0x85')](/'/g,'\x27\x27');if(qs[_0x8c2e('0x86')](_0x3c559a)){_0xb94370['or'](_0x8c2e('0x87'),_0x3c559a+'%')['or'](_0x8c2e('0x88'),_0x3c559a+'%');}_0xb94370['or'](_0x8c2e('0x89'),_0x3c559a+'%');}}_0x4cea7b[_0x8c2e('0x49')](_0xb94370);_0x4cea7b[_0x8c2e('0x8a')]('i.id');var _0x6df6c2={'type':db['Sequelize'][_0x8c2e('0x8b')][_0x8c2e('0x8c')],'raw':!![]};var _0x5a285c=_0x4cea7b[_0x8c2e('0x8d')]();_0x5a285c[_0x8c2e('0x4d')](_0x8c2e('0x8e'));_0x5a285c['field'](_0x8c2e('0x8f'),'unreadMessages');if(_0x2d31c0['order']){_0x2d31c0[_0x8c2e('0x47')][_0x8c2e('0x35')](function(_0x415d45){var _0x1342ad=_0x415d45[0x0]===_0x8c2e('0x90')?_0x415d45[0x0]:'i.'+_0x415d45[0x0];_0x4cea7b[_0x8c2e('0x47')](_0x1342ad,_0x415d45[0x1]===_0x8c2e('0x91')?![]:!![]);});}if(!_[_0x8c2e('0x77')](_0x486784)){_0x4cea7b[_0x8c2e('0x63')](_0x57ebf9);_0x5a285c[_0x8c2e('0x49')](_0x8c2e('0x92'),_0x486784);}BPromise[_0x8c2e('0x93')]()['then'](function(){if(!_0xb4ae10){if(_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x94')])return;_0x5a285c[_0x8c2e('0x49')](_0x8c2e('0x95'));_0x4cea7b[_0x8c2e('0x49')](_0x8c2e('0x95'));return;}if(_0x5a2117[_0x8c2e('0x96')]['role']!==_0x8c2e('0x97'))return;return _0x5a2117[_0x8c2e('0x96')][_0x8c2e('0x98')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38a458){if(_[_0x8c2e('0x77')](_0x38a458)){_0x5a285c['where'](_0x8c2e('0x99'));_0x4cea7b[_0x8c2e('0x49')](_0x8c2e('0x99'));}else{_0x5a285c[_0x8c2e('0x49')](_0x8c2e('0x78'),_[_0x8c2e('0x30')](_0x38a458,'id'));_0x4cea7b['where']('i.FaxAccountId\x20IN\x20?',_[_0x8c2e('0x30')](_0x38a458,'id'));}});})[_0x8c2e('0x2a')](function(){if(_0x5a2117['user'][_0x8c2e('0x9a')]===_0x8c2e('0x97')&&!_0xb4ae10&&!_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x94')])return[];return db[_0x8c2e('0x9b')][_0x8c2e('0x40')](_0x5a285c[_0x8c2e('0x9c')](),_0x6df6c2);})['then'](function(_0x432815){_0x1967ef['count']=_0x432815['length'];if(_0x1967ef[_0x8c2e('0x23')]===0x0)return[];return db[_0x8c2e('0x9b')]['query'](_0x3d7a58[_0x8c2e('0x9c')](),_0x6df6c2)[_0x8c2e('0x2a')](function(_0x1b6b74){_0x304026=_[_0x8c2e('0x9d')](_0x1b6b74,'id');_0x6df6c2=_['merge'](_0x6df6c2,{'model':db[_0x8c2e('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x43')]){_0x2d31c0[_0x8c2e('0x44')][_0x8c2e('0x35')](function(_0x25d0eb){_0x4cea7b[_0x8c2e('0x4d')]('i.'+_0x25d0eb);});}else{_0x4cea7b['field'](_0x8c2e('0x8f'),_0x8c2e('0x9e'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0x9f'),'Account.key');_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xa0'),_0x8c2e('0xa1'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xa2'),_0x8c2e('0x90'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xa3'));_0x4cea7b['field'](_0x8c2e('0xa4'),_0x8c2e('0xa5'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xa6'),_0x8c2e('0xa7'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xa8'),'Contact.email');_0x4cea7b[_0x8c2e('0x4d')]('c.phone',_0x8c2e('0xa9'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xaa'),_0x8c2e('0xab'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xac'),'Contact.fax');_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xad'),'Owner.fullname');_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xae'),_0x8c2e('0xaf'));_0x4cea7b['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8c2e('0x32'));}if(_0x2d31c0['limit'])_0x4cea7b[_0x8c2e('0x24')](_0x2d31c0[_0x8c2e('0x24')]);if(_0x2d31c0[_0x8c2e('0x21')])_0x4cea7b['offset'](_0x2d31c0['offset']);return db[_0x8c2e('0x9b')][_0x8c2e('0x40')](_0x4cea7b['toString'](),_0x6df6c2);})[_0x8c2e('0x2a')](function(_0x186d1d){if(_0x186d1d[_0x8c2e('0x45')]>0x0)_0x1eb3c0[_0x8c2e('0x49')]('ui.FaxInteractionId\x20IN\x20?',_[_0x8c2e('0x30')](_0x186d1d,'id'));return db[_0x8c2e('0x9b')][_0x8c2e('0x40')](_0x1eb3c0[_0x8c2e('0x9c')](),_0x6df6c2)[_0x8c2e('0x2a')](function(_0x4bfa03){var _0x486297=_['groupBy'](_0x4bfa03,_0x8c2e('0xb0'));var _0x1787a0=[];_0x186d1d[_0x8c2e('0x35')](function(_0x22a12e){_0x1787a0[_0x8c2e('0x36')](updateFaxInteraction(_0x22a12e,_0x304026,_0x486297));});return BPromise[_0x8c2e('0xb1')](_0x1787a0);});});})[_0x8c2e('0x2a')](function(_0x32cbd0){_0x1967ef[_0x8c2e('0xb2')]=_0x32cbd0;return _0x1967ef;})[_0x8c2e('0x2a')](respondWithFilteredResult(_0x4c44f8,_0x2d31c0))[_0x8c2e('0x37')](handleError(_0x4c44f8,null));};exports[_0x8c2e('0xb3')]=function(_0xb03438,_0x2fc6f0){var _0x34d71f={'raw':![],'where':{'id':_0xb03438[_0x8c2e('0xb4')]['id']}},_0x85b09b={};_0x85b09b['model']=_[_0x8c2e('0x41')](db[_0x8c2e('0x39')][_0x8c2e('0x3a')]);_0x85b09b[_0x8c2e('0x40')]=_[_0x8c2e('0x41')](_0xb03438[_0x8c2e('0x40')]);_0x85b09b[_0x8c2e('0x4b')]=_[_0x8c2e('0x42')](_0x85b09b[_0x8c2e('0x3e')],_0x85b09b[_0x8c2e('0x40')]);_0x34d71f[_0x8c2e('0x44')]=_[_0x8c2e('0x42')](_0x85b09b[_0x8c2e('0x3e')],qs[_0x8c2e('0x43')](_0xb03438['query'][_0x8c2e('0x43')]));_0x34d71f[_0x8c2e('0x44')]=_0x34d71f[_0x8c2e('0x44')]['length']?_0x34d71f[_0x8c2e('0x44')]:_0x85b09b[_0x8c2e('0x3e')];if(_0xb03438[_0x8c2e('0x40')][_0x8c2e('0xb5')]){_0x34d71f['include']=[{'all':!![]}];}_0x34d71f=_[_0x8c2e('0xb6')]({},_0x34d71f,_0xb03438['options']);return db[_0x8c2e('0x39')][_0x8c2e('0x61')](_0x34d71f)[_0x8c2e('0x2a')](handleEntityNotFound(_0x2fc6f0,null))[_0x8c2e('0x2a')](respondWithResult(_0x2fc6f0,null))['catch'](handleError(_0x2fc6f0,null));};exports['create']=function(_0x520e7d,_0x5a3eb3){return db['FaxInteraction'][_0x8c2e('0xb7')](_0x520e7d[_0x8c2e('0xb8')],{})[_0x8c2e('0x2a')](respondWithResult(_0x5a3eb3,0xc9))[_0x8c2e('0x37')](handleError(_0x5a3eb3,null));};exports[_0x8c2e('0x29')]=function(_0x230be9,_0x208bb6){if(_0x230be9[_0x8c2e('0xb8')]['id']){delete _0x230be9['body']['id'];}return db['FaxInteraction'][_0x8c2e('0x61')]({'where':{'id':_0x230be9[_0x8c2e('0xb4')]['id']}})[_0x8c2e('0x2a')](handleEntityNotFound(_0x208bb6,null))[_0x8c2e('0x2a')](saveUpdates(_0x230be9['body'],null))[_0x8c2e('0x2a')](respondWithResult(_0x208bb6,null))['catch'](handleError(_0x208bb6,null));};exports['destroy']=function(_0x486d0f,_0x47d24b){return db[_0x8c2e('0x39')][_0x8c2e('0x61')]({'where':{'id':_0x486d0f['params']['id']}})['then'](handleEntityNotFound(_0x47d24b,null))[_0x8c2e('0x2a')](removeEntity(_0x47d24b,null))[_0x8c2e('0x37')](handleError(_0x47d24b,null));};exports[_0x8c2e('0xb9')]=function(_0x394809,_0x4d6b79){return db[_0x8c2e('0x39')][_0x8c2e('0xb9')]()['then'](respondWithResult(_0x4d6b79,null))[_0x8c2e('0x37')](handleError(_0x4d6b79,null));};exports[_0x8c2e('0xba')]=function(_0x23756f,_0x568012,_0x543443){return db['FaxMessage'][_0x8c2e('0x61')]({'where':{'id':_0x23756f[_0x8c2e('0xb4')]['id']}})[_0x8c2e('0x2a')](handleEntityNotFound(_0x568012,null))[_0x8c2e('0x2a')](function(_0x2add04){if(_0x2add04){return _0x2add04['addMessage'](_0x23756f[_0x8c2e('0xb8')][_0x8c2e('0xbb')],_[_0x8c2e('0xbc')](_0x23756f[_0x8c2e('0xb8')],[_0x8c2e('0xbb'),'id'])||{});}})[_0x8c2e('0x2a')](respondWithResult(_0x568012,null))[_0x8c2e('0x37')](handleError(_0x568012,null));};exports[_0x8c2e('0xbd')]=function(_0x3cfefa,_0x264552,_0x4e5760){var _0x1ed43c={'raw':![],'where':{}};var _0x52383c={};var _0x2bed00={'count':0x0,'rows':[]};return db[_0x8c2e('0x39')][_0x8c2e('0xbe')]({'where':{'id':_0x3cfefa[_0x8c2e('0xb4')]['id']}})['then'](handleEntityNotFound(_0x264552,null))['then'](function(_0x20ff1e){if(_0x20ff1e){_0x52383c[_0x8c2e('0x3e')]=_[_0x8c2e('0x41')](db[_0x8c2e('0xbf')][_0x8c2e('0x3a')]);_0x52383c['query']=_[_0x8c2e('0x41')](_0x3cfefa[_0x8c2e('0x40')]);_0x52383c[_0x8c2e('0x4b')]=_[_0x8c2e('0x42')](_0x52383c['model'],_0x52383c[_0x8c2e('0x40')]);_0x1ed43c['attributes']=_[_0x8c2e('0x42')](_0x52383c[_0x8c2e('0x3e')],qs[_0x8c2e('0x43')](_0x3cfefa[_0x8c2e('0x40')][_0x8c2e('0x43')]));_0x1ed43c[_0x8c2e('0x44')]=_0x1ed43c[_0x8c2e('0x44')][_0x8c2e('0x45')]?_0x1ed43c[_0x8c2e('0x44')]:_0x52383c[_0x8c2e('0x3e')];if(!_0x3cfefa['query']['hasOwnProperty'](_0x8c2e('0xc0'))){_0x1ed43c[_0x8c2e('0x24')]=qs[_0x8c2e('0x24')](_0x3cfefa['query'][_0x8c2e('0x24')]);_0x1ed43c['offset']=qs[_0x8c2e('0x21')](_0x3cfefa['query']['offset']);}_0x1ed43c['order']=qs[_0x8c2e('0x48')](_0x3cfefa[_0x8c2e('0x40')][_0x8c2e('0x48')]);_0x1ed43c[_0x8c2e('0x49')]=qs[_0x8c2e('0x4b')](_['pick'](_0x3cfefa[_0x8c2e('0x40')],_0x52383c[_0x8c2e('0x4b')]));_0x1ed43c['where'][_0x8c2e('0xb0')]=_0x20ff1e['id'];if(_0x3cfefa['query'][_0x8c2e('0x84')]){_0x1ed43c[_0x8c2e('0x49')]=_[_0x8c2e('0xb6')](_0x1ed43c[_0x8c2e('0x49')],{'$or':_[_0x8c2e('0x30')](_0x1ed43c[_0x8c2e('0x44')],function(_0x39679a){var _0x40fed4={};_0x40fed4[_0x39679a]={'$like':'%'+_0x3cfefa[_0x8c2e('0x40')]['filter']+'%'};return _0x40fed4;})});}if(_0x3cfefa[_0x8c2e('0x40')][_0x8c2e('0x7c')]){var _0x184a60=_0x3cfefa[_0x8c2e('0x40')][_0x8c2e('0x7c')][_0x8c2e('0x34')](',');var _0x4dedd2={};_0x4dedd2[_0x184a60[0x0]]={'$gte':moment(_0x184a60[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1ed43c['where']=_[_0x8c2e('0xb6')](_0x1ed43c[_0x8c2e('0x49')],_0x4dedd2);}_0x1ed43c=_[_0x8c2e('0xb6')]({},_0x1ed43c,_0x3cfefa[_0x8c2e('0xc1')]);return db[_0x8c2e('0xbf')][_0x8c2e('0x23')]({'where':_0x1ed43c[_0x8c2e('0x49')]})[_0x8c2e('0x2a')](function(_0x345b68){_0x2bed00[_0x8c2e('0x23')]=_0x345b68;if(_0x3cfefa['query'][_0x8c2e('0xb5')]){_0x1ed43c[_0x8c2e('0xc2')]=[{'all':!![]}];}return db[_0x8c2e('0xbf')][_0x8c2e('0xc3')](_0x1ed43c);})[_0x8c2e('0x2a')](function(_0x551470){_0x2bed00[_0x8c2e('0xb2')]=_0x551470;return _0x2bed00;});}})[_0x8c2e('0x2a')](respondWithFilteredResult(_0x264552,_0x1ed43c))[_0x8c2e('0x37')](handleError(_0x264552,null));};exports[_0x8c2e('0xc4')]=function(_0x573ec8,_0x305262,_0x344b1d){return db[_0x8c2e('0x39')][_0x8c2e('0x61')]({'where':{'id':_0x573ec8['params']['id']}})[_0x8c2e('0x2a')](handleEntityNotFound(_0x305262,null))['then'](function(_0x1b5427){if(_0x1b5427){return _0x1b5427[_0x8c2e('0xc5')](_0x573ec8[_0x8c2e('0xb8')][_0x8c2e('0xbb')],_[_0x8c2e('0xbc')](_0x573ec8[_0x8c2e('0xb8')],[_0x8c2e('0xbb'),'id'])||{})['spread'](function(){return db[_0x8c2e('0x6f')]['findAll']({'attributes':['id','name',_0x8c2e('0x4e')],'where':{'id':_0x573ec8[_0x8c2e('0xb8')]['ids']}});})[_0x8c2e('0x2a')](function(_0x3b7e8f){socket[_0x8c2e('0xc6')]('faxInteractionTags:save',{'id':Number(_0x573ec8['params']['id']),'tags':_0x3b7e8f||[]});return{'id':Number(_0x573ec8[_0x8c2e('0xb4')]['id']),'tags':_0x3b7e8f||[]};});}})[_0x8c2e('0x2a')](respondWithResult(_0x305262,null))[_0x8c2e('0x37')](handleError(_0x305262,null));};exports[_0x8c2e('0xc7')]=function(_0x19b355,_0x45359a,_0x31b8e1){return db[_0x8c2e('0x39')][_0x8c2e('0x61')]({'where':{'id':_0x19b355[_0x8c2e('0xb4')]['id']}})[_0x8c2e('0x2a')](handleEntityNotFound(_0x45359a,null))['then'](function(_0x159b09){if(_0x159b09){return _0x159b09[_0x8c2e('0xc7')](_0x19b355[_0x8c2e('0x40')]['ids']);}})[_0x8c2e('0x2a')](respondWithStatusCode(_0x45359a,null))[_0x8c2e('0x37')](handleError(_0x45359a,null));};exports[_0x8c2e('0xc8')]=function(_0x48f98f,_0x2f728a){var _0x514cea=moment()[_0x8c2e('0xc9')]()[_0x8c2e('0x9c')]();var _0x13ee72=path[_0x8c2e('0xca')](config[_0x8c2e('0xcb')],_0x8c2e('0xcc'),_0x8c2e('0xcd'),_0x8c2e('0xce'));var _0x59f042=path[_0x8c2e('0xca')](config['root'],_0x8c2e('0xcc'),_0x8c2e('0xcd'),_0x8c2e('0xcf'));var _0x281337=path['join'](_0x13ee72,_0x514cea);var _0x1b060d=util['format'](_0x8c2e('0xd0'),_0x48f98f[_0x8c2e('0xb4')]['id'],_0x514cea);var _0x165016=path[_0x8c2e('0xca')](_0x13ee72,_0x1b060d);var _0x4be5cc=[];_0x4be5cc[_0x8c2e('0x36')]({'model':db[_0x8c2e('0xd1')],'as':_0x8c2e('0xd1'),'raw':!![]});var _0x151e53=[{'model':db[_0x8c2e('0xbf')],'as':_0x8c2e('0xd2'),'attributes':['id',_0x8c2e('0xb8'),_0x8c2e('0x7a')],'include':_0x4be5cc}];return db[_0x8c2e('0x39')][_0x8c2e('0x61')]({'where':{'id':_0x48f98f[_0x8c2e('0xb4')]['id']},'include':_0x151e53})[_0x8c2e('0x2a')](handleEntityNotFound(_0x2f728a,null))['then'](function(_0x259215){if(_0x259215&&_0x259215['Messages']){var _0x15040a=_0x259215[_0x8c2e('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x281337);for(var _0x5e7c2c=0x0;_0x5e7c2c<_0x15040a[_0x8c2e('0xd2')]['length'];_0x5e7c2c++){var _0x44a236=_0x15040a[_0x8c2e('0xd2')][_0x5e7c2c][_0x8c2e('0xd1')];if(_0x44a236){var _0x30e300=path['join'](_0x59f042,_0x44a236[_0x8c2e('0xd4')]);if(fs['existsSync'](_0x30e300)){fs[_0x8c2e('0xd5')](_0x30e300)['pipe'](fs['createWriteStream'](path['join'](_0x281337,_0x44a236[_0x8c2e('0xd4')])));}}}return BPromise[_0x8c2e('0x93')]()['then'](function(){return new BPromise(function(_0x4f220,_0x39a9f9){zipdir(_0x281337,{'saveTo':_0x165016},function(_0x137dca,_0x2d0803){if(_0x137dca)return _0x39a9f9(_0x137dca);return _0x4f220(_0x2d0803);});})[_0x8c2e('0x2a')](function(){return new BPromise(function(_0x153f3f,_0x5e7a6e){rimraf(_0x281337,function(_0x50af1f){if(_0x50af1f)_0x5e7a6e(_0x50af1f);return _0x153f3f();});});})[_0x8c2e('0x2a')](function(){return _0x2f728a['download'](_0x165016,_0x1b060d,function(_0x391d3d){if(_0x391d3d){console[_0x8c2e('0xd6')](_0x8c2e('0xd7'),_0x391d3d);}else{fs[_0x8c2e('0xd8')](_0x165016);}});});});}else{return _0x2f728a['sendStatus'](0xc8);}})[_0x8c2e('0x37')](handleError(_0x2f728a,null));};
\ No newline at end of file
+var _0xc697=['addMessage','omit','ids','findOne','FaxMessage','hasOwnProperty','pick','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','addTags','setTags','color','emit','faxInteractionTags:save','removeTags','download','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./faxInteraction.socket','sendStatus','status','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','end','error','name','send','Users','map','fullname','Tags','TagIds','forEach','catch','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','select','field','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','having','`\x20=\x200','`\x20>\x200','operator','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','UserId','buildExpression','body','compact','isEmpty','FaxAccountId','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\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?','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','agent','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','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.internal','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','push','all','show','params','keys','FaxInteraction','includeAll','merge','options','create','describe'];(function(_0xc585c7,_0x4218a3){var _0x4e21f0=function(_0x3b7fdd){while(--_0x3b7fdd){_0xc585c7['push'](_0xc585c7['shift']());}};_0x4e21f0(++_0x4218a3);}(_0xc697,0xf7));var _0x7c69=function(_0x14015e,_0x1a4688){_0x14015e=_0x14015e-0x0;var _0x543b37=_0xc697[_0x14015e];return _0x543b37;};'use strict';var emlformat=require(_0x7c69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7c69('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c69('0x2'));var moment=require(_0x7c69('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7c69('0x4'));var util=require('util');var path=require(_0x7c69('0x5'));var sox=require(_0x7c69('0x6'));var csv=require(_0x7c69('0x7'));var ejs=require(_0x7c69('0x8'));var fs=require('fs');var fs_extra=require(_0x7c69('0x9'));var _=require(_0x7c69('0xa'));var squel=require(_0x7c69('0xb'));var crypto=require('crypto');var jsforce=require(_0x7c69('0xc'));var deskjs=require(_0x7c69('0xd'));var toCsv=require(_0x7c69('0x7'));var querystring=require(_0x7c69('0xe'));var Papa=require('papaparse');var Redis=require(_0x7c69('0xf'));var authService=require(_0x7c69('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7c69('0x11'));var hardwareService=require(_0x7c69('0x12'));var logger=require(_0x7c69('0x13'))(_0x7c69('0x14'));var utils=require(_0x7c69('0x15'));var config=require(_0x7c69('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c69('0x17'))['db'];config[_0x7c69('0x18')]=_['defaults'](config[_0x7c69('0x18')],{'host':_0x7c69('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c69('0x18')]));require(_0x7c69('0x1a'))['register'](socket);function respondWithStatusCode(_0x3cef74,_0xcad5c0){_0xcad5c0=_0xcad5c0||0xcc;return function(_0x67168){if(_0x67168){return _0x3cef74[_0x7c69('0x1b')](_0xcad5c0);}return _0x3cef74[_0x7c69('0x1c')](_0xcad5c0)['end']();};}function respondWithResult(_0x190600,_0x797a3){_0x797a3=_0x797a3||0xc8;return function(_0x1ac147){if(_0x1ac147){return _0x190600['status'](_0x797a3)['json'](_0x1ac147);}};}function respondWithFilteredResult(_0x4e24f1,_0x4f2670){return function(_0x5afb8f){if(_0x5afb8f){var _0x229503=typeof _0x4f2670['offset']===_0x7c69('0x1d')&&typeof _0x4f2670['limit']===_0x7c69('0x1d');var _0x2efa0a=_0x5afb8f[_0x7c69('0x1e')];var _0x17ef74=_0x229503?0x0:_0x4f2670[_0x7c69('0x1f')];var _0x5bf6b4=_0x229503?_0x5afb8f[_0x7c69('0x1e')]:_0x4f2670[_0x7c69('0x1f')]+_0x4f2670[_0x7c69('0x20')];var _0x17e7a4;if(_0x5bf6b4>=_0x2efa0a){_0x5bf6b4=_0x2efa0a;_0x17e7a4=0xc8;}else{_0x17e7a4=0xce;}_0x4e24f1['status'](_0x17e7a4);return _0x4e24f1[_0x7c69('0x21')]('Content-Range',_0x17ef74+'-'+_0x5bf6b4+'/'+_0x2efa0a)[_0x7c69('0x22')](_0x5afb8f);}return null;};}function patchUpdates(_0x320013){return function(_0x545b69){try{jsonpatch[_0x7c69('0x23')](_0x545b69,_0x320013,!![]);}catch(_0x3ecad6){return BPromise[_0x7c69('0x24')](_0x3ecad6);}return _0x545b69[_0x7c69('0x25')]();};}function saveUpdates(_0x57c35d,_0x37a0dc){return function(_0x446be9){if(_0x446be9){return _0x446be9[_0x7c69('0x26')](_0x57c35d)[_0x7c69('0x27')](function(_0x334c6b){return _0x334c6b;});}return null;};}function removeEntity(_0x267471,_0x39bf26){return function(_0x38d980){if(_0x38d980){return _0x38d980[_0x7c69('0x28')]()['then'](function(){_0x267471[_0x7c69('0x1c')](0xcc)[_0x7c69('0x29')]();});}};}function handleEntityNotFound(_0x5ce96b,_0x3d886d){return function(_0x57ff2b){if(!_0x57ff2b){_0x5ce96b[_0x7c69('0x1b')](0x194);}return _0x57ff2b;};}function handleError(_0x1d793b,_0x5d8cca){_0x5d8cca=_0x5d8cca||0x1f4;return function(_0x89c083){logger[_0x7c69('0x2a')](_0x89c083['stack']);if(_0x89c083[_0x7c69('0x2b')]){delete _0x89c083[_0x7c69('0x2b')];}_0x1d793b[_0x7c69('0x1c')](_0x5d8cca)[_0x7c69('0x2c')](_0x89c083);};}function getInteractionUsers(_0x3af360,_0x75cea0){return new BPromise(function(_0x475af7,_0xee727b){try{if(_0x75cea0[_0x3af360['id']]){_0x3af360[_0x7c69('0x2d')]=_[_0x7c69('0x2e')](_0x75cea0[_0x3af360['id']],function(_0x48e092){return{'id':_0x48e092['id'],'fullname':_0x48e092[_0x7c69('0x2f')]};});}}catch(_0x1a29d1){_0xee727b(_0x1a29d1);}_0x475af7(_0x3af360);});}function getInteractionTags(_0x595501,_0x204c42){return new BPromise(function(_0x3e3b2a,_0x334805){try{if(_0x595501['TagIds']){_0x595501[_0x7c69('0x30')]=[];_0x595501[_0x7c69('0x31')]['split'](',')[_0x7c69('0x32')](function(_0x54f7d0){_0x595501[_0x7c69('0x30')]['push'](_0x204c42[_0x54f7d0]);});}delete _0x595501[_0x7c69('0x31')];}catch(_0x5479d2){_0x334805(_0x5479d2);}_0x3e3b2a(_0x595501);});}function updateFaxInteraction(_0x1858ee,_0x3eb5ad,_0x351f5d){return new BPromise(function(_0x383c9e,_0x4f48bf){return getInteractionUsers(_0x1858ee,_0x351f5d)['then'](function(_0x494fc9){return getInteractionTags(_0x494fc9,_0x3eb5ad);})['then'](function(_0x587d34){_0x383c9e(_0x587d34);})[_0x7c69('0x33')](function(_0x35df2c){_0x4f48bf(_0x35df2c);});});}exports['index']=function(_0x1e806f,_0x431e2){var _0x187a8c={},_0x15ef1e={},_0x8b3e2f={'count':0x0,'rows':[]};var _0x51346f=_[_0x7c69('0x2e')](db['FaxInteraction'][_0x7c69('0x34')],function(_0x48e4a5){return{'name':_0x48e4a5['fieldName'],'type':_0x48e4a5[_0x7c69('0x35')][_0x7c69('0x36')]};});_0x15ef1e[_0x7c69('0x37')]=_[_0x7c69('0x2e')](_0x51346f,_0x7c69('0x2b'));_0x15ef1e[_0x7c69('0x38')]=_['keys'](_0x1e806f['query']);_0x15ef1e[_0x7c69('0x39')]=_[_0x7c69('0x3a')](_0x15ef1e[_0x7c69('0x37')],_0x15ef1e['query']);_0x187a8c[_0x7c69('0x3b')]=_['intersection'](_0x15ef1e[_0x7c69('0x37')],qs['fields'](_0x1e806f[_0x7c69('0x38')][_0x7c69('0x3c')]));_0x187a8c[_0x7c69('0x3b')]=_0x187a8c[_0x7c69('0x3b')][_0x7c69('0x3d')]?_0x187a8c[_0x7c69('0x3b')]:_0x15ef1e[_0x7c69('0x37')];if(!_0x1e806f[_0x7c69('0x38')]['hasOwnProperty']('nolimit')){_0x187a8c[_0x7c69('0x20')]=qs[_0x7c69('0x20')](_0x1e806f[_0x7c69('0x38')][_0x7c69('0x20')]);_0x187a8c[_0x7c69('0x1f')]=qs['offset'](_0x1e806f[_0x7c69('0x38')]['offset']);}_0x187a8c[_0x7c69('0x3e')]=qs[_0x7c69('0x3f')](_0x1e806f['query'][_0x7c69('0x3f')]);_0x187a8c[_0x7c69('0x40')]=qs[_0x7c69('0x39')](_['pick'](_0x1e806f[_0x7c69('0x38')],_0x15ef1e['filters']),_0x51346f);var _0x51658c=[];var _0x52e4d1=squel[_0x7c69('0x41')]()[_0x7c69('0x42')]('id')['field'](_0x7c69('0x2b'))[_0x7c69('0x42')]('color')[_0x7c69('0x43')](_0x7c69('0x44'));var _0x1b6890=squel[_0x7c69('0x41')]()[_0x7c69('0x42')](_0x7c69('0x45'))[_0x7c69('0x42')]('u.fullname')[_0x7c69('0x42')](_0x7c69('0x46'))[_0x7c69('0x43')](_0x7c69('0x47'),'ui')[_0x7c69('0x48')](_0x7c69('0x49'),'u','u.id\x20=\x20ui.UserId');var _0x2b1ac1=squel[_0x7c69('0x41')]()[_0x7c69('0x43')](_0x7c69('0x4a'),'i')[_0x7c69('0x48')](_0x7c69('0x4b'),'c',_0x7c69('0x4c'))[_0x7c69('0x48')]('users','o',_0x7c69('0x4d'))[_0x7c69('0x48')](_0x7c69('0x4e'),'a',_0x7c69('0x4f'))[_0x7c69('0x48')](_0x7c69('0x50'),'me',_0x7c69('0x51'))[_0x7c69('0x48')]('fax_interaction_has_tags','it',_0x7c69('0x52'))[_0x7c69('0x48')](_0x7c69('0x44'),'t',_0x7c69('0x53'));var _0x3e3948=squel['expr']();var _0x32e0f8=[];var _0x2f295c=squel[_0x7c69('0x54')]();var _0x2f94c4;if(_0x1e806f[_0x7c69('0x38')]['search']){_0x2f94c4=as[_0x7c69('0x55')](_0x1e806f[_0x7c69('0x38')]['search']);var _0x4d3102=_0x2f94c4[_0x7c69('0x56')];for(var _0x3488a6=0x0;_0x3488a6<_0x2f94c4['conditions'][_0x7c69('0x3d')];_0x3488a6++){var _0x2924be=_0x2f94c4['conditions'][_0x3488a6];var _0x28ca4f='i';var _0x21fcd9=_['find'](_0x51346f,['name',_0x2924be[_0x7c69('0x42')]]);if(!_0x21fcd9){switch(_0x2924be[_0x7c69('0x42')]){case'unreadMessages':if(_0x2924be['value']==0x1){_0x2b1ac1[_0x7c69('0x57')]('`'+_0x2924be['field']+_0x7c69('0x58'));}else{_0x2b1ac1[_0x7c69('0x57')]('`'+_0x2924be[_0x7c69('0x42')]+_0x7c69('0x59'));}break;case'Contact':if(_0x2924be[_0x7c69('0x5a')]==='$substring'){if(_0x2924be[_0x7c69('0x5b')][_0x7c69('0x5c')]('\x20')['length']>0x1){_0x3e3948[_0x4d3102](_0x7c69('0x5d'),qs[_0x7c69('0x5e')](_0x2924be['value']),null);}else{var _0x485627='%'+_0x2924be[_0x7c69('0x5b')]+'%';_0x3e3948[_0x4d3102](_0x7c69('0x5f'),_0x485627,_0x485627,_0x485627);}}else{_0x21fcd9=_[_0x7c69('0x60')](_0x51346f,[_0x7c69('0x2b'),_0x7c69('0x61')]);_0x2924be[_0x7c69('0x42')]=_0x7c69('0x61');_0x4e7bc1=as['buildExpression'](_0x28ca4f,_0x21fcd9[_0x7c69('0x35')],_0x2924be);_0x3e3948[_0x4d3102](_0x4e7bc1[_0x7c69('0x62')],_0x4e7bc1[_0x7c69('0x5b')][_0x7c69('0x63')],_0x4e7bc1[_0x7c69('0x5b')][_0x7c69('0x29')]);}break;case _0x7c69('0x64'):var _0x1cb79d=_0x2924be[_0x7c69('0x5b')][_0x7c69('0x5c')](',')[_0x7c69('0x2e')](function(_0x5aa92e){return Number(_0x5aa92e);});_0x1cb79d[_0x7c69('0x32')](function(_0x54b92d){_0x2f295c['or'](_0x7c69('0x65'),'%,'+_0x54b92d+',%');});_0x32e0f8=_[_0x7c69('0x66')](_0x32e0f8,_0x1cb79d);break;case'User':if(_0x2924be[_0x7c69('0x5a')]===_0x7c69('0x67')){_0x3e3948[_0x4d3102]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2924be['value']+'%',null);}else{_0x21fcd9=_[_0x7c69('0x60')](_0x51346f,[_0x7c69('0x2b'),_0x7c69('0x68')]);_0x2924be[_0x7c69('0x42')]=_0x7c69('0x68');_0x4e7bc1=as[_0x7c69('0x69')](_0x28ca4f,_0x21fcd9[_0x7c69('0x35')],_0x2924be);_0x3e3948[_0x4d3102](_0x4e7bc1[_0x7c69('0x62')],_0x4e7bc1[_0x7c69('0x5b')]['start'],_0x4e7bc1['value'][_0x7c69('0x29')]);}break;case _0x7c69('0x6a'):_0x4e7bc1=as[_0x7c69('0x69')]('me',null,_0x2924be);_0x3e3948[_0x4d3102](_0x4e7bc1[_0x7c69('0x62')],_0x4e7bc1[_0x7c69('0x5b')][_0x7c69('0x63')],_0x4e7bc1[_0x7c69('0x5b')]['end']);break;}}else{var _0x4e7bc1=as[_0x7c69('0x69')](_0x28ca4f,_0x21fcd9[_0x7c69('0x35')],_0x2924be);_0x3e3948[_0x4d3102](_0x4e7bc1[_0x7c69('0x62')],_0x4e7bc1[_0x7c69('0x5b')][_0x7c69('0x63')],_0x4e7bc1[_0x7c69('0x5b')][_0x7c69('0x29')]);}}}else{var _0x5bc5e0=_(_0x1e806f[_0x7c69('0x38')])['keys']()[_0x7c69('0x2e')](function(_0x57271e){return _['some'](_0x51346f,[_0x7c69('0x2b'),_0x57271e])?_0x57271e:undefined;})[_0x7c69('0x6b')]()[_0x7c69('0x5b')]();if(!_[_0x7c69('0x6c')](_0x5bc5e0)){_0x5bc5e0[_0x7c69('0x32')](function(_0x72dce7){if(_0x72dce7===_0x7c69('0x6d')){_0x2b1ac1[_0x7c69('0x40')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x1e806f[_0x7c69('0x38')][_0x72dce7]));}else if(_0x72dce7===_0x7c69('0x6e')){var _0x3a9e14=JSON[_0x7c69('0x6f')](_0x1e806f[_0x7c69('0x38')][_0x72dce7])[_0x7c69('0x70')];var _0x7d66b2=JSON['parse'](_0x1e806f[_0x7c69('0x38')][_0x72dce7])[_0x7c69('0x71')];_0x2b1ac1['where'](_0x7c69('0x72'),_0x3a9e14,_0x7d66b2);}else{if(_0x1e806f[_0x7c69('0x38')][_0x72dce7]==='null'){_0x2b1ac1[_0x7c69('0x40')]('i.'+_0x72dce7+'\x20IS\x20NULL');}else{_0x2b1ac1[_0x7c69('0x40')]('i.'+_0x72dce7+'\x20=\x20?',_0x1e806f['query'][_0x72dce7]);}}});}if(_0x1e806f[_0x7c69('0x38')][_0x7c69('0x73')]){if(_0x1e806f[_0x7c69('0x38')][_0x7c69('0x73')]==0x1){_0x2b1ac1[_0x7c69('0x57')](_0x7c69('0x74'));}else{_0x2b1ac1[_0x7c69('0x57')](_0x7c69('0x75'));}}if(_0x1e806f[_0x7c69('0x38')][_0x7c69('0x76')]){_0x32e0f8=_[_0x7c69('0x77')](_0x1e806f[_0x7c69('0x38')][_0x7c69('0x76')])?_0x1e806f[_0x7c69('0x38')][_0x7c69('0x76')]:new Array(_0x1e806f['query'][_0x7c69('0x76')]);_0x32e0f8[_0x7c69('0x32')](function(_0x3d0255){_0x2f295c['or'](_0x7c69('0x65'),'%,'+_0x3d0255+',%');});}if(_0x1e806f['query'][_0x7c69('0x78')]){var _0x61f95b=_0x1e806f[_0x7c69('0x38')]['filter']['replace']('\x5c','\x5c\x5c')[_0x7c69('0x79')](/'/g,'\x27\x27');if(qs[_0x7c69('0x7a')](_0x61f95b)){_0x3e3948['or'](_0x7c69('0x7b'),_0x61f95b+'%')['or'](_0x7c69('0x7c'),_0x61f95b+'%');}_0x3e3948['or'](_0x7c69('0x7d'),_0x61f95b+'%');}}_0x2b1ac1[_0x7c69('0x40')](_0x3e3948);_0x2b1ac1['group'](_0x7c69('0x7e'));var _0x7a9e5={'type':db[_0x7c69('0x7f')][_0x7c69('0x80')][_0x7c69('0x81')],'raw':!![]};var _0x588bfc=_0x2b1ac1['clone']();_0x588bfc['field']('i.id');_0x588bfc[_0x7c69('0x42')](_0x7c69('0x82'),_0x7c69('0x83'));if(_0x187a8c[_0x7c69('0x3e')]){_0x187a8c['order'][_0x7c69('0x32')](function(_0x5c3634){var _0x528d22=_0x5c3634[0x0]===_0x7c69('0x84')?_0x5c3634[0x0]:'i.'+_0x5c3634[0x0];_0x2b1ac1[_0x7c69('0x3e')](_0x528d22,_0x5c3634[0x1]===_0x7c69('0x85')?![]:!![]);});}if(!_['isEmpty'](_0x32e0f8)){_0x2b1ac1[_0x7c69('0x57')](_0x2f295c);_0x588bfc[_0x7c69('0x40')]('t.id\x20IN\x20?',_0x32e0f8);}BPromise['resolve']()['then'](function(){if(!_0x2f94c4){if(_0x1e806f[_0x7c69('0x38')][_0x7c69('0x6d')])return;_0x588bfc['where'](_0x7c69('0x86'));_0x2b1ac1[_0x7c69('0x40')](_0x7c69('0x86'));return;}if(_0x1e806f[_0x7c69('0x87')][_0x7c69('0x88')]!=='agent')return;return _0x1e806f[_0x7c69('0x87')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x20a5eb){if(_[_0x7c69('0x6c')](_0x20a5eb)){_0x588bfc[_0x7c69('0x40')](_0x7c69('0x89'));_0x2b1ac1[_0x7c69('0x40')](_0x7c69('0x89'));}else{_0x588bfc['where'](_0x7c69('0x8a'),_['map'](_0x20a5eb,'id'));_0x2b1ac1[_0x7c69('0x40')]('i.FaxAccountId\x20IN\x20?',_[_0x7c69('0x2e')](_0x20a5eb,'id'));}});})[_0x7c69('0x27')](function(){if(_0x1e806f[_0x7c69('0x87')]['role']===_0x7c69('0x8b')&&!_0x2f94c4&&!_0x1e806f[_0x7c69('0x38')][_0x7c69('0x6d')])return[];return db[_0x7c69('0x8c')][_0x7c69('0x38')](_0x588bfc[_0x7c69('0x8d')](),_0x7a9e5);})[_0x7c69('0x27')](function(_0x501cb5){_0x8b3e2f['count']=_0x501cb5['length'];if(_0x8b3e2f['count']===0x0)return[];return db[_0x7c69('0x8c')][_0x7c69('0x38')](_0x52e4d1[_0x7c69('0x8d')](),_0x7a9e5)[_0x7c69('0x27')](function(_0x2aea10){_0x51658c=_[_0x7c69('0x8e')](_0x2aea10,'id');_0x7a9e5=_['merge'](_0x7a9e5,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e806f['query'][_0x7c69('0x3c')]){_0x187a8c[_0x7c69('0x3b')]['forEach'](function(_0x3d9f60){_0x2b1ac1[_0x7c69('0x42')]('i.'+_0x3d9f60);});}else{_0x2b1ac1[_0x7c69('0x42')](_0x7c69('0x82'),'unreadMessages');_0x2b1ac1[_0x7c69('0x42')](_0x7c69('0x8f'),_0x7c69('0x90'));_0x2b1ac1[_0x7c69('0x42')](_0x7c69('0x91'),_0x7c69('0x92'));_0x2b1ac1['field'](_0x7c69('0x93'),'contactName');_0x2b1ac1['field'](_0x7c69('0x94'));_0x2b1ac1['field']('c.firstName',_0x7c69('0x95'));_0x2b1ac1[_0x7c69('0x42')]('c.lastName',_0x7c69('0x96'));_0x2b1ac1['field'](_0x7c69('0x97'),_0x7c69('0x98'));_0x2b1ac1['field']('c.phone',_0x7c69('0x99'));_0x2b1ac1[_0x7c69('0x42')]('c.mobile',_0x7c69('0x9a'));_0x2b1ac1[_0x7c69('0x42')]('c.fax',_0x7c69('0x9b'));_0x2b1ac1[_0x7c69('0x42')](_0x7c69('0x9c'),'Owner.fullname');_0x2b1ac1[_0x7c69('0x42')]('o.internal',_0x7c69('0x9d'));_0x2b1ac1[_0x7c69('0x42')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x7c69('0x31'));}if(_0x187a8c['limit'])_0x2b1ac1[_0x7c69('0x20')](_0x187a8c['limit']);if(_0x187a8c[_0x7c69('0x1f')])_0x2b1ac1[_0x7c69('0x1f')](_0x187a8c[_0x7c69('0x1f')]);return db[_0x7c69('0x8c')][_0x7c69('0x38')](_0x2b1ac1[_0x7c69('0x8d')](),_0x7a9e5);})[_0x7c69('0x27')](function(_0x136ed8){if(_0x136ed8[_0x7c69('0x3d')]>0x0)_0x1b6890[_0x7c69('0x40')](_0x7c69('0x9e'),_['map'](_0x136ed8,'id'));return db['sequelize']['query'](_0x1b6890['toString'](),_0x7a9e5)['then'](function(_0x37af16){var _0x438c1f=_['groupBy'](_0x37af16,_0x7c69('0x9f'));var _0x3aa6f9=[];_0x136ed8[_0x7c69('0x32')](function(_0x57bc07){_0x3aa6f9[_0x7c69('0xa0')](updateFaxInteraction(_0x57bc07,_0x51658c,_0x438c1f));});return BPromise[_0x7c69('0xa1')](_0x3aa6f9);});});})[_0x7c69('0x27')](function(_0x294d2a){_0x8b3e2f['rows']=_0x294d2a;return _0x8b3e2f;})[_0x7c69('0x27')](respondWithFilteredResult(_0x431e2,_0x187a8c))[_0x7c69('0x33')](handleError(_0x431e2,null));};exports[_0x7c69('0xa2')]=function(_0x3766fd,_0x45e144){var _0x16e13e={'raw':![],'where':{'id':_0x3766fd[_0x7c69('0xa3')]['id']}},_0x3812e8={};_0x3812e8['model']=_[_0x7c69('0xa4')](db[_0x7c69('0xa5')][_0x7c69('0x34')]);_0x3812e8[_0x7c69('0x38')]=_[_0x7c69('0xa4')](_0x3766fd[_0x7c69('0x38')]);_0x3812e8['filters']=_['intersection'](_0x3812e8[_0x7c69('0x37')],_0x3812e8[_0x7c69('0x38')]);_0x16e13e[_0x7c69('0x3b')]=_[_0x7c69('0x3a')](_0x3812e8[_0x7c69('0x37')],qs[_0x7c69('0x3c')](_0x3766fd['query'][_0x7c69('0x3c')]));_0x16e13e['attributes']=_0x16e13e[_0x7c69('0x3b')][_0x7c69('0x3d')]?_0x16e13e[_0x7c69('0x3b')]:_0x3812e8['model'];if(_0x3766fd[_0x7c69('0x38')][_0x7c69('0xa6')]){_0x16e13e['include']=[{'all':!![]}];}_0x16e13e=_[_0x7c69('0xa7')]({},_0x16e13e,_0x3766fd[_0x7c69('0xa8')]);return db[_0x7c69('0xa5')]['find'](_0x16e13e)['then'](handleEntityNotFound(_0x45e144,null))[_0x7c69('0x27')](respondWithResult(_0x45e144,null))[_0x7c69('0x33')](handleError(_0x45e144,null));};exports[_0x7c69('0xa9')]=function(_0x446aa6,_0xf098f){return db[_0x7c69('0xa5')][_0x7c69('0xa9')](_0x446aa6[_0x7c69('0x6a')],{})['then'](respondWithResult(_0xf098f,0xc9))['catch'](handleError(_0xf098f,null));};exports[_0x7c69('0x26')]=function(_0x3262d6,_0x4f1a0f){if(_0x3262d6[_0x7c69('0x6a')]['id']){delete _0x3262d6[_0x7c69('0x6a')]['id'];}return db[_0x7c69('0xa5')][_0x7c69('0x60')]({'where':{'id':_0x3262d6['params']['id']}})['then'](handleEntityNotFound(_0x4f1a0f,null))[_0x7c69('0x27')](saveUpdates(_0x3262d6['body'],null))['then'](respondWithResult(_0x4f1a0f,null))[_0x7c69('0x33')](handleError(_0x4f1a0f,null));};exports[_0x7c69('0x28')]=function(_0x54cf55,_0x39f4e5){return db[_0x7c69('0xa5')]['find']({'where':{'id':_0x54cf55[_0x7c69('0xa3')]['id']}})['then'](handleEntityNotFound(_0x39f4e5,null))['then'](removeEntity(_0x39f4e5,null))[_0x7c69('0x33')](handleError(_0x39f4e5,null));};exports[_0x7c69('0xaa')]=function(_0x584aad,_0x1d9270){return db[_0x7c69('0xa5')]['describe']()[_0x7c69('0x27')](respondWithResult(_0x1d9270,null))[_0x7c69('0x33')](handleError(_0x1d9270,null));};exports['addMessage']=function(_0xf2e3b,_0x3ce5d8,_0x59611d){return db['FaxMessage'][_0x7c69('0x60')]({'where':{'id':_0xf2e3b['params']['id']}})['then'](handleEntityNotFound(_0x3ce5d8,null))['then'](function(_0x4f9eec){if(_0x4f9eec){return _0x4f9eec[_0x7c69('0xab')](_0xf2e3b[_0x7c69('0x6a')]['ids'],_[_0x7c69('0xac')](_0xf2e3b[_0x7c69('0x6a')],[_0x7c69('0xad'),'id'])||{});}})['then'](respondWithResult(_0x3ce5d8,null))['catch'](handleError(_0x3ce5d8,null));};exports['getMessages']=function(_0x3883b6,_0xdd9ab2,_0x38c2b0){var _0x5d4010={'raw':![],'where':{}};var _0xa14fec={};var _0x863b4f={'count':0x0,'rows':[]};return db[_0x7c69('0xa5')][_0x7c69('0xae')]({'where':{'id':_0x3883b6[_0x7c69('0xa3')]['id']}})['then'](handleEntityNotFound(_0xdd9ab2,null))[_0x7c69('0x27')](function(_0x531080){if(_0x531080){_0xa14fec[_0x7c69('0x37')]=_[_0x7c69('0xa4')](db[_0x7c69('0xaf')][_0x7c69('0x34')]);_0xa14fec[_0x7c69('0x38')]=_[_0x7c69('0xa4')](_0x3883b6[_0x7c69('0x38')]);_0xa14fec[_0x7c69('0x39')]=_[_0x7c69('0x3a')](_0xa14fec[_0x7c69('0x37')],_0xa14fec['query']);_0x5d4010['attributes']=_['intersection'](_0xa14fec[_0x7c69('0x37')],qs['fields'](_0x3883b6[_0x7c69('0x38')][_0x7c69('0x3c')]));_0x5d4010[_0x7c69('0x3b')]=_0x5d4010[_0x7c69('0x3b')][_0x7c69('0x3d')]?_0x5d4010['attributes']:_0xa14fec[_0x7c69('0x37')];if(!_0x3883b6[_0x7c69('0x38')][_0x7c69('0xb0')]('nolimit')){_0x5d4010['limit']=qs[_0x7c69('0x20')](_0x3883b6[_0x7c69('0x38')][_0x7c69('0x20')]);_0x5d4010[_0x7c69('0x1f')]=qs['offset'](_0x3883b6[_0x7c69('0x38')][_0x7c69('0x1f')]);}_0x5d4010[_0x7c69('0x3e')]=qs[_0x7c69('0x3f')](_0x3883b6['query'][_0x7c69('0x3f')]);_0x5d4010[_0x7c69('0x40')]=qs[_0x7c69('0x39')](_[_0x7c69('0xb1')](_0x3883b6[_0x7c69('0x38')],_0xa14fec[_0x7c69('0x39')]));_0x5d4010[_0x7c69('0x40')][_0x7c69('0x9f')]=_0x531080['id'];if(_0x3883b6[_0x7c69('0x38')][_0x7c69('0x78')]){_0x5d4010[_0x7c69('0x40')]=_[_0x7c69('0xa7')](_0x5d4010[_0x7c69('0x40')],{'$or':_[_0x7c69('0x2e')](_0x5d4010[_0x7c69('0x3b')],function(_0xf2e367){var _0x3507bf={};_0x3507bf[_0xf2e367]={'$like':'%'+_0x3883b6[_0x7c69('0x38')][_0x7c69('0x78')]+'%'};return _0x3507bf;})});}if(_0x3883b6[_0x7c69('0x38')][_0x7c69('0x70')]){var _0x208df9=_0x3883b6[_0x7c69('0x38')]['$gte'][_0x7c69('0x5c')](',');var _0x1bc601={};_0x1bc601[_0x208df9[0x0]]={'$gte':moment(_0x208df9[0x1])[_0x7c69('0xb2')](_0x7c69('0xb3'))};_0x5d4010[_0x7c69('0x40')]=_['merge'](_0x5d4010[_0x7c69('0x40')],_0x1bc601);}_0x5d4010=_['merge']({},_0x5d4010,_0x3883b6[_0x7c69('0xa8')]);return db[_0x7c69('0xaf')][_0x7c69('0x1e')]({'where':_0x5d4010[_0x7c69('0x40')]})[_0x7c69('0x27')](function(_0x17351a){_0x863b4f[_0x7c69('0x1e')]=_0x17351a;if(_0x3883b6['query'][_0x7c69('0xa6')]){_0x5d4010[_0x7c69('0xb4')]=[{'all':!![]}];}return db[_0x7c69('0xaf')][_0x7c69('0xb5')](_0x5d4010);})[_0x7c69('0x27')](function(_0x171a2d){_0x863b4f[_0x7c69('0xb6')]=_0x171a2d;return _0x863b4f;});}})[_0x7c69('0x27')](respondWithFilteredResult(_0xdd9ab2,_0x5d4010))[_0x7c69('0x33')](handleError(_0xdd9ab2,null));};exports[_0x7c69('0xb7')]=function(_0x5c065e,_0x55e467,_0x2adb2a){return db['FaxInteraction']['find']({'where':{'id':_0x5c065e['params']['id']}})[_0x7c69('0x27')](handleEntityNotFound(_0x55e467,null))['then'](function(_0x28a140){if(_0x28a140){return _0x28a140[_0x7c69('0xb8')](_0x5c065e[_0x7c69('0x6a')][_0x7c69('0xad')],_[_0x7c69('0xac')](_0x5c065e[_0x7c69('0x6a')],[_0x7c69('0xad'),'id'])||{})['spread'](function(){return db[_0x7c69('0x64')][_0x7c69('0xb5')]({'attributes':['id',_0x7c69('0x2b'),_0x7c69('0xb9')],'where':{'id':_0x5c065e[_0x7c69('0x6a')]['ids']}});})[_0x7c69('0x27')](function(_0x58b4eb){socket[_0x7c69('0xba')](_0x7c69('0xbb'),{'id':Number(_0x5c065e[_0x7c69('0xa3')]['id']),'tags':_0x58b4eb||[]});return{'id':Number(_0x5c065e[_0x7c69('0xa3')]['id']),'tags':_0x58b4eb||[]};});}})[_0x7c69('0x27')](respondWithResult(_0x55e467,null))['catch'](handleError(_0x55e467,null));};exports['removeTags']=function(_0x24e018,_0x243438,_0xc521c6){return db[_0x7c69('0xa5')][_0x7c69('0x60')]({'where':{'id':_0x24e018[_0x7c69('0xa3')]['id']}})['then'](handleEntityNotFound(_0x243438,null))[_0x7c69('0x27')](function(_0xe0d8e){if(_0xe0d8e){return _0xe0d8e[_0x7c69('0xbc')](_0x24e018[_0x7c69('0x38')][_0x7c69('0xad')]);}})['then'](respondWithStatusCode(_0x243438,null))[_0x7c69('0x33')](handleError(_0x243438,null));};exports[_0x7c69('0xbd')]=function(_0x877f11,_0x22f67){var _0xc559fd=moment()['unix']()['toString']();var _0x4085ab=path[_0x7c69('0xbe')](config[_0x7c69('0xbf')],_0x7c69('0xc0'),_0x7c69('0xc1'),'tmp');var _0x43820e=path['join'](config['root'],_0x7c69('0xc0'),_0x7c69('0xc1'),_0x7c69('0xc2'));var _0x228db4=path[_0x7c69('0xbe')](_0x4085ab,_0xc559fd);var _0x405240=util[_0x7c69('0xb2')](_0x7c69('0xc3'),_0x877f11[_0x7c69('0xa3')]['id'],_0xc559fd);var _0xb340cc=path[_0x7c69('0xbe')](_0x4085ab,_0x405240);var _0x58fea1=[];_0x58fea1['push']({'model':db[_0x7c69('0xc4')],'as':_0x7c69('0xc4'),'raw':!![]});var _0x4c5804=[{'model':db[_0x7c69('0xaf')],'as':'Messages','attributes':['id','body',_0x7c69('0x6e')],'include':_0x58fea1}];return db[_0x7c69('0xa5')][_0x7c69('0x60')]({'where':{'id':_0x877f11['params']['id']},'include':_0x4c5804})['then'](handleEntityNotFound(_0x22f67,null))['then'](function(_0x46f28a){if(_0x46f28a&&_0x46f28a[_0x7c69('0xc5')]){var _0x51b7ff=_0x46f28a[_0x7c69('0xc6')]({'plain':!![]});fs[_0x7c69('0xc7')](_0x228db4);for(var _0x38f9e8=0x0;_0x38f9e8<_0x51b7ff['Messages'][_0x7c69('0x3d')];_0x38f9e8++){var _0x39781e=_0x51b7ff[_0x7c69('0xc5')][_0x38f9e8][_0x7c69('0xc4')];if(_0x39781e){var _0x33e5fb=path[_0x7c69('0xbe')](_0x43820e,_0x39781e[_0x7c69('0xc8')]);if(fs[_0x7c69('0xc9')](_0x33e5fb)){fs[_0x7c69('0xca')](_0x33e5fb)[_0x7c69('0xcb')](fs[_0x7c69('0xcc')](path[_0x7c69('0xbe')](_0x228db4,_0x39781e[_0x7c69('0xc8')])));}}}return BPromise[_0x7c69('0xcd')]()['then'](function(){return new BPromise(function(_0x45f6b4,_0x384cd3){zipdir(_0x228db4,{'saveTo':_0xb340cc},function(_0x66fef0,_0x53dcb0){if(_0x66fef0)return _0x384cd3(_0x66fef0);return _0x45f6b4(_0x53dcb0);});})[_0x7c69('0x27')](function(){return new BPromise(function(_0x1eb0b1,_0x3e8621){rimraf(_0x228db4,function(_0x10cb30){if(_0x10cb30)_0x3e8621(_0x10cb30);return _0x1eb0b1();});});})['then'](function(){return _0x22f67['download'](_0xb340cc,_0x405240,function(_0x1ea1c4){if(_0x1ea1c4){console[_0x7c69('0xce')](_0x7c69('0xcf'),_0x1ea1c4);}else{fs[_0x7c69('0xd0')](_0xb340cc);}});});});}else{return _0x22f67['sendStatus'](0xc8);}})['catch'](handleError(_0x22f67,null));};
\ No newline at end of file
index 70b8363..538c9b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x362f=['../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','exports','events'];(function(_0x70bb8,_0x1da278){var _0x48ba84=function(_0xb567b9){while(--_0xb567b9){_0x70bb8['push'](_0x70bb8['shift']());}};_0x48ba84(++_0x1da278);}(_0x362f,0x1db));var _0xf362=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x362f[_0x5bd426];return _0x23a7eb;};'use strict';var EventEmitter=require(_0xf362('0x0'));var FaxInteraction=require(_0xf362('0x1'))['db'][_0xf362('0x2')];var FaxMessage=require(_0xf362('0x1'))['db'][_0xf362('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf362('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf362('0x5'),'afterDestroy':_0xf362('0x6')};function emitEvent(_0x4ae82c){return function(_0x41daff,_0x3a449e,_0x323cca){_0x41daff[_0xf362('0x7')]({'attributes':['id'],'raw':!![]})[_0xf362('0x8')](function(_0x16e540){_0x41daff[_0xf362('0x9')](_0xf362('0xa'),_0x16e540[_0xf362('0xb')](function(_0x5ed4bb){return{'id':_0x5ed4bb['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x41daff['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1a61ec){_0x41daff[_0xf362('0x9')]('unreadMessages',_0x1a61ec[_0xf362('0xc')]);FaxInteractionEvents[_0xf362('0xd')](_0x4ae82c+':'+_0x41daff['id'],_0x41daff);FaxInteractionEvents[_0xf362('0xd')](_0x4ae82c,_0x41daff);_0x323cca(null);})[_0xf362('0xe')](_0x323cca(null));};}for(var e in events){if(events[_0xf362('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xf362('0x10')]=FaxInteractionEvents;
\ No newline at end of file
+var _0xe995=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x4d10de,_0x3c2cd6){var _0x29afc2=function(_0x31688a){while(--_0x31688a){_0x4d10de['push'](_0x4d10de['shift']());}};_0x29afc2(++_0x3c2cd6);}(_0xe995,0x92));var _0x5e99=function(_0xb23ea7,_0x42dbfb){_0xb23ea7=_0xb23ea7-0x0;var _0x502273=_0xe995[_0xb23ea7];return _0x502273;};'use strict';var EventEmitter=require(_0x5e99('0x0'));var FaxInteraction=require(_0x5e99('0x1'))['db'][_0x5e99('0x2')];var FaxMessage=require(_0x5e99('0x1'))['db'][_0x5e99('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5e99('0x4'),'afterUpdate':_0x5e99('0x5'),'afterDestroy':_0x5e99('0x6')};function emitEvent(_0x3d97d4){return function(_0x4ba90a,_0x4b1aea,_0x30ab88){_0x4ba90a[_0x5e99('0x7')]({'attributes':['id'],'raw':!![]})[_0x5e99('0x8')](function(_0x2bf7fb){_0x4ba90a[_0x5e99('0x9')](_0x5e99('0xa'),_0x2bf7fb[_0x5e99('0xb')](function(_0x1ff6aa){return{'id':_0x1ff6aa['id']};}));return FaxMessage[_0x5e99('0xc')]({'where':{'FaxInteractionId':_0x4ba90a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x26bcb1){_0x4ba90a['setDataValue'](_0x5e99('0xd'),_0x26bcb1[_0x5e99('0xe')]);FaxInteractionEvents[_0x5e99('0xf')](_0x3d97d4+':'+_0x4ba90a['id'],_0x4ba90a);FaxInteractionEvents[_0x5e99('0xf')](_0x3d97d4,_0x4ba90a);_0x30ab88(null);})[_0x5e99('0x10')](_0x30ab88(null));};}for(var e in events){if(events[_0x5e99('0x11')](e)){var event=events[e];FaxInteraction[_0x5e99('0x12')](e,emitEvent(event));}}module[_0x5e99('0x13')]=FaxInteractionEvents;
\ No newline at end of file
index fea84a3..a5ab960 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x498d=['path','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','util','api','moment','bluebird','request-promise'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x498d,0x191));var _0xd498=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0x498d[_0x25c326];return _0x762452;};'use strict';var _=require('lodash');var util=require(_0xd498('0x0'));var logger=require('../../config/logger')(_0xd498('0x1'));var moment=require(_0xd498('0x2'));var BPromise=require(_0xd498('0x3'));var rp=require(_0xd498('0x4'));var fs=require('fs');var path=require(_0xd498('0x5'));var rimraf=require('rimraf');var config=require(_0xd498('0x6'));var attributes=require(_0xd498('0x7'));module[_0xd498('0x8')]=function(_0x274007,_0x25741a){return _0x274007['define'](_0xd498('0x9'),attributes,{'tableName':_0xd498('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48aa3e,_0x5cf39e,_0x1a0c68){if(_0x48aa3e[_0xd498('0xb')](_0xd498('0xc'))){_0x48aa3e[_0xd498('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1a0c68(null,_0x48aa3e);}}});};
\ No newline at end of file
+var _0x6ead=['fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5c64f3,_0x1ded01){var _0x11ab41=function(_0x593119){while(--_0x593119){_0x5c64f3['push'](_0x5c64f3['shift']());}};_0x11ab41(++_0x1ded01);}(_0x6ead,0x122));var _0xd6ea=function(_0x161f1e,_0x235e5e){_0x161f1e=_0x161f1e-0x0;var _0x38d3df=_0x6ead[_0x161f1e];return _0x38d3df;};'use strict';var _=require(_0xd6ea('0x0'));var util=require(_0xd6ea('0x1'));var logger=require(_0xd6ea('0x2'))('api');var moment=require(_0xd6ea('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6ea('0x4'));var fs=require('fs');var path=require(_0xd6ea('0x5'));var rimraf=require(_0xd6ea('0x6'));var config=require(_0xd6ea('0x7'));var attributes=require('./faxInteraction.attributes');module[_0xd6ea('0x8')]=function(_0x1e9e63,_0x18e258){return _0x1e9e63[_0xd6ea('0x9')]('FaxInteraction',attributes,{'tableName':_0xd6ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2900ff,_0x18e908,_0xce3e7f){if(_0x2900ff[_0xd6ea('0xb')](_0xd6ea('0xc'))){_0x2900ff['closedAt']=moment()[_0xd6ea('0xd')](_0xd6ea('0xe'));}_0xce3e7f(null,_0x2900ff);}}});};
\ No newline at end of file
index 880127c..0e8da84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd067=['options','raw','attributes','limit','AddTagsToFaxInteraction','where','addTags','ids','spread','AddTags','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','FaxInteraction,\x20%s,\x20%s','message','result','UpdateFaxInteraction','FaxInteraction','update','body'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd067,0x14b));var _0x7d06=function(_0x2420c8,_0x59cdcc){_0x2420c8=_0x2420c8-0x0;var _0x46e13d=_0xd067[_0x2420c8];return _0x46e13d;};'use strict';var _=require(_0x7d06('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7d06('0x1'));var rs=require(_0x7d06('0x2'));var fs=require('fs');var Redis=require(_0x7d06('0x3'));var db=require(_0x7d06('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d06('0x5'))('rpc');var config=require(_0x7d06('0x6'));var jayson=require(_0x7d06('0x7'));var client=jayson['client'][_0x7d06('0x8')]({'port':0x232a});config[_0x7d06('0x9')]=_[_0x7d06('0xa')](config[_0x7d06('0x9')],{'host':_0x7d06('0xb'),'port':0x18eb});var socket=require(_0x7d06('0xc'))(new Redis(config[_0x7d06('0x9')]));require('./faxInteraction.socket')[_0x7d06('0xd')](socket);function respondWithRpcPromise(_0x3940b0,_0xbe2494,_0x1763a4){return new BPromise(function(_0x590269,_0x239521){return client[_0x7d06('0xe')](_0x3940b0,_0x1763a4)[_0x7d06('0xf')](function(_0x205a5c){logger[_0x7d06('0x10')]('FaxInteraction,\x20%s,\x20%s',_0xbe2494,_0x7d06('0x11'));logger[_0x7d06('0x12')](_0x7d06('0x13'),_0xbe2494,_0x7d06('0x11'),JSON[_0x7d06('0x14')](_0x205a5c));if(_0x205a5c[_0x7d06('0x15')]){if(_0x205a5c[_0x7d06('0x15')]['code']===0x1f4){logger[_0x7d06('0x15')](_0x7d06('0x16'),_0xbe2494,_0x205a5c[_0x7d06('0x15')][_0x7d06('0x17')]);return _0x239521(_0x205a5c[_0x7d06('0x15')][_0x7d06('0x17')]);}logger[_0x7d06('0x15')](_0x7d06('0x16'),_0xbe2494,_0x205a5c[_0x7d06('0x15')]['message']);return _0x590269(_0x205a5c[_0x7d06('0x15')]['message']);}else{logger['info'](_0x7d06('0x16'),_0xbe2494,_0x7d06('0x11'));_0x590269(_0x205a5c[_0x7d06('0x18')][_0x7d06('0x17')]);}})['catch'](function(_0x23a410){logger[_0x7d06('0x15')](_0x7d06('0x16'),_0xbe2494,_0x23a410);_0x239521(_0x23a410);});});}exports[_0x7d06('0x19')]=function(_0x130fee){var _0x4034ee=this;return new Promise(function(_0x41d58e,_0x536f66){return db[_0x7d06('0x1a')][_0x7d06('0x1b')](_0x130fee[_0x7d06('0x1c')],{'raw':_0x130fee[_0x7d06('0x1d')]?_0x130fee[_0x7d06('0x1d')][_0x7d06('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x130fee['options']?_0x130fee['options']['where']||null:null,'attributes':_0x130fee['options']?_0x130fee[_0x7d06('0x1d')][_0x7d06('0x1f')]||null:null,'limit':_0x130fee[_0x7d06('0x1d')]?_0x130fee[_0x7d06('0x1d')][_0x7d06('0x20')]||null:null})['then'](function(_0x5cf601){logger[_0x7d06('0x10')](_0x7d06('0x19'),_0x130fee);logger[_0x7d06('0x12')](_0x7d06('0x19'),_0x130fee,JSON[_0x7d06('0x14')](_0x5cf601));_0x41d58e(_0x5cf601);})['catch'](function(_0x35e689){logger[_0x7d06('0x15')](_0x7d06('0x19'),_0x35e689[_0x7d06('0x17')],_0x130fee);_0x536f66(_0x4034ee['error'](0x1f4,_0x35e689[_0x7d06('0x17')]));});});};exports[_0x7d06('0x21')]=function(_0x10c4b3){return new Promise(function(_0x96d611,_0x294d36){return db[_0x7d06('0x1a')]['find']({'where':_0x10c4b3[_0x7d06('0x1d')]?_0x10c4b3[_0x7d06('0x1d')][_0x7d06('0x22')]||null:null})[_0x7d06('0xf')](function(_0x85bdc6){if(_0x85bdc6){return _0x85bdc6[_0x7d06('0x23')](_0x10c4b3[_0x7d06('0x1c')][_0x7d06('0x24')],_['omit'](_0x10c4b3[_0x7d06('0x1c')],[_0x7d06('0x24'),'id'])||{});}})[_0x7d06('0x25')](function(_0x344122){logger[_0x7d06('0x10')](_0x7d06('0x26'),_0x10c4b3);logger[_0x7d06('0x12')](_0x7d06('0x26'),_0x10c4b3,JSON[_0x7d06('0x14')](_0x344122));_0x96d611(_0x344122);})[_0x7d06('0x27')](function(_0x902397){logger[_0x7d06('0x15')](_0x7d06('0x26'),_0x902397[_0x7d06('0x17')],_0x10c4b3);_0x294d36(_this[_0x7d06('0x15')](0x1f4,_0x902397['message']));});});};
\ No newline at end of file
+var _0xdf43=['spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./faxInteraction.socket','then','info','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','catch','UpdateFaxInteraction','FaxInteraction','options','where','attributes','limit','debug','AddTagsToFaxInteraction','addTags','ids','omit','body'];(function(_0x39514b,_0x28b46a){var _0x5401d1=function(_0x2a2a1f){while(--_0x2a2a1f){_0x39514b['push'](_0x39514b['shift']());}};_0x5401d1(++_0x28b46a);}(_0xdf43,0x74));var _0x3df4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xdf43[_0x4d613c];return _0x301fe3;};'use strict';var _=require('lodash');var util=require(_0x3df4('0x0'));var moment=require(_0x3df4('0x1'));var BPromise=require(_0x3df4('0x2'));var rs=require(_0x3df4('0x3'));var fs=require('fs');var Redis=require(_0x3df4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3df4('0x5'))(_0x3df4('0x6'));var config=require(_0x3df4('0x7'));var jayson=require(_0x3df4('0x8'));var client=jayson[_0x3df4('0x9')]['http']({'port':0x232a});config[_0x3df4('0xa')]=_[_0x3df4('0xb')](config[_0x3df4('0xa')],{'host':_0x3df4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3df4('0xa')]));require(_0x3df4('0xd'))['register'](socket);function respondWithRpcPromise(_0x407534,_0x1801a5,_0x4fc3fb){return new BPromise(function(_0x3937d6,_0x44ecbe){return client['request'](_0x407534,_0x4fc3fb)[_0x3df4('0xe')](function(_0x3f958a){logger[_0x3df4('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x1801a5,'request\x20sent');logger['debug'](_0x3df4('0x10'),_0x1801a5,_0x3df4('0x11'),JSON[_0x3df4('0x12')](_0x3f958a));if(_0x3f958a[_0x3df4('0x13')]){if(_0x3f958a['error'][_0x3df4('0x14')]===0x1f4){logger[_0x3df4('0x13')](_0x3df4('0x15'),_0x1801a5,_0x3f958a[_0x3df4('0x13')]['message']);return _0x44ecbe(_0x3f958a[_0x3df4('0x13')][_0x3df4('0x16')]);}logger['error'](_0x3df4('0x15'),_0x1801a5,_0x3f958a[_0x3df4('0x13')]['message']);return _0x3937d6(_0x3f958a[_0x3df4('0x13')][_0x3df4('0x16')]);}else{logger[_0x3df4('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x1801a5,'request\x20sent');_0x3937d6(_0x3f958a['result'][_0x3df4('0x16')]);}})[_0x3df4('0x17')](function(_0x1e3849){logger[_0x3df4('0x13')](_0x3df4('0x15'),_0x1801a5,_0x1e3849);_0x44ecbe(_0x1e3849);});});}exports[_0x3df4('0x18')]=function(_0x53ecb1){var _0x420f83=this;return new Promise(function(_0x5ce5ca,_0x470468){return db[_0x3df4('0x19')]['update'](_0x53ecb1['body'],{'raw':_0x53ecb1[_0x3df4('0x1a')]?_0x53ecb1['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53ecb1[_0x3df4('0x1a')]?_0x53ecb1['options'][_0x3df4('0x1b')]||null:null,'attributes':_0x53ecb1[_0x3df4('0x1a')]?_0x53ecb1[_0x3df4('0x1a')][_0x3df4('0x1c')]||null:null,'limit':_0x53ecb1[_0x3df4('0x1a')]?_0x53ecb1['options'][_0x3df4('0x1d')]||null:null})['then'](function(_0x1d4eaf){logger[_0x3df4('0xf')](_0x3df4('0x18'),_0x53ecb1);logger[_0x3df4('0x1e')](_0x3df4('0x18'),_0x53ecb1,JSON['stringify'](_0x1d4eaf));_0x5ce5ca(_0x1d4eaf);})[_0x3df4('0x17')](function(_0x503328){logger[_0x3df4('0x13')](_0x3df4('0x18'),_0x503328['message'],_0x53ecb1);_0x470468(_0x420f83['error'](0x1f4,_0x503328['message']));});});};exports[_0x3df4('0x1f')]=function(_0x17fe03){return new Promise(function(_0x288360,_0x2282ea){return db['FaxInteraction']['find']({'where':_0x17fe03['options']?_0x17fe03[_0x3df4('0x1a')][_0x3df4('0x1b')]||null:null})[_0x3df4('0xe')](function(_0x4ec711){if(_0x4ec711){return _0x4ec711[_0x3df4('0x20')](_0x17fe03['body'][_0x3df4('0x21')],_[_0x3df4('0x22')](_0x17fe03[_0x3df4('0x23')],[_0x3df4('0x21'),'id'])||{});}})[_0x3df4('0x24')](function(_0x4e8308){logger['info'](_0x3df4('0x25'),_0x17fe03);logger['debug'](_0x3df4('0x25'),_0x17fe03,JSON['stringify'](_0x4e8308));_0x288360(_0x4e8308);})['catch'](function(_0x39dc1e){logger[_0x3df4('0x13')](_0x3df4('0x25'),_0x39dc1e[_0x3df4('0x16')],_0x17fe03);_0x2282ea(_this[_0x3df4('0x13')](0x1f4,_0x39dc1e[_0x3df4('0x16')]));});});};
\ No newline at end of file
index 131da4a..c75a69e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf32=['./faxInteraction.events','save','remove','update','emit','length'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xaf32,0xc6));var _0x2af3=function(_0x2fdbf8,_0x461a51){_0x2fdbf8=_0x2fdbf8-0x0;var _0x5dc976=_0xaf32[_0x2fdbf8];return _0x5dc976;};'use strict';var FaxInteractionEvents=require(_0x2af3('0x0'));var events=[_0x2af3('0x1'),_0x2af3('0x2'),_0x2af3('0x3')];function createListener(_0x24f3bf,_0x199e5e){return function(_0x423af8){_0x199e5e[_0x2af3('0x4')](_0x24f3bf,_0x423af8);};}function removeListener(_0x503ed1,_0x3750f6){return function(){FaxInteractionEvents['removeListener'](_0x503ed1,_0x3750f6);};}exports['register']=function(_0x2bbe1c){for(var _0x3c623b=0x0,_0x397a27=events[_0x2af3('0x5')];_0x3c623b<_0x397a27;_0x3c623b++){var _0x5b9f2c=events[_0x3c623b];var _0x116d7f=createListener('faxInteraction:'+_0x5b9f2c,_0x2bbe1c);FaxInteractionEvents['on'](_0x5b9f2c,_0x116d7f);}};
\ No newline at end of file
+var _0x4571=['emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove','update'];(function(_0x2d8434,_0x43d781){var _0x26b9e4=function(_0x54f5b8){while(--_0x54f5b8){_0x2d8434['push'](_0x2d8434['shift']());}};_0x26b9e4(++_0x43d781);}(_0x4571,0x137));var _0x1457=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x4571[_0x2b5513];return _0x578fd2;};'use strict';var FaxInteractionEvents=require(_0x1457('0x0'));var events=[_0x1457('0x1'),_0x1457('0x2'),_0x1457('0x3')];function createListener(_0x49c172,_0x57c9f6){return function(_0x33dd1c){_0x57c9f6[_0x1457('0x4')](_0x49c172,_0x33dd1c);};}function removeListener(_0x537427,_0xe95062){return function(){FaxInteractionEvents[_0x1457('0x5')](_0x537427,_0xe95062);};}exports[_0x1457('0x6')]=function(_0x21f2d9){for(var _0x33a81d=0x0,_0xba4237=events[_0x1457('0x7')];_0x33a81d<_0xba4237;_0x33a81d++){var _0x342b38=events[_0x33a81d];var _0x45510f=createListener(_0x1457('0x8')+_0x342b38,_0x21f2d9);FaxInteractionEvents['on'](_0x342b38,_0x45510f);}};
\ No newline at end of file
index ebaf7c3..07732fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f24=['index','/describe','/:id','show','getMessages','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','update','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated'];(function(_0x15e0d2,_0x8333c){var _0x45bb73=function(_0x52cb41){while(--_0x52cb41){_0x15e0d2['push'](_0x15e0d2['shift']());}};_0x45bb73(++_0x8333c);}(_0x7f24,0x16a));var _0x47f2=function(_0x3fa813,_0x295ac7){_0x3fa813=_0x3fa813-0x0;var _0x3cbab1=_0x7f24[_0x3fa813];return _0x3cbab1;};'use strict';var multer=require(_0x47f2('0x0'));var util=require('util');var path=require(_0x47f2('0x1'));var timeout=require(_0x47f2('0x2'));var express=require(_0x47f2('0x3'));var router=express['Router']();var fs_extra=require(_0x47f2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x47f2('0x5'));var config=require(_0x47f2('0x6'));var controller=require(_0x47f2('0x7'));router[_0x47f2('0x8')]('/',auth[_0x47f2('0x9')](),controller[_0x47f2('0xa')]);router['get'](_0x47f2('0xb'),auth[_0x47f2('0x9')](),controller['describe']);router['get'](_0x47f2('0xc'),auth[_0x47f2('0x9')](),controller[_0x47f2('0xd')]);router['get']('/:id/messages',auth[_0x47f2('0x9')](),controller[_0x47f2('0xe')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x47f2('0xf')]);router[_0x47f2('0x10')]('/',auth['isAuthenticated'](),controller[_0x47f2('0x11')]);router[_0x47f2('0x10')](_0x47f2('0x12'),auth[_0x47f2('0x9')](),controller[_0x47f2('0x13')]);router[_0x47f2('0x10')](_0x47f2('0x14'),auth['isAuthenticated'](),interaction[_0x47f2('0x15')](_0x47f2('0x16'),_0x47f2('0x17')),controller['addTags']);router[_0x47f2('0x18')]('/:id',auth[_0x47f2('0x9')](),interaction[_0x47f2('0x15')](_0x47f2('0x16'),_0x47f2('0x19')),controller[_0x47f2('0x1a')]);router['delete'](_0x47f2('0xc'),auth[_0x47f2('0x9')](),interaction[_0x47f2('0x15')]('fax','faxinteraction:destroy'),controller[_0x47f2('0x1b')]);router[_0x47f2('0x1c')](_0x47f2('0x14'),auth[_0x47f2('0x9')](),controller[_0x47f2('0x1d')]);module[_0x47f2('0x1e')]=router;
\ No newline at end of file
+var _0xa1aa=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','show','/:id/messages','/:id/download','download','post','create','addMessage','fax','faxinteraction:addtags','addTags','put','/:id','tracked','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags'];(function(_0x52e040,_0x583d2f){var _0x4cd278=function(_0xa844b5){while(--_0xa844b5){_0x52e040['push'](_0x52e040['shift']());}};_0x4cd278(++_0x583d2f);}(_0xa1aa,0x1a1));var _0xaa1a=function(_0x473fc0,_0x6a5f03){_0x473fc0=_0x473fc0-0x0;var _0x1b6256=_0xa1aa[_0x473fc0];return _0x1b6256;};'use strict';var multer=require(_0xaa1a('0x0'));var util=require('util');var path=require(_0xaa1a('0x1'));var timeout=require(_0xaa1a('0x2'));var express=require(_0xaa1a('0x3'));var router=express[_0xaa1a('0x4')]();var fs_extra=require(_0xaa1a('0x5'));var auth=require(_0xaa1a('0x6'));var interaction=require(_0xaa1a('0x7'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0xaa1a('0x8')]('/',auth[_0xaa1a('0x9')](),controller['index']);router[_0xaa1a('0x8')](_0xaa1a('0xa'),auth['isAuthenticated'](),controller[_0xaa1a('0xb')]);router[_0xaa1a('0x8')]('/:id',auth[_0xaa1a('0x9')](),controller[_0xaa1a('0xc')]);router['get'](_0xaa1a('0xd'),auth[_0xaa1a('0x9')](),controller['getMessages']);router[_0xaa1a('0x8')](_0xaa1a('0xe'),auth[_0xaa1a('0x9')](),controller[_0xaa1a('0xf')]);router[_0xaa1a('0x10')]('/',auth[_0xaa1a('0x9')](),controller[_0xaa1a('0x11')]);router[_0xaa1a('0x10')](_0xaa1a('0xd'),auth[_0xaa1a('0x9')](),controller[_0xaa1a('0x12')]);router[_0xaa1a('0x10')]('/:id/tags',auth[_0xaa1a('0x9')](),interaction['tracked'](_0xaa1a('0x13'),_0xaa1a('0x14')),controller[_0xaa1a('0x15')]);router[_0xaa1a('0x16')](_0xaa1a('0x17'),auth[_0xaa1a('0x9')](),interaction[_0xaa1a('0x18')](_0xaa1a('0x13'),_0xaa1a('0x19')),controller[_0xaa1a('0x1a')]);router['delete'](_0xaa1a('0x17'),auth[_0xaa1a('0x9')](),interaction[_0xaa1a('0x18')](_0xaa1a('0x13'),_0xaa1a('0x1b')),controller[_0xaa1a('0x1c')]);router[_0xaa1a('0x1d')]('/:id/tags',auth[_0xaa1a('0x9')](),controller[_0xaa1a('0x1e')]);module[_0xaa1a('0x1f')]=router;
\ No newline at end of file
index 501a5b1..4514428 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['out','TEXT','DATE','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0xfe5672,_0x5546b4){var _0x816a0b=function(_0x13d798){while(--_0x13d798){_0xfe5672['push'](_0xfe5672['shift']());}};_0x816a0b(++_0x5546b4);}(_0xa41a,0x6b));var _0xaa41=function(_0x20c4f7,_0x1f0b6b){_0x20c4f7=_0x20c4f7-0x0;var _0xf20272=_0xa41a[_0x20c4f7];return _0xf20272;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'body':{'type':Sequelize['TEXT'](_0xaa41('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xaa41('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaa41('0x4')]('in',_0xaa41('0x5')),'defaultValue':_0xaa41('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xaa41('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0xaa41('0x7')]}};
\ No newline at end of file
+var _0x19ea=['ENUM','out','sequelize','medium'];(function(_0x292304,_0xa7fa2c){var _0x33a578=function(_0x1c8f2d){while(--_0x1c8f2d){_0x292304['push'](_0x292304['shift']());}};_0x33a578(++_0xa7fa2c);}(_0x19ea,0xfe));var _0xa19e=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x19ea[_0xbb9dbf];return _0x30223c;};'use strict';var Sequelize=require(_0xa19e('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xa19e('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa19e('0x2')]('in',_0xa19e('0x3')),'defaultValue':_0xa19e('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index aa965db..10bd9a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d21=['files','attachments','join','basename','eml-format','zip-dir','fast-json-patch','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/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','client','request','then','request\x20sent','debug','error','code','FaxMessage,\x20%s,\x20%s','message','info','result','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','update','destroy','sendStatus','stack','name','send','index','FaxMessage','fieldName','type','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','include','findAll','rows','show','params','keys','rawAttributes','intersection','length','includeAll','find','body','describe','fax-interactions','accept','fax','read','readAt','format','UserId','get','FaxInteraction','FaxInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','email','internal','agent','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','interaction','rejectMessage','QueryTypes','contact','User','motionChannel','create','CmContact','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','download','root','server'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0x4d21,0x96));var _0x14d2=function(_0x2c5866,_0x521cbc){_0x2c5866=_0x2c5866-0x0;var _0x17a2d0=_0x4d21[_0x2c5866];return _0x17a2d0;};'use strict';var emlformat=require(_0x14d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x14d2('0x1'));var jsonpatch=require(_0x14d2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14d2('0x3'));var Mustache=require('mustache');var util=require(_0x14d2('0x4'));var path=require(_0x14d2('0x5'));var sox=require(_0x14d2('0x6'));var csv=require(_0x14d2('0x7'));var ejs=require(_0x14d2('0x8'));var fs=require('fs');var fs_extra=require(_0x14d2('0x9'));var _=require(_0x14d2('0xa'));var squel=require(_0x14d2('0xb'));var crypto=require(_0x14d2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x14d2('0xd'));var toCsv=require(_0x14d2('0x7'));var querystring=require(_0x14d2('0xe'));var Papa=require(_0x14d2('0xf'));var Redis=require(_0x14d2('0x10'));var authService=require(_0x14d2('0x11'));var qs=require(_0x14d2('0x12'));var as=require(_0x14d2('0x13'));var hardwareService=require(_0x14d2('0x14'));var logger=require(_0x14d2('0x15'))(_0x14d2('0x16'));var utils=require('../../config/utils');var config=require(_0x14d2('0x17'));var licenseUtil=require(_0x14d2('0x18'));var db=require('../../mysqldb')['db'];config[_0x14d2('0x19')]=_['defaults'](config[_0x14d2('0x19')],{'host':_0x14d2('0x1a'),'port':0x18eb});var socket=require(_0x14d2('0x1b'))(new Redis(config['redis']));require(_0x14d2('0x1c'))[_0x14d2('0x1d')](socket);var jayson=require(_0x14d2('0x1e'));var client=jayson['client'][_0x14d2('0x1f')]({'port':0x232c});var client9002=jayson[_0x14d2('0x20')][_0x14d2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1c573f,_0x2c771e,_0x4ac402,_0x256f48){return new BPromise(function(_0x328f7b,_0x3abcaa){var _0x53df6e=_0x256f48||client;return _0x53df6e[_0x14d2('0x21')](_0x1c573f,_0x4ac402)[_0x14d2('0x22')](function(_0x2e55f5){logger['info']('FaxMessage,\x20%s,\x20%s',_0x2c771e,_0x14d2('0x23'));logger[_0x14d2('0x24')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2c771e,_0x14d2('0x23'),JSON['stringify'](_0x2e55f5));if(_0x2e55f5['error']){if(_0x2e55f5[_0x14d2('0x25')][_0x14d2('0x26')]===0x1f4){logger[_0x14d2('0x25')](_0x14d2('0x27'),_0x2c771e,_0x2e55f5['error'][_0x14d2('0x28')]);return _0x3abcaa(_0x2e55f5[_0x14d2('0x25')][_0x14d2('0x28')]);}logger[_0x14d2('0x25')]('FaxMessage,\x20%s,\x20%s',_0x2c771e,_0x2e55f5[_0x14d2('0x25')][_0x14d2('0x28')]);return _0x328f7b(_0x2e55f5['error'][_0x14d2('0x28')]);}else{logger[_0x14d2('0x29')](_0x14d2('0x27'),_0x2c771e,_0x14d2('0x23'));_0x328f7b(_0x2e55f5[_0x14d2('0x2a')][_0x14d2('0x28')]);}})[_0x14d2('0x2b')](function(_0x179720){logger[_0x14d2('0x25')](_0x14d2('0x27'),_0x2c771e,_0x179720);_0x3abcaa(_0x179720);});});}function respondWithStatusCode(_0x43e519,_0x1238c5){_0x1238c5=_0x1238c5||0xcc;return function(_0x16c321){if(_0x16c321){return _0x43e519['sendStatus'](_0x1238c5);}return _0x43e519[_0x14d2('0x2c')](_0x1238c5)[_0x14d2('0x2d')]();};}function respondWithResult(_0x5ea024,_0x2d6de4){_0x2d6de4=_0x2d6de4||0xc8;return function(_0xfe2fa4){if(_0xfe2fa4){return _0x5ea024[_0x14d2('0x2c')](_0x2d6de4)['json'](_0xfe2fa4);}};}function respondWithFilteredResult(_0x510e54,_0x3a36a5){return function(_0x49e8c6){if(_0x49e8c6){var _0x366449=typeof _0x3a36a5[_0x14d2('0x2e')]===_0x14d2('0x2f')&&typeof _0x3a36a5['limit']==='undefined';var _0x3b7d8f=_0x49e8c6[_0x14d2('0x30')];var _0x419645=_0x366449?0x0:_0x3a36a5[_0x14d2('0x2e')];var _0x38637e=_0x366449?_0x49e8c6[_0x14d2('0x30')]:_0x3a36a5['offset']+_0x3a36a5[_0x14d2('0x31')];var _0xebefb2;if(_0x38637e>=_0x3b7d8f){_0x38637e=_0x3b7d8f;_0xebefb2=0xc8;}else{_0xebefb2=0xce;}_0x510e54[_0x14d2('0x2c')](_0xebefb2);return _0x510e54[_0x14d2('0x32')](_0x14d2('0x33'),_0x419645+'-'+_0x38637e+'/'+_0x3b7d8f)[_0x14d2('0x34')](_0x49e8c6);}return null;};}function patchUpdates(_0xc3fac2){return function(_0x71cbab){try{jsonpatch['apply'](_0x71cbab,_0xc3fac2,!![]);}catch(_0x2bb382){return BPromise[_0x14d2('0x35')](_0x2bb382);}return _0x71cbab['save']();};}function saveUpdates(_0x1ca78c,_0x2925b2){return function(_0x289958){if(_0x289958){return _0x289958[_0x14d2('0x36')](_0x1ca78c)['then'](function(_0xdeac8){return _0xdeac8;});}return null;};}function removeEntity(_0x187f8b,_0x174d9c){return function(_0x501870){if(_0x501870){return _0x501870[_0x14d2('0x37')]()[_0x14d2('0x22')](function(){_0x187f8b[_0x14d2('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f2dde,_0x42b8d8){return function(_0x537697){if(!_0x537697){_0x2f2dde[_0x14d2('0x38')](0x194);}return _0x537697;};}function handleError(_0x5b109e,_0x185b1b){_0x185b1b=_0x185b1b||0x1f4;return function(_0x1ecdad){logger['error'](_0x1ecdad[_0x14d2('0x39')]);if(_0x1ecdad[_0x14d2('0x3a')]){delete _0x1ecdad[_0x14d2('0x3a')];}_0x5b109e[_0x14d2('0x2c')](_0x185b1b)[_0x14d2('0x3b')](_0x1ecdad);};}exports[_0x14d2('0x3c')]=function(_0x28ac36,_0x240882){var _0x1ecd44={},_0x15baca={},_0x36e56c={'count':0x0,'rows':[]};var _0x27dd31=_['map'](db[_0x14d2('0x3d')]['rawAttributes'],function(_0x57a3b8){return{'name':_0x57a3b8[_0x14d2('0x3e')],'type':_0x57a3b8[_0x14d2('0x3f')]['key']};});_0x15baca[_0x14d2('0x40')]=_['map'](_0x27dd31,_0x14d2('0x3a'));_0x15baca[_0x14d2('0x41')]=_['keys'](_0x28ac36[_0x14d2('0x41')]);_0x15baca[_0x14d2('0x42')]=_['intersection'](_0x15baca[_0x14d2('0x40')],_0x15baca[_0x14d2('0x41')]);_0x1ecd44[_0x14d2('0x43')]=_['intersection'](_0x15baca[_0x14d2('0x40')],qs[_0x14d2('0x44')](_0x28ac36['query'][_0x14d2('0x44')]));_0x1ecd44['attributes']=_0x1ecd44[_0x14d2('0x43')]['length']?_0x1ecd44[_0x14d2('0x43')]:_0x15baca[_0x14d2('0x40')];if(!_0x28ac36[_0x14d2('0x41')][_0x14d2('0x45')](_0x14d2('0x46'))){_0x1ecd44[_0x14d2('0x31')]=qs[_0x14d2('0x31')](_0x28ac36[_0x14d2('0x41')]['limit']);_0x1ecd44[_0x14d2('0x2e')]=qs[_0x14d2('0x2e')](_0x28ac36['query'][_0x14d2('0x2e')]);}_0x1ecd44[_0x14d2('0x47')]=qs[_0x14d2('0x48')](_0x28ac36[_0x14d2('0x41')]['sort']);_0x1ecd44[_0x14d2('0x49')]=qs['filters'](_['pick'](_0x28ac36[_0x14d2('0x41')],_0x15baca[_0x14d2('0x42')]),_0x27dd31);if(_0x28ac36[_0x14d2('0x41')][_0x14d2('0x4a')]){_0x1ecd44[_0x14d2('0x49')]=_[_0x14d2('0x4b')](_0x1ecd44[_0x14d2('0x49')],{'$or':_[_0x14d2('0x4c')](_0x27dd31,function(_0x5dee87){if(_0x5dee87[_0x14d2('0x3f')]!==_0x14d2('0x4d')){var _0xb4a2cc={};_0xb4a2cc[_0x5dee87[_0x14d2('0x3a')]]={'$like':'%'+_0x28ac36[_0x14d2('0x41')][_0x14d2('0x4a')]+'%'};return _0xb4a2cc;}})});}_0x1ecd44=_[_0x14d2('0x4b')]({},_0x1ecd44,_0x28ac36[_0x14d2('0x4e')]);var _0x4f1833={'where':_0x1ecd44['where']};return db[_0x14d2('0x3d')]['count'](_0x4f1833)[_0x14d2('0x22')](function(_0x6c4dc){_0x36e56c[_0x14d2('0x30')]=_0x6c4dc;if(_0x28ac36[_0x14d2('0x41')]['includeAll']){_0x1ecd44[_0x14d2('0x4f')]=[{'all':!![]}];}return db[_0x14d2('0x3d')][_0x14d2('0x50')](_0x1ecd44);})['then'](function(_0x171793){_0x36e56c[_0x14d2('0x51')]=_0x171793;return _0x36e56c;})[_0x14d2('0x22')](respondWithFilteredResult(_0x240882,_0x1ecd44))[_0x14d2('0x2b')](handleError(_0x240882,null));};exports[_0x14d2('0x52')]=function(_0x530ec0,_0x316c46){var _0x257f05={'raw':!![],'where':{'id':_0x530ec0[_0x14d2('0x53')]['id']}},_0x520c31={};_0x520c31['model']=_[_0x14d2('0x54')](db['FaxMessage'][_0x14d2('0x55')]);_0x520c31['query']=_[_0x14d2('0x54')](_0x530ec0[_0x14d2('0x41')]);_0x520c31['filters']=_['intersection'](_0x520c31[_0x14d2('0x40')],_0x520c31[_0x14d2('0x41')]);_0x257f05[_0x14d2('0x43')]=_[_0x14d2('0x56')](_0x520c31['model'],qs['fields'](_0x530ec0[_0x14d2('0x41')][_0x14d2('0x44')]));_0x257f05[_0x14d2('0x43')]=_0x257f05['attributes'][_0x14d2('0x57')]?_0x257f05[_0x14d2('0x43')]:_0x520c31[_0x14d2('0x40')];if(_0x530ec0[_0x14d2('0x41')][_0x14d2('0x58')]){_0x257f05[_0x14d2('0x4f')]=[{'all':!![]}];}_0x257f05=_[_0x14d2('0x4b')]({},_0x257f05,_0x530ec0[_0x14d2('0x4e')]);return db['FaxMessage'][_0x14d2('0x59')](_0x257f05)[_0x14d2('0x22')](handleEntityNotFound(_0x316c46,null))[_0x14d2('0x22')](respondWithResult(_0x316c46,null))['catch'](handleError(_0x316c46,null));};exports[_0x14d2('0x36')]=function(_0x3482d7,_0xb4df38){if(_0x3482d7['body']['id']){delete _0x3482d7[_0x14d2('0x5a')]['id'];}return db[_0x14d2('0x3d')][_0x14d2('0x59')]({'where':{'id':_0x3482d7[_0x14d2('0x53')]['id']}})[_0x14d2('0x22')](handleEntityNotFound(_0xb4df38,null))[_0x14d2('0x22')](saveUpdates(_0x3482d7['body'],null))[_0x14d2('0x22')](respondWithResult(_0xb4df38,null))['catch'](handleError(_0xb4df38,null));};exports['destroy']=function(_0x1f9f35,_0x3e9b){return db[_0x14d2('0x3d')]['find']({'where':{'id':_0x1f9f35['params']['id']}})[_0x14d2('0x22')](handleEntityNotFound(_0x3e9b,null))[_0x14d2('0x22')](removeEntity(_0x3e9b,null))[_0x14d2('0x2b')](handleError(_0x3e9b,null));};exports[_0x14d2('0x5b')]=function(_0x4ba8cc,_0x99a633){return db[_0x14d2('0x3d')][_0x14d2('0x5b')]()[_0x14d2('0x22')](respondWithResult(_0x99a633,null))[_0x14d2('0x2b')](handleError(_0x99a633,null));};var interaction_log=require(_0x14d2('0x15'))(_0x14d2('0x5c'));exports[_0x14d2('0x5d')]=function(_0x4d3c00,_0x5c261e,_0xdb4c0d){var _0x13c8ec={'agent':{},'channel':_0x14d2('0x5e')};if(_0x4d3c00['body']['id']){delete _0x4d3c00[_0x14d2('0x5a')]['id'];}_0x4d3c00[_0x14d2('0x5a')][_0x14d2('0x5f')]=!![];_0x4d3c00[_0x14d2('0x5a')][_0x14d2('0x60')]=moment()[_0x14d2('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x4d3c00[_0x14d2('0x5a')][_0x14d2('0x62')]=_0x4d3c00['body'][_0x14d2('0x62')]||_0x4d3c00['user']['id'];_0x13c8ec['agent']['id']=_0x4d3c00[_0x14d2('0x5a')][_0x14d2('0x62')];return db[_0x14d2('0x3d')][_0x14d2('0x59')]({'where':{'id':_0x4d3c00['params']['id'],'UserId':null}})[_0x14d2('0x22')](handleEntityNotFound(_0x5c261e,null))['then'](saveUpdates(_0x4d3c00[_0x14d2('0x5a')],null))[_0x14d2('0x22')](function(_0x1b114f){if(_0x1b114f){_0x13c8ec[_0x14d2('0x28')]=_0x1b114f[_0x14d2('0x63')]({'plain':!![]});return db[_0x14d2('0x64')]['find']({'where':{'id':_0x1b114f[_0x14d2('0x65')]}});}return null;})[_0x14d2('0x22')](handleEntityNotFound(_0x5c261e,null))['then'](function(_0x7e1915){if(_0x7e1915){return _0x7e1915['update']({'UserId':_0x4d3c00[_0x14d2('0x5a')]['UserId'],'read1stAt':_['isNil'](_0x7e1915[_0x14d2('0x66')])?moment()[_0x14d2('0x61')](_0x14d2('0x67')):undefined});}return null;})['then'](function(_0x8024ae){if(_0x8024ae){_0x13c8ec['interaction']=_0x8024ae[_0x14d2('0x63')]({'plain':!![]});interaction_log[_0x14d2('0x29')](_0x14d2('0x68'),_0x4d3c00[_0x14d2('0x69')]['id'],_0x4d3c00['user'][_0x14d2('0x3a')],_0x4d3c00[_0x14d2('0x69')]['role'],_0x13c8ec['interaction']['id'],_0x4d3c00[_0x14d2('0x5a')]?JSON[_0x14d2('0x6a')](_0x4d3c00[_0x14d2('0x5a')]):_0x14d2('0x6b'));return respondWithRpcPromise(_0x14d2('0x6c'),_0x14d2('0x6d'),_0x13c8ec);}return null;})[_0x14d2('0x22')](function(_0x449d2f){var _0x24d26c=_0x14d2('0x6e')+_0x449d2f[_0x14d2('0x28')][_0x14d2('0x6f')];return db[_0x14d2('0x70')][_0x14d2('0x41')](_0x24d26c,{'type':db[_0x14d2('0x71')]['QueryTypes'][_0x14d2('0x72')],'raw':!![]})['then'](function(_0x4adbb1){return _0x4adbb1;});})[_0x14d2('0x22')](function(_0x188a13){if(_0x188a13){_0x13c8ec[_0x14d2('0x28')]['contact']=_0x188a13[0x0];if(!_0x4d3c00['body'][_0x14d2('0x62')])return;return db['User']['find']({'where':{'id':_0x4d3c00[_0x14d2('0x5a')]['UserId'],'role':'agent'},'attributes':['id','name','fullname',_0x14d2('0x73'),_0x14d2('0x74')],'raw':!![]});}return null;})['then'](function(_0x267b06){if(!_0x267b06)return null;_0x13c8ec[_0x14d2('0x28')][_0x14d2('0x75')]=_0x267b06;return _0x13c8ec;})[_0x14d2('0x22')](function(_0x2a20f3){if(_0x2a20f3){if(_0x4d3c00[_0x14d2('0x5a')][_0x14d2('0x76')]){_0x13c8ec[_0x14d2('0x28')][_0x14d2('0x77')]=util[_0x14d2('0x61')](_0x14d2('0x78'),_0x4d3c00[_0x14d2('0x69')][_0x14d2('0x3a')]);_0x13c8ec[_0x14d2('0x28')]['channel']=_0x13c8ec[_0x14d2('0x79')];_0x13c8ec['message']['motionChannel']=_0x13c8ec['channel'];_0x13c8ec[_0x14d2('0x28')][_0x14d2('0x7a')]=_0x14d2('0x5d');return respondWithRpcPromise(_0x14d2('0x7b'),'EventManager',{'event':_0x14d2('0x7c'),'message':_0x13c8ec['message']},client9002)[_0x14d2('0x22')](function(){return _0x13c8ec;});}return _0x13c8ec;}return null;})[_0x14d2('0x22')](respondWithResult(_0x5c261e,null))['catch'](handleError(_0x5c261e,null));};var interaction_log=require(_0x14d2('0x15'))(_0x14d2('0x5c'));exports[_0x14d2('0x35')]=function(_0x58b5be,_0x23b2b8,_0x3c23f4){var _0x2fff2e={'agent':{},'channel':'fax'};if(_0x58b5be['body']['id']){delete _0x58b5be['body']['id'];}_0x58b5be[_0x14d2('0x5a')][_0x14d2('0x62')]=_0x58b5be[_0x14d2('0x5a')]['UserId']||_0x58b5be['user']['id'];_0x2fff2e[_0x14d2('0x75')]['id']=_0x58b5be[_0x14d2('0x5a')]['UserId'];return db['FaxMessage'][_0x14d2('0x59')]({'where':{'id':_0x58b5be[_0x14d2('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x23b2b8,null))[_0x14d2('0x22')](function(_0x31efe7){if(_0x31efe7){_0x2fff2e[_0x14d2('0x28')]=_0x31efe7[_0x14d2('0x63')]({'plain':!![]});return db['FaxInteraction'][_0x14d2('0x59')]({'where':{'id':_0x31efe7[_0x14d2('0x65')]}});}return null;})[_0x14d2('0x22')](handleEntityNotFound(_0x23b2b8,null))['then'](function(_0x36531c){if(_0x36531c){_0x2fff2e[_0x14d2('0x7d')]=_0x36531c[_0x14d2('0x63')]({'plain':!![]});interaction_log[_0x14d2('0x29')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x58b5be[_0x14d2('0x69')]['id'],_0x58b5be['user'][_0x14d2('0x3a')],_0x58b5be[_0x14d2('0x69')]['role'],_0x2fff2e['interaction']['id'],_0x58b5be[_0x14d2('0x5a')]?JSON[_0x14d2('0x6a')](_0x58b5be[_0x14d2('0x5a')]):_0x14d2('0x6b'));return respondWithRpcPromise('RejectMessage',_0x14d2('0x7e'),_0x2fff2e);}return null;})[_0x14d2('0x22')](function(_0x24ecd7){var _0x4ed4b3=_0x14d2('0x6e')+_0x24ecd7[_0x14d2('0x28')][_0x14d2('0x6f')];return db['sequelize']['query'](_0x4ed4b3,{'type':db[_0x14d2('0x71')][_0x14d2('0x7f')][_0x14d2('0x72')],'raw':!![]})[_0x14d2('0x22')](function(_0x3165b2){return _0x3165b2;});})[_0x14d2('0x22')](function(_0x5056f7){if(_0x5056f7){_0x2fff2e[_0x14d2('0x28')][_0x14d2('0x80')]=_0x5056f7[0x0];if(!_0x58b5be[_0x14d2('0x5a')][_0x14d2('0x62')])return;return db[_0x14d2('0x81')][_0x14d2('0x59')]({'where':{'id':_0x58b5be['body'][_0x14d2('0x62')],'role':'agent'},'attributes':['id',_0x14d2('0x3a'),'fullname',_0x14d2('0x73'),'internal'],'raw':!![]});}return null;})[_0x14d2('0x22')](function(_0xf87de){if(!_0xf87de)return null;_0x2fff2e[_0x14d2('0x28')]['agent']=_0xf87de;return _0x2fff2e;})[_0x14d2('0x22')](function(_0x5cb01a){if(_0x5cb01a){_0x5cb01a[_0x14d2('0x28')]['interface']=util[_0x14d2('0x61')]('SIP/%s',_0x58b5be[_0x14d2('0x69')][_0x14d2('0x3a')]);_0x5cb01a[_0x14d2('0x28')][_0x14d2('0x79')]=_0x2fff2e[_0x14d2('0x79')];_0x5cb01a[_0x14d2('0x28')][_0x14d2('0x82')]=_0x2fff2e[_0x14d2('0x79')];_0x5cb01a[_0x14d2('0x28')]['event']=_0x14d2('0x35');respondWithRpcPromise(_0x14d2('0x7b'),_0x14d2('0x7b'),{'event':'rejectmessage','message':_0x5cb01a[_0x14d2('0x28')]},client9002);return _0x2fff2e;}return null;})[_0x14d2('0x22')](respondWithResult(_0x23b2b8,null))[_0x14d2('0x2b')](handleError(_0x23b2b8,null));};exports['create']=function(_0x39a1af,_0x574116){var _0x51ff89;return db[_0x14d2('0x3d')][_0x14d2('0x83')](_0x39a1af[_0x14d2('0x5a')],{})[_0x14d2('0x22')](function(_0x3971d2){_0x51ff89=_0x3971d2;return db[_0x14d2('0x84')][_0x14d2('0x85')]({'where':{'id':_0x51ff89[_0x14d2('0x6f')]}});})[_0x14d2('0x22')](function(_0xa319d2){if(_[_0x14d2('0x86')](_0xa319d2)){return;}else{_0x51ff89[_0x14d2('0x5e')]=_0xa319d2[_0x14d2('0x5e')];return db[_0x14d2('0x87')][_0x14d2('0x85')]({'where':{'id':_0x51ff89[_0x14d2('0x88')]}});}})['then'](function(_0x4d59ee){return respondWithRpcPromise(_0x14d2('0x89'),_0x14d2('0x89'),{'FaxAccountId':_['isNil'](_0x39a1af['body'])?undefined:_0x39a1af['body'][_0x14d2('0x8a')],'path':_[_0x14d2('0x86')](_0x4d59ee)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x4d59ee['basename']),'fax':_[_0x14d2('0x86')](_0x51ff89['fax'])?undefined:_0x51ff89[_0x14d2('0x5e')],'AttachmentId':_0x51ff89[_0x14d2('0x88')]},client9002);})[_0x14d2('0x22')](respondWithResult(_0x574116,0xc9))['catch'](handleError(_0x574116,null));};exports[_0x14d2('0x8b')]=function(_0x2611c0,_0x31f921){var _0x2fddd1=path['join'](config[_0x14d2('0x8c')],_0x14d2('0x8d'),_0x14d2('0x8e'),_0x14d2('0x8f'));return db['FaxMessage'][_0x14d2('0x59')]({'where':{'id':_0x2611c0[_0x14d2('0x53')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x14d2('0x22')](handleEntityNotFound(_0x31f921,null))[_0x14d2('0x22')](function(_0xdf0875){if(_0xdf0875){return _0x31f921[_0x14d2('0x8b')](path[_0x14d2('0x90')](_0x2fddd1,_0xdf0875[_0x14d2('0x87')][_0x14d2('0x91')]));}})[_0x14d2('0x2b')](handleError(_0x31f921,null));};
\ No newline at end of file
+var _0x90f8=['moment','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','end','name','send','index','map','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxMessage','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','include','find','body','destroy','describe','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','interaction','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','contact','fullname','rejectmessage','create','CmContact','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','Attachment','download','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x90f8,0x1a3));var _0x890f=function(_0xf3ac69,_0x372da8){_0xf3ac69=_0xf3ac69-0x0;var _0x24b134=_0x90f8[_0xf3ac69];return _0x24b134;};'use strict';var emlformat=require(_0x890f('0x0'));var rimraf=require(_0x890f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x890f('0x2'));var rp=require(_0x890f('0x3'));var moment=require(_0x890f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x890f('0x5'));var util=require('util');var path=require(_0x890f('0x6'));var sox=require(_0x890f('0x7'));var csv=require(_0x890f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x890f('0x9'));var squel=require('squel');var crypto=require(_0x890f('0xa'));var jsforce=require(_0x890f('0xb'));var deskjs=require(_0x890f('0xc'));var toCsv=require(_0x890f('0x8'));var querystring=require(_0x890f('0xd'));var Papa=require('papaparse');var Redis=require(_0x890f('0xe'));var authService=require(_0x890f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x890f('0x10'));var hardwareService=require(_0x890f('0x11'));var logger=require(_0x890f('0x12'))('api');var utils=require(_0x890f('0x13'));var config=require(_0x890f('0x14'));var licenseUtil=require(_0x890f('0x15'));var db=require(_0x890f('0x16'))['db'];config[_0x890f('0x17')]=_[_0x890f('0x18')](config[_0x890f('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x890f('0x19'))(new Redis(config[_0x890f('0x17')]));require(_0x890f('0x1a'))[_0x890f('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x890f('0x1c')][_0x890f('0x1d')]({'port':0x232c});var client9002=jayson[_0x890f('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x514afc,_0x36a9b2,_0xc3141c,_0x3cbec6){return new BPromise(function(_0x22c445,_0x47b947){var _0x3efa7b=_0x3cbec6||client;return _0x3efa7b[_0x890f('0x1e')](_0x514afc,_0xc3141c)[_0x890f('0x1f')](function(_0x5d2d2c){logger[_0x890f('0x20')](_0x890f('0x21'),_0x36a9b2,_0x890f('0x22'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x36a9b2,_0x890f('0x22'),JSON[_0x890f('0x23')](_0x5d2d2c));if(_0x5d2d2c[_0x890f('0x24')]){if(_0x5d2d2c[_0x890f('0x24')][_0x890f('0x25')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x36a9b2,_0x5d2d2c['error'][_0x890f('0x26')]);return _0x47b947(_0x5d2d2c['error']['message']);}logger[_0x890f('0x24')](_0x890f('0x21'),_0x36a9b2,_0x5d2d2c[_0x890f('0x24')][_0x890f('0x26')]);return _0x22c445(_0x5d2d2c[_0x890f('0x24')]['message']);}else{logger['info'](_0x890f('0x21'),_0x36a9b2,_0x890f('0x22'));_0x22c445(_0x5d2d2c[_0x890f('0x27')][_0x890f('0x26')]);}})['catch'](function(_0x18537d){logger['error'](_0x890f('0x21'),_0x36a9b2,_0x18537d);_0x47b947(_0x18537d);});});}function respondWithStatusCode(_0x12dc5e,_0x3cdacc){_0x3cdacc=_0x3cdacc||0xcc;return function(_0x2357c9){if(_0x2357c9){return _0x12dc5e[_0x890f('0x28')](_0x3cdacc);}return _0x12dc5e[_0x890f('0x29')](_0x3cdacc)['end']();};}function respondWithResult(_0x145776,_0x2ce69a){_0x2ce69a=_0x2ce69a||0xc8;return function(_0x942413){if(_0x942413){return _0x145776[_0x890f('0x29')](_0x2ce69a)[_0x890f('0x2a')](_0x942413);}};}function respondWithFilteredResult(_0x39b10f,_0x1c8e1c){return function(_0x5b9025){if(_0x5b9025){var _0x4ed759=typeof _0x1c8e1c[_0x890f('0x2b')]===_0x890f('0x2c')&&typeof _0x1c8e1c[_0x890f('0x2d')]===_0x890f('0x2c');var _0x44e8bc=_0x5b9025['count'];var _0xa5e2d1=_0x4ed759?0x0:_0x1c8e1c['offset'];var _0x292d58=_0x4ed759?_0x5b9025[_0x890f('0x2e')]:_0x1c8e1c['offset']+_0x1c8e1c[_0x890f('0x2d')];var _0x468139;if(_0x292d58>=_0x44e8bc){_0x292d58=_0x44e8bc;_0x468139=0xc8;}else{_0x468139=0xce;}_0x39b10f[_0x890f('0x29')](_0x468139);return _0x39b10f[_0x890f('0x2f')](_0x890f('0x30'),_0xa5e2d1+'-'+_0x292d58+'/'+_0x44e8bc)['json'](_0x5b9025);}return null;};}function patchUpdates(_0x3a1cf2){return function(_0x42b861){try{jsonpatch[_0x890f('0x31')](_0x42b861,_0x3a1cf2,!![]);}catch(_0x9bb23e){return BPromise[_0x890f('0x32')](_0x9bb23e);}return _0x42b861[_0x890f('0x33')]();};}function saveUpdates(_0x5517b3,_0x11f041){return function(_0x140fe5){if(_0x140fe5){return _0x140fe5[_0x890f('0x34')](_0x5517b3)[_0x890f('0x1f')](function(_0x42cf08){return _0x42cf08;});}return null;};}function removeEntity(_0x1ba207,_0x20bb28){return function(_0x49756f){if(_0x49756f){return _0x49756f['destroy']()['then'](function(){_0x1ba207[_0x890f('0x29')](0xcc)[_0x890f('0x35')]();});}};}function handleEntityNotFound(_0x194f55,_0x5290){return function(_0x3a5c4e){if(!_0x3a5c4e){_0x194f55[_0x890f('0x28')](0x194);}return _0x3a5c4e;};}function handleError(_0x508f6d,_0x242a05){_0x242a05=_0x242a05||0x1f4;return function(_0x13cca1){logger['error'](_0x13cca1['stack']);if(_0x13cca1[_0x890f('0x36')]){delete _0x13cca1[_0x890f('0x36')];}_0x508f6d[_0x890f('0x29')](_0x242a05)[_0x890f('0x37')](_0x13cca1);};}exports[_0x890f('0x38')]=function(_0x8ec57f,_0x4a9e2a){var _0x26fe31={},_0x53c04c={},_0x50a899={'count':0x0,'rows':[]};var _0x45fe08=_[_0x890f('0x39')](db['FaxMessage']['rawAttributes'],function(_0x4549ee){return{'name':_0x4549ee['fieldName'],'type':_0x4549ee[_0x890f('0x3a')][_0x890f('0x3b')]};});_0x53c04c[_0x890f('0x3c')]=_[_0x890f('0x39')](_0x45fe08,_0x890f('0x36'));_0x53c04c[_0x890f('0x3d')]=_['keys'](_0x8ec57f['query']);_0x53c04c[_0x890f('0x3e')]=_['intersection'](_0x53c04c['model'],_0x53c04c[_0x890f('0x3d')]);_0x26fe31[_0x890f('0x3f')]=_[_0x890f('0x40')](_0x53c04c[_0x890f('0x3c')],qs[_0x890f('0x41')](_0x8ec57f[_0x890f('0x3d')][_0x890f('0x41')]));_0x26fe31[_0x890f('0x3f')]=_0x26fe31['attributes'][_0x890f('0x42')]?_0x26fe31[_0x890f('0x3f')]:_0x53c04c[_0x890f('0x3c')];if(!_0x8ec57f[_0x890f('0x3d')][_0x890f('0x43')](_0x890f('0x44'))){_0x26fe31['limit']=qs[_0x890f('0x2d')](_0x8ec57f[_0x890f('0x3d')]['limit']);_0x26fe31['offset']=qs['offset'](_0x8ec57f[_0x890f('0x3d')][_0x890f('0x2b')]);}_0x26fe31[_0x890f('0x45')]=qs[_0x890f('0x46')](_0x8ec57f['query'][_0x890f('0x46')]);_0x26fe31[_0x890f('0x47')]=qs['filters'](_[_0x890f('0x48')](_0x8ec57f[_0x890f('0x3d')],_0x53c04c[_0x890f('0x3e')]),_0x45fe08);if(_0x8ec57f[_0x890f('0x3d')][_0x890f('0x49')]){_0x26fe31[_0x890f('0x47')]=_[_0x890f('0x4a')](_0x26fe31[_0x890f('0x47')],{'$or':_[_0x890f('0x39')](_0x45fe08,function(_0x65f103){if(_0x65f103['type']!==_0x890f('0x4b')){var _0x5c344e={};_0x5c344e[_0x65f103[_0x890f('0x36')]]={'$like':'%'+_0x8ec57f['query'][_0x890f('0x49')]+'%'};return _0x5c344e;}})});}_0x26fe31=_[_0x890f('0x4a')]({},_0x26fe31,_0x8ec57f[_0x890f('0x4c')]);var _0x410c8d={'where':_0x26fe31[_0x890f('0x47')]};return db[_0x890f('0x4d')][_0x890f('0x2e')](_0x410c8d)['then'](function(_0x2a1201){_0x50a899[_0x890f('0x2e')]=_0x2a1201;if(_0x8ec57f[_0x890f('0x3d')][_0x890f('0x4e')]){_0x26fe31['include']=[{'all':!![]}];}return db[_0x890f('0x4d')][_0x890f('0x4f')](_0x26fe31);})[_0x890f('0x1f')](function(_0x12bac6){_0x50a899[_0x890f('0x50')]=_0x12bac6;return _0x50a899;})[_0x890f('0x1f')](respondWithFilteredResult(_0x4a9e2a,_0x26fe31))[_0x890f('0x51')](handleError(_0x4a9e2a,null));};exports[_0x890f('0x52')]=function(_0x2cdd31,_0x1cb342){var _0xc50154={'raw':!![],'where':{'id':_0x2cdd31[_0x890f('0x53')]['id']}},_0x1242f0={};_0x1242f0[_0x890f('0x3c')]=_['keys'](db[_0x890f('0x4d')][_0x890f('0x54')]);_0x1242f0[_0x890f('0x3d')]=_[_0x890f('0x55')](_0x2cdd31[_0x890f('0x3d')]);_0x1242f0['filters']=_[_0x890f('0x40')](_0x1242f0[_0x890f('0x3c')],_0x1242f0[_0x890f('0x3d')]);_0xc50154[_0x890f('0x3f')]=_[_0x890f('0x40')](_0x1242f0[_0x890f('0x3c')],qs['fields'](_0x2cdd31[_0x890f('0x3d')]['fields']));_0xc50154[_0x890f('0x3f')]=_0xc50154[_0x890f('0x3f')]['length']?_0xc50154[_0x890f('0x3f')]:_0x1242f0[_0x890f('0x3c')];if(_0x2cdd31[_0x890f('0x3d')][_0x890f('0x4e')]){_0xc50154[_0x890f('0x56')]=[{'all':!![]}];}_0xc50154=_[_0x890f('0x4a')]({},_0xc50154,_0x2cdd31[_0x890f('0x4c')]);return db['FaxMessage'][_0x890f('0x57')](_0xc50154)[_0x890f('0x1f')](handleEntityNotFound(_0x1cb342,null))[_0x890f('0x1f')](respondWithResult(_0x1cb342,null))[_0x890f('0x51')](handleError(_0x1cb342,null));};exports[_0x890f('0x34')]=function(_0x197414,_0x2191d8){if(_0x197414['body']['id']){delete _0x197414[_0x890f('0x58')]['id'];}return db[_0x890f('0x4d')][_0x890f('0x57')]({'where':{'id':_0x197414[_0x890f('0x53')]['id']}})[_0x890f('0x1f')](handleEntityNotFound(_0x2191d8,null))[_0x890f('0x1f')](saveUpdates(_0x197414[_0x890f('0x58')],null))['then'](respondWithResult(_0x2191d8,null))[_0x890f('0x51')](handleError(_0x2191d8,null));};exports[_0x890f('0x59')]=function(_0x4d8c38,_0x9186e1){return db['FaxMessage'][_0x890f('0x57')]({'where':{'id':_0x4d8c38[_0x890f('0x53')]['id']}})[_0x890f('0x1f')](handleEntityNotFound(_0x9186e1,null))[_0x890f('0x1f')](removeEntity(_0x9186e1,null))[_0x890f('0x51')](handleError(_0x9186e1,null));};exports[_0x890f('0x5a')]=function(_0x44c29f,_0x37c75a){return db['FaxMessage'][_0x890f('0x5a')]()[_0x890f('0x1f')](respondWithResult(_0x37c75a,null))[_0x890f('0x51')](handleError(_0x37c75a,null));};var interaction_log=require('../../config/logger')(_0x890f('0x5b'));exports['accept']=function(_0x4acdb5,_0x26b2e2,_0x3c735f){var _0x5e6e4c={'agent':{},'channel':_0x890f('0x5c')};if(_0x4acdb5[_0x890f('0x58')]['id']){delete _0x4acdb5['body']['id'];}_0x4acdb5[_0x890f('0x58')][_0x890f('0x5d')]=!![];_0x4acdb5['body'][_0x890f('0x5e')]=moment()[_0x890f('0x5f')](_0x890f('0x60'));_0x4acdb5[_0x890f('0x58')]['UserId']=_0x4acdb5[_0x890f('0x58')][_0x890f('0x61')]||_0x4acdb5[_0x890f('0x62')]['id'];_0x5e6e4c[_0x890f('0x63')]['id']=_0x4acdb5[_0x890f('0x58')][_0x890f('0x61')];return db['FaxMessage']['find']({'where':{'id':_0x4acdb5['params']['id'],'UserId':null}})[_0x890f('0x1f')](handleEntityNotFound(_0x26b2e2,null))[_0x890f('0x1f')](saveUpdates(_0x4acdb5[_0x890f('0x58')],null))[_0x890f('0x1f')](function(_0x1c0c8e){if(_0x1c0c8e){_0x5e6e4c[_0x890f('0x26')]=_0x1c0c8e[_0x890f('0x64')]({'plain':!![]});return db[_0x890f('0x65')][_0x890f('0x57')]({'where':{'id':_0x1c0c8e[_0x890f('0x66')]}});}return null;})[_0x890f('0x1f')](handleEntityNotFound(_0x26b2e2,null))[_0x890f('0x1f')](function(_0x21077f){if(_0x21077f){return _0x21077f[_0x890f('0x34')]({'UserId':_0x4acdb5[_0x890f('0x58')][_0x890f('0x61')],'read1stAt':_[_0x890f('0x67')](_0x21077f['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x890f('0x1f')](function(_0x3f60a9){if(_0x3f60a9){_0x5e6e4c[_0x890f('0x68')]=_0x3f60a9['get']({'plain':!![]});interaction_log[_0x890f('0x20')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4acdb5['user']['id'],_0x4acdb5[_0x890f('0x62')]['name'],_0x4acdb5[_0x890f('0x62')][_0x890f('0x69')],_0x5e6e4c[_0x890f('0x68')]['id'],_0x4acdb5[_0x890f('0x58')]?JSON[_0x890f('0x23')](_0x4acdb5['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x890f('0x6a'),_0x5e6e4c);}return null;})[_0x890f('0x1f')](function(_0x23b4dd){var _0x151018=_0x890f('0x6b')+_0x23b4dd['message'][_0x890f('0x6c')];return db[_0x890f('0x6d')]['query'](_0x151018,{'type':db[_0x890f('0x6e')][_0x890f('0x6f')][_0x890f('0x70')],'raw':!![]})[_0x890f('0x1f')](function(_0x540319){return _0x540319;});})[_0x890f('0x1f')](function(_0x484069){if(_0x484069){_0x5e6e4c['message']['contact']=_0x484069[0x0];if(!_0x4acdb5[_0x890f('0x58')][_0x890f('0x61')])return;return db['User'][_0x890f('0x57')]({'where':{'id':_0x4acdb5[_0x890f('0x58')]['UserId'],'role':_0x890f('0x63')},'attributes':['id','name','fullname',_0x890f('0x71'),_0x890f('0x72')],'raw':!![]});}return null;})['then'](function(_0x3fed34){if(!_0x3fed34)return null;_0x5e6e4c[_0x890f('0x26')][_0x890f('0x63')]=_0x3fed34;return _0x5e6e4c;})['then'](function(_0x200473){if(_0x200473){if(_0x4acdb5[_0x890f('0x58')]['manual']){_0x5e6e4c['message'][_0x890f('0x73')]=util[_0x890f('0x5f')](_0x890f('0x74'),_0x4acdb5[_0x890f('0x62')][_0x890f('0x36')]);_0x5e6e4c['message']['channel']=_0x5e6e4c[_0x890f('0x75')];_0x5e6e4c[_0x890f('0x26')][_0x890f('0x76')]=_0x5e6e4c[_0x890f('0x75')];_0x5e6e4c[_0x890f('0x26')][_0x890f('0x77')]=_0x890f('0x78');return respondWithRpcPromise(_0x890f('0x79'),_0x890f('0x79'),{'event':_0x890f('0x7a'),'message':_0x5e6e4c['message']},client9002)[_0x890f('0x1f')](function(){return _0x5e6e4c;});}return _0x5e6e4c;}return null;})[_0x890f('0x1f')](respondWithResult(_0x26b2e2,null))[_0x890f('0x51')](handleError(_0x26b2e2,null));};var interaction_log=require('../../config/logger')(_0x890f('0x5b'));exports['reject']=function(_0x12aa4e,_0x5281ff,_0x69de40){var _0x3cef27={'agent':{},'channel':_0x890f('0x5c')};if(_0x12aa4e[_0x890f('0x58')]['id']){delete _0x12aa4e[_0x890f('0x58')]['id'];}_0x12aa4e[_0x890f('0x58')][_0x890f('0x61')]=_0x12aa4e[_0x890f('0x58')][_0x890f('0x61')]||_0x12aa4e[_0x890f('0x62')]['id'];_0x3cef27[_0x890f('0x63')]['id']=_0x12aa4e[_0x890f('0x58')][_0x890f('0x61')];return db['FaxMessage'][_0x890f('0x57')]({'where':{'id':_0x12aa4e['params']['id'],'UserId':null}})[_0x890f('0x1f')](handleEntityNotFound(_0x5281ff,null))[_0x890f('0x1f')](function(_0x3d26db){if(_0x3d26db){_0x3cef27[_0x890f('0x26')]=_0x3d26db['get']({'plain':!![]});return db[_0x890f('0x65')][_0x890f('0x57')]({'where':{'id':_0x3d26db[_0x890f('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x5281ff,null))['then'](function(_0x113078){if(_0x113078){_0x3cef27[_0x890f('0x68')]=_0x113078[_0x890f('0x64')]({'plain':!![]});interaction_log[_0x890f('0x20')](_0x890f('0x7b'),_0x12aa4e[_0x890f('0x62')]['id'],_0x12aa4e[_0x890f('0x62')][_0x890f('0x36')],_0x12aa4e[_0x890f('0x62')][_0x890f('0x69')],_0x3cef27['interaction']['id'],_0x12aa4e[_0x890f('0x58')]?JSON[_0x890f('0x23')](_0x12aa4e[_0x890f('0x58')]):_0x890f('0x7c'));return respondWithRpcPromise(_0x890f('0x7d'),_0x890f('0x7e'),_0x3cef27);}return null;})[_0x890f('0x1f')](function(_0x4ed583){var _0x38df7f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4ed583[_0x890f('0x26')][_0x890f('0x6c')];return db[_0x890f('0x6d')][_0x890f('0x3d')](_0x38df7f,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x2ae6fc){return _0x2ae6fc;});})['then'](function(_0x4471be){if(_0x4471be){_0x3cef27[_0x890f('0x26')][_0x890f('0x7f')]=_0x4471be[0x0];if(!_0x12aa4e[_0x890f('0x58')]['UserId'])return;return db['User'][_0x890f('0x57')]({'where':{'id':_0x12aa4e[_0x890f('0x58')][_0x890f('0x61')],'role':'agent'},'attributes':['id',_0x890f('0x36'),_0x890f('0x80'),_0x890f('0x71'),_0x890f('0x72')],'raw':!![]});}return null;})[_0x890f('0x1f')](function(_0x5c85ff){if(!_0x5c85ff)return null;_0x3cef27[_0x890f('0x26')][_0x890f('0x63')]=_0x5c85ff;return _0x3cef27;})[_0x890f('0x1f')](function(_0x51d588){if(_0x51d588){_0x51d588[_0x890f('0x26')][_0x890f('0x73')]=util[_0x890f('0x5f')](_0x890f('0x74'),_0x12aa4e['user'][_0x890f('0x36')]);_0x51d588['message'][_0x890f('0x75')]=_0x3cef27['channel'];_0x51d588[_0x890f('0x26')][_0x890f('0x76')]=_0x3cef27[_0x890f('0x75')];_0x51d588[_0x890f('0x26')][_0x890f('0x77')]=_0x890f('0x32');respondWithRpcPromise(_0x890f('0x79'),_0x890f('0x79'),{'event':_0x890f('0x81'),'message':_0x51d588[_0x890f('0x26')]},client9002);return _0x3cef27;}return null;})['then'](respondWithResult(_0x5281ff,null))[_0x890f('0x51')](handleError(_0x5281ff,null));};exports[_0x890f('0x82')]=function(_0x1a0f62,_0x3cee42){var _0x43aeb1;return db[_0x890f('0x4d')][_0x890f('0x82')](_0x1a0f62[_0x890f('0x58')],{})['then'](function(_0x2c689b){_0x43aeb1=_0x2c689b;return db[_0x890f('0x83')][_0x890f('0x84')]({'where':{'id':_0x43aeb1['ContactId']}});})[_0x890f('0x1f')](function(_0x373f8f){if(_['isNil'](_0x373f8f)){return;}else{_0x43aeb1['fax']=_0x373f8f['fax'];return db['Attachment']['findOne']({'where':{'id':_0x43aeb1['AttachmentId']}});}})[_0x890f('0x1f')](function(_0x102ab4){return respondWithRpcPromise(_0x890f('0x85'),_0x890f('0x85'),{'FaxAccountId':_['isNil'](_0x1a0f62[_0x890f('0x58')])?undefined:_0x1a0f62[_0x890f('0x58')][_0x890f('0x86')],'path':_['isNil'](_0x102ab4)?undefined:util[_0x890f('0x5f')](_0x890f('0x87'),_0x102ab4[_0x890f('0x88')]),'fax':_[_0x890f('0x67')](_0x43aeb1[_0x890f('0x5c')])?undefined:_0x43aeb1[_0x890f('0x5c')],'AttachmentId':_0x43aeb1['AttachmentId']},client9002);})[_0x890f('0x1f')](respondWithResult(_0x3cee42,0xc9))[_0x890f('0x51')](handleError(_0x3cee42,null));};exports['download']=function(_0x1830c4,_0xd7a759){var _0x5baa0a=path[_0x890f('0x89')](config[_0x890f('0x8a')],'server','files','attachments');return db['FaxMessage'][_0x890f('0x57')]({'where':{'id':_0x1830c4[_0x890f('0x53')]['id']},'include':[{'model':db[_0x890f('0x8b')],'as':'Attachment'}]})[_0x890f('0x1f')](handleEntityNotFound(_0xd7a759,null))['then'](function(_0x11a99d){if(_0x11a99d){return _0xd7a759[_0x890f('0x8c')](path[_0x890f('0x89')](_0x5baa0a,_0x11a99d[_0x890f('0x8b')]['basename']));}})[_0x890f('0x51')](handleError(_0xd7a759,null));};
\ No newline at end of file
index bbc935c..b320756 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87f1=['FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x125d65,_0x57b008){var _0x418391=function(_0x10ecf2){while(--_0x10ecf2){_0x125d65['push'](_0x125d65['shift']());}};_0x418391(++_0x57b008);}(_0x87f1,0x170));var _0x187f=function(_0x4f2bf2,_0x387ecd){_0x4f2bf2=_0x4f2bf2-0x0;var _0x447db=_0x87f1[_0x4f2bf2];return _0x447db;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x187f('0x0'))['db'][_0x187f('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x187f('0x2')](0x0);var events={'afterCreate':_0x187f('0x3'),'afterUpdate':_0x187f('0x4'),'afterDestroy':_0x187f('0x5')};function emitEvent(_0x233cda){return function(_0x5eafdc,_0x19e8fb,_0x4c6db8){FaxMessageEvents[_0x187f('0x6')](_0x233cda+':'+_0x5eafdc['id'],_0x5eafdc);FaxMessageEvents['emit'](_0x233cda,_0x5eafdc);_0x4c6db8(null);};}for(var e in events){if(events[_0x187f('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x187f('0x8')]=FaxMessageEvents;
\ No newline at end of file
+var _0x7409=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1785a6,_0x3cde3b){var _0x18aa08=function(_0x41a89a){while(--_0x41a89a){_0x1785a6['push'](_0x1785a6['shift']());}};_0x18aa08(++_0x3cde3b);}(_0x7409,0x6e));var _0x9740=function(_0x481bdf,_0x231538){_0x481bdf=_0x481bdf-0x0;var _0x281a12=_0x7409[_0x481bdf];return _0x281a12;};'use strict';var EventEmitter=require(_0x9740('0x0'));var FaxMessage=require(_0x9740('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9740('0x2')](0x0);var events={'afterCreate':_0x9740('0x3'),'afterUpdate':_0x9740('0x4'),'afterDestroy':_0x9740('0x5')};function emitEvent(_0x1109e2){return function(_0x2c15f1,_0xf40233,_0x2bb453){FaxMessageEvents[_0x9740('0x6')](_0x1109e2+':'+_0x2c15f1['id'],_0x2c15f1);FaxMessageEvents['emit'](_0x1109e2,_0x2c15f1);_0x2bb453(null);};}for(var e in events){if(events[_0x9740('0x7')](e)){var event=events[e];FaxMessage[_0x9740('0x8')](e,emitEvent(event));}}module[_0x9740('0x9')]=FaxMessageEvents;
\ No newline at end of file
index 48c89ae..212b600 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1559=['./faxMessage.attributes','define','fax_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','isNil','FaxInteraction','findOne','then','update','catch','error','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1559,0x16f));var _0x9155=function(_0x334763,_0x575eff){_0x334763=_0x334763-0x0;var _0x566db0=_0x1559[_0x334763];return _0x566db0;};'use strict';var _=require(_0x9155('0x0'));var util=require(_0x9155('0x1'));var logger=require(_0x9155('0x2'))('api');var moment=require(_0x9155('0x3'));var BPromise=require('bluebird');var rp=require(_0x9155('0x4'));var fs=require('fs');var path=require(_0x9155('0x5'));var rimraf=require(_0x9155('0x6'));var config=require(_0x9155('0x7'));var attributes=require(_0x9155('0x8'));module['exports']=function(_0x3fe33f,_0x4155ab){return _0x3fe33f[_0x9155('0x9')]('FaxMessage',attributes,{'tableName':_0x9155('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x9155('0xb')],'type':_0x9155('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xcb1df9,_0x28dba0,_0x42321b){var _0x8e1100=_0x3fe33f[_0x9155('0xd')];var _0x569972=_0xcb1df9[_0x9155('0xe')]({'plain':!![]});if(_0x569972['direction'][_0x9155('0xf')]()==='in'||_0x569972[_0x9155('0x10')][_0x9155('0xf')]()==='out'&&!_0x569972[_0x9155('0x11')]&&!_[_0x9155('0x12')](_0x569972['UserId'])){_0x8e1100[_0x9155('0x13')][_0x9155('0x14')]({'where':{'id':_0x569972['FaxInteractionId']}})[_0x9155('0x15')](function(_0x2b9959){if(_0x2b9959){_0x2b9959[_0x9155('0x16')]({'lastMsgAt':_0x569972['createdAt'],'lastMsgDirection':_0x569972[_0x9155('0x10')][_0x9155('0xf')]()});}})[_0x9155('0x17')](function(_0x42ad0b){console[_0x9155('0x18')](_0x42ad0b);});}_0x42321b();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xbfb1=['path','rimraf','../../config/environment','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4b3f35,_0x421ed9){var _0x14f4e3=function(_0x12eaad){while(--_0x12eaad){_0x4b3f35['push'](_0x4b3f35['shift']());}};_0x14f4e3(++_0x421ed9);}(_0xbfb1,0xad));var _0x1bfb=function(_0x5f0c2e,_0x33309f){_0x5f0c2e=_0x5f0c2e-0x0;var _0x1c2dda=_0xbfb1[_0x5f0c2e];return _0x1c2dda;};'use strict';var _=require(_0x1bfb('0x0'));var util=require(_0x1bfb('0x1'));var logger=require(_0x1bfb('0x2'))(_0x1bfb('0x3'));var moment=require(_0x1bfb('0x4'));var BPromise=require(_0x1bfb('0x5'));var rp=require(_0x1bfb('0x6'));var fs=require('fs');var path=require(_0x1bfb('0x7'));var rimraf=require(_0x1bfb('0x8'));var config=require(_0x1bfb('0x9'));var attributes=require('./faxMessage.attributes');module[_0x1bfb('0xa')]=function(_0x18167f,_0x5c0925){return _0x18167f[_0x1bfb('0xb')](_0x1bfb('0xc'),attributes,{'tableName':_0x1bfb('0xd'),'paranoid':![],'indexes':[{'name':_0x1bfb('0xe'),'fields':['body'],'type':_0x1bfb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x447ade,_0xaf2918,_0x3786bb){var _0x2c8173=_0x18167f[_0x1bfb('0x10')];var _0x31a011=_0x447ade[_0x1bfb('0x11')]({'plain':!![]});if(_0x31a011[_0x1bfb('0x12')][_0x1bfb('0x13')]()==='in'||_0x31a011['direction'][_0x1bfb('0x13')]()===_0x1bfb('0x14')&&!_0x31a011[_0x1bfb('0x15')]&&!_[_0x1bfb('0x16')](_0x31a011['UserId'])){_0x2c8173[_0x1bfb('0x17')]['findOne']({'where':{'id':_0x31a011[_0x1bfb('0x18')]}})[_0x1bfb('0x19')](function(_0xb0c1b9){if(_0xb0c1b9){_0xb0c1b9[_0x1bfb('0x1a')]({'lastMsgAt':_0x31a011[_0x1bfb('0x1b')],'lastMsgDirection':_0x31a011[_0x1bfb('0x12')][_0x1bfb('0x13')]()});}})[_0x1bfb('0x1c')](function(_0x582d0a){console['error'](_0x582d0a);});}_0x3786bb();}},'charset':'utf8mb4','collate':_0x1bfb('0x1d')});};
\ No newline at end of file
index 981758b..2feb710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55e0=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./faxMessage.socket','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','UpdateFaxMessage','update','where','attributes','limit','lodash','util'];(function(_0x125dea,_0x495f42){var _0x4a9aa6=function(_0x416805){while(--_0x416805){_0x125dea['push'](_0x125dea['shift']());}};_0x4a9aa6(++_0x495f42);}(_0x55e0,0xdc));var _0x055e=function(_0x49c4c8,_0x382d40){_0x49c4c8=_0x49c4c8-0x0;var _0x5dac8c=_0x55e0[_0x49c4c8];return _0x5dac8c;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x055e('0xa')]=_['defaults'](config[_0x055e('0xa')],{'host':_0x055e('0xb'),'port':0x18eb});var socket=require(_0x055e('0xc'))(new Redis(config[_0x055e('0xa')]));require(_0x055e('0xd'))['register'](socket);function respondWithRpcPromise(_0x40779c,_0xd67814,_0xb816c){return new BPromise(function(_0xa0d384,_0x238068){return client['request'](_0x40779c,_0xb816c)['then'](function(_0x187cce){logger['info'](_0x055e('0xe'),_0xd67814,_0x055e('0xf'));logger[_0x055e('0x10')](_0x055e('0x11'),_0xd67814,_0x055e('0xf'),JSON[_0x055e('0x12')](_0x187cce));if(_0x187cce[_0x055e('0x13')]){if(_0x187cce['error'][_0x055e('0x14')]===0x1f4){logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);return _0x238068(_0x187cce['error'][_0x055e('0x15')]);}logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce['error'][_0x055e('0x15')]);return _0xa0d384(_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);}else{logger[_0x055e('0x16')](_0x055e('0xe'),_0xd67814,'request\x20sent');_0xa0d384(_0x187cce[_0x055e('0x17')][_0x055e('0x15')]);}})[_0x055e('0x18')](function(_0x2ed6fb){logger['error'](_0x055e('0xe'),_0xd67814,_0x2ed6fb);_0x238068(_0x2ed6fb);});});}exports[_0x055e('0x19')]=function(_0x58e44a){var _0xe2b7b5=this;return new Promise(function(_0x4412f9,_0x10258f){return db[_0x055e('0x1a')][_0x055e('0x1b')](_0x58e44a[_0x055e('0x1c')],{'raw':_0x58e44a['options']?_0x58e44a[_0x055e('0x1d')][_0x055e('0x1e')]===undefined?!![]:![]:!![]})[_0x055e('0x1f')](function(_0x5930ff){logger[_0x055e('0x16')](_0x055e('0x19'),_0x58e44a);logger[_0x055e('0x10')](_0x055e('0x19'),_0x58e44a,JSON['stringify'](_0x5930ff));_0x4412f9(_0x5930ff);})[_0x055e('0x18')](function(_0x56c372){logger[_0x055e('0x13')](_0x055e('0x19'),_0x56c372[_0x055e('0x15')],_0x58e44a);_0x10258f(_0xe2b7b5[_0x055e('0x13')](0x1f4,_0x56c372[_0x055e('0x15')]));});});};exports[_0x055e('0x20')]=function(_0x58caf9){var _0x2fb49b=this;return new Promise(function(_0x1f90a9,_0x2a82f8){return db['FaxMessage'][_0x055e('0x21')](_0x58caf9[_0x055e('0x1c')],{'raw':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x22')]||null:null,'attributes':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')][_0x055e('0x23')]||null:null,'limit':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x24')]||null:null})[_0x055e('0x1f')](function(_0x293062){logger[_0x055e('0x16')](_0x055e('0x20'),_0x58caf9);logger[_0x055e('0x10')](_0x055e('0x20'),_0x58caf9,JSON[_0x055e('0x12')](_0x293062));_0x1f90a9(_0x293062);})['catch'](function(_0x26d1c2){logger[_0x055e('0x13')]('UpdateFaxMessage',_0x26d1c2[_0x055e('0x15')],_0x58caf9);_0x2a82f8(_0x2fb49b[_0x055e('0x13')](0x1f4,_0x26d1c2[_0x055e('0x15')]));});});};
\ No newline at end of file
+var _0x84ab=['code','message','result','catch','FaxMessage','create','body','raw','CreateFaxMessage','debug','UpdateFaxMessage','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','./faxMessage.socket','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dac28,_0x345de7){var _0x139e69=function(_0x280912){while(--_0x280912){_0x3dac28['push'](_0x3dac28['shift']());}};_0x139e69(++_0x345de7);}(_0x84ab,0x12f));var _0xb84a=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0x84ab[_0xd13a88];return _0x1c993c;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var BPromise=require(_0xb84a('0x3'));var rs=require(_0xb84a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84a('0x5'))['db'];var utils=require(_0xb84a('0x6'));var logger=require('../../config/logger')(_0xb84a('0x7'));var config=require(_0xb84a('0x8'));var jayson=require(_0xb84a('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xb84a('0xa')](config['redis'],{'host':_0xb84a('0xb'),'port':0x18eb});var socket=require(_0xb84a('0xc'))(new Redis(config['redis']));require(_0xb84a('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e6a71,_0x1886e0,_0x42daf5){return new BPromise(function(_0x5d3b29,_0x5a34f7){return client['request'](_0x2e6a71,_0x42daf5)[_0xb84a('0xe')](function(_0x17379b){logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));logger['debug'](_0xb84a('0x12'),_0x1886e0,_0xb84a('0x11'),JSON[_0xb84a('0x13')](_0x17379b));if(_0x17379b[_0xb84a('0x14')]){if(_0x17379b[_0xb84a('0x14')][_0xb84a('0x15')]===0x1f4){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5a34f7(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}logger['error'](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5d3b29(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}else{logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));_0x5d3b29(_0x17379b[_0xb84a('0x17')][_0xb84a('0x16')]);}})[_0xb84a('0x18')](function(_0x2de49c){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x2de49c);_0x5a34f7(_0x2de49c);});});}exports['CreateFaxMessage']=function(_0x1a0056){var _0x319216=this;return new Promise(function(_0x55a633,_0xac76d3){return db[_0xb84a('0x19')][_0xb84a('0x1a')](_0x1a0056[_0xb84a('0x1b')],{'raw':_0x1a0056['options']?_0x1a0056['options'][_0xb84a('0x1c')]===undefined?!![]:![]:!![]})[_0xb84a('0xe')](function(_0x2d70fd){logger[_0xb84a('0xf')](_0xb84a('0x1d'),_0x1a0056);logger[_0xb84a('0x1e')](_0xb84a('0x1d'),_0x1a0056,JSON[_0xb84a('0x13')](_0x2d70fd));_0x55a633(_0x2d70fd);})[_0xb84a('0x18')](function(_0x26fe42){logger[_0xb84a('0x14')](_0xb84a('0x1d'),_0x26fe42[_0xb84a('0x16')],_0x1a0056);_0xac76d3(_0x319216[_0xb84a('0x14')](0x1f4,_0x26fe42[_0xb84a('0x16')]));});});};exports[_0xb84a('0x1f')]=function(_0x378ce1){var _0x3ff0bc=this;return new Promise(function(_0x3b6805,_0xd468c3){return db[_0xb84a('0x19')][_0xb84a('0x20')](_0x378ce1[_0xb84a('0x1b')],{'raw':_0x378ce1[_0xb84a('0x21')]?_0x378ce1[_0xb84a('0x21')][_0xb84a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378ce1['options']?_0x378ce1['options'][_0xb84a('0x22')]||null:null,'attributes':_0x378ce1[_0xb84a('0x21')]?_0x378ce1['options'][_0xb84a('0x23')]||null:null,'limit':_0x378ce1[_0xb84a('0x21')]?_0x378ce1['options']['limit']||null:null})[_0xb84a('0xe')](function(_0x8e9319){logger['info'](_0xb84a('0x1f'),_0x378ce1);logger[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x378ce1,JSON[_0xb84a('0x13')](_0x8e9319));_0x3b6805(_0x8e9319);})[_0xb84a('0x18')](function(_0x144c25){logger[_0xb84a('0x14')](_0xb84a('0x1f'),_0x144c25['message'],_0x378ce1);_0xd468c3(_0x3ff0bc[_0xb84a('0x14')](0x1f4,_0x144c25['message']));});});};
\ No newline at end of file
index 53d9a5e..ef48a0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f0b=['register','length','faxMessage:','update','emit','removeListener'];(function(_0x590a3a,_0xd9db9){var _0x49017f=function(_0x1d92e9){while(--_0x1d92e9){_0x590a3a['push'](_0x590a3a['shift']());}};_0x49017f(++_0xd9db9);}(_0x4f0b,0x1b9));var _0xb4f0=function(_0x373671,_0x3566b5){_0x373671=_0x373671-0x0;var _0x2c5372=_0x4f0b[_0x373671];return _0x2c5372;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save','remove',_0xb4f0('0x0')];function createListener(_0x188dc8,_0x67d89d){return function(_0x5c9073){_0x67d89d[_0xb4f0('0x1')](_0x188dc8,_0x5c9073);};}function removeListener(_0x56111a,_0x2b783d){return function(){FaxMessageEvents[_0xb4f0('0x2')](_0x56111a,_0x2b783d);};}exports[_0xb4f0('0x3')]=function(_0x54799d){for(var _0x1cc37e=0x0,_0x9974ec=events[_0xb4f0('0x4')];_0x1cc37e<_0x9974ec;_0x1cc37e++){var _0x59c5f4=events[_0x1cc37e];var _0x1ade2b=createListener(_0xb4f0('0x5')+_0x59c5f4,_0x54799d);FaxMessageEvents['on'](_0x59c5f4,_0x1ade2b);}};
\ No newline at end of file
+var _0x6372=['./faxMessage.events','remove','emit','removeListener','register'];(function(_0x107d42,_0x44f5d5){var _0x52968f=function(_0xb1cd59){while(--_0xb1cd59){_0x107d42['push'](_0x107d42['shift']());}};_0x52968f(++_0x44f5d5);}(_0x6372,0x1b8));var _0x2637=function(_0x230acb,_0xecd330){_0x230acb=_0x230acb-0x0;var _0x42f265=_0x6372[_0x230acb];return _0x42f265;};'use strict';var FaxMessageEvents=require(_0x2637('0x0'));var events=['save',_0x2637('0x1'),'update'];function createListener(_0xbe0323,_0x20c84a){return function(_0x5b7f97){_0x20c84a[_0x2637('0x2')](_0xbe0323,_0x5b7f97);};}function removeListener(_0x32e73d,_0x1e5d44){return function(){FaxMessageEvents[_0x2637('0x3')](_0x32e73d,_0x1e5d44);};}exports[_0x2637('0x4')]=function(_0x5da891){for(var _0x33d56c=0x0,_0x54bdd1=events['length'];_0x33d56c<_0x54bdd1;_0x33d56c++){var _0x49383d=events[_0x33d56c];var _0x30abde=createListener('faxMessage:'+_0x49383d,_0x5da891);FaxMessageEvents['on'](_0x49383d,_0x30abde);}};
\ No newline at end of file
index f20f0df..523532d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e54=['download','post','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x4d7a61,_0x3fb6e6){var _0x186f73=function(_0x4eeeeb){while(--_0x4eeeeb){_0x4d7a61['push'](_0x4d7a61['shift']());}};_0x186f73(++_0x3fb6e6);}(_0x2e54,0x1dd));var _0x42e5=function(_0x6e024e,_0x11bf6d){_0x6e024e=_0x6e024e-0x0;var _0x4dd0d9=_0x2e54[_0x6e024e];return _0x4dd0d9;};'use strict';var multer=require(_0x42e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x42e5('0x1'));var express=require(_0x42e5('0x2'));var router=express[_0x42e5('0x3')]();var fs_extra=require(_0x42e5('0x4'));var auth=require(_0x42e5('0x5'));var interaction=require(_0x42e5('0x6'));var config=require(_0x42e5('0x7'));var controller=require('./faxMessage.controller');router[_0x42e5('0x8')]('/',auth[_0x42e5('0x9')](),controller[_0x42e5('0xa')]);router['get'](_0x42e5('0xb'),auth['isAuthenticated'](),controller[_0x42e5('0xc')]);router['get'](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0xe')]);router[_0x42e5('0x8')](_0x42e5('0xf'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x10')]);router[_0x42e5('0x11')]('/',auth[_0x42e5('0x9')](),interaction['tracked'](_0x42e5('0x12'),_0x42e5('0x13')),controller['create']);router[_0x42e5('0x14')](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x15')]);router[_0x42e5('0x14')](_0x42e5('0x16'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x17')]);router[_0x42e5('0x14')](_0x42e5('0x18'),auth['isAuthenticated'](),controller[_0x42e5('0x19')]);router[_0x42e5('0x1a')](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x1b')]);module[_0x42e5('0x1c')]=router;
\ No newline at end of file
+var _0xee5b=['update','/:id/accept','accept','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id'];(function(_0x484f3d,_0x38d56a){var _0xb9f3af=function(_0x307906){while(--_0x307906){_0x484f3d['push'](_0x484f3d['shift']());}};_0xb9f3af(++_0x38d56a);}(_0xee5b,0x1f4));var _0xbee5=function(_0x1e9603,_0x575c06){_0x1e9603=_0x1e9603-0x0;var _0x745e43=_0xee5b[_0x1e9603];return _0x745e43;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var fs_extra=require(_0xbee5('0x4'));var auth=require(_0xbee5('0x5'));var interaction=require(_0xbee5('0x6'));var config=require('../../config/environment');var controller=require('./faxMessage.controller');router[_0xbee5('0x7')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0x9')]);router[_0xbee5('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xbee5('0x8')](),controller[_0xbee5('0xa')]);router[_0xbee5('0x7')](_0xbee5('0xb'),auth['isAuthenticated'](),controller[_0xbee5('0xc')]);router[_0xbee5('0xd')]('/',auth[_0xbee5('0x8')](),interaction[_0xbee5('0xe')](_0xbee5('0xf'),_0xbee5('0x10')),controller[_0xbee5('0x11')]);router[_0xbee5('0x12')](_0xbee5('0x13'),auth['isAuthenticated'](),controller[_0xbee5('0x14')]);router['put'](_0xbee5('0x15'),auth[_0xbee5('0x8')](),controller[_0xbee5('0x16')]);router['put']('/:id/reject',auth[_0xbee5('0x8')](),controller['reject']);router[_0xbee5('0x17')]('/:id',auth[_0xbee5('0x8')](),controller[_0xbee5('0x18')]);module[_0xbee5('0x19')]=router;
\ No newline at end of file
index eb9773e..371b2c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dbe=['ENUM','beepall','roundrobin','sequelize','STRING','INTEGER'];(function(_0x3e9881,_0xfa4ff4){var _0x3fb063=function(_0x461821){while(--_0x461821){_0x3e9881['push'](_0x3e9881['shift']());}};_0x3fb063(++_0xfa4ff4);}(_0x7dbe,0x183));var _0xe7db=function(_0x40258c,_0x32939e){_0x40258c=_0x40258c-0x0;var _0x2a6e7b=_0x7dbe[_0x40258c];return _0x2a6e7b;};'use strict';var Sequelize=require(_0xe7db('0x0'));module['exports']={'name':{'type':Sequelize[_0xe7db('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe7db('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe7db('0x3')]('rrmemory',_0xe7db('0x4'),_0xe7db('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xe7db('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc794=['roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x42d9c4,_0x47e3dd){var _0x6e93cf=function(_0x2b415b){while(--_0x2b415b){_0x42d9c4['push'](_0x42d9c4['shift']());}};_0x6e93cf(++_0x47e3dd);}(_0xc794,0x141));var _0x4c79=function(_0x3e15e2,_0x1aec11){_0x3e15e2=_0x3e15e2-0x0;var _0x1e6ad1=_0xc794[_0x3e15e2];return _0x1e6ad1;};'use strict';var Sequelize=require('sequelize');module[_0x4c79('0x0')]={'name':{'type':Sequelize[_0x4c79('0x1')],'unique':_0x4c79('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4c79('0x1')]},'timeout':{'type':Sequelize[_0x4c79('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4c79('0x4')](_0x4c79('0x5'),_0x4c79('0x6'),_0x4c79('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index e222c2d..42fabdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3883=['UserId','agent','faxPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','includes','all','union','compact','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','name','send','index','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map','type','options','FaxQueue','includeAll','findAll','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserFaxQueue','order','pick','User','findAndCountAll'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x3883,0xbf));var _0x3388=function(_0x308fd3,_0xb7552d){_0x308fd3=_0x308fd3-0x0;var _0x2a5670=_0x3883[_0x308fd3];return _0x2a5670;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3388('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3388('0x1'));var rp=require(_0x3388('0x2'));var moment=require('moment');var BPromise=require(_0x3388('0x3'));var Mustache=require(_0x3388('0x4'));var util=require(_0x3388('0x5'));var path=require(_0x3388('0x6'));var sox=require('sox');var csv=require(_0x3388('0x7'));var ejs=require(_0x3388('0x8'));var fs=require('fs');var fs_extra=require(_0x3388('0x9'));var _=require('lodash');var squel=require(_0x3388('0xa'));var crypto=require(_0x3388('0xb'));var jsforce=require(_0x3388('0xc'));var deskjs=require(_0x3388('0xd'));var toCsv=require(_0x3388('0x7'));var querystring=require(_0x3388('0xe'));var Papa=require(_0x3388('0xf'));var Redis=require(_0x3388('0x10'));var authService=require(_0x3388('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3388('0x12'));var hardwareService=require(_0x3388('0x13'));var logger=require(_0x3388('0x14'))(_0x3388('0x15'));var utils=require(_0x3388('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3388('0x17'));var db=require(_0x3388('0x18'))['db'];config[_0x3388('0x19')]=_[_0x3388('0x1a')](config[_0x3388('0x19')],{'host':_0x3388('0x1b'),'port':0x18eb});var socket=require(_0x3388('0x1c'))(new Redis(config[_0x3388('0x19')]));require(_0x3388('0x1d'))[_0x3388('0x1e')](socket);function respondWithStatusCode(_0xec2827,_0x3735a7){_0x3735a7=_0x3735a7||0xcc;return function(_0x4be53a){if(_0x4be53a){return _0xec2827[_0x3388('0x1f')](_0x3735a7);}return _0xec2827[_0x3388('0x20')](_0x3735a7)[_0x3388('0x21')]();};}function respondWithResult(_0x33311e,_0x1601ec){_0x1601ec=_0x1601ec||0xc8;return function(_0x4c7b7d){if(_0x4c7b7d){return _0x33311e[_0x3388('0x20')](_0x1601ec)[_0x3388('0x22')](_0x4c7b7d);}};}function respondWithFilteredResult(_0x342f98,_0x5c0d09){return function(_0x26fdd4){if(_0x26fdd4){var _0x2d5581=typeof _0x5c0d09[_0x3388('0x23')]===_0x3388('0x24')&&typeof _0x5c0d09['limit']===_0x3388('0x24');var _0x17e0b5=_0x26fdd4[_0x3388('0x25')];var _0x5a0d47=_0x2d5581?0x0:_0x5c0d09[_0x3388('0x23')];var _0x17930b=_0x2d5581?_0x26fdd4['count']:_0x5c0d09[_0x3388('0x23')]+_0x5c0d09['limit'];var _0x49dd0e;if(_0x17930b>=_0x17e0b5){_0x17930b=_0x17e0b5;_0x49dd0e=0xc8;}else{_0x49dd0e=0xce;}_0x342f98[_0x3388('0x20')](_0x49dd0e);return _0x342f98[_0x3388('0x26')](_0x3388('0x27'),_0x5a0d47+'-'+_0x17930b+'/'+_0x17e0b5)[_0x3388('0x22')](_0x26fdd4);}return null;};}function patchUpdates(_0x327f3b){return function(_0x974f10){try{jsonpatch['apply'](_0x974f10,_0x327f3b,!![]);}catch(_0x3a2e8e){return BPromise['reject'](_0x3a2e8e);}return _0x974f10[_0x3388('0x28')]();};}function saveUpdates(_0x1da479,_0x281a75){return function(_0x29e4b8){if(_0x29e4b8){return _0x29e4b8[_0x3388('0x29')](_0x1da479)[_0x3388('0x2a')](function(_0xd74a6e){return _0xd74a6e;});}return null;};}function removeEntity(_0x4c2ad5,_0x2a2861){return function(_0x29882a){if(_0x29882a){return _0x29882a[_0x3388('0x2b')]()[_0x3388('0x2a')](function(){var _0x477f3a=_0x29882a[_0x3388('0x2c')]({'plain':!![]});var _0x47a10f=_0x3388('0x2d');return db[_0x3388('0x2e')][_0x3388('0x2b')]({'where':{'type':_0x47a10f,'resourceId':_0x477f3a['id']}})[_0x3388('0x2a')](function(){return _0x29882a;});})['then'](function(){_0x4c2ad5[_0x3388('0x20')](0xcc)[_0x3388('0x21')]();});}};}function handleEntityNotFound(_0x51d35b,_0x13a843){return function(_0x246722){if(!_0x246722){_0x51d35b[_0x3388('0x1f')](0x194);}return _0x246722;};}function handleError(_0x3a0e04,_0x14cf45){_0x14cf45=_0x14cf45||0x1f4;return function(_0xf24fb2){logger[_0x3388('0x2f')](_0xf24fb2['stack']);if(_0xf24fb2['name']){delete _0xf24fb2[_0x3388('0x30')];}_0x3a0e04['status'](_0x14cf45)[_0x3388('0x31')](_0xf24fb2);};}exports[_0x3388('0x32')]=function(_0x2bd45e,_0x5a390e){var _0x219fe7={},_0x504893={},_0x3946e9={'count':0x0,'rows':[]};var _0x2cefbb=_['map'](db['FaxQueue'][_0x3388('0x33')],function(_0x563c68){return{'name':_0x563c68['fieldName'],'type':_0x563c68['type'][_0x3388('0x34')]};});_0x504893[_0x3388('0x35')]=_['map'](_0x2cefbb,_0x3388('0x30'));_0x504893[_0x3388('0x36')]=_[_0x3388('0x37')](_0x2bd45e[_0x3388('0x36')]);_0x504893[_0x3388('0x38')]=_[_0x3388('0x39')](_0x504893[_0x3388('0x35')],_0x504893[_0x3388('0x36')]);_0x219fe7[_0x3388('0x3a')]=_['intersection'](_0x504893[_0x3388('0x35')],qs[_0x3388('0x3b')](_0x2bd45e[_0x3388('0x36')][_0x3388('0x3b')]));_0x219fe7[_0x3388('0x3a')]=_0x219fe7[_0x3388('0x3a')][_0x3388('0x3c')]?_0x219fe7['attributes']:_0x504893[_0x3388('0x35')];if(!_0x2bd45e[_0x3388('0x36')][_0x3388('0x3d')](_0x3388('0x3e'))){_0x219fe7[_0x3388('0x3f')]=qs[_0x3388('0x3f')](_0x2bd45e[_0x3388('0x36')][_0x3388('0x3f')]);_0x219fe7[_0x3388('0x23')]=qs[_0x3388('0x23')](_0x2bd45e[_0x3388('0x36')][_0x3388('0x23')]);}_0x219fe7['order']=qs[_0x3388('0x40')](_0x2bd45e[_0x3388('0x36')][_0x3388('0x40')]);_0x219fe7[_0x3388('0x41')]=qs[_0x3388('0x38')](_['pick'](_0x2bd45e[_0x3388('0x36')],_0x504893[_0x3388('0x38')]),_0x2cefbb);if(_0x2bd45e['query'][_0x3388('0x42')]){_0x219fe7['where']=_[_0x3388('0x43')](_0x219fe7[_0x3388('0x41')],{'$or':_[_0x3388('0x44')](_0x2cefbb,function(_0x4a7784){if(_0x4a7784[_0x3388('0x45')]!=='VIRTUAL'){var _0x1aba7e={};_0x1aba7e[_0x4a7784[_0x3388('0x30')]]={'$like':'%'+_0x2bd45e[_0x3388('0x36')][_0x3388('0x42')]+'%'};return _0x1aba7e;}})});}_0x219fe7=_['merge']({},_0x219fe7,_0x2bd45e[_0x3388('0x46')]);var _0x1a6e69={'where':_0x219fe7[_0x3388('0x41')]};return db[_0x3388('0x47')][_0x3388('0x25')](_0x1a6e69)[_0x3388('0x2a')](function(_0x2ba9f1){_0x3946e9['count']=_0x2ba9f1;if(_0x2bd45e['query'][_0x3388('0x48')]){_0x219fe7['include']=[{'all':!![]}];}return db['FaxQueue'][_0x3388('0x49')](_0x219fe7);})['then'](function(_0x58777b){_0x3946e9['rows']=_0x58777b;return _0x3946e9;})['then'](respondWithFilteredResult(_0x5a390e,_0x219fe7))[_0x3388('0x4a')](handleError(_0x5a390e,null));};exports[_0x3388('0x4b')]=function(_0x41300e,_0x3a31bf){var _0x4503ba={'raw':!![],'where':{'id':_0x41300e[_0x3388('0x4c')]['id']}},_0x1f2584={};_0x1f2584[_0x3388('0x35')]=_[_0x3388('0x37')](db[_0x3388('0x47')][_0x3388('0x33')]);_0x1f2584['query']=_[_0x3388('0x37')](_0x41300e[_0x3388('0x36')]);_0x1f2584[_0x3388('0x38')]=_[_0x3388('0x39')](_0x1f2584['model'],_0x1f2584[_0x3388('0x36')]);_0x4503ba[_0x3388('0x3a')]=_['intersection'](_0x1f2584['model'],qs[_0x3388('0x3b')](_0x41300e[_0x3388('0x36')][_0x3388('0x3b')]));_0x4503ba[_0x3388('0x3a')]=_0x4503ba['attributes'][_0x3388('0x3c')]?_0x4503ba['attributes']:_0x1f2584[_0x3388('0x35')];if(_0x41300e[_0x3388('0x36')]['includeAll']){_0x4503ba[_0x3388('0x4d')]=[{'all':!![]}];}_0x4503ba=_[_0x3388('0x43')]({},_0x4503ba,_0x41300e[_0x3388('0x46')]);return db[_0x3388('0x47')][_0x3388('0x4e')](_0x4503ba)['then'](handleEntityNotFound(_0x3a31bf,null))[_0x3388('0x2a')](respondWithResult(_0x3a31bf,null))['catch'](handleError(_0x3a31bf,null));};exports[_0x3388('0x4f')]=function(_0x129e0d,_0x19ad93){return db['FaxQueue'][_0x3388('0x4f')](_0x129e0d['body'],{})[_0x3388('0x2a')](function(_0x205a8b){var _0x4ad32f=_0x129e0d[_0x3388('0x50')][_0x3388('0x2c')]({'plain':!![]});if(!_0x4ad32f)throw new Error(_0x3388('0x51'));if(_0x4ad32f[_0x3388('0x52')]==='user'){var _0x403fc3=_0x205a8b['get']({'plain':!![]});var _0x6c919c=_0x3388('0x2d');return db[_0x3388('0x53')][_0x3388('0x4e')]({'where':{'name':_0x6c919c,'userProfileId':_0x4ad32f[_0x3388('0x54')]},'raw':!![]})[_0x3388('0x2a')](function(_0xe17c28){if(_0xe17c28&&_0xe17c28['autoAssociation']===0x0){return db[_0x3388('0x2e')]['create']({'name':_0x403fc3[_0x3388('0x30')],'resourceId':_0x403fc3['id'],'type':_0xe17c28['name'],'sectionId':_0xe17c28['id']},{})[_0x3388('0x2a')](function(){return _0x205a8b;});}else{return _0x205a8b;}})['catch'](function(_0x174730){logger[_0x3388('0x2f')](_0x3388('0x55'),_0x174730);throw _0x174730;});}return _0x205a8b;})['then'](respondWithResult(_0x19ad93,0xc9))[_0x3388('0x4a')](handleError(_0x19ad93,null));};exports[_0x3388('0x29')]=function(_0x3767eb,_0x32321a){if(_0x3767eb['body']['id']){delete _0x3767eb[_0x3388('0x56')]['id'];}return db[_0x3388('0x47')]['find']({'where':{'id':_0x3767eb[_0x3388('0x4c')]['id']}})[_0x3388('0x2a')](handleEntityNotFound(_0x32321a,null))['then'](saveUpdates(_0x3767eb['body'],null))[_0x3388('0x2a')](respondWithResult(_0x32321a,null))[_0x3388('0x4a')](handleError(_0x32321a,null));};exports['destroy']=function(_0x3795e9,_0x28804d){return db[_0x3388('0x47')][_0x3388('0x4e')]({'where':{'id':_0x3795e9['params']['id']}})[_0x3388('0x2a')](handleEntityNotFound(_0x28804d,null))[_0x3388('0x2a')](removeEntity(_0x28804d,null))[_0x3388('0x4a')](handleError(_0x28804d,null));};exports[_0x3388('0x57')]=function(_0x595b68,_0x57bc63){return db[_0x3388('0x47')]['describe']()['then'](respondWithResult(_0x57bc63,null))[_0x3388('0x4a')](handleError(_0x57bc63,null));};exports[_0x3388('0x58')]=function(_0xda389,_0xfd65ed,_0x2faa31){var _0x696120={'raw':!![],'where':{}},_0x112bef={},_0x15e61e;return db['FaxQueue'][_0x3388('0x59')]({'where':{'id':_0xda389[_0x3388('0x4c')]['id']}})['then'](handleEntityNotFound(_0xfd65ed,null))[_0x3388('0x2a')](function(_0x23fb22){if(_0x23fb22){_0x15e61e=_0x23fb22['get']({'plain':!![]});_0x112bef[_0x3388('0x35')]=_[_0x3388('0x37')](db[_0x3388('0x5a')][_0x3388('0x33')]);_0x112bef['query']=_[_0x3388('0x37')](_0xda389['query']);_0x112bef[_0x3388('0x38')]=_[_0x3388('0x39')](_0x112bef['model'],_0x112bef[_0x3388('0x36')]);_0x696120['attributes']=_[_0x3388('0x39')](_0x112bef[_0x3388('0x35')],qs[_0x3388('0x3b')](_0xda389[_0x3388('0x36')]['fields']));_0x696120[_0x3388('0x3a')]=_0x696120['attributes']['length']?_0x696120[_0x3388('0x3a')]:_0x112bef[_0x3388('0x35')];if(!_0xda389['query'][_0x3388('0x3d')](_0x3388('0x3e'))){_0x696120[_0x3388('0x3f')]=qs[_0x3388('0x3f')](_0xda389[_0x3388('0x36')][_0x3388('0x3f')]);_0x696120[_0x3388('0x23')]=qs['offset'](_0xda389[_0x3388('0x36')][_0x3388('0x23')]);}_0x696120[_0x3388('0x5b')]=qs[_0x3388('0x40')](_0xda389[_0x3388('0x36')]['sort']);_0x696120['where']=qs[_0x3388('0x38')](_[_0x3388('0x5c')](_0xda389[_0x3388('0x36')],_0x112bef[_0x3388('0x38')]));_0x696120[_0x3388('0x41')]['FaxQueueId']=_0x23fb22['id'];if(_0xda389[_0x3388('0x36')][_0x3388('0x42')]){_0x696120[_0x3388('0x41')]=_['merge'](_0x696120[_0x3388('0x41')],{'$or':_[_0x3388('0x44')](_0x696120[_0x3388('0x3a')],function(_0x2acbb2){var _0x56d350={};_0x56d350[_0x2acbb2]={'$like':'%'+_0xda389[_0x3388('0x36')][_0x3388('0x42')]+'%'};return _0x56d350;})});}_0x696120=_[_0x3388('0x43')]({},_0x696120,_0xda389[_0x3388('0x46')]);return db[_0x3388('0x5a')][_0x3388('0x49')](_0x696120);}})[_0x3388('0x2a')](function(_0x2170d4){if(_0x2170d4){return db[_0x3388('0x5d')][_0x3388('0x5e')]({'where':{'id':_[_0x3388('0x44')](_0x2170d4,_0x3388('0x5f')),'role':_0x3388('0x60')},'attributes':['id',_0x3388('0x30'),_0x3388('0x61'),_0x3388('0x62'),_0x3388('0x63')]});}})['then'](function(_0x2df459){if(_0x2df459){return{'count':_0x2df459[_0x3388('0x25')],'rows':_[_0x3388('0x44')](_0x2df459[_0x3388('0x64')],function(_0x1380c4){return{'membername':_0x1380c4[_0x3388('0x30')],'UserId':_0x1380c4['id'],'queue_name':_0x15e61e[_0x3388('0x30')],'FaxQueueId':_0x15e61e['id'],'interface':util[_0x3388('0x65')](_0x3388('0x66'),_0x3388('0x67'),_0x1380c4[_0x3388('0x30')]),'penalty':0x0,'paused':_0x1380c4[_0x3388('0x61')],'createdAt':_0x1380c4[_0x3388('0x63')],'updatedAt':_0x1380c4[_0x3388('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xfd65ed,_0x696120))[_0x3388('0x4a')](handleError(_0xfd65ed,null));};exports[_0x3388('0x68')]=function(_0x1682e1,_0x39d70a,_0x24957f){var _0x2ee769={};var _0x37ab44={};var _0x39bbdf;var _0x3f4c78;return db[_0x3388('0x47')][_0x3388('0x59')]({'where':{'id':_0x1682e1[_0x3388('0x4c')]['id']}})[_0x3388('0x2a')](handleEntityNotFound(_0x39d70a,null))[_0x3388('0x2a')](function(_0x46d29b){if(_0x46d29b){_0x39bbdf=_0x46d29b;_0x37ab44[_0x3388('0x35')]=_[_0x3388('0x37')](db[_0x3388('0x69')]['rawAttributes']);_0x37ab44[_0x3388('0x36')]=_[_0x3388('0x37')](_0x1682e1[_0x3388('0x36')]);_0x37ab44[_0x3388('0x38')]=_[_0x3388('0x39')](_0x37ab44[_0x3388('0x35')],_0x37ab44[_0x3388('0x36')]);_0x2ee769[_0x3388('0x3a')]=_[_0x3388('0x39')](_0x37ab44[_0x3388('0x35')],qs[_0x3388('0x3b')](_0x1682e1[_0x3388('0x36')][_0x3388('0x3b')]));_0x2ee769['attributes']=_0x2ee769[_0x3388('0x3a')]['length']?_0x2ee769['attributes']:_0x37ab44[_0x3388('0x35')];_0x2ee769['order']=qs['sort'](_0x1682e1['query'][_0x3388('0x40')]);_0x2ee769['where']=qs['filters'](_[_0x3388('0x5c')](_0x1682e1[_0x3388('0x36')],_0x37ab44[_0x3388('0x38')]));if(_0x1682e1[_0x3388('0x36')][_0x3388('0x42')]){_0x2ee769[_0x3388('0x41')]=_[_0x3388('0x43')](_0x2ee769[_0x3388('0x41')],{'$or':_[_0x3388('0x44')](_0x2ee769[_0x3388('0x3a')],function(_0x90582f){var _0x25910e={};_0x25910e[_0x90582f]={'$like':'%'+_0x1682e1[_0x3388('0x36')][_0x3388('0x42')]+'%'};return _0x25910e;})});}_0x2ee769=_[_0x3388('0x43')]({},_0x2ee769,_0x1682e1['options']);return _0x39bbdf[_0x3388('0x68')](_0x2ee769);}})['then'](function(_0x1ad59d){if(_0x1ad59d){_0x3f4c78=_0x1ad59d[_0x3388('0x3c')];if(!_0x1682e1[_0x3388('0x36')][_0x3388('0x3d')](_0x3388('0x3e'))){_0x2ee769[_0x3388('0x3f')]=qs[_0x3388('0x3f')](_0x1682e1[_0x3388('0x36')][_0x3388('0x3f')]);_0x2ee769[_0x3388('0x23')]=qs[_0x3388('0x23')](_0x1682e1[_0x3388('0x36')][_0x3388('0x23')]);}return _0x39bbdf[_0x3388('0x68')](_0x2ee769);}})[_0x3388('0x2a')](function(_0xf9025f){if(_0xf9025f){return _0xf9025f?{'count':_0x3f4c78,'rows':_0xf9025f}:null;}})[_0x3388('0x2a')](respondWithResult(_0x39d70a,null))[_0x3388('0x4a')](handleError(_0x39d70a,null));};exports[_0x3388('0x6a')]=function(_0xf6bdee,_0x11e5a0,_0x2c0d63){var _0x1a833b=_0xf6bdee[_0x3388('0x56')][_0x3388('0x6b')];return db[_0x3388('0x69')][_0x3388('0x49')]({'where':{'id':_0x1a833b},'attributes':['id'],'include':[{'model':db[_0x3388('0x5d')],'as':_0x3388('0x6c'),'attributes':['id',_0x3388('0x30'),_0x3388('0x6d'),'voicePause',_0x3388('0x6e')],'raw':!![]}]})[_0x3388('0x2a')](function(_0x314248){if(_0x314248){var _0x3c7960=_[_0x3388('0x6f')](_0x314248,function(_0x410df6){var _0x309e38=_0x410df6['get']({'plain':!![]});return _0x309e38[_0x3388('0x6c')];});return db['FaxQueue'][_0x3388('0x4e')]({'where':{'id':_0xf6bdee['params']['id']}})['then'](function(_0x21b040){return db[_0x3388('0x70')][_0x3388('0x71')](function(_0x586737){return _0x21b040[_0x3388('0x6a')](_0x1a833b,{'transaction':_0x586737})[_0x3388('0x2a')](function(){return BPromise[_0x3388('0x72')](_0x3c7960,function(_0x334761){return db[_0x3388('0x5a')][_0x3388('0x73')]({'where':{'UserId':_0x334761['id'],'FaxQueueId':_0xf6bdee[_0x3388('0x4c')]['id']},'transaction':_0x586737});});})['then'](function(){_0x3c7960[_0x3388('0x74')](function(_0x526595){socket[_0x3388('0x75')](_0x3388('0x76'),{'UserId':_0x526595['id'],'FaxQueueId':_0x21b040['id']});});});});});}})[_0x3388('0x2a')](respondWithStatusCode(_0x11e5a0,null))[_0x3388('0x4a')](handleError(_0x11e5a0,null));};exports['removeTeams']=function(_0x1d4c94,_0x3e5a19,_0x5b116b){return db['Team'][_0x3388('0x49')]({'where':{'id':_0x1d4c94['query'][_0x3388('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3388('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x3388('0x2a')](handleEntityNotFound(_0x3e5a19,null))['then'](function(_0x3c466e){var _0x3c20d5=_['map'](_0x3c466e,'id');var _0x10689b=[];var _0x541fa8=[];var _0x517e7a=squel[_0x3388('0x77')]();_0x517e7a['field'](_0x3388('0x78'))[_0x3388('0x79')](_0x3388('0x7a'),'tq')[_0x3388('0x7b')](_0x3388('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3388('0x41')](_0x3388('0x7d'),_0x1d4c94[_0x3388('0x4c')]['id']);for(var _0x45e494=0x0;_0x45e494<_0x3c466e[_0x3388('0x3c')];_0x45e494+=0x1){let _0x2fc69=_0x3c466e[_0x45e494];for(var _0x36ef19=0x0;_0x36ef19<_0x2fc69[_0x3388('0x6c')]['length'];_0x36ef19+=0x1){let _0x47667d=_0x2fc69[_0x3388('0x6c')][_0x36ef19];var _0xa8c9a4=_0x517e7a[_0x3388('0x7e')]();_0xa8c9a4[_0x3388('0x41')](_0x3388('0x7f'),_0x47667d['id']);_0x541fa8['push'](db[_0x3388('0x70')][_0x3388('0x36')](_0xa8c9a4['toString'](),{'type':db[_0x3388('0x70')][_0x3388('0x80')][_0x3388('0x81')]})[_0x3388('0x2a')](function(_0x203020){if(_0x203020[_0x3388('0x3c')]===0x1){return _0x47667d['id'];}else{var _0x3753cd=_['every'](_[_0x3388('0x44')](_0x203020,'TeamId'),function(_0x1efdf7){return _[_0x3388('0x82')](_0x3c20d5,_0x1efdf7);});if(_0x3753cd){return _0x47667d['id'];}}}));}}return BPromise[_0x3388('0x83')](_0x541fa8)[_0x3388('0x2a')](function(_0x476544){_0x10689b=_(_0x10689b)[_0x3388('0x84')](_0x476544)[_0x3388('0x85')]()['value']();return db[_0x3388('0x47')][_0x3388('0x4e')]({'where':{'id':_0x1d4c94[_0x3388('0x4c')]['id']}})[_0x3388('0x2a')](function(_0x20d878){return db[_0x3388('0x70')][_0x3388('0x71')](function(_0x285a31){return _0x20d878[_0x3388('0x86')](_0x1d4c94['query'][_0x3388('0x6b')],{'transaction':_0x285a31})[_0x3388('0x2a')](function(){if(!_[_0x3388('0x87')](_0x10689b)){return _0x20d878[_0x3388('0x88')](_0x10689b,{'transaction':_0x285a31});}})[_0x3388('0x2a')](function(){_0x10689b['forEach'](function(_0x2c520e){socket[_0x3388('0x75')](_0x3388('0x89'),{'UserId':_0x2c520e,'FaxQueueId':_0x20d878['id']});});});});});});})[_0x3388('0x2a')](respondWithStatusCode(_0x3e5a19,null))[_0x3388('0x4a')](handleError(_0x3e5a19,null));};exports[_0x3388('0x8a')]=function(_0x1c030d,_0x579e34,_0x4ae056){return db[_0x3388('0x47')][_0x3388('0x4e')]({'where':{'id':_0x1c030d[_0x3388('0x4c')]['id']}})[_0x3388('0x2a')](handleEntityNotFound(_0x579e34,null))[_0x3388('0x2a')](function(_0x1c0345){if(_0x1c0345){return _0x1c0345[_0x3388('0x8a')](_0x1c030d['body'][_0x3388('0x6b')],_[_0x3388('0x8b')](_0x1c030d[_0x3388('0x56')],[_0x3388('0x6b'),'id'])||{})[_0x3388('0x8c')](function(_0x43f6a4){for(var _0x3c5e31=0x0;_0x3c5e31<_0x1c030d[_0x3388('0x56')][_0x3388('0x6b')][_0x3388('0x3c')];_0x3c5e31+=0x1){socket[_0x3388('0x75')](_0x3388('0x76'),{'UserId':Number(_0x1c030d[_0x3388('0x56')][_0x3388('0x6b')][_0x3c5e31]),'FaxQueueId':Number(_0x1c030d[_0x3388('0x4c')]['id'])});}return _0x43f6a4;});}})[_0x3388('0x2a')](respondWithResult(_0x579e34,null))[_0x3388('0x4a')](handleError(_0x579e34,null));};exports[_0x3388('0x88')]=function(_0x21eac9,_0x4f6508,_0xe90e46){return db[_0x3388('0x47')][_0x3388('0x4e')]({'where':{'id':_0x21eac9[_0x3388('0x4c')]['id']}})[_0x3388('0x2a')](handleEntityNotFound(_0x4f6508,null))['then'](function(_0x5ae3aa){if(_0x5ae3aa){return _0x5ae3aa['removeAgents'](_0x21eac9[_0x3388('0x36')][_0x3388('0x6b')])['then'](function(){if(_[_0x3388('0x8d')](_0x21eac9['query'][_0x3388('0x6b')])){for(var _0x26f1e5=0x0;_0x26f1e5<_0x21eac9[_0x3388('0x36')][_0x3388('0x6b')][_0x3388('0x3c')];_0x26f1e5+=0x1){socket['emit'](_0x3388('0x89'),{'UserId':Number(_0x21eac9['query'][_0x3388('0x6b')][_0x26f1e5]),'FaxQueueId':Number(_0x21eac9[_0x3388('0x4c')]['id'])});}}else{socket['emit'](_0x3388('0x89'),{'UserId':Number(_0x21eac9[_0x3388('0x36')][_0x3388('0x6b')]),'FaxQueueId':Number(_0x21eac9[_0x3388('0x4c')]['id'])});}});}})[_0x3388('0x2a')](respondWithStatusCode(_0x4f6508,null))[_0x3388('0x4a')](handleError(_0x4f6508,null));};exports[_0x3388('0x8e')]=function(_0x589f40,_0x18af4f,_0x5d7b0f){var _0x228932={};var _0x244bd4={};var _0xa1660e;var _0x26da5f;return db[_0x3388('0x47')][_0x3388('0x59')]({'where':{'id':_0x589f40[_0x3388('0x4c')]['id']}})['then'](handleEntityNotFound(_0x18af4f,null))[_0x3388('0x2a')](function(_0x108336){if(_0x108336){_0xa1660e=_0x108336;_0x244bd4[_0x3388('0x35')]=_['keys'](db[_0x3388('0x5d')][_0x3388('0x33')]);_0x244bd4['query']=_[_0x3388('0x37')](_0x589f40[_0x3388('0x36')]);_0x244bd4[_0x3388('0x38')]=_[_0x3388('0x39')](_0x244bd4[_0x3388('0x35')],_0x244bd4[_0x3388('0x36')]);_0x228932[_0x3388('0x3a')]=_[_0x3388('0x39')](_0x244bd4[_0x3388('0x35')],qs[_0x3388('0x3b')](_0x589f40[_0x3388('0x36')][_0x3388('0x3b')]));_0x228932['attributes']=_0x228932[_0x3388('0x3a')]['length']?_0x228932[_0x3388('0x3a')]:_0x244bd4[_0x3388('0x35')];_0x228932['order']=qs[_0x3388('0x40')](_0x589f40[_0x3388('0x36')][_0x3388('0x40')]);_0x228932[_0x3388('0x41')]=qs[_0x3388('0x38')](_[_0x3388('0x5c')](_0x589f40[_0x3388('0x36')],_0x244bd4['filters']));if(_0x589f40[_0x3388('0x36')]['filter']){_0x228932[_0x3388('0x41')]=_[_0x3388('0x43')](_0x228932[_0x3388('0x41')],{'$or':_['map'](_0x228932[_0x3388('0x3a')],function(_0x36431b){var _0x38c134={};_0x38c134[_0x36431b]={'$like':'%'+_0x589f40[_0x3388('0x36')]['filter']+'%'};return _0x38c134;})});}_0x228932=_[_0x3388('0x43')]({},_0x228932,_0x589f40['options']);return _0xa1660e['getAgents'](_0x228932);}})[_0x3388('0x2a')](function(_0x3224ae){if(_0x3224ae){_0x26da5f=_0x3224ae[_0x3388('0x3c')];if(!_0x589f40[_0x3388('0x36')][_0x3388('0x3d')]('nolimit')){_0x228932[_0x3388('0x3f')]=qs['limit'](_0x589f40[_0x3388('0x36')][_0x3388('0x3f')]);_0x228932[_0x3388('0x23')]=qs[_0x3388('0x23')](_0x589f40[_0x3388('0x36')][_0x3388('0x23')]);}return _0xa1660e['getAgents'](_0x228932);}})[_0x3388('0x2a')](function(_0x32e65a){if(_0x32e65a){return _0x32e65a?{'count':_0x26da5f,'rows':_0x32e65a}:null;}})['then'](respondWithResult(_0x18af4f,null))[_0x3388('0x4a')](handleError(_0x18af4f,null));};
\ No newline at end of file
+var _0x5fb3=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','sort','pick','where','VIRTUAL','filter','merge','options','FaxQueue','findAll','rows','catch','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxQueues','userProfileId','autoAssociation','error','params','describe','findOne','UserFaxQueue','nolimit','FaxQueueId','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','order','hasOwnProperty','addTeams','ids','User','Agents','online','voicePause','sequelize','transaction','each','forEach','emit','removeTeams','select','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','all','union','compact','isEmpty','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status'];(function(_0x4cfb5b,_0x52ada7){var _0x4598a5=function(_0x388128){while(--_0x388128){_0x4cfb5b['push'](_0x4cfb5b['shift']());}};_0x4598a5(++_0x52ada7);}(_0x5fb3,0x69));var _0x35fb=function(_0x40f99d,_0x374216){_0x40f99d=_0x40f99d-0x0;var _0x8a4685=_0x5fb3[_0x40f99d];return _0x8a4685;};'use strict';var emlformat=require(_0x35fb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x35fb('0x1'));var jsonpatch=require(_0x35fb('0x2'));var rp=require(_0x35fb('0x3'));var moment=require(_0x35fb('0x4'));var BPromise=require(_0x35fb('0x5'));var Mustache=require(_0x35fb('0x6'));var util=require(_0x35fb('0x7'));var path=require(_0x35fb('0x8'));var sox=require('sox');var csv=require(_0x35fb('0x9'));var ejs=require(_0x35fb('0xa'));var fs=require('fs');var fs_extra=require(_0x35fb('0xb'));var _=require(_0x35fb('0xc'));var squel=require('squel');var crypto=require(_0x35fb('0xd'));var jsforce=require(_0x35fb('0xe'));var deskjs=require(_0x35fb('0xf'));var toCsv=require('to-csv');var querystring=require(_0x35fb('0x10'));var Papa=require(_0x35fb('0x11'));var Redis=require(_0x35fb('0x12'));var authService=require(_0x35fb('0x13'));var qs=require(_0x35fb('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35fb('0x15'));var logger=require(_0x35fb('0x16'))('api');var utils=require(_0x35fb('0x17'));var config=require(_0x35fb('0x18'));var licenseUtil=require(_0x35fb('0x19'));var db=require(_0x35fb('0x1a'))['db'];config[_0x35fb('0x1b')]=_[_0x35fb('0x1c')](config['redis'],{'host':_0x35fb('0x1d'),'port':0x18eb});var socket=require(_0x35fb('0x1e'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x35fb('0x1f')](socket);function respondWithStatusCode(_0x1762e2,_0x2efa1b){_0x2efa1b=_0x2efa1b||0xcc;return function(_0x589c99){if(_0x589c99){return _0x1762e2['sendStatus'](_0x2efa1b);}return _0x1762e2[_0x35fb('0x20')](_0x2efa1b)[_0x35fb('0x21')]();};}function respondWithResult(_0x279931,_0x1d68f3){_0x1d68f3=_0x1d68f3||0xc8;return function(_0x2f9774){if(_0x2f9774){return _0x279931['status'](_0x1d68f3)[_0x35fb('0x22')](_0x2f9774);}};}function respondWithFilteredResult(_0x58d8f2,_0x36e6e1){return function(_0x5f4c53){if(_0x5f4c53){var _0x5e38f0=typeof _0x36e6e1[_0x35fb('0x23')]===_0x35fb('0x24')&&typeof _0x36e6e1[_0x35fb('0x25')]===_0x35fb('0x24');var _0x1c3a2b=_0x5f4c53['count'];var _0x2f3a74=_0x5e38f0?0x0:_0x36e6e1['offset'];var _0x37e604=_0x5e38f0?_0x5f4c53[_0x35fb('0x26')]:_0x36e6e1['offset']+_0x36e6e1[_0x35fb('0x25')];var _0x1ceeeb;if(_0x37e604>=_0x1c3a2b){_0x37e604=_0x1c3a2b;_0x1ceeeb=0xc8;}else{_0x1ceeeb=0xce;}_0x58d8f2[_0x35fb('0x20')](_0x1ceeeb);return _0x58d8f2[_0x35fb('0x27')](_0x35fb('0x28'),_0x2f3a74+'-'+_0x37e604+'/'+_0x1c3a2b)[_0x35fb('0x22')](_0x5f4c53);}return null;};}function patchUpdates(_0x4cd71f){return function(_0x1a0c21){try{jsonpatch[_0x35fb('0x29')](_0x1a0c21,_0x4cd71f,!![]);}catch(_0x2a9f50){return BPromise[_0x35fb('0x2a')](_0x2a9f50);}return _0x1a0c21['save']();};}function saveUpdates(_0x5e7ae4,_0x47646f){return function(_0x274e9c){if(_0x274e9c){return _0x274e9c[_0x35fb('0x2b')](_0x5e7ae4)[_0x35fb('0x2c')](function(_0xc4bebb){return _0xc4bebb;});}return null;};}function removeEntity(_0x27fb88,_0x432a2b){return function(_0x3caed2){if(_0x3caed2){return _0x3caed2[_0x35fb('0x2d')]()[_0x35fb('0x2c')](function(){var _0x1d3a9b=_0x3caed2[_0x35fb('0x2e')]({'plain':!![]});var _0x2d1e4c='FaxQueues';return db[_0x35fb('0x2f')][_0x35fb('0x2d')]({'where':{'type':_0x2d1e4c,'resourceId':_0x1d3a9b['id']}})[_0x35fb('0x2c')](function(){return _0x3caed2;});})[_0x35fb('0x2c')](function(){_0x27fb88['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44ae2f,_0x420e4c){return function(_0x3fccf9){if(!_0x3fccf9){_0x44ae2f[_0x35fb('0x30')](0x194);}return _0x3fccf9;};}function handleError(_0x93046f,_0x49bb37){_0x49bb37=_0x49bb37||0x1f4;return function(_0x120564){logger['error'](_0x120564[_0x35fb('0x31')]);if(_0x120564[_0x35fb('0x32')]){delete _0x120564[_0x35fb('0x32')];}_0x93046f[_0x35fb('0x20')](_0x49bb37)[_0x35fb('0x33')](_0x120564);};}exports[_0x35fb('0x34')]=function(_0x4991a5,_0x101b52){var _0x38a4af={},_0x551385={},_0x18dd6b={'count':0x0,'rows':[]};var _0x477b17=_[_0x35fb('0x35')](db['FaxQueue'][_0x35fb('0x36')],function(_0x1a1bee){return{'name':_0x1a1bee[_0x35fb('0x37')],'type':_0x1a1bee[_0x35fb('0x38')][_0x35fb('0x39')]};});_0x551385[_0x35fb('0x3a')]=_[_0x35fb('0x35')](_0x477b17,_0x35fb('0x32'));_0x551385['query']=_[_0x35fb('0x3b')](_0x4991a5[_0x35fb('0x3c')]);_0x551385[_0x35fb('0x3d')]=_[_0x35fb('0x3e')](_0x551385[_0x35fb('0x3a')],_0x551385['query']);_0x38a4af[_0x35fb('0x3f')]=_[_0x35fb('0x3e')](_0x551385[_0x35fb('0x3a')],qs[_0x35fb('0x40')](_0x4991a5['query'][_0x35fb('0x40')]));_0x38a4af[_0x35fb('0x3f')]=_0x38a4af[_0x35fb('0x3f')][_0x35fb('0x41')]?_0x38a4af[_0x35fb('0x3f')]:_0x551385[_0x35fb('0x3a')];if(!_0x4991a5[_0x35fb('0x3c')]['hasOwnProperty']('nolimit')){_0x38a4af['limit']=qs[_0x35fb('0x25')](_0x4991a5[_0x35fb('0x3c')]['limit']);_0x38a4af['offset']=qs['offset'](_0x4991a5['query']['offset']);}_0x38a4af['order']=qs['sort'](_0x4991a5[_0x35fb('0x3c')][_0x35fb('0x42')]);_0x38a4af['where']=qs[_0x35fb('0x3d')](_[_0x35fb('0x43')](_0x4991a5[_0x35fb('0x3c')],_0x551385[_0x35fb('0x3d')]),_0x477b17);if(_0x4991a5[_0x35fb('0x3c')]['filter']){_0x38a4af[_0x35fb('0x44')]=_['merge'](_0x38a4af[_0x35fb('0x44')],{'$or':_[_0x35fb('0x35')](_0x477b17,function(_0x2d0cf0){if(_0x2d0cf0[_0x35fb('0x38')]!==_0x35fb('0x45')){var _0x3e98a9={};_0x3e98a9[_0x2d0cf0[_0x35fb('0x32')]]={'$like':'%'+_0x4991a5['query'][_0x35fb('0x46')]+'%'};return _0x3e98a9;}})});}_0x38a4af=_[_0x35fb('0x47')]({},_0x38a4af,_0x4991a5[_0x35fb('0x48')]);var _0x285e80={'where':_0x38a4af[_0x35fb('0x44')]};return db['FaxQueue']['count'](_0x285e80)[_0x35fb('0x2c')](function(_0x3a42c5){_0x18dd6b[_0x35fb('0x26')]=_0x3a42c5;if(_0x4991a5['query']['includeAll']){_0x38a4af['include']=[{'all':!![]}];}return db[_0x35fb('0x49')][_0x35fb('0x4a')](_0x38a4af);})['then'](function(_0x5135dd){_0x18dd6b[_0x35fb('0x4b')]=_0x5135dd;return _0x18dd6b;})[_0x35fb('0x2c')](respondWithFilteredResult(_0x101b52,_0x38a4af))[_0x35fb('0x4c')](handleError(_0x101b52,null));};exports['show']=function(_0x33683a,_0x319e5a){var _0x169f76={'raw':!![],'where':{'id':_0x33683a['params']['id']}},_0x4ce05e={};_0x4ce05e[_0x35fb('0x3a')]=_['keys'](db['FaxQueue']['rawAttributes']);_0x4ce05e[_0x35fb('0x3c')]=_['keys'](_0x33683a[_0x35fb('0x3c')]);_0x4ce05e[_0x35fb('0x3d')]=_[_0x35fb('0x3e')](_0x4ce05e[_0x35fb('0x3a')],_0x4ce05e[_0x35fb('0x3c')]);_0x169f76[_0x35fb('0x3f')]=_['intersection'](_0x4ce05e[_0x35fb('0x3a')],qs[_0x35fb('0x40')](_0x33683a[_0x35fb('0x3c')][_0x35fb('0x40')]));_0x169f76[_0x35fb('0x3f')]=_0x169f76[_0x35fb('0x3f')][_0x35fb('0x41')]?_0x169f76[_0x35fb('0x3f')]:_0x4ce05e[_0x35fb('0x3a')];if(_0x33683a['query']['includeAll']){_0x169f76[_0x35fb('0x4d')]=[{'all':!![]}];}_0x169f76=_[_0x35fb('0x47')]({},_0x169f76,_0x33683a[_0x35fb('0x48')]);return db[_0x35fb('0x49')][_0x35fb('0x4e')](_0x169f76)[_0x35fb('0x2c')](handleEntityNotFound(_0x319e5a,null))[_0x35fb('0x2c')](respondWithResult(_0x319e5a,null))[_0x35fb('0x4c')](handleError(_0x319e5a,null));};exports[_0x35fb('0x4f')]=function(_0x8f4744,_0x5649df){return db[_0x35fb('0x49')][_0x35fb('0x4f')](_0x8f4744[_0x35fb('0x50')],{})[_0x35fb('0x2c')](function(_0x28cceb){var _0x404200=_0x8f4744[_0x35fb('0x51')]['get']({'plain':!![]});if(!_0x404200)throw new Error(_0x35fb('0x52'));if(_0x404200['role']===_0x35fb('0x51')){var _0x17b06d=_0x28cceb[_0x35fb('0x2e')]({'plain':!![]});var _0x30fd3f=_0x35fb('0x53');return db['UserProfileSection'][_0x35fb('0x4e')]({'where':{'name':_0x30fd3f,'userProfileId':_0x404200[_0x35fb('0x54')]},'raw':!![]})['then'](function(_0x5c9fe7){if(_0x5c9fe7&&_0x5c9fe7[_0x35fb('0x55')]===0x0){return db[_0x35fb('0x2f')][_0x35fb('0x4f')]({'name':_0x17b06d[_0x35fb('0x32')],'resourceId':_0x17b06d['id'],'type':_0x5c9fe7[_0x35fb('0x32')],'sectionId':_0x5c9fe7['id']},{})[_0x35fb('0x2c')](function(){return _0x28cceb;});}else{return _0x28cceb;}})[_0x35fb('0x4c')](function(_0xc948e6){logger[_0x35fb('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc948e6);throw _0xc948e6;});}return _0x28cceb;})['then'](respondWithResult(_0x5649df,0xc9))[_0x35fb('0x4c')](handleError(_0x5649df,null));};exports['update']=function(_0x4b8d00,_0xe279ee){if(_0x4b8d00['body']['id']){delete _0x4b8d00[_0x35fb('0x50')]['id'];}return db[_0x35fb('0x49')][_0x35fb('0x4e')]({'where':{'id':_0x4b8d00[_0x35fb('0x57')]['id']}})['then'](handleEntityNotFound(_0xe279ee,null))['then'](saveUpdates(_0x4b8d00[_0x35fb('0x50')],null))['then'](respondWithResult(_0xe279ee,null))[_0x35fb('0x4c')](handleError(_0xe279ee,null));};exports[_0x35fb('0x2d')]=function(_0x4027f2,_0x39fcf7){return db['FaxQueue'][_0x35fb('0x4e')]({'where':{'id':_0x4027f2[_0x35fb('0x57')]['id']}})[_0x35fb('0x2c')](handleEntityNotFound(_0x39fcf7,null))[_0x35fb('0x2c')](removeEntity(_0x39fcf7,null))['catch'](handleError(_0x39fcf7,null));};exports[_0x35fb('0x58')]=function(_0x14eef6,_0x4e5327){return db['FaxQueue']['describe']()['then'](respondWithResult(_0x4e5327,null))[_0x35fb('0x4c')](handleError(_0x4e5327,null));};exports['getMembers']=function(_0x129088,_0x3f8ec6,_0x271ec6){var _0x5a1b8e={'raw':!![],'where':{}},_0x417328={},_0x572c15;return db[_0x35fb('0x49')][_0x35fb('0x59')]({'where':{'id':_0x129088[_0x35fb('0x57')]['id']}})[_0x35fb('0x2c')](handleEntityNotFound(_0x3f8ec6,null))[_0x35fb('0x2c')](function(_0x192b86){if(_0x192b86){_0x572c15=_0x192b86[_0x35fb('0x2e')]({'plain':!![]});_0x417328[_0x35fb('0x3a')]=_['keys'](db[_0x35fb('0x5a')][_0x35fb('0x36')]);_0x417328[_0x35fb('0x3c')]=_[_0x35fb('0x3b')](_0x129088[_0x35fb('0x3c')]);_0x417328[_0x35fb('0x3d')]=_[_0x35fb('0x3e')](_0x417328['model'],_0x417328[_0x35fb('0x3c')]);_0x5a1b8e[_0x35fb('0x3f')]=_['intersection'](_0x417328['model'],qs[_0x35fb('0x40')](_0x129088[_0x35fb('0x3c')]['fields']));_0x5a1b8e[_0x35fb('0x3f')]=_0x5a1b8e[_0x35fb('0x3f')][_0x35fb('0x41')]?_0x5a1b8e[_0x35fb('0x3f')]:_0x417328['model'];if(!_0x129088[_0x35fb('0x3c')]['hasOwnProperty'](_0x35fb('0x5b'))){_0x5a1b8e['limit']=qs[_0x35fb('0x25')](_0x129088[_0x35fb('0x3c')][_0x35fb('0x25')]);_0x5a1b8e[_0x35fb('0x23')]=qs[_0x35fb('0x23')](_0x129088['query'][_0x35fb('0x23')]);}_0x5a1b8e['order']=qs[_0x35fb('0x42')](_0x129088['query'][_0x35fb('0x42')]);_0x5a1b8e[_0x35fb('0x44')]=qs[_0x35fb('0x3d')](_['pick'](_0x129088[_0x35fb('0x3c')],_0x417328['filters']));_0x5a1b8e[_0x35fb('0x44')][_0x35fb('0x5c')]=_0x192b86['id'];if(_0x129088[_0x35fb('0x3c')]['filter']){_0x5a1b8e[_0x35fb('0x44')]=_[_0x35fb('0x47')](_0x5a1b8e['where'],{'$or':_['map'](_0x5a1b8e['attributes'],function(_0x596390){var _0x44ece2={};_0x44ece2[_0x596390]={'$like':'%'+_0x129088[_0x35fb('0x3c')][_0x35fb('0x46')]+'%'};return _0x44ece2;})});}_0x5a1b8e=_[_0x35fb('0x47')]({},_0x5a1b8e,_0x129088['options']);return db['UserFaxQueue']['findAll'](_0x5a1b8e);}})[_0x35fb('0x2c')](function(_0x47f595){if(_0x47f595){return db['User']['findAndCountAll']({'where':{'id':_[_0x35fb('0x35')](_0x47f595,'UserId'),'role':_0x35fb('0x5d')},'attributes':['id','name',_0x35fb('0x5e'),_0x35fb('0x5f'),_0x35fb('0x60')]});}})[_0x35fb('0x2c')](function(_0x1a7905){if(_0x1a7905){return{'count':_0x1a7905[_0x35fb('0x26')],'rows':_[_0x35fb('0x35')](_0x1a7905['rows'],function(_0x4e642f){return{'membername':_0x4e642f[_0x35fb('0x32')],'UserId':_0x4e642f['id'],'queue_name':_0x572c15[_0x35fb('0x32')],'FaxQueueId':_0x572c15['id'],'interface':util['format'](_0x35fb('0x61'),_0x35fb('0x62'),_0x4e642f['name']),'penalty':0x0,'paused':_0x4e642f[_0x35fb('0x5e')],'createdAt':_0x4e642f[_0x35fb('0x60')],'updatedAt':_0x4e642f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x35fb('0x2c')](respondWithFilteredResult(_0x3f8ec6,_0x5a1b8e))[_0x35fb('0x4c')](handleError(_0x3f8ec6,null));};exports[_0x35fb('0x63')]=function(_0x5d4e1f,_0x4d95d3,_0x5901d8){var _0x4f0358={};var _0x576d85={};var _0xaa1a9e;var _0x2722c6;return db[_0x35fb('0x49')]['findOne']({'where':{'id':_0x5d4e1f[_0x35fb('0x57')]['id']}})[_0x35fb('0x2c')](handleEntityNotFound(_0x4d95d3,null))[_0x35fb('0x2c')](function(_0x3196bd){if(_0x3196bd){_0xaa1a9e=_0x3196bd;_0x576d85[_0x35fb('0x3a')]=_[_0x35fb('0x3b')](db[_0x35fb('0x64')][_0x35fb('0x36')]);_0x576d85[_0x35fb('0x3c')]=_[_0x35fb('0x3b')](_0x5d4e1f[_0x35fb('0x3c')]);_0x576d85[_0x35fb('0x3d')]=_[_0x35fb('0x3e')](_0x576d85[_0x35fb('0x3a')],_0x576d85[_0x35fb('0x3c')]);_0x4f0358['attributes']=_[_0x35fb('0x3e')](_0x576d85[_0x35fb('0x3a')],qs['fields'](_0x5d4e1f[_0x35fb('0x3c')][_0x35fb('0x40')]));_0x4f0358[_0x35fb('0x3f')]=_0x4f0358[_0x35fb('0x3f')][_0x35fb('0x41')]?_0x4f0358[_0x35fb('0x3f')]:_0x576d85[_0x35fb('0x3a')];_0x4f0358[_0x35fb('0x65')]=qs['sort'](_0x5d4e1f['query'][_0x35fb('0x42')]);_0x4f0358[_0x35fb('0x44')]=qs['filters'](_['pick'](_0x5d4e1f['query'],_0x576d85[_0x35fb('0x3d')]));if(_0x5d4e1f[_0x35fb('0x3c')]['filter']){_0x4f0358['where']=_[_0x35fb('0x47')](_0x4f0358[_0x35fb('0x44')],{'$or':_[_0x35fb('0x35')](_0x4f0358[_0x35fb('0x3f')],function(_0x33caca){var _0x5a9bef={};_0x5a9bef[_0x33caca]={'$like':'%'+_0x5d4e1f[_0x35fb('0x3c')][_0x35fb('0x46')]+'%'};return _0x5a9bef;})});}_0x4f0358=_[_0x35fb('0x47')]({},_0x4f0358,_0x5d4e1f[_0x35fb('0x48')]);return _0xaa1a9e['getTeams'](_0x4f0358);}})[_0x35fb('0x2c')](function(_0xda6837){if(_0xda6837){_0x2722c6=_0xda6837[_0x35fb('0x41')];if(!_0x5d4e1f[_0x35fb('0x3c')][_0x35fb('0x66')](_0x35fb('0x5b'))){_0x4f0358['limit']=qs[_0x35fb('0x25')](_0x5d4e1f[_0x35fb('0x3c')][_0x35fb('0x25')]);_0x4f0358[_0x35fb('0x23')]=qs[_0x35fb('0x23')](_0x5d4e1f[_0x35fb('0x3c')][_0x35fb('0x23')]);}return _0xaa1a9e[_0x35fb('0x63')](_0x4f0358);}})[_0x35fb('0x2c')](function(_0x11f14a){if(_0x11f14a){return _0x11f14a?{'count':_0x2722c6,'rows':_0x11f14a}:null;}})[_0x35fb('0x2c')](respondWithResult(_0x4d95d3,null))[_0x35fb('0x4c')](handleError(_0x4d95d3,null));};exports[_0x35fb('0x67')]=function(_0xd7f183,_0x24475e,_0x59b532){var _0x328b64=_0xd7f183['body'][_0x35fb('0x68')];return db[_0x35fb('0x64')]['findAll']({'where':{'id':_0x328b64},'attributes':['id'],'include':[{'model':db[_0x35fb('0x69')],'as':_0x35fb('0x6a'),'attributes':['id',_0x35fb('0x32'),_0x35fb('0x6b'),_0x35fb('0x6c'),'interface'],'raw':!![]}]})[_0x35fb('0x2c')](function(_0x4444ff){if(_0x4444ff){var _0x3ecac0=_['flatMap'](_0x4444ff,function(_0x1ed3e5){var _0x1b429c=_0x1ed3e5[_0x35fb('0x2e')]({'plain':!![]});return _0x1b429c[_0x35fb('0x6a')];});return db['FaxQueue'][_0x35fb('0x4e')]({'where':{'id':_0xd7f183[_0x35fb('0x57')]['id']}})[_0x35fb('0x2c')](function(_0x171745){return db[_0x35fb('0x6d')][_0x35fb('0x6e')](function(_0x543705){return _0x171745['addTeams'](_0x328b64,{'transaction':_0x543705})[_0x35fb('0x2c')](function(){return BPromise[_0x35fb('0x6f')](_0x3ecac0,function(_0x32e57f){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x32e57f['id'],'FaxQueueId':_0xd7f183['params']['id']},'transaction':_0x543705});});})['then'](function(){_0x3ecac0[_0x35fb('0x70')](function(_0x31079b){socket[_0x35fb('0x71')]('userFaxQueue:save',{'UserId':_0x31079b['id'],'FaxQueueId':_0x171745['id']});});});});});}})['then'](respondWithStatusCode(_0x24475e,null))['catch'](handleError(_0x24475e,null));};exports[_0x35fb('0x72')]=function(_0x4ea261,_0x3584e7,_0x210247){return db[_0x35fb('0x64')][_0x35fb('0x4a')]({'where':{'id':_0x4ea261[_0x35fb('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db[_0x35fb('0x69')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x35fb('0x2c')](handleEntityNotFound(_0x3584e7,null))[_0x35fb('0x2c')](function(_0x2b37fe){var _0x3df894=_[_0x35fb('0x35')](_0x2b37fe,'id');var _0x29bb12=[];var _0x18fbe2=[];var _0x10f5fd=squel[_0x35fb('0x73')]();_0x10f5fd['field']('tq.TeamId')[_0x35fb('0x74')](_0x35fb('0x75'),'tq')[_0x35fb('0x76')](_0x35fb('0x77'),'ut',_0x35fb('0x78'))[_0x35fb('0x44')]('FaxQueueId\x20=\x20?',_0x4ea261[_0x35fb('0x57')]['id']);for(var _0x409fc1=0x0;_0x409fc1<_0x2b37fe[_0x35fb('0x41')];_0x409fc1+=0x1){let _0x406e95=_0x2b37fe[_0x409fc1];for(var _0x3927e3=0x0;_0x3927e3<_0x406e95[_0x35fb('0x6a')]['length'];_0x3927e3+=0x1){let _0x1e95a2=_0x406e95[_0x35fb('0x6a')][_0x3927e3];var _0x430133=_0x10f5fd['clone']();_0x430133[_0x35fb('0x44')](_0x35fb('0x79'),_0x1e95a2['id']);_0x18fbe2['push'](db['sequelize'][_0x35fb('0x3c')](_0x430133[_0x35fb('0x7a')](),{'type':db[_0x35fb('0x6d')]['QueryTypes'][_0x35fb('0x7b')]})[_0x35fb('0x2c')](function(_0x8887a){if(_0x8887a[_0x35fb('0x41')]===0x1){return _0x1e95a2['id'];}else{var _0x4b96fc=_['every'](_['map'](_0x8887a,_0x35fb('0x7c')),function(_0x3eb21c){return _[_0x35fb('0x7d')](_0x3df894,_0x3eb21c);});if(_0x4b96fc){return _0x1e95a2['id'];}}}));}}return BPromise[_0x35fb('0x7e')](_0x18fbe2)[_0x35fb('0x2c')](function(_0x374234){_0x29bb12=_(_0x29bb12)[_0x35fb('0x7f')](_0x374234)[_0x35fb('0x80')]()['value']();return db[_0x35fb('0x49')][_0x35fb('0x4e')]({'where':{'id':_0x4ea261[_0x35fb('0x57')]['id']}})['then'](function(_0x18bfcf){return db[_0x35fb('0x6d')]['transaction'](function(_0x166744){return _0x18bfcf[_0x35fb('0x72')](_0x4ea261[_0x35fb('0x3c')]['ids'],{'transaction':_0x166744})[_0x35fb('0x2c')](function(){if(!_[_0x35fb('0x81')](_0x29bb12)){return _0x18bfcf['removeAgents'](_0x29bb12,{'transaction':_0x166744});}})[_0x35fb('0x2c')](function(){_0x29bb12[_0x35fb('0x70')](function(_0x1eddba){socket[_0x35fb('0x71')](_0x35fb('0x82'),{'UserId':_0x1eddba,'FaxQueueId':_0x18bfcf['id']});});});});});});})[_0x35fb('0x2c')](respondWithStatusCode(_0x3584e7,null))[_0x35fb('0x4c')](handleError(_0x3584e7,null));};exports[_0x35fb('0x83')]=function(_0x33fd31,_0xc44da9,_0x204c43){return db[_0x35fb('0x49')]['find']({'where':{'id':_0x33fd31[_0x35fb('0x57')]['id']}})[_0x35fb('0x2c')](handleEntityNotFound(_0xc44da9,null))[_0x35fb('0x2c')](function(_0x52ee5d){if(_0x52ee5d){return _0x52ee5d[_0x35fb('0x83')](_0x33fd31[_0x35fb('0x50')][_0x35fb('0x68')],_[_0x35fb('0x84')](_0x33fd31['body'],[_0x35fb('0x68'),'id'])||{})[_0x35fb('0x85')](function(_0x446e5c){for(var _0x24a874=0x0;_0x24a874<_0x33fd31[_0x35fb('0x50')][_0x35fb('0x68')]['length'];_0x24a874+=0x1){socket['emit'](_0x35fb('0x86'),{'UserId':Number(_0x33fd31[_0x35fb('0x50')][_0x35fb('0x68')][_0x24a874]),'FaxQueueId':Number(_0x33fd31[_0x35fb('0x57')]['id'])});}return _0x446e5c;});}})[_0x35fb('0x2c')](respondWithResult(_0xc44da9,null))[_0x35fb('0x4c')](handleError(_0xc44da9,null));};exports[_0x35fb('0x87')]=function(_0x15ecbd,_0x2991aa,_0x38893a){return db[_0x35fb('0x49')][_0x35fb('0x4e')]({'where':{'id':_0x15ecbd[_0x35fb('0x57')]['id']}})['then'](handleEntityNotFound(_0x2991aa,null))['then'](function(_0x7d753a){if(_0x7d753a){return _0x7d753a['removeAgents'](_0x15ecbd['query'][_0x35fb('0x68')])[_0x35fb('0x2c')](function(){if(_[_0x35fb('0x88')](_0x15ecbd['query'][_0x35fb('0x68')])){for(var _0x32d15a=0x0;_0x32d15a<_0x15ecbd[_0x35fb('0x3c')][_0x35fb('0x68')][_0x35fb('0x41')];_0x32d15a+=0x1){socket[_0x35fb('0x71')](_0x35fb('0x82'),{'UserId':Number(_0x15ecbd[_0x35fb('0x3c')][_0x35fb('0x68')][_0x32d15a]),'FaxQueueId':Number(_0x15ecbd[_0x35fb('0x57')]['id'])});}}else{socket[_0x35fb('0x71')](_0x35fb('0x82'),{'UserId':Number(_0x15ecbd[_0x35fb('0x3c')][_0x35fb('0x68')]),'FaxQueueId':Number(_0x15ecbd[_0x35fb('0x57')]['id'])});}});}})[_0x35fb('0x2c')](respondWithStatusCode(_0x2991aa,null))[_0x35fb('0x4c')](handleError(_0x2991aa,null));};exports[_0x35fb('0x89')]=function(_0x308a24,_0x125319,_0x42cc73){var _0x2fbd8e={};var _0x45aa98={};var _0x522407;var _0x5784b2;return db['FaxQueue'][_0x35fb('0x59')]({'where':{'id':_0x308a24[_0x35fb('0x57')]['id']}})[_0x35fb('0x2c')](handleEntityNotFound(_0x125319,null))['then'](function(_0x49d788){if(_0x49d788){_0x522407=_0x49d788;_0x45aa98[_0x35fb('0x3a')]=_['keys'](db[_0x35fb('0x69')][_0x35fb('0x36')]);_0x45aa98[_0x35fb('0x3c')]=_[_0x35fb('0x3b')](_0x308a24['query']);_0x45aa98['filters']=_[_0x35fb('0x3e')](_0x45aa98['model'],_0x45aa98['query']);_0x2fbd8e['attributes']=_[_0x35fb('0x3e')](_0x45aa98[_0x35fb('0x3a')],qs[_0x35fb('0x40')](_0x308a24[_0x35fb('0x3c')][_0x35fb('0x40')]));_0x2fbd8e['attributes']=_0x2fbd8e[_0x35fb('0x3f')][_0x35fb('0x41')]?_0x2fbd8e[_0x35fb('0x3f')]:_0x45aa98[_0x35fb('0x3a')];_0x2fbd8e[_0x35fb('0x65')]=qs[_0x35fb('0x42')](_0x308a24[_0x35fb('0x3c')]['sort']);_0x2fbd8e[_0x35fb('0x44')]=qs[_0x35fb('0x3d')](_[_0x35fb('0x43')](_0x308a24['query'],_0x45aa98[_0x35fb('0x3d')]));if(_0x308a24['query'][_0x35fb('0x46')]){_0x2fbd8e[_0x35fb('0x44')]=_[_0x35fb('0x47')](_0x2fbd8e[_0x35fb('0x44')],{'$or':_[_0x35fb('0x35')](_0x2fbd8e[_0x35fb('0x3f')],function(_0x1ecd7d){var _0x3df99f={};_0x3df99f[_0x1ecd7d]={'$like':'%'+_0x308a24[_0x35fb('0x3c')][_0x35fb('0x46')]+'%'};return _0x3df99f;})});}_0x2fbd8e=_[_0x35fb('0x47')]({},_0x2fbd8e,_0x308a24['options']);return _0x522407[_0x35fb('0x89')](_0x2fbd8e);}})[_0x35fb('0x2c')](function(_0x58d96b){if(_0x58d96b){_0x5784b2=_0x58d96b[_0x35fb('0x41')];if(!_0x308a24[_0x35fb('0x3c')][_0x35fb('0x66')]('nolimit')){_0x2fbd8e[_0x35fb('0x25')]=qs[_0x35fb('0x25')](_0x308a24[_0x35fb('0x3c')][_0x35fb('0x25')]);_0x2fbd8e['offset']=qs['offset'](_0x308a24['query']['offset']);}return _0x522407[_0x35fb('0x89')](_0x2fbd8e);}})[_0x35fb('0x2c')](function(_0x599131){if(_0x599131){return _0x599131?{'count':_0x5784b2,'rows':_0x599131}:null;}})['then'](respondWithResult(_0x125319,null))[_0x35fb('0x4c')](handleError(_0x125319,null));};
\ No newline at end of file
index f815fe3..d1035a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb138=['emit','hasOwnProperty','hook','events','FaxQueue','setMaxListeners','update'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xb138,0x1a0));var _0x8b13=function(_0x27fefa,_0x5b995a){_0x27fefa=_0x27fefa-0x0;var _0x9652a5=_0xb138[_0x27fefa];return _0x9652a5;};'use strict';var EventEmitter=require(_0x8b13('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x8b13('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8b13('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8b13('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2223b8){return function(_0x5cfae4,_0x12d3ff,_0x571b99){FaxQueueEvents[_0x8b13('0x4')](_0x2223b8+':'+_0x5cfae4['id'],_0x5cfae4);FaxQueueEvents[_0x8b13('0x4')](_0x2223b8,_0x5cfae4);_0x571b99(null);};}for(var e in events){if(events[_0x8b13('0x5')](e)){var event=events[e];FaxQueue[_0x8b13('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
+var _0xa1b5=['exports','events','../../mysqldb','FaxQueue','update','remove','emit','hasOwnProperty'];(function(_0x12c3a0,_0x37b939){var _0x5203ca=function(_0x1a4ac1){while(--_0x1a4ac1){_0x12c3a0['push'](_0x12c3a0['shift']());}};_0x5203ca(++_0x37b939);}(_0xa1b5,0x99));var _0x5a1b=function(_0x132967,_0x3926b8){_0x132967=_0x132967-0x0;var _0x35e4a7=_0xa1b5[_0x132967];return _0x35e4a7;};'use strict';var EventEmitter=require(_0x5a1b('0x0'));var FaxQueue=require(_0x5a1b('0x1'))['db'][_0x5a1b('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5a1b('0x3'),'afterDestroy':_0x5a1b('0x4')};function emitEvent(_0x5e2ed5){return function(_0x301889,_0x541f4c,_0x28b417){FaxQueueEvents[_0x5a1b('0x5')](_0x5e2ed5+':'+_0x301889['id'],_0x301889);FaxQueueEvents['emit'](_0x5e2ed5,_0x301889);_0x28b417(null);};}for(var e in events){if(events[_0x5a1b('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x5a1b('0x7')]=FaxQueueEvents;
\ No newline at end of file
index 952130d..81d4055 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4ab=['api','moment','bluebird','request-promise','path','../../config/environment','./faxQueue.attributes','FaxQueue','fax_queues','lodash','util','../../config/logger'];(function(_0xc3b891,_0x5a06a6){var _0xe3d063=function(_0x51bd94){while(--_0x51bd94){_0xc3b891['push'](_0xc3b891['shift']());}};_0xe3d063(++_0x5a06a6);}(_0xd4ab,0xd5));var _0xbd4a=function(_0x3520a0,_0x27eecf){_0x3520a0=_0x3520a0-0x0;var _0x2a6ed6=_0xd4ab[_0x3520a0];return _0x2a6ed6;};'use strict';var _=require(_0xbd4a('0x0'));var util=require(_0xbd4a('0x1'));var logger=require(_0xbd4a('0x2'))(_0xbd4a('0x3'));var moment=require(_0xbd4a('0x4'));var BPromise=require(_0xbd4a('0x5'));var rp=require(_0xbd4a('0x6'));var fs=require('fs');var path=require(_0xbd4a('0x7'));var rimraf=require('rimraf');var config=require(_0xbd4a('0x8'));var attributes=require(_0xbd4a('0x9'));module['exports']=function(_0x55b96c,_0x242aa5){return _0x55b96c['define'](_0xbd4a('0xa'),attributes,{'tableName':_0xbd4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3148=['FaxQueue','fax_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define'];(function(_0x2ee8a2,_0x7477f0){var _0xce6a35=function(_0x49b6b8){while(--_0x49b6b8){_0x2ee8a2['push'](_0x2ee8a2['shift']());}};_0xce6a35(++_0x7477f0);}(_0x3148,0x1d6));var _0x8314=function(_0x47e934,_0x11d22f){_0x47e934=_0x47e934-0x0;var _0x2088eb=_0x3148[_0x47e934];return _0x2088eb;};'use strict';var _=require(_0x8314('0x0'));var util=require('util');var logger=require(_0x8314('0x1'))('api');var moment=require(_0x8314('0x2'));var BPromise=require(_0x8314('0x3'));var rp=require(_0x8314('0x4'));var fs=require('fs');var path=require(_0x8314('0x5'));var rimraf=require(_0x8314('0x6'));var config=require(_0x8314('0x7'));var attributes=require(_0x8314('0x8'));module['exports']=function(_0x38b42a,_0x4f916c){return _0x38b42a[_0x8314('0x9')](_0x8314('0xa'),attributes,{'tableName':_0x8314('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ea606e7..2f389ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83fc=['./faxQueue.socket','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxQueue','options','raw','include','map','model','attributes','GetFaxQueue','find','where','ShowFaxQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x505458,_0x2164b5){var _0x27c96a=function(_0x421036){while(--_0x421036){_0x505458['push'](_0x505458['shift']());}};_0x27c96a(++_0x2164b5);}(_0x83fc,0x66));var _0xc83f=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x83fc[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xc83f('0x0'));var util=require(_0xc83f('0x1'));var moment=require(_0xc83f('0x2'));var BPromise=require(_0xc83f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc83f('0x4'));var db=require(_0xc83f('0x5'))['db'];var utils=require(_0xc83f('0x6'));var logger=require(_0xc83f('0x7'))(_0xc83f('0x8'));var config=require(_0xc83f('0x9'));var jayson=require(_0xc83f('0xa'));var client=jayson[_0xc83f('0xb')][_0xc83f('0xc')]({'port':0x232a});config[_0xc83f('0xd')]=_[_0xc83f('0xe')](config[_0xc83f('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc83f('0xd')]));require(_0xc83f('0xf'))['register'](socket);function respondWithRpcPromise(_0x1b9308,_0x3f3e74,_0x4a4d4e){return new BPromise(function(_0x165eea,_0x48ff46){return client['request'](_0x1b9308,_0x4a4d4e)[_0xc83f('0x10')](function(_0x2e2ad9){logger[_0xc83f('0x11')](_0xc83f('0x12'),_0x3f3e74,_0xc83f('0x13'));logger[_0xc83f('0x14')](_0xc83f('0x15'),_0x3f3e74,'request\x20sent',JSON[_0xc83f('0x16')](_0x2e2ad9));if(_0x2e2ad9[_0xc83f('0x17')]){if(_0x2e2ad9[_0xc83f('0x17')][_0xc83f('0x18')]===0x1f4){logger[_0xc83f('0x17')](_0xc83f('0x12'),_0x3f3e74,_0x2e2ad9[_0xc83f('0x17')][_0xc83f('0x19')]);return _0x48ff46(_0x2e2ad9[_0xc83f('0x17')][_0xc83f('0x19')]);}logger[_0xc83f('0x17')](_0xc83f('0x12'),_0x3f3e74,_0x2e2ad9[_0xc83f('0x17')][_0xc83f('0x19')]);return _0x165eea(_0x2e2ad9[_0xc83f('0x17')]['message']);}else{logger[_0xc83f('0x11')](_0xc83f('0x12'),_0x3f3e74,'request\x20sent');_0x165eea(_0x2e2ad9[_0xc83f('0x1a')][_0xc83f('0x19')]);}})[_0xc83f('0x1b')](function(_0x12fb5e){logger[_0xc83f('0x17')](_0xc83f('0x12'),_0x3f3e74,_0x12fb5e);_0x48ff46(_0x12fb5e);});});}exports['GetFaxQueue']=function(_0x20d8dd){var _0x425503=this;return new Promise(function(_0x43436e,_0xb59ea8){return db[_0xc83f('0x1c')]['findAll']({'raw':_0x20d8dd[_0xc83f('0x1d')]?_0x20d8dd['options'][_0xc83f('0x1e')]===undefined?!![]:![]:!![],'where':_0x20d8dd['options']?_0x20d8dd[_0xc83f('0x1d')]['where']||null:null,'attributes':_0x20d8dd['options']?_0x20d8dd[_0xc83f('0x1d')]['attributes']||null:null,'limit':_0x20d8dd[_0xc83f('0x1d')]?_0x20d8dd['options']['limit']||null:null,'include':_0x20d8dd[_0xc83f('0x1d')]?_0x20d8dd[_0xc83f('0x1d')][_0xc83f('0x1f')]?_[_0xc83f('0x20')](_0x20d8dd['options']['include'],function(_0x8580fa){return{'model':db[_0x8580fa[_0xc83f('0x21')]],'as':_0x8580fa['as'],'attributes':_0x8580fa[_0xc83f('0x22')],'include':_0x8580fa[_0xc83f('0x1f')]?_[_0xc83f('0x20')](_0x8580fa['include'],function(_0x280815){return{'model':db[_0x280815[_0xc83f('0x21')]],'as':_0x280815['as'],'attributes':_0x280815[_0xc83f('0x22')],'include':_0x280815[_0xc83f('0x1f')]?_['map'](_0x280815['include'],function(_0x2627a1){return{'model':db[_0x2627a1['model']],'as':_0x2627a1['as'],'attributes':_0x2627a1[_0xc83f('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc83f('0x10')](function(_0x55fa22){logger[_0xc83f('0x11')](_0xc83f('0x23'),_0x20d8dd);logger['debug'](_0xc83f('0x23'),_0x20d8dd,JSON[_0xc83f('0x16')](_0x55fa22));_0x43436e(_0x55fa22);})['catch'](function(_0x1e1295){logger[_0xc83f('0x17')]('GetFaxQueue',_0x1e1295[_0xc83f('0x19')],_0x20d8dd);_0xb59ea8(_0x425503[_0xc83f('0x17')](0x1f4,_0x1e1295[_0xc83f('0x19')]));});});};exports['ShowFaxQueue']=function(_0xa2fbbf){var _0x28bc94=this;return new Promise(function(_0x5a2f69,_0x4bff7d){return db[_0xc83f('0x1c')][_0xc83f('0x24')]({'raw':_0xa2fbbf['options']?_0xa2fbbf[_0xc83f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xa2fbbf['options']?_0xa2fbbf['options'][_0xc83f('0x25')]||null:null,'attributes':_0xa2fbbf[_0xc83f('0x1d')]?_0xa2fbbf[_0xc83f('0x1d')][_0xc83f('0x22')]||null:null,'include':_0xa2fbbf[_0xc83f('0x1d')]?_0xa2fbbf[_0xc83f('0x1d')][_0xc83f('0x1f')]?_['map'](_0xa2fbbf['options'][_0xc83f('0x1f')],function(_0x2d7490){return{'model':db[_0x2d7490[_0xc83f('0x21')]],'as':_0x2d7490['as'],'attributes':_0x2d7490[_0xc83f('0x22')],'include':_0x2d7490[_0xc83f('0x1f')]?_[_0xc83f('0x20')](_0x2d7490[_0xc83f('0x1f')],function(_0x54ede5){return{'model':db[_0x54ede5[_0xc83f('0x21')]],'as':_0x54ede5['as'],'attributes':_0x54ede5['attributes'],'include':_0x54ede5[_0xc83f('0x1f')]?_['map'](_0x54ede5[_0xc83f('0x1f')],function(_0x54eb67){return{'model':db[_0x54eb67[_0xc83f('0x21')]],'as':_0x54eb67['as'],'attributes':_0x54eb67[_0xc83f('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc83f('0x10')](function(_0x55945d){logger['info'](_0xc83f('0x26'),_0xa2fbbf);logger['debug'](_0xc83f('0x26'),_0xa2fbbf,JSON['stringify'](_0x55945d));_0x5a2f69(_0x55945d);})[_0xc83f('0x1b')](function(_0x550da2){logger[_0xc83f('0x17')](_0xc83f('0x26'),_0x550da2['message'],_0xa2fbbf);_0x4bff7d(_0x28bc94['error'](0x1f4,_0x550da2[_0xc83f('0x19')]));});});};
\ No newline at end of file
+var _0x98fd=['raw','debug','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','FaxQueue','options','where','attributes','include','map','model','GetFaxQueue','ShowFaxQueue','find'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x98fd,0x78));var _0xd98f=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x98fd[_0x34325b];return _0x3da348;};'use strict';var _=require(_0xd98f('0x0'));var util=require(_0xd98f('0x1'));var moment=require(_0xd98f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd98f('0x3'));var db=require(_0xd98f('0x4'))['db'];var utils=require(_0xd98f('0x5'));var logger=require(_0xd98f('0x6'))('rpc');var config=require(_0xd98f('0x7'));var jayson=require(_0xd98f('0x8'));var client=jayson[_0xd98f('0x9')][_0xd98f('0xa')]({'port':0x232a});config[_0xd98f('0xb')]=_[_0xd98f('0xc')](config[_0xd98f('0xb')],{'host':_0xd98f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd98f('0xe'))[_0xd98f('0xf')](socket);function respondWithRpcPromise(_0x43fbf3,_0x481ead,_0x348cb7){return new BPromise(function(_0x451070,_0x448145){return client[_0xd98f('0x10')](_0x43fbf3,_0x348cb7)[_0xd98f('0x11')](function(_0x3e9b1c){logger[_0xd98f('0x12')](_0xd98f('0x13'),_0x481ead,_0xd98f('0x14'));logger['debug'](_0xd98f('0x15'),_0x481ead,_0xd98f('0x14'),JSON[_0xd98f('0x16')](_0x3e9b1c));if(_0x3e9b1c[_0xd98f('0x17')]){if(_0x3e9b1c['error']['code']===0x1f4){logger['error'](_0xd98f('0x13'),_0x481ead,_0x3e9b1c[_0xd98f('0x17')][_0xd98f('0x18')]);return _0x448145(_0x3e9b1c[_0xd98f('0x17')][_0xd98f('0x18')]);}logger[_0xd98f('0x17')](_0xd98f('0x13'),_0x481ead,_0x3e9b1c[_0xd98f('0x17')]['message']);return _0x451070(_0x3e9b1c[_0xd98f('0x17')][_0xd98f('0x18')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x481ead,_0xd98f('0x14'));_0x451070(_0x3e9b1c[_0xd98f('0x19')][_0xd98f('0x18')]);}})['catch'](function(_0x35ad6a){logger['error'](_0xd98f('0x13'),_0x481ead,_0x35ad6a);_0x448145(_0x35ad6a);});});}exports['GetFaxQueue']=function(_0x560acd){var _0x5bdc8d=this;return new Promise(function(_0x54bf30,_0x524dbc){return db[_0xd98f('0x1a')]['findAll']({'raw':_0x560acd['options']?_0x560acd['options']['raw']===undefined?!![]:![]:!![],'where':_0x560acd[_0xd98f('0x1b')]?_0x560acd[_0xd98f('0x1b')][_0xd98f('0x1c')]||null:null,'attributes':_0x560acd[_0xd98f('0x1b')]?_0x560acd[_0xd98f('0x1b')][_0xd98f('0x1d')]||null:null,'limit':_0x560acd[_0xd98f('0x1b')]?_0x560acd[_0xd98f('0x1b')]['limit']||null:null,'include':_0x560acd[_0xd98f('0x1b')]?_0x560acd[_0xd98f('0x1b')][_0xd98f('0x1e')]?_[_0xd98f('0x1f')](_0x560acd[_0xd98f('0x1b')][_0xd98f('0x1e')],function(_0x235e20){return{'model':db[_0x235e20[_0xd98f('0x20')]],'as':_0x235e20['as'],'attributes':_0x235e20[_0xd98f('0x1d')],'include':_0x235e20[_0xd98f('0x1e')]?_[_0xd98f('0x1f')](_0x235e20[_0xd98f('0x1e')],function(_0x2594bd){return{'model':db[_0x2594bd[_0xd98f('0x20')]],'as':_0x2594bd['as'],'attributes':_0x2594bd['attributes'],'include':_0x2594bd['include']?_[_0xd98f('0x1f')](_0x2594bd[_0xd98f('0x1e')],function(_0x42a954){return{'model':db[_0x42a954[_0xd98f('0x20')]],'as':_0x42a954['as'],'attributes':_0x42a954['attributes']};}):[]};}):[]};}):[]:[]})[_0xd98f('0x11')](function(_0x329af8){logger[_0xd98f('0x12')](_0xd98f('0x21'),_0x560acd);logger['debug'](_0xd98f('0x21'),_0x560acd,JSON[_0xd98f('0x16')](_0x329af8));_0x54bf30(_0x329af8);})['catch'](function(_0x22177c){logger[_0xd98f('0x17')]('GetFaxQueue',_0x22177c[_0xd98f('0x18')],_0x560acd);_0x524dbc(_0x5bdc8d[_0xd98f('0x17')](0x1f4,_0x22177c[_0xd98f('0x18')]));});});};exports[_0xd98f('0x22')]=function(_0x4e7807){var _0x2dff4d=this;return new Promise(function(_0x31cdc1,_0x32e0dd){return db['FaxQueue'][_0xd98f('0x23')]({'raw':_0x4e7807[_0xd98f('0x1b')]?_0x4e7807[_0xd98f('0x1b')][_0xd98f('0x24')]===undefined?!![]:![]:!![],'where':_0x4e7807[_0xd98f('0x1b')]?_0x4e7807[_0xd98f('0x1b')][_0xd98f('0x1c')]||null:null,'attributes':_0x4e7807[_0xd98f('0x1b')]?_0x4e7807['options'][_0xd98f('0x1d')]||null:null,'include':_0x4e7807[_0xd98f('0x1b')]?_0x4e7807[_0xd98f('0x1b')]['include']?_['map'](_0x4e7807[_0xd98f('0x1b')][_0xd98f('0x1e')],function(_0x2ed15b){return{'model':db[_0x2ed15b['model']],'as':_0x2ed15b['as'],'attributes':_0x2ed15b[_0xd98f('0x1d')],'include':_0x2ed15b[_0xd98f('0x1e')]?_[_0xd98f('0x1f')](_0x2ed15b[_0xd98f('0x1e')],function(_0xfebc1){return{'model':db[_0xfebc1[_0xd98f('0x20')]],'as':_0xfebc1['as'],'attributes':_0xfebc1['attributes'],'include':_0xfebc1[_0xd98f('0x1e')]?_['map'](_0xfebc1[_0xd98f('0x1e')],function(_0x116ba3){return{'model':db[_0x116ba3[_0xd98f('0x20')]],'as':_0x116ba3['as'],'attributes':_0x116ba3['attributes']};}):[]};}):[]};}):[]:[]})[_0xd98f('0x11')](function(_0x1f0bf1){logger['info'](_0xd98f('0x22'),_0x4e7807);logger[_0xd98f('0x25')](_0xd98f('0x22'),_0x4e7807,JSON['stringify'](_0x1f0bf1));_0x31cdc1(_0x1f0bf1);})[_0xd98f('0x26')](function(_0x2f3a18){logger[_0xd98f('0x17')]('ShowFaxQueue',_0x2f3a18[_0xd98f('0x18')],_0x4e7807);_0x32e0dd(_0x2dff4d[_0xd98f('0x17')](0x1f4,_0x2f3a18[_0xd98f('0x18')]));});});};
\ No newline at end of file
index 147b7de..15a1be6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61eb=['removeListener','register','length','faxQueue:','./faxQueue.events','save','remove'];(function(_0x18a01c,_0xd1a13a){var _0x2b0cd6=function(_0x563571){while(--_0x563571){_0x18a01c['push'](_0x18a01c['shift']());}};_0x2b0cd6(++_0xd1a13a);}(_0x61eb,0x14d));var _0xb61e=function(_0x138a75,_0x4a0e7c){_0x138a75=_0x138a75-0x0;var _0x4e7560=_0x61eb[_0x138a75];return _0x4e7560;};'use strict';var FaxQueueEvents=require(_0xb61e('0x0'));var events=[_0xb61e('0x1'),_0xb61e('0x2'),'update'];function createListener(_0x3f762d,_0x446c4b){return function(_0x5a014e){_0x446c4b['emit'](_0x3f762d,_0x5a014e);};}function removeListener(_0x16a16b,_0xc9dd5){return function(){FaxQueueEvents[_0xb61e('0x3')](_0x16a16b,_0xc9dd5);};}exports[_0xb61e('0x4')]=function(_0x551dce){for(var _0x10c401=0x0,_0x5ae373=events[_0xb61e('0x5')];_0x10c401<_0x5ae373;_0x10c401++){var _0xe56b6c=events[_0x10c401];var _0x429478=createListener(_0xb61e('0x6')+_0xe56b6c,_0x551dce);FaxQueueEvents['on'](_0xe56b6c,_0x429478);}};
\ No newline at end of file
+var _0x0e85=['update','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x3d6058,_0x34b9b6){var _0xf5c655=function(_0x19b704){while(--_0x19b704){_0x3d6058['push'](_0x3d6058['shift']());}};_0xf5c655(++_0x34b9b6);}(_0x0e85,0x7c));var _0x50e8=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x0e85[_0x47aa64];return _0x549c7a;};'use strict';var FaxQueueEvents=require(_0x50e8('0x0'));var events=[_0x50e8('0x1'),'remove',_0x50e8('0x2')];function createListener(_0x682d10,_0x55e515){return function(_0x55cba3){_0x55e515['emit'](_0x682d10,_0x55cba3);};}function removeListener(_0x236cf3,_0x4e90e7){return function(){FaxQueueEvents[_0x50e8('0x3')](_0x236cf3,_0x4e90e7);};}exports[_0x50e8('0x4')]=function(_0xe3151e){for(var _0xfde42=0x0,_0x5e8b01=events[_0x50e8('0x5')];_0xfde42<_0x5e8b01;_0xfde42++){var _0x108edc=events[_0xfde42];var _0x42665e=createListener(_0x50e8('0x6')+_0x108edc,_0xe3151e);FaxQueueEvents['on'](_0x108edc,_0x42665e);}};
\ No newline at end of file
index 818c8c1..bf53412 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b29=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b29,0x163));var _0x92b2=function(_0x3be9b5,_0x41fe38){_0x3be9b5=_0x3be9b5-0x0;var _0x523abf=_0x2b29[_0x3be9b5];return _0x523abf;};'use strict';var multer=require('multer');var util=require(_0x92b2('0x0'));var path=require(_0x92b2('0x1'));var timeout=require(_0x92b2('0x2'));var express=require(_0x92b2('0x3'));var router=express['Router']();var fs_extra=require(_0x92b2('0x4'));var auth=require(_0x92b2('0x5'));var interaction=require(_0x92b2('0x6'));var config=require(_0x92b2('0x7'));var controller=require(_0x92b2('0x8'));router[_0x92b2('0x9')]('/',auth['isAuthenticated'](),controller[_0x92b2('0xa')]);router['get'](_0x92b2('0xb'),auth[_0x92b2('0xc')](),controller['describe']);router[_0x92b2('0x9')](_0x92b2('0xd'),auth[_0x92b2('0xc')](),controller[_0x92b2('0xe')]);router['get'](_0x92b2('0xf'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x10')]);router[_0x92b2('0x9')](_0x92b2('0x11'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x12')]);router['get'](_0x92b2('0x13'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x14')]);router['post']('/',auth[_0x92b2('0xc')](),controller[_0x92b2('0x15')]);router[_0x92b2('0x16')](_0x92b2('0x11'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x17')]);router['post'](_0x92b2('0x13'),auth['isAuthenticated'](),controller[_0x92b2('0x18')]);router[_0x92b2('0x19')](_0x92b2('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x92b2('0x1a')]('/:id',auth[_0x92b2('0xc')](),controller['destroy']);router[_0x92b2('0x1a')](_0x92b2('0x11'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x1b')]);router[_0x92b2('0x1a')](_0x92b2('0x13'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x1c')]);module[_0x92b2('0x1d')]=router;
\ No newline at end of file
+var _0x2da6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','update','delete','removeTeams','removeAgents','multer','util','path'];(function(_0x199e07,_0x3a61a2){var _0x515de1=function(_0x345ac5){while(--_0x345ac5){_0x199e07['push'](_0x199e07['shift']());}};_0x515de1(++_0x3a61a2);}(_0x2da6,0x1dd));var _0x62da=function(_0x490280,_0x129cea){_0x490280=_0x490280-0x0;var _0x340609=_0x2da6[_0x490280];return _0x340609;};'use strict';var multer=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var path=require(_0x62da('0x2'));var timeout=require(_0x62da('0x3'));var express=require(_0x62da('0x4'));var router=express[_0x62da('0x5')]();var fs_extra=require(_0x62da('0x6'));var auth=require(_0x62da('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x62da('0x8'));router[_0x62da('0x9')]('/',auth[_0x62da('0xa')](),controller[_0x62da('0xb')]);router[_0x62da('0x9')](_0x62da('0xc'),auth[_0x62da('0xa')](),controller[_0x62da('0xd')]);router[_0x62da('0x9')]('/:id',auth[_0x62da('0xa')](),controller[_0x62da('0xe')]);router[_0x62da('0x9')](_0x62da('0xf'),auth['isAuthenticated'](),controller[_0x62da('0x10')]);router[_0x62da('0x9')](_0x62da('0x11'),auth[_0x62da('0xa')](),controller[_0x62da('0x12')]);router['get'](_0x62da('0x13'),auth[_0x62da('0xa')](),controller[_0x62da('0x14')]);router[_0x62da('0x15')]('/',auth[_0x62da('0xa')](),controller['create']);router['post'](_0x62da('0x11'),auth[_0x62da('0xa')](),controller[_0x62da('0x16')]);router[_0x62da('0x15')](_0x62da('0x13'),auth[_0x62da('0xa')](),controller[_0x62da('0x17')]);router[_0x62da('0x18')](_0x62da('0x19'),auth[_0x62da('0xa')](),controller[_0x62da('0x1a')]);router[_0x62da('0x1b')](_0x62da('0x19'),auth[_0x62da('0xa')](),controller['destroy']);router['delete'](_0x62da('0x11'),auth['isAuthenticated'](),controller[_0x62da('0x1c')]);router[_0x62da('0x1b')](_0x62da('0x13'),auth['isAuthenticated'](),controller[_0x62da('0x1d')]);module['exports']=router;
\ No newline at end of file
index bcd4213..8a40747 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8888=['exports','STRING','DATE','moment','sequelize'];(function(_0x1739e3,_0x31f4bf){var _0x238d44=function(_0x4e67f8){while(--_0x4e67f8){_0x1739e3['push'](_0x1739e3['shift']());}};_0x238d44(++_0x31f4bf);}(_0x8888,0x99));var _0x8888=function(_0x581d43,_0x2c8a96){_0x581d43=_0x581d43-0x0;var _0x4a11de=_0x8888[_0x581d43];return _0x4a11de;};'use strict';var moment=require(_0x8888('0x0'));var Sequelize=require(_0x8888('0x1'));module[_0x8888('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8888('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8888('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8888('0x4')]},'reason':{'type':Sequelize[_0x8888('0x3')]}};
\ No newline at end of file
+var _0xa75d=['moment','sequelize','exports','STRING','DATE'];(function(_0x423094,_0x32832e){var _0x1f129a=function(_0x53aa4d){while(--_0x53aa4d){_0x423094['push'](_0x423094['shift']());}};_0x1f129a(++_0x32832e);}(_0xa75d,0x1a9));var _0xda75=function(_0x4bfc91,_0x29f93d){_0x4bfc91=_0x4bfc91-0x0;var _0x59189e=_0xa75d[_0x4bfc91];return _0x59189e;};'use strict';var moment=require(_0xda75('0x0'));var Sequelize=require(_0xda75('0x1'));module[_0xda75('0x2')]={'uniqueid':{'type':Sequelize[_0xda75('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xda75('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xda75('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xda75('0x3')]}};
\ No newline at end of file
index 0db9455..f0a3b93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b05=['include','findAll','rows','show','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','type','options','includeAll'];(function(_0x324817,_0x2eb0bd){var _0x2abc80=function(_0x40c8c8){while(--_0x40c8c8){_0x324817['push'](_0x324817['shift']());}};_0x2abc80(++_0x2eb0bd);}(_0x5b05,0x190));var _0x55b0=function(_0x261bb4,_0x23add8){_0x261bb4=_0x261bb4-0x0;var _0x4544a6=_0x5b05[_0x261bb4];return _0x4544a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x55b0('0x0'));var zipdir=require(_0x55b0('0x1'));var jsonpatch=require(_0x55b0('0x2'));var rp=require(_0x55b0('0x3'));var moment=require(_0x55b0('0x4'));var BPromise=require(_0x55b0('0x5'));var Mustache=require(_0x55b0('0x6'));var util=require(_0x55b0('0x7'));var path=require(_0x55b0('0x8'));var sox=require(_0x55b0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55b0('0xa'));var _=require(_0x55b0('0xb'));var squel=require(_0x55b0('0xc'));var crypto=require(_0x55b0('0xd'));var jsforce=require(_0x55b0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x55b0('0xf'));var querystring=require(_0x55b0('0x10'));var Papa=require(_0x55b0('0x11'));var Redis=require(_0x55b0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x55b0('0x13'));var hardwareService=require(_0x55b0('0x14'));var logger=require(_0x55b0('0x15'))(_0x55b0('0x16'));var utils=require(_0x55b0('0x17'));var config=require(_0x55b0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x55b0('0x19'))['db'];function respondWithStatusCode(_0x35212d,_0x4d8be8){_0x4d8be8=_0x4d8be8||0xcc;return function(_0x8c1df0){if(_0x8c1df0){return _0x35212d[_0x55b0('0x1a')](_0x4d8be8);}return _0x35212d[_0x55b0('0x1b')](_0x4d8be8)[_0x55b0('0x1c')]();};}function respondWithResult(_0x5baa88,_0x525f9b){_0x525f9b=_0x525f9b||0xc8;return function(_0x4d614b){if(_0x4d614b){return _0x5baa88[_0x55b0('0x1b')](_0x525f9b)['json'](_0x4d614b);}};}function respondWithFilteredResult(_0x7d7527,_0x3ca8e2){return function(_0x4d2271){if(_0x4d2271){var _0x15fa8f=typeof _0x3ca8e2[_0x55b0('0x1d')]===_0x55b0('0x1e')&&typeof _0x3ca8e2[_0x55b0('0x1f')]===_0x55b0('0x1e');var _0x4f98ba=_0x4d2271[_0x55b0('0x20')];var _0x20b1c5=_0x15fa8f?0x0:_0x3ca8e2[_0x55b0('0x1d')];var _0x5ca2ec=_0x15fa8f?_0x4d2271['count']:_0x3ca8e2[_0x55b0('0x1d')]+_0x3ca8e2[_0x55b0('0x1f')];var _0x3f9458;if(_0x5ca2ec>=_0x4f98ba){_0x5ca2ec=_0x4f98ba;_0x3f9458=0xc8;}else{_0x3f9458=0xce;}_0x7d7527['status'](_0x3f9458);return _0x7d7527[_0x55b0('0x21')](_0x55b0('0x22'),_0x20b1c5+'-'+_0x5ca2ec+'/'+_0x4f98ba)[_0x55b0('0x23')](_0x4d2271);}return null;};}function patchUpdates(_0x3ff56c){return function(_0x55b08e){try{jsonpatch[_0x55b0('0x24')](_0x55b08e,_0x3ff56c,!![]);}catch(_0x27ecd1){return BPromise[_0x55b0('0x25')](_0x27ecd1);}return _0x55b08e[_0x55b0('0x26')]();};}function saveUpdates(_0x4fa147,_0x4082ce){return function(_0x5e3acc){if(_0x5e3acc){return _0x5e3acc[_0x55b0('0x27')](_0x4fa147)['then'](function(_0x33bcc1){return _0x33bcc1;});}return null;};}function removeEntity(_0x25eb8a,_0x1ea756){return function(_0x3056f8){if(_0x3056f8){return _0x3056f8[_0x55b0('0x28')]()[_0x55b0('0x29')](function(){_0x25eb8a[_0x55b0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x244092,_0x54f74f){return function(_0x494092){if(!_0x494092){_0x244092[_0x55b0('0x1a')](0x194);}return _0x494092;};}function handleError(_0x43b2c8,_0x5b2dc8){_0x5b2dc8=_0x5b2dc8||0x1f4;return function(_0x177bb8){logger['error'](_0x177bb8[_0x55b0('0x2a')]);if(_0x177bb8[_0x55b0('0x2b')]){delete _0x177bb8[_0x55b0('0x2b')];}_0x43b2c8[_0x55b0('0x1b')](_0x5b2dc8)[_0x55b0('0x2c')](_0x177bb8);};}exports[_0x55b0('0x2d')]=function(_0x20385f,_0x3b0262){var _0x10d5c9={},_0x4273e0={},_0x443d20={'count':0x0,'rows':[]};var _0x1237f9=_[_0x55b0('0x2e')](db[_0x55b0('0x2f')][_0x55b0('0x30')],function(_0xc62841){return{'name':_0xc62841[_0x55b0('0x31')],'type':_0xc62841['type'][_0x55b0('0x32')]};});_0x4273e0[_0x55b0('0x33')]=_[_0x55b0('0x2e')](_0x1237f9,_0x55b0('0x2b'));_0x4273e0['query']=_[_0x55b0('0x34')](_0x20385f[_0x55b0('0x35')]);_0x4273e0[_0x55b0('0x36')]=_[_0x55b0('0x37')](_0x4273e0[_0x55b0('0x33')],_0x4273e0[_0x55b0('0x35')]);_0x10d5c9['attributes']=_[_0x55b0('0x37')](_0x4273e0['model'],qs[_0x55b0('0x38')](_0x20385f[_0x55b0('0x35')][_0x55b0('0x38')]));_0x10d5c9[_0x55b0('0x39')]=_0x10d5c9[_0x55b0('0x39')][_0x55b0('0x3a')]?_0x10d5c9[_0x55b0('0x39')]:_0x4273e0[_0x55b0('0x33')];if(!_0x20385f[_0x55b0('0x35')][_0x55b0('0x3b')]('nolimit')){_0x10d5c9[_0x55b0('0x1f')]=qs[_0x55b0('0x1f')](_0x20385f[_0x55b0('0x35')][_0x55b0('0x1f')]);_0x10d5c9[_0x55b0('0x1d')]=qs[_0x55b0('0x1d')](_0x20385f[_0x55b0('0x35')][_0x55b0('0x1d')]);}_0x10d5c9[_0x55b0('0x3c')]=qs['sort'](_0x20385f['query'][_0x55b0('0x3d')]);_0x10d5c9['where']=qs[_0x55b0('0x36')](_['pick'](_0x20385f[_0x55b0('0x35')],_0x4273e0[_0x55b0('0x36')]),_0x1237f9);if(_0x20385f['query'][_0x55b0('0x3e')]){_0x10d5c9[_0x55b0('0x3f')]=_[_0x55b0('0x40')](_0x10d5c9['where'],{'$or':_['map'](_0x1237f9,function(_0x512969){if(_0x512969[_0x55b0('0x41')]!=='VIRTUAL'){var _0x4b7d7b={};_0x4b7d7b[_0x512969[_0x55b0('0x2b')]]={'$like':'%'+_0x20385f[_0x55b0('0x35')]['filter']+'%'};return _0x4b7d7b;}})});}_0x10d5c9=_[_0x55b0('0x40')]({},_0x10d5c9,_0x20385f[_0x55b0('0x42')]);var _0x4a70c5={'where':_0x10d5c9['where']};return db[_0x55b0('0x2f')][_0x55b0('0x20')](_0x4a70c5)[_0x55b0('0x29')](function(_0x5f4afc){_0x443d20[_0x55b0('0x20')]=_0x5f4afc;if(_0x20385f[_0x55b0('0x35')][_0x55b0('0x43')]){_0x10d5c9[_0x55b0('0x44')]=[{'all':!![]}];}return db[_0x55b0('0x2f')][_0x55b0('0x45')](_0x10d5c9);})[_0x55b0('0x29')](function(_0x163f93){_0x443d20[_0x55b0('0x46')]=_0x163f93;return _0x443d20;})['then'](respondWithFilteredResult(_0x3b0262,_0x10d5c9))['catch'](handleError(_0x3b0262,null));};exports[_0x55b0('0x47')]=function(_0x323fbc,_0x10bbd9){var _0x22e0c9={'raw':!![],'where':{'id':_0x323fbc['params']['id']}},_0x5cb5e1={};_0x5cb5e1['model']=_[_0x55b0('0x34')](db[_0x55b0('0x2f')][_0x55b0('0x30')]);_0x5cb5e1[_0x55b0('0x35')]=_[_0x55b0('0x34')](_0x323fbc[_0x55b0('0x35')]);_0x5cb5e1['filters']=_[_0x55b0('0x37')](_0x5cb5e1[_0x55b0('0x33')],_0x5cb5e1[_0x55b0('0x35')]);_0x22e0c9['attributes']=_[_0x55b0('0x37')](_0x5cb5e1[_0x55b0('0x33')],qs[_0x55b0('0x38')](_0x323fbc[_0x55b0('0x35')][_0x55b0('0x38')]));_0x22e0c9[_0x55b0('0x39')]=_0x22e0c9['attributes'][_0x55b0('0x3a')]?_0x22e0c9['attributes']:_0x5cb5e1[_0x55b0('0x33')];if(_0x323fbc[_0x55b0('0x35')][_0x55b0('0x43')]){_0x22e0c9[_0x55b0('0x44')]=[{'all':!![]}];}_0x22e0c9=_[_0x55b0('0x40')]({},_0x22e0c9,_0x323fbc[_0x55b0('0x42')]);return db[_0x55b0('0x2f')][_0x55b0('0x48')](_0x22e0c9)['then'](handleEntityNotFound(_0x10bbd9,null))['then'](respondWithResult(_0x10bbd9,null))[_0x55b0('0x49')](handleError(_0x10bbd9,null));};exports[_0x55b0('0x4a')]=function(_0x358b0a,_0x42783e){return db['FaxQueueReport']['create'](_0x358b0a[_0x55b0('0x4b')],{})[_0x55b0('0x29')](respondWithResult(_0x42783e,0xc9))[_0x55b0('0x49')](handleError(_0x42783e,null));};exports['update']=function(_0x4b2df2,_0x7e2fc){if(_0x4b2df2['body']['id']){delete _0x4b2df2[_0x55b0('0x4b')]['id'];}return db[_0x55b0('0x2f')][_0x55b0('0x48')]({'where':{'id':_0x4b2df2[_0x55b0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x7e2fc,null))[_0x55b0('0x29')](saveUpdates(_0x4b2df2['body'],null))[_0x55b0('0x29')](respondWithResult(_0x7e2fc,null))[_0x55b0('0x49')](handleError(_0x7e2fc,null));};exports[_0x55b0('0x28')]=function(_0x955c43,_0xe15280){return db['FaxQueueReport'][_0x55b0('0x48')]({'where':{'id':_0x955c43[_0x55b0('0x4c')]['id']}})[_0x55b0('0x29')](handleEntityNotFound(_0xe15280,null))[_0x55b0('0x29')](removeEntity(_0xe15280,null))['catch'](handleError(_0xe15280,null));};exports[_0x55b0('0x4d')]=function(_0xac7532,_0x3bdaa7){return db[_0x55b0('0x2f')][_0x55b0('0x4d')]()['then'](respondWithResult(_0x3bdaa7,null))[_0x55b0('0x49')](handleError(_0x3bdaa7,null));};
\ No newline at end of file
+var _0x8fcf=['hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length'];(function(_0x22c702,_0x87cf6f){var _0x582f9b=function(_0x126453){while(--_0x126453){_0x22c702['push'](_0x22c702['shift']());}};_0x582f9b(++_0x87cf6f);}(_0x8fcf,0x1db));var _0xf8fc=function(_0x363dc5,_0xd6f81c){_0x363dc5=_0x363dc5-0x0;var _0x58c3c7=_0x8fcf[_0x363dc5];return _0x58c3c7;};'use strict';var emlformat=require(_0xf8fc('0x0'));var rimraf=require(_0xf8fc('0x1'));var zipdir=require(_0xf8fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8fc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf8fc('0x4'));var path=require(_0xf8fc('0x5'));var sox=require(_0xf8fc('0x6'));var csv=require(_0xf8fc('0x7'));var ejs=require(_0xf8fc('0x8'));var fs=require('fs');var fs_extra=require(_0xf8fc('0x9'));var _=require(_0xf8fc('0xa'));var squel=require(_0xf8fc('0xb'));var crypto=require('crypto');var jsforce=require(_0xf8fc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf8fc('0x7'));var querystring=require(_0xf8fc('0xd'));var Papa=require(_0xf8fc('0xe'));var Redis=require(_0xf8fc('0xf'));var authService=require(_0xf8fc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf8fc('0x11'));var hardwareService=require(_0xf8fc('0x12'));var logger=require('../../config/logger')(_0xf8fc('0x13'));var utils=require(_0xf8fc('0x14'));var config=require(_0xf8fc('0x15'));var licenseUtil=require(_0xf8fc('0x16'));var db=require(_0xf8fc('0x17'))['db'];function respondWithStatusCode(_0x21635e,_0x5714e2){_0x5714e2=_0x5714e2||0xcc;return function(_0x4591a8){if(_0x4591a8){return _0x21635e[_0xf8fc('0x18')](_0x5714e2);}return _0x21635e[_0xf8fc('0x19')](_0x5714e2)[_0xf8fc('0x1a')]();};}function respondWithResult(_0x58a6ee,_0x5f1cc6){_0x5f1cc6=_0x5f1cc6||0xc8;return function(_0x512e4b){if(_0x512e4b){return _0x58a6ee['status'](_0x5f1cc6)[_0xf8fc('0x1b')](_0x512e4b);}};}function respondWithFilteredResult(_0x34c6f7,_0x210078){return function(_0x419930){if(_0x419930){var _0x2742e4=typeof _0x210078['offset']===_0xf8fc('0x1c')&&typeof _0x210078[_0xf8fc('0x1d')]===_0xf8fc('0x1c');var _0x2829f7=_0x419930[_0xf8fc('0x1e')];var _0xe2770c=_0x2742e4?0x0:_0x210078[_0xf8fc('0x1f')];var _0x396cf5=_0x2742e4?_0x419930[_0xf8fc('0x1e')]:_0x210078[_0xf8fc('0x1f')]+_0x210078[_0xf8fc('0x1d')];var _0x4a0907;if(_0x396cf5>=_0x2829f7){_0x396cf5=_0x2829f7;_0x4a0907=0xc8;}else{_0x4a0907=0xce;}_0x34c6f7['status'](_0x4a0907);return _0x34c6f7[_0xf8fc('0x20')](_0xf8fc('0x21'),_0xe2770c+'-'+_0x396cf5+'/'+_0x2829f7)[_0xf8fc('0x1b')](_0x419930);}return null;};}function patchUpdates(_0x4a4cfa){return function(_0x3816d3){try{jsonpatch['apply'](_0x3816d3,_0x4a4cfa,!![]);}catch(_0x197912){return BPromise[_0xf8fc('0x22')](_0x197912);}return _0x3816d3[_0xf8fc('0x23')]();};}function saveUpdates(_0x56ea0f,_0x9965ab){return function(_0x17dca8){if(_0x17dca8){return _0x17dca8[_0xf8fc('0x24')](_0x56ea0f)[_0xf8fc('0x25')](function(_0x2e700b){return _0x2e700b;});}return null;};}function removeEntity(_0x529d68,_0x4e0ea1){return function(_0x5de910){if(_0x5de910){return _0x5de910[_0xf8fc('0x26')]()[_0xf8fc('0x25')](function(){_0x529d68['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x429b7a,_0x38d3b6){return function(_0x42f086){if(!_0x42f086){_0x429b7a[_0xf8fc('0x18')](0x194);}return _0x42f086;};}function handleError(_0xd24a2c,_0x288a56){_0x288a56=_0x288a56||0x1f4;return function(_0x2bcdf1){logger[_0xf8fc('0x27')](_0x2bcdf1[_0xf8fc('0x28')]);if(_0x2bcdf1[_0xf8fc('0x29')]){delete _0x2bcdf1['name'];}_0xd24a2c[_0xf8fc('0x19')](_0x288a56)[_0xf8fc('0x2a')](_0x2bcdf1);};}exports[_0xf8fc('0x2b')]=function(_0x456cc1,_0x5299bf){var _0x2aa716={},_0x551cd3={},_0x3a40bd={'count':0x0,'rows':[]};var _0x6f5e3b=_['map'](db[_0xf8fc('0x2c')][_0xf8fc('0x2d')],function(_0x5826c1){return{'name':_0x5826c1[_0xf8fc('0x2e')],'type':_0x5826c1['type'][_0xf8fc('0x2f')]};});_0x551cd3[_0xf8fc('0x30')]=_[_0xf8fc('0x31')](_0x6f5e3b,_0xf8fc('0x29'));_0x551cd3[_0xf8fc('0x32')]=_[_0xf8fc('0x33')](_0x456cc1[_0xf8fc('0x32')]);_0x551cd3[_0xf8fc('0x34')]=_['intersection'](_0x551cd3['model'],_0x551cd3[_0xf8fc('0x32')]);_0x2aa716[_0xf8fc('0x35')]=_[_0xf8fc('0x36')](_0x551cd3[_0xf8fc('0x30')],qs[_0xf8fc('0x37')](_0x456cc1[_0xf8fc('0x32')][_0xf8fc('0x37')]));_0x2aa716[_0xf8fc('0x35')]=_0x2aa716[_0xf8fc('0x35')][_0xf8fc('0x38')]?_0x2aa716[_0xf8fc('0x35')]:_0x551cd3[_0xf8fc('0x30')];if(!_0x456cc1[_0xf8fc('0x32')][_0xf8fc('0x39')]('nolimit')){_0x2aa716[_0xf8fc('0x1d')]=qs['limit'](_0x456cc1['query'][_0xf8fc('0x1d')]);_0x2aa716['offset']=qs[_0xf8fc('0x1f')](_0x456cc1['query']['offset']);}_0x2aa716[_0xf8fc('0x3a')]=qs[_0xf8fc('0x3b')](_0x456cc1[_0xf8fc('0x32')][_0xf8fc('0x3b')]);_0x2aa716[_0xf8fc('0x3c')]=qs[_0xf8fc('0x34')](_[_0xf8fc('0x3d')](_0x456cc1[_0xf8fc('0x32')],_0x551cd3['filters']),_0x6f5e3b);if(_0x456cc1['query']['filter']){_0x2aa716[_0xf8fc('0x3c')]=_[_0xf8fc('0x3e')](_0x2aa716[_0xf8fc('0x3c')],{'$or':_['map'](_0x6f5e3b,function(_0x54cefe){if(_0x54cefe['type']!=='VIRTUAL'){var _0xf9b2d5={};_0xf9b2d5[_0x54cefe[_0xf8fc('0x29')]]={'$like':'%'+_0x456cc1[_0xf8fc('0x32')][_0xf8fc('0x3f')]+'%'};return _0xf9b2d5;}})});}_0x2aa716=_[_0xf8fc('0x3e')]({},_0x2aa716,_0x456cc1[_0xf8fc('0x40')]);var _0x20c152={'where':_0x2aa716[_0xf8fc('0x3c')]};return db[_0xf8fc('0x2c')][_0xf8fc('0x1e')](_0x20c152)['then'](function(_0x41da94){_0x3a40bd[_0xf8fc('0x1e')]=_0x41da94;if(_0x456cc1[_0xf8fc('0x32')][_0xf8fc('0x41')]){_0x2aa716[_0xf8fc('0x42')]=[{'all':!![]}];}return db[_0xf8fc('0x2c')][_0xf8fc('0x43')](_0x2aa716);})[_0xf8fc('0x25')](function(_0x55f45b){_0x3a40bd[_0xf8fc('0x44')]=_0x55f45b;return _0x3a40bd;})[_0xf8fc('0x25')](respondWithFilteredResult(_0x5299bf,_0x2aa716))[_0xf8fc('0x45')](handleError(_0x5299bf,null));};exports[_0xf8fc('0x46')]=function(_0x5c1728,_0xc60ea4){var _0x1682ed={'raw':!![],'where':{'id':_0x5c1728[_0xf8fc('0x47')]['id']}},_0x41b835={};_0x41b835['model']=_['keys'](db[_0xf8fc('0x2c')][_0xf8fc('0x2d')]);_0x41b835['query']=_[_0xf8fc('0x33')](_0x5c1728[_0xf8fc('0x32')]);_0x41b835[_0xf8fc('0x34')]=_[_0xf8fc('0x36')](_0x41b835['model'],_0x41b835[_0xf8fc('0x32')]);_0x1682ed[_0xf8fc('0x35')]=_[_0xf8fc('0x36')](_0x41b835[_0xf8fc('0x30')],qs[_0xf8fc('0x37')](_0x5c1728['query'][_0xf8fc('0x37')]));_0x1682ed[_0xf8fc('0x35')]=_0x1682ed['attributes'][_0xf8fc('0x38')]?_0x1682ed[_0xf8fc('0x35')]:_0x41b835['model'];if(_0x5c1728[_0xf8fc('0x32')][_0xf8fc('0x41')]){_0x1682ed[_0xf8fc('0x42')]=[{'all':!![]}];}_0x1682ed=_[_0xf8fc('0x3e')]({},_0x1682ed,_0x5c1728['options']);return db[_0xf8fc('0x2c')][_0xf8fc('0x48')](_0x1682ed)[_0xf8fc('0x25')](handleEntityNotFound(_0xc60ea4,null))[_0xf8fc('0x25')](respondWithResult(_0xc60ea4,null))[_0xf8fc('0x45')](handleError(_0xc60ea4,null));};exports['create']=function(_0x6cc190,_0x4f69b0){return db[_0xf8fc('0x2c')][_0xf8fc('0x49')](_0x6cc190[_0xf8fc('0x4a')],{})[_0xf8fc('0x25')](respondWithResult(_0x4f69b0,0xc9))[_0xf8fc('0x45')](handleError(_0x4f69b0,null));};exports['update']=function(_0x39f4e3,_0x3d2d1e){if(_0x39f4e3[_0xf8fc('0x4a')]['id']){delete _0x39f4e3[_0xf8fc('0x4a')]['id'];}return db[_0xf8fc('0x2c')][_0xf8fc('0x48')]({'where':{'id':_0x39f4e3[_0xf8fc('0x47')]['id']}})[_0xf8fc('0x25')](handleEntityNotFound(_0x3d2d1e,null))[_0xf8fc('0x25')](saveUpdates(_0x39f4e3[_0xf8fc('0x4a')],null))[_0xf8fc('0x25')](respondWithResult(_0x3d2d1e,null))[_0xf8fc('0x45')](handleError(_0x3d2d1e,null));};exports[_0xf8fc('0x26')]=function(_0x4d08ec,_0x460d32){return db[_0xf8fc('0x2c')]['find']({'where':{'id':_0x4d08ec['params']['id']}})[_0xf8fc('0x25')](handleEntityNotFound(_0x460d32,null))[_0xf8fc('0x25')](removeEntity(_0x460d32,null))[_0xf8fc('0x45')](handleError(_0x460d32,null));};exports[_0xf8fc('0x4b')]=function(_0x199bc4,_0x3c7e53){return db[_0xf8fc('0x2c')][_0xf8fc('0x4b')]()[_0xf8fc('0x25')](respondWithResult(_0x3c7e53,null))[_0xf8fc('0x45')](handleError(_0x3c7e53,null));};
\ No newline at end of file
index c7ae97d..9e0d93f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x8e7495,_0x53f622){var _0x40ae78=function(_0x3a4639){while(--_0x3a4639){_0x8e7495['push'](_0x8e7495['shift']());}};_0x40ae78(++_0x53f622);}(_0x1261,0x144));var _0x1126=function(_0x32efcb,_0x55523f){_0x32efcb=_0x32efcb-0x0;var _0x1dae88=_0x1261[_0x32efcb];return _0x1dae88;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0295=['rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash','api','request-promise','path'];(function(_0x40b89b,_0x402e89){var _0x5e3173=function(_0x4c00c7){while(--_0x4c00c7){_0x40b89b['push'](_0x40b89b['shift']());}};_0x5e3173(++_0x402e89);}(_0x0295,0x1f0));var _0x5029=function(_0x7342e,_0x1c3fe7){_0x7342e=_0x7342e-0x0;var _0x524ece=_0x0295[_0x7342e];return _0x524ece;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5029('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index ea8280c..d8e3873 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9da=['bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FaxQueueReport','create','body','options','CreateFaxQueueReport','UpdateFaxQueueReport','update','attributes','limit','lodash','util','moment'];(function(_0xd780d9,_0x363e00){var _0x7a8708=function(_0x48aa46){while(--_0x48aa46){_0xd780d9['push'](_0xd780d9['shift']());}};_0x7a8708(++_0x363e00);}(_0xa9da,0x19d));var _0xaa9d=function(_0x8fcdbf,_0x5e3bcd){_0x8fcdbf=_0x8fcdbf-0x0;var _0x1bace7=_0xa9da[_0x8fcdbf];return _0x1bace7;};'use strict';var _=require(_0xaa9d('0x0'));var util=require(_0xaa9d('0x1'));var moment=require(_0xaa9d('0x2'));var BPromise=require(_0xaa9d('0x3'));var rs=require(_0xaa9d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa9d('0x5'))['db'];var utils=require(_0xaa9d('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xaa9d('0x7'));var client=jayson[_0xaa9d('0x8')][_0xaa9d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e5d5b,_0x255fde,_0x20a03f){return new BPromise(function(_0x56b4fc,_0x4b3866){return client[_0xaa9d('0xa')](_0x4e5d5b,_0x20a03f)[_0xaa9d('0xb')](function(_0x7b814a){logger['info'](_0xaa9d('0xc'),_0x255fde,_0xaa9d('0xd'));logger[_0xaa9d('0xe')](_0xaa9d('0xf'),_0x255fde,'request\x20sent',JSON[_0xaa9d('0x10')](_0x7b814a));if(_0x7b814a[_0xaa9d('0x11')]){if(_0x7b814a[_0xaa9d('0x11')][_0xaa9d('0x12')]===0x1f4){logger[_0xaa9d('0x11')](_0xaa9d('0xc'),_0x255fde,_0x7b814a['error'][_0xaa9d('0x13')]);return _0x4b3866(_0x7b814a[_0xaa9d('0x11')][_0xaa9d('0x13')]);}logger[_0xaa9d('0x11')](_0xaa9d('0xc'),_0x255fde,_0x7b814a[_0xaa9d('0x11')]['message']);return _0x56b4fc(_0x7b814a['error'][_0xaa9d('0x13')]);}else{logger[_0xaa9d('0x14')](_0xaa9d('0xc'),_0x255fde,'request\x20sent');_0x56b4fc(_0x7b814a[_0xaa9d('0x15')][_0xaa9d('0x13')]);}})[_0xaa9d('0x16')](function(_0x3322f2){logger[_0xaa9d('0x11')](_0xaa9d('0xc'),_0x255fde,_0x3322f2);_0x4b3866(_0x3322f2);});});}exports['CreateFaxQueueReport']=function(_0x1fa3d1){var _0x512596=this;return new Promise(function(_0x37e7f7,_0x3e558d){return db[_0xaa9d('0x17')][_0xaa9d('0x18')](_0x1fa3d1[_0xaa9d('0x19')],{'raw':_0x1fa3d1[_0xaa9d('0x1a')]?_0x1fa3d1['options']['raw']===undefined?!![]:![]:!![]})[_0xaa9d('0xb')](function(_0x433565){logger[_0xaa9d('0x14')](_0xaa9d('0x1b'),_0x1fa3d1);logger[_0xaa9d('0xe')](_0xaa9d('0x1b'),_0x1fa3d1,JSON[_0xaa9d('0x10')](_0x433565));_0x37e7f7(_0x433565);})[_0xaa9d('0x16')](function(_0x6f8b91){logger[_0xaa9d('0x11')](_0xaa9d('0x1b'),_0x6f8b91['message'],_0x1fa3d1);_0x3e558d(_0x512596[_0xaa9d('0x11')](0x1f4,_0x6f8b91[_0xaa9d('0x13')]));});});};exports[_0xaa9d('0x1c')]=function(_0x501cd7){var _0x5910b0=this;return new Promise(function(_0x46a449,_0x295aea){return db[_0xaa9d('0x17')][_0xaa9d('0x1d')](_0x501cd7[_0xaa9d('0x19')],{'raw':_0x501cd7[_0xaa9d('0x1a')]?_0x501cd7[_0xaa9d('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x501cd7[_0xaa9d('0x1a')]?_0x501cd7['options']['where']||null:null,'attributes':_0x501cd7[_0xaa9d('0x1a')]?_0x501cd7['options'][_0xaa9d('0x1e')]||null:null,'limit':_0x501cd7['options']?_0x501cd7[_0xaa9d('0x1a')][_0xaa9d('0x1f')]||null:null})[_0xaa9d('0xb')](function(_0x4c398b){logger[_0xaa9d('0x14')](_0xaa9d('0x1c'),_0x501cd7);logger[_0xaa9d('0xe')]('UpdateFaxQueueReport',_0x501cd7,JSON[_0xaa9d('0x10')](_0x4c398b));_0x46a449(_0x4c398b);})['catch'](function(_0x33a334){logger['error'](_0xaa9d('0x1c'),_0x33a334[_0xaa9d('0x13')],_0x501cd7);_0x295aea(_0x5910b0[_0xaa9d('0x11')](0x1f4,_0x33a334[_0xaa9d('0x13')]));});});};
\ No newline at end of file
+var _0x52ec=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','debug','UpdateFaxQueueReport','where','attributes','limit','lodash','moment'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0x52ec,0xde));var _0xc52e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x52ec[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0xc52e('0x0'));var util=require('util');var moment=require(_0xc52e('0x1'));var BPromise=require(_0xc52e('0x2'));var rs=require(_0xc52e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc52e('0x4'))['db'];var utils=require(_0xc52e('0x5'));var logger=require(_0xc52e('0x6'))('rpc');var config=require(_0xc52e('0x7'));var jayson=require(_0xc52e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f3ae0,_0x1cbfca,_0x33fd08){return new BPromise(function(_0xd72cbc,_0x36b9e0){return client[_0xc52e('0x9')](_0x2f3ae0,_0x33fd08)[_0xc52e('0xa')](function(_0x5db876){logger['info'](_0xc52e('0xb'),_0x1cbfca,_0xc52e('0xc'));logger['debug'](_0xc52e('0xd'),_0x1cbfca,_0xc52e('0xc'),JSON[_0xc52e('0xe')](_0x5db876));if(_0x5db876[_0xc52e('0xf')]){if(_0x5db876[_0xc52e('0xf')][_0xc52e('0x10')]===0x1f4){logger[_0xc52e('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x1cbfca,_0x5db876['error'][_0xc52e('0x11')]);return _0x36b9e0(_0x5db876[_0xc52e('0xf')][_0xc52e('0x11')]);}logger[_0xc52e('0xf')](_0xc52e('0xb'),_0x1cbfca,_0x5db876[_0xc52e('0xf')][_0xc52e('0x11')]);return _0xd72cbc(_0x5db876['error']['message']);}else{logger[_0xc52e('0x12')](_0xc52e('0xb'),_0x1cbfca,_0xc52e('0xc'));_0xd72cbc(_0x5db876[_0xc52e('0x13')][_0xc52e('0x11')]);}})[_0xc52e('0x14')](function(_0x5ba4b2){logger[_0xc52e('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x1cbfca,_0x5ba4b2);_0x36b9e0(_0x5ba4b2);});});}exports['CreateFaxQueueReport']=function(_0xf794){var _0x1c8179=this;return new Promise(function(_0x54b10a,_0x51545d){return db[_0xc52e('0x15')][_0xc52e('0x16')](_0xf794[_0xc52e('0x17')],{'raw':_0xf794[_0xc52e('0x18')]?_0xf794['options'][_0xc52e('0x19')]===undefined?!![]:![]:!![]})[_0xc52e('0xa')](function(_0x23c720){logger['info'](_0xc52e('0x1a'),_0xf794);logger[_0xc52e('0x1b')](_0xc52e('0x1a'),_0xf794,JSON[_0xc52e('0xe')](_0x23c720));_0x54b10a(_0x23c720);})[_0xc52e('0x14')](function(_0x1273fb){logger[_0xc52e('0xf')](_0xc52e('0x1a'),_0x1273fb['message'],_0xf794);_0x51545d(_0x1c8179['error'](0x1f4,_0x1273fb['message']));});});};exports[_0xc52e('0x1c')]=function(_0x5ddbaa){var _0x1f6e88=this;return new Promise(function(_0x3f9104,_0x5dfb60){return db[_0xc52e('0x15')]['update'](_0x5ddbaa['body'],{'raw':_0x5ddbaa[_0xc52e('0x18')]?_0x5ddbaa['options'][_0xc52e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ddbaa[_0xc52e('0x18')]?_0x5ddbaa[_0xc52e('0x18')][_0xc52e('0x1d')]||null:null,'attributes':_0x5ddbaa['options']?_0x5ddbaa[_0xc52e('0x18')][_0xc52e('0x1e')]||null:null,'limit':_0x5ddbaa[_0xc52e('0x18')]?_0x5ddbaa[_0xc52e('0x18')][_0xc52e('0x1f')]||null:null})[_0xc52e('0xa')](function(_0x43a346){logger['info'](_0xc52e('0x1c'),_0x5ddbaa);logger['debug']('UpdateFaxQueueReport',_0x5ddbaa,JSON[_0xc52e('0xe')](_0x43a346));_0x3f9104(_0x43a346);})[_0xc52e('0x14')](function(_0x21904a){logger[_0xc52e('0xf')](_0xc52e('0x1c'),_0x21904a[_0xc52e('0x11')],_0x5ddbaa);_0x5dfb60(_0x1f6e88[_0xc52e('0xf')](0x1f4,_0x21904a[_0xc52e('0x11')]));});});};
\ No newline at end of file
index c308e9d..965de78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ab0=['post','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x2c3999,_0x48222d){var _0x1147af=function(_0x3908b0){while(--_0x3908b0){_0x2c3999['push'](_0x2c3999['shift']());}};_0x1147af(++_0x48222d);}(_0x3ab0,0x84));var _0x03ab=function(_0x14499c,_0x4039bf){_0x14499c=_0x14499c-0x0;var _0x28886b=_0x3ab0[_0x14499c];return _0x28886b;};'use strict';var multer=require(_0x03ab('0x0'));var util=require('util');var path=require(_0x03ab('0x1'));var timeout=require(_0x03ab('0x2'));var express=require('express');var router=express[_0x03ab('0x3')]();var fs_extra=require(_0x03ab('0x4'));var auth=require(_0x03ab('0x5'));var interaction=require(_0x03ab('0x6'));var config=require('../../config/environment');var controller=require(_0x03ab('0x7'));router[_0x03ab('0x8')]('/',auth[_0x03ab('0x9')](),controller[_0x03ab('0xa')]);router[_0x03ab('0x8')](_0x03ab('0xb'),auth[_0x03ab('0x9')](),controller[_0x03ab('0xc')]);router[_0x03ab('0x8')](_0x03ab('0xd'),auth['isAuthenticated'](),controller[_0x03ab('0xe')]);router[_0x03ab('0xf')]('/',auth[_0x03ab('0x9')](),controller['create']);router[_0x03ab('0x10')](_0x03ab('0xd'),auth[_0x03ab('0x9')](),controller[_0x03ab('0x11')]);router[_0x03ab('0x12')](_0x03ab('0xd'),auth['isAuthenticated'](),controller[_0x03ab('0x13')]);module[_0x03ab('0x14')]=router;
\ No newline at end of file
+var _0xd655=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd655,0x93));var _0x5d65=function(_0x3a13cf,_0x478c62){_0x3a13cf=_0x3a13cf-0x0;var _0x4817c=_0xd655[_0x3a13cf];return _0x4817c;};'use strict';var multer=require(_0x5d65('0x0'));var util=require(_0x5d65('0x1'));var path=require(_0x5d65('0x2'));var timeout=require(_0x5d65('0x3'));var express=require(_0x5d65('0x4'));var router=express[_0x5d65('0x5')]();var fs_extra=require(_0x5d65('0x6'));var auth=require(_0x5d65('0x7'));var interaction=require(_0x5d65('0x8'));var config=require(_0x5d65('0x9'));var controller=require('./faxQueueReport.controller');router[_0x5d65('0xa')]('/',auth[_0x5d65('0xb')](),controller[_0x5d65('0xc')]);router[_0x5d65('0xa')](_0x5d65('0xd'),auth[_0x5d65('0xb')](),controller[_0x5d65('0xe')]);router[_0x5d65('0xa')](_0x5d65('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x5d65('0x10')]('/',auth['isAuthenticated'](),controller[_0x5d65('0x11')]);router[_0x5d65('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5d65('0x13')]);router[_0x5d65('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x5d65('0x15')]);module[_0x5d65('0x16')]=router;
\ No newline at end of file
index 49fcac7..e33e899 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0xf9431c,_0x4754b5){var _0x53fc33=function(_0x50ac6c){while(--_0x50ac6c){_0xf9431c['push'](_0xf9431c['shift']());}};_0x53fc33(++_0x4754b5);}(_0x34e8,0x12c));var _0x834e=function(_0x10c506,_0xcaca0a){_0x10c506=_0x10c506-0x0;var _0x295601=_0x34e8[_0x10c506];return _0x295601;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
+var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x571f2e,_0x53f476){var _0x540a52=function(_0x455ea3){while(--_0x455ea3){_0x571f2e['push'](_0x571f2e['shift']());}};_0x540a52(++_0x53f476);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
index 1213243..6f98301 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9918=['catch','show','params','keys','intersection','fields','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','save','then','destroy','error','stack','name','index','map','rawAttributes','key','model','query','filters','attributes','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','FaxTransferReport','includeAll','include','findAll'];(function(_0x4a65a4,_0x1dd9eb){var _0x28f367=function(_0x10029a){while(--_0x10029a){_0x4a65a4['push'](_0x4a65a4['shift']());}};_0x28f367(++_0x1dd9eb);}(_0x9918,0x172));var _0x8991=function(_0x38233a,_0x371550){_0x38233a=_0x38233a-0x0;var _0x5e28ae=_0x9918[_0x38233a];return _0x5e28ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8991('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8991('0x1'));var rp=require(_0x8991('0x2'));var moment=require(_0x8991('0x3'));var BPromise=require(_0x8991('0x4'));var Mustache=require(_0x8991('0x5'));var util=require(_0x8991('0x6'));var path=require(_0x8991('0x7'));var sox=require(_0x8991('0x8'));var csv=require(_0x8991('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8991('0xa'));var _=require(_0x8991('0xb'));var squel=require(_0x8991('0xc'));var crypto=require(_0x8991('0xd'));var jsforce=require(_0x8991('0xe'));var deskjs=require(_0x8991('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8991('0x10'));var Papa=require(_0x8991('0x11'));var Redis=require(_0x8991('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8991('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8991('0x14'));var utils=require(_0x8991('0x15'));var config=require(_0x8991('0x16'));var licenseUtil=require(_0x8991('0x17'));var db=require(_0x8991('0x18'))['db'];function respondWithStatusCode(_0x4a465c,_0x22d4cf){_0x22d4cf=_0x22d4cf||0xcc;return function(_0x285655){if(_0x285655){return _0x4a465c[_0x8991('0x19')](_0x22d4cf);}return _0x4a465c[_0x8991('0x1a')](_0x22d4cf)['end']();};}function respondWithResult(_0x2a26fd,_0x381bfb){_0x381bfb=_0x381bfb||0xc8;return function(_0x380ecb){if(_0x380ecb){return _0x2a26fd['status'](_0x381bfb)[_0x8991('0x1b')](_0x380ecb);}};}function respondWithFilteredResult(_0x1b6a64,_0x364e5b){return function(_0x3fb2fb){if(_0x3fb2fb){var _0x144b88=typeof _0x364e5b[_0x8991('0x1c')]==='undefined'&&typeof _0x364e5b[_0x8991('0x1d')]===_0x8991('0x1e');var _0x21a92f=_0x3fb2fb[_0x8991('0x1f')];var _0x3a7aa7=_0x144b88?0x0:_0x364e5b[_0x8991('0x1c')];var _0x2511be=_0x144b88?_0x3fb2fb[_0x8991('0x1f')]:_0x364e5b[_0x8991('0x1c')]+_0x364e5b[_0x8991('0x1d')];var _0x2b2963;if(_0x2511be>=_0x21a92f){_0x2511be=_0x21a92f;_0x2b2963=0xc8;}else{_0x2b2963=0xce;}_0x1b6a64[_0x8991('0x1a')](_0x2b2963);return _0x1b6a64['set'](_0x8991('0x20'),_0x3a7aa7+'-'+_0x2511be+'/'+_0x21a92f)[_0x8991('0x1b')](_0x3fb2fb);}return null;};}function patchUpdates(_0x1096ed){return function(_0x5b3d0e){try{jsonpatch['apply'](_0x5b3d0e,_0x1096ed,!![]);}catch(_0x4ceec9){return BPromise['reject'](_0x4ceec9);}return _0x5b3d0e[_0x8991('0x21')]();};}function saveUpdates(_0x1e6fb3,_0x1c88c8){return function(_0x30babe){if(_0x30babe){return _0x30babe['update'](_0x1e6fb3)[_0x8991('0x22')](function(_0x1839bd){return _0x1839bd;});}return null;};}function removeEntity(_0x2055d1,_0x2e8872){return function(_0xaaa85){if(_0xaaa85){return _0xaaa85[_0x8991('0x23')]()['then'](function(){_0x2055d1[_0x8991('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e558e,_0x1d3a15){return function(_0x2ff701){if(!_0x2ff701){_0x5e558e['sendStatus'](0x194);}return _0x2ff701;};}function handleError(_0x253296,_0x6e0073){_0x6e0073=_0x6e0073||0x1f4;return function(_0x4e9337){logger[_0x8991('0x24')](_0x4e9337[_0x8991('0x25')]);if(_0x4e9337[_0x8991('0x26')]){delete _0x4e9337[_0x8991('0x26')];}_0x253296['status'](_0x6e0073)['send'](_0x4e9337);};}exports[_0x8991('0x27')]=function(_0x452099,_0x4f0b70){var _0x3debc5={},_0x44857f={},_0x4ade6e={'count':0x0,'rows':[]};var _0x38a1fc=_[_0x8991('0x28')](db['FaxTransferReport'][_0x8991('0x29')],function(_0x791abe){return{'name':_0x791abe['fieldName'],'type':_0x791abe['type'][_0x8991('0x2a')]};});_0x44857f[_0x8991('0x2b')]=_[_0x8991('0x28')](_0x38a1fc,_0x8991('0x26'));_0x44857f['query']=_['keys'](_0x452099[_0x8991('0x2c')]);_0x44857f[_0x8991('0x2d')]=_['intersection'](_0x44857f[_0x8991('0x2b')],_0x44857f[_0x8991('0x2c')]);_0x3debc5[_0x8991('0x2e')]=_['intersection'](_0x44857f['model'],qs['fields'](_0x452099[_0x8991('0x2c')]['fields']));_0x3debc5['attributes']=_0x3debc5[_0x8991('0x2e')][_0x8991('0x2f')]?_0x3debc5[_0x8991('0x2e')]:_0x44857f[_0x8991('0x2b')];if(!_0x452099[_0x8991('0x2c')]['hasOwnProperty'](_0x8991('0x30'))){_0x3debc5[_0x8991('0x1d')]=qs['limit'](_0x452099[_0x8991('0x2c')][_0x8991('0x1d')]);_0x3debc5[_0x8991('0x1c')]=qs[_0x8991('0x1c')](_0x452099[_0x8991('0x2c')][_0x8991('0x1c')]);}_0x3debc5[_0x8991('0x31')]=qs[_0x8991('0x32')](_0x452099[_0x8991('0x2c')][_0x8991('0x32')]);_0x3debc5[_0x8991('0x33')]=qs[_0x8991('0x2d')](_[_0x8991('0x34')](_0x452099['query'],_0x44857f['filters']),_0x38a1fc);if(_0x452099[_0x8991('0x2c')][_0x8991('0x35')]){_0x3debc5[_0x8991('0x33')]=_['merge'](_0x3debc5[_0x8991('0x33')],{'$or':_['map'](_0x38a1fc,function(_0x111a85){if(_0x111a85[_0x8991('0x36')]!==_0x8991('0x37')){var _0x1b4027={};_0x1b4027[_0x111a85[_0x8991('0x26')]]={'$like':'%'+_0x452099[_0x8991('0x2c')][_0x8991('0x35')]+'%'};return _0x1b4027;}})});}_0x3debc5=_[_0x8991('0x38')]({},_0x3debc5,_0x452099[_0x8991('0x39')]);var _0x7a9a05={'where':_0x3debc5[_0x8991('0x33')]};return db[_0x8991('0x3a')][_0x8991('0x1f')](_0x7a9a05)['then'](function(_0x2407e7){_0x4ade6e['count']=_0x2407e7;if(_0x452099[_0x8991('0x2c')][_0x8991('0x3b')]){_0x3debc5[_0x8991('0x3c')]=[{'all':!![]}];}return db[_0x8991('0x3a')][_0x8991('0x3d')](_0x3debc5);})['then'](function(_0x2324c9){_0x4ade6e['rows']=_0x2324c9;return _0x4ade6e;})[_0x8991('0x22')](respondWithFilteredResult(_0x4f0b70,_0x3debc5))[_0x8991('0x3e')](handleError(_0x4f0b70,null));};exports[_0x8991('0x3f')]=function(_0x4ede5f,_0x2e0c9b){var _0x1d54e4={'raw':!![],'where':{'id':_0x4ede5f[_0x8991('0x40')]['id']}},_0x48f0c={};_0x48f0c['model']=_[_0x8991('0x41')](db[_0x8991('0x3a')][_0x8991('0x29')]);_0x48f0c[_0x8991('0x2c')]=_[_0x8991('0x41')](_0x4ede5f[_0x8991('0x2c')]);_0x48f0c[_0x8991('0x2d')]=_['intersection'](_0x48f0c[_0x8991('0x2b')],_0x48f0c[_0x8991('0x2c')]);_0x1d54e4[_0x8991('0x2e')]=_[_0x8991('0x42')](_0x48f0c[_0x8991('0x2b')],qs[_0x8991('0x43')](_0x4ede5f[_0x8991('0x2c')][_0x8991('0x43')]));_0x1d54e4[_0x8991('0x2e')]=_0x1d54e4['attributes'][_0x8991('0x2f')]?_0x1d54e4[_0x8991('0x2e')]:_0x48f0c[_0x8991('0x2b')];if(_0x4ede5f[_0x8991('0x2c')][_0x8991('0x3b')]){_0x1d54e4[_0x8991('0x3c')]=[{'all':!![]}];}_0x1d54e4=_[_0x8991('0x38')]({},_0x1d54e4,_0x4ede5f['options']);return db['FaxTransferReport']['find'](_0x1d54e4)[_0x8991('0x22')](handleEntityNotFound(_0x2e0c9b,null))[_0x8991('0x22')](respondWithResult(_0x2e0c9b,null))[_0x8991('0x3e')](handleError(_0x2e0c9b,null));};exports[_0x8991('0x44')]=function(_0x8286f3,_0x5553e1){return db[_0x8991('0x3a')][_0x8991('0x44')](_0x8286f3['body'],{})[_0x8991('0x22')](respondWithResult(_0x5553e1,0xc9))[_0x8991('0x3e')](handleError(_0x5553e1,null));};exports['update']=function(_0x274ebf,_0x5484dd){if(_0x274ebf[_0x8991('0x45')]['id']){delete _0x274ebf[_0x8991('0x45')]['id'];}return db[_0x8991('0x3a')][_0x8991('0x46')]({'where':{'id':_0x274ebf['params']['id']}})['then'](handleEntityNotFound(_0x5484dd,null))[_0x8991('0x22')](saveUpdates(_0x274ebf[_0x8991('0x45')],null))[_0x8991('0x22')](respondWithResult(_0x5484dd,null))[_0x8991('0x3e')](handleError(_0x5484dd,null));};exports[_0x8991('0x23')]=function(_0x5b177c,_0x12f480){return db['FaxTransferReport'][_0x8991('0x46')]({'where':{'id':_0x5b177c['params']['id']}})[_0x8991('0x22')](handleEntityNotFound(_0x12f480,null))[_0x8991('0x22')](removeEntity(_0x12f480,null))[_0x8991('0x3e')](handleError(_0x12f480,null));};exports[_0x8991('0x47')]=function(_0x4e6ea3,_0x4d3efe){return db['FaxTransferReport'][_0x8991('0x47')]()[_0x8991('0x22')](respondWithResult(_0x4d3efe,null))['catch'](handleError(_0x4d3efe,null));};
\ No newline at end of file
+var _0xe0f7=['include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','FaxTransferReport','includeAll','findAll','rows','catch','show','params'];(function(_0x5a4400,_0xfae3b6){var _0xf9b532=function(_0x39804e){while(--_0x39804e){_0x5a4400['push'](_0x5a4400['shift']());}};_0xf9b532(++_0xfae3b6);}(_0xe0f7,0xa8));var _0x7e0f=function(_0x4b0e7c,_0x3810b6){_0x4b0e7c=_0x4b0e7c-0x0;var _0x3f633c=_0xe0f7[_0x4b0e7c];return _0x3f633c;};'use strict';var emlformat=require(_0x7e0f('0x0'));var rimraf=require(_0x7e0f('0x1'));var zipdir=require(_0x7e0f('0x2'));var jsonpatch=require(_0x7e0f('0x3'));var rp=require(_0x7e0f('0x4'));var moment=require('moment');var BPromise=require(_0x7e0f('0x5'));var Mustache=require(_0x7e0f('0x6'));var util=require(_0x7e0f('0x7'));var path=require(_0x7e0f('0x8'));var sox=require(_0x7e0f('0x9'));var csv=require('to-csv');var ejs=require(_0x7e0f('0xa'));var fs=require('fs');var fs_extra=require(_0x7e0f('0xb'));var _=require(_0x7e0f('0xc'));var squel=require(_0x7e0f('0xd'));var crypto=require(_0x7e0f('0xe'));var jsforce=require(_0x7e0f('0xf'));var deskjs=require(_0x7e0f('0x10'));var toCsv=require(_0x7e0f('0x11'));var querystring=require(_0x7e0f('0x12'));var Papa=require(_0x7e0f('0x13'));var Redis=require(_0x7e0f('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x7e0f('0x15'));var as=require(_0x7e0f('0x16'));var hardwareService=require(_0x7e0f('0x17'));var logger=require(_0x7e0f('0x18'))(_0x7e0f('0x19'));var utils=require('../../config/utils');var config=require(_0x7e0f('0x1a'));var licenseUtil=require(_0x7e0f('0x1b'));var db=require(_0x7e0f('0x1c'))['db'];function respondWithStatusCode(_0x27c2b8,_0x15c049){_0x15c049=_0x15c049||0xcc;return function(_0x4af7e5){if(_0x4af7e5){return _0x27c2b8[_0x7e0f('0x1d')](_0x15c049);}return _0x27c2b8[_0x7e0f('0x1e')](_0x15c049)[_0x7e0f('0x1f')]();};}function respondWithResult(_0x4acf92,_0x18abf3){_0x18abf3=_0x18abf3||0xc8;return function(_0x3f10b9){if(_0x3f10b9){return _0x4acf92[_0x7e0f('0x1e')](_0x18abf3)[_0x7e0f('0x20')](_0x3f10b9);}};}function respondWithFilteredResult(_0x46d723,_0x169a5f){return function(_0x19fdf2){if(_0x19fdf2){var _0x3ffced=typeof _0x169a5f[_0x7e0f('0x21')]===_0x7e0f('0x22')&&typeof _0x169a5f[_0x7e0f('0x23')]===_0x7e0f('0x22');var _0x1bfcbd=_0x19fdf2[_0x7e0f('0x24')];var _0x3547af=_0x3ffced?0x0:_0x169a5f[_0x7e0f('0x21')];var _0x68d1e6=_0x3ffced?_0x19fdf2[_0x7e0f('0x24')]:_0x169a5f[_0x7e0f('0x21')]+_0x169a5f[_0x7e0f('0x23')];var _0x4744ee;if(_0x68d1e6>=_0x1bfcbd){_0x68d1e6=_0x1bfcbd;_0x4744ee=0xc8;}else{_0x4744ee=0xce;}_0x46d723[_0x7e0f('0x1e')](_0x4744ee);return _0x46d723[_0x7e0f('0x25')](_0x7e0f('0x26'),_0x3547af+'-'+_0x68d1e6+'/'+_0x1bfcbd)[_0x7e0f('0x20')](_0x19fdf2);}return null;};}function patchUpdates(_0x265358){return function(_0x31b112){try{jsonpatch[_0x7e0f('0x27')](_0x31b112,_0x265358,!![]);}catch(_0x5ce9bc){return BPromise['reject'](_0x5ce9bc);}return _0x31b112['save']();};}function saveUpdates(_0x18de61,_0xd0e130){return function(_0x440eaf){if(_0x440eaf){return _0x440eaf[_0x7e0f('0x28')](_0x18de61)[_0x7e0f('0x29')](function(_0x352412){return _0x352412;});}return null;};}function removeEntity(_0x25c79d,_0x7e8452){return function(_0x434ed3){if(_0x434ed3){return _0x434ed3[_0x7e0f('0x2a')]()['then'](function(){_0x25c79d[_0x7e0f('0x1e')](0xcc)[_0x7e0f('0x1f')]();});}};}function handleEntityNotFound(_0x4b7fcd,_0x275b14){return function(_0x5c6665){if(!_0x5c6665){_0x4b7fcd[_0x7e0f('0x1d')](0x194);}return _0x5c6665;};}function handleError(_0x1789d6,_0x170cf4){_0x170cf4=_0x170cf4||0x1f4;return function(_0x20649a){logger['error'](_0x20649a[_0x7e0f('0x2b')]);if(_0x20649a[_0x7e0f('0x2c')]){delete _0x20649a[_0x7e0f('0x2c')];}_0x1789d6['status'](_0x170cf4)[_0x7e0f('0x2d')](_0x20649a);};}exports[_0x7e0f('0x2e')]=function(_0x5ca04f,_0x5244a0){var _0x40ad26={},_0x4bf767={},_0x135927={'count':0x0,'rows':[]};var _0x47824f=_[_0x7e0f('0x2f')](db['FaxTransferReport'][_0x7e0f('0x30')],function(_0x2b60bc){return{'name':_0x2b60bc['fieldName'],'type':_0x2b60bc[_0x7e0f('0x31')][_0x7e0f('0x32')]};});_0x4bf767[_0x7e0f('0x33')]=_[_0x7e0f('0x2f')](_0x47824f,_0x7e0f('0x2c'));_0x4bf767[_0x7e0f('0x34')]=_[_0x7e0f('0x35')](_0x5ca04f['query']);_0x4bf767[_0x7e0f('0x36')]=_[_0x7e0f('0x37')](_0x4bf767[_0x7e0f('0x33')],_0x4bf767[_0x7e0f('0x34')]);_0x40ad26[_0x7e0f('0x38')]=_[_0x7e0f('0x37')](_0x4bf767['model'],qs['fields'](_0x5ca04f[_0x7e0f('0x34')][_0x7e0f('0x39')]));_0x40ad26[_0x7e0f('0x38')]=_0x40ad26['attributes'][_0x7e0f('0x3a')]?_0x40ad26['attributes']:_0x4bf767[_0x7e0f('0x33')];if(!_0x5ca04f[_0x7e0f('0x34')][_0x7e0f('0x3b')](_0x7e0f('0x3c'))){_0x40ad26[_0x7e0f('0x23')]=qs[_0x7e0f('0x23')](_0x5ca04f[_0x7e0f('0x34')][_0x7e0f('0x23')]);_0x40ad26[_0x7e0f('0x21')]=qs[_0x7e0f('0x21')](_0x5ca04f['query'][_0x7e0f('0x21')]);}_0x40ad26[_0x7e0f('0x3d')]=qs[_0x7e0f('0x3e')](_0x5ca04f[_0x7e0f('0x34')]['sort']);_0x40ad26[_0x7e0f('0x3f')]=qs[_0x7e0f('0x36')](_[_0x7e0f('0x40')](_0x5ca04f[_0x7e0f('0x34')],_0x4bf767[_0x7e0f('0x36')]),_0x47824f);if(_0x5ca04f[_0x7e0f('0x34')]['filter']){_0x40ad26[_0x7e0f('0x3f')]=_[_0x7e0f('0x41')](_0x40ad26[_0x7e0f('0x3f')],{'$or':_[_0x7e0f('0x2f')](_0x47824f,function(_0x292010){if(_0x292010['type']!==_0x7e0f('0x42')){var _0x428b04={};_0x428b04[_0x292010[_0x7e0f('0x2c')]]={'$like':'%'+_0x5ca04f[_0x7e0f('0x34')][_0x7e0f('0x43')]+'%'};return _0x428b04;}})});}_0x40ad26=_['merge']({},_0x40ad26,_0x5ca04f['options']);var _0x58f8c8={'where':_0x40ad26[_0x7e0f('0x3f')]};return db[_0x7e0f('0x44')][_0x7e0f('0x24')](_0x58f8c8)[_0x7e0f('0x29')](function(_0x11fa92){_0x135927[_0x7e0f('0x24')]=_0x11fa92;if(_0x5ca04f[_0x7e0f('0x34')][_0x7e0f('0x45')]){_0x40ad26['include']=[{'all':!![]}];}return db[_0x7e0f('0x44')][_0x7e0f('0x46')](_0x40ad26);})[_0x7e0f('0x29')](function(_0x3875d8){_0x135927[_0x7e0f('0x47')]=_0x3875d8;return _0x135927;})[_0x7e0f('0x29')](respondWithFilteredResult(_0x5244a0,_0x40ad26))[_0x7e0f('0x48')](handleError(_0x5244a0,null));};exports[_0x7e0f('0x49')]=function(_0x17e5a1,_0x58da16){var _0x29fc40={'raw':!![],'where':{'id':_0x17e5a1[_0x7e0f('0x4a')]['id']}},_0x356731={};_0x356731[_0x7e0f('0x33')]=_['keys'](db[_0x7e0f('0x44')]['rawAttributes']);_0x356731[_0x7e0f('0x34')]=_[_0x7e0f('0x35')](_0x17e5a1[_0x7e0f('0x34')]);_0x356731[_0x7e0f('0x36')]=_[_0x7e0f('0x37')](_0x356731[_0x7e0f('0x33')],_0x356731['query']);_0x29fc40[_0x7e0f('0x38')]=_[_0x7e0f('0x37')](_0x356731[_0x7e0f('0x33')],qs[_0x7e0f('0x39')](_0x17e5a1[_0x7e0f('0x34')]['fields']));_0x29fc40[_0x7e0f('0x38')]=_0x29fc40[_0x7e0f('0x38')][_0x7e0f('0x3a')]?_0x29fc40['attributes']:_0x356731['model'];if(_0x17e5a1['query'][_0x7e0f('0x45')]){_0x29fc40[_0x7e0f('0x4b')]=[{'all':!![]}];}_0x29fc40=_[_0x7e0f('0x41')]({},_0x29fc40,_0x17e5a1[_0x7e0f('0x4c')]);return db['FaxTransferReport'][_0x7e0f('0x4d')](_0x29fc40)[_0x7e0f('0x29')](handleEntityNotFound(_0x58da16,null))[_0x7e0f('0x29')](respondWithResult(_0x58da16,null))[_0x7e0f('0x48')](handleError(_0x58da16,null));};exports[_0x7e0f('0x4e')]=function(_0x472298,_0x215e61){return db[_0x7e0f('0x44')][_0x7e0f('0x4e')](_0x472298[_0x7e0f('0x4f')],{})[_0x7e0f('0x29')](respondWithResult(_0x215e61,0xc9))[_0x7e0f('0x48')](handleError(_0x215e61,null));};exports[_0x7e0f('0x28')]=function(_0x16291c,_0x39348b){if(_0x16291c[_0x7e0f('0x4f')]['id']){delete _0x16291c['body']['id'];}return db[_0x7e0f('0x44')]['find']({'where':{'id':_0x16291c['params']['id']}})[_0x7e0f('0x29')](handleEntityNotFound(_0x39348b,null))[_0x7e0f('0x29')](saveUpdates(_0x16291c[_0x7e0f('0x4f')],null))[_0x7e0f('0x29')](respondWithResult(_0x39348b,null))[_0x7e0f('0x48')](handleError(_0x39348b,null));};exports[_0x7e0f('0x2a')]=function(_0xb2e82,_0x3f6720){return db[_0x7e0f('0x44')][_0x7e0f('0x4d')]({'where':{'id':_0xb2e82[_0x7e0f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f6720,null))[_0x7e0f('0x29')](removeEntity(_0x3f6720,null))[_0x7e0f('0x48')](handleError(_0x3f6720,null));};exports[_0x7e0f('0x50')]=function(_0xbc8bb9,_0x4819c8){return db[_0x7e0f('0x44')][_0x7e0f('0x50')]()[_0x7e0f('0x29')](respondWithResult(_0x4819c8,null))[_0x7e0f('0x48')](handleError(_0x4819c8,null));};
\ No newline at end of file
index d70cde4..563b97d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf74b=['path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x52469e,_0x3579c2){var _0x2e6692=function(_0x3e5576){while(--_0x3e5576){_0x52469e['push'](_0x52469e['shift']());}};_0x2e6692(++_0x3579c2);}(_0xf74b,0x97));var _0xbf74=function(_0x44da25,_0x512575){_0x44da25=_0x44da25-0x0;var _0x68594f=_0xf74b[_0x44da25];return _0x68594f;};'use strict';var _=require(_0xbf74('0x0'));var util=require(_0xbf74('0x1'));var logger=require(_0xbf74('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbf74('0x3'));var rp=require(_0xbf74('0x4'));var fs=require('fs');var path=require(_0xbf74('0x5'));var rimraf=require(_0xbf74('0x6'));var config=require(_0xbf74('0x7'));var attributes=require(_0xbf74('0x8'));module[_0xbf74('0x9')]=function(_0x5e6b18,_0xa8d8f4){return _0x5e6b18[_0xbf74('0xa')]('FaxTransferReport',attributes,{'tableName':_0xbf74('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xbf74('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x69d4=['util','api','moment','bluebird','path','../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash'];(function(_0x5c8ae4,_0x6bcd9c){var _0x51fcc1=function(_0x324e2d){while(--_0x324e2d){_0x5c8ae4['push'](_0x5c8ae4['shift']());}};_0x51fcc1(++_0x6bcd9c);}(_0x69d4,0x83));var _0x469d=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x69d4[_0x16db8b];return _0x5ba017;};'use strict';var _=require(_0x469d('0x0'));var util=require(_0x469d('0x1'));var logger=require('../../config/logger')(_0x469d('0x2'));var moment=require(_0x469d('0x3'));var BPromise=require(_0x469d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x469d('0x5'));var rimraf=require('rimraf');var config=require(_0x469d('0x6'));var attributes=require(_0x469d('0x7'));module[_0x469d('0x8')]=function(_0x336101,_0x3d0ec8){return _0x336101[_0x469d('0x9')]('FaxTransferReport',attributes,{'tableName':_0x469d('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x469d('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 0dbd66a..997bb5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9109=['lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x9109,0xd2));var _0x9910=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x9109[_0x836465];return _0x2150ea;};'use strict';var _=require(_0x9910('0x0'));var util=require(_0x9910('0x1'));var moment=require(_0x9910('0x2'));var BPromise=require(_0x9910('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9910('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9910('0x5'))(_0x9910('0x6'));var config=require(_0x9910('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9910('0x8')][_0x9910('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193fd1,_0x1ac02f,_0x2bb78c){return new BPromise(function(_0x442ffb,_0x4a98b1){return client[_0x9910('0xa')](_0x193fd1,_0x2bb78c)[_0x9910('0xb')](function(_0xb56f10){logger[_0x9910('0xc')](_0x9910('0xd'),_0x1ac02f,_0x9910('0xe'));logger[_0x9910('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x1ac02f,_0x9910('0xe'),JSON[_0x9910('0x10')](_0xb56f10));if(_0xb56f10[_0x9910('0x11')]){if(_0xb56f10[_0x9910('0x11')]['code']===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x1ac02f,_0xb56f10[_0x9910('0x11')][_0x9910('0x12')]);return _0x4a98b1(_0xb56f10[_0x9910('0x11')][_0x9910('0x12')]);}logger[_0x9910('0x11')](_0x9910('0xd'),_0x1ac02f,_0xb56f10['error']['message']);return _0x442ffb(_0xb56f10['error'][_0x9910('0x12')]);}else{logger['info'](_0x9910('0xd'),_0x1ac02f,'request\x20sent');_0x442ffb(_0xb56f10[_0x9910('0x13')][_0x9910('0x12')]);}})[_0x9910('0x14')](function(_0x1e34f1){logger[_0x9910('0x11')](_0x9910('0xd'),_0x1ac02f,_0x1e34f1);_0x4a98b1(_0x1e34f1);});});}
\ No newline at end of file
+var _0xd0c4=['bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','info','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','moment'];(function(_0x46ee74,_0x24a0a4){var _0x59fc52=function(_0x4f47c4){while(--_0x4f47c4){_0x46ee74['push'](_0x46ee74['shift']());}};_0x59fc52(++_0x24a0a4);}(_0xd0c4,0x1b6));var _0x4d0c=function(_0x408b34,_0xb7d872){_0x408b34=_0x408b34-0x0;var _0x1182aa=_0xd0c4[_0x408b34];return _0x1182aa;};'use strict';var _=require(_0x4d0c('0x0'));var util=require('util');var moment=require(_0x4d0c('0x1'));var BPromise=require(_0x4d0c('0x2'));var rs=require(_0x4d0c('0x3'));var fs=require('fs');var Redis=require(_0x4d0c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d0c('0x5'));var logger=require('../../config/logger')(_0x4d0c('0x6'));var config=require('../../config/environment');var jayson=require(_0x4d0c('0x7'));var client=jayson['client'][_0x4d0c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f8d00,_0x47e143,_0x1b622d){return new BPromise(function(_0x59a60f,_0x28c13a){return client[_0x4d0c('0x9')](_0x1f8d00,_0x1b622d)['then'](function(_0x5de931){logger[_0x4d0c('0xa')](_0x4d0c('0xb'),_0x47e143,'request\x20sent');logger['debug'](_0x4d0c('0xc'),_0x47e143,_0x4d0c('0xd'),JSON[_0x4d0c('0xe')](_0x5de931));if(_0x5de931['error']){if(_0x5de931['error'][_0x4d0c('0xf')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x47e143,_0x5de931[_0x4d0c('0x10')][_0x4d0c('0x11')]);return _0x28c13a(_0x5de931[_0x4d0c('0x10')][_0x4d0c('0x11')]);}logger['error'](_0x4d0c('0xb'),_0x47e143,_0x5de931[_0x4d0c('0x10')][_0x4d0c('0x11')]);return _0x59a60f(_0x5de931[_0x4d0c('0x10')][_0x4d0c('0x11')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x47e143,_0x4d0c('0xd'));_0x59a60f(_0x5de931[_0x4d0c('0x12')][_0x4d0c('0x11')]);}})[_0x4d0c('0x13')](function(_0x44062f){logger[_0x4d0c('0x10')](_0x4d0c('0xb'),_0x47e143,_0x44062f);_0x28c13a(_0x44062f);});});}
\ No newline at end of file
index 5761f0e..5efef51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63aa=['../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x489a1c,_0x112bc1){var _0x2b4161=function(_0x2b481f){while(--_0x2b481f){_0x489a1c['push'](_0x489a1c['shift']());}};_0x2b4161(++_0x112bc1);}(_0x63aa,0x6c));var _0xa63a=function(_0x49e175,_0x4b0c36){_0x49e175=_0x49e175-0x0;var _0x564a3a=_0x63aa[_0x49e175];return _0x564a3a;};'use strict';var multer=require(_0xa63a('0x0'));var util=require('util');var path=require(_0xa63a('0x1'));var timeout=require(_0xa63a('0x2'));var express=require(_0xa63a('0x3'));var router=express[_0xa63a('0x4')]();var fs_extra=require(_0xa63a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa63a('0x6'));var config=require(_0xa63a('0x7'));var controller=require(_0xa63a('0x8'));router[_0xa63a('0x9')]('/',auth[_0xa63a('0xa')](),controller[_0xa63a('0xb')]);router[_0xa63a('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xa63a('0xc'),auth[_0xa63a('0xa')](),controller[_0xa63a('0xd')]);router[_0xa63a('0xe')]('/',auth[_0xa63a('0xa')](),controller[_0xa63a('0xf')]);router[_0xa63a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa63a('0x11')]);router['delete'](_0xa63a('0xc'),auth[_0xa63a('0xa')](),controller[_0xa63a('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x0345=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','show','post','update','multer'];(function(_0x1300ec,_0x3ff267){var _0x2c13c9=function(_0x58d88){while(--_0x58d88){_0x1300ec['push'](_0x1300ec['shift']());}};_0x2c13c9(++_0x3ff267);}(_0x0345,0xba));var _0x5034=function(_0x330f4f,_0x1c911a){_0x330f4f=_0x330f4f-0x0;var _0x4b5dbb=_0x0345[_0x330f4f];return _0x4b5dbb;};'use strict';var multer=require(_0x5034('0x0'));var util=require(_0x5034('0x1'));var path=require(_0x5034('0x2'));var timeout=require(_0x5034('0x3'));var express=require(_0x5034('0x4'));var router=express[_0x5034('0x5')]();var fs_extra=require(_0x5034('0x6'));var auth=require(_0x5034('0x7'));var interaction=require(_0x5034('0x8'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0x5034('0x9')](),controller['index']);router[_0x5034('0xa')](_0x5034('0xb'),auth['isAuthenticated'](),controller[_0x5034('0xc')]);router[_0x5034('0xa')](_0x5034('0xd'),auth[_0x5034('0x9')](),controller[_0x5034('0xe')]);router[_0x5034('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x5034('0xd'),auth['isAuthenticated'](),controller[_0x5034('0x10')]);router['delete'](_0x5034('0xd'),auth[_0x5034('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 24ec10b..063a0c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb12a=['/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xb12a,0x145));var _0xab12=function(_0x3e5c60,_0x141693){_0x3e5c60=_0x3e5c60-0x0;var _0x815443=_0xb12a[_0x3e5c60];return _0x815443;};'use strict';var multer=require(_0xab12('0x0'));var util=require(_0xab12('0x1'));var path=require(_0xab12('0x2'));var timeout=require(_0xab12('0x3'));var express=require(_0xab12('0x4'));var router=express[_0xab12('0x5')]();var fs_extra=require(_0xab12('0x6'));var auth=require(_0xab12('0x7'));var interaction=require(_0xab12('0x8'));var config=require(_0xab12('0x9'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0xab12('0xa')](),controller['index']);router[_0xab12('0xb')]('/:id',auth[_0xab12('0xa')](),controller[_0xab12('0xc')]);router[_0xab12('0xb')](_0xab12('0xd'),auth['isAuthenticated'](),controller[_0xab12('0xe')]);router[_0xab12('0xb')](_0xab12('0xf'),auth[_0xab12('0xa')](),controller[_0xab12('0x10')]);router['post']('/',auth[_0xab12('0xa')](),controller[_0xab12('0x11')]);router[_0xab12('0x12')](_0xab12('0xd'),auth[_0xab12('0xa')](),controller[_0xab12('0x13')]);router[_0xab12('0x14')](_0xab12('0x15'),auth[_0xab12('0xa')](),controller[_0xab12('0x16')]);router[_0xab12('0x17')](_0xab12('0x15'),auth['isAuthenticated'](),controller[_0xab12('0x18')]);module[_0xab12('0x19')]=router;
\ No newline at end of file
+var _0xb77d=['index','show','get','/:id/fields','getFields','post','create','addConfiguration','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated'];(function(_0x321799,_0x50c6d9){var _0x42f9d8=function(_0x555a2f){while(--_0x555a2f){_0x321799['push'](_0x321799['shift']());}};_0x42f9d8(++_0x50c6d9);}(_0xb77d,0x12d));var _0xdb77=function(_0x2acb8a,_0x204b3d){_0x2acb8a=_0x2acb8a-0x0;var _0x153af9=_0xb77d[_0x2acb8a];return _0x153af9;};'use strict';var multer=require(_0xdb77('0x0'));var util=require(_0xdb77('0x1'));var path=require(_0xdb77('0x2'));var timeout=require('connect-timeout');var express=require(_0xdb77('0x3'));var router=express[_0xdb77('0x4')]();var fs_extra=require(_0xdb77('0x5'));var auth=require(_0xdb77('0x6'));var interaction=require(_0xdb77('0x7'));var config=require(_0xdb77('0x8'));var controller=require(_0xdb77('0x9'));router['get']('/',auth[_0xdb77('0xa')](),controller[_0xdb77('0xb')]);router['get']('/:id',auth[_0xdb77('0xa')](),controller[_0xdb77('0xc')]);router[_0xdb77('0xd')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0xdb77('0xe'),auth[_0xdb77('0xa')](),controller[_0xdb77('0xf')]);router[_0xdb77('0x10')]('/',auth['isAuthenticated'](),controller[_0xdb77('0x11')]);router[_0xdb77('0x10')]('/:id/configurations',auth[_0xdb77('0xa')](),controller[_0xdb77('0x12')]);router['put'](_0xdb77('0x13'),auth[_0xdb77('0xa')](),controller[_0xdb77('0x14')]);router[_0xdb77('0x15')](_0xdb77('0x13'),auth[_0xdb77('0xa')](),controller[_0xdb77('0x16')]);module[_0xdb77('0x17')]=router;
\ No newline at end of file
index ebf792f..bf96327 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54cc=['STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x54cc,0x14f));var _0xc54c=function(_0x4dcbe1,_0xbc12e0){_0x4dcbe1=_0x4dcbe1-0x0;var _0x510957=_0x54cc[_0x4dcbe1];return _0x510957;};'use strict';var Sequelize=require(_0xc54c('0x0'));module['exports']={'name':{'type':Sequelize[_0xc54c('0x1')]},'description':{'type':Sequelize[_0xc54c('0x1')]},'username':{'type':Sequelize[_0xc54c('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xc54c('0x2')](_0xc54c('0x3')),'defaultValue':_0xc54c('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xc54c('0x1')]},'consumerSecret':{'type':Sequelize[_0xc54c('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xc54c('0x1')]},'serverUrl':{'type':Sequelize[_0xc54c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc54c('0x2')](_0xc54c('0x4'),_0xc54c('0x5')),'defaultValue':_0xc54c('0x4')}};
\ No newline at end of file
+var _0x089d=['integrationTab','exports','STRING','basic','newTab'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0x089d,0x6f));var _0xd089=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x089d[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require('sequelize');module[_0xd089('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd089('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd089('0x1')]},'authType':{'type':Sequelize['ENUM'](_0xd089('0x2')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xd089('0x1')]},'consumerKey':{'type':Sequelize[_0xd089('0x1')]},'consumerSecret':{'type':Sequelize[_0xd089('0x1')]},'token':{'type':Sequelize[_0xd089('0x1')]},'tokenSecret':{'type':Sequelize[_0xd089('0x1')]},'serverUrl':{'type':Sequelize[_0xd089('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xd089('0x3')),'defaultValue':_0xd089('0x4')}};
\ No newline at end of file
index 8d751ee..c405298 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e69=['tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Authorization','Basic\x20%s','%s:%s','base64','concat','entries','active','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','DeskAccount','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','destroy','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','authType','username','password','consumerKey','consumerSecret','token'];(function(_0x25762c,_0x2709df){var _0x2f77a8=function(_0x9f133f){while(--_0x9f133f){_0x25762c['push'](_0x25762c['shift']());}};_0x2f77a8(++_0x2709df);}(_0x1e69,0x8a));var _0x91e6=function(_0x2d4b78,_0xa41467){_0x2d4b78=_0x2d4b78-0x0;var _0x14da49=_0x1e69[_0x2d4b78];return _0x14da49;};'use strict';var emlformat=require(_0x91e6('0x0'));var rimraf=require(_0x91e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x91e6('0x2'));var rp=require(_0x91e6('0x3'));var moment=require(_0x91e6('0x4'));var BPromise=require(_0x91e6('0x5'));var Mustache=require(_0x91e6('0x6'));var util=require(_0x91e6('0x7'));var path=require(_0x91e6('0x8'));var sox=require(_0x91e6('0x9'));var csv=require(_0x91e6('0xa'));var ejs=require(_0x91e6('0xb'));var fs=require('fs');var fs_extra=require(_0x91e6('0xc'));var _=require('lodash');var squel=require(_0x91e6('0xd'));var crypto=require('crypto');var jsforce=require(_0x91e6('0xe'));var deskjs=require(_0x91e6('0xf'));var toCsv=require(_0x91e6('0xa'));var querystring=require(_0x91e6('0x10'));var Papa=require(_0x91e6('0x11'));var Redis=require(_0x91e6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x91e6('0x13'));var as=require(_0x91e6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x91e6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x91e6('0x16'));var licenseUtil=require(_0x91e6('0x17'));var db=require(_0x91e6('0x18'))['db'];var integrations=require(_0x91e6('0x19'));function respondWithStatusCode(_0x3234a9,_0x2e25af){_0x2e25af=_0x2e25af||0xcc;return function(_0x2d443e){if(_0x2d443e){return _0x3234a9[_0x91e6('0x1a')](_0x2e25af);}return _0x3234a9[_0x91e6('0x1b')](_0x2e25af)[_0x91e6('0x1c')]();};}function respondWithResult(_0x469f0f,_0x1cf200){_0x1cf200=_0x1cf200||0xc8;return function(_0x2d1fcb){if(_0x2d1fcb){return _0x469f0f['status'](_0x1cf200)[_0x91e6('0x1d')](_0x2d1fcb);}};}function respondWithFilteredResult(_0xae0543,_0x5dab2c){return function(_0x4a1e33){if(_0x4a1e33){var _0x4397b7=typeof _0x5dab2c[_0x91e6('0x1e')]===_0x91e6('0x1f')&&typeof _0x5dab2c[_0x91e6('0x20')]==='undefined';var _0xad7f30=_0x4a1e33['count'];var _0x22a2a9=_0x4397b7?0x0:_0x5dab2c['offset'];var _0x55f526=_0x4397b7?_0x4a1e33[_0x91e6('0x21')]:_0x5dab2c[_0x91e6('0x1e')]+_0x5dab2c[_0x91e6('0x20')];var _0x2527dd;if(_0x55f526>=_0xad7f30){_0x55f526=_0xad7f30;_0x2527dd=0xc8;}else{_0x2527dd=0xce;}_0xae0543[_0x91e6('0x1b')](_0x2527dd);return _0xae0543[_0x91e6('0x22')](_0x91e6('0x23'),_0x22a2a9+'-'+_0x55f526+'/'+_0xad7f30)[_0x91e6('0x1d')](_0x4a1e33);}return null;};}function patchUpdates(_0x23d635){return function(_0x340a71){try{jsonpatch[_0x91e6('0x24')](_0x340a71,_0x23d635,!![]);}catch(_0x33f3ba){return BPromise[_0x91e6('0x25')](_0x33f3ba);}return _0x340a71['save']();};}function saveUpdates(_0x2c78bd,_0x2aa820){return function(_0x3c0e58){if(_0x3c0e58){return _0x3c0e58['update'](_0x2c78bd)['then'](function(_0x344ec8){return _0x344ec8;});}return null;};}function removeEntity(_0x1d0152,_0x317dc6){return function(_0x4e69ac){if(_0x4e69ac){return _0x4e69ac['destroy']()[_0x91e6('0x26')](function(){_0x1d0152[_0x91e6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3675d8,_0x3fa660){return function(_0x157f62){if(!_0x157f62){_0x3675d8[_0x91e6('0x1a')](0x194);}return _0x157f62;};}function handleError(_0x24292b,_0x266d96){_0x266d96=_0x266d96||0x1f4;return function(_0x55b668){logger[_0x91e6('0x27')](_0x55b668[_0x91e6('0x28')]);if(_0x55b668[_0x91e6('0x29')]){delete _0x55b668['name'];}_0x24292b[_0x91e6('0x1b')](_0x266d96)['send'](_0x55b668);};}exports['index']=function(_0x35e942,_0x41cd25){var _0x4d6ade={},_0x51c10b={},_0xdf9984={'count':0x0,'rows':[]};var _0x33ef61=_[_0x91e6('0x2a')](db['DeskAccount'][_0x91e6('0x2b')],function(_0x2b7a83){return{'name':_0x2b7a83[_0x91e6('0x2c')],'type':_0x2b7a83[_0x91e6('0x2d')][_0x91e6('0x2e')]};});_0x51c10b['model']=_[_0x91e6('0x2a')](_0x33ef61,_0x91e6('0x29'));_0x51c10b[_0x91e6('0x2f')]=_[_0x91e6('0x30')](_0x35e942['query']);_0x51c10b[_0x91e6('0x31')]=_['intersection'](_0x51c10b[_0x91e6('0x32')],_0x51c10b['query']);_0x4d6ade[_0x91e6('0x33')]=_[_0x91e6('0x34')](_0x51c10b[_0x91e6('0x32')],qs[_0x91e6('0x35')](_0x35e942[_0x91e6('0x2f')][_0x91e6('0x35')]));_0x4d6ade['attributes']=_0x4d6ade['attributes'][_0x91e6('0x36')]?_0x4d6ade[_0x91e6('0x33')]:_0x51c10b[_0x91e6('0x32')];if(!_0x35e942[_0x91e6('0x2f')][_0x91e6('0x37')](_0x91e6('0x38'))){_0x4d6ade[_0x91e6('0x20')]=qs[_0x91e6('0x20')](_0x35e942[_0x91e6('0x2f')][_0x91e6('0x20')]);_0x4d6ade[_0x91e6('0x1e')]=qs[_0x91e6('0x1e')](_0x35e942['query'][_0x91e6('0x1e')]);}_0x4d6ade[_0x91e6('0x39')]=qs[_0x91e6('0x3a')](_0x35e942['query'][_0x91e6('0x3a')]);_0x4d6ade[_0x91e6('0x3b')]=qs[_0x91e6('0x31')](_[_0x91e6('0x3c')](_0x35e942[_0x91e6('0x2f')],_0x51c10b[_0x91e6('0x31')]),_0x33ef61);if(_0x35e942[_0x91e6('0x2f')][_0x91e6('0x3d')]){_0x4d6ade[_0x91e6('0x3b')]=_[_0x91e6('0x3e')](_0x4d6ade[_0x91e6('0x3b')],{'$or':_[_0x91e6('0x2a')](_0x33ef61,function(_0x41745c){if(_0x41745c[_0x91e6('0x2d')]!==_0x91e6('0x3f')){var _0x4940b3={};_0x4940b3[_0x41745c[_0x91e6('0x29')]]={'$like':'%'+_0x35e942['query'][_0x91e6('0x3d')]+'%'};return _0x4940b3;}})});}_0x4d6ade=_[_0x91e6('0x3e')]({},_0x4d6ade,_0x35e942[_0x91e6('0x40')]);var _0x53feaa={'where':_0x4d6ade['where']};return db[_0x91e6('0x41')][_0x91e6('0x21')](_0x53feaa)['then'](function(_0x15ae12){_0xdf9984['count']=_0x15ae12;if(_0x35e942[_0x91e6('0x2f')][_0x91e6('0x42')]){_0x4d6ade['include']=[{'all':!![]}];}return db['DeskAccount'][_0x91e6('0x43')](_0x4d6ade);})['then'](function(_0x3d2ef9){_0xdf9984[_0x91e6('0x44')]=_0x3d2ef9;return _0xdf9984;})[_0x91e6('0x26')](respondWithFilteredResult(_0x41cd25,_0x4d6ade))[_0x91e6('0x45')](handleError(_0x41cd25,null));};exports[_0x91e6('0x46')]=function(_0x2d8a8a,_0x4e016f){var _0x3fce26={'raw':![],'where':{'id':_0x2d8a8a[_0x91e6('0x47')]['id']}},_0x791424={};_0x791424[_0x91e6('0x32')]=_['keys'](db[_0x91e6('0x41')][_0x91e6('0x2b')]);_0x791424[_0x91e6('0x2f')]=_[_0x91e6('0x30')](_0x2d8a8a[_0x91e6('0x2f')]);_0x791424['filters']=_['intersection'](_0x791424[_0x91e6('0x32')],_0x791424[_0x91e6('0x2f')]);_0x3fce26[_0x91e6('0x33')]=_[_0x91e6('0x34')](_0x791424[_0x91e6('0x32')],qs[_0x91e6('0x35')](_0x2d8a8a[_0x91e6('0x2f')][_0x91e6('0x35')]));_0x3fce26[_0x91e6('0x33')]=_0x3fce26['attributes'][_0x91e6('0x36')]?_0x3fce26[_0x91e6('0x33')]:_0x791424[_0x91e6('0x32')];if(_0x2d8a8a['query'][_0x91e6('0x42')]){_0x3fce26[_0x91e6('0x48')]=[{'all':!![]}];}_0x3fce26=_[_0x91e6('0x3e')]({},_0x3fce26,_0x2d8a8a['options']);return db[_0x91e6('0x41')][_0x91e6('0x49')](_0x3fce26)['then'](handleEntityNotFound(_0x4e016f,null))['then'](respondWithResult(_0x4e016f,null))[_0x91e6('0x45')](handleError(_0x4e016f,null));};exports[_0x91e6('0x4a')]=function(_0x29558d,_0x1ff40e){return db[_0x91e6('0x41')][_0x91e6('0x4a')](_0x29558d[_0x91e6('0x4b')],{})[_0x91e6('0x26')](respondWithResult(_0x1ff40e,0xc9))[_0x91e6('0x45')](handleError(_0x1ff40e,null));};exports[_0x91e6('0x4c')]=function(_0x3650b2,_0x5e84c1){if(_0x3650b2[_0x91e6('0x4b')]['id']){delete _0x3650b2['body']['id'];}return db[_0x91e6('0x41')][_0x91e6('0x49')]({'where':{'id':_0x3650b2[_0x91e6('0x47')]['id']}})['then'](handleEntityNotFound(_0x5e84c1,null))[_0x91e6('0x26')](saveUpdates(_0x3650b2['body'],null))[_0x91e6('0x26')](respondWithResult(_0x5e84c1,null))[_0x91e6('0x45')](handleError(_0x5e84c1,null));};exports[_0x91e6('0x4d')]=function(_0x462225,_0x3b18b1){return db[_0x91e6('0x41')]['find']({'where':{'id':_0x462225[_0x91e6('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b18b1,null))[_0x91e6('0x26')](removeEntity(_0x3b18b1,null))[_0x91e6('0x45')](handleError(_0x3b18b1,null));};exports[_0x91e6('0x4e')]=function(_0x578ed0,_0x3e8974,_0x4ce872){var _0x196125={};var _0x1426a4={};var _0x487da5;var _0x4d02e7;return db['DeskAccount'][_0x91e6('0x4f')]({'where':{'id':_0x578ed0[_0x91e6('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e8974,null))['then'](function(_0x944198){if(_0x944198){_0x487da5=_0x944198;_0x1426a4['model']=_[_0x91e6('0x30')](db[_0x91e6('0x50')]['rawAttributes']);_0x1426a4['query']=_[_0x91e6('0x30')](_0x578ed0[_0x91e6('0x2f')]);_0x1426a4['filters']=_['intersection'](_0x1426a4[_0x91e6('0x32')],_0x1426a4[_0x91e6('0x2f')]);_0x196125[_0x91e6('0x33')]=_[_0x91e6('0x34')](_0x1426a4[_0x91e6('0x32')],qs[_0x91e6('0x35')](_0x578ed0[_0x91e6('0x2f')][_0x91e6('0x35')]));_0x196125[_0x91e6('0x33')]=_0x196125[_0x91e6('0x33')]['length']?_0x196125[_0x91e6('0x33')]:_0x1426a4[_0x91e6('0x32')];_0x196125[_0x91e6('0x39')]=qs[_0x91e6('0x3a')](_0x578ed0[_0x91e6('0x2f')][_0x91e6('0x3a')]);_0x196125[_0x91e6('0x3b')]=qs[_0x91e6('0x31')](_[_0x91e6('0x3c')](_0x578ed0[_0x91e6('0x2f')],_0x1426a4[_0x91e6('0x31')]));if(_0x578ed0[_0x91e6('0x2f')]['filter']){_0x196125[_0x91e6('0x3b')]=_[_0x91e6('0x3e')](_0x196125[_0x91e6('0x3b')],{'$or':_[_0x91e6('0x2a')](_0x196125['attributes'],function(_0x69517b){var _0x67513c={};_0x67513c[_0x69517b]={'$like':'%'+_0x578ed0[_0x91e6('0x2f')]['filter']+'%'};return _0x67513c;})});}_0x196125=_[_0x91e6('0x3e')]({},_0x196125,_0x578ed0[_0x91e6('0x40')]);return _0x487da5[_0x91e6('0x4e')](_0x196125);}})[_0x91e6('0x26')](function(_0x4618be){if(_0x4618be){_0x4d02e7=_0x4618be[_0x91e6('0x36')];if(!_0x578ed0[_0x91e6('0x2f')][_0x91e6('0x37')](_0x91e6('0x38'))){_0x196125[_0x91e6('0x20')]=qs[_0x91e6('0x20')](_0x578ed0[_0x91e6('0x2f')][_0x91e6('0x20')]);_0x196125[_0x91e6('0x1e')]=qs[_0x91e6('0x1e')](_0x578ed0['query'][_0x91e6('0x1e')]);}return _0x487da5[_0x91e6('0x4e')](_0x196125);}})[_0x91e6('0x26')](function(_0x4c6404){if(_0x4c6404){return _0x4c6404?{'count':_0x4d02e7,'rows':_0x4c6404}:null;}})[_0x91e6('0x26')](respondWithResult(_0x3e8974,null))[_0x91e6('0x45')](handleError(_0x3e8974,null));};exports[_0x91e6('0x51')]=function(_0x44ff74,_0x1340b8,_0x529eac){if(_0x44ff74[_0x91e6('0x4b')]['id']){delete _0x44ff74['body']['id'];}return db[_0x91e6('0x41')][_0x91e6('0x4f')]({'where':{'id':_0x44ff74['params']['id']}})[_0x91e6('0x26')](handleEntityNotFound(_0x1340b8,null))['then'](function(_0x11597d){if(_0x11597d){_0x44ff74['body'][_0x91e6('0x52')]=_0x11597d['id'];_0x44ff74[_0x91e6('0x4b')]['Subjects']=integrations['getSubjects'](_0x44ff74[_0x91e6('0x4b')][_0x91e6('0x53')],_0x44ff74[_0x91e6('0x4b')][_0x91e6('0x2d')]);_0x44ff74['body'][_0x91e6('0x54')]=integrations[_0x91e6('0x55')](_0x44ff74[_0x91e6('0x4b')][_0x91e6('0x53')],_0x44ff74[_0x91e6('0x4b')][_0x91e6('0x2d')]);return db[_0x91e6('0x50')]['create'](_0x44ff74[_0x91e6('0x4b')],{'include':[{'model':db[_0x91e6('0x56')],'as':_0x91e6('0x57')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1340b8,null))[_0x91e6('0x45')](handleError(_0x1340b8,null));};exports[_0x91e6('0x58')]=function(_0x8ff7bf,_0x1e50c8,_0x2e059a){var _0x400de1=[{'name':_0x91e6('0x59'),'label':_0x91e6('0x59'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2f4637='';return db['DeskAccount'][_0x91e6('0x4f')]({'where':{'id':_0x8ff7bf['params']['id']},'attributes':['id','remoteUri',_0x91e6('0x5a'),_0x91e6('0x5b'),_0x91e6('0x5c'),_0x91e6('0x5d'),_0x91e6('0x5e'),_0x91e6('0x5f'),_0x91e6('0x60')]})[_0x91e6('0x26')](handleEntityNotFound(_0x1e50c8,null))['then'](function(_0x2305b2){if(_0x2305b2){_0x2f4637=_0x2305b2[_0x91e6('0x61')];var _0x4e8f2e=_0x2f4637[_0x91e6('0x62')](-0x1);if(_0x4e8f2e==='/'){_0x2f4637=_0x2f4637[_0x91e6('0x63')](0x0,_0x2f4637[_0x91e6('0x64')](_0x4e8f2e));}var _0x4d0401={'method':_0x91e6('0x65'),'uri':util[_0x91e6('0x66')](_0x91e6('0x67'),_0x2f4637),'headers':{'Content-Type':_0x91e6('0x68'),'Accept':_0x91e6('0x68')},'json':!![]};if(_0x2305b2['authType']==='basic'){_0x4d0401[_0x91e6('0x69')][_0x91e6('0x6a')]=util['format'](_0x91e6('0x6b'),new Buffer(util[_0x91e6('0x66')](_0x91e6('0x6c'),_0x2305b2['username'],_0x2305b2[_0x91e6('0x5c')]))['toString'](_0x91e6('0x6d')));}return rp(_0x4d0401)[_0x91e6('0x26')](function(_0x41d562){return _0x400de1[_0x91e6('0x6e')](_[_0x91e6('0x2a')](_0x41d562['_embedded'][_0x91e6('0x6f')],function(_0x58825b){return{'id':_0x58825b[_0x91e6('0x29')],'name':_0x58825b[_0x91e6('0x29')],'type':_0x58825b[_0x91e6('0x2d')],'active':_0x58825b[_0x91e6('0x70')],'label':_0x58825b['label'],'custom':!![]};}));});}})[_0x91e6('0x26')](function(_0x47feb2){return{'count':_0x47feb2[_0x91e6('0x36')],'rows':_0x47feb2};})['then'](respondWithResult(_0x1e50c8,null))['catch'](function(_0x3121d8){var _0x225540=_0x8ff7bf[_0x91e6('0x2f')]['test']?0x1f4:_0x3121d8[_0x91e6('0x71')]||0x1f4;logger[_0x91e6('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x91e6('0x58'),_0x225540,JSON[_0x91e6('0x72')](_0x3121d8));delete _0x3121d8[_0x91e6('0x29')];if(_0x225540===0x191){_0x225540=0x190;}_0x1e50c8[_0x91e6('0x1b')](_0x225540)['send'](_0x8ff7bf[_0x91e6('0x2f')][_0x91e6('0x73')]?{'message':_0x91e6('0x74'),'statusCode':_0x3121d8[_0x91e6('0x71')]}:_0x3121d8);});};
\ No newline at end of file
+var _0x3be2=['toString','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','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','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','remoteUri','authType','password','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','username'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3be2,0x7a));var _0x23be=function(_0x41b33d,_0x540f49){_0x41b33d=_0x41b33d-0x0;var _0x2532b7=_0x3be2[_0x41b33d];return _0x2532b7;};'use strict';var emlformat=require(_0x23be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x23be('0x1'));var jsonpatch=require(_0x23be('0x2'));var rp=require(_0x23be('0x3'));var moment=require('moment');var BPromise=require(_0x23be('0x4'));var Mustache=require(_0x23be('0x5'));var util=require('util');var path=require(_0x23be('0x6'));var sox=require(_0x23be('0x7'));var csv=require(_0x23be('0x8'));var ejs=require(_0x23be('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x23be('0xa'));var squel=require(_0x23be('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x23be('0x8'));var querystring=require('querystring');var Papa=require(_0x23be('0xc'));var Redis=require(_0x23be('0xd'));var authService=require(_0x23be('0xe'));var qs=require(_0x23be('0xf'));var as=require(_0x23be('0x10'));var hardwareService=require(_0x23be('0x11'));var logger=require('../../config/logger')(_0x23be('0x12'));var utils=require(_0x23be('0x13'));var config=require(_0x23be('0x14'));var licenseUtil=require(_0x23be('0x15'));var db=require(_0x23be('0x16'))['db'];var integrations=require(_0x23be('0x17'));function respondWithStatusCode(_0x4cb585,_0x46edec){_0x46edec=_0x46edec||0xcc;return function(_0x3ebb72){if(_0x3ebb72){return _0x4cb585[_0x23be('0x18')](_0x46edec);}return _0x4cb585[_0x23be('0x19')](_0x46edec)[_0x23be('0x1a')]();};}function respondWithResult(_0x1b23de,_0x399cf9){_0x399cf9=_0x399cf9||0xc8;return function(_0x381767){if(_0x381767){return _0x1b23de['status'](_0x399cf9)[_0x23be('0x1b')](_0x381767);}};}function respondWithFilteredResult(_0x46306a,_0x404d29){return function(_0x3aef72){if(_0x3aef72){var _0x504aeb=typeof _0x404d29[_0x23be('0x1c')]===_0x23be('0x1d')&&typeof _0x404d29[_0x23be('0x1e')]==='undefined';var _0x4ecf67=_0x3aef72['count'];var _0x529c8f=_0x504aeb?0x0:_0x404d29[_0x23be('0x1c')];var _0x1b81c7=_0x504aeb?_0x3aef72[_0x23be('0x1f')]:_0x404d29[_0x23be('0x1c')]+_0x404d29[_0x23be('0x1e')];var _0x2c016c;if(_0x1b81c7>=_0x4ecf67){_0x1b81c7=_0x4ecf67;_0x2c016c=0xc8;}else{_0x2c016c=0xce;}_0x46306a[_0x23be('0x19')](_0x2c016c);return _0x46306a['set'](_0x23be('0x20'),_0x529c8f+'-'+_0x1b81c7+'/'+_0x4ecf67)['json'](_0x3aef72);}return null;};}function patchUpdates(_0x38704d){return function(_0x2b17d2){try{jsonpatch[_0x23be('0x21')](_0x2b17d2,_0x38704d,!![]);}catch(_0x95a81d){return BPromise[_0x23be('0x22')](_0x95a81d);}return _0x2b17d2[_0x23be('0x23')]();};}function saveUpdates(_0x532c93,_0x39f811){return function(_0x355d23){if(_0x355d23){return _0x355d23[_0x23be('0x24')](_0x532c93)[_0x23be('0x25')](function(_0x1824f0){return _0x1824f0;});}return null;};}function removeEntity(_0x592a9e,_0x5cada9){return function(_0x12abe5){if(_0x12abe5){return _0x12abe5[_0x23be('0x26')]()[_0x23be('0x25')](function(){_0x592a9e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x221cc9,_0xf3a4b9){return function(_0x4a5cff){if(!_0x4a5cff){_0x221cc9[_0x23be('0x18')](0x194);}return _0x4a5cff;};}function handleError(_0x33aee7,_0x4701dc){_0x4701dc=_0x4701dc||0x1f4;return function(_0x3d3f3e){logger[_0x23be('0x27')](_0x3d3f3e['stack']);if(_0x3d3f3e['name']){delete _0x3d3f3e[_0x23be('0x28')];}_0x33aee7[_0x23be('0x19')](_0x4701dc)[_0x23be('0x29')](_0x3d3f3e);};}exports[_0x23be('0x2a')]=function(_0x577784,_0xc72fd){var _0x25f9b8={},_0x64c8e4={},_0x2082c9={'count':0x0,'rows':[]};var _0x455013=_[_0x23be('0x2b')](db[_0x23be('0x2c')][_0x23be('0x2d')],function(_0x364967){return{'name':_0x364967[_0x23be('0x2e')],'type':_0x364967[_0x23be('0x2f')][_0x23be('0x30')]};});_0x64c8e4[_0x23be('0x31')]=_[_0x23be('0x2b')](_0x455013,_0x23be('0x28'));_0x64c8e4[_0x23be('0x32')]=_[_0x23be('0x33')](_0x577784[_0x23be('0x32')]);_0x64c8e4['filters']=_[_0x23be('0x34')](_0x64c8e4[_0x23be('0x31')],_0x64c8e4[_0x23be('0x32')]);_0x25f9b8['attributes']=_['intersection'](_0x64c8e4[_0x23be('0x31')],qs[_0x23be('0x35')](_0x577784[_0x23be('0x32')][_0x23be('0x35')]));_0x25f9b8[_0x23be('0x36')]=_0x25f9b8['attributes'][_0x23be('0x37')]?_0x25f9b8[_0x23be('0x36')]:_0x64c8e4[_0x23be('0x31')];if(!_0x577784['query'][_0x23be('0x38')](_0x23be('0x39'))){_0x25f9b8[_0x23be('0x1e')]=qs['limit'](_0x577784[_0x23be('0x32')][_0x23be('0x1e')]);_0x25f9b8[_0x23be('0x1c')]=qs[_0x23be('0x1c')](_0x577784[_0x23be('0x32')][_0x23be('0x1c')]);}_0x25f9b8[_0x23be('0x3a')]=qs['sort'](_0x577784[_0x23be('0x32')][_0x23be('0x3b')]);_0x25f9b8[_0x23be('0x3c')]=qs['filters'](_[_0x23be('0x3d')](_0x577784['query'],_0x64c8e4[_0x23be('0x3e')]),_0x455013);if(_0x577784[_0x23be('0x32')][_0x23be('0x3f')]){_0x25f9b8[_0x23be('0x3c')]=_[_0x23be('0x40')](_0x25f9b8['where'],{'$or':_['map'](_0x455013,function(_0xdbfa4e){if(_0xdbfa4e[_0x23be('0x2f')]!==_0x23be('0x41')){var _0x526f8a={};_0x526f8a[_0xdbfa4e['name']]={'$like':'%'+_0x577784[_0x23be('0x32')][_0x23be('0x3f')]+'%'};return _0x526f8a;}})});}_0x25f9b8=_['merge']({},_0x25f9b8,_0x577784[_0x23be('0x42')]);var _0x194dde={'where':_0x25f9b8['where']};return db[_0x23be('0x2c')]['count'](_0x194dde)[_0x23be('0x25')](function(_0x9b0aad){_0x2082c9[_0x23be('0x1f')]=_0x9b0aad;if(_0x577784[_0x23be('0x32')][_0x23be('0x43')]){_0x25f9b8[_0x23be('0x44')]=[{'all':!![]}];}return db[_0x23be('0x2c')][_0x23be('0x45')](_0x25f9b8);})[_0x23be('0x25')](function(_0x55d416){_0x2082c9[_0x23be('0x46')]=_0x55d416;return _0x2082c9;})[_0x23be('0x25')](respondWithFilteredResult(_0xc72fd,_0x25f9b8))['catch'](handleError(_0xc72fd,null));};exports[_0x23be('0x47')]=function(_0x4803ac,_0x19f7cf){var _0xa395a6={'raw':![],'where':{'id':_0x4803ac[_0x23be('0x48')]['id']}},_0x2adbde={};_0x2adbde['model']=_[_0x23be('0x33')](db['DeskAccount'][_0x23be('0x2d')]);_0x2adbde[_0x23be('0x32')]=_[_0x23be('0x33')](_0x4803ac[_0x23be('0x32')]);_0x2adbde[_0x23be('0x3e')]=_[_0x23be('0x34')](_0x2adbde[_0x23be('0x31')],_0x2adbde[_0x23be('0x32')]);_0xa395a6[_0x23be('0x36')]=_[_0x23be('0x34')](_0x2adbde[_0x23be('0x31')],qs[_0x23be('0x35')](_0x4803ac[_0x23be('0x32')][_0x23be('0x35')]));_0xa395a6['attributes']=_0xa395a6['attributes'][_0x23be('0x37')]?_0xa395a6[_0x23be('0x36')]:_0x2adbde[_0x23be('0x31')];if(_0x4803ac[_0x23be('0x32')][_0x23be('0x43')]){_0xa395a6[_0x23be('0x44')]=[{'all':!![]}];}_0xa395a6=_['merge']({},_0xa395a6,_0x4803ac[_0x23be('0x42')]);return db[_0x23be('0x2c')][_0x23be('0x49')](_0xa395a6)[_0x23be('0x25')](handleEntityNotFound(_0x19f7cf,null))[_0x23be('0x25')](respondWithResult(_0x19f7cf,null))[_0x23be('0x4a')](handleError(_0x19f7cf,null));};exports[_0x23be('0x4b')]=function(_0x2f47ea,_0x577ef2){return db[_0x23be('0x2c')][_0x23be('0x4b')](_0x2f47ea['body'],{})[_0x23be('0x25')](respondWithResult(_0x577ef2,0xc9))['catch'](handleError(_0x577ef2,null));};exports[_0x23be('0x24')]=function(_0x2e215c,_0x1b72b0){if(_0x2e215c[_0x23be('0x4c')]['id']){delete _0x2e215c[_0x23be('0x4c')]['id'];}return db[_0x23be('0x2c')][_0x23be('0x49')]({'where':{'id':_0x2e215c[_0x23be('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b72b0,null))[_0x23be('0x25')](saveUpdates(_0x2e215c['body'],null))['then'](respondWithResult(_0x1b72b0,null))[_0x23be('0x4a')](handleError(_0x1b72b0,null));};exports[_0x23be('0x26')]=function(_0x3bf424,_0x4caa52){return db[_0x23be('0x2c')][_0x23be('0x49')]({'where':{'id':_0x3bf424[_0x23be('0x48')]['id']}})[_0x23be('0x25')](handleEntityNotFound(_0x4caa52,null))[_0x23be('0x25')](removeEntity(_0x4caa52,null))['catch'](handleError(_0x4caa52,null));};exports['getConfigurations']=function(_0x18af64,_0x2f31e5,_0x9064d7){var _0x28a964={};var _0x16cc5a={};var _0x396ffe;var _0x5a9ef8;return db[_0x23be('0x2c')][_0x23be('0x4d')]({'where':{'id':_0x18af64[_0x23be('0x48')]['id']}})[_0x23be('0x25')](handleEntityNotFound(_0x2f31e5,null))[_0x23be('0x25')](function(_0x1ad611){if(_0x1ad611){_0x396ffe=_0x1ad611;_0x16cc5a[_0x23be('0x31')]=_[_0x23be('0x33')](db[_0x23be('0x4e')][_0x23be('0x2d')]);_0x16cc5a[_0x23be('0x32')]=_[_0x23be('0x33')](_0x18af64['query']);_0x16cc5a[_0x23be('0x3e')]=_['intersection'](_0x16cc5a[_0x23be('0x31')],_0x16cc5a[_0x23be('0x32')]);_0x28a964['attributes']=_['intersection'](_0x16cc5a[_0x23be('0x31')],qs[_0x23be('0x35')](_0x18af64[_0x23be('0x32')][_0x23be('0x35')]));_0x28a964['attributes']=_0x28a964[_0x23be('0x36')][_0x23be('0x37')]?_0x28a964[_0x23be('0x36')]:_0x16cc5a[_0x23be('0x31')];_0x28a964[_0x23be('0x3a')]=qs[_0x23be('0x3b')](_0x18af64['query'][_0x23be('0x3b')]);_0x28a964[_0x23be('0x3c')]=qs[_0x23be('0x3e')](_[_0x23be('0x3d')](_0x18af64['query'],_0x16cc5a[_0x23be('0x3e')]));if(_0x18af64[_0x23be('0x32')][_0x23be('0x3f')]){_0x28a964[_0x23be('0x3c')]=_[_0x23be('0x40')](_0x28a964['where'],{'$or':_[_0x23be('0x2b')](_0x28a964['attributes'],function(_0x4cb995){var _0x3e6615={};_0x3e6615[_0x4cb995]={'$like':'%'+_0x18af64[_0x23be('0x32')][_0x23be('0x3f')]+'%'};return _0x3e6615;})});}_0x28a964=_[_0x23be('0x40')]({},_0x28a964,_0x18af64[_0x23be('0x42')]);return _0x396ffe[_0x23be('0x4f')](_0x28a964);}})[_0x23be('0x25')](function(_0x54cd59){if(_0x54cd59){_0x5a9ef8=_0x54cd59[_0x23be('0x37')];if(!_0x18af64[_0x23be('0x32')][_0x23be('0x38')]('nolimit')){_0x28a964['limit']=qs[_0x23be('0x1e')](_0x18af64[_0x23be('0x32')][_0x23be('0x1e')]);_0x28a964['offset']=qs[_0x23be('0x1c')](_0x18af64[_0x23be('0x32')][_0x23be('0x1c')]);}return _0x396ffe[_0x23be('0x4f')](_0x28a964);}})['then'](function(_0x9eb3e6){if(_0x9eb3e6){return _0x9eb3e6?{'count':_0x5a9ef8,'rows':_0x9eb3e6}:null;}})[_0x23be('0x25')](respondWithResult(_0x2f31e5,null))[_0x23be('0x4a')](handleError(_0x2f31e5,null));};exports[_0x23be('0x50')]=function(_0x39ee4b,_0x3b2f3c,_0x59884e){if(_0x39ee4b[_0x23be('0x4c')]['id']){delete _0x39ee4b[_0x23be('0x4c')]['id'];}return db['DeskAccount'][_0x23be('0x4d')]({'where':{'id':_0x39ee4b[_0x23be('0x48')]['id']}})[_0x23be('0x25')](handleEntityNotFound(_0x3b2f3c,null))['then'](function(_0x5a01fd){if(_0x5a01fd){_0x39ee4b[_0x23be('0x4c')][_0x23be('0x51')]=_0x5a01fd['id'];_0x39ee4b['body'][_0x23be('0x52')]=integrations[_0x23be('0x53')](_0x39ee4b['body'][_0x23be('0x54')],_0x39ee4b[_0x23be('0x4c')][_0x23be('0x2f')]);_0x39ee4b[_0x23be('0x4c')][_0x23be('0x55')]=integrations[_0x23be('0x56')](_0x39ee4b[_0x23be('0x4c')][_0x23be('0x54')],_0x39ee4b[_0x23be('0x4c')][_0x23be('0x2f')]);return db[_0x23be('0x4e')][_0x23be('0x4b')](_0x39ee4b[_0x23be('0x4c')],{'include':[{'model':db[_0x23be('0x57')],'as':_0x23be('0x52')},{'model':db[_0x23be('0x57')],'as':_0x23be('0x55')}]});}return null;})[_0x23be('0x25')](respondWithResult(_0x3b2f3c,null))['catch'](handleError(_0x3b2f3c,null));};exports['getFields']=function(_0x58314f,_0x59dcdf,_0x356fd2){var _0x2752aa=[{'name':'priority','label':_0x23be('0x58'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x4867b8='';return db['DeskAccount'][_0x23be('0x4d')]({'where':{'id':_0x58314f[_0x23be('0x48')]['id']},'attributes':['id',_0x23be('0x59'),_0x23be('0x5a'),'username',_0x23be('0x5b'),'consumerKey',_0x23be('0x5c'),_0x23be('0x5d'),_0x23be('0x5e')]})[_0x23be('0x25')](handleEntityNotFound(_0x59dcdf,null))[_0x23be('0x25')](function(_0x528dec){if(_0x528dec){_0x4867b8=_0x528dec[_0x23be('0x59')];var _0x81c021=_0x4867b8[_0x23be('0x5f')](-0x1);if(_0x81c021==='/'){_0x4867b8=_0x4867b8[_0x23be('0x60')](0x0,_0x4867b8[_0x23be('0x61')](_0x81c021));}var _0x535f3b={'method':'GET','uri':util[_0x23be('0x62')](_0x23be('0x63'),_0x4867b8),'headers':{'Content-Type':'application/json','Accept':_0x23be('0x64')},'json':!![]};if(_0x528dec[_0x23be('0x5a')]===_0x23be('0x65')){_0x535f3b[_0x23be('0x66')]['Authorization']=util[_0x23be('0x62')](_0x23be('0x67'),new Buffer(util[_0x23be('0x62')](_0x23be('0x68'),_0x528dec[_0x23be('0x69')],_0x528dec[_0x23be('0x5b')]))[_0x23be('0x6a')]('base64'));}return rp(_0x535f3b)[_0x23be('0x25')](function(_0x3692e0){return _0x2752aa['concat'](_[_0x23be('0x2b')](_0x3692e0['_embedded'][_0x23be('0x6b')],function(_0x215c90){return{'id':_0x215c90[_0x23be('0x28')],'name':_0x215c90[_0x23be('0x28')],'type':_0x215c90[_0x23be('0x2f')],'active':_0x215c90[_0x23be('0x6c')],'label':_0x215c90[_0x23be('0x6d')],'custom':!![]};}));});}})['then'](function(_0x252cd2){return{'count':_0x252cd2[_0x23be('0x37')],'rows':_0x252cd2};})[_0x23be('0x25')](respondWithResult(_0x59dcdf,null))[_0x23be('0x4a')](function(_0x4b6803){var _0x39a0df=_0x58314f[_0x23be('0x32')][_0x23be('0x6e')]?0x1f4:_0x4b6803[_0x23be('0x6f')]||0x1f4;logger['error'](_0x23be('0x70'),_0x23be('0x71'),_0x39a0df,JSON['stringify'](_0x4b6803));delete _0x4b6803[_0x23be('0x28')];if(_0x39a0df===0x191){_0x39a0df=0x190;}_0x59dcdf['status'](_0x39a0df)[_0x23be('0x29')](_0x58314f[_0x23be('0x32')][_0x23be('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x4b6803[_0x23be('0x6f')]}:_0x4b6803);});};
\ No newline at end of file
index 2eae363..d8e1361 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac9b=['moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','util','../../config/logger','api'];(function(_0x35d0af,_0x46a010){var _0x4bc858=function(_0x176a02){while(--_0x176a02){_0x35d0af['push'](_0x35d0af['shift']());}};_0x4bc858(++_0x46a010);}(_0xac9b,0x6d));var _0xbac9=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0xac9b[_0x2714ec];return _0x2608e5;};'use strict';var _=require('lodash');var util=require(_0xbac9('0x0'));var logger=require(_0xbac9('0x1'))(_0xbac9('0x2'));var moment=require(_0xbac9('0x3'));var BPromise=require(_0xbac9('0x4'));var rp=require(_0xbac9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbac9('0x6'));var config=require(_0xbac9('0x7'));var attributes=require(_0xbac9('0x8'));var integrations=require(_0xbac9('0x9'));module[_0xbac9('0xa')]=function(_0x492b9e,_0x5b0f6c){return _0x492b9e[_0xbac9('0xb')](_0xbac9('0xc'),attributes,{'tableName':_0xbac9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4849=['../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes'];(function(_0x54576b,_0x1e6f9d){var _0x12dc2d=function(_0x1ffef6){while(--_0x1ffef6){_0x54576b['push'](_0x54576b['shift']());}};_0x12dc2d(++_0x1e6f9d);}(_0x4849,0xac));var _0x9484=function(_0x388349,_0x3b01d5){_0x388349=_0x388349-0x0;var _0x477e1b=_0x4849[_0x388349];return _0x477e1b;};'use strict';var _=require(_0x9484('0x0'));var util=require(_0x9484('0x1'));var logger=require(_0x9484('0x2'))(_0x9484('0x3'));var moment=require('moment');var BPromise=require(_0x9484('0x4'));var rp=require(_0x9484('0x5'));var fs=require('fs');var path=require(_0x9484('0x6'));var rimraf=require(_0x9484('0x7'));var config=require(_0x9484('0x8'));var attributes=require(_0x9484('0x9'));var integrations=require(_0x9484('0xa'));module[_0x9484('0xb')]=function(_0x1fef73,_0x303cd5){return _0x1fef73[_0x9484('0xc')]('DeskAccount',attributes,{'tableName':_0x9484('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2cf8a78..e6d66a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf970=['attributes','include','map','model','stringify','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xf970,0xd8));var _0x0f97=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf970[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0f97('0x0'));var util=require(_0x0f97('0x1'));var moment=require(_0x0f97('0x2'));var BPromise=require(_0x0f97('0x3'));var rs=require(_0x0f97('0x4'));var fs=require('fs');var Redis=require(_0x0f97('0x5'));var db=require(_0x0f97('0x6'))['db'];var utils=require(_0x0f97('0x7'));var logger=require(_0x0f97('0x8'))(_0x0f97('0x9'));var config=require(_0x0f97('0xa'));var jayson=require(_0x0f97('0xb'));var client=jayson['client'][_0x0f97('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33a0c4,_0xfe953e,_0x3a2519){return new BPromise(function(_0x14e08d,_0x21f6b1){return client['request'](_0x33a0c4,_0x3a2519)[_0x0f97('0xd')](function(_0x1823c4){logger[_0x0f97('0xe')](_0x0f97('0xf'),_0xfe953e,_0x0f97('0x10'));logger[_0x0f97('0x11')](_0x0f97('0x12'),_0xfe953e,_0x0f97('0x10'),JSON['stringify'](_0x1823c4));if(_0x1823c4[_0x0f97('0x13')]){if(_0x1823c4[_0x0f97('0x13')][_0x0f97('0x14')]===0x1f4){logger[_0x0f97('0x13')]('DeskAccount,\x20%s,\x20%s',_0xfe953e,_0x1823c4[_0x0f97('0x13')][_0x0f97('0x15')]);return _0x21f6b1(_0x1823c4['error'][_0x0f97('0x15')]);}logger[_0x0f97('0x13')]('DeskAccount,\x20%s,\x20%s',_0xfe953e,_0x1823c4[_0x0f97('0x13')][_0x0f97('0x15')]);return _0x14e08d(_0x1823c4[_0x0f97('0x13')]['message']);}else{logger[_0x0f97('0xe')](_0x0f97('0xf'),_0xfe953e,_0x0f97('0x10'));_0x14e08d(_0x1823c4['result']['message']);}})[_0x0f97('0x16')](function(_0x312bda){logger[_0x0f97('0x13')](_0x0f97('0xf'),_0xfe953e,_0x312bda);_0x21f6b1(_0x312bda);});});}exports[_0x0f97('0x17')]=function(_0x5e7c74){var _0x4b8de9=this;return new Promise(function(_0x3c1e50,_0x3371f0){return db[_0x0f97('0x18')][_0x0f97('0x19')]({'raw':_0x5e7c74[_0x0f97('0x1a')]?_0x5e7c74[_0x0f97('0x1a')][_0x0f97('0x1b')]===undefined?!![]:![]:!![],'where':_0x5e7c74[_0x0f97('0x1a')]?_0x5e7c74['options'][_0x0f97('0x1c')]||null:null,'attributes':_0x5e7c74['options']?_0x5e7c74[_0x0f97('0x1a')][_0x0f97('0x1d')]||null:null,'limit':_0x5e7c74[_0x0f97('0x1a')]?_0x5e7c74['options']['limit']||null:null,'include':_0x5e7c74['options']?_0x5e7c74[_0x0f97('0x1a')][_0x0f97('0x1e')]?_[_0x0f97('0x1f')](_0x5e7c74['options'][_0x0f97('0x1e')],function(_0x4655b7){return{'model':db[_0x4655b7[_0x0f97('0x20')]],'as':_0x4655b7['as'],'attributes':_0x4655b7['attributes'],'include':_0x4655b7['include']?_['map'](_0x4655b7[_0x0f97('0x1e')],function(_0x8bf2f){return{'model':db[_0x8bf2f[_0x0f97('0x20')]],'as':_0x8bf2f['as'],'attributes':_0x8bf2f['attributes'],'include':_0x8bf2f[_0x0f97('0x1e')]?_[_0x0f97('0x1f')](_0x8bf2f[_0x0f97('0x1e')],function(_0x5d569e){return{'model':db[_0x5d569e[_0x0f97('0x20')]],'as':_0x5d569e['as'],'attributes':_0x5d569e[_0x0f97('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0f97('0xd')](function(_0x175834){logger[_0x0f97('0xe')](_0x0f97('0x17'),_0x5e7c74);logger[_0x0f97('0x11')]('GetDeskAccount',_0x5e7c74,JSON[_0x0f97('0x21')](_0x175834));_0x3c1e50(_0x175834);})['catch'](function(_0x2379d6){logger['error'](_0x0f97('0x17'),_0x2379d6[_0x0f97('0x15')],_0x5e7c74);_0x3371f0(_0x4b8de9[_0x0f97('0x13')](0x1f4,_0x2379d6[_0x0f97('0x15')]));});});};exports['ShowDeskAccount']=function(_0x497def){var _0x39365a=this;return new Promise(function(_0x3372f4,_0x57ccea){return db[_0x0f97('0x18')]['find']({'raw':_0x497def[_0x0f97('0x1a')]?_0x497def[_0x0f97('0x1a')][_0x0f97('0x1b')]===undefined?!![]:![]:!![],'where':_0x497def[_0x0f97('0x1a')]?_0x497def['options']['where']||null:null,'attributes':_0x497def[_0x0f97('0x1a')]?_0x497def['options']['attributes']||null:null,'include':_0x497def[_0x0f97('0x1a')]?_0x497def[_0x0f97('0x1a')][_0x0f97('0x1e')]?_[_0x0f97('0x1f')](_0x497def[_0x0f97('0x1a')][_0x0f97('0x1e')],function(_0x4d6122){return{'model':db[_0x4d6122[_0x0f97('0x20')]],'as':_0x4d6122['as'],'attributes':_0x4d6122[_0x0f97('0x1d')],'include':_0x4d6122['include']?_[_0x0f97('0x1f')](_0x4d6122['include'],function(_0xd61747){return{'model':db[_0xd61747[_0x0f97('0x20')]],'as':_0xd61747['as'],'attributes':_0xd61747['attributes'],'include':_0xd61747[_0x0f97('0x1e')]?_[_0x0f97('0x1f')](_0xd61747[_0x0f97('0x1e')],function(_0x280838){return{'model':db[_0x280838[_0x0f97('0x20')]],'as':_0x280838['as'],'attributes':_0x280838[_0x0f97('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0f97('0xd')](function(_0x3838b9){logger[_0x0f97('0xe')](_0x0f97('0x22'),_0x497def);logger['debug'](_0x0f97('0x22'),_0x497def,JSON['stringify'](_0x3838b9));_0x3372f4(_0x3838b9);})[_0x0f97('0x16')](function(_0x1155af){logger[_0x0f97('0x13')](_0x0f97('0x22'),_0x1155af[_0x0f97('0x15')],_0x497def);_0x57ccea(_0x39365a[_0x0f97('0x13')](0x1f4,_0x1155af[_0x0f97('0x15')]));});});};
\ No newline at end of file
+var _0x1e17=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','find','ShowDeskAccount','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x27d933,_0x164b72){var _0x39aebe=function(_0x40f123){while(--_0x40f123){_0x27d933['push'](_0x27d933['shift']());}};_0x39aebe(++_0x164b72);}(_0x1e17,0xe8));var _0x71e1=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x1e17[_0x19b3f9];return _0x18c3f6;};'use strict';var _=require(_0x71e1('0x0'));var util=require(_0x71e1('0x1'));var moment=require(_0x71e1('0x2'));var BPromise=require('bluebird');var rs=require(_0x71e1('0x3'));var fs=require('fs');var Redis=require(_0x71e1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x71e1('0x5'));var logger=require('../../config/logger')(_0x71e1('0x6'));var config=require(_0x71e1('0x7'));var jayson=require(_0x71e1('0x8'));var client=jayson[_0x71e1('0x9')][_0x71e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21d2ee,_0x41b0e4,_0x4d4c66){return new BPromise(function(_0x1bd274,_0x287d3e){return client[_0x71e1('0xb')](_0x21d2ee,_0x4d4c66)[_0x71e1('0xc')](function(_0x551423){logger[_0x71e1('0xd')](_0x71e1('0xe'),_0x41b0e4,_0x71e1('0xf'));logger['debug'](_0x71e1('0x10'),_0x41b0e4,'request\x20sent',JSON[_0x71e1('0x11')](_0x551423));if(_0x551423['error']){if(_0x551423[_0x71e1('0x12')]['code']===0x1f4){logger[_0x71e1('0x12')](_0x71e1('0xe'),_0x41b0e4,_0x551423['error']['message']);return _0x287d3e(_0x551423['error'][_0x71e1('0x13')]);}logger[_0x71e1('0x12')](_0x71e1('0xe'),_0x41b0e4,_0x551423['error'][_0x71e1('0x13')]);return _0x1bd274(_0x551423[_0x71e1('0x12')][_0x71e1('0x13')]);}else{logger['info'](_0x71e1('0xe'),_0x41b0e4,_0x71e1('0xf'));_0x1bd274(_0x551423['result']['message']);}})[_0x71e1('0x14')](function(_0x5e61e4){logger[_0x71e1('0x12')]('DeskAccount,\x20%s,\x20%s',_0x41b0e4,_0x5e61e4);_0x287d3e(_0x5e61e4);});});}exports['GetDeskAccount']=function(_0x1a4663){var _0x4e108e=this;return new Promise(function(_0x59cea6,_0x242cd7){return db[_0x71e1('0x15')][_0x71e1('0x16')]({'raw':_0x1a4663[_0x71e1('0x17')]?_0x1a4663[_0x71e1('0x17')][_0x71e1('0x18')]===undefined?!![]:![]:!![],'where':_0x1a4663[_0x71e1('0x17')]?_0x1a4663['options'][_0x71e1('0x19')]||null:null,'attributes':_0x1a4663[_0x71e1('0x17')]?_0x1a4663[_0x71e1('0x17')][_0x71e1('0x1a')]||null:null,'limit':_0x1a4663[_0x71e1('0x17')]?_0x1a4663['options'][_0x71e1('0x1b')]||null:null,'include':_0x1a4663[_0x71e1('0x17')]?_0x1a4663['options'][_0x71e1('0x1c')]?_[_0x71e1('0x1d')](_0x1a4663['options'][_0x71e1('0x1c')],function(_0x1a921e){return{'model':db[_0x1a921e[_0x71e1('0x1e')]],'as':_0x1a921e['as'],'attributes':_0x1a921e[_0x71e1('0x1a')],'include':_0x1a921e[_0x71e1('0x1c')]?_['map'](_0x1a921e[_0x71e1('0x1c')],function(_0x25ab69){return{'model':db[_0x25ab69[_0x71e1('0x1e')]],'as':_0x25ab69['as'],'attributes':_0x25ab69[_0x71e1('0x1a')],'include':_0x25ab69[_0x71e1('0x1c')]?_['map'](_0x25ab69[_0x71e1('0x1c')],function(_0x345f95){return{'model':db[_0x345f95[_0x71e1('0x1e')]],'as':_0x345f95['as'],'attributes':_0x345f95[_0x71e1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x71e1('0xc')](function(_0x277fca){logger[_0x71e1('0xd')](_0x71e1('0x1f'),_0x1a4663);logger['debug'](_0x71e1('0x1f'),_0x1a4663,JSON[_0x71e1('0x11')](_0x277fca));_0x59cea6(_0x277fca);})[_0x71e1('0x14')](function(_0x1cc9c3){logger[_0x71e1('0x12')](_0x71e1('0x1f'),_0x1cc9c3[_0x71e1('0x13')],_0x1a4663);_0x242cd7(_0x4e108e[_0x71e1('0x12')](0x1f4,_0x1cc9c3['message']));});});};exports['ShowDeskAccount']=function(_0x508169){var _0x2874e7=this;return new Promise(function(_0x1e97ab,_0x1453b7){return db['DeskAccount'][_0x71e1('0x20')]({'raw':_0x508169[_0x71e1('0x17')]?_0x508169[_0x71e1('0x17')][_0x71e1('0x18')]===undefined?!![]:![]:!![],'where':_0x508169[_0x71e1('0x17')]?_0x508169[_0x71e1('0x17')][_0x71e1('0x19')]||null:null,'attributes':_0x508169[_0x71e1('0x17')]?_0x508169[_0x71e1('0x17')]['attributes']||null:null,'include':_0x508169['options']?_0x508169[_0x71e1('0x17')]['include']?_['map'](_0x508169[_0x71e1('0x17')]['include'],function(_0x4679cb){return{'model':db[_0x4679cb[_0x71e1('0x1e')]],'as':_0x4679cb['as'],'attributes':_0x4679cb[_0x71e1('0x1a')],'include':_0x4679cb[_0x71e1('0x1c')]?_[_0x71e1('0x1d')](_0x4679cb[_0x71e1('0x1c')],function(_0x2c470b){return{'model':db[_0x2c470b[_0x71e1('0x1e')]],'as':_0x2c470b['as'],'attributes':_0x2c470b[_0x71e1('0x1a')],'include':_0x2c470b[_0x71e1('0x1c')]?_[_0x71e1('0x1d')](_0x2c470b[_0x71e1('0x1c')],function(_0x191b6a){return{'model':db[_0x191b6a['model']],'as':_0x191b6a['as'],'attributes':_0x191b6a['attributes']};}):[]};}):[]};}):[]:[]})[_0x71e1('0xc')](function(_0x3c4c03){logger[_0x71e1('0xd')]('ShowDeskAccount',_0x508169);logger['debug'](_0x71e1('0x21'),_0x508169,JSON[_0x71e1('0x11')](_0x3c4c03));_0x1e97ab(_0x3c4c03);})['catch'](function(_0x4397ed){logger[_0x71e1('0x12')](_0x71e1('0x21'),_0x4397ed[_0x71e1('0x13')],_0x508169);_0x1453b7(_0x2874e7[_0x71e1('0x12')](0x1f4,_0x4397ed[_0x71e1('0x13')]));});});};
\ No newline at end of file
index 898fff9..b7f3016 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x3cdff2,_0x30d0e9){var _0x1e06e9=function(_0x51cf08){while(--_0x51cf08){_0x3cdff2['push'](_0x3cdff2['shift']());}};_0x1e06e9(++_0x30d0e9);}(_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');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router;
\ No newline at end of file
+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(_0x154489,_0x543e90){var _0x16a870=function(_0x989eb6){while(--_0x989eb6){_0x154489['push'](_0x154489['shift']());}};_0x16a870(++_0x543e90);}(_0x34e8,0x12c));var _0x834e=function(_0x316a37,_0x30edf7){_0x316a37=_0x316a37-0x0;var _0x16c0b7=_0x34e8[_0x316a37];return _0x16c0b7;};'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 d583ee2..f31c23e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fd9=['sequelize','STRING'];(function(_0x172bac,_0x5a3e91){var _0x38d930=function(_0x169f46){while(--_0x169f46){_0x172bac['push'](_0x172bac['shift']());}};_0x38d930(++_0x5a3e91);}(_0x6fd9,0x198));var _0x96fd=function(_0x7f63af,_0x39ac52){_0x7f63af=_0x7f63af-0x0;var _0x1a5bc5=_0x6fd9[_0x7f63af];return _0x1a5bc5;};'use strict';var Sequelize=require(_0x96fd('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x96fd('0x1')]}};
\ No newline at end of file
+var _0xc789=['sequelize','exports','STRING'];(function(_0x589248,_0x31dea3){var _0x486750=function(_0x3e7c21){while(--_0x3e7c21){_0x589248['push'](_0x589248['shift']());}};_0x486750(++_0x31dea3);}(_0xc789,0x8a));var _0x9c78=function(_0x5c3c18,_0x1c85c2){_0x5c3c18=_0x5c3c18-0x0;var _0x5b4373=_0xc789[_0x5c3c18];return _0x5b4373;};'use strict';var Sequelize=require(_0x9c78('0x0'));module[_0x9c78('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9c78('0x2')]}};
\ No newline at end of file
index a95af1b..5fb5dac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2d2=['pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','length','find','catch','create','body','findOne','DeskField','order','options','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x160425,_0x2983aa){var _0x455b67=function(_0x1e964a){while(--_0x1e964a){_0x160425['push'](_0x160425['shift']());}};_0x455b67(++_0x2983aa);}(_0xc2d2,0x160));var _0x2c2d=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0xc2d2[_0x22bdd3];return _0x44d9d9;};'use strict';var emlformat=require(_0x2c2d('0x0'));var rimraf=require(_0x2c2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c2d('0x2'));var rp=require(_0x2c2d('0x3'));var moment=require('moment');var BPromise=require(_0x2c2d('0x4'));var Mustache=require('mustache');var util=require(_0x2c2d('0x5'));var path=require(_0x2c2d('0x6'));var sox=require(_0x2c2d('0x7'));var csv=require('to-csv');var ejs=require(_0x2c2d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c2d('0x9'));var squel=require('squel');var crypto=require(_0x2c2d('0xa'));var jsforce=require(_0x2c2d('0xb'));var deskjs=require(_0x2c2d('0xc'));var toCsv=require(_0x2c2d('0xd'));var querystring=require(_0x2c2d('0xe'));var Papa=require(_0x2c2d('0xf'));var Redis=require(_0x2c2d('0x10'));var authService=require(_0x2c2d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2c2d('0x12'));var hardwareService=require(_0x2c2d('0x13'));var logger=require(_0x2c2d('0x14'))(_0x2c2d('0x15'));var utils=require(_0x2c2d('0x16'));var config=require(_0x2c2d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3aa8ec,_0x1ff473){_0x1ff473=_0x1ff473||0xcc;return function(_0x3dff7a){if(_0x3dff7a){return _0x3aa8ec[_0x2c2d('0x18')](_0x1ff473);}return _0x3aa8ec[_0x2c2d('0x19')](_0x1ff473)[_0x2c2d('0x1a')]();};}function respondWithResult(_0x273bda,_0x70baa4){_0x70baa4=_0x70baa4||0xc8;return function(_0xf772a4){if(_0xf772a4){return _0x273bda[_0x2c2d('0x19')](_0x70baa4)[_0x2c2d('0x1b')](_0xf772a4);}};}function respondWithFilteredResult(_0x105d92,_0x5d5a7f){return function(_0x281993){if(_0x281993){var _0x9526e5=typeof _0x5d5a7f[_0x2c2d('0x1c')]==='undefined'&&typeof _0x5d5a7f[_0x2c2d('0x1d')]===_0x2c2d('0x1e');var _0x149825=_0x281993['count'];var _0xb27959=_0x9526e5?0x0:_0x5d5a7f[_0x2c2d('0x1c')];var _0x275676=_0x9526e5?_0x281993[_0x2c2d('0x1f')]:_0x5d5a7f[_0x2c2d('0x1c')]+_0x5d5a7f[_0x2c2d('0x1d')];var _0x55d622;if(_0x275676>=_0x149825){_0x275676=_0x149825;_0x55d622=0xc8;}else{_0x55d622=0xce;}_0x105d92[_0x2c2d('0x19')](_0x55d622);return _0x105d92[_0x2c2d('0x20')](_0x2c2d('0x21'),_0xb27959+'-'+_0x275676+'/'+_0x149825)[_0x2c2d('0x1b')](_0x281993);}return null;};}function patchUpdates(_0x2a41eb){return function(_0x15a3c1){try{jsonpatch['apply'](_0x15a3c1,_0x2a41eb,!![]);}catch(_0x605643){return BPromise['reject'](_0x605643);}return _0x15a3c1[_0x2c2d('0x22')]();};}function saveUpdates(_0x17f652,_0x201a7b){return function(_0x3b49b6){if(_0x3b49b6){return _0x3b49b6[_0x2c2d('0x23')](_0x17f652)[_0x2c2d('0x24')](function(_0x18b9fb){return _0x18b9fb;});}return null;};}function removeEntity(_0x35b4ae,_0x231699){return function(_0x41f0ca){if(_0x41f0ca){return _0x41f0ca[_0x2c2d('0x25')]()[_0x2c2d('0x24')](function(){_0x35b4ae[_0x2c2d('0x19')](0xcc)[_0x2c2d('0x1a')]();});}};}function handleEntityNotFound(_0x56c537,_0x26af8d){return function(_0x52a028){if(!_0x52a028){_0x56c537[_0x2c2d('0x18')](0x194);}return _0x52a028;};}function handleError(_0x349b3a,_0x400b53){_0x400b53=_0x400b53||0x1f4;return function(_0x270be7){logger[_0x2c2d('0x26')](_0x270be7[_0x2c2d('0x27')]);if(_0x270be7['name']){delete _0x270be7[_0x2c2d('0x28')];}_0x349b3a[_0x2c2d('0x19')](_0x400b53)['send'](_0x270be7);};}exports[_0x2c2d('0x29')]=function(_0x5f416a,_0x39543c){var _0x488599={},_0x139853={},_0x44f5ab={'count':0x0,'rows':[]};var _0x265f1e=_[_0x2c2d('0x2a')](db[_0x2c2d('0x2b')][_0x2c2d('0x2c')],function(_0x51ba84){return{'name':_0x51ba84[_0x2c2d('0x2d')],'type':_0x51ba84[_0x2c2d('0x2e')][_0x2c2d('0x2f')]};});_0x139853['model']=_[_0x2c2d('0x2a')](_0x265f1e,_0x2c2d('0x28'));_0x139853[_0x2c2d('0x30')]=_['keys'](_0x5f416a['query']);_0x139853[_0x2c2d('0x31')]=_[_0x2c2d('0x32')](_0x139853[_0x2c2d('0x33')],_0x139853[_0x2c2d('0x30')]);_0x488599[_0x2c2d('0x34')]=_[_0x2c2d('0x32')](_0x139853['model'],qs[_0x2c2d('0x35')](_0x5f416a[_0x2c2d('0x30')]['fields']));_0x488599[_0x2c2d('0x34')]=_0x488599[_0x2c2d('0x34')]['length']?_0x488599['attributes']:_0x139853[_0x2c2d('0x33')];if(!_0x5f416a[_0x2c2d('0x30')][_0x2c2d('0x36')](_0x2c2d('0x37'))){_0x488599[_0x2c2d('0x1d')]=qs[_0x2c2d('0x1d')](_0x5f416a[_0x2c2d('0x30')][_0x2c2d('0x1d')]);_0x488599['offset']=qs[_0x2c2d('0x1c')](_0x5f416a['query'][_0x2c2d('0x1c')]);}_0x488599['order']=qs[_0x2c2d('0x38')](_0x5f416a[_0x2c2d('0x30')][_0x2c2d('0x38')]);_0x488599[_0x2c2d('0x39')]=qs[_0x2c2d('0x31')](_[_0x2c2d('0x3a')](_0x5f416a[_0x2c2d('0x30')],_0x139853[_0x2c2d('0x31')]),_0x265f1e);if(_0x5f416a['query'][_0x2c2d('0x3b')]){_0x488599[_0x2c2d('0x39')]=_[_0x2c2d('0x3c')](_0x488599[_0x2c2d('0x39')],{'$or':_['map'](_0x265f1e,function(_0x269bf6){if(_0x269bf6['type']!==_0x2c2d('0x3d')){var _0x1d954d={};_0x1d954d[_0x269bf6[_0x2c2d('0x28')]]={'$like':'%'+_0x5f416a['query'][_0x2c2d('0x3b')]+'%'};return _0x1d954d;}})});}_0x488599=_[_0x2c2d('0x3c')]({},_0x488599,_0x5f416a['options']);var _0x12cd19={'where':_0x488599[_0x2c2d('0x39')]};return db[_0x2c2d('0x2b')][_0x2c2d('0x1f')](_0x12cd19)[_0x2c2d('0x24')](function(_0x148390){_0x44f5ab['count']=_0x148390;if(_0x5f416a[_0x2c2d('0x30')][_0x2c2d('0x3e')]){_0x488599[_0x2c2d('0x3f')]=[{'all':!![]}];}return db[_0x2c2d('0x2b')][_0x2c2d('0x40')](_0x488599);})[_0x2c2d('0x24')](function(_0x136e80){_0x44f5ab[_0x2c2d('0x41')]=_0x136e80;return _0x44f5ab;})[_0x2c2d('0x24')](respondWithFilteredResult(_0x39543c,_0x488599))['catch'](handleError(_0x39543c,null));};exports['show']=function(_0x58e069,_0x36efd3){var _0x4d795d={'raw':![],'where':{'id':_0x58e069[_0x2c2d('0x42')]['id']}},_0x4249ca={};_0x4249ca['model']=_['keys'](db['DeskConfiguration'][_0x2c2d('0x2c')]);_0x4249ca[_0x2c2d('0x30')]=_[_0x2c2d('0x43')](_0x58e069[_0x2c2d('0x30')]);_0x4249ca[_0x2c2d('0x31')]=_[_0x2c2d('0x32')](_0x4249ca[_0x2c2d('0x33')],_0x4249ca[_0x2c2d('0x30')]);_0x4d795d['attributes']=_[_0x2c2d('0x32')](_0x4249ca[_0x2c2d('0x33')],qs[_0x2c2d('0x35')](_0x58e069['query'][_0x2c2d('0x35')]));_0x4d795d['attributes']=_0x4d795d[_0x2c2d('0x34')][_0x2c2d('0x44')]?_0x4d795d[_0x2c2d('0x34')]:_0x4249ca[_0x2c2d('0x33')];if(_0x58e069['query']['includeAll']){_0x4d795d[_0x2c2d('0x3f')]=[{'all':!![]}];}_0x4d795d=_[_0x2c2d('0x3c')]({},_0x4d795d,_0x58e069['options']);return db[_0x2c2d('0x2b')][_0x2c2d('0x45')](_0x4d795d)[_0x2c2d('0x24')](handleEntityNotFound(_0x36efd3,null))[_0x2c2d('0x24')](respondWithResult(_0x36efd3,null))[_0x2c2d('0x46')](handleError(_0x36efd3,null));};exports[_0x2c2d('0x47')]=function(_0x44277d,_0x3dee97){return db[_0x2c2d('0x2b')][_0x2c2d('0x47')](_0x44277d[_0x2c2d('0x48')],{})[_0x2c2d('0x24')](respondWithResult(_0x3dee97,0xc9))['catch'](handleError(_0x3dee97,null));};exports[_0x2c2d('0x23')]=function(_0x444697,_0x232ef7){if(_0x444697[_0x2c2d('0x48')]['id']){delete _0x444697[_0x2c2d('0x48')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x444697[_0x2c2d('0x42')]['id']}})[_0x2c2d('0x24')](handleEntityNotFound(_0x232ef7,null))[_0x2c2d('0x24')](saveUpdates(_0x444697[_0x2c2d('0x48')],null))[_0x2c2d('0x24')](respondWithResult(_0x232ef7,null))[_0x2c2d('0x46')](handleError(_0x232ef7,null));};exports[_0x2c2d('0x25')]=function(_0x181b3a,_0x4ef621){return db[_0x2c2d('0x2b')]['find']({'where':{'id':_0x181b3a['params']['id']}})[_0x2c2d('0x24')](handleEntityNotFound(_0x4ef621,null))['then'](removeEntity(_0x4ef621,null))[_0x2c2d('0x46')](handleError(_0x4ef621,null));};exports['getFields']=function(_0x492d09,_0x90700c,_0x5884d2){var _0x2b52a5={};var _0x329505={};var _0x39555d;var _0x55f35d;return db[_0x2c2d('0x2b')][_0x2c2d('0x49')]({'where':{'id':_0x492d09[_0x2c2d('0x42')]['id']}})[_0x2c2d('0x24')](handleEntityNotFound(_0x90700c,null))[_0x2c2d('0x24')](function(_0x4066db){if(_0x4066db){_0x39555d=_0x4066db;_0x329505[_0x2c2d('0x33')]=_[_0x2c2d('0x43')](db[_0x2c2d('0x4a')][_0x2c2d('0x2c')]);_0x329505[_0x2c2d('0x30')]=_[_0x2c2d('0x43')](_0x492d09[_0x2c2d('0x30')]);_0x329505[_0x2c2d('0x31')]=_['intersection'](_0x329505[_0x2c2d('0x33')],_0x329505[_0x2c2d('0x30')]);_0x2b52a5[_0x2c2d('0x34')]=_['intersection'](_0x329505['model'],qs[_0x2c2d('0x35')](_0x492d09[_0x2c2d('0x30')][_0x2c2d('0x35')]));_0x2b52a5[_0x2c2d('0x34')]=_0x2b52a5['attributes'][_0x2c2d('0x44')]?_0x2b52a5['attributes']:_0x329505['model'];_0x2b52a5[_0x2c2d('0x4b')]=qs['sort'](_0x492d09[_0x2c2d('0x30')][_0x2c2d('0x38')]);_0x2b52a5[_0x2c2d('0x39')]=qs['filters'](_[_0x2c2d('0x3a')](_0x492d09[_0x2c2d('0x30')],_0x329505[_0x2c2d('0x31')]));if(_0x492d09[_0x2c2d('0x30')][_0x2c2d('0x3b')]){_0x2b52a5[_0x2c2d('0x39')]=_[_0x2c2d('0x3c')](_0x2b52a5[_0x2c2d('0x39')],{'$or':_[_0x2c2d('0x2a')](_0x2b52a5[_0x2c2d('0x34')],function(_0x17a10f){var _0x43d1a5={};_0x43d1a5[_0x17a10f]={'$like':'%'+_0x492d09['query'][_0x2c2d('0x3b')]+'%'};return _0x43d1a5;})});}_0x2b52a5=_[_0x2c2d('0x3c')]({},_0x2b52a5,_0x492d09[_0x2c2d('0x4c')]);return _0x39555d['getFields'](_0x2b52a5);}})[_0x2c2d('0x24')](function(_0x511caf){if(_0x511caf){_0x55f35d=_0x511caf[_0x2c2d('0x44')];if(!_0x492d09[_0x2c2d('0x30')][_0x2c2d('0x36')](_0x2c2d('0x37'))){_0x2b52a5[_0x2c2d('0x1d')]=qs[_0x2c2d('0x1d')](_0x492d09[_0x2c2d('0x30')]['limit']);_0x2b52a5['offset']=qs[_0x2c2d('0x1c')](_0x492d09[_0x2c2d('0x30')]['offset']);}return _0x39555d['getFields'](_0x2b52a5);}})[_0x2c2d('0x24')](function(_0x4e6fad){if(_0x4e6fad){return _0x4e6fad?{'count':_0x55f35d,'rows':_0x4e6fad}:null;}})[_0x2c2d('0x24')](respondWithResult(_0x90700c,null))[_0x2c2d('0x46')](handleError(_0x90700c,null));};exports[_0x2c2d('0x4d')]=function(_0x5bfe30,_0x54e13c,_0x2c4224){var _0x32a14b={};var _0x55f797={};var _0x377307;var _0x2afa95;return db[_0x2c2d('0x2b')][_0x2c2d('0x49')]({'where':{'id':_0x5bfe30[_0x2c2d('0x42')]['id']}})[_0x2c2d('0x24')](handleEntityNotFound(_0x54e13c,null))[_0x2c2d('0x24')](function(_0x5e6da1){if(_0x5e6da1){_0x377307=_0x5e6da1;_0x55f797[_0x2c2d('0x33')]=_[_0x2c2d('0x43')](db['DeskField'][_0x2c2d('0x2c')]);_0x55f797['query']=_[_0x2c2d('0x43')](_0x5bfe30[_0x2c2d('0x30')]);_0x55f797['filters']=_[_0x2c2d('0x32')](_0x55f797['model'],_0x55f797[_0x2c2d('0x30')]);_0x32a14b[_0x2c2d('0x34')]=_[_0x2c2d('0x32')](_0x55f797[_0x2c2d('0x33')],qs['fields'](_0x5bfe30[_0x2c2d('0x30')][_0x2c2d('0x35')]));_0x32a14b[_0x2c2d('0x34')]=_0x32a14b[_0x2c2d('0x34')][_0x2c2d('0x44')]?_0x32a14b['attributes']:_0x55f797[_0x2c2d('0x33')];_0x32a14b['order']=qs[_0x2c2d('0x38')](_0x5bfe30['query']['sort']);_0x32a14b[_0x2c2d('0x39')]=qs[_0x2c2d('0x31')](_['pick'](_0x5bfe30['query'],_0x55f797[_0x2c2d('0x31')]));if(_0x5bfe30[_0x2c2d('0x30')][_0x2c2d('0x3b')]){_0x32a14b[_0x2c2d('0x39')]=_[_0x2c2d('0x3c')](_0x32a14b['where'],{'$or':_[_0x2c2d('0x2a')](_0x32a14b[_0x2c2d('0x34')],function(_0xc21e52){var _0x48b093={};_0x48b093[_0xc21e52]={'$like':'%'+_0x5bfe30[_0x2c2d('0x30')][_0x2c2d('0x3b')]+'%'};return _0x48b093;})});}_0x32a14b=_[_0x2c2d('0x3c')]({},_0x32a14b,_0x5bfe30[_0x2c2d('0x4c')]);return _0x377307[_0x2c2d('0x4d')](_0x32a14b);}})[_0x2c2d('0x24')](function(_0x55115d){if(_0x55115d){_0x2afa95=_0x55115d['length'];if(!_0x5bfe30[_0x2c2d('0x30')][_0x2c2d('0x36')](_0x2c2d('0x37'))){_0x32a14b[_0x2c2d('0x1d')]=qs[_0x2c2d('0x1d')](_0x5bfe30[_0x2c2d('0x30')]['limit']);_0x32a14b['offset']=qs[_0x2c2d('0x1c')](_0x5bfe30[_0x2c2d('0x30')][_0x2c2d('0x1c')]);}return _0x377307['getSubjects'](_0x32a14b);}})['then'](function(_0x3210ed){if(_0x3210ed){return _0x3210ed?{'count':_0x2afa95,'rows':_0x3210ed}:null;}})[_0x2c2d('0x24')](respondWithResult(_0x54e13c,null))[_0x2c2d('0x46')](handleError(_0x54e13c,null));};exports[_0x2c2d('0x4e')]=function(_0x117759,_0x5a42a1,_0x4025e9){var _0x3f8f35={};var _0x29d1ad={};var _0x149880;var _0x479010;return db[_0x2c2d('0x2b')][_0x2c2d('0x49')]({'where':{'id':_0x117759[_0x2c2d('0x42')]['id']}})[_0x2c2d('0x24')](handleEntityNotFound(_0x5a42a1,null))[_0x2c2d('0x24')](function(_0x19d8eb){if(_0x19d8eb){_0x149880=_0x19d8eb;_0x29d1ad['model']=_[_0x2c2d('0x43')](db[_0x2c2d('0x4a')][_0x2c2d('0x2c')]);_0x29d1ad['query']=_['keys'](_0x117759[_0x2c2d('0x30')]);_0x29d1ad['filters']=_[_0x2c2d('0x32')](_0x29d1ad['model'],_0x29d1ad['query']);_0x3f8f35[_0x2c2d('0x34')]=_['intersection'](_0x29d1ad[_0x2c2d('0x33')],qs[_0x2c2d('0x35')](_0x117759[_0x2c2d('0x30')][_0x2c2d('0x35')]));_0x3f8f35['attributes']=_0x3f8f35[_0x2c2d('0x34')][_0x2c2d('0x44')]?_0x3f8f35[_0x2c2d('0x34')]:_0x29d1ad[_0x2c2d('0x33')];_0x3f8f35[_0x2c2d('0x4b')]=qs['sort'](_0x117759[_0x2c2d('0x30')][_0x2c2d('0x38')]);_0x3f8f35[_0x2c2d('0x39')]=qs['filters'](_['pick'](_0x117759[_0x2c2d('0x30')],_0x29d1ad['filters']));if(_0x117759['query'][_0x2c2d('0x3b')]){_0x3f8f35[_0x2c2d('0x39')]=_[_0x2c2d('0x3c')](_0x3f8f35[_0x2c2d('0x39')],{'$or':_[_0x2c2d('0x2a')](_0x3f8f35['attributes'],function(_0x442bc2){var _0x57b5f1={};_0x57b5f1[_0x442bc2]={'$like':'%'+_0x117759['query'][_0x2c2d('0x3b')]+'%'};return _0x57b5f1;})});}_0x3f8f35=_[_0x2c2d('0x3c')]({},_0x3f8f35,_0x117759[_0x2c2d('0x4c')]);return _0x149880[_0x2c2d('0x4e')](_0x3f8f35);}})[_0x2c2d('0x24')](function(_0x46da52){if(_0x46da52){_0x479010=_0x46da52['length'];if(!_0x117759[_0x2c2d('0x30')]['hasOwnProperty'](_0x2c2d('0x37'))){_0x3f8f35[_0x2c2d('0x1d')]=qs['limit'](_0x117759[_0x2c2d('0x30')][_0x2c2d('0x1d')]);_0x3f8f35[_0x2c2d('0x1c')]=qs[_0x2c2d('0x1c')](_0x117759[_0x2c2d('0x30')]['offset']);}return _0x149880[_0x2c2d('0x4e')](_0x3f8f35);}})[_0x2c2d('0x24')](function(_0x9c6a3){if(_0x9c6a3){return _0x9c6a3?{'count':_0x479010,'rows':_0x9c6a3}:null;}})[_0x2c2d('0x24')](respondWithResult(_0x5a42a1,null))[_0x2c2d('0x46')](handleError(_0x5a42a1,null));};exports[_0x2c2d('0x4f')]=function(_0x2c1a71,_0x275454,_0x12582e){var _0x376fe1={};var _0x43caac={};var _0x101e66;var _0x1ef856;return db[_0x2c2d('0x2b')][_0x2c2d('0x49')]({'where':{'id':_0x2c1a71[_0x2c2d('0x42')]['id']}})[_0x2c2d('0x24')](handleEntityNotFound(_0x275454,null))[_0x2c2d('0x24')](function(_0x4eb028){if(_0x4eb028){_0x101e66=_0x4eb028;_0x43caac[_0x2c2d('0x33')]=_[_0x2c2d('0x43')](db[_0x2c2d('0x50')][_0x2c2d('0x2c')]);_0x43caac[_0x2c2d('0x30')]=_[_0x2c2d('0x43')](_0x2c1a71[_0x2c2d('0x30')]);_0x43caac['filters']=_[_0x2c2d('0x32')](_0x43caac[_0x2c2d('0x33')],_0x43caac[_0x2c2d('0x30')]);_0x376fe1[_0x2c2d('0x34')]=_[_0x2c2d('0x32')](_0x43caac[_0x2c2d('0x33')],qs[_0x2c2d('0x35')](_0x2c1a71[_0x2c2d('0x30')][_0x2c2d('0x35')]));_0x376fe1[_0x2c2d('0x34')]=_0x376fe1[_0x2c2d('0x34')][_0x2c2d('0x44')]?_0x376fe1[_0x2c2d('0x34')]:_0x43caac[_0x2c2d('0x33')];_0x376fe1[_0x2c2d('0x4b')]=qs[_0x2c2d('0x38')](_0x2c1a71[_0x2c2d('0x30')][_0x2c2d('0x38')]);_0x376fe1[_0x2c2d('0x39')]=qs[_0x2c2d('0x31')](_[_0x2c2d('0x3a')](_0x2c1a71['query'],_0x43caac['filters']));if(_0x2c1a71[_0x2c2d('0x30')][_0x2c2d('0x3b')]){_0x376fe1[_0x2c2d('0x39')]=_[_0x2c2d('0x3c')](_0x376fe1[_0x2c2d('0x39')],{'$or':_[_0x2c2d('0x2a')](_0x376fe1[_0x2c2d('0x34')],function(_0x450775){var _0x40e56d={};_0x40e56d[_0x450775]={'$like':'%'+_0x2c1a71['query'][_0x2c2d('0x3b')]+'%'};return _0x40e56d;})});}_0x376fe1=_[_0x2c2d('0x3c')]({},_0x376fe1,_0x2c1a71[_0x2c2d('0x4c')]);return _0x101e66['getTags'](_0x376fe1);}})[_0x2c2d('0x24')](function(_0x45443e){if(_0x45443e){_0x1ef856=_0x45443e[_0x2c2d('0x44')];if(!_0x2c1a71[_0x2c2d('0x30')][_0x2c2d('0x36')](_0x2c2d('0x37'))){_0x376fe1[_0x2c2d('0x1d')]=qs['limit'](_0x2c1a71[_0x2c2d('0x30')][_0x2c2d('0x1d')]);_0x376fe1['offset']=qs[_0x2c2d('0x1c')](_0x2c1a71['query']['offset']);}return _0x101e66[_0x2c2d('0x4f')](_0x376fe1);}})[_0x2c2d('0x24')](function(_0x45132b){if(_0x45132b){return _0x45132b?{'count':_0x1ef856,'rows':_0x45132b}:null;}})[_0x2c2d('0x24')](respondWithResult(_0x275454,null))['catch'](handleError(_0x275454,null));};exports['setTags']=function(_0x26c5c5,_0x412ef6,_0x4c0449){if(_0x26c5c5[_0x2c2d('0x48')]['id']){delete _0x26c5c5[_0x2c2d('0x48')]['id'];}return db[_0x2c2d('0x2b')]['findOne']({'where':{'id':_0x26c5c5[_0x2c2d('0x42')]['id']}})['then'](handleEntityNotFound(_0x412ef6,null))[_0x2c2d('0x24')](function(_0x19c4b1){if(_0x19c4b1){return _0x19c4b1[_0x2c2d('0x51')](_0x26c5c5[_0x2c2d('0x48')]['ids']||[]);}return null;})[_0x2c2d('0x24')](respondWithResult(_0x412ef6,null))[_0x2c2d('0x46')](handleError(_0x412ef6,null));};
\ No newline at end of file
+var _0xce92=['util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','sendStatus','error','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','DeskConfiguration','includeAll','include','findAll','rows','catch','options','find','create','body','update','params','getFields','findOne','getSubjects','order','pick','DeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x810e4d,_0x909ef4){var _0x13f01c=function(_0x12fd89){while(--_0x12fd89){_0x810e4d['push'](_0x810e4d['shift']());}};_0x13f01c(++_0x909ef4);}(_0xce92,0xa8));var _0x2ce9=function(_0xfa260b,_0xd2d0d){_0xfa260b=_0xfa260b-0x0;var _0x48fb84=_0xce92[_0xfa260b];return _0x48fb84;};'use strict';var emlformat=require(_0x2ce9('0x0'));var rimraf=require(_0x2ce9('0x1'));var zipdir=require(_0x2ce9('0x2'));var jsonpatch=require(_0x2ce9('0x3'));var rp=require(_0x2ce9('0x4'));var moment=require(_0x2ce9('0x5'));var BPromise=require(_0x2ce9('0x6'));var Mustache=require(_0x2ce9('0x7'));var util=require(_0x2ce9('0x8'));var path=require(_0x2ce9('0x9'));var sox=require(_0x2ce9('0xa'));var csv=require('to-csv');var ejs=require(_0x2ce9('0xb'));var fs=require('fs');var fs_extra=require(_0x2ce9('0xc'));var _=require(_0x2ce9('0xd'));var squel=require(_0x2ce9('0xe'));var crypto=require(_0x2ce9('0xf'));var jsforce=require(_0x2ce9('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x2ce9('0x11'));var querystring=require(_0x2ce9('0x12'));var Papa=require(_0x2ce9('0x13'));var Redis=require('ioredis');var authService=require(_0x2ce9('0x14'));var qs=require(_0x2ce9('0x15'));var as=require(_0x2ce9('0x16'));var hardwareService=require(_0x2ce9('0x17'));var logger=require(_0x2ce9('0x18'))('api');var utils=require(_0x2ce9('0x19'));var config=require(_0x2ce9('0x1a'));var licenseUtil=require(_0x2ce9('0x1b'));var db=require(_0x2ce9('0x1c'))['db'];function respondWithStatusCode(_0x40cd15,_0xe01986){_0xe01986=_0xe01986||0xcc;return function(_0x4a6275){if(_0x4a6275){return _0x40cd15['sendStatus'](_0xe01986);}return _0x40cd15['status'](_0xe01986)[_0x2ce9('0x1d')]();};}function respondWithResult(_0x390a5b,_0x17febc){_0x17febc=_0x17febc||0xc8;return function(_0x3b5530){if(_0x3b5530){return _0x390a5b[_0x2ce9('0x1e')](_0x17febc)[_0x2ce9('0x1f')](_0x3b5530);}};}function respondWithFilteredResult(_0x1c43e9,_0x5bc3fc){return function(_0x43cab1){if(_0x43cab1){var _0x33437a=typeof _0x5bc3fc[_0x2ce9('0x20')]===_0x2ce9('0x21')&&typeof _0x5bc3fc[_0x2ce9('0x22')]===_0x2ce9('0x21');var _0x1eaf73=_0x43cab1[_0x2ce9('0x23')];var _0x1aaed0=_0x33437a?0x0:_0x5bc3fc[_0x2ce9('0x20')];var _0x1aeead=_0x33437a?_0x43cab1[_0x2ce9('0x23')]:_0x5bc3fc[_0x2ce9('0x20')]+_0x5bc3fc['limit'];var _0x249837;if(_0x1aeead>=_0x1eaf73){_0x1aeead=_0x1eaf73;_0x249837=0xc8;}else{_0x249837=0xce;}_0x1c43e9[_0x2ce9('0x1e')](_0x249837);return _0x1c43e9['set'](_0x2ce9('0x24'),_0x1aaed0+'-'+_0x1aeead+'/'+_0x1eaf73)[_0x2ce9('0x1f')](_0x43cab1);}return null;};}function patchUpdates(_0x50b626){return function(_0x279c79){try{jsonpatch[_0x2ce9('0x25')](_0x279c79,_0x50b626,!![]);}catch(_0x269065){return BPromise['reject'](_0x269065);}return _0x279c79[_0x2ce9('0x26')]();};}function saveUpdates(_0x6f4556,_0x516c72){return function(_0x1c96b7){if(_0x1c96b7){return _0x1c96b7['update'](_0x6f4556)['then'](function(_0xf92aae){return _0xf92aae;});}return null;};}function removeEntity(_0x3442b3,_0x1694bb){return function(_0x1dd071){if(_0x1dd071){return _0x1dd071[_0x2ce9('0x27')]()[_0x2ce9('0x28')](function(){_0x3442b3[_0x2ce9('0x1e')](0xcc)[_0x2ce9('0x1d')]();});}};}function handleEntityNotFound(_0x5b4d19,_0x35985e){return function(_0x75c4e4){if(!_0x75c4e4){_0x5b4d19[_0x2ce9('0x29')](0x194);}return _0x75c4e4;};}function handleError(_0x1f31f1,_0x5127a0){_0x5127a0=_0x5127a0||0x1f4;return function(_0x19575b){logger[_0x2ce9('0x2a')](_0x19575b['stack']);if(_0x19575b['name']){delete _0x19575b['name'];}_0x1f31f1[_0x2ce9('0x1e')](_0x5127a0)['send'](_0x19575b);};}exports[_0x2ce9('0x2b')]=function(_0x2a78bf,_0x4b6266){var _0x5087e7={},_0x516677={},_0x7600d1={'count':0x0,'rows':[]};var _0x37319f=_[_0x2ce9('0x2c')](db['DeskConfiguration'][_0x2ce9('0x2d')],function(_0xcd0ce8){return{'name':_0xcd0ce8[_0x2ce9('0x2e')],'type':_0xcd0ce8[_0x2ce9('0x2f')][_0x2ce9('0x30')]};});_0x516677[_0x2ce9('0x31')]=_[_0x2ce9('0x2c')](_0x37319f,_0x2ce9('0x32'));_0x516677[_0x2ce9('0x33')]=_[_0x2ce9('0x34')](_0x2a78bf[_0x2ce9('0x33')]);_0x516677[_0x2ce9('0x35')]=_[_0x2ce9('0x36')](_0x516677['model'],_0x516677[_0x2ce9('0x33')]);_0x5087e7['attributes']=_[_0x2ce9('0x36')](_0x516677[_0x2ce9('0x31')],qs[_0x2ce9('0x37')](_0x2a78bf[_0x2ce9('0x33')]['fields']));_0x5087e7[_0x2ce9('0x38')]=_0x5087e7[_0x2ce9('0x38')][_0x2ce9('0x39')]?_0x5087e7[_0x2ce9('0x38')]:_0x516677[_0x2ce9('0x31')];if(!_0x2a78bf['query'][_0x2ce9('0x3a')](_0x2ce9('0x3b'))){_0x5087e7['limit']=qs[_0x2ce9('0x22')](_0x2a78bf[_0x2ce9('0x33')][_0x2ce9('0x22')]);_0x5087e7[_0x2ce9('0x20')]=qs[_0x2ce9('0x20')](_0x2a78bf[_0x2ce9('0x33')][_0x2ce9('0x20')]);}_0x5087e7['order']=qs[_0x2ce9('0x3c')](_0x2a78bf[_0x2ce9('0x33')][_0x2ce9('0x3c')]);_0x5087e7[_0x2ce9('0x3d')]=qs[_0x2ce9('0x35')](_['pick'](_0x2a78bf[_0x2ce9('0x33')],_0x516677['filters']),_0x37319f);if(_0x2a78bf[_0x2ce9('0x33')][_0x2ce9('0x3e')]){_0x5087e7[_0x2ce9('0x3d')]=_[_0x2ce9('0x3f')](_0x5087e7[_0x2ce9('0x3d')],{'$or':_[_0x2ce9('0x2c')](_0x37319f,function(_0x56a9e4){if(_0x56a9e4['type']!==_0x2ce9('0x40')){var _0x3aa7eb={};_0x3aa7eb[_0x56a9e4[_0x2ce9('0x32')]]={'$like':'%'+_0x2a78bf['query'][_0x2ce9('0x3e')]+'%'};return _0x3aa7eb;}})});}_0x5087e7=_[_0x2ce9('0x3f')]({},_0x5087e7,_0x2a78bf['options']);var _0x33c343={'where':_0x5087e7['where']};return db[_0x2ce9('0x41')]['count'](_0x33c343)[_0x2ce9('0x28')](function(_0x550e99){_0x7600d1[_0x2ce9('0x23')]=_0x550e99;if(_0x2a78bf['query'][_0x2ce9('0x42')]){_0x5087e7[_0x2ce9('0x43')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x2ce9('0x44')](_0x5087e7);})[_0x2ce9('0x28')](function(_0x141799){_0x7600d1[_0x2ce9('0x45')]=_0x141799;return _0x7600d1;})[_0x2ce9('0x28')](respondWithFilteredResult(_0x4b6266,_0x5087e7))[_0x2ce9('0x46')](handleError(_0x4b6266,null));};exports['show']=function(_0x4ce885,_0x481cc5){var _0x446873={'raw':![],'where':{'id':_0x4ce885['params']['id']}},_0xa2170={};_0xa2170['model']=_[_0x2ce9('0x34')](db[_0x2ce9('0x41')][_0x2ce9('0x2d')]);_0xa2170[_0x2ce9('0x33')]=_[_0x2ce9('0x34')](_0x4ce885[_0x2ce9('0x33')]);_0xa2170[_0x2ce9('0x35')]=_[_0x2ce9('0x36')](_0xa2170['model'],_0xa2170['query']);_0x446873[_0x2ce9('0x38')]=_['intersection'](_0xa2170['model'],qs[_0x2ce9('0x37')](_0x4ce885[_0x2ce9('0x33')][_0x2ce9('0x37')]));_0x446873[_0x2ce9('0x38')]=_0x446873[_0x2ce9('0x38')][_0x2ce9('0x39')]?_0x446873[_0x2ce9('0x38')]:_0xa2170[_0x2ce9('0x31')];if(_0x4ce885[_0x2ce9('0x33')][_0x2ce9('0x42')]){_0x446873[_0x2ce9('0x43')]=[{'all':!![]}];}_0x446873=_[_0x2ce9('0x3f')]({},_0x446873,_0x4ce885[_0x2ce9('0x47')]);return db['DeskConfiguration'][_0x2ce9('0x48')](_0x446873)[_0x2ce9('0x28')](handleEntityNotFound(_0x481cc5,null))['then'](respondWithResult(_0x481cc5,null))[_0x2ce9('0x46')](handleError(_0x481cc5,null));};exports['create']=function(_0x59c681,_0x3174af){return db[_0x2ce9('0x41')][_0x2ce9('0x49')](_0x59c681[_0x2ce9('0x4a')],{})[_0x2ce9('0x28')](respondWithResult(_0x3174af,0xc9))[_0x2ce9('0x46')](handleError(_0x3174af,null));};exports[_0x2ce9('0x4b')]=function(_0x2cd531,_0x2f7287){if(_0x2cd531['body']['id']){delete _0x2cd531['body']['id'];}return db[_0x2ce9('0x41')][_0x2ce9('0x48')]({'where':{'id':_0x2cd531[_0x2ce9('0x4c')]['id']}})[_0x2ce9('0x28')](handleEntityNotFound(_0x2f7287,null))[_0x2ce9('0x28')](saveUpdates(_0x2cd531[_0x2ce9('0x4a')],null))['then'](respondWithResult(_0x2f7287,null))[_0x2ce9('0x46')](handleError(_0x2f7287,null));};exports[_0x2ce9('0x27')]=function(_0x569782,_0x515b1f){return db[_0x2ce9('0x41')][_0x2ce9('0x48')]({'where':{'id':_0x569782[_0x2ce9('0x4c')]['id']}})[_0x2ce9('0x28')](handleEntityNotFound(_0x515b1f,null))[_0x2ce9('0x28')](removeEntity(_0x515b1f,null))[_0x2ce9('0x46')](handleError(_0x515b1f,null));};exports[_0x2ce9('0x4d')]=function(_0x3cb742,_0x45eabe,_0x42faf8){var _0x4847fa={};var _0x59f0ca={};var _0x55c92c;var _0x11eb50;return db[_0x2ce9('0x41')][_0x2ce9('0x4e')]({'where':{'id':_0x3cb742['params']['id']}})[_0x2ce9('0x28')](handleEntityNotFound(_0x45eabe,null))['then'](function(_0x1325b0){if(_0x1325b0){_0x55c92c=_0x1325b0;_0x59f0ca[_0x2ce9('0x31')]=_[_0x2ce9('0x34')](db['DeskField'][_0x2ce9('0x2d')]);_0x59f0ca[_0x2ce9('0x33')]=_['keys'](_0x3cb742[_0x2ce9('0x33')]);_0x59f0ca[_0x2ce9('0x35')]=_[_0x2ce9('0x36')](_0x59f0ca['model'],_0x59f0ca['query']);_0x4847fa[_0x2ce9('0x38')]=_['intersection'](_0x59f0ca[_0x2ce9('0x31')],qs[_0x2ce9('0x37')](_0x3cb742[_0x2ce9('0x33')]['fields']));_0x4847fa[_0x2ce9('0x38')]=_0x4847fa[_0x2ce9('0x38')][_0x2ce9('0x39')]?_0x4847fa[_0x2ce9('0x38')]:_0x59f0ca[_0x2ce9('0x31')];_0x4847fa['order']=qs[_0x2ce9('0x3c')](_0x3cb742['query']['sort']);_0x4847fa[_0x2ce9('0x3d')]=qs[_0x2ce9('0x35')](_['pick'](_0x3cb742['query'],_0x59f0ca[_0x2ce9('0x35')]));if(_0x3cb742[_0x2ce9('0x33')][_0x2ce9('0x3e')]){_0x4847fa[_0x2ce9('0x3d')]=_[_0x2ce9('0x3f')](_0x4847fa[_0x2ce9('0x3d')],{'$or':_[_0x2ce9('0x2c')](_0x4847fa[_0x2ce9('0x38')],function(_0x37c9c7){var _0x1e85a6={};_0x1e85a6[_0x37c9c7]={'$like':'%'+_0x3cb742['query']['filter']+'%'};return _0x1e85a6;})});}_0x4847fa=_[_0x2ce9('0x3f')]({},_0x4847fa,_0x3cb742[_0x2ce9('0x47')]);return _0x55c92c['getFields'](_0x4847fa);}})['then'](function(_0x3b374b){if(_0x3b374b){_0x11eb50=_0x3b374b['length'];if(!_0x3cb742[_0x2ce9('0x33')]['hasOwnProperty'](_0x2ce9('0x3b'))){_0x4847fa[_0x2ce9('0x22')]=qs['limit'](_0x3cb742['query'][_0x2ce9('0x22')]);_0x4847fa[_0x2ce9('0x20')]=qs['offset'](_0x3cb742[_0x2ce9('0x33')][_0x2ce9('0x20')]);}return _0x55c92c['getFields'](_0x4847fa);}})['then'](function(_0x659437){if(_0x659437){return _0x659437?{'count':_0x11eb50,'rows':_0x659437}:null;}})['then'](respondWithResult(_0x45eabe,null))[_0x2ce9('0x46')](handleError(_0x45eabe,null));};exports[_0x2ce9('0x4f')]=function(_0xbb9c2f,_0x276151,_0x43309e){var _0x2f8974={};var _0x33012e={};var _0x167e21;var _0x19f666;return db[_0x2ce9('0x41')]['findOne']({'where':{'id':_0xbb9c2f['params']['id']}})[_0x2ce9('0x28')](handleEntityNotFound(_0x276151,null))[_0x2ce9('0x28')](function(_0x56bf1e){if(_0x56bf1e){_0x167e21=_0x56bf1e;_0x33012e['model']=_[_0x2ce9('0x34')](db['DeskField'][_0x2ce9('0x2d')]);_0x33012e['query']=_['keys'](_0xbb9c2f[_0x2ce9('0x33')]);_0x33012e[_0x2ce9('0x35')]=_[_0x2ce9('0x36')](_0x33012e['model'],_0x33012e['query']);_0x2f8974[_0x2ce9('0x38')]=_[_0x2ce9('0x36')](_0x33012e['model'],qs[_0x2ce9('0x37')](_0xbb9c2f[_0x2ce9('0x33')][_0x2ce9('0x37')]));_0x2f8974['attributes']=_0x2f8974[_0x2ce9('0x38')][_0x2ce9('0x39')]?_0x2f8974[_0x2ce9('0x38')]:_0x33012e[_0x2ce9('0x31')];_0x2f8974[_0x2ce9('0x50')]=qs['sort'](_0xbb9c2f['query'][_0x2ce9('0x3c')]);_0x2f8974['where']=qs[_0x2ce9('0x35')](_[_0x2ce9('0x51')](_0xbb9c2f[_0x2ce9('0x33')],_0x33012e[_0x2ce9('0x35')]));if(_0xbb9c2f[_0x2ce9('0x33')]['filter']){_0x2f8974['where']=_['merge'](_0x2f8974[_0x2ce9('0x3d')],{'$or':_[_0x2ce9('0x2c')](_0x2f8974[_0x2ce9('0x38')],function(_0x29d11c){var _0x198dee={};_0x198dee[_0x29d11c]={'$like':'%'+_0xbb9c2f[_0x2ce9('0x33')]['filter']+'%'};return _0x198dee;})});}_0x2f8974=_[_0x2ce9('0x3f')]({},_0x2f8974,_0xbb9c2f['options']);return _0x167e21[_0x2ce9('0x4f')](_0x2f8974);}})['then'](function(_0x5c55e4){if(_0x5c55e4){_0x19f666=_0x5c55e4['length'];if(!_0xbb9c2f[_0x2ce9('0x33')]['hasOwnProperty']('nolimit')){_0x2f8974[_0x2ce9('0x22')]=qs[_0x2ce9('0x22')](_0xbb9c2f[_0x2ce9('0x33')][_0x2ce9('0x22')]);_0x2f8974[_0x2ce9('0x20')]=qs[_0x2ce9('0x20')](_0xbb9c2f[_0x2ce9('0x33')]['offset']);}return _0x167e21['getSubjects'](_0x2f8974);}})['then'](function(_0x175f91){if(_0x175f91){return _0x175f91?{'count':_0x19f666,'rows':_0x175f91}:null;}})[_0x2ce9('0x28')](respondWithResult(_0x276151,null))[_0x2ce9('0x46')](handleError(_0x276151,null));};exports['getDescriptions']=function(_0x4443b9,_0x34f67b,_0x2ec112){var _0x5ba95e={};var _0x958884={};var _0x18f748;var _0x39d558;return db[_0x2ce9('0x41')][_0x2ce9('0x4e')]({'where':{'id':_0x4443b9[_0x2ce9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34f67b,null))[_0x2ce9('0x28')](function(_0x2f88dc){if(_0x2f88dc){_0x18f748=_0x2f88dc;_0x958884[_0x2ce9('0x31')]=_[_0x2ce9('0x34')](db[_0x2ce9('0x52')]['rawAttributes']);_0x958884[_0x2ce9('0x33')]=_[_0x2ce9('0x34')](_0x4443b9[_0x2ce9('0x33')]);_0x958884[_0x2ce9('0x35')]=_[_0x2ce9('0x36')](_0x958884[_0x2ce9('0x31')],_0x958884[_0x2ce9('0x33')]);_0x5ba95e['attributes']=_[_0x2ce9('0x36')](_0x958884[_0x2ce9('0x31')],qs['fields'](_0x4443b9[_0x2ce9('0x33')][_0x2ce9('0x37')]));_0x5ba95e[_0x2ce9('0x38')]=_0x5ba95e[_0x2ce9('0x38')][_0x2ce9('0x39')]?_0x5ba95e['attributes']:_0x958884[_0x2ce9('0x31')];_0x5ba95e['order']=qs[_0x2ce9('0x3c')](_0x4443b9['query'][_0x2ce9('0x3c')]);_0x5ba95e[_0x2ce9('0x3d')]=qs['filters'](_[_0x2ce9('0x51')](_0x4443b9[_0x2ce9('0x33')],_0x958884[_0x2ce9('0x35')]));if(_0x4443b9[_0x2ce9('0x33')]['filter']){_0x5ba95e[_0x2ce9('0x3d')]=_[_0x2ce9('0x3f')](_0x5ba95e[_0x2ce9('0x3d')],{'$or':_[_0x2ce9('0x2c')](_0x5ba95e[_0x2ce9('0x38')],function(_0x5de2d8){var _0x21e182={};_0x21e182[_0x5de2d8]={'$like':'%'+_0x4443b9[_0x2ce9('0x33')]['filter']+'%'};return _0x21e182;})});}_0x5ba95e=_[_0x2ce9('0x3f')]({},_0x5ba95e,_0x4443b9[_0x2ce9('0x47')]);return _0x18f748[_0x2ce9('0x53')](_0x5ba95e);}})['then'](function(_0x19462e){if(_0x19462e){_0x39d558=_0x19462e['length'];if(!_0x4443b9['query']['hasOwnProperty'](_0x2ce9('0x3b'))){_0x5ba95e[_0x2ce9('0x22')]=qs[_0x2ce9('0x22')](_0x4443b9[_0x2ce9('0x33')][_0x2ce9('0x22')]);_0x5ba95e[_0x2ce9('0x20')]=qs['offset'](_0x4443b9[_0x2ce9('0x33')][_0x2ce9('0x20')]);}return _0x18f748[_0x2ce9('0x53')](_0x5ba95e);}})[_0x2ce9('0x28')](function(_0x35e1aa){if(_0x35e1aa){return _0x35e1aa?{'count':_0x39d558,'rows':_0x35e1aa}:null;}})[_0x2ce9('0x28')](respondWithResult(_0x34f67b,null))[_0x2ce9('0x46')](handleError(_0x34f67b,null));};exports[_0x2ce9('0x54')]=function(_0x157e0f,_0x5b4800,_0x2bf7cb){var _0x16073c={};var _0x469fef={};var _0x347eef;var _0x117fc1;return db[_0x2ce9('0x41')][_0x2ce9('0x4e')]({'where':{'id':_0x157e0f[_0x2ce9('0x4c')]['id']}})[_0x2ce9('0x28')](handleEntityNotFound(_0x5b4800,null))['then'](function(_0x1519e0){if(_0x1519e0){_0x347eef=_0x1519e0;_0x469fef[_0x2ce9('0x31')]=_[_0x2ce9('0x34')](db[_0x2ce9('0x55')][_0x2ce9('0x2d')]);_0x469fef[_0x2ce9('0x33')]=_[_0x2ce9('0x34')](_0x157e0f[_0x2ce9('0x33')]);_0x469fef['filters']=_[_0x2ce9('0x36')](_0x469fef['model'],_0x469fef[_0x2ce9('0x33')]);_0x16073c['attributes']=_[_0x2ce9('0x36')](_0x469fef[_0x2ce9('0x31')],qs['fields'](_0x157e0f[_0x2ce9('0x33')][_0x2ce9('0x37')]));_0x16073c[_0x2ce9('0x38')]=_0x16073c['attributes']['length']?_0x16073c['attributes']:_0x469fef[_0x2ce9('0x31')];_0x16073c['order']=qs[_0x2ce9('0x3c')](_0x157e0f[_0x2ce9('0x33')][_0x2ce9('0x3c')]);_0x16073c[_0x2ce9('0x3d')]=qs[_0x2ce9('0x35')](_[_0x2ce9('0x51')](_0x157e0f['query'],_0x469fef[_0x2ce9('0x35')]));if(_0x157e0f['query'][_0x2ce9('0x3e')]){_0x16073c[_0x2ce9('0x3d')]=_[_0x2ce9('0x3f')](_0x16073c[_0x2ce9('0x3d')],{'$or':_[_0x2ce9('0x2c')](_0x16073c[_0x2ce9('0x38')],function(_0x44a972){var _0xb39ce2={};_0xb39ce2[_0x44a972]={'$like':'%'+_0x157e0f[_0x2ce9('0x33')][_0x2ce9('0x3e')]+'%'};return _0xb39ce2;})});}_0x16073c=_[_0x2ce9('0x3f')]({},_0x16073c,_0x157e0f['options']);return _0x347eef[_0x2ce9('0x54')](_0x16073c);}})['then'](function(_0x140845){if(_0x140845){_0x117fc1=_0x140845[_0x2ce9('0x39')];if(!_0x157e0f[_0x2ce9('0x33')]['hasOwnProperty'](_0x2ce9('0x3b'))){_0x16073c[_0x2ce9('0x22')]=qs[_0x2ce9('0x22')](_0x157e0f[_0x2ce9('0x33')][_0x2ce9('0x22')]);_0x16073c[_0x2ce9('0x20')]=qs[_0x2ce9('0x20')](_0x157e0f[_0x2ce9('0x33')][_0x2ce9('0x20')]);}return _0x347eef[_0x2ce9('0x54')](_0x16073c);}})[_0x2ce9('0x28')](function(_0xc39691){if(_0xc39691){return _0xc39691?{'count':_0x117fc1,'rows':_0xc39691}:null;}})[_0x2ce9('0x28')](respondWithResult(_0x5b4800,null))[_0x2ce9('0x46')](handleError(_0x5b4800,null));};exports[_0x2ce9('0x56')]=function(_0x3a7253,_0x5019ae,_0x246f5e){if(_0x3a7253[_0x2ce9('0x4a')]['id']){delete _0x3a7253['body']['id'];}return db[_0x2ce9('0x41')][_0x2ce9('0x4e')]({'where':{'id':_0x3a7253[_0x2ce9('0x4c')]['id']}})[_0x2ce9('0x28')](handleEntityNotFound(_0x5019ae,null))['then'](function(_0x3c96dd){if(_0x3c96dd){return _0x3c96dd[_0x2ce9('0x56')](_0x3a7253[_0x2ce9('0x4a')][_0x2ce9('0x57')]||[]);}return null;})[_0x2ce9('0x28')](respondWithResult(_0x5019ae,null))['catch'](handleError(_0x5019ae,null));};
\ No newline at end of file
index 19d091b..27f03b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x131e=['int_desk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','DeskConfiguration'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x131e,0x1d5));var _0xe131=function(_0x2b997c,_0x13bb47){_0x2b997c=_0x2b997c-0x0;var _0x1777aa=_0x131e[_0x2b997c];return _0x1777aa;};'use strict';var _=require(_0xe131('0x0'));var util=require(_0xe131('0x1'));var logger=require(_0xe131('0x2'))(_0xe131('0x3'));var moment=require('moment');var BPromise=require(_0xe131('0x4'));var rp=require(_0xe131('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe131('0x6'));var config=require(_0xe131('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0xe131('0x8')]=function(_0x16402c,_0x3d7810){return _0x16402c[_0xe131('0x9')](_0xe131('0xa'),attributes,{'tableName':_0xe131('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6c56=['DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x501afa,_0x581a33){var _0x42ef07=function(_0x23e6a5){while(--_0x23e6a5){_0x501afa['push'](_0x501afa['shift']());}};_0x42ef07(++_0x581a33);}(_0x6c56,0x1af));var _0x66c5=function(_0x4b7b9b,_0xa4aff9){_0x4b7b9b=_0x4b7b9b-0x0;var _0x3be710=_0x6c56[_0x4b7b9b];return _0x3be710;};'use strict';var _=require(_0x66c5('0x0'));var util=require(_0x66c5('0x1'));var logger=require(_0x66c5('0x2'))(_0x66c5('0x3'));var moment=require(_0x66c5('0x4'));var BPromise=require(_0x66c5('0x5'));var rp=require(_0x66c5('0x6'));var fs=require('fs');var path=require(_0x66c5('0x7'));var rimraf=require('rimraf');var config=require(_0x66c5('0x8'));var attributes=require(_0x66c5('0x9'));module[_0x66c5('0xa')]=function(_0x4e56b7,_0x405e1b){return _0x4e56b7['define'](_0x66c5('0xb'),attributes,{'tableName':_0x66c5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eea4f7d..11eb09d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3445=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s'];(function(_0x47aa9b,_0x261f02){var _0x37d8da=function(_0x1a17a7){while(--_0x1a17a7){_0x47aa9b['push'](_0x47aa9b['shift']());}};_0x37d8da(++_0x261f02);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5344('0x0'));var util=require(_0x5344('0x1'));var moment=require(_0x5344('0x2'));var BPromise=require(_0x5344('0x3'));var rs=require(_0x5344('0x4'));var fs=require('fs');var Redis=require(_0x5344('0x5'));var db=require(_0x5344('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5344('0x7'));var config=require(_0x5344('0x8'));var jayson=require(_0x5344('0x9'));var client=jayson[_0x5344('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ffe5f,_0x5642cb,_0x5a4f52){return new BPromise(function(_0x3f638c,_0x4adb8a){return client['request'](_0x4ffe5f,_0x5a4f52)[_0x5344('0xb')](function(_0xbc5346){logger[_0x5344('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x5642cb,_0x5344('0xd'));logger[_0x5344('0xe')](_0x5344('0xf'),_0x5642cb,_0x5344('0xd'),JSON[_0x5344('0x10')](_0xbc5346));if(_0xbc5346[_0x5344('0x11')]){if(_0xbc5346['error'][_0x5344('0x12')]===0x1f4){logger[_0x5344('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')]['message']);return _0x4adb8a(_0xbc5346[_0x5344('0x11')]['message']);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);return _0x3f638c(_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);}else{logger[_0x5344('0xc')](_0x5344('0x14'),_0x5642cb,_0x5344('0xd'));_0x3f638c(_0xbc5346[_0x5344('0x15')][_0x5344('0x13')]);}})[_0x5344('0x16')](function(_0x4ae241){logger[_0x5344('0x11')](_0x5344('0x14'),_0x5642cb,_0x4ae241);_0x4adb8a(_0x4ae241);});});}
\ No newline at end of file
+var _0x0598=['../../config/utils','jayson/promise','client','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','bluebird','../../mysqldb'];(function(_0x121629,_0x3c113c){var _0x51603a=function(_0x1adc59){while(--_0x1adc59){_0x121629['push'](_0x121629['shift']());}};_0x51603a(++_0x3c113c);}(_0x0598,0x92));var _0x8059=function(_0x43cee1,_0x5f74e3){_0x43cee1=_0x43cee1-0x0;var _0xbdd2a7=_0x0598[_0x43cee1];return _0xbdd2a7;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}
\ No newline at end of file
index 7c3f717..691e684 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f91=['../../config/environment','get','index','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','util','path','fs-extra','../../components/auth/service'];(function(_0x17f397,_0x5bf1eb){var _0x65aa26=function(_0x2dfc7c){while(--_0x2dfc7c){_0x17f397['push'](_0x17f397['shift']());}};_0x65aa26(++_0x5bf1eb);}(_0x9f91,0x14c));var _0x19f9=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x9f91[_0x496738];return _0xee1381;};'use strict';var multer=require('multer');var util=require(_0x19f9('0x0'));var path=require(_0x19f9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x19f9('0x2'));var auth=require(_0x19f9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x19f9('0x4'));var controller=require('./intDeskField.controller');router[_0x19f9('0x5')]('/',auth['isAuthenticated'](),controller[_0x19f9('0x6')]);router[_0x19f9('0x5')]('/:id',auth[_0x19f9('0x7')](),controller[_0x19f9('0x8')]);router[_0x19f9('0x9')]('/',auth[_0x19f9('0x7')](),controller[_0x19f9('0xa')]);router[_0x19f9('0xb')](_0x19f9('0xc'),auth[_0x19f9('0x7')](),controller['update']);router[_0x19f9('0xd')]('/:id',auth[_0x19f9('0x7')](),controller[_0x19f9('0xe')]);module[_0x19f9('0xf')]=router;
\ No newline at end of file
+var _0x5790=['fs-extra','../../components/auth/service','./intDeskField.controller','get','isAuthenticated','index','/:id','post','create','put','exports','util','path','express'];(function(_0x5ee44b,_0x11f219){var _0x4b0177=function(_0x1b74fe){while(--_0x1b74fe){_0x5ee44b['push'](_0x5ee44b['shift']());}};_0x4b0177(++_0x11f219);}(_0x5790,0xa5));var _0x0579=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5790[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require(_0x0579('0x0'));var path=require(_0x0579('0x1'));var timeout=require('connect-timeout');var express=require(_0x0579('0x2'));var router=express['Router']();var fs_extra=require(_0x0579('0x3'));var auth=require(_0x0579('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0579('0x5'));router[_0x0579('0x6')]('/',auth[_0x0579('0x7')](),controller[_0x0579('0x8')]);router[_0x0579('0x6')](_0x0579('0x9'),auth[_0x0579('0x7')](),controller['show']);router[_0x0579('0xa')]('/',auth[_0x0579('0x7')](),controller[_0x0579('0xb')]);router[_0x0579('0xc')](_0x0579('0x9'),auth[_0x0579('0x7')](),controller['update']);router['delete']('/:id',auth[_0x0579('0x7')](),controller['destroy']);module[_0x0579('0xd')]=router;
\ No newline at end of file
index 385797c..b5688d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe189=['keyValue','picklist','STRING','ENUM','sequelize','exports','string','variable','customVariable'];(function(_0x4b89d9,_0x3a4a59){var _0x5648ac=function(_0x247968){while(--_0x247968){_0x4b89d9['push'](_0x4b89d9['shift']());}};_0x5648ac(++_0x3a4a59);}(_0xe189,0xc1));var _0x9e18=function(_0x6f3bf1,_0x11923e){_0x6f3bf1=_0x6f3bf1-0x0;var _0x12a54e=_0xe189[_0x6f3bf1];return _0x12a54e;};'use strict';var Sequelize=require(_0x9e18('0x0'));module[_0x9e18('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9e18('0x2'),_0x9e18('0x3'),_0x9e18('0x4'),_0x9e18('0x5'),_0x9e18('0x6')),'defaultValue':_0x9e18('0x2')},'content':{'type':Sequelize[_0x9e18('0x7')]},'key':{'type':Sequelize[_0x9e18('0x7')]},'keyType':{'type':Sequelize[_0x9e18('0x8')](_0x9e18('0x2'),_0x9e18('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x9e18('0x7')]},'idField':{'type':Sequelize[_0x9e18('0x7')]},'nameField':{'type':Sequelize[_0x9e18('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9e18('0x7')]}};
\ No newline at end of file
+var _0xdfba=['BOOLEAN','sequelize','ENUM','variable','keyValue','picklist','string','STRING','customVariable'];(function(_0x36f777,_0x23ddd7){var _0x43daf0=function(_0x13e89d){while(--_0x13e89d){_0x36f777['push'](_0x36f777['shift']());}};_0x43daf0(++_0x23ddd7);}(_0xdfba,0x7f));var _0xadfb=function(_0x36f35c,_0x28a553){_0x36f35c=_0x36f35c-0x0;var _0x5df531=_0xdfba[_0x36f35c];return _0x5df531;};'use strict';var Sequelize=require(_0xadfb('0x0'));module['exports']={'type':{'type':Sequelize[_0xadfb('0x1')]('string',_0xadfb('0x2'),'customVariable',_0xadfb('0x3'),_0xadfb('0x4')),'defaultValue':_0xadfb('0x5')},'content':{'type':Sequelize[_0xadfb('0x6')]},'key':{'type':Sequelize[_0xadfb('0x6')]},'keyType':{'type':Sequelize[_0xadfb('0x1')](_0xadfb('0x5'),_0xadfb('0x2'),_0xadfb('0x7'))},'keyContent':{'type':Sequelize[_0xadfb('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xadfb('0x6')]},'customField':{'type':Sequelize[_0xadfb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 4009484..4c167f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6114=['send','index','map','DeskField','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name'];(function(_0x263c92,_0xd5a777){var _0x1ab2d7=function(_0x554129){while(--_0x554129){_0x263c92['push'](_0x263c92['shift']());}};_0x1ab2d7(++_0xd5a777);}(_0x6114,0x6d));var _0x4611=function(_0x4c0ebb,_0x1e7eae){_0x4c0ebb=_0x4c0ebb-0x0;var _0xfc4dc1=_0x6114[_0x4c0ebb];return _0xfc4dc1;};'use strict';var emlformat=require(_0x4611('0x0'));var rimraf=require(_0x4611('0x1'));var zipdir=require(_0x4611('0x2'));var jsonpatch=require(_0x4611('0x3'));var rp=require(_0x4611('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4611('0x5'));var util=require('util');var path=require(_0x4611('0x6'));var sox=require(_0x4611('0x7'));var csv=require(_0x4611('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4611('0x9'));var _=require(_0x4611('0xa'));var squel=require(_0x4611('0xb'));var crypto=require(_0x4611('0xc'));var jsforce=require(_0x4611('0xd'));var deskjs=require(_0x4611('0xe'));var toCsv=require(_0x4611('0x8'));var querystring=require(_0x4611('0xf'));var Papa=require(_0x4611('0x10'));var Redis=require(_0x4611('0x11'));var authService=require(_0x4611('0x12'));var qs=require(_0x4611('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4611('0x14'));var utils=require(_0x4611('0x15'));var config=require(_0x4611('0x16'));var licenseUtil=require(_0x4611('0x17'));var db=require(_0x4611('0x18'))['db'];function respondWithStatusCode(_0x551cf5,_0x335d46){_0x335d46=_0x335d46||0xcc;return function(_0x1ca0d7){if(_0x1ca0d7){return _0x551cf5[_0x4611('0x19')](_0x335d46);}return _0x551cf5['status'](_0x335d46)[_0x4611('0x1a')]();};}function respondWithResult(_0x1ba2ff,_0x538961){_0x538961=_0x538961||0xc8;return function(_0x1960de){if(_0x1960de){return _0x1ba2ff[_0x4611('0x1b')](_0x538961)[_0x4611('0x1c')](_0x1960de);}};}function respondWithFilteredResult(_0x365b8c,_0x4d2499){return function(_0x4927aa){if(_0x4927aa){var _0x205094=typeof _0x4d2499[_0x4611('0x1d')]===_0x4611('0x1e')&&typeof _0x4d2499[_0x4611('0x1f')]===_0x4611('0x1e');var _0x464c56=_0x4927aa[_0x4611('0x20')];var _0x584f9b=_0x205094?0x0:_0x4d2499[_0x4611('0x1d')];var _0x596e5b=_0x205094?_0x4927aa[_0x4611('0x20')]:_0x4d2499[_0x4611('0x1d')]+_0x4d2499[_0x4611('0x1f')];var _0x5ec526;if(_0x596e5b>=_0x464c56){_0x596e5b=_0x464c56;_0x5ec526=0xc8;}else{_0x5ec526=0xce;}_0x365b8c['status'](_0x5ec526);return _0x365b8c[_0x4611('0x21')](_0x4611('0x22'),_0x584f9b+'-'+_0x596e5b+'/'+_0x464c56)['json'](_0x4927aa);}return null;};}function patchUpdates(_0x295b7a){return function(_0x444bc4){try{jsonpatch[_0x4611('0x23')](_0x444bc4,_0x295b7a,!![]);}catch(_0x481acb){return BPromise['reject'](_0x481acb);}return _0x444bc4[_0x4611('0x24')]();};}function saveUpdates(_0xd15c60,_0x2a5df3){return function(_0x2cb61a){if(_0x2cb61a){return _0x2cb61a[_0x4611('0x25')](_0xd15c60)[_0x4611('0x26')](function(_0x1bb45f){return _0x1bb45f;});}return null;};}function removeEntity(_0x4f6bc9,_0x36f065){return function(_0x34bdeb){if(_0x34bdeb){return _0x34bdeb[_0x4611('0x27')]()[_0x4611('0x26')](function(){_0x4f6bc9[_0x4611('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6b720d,_0x40d2c6){return function(_0x120500){if(!_0x120500){_0x6b720d[_0x4611('0x19')](0x194);}return _0x120500;};}function handleError(_0x9fa520,_0x3d1dfe){_0x3d1dfe=_0x3d1dfe||0x1f4;return function(_0x2d43e6){logger[_0x4611('0x28')](_0x2d43e6[_0x4611('0x29')]);if(_0x2d43e6[_0x4611('0x2a')]){delete _0x2d43e6[_0x4611('0x2a')];}_0x9fa520[_0x4611('0x1b')](_0x3d1dfe)[_0x4611('0x2b')](_0x2d43e6);};}exports[_0x4611('0x2c')]=function(_0x98759c,_0x2bdd97){var _0x24b037={},_0x102f2c={},_0x28ae4a={'count':0x0,'rows':[]};var _0x93f058=_[_0x4611('0x2d')](db[_0x4611('0x2e')][_0x4611('0x2f')],function(_0x5941fb){return{'name':_0x5941fb['fieldName'],'type':_0x5941fb[_0x4611('0x30')][_0x4611('0x31')]};});_0x102f2c['model']=_[_0x4611('0x2d')](_0x93f058,'name');_0x102f2c['query']=_[_0x4611('0x32')](_0x98759c[_0x4611('0x33')]);_0x102f2c[_0x4611('0x34')]=_[_0x4611('0x35')](_0x102f2c[_0x4611('0x36')],_0x102f2c[_0x4611('0x33')]);_0x24b037['attributes']=_[_0x4611('0x35')](_0x102f2c[_0x4611('0x36')],qs[_0x4611('0x37')](_0x98759c[_0x4611('0x33')][_0x4611('0x37')]));_0x24b037[_0x4611('0x38')]=_0x24b037[_0x4611('0x38')][_0x4611('0x39')]?_0x24b037[_0x4611('0x38')]:_0x102f2c[_0x4611('0x36')];if(!_0x98759c[_0x4611('0x33')][_0x4611('0x3a')]('nolimit')){_0x24b037[_0x4611('0x1f')]=qs[_0x4611('0x1f')](_0x98759c['query'][_0x4611('0x1f')]);_0x24b037[_0x4611('0x1d')]=qs[_0x4611('0x1d')](_0x98759c[_0x4611('0x33')][_0x4611('0x1d')]);}_0x24b037['order']=qs[_0x4611('0x3b')](_0x98759c['query'][_0x4611('0x3b')]);_0x24b037[_0x4611('0x3c')]=qs[_0x4611('0x34')](_[_0x4611('0x3d')](_0x98759c[_0x4611('0x33')],_0x102f2c['filters']),_0x93f058);if(_0x98759c[_0x4611('0x33')][_0x4611('0x3e')]){_0x24b037[_0x4611('0x3c')]=_[_0x4611('0x3f')](_0x24b037[_0x4611('0x3c')],{'$or':_[_0x4611('0x2d')](_0x93f058,function(_0x9543c6){if(_0x9543c6['type']!==_0x4611('0x40')){var _0x804359={};_0x804359[_0x9543c6[_0x4611('0x2a')]]={'$like':'%'+_0x98759c[_0x4611('0x33')][_0x4611('0x3e')]+'%'};return _0x804359;}})});}_0x24b037=_[_0x4611('0x3f')]({},_0x24b037,_0x98759c[_0x4611('0x41')]);var _0x7db771={'where':_0x24b037[_0x4611('0x3c')]};return db[_0x4611('0x2e')][_0x4611('0x20')](_0x7db771)['then'](function(_0x1c99e1){_0x28ae4a['count']=_0x1c99e1;if(_0x98759c[_0x4611('0x33')]['includeAll']){_0x24b037[_0x4611('0x42')]=[{'all':!![]}];}return db[_0x4611('0x2e')][_0x4611('0x43')](_0x24b037);})[_0x4611('0x26')](function(_0x25e67c){_0x28ae4a[_0x4611('0x44')]=_0x25e67c;return _0x28ae4a;})[_0x4611('0x26')](respondWithFilteredResult(_0x2bdd97,_0x24b037))[_0x4611('0x45')](handleError(_0x2bdd97,null));};exports[_0x4611('0x46')]=function(_0x1fafa6,_0x227775){var _0x382aea={'raw':!![],'where':{'id':_0x1fafa6[_0x4611('0x47')]['id']}},_0x45c7ba={};_0x45c7ba[_0x4611('0x36')]=_[_0x4611('0x32')](db[_0x4611('0x2e')]['rawAttributes']);_0x45c7ba[_0x4611('0x33')]=_[_0x4611('0x32')](_0x1fafa6[_0x4611('0x33')]);_0x45c7ba[_0x4611('0x34')]=_[_0x4611('0x35')](_0x45c7ba[_0x4611('0x36')],_0x45c7ba['query']);_0x382aea[_0x4611('0x38')]=_['intersection'](_0x45c7ba[_0x4611('0x36')],qs['fields'](_0x1fafa6[_0x4611('0x33')]['fields']));_0x382aea[_0x4611('0x38')]=_0x382aea[_0x4611('0x38')][_0x4611('0x39')]?_0x382aea[_0x4611('0x38')]:_0x45c7ba[_0x4611('0x36')];if(_0x1fafa6[_0x4611('0x33')][_0x4611('0x48')]){_0x382aea[_0x4611('0x42')]=[{'all':!![]}];}_0x382aea=_[_0x4611('0x3f')]({},_0x382aea,_0x1fafa6[_0x4611('0x41')]);return db[_0x4611('0x2e')][_0x4611('0x49')](_0x382aea)[_0x4611('0x26')](handleEntityNotFound(_0x227775,null))[_0x4611('0x26')](respondWithResult(_0x227775,null))[_0x4611('0x45')](handleError(_0x227775,null));};exports[_0x4611('0x4a')]=function(_0x2e024c,_0x36f191){return db[_0x4611('0x2e')][_0x4611('0x4a')](_0x2e024c['body'],{})[_0x4611('0x26')](respondWithResult(_0x36f191,0xc9))['catch'](handleError(_0x36f191,null));};exports[_0x4611('0x25')]=function(_0x182b5a,_0x24a69c){if(_0x182b5a[_0x4611('0x4b')]['id']){delete _0x182b5a[_0x4611('0x4b')]['id'];}return db[_0x4611('0x2e')][_0x4611('0x49')]({'where':{'id':_0x182b5a[_0x4611('0x47')]['id']}})[_0x4611('0x26')](handleEntityNotFound(_0x24a69c,null))[_0x4611('0x26')](saveUpdates(_0x182b5a['body'],null))[_0x4611('0x26')](respondWithResult(_0x24a69c,null))[_0x4611('0x45')](handleError(_0x24a69c,null));};exports[_0x4611('0x27')]=function(_0x366991,_0x598ba3){return db[_0x4611('0x2e')]['find']({'where':{'id':_0x366991[_0x4611('0x47')]['id']}})[_0x4611('0x26')](handleEntityNotFound(_0x598ba3,null))[_0x4611('0x26')](removeEntity(_0x598ba3,null))['catch'](handleError(_0x598ba3,null));};
\ No newline at end of file
+var _0x3fe7=['create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','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','offset','undefined','limit','Content-Range','json','apply','reject','then','destroy','end','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','length','find'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3fe7,0x97));var _0x73fe=function(_0x11ba46,_0x1d6752){_0x11ba46=_0x11ba46-0x0;var _0x1c8c6f=_0x3fe7[_0x11ba46];return _0x1c8c6f;};'use strict';var emlformat=require(_0x73fe('0x0'));var rimraf=require(_0x73fe('0x1'));var zipdir=require(_0x73fe('0x2'));var jsonpatch=require(_0x73fe('0x3'));var rp=require('request-promise');var moment=require(_0x73fe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x73fe('0x5'));var util=require('util');var path=require(_0x73fe('0x6'));var sox=require(_0x73fe('0x7'));var csv=require('to-csv');var ejs=require(_0x73fe('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x73fe('0x9'));var squel=require(_0x73fe('0xa'));var crypto=require(_0x73fe('0xb'));var jsforce=require(_0x73fe('0xc'));var deskjs=require(_0x73fe('0xd'));var toCsv=require(_0x73fe('0xe'));var querystring=require(_0x73fe('0xf'));var Papa=require(_0x73fe('0x10'));var Redis=require(_0x73fe('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x73fe('0x12'));var hardwareService=require(_0x73fe('0x13'));var logger=require(_0x73fe('0x14'))(_0x73fe('0x15'));var utils=require('../../config/utils');var config=require(_0x73fe('0x16'));var licenseUtil=require(_0x73fe('0x17'));var db=require(_0x73fe('0x18'))['db'];function respondWithStatusCode(_0x37e7a8,_0x1310ea){_0x1310ea=_0x1310ea||0xcc;return function(_0x218097){if(_0x218097){return _0x37e7a8[_0x73fe('0x19')](_0x1310ea);}return _0x37e7a8[_0x73fe('0x1a')](_0x1310ea)['end']();};}function respondWithResult(_0xdaec64,_0x5e2dec){_0x5e2dec=_0x5e2dec||0xc8;return function(_0x553238){if(_0x553238){return _0xdaec64[_0x73fe('0x1a')](_0x5e2dec)['json'](_0x553238);}};}function respondWithFilteredResult(_0x4ed991,_0x212316){return function(_0x8aab48){if(_0x8aab48){var _0x42874e=typeof _0x212316[_0x73fe('0x1b')]===_0x73fe('0x1c')&&typeof _0x212316['limit']===_0x73fe('0x1c');var _0xdd42c6=_0x8aab48['count'];var _0x14c1e1=_0x42874e?0x0:_0x212316[_0x73fe('0x1b')];var _0x3a7715=_0x42874e?_0x8aab48['count']:_0x212316[_0x73fe('0x1b')]+_0x212316[_0x73fe('0x1d')];var _0x1b7ff6;if(_0x3a7715>=_0xdd42c6){_0x3a7715=_0xdd42c6;_0x1b7ff6=0xc8;}else{_0x1b7ff6=0xce;}_0x4ed991[_0x73fe('0x1a')](_0x1b7ff6);return _0x4ed991['set'](_0x73fe('0x1e'),_0x14c1e1+'-'+_0x3a7715+'/'+_0xdd42c6)[_0x73fe('0x1f')](_0x8aab48);}return null;};}function patchUpdates(_0x2db81b){return function(_0x570e26){try{jsonpatch[_0x73fe('0x20')](_0x570e26,_0x2db81b,!![]);}catch(_0x590e52){return BPromise[_0x73fe('0x21')](_0x590e52);}return _0x570e26['save']();};}function saveUpdates(_0xa98ebc,_0x2081b0){return function(_0x5db5a0){if(_0x5db5a0){return _0x5db5a0['update'](_0xa98ebc)[_0x73fe('0x22')](function(_0x53b769){return _0x53b769;});}return null;};}function removeEntity(_0x3b0c49,_0x28df58){return function(_0x5c487c){if(_0x5c487c){return _0x5c487c[_0x73fe('0x23')]()[_0x73fe('0x22')](function(){_0x3b0c49[_0x73fe('0x1a')](0xcc)[_0x73fe('0x24')]();});}};}function handleEntityNotFound(_0x29074f,_0x40c2da){return function(_0x3c4ac0){if(!_0x3c4ac0){_0x29074f['sendStatus'](0x194);}return _0x3c4ac0;};}function handleError(_0x16272c,_0x2924e3){_0x2924e3=_0x2924e3||0x1f4;return function(_0x28c786){logger[_0x73fe('0x25')](_0x28c786[_0x73fe('0x26')]);if(_0x28c786['name']){delete _0x28c786[_0x73fe('0x27')];}_0x16272c['status'](_0x2924e3)[_0x73fe('0x28')](_0x28c786);};}exports['index']=function(_0x5c8eec,_0x49f4a8){var _0x54ab01={},_0x108194={},_0x1cd32f={'count':0x0,'rows':[]};var _0x4fc5c6=_[_0x73fe('0x29')](db[_0x73fe('0x2a')][_0x73fe('0x2b')],function(_0x2fee47){return{'name':_0x2fee47[_0x73fe('0x2c')],'type':_0x2fee47[_0x73fe('0x2d')][_0x73fe('0x2e')]};});_0x108194[_0x73fe('0x2f')]=_[_0x73fe('0x29')](_0x4fc5c6,_0x73fe('0x27'));_0x108194[_0x73fe('0x30')]=_[_0x73fe('0x31')](_0x5c8eec[_0x73fe('0x30')]);_0x108194[_0x73fe('0x32')]=_[_0x73fe('0x33')](_0x108194[_0x73fe('0x2f')],_0x108194[_0x73fe('0x30')]);_0x54ab01[_0x73fe('0x34')]=_['intersection'](_0x108194[_0x73fe('0x2f')],qs[_0x73fe('0x35')](_0x5c8eec['query'][_0x73fe('0x35')]));_0x54ab01[_0x73fe('0x34')]=_0x54ab01['attributes']['length']?_0x54ab01[_0x73fe('0x34')]:_0x108194[_0x73fe('0x2f')];if(!_0x5c8eec[_0x73fe('0x30')]['hasOwnProperty'](_0x73fe('0x36'))){_0x54ab01[_0x73fe('0x1d')]=qs[_0x73fe('0x1d')](_0x5c8eec['query'][_0x73fe('0x1d')]);_0x54ab01[_0x73fe('0x1b')]=qs[_0x73fe('0x1b')](_0x5c8eec[_0x73fe('0x30')][_0x73fe('0x1b')]);}_0x54ab01['order']=qs[_0x73fe('0x37')](_0x5c8eec[_0x73fe('0x30')][_0x73fe('0x37')]);_0x54ab01[_0x73fe('0x38')]=qs[_0x73fe('0x32')](_[_0x73fe('0x39')](_0x5c8eec[_0x73fe('0x30')],_0x108194[_0x73fe('0x32')]),_0x4fc5c6);if(_0x5c8eec[_0x73fe('0x30')][_0x73fe('0x3a')]){_0x54ab01[_0x73fe('0x38')]=_[_0x73fe('0x3b')](_0x54ab01[_0x73fe('0x38')],{'$or':_[_0x73fe('0x29')](_0x4fc5c6,function(_0x23c710){if(_0x23c710[_0x73fe('0x2d')]!==_0x73fe('0x3c')){var _0x4f1f1b={};_0x4f1f1b[_0x23c710['name']]={'$like':'%'+_0x5c8eec['query'][_0x73fe('0x3a')]+'%'};return _0x4f1f1b;}})});}_0x54ab01=_[_0x73fe('0x3b')]({},_0x54ab01,_0x5c8eec[_0x73fe('0x3d')]);var _0x33c4c1={'where':_0x54ab01[_0x73fe('0x38')]};return db[_0x73fe('0x2a')][_0x73fe('0x3e')](_0x33c4c1)['then'](function(_0x17e281){_0x1cd32f[_0x73fe('0x3e')]=_0x17e281;if(_0x5c8eec[_0x73fe('0x30')][_0x73fe('0x3f')]){_0x54ab01[_0x73fe('0x40')]=[{'all':!![]}];}return db['DeskField'][_0x73fe('0x41')](_0x54ab01);})[_0x73fe('0x22')](function(_0x39ee6a){_0x1cd32f[_0x73fe('0x42')]=_0x39ee6a;return _0x1cd32f;})[_0x73fe('0x22')](respondWithFilteredResult(_0x49f4a8,_0x54ab01))[_0x73fe('0x43')](handleError(_0x49f4a8,null));};exports['show']=function(_0x274dbd,_0x3e6d45){var _0x3b2eb4={'raw':!![],'where':{'id':_0x274dbd[_0x73fe('0x44')]['id']}},_0x2855d5={};_0x2855d5['model']=_[_0x73fe('0x31')](db['DeskField'][_0x73fe('0x2b')]);_0x2855d5[_0x73fe('0x30')]=_[_0x73fe('0x31')](_0x274dbd[_0x73fe('0x30')]);_0x2855d5[_0x73fe('0x32')]=_['intersection'](_0x2855d5['model'],_0x2855d5['query']);_0x3b2eb4[_0x73fe('0x34')]=_[_0x73fe('0x33')](_0x2855d5[_0x73fe('0x2f')],qs['fields'](_0x274dbd[_0x73fe('0x30')][_0x73fe('0x35')]));_0x3b2eb4[_0x73fe('0x34')]=_0x3b2eb4[_0x73fe('0x34')][_0x73fe('0x45')]?_0x3b2eb4['attributes']:_0x2855d5[_0x73fe('0x2f')];if(_0x274dbd[_0x73fe('0x30')][_0x73fe('0x3f')]){_0x3b2eb4[_0x73fe('0x40')]=[{'all':!![]}];}_0x3b2eb4=_[_0x73fe('0x3b')]({},_0x3b2eb4,_0x274dbd['options']);return db[_0x73fe('0x2a')][_0x73fe('0x46')](_0x3b2eb4)['then'](handleEntityNotFound(_0x3e6d45,null))[_0x73fe('0x22')](respondWithResult(_0x3e6d45,null))[_0x73fe('0x43')](handleError(_0x3e6d45,null));};exports[_0x73fe('0x47')]=function(_0x1ba0e8,_0xb10251){return db[_0x73fe('0x2a')][_0x73fe('0x47')](_0x1ba0e8[_0x73fe('0x48')],{})[_0x73fe('0x22')](respondWithResult(_0xb10251,0xc9))[_0x73fe('0x43')](handleError(_0xb10251,null));};exports[_0x73fe('0x49')]=function(_0x1dffc8,_0x4cd4dc){if(_0x1dffc8['body']['id']){delete _0x1dffc8[_0x73fe('0x48')]['id'];}return db['DeskField'][_0x73fe('0x46')]({'where':{'id':_0x1dffc8[_0x73fe('0x44')]['id']}})[_0x73fe('0x22')](handleEntityNotFound(_0x4cd4dc,null))[_0x73fe('0x22')](saveUpdates(_0x1dffc8[_0x73fe('0x48')],null))[_0x73fe('0x22')](respondWithResult(_0x4cd4dc,null))['catch'](handleError(_0x4cd4dc,null));};exports[_0x73fe('0x23')]=function(_0x18edcf,_0x21d1e9){return db['DeskField'][_0x73fe('0x46')]({'where':{'id':_0x18edcf[_0x73fe('0x44')]['id']}})['then'](handleEntityNotFound(_0x21d1e9,null))[_0x73fe('0x22')](removeEntity(_0x21d1e9,null))[_0x73fe('0x43')](handleError(_0x21d1e9,null));};
\ No newline at end of file
index 9a4d4e0..8b509f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7d8=['DeskField','int_desk_fields','desk_unique_index','idField','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x14795a,_0x1bb61a){var _0x31c7b4=function(_0x5272bb){while(--_0x5272bb){_0x14795a['push'](_0x14795a['shift']());}};_0x31c7b4(++_0x1bb61a);}(_0xf7d8,0x6d));var _0x8f7d=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0xf7d8[_0xd0a847];return _0x2536ec;};'use strict';var _=require('lodash');var util=require(_0x8f7d('0x0'));var logger=require(_0x8f7d('0x1'))(_0x8f7d('0x2'));var moment=require(_0x8f7d('0x3'));var BPromise=require('bluebird');var rp=require(_0x8f7d('0x4'));var fs=require('fs');var path=require(_0x8f7d('0x5'));var rimraf=require(_0x8f7d('0x6'));var config=require(_0x8f7d('0x7'));var attributes=require(_0x8f7d('0x8'));module[_0x8f7d('0x9')]=function(_0x3176f3,_0x22d913){return _0x3176f3[_0x8f7d('0xa')](_0x8f7d('0xb'),attributes,{'tableName':_0x8f7d('0xc'),'paranoid':![],'indexes':[{'name':_0x8f7d('0xd'),'fields':[_0x8f7d('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfe01=['./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0xf4666e,_0x571140){var _0x1853f1=function(_0x5160a5){while(--_0x5160a5){_0xf4666e['push'](_0xf4666e['shift']());}};_0x1853f1(++_0x571140);}(_0xfe01,0xd7));var _0x1fe0=function(_0x39f5a2,_0x16cbc8){_0x39f5a2=_0x39f5a2-0x0;var _0x6a6f05=_0xfe01[_0x39f5a2];return _0x6a6f05;};'use strict';var _=require('lodash');var util=require(_0x1fe0('0x0'));var logger=require(_0x1fe0('0x1'))(_0x1fe0('0x2'));var moment=require(_0x1fe0('0x3'));var BPromise=require('bluebird');var rp=require(_0x1fe0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1fe0('0x5'));var attributes=require(_0x1fe0('0x6'));module[_0x1fe0('0x7')]=function(_0x4143fc,_0x1e697c){return _0x4143fc['define'](_0x1fe0('0x8'),attributes,{'tableName':_0x1fe0('0x9'),'paranoid':![],'indexes':[{'name':_0x1fe0('0xa'),'fields':[_0x1fe0('0xb'),_0x1fe0('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index d9a99dc..78fe65c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84a2=['debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s'];(function(_0x3eee26,_0x36825d){var _0x101f0b=function(_0x490677){while(--_0x490677){_0x3eee26['push'](_0x3eee26['shift']());}};_0x101f0b(++_0x36825d);}(_0x84a2,0xef));var _0x284a=function(_0x2e0bed,_0x24b28d){_0x2e0bed=_0x2e0bed-0x0;var _0x45e74e=_0x84a2[_0x2e0bed];return _0x45e74e;};'use strict';var _=require(_0x284a('0x0'));var util=require(_0x284a('0x1'));var moment=require('moment');var BPromise=require(_0x284a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x284a('0x3'))['db'];var utils=require(_0x284a('0x4'));var logger=require(_0x284a('0x5'))('rpc');var config=require(_0x284a('0x6'));var jayson=require(_0x284a('0x7'));var client=jayson[_0x284a('0x8')][_0x284a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4967e6,_0x120452,_0x41b225){return new BPromise(function(_0x4631e4,_0x5684e8){return client[_0x284a('0xa')](_0x4967e6,_0x41b225)[_0x284a('0xb')](function(_0x550327){logger[_0x284a('0xc')](_0x284a('0xd'),_0x120452,'request\x20sent');logger[_0x284a('0xe')](_0x284a('0xf'),_0x120452,_0x284a('0x10'),JSON[_0x284a('0x11')](_0x550327));if(_0x550327[_0x284a('0x12')]){if(_0x550327[_0x284a('0x12')][_0x284a('0x13')]===0x1f4){logger[_0x284a('0x12')](_0x284a('0xd'),_0x120452,_0x550327[_0x284a('0x12')][_0x284a('0x14')]);return _0x5684e8(_0x550327[_0x284a('0x12')][_0x284a('0x14')]);}logger[_0x284a('0x12')]('DeskField,\x20%s,\x20%s',_0x120452,_0x550327['error'][_0x284a('0x14')]);return _0x4631e4(_0x550327[_0x284a('0x12')][_0x284a('0x14')]);}else{logger[_0x284a('0xc')](_0x284a('0xd'),_0x120452,_0x284a('0x10'));_0x4631e4(_0x550327[_0x284a('0x15')][_0x284a('0x14')]);}})[_0x284a('0x16')](function(_0x56fd71){logger['error']('DeskField,\x20%s,\x20%s',_0x120452,_0x56fd71);_0x5684e8(_0x56fd71);});});}
\ No newline at end of file
+var _0xcf41=['request\x20sent','stringify','error','code','message','info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','DeskField,\x20%s,\x20%s'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xcf41,0xff));var _0x1cf4=function(_0x218f94,_0x2e3906){_0x218f94=_0x218f94-0x0;var _0x516e8a=_0xcf41[_0x218f94];return _0x516e8a;};'use strict';var _=require('lodash');var util=require(_0x1cf4('0x0'));var moment=require(_0x1cf4('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cf4('0x2'));var db=require(_0x1cf4('0x3'))['db'];var utils=require(_0x1cf4('0x4'));var logger=require('../../config/logger')(_0x1cf4('0x5'));var config=require(_0x1cf4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1cf4('0x7')][_0x1cf4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32ef00,_0x3bf0f8,_0x50c53a){return new BPromise(function(_0x584682,_0x5327bc){return client['request'](_0x32ef00,_0x50c53a)[_0x1cf4('0x9')](function(_0x374346){logger['info'](_0x1cf4('0xa'),_0x3bf0f8,_0x1cf4('0xb'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x3bf0f8,_0x1cf4('0xb'),JSON[_0x1cf4('0xc')](_0x374346));if(_0x374346[_0x1cf4('0xd')]){if(_0x374346[_0x1cf4('0xd')][_0x1cf4('0xe')]===0x1f4){logger[_0x1cf4('0xd')](_0x1cf4('0xa'),_0x3bf0f8,_0x374346[_0x1cf4('0xd')]['message']);return _0x5327bc(_0x374346[_0x1cf4('0xd')][_0x1cf4('0xf')]);}logger['error'](_0x1cf4('0xa'),_0x3bf0f8,_0x374346[_0x1cf4('0xd')][_0x1cf4('0xf')]);return _0x584682(_0x374346['error'][_0x1cf4('0xf')]);}else{logger[_0x1cf4('0x10')](_0x1cf4('0xa'),_0x3bf0f8,_0x1cf4('0xb'));_0x584682(_0x374346[_0x1cf4('0x11')][_0x1cf4('0xf')]);}})[_0x1cf4('0x12')](function(_0x498c08){logger[_0x1cf4('0xd')](_0x1cf4('0xa'),_0x3bf0f8,_0x498c08);_0x5327bc(_0x498c08);});});}
\ No newline at end of file
index c866920..4636815 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf487=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','isAuthenticated','show','/:id/fields','getFields','post','create','addConfiguration','put','/:id'];(function(_0x50fd99,_0x1b4679){var _0x12a19a=function(_0x10ec67){while(--_0x10ec67){_0x50fd99['push'](_0x50fd99['shift']());}};_0x12a19a(++_0x1b4679);}(_0xf487,0x9a));var _0x7f48=function(_0xbb7396,_0x404ac4){_0xbb7396=_0xbb7396-0x0;var _0x2c41dd=_0xf487[_0xbb7396];return _0x2c41dd;};'use strict';var multer=require(_0x7f48('0x0'));var util=require(_0x7f48('0x1'));var path=require(_0x7f48('0x2'));var timeout=require(_0x7f48('0x3'));var express=require(_0x7f48('0x4'));var router=express[_0x7f48('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7f48('0x6'));var interaction=require(_0x7f48('0x7'));var config=require(_0x7f48('0x8'));var controller=require(_0x7f48('0x9'));router[_0x7f48('0xa')]('/',auth['isAuthenticated'](),controller[_0x7f48('0xb')]);router[_0x7f48('0xa')]('/:id',auth[_0x7f48('0xc')](),controller[_0x7f48('0xd')]);router[_0x7f48('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x7f48('0xa')](_0x7f48('0xe'),auth[_0x7f48('0xc')](),controller[_0x7f48('0xf')]);router[_0x7f48('0x10')]('/',auth[_0x7f48('0xc')](),controller[_0x7f48('0x11')]);router[_0x7f48('0x10')]('/:id/configurations',auth[_0x7f48('0xc')](),controller[_0x7f48('0x12')]);router[_0x7f48('0x13')](_0x7f48('0x14'),auth[_0x7f48('0xc')](),controller[_0x7f48('0x15')]);router[_0x7f48('0x16')](_0x7f48('0x14'),auth['isAuthenticated'](),controller[_0x7f48('0x17')]);module[_0x7f48('0x18')]=router;
\ No newline at end of file
+var _0xb7c9=['../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0xb7c9,0x162));var _0x9b7c=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xb7c9[_0x5f0089];return _0x193892;};'use strict';var multer=require('multer');var util=require(_0x9b7c('0x0'));var path=require(_0x9b7c('0x1'));var timeout=require(_0x9b7c('0x2'));var express=require(_0x9b7c('0x3'));var router=express[_0x9b7c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9b7c('0x5'));var interaction=require(_0x9b7c('0x6'));var config=require('../../config/environment');var controller=require(_0x9b7c('0x7'));router[_0x9b7c('0x8')]('/',auth[_0x9b7c('0x9')](),controller[_0x9b7c('0xa')]);router[_0x9b7c('0x8')](_0x9b7c('0xb'),auth[_0x9b7c('0x9')](),controller[_0x9b7c('0xc')]);router[_0x9b7c('0x8')](_0x9b7c('0xd'),auth[_0x9b7c('0x9')](),controller[_0x9b7c('0xe')]);router[_0x9b7c('0x8')](_0x9b7c('0xf'),auth[_0x9b7c('0x9')](),controller[_0x9b7c('0x10')]);router[_0x9b7c('0x11')]('/',auth[_0x9b7c('0x9')](),controller['create']);router[_0x9b7c('0x11')](_0x9b7c('0xd'),auth[_0x9b7c('0x9')](),controller[_0x9b7c('0x12')]);router[_0x9b7c('0x13')](_0x9b7c('0xb'),auth['isAuthenticated'](),controller[_0x9b7c('0x14')]);router[_0x9b7c('0x15')](_0x9b7c('0xb'),auth[_0x9b7c('0x9')](),controller[_0x9b7c('0x16')]);module[_0x9b7c('0x17')]=router;
\ No newline at end of file
index f0582bf..74c9c6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6519=['STRING','sequelize','exports'];(function(_0x10dc36,_0x4d19af){var _0x56a9be=function(_0x55328a){while(--_0x55328a){_0x10dc36['push'](_0x10dc36['shift']());}};_0x56a9be(++_0x4d19af);}(_0x6519,0x163));var _0x9651=function(_0x2e9b5b,_0x3e1332){_0x2e9b5b=_0x2e9b5b-0x0;var _0x734c46=_0x6519[_0x2e9b5b];return _0x734c46;};'use strict';var Sequelize=require(_0x9651('0x0'));module[_0x9651('0x1')]={'name':{'type':Sequelize[_0x9651('0x2')]},'username':{'type':Sequelize[_0x9651('0x2')]},'password':{'type':Sequelize[_0x9651('0x2')]},'remoteUri':{'type':Sequelize[_0x9651('0x2')]},'tenantId':{'type':Sequelize[_0x9651('0x2')]},'clientId':{'type':Sequelize[_0x9651('0x2')]},'clientSecret':{'type':Sequelize[_0x9651('0x2')]},'serverUrl':{'type':Sequelize[_0x9651('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8f28=['exports','STRING','sequelize'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x8f28,0xcb));var _0x88f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f28[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x88f2('0x0'));module[_0x88f2('0x1')]={'name':{'type':Sequelize[_0x88f2('0x2')]},'username':{'type':Sequelize[_0x88f2('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x88f2('0x2')]},'clientId':{'type':Sequelize[_0x88f2('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x88f2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x88f2('0x2')]}};
\ No newline at end of file
index 479d0a2..4c34f25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3036=['slice','substring','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','tenantId','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','includes','LogicalName','forEach','push','all','isNil','@odata.type','BooleanAttributeMetadata','StringAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','FalseOption',')/Attributes(','?$select=DisplayName,LogicalName','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','Dynamics365Account','include','findAll','rows','show','find','create','body','params','catch','getConfigurations','findOne','Dynamics365Configuration','options','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','incident','title','description','customerid','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridtype','customeridyominame','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responsiblecontactidyominame','sentimentvalue','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','remoteUri','clientSecret'];(function(_0x22b782,_0x10154f){var _0x50780e=function(_0x3f4034){while(--_0x3f4034){_0x22b782['push'](_0x22b782['shift']());}};_0x50780e(++_0x10154f);}(_0x3036,0x1a9));var _0x6303=function(_0x1365bb,_0x209d07){_0x1365bb=_0x1365bb-0x0;var _0x218d4d=_0x3036[_0x1365bb];return _0x218d4d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6303('0x0'));var jsonpatch=require(_0x6303('0x1'));var rp=require(_0x6303('0x2'));var moment=require('moment');var BPromise=require(_0x6303('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6303('0x4'));var csv=require('to-csv');var ejs=require(_0x6303('0x5'));var fs=require('fs');var fs_extra=require(_0x6303('0x6'));var _=require(_0x6303('0x7'));var squel=require('squel');var crypto=require(_0x6303('0x8'));var jsforce=require(_0x6303('0x9'));var deskjs=require(_0x6303('0xa'));var toCsv=require(_0x6303('0xb'));var querystring=require(_0x6303('0xc'));var Papa=require(_0x6303('0xd'));var Redis=require(_0x6303('0xe'));var authService=require(_0x6303('0xf'));var qs=require(_0x6303('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6303('0x11'));var logger=require(_0x6303('0x12'))(_0x6303('0x13'));var utils=require(_0x6303('0x14'));var config=require(_0x6303('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6303('0x16'))['db'];var integrations=require(_0x6303('0x17'));function respondWithStatusCode(_0x10c1e0,_0x251291){_0x251291=_0x251291||0xcc;return function(_0x284a8b){if(_0x284a8b){return _0x10c1e0['sendStatus'](_0x251291);}return _0x10c1e0['status'](_0x251291)['end']();};}function respondWithResult(_0x2726ef,_0x3f8f56){_0x3f8f56=_0x3f8f56||0xc8;return function(_0x251995){if(_0x251995){return _0x2726ef[_0x6303('0x18')](_0x3f8f56)[_0x6303('0x19')](_0x251995);}};}function respondWithFilteredResult(_0x43526d,_0x3395e0){return function(_0x2c4cbd){if(_0x2c4cbd){var _0x13874f=typeof _0x3395e0['offset']==='undefined'&&typeof _0x3395e0[_0x6303('0x1a')]===_0x6303('0x1b');var _0x46c724=_0x2c4cbd[_0x6303('0x1c')];var _0x36a6af=_0x13874f?0x0:_0x3395e0['offset'];var _0x30dcd2=_0x13874f?_0x2c4cbd[_0x6303('0x1c')]:_0x3395e0[_0x6303('0x1d')]+_0x3395e0[_0x6303('0x1a')];var _0x33474f;if(_0x30dcd2>=_0x46c724){_0x30dcd2=_0x46c724;_0x33474f=0xc8;}else{_0x33474f=0xce;}_0x43526d[_0x6303('0x18')](_0x33474f);return _0x43526d[_0x6303('0x1e')](_0x6303('0x1f'),_0x36a6af+'-'+_0x30dcd2+'/'+_0x46c724)[_0x6303('0x19')](_0x2c4cbd);}return null;};}function patchUpdates(_0x154472){return function(_0x46b3f3){try{jsonpatch['apply'](_0x46b3f3,_0x154472,!![]);}catch(_0x579acb){return BPromise[_0x6303('0x20')](_0x579acb);}return _0x46b3f3[_0x6303('0x21')]();};}function saveUpdates(_0x24c7c5,_0x20454a){return function(_0x52235a){if(_0x52235a){return _0x52235a[_0x6303('0x22')](_0x24c7c5)[_0x6303('0x23')](function(_0x2872e8){return _0x2872e8;});}return null;};}function removeEntity(_0x18b80a,_0x1336de){return function(_0x21eec0){if(_0x21eec0){return _0x21eec0[_0x6303('0x24')]()['then'](function(){_0x18b80a['status'](0xcc)[_0x6303('0x25')]();});}};}function handleEntityNotFound(_0x3fed67,_0x551578){return function(_0x46cb9b){if(!_0x46cb9b){_0x3fed67[_0x6303('0x26')](0x194);}return _0x46cb9b;};}function handleError(_0x294049,_0x53adbd){_0x53adbd=_0x53adbd||0x1f4;return function(_0x1e7d33){logger[_0x6303('0x27')](_0x1e7d33[_0x6303('0x28')]);if(_0x1e7d33[_0x6303('0x29')]){delete _0x1e7d33[_0x6303('0x29')];}_0x294049[_0x6303('0x18')](_0x53adbd)[_0x6303('0x2a')](_0x1e7d33);};}exports[_0x6303('0x2b')]=function(_0x62e4b,_0x29cd61){var _0x17891b={},_0x5ae660={},_0x6fe268={'count':0x0,'rows':[]};var _0x4d1e98=_[_0x6303('0x2c')](db['Dynamics365Account']['rawAttributes'],function(_0xb9f2e3){return{'name':_0xb9f2e3[_0x6303('0x2d')],'type':_0xb9f2e3[_0x6303('0x2e')]['key']};});_0x5ae660['model']=_[_0x6303('0x2c')](_0x4d1e98,'name');_0x5ae660['query']=_[_0x6303('0x2f')](_0x62e4b[_0x6303('0x30')]);_0x5ae660[_0x6303('0x31')]=_[_0x6303('0x32')](_0x5ae660[_0x6303('0x33')],_0x5ae660['query']);_0x17891b[_0x6303('0x34')]=_[_0x6303('0x32')](_0x5ae660[_0x6303('0x33')],qs['fields'](_0x62e4b['query'][_0x6303('0x35')]));_0x17891b['attributes']=_0x17891b[_0x6303('0x34')][_0x6303('0x36')]?_0x17891b[_0x6303('0x34')]:_0x5ae660[_0x6303('0x33')];if(!_0x62e4b[_0x6303('0x30')]['hasOwnProperty'](_0x6303('0x37'))){_0x17891b[_0x6303('0x1a')]=qs[_0x6303('0x1a')](_0x62e4b[_0x6303('0x30')][_0x6303('0x1a')]);_0x17891b['offset']=qs[_0x6303('0x1d')](_0x62e4b[_0x6303('0x30')][_0x6303('0x1d')]);}_0x17891b[_0x6303('0x38')]=qs[_0x6303('0x39')](_0x62e4b['query'][_0x6303('0x39')]);_0x17891b['where']=qs[_0x6303('0x31')](_[_0x6303('0x3a')](_0x62e4b[_0x6303('0x30')],_0x5ae660['filters']),_0x4d1e98);if(_0x62e4b['query'][_0x6303('0x3b')]){_0x17891b['where']=_[_0x6303('0x3c')](_0x17891b[_0x6303('0x3d')],{'$or':_[_0x6303('0x2c')](_0x4d1e98,function(_0x4eb2f5){if(_0x4eb2f5['type']!==_0x6303('0x3e')){var _0x2cd981={};_0x2cd981[_0x4eb2f5[_0x6303('0x29')]]={'$like':'%'+_0x62e4b[_0x6303('0x30')][_0x6303('0x3b')]+'%'};return _0x2cd981;}})});}_0x17891b=_[_0x6303('0x3c')]({},_0x17891b,_0x62e4b['options']);var _0x375379={'where':_0x17891b['where']};return db[_0x6303('0x3f')]['count'](_0x375379)[_0x6303('0x23')](function(_0x44cd0c){_0x6fe268[_0x6303('0x1c')]=_0x44cd0c;if(_0x62e4b[_0x6303('0x30')]['includeAll']){_0x17891b[_0x6303('0x40')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x6303('0x41')](_0x17891b);})[_0x6303('0x23')](function(_0x4cd580){_0x6fe268[_0x6303('0x42')]=_0x4cd580;return _0x6fe268;})[_0x6303('0x23')](respondWithFilteredResult(_0x29cd61,_0x17891b))['catch'](handleError(_0x29cd61,null));};exports[_0x6303('0x43')]=function(_0x5924a9,_0x7e5879){var _0x511c46={'raw':![],'where':{'id':_0x5924a9['params']['id']}},_0x511086={};_0x511086[_0x6303('0x33')]=_[_0x6303('0x2f')](db['Dynamics365Account']['rawAttributes']);_0x511086[_0x6303('0x30')]=_[_0x6303('0x2f')](_0x5924a9['query']);_0x511086[_0x6303('0x31')]=_[_0x6303('0x32')](_0x511086[_0x6303('0x33')],_0x511086[_0x6303('0x30')]);_0x511c46['attributes']=_[_0x6303('0x32')](_0x511086[_0x6303('0x33')],qs[_0x6303('0x35')](_0x5924a9['query'][_0x6303('0x35')]));_0x511c46[_0x6303('0x34')]=_0x511c46[_0x6303('0x34')][_0x6303('0x36')]?_0x511c46[_0x6303('0x34')]:_0x511086[_0x6303('0x33')];if(_0x5924a9['query']['includeAll']){_0x511c46[_0x6303('0x40')]=[{'all':!![]}];}_0x511c46=_[_0x6303('0x3c')]({},_0x511c46,_0x5924a9['options']);return db[_0x6303('0x3f')][_0x6303('0x44')](_0x511c46)[_0x6303('0x23')](handleEntityNotFound(_0x7e5879,null))[_0x6303('0x23')](respondWithResult(_0x7e5879,null))['catch'](handleError(_0x7e5879,null));};exports[_0x6303('0x45')]=function(_0x154df3,_0x351e40){return db[_0x6303('0x3f')]['create'](_0x154df3[_0x6303('0x46')],{})[_0x6303('0x23')](respondWithResult(_0x351e40,0xc9))['catch'](handleError(_0x351e40,null));};exports[_0x6303('0x22')]=function(_0x174121,_0x3be866){if(_0x174121[_0x6303('0x46')]['id']){delete _0x174121[_0x6303('0x46')]['id'];}return db[_0x6303('0x3f')][_0x6303('0x44')]({'where':{'id':_0x174121[_0x6303('0x47')]['id']}})[_0x6303('0x23')](handleEntityNotFound(_0x3be866,null))[_0x6303('0x23')](saveUpdates(_0x174121[_0x6303('0x46')],null))[_0x6303('0x23')](respondWithResult(_0x3be866,null))[_0x6303('0x48')](handleError(_0x3be866,null));};exports['destroy']=function(_0x40831c,_0x5b5388){return db[_0x6303('0x3f')][_0x6303('0x44')]({'where':{'id':_0x40831c['params']['id']}})['then'](handleEntityNotFound(_0x5b5388,null))[_0x6303('0x23')](removeEntity(_0x5b5388,null))[_0x6303('0x48')](handleError(_0x5b5388,null));};exports[_0x6303('0x49')]=function(_0x3707af,_0x2e7439,_0x2fdb9c){var _0x113828={};var _0x339ad2={};var _0x6a4ef2;var _0x47705a;return db[_0x6303('0x3f')][_0x6303('0x4a')]({'where':{'id':_0x3707af[_0x6303('0x47')]['id']}})['then'](handleEntityNotFound(_0x2e7439,null))[_0x6303('0x23')](function(_0x5c1936){if(_0x5c1936){_0x6a4ef2=_0x5c1936;_0x339ad2['model']=_['keys'](db[_0x6303('0x4b')]['rawAttributes']);_0x339ad2['query']=_['keys'](_0x3707af[_0x6303('0x30')]);_0x339ad2[_0x6303('0x31')]=_['intersection'](_0x339ad2[_0x6303('0x33')],_0x339ad2['query']);_0x113828['attributes']=_[_0x6303('0x32')](_0x339ad2[_0x6303('0x33')],qs[_0x6303('0x35')](_0x3707af[_0x6303('0x30')][_0x6303('0x35')]));_0x113828[_0x6303('0x34')]=_0x113828[_0x6303('0x34')][_0x6303('0x36')]?_0x113828[_0x6303('0x34')]:_0x339ad2[_0x6303('0x33')];_0x113828['order']=qs[_0x6303('0x39')](_0x3707af['query'][_0x6303('0x39')]);_0x113828[_0x6303('0x3d')]=qs[_0x6303('0x31')](_[_0x6303('0x3a')](_0x3707af[_0x6303('0x30')],_0x339ad2['filters']));if(_0x3707af['query'][_0x6303('0x3b')]){_0x113828['where']=_[_0x6303('0x3c')](_0x113828['where'],{'$or':_[_0x6303('0x2c')](_0x113828['attributes'],function(_0x4b7d32){var _0x6d73ff={};_0x6d73ff[_0x4b7d32]={'$like':'%'+_0x3707af[_0x6303('0x30')]['filter']+'%'};return _0x6d73ff;})});}_0x113828=_[_0x6303('0x3c')]({},_0x113828,_0x3707af[_0x6303('0x4c')]);return _0x6a4ef2[_0x6303('0x49')](_0x113828);}})[_0x6303('0x23')](function(_0x50879d){if(_0x50879d){_0x47705a=_0x50879d[_0x6303('0x36')];if(!_0x3707af[_0x6303('0x30')][_0x6303('0x4d')](_0x6303('0x37'))){_0x113828[_0x6303('0x1a')]=qs['limit'](_0x3707af['query'][_0x6303('0x1a')]);_0x113828[_0x6303('0x1d')]=qs[_0x6303('0x1d')](_0x3707af['query'][_0x6303('0x1d')]);}return _0x6a4ef2[_0x6303('0x49')](_0x113828);}})[_0x6303('0x23')](function(_0x311436){if(_0x311436){return _0x311436?{'count':_0x47705a,'rows':_0x311436}:null;}})[_0x6303('0x23')](respondWithResult(_0x2e7439,null))[_0x6303('0x48')](handleError(_0x2e7439,null));};exports[_0x6303('0x4e')]=function(_0x4eaa6c,_0x37987a,_0x141367){if(_0x4eaa6c[_0x6303('0x46')]['id']){delete _0x4eaa6c['body']['id'];}return db[_0x6303('0x3f')][_0x6303('0x4a')]({'where':{'id':_0x4eaa6c['params']['id']}})[_0x6303('0x23')](handleEntityNotFound(_0x37987a,null))[_0x6303('0x23')](function(_0x5c8adf){if(_0x5c8adf){_0x4eaa6c[_0x6303('0x46')][_0x6303('0x4f')]=_0x5c8adf['id'];_0x4eaa6c[_0x6303('0x46')][_0x6303('0x50')]=integrations[_0x6303('0x51')](_0x4eaa6c[_0x6303('0x46')][_0x6303('0x52')],_0x4eaa6c[_0x6303('0x46')]['type']);_0x4eaa6c[_0x6303('0x46')][_0x6303('0x53')]=integrations[_0x6303('0x54')](_0x4eaa6c[_0x6303('0x46')][_0x6303('0x52')],_0x4eaa6c[_0x6303('0x46')][_0x6303('0x2e')]);return db[_0x6303('0x4b')][_0x6303('0x45')](_0x4eaa6c[_0x6303('0x46')],{'include':[{'model':db[_0x6303('0x55')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0x6303('0x53')}]});}return null;})[_0x6303('0x23')](respondWithResult(_0x37987a,null))[_0x6303('0x48')](handleError(_0x37987a,null));};exports['getFields']=function(_0x5d2f91,_0x9f2209,_0xce52e){var _0x4cc4f2=_0x5d2f91[_0x6303('0x30')]['ticketType'];var _0x1cbcb1=_0x4cc4f2===_0x6303('0x56')?'Incident':'PhoneCall';var _0x289885='';var _0x5f3700='';var _0x3cdfce='';var _0x2d66a5='';var _0x3f7567='';var _0x12c84c='';var _0x56ef34='';var _0x5f32fe='';var _0x2eda6a=[_0x6303('0x57'),_0x6303('0x58'),_0x6303('0x59'),'ownerid','caseorigincode','subject','phonenumber',_0x6303('0x5a'),_0x6303('0x5b'),'phonecall_activity_parties'];var _0x34b8cd=[_0x6303('0x5c'),_0x6303('0x5d'),_0x6303('0x5e'),_0x6303('0x5f'),'contactidname','contactidyominame',_0x6303('0x60'),_0x6303('0x61'),'createdbyexternalpartyname',_0x6303('0x62'),_0x6303('0x63'),_0x6303('0x64'),_0x6303('0x65'),_0x6303('0x66'),'createdonbehalfbyyominame','customeridname',_0x6303('0x67'),_0x6303('0x68'),'emailaddress','entitlementidname','entityimage_timestamp',_0x6303('0x69'),'escalatedon',_0x6303('0x6a'),_0x6303('0x6b'),_0x6303('0x6c'),_0x6303('0x6d'),_0x6303('0x6e'),'kbarticleidname',_0x6303('0x6f'),'masteridname',_0x6303('0x70'),'modifiedbyexternalpartyyominame',_0x6303('0x71'),_0x6303('0x72'),_0x6303('0x73'),'modifiedonbehalfbyname',_0x6303('0x74'),_0x6303('0x75'),_0x6303('0x76'),_0x6303('0x77'),_0x6303('0x78'),_0x6303('0x79'),_0x6303('0x7a'),'owneridtype',_0x6303('0x7b'),_0x6303('0x7c'),_0x6303('0x7d'),_0x6303('0x7e'),_0x6303('0x7f'),_0x6303('0x80'),_0x6303('0x81'),'resolveby',_0x6303('0x82'),'responseby','responsiblecontactidname',_0x6303('0x83'),_0x6303('0x84'),'slainvokedidname','slaname','socialprofileidname',_0x6303('0x85'),_0x6303('0x86'),_0x6303('0x87'),_0x6303('0x88'),_0x6303('0x89'),_0x6303('0x8a'),_0x6303('0x8b'),_0x6303('0x8c'),'versionnumber'];var _0x44a4d4=_0x2eda6a[_0x6303('0x8d')](_0x34b8cd);return db['Dynamics365Account'][_0x6303('0x4a')]({'where':{'id':_0x5d2f91[_0x6303('0x47')]['id']},'attributes':['id',_0x6303('0x8e'),'password',_0x6303('0x8f'),'tenantId','clientId',_0x6303('0x90')]})[_0x6303('0x23')](handleEntityNotFound(_0x9f2209,null))[_0x6303('0x23')](function(_0x4e8782){if(_0x4e8782){_0x5f32fe=_0x4e8782[_0x6303('0x8f')];var _0x4973df=_0x5f32fe[_0x6303('0x91')](-0x1);if(_0x4973df==='/'){_0x5f32fe=_0x5f32fe[_0x6303('0x92')](0x0,_0x5f32fe[_0x6303('0x93')](_0x4973df));}_0x56ef34=util[_0x6303('0x94')](_0x6303('0x95'),_0x5f32fe);var _0x56d27e={'method':'POST','uri':_0x6303('0x96')+_0x4e8782[_0x6303('0x97')]+_0x6303('0x98'),'form':{'client_id':_0x4e8782['clientId'],'resource':_0x5f32fe,'username':_0x4e8782[_0x6303('0x8e')],'password':_0x4e8782['password'],'grant_type':'password','client_secret':_0x4e8782['clientSecret']},'json':!![]};return rp(_0x56d27e);}})[_0x6303('0x23')](function(_0x48d6c2){_0x12c84c=_0x48d6c2['access_token'];var _0x5b6606={'method':_0x6303('0x99'),'uri':encodeURI(_0x56ef34+_0x6303('0x9a')+_0x1cbcb1+'\x27'),'headers':{'Authorization':_0x6303('0x9b')+_0x12c84c,'If-None-Match':null,'OData-Version':_0x6303('0x9c')},'json':!![]};return rp(_0x5b6606);})[_0x6303('0x23')](function(_0x341a38){var _0x33278b=_0x341a38[_0x6303('0x9d')][0x0];var _0x3ebe39=_0x33278b[_0x6303('0x9e')];var _0x19e7bd={'method':_0x6303('0x99'),'uri':_0x56ef34+_0x6303('0x9f')+_0x3ebe39+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x6303('0x9b')+_0x12c84c,'If-None-Match':null,'OData-Version':_0x6303('0x9c')},'json':!![]};return rp(_0x19e7bd);})['then'](function(_0x86af15){_0x289885=_0x86af15;_0x5f3700=_0x289885[_0x6303('0xa0')];_0x5f3700=_['remove'](_0x5f3700,function(_0x4e3923){return!_0x44a4d4[_0x6303('0xa1')](_0x4e3923[_0x6303('0xa2')]);});var _0x269581=[];var _0x59d8d6=[];_0x5f3700[_0x6303('0xa3')](function(_0x36d95c){if(_0x36d95c['@odata.type']){var _0x4a03ca=_0x36d95c['@odata.type'][_0x6303('0x92')](_0x36d95c['@odata.type'][_0x6303('0x93')]('.')+0x1);if(_0x4a03ca==='PicklistAttributeMetadata'){_0x269581[_0x6303('0xa4')](getSelectList(_0x56ef34,_0x4cc4f2,_0x59d8d6,_0x289885[_0x6303('0x9e')],_0x36d95c['MetadataId'],_0x12c84c));}}});return Promise[_0x6303('0xa5')](_0x269581);})[_0x6303('0x23')](function(_0x11170b){_0x3cdfce=_0x11170b[0x0];var _0x3888b7=[];var _0x5a4907=[];_0x5f3700[_0x6303('0xa3')](function(_0x456a65){if(!_[_0x6303('0xa6')](_0x456a65[_0x6303('0xa7')])){var _0xd65153=_0x456a65[_0x6303('0xa7')][_0x6303('0x92')](_0x456a65[_0x6303('0xa7')][_0x6303('0x93')]('.')+0x1);if(_0xd65153===_0x6303('0xa8')){_0x3888b7['push'](getBooleanList(_0x56ef34,_0x4cc4f2,_0x5a4907,_0x289885[_0x6303('0x9e')],_0x456a65['MetadataId'],_0x12c84c));}}});return Promise[_0x6303('0xa5')](_0x3888b7);})[_0x6303('0x23')](function(_0x1179f9){_0x2d66a5=_0x1179f9[0x0];var _0x3b32e1=[];var _0x2bbae8=[];_0x5f3700[_0x6303('0xa3')](function(_0x7139bf){if(_0x7139bf[_0x6303('0xa7')]){var _0xe232e9=_0x7139bf[_0x6303('0xa7')][_0x6303('0x92')](_0x7139bf[_0x6303('0xa7')][_0x6303('0x93')]('.')+0x1);if(_0xe232e9===_0x6303('0xa9')||_0xe232e9==='DoubleAttributeMetadata'||_0xe232e9==='BigIntAttributeMetadata'||_0xe232e9==='IntegerAttributeMetadata'||_0xe232e9===_0x6303('0xaa')||_0xe232e9===_0x6303('0xab')||_0xe232e9==='StatusAttributeMetadata'||_0xe232e9===_0x6303('0xac')||_0xe232e9===_0x6303('0xad')||_0xe232e9===_0x6303('0xae')){_0x3b32e1[_0x6303('0xa4')](getInputList(_0x56ef34,_0x4cc4f2,_0xe232e9,_0x2bbae8,_0x289885[_0x6303('0x9e')],_0x7139bf[_0x6303('0x9e')],_0x12c84c));}}});return Promise[_0x6303('0xa5')](_0x3b32e1);})[_0x6303('0x23')](function(_0x11bd12){_0x3f7567=_0x11bd12[0x0];var _0x15c011=_0x3cdfce[_0x6303('0x8d')](_0x2d66a5)[_0x6303('0x8d')](_0x3f7567);var _0x303e80={'count':_0x15c011[_0x6303('0x36')],'rows':_0x15c011};return _0x303e80;})[_0x6303('0x23')](respondWithResult(_0x9f2209,null))[_0x6303('0x48')](function(_0x1a76b7){var _0x59157c=_0x5d2f91[_0x6303('0x30')][_0x6303('0xaf')]?0x1f4:_0x1a76b7[_0x6303('0xb0')]||0x1f4;logger[_0x6303('0x27')](_0x1a76b7[_0x6303('0x28')]);delete _0x1a76b7['name'];if(_0x59157c===0x191){_0x59157c=0x190;}_0x9f2209[_0x6303('0x18')](_0x59157c)[_0x6303('0x2a')](_0x5d2f91[_0x6303('0x30')][_0x6303('0xaf')]?{'message':_0x6303('0xb1'),'statusCode':_0x1a76b7[_0x6303('0xb0')]}:_0x1a76b7);});};function getSelectList(_0x4760fd,_0x389cf3,_0x34837b,_0x11bcdf,_0x24666d,_0x4f952a){var _0x3b380c={'method':_0x6303('0x99'),'uri':_0x4760fd+'EntityDefinitions('+_0x11bcdf+')/Attributes('+_0x24666d+_0x6303('0xb2')+_0x6303('0xb3'),'headers':{'Authorization':_0x6303('0x9b')+_0x4f952a,'If-None-Match':null,'OData-Version':_0x6303('0x9c')},'json':!![]};return rp(_0x3b380c)[_0x6303('0x23')](function(_0x3292bb){var _0x3cdb0b=[];var _0x59b62c=_0x3292bb['OptionSet'][_0x6303('0xb4')];_0x59b62c['forEach'](function(_0x13511f){_0x3cdb0b[_0x6303('0xa4')]({'name':_0x13511f[_0x6303('0xb5')][_0x6303('0xb6')][_0x6303('0xb5')],'value':String(_0x13511f[_0x6303('0xb7')])});});var _0x2b6816={'id':_0x389cf3+'_'+_0x3292bb[_0x6303('0xa2')],'name':_0x3292bb[_0x6303('0xb8')]['UserLocalizedLabel'][_0x6303('0xb5')],'custom':![],'options':_0x3cdb0b};_0x34837b['push'](_0x2b6816);return _0x34837b;});}function getBooleanList(_0x2463bc,_0x3fa04c,_0x293332,_0x2c9f6a,_0x3bdcb9,_0xb03153){var _0x2e5793={'method':_0x6303('0x99'),'uri':_0x2463bc+_0x6303('0x9f')+_0x2c9f6a+')/Attributes('+_0x3bdcb9+_0x6303('0xb9'),'headers':{'Authorization':'Bearer\x20'+_0xb03153,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2e5793)[_0x6303('0x23')](function(_0x365489){var _0x4517b4=[];_0x4517b4[_0x6303('0xa4')]({'name':_0x365489['OptionSet']['TrueOption']['Label'][_0x6303('0xb6')][_0x6303('0xb5')],'value':'true'},{'name':_0x365489[_0x6303('0xba')][_0x6303('0xbb')]['Label'][_0x6303('0xb6')][_0x6303('0xb5')],'value':'false'});var _0xace363={'id':_0x3fa04c+'_'+_0x365489['LogicalName'],'name':_0x365489['DisplayName'][_0x6303('0xb6')]['Label'],'custom':![],'options':_0x4517b4};_0x293332['push'](_0xace363);return _0x293332;});}function getInputList(_0x280ff6,_0x54cbdf,_0x56319b,_0x18be42,_0x4d7db1,_0x277108,_0x592674){var _0x477241={'method':_0x6303('0x99'),'uri':_0x280ff6+'EntityDefinitions('+_0x4d7db1+_0x6303('0xbc')+_0x277108+')/Microsoft.Dynamics.CRM.'+_0x56319b+_0x6303('0xbd'),'headers':{'Authorization':_0x6303('0x9b')+_0x592674,'If-None-Match':null,'OData-Version':_0x6303('0x9c')},'json':!![]};return rp(_0x477241)[_0x6303('0x23')](function(_0xedcc57){var _0x41120b={'id':_0x54cbdf+'_'+_0xedcc57['LogicalName'],'name':_0xedcc57[_0x6303('0xb8')][_0x6303('0xb6')]?_0xedcc57['DisplayName']['UserLocalizedLabel'][_0x6303('0xb5')]:_0xedcc57[_0x6303('0xa2')],'custom':![],'options':[]};_0x18be42[_0x6303('0xa4')](_0x41120b);return _0x18be42;});}
\ No newline at end of file
+var _0x4c6d=['4.0','MetadataId','GET','EntityDefinitions(','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','all','forEach','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','merge','find','create','body','destroy','getConfigurations','length','hasOwnProperty','addConfiguration','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Configuration','Dynamics365Field','getFields','incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token'];(function(_0x1c6135,_0x5de9a2){var _0x2f2277=function(_0x12ca85){while(--_0x12ca85){_0x1c6135['push'](_0x1c6135['shift']());}};_0x2f2277(++_0x5de9a2);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x4fd57e,_0x154b79){_0x4fd57e=_0x4fd57e-0x0;var _0x782aa7=_0x4c6d[_0x4fd57e];return _0x782aa7;};'use strict';var emlformat=require(_0xd4c6('0x0'));var rimraf=require(_0xd4c6('0x1'));var zipdir=require(_0xd4c6('0x2'));var jsonpatch=require(_0xd4c6('0x3'));var rp=require(_0xd4c6('0x4'));var moment=require('moment');var BPromise=require(_0xd4c6('0x5'));var Mustache=require(_0xd4c6('0x6'));var util=require(_0xd4c6('0x7'));var path=require('path');var sox=require(_0xd4c6('0x8'));var csv=require(_0xd4c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4c6('0xa'));var _=require(_0xd4c6('0xb'));var squel=require(_0xd4c6('0xc'));var crypto=require('crypto');var jsforce=require(_0xd4c6('0xd'));var deskjs=require(_0xd4c6('0xe'));var toCsv=require(_0xd4c6('0x9'));var querystring=require('querystring');var Papa=require(_0xd4c6('0xf'));var Redis=require(_0xd4c6('0x10'));var authService=require(_0xd4c6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd4c6('0x12'));var hardwareService=require(_0xd4c6('0x13'));var logger=require(_0xd4c6('0x14'))(_0xd4c6('0x15'));var utils=require(_0xd4c6('0x16'));var config=require(_0xd4c6('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd4c6('0x18'));function respondWithStatusCode(_0x489171,_0x162681){_0x162681=_0x162681||0xcc;return function(_0x1ce98a){if(_0x1ce98a){return _0x489171[_0xd4c6('0x19')](_0x162681);}return _0x489171[_0xd4c6('0x1a')](_0x162681)[_0xd4c6('0x1b')]();};}function respondWithResult(_0x384a98,_0x94f42e){_0x94f42e=_0x94f42e||0xc8;return function(_0x5b3cf0){if(_0x5b3cf0){return _0x384a98['status'](_0x94f42e)[_0xd4c6('0x1c')](_0x5b3cf0);}};}function respondWithFilteredResult(_0x3deb85,_0x25e1fb){return function(_0x25204d){if(_0x25204d){var _0x3cb95c=typeof _0x25e1fb[_0xd4c6('0x1d')]===_0xd4c6('0x1e')&&typeof _0x25e1fb['limit']===_0xd4c6('0x1e');var _0x44126c=_0x25204d[_0xd4c6('0x1f')];var _0x2c97b=_0x3cb95c?0x0:_0x25e1fb[_0xd4c6('0x1d')];var _0x54e0a5=_0x3cb95c?_0x25204d[_0xd4c6('0x1f')]:_0x25e1fb[_0xd4c6('0x1d')]+_0x25e1fb[_0xd4c6('0x20')];var _0x4b3323;if(_0x54e0a5>=_0x44126c){_0x54e0a5=_0x44126c;_0x4b3323=0xc8;}else{_0x4b3323=0xce;}_0x3deb85[_0xd4c6('0x1a')](_0x4b3323);return _0x3deb85[_0xd4c6('0x21')](_0xd4c6('0x22'),_0x2c97b+'-'+_0x54e0a5+'/'+_0x44126c)[_0xd4c6('0x1c')](_0x25204d);}return null;};}function patchUpdates(_0x48dbf8){return function(_0x1c8427){try{jsonpatch['apply'](_0x1c8427,_0x48dbf8,!![]);}catch(_0x37f552){return BPromise[_0xd4c6('0x23')](_0x37f552);}return _0x1c8427[_0xd4c6('0x24')]();};}function saveUpdates(_0x222813,_0xf536e0){return function(_0x27d8eb){if(_0x27d8eb){return _0x27d8eb[_0xd4c6('0x25')](_0x222813)[_0xd4c6('0x26')](function(_0x155cb3){return _0x155cb3;});}return null;};}function removeEntity(_0x466330,_0x1ebb17){return function(_0x1c4e19){if(_0x1c4e19){return _0x1c4e19['destroy']()['then'](function(){_0x466330[_0xd4c6('0x1a')](0xcc)[_0xd4c6('0x1b')]();});}};}function handleEntityNotFound(_0x4a5390,_0x1dee19){return function(_0x3a2c50){if(!_0x3a2c50){_0x4a5390[_0xd4c6('0x19')](0x194);}return _0x3a2c50;};}function handleError(_0x565b25,_0x35b50c){_0x35b50c=_0x35b50c||0x1f4;return function(_0x30276c){logger['error'](_0x30276c[_0xd4c6('0x27')]);if(_0x30276c[_0xd4c6('0x28')]){delete _0x30276c[_0xd4c6('0x28')];}_0x565b25['status'](_0x35b50c)[_0xd4c6('0x29')](_0x30276c);};}exports[_0xd4c6('0x2a')]=function(_0x255630,_0x4270d5){var _0x2e8c34={},_0x160330={},_0x41a8d2={'count':0x0,'rows':[]};var _0x1f32d8=_[_0xd4c6('0x2b')](db[_0xd4c6('0x2c')][_0xd4c6('0x2d')],function(_0x31e3d0){return{'name':_0x31e3d0[_0xd4c6('0x2e')],'type':_0x31e3d0[_0xd4c6('0x2f')]['key']};});_0x160330[_0xd4c6('0x30')]=_[_0xd4c6('0x2b')](_0x1f32d8,_0xd4c6('0x28'));_0x160330[_0xd4c6('0x31')]=_['keys'](_0x255630['query']);_0x160330['filters']=_[_0xd4c6('0x32')](_0x160330[_0xd4c6('0x30')],_0x160330[_0xd4c6('0x31')]);_0x2e8c34[_0xd4c6('0x33')]=_[_0xd4c6('0x32')](_0x160330[_0xd4c6('0x30')],qs[_0xd4c6('0x34')](_0x255630['query'][_0xd4c6('0x34')]));_0x2e8c34[_0xd4c6('0x33')]=_0x2e8c34[_0xd4c6('0x33')]['length']?_0x2e8c34[_0xd4c6('0x33')]:_0x160330[_0xd4c6('0x30')];if(!_0x255630[_0xd4c6('0x31')]['hasOwnProperty'](_0xd4c6('0x35'))){_0x2e8c34[_0xd4c6('0x20')]=qs[_0xd4c6('0x20')](_0x255630[_0xd4c6('0x31')]['limit']);_0x2e8c34[_0xd4c6('0x1d')]=qs[_0xd4c6('0x1d')](_0x255630[_0xd4c6('0x31')][_0xd4c6('0x1d')]);}_0x2e8c34[_0xd4c6('0x36')]=qs['sort'](_0x255630[_0xd4c6('0x31')][_0xd4c6('0x37')]);_0x2e8c34[_0xd4c6('0x38')]=qs[_0xd4c6('0x39')](_[_0xd4c6('0x3a')](_0x255630[_0xd4c6('0x31')],_0x160330['filters']),_0x1f32d8);if(_0x255630[_0xd4c6('0x31')][_0xd4c6('0x3b')]){_0x2e8c34[_0xd4c6('0x38')]=_['merge'](_0x2e8c34[_0xd4c6('0x38')],{'$or':_[_0xd4c6('0x2b')](_0x1f32d8,function(_0x1c95e3){if(_0x1c95e3[_0xd4c6('0x2f')]!==_0xd4c6('0x3c')){var _0x20a4e8={};_0x20a4e8[_0x1c95e3[_0xd4c6('0x28')]]={'$like':'%'+_0x255630[_0xd4c6('0x31')][_0xd4c6('0x3b')]+'%'};return _0x20a4e8;}})});}_0x2e8c34=_['merge']({},_0x2e8c34,_0x255630[_0xd4c6('0x3d')]);var _0x47e104={'where':_0x2e8c34['where']};return db[_0xd4c6('0x2c')][_0xd4c6('0x1f')](_0x47e104)[_0xd4c6('0x26')](function(_0x3960ca){_0x41a8d2[_0xd4c6('0x1f')]=_0x3960ca;if(_0x255630['query']['includeAll']){_0x2e8c34[_0xd4c6('0x3e')]=[{'all':!![]}];}return db[_0xd4c6('0x2c')][_0xd4c6('0x3f')](_0x2e8c34);})[_0xd4c6('0x26')](function(_0x4f6310){_0x41a8d2[_0xd4c6('0x40')]=_0x4f6310;return _0x41a8d2;})['then'](respondWithFilteredResult(_0x4270d5,_0x2e8c34))[_0xd4c6('0x41')](handleError(_0x4270d5,null));};exports[_0xd4c6('0x42')]=function(_0x1114db,_0x51585c){var _0x470157={'raw':![],'where':{'id':_0x1114db[_0xd4c6('0x43')]['id']}},_0x44cef3={};_0x44cef3[_0xd4c6('0x30')]=_[_0xd4c6('0x44')](db[_0xd4c6('0x2c')][_0xd4c6('0x2d')]);_0x44cef3[_0xd4c6('0x31')]=_[_0xd4c6('0x44')](_0x1114db['query']);_0x44cef3[_0xd4c6('0x39')]=_[_0xd4c6('0x32')](_0x44cef3[_0xd4c6('0x30')],_0x44cef3['query']);_0x470157[_0xd4c6('0x33')]=_[_0xd4c6('0x32')](_0x44cef3[_0xd4c6('0x30')],qs['fields'](_0x1114db['query'][_0xd4c6('0x34')]));_0x470157[_0xd4c6('0x33')]=_0x470157[_0xd4c6('0x33')]['length']?_0x470157[_0xd4c6('0x33')]:_0x44cef3[_0xd4c6('0x30')];if(_0x1114db[_0xd4c6('0x31')][_0xd4c6('0x45')]){_0x470157[_0xd4c6('0x3e')]=[{'all':!![]}];}_0x470157=_[_0xd4c6('0x46')]({},_0x470157,_0x1114db['options']);return db[_0xd4c6('0x2c')][_0xd4c6('0x47')](_0x470157)[_0xd4c6('0x26')](handleEntityNotFound(_0x51585c,null))[_0xd4c6('0x26')](respondWithResult(_0x51585c,null))[_0xd4c6('0x41')](handleError(_0x51585c,null));};exports[_0xd4c6('0x48')]=function(_0x34fb42,_0x3e75ce){return db['Dynamics365Account']['create'](_0x34fb42[_0xd4c6('0x49')],{})[_0xd4c6('0x26')](respondWithResult(_0x3e75ce,0xc9))[_0xd4c6('0x41')](handleError(_0x3e75ce,null));};exports['update']=function(_0x37aa81,_0x400d66){if(_0x37aa81[_0xd4c6('0x49')]['id']){delete _0x37aa81['body']['id'];}return db[_0xd4c6('0x2c')][_0xd4c6('0x47')]({'where':{'id':_0x37aa81[_0xd4c6('0x43')]['id']}})[_0xd4c6('0x26')](handleEntityNotFound(_0x400d66,null))['then'](saveUpdates(_0x37aa81[_0xd4c6('0x49')],null))[_0xd4c6('0x26')](respondWithResult(_0x400d66,null))[_0xd4c6('0x41')](handleError(_0x400d66,null));};exports[_0xd4c6('0x4a')]=function(_0x291837,_0x2803ef){return db[_0xd4c6('0x2c')]['find']({'where':{'id':_0x291837[_0xd4c6('0x43')]['id']}})[_0xd4c6('0x26')](handleEntityNotFound(_0x2803ef,null))[_0xd4c6('0x26')](removeEntity(_0x2803ef,null))['catch'](handleError(_0x2803ef,null));};exports[_0xd4c6('0x4b')]=function(_0x1ca24a,_0x46bf10,_0xb0fc59){var _0x471f08={};var _0x3e6df8={};var _0x1f7a1a;var _0x591c7c;return db[_0xd4c6('0x2c')]['findOne']({'where':{'id':_0x1ca24a['params']['id']}})[_0xd4c6('0x26')](handleEntityNotFound(_0x46bf10,null))['then'](function(_0x868da9){if(_0x868da9){_0x1f7a1a=_0x868da9;_0x3e6df8['model']=_[_0xd4c6('0x44')](db['Dynamics365Configuration']['rawAttributes']);_0x3e6df8[_0xd4c6('0x31')]=_[_0xd4c6('0x44')](_0x1ca24a[_0xd4c6('0x31')]);_0x3e6df8[_0xd4c6('0x39')]=_[_0xd4c6('0x32')](_0x3e6df8[_0xd4c6('0x30')],_0x3e6df8[_0xd4c6('0x31')]);_0x471f08[_0xd4c6('0x33')]=_[_0xd4c6('0x32')](_0x3e6df8['model'],qs[_0xd4c6('0x34')](_0x1ca24a[_0xd4c6('0x31')][_0xd4c6('0x34')]));_0x471f08[_0xd4c6('0x33')]=_0x471f08[_0xd4c6('0x33')][_0xd4c6('0x4c')]?_0x471f08[_0xd4c6('0x33')]:_0x3e6df8[_0xd4c6('0x30')];_0x471f08[_0xd4c6('0x36')]=qs[_0xd4c6('0x37')](_0x1ca24a[_0xd4c6('0x31')]['sort']);_0x471f08['where']=qs[_0xd4c6('0x39')](_[_0xd4c6('0x3a')](_0x1ca24a['query'],_0x3e6df8['filters']));if(_0x1ca24a['query'][_0xd4c6('0x3b')]){_0x471f08[_0xd4c6('0x38')]=_['merge'](_0x471f08['where'],{'$or':_[_0xd4c6('0x2b')](_0x471f08[_0xd4c6('0x33')],function(_0x22af44){var _0x3c8af3={};_0x3c8af3[_0x22af44]={'$like':'%'+_0x1ca24a[_0xd4c6('0x31')]['filter']+'%'};return _0x3c8af3;})});}_0x471f08=_[_0xd4c6('0x46')]({},_0x471f08,_0x1ca24a[_0xd4c6('0x3d')]);return _0x1f7a1a[_0xd4c6('0x4b')](_0x471f08);}})[_0xd4c6('0x26')](function(_0x2e46d7){if(_0x2e46d7){_0x591c7c=_0x2e46d7[_0xd4c6('0x4c')];if(!_0x1ca24a[_0xd4c6('0x31')][_0xd4c6('0x4d')](_0xd4c6('0x35'))){_0x471f08[_0xd4c6('0x20')]=qs[_0xd4c6('0x20')](_0x1ca24a[_0xd4c6('0x31')][_0xd4c6('0x20')]);_0x471f08['offset']=qs['offset'](_0x1ca24a[_0xd4c6('0x31')]['offset']);}return _0x1f7a1a['getConfigurations'](_0x471f08);}})['then'](function(_0x3ada36){if(_0x3ada36){return _0x3ada36?{'count':_0x591c7c,'rows':_0x3ada36}:null;}})[_0xd4c6('0x26')](respondWithResult(_0x46bf10,null))[_0xd4c6('0x41')](handleError(_0x46bf10,null));};exports[_0xd4c6('0x4e')]=function(_0x5731f6,_0xbdcb11,_0x27249c){if(_0x5731f6['body']['id']){delete _0x5731f6[_0xd4c6('0x49')]['id'];}return db[_0xd4c6('0x2c')][_0xd4c6('0x4f')]({'where':{'id':_0x5731f6[_0xd4c6('0x43')]['id']}})['then'](handleEntityNotFound(_0xbdcb11,null))[_0xd4c6('0x26')](function(_0x2b517a){if(_0x2b517a){_0x5731f6['body'][_0xd4c6('0x50')]=_0x2b517a['id'];_0x5731f6[_0xd4c6('0x49')]['Subjects']=integrations[_0xd4c6('0x51')](_0x5731f6[_0xd4c6('0x49')]['channel'],_0x5731f6[_0xd4c6('0x49')]['type']);_0x5731f6[_0xd4c6('0x49')][_0xd4c6('0x52')]=integrations[_0xd4c6('0x53')](_0x5731f6[_0xd4c6('0x49')][_0xd4c6('0x54')],_0x5731f6[_0xd4c6('0x49')]['type']);return db[_0xd4c6('0x55')]['create'](_0x5731f6[_0xd4c6('0x49')],{'include':[{'model':db[_0xd4c6('0x56')],'as':'Subjects'},{'model':db[_0xd4c6('0x56')],'as':_0xd4c6('0x52')}]});}return null;})[_0xd4c6('0x26')](respondWithResult(_0xbdcb11,null))['catch'](handleError(_0xbdcb11,null));};exports[_0xd4c6('0x57')]=function(_0x5e060d,_0x1ade87,_0x1f4392){var _0x5941b9=_0x5e060d[_0xd4c6('0x31')]['ticketType'];var _0x403497=_0x5941b9===_0xd4c6('0x58')?'Incident':_0xd4c6('0x59');var _0xad0f30='';var _0x589f80='';var _0x1678aa='';var _0x3c1d6c='';var _0x4ab66a='';var _0x237255='';var _0x1b30f1='';var _0x247ad3='';var _0x4e7a0d=[_0xd4c6('0x5a'),_0xd4c6('0x5b'),_0xd4c6('0x5c'),_0xd4c6('0x5d'),_0xd4c6('0x5e'),_0xd4c6('0x5f'),_0xd4c6('0x60'),_0xd4c6('0x61'),_0xd4c6('0x62'),_0xd4c6('0x63')];var _0x116dae=[_0xd4c6('0x64'),_0xd4c6('0x65'),_0xd4c6('0x66'),_0xd4c6('0x67'),_0xd4c6('0x68'),_0xd4c6('0x69'),_0xd4c6('0x6a'),_0xd4c6('0x6b'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0xd4c6('0x6c'),_0xd4c6('0x6d'),_0xd4c6('0x6e'),_0xd4c6('0x6f'),_0xd4c6('0x70'),_0xd4c6('0x71'),_0xd4c6('0x72'),_0xd4c6('0x73'),'emailaddress',_0xd4c6('0x74'),_0xd4c6('0x75'),_0xd4c6('0x76'),'escalatedon',_0xd4c6('0x77'),_0xd4c6('0x78'),'followupby',_0xd4c6('0x79'),_0xd4c6('0x7a'),'kbarticleidname',_0xd4c6('0x7b'),'masteridname',_0xd4c6('0x7c'),_0xd4c6('0x7d'),_0xd4c6('0x7e'),_0xd4c6('0x7f'),'modifiedon',_0xd4c6('0x80'),_0xd4c6('0x81'),'msdyn_incidenttypename',_0xd4c6('0x82'),_0xd4c6('0x83'),'onholdtime',_0xd4c6('0x84'),_0xd4c6('0x85'),'owneridtype','owneridyominame',_0xd4c6('0x86'),_0xd4c6('0x87'),_0xd4c6('0x88'),_0xd4c6('0x89'),_0xd4c6('0x8a'),_0xd4c6('0x8b'),'resolveby',_0xd4c6('0x8c'),_0xd4c6('0x8d'),_0xd4c6('0x8e'),_0xd4c6('0x8f'),_0xd4c6('0x90'),_0xd4c6('0x91'),'slaname','socialprofileidname',_0xd4c6('0x92'),_0xd4c6('0x93'),_0xd4c6('0x94'),_0xd4c6('0x95'),_0xd4c6('0x96'),'transactioncurrencyidname',_0xd4c6('0x97'),_0xd4c6('0x98'),_0xd4c6('0x99')];var _0x3c24d2=_0x4e7a0d[_0xd4c6('0x9a')](_0x116dae);return db['Dynamics365Account'][_0xd4c6('0x4f')]({'where':{'id':_0x5e060d['params']['id']},'attributes':['id',_0xd4c6('0x9b'),_0xd4c6('0x9c'),_0xd4c6('0x9d'),_0xd4c6('0x9e'),_0xd4c6('0x9f'),_0xd4c6('0xa0')]})[_0xd4c6('0x26')](handleEntityNotFound(_0x1ade87,null))[_0xd4c6('0x26')](function(_0x235bdc){if(_0x235bdc){_0x247ad3=_0x235bdc['remoteUri'];var _0x4d2795=_0x247ad3['slice'](-0x1);if(_0x4d2795==='/'){_0x247ad3=_0x247ad3[_0xd4c6('0xa1')](0x0,_0x247ad3[_0xd4c6('0xa2')](_0x4d2795));}_0x1b30f1=util[_0xd4c6('0xa3')](_0xd4c6('0xa4'),_0x247ad3);var _0x758c63={'method':_0xd4c6('0xa5'),'uri':_0xd4c6('0xa6')+_0x235bdc['tenantId']+_0xd4c6('0xa7'),'form':{'client_id':_0x235bdc[_0xd4c6('0x9f')],'resource':_0x247ad3,'username':_0x235bdc['username'],'password':_0x235bdc[_0xd4c6('0x9c')],'grant_type':_0xd4c6('0x9c'),'client_secret':_0x235bdc['clientSecret']},'json':!![]};return rp(_0x758c63);}})['then'](function(_0x48ee36){_0x237255=_0x48ee36[_0xd4c6('0xa8')];var _0x230520={'method':'GET','uri':encodeURI(_0x1b30f1+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x403497+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x237255,'If-None-Match':null,'OData-Version':_0xd4c6('0xa9')},'json':!![]};return rp(_0x230520);})[_0xd4c6('0x26')](function(_0x3ae5d4){var _0x3e5849=_0x3ae5d4['value'][0x0];var _0x451353=_0x3e5849[_0xd4c6('0xaa')];var _0x58d34c={'method':_0xd4c6('0xab'),'uri':_0x1b30f1+_0xd4c6('0xac')+_0x451353+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x237255,'If-None-Match':null,'OData-Version':_0xd4c6('0xa9')},'json':!![]};return rp(_0x58d34c);})[_0xd4c6('0x26')](function(_0x3d0329){_0xad0f30=_0x3d0329;_0x589f80=_0xad0f30['Attributes'];_0x589f80=_[_0xd4c6('0xad')](_0x589f80,function(_0x567398){return!_0x3c24d2[_0xd4c6('0xae')](_0x567398[_0xd4c6('0xaf')]);});var _0x371181=[];var _0xb71f19=[];_0x589f80['forEach'](function(_0x4c5c1f){if(_0x4c5c1f[_0xd4c6('0xb0')]){var _0x5d787d=_0x4c5c1f[_0xd4c6('0xb0')][_0xd4c6('0xa1')](_0x4c5c1f['@odata.type'][_0xd4c6('0xa2')]('.')+0x1);if(_0x5d787d===_0xd4c6('0xb1')){_0x371181[_0xd4c6('0xb2')](getSelectList(_0x1b30f1,_0x5941b9,_0xb71f19,_0xad0f30['MetadataId'],_0x4c5c1f['MetadataId'],_0x237255));}}});return Promise[_0xd4c6('0xb3')](_0x371181);})[_0xd4c6('0x26')](function(_0x35dbb2){_0x1678aa=_0x35dbb2[0x0];var _0x4763ec=[];var _0x1fa945=[];_0x589f80[_0xd4c6('0xb4')](function(_0x1db94e){if(!_[_0xd4c6('0xb5')](_0x1db94e[_0xd4c6('0xb0')])){var _0x157a70=_0x1db94e[_0xd4c6('0xb0')][_0xd4c6('0xa1')](_0x1db94e[_0xd4c6('0xb0')]['lastIndexOf']('.')+0x1);if(_0x157a70==='BooleanAttributeMetadata'){_0x4763ec[_0xd4c6('0xb2')](getBooleanList(_0x1b30f1,_0x5941b9,_0x1fa945,_0xad0f30['MetadataId'],_0x1db94e[_0xd4c6('0xaa')],_0x237255));}}});return Promise[_0xd4c6('0xb3')](_0x4763ec);})[_0xd4c6('0x26')](function(_0x1b91a1){_0x3c1d6c=_0x1b91a1[0x0];var _0x23461a=[];var _0x2f01e6=[];_0x589f80[_0xd4c6('0xb4')](function(_0x5b44f8){if(_0x5b44f8[_0xd4c6('0xb0')]){var _0x1861ac=_0x5b44f8[_0xd4c6('0xb0')]['substring'](_0x5b44f8[_0xd4c6('0xb0')][_0xd4c6('0xa2')]('.')+0x1);if(_0x1861ac===_0xd4c6('0xb6')||_0x1861ac===_0xd4c6('0xb7')||_0x1861ac===_0xd4c6('0xb8')||_0x1861ac===_0xd4c6('0xb9')||_0x1861ac===_0xd4c6('0xba')||_0x1861ac===_0xd4c6('0xbb')||_0x1861ac===_0xd4c6('0xbc')||_0x1861ac===_0xd4c6('0xbd')||_0x1861ac===_0xd4c6('0xbe')||_0x1861ac===_0xd4c6('0xbf')){_0x23461a[_0xd4c6('0xb2')](getInputList(_0x1b30f1,_0x5941b9,_0x1861ac,_0x2f01e6,_0xad0f30[_0xd4c6('0xaa')],_0x5b44f8[_0xd4c6('0xaa')],_0x237255));}}});return Promise[_0xd4c6('0xb3')](_0x23461a);})['then'](function(_0x108178){_0x4ab66a=_0x108178[0x0];var _0x4931a0=_0x1678aa[_0xd4c6('0x9a')](_0x3c1d6c)[_0xd4c6('0x9a')](_0x4ab66a);var _0x1fb876={'count':_0x4931a0[_0xd4c6('0x4c')],'rows':_0x4931a0};return _0x1fb876;})[_0xd4c6('0x26')](respondWithResult(_0x1ade87,null))[_0xd4c6('0x41')](function(_0x140c80){var _0x49bb8d=_0x5e060d[_0xd4c6('0x31')]['test']?0x1f4:_0x140c80[_0xd4c6('0xc0')]||0x1f4;logger['error'](_0x140c80[_0xd4c6('0x27')]);delete _0x140c80[_0xd4c6('0x28')];if(_0x49bb8d===0x191){_0x49bb8d=0x190;}_0x1ade87['status'](_0x49bb8d)[_0xd4c6('0x29')](_0x5e060d[_0xd4c6('0x31')][_0xd4c6('0xc1')]?{'message':_0xd4c6('0xc2'),'statusCode':_0x140c80[_0xd4c6('0xc0')]}:_0x140c80);});};function getSelectList(_0x3ecf66,_0x2d73f5,_0xdb73c1,_0x437cac,_0x4a8d5f,_0x144907){var _0x599759={'method':'GET','uri':_0x3ecf66+_0xd4c6('0xac')+_0x437cac+_0xd4c6('0xc3')+_0x4a8d5f+_0xd4c6('0xc4')+_0xd4c6('0xc5'),'headers':{'Authorization':_0xd4c6('0xc6')+_0x144907,'If-None-Match':null,'OData-Version':_0xd4c6('0xa9')},'json':!![]};return rp(_0x599759)[_0xd4c6('0x26')](function(_0xe41b8a){var _0x31a7cf=[];var _0x2a9379=_0xe41b8a[_0xd4c6('0xc7')][_0xd4c6('0xc8')];_0x2a9379[_0xd4c6('0xb4')](function(_0x22870d){_0x31a7cf[_0xd4c6('0xb2')]({'name':_0x22870d[_0xd4c6('0xc9')][_0xd4c6('0xca')][_0xd4c6('0xc9')],'value':String(_0x22870d[_0xd4c6('0xcb')])});});var _0x174e8a={'id':_0x2d73f5+'_'+_0xe41b8a[_0xd4c6('0xaf')],'name':_0xe41b8a[_0xd4c6('0xcc')][_0xd4c6('0xca')]['Label'],'custom':![],'options':_0x31a7cf};_0xdb73c1[_0xd4c6('0xb2')](_0x174e8a);return _0xdb73c1;});}function getBooleanList(_0xd91b9e,_0x3149fd,_0x9b0ba6,_0x16d891,_0x2ead6a,_0x3c573e){var _0x2c0aa0={'method':_0xd4c6('0xab'),'uri':_0xd91b9e+_0xd4c6('0xac')+_0x16d891+_0xd4c6('0xc3')+_0x2ead6a+_0xd4c6('0xcd'),'headers':{'Authorization':_0xd4c6('0xc6')+_0x3c573e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2c0aa0)[_0xd4c6('0x26')](function(_0x3a2656){var _0x183fac=[];_0x183fac['push']({'name':_0x3a2656['OptionSet'][_0xd4c6('0xce')][_0xd4c6('0xc9')][_0xd4c6('0xca')][_0xd4c6('0xc9')],'value':_0xd4c6('0xcf')},{'name':_0x3a2656['OptionSet'][_0xd4c6('0xd0')]['Label'][_0xd4c6('0xca')][_0xd4c6('0xc9')],'value':_0xd4c6('0xd1')});var _0x50c8cb={'id':_0x3149fd+'_'+_0x3a2656[_0xd4c6('0xaf')],'name':_0x3a2656['DisplayName'][_0xd4c6('0xca')][_0xd4c6('0xc9')],'custom':![],'options':_0x183fac};_0x9b0ba6[_0xd4c6('0xb2')](_0x50c8cb);return _0x9b0ba6;});}function getInputList(_0x5b3a77,_0x524467,_0x501296,_0x1281a0,_0x2d99ef,_0x36d967,_0x5d9435){var _0x1f1114={'method':'GET','uri':_0x5b3a77+_0xd4c6('0xac')+_0x2d99ef+_0xd4c6('0xc3')+_0x36d967+')/Microsoft.Dynamics.CRM.'+_0x501296+_0xd4c6('0xd2'),'headers':{'Authorization':_0xd4c6('0xc6')+_0x5d9435,'If-None-Match':null,'OData-Version':_0xd4c6('0xa9')},'json':!![]};return rp(_0x1f1114)['then'](function(_0x22a944){var _0x1d5ff1={'id':_0x524467+'_'+_0x22a944[_0xd4c6('0xaf')],'name':_0x22a944['DisplayName']['UserLocalizedLabel']?_0x22a944['DisplayName'][_0xd4c6('0xca')][_0xd4c6('0xc9')]:_0x22a944[_0xd4c6('0xaf')],'custom':![],'options':[]};_0x1281a0[_0xd4c6('0xb2')](_0x1d5ff1);return _0x1281a0;});}
\ No newline at end of file
index 1154485..ffdaf32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x2fdea9,_0x1bc031){var _0x3b26b2=function(_0x394011){while(--_0x394011){_0x2fdea9['push'](_0x2fdea9['shift']());}};_0x3b26b2(++_0x1bc031);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0xcb91[_0x420b24];return _0x4da552;};'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'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x212ab6,_0x4e48cf){var _0x56073a=function(_0x4f1a98){while(--_0x4f1a98){_0x212ab6['push'](_0x212ab6['shift']());}};_0x56073a(++_0x4e48cf);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 42d4292..f2688d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52c1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','then','ShowDynamics365Account','lodash','moment','bluebird'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x52c1,0x1e7));var _0x152c=function(_0x36d9fd,_0x2f174c){_0x36d9fd=_0x36d9fd-0x0;var _0x5e13ee=_0x52c1[_0x36d9fd];return _0x5e13ee;};'use strict';var _=require(_0x152c('0x0'));var util=require('util');var moment=require(_0x152c('0x1'));var BPromise=require(_0x152c('0x2'));var rs=require(_0x152c('0x3'));var fs=require('fs');var Redis=require(_0x152c('0x4'));var db=require(_0x152c('0x5'))['db'];var utils=require(_0x152c('0x6'));var logger=require(_0x152c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x152c('0x8'));var client=jayson[_0x152c('0x9')][_0x152c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22be79,_0x4f6439,_0x7fbbdd){return new BPromise(function(_0x37bb12,_0x36c8ac){return client[_0x152c('0xb')](_0x22be79,_0x7fbbdd)['then'](function(_0x19c81e){logger[_0x152c('0xc')](_0x152c('0xd'),_0x4f6439,_0x152c('0xe'));logger[_0x152c('0xf')](_0x152c('0x10'),_0x4f6439,'request\x20sent',JSON[_0x152c('0x11')](_0x19c81e));if(_0x19c81e[_0x152c('0x12')]){if(_0x19c81e[_0x152c('0x12')][_0x152c('0x13')]===0x1f4){logger['error'](_0x152c('0xd'),_0x4f6439,_0x19c81e['error'][_0x152c('0x14')]);return _0x36c8ac(_0x19c81e[_0x152c('0x12')]['message']);}logger[_0x152c('0x12')](_0x152c('0xd'),_0x4f6439,_0x19c81e[_0x152c('0x12')][_0x152c('0x14')]);return _0x37bb12(_0x19c81e[_0x152c('0x12')][_0x152c('0x14')]);}else{logger['info'](_0x152c('0xd'),_0x4f6439,'request\x20sent');_0x37bb12(_0x19c81e[_0x152c('0x15')]['message']);}})[_0x152c('0x16')](function(_0x253734){logger[_0x152c('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x4f6439,_0x253734);_0x36c8ac(_0x253734);});});}exports[_0x152c('0x17')]=function(_0x32cb15){var _0x2ae02f=this;return new Promise(function(_0x37f6ab,_0x405b5f){return db[_0x152c('0x18')][_0x152c('0x19')]({'raw':_0x32cb15[_0x152c('0x1a')]?_0x32cb15[_0x152c('0x1a')][_0x152c('0x1b')]===undefined?!![]:![]:!![],'where':_0x32cb15[_0x152c('0x1a')]?_0x32cb15[_0x152c('0x1a')][_0x152c('0x1c')]||null:null,'attributes':_0x32cb15['options']?_0x32cb15[_0x152c('0x1a')][_0x152c('0x1d')]||null:null,'limit':_0x32cb15['options']?_0x32cb15[_0x152c('0x1a')]['limit']||null:null,'include':_0x32cb15[_0x152c('0x1a')]?_0x32cb15[_0x152c('0x1a')][_0x152c('0x1e')]?_[_0x152c('0x1f')](_0x32cb15['options']['include'],function(_0x1d6070){return{'model':db[_0x1d6070[_0x152c('0x20')]],'as':_0x1d6070['as'],'attributes':_0x1d6070[_0x152c('0x1d')],'include':_0x1d6070[_0x152c('0x1e')]?_[_0x152c('0x1f')](_0x1d6070['include'],function(_0x453344){return{'model':db[_0x453344[_0x152c('0x20')]],'as':_0x453344['as'],'attributes':_0x453344[_0x152c('0x1d')],'include':_0x453344[_0x152c('0x1e')]?_[_0x152c('0x1f')](_0x453344[_0x152c('0x1e')],function(_0x4e2ff9){return{'model':db[_0x4e2ff9['model']],'as':_0x4e2ff9['as'],'attributes':_0x4e2ff9[_0x152c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x152c('0x21')](function(_0x341e34){logger[_0x152c('0xc')](_0x152c('0x17'),_0x32cb15);logger['debug']('GetDynamics365Account',_0x32cb15,JSON[_0x152c('0x11')](_0x341e34));_0x37f6ab(_0x341e34);})[_0x152c('0x16')](function(_0x271e8b){logger[_0x152c('0x12')](_0x152c('0x17'),_0x271e8b[_0x152c('0x14')],_0x32cb15);_0x405b5f(_0x2ae02f[_0x152c('0x12')](0x1f4,_0x271e8b[_0x152c('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x2daa60){var _0x5414fb=this;return new Promise(function(_0x33ef99,_0x390769){return db[_0x152c('0x18')]['find']({'raw':_0x2daa60['options']?_0x2daa60[_0x152c('0x1a')][_0x152c('0x1b')]===undefined?!![]:![]:!![],'where':_0x2daa60[_0x152c('0x1a')]?_0x2daa60[_0x152c('0x1a')][_0x152c('0x1c')]||null:null,'attributes':_0x2daa60[_0x152c('0x1a')]?_0x2daa60['options'][_0x152c('0x1d')]||null:null,'include':_0x2daa60[_0x152c('0x1a')]?_0x2daa60[_0x152c('0x1a')]['include']?_['map'](_0x2daa60[_0x152c('0x1a')]['include'],function(_0x1240b6){return{'model':db[_0x1240b6[_0x152c('0x20')]],'as':_0x1240b6['as'],'attributes':_0x1240b6[_0x152c('0x1d')],'include':_0x1240b6['include']?_[_0x152c('0x1f')](_0x1240b6[_0x152c('0x1e')],function(_0x1481c0){return{'model':db[_0x1481c0[_0x152c('0x20')]],'as':_0x1481c0['as'],'attributes':_0x1481c0['attributes'],'include':_0x1481c0[_0x152c('0x1e')]?_[_0x152c('0x1f')](_0x1481c0[_0x152c('0x1e')],function(_0x56c36f){return{'model':db[_0x56c36f['model']],'as':_0x56c36f['as'],'attributes':_0x56c36f[_0x152c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x152c('0x21')](function(_0x5106e9){logger['info'](_0x152c('0x22'),_0x2daa60);logger[_0x152c('0xf')](_0x152c('0x22'),_0x2daa60,JSON['stringify'](_0x5106e9));_0x33ef99(_0x5106e9);})[_0x152c('0x16')](function(_0xf6af17){logger['error'](_0x152c('0x22'),_0xf6af17[_0x152c('0x14')],_0x2daa60);_0x390769(_0x5414fb['error'](0x1f4,_0xf6af17['message']));});});};
\ No newline at end of file
+var _0x1997=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','include','model','map','debug','stringify','ShowDynamics365Account','find','lodash','util','moment'];(function(_0x410adc,_0x681bef){var _0x10044b=function(_0x11dd57){while(--_0x11dd57){_0x410adc['push'](_0x410adc['shift']());}};_0x10044b(++_0x681bef);}(_0x1997,0x69));var _0x7199=function(_0x1167bf,_0x1ab12f){_0x1167bf=_0x1167bf-0x0;var _0x4209e8=_0x1997[_0x1167bf];return _0x4209e8;};'use strict';var _=require(_0x7199('0x0'));var util=require(_0x7199('0x1'));var moment=require(_0x7199('0x2'));var BPromise=require(_0x7199('0x3'));var rs=require(_0x7199('0x4'));var fs=require('fs');var Redis=require(_0x7199('0x5'));var db=require(_0x7199('0x6'))['db'];var utils=require(_0x7199('0x7'));var logger=require('../../config/logger')(_0x7199('0x8'));var config=require(_0x7199('0x9'));var jayson=require(_0x7199('0xa'));var client=jayson[_0x7199('0xb')][_0x7199('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b37cb,_0x3f53ab,_0x2335d7){return new BPromise(function(_0x35d3be,_0x4a9a0d){return client[_0x7199('0xd')](_0x5b37cb,_0x2335d7)[_0x7199('0xe')](function(_0x34600f){logger[_0x7199('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x3f53ab,_0x7199('0x10'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x3f53ab,_0x7199('0x10'),JSON['stringify'](_0x34600f));if(_0x34600f[_0x7199('0x11')]){if(_0x34600f[_0x7199('0x11')][_0x7199('0x12')]===0x1f4){logger[_0x7199('0x11')](_0x7199('0x13'),_0x3f53ab,_0x34600f[_0x7199('0x11')][_0x7199('0x14')]);return _0x4a9a0d(_0x34600f[_0x7199('0x11')][_0x7199('0x14')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x3f53ab,_0x34600f[_0x7199('0x11')][_0x7199('0x14')]);return _0x35d3be(_0x34600f[_0x7199('0x11')][_0x7199('0x14')]);}else{logger['info'](_0x7199('0x13'),_0x3f53ab,'request\x20sent');_0x35d3be(_0x34600f[_0x7199('0x15')]['message']);}})[_0x7199('0x16')](function(_0x1d4ed7){logger[_0x7199('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x3f53ab,_0x1d4ed7);_0x4a9a0d(_0x1d4ed7);});});}exports[_0x7199('0x17')]=function(_0x4ff7a5){var _0x3ef61d=this;return new Promise(function(_0x1c483d,_0x54c1bf){return db[_0x7199('0x18')]['findAll']({'raw':_0x4ff7a5[_0x7199('0x19')]?_0x4ff7a5[_0x7199('0x19')][_0x7199('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ff7a5[_0x7199('0x19')]?_0x4ff7a5[_0x7199('0x19')][_0x7199('0x1b')]||null:null,'attributes':_0x4ff7a5[_0x7199('0x19')]?_0x4ff7a5[_0x7199('0x19')][_0x7199('0x1c')]||null:null,'limit':_0x4ff7a5[_0x7199('0x19')]?_0x4ff7a5[_0x7199('0x19')]['limit']||null:null,'include':_0x4ff7a5[_0x7199('0x19')]?_0x4ff7a5[_0x7199('0x19')][_0x7199('0x1d')]?_['map'](_0x4ff7a5[_0x7199('0x19')]['include'],function(_0x249b5d){return{'model':db[_0x249b5d[_0x7199('0x1e')]],'as':_0x249b5d['as'],'attributes':_0x249b5d['attributes'],'include':_0x249b5d[_0x7199('0x1d')]?_['map'](_0x249b5d[_0x7199('0x1d')],function(_0x111fb5){return{'model':db[_0x111fb5[_0x7199('0x1e')]],'as':_0x111fb5['as'],'attributes':_0x111fb5[_0x7199('0x1c')],'include':_0x111fb5[_0x7199('0x1d')]?_[_0x7199('0x1f')](_0x111fb5[_0x7199('0x1d')],function(_0x397d5e){return{'model':db[_0x397d5e['model']],'as':_0x397d5e['as'],'attributes':_0x397d5e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x191d16){logger[_0x7199('0xf')](_0x7199('0x17'),_0x4ff7a5);logger[_0x7199('0x20')](_0x7199('0x17'),_0x4ff7a5,JSON[_0x7199('0x21')](_0x191d16));_0x1c483d(_0x191d16);})[_0x7199('0x16')](function(_0x50b8e6){logger['error'](_0x7199('0x17'),_0x50b8e6[_0x7199('0x14')],_0x4ff7a5);_0x54c1bf(_0x3ef61d[_0x7199('0x11')](0x1f4,_0x50b8e6[_0x7199('0x14')]));});});};exports[_0x7199('0x22')]=function(_0x310604){var _0xd2a114=this;return new Promise(function(_0x32b760,_0x4d0929){return db[_0x7199('0x18')][_0x7199('0x23')]({'raw':_0x310604[_0x7199('0x19')]?_0x310604[_0x7199('0x19')][_0x7199('0x1a')]===undefined?!![]:![]:!![],'where':_0x310604[_0x7199('0x19')]?_0x310604[_0x7199('0x19')][_0x7199('0x1b')]||null:null,'attributes':_0x310604['options']?_0x310604['options']['attributes']||null:null,'include':_0x310604[_0x7199('0x19')]?_0x310604[_0x7199('0x19')][_0x7199('0x1d')]?_[_0x7199('0x1f')](_0x310604['options'][_0x7199('0x1d')],function(_0x1e9148){return{'model':db[_0x1e9148[_0x7199('0x1e')]],'as':_0x1e9148['as'],'attributes':_0x1e9148[_0x7199('0x1c')],'include':_0x1e9148[_0x7199('0x1d')]?_[_0x7199('0x1f')](_0x1e9148[_0x7199('0x1d')],function(_0x13b1c6){return{'model':db[_0x13b1c6[_0x7199('0x1e')]],'as':_0x13b1c6['as'],'attributes':_0x13b1c6[_0x7199('0x1c')],'include':_0x13b1c6[_0x7199('0x1d')]?_[_0x7199('0x1f')](_0x13b1c6['include'],function(_0x2b21d7){return{'model':db[_0x2b21d7[_0x7199('0x1e')]],'as':_0x2b21d7['as'],'attributes':_0x2b21d7[_0x7199('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7199('0xe')](function(_0x233e76){logger[_0x7199('0xf')](_0x7199('0x22'),_0x310604);logger[_0x7199('0x20')](_0x7199('0x22'),_0x310604,JSON['stringify'](_0x233e76));_0x32b760(_0x233e76);})['catch'](function(_0x2f019b){logger['error'](_0x7199('0x22'),_0x2f019b[_0x7199('0x14')],_0x310604);_0x4d0929(_0xd2a114[_0x7199('0x11')](0x1f4,_0x2f019b['message']));});});};
\ No newline at end of file
index 736ac15..81e3087 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb79a=['create','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post'];(function(_0x5eb496,_0x25bc44){var _0x4f513a=function(_0x4e2351){while(--_0x4e2351){_0x5eb496['push'](_0x5eb496['shift']());}};_0x4f513a(++_0x25bc44);}(_0xb79a,0x18e));var _0xab79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb79a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xab79('0x0'));var util=require(_0xab79('0x1'));var path=require('path');var timeout=require(_0xab79('0x2'));var express=require(_0xab79('0x3'));var router=express[_0xab79('0x4')]();var fs_extra=require(_0xab79('0x5'));var auth=require(_0xab79('0x6'));var interaction=require(_0xab79('0x7'));var config=require(_0xab79('0x8'));var controller=require(_0xab79('0x9'));router['get']('/',auth[_0xab79('0xa')](),controller['index']);router[_0xab79('0xb')](_0xab79('0xc'),auth[_0xab79('0xa')](),controller[_0xab79('0xd')]);router[_0xab79('0xb')](_0xab79('0xe'),auth[_0xab79('0xa')](),controller[_0xab79('0xf')]);router[_0xab79('0xb')](_0xab79('0x10'),auth[_0xab79('0xa')](),controller['getSubjects']);router['get'](_0xab79('0x11'),auth[_0xab79('0xa')](),controller[_0xab79('0x12')]);router[_0xab79('0x13')]('/',auth[_0xab79('0xa')](),controller[_0xab79('0x14')]);router['put']('/:id',auth[_0xab79('0xa')](),controller['update']);router[_0xab79('0x15')](_0xab79('0xc'),auth[_0xab79('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x40be=['getFields','/:id/subjects','getDescriptions','post','put','/:id','update','delete','destroy','exports','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields'];(function(_0x3253a1,_0x5c8d0a){var _0x38c883=function(_0x34e5fe){while(--_0x34e5fe){_0x3253a1['push'](_0x3253a1['shift']());}};_0x38c883(++_0x5c8d0a);}(_0x40be,0x14d));var _0xe40b=function(_0x27a3cc,_0x5d50f5){_0x27a3cc=_0x27a3cc-0x0;var _0x3016d3=_0x40be[_0x27a3cc];return _0x3016d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe40b('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe40b('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0xe40b('0x2'));var config=require(_0xe40b('0x3'));var controller=require('./intDynamics365Configuration.controller');router[_0xe40b('0x4')]('/',auth[_0xe40b('0x5')](),controller[_0xe40b('0x6')]);router[_0xe40b('0x4')]('/:id',auth[_0xe40b('0x5')](),controller[_0xe40b('0x7')]);router['get'](_0xe40b('0x8'),auth[_0xe40b('0x5')](),controller[_0xe40b('0x9')]);router[_0xe40b('0x4')](_0xe40b('0xa'),auth[_0xe40b('0x5')](),controller['getSubjects']);router[_0xe40b('0x4')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe40b('0xb')]);router[_0xe40b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe40b('0xd')](_0xe40b('0xe'),auth[_0xe40b('0x5')](),controller[_0xe40b('0xf')]);router[_0xe40b('0x10')](_0xe40b('0xe'),auth[_0xe40b('0x5')](),controller[_0xe40b('0x11')]);module[_0xe40b('0x12')]=router;
\ No newline at end of file
index 6b7d215..122950f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9eaa=['ENUM','incident','phonecall','sequelize'];(function(_0x246194,_0x27cdd9){var _0x4fed0e=function(_0x5a92bc){while(--_0x5a92bc){_0x246194['push'](_0x246194['shift']());}};_0x4fed0e(++_0x27cdd9);}(_0x9eaa,0x1bb));var _0xa9ea=function(_0x3009f1,_0x2f8f44){_0x3009f1=_0x3009f1-0x0;var _0x397129=_0x9eaa[_0x3009f1];return _0x397129;};'use strict';var Sequelize=require(_0xa9ea('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xa9ea('0x1')](_0xa9ea('0x2'),_0xa9ea('0x3')),'defaultValue':_0xa9ea('0x2')}};
\ No newline at end of file
+var _0xec6d=['exports','STRING','incident','phonecall','sequelize'];(function(_0x3dbd8d,_0x294d66){var _0x3edcf7=function(_0x439029){while(--_0x439029){_0x3dbd8d['push'](_0x3dbd8d['shift']());}};_0x3edcf7(++_0x294d66);}(_0xec6d,0x1a8));var _0xdec6=function(_0x27855d,_0x41e7ff){_0x27855d=_0x27855d-0x0;var _0x16efa7=_0xec6d[_0x27855d];return _0x16efa7;};'use strict';var Sequelize=require(_0xdec6('0x0'));module[_0xdec6('0x1')]={'name':{'type':Sequelize[_0xdec6('0x2')]},'description':{'type':Sequelize[_0xdec6('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xdec6('0x3'),_0xdec6('0x4')),'defaultValue':_0xdec6('0x3')}};
\ No newline at end of file
index 2691fcb..81f0afb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e7a=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','offset','count','set','Content-Range','json','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','params','keys','length','includeAll','create','body','find','getFields','findOne','Dynamics365Field','sort','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x4f18b2,_0x48d20f){var _0x5d2a20=function(_0x20dc81){while(--_0x20dc81){_0x4f18b2['push'](_0x4f18b2['shift']());}};_0x5d2a20(++_0x48d20f);}(_0x2e7a,0x9e));var _0xa2e7=function(_0x43236e,_0xf0da48){_0x43236e=_0x43236e-0x0;var _0x4aa7be=_0x2e7a[_0x43236e];return _0x4aa7be;};'use strict';var emlformat=require(_0xa2e7('0x0'));var rimraf=require(_0xa2e7('0x1'));var zipdir=require(_0xa2e7('0x2'));var jsonpatch=require(_0xa2e7('0x3'));var rp=require(_0xa2e7('0x4'));var moment=require('moment');var BPromise=require(_0xa2e7('0x5'));var Mustache=require(_0xa2e7('0x6'));var util=require(_0xa2e7('0x7'));var path=require(_0xa2e7('0x8'));var sox=require(_0xa2e7('0x9'));var csv=require(_0xa2e7('0xa'));var ejs=require(_0xa2e7('0xb'));var fs=require('fs');var fs_extra=require(_0xa2e7('0xc'));var _=require(_0xa2e7('0xd'));var squel=require(_0xa2e7('0xe'));var crypto=require(_0xa2e7('0xf'));var jsforce=require(_0xa2e7('0x10'));var deskjs=require(_0xa2e7('0x11'));var toCsv=require(_0xa2e7('0xa'));var querystring=require(_0xa2e7('0x12'));var Papa=require(_0xa2e7('0x13'));var Redis=require(_0xa2e7('0x14'));var authService=require(_0xa2e7('0x15'));var qs=require(_0xa2e7('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2e7('0x17'))(_0xa2e7('0x18'));var utils=require(_0xa2e7('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xa2e7('0x1a'));var db=require(_0xa2e7('0x1b'))['db'];function respondWithStatusCode(_0x32258c,_0x454a89){_0x454a89=_0x454a89||0xcc;return function(_0x4712cb){if(_0x4712cb){return _0x32258c['sendStatus'](_0x454a89);}return _0x32258c[_0xa2e7('0x1c')](_0x454a89)[_0xa2e7('0x1d')]();};}function respondWithResult(_0x4dc5e4,_0x47f157){_0x47f157=_0x47f157||0xc8;return function(_0x23b4c1){if(_0x23b4c1){return _0x4dc5e4['status'](_0x47f157)['json'](_0x23b4c1);}};}function respondWithFilteredResult(_0x3bcf20,_0x243428){return function(_0x4e7f1b){if(_0x4e7f1b){var _0x4bae01=typeof _0x243428['offset']===_0xa2e7('0x1e')&&typeof _0x243428['limit']===_0xa2e7('0x1e');var _0x283313=_0x4e7f1b['count'];var _0xaa6671=_0x4bae01?0x0:_0x243428[_0xa2e7('0x1f')];var _0x4ac1a3=_0x4bae01?_0x4e7f1b[_0xa2e7('0x20')]:_0x243428['offset']+_0x243428['limit'];var _0x24f5b9;if(_0x4ac1a3>=_0x283313){_0x4ac1a3=_0x283313;_0x24f5b9=0xc8;}else{_0x24f5b9=0xce;}_0x3bcf20[_0xa2e7('0x1c')](_0x24f5b9);return _0x3bcf20[_0xa2e7('0x21')](_0xa2e7('0x22'),_0xaa6671+'-'+_0x4ac1a3+'/'+_0x283313)[_0xa2e7('0x23')](_0x4e7f1b);}return null;};}function patchUpdates(_0x3d4cde){return function(_0x728c02){try{jsonpatch['apply'](_0x728c02,_0x3d4cde,!![]);}catch(_0x5ce486){return BPromise['reject'](_0x5ce486);}return _0x728c02[_0xa2e7('0x24')]();};}function saveUpdates(_0xc5893c,_0x28819a){return function(_0x4d5821){if(_0x4d5821){return _0x4d5821[_0xa2e7('0x25')](_0xc5893c)[_0xa2e7('0x26')](function(_0x51f5ee){return _0x51f5ee;});}return null;};}function removeEntity(_0x21c97e,_0x23883c){return function(_0x233609){if(_0x233609){return _0x233609[_0xa2e7('0x27')]()[_0xa2e7('0x26')](function(){_0x21c97e['status'](0xcc)[_0xa2e7('0x1d')]();});}};}function handleEntityNotFound(_0x19144c,_0x27dae1){return function(_0xfdd58){if(!_0xfdd58){_0x19144c[_0xa2e7('0x28')](0x194);}return _0xfdd58;};}function handleError(_0x41495a,_0x48f9e7){_0x48f9e7=_0x48f9e7||0x1f4;return function(_0x16b073){logger[_0xa2e7('0x29')](_0x16b073[_0xa2e7('0x2a')]);if(_0x16b073['name']){delete _0x16b073[_0xa2e7('0x2b')];}_0x41495a['status'](_0x48f9e7)[_0xa2e7('0x2c')](_0x16b073);};}exports[_0xa2e7('0x2d')]=function(_0x3fc352,_0x5bf2a5){var _0x13808d={},_0xe43be1={},_0x1a5d2c={'count':0x0,'rows':[]};var _0x5365ed=_[_0xa2e7('0x2e')](db[_0xa2e7('0x2f')][_0xa2e7('0x30')],function(_0x1ccfd1){return{'name':_0x1ccfd1[_0xa2e7('0x31')],'type':_0x1ccfd1[_0xa2e7('0x32')][_0xa2e7('0x33')]};});_0xe43be1[_0xa2e7('0x34')]=_['map'](_0x5365ed,'name');_0xe43be1[_0xa2e7('0x35')]=_['keys'](_0x3fc352[_0xa2e7('0x35')]);_0xe43be1['filters']=_[_0xa2e7('0x36')](_0xe43be1[_0xa2e7('0x34')],_0xe43be1[_0xa2e7('0x35')]);_0x13808d[_0xa2e7('0x37')]=_[_0xa2e7('0x36')](_0xe43be1[_0xa2e7('0x34')],qs[_0xa2e7('0x38')](_0x3fc352['query']['fields']));_0x13808d['attributes']=_0x13808d['attributes']['length']?_0x13808d[_0xa2e7('0x37')]:_0xe43be1[_0xa2e7('0x34')];if(!_0x3fc352[_0xa2e7('0x35')][_0xa2e7('0x39')](_0xa2e7('0x3a'))){_0x13808d['limit']=qs[_0xa2e7('0x3b')](_0x3fc352[_0xa2e7('0x35')][_0xa2e7('0x3b')]);_0x13808d[_0xa2e7('0x1f')]=qs[_0xa2e7('0x1f')](_0x3fc352['query'][_0xa2e7('0x1f')]);}_0x13808d[_0xa2e7('0x3c')]=qs['sort'](_0x3fc352[_0xa2e7('0x35')]['sort']);_0x13808d[_0xa2e7('0x3d')]=qs[_0xa2e7('0x3e')](_[_0xa2e7('0x3f')](_0x3fc352[_0xa2e7('0x35')],_0xe43be1[_0xa2e7('0x3e')]),_0x5365ed);if(_0x3fc352[_0xa2e7('0x35')][_0xa2e7('0x40')]){_0x13808d[_0xa2e7('0x3d')]=_['merge'](_0x13808d[_0xa2e7('0x3d')],{'$or':_['map'](_0x5365ed,function(_0x29cbbd){if(_0x29cbbd[_0xa2e7('0x32')]!==_0xa2e7('0x41')){var _0x20c7f0={};_0x20c7f0[_0x29cbbd['name']]={'$like':'%'+_0x3fc352[_0xa2e7('0x35')][_0xa2e7('0x40')]+'%'};return _0x20c7f0;}})});}_0x13808d=_[_0xa2e7('0x42')]({},_0x13808d,_0x3fc352[_0xa2e7('0x43')]);var _0x3c591f={'where':_0x13808d[_0xa2e7('0x3d')]};return db[_0xa2e7('0x2f')][_0xa2e7('0x20')](_0x3c591f)[_0xa2e7('0x26')](function(_0x5d735e){_0x1a5d2c[_0xa2e7('0x20')]=_0x5d735e;if(_0x3fc352[_0xa2e7('0x35')]['includeAll']){_0x13808d[_0xa2e7('0x44')]=[{'all':!![]}];}return db[_0xa2e7('0x2f')]['findAll'](_0x13808d);})[_0xa2e7('0x26')](function(_0x5c1344){_0x1a5d2c[_0xa2e7('0x45')]=_0x5c1344;return _0x1a5d2c;})[_0xa2e7('0x26')](respondWithFilteredResult(_0x5bf2a5,_0x13808d))[_0xa2e7('0x46')](handleError(_0x5bf2a5,null));};exports['show']=function(_0x269a61,_0x53b7d0){var _0x126b31={'raw':![],'where':{'id':_0x269a61[_0xa2e7('0x47')]['id']}},_0x290691={};_0x290691[_0xa2e7('0x34')]=_[_0xa2e7('0x48')](db[_0xa2e7('0x2f')]['rawAttributes']);_0x290691[_0xa2e7('0x35')]=_[_0xa2e7('0x48')](_0x269a61[_0xa2e7('0x35')]);_0x290691['filters']=_['intersection'](_0x290691[_0xa2e7('0x34')],_0x290691[_0xa2e7('0x35')]);_0x126b31[_0xa2e7('0x37')]=_['intersection'](_0x290691[_0xa2e7('0x34')],qs[_0xa2e7('0x38')](_0x269a61[_0xa2e7('0x35')]['fields']));_0x126b31['attributes']=_0x126b31[_0xa2e7('0x37')][_0xa2e7('0x49')]?_0x126b31[_0xa2e7('0x37')]:_0x290691[_0xa2e7('0x34')];if(_0x269a61[_0xa2e7('0x35')][_0xa2e7('0x4a')]){_0x126b31[_0xa2e7('0x44')]=[{'all':!![]}];}_0x126b31=_[_0xa2e7('0x42')]({},_0x126b31,_0x269a61[_0xa2e7('0x43')]);return db['Dynamics365Configuration']['find'](_0x126b31)[_0xa2e7('0x26')](handleEntityNotFound(_0x53b7d0,null))[_0xa2e7('0x26')](respondWithResult(_0x53b7d0,null))[_0xa2e7('0x46')](handleError(_0x53b7d0,null));};exports['create']=function(_0x2cc5e9,_0x750a21){return db[_0xa2e7('0x2f')][_0xa2e7('0x4b')](_0x2cc5e9['body'],{})[_0xa2e7('0x26')](respondWithResult(_0x750a21,0xc9))[_0xa2e7('0x46')](handleError(_0x750a21,null));};exports[_0xa2e7('0x25')]=function(_0x29d6b6,_0x2b712c){if(_0x29d6b6[_0xa2e7('0x4c')]['id']){delete _0x29d6b6[_0xa2e7('0x4c')]['id'];}return db[_0xa2e7('0x2f')][_0xa2e7('0x4d')]({'where':{'id':_0x29d6b6[_0xa2e7('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b712c,null))[_0xa2e7('0x26')](saveUpdates(_0x29d6b6[_0xa2e7('0x4c')],null))['then'](respondWithResult(_0x2b712c,null))[_0xa2e7('0x46')](handleError(_0x2b712c,null));};exports[_0xa2e7('0x27')]=function(_0x25530e,_0x478c85){return db[_0xa2e7('0x2f')][_0xa2e7('0x4d')]({'where':{'id':_0x25530e[_0xa2e7('0x47')]['id']}})['then'](handleEntityNotFound(_0x478c85,null))[_0xa2e7('0x26')](removeEntity(_0x478c85,null))['catch'](handleError(_0x478c85,null));};exports[_0xa2e7('0x4e')]=function(_0x1e8354,_0x4ccc47,_0x39c412){var _0x3b1119={};var _0x3483b5={};var _0x194818;var _0x31b818;return db[_0xa2e7('0x2f')][_0xa2e7('0x4f')]({'where':{'id':_0x1e8354[_0xa2e7('0x47')]['id']}})[_0xa2e7('0x26')](handleEntityNotFound(_0x4ccc47,null))['then'](function(_0x16afcb){if(_0x16afcb){_0x194818=_0x16afcb;_0x3483b5['model']=_['keys'](db[_0xa2e7('0x50')][_0xa2e7('0x30')]);_0x3483b5[_0xa2e7('0x35')]=_[_0xa2e7('0x48')](_0x1e8354['query']);_0x3483b5[_0xa2e7('0x3e')]=_[_0xa2e7('0x36')](_0x3483b5[_0xa2e7('0x34')],_0x3483b5[_0xa2e7('0x35')]);_0x3b1119[_0xa2e7('0x37')]=_['intersection'](_0x3483b5['model'],qs['fields'](_0x1e8354[_0xa2e7('0x35')][_0xa2e7('0x38')]));_0x3b1119[_0xa2e7('0x37')]=_0x3b1119['attributes'][_0xa2e7('0x49')]?_0x3b1119[_0xa2e7('0x37')]:_0x3483b5[_0xa2e7('0x34')];_0x3b1119[_0xa2e7('0x3c')]=qs[_0xa2e7('0x51')](_0x1e8354[_0xa2e7('0x35')][_0xa2e7('0x51')]);_0x3b1119['where']=qs[_0xa2e7('0x3e')](_[_0xa2e7('0x3f')](_0x1e8354['query'],_0x3483b5[_0xa2e7('0x3e')]));if(_0x1e8354[_0xa2e7('0x35')]['filter']){_0x3b1119['where']=_[_0xa2e7('0x42')](_0x3b1119['where'],{'$or':_[_0xa2e7('0x2e')](_0x3b1119[_0xa2e7('0x37')],function(_0x4efb3f){var _0x1f5f07={};_0x1f5f07[_0x4efb3f]={'$like':'%'+_0x1e8354[_0xa2e7('0x35')]['filter']+'%'};return _0x1f5f07;})});}_0x3b1119=_[_0xa2e7('0x42')]({},_0x3b1119,_0x1e8354[_0xa2e7('0x43')]);return _0x194818['getFields'](_0x3b1119);}})['then'](function(_0x106818){if(_0x106818){_0x31b818=_0x106818[_0xa2e7('0x49')];if(!_0x1e8354[_0xa2e7('0x35')][_0xa2e7('0x39')](_0xa2e7('0x3a'))){_0x3b1119[_0xa2e7('0x3b')]=qs[_0xa2e7('0x3b')](_0x1e8354['query']['limit']);_0x3b1119[_0xa2e7('0x1f')]=qs[_0xa2e7('0x1f')](_0x1e8354[_0xa2e7('0x35')][_0xa2e7('0x1f')]);}return _0x194818[_0xa2e7('0x4e')](_0x3b1119);}})[_0xa2e7('0x26')](function(_0x14db6b){if(_0x14db6b){return _0x14db6b?{'count':_0x31b818,'rows':_0x14db6b}:null;}})[_0xa2e7('0x26')](respondWithResult(_0x4ccc47,null))[_0xa2e7('0x46')](handleError(_0x4ccc47,null));};exports[_0xa2e7('0x52')]=function(_0x3eb530,_0x12ca5e,_0x2e7656){var _0x212a32={};var _0x19ba17={};var _0x380b4e;var _0x10a374;return db[_0xa2e7('0x2f')]['findOne']({'where':{'id':_0x3eb530['params']['id']}})['then'](handleEntityNotFound(_0x12ca5e,null))[_0xa2e7('0x26')](function(_0x126049){if(_0x126049){_0x380b4e=_0x126049;_0x19ba17[_0xa2e7('0x34')]=_['keys'](db['Dynamics365Field'][_0xa2e7('0x30')]);_0x19ba17[_0xa2e7('0x35')]=_['keys'](_0x3eb530['query']);_0x19ba17[_0xa2e7('0x3e')]=_[_0xa2e7('0x36')](_0x19ba17['model'],_0x19ba17[_0xa2e7('0x35')]);_0x212a32[_0xa2e7('0x37')]=_['intersection'](_0x19ba17[_0xa2e7('0x34')],qs['fields'](_0x3eb530['query'][_0xa2e7('0x38')]));_0x212a32[_0xa2e7('0x37')]=_0x212a32[_0xa2e7('0x37')][_0xa2e7('0x49')]?_0x212a32[_0xa2e7('0x37')]:_0x19ba17[_0xa2e7('0x34')];_0x212a32['order']=qs[_0xa2e7('0x51')](_0x3eb530[_0xa2e7('0x35')]['sort']);_0x212a32[_0xa2e7('0x3d')]=qs['filters'](_[_0xa2e7('0x3f')](_0x3eb530[_0xa2e7('0x35')],_0x19ba17[_0xa2e7('0x3e')]));if(_0x3eb530[_0xa2e7('0x35')][_0xa2e7('0x40')]){_0x212a32[_0xa2e7('0x3d')]=_[_0xa2e7('0x42')](_0x212a32[_0xa2e7('0x3d')],{'$or':_[_0xa2e7('0x2e')](_0x212a32[_0xa2e7('0x37')],function(_0xef8849){var _0x279ca9={};_0x279ca9[_0xef8849]={'$like':'%'+_0x3eb530['query'][_0xa2e7('0x40')]+'%'};return _0x279ca9;})});}_0x212a32=_['merge']({},_0x212a32,_0x3eb530['options']);return _0x380b4e[_0xa2e7('0x52')](_0x212a32);}})[_0xa2e7('0x26')](function(_0x49cff9){if(_0x49cff9){_0x10a374=_0x49cff9[_0xa2e7('0x49')];if(!_0x3eb530[_0xa2e7('0x35')][_0xa2e7('0x39')](_0xa2e7('0x3a'))){_0x212a32[_0xa2e7('0x3b')]=qs['limit'](_0x3eb530[_0xa2e7('0x35')]['limit']);_0x212a32[_0xa2e7('0x1f')]=qs[_0xa2e7('0x1f')](_0x3eb530[_0xa2e7('0x35')][_0xa2e7('0x1f')]);}return _0x380b4e['getSubjects'](_0x212a32);}})[_0xa2e7('0x26')](function(_0x4034eb){if(_0x4034eb){return _0x4034eb?{'count':_0x10a374,'rows':_0x4034eb}:null;}})[_0xa2e7('0x26')](respondWithResult(_0x12ca5e,null))[_0xa2e7('0x46')](handleError(_0x12ca5e,null));};exports[_0xa2e7('0x53')]=function(_0x485f86,_0x2100c0,_0xac66f4){var _0xa4e290={};var _0x3b5a42={};var _0xec3f23;var _0x1f9a21;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x485f86[_0xa2e7('0x47')]['id']}})['then'](handleEntityNotFound(_0x2100c0,null))[_0xa2e7('0x26')](function(_0x5609c0){if(_0x5609c0){_0xec3f23=_0x5609c0;_0x3b5a42['model']=_[_0xa2e7('0x48')](db[_0xa2e7('0x50')][_0xa2e7('0x30')]);_0x3b5a42[_0xa2e7('0x35')]=_[_0xa2e7('0x48')](_0x485f86[_0xa2e7('0x35')]);_0x3b5a42[_0xa2e7('0x3e')]=_[_0xa2e7('0x36')](_0x3b5a42[_0xa2e7('0x34')],_0x3b5a42[_0xa2e7('0x35')]);_0xa4e290[_0xa2e7('0x37')]=_[_0xa2e7('0x36')](_0x3b5a42[_0xa2e7('0x34')],qs[_0xa2e7('0x38')](_0x485f86['query']['fields']));_0xa4e290['attributes']=_0xa4e290[_0xa2e7('0x37')][_0xa2e7('0x49')]?_0xa4e290[_0xa2e7('0x37')]:_0x3b5a42[_0xa2e7('0x34')];_0xa4e290['order']=qs[_0xa2e7('0x51')](_0x485f86[_0xa2e7('0x35')][_0xa2e7('0x51')]);_0xa4e290[_0xa2e7('0x3d')]=qs[_0xa2e7('0x3e')](_[_0xa2e7('0x3f')](_0x485f86[_0xa2e7('0x35')],_0x3b5a42['filters']));if(_0x485f86['query'][_0xa2e7('0x40')]){_0xa4e290[_0xa2e7('0x3d')]=_[_0xa2e7('0x42')](_0xa4e290[_0xa2e7('0x3d')],{'$or':_[_0xa2e7('0x2e')](_0xa4e290[_0xa2e7('0x37')],function(_0x5ef499){var _0x208c8={};_0x208c8[_0x5ef499]={'$like':'%'+_0x485f86['query']['filter']+'%'};return _0x208c8;})});}_0xa4e290=_[_0xa2e7('0x42')]({},_0xa4e290,_0x485f86[_0xa2e7('0x43')]);return _0xec3f23['getDescriptions'](_0xa4e290);}})[_0xa2e7('0x26')](function(_0x45d9f5){if(_0x45d9f5){_0x1f9a21=_0x45d9f5[_0xa2e7('0x49')];if(!_0x485f86[_0xa2e7('0x35')]['hasOwnProperty'](_0xa2e7('0x3a'))){_0xa4e290[_0xa2e7('0x3b')]=qs[_0xa2e7('0x3b')](_0x485f86['query'][_0xa2e7('0x3b')]);_0xa4e290[_0xa2e7('0x1f')]=qs[_0xa2e7('0x1f')](_0x485f86['query'][_0xa2e7('0x1f')]);}return _0xec3f23[_0xa2e7('0x53')](_0xa4e290);}})['then'](function(_0x14890d){if(_0x14890d){return _0x14890d?{'count':_0x1f9a21,'rows':_0x14890d}:null;}})['then'](respondWithResult(_0x2100c0,null))[_0xa2e7('0x46')](handleError(_0x2100c0,null));};
\ No newline at end of file
+var _0x9a6a=['include','catch','show','params','includeAll','options','find','create','body','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x5cb8a3,_0x420b1f){var _0x477b9e=function(_0x50f5c1){while(--_0x50f5c1){_0x5cb8a3['push'](_0x5cb8a3['shift']());}};_0x477b9e(++_0x420b1f);}(_0x9a6a,0xb8));var _0xa9a6=function(_0x462d4b,_0x597689){_0x462d4b=_0x462d4b-0x0;var _0x606afe=_0x9a6a[_0x462d4b];return _0x606afe;};'use strict';var emlformat=require(_0xa9a6('0x0'));var rimraf=require(_0xa9a6('0x1'));var zipdir=require(_0xa9a6('0x2'));var jsonpatch=require(_0xa9a6('0x3'));var rp=require(_0xa9a6('0x4'));var moment=require(_0xa9a6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa9a6('0x6'));var util=require('util');var path=require(_0xa9a6('0x7'));var sox=require(_0xa9a6('0x8'));var csv=require(_0xa9a6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9a6('0xa'));var _=require(_0xa9a6('0xb'));var squel=require(_0xa9a6('0xc'));var crypto=require(_0xa9a6('0xd'));var jsforce=require(_0xa9a6('0xe'));var deskjs=require(_0xa9a6('0xf'));var toCsv=require(_0xa9a6('0x9'));var querystring=require(_0xa9a6('0x10'));var Papa=require(_0xa9a6('0x11'));var Redis=require(_0xa9a6('0x12'));var authService=require(_0xa9a6('0x13'));var qs=require(_0xa9a6('0x14'));var as=require(_0xa9a6('0x15'));var hardwareService=require(_0xa9a6('0x16'));var logger=require(_0xa9a6('0x17'))(_0xa9a6('0x18'));var utils=require('../../config/utils');var config=require(_0xa9a6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa9a6('0x1a'))['db'];function respondWithStatusCode(_0x4ed2c2,_0x5805e9){_0x5805e9=_0x5805e9||0xcc;return function(_0x322146){if(_0x322146){return _0x4ed2c2[_0xa9a6('0x1b')](_0x5805e9);}return _0x4ed2c2[_0xa9a6('0x1c')](_0x5805e9)[_0xa9a6('0x1d')]();};}function respondWithResult(_0x7d563d,_0x16b609){_0x16b609=_0x16b609||0xc8;return function(_0x4cab65){if(_0x4cab65){return _0x7d563d['status'](_0x16b609)[_0xa9a6('0x1e')](_0x4cab65);}};}function respondWithFilteredResult(_0x2361b7,_0x59fc72){return function(_0x4283f3){if(_0x4283f3){var _0x103e3f=typeof _0x59fc72['offset']===_0xa9a6('0x1f')&&typeof _0x59fc72[_0xa9a6('0x20')]===_0xa9a6('0x1f');var _0x3c9301=_0x4283f3['count'];var _0x136606=_0x103e3f?0x0:_0x59fc72[_0xa9a6('0x21')];var _0x38f322=_0x103e3f?_0x4283f3[_0xa9a6('0x22')]:_0x59fc72[_0xa9a6('0x21')]+_0x59fc72[_0xa9a6('0x20')];var _0x5f95b4;if(_0x38f322>=_0x3c9301){_0x38f322=_0x3c9301;_0x5f95b4=0xc8;}else{_0x5f95b4=0xce;}_0x2361b7[_0xa9a6('0x1c')](_0x5f95b4);return _0x2361b7[_0xa9a6('0x23')](_0xa9a6('0x24'),_0x136606+'-'+_0x38f322+'/'+_0x3c9301)[_0xa9a6('0x1e')](_0x4283f3);}return null;};}function patchUpdates(_0x184e2a){return function(_0xddb269){try{jsonpatch[_0xa9a6('0x25')](_0xddb269,_0x184e2a,!![]);}catch(_0x15908e){return BPromise[_0xa9a6('0x26')](_0x15908e);}return _0xddb269[_0xa9a6('0x27')]();};}function saveUpdates(_0x976186,_0x42fdc0){return function(_0x10797c){if(_0x10797c){return _0x10797c[_0xa9a6('0x28')](_0x976186)[_0xa9a6('0x29')](function(_0xefea31){return _0xefea31;});}return null;};}function removeEntity(_0x30bd46,_0x5d12ff){return function(_0x55585b){if(_0x55585b){return _0x55585b[_0xa9a6('0x2a')]()[_0xa9a6('0x29')](function(){_0x30bd46[_0xa9a6('0x1c')](0xcc)[_0xa9a6('0x1d')]();});}};}function handleEntityNotFound(_0xccee75,_0x308d41){return function(_0x2f06e1){if(!_0x2f06e1){_0xccee75[_0xa9a6('0x1b')](0x194);}return _0x2f06e1;};}function handleError(_0x4c4d3c,_0x53f993){_0x53f993=_0x53f993||0x1f4;return function(_0x4cd9c0){logger[_0xa9a6('0x2b')](_0x4cd9c0[_0xa9a6('0x2c')]);if(_0x4cd9c0[_0xa9a6('0x2d')]){delete _0x4cd9c0[_0xa9a6('0x2d')];}_0x4c4d3c[_0xa9a6('0x1c')](_0x53f993)[_0xa9a6('0x2e')](_0x4cd9c0);};}exports[_0xa9a6('0x2f')]=function(_0x422ee5,_0x4d9c3d){var _0x3eb888={},_0x562255={},_0x598f09={'count':0x0,'rows':[]};var _0x2c89d4=_[_0xa9a6('0x30')](db[_0xa9a6('0x31')][_0xa9a6('0x32')],function(_0x39a924){return{'name':_0x39a924[_0xa9a6('0x33')],'type':_0x39a924[_0xa9a6('0x34')][_0xa9a6('0x35')]};});_0x562255[_0xa9a6('0x36')]=_['map'](_0x2c89d4,_0xa9a6('0x2d'));_0x562255[_0xa9a6('0x37')]=_[_0xa9a6('0x38')](_0x422ee5[_0xa9a6('0x37')]);_0x562255[_0xa9a6('0x39')]=_[_0xa9a6('0x3a')](_0x562255[_0xa9a6('0x36')],_0x562255['query']);_0x3eb888['attributes']=_['intersection'](_0x562255[_0xa9a6('0x36')],qs[_0xa9a6('0x3b')](_0x422ee5['query'][_0xa9a6('0x3b')]));_0x3eb888[_0xa9a6('0x3c')]=_0x3eb888['attributes'][_0xa9a6('0x3d')]?_0x3eb888[_0xa9a6('0x3c')]:_0x562255[_0xa9a6('0x36')];if(!_0x422ee5[_0xa9a6('0x37')][_0xa9a6('0x3e')](_0xa9a6('0x3f'))){_0x3eb888[_0xa9a6('0x20')]=qs[_0xa9a6('0x20')](_0x422ee5[_0xa9a6('0x37')][_0xa9a6('0x20')]);_0x3eb888[_0xa9a6('0x21')]=qs[_0xa9a6('0x21')](_0x422ee5[_0xa9a6('0x37')][_0xa9a6('0x21')]);}_0x3eb888[_0xa9a6('0x40')]=qs['sort'](_0x422ee5[_0xa9a6('0x37')][_0xa9a6('0x41')]);_0x3eb888[_0xa9a6('0x42')]=qs['filters'](_[_0xa9a6('0x43')](_0x422ee5[_0xa9a6('0x37')],_0x562255[_0xa9a6('0x39')]),_0x2c89d4);if(_0x422ee5[_0xa9a6('0x37')][_0xa9a6('0x44')]){_0x3eb888[_0xa9a6('0x42')]=_['merge'](_0x3eb888[_0xa9a6('0x42')],{'$or':_['map'](_0x2c89d4,function(_0x12d14b){if(_0x12d14b['type']!==_0xa9a6('0x45')){var _0x55bdc4={};_0x55bdc4[_0x12d14b[_0xa9a6('0x2d')]]={'$like':'%'+_0x422ee5[_0xa9a6('0x37')][_0xa9a6('0x44')]+'%'};return _0x55bdc4;}})});}_0x3eb888=_[_0xa9a6('0x46')]({},_0x3eb888,_0x422ee5['options']);var _0x4524e1={'where':_0x3eb888[_0xa9a6('0x42')]};return db[_0xa9a6('0x31')]['count'](_0x4524e1)[_0xa9a6('0x29')](function(_0x2d15cf){_0x598f09['count']=_0x2d15cf;if(_0x422ee5[_0xa9a6('0x37')]['includeAll']){_0x3eb888[_0xa9a6('0x47')]=[{'all':!![]}];}return db[_0xa9a6('0x31')]['findAll'](_0x3eb888);})[_0xa9a6('0x29')](function(_0x36da22){_0x598f09['rows']=_0x36da22;return _0x598f09;})[_0xa9a6('0x29')](respondWithFilteredResult(_0x4d9c3d,_0x3eb888))[_0xa9a6('0x48')](handleError(_0x4d9c3d,null));};exports[_0xa9a6('0x49')]=function(_0x4803c0,_0x1c2bf6){var _0x21eb2c={'raw':![],'where':{'id':_0x4803c0[_0xa9a6('0x4a')]['id']}},_0x55dee2={};_0x55dee2[_0xa9a6('0x36')]=_[_0xa9a6('0x38')](db[_0xa9a6('0x31')][_0xa9a6('0x32')]);_0x55dee2[_0xa9a6('0x37')]=_[_0xa9a6('0x38')](_0x4803c0[_0xa9a6('0x37')]);_0x55dee2[_0xa9a6('0x39')]=_[_0xa9a6('0x3a')](_0x55dee2[_0xa9a6('0x36')],_0x55dee2[_0xa9a6('0x37')]);_0x21eb2c[_0xa9a6('0x3c')]=_['intersection'](_0x55dee2[_0xa9a6('0x36')],qs['fields'](_0x4803c0['query'][_0xa9a6('0x3b')]));_0x21eb2c[_0xa9a6('0x3c')]=_0x21eb2c[_0xa9a6('0x3c')][_0xa9a6('0x3d')]?_0x21eb2c[_0xa9a6('0x3c')]:_0x55dee2[_0xa9a6('0x36')];if(_0x4803c0[_0xa9a6('0x37')][_0xa9a6('0x4b')]){_0x21eb2c[_0xa9a6('0x47')]=[{'all':!![]}];}_0x21eb2c=_[_0xa9a6('0x46')]({},_0x21eb2c,_0x4803c0[_0xa9a6('0x4c')]);return db[_0xa9a6('0x31')][_0xa9a6('0x4d')](_0x21eb2c)['then'](handleEntityNotFound(_0x1c2bf6,null))['then'](respondWithResult(_0x1c2bf6,null))['catch'](handleError(_0x1c2bf6,null));};exports[_0xa9a6('0x4e')]=function(_0x4338cb,_0x3d493e){return db[_0xa9a6('0x31')][_0xa9a6('0x4e')](_0x4338cb[_0xa9a6('0x4f')],{})[_0xa9a6('0x29')](respondWithResult(_0x3d493e,0xc9))[_0xa9a6('0x48')](handleError(_0x3d493e,null));};exports[_0xa9a6('0x28')]=function(_0x22aa31,_0x41359f){if(_0x22aa31[_0xa9a6('0x4f')]['id']){delete _0x22aa31[_0xa9a6('0x4f')]['id'];}return db[_0xa9a6('0x31')][_0xa9a6('0x4d')]({'where':{'id':_0x22aa31['params']['id']}})[_0xa9a6('0x29')](handleEntityNotFound(_0x41359f,null))['then'](saveUpdates(_0x22aa31['body'],null))[_0xa9a6('0x29')](respondWithResult(_0x41359f,null))[_0xa9a6('0x48')](handleError(_0x41359f,null));};exports[_0xa9a6('0x2a')]=function(_0x447b14,_0x43258e){return db[_0xa9a6('0x31')][_0xa9a6('0x4d')]({'where':{'id':_0x447b14[_0xa9a6('0x4a')]['id']}})[_0xa9a6('0x29')](handleEntityNotFound(_0x43258e,null))[_0xa9a6('0x29')](removeEntity(_0x43258e,null))['catch'](handleError(_0x43258e,null));};exports[_0xa9a6('0x50')]=function(_0x2b088d,_0x3a8470,_0x5bf2c1){var _0x4d4af0={};var _0x2a7b0e={};var _0x17c870;var _0x2e9788;return db[_0xa9a6('0x31')][_0xa9a6('0x51')]({'where':{'id':_0x2b088d[_0xa9a6('0x4a')]['id']}})[_0xa9a6('0x29')](handleEntityNotFound(_0x3a8470,null))['then'](function(_0x30f710){if(_0x30f710){_0x17c870=_0x30f710;_0x2a7b0e[_0xa9a6('0x36')]=_[_0xa9a6('0x38')](db[_0xa9a6('0x52')]['rawAttributes']);_0x2a7b0e[_0xa9a6('0x37')]=_['keys'](_0x2b088d[_0xa9a6('0x37')]);_0x2a7b0e[_0xa9a6('0x39')]=_[_0xa9a6('0x3a')](_0x2a7b0e[_0xa9a6('0x36')],_0x2a7b0e[_0xa9a6('0x37')]);_0x4d4af0[_0xa9a6('0x3c')]=_[_0xa9a6('0x3a')](_0x2a7b0e[_0xa9a6('0x36')],qs[_0xa9a6('0x3b')](_0x2b088d[_0xa9a6('0x37')][_0xa9a6('0x3b')]));_0x4d4af0[_0xa9a6('0x3c')]=_0x4d4af0[_0xa9a6('0x3c')][_0xa9a6('0x3d')]?_0x4d4af0[_0xa9a6('0x3c')]:_0x2a7b0e[_0xa9a6('0x36')];_0x4d4af0[_0xa9a6('0x40')]=qs[_0xa9a6('0x41')](_0x2b088d[_0xa9a6('0x37')][_0xa9a6('0x41')]);_0x4d4af0['where']=qs[_0xa9a6('0x39')](_[_0xa9a6('0x43')](_0x2b088d[_0xa9a6('0x37')],_0x2a7b0e['filters']));if(_0x2b088d[_0xa9a6('0x37')][_0xa9a6('0x44')]){_0x4d4af0[_0xa9a6('0x42')]=_['merge'](_0x4d4af0['where'],{'$or':_[_0xa9a6('0x30')](_0x4d4af0[_0xa9a6('0x3c')],function(_0x51e7f1){var _0x1e2391={};_0x1e2391[_0x51e7f1]={'$like':'%'+_0x2b088d[_0xa9a6('0x37')][_0xa9a6('0x44')]+'%'};return _0x1e2391;})});}_0x4d4af0=_['merge']({},_0x4d4af0,_0x2b088d['options']);return _0x17c870['getFields'](_0x4d4af0);}})[_0xa9a6('0x29')](function(_0x8aa6e8){if(_0x8aa6e8){_0x2e9788=_0x8aa6e8[_0xa9a6('0x3d')];if(!_0x2b088d['query'][_0xa9a6('0x3e')](_0xa9a6('0x3f'))){_0x4d4af0[_0xa9a6('0x20')]=qs['limit'](_0x2b088d[_0xa9a6('0x37')]['limit']);_0x4d4af0[_0xa9a6('0x21')]=qs[_0xa9a6('0x21')](_0x2b088d['query'][_0xa9a6('0x21')]);}return _0x17c870[_0xa9a6('0x50')](_0x4d4af0);}})[_0xa9a6('0x29')](function(_0x54bd7c){if(_0x54bd7c){return _0x54bd7c?{'count':_0x2e9788,'rows':_0x54bd7c}:null;}})['then'](respondWithResult(_0x3a8470,null))['catch'](handleError(_0x3a8470,null));};exports[_0xa9a6('0x53')]=function(_0x5619d2,_0x448378,_0x19b973){var _0x56e336={};var _0x14a010={};var _0x2837df;var _0x16db91;return db[_0xa9a6('0x31')][_0xa9a6('0x51')]({'where':{'id':_0x5619d2[_0xa9a6('0x4a')]['id']}})[_0xa9a6('0x29')](handleEntityNotFound(_0x448378,null))[_0xa9a6('0x29')](function(_0xe0aa73){if(_0xe0aa73){_0x2837df=_0xe0aa73;_0x14a010[_0xa9a6('0x36')]=_['keys'](db[_0xa9a6('0x52')][_0xa9a6('0x32')]);_0x14a010[_0xa9a6('0x37')]=_[_0xa9a6('0x38')](_0x5619d2[_0xa9a6('0x37')]);_0x14a010[_0xa9a6('0x39')]=_[_0xa9a6('0x3a')](_0x14a010[_0xa9a6('0x36')],_0x14a010[_0xa9a6('0x37')]);_0x56e336[_0xa9a6('0x3c')]=_[_0xa9a6('0x3a')](_0x14a010['model'],qs[_0xa9a6('0x3b')](_0x5619d2[_0xa9a6('0x37')]['fields']));_0x56e336[_0xa9a6('0x3c')]=_0x56e336['attributes']['length']?_0x56e336[_0xa9a6('0x3c')]:_0x14a010['model'];_0x56e336[_0xa9a6('0x40')]=qs[_0xa9a6('0x41')](_0x5619d2[_0xa9a6('0x37')]['sort']);_0x56e336[_0xa9a6('0x42')]=qs[_0xa9a6('0x39')](_[_0xa9a6('0x43')](_0x5619d2[_0xa9a6('0x37')],_0x14a010[_0xa9a6('0x39')]));if(_0x5619d2['query'][_0xa9a6('0x44')]){_0x56e336[_0xa9a6('0x42')]=_[_0xa9a6('0x46')](_0x56e336[_0xa9a6('0x42')],{'$or':_['map'](_0x56e336[_0xa9a6('0x3c')],function(_0x22b8bd){var _0x2a7f73={};_0x2a7f73[_0x22b8bd]={'$like':'%'+_0x5619d2[_0xa9a6('0x37')][_0xa9a6('0x44')]+'%'};return _0x2a7f73;})});}_0x56e336=_[_0xa9a6('0x46')]({},_0x56e336,_0x5619d2[_0xa9a6('0x4c')]);return _0x2837df[_0xa9a6('0x53')](_0x56e336);}})[_0xa9a6('0x29')](function(_0x1fa694){if(_0x1fa694){_0x16db91=_0x1fa694[_0xa9a6('0x3d')];if(!_0x5619d2[_0xa9a6('0x37')]['hasOwnProperty'](_0xa9a6('0x3f'))){_0x56e336[_0xa9a6('0x20')]=qs[_0xa9a6('0x20')](_0x5619d2['query']['limit']);_0x56e336[_0xa9a6('0x21')]=qs[_0xa9a6('0x21')](_0x5619d2[_0xa9a6('0x37')][_0xa9a6('0x21')]);}return _0x2837df['getSubjects'](_0x56e336);}})[_0xa9a6('0x29')](function(_0x2490a9){if(_0x2490a9){return _0x2490a9?{'count':_0x16db91,'rows':_0x2490a9}:null;}})[_0xa9a6('0x29')](respondWithResult(_0x448378,null))[_0xa9a6('0x48')](handleError(_0x448378,null));};exports['getDescriptions']=function(_0x2aa9c0,_0x1bd302,_0x14fb67){var _0x2847f3={};var _0x2bf3e6={};var _0x3d3fd7;var _0x5dd527;return db[_0xa9a6('0x31')][_0xa9a6('0x51')]({'where':{'id':_0x2aa9c0[_0xa9a6('0x4a')]['id']}})[_0xa9a6('0x29')](handleEntityNotFound(_0x1bd302,null))[_0xa9a6('0x29')](function(_0x5dceb7){if(_0x5dceb7){_0x3d3fd7=_0x5dceb7;_0x2bf3e6[_0xa9a6('0x36')]=_[_0xa9a6('0x38')](db[_0xa9a6('0x52')][_0xa9a6('0x32')]);_0x2bf3e6[_0xa9a6('0x37')]=_[_0xa9a6('0x38')](_0x2aa9c0['query']);_0x2bf3e6[_0xa9a6('0x39')]=_[_0xa9a6('0x3a')](_0x2bf3e6['model'],_0x2bf3e6[_0xa9a6('0x37')]);_0x2847f3[_0xa9a6('0x3c')]=_[_0xa9a6('0x3a')](_0x2bf3e6['model'],qs[_0xa9a6('0x3b')](_0x2aa9c0[_0xa9a6('0x37')]['fields']));_0x2847f3[_0xa9a6('0x3c')]=_0x2847f3['attributes']['length']?_0x2847f3[_0xa9a6('0x3c')]:_0x2bf3e6[_0xa9a6('0x36')];_0x2847f3[_0xa9a6('0x40')]=qs[_0xa9a6('0x41')](_0x2aa9c0[_0xa9a6('0x37')][_0xa9a6('0x41')]);_0x2847f3['where']=qs[_0xa9a6('0x39')](_[_0xa9a6('0x43')](_0x2aa9c0['query'],_0x2bf3e6[_0xa9a6('0x39')]));if(_0x2aa9c0[_0xa9a6('0x37')][_0xa9a6('0x44')]){_0x2847f3[_0xa9a6('0x42')]=_[_0xa9a6('0x46')](_0x2847f3['where'],{'$or':_[_0xa9a6('0x30')](_0x2847f3['attributes'],function(_0x45d849){var _0x549e7d={};_0x549e7d[_0x45d849]={'$like':'%'+_0x2aa9c0[_0xa9a6('0x37')]['filter']+'%'};return _0x549e7d;})});}_0x2847f3=_[_0xa9a6('0x46')]({},_0x2847f3,_0x2aa9c0[_0xa9a6('0x4c')]);return _0x3d3fd7[_0xa9a6('0x54')](_0x2847f3);}})[_0xa9a6('0x29')](function(_0x8fab71){if(_0x8fab71){_0x5dd527=_0x8fab71[_0xa9a6('0x3d')];if(!_0x2aa9c0[_0xa9a6('0x37')][_0xa9a6('0x3e')](_0xa9a6('0x3f'))){_0x2847f3['limit']=qs[_0xa9a6('0x20')](_0x2aa9c0['query'][_0xa9a6('0x20')]);_0x2847f3[_0xa9a6('0x21')]=qs[_0xa9a6('0x21')](_0x2aa9c0[_0xa9a6('0x37')][_0xa9a6('0x21')]);}return _0x3d3fd7[_0xa9a6('0x54')](_0x2847f3);}})[_0xa9a6('0x29')](function(_0x39248a){if(_0x39248a){return _0x39248a?{'count':_0x5dd527,'rows':_0x39248a}:null;}})['then'](respondWithResult(_0x1bd302,null))[_0xa9a6('0x48')](handleError(_0x1bd302,null));};
\ No newline at end of file
index 5fd78cb..188e730 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','lodash','util'];(function(_0x11b616,_0x744c44){var _0x4ec9ae=function(_0x58e5a3){while(--_0x58e5a3){_0x11b616['push'](_0x11b616['shift']());}};_0x4ec9ae(++_0x744c44);}(_0x54ef,0x112));var _0xf54e=function(_0x5aee24,_0x123255){_0x5aee24=_0x5aee24-0x0;var _0x425181=_0x54ef[_0x5aee24];return _0x425181;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf109=['Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x5ee65c,_0x45b969){var _0x5c6e46=function(_0x2a9db5){while(--_0x2a9db5){_0x5ee65c['push'](_0x5ee65c['shift']());}};_0x5c6e46(++_0x45b969);}(_0xf109,0xce));var _0x9f10=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xf109[_0x26462c];return _0x509a42;};'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 cbdcfc7..c72f752 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5cc=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x584f66,_0x39a037){var _0x3908b4=function(_0x452df3){while(--_0x452df3){_0x584f66['push'](_0x584f66['shift']());}};_0x3908b4(++_0x39a037);}(_0xb5cc,0x139));var _0xcb5c=function(_0x348ac9,_0x1f39b9){_0x348ac9=_0x348ac9-0x0;var _0x18148e=_0xb5cc[_0x348ac9];return _0x18148e;};'use strict';var _=require(_0xcb5c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcb5c('0x1'));var rs=require(_0xcb5c('0x2'));var fs=require('fs');var Redis=require(_0xcb5c('0x3'));var db=require(_0xcb5c('0x4'))['db'];var utils=require(_0xcb5c('0x5'));var logger=require(_0xcb5c('0x6'))(_0xcb5c('0x7'));var config=require(_0xcb5c('0x8'));var jayson=require(_0xcb5c('0x9'));var client=jayson[_0xcb5c('0xa')][_0xcb5c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b3d1b,_0x48ff65,_0x213e57){return new BPromise(function(_0x167b97,_0x6e458b){return client[_0xcb5c('0xc')](_0x4b3d1b,_0x213e57)['then'](function(_0x4e396a){logger[_0xcb5c('0xd')](_0xcb5c('0xe'),_0x48ff65,_0xcb5c('0xf'));logger[_0xcb5c('0x10')](_0xcb5c('0x11'),_0x48ff65,_0xcb5c('0xf'),JSON['stringify'](_0x4e396a));if(_0x4e396a[_0xcb5c('0x12')]){if(_0x4e396a[_0xcb5c('0x12')][_0xcb5c('0x13')]===0x1f4){logger[_0xcb5c('0x12')](_0xcb5c('0xe'),_0x48ff65,_0x4e396a['error']['message']);return _0x6e458b(_0x4e396a[_0xcb5c('0x12')][_0xcb5c('0x14')]);}logger[_0xcb5c('0x12')](_0xcb5c('0xe'),_0x48ff65,_0x4e396a[_0xcb5c('0x12')][_0xcb5c('0x14')]);return _0x167b97(_0x4e396a[_0xcb5c('0x12')]['message']);}else{logger[_0xcb5c('0xd')](_0xcb5c('0xe'),_0x48ff65,_0xcb5c('0xf'));_0x167b97(_0x4e396a['result'][_0xcb5c('0x14')]);}})[_0xcb5c('0x15')](function(_0x5f5d10){logger[_0xcb5c('0x12')](_0xcb5c('0xe'),_0x48ff65,_0x5f5d10);_0x6e458b(_0x5f5d10);});});}
\ No newline at end of file
+var _0x192a=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x192a,0xab));var _0xa192=function(_0x7cbd7e,_0x13e8f7){_0x7cbd7e=_0x7cbd7e-0x0;var _0x3dfffa=_0x192a[_0x7cbd7e];return _0x3dfffa;};'use strict';var _=require(_0xa192('0x0'));var util=require(_0xa192('0x1'));var moment=require(_0xa192('0x2'));var BPromise=require(_0xa192('0x3'));var rs=require(_0xa192('0x4'));var fs=require('fs');var Redis=require(_0xa192('0x5'));var db=require(_0xa192('0x6'))['db'];var utils=require(_0xa192('0x7'));var logger=require(_0xa192('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa192('0x9')][_0xa192('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cb516,_0x506787,_0x4f660e){return new BPromise(function(_0x537c6b,_0x2235e9){return client[_0xa192('0xb')](_0x4cb516,_0x4f660e)[_0xa192('0xc')](function(_0x4c863d){logger['info'](_0xa192('0xd'),_0x506787,_0xa192('0xe'));logger['debug'](_0xa192('0xf'),_0x506787,'request\x20sent',JSON[_0xa192('0x10')](_0x4c863d));if(_0x4c863d[_0xa192('0x11')]){if(_0x4c863d[_0xa192('0x11')][_0xa192('0x12')]===0x1f4){logger['error'](_0xa192('0xd'),_0x506787,_0x4c863d[_0xa192('0x11')][_0xa192('0x13')]);return _0x2235e9(_0x4c863d['error'][_0xa192('0x13')]);}logger['error'](_0xa192('0xd'),_0x506787,_0x4c863d[_0xa192('0x11')][_0xa192('0x13')]);return _0x537c6b(_0x4c863d[_0xa192('0x11')][_0xa192('0x13')]);}else{logger[_0xa192('0x14')](_0xa192('0xd'),_0x506787,_0xa192('0xe'));_0x537c6b(_0x4c863d[_0xa192('0x15')][_0xa192('0x13')]);}})[_0xa192('0x16')](function(_0x3d66b9){logger[_0xa192('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x506787,_0x3d66b9);_0x2235e9(_0x3d66b9);});});}
\ No newline at end of file
index 523ffbf..d2cec61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeeb2=['../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1f99a0,_0x50b73d){var _0x1e0849=function(_0x41e764){while(--_0x41e764){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0x1e0849(++_0x50b73d);}(_0xeeb2,0x1d4));var _0x2eeb=function(_0xf6aec0,_0x51ffd6){_0xf6aec0=_0xf6aec0-0x0;var _0x59a51b=_0xeeb2[_0xf6aec0];return _0x59a51b;};'use strict';var multer=require(_0x2eeb('0x0'));var util=require(_0x2eeb('0x1'));var path=require(_0x2eeb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2eeb('0x3')]();var fs_extra=require(_0x2eeb('0x4'));var auth=require(_0x2eeb('0x5'));var interaction=require(_0x2eeb('0x6'));var config=require(_0x2eeb('0x7'));var controller=require(_0x2eeb('0x8'));router[_0x2eeb('0x9')]('/',auth['isAuthenticated'](),controller[_0x2eeb('0xa')]);router['get'](_0x2eeb('0xb'),auth[_0x2eeb('0xc')](),controller[_0x2eeb('0xd')]);router[_0x2eeb('0xe')]('/',auth[_0x2eeb('0xc')](),controller[_0x2eeb('0xf')]);router[_0x2eeb('0x10')](_0x2eeb('0xb'),auth[_0x2eeb('0xc')](),controller['update']);router['delete'](_0x2eeb('0xb'),auth[_0x2eeb('0xc')](),controller[_0x2eeb('0x11')]);module[_0x2eeb('0x12')]=router;
\ No newline at end of file
+var _0x8b4c=['../../components/interaction/service','./intDynamics365Field.controller','isAuthenticated','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5da107,_0x10357c){var _0x224f15=function(_0x2b7af8){while(--_0x2b7af8){_0x5da107['push'](_0x5da107['shift']());}};_0x224f15(++_0x10357c);}(_0x8b4c,0x188));var _0xc8b4=function(_0x1067d6,_0x501330){_0x1067d6=_0x1067d6-0x0;var _0x1c5c9d=_0x8b4c[_0x1067d6];return _0x1c5c9d;};'use strict';var multer=require(_0xc8b4('0x0'));var util=require(_0xc8b4('0x1'));var path=require(_0xc8b4('0x2'));var timeout=require(_0xc8b4('0x3'));var express=require(_0xc8b4('0x4'));var router=express['Router']();var fs_extra=require(_0xc8b4('0x5'));var auth=require(_0xc8b4('0x6'));var interaction=require(_0xc8b4('0x7'));var config=require('../../config/environment');var controller=require(_0xc8b4('0x8'));router['get']('/',auth[_0xc8b4('0x9')](),controller['index']);router[_0xc8b4('0xa')](_0xc8b4('0xb'),auth[_0xc8b4('0x9')](),controller[_0xc8b4('0xc')]);router['post']('/',auth[_0xc8b4('0x9')](),controller[_0xc8b4('0xd')]);router[_0xc8b4('0xe')](_0xc8b4('0xb'),auth[_0xc8b4('0x9')](),controller[_0xc8b4('0xf')]);router[_0xc8b4('0x10')](_0xc8b4('0xb'),auth['isAuthenticated'](),controller[_0xc8b4('0x11')]);module[_0xc8b4('0x12')]=router;
\ No newline at end of file
index 0c85bf1..7f0a8cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb64=['variable','customVariable','keyValue','STRING','ENUM','BOOLEAN','exports','string'];(function(_0x13f010,_0x3095ae){var _0x2cffba=function(_0x1ac3c9){while(--_0x1ac3c9){_0x13f010['push'](_0x13f010['shift']());}};_0x2cffba(++_0x3095ae);}(_0xeb64,0x146));var _0x4eb6=function(_0x1c3a04,_0x392170){_0x1c3a04=_0x1c3a04-0x0;var _0x1eecf5=_0xeb64[_0x1c3a04];return _0x1eecf5;};'use strict';var Sequelize=require('sequelize');module[_0x4eb6('0x0')]={'type':{'type':Sequelize['ENUM'](_0x4eb6('0x1'),_0x4eb6('0x2'),_0x4eb6('0x3'),_0x4eb6('0x4'),'picklist'),'defaultValue':_0x4eb6('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4eb6('0x5')]},'keyType':{'type':Sequelize[_0x4eb6('0x6')](_0x4eb6('0x1'),_0x4eb6('0x2'),_0x4eb6('0x3'))},'keyContent':{'type':Sequelize[_0x4eb6('0x5')]},'idField':{'type':Sequelize[_0x4eb6('0x5')]},'nameField':{'type':Sequelize[_0x4eb6('0x5')]},'customField':{'type':Sequelize[_0x4eb6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4eb6('0x5')]}};
\ No newline at end of file
+var _0x9969=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x1e3d86,_0x241e96){var _0x14c3b9=function(_0x186f15){while(--_0x186f15){_0x1e3d86['push'](_0x1e3d86['shift']());}};_0x14c3b9(++_0x241e96);}(_0x9969,0x8f));var _0x9996=function(_0x272039,_0x221889){_0x272039=_0x272039-0x0;var _0x3b7cfd=_0x9969[_0x272039];return _0x3b7cfd;};'use strict';var Sequelize=require(_0x9996('0x0'));module[_0x9996('0x1')]={'type':{'type':Sequelize[_0x9996('0x2')](_0x9996('0x3'),_0x9996('0x4'),_0x9996('0x5'),_0x9996('0x6'),'picklist'),'defaultValue':_0x9996('0x3')},'content':{'type':Sequelize[_0x9996('0x7')]},'key':{'type':Sequelize[_0x9996('0x7')]},'keyType':{'type':Sequelize[_0x9996('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x9996('0x7')]},'idField':{'type':Sequelize[_0x9996('0x7')]},'nameField':{'type':Sequelize[_0x9996('0x7')]},'customField':{'type':Sequelize[_0x9996('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 759d2d8..fd2db24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16ed=['limit','undefined','Content-Range','json','apply','reject','update','then','error','name','send','index','fieldName','key','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','sort','where','filter','map','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','Dynamics365Field','merge','create','body','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','end','offset'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x16ed,0x72));var _0xd16e=function(_0x3eb9fb,_0x5b8af6){_0x3eb9fb=_0x3eb9fb-0x0;var _0x4c9d13=_0x16ed[_0x3eb9fb];return _0x4c9d13;};'use strict';var emlformat=require(_0xd16e('0x0'));var rimraf=require(_0xd16e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd16e('0x2'));var rp=require(_0xd16e('0x3'));var moment=require(_0xd16e('0x4'));var BPromise=require(_0xd16e('0x5'));var Mustache=require(_0xd16e('0x6'));var util=require(_0xd16e('0x7'));var path=require(_0xd16e('0x8'));var sox=require(_0xd16e('0x9'));var csv=require('to-csv');var ejs=require(_0xd16e('0xa'));var fs=require('fs');var fs_extra=require(_0xd16e('0xb'));var _=require(_0xd16e('0xc'));var squel=require(_0xd16e('0xd'));var crypto=require(_0xd16e('0xe'));var jsforce=require(_0xd16e('0xf'));var deskjs=require(_0xd16e('0x10'));var toCsv=require(_0xd16e('0x11'));var querystring=require(_0xd16e('0x12'));var Papa=require('papaparse');var Redis=require(_0xd16e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd16e('0x14'));var as=require(_0xd16e('0x15'));var hardwareService=require(_0xd16e('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd16e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13f018,_0x49f5d1){_0x49f5d1=_0x49f5d1||0xcc;return function(_0x5cb752){if(_0x5cb752){return _0x13f018[_0xd16e('0x18')](_0x49f5d1);}return _0x13f018[_0xd16e('0x19')](_0x49f5d1)[_0xd16e('0x1a')]();};}function respondWithResult(_0x1f9c9f,_0x3e472c){_0x3e472c=_0x3e472c||0xc8;return function(_0xbc1116){if(_0xbc1116){return _0x1f9c9f['status'](_0x3e472c)['json'](_0xbc1116);}};}function respondWithFilteredResult(_0xee0d19,_0x126f00){return function(_0x254d4c){if(_0x254d4c){var _0x5912ce=typeof _0x126f00[_0xd16e('0x1b')]==='undefined'&&typeof _0x126f00[_0xd16e('0x1c')]===_0xd16e('0x1d');var _0x27d449=_0x254d4c['count'];var _0x36cb8b=_0x5912ce?0x0:_0x126f00[_0xd16e('0x1b')];var _0x85adf=_0x5912ce?_0x254d4c['count']:_0x126f00[_0xd16e('0x1b')]+_0x126f00[_0xd16e('0x1c')];var _0x3afe21;if(_0x85adf>=_0x27d449){_0x85adf=_0x27d449;_0x3afe21=0xc8;}else{_0x3afe21=0xce;}_0xee0d19[_0xd16e('0x19')](_0x3afe21);return _0xee0d19['set'](_0xd16e('0x1e'),_0x36cb8b+'-'+_0x85adf+'/'+_0x27d449)[_0xd16e('0x1f')](_0x254d4c);}return null;};}function patchUpdates(_0x14be8b){return function(_0x4eecbc){try{jsonpatch[_0xd16e('0x20')](_0x4eecbc,_0x14be8b,!![]);}catch(_0x567708){return BPromise[_0xd16e('0x21')](_0x567708);}return _0x4eecbc['save']();};}function saveUpdates(_0x25e292,_0x540c46){return function(_0xd9d2e9){if(_0xd9d2e9){return _0xd9d2e9[_0xd16e('0x22')](_0x25e292)[_0xd16e('0x23')](function(_0x252cb7){return _0x252cb7;});}return null;};}function removeEntity(_0x3268e7,_0x1e4641){return function(_0x23cd6f){if(_0x23cd6f){return _0x23cd6f['destroy']()[_0xd16e('0x23')](function(){_0x3268e7[_0xd16e('0x19')](0xcc)[_0xd16e('0x1a')]();});}};}function handleEntityNotFound(_0xc88df6,_0x235213){return function(_0x5de428){if(!_0x5de428){_0xc88df6[_0xd16e('0x18')](0x194);}return _0x5de428;};}function handleError(_0x42dc87,_0x865696){_0x865696=_0x865696||0x1f4;return function(_0x56972e){logger[_0xd16e('0x24')](_0x56972e['stack']);if(_0x56972e[_0xd16e('0x25')]){delete _0x56972e[_0xd16e('0x25')];}_0x42dc87[_0xd16e('0x19')](_0x865696)[_0xd16e('0x26')](_0x56972e);};}exports[_0xd16e('0x27')]=function(_0x3fb025,_0x4979db){var _0x95376b={},_0x572031={},_0x232dbb={'count':0x0,'rows':[]};var _0x5b9223=_['map'](db['Dynamics365Field']['rawAttributes'],function(_0x2a5121){return{'name':_0x2a5121[_0xd16e('0x28')],'type':_0x2a5121['type'][_0xd16e('0x29')]};});_0x572031['model']=_['map'](_0x5b9223,_0xd16e('0x25'));_0x572031['query']=_[_0xd16e('0x2a')](_0x3fb025['query']);_0x572031[_0xd16e('0x2b')]=_[_0xd16e('0x2c')](_0x572031[_0xd16e('0x2d')],_0x572031['query']);_0x95376b[_0xd16e('0x2e')]=_['intersection'](_0x572031[_0xd16e('0x2d')],qs[_0xd16e('0x2f')](_0x3fb025[_0xd16e('0x30')][_0xd16e('0x2f')]));_0x95376b['attributes']=_0x95376b[_0xd16e('0x2e')][_0xd16e('0x31')]?_0x95376b[_0xd16e('0x2e')]:_0x572031[_0xd16e('0x2d')];if(!_0x3fb025[_0xd16e('0x30')][_0xd16e('0x32')]('nolimit')){_0x95376b['limit']=qs[_0xd16e('0x1c')](_0x3fb025[_0xd16e('0x30')][_0xd16e('0x1c')]);_0x95376b[_0xd16e('0x1b')]=qs[_0xd16e('0x1b')](_0x3fb025[_0xd16e('0x30')]['offset']);}_0x95376b['order']=qs[_0xd16e('0x33')](_0x3fb025[_0xd16e('0x30')]['sort']);_0x95376b[_0xd16e('0x34')]=qs[_0xd16e('0x2b')](_['pick'](_0x3fb025[_0xd16e('0x30')],_0x572031[_0xd16e('0x2b')]),_0x5b9223);if(_0x3fb025[_0xd16e('0x30')][_0xd16e('0x35')]){_0x95376b[_0xd16e('0x34')]=_['merge'](_0x95376b[_0xd16e('0x34')],{'$or':_[_0xd16e('0x36')](_0x5b9223,function(_0x895d3c){if(_0x895d3c[_0xd16e('0x37')]!==_0xd16e('0x38')){var _0x598339={};_0x598339[_0x895d3c[_0xd16e('0x25')]]={'$like':'%'+_0x3fb025['query']['filter']+'%'};return _0x598339;}})});}_0x95376b=_['merge']({},_0x95376b,_0x3fb025[_0xd16e('0x39')]);var _0x50d623={'where':_0x95376b[_0xd16e('0x34')]};return db['Dynamics365Field']['count'](_0x50d623)[_0xd16e('0x23')](function(_0x4e0529){_0x232dbb[_0xd16e('0x3a')]=_0x4e0529;if(_0x3fb025['query'][_0xd16e('0x3b')]){_0x95376b[_0xd16e('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xd16e('0x3d')](_0x95376b);})[_0xd16e('0x23')](function(_0x1221d6){_0x232dbb[_0xd16e('0x3e')]=_0x1221d6;return _0x232dbb;})[_0xd16e('0x23')](respondWithFilteredResult(_0x4979db,_0x95376b))[_0xd16e('0x3f')](handleError(_0x4979db,null));};exports['show']=function(_0x5c3ae8,_0xbc921d){var _0x39922b={'raw':!![],'where':{'id':_0x5c3ae8[_0xd16e('0x40')]['id']}},_0x111c12={};_0x111c12[_0xd16e('0x2d')]=_['keys'](db[_0xd16e('0x41')]['rawAttributes']);_0x111c12[_0xd16e('0x30')]=_[_0xd16e('0x2a')](_0x5c3ae8[_0xd16e('0x30')]);_0x111c12[_0xd16e('0x2b')]=_[_0xd16e('0x2c')](_0x111c12['model'],_0x111c12['query']);_0x39922b[_0xd16e('0x2e')]=_[_0xd16e('0x2c')](_0x111c12['model'],qs[_0xd16e('0x2f')](_0x5c3ae8['query']['fields']));_0x39922b[_0xd16e('0x2e')]=_0x39922b[_0xd16e('0x2e')]['length']?_0x39922b[_0xd16e('0x2e')]:_0x111c12[_0xd16e('0x2d')];if(_0x5c3ae8[_0xd16e('0x30')][_0xd16e('0x3b')]){_0x39922b[_0xd16e('0x3c')]=[{'all':!![]}];}_0x39922b=_[_0xd16e('0x42')]({},_0x39922b,_0x5c3ae8['options']);return db[_0xd16e('0x41')]['find'](_0x39922b)[_0xd16e('0x23')](handleEntityNotFound(_0xbc921d,null))[_0xd16e('0x23')](respondWithResult(_0xbc921d,null))[_0xd16e('0x3f')](handleError(_0xbc921d,null));};exports['create']=function(_0x41f867,_0x3b003b){return db[_0xd16e('0x41')][_0xd16e('0x43')](_0x41f867['body'],{})[_0xd16e('0x23')](respondWithResult(_0x3b003b,0xc9))[_0xd16e('0x3f')](handleError(_0x3b003b,null));};exports[_0xd16e('0x22')]=function(_0x1f99a4,_0x137754){if(_0x1f99a4['body']['id']){delete _0x1f99a4[_0xd16e('0x44')]['id'];}return db['Dynamics365Field'][_0xd16e('0x45')]({'where':{'id':_0x1f99a4[_0xd16e('0x40')]['id']}})[_0xd16e('0x23')](handleEntityNotFound(_0x137754,null))[_0xd16e('0x23')](saveUpdates(_0x1f99a4[_0xd16e('0x44')],null))[_0xd16e('0x23')](respondWithResult(_0x137754,null))[_0xd16e('0x3f')](handleError(_0x137754,null));};exports[_0xd16e('0x46')]=function(_0x3817a8,_0x446919){return db[_0xd16e('0x41')][_0xd16e('0x45')]({'where':{'id':_0x3817a8[_0xd16e('0x40')]['id']}})[_0xd16e('0x23')](handleEntityNotFound(_0x446919,null))[_0xd16e('0x23')](removeEntity(_0x446919,null))[_0xd16e('0x3f')](handleError(_0x446919,null));};
\ No newline at end of file
+var _0x94e1=['error','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','length','attributes','hasOwnProperty','nolimit','sort','where','map','filter','merge','options','includeAll','include','findAll','catch','show','intersection','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy'];(function(_0x1c27ea,_0x2125cb){var _0x2bd95e=function(_0x54f697){while(--_0x54f697){_0x1c27ea['push'](_0x1c27ea['shift']());}};_0x2bd95e(++_0x2125cb);}(_0x94e1,0xb5));var _0x194e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x94e1[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x194e('0x0'));var rimraf=require(_0x194e('0x1'));var zipdir=require(_0x194e('0x2'));var jsonpatch=require(_0x194e('0x3'));var rp=require(_0x194e('0x4'));var moment=require(_0x194e('0x5'));var BPromise=require(_0x194e('0x6'));var Mustache=require(_0x194e('0x7'));var util=require('util');var path=require(_0x194e('0x8'));var sox=require('sox');var csv=require(_0x194e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x194e('0xa'));var _=require(_0x194e('0xb'));var squel=require(_0x194e('0xc'));var crypto=require(_0x194e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x194e('0xe'));var toCsv=require(_0x194e('0x9'));var querystring=require('querystring');var Papa=require(_0x194e('0xf'));var Redis=require('ioredis');var authService=require(_0x194e('0x10'));var qs=require(_0x194e('0x11'));var as=require(_0x194e('0x12'));var hardwareService=require(_0x194e('0x13'));var logger=require(_0x194e('0x14'))(_0x194e('0x15'));var utils=require('../../config/utils');var config=require(_0x194e('0x16'));var licenseUtil=require(_0x194e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e1cd6,_0x321857){_0x321857=_0x321857||0xcc;return function(_0xb9b725){if(_0xb9b725){return _0x1e1cd6[_0x194e('0x18')](_0x321857);}return _0x1e1cd6[_0x194e('0x19')](_0x321857)[_0x194e('0x1a')]();};}function respondWithResult(_0x4bec57,_0x33e1d6){_0x33e1d6=_0x33e1d6||0xc8;return function(_0x2cc05c){if(_0x2cc05c){return _0x4bec57['status'](_0x33e1d6)[_0x194e('0x1b')](_0x2cc05c);}};}function respondWithFilteredResult(_0x112885,_0x48909b){return function(_0x588ec9){if(_0x588ec9){var _0x3d404f=typeof _0x48909b[_0x194e('0x1c')]===_0x194e('0x1d')&&typeof _0x48909b[_0x194e('0x1e')]===_0x194e('0x1d');var _0x2d7fbd=_0x588ec9[_0x194e('0x1f')];var _0x3e9ef1=_0x3d404f?0x0:_0x48909b[_0x194e('0x1c')];var _0x2d989c=_0x3d404f?_0x588ec9[_0x194e('0x1f')]:_0x48909b[_0x194e('0x1c')]+_0x48909b['limit'];var _0x4c8487;if(_0x2d989c>=_0x2d7fbd){_0x2d989c=_0x2d7fbd;_0x4c8487=0xc8;}else{_0x4c8487=0xce;}_0x112885[_0x194e('0x19')](_0x4c8487);return _0x112885[_0x194e('0x20')]('Content-Range',_0x3e9ef1+'-'+_0x2d989c+'/'+_0x2d7fbd)[_0x194e('0x1b')](_0x588ec9);}return null;};}function patchUpdates(_0x26b9fb){return function(_0x1f9a79){try{jsonpatch['apply'](_0x1f9a79,_0x26b9fb,!![]);}catch(_0x371e65){return BPromise[_0x194e('0x21')](_0x371e65);}return _0x1f9a79[_0x194e('0x22')]();};}function saveUpdates(_0x3a4ef3,_0x2f0aec){return function(_0x3933ab){if(_0x3933ab){return _0x3933ab[_0x194e('0x23')](_0x3a4ef3)[_0x194e('0x24')](function(_0x2e3127){return _0x2e3127;});}return null;};}function removeEntity(_0x54d41a,_0x355d65){return function(_0x4290bc){if(_0x4290bc){return _0x4290bc[_0x194e('0x25')]()[_0x194e('0x24')](function(){_0x54d41a[_0x194e('0x19')](0xcc)[_0x194e('0x1a')]();});}};}function handleEntityNotFound(_0x14082a,_0x2d0275){return function(_0x3d1d81){if(!_0x3d1d81){_0x14082a[_0x194e('0x18')](0x194);}return _0x3d1d81;};}function handleError(_0x5a2826,_0x319098){_0x319098=_0x319098||0x1f4;return function(_0x178507){logger[_0x194e('0x26')](_0x178507[_0x194e('0x27')]);if(_0x178507[_0x194e('0x28')]){delete _0x178507[_0x194e('0x28')];}_0x5a2826[_0x194e('0x19')](_0x319098)[_0x194e('0x29')](_0x178507);};}exports[_0x194e('0x2a')]=function(_0x34b163,_0x5e8bfe){var _0x381804={},_0x4b940a={},_0x270a86={'count':0x0,'rows':[]};var _0x38bd7a=_['map'](db[_0x194e('0x2b')][_0x194e('0x2c')],function(_0x4f3cb2){return{'name':_0x4f3cb2[_0x194e('0x2d')],'type':_0x4f3cb2[_0x194e('0x2e')][_0x194e('0x2f')]};});_0x4b940a[_0x194e('0x30')]=_['map'](_0x38bd7a,_0x194e('0x28'));_0x4b940a['query']=_[_0x194e('0x31')](_0x34b163[_0x194e('0x32')]);_0x4b940a[_0x194e('0x33')]=_['intersection'](_0x4b940a[_0x194e('0x30')],_0x4b940a[_0x194e('0x32')]);_0x381804['attributes']=_['intersection'](_0x4b940a[_0x194e('0x30')],qs[_0x194e('0x34')](_0x34b163[_0x194e('0x32')]['fields']));_0x381804['attributes']=_0x381804['attributes'][_0x194e('0x35')]?_0x381804[_0x194e('0x36')]:_0x4b940a[_0x194e('0x30')];if(!_0x34b163[_0x194e('0x32')][_0x194e('0x37')](_0x194e('0x38'))){_0x381804['limit']=qs['limit'](_0x34b163[_0x194e('0x32')][_0x194e('0x1e')]);_0x381804[_0x194e('0x1c')]=qs['offset'](_0x34b163[_0x194e('0x32')][_0x194e('0x1c')]);}_0x381804['order']=qs[_0x194e('0x39')](_0x34b163[_0x194e('0x32')][_0x194e('0x39')]);_0x381804[_0x194e('0x3a')]=qs['filters'](_['pick'](_0x34b163[_0x194e('0x32')],_0x4b940a[_0x194e('0x33')]),_0x38bd7a);if(_0x34b163[_0x194e('0x32')]['filter']){_0x381804['where']=_['merge'](_0x381804[_0x194e('0x3a')],{'$or':_[_0x194e('0x3b')](_0x38bd7a,function(_0xa7484d){if(_0xa7484d[_0x194e('0x2e')]!=='VIRTUAL'){var _0x54ba5f={};_0x54ba5f[_0xa7484d['name']]={'$like':'%'+_0x34b163['query'][_0x194e('0x3c')]+'%'};return _0x54ba5f;}})});}_0x381804=_[_0x194e('0x3d')]({},_0x381804,_0x34b163[_0x194e('0x3e')]);var _0x5544ec={'where':_0x381804[_0x194e('0x3a')]};return db[_0x194e('0x2b')]['count'](_0x5544ec)[_0x194e('0x24')](function(_0x4102d9){_0x270a86[_0x194e('0x1f')]=_0x4102d9;if(_0x34b163[_0x194e('0x32')][_0x194e('0x3f')]){_0x381804[_0x194e('0x40')]=[{'all':!![]}];}return db[_0x194e('0x2b')][_0x194e('0x41')](_0x381804);})[_0x194e('0x24')](function(_0x5e60ef){_0x270a86['rows']=_0x5e60ef;return _0x270a86;})[_0x194e('0x24')](respondWithFilteredResult(_0x5e8bfe,_0x381804))[_0x194e('0x42')](handleError(_0x5e8bfe,null));};exports[_0x194e('0x43')]=function(_0x4e07df,_0x5116ec){var _0xd6788e={'raw':!![],'where':{'id':_0x4e07df['params']['id']}},_0x432352={};_0x432352[_0x194e('0x30')]=_['keys'](db[_0x194e('0x2b')][_0x194e('0x2c')]);_0x432352[_0x194e('0x32')]=_[_0x194e('0x31')](_0x4e07df[_0x194e('0x32')]);_0x432352[_0x194e('0x33')]=_[_0x194e('0x44')](_0x432352['model'],_0x432352[_0x194e('0x32')]);_0xd6788e[_0x194e('0x36')]=_['intersection'](_0x432352[_0x194e('0x30')],qs[_0x194e('0x34')](_0x4e07df['query']['fields']));_0xd6788e[_0x194e('0x36')]=_0xd6788e[_0x194e('0x36')][_0x194e('0x35')]?_0xd6788e['attributes']:_0x432352[_0x194e('0x30')];if(_0x4e07df[_0x194e('0x32')][_0x194e('0x3f')]){_0xd6788e[_0x194e('0x40')]=[{'all':!![]}];}_0xd6788e=_[_0x194e('0x3d')]({},_0xd6788e,_0x4e07df['options']);return db[_0x194e('0x2b')][_0x194e('0x45')](_0xd6788e)['then'](handleEntityNotFound(_0x5116ec,null))[_0x194e('0x24')](respondWithResult(_0x5116ec,null))[_0x194e('0x42')](handleError(_0x5116ec,null));};exports[_0x194e('0x46')]=function(_0x3c35cd,_0x20968c){return db[_0x194e('0x2b')]['create'](_0x3c35cd[_0x194e('0x47')],{})['then'](respondWithResult(_0x20968c,0xc9))['catch'](handleError(_0x20968c,null));};exports[_0x194e('0x23')]=function(_0x18cd7d,_0x194841){if(_0x18cd7d[_0x194e('0x47')]['id']){delete _0x18cd7d[_0x194e('0x47')]['id'];}return db['Dynamics365Field'][_0x194e('0x45')]({'where':{'id':_0x18cd7d[_0x194e('0x48')]['id']}})[_0x194e('0x24')](handleEntityNotFound(_0x194841,null))[_0x194e('0x24')](saveUpdates(_0x18cd7d[_0x194e('0x47')],null))[_0x194e('0x24')](respondWithResult(_0x194841,null))[_0x194e('0x42')](handleError(_0x194841,null));};exports[_0x194e('0x25')]=function(_0x3b72d9,_0x1be36c){return db['Dynamics365Field'][_0x194e('0x45')]({'where':{'id':_0x3b72d9['params']['id']}})['then'](handleEntityNotFound(_0x1be36c,null))[_0x194e('0x24')](removeEntity(_0x1be36c,null))[_0x194e('0x42')](handleError(_0x1be36c,null));};
\ No newline at end of file
index 630c642..708e67a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbb0=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x7e5b90,_0x3ab63a){var _0xd48df6=function(_0x16b7d1){while(--_0x16b7d1){_0x7e5b90['push'](_0x7e5b90['shift']());}};_0xd48df6(++_0x3ab63a);}(_0xfbb0,0xfc));var _0x0fbb=function(_0x123bdd,_0x4bb6d6){_0x123bdd=_0x123bdd-0x0;var _0x83958e=_0xfbb0[_0x123bdd];return _0x83958e;};'use strict';var _=require(_0x0fbb('0x0'));var util=require(_0x0fbb('0x1'));var logger=require(_0x0fbb('0x2'))(_0x0fbb('0x3'));var moment=require(_0x0fbb('0x4'));var BPromise=require(_0x0fbb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fbb('0x6'));var rimraf=require(_0x0fbb('0x7'));var config=require(_0x0fbb('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0x0fbb('0x9')]=function(_0x228546,_0x165c05){return _0x228546[_0x0fbb('0xa')](_0x0fbb('0xb'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x0fbb('0xc'),'fields':[_0x0fbb('0xd'),_0x0fbb('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x56e9=['./intDynamics365Field.attributes','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x1a0f83,_0x423ded){var _0x33f125=function(_0x28c98d){while(--_0x28c98d){_0x1a0f83['push'](_0x1a0f83['shift']());}};_0x33f125(++_0x423ded);}(_0x56e9,0x6e));var _0x956e=function(_0x324245,_0xf9122c){_0x324245=_0x324245-0x0;var _0x28302a=_0x56e9[_0x324245];return _0x28302a;};'use strict';var _=require(_0x956e('0x0'));var util=require(_0x956e('0x1'));var logger=require('../../config/logger')(_0x956e('0x2'));var moment=require(_0x956e('0x3'));var BPromise=require(_0x956e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x956e('0x5'));var rimraf=require('rimraf');var config=require(_0x956e('0x6'));var attributes=require(_0x956e('0x7'));module['exports']=function(_0x4d286a,_0x549fbf){return _0x4d286a[_0x956e('0x8')](_0x956e('0x9'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x956e('0xa'),'fields':[_0x956e('0xb'),_0x956e('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 40e3f24..e22fae1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0204=['Dynamics365Field,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x521084,_0x3fbb5e){var _0x3323e0=function(_0x204e3d){while(--_0x204e3d){_0x521084['push'](_0x521084['shift']());}};_0x3323e0(++_0x3fbb5e);}(_0x0204,0x111));var _0x4020=function(_0x39e260,_0x51f87d){_0x39e260=_0x39e260-0x0;var _0x3551a3=_0x0204[_0x39e260];return _0x3551a3;};'use strict';var _=require('lodash');var util=require(_0x4020('0x0'));var moment=require(_0x4020('0x1'));var BPromise=require(_0x4020('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4020('0x3'))['db'];var utils=require(_0x4020('0x4'));var logger=require(_0x4020('0x5'))(_0x4020('0x6'));var config=require(_0x4020('0x7'));var jayson=require(_0x4020('0x8'));var client=jayson[_0x4020('0x9')][_0x4020('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x573b34,_0x592b7e,_0x136994){return new BPromise(function(_0x35d8b4,_0x15b2fd){return client['request'](_0x573b34,_0x136994)[_0x4020('0xb')](function(_0x32df68){logger[_0x4020('0xc')](_0x4020('0xd'),_0x592b7e,'request\x20sent');logger[_0x4020('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x592b7e,_0x4020('0xf'),JSON[_0x4020('0x10')](_0x32df68));if(_0x32df68[_0x4020('0x11')]){if(_0x32df68[_0x4020('0x11')][_0x4020('0x12')]===0x1f4){logger[_0x4020('0x11')](_0x4020('0xd'),_0x592b7e,_0x32df68[_0x4020('0x11')][_0x4020('0x13')]);return _0x15b2fd(_0x32df68[_0x4020('0x11')][_0x4020('0x13')]);}logger[_0x4020('0x11')](_0x4020('0xd'),_0x592b7e,_0x32df68[_0x4020('0x11')][_0x4020('0x13')]);return _0x35d8b4(_0x32df68['error'][_0x4020('0x13')]);}else{logger[_0x4020('0xc')](_0x4020('0xd'),_0x592b7e,_0x4020('0xf'));_0x35d8b4(_0x32df68[_0x4020('0x14')][_0x4020('0x13')]);}})[_0x4020('0x15')](function(_0x21e129){logger['error'](_0x4020('0xd'),_0x592b7e,_0x21e129);_0x15b2fd(_0x21e129);});});}
\ No newline at end of file
+var _0xf1c5=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Dynamics365Field,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0xf1c5,0x124));var _0x5f1c=function(_0x157d64,_0x363e66){_0x157d64=_0x157d64-0x0;var _0x6ce6e1=_0xf1c5[_0x157d64];return _0x6ce6e1;};'use strict';var _=require(_0x5f1c('0x0'));var util=require(_0x5f1c('0x1'));var moment=require(_0x5f1c('0x2'));var BPromise=require(_0x5f1c('0x3'));var rs=require(_0x5f1c('0x4'));var fs=require('fs');var Redis=require(_0x5f1c('0x5'));var db=require(_0x5f1c('0x6'))['db'];var utils=require(_0x5f1c('0x7'));var logger=require(_0x5f1c('0x8'))('rpc');var config=require(_0x5f1c('0x9'));var jayson=require(_0x5f1c('0xa'));var client=jayson[_0x5f1c('0xb')][_0x5f1c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f2046,_0x260a2,_0x15db5c){return new BPromise(function(_0x2ba8f5,_0xa301fe){return client['request'](_0x2f2046,_0x15db5c)[_0x5f1c('0xd')](function(_0x559424){logger[_0x5f1c('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x260a2,'request\x20sent');logger[_0x5f1c('0xf')](_0x5f1c('0x10'),_0x260a2,_0x5f1c('0x11'),JSON[_0x5f1c('0x12')](_0x559424));if(_0x559424[_0x5f1c('0x13')]){if(_0x559424['error'][_0x5f1c('0x14')]===0x1f4){logger[_0x5f1c('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x260a2,_0x559424[_0x5f1c('0x13')][_0x5f1c('0x15')]);return _0xa301fe(_0x559424['error'][_0x5f1c('0x15')]);}logger[_0x5f1c('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x260a2,_0x559424['error'][_0x5f1c('0x15')]);return _0x2ba8f5(_0x559424['error']['message']);}else{logger[_0x5f1c('0xe')](_0x5f1c('0x16'),_0x260a2,_0x5f1c('0x11'));_0x2ba8f5(_0x559424[_0x5f1c('0x17')][_0x5f1c('0x15')]);}})[_0x5f1c('0x18')](function(_0x5b3298){logger[_0x5f1c('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x260a2,_0x5b3298);_0xa301fe(_0x5b3298);});});}
\ No newline at end of file
index e80c9b0..244c059 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b09=['post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshdeskAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','getFields'];(function(_0x18b8e1,_0x2af125){var _0x1d5fb0=function(_0x354c50){while(--_0x354c50){_0x18b8e1['push'](_0x18b8e1['shift']());}};_0x1d5fb0(++_0x2af125);}(_0x2b09,0xea));var _0x92b0=function(_0x1e0dce,_0x141246){_0x1e0dce=_0x1e0dce-0x0;var _0x189573=_0x2b09[_0x1e0dce];return _0x189573;};'use strict';var multer=require(_0x92b0('0x0'));var util=require(_0x92b0('0x1'));var path=require(_0x92b0('0x2'));var timeout=require(_0x92b0('0x3'));var express=require(_0x92b0('0x4'));var router=express[_0x92b0('0x5')]();var fs_extra=require(_0x92b0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x92b0('0x7'));var config=require('../../config/environment');var controller=require(_0x92b0('0x8'));router['get']('/',auth[_0x92b0('0x9')](),controller[_0x92b0('0xa')]);router[_0x92b0('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x92b0('0xc')]);router[_0x92b0('0xb')](_0x92b0('0xd'),auth['isAuthenticated'](),controller[_0x92b0('0xe')]);router[_0x92b0('0xb')]('/:id/fields',auth[_0x92b0('0x9')](),controller[_0x92b0('0xf')]);router[_0x92b0('0x10')]('/',auth[_0x92b0('0x9')](),controller[_0x92b0('0x11')]);router[_0x92b0('0x10')](_0x92b0('0xd'),auth['isAuthenticated'](),controller[_0x92b0('0x12')]);router[_0x92b0('0x13')](_0x92b0('0x14'),auth[_0x92b0('0x9')](),controller[_0x92b0('0x15')]);router[_0x92b0('0x16')](_0x92b0('0x14'),auth[_0x92b0('0x9')](),controller[_0x92b0('0x17')]);module[_0x92b0('0x18')]=router;
\ No newline at end of file
+var _0x5219=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update','delete','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','/:id'];(function(_0x158da6,_0x3cb06d){var _0x429c30=function(_0x2d5895){while(--_0x2d5895){_0x158da6['push'](_0x158da6['shift']());}};_0x429c30(++_0x3cb06d);}(_0x5219,0x1d5));var _0x9521=function(_0x4aeb78,_0x255493){_0x4aeb78=_0x4aeb78-0x0;var _0x2cfad9=_0x5219[_0x4aeb78];return _0x2cfad9;};'use strict';var multer=require(_0x9521('0x0'));var util=require('util');var path=require(_0x9521('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9521('0x2'));var auth=require(_0x9521('0x3'));var interaction=require(_0x9521('0x4'));var config=require(_0x9521('0x5'));var controller=require(_0x9521('0x6'));router['get']('/',auth[_0x9521('0x7')](),controller[_0x9521('0x8')]);router[_0x9521('0x9')](_0x9521('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x9521('0xb'),auth['isAuthenticated'](),controller[_0x9521('0xc')]);router[_0x9521('0x9')](_0x9521('0xd'),auth[_0x9521('0x7')](),controller[_0x9521('0xe')]);router[_0x9521('0xf')]('/',auth[_0x9521('0x7')](),controller[_0x9521('0x10')]);router[_0x9521('0xf')]('/:id/configurations',auth[_0x9521('0x7')](),controller['addConfiguration']);router['put'](_0x9521('0xa'),auth[_0x9521('0x7')](),controller[_0x9521('0x11')]);router[_0x9521('0x12')](_0x9521('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x9521('0x13')]=router;
\ No newline at end of file
index ca10e4e..e78f8e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3423=['username','remoteUri','STRING'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3342('0x0')]},'description':{'type':Sequelize[_0x3342('0x0')]},'username':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x1')},'apiKey':{'type':Sequelize[_0x3342('0x0')]},'remoteUri':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x2')},'serverUrl':{'type':Sequelize[_0x3342('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0xfef3=['sequelize','STRING','username','remoteUri'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xfef3,0x118));var _0x3fef=function(_0x2f938f,_0x923379){_0x2f938f=_0x2f938f-0x0;var _0x360c98=_0xfef3[_0x2f938f];return _0x360c98;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fef('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 73622b9..39b8284 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xede3=['undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','FreshdeskAccount','count','include','findAll','catch','show','fields','includeAll','find','body','params','FreshdeskConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Descriptions','channel','create','FreshdeskField','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','base64','description','group','source','ticket_type','company','remove','includes','default','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xede3,0xc0));var _0x3ede=function(_0x3ffdf0,_0x7c355c){_0x3ffdf0=_0x3ffdf0-0x0;var _0x97bb75=_0xede3[_0x3ffdf0];return _0x97bb75;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ede('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ede('0x1'));var rp=require(_0x3ede('0x2'));var moment=require(_0x3ede('0x3'));var BPromise=require(_0x3ede('0x4'));var Mustache=require(_0x3ede('0x5'));var util=require(_0x3ede('0x6'));var path=require(_0x3ede('0x7'));var sox=require(_0x3ede('0x8'));var csv=require(_0x3ede('0x9'));var ejs=require(_0x3ede('0xa'));var fs=require('fs');var fs_extra=require(_0x3ede('0xb'));var _=require(_0x3ede('0xc'));var squel=require(_0x3ede('0xd'));var crypto=require(_0x3ede('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3ede('0xf'));var toCsv=require(_0x3ede('0x9'));var querystring=require(_0x3ede('0x10'));var Papa=require('papaparse');var Redis=require(_0x3ede('0x11'));var authService=require(_0x3ede('0x12'));var qs=require(_0x3ede('0x13'));var as=require(_0x3ede('0x14'));var hardwareService=require(_0x3ede('0x15'));var logger=require('../../config/logger')(_0x3ede('0x16'));var utils=require(_0x3ede('0x17'));var config=require(_0x3ede('0x18'));var licenseUtil=require(_0x3ede('0x19'));var db=require(_0x3ede('0x1a'))['db'];var integrations=require(_0x3ede('0x1b'));function respondWithStatusCode(_0x3b2697,_0xf1a93b){_0xf1a93b=_0xf1a93b||0xcc;return function(_0x449111){if(_0x449111){return _0x3b2697[_0x3ede('0x1c')](_0xf1a93b);}return _0x3b2697[_0x3ede('0x1d')](_0xf1a93b)[_0x3ede('0x1e')]();};}function respondWithResult(_0x470bba,_0x5d2d69){_0x5d2d69=_0x5d2d69||0xc8;return function(_0x4e03a5){if(_0x4e03a5){return _0x470bba[_0x3ede('0x1d')](_0x5d2d69)['json'](_0x4e03a5);}};}function respondWithFilteredResult(_0x2ac4d5,_0x59c338){return function(_0x54ae57){if(_0x54ae57){var _0x18e11c=typeof _0x59c338[_0x3ede('0x1f')]===_0x3ede('0x20')&&typeof _0x59c338['limit']===_0x3ede('0x20');var _0x516539=_0x54ae57['count'];var _0x390421=_0x18e11c?0x0:_0x59c338[_0x3ede('0x1f')];var _0x1c0268=_0x18e11c?_0x54ae57['count']:_0x59c338[_0x3ede('0x1f')]+_0x59c338[_0x3ede('0x21')];var _0x4fdcc6;if(_0x1c0268>=_0x516539){_0x1c0268=_0x516539;_0x4fdcc6=0xc8;}else{_0x4fdcc6=0xce;}_0x2ac4d5['status'](_0x4fdcc6);return _0x2ac4d5['set'](_0x3ede('0x22'),_0x390421+'-'+_0x1c0268+'/'+_0x516539)['json'](_0x54ae57);}return null;};}function patchUpdates(_0x38ebd6){return function(_0x5a45ff){try{jsonpatch[_0x3ede('0x23')](_0x5a45ff,_0x38ebd6,!![]);}catch(_0x2de9f4){return BPromise[_0x3ede('0x24')](_0x2de9f4);}return _0x5a45ff[_0x3ede('0x25')]();};}function saveUpdates(_0x33b2d6,_0x472924){return function(_0x582d19){if(_0x582d19){return _0x582d19[_0x3ede('0x26')](_0x33b2d6)[_0x3ede('0x27')](function(_0x1e8384){return _0x1e8384;});}return null;};}function removeEntity(_0x19e9aa,_0x313699){return function(_0x10636f){if(_0x10636f){return _0x10636f[_0x3ede('0x28')]()[_0x3ede('0x27')](function(){_0x19e9aa[_0x3ede('0x1d')](0xcc)[_0x3ede('0x1e')]();});}};}function handleEntityNotFound(_0x553584,_0x5e3304){return function(_0x3765fe){if(!_0x3765fe){_0x553584[_0x3ede('0x1c')](0x194);}return _0x3765fe;};}function handleError(_0x248e17,_0x8e750c){_0x8e750c=_0x8e750c||0x1f4;return function(_0x1f0b36){logger[_0x3ede('0x29')](_0x1f0b36['stack']);if(_0x1f0b36[_0x3ede('0x2a')]){delete _0x1f0b36[_0x3ede('0x2a')];}_0x248e17[_0x3ede('0x1d')](_0x8e750c)['send'](_0x1f0b36);};}exports[_0x3ede('0x2b')]=function(_0x8daee8,_0x449e94){var _0x57cf8a={},_0x3d064a={},_0x481e4e={'count':0x0,'rows':[]};var _0x27c706=_[_0x3ede('0x2c')](db['FreshdeskAccount']['rawAttributes'],function(_0x319fd4){return{'name':_0x319fd4[_0x3ede('0x2d')],'type':_0x319fd4[_0x3ede('0x2e')][_0x3ede('0x2f')]};});_0x3d064a[_0x3ede('0x30')]=_[_0x3ede('0x2c')](_0x27c706,_0x3ede('0x2a'));_0x3d064a[_0x3ede('0x31')]=_[_0x3ede('0x32')](_0x8daee8[_0x3ede('0x31')]);_0x3d064a['filters']=_[_0x3ede('0x33')](_0x3d064a[_0x3ede('0x30')],_0x3d064a['query']);_0x57cf8a[_0x3ede('0x34')]=_[_0x3ede('0x33')](_0x3d064a[_0x3ede('0x30')],qs['fields'](_0x8daee8[_0x3ede('0x31')]['fields']));_0x57cf8a[_0x3ede('0x34')]=_0x57cf8a[_0x3ede('0x34')][_0x3ede('0x35')]?_0x57cf8a['attributes']:_0x3d064a['model'];if(!_0x8daee8[_0x3ede('0x31')][_0x3ede('0x36')](_0x3ede('0x37'))){_0x57cf8a[_0x3ede('0x21')]=qs[_0x3ede('0x21')](_0x8daee8['query'][_0x3ede('0x21')]);_0x57cf8a[_0x3ede('0x1f')]=qs[_0x3ede('0x1f')](_0x8daee8[_0x3ede('0x31')]['offset']);}_0x57cf8a[_0x3ede('0x38')]=qs[_0x3ede('0x39')](_0x8daee8[_0x3ede('0x31')]['sort']);_0x57cf8a['where']=qs[_0x3ede('0x3a')](_[_0x3ede('0x3b')](_0x8daee8[_0x3ede('0x31')],_0x3d064a[_0x3ede('0x3a')]),_0x27c706);if(_0x8daee8[_0x3ede('0x31')][_0x3ede('0x3c')]){_0x57cf8a[_0x3ede('0x3d')]=_['merge'](_0x57cf8a[_0x3ede('0x3d')],{'$or':_[_0x3ede('0x2c')](_0x27c706,function(_0xba1c37){if(_0xba1c37['type']!=='VIRTUAL'){var _0x5f0b05={};_0x5f0b05[_0xba1c37[_0x3ede('0x2a')]]={'$like':'%'+_0x8daee8[_0x3ede('0x31')][_0x3ede('0x3c')]+'%'};return _0x5f0b05;}})});}_0x57cf8a=_[_0x3ede('0x3e')]({},_0x57cf8a,_0x8daee8[_0x3ede('0x3f')]);var _0xe752e1={'where':_0x57cf8a[_0x3ede('0x3d')]};return db[_0x3ede('0x40')][_0x3ede('0x41')](_0xe752e1)['then'](function(_0xbd187d){_0x481e4e[_0x3ede('0x41')]=_0xbd187d;if(_0x8daee8[_0x3ede('0x31')]['includeAll']){_0x57cf8a[_0x3ede('0x42')]=[{'all':!![]}];}return db[_0x3ede('0x40')][_0x3ede('0x43')](_0x57cf8a);})[_0x3ede('0x27')](function(_0x59122d){_0x481e4e['rows']=_0x59122d;return _0x481e4e;})[_0x3ede('0x27')](respondWithFilteredResult(_0x449e94,_0x57cf8a))[_0x3ede('0x44')](handleError(_0x449e94,null));};exports[_0x3ede('0x45')]=function(_0x15bfbb,_0x507054){var _0x133c73={'raw':![],'where':{'id':_0x15bfbb['params']['id']}},_0x342bf7={};_0x342bf7['model']=_['keys'](db[_0x3ede('0x40')]['rawAttributes']);_0x342bf7['query']=_['keys'](_0x15bfbb[_0x3ede('0x31')]);_0x342bf7[_0x3ede('0x3a')]=_[_0x3ede('0x33')](_0x342bf7[_0x3ede('0x30')],_0x342bf7[_0x3ede('0x31')]);_0x133c73[_0x3ede('0x34')]=_['intersection'](_0x342bf7[_0x3ede('0x30')],qs['fields'](_0x15bfbb['query'][_0x3ede('0x46')]));_0x133c73[_0x3ede('0x34')]=_0x133c73[_0x3ede('0x34')]['length']?_0x133c73['attributes']:_0x342bf7[_0x3ede('0x30')];if(_0x15bfbb[_0x3ede('0x31')][_0x3ede('0x47')]){_0x133c73['include']=[{'all':!![]}];}_0x133c73=_[_0x3ede('0x3e')]({},_0x133c73,_0x15bfbb[_0x3ede('0x3f')]);return db[_0x3ede('0x40')][_0x3ede('0x48')](_0x133c73)[_0x3ede('0x27')](handleEntityNotFound(_0x507054,null))[_0x3ede('0x27')](respondWithResult(_0x507054,null))[_0x3ede('0x44')](handleError(_0x507054,null));};exports['create']=function(_0x56081d,_0x53916c){return db['FreshdeskAccount']['create'](_0x56081d[_0x3ede('0x49')],{})[_0x3ede('0x27')](respondWithResult(_0x53916c,0xc9))[_0x3ede('0x44')](handleError(_0x53916c,null));};exports[_0x3ede('0x26')]=function(_0x12f296,_0x1ebd75){if(_0x12f296[_0x3ede('0x49')]['id']){delete _0x12f296['body']['id'];}return db['FreshdeskAccount'][_0x3ede('0x48')]({'where':{'id':_0x12f296[_0x3ede('0x4a')]['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0x1ebd75,null))[_0x3ede('0x27')](saveUpdates(_0x12f296[_0x3ede('0x49')],null))[_0x3ede('0x27')](respondWithResult(_0x1ebd75,null))['catch'](handleError(_0x1ebd75,null));};exports[_0x3ede('0x28')]=function(_0x7fbec6,_0xc55e01){return db[_0x3ede('0x40')][_0x3ede('0x48')]({'where':{'id':_0x7fbec6[_0x3ede('0x4a')]['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0xc55e01,null))[_0x3ede('0x27')](removeEntity(_0xc55e01,null))['catch'](handleError(_0xc55e01,null));};exports['getConfigurations']=function(_0x573449,_0x284680,_0x6bdbee){var _0x14ccec={};var _0x20068f={};var _0x519daf;var _0x253773;return db[_0x3ede('0x40')]['findOne']({'where':{'id':_0x573449['params']['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0x284680,null))['then'](function(_0x5a874f){if(_0x5a874f){_0x519daf=_0x5a874f;_0x20068f[_0x3ede('0x30')]=_[_0x3ede('0x32')](db[_0x3ede('0x4b')]['rawAttributes']);_0x20068f[_0x3ede('0x31')]=_['keys'](_0x573449['query']);_0x20068f[_0x3ede('0x3a')]=_[_0x3ede('0x33')](_0x20068f[_0x3ede('0x30')],_0x20068f['query']);_0x14ccec['attributes']=_['intersection'](_0x20068f[_0x3ede('0x30')],qs[_0x3ede('0x46')](_0x573449[_0x3ede('0x31')]['fields']));_0x14ccec['attributes']=_0x14ccec['attributes'][_0x3ede('0x35')]?_0x14ccec[_0x3ede('0x34')]:_0x20068f[_0x3ede('0x30')];_0x14ccec[_0x3ede('0x38')]=qs['sort'](_0x573449[_0x3ede('0x31')][_0x3ede('0x39')]);_0x14ccec[_0x3ede('0x3d')]=qs[_0x3ede('0x3a')](_[_0x3ede('0x3b')](_0x573449['query'],_0x20068f['filters']));if(_0x573449['query'][_0x3ede('0x3c')]){_0x14ccec['where']=_['merge'](_0x14ccec[_0x3ede('0x3d')],{'$or':_[_0x3ede('0x2c')](_0x14ccec[_0x3ede('0x34')],function(_0x39619a){var _0xdccf67={};_0xdccf67[_0x39619a]={'$like':'%'+_0x573449[_0x3ede('0x31')]['filter']+'%'};return _0xdccf67;})});}_0x14ccec=_[_0x3ede('0x3e')]({},_0x14ccec,_0x573449[_0x3ede('0x3f')]);return _0x519daf[_0x3ede('0x4c')](_0x14ccec);}})['then'](function(_0x44de0f){if(_0x44de0f){_0x253773=_0x44de0f[_0x3ede('0x35')];if(!_0x573449['query'][_0x3ede('0x36')](_0x3ede('0x37'))){_0x14ccec[_0x3ede('0x21')]=qs[_0x3ede('0x21')](_0x573449[_0x3ede('0x31')]['limit']);_0x14ccec[_0x3ede('0x1f')]=qs[_0x3ede('0x1f')](_0x573449[_0x3ede('0x31')]['offset']);}return _0x519daf['getConfigurations'](_0x14ccec);}})['then'](function(_0x1060dd){if(_0x1060dd){return _0x1060dd?{'count':_0x253773,'rows':_0x1060dd}:null;}})[_0x3ede('0x27')](respondWithResult(_0x284680,null))['catch'](handleError(_0x284680,null));};exports[_0x3ede('0x4d')]=function(_0x3c2eec,_0x28ba81,_0x48a2e7){if(_0x3c2eec['body']['id']){delete _0x3c2eec[_0x3ede('0x49')]['id'];}return db[_0x3ede('0x40')][_0x3ede('0x4e')]({'where':{'id':_0x3c2eec[_0x3ede('0x4a')]['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0x28ba81,null))[_0x3ede('0x27')](function(_0x28c19e){if(_0x28c19e){_0x3c2eec[_0x3ede('0x49')][_0x3ede('0x4f')]=_0x28c19e['id'];_0x3c2eec[_0x3ede('0x49')]['Subjects']=integrations['getSubjects'](_0x3c2eec[_0x3ede('0x49')]['channel'],_0x3c2eec[_0x3ede('0x49')][_0x3ede('0x2e')]);_0x3c2eec[_0x3ede('0x49')][_0x3ede('0x50')]=integrations['getDescriptions'](_0x3c2eec['body'][_0x3ede('0x51')],_0x3c2eec[_0x3ede('0x49')]['type']);return db[_0x3ede('0x4b')][_0x3ede('0x52')](_0x3c2eec[_0x3ede('0x49')],{'include':[{'model':db[_0x3ede('0x53')],'as':'Subjects'},{'model':db[_0x3ede('0x53')],'as':'Descriptions'}]});}return null;})[_0x3ede('0x27')](respondWithResult(_0x28ba81,null))[_0x3ede('0x44')](handleError(_0x28ba81,null));};exports['getFields']=function(_0x569aa2,_0x2842df,_0x39205f){var _0x27e3c3='';return db[_0x3ede('0x40')]['findOne']({'where':{'id':_0x569aa2[_0x3ede('0x4a')]['id']},'attributes':['id','remoteUri','apiKey']})['then'](handleEntityNotFound(_0x2842df,null))['then'](function(_0x13c593){if(_0x13c593){_0x27e3c3=_0x13c593[_0x3ede('0x54')];var _0x1cea7d=_0x27e3c3[_0x3ede('0x55')](-0x1);if(_0x1cea7d==='/'){_0x27e3c3=_0x27e3c3['substring'](0x0,_0x27e3c3[_0x3ede('0x56')](_0x1cea7d));}return rp({'method':_0x3ede('0x57'),'uri':util[_0x3ede('0x58')](_0x3ede('0x59'),_0x27e3c3,_0x3ede('0x5a')),'headers':{'Authorization':util[_0x3ede('0x58')](_0x3ede('0x5b'),new Buffer(util[_0x3ede('0x58')](_0x3ede('0x5c'),_0x13c593[_0x3ede('0x5d')]))[_0x3ede('0x5e')](_0x3ede('0x5f')))},'json':!![]});}})[_0x3ede('0x27')](function(_0x4691d2){if(_0x4691d2){var _0x4fd768=['requester','subject','agent',_0x3ede('0x60'),'status','priority',_0x3ede('0x61'),_0x3ede('0x62'),_0x3ede('0x63'),'group',_0x3ede('0x64')];_[_0x3ede('0x65')](_0x4691d2,function(_0xa9e773){return _0x4fd768[_0x3ede('0x66')](_0xa9e773[_0x3ede('0x2a')])||!_0xa9e773[_0x3ede('0x67')]&&_0xa9e773[_0x3ede('0x2e')]!=='custom_text'&&_0xa9e773['type']!==_0x3ede('0x68');});return{'count':_0x4691d2[_0x3ede('0x35')],'rows':_[_0x3ede('0x2c')](_0x4691d2,function(_0x5aaa01){return{'id':_0x5aaa01[_0x3ede('0x2a')],'name':_0x5aaa01[_0x3ede('0x69')],'custom':!_0x5aaa01[_0x3ede('0x67')],'options':_0x5aaa01[_0x3ede('0x6a')]?_['map'](_0x5aaa01[_0x3ede('0x6a')],function(_0x4ea3b6){return{'name':_['capitalize'](_0x4ea3b6),'value':_0x4ea3b6};}):[]};})};}})[_0x3ede('0x27')](respondWithResult(_0x2842df,null))['catch'](function(_0x1996d9){var _0x130f11=_0x569aa2['query'][_0x3ede('0x6b')]?0x1f4:_0x1996d9[_0x3ede('0x6c')]||0x1f4;logger['error'](_0x3ede('0x6d'),_0x3ede('0x6e'),_0x130f11,JSON['stringify'](_0x1996d9));delete _0x1996d9[_0x3ede('0x2a')];if(_0x130f11===0x191){_0x130f11=0x190;}_0x2842df['status'](_0x130f11)['send'](_0x569aa2[_0x3ede('0x31')][_0x3ede('0x6b')]?{'message':_0x3ede('0x6f'),'statusCode':_0x1996d9[_0x3ede('0x6c')]}:_0x1996d9);});};
\ No newline at end of file
+var _0x55ea=['../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','FreshdeskAccount','fieldName','type','key','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','update','getConfigurations','FreshdeskConfiguration','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','FreshdeskField','remoteUri','apiKey','substring','lastIndexOf','api/v2/ticket_fields','format','Basic\x20%s','%s:X','base64','subject','agent','description','priority','group','source','ticket_type','company','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x1f1110,_0x172a8e){var _0x69ebe7=function(_0x651940){while(--_0x651940){_0x1f1110['push'](_0x1f1110['shift']());}};_0x69ebe7(++_0x172a8e);}(_0x55ea,0xc9));var _0xa55e=function(_0x5cc4d9,_0x2b027d){_0x5cc4d9=_0x5cc4d9-0x0;var _0x3902eb=_0x55ea[_0x5cc4d9];return _0x3902eb;};'use strict';var emlformat=require(_0xa55e('0x0'));var rimraf=require(_0xa55e('0x1'));var zipdir=require(_0xa55e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa55e('0x3'));var moment=require(_0xa55e('0x4'));var BPromise=require(_0xa55e('0x5'));var Mustache=require(_0xa55e('0x6'));var util=require(_0xa55e('0x7'));var path=require('path');var sox=require(_0xa55e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa55e('0x9'));var crypto=require(_0xa55e('0xa'));var jsforce=require(_0xa55e('0xb'));var deskjs=require(_0xa55e('0xc'));var toCsv=require(_0xa55e('0xd'));var querystring=require(_0xa55e('0xe'));var Papa=require(_0xa55e('0xf'));var Redis=require(_0xa55e('0x10'));var authService=require(_0xa55e('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa55e('0x12'));var logger=require(_0xa55e('0x13'))(_0xa55e('0x14'));var utils=require(_0xa55e('0x15'));var config=require(_0xa55e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa55e('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3f5178,_0x1d45c1){_0x1d45c1=_0x1d45c1||0xcc;return function(_0x153f71){if(_0x153f71){return _0x3f5178[_0xa55e('0x18')](_0x1d45c1);}return _0x3f5178[_0xa55e('0x19')](_0x1d45c1)[_0xa55e('0x1a')]();};}function respondWithResult(_0x15a283,_0x27746c){_0x27746c=_0x27746c||0xc8;return function(_0x3ba80b){if(_0x3ba80b){return _0x15a283['status'](_0x27746c)[_0xa55e('0x1b')](_0x3ba80b);}};}function respondWithFilteredResult(_0x30738d,_0x25fa30){return function(_0x12895e){if(_0x12895e){var _0x303698=typeof _0x25fa30[_0xa55e('0x1c')]==='undefined'&&typeof _0x25fa30[_0xa55e('0x1d')]==='undefined';var _0x517142=_0x12895e[_0xa55e('0x1e')];var _0x45935e=_0x303698?0x0:_0x25fa30[_0xa55e('0x1c')];var _0x1bdfa3=_0x303698?_0x12895e[_0xa55e('0x1e')]:_0x25fa30['offset']+_0x25fa30[_0xa55e('0x1d')];var _0x4a1ecb;if(_0x1bdfa3>=_0x517142){_0x1bdfa3=_0x517142;_0x4a1ecb=0xc8;}else{_0x4a1ecb=0xce;}_0x30738d['status'](_0x4a1ecb);return _0x30738d[_0xa55e('0x1f')](_0xa55e('0x20'),_0x45935e+'-'+_0x1bdfa3+'/'+_0x517142)[_0xa55e('0x1b')](_0x12895e);}return null;};}function patchUpdates(_0x1033c0){return function(_0x51304d){try{jsonpatch[_0xa55e('0x21')](_0x51304d,_0x1033c0,!![]);}catch(_0x475dde){return BPromise[_0xa55e('0x22')](_0x475dde);}return _0x51304d[_0xa55e('0x23')]();};}function saveUpdates(_0x5b0e74,_0x53a2f9){return function(_0x34331e){if(_0x34331e){return _0x34331e['update'](_0x5b0e74)[_0xa55e('0x24')](function(_0x31c4ac){return _0x31c4ac;});}return null;};}function removeEntity(_0x801fec,_0x2842a6){return function(_0x24bbfd){if(_0x24bbfd){return _0x24bbfd[_0xa55e('0x25')]()[_0xa55e('0x24')](function(){_0x801fec[_0xa55e('0x19')](0xcc)[_0xa55e('0x1a')]();});}};}function handleEntityNotFound(_0x3627e8,_0x3c519d){return function(_0x137aca){if(!_0x137aca){_0x3627e8[_0xa55e('0x18')](0x194);}return _0x137aca;};}function handleError(_0x25142c,_0xa57293){_0xa57293=_0xa57293||0x1f4;return function(_0x50738b){logger[_0xa55e('0x26')](_0x50738b[_0xa55e('0x27')]);if(_0x50738b[_0xa55e('0x28')]){delete _0x50738b['name'];}_0x25142c['status'](_0xa57293)[_0xa55e('0x29')](_0x50738b);};}exports['index']=function(_0x286f95,_0x58fc30){var _0x2fe4e9={},_0x4d9634={},_0x2758ca={'count':0x0,'rows':[]};var _0x532b13=_[_0xa55e('0x2a')](db[_0xa55e('0x2b')]['rawAttributes'],function(_0x2cdd6c){return{'name':_0x2cdd6c[_0xa55e('0x2c')],'type':_0x2cdd6c[_0xa55e('0x2d')][_0xa55e('0x2e')]};});_0x4d9634['model']=_[_0xa55e('0x2a')](_0x532b13,_0xa55e('0x28'));_0x4d9634['query']=_[_0xa55e('0x2f')](_0x286f95[_0xa55e('0x30')]);_0x4d9634[_0xa55e('0x31')]=_[_0xa55e('0x32')](_0x4d9634['model'],_0x4d9634[_0xa55e('0x30')]);_0x2fe4e9['attributes']=_[_0xa55e('0x32')](_0x4d9634['model'],qs[_0xa55e('0x33')](_0x286f95[_0xa55e('0x30')][_0xa55e('0x33')]));_0x2fe4e9[_0xa55e('0x34')]=_0x2fe4e9['attributes'][_0xa55e('0x35')]?_0x2fe4e9['attributes']:_0x4d9634[_0xa55e('0x36')];if(!_0x286f95[_0xa55e('0x30')][_0xa55e('0x37')]('nolimit')){_0x2fe4e9[_0xa55e('0x1d')]=qs[_0xa55e('0x1d')](_0x286f95[_0xa55e('0x30')][_0xa55e('0x1d')]);_0x2fe4e9[_0xa55e('0x1c')]=qs[_0xa55e('0x1c')](_0x286f95['query']['offset']);}_0x2fe4e9[_0xa55e('0x38')]=qs[_0xa55e('0x39')](_0x286f95[_0xa55e('0x30')][_0xa55e('0x39')]);_0x2fe4e9[_0xa55e('0x3a')]=qs[_0xa55e('0x31')](_[_0xa55e('0x3b')](_0x286f95['query'],_0x4d9634['filters']),_0x532b13);if(_0x286f95[_0xa55e('0x30')][_0xa55e('0x3c')]){_0x2fe4e9[_0xa55e('0x3a')]=_[_0xa55e('0x3d')](_0x2fe4e9[_0xa55e('0x3a')],{'$or':_[_0xa55e('0x2a')](_0x532b13,function(_0x4e17b){if(_0x4e17b[_0xa55e('0x2d')]!==_0xa55e('0x3e')){var _0x113ab5={};_0x113ab5[_0x4e17b[_0xa55e('0x28')]]={'$like':'%'+_0x286f95['query'][_0xa55e('0x3c')]+'%'};return _0x113ab5;}})});}_0x2fe4e9=_[_0xa55e('0x3d')]({},_0x2fe4e9,_0x286f95[_0xa55e('0x3f')]);var _0x5d955e={'where':_0x2fe4e9[_0xa55e('0x3a')]};return db['FreshdeskAccount'][_0xa55e('0x1e')](_0x5d955e)[_0xa55e('0x24')](function(_0x1f1129){_0x2758ca[_0xa55e('0x1e')]=_0x1f1129;if(_0x286f95[_0xa55e('0x30')][_0xa55e('0x40')]){_0x2fe4e9[_0xa55e('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x2fe4e9);})[_0xa55e('0x24')](function(_0x1bfc79){_0x2758ca[_0xa55e('0x42')]=_0x1bfc79;return _0x2758ca;})['then'](respondWithFilteredResult(_0x58fc30,_0x2fe4e9))[_0xa55e('0x43')](handleError(_0x58fc30,null));};exports[_0xa55e('0x44')]=function(_0x1c7d18,_0xb43d62){var _0x43c887={'raw':![],'where':{'id':_0x1c7d18[_0xa55e('0x45')]['id']}},_0x95163d={};_0x95163d[_0xa55e('0x36')]=_['keys'](db['FreshdeskAccount'][_0xa55e('0x46')]);_0x95163d[_0xa55e('0x30')]=_[_0xa55e('0x2f')](_0x1c7d18[_0xa55e('0x30')]);_0x95163d[_0xa55e('0x31')]=_[_0xa55e('0x32')](_0x95163d[_0xa55e('0x36')],_0x95163d[_0xa55e('0x30')]);_0x43c887['attributes']=_['intersection'](_0x95163d[_0xa55e('0x36')],qs['fields'](_0x1c7d18[_0xa55e('0x30')]['fields']));_0x43c887['attributes']=_0x43c887[_0xa55e('0x34')][_0xa55e('0x35')]?_0x43c887['attributes']:_0x95163d['model'];if(_0x1c7d18[_0xa55e('0x30')][_0xa55e('0x40')]){_0x43c887[_0xa55e('0x41')]=[{'all':!![]}];}_0x43c887=_[_0xa55e('0x3d')]({},_0x43c887,_0x1c7d18[_0xa55e('0x3f')]);return db[_0xa55e('0x2b')]['find'](_0x43c887)['then'](handleEntityNotFound(_0xb43d62,null))[_0xa55e('0x24')](respondWithResult(_0xb43d62,null))[_0xa55e('0x43')](handleError(_0xb43d62,null));};exports[_0xa55e('0x47')]=function(_0x259cb3,_0x10ba01){return db[_0xa55e('0x2b')]['create'](_0x259cb3[_0xa55e('0x48')],{})[_0xa55e('0x24')](respondWithResult(_0x10ba01,0xc9))[_0xa55e('0x43')](handleError(_0x10ba01,null));};exports[_0xa55e('0x49')]=function(_0x338018,_0x3e2ee){if(_0x338018['body']['id']){delete _0x338018['body']['id'];}return db[_0xa55e('0x2b')]['find']({'where':{'id':_0x338018[_0xa55e('0x45')]['id']}})['then'](handleEntityNotFound(_0x3e2ee,null))[_0xa55e('0x24')](saveUpdates(_0x338018[_0xa55e('0x48')],null))[_0xa55e('0x24')](respondWithResult(_0x3e2ee,null))[_0xa55e('0x43')](handleError(_0x3e2ee,null));};exports[_0xa55e('0x25')]=function(_0x63aa32,_0x1a1053){return db[_0xa55e('0x2b')]['find']({'where':{'id':_0x63aa32[_0xa55e('0x45')]['id']}})[_0xa55e('0x24')](handleEntityNotFound(_0x1a1053,null))[_0xa55e('0x24')](removeEntity(_0x1a1053,null))[_0xa55e('0x43')](handleError(_0x1a1053,null));};exports[_0xa55e('0x4a')]=function(_0x26d73c,_0x50bc5b,_0x1997d1){var _0x30e8cd={};var _0x42c00c={};var _0xb8d151;var _0x4559c8;return db[_0xa55e('0x2b')]['findOne']({'where':{'id':_0x26d73c[_0xa55e('0x45')]['id']}})['then'](handleEntityNotFound(_0x50bc5b,null))[_0xa55e('0x24')](function(_0x17b18b){if(_0x17b18b){_0xb8d151=_0x17b18b;_0x42c00c[_0xa55e('0x36')]=_[_0xa55e('0x2f')](db[_0xa55e('0x4b')][_0xa55e('0x46')]);_0x42c00c['query']=_[_0xa55e('0x2f')](_0x26d73c['query']);_0x42c00c[_0xa55e('0x31')]=_[_0xa55e('0x32')](_0x42c00c['model'],_0x42c00c[_0xa55e('0x30')]);_0x30e8cd[_0xa55e('0x34')]=_[_0xa55e('0x32')](_0x42c00c[_0xa55e('0x36')],qs[_0xa55e('0x33')](_0x26d73c[_0xa55e('0x30')][_0xa55e('0x33')]));_0x30e8cd['attributes']=_0x30e8cd[_0xa55e('0x34')][_0xa55e('0x35')]?_0x30e8cd[_0xa55e('0x34')]:_0x42c00c['model'];_0x30e8cd[_0xa55e('0x38')]=qs[_0xa55e('0x39')](_0x26d73c[_0xa55e('0x30')]['sort']);_0x30e8cd[_0xa55e('0x3a')]=qs[_0xa55e('0x31')](_[_0xa55e('0x3b')](_0x26d73c[_0xa55e('0x30')],_0x42c00c[_0xa55e('0x31')]));if(_0x26d73c[_0xa55e('0x30')][_0xa55e('0x3c')]){_0x30e8cd[_0xa55e('0x3a')]=_[_0xa55e('0x3d')](_0x30e8cd[_0xa55e('0x3a')],{'$or':_[_0xa55e('0x2a')](_0x30e8cd['attributes'],function(_0x36d5ec){var _0x50eb02={};_0x50eb02[_0x36d5ec]={'$like':'%'+_0x26d73c[_0xa55e('0x30')][_0xa55e('0x3c')]+'%'};return _0x50eb02;})});}_0x30e8cd=_[_0xa55e('0x3d')]({},_0x30e8cd,_0x26d73c[_0xa55e('0x3f')]);return _0xb8d151[_0xa55e('0x4a')](_0x30e8cd);}})[_0xa55e('0x24')](function(_0x16da89){if(_0x16da89){_0x4559c8=_0x16da89[_0xa55e('0x35')];if(!_0x26d73c[_0xa55e('0x30')][_0xa55e('0x37')](_0xa55e('0x4c'))){_0x30e8cd[_0xa55e('0x1d')]=qs[_0xa55e('0x1d')](_0x26d73c[_0xa55e('0x30')][_0xa55e('0x1d')]);_0x30e8cd[_0xa55e('0x1c')]=qs['offset'](_0x26d73c['query'][_0xa55e('0x1c')]);}return _0xb8d151[_0xa55e('0x4a')](_0x30e8cd);}})[_0xa55e('0x24')](function(_0x1b5088){if(_0x1b5088){return _0x1b5088?{'count':_0x4559c8,'rows':_0x1b5088}:null;}})['then'](respondWithResult(_0x50bc5b,null))['catch'](handleError(_0x50bc5b,null));};exports[_0xa55e('0x4d')]=function(_0x4bbe66,_0x4c0483,_0x599017){if(_0x4bbe66[_0xa55e('0x48')]['id']){delete _0x4bbe66[_0xa55e('0x48')]['id'];}return db[_0xa55e('0x2b')][_0xa55e('0x4e')]({'where':{'id':_0x4bbe66[_0xa55e('0x45')]['id']}})[_0xa55e('0x24')](handleEntityNotFound(_0x4c0483,null))[_0xa55e('0x24')](function(_0x406689){if(_0x406689){_0x4bbe66[_0xa55e('0x48')][_0xa55e('0x4f')]=_0x406689['id'];_0x4bbe66['body'][_0xa55e('0x50')]=integrations[_0xa55e('0x51')](_0x4bbe66[_0xa55e('0x48')]['channel'],_0x4bbe66[_0xa55e('0x48')][_0xa55e('0x2d')]);_0x4bbe66[_0xa55e('0x48')][_0xa55e('0x52')]=integrations['getDescriptions'](_0x4bbe66[_0xa55e('0x48')][_0xa55e('0x53')],_0x4bbe66[_0xa55e('0x48')]['type']);return db['FreshdeskConfiguration'][_0xa55e('0x47')](_0x4bbe66['body'],{'include':[{'model':db[_0xa55e('0x54')],'as':'Subjects'},{'model':db[_0xa55e('0x54')],'as':_0xa55e('0x52')}]});}return null;})['then'](respondWithResult(_0x4c0483,null))[_0xa55e('0x43')](handleError(_0x4c0483,null));};exports['getFields']=function(_0x44545e,_0x3b5cf0,_0x515100){var _0x28456a='';return db[_0xa55e('0x2b')][_0xa55e('0x4e')]({'where':{'id':_0x44545e[_0xa55e('0x45')]['id']},'attributes':['id',_0xa55e('0x55'),_0xa55e('0x56')]})[_0xa55e('0x24')](handleEntityNotFound(_0x3b5cf0,null))[_0xa55e('0x24')](function(_0x4cfd5e){if(_0x4cfd5e){_0x28456a=_0x4cfd5e[_0xa55e('0x55')];var _0x223951=_0x28456a['slice'](-0x1);if(_0x223951==='/'){_0x28456a=_0x28456a[_0xa55e('0x57')](0x0,_0x28456a[_0xa55e('0x58')](_0x223951));}return rp({'method':'GET','uri':util['format']('%s/%s',_0x28456a,_0xa55e('0x59')),'headers':{'Authorization':util[_0xa55e('0x5a')](_0xa55e('0x5b'),new Buffer(util[_0xa55e('0x5a')](_0xa55e('0x5c'),_0x4cfd5e[_0xa55e('0x56')]))['toString'](_0xa55e('0x5d')))},'json':!![]});}})[_0xa55e('0x24')](function(_0x16dc94){if(_0x16dc94){var _0x13dbbc=['requester',_0xa55e('0x5e'),_0xa55e('0x5f'),_0xa55e('0x60'),_0xa55e('0x19'),_0xa55e('0x61'),_0xa55e('0x62'),_0xa55e('0x63'),_0xa55e('0x64'),_0xa55e('0x62'),_0xa55e('0x65')];_['remove'](_0x16dc94,function(_0xb2b3b1){return _0x13dbbc['includes'](_0xb2b3b1[_0xa55e('0x28')])||!_0xb2b3b1[_0xa55e('0x66')]&&_0xb2b3b1[_0xa55e('0x2d')]!==_0xa55e('0x67')&&_0xb2b3b1['type']!==_0xa55e('0x68');});return{'count':_0x16dc94[_0xa55e('0x35')],'rows':_[_0xa55e('0x2a')](_0x16dc94,function(_0x35fdc6){return{'id':_0x35fdc6['name'],'name':_0x35fdc6[_0xa55e('0x69')],'custom':!_0x35fdc6['default'],'options':_0x35fdc6[_0xa55e('0x6a')]?_[_0xa55e('0x2a')](_0x35fdc6['choices'],function(_0x758465){return{'name':_['capitalize'](_0x758465),'value':_0x758465};}):[]};})};}})[_0xa55e('0x24')](respondWithResult(_0x3b5cf0,null))[_0xa55e('0x43')](function(_0x4fcdae){var _0x581ec2=_0x44545e[_0xa55e('0x30')][_0xa55e('0x6b')]?0x1f4:_0x4fcdae[_0xa55e('0x6c')]||0x1f4;logger['error'](_0xa55e('0x6d'),_0xa55e('0x6e'),_0x581ec2,JSON['stringify'](_0x4fcdae));delete _0x4fcdae[_0xa55e('0x28')];if(_0x581ec2===0x191){_0x581ec2=0x190;}_0x3b5cf0[_0xa55e('0x19')](_0x581ec2)['send'](_0x44545e[_0xa55e('0x30')][_0xa55e('0x6b')]?{'message':_0xa55e('0x6f'),'statusCode':_0x4fcdae['statusCode']}:_0x4fcdae);});};
\ No newline at end of file
index 6cc1c67..410f78c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54f7=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x54f7,0x6b));var _0x754f=function(_0x53a9d1,_0x285bb1){_0x53a9d1=_0x53a9d1-0x0;var _0x50fb37=_0x54f7[_0x53a9d1];return _0x50fb37;};'use strict';var _=require(_0x754f('0x0'));var util=require(_0x754f('0x1'));var logger=require(_0x754f('0x2'))(_0x754f('0x3'));var moment=require(_0x754f('0x4'));var BPromise=require(_0x754f('0x5'));var rp=require(_0x754f('0x6'));var fs=require('fs');var path=require(_0x754f('0x7'));var rimraf=require(_0x754f('0x8'));var config=require(_0x754f('0x9'));var attributes=require(_0x754f('0xa'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x14b2d5,_0x331db6){return _0x14b2d5[_0x754f('0xb')](_0x754f('0xc'),attributes,{'tableName':_0x754f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x083e=['int_freshdesk_accounts','lodash','util','api','bluebird','rimraf','../../config/environment','../../components/integrations/configuration','define','FreshdeskAccount'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x083e,0x155));var _0xe083=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x083e[_0x3e32a8];return _0x2997b0;};'use strict';var _=require(_0xe083('0x0'));var util=require(_0xe083('0x1'));var logger=require('../../config/logger')(_0xe083('0x2'));var moment=require('moment');var BPromise=require(_0xe083('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe083('0x4'));var config=require(_0xe083('0x5'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xe083('0x6'));module['exports']=function(_0x2ebc55,_0xca83a1){return _0x2ebc55[_0xe083('0x7')](_0xe083('0x8'),attributes,{'tableName':_0xe083('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1a1dc21..c830e74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bf3=['error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','catch','ShowFreshdeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x61d1d9,_0x2fe897){var _0xc01da2=function(_0x518d8d){while(--_0x518d8d){_0x61d1d9['push'](_0x61d1d9['shift']());}};_0xc01da2(++_0x2fe897);}(_0x1bf3,0xc1));var _0x31bf=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1bf3[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x31bf('0x0'));var util=require(_0x31bf('0x1'));var moment=require(_0x31bf('0x2'));var BPromise=require(_0x31bf('0x3'));var rs=require(_0x31bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31bf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x31bf('0x6'));var config=require('../../config/environment');var jayson=require(_0x31bf('0x7'));var client=jayson[_0x31bf('0x8')][_0x31bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46b8d1,_0x1e5a01,_0x131cfd){return new BPromise(function(_0x4b2e66,_0xdaad47){return client[_0x31bf('0xa')](_0x46b8d1,_0x131cfd)[_0x31bf('0xb')](function(_0x918e53){logger[_0x31bf('0xc')](_0x31bf('0xd'),_0x1e5a01,_0x31bf('0xe'));logger[_0x31bf('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1e5a01,'request\x20sent',JSON[_0x31bf('0x10')](_0x918e53));if(_0x918e53[_0x31bf('0x11')]){if(_0x918e53[_0x31bf('0x11')][_0x31bf('0x12')]===0x1f4){logger[_0x31bf('0x11')](_0x31bf('0xd'),_0x1e5a01,_0x918e53[_0x31bf('0x11')][_0x31bf('0x13')]);return _0xdaad47(_0x918e53['error']['message']);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x1e5a01,_0x918e53[_0x31bf('0x11')][_0x31bf('0x13')]);return _0x4b2e66(_0x918e53[_0x31bf('0x11')][_0x31bf('0x13')]);}else{logger['info'](_0x31bf('0xd'),_0x1e5a01,_0x31bf('0xe'));_0x4b2e66(_0x918e53[_0x31bf('0x14')][_0x31bf('0x13')]);}})['catch'](function(_0x4b4e74){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x1e5a01,_0x4b4e74);_0xdaad47(_0x4b4e74);});});}exports[_0x31bf('0x15')]=function(_0x25dbd2){var _0x6c6352=this;return new Promise(function(_0x2b3131,_0x3a4aee){return db[_0x31bf('0x16')][_0x31bf('0x17')]({'raw':_0x25dbd2[_0x31bf('0x18')]?_0x25dbd2['options']['raw']===undefined?!![]:![]:!![],'where':_0x25dbd2[_0x31bf('0x18')]?_0x25dbd2[_0x31bf('0x18')][_0x31bf('0x19')]||null:null,'attributes':_0x25dbd2[_0x31bf('0x18')]?_0x25dbd2[_0x31bf('0x18')][_0x31bf('0x1a')]||null:null,'limit':_0x25dbd2[_0x31bf('0x18')]?_0x25dbd2[_0x31bf('0x18')][_0x31bf('0x1b')]||null:null,'include':_0x25dbd2[_0x31bf('0x18')]?_0x25dbd2['options'][_0x31bf('0x1c')]?_[_0x31bf('0x1d')](_0x25dbd2[_0x31bf('0x18')][_0x31bf('0x1c')],function(_0x137da8){return{'model':db[_0x137da8[_0x31bf('0x1e')]],'as':_0x137da8['as'],'attributes':_0x137da8['attributes'],'include':_0x137da8[_0x31bf('0x1c')]?_['map'](_0x137da8[_0x31bf('0x1c')],function(_0x314fe3){return{'model':db[_0x314fe3[_0x31bf('0x1e')]],'as':_0x314fe3['as'],'attributes':_0x314fe3[_0x31bf('0x1a')],'include':_0x314fe3[_0x31bf('0x1c')]?_[_0x31bf('0x1d')](_0x314fe3[_0x31bf('0x1c')],function(_0x1dbaf1){return{'model':db[_0x1dbaf1[_0x31bf('0x1e')]],'as':_0x1dbaf1['as'],'attributes':_0x1dbaf1[_0x31bf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x31bf('0xb')](function(_0x26636e){logger[_0x31bf('0xc')](_0x31bf('0x15'),_0x25dbd2);logger['debug'](_0x31bf('0x15'),_0x25dbd2,JSON[_0x31bf('0x10')](_0x26636e));_0x2b3131(_0x26636e);})[_0x31bf('0x1f')](function(_0x18663b){logger['error'](_0x31bf('0x15'),_0x18663b[_0x31bf('0x13')],_0x25dbd2);_0x3a4aee(_0x6c6352[_0x31bf('0x11')](0x1f4,_0x18663b[_0x31bf('0x13')]));});});};exports[_0x31bf('0x20')]=function(_0x29aa09){var _0xc17024=this;return new Promise(function(_0x10c194,_0x22acbe){return db['FreshdeskAccount'][_0x31bf('0x21')]({'raw':_0x29aa09[_0x31bf('0x18')]?_0x29aa09[_0x31bf('0x18')][_0x31bf('0x22')]===undefined?!![]:![]:!![],'where':_0x29aa09[_0x31bf('0x18')]?_0x29aa09[_0x31bf('0x18')][_0x31bf('0x19')]||null:null,'attributes':_0x29aa09[_0x31bf('0x18')]?_0x29aa09[_0x31bf('0x18')]['attributes']||null:null,'include':_0x29aa09[_0x31bf('0x18')]?_0x29aa09[_0x31bf('0x18')][_0x31bf('0x1c')]?_[_0x31bf('0x1d')](_0x29aa09[_0x31bf('0x18')]['include'],function(_0x49e61f){return{'model':db[_0x49e61f['model']],'as':_0x49e61f['as'],'attributes':_0x49e61f[_0x31bf('0x1a')],'include':_0x49e61f[_0x31bf('0x1c')]?_[_0x31bf('0x1d')](_0x49e61f['include'],function(_0x50b1e3){return{'model':db[_0x50b1e3[_0x31bf('0x1e')]],'as':_0x50b1e3['as'],'attributes':_0x50b1e3[_0x31bf('0x1a')],'include':_0x50b1e3[_0x31bf('0x1c')]?_[_0x31bf('0x1d')](_0x50b1e3[_0x31bf('0x1c')],function(_0x463900){return{'model':db[_0x463900[_0x31bf('0x1e')]],'as':_0x463900['as'],'attributes':_0x463900['attributes']};}):[]};}):[]};}):[]:[]})[_0x31bf('0xb')](function(_0x4d7dac){logger['info'](_0x31bf('0x20'),_0x29aa09);logger['debug'](_0x31bf('0x20'),_0x29aa09,JSON['stringify'](_0x4d7dac));_0x10c194(_0x4d7dac);})[_0x31bf('0x1f')](function(_0x2e1a09){logger[_0x31bf('0x11')](_0x31bf('0x20'),_0x2e1a09[_0x31bf('0x13')],_0x29aa09);_0x22acbe(_0xc17024[_0x31bf('0x11')](0x1f4,_0x2e1a09[_0x31bf('0x13')]));});});};
\ No newline at end of file
+var _0xf3ff=['info','catch','ShowFreshdeskAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','then'];(function(_0x3563c2,_0x25cabb){var _0x1e2aac=function(_0x3bfdf3){while(--_0x3bfdf3){_0x3563c2['push'](_0x3563c2['shift']());}};_0x1e2aac(++_0x25cabb);}(_0xf3ff,0xae));var _0xff3f=function(_0x418d28,_0x546071){_0x418d28=_0x418d28-0x0;var _0x4eef9b=_0xf3ff[_0x418d28];return _0x4eef9b;};'use strict';var _=require(_0xff3f('0x0'));var util=require('util');var moment=require(_0xff3f('0x1'));var BPromise=require(_0xff3f('0x2'));var rs=require(_0xff3f('0x3'));var fs=require('fs');var Redis=require(_0xff3f('0x4'));var db=require(_0xff3f('0x5'))['db'];var utils=require(_0xff3f('0x6'));var logger=require('../../config/logger')(_0xff3f('0x7'));var config=require(_0xff3f('0x8'));var jayson=require(_0xff3f('0x9'));var client=jayson['client'][_0xff3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45a86f,_0x5568d0,_0x465c8a){return new BPromise(function(_0x1543bf,_0x5c1d76){return client['request'](_0x45a86f,_0x465c8a)['then'](function(_0x34df96){logger['info'](_0xff3f('0xb'),_0x5568d0,'request\x20sent');logger[_0xff3f('0xc')](_0xff3f('0xd'),_0x5568d0,_0xff3f('0xe'),JSON[_0xff3f('0xf')](_0x34df96));if(_0x34df96[_0xff3f('0x10')]){if(_0x34df96[_0xff3f('0x10')][_0xff3f('0x11')]===0x1f4){logger[_0xff3f('0x10')](_0xff3f('0xb'),_0x5568d0,_0x34df96[_0xff3f('0x10')]['message']);return _0x5c1d76(_0x34df96['error'][_0xff3f('0x12')]);}logger[_0xff3f('0x10')](_0xff3f('0xb'),_0x5568d0,_0x34df96['error']['message']);return _0x1543bf(_0x34df96[_0xff3f('0x10')]['message']);}else{logger['info'](_0xff3f('0xb'),_0x5568d0,_0xff3f('0xe'));_0x1543bf(_0x34df96['result'][_0xff3f('0x12')]);}})['catch'](function(_0x129647){logger['error'](_0xff3f('0xb'),_0x5568d0,_0x129647);_0x5c1d76(_0x129647);});});}exports[_0xff3f('0x13')]=function(_0xf21b3){var _0x56bcfa=this;return new Promise(function(_0xc1698d,_0x434dd5){return db['FreshdeskAccount'][_0xff3f('0x14')]({'raw':_0xf21b3[_0xff3f('0x15')]?_0xf21b3[_0xff3f('0x15')][_0xff3f('0x16')]===undefined?!![]:![]:!![],'where':_0xf21b3[_0xff3f('0x15')]?_0xf21b3[_0xff3f('0x15')][_0xff3f('0x17')]||null:null,'attributes':_0xf21b3[_0xff3f('0x15')]?_0xf21b3[_0xff3f('0x15')][_0xff3f('0x18')]||null:null,'limit':_0xf21b3[_0xff3f('0x15')]?_0xf21b3[_0xff3f('0x15')][_0xff3f('0x19')]||null:null,'include':_0xf21b3[_0xff3f('0x15')]?_0xf21b3['options']['include']?_[_0xff3f('0x1a')](_0xf21b3['options'][_0xff3f('0x1b')],function(_0x2bbbb2){return{'model':db[_0x2bbbb2['model']],'as':_0x2bbbb2['as'],'attributes':_0x2bbbb2[_0xff3f('0x18')],'include':_0x2bbbb2['include']?_[_0xff3f('0x1a')](_0x2bbbb2['include'],function(_0x20b234){return{'model':db[_0x20b234[_0xff3f('0x1c')]],'as':_0x20b234['as'],'attributes':_0x20b234[_0xff3f('0x18')],'include':_0x20b234[_0xff3f('0x1b')]?_[_0xff3f('0x1a')](_0x20b234['include'],function(_0x579659){return{'model':db[_0x579659[_0xff3f('0x1c')]],'as':_0x579659['as'],'attributes':_0x579659[_0xff3f('0x18')]};}):[]};}):[]};}):[]:[]})[_0xff3f('0x1d')](function(_0x411534){logger[_0xff3f('0x1e')]('GetFreshdeskAccount',_0xf21b3);logger[_0xff3f('0xc')](_0xff3f('0x13'),_0xf21b3,JSON['stringify'](_0x411534));_0xc1698d(_0x411534);})[_0xff3f('0x1f')](function(_0x33a849){logger[_0xff3f('0x10')](_0xff3f('0x13'),_0x33a849[_0xff3f('0x12')],_0xf21b3);_0x434dd5(_0x56bcfa[_0xff3f('0x10')](0x1f4,_0x33a849[_0xff3f('0x12')]));});});};exports[_0xff3f('0x20')]=function(_0xaef900){var _0x183922=this;return new Promise(function(_0x513871,_0x64b19a){return db['FreshdeskAccount'][_0xff3f('0x21')]({'raw':_0xaef900[_0xff3f('0x15')]?_0xaef900[_0xff3f('0x15')][_0xff3f('0x16')]===undefined?!![]:![]:!![],'where':_0xaef900[_0xff3f('0x15')]?_0xaef900[_0xff3f('0x15')][_0xff3f('0x17')]||null:null,'attributes':_0xaef900[_0xff3f('0x15')]?_0xaef900['options']['attributes']||null:null,'include':_0xaef900[_0xff3f('0x15')]?_0xaef900[_0xff3f('0x15')][_0xff3f('0x1b')]?_[_0xff3f('0x1a')](_0xaef900['options'][_0xff3f('0x1b')],function(_0x46c712){return{'model':db[_0x46c712[_0xff3f('0x1c')]],'as':_0x46c712['as'],'attributes':_0x46c712['attributes'],'include':_0x46c712[_0xff3f('0x1b')]?_[_0xff3f('0x1a')](_0x46c712[_0xff3f('0x1b')],function(_0x5f4381){return{'model':db[_0x5f4381[_0xff3f('0x1c')]],'as':_0x5f4381['as'],'attributes':_0x5f4381['attributes'],'include':_0x5f4381[_0xff3f('0x1b')]?_[_0xff3f('0x1a')](_0x5f4381[_0xff3f('0x1b')],function(_0x214d7a){return{'model':db[_0x214d7a[_0xff3f('0x1c')]],'as':_0x214d7a['as'],'attributes':_0x214d7a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f8710){logger['info'](_0xff3f('0x20'),_0xaef900);logger[_0xff3f('0xc')](_0xff3f('0x20'),_0xaef900,JSON[_0xff3f('0xf')](_0x3f8710));_0x513871(_0x3f8710);})[_0xff3f('0x1f')](function(_0x36b844){logger[_0xff3f('0x10')](_0xff3f('0x20'),_0x36b844[_0xff3f('0x12')],_0xaef900);_0x64b19a(_0x183922[_0xff3f('0x10')](0x1f4,_0x36b844[_0xff3f('0x12')]));});});};
\ No newline at end of file
index 95a327b..4bc1a9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc699=['../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2255ba,_0x22cd6d){var _0x132223=function(_0xd31279){while(--_0xd31279){_0x2255ba['push'](_0x2255ba['shift']());}};_0x132223(++_0x22cd6d);}(_0xc699,0xdc));var _0x9c69=function(_0x46759d,_0x13e994){_0x46759d=_0x46759d-0x0;var _0x3e7fe0=_0xc699[_0x46759d];return _0x3e7fe0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9c69('0x0'));var express=require(_0x9c69('0x1'));var router=express[_0x9c69('0x2')]();var fs_extra=require(_0x9c69('0x3'));var auth=require(_0x9c69('0x4'));var interaction=require(_0x9c69('0x5'));var config=require(_0x9c69('0x6'));var controller=require(_0x9c69('0x7'));router[_0x9c69('0x8')]('/',auth[_0x9c69('0x9')](),controller[_0x9c69('0xa')]);router['get'](_0x9c69('0xb'),auth[_0x9c69('0x9')](),controller[_0x9c69('0xc')]);router[_0x9c69('0x8')](_0x9c69('0xd'),auth[_0x9c69('0x9')](),controller['getFields']);router['get'](_0x9c69('0xe'),auth['isAuthenticated'](),controller[_0x9c69('0xf')]);router['get'](_0x9c69('0x10'),auth[_0x9c69('0x9')](),controller[_0x9c69('0x11')]);router['get'](_0x9c69('0x12'),auth[_0x9c69('0x9')](),controller[_0x9c69('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9c69('0x14')]);router[_0x9c69('0x15')](_0x9c69('0x12'),auth[_0x9c69('0x9')](),controller[_0x9c69('0x16')]);router[_0x9c69('0x17')](_0x9c69('0xb'),auth[_0x9c69('0x9')](),controller['update']);router['delete']('/:id',auth[_0x9c69('0x9')](),controller['destroy']);module[_0x9c69('0x18')]=router;
\ No newline at end of file
+var _0xe4e5=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0xe4e5,0xcb));var _0x5e4e=function(_0x496446,_0x32ba88){_0x496446=_0x496446-0x0;var _0xfeaa7f=_0xe4e5[_0x496446];return _0xfeaa7f;};'use strict';var multer=require(_0x5e4e('0x0'));var util=require(_0x5e4e('0x1'));var path=require(_0x5e4e('0x2'));var timeout=require(_0x5e4e('0x3'));var express=require(_0x5e4e('0x4'));var router=express[_0x5e4e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5e4e('0x6'));var config=require(_0x5e4e('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x5e4e('0x8')]('/',auth[_0x5e4e('0x9')](),controller[_0x5e4e('0xa')]);router['get'](_0x5e4e('0xb'),auth['isAuthenticated'](),controller[_0x5e4e('0xc')]);router[_0x5e4e('0x8')](_0x5e4e('0xd'),auth[_0x5e4e('0x9')](),controller[_0x5e4e('0xe')]);router[_0x5e4e('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x5e4e('0xf')]);router[_0x5e4e('0x8')]('/:id/descriptions',auth[_0x5e4e('0x9')](),controller[_0x5e4e('0x10')]);router[_0x5e4e('0x8')](_0x5e4e('0x11'),auth[_0x5e4e('0x9')](),controller[_0x5e4e('0x12')]);router[_0x5e4e('0x13')]('/',auth[_0x5e4e('0x9')](),controller[_0x5e4e('0x14')]);router[_0x5e4e('0x13')](_0x5e4e('0x11'),auth['isAuthenticated'](),controller[_0x5e4e('0x15')]);router['put']('/:id',auth[_0x5e4e('0x9')](),controller['update']);router[_0x5e4e('0x16')](_0x5e4e('0xb'),auth[_0x5e4e('0x9')](),controller[_0x5e4e('0x17')]);module[_0x5e4e('0x18')]=router;
\ No newline at end of file
index 879396f..b1fae76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2247=['exports','STRING'];(function(_0x53ee61,_0x564943){var _0x215b35=function(_0x315748){while(--_0x315748){_0x53ee61['push'](_0x53ee61['shift']());}};_0x215b35(++_0x564943);}(_0x2247,0x1d0));var _0x7224=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x2247[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require('sequelize');module[_0x7224('0x0')]={'name':{'type':Sequelize[_0x7224('0x1')]},'description':{'type':Sequelize[_0x7224('0x1')]}};
\ No newline at end of file
+var _0xb199=['exports','STRING','sequelize'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xb199,0x98));var _0x9b19=function(_0xb6da18,_0x437e03){_0xb6da18=_0xb6da18-0x0;var _0x386936=_0xb199[_0xb6da18];return _0x386936;};'use strict';var Sequelize=require(_0x9b19('0x0'));module[_0x9b19('0x1')]={'name':{'type':Sequelize[_0x9b19('0x2')]},'description':{'type':Sequelize[_0x9b19('0x2')]}};
\ No newline at end of file
index 9c46d41..42f9547 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e88=['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','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','body','find','getFields','FreshdeskField','pick','nolimit','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse'];(function(_0x414810,_0x5e924d){var _0x2d4df5=function(_0x390860){while(--_0x390860){_0x414810['push'](_0x414810['shift']());}};_0x2d4df5(++_0x5e924d);}(_0x6e88,0x195));var _0x86e8=function(_0x5cab48,_0x1d7919){_0x5cab48=_0x5cab48-0x0;var _0xf4c902=_0x6e88[_0x5cab48];return _0xf4c902;};'use strict';var emlformat=require(_0x86e8('0x0'));var rimraf=require(_0x86e8('0x1'));var zipdir=require(_0x86e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86e8('0x3'));var moment=require(_0x86e8('0x4'));var BPromise=require(_0x86e8('0x5'));var Mustache=require(_0x86e8('0x6'));var util=require(_0x86e8('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x86e8('0x8'));var fs=require('fs');var fs_extra=require(_0x86e8('0x9'));var _=require(_0x86e8('0xa'));var squel=require('squel');var crypto=require(_0x86e8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x86e8('0xc'));var querystring=require(_0x86e8('0xd'));var Papa=require(_0x86e8('0xe'));var Redis=require(_0x86e8('0xf'));var authService=require(_0x86e8('0x10'));var qs=require(_0x86e8('0x11'));var as=require(_0x86e8('0x12'));var hardwareService=require(_0x86e8('0x13'));var logger=require(_0x86e8('0x14'))(_0x86e8('0x15'));var utils=require(_0x86e8('0x16'));var config=require(_0x86e8('0x17'));var licenseUtil=require(_0x86e8('0x18'));var db=require(_0x86e8('0x19'))['db'];function respondWithStatusCode(_0x3ad601,_0x3e33a4){_0x3e33a4=_0x3e33a4||0xcc;return function(_0x730d0a){if(_0x730d0a){return _0x3ad601['sendStatus'](_0x3e33a4);}return _0x3ad601[_0x86e8('0x1a')](_0x3e33a4)[_0x86e8('0x1b')]();};}function respondWithResult(_0x5ebc84,_0x3030d7){_0x3030d7=_0x3030d7||0xc8;return function(_0x23cd75){if(_0x23cd75){return _0x5ebc84['status'](_0x3030d7)[_0x86e8('0x1c')](_0x23cd75);}};}function respondWithFilteredResult(_0x4b964e,_0x31a707){return function(_0x12561b){if(_0x12561b){var _0x153994=typeof _0x31a707[_0x86e8('0x1d')]===_0x86e8('0x1e')&&typeof _0x31a707[_0x86e8('0x1f')]===_0x86e8('0x1e');var _0xb38135=_0x12561b[_0x86e8('0x20')];var _0x4c87e8=_0x153994?0x0:_0x31a707['offset'];var _0x5643c7=_0x153994?_0x12561b[_0x86e8('0x20')]:_0x31a707[_0x86e8('0x1d')]+_0x31a707[_0x86e8('0x1f')];var _0x1b007a;if(_0x5643c7>=_0xb38135){_0x5643c7=_0xb38135;_0x1b007a=0xc8;}else{_0x1b007a=0xce;}_0x4b964e[_0x86e8('0x1a')](_0x1b007a);return _0x4b964e[_0x86e8('0x21')]('Content-Range',_0x4c87e8+'-'+_0x5643c7+'/'+_0xb38135)[_0x86e8('0x1c')](_0x12561b);}return null;};}function patchUpdates(_0x5da74c){return function(_0x946eef){try{jsonpatch['apply'](_0x946eef,_0x5da74c,!![]);}catch(_0x2eb8a2){return BPromise[_0x86e8('0x22')](_0x2eb8a2);}return _0x946eef[_0x86e8('0x23')]();};}function saveUpdates(_0x20bf4b,_0x624768){return function(_0x18c83f){if(_0x18c83f){return _0x18c83f[_0x86e8('0x24')](_0x20bf4b)[_0x86e8('0x25')](function(_0x408900){return _0x408900;});}return null;};}function removeEntity(_0x5e05e8,_0x198980){return function(_0x3251f4){if(_0x3251f4){return _0x3251f4[_0x86e8('0x26')]()[_0x86e8('0x25')](function(){_0x5e05e8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25eaa1,_0x537478){return function(_0x5d0246){if(!_0x5d0246){_0x25eaa1[_0x86e8('0x27')](0x194);}return _0x5d0246;};}function handleError(_0x417fdc,_0x13a33d){_0x13a33d=_0x13a33d||0x1f4;return function(_0x3be392){logger[_0x86e8('0x28')](_0x3be392[_0x86e8('0x29')]);if(_0x3be392[_0x86e8('0x2a')]){delete _0x3be392[_0x86e8('0x2a')];}_0x417fdc[_0x86e8('0x1a')](_0x13a33d)[_0x86e8('0x2b')](_0x3be392);};}exports[_0x86e8('0x2c')]=function(_0x30d96a,_0x2f6dc6){var _0x2d5efa={},_0x598b24={},_0x356108={'count':0x0,'rows':[]};var _0x502824=_['map'](db[_0x86e8('0x2d')][_0x86e8('0x2e')],function(_0x5d62b9){return{'name':_0x5d62b9[_0x86e8('0x2f')],'type':_0x5d62b9['type']['key']};});_0x598b24[_0x86e8('0x30')]=_[_0x86e8('0x31')](_0x502824,_0x86e8('0x2a'));_0x598b24[_0x86e8('0x32')]=_[_0x86e8('0x33')](_0x30d96a[_0x86e8('0x32')]);_0x598b24[_0x86e8('0x34')]=_['intersection'](_0x598b24['model'],_0x598b24[_0x86e8('0x32')]);_0x2d5efa[_0x86e8('0x35')]=_[_0x86e8('0x36')](_0x598b24[_0x86e8('0x30')],qs[_0x86e8('0x37')](_0x30d96a[_0x86e8('0x32')][_0x86e8('0x37')]));_0x2d5efa[_0x86e8('0x35')]=_0x2d5efa[_0x86e8('0x35')][_0x86e8('0x38')]?_0x2d5efa[_0x86e8('0x35')]:_0x598b24['model'];if(!_0x30d96a[_0x86e8('0x32')][_0x86e8('0x39')]('nolimit')){_0x2d5efa[_0x86e8('0x1f')]=qs[_0x86e8('0x1f')](_0x30d96a[_0x86e8('0x32')]['limit']);_0x2d5efa[_0x86e8('0x1d')]=qs[_0x86e8('0x1d')](_0x30d96a[_0x86e8('0x32')][_0x86e8('0x1d')]);}_0x2d5efa[_0x86e8('0x3a')]=qs[_0x86e8('0x3b')](_0x30d96a[_0x86e8('0x32')][_0x86e8('0x3b')]);_0x2d5efa[_0x86e8('0x3c')]=qs[_0x86e8('0x34')](_['pick'](_0x30d96a[_0x86e8('0x32')],_0x598b24[_0x86e8('0x34')]),_0x502824);if(_0x30d96a[_0x86e8('0x32')][_0x86e8('0x3d')]){_0x2d5efa[_0x86e8('0x3c')]=_['merge'](_0x2d5efa[_0x86e8('0x3c')],{'$or':_['map'](_0x502824,function(_0x6a0504){if(_0x6a0504['type']!==_0x86e8('0x3e')){var _0x23faaa={};_0x23faaa[_0x6a0504['name']]={'$like':'%'+_0x30d96a[_0x86e8('0x32')][_0x86e8('0x3d')]+'%'};return _0x23faaa;}})});}_0x2d5efa=_[_0x86e8('0x3f')]({},_0x2d5efa,_0x30d96a['options']);var _0x382440={'where':_0x2d5efa[_0x86e8('0x3c')]};return db[_0x86e8('0x2d')]['count'](_0x382440)[_0x86e8('0x25')](function(_0x5ef40f){_0x356108[_0x86e8('0x20')]=_0x5ef40f;if(_0x30d96a[_0x86e8('0x32')][_0x86e8('0x40')]){_0x2d5efa[_0x86e8('0x41')]=[{'all':!![]}];}return db[_0x86e8('0x2d')][_0x86e8('0x42')](_0x2d5efa);})[_0x86e8('0x25')](function(_0x2a3614){_0x356108[_0x86e8('0x43')]=_0x2a3614;return _0x356108;})['then'](respondWithFilteredResult(_0x2f6dc6,_0x2d5efa))[_0x86e8('0x44')](handleError(_0x2f6dc6,null));};exports[_0x86e8('0x45')]=function(_0x56d227,_0x22a015){var _0x177eb5={'raw':![],'where':{'id':_0x56d227[_0x86e8('0x46')]['id']}},_0x36a964={};_0x36a964[_0x86e8('0x30')]=_[_0x86e8('0x33')](db[_0x86e8('0x2d')]['rawAttributes']);_0x36a964[_0x86e8('0x32')]=_[_0x86e8('0x33')](_0x56d227[_0x86e8('0x32')]);_0x36a964[_0x86e8('0x34')]=_[_0x86e8('0x36')](_0x36a964[_0x86e8('0x30')],_0x36a964['query']);_0x177eb5[_0x86e8('0x35')]=_[_0x86e8('0x36')](_0x36a964['model'],qs[_0x86e8('0x37')](_0x56d227['query']['fields']));_0x177eb5[_0x86e8('0x35')]=_0x177eb5['attributes'][_0x86e8('0x38')]?_0x177eb5['attributes']:_0x36a964[_0x86e8('0x30')];if(_0x56d227['query'][_0x86e8('0x40')]){_0x177eb5[_0x86e8('0x41')]=[{'all':!![]}];}_0x177eb5=_[_0x86e8('0x3f')]({},_0x177eb5,_0x56d227[_0x86e8('0x47')]);return db[_0x86e8('0x2d')]['find'](_0x177eb5)['then'](handleEntityNotFound(_0x22a015,null))[_0x86e8('0x25')](respondWithResult(_0x22a015,null))['catch'](handleError(_0x22a015,null));};exports['create']=function(_0x286490,_0xfc49c9){return db[_0x86e8('0x2d')]['create'](_0x286490[_0x86e8('0x48')],{})['then'](respondWithResult(_0xfc49c9,0xc9))['catch'](handleError(_0xfc49c9,null));};exports['update']=function(_0x9dcd6d,_0x23a3eb){if(_0x9dcd6d['body']['id']){delete _0x9dcd6d[_0x86e8('0x48')]['id'];}return db[_0x86e8('0x2d')][_0x86e8('0x49')]({'where':{'id':_0x9dcd6d[_0x86e8('0x46')]['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0x23a3eb,null))[_0x86e8('0x25')](saveUpdates(_0x9dcd6d[_0x86e8('0x48')],null))[_0x86e8('0x25')](respondWithResult(_0x23a3eb,null))['catch'](handleError(_0x23a3eb,null));};exports['destroy']=function(_0x5c94c1,_0x594dc2){return db['FreshdeskConfiguration'][_0x86e8('0x49')]({'where':{'id':_0x5c94c1[_0x86e8('0x46')]['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0x594dc2,null))[_0x86e8('0x25')](removeEntity(_0x594dc2,null))[_0x86e8('0x44')](handleError(_0x594dc2,null));};exports[_0x86e8('0x4a')]=function(_0x3a84fb,_0xbf3420,_0x3e0dd0){var _0x34f827={};var _0x30b15b={};var _0x2cd172;var _0x31e4e2;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x3a84fb['params']['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0xbf3420,null))[_0x86e8('0x25')](function(_0x42b051){if(_0x42b051){_0x2cd172=_0x42b051;_0x30b15b[_0x86e8('0x30')]=_['keys'](db[_0x86e8('0x4b')][_0x86e8('0x2e')]);_0x30b15b['query']=_[_0x86e8('0x33')](_0x3a84fb[_0x86e8('0x32')]);_0x30b15b[_0x86e8('0x34')]=_[_0x86e8('0x36')](_0x30b15b[_0x86e8('0x30')],_0x30b15b[_0x86e8('0x32')]);_0x34f827[_0x86e8('0x35')]=_['intersection'](_0x30b15b[_0x86e8('0x30')],qs[_0x86e8('0x37')](_0x3a84fb[_0x86e8('0x32')][_0x86e8('0x37')]));_0x34f827['attributes']=_0x34f827[_0x86e8('0x35')]['length']?_0x34f827[_0x86e8('0x35')]:_0x30b15b[_0x86e8('0x30')];_0x34f827[_0x86e8('0x3a')]=qs[_0x86e8('0x3b')](_0x3a84fb['query'][_0x86e8('0x3b')]);_0x34f827['where']=qs[_0x86e8('0x34')](_[_0x86e8('0x4c')](_0x3a84fb['query'],_0x30b15b[_0x86e8('0x34')]));if(_0x3a84fb['query'][_0x86e8('0x3d')]){_0x34f827[_0x86e8('0x3c')]=_[_0x86e8('0x3f')](_0x34f827[_0x86e8('0x3c')],{'$or':_[_0x86e8('0x31')](_0x34f827['attributes'],function(_0x478481){var _0x5ed6c4={};_0x5ed6c4[_0x478481]={'$like':'%'+_0x3a84fb[_0x86e8('0x32')][_0x86e8('0x3d')]+'%'};return _0x5ed6c4;})});}_0x34f827=_[_0x86e8('0x3f')]({},_0x34f827,_0x3a84fb[_0x86e8('0x47')]);return _0x2cd172[_0x86e8('0x4a')](_0x34f827);}})[_0x86e8('0x25')](function(_0x232260){if(_0x232260){_0x31e4e2=_0x232260[_0x86e8('0x38')];if(!_0x3a84fb[_0x86e8('0x32')][_0x86e8('0x39')](_0x86e8('0x4d'))){_0x34f827['limit']=qs[_0x86e8('0x1f')](_0x3a84fb['query'][_0x86e8('0x1f')]);_0x34f827[_0x86e8('0x1d')]=qs[_0x86e8('0x1d')](_0x3a84fb['query'][_0x86e8('0x1d')]);}return _0x2cd172[_0x86e8('0x4a')](_0x34f827);}})[_0x86e8('0x25')](function(_0x10409c){if(_0x10409c){return _0x10409c?{'count':_0x31e4e2,'rows':_0x10409c}:null;}})[_0x86e8('0x25')](respondWithResult(_0xbf3420,null))['catch'](handleError(_0xbf3420,null));};exports['getSubjects']=function(_0x81b56f,_0x590c89,_0xfb312d){var _0x5b8e1c={};var _0x2a5335={};var _0xb3b267;var _0x5288de;return db[_0x86e8('0x2d')][_0x86e8('0x4e')]({'where':{'id':_0x81b56f[_0x86e8('0x46')]['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0x590c89,null))[_0x86e8('0x25')](function(_0x1e3fe3){if(_0x1e3fe3){_0xb3b267=_0x1e3fe3;_0x2a5335['model']=_['keys'](db[_0x86e8('0x4b')]['rawAttributes']);_0x2a5335[_0x86e8('0x32')]=_['keys'](_0x81b56f[_0x86e8('0x32')]);_0x2a5335[_0x86e8('0x34')]=_[_0x86e8('0x36')](_0x2a5335[_0x86e8('0x30')],_0x2a5335[_0x86e8('0x32')]);_0x5b8e1c['attributes']=_[_0x86e8('0x36')](_0x2a5335[_0x86e8('0x30')],qs[_0x86e8('0x37')](_0x81b56f[_0x86e8('0x32')][_0x86e8('0x37')]));_0x5b8e1c[_0x86e8('0x35')]=_0x5b8e1c[_0x86e8('0x35')][_0x86e8('0x38')]?_0x5b8e1c[_0x86e8('0x35')]:_0x2a5335['model'];_0x5b8e1c['order']=qs[_0x86e8('0x3b')](_0x81b56f[_0x86e8('0x32')][_0x86e8('0x3b')]);_0x5b8e1c[_0x86e8('0x3c')]=qs[_0x86e8('0x34')](_[_0x86e8('0x4c')](_0x81b56f[_0x86e8('0x32')],_0x2a5335[_0x86e8('0x34')]));if(_0x81b56f['query'][_0x86e8('0x3d')]){_0x5b8e1c[_0x86e8('0x3c')]=_[_0x86e8('0x3f')](_0x5b8e1c[_0x86e8('0x3c')],{'$or':_[_0x86e8('0x31')](_0x5b8e1c[_0x86e8('0x35')],function(_0x29e8b3){var _0xa56e7a={};_0xa56e7a[_0x29e8b3]={'$like':'%'+_0x81b56f['query']['filter']+'%'};return _0xa56e7a;})});}_0x5b8e1c=_[_0x86e8('0x3f')]({},_0x5b8e1c,_0x81b56f[_0x86e8('0x47')]);return _0xb3b267[_0x86e8('0x4f')](_0x5b8e1c);}})[_0x86e8('0x25')](function(_0x1b6455){if(_0x1b6455){_0x5288de=_0x1b6455[_0x86e8('0x38')];if(!_0x81b56f[_0x86e8('0x32')]['hasOwnProperty'](_0x86e8('0x4d'))){_0x5b8e1c[_0x86e8('0x1f')]=qs[_0x86e8('0x1f')](_0x81b56f[_0x86e8('0x32')][_0x86e8('0x1f')]);_0x5b8e1c[_0x86e8('0x1d')]=qs['offset'](_0x81b56f[_0x86e8('0x32')][_0x86e8('0x1d')]);}return _0xb3b267[_0x86e8('0x4f')](_0x5b8e1c);}})[_0x86e8('0x25')](function(_0x46bcbd){if(_0x46bcbd){return _0x46bcbd?{'count':_0x5288de,'rows':_0x46bcbd}:null;}})['then'](respondWithResult(_0x590c89,null))['catch'](handleError(_0x590c89,null));};exports['getDescriptions']=function(_0x554935,_0x106125,_0x3fe797){var _0x1261fb={};var _0x4279eb={};var _0x2e10ae;var _0x27e85c;return db[_0x86e8('0x2d')][_0x86e8('0x4e')]({'where':{'id':_0x554935['params']['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0x106125,null))[_0x86e8('0x25')](function(_0xddb313){if(_0xddb313){_0x2e10ae=_0xddb313;_0x4279eb['model']=_['keys'](db[_0x86e8('0x4b')][_0x86e8('0x2e')]);_0x4279eb[_0x86e8('0x32')]=_['keys'](_0x554935['query']);_0x4279eb['filters']=_[_0x86e8('0x36')](_0x4279eb[_0x86e8('0x30')],_0x4279eb[_0x86e8('0x32')]);_0x1261fb[_0x86e8('0x35')]=_[_0x86e8('0x36')](_0x4279eb[_0x86e8('0x30')],qs[_0x86e8('0x37')](_0x554935[_0x86e8('0x32')][_0x86e8('0x37')]));_0x1261fb[_0x86e8('0x35')]=_0x1261fb['attributes'][_0x86e8('0x38')]?_0x1261fb[_0x86e8('0x35')]:_0x4279eb[_0x86e8('0x30')];_0x1261fb[_0x86e8('0x3a')]=qs['sort'](_0x554935[_0x86e8('0x32')][_0x86e8('0x3b')]);_0x1261fb[_0x86e8('0x3c')]=qs['filters'](_['pick'](_0x554935[_0x86e8('0x32')],_0x4279eb[_0x86e8('0x34')]));if(_0x554935[_0x86e8('0x32')][_0x86e8('0x3d')]){_0x1261fb[_0x86e8('0x3c')]=_[_0x86e8('0x3f')](_0x1261fb['where'],{'$or':_[_0x86e8('0x31')](_0x1261fb[_0x86e8('0x35')],function(_0x3c6add){var _0x3aa6a4={};_0x3aa6a4[_0x3c6add]={'$like':'%'+_0x554935[_0x86e8('0x32')][_0x86e8('0x3d')]+'%'};return _0x3aa6a4;})});}_0x1261fb=_[_0x86e8('0x3f')]({},_0x1261fb,_0x554935[_0x86e8('0x47')]);return _0x2e10ae[_0x86e8('0x50')](_0x1261fb);}})[_0x86e8('0x25')](function(_0x5a0ab2){if(_0x5a0ab2){_0x27e85c=_0x5a0ab2[_0x86e8('0x38')];if(!_0x554935[_0x86e8('0x32')][_0x86e8('0x39')](_0x86e8('0x4d'))){_0x1261fb['limit']=qs['limit'](_0x554935['query'][_0x86e8('0x1f')]);_0x1261fb['offset']=qs[_0x86e8('0x1d')](_0x554935[_0x86e8('0x32')]['offset']);}return _0x2e10ae[_0x86e8('0x50')](_0x1261fb);}})[_0x86e8('0x25')](function(_0xb4a85e){if(_0xb4a85e){return _0xb4a85e?{'count':_0x27e85c,'rows':_0xb4a85e}:null;}})[_0x86e8('0x25')](respondWithResult(_0x106125,null))[_0x86e8('0x44')](handleError(_0x106125,null));};exports[_0x86e8('0x51')]=function(_0x1ecf3d,_0x2624fa,_0x660bb1){var _0xe976d3={};var _0x4cbde6={};var _0xe6a05;var _0x1e5ce7;return db[_0x86e8('0x2d')]['findOne']({'where':{'id':_0x1ecf3d[_0x86e8('0x46')]['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0x2624fa,null))[_0x86e8('0x25')](function(_0x1d96ff){if(_0x1d96ff){_0xe6a05=_0x1d96ff;_0x4cbde6['model']=_[_0x86e8('0x33')](db[_0x86e8('0x52')]['rawAttributes']);_0x4cbde6['query']=_[_0x86e8('0x33')](_0x1ecf3d[_0x86e8('0x32')]);_0x4cbde6[_0x86e8('0x34')]=_[_0x86e8('0x36')](_0x4cbde6[_0x86e8('0x30')],_0x4cbde6[_0x86e8('0x32')]);_0xe976d3[_0x86e8('0x35')]=_[_0x86e8('0x36')](_0x4cbde6[_0x86e8('0x30')],qs[_0x86e8('0x37')](_0x1ecf3d[_0x86e8('0x32')][_0x86e8('0x37')]));_0xe976d3[_0x86e8('0x35')]=_0xe976d3[_0x86e8('0x35')]['length']?_0xe976d3['attributes']:_0x4cbde6[_0x86e8('0x30')];_0xe976d3[_0x86e8('0x3a')]=qs[_0x86e8('0x3b')](_0x1ecf3d['query'][_0x86e8('0x3b')]);_0xe976d3[_0x86e8('0x3c')]=qs[_0x86e8('0x34')](_['pick'](_0x1ecf3d['query'],_0x4cbde6[_0x86e8('0x34')]));if(_0x1ecf3d[_0x86e8('0x32')][_0x86e8('0x3d')]){_0xe976d3[_0x86e8('0x3c')]=_['merge'](_0xe976d3[_0x86e8('0x3c')],{'$or':_['map'](_0xe976d3[_0x86e8('0x35')],function(_0x141968){var _0x15bf49={};_0x15bf49[_0x141968]={'$like':'%'+_0x1ecf3d[_0x86e8('0x32')][_0x86e8('0x3d')]+'%'};return _0x15bf49;})});}_0xe976d3=_[_0x86e8('0x3f')]({},_0xe976d3,_0x1ecf3d['options']);return _0xe6a05[_0x86e8('0x51')](_0xe976d3);}})['then'](function(_0xcfc91e){if(_0xcfc91e){_0x1e5ce7=_0xcfc91e[_0x86e8('0x38')];if(!_0x1ecf3d[_0x86e8('0x32')]['hasOwnProperty'](_0x86e8('0x4d'))){_0xe976d3['limit']=qs['limit'](_0x1ecf3d[_0x86e8('0x32')][_0x86e8('0x1f')]);_0xe976d3[_0x86e8('0x1d')]=qs[_0x86e8('0x1d')](_0x1ecf3d[_0x86e8('0x32')][_0x86e8('0x1d')]);}return _0xe6a05[_0x86e8('0x51')](_0xe976d3);}})[_0x86e8('0x25')](function(_0x142330){if(_0x142330){return _0x142330?{'count':_0x1e5ce7,'rows':_0x142330}:null;}})[_0x86e8('0x25')](respondWithResult(_0x2624fa,null))[_0x86e8('0x44')](handleError(_0x2624fa,null));};exports[_0x86e8('0x53')]=function(_0x1cb89d,_0x3fcad6,_0x341722){if(_0x1cb89d['body']['id']){delete _0x1cb89d['body']['id'];}return db[_0x86e8('0x2d')][_0x86e8('0x4e')]({'where':{'id':_0x1cb89d[_0x86e8('0x46')]['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0x3fcad6,null))['then'](function(_0x11359e){if(_0x11359e){return _0x11359e['setTags'](_0x1cb89d[_0x86e8('0x48')]['ids']||[]);}return null;})[_0x86e8('0x25')](respondWithResult(_0x3fcad6,null))['catch'](handleError(_0x3fcad6,null));};
\ No newline at end of file
+var _0x56f0=['FreshdeskConfiguration','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','destroy','getFields','findOne','FreshdeskField','order','getSubjects','getDescriptions','Tag','getTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','apply','save','then','error','name','index','map'];(function(_0x4ca62f,_0x44acd6){var _0x3cbff3=function(_0x12972e){while(--_0x12972e){_0x4ca62f['push'](_0x4ca62f['shift']());}};_0x3cbff3(++_0x44acd6);}(_0x56f0,0x79));var _0x056f=function(_0x1ad5a2,_0x45632b){_0x1ad5a2=_0x1ad5a2-0x0;var _0x51eba3=_0x56f0[_0x1ad5a2];return _0x51eba3;};'use strict';var emlformat=require(_0x056f('0x0'));var rimraf=require(_0x056f('0x1'));var zipdir=require(_0x056f('0x2'));var jsonpatch=require(_0x056f('0x3'));var rp=require(_0x056f('0x4'));var moment=require(_0x056f('0x5'));var BPromise=require(_0x056f('0x6'));var Mustache=require(_0x056f('0x7'));var util=require(_0x056f('0x8'));var path=require(_0x056f('0x9'));var sox=require(_0x056f('0xa'));var csv=require(_0x056f('0xb'));var ejs=require(_0x056f('0xc'));var fs=require('fs');var fs_extra=require(_0x056f('0xd'));var _=require(_0x056f('0xe'));var squel=require(_0x056f('0xf'));var crypto=require(_0x056f('0x10'));var jsforce=require(_0x056f('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x056f('0x12'));var Papa=require(_0x056f('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x056f('0x14'));var as=require(_0x056f('0x15'));var hardwareService=require(_0x056f('0x16'));var logger=require(_0x056f('0x17'))('api');var utils=require(_0x056f('0x18'));var config=require(_0x056f('0x19'));var licenseUtil=require(_0x056f('0x1a'));var db=require(_0x056f('0x1b'))['db'];function respondWithStatusCode(_0x525974,_0xda3251){_0xda3251=_0xda3251||0xcc;return function(_0x349f06){if(_0x349f06){return _0x525974[_0x056f('0x1c')](_0xda3251);}return _0x525974['status'](_0xda3251)[_0x056f('0x1d')]();};}function respondWithResult(_0x9698e,_0x5d44bd){_0x5d44bd=_0x5d44bd||0xc8;return function(_0x133dec){if(_0x133dec){return _0x9698e[_0x056f('0x1e')](_0x5d44bd)[_0x056f('0x1f')](_0x133dec);}};}function respondWithFilteredResult(_0x42f423,_0x5dc620){return function(_0xcd8694){if(_0xcd8694){var _0x5d6321=typeof _0x5dc620[_0x056f('0x20')]===_0x056f('0x21')&&typeof _0x5dc620['limit']===_0x056f('0x21');var _0x3fc4d4=_0xcd8694[_0x056f('0x22')];var _0x29f646=_0x5d6321?0x0:_0x5dc620[_0x056f('0x20')];var _0x16f158=_0x5d6321?_0xcd8694[_0x056f('0x22')]:_0x5dc620[_0x056f('0x20')]+_0x5dc620[_0x056f('0x23')];var _0x5bec67;if(_0x16f158>=_0x3fc4d4){_0x16f158=_0x3fc4d4;_0x5bec67=0xc8;}else{_0x5bec67=0xce;}_0x42f423[_0x056f('0x1e')](_0x5bec67);return _0x42f423['set']('Content-Range',_0x29f646+'-'+_0x16f158+'/'+_0x3fc4d4)[_0x056f('0x1f')](_0xcd8694);}return null;};}function patchUpdates(_0x3176ba){return function(_0x49144e){try{jsonpatch[_0x056f('0x24')](_0x49144e,_0x3176ba,!![]);}catch(_0x20cae4){return BPromise['reject'](_0x20cae4);}return _0x49144e[_0x056f('0x25')]();};}function saveUpdates(_0x524dc1,_0x2a0523){return function(_0x418e83){if(_0x418e83){return _0x418e83['update'](_0x524dc1)[_0x056f('0x26')](function(_0x38efa0){return _0x38efa0;});}return null;};}function removeEntity(_0x5a94db,_0x22cb28){return function(_0x34c47f){if(_0x34c47f){return _0x34c47f['destroy']()[_0x056f('0x26')](function(){_0x5a94db[_0x056f('0x1e')](0xcc)[_0x056f('0x1d')]();});}};}function handleEntityNotFound(_0x53088c,_0x23f7a7){return function(_0x1ebade){if(!_0x1ebade){_0x53088c[_0x056f('0x1c')](0x194);}return _0x1ebade;};}function handleError(_0x399122,_0x217ac1){_0x217ac1=_0x217ac1||0x1f4;return function(_0xe5070c){logger[_0x056f('0x27')](_0xe5070c['stack']);if(_0xe5070c[_0x056f('0x28')]){delete _0xe5070c[_0x056f('0x28')];}_0x399122[_0x056f('0x1e')](_0x217ac1)['send'](_0xe5070c);};}exports[_0x056f('0x29')]=function(_0x29d603,_0x4e9f1c){var _0x1674ba={},_0x11c38e={},_0x3f01f6={'count':0x0,'rows':[]};var _0x43c22f=_[_0x056f('0x2a')](db[_0x056f('0x2b')][_0x056f('0x2c')],function(_0x57e949){return{'name':_0x57e949[_0x056f('0x2d')],'type':_0x57e949['type']['key']};});_0x11c38e[_0x056f('0x2e')]=_[_0x056f('0x2a')](_0x43c22f,'name');_0x11c38e[_0x056f('0x2f')]=_['keys'](_0x29d603[_0x056f('0x2f')]);_0x11c38e[_0x056f('0x30')]=_['intersection'](_0x11c38e[_0x056f('0x2e')],_0x11c38e[_0x056f('0x2f')]);_0x1674ba[_0x056f('0x31')]=_[_0x056f('0x32')](_0x11c38e[_0x056f('0x2e')],qs['fields'](_0x29d603[_0x056f('0x2f')][_0x056f('0x33')]));_0x1674ba['attributes']=_0x1674ba[_0x056f('0x31')]['length']?_0x1674ba['attributes']:_0x11c38e['model'];if(!_0x29d603[_0x056f('0x2f')][_0x056f('0x34')](_0x056f('0x35'))){_0x1674ba[_0x056f('0x23')]=qs[_0x056f('0x23')](_0x29d603['query'][_0x056f('0x23')]);_0x1674ba[_0x056f('0x20')]=qs[_0x056f('0x20')](_0x29d603['query'][_0x056f('0x20')]);}_0x1674ba['order']=qs['sort'](_0x29d603[_0x056f('0x2f')][_0x056f('0x36')]);_0x1674ba['where']=qs[_0x056f('0x30')](_[_0x056f('0x37')](_0x29d603[_0x056f('0x2f')],_0x11c38e[_0x056f('0x30')]),_0x43c22f);if(_0x29d603[_0x056f('0x2f')][_0x056f('0x38')]){_0x1674ba[_0x056f('0x39')]=_[_0x056f('0x3a')](_0x1674ba[_0x056f('0x39')],{'$or':_[_0x056f('0x2a')](_0x43c22f,function(_0x112285){if(_0x112285[_0x056f('0x3b')]!=='VIRTUAL'){var _0x96f553={};_0x96f553[_0x112285[_0x056f('0x28')]]={'$like':'%'+_0x29d603[_0x056f('0x2f')][_0x056f('0x38')]+'%'};return _0x96f553;}})});}_0x1674ba=_[_0x056f('0x3a')]({},_0x1674ba,_0x29d603[_0x056f('0x3c')]);var _0x1a4994={'where':_0x1674ba[_0x056f('0x39')]};return db[_0x056f('0x2b')][_0x056f('0x22')](_0x1a4994)[_0x056f('0x26')](function(_0x3c947d){_0x3f01f6[_0x056f('0x22')]=_0x3c947d;if(_0x29d603[_0x056f('0x2f')][_0x056f('0x3d')]){_0x1674ba[_0x056f('0x3e')]=[{'all':!![]}];}return db[_0x056f('0x2b')][_0x056f('0x3f')](_0x1674ba);})[_0x056f('0x26')](function(_0x405f54){_0x3f01f6['rows']=_0x405f54;return _0x3f01f6;})[_0x056f('0x26')](respondWithFilteredResult(_0x4e9f1c,_0x1674ba))[_0x056f('0x40')](handleError(_0x4e9f1c,null));};exports[_0x056f('0x41')]=function(_0x38d854,_0x221ff6){var _0xfdcd83={'raw':![],'where':{'id':_0x38d854[_0x056f('0x42')]['id']}},_0x843a3a={};_0x843a3a[_0x056f('0x2e')]=_[_0x056f('0x43')](db[_0x056f('0x2b')][_0x056f('0x2c')]);_0x843a3a[_0x056f('0x2f')]=_[_0x056f('0x43')](_0x38d854['query']);_0x843a3a[_0x056f('0x30')]=_[_0x056f('0x32')](_0x843a3a[_0x056f('0x2e')],_0x843a3a[_0x056f('0x2f')]);_0xfdcd83['attributes']=_['intersection'](_0x843a3a[_0x056f('0x2e')],qs[_0x056f('0x33')](_0x38d854[_0x056f('0x2f')]['fields']));_0xfdcd83[_0x056f('0x31')]=_0xfdcd83[_0x056f('0x31')][_0x056f('0x44')]?_0xfdcd83[_0x056f('0x31')]:_0x843a3a[_0x056f('0x2e')];if(_0x38d854[_0x056f('0x2f')][_0x056f('0x3d')]){_0xfdcd83[_0x056f('0x3e')]=[{'all':!![]}];}_0xfdcd83=_[_0x056f('0x3a')]({},_0xfdcd83,_0x38d854[_0x056f('0x3c')]);return db[_0x056f('0x2b')][_0x056f('0x45')](_0xfdcd83)[_0x056f('0x26')](handleEntityNotFound(_0x221ff6,null))[_0x056f('0x26')](respondWithResult(_0x221ff6,null))[_0x056f('0x40')](handleError(_0x221ff6,null));};exports[_0x056f('0x46')]=function(_0x40b7ce,_0x3ef545){return db[_0x056f('0x2b')]['create'](_0x40b7ce[_0x056f('0x47')],{})[_0x056f('0x26')](respondWithResult(_0x3ef545,0xc9))['catch'](handleError(_0x3ef545,null));};exports['update']=function(_0x1cdf86,_0x3167e0){if(_0x1cdf86['body']['id']){delete _0x1cdf86[_0x056f('0x47')]['id'];}return db[_0x056f('0x2b')]['find']({'where':{'id':_0x1cdf86[_0x056f('0x42')]['id']}})[_0x056f('0x26')](handleEntityNotFound(_0x3167e0,null))[_0x056f('0x26')](saveUpdates(_0x1cdf86[_0x056f('0x47')],null))['then'](respondWithResult(_0x3167e0,null))[_0x056f('0x40')](handleError(_0x3167e0,null));};exports[_0x056f('0x48')]=function(_0x552136,_0x2975fb){return db[_0x056f('0x2b')][_0x056f('0x45')]({'where':{'id':_0x552136['params']['id']}})[_0x056f('0x26')](handleEntityNotFound(_0x2975fb,null))[_0x056f('0x26')](removeEntity(_0x2975fb,null))[_0x056f('0x40')](handleError(_0x2975fb,null));};exports[_0x056f('0x49')]=function(_0x55e4ff,_0x4f5dee,_0x577419){var _0x40a45f={};var _0x58c499={};var _0x5d9fac;var _0x5314a4;return db[_0x056f('0x2b')][_0x056f('0x4a')]({'where':{'id':_0x55e4ff[_0x056f('0x42')]['id']}})[_0x056f('0x26')](handleEntityNotFound(_0x4f5dee,null))['then'](function(_0x2961aa){if(_0x2961aa){_0x5d9fac=_0x2961aa;_0x58c499[_0x056f('0x2e')]=_[_0x056f('0x43')](db[_0x056f('0x4b')][_0x056f('0x2c')]);_0x58c499[_0x056f('0x2f')]=_[_0x056f('0x43')](_0x55e4ff['query']);_0x58c499['filters']=_[_0x056f('0x32')](_0x58c499[_0x056f('0x2e')],_0x58c499[_0x056f('0x2f')]);_0x40a45f[_0x056f('0x31')]=_[_0x056f('0x32')](_0x58c499[_0x056f('0x2e')],qs['fields'](_0x55e4ff['query'][_0x056f('0x33')]));_0x40a45f[_0x056f('0x31')]=_0x40a45f[_0x056f('0x31')]['length']?_0x40a45f[_0x056f('0x31')]:_0x58c499['model'];_0x40a45f[_0x056f('0x4c')]=qs['sort'](_0x55e4ff['query'][_0x056f('0x36')]);_0x40a45f[_0x056f('0x39')]=qs['filters'](_[_0x056f('0x37')](_0x55e4ff[_0x056f('0x2f')],_0x58c499[_0x056f('0x30')]));if(_0x55e4ff[_0x056f('0x2f')][_0x056f('0x38')]){_0x40a45f['where']=_[_0x056f('0x3a')](_0x40a45f[_0x056f('0x39')],{'$or':_['map'](_0x40a45f['attributes'],function(_0x3a69bf){var _0x1c1920={};_0x1c1920[_0x3a69bf]={'$like':'%'+_0x55e4ff[_0x056f('0x2f')]['filter']+'%'};return _0x1c1920;})});}_0x40a45f=_['merge']({},_0x40a45f,_0x55e4ff[_0x056f('0x3c')]);return _0x5d9fac[_0x056f('0x49')](_0x40a45f);}})[_0x056f('0x26')](function(_0x5b8643){if(_0x5b8643){_0x5314a4=_0x5b8643['length'];if(!_0x55e4ff[_0x056f('0x2f')][_0x056f('0x34')](_0x056f('0x35'))){_0x40a45f['limit']=qs[_0x056f('0x23')](_0x55e4ff[_0x056f('0x2f')][_0x056f('0x23')]);_0x40a45f[_0x056f('0x20')]=qs[_0x056f('0x20')](_0x55e4ff['query']['offset']);}return _0x5d9fac[_0x056f('0x49')](_0x40a45f);}})[_0x056f('0x26')](function(_0x156258){if(_0x156258){return _0x156258?{'count':_0x5314a4,'rows':_0x156258}:null;}})[_0x056f('0x26')](respondWithResult(_0x4f5dee,null))[_0x056f('0x40')](handleError(_0x4f5dee,null));};exports[_0x056f('0x4d')]=function(_0x132e9e,_0x1dd37d,_0x26638c){var _0x893f3b={};var _0x426a20={};var _0x2d752c;var _0x2b19b3;return db[_0x056f('0x2b')]['findOne']({'where':{'id':_0x132e9e['params']['id']}})['then'](handleEntityNotFound(_0x1dd37d,null))[_0x056f('0x26')](function(_0xb89a1d){if(_0xb89a1d){_0x2d752c=_0xb89a1d;_0x426a20[_0x056f('0x2e')]=_[_0x056f('0x43')](db['FreshdeskField']['rawAttributes']);_0x426a20[_0x056f('0x2f')]=_[_0x056f('0x43')](_0x132e9e['query']);_0x426a20[_0x056f('0x30')]=_['intersection'](_0x426a20[_0x056f('0x2e')],_0x426a20[_0x056f('0x2f')]);_0x893f3b[_0x056f('0x31')]=_['intersection'](_0x426a20[_0x056f('0x2e')],qs[_0x056f('0x33')](_0x132e9e[_0x056f('0x2f')][_0x056f('0x33')]));_0x893f3b[_0x056f('0x31')]=_0x893f3b[_0x056f('0x31')][_0x056f('0x44')]?_0x893f3b[_0x056f('0x31')]:_0x426a20[_0x056f('0x2e')];_0x893f3b[_0x056f('0x4c')]=qs[_0x056f('0x36')](_0x132e9e[_0x056f('0x2f')][_0x056f('0x36')]);_0x893f3b[_0x056f('0x39')]=qs[_0x056f('0x30')](_['pick'](_0x132e9e['query'],_0x426a20[_0x056f('0x30')]));if(_0x132e9e[_0x056f('0x2f')][_0x056f('0x38')]){_0x893f3b['where']=_[_0x056f('0x3a')](_0x893f3b[_0x056f('0x39')],{'$or':_[_0x056f('0x2a')](_0x893f3b[_0x056f('0x31')],function(_0x135332){var _0x115975={};_0x115975[_0x135332]={'$like':'%'+_0x132e9e[_0x056f('0x2f')][_0x056f('0x38')]+'%'};return _0x115975;})});}_0x893f3b=_['merge']({},_0x893f3b,_0x132e9e[_0x056f('0x3c')]);return _0x2d752c[_0x056f('0x4d')](_0x893f3b);}})['then'](function(_0x219b38){if(_0x219b38){_0x2b19b3=_0x219b38['length'];if(!_0x132e9e['query'][_0x056f('0x34')]('nolimit')){_0x893f3b[_0x056f('0x23')]=qs['limit'](_0x132e9e[_0x056f('0x2f')][_0x056f('0x23')]);_0x893f3b[_0x056f('0x20')]=qs[_0x056f('0x20')](_0x132e9e[_0x056f('0x2f')]['offset']);}return _0x2d752c[_0x056f('0x4d')](_0x893f3b);}})[_0x056f('0x26')](function(_0x2f50f4){if(_0x2f50f4){return _0x2f50f4?{'count':_0x2b19b3,'rows':_0x2f50f4}:null;}})[_0x056f('0x26')](respondWithResult(_0x1dd37d,null))[_0x056f('0x40')](handleError(_0x1dd37d,null));};exports[_0x056f('0x4e')]=function(_0x222cc5,_0x479a20,_0x3896c2){var _0x3c3ef0={};var _0x5e3bd2={};var _0xcf7f40;var _0x249e7b;return db['FreshdeskConfiguration'][_0x056f('0x4a')]({'where':{'id':_0x222cc5[_0x056f('0x42')]['id']}})[_0x056f('0x26')](handleEntityNotFound(_0x479a20,null))[_0x056f('0x26')](function(_0x5eee6f){if(_0x5eee6f){_0xcf7f40=_0x5eee6f;_0x5e3bd2[_0x056f('0x2e')]=_[_0x056f('0x43')](db[_0x056f('0x4b')][_0x056f('0x2c')]);_0x5e3bd2[_0x056f('0x2f')]=_[_0x056f('0x43')](_0x222cc5[_0x056f('0x2f')]);_0x5e3bd2[_0x056f('0x30')]=_['intersection'](_0x5e3bd2[_0x056f('0x2e')],_0x5e3bd2['query']);_0x3c3ef0[_0x056f('0x31')]=_['intersection'](_0x5e3bd2[_0x056f('0x2e')],qs[_0x056f('0x33')](_0x222cc5[_0x056f('0x2f')][_0x056f('0x33')]));_0x3c3ef0[_0x056f('0x31')]=_0x3c3ef0[_0x056f('0x31')][_0x056f('0x44')]?_0x3c3ef0[_0x056f('0x31')]:_0x5e3bd2[_0x056f('0x2e')];_0x3c3ef0[_0x056f('0x4c')]=qs[_0x056f('0x36')](_0x222cc5[_0x056f('0x2f')][_0x056f('0x36')]);_0x3c3ef0[_0x056f('0x39')]=qs['filters'](_[_0x056f('0x37')](_0x222cc5[_0x056f('0x2f')],_0x5e3bd2[_0x056f('0x30')]));if(_0x222cc5[_0x056f('0x2f')]['filter']){_0x3c3ef0['where']=_[_0x056f('0x3a')](_0x3c3ef0['where'],{'$or':_[_0x056f('0x2a')](_0x3c3ef0['attributes'],function(_0x35c667){var _0x4ad788={};_0x4ad788[_0x35c667]={'$like':'%'+_0x222cc5['query']['filter']+'%'};return _0x4ad788;})});}_0x3c3ef0=_[_0x056f('0x3a')]({},_0x3c3ef0,_0x222cc5['options']);return _0xcf7f40[_0x056f('0x4e')](_0x3c3ef0);}})[_0x056f('0x26')](function(_0x10cd97){if(_0x10cd97){_0x249e7b=_0x10cd97['length'];if(!_0x222cc5['query'][_0x056f('0x34')](_0x056f('0x35'))){_0x3c3ef0[_0x056f('0x23')]=qs[_0x056f('0x23')](_0x222cc5[_0x056f('0x2f')]['limit']);_0x3c3ef0[_0x056f('0x20')]=qs[_0x056f('0x20')](_0x222cc5[_0x056f('0x2f')][_0x056f('0x20')]);}return _0xcf7f40['getDescriptions'](_0x3c3ef0);}})[_0x056f('0x26')](function(_0x59e920){if(_0x59e920){return _0x59e920?{'count':_0x249e7b,'rows':_0x59e920}:null;}})[_0x056f('0x26')](respondWithResult(_0x479a20,null))[_0x056f('0x40')](handleError(_0x479a20,null));};exports['getTags']=function(_0x183e86,_0x67ef3,_0x356432){var _0x296e25={};var _0x3ad592={};var _0x993de6;var _0x1429f4;return db[_0x056f('0x2b')]['findOne']({'where':{'id':_0x183e86[_0x056f('0x42')]['id']}})[_0x056f('0x26')](handleEntityNotFound(_0x67ef3,null))['then'](function(_0xa48d10){if(_0xa48d10){_0x993de6=_0xa48d10;_0x3ad592[_0x056f('0x2e')]=_[_0x056f('0x43')](db[_0x056f('0x4f')][_0x056f('0x2c')]);_0x3ad592['query']=_[_0x056f('0x43')](_0x183e86[_0x056f('0x2f')]);_0x3ad592[_0x056f('0x30')]=_['intersection'](_0x3ad592[_0x056f('0x2e')],_0x3ad592['query']);_0x296e25['attributes']=_['intersection'](_0x3ad592[_0x056f('0x2e')],qs['fields'](_0x183e86[_0x056f('0x2f')][_0x056f('0x33')]));_0x296e25[_0x056f('0x31')]=_0x296e25[_0x056f('0x31')]['length']?_0x296e25['attributes']:_0x3ad592[_0x056f('0x2e')];_0x296e25[_0x056f('0x4c')]=qs[_0x056f('0x36')](_0x183e86[_0x056f('0x2f')][_0x056f('0x36')]);_0x296e25[_0x056f('0x39')]=qs[_0x056f('0x30')](_[_0x056f('0x37')](_0x183e86[_0x056f('0x2f')],_0x3ad592['filters']));if(_0x183e86[_0x056f('0x2f')][_0x056f('0x38')]){_0x296e25['where']=_[_0x056f('0x3a')](_0x296e25[_0x056f('0x39')],{'$or':_[_0x056f('0x2a')](_0x296e25[_0x056f('0x31')],function(_0x18faae){var _0x1b8caf={};_0x1b8caf[_0x18faae]={'$like':'%'+_0x183e86[_0x056f('0x2f')][_0x056f('0x38')]+'%'};return _0x1b8caf;})});}_0x296e25=_[_0x056f('0x3a')]({},_0x296e25,_0x183e86[_0x056f('0x3c')]);return _0x993de6[_0x056f('0x50')](_0x296e25);}})[_0x056f('0x26')](function(_0x1e0710){if(_0x1e0710){_0x1429f4=_0x1e0710[_0x056f('0x44')];if(!_0x183e86[_0x056f('0x2f')][_0x056f('0x34')]('nolimit')){_0x296e25[_0x056f('0x23')]=qs[_0x056f('0x23')](_0x183e86[_0x056f('0x2f')][_0x056f('0x23')]);_0x296e25[_0x056f('0x20')]=qs[_0x056f('0x20')](_0x183e86[_0x056f('0x2f')][_0x056f('0x20')]);}return _0x993de6[_0x056f('0x50')](_0x296e25);}})[_0x056f('0x26')](function(_0x49304d){if(_0x49304d){return _0x49304d?{'count':_0x1429f4,'rows':_0x49304d}:null;}})[_0x056f('0x26')](respondWithResult(_0x67ef3,null))[_0x056f('0x40')](handleError(_0x67ef3,null));};exports['setTags']=function(_0x58807f,_0x3d3a3f,_0x3e875a){if(_0x58807f['body']['id']){delete _0x58807f[_0x056f('0x47')]['id'];}return db['FreshdeskConfiguration'][_0x056f('0x4a')]({'where':{'id':_0x58807f['params']['id']}})[_0x056f('0x26')](handleEntityNotFound(_0x3d3a3f,null))['then'](function(_0x4f390b){if(_0x4f390b){return _0x4f390b['setTags'](_0x58807f[_0x056f('0x47')][_0x056f('0x51')]||[]);}return null;})[_0x056f('0x26')](respondWithResult(_0x3d3a3f,null))['catch'](handleError(_0x3d3a3f,null));};
\ No newline at end of file
index 8f77141..d7f7c3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ff1=['./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','bluebird','request-promise','path'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x1ff1,0xaf));var _0x11ff=function(_0x4f6547,_0x12599b){_0x4f6547=_0x4f6547-0x0;var _0x398dac=_0x1ff1[_0x4f6547];return _0x398dac;};'use strict';var _=require(_0x11ff('0x0'));var util=require(_0x11ff('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x11ff('0x2'));var rp=require(_0x11ff('0x3'));var fs=require('fs');var path=require(_0x11ff('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x11ff('0x5'));module['exports']=function(_0x285c3a,_0x297c47){return _0x285c3a[_0x11ff('0x6')](_0x11ff('0x7'),attributes,{'tableName':_0x11ff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6474=['lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','exports','define','FreshdeskConfiguration'];(function(_0x2bd30c,_0x4037d9){var _0x1f0e96=function(_0x28bc5e){while(--_0x28bc5e){_0x2bd30c['push'](_0x2bd30c['shift']());}};_0x1f0e96(++_0x4037d9);}(_0x6474,0xf0));var _0x4647=function(_0x365274,_0xf4d7ff){_0x365274=_0x365274-0x0;var _0x276856=_0x6474[_0x365274];return _0x276856;};'use strict';var _=require(_0x4647('0x0'));var util=require(_0x4647('0x1'));var logger=require(_0x4647('0x2'))('api');var moment=require(_0x4647('0x3'));var BPromise=require('bluebird');var rp=require(_0x4647('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4647('0x5'));var config=require(_0x4647('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x4647('0x7')]=function(_0x434fcc,_0x487ad7){return _0x434fcc[_0x4647('0x8')](_0x4647('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 98fb27d..ee69007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9f1=['stringify','code','error','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0xa9f1,0x182));var _0x1a9f=function(_0x3dc5a2,_0x56ed72){_0x3dc5a2=_0x3dc5a2-0x0;var _0x5999ea=_0xa9f1[_0x3dc5a2];return _0x5999ea;};'use strict';var _=require('lodash');var util=require(_0x1a9f('0x0'));var moment=require('moment');var BPromise=require(_0x1a9f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a9f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a9f('0x3'));var logger=require(_0x1a9f('0x4'))(_0x1a9f('0x5'));var config=require('../../config/environment');var jayson=require(_0x1a9f('0x6'));var client=jayson['client'][_0x1a9f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x152a27,_0x505cdd,_0x10d505){return new BPromise(function(_0xa2ca6c,_0x3b8aab){return client[_0x1a9f('0x8')](_0x152a27,_0x10d505)[_0x1a9f('0x9')](function(_0x5e1f63){logger[_0x1a9f('0xa')](_0x1a9f('0xb'),_0x505cdd,_0x1a9f('0xc'));logger[_0x1a9f('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x505cdd,'request\x20sent',JSON[_0x1a9f('0xe')](_0x5e1f63));if(_0x5e1f63['error']){if(_0x5e1f63['error'][_0x1a9f('0xf')]===0x1f4){logger['error'](_0x1a9f('0xb'),_0x505cdd,_0x5e1f63[_0x1a9f('0x10')][_0x1a9f('0x11')]);return _0x3b8aab(_0x5e1f63[_0x1a9f('0x10')][_0x1a9f('0x11')]);}logger[_0x1a9f('0x10')](_0x1a9f('0xb'),_0x505cdd,_0x5e1f63[_0x1a9f('0x10')]['message']);return _0xa2ca6c(_0x5e1f63['error']['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x505cdd,_0x1a9f('0xc'));_0xa2ca6c(_0x5e1f63[_0x1a9f('0x12')][_0x1a9f('0x11')]);}})[_0x1a9f('0x13')](function(_0x9d8aed){logger[_0x1a9f('0x10')](_0x1a9f('0xb'),_0x505cdd,_0x9d8aed);_0x3b8aab(_0x9d8aed);});});}
\ No newline at end of file
+var _0xec30=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x650518,_0x5cbb2a){var _0x5d8187=function(_0xf9a7b3){while(--_0xf9a7b3){_0x650518['push'](_0x650518['shift']());}};_0x5d8187(++_0x5cbb2a);}(_0xec30,0xdb));var _0x0ec3=function(_0x820e1b,_0x2119c1){_0x820e1b=_0x820e1b-0x0;var _0x3f75f8=_0xec30[_0x820e1b];return _0x3f75f8;};'use strict';var _=require(_0x0ec3('0x0'));var util=require(_0x0ec3('0x1'));var moment=require(_0x0ec3('0x2'));var BPromise=require(_0x0ec3('0x3'));var rs=require(_0x0ec3('0x4'));var fs=require('fs');var Redis=require(_0x0ec3('0x5'));var db=require(_0x0ec3('0x6'))['db'];var utils=require(_0x0ec3('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0ec3('0x8'));var jayson=require(_0x0ec3('0x9'));var client=jayson[_0x0ec3('0xa')][_0x0ec3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dcf2c,_0x3851e3,_0x41a5a5){return new BPromise(function(_0x2e5ef1,_0x387b64){return client[_0x0ec3('0xc')](_0x2dcf2c,_0x41a5a5)[_0x0ec3('0xd')](function(_0x289ec1){logger['info'](_0x0ec3('0xe'),_0x3851e3,'request\x20sent');logger[_0x0ec3('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3851e3,_0x0ec3('0x10'),JSON[_0x0ec3('0x11')](_0x289ec1));if(_0x289ec1[_0x0ec3('0x12')]){if(_0x289ec1[_0x0ec3('0x12')][_0x0ec3('0x13')]===0x1f4){logger[_0x0ec3('0x12')](_0x0ec3('0xe'),_0x3851e3,_0x289ec1[_0x0ec3('0x12')][_0x0ec3('0x14')]);return _0x387b64(_0x289ec1[_0x0ec3('0x12')][_0x0ec3('0x14')]);}logger[_0x0ec3('0x12')](_0x0ec3('0xe'),_0x3851e3,_0x289ec1['error'][_0x0ec3('0x14')]);return _0x2e5ef1(_0x289ec1['error'][_0x0ec3('0x14')]);}else{logger[_0x0ec3('0x15')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3851e3,_0x0ec3('0x10'));_0x2e5ef1(_0x289ec1[_0x0ec3('0x16')][_0x0ec3('0x14')]);}})[_0x0ec3('0x17')](function(_0x50d519){logger[_0x0ec3('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3851e3,_0x50d519);_0x387b64(_0x50d519);});});}
\ No newline at end of file
index e99e03d..3b60b00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d47=['destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','put','delete'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x4d47,0x101));var _0x74d4=function(_0x3fd60c,_0x23fb55){_0x3fd60c=_0x3fd60c-0x0;var _0x33d2ff=_0x4d47[_0x3fd60c];return _0x33d2ff;};'use strict';var multer=require(_0x74d4('0x0'));var util=require(_0x74d4('0x1'));var path=require(_0x74d4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x74d4('0x3')]();var fs_extra=require(_0x74d4('0x4'));var auth=require(_0x74d4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x74d4('0x6'));var controller=require(_0x74d4('0x7'));router[_0x74d4('0x8')]('/',auth[_0x74d4('0x9')](),controller[_0x74d4('0xa')]);router[_0x74d4('0x8')]('/:id',auth[_0x74d4('0x9')](),controller['show']);router['post']('/',auth[_0x74d4('0x9')](),controller['create']);router[_0x74d4('0xb')]('/:id',auth[_0x74d4('0x9')](),controller['update']);router[_0x74d4('0xc')]('/:id',auth[_0x74d4('0x9')](),controller[_0x74d4('0xd')]);module[_0x74d4('0xe')]=router;
\ No newline at end of file
+var _0x3130=['path','connect-timeout','express','../../components/auth/service','isAuthenticated','get','/:id','show','post','put','destroy','exports','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3130,0x1b9));var _0x0313=function(_0x4f9f56,_0x5ae9ce){_0x4f9f56=_0x4f9f56-0x0;var _0x48dabb=_0x3130[_0x4f9f56];return _0x48dabb;};'use strict';var multer=require('multer');var util=require(_0x0313('0x0'));var path=require(_0x0313('0x1'));var timeout=require(_0x0313('0x2'));var express=require(_0x0313('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0313('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0x0313('0x5')](),controller['index']);router[_0x0313('0x6')](_0x0313('0x7'),auth[_0x0313('0x5')](),controller[_0x0313('0x8')]);router[_0x0313('0x9')]('/',auth[_0x0313('0x5')](),controller['create']);router[_0x0313('0xa')](_0x0313('0x7'),auth[_0x0313('0x5')](),controller['update']);router['delete']('/:id',auth[_0x0313('0x5')](),controller[_0x0313('0xb')]);module[_0x0313('0xc')]=router;
\ No newline at end of file
index 011a975..62d77b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0335=['customVariable','BOOLEAN','exports','ENUM','variable','keyValue','string','STRING'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x0335,0x6a));var _0x5033=function(_0x21d9b3,_0x4d20d4){_0x21d9b3=_0x21d9b3-0x0;var _0x5b89ce=_0x0335[_0x21d9b3];return _0x5b89ce;};'use strict';var Sequelize=require('sequelize');module[_0x5033('0x0')]={'type':{'type':Sequelize[_0x5033('0x1')]('string',_0x5033('0x2'),'customVariable',_0x5033('0x3'),'picklist'),'defaultValue':_0x5033('0x4')},'content':{'type':Sequelize[_0x5033('0x5')]},'key':{'type':Sequelize[_0x5033('0x5')]},'keyType':{'type':Sequelize[_0x5033('0x1')](_0x5033('0x4'),_0x5033('0x2'),_0x5033('0x6'))},'keyContent':{'type':Sequelize[_0x5033('0x5')]},'idField':{'type':Sequelize[_0x5033('0x5')]},'nameField':{'type':Sequelize[_0x5033('0x5')]},'customField':{'type':Sequelize[_0x5033('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5033('0x5')]}};
\ No newline at end of file
+var _0x6568=['BOOLEAN','ENUM','string','variable','picklist','STRING'];(function(_0x36f501,_0x39fe6e){var _0x529e03=function(_0x24b7cf){while(--_0x24b7cf){_0x36f501['push'](_0x36f501['shift']());}};_0x529e03(++_0x39fe6e);}(_0x6568,0x145));var _0x8656=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6568[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x8656('0x0')](_0x8656('0x1'),_0x8656('0x2'),'customVariable','keyValue',_0x8656('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8656('0x4')]},'key':{'type':Sequelize[_0x8656('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x8656('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x8656('0x4')]},'idField':{'type':Sequelize[_0x8656('0x4')]},'nameField':{'type':Sequelize[_0x8656('0x4')]},'customField':{'type':Sequelize[_0x8656('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8656('0x4')]}};
\ No newline at end of file
index c8a30d7..e63fc23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e5c=['options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','pick','map','VIRTUAL','filter','FreshdeskField','includeAll','findAll','rows','params','include','merge'];(function(_0x1f4d60,_0x20aa3c){var _0x3ace4a=function(_0xc92e10){while(--_0xc92e10){_0x1f4d60['push'](_0x1f4d60['shift']());}};_0x3ace4a(++_0x20aa3c);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x5c559c,_0x12116c){_0x5c559c=_0x5c559c-0x0;var _0x5ecdb2=_0x3e5c[_0x5c559c];return _0x5ecdb2;};'use strict';var emlformat=require(_0xc3e5('0x0'));var rimraf=require(_0xc3e5('0x1'));var zipdir=require(_0xc3e5('0x2'));var jsonpatch=require(_0xc3e5('0x3'));var rp=require('request-promise');var moment=require(_0xc3e5('0x4'));var BPromise=require(_0xc3e5('0x5'));var Mustache=require(_0xc3e5('0x6'));var util=require(_0xc3e5('0x7'));var path=require(_0xc3e5('0x8'));var sox=require(_0xc3e5('0x9'));var csv=require('to-csv');var ejs=require(_0xc3e5('0xa'));var fs=require('fs');var fs_extra=require(_0xc3e5('0xb'));var _=require(_0xc3e5('0xc'));var squel=require(_0xc3e5('0xd'));var crypto=require(_0xc3e5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc3e5('0xf'));var toCsv=require(_0xc3e5('0x10'));var querystring=require(_0xc3e5('0x11'));var Papa=require(_0xc3e5('0x12'));var Redis=require(_0xc3e5('0x13'));var authService=require(_0xc3e5('0x14'));var qs=require(_0xc3e5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3e5('0x16'));var logger=require(_0xc3e5('0x17'))(_0xc3e5('0x18'));var utils=require(_0xc3e5('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc3e5('0x1a'));var db=require(_0xc3e5('0x1b'))['db'];function respondWithStatusCode(_0x36193e,_0x3f0395){_0x3f0395=_0x3f0395||0xcc;return function(_0x3b7441){if(_0x3b7441){return _0x36193e[_0xc3e5('0x1c')](_0x3f0395);}return _0x36193e['status'](_0x3f0395)['end']();};}function respondWithResult(_0x52cca7,_0x27c226){_0x27c226=_0x27c226||0xc8;return function(_0x5a52f1){if(_0x5a52f1){return _0x52cca7[_0xc3e5('0x1d')](_0x27c226)[_0xc3e5('0x1e')](_0x5a52f1);}};}function respondWithFilteredResult(_0x4d1ad9,_0x353dc0){return function(_0x3e3eaa){if(_0x3e3eaa){var _0x2cc476=typeof _0x353dc0[_0xc3e5('0x1f')]===_0xc3e5('0x20')&&typeof _0x353dc0['limit']===_0xc3e5('0x20');var _0x277063=_0x3e3eaa[_0xc3e5('0x21')];var _0xa33d84=_0x2cc476?0x0:_0x353dc0[_0xc3e5('0x1f')];var _0x1e1eea=_0x2cc476?_0x3e3eaa['count']:_0x353dc0[_0xc3e5('0x1f')]+_0x353dc0[_0xc3e5('0x22')];var _0x4a1d86;if(_0x1e1eea>=_0x277063){_0x1e1eea=_0x277063;_0x4a1d86=0xc8;}else{_0x4a1d86=0xce;}_0x4d1ad9[_0xc3e5('0x1d')](_0x4a1d86);return _0x4d1ad9['set'](_0xc3e5('0x23'),_0xa33d84+'-'+_0x1e1eea+'/'+_0x277063)[_0xc3e5('0x1e')](_0x3e3eaa);}return null;};}function patchUpdates(_0x2d551b){return function(_0xebf6dc){try{jsonpatch[_0xc3e5('0x24')](_0xebf6dc,_0x2d551b,!![]);}catch(_0x4a7806){return BPromise[_0xc3e5('0x25')](_0x4a7806);}return _0xebf6dc[_0xc3e5('0x26')]();};}function saveUpdates(_0x2d8c6f,_0x3eb513){return function(_0x414ba9){if(_0x414ba9){return _0x414ba9[_0xc3e5('0x27')](_0x2d8c6f)[_0xc3e5('0x28')](function(_0x47f344){return _0x47f344;});}return null;};}function removeEntity(_0x3a2800,_0x430cb4){return function(_0x43d01e){if(_0x43d01e){return _0x43d01e[_0xc3e5('0x29')]()[_0xc3e5('0x28')](function(){_0x3a2800[_0xc3e5('0x1d')](0xcc)[_0xc3e5('0x2a')]();});}};}function handleEntityNotFound(_0x45556e,_0x564748){return function(_0x25d3a3){if(!_0x25d3a3){_0x45556e['sendStatus'](0x194);}return _0x25d3a3;};}function handleError(_0x4c0cf4,_0x8815af){_0x8815af=_0x8815af||0x1f4;return function(_0x12ad6e){logger[_0xc3e5('0x2b')](_0x12ad6e['stack']);if(_0x12ad6e[_0xc3e5('0x2c')]){delete _0x12ad6e[_0xc3e5('0x2c')];}_0x4c0cf4[_0xc3e5('0x1d')](_0x8815af)[_0xc3e5('0x2d')](_0x12ad6e);};}exports['index']=function(_0xa6766d,_0x497ecf){var _0x45ca6d={},_0xc0e6e7={},_0xc58f2b={'count':0x0,'rows':[]};var _0x5a2d41=_['map'](db['FreshdeskField'][_0xc3e5('0x2e')],function(_0x45cd9c){return{'name':_0x45cd9c[_0xc3e5('0x2f')],'type':_0x45cd9c[_0xc3e5('0x30')][_0xc3e5('0x31')]};});_0xc0e6e7[_0xc3e5('0x32')]=_['map'](_0x5a2d41,_0xc3e5('0x2c'));_0xc0e6e7[_0xc3e5('0x33')]=_[_0xc3e5('0x34')](_0xa6766d[_0xc3e5('0x33')]);_0xc0e6e7[_0xc3e5('0x35')]=_[_0xc3e5('0x36')](_0xc0e6e7[_0xc3e5('0x32')],_0xc0e6e7[_0xc3e5('0x33')]);_0x45ca6d[_0xc3e5('0x37')]=_[_0xc3e5('0x36')](_0xc0e6e7[_0xc3e5('0x32')],qs['fields'](_0xa6766d[_0xc3e5('0x33')]['fields']));_0x45ca6d[_0xc3e5('0x37')]=_0x45ca6d[_0xc3e5('0x37')][_0xc3e5('0x38')]?_0x45ca6d[_0xc3e5('0x37')]:_0xc0e6e7['model'];if(!_0xa6766d[_0xc3e5('0x33')]['hasOwnProperty']('nolimit')){_0x45ca6d[_0xc3e5('0x22')]=qs['limit'](_0xa6766d[_0xc3e5('0x33')][_0xc3e5('0x22')]);_0x45ca6d[_0xc3e5('0x1f')]=qs[_0xc3e5('0x1f')](_0xa6766d[_0xc3e5('0x33')]['offset']);}_0x45ca6d[_0xc3e5('0x39')]=qs[_0xc3e5('0x3a')](_0xa6766d[_0xc3e5('0x33')][_0xc3e5('0x3a')]);_0x45ca6d[_0xc3e5('0x3b')]=qs['filters'](_[_0xc3e5('0x3c')](_0xa6766d['query'],_0xc0e6e7[_0xc3e5('0x35')]),_0x5a2d41);if(_0xa6766d[_0xc3e5('0x33')]['filter']){_0x45ca6d[_0xc3e5('0x3b')]=_['merge'](_0x45ca6d[_0xc3e5('0x3b')],{'$or':_[_0xc3e5('0x3d')](_0x5a2d41,function(_0x3e7333){if(_0x3e7333['type']!==_0xc3e5('0x3e')){var _0x3c496f={};_0x3c496f[_0x3e7333[_0xc3e5('0x2c')]]={'$like':'%'+_0xa6766d[_0xc3e5('0x33')][_0xc3e5('0x3f')]+'%'};return _0x3c496f;}})});}_0x45ca6d=_['merge']({},_0x45ca6d,_0xa6766d['options']);var _0x5ebe00={'where':_0x45ca6d[_0xc3e5('0x3b')]};return db[_0xc3e5('0x40')]['count'](_0x5ebe00)[_0xc3e5('0x28')](function(_0x5b100d){_0xc58f2b[_0xc3e5('0x21')]=_0x5b100d;if(_0xa6766d['query'][_0xc3e5('0x41')]){_0x45ca6d['include']=[{'all':!![]}];}return db[_0xc3e5('0x40')][_0xc3e5('0x42')](_0x45ca6d);})[_0xc3e5('0x28')](function(_0x1c5177){_0xc58f2b[_0xc3e5('0x43')]=_0x1c5177;return _0xc58f2b;})[_0xc3e5('0x28')](respondWithFilteredResult(_0x497ecf,_0x45ca6d))['catch'](handleError(_0x497ecf,null));};exports['show']=function(_0x3213d3,_0x5f4328){var _0x3f0887={'raw':!![],'where':{'id':_0x3213d3[_0xc3e5('0x44')]['id']}},_0x27354c={};_0x27354c[_0xc3e5('0x32')]=_[_0xc3e5('0x34')](db[_0xc3e5('0x40')]['rawAttributes']);_0x27354c[_0xc3e5('0x33')]=_[_0xc3e5('0x34')](_0x3213d3[_0xc3e5('0x33')]);_0x27354c[_0xc3e5('0x35')]=_[_0xc3e5('0x36')](_0x27354c[_0xc3e5('0x32')],_0x27354c[_0xc3e5('0x33')]);_0x3f0887[_0xc3e5('0x37')]=_[_0xc3e5('0x36')](_0x27354c[_0xc3e5('0x32')],qs['fields'](_0x3213d3['query']['fields']));_0x3f0887[_0xc3e5('0x37')]=_0x3f0887['attributes'][_0xc3e5('0x38')]?_0x3f0887[_0xc3e5('0x37')]:_0x27354c[_0xc3e5('0x32')];if(_0x3213d3[_0xc3e5('0x33')]['includeAll']){_0x3f0887[_0xc3e5('0x45')]=[{'all':!![]}];}_0x3f0887=_[_0xc3e5('0x46')]({},_0x3f0887,_0x3213d3[_0xc3e5('0x47')]);return db[_0xc3e5('0x40')]['find'](_0x3f0887)['then'](handleEntityNotFound(_0x5f4328,null))[_0xc3e5('0x28')](respondWithResult(_0x5f4328,null))[_0xc3e5('0x48')](handleError(_0x5f4328,null));};exports['create']=function(_0x12cc80,_0x4c9b0b){return db[_0xc3e5('0x40')]['create'](_0x12cc80[_0xc3e5('0x49')],{})['then'](respondWithResult(_0x4c9b0b,0xc9))['catch'](handleError(_0x4c9b0b,null));};exports['update']=function(_0x87855d,_0x11da7e){if(_0x87855d[_0xc3e5('0x49')]['id']){delete _0x87855d['body']['id'];}return db['FreshdeskField'][_0xc3e5('0x4a')]({'where':{'id':_0x87855d['params']['id']}})[_0xc3e5('0x28')](handleEntityNotFound(_0x11da7e,null))[_0xc3e5('0x28')](saveUpdates(_0x87855d[_0xc3e5('0x49')],null))[_0xc3e5('0x28')](respondWithResult(_0x11da7e,null))[_0xc3e5('0x48')](handleError(_0x11da7e,null));};exports[_0xc3e5('0x29')]=function(_0x5cd31c,_0x27924f){return db['FreshdeskField']['find']({'where':{'id':_0x5cd31c[_0xc3e5('0x44')]['id']}})['then'](handleEntityNotFound(_0x27924f,null))[_0xc3e5('0x28')](removeEntity(_0x27924f,null))['catch'](handleError(_0x27924f,null));};
\ No newline at end of file
+var _0x6c76=['pick','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','FreshdeskField','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c76,0x184));var _0x66c7=function(_0x4bc84d,_0x2c8cc1){_0x4bc84d=_0x4bc84d-0x0;var _0x3c2e9b=_0x6c76[_0x4bc84d];return _0x3c2e9b;};'use strict';var emlformat=require(_0x66c7('0x0'));var rimraf=require(_0x66c7('0x1'));var zipdir=require(_0x66c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66c7('0x3'));var moment=require(_0x66c7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x66c7('0x5'));var path=require(_0x66c7('0x6'));var sox=require('sox');var csv=require(_0x66c7('0x7'));var ejs=require(_0x66c7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66c7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x66c7('0xa'));var deskjs=require(_0x66c7('0xb'));var toCsv=require(_0x66c7('0x7'));var querystring=require('querystring');var Papa=require(_0x66c7('0xc'));var Redis=require(_0x66c7('0xd'));var authService=require(_0x66c7('0xe'));var qs=require(_0x66c7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66c7('0x10'));var logger=require(_0x66c7('0x11'))(_0x66c7('0x12'));var utils=require(_0x66c7('0x13'));var config=require(_0x66c7('0x14'));var licenseUtil=require(_0x66c7('0x15'));var db=require(_0x66c7('0x16'))['db'];function respondWithStatusCode(_0x5176a3,_0x18c309){_0x18c309=_0x18c309||0xcc;return function(_0x760e36){if(_0x760e36){return _0x5176a3[_0x66c7('0x17')](_0x18c309);}return _0x5176a3[_0x66c7('0x18')](_0x18c309)[_0x66c7('0x19')]();};}function respondWithResult(_0x1e91d1,_0x618bd7){_0x618bd7=_0x618bd7||0xc8;return function(_0xf3b04){if(_0xf3b04){return _0x1e91d1[_0x66c7('0x18')](_0x618bd7)['json'](_0xf3b04);}};}function respondWithFilteredResult(_0x110f6d,_0x4dd902){return function(_0x208010){if(_0x208010){var _0x39f951=typeof _0x4dd902[_0x66c7('0x1a')]===_0x66c7('0x1b')&&typeof _0x4dd902[_0x66c7('0x1c')]==='undefined';var _0x5cf913=_0x208010['count'];var _0x5129f6=_0x39f951?0x0:_0x4dd902[_0x66c7('0x1a')];var _0x19f29d=_0x39f951?_0x208010['count']:_0x4dd902['offset']+_0x4dd902[_0x66c7('0x1c')];var _0x9b65cf;if(_0x19f29d>=_0x5cf913){_0x19f29d=_0x5cf913;_0x9b65cf=0xc8;}else{_0x9b65cf=0xce;}_0x110f6d[_0x66c7('0x18')](_0x9b65cf);return _0x110f6d[_0x66c7('0x1d')]('Content-Range',_0x5129f6+'-'+_0x19f29d+'/'+_0x5cf913)['json'](_0x208010);}return null;};}function patchUpdates(_0x1853b2){return function(_0x237177){try{jsonpatch[_0x66c7('0x1e')](_0x237177,_0x1853b2,!![]);}catch(_0x1c43c4){return BPromise[_0x66c7('0x1f')](_0x1c43c4);}return _0x237177[_0x66c7('0x20')]();};}function saveUpdates(_0x4804cf,_0x4ddbd2){return function(_0x366e9b){if(_0x366e9b){return _0x366e9b['update'](_0x4804cf)[_0x66c7('0x21')](function(_0x8b96b1){return _0x8b96b1;});}return null;};}function removeEntity(_0x44bdef,_0x1fc9d3){return function(_0x5bfaf6){if(_0x5bfaf6){return _0x5bfaf6[_0x66c7('0x22')]()[_0x66c7('0x21')](function(){_0x44bdef['status'](0xcc)[_0x66c7('0x19')]();});}};}function handleEntityNotFound(_0x11a6b9,_0x2bb86d){return function(_0x2ef6a2){if(!_0x2ef6a2){_0x11a6b9[_0x66c7('0x17')](0x194);}return _0x2ef6a2;};}function handleError(_0x54d45d,_0x5bc4e6){_0x5bc4e6=_0x5bc4e6||0x1f4;return function(_0x4e514a){logger[_0x66c7('0x23')](_0x4e514a[_0x66c7('0x24')]);if(_0x4e514a['name']){delete _0x4e514a[_0x66c7('0x25')];}_0x54d45d[_0x66c7('0x18')](_0x5bc4e6)[_0x66c7('0x26')](_0x4e514a);};}exports[_0x66c7('0x27')]=function(_0x36a830,_0x27be81){var _0x570f0d={},_0xccefb2={},_0x2e2560={'count':0x0,'rows':[]};var _0xc4b2bf=_[_0x66c7('0x28')](db[_0x66c7('0x29')]['rawAttributes'],function(_0x263b48){return{'name':_0x263b48['fieldName'],'type':_0x263b48[_0x66c7('0x2a')]['key']};});_0xccefb2[_0x66c7('0x2b')]=_[_0x66c7('0x28')](_0xc4b2bf,_0x66c7('0x25'));_0xccefb2[_0x66c7('0x2c')]=_[_0x66c7('0x2d')](_0x36a830[_0x66c7('0x2c')]);_0xccefb2['filters']=_['intersection'](_0xccefb2[_0x66c7('0x2b')],_0xccefb2[_0x66c7('0x2c')]);_0x570f0d[_0x66c7('0x2e')]=_[_0x66c7('0x2f')](_0xccefb2[_0x66c7('0x2b')],qs[_0x66c7('0x30')](_0x36a830[_0x66c7('0x2c')][_0x66c7('0x30')]));_0x570f0d[_0x66c7('0x2e')]=_0x570f0d[_0x66c7('0x2e')][_0x66c7('0x31')]?_0x570f0d[_0x66c7('0x2e')]:_0xccefb2['model'];if(!_0x36a830['query'][_0x66c7('0x32')](_0x66c7('0x33'))){_0x570f0d[_0x66c7('0x1c')]=qs[_0x66c7('0x1c')](_0x36a830[_0x66c7('0x2c')][_0x66c7('0x1c')]);_0x570f0d[_0x66c7('0x1a')]=qs['offset'](_0x36a830[_0x66c7('0x2c')][_0x66c7('0x1a')]);}_0x570f0d[_0x66c7('0x34')]=qs[_0x66c7('0x35')](_0x36a830[_0x66c7('0x2c')][_0x66c7('0x35')]);_0x570f0d[_0x66c7('0x36')]=qs[_0x66c7('0x37')](_[_0x66c7('0x38')](_0x36a830[_0x66c7('0x2c')],_0xccefb2[_0x66c7('0x37')]),_0xc4b2bf);if(_0x36a830['query']['filter']){_0x570f0d[_0x66c7('0x36')]=_[_0x66c7('0x39')](_0x570f0d[_0x66c7('0x36')],{'$or':_['map'](_0xc4b2bf,function(_0x4d46dd){if(_0x4d46dd[_0x66c7('0x2a')]!==_0x66c7('0x3a')){var _0x501771={};_0x501771[_0x4d46dd[_0x66c7('0x25')]]={'$like':'%'+_0x36a830[_0x66c7('0x2c')][_0x66c7('0x3b')]+'%'};return _0x501771;}})});}_0x570f0d=_['merge']({},_0x570f0d,_0x36a830[_0x66c7('0x3c')]);var _0x16b754={'where':_0x570f0d[_0x66c7('0x36')]};return db[_0x66c7('0x29')][_0x66c7('0x3d')](_0x16b754)[_0x66c7('0x21')](function(_0x21deb3){_0x2e2560[_0x66c7('0x3d')]=_0x21deb3;if(_0x36a830[_0x66c7('0x2c')]['includeAll']){_0x570f0d[_0x66c7('0x3e')]=[{'all':!![]}];}return db[_0x66c7('0x29')][_0x66c7('0x3f')](_0x570f0d);})[_0x66c7('0x21')](function(_0x3f169e){_0x2e2560[_0x66c7('0x40')]=_0x3f169e;return _0x2e2560;})[_0x66c7('0x21')](respondWithFilteredResult(_0x27be81,_0x570f0d))[_0x66c7('0x41')](handleError(_0x27be81,null));};exports[_0x66c7('0x42')]=function(_0x3d371a,_0x513317){var _0x5bb5fc={'raw':!![],'where':{'id':_0x3d371a[_0x66c7('0x43')]['id']}},_0x528f5c={};_0x528f5c[_0x66c7('0x2b')]=_['keys'](db['FreshdeskField'][_0x66c7('0x44')]);_0x528f5c[_0x66c7('0x2c')]=_[_0x66c7('0x2d')](_0x3d371a[_0x66c7('0x2c')]);_0x528f5c[_0x66c7('0x37')]=_['intersection'](_0x528f5c[_0x66c7('0x2b')],_0x528f5c['query']);_0x5bb5fc['attributes']=_[_0x66c7('0x2f')](_0x528f5c[_0x66c7('0x2b')],qs[_0x66c7('0x30')](_0x3d371a[_0x66c7('0x2c')]['fields']));_0x5bb5fc['attributes']=_0x5bb5fc[_0x66c7('0x2e')]['length']?_0x5bb5fc['attributes']:_0x528f5c[_0x66c7('0x2b')];if(_0x3d371a[_0x66c7('0x2c')][_0x66c7('0x45')]){_0x5bb5fc[_0x66c7('0x3e')]=[{'all':!![]}];}_0x5bb5fc=_['merge']({},_0x5bb5fc,_0x3d371a[_0x66c7('0x3c')]);return db[_0x66c7('0x29')][_0x66c7('0x46')](_0x5bb5fc)['then'](handleEntityNotFound(_0x513317,null))[_0x66c7('0x21')](respondWithResult(_0x513317,null))[_0x66c7('0x41')](handleError(_0x513317,null));};exports[_0x66c7('0x47')]=function(_0x3c45cd,_0x1b78a6){return db[_0x66c7('0x29')][_0x66c7('0x47')](_0x3c45cd[_0x66c7('0x48')],{})['then'](respondWithResult(_0x1b78a6,0xc9))[_0x66c7('0x41')](handleError(_0x1b78a6,null));};exports[_0x66c7('0x49')]=function(_0x23d0eb,_0x1386a2){if(_0x23d0eb[_0x66c7('0x48')]['id']){delete _0x23d0eb[_0x66c7('0x48')]['id'];}return db[_0x66c7('0x29')][_0x66c7('0x46')]({'where':{'id':_0x23d0eb[_0x66c7('0x43')]['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x1386a2,null))[_0x66c7('0x21')](saveUpdates(_0x23d0eb[_0x66c7('0x48')],null))[_0x66c7('0x21')](respondWithResult(_0x1386a2,null))[_0x66c7('0x41')](handleError(_0x1386a2,null));};exports['destroy']=function(_0x43d4db,_0x225fb6){return db[_0x66c7('0x29')][_0x66c7('0x46')]({'where':{'id':_0x43d4db['params']['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x225fb6,null))[_0x66c7('0x21')](removeEntity(_0x225fb6,null))['catch'](handleError(_0x225fb6,null));};
\ No newline at end of file
index 7ad90fe..2f24a9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1803=['freshdesk_unique_index','idField','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','int_freshdesk_fields'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x1803,0x1be));var _0x3180=function(_0x3745f7,_0x5181b2){_0x3745f7=_0x3745f7-0x0;var _0x1f8745=_0x1803[_0x3745f7];return _0x1f8745;};'use strict';var _=require('lodash');var util=require(_0x3180('0x0'));var logger=require('../../config/logger')(_0x3180('0x1'));var moment=require(_0x3180('0x2'));var BPromise=require(_0x3180('0x3'));var rp=require(_0x3180('0x4'));var fs=require('fs');var path=require(_0x3180('0x5'));var rimraf=require(_0x3180('0x6'));var config=require(_0x3180('0x7'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x355046,_0x252ebc){return _0x355046[_0x3180('0x8')]('FreshdeskField',attributes,{'tableName':_0x3180('0x9'),'paranoid':![],'indexes':[{'name':_0x3180('0xa'),'fields':[_0x3180('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x676a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','idField','FieldId','util'];(function(_0x4a78a5,_0x247899){var _0x2ee11b=function(_0x1b598b){while(--_0x1b598b){_0x4a78a5['push'](_0x4a78a5['shift']());}};_0x2ee11b(++_0x247899);}(_0x676a,0x14f));var _0xa676=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x676a[_0xbb091];return _0x467a04;};'use strict';var _=require('lodash');var util=require(_0xa676('0x0'));var logger=require(_0xa676('0x1'))(_0xa676('0x2'));var moment=require(_0xa676('0x3'));var BPromise=require(_0xa676('0x4'));var rp=require(_0xa676('0x5'));var fs=require('fs');var path=require(_0xa676('0x6'));var rimraf=require(_0xa676('0x7'));var config=require('../../config/environment');var attributes=require(_0xa676('0x8'));module[_0xa676('0x9')]=function(_0x3caa9b,_0x1c66f1){return _0x3caa9b['define']('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xa676('0xa'),_0xa676('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index c079ee4..5620637 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x860a=['message','result','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x860a,0xac));var _0xa860=function(_0x32ba36,_0x6dc119){_0x32ba36=_0x32ba36-0x0;var _0xe4ab10=_0x860a[_0x32ba36];return _0xe4ab10;};'use strict';var _=require(_0xa860('0x0'));var util=require('util');var moment=require(_0xa860('0x1'));var BPromise=require('bluebird');var rs=require(_0xa860('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa860('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa860('0x4'))('rpc');var config=require(_0xa860('0x5'));var jayson=require(_0xa860('0x6'));var client=jayson[_0xa860('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42084a,_0x124eb9,_0x3272c7){return new BPromise(function(_0x55c035,_0x145d02){return client[_0xa860('0x8')](_0x42084a,_0x3272c7)[_0xa860('0x9')](function(_0x296fd1){logger[_0xa860('0xa')](_0xa860('0xb'),_0x124eb9,'request\x20sent');logger['debug'](_0xa860('0xc'),_0x124eb9,_0xa860('0xd'),JSON['stringify'](_0x296fd1));if(_0x296fd1[_0xa860('0xe')]){if(_0x296fd1[_0xa860('0xe')]['code']===0x1f4){logger[_0xa860('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x124eb9,_0x296fd1[_0xa860('0xe')][_0xa860('0xf')]);return _0x145d02(_0x296fd1[_0xa860('0xe')][_0xa860('0xf')]);}logger[_0xa860('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x124eb9,_0x296fd1[_0xa860('0xe')][_0xa860('0xf')]);return _0x55c035(_0x296fd1['error'][_0xa860('0xf')]);}else{logger[_0xa860('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x124eb9,_0xa860('0xd'));_0x55c035(_0x296fd1[_0xa860('0x10')][_0xa860('0xf')]);}})['catch'](function(_0x335a81){logger[_0xa860('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x124eb9,_0x335a81);_0x145d02(_0x335a81);});});}
\ No newline at end of file
+var _0x1032=['../../config/logger','rpc','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x19b61f,_0x38c240){var _0x395b05=function(_0x3b39f4){while(--_0x3b39f4){_0x19b61f['push'](_0x19b61f['shift']());}};_0x395b05(++_0x38c240);}(_0x1032,0x83));var _0x2103=function(_0x23d492,_0x5552d1){_0x23d492=_0x23d492-0x0;var _0x5d2e18=_0x1032[_0x23d492];return _0x5d2e18;};'use strict';var _=require(_0x2103('0x0'));var util=require(_0x2103('0x1'));var moment=require(_0x2103('0x2'));var BPromise=require(_0x2103('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2103('0x4'));var db=require(_0x2103('0x5'))['db'];var utils=require(_0x2103('0x6'));var logger=require(_0x2103('0x7'))(_0x2103('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2103('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27c1c6,_0x52bc3a,_0x21bfed){return new BPromise(function(_0x2dfdf3,_0x5f472a){return client[_0x2103('0xa')](_0x27c1c6,_0x21bfed)[_0x2103('0xb')](function(_0x3dde94){logger[_0x2103('0xc')](_0x2103('0xd'),_0x52bc3a,_0x2103('0xe'));logger[_0x2103('0xf')](_0x2103('0x10'),_0x52bc3a,_0x2103('0xe'),JSON[_0x2103('0x11')](_0x3dde94));if(_0x3dde94[_0x2103('0x12')]){if(_0x3dde94[_0x2103('0x12')][_0x2103('0x13')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x52bc3a,_0x3dde94['error'][_0x2103('0x14')]);return _0x5f472a(_0x3dde94[_0x2103('0x12')][_0x2103('0x14')]);}logger[_0x2103('0x12')](_0x2103('0xd'),_0x52bc3a,_0x3dde94[_0x2103('0x12')][_0x2103('0x14')]);return _0x2dfdf3(_0x3dde94[_0x2103('0x12')][_0x2103('0x14')]);}else{logger['info'](_0x2103('0xd'),_0x52bc3a,_0x2103('0xe'));_0x2dfdf3(_0x3dde94[_0x2103('0x15')][_0x2103('0x14')]);}})[_0x2103('0x16')](function(_0x12c3fd){logger[_0x2103('0x12')](_0x2103('0xd'),_0x52bc3a,_0x12c3fd);_0x5f472a(_0x12c3fd);});});}
\ No newline at end of file
index f46afd5..bb6e4a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf66=['util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','post','create','put','update','delete','destroy','multer'];(function(_0x11a356,_0x53023f){var _0x588985=function(_0x1b173f){while(--_0x1b173f){_0x11a356['push'](_0x11a356['shift']());}};_0x588985(++_0x53023f);}(_0xcf66,0x71));var _0x6cf6=function(_0x59a654,_0x373b40){_0x59a654=_0x59a654-0x0;var _0x328ae5=_0xcf66[_0x59a654];return _0x328ae5;};'use strict';var multer=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var path=require(_0x6cf6('0x2'));var timeout=require('connect-timeout');var express=require(_0x6cf6('0x3'));var router=express[_0x6cf6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6cf6('0x5'));var config=require(_0x6cf6('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x6cf6('0x7')]('/',auth[_0x6cf6('0x8')](),controller[_0x6cf6('0x9')]);router['get'](_0x6cf6('0xa'),auth[_0x6cf6('0x8')](),controller[_0x6cf6('0xb')]);router[_0x6cf6('0x7')](_0x6cf6('0xc'),auth[_0x6cf6('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x6cf6('0x8')](),controller['getFields']);router[_0x6cf6('0xd')]('/',auth[_0x6cf6('0x8')](),controller[_0x6cf6('0xe')]);router[_0x6cf6('0xd')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x6cf6('0xf')](_0x6cf6('0xa'),auth[_0x6cf6('0x8')](),controller[_0x6cf6('0x10')]);router[_0x6cf6('0x11')](_0x6cf6('0xa'),auth['isAuthenticated'](),controller[_0x6cf6('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x4522=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','create','post','addConfiguration','put','destroy','path','connect-timeout','express','fs-extra'];(function(_0x12505e,_0x35fec7){var _0x172dc3=function(_0x23ba79){while(--_0x23ba79){_0x12505e['push'](_0x12505e['shift']());}};_0x172dc3(++_0x35fec7);}(_0x4522,0x1a0));var _0x2452=function(_0x13a7e7,_0xc2a87f){_0x13a7e7=_0x13a7e7-0x0;var _0x41027e=_0x4522[_0x13a7e7];return _0x41027e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var fs_extra=require(_0x2452('0x3'));var auth=require(_0x2452('0x4'));var interaction=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var controller=require(_0x2452('0x7'));router[_0x2452('0x8')]('/',auth[_0x2452('0x9')](),controller[_0x2452('0xa')]);router[_0x2452('0x8')](_0x2452('0xb'),auth[_0x2452('0x9')](),controller[_0x2452('0xc')]);router[_0x2452('0x8')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0xe')]);router['get']('/:id/fields',auth[_0x2452('0x9')](),controller['getFields']);router['post']('/',auth[_0x2452('0x9')](),controller[_0x2452('0xf')]);router[_0x2452('0x10')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0x11')]);router[_0x2452('0x12')](_0x2452('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2452('0xb'),auth['isAuthenticated'](),controller[_0x2452('0x13')]);module['exports']=router;
\ No newline at end of file
index f08e2a6..6930031 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b17=['username','sequelize','STRING'];(function(_0x28a96b,_0x21cad1){var _0x53bcdf=function(_0x4bbe7e){while(--_0x4bbe7e){_0x28a96b['push'](_0x28a96b['shift']());}};_0x53bcdf(++_0x21cad1);}(_0x4b17,0x10f));var _0x74b1=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0x4b17[_0x2b737c];return _0x466ed5;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x74b1('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x74b1('0x1')],'unique':_0x74b1('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x74b1('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x955f=['exports','STRING','sequelize'];(function(_0x16835f,_0x18c605){var _0x2053b0=function(_0x42f762){while(--_0x42f762){_0x16835f['push'](_0x16835f['shift']());}};_0x2053b0(++_0x18c605);}(_0x955f,0x1eb));var _0xf955=function(_0x1b8c10,_0x109ec8){_0x1b8c10=_0x1b8c10-0x0;var _0xd6704b=_0x955f[_0x1b8c10];return _0xd6704b;};'use strict';var Sequelize=require(_0xf955('0x0'));module[_0xf955('0x1')]={'name':{'type':Sequelize[_0xf955('0x2')]},'description':{'type':Sequelize[_0xf955('0x2')]},'username':{'type':Sequelize[_0xf955('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xf955('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xf955('0x2')],'allowNull':![]}};
\ No newline at end of file
index eaefc3e..76fe66f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbca3=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','FreshsalesAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesField','apiKey','remoteUri','slice','substring','lastIndexOf','format','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','statusCode','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','util'];(function(_0x31a7b9,_0x1894b9){var _0x13b914=function(_0x33c816){while(--_0x33c816){_0x31a7b9['push'](_0x31a7b9['shift']());}};_0x13b914(++_0x1894b9);}(_0xbca3,0xc1));var _0x3bca=function(_0x394902,_0x509dcb){_0x394902=_0x394902-0x0;var _0x24dc57=_0xbca3[_0x394902];return _0x24dc57;};'use strict';var emlformat=require(_0x3bca('0x0'));var rimraf=require(_0x3bca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bca('0x2'));var moment=require(_0x3bca('0x3'));var BPromise=require(_0x3bca('0x4'));var Mustache=require(_0x3bca('0x5'));var util=require(_0x3bca('0x6'));var path=require(_0x3bca('0x7'));var sox=require(_0x3bca('0x8'));var csv=require('to-csv');var ejs=require(_0x3bca('0x9'));var fs=require('fs');var fs_extra=require(_0x3bca('0xa'));var _=require(_0x3bca('0xb'));var squel=require(_0x3bca('0xc'));var crypto=require(_0x3bca('0xd'));var jsforce=require(_0x3bca('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3bca('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3bca('0x10'));var authService=require(_0x3bca('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bca('0x12'))(_0x3bca('0x13'));var utils=require(_0x3bca('0x14'));var config=require(_0x3bca('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3bca('0x16'));function respondWithStatusCode(_0x2cd37,_0x6a0928){_0x6a0928=_0x6a0928||0xcc;return function(_0x357c7a){if(_0x357c7a){return _0x2cd37[_0x3bca('0x17')](_0x6a0928);}return _0x2cd37['status'](_0x6a0928)['end']();};}function respondWithResult(_0x431643,_0x46483f){_0x46483f=_0x46483f||0xc8;return function(_0x1c5b37){if(_0x1c5b37){return _0x431643[_0x3bca('0x18')](_0x46483f)[_0x3bca('0x19')](_0x1c5b37);}};}function respondWithFilteredResult(_0x59445c,_0x1a98f2){return function(_0x3f88bf){if(_0x3f88bf){var _0x15b34c=typeof _0x1a98f2[_0x3bca('0x1a')]===_0x3bca('0x1b')&&typeof _0x1a98f2['limit']===_0x3bca('0x1b');var _0x2cc1c0=_0x3f88bf[_0x3bca('0x1c')];var _0x489451=_0x15b34c?0x0:_0x1a98f2[_0x3bca('0x1a')];var _0x4998ae=_0x15b34c?_0x3f88bf['count']:_0x1a98f2['offset']+_0x1a98f2[_0x3bca('0x1d')];var _0x2d585f;if(_0x4998ae>=_0x2cc1c0){_0x4998ae=_0x2cc1c0;_0x2d585f=0xc8;}else{_0x2d585f=0xce;}_0x59445c['status'](_0x2d585f);return _0x59445c[_0x3bca('0x1e')](_0x3bca('0x1f'),_0x489451+'-'+_0x4998ae+'/'+_0x2cc1c0)['json'](_0x3f88bf);}return null;};}function patchUpdates(_0x3b4391){return function(_0x1e699e){try{jsonpatch[_0x3bca('0x20')](_0x1e699e,_0x3b4391,!![]);}catch(_0x3a36e1){return BPromise[_0x3bca('0x21')](_0x3a36e1);}return _0x1e699e['save']();};}function saveUpdates(_0x1ca733,_0x7f9cf0){return function(_0x599844){if(_0x599844){return _0x599844[_0x3bca('0x22')](_0x1ca733)['then'](function(_0x230c20){return _0x230c20;});}return null;};}function removeEntity(_0x2d5f05,_0x2ef5c4){return function(_0xf2effc){if(_0xf2effc){return _0xf2effc[_0x3bca('0x23')]()[_0x3bca('0x24')](function(){_0x2d5f05[_0x3bca('0x18')](0xcc)[_0x3bca('0x25')]();});}};}function handleEntityNotFound(_0x122be2,_0x1ae2a0){return function(_0x53d848){if(!_0x53d848){_0x122be2[_0x3bca('0x17')](0x194);}return _0x53d848;};}function handleError(_0x4ec295,_0x3e943d){_0x3e943d=_0x3e943d||0x1f4;return function(_0x3e3623){logger[_0x3bca('0x26')](_0x3e3623[_0x3bca('0x27')]);if(_0x3e3623[_0x3bca('0x28')]){delete _0x3e3623[_0x3bca('0x28')];}_0x4ec295['status'](_0x3e943d)['send'](_0x3e3623);};}exports['index']=function(_0x573835,_0x289662){var _0xd67e40={},_0x361e74={},_0x49997d={'count':0x0,'rows':[]};var _0xd69243=_['map'](db[_0x3bca('0x29')]['rawAttributes'],function(_0x1dec92){return{'name':_0x1dec92[_0x3bca('0x2a')],'type':_0x1dec92[_0x3bca('0x2b')][_0x3bca('0x2c')]};});_0x361e74[_0x3bca('0x2d')]=_[_0x3bca('0x2e')](_0xd69243,'name');_0x361e74[_0x3bca('0x2f')]=_[_0x3bca('0x30')](_0x573835[_0x3bca('0x2f')]);_0x361e74[_0x3bca('0x31')]=_[_0x3bca('0x32')](_0x361e74['model'],_0x361e74[_0x3bca('0x2f')]);_0xd67e40[_0x3bca('0x33')]=_[_0x3bca('0x32')](_0x361e74[_0x3bca('0x2d')],qs['fields'](_0x573835[_0x3bca('0x2f')][_0x3bca('0x34')]));_0xd67e40['attributes']=_0xd67e40[_0x3bca('0x33')][_0x3bca('0x35')]?_0xd67e40[_0x3bca('0x33')]:_0x361e74[_0x3bca('0x2d')];if(!_0x573835['query'][_0x3bca('0x36')](_0x3bca('0x37'))){_0xd67e40['limit']=qs[_0x3bca('0x1d')](_0x573835[_0x3bca('0x2f')]['limit']);_0xd67e40[_0x3bca('0x1a')]=qs[_0x3bca('0x1a')](_0x573835[_0x3bca('0x2f')][_0x3bca('0x1a')]);}_0xd67e40[_0x3bca('0x38')]=qs['sort'](_0x573835['query'][_0x3bca('0x39')]);_0xd67e40[_0x3bca('0x3a')]=qs[_0x3bca('0x31')](_[_0x3bca('0x3b')](_0x573835[_0x3bca('0x2f')],_0x361e74['filters']),_0xd69243);if(_0x573835[_0x3bca('0x2f')][_0x3bca('0x3c')]){_0xd67e40[_0x3bca('0x3a')]=_['merge'](_0xd67e40[_0x3bca('0x3a')],{'$or':_[_0x3bca('0x2e')](_0xd69243,function(_0x1cceab){if(_0x1cceab[_0x3bca('0x2b')]!==_0x3bca('0x3d')){var _0x18b3d={};_0x18b3d[_0x1cceab[_0x3bca('0x28')]]={'$like':'%'+_0x573835[_0x3bca('0x2f')][_0x3bca('0x3c')]+'%'};return _0x18b3d;}})});}_0xd67e40=_[_0x3bca('0x3e')]({},_0xd67e40,_0x573835[_0x3bca('0x3f')]);var _0x1548f6={'where':_0xd67e40[_0x3bca('0x3a')]};return db[_0x3bca('0x29')][_0x3bca('0x1c')](_0x1548f6)['then'](function(_0x49f734){_0x49997d['count']=_0x49f734;if(_0x573835[_0x3bca('0x2f')][_0x3bca('0x40')]){_0xd67e40[_0x3bca('0x41')]=[{'all':!![]}];}return db[_0x3bca('0x29')][_0x3bca('0x42')](_0xd67e40);})[_0x3bca('0x24')](function(_0x111133){_0x49997d[_0x3bca('0x43')]=_0x111133;return _0x49997d;})[_0x3bca('0x24')](respondWithFilteredResult(_0x289662,_0xd67e40))[_0x3bca('0x44')](handleError(_0x289662,null));};exports[_0x3bca('0x45')]=function(_0x3c57ab,_0x5c33b0){var _0x5514ab={'raw':![],'where':{'id':_0x3c57ab[_0x3bca('0x46')]['id']}},_0x12c252={};_0x12c252[_0x3bca('0x2d')]=_[_0x3bca('0x30')](db[_0x3bca('0x29')][_0x3bca('0x47')]);_0x12c252[_0x3bca('0x2f')]=_[_0x3bca('0x30')](_0x3c57ab[_0x3bca('0x2f')]);_0x12c252['filters']=_[_0x3bca('0x32')](_0x12c252[_0x3bca('0x2d')],_0x12c252[_0x3bca('0x2f')]);_0x5514ab[_0x3bca('0x33')]=_[_0x3bca('0x32')](_0x12c252[_0x3bca('0x2d')],qs[_0x3bca('0x34')](_0x3c57ab[_0x3bca('0x2f')][_0x3bca('0x34')]));_0x5514ab['attributes']=_0x5514ab[_0x3bca('0x33')]['length']?_0x5514ab['attributes']:_0x12c252[_0x3bca('0x2d')];if(_0x3c57ab['query']['includeAll']){_0x5514ab['include']=[{'all':!![]}];}_0x5514ab=_['merge']({},_0x5514ab,_0x3c57ab['options']);return db[_0x3bca('0x29')]['find'](_0x5514ab)['then'](handleEntityNotFound(_0x5c33b0,null))[_0x3bca('0x24')](respondWithResult(_0x5c33b0,null))[_0x3bca('0x44')](handleError(_0x5c33b0,null));};exports[_0x3bca('0x48')]=function(_0x1f2f4c,_0x1a98e3){return db[_0x3bca('0x29')][_0x3bca('0x48')](_0x1f2f4c[_0x3bca('0x49')],{})[_0x3bca('0x24')](respondWithResult(_0x1a98e3,0xc9))['catch'](handleError(_0x1a98e3,null));};exports[_0x3bca('0x22')]=function(_0x5abc0a,_0x5c13ec){if(_0x5abc0a[_0x3bca('0x49')]['id']){delete _0x5abc0a[_0x3bca('0x49')]['id'];}return db[_0x3bca('0x29')][_0x3bca('0x4a')]({'where':{'id':_0x5abc0a['params']['id']}})[_0x3bca('0x24')](handleEntityNotFound(_0x5c13ec,null))[_0x3bca('0x24')](saveUpdates(_0x5abc0a[_0x3bca('0x49')],null))[_0x3bca('0x24')](respondWithResult(_0x5c13ec,null))[_0x3bca('0x44')](handleError(_0x5c13ec,null));};exports[_0x3bca('0x23')]=function(_0x28eb69,_0x1e6464){return db[_0x3bca('0x29')][_0x3bca('0x4a')]({'where':{'id':_0x28eb69[_0x3bca('0x46')]['id']}})[_0x3bca('0x24')](handleEntityNotFound(_0x1e6464,null))[_0x3bca('0x24')](removeEntity(_0x1e6464,null))[_0x3bca('0x44')](handleError(_0x1e6464,null));};exports['getConfigurations']=function(_0x274218,_0x52f321,_0x31df82){var _0x1f1713={};var _0x351588={};var _0x4619ce;var _0x38e634;return db['FreshsalesAccount'][_0x3bca('0x4b')]({'where':{'id':_0x274218[_0x3bca('0x46')]['id']}})[_0x3bca('0x24')](handleEntityNotFound(_0x52f321,null))[_0x3bca('0x24')](function(_0x48ab4d){if(_0x48ab4d){_0x4619ce=_0x48ab4d;_0x351588[_0x3bca('0x2d')]=_[_0x3bca('0x30')](db[_0x3bca('0x4c')]['rawAttributes']);_0x351588[_0x3bca('0x2f')]=_['keys'](_0x274218[_0x3bca('0x2f')]);_0x351588['filters']=_['intersection'](_0x351588[_0x3bca('0x2d')],_0x351588[_0x3bca('0x2f')]);_0x1f1713[_0x3bca('0x33')]=_[_0x3bca('0x32')](_0x351588['model'],qs[_0x3bca('0x34')](_0x274218['query'][_0x3bca('0x34')]));_0x1f1713[_0x3bca('0x33')]=_0x1f1713[_0x3bca('0x33')][_0x3bca('0x35')]?_0x1f1713[_0x3bca('0x33')]:_0x351588[_0x3bca('0x2d')];_0x1f1713[_0x3bca('0x38')]=qs[_0x3bca('0x39')](_0x274218[_0x3bca('0x2f')][_0x3bca('0x39')]);_0x1f1713[_0x3bca('0x3a')]=qs[_0x3bca('0x31')](_[_0x3bca('0x3b')](_0x274218[_0x3bca('0x2f')],_0x351588['filters']));if(_0x274218[_0x3bca('0x2f')][_0x3bca('0x3c')]){_0x1f1713['where']=_[_0x3bca('0x3e')](_0x1f1713['where'],{'$or':_['map'](_0x1f1713[_0x3bca('0x33')],function(_0x195274){var _0x52ebfd={};_0x52ebfd[_0x195274]={'$like':'%'+_0x274218[_0x3bca('0x2f')]['filter']+'%'};return _0x52ebfd;})});}_0x1f1713=_[_0x3bca('0x3e')]({},_0x1f1713,_0x274218[_0x3bca('0x3f')]);return _0x4619ce[_0x3bca('0x4d')](_0x1f1713);}})[_0x3bca('0x24')](function(_0x3e0b72){if(_0x3e0b72){_0x38e634=_0x3e0b72[_0x3bca('0x35')];if(!_0x274218['query'][_0x3bca('0x36')](_0x3bca('0x37'))){_0x1f1713[_0x3bca('0x1d')]=qs[_0x3bca('0x1d')](_0x274218[_0x3bca('0x2f')][_0x3bca('0x1d')]);_0x1f1713[_0x3bca('0x1a')]=qs[_0x3bca('0x1a')](_0x274218['query'][_0x3bca('0x1a')]);}return _0x4619ce[_0x3bca('0x4d')](_0x1f1713);}})[_0x3bca('0x24')](function(_0x22f8b1){if(_0x22f8b1){return _0x22f8b1?{'count':_0x38e634,'rows':_0x22f8b1}:null;}})[_0x3bca('0x24')](respondWithResult(_0x52f321,null))['catch'](handleError(_0x52f321,null));};exports[_0x3bca('0x4e')]=function(_0x2ef92b,_0xdada8b,_0x582a02){if(_0x2ef92b['body']['id']){delete _0x2ef92b[_0x3bca('0x49')]['id'];}return db[_0x3bca('0x29')]['findOne']({'where':{'id':_0x2ef92b[_0x3bca('0x46')]['id']}})['then'](handleEntityNotFound(_0xdada8b,null))[_0x3bca('0x24')](function(_0x30c599){if(_0x30c599){_0x2ef92b['body'][_0x3bca('0x4f')]=_0x30c599['id'];_0x2ef92b[_0x3bca('0x49')][_0x3bca('0x50')]=integrations['getSubjects'](_0x2ef92b['body'][_0x3bca('0x51')],_0x2ef92b['body'][_0x3bca('0x2b')]);_0x2ef92b['body'][_0x3bca('0x52')]=integrations[_0x3bca('0x53')](_0x2ef92b[_0x3bca('0x49')][_0x3bca('0x51')],_0x2ef92b[_0x3bca('0x49')]['type']);return db['FreshsalesConfiguration'][_0x3bca('0x48')](_0x2ef92b['body'],{'include':[{'model':db[_0x3bca('0x54')],'as':_0x3bca('0x50')},{'model':db[_0x3bca('0x54')],'as':_0x3bca('0x52')}]});}return null;})[_0x3bca('0x24')](respondWithResult(_0xdada8b,null))[_0x3bca('0x44')](handleError(_0xdada8b,null));};exports['getFields']=function(_0x313183,_0x80f7a2,_0x2b9921){var _0x57acac='';var _0x2c9cc3='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x313183[_0x3bca('0x46')]['id']},'attributes':['id','username','remoteUri',_0x3bca('0x55')]})[_0x3bca('0x24')](handleEntityNotFound(_0x80f7a2,null))[_0x3bca('0x24')](function(_0x350aca){if(_0x350aca){_0x2c9cc3=_0x350aca['username'];_0x57acac=_0x350aca[_0x3bca('0x56')];var _0x318198=_0x350aca[_0x3bca('0x56')][_0x3bca('0x57')](-0x1);if(_0x318198==='/'){_0x57acac=_0x57acac[_0x3bca('0x58')](0x0,_0x57acac[_0x3bca('0x59')](_0x318198));}return rp({'method':'GET','uri':util[_0x3bca('0x5a')]('%s%s',_0x57acac,_0x3bca('0x5b')),'headers':{'Authorization':_0x3bca('0x5c')+_0x350aca[_0x3bca('0x55')]},'json':!![]});}})[_0x3bca('0x24')](function(_0x4ad409){if(_0x4ad409){var _0x3378be=_0x4ad409[_0x3bca('0x5d')];var _0x438f15=![];var _0x2bad02=null;for(_0x2bad02=0x0;_0x2bad02<_0x3378be[_0x3bca('0x35')];_0x2bad02++){if(_0x3378be[_0x2bad02]['email']===_0x2c9cc3){_0x438f15=!![];}}if(_0x438f15){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x3bca('0x5e')});}}})[_0x3bca('0x24')](respondWithResult(_0x80f7a2,null))['catch'](function(_0x31fc9f){var _0x3933fa=_0x313183[_0x3bca('0x2f')]['test']?0x1f4:_0x31fc9f[_0x3bca('0x5f')]||0x1f4;logger[_0x3bca('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x3bca('0x60'),_0x3933fa,JSON[_0x3bca('0x61')](_0x31fc9f));delete _0x31fc9f[_0x3bca('0x28')];if(_0x3933fa===0x191){_0x3933fa=0x190;}_0x80f7a2[_0x3bca('0x18')](_0x3933fa)['send'](_0x313183['query'][_0x3bca('0x62')]?{'message':_0x3bca('0x63'),'statusCode':_0x31fc9f[_0x3bca('0x5f')]}:_0x31fc9f);});};
\ No newline at end of file
+var _0x9da8=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','error','name','send','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','create','body','destroy','find','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','format','/api/selector/owners','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x9da8,0x110));var _0x89da=function(_0x184a51,_0x1fa811){_0x184a51=_0x184a51-0x0;var _0x383eca=_0x9da8[_0x184a51];return _0x383eca;};'use strict';var emlformat=require(_0x89da('0x0'));var rimraf=require(_0x89da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x89da('0x2'));var rp=require('request-promise');var moment=require(_0x89da('0x3'));var BPromise=require(_0x89da('0x4'));var Mustache=require(_0x89da('0x5'));var util=require(_0x89da('0x6'));var path=require(_0x89da('0x7'));var sox=require(_0x89da('0x8'));var csv=require(_0x89da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x89da('0xa'));var _=require(_0x89da('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x89da('0xc'));var deskjs=require(_0x89da('0xd'));var toCsv=require(_0x89da('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x89da('0xe'));var authService=require(_0x89da('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89da('0x10'));var logger=require(_0x89da('0x11'))(_0x89da('0x12'));var utils=require(_0x89da('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x89da('0x14'));var db=require(_0x89da('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x153e96,_0x2c9e43){_0x2c9e43=_0x2c9e43||0xcc;return function(_0x1b8600){if(_0x1b8600){return _0x153e96[_0x89da('0x16')](_0x2c9e43);}return _0x153e96[_0x89da('0x17')](_0x2c9e43)[_0x89da('0x18')]();};}function respondWithResult(_0xe7e5af,_0x155477){_0x155477=_0x155477||0xc8;return function(_0x2c5adc){if(_0x2c5adc){return _0xe7e5af[_0x89da('0x17')](_0x155477)[_0x89da('0x19')](_0x2c5adc);}};}function respondWithFilteredResult(_0x428ef5,_0x50e6ab){return function(_0x3fd7c7){if(_0x3fd7c7){var _0x16ad83=typeof _0x50e6ab[_0x89da('0x1a')]===_0x89da('0x1b')&&typeof _0x50e6ab['limit']===_0x89da('0x1b');var _0x1f9225=_0x3fd7c7[_0x89da('0x1c')];var _0x445db3=_0x16ad83?0x0:_0x50e6ab[_0x89da('0x1a')];var _0x4738ae=_0x16ad83?_0x3fd7c7[_0x89da('0x1c')]:_0x50e6ab[_0x89da('0x1a')]+_0x50e6ab[_0x89da('0x1d')];var _0x2ae201;if(_0x4738ae>=_0x1f9225){_0x4738ae=_0x1f9225;_0x2ae201=0xc8;}else{_0x2ae201=0xce;}_0x428ef5[_0x89da('0x17')](_0x2ae201);return _0x428ef5[_0x89da('0x1e')]('Content-Range',_0x445db3+'-'+_0x4738ae+'/'+_0x1f9225)[_0x89da('0x19')](_0x3fd7c7);}return null;};}function patchUpdates(_0x1f4cc7){return function(_0x23587a){try{jsonpatch[_0x89da('0x1f')](_0x23587a,_0x1f4cc7,!![]);}catch(_0x31816a){return BPromise[_0x89da('0x20')](_0x31816a);}return _0x23587a['save']();};}function saveUpdates(_0x4b0433,_0xa42258){return function(_0x621adc){if(_0x621adc){return _0x621adc[_0x89da('0x21')](_0x4b0433)[_0x89da('0x22')](function(_0x5909d5){return _0x5909d5;});}return null;};}function removeEntity(_0x48fd61,_0x3c5f91){return function(_0x30ec0c){if(_0x30ec0c){return _0x30ec0c['destroy']()[_0x89da('0x22')](function(){_0x48fd61[_0x89da('0x17')](0xcc)[_0x89da('0x18')]();});}};}function handleEntityNotFound(_0x4f8f67,_0x193771){return function(_0xfcc0e3){if(!_0xfcc0e3){_0x4f8f67[_0x89da('0x16')](0x194);}return _0xfcc0e3;};}function handleError(_0x4f1570,_0x5f3452){_0x5f3452=_0x5f3452||0x1f4;return function(_0xa6a256){logger[_0x89da('0x23')](_0xa6a256['stack']);if(_0xa6a256[_0x89da('0x24')]){delete _0xa6a256[_0x89da('0x24')];}_0x4f1570[_0x89da('0x17')](_0x5f3452)[_0x89da('0x25')](_0xa6a256);};}exports['index']=function(_0x1be2e1,_0x27c731){var _0x5c0b49={},_0x5848bb={},_0x2e6c4b={'count':0x0,'rows':[]};var _0x2a4cfd=_[_0x89da('0x26')](db[_0x89da('0x27')][_0x89da('0x28')],function(_0x415fdb){return{'name':_0x415fdb[_0x89da('0x29')],'type':_0x415fdb[_0x89da('0x2a')][_0x89da('0x2b')]};});_0x5848bb[_0x89da('0x2c')]=_[_0x89da('0x26')](_0x2a4cfd,_0x89da('0x24'));_0x5848bb['query']=_[_0x89da('0x2d')](_0x1be2e1[_0x89da('0x2e')]);_0x5848bb['filters']=_[_0x89da('0x2f')](_0x5848bb[_0x89da('0x2c')],_0x5848bb[_0x89da('0x2e')]);_0x5c0b49[_0x89da('0x30')]=_[_0x89da('0x2f')](_0x5848bb[_0x89da('0x2c')],qs[_0x89da('0x31')](_0x1be2e1[_0x89da('0x2e')][_0x89da('0x31')]));_0x5c0b49[_0x89da('0x30')]=_0x5c0b49[_0x89da('0x30')][_0x89da('0x32')]?_0x5c0b49[_0x89da('0x30')]:_0x5848bb[_0x89da('0x2c')];if(!_0x1be2e1[_0x89da('0x2e')][_0x89da('0x33')](_0x89da('0x34'))){_0x5c0b49[_0x89da('0x1d')]=qs[_0x89da('0x1d')](_0x1be2e1[_0x89da('0x2e')][_0x89da('0x1d')]);_0x5c0b49['offset']=qs['offset'](_0x1be2e1[_0x89da('0x2e')][_0x89da('0x1a')]);}_0x5c0b49[_0x89da('0x35')]=qs['sort'](_0x1be2e1[_0x89da('0x2e')][_0x89da('0x36')]);_0x5c0b49[_0x89da('0x37')]=qs[_0x89da('0x38')](_[_0x89da('0x39')](_0x1be2e1[_0x89da('0x2e')],_0x5848bb[_0x89da('0x38')]),_0x2a4cfd);if(_0x1be2e1[_0x89da('0x2e')][_0x89da('0x3a')]){_0x5c0b49[_0x89da('0x37')]=_[_0x89da('0x3b')](_0x5c0b49[_0x89da('0x37')],{'$or':_[_0x89da('0x26')](_0x2a4cfd,function(_0xebbe3a){if(_0xebbe3a[_0x89da('0x2a')]!=='VIRTUAL'){var _0x4d3b48={};_0x4d3b48[_0xebbe3a[_0x89da('0x24')]]={'$like':'%'+_0x1be2e1[_0x89da('0x2e')][_0x89da('0x3a')]+'%'};return _0x4d3b48;}})});}_0x5c0b49=_[_0x89da('0x3b')]({},_0x5c0b49,_0x1be2e1[_0x89da('0x3c')]);var _0x45918b={'where':_0x5c0b49['where']};return db[_0x89da('0x27')][_0x89da('0x1c')](_0x45918b)['then'](function(_0x2b54c1){_0x2e6c4b[_0x89da('0x1c')]=_0x2b54c1;if(_0x1be2e1[_0x89da('0x2e')][_0x89da('0x3d')]){_0x5c0b49['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x89da('0x3e')](_0x5c0b49);})[_0x89da('0x22')](function(_0x4eb703){_0x2e6c4b[_0x89da('0x3f')]=_0x4eb703;return _0x2e6c4b;})[_0x89da('0x22')](respondWithFilteredResult(_0x27c731,_0x5c0b49))[_0x89da('0x40')](handleError(_0x27c731,null));};exports[_0x89da('0x41')]=function(_0x187d12,_0x4b6d68){var _0x531178={'raw':![],'where':{'id':_0x187d12[_0x89da('0x42')]['id']}},_0x1cc916={};_0x1cc916[_0x89da('0x2c')]=_[_0x89da('0x2d')](db['FreshsalesAccount'][_0x89da('0x28')]);_0x1cc916[_0x89da('0x2e')]=_[_0x89da('0x2d')](_0x187d12[_0x89da('0x2e')]);_0x1cc916['filters']=_[_0x89da('0x2f')](_0x1cc916[_0x89da('0x2c')],_0x1cc916[_0x89da('0x2e')]);_0x531178[_0x89da('0x30')]=_[_0x89da('0x2f')](_0x1cc916[_0x89da('0x2c')],qs[_0x89da('0x31')](_0x187d12[_0x89da('0x2e')][_0x89da('0x31')]));_0x531178['attributes']=_0x531178[_0x89da('0x30')][_0x89da('0x32')]?_0x531178['attributes']:_0x1cc916[_0x89da('0x2c')];if(_0x187d12['query'][_0x89da('0x3d')]){_0x531178['include']=[{'all':!![]}];}_0x531178=_[_0x89da('0x3b')]({},_0x531178,_0x187d12[_0x89da('0x3c')]);return db[_0x89da('0x27')]['find'](_0x531178)[_0x89da('0x22')](handleEntityNotFound(_0x4b6d68,null))[_0x89da('0x22')](respondWithResult(_0x4b6d68,null))[_0x89da('0x40')](handleError(_0x4b6d68,null));};exports[_0x89da('0x43')]=function(_0x255c4d,_0x2910c9){return db[_0x89da('0x27')]['create'](_0x255c4d[_0x89da('0x44')],{})[_0x89da('0x22')](respondWithResult(_0x2910c9,0xc9))[_0x89da('0x40')](handleError(_0x2910c9,null));};exports[_0x89da('0x21')]=function(_0x9072ae,_0x4f7db0){if(_0x9072ae[_0x89da('0x44')]['id']){delete _0x9072ae[_0x89da('0x44')]['id'];}return db[_0x89da('0x27')]['find']({'where':{'id':_0x9072ae[_0x89da('0x42')]['id']}})[_0x89da('0x22')](handleEntityNotFound(_0x4f7db0,null))['then'](saveUpdates(_0x9072ae['body'],null))[_0x89da('0x22')](respondWithResult(_0x4f7db0,null))[_0x89da('0x40')](handleError(_0x4f7db0,null));};exports[_0x89da('0x45')]=function(_0x5d6f5c,_0xdd348a){return db['FreshsalesAccount'][_0x89da('0x46')]({'where':{'id':_0x5d6f5c[_0x89da('0x42')]['id']}})[_0x89da('0x22')](handleEntityNotFound(_0xdd348a,null))['then'](removeEntity(_0xdd348a,null))[_0x89da('0x40')](handleError(_0xdd348a,null));};exports[_0x89da('0x47')]=function(_0x5be10a,_0x15f80e,_0x3927c8){var _0x40a327={};var _0x576188={};var _0x3709a2;var _0x27c8d9;return db[_0x89da('0x27')][_0x89da('0x48')]({'where':{'id':_0x5be10a[_0x89da('0x42')]['id']}})['then'](handleEntityNotFound(_0x15f80e,null))['then'](function(_0x3a7510){if(_0x3a7510){_0x3709a2=_0x3a7510;_0x576188[_0x89da('0x2c')]=_[_0x89da('0x2d')](db[_0x89da('0x49')]['rawAttributes']);_0x576188[_0x89da('0x2e')]=_[_0x89da('0x2d')](_0x5be10a[_0x89da('0x2e')]);_0x576188['filters']=_[_0x89da('0x2f')](_0x576188[_0x89da('0x2c')],_0x576188[_0x89da('0x2e')]);_0x40a327[_0x89da('0x30')]=_[_0x89da('0x2f')](_0x576188[_0x89da('0x2c')],qs['fields'](_0x5be10a[_0x89da('0x2e')]['fields']));_0x40a327['attributes']=_0x40a327[_0x89da('0x30')][_0x89da('0x32')]?_0x40a327[_0x89da('0x30')]:_0x576188[_0x89da('0x2c')];_0x40a327[_0x89da('0x35')]=qs['sort'](_0x5be10a[_0x89da('0x2e')][_0x89da('0x36')]);_0x40a327[_0x89da('0x37')]=qs[_0x89da('0x38')](_['pick'](_0x5be10a['query'],_0x576188[_0x89da('0x38')]));if(_0x5be10a['query'][_0x89da('0x3a')]){_0x40a327[_0x89da('0x37')]=_[_0x89da('0x3b')](_0x40a327[_0x89da('0x37')],{'$or':_['map'](_0x40a327[_0x89da('0x30')],function(_0x46cbf4){var _0x1e5717={};_0x1e5717[_0x46cbf4]={'$like':'%'+_0x5be10a[_0x89da('0x2e')][_0x89da('0x3a')]+'%'};return _0x1e5717;})});}_0x40a327=_['merge']({},_0x40a327,_0x5be10a[_0x89da('0x3c')]);return _0x3709a2[_0x89da('0x47')](_0x40a327);}})['then'](function(_0x345ad7){if(_0x345ad7){_0x27c8d9=_0x345ad7['length'];if(!_0x5be10a[_0x89da('0x2e')][_0x89da('0x33')](_0x89da('0x34'))){_0x40a327['limit']=qs['limit'](_0x5be10a[_0x89da('0x2e')]['limit']);_0x40a327[_0x89da('0x1a')]=qs[_0x89da('0x1a')](_0x5be10a[_0x89da('0x2e')][_0x89da('0x1a')]);}return _0x3709a2[_0x89da('0x47')](_0x40a327);}})[_0x89da('0x22')](function(_0x227fb3){if(_0x227fb3){return _0x227fb3?{'count':_0x27c8d9,'rows':_0x227fb3}:null;}})[_0x89da('0x22')](respondWithResult(_0x15f80e,null))[_0x89da('0x40')](handleError(_0x15f80e,null));};exports[_0x89da('0x4a')]=function(_0x592c88,_0x554fc5,_0x13c4f5){if(_0x592c88[_0x89da('0x44')]['id']){delete _0x592c88['body']['id'];}return db['FreshsalesAccount'][_0x89da('0x48')]({'where':{'id':_0x592c88[_0x89da('0x42')]['id']}})[_0x89da('0x22')](handleEntityNotFound(_0x554fc5,null))[_0x89da('0x22')](function(_0x560574){if(_0x560574){_0x592c88['body'][_0x89da('0x4b')]=_0x560574['id'];_0x592c88[_0x89da('0x44')][_0x89da('0x4c')]=integrations['getSubjects'](_0x592c88['body'][_0x89da('0x4d')],_0x592c88[_0x89da('0x44')][_0x89da('0x2a')]);_0x592c88[_0x89da('0x44')][_0x89da('0x4e')]=integrations[_0x89da('0x4f')](_0x592c88[_0x89da('0x44')]['channel'],_0x592c88['body'][_0x89da('0x2a')]);return db[_0x89da('0x49')][_0x89da('0x43')](_0x592c88[_0x89da('0x44')],{'include':[{'model':db[_0x89da('0x50')],'as':_0x89da('0x4c')},{'model':db[_0x89da('0x50')],'as':_0x89da('0x4e')}]});}return null;})[_0x89da('0x22')](respondWithResult(_0x554fc5,null))[_0x89da('0x40')](handleError(_0x554fc5,null));};exports[_0x89da('0x51')]=function(_0x1b00d4,_0x33184d,_0x19136d){var _0x34e1ef='';var _0x2c08e0='';return db[_0x89da('0x27')][_0x89da('0x48')]({'where':{'id':_0x1b00d4[_0x89da('0x42')]['id']},'attributes':['id',_0x89da('0x52'),_0x89da('0x53'),_0x89da('0x54')]})[_0x89da('0x22')](handleEntityNotFound(_0x33184d,null))[_0x89da('0x22')](function(_0xfb3024){if(_0xfb3024){_0x2c08e0=_0xfb3024['username'];_0x34e1ef=_0xfb3024[_0x89da('0x53')];var _0x304e08=_0xfb3024[_0x89da('0x53')][_0x89da('0x55')](-0x1);if(_0x304e08==='/'){_0x34e1ef=_0x34e1ef[_0x89da('0x56')](0x0,_0x34e1ef['lastIndexOf'](_0x304e08));}return rp({'method':'GET','uri':util[_0x89da('0x57')]('%s%s',_0x34e1ef,_0x89da('0x58')),'headers':{'Authorization':'Token\x20token='+_0xfb3024[_0x89da('0x54')]},'json':!![]});}})[_0x89da('0x22')](function(_0x4f6023){if(_0x4f6023){var _0x1a97f8=_0x4f6023[_0x89da('0x59')];var _0x395b3b=![];var _0x44b8cf=null;for(_0x44b8cf=0x0;_0x44b8cf<_0x1a97f8[_0x89da('0x32')];_0x44b8cf++){if(_0x1a97f8[_0x44b8cf][_0x89da('0x5a')]===_0x2c08e0){_0x395b3b=!![];}}if(_0x395b3b){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x89da('0x22')](respondWithResult(_0x33184d,null))[_0x89da('0x40')](function(_0x238f06){var _0x3c7b3c=_0x1b00d4[_0x89da('0x2e')][_0x89da('0x5b')]?0x1f4:_0x238f06[_0x89da('0x5c')]||0x1f4;logger['error'](_0x89da('0x5d'),_0x89da('0x51'),_0x3c7b3c,JSON[_0x89da('0x5e')](_0x238f06));delete _0x238f06[_0x89da('0x24')];if(_0x3c7b3c===0x191){_0x3c7b3c=0x190;}_0x33184d[_0x89da('0x17')](_0x3c7b3c)['send'](_0x1b00d4[_0x89da('0x2e')][_0x89da('0x5b')]?{'message':_0x89da('0x5f'),'statusCode':_0x238f06[_0x89da('0x5c')]}:_0x238f06);});};
\ No newline at end of file
index 8775373..b5a8480 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafb9=['moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x455d30,_0x5b6a21){var _0x504b56=function(_0x2c5fd9){while(--_0x2c5fd9){_0x455d30['push'](_0x455d30['shift']());}};_0x504b56(++_0x5b6a21);}(_0xafb9,0x68));var _0x9afb=function(_0x82d37e,_0x1fbd2b){_0x82d37e=_0x82d37e-0x0;var _0x5c0a5b=_0xafb9[_0x82d37e];return _0x5c0a5b;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var logger=require(_0x9afb('0x2'))(_0x9afb('0x3'));var moment=require(_0x9afb('0x4'));var BPromise=require(_0x9afb('0x5'));var rp=require(_0x9afb('0x6'));var fs=require('fs');var path=require(_0x9afb('0x7'));var rimraf=require(_0x9afb('0x8'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x9afb('0x9'));module['exports']=function(_0x1ccf93,_0x548b24){return _0x1ccf93['define'](_0x9afb('0xa'),attributes,{'tableName':_0x9afb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0120=['../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2cceee,_0x37737c){var _0x40daa5=function(_0x92b0f7){while(--_0x92b0f7){_0x2cceee['push'](_0x2cceee['shift']());}};_0x40daa5(++_0x37737c);}(_0x0120,0x6f));var _0x0012=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x0120[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));var integrations=require(_0x0012('0xb'));module['exports']=function(_0x4b396c,_0x59980a){return _0x4b396c[_0x0012('0xc')](_0x0012('0xd'),attributes,{'tableName':_0x0012('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8e31e13..9bcafef 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(_0x161cdb,_0x30dc13){var _0x4f51f8=function(_0x25eb42){while(--_0x25eb42){_0x161cdb['push'](_0x161cdb['shift']());}};_0x4f51f8(++_0x30dc13);}(_0xdb28,0x106));var _0x8db2=function(_0x5cba13,_0x117521){_0x5cba13=_0x5cba13-0x0;var _0x4e3572=_0xdb28[_0x5cba13];return _0x4e3572;};'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 _0x9582=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','FreshsalesAccount','options','raw','limit','include','map','model','attributes','then','GetFreshsalesAccount','ShowFreshsalesAccount','find'];(function(_0xc10c6b,_0x55236f){var _0x11a7f0=function(_0x154815){while(--_0x154815){_0xc10c6b['push'](_0xc10c6b['shift']());}};_0x11a7f0(++_0x55236f);}(_0x9582,0x95));var _0x2958=function(_0x511cb6,_0x40cdf4){_0x511cb6=_0x511cb6-0x0;var _0x429edd=_0x9582[_0x511cb6];return _0x429edd;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});}exports['GetFreshsalesAccount']=function(_0x28a92c){var _0x160949=this;return new Promise(function(_0x310d07,_0x42bb99){return db[_0x2958('0x18')]['findAll']({'raw':_0x28a92c[_0x2958('0x19')]?_0x28a92c[_0x2958('0x19')][_0x2958('0x1a')]===undefined?!![]:![]:!![],'where':_0x28a92c['options']?_0x28a92c[_0x2958('0x19')]['where']||null:null,'attributes':_0x28a92c[_0x2958('0x19')]?_0x28a92c['options']['attributes']||null:null,'limit':_0x28a92c[_0x2958('0x19')]?_0x28a92c[_0x2958('0x19')][_0x2958('0x1b')]||null:null,'include':_0x28a92c[_0x2958('0x19')]?_0x28a92c[_0x2958('0x19')][_0x2958('0x1c')]?_[_0x2958('0x1d')](_0x28a92c[_0x2958('0x19')][_0x2958('0x1c')],function(_0x2aa514){return{'model':db[_0x2aa514[_0x2958('0x1e')]],'as':_0x2aa514['as'],'attributes':_0x2aa514[_0x2958('0x1f')],'include':_0x2aa514[_0x2958('0x1c')]?_[_0x2958('0x1d')](_0x2aa514[_0x2958('0x1c')],function(_0x4f811a){return{'model':db[_0x4f811a['model']],'as':_0x4f811a['as'],'attributes':_0x4f811a[_0x2958('0x1f')],'include':_0x4f811a[_0x2958('0x1c')]?_[_0x2958('0x1d')](_0x4f811a[_0x2958('0x1c')],function(_0x52bd32){return{'model':db[_0x52bd32[_0x2958('0x1e')]],'as':_0x52bd32['as'],'attributes':_0x52bd32['attributes']};}):[]};}):[]};}):[]:[]})[_0x2958('0x20')](function(_0x40adce){logger[_0x2958('0x16')](_0x2958('0x21'),_0x28a92c);logger[_0x2958('0xf')](_0x2958('0x21'),_0x28a92c,JSON[_0x2958('0x12')](_0x40adce));_0x310d07(_0x40adce);})['catch'](function(_0x21b919){logger['error']('GetFreshsalesAccount',_0x21b919[_0x2958('0x15')],_0x28a92c);_0x42bb99(_0x160949[_0x2958('0x13')](0x1f4,_0x21b919[_0x2958('0x15')]));});});};exports[_0x2958('0x22')]=function(_0x584179){var _0x2d9472=this;return new Promise(function(_0x222b83,_0x2c73e9){return db['FreshsalesAccount'][_0x2958('0x23')]({'raw':_0x584179[_0x2958('0x19')]?_0x584179['options'][_0x2958('0x1a')]===undefined?!![]:![]:!![],'where':_0x584179['options']?_0x584179[_0x2958('0x19')]['where']||null:null,'attributes':_0x584179[_0x2958('0x19')]?_0x584179['options'][_0x2958('0x1f')]||null:null,'include':_0x584179[_0x2958('0x19')]?_0x584179[_0x2958('0x19')][_0x2958('0x1c')]?_[_0x2958('0x1d')](_0x584179[_0x2958('0x19')][_0x2958('0x1c')],function(_0x58f9b4){return{'model':db[_0x58f9b4[_0x2958('0x1e')]],'as':_0x58f9b4['as'],'attributes':_0x58f9b4['attributes'],'include':_0x58f9b4[_0x2958('0x1c')]?_['map'](_0x58f9b4[_0x2958('0x1c')],function(_0x517f55){return{'model':db[_0x517f55[_0x2958('0x1e')]],'as':_0x517f55['as'],'attributes':_0x517f55[_0x2958('0x1f')],'include':_0x517f55[_0x2958('0x1c')]?_[_0x2958('0x1d')](_0x517f55[_0x2958('0x1c')],function(_0x24aca5){return{'model':db[_0x24aca5[_0x2958('0x1e')]],'as':_0x24aca5['as'],'attributes':_0x24aca5[_0x2958('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2958('0x20')](function(_0xc4a303){logger[_0x2958('0x16')](_0x2958('0x22'),_0x584179);logger[_0x2958('0xf')]('ShowFreshsalesAccount',_0x584179,JSON[_0x2958('0x12')](_0xc4a303));_0x222b83(_0xc4a303);})[_0x2958('0x24')](function(_0x281817){logger[_0x2958('0x13')]('ShowFreshsalesAccount',_0x281817[_0x2958('0x15')],_0x584179);_0x2c73e9(_0x2d9472[_0x2958('0x13')](0x1f4,_0x281817[_0x2958('0x15')]));});});};
\ No newline at end of file
index a8ee92d..55ede0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bf9=['/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2bf9,0x15c));var _0x92bf=function(_0x12a020,_0x85b476){_0x12a020=_0x12a020-0x0;var _0x63cddd=_0x2bf9[_0x12a020];return _0x63cddd;};'use strict';var multer=require(_0x92bf('0x0'));var util=require('util');var path=require(_0x92bf('0x1'));var timeout=require('connect-timeout');var express=require(_0x92bf('0x2'));var router=express[_0x92bf('0x3')]();var fs_extra=require(_0x92bf('0x4'));var auth=require(_0x92bf('0x5'));var interaction=require(_0x92bf('0x6'));var config=require(_0x92bf('0x7'));var controller=require(_0x92bf('0x8'));router[_0x92bf('0x9')]('/',auth[_0x92bf('0xa')](),controller[_0x92bf('0xb')]);router[_0x92bf('0x9')](_0x92bf('0xc'),auth[_0x92bf('0xa')](),controller[_0x92bf('0xd')]);router['get'](_0x92bf('0xe'),auth[_0x92bf('0xa')](),controller['getSubjects']);router[_0x92bf('0x9')](_0x92bf('0xf'),auth[_0x92bf('0xa')](),controller[_0x92bf('0x10')]);router[_0x92bf('0x9')](_0x92bf('0x11'),auth[_0x92bf('0xa')](),controller['getFields']);router[_0x92bf('0x12')]('/',auth[_0x92bf('0xa')](),controller[_0x92bf('0x13')]);router['put'](_0x92bf('0xc'),auth[_0x92bf('0xa')](),controller[_0x92bf('0x14')]);router[_0x92bf('0x15')](_0x92bf('0xc'),auth[_0x92bf('0xa')](),controller[_0x92bf('0x16')]);module[_0x92bf('0x17')]=router;
\ No newline at end of file
+var _0xbd69=['get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller'];(function(_0x4c5a24,_0x5ef60c){var _0x4b067e=function(_0x33c0da){while(--_0x33c0da){_0x4c5a24['push'](_0x4c5a24['shift']());}};_0x4b067e(++_0x5ef60c);}(_0xbd69,0xf2));var _0x9bd6=function(_0x2d27b8,_0x15cb8e){_0x2d27b8=_0x2d27b8-0x0;var _0x8c02be=_0xbd69[_0x2d27b8];return _0x8c02be;};'use strict';var multer=require('multer');var util=require(_0x9bd6('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9bd6('0x1'));var router=express[_0x9bd6('0x2')]();var fs_extra=require(_0x9bd6('0x3'));var auth=require(_0x9bd6('0x4'));var interaction=require(_0x9bd6('0x5'));var config=require(_0x9bd6('0x6'));var controller=require(_0x9bd6('0x7'));router[_0x9bd6('0x8')]('/',auth[_0x9bd6('0x9')](),controller[_0x9bd6('0xa')]);router[_0x9bd6('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x9bd6('0xb')]);router[_0x9bd6('0x8')](_0x9bd6('0xc'),auth['isAuthenticated'](),controller[_0x9bd6('0xd')]);router['get'](_0x9bd6('0xe'),auth[_0x9bd6('0x9')](),controller[_0x9bd6('0xf')]);router[_0x9bd6('0x8')](_0x9bd6('0x10'),auth['isAuthenticated'](),controller[_0x9bd6('0x11')]);router[_0x9bd6('0x12')]('/',auth['isAuthenticated'](),controller[_0x9bd6('0x13')]);router[_0x9bd6('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x9bd6('0x15')]);router[_0x9bd6('0x16')]('/:id',auth[_0x9bd6('0x9')](),controller[_0x9bd6('0x17')]);module[_0x9bd6('0x18')]=router;
\ No newline at end of file
index 0417608..60696d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x958f=['STRING','sequelize','exports'];(function(_0x2ee665,_0x577a1c){var _0x2f89f6=function(_0x1c1fcc){while(--_0x1c1fcc){_0x2ee665['push'](_0x2ee665['shift']());}};_0x2f89f6(++_0x577a1c);}(_0x958f,0x1de));var _0xf958=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x958f[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0xf958('0x0'));module[_0xf958('0x1')]={'name':{'type':Sequelize[_0xf958('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb69b=['sequelize','STRING'];(function(_0x58a5e7,_0x36717e){var _0x39626a=function(_0x14ae95){while(--_0x14ae95){_0x58a5e7['push'](_0x58a5e7['shift']());}};_0x39626a(++_0x36717e);}(_0xb69b,0x86));var _0xbb69=function(_0x4a74b0,_0x38b257){_0x4a74b0=_0x4a74b0-0x0;var _0x16187f=_0xb69b[_0x4a74b0];return _0x16187f;};'use strict';var Sequelize=require(_0xbb69('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbb69('0x1')]}};
\ No newline at end of file
index a545d2e..3fece06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1201=['order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','find','body','params','findOne','FreshsalesField','getSubjects','getDescriptions','getFields','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','index','map','FreshsalesConfiguration','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x47bb74,_0x18327d){var _0x20d466=function(_0x515969){while(--_0x515969){_0x47bb74['push'](_0x47bb74['shift']());}};_0x20d466(++_0x18327d);}(_0x1201,0x188));var _0x1120=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0x1201[_0x27bcf5];return _0x4ce4cf;};'use strict';var emlformat=require(_0x1120('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1120('0x1'));var rp=require(_0x1120('0x2'));var moment=require(_0x1120('0x3'));var BPromise=require(_0x1120('0x4'));var Mustache=require(_0x1120('0x5'));var util=require(_0x1120('0x6'));var path=require('path');var sox=require(_0x1120('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1120('0x8'));var squel=require(_0x1120('0x9'));var crypto=require(_0x1120('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1120('0xb'));var toCsv=require(_0x1120('0xc'));var querystring=require(_0x1120('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1120('0xe'));var qs=require(_0x1120('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1120('0x10'));var logger=require(_0x1120('0x11'))('api');var utils=require(_0x1120('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1120('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b1cc1,_0x215511){_0x215511=_0x215511||0xcc;return function(_0x35c02b){if(_0x35c02b){return _0x2b1cc1['sendStatus'](_0x215511);}return _0x2b1cc1[_0x1120('0x14')](_0x215511)[_0x1120('0x15')]();};}function respondWithResult(_0x493f30,_0x57527b){_0x57527b=_0x57527b||0xc8;return function(_0x450e39){if(_0x450e39){return _0x493f30[_0x1120('0x14')](_0x57527b)[_0x1120('0x16')](_0x450e39);}};}function respondWithFilteredResult(_0x182dda,_0x56b4dd){return function(_0x3c7ee7){if(_0x3c7ee7){var _0x517ea2=typeof _0x56b4dd['offset']===_0x1120('0x17')&&typeof _0x56b4dd[_0x1120('0x18')]==='undefined';var _0x498a31=_0x3c7ee7['count'];var _0x79d062=_0x517ea2?0x0:_0x56b4dd[_0x1120('0x19')];var _0xa86b7=_0x517ea2?_0x3c7ee7[_0x1120('0x1a')]:_0x56b4dd[_0x1120('0x19')]+_0x56b4dd[_0x1120('0x18')];var _0x1c366c;if(_0xa86b7>=_0x498a31){_0xa86b7=_0x498a31;_0x1c366c=0xc8;}else{_0x1c366c=0xce;}_0x182dda[_0x1120('0x14')](_0x1c366c);return _0x182dda[_0x1120('0x1b')](_0x1120('0x1c'),_0x79d062+'-'+_0xa86b7+'/'+_0x498a31)[_0x1120('0x16')](_0x3c7ee7);}return null;};}function patchUpdates(_0x353427){return function(_0x33fc9f){try{jsonpatch[_0x1120('0x1d')](_0x33fc9f,_0x353427,!![]);}catch(_0x1df7d5){return BPromise['reject'](_0x1df7d5);}return _0x33fc9f[_0x1120('0x1e')]();};}function saveUpdates(_0x1e19dc,_0x2cbd9c){return function(_0x11a21a){if(_0x11a21a){return _0x11a21a[_0x1120('0x1f')](_0x1e19dc)[_0x1120('0x20')](function(_0x2bf370){return _0x2bf370;});}return null;};}function removeEntity(_0x34361a,_0x57bd65){return function(_0x71b475){if(_0x71b475){return _0x71b475[_0x1120('0x21')]()[_0x1120('0x20')](function(){_0x34361a[_0x1120('0x14')](0xcc)[_0x1120('0x15')]();});}};}function handleEntityNotFound(_0x2e1a2a,_0x16d454){return function(_0x2ce19d){if(!_0x2ce19d){_0x2e1a2a[_0x1120('0x22')](0x194);}return _0x2ce19d;};}function handleError(_0x5d598b,_0xc15584){_0xc15584=_0xc15584||0x1f4;return function(_0x338056){logger['error'](_0x338056[_0x1120('0x23')]);if(_0x338056[_0x1120('0x24')]){delete _0x338056[_0x1120('0x24')];}_0x5d598b[_0x1120('0x14')](_0xc15584)['send'](_0x338056);};}exports[_0x1120('0x25')]=function(_0x2a5d32,_0x4852a2){var _0x5a2f5c={},_0x45ebb0={},_0x48e6b2={'count':0x0,'rows':[]};var _0x5b0804=_[_0x1120('0x26')](db[_0x1120('0x27')]['rawAttributes'],function(_0x17145f){return{'name':_0x17145f[_0x1120('0x28')],'type':_0x17145f[_0x1120('0x29')]['key']};});_0x45ebb0['model']=_[_0x1120('0x26')](_0x5b0804,_0x1120('0x24'));_0x45ebb0[_0x1120('0x2a')]=_[_0x1120('0x2b')](_0x2a5d32[_0x1120('0x2a')]);_0x45ebb0[_0x1120('0x2c')]=_[_0x1120('0x2d')](_0x45ebb0[_0x1120('0x2e')],_0x45ebb0[_0x1120('0x2a')]);_0x5a2f5c[_0x1120('0x2f')]=_['intersection'](_0x45ebb0['model'],qs['fields'](_0x2a5d32[_0x1120('0x2a')][_0x1120('0x30')]));_0x5a2f5c[_0x1120('0x2f')]=_0x5a2f5c[_0x1120('0x2f')][_0x1120('0x31')]?_0x5a2f5c[_0x1120('0x2f')]:_0x45ebb0['model'];if(!_0x2a5d32['query'][_0x1120('0x32')](_0x1120('0x33'))){_0x5a2f5c['limit']=qs[_0x1120('0x18')](_0x2a5d32[_0x1120('0x2a')][_0x1120('0x18')]);_0x5a2f5c[_0x1120('0x19')]=qs[_0x1120('0x19')](_0x2a5d32[_0x1120('0x2a')]['offset']);}_0x5a2f5c[_0x1120('0x34')]=qs['sort'](_0x2a5d32[_0x1120('0x2a')][_0x1120('0x35')]);_0x5a2f5c[_0x1120('0x36')]=qs[_0x1120('0x2c')](_[_0x1120('0x37')](_0x2a5d32[_0x1120('0x2a')],_0x45ebb0[_0x1120('0x2c')]),_0x5b0804);if(_0x2a5d32[_0x1120('0x2a')][_0x1120('0x38')]){_0x5a2f5c['where']=_[_0x1120('0x39')](_0x5a2f5c['where'],{'$or':_[_0x1120('0x26')](_0x5b0804,function(_0x256869){if(_0x256869['type']!==_0x1120('0x3a')){var _0x485065={};_0x485065[_0x256869[_0x1120('0x24')]]={'$like':'%'+_0x2a5d32[_0x1120('0x2a')]['filter']+'%'};return _0x485065;}})});}_0x5a2f5c=_[_0x1120('0x39')]({},_0x5a2f5c,_0x2a5d32[_0x1120('0x3b')]);var _0x19130e={'where':_0x5a2f5c['where']};return db[_0x1120('0x27')][_0x1120('0x1a')](_0x19130e)[_0x1120('0x20')](function(_0x128cb5){_0x48e6b2[_0x1120('0x1a')]=_0x128cb5;if(_0x2a5d32[_0x1120('0x2a')]['includeAll']){_0x5a2f5c[_0x1120('0x3c')]=[{'all':!![]}];}return db[_0x1120('0x27')][_0x1120('0x3d')](_0x5a2f5c);})['then'](function(_0x53c0b5){_0x48e6b2[_0x1120('0x3e')]=_0x53c0b5;return _0x48e6b2;})[_0x1120('0x20')](respondWithFilteredResult(_0x4852a2,_0x5a2f5c))[_0x1120('0x3f')](handleError(_0x4852a2,null));};exports[_0x1120('0x40')]=function(_0x5aca4f,_0x10201b){var _0x20f44e={'raw':![],'where':{'id':_0x5aca4f['params']['id']}},_0x50b95e={};_0x50b95e[_0x1120('0x2e')]=_['keys'](db['FreshsalesConfiguration'][_0x1120('0x41')]);_0x50b95e[_0x1120('0x2a')]=_[_0x1120('0x2b')](_0x5aca4f[_0x1120('0x2a')]);_0x50b95e[_0x1120('0x2c')]=_['intersection'](_0x50b95e[_0x1120('0x2e')],_0x50b95e[_0x1120('0x2a')]);_0x20f44e[_0x1120('0x2f')]=_[_0x1120('0x2d')](_0x50b95e[_0x1120('0x2e')],qs[_0x1120('0x30')](_0x5aca4f[_0x1120('0x2a')]['fields']));_0x20f44e['attributes']=_0x20f44e[_0x1120('0x2f')]['length']?_0x20f44e[_0x1120('0x2f')]:_0x50b95e['model'];if(_0x5aca4f[_0x1120('0x2a')]['includeAll']){_0x20f44e['include']=[{'all':!![]}];}_0x20f44e=_[_0x1120('0x39')]({},_0x20f44e,_0x5aca4f[_0x1120('0x3b')]);return db[_0x1120('0x27')][_0x1120('0x42')](_0x20f44e)[_0x1120('0x20')](handleEntityNotFound(_0x10201b,null))['then'](respondWithResult(_0x10201b,null))[_0x1120('0x3f')](handleError(_0x10201b,null));};exports['create']=function(_0x4492fe,_0x4789f4){return db[_0x1120('0x27')]['create'](_0x4492fe[_0x1120('0x43')],{})[_0x1120('0x20')](respondWithResult(_0x4789f4,0xc9))[_0x1120('0x3f')](handleError(_0x4789f4,null));};exports[_0x1120('0x1f')]=function(_0x10398d,_0x578f17){if(_0x10398d['body']['id']){delete _0x10398d['body']['id'];}return db[_0x1120('0x27')]['find']({'where':{'id':_0x10398d['params']['id']}})[_0x1120('0x20')](handleEntityNotFound(_0x578f17,null))['then'](saveUpdates(_0x10398d['body'],null))[_0x1120('0x20')](respondWithResult(_0x578f17,null))['catch'](handleError(_0x578f17,null));};exports[_0x1120('0x21')]=function(_0x57e312,_0x5f082b){return db[_0x1120('0x27')][_0x1120('0x42')]({'where':{'id':_0x57e312[_0x1120('0x44')]['id']}})[_0x1120('0x20')](handleEntityNotFound(_0x5f082b,null))['then'](removeEntity(_0x5f082b,null))['catch'](handleError(_0x5f082b,null));};exports['getSubjects']=function(_0x1fdcd9,_0x227fd1,_0x2034f1){var _0x1b1b5c={};var _0x386556={};var _0x53c662;var _0x441add;return db[_0x1120('0x27')][_0x1120('0x45')]({'where':{'id':_0x1fdcd9[_0x1120('0x44')]['id']}})[_0x1120('0x20')](handleEntityNotFound(_0x227fd1,null))[_0x1120('0x20')](function(_0x24267c){if(_0x24267c){_0x53c662=_0x24267c;_0x386556['model']=_[_0x1120('0x2b')](db[_0x1120('0x46')]['rawAttributes']);_0x386556[_0x1120('0x2a')]=_[_0x1120('0x2b')](_0x1fdcd9['query']);_0x386556['filters']=_[_0x1120('0x2d')](_0x386556['model'],_0x386556[_0x1120('0x2a')]);_0x1b1b5c['attributes']=_[_0x1120('0x2d')](_0x386556[_0x1120('0x2e')],qs[_0x1120('0x30')](_0x1fdcd9[_0x1120('0x2a')]['fields']));_0x1b1b5c[_0x1120('0x2f')]=_0x1b1b5c[_0x1120('0x2f')]['length']?_0x1b1b5c['attributes']:_0x386556[_0x1120('0x2e')];_0x1b1b5c['order']=qs[_0x1120('0x35')](_0x1fdcd9['query'][_0x1120('0x35')]);_0x1b1b5c[_0x1120('0x36')]=qs[_0x1120('0x2c')](_[_0x1120('0x37')](_0x1fdcd9[_0x1120('0x2a')],_0x386556[_0x1120('0x2c')]));if(_0x1fdcd9[_0x1120('0x2a')][_0x1120('0x38')]){_0x1b1b5c[_0x1120('0x36')]=_['merge'](_0x1b1b5c['where'],{'$or':_[_0x1120('0x26')](_0x1b1b5c[_0x1120('0x2f')],function(_0x5d9715){var _0x4d75ed={};_0x4d75ed[_0x5d9715]={'$like':'%'+_0x1fdcd9['query']['filter']+'%'};return _0x4d75ed;})});}_0x1b1b5c=_[_0x1120('0x39')]({},_0x1b1b5c,_0x1fdcd9[_0x1120('0x3b')]);return _0x53c662[_0x1120('0x47')](_0x1b1b5c);}})[_0x1120('0x20')](function(_0x5de9ac){if(_0x5de9ac){_0x441add=_0x5de9ac['length'];if(!_0x1fdcd9[_0x1120('0x2a')][_0x1120('0x32')]('nolimit')){_0x1b1b5c[_0x1120('0x18')]=qs['limit'](_0x1fdcd9[_0x1120('0x2a')][_0x1120('0x18')]);_0x1b1b5c[_0x1120('0x19')]=qs[_0x1120('0x19')](_0x1fdcd9[_0x1120('0x2a')][_0x1120('0x19')]);}return _0x53c662[_0x1120('0x47')](_0x1b1b5c);}})[_0x1120('0x20')](function(_0x282b65){if(_0x282b65){return _0x282b65?{'count':_0x441add,'rows':_0x282b65}:null;}})[_0x1120('0x20')](respondWithResult(_0x227fd1,null))[_0x1120('0x3f')](handleError(_0x227fd1,null));};exports[_0x1120('0x48')]=function(_0x4e3f33,_0x265116,_0x1be5f0){var _0x1903b9={};var _0xa4fbc1={};var _0x1a14ba;var _0x298aee;return db['FreshsalesConfiguration'][_0x1120('0x45')]({'where':{'id':_0x4e3f33[_0x1120('0x44')]['id']}})[_0x1120('0x20')](handleEntityNotFound(_0x265116,null))[_0x1120('0x20')](function(_0x308e58){if(_0x308e58){_0x1a14ba=_0x308e58;_0xa4fbc1[_0x1120('0x2e')]=_[_0x1120('0x2b')](db[_0x1120('0x46')][_0x1120('0x41')]);_0xa4fbc1[_0x1120('0x2a')]=_['keys'](_0x4e3f33[_0x1120('0x2a')]);_0xa4fbc1[_0x1120('0x2c')]=_['intersection'](_0xa4fbc1[_0x1120('0x2e')],_0xa4fbc1['query']);_0x1903b9[_0x1120('0x2f')]=_[_0x1120('0x2d')](_0xa4fbc1[_0x1120('0x2e')],qs[_0x1120('0x30')](_0x4e3f33['query'][_0x1120('0x30')]));_0x1903b9['attributes']=_0x1903b9[_0x1120('0x2f')][_0x1120('0x31')]?_0x1903b9[_0x1120('0x2f')]:_0xa4fbc1[_0x1120('0x2e')];_0x1903b9[_0x1120('0x34')]=qs[_0x1120('0x35')](_0x4e3f33['query']['sort']);_0x1903b9[_0x1120('0x36')]=qs[_0x1120('0x2c')](_['pick'](_0x4e3f33[_0x1120('0x2a')],_0xa4fbc1[_0x1120('0x2c')]));if(_0x4e3f33[_0x1120('0x2a')][_0x1120('0x38')]){_0x1903b9[_0x1120('0x36')]=_['merge'](_0x1903b9[_0x1120('0x36')],{'$or':_[_0x1120('0x26')](_0x1903b9[_0x1120('0x2f')],function(_0x345e64){var _0x40b80c={};_0x40b80c[_0x345e64]={'$like':'%'+_0x4e3f33['query'][_0x1120('0x38')]+'%'};return _0x40b80c;})});}_0x1903b9=_[_0x1120('0x39')]({},_0x1903b9,_0x4e3f33[_0x1120('0x3b')]);return _0x1a14ba[_0x1120('0x48')](_0x1903b9);}})[_0x1120('0x20')](function(_0x1af030){if(_0x1af030){_0x298aee=_0x1af030[_0x1120('0x31')];if(!_0x4e3f33['query']['hasOwnProperty'](_0x1120('0x33'))){_0x1903b9[_0x1120('0x18')]=qs[_0x1120('0x18')](_0x4e3f33[_0x1120('0x2a')][_0x1120('0x18')]);_0x1903b9[_0x1120('0x19')]=qs['offset'](_0x4e3f33[_0x1120('0x2a')][_0x1120('0x19')]);}return _0x1a14ba[_0x1120('0x48')](_0x1903b9);}})['then'](function(_0x6d4c01){if(_0x6d4c01){return _0x6d4c01?{'count':_0x298aee,'rows':_0x6d4c01}:null;}})['then'](respondWithResult(_0x265116,null))[_0x1120('0x3f')](handleError(_0x265116,null));};exports[_0x1120('0x49')]=function(_0x5ceb9d,_0x41a030,_0xdd44eb){var _0x1fff2d={};var _0x59d87f={};var _0xaf23e8;var _0x1f12e4;return db[_0x1120('0x27')][_0x1120('0x45')]({'where':{'id':_0x5ceb9d[_0x1120('0x44')]['id']}})[_0x1120('0x20')](handleEntityNotFound(_0x41a030,null))[_0x1120('0x20')](function(_0x5f50ce){if(_0x5f50ce){_0xaf23e8=_0x5f50ce;_0x59d87f[_0x1120('0x2e')]=_[_0x1120('0x2b')](db[_0x1120('0x46')][_0x1120('0x41')]);_0x59d87f['query']=_[_0x1120('0x2b')](_0x5ceb9d[_0x1120('0x2a')]);_0x59d87f[_0x1120('0x2c')]=_[_0x1120('0x2d')](_0x59d87f['model'],_0x59d87f[_0x1120('0x2a')]);_0x1fff2d[_0x1120('0x2f')]=_[_0x1120('0x2d')](_0x59d87f['model'],qs[_0x1120('0x30')](_0x5ceb9d[_0x1120('0x2a')][_0x1120('0x30')]));_0x1fff2d[_0x1120('0x2f')]=_0x1fff2d[_0x1120('0x2f')]['length']?_0x1fff2d[_0x1120('0x2f')]:_0x59d87f[_0x1120('0x2e')];_0x1fff2d['order']=qs[_0x1120('0x35')](_0x5ceb9d[_0x1120('0x2a')][_0x1120('0x35')]);_0x1fff2d[_0x1120('0x36')]=qs['filters'](_['pick'](_0x5ceb9d[_0x1120('0x2a')],_0x59d87f['filters']));if(_0x5ceb9d[_0x1120('0x2a')][_0x1120('0x38')]){_0x1fff2d['where']=_['merge'](_0x1fff2d[_0x1120('0x36')],{'$or':_[_0x1120('0x26')](_0x1fff2d['attributes'],function(_0x2a3bf1){var _0x3d0d00={};_0x3d0d00[_0x2a3bf1]={'$like':'%'+_0x5ceb9d['query']['filter']+'%'};return _0x3d0d00;})});}_0x1fff2d=_['merge']({},_0x1fff2d,_0x5ceb9d[_0x1120('0x3b')]);return _0xaf23e8['getFields'](_0x1fff2d);}})[_0x1120('0x20')](function(_0x33cb08){if(_0x33cb08){_0x1f12e4=_0x33cb08[_0x1120('0x31')];if(!_0x5ceb9d[_0x1120('0x2a')][_0x1120('0x32')](_0x1120('0x33'))){_0x1fff2d[_0x1120('0x18')]=qs[_0x1120('0x18')](_0x5ceb9d[_0x1120('0x2a')][_0x1120('0x18')]);_0x1fff2d[_0x1120('0x19')]=qs[_0x1120('0x19')](_0x5ceb9d[_0x1120('0x2a')][_0x1120('0x19')]);}return _0xaf23e8[_0x1120('0x49')](_0x1fff2d);}})[_0x1120('0x20')](function(_0x5f558c){if(_0x5f558c){return _0x5f558c?{'count':_0x1f12e4,'rows':_0x5f558c}:null;}})[_0x1120('0x20')](respondWithResult(_0x41a030,null))[_0x1120('0x3f')](handleError(_0x41a030,null));};
\ No newline at end of file
+var _0x01bb=['count','limit','set','apply','reject','update','then','destroy','stack','name','send','map','FreshsalesConfiguration','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','getSubjects','findOne','FreshsalesField','options','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined'];(function(_0x5c082d,_0x4fe0b4){var _0x25ae50=function(_0x532476){while(--_0x532476){_0x5c082d['push'](_0x5c082d['shift']());}};_0x25ae50(++_0x4fe0b4);}(_0x01bb,0x10a));var _0xb01b=function(_0xde34ca,_0x1d5d8a){_0xde34ca=_0xde34ca-0x0;var _0x160eb6=_0x01bb[_0xde34ca];return _0x160eb6;};'use strict';var emlformat=require(_0xb01b('0x0'));var rimraf=require(_0xb01b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb01b('0x2'));var rp=require(_0xb01b('0x3'));var moment=require(_0xb01b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb01b('0x5'));var csv=require(_0xb01b('0x6'));var ejs=require(_0xb01b('0x7'));var fs=require('fs');var fs_extra=require(_0xb01b('0x8'));var _=require(_0xb01b('0x9'));var squel=require('squel');var crypto=require(_0xb01b('0xa'));var jsforce=require(_0xb01b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb01b('0x6'));var querystring=require(_0xb01b('0xc'));var Papa=require('papaparse');var Redis=require(_0xb01b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xb01b('0xe'));var as=require(_0xb01b('0xf'));var hardwareService=require(_0xb01b('0x10'));var logger=require(_0xb01b('0x11'))(_0xb01b('0x12'));var utils=require('../../config/utils');var config=require(_0xb01b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xb01b('0x14'))['db'];function respondWithStatusCode(_0x49e791,_0x35dca8){_0x35dca8=_0x35dca8||0xcc;return function(_0x326bac){if(_0x326bac){return _0x49e791['sendStatus'](_0x35dca8);}return _0x49e791[_0xb01b('0x15')](_0x35dca8)[_0xb01b('0x16')]();};}function respondWithResult(_0x409752,_0x1a6886){_0x1a6886=_0x1a6886||0xc8;return function(_0x3db55a){if(_0x3db55a){return _0x409752['status'](_0x1a6886)[_0xb01b('0x17')](_0x3db55a);}};}function respondWithFilteredResult(_0x2339af,_0x5d0d35){return function(_0x118f83){if(_0x118f83){var _0x4aa918=typeof _0x5d0d35[_0xb01b('0x18')]===_0xb01b('0x19')&&typeof _0x5d0d35['limit']===_0xb01b('0x19');var _0x262fea=_0x118f83[_0xb01b('0x1a')];var _0x18d85a=_0x4aa918?0x0:_0x5d0d35['offset'];var _0x4c6d53=_0x4aa918?_0x118f83[_0xb01b('0x1a')]:_0x5d0d35[_0xb01b('0x18')]+_0x5d0d35[_0xb01b('0x1b')];var _0x494ae0;if(_0x4c6d53>=_0x262fea){_0x4c6d53=_0x262fea;_0x494ae0=0xc8;}else{_0x494ae0=0xce;}_0x2339af[_0xb01b('0x15')](_0x494ae0);return _0x2339af[_0xb01b('0x1c')]('Content-Range',_0x18d85a+'-'+_0x4c6d53+'/'+_0x262fea)[_0xb01b('0x17')](_0x118f83);}return null;};}function patchUpdates(_0x74ef63){return function(_0x4d4b7e){try{jsonpatch[_0xb01b('0x1d')](_0x4d4b7e,_0x74ef63,!![]);}catch(_0x3c589c){return BPromise[_0xb01b('0x1e')](_0x3c589c);}return _0x4d4b7e['save']();};}function saveUpdates(_0x4af9aa,_0x282a2c){return function(_0x2eaa79){if(_0x2eaa79){return _0x2eaa79[_0xb01b('0x1f')](_0x4af9aa)[_0xb01b('0x20')](function(_0x15385e){return _0x15385e;});}return null;};}function removeEntity(_0x31155c,_0xba9b5f){return function(_0x437d76){if(_0x437d76){return _0x437d76[_0xb01b('0x21')]()[_0xb01b('0x20')](function(){_0x31155c[_0xb01b('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f43db,_0x30d582){return function(_0x52196f){if(!_0x52196f){_0x5f43db['sendStatus'](0x194);}return _0x52196f;};}function handleError(_0x29a915,_0x2851a0){_0x2851a0=_0x2851a0||0x1f4;return function(_0x18a4af){logger['error'](_0x18a4af[_0xb01b('0x22')]);if(_0x18a4af[_0xb01b('0x23')]){delete _0x18a4af[_0xb01b('0x23')];}_0x29a915[_0xb01b('0x15')](_0x2851a0)[_0xb01b('0x24')](_0x18a4af);};}exports['index']=function(_0x1612bf,_0x75b0b9){var _0x14eeff={},_0x4d5ad2={},_0x527f12={'count':0x0,'rows':[]};var _0x21005e=_[_0xb01b('0x25')](db[_0xb01b('0x26')]['rawAttributes'],function(_0x250400){return{'name':_0x250400[_0xb01b('0x27')],'type':_0x250400['type']['key']};});_0x4d5ad2[_0xb01b('0x28')]=_['map'](_0x21005e,_0xb01b('0x23'));_0x4d5ad2[_0xb01b('0x29')]=_[_0xb01b('0x2a')](_0x1612bf[_0xb01b('0x29')]);_0x4d5ad2['filters']=_['intersection'](_0x4d5ad2[_0xb01b('0x28')],_0x4d5ad2[_0xb01b('0x29')]);_0x14eeff[_0xb01b('0x2b')]=_[_0xb01b('0x2c')](_0x4d5ad2['model'],qs['fields'](_0x1612bf[_0xb01b('0x29')][_0xb01b('0x2d')]));_0x14eeff[_0xb01b('0x2b')]=_0x14eeff[_0xb01b('0x2b')][_0xb01b('0x2e')]?_0x14eeff['attributes']:_0x4d5ad2['model'];if(!_0x1612bf[_0xb01b('0x29')][_0xb01b('0x2f')](_0xb01b('0x30'))){_0x14eeff[_0xb01b('0x1b')]=qs[_0xb01b('0x1b')](_0x1612bf[_0xb01b('0x29')][_0xb01b('0x1b')]);_0x14eeff['offset']=qs[_0xb01b('0x18')](_0x1612bf[_0xb01b('0x29')][_0xb01b('0x18')]);}_0x14eeff[_0xb01b('0x31')]=qs[_0xb01b('0x32')](_0x1612bf[_0xb01b('0x29')][_0xb01b('0x32')]);_0x14eeff[_0xb01b('0x33')]=qs[_0xb01b('0x34')](_[_0xb01b('0x35')](_0x1612bf['query'],_0x4d5ad2['filters']),_0x21005e);if(_0x1612bf[_0xb01b('0x29')][_0xb01b('0x36')]){_0x14eeff[_0xb01b('0x33')]=_['merge'](_0x14eeff[_0xb01b('0x33')],{'$or':_[_0xb01b('0x25')](_0x21005e,function(_0x25b9a0){if(_0x25b9a0[_0xb01b('0x37')]!=='VIRTUAL'){var _0x22da5a={};_0x22da5a[_0x25b9a0[_0xb01b('0x23')]]={'$like':'%'+_0x1612bf[_0xb01b('0x29')][_0xb01b('0x36')]+'%'};return _0x22da5a;}})});}_0x14eeff=_[_0xb01b('0x38')]({},_0x14eeff,_0x1612bf['options']);var _0x597b79={'where':_0x14eeff[_0xb01b('0x33')]};return db[_0xb01b('0x26')]['count'](_0x597b79)[_0xb01b('0x20')](function(_0x391c0e){_0x527f12[_0xb01b('0x1a')]=_0x391c0e;if(_0x1612bf[_0xb01b('0x29')][_0xb01b('0x39')]){_0x14eeff[_0xb01b('0x3a')]=[{'all':!![]}];}return db[_0xb01b('0x26')][_0xb01b('0x3b')](_0x14eeff);})[_0xb01b('0x20')](function(_0x6527e2){_0x527f12[_0xb01b('0x3c')]=_0x6527e2;return _0x527f12;})[_0xb01b('0x20')](respondWithFilteredResult(_0x75b0b9,_0x14eeff))[_0xb01b('0x3d')](handleError(_0x75b0b9,null));};exports['show']=function(_0x2a7719,_0x5eb045){var _0x36b179={'raw':![],'where':{'id':_0x2a7719[_0xb01b('0x3e')]['id']}},_0xb697b2={};_0xb697b2['model']=_['keys'](db[_0xb01b('0x26')][_0xb01b('0x3f')]);_0xb697b2['query']=_[_0xb01b('0x2a')](_0x2a7719[_0xb01b('0x29')]);_0xb697b2[_0xb01b('0x34')]=_[_0xb01b('0x2c')](_0xb697b2[_0xb01b('0x28')],_0xb697b2[_0xb01b('0x29')]);_0x36b179['attributes']=_[_0xb01b('0x2c')](_0xb697b2[_0xb01b('0x28')],qs[_0xb01b('0x2d')](_0x2a7719[_0xb01b('0x29')][_0xb01b('0x2d')]));_0x36b179[_0xb01b('0x2b')]=_0x36b179['attributes'][_0xb01b('0x2e')]?_0x36b179[_0xb01b('0x2b')]:_0xb697b2['model'];if(_0x2a7719[_0xb01b('0x29')][_0xb01b('0x39')]){_0x36b179['include']=[{'all':!![]}];}_0x36b179=_[_0xb01b('0x38')]({},_0x36b179,_0x2a7719['options']);return db[_0xb01b('0x26')][_0xb01b('0x40')](_0x36b179)[_0xb01b('0x20')](handleEntityNotFound(_0x5eb045,null))[_0xb01b('0x20')](respondWithResult(_0x5eb045,null))[_0xb01b('0x3d')](handleError(_0x5eb045,null));};exports[_0xb01b('0x41')]=function(_0x33c5b0,_0x5ef6c5){return db['FreshsalesConfiguration'][_0xb01b('0x41')](_0x33c5b0[_0xb01b('0x42')],{})[_0xb01b('0x20')](respondWithResult(_0x5ef6c5,0xc9))[_0xb01b('0x3d')](handleError(_0x5ef6c5,null));};exports[_0xb01b('0x1f')]=function(_0x2d6cf3,_0x3363b9){if(_0x2d6cf3[_0xb01b('0x42')]['id']){delete _0x2d6cf3['body']['id'];}return db[_0xb01b('0x26')]['find']({'where':{'id':_0x2d6cf3['params']['id']}})[_0xb01b('0x20')](handleEntityNotFound(_0x3363b9,null))[_0xb01b('0x20')](saveUpdates(_0x2d6cf3[_0xb01b('0x42')],null))[_0xb01b('0x20')](respondWithResult(_0x3363b9,null))[_0xb01b('0x3d')](handleError(_0x3363b9,null));};exports['destroy']=function(_0x274a56,_0x366032){return db['FreshsalesConfiguration'][_0xb01b('0x40')]({'where':{'id':_0x274a56[_0xb01b('0x3e')]['id']}})[_0xb01b('0x20')](handleEntityNotFound(_0x366032,null))[_0xb01b('0x20')](removeEntity(_0x366032,null))[_0xb01b('0x3d')](handleError(_0x366032,null));};exports[_0xb01b('0x43')]=function(_0x399451,_0x1692b5,_0x461c86){var _0x1bb36d={};var _0x51719e={};var _0x25aa97;var _0x5c0d44;return db[_0xb01b('0x26')][_0xb01b('0x44')]({'where':{'id':_0x399451[_0xb01b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1692b5,null))[_0xb01b('0x20')](function(_0x2f5d76){if(_0x2f5d76){_0x25aa97=_0x2f5d76;_0x51719e['model']=_[_0xb01b('0x2a')](db[_0xb01b('0x45')]['rawAttributes']);_0x51719e['query']=_[_0xb01b('0x2a')](_0x399451[_0xb01b('0x29')]);_0x51719e[_0xb01b('0x34')]=_[_0xb01b('0x2c')](_0x51719e['model'],_0x51719e[_0xb01b('0x29')]);_0x1bb36d[_0xb01b('0x2b')]=_[_0xb01b('0x2c')](_0x51719e[_0xb01b('0x28')],qs[_0xb01b('0x2d')](_0x399451[_0xb01b('0x29')][_0xb01b('0x2d')]));_0x1bb36d[_0xb01b('0x2b')]=_0x1bb36d[_0xb01b('0x2b')][_0xb01b('0x2e')]?_0x1bb36d[_0xb01b('0x2b')]:_0x51719e[_0xb01b('0x28')];_0x1bb36d['order']=qs[_0xb01b('0x32')](_0x399451['query'][_0xb01b('0x32')]);_0x1bb36d[_0xb01b('0x33')]=qs['filters'](_['pick'](_0x399451[_0xb01b('0x29')],_0x51719e[_0xb01b('0x34')]));if(_0x399451['query'][_0xb01b('0x36')]){_0x1bb36d[_0xb01b('0x33')]=_['merge'](_0x1bb36d[_0xb01b('0x33')],{'$or':_[_0xb01b('0x25')](_0x1bb36d[_0xb01b('0x2b')],function(_0x42d086){var _0x2b74cc={};_0x2b74cc[_0x42d086]={'$like':'%'+_0x399451[_0xb01b('0x29')][_0xb01b('0x36')]+'%'};return _0x2b74cc;})});}_0x1bb36d=_[_0xb01b('0x38')]({},_0x1bb36d,_0x399451[_0xb01b('0x46')]);return _0x25aa97[_0xb01b('0x43')](_0x1bb36d);}})['then'](function(_0x3ac93e){if(_0x3ac93e){_0x5c0d44=_0x3ac93e[_0xb01b('0x2e')];if(!_0x399451['query'][_0xb01b('0x2f')]('nolimit')){_0x1bb36d[_0xb01b('0x1b')]=qs[_0xb01b('0x1b')](_0x399451[_0xb01b('0x29')][_0xb01b('0x1b')]);_0x1bb36d['offset']=qs[_0xb01b('0x18')](_0x399451[_0xb01b('0x29')][_0xb01b('0x18')]);}return _0x25aa97[_0xb01b('0x43')](_0x1bb36d);}})[_0xb01b('0x20')](function(_0x3015e3){if(_0x3015e3){return _0x3015e3?{'count':_0x5c0d44,'rows':_0x3015e3}:null;}})[_0xb01b('0x20')](respondWithResult(_0x1692b5,null))[_0xb01b('0x3d')](handleError(_0x1692b5,null));};exports[_0xb01b('0x47')]=function(_0x1e0b34,_0x5db8d0,_0x40d2c4){var _0x2be534={};var _0x3d89f9={};var _0x4d6d3c;var _0x135432;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x1e0b34[_0xb01b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5db8d0,null))[_0xb01b('0x20')](function(_0x48f667){if(_0x48f667){_0x4d6d3c=_0x48f667;_0x3d89f9[_0xb01b('0x28')]=_[_0xb01b('0x2a')](db[_0xb01b('0x45')][_0xb01b('0x3f')]);_0x3d89f9[_0xb01b('0x29')]=_[_0xb01b('0x2a')](_0x1e0b34[_0xb01b('0x29')]);_0x3d89f9[_0xb01b('0x34')]=_[_0xb01b('0x2c')](_0x3d89f9['model'],_0x3d89f9[_0xb01b('0x29')]);_0x2be534['attributes']=_[_0xb01b('0x2c')](_0x3d89f9[_0xb01b('0x28')],qs['fields'](_0x1e0b34[_0xb01b('0x29')][_0xb01b('0x2d')]));_0x2be534[_0xb01b('0x2b')]=_0x2be534[_0xb01b('0x2b')][_0xb01b('0x2e')]?_0x2be534['attributes']:_0x3d89f9['model'];_0x2be534[_0xb01b('0x31')]=qs[_0xb01b('0x32')](_0x1e0b34[_0xb01b('0x29')][_0xb01b('0x32')]);_0x2be534[_0xb01b('0x33')]=qs['filters'](_[_0xb01b('0x35')](_0x1e0b34[_0xb01b('0x29')],_0x3d89f9['filters']));if(_0x1e0b34[_0xb01b('0x29')]['filter']){_0x2be534[_0xb01b('0x33')]=_[_0xb01b('0x38')](_0x2be534['where'],{'$or':_[_0xb01b('0x25')](_0x2be534[_0xb01b('0x2b')],function(_0x35bec8){var _0x49433b={};_0x49433b[_0x35bec8]={'$like':'%'+_0x1e0b34[_0xb01b('0x29')][_0xb01b('0x36')]+'%'};return _0x49433b;})});}_0x2be534=_['merge']({},_0x2be534,_0x1e0b34[_0xb01b('0x46')]);return _0x4d6d3c[_0xb01b('0x47')](_0x2be534);}})['then'](function(_0x3d77c8){if(_0x3d77c8){_0x135432=_0x3d77c8['length'];if(!_0x1e0b34[_0xb01b('0x29')]['hasOwnProperty']('nolimit')){_0x2be534[_0xb01b('0x1b')]=qs[_0xb01b('0x1b')](_0x1e0b34[_0xb01b('0x29')]['limit']);_0x2be534[_0xb01b('0x18')]=qs[_0xb01b('0x18')](_0x1e0b34[_0xb01b('0x29')][_0xb01b('0x18')]);}return _0x4d6d3c[_0xb01b('0x47')](_0x2be534);}})[_0xb01b('0x20')](function(_0x3791eb){if(_0x3791eb){return _0x3791eb?{'count':_0x135432,'rows':_0x3791eb}:null;}})[_0xb01b('0x20')](respondWithResult(_0x5db8d0,null))[_0xb01b('0x3d')](handleError(_0x5db8d0,null));};exports[_0xb01b('0x48')]=function(_0x4ea616,_0x18739f,_0x3efb85){var _0x5970e2={};var _0x1770c3={};var _0x1ef34d;var _0x157d4c;return db[_0xb01b('0x26')][_0xb01b('0x44')]({'where':{'id':_0x4ea616[_0xb01b('0x3e')]['id']}})[_0xb01b('0x20')](handleEntityNotFound(_0x18739f,null))['then'](function(_0x4b8261){if(_0x4b8261){_0x1ef34d=_0x4b8261;_0x1770c3['model']=_['keys'](db[_0xb01b('0x45')][_0xb01b('0x3f')]);_0x1770c3[_0xb01b('0x29')]=_[_0xb01b('0x2a')](_0x4ea616[_0xb01b('0x29')]);_0x1770c3[_0xb01b('0x34')]=_['intersection'](_0x1770c3[_0xb01b('0x28')],_0x1770c3[_0xb01b('0x29')]);_0x5970e2[_0xb01b('0x2b')]=_[_0xb01b('0x2c')](_0x1770c3[_0xb01b('0x28')],qs[_0xb01b('0x2d')](_0x4ea616['query'][_0xb01b('0x2d')]));_0x5970e2['attributes']=_0x5970e2['attributes'][_0xb01b('0x2e')]?_0x5970e2[_0xb01b('0x2b')]:_0x1770c3['model'];_0x5970e2[_0xb01b('0x31')]=qs['sort'](_0x4ea616[_0xb01b('0x29')][_0xb01b('0x32')]);_0x5970e2[_0xb01b('0x33')]=qs[_0xb01b('0x34')](_[_0xb01b('0x35')](_0x4ea616[_0xb01b('0x29')],_0x1770c3[_0xb01b('0x34')]));if(_0x4ea616[_0xb01b('0x29')][_0xb01b('0x36')]){_0x5970e2[_0xb01b('0x33')]=_['merge'](_0x5970e2[_0xb01b('0x33')],{'$or':_[_0xb01b('0x25')](_0x5970e2[_0xb01b('0x2b')],function(_0x289dc0){var _0x1ef7c3={};_0x1ef7c3[_0x289dc0]={'$like':'%'+_0x4ea616[_0xb01b('0x29')][_0xb01b('0x36')]+'%'};return _0x1ef7c3;})});}_0x5970e2=_[_0xb01b('0x38')]({},_0x5970e2,_0x4ea616[_0xb01b('0x46')]);return _0x1ef34d[_0xb01b('0x48')](_0x5970e2);}})[_0xb01b('0x20')](function(_0x5f2f90){if(_0x5f2f90){_0x157d4c=_0x5f2f90[_0xb01b('0x2e')];if(!_0x4ea616['query'][_0xb01b('0x2f')](_0xb01b('0x30'))){_0x5970e2[_0xb01b('0x1b')]=qs['limit'](_0x4ea616['query'][_0xb01b('0x1b')]);_0x5970e2[_0xb01b('0x18')]=qs[_0xb01b('0x18')](_0x4ea616[_0xb01b('0x29')][_0xb01b('0x18')]);}return _0x1ef34d['getFields'](_0x5970e2);}})[_0xb01b('0x20')](function(_0x22e824){if(_0x22e824){return _0x22e824?{'count':_0x157d4c,'rows':_0x22e824}:null;}})[_0xb01b('0x20')](respondWithResult(_0x18739f,null))['catch'](handleError(_0x18739f,null));};
\ No newline at end of file
index 812bcdb..dd7bb89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d9d=['define','FreshsalesConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x45bcb1,_0x46cad0){var _0x4bd6a3=function(_0x1f197f){while(--_0x1f197f){_0x45bcb1['push'](_0x45bcb1['shift']());}};_0x4bd6a3(++_0x46cad0);}(_0x7d9d,0x9e));var _0xd7d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d9d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7d9('0x0'));var util=require(_0xd7d9('0x1'));var logger=require(_0xd7d9('0x2'))(_0xd7d9('0x3'));var moment=require(_0xd7d9('0x4'));var BPromise=require(_0xd7d9('0x5'));var rp=require(_0xd7d9('0x6'));var fs=require('fs');var path=require(_0xd7d9('0x7'));var rimraf=require('rimraf');var config=require(_0xd7d9('0x8'));var attributes=require(_0xd7d9('0x9'));module[_0xd7d9('0xa')]=function(_0x56c3c4,_0x587eb5){return _0x56c3c4[_0xd7d9('0xb')](_0xd7d9('0xc'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xee31=['exports','define','FreshsalesConfiguration','int_freshsales_configurations','util','../../config/logger','api','bluebird','path','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x4967ea,_0x3bb674){var _0x140147=function(_0x1f1a34){while(--_0x1f1a34){_0x4967ea['push'](_0x4967ea['shift']());}};_0x140147(++_0x3bb674);}(_0xee31,0x16f));var _0x1ee3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xee31[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x1ee3('0x0'));var logger=require(_0x1ee3('0x1'))(_0x1ee3('0x2'));var moment=require('moment');var BPromise=require(_0x1ee3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ee3('0x4'));var rimraf=require('rimraf');var config=require(_0x1ee3('0x5'));var attributes=require(_0x1ee3('0x6'));module[_0x1ee3('0x7')]=function(_0x4e5633,_0x5db0e1){return _0x4e5633[_0x1ee3('0x8')](_0x1ee3('0x9'),attributes,{'tableName':_0x1ee3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a128d2e..6be3c17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x501a=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x501a,0x12d));var _0xa501=function(_0x17e75e,_0x24753e){_0x17e75e=_0x17e75e-0x0;var _0x25f451=_0x501a[_0x17e75e];return _0x25f451;};'use strict';var _=require(_0xa501('0x0'));var util=require(_0xa501('0x1'));var moment=require(_0xa501('0x2'));var BPromise=require(_0xa501('0x3'));var rs=require(_0xa501('0x4'));var fs=require('fs');var Redis=require(_0xa501('0x5'));var db=require(_0xa501('0x6'))['db'];var utils=require(_0xa501('0x7'));var logger=require(_0xa501('0x8'))(_0xa501('0x9'));var config=require(_0xa501('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa501('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27ff90,_0x2faf4,_0x2f1676){return new BPromise(function(_0x25cb2a,_0x34f4c6){return client[_0xa501('0xc')](_0x27ff90,_0x2f1676)['then'](function(_0x147e50){logger['info'](_0xa501('0xd'),_0x2faf4,_0xa501('0xe'));logger['debug'](_0xa501('0xf'),_0x2faf4,_0xa501('0xe'),JSON[_0xa501('0x10')](_0x147e50));if(_0x147e50[_0xa501('0x11')]){if(_0x147e50[_0xa501('0x11')][_0xa501('0x12')]===0x1f4){logger[_0xa501('0x11')](_0xa501('0xd'),_0x2faf4,_0x147e50[_0xa501('0x11')][_0xa501('0x13')]);return _0x34f4c6(_0x147e50[_0xa501('0x11')][_0xa501('0x13')]);}logger[_0xa501('0x11')](_0xa501('0xd'),_0x2faf4,_0x147e50[_0xa501('0x11')][_0xa501('0x13')]);return _0x25cb2a(_0x147e50[_0xa501('0x11')][_0xa501('0x13')]);}else{logger[_0xa501('0x14')](_0xa501('0xd'),_0x2faf4,_0xa501('0xe'));_0x25cb2a(_0x147e50['result'][_0xa501('0x13')]);}})[_0xa501('0x15')](function(_0x1ca2b8){logger[_0xa501('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2faf4,_0x1ca2b8);_0x34f4c6(_0x1ca2b8);});});}
\ No newline at end of file
+var _0x3112=['../../config/logger','rpc','../../config/environment','client','then','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3112,0x7a));var _0x2311=function(_0x27ae0c,_0x257f50){_0x27ae0c=_0x27ae0c-0x0;var _0x4fc435=_0x3112[_0x27ae0c];return _0x4fc435;};'use strict';var _=require('lodash');var util=require(_0x2311('0x0'));var moment=require('moment');var BPromise=require(_0x2311('0x1'));var rs=require(_0x2311('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2311('0x3'));var logger=require(_0x2311('0x4'))(_0x2311('0x5'));var config=require(_0x2311('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2311('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38088d,_0x3f1f38,_0x532439){return new BPromise(function(_0x4d4f5d,_0x505dca){return client['request'](_0x38088d,_0x532439)[_0x2311('0x8')](function(_0x56ceda){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x3f1f38,'request\x20sent');logger['debug'](_0x2311('0x9'),_0x3f1f38,_0x2311('0xa'),JSON['stringify'](_0x56ceda));if(_0x56ceda[_0x2311('0xb')]){if(_0x56ceda[_0x2311('0xb')][_0x2311('0xc')]===0x1f4){logger[_0x2311('0xb')](_0x2311('0xd'),_0x3f1f38,_0x56ceda[_0x2311('0xb')][_0x2311('0xe')]);return _0x505dca(_0x56ceda[_0x2311('0xb')]['message']);}logger[_0x2311('0xb')](_0x2311('0xd'),_0x3f1f38,_0x56ceda[_0x2311('0xb')]['message']);return _0x4d4f5d(_0x56ceda[_0x2311('0xb')]['message']);}else{logger[_0x2311('0xf')](_0x2311('0xd'),_0x3f1f38,_0x2311('0xa'));_0x4d4f5d(_0x56ceda[_0x2311('0x10')][_0x2311('0xe')]);}})[_0x2311('0x11')](function(_0x1abba9){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x3f1f38,_0x1abba9);_0x505dca(_0x1abba9);});});}
\ No newline at end of file
index 6a13336..fc25d8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc39c=['../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x33bb55,_0x3e7985){var _0xba6684=function(_0x5d655c){while(--_0x5d655c){_0x33bb55['push'](_0x33bb55['shift']());}};_0xba6684(++_0x3e7985);}(_0xc39c,0xd2));var _0xcc39=function(_0x3549e9,_0x455a35){_0x3549e9=_0x3549e9-0x0;var _0x338b94=_0xc39c[_0x3549e9];return _0x338b94;};'use strict';var multer=require('multer');var util=require(_0xcc39('0x0'));var path=require(_0xcc39('0x1'));var timeout=require(_0xcc39('0x2'));var express=require('express');var router=express[_0xcc39('0x3')]();var fs_extra=require(_0xcc39('0x4'));var auth=require(_0xcc39('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcc39('0x6'));var controller=require(_0xcc39('0x7'));router[_0xcc39('0x8')]('/',auth[_0xcc39('0x9')](),controller['index']);router[_0xcc39('0x8')](_0xcc39('0xa'),auth[_0xcc39('0x9')](),controller[_0xcc39('0xb')]);router[_0xcc39('0xc')]('/',auth[_0xcc39('0x9')](),controller[_0xcc39('0xd')]);router[_0xcc39('0xe')](_0xcc39('0xa'),auth[_0xcc39('0x9')](),controller['update']);router[_0xcc39('0xf')]('/:id',auth[_0xcc39('0x9')](),controller[_0xcc39('0x10')]);module[_0xcc39('0x11')]=router;
\ No newline at end of file
+var _0xecd5=['delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x50921b,_0x5eb211){var _0x4c3ea3=function(_0x4cd588){while(--_0x4cd588){_0x50921b['push'](_0x50921b['shift']());}};_0x4c3ea3(++_0x5eb211);}(_0xecd5,0x110));var _0x5ecd=function(_0x3cadc2,_0xdd0aee){_0x3cadc2=_0x3cadc2-0x0;var _0x49773f=_0xecd5[_0x3cadc2];return _0x49773f;};'use strict';var multer=require('multer');var util=require(_0x5ecd('0x0'));var path=require(_0x5ecd('0x1'));var timeout=require(_0x5ecd('0x2'));var express=require('express');var router=express[_0x5ecd('0x3')]();var fs_extra=require(_0x5ecd('0x4'));var auth=require(_0x5ecd('0x5'));var interaction=require(_0x5ecd('0x6'));var config=require('../../config/environment');var controller=require(_0x5ecd('0x7'));router['get']('/',auth[_0x5ecd('0x8')](),controller[_0x5ecd('0x9')]);router['get'](_0x5ecd('0xa'),auth[_0x5ecd('0x8')](),controller[_0x5ecd('0xb')]);router[_0x5ecd('0xc')]('/',auth[_0x5ecd('0x8')](),controller[_0x5ecd('0xd')]);router[_0x5ecd('0xe')](_0x5ecd('0xa'),auth[_0x5ecd('0x8')](),controller[_0x5ecd('0xf')]);router[_0x5ecd('0x10')](_0x5ecd('0xa'),auth['isAuthenticated'](),controller[_0x5ecd('0x11')]);module['exports']=router;
\ No newline at end of file
index dd07fa4..ab30cfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3668=['picklist','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue'];(function(_0x68bc2d,_0x1d62d9){var _0x57aea9=function(_0x17ed78){while(--_0x17ed78){_0x68bc2d['push'](_0x68bc2d['shift']());}};_0x57aea9(++_0x1d62d9);}(_0x3668,0x1cb));var _0x8366=function(_0x477b89,_0x15db07){_0x477b89=_0x477b89-0x0;var _0x5b1c03=_0x3668[_0x477b89];return _0x5b1c03;};'use strict';var Sequelize=require(_0x8366('0x0'));module['exports']={'type':{'type':Sequelize[_0x8366('0x1')]('string',_0x8366('0x2'),_0x8366('0x3'),_0x8366('0x4'),_0x8366('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8366('0x6')]},'key':{'type':Sequelize[_0x8366('0x6')]},'keyType':{'type':Sequelize[_0x8366('0x1')]('string',_0x8366('0x2'),_0x8366('0x3'))},'keyContent':{'type':Sequelize[_0x8366('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8366('0x6')]},'customField':{'type':Sequelize[_0x8366('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8366('0x6')]}};
\ No newline at end of file
+var _0xb570=['ENUM','string','picklist','STRING','variable','customVariable','BOOLEAN','sequelize'];(function(_0xc270db,_0x502adb){var _0x353a63=function(_0x459d82){while(--_0x459d82){_0xc270db['push'](_0xc270db['shift']());}};_0x353a63(++_0x502adb);}(_0xb570,0xa7));var _0x0b57=function(_0x106934,_0x5bc891){_0x106934=_0x106934-0x0;var _0x4c845b=_0xb570[_0x106934];return _0x4c845b;};'use strict';var Sequelize=require(_0x0b57('0x0'));module['exports']={'type':{'type':Sequelize[_0x0b57('0x1')](_0x0b57('0x2'),'variable','customVariable','keyValue',_0x0b57('0x3')),'defaultValue':_0x0b57('0x2')},'content':{'type':Sequelize[_0x0b57('0x4')]},'key':{'type':Sequelize[_0x0b57('0x4')]},'keyType':{'type':Sequelize[_0x0b57('0x1')](_0x0b57('0x2'),_0x0b57('0x5'),_0x0b57('0x6'))},'keyContent':{'type':Sequelize[_0x0b57('0x4')]},'idField':{'type':Sequelize[_0x0b57('0x4')]},'nameField':{'type':Sequelize[_0x0b57('0x4')]},'customField':{'type':Sequelize[_0x0b57('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0b57('0x4')]}};
\ No newline at end of file
index d4421ff..d1d84b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a88=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','fields','include','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x5a88,0x129));var _0x85a8=function(_0x6b7324,_0x3b23cf){_0x6b7324=_0x6b7324-0x0;var _0x2f1a35=_0x5a88[_0x6b7324];return _0x2f1a35;};'use strict';var emlformat=require(_0x85a8('0x0'));var rimraf=require(_0x85a8('0x1'));var zipdir=require(_0x85a8('0x2'));var jsonpatch=require(_0x85a8('0x3'));var rp=require(_0x85a8('0x4'));var moment=require(_0x85a8('0x5'));var BPromise=require(_0x85a8('0x6'));var Mustache=require(_0x85a8('0x7'));var util=require(_0x85a8('0x8'));var path=require('path');var sox=require(_0x85a8('0x9'));var csv=require(_0x85a8('0xa'));var ejs=require(_0x85a8('0xb'));var fs=require('fs');var fs_extra=require(_0x85a8('0xc'));var _=require('lodash');var squel=require(_0x85a8('0xd'));var crypto=require(_0x85a8('0xe'));var jsforce=require(_0x85a8('0xf'));var deskjs=require(_0x85a8('0x10'));var toCsv=require(_0x85a8('0xa'));var querystring=require(_0x85a8('0x11'));var Papa=require(_0x85a8('0x12'));var Redis=require(_0x85a8('0x13'));var authService=require(_0x85a8('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x85a8('0x15'));var logger=require(_0x85a8('0x16'))(_0x85a8('0x17'));var utils=require(_0x85a8('0x18'));var config=require(_0x85a8('0x19'));var licenseUtil=require(_0x85a8('0x1a'));var db=require(_0x85a8('0x1b'))['db'];function respondWithStatusCode(_0xafad93,_0x14a75b){_0x14a75b=_0x14a75b||0xcc;return function(_0x5e1367){if(_0x5e1367){return _0xafad93[_0x85a8('0x1c')](_0x14a75b);}return _0xafad93[_0x85a8('0x1d')](_0x14a75b)[_0x85a8('0x1e')]();};}function respondWithResult(_0x169733,_0x19bf34){_0x19bf34=_0x19bf34||0xc8;return function(_0x1ae6b2){if(_0x1ae6b2){return _0x169733[_0x85a8('0x1d')](_0x19bf34)[_0x85a8('0x1f')](_0x1ae6b2);}};}function respondWithFilteredResult(_0x26db3c,_0x5fa32c){return function(_0x20df9a){if(_0x20df9a){var _0x33630f=typeof _0x5fa32c[_0x85a8('0x20')]===_0x85a8('0x21')&&typeof _0x5fa32c[_0x85a8('0x22')]===_0x85a8('0x21');var _0x2113f1=_0x20df9a[_0x85a8('0x23')];var _0x4c9a70=_0x33630f?0x0:_0x5fa32c[_0x85a8('0x20')];var _0x40886e=_0x33630f?_0x20df9a[_0x85a8('0x23')]:_0x5fa32c[_0x85a8('0x20')]+_0x5fa32c[_0x85a8('0x22')];var _0x312b42;if(_0x40886e>=_0x2113f1){_0x40886e=_0x2113f1;_0x312b42=0xc8;}else{_0x312b42=0xce;}_0x26db3c[_0x85a8('0x1d')](_0x312b42);return _0x26db3c['set'](_0x85a8('0x24'),_0x4c9a70+'-'+_0x40886e+'/'+_0x2113f1)[_0x85a8('0x1f')](_0x20df9a);}return null;};}function patchUpdates(_0x4c9b6e){return function(_0xe169d8){try{jsonpatch[_0x85a8('0x25')](_0xe169d8,_0x4c9b6e,!![]);}catch(_0x15ef47){return BPromise[_0x85a8('0x26')](_0x15ef47);}return _0xe169d8[_0x85a8('0x27')]();};}function saveUpdates(_0x1bd91d,_0x4a0721){return function(_0x28c06d){if(_0x28c06d){return _0x28c06d['update'](_0x1bd91d)[_0x85a8('0x28')](function(_0x471d81){return _0x471d81;});}return null;};}function removeEntity(_0x45fc92,_0x2d12cb){return function(_0x7a9b41){if(_0x7a9b41){return _0x7a9b41[_0x85a8('0x29')]()[_0x85a8('0x28')](function(){_0x45fc92['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x152a53,_0x398e88){return function(_0x334477){if(!_0x334477){_0x152a53[_0x85a8('0x1c')](0x194);}return _0x334477;};}function handleError(_0x21da33,_0x22c8f7){_0x22c8f7=_0x22c8f7||0x1f4;return function(_0x452daa){logger[_0x85a8('0x2a')](_0x452daa[_0x85a8('0x2b')]);if(_0x452daa[_0x85a8('0x2c')]){delete _0x452daa[_0x85a8('0x2c')];}_0x21da33['status'](_0x22c8f7)[_0x85a8('0x2d')](_0x452daa);};}exports[_0x85a8('0x2e')]=function(_0x1f4dd6,_0xf610d8){var _0x139aa2={},_0x313887={},_0x6c65fa={'count':0x0,'rows':[]};var _0x3b4933=_[_0x85a8('0x2f')](db[_0x85a8('0x30')][_0x85a8('0x31')],function(_0x529db3){return{'name':_0x529db3['fieldName'],'type':_0x529db3[_0x85a8('0x32')][_0x85a8('0x33')]};});_0x313887['model']=_[_0x85a8('0x2f')](_0x3b4933,_0x85a8('0x2c'));_0x313887[_0x85a8('0x34')]=_[_0x85a8('0x35')](_0x1f4dd6[_0x85a8('0x34')]);_0x313887[_0x85a8('0x36')]=_[_0x85a8('0x37')](_0x313887[_0x85a8('0x38')],_0x313887[_0x85a8('0x34')]);_0x139aa2[_0x85a8('0x39')]=_[_0x85a8('0x37')](_0x313887[_0x85a8('0x38')],qs['fields'](_0x1f4dd6[_0x85a8('0x34')]['fields']));_0x139aa2[_0x85a8('0x39')]=_0x139aa2[_0x85a8('0x39')][_0x85a8('0x3a')]?_0x139aa2[_0x85a8('0x39')]:_0x313887[_0x85a8('0x38')];if(!_0x1f4dd6[_0x85a8('0x34')][_0x85a8('0x3b')](_0x85a8('0x3c'))){_0x139aa2[_0x85a8('0x22')]=qs[_0x85a8('0x22')](_0x1f4dd6[_0x85a8('0x34')]['limit']);_0x139aa2['offset']=qs['offset'](_0x1f4dd6[_0x85a8('0x34')][_0x85a8('0x20')]);}_0x139aa2[_0x85a8('0x3d')]=qs[_0x85a8('0x3e')](_0x1f4dd6['query']['sort']);_0x139aa2[_0x85a8('0x3f')]=qs[_0x85a8('0x36')](_[_0x85a8('0x40')](_0x1f4dd6['query'],_0x313887[_0x85a8('0x36')]),_0x3b4933);if(_0x1f4dd6[_0x85a8('0x34')][_0x85a8('0x41')]){_0x139aa2[_0x85a8('0x3f')]=_[_0x85a8('0x42')](_0x139aa2[_0x85a8('0x3f')],{'$or':_[_0x85a8('0x2f')](_0x3b4933,function(_0x9011be){if(_0x9011be['type']!==_0x85a8('0x43')){var _0x35f5c9={};_0x35f5c9[_0x9011be[_0x85a8('0x2c')]]={'$like':'%'+_0x1f4dd6[_0x85a8('0x34')]['filter']+'%'};return _0x35f5c9;}})});}_0x139aa2=_[_0x85a8('0x42')]({},_0x139aa2,_0x1f4dd6[_0x85a8('0x44')]);var _0x333b5c={'where':_0x139aa2[_0x85a8('0x3f')]};return db['FreshsalesField'][_0x85a8('0x23')](_0x333b5c)['then'](function(_0x1254e7){_0x6c65fa[_0x85a8('0x23')]=_0x1254e7;if(_0x1f4dd6[_0x85a8('0x34')][_0x85a8('0x45')]){_0x139aa2['include']=[{'all':!![]}];}return db[_0x85a8('0x30')][_0x85a8('0x46')](_0x139aa2);})[_0x85a8('0x28')](function(_0x4ff32b){_0x6c65fa[_0x85a8('0x47')]=_0x4ff32b;return _0x6c65fa;})[_0x85a8('0x28')](respondWithFilteredResult(_0xf610d8,_0x139aa2))[_0x85a8('0x48')](handleError(_0xf610d8,null));};exports['show']=function(_0x2624fa,_0x313cfc){var _0xef2456={'raw':!![],'where':{'id':_0x2624fa[_0x85a8('0x49')]['id']}},_0x5683da={};_0x5683da[_0x85a8('0x38')]=_[_0x85a8('0x35')](db[_0x85a8('0x30')][_0x85a8('0x31')]);_0x5683da['query']=_['keys'](_0x2624fa[_0x85a8('0x34')]);_0x5683da[_0x85a8('0x36')]=_[_0x85a8('0x37')](_0x5683da['model'],_0x5683da[_0x85a8('0x34')]);_0xef2456[_0x85a8('0x39')]=_['intersection'](_0x5683da[_0x85a8('0x38')],qs[_0x85a8('0x4a')](_0x2624fa[_0x85a8('0x34')]['fields']));_0xef2456[_0x85a8('0x39')]=_0xef2456[_0x85a8('0x39')][_0x85a8('0x3a')]?_0xef2456[_0x85a8('0x39')]:_0x5683da[_0x85a8('0x38')];if(_0x2624fa['query'][_0x85a8('0x45')]){_0xef2456[_0x85a8('0x4b')]=[{'all':!![]}];}_0xef2456=_[_0x85a8('0x42')]({},_0xef2456,_0x2624fa[_0x85a8('0x44')]);return db['FreshsalesField'][_0x85a8('0x4c')](_0xef2456)['then'](handleEntityNotFound(_0x313cfc,null))[_0x85a8('0x28')](respondWithResult(_0x313cfc,null))[_0x85a8('0x48')](handleError(_0x313cfc,null));};exports['create']=function(_0x435b9b,_0x4a76e6){return db['FreshsalesField'][_0x85a8('0x4d')](_0x435b9b['body'],{})['then'](respondWithResult(_0x4a76e6,0xc9))[_0x85a8('0x48')](handleError(_0x4a76e6,null));};exports[_0x85a8('0x4e')]=function(_0x100252,_0x135efc){if(_0x100252[_0x85a8('0x4f')]['id']){delete _0x100252[_0x85a8('0x4f')]['id'];}return db[_0x85a8('0x30')][_0x85a8('0x4c')]({'where':{'id':_0x100252[_0x85a8('0x49')]['id']}})[_0x85a8('0x28')](handleEntityNotFound(_0x135efc,null))['then'](saveUpdates(_0x100252['body'],null))[_0x85a8('0x28')](respondWithResult(_0x135efc,null))[_0x85a8('0x48')](handleError(_0x135efc,null));};exports['destroy']=function(_0x211b68,_0x5ebaf8){return db[_0x85a8('0x30')][_0x85a8('0x4c')]({'where':{'id':_0x211b68[_0x85a8('0x49')]['id']}})['then'](handleEntityNotFound(_0x5ebaf8,null))[_0x85a8('0x28')](removeEntity(_0x5ebaf8,null))[_0x85a8('0x48')](handleError(_0x5ebaf8,null));};
\ No newline at end of file
+var _0x8963=['nolimit','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','findAll','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','end','error','name','send','index','FreshsalesField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8963,0x137));var _0x3896=function(_0x48d687,_0x43a7b5){_0x48d687=_0x48d687-0x0;var _0x174512=_0x8963[_0x48d687];return _0x174512;};'use strict';var emlformat=require(_0x3896('0x0'));var rimraf=require(_0x3896('0x1'));var zipdir=require(_0x3896('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3896('0x3'));var BPromise=require(_0x3896('0x4'));var Mustache=require(_0x3896('0x5'));var util=require(_0x3896('0x6'));var path=require(_0x3896('0x7'));var sox=require('sox');var csv=require(_0x3896('0x8'));var ejs=require(_0x3896('0x9'));var fs=require('fs');var fs_extra=require(_0x3896('0xa'));var _=require(_0x3896('0xb'));var squel=require(_0x3896('0xc'));var crypto=require(_0x3896('0xd'));var jsforce=require(_0x3896('0xe'));var deskjs=require(_0x3896('0xf'));var toCsv=require(_0x3896('0x8'));var querystring=require('querystring');var Papa=require(_0x3896('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3896('0x11'));var logger=require(_0x3896('0x12'))(_0x3896('0x13'));var utils=require(_0x3896('0x14'));var config=require(_0x3896('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3896('0x16'))['db'];function respondWithStatusCode(_0x4b8758,_0x11d90f){_0x11d90f=_0x11d90f||0xcc;return function(_0x137bc5){if(_0x137bc5){return _0x4b8758[_0x3896('0x17')](_0x11d90f);}return _0x4b8758[_0x3896('0x18')](_0x11d90f)['end']();};}function respondWithResult(_0x573373,_0x1fa267){_0x1fa267=_0x1fa267||0xc8;return function(_0x1964c9){if(_0x1964c9){return _0x573373[_0x3896('0x18')](_0x1fa267)[_0x3896('0x19')](_0x1964c9);}};}function respondWithFilteredResult(_0x43f16e,_0x3b6a19){return function(_0x3b4c3c){if(_0x3b4c3c){var _0x488fac=typeof _0x3b6a19['offset']===_0x3896('0x1a')&&typeof _0x3b6a19[_0x3896('0x1b')]===_0x3896('0x1a');var _0x2b7f2a=_0x3b4c3c[_0x3896('0x1c')];var _0x34bb2d=_0x488fac?0x0:_0x3b6a19[_0x3896('0x1d')];var _0x5ca1eb=_0x488fac?_0x3b4c3c[_0x3896('0x1c')]:_0x3b6a19[_0x3896('0x1d')]+_0x3b6a19[_0x3896('0x1b')];var _0xe1e1be;if(_0x5ca1eb>=_0x2b7f2a){_0x5ca1eb=_0x2b7f2a;_0xe1e1be=0xc8;}else{_0xe1e1be=0xce;}_0x43f16e[_0x3896('0x18')](_0xe1e1be);return _0x43f16e[_0x3896('0x1e')](_0x3896('0x1f'),_0x34bb2d+'-'+_0x5ca1eb+'/'+_0x2b7f2a)[_0x3896('0x19')](_0x3b4c3c);}return null;};}function patchUpdates(_0x87a888){return function(_0x2f611a){try{jsonpatch['apply'](_0x2f611a,_0x87a888,!![]);}catch(_0x321a9e){return BPromise['reject'](_0x321a9e);}return _0x2f611a[_0x3896('0x20')]();};}function saveUpdates(_0x40781e,_0x4f4ca4){return function(_0x4a6434){if(_0x4a6434){return _0x4a6434[_0x3896('0x21')](_0x40781e)[_0x3896('0x22')](function(_0x2c3d9a){return _0x2c3d9a;});}return null;};}function removeEntity(_0x2bc024,_0x597511){return function(_0x22dccc){if(_0x22dccc){return _0x22dccc[_0x3896('0x23')]()[_0x3896('0x22')](function(){_0x2bc024['status'](0xcc)[_0x3896('0x24')]();});}};}function handleEntityNotFound(_0x21a923,_0x2bbdac){return function(_0x3a9b4a){if(!_0x3a9b4a){_0x21a923['sendStatus'](0x194);}return _0x3a9b4a;};}function handleError(_0x2c1c0d,_0x416e26){_0x416e26=_0x416e26||0x1f4;return function(_0x41f70c){logger[_0x3896('0x25')](_0x41f70c['stack']);if(_0x41f70c[_0x3896('0x26')]){delete _0x41f70c[_0x3896('0x26')];}_0x2c1c0d[_0x3896('0x18')](_0x416e26)[_0x3896('0x27')](_0x41f70c);};}exports[_0x3896('0x28')]=function(_0x1184cb,_0x23cda8){var _0x5a30f4={},_0x52ea24={},_0x597408={'count':0x0,'rows':[]};var _0x2e0e79=_['map'](db[_0x3896('0x29')][_0x3896('0x2a')],function(_0x135cee){return{'name':_0x135cee[_0x3896('0x2b')],'type':_0x135cee['type'][_0x3896('0x2c')]};});_0x52ea24[_0x3896('0x2d')]=_['map'](_0x2e0e79,_0x3896('0x26'));_0x52ea24[_0x3896('0x2e')]=_[_0x3896('0x2f')](_0x1184cb['query']);_0x52ea24[_0x3896('0x30')]=_[_0x3896('0x31')](_0x52ea24[_0x3896('0x2d')],_0x52ea24[_0x3896('0x2e')]);_0x5a30f4[_0x3896('0x32')]=_[_0x3896('0x31')](_0x52ea24[_0x3896('0x2d')],qs['fields'](_0x1184cb[_0x3896('0x2e')][_0x3896('0x33')]));_0x5a30f4[_0x3896('0x32')]=_0x5a30f4[_0x3896('0x32')][_0x3896('0x34')]?_0x5a30f4[_0x3896('0x32')]:_0x52ea24['model'];if(!_0x1184cb[_0x3896('0x2e')][_0x3896('0x35')](_0x3896('0x36'))){_0x5a30f4[_0x3896('0x1b')]=qs[_0x3896('0x1b')](_0x1184cb['query'][_0x3896('0x1b')]);_0x5a30f4[_0x3896('0x1d')]=qs[_0x3896('0x1d')](_0x1184cb[_0x3896('0x2e')][_0x3896('0x1d')]);}_0x5a30f4[_0x3896('0x37')]=qs[_0x3896('0x38')](_0x1184cb[_0x3896('0x2e')][_0x3896('0x38')]);_0x5a30f4[_0x3896('0x39')]=qs['filters'](_[_0x3896('0x3a')](_0x1184cb['query'],_0x52ea24['filters']),_0x2e0e79);if(_0x1184cb['query'][_0x3896('0x3b')]){_0x5a30f4['where']=_[_0x3896('0x3c')](_0x5a30f4[_0x3896('0x39')],{'$or':_[_0x3896('0x3d')](_0x2e0e79,function(_0x28fcf0){if(_0x28fcf0[_0x3896('0x3e')]!=='VIRTUAL'){var _0x24d4f6={};_0x24d4f6[_0x28fcf0['name']]={'$like':'%'+_0x1184cb[_0x3896('0x2e')][_0x3896('0x3b')]+'%'};return _0x24d4f6;}})});}_0x5a30f4=_[_0x3896('0x3c')]({},_0x5a30f4,_0x1184cb[_0x3896('0x3f')]);var _0x39a766={'where':_0x5a30f4[_0x3896('0x39')]};return db['FreshsalesField'][_0x3896('0x1c')](_0x39a766)['then'](function(_0x5c1bcf){_0x597408['count']=_0x5c1bcf;if(_0x1184cb['query'][_0x3896('0x40')]){_0x5a30f4[_0x3896('0x41')]=[{'all':!![]}];}return db['FreshsalesField'][_0x3896('0x42')](_0x5a30f4);})['then'](function(_0x316457){_0x597408['rows']=_0x316457;return _0x597408;})[_0x3896('0x22')](respondWithFilteredResult(_0x23cda8,_0x5a30f4))[_0x3896('0x43')](handleError(_0x23cda8,null));};exports[_0x3896('0x44')]=function(_0xd1e994,_0x250f05){var _0x1a8e2f={'raw':!![],'where':{'id':_0xd1e994['params']['id']}},_0xf9d797={};_0xf9d797[_0x3896('0x2d')]=_[_0x3896('0x2f')](db[_0x3896('0x29')][_0x3896('0x2a')]);_0xf9d797[_0x3896('0x2e')]=_[_0x3896('0x2f')](_0xd1e994[_0x3896('0x2e')]);_0xf9d797[_0x3896('0x30')]=_[_0x3896('0x31')](_0xf9d797[_0x3896('0x2d')],_0xf9d797[_0x3896('0x2e')]);_0x1a8e2f['attributes']=_[_0x3896('0x31')](_0xf9d797[_0x3896('0x2d')],qs['fields'](_0xd1e994[_0x3896('0x2e')][_0x3896('0x33')]));_0x1a8e2f['attributes']=_0x1a8e2f[_0x3896('0x32')]['length']?_0x1a8e2f[_0x3896('0x32')]:_0xf9d797['model'];if(_0xd1e994['query'][_0x3896('0x40')]){_0x1a8e2f[_0x3896('0x41')]=[{'all':!![]}];}_0x1a8e2f=_[_0x3896('0x3c')]({},_0x1a8e2f,_0xd1e994[_0x3896('0x3f')]);return db['FreshsalesField'][_0x3896('0x45')](_0x1a8e2f)[_0x3896('0x22')](handleEntityNotFound(_0x250f05,null))[_0x3896('0x22')](respondWithResult(_0x250f05,null))[_0x3896('0x43')](handleError(_0x250f05,null));};exports[_0x3896('0x46')]=function(_0x6aac8,_0x3422dd){return db[_0x3896('0x29')][_0x3896('0x46')](_0x6aac8[_0x3896('0x47')],{})[_0x3896('0x22')](respondWithResult(_0x3422dd,0xc9))[_0x3896('0x43')](handleError(_0x3422dd,null));};exports['update']=function(_0x4c189e,_0x27704a){if(_0x4c189e[_0x3896('0x47')]['id']){delete _0x4c189e[_0x3896('0x47')]['id'];}return db[_0x3896('0x29')][_0x3896('0x45')]({'where':{'id':_0x4c189e[_0x3896('0x48')]['id']}})['then'](handleEntityNotFound(_0x27704a,null))[_0x3896('0x22')](saveUpdates(_0x4c189e[_0x3896('0x47')],null))[_0x3896('0x22')](respondWithResult(_0x27704a,null))[_0x3896('0x43')](handleError(_0x27704a,null));};exports[_0x3896('0x23')]=function(_0x4d05b4,_0x92bb9a){return db[_0x3896('0x29')][_0x3896('0x45')]({'where':{'id':_0x4d05b4[_0x3896('0x48')]['id']}})['then'](handleEntityNotFound(_0x92bb9a,null))[_0x3896('0x22')](removeEntity(_0x92bb9a,null))[_0x3896('0x43')](handleError(_0x92bb9a,null));};
\ No newline at end of file
index c011b53..aa9a0fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f7a=['request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','int_freshsales_fields','freshsales_unique_index','idField','FieldId','../../config/logger','api','moment'];(function(_0x12ce23,_0x1a2816){var _0x3c2dd9=function(_0x49ba73){while(--_0x49ba73){_0x12ce23['push'](_0x12ce23['shift']());}};_0x3c2dd9(++_0x1a2816);}(_0x4f7a,0x105));var _0xa4f7=function(_0x1a4134,_0x4d0760){_0x1a4134=_0x1a4134-0x0;var _0x26c0f2=_0x4f7a[_0x1a4134];return _0x26c0f2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa4f7('0x0'))(_0xa4f7('0x1'));var moment=require(_0xa4f7('0x2'));var BPromise=require('bluebird');var rp=require(_0xa4f7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4f7('0x4'));var config=require(_0xa4f7('0x5'));var attributes=require(_0xa4f7('0x6'));module['exports']=function(_0x31c8ab,_0x1d7c51){return _0x31c8ab['define']('FreshsalesField',attributes,{'tableName':_0xa4f7('0x7'),'paranoid':![],'indexes':[{'name':_0xa4f7('0x8'),'fields':[_0xa4f7('0x9'),_0xa4f7('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7880=['define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x23c8e0,_0x5c9239){var _0x21be9d=function(_0x3b655a){while(--_0x3b655a){_0x23c8e0['push'](_0x23c8e0['shift']());}};_0x21be9d(++_0x5c9239);}(_0x7880,0x1f4));var _0x0788=function(_0x3e3527,_0x4f9564){_0x3e3527=_0x3e3527-0x0;var _0x1465cb=_0x7880[_0x3e3527];return _0x1465cb;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var logger=require(_0x0788('0x1'))(_0x0788('0x2'));var moment=require(_0x0788('0x3'));var BPromise=require(_0x0788('0x4'));var rp=require(_0x0788('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var attributes=require(_0x0788('0x8'));module[_0x0788('0x9')]=function(_0x262f5c,_0x775629){return _0x262f5c[_0x0788('0xa')](_0x0788('0xb'),attributes,{'tableName':_0x0788('0xc'),'paranoid':![],'indexes':[{'name':_0x0788('0xd'),'fields':['idField',_0x0788('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index b9b84ee..d38a448 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x4975,0x86));var _0x5497=function(_0x1b1468,_0x7b5a5e){_0x1b1468=_0x1b1468-0x0;var _0x404a18=_0x4975[_0x1b1468];return _0x404a18;};'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')]('FreshsalesField,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
+var _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4ddff7,_0xcc21cc){var _0x136499=function(_0x32a169){while(--_0x32a169){_0x4ddff7['push'](_0x4ddff7['shift']());}};_0x136499(++_0xcc21cc);}(_0xda19,0xd5));var _0x9da1=function(_0x526a99,_0x30606c){_0x526a99=_0x526a99-0x0;var _0x1c74c8=_0xda19[_0x526a99];return _0x1c74c8;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});}
\ No newline at end of file
index 13d3560..e158b37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x263bad,_0x3db138){var _0x23f968=function(_0x2aa6fb){while(--_0x2aa6fb){_0x263bad['push'](_0x263bad['shift']());}};_0x23f968(++_0x3db138);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2c88d7,_0x115b71){var _0x8d591=function(_0x5bb793){while(--_0x5bb793){_0x2c88d7['push'](_0x2c88d7['shift']());}};_0x8d591(++_0x115b71);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
index ab1c091..990bad9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf9f=['STRING','username','ENUM','integrationTab','newTab','exports'];(function(_0x3ab5bd,_0x56fbcf){var _0xe4109d=function(_0x36418b){while(--_0x36418b){_0x3ab5bd['push'](_0x3ab5bd['shift']());}};_0xe4109d(++_0x56fbcf);}(_0xcf9f,0x13d));var _0xfcf9=function(_0x126d18,_0x2cf8fd){_0x126d18=_0x126d18-0x0;var _0x4e6c03=_0xcf9f[_0x126d18];return _0x4e6c03;};'use strict';var Sequelize=require('sequelize');module[_0xfcf9('0x0')]={'name':{'type':Sequelize[_0xfcf9('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfcf9('0x1')],'unique':_0xfcf9('0x2')},'remoteUri':{'type':Sequelize[_0xfcf9('0x1')]},'password':{'type':Sequelize[_0xfcf9('0x1')]},'clientId':{'type':Sequelize[_0xfcf9('0x1')]},'clientSecret':{'type':Sequelize[_0xfcf9('0x1')]},'securityToken':{'type':Sequelize[_0xfcf9('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfcf9('0x3')](_0xfcf9('0x4'),_0xfcf9('0x5')),'defaultValue':_0xfcf9('0x4')}};
\ No newline at end of file
+var _0xfc6d=['newTab','sequelize','exports','STRING','integrationTab'];(function(_0x4cae38,_0x1f7372){var _0x4fc0d6=function(_0x105335){while(--_0x105335){_0x4cae38['push'](_0x4cae38['shift']());}};_0x4fc0d6(++_0x1f7372);}(_0xfc6d,0x1e6));var _0xdfc6=function(_0xdb7691,_0x2f5da3){_0xdb7691=_0xdb7691-0x0;var _0x56c15d=_0xfc6d[_0xdb7691];return _0x56c15d;};'use strict';var Sequelize=require(_0xdfc6('0x0'));module[_0xdfc6('0x1')]={'name':{'type':Sequelize[_0xdfc6('0x2')]},'description':{'type':Sequelize[_0xdfc6('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xdfc6('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xdfc6('0x2')]},'clientSecret':{'type':Sequelize[_0xdfc6('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xdfc6('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xdfc6('0x3'),_0xdfc6('0x4')),'defaultValue':_0xdfc6('0x3')}};
\ No newline at end of file
index f68a14d..8ed76b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29da=['keys','intersection','attributes','fields','query','sort','filters','where','merge','VIRTUAL','filter','options','SalesforceAccount','count','include','rows','show','params','length','includeAll','find','catch','create','body','destroy','getConfigurations','findOne','pick','hasOwnProperty','nolimit','addConfiguration','Subjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','username','password','securityToken','slice','substring','lastIndexOf','Connection','concat','isNil','ticketType','OwnerId','ActivityDate','IsRecurrence','Subject','Description','string','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','False','false','test','statusCode','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','offset','set','json','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map'];(function(_0x20d514,_0x539b3c){var _0x16d64e=function(_0x53ccc1){while(--_0x53ccc1){_0x20d514['push'](_0x20d514['shift']());}};_0x16d64e(++_0x539b3c);}(_0x29da,0x143));var _0xa29d=function(_0x174d5e,_0x1d7bd9){_0x174d5e=_0x174d5e-0x0;var _0x4ba358=_0x29da[_0x174d5e];return _0x4ba358;};'use strict';var emlformat=require(_0xa29d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa29d('0x1'));var rp=require(_0xa29d('0x2'));var moment=require(_0xa29d('0x3'));var BPromise=require(_0xa29d('0x4'));var Mustache=require(_0xa29d('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa29d('0x6'));var csv=require(_0xa29d('0x7'));var ejs=require(_0xa29d('0x8'));var fs=require('fs');var fs_extra=require(_0xa29d('0x9'));var _=require(_0xa29d('0xa'));var squel=require(_0xa29d('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa29d('0xc'));var toCsv=require(_0xa29d('0x7'));var querystring=require('querystring');var Papa=require(_0xa29d('0xd'));var Redis=require(_0xa29d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa29d('0xf'));var as=require(_0xa29d('0x10'));var hardwareService=require(_0xa29d('0x11'));var logger=require(_0xa29d('0x12'))(_0xa29d('0x13'));var utils=require(_0xa29d('0x14'));var config=require(_0xa29d('0x15'));var licenseUtil=require(_0xa29d('0x16'));var db=require(_0xa29d('0x17'))['db'];var integrations=require(_0xa29d('0x18'));function respondWithStatusCode(_0x45a3d8,_0x5dd455){_0x5dd455=_0x5dd455||0xcc;return function(_0x4d3b6e){if(_0x4d3b6e){return _0x45a3d8[_0xa29d('0x19')](_0x5dd455);}return _0x45a3d8[_0xa29d('0x1a')](_0x5dd455)[_0xa29d('0x1b')]();};}function respondWithResult(_0x477d0e,_0x14bce6){_0x14bce6=_0x14bce6||0xc8;return function(_0x589651){if(_0x589651){return _0x477d0e[_0xa29d('0x1a')](_0x14bce6)['json'](_0x589651);}};}function respondWithFilteredResult(_0x4aae28,_0xeef771){return function(_0x32074d){if(_0x32074d){var _0x2e3ba2=typeof _0xeef771['offset']===_0xa29d('0x1c')&&typeof _0xeef771[_0xa29d('0x1d')]===_0xa29d('0x1c');var _0x227516=_0x32074d['count'];var _0x15174a=_0x2e3ba2?0x0:_0xeef771[_0xa29d('0x1e')];var _0x4f6e37=_0x2e3ba2?_0x32074d['count']:_0xeef771[_0xa29d('0x1e')]+_0xeef771[_0xa29d('0x1d')];var _0x22e063;if(_0x4f6e37>=_0x227516){_0x4f6e37=_0x227516;_0x22e063=0xc8;}else{_0x22e063=0xce;}_0x4aae28['status'](_0x22e063);return _0x4aae28[_0xa29d('0x1f')]('Content-Range',_0x15174a+'-'+_0x4f6e37+'/'+_0x227516)[_0xa29d('0x20')](_0x32074d);}return null;};}function patchUpdates(_0x451607){return function(_0x4a693e){try{jsonpatch[_0xa29d('0x21')](_0x4a693e,_0x451607,!![]);}catch(_0x5c5192){return BPromise[_0xa29d('0x22')](_0x5c5192);}return _0x4a693e[_0xa29d('0x23')]();};}function saveUpdates(_0xd426bb,_0x32eaed){return function(_0x296e7d){if(_0x296e7d){return _0x296e7d[_0xa29d('0x24')](_0xd426bb)['then'](function(_0x1266c4){return _0x1266c4;});}return null;};}function removeEntity(_0x49b63f,_0x45ffe3){return function(_0x2789d6){if(_0x2789d6){return _0x2789d6['destroy']()[_0xa29d('0x25')](function(){_0x49b63f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d3d10,_0x5a5548){return function(_0x6bca24){if(!_0x6bca24){_0x5d3d10[_0xa29d('0x19')](0x194);}return _0x6bca24;};}function handleError(_0x33ae3e,_0x24c255){_0x24c255=_0x24c255||0x1f4;return function(_0x49da06){logger[_0xa29d('0x26')](_0x49da06[_0xa29d('0x27')]);if(_0x49da06[_0xa29d('0x28')]){delete _0x49da06[_0xa29d('0x28')];}_0x33ae3e[_0xa29d('0x1a')](_0x24c255)[_0xa29d('0x29')](_0x49da06);};}exports[_0xa29d('0x2a')]=function(_0x5713b2,_0x365289){var _0x5510e3={},_0xca866f={},_0x261dac={'count':0x0,'rows':[]};var _0x4d9081=_['map'](db['SalesforceAccount'][_0xa29d('0x2b')],function(_0x44c83d){return{'name':_0x44c83d[_0xa29d('0x2c')],'type':_0x44c83d[_0xa29d('0x2d')][_0xa29d('0x2e')]};});_0xca866f[_0xa29d('0x2f')]=_[_0xa29d('0x30')](_0x4d9081,_0xa29d('0x28'));_0xca866f['query']=_[_0xa29d('0x31')](_0x5713b2['query']);_0xca866f['filters']=_[_0xa29d('0x32')](_0xca866f[_0xa29d('0x2f')],_0xca866f['query']);_0x5510e3[_0xa29d('0x33')]=_[_0xa29d('0x32')](_0xca866f[_0xa29d('0x2f')],qs[_0xa29d('0x34')](_0x5713b2[_0xa29d('0x35')][_0xa29d('0x34')]));_0x5510e3[_0xa29d('0x33')]=_0x5510e3[_0xa29d('0x33')]['length']?_0x5510e3[_0xa29d('0x33')]:_0xca866f[_0xa29d('0x2f')];if(!_0x5713b2[_0xa29d('0x35')]['hasOwnProperty']('nolimit')){_0x5510e3[_0xa29d('0x1d')]=qs[_0xa29d('0x1d')](_0x5713b2[_0xa29d('0x35')][_0xa29d('0x1d')]);_0x5510e3[_0xa29d('0x1e')]=qs['offset'](_0x5713b2[_0xa29d('0x35')][_0xa29d('0x1e')]);}_0x5510e3['order']=qs[_0xa29d('0x36')](_0x5713b2[_0xa29d('0x35')][_0xa29d('0x36')]);_0x5510e3['where']=qs[_0xa29d('0x37')](_['pick'](_0x5713b2[_0xa29d('0x35')],_0xca866f[_0xa29d('0x37')]),_0x4d9081);if(_0x5713b2['query']['filter']){_0x5510e3[_0xa29d('0x38')]=_[_0xa29d('0x39')](_0x5510e3[_0xa29d('0x38')],{'$or':_[_0xa29d('0x30')](_0x4d9081,function(_0x1fe1a4){if(_0x1fe1a4['type']!==_0xa29d('0x3a')){var _0x1c71e4={};_0x1c71e4[_0x1fe1a4[_0xa29d('0x28')]]={'$like':'%'+_0x5713b2[_0xa29d('0x35')][_0xa29d('0x3b')]+'%'};return _0x1c71e4;}})});}_0x5510e3=_[_0xa29d('0x39')]({},_0x5510e3,_0x5713b2[_0xa29d('0x3c')]);var _0x1c1311={'where':_0x5510e3[_0xa29d('0x38')]};return db[_0xa29d('0x3d')][_0xa29d('0x3e')](_0x1c1311)[_0xa29d('0x25')](function(_0x252eaa){_0x261dac['count']=_0x252eaa;if(_0x5713b2['query']['includeAll']){_0x5510e3[_0xa29d('0x3f')]=[{'all':!![]}];}return db[_0xa29d('0x3d')]['findAll'](_0x5510e3);})[_0xa29d('0x25')](function(_0x33a3e2){_0x261dac[_0xa29d('0x40')]=_0x33a3e2;return _0x261dac;})[_0xa29d('0x25')](respondWithFilteredResult(_0x365289,_0x5510e3))['catch'](handleError(_0x365289,null));};exports[_0xa29d('0x41')]=function(_0x3ce29e,_0x133389){var _0x440db5={'raw':![],'where':{'id':_0x3ce29e[_0xa29d('0x42')]['id']}},_0x4cce22={};_0x4cce22[_0xa29d('0x2f')]=_[_0xa29d('0x31')](db[_0xa29d('0x3d')][_0xa29d('0x2b')]);_0x4cce22[_0xa29d('0x35')]=_[_0xa29d('0x31')](_0x3ce29e['query']);_0x4cce22['filters']=_[_0xa29d('0x32')](_0x4cce22[_0xa29d('0x2f')],_0x4cce22['query']);_0x440db5[_0xa29d('0x33')]=_['intersection'](_0x4cce22[_0xa29d('0x2f')],qs['fields'](_0x3ce29e[_0xa29d('0x35')]['fields']));_0x440db5[_0xa29d('0x33')]=_0x440db5['attributes'][_0xa29d('0x43')]?_0x440db5[_0xa29d('0x33')]:_0x4cce22[_0xa29d('0x2f')];if(_0x3ce29e[_0xa29d('0x35')][_0xa29d('0x44')]){_0x440db5[_0xa29d('0x3f')]=[{'all':!![]}];}_0x440db5=_[_0xa29d('0x39')]({},_0x440db5,_0x3ce29e['options']);return db[_0xa29d('0x3d')][_0xa29d('0x45')](_0x440db5)[_0xa29d('0x25')](handleEntityNotFound(_0x133389,null))[_0xa29d('0x25')](respondWithResult(_0x133389,null))[_0xa29d('0x46')](handleError(_0x133389,null));};exports[_0xa29d('0x47')]=function(_0x4a11e5,_0x504eb3){return db[_0xa29d('0x3d')]['create'](_0x4a11e5[_0xa29d('0x48')],{})[_0xa29d('0x25')](respondWithResult(_0x504eb3,0xc9))[_0xa29d('0x46')](handleError(_0x504eb3,null));};exports[_0xa29d('0x24')]=function(_0x194da3,_0x5cd703){if(_0x194da3[_0xa29d('0x48')]['id']){delete _0x194da3[_0xa29d('0x48')]['id'];}return db[_0xa29d('0x3d')][_0xa29d('0x45')]({'where':{'id':_0x194da3['params']['id']}})['then'](handleEntityNotFound(_0x5cd703,null))[_0xa29d('0x25')](saveUpdates(_0x194da3[_0xa29d('0x48')],null))[_0xa29d('0x25')](respondWithResult(_0x5cd703,null))['catch'](handleError(_0x5cd703,null));};exports[_0xa29d('0x49')]=function(_0x440ff1,_0x4bd1df){return db['SalesforceAccount'][_0xa29d('0x45')]({'where':{'id':_0x440ff1['params']['id']}})[_0xa29d('0x25')](handleEntityNotFound(_0x4bd1df,null))[_0xa29d('0x25')](removeEntity(_0x4bd1df,null))['catch'](handleError(_0x4bd1df,null));};exports[_0xa29d('0x4a')]=function(_0x413075,_0x2a4242,_0x36305d){var _0x329317={};var _0x4054d5={};var _0x34cca1;var _0x167b85;return db[_0xa29d('0x3d')][_0xa29d('0x4b')]({'where':{'id':_0x413075['params']['id']}})[_0xa29d('0x25')](handleEntityNotFound(_0x2a4242,null))['then'](function(_0x5f1258){if(_0x5f1258){_0x34cca1=_0x5f1258;_0x4054d5[_0xa29d('0x2f')]=_[_0xa29d('0x31')](db['SalesforceConfiguration'][_0xa29d('0x2b')]);_0x4054d5['query']=_['keys'](_0x413075[_0xa29d('0x35')]);_0x4054d5[_0xa29d('0x37')]=_[_0xa29d('0x32')](_0x4054d5[_0xa29d('0x2f')],_0x4054d5[_0xa29d('0x35')]);_0x329317[_0xa29d('0x33')]=_['intersection'](_0x4054d5[_0xa29d('0x2f')],qs['fields'](_0x413075[_0xa29d('0x35')][_0xa29d('0x34')]));_0x329317['attributes']=_0x329317[_0xa29d('0x33')][_0xa29d('0x43')]?_0x329317[_0xa29d('0x33')]:_0x4054d5[_0xa29d('0x2f')];_0x329317['order']=qs[_0xa29d('0x36')](_0x413075['query']['sort']);_0x329317[_0xa29d('0x38')]=qs['filters'](_[_0xa29d('0x4c')](_0x413075[_0xa29d('0x35')],_0x4054d5[_0xa29d('0x37')]));if(_0x413075[_0xa29d('0x35')][_0xa29d('0x3b')]){_0x329317[_0xa29d('0x38')]=_[_0xa29d('0x39')](_0x329317['where'],{'$or':_[_0xa29d('0x30')](_0x329317[_0xa29d('0x33')],function(_0x297928){var _0x4bedba={};_0x4bedba[_0x297928]={'$like':'%'+_0x413075[_0xa29d('0x35')][_0xa29d('0x3b')]+'%'};return _0x4bedba;})});}_0x329317=_['merge']({},_0x329317,_0x413075[_0xa29d('0x3c')]);return _0x34cca1[_0xa29d('0x4a')](_0x329317);}})[_0xa29d('0x25')](function(_0x7fbdb8){if(_0x7fbdb8){_0x167b85=_0x7fbdb8[_0xa29d('0x43')];if(!_0x413075['query'][_0xa29d('0x4d')](_0xa29d('0x4e'))){_0x329317[_0xa29d('0x1d')]=qs[_0xa29d('0x1d')](_0x413075['query'][_0xa29d('0x1d')]);_0x329317[_0xa29d('0x1e')]=qs[_0xa29d('0x1e')](_0x413075[_0xa29d('0x35')]['offset']);}return _0x34cca1[_0xa29d('0x4a')](_0x329317);}})[_0xa29d('0x25')](function(_0x375a4e){if(_0x375a4e){return _0x375a4e?{'count':_0x167b85,'rows':_0x375a4e}:null;}})[_0xa29d('0x25')](respondWithResult(_0x2a4242,null))['catch'](handleError(_0x2a4242,null));};exports[_0xa29d('0x4f')]=function(_0x3ddcf5,_0x3d93ba,_0x316df0){if(_0x3ddcf5[_0xa29d('0x48')]['id']){delete _0x3ddcf5['body']['id'];}return db[_0xa29d('0x3d')]['findOne']({'where':{'id':_0x3ddcf5[_0xa29d('0x42')]['id']}})['then'](handleEntityNotFound(_0x3d93ba,null))[_0xa29d('0x25')](function(_0x3565b8){if(_0x3565b8){_0x3ddcf5[_0xa29d('0x48')]['AccountId']=_0x3565b8['id'];_0x3ddcf5[_0xa29d('0x48')][_0xa29d('0x50')]=integrations['getSubjects'](_0x3ddcf5[_0xa29d('0x48')][_0xa29d('0x51')],_0x3ddcf5[_0xa29d('0x48')][_0xa29d('0x2d')]);_0x3ddcf5[_0xa29d('0x48')][_0xa29d('0x52')]=integrations[_0xa29d('0x53')](_0x3ddcf5['body']['channel'],_0x3ddcf5[_0xa29d('0x48')][_0xa29d('0x2d')]);return db[_0xa29d('0x54')][_0xa29d('0x47')](_0x3ddcf5[_0xa29d('0x48')],{'include':[{'model':db[_0xa29d('0x55')],'as':'Subjects'},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xa29d('0x25')](respondWithResult(_0x3d93ba,null))['catch'](handleError(_0x3d93ba,null));};exports[_0xa29d('0x56')]=function(_0x352989,_0x44c375,_0x38839d){var _0x1fc21c;var _0x5f1d7c='';var _0x4e0370=_0xa29d('0x57');return db[_0xa29d('0x3d')][_0xa29d('0x4b')]({'where':{'id':_0x352989[_0xa29d('0x42')]['id']},'attributes':['id',_0xa29d('0x58'),_0xa29d('0x59'),'clientSecret',_0xa29d('0x5a'),_0xa29d('0x5b'),_0xa29d('0x5c')]})[_0xa29d('0x25')](handleEntityNotFound(_0x44c375,null))[_0xa29d('0x25')](function(_0xb53bea){if(_0xb53bea){_0x5f1d7c=_0xb53bea['remoteUri'];var _0x2a2192=_0x5f1d7c[_0xa29d('0x5d')](-0x1);if(_0x2a2192==='/'){_0x5f1d7c=_0x5f1d7c[_0xa29d('0x5e')](0x0,_0x5f1d7c[_0xa29d('0x5f')](_0x2a2192));}_0x1fc21c=new jsforce[(_0xa29d('0x60'))]({'oauth2':{'loginUrl':_0x5f1d7c,'clientId':_0xb53bea[_0xa29d('0x59')],'clientSecret':_0xb53bea['clientSecret']}});return _0x1fc21c['login'](_0xb53bea['username'],_0xb53bea[_0xa29d('0x5b')][_0xa29d('0x61')](_0xb53bea[_0xa29d('0x5c')]));}})[_0xa29d('0x25')](function(_0x181884){if(_0x181884){if(!_[_0xa29d('0x62')](_0x352989[_0xa29d('0x35')]['ticketType'])){_0x4e0370=_0x352989['query'][_0xa29d('0x63')];}return _0x1fc21c['sobject'](_0x4e0370)['describe']();}})['then'](function(_0x4cc7b8){var _0x5f27f3=[_0xa29d('0x64'),_0xa29d('0x65'),'IsReminderSet',_0xa29d('0x66'),_0xa29d('0x67'),_0xa29d('0x68')];var _0x32ddd7=[_0xa29d('0x69'),'int',_0xa29d('0x6a'),_0xa29d('0x6b'),_0xa29d('0x6c'),_0xa29d('0x6d'),_0xa29d('0x6e')];if(_0x4cc7b8){_[_0xa29d('0x6f')](_0x4cc7b8[_0xa29d('0x34')],function(_0x1321e3){return _0x5f27f3['includes'](_0x1321e3[_0xa29d('0x28')])||!_0x32ddd7[_0xa29d('0x70')](_0x1321e3[_0xa29d('0x2d')]);});return{'count':_0x4cc7b8['fields'][_0xa29d('0x43')],'rows':_[_0xa29d('0x30')](_0x4cc7b8['fields'],function(_0x391c98){return{'id':_0x391c98[_0xa29d('0x28')],'name':_0x391c98[_0xa29d('0x71')],'custom':_0x391c98[_0xa29d('0x72')],'options':_0x391c98[_0xa29d('0x73')][_0xa29d('0x43')]>0x0?_[_0xa29d('0x30')](_0x391c98[_0xa29d('0x73')],function(_0x353665){return{'name':_0x353665[_0xa29d('0x71')],'value':_0x353665[_0xa29d('0x74')]};}):_0x391c98['type']=='boolean'?[{'name':_0xa29d('0x75'),'value':_0xa29d('0x76')},{'name':_0xa29d('0x77'),'value':_0xa29d('0x78')}]:[]};})};}})[_0xa29d('0x25')](respondWithResult(_0x44c375,null))[_0xa29d('0x46')](function(_0x3d89ff){var _0x2978be=_0x352989[_0xa29d('0x35')][_0xa29d('0x79')]?0x1f4:_0x3d89ff[_0xa29d('0x7a')]||0x1f4;logger[_0xa29d('0x26')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2978be,JSON['stringify'](_0x3d89ff));delete _0x3d89ff['name'];if(_0x2978be===0x191){_0x2978be=0x190;}_0x44c375[_0xa29d('0x1a')](_0x2978be)['send'](_0x352989[_0xa29d('0x35')][_0xa29d('0x79')]?{'message':_0xa29d('0x7b'),'statusCode':_0x3d89ff[_0xa29d('0x7a')]}:_0x3d89ff);});};
\ No newline at end of file
+var _0xd2c1=['clientSecret','password','remoteUri','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','ActivityDate','IsRecurrence','Subject','Description','string','int','boolean','email','phone','remove','label','custom','picklistValues','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','SalesforceAccount','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','update','destroy','getConfigurations','findOne','SalesforceConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','clientId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd2c1,0x9c));var _0x1d2c=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0xd2c1[_0x1809c5];return _0x5254a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1d2c('0x0'));var zipdir=require(_0x1d2c('0x1'));var jsonpatch=require(_0x1d2c('0x2'));var rp=require(_0x1d2c('0x3'));var moment=require('moment');var BPromise=require(_0x1d2c('0x4'));var Mustache=require(_0x1d2c('0x5'));var util=require(_0x1d2c('0x6'));var path=require(_0x1d2c('0x7'));var sox=require(_0x1d2c('0x8'));var csv=require('to-csv');var ejs=require(_0x1d2c('0x9'));var fs=require('fs');var fs_extra=require(_0x1d2c('0xa'));var _=require(_0x1d2c('0xb'));var squel=require(_0x1d2c('0xc'));var crypto=require('crypto');var jsforce=require(_0x1d2c('0xd'));var deskjs=require(_0x1d2c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1d2c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1d2c('0x10'));var qs=require(_0x1d2c('0x11'));var as=require(_0x1d2c('0x12'));var hardwareService=require(_0x1d2c('0x13'));var logger=require('../../config/logger')(_0x1d2c('0x14'));var utils=require(_0x1d2c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1d2c('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1aa09a,_0x333f7f){_0x333f7f=_0x333f7f||0xcc;return function(_0x5414d7){if(_0x5414d7){return _0x1aa09a[_0x1d2c('0x17')](_0x333f7f);}return _0x1aa09a[_0x1d2c('0x18')](_0x333f7f)['end']();};}function respondWithResult(_0x3f73a1,_0x4b8565){_0x4b8565=_0x4b8565||0xc8;return function(_0x211af1){if(_0x211af1){return _0x3f73a1['status'](_0x4b8565)[_0x1d2c('0x19')](_0x211af1);}};}function respondWithFilteredResult(_0x39596c,_0x24fba2){return function(_0x36e8bc){if(_0x36e8bc){var _0x570225=typeof _0x24fba2[_0x1d2c('0x1a')]==='undefined'&&typeof _0x24fba2[_0x1d2c('0x1b')]==='undefined';var _0x151661=_0x36e8bc[_0x1d2c('0x1c')];var _0x4f0276=_0x570225?0x0:_0x24fba2['offset'];var _0x443229=_0x570225?_0x36e8bc[_0x1d2c('0x1c')]:_0x24fba2[_0x1d2c('0x1a')]+_0x24fba2['limit'];var _0x4bc5b9;if(_0x443229>=_0x151661){_0x443229=_0x151661;_0x4bc5b9=0xc8;}else{_0x4bc5b9=0xce;}_0x39596c[_0x1d2c('0x18')](_0x4bc5b9);return _0x39596c[_0x1d2c('0x1d')](_0x1d2c('0x1e'),_0x4f0276+'-'+_0x443229+'/'+_0x151661)[_0x1d2c('0x19')](_0x36e8bc);}return null;};}function patchUpdates(_0xc07a70){return function(_0x4d5471){try{jsonpatch[_0x1d2c('0x1f')](_0x4d5471,_0xc07a70,!![]);}catch(_0x29db55){return BPromise[_0x1d2c('0x20')](_0x29db55);}return _0x4d5471[_0x1d2c('0x21')]();};}function saveUpdates(_0x4533db,_0x492c79){return function(_0x2a3a84){if(_0x2a3a84){return _0x2a3a84['update'](_0x4533db)[_0x1d2c('0x22')](function(_0x559b71){return _0x559b71;});}return null;};}function removeEntity(_0x270b3f,_0x312dff){return function(_0x125bc1){if(_0x125bc1){return _0x125bc1['destroy']()['then'](function(){_0x270b3f['status'](0xcc)[_0x1d2c('0x23')]();});}};}function handleEntityNotFound(_0xcb87f5,_0x4a827a){return function(_0x249991){if(!_0x249991){_0xcb87f5['sendStatus'](0x194);}return _0x249991;};}function handleError(_0x10d133,_0x7fc916){_0x7fc916=_0x7fc916||0x1f4;return function(_0x24423a){logger[_0x1d2c('0x24')](_0x24423a[_0x1d2c('0x25')]);if(_0x24423a[_0x1d2c('0x26')]){delete _0x24423a['name'];}_0x10d133[_0x1d2c('0x18')](_0x7fc916)[_0x1d2c('0x27')](_0x24423a);};}exports[_0x1d2c('0x28')]=function(_0x590e9e,_0x119c38){var _0x201535={},_0x2fb4fe={},_0x41f7a6={'count':0x0,'rows':[]};var _0x8a8578=_['map'](db[_0x1d2c('0x29')][_0x1d2c('0x2a')],function(_0x198236){return{'name':_0x198236[_0x1d2c('0x2b')],'type':_0x198236['type'][_0x1d2c('0x2c')]};});_0x2fb4fe[_0x1d2c('0x2d')]=_[_0x1d2c('0x2e')](_0x8a8578,'name');_0x2fb4fe[_0x1d2c('0x2f')]=_['keys'](_0x590e9e['query']);_0x2fb4fe[_0x1d2c('0x30')]=_[_0x1d2c('0x31')](_0x2fb4fe[_0x1d2c('0x2d')],_0x2fb4fe[_0x1d2c('0x2f')]);_0x201535[_0x1d2c('0x32')]=_[_0x1d2c('0x31')](_0x2fb4fe[_0x1d2c('0x2d')],qs[_0x1d2c('0x33')](_0x590e9e['query'][_0x1d2c('0x33')]));_0x201535[_0x1d2c('0x32')]=_0x201535[_0x1d2c('0x32')][_0x1d2c('0x34')]?_0x201535[_0x1d2c('0x32')]:_0x2fb4fe[_0x1d2c('0x2d')];if(!_0x590e9e[_0x1d2c('0x2f')]['hasOwnProperty']('nolimit')){_0x201535[_0x1d2c('0x1b')]=qs[_0x1d2c('0x1b')](_0x590e9e[_0x1d2c('0x2f')][_0x1d2c('0x1b')]);_0x201535[_0x1d2c('0x1a')]=qs[_0x1d2c('0x1a')](_0x590e9e[_0x1d2c('0x2f')]['offset']);}_0x201535[_0x1d2c('0x35')]=qs[_0x1d2c('0x36')](_0x590e9e[_0x1d2c('0x2f')]['sort']);_0x201535[_0x1d2c('0x37')]=qs[_0x1d2c('0x30')](_[_0x1d2c('0x38')](_0x590e9e['query'],_0x2fb4fe[_0x1d2c('0x30')]),_0x8a8578);if(_0x590e9e[_0x1d2c('0x2f')][_0x1d2c('0x39')]){_0x201535['where']=_[_0x1d2c('0x3a')](_0x201535[_0x1d2c('0x37')],{'$or':_[_0x1d2c('0x2e')](_0x8a8578,function(_0x523f4b){if(_0x523f4b[_0x1d2c('0x3b')]!==_0x1d2c('0x3c')){var _0x4724d2={};_0x4724d2[_0x523f4b['name']]={'$like':'%'+_0x590e9e[_0x1d2c('0x2f')][_0x1d2c('0x39')]+'%'};return _0x4724d2;}})});}_0x201535=_['merge']({},_0x201535,_0x590e9e[_0x1d2c('0x3d')]);var _0x123a17={'where':_0x201535[_0x1d2c('0x37')]};return db[_0x1d2c('0x29')][_0x1d2c('0x1c')](_0x123a17)[_0x1d2c('0x22')](function(_0x2728f2){_0x41f7a6[_0x1d2c('0x1c')]=_0x2728f2;if(_0x590e9e[_0x1d2c('0x2f')][_0x1d2c('0x3e')]){_0x201535[_0x1d2c('0x3f')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x1d2c('0x40')](_0x201535);})[_0x1d2c('0x22')](function(_0x23de02){_0x41f7a6[_0x1d2c('0x41')]=_0x23de02;return _0x41f7a6;})['then'](respondWithFilteredResult(_0x119c38,_0x201535))[_0x1d2c('0x42')](handleError(_0x119c38,null));};exports['show']=function(_0xfe88a7,_0x171e8e){var _0x4b414a={'raw':![],'where':{'id':_0xfe88a7[_0x1d2c('0x43')]['id']}},_0x287d9e={};_0x287d9e['model']=_[_0x1d2c('0x44')](db[_0x1d2c('0x29')][_0x1d2c('0x2a')]);_0x287d9e[_0x1d2c('0x2f')]=_[_0x1d2c('0x44')](_0xfe88a7[_0x1d2c('0x2f')]);_0x287d9e[_0x1d2c('0x30')]=_[_0x1d2c('0x31')](_0x287d9e[_0x1d2c('0x2d')],_0x287d9e[_0x1d2c('0x2f')]);_0x4b414a[_0x1d2c('0x32')]=_[_0x1d2c('0x31')](_0x287d9e[_0x1d2c('0x2d')],qs[_0x1d2c('0x33')](_0xfe88a7['query'][_0x1d2c('0x33')]));_0x4b414a[_0x1d2c('0x32')]=_0x4b414a['attributes']['length']?_0x4b414a[_0x1d2c('0x32')]:_0x287d9e[_0x1d2c('0x2d')];if(_0xfe88a7[_0x1d2c('0x2f')][_0x1d2c('0x3e')]){_0x4b414a['include']=[{'all':!![]}];}_0x4b414a=_[_0x1d2c('0x3a')]({},_0x4b414a,_0xfe88a7[_0x1d2c('0x3d')]);return db[_0x1d2c('0x29')][_0x1d2c('0x45')](_0x4b414a)['then'](handleEntityNotFound(_0x171e8e,null))[_0x1d2c('0x22')](respondWithResult(_0x171e8e,null))[_0x1d2c('0x42')](handleError(_0x171e8e,null));};exports[_0x1d2c('0x46')]=function(_0x42f4de,_0x509c90){return db[_0x1d2c('0x29')][_0x1d2c('0x46')](_0x42f4de[_0x1d2c('0x47')],{})[_0x1d2c('0x22')](respondWithResult(_0x509c90,0xc9))['catch'](handleError(_0x509c90,null));};exports[_0x1d2c('0x48')]=function(_0x42a575,_0x314fb9){if(_0x42a575['body']['id']){delete _0x42a575['body']['id'];}return db[_0x1d2c('0x29')]['find']({'where':{'id':_0x42a575[_0x1d2c('0x43')]['id']}})[_0x1d2c('0x22')](handleEntityNotFound(_0x314fb9,null))[_0x1d2c('0x22')](saveUpdates(_0x42a575[_0x1d2c('0x47')],null))[_0x1d2c('0x22')](respondWithResult(_0x314fb9,null))[_0x1d2c('0x42')](handleError(_0x314fb9,null));};exports[_0x1d2c('0x49')]=function(_0x448452,_0x4ac65d){return db[_0x1d2c('0x29')][_0x1d2c('0x45')]({'where':{'id':_0x448452[_0x1d2c('0x43')]['id']}})[_0x1d2c('0x22')](handleEntityNotFound(_0x4ac65d,null))[_0x1d2c('0x22')](removeEntity(_0x4ac65d,null))[_0x1d2c('0x42')](handleError(_0x4ac65d,null));};exports[_0x1d2c('0x4a')]=function(_0x5c176d,_0x3171e9,_0x396c69){var _0x3bb1ff={};var _0x18acba={};var _0x575198;var _0x43d7cd;return db['SalesforceAccount'][_0x1d2c('0x4b')]({'where':{'id':_0x5c176d['params']['id']}})['then'](handleEntityNotFound(_0x3171e9,null))[_0x1d2c('0x22')](function(_0x57b905){if(_0x57b905){_0x575198=_0x57b905;_0x18acba[_0x1d2c('0x2d')]=_[_0x1d2c('0x44')](db[_0x1d2c('0x4c')]['rawAttributes']);_0x18acba[_0x1d2c('0x2f')]=_[_0x1d2c('0x44')](_0x5c176d[_0x1d2c('0x2f')]);_0x18acba[_0x1d2c('0x30')]=_[_0x1d2c('0x31')](_0x18acba[_0x1d2c('0x2d')],_0x18acba[_0x1d2c('0x2f')]);_0x3bb1ff[_0x1d2c('0x32')]=_['intersection'](_0x18acba[_0x1d2c('0x2d')],qs[_0x1d2c('0x33')](_0x5c176d['query'][_0x1d2c('0x33')]));_0x3bb1ff['attributes']=_0x3bb1ff[_0x1d2c('0x32')][_0x1d2c('0x34')]?_0x3bb1ff['attributes']:_0x18acba['model'];_0x3bb1ff[_0x1d2c('0x35')]=qs[_0x1d2c('0x36')](_0x5c176d[_0x1d2c('0x2f')][_0x1d2c('0x36')]);_0x3bb1ff['where']=qs['filters'](_[_0x1d2c('0x38')](_0x5c176d[_0x1d2c('0x2f')],_0x18acba['filters']));if(_0x5c176d[_0x1d2c('0x2f')]['filter']){_0x3bb1ff[_0x1d2c('0x37')]=_[_0x1d2c('0x3a')](_0x3bb1ff['where'],{'$or':_[_0x1d2c('0x2e')](_0x3bb1ff[_0x1d2c('0x32')],function(_0x5ce159){var _0x4eef3c={};_0x4eef3c[_0x5ce159]={'$like':'%'+_0x5c176d['query'][_0x1d2c('0x39')]+'%'};return _0x4eef3c;})});}_0x3bb1ff=_[_0x1d2c('0x3a')]({},_0x3bb1ff,_0x5c176d['options']);return _0x575198[_0x1d2c('0x4a')](_0x3bb1ff);}})['then'](function(_0x1b8d05){if(_0x1b8d05){_0x43d7cd=_0x1b8d05[_0x1d2c('0x34')];if(!_0x5c176d['query']['hasOwnProperty'](_0x1d2c('0x4d'))){_0x3bb1ff[_0x1d2c('0x1b')]=qs[_0x1d2c('0x1b')](_0x5c176d[_0x1d2c('0x2f')]['limit']);_0x3bb1ff[_0x1d2c('0x1a')]=qs[_0x1d2c('0x1a')](_0x5c176d[_0x1d2c('0x2f')]['offset']);}return _0x575198[_0x1d2c('0x4a')](_0x3bb1ff);}})[_0x1d2c('0x22')](function(_0x3439db){if(_0x3439db){return _0x3439db?{'count':_0x43d7cd,'rows':_0x3439db}:null;}})['then'](respondWithResult(_0x3171e9,null))[_0x1d2c('0x42')](handleError(_0x3171e9,null));};exports[_0x1d2c('0x4e')]=function(_0x55f975,_0x921520,_0x33b196){if(_0x55f975[_0x1d2c('0x47')]['id']){delete _0x55f975[_0x1d2c('0x47')]['id'];}return db[_0x1d2c('0x29')][_0x1d2c('0x4b')]({'where':{'id':_0x55f975[_0x1d2c('0x43')]['id']}})[_0x1d2c('0x22')](handleEntityNotFound(_0x921520,null))[_0x1d2c('0x22')](function(_0x30bb46){if(_0x30bb46){_0x55f975[_0x1d2c('0x47')][_0x1d2c('0x4f')]=_0x30bb46['id'];_0x55f975['body'][_0x1d2c('0x50')]=integrations[_0x1d2c('0x51')](_0x55f975[_0x1d2c('0x47')][_0x1d2c('0x52')],_0x55f975[_0x1d2c('0x47')][_0x1d2c('0x3b')]);_0x55f975['body'][_0x1d2c('0x53')]=integrations[_0x1d2c('0x54')](_0x55f975[_0x1d2c('0x47')]['channel'],_0x55f975[_0x1d2c('0x47')][_0x1d2c('0x3b')]);return db[_0x1d2c('0x4c')]['create'](_0x55f975[_0x1d2c('0x47')],{'include':[{'model':db[_0x1d2c('0x55')],'as':'Subjects'},{'model':db[_0x1d2c('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x921520,null))[_0x1d2c('0x42')](handleError(_0x921520,null));};exports[_0x1d2c('0x56')]=function(_0x4de864,_0x30458a,_0x3d7355){var _0x56fea4;var _0x1d3a1e='';var _0xf997a5='Task';return db[_0x1d2c('0x29')][_0x1d2c('0x4b')]({'where':{'id':_0x4de864[_0x1d2c('0x43')]['id']},'attributes':['id','remoteUri',_0x1d2c('0x57'),_0x1d2c('0x58'),'username',_0x1d2c('0x59'),'securityToken']})[_0x1d2c('0x22')](handleEntityNotFound(_0x30458a,null))[_0x1d2c('0x22')](function(_0x513006){if(_0x513006){_0x1d3a1e=_0x513006[_0x1d2c('0x5a')];var _0x162ccc=_0x1d3a1e[_0x1d2c('0x5b')](-0x1);if(_0x162ccc==='/'){_0x1d3a1e=_0x1d3a1e[_0x1d2c('0x5c')](0x0,_0x1d3a1e[_0x1d2c('0x5d')](_0x162ccc));}_0x56fea4=new jsforce[(_0x1d2c('0x5e'))]({'oauth2':{'loginUrl':_0x1d3a1e,'clientId':_0x513006['clientId'],'clientSecret':_0x513006[_0x1d2c('0x58')]}});return _0x56fea4[_0x1d2c('0x5f')](_0x513006['username'],_0x513006[_0x1d2c('0x59')][_0x1d2c('0x60')](_0x513006['securityToken']));}})['then'](function(_0x5256d2){if(_0x5256d2){if(!_[_0x1d2c('0x61')](_0x4de864['query'][_0x1d2c('0x62')])){_0xf997a5=_0x4de864[_0x1d2c('0x2f')][_0x1d2c('0x62')];}return _0x56fea4[_0x1d2c('0x63')](_0xf997a5)[_0x1d2c('0x64')]();}})[_0x1d2c('0x22')](function(_0x464948){var _0x27490f=['OwnerId',_0x1d2c('0x65'),'IsReminderSet',_0x1d2c('0x66'),_0x1d2c('0x67'),_0x1d2c('0x68')];var _0x243c1c=[_0x1d2c('0x69'),_0x1d2c('0x6a'),'picklist',_0x1d2c('0x6b'),_0x1d2c('0x6c'),'textarea',_0x1d2c('0x6d')];if(_0x464948){_[_0x1d2c('0x6e')](_0x464948[_0x1d2c('0x33')],function(_0x1597a0){return _0x27490f['includes'](_0x1597a0['name'])||!_0x243c1c['includes'](_0x1597a0[_0x1d2c('0x3b')]);});return{'count':_0x464948['fields'][_0x1d2c('0x34')],'rows':_[_0x1d2c('0x2e')](_0x464948[_0x1d2c('0x33')],function(_0x118fc6){return{'id':_0x118fc6[_0x1d2c('0x26')],'name':_0x118fc6[_0x1d2c('0x6f')],'custom':_0x118fc6[_0x1d2c('0x70')],'options':_0x118fc6[_0x1d2c('0x71')]['length']>0x0?_[_0x1d2c('0x2e')](_0x118fc6[_0x1d2c('0x71')],function(_0x5d8660){return{'name':_0x5d8660['label'],'value':_0x5d8660['value']};}):_0x118fc6['type']=='boolean'?[{'name':_0x1d2c('0x72'),'value':_0x1d2c('0x73')},{'name':'False','value':_0x1d2c('0x74')}]:[]};})};}})[_0x1d2c('0x22')](respondWithResult(_0x30458a,null))[_0x1d2c('0x42')](function(_0x4e8b1d){var _0x4def91=_0x4de864[_0x1d2c('0x2f')][_0x1d2c('0x75')]?0x1f4:_0x4e8b1d[_0x1d2c('0x76')]||0x1f4;logger[_0x1d2c('0x24')](_0x1d2c('0x77'),_0x1d2c('0x56'),_0x4def91,JSON[_0x1d2c('0x78')](_0x4e8b1d));delete _0x4e8b1d[_0x1d2c('0x26')];if(_0x4def91===0x191){_0x4def91=0x190;}_0x30458a[_0x1d2c('0x18')](_0x4def91)['send'](_0x4de864[_0x1d2c('0x2f')][_0x1d2c('0x75')]?{'message':_0x1d2c('0x79'),'statusCode':_0x4e8b1d[_0x1d2c('0x76')]}:_0x4e8b1d);});};
\ No newline at end of file
index 8306cc2..13a24d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65e9=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash'];(function(_0x5bdd45,_0x174a62){var _0x387fb5=function(_0x20736d){while(--_0x20736d){_0x5bdd45['push'](_0x5bdd45['shift']());}};_0x387fb5(++_0x174a62);}(_0x65e9,0x15e));var _0x965e=function(_0x43f390,_0x11bda7){_0x43f390=_0x43f390-0x0;var _0x199a49=_0x65e9[_0x43f390];return _0x199a49;};'use strict';var _=require(_0x965e('0x0'));var util=require(_0x965e('0x1'));var logger=require('../../config/logger')(_0x965e('0x2'));var moment=require(_0x965e('0x3'));var BPromise=require(_0x965e('0x4'));var rp=require(_0x965e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x965e('0x6'));var config=require(_0x965e('0x7'));var attributes=require(_0x965e('0x8'));var integrations=require(_0x965e('0x9'));module[_0x965e('0xa')]=function(_0x363e45,_0xa623d5){return _0x363e45[_0x965e('0xb')](_0x965e('0xc'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3cfb=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','int_salesforce_accounts','lodash','util'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x25b3ba,_0x235648){_0x25b3ba=_0x25b3ba-0x0;var _0x83d48=_0x3cfb[_0x25b3ba];return _0x83d48;};'use strict';var _=require(_0xb3cf('0x0'));var util=require(_0xb3cf('0x1'));var logger=require(_0xb3cf('0x2'))(_0xb3cf('0x3'));var moment=require(_0xb3cf('0x4'));var BPromise=require(_0xb3cf('0x5'));var rp=require(_0xb3cf('0x6'));var fs=require('fs');var path=require(_0xb3cf('0x7'));var rimraf=require('rimraf');var config=require(_0xb3cf('0x8'));var attributes=require(_0xb3cf('0x9'));var integrations=require(_0xb3cf('0xa'));module['exports']=function(_0x2e5c00,_0x1b7131){return _0x2e5c00[_0xb3cf('0xb')]('SalesforceAccount',attributes,{'tableName':_0xb3cf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6a800ab..9f2a6bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8187=['map','model','info','debug','stringify','ShowSalesforceAccount','SalesforceAccount','find','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSalesforceAccount','options','raw','where','attributes','limit','include'];(function(_0x3d129d,_0x49ff92){var _0xabba38=function(_0x49eea9){while(--_0x49eea9){_0x3d129d['push'](_0x3d129d['shift']());}};_0xabba38(++_0x49ff92);}(_0x8187,0xfd));var _0x7818=function(_0x40b162,_0x51a74d){_0x40b162=_0x40b162-0x0;var _0x1a5e44=_0x8187[_0x40b162];return _0x1a5e44;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7818('0x0'));var BPromise=require('bluebird');var rs=require(_0x7818('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7818('0x2'))['db'];var utils=require(_0x7818('0x3'));var logger=require(_0x7818('0x4'))(_0x7818('0x5'));var config=require(_0x7818('0x6'));var jayson=require(_0x7818('0x7'));var client=jayson[_0x7818('0x8')][_0x7818('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1273a8,_0x5cd093,_0x39ced9){return new BPromise(function(_0xd5df33,_0x2e4f38){return client[_0x7818('0xa')](_0x1273a8,_0x39ced9)[_0x7818('0xb')](function(_0x2143c8){logger['info'](_0x7818('0xc'),_0x5cd093,_0x7818('0xd'));logger['debug'](_0x7818('0xe'),_0x5cd093,_0x7818('0xd'),JSON['stringify'](_0x2143c8));if(_0x2143c8[_0x7818('0xf')]){if(_0x2143c8['error'][_0x7818('0x10')]===0x1f4){logger['error'](_0x7818('0xc'),_0x5cd093,_0x2143c8['error'][_0x7818('0x11')]);return _0x2e4f38(_0x2143c8[_0x7818('0xf')][_0x7818('0x11')]);}logger[_0x7818('0xf')](_0x7818('0xc'),_0x5cd093,_0x2143c8[_0x7818('0xf')][_0x7818('0x11')]);return _0xd5df33(_0x2143c8[_0x7818('0xf')][_0x7818('0x11')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x5cd093,_0x7818('0xd'));_0xd5df33(_0x2143c8[_0x7818('0x12')]['message']);}})[_0x7818('0x13')](function(_0x4d63c6){logger[_0x7818('0xf')](_0x7818('0xc'),_0x5cd093,_0x4d63c6);_0x2e4f38(_0x4d63c6);});});}exports[_0x7818('0x14')]=function(_0x4b6300){var _0x3f1504=this;return new Promise(function(_0x4344a9,_0x503068){return db['SalesforceAccount']['findAll']({'raw':_0x4b6300['options']?_0x4b6300[_0x7818('0x15')][_0x7818('0x16')]===undefined?!![]:![]:!![],'where':_0x4b6300[_0x7818('0x15')]?_0x4b6300[_0x7818('0x15')][_0x7818('0x17')]||null:null,'attributes':_0x4b6300[_0x7818('0x15')]?_0x4b6300['options'][_0x7818('0x18')]||null:null,'limit':_0x4b6300[_0x7818('0x15')]?_0x4b6300[_0x7818('0x15')][_0x7818('0x19')]||null:null,'include':_0x4b6300[_0x7818('0x15')]?_0x4b6300[_0x7818('0x15')][_0x7818('0x1a')]?_[_0x7818('0x1b')](_0x4b6300[_0x7818('0x15')][_0x7818('0x1a')],function(_0x5a689b){return{'model':db[_0x5a689b['model']],'as':_0x5a689b['as'],'attributes':_0x5a689b[_0x7818('0x18')],'include':_0x5a689b[_0x7818('0x1a')]?_[_0x7818('0x1b')](_0x5a689b[_0x7818('0x1a')],function(_0x241f45){return{'model':db[_0x241f45[_0x7818('0x1c')]],'as':_0x241f45['as'],'attributes':_0x241f45[_0x7818('0x18')],'include':_0x241f45['include']?_['map'](_0x241f45[_0x7818('0x1a')],function(_0x544e2a){return{'model':db[_0x544e2a[_0x7818('0x1c')]],'as':_0x544e2a['as'],'attributes':_0x544e2a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b9591){logger[_0x7818('0x1d')](_0x7818('0x14'),_0x4b6300);logger[_0x7818('0x1e')](_0x7818('0x14'),_0x4b6300,JSON[_0x7818('0x1f')](_0x4b9591));_0x4344a9(_0x4b9591);})[_0x7818('0x13')](function(_0x1d8ae0){logger['error'](_0x7818('0x14'),_0x1d8ae0[_0x7818('0x11')],_0x4b6300);_0x503068(_0x3f1504[_0x7818('0xf')](0x1f4,_0x1d8ae0[_0x7818('0x11')]));});});};exports[_0x7818('0x20')]=function(_0x59c1d8){var _0x1510b7=this;return new Promise(function(_0x4e40a8,_0x4428a0){return db[_0x7818('0x21')][_0x7818('0x22')]({'raw':_0x59c1d8[_0x7818('0x15')]?_0x59c1d8[_0x7818('0x15')][_0x7818('0x16')]===undefined?!![]:![]:!![],'where':_0x59c1d8[_0x7818('0x15')]?_0x59c1d8[_0x7818('0x15')][_0x7818('0x17')]||null:null,'attributes':_0x59c1d8[_0x7818('0x15')]?_0x59c1d8[_0x7818('0x15')][_0x7818('0x18')]||null:null,'include':_0x59c1d8[_0x7818('0x15')]?_0x59c1d8['options'][_0x7818('0x1a')]?_[_0x7818('0x1b')](_0x59c1d8[_0x7818('0x15')][_0x7818('0x1a')],function(_0x41bf4e){return{'model':db[_0x41bf4e[_0x7818('0x1c')]],'as':_0x41bf4e['as'],'attributes':_0x41bf4e[_0x7818('0x18')],'include':_0x41bf4e[_0x7818('0x1a')]?_[_0x7818('0x1b')](_0x41bf4e['include'],function(_0x3c8d62){return{'model':db[_0x3c8d62[_0x7818('0x1c')]],'as':_0x3c8d62['as'],'attributes':_0x3c8d62['attributes'],'include':_0x3c8d62['include']?_[_0x7818('0x1b')](_0x3c8d62[_0x7818('0x1a')],function(_0x32e232){return{'model':db[_0x32e232[_0x7818('0x1c')]],'as':_0x32e232['as'],'attributes':_0x32e232['attributes']};}):[]};}):[]};}):[]:[]})[_0x7818('0xb')](function(_0x500c82){logger[_0x7818('0x1d')](_0x7818('0x20'),_0x59c1d8);logger[_0x7818('0x1e')](_0x7818('0x20'),_0x59c1d8,JSON[_0x7818('0x1f')](_0x500c82));_0x4e40a8(_0x500c82);})[_0x7818('0x13')](function(_0xb0148d){logger[_0x7818('0xf')](_0x7818('0x20'),_0xb0148d[_0x7818('0x11')],_0x59c1d8);_0x4428a0(_0x1510b7[_0x7818('0xf')](0x1f4,_0xb0148d['message']));});});};
\ No newline at end of file
+var _0x92da=['then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x92da,0x166));var _0xa92d=function(_0x123cbe,_0x42e73e){_0x123cbe=_0x123cbe-0x0;var _0x3ff306=_0x92da[_0x123cbe];return _0x3ff306;};'use strict';var _=require(_0xa92d('0x0'));var util=require(_0xa92d('0x1'));var moment=require(_0xa92d('0x2'));var BPromise=require(_0xa92d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa92d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa92d('0x5'))(_0xa92d('0x6'));var config=require(_0xa92d('0x7'));var jayson=require(_0xa92d('0x8'));var client=jayson[_0xa92d('0x9')][_0xa92d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34eaa3,_0x4cb2d8,_0x22bb21){return new BPromise(function(_0x2b85cf,_0x8ee38e){return client[_0xa92d('0xb')](_0x34eaa3,_0x22bb21)[_0xa92d('0xc')](function(_0x10d1d6){logger[_0xa92d('0xd')](_0xa92d('0xe'),_0x4cb2d8,_0xa92d('0xf'));logger['debug'](_0xa92d('0x10'),_0x4cb2d8,_0xa92d('0xf'),JSON[_0xa92d('0x11')](_0x10d1d6));if(_0x10d1d6[_0xa92d('0x12')]){if(_0x10d1d6[_0xa92d('0x12')][_0xa92d('0x13')]===0x1f4){logger[_0xa92d('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x4cb2d8,_0x10d1d6[_0xa92d('0x12')][_0xa92d('0x14')]);return _0x8ee38e(_0x10d1d6[_0xa92d('0x12')][_0xa92d('0x14')]);}logger[_0xa92d('0x12')](_0xa92d('0xe'),_0x4cb2d8,_0x10d1d6[_0xa92d('0x12')][_0xa92d('0x14')]);return _0x2b85cf(_0x10d1d6[_0xa92d('0x12')][_0xa92d('0x14')]);}else{logger[_0xa92d('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x4cb2d8,_0xa92d('0xf'));_0x2b85cf(_0x10d1d6[_0xa92d('0x15')][_0xa92d('0x14')]);}})[_0xa92d('0x16')](function(_0x9c1c2b){logger['error'](_0xa92d('0xe'),_0x4cb2d8,_0x9c1c2b);_0x8ee38e(_0x9c1c2b);});});}exports[_0xa92d('0x17')]=function(_0x4881f8){var _0x279818=this;return new Promise(function(_0x1912ef,_0x551419){return db[_0xa92d('0x18')][_0xa92d('0x19')]({'raw':_0x4881f8['options']?_0x4881f8[_0xa92d('0x1a')][_0xa92d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4881f8['options']?_0x4881f8[_0xa92d('0x1a')][_0xa92d('0x1c')]||null:null,'attributes':_0x4881f8[_0xa92d('0x1a')]?_0x4881f8['options'][_0xa92d('0x1d')]||null:null,'limit':_0x4881f8[_0xa92d('0x1a')]?_0x4881f8[_0xa92d('0x1a')][_0xa92d('0x1e')]||null:null,'include':_0x4881f8['options']?_0x4881f8['options'][_0xa92d('0x1f')]?_[_0xa92d('0x20')](_0x4881f8[_0xa92d('0x1a')]['include'],function(_0x3703b4){return{'model':db[_0x3703b4[_0xa92d('0x21')]],'as':_0x3703b4['as'],'attributes':_0x3703b4['attributes'],'include':_0x3703b4[_0xa92d('0x1f')]?_[_0xa92d('0x20')](_0x3703b4[_0xa92d('0x1f')],function(_0x3993e2){return{'model':db[_0x3993e2['model']],'as':_0x3993e2['as'],'attributes':_0x3993e2[_0xa92d('0x1d')],'include':_0x3993e2[_0xa92d('0x1f')]?_[_0xa92d('0x20')](_0x3993e2[_0xa92d('0x1f')],function(_0x584793){return{'model':db[_0x584793['model']],'as':_0x584793['as'],'attributes':_0x584793[_0xa92d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa92d('0xc')](function(_0x49946e){logger[_0xa92d('0xd')](_0xa92d('0x17'),_0x4881f8);logger['debug'](_0xa92d('0x17'),_0x4881f8,JSON['stringify'](_0x49946e));_0x1912ef(_0x49946e);})[_0xa92d('0x16')](function(_0x2efb76){logger[_0xa92d('0x12')](_0xa92d('0x17'),_0x2efb76[_0xa92d('0x14')],_0x4881f8);_0x551419(_0x279818['error'](0x1f4,_0x2efb76['message']));});});};exports[_0xa92d('0x22')]=function(_0x49aa57){var _0xcd0643=this;return new Promise(function(_0x1e1571,_0x5b605e){return db[_0xa92d('0x18')][_0xa92d('0x23')]({'raw':_0x49aa57['options']?_0x49aa57['options'][_0xa92d('0x1b')]===undefined?!![]:![]:!![],'where':_0x49aa57[_0xa92d('0x1a')]?_0x49aa57[_0xa92d('0x1a')][_0xa92d('0x1c')]||null:null,'attributes':_0x49aa57['options']?_0x49aa57[_0xa92d('0x1a')][_0xa92d('0x1d')]||null:null,'include':_0x49aa57[_0xa92d('0x1a')]?_0x49aa57[_0xa92d('0x1a')][_0xa92d('0x1f')]?_['map'](_0x49aa57['options'][_0xa92d('0x1f')],function(_0x53737d){return{'model':db[_0x53737d['model']],'as':_0x53737d['as'],'attributes':_0x53737d[_0xa92d('0x1d')],'include':_0x53737d[_0xa92d('0x1f')]?_[_0xa92d('0x20')](_0x53737d[_0xa92d('0x1f')],function(_0x34eae7){return{'model':db[_0x34eae7[_0xa92d('0x21')]],'as':_0x34eae7['as'],'attributes':_0x34eae7[_0xa92d('0x1d')],'include':_0x34eae7[_0xa92d('0x1f')]?_[_0xa92d('0x20')](_0x34eae7[_0xa92d('0x1f')],function(_0x557e36){return{'model':db[_0x557e36[_0xa92d('0x21')]],'as':_0x557e36['as'],'attributes':_0x557e36[_0xa92d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa92d('0xc')](function(_0x5d808b){logger[_0xa92d('0xd')](_0xa92d('0x22'),_0x49aa57);logger[_0xa92d('0x24')](_0xa92d('0x22'),_0x49aa57,JSON[_0xa92d('0x11')](_0x5d808b));_0x1e1571(_0x5d808b);})['catch'](function(_0x1f7049){logger['error'](_0xa92d('0x22'),_0x1f7049['message'],_0x49aa57);_0x5b605e(_0xcd0643[_0xa92d('0x12')](0x1f4,_0x1f7049[_0xa92d('0x14')]));});});};
\ No newline at end of file
index 900e4f0..ecc543f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xdb28,0x106));var _0x8db2=function(_0x32cc7e,_0x519511){_0x32cc7e=_0x32cc7e-0x0;var _0x104a6d=_0xdb28[_0x32cc7e];return _0x104a6d;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router;
\ No newline at end of file
+var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x0b0e,0x187));var _0xe0b0=function(_0x19691f,_0x159737){_0x19691f=_0x19691f-0x0;var _0x5677b6=_0x0b0e[_0x19691f];return _0x5677b6;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router;
\ No newline at end of file
index 211f169..e2e352b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe584=['account','STRING','sequelize','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe584,0x14c));var _0x4e58=function(_0x31a180,_0x3924b9){_0x31a180=_0x31a180-0x0;var _0x4b0502=_0xe584[_0x31a180];return _0x4b0502;};'use strict';var Sequelize=require(_0x4e58('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x4e58('0x1')](_0x4e58('0x2'),_0x4e58('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x4e58('0x1')](_0x4e58('0x4'),_0x4e58('0x5'),_0x4e58('0x6'),_0x4e58('0x7'),_0x4e58('0x8')),'defaultValue':_0x4e58('0x4')},'moduleCreate':{'type':Sequelize[_0x4e58('0x1')]('nothing',_0x4e58('0x5'),_0x4e58('0x6'),_0x4e58('0x8')),'defaultValue':_0x4e58('0x6')},'leadId':{'type':Sequelize[_0x4e58('0x9')]},'additionalSearchAccount':{'type':Sequelize[_0x4e58('0x9')]},'additionalSearchContact':{'type':Sequelize[_0x4e58('0x9')]},'additionalSearchLead':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4b89=['Case','contact_lead','contact','lead','account','nothing','sequelize','exports','STRING','ENUM','Task'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x4b89,0xb6));var _0x94b8=function(_0x57a352,_0xbd7532){_0x57a352=_0x57a352-0x0;var _0x5cd613=_0x4b89[_0x57a352];return _0x5cd613;};'use strict';var Sequelize=require(_0x94b8('0x0'));module[_0x94b8('0x1')]={'name':{'type':Sequelize[_0x94b8('0x2')]},'description':{'type':Sequelize[_0x94b8('0x2')]},'ticketType':{'type':Sequelize[_0x94b8('0x3')](_0x94b8('0x4'),_0x94b8('0x5')),'defaultValue':_0x94b8('0x4')},'moduleSearch':{'type':Sequelize[_0x94b8('0x3')](_0x94b8('0x6'),_0x94b8('0x7'),_0x94b8('0x8'),'account_contact_lead',_0x94b8('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x94b8('0x3')](_0x94b8('0xa'),_0x94b8('0x7'),'lead','account'),'defaultValue':_0x94b8('0x8')},'leadId':{'type':Sequelize[_0x94b8('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x94b8('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x94b8('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 3873c38..deed4fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccc8=['pick','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','SalesforceConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','where','filter','VIRTUAL','merge','include','findAll','catch','show','includeAll','options','find','body','params','findOne','SalesforceField','sort','getFields','hasOwnProperty','getSubjects','getDescriptions'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0xccc8,0xa3));var _0x8ccc=function(_0x537c37,_0x536e74){_0x537c37=_0x537c37-0x0;var _0x241f84=_0xccc8[_0x537c37];return _0x241f84;};'use strict';var emlformat=require(_0x8ccc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ccc('0x1'));var jsonpatch=require(_0x8ccc('0x2'));var rp=require(_0x8ccc('0x3'));var moment=require('moment');var BPromise=require(_0x8ccc('0x4'));var Mustache=require(_0x8ccc('0x5'));var util=require(_0x8ccc('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8ccc('0x7'));var ejs=require(_0x8ccc('0x8'));var fs=require('fs');var fs_extra=require(_0x8ccc('0x9'));var _=require(_0x8ccc('0xa'));var squel=require(_0x8ccc('0xb'));var crypto=require(_0x8ccc('0xc'));var jsforce=require(_0x8ccc('0xd'));var deskjs=require(_0x8ccc('0xe'));var toCsv=require(_0x8ccc('0x7'));var querystring=require(_0x8ccc('0xf'));var Papa=require(_0x8ccc('0x10'));var Redis=require(_0x8ccc('0x11'));var authService=require(_0x8ccc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8ccc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ccc('0x14'))(_0x8ccc('0x15'));var utils=require(_0x8ccc('0x16'));var config=require(_0x8ccc('0x17'));var licenseUtil=require(_0x8ccc('0x18'));var db=require(_0x8ccc('0x19'))['db'];function respondWithStatusCode(_0x2ad047,_0x44e12d){_0x44e12d=_0x44e12d||0xcc;return function(_0x36a575){if(_0x36a575){return _0x2ad047[_0x8ccc('0x1a')](_0x44e12d);}return _0x2ad047[_0x8ccc('0x1b')](_0x44e12d)[_0x8ccc('0x1c')]();};}function respondWithResult(_0x3d1621,_0x6c184b){_0x6c184b=_0x6c184b||0xc8;return function(_0x44b351){if(_0x44b351){return _0x3d1621[_0x8ccc('0x1b')](_0x6c184b)[_0x8ccc('0x1d')](_0x44b351);}};}function respondWithFilteredResult(_0x3f7727,_0x3eda50){return function(_0x5acdb4){if(_0x5acdb4){var _0x4bddfc=typeof _0x3eda50[_0x8ccc('0x1e')]==='undefined'&&typeof _0x3eda50[_0x8ccc('0x1f')]===_0x8ccc('0x20');var _0x2f20e9=_0x5acdb4[_0x8ccc('0x21')];var _0x38e8c1=_0x4bddfc?0x0:_0x3eda50[_0x8ccc('0x1e')];var _0x1cd7e3=_0x4bddfc?_0x5acdb4[_0x8ccc('0x21')]:_0x3eda50[_0x8ccc('0x1e')]+_0x3eda50[_0x8ccc('0x1f')];var _0x3a1989;if(_0x1cd7e3>=_0x2f20e9){_0x1cd7e3=_0x2f20e9;_0x3a1989=0xc8;}else{_0x3a1989=0xce;}_0x3f7727[_0x8ccc('0x1b')](_0x3a1989);return _0x3f7727[_0x8ccc('0x22')](_0x8ccc('0x23'),_0x38e8c1+'-'+_0x1cd7e3+'/'+_0x2f20e9)['json'](_0x5acdb4);}return null;};}function patchUpdates(_0x5597ce){return function(_0x296f50){try{jsonpatch[_0x8ccc('0x24')](_0x296f50,_0x5597ce,!![]);}catch(_0x4f072e){return BPromise['reject'](_0x4f072e);}return _0x296f50[_0x8ccc('0x25')]();};}function saveUpdates(_0x264371,_0x4eed06){return function(_0x60a4c1){if(_0x60a4c1){return _0x60a4c1[_0x8ccc('0x26')](_0x264371)[_0x8ccc('0x27')](function(_0x5c8511){return _0x5c8511;});}return null;};}function removeEntity(_0x37da12,_0x358174){return function(_0x66dd84){if(_0x66dd84){return _0x66dd84[_0x8ccc('0x28')]()[_0x8ccc('0x27')](function(){_0x37da12['status'](0xcc)[_0x8ccc('0x1c')]();});}};}function handleEntityNotFound(_0x438f9b,_0x28937d){return function(_0x77f605){if(!_0x77f605){_0x438f9b[_0x8ccc('0x1a')](0x194);}return _0x77f605;};}function handleError(_0x33df3a,_0x251a94){_0x251a94=_0x251a94||0x1f4;return function(_0x2f9c2f){logger[_0x8ccc('0x29')](_0x2f9c2f[_0x8ccc('0x2a')]);if(_0x2f9c2f['name']){delete _0x2f9c2f[_0x8ccc('0x2b')];}_0x33df3a['status'](_0x251a94)['send'](_0x2f9c2f);};}exports[_0x8ccc('0x2c')]=function(_0x300172,_0x2284fd){var _0x1c0883={},_0x254778={},_0x510c12={'count':0x0,'rows':[]};var _0x223b9e=_[_0x8ccc('0x2d')](db[_0x8ccc('0x2e')][_0x8ccc('0x2f')],function(_0x1c701e){return{'name':_0x1c701e['fieldName'],'type':_0x1c701e[_0x8ccc('0x30')][_0x8ccc('0x31')]};});_0x254778[_0x8ccc('0x32')]=_['map'](_0x223b9e,_0x8ccc('0x2b'));_0x254778[_0x8ccc('0x33')]=_[_0x8ccc('0x34')](_0x300172['query']);_0x254778[_0x8ccc('0x35')]=_['intersection'](_0x254778[_0x8ccc('0x32')],_0x254778['query']);_0x1c0883[_0x8ccc('0x36')]=_[_0x8ccc('0x37')](_0x254778[_0x8ccc('0x32')],qs['fields'](_0x300172[_0x8ccc('0x33')][_0x8ccc('0x38')]));_0x1c0883[_0x8ccc('0x36')]=_0x1c0883['attributes'][_0x8ccc('0x39')]?_0x1c0883[_0x8ccc('0x36')]:_0x254778[_0x8ccc('0x32')];if(!_0x300172[_0x8ccc('0x33')]['hasOwnProperty'](_0x8ccc('0x3a'))){_0x1c0883[_0x8ccc('0x1f')]=qs[_0x8ccc('0x1f')](_0x300172['query'][_0x8ccc('0x1f')]);_0x1c0883[_0x8ccc('0x1e')]=qs[_0x8ccc('0x1e')](_0x300172[_0x8ccc('0x33')][_0x8ccc('0x1e')]);}_0x1c0883[_0x8ccc('0x3b')]=qs['sort'](_0x300172[_0x8ccc('0x33')]['sort']);_0x1c0883[_0x8ccc('0x3c')]=qs[_0x8ccc('0x35')](_['pick'](_0x300172[_0x8ccc('0x33')],_0x254778['filters']),_0x223b9e);if(_0x300172[_0x8ccc('0x33')][_0x8ccc('0x3d')]){_0x1c0883[_0x8ccc('0x3c')]=_['merge'](_0x1c0883[_0x8ccc('0x3c')],{'$or':_[_0x8ccc('0x2d')](_0x223b9e,function(_0x1f7ee1){if(_0x1f7ee1['type']!==_0x8ccc('0x3e')){var _0x4b2b80={};_0x4b2b80[_0x1f7ee1[_0x8ccc('0x2b')]]={'$like':'%'+_0x300172['query'][_0x8ccc('0x3d')]+'%'};return _0x4b2b80;}})});}_0x1c0883=_[_0x8ccc('0x3f')]({},_0x1c0883,_0x300172['options']);var _0x8472b8={'where':_0x1c0883[_0x8ccc('0x3c')]};return db['SalesforceConfiguration'][_0x8ccc('0x21')](_0x8472b8)[_0x8ccc('0x27')](function(_0x128a30){_0x510c12[_0x8ccc('0x21')]=_0x128a30;if(_0x300172[_0x8ccc('0x33')]['includeAll']){_0x1c0883[_0x8ccc('0x40')]=[{'all':!![]}];}return db[_0x8ccc('0x2e')][_0x8ccc('0x41')](_0x1c0883);})[_0x8ccc('0x27')](function(_0x5bc9d1){_0x510c12['rows']=_0x5bc9d1;return _0x510c12;})[_0x8ccc('0x27')](respondWithFilteredResult(_0x2284fd,_0x1c0883))[_0x8ccc('0x42')](handleError(_0x2284fd,null));};exports[_0x8ccc('0x43')]=function(_0x5d5f3a,_0xde090b){var _0x38db8d={'raw':![],'where':{'id':_0x5d5f3a['params']['id']}},_0x971a55={};_0x971a55[_0x8ccc('0x32')]=_[_0x8ccc('0x34')](db[_0x8ccc('0x2e')][_0x8ccc('0x2f')]);_0x971a55[_0x8ccc('0x33')]=_[_0x8ccc('0x34')](_0x5d5f3a['query']);_0x971a55[_0x8ccc('0x35')]=_[_0x8ccc('0x37')](_0x971a55['model'],_0x971a55[_0x8ccc('0x33')]);_0x38db8d['attributes']=_[_0x8ccc('0x37')](_0x971a55[_0x8ccc('0x32')],qs[_0x8ccc('0x38')](_0x5d5f3a['query'][_0x8ccc('0x38')]));_0x38db8d[_0x8ccc('0x36')]=_0x38db8d[_0x8ccc('0x36')]['length']?_0x38db8d[_0x8ccc('0x36')]:_0x971a55[_0x8ccc('0x32')];if(_0x5d5f3a[_0x8ccc('0x33')][_0x8ccc('0x44')]){_0x38db8d[_0x8ccc('0x40')]=[{'all':!![]}];}_0x38db8d=_[_0x8ccc('0x3f')]({},_0x38db8d,_0x5d5f3a[_0x8ccc('0x45')]);return db['SalesforceConfiguration'][_0x8ccc('0x46')](_0x38db8d)[_0x8ccc('0x27')](handleEntityNotFound(_0xde090b,null))['then'](respondWithResult(_0xde090b,null))[_0x8ccc('0x42')](handleError(_0xde090b,null));};exports['create']=function(_0x5cfcbc,_0x2a7643){return db[_0x8ccc('0x2e')]['create'](_0x5cfcbc['body'],{})[_0x8ccc('0x27')](respondWithResult(_0x2a7643,0xc9))['catch'](handleError(_0x2a7643,null));};exports['update']=function(_0x14b7fd,_0xb36e90){if(_0x14b7fd[_0x8ccc('0x47')]['id']){delete _0x14b7fd[_0x8ccc('0x47')]['id'];}return db[_0x8ccc('0x2e')][_0x8ccc('0x46')]({'where':{'id':_0x14b7fd[_0x8ccc('0x48')]['id']}})[_0x8ccc('0x27')](handleEntityNotFound(_0xb36e90,null))[_0x8ccc('0x27')](saveUpdates(_0x14b7fd[_0x8ccc('0x47')],null))[_0x8ccc('0x27')](respondWithResult(_0xb36e90,null))['catch'](handleError(_0xb36e90,null));};exports[_0x8ccc('0x28')]=function(_0x4c7510,_0x16f1f2){return db[_0x8ccc('0x2e')][_0x8ccc('0x46')]({'where':{'id':_0x4c7510['params']['id']}})['then'](handleEntityNotFound(_0x16f1f2,null))[_0x8ccc('0x27')](removeEntity(_0x16f1f2,null))[_0x8ccc('0x42')](handleError(_0x16f1f2,null));};exports['getFields']=function(_0x39ff85,_0x26f022,_0x105bd6){var _0x350e7d={};var _0x2716f1={};var _0x135cf1;var _0x379f41;return db[_0x8ccc('0x2e')][_0x8ccc('0x49')]({'where':{'id':_0x39ff85[_0x8ccc('0x48')]['id']}})[_0x8ccc('0x27')](handleEntityNotFound(_0x26f022,null))[_0x8ccc('0x27')](function(_0x19368e){if(_0x19368e){_0x135cf1=_0x19368e;_0x2716f1[_0x8ccc('0x32')]=_['keys'](db[_0x8ccc('0x4a')][_0x8ccc('0x2f')]);_0x2716f1['query']=_[_0x8ccc('0x34')](_0x39ff85[_0x8ccc('0x33')]);_0x2716f1['filters']=_[_0x8ccc('0x37')](_0x2716f1[_0x8ccc('0x32')],_0x2716f1['query']);_0x350e7d[_0x8ccc('0x36')]=_[_0x8ccc('0x37')](_0x2716f1['model'],qs['fields'](_0x39ff85[_0x8ccc('0x33')][_0x8ccc('0x38')]));_0x350e7d[_0x8ccc('0x36')]=_0x350e7d['attributes'][_0x8ccc('0x39')]?_0x350e7d[_0x8ccc('0x36')]:_0x2716f1[_0x8ccc('0x32')];_0x350e7d[_0x8ccc('0x3b')]=qs[_0x8ccc('0x4b')](_0x39ff85['query']['sort']);_0x350e7d['where']=qs[_0x8ccc('0x35')](_['pick'](_0x39ff85[_0x8ccc('0x33')],_0x2716f1[_0x8ccc('0x35')]));if(_0x39ff85[_0x8ccc('0x33')][_0x8ccc('0x3d')]){_0x350e7d[_0x8ccc('0x3c')]=_[_0x8ccc('0x3f')](_0x350e7d['where'],{'$or':_[_0x8ccc('0x2d')](_0x350e7d['attributes'],function(_0x49e011){var _0x1bedcb={};_0x1bedcb[_0x49e011]={'$like':'%'+_0x39ff85[_0x8ccc('0x33')]['filter']+'%'};return _0x1bedcb;})});}_0x350e7d=_['merge']({},_0x350e7d,_0x39ff85[_0x8ccc('0x45')]);return _0x135cf1[_0x8ccc('0x4c')](_0x350e7d);}})[_0x8ccc('0x27')](function(_0x3fed28){if(_0x3fed28){_0x379f41=_0x3fed28[_0x8ccc('0x39')];if(!_0x39ff85['query'][_0x8ccc('0x4d')](_0x8ccc('0x3a'))){_0x350e7d[_0x8ccc('0x1f')]=qs[_0x8ccc('0x1f')](_0x39ff85[_0x8ccc('0x33')][_0x8ccc('0x1f')]);_0x350e7d[_0x8ccc('0x1e')]=qs['offset'](_0x39ff85[_0x8ccc('0x33')][_0x8ccc('0x1e')]);}return _0x135cf1['getFields'](_0x350e7d);}})['then'](function(_0x53327b){if(_0x53327b){return _0x53327b?{'count':_0x379f41,'rows':_0x53327b}:null;}})[_0x8ccc('0x27')](respondWithResult(_0x26f022,null))['catch'](handleError(_0x26f022,null));};exports[_0x8ccc('0x4e')]=function(_0x27fbc7,_0x1032f3,_0x9f3cae){var _0x415e0f={};var _0x2b242c={};var _0x322980;var _0x67791;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x27fbc7[_0x8ccc('0x48')]['id']}})['then'](handleEntityNotFound(_0x1032f3,null))[_0x8ccc('0x27')](function(_0x58e6e7){if(_0x58e6e7){_0x322980=_0x58e6e7;_0x2b242c['model']=_[_0x8ccc('0x34')](db[_0x8ccc('0x4a')][_0x8ccc('0x2f')]);_0x2b242c[_0x8ccc('0x33')]=_[_0x8ccc('0x34')](_0x27fbc7[_0x8ccc('0x33')]);_0x2b242c[_0x8ccc('0x35')]=_[_0x8ccc('0x37')](_0x2b242c[_0x8ccc('0x32')],_0x2b242c[_0x8ccc('0x33')]);_0x415e0f[_0x8ccc('0x36')]=_['intersection'](_0x2b242c[_0x8ccc('0x32')],qs[_0x8ccc('0x38')](_0x27fbc7[_0x8ccc('0x33')][_0x8ccc('0x38')]));_0x415e0f[_0x8ccc('0x36')]=_0x415e0f[_0x8ccc('0x36')][_0x8ccc('0x39')]?_0x415e0f[_0x8ccc('0x36')]:_0x2b242c[_0x8ccc('0x32')];_0x415e0f[_0x8ccc('0x3b')]=qs[_0x8ccc('0x4b')](_0x27fbc7[_0x8ccc('0x33')]['sort']);_0x415e0f[_0x8ccc('0x3c')]=qs[_0x8ccc('0x35')](_['pick'](_0x27fbc7['query'],_0x2b242c[_0x8ccc('0x35')]));if(_0x27fbc7['query'][_0x8ccc('0x3d')]){_0x415e0f[_0x8ccc('0x3c')]=_['merge'](_0x415e0f['where'],{'$or':_[_0x8ccc('0x2d')](_0x415e0f[_0x8ccc('0x36')],function(_0x5ded8c){var _0x4a4c87={};_0x4a4c87[_0x5ded8c]={'$like':'%'+_0x27fbc7[_0x8ccc('0x33')][_0x8ccc('0x3d')]+'%'};return _0x4a4c87;})});}_0x415e0f=_[_0x8ccc('0x3f')]({},_0x415e0f,_0x27fbc7[_0x8ccc('0x45')]);return _0x322980[_0x8ccc('0x4e')](_0x415e0f);}})[_0x8ccc('0x27')](function(_0x41fc28){if(_0x41fc28){_0x67791=_0x41fc28[_0x8ccc('0x39')];if(!_0x27fbc7[_0x8ccc('0x33')][_0x8ccc('0x4d')](_0x8ccc('0x3a'))){_0x415e0f[_0x8ccc('0x1f')]=qs[_0x8ccc('0x1f')](_0x27fbc7['query'][_0x8ccc('0x1f')]);_0x415e0f[_0x8ccc('0x1e')]=qs[_0x8ccc('0x1e')](_0x27fbc7[_0x8ccc('0x33')]['offset']);}return _0x322980['getSubjects'](_0x415e0f);}})[_0x8ccc('0x27')](function(_0x1efe50){if(_0x1efe50){return _0x1efe50?{'count':_0x67791,'rows':_0x1efe50}:null;}})[_0x8ccc('0x27')](respondWithResult(_0x1032f3,null))['catch'](handleError(_0x1032f3,null));};exports[_0x8ccc('0x4f')]=function(_0x5ee3c0,_0x290353,_0x526f99){var _0x31c3f0={};var _0x5100af={};var _0x3732ea;var _0x111908;return db[_0x8ccc('0x2e')]['findOne']({'where':{'id':_0x5ee3c0[_0x8ccc('0x48')]['id']}})[_0x8ccc('0x27')](handleEntityNotFound(_0x290353,null))[_0x8ccc('0x27')](function(_0xb1cea1){if(_0xb1cea1){_0x3732ea=_0xb1cea1;_0x5100af[_0x8ccc('0x32')]=_[_0x8ccc('0x34')](db[_0x8ccc('0x4a')][_0x8ccc('0x2f')]);_0x5100af[_0x8ccc('0x33')]=_[_0x8ccc('0x34')](_0x5ee3c0[_0x8ccc('0x33')]);_0x5100af[_0x8ccc('0x35')]=_[_0x8ccc('0x37')](_0x5100af[_0x8ccc('0x32')],_0x5100af[_0x8ccc('0x33')]);_0x31c3f0[_0x8ccc('0x36')]=_[_0x8ccc('0x37')](_0x5100af[_0x8ccc('0x32')],qs[_0x8ccc('0x38')](_0x5ee3c0[_0x8ccc('0x33')]['fields']));_0x31c3f0[_0x8ccc('0x36')]=_0x31c3f0[_0x8ccc('0x36')][_0x8ccc('0x39')]?_0x31c3f0[_0x8ccc('0x36')]:_0x5100af[_0x8ccc('0x32')];_0x31c3f0[_0x8ccc('0x3b')]=qs[_0x8ccc('0x4b')](_0x5ee3c0[_0x8ccc('0x33')]['sort']);_0x31c3f0[_0x8ccc('0x3c')]=qs['filters'](_[_0x8ccc('0x50')](_0x5ee3c0['query'],_0x5100af['filters']));if(_0x5ee3c0['query']['filter']){_0x31c3f0['where']=_[_0x8ccc('0x3f')](_0x31c3f0[_0x8ccc('0x3c')],{'$or':_['map'](_0x31c3f0['attributes'],function(_0x28b3d8){var _0xfe5a37={};_0xfe5a37[_0x28b3d8]={'$like':'%'+_0x5ee3c0[_0x8ccc('0x33')][_0x8ccc('0x3d')]+'%'};return _0xfe5a37;})});}_0x31c3f0=_[_0x8ccc('0x3f')]({},_0x31c3f0,_0x5ee3c0[_0x8ccc('0x45')]);return _0x3732ea['getDescriptions'](_0x31c3f0);}})[_0x8ccc('0x27')](function(_0x452156){if(_0x452156){_0x111908=_0x452156['length'];if(!_0x5ee3c0[_0x8ccc('0x33')][_0x8ccc('0x4d')]('nolimit')){_0x31c3f0[_0x8ccc('0x1f')]=qs[_0x8ccc('0x1f')](_0x5ee3c0['query'][_0x8ccc('0x1f')]);_0x31c3f0['offset']=qs['offset'](_0x5ee3c0[_0x8ccc('0x33')][_0x8ccc('0x1e')]);}return _0x3732ea['getDescriptions'](_0x31c3f0);}})[_0x8ccc('0x27')](function(_0x3d2b56){if(_0x3d2b56){return _0x3d2b56?{'count':_0x111908,'rows':_0x3d2b56}:null;}})['then'](respondWithResult(_0x290353,null))['catch'](handleError(_0x290353,null));};
\ No newline at end of file
+var _0x65e0=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','SalesforceConfiguration','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','getFields','findOne','order','getSubjects','pick','getDescriptions','SalesforceField','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x468ce8,_0x51a54c){var _0x14e45f=function(_0x3b56dd){while(--_0x3b56dd){_0x468ce8['push'](_0x468ce8['shift']());}};_0x14e45f(++_0x51a54c);}(_0x65e0,0x96));var _0x065e=function(_0x466e57,_0x21b819){_0x466e57=_0x466e57-0x0;var _0x34df42=_0x65e0[_0x466e57];return _0x34df42;};'use strict';var emlformat=require(_0x065e('0x0'));var rimraf=require(_0x065e('0x1'));var zipdir=require(_0x065e('0x2'));var jsonpatch=require(_0x065e('0x3'));var rp=require('request-promise');var moment=require(_0x065e('0x4'));var BPromise=require(_0x065e('0x5'));var Mustache=require(_0x065e('0x6'));var util=require(_0x065e('0x7'));var path=require(_0x065e('0x8'));var sox=require(_0x065e('0x9'));var csv=require(_0x065e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x065e('0xb'));var _=require('lodash');var squel=require(_0x065e('0xc'));var crypto=require(_0x065e('0xd'));var jsforce=require(_0x065e('0xe'));var deskjs=require(_0x065e('0xf'));var toCsv=require(_0x065e('0xa'));var querystring=require(_0x065e('0x10'));var Papa=require(_0x065e('0x11'));var Redis=require(_0x065e('0x12'));var authService=require(_0x065e('0x13'));var qs=require(_0x065e('0x14'));var as=require(_0x065e('0x15'));var hardwareService=require(_0x065e('0x16'));var logger=require('../../config/logger')(_0x065e('0x17'));var utils=require('../../config/utils');var config=require(_0x065e('0x18'));var licenseUtil=require(_0x065e('0x19'));var db=require(_0x065e('0x1a'))['db'];function respondWithStatusCode(_0x18e382,_0x43c794){_0x43c794=_0x43c794||0xcc;return function(_0x439121){if(_0x439121){return _0x18e382[_0x065e('0x1b')](_0x43c794);}return _0x18e382[_0x065e('0x1c')](_0x43c794)[_0x065e('0x1d')]();};}function respondWithResult(_0x25f94,_0x2ddccd){_0x2ddccd=_0x2ddccd||0xc8;return function(_0x3dfc0c){if(_0x3dfc0c){return _0x25f94[_0x065e('0x1c')](_0x2ddccd)[_0x065e('0x1e')](_0x3dfc0c);}};}function respondWithFilteredResult(_0x341fb3,_0x86cc6){return function(_0x35c33d){if(_0x35c33d){var _0x2c8ec1=typeof _0x86cc6[_0x065e('0x1f')]===_0x065e('0x20')&&typeof _0x86cc6[_0x065e('0x21')]==='undefined';var _0xa90abf=_0x35c33d['count'];var _0x307112=_0x2c8ec1?0x0:_0x86cc6[_0x065e('0x1f')];var _0x1d6c06=_0x2c8ec1?_0x35c33d[_0x065e('0x22')]:_0x86cc6[_0x065e('0x1f')]+_0x86cc6[_0x065e('0x21')];var _0xbbe139;if(_0x1d6c06>=_0xa90abf){_0x1d6c06=_0xa90abf;_0xbbe139=0xc8;}else{_0xbbe139=0xce;}_0x341fb3[_0x065e('0x1c')](_0xbbe139);return _0x341fb3[_0x065e('0x23')](_0x065e('0x24'),_0x307112+'-'+_0x1d6c06+'/'+_0xa90abf)[_0x065e('0x1e')](_0x35c33d);}return null;};}function patchUpdates(_0x2863ed){return function(_0x1b5c6d){try{jsonpatch[_0x065e('0x25')](_0x1b5c6d,_0x2863ed,!![]);}catch(_0x4aa23d){return BPromise['reject'](_0x4aa23d);}return _0x1b5c6d[_0x065e('0x26')]();};}function saveUpdates(_0x4f02a5,_0x47c252){return function(_0x4bd485){if(_0x4bd485){return _0x4bd485[_0x065e('0x27')](_0x4f02a5)[_0x065e('0x28')](function(_0x5e7308){return _0x5e7308;});}return null;};}function removeEntity(_0x535fc6,_0x44a191){return function(_0x30504b){if(_0x30504b){return _0x30504b[_0x065e('0x29')]()[_0x065e('0x28')](function(){_0x535fc6['status'](0xcc)[_0x065e('0x1d')]();});}};}function handleEntityNotFound(_0x5c6495,_0x12a027){return function(_0x343a59){if(!_0x343a59){_0x5c6495[_0x065e('0x1b')](0x194);}return _0x343a59;};}function handleError(_0x26abcc,_0xf6b37f){_0xf6b37f=_0xf6b37f||0x1f4;return function(_0x134ac8){logger['error'](_0x134ac8[_0x065e('0x2a')]);if(_0x134ac8['name']){delete _0x134ac8[_0x065e('0x2b')];}_0x26abcc[_0x065e('0x1c')](_0xf6b37f)[_0x065e('0x2c')](_0x134ac8);};}exports[_0x065e('0x2d')]=function(_0x3e1b14,_0x191be9){var _0xd27117={},_0x5793d3={},_0x1e2d18={'count':0x0,'rows':[]};var _0x1b3539=_[_0x065e('0x2e')](db[_0x065e('0x2f')]['rawAttributes'],function(_0x5a7119){return{'name':_0x5a7119['fieldName'],'type':_0x5a7119[_0x065e('0x30')][_0x065e('0x31')]};});_0x5793d3['model']=_[_0x065e('0x2e')](_0x1b3539,'name');_0x5793d3[_0x065e('0x32')]=_[_0x065e('0x33')](_0x3e1b14['query']);_0x5793d3[_0x065e('0x34')]=_[_0x065e('0x35')](_0x5793d3['model'],_0x5793d3[_0x065e('0x32')]);_0xd27117[_0x065e('0x36')]=_[_0x065e('0x35')](_0x5793d3[_0x065e('0x37')],qs['fields'](_0x3e1b14[_0x065e('0x32')][_0x065e('0x38')]));_0xd27117['attributes']=_0xd27117[_0x065e('0x36')][_0x065e('0x39')]?_0xd27117[_0x065e('0x36')]:_0x5793d3[_0x065e('0x37')];if(!_0x3e1b14[_0x065e('0x32')][_0x065e('0x3a')](_0x065e('0x3b'))){_0xd27117[_0x065e('0x21')]=qs[_0x065e('0x21')](_0x3e1b14['query'][_0x065e('0x21')]);_0xd27117[_0x065e('0x1f')]=qs[_0x065e('0x1f')](_0x3e1b14[_0x065e('0x32')][_0x065e('0x1f')]);}_0xd27117['order']=qs['sort'](_0x3e1b14[_0x065e('0x32')][_0x065e('0x3c')]);_0xd27117[_0x065e('0x3d')]=qs[_0x065e('0x34')](_['pick'](_0x3e1b14[_0x065e('0x32')],_0x5793d3[_0x065e('0x34')]),_0x1b3539);if(_0x3e1b14[_0x065e('0x32')][_0x065e('0x3e')]){_0xd27117[_0x065e('0x3d')]=_[_0x065e('0x3f')](_0xd27117[_0x065e('0x3d')],{'$or':_[_0x065e('0x2e')](_0x1b3539,function(_0x497331){if(_0x497331[_0x065e('0x30')]!==_0x065e('0x40')){var _0x1242d3={};_0x1242d3[_0x497331['name']]={'$like':'%'+_0x3e1b14[_0x065e('0x32')][_0x065e('0x3e')]+'%'};return _0x1242d3;}})});}_0xd27117=_[_0x065e('0x3f')]({},_0xd27117,_0x3e1b14[_0x065e('0x41')]);var _0x3b3811={'where':_0xd27117[_0x065e('0x3d')]};return db['SalesforceConfiguration'][_0x065e('0x22')](_0x3b3811)[_0x065e('0x28')](function(_0x1a47b5){_0x1e2d18[_0x065e('0x22')]=_0x1a47b5;if(_0x3e1b14[_0x065e('0x32')][_0x065e('0x42')]){_0xd27117[_0x065e('0x43')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0xd27117);})[_0x065e('0x28')](function(_0x119730){_0x1e2d18[_0x065e('0x44')]=_0x119730;return _0x1e2d18;})['then'](respondWithFilteredResult(_0x191be9,_0xd27117))['catch'](handleError(_0x191be9,null));};exports[_0x065e('0x45')]=function(_0x18bdac,_0x7d283d){var _0x2854ca={'raw':![],'where':{'id':_0x18bdac[_0x065e('0x46')]['id']}},_0x43616c={};_0x43616c[_0x065e('0x37')]=_[_0x065e('0x33')](db['SalesforceConfiguration'][_0x065e('0x47')]);_0x43616c[_0x065e('0x32')]=_['keys'](_0x18bdac[_0x065e('0x32')]);_0x43616c[_0x065e('0x34')]=_[_0x065e('0x35')](_0x43616c[_0x065e('0x37')],_0x43616c[_0x065e('0x32')]);_0x2854ca[_0x065e('0x36')]=_[_0x065e('0x35')](_0x43616c[_0x065e('0x37')],qs[_0x065e('0x38')](_0x18bdac['query'][_0x065e('0x38')]));_0x2854ca[_0x065e('0x36')]=_0x2854ca['attributes'][_0x065e('0x39')]?_0x2854ca[_0x065e('0x36')]:_0x43616c[_0x065e('0x37')];if(_0x18bdac[_0x065e('0x32')][_0x065e('0x42')]){_0x2854ca[_0x065e('0x43')]=[{'all':!![]}];}_0x2854ca=_[_0x065e('0x3f')]({},_0x2854ca,_0x18bdac[_0x065e('0x41')]);return db[_0x065e('0x2f')][_0x065e('0x48')](_0x2854ca)[_0x065e('0x28')](handleEntityNotFound(_0x7d283d,null))[_0x065e('0x28')](respondWithResult(_0x7d283d,null))[_0x065e('0x49')](handleError(_0x7d283d,null));};exports['create']=function(_0x377d4e,_0x2f9f6c){return db['SalesforceConfiguration'][_0x065e('0x4a')](_0x377d4e[_0x065e('0x4b')],{})['then'](respondWithResult(_0x2f9f6c,0xc9))[_0x065e('0x49')](handleError(_0x2f9f6c,null));};exports[_0x065e('0x27')]=function(_0x496a78,_0x54e2fb){if(_0x496a78[_0x065e('0x4b')]['id']){delete _0x496a78[_0x065e('0x4b')]['id'];}return db[_0x065e('0x2f')][_0x065e('0x48')]({'where':{'id':_0x496a78[_0x065e('0x46')]['id']}})[_0x065e('0x28')](handleEntityNotFound(_0x54e2fb,null))[_0x065e('0x28')](saveUpdates(_0x496a78[_0x065e('0x4b')],null))[_0x065e('0x28')](respondWithResult(_0x54e2fb,null))[_0x065e('0x49')](handleError(_0x54e2fb,null));};exports[_0x065e('0x29')]=function(_0x5ef368,_0x101aa1){return db[_0x065e('0x2f')][_0x065e('0x48')]({'where':{'id':_0x5ef368[_0x065e('0x46')]['id']}})[_0x065e('0x28')](handleEntityNotFound(_0x101aa1,null))[_0x065e('0x28')](removeEntity(_0x101aa1,null))[_0x065e('0x49')](handleError(_0x101aa1,null));};exports[_0x065e('0x4c')]=function(_0x2296f0,_0xb0e33b,_0x41a47b){var _0x190972={};var _0x5849d9={};var _0x571a3e;var _0x2c2527;return db[_0x065e('0x2f')][_0x065e('0x4d')]({'where':{'id':_0x2296f0[_0x065e('0x46')]['id']}})[_0x065e('0x28')](handleEntityNotFound(_0xb0e33b,null))[_0x065e('0x28')](function(_0x75d7a2){if(_0x75d7a2){_0x571a3e=_0x75d7a2;_0x5849d9['model']=_[_0x065e('0x33')](db['SalesforceField']['rawAttributes']);_0x5849d9[_0x065e('0x32')]=_['keys'](_0x2296f0[_0x065e('0x32')]);_0x5849d9[_0x065e('0x34')]=_[_0x065e('0x35')](_0x5849d9[_0x065e('0x37')],_0x5849d9[_0x065e('0x32')]);_0x190972['attributes']=_[_0x065e('0x35')](_0x5849d9[_0x065e('0x37')],qs[_0x065e('0x38')](_0x2296f0[_0x065e('0x32')][_0x065e('0x38')]));_0x190972[_0x065e('0x36')]=_0x190972[_0x065e('0x36')][_0x065e('0x39')]?_0x190972['attributes']:_0x5849d9[_0x065e('0x37')];_0x190972[_0x065e('0x4e')]=qs[_0x065e('0x3c')](_0x2296f0[_0x065e('0x32')]['sort']);_0x190972[_0x065e('0x3d')]=qs[_0x065e('0x34')](_['pick'](_0x2296f0[_0x065e('0x32')],_0x5849d9[_0x065e('0x34')]));if(_0x2296f0[_0x065e('0x32')][_0x065e('0x3e')]){_0x190972[_0x065e('0x3d')]=_[_0x065e('0x3f')](_0x190972[_0x065e('0x3d')],{'$or':_['map'](_0x190972[_0x065e('0x36')],function(_0x10e0cc){var _0x1410a1={};_0x1410a1[_0x10e0cc]={'$like':'%'+_0x2296f0[_0x065e('0x32')]['filter']+'%'};return _0x1410a1;})});}_0x190972=_[_0x065e('0x3f')]({},_0x190972,_0x2296f0[_0x065e('0x41')]);return _0x571a3e['getFields'](_0x190972);}})[_0x065e('0x28')](function(_0x17a52d){if(_0x17a52d){_0x2c2527=_0x17a52d[_0x065e('0x39')];if(!_0x2296f0[_0x065e('0x32')][_0x065e('0x3a')](_0x065e('0x3b'))){_0x190972[_0x065e('0x21')]=qs['limit'](_0x2296f0[_0x065e('0x32')][_0x065e('0x21')]);_0x190972[_0x065e('0x1f')]=qs[_0x065e('0x1f')](_0x2296f0[_0x065e('0x32')][_0x065e('0x1f')]);}return _0x571a3e['getFields'](_0x190972);}})[_0x065e('0x28')](function(_0x3cb998){if(_0x3cb998){return _0x3cb998?{'count':_0x2c2527,'rows':_0x3cb998}:null;}})['then'](respondWithResult(_0xb0e33b,null))[_0x065e('0x49')](handleError(_0xb0e33b,null));};exports[_0x065e('0x4f')]=function(_0x127915,_0x209a91,_0xda0f28){var _0x5db9f8={};var _0x47149f={};var _0x2b57f4;var _0x270e02;return db[_0x065e('0x2f')][_0x065e('0x4d')]({'where':{'id':_0x127915[_0x065e('0x46')]['id']}})[_0x065e('0x28')](handleEntityNotFound(_0x209a91,null))[_0x065e('0x28')](function(_0x247217){if(_0x247217){_0x2b57f4=_0x247217;_0x47149f[_0x065e('0x37')]=_[_0x065e('0x33')](db['SalesforceField']['rawAttributes']);_0x47149f[_0x065e('0x32')]=_['keys'](_0x127915[_0x065e('0x32')]);_0x47149f[_0x065e('0x34')]=_[_0x065e('0x35')](_0x47149f[_0x065e('0x37')],_0x47149f['query']);_0x5db9f8['attributes']=_['intersection'](_0x47149f[_0x065e('0x37')],qs[_0x065e('0x38')](_0x127915[_0x065e('0x32')]['fields']));_0x5db9f8['attributes']=_0x5db9f8[_0x065e('0x36')]['length']?_0x5db9f8[_0x065e('0x36')]:_0x47149f['model'];_0x5db9f8['order']=qs[_0x065e('0x3c')](_0x127915[_0x065e('0x32')][_0x065e('0x3c')]);_0x5db9f8[_0x065e('0x3d')]=qs[_0x065e('0x34')](_[_0x065e('0x50')](_0x127915['query'],_0x47149f[_0x065e('0x34')]));if(_0x127915[_0x065e('0x32')][_0x065e('0x3e')]){_0x5db9f8['where']=_[_0x065e('0x3f')](_0x5db9f8[_0x065e('0x3d')],{'$or':_['map'](_0x5db9f8['attributes'],function(_0x27da6c){var _0x5acb0f={};_0x5acb0f[_0x27da6c]={'$like':'%'+_0x127915[_0x065e('0x32')][_0x065e('0x3e')]+'%'};return _0x5acb0f;})});}_0x5db9f8=_[_0x065e('0x3f')]({},_0x5db9f8,_0x127915[_0x065e('0x41')]);return _0x2b57f4[_0x065e('0x4f')](_0x5db9f8);}})[_0x065e('0x28')](function(_0x32ab8e){if(_0x32ab8e){_0x270e02=_0x32ab8e[_0x065e('0x39')];if(!_0x127915[_0x065e('0x32')][_0x065e('0x3a')]('nolimit')){_0x5db9f8[_0x065e('0x21')]=qs[_0x065e('0x21')](_0x127915[_0x065e('0x32')][_0x065e('0x21')]);_0x5db9f8['offset']=qs['offset'](_0x127915['query'][_0x065e('0x1f')]);}return _0x2b57f4[_0x065e('0x4f')](_0x5db9f8);}})['then'](function(_0x585535){if(_0x585535){return _0x585535?{'count':_0x270e02,'rows':_0x585535}:null;}})['then'](respondWithResult(_0x209a91,null))[_0x065e('0x49')](handleError(_0x209a91,null));};exports[_0x065e('0x51')]=function(_0x260d12,_0x2ed651,_0x45d80b){var _0x46ec96={};var _0x357689={};var _0x348bbd;var _0x306cb5;return db[_0x065e('0x2f')][_0x065e('0x4d')]({'where':{'id':_0x260d12[_0x065e('0x46')]['id']}})[_0x065e('0x28')](handleEntityNotFound(_0x2ed651,null))[_0x065e('0x28')](function(_0x280aba){if(_0x280aba){_0x348bbd=_0x280aba;_0x357689[_0x065e('0x37')]=_[_0x065e('0x33')](db[_0x065e('0x52')]['rawAttributes']);_0x357689[_0x065e('0x32')]=_['keys'](_0x260d12[_0x065e('0x32')]);_0x357689[_0x065e('0x34')]=_[_0x065e('0x35')](_0x357689[_0x065e('0x37')],_0x357689[_0x065e('0x32')]);_0x46ec96[_0x065e('0x36')]=_[_0x065e('0x35')](_0x357689[_0x065e('0x37')],qs[_0x065e('0x38')](_0x260d12[_0x065e('0x32')][_0x065e('0x38')]));_0x46ec96[_0x065e('0x36')]=_0x46ec96[_0x065e('0x36')]['length']?_0x46ec96[_0x065e('0x36')]:_0x357689[_0x065e('0x37')];_0x46ec96[_0x065e('0x4e')]=qs[_0x065e('0x3c')](_0x260d12['query'][_0x065e('0x3c')]);_0x46ec96[_0x065e('0x3d')]=qs[_0x065e('0x34')](_[_0x065e('0x50')](_0x260d12['query'],_0x357689[_0x065e('0x34')]));if(_0x260d12[_0x065e('0x32')]['filter']){_0x46ec96[_0x065e('0x3d')]=_[_0x065e('0x3f')](_0x46ec96[_0x065e('0x3d')],{'$or':_['map'](_0x46ec96[_0x065e('0x36')],function(_0x47e0b1){var _0x4b1766={};_0x4b1766[_0x47e0b1]={'$like':'%'+_0x260d12[_0x065e('0x32')][_0x065e('0x3e')]+'%'};return _0x4b1766;})});}_0x46ec96=_[_0x065e('0x3f')]({},_0x46ec96,_0x260d12[_0x065e('0x41')]);return _0x348bbd[_0x065e('0x51')](_0x46ec96);}})[_0x065e('0x28')](function(_0x2ca09f){if(_0x2ca09f){_0x306cb5=_0x2ca09f[_0x065e('0x39')];if(!_0x260d12['query'][_0x065e('0x3a')](_0x065e('0x3b'))){_0x46ec96[_0x065e('0x21')]=qs['limit'](_0x260d12[_0x065e('0x32')][_0x065e('0x21')]);_0x46ec96[_0x065e('0x1f')]=qs[_0x065e('0x1f')](_0x260d12[_0x065e('0x32')][_0x065e('0x1f')]);}return _0x348bbd[_0x065e('0x51')](_0x46ec96);}})[_0x065e('0x28')](function(_0x149bbd){if(_0x149bbd){return _0x149bbd?{'count':_0x306cb5,'rows':_0x149bbd}:null;}})[_0x065e('0x28')](respondWithResult(_0x2ed651,null))[_0x065e('0x49')](handleError(_0x2ed651,null));};
\ No newline at end of file
index 3add38e..9042e48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefd2=['rimraf','exports','define','SalesforceConfiguration','lodash','util','moment','bluebird','request-promise','path'];(function(_0x1b6eae,_0x3eb5db){var _0x28c7cd=function(_0x1bdcf0){while(--_0x1bdcf0){_0x1b6eae['push'](_0x1b6eae['shift']());}};_0x28c7cd(++_0x3eb5db);}(_0xefd2,0x144));var _0x2efd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xefd2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2efd('0x0'));var util=require(_0x2efd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2efd('0x2'));var BPromise=require(_0x2efd('0x3'));var rp=require(_0x2efd('0x4'));var fs=require('fs');var path=require(_0x2efd('0x5'));var rimraf=require(_0x2efd('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x2efd('0x7')]=function(_0x440154,_0xbd7f80){return _0x440154[_0x2efd('0x8')](_0x2efd('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x82aa=['define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports'];(function(_0x18c1d9,_0x3afc37){var _0xc16a66=function(_0x4a2869){while(--_0x4a2869){_0x18c1d9['push'](_0x18c1d9['shift']());}};_0xc16a66(++_0x3afc37);}(_0x82aa,0xc6));var _0xa82a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x82aa[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xa82a('0x0'));var util=require(_0xa82a('0x1'));var logger=require(_0xa82a('0x2'))('api');var moment=require(_0xa82a('0x3'));var BPromise=require(_0xa82a('0x4'));var rp=require(_0xa82a('0x5'));var fs=require('fs');var path=require(_0xa82a('0x6'));var rimraf=require(_0xa82a('0x7'));var config=require('../../config/environment');var attributes=require(_0xa82a('0x8'));module[_0xa82a('0x9')]=function(_0x537bd9,_0x1129ea){return _0x537bd9[_0xa82a('0xa')](_0xa82a('0xb'),attributes,{'tableName':_0xa82a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c8815be..9eecb3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2478=['SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code'];(function(_0x3cbe3a,_0x78bfce){var _0x24ffc1=function(_0x103ae4){while(--_0x103ae4){_0x3cbe3a['push'](_0x3cbe3a['shift']());}};_0x24ffc1(++_0x78bfce);}(_0x2478,0x11c));var _0x8247=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x2478[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8247('0x0'));var rs=require(_0x8247('0x1'));var fs=require('fs');var Redis=require(_0x8247('0x2'));var db=require(_0x8247('0x3'))['db'];var utils=require(_0x8247('0x4'));var logger=require(_0x8247('0x5'))('rpc');var config=require(_0x8247('0x6'));var jayson=require(_0x8247('0x7'));var client=jayson[_0x8247('0x8')][_0x8247('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56a65,_0x32338a,_0x3c8976){return new BPromise(function(_0x32cdeb,_0x3bf77a){return client['request'](_0x56a65,_0x3c8976)[_0x8247('0xa')](function(_0x5d9bb6){logger[_0x8247('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x32338a,_0x8247('0xc'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x32338a,_0x8247('0xc'),JSON[_0x8247('0xd')](_0x5d9bb6));if(_0x5d9bb6[_0x8247('0xe')]){if(_0x5d9bb6[_0x8247('0xe')][_0x8247('0xf')]===0x1f4){logger[_0x8247('0xe')](_0x8247('0x10'),_0x32338a,_0x5d9bb6['error'][_0x8247('0x11')]);return _0x3bf77a(_0x5d9bb6[_0x8247('0xe')][_0x8247('0x11')]);}logger[_0x8247('0xe')](_0x8247('0x10'),_0x32338a,_0x5d9bb6[_0x8247('0xe')][_0x8247('0x11')]);return _0x32cdeb(_0x5d9bb6[_0x8247('0xe')][_0x8247('0x11')]);}else{logger[_0x8247('0xb')](_0x8247('0x10'),_0x32338a,_0x8247('0xc'));_0x32cdeb(_0x5d9bb6[_0x8247('0x12')]['message']);}})[_0x8247('0x13')](function(_0x13a6e5){logger[_0x8247('0xe')](_0x8247('0x10'),_0x32338a,_0x13a6e5);_0x3bf77a(_0x13a6e5);});});}
\ No newline at end of file
+var _0x88b7=['rpc','jayson/promise','client','http','request','then','request\x20sent','debug','error','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x5e434d,_0x5ed997){var _0x27b37d=function(_0xd1ff54){while(--_0xd1ff54){_0x5e434d['push'](_0x5e434d['shift']());}};_0x27b37d(++_0x5ed997);}(_0x88b7,0x9a));var _0x788b=function(_0x478c55,_0x4d8760){_0x478c55=_0x478c55-0x0;var _0x161eb2=_0x88b7[_0x478c55];return _0x161eb2;};'use strict';var _=require(_0x788b('0x0'));var util=require(_0x788b('0x1'));var moment=require('moment');var BPromise=require(_0x788b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x788b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x788b('0x4'));var logger=require(_0x788b('0x5'))(_0x788b('0x6'));var config=require('../../config/environment');var jayson=require(_0x788b('0x7'));var client=jayson[_0x788b('0x8')][_0x788b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26dbe3,_0x406040,_0x29199a){return new BPromise(function(_0x3d08ef,_0x33437c){return client[_0x788b('0xa')](_0x26dbe3,_0x29199a)[_0x788b('0xb')](function(_0x755803){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x406040,_0x788b('0xc'));logger[_0x788b('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x406040,'request\x20sent',JSON['stringify'](_0x755803));if(_0x755803[_0x788b('0xe')]){if(_0x755803[_0x788b('0xe')]['code']===0x1f4){logger[_0x788b('0xe')](_0x788b('0xf'),_0x406040,_0x755803[_0x788b('0xe')][_0x788b('0x10')]);return _0x33437c(_0x755803[_0x788b('0xe')][_0x788b('0x10')]);}logger[_0x788b('0xe')](_0x788b('0xf'),_0x406040,_0x755803['error']['message']);return _0x3d08ef(_0x755803['error']['message']);}else{logger[_0x788b('0x11')](_0x788b('0xf'),_0x406040,_0x788b('0xc'));_0x3d08ef(_0x755803[_0x788b('0x12')][_0x788b('0x10')]);}})[_0x788b('0x13')](function(_0x484606){logger[_0x788b('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x406040,_0x484606);_0x33437c(_0x484606);});});}
\ No newline at end of file
index 56674ed..2486d58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb1=['/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','index'];(function(_0x8854d6,_0x18f068){var _0x481689=function(_0x24fc2a){while(--_0x24fc2a){_0x8854d6['push'](_0x8854d6['shift']());}};_0x481689(++_0x18f068);}(_0x5eb1,0x16e));var _0x15eb=function(_0x14d250,_0x4b2e12){_0x14d250=_0x14d250-0x0;var _0xb991d8=_0x5eb1[_0x14d250];return _0xb991d8;};'use strict';var multer=require(_0x15eb('0x0'));var util=require(_0x15eb('0x1'));var path=require(_0x15eb('0x2'));var timeout=require(_0x15eb('0x3'));var express=require(_0x15eb('0x4'));var router=express[_0x15eb('0x5')]();var fs_extra=require(_0x15eb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x15eb('0x7'));var config=require(_0x15eb('0x8'));var controller=require(_0x15eb('0x9'));router[_0x15eb('0xa')]('/',auth['isAuthenticated'](),controller[_0x15eb('0xb')]);router[_0x15eb('0xa')](_0x15eb('0xc'),auth[_0x15eb('0xd')](),controller[_0x15eb('0xe')]);router[_0x15eb('0xf')]('/',auth[_0x15eb('0xd')](),controller[_0x15eb('0x10')]);router['put']('/:id',auth[_0x15eb('0xd')](),controller[_0x15eb('0x11')]);router[_0x15eb('0x12')](_0x15eb('0xc'),auth[_0x15eb('0xd')](),controller[_0x15eb('0x13')]);module[_0x15eb('0x14')]=router;
\ No newline at end of file
+var _0x661a=['get','/:id','show','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x661a,0x1cf));var _0xa661=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0x661a[_0x5179a5];return _0x15c8ce;};'use strict';var multer=require('multer');var util=require(_0xa661('0x0'));var path=require(_0xa661('0x1'));var timeout=require(_0xa661('0x2'));var express=require(_0xa661('0x3'));var router=express[_0xa661('0x4')]();var fs_extra=require(_0xa661('0x5'));var auth=require(_0xa661('0x6'));var interaction=require(_0xa661('0x7'));var config=require(_0xa661('0x8'));var controller=require(_0xa661('0x9'));router['get']('/',auth[_0xa661('0xa')](),controller[_0xa661('0xb')]);router[_0xa661('0xc')](_0xa661('0xd'),auth[_0xa661('0xa')](),controller[_0xa661('0xe')]);router['post']('/',auth[_0xa661('0xa')](),controller[_0xa661('0xf')]);router['put']('/:id',auth[_0xa661('0xa')](),controller[_0xa661('0x10')]);router[_0xa661('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa661('0x12')]);module['exports']=router;
\ No newline at end of file
index 2d18d9a..1b3a49b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ac1=['string','variable','customVariable','keyValue','STRING','exports','ENUM'];(function(_0x23a477,_0x3628f2){var _0x332ecd=function(_0x54be8b){while(--_0x54be8b){_0x23a477['push'](_0x23a477['shift']());}};_0x332ecd(++_0x3628f2);}(_0x6ac1,0x15c));var _0x16ac=function(_0x22f53f,_0x14ef66){_0x22f53f=_0x22f53f-0x0;var _0x57bc67=_0x6ac1[_0x22f53f];return _0x57bc67;};'use strict';var Sequelize=require('sequelize');module[_0x16ac('0x0')]={'type':{'type':Sequelize[_0x16ac('0x1')](_0x16ac('0x2'),_0x16ac('0x3'),_0x16ac('0x4'),_0x16ac('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x16ac('0x6')]},'keyType':{'type':Sequelize[_0x16ac('0x1')](_0x16ac('0x2'),_0x16ac('0x3'),_0x16ac('0x4'))},'keyContent':{'type':Sequelize[_0x16ac('0x6')]},'idField':{'type':Sequelize[_0x16ac('0x6')]},'variableName':{'type':Sequelize[_0x16ac('0x6')]}};
\ No newline at end of file
+var _0x2a90=['variable','customVariable','picklist','STRING','exports','ENUM','string'];(function(_0x59961b,_0x4895ff){var _0x5254e2=function(_0x4dcb06){while(--_0x4dcb06){_0x59961b['push'](_0x59961b['shift']());}};_0x5254e2(++_0x4895ff);}(_0x2a90,0x193));var _0x02a9=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2a90[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0x02a9('0x0')]={'type':{'type':Sequelize[_0x02a9('0x1')](_0x02a9('0x2'),_0x02a9('0x3'),_0x02a9('0x4'),'keyValue',_0x02a9('0x5')),'defaultValue':_0x02a9('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x02a9('0x6')]},'keyType':{'type':Sequelize[_0x02a9('0x1')]('string',_0x02a9('0x3'),_0x02a9('0x4'))},'keyContent':{'type':Sequelize[_0x02a9('0x6')]},'idField':{'type':Sequelize[_0x02a9('0x6')]},'variableName':{'type':Sequelize[_0x02a9('0x6')]}};
\ No newline at end of file
index 48fa551..ed32335 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc112=['util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','SalesforceField','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','rawAttributes','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4233b0,_0x5effc4){var _0x31c625=function(_0x212c20){while(--_0x212c20){_0x4233b0['push'](_0x4233b0['shift']());}};_0x31c625(++_0x5effc4);}(_0xc112,0x8e));var _0x2c11=function(_0x15783f,_0x4a0670){_0x15783f=_0x15783f-0x0;var _0x15b342=_0xc112[_0x15783f];return _0x15b342;};'use strict';var emlformat=require(_0x2c11('0x0'));var rimraf=require(_0x2c11('0x1'));var zipdir=require(_0x2c11('0x2'));var jsonpatch=require(_0x2c11('0x3'));var rp=require(_0x2c11('0x4'));var moment=require(_0x2c11('0x5'));var BPromise=require(_0x2c11('0x6'));var Mustache=require(_0x2c11('0x7'));var util=require(_0x2c11('0x8'));var path=require(_0x2c11('0x9'));var sox=require('sox');var csv=require(_0x2c11('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c11('0xb'));var _=require(_0x2c11('0xc'));var squel=require(_0x2c11('0xd'));var crypto=require(_0x2c11('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2c11('0xa'));var querystring=require(_0x2c11('0xf'));var Papa=require(_0x2c11('0x10'));var Redis=require(_0x2c11('0x11'));var authService=require(_0x2c11('0x12'));var qs=require(_0x2c11('0x13'));var as=require(_0x2c11('0x14'));var hardwareService=require(_0x2c11('0x15'));var logger=require(_0x2c11('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x2c11('0x17'));var licenseUtil=require(_0x2c11('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15e205,_0x40eb5a){_0x40eb5a=_0x40eb5a||0xcc;return function(_0x1b145a){if(_0x1b145a){return _0x15e205['sendStatus'](_0x40eb5a);}return _0x15e205[_0x2c11('0x19')](_0x40eb5a)['end']();};}function respondWithResult(_0x52c711,_0x4952f4){_0x4952f4=_0x4952f4||0xc8;return function(_0x25aa2e){if(_0x25aa2e){return _0x52c711[_0x2c11('0x19')](_0x4952f4)['json'](_0x25aa2e);}};}function respondWithFilteredResult(_0x1227c8,_0x1fbee5){return function(_0x1bb5cd){if(_0x1bb5cd){var _0x449a9c=typeof _0x1fbee5[_0x2c11('0x1a')]==='undefined'&&typeof _0x1fbee5[_0x2c11('0x1b')]===_0x2c11('0x1c');var _0x1d8a9c=_0x1bb5cd[_0x2c11('0x1d')];var _0x1456d3=_0x449a9c?0x0:_0x1fbee5['offset'];var _0x151eec=_0x449a9c?_0x1bb5cd[_0x2c11('0x1d')]:_0x1fbee5[_0x2c11('0x1a')]+_0x1fbee5[_0x2c11('0x1b')];var _0x4cbe21;if(_0x151eec>=_0x1d8a9c){_0x151eec=_0x1d8a9c;_0x4cbe21=0xc8;}else{_0x4cbe21=0xce;}_0x1227c8[_0x2c11('0x19')](_0x4cbe21);return _0x1227c8[_0x2c11('0x1e')](_0x2c11('0x1f'),_0x1456d3+'-'+_0x151eec+'/'+_0x1d8a9c)[_0x2c11('0x20')](_0x1bb5cd);}return null;};}function patchUpdates(_0x49d4d7){return function(_0x56a19f){try{jsonpatch[_0x2c11('0x21')](_0x56a19f,_0x49d4d7,!![]);}catch(_0xc1009a){return BPromise[_0x2c11('0x22')](_0xc1009a);}return _0x56a19f[_0x2c11('0x23')]();};}function saveUpdates(_0x4c5384,_0x3bb2da){return function(_0x4f8a90){if(_0x4f8a90){return _0x4f8a90[_0x2c11('0x24')](_0x4c5384)[_0x2c11('0x25')](function(_0x13b106){return _0x13b106;});}return null;};}function removeEntity(_0x458930,_0x120a2b){return function(_0x4c96b8){if(_0x4c96b8){return _0x4c96b8[_0x2c11('0x26')]()[_0x2c11('0x25')](function(){_0x458930[_0x2c11('0x19')](0xcc)[_0x2c11('0x27')]();});}};}function handleEntityNotFound(_0xc9cf32,_0x511fa7){return function(_0x15eeea){if(!_0x15eeea){_0xc9cf32[_0x2c11('0x28')](0x194);}return _0x15eeea;};}function handleError(_0x4169e5,_0x2fa0af){_0x2fa0af=_0x2fa0af||0x1f4;return function(_0x4b24e1){logger[_0x2c11('0x29')](_0x4b24e1[_0x2c11('0x2a')]);if(_0x4b24e1[_0x2c11('0x2b')]){delete _0x4b24e1[_0x2c11('0x2b')];}_0x4169e5[_0x2c11('0x19')](_0x2fa0af)['send'](_0x4b24e1);};}exports[_0x2c11('0x2c')]=function(_0x4e813f,_0x52583f){var _0x443b2f={},_0x1b9be4={},_0x34be5f={'count':0x0,'rows':[]};var _0x25d74e=_[_0x2c11('0x2d')](db[_0x2c11('0x2e')]['rawAttributes'],function(_0xca2fe5){return{'name':_0xca2fe5[_0x2c11('0x2f')],'type':_0xca2fe5[_0x2c11('0x30')]['key']};});_0x1b9be4[_0x2c11('0x31')]=_[_0x2c11('0x2d')](_0x25d74e,_0x2c11('0x2b'));_0x1b9be4['query']=_[_0x2c11('0x32')](_0x4e813f[_0x2c11('0x33')]);_0x1b9be4[_0x2c11('0x34')]=_[_0x2c11('0x35')](_0x1b9be4[_0x2c11('0x31')],_0x1b9be4['query']);_0x443b2f['attributes']=_[_0x2c11('0x35')](_0x1b9be4[_0x2c11('0x31')],qs[_0x2c11('0x36')](_0x4e813f[_0x2c11('0x33')]['fields']));_0x443b2f[_0x2c11('0x37')]=_0x443b2f[_0x2c11('0x37')]['length']?_0x443b2f[_0x2c11('0x37')]:_0x1b9be4[_0x2c11('0x31')];if(!_0x4e813f[_0x2c11('0x33')][_0x2c11('0x38')](_0x2c11('0x39'))){_0x443b2f[_0x2c11('0x1b')]=qs[_0x2c11('0x1b')](_0x4e813f[_0x2c11('0x33')][_0x2c11('0x1b')]);_0x443b2f[_0x2c11('0x1a')]=qs[_0x2c11('0x1a')](_0x4e813f[_0x2c11('0x33')][_0x2c11('0x1a')]);}_0x443b2f[_0x2c11('0x3a')]=qs['sort'](_0x4e813f['query'][_0x2c11('0x3b')]);_0x443b2f[_0x2c11('0x3c')]=qs[_0x2c11('0x34')](_[_0x2c11('0x3d')](_0x4e813f['query'],_0x1b9be4['filters']),_0x25d74e);if(_0x4e813f['query'][_0x2c11('0x3e')]){_0x443b2f[_0x2c11('0x3c')]=_[_0x2c11('0x3f')](_0x443b2f['where'],{'$or':_[_0x2c11('0x2d')](_0x25d74e,function(_0x5b5683){if(_0x5b5683['type']!==_0x2c11('0x40')){var _0x411c0c={};_0x411c0c[_0x5b5683[_0x2c11('0x2b')]]={'$like':'%'+_0x4e813f[_0x2c11('0x33')]['filter']+'%'};return _0x411c0c;}})});}_0x443b2f=_['merge']({},_0x443b2f,_0x4e813f[_0x2c11('0x41')]);var _0x4b4e88={'where':_0x443b2f[_0x2c11('0x3c')]};return db[_0x2c11('0x2e')]['count'](_0x4b4e88)['then'](function(_0x2b66b9){_0x34be5f['count']=_0x2b66b9;if(_0x4e813f['query']['includeAll']){_0x443b2f[_0x2c11('0x42')]=[{'all':!![]}];}return db[_0x2c11('0x2e')][_0x2c11('0x43')](_0x443b2f);})['then'](function(_0x42d917){_0x34be5f['rows']=_0x42d917;return _0x34be5f;})[_0x2c11('0x25')](respondWithFilteredResult(_0x52583f,_0x443b2f))[_0x2c11('0x44')](handleError(_0x52583f,null));};exports[_0x2c11('0x45')]=function(_0x13c76e,_0x19fd66){var _0x53af68={'raw':!![],'where':{'id':_0x13c76e['params']['id']}},_0x1adb38={};_0x1adb38[_0x2c11('0x31')]=_['keys'](db[_0x2c11('0x2e')][_0x2c11('0x46')]);_0x1adb38[_0x2c11('0x33')]=_[_0x2c11('0x32')](_0x13c76e[_0x2c11('0x33')]);_0x1adb38[_0x2c11('0x34')]=_['intersection'](_0x1adb38[_0x2c11('0x31')],_0x1adb38[_0x2c11('0x33')]);_0x53af68['attributes']=_['intersection'](_0x1adb38['model'],qs[_0x2c11('0x36')](_0x13c76e['query'][_0x2c11('0x36')]));_0x53af68['attributes']=_0x53af68['attributes']['length']?_0x53af68[_0x2c11('0x37')]:_0x1adb38['model'];if(_0x13c76e[_0x2c11('0x33')]['includeAll']){_0x53af68[_0x2c11('0x42')]=[{'all':!![]}];}_0x53af68=_[_0x2c11('0x3f')]({},_0x53af68,_0x13c76e[_0x2c11('0x41')]);return db[_0x2c11('0x2e')]['find'](_0x53af68)['then'](handleEntityNotFound(_0x19fd66,null))[_0x2c11('0x25')](respondWithResult(_0x19fd66,null))[_0x2c11('0x44')](handleError(_0x19fd66,null));};exports[_0x2c11('0x47')]=function(_0xc40f14,_0x33c79f){return db[_0x2c11('0x2e')][_0x2c11('0x47')](_0xc40f14[_0x2c11('0x48')],{})[_0x2c11('0x25')](respondWithResult(_0x33c79f,0xc9))[_0x2c11('0x44')](handleError(_0x33c79f,null));};exports['update']=function(_0x217330,_0x3a5aa5){if(_0x217330[_0x2c11('0x48')]['id']){delete _0x217330[_0x2c11('0x48')]['id'];}return db['SalesforceField'][_0x2c11('0x49')]({'where':{'id':_0x217330[_0x2c11('0x4a')]['id']}})[_0x2c11('0x25')](handleEntityNotFound(_0x3a5aa5,null))[_0x2c11('0x25')](saveUpdates(_0x217330[_0x2c11('0x48')],null))[_0x2c11('0x25')](respondWithResult(_0x3a5aa5,null))[_0x2c11('0x44')](handleError(_0x3a5aa5,null));};exports[_0x2c11('0x26')]=function(_0xb0edbe,_0x180775){return db[_0x2c11('0x2e')]['find']({'where':{'id':_0xb0edbe[_0x2c11('0x4a')]['id']}})[_0x2c11('0x25')](handleEntityNotFound(_0x180775,null))['then'](removeEntity(_0x180775,null))[_0x2c11('0x44')](handleError(_0x180775,null));};
\ No newline at end of file
+var _0x74fc=['mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','key','model','query','keys','filters','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','intersection','fields','length','include','body','find','params','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0xb09342,_0x5458f9){var _0x561472=function(_0x1f837b){while(--_0x1f837b){_0xb09342['push'](_0xb09342['shift']());}};_0x561472(++_0x5458f9);}(_0x74fc,0x12f));var _0xc74f=function(_0x502206,_0x231dc7){_0x502206=_0x502206-0x0;var _0x533db4=_0x74fc[_0x502206];return _0x533db4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc74f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc74f('0x1'));var rp=require(_0xc74f('0x2'));var moment=require(_0xc74f('0x3'));var BPromise=require(_0xc74f('0x4'));var Mustache=require(_0xc74f('0x5'));var util=require(_0xc74f('0x6'));var path=require(_0xc74f('0x7'));var sox=require(_0xc74f('0x8'));var csv=require(_0xc74f('0x9'));var ejs=require(_0xc74f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc74f('0xb'));var squel=require(_0xc74f('0xc'));var crypto=require(_0xc74f('0xd'));var jsforce=require(_0xc74f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc74f('0xf'));var Papa=require(_0xc74f('0x10'));var Redis=require(_0xc74f('0x11'));var authService=require(_0xc74f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc74f('0x13'));var hardwareService=require(_0xc74f('0x14'));var logger=require(_0xc74f('0x15'))(_0xc74f('0x16'));var utils=require(_0xc74f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc74f('0x18'));var db=require(_0xc74f('0x19'))['db'];function respondWithStatusCode(_0x33fc89,_0x3f4068){_0x3f4068=_0x3f4068||0xcc;return function(_0x10a7b9){if(_0x10a7b9){return _0x33fc89[_0xc74f('0x1a')](_0x3f4068);}return _0x33fc89['status'](_0x3f4068)[_0xc74f('0x1b')]();};}function respondWithResult(_0xde1531,_0x1e48ec){_0x1e48ec=_0x1e48ec||0xc8;return function(_0x113d2c){if(_0x113d2c){return _0xde1531[_0xc74f('0x1c')](_0x1e48ec)[_0xc74f('0x1d')](_0x113d2c);}};}function respondWithFilteredResult(_0x1d31e4,_0x1c0bbe){return function(_0x30bb3c){if(_0x30bb3c){var _0x348175=typeof _0x1c0bbe['offset']===_0xc74f('0x1e')&&typeof _0x1c0bbe[_0xc74f('0x1f')]===_0xc74f('0x1e');var _0x5db09e=_0x30bb3c[_0xc74f('0x20')];var _0x335fe1=_0x348175?0x0:_0x1c0bbe[_0xc74f('0x21')];var _0x27c46c=_0x348175?_0x30bb3c[_0xc74f('0x20')]:_0x1c0bbe[_0xc74f('0x21')]+_0x1c0bbe['limit'];var _0x1abd61;if(_0x27c46c>=_0x5db09e){_0x27c46c=_0x5db09e;_0x1abd61=0xc8;}else{_0x1abd61=0xce;}_0x1d31e4['status'](_0x1abd61);return _0x1d31e4[_0xc74f('0x22')](_0xc74f('0x23'),_0x335fe1+'-'+_0x27c46c+'/'+_0x5db09e)[_0xc74f('0x1d')](_0x30bb3c);}return null;};}function patchUpdates(_0x333f17){return function(_0xe01dd9){try{jsonpatch[_0xc74f('0x24')](_0xe01dd9,_0x333f17,!![]);}catch(_0x1c8fed){return BPromise[_0xc74f('0x25')](_0x1c8fed);}return _0xe01dd9['save']();};}function saveUpdates(_0x12b550,_0x43d319){return function(_0x40d016){if(_0x40d016){return _0x40d016[_0xc74f('0x26')](_0x12b550)[_0xc74f('0x27')](function(_0x224237){return _0x224237;});}return null;};}function removeEntity(_0x41d620,_0x301a56){return function(_0x28ae4d){if(_0x28ae4d){return _0x28ae4d[_0xc74f('0x28')]()[_0xc74f('0x27')](function(){_0x41d620[_0xc74f('0x1c')](0xcc)[_0xc74f('0x1b')]();});}};}function handleEntityNotFound(_0x438104,_0x32538a){return function(_0x32ee88){if(!_0x32ee88){_0x438104[_0xc74f('0x1a')](0x194);}return _0x32ee88;};}function handleError(_0x19e3d3,_0x254716){_0x254716=_0x254716||0x1f4;return function(_0x224ca8){logger[_0xc74f('0x29')](_0x224ca8[_0xc74f('0x2a')]);if(_0x224ca8['name']){delete _0x224ca8[_0xc74f('0x2b')];}_0x19e3d3[_0xc74f('0x1c')](_0x254716)[_0xc74f('0x2c')](_0x224ca8);};}exports[_0xc74f('0x2d')]=function(_0x67d80e,_0x18b50e){var _0x499cc7={},_0x227b1c={},_0x117da8={'count':0x0,'rows':[]};var _0x1032cf=_[_0xc74f('0x2e')](db[_0xc74f('0x2f')][_0xc74f('0x30')],function(_0x597040){return{'name':_0x597040[_0xc74f('0x31')],'type':_0x597040['type'][_0xc74f('0x32')]};});_0x227b1c[_0xc74f('0x33')]=_[_0xc74f('0x2e')](_0x1032cf,'name');_0x227b1c[_0xc74f('0x34')]=_[_0xc74f('0x35')](_0x67d80e['query']);_0x227b1c[_0xc74f('0x36')]=_['intersection'](_0x227b1c[_0xc74f('0x33')],_0x227b1c[_0xc74f('0x34')]);_0x499cc7[_0xc74f('0x37')]=_['intersection'](_0x227b1c['model'],qs['fields'](_0x67d80e[_0xc74f('0x34')]['fields']));_0x499cc7[_0xc74f('0x37')]=_0x499cc7[_0xc74f('0x37')]['length']?_0x499cc7[_0xc74f('0x37')]:_0x227b1c[_0xc74f('0x33')];if(!_0x67d80e[_0xc74f('0x34')][_0xc74f('0x38')](_0xc74f('0x39'))){_0x499cc7[_0xc74f('0x1f')]=qs['limit'](_0x67d80e[_0xc74f('0x34')][_0xc74f('0x1f')]);_0x499cc7[_0xc74f('0x21')]=qs[_0xc74f('0x21')](_0x67d80e[_0xc74f('0x34')][_0xc74f('0x21')]);}_0x499cc7[_0xc74f('0x3a')]=qs['sort'](_0x67d80e[_0xc74f('0x34')][_0xc74f('0x3b')]);_0x499cc7[_0xc74f('0x3c')]=qs['filters'](_['pick'](_0x67d80e[_0xc74f('0x34')],_0x227b1c[_0xc74f('0x36')]),_0x1032cf);if(_0x67d80e[_0xc74f('0x34')][_0xc74f('0x3d')]){_0x499cc7[_0xc74f('0x3c')]=_['merge'](_0x499cc7[_0xc74f('0x3c')],{'$or':_[_0xc74f('0x2e')](_0x1032cf,function(_0x34ebd2){if(_0x34ebd2[_0xc74f('0x3e')]!==_0xc74f('0x3f')){var _0x49626d={};_0x49626d[_0x34ebd2[_0xc74f('0x2b')]]={'$like':'%'+_0x67d80e[_0xc74f('0x34')][_0xc74f('0x3d')]+'%'};return _0x49626d;}})});}_0x499cc7=_[_0xc74f('0x40')]({},_0x499cc7,_0x67d80e[_0xc74f('0x41')]);var _0x4d217e={'where':_0x499cc7[_0xc74f('0x3c')]};return db[_0xc74f('0x2f')][_0xc74f('0x20')](_0x4d217e)['then'](function(_0x3e27e5){_0x117da8[_0xc74f('0x20')]=_0x3e27e5;if(_0x67d80e[_0xc74f('0x34')][_0xc74f('0x42')]){_0x499cc7['include']=[{'all':!![]}];}return db[_0xc74f('0x2f')][_0xc74f('0x43')](_0x499cc7);})[_0xc74f('0x27')](function(_0x450615){_0x117da8[_0xc74f('0x44')]=_0x450615;return _0x117da8;})['then'](respondWithFilteredResult(_0x18b50e,_0x499cc7))[_0xc74f('0x45')](handleError(_0x18b50e,null));};exports['show']=function(_0xbf91f6,_0x45c9ba){var _0x337268={'raw':!![],'where':{'id':_0xbf91f6['params']['id']}},_0x1ee15c={};_0x1ee15c[_0xc74f('0x33')]=_[_0xc74f('0x35')](db[_0xc74f('0x2f')][_0xc74f('0x30')]);_0x1ee15c[_0xc74f('0x34')]=_['keys'](_0xbf91f6['query']);_0x1ee15c[_0xc74f('0x36')]=_[_0xc74f('0x46')](_0x1ee15c[_0xc74f('0x33')],_0x1ee15c[_0xc74f('0x34')]);_0x337268[_0xc74f('0x37')]=_['intersection'](_0x1ee15c[_0xc74f('0x33')],qs[_0xc74f('0x47')](_0xbf91f6[_0xc74f('0x34')][_0xc74f('0x47')]));_0x337268[_0xc74f('0x37')]=_0x337268[_0xc74f('0x37')][_0xc74f('0x48')]?_0x337268['attributes']:_0x1ee15c['model'];if(_0xbf91f6[_0xc74f('0x34')]['includeAll']){_0x337268[_0xc74f('0x49')]=[{'all':!![]}];}_0x337268=_['merge']({},_0x337268,_0xbf91f6[_0xc74f('0x41')]);return db[_0xc74f('0x2f')]['find'](_0x337268)['then'](handleEntityNotFound(_0x45c9ba,null))[_0xc74f('0x27')](respondWithResult(_0x45c9ba,null))[_0xc74f('0x45')](handleError(_0x45c9ba,null));};exports['create']=function(_0x354cc3,_0x56103d){return db[_0xc74f('0x2f')]['create'](_0x354cc3['body'],{})['then'](respondWithResult(_0x56103d,0xc9))[_0xc74f('0x45')](handleError(_0x56103d,null));};exports['update']=function(_0x3a0216,_0x55afb6){if(_0x3a0216[_0xc74f('0x4a')]['id']){delete _0x3a0216[_0xc74f('0x4a')]['id'];}return db[_0xc74f('0x2f')][_0xc74f('0x4b')]({'where':{'id':_0x3a0216['params']['id']}})[_0xc74f('0x27')](handleEntityNotFound(_0x55afb6,null))[_0xc74f('0x27')](saveUpdates(_0x3a0216[_0xc74f('0x4a')],null))['then'](respondWithResult(_0x55afb6,null))[_0xc74f('0x45')](handleError(_0x55afb6,null));};exports[_0xc74f('0x28')]=function(_0x3aaf59,_0x3ffb89){return db[_0xc74f('0x2f')][_0xc74f('0x4b')]({'where':{'id':_0x3aaf59[_0xc74f('0x4c')]['id']}})[_0xc74f('0x27')](handleEntityNotFound(_0x3ffb89,null))['then'](removeEntity(_0x3ffb89,null))['catch'](handleError(_0x3ffb89,null));};
\ No newline at end of file
index 5c2b9e0..7360a85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6d6=['lodash','util','api','moment','bluebird','rimraf','../../config/environment','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xb6d6,0x9a));var _0x6b6d=function(_0x43d65d,_0x54d57c){_0x43d65d=_0x43d65d-0x0;var _0x2a5f77=_0xb6d6[_0x43d65d];return _0x2a5f77;};'use strict';var _=require(_0x6b6d('0x0'));var util=require(_0x6b6d('0x1'));var logger=require('../../config/logger')(_0x6b6d('0x2'));var moment=require(_0x6b6d('0x3'));var BPromise=require(_0x6b6d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6b6d('0x5'));var config=require(_0x6b6d('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0x6b6d('0x7')]=function(_0x789d06,_0x5d276c){return _0x789d06[_0x6b6d('0x8')](_0x6b6d('0x9'),attributes,{'tableName':_0x6b6d('0xa'),'paranoid':![],'indexes':[{'name':_0x6b6d('0xb'),'fields':[_0x6b6d('0xc'),_0x6b6d('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf2b6=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xf2b6,0x12a));var _0x6f2b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xf2b6[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x6f2b('0x0'));var util=require(_0x6f2b('0x1'));var logger=require(_0x6f2b('0x2'))(_0x6f2b('0x3'));var moment=require(_0x6f2b('0x4'));var BPromise=require(_0x6f2b('0x5'));var rp=require(_0x6f2b('0x6'));var fs=require('fs');var path=require(_0x6f2b('0x7'));var rimraf=require(_0x6f2b('0x8'));var config=require(_0x6f2b('0x9'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x147b76,_0x52498f){return _0x147b76[_0x6f2b('0xa')]('SalesforceField',attributes,{'tableName':_0x6f2b('0xb'),'paranoid':![],'indexes':[{'name':_0x6f2b('0xc'),'fields':[_0x6f2b('0xd'),_0x6f2b('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 4a25e87..1d4816c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6360=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1c0f41,_0x26d95d){var _0x369a9f=function(_0x251234){while(--_0x251234){_0x1c0f41['push'](_0x1c0f41['shift']());}};_0x369a9f(++_0x26d95d);}(_0x6360,0x1c9));var _0x0636=function(_0x19ecdb,_0x253521){_0x19ecdb=_0x19ecdb-0x0;var _0x792ec9=_0x6360[_0x19ecdb];return _0x792ec9;};'use strict';var _=require(_0x0636('0x0'));var util=require(_0x0636('0x1'));var moment=require(_0x0636('0x2'));var BPromise=require(_0x0636('0x3'));var rs=require(_0x0636('0x4'));var fs=require('fs');var Redis=require(_0x0636('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0636('0x6'));var logger=require(_0x0636('0x7'))(_0x0636('0x8'));var config=require('../../config/environment');var jayson=require(_0x0636('0x9'));var client=jayson['client'][_0x0636('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ea304,_0x325978,_0x4bce45){return new BPromise(function(_0xa73ca,_0x533b40){return client[_0x0636('0xb')](_0x1ea304,_0x4bce45)['then'](function(_0x3e85ff){logger[_0x0636('0xc')](_0x0636('0xd'),_0x325978,'request\x20sent');logger[_0x0636('0xe')](_0x0636('0xf'),_0x325978,_0x0636('0x10'),JSON['stringify'](_0x3e85ff));if(_0x3e85ff[_0x0636('0x11')]){if(_0x3e85ff['error'][_0x0636('0x12')]===0x1f4){logger[_0x0636('0x11')](_0x0636('0xd'),_0x325978,_0x3e85ff['error'][_0x0636('0x13')]);return _0x533b40(_0x3e85ff[_0x0636('0x11')][_0x0636('0x13')]);}logger['error'](_0x0636('0xd'),_0x325978,_0x3e85ff[_0x0636('0x11')][_0x0636('0x13')]);return _0xa73ca(_0x3e85ff[_0x0636('0x11')][_0x0636('0x13')]);}else{logger[_0x0636('0xc')](_0x0636('0xd'),_0x325978,_0x0636('0x10'));_0xa73ca(_0x3e85ff[_0x0636('0x14')][_0x0636('0x13')]);}})[_0x0636('0x15')](function(_0x23d3fc){logger['error'](_0x0636('0xd'),_0x325978,_0x23d3fc);_0x533b40(_0x23d3fc);});});}
\ No newline at end of file
+var _0xd008=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash'];(function(_0x14016c,_0x5d7d8e){var _0x44a523=function(_0x2e4fca){while(--_0x2e4fca){_0x14016c['push'](_0x14016c['shift']());}};_0x44a523(++_0x5d7d8e);}(_0xd008,0x1f3));var _0x8d00=function(_0xdae3e3,_0x2355de){_0xdae3e3=_0xdae3e3-0x0;var _0x5c5ee0=_0xd008[_0xdae3e3];return _0x5c5ee0;};'use strict';var _=require(_0x8d00('0x0'));var util=require('util');var moment=require(_0x8d00('0x1'));var BPromise=require(_0x8d00('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d00('0x3'));var db=require(_0x8d00('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d00('0x5'))(_0x8d00('0x6'));var config=require('../../config/environment');var jayson=require(_0x8d00('0x7'));var client=jayson[_0x8d00('0x8')][_0x8d00('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44ba4b,_0x12f291,_0x12a39d){return new BPromise(function(_0x519c45,_0x102129){return client[_0x8d00('0xa')](_0x44ba4b,_0x12a39d)[_0x8d00('0xb')](function(_0xa5adaf){logger['info'](_0x8d00('0xc'),_0x12f291,_0x8d00('0xd'));logger[_0x8d00('0xe')](_0x8d00('0xf'),_0x12f291,_0x8d00('0xd'),JSON[_0x8d00('0x10')](_0xa5adaf));if(_0xa5adaf['error']){if(_0xa5adaf[_0x8d00('0x11')]['code']===0x1f4){logger[_0x8d00('0x11')]('SalesforceField,\x20%s,\x20%s',_0x12f291,_0xa5adaf[_0x8d00('0x11')][_0x8d00('0x12')]);return _0x102129(_0xa5adaf[_0x8d00('0x11')][_0x8d00('0x12')]);}logger[_0x8d00('0x11')](_0x8d00('0xc'),_0x12f291,_0xa5adaf['error']['message']);return _0x519c45(_0xa5adaf[_0x8d00('0x11')][_0x8d00('0x12')]);}else{logger[_0x8d00('0x13')]('SalesforceField,\x20%s,\x20%s',_0x12f291,_0x8d00('0xd'));_0x519c45(_0xa5adaf['result'][_0x8d00('0x12')]);}})['catch'](function(_0x489e85){logger[_0x8d00('0x11')](_0x8d00('0xc'),_0x12f291,_0x489e85);_0x102129(_0x489e85);});});}
\ No newline at end of file
index 81460bc..4387fec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x195e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','create','post','addConfiguration','update','delete','destroy','multer','util'];(function(_0x3d6eca,_0x15cd90){var _0x3220fb=function(_0x58ef6a){while(--_0x58ef6a){_0x3d6eca['push'](_0x3d6eca['shift']());}};_0x3220fb(++_0x15cd90);}(_0x195e,0xfb));var _0xe195=function(_0x9830cb,_0x293555){_0x9830cb=_0x9830cb-0x0;var _0x100f07=_0x195e[_0x9830cb];return _0x100f07;};'use strict';var multer=require(_0xe195('0x0'));var util=require(_0xe195('0x1'));var path=require(_0xe195('0x2'));var timeout=require(_0xe195('0x3'));var express=require(_0xe195('0x4'));var router=express[_0xe195('0x5')]();var fs_extra=require(_0xe195('0x6'));var auth=require(_0xe195('0x7'));var interaction=require(_0xe195('0x8'));var config=require(_0xe195('0x9'));var controller=require(_0xe195('0xa'));router[_0xe195('0xb')]('/',auth[_0xe195('0xc')](),controller['index']);router[_0xe195('0xb')](_0xe195('0xd'),auth[_0xe195('0xc')](),controller[_0xe195('0xe')]);router[_0xe195('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xe195('0xb')](_0xe195('0xf'),auth[_0xe195('0xc')](),controller[_0xe195('0x10')]);router['post']('/',auth[_0xe195('0xc')](),controller[_0xe195('0x11')]);router[_0xe195('0x12')]('/:id/configurations',auth[_0xe195('0xc')](),controller[_0xe195('0x13')]);router['put'](_0xe195('0xd'),auth[_0xe195('0xc')](),controller[_0xe195('0x14')]);router[_0xe195('0x15')]('/:id',auth[_0xe195('0xc')](),controller[_0xe195('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x4c62=['post','create','/:id/configurations','addConfiguration','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields'];(function(_0x23a477,_0x36bd86){var _0x1a6fb2=function(_0x4e9f26){while(--_0x4e9f26){_0x23a477['push'](_0x23a477['shift']());}};_0x1a6fb2(++_0x36bd86);}(_0x4c62,0x18e));var _0x24c6=function(_0x7ad398,_0x29ec11){_0x7ad398=_0x7ad398-0x0;var _0x46ebfd=_0x4c62[_0x7ad398];return _0x46ebfd;};'use strict';var multer=require(_0x24c6('0x0'));var util=require(_0x24c6('0x1'));var path=require(_0x24c6('0x2'));var timeout=require('connect-timeout');var express=require(_0x24c6('0x3'));var router=express[_0x24c6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x24c6('0x5'));var interaction=require(_0x24c6('0x6'));var config=require(_0x24c6('0x7'));var controller=require(_0x24c6('0x8'));router[_0x24c6('0x9')]('/',auth[_0x24c6('0xa')](),controller[_0x24c6('0xb')]);router['get'](_0x24c6('0xc'),auth[_0x24c6('0xa')](),controller[_0x24c6('0xd')]);router['get']('/:id/configurations',auth[_0x24c6('0xa')](),controller[_0x24c6('0xe')]);router[_0x24c6('0x9')](_0x24c6('0xf'),auth[_0x24c6('0xa')](),controller['getFields']);router[_0x24c6('0x10')]('/',auth['isAuthenticated'](),controller[_0x24c6('0x11')]);router[_0x24c6('0x10')](_0x24c6('0x12'),auth[_0x24c6('0xa')](),controller[_0x24c6('0x13')]);router['put'](_0x24c6('0xc'),auth[_0x24c6('0xa')](),controller[_0x24c6('0x14')]);router[_0x24c6('0x15')](_0x24c6('0xc'),auth[_0x24c6('0xa')](),controller[_0x24c6('0x16')]);module['exports']=router;
\ No newline at end of file
index f9f7e85..9599caf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b20=['exports','STRING','username','remoteUri','sequelize'];(function(_0x36c740,_0x31d564){var _0x4980f7=function(_0x180bed){while(--_0x180bed){_0x36c740['push'](_0x36c740['shift']());}};_0x4980f7(++_0x31d564);}(_0x3b20,0x9f));var _0x03b2=function(_0x26ef31,_0xd8f94b){_0x26ef31=_0x26ef31-0x0;var _0x366f80=_0x3b20[_0x26ef31];return _0x366f80;};'use strict';var Sequelize=require(_0x03b2('0x0'));module[_0x03b2('0x1')]={'name':{'type':Sequelize[_0x03b2('0x2')]},'description':{'type':Sequelize[_0x03b2('0x2')]},'username':{'type':Sequelize[_0x03b2('0x2')],'unique':_0x03b2('0x3')},'password':{'type':Sequelize[_0x03b2('0x2')]},'email':{'type':Sequelize[_0x03b2('0x2')]},'remoteUri':{'type':Sequelize[_0x03b2('0x2')],'unique':_0x03b2('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xe602=['remoteUri','sequelize','exports','STRING'];(function(_0x31210e,_0x2bc3e2){var _0x51d4b8=function(_0x2baeb7){while(--_0x2baeb7){_0x31210e['push'](_0x31210e['shift']());}};_0x51d4b8(++_0x2bc3e2);}(_0xe602,0x79));var _0x2e60=function(_0x5a2467,_0x53684a){_0x5a2467=_0x5a2467-0x0;var _0x2dc9f9=_0xe602[_0x5a2467];return _0x2dc9f9;};'use strict';var Sequelize=require(_0x2e60('0x0'));module[_0x2e60('0x1')]={'name':{'type':Sequelize[_0x2e60('0x2')]},'description':{'type':Sequelize[_0x2e60('0x2')]},'username':{'type':Sequelize[_0x2e60('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x2e60('0x2')]},'email':{'type':Sequelize[_0x2e60('0x2')]},'remoteUri':{'type':Sequelize[_0x2e60('0x2')],'unique':_0x2e60('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 44418ac..2bcc46f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a56=['length','nolimit','sort','where','filter','merge','VIRTUAL','count','include','rows','params','rawAttributes','includeAll','options','find','create','body','catch','destroy','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','knowledge','subcategory','severity','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_by','delivery_plan','impact','active','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','delivery_task','work_start','assignment_group','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','result','incident\x20table\x20objects','assign','remove','includes','label','push','all','log','forEach','concat','ServiceNow\x20error:\x20','statusCode','error','test','Wrong\x20credentials','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','status','set','reject','save','update','then','stack','name','send','map','ServicenowAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x267935,_0x5d4a3c){var _0x383980=function(_0x2d82cc){while(--_0x2d82cc){_0x267935['push'](_0x267935['shift']());}};_0x383980(++_0x5d4a3c);}(_0x6a56,0x131));var _0x66a5=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x6a56[_0x1bc0ae];return _0x501104;};'use strict';var emlformat=require(_0x66a5('0x0'));var rimraf=require(_0x66a5('0x1'));var zipdir=require(_0x66a5('0x2'));var jsonpatch=require(_0x66a5('0x3'));var rp=require(_0x66a5('0x4'));var moment=require('moment');var BPromise=require(_0x66a5('0x5'));var Mustache=require(_0x66a5('0x6'));var util=require(_0x66a5('0x7'));var path=require(_0x66a5('0x8'));var sox=require(_0x66a5('0x9'));var csv=require(_0x66a5('0xa'));var ejs=require(_0x66a5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66a5('0xc'));var squel=require(_0x66a5('0xd'));var crypto=require(_0x66a5('0xe'));var jsforce=require(_0x66a5('0xf'));var deskjs=require(_0x66a5('0x10'));var toCsv=require(_0x66a5('0xa'));var querystring=require(_0x66a5('0x11'));var Papa=require(_0x66a5('0x12'));var Redis=require(_0x66a5('0x13'));var authService=require(_0x66a5('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x66a5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x66a5('0x16'))(_0x66a5('0x17'));var utils=require(_0x66a5('0x18'));var config=require(_0x66a5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x66a5('0x1a'))['db'];var integrations=require(_0x66a5('0x1b'));function respondWithStatusCode(_0xf892f5,_0x176db9){_0x176db9=_0x176db9||0xcc;return function(_0x3b1f3b){if(_0x3b1f3b){return _0xf892f5[_0x66a5('0x1c')](_0x176db9);}return _0xf892f5['status'](_0x176db9)[_0x66a5('0x1d')]();};}function respondWithResult(_0x975113,_0x18d5c7){_0x18d5c7=_0x18d5c7||0xc8;return function(_0x40d2a8){if(_0x40d2a8){return _0x975113['status'](_0x18d5c7)[_0x66a5('0x1e')](_0x40d2a8);}};}function respondWithFilteredResult(_0x181c70,_0x496017){return function(_0x11c846){if(_0x11c846){var _0x2001f0=typeof _0x496017[_0x66a5('0x1f')]===_0x66a5('0x20')&&typeof _0x496017['limit']===_0x66a5('0x20');var _0x199636=_0x11c846['count'];var _0x3c2210=_0x2001f0?0x0:_0x496017[_0x66a5('0x1f')];var _0x5a948f=_0x2001f0?_0x11c846['count']:_0x496017[_0x66a5('0x1f')]+_0x496017[_0x66a5('0x21')];var _0x115234;if(_0x5a948f>=_0x199636){_0x5a948f=_0x199636;_0x115234=0xc8;}else{_0x115234=0xce;}_0x181c70[_0x66a5('0x22')](_0x115234);return _0x181c70[_0x66a5('0x23')]('Content-Range',_0x3c2210+'-'+_0x5a948f+'/'+_0x199636)['json'](_0x11c846);}return null;};}function patchUpdates(_0x4002b7){return function(_0x42b700){try{jsonpatch['apply'](_0x42b700,_0x4002b7,!![]);}catch(_0x2dc11f){return BPromise[_0x66a5('0x24')](_0x2dc11f);}return _0x42b700[_0x66a5('0x25')]();};}function saveUpdates(_0xe74f2e,_0x480921){return function(_0x38bce4){if(_0x38bce4){return _0x38bce4[_0x66a5('0x26')](_0xe74f2e)[_0x66a5('0x27')](function(_0x4b99ad){return _0x4b99ad;});}return null;};}function removeEntity(_0x3a4e37,_0x5a5b5f){return function(_0x40256f){if(_0x40256f){return _0x40256f['destroy']()[_0x66a5('0x27')](function(){_0x3a4e37['status'](0xcc)[_0x66a5('0x1d')]();});}};}function handleEntityNotFound(_0x106b91,_0x874ec9){return function(_0x183cd2){if(!_0x183cd2){_0x106b91['sendStatus'](0x194);}return _0x183cd2;};}function handleError(_0x2c61b5,_0x36c262){_0x36c262=_0x36c262||0x1f4;return function(_0x3d6ac5){logger['error'](_0x3d6ac5[_0x66a5('0x28')]);if(_0x3d6ac5['name']){delete _0x3d6ac5[_0x66a5('0x29')];}_0x2c61b5[_0x66a5('0x22')](_0x36c262)[_0x66a5('0x2a')](_0x3d6ac5);};}exports['index']=function(_0x2ae1c8,_0x5c862b){var _0x8cc280={},_0x2eaa61={},_0x2e9cc0={'count':0x0,'rows':[]};var _0x1ee952=_[_0x66a5('0x2b')](db[_0x66a5('0x2c')]['rawAttributes'],function(_0x33864e){return{'name':_0x33864e[_0x66a5('0x2d')],'type':_0x33864e[_0x66a5('0x2e')][_0x66a5('0x2f')]};});_0x2eaa61[_0x66a5('0x30')]=_[_0x66a5('0x2b')](_0x1ee952,_0x66a5('0x29'));_0x2eaa61[_0x66a5('0x31')]=_[_0x66a5('0x32')](_0x2ae1c8[_0x66a5('0x31')]);_0x2eaa61[_0x66a5('0x33')]=_[_0x66a5('0x34')](_0x2eaa61[_0x66a5('0x30')],_0x2eaa61['query']);_0x8cc280[_0x66a5('0x35')]=_[_0x66a5('0x34')](_0x2eaa61[_0x66a5('0x30')],qs[_0x66a5('0x36')](_0x2ae1c8[_0x66a5('0x31')][_0x66a5('0x36')]));_0x8cc280[_0x66a5('0x35')]=_0x8cc280[_0x66a5('0x35')][_0x66a5('0x37')]?_0x8cc280[_0x66a5('0x35')]:_0x2eaa61[_0x66a5('0x30')];if(!_0x2ae1c8[_0x66a5('0x31')]['hasOwnProperty'](_0x66a5('0x38'))){_0x8cc280[_0x66a5('0x21')]=qs[_0x66a5('0x21')](_0x2ae1c8[_0x66a5('0x31')]['limit']);_0x8cc280['offset']=qs[_0x66a5('0x1f')](_0x2ae1c8[_0x66a5('0x31')][_0x66a5('0x1f')]);}_0x8cc280['order']=qs[_0x66a5('0x39')](_0x2ae1c8['query'][_0x66a5('0x39')]);_0x8cc280[_0x66a5('0x3a')]=qs[_0x66a5('0x33')](_['pick'](_0x2ae1c8[_0x66a5('0x31')],_0x2eaa61[_0x66a5('0x33')]),_0x1ee952);if(_0x2ae1c8[_0x66a5('0x31')][_0x66a5('0x3b')]){_0x8cc280[_0x66a5('0x3a')]=_[_0x66a5('0x3c')](_0x8cc280[_0x66a5('0x3a')],{'$or':_[_0x66a5('0x2b')](_0x1ee952,function(_0x3961ab){if(_0x3961ab[_0x66a5('0x2e')]!==_0x66a5('0x3d')){var _0x487e52={};_0x487e52[_0x3961ab[_0x66a5('0x29')]]={'$like':'%'+_0x2ae1c8[_0x66a5('0x31')][_0x66a5('0x3b')]+'%'};return _0x487e52;}})});}_0x8cc280=_[_0x66a5('0x3c')]({},_0x8cc280,_0x2ae1c8['options']);var _0x577c3a={'where':_0x8cc280[_0x66a5('0x3a')]};return db[_0x66a5('0x2c')][_0x66a5('0x3e')](_0x577c3a)['then'](function(_0x16d0cb){_0x2e9cc0['count']=_0x16d0cb;if(_0x2ae1c8[_0x66a5('0x31')]['includeAll']){_0x8cc280[_0x66a5('0x3f')]=[{'all':!![]}];}return db[_0x66a5('0x2c')]['findAll'](_0x8cc280);})[_0x66a5('0x27')](function(_0x15a260){_0x2e9cc0[_0x66a5('0x40')]=_0x15a260;return _0x2e9cc0;})[_0x66a5('0x27')](respondWithFilteredResult(_0x5c862b,_0x8cc280))['catch'](handleError(_0x5c862b,null));};exports['show']=function(_0x558432,_0x4ac36a){var _0xd25b89={'raw':![],'where':{'id':_0x558432[_0x66a5('0x41')]['id']}},_0x1f2246={};_0x1f2246[_0x66a5('0x30')]=_[_0x66a5('0x32')](db[_0x66a5('0x2c')][_0x66a5('0x42')]);_0x1f2246[_0x66a5('0x31')]=_[_0x66a5('0x32')](_0x558432[_0x66a5('0x31')]);_0x1f2246[_0x66a5('0x33')]=_[_0x66a5('0x34')](_0x1f2246['model'],_0x1f2246[_0x66a5('0x31')]);_0xd25b89['attributes']=_[_0x66a5('0x34')](_0x1f2246[_0x66a5('0x30')],qs[_0x66a5('0x36')](_0x558432['query'][_0x66a5('0x36')]));_0xd25b89['attributes']=_0xd25b89[_0x66a5('0x35')][_0x66a5('0x37')]?_0xd25b89[_0x66a5('0x35')]:_0x1f2246[_0x66a5('0x30')];if(_0x558432[_0x66a5('0x31')][_0x66a5('0x43')]){_0xd25b89[_0x66a5('0x3f')]=[{'all':!![]}];}_0xd25b89=_[_0x66a5('0x3c')]({},_0xd25b89,_0x558432[_0x66a5('0x44')]);return db[_0x66a5('0x2c')][_0x66a5('0x45')](_0xd25b89)[_0x66a5('0x27')](handleEntityNotFound(_0x4ac36a,null))['then'](respondWithResult(_0x4ac36a,null))['catch'](handleError(_0x4ac36a,null));};exports[_0x66a5('0x46')]=function(_0x49769b,_0x25f256){return db[_0x66a5('0x2c')][_0x66a5('0x46')](_0x49769b[_0x66a5('0x47')],{})[_0x66a5('0x27')](respondWithResult(_0x25f256,0xc9))[_0x66a5('0x48')](handleError(_0x25f256,null));};exports[_0x66a5('0x26')]=function(_0x3df6bb,_0x1edc5b){if(_0x3df6bb[_0x66a5('0x47')]['id']){delete _0x3df6bb['body']['id'];}return db[_0x66a5('0x2c')][_0x66a5('0x45')]({'where':{'id':_0x3df6bb[_0x66a5('0x41')]['id']}})[_0x66a5('0x27')](handleEntityNotFound(_0x1edc5b,null))[_0x66a5('0x27')](saveUpdates(_0x3df6bb[_0x66a5('0x47')],null))[_0x66a5('0x27')](respondWithResult(_0x1edc5b,null))['catch'](handleError(_0x1edc5b,null));};exports[_0x66a5('0x49')]=function(_0x536319,_0x171d53){return db['ServicenowAccount'][_0x66a5('0x45')]({'where':{'id':_0x536319[_0x66a5('0x41')]['id']}})[_0x66a5('0x27')](handleEntityNotFound(_0x171d53,null))[_0x66a5('0x27')](removeEntity(_0x171d53,null))[_0x66a5('0x48')](handleError(_0x171d53,null));};exports[_0x66a5('0x4a')]=function(_0x4c2f5e,_0x3798ca,_0x31f5bc){var _0x303616={};var _0x33e920={};var _0x4ef115;var _0x5860bc;return db[_0x66a5('0x2c')][_0x66a5('0x4b')]({'where':{'id':_0x4c2f5e[_0x66a5('0x41')]['id']}})['then'](handleEntityNotFound(_0x3798ca,null))[_0x66a5('0x27')](function(_0x319816){if(_0x319816){_0x4ef115=_0x319816;_0x33e920['model']=_[_0x66a5('0x32')](db[_0x66a5('0x4c')]['rawAttributes']);_0x33e920[_0x66a5('0x31')]=_[_0x66a5('0x32')](_0x4c2f5e[_0x66a5('0x31')]);_0x33e920[_0x66a5('0x33')]=_[_0x66a5('0x34')](_0x33e920[_0x66a5('0x30')],_0x33e920[_0x66a5('0x31')]);_0x303616[_0x66a5('0x35')]=_[_0x66a5('0x34')](_0x33e920[_0x66a5('0x30')],qs[_0x66a5('0x36')](_0x4c2f5e[_0x66a5('0x31')][_0x66a5('0x36')]));_0x303616[_0x66a5('0x35')]=_0x303616[_0x66a5('0x35')][_0x66a5('0x37')]?_0x303616[_0x66a5('0x35')]:_0x33e920[_0x66a5('0x30')];_0x303616['order']=qs[_0x66a5('0x39')](_0x4c2f5e[_0x66a5('0x31')][_0x66a5('0x39')]);_0x303616[_0x66a5('0x3a')]=qs[_0x66a5('0x33')](_['pick'](_0x4c2f5e[_0x66a5('0x31')],_0x33e920['filters']));if(_0x4c2f5e['query'][_0x66a5('0x3b')]){_0x303616['where']=_[_0x66a5('0x3c')](_0x303616['where'],{'$or':_[_0x66a5('0x2b')](_0x303616[_0x66a5('0x35')],function(_0x1e0646){var _0x59614e={};_0x59614e[_0x1e0646]={'$like':'%'+_0x4c2f5e[_0x66a5('0x31')]['filter']+'%'};return _0x59614e;})});}_0x303616=_[_0x66a5('0x3c')]({},_0x303616,_0x4c2f5e[_0x66a5('0x44')]);return _0x4ef115['getConfigurations'](_0x303616);}})[_0x66a5('0x27')](function(_0x4cb4fd){if(_0x4cb4fd){_0x5860bc=_0x4cb4fd[_0x66a5('0x37')];if(!_0x4c2f5e[_0x66a5('0x31')]['hasOwnProperty'](_0x66a5('0x38'))){_0x303616[_0x66a5('0x21')]=qs[_0x66a5('0x21')](_0x4c2f5e['query'][_0x66a5('0x21')]);_0x303616[_0x66a5('0x1f')]=qs[_0x66a5('0x1f')](_0x4c2f5e[_0x66a5('0x31')][_0x66a5('0x1f')]);}return _0x4ef115[_0x66a5('0x4a')](_0x303616);}})[_0x66a5('0x27')](function(_0x50680b){if(_0x50680b){return _0x50680b?{'count':_0x5860bc,'rows':_0x50680b}:null;}})[_0x66a5('0x27')](respondWithResult(_0x3798ca,null))['catch'](handleError(_0x3798ca,null));};exports[_0x66a5('0x4d')]=function(_0x535271,_0x2d82dd,_0x2b43f2){if(_0x535271['body']['id']){delete _0x535271[_0x66a5('0x47')]['id'];}return db[_0x66a5('0x2c')]['findOne']({'where':{'id':_0x535271['params']['id']}})[_0x66a5('0x27')](handleEntityNotFound(_0x2d82dd,null))[_0x66a5('0x27')](function(_0x2d8862){if(_0x2d8862){_0x535271[_0x66a5('0x47')][_0x66a5('0x4e')]=_0x2d8862['id'];_0x535271[_0x66a5('0x47')][_0x66a5('0x4f')]=integrations[_0x66a5('0x50')](_0x535271[_0x66a5('0x47')][_0x66a5('0x51')],_0x535271[_0x66a5('0x47')][_0x66a5('0x2e')]);_0x535271[_0x66a5('0x47')][_0x66a5('0x52')]=integrations[_0x66a5('0x53')](_0x535271[_0x66a5('0x47')][_0x66a5('0x51')],_0x535271['body']['type']);return db[_0x66a5('0x4c')][_0x66a5('0x46')](_0x535271['body'],{'include':[{'model':db[_0x66a5('0x54')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0x66a5('0x52')}]});}return null;})['then'](respondWithResult(_0x2d82dd,null))[_0x66a5('0x48')](handleError(_0x2d82dd,null));};exports[_0x66a5('0x55')]=function(_0x1e6dad,_0x543eff,_0x7544e2){var _0x1beb27=['made_sla',_0x66a5('0x56'),_0x66a5('0x57'),_0x66a5('0x58'),'close_code','notify','incident_state',_0x66a5('0x59'),'category'];var _0x10a827=[_0x66a5('0x5a'),_0x66a5('0x5b'),_0x66a5('0x5c'),_0x66a5('0x5d'),_0x66a5('0x5e'),_0x66a5('0x5f'),_0x66a5('0x60'),_0x66a5('0x56'),_0x66a5('0x61'),_0x66a5('0x62'),_0x66a5('0x63'),_0x66a5('0x64'),_0x66a5('0x65'),_0x66a5('0x66'),'sys_created_on','sys_domain','state',_0x66a5('0x67'),_0x66a5('0x57'),'order','calendar_stc','closed_at','cmdb_ci',_0x66a5('0x68'),_0x66a5('0x69'),_0x66a5('0x6a'),'work_notes_list',_0x66a5('0x6b'),_0x66a5('0x6c'),_0x66a5('0x6d'),'rfc',_0x66a5('0x6e'),_0x66a5('0x6f'),_0x66a5('0x70'),_0x66a5('0x71'),_0x66a5('0x72'),_0x66a5('0x73'),_0x66a5('0x74'),_0x66a5('0x75'),_0x66a5('0x76'),_0x66a5('0x77'),_0x66a5('0x58'),_0x66a5('0x78'),'short_description','close_code','correlation_display',_0x66a5('0x79'),_0x66a5('0x7a'),_0x66a5('0x7b'),'business_stc','additional_assignee_list','description',_0x66a5('0x7c'),'notify',_0x66a5('0x7d'),_0x66a5('0x7e'),_0x66a5('0x7f'),_0x66a5('0x80'),_0x66a5('0x81'),_0x66a5('0x82'),_0x66a5('0x83'),_0x66a5('0x84'),_0x66a5('0x85'),_0x66a5('0x86'),_0x66a5('0x87'),'company',_0x66a5('0x88'),_0x66a5('0x89'),_0x66a5('0x8a'),_0x66a5('0x59'),_0x66a5('0x8b'),_0x66a5('0x8c'),_0x66a5('0x8d'),_0x66a5('0x8e'),'due_date',_0x66a5('0x8f'),_0x66a5('0x90'),_0x66a5('0x91'),_0x66a5('0x92'),'upon_approval',_0x66a5('0x93'),_0x66a5('0x94'),'category'];var _0x398dc5='';var _0x21e809='';var _0x5c4bec=[];var _0x1b2723='';var _0x1b40a9='';var _0x8c1677=[];var _0x4a132a='';var _0x2f04ae='';var _0x227a65={};var _0x3e2c36='';return db[_0x66a5('0x2c')]['findOne']({'where':{'id':_0x1e6dad[_0x66a5('0x41')]['id']},'attributes':['id','username',_0x66a5('0x95'),_0x66a5('0x96'),_0x66a5('0x97'),_0x66a5('0x98')]})[_0x66a5('0x27')](handleEntityNotFound(_0x543eff,null))[_0x66a5('0x27')](function(_0x452488){if(_0x452488){_0x3e2c36=_0x452488[_0x66a5('0x97')];var _0x2060fa=_0x3e2c36[_0x66a5('0x99')](-0x1);if(_0x2060fa==='/'){_0x3e2c36=_0x3e2c36[_0x66a5('0x9a')](0x0,_0x3e2c36['lastIndexOf'](_0x2060fa));}_0x2f04ae=util[_0x66a5('0x9b')](_0x66a5('0x9c'),_0x3e2c36);_0x4a132a=util['format'](_0x66a5('0x9d'),_0x3e2c36);_0x227a65={'user':_0x452488['username'],'pass':_0x452488[_0x66a5('0x95')]};var _0x88bbc3={'method':_0x66a5('0x9e'),'uri':_0x2f04ae+'incident?sysparm_display_value=all','auth':_0x227a65,'json':!![]};return rp(_0x88bbc3);}})[_0x66a5('0x27')](function(_0x52fb67){if(_0x52fb67[_0x66a5('0x9f')][_0x66a5('0x37')]>0x0){_0x398dc5=_0x52fb67[_0x66a5('0x9f')];}console['log'](_0x66a5('0xa0'),_0x398dc5);_0x8c1677=[];_0x21e809=Object[_0x66a5('0xa1')]([],_0x398dc5);_[_0x66a5('0xa2')](_0x21e809,function(_0x45786b){return!_0x1beb27[_0x66a5('0xa3')](_0x45786b[_0x66a5('0x29')]);});_0x21e809['forEach'](function(_0x5aaa3c){var _0x2144b6=createFieldObject(_0x4a132a,_0x227a65,_0x5aaa3c['internalType'],_0x5aaa3c[_0x66a5('0x29')],_0x5aaa3c[_0x66a5('0xa4')],![]);_0x8c1677[_0x66a5('0xa5')](_0x2144b6);});return Promise[_0x66a5('0xa6')](_0x8c1677);})['then'](function(_0x518eb7){_0x5c4bec=_0x518eb7;_0x1b2723=Object[_0x66a5('0xa1')]([],_0x398dc5);console[_0x66a5('0xa7')]('TCL:\x20_object',_0x398dc5);_['remove'](_0x1b2723,function(_0x44a3fd){return _0x10a827[_0x66a5('0xa3')](_0x44a3fd[_0x66a5('0x29')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1b2723);_0x8c1677=[];_0x1b2723[_0x66a5('0xa8')](function(_0x5aed0e){var _0x27f969=createFieldObject(_0x4a132a,_0x227a65,_0x5aed0e['internalType'],_0x5aed0e[_0x66a5('0x29')],_0x5aed0e[_0x66a5('0xa4')],!![]);_0x8c1677['push'](_0x27f969);});return Promise['all'](_0x8c1677);})[_0x66a5('0x27')](function(_0x2e4947){_0x1b40a9=_0x2e4947;var _0x5880cc=_0x5c4bec[_0x66a5('0xa9')](_0x1b40a9);return{'count':_0x5880cc[_0x66a5('0x37')],'rows':_0x5880cc};})[_0x66a5('0x27')](respondWithResult(_0x543eff,null))['catch'](function(_0x27a4e5){console[_0x66a5('0xa7')](_0x66a5('0xaa')+_0x27a4e5);var _0x26d7d5=_0x1e6dad[_0x66a5('0x31')]['test']?0x1f4:_0x27a4e5[_0x66a5('0xab')]||0x1f4;logger[_0x66a5('0xac')](_0x27a4e5[_0x66a5('0x28')]);delete _0x27a4e5[_0x66a5('0x29')];if(_0x26d7d5===0x191){_0x26d7d5=0x190;}_0x543eff['status'](_0x26d7d5)[_0x66a5('0x2a')](_0x1e6dad[_0x66a5('0x31')][_0x66a5('0xad')]?{'message':_0x66a5('0xae'),'statusCode':_0x27a4e5['statusCode']}:_0x27a4e5);});};function createFieldObject(_0x452761,_0xf4ec97,_0x587f7c,_0x5f1993,_0x1fa775,_0x294759){return new Promise(function(_0x59f153,_0x41c683){var _0x50ae95={'id':_0x5f1993,'name':_0x1fa775,'custom':_0x294759};if(_0x587f7c===_0x66a5('0xaf')){_0x50ae95[_0x66a5('0x44')]=[{'name':_0x66a5('0xb0'),'value':_0x66a5('0xb1')},{'name':_0x66a5('0xb2'),'value':'false'}];_0x59f153(_0x50ae95);}else{var _0x9b3ed9={'method':'GET','uri':_0x452761+_0x66a5('0xb3')+_0x5f1993,'auth':_0xf4ec97,'json':!![]};return rp(_0x9b3ed9)[_0x66a5('0x27')](function(_0x43dd65){var _0x3c4fd1=[];if(_0x43dd65['result']['length']>0x0){_0x43dd65[_0x66a5('0x9f')][_0x66a5('0xa8')](function(_0x368747){if(_0x368747['inactive']==='false'){var _0x4263f8={'name':_0x368747['label'],'value':_0x368747['value']};_0x3c4fd1[_0x66a5('0xa5')](_0x4263f8);}});}_0x50ae95['options']=_0x3c4fd1;if(_0x50ae95[_0x66a5('0x44')]['length']>0x0){_0x59f153(_0x50ae95);}else{if(_0x294759==![]){_0x59f153();}else{_0x59f153(_0x50ae95);}}});}});}
\ No newline at end of file
+var _0x5fe9=['opened_at','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','forEach','internalType','label','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','test','statusCode','send','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','stack','name','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','filters','include','find','create','body','getConfigurations','findOne','ServicenowConfiguration','order','hasOwnProperty','addConfiguration','AccountId','Subjects','Descriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','priority','rfc','time_worked'];(function(_0x28d43f,_0x326cb4){var _0x646bf=function(_0x5e5769){while(--_0x5e5769){_0x28d43f['push'](_0x28d43f['shift']());}};_0x646bf(++_0x326cb4);}(_0x5fe9,0xff));var _0x95fe=function(_0x127964,_0x22b61d){_0x127964=_0x127964-0x0;var _0x5614fb=_0x5fe9[_0x127964];return _0x5614fb;};'use strict';var emlformat=require(_0x95fe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x95fe('0x1'));var jsonpatch=require(_0x95fe('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x95fe('0x3'));var Mustache=require(_0x95fe('0x4'));var util=require(_0x95fe('0x5'));var path=require(_0x95fe('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x95fe('0x7'));var fs=require('fs');var fs_extra=require(_0x95fe('0x8'));var _=require(_0x95fe('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x95fe('0xa'));var deskjs=require(_0x95fe('0xb'));var toCsv=require(_0x95fe('0xc'));var querystring=require(_0x95fe('0xd'));var Papa=require(_0x95fe('0xe'));var Redis=require('ioredis');var authService=require(_0x95fe('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95fe('0x10'));var logger=require(_0x95fe('0x11'))('api');var utils=require(_0x95fe('0x12'));var config=require(_0x95fe('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x95fe('0x14'));function respondWithStatusCode(_0x2468ba,_0xc7557){_0xc7557=_0xc7557||0xcc;return function(_0x4e56da){if(_0x4e56da){return _0x2468ba[_0x95fe('0x15')](_0xc7557);}return _0x2468ba[_0x95fe('0x16')](_0xc7557)[_0x95fe('0x17')]();};}function respondWithResult(_0x15a6e2,_0x5cffe2){_0x5cffe2=_0x5cffe2||0xc8;return function(_0x266b4c){if(_0x266b4c){return _0x15a6e2[_0x95fe('0x16')](_0x5cffe2)[_0x95fe('0x18')](_0x266b4c);}};}function respondWithFilteredResult(_0xf4c43b,_0x3f616c){return function(_0x4cc575){if(_0x4cc575){var _0x513d8c=typeof _0x3f616c['offset']===_0x95fe('0x19')&&typeof _0x3f616c[_0x95fe('0x1a')]===_0x95fe('0x19');var _0x4c99af=_0x4cc575[_0x95fe('0x1b')];var _0x5d0ec7=_0x513d8c?0x0:_0x3f616c['offset'];var _0x35dc29=_0x513d8c?_0x4cc575['count']:_0x3f616c[_0x95fe('0x1c')]+_0x3f616c[_0x95fe('0x1a')];var _0x32c13e;if(_0x35dc29>=_0x4c99af){_0x35dc29=_0x4c99af;_0x32c13e=0xc8;}else{_0x32c13e=0xce;}_0xf4c43b[_0x95fe('0x16')](_0x32c13e);return _0xf4c43b[_0x95fe('0x1d')]('Content-Range',_0x5d0ec7+'-'+_0x35dc29+'/'+_0x4c99af)[_0x95fe('0x18')](_0x4cc575);}return null;};}function patchUpdates(_0x203735){return function(_0x2c1f4a){try{jsonpatch[_0x95fe('0x1e')](_0x2c1f4a,_0x203735,!![]);}catch(_0x311e1d){return BPromise[_0x95fe('0x1f')](_0x311e1d);}return _0x2c1f4a[_0x95fe('0x20')]();};}function saveUpdates(_0x7cab3c,_0xcb747a){return function(_0x3a5519){if(_0x3a5519){return _0x3a5519['update'](_0x7cab3c)[_0x95fe('0x21')](function(_0x22f6fc){return _0x22f6fc;});}return null;};}function removeEntity(_0x3d0e9a,_0x80db61){return function(_0x24dbe7){if(_0x24dbe7){return _0x24dbe7[_0x95fe('0x22')]()[_0x95fe('0x21')](function(){_0x3d0e9a[_0x95fe('0x16')](0xcc)[_0x95fe('0x17')]();});}};}function handleEntityNotFound(_0x2d5c08,_0x57d539){return function(_0x1317c4){if(!_0x1317c4){_0x2d5c08[_0x95fe('0x15')](0x194);}return _0x1317c4;};}function handleError(_0x561138,_0x422627){_0x422627=_0x422627||0x1f4;return function(_0x82caef){logger[_0x95fe('0x23')](_0x82caef[_0x95fe('0x24')]);if(_0x82caef[_0x95fe('0x25')]){delete _0x82caef[_0x95fe('0x25')];}_0x561138['status'](_0x422627)['send'](_0x82caef);};}exports['index']=function(_0x6ab23,_0x5b4fc9){var _0x2e0f4d={},_0x359ed9={},_0x3e687b={'count':0x0,'rows':[]};var _0x1fb5ee=_['map'](db[_0x95fe('0x26')][_0x95fe('0x27')],function(_0x2ab3b6){return{'name':_0x2ab3b6[_0x95fe('0x28')],'type':_0x2ab3b6[_0x95fe('0x29')][_0x95fe('0x2a')]};});_0x359ed9[_0x95fe('0x2b')]=_['map'](_0x1fb5ee,_0x95fe('0x25'));_0x359ed9[_0x95fe('0x2c')]=_[_0x95fe('0x2d')](_0x6ab23[_0x95fe('0x2c')]);_0x359ed9['filters']=_[_0x95fe('0x2e')](_0x359ed9['model'],_0x359ed9[_0x95fe('0x2c')]);_0x2e0f4d[_0x95fe('0x2f')]=_['intersection'](_0x359ed9['model'],qs['fields'](_0x6ab23[_0x95fe('0x2c')][_0x95fe('0x30')]));_0x2e0f4d[_0x95fe('0x2f')]=_0x2e0f4d[_0x95fe('0x2f')][_0x95fe('0x31')]?_0x2e0f4d[_0x95fe('0x2f')]:_0x359ed9['model'];if(!_0x6ab23[_0x95fe('0x2c')]['hasOwnProperty'](_0x95fe('0x32'))){_0x2e0f4d[_0x95fe('0x1a')]=qs[_0x95fe('0x1a')](_0x6ab23['query'][_0x95fe('0x1a')]);_0x2e0f4d['offset']=qs[_0x95fe('0x1c')](_0x6ab23[_0x95fe('0x2c')][_0x95fe('0x1c')]);}_0x2e0f4d['order']=qs[_0x95fe('0x33')](_0x6ab23[_0x95fe('0x2c')][_0x95fe('0x33')]);_0x2e0f4d[_0x95fe('0x34')]=qs['filters'](_[_0x95fe('0x35')](_0x6ab23['query'],_0x359ed9['filters']),_0x1fb5ee);if(_0x6ab23[_0x95fe('0x2c')]['filter']){_0x2e0f4d['where']=_[_0x95fe('0x36')](_0x2e0f4d[_0x95fe('0x34')],{'$or':_['map'](_0x1fb5ee,function(_0x1d3efa){if(_0x1d3efa[_0x95fe('0x29')]!=='VIRTUAL'){var _0x37169a={};_0x37169a[_0x1d3efa['name']]={'$like':'%'+_0x6ab23['query'][_0x95fe('0x37')]+'%'};return _0x37169a;}})});}_0x2e0f4d=_[_0x95fe('0x36')]({},_0x2e0f4d,_0x6ab23[_0x95fe('0x38')]);var _0x650701={'where':_0x2e0f4d[_0x95fe('0x34')]};return db[_0x95fe('0x26')][_0x95fe('0x1b')](_0x650701)[_0x95fe('0x21')](function(_0x3276af){_0x3e687b[_0x95fe('0x1b')]=_0x3276af;if(_0x6ab23['query'][_0x95fe('0x39')]){_0x2e0f4d['include']=[{'all':!![]}];}return db[_0x95fe('0x26')][_0x95fe('0x3a')](_0x2e0f4d);})[_0x95fe('0x21')](function(_0x6b69c5){_0x3e687b[_0x95fe('0x3b')]=_0x6b69c5;return _0x3e687b;})[_0x95fe('0x21')](respondWithFilteredResult(_0x5b4fc9,_0x2e0f4d))[_0x95fe('0x3c')](handleError(_0x5b4fc9,null));};exports[_0x95fe('0x3d')]=function(_0x21b07c,_0x41062a){var _0x101c17={'raw':![],'where':{'id':_0x21b07c[_0x95fe('0x3e')]['id']}},_0x2fbdac={};_0x2fbdac[_0x95fe('0x2b')]=_[_0x95fe('0x2d')](db['ServicenowAccount'][_0x95fe('0x27')]);_0x2fbdac['query']=_[_0x95fe('0x2d')](_0x21b07c[_0x95fe('0x2c')]);_0x2fbdac[_0x95fe('0x3f')]=_[_0x95fe('0x2e')](_0x2fbdac[_0x95fe('0x2b')],_0x2fbdac['query']);_0x101c17[_0x95fe('0x2f')]=_[_0x95fe('0x2e')](_0x2fbdac[_0x95fe('0x2b')],qs[_0x95fe('0x30')](_0x21b07c[_0x95fe('0x2c')][_0x95fe('0x30')]));_0x101c17[_0x95fe('0x2f')]=_0x101c17['attributes'][_0x95fe('0x31')]?_0x101c17[_0x95fe('0x2f')]:_0x2fbdac['model'];if(_0x21b07c['query'][_0x95fe('0x39')]){_0x101c17[_0x95fe('0x40')]=[{'all':!![]}];}_0x101c17=_['merge']({},_0x101c17,_0x21b07c['options']);return db['ServicenowAccount'][_0x95fe('0x41')](_0x101c17)[_0x95fe('0x21')](handleEntityNotFound(_0x41062a,null))[_0x95fe('0x21')](respondWithResult(_0x41062a,null))[_0x95fe('0x3c')](handleError(_0x41062a,null));};exports[_0x95fe('0x42')]=function(_0x5858ff,_0x27ba0e){return db[_0x95fe('0x26')][_0x95fe('0x42')](_0x5858ff[_0x95fe('0x43')],{})[_0x95fe('0x21')](respondWithResult(_0x27ba0e,0xc9))['catch'](handleError(_0x27ba0e,null));};exports['update']=function(_0x1d37cd,_0x4d4847){if(_0x1d37cd['body']['id']){delete _0x1d37cd[_0x95fe('0x43')]['id'];}return db['ServicenowAccount'][_0x95fe('0x41')]({'where':{'id':_0x1d37cd[_0x95fe('0x3e')]['id']}})[_0x95fe('0x21')](handleEntityNotFound(_0x4d4847,null))[_0x95fe('0x21')](saveUpdates(_0x1d37cd['body'],null))['then'](respondWithResult(_0x4d4847,null))[_0x95fe('0x3c')](handleError(_0x4d4847,null));};exports[_0x95fe('0x22')]=function(_0x1dfaf3,_0x3350cc){return db[_0x95fe('0x26')][_0x95fe('0x41')]({'where':{'id':_0x1dfaf3[_0x95fe('0x3e')]['id']}})[_0x95fe('0x21')](handleEntityNotFound(_0x3350cc,null))[_0x95fe('0x21')](removeEntity(_0x3350cc,null))[_0x95fe('0x3c')](handleError(_0x3350cc,null));};exports[_0x95fe('0x44')]=function(_0x55f123,_0x4393ad,_0x576a94){var _0x44702e={};var _0x533c06={};var _0x5903a5;var _0x52c817;return db[_0x95fe('0x26')][_0x95fe('0x45')]({'where':{'id':_0x55f123['params']['id']}})[_0x95fe('0x21')](handleEntityNotFound(_0x4393ad,null))[_0x95fe('0x21')](function(_0x1cfab5){if(_0x1cfab5){_0x5903a5=_0x1cfab5;_0x533c06['model']=_[_0x95fe('0x2d')](db[_0x95fe('0x46')][_0x95fe('0x27')]);_0x533c06['query']=_['keys'](_0x55f123[_0x95fe('0x2c')]);_0x533c06[_0x95fe('0x3f')]=_[_0x95fe('0x2e')](_0x533c06[_0x95fe('0x2b')],_0x533c06['query']);_0x44702e['attributes']=_[_0x95fe('0x2e')](_0x533c06['model'],qs['fields'](_0x55f123['query'][_0x95fe('0x30')]));_0x44702e[_0x95fe('0x2f')]=_0x44702e[_0x95fe('0x2f')][_0x95fe('0x31')]?_0x44702e[_0x95fe('0x2f')]:_0x533c06[_0x95fe('0x2b')];_0x44702e[_0x95fe('0x47')]=qs[_0x95fe('0x33')](_0x55f123[_0x95fe('0x2c')][_0x95fe('0x33')]);_0x44702e['where']=qs[_0x95fe('0x3f')](_['pick'](_0x55f123['query'],_0x533c06[_0x95fe('0x3f')]));if(_0x55f123['query'][_0x95fe('0x37')]){_0x44702e[_0x95fe('0x34')]=_[_0x95fe('0x36')](_0x44702e[_0x95fe('0x34')],{'$or':_['map'](_0x44702e[_0x95fe('0x2f')],function(_0x371854){var _0x324cff={};_0x324cff[_0x371854]={'$like':'%'+_0x55f123[_0x95fe('0x2c')][_0x95fe('0x37')]+'%'};return _0x324cff;})});}_0x44702e=_[_0x95fe('0x36')]({},_0x44702e,_0x55f123[_0x95fe('0x38')]);return _0x5903a5[_0x95fe('0x44')](_0x44702e);}})['then'](function(_0x2aac95){if(_0x2aac95){_0x52c817=_0x2aac95[_0x95fe('0x31')];if(!_0x55f123[_0x95fe('0x2c')][_0x95fe('0x48')](_0x95fe('0x32'))){_0x44702e['limit']=qs[_0x95fe('0x1a')](_0x55f123[_0x95fe('0x2c')][_0x95fe('0x1a')]);_0x44702e[_0x95fe('0x1c')]=qs[_0x95fe('0x1c')](_0x55f123[_0x95fe('0x2c')][_0x95fe('0x1c')]);}return _0x5903a5[_0x95fe('0x44')](_0x44702e);}})['then'](function(_0x2d0fc1){if(_0x2d0fc1){return _0x2d0fc1?{'count':_0x52c817,'rows':_0x2d0fc1}:null;}})[_0x95fe('0x21')](respondWithResult(_0x4393ad,null))[_0x95fe('0x3c')](handleError(_0x4393ad,null));};exports[_0x95fe('0x49')]=function(_0x4a7798,_0x1594ba,_0x216e2b){if(_0x4a7798[_0x95fe('0x43')]['id']){delete _0x4a7798[_0x95fe('0x43')]['id'];}return db['ServicenowAccount'][_0x95fe('0x45')]({'where':{'id':_0x4a7798[_0x95fe('0x3e')]['id']}})[_0x95fe('0x21')](handleEntityNotFound(_0x1594ba,null))['then'](function(_0x4c6af3){if(_0x4c6af3){_0x4a7798['body'][_0x95fe('0x4a')]=_0x4c6af3['id'];_0x4a7798[_0x95fe('0x43')][_0x95fe('0x4b')]=integrations['getSubjects'](_0x4a7798[_0x95fe('0x43')]['channel'],_0x4a7798[_0x95fe('0x43')]['type']);_0x4a7798[_0x95fe('0x43')][_0x95fe('0x4c')]=integrations['getDescriptions'](_0x4a7798['body'][_0x95fe('0x4d')],_0x4a7798[_0x95fe('0x43')]['type']);return db[_0x95fe('0x46')][_0x95fe('0x42')](_0x4a7798['body'],{'include':[{'model':db[_0x95fe('0x4e')],'as':_0x95fe('0x4b')},{'model':db[_0x95fe('0x4e')],'as':_0x95fe('0x4c')}]});}return null;})[_0x95fe('0x21')](respondWithResult(_0x1594ba,null))[_0x95fe('0x3c')](handleError(_0x1594ba,null));};exports[_0x95fe('0x4f')]=function(_0x8f578a,_0x3ac6a8,_0x3778d7){var _0x1d9f1b=[_0x95fe('0x50'),_0x95fe('0x51'),_0x95fe('0x52'),_0x95fe('0x53'),_0x95fe('0x54'),_0x95fe('0x55'),_0x95fe('0x56'),_0x95fe('0x57'),_0x95fe('0x58')];var _0xd6beb1=[_0x95fe('0x59'),_0x95fe('0x50'),_0x95fe('0x5a'),_0x95fe('0x5b'),_0x95fe('0x5c'),_0x95fe('0x5d'),'child_incidents',_0x95fe('0x51'),'approval_history',_0x95fe('0x5e'),_0x95fe('0x5f'),_0x95fe('0x60'),_0x95fe('0x61'),_0x95fe('0x62'),'sys_created_on',_0x95fe('0x63'),_0x95fe('0x64'),'sys_created_by','knowledge',_0x95fe('0x47'),_0x95fe('0x65'),_0x95fe('0x66'),_0x95fe('0x67'),'delivery_plan',_0x95fe('0x68'),_0x95fe('0x69'),_0x95fe('0x6a'),_0x95fe('0x6b'),_0x95fe('0x6c'),'sys_domain_path',_0x95fe('0x6d'),_0x95fe('0x6e'),'expected_start',_0x95fe('0x6f'),_0x95fe('0x70'),_0x95fe('0x71'),_0x95fe('0x72'),'reopened_time',_0x95fe('0x73'),_0x95fe('0x74'),_0x95fe('0x75'),_0x95fe('0x53'),_0x95fe('0x76'),_0x95fe('0x77'),_0x95fe('0x54'),_0x95fe('0x78'),_0x95fe('0x79'),_0x95fe('0x7a'),_0x95fe('0x7b'),'business_stc','additional_assignee_list',_0x95fe('0x7c'),_0x95fe('0x7d'),_0x95fe('0x55'),_0x95fe('0x7e'),_0x95fe('0x7f'),_0x95fe('0x80'),_0x95fe('0x81'),_0x95fe('0x82'),_0x95fe('0x83'),_0x95fe('0x84'),'reopened_by',_0x95fe('0x56'),_0x95fe('0x85'),_0x95fe('0x86'),_0x95fe('0x87'),_0x95fe('0x88'),_0x95fe('0x89'),'assigned_to',_0x95fe('0x57'),_0x95fe('0x8a'),_0x95fe('0x8b'),_0x95fe('0x8c'),_0x95fe('0x8d'),'due_date',_0x95fe('0x8e'),_0x95fe('0x8f'),_0x95fe('0x90'),_0x95fe('0x91'),_0x95fe('0x92'),_0x95fe('0x93'),_0x95fe('0x94'),_0x95fe('0x58')];var _0x57a071='';var _0x370be6='';var _0x45dd81=[];var _0x32c01d='';var _0xa0e259='';var _0xcd8c04=[];var _0x187073='';var _0x5aff30='';var _0xf10201={};var _0x3b8430='';return db[_0x95fe('0x26')][_0x95fe('0x45')]({'where':{'id':_0x8f578a[_0x95fe('0x3e')]['id']},'attributes':['id',_0x95fe('0x95'),_0x95fe('0x96'),_0x95fe('0x97'),'remoteUri','serverUrl']})[_0x95fe('0x21')](handleEntityNotFound(_0x3ac6a8,null))[_0x95fe('0x21')](function(_0x273f1e){if(_0x273f1e){_0x3b8430=_0x273f1e['remoteUri'];var _0x3cb57b=_0x3b8430[_0x95fe('0x98')](-0x1);if(_0x3cb57b==='/'){_0x3b8430=_0x3b8430[_0x95fe('0x99')](0x0,_0x3b8430[_0x95fe('0x9a')](_0x3cb57b));}_0x5aff30=util['format'](_0x95fe('0x9b'),_0x3b8430);_0x187073=util['format'](_0x95fe('0x9c'),_0x3b8430);_0xf10201={'user':_0x273f1e[_0x95fe('0x95')],'pass':_0x273f1e['password']};var _0x18fa64={'method':_0x95fe('0x9d'),'uri':_0x5aff30+_0x95fe('0x9e'),'auth':_0xf10201,'json':!![]};return rp(_0x18fa64);}})[_0x95fe('0x21')](function(_0x7cbaba){if(_0x7cbaba[_0x95fe('0x9f')][_0x95fe('0x31')]>0x0){_0x57a071=_0x7cbaba[_0x95fe('0x9f')];}console[_0x95fe('0xa0')]('incident\x20table\x20objects',_0x57a071);_0xcd8c04=[];_0x370be6=Object[_0x95fe('0xa1')]([],_0x57a071);_[_0x95fe('0xa2')](_0x370be6,function(_0xf48487){return!_0x1d9f1b['includes'](_0xf48487[_0x95fe('0x25')]);});_0x370be6[_0x95fe('0xa3')](function(_0xbdddb5){var _0x4b24cd=createFieldObject(_0x187073,_0xf10201,_0xbdddb5[_0x95fe('0xa4')],_0xbdddb5[_0x95fe('0x25')],_0xbdddb5[_0x95fe('0xa5')],![]);_0xcd8c04[_0x95fe('0xa6')](_0x4b24cd);});return Promise[_0x95fe('0xa7')](_0xcd8c04);})['then'](function(_0x1959cb){_0x45dd81=_0x1959cb;_0x32c01d=Object[_0x95fe('0xa1')]([],_0x57a071);console[_0x95fe('0xa0')](_0x95fe('0xa8'),_0x57a071);_[_0x95fe('0xa2')](_0x32c01d,function(_0x25c393){return _0xd6beb1[_0x95fe('0xa9')](_0x25c393[_0x95fe('0x25')]);});console[_0x95fe('0xa0')](_0x95fe('0xaa'),_0x32c01d);_0xcd8c04=[];_0x32c01d[_0x95fe('0xa3')](function(_0x2091b9){var _0x5826d3=createFieldObject(_0x187073,_0xf10201,_0x2091b9[_0x95fe('0xa4')],_0x2091b9[_0x95fe('0x25')],_0x2091b9[_0x95fe('0xa5')],!![]);_0xcd8c04[_0x95fe('0xa6')](_0x5826d3);});return Promise[_0x95fe('0xa7')](_0xcd8c04);})[_0x95fe('0x21')](function(_0x479174){_0xa0e259=_0x479174;var _0x15cd4=_0x45dd81['concat'](_0xa0e259);return{'count':_0x15cd4[_0x95fe('0x31')],'rows':_0x15cd4};})[_0x95fe('0x21')](respondWithResult(_0x3ac6a8,null))[_0x95fe('0x3c')](function(_0x4ebc0d){console[_0x95fe('0xa0')](_0x95fe('0xab')+_0x4ebc0d);var _0x48b66d=_0x8f578a[_0x95fe('0x2c')][_0x95fe('0xac')]?0x1f4:_0x4ebc0d[_0x95fe('0xad')]||0x1f4;logger['error'](_0x4ebc0d[_0x95fe('0x24')]);delete _0x4ebc0d[_0x95fe('0x25')];if(_0x48b66d===0x191){_0x48b66d=0x190;}_0x3ac6a8[_0x95fe('0x16')](_0x48b66d)[_0x95fe('0xae')](_0x8f578a[_0x95fe('0x2c')]['test']?{'message':_0x95fe('0xaf'),'statusCode':_0x4ebc0d[_0x95fe('0xad')]}:_0x4ebc0d);});};function createFieldObject(_0x5a6890,_0x2a0a9c,_0x4de383,_0x5bf49f,_0x3e5730,_0x310126){return new Promise(function(_0x54a148,_0x28c606){var _0x10b4a3={'id':_0x5bf49f,'name':_0x3e5730,'custom':_0x310126};if(_0x4de383===_0x95fe('0xb0')){_0x10b4a3[_0x95fe('0x38')]=[{'name':_0x95fe('0xb1'),'value':_0x95fe('0xb2')},{'name':_0x95fe('0xb3'),'value':_0x95fe('0xb4')}];_0x54a148(_0x10b4a3);}else{var _0x5b8c45={'method':_0x95fe('0x9d'),'uri':_0x5a6890+_0x95fe('0xb5')+_0x5bf49f,'auth':_0x2a0a9c,'json':!![]};return rp(_0x5b8c45)['then'](function(_0x4bdbe6){var _0x49a66a=[];if(_0x4bdbe6[_0x95fe('0x9f')][_0x95fe('0x31')]>0x0){_0x4bdbe6[_0x95fe('0x9f')][_0x95fe('0xa3')](function(_0x996cc4){if(_0x996cc4[_0x95fe('0xb6')]===_0x95fe('0xb4')){var _0x19f0f2={'name':_0x996cc4[_0x95fe('0xa5')],'value':_0x996cc4['value']};_0x49a66a['push'](_0x19f0f2);}});}_0x10b4a3[_0x95fe('0x38')]=_0x49a66a;if(_0x10b4a3[_0x95fe('0x38')][_0x95fe('0x31')]>0x0){_0x54a148(_0x10b4a3);}else{if(_0x310126==![]){_0x54a148();}else{_0x54a148(_0x10b4a3);}}});}});}
\ No newline at end of file
index 46193ec..ae5acb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x545fcd,_0x3247cc){var _0x32e380=function(_0xa98551){while(--_0xa98551){_0x545fcd['push'](_0x545fcd['shift']());}};_0x32e380(++_0x3247cc);}(_0x5075,0x73));var _0x5507=function(_0x2bd0be,_0xf63d47){_0x2bd0be=_0x2bd0be-0x0;var _0x3e8e85=_0x5075[_0x2bd0be];return _0x3e8e85;};'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
+var _0xc4aa=['bluebird','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'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'));var integrations=require(_0xac4a('0x8'));module[_0xac4a('0x9')]=function(_0x96be2b,_0x15cd34){return _0x96be2b[_0xac4a('0xa')](_0xac4a('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ea3c827..2c6680a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6783=['info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','find','ShowServicenowAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0xb73ad2,_0x46729a){var _0x4f2db7=function(_0x3f2f03){while(--_0x3f2f03){_0xb73ad2['push'](_0xb73ad2['shift']());}};_0x4f2db7(++_0x46729a);}(_0x6783,0x84));var _0x3678=function(_0x1dd060,_0x5f3ba3){_0x1dd060=_0x1dd060-0x0;var _0x58e764=_0x6783[_0x1dd060];return _0x58e764;};'use strict';var _=require(_0x3678('0x0'));var util=require('util');var moment=require(_0x3678('0x1'));var BPromise=require(_0x3678('0x2'));var rs=require(_0x3678('0x3'));var fs=require('fs');var Redis=require(_0x3678('0x4'));var db=require(_0x3678('0x5'))['db'];var utils=require(_0x3678('0x6'));var logger=require(_0x3678('0x7'))(_0x3678('0x8'));var config=require('../../config/environment');var jayson=require(_0x3678('0x9'));var client=jayson[_0x3678('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e18b3,_0x212ffc,_0x13703b){return new BPromise(function(_0x448cb6,_0xa2b5d6){return client[_0x3678('0xb')](_0x1e18b3,_0x13703b)['then'](function(_0x3c58fc){logger[_0x3678('0xc')](_0x3678('0xd'),_0x212ffc,_0x3678('0xe'));logger['debug'](_0x3678('0xf'),_0x212ffc,_0x3678('0xe'),JSON[_0x3678('0x10')](_0x3c58fc));if(_0x3c58fc[_0x3678('0x11')]){if(_0x3c58fc[_0x3678('0x11')][_0x3678('0x12')]===0x1f4){logger[_0x3678('0x11')](_0x3678('0xd'),_0x212ffc,_0x3c58fc['error'][_0x3678('0x13')]);return _0xa2b5d6(_0x3c58fc[_0x3678('0x11')][_0x3678('0x13')]);}logger[_0x3678('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x212ffc,_0x3c58fc[_0x3678('0x11')][_0x3678('0x13')]);return _0x448cb6(_0x3c58fc[_0x3678('0x11')][_0x3678('0x13')]);}else{logger[_0x3678('0xc')](_0x3678('0xd'),_0x212ffc,'request\x20sent');_0x448cb6(_0x3c58fc['result'][_0x3678('0x13')]);}})[_0x3678('0x14')](function(_0x580aaf){logger[_0x3678('0x11')](_0x3678('0xd'),_0x212ffc,_0x580aaf);_0xa2b5d6(_0x580aaf);});});}exports[_0x3678('0x15')]=function(_0x3dc666){var _0x40446c=this;return new Promise(function(_0x498a41,_0x42e947){return db[_0x3678('0x16')][_0x3678('0x17')]({'raw':_0x3dc666[_0x3678('0x18')]?_0x3dc666[_0x3678('0x18')][_0x3678('0x19')]===undefined?!![]:![]:!![],'where':_0x3dc666[_0x3678('0x18')]?_0x3dc666[_0x3678('0x18')][_0x3678('0x1a')]||null:null,'attributes':_0x3dc666[_0x3678('0x18')]?_0x3dc666['options'][_0x3678('0x1b')]||null:null,'limit':_0x3dc666[_0x3678('0x18')]?_0x3dc666[_0x3678('0x18')][_0x3678('0x1c')]||null:null,'include':_0x3dc666['options']?_0x3dc666[_0x3678('0x18')][_0x3678('0x1d')]?_[_0x3678('0x1e')](_0x3dc666[_0x3678('0x18')][_0x3678('0x1d')],function(_0x1295bc){return{'model':db[_0x1295bc[_0x3678('0x1f')]],'as':_0x1295bc['as'],'attributes':_0x1295bc[_0x3678('0x1b')],'include':_0x1295bc[_0x3678('0x1d')]?_['map'](_0x1295bc[_0x3678('0x1d')],function(_0x123f9f){return{'model':db[_0x123f9f[_0x3678('0x1f')]],'as':_0x123f9f['as'],'attributes':_0x123f9f[_0x3678('0x1b')],'include':_0x123f9f[_0x3678('0x1d')]?_['map'](_0x123f9f['include'],function(_0x36bccf){return{'model':db[_0x36bccf[_0x3678('0x1f')]],'as':_0x36bccf['as'],'attributes':_0x36bccf[_0x3678('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3678('0x20')](function(_0x4fe23a){logger[_0x3678('0xc')](_0x3678('0x15'),_0x3dc666);logger[_0x3678('0x21')]('GetServicenowAccount',_0x3dc666,JSON[_0x3678('0x10')](_0x4fe23a));_0x498a41(_0x4fe23a);})[_0x3678('0x14')](function(_0x453eb1){logger[_0x3678('0x11')](_0x3678('0x15'),_0x453eb1[_0x3678('0x13')],_0x3dc666);_0x42e947(_0x40446c[_0x3678('0x11')](0x1f4,_0x453eb1[_0x3678('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x4fb670){var _0xc03cce=this;return new Promise(function(_0x5a08f5,_0x313c3b){return db['ServicenowAccount'][_0x3678('0x22')]({'raw':_0x4fb670[_0x3678('0x18')]?_0x4fb670[_0x3678('0x18')][_0x3678('0x19')]===undefined?!![]:![]:!![],'where':_0x4fb670[_0x3678('0x18')]?_0x4fb670['options'][_0x3678('0x1a')]||null:null,'attributes':_0x4fb670[_0x3678('0x18')]?_0x4fb670[_0x3678('0x18')][_0x3678('0x1b')]||null:null,'include':_0x4fb670[_0x3678('0x18')]?_0x4fb670[_0x3678('0x18')][_0x3678('0x1d')]?_[_0x3678('0x1e')](_0x4fb670['options'][_0x3678('0x1d')],function(_0x34c443){return{'model':db[_0x34c443['model']],'as':_0x34c443['as'],'attributes':_0x34c443[_0x3678('0x1b')],'include':_0x34c443['include']?_[_0x3678('0x1e')](_0x34c443[_0x3678('0x1d')],function(_0x416487){return{'model':db[_0x416487[_0x3678('0x1f')]],'as':_0x416487['as'],'attributes':_0x416487[_0x3678('0x1b')],'include':_0x416487[_0x3678('0x1d')]?_[_0x3678('0x1e')](_0x416487['include'],function(_0x87e788){return{'model':db[_0x87e788[_0x3678('0x1f')]],'as':_0x87e788['as'],'attributes':_0x87e788[_0x3678('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3678('0x20')](function(_0x4f359c){logger[_0x3678('0xc')](_0x3678('0x23'),_0x4fb670);logger[_0x3678('0x21')]('ShowServicenowAccount',_0x4fb670,JSON[_0x3678('0x10')](_0x4f359c));_0x5a08f5(_0x4f359c);})[_0x3678('0x14')](function(_0x49aee0){logger[_0x3678('0x11')](_0x3678('0x23'),_0x49aee0[_0x3678('0x13')],_0x4fb670);_0x313c3b(_0xc03cce[_0x3678('0x11')](0x1f4,_0x49aee0[_0x3678('0x13')]));});});};
\ No newline at end of file
+var _0x5ad4=['options','raw','where','attributes','limit','map','include','model','ShowServicenowAccount','find','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll'];(function(_0x50389d,_0x124d7b){var _0x445ed9=function(_0x36fea3){while(--_0x36fea3){_0x50389d['push'](_0x50389d['shift']());}};_0x445ed9(++_0x124d7b);}(_0x5ad4,0x107));var _0x45ad=function(_0x5a4508,_0x4f70f4){_0x5a4508=_0x5a4508-0x0;var _0x554410=_0x5ad4[_0x5a4508];return _0x554410;};'use strict';var _=require('lodash');var util=require(_0x45ad('0x0'));var moment=require(_0x45ad('0x1'));var BPromise=require(_0x45ad('0x2'));var rs=require(_0x45ad('0x3'));var fs=require('fs');var Redis=require(_0x45ad('0x4'));var db=require(_0x45ad('0x5'))['db'];var utils=require(_0x45ad('0x6'));var logger=require('../../config/logger')(_0x45ad('0x7'));var config=require('../../config/environment');var jayson=require(_0x45ad('0x8'));var client=jayson[_0x45ad('0x9')][_0x45ad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x435e04,_0x2fa088,_0x5a1787){return new BPromise(function(_0x165c84,_0x116657){return client[_0x45ad('0xb')](_0x435e04,_0x5a1787)[_0x45ad('0xc')](function(_0x326804){logger['info'](_0x45ad('0xd'),_0x2fa088,_0x45ad('0xe'));logger['debug'](_0x45ad('0xf'),_0x2fa088,_0x45ad('0xe'),JSON[_0x45ad('0x10')](_0x326804));if(_0x326804['error']){if(_0x326804[_0x45ad('0x11')]['code']===0x1f4){logger[_0x45ad('0x11')](_0x45ad('0xd'),_0x2fa088,_0x326804[_0x45ad('0x11')]['message']);return _0x116657(_0x326804['error'][_0x45ad('0x12')]);}logger[_0x45ad('0x11')](_0x45ad('0xd'),_0x2fa088,_0x326804[_0x45ad('0x11')][_0x45ad('0x12')]);return _0x165c84(_0x326804[_0x45ad('0x11')]['message']);}else{logger[_0x45ad('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x2fa088,_0x45ad('0xe'));_0x165c84(_0x326804[_0x45ad('0x14')]['message']);}})[_0x45ad('0x15')](function(_0x5f47d8){logger[_0x45ad('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x2fa088,_0x5f47d8);_0x116657(_0x5f47d8);});});}exports[_0x45ad('0x16')]=function(_0x2017b5){var _0x821131=this;return new Promise(function(_0x530f0b,_0x121c9f){return db[_0x45ad('0x17')][_0x45ad('0x18')]({'raw':_0x2017b5[_0x45ad('0x19')]?_0x2017b5[_0x45ad('0x19')][_0x45ad('0x1a')]===undefined?!![]:![]:!![],'where':_0x2017b5[_0x45ad('0x19')]?_0x2017b5['options'][_0x45ad('0x1b')]||null:null,'attributes':_0x2017b5[_0x45ad('0x19')]?_0x2017b5[_0x45ad('0x19')][_0x45ad('0x1c')]||null:null,'limit':_0x2017b5[_0x45ad('0x19')]?_0x2017b5[_0x45ad('0x19')][_0x45ad('0x1d')]||null:null,'include':_0x2017b5['options']?_0x2017b5[_0x45ad('0x19')]['include']?_[_0x45ad('0x1e')](_0x2017b5[_0x45ad('0x19')][_0x45ad('0x1f')],function(_0x2767b3){return{'model':db[_0x2767b3['model']],'as':_0x2767b3['as'],'attributes':_0x2767b3['attributes'],'include':_0x2767b3[_0x45ad('0x1f')]?_['map'](_0x2767b3['include'],function(_0x33c7f5){return{'model':db[_0x33c7f5[_0x45ad('0x20')]],'as':_0x33c7f5['as'],'attributes':_0x33c7f5[_0x45ad('0x1c')],'include':_0x33c7f5['include']?_[_0x45ad('0x1e')](_0x33c7f5[_0x45ad('0x1f')],function(_0x342a5c){return{'model':db[_0x342a5c[_0x45ad('0x20')]],'as':_0x342a5c['as'],'attributes':_0x342a5c[_0x45ad('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x45ad('0xc')](function(_0x48044c){logger[_0x45ad('0x13')](_0x45ad('0x16'),_0x2017b5);logger['debug'](_0x45ad('0x16'),_0x2017b5,JSON['stringify'](_0x48044c));_0x530f0b(_0x48044c);})[_0x45ad('0x15')](function(_0x2873c5){logger[_0x45ad('0x11')](_0x45ad('0x16'),_0x2873c5[_0x45ad('0x12')],_0x2017b5);_0x121c9f(_0x821131['error'](0x1f4,_0x2873c5['message']));});});};exports[_0x45ad('0x21')]=function(_0x32a352){var _0x43fd86=this;return new Promise(function(_0x1f019a,_0x1006e1){return db[_0x45ad('0x17')][_0x45ad('0x22')]({'raw':_0x32a352['options']?_0x32a352[_0x45ad('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x32a352[_0x45ad('0x19')]?_0x32a352['options'][_0x45ad('0x1b')]||null:null,'attributes':_0x32a352[_0x45ad('0x19')]?_0x32a352[_0x45ad('0x19')][_0x45ad('0x1c')]||null:null,'include':_0x32a352[_0x45ad('0x19')]?_0x32a352[_0x45ad('0x19')]['include']?_['map'](_0x32a352['options'][_0x45ad('0x1f')],function(_0x25f4e9){return{'model':db[_0x25f4e9[_0x45ad('0x20')]],'as':_0x25f4e9['as'],'attributes':_0x25f4e9[_0x45ad('0x1c')],'include':_0x25f4e9['include']?_[_0x45ad('0x1e')](_0x25f4e9[_0x45ad('0x1f')],function(_0x21b43a){return{'model':db[_0x21b43a[_0x45ad('0x20')]],'as':_0x21b43a['as'],'attributes':_0x21b43a['attributes'],'include':_0x21b43a[_0x45ad('0x1f')]?_[_0x45ad('0x1e')](_0x21b43a[_0x45ad('0x1f')],function(_0x251761){return{'model':db[_0x251761[_0x45ad('0x20')]],'as':_0x251761['as'],'attributes':_0x251761['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5678e8){logger[_0x45ad('0x13')]('ShowServicenowAccount',_0x32a352);logger[_0x45ad('0x23')]('ShowServicenowAccount',_0x32a352,JSON[_0x45ad('0x10')](_0x5678e8));_0x1f019a(_0x5678e8);})['catch'](function(_0x2b44d9){logger['error']('ShowServicenowAccount',_0x2b44d9['message'],_0x32a352);_0x1006e1(_0x43fd86[_0x45ad('0x11')](0x1f4,_0x2b44d9[_0x45ad('0x12')]));});});};
\ No newline at end of file
index e431ae2..9f507c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e98=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','update','destroy','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','show'];(function(_0x708a9d,_0x35804e){var _0x3c2265=function(_0x5f3e10){while(--_0x5f3e10){_0x708a9d['push'](_0x708a9d['shift']());}};_0x3c2265(++_0x35804e);}(_0x4e98,0x105));var _0x84e9=function(_0x4ab261,_0x20904b){_0x4ab261=_0x4ab261-0x0;var _0x4b81e8=_0x4e98[_0x4ab261];return _0x4b81e8;};'use strict';var multer=require('multer');var util=require(_0x84e9('0x0'));var path=require(_0x84e9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x84e9('0x2')]();var fs_extra=require(_0x84e9('0x3'));var auth=require(_0x84e9('0x4'));var interaction=require(_0x84e9('0x5'));var config=require(_0x84e9('0x6'));var controller=require(_0x84e9('0x7'));router[_0x84e9('0x8')]('/',auth[_0x84e9('0x9')](),controller[_0x84e9('0xa')]);router[_0x84e9('0x8')]('/:id',auth[_0x84e9('0x9')](),controller[_0x84e9('0xb')]);router[_0x84e9('0x8')]('/:id/fields',auth[_0x84e9('0x9')](),controller['getFields']);router['get'](_0x84e9('0xc'),auth[_0x84e9('0x9')](),controller[_0x84e9('0xd')]);router[_0x84e9('0x8')](_0x84e9('0xe'),auth[_0x84e9('0x9')](),controller[_0x84e9('0xf')]);router[_0x84e9('0x10')]('/',auth[_0x84e9('0x9')](),controller[_0x84e9('0x11')]);router['put'](_0x84e9('0x12'),auth[_0x84e9('0x9')](),controller[_0x84e9('0x13')]);router['delete']('/:id',auth[_0x84e9('0x9')](),controller[_0x84e9('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x983f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','index','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout'];(function(_0x2a08ea,_0x28d842){var _0x5c6b4c=function(_0x35f964){while(--_0x35f964){_0x2a08ea['push'](_0x2a08ea['shift']());}};_0x5c6b4c(++_0x28d842);}(_0x983f,0xc5));var _0xf983=function(_0x133881,_0x23b92f){_0x133881=_0x133881-0x0;var _0x396177=_0x983f[_0x133881];return _0x396177;};'use strict';var multer=require(_0xf983('0x0'));var util=require(_0xf983('0x1'));var path=require('path');var timeout=require(_0xf983('0x2'));var express=require(_0xf983('0x3'));var router=express[_0xf983('0x4')]();var fs_extra=require(_0xf983('0x5'));var auth=require(_0xf983('0x6'));var interaction=require(_0xf983('0x7'));var config=require('../../config/environment');var controller=require(_0xf983('0x8'));router[_0xf983('0x9')]('/',auth['isAuthenticated'](),controller[_0xf983('0xa')]);router[_0xf983('0x9')]('/:id',auth[_0xf983('0xb')](),controller[_0xf983('0xc')]);router[_0xf983('0x9')]('/:id/fields',auth[_0xf983('0xb')](),controller[_0xf983('0xd')]);router[_0xf983('0x9')](_0xf983('0xe'),auth[_0xf983('0xb')](),controller[_0xf983('0xf')]);router[_0xf983('0x9')](_0xf983('0x10'),auth[_0xf983('0xb')](),controller[_0xf983('0x11')]);router[_0xf983('0x12')]('/',auth['isAuthenticated'](),controller[_0xf983('0x13')]);router[_0xf983('0x14')](_0xf983('0x15'),auth[_0xf983('0xb')](),controller[_0xf983('0x16')]);router[_0xf983('0x17')](_0xf983('0x15'),auth[_0xf983('0xb')](),controller['destroy']);module[_0xf983('0x18')]=router;
\ No newline at end of file
index 4d4f17f..c1877ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e6b=['exports','STRING','sequelize'];(function(_0x1a0600,_0x41feef){var _0x734670=function(_0x2da4e4){while(--_0x2da4e4){_0x1a0600['push'](_0x1a0600['shift']());}};_0x734670(++_0x41feef);}(_0x1e6b,0x146));var _0xb1e6=function(_0xf075c7,_0xa0f10f){_0xf075c7=_0xf075c7-0x0;var _0x5ba515=_0x1e6b[_0xf075c7];return _0x5ba515;};'use strict';var Sequelize=require(_0xb1e6('0x0'));module[_0xb1e6('0x1')]={'name':{'type':Sequelize[_0xb1e6('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xac8f=['exports','STRING'];(function(_0x3011f7,_0x206731){var _0x5e5372=function(_0x530b63){while(--_0x530b63){_0x3011f7['push'](_0x3011f7['shift']());}};_0x5e5372(++_0x206731);}(_0xac8f,0x10a));var _0xfac8=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0xac8f[_0x261522];return _0x98a25a;};'use strict';var Sequelize=require('sequelize');module[_0xfac8('0x0')]={'name':{'type':Sequelize[_0xfac8('0x1')]},'description':{'type':Sequelize[_0xfac8('0x1')]}};
\ No newline at end of file
index d9542f0..32639be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e15=['findAll','rows','catch','show','params','keys','include','find','create','body','findOne','ServicenowField','getFields','getSubjects','getDescriptions','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','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','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','map','VIRTUAL','filter','options','includeAll'];(function(_0x3aadde,_0x50f23f){var _0x21df4e=function(_0x55a49d){while(--_0x55a49d){_0x3aadde['push'](_0x3aadde['shift']());}};_0x21df4e(++_0x50f23f);}(_0x7e15,0x65));var _0x57e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7e15[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x57e1('0x0'));var rimraf=require(_0x57e1('0x1'));var zipdir=require(_0x57e1('0x2'));var jsonpatch=require(_0x57e1('0x3'));var rp=require(_0x57e1('0x4'));var moment=require(_0x57e1('0x5'));var BPromise=require(_0x57e1('0x6'));var Mustache=require(_0x57e1('0x7'));var util=require(_0x57e1('0x8'));var path=require(_0x57e1('0x9'));var sox=require(_0x57e1('0xa'));var csv=require(_0x57e1('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57e1('0xc'));var _=require(_0x57e1('0xd'));var squel=require(_0x57e1('0xe'));var crypto=require('crypto');var jsforce=require(_0x57e1('0xf'));var deskjs=require(_0x57e1('0x10'));var toCsv=require(_0x57e1('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x57e1('0x11'));var authService=require(_0x57e1('0x12'));var qs=require(_0x57e1('0x13'));var as=require(_0x57e1('0x14'));var hardwareService=require(_0x57e1('0x15'));var logger=require(_0x57e1('0x16'))(_0x57e1('0x17'));var utils=require(_0x57e1('0x18'));var config=require(_0x57e1('0x19'));var licenseUtil=require(_0x57e1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2359f8,_0x47375b){_0x47375b=_0x47375b||0xcc;return function(_0x6f4e0a){if(_0x6f4e0a){return _0x2359f8['sendStatus'](_0x47375b);}return _0x2359f8['status'](_0x47375b)['end']();};}function respondWithResult(_0x27b68a,_0x58de02){_0x58de02=_0x58de02||0xc8;return function(_0x337e8f){if(_0x337e8f){return _0x27b68a['status'](_0x58de02)[_0x57e1('0x1b')](_0x337e8f);}};}function respondWithFilteredResult(_0x5787e7,_0xbed43f){return function(_0x42a79d){if(_0x42a79d){var _0x2195f9=typeof _0xbed43f[_0x57e1('0x1c')]==='undefined'&&typeof _0xbed43f['limit']===_0x57e1('0x1d');var _0x2fe1e5=_0x42a79d['count'];var _0xb637a7=_0x2195f9?0x0:_0xbed43f[_0x57e1('0x1c')];var _0x1a2d0a=_0x2195f9?_0x42a79d[_0x57e1('0x1e')]:_0xbed43f[_0x57e1('0x1c')]+_0xbed43f[_0x57e1('0x1f')];var _0x1463bb;if(_0x1a2d0a>=_0x2fe1e5){_0x1a2d0a=_0x2fe1e5;_0x1463bb=0xc8;}else{_0x1463bb=0xce;}_0x5787e7[_0x57e1('0x20')](_0x1463bb);return _0x5787e7[_0x57e1('0x21')](_0x57e1('0x22'),_0xb637a7+'-'+_0x1a2d0a+'/'+_0x2fe1e5)[_0x57e1('0x1b')](_0x42a79d);}return null;};}function patchUpdates(_0x1d3ac5){return function(_0x139be6){try{jsonpatch[_0x57e1('0x23')](_0x139be6,_0x1d3ac5,!![]);}catch(_0x34fa44){return BPromise[_0x57e1('0x24')](_0x34fa44);}return _0x139be6['save']();};}function saveUpdates(_0x2ce3eb,_0x26d50d){return function(_0x56588e){if(_0x56588e){return _0x56588e[_0x57e1('0x25')](_0x2ce3eb)[_0x57e1('0x26')](function(_0xa860d9){return _0xa860d9;});}return null;};}function removeEntity(_0x1a4420,_0x40ad70){return function(_0x3affe6){if(_0x3affe6){return _0x3affe6[_0x57e1('0x27')]()['then'](function(){_0x1a4420['status'](0xcc)[_0x57e1('0x28')]();});}};}function handleEntityNotFound(_0x46fe69,_0x5c0c7f){return function(_0x1a51e3){if(!_0x1a51e3){_0x46fe69[_0x57e1('0x29')](0x194);}return _0x1a51e3;};}function handleError(_0x22768d,_0x100429){_0x100429=_0x100429||0x1f4;return function(_0x358e23){logger[_0x57e1('0x2a')](_0x358e23[_0x57e1('0x2b')]);if(_0x358e23['name']){delete _0x358e23[_0x57e1('0x2c')];}_0x22768d[_0x57e1('0x20')](_0x100429)[_0x57e1('0x2d')](_0x358e23);};}exports[_0x57e1('0x2e')]=function(_0x3dc3d0,_0x28fb09){var _0x448664={},_0x1ad24e={},_0x16eb2c={'count':0x0,'rows':[]};var _0x115de8=_['map'](db[_0x57e1('0x2f')][_0x57e1('0x30')],function(_0x1f65ec){return{'name':_0x1f65ec['fieldName'],'type':_0x1f65ec[_0x57e1('0x31')][_0x57e1('0x32')]};});_0x1ad24e[_0x57e1('0x33')]=_['map'](_0x115de8,_0x57e1('0x2c'));_0x1ad24e[_0x57e1('0x34')]=_['keys'](_0x3dc3d0[_0x57e1('0x34')]);_0x1ad24e['filters']=_[_0x57e1('0x35')](_0x1ad24e[_0x57e1('0x33')],_0x1ad24e[_0x57e1('0x34')]);_0x448664[_0x57e1('0x36')]=_['intersection'](_0x1ad24e['model'],qs['fields'](_0x3dc3d0[_0x57e1('0x34')][_0x57e1('0x37')]));_0x448664[_0x57e1('0x36')]=_0x448664[_0x57e1('0x36')][_0x57e1('0x38')]?_0x448664['attributes']:_0x1ad24e[_0x57e1('0x33')];if(!_0x3dc3d0[_0x57e1('0x34')][_0x57e1('0x39')](_0x57e1('0x3a'))){_0x448664[_0x57e1('0x1f')]=qs[_0x57e1('0x1f')](_0x3dc3d0[_0x57e1('0x34')][_0x57e1('0x1f')]);_0x448664[_0x57e1('0x1c')]=qs[_0x57e1('0x1c')](_0x3dc3d0['query']['offset']);}_0x448664[_0x57e1('0x3b')]=qs[_0x57e1('0x3c')](_0x3dc3d0[_0x57e1('0x34')]['sort']);_0x448664[_0x57e1('0x3d')]=qs[_0x57e1('0x3e')](_['pick'](_0x3dc3d0[_0x57e1('0x34')],_0x1ad24e[_0x57e1('0x3e')]),_0x115de8);if(_0x3dc3d0[_0x57e1('0x34')]['filter']){_0x448664[_0x57e1('0x3d')]=_[_0x57e1('0x3f')](_0x448664['where'],{'$or':_[_0x57e1('0x40')](_0x115de8,function(_0xd03a62){if(_0xd03a62[_0x57e1('0x31')]!==_0x57e1('0x41')){var _0x2ac81b={};_0x2ac81b[_0xd03a62[_0x57e1('0x2c')]]={'$like':'%'+_0x3dc3d0[_0x57e1('0x34')][_0x57e1('0x42')]+'%'};return _0x2ac81b;}})});}_0x448664=_[_0x57e1('0x3f')]({},_0x448664,_0x3dc3d0[_0x57e1('0x43')]);var _0xe78c7d={'where':_0x448664[_0x57e1('0x3d')]};return db[_0x57e1('0x2f')]['count'](_0xe78c7d)[_0x57e1('0x26')](function(_0x5faf3){_0x16eb2c[_0x57e1('0x1e')]=_0x5faf3;if(_0x3dc3d0[_0x57e1('0x34')][_0x57e1('0x44')]){_0x448664['include']=[{'all':!![]}];}return db[_0x57e1('0x2f')][_0x57e1('0x45')](_0x448664);})[_0x57e1('0x26')](function(_0x89ee4e){_0x16eb2c[_0x57e1('0x46')]=_0x89ee4e;return _0x16eb2c;})[_0x57e1('0x26')](respondWithFilteredResult(_0x28fb09,_0x448664))[_0x57e1('0x47')](handleError(_0x28fb09,null));};exports[_0x57e1('0x48')]=function(_0x148d03,_0x51834c){var _0x840e70={'raw':![],'where':{'id':_0x148d03[_0x57e1('0x49')]['id']}},_0x43d602={};_0x43d602[_0x57e1('0x33')]=_['keys'](db[_0x57e1('0x2f')][_0x57e1('0x30')]);_0x43d602[_0x57e1('0x34')]=_[_0x57e1('0x4a')](_0x148d03[_0x57e1('0x34')]);_0x43d602[_0x57e1('0x3e')]=_[_0x57e1('0x35')](_0x43d602[_0x57e1('0x33')],_0x43d602[_0x57e1('0x34')]);_0x840e70[_0x57e1('0x36')]=_[_0x57e1('0x35')](_0x43d602[_0x57e1('0x33')],qs[_0x57e1('0x37')](_0x148d03[_0x57e1('0x34')][_0x57e1('0x37')]));_0x840e70[_0x57e1('0x36')]=_0x840e70[_0x57e1('0x36')][_0x57e1('0x38')]?_0x840e70[_0x57e1('0x36')]:_0x43d602[_0x57e1('0x33')];if(_0x148d03[_0x57e1('0x34')][_0x57e1('0x44')]){_0x840e70[_0x57e1('0x4b')]=[{'all':!![]}];}_0x840e70=_['merge']({},_0x840e70,_0x148d03['options']);return db[_0x57e1('0x2f')][_0x57e1('0x4c')](_0x840e70)['then'](handleEntityNotFound(_0x51834c,null))[_0x57e1('0x26')](respondWithResult(_0x51834c,null))[_0x57e1('0x47')](handleError(_0x51834c,null));};exports[_0x57e1('0x4d')]=function(_0x2befef,_0x2d8269){return db[_0x57e1('0x2f')][_0x57e1('0x4d')](_0x2befef[_0x57e1('0x4e')],{})[_0x57e1('0x26')](respondWithResult(_0x2d8269,0xc9))[_0x57e1('0x47')](handleError(_0x2d8269,null));};exports[_0x57e1('0x25')]=function(_0x54deeb,_0x2b1238){if(_0x54deeb[_0x57e1('0x4e')]['id']){delete _0x54deeb[_0x57e1('0x4e')]['id'];}return db[_0x57e1('0x2f')][_0x57e1('0x4c')]({'where':{'id':_0x54deeb[_0x57e1('0x49')]['id']}})[_0x57e1('0x26')](handleEntityNotFound(_0x2b1238,null))[_0x57e1('0x26')](saveUpdates(_0x54deeb[_0x57e1('0x4e')],null))[_0x57e1('0x26')](respondWithResult(_0x2b1238,null))[_0x57e1('0x47')](handleError(_0x2b1238,null));};exports[_0x57e1('0x27')]=function(_0x127da9,_0x28a968){return db[_0x57e1('0x2f')]['find']({'where':{'id':_0x127da9[_0x57e1('0x49')]['id']}})['then'](handleEntityNotFound(_0x28a968,null))['then'](removeEntity(_0x28a968,null))[_0x57e1('0x47')](handleError(_0x28a968,null));};exports['getFields']=function(_0x138a91,_0x2996b6,_0x7c6ef7){var _0x1742aa={};var _0x50cb75={};var _0x4fed9e;var _0x2762db;return db[_0x57e1('0x2f')][_0x57e1('0x4f')]({'where':{'id':_0x138a91[_0x57e1('0x49')]['id']}})[_0x57e1('0x26')](handleEntityNotFound(_0x2996b6,null))[_0x57e1('0x26')](function(_0x2ac9cd){if(_0x2ac9cd){_0x4fed9e=_0x2ac9cd;_0x50cb75['model']=_['keys'](db[_0x57e1('0x50')][_0x57e1('0x30')]);_0x50cb75[_0x57e1('0x34')]=_[_0x57e1('0x4a')](_0x138a91[_0x57e1('0x34')]);_0x50cb75[_0x57e1('0x3e')]=_[_0x57e1('0x35')](_0x50cb75[_0x57e1('0x33')],_0x50cb75[_0x57e1('0x34')]);_0x1742aa[_0x57e1('0x36')]=_[_0x57e1('0x35')](_0x50cb75['model'],qs[_0x57e1('0x37')](_0x138a91[_0x57e1('0x34')][_0x57e1('0x37')]));_0x1742aa[_0x57e1('0x36')]=_0x1742aa[_0x57e1('0x36')][_0x57e1('0x38')]?_0x1742aa[_0x57e1('0x36')]:_0x50cb75[_0x57e1('0x33')];_0x1742aa[_0x57e1('0x3b')]=qs[_0x57e1('0x3c')](_0x138a91[_0x57e1('0x34')][_0x57e1('0x3c')]);_0x1742aa[_0x57e1('0x3d')]=qs[_0x57e1('0x3e')](_['pick'](_0x138a91['query'],_0x50cb75['filters']));if(_0x138a91['query'][_0x57e1('0x42')]){_0x1742aa[_0x57e1('0x3d')]=_['merge'](_0x1742aa[_0x57e1('0x3d')],{'$or':_[_0x57e1('0x40')](_0x1742aa[_0x57e1('0x36')],function(_0xd0bc1c){var _0x576409={};_0x576409[_0xd0bc1c]={'$like':'%'+_0x138a91[_0x57e1('0x34')][_0x57e1('0x42')]+'%'};return _0x576409;})});}_0x1742aa=_[_0x57e1('0x3f')]({},_0x1742aa,_0x138a91['options']);return _0x4fed9e[_0x57e1('0x51')](_0x1742aa);}})['then'](function(_0x2a5fcd){if(_0x2a5fcd){_0x2762db=_0x2a5fcd[_0x57e1('0x38')];if(!_0x138a91[_0x57e1('0x34')]['hasOwnProperty']('nolimit')){_0x1742aa[_0x57e1('0x1f')]=qs[_0x57e1('0x1f')](_0x138a91[_0x57e1('0x34')][_0x57e1('0x1f')]);_0x1742aa[_0x57e1('0x1c')]=qs['offset'](_0x138a91['query'][_0x57e1('0x1c')]);}return _0x4fed9e[_0x57e1('0x51')](_0x1742aa);}})[_0x57e1('0x26')](function(_0x498580){if(_0x498580){return _0x498580?{'count':_0x2762db,'rows':_0x498580}:null;}})['then'](respondWithResult(_0x2996b6,null))[_0x57e1('0x47')](handleError(_0x2996b6,null));};exports[_0x57e1('0x52')]=function(_0x19149c,_0x5d0b7e,_0x3956da){var _0x53dc94={};var _0x368ac0={};var _0x4b0ecf;var _0xa7cdf4;return db[_0x57e1('0x2f')][_0x57e1('0x4f')]({'where':{'id':_0x19149c[_0x57e1('0x49')]['id']}})[_0x57e1('0x26')](handleEntityNotFound(_0x5d0b7e,null))[_0x57e1('0x26')](function(_0x37087d){if(_0x37087d){_0x4b0ecf=_0x37087d;_0x368ac0['model']=_[_0x57e1('0x4a')](db[_0x57e1('0x50')]['rawAttributes']);_0x368ac0[_0x57e1('0x34')]=_[_0x57e1('0x4a')](_0x19149c[_0x57e1('0x34')]);_0x368ac0[_0x57e1('0x3e')]=_[_0x57e1('0x35')](_0x368ac0[_0x57e1('0x33')],_0x368ac0[_0x57e1('0x34')]);_0x53dc94['attributes']=_[_0x57e1('0x35')](_0x368ac0[_0x57e1('0x33')],qs[_0x57e1('0x37')](_0x19149c[_0x57e1('0x34')][_0x57e1('0x37')]));_0x53dc94[_0x57e1('0x36')]=_0x53dc94['attributes'][_0x57e1('0x38')]?_0x53dc94[_0x57e1('0x36')]:_0x368ac0['model'];_0x53dc94['order']=qs[_0x57e1('0x3c')](_0x19149c[_0x57e1('0x34')]['sort']);_0x53dc94['where']=qs['filters'](_['pick'](_0x19149c[_0x57e1('0x34')],_0x368ac0[_0x57e1('0x3e')]));if(_0x19149c[_0x57e1('0x34')][_0x57e1('0x42')]){_0x53dc94['where']=_[_0x57e1('0x3f')](_0x53dc94[_0x57e1('0x3d')],{'$or':_[_0x57e1('0x40')](_0x53dc94[_0x57e1('0x36')],function(_0x4fab1f){var _0x22c093={};_0x22c093[_0x4fab1f]={'$like':'%'+_0x19149c[_0x57e1('0x34')][_0x57e1('0x42')]+'%'};return _0x22c093;})});}_0x53dc94=_['merge']({},_0x53dc94,_0x19149c[_0x57e1('0x43')]);return _0x4b0ecf[_0x57e1('0x52')](_0x53dc94);}})[_0x57e1('0x26')](function(_0x5a9599){if(_0x5a9599){_0xa7cdf4=_0x5a9599['length'];if(!_0x19149c['query'][_0x57e1('0x39')](_0x57e1('0x3a'))){_0x53dc94[_0x57e1('0x1f')]=qs[_0x57e1('0x1f')](_0x19149c[_0x57e1('0x34')][_0x57e1('0x1f')]);_0x53dc94['offset']=qs['offset'](_0x19149c['query']['offset']);}return _0x4b0ecf['getSubjects'](_0x53dc94);}})[_0x57e1('0x26')](function(_0x6433c7){if(_0x6433c7){return _0x6433c7?{'count':_0xa7cdf4,'rows':_0x6433c7}:null;}})[_0x57e1('0x26')](respondWithResult(_0x5d0b7e,null))[_0x57e1('0x47')](handleError(_0x5d0b7e,null));};exports[_0x57e1('0x53')]=function(_0x256308,_0x39a25e,_0x414071){var _0x17d9e2={};var _0x5c02e1={};var _0x118a0a;var _0x1d2403;return db[_0x57e1('0x2f')]['findOne']({'where':{'id':_0x256308[_0x57e1('0x49')]['id']}})[_0x57e1('0x26')](handleEntityNotFound(_0x39a25e,null))[_0x57e1('0x26')](function(_0x16aab7){if(_0x16aab7){_0x118a0a=_0x16aab7;_0x5c02e1[_0x57e1('0x33')]=_[_0x57e1('0x4a')](db['ServicenowField'][_0x57e1('0x30')]);_0x5c02e1['query']=_['keys'](_0x256308[_0x57e1('0x34')]);_0x5c02e1[_0x57e1('0x3e')]=_[_0x57e1('0x35')](_0x5c02e1['model'],_0x5c02e1['query']);_0x17d9e2[_0x57e1('0x36')]=_['intersection'](_0x5c02e1[_0x57e1('0x33')],qs[_0x57e1('0x37')](_0x256308[_0x57e1('0x34')][_0x57e1('0x37')]));_0x17d9e2[_0x57e1('0x36')]=_0x17d9e2[_0x57e1('0x36')][_0x57e1('0x38')]?_0x17d9e2[_0x57e1('0x36')]:_0x5c02e1['model'];_0x17d9e2[_0x57e1('0x3b')]=qs[_0x57e1('0x3c')](_0x256308[_0x57e1('0x34')][_0x57e1('0x3c')]);_0x17d9e2[_0x57e1('0x3d')]=qs['filters'](_[_0x57e1('0x54')](_0x256308['query'],_0x5c02e1['filters']));if(_0x256308['query'][_0x57e1('0x42')]){_0x17d9e2[_0x57e1('0x3d')]=_['merge'](_0x17d9e2['where'],{'$or':_[_0x57e1('0x40')](_0x17d9e2['attributes'],function(_0xfa800f){var _0x5e8129={};_0x5e8129[_0xfa800f]={'$like':'%'+_0x256308['query'][_0x57e1('0x42')]+'%'};return _0x5e8129;})});}_0x17d9e2=_[_0x57e1('0x3f')]({},_0x17d9e2,_0x256308[_0x57e1('0x43')]);return _0x118a0a[_0x57e1('0x53')](_0x17d9e2);}})[_0x57e1('0x26')](function(_0x43ca82){if(_0x43ca82){_0x1d2403=_0x43ca82[_0x57e1('0x38')];if(!_0x256308[_0x57e1('0x34')][_0x57e1('0x39')](_0x57e1('0x3a'))){_0x17d9e2[_0x57e1('0x1f')]=qs[_0x57e1('0x1f')](_0x256308['query'][_0x57e1('0x1f')]);_0x17d9e2[_0x57e1('0x1c')]=qs[_0x57e1('0x1c')](_0x256308[_0x57e1('0x34')][_0x57e1('0x1c')]);}return _0x118a0a['getDescriptions'](_0x17d9e2);}})[_0x57e1('0x26')](function(_0x18c4d0){if(_0x18c4d0){return _0x18c4d0?{'count':_0x1d2403,'rows':_0x18c4d0}:null;}})[_0x57e1('0x26')](respondWithResult(_0x39a25e,null))[_0x57e1('0x47')](handleError(_0x39a25e,null));};
\ No newline at end of file
+var _0xccaa=['fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','body','find','getFields','findOne','ServicenowField','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','ServicenowConfiguration','rawAttributes'];(function(_0x75529f,_0x46eb76){var _0x4db920=function(_0x567fa6){while(--_0x567fa6){_0x75529f['push'](_0x75529f['shift']());}};_0x4db920(++_0x46eb76);}(_0xccaa,0x1f2));var _0xacca=function(_0x4a1e37,_0x2eef28){_0x4a1e37=_0x4a1e37-0x0;var _0xeb1f8b=_0xccaa[_0x4a1e37];return _0xeb1f8b;};'use strict';var emlformat=require(_0xacca('0x0'));var rimraf=require(_0xacca('0x1'));var zipdir=require(_0xacca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xacca('0x3'));var moment=require(_0xacca('0x4'));var BPromise=require(_0xacca('0x5'));var Mustache=require(_0xacca('0x6'));var util=require(_0xacca('0x7'));var path=require('path');var sox=require(_0xacca('0x8'));var csv=require(_0xacca('0x9'));var ejs=require(_0xacca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xacca('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xacca('0xc'));var toCsv=require('to-csv');var querystring=require(_0xacca('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xacca('0xe'));var as=require(_0xacca('0xf'));var hardwareService=require(_0xacca('0x10'));var logger=require(_0xacca('0x11'))(_0xacca('0x12'));var utils=require('../../config/utils');var config=require(_0xacca('0x13'));var licenseUtil=require(_0xacca('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf01c91,_0x3abbb7){_0x3abbb7=_0x3abbb7||0xcc;return function(_0x4c3b13){if(_0x4c3b13){return _0xf01c91[_0xacca('0x15')](_0x3abbb7);}return _0xf01c91[_0xacca('0x16')](_0x3abbb7)[_0xacca('0x17')]();};}function respondWithResult(_0x4ef80b,_0x576ad1){_0x576ad1=_0x576ad1||0xc8;return function(_0x24bc81){if(_0x24bc81){return _0x4ef80b[_0xacca('0x16')](_0x576ad1)[_0xacca('0x18')](_0x24bc81);}};}function respondWithFilteredResult(_0x487dde,_0xc3c506){return function(_0x10eeb6){if(_0x10eeb6){var _0x2ab37f=typeof _0xc3c506[_0xacca('0x19')]==='undefined'&&typeof _0xc3c506[_0xacca('0x1a')]==='undefined';var _0x87f028=_0x10eeb6[_0xacca('0x1b')];var _0x4ec7ee=_0x2ab37f?0x0:_0xc3c506['offset'];var _0x225c6f=_0x2ab37f?_0x10eeb6[_0xacca('0x1b')]:_0xc3c506[_0xacca('0x19')]+_0xc3c506[_0xacca('0x1a')];var _0x2a3baf;if(_0x225c6f>=_0x87f028){_0x225c6f=_0x87f028;_0x2a3baf=0xc8;}else{_0x2a3baf=0xce;}_0x487dde[_0xacca('0x16')](_0x2a3baf);return _0x487dde[_0xacca('0x1c')](_0xacca('0x1d'),_0x4ec7ee+'-'+_0x225c6f+'/'+_0x87f028)['json'](_0x10eeb6);}return null;};}function patchUpdates(_0x33d01a){return function(_0x3e2f05){try{jsonpatch[_0xacca('0x1e')](_0x3e2f05,_0x33d01a,!![]);}catch(_0x58c7b1){return BPromise[_0xacca('0x1f')](_0x58c7b1);}return _0x3e2f05[_0xacca('0x20')]();};}function saveUpdates(_0x4a3f72,_0x1c469d){return function(_0x8ede89){if(_0x8ede89){return _0x8ede89[_0xacca('0x21')](_0x4a3f72)[_0xacca('0x22')](function(_0x25327c){return _0x25327c;});}return null;};}function removeEntity(_0x112e36,_0x2caca9){return function(_0x496590){if(_0x496590){return _0x496590[_0xacca('0x23')]()[_0xacca('0x22')](function(){_0x112e36[_0xacca('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dc0cc,_0x29fee9){return function(_0x494808){if(!_0x494808){_0x3dc0cc[_0xacca('0x15')](0x194);}return _0x494808;};}function handleError(_0x8b49c4,_0x2c03fe){_0x2c03fe=_0x2c03fe||0x1f4;return function(_0x5129a2){logger[_0xacca('0x24')](_0x5129a2['stack']);if(_0x5129a2['name']){delete _0x5129a2[_0xacca('0x25')];}_0x8b49c4[_0xacca('0x16')](_0x2c03fe)['send'](_0x5129a2);};}exports[_0xacca('0x26')]=function(_0x59e0e7,_0x2904b7){var _0x3fd05e={},_0x3fd0fd={},_0x5391f5={'count':0x0,'rows':[]};var _0x5b053f=_['map'](db[_0xacca('0x27')][_0xacca('0x28')],function(_0x357272){return{'name':_0x357272[_0xacca('0x29')],'type':_0x357272['type'][_0xacca('0x2a')]};});_0x3fd0fd[_0xacca('0x2b')]=_[_0xacca('0x2c')](_0x5b053f,_0xacca('0x25'));_0x3fd0fd[_0xacca('0x2d')]=_[_0xacca('0x2e')](_0x59e0e7[_0xacca('0x2d')]);_0x3fd0fd[_0xacca('0x2f')]=_[_0xacca('0x30')](_0x3fd0fd[_0xacca('0x2b')],_0x3fd0fd['query']);_0x3fd05e['attributes']=_[_0xacca('0x30')](_0x3fd0fd[_0xacca('0x2b')],qs[_0xacca('0x31')](_0x59e0e7[_0xacca('0x2d')][_0xacca('0x31')]));_0x3fd05e['attributes']=_0x3fd05e[_0xacca('0x32')][_0xacca('0x33')]?_0x3fd05e[_0xacca('0x32')]:_0x3fd0fd[_0xacca('0x2b')];if(!_0x59e0e7['query'][_0xacca('0x34')](_0xacca('0x35'))){_0x3fd05e[_0xacca('0x1a')]=qs[_0xacca('0x1a')](_0x59e0e7['query'][_0xacca('0x1a')]);_0x3fd05e['offset']=qs[_0xacca('0x19')](_0x59e0e7[_0xacca('0x2d')][_0xacca('0x19')]);}_0x3fd05e[_0xacca('0x36')]=qs[_0xacca('0x37')](_0x59e0e7[_0xacca('0x2d')][_0xacca('0x37')]);_0x3fd05e[_0xacca('0x38')]=qs['filters'](_['pick'](_0x59e0e7[_0xacca('0x2d')],_0x3fd0fd[_0xacca('0x2f')]),_0x5b053f);if(_0x59e0e7[_0xacca('0x2d')][_0xacca('0x39')]){_0x3fd05e[_0xacca('0x38')]=_['merge'](_0x3fd05e[_0xacca('0x38')],{'$or':_[_0xacca('0x2c')](_0x5b053f,function(_0x58a911){if(_0x58a911[_0xacca('0x3a')]!==_0xacca('0x3b')){var _0x5c43c1={};_0x5c43c1[_0x58a911[_0xacca('0x25')]]={'$like':'%'+_0x59e0e7[_0xacca('0x2d')]['filter']+'%'};return _0x5c43c1;}})});}_0x3fd05e=_[_0xacca('0x3c')]({},_0x3fd05e,_0x59e0e7[_0xacca('0x3d')]);var _0x3257b6={'where':_0x3fd05e[_0xacca('0x38')]};return db['ServicenowConfiguration'][_0xacca('0x1b')](_0x3257b6)[_0xacca('0x22')](function(_0x588728){_0x5391f5[_0xacca('0x1b')]=_0x588728;if(_0x59e0e7[_0xacca('0x2d')][_0xacca('0x3e')]){_0x3fd05e[_0xacca('0x3f')]=[{'all':!![]}];}return db[_0xacca('0x27')][_0xacca('0x40')](_0x3fd05e);})[_0xacca('0x22')](function(_0x4b992c){_0x5391f5[_0xacca('0x41')]=_0x4b992c;return _0x5391f5;})[_0xacca('0x22')](respondWithFilteredResult(_0x2904b7,_0x3fd05e))[_0xacca('0x42')](handleError(_0x2904b7,null));};exports['show']=function(_0x1a184c,_0xfbf00b){var _0x1bcf9b={'raw':![],'where':{'id':_0x1a184c[_0xacca('0x43')]['id']}},_0x21b614={};_0x21b614[_0xacca('0x2b')]=_[_0xacca('0x2e')](db[_0xacca('0x27')][_0xacca('0x28')]);_0x21b614[_0xacca('0x2d')]=_[_0xacca('0x2e')](_0x1a184c['query']);_0x21b614[_0xacca('0x2f')]=_[_0xacca('0x30')](_0x21b614['model'],_0x21b614[_0xacca('0x2d')]);_0x1bcf9b['attributes']=_[_0xacca('0x30')](_0x21b614[_0xacca('0x2b')],qs[_0xacca('0x31')](_0x1a184c[_0xacca('0x2d')]['fields']));_0x1bcf9b['attributes']=_0x1bcf9b[_0xacca('0x32')][_0xacca('0x33')]?_0x1bcf9b['attributes']:_0x21b614['model'];if(_0x1a184c['query'][_0xacca('0x3e')]){_0x1bcf9b[_0xacca('0x3f')]=[{'all':!![]}];}_0x1bcf9b=_[_0xacca('0x3c')]({},_0x1bcf9b,_0x1a184c[_0xacca('0x3d')]);return db[_0xacca('0x27')]['find'](_0x1bcf9b)[_0xacca('0x22')](handleEntityNotFound(_0xfbf00b,null))[_0xacca('0x22')](respondWithResult(_0xfbf00b,null))[_0xacca('0x42')](handleError(_0xfbf00b,null));};exports[_0xacca('0x44')]=function(_0x3466fc,_0x217c93){return db['ServicenowConfiguration'][_0xacca('0x44')](_0x3466fc[_0xacca('0x45')],{})[_0xacca('0x22')](respondWithResult(_0x217c93,0xc9))['catch'](handleError(_0x217c93,null));};exports[_0xacca('0x21')]=function(_0x194d11,_0x2a38ce){if(_0x194d11[_0xacca('0x45')]['id']){delete _0x194d11[_0xacca('0x45')]['id'];}return db[_0xacca('0x27')]['find']({'where':{'id':_0x194d11[_0xacca('0x43')]['id']}})['then'](handleEntityNotFound(_0x2a38ce,null))['then'](saveUpdates(_0x194d11['body'],null))['then'](respondWithResult(_0x2a38ce,null))[_0xacca('0x42')](handleError(_0x2a38ce,null));};exports[_0xacca('0x23')]=function(_0x22dcf6,_0x486de3){return db[_0xacca('0x27')][_0xacca('0x46')]({'where':{'id':_0x22dcf6[_0xacca('0x43')]['id']}})[_0xacca('0x22')](handleEntityNotFound(_0x486de3,null))[_0xacca('0x22')](removeEntity(_0x486de3,null))['catch'](handleError(_0x486de3,null));};exports[_0xacca('0x47')]=function(_0x32a9f3,_0x2db672,_0x560e9e){var _0x58e98c={};var _0x36e4f6={};var _0x49c157;var _0x2cea19;return db[_0xacca('0x27')][_0xacca('0x48')]({'where':{'id':_0x32a9f3[_0xacca('0x43')]['id']}})[_0xacca('0x22')](handleEntityNotFound(_0x2db672,null))[_0xacca('0x22')](function(_0x4dfeef){if(_0x4dfeef){_0x49c157=_0x4dfeef;_0x36e4f6[_0xacca('0x2b')]=_[_0xacca('0x2e')](db[_0xacca('0x49')][_0xacca('0x28')]);_0x36e4f6[_0xacca('0x2d')]=_[_0xacca('0x2e')](_0x32a9f3[_0xacca('0x2d')]);_0x36e4f6['filters']=_['intersection'](_0x36e4f6[_0xacca('0x2b')],_0x36e4f6[_0xacca('0x2d')]);_0x58e98c[_0xacca('0x32')]=_[_0xacca('0x30')](_0x36e4f6['model'],qs[_0xacca('0x31')](_0x32a9f3[_0xacca('0x2d')]['fields']));_0x58e98c[_0xacca('0x32')]=_0x58e98c[_0xacca('0x32')][_0xacca('0x33')]?_0x58e98c[_0xacca('0x32')]:_0x36e4f6[_0xacca('0x2b')];_0x58e98c['order']=qs[_0xacca('0x37')](_0x32a9f3[_0xacca('0x2d')]['sort']);_0x58e98c[_0xacca('0x38')]=qs[_0xacca('0x2f')](_['pick'](_0x32a9f3['query'],_0x36e4f6[_0xacca('0x2f')]));if(_0x32a9f3[_0xacca('0x2d')]['filter']){_0x58e98c[_0xacca('0x38')]=_[_0xacca('0x3c')](_0x58e98c[_0xacca('0x38')],{'$or':_[_0xacca('0x2c')](_0x58e98c[_0xacca('0x32')],function(_0x557701){var _0x3e5902={};_0x3e5902[_0x557701]={'$like':'%'+_0x32a9f3[_0xacca('0x2d')]['filter']+'%'};return _0x3e5902;})});}_0x58e98c=_[_0xacca('0x3c')]({},_0x58e98c,_0x32a9f3[_0xacca('0x3d')]);return _0x49c157[_0xacca('0x47')](_0x58e98c);}})[_0xacca('0x22')](function(_0x55e9ab){if(_0x55e9ab){_0x2cea19=_0x55e9ab[_0xacca('0x33')];if(!_0x32a9f3['query'][_0xacca('0x34')](_0xacca('0x35'))){_0x58e98c['limit']=qs['limit'](_0x32a9f3[_0xacca('0x2d')][_0xacca('0x1a')]);_0x58e98c[_0xacca('0x19')]=qs['offset'](_0x32a9f3[_0xacca('0x2d')]['offset']);}return _0x49c157[_0xacca('0x47')](_0x58e98c);}})['then'](function(_0x4a0e03){if(_0x4a0e03){return _0x4a0e03?{'count':_0x2cea19,'rows':_0x4a0e03}:null;}})[_0xacca('0x22')](respondWithResult(_0x2db672,null))[_0xacca('0x42')](handleError(_0x2db672,null));};exports[_0xacca('0x4a')]=function(_0x367f88,_0xedb31f,_0x3e66ca){var _0x4095b2={};var _0x5de413={};var _0x46296f;var _0x18514e;return db[_0xacca('0x27')]['findOne']({'where':{'id':_0x367f88[_0xacca('0x43')]['id']}})['then'](handleEntityNotFound(_0xedb31f,null))['then'](function(_0x197077){if(_0x197077){_0x46296f=_0x197077;_0x5de413[_0xacca('0x2b')]=_[_0xacca('0x2e')](db[_0xacca('0x49')][_0xacca('0x28')]);_0x5de413[_0xacca('0x2d')]=_[_0xacca('0x2e')](_0x367f88[_0xacca('0x2d')]);_0x5de413[_0xacca('0x2f')]=_[_0xacca('0x30')](_0x5de413['model'],_0x5de413[_0xacca('0x2d')]);_0x4095b2['attributes']=_['intersection'](_0x5de413[_0xacca('0x2b')],qs[_0xacca('0x31')](_0x367f88[_0xacca('0x2d')]['fields']));_0x4095b2[_0xacca('0x32')]=_0x4095b2[_0xacca('0x32')][_0xacca('0x33')]?_0x4095b2[_0xacca('0x32')]:_0x5de413[_0xacca('0x2b')];_0x4095b2[_0xacca('0x36')]=qs[_0xacca('0x37')](_0x367f88[_0xacca('0x2d')][_0xacca('0x37')]);_0x4095b2[_0xacca('0x38')]=qs[_0xacca('0x2f')](_[_0xacca('0x4b')](_0x367f88[_0xacca('0x2d')],_0x5de413[_0xacca('0x2f')]));if(_0x367f88[_0xacca('0x2d')][_0xacca('0x39')]){_0x4095b2['where']=_[_0xacca('0x3c')](_0x4095b2[_0xacca('0x38')],{'$or':_['map'](_0x4095b2['attributes'],function(_0x476226){var _0x239501={};_0x239501[_0x476226]={'$like':'%'+_0x367f88['query'][_0xacca('0x39')]+'%'};return _0x239501;})});}_0x4095b2=_['merge']({},_0x4095b2,_0x367f88[_0xacca('0x3d')]);return _0x46296f[_0xacca('0x4a')](_0x4095b2);}})['then'](function(_0x4382ef){if(_0x4382ef){_0x18514e=_0x4382ef[_0xacca('0x33')];if(!_0x367f88[_0xacca('0x2d')][_0xacca('0x34')](_0xacca('0x35'))){_0x4095b2['limit']=qs['limit'](_0x367f88['query']['limit']);_0x4095b2[_0xacca('0x19')]=qs[_0xacca('0x19')](_0x367f88[_0xacca('0x2d')][_0xacca('0x19')]);}return _0x46296f[_0xacca('0x4a')](_0x4095b2);}})[_0xacca('0x22')](function(_0x1209a1){if(_0x1209a1){return _0x1209a1?{'count':_0x18514e,'rows':_0x1209a1}:null;}})[_0xacca('0x22')](respondWithResult(_0xedb31f,null))[_0xacca('0x42')](handleError(_0xedb31f,null));};exports['getDescriptions']=function(_0x39b65d,_0x44d5e7,_0x1d8139){var _0x2633c2={};var _0x33197e={};var _0x14993d;var _0x17e19a;return db['ServicenowConfiguration'][_0xacca('0x48')]({'where':{'id':_0x39b65d[_0xacca('0x43')]['id']}})[_0xacca('0x22')](handleEntityNotFound(_0x44d5e7,null))[_0xacca('0x22')](function(_0x1090ec){if(_0x1090ec){_0x14993d=_0x1090ec;_0x33197e['model']=_[_0xacca('0x2e')](db[_0xacca('0x49')][_0xacca('0x28')]);_0x33197e[_0xacca('0x2d')]=_[_0xacca('0x2e')](_0x39b65d[_0xacca('0x2d')]);_0x33197e[_0xacca('0x2f')]=_[_0xacca('0x30')](_0x33197e[_0xacca('0x2b')],_0x33197e[_0xacca('0x2d')]);_0x2633c2[_0xacca('0x32')]=_[_0xacca('0x30')](_0x33197e[_0xacca('0x2b')],qs[_0xacca('0x31')](_0x39b65d[_0xacca('0x2d')][_0xacca('0x31')]));_0x2633c2[_0xacca('0x32')]=_0x2633c2[_0xacca('0x32')][_0xacca('0x33')]?_0x2633c2['attributes']:_0x33197e['model'];_0x2633c2['order']=qs['sort'](_0x39b65d[_0xacca('0x2d')][_0xacca('0x37')]);_0x2633c2[_0xacca('0x38')]=qs['filters'](_[_0xacca('0x4b')](_0x39b65d['query'],_0x33197e[_0xacca('0x2f')]));if(_0x39b65d[_0xacca('0x2d')][_0xacca('0x39')]){_0x2633c2[_0xacca('0x38')]=_[_0xacca('0x3c')](_0x2633c2[_0xacca('0x38')],{'$or':_[_0xacca('0x2c')](_0x2633c2[_0xacca('0x32')],function(_0x28ee7c){var _0x422376={};_0x422376[_0x28ee7c]={'$like':'%'+_0x39b65d['query'][_0xacca('0x39')]+'%'};return _0x422376;})});}_0x2633c2=_['merge']({},_0x2633c2,_0x39b65d[_0xacca('0x3d')]);return _0x14993d[_0xacca('0x4c')](_0x2633c2);}})['then'](function(_0x1f0137){if(_0x1f0137){_0x17e19a=_0x1f0137[_0xacca('0x33')];if(!_0x39b65d[_0xacca('0x2d')]['hasOwnProperty']('nolimit')){_0x2633c2['limit']=qs['limit'](_0x39b65d[_0xacca('0x2d')]['limit']);_0x2633c2[_0xacca('0x19')]=qs[_0xacca('0x19')](_0x39b65d[_0xacca('0x2d')][_0xacca('0x19')]);}return _0x14993d[_0xacca('0x4c')](_0x2633c2);}})[_0xacca('0x22')](function(_0x5bd704){if(_0x5bd704){return _0x5bd704?{'count':_0x17e19a,'rows':_0x5bd704}:null;}})[_0xacca('0x22')](respondWithResult(_0x44d5e7,null))[_0xacca('0x42')](handleError(_0x44d5e7,null));};
\ No newline at end of file
index b0bd5ab..46c8ba0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc15c=['../../config/logger','api','moment','request-promise','../../config/environment','int_servicenow_configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc15c,0xae));var _0xcc15=function(_0x7aa257,_0x403bd7){_0x7aa257=_0x7aa257-0x0;var _0x289a29=_0xc15c[_0x7aa257];return _0x289a29;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcc15('0x0'))(_0xcc15('0x1'));var moment=require(_0xcc15('0x2'));var BPromise=require('bluebird');var rp=require(_0xcc15('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcc15('0x4'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x11ae7e,_0x15135d){return _0x11ae7e['define']('ServicenowConfiguration',attributes,{'tableName':_0xcc15('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae8e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x265c1c,_0x1fa667){var _0xf1471=function(_0x2a8bfb){while(--_0x2a8bfb){_0x265c1c['push'](_0x265c1c['shift']());}};_0xf1471(++_0x1fa667);}(_0xae8e,0xc3));var _0xeae8=function(_0x195e83,_0xe672b5){_0x195e83=_0x195e83-0x0;var _0x1c0062=_0xae8e[_0x195e83];return _0x1c0062;};'use strict';var _=require(_0xeae8('0x0'));var util=require(_0xeae8('0x1'));var logger=require(_0xeae8('0x2'))(_0xeae8('0x3'));var moment=require(_0xeae8('0x4'));var BPromise=require(_0xeae8('0x5'));var rp=require(_0xeae8('0x6'));var fs=require('fs');var path=require(_0xeae8('0x7'));var rimraf=require(_0xeae8('0x8'));var config=require(_0xeae8('0x9'));var attributes=require(_0xeae8('0xa'));module[_0xeae8('0xb')]=function(_0x23b0d7,_0x17345e){return _0x23b0d7[_0xeae8('0xc')](_0xeae8('0xd'),attributes,{'tableName':_0xeae8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 75107e5..e0478cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b26=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch'];(function(_0x1a2ef3,_0x21186c){var _0x34f4a4=function(_0x277126){while(--_0x277126){_0x1a2ef3['push'](_0x1a2ef3['shift']());}};_0x34f4a4(++_0x21186c);}(_0x5b26,0x7d));var _0x65b2=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5b26[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x65b2('0x0'));var util=require(_0x65b2('0x1'));var moment=require('moment');var BPromise=require(_0x65b2('0x2'));var rs=require(_0x65b2('0x3'));var fs=require('fs');var Redis=require(_0x65b2('0x4'));var db=require(_0x65b2('0x5'))['db'];var utils=require(_0x65b2('0x6'));var logger=require(_0x65b2('0x7'))(_0x65b2('0x8'));var config=require(_0x65b2('0x9'));var jayson=require(_0x65b2('0xa'));var client=jayson[_0x65b2('0xb')][_0x65b2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36c91b,_0x428949,_0x4a5ee1){return new BPromise(function(_0x594e7c,_0x1e3c80){return client[_0x65b2('0xd')](_0x36c91b,_0x4a5ee1)[_0x65b2('0xe')](function(_0x5fde7f){logger[_0x65b2('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x428949,_0x65b2('0x10'));logger['debug'](_0x65b2('0x11'),_0x428949,_0x65b2('0x10'),JSON[_0x65b2('0x12')](_0x5fde7f));if(_0x5fde7f[_0x65b2('0x13')]){if(_0x5fde7f[_0x65b2('0x13')][_0x65b2('0x14')]===0x1f4){logger[_0x65b2('0x13')](_0x65b2('0x15'),_0x428949,_0x5fde7f[_0x65b2('0x13')][_0x65b2('0x16')]);return _0x1e3c80(_0x5fde7f[_0x65b2('0x13')]['message']);}logger[_0x65b2('0x13')](_0x65b2('0x15'),_0x428949,_0x5fde7f[_0x65b2('0x13')]['message']);return _0x594e7c(_0x5fde7f[_0x65b2('0x13')][_0x65b2('0x16')]);}else{logger[_0x65b2('0xf')](_0x65b2('0x15'),_0x428949,_0x65b2('0x10'));_0x594e7c(_0x5fde7f[_0x65b2('0x17')]['message']);}})[_0x65b2('0x18')](function(_0x1d61cd){logger[_0x65b2('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x428949,_0x1d61cd);_0x1e3c80(_0x1d61cd);});});}
\ No newline at end of file
+var _0xe935=['../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe935,0x10b));var _0x5e93=function(_0xd05645,_0x419bc4){_0xd05645=_0xd05645-0x0;var _0x13302c=_0xe935[_0xd05645];return _0x13302c;};'use strict';var _=require(_0x5e93('0x0'));var util=require(_0x5e93('0x1'));var moment=require('moment');var BPromise=require(_0x5e93('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e93('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e93('0x4'));var logger=require(_0x5e93('0x5'))('rpc');var config=require(_0x5e93('0x6'));var jayson=require(_0x5e93('0x7'));var client=jayson[_0x5e93('0x8')][_0x5e93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f89c8,_0x5724bc,_0x2a5f05){return new BPromise(function(_0xcf77c5,_0x458009){return client[_0x5e93('0xa')](_0x4f89c8,_0x2a5f05)[_0x5e93('0xb')](function(_0x651659){logger[_0x5e93('0xc')](_0x5e93('0xd'),_0x5724bc,_0x5e93('0xe'));logger['debug'](_0x5e93('0xf'),_0x5724bc,_0x5e93('0xe'),JSON[_0x5e93('0x10')](_0x651659));if(_0x651659[_0x5e93('0x11')]){if(_0x651659[_0x5e93('0x11')][_0x5e93('0x12')]===0x1f4){logger[_0x5e93('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5724bc,_0x651659[_0x5e93('0x11')][_0x5e93('0x13')]);return _0x458009(_0x651659[_0x5e93('0x11')]['message']);}logger[_0x5e93('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5724bc,_0x651659[_0x5e93('0x11')][_0x5e93('0x13')]);return _0xcf77c5(_0x651659[_0x5e93('0x11')][_0x5e93('0x13')]);}else{logger['info'](_0x5e93('0xd'),_0x5724bc,_0x5e93('0xe'));_0xcf77c5(_0x651659[_0x5e93('0x14')][_0x5e93('0x13')]);}})['catch'](function(_0x1d9af4){logger[_0x5e93('0x11')](_0x5e93('0xd'),_0x5724bc,_0x1d9af4);_0x458009(_0x1d9af4);});});}
\ No newline at end of file
index a5c46f7..176d323 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9691=['../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2b497a,_0x33571f){var _0x420d40=function(_0x4f2d27){while(--_0x4f2d27){_0x2b497a['push'](_0x2b497a['shift']());}};_0x420d40(++_0x33571f);}(_0x9691,0xc2));var _0x1969=function(_0x5f3388,_0x32972f){_0x5f3388=_0x5f3388-0x0;var _0x142780=_0x9691[_0x5f3388];return _0x142780;};'use strict';var multer=require(_0x1969('0x0'));var util=require(_0x1969('0x1'));var path=require('path');var timeout=require(_0x1969('0x2'));var express=require(_0x1969('0x3'));var router=express[_0x1969('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1969('0x5'));var interaction=require(_0x1969('0x6'));var config=require(_0x1969('0x7'));var controller=require(_0x1969('0x8'));router[_0x1969('0x9')]('/',auth[_0x1969('0xa')](),controller['index']);router[_0x1969('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1969('0xb')]);router[_0x1969('0xc')]('/',auth['isAuthenticated'](),controller[_0x1969('0xd')]);router[_0x1969('0xe')](_0x1969('0xf'),auth['isAuthenticated'](),controller[_0x1969('0x10')]);router[_0x1969('0x11')](_0x1969('0xf'),auth[_0x1969('0xa')](),controller[_0x1969('0x12')]);module[_0x1969('0x13')]=router;
\ No newline at end of file
+var _0x65dd=['../../components/auth/service','./intServicenowField.controller','isAuthenticated','index','/:id','show','create','put','update','destroy','util','path','connect-timeout','express','Router'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x65dd,0x91));var _0xd65d=function(_0x513a51,_0x16d5ea){_0x513a51=_0x513a51-0x0;var _0x3af33b=_0x65dd[_0x513a51];return _0x3af33b;};'use strict';var multer=require('multer');var util=require(_0xd65d('0x0'));var path=require(_0xd65d('0x1'));var timeout=require(_0xd65d('0x2'));var express=require(_0xd65d('0x3'));var router=express[_0xd65d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd65d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd65d('0x6'));router['get']('/',auth[_0xd65d('0x7')](),controller[_0xd65d('0x8')]);router['get'](_0xd65d('0x9'),auth[_0xd65d('0x7')](),controller[_0xd65d('0xa')]);router['post']('/',auth[_0xd65d('0x7')](),controller[_0xd65d('0xb')]);router[_0xd65d('0xc')]('/:id',auth[_0xd65d('0x7')](),controller[_0xd65d('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd65d('0xe')]);module['exports']=router;
\ No newline at end of file
index 723d7b7..bef8b81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed5c=['STRING','variable','BOOLEAN','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xed5c,0xe4));var _0xced5=function(_0x196e58,_0x373107){_0x196e58=_0x196e58-0x0;var _0x19bc0a=_0xed5c[_0x196e58];return _0x19bc0a;};'use strict';var Sequelize=require('sequelize');module[_0xced5('0x0')]={'type':{'type':Sequelize[_0xced5('0x1')](_0xced5('0x2'),'variable',_0xced5('0x3'),_0xced5('0x4'),_0xced5('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xced5('0x6')]},'key':{'type':Sequelize[_0xced5('0x6')]},'keyType':{'type':Sequelize[_0xced5('0x1')](_0xced5('0x2'),_0xced5('0x7'),_0xced5('0x3'))},'keyContent':{'type':Sequelize[_0xced5('0x6')]},'idField':{'type':Sequelize[_0xced5('0x6')]},'nameField':{'type':Sequelize[_0xced5('0x6')]},'customField':{'type':Sequelize[_0xced5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xced5('0x6')]}};
\ No newline at end of file
+var _0x75aa=['string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x75aa,0x109));var _0xa75a=function(_0x77a4b4,_0xb13e0b){_0x77a4b4=_0x77a4b4-0x0;var _0x265a30=_0x75aa[_0x77a4b4];return _0x265a30;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xa75a('0x0')](_0xa75a('0x1'),_0xa75a('0x2'),_0xa75a('0x3'),_0xa75a('0x4'),_0xa75a('0x5')),'defaultValue':_0xa75a('0x1')},'content':{'type':Sequelize[_0xa75a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa75a('0x0')](_0xa75a('0x1'),_0xa75a('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xa75a('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa75a('0x6')]}};
\ No newline at end of file
index 3f291a0..d00ccd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97dd=['index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','save','update','then','end','sendStatus','error','stack','name'];(function(_0xa2bf09,_0x1df044){var _0x857ff9=function(_0x136253){while(--_0x136253){_0xa2bf09['push'](_0xa2bf09['shift']());}};_0x857ff9(++_0x1df044);}(_0x97dd,0x140));var _0xd97d=function(_0x5e6104,_0x58e9a0){_0x5e6104=_0x5e6104-0x0;var _0x4d8e26=_0x97dd[_0x5e6104];return _0x4d8e26;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd97d('0x0'));var zipdir=require(_0xd97d('0x1'));var jsonpatch=require(_0xd97d('0x2'));var rp=require(_0xd97d('0x3'));var moment=require(_0xd97d('0x4'));var BPromise=require(_0xd97d('0x5'));var Mustache=require('mustache');var util=require(_0xd97d('0x6'));var path=require(_0xd97d('0x7'));var sox=require(_0xd97d('0x8'));var csv=require('to-csv');var ejs=require(_0xd97d('0x9'));var fs=require('fs');var fs_extra=require(_0xd97d('0xa'));var _=require(_0xd97d('0xb'));var squel=require(_0xd97d('0xc'));var crypto=require(_0xd97d('0xd'));var jsforce=require(_0xd97d('0xe'));var deskjs=require(_0xd97d('0xf'));var toCsv=require(_0xd97d('0x10'));var querystring=require(_0xd97d('0x11'));var Papa=require(_0xd97d('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd97d('0x13'));var as=require(_0xd97d('0x14'));var hardwareService=require(_0xd97d('0x15'));var logger=require(_0xd97d('0x16'))(_0xd97d('0x17'));var utils=require('../../config/utils');var config=require(_0xd97d('0x18'));var licenseUtil=require(_0xd97d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32dbe9,_0xa94c5c){_0xa94c5c=_0xa94c5c||0xcc;return function(_0x41adc9){if(_0x41adc9){return _0x32dbe9['sendStatus'](_0xa94c5c);}return _0x32dbe9[_0xd97d('0x1a')](_0xa94c5c)['end']();};}function respondWithResult(_0x3aeada,_0x3d8b78){_0x3d8b78=_0x3d8b78||0xc8;return function(_0x19ad33){if(_0x19ad33){return _0x3aeada['status'](_0x3d8b78)[_0xd97d('0x1b')](_0x19ad33);}};}function respondWithFilteredResult(_0x4bbc53,_0x47b704){return function(_0x546201){if(_0x546201){var _0x29716d=typeof _0x47b704[_0xd97d('0x1c')]===_0xd97d('0x1d')&&typeof _0x47b704[_0xd97d('0x1e')]===_0xd97d('0x1d');var _0x142ed4=_0x546201['count'];var _0x176267=_0x29716d?0x0:_0x47b704[_0xd97d('0x1c')];var _0x343a23=_0x29716d?_0x546201[_0xd97d('0x1f')]:_0x47b704[_0xd97d('0x1c')]+_0x47b704[_0xd97d('0x1e')];var _0x5d7dac;if(_0x343a23>=_0x142ed4){_0x343a23=_0x142ed4;_0x5d7dac=0xc8;}else{_0x5d7dac=0xce;}_0x4bbc53[_0xd97d('0x1a')](_0x5d7dac);return _0x4bbc53['set']('Content-Range',_0x176267+'-'+_0x343a23+'/'+_0x142ed4)[_0xd97d('0x1b')](_0x546201);}return null;};}function patchUpdates(_0x2cc380){return function(_0x331756){try{jsonpatch['apply'](_0x331756,_0x2cc380,!![]);}catch(_0xe03be8){return BPromise['reject'](_0xe03be8);}return _0x331756[_0xd97d('0x20')]();};}function saveUpdates(_0x24e5f3,_0x2bf579){return function(_0x2a0719){if(_0x2a0719){return _0x2a0719[_0xd97d('0x21')](_0x24e5f3)[_0xd97d('0x22')](function(_0x573056){return _0x573056;});}return null;};}function removeEntity(_0x14d068,_0xa991cf){return function(_0x304c67){if(_0x304c67){return _0x304c67['destroy']()[_0xd97d('0x22')](function(){_0x14d068[_0xd97d('0x1a')](0xcc)[_0xd97d('0x23')]();});}};}function handleEntityNotFound(_0x50b497,_0x2053b8){return function(_0x6e01a5){if(!_0x6e01a5){_0x50b497[_0xd97d('0x24')](0x194);}return _0x6e01a5;};}function handleError(_0x4b6645,_0x1ffce0){_0x1ffce0=_0x1ffce0||0x1f4;return function(_0x42b3f8){logger[_0xd97d('0x25')](_0x42b3f8[_0xd97d('0x26')]);if(_0x42b3f8['name']){delete _0x42b3f8[_0xd97d('0x27')];}_0x4b6645[_0xd97d('0x1a')](_0x1ffce0)['send'](_0x42b3f8);};}exports[_0xd97d('0x28')]=function(_0x5a6728,_0x53ed8f){var _0x328a8e={},_0x247f53={},_0x54ad3f={'count':0x0,'rows':[]};var _0x303468=_[_0xd97d('0x29')](db[_0xd97d('0x2a')][_0xd97d('0x2b')],function(_0x3531bc){return{'name':_0x3531bc[_0xd97d('0x2c')],'type':_0x3531bc[_0xd97d('0x2d')][_0xd97d('0x2e')]};});_0x247f53[_0xd97d('0x2f')]=_[_0xd97d('0x29')](_0x303468,_0xd97d('0x27'));_0x247f53[_0xd97d('0x30')]=_[_0xd97d('0x31')](_0x5a6728['query']);_0x247f53[_0xd97d('0x32')]=_[_0xd97d('0x33')](_0x247f53[_0xd97d('0x2f')],_0x247f53[_0xd97d('0x30')]);_0x328a8e[_0xd97d('0x34')]=_[_0xd97d('0x33')](_0x247f53[_0xd97d('0x2f')],qs['fields'](_0x5a6728[_0xd97d('0x30')][_0xd97d('0x35')]));_0x328a8e[_0xd97d('0x34')]=_0x328a8e['attributes'][_0xd97d('0x36')]?_0x328a8e[_0xd97d('0x34')]:_0x247f53[_0xd97d('0x2f')];if(!_0x5a6728[_0xd97d('0x30')]['hasOwnProperty'](_0xd97d('0x37'))){_0x328a8e[_0xd97d('0x1e')]=qs[_0xd97d('0x1e')](_0x5a6728[_0xd97d('0x30')]['limit']);_0x328a8e[_0xd97d('0x1c')]=qs['offset'](_0x5a6728['query'][_0xd97d('0x1c')]);}_0x328a8e['order']=qs[_0xd97d('0x38')](_0x5a6728[_0xd97d('0x30')][_0xd97d('0x38')]);_0x328a8e[_0xd97d('0x39')]=qs[_0xd97d('0x32')](_[_0xd97d('0x3a')](_0x5a6728[_0xd97d('0x30')],_0x247f53[_0xd97d('0x32')]),_0x303468);if(_0x5a6728[_0xd97d('0x30')]['filter']){_0x328a8e['where']=_[_0xd97d('0x3b')](_0x328a8e[_0xd97d('0x39')],{'$or':_[_0xd97d('0x29')](_0x303468,function(_0x5b205b){if(_0x5b205b[_0xd97d('0x2d')]!==_0xd97d('0x3c')){var _0x11b670={};_0x11b670[_0x5b205b['name']]={'$like':'%'+_0x5a6728[_0xd97d('0x30')][_0xd97d('0x3d')]+'%'};return _0x11b670;}})});}_0x328a8e=_[_0xd97d('0x3b')]({},_0x328a8e,_0x5a6728[_0xd97d('0x3e')]);var _0x38599a={'where':_0x328a8e[_0xd97d('0x39')]};return db['ServicenowField'][_0xd97d('0x1f')](_0x38599a)[_0xd97d('0x22')](function(_0x3e48f9){_0x54ad3f[_0xd97d('0x1f')]=_0x3e48f9;if(_0x5a6728[_0xd97d('0x30')][_0xd97d('0x3f')]){_0x328a8e[_0xd97d('0x40')]=[{'all':!![]}];}return db[_0xd97d('0x2a')]['findAll'](_0x328a8e);})[_0xd97d('0x22')](function(_0x16cc56){_0x54ad3f[_0xd97d('0x41')]=_0x16cc56;return _0x54ad3f;})[_0xd97d('0x22')](respondWithFilteredResult(_0x53ed8f,_0x328a8e))['catch'](handleError(_0x53ed8f,null));};exports[_0xd97d('0x42')]=function(_0x1cc870,_0x17f11c){var _0x170181={'raw':!![],'where':{'id':_0x1cc870['params']['id']}},_0x2ceb97={};_0x2ceb97[_0xd97d('0x2f')]=_['keys'](db[_0xd97d('0x2a')][_0xd97d('0x2b')]);_0x2ceb97[_0xd97d('0x30')]=_[_0xd97d('0x31')](_0x1cc870[_0xd97d('0x30')]);_0x2ceb97[_0xd97d('0x32')]=_[_0xd97d('0x33')](_0x2ceb97['model'],_0x2ceb97[_0xd97d('0x30')]);_0x170181[_0xd97d('0x34')]=_[_0xd97d('0x33')](_0x2ceb97[_0xd97d('0x2f')],qs[_0xd97d('0x35')](_0x1cc870[_0xd97d('0x30')]['fields']));_0x170181[_0xd97d('0x34')]=_0x170181[_0xd97d('0x34')][_0xd97d('0x36')]?_0x170181[_0xd97d('0x34')]:_0x2ceb97[_0xd97d('0x2f')];if(_0x1cc870[_0xd97d('0x30')][_0xd97d('0x3f')]){_0x170181['include']=[{'all':!![]}];}_0x170181=_[_0xd97d('0x3b')]({},_0x170181,_0x1cc870['options']);return db[_0xd97d('0x2a')][_0xd97d('0x43')](_0x170181)[_0xd97d('0x22')](handleEntityNotFound(_0x17f11c,null))[_0xd97d('0x22')](respondWithResult(_0x17f11c,null))[_0xd97d('0x44')](handleError(_0x17f11c,null));};exports[_0xd97d('0x45')]=function(_0x1b2629,_0x39546e){return db[_0xd97d('0x2a')][_0xd97d('0x45')](_0x1b2629[_0xd97d('0x46')],{})[_0xd97d('0x22')](respondWithResult(_0x39546e,0xc9))[_0xd97d('0x44')](handleError(_0x39546e,null));};exports[_0xd97d('0x21')]=function(_0x178d92,_0x4643a3){if(_0x178d92[_0xd97d('0x46')]['id']){delete _0x178d92[_0xd97d('0x46')]['id'];}return db[_0xd97d('0x2a')][_0xd97d('0x43')]({'where':{'id':_0x178d92[_0xd97d('0x47')]['id']}})[_0xd97d('0x22')](handleEntityNotFound(_0x4643a3,null))[_0xd97d('0x22')](saveUpdates(_0x178d92['body'],null))[_0xd97d('0x22')](respondWithResult(_0x4643a3,null))[_0xd97d('0x44')](handleError(_0x4643a3,null));};exports['destroy']=function(_0x2ecf67,_0x2efb0b){return db[_0xd97d('0x2a')][_0xd97d('0x43')]({'where':{'id':_0x2ecf67[_0xd97d('0x47')]['id']}})[_0xd97d('0x22')](handleEntityNotFound(_0x2efb0b,null))[_0xd97d('0x22')](removeEntity(_0x2efb0b,null))[_0xd97d('0x44')](handleError(_0x2efb0b,null));};
\ No newline at end of file
+var _0xfc4d=['pick','filter','merge','options','include','findAll','catch','show','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','then','error','stack','send','index','map','ServicenowField','rawAttributes','fieldName','type','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x24b852,_0x2bad67){var _0x180ad2=function(_0x454562){while(--_0x454562){_0x24b852['push'](_0x24b852['shift']());}};_0x180ad2(++_0x2bad67);}(_0xfc4d,0x119));var _0xdfc4=function(_0x5e75ef,_0x4ce765){_0x5e75ef=_0x5e75ef-0x0;var _0x3c28b2=_0xfc4d[_0x5e75ef];return _0x3c28b2;};'use strict';var emlformat=require(_0xdfc4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdfc4('0x1'));var jsonpatch=require(_0xdfc4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdfc4('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdfc4('0x4'));var sox=require('sox');var csv=require(_0xdfc4('0x5'));var ejs=require(_0xdfc4('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdfc4('0x7'));var squel=require(_0xdfc4('0x8'));var crypto=require(_0xdfc4('0x9'));var jsforce=require(_0xdfc4('0xa'));var deskjs=require(_0xdfc4('0xb'));var toCsv=require(_0xdfc4('0x5'));var querystring=require(_0xdfc4('0xc'));var Papa=require(_0xdfc4('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdfc4('0xe'));var logger=require(_0xdfc4('0xf'))(_0xdfc4('0x10'));var utils=require(_0xdfc4('0x11'));var config=require(_0xdfc4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xdfc4('0x13'))['db'];function respondWithStatusCode(_0x2eaaac,_0x4923b9){_0x4923b9=_0x4923b9||0xcc;return function(_0x2a83c5){if(_0x2a83c5){return _0x2eaaac[_0xdfc4('0x14')](_0x4923b9);}return _0x2eaaac[_0xdfc4('0x15')](_0x4923b9)[_0xdfc4('0x16')]();};}function respondWithResult(_0x2774cc,_0x3c2087){_0x3c2087=_0x3c2087||0xc8;return function(_0x1ff5ca){if(_0x1ff5ca){return _0x2774cc[_0xdfc4('0x15')](_0x3c2087)[_0xdfc4('0x17')](_0x1ff5ca);}};}function respondWithFilteredResult(_0x55adae,_0x3dd9fb){return function(_0x153a90){if(_0x153a90){var _0x583838=typeof _0x3dd9fb[_0xdfc4('0x18')]===_0xdfc4('0x19')&&typeof _0x3dd9fb[_0xdfc4('0x1a')]===_0xdfc4('0x19');var _0x3aaf85=_0x153a90['count'];var _0x25dd73=_0x583838?0x0:_0x3dd9fb[_0xdfc4('0x18')];var _0x171f44=_0x583838?_0x153a90[_0xdfc4('0x1b')]:_0x3dd9fb[_0xdfc4('0x18')]+_0x3dd9fb['limit'];var _0x351e13;if(_0x171f44>=_0x3aaf85){_0x171f44=_0x3aaf85;_0x351e13=0xc8;}else{_0x351e13=0xce;}_0x55adae[_0xdfc4('0x15')](_0x351e13);return _0x55adae['set'](_0xdfc4('0x1c'),_0x25dd73+'-'+_0x171f44+'/'+_0x3aaf85)['json'](_0x153a90);}return null;};}function patchUpdates(_0x593a86){return function(_0xc173d6){try{jsonpatch['apply'](_0xc173d6,_0x593a86,!![]);}catch(_0x5e8acd){return BPromise['reject'](_0x5e8acd);}return _0xc173d6[_0xdfc4('0x1d')]();};}function saveUpdates(_0x4c9e4b,_0x1b98e9){return function(_0x2a0de0){if(_0x2a0de0){return _0x2a0de0['update'](_0x4c9e4b)[_0xdfc4('0x1e')](function(_0x426c5b){return _0x426c5b;});}return null;};}function removeEntity(_0x5c6754,_0x259685){return function(_0x2f11c7){if(_0x2f11c7){return _0x2f11c7['destroy']()[_0xdfc4('0x1e')](function(){_0x5c6754[_0xdfc4('0x15')](0xcc)[_0xdfc4('0x16')]();});}};}function handleEntityNotFound(_0x492ae6,_0x99697e){return function(_0x415af9){if(!_0x415af9){_0x492ae6['sendStatus'](0x194);}return _0x415af9;};}function handleError(_0xb51743,_0x259a64){_0x259a64=_0x259a64||0x1f4;return function(_0x5332c2){logger[_0xdfc4('0x1f')](_0x5332c2[_0xdfc4('0x20')]);if(_0x5332c2['name']){delete _0x5332c2['name'];}_0xb51743[_0xdfc4('0x15')](_0x259a64)[_0xdfc4('0x21')](_0x5332c2);};}exports[_0xdfc4('0x22')]=function(_0x1b06eb,_0x25ce0e){var _0x4adfaf={},_0x16aa89={},_0x5036e5={'count':0x0,'rows':[]};var _0x51f962=_[_0xdfc4('0x23')](db[_0xdfc4('0x24')][_0xdfc4('0x25')],function(_0x4a5cec){return{'name':_0x4a5cec[_0xdfc4('0x26')],'type':_0x4a5cec[_0xdfc4('0x27')]['key']};});_0x16aa89[_0xdfc4('0x28')]=_[_0xdfc4('0x23')](_0x51f962,_0xdfc4('0x29'));_0x16aa89[_0xdfc4('0x2a')]=_[_0xdfc4('0x2b')](_0x1b06eb[_0xdfc4('0x2a')]);_0x16aa89['filters']=_[_0xdfc4('0x2c')](_0x16aa89[_0xdfc4('0x28')],_0x16aa89['query']);_0x4adfaf['attributes']=_['intersection'](_0x16aa89[_0xdfc4('0x28')],qs[_0xdfc4('0x2d')](_0x1b06eb[_0xdfc4('0x2a')]['fields']));_0x4adfaf[_0xdfc4('0x2e')]=_0x4adfaf[_0xdfc4('0x2e')][_0xdfc4('0x2f')]?_0x4adfaf[_0xdfc4('0x2e')]:_0x16aa89[_0xdfc4('0x28')];if(!_0x1b06eb[_0xdfc4('0x2a')][_0xdfc4('0x30')](_0xdfc4('0x31'))){_0x4adfaf[_0xdfc4('0x1a')]=qs[_0xdfc4('0x1a')](_0x1b06eb[_0xdfc4('0x2a')][_0xdfc4('0x1a')]);_0x4adfaf[_0xdfc4('0x18')]=qs['offset'](_0x1b06eb[_0xdfc4('0x2a')][_0xdfc4('0x18')]);}_0x4adfaf[_0xdfc4('0x32')]=qs[_0xdfc4('0x33')](_0x1b06eb[_0xdfc4('0x2a')][_0xdfc4('0x33')]);_0x4adfaf[_0xdfc4('0x34')]=qs[_0xdfc4('0x35')](_[_0xdfc4('0x36')](_0x1b06eb['query'],_0x16aa89[_0xdfc4('0x35')]),_0x51f962);if(_0x1b06eb['query'][_0xdfc4('0x37')]){_0x4adfaf['where']=_[_0xdfc4('0x38')](_0x4adfaf[_0xdfc4('0x34')],{'$or':_[_0xdfc4('0x23')](_0x51f962,function(_0x1f1f2d){if(_0x1f1f2d[_0xdfc4('0x27')]!=='VIRTUAL'){var _0x193255={};_0x193255[_0x1f1f2d[_0xdfc4('0x29')]]={'$like':'%'+_0x1b06eb[_0xdfc4('0x2a')][_0xdfc4('0x37')]+'%'};return _0x193255;}})});}_0x4adfaf=_['merge']({},_0x4adfaf,_0x1b06eb[_0xdfc4('0x39')]);var _0x3139f9={'where':_0x4adfaf['where']};return db[_0xdfc4('0x24')][_0xdfc4('0x1b')](_0x3139f9)['then'](function(_0x12c74c){_0x5036e5[_0xdfc4('0x1b')]=_0x12c74c;if(_0x1b06eb[_0xdfc4('0x2a')]['includeAll']){_0x4adfaf[_0xdfc4('0x3a')]=[{'all':!![]}];}return db[_0xdfc4('0x24')][_0xdfc4('0x3b')](_0x4adfaf);})[_0xdfc4('0x1e')](function(_0x14831c){_0x5036e5['rows']=_0x14831c;return _0x5036e5;})[_0xdfc4('0x1e')](respondWithFilteredResult(_0x25ce0e,_0x4adfaf))[_0xdfc4('0x3c')](handleError(_0x25ce0e,null));};exports[_0xdfc4('0x3d')]=function(_0x507f99,_0x4c1907){var _0x55ee97={'raw':!![],'where':{'id':_0x507f99[_0xdfc4('0x3e')]['id']}},_0xb7dc32={};_0xb7dc32[_0xdfc4('0x28')]=_[_0xdfc4('0x2b')](db[_0xdfc4('0x24')][_0xdfc4('0x25')]);_0xb7dc32[_0xdfc4('0x2a')]=_['keys'](_0x507f99['query']);_0xb7dc32['filters']=_['intersection'](_0xb7dc32[_0xdfc4('0x28')],_0xb7dc32[_0xdfc4('0x2a')]);_0x55ee97[_0xdfc4('0x2e')]=_[_0xdfc4('0x2c')](_0xb7dc32[_0xdfc4('0x28')],qs[_0xdfc4('0x2d')](_0x507f99['query'][_0xdfc4('0x2d')]));_0x55ee97[_0xdfc4('0x2e')]=_0x55ee97[_0xdfc4('0x2e')]['length']?_0x55ee97[_0xdfc4('0x2e')]:_0xb7dc32[_0xdfc4('0x28')];if(_0x507f99['query']['includeAll']){_0x55ee97['include']=[{'all':!![]}];}_0x55ee97=_[_0xdfc4('0x38')]({},_0x55ee97,_0x507f99['options']);return db[_0xdfc4('0x24')][_0xdfc4('0x3f')](_0x55ee97)[_0xdfc4('0x1e')](handleEntityNotFound(_0x4c1907,null))[_0xdfc4('0x1e')](respondWithResult(_0x4c1907,null))['catch'](handleError(_0x4c1907,null));};exports[_0xdfc4('0x40')]=function(_0x290525,_0x5db136){return db['ServicenowField'][_0xdfc4('0x40')](_0x290525[_0xdfc4('0x41')],{})[_0xdfc4('0x1e')](respondWithResult(_0x5db136,0xc9))[_0xdfc4('0x3c')](handleError(_0x5db136,null));};exports[_0xdfc4('0x42')]=function(_0x389287,_0x28773f){if(_0x389287[_0xdfc4('0x41')]['id']){delete _0x389287[_0xdfc4('0x41')]['id'];}return db[_0xdfc4('0x24')][_0xdfc4('0x3f')]({'where':{'id':_0x389287[_0xdfc4('0x3e')]['id']}})[_0xdfc4('0x1e')](handleEntityNotFound(_0x28773f,null))[_0xdfc4('0x1e')](saveUpdates(_0x389287['body'],null))[_0xdfc4('0x1e')](respondWithResult(_0x28773f,null))[_0xdfc4('0x3c')](handleError(_0x28773f,null));};exports['destroy']=function(_0x464e2d,_0x2ff18d){return db[_0xdfc4('0x24')][_0xdfc4('0x3f')]({'where':{'id':_0x464e2d[_0xdfc4('0x3e')]['id']}})[_0xdfc4('0x1e')](handleEntityNotFound(_0x2ff18d,null))['then'](removeEntity(_0x2ff18d,null))[_0xdfc4('0x3c')](handleError(_0x2ff18d,null));};
\ No newline at end of file
index 299b63e..0664c55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeec8=['../../config/logger','moment','bluebird','rimraf','../../config/environment','exports','define','ServicenowField','servicenow_unique_index','FieldId','lodash','util'];(function(_0x2595a6,_0x48fc45){var _0x460197=function(_0x18f9db){while(--_0x18f9db){_0x2595a6['push'](_0x2595a6['shift']());}};_0x460197(++_0x48fc45);}(_0xeec8,0x1ba));var _0x8eec=function(_0x4ec643,_0x11ef45){_0x4ec643=_0x4ec643-0x0;var _0x33773a=_0xeec8[_0x4ec643];return _0x33773a;};'use strict';var _=require(_0x8eec('0x0'));var util=require(_0x8eec('0x1'));var logger=require(_0x8eec('0x2'))('api');var moment=require(_0x8eec('0x3'));var BPromise=require(_0x8eec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8eec('0x5'));var config=require(_0x8eec('0x6'));var attributes=require('./intServicenowField.attributes');module[_0x8eec('0x7')]=function(_0xbc9386,_0x139100){return _0xbc9386[_0x8eec('0x8')](_0x8eec('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x8eec('0xa'),'fields':['idField',_0x8eec('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0477=['api','moment','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','exports','ServicenowField','servicenow_unique_index','idField','lodash','util'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x0477,0x1c5));var _0x7047=function(_0x41cc3f,_0x2678a2){_0x41cc3f=_0x41cc3f-0x0;var _0x47ff58=_0x0477[_0x41cc3f];return _0x47ff58;};'use strict';var _=require(_0x7047('0x0'));var util=require(_0x7047('0x1'));var logger=require('../../config/logger')(_0x7047('0x2'));var moment=require(_0x7047('0x3'));var BPromise=require(_0x7047('0x4'));var rp=require(_0x7047('0x5'));var fs=require('fs');var path=require(_0x7047('0x6'));var rimraf=require(_0x7047('0x7'));var config=require('../../config/environment');var attributes=require(_0x7047('0x8'));module[_0x7047('0x9')]=function(_0x1da8dd,_0x2d48f7){return _0x1da8dd['define'](_0x7047('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x7047('0xb'),'fields':[_0x7047('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 5dea9f6..0696458 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1c2e2b,_0x4bbac7){var _0x364b22=function(_0x147587){while(--_0x147587){_0x1c2e2b['push'](_0x1c2e2b['shift']());}};_0x364b22(++_0x4bbac7);}(_0xb43b,0x1b2));var _0xbb43=function(_0x23b336,_0x1b205d){_0x23b336=_0x23b336-0x0;var _0x53a430=_0xb43b[_0x23b336];return _0x53a430;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}
\ No newline at end of file
+var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1c5463,_0x26a1a2){var _0x3fc93e=function(_0x5c08d7){while(--_0x5c08d7){_0x1c5463['push'](_0x1c5463['shift']());}};_0x3fc93e(++_0x26a1a2);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4400b0,_0x5d22de){_0x4400b0=_0x4400b0-0x0;var _0x588520=_0xb43b[_0x4400b0];return _0x588520;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}
\ No newline at end of file
index 0f7e32d..6262ae8 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(_0x1ae510,_0x315043){var _0x41b5f6=function(_0x4fb123){while(--_0x4fb123){_0x1ae510['push'](_0x1ae510['shift']());}};_0x41b5f6(++_0x315043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0xc7506c,_0xbf9d28){var _0x345b62=function(_0x195ffa){while(--_0x195ffa){_0xc7506c['push'](_0xc7506c['shift']());}};_0x345b62(++_0xbf9d28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 ec6c1bc..be54c5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x4bbe32,_0x3d80e2){var _0x16999a=function(_0x260e2b){while(--_0x260e2b){_0x4bbe32['push'](_0x4bbe32['shift']());}};_0x16999a(++_0x3d80e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x11b845,_0x428a1a){var _0x2a85d0=function(_0x484aa9){while(--_0x484aa9){_0x11b845['push'](_0x11b845['shift']());}};_0x2a85d0(++_0x428a1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 f37ada6..929b2ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a8e=['getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','SugarcrmAccount','findAll','show','params','catch','create','body','find','destroy','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','%s%s','login','JSON','stringify','PLAIN','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','values','module_fields','remove','includes','label','endsWith','test','statusCode','error'];(function(_0x582656,_0x2181df){var _0x1bf0e9=function(_0x482141){while(--_0x482141){_0x582656['push'](_0x582656['shift']());}};_0x1bf0e9(++_0x2181df);}(_0x1a8e,0xf4));var _0xe1a8=function(_0x46c75c,_0x5ee3ec){_0x46c75c=_0x46c75c-0x0;var _0x48e1d2=_0x1a8e[_0x46c75c];return _0x48e1d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe1a8('0x0'));var zipdir=require(_0xe1a8('0x1'));var jsonpatch=require(_0xe1a8('0x2'));var rp=require('request-promise');var moment=require(_0xe1a8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe1a8('0x4'));var util=require(_0xe1a8('0x5'));var path=require('path');var sox=require(_0xe1a8('0x6'));var csv=require(_0xe1a8('0x7'));var ejs=require(_0xe1a8('0x8'));var fs=require('fs');var fs_extra=require(_0xe1a8('0x9'));var _=require('lodash');var squel=require(_0xe1a8('0xa'));var crypto=require('crypto');var jsforce=require(_0xe1a8('0xb'));var deskjs=require(_0xe1a8('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe1a8('0xd'));var Papa=require(_0xe1a8('0xe'));var Redis=require(_0xe1a8('0xf'));var authService=require(_0xe1a8('0x10'));var qs=require(_0xe1a8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe1a8('0x12'));var logger=require(_0xe1a8('0x13'))(_0xe1a8('0x14'));var utils=require(_0xe1a8('0x15'));var config=require(_0xe1a8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe1a8('0x17'))['db'];var integrations=require(_0xe1a8('0x18'));function respondWithStatusCode(_0x41b587,_0xea2313){_0xea2313=_0xea2313||0xcc;return function(_0xa44c7b){if(_0xa44c7b){return _0x41b587[_0xe1a8('0x19')](_0xea2313);}return _0x41b587['status'](_0xea2313)[_0xe1a8('0x1a')]();};}function respondWithResult(_0x3fcd3b,_0x2eceeb){_0x2eceeb=_0x2eceeb||0xc8;return function(_0x3ec4c4){if(_0x3ec4c4){return _0x3fcd3b[_0xe1a8('0x1b')](_0x2eceeb)[_0xe1a8('0x1c')](_0x3ec4c4);}};}function respondWithFilteredResult(_0x2dd76d,_0x3d66e6){return function(_0x23c8a8){if(_0x23c8a8){var _0x4f52ec=typeof _0x3d66e6['offset']===_0xe1a8('0x1d')&&typeof _0x3d66e6['limit']===_0xe1a8('0x1d');var _0x21fdf8=_0x23c8a8[_0xe1a8('0x1e')];var _0x2269e7=_0x4f52ec?0x0:_0x3d66e6[_0xe1a8('0x1f')];var _0x29c01b=_0x4f52ec?_0x23c8a8[_0xe1a8('0x1e')]:_0x3d66e6[_0xe1a8('0x1f')]+_0x3d66e6[_0xe1a8('0x20')];var _0x37acfb;if(_0x29c01b>=_0x21fdf8){_0x29c01b=_0x21fdf8;_0x37acfb=0xc8;}else{_0x37acfb=0xce;}_0x2dd76d['status'](_0x37acfb);return _0x2dd76d[_0xe1a8('0x21')](_0xe1a8('0x22'),_0x2269e7+'-'+_0x29c01b+'/'+_0x21fdf8)[_0xe1a8('0x1c')](_0x23c8a8);}return null;};}function patchUpdates(_0x49b19f){return function(_0x2f1280){try{jsonpatch[_0xe1a8('0x23')](_0x2f1280,_0x49b19f,!![]);}catch(_0x569b0e){return BPromise['reject'](_0x569b0e);}return _0x2f1280['save']();};}function saveUpdates(_0x338b95,_0x452e0e){return function(_0x50a04f){if(_0x50a04f){return _0x50a04f[_0xe1a8('0x24')](_0x338b95)[_0xe1a8('0x25')](function(_0x1e6995){return _0x1e6995;});}return null;};}function removeEntity(_0x2ba6a8,_0x1c3707){return function(_0x31c762){if(_0x31c762){return _0x31c762['destroy']()[_0xe1a8('0x25')](function(){_0x2ba6a8[_0xe1a8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x360b78,_0x52a4ec){return function(_0xe596a5){if(!_0xe596a5){_0x360b78[_0xe1a8('0x19')](0x194);}return _0xe596a5;};}function handleError(_0x3a73dd,_0x4d3f10){_0x4d3f10=_0x4d3f10||0x1f4;return function(_0x1d04b9){logger['error'](_0x1d04b9[_0xe1a8('0x26')]);if(_0x1d04b9[_0xe1a8('0x27')]){delete _0x1d04b9[_0xe1a8('0x27')];}_0x3a73dd['status'](_0x4d3f10)[_0xe1a8('0x28')](_0x1d04b9);};}exports[_0xe1a8('0x29')]=function(_0x446e16,_0x18d727){var _0x3cec7a={},_0xa2c5b4={},_0x25d4c4={'count':0x0,'rows':[]};var _0x164854=_[_0xe1a8('0x2a')](db['SugarcrmAccount'][_0xe1a8('0x2b')],function(_0x6640d3){return{'name':_0x6640d3['fieldName'],'type':_0x6640d3[_0xe1a8('0x2c')][_0xe1a8('0x2d')]};});_0xa2c5b4['model']=_[_0xe1a8('0x2a')](_0x164854,'name');_0xa2c5b4[_0xe1a8('0x2e')]=_[_0xe1a8('0x2f')](_0x446e16[_0xe1a8('0x2e')]);_0xa2c5b4[_0xe1a8('0x30')]=_[_0xe1a8('0x31')](_0xa2c5b4[_0xe1a8('0x32')],_0xa2c5b4[_0xe1a8('0x2e')]);_0x3cec7a['attributes']=_[_0xe1a8('0x31')](_0xa2c5b4['model'],qs[_0xe1a8('0x33')](_0x446e16['query']['fields']));_0x3cec7a[_0xe1a8('0x34')]=_0x3cec7a[_0xe1a8('0x34')][_0xe1a8('0x35')]?_0x3cec7a[_0xe1a8('0x34')]:_0xa2c5b4[_0xe1a8('0x32')];if(!_0x446e16[_0xe1a8('0x2e')][_0xe1a8('0x36')](_0xe1a8('0x37'))){_0x3cec7a[_0xe1a8('0x20')]=qs[_0xe1a8('0x20')](_0x446e16['query']['limit']);_0x3cec7a[_0xe1a8('0x1f')]=qs[_0xe1a8('0x1f')](_0x446e16[_0xe1a8('0x2e')][_0xe1a8('0x1f')]);}_0x3cec7a[_0xe1a8('0x38')]=qs[_0xe1a8('0x39')](_0x446e16[_0xe1a8('0x2e')][_0xe1a8('0x39')]);_0x3cec7a['where']=qs[_0xe1a8('0x30')](_[_0xe1a8('0x3a')](_0x446e16[_0xe1a8('0x2e')],_0xa2c5b4[_0xe1a8('0x30')]),_0x164854);if(_0x446e16[_0xe1a8('0x2e')][_0xe1a8('0x3b')]){_0x3cec7a[_0xe1a8('0x3c')]=_[_0xe1a8('0x3d')](_0x3cec7a[_0xe1a8('0x3c')],{'$or':_[_0xe1a8('0x2a')](_0x164854,function(_0xd33841){if(_0xd33841[_0xe1a8('0x2c')]!==_0xe1a8('0x3e')){var _0x5c4d12={};_0x5c4d12[_0xd33841['name']]={'$like':'%'+_0x446e16['query'][_0xe1a8('0x3b')]+'%'};return _0x5c4d12;}})});}_0x3cec7a=_[_0xe1a8('0x3d')]({},_0x3cec7a,_0x446e16[_0xe1a8('0x3f')]);var _0x59f58f={'where':_0x3cec7a[_0xe1a8('0x3c')]};return db['SugarcrmAccount'][_0xe1a8('0x1e')](_0x59f58f)[_0xe1a8('0x25')](function(_0xeb5cf6){_0x25d4c4[_0xe1a8('0x1e')]=_0xeb5cf6;if(_0x446e16[_0xe1a8('0x2e')][_0xe1a8('0x40')]){_0x3cec7a[_0xe1a8('0x41')]=[{'all':!![]}];}return db[_0xe1a8('0x42')][_0xe1a8('0x43')](_0x3cec7a);})[_0xe1a8('0x25')](function(_0x3ac0aa){_0x25d4c4['rows']=_0x3ac0aa;return _0x25d4c4;})['then'](respondWithFilteredResult(_0x18d727,_0x3cec7a))['catch'](handleError(_0x18d727,null));};exports[_0xe1a8('0x44')]=function(_0x33bff1,_0x21367a){var _0x4dae5a={'raw':![],'where':{'id':_0x33bff1[_0xe1a8('0x45')]['id']}},_0x3052f2={};_0x3052f2[_0xe1a8('0x32')]=_[_0xe1a8('0x2f')](db[_0xe1a8('0x42')][_0xe1a8('0x2b')]);_0x3052f2[_0xe1a8('0x2e')]=_[_0xe1a8('0x2f')](_0x33bff1[_0xe1a8('0x2e')]);_0x3052f2[_0xe1a8('0x30')]=_['intersection'](_0x3052f2[_0xe1a8('0x32')],_0x3052f2[_0xe1a8('0x2e')]);_0x4dae5a['attributes']=_['intersection'](_0x3052f2[_0xe1a8('0x32')],qs['fields'](_0x33bff1[_0xe1a8('0x2e')]['fields']));_0x4dae5a['attributes']=_0x4dae5a[_0xe1a8('0x34')][_0xe1a8('0x35')]?_0x4dae5a[_0xe1a8('0x34')]:_0x3052f2['model'];if(_0x33bff1[_0xe1a8('0x2e')][_0xe1a8('0x40')]){_0x4dae5a[_0xe1a8('0x41')]=[{'all':!![]}];}_0x4dae5a=_['merge']({},_0x4dae5a,_0x33bff1[_0xe1a8('0x3f')]);return db[_0xe1a8('0x42')]['find'](_0x4dae5a)[_0xe1a8('0x25')](handleEntityNotFound(_0x21367a,null))[_0xe1a8('0x25')](respondWithResult(_0x21367a,null))[_0xe1a8('0x46')](handleError(_0x21367a,null));};exports[_0xe1a8('0x47')]=function(_0xcbd04c,_0x5f615b){return db[_0xe1a8('0x42')][_0xe1a8('0x47')](_0xcbd04c[_0xe1a8('0x48')],{})[_0xe1a8('0x25')](respondWithResult(_0x5f615b,0xc9))[_0xe1a8('0x46')](handleError(_0x5f615b,null));};exports[_0xe1a8('0x24')]=function(_0xeb5bc7,_0x4014b1){if(_0xeb5bc7[_0xe1a8('0x48')]['id']){delete _0xeb5bc7[_0xe1a8('0x48')]['id'];}return db[_0xe1a8('0x42')][_0xe1a8('0x49')]({'where':{'id':_0xeb5bc7[_0xe1a8('0x45')]['id']}})[_0xe1a8('0x25')](handleEntityNotFound(_0x4014b1,null))['then'](saveUpdates(_0xeb5bc7[_0xe1a8('0x48')],null))[_0xe1a8('0x25')](respondWithResult(_0x4014b1,null))[_0xe1a8('0x46')](handleError(_0x4014b1,null));};exports[_0xe1a8('0x4a')]=function(_0xcdbb7,_0x579a72){return db[_0xe1a8('0x42')][_0xe1a8('0x49')]({'where':{'id':_0xcdbb7[_0xe1a8('0x45')]['id']}})[_0xe1a8('0x25')](handleEntityNotFound(_0x579a72,null))[_0xe1a8('0x25')](removeEntity(_0x579a72,null))[_0xe1a8('0x46')](handleError(_0x579a72,null));};exports['getConfigurations']=function(_0x514a18,_0x24439d,_0x5f3a27){var _0x500abf={};var _0x4b1e78={};var _0x41af84;var _0x4c0dd9;return db['SugarcrmAccount'][_0xe1a8('0x4b')]({'where':{'id':_0x514a18[_0xe1a8('0x45')]['id']}})['then'](handleEntityNotFound(_0x24439d,null))['then'](function(_0x5d77e9){if(_0x5d77e9){_0x41af84=_0x5d77e9;_0x4b1e78[_0xe1a8('0x32')]=_[_0xe1a8('0x2f')](db[_0xe1a8('0x4c')][_0xe1a8('0x2b')]);_0x4b1e78['query']=_[_0xe1a8('0x2f')](_0x514a18[_0xe1a8('0x2e')]);_0x4b1e78[_0xe1a8('0x30')]=_[_0xe1a8('0x31')](_0x4b1e78[_0xe1a8('0x32')],_0x4b1e78['query']);_0x500abf['attributes']=_[_0xe1a8('0x31')](_0x4b1e78[_0xe1a8('0x32')],qs[_0xe1a8('0x33')](_0x514a18[_0xe1a8('0x2e')][_0xe1a8('0x33')]));_0x500abf[_0xe1a8('0x34')]=_0x500abf['attributes'][_0xe1a8('0x35')]?_0x500abf['attributes']:_0x4b1e78[_0xe1a8('0x32')];_0x500abf['order']=qs[_0xe1a8('0x39')](_0x514a18['query'][_0xe1a8('0x39')]);_0x500abf[_0xe1a8('0x3c')]=qs[_0xe1a8('0x30')](_[_0xe1a8('0x3a')](_0x514a18[_0xe1a8('0x2e')],_0x4b1e78['filters']));if(_0x514a18[_0xe1a8('0x2e')][_0xe1a8('0x3b')]){_0x500abf[_0xe1a8('0x3c')]=_[_0xe1a8('0x3d')](_0x500abf[_0xe1a8('0x3c')],{'$or':_[_0xe1a8('0x2a')](_0x500abf[_0xe1a8('0x34')],function(_0x3d61d2){var _0x184a2e={};_0x184a2e[_0x3d61d2]={'$like':'%'+_0x514a18[_0xe1a8('0x2e')]['filter']+'%'};return _0x184a2e;})});}_0x500abf=_[_0xe1a8('0x3d')]({},_0x500abf,_0x514a18['options']);return _0x41af84[_0xe1a8('0x4d')](_0x500abf);}})[_0xe1a8('0x25')](function(_0x3b3e1a){if(_0x3b3e1a){_0x4c0dd9=_0x3b3e1a['length'];if(!_0x514a18[_0xe1a8('0x2e')][_0xe1a8('0x36')](_0xe1a8('0x37'))){_0x500abf[_0xe1a8('0x20')]=qs[_0xe1a8('0x20')](_0x514a18['query'][_0xe1a8('0x20')]);_0x500abf[_0xe1a8('0x1f')]=qs[_0xe1a8('0x1f')](_0x514a18[_0xe1a8('0x2e')]['offset']);}return _0x41af84['getConfigurations'](_0x500abf);}})[_0xe1a8('0x25')](function(_0x57f965){if(_0x57f965){return _0x57f965?{'count':_0x4c0dd9,'rows':_0x57f965}:null;}})[_0xe1a8('0x25')](respondWithResult(_0x24439d,null))[_0xe1a8('0x46')](handleError(_0x24439d,null));};exports[_0xe1a8('0x4e')]=function(_0x18a8f4,_0x2db2de,_0x23dcbb){if(_0x18a8f4['body']['id']){delete _0x18a8f4['body']['id'];}return db[_0xe1a8('0x42')]['findOne']({'where':{'id':_0x18a8f4[_0xe1a8('0x45')]['id']}})['then'](handleEntityNotFound(_0x2db2de,null))['then'](function(_0x1686ac){if(_0x1686ac){_0x18a8f4[_0xe1a8('0x48')][_0xe1a8('0x4f')]=_0x1686ac['id'];_0x18a8f4[_0xe1a8('0x48')][_0xe1a8('0x50')]=integrations[_0xe1a8('0x51')](_0x18a8f4['body'][_0xe1a8('0x52')],_0x18a8f4['body'][_0xe1a8('0x2c')]);_0x18a8f4[_0xe1a8('0x48')]['Descriptions']=integrations[_0xe1a8('0x53')](_0x18a8f4[_0xe1a8('0x48')]['channel'],_0x18a8f4[_0xe1a8('0x48')][_0xe1a8('0x2c')]);return db[_0xe1a8('0x4c')][_0xe1a8('0x47')](_0x18a8f4[_0xe1a8('0x48')],{'include':[{'model':db[_0xe1a8('0x54')],'as':_0xe1a8('0x50')},{'model':db['SugarcrmField'],'as':_0xe1a8('0x55')}]});}return null;})['then'](respondWithResult(_0x2db2de,null))[_0xe1a8('0x46')](handleError(_0x2db2de,null));};exports[_0xe1a8('0x56')]=function(_0x36c541,_0x516e68,_0x12056e){var _0x4d53e1='';var _0x27fb88=['id','name',_0xe1a8('0x57'),_0xe1a8('0x58'),_0xe1a8('0x59'),_0xe1a8('0x5a'),_0xe1a8('0x5b'),_0xe1a8('0x5c'),_0xe1a8('0x5d'),_0xe1a8('0x5e'),_0xe1a8('0x5f'),_0xe1a8('0x60')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x36c541[_0xe1a8('0x45')]['id']},'attributes':['id',_0xe1a8('0x61'),_0xe1a8('0x62'),_0xe1a8('0x63')]})[_0xe1a8('0x25')](handleEntityNotFound(_0x516e68,null))[_0xe1a8('0x25')](function(_0x5b349d){if(_0x5b349d){_0x4d53e1=_0x5b349d[_0xe1a8('0x63')];var _0x12b00d=_0x4d53e1[_0xe1a8('0x64')](-0x1);if(_0x12b00d==='/'){_0x4d53e1=_0x4d53e1['substring'](0x0,_0x4d53e1[_0xe1a8('0x65')](_0x12b00d));}return rp({'method':'POST','uri':util['format'](_0xe1a8('0x66'),_0x4d53e1,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xe1a8('0x67'),'input_type':_0xe1a8('0x68'),'response_type':_0xe1a8('0x68'),'rest_data':JSON[_0xe1a8('0x69')]({'user_auth':{'user_name':_0x5b349d['username'],'password':_0x5b349d[_0xe1a8('0x62')],'encryption':_0xe1a8('0x6a')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xe1a8('0x25')](function(_0x3b2cfd){if(_0x3b2cfd&&_0x3b2cfd[_0xe1a8('0x27')]!=='Invalid\x20Login'&&_0x3b2cfd['name']!==_0xe1a8('0x6b')){return rp({'method':'POST','uri':util['format']('%s%s',_0x4d53e1,_0xe1a8('0x6c')),'json':!![],'form':{'method':_0xe1a8('0x6d'),'input_type':_0xe1a8('0x68'),'response_type':_0xe1a8('0x68'),'rest_data':JSON[_0xe1a8('0x69')]({'session':_0x3b2cfd['id'],'module_name':'Calls'})}})[_0xe1a8('0x25')](function(_0x53f247){if(_0x53f247){var _0x41fd30=_[_0xe1a8('0x6e')](_0x53f247[_0xe1a8('0x6f')]);_[_0xe1a8('0x70')](_0x41fd30,function(_0x38f2ad){return _0x27fb88[_0xe1a8('0x71')](_0x38f2ad['name']);});return{'count':_0x41fd30['length'],'rows':_['map'](_0x41fd30,function(_0x3bce85){return{'id':_0x3bce85[_0xe1a8('0x27')],'name':_0x3bce85[_0xe1a8('0x72')],'custom':_[_0xe1a8('0x73')](_0x3bce85[_0xe1a8('0x27')],'_c')?!![]:![],'options':_0x3bce85['options']?_[_0xe1a8('0x2a')](_['values'](_0x3bce85[_0xe1a8('0x3f')]),function(_0x1a1f69){return{'name':_0x1a1f69['value'],'value':_0x1a1f69['name']};}):[]};})};}})['then'](respondWithResult(_0x516e68,null))['catch'](function(_0x5a8260){var _0x5dce8f=_0x36c541['query'][_0xe1a8('0x74')]?0x1f4:_0x5a8260[_0xe1a8('0x75')]||0x1f4;logger[_0xe1a8('0x76')](_0xe1a8('0x77'),_0xe1a8('0x56'),_0x5dce8f,JSON['stringify'](_0x5a8260));delete _0x5a8260[_0xe1a8('0x27')];if(_0x5dce8f===0x191){_0x5dce8f=0x190;}_0x516e68['status'](_0x5dce8f)['send'](_0x36c541[_0xe1a8('0x2e')][_0xe1a8('0x74')]?{'message':_0xe1a8('0x78'),'statusCode':_0x5a8260['statusCode']}:_0x5a8260);});}else{var _0x478fca=0x1f4;_0x516e68[_0xe1a8('0x1b')](_0x478fca)[_0xe1a8('0x28')]({'message':_0xe1a8('0x78'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0x70ef=['Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','AccountId','channel','Subjects','SugarcrmField','Descriptions','description','duration_hours','duration_minutes','parent_id','parent_type','direction','remoteUri','slice','lastIndexOf','login','JSON','stringify','username','password','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','format','%s%s','/service/v4_1/rest.php','values','module_fields','includes','label','endsWith','options','value','test','Wrong\x20credentials','statusCode','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set'];(function(_0x543661,_0x5de42e){var _0x5aa44f=function(_0x228b05){while(--_0x228b05){_0x543661['push'](_0x543661['shift']());}};_0x5aa44f(++_0x5de42e);}(_0x70ef,0x1b7));var _0xf70e=function(_0x4d97df,_0xc507db){_0x4d97df=_0x4d97df-0x0;var _0x4519cf=_0x70ef[_0x4d97df];return _0x4519cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf70e('0x0'));var jsonpatch=require(_0xf70e('0x1'));var rp=require('request-promise');var moment=require(_0xf70e('0x2'));var BPromise=require(_0xf70e('0x3'));var Mustache=require('mustache');var util=require(_0xf70e('0x4'));var path=require(_0xf70e('0x5'));var sox=require(_0xf70e('0x6'));var csv=require(_0xf70e('0x7'));var ejs=require(_0xf70e('0x8'));var fs=require('fs');var fs_extra=require(_0xf70e('0x9'));var _=require('lodash');var squel=require(_0xf70e('0xa'));var crypto=require('crypto');var jsforce=require(_0xf70e('0xb'));var deskjs=require(_0xf70e('0xc'));var toCsv=require(_0xf70e('0x7'));var querystring=require('querystring');var Papa=require(_0xf70e('0xd'));var Redis=require(_0xf70e('0xe'));var authService=require(_0xf70e('0xf'));var qs=require(_0xf70e('0x10'));var as=require(_0xf70e('0x11'));var hardwareService=require(_0xf70e('0x12'));var logger=require(_0xf70e('0x13'))(_0xf70e('0x14'));var utils=require('../../config/utils');var config=require(_0xf70e('0x15'));var licenseUtil=require(_0xf70e('0x16'));var db=require(_0xf70e('0x17'))['db'];var integrations=require(_0xf70e('0x18'));function respondWithStatusCode(_0x1c2d1a,_0x2d2f9b){_0x2d2f9b=_0x2d2f9b||0xcc;return function(_0x5aec25){if(_0x5aec25){return _0x1c2d1a['sendStatus'](_0x2d2f9b);}return _0x1c2d1a[_0xf70e('0x19')](_0x2d2f9b)[_0xf70e('0x1a')]();};}function respondWithResult(_0x3c83b8,_0x48c465){_0x48c465=_0x48c465||0xc8;return function(_0x16b87a){if(_0x16b87a){return _0x3c83b8[_0xf70e('0x19')](_0x48c465)[_0xf70e('0x1b')](_0x16b87a);}};}function respondWithFilteredResult(_0x12337a,_0x2bf7be){return function(_0x1691bf){if(_0x1691bf){var _0x5b75b9=typeof _0x2bf7be[_0xf70e('0x1c')]==='undefined'&&typeof _0x2bf7be[_0xf70e('0x1d')]===_0xf70e('0x1e');var _0x2fa730=_0x1691bf[_0xf70e('0x1f')];var _0x3a0ea1=_0x5b75b9?0x0:_0x2bf7be[_0xf70e('0x1c')];var _0x57d168=_0x5b75b9?_0x1691bf[_0xf70e('0x1f')]:_0x2bf7be[_0xf70e('0x1c')]+_0x2bf7be[_0xf70e('0x1d')];var _0x283b28;if(_0x57d168>=_0x2fa730){_0x57d168=_0x2fa730;_0x283b28=0xc8;}else{_0x283b28=0xce;}_0x12337a[_0xf70e('0x19')](_0x283b28);return _0x12337a[_0xf70e('0x20')](_0xf70e('0x21'),_0x3a0ea1+'-'+_0x57d168+'/'+_0x2fa730)[_0xf70e('0x1b')](_0x1691bf);}return null;};}function patchUpdates(_0x52b92f){return function(_0x6b5d7a){try{jsonpatch[_0xf70e('0x22')](_0x6b5d7a,_0x52b92f,!![]);}catch(_0x2f2c4){return BPromise[_0xf70e('0x23')](_0x2f2c4);}return _0x6b5d7a[_0xf70e('0x24')]();};}function saveUpdates(_0x18df81,_0x474402){return function(_0xe90142){if(_0xe90142){return _0xe90142['update'](_0x18df81)[_0xf70e('0x25')](function(_0x143116){return _0x143116;});}return null;};}function removeEntity(_0x5a876a,_0x27c808){return function(_0x2043c2){if(_0x2043c2){return _0x2043c2['destroy']()[_0xf70e('0x25')](function(){_0x5a876a[_0xf70e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bb9dc,_0x57bf0b){return function(_0x51899e){if(!_0x51899e){_0x5bb9dc[_0xf70e('0x26')](0x194);}return _0x51899e;};}function handleError(_0x3881be,_0x2be52f){_0x2be52f=_0x2be52f||0x1f4;return function(_0x27b4bf){logger[_0xf70e('0x27')](_0x27b4bf[_0xf70e('0x28')]);if(_0x27b4bf[_0xf70e('0x29')]){delete _0x27b4bf[_0xf70e('0x29')];}_0x3881be[_0xf70e('0x19')](_0x2be52f)[_0xf70e('0x2a')](_0x27b4bf);};}exports[_0xf70e('0x2b')]=function(_0x3e1153,_0x5c0809){var _0x35d274={},_0x466819={},_0x3134a5={'count':0x0,'rows':[]};var _0x291744=_[_0xf70e('0x2c')](db[_0xf70e('0x2d')][_0xf70e('0x2e')],function(_0x39cb45){return{'name':_0x39cb45[_0xf70e('0x2f')],'type':_0x39cb45[_0xf70e('0x30')][_0xf70e('0x31')]};});_0x466819[_0xf70e('0x32')]=_[_0xf70e('0x2c')](_0x291744,'name');_0x466819[_0xf70e('0x33')]=_['keys'](_0x3e1153[_0xf70e('0x33')]);_0x466819[_0xf70e('0x34')]=_[_0xf70e('0x35')](_0x466819[_0xf70e('0x32')],_0x466819[_0xf70e('0x33')]);_0x35d274[_0xf70e('0x36')]=_[_0xf70e('0x35')](_0x466819[_0xf70e('0x32')],qs[_0xf70e('0x37')](_0x3e1153['query'][_0xf70e('0x37')]));_0x35d274[_0xf70e('0x36')]=_0x35d274[_0xf70e('0x36')][_0xf70e('0x38')]?_0x35d274[_0xf70e('0x36')]:_0x466819['model'];if(!_0x3e1153[_0xf70e('0x33')][_0xf70e('0x39')](_0xf70e('0x3a'))){_0x35d274['limit']=qs[_0xf70e('0x1d')](_0x3e1153[_0xf70e('0x33')][_0xf70e('0x1d')]);_0x35d274[_0xf70e('0x1c')]=qs[_0xf70e('0x1c')](_0x3e1153[_0xf70e('0x33')]['offset']);}_0x35d274[_0xf70e('0x3b')]=qs[_0xf70e('0x3c')](_0x3e1153['query'][_0xf70e('0x3c')]);_0x35d274['where']=qs[_0xf70e('0x34')](_[_0xf70e('0x3d')](_0x3e1153[_0xf70e('0x33')],_0x466819[_0xf70e('0x34')]),_0x291744);if(_0x3e1153[_0xf70e('0x33')][_0xf70e('0x3e')]){_0x35d274[_0xf70e('0x3f')]=_[_0xf70e('0x40')](_0x35d274[_0xf70e('0x3f')],{'$or':_[_0xf70e('0x2c')](_0x291744,function(_0x12be45){if(_0x12be45[_0xf70e('0x30')]!==_0xf70e('0x41')){var _0x3029e9={};_0x3029e9[_0x12be45[_0xf70e('0x29')]]={'$like':'%'+_0x3e1153[_0xf70e('0x33')][_0xf70e('0x3e')]+'%'};return _0x3029e9;}})});}_0x35d274=_['merge']({},_0x35d274,_0x3e1153['options']);var _0x25ddf0={'where':_0x35d274[_0xf70e('0x3f')]};return db[_0xf70e('0x2d')][_0xf70e('0x1f')](_0x25ddf0)[_0xf70e('0x25')](function(_0x71650d){_0x3134a5[_0xf70e('0x1f')]=_0x71650d;if(_0x3e1153[_0xf70e('0x33')][_0xf70e('0x42')]){_0x35d274[_0xf70e('0x43')]=[{'all':!![]}];}return db[_0xf70e('0x2d')][_0xf70e('0x44')](_0x35d274);})[_0xf70e('0x25')](function(_0x315942){_0x3134a5[_0xf70e('0x45')]=_0x315942;return _0x3134a5;})[_0xf70e('0x25')](respondWithFilteredResult(_0x5c0809,_0x35d274))[_0xf70e('0x46')](handleError(_0x5c0809,null));};exports[_0xf70e('0x47')]=function(_0x781137,_0x2f4dcf){var _0x3ed423={'raw':![],'where':{'id':_0x781137[_0xf70e('0x48')]['id']}},_0xe5ff8f={};_0xe5ff8f[_0xf70e('0x32')]=_[_0xf70e('0x49')](db['SugarcrmAccount'][_0xf70e('0x2e')]);_0xe5ff8f[_0xf70e('0x33')]=_[_0xf70e('0x49')](_0x781137[_0xf70e('0x33')]);_0xe5ff8f[_0xf70e('0x34')]=_[_0xf70e('0x35')](_0xe5ff8f['model'],_0xe5ff8f[_0xf70e('0x33')]);_0x3ed423['attributes']=_[_0xf70e('0x35')](_0xe5ff8f[_0xf70e('0x32')],qs[_0xf70e('0x37')](_0x781137[_0xf70e('0x33')][_0xf70e('0x37')]));_0x3ed423[_0xf70e('0x36')]=_0x3ed423['attributes']['length']?_0x3ed423[_0xf70e('0x36')]:_0xe5ff8f[_0xf70e('0x32')];if(_0x781137[_0xf70e('0x33')][_0xf70e('0x42')]){_0x3ed423[_0xf70e('0x43')]=[{'all':!![]}];}_0x3ed423=_[_0xf70e('0x40')]({},_0x3ed423,_0x781137['options']);return db[_0xf70e('0x2d')][_0xf70e('0x4a')](_0x3ed423)[_0xf70e('0x25')](handleEntityNotFound(_0x2f4dcf,null))[_0xf70e('0x25')](respondWithResult(_0x2f4dcf,null))[_0xf70e('0x46')](handleError(_0x2f4dcf,null));};exports[_0xf70e('0x4b')]=function(_0xc2185e,_0x309242){return db[_0xf70e('0x2d')][_0xf70e('0x4b')](_0xc2185e['body'],{})[_0xf70e('0x25')](respondWithResult(_0x309242,0xc9))['catch'](handleError(_0x309242,null));};exports['update']=function(_0x5127b3,_0x7a3ac9){if(_0x5127b3[_0xf70e('0x4c')]['id']){delete _0x5127b3['body']['id'];}return db[_0xf70e('0x2d')]['find']({'where':{'id':_0x5127b3[_0xf70e('0x48')]['id']}})[_0xf70e('0x25')](handleEntityNotFound(_0x7a3ac9,null))[_0xf70e('0x25')](saveUpdates(_0x5127b3[_0xf70e('0x4c')],null))[_0xf70e('0x25')](respondWithResult(_0x7a3ac9,null))[_0xf70e('0x46')](handleError(_0x7a3ac9,null));};exports[_0xf70e('0x4d')]=function(_0xfff01c,_0x5ce614){return db['SugarcrmAccount'][_0xf70e('0x4a')]({'where':{'id':_0xfff01c['params']['id']}})[_0xf70e('0x25')](handleEntityNotFound(_0x5ce614,null))[_0xf70e('0x25')](removeEntity(_0x5ce614,null))[_0xf70e('0x46')](handleError(_0x5ce614,null));};exports['getConfigurations']=function(_0x4b1b0b,_0x4f1cd2,_0x4c358e){var _0x5ae4a9={};var _0x419791={};var _0x1346be;var _0x5f384b;return db['SugarcrmAccount'][_0xf70e('0x4e')]({'where':{'id':_0x4b1b0b[_0xf70e('0x48')]['id']}})[_0xf70e('0x25')](handleEntityNotFound(_0x4f1cd2,null))[_0xf70e('0x25')](function(_0x33f348){if(_0x33f348){_0x1346be=_0x33f348;_0x419791['model']=_[_0xf70e('0x49')](db[_0xf70e('0x4f')][_0xf70e('0x2e')]);_0x419791[_0xf70e('0x33')]=_[_0xf70e('0x49')](_0x4b1b0b['query']);_0x419791['filters']=_['intersection'](_0x419791[_0xf70e('0x32')],_0x419791[_0xf70e('0x33')]);_0x5ae4a9[_0xf70e('0x36')]=_[_0xf70e('0x35')](_0x419791[_0xf70e('0x32')],qs[_0xf70e('0x37')](_0x4b1b0b[_0xf70e('0x33')][_0xf70e('0x37')]));_0x5ae4a9[_0xf70e('0x36')]=_0x5ae4a9['attributes'][_0xf70e('0x38')]?_0x5ae4a9[_0xf70e('0x36')]:_0x419791[_0xf70e('0x32')];_0x5ae4a9[_0xf70e('0x3b')]=qs['sort'](_0x4b1b0b[_0xf70e('0x33')][_0xf70e('0x3c')]);_0x5ae4a9[_0xf70e('0x3f')]=qs['filters'](_['pick'](_0x4b1b0b['query'],_0x419791['filters']));if(_0x4b1b0b[_0xf70e('0x33')][_0xf70e('0x3e')]){_0x5ae4a9[_0xf70e('0x3f')]=_[_0xf70e('0x40')](_0x5ae4a9['where'],{'$or':_['map'](_0x5ae4a9[_0xf70e('0x36')],function(_0x760dde){var _0x3d489a={};_0x3d489a[_0x760dde]={'$like':'%'+_0x4b1b0b[_0xf70e('0x33')][_0xf70e('0x3e')]+'%'};return _0x3d489a;})});}_0x5ae4a9=_[_0xf70e('0x40')]({},_0x5ae4a9,_0x4b1b0b['options']);return _0x1346be['getConfigurations'](_0x5ae4a9);}})[_0xf70e('0x25')](function(_0x30b8cd){if(_0x30b8cd){_0x5f384b=_0x30b8cd[_0xf70e('0x38')];if(!_0x4b1b0b['query'][_0xf70e('0x39')](_0xf70e('0x3a'))){_0x5ae4a9[_0xf70e('0x1d')]=qs[_0xf70e('0x1d')](_0x4b1b0b[_0xf70e('0x33')][_0xf70e('0x1d')]);_0x5ae4a9['offset']=qs[_0xf70e('0x1c')](_0x4b1b0b['query'][_0xf70e('0x1c')]);}return _0x1346be[_0xf70e('0x50')](_0x5ae4a9);}})[_0xf70e('0x25')](function(_0x4a53a0){if(_0x4a53a0){return _0x4a53a0?{'count':_0x5f384b,'rows':_0x4a53a0}:null;}})[_0xf70e('0x25')](respondWithResult(_0x4f1cd2,null))['catch'](handleError(_0x4f1cd2,null));};exports[_0xf70e('0x51')]=function(_0x1118f1,_0x39249c,_0x39482d){if(_0x1118f1[_0xf70e('0x4c')]['id']){delete _0x1118f1[_0xf70e('0x4c')]['id'];}return db[_0xf70e('0x2d')][_0xf70e('0x4e')]({'where':{'id':_0x1118f1[_0xf70e('0x48')]['id']}})[_0xf70e('0x25')](handleEntityNotFound(_0x39249c,null))[_0xf70e('0x25')](function(_0x27355c){if(_0x27355c){_0x1118f1[_0xf70e('0x4c')][_0xf70e('0x52')]=_0x27355c['id'];_0x1118f1[_0xf70e('0x4c')]['Subjects']=integrations['getSubjects'](_0x1118f1['body']['channel'],_0x1118f1[_0xf70e('0x4c')][_0xf70e('0x30')]);_0x1118f1[_0xf70e('0x4c')]['Descriptions']=integrations['getDescriptions'](_0x1118f1[_0xf70e('0x4c')][_0xf70e('0x53')],_0x1118f1[_0xf70e('0x4c')][_0xf70e('0x30')]);return db[_0xf70e('0x4f')][_0xf70e('0x4b')](_0x1118f1[_0xf70e('0x4c')],{'include':[{'model':db['SugarcrmField'],'as':_0xf70e('0x54')},{'model':db[_0xf70e('0x55')],'as':_0xf70e('0x56')}]});}return null;})['then'](respondWithResult(_0x39249c,null))[_0xf70e('0x46')](handleError(_0x39249c,null));};exports['getFields']=function(_0x29e13c,_0x354e50,_0x19c0b6){var _0x41bb95='';var _0x1de7c0=['id',_0xf70e('0x29'),'assigned_user_id','created_by',_0xf70e('0x57'),'date_start',_0xf70e('0x58'),_0xf70e('0x59'),_0xf70e('0x5a'),_0xf70e('0x5b'),'parent_name',_0xf70e('0x5c')];return db[_0xf70e('0x2d')][_0xf70e('0x4e')]({'where':{'id':_0x29e13c[_0xf70e('0x48')]['id']},'attributes':['id','username','password',_0xf70e('0x5d')]})[_0xf70e('0x25')](handleEntityNotFound(_0x354e50,null))[_0xf70e('0x25')](function(_0x4b05ea){if(_0x4b05ea){_0x41bb95=_0x4b05ea[_0xf70e('0x5d')];var _0x16c53b=_0x41bb95[_0xf70e('0x5e')](-0x1);if(_0x16c53b==='/'){_0x41bb95=_0x41bb95['substring'](0x0,_0x41bb95[_0xf70e('0x5f')](_0x16c53b));}return rp({'method':'POST','uri':util['format']('%s%s',_0x41bb95,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xf70e('0x60'),'input_type':_0xf70e('0x61'),'response_type':_0xf70e('0x61'),'rest_data':JSON[_0xf70e('0x62')]({'user_auth':{'user_name':_0x4b05ea[_0xf70e('0x63')],'password':_0x4b05ea[_0xf70e('0x64')],'encryption':'PLAIN'},'application':_0xf70e('0x65')})}});}})['then'](function(_0x5d4c61){if(_0x5d4c61&&_0x5d4c61[_0xf70e('0x29')]!==_0xf70e('0x66')&&_0x5d4c61[_0xf70e('0x29')]!==_0xf70e('0x67')){return rp({'method':_0xf70e('0x68'),'uri':util[_0xf70e('0x69')](_0xf70e('0x6a'),_0x41bb95,_0xf70e('0x6b')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xf70e('0x61'),'response_type':_0xf70e('0x61'),'rest_data':JSON[_0xf70e('0x62')]({'session':_0x5d4c61['id'],'module_name':'Calls'})}})[_0xf70e('0x25')](function(_0x1b6cb9){if(_0x1b6cb9){var _0x51d5ea=_[_0xf70e('0x6c')](_0x1b6cb9[_0xf70e('0x6d')]);_['remove'](_0x51d5ea,function(_0x412776){return _0x1de7c0[_0xf70e('0x6e')](_0x412776[_0xf70e('0x29')]);});return{'count':_0x51d5ea['length'],'rows':_[_0xf70e('0x2c')](_0x51d5ea,function(_0x3beb76){return{'id':_0x3beb76['name'],'name':_0x3beb76[_0xf70e('0x6f')],'custom':_[_0xf70e('0x70')](_0x3beb76[_0xf70e('0x29')],'_c')?!![]:![],'options':_0x3beb76[_0xf70e('0x71')]?_['map'](_[_0xf70e('0x6c')](_0x3beb76[_0xf70e('0x71')]),function(_0x4a9770){return{'name':_0x4a9770[_0xf70e('0x72')],'value':_0x4a9770[_0xf70e('0x29')]};}):[]};})};}})[_0xf70e('0x25')](respondWithResult(_0x354e50,null))[_0xf70e('0x46')](function(_0x485e84){var _0x552751=_0x29e13c[_0xf70e('0x33')][_0xf70e('0x73')]?0x1f4:_0x485e84['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x552751,JSON[_0xf70e('0x62')](_0x485e84));delete _0x485e84[_0xf70e('0x29')];if(_0x552751===0x191){_0x552751=0x190;}_0x354e50[_0xf70e('0x19')](_0x552751)['send'](_0x29e13c['query'][_0xf70e('0x73')]?{'message':_0xf70e('0x74'),'statusCode':_0x485e84[_0xf70e('0x75')]}:_0x485e84);});}else{var _0x495149=0x1f4;_0x354e50[_0xf70e('0x19')](_0x495149)['send']({'message':_0xf70e('0x74'),'statusCode':0x190});}});};
\ No newline at end of file
index 1243e6d..312c1f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d08=['int_sugarcrm_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount'];(function(_0x56696e,_0x4680b1){var _0xada3fa=function(_0x40cdae){while(--_0x40cdae){_0x56696e['push'](_0x56696e['shift']());}};_0xada3fa(++_0x4680b1);}(_0x4d08,0x1a5));var _0x84d0=function(_0x3e2489,_0x41d9dd){_0x3e2489=_0x3e2489-0x0;var _0x2254ce=_0x4d08[_0x3e2489];return _0x2254ce;};'use strict';var _=require(_0x84d0('0x0'));var util=require('util');var logger=require(_0x84d0('0x1'))(_0x84d0('0x2'));var moment=require(_0x84d0('0x3'));var BPromise=require(_0x84d0('0x4'));var rp=require(_0x84d0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x84d0('0x6'));var config=require(_0x84d0('0x7'));var attributes=require(_0x84d0('0x8'));var integrations=require(_0x84d0('0x9'));module[_0x84d0('0xa')]=function(_0x161c3f,_0x2a4698){return _0x161c3f[_0x84d0('0xb')](_0x84d0('0xc'),attributes,{'tableName':_0x84d0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd477=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x3ebefc,_0x14c7bc){var _0xe79af0=function(_0x1ae7cf){while(--_0x1ae7cf){_0x3ebefc['push'](_0x3ebefc['shift']());}};_0xe79af0(++_0x14c7bc);}(_0xd477,0xdf));var _0x7d47=function(_0x14bd60,_0x73b2f9){_0x14bd60=_0x14bd60-0x0;var _0x4b0a31=_0xd477[_0x14bd60];return _0x4b0a31;};'use strict';var _=require(_0x7d47('0x0'));var util=require(_0x7d47('0x1'));var logger=require(_0x7d47('0x2'))(_0x7d47('0x3'));var moment=require(_0x7d47('0x4'));var BPromise=require('bluebird');var rp=require(_0x7d47('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d47('0x6'));var config=require(_0x7d47('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x7d47('0x8'));module[_0x7d47('0x9')]=function(_0x3c66d0,_0x221423){return _0x3c66d0[_0x7d47('0xa')](_0x7d47('0xb'),attributes,{'tableName':_0x7d47('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 674de4f..0ba0ef2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41c7=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','attributes','limit','map','model','include','ShowSugarcrmAccount','find','raw','where','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x98459f,_0x4dfb55){var _0x128f94=function(_0xe6315c){while(--_0xe6315c){_0x98459f['push'](_0x98459f['shift']());}};_0x128f94(++_0x4dfb55);}(_0x41c7,0x171));var _0x741c=function(_0x12126a,_0x439051){_0x12126a=_0x12126a-0x0;var _0x4aa891=_0x41c7[_0x12126a];return _0x4aa891;};'use strict';var _=require(_0x741c('0x0'));var util=require(_0x741c('0x1'));var moment=require(_0x741c('0x2'));var BPromise=require('bluebird');var rs=require(_0x741c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x741c('0x4'))['db'];var utils=require(_0x741c('0x5'));var logger=require('../../config/logger')(_0x741c('0x6'));var config=require(_0x741c('0x7'));var jayson=require(_0x741c('0x8'));var client=jayson[_0x741c('0x9')][_0x741c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a2626,_0x527029,_0x50b053){return new BPromise(function(_0x1efc61,_0x4f962a){return client['request'](_0x1a2626,_0x50b053)[_0x741c('0xb')](function(_0x310153){logger[_0x741c('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x527029,_0x741c('0xd'));logger[_0x741c('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x527029,_0x741c('0xd'),JSON[_0x741c('0xf')](_0x310153));if(_0x310153[_0x741c('0x10')]){if(_0x310153[_0x741c('0x10')][_0x741c('0x11')]===0x1f4){logger['error'](_0x741c('0x12'),_0x527029,_0x310153[_0x741c('0x10')]['message']);return _0x4f962a(_0x310153[_0x741c('0x10')][_0x741c('0x13')]);}logger['error'](_0x741c('0x12'),_0x527029,_0x310153[_0x741c('0x10')][_0x741c('0x13')]);return _0x1efc61(_0x310153[_0x741c('0x10')][_0x741c('0x13')]);}else{logger[_0x741c('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x527029,_0x741c('0xd'));_0x1efc61(_0x310153['result'][_0x741c('0x13')]);}})[_0x741c('0x14')](function(_0x5b900c){logger[_0x741c('0x10')](_0x741c('0x12'),_0x527029,_0x5b900c);_0x4f962a(_0x5b900c);});});}exports[_0x741c('0x15')]=function(_0x19618b){var _0x1d54b9=this;return new Promise(function(_0xb61e92,_0x4f562e){return db[_0x741c('0x16')][_0x741c('0x17')]({'raw':_0x19618b[_0x741c('0x18')]?_0x19618b[_0x741c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x19618b[_0x741c('0x18')]?_0x19618b['options']['where']||null:null,'attributes':_0x19618b['options']?_0x19618b['options'][_0x741c('0x19')]||null:null,'limit':_0x19618b[_0x741c('0x18')]?_0x19618b['options'][_0x741c('0x1a')]||null:null,'include':_0x19618b[_0x741c('0x18')]?_0x19618b['options']['include']?_[_0x741c('0x1b')](_0x19618b[_0x741c('0x18')]['include'],function(_0x5e1ba0){return{'model':db[_0x5e1ba0[_0x741c('0x1c')]],'as':_0x5e1ba0['as'],'attributes':_0x5e1ba0[_0x741c('0x19')],'include':_0x5e1ba0['include']?_[_0x741c('0x1b')](_0x5e1ba0['include'],function(_0x1864f6){return{'model':db[_0x1864f6[_0x741c('0x1c')]],'as':_0x1864f6['as'],'attributes':_0x1864f6['attributes'],'include':_0x1864f6[_0x741c('0x1d')]?_[_0x741c('0x1b')](_0x1864f6[_0x741c('0x1d')],function(_0x32c68c){return{'model':db[_0x32c68c['model']],'as':_0x32c68c['as'],'attributes':_0x32c68c[_0x741c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x741c('0xb')](function(_0x32a51a){logger['info'](_0x741c('0x15'),_0x19618b);logger[_0x741c('0xe')](_0x741c('0x15'),_0x19618b,JSON[_0x741c('0xf')](_0x32a51a));_0xb61e92(_0x32a51a);})[_0x741c('0x14')](function(_0x26ebe2){logger['error'](_0x741c('0x15'),_0x26ebe2['message'],_0x19618b);_0x4f562e(_0x1d54b9[_0x741c('0x10')](0x1f4,_0x26ebe2[_0x741c('0x13')]));});});};exports[_0x741c('0x1e')]=function(_0x451130){var _0x5ead15=this;return new Promise(function(_0x8fb815,_0x224a58){return db[_0x741c('0x16')][_0x741c('0x1f')]({'raw':_0x451130[_0x741c('0x18')]?_0x451130[_0x741c('0x18')][_0x741c('0x20')]===undefined?!![]:![]:!![],'where':_0x451130[_0x741c('0x18')]?_0x451130[_0x741c('0x18')][_0x741c('0x21')]||null:null,'attributes':_0x451130[_0x741c('0x18')]?_0x451130['options']['attributes']||null:null,'include':_0x451130['options']?_0x451130['options'][_0x741c('0x1d')]?_['map'](_0x451130[_0x741c('0x18')][_0x741c('0x1d')],function(_0xe162){return{'model':db[_0xe162[_0x741c('0x1c')]],'as':_0xe162['as'],'attributes':_0xe162[_0x741c('0x19')],'include':_0xe162[_0x741c('0x1d')]?_[_0x741c('0x1b')](_0xe162[_0x741c('0x1d')],function(_0x3ca671){return{'model':db[_0x3ca671[_0x741c('0x1c')]],'as':_0x3ca671['as'],'attributes':_0x3ca671['attributes'],'include':_0x3ca671[_0x741c('0x1d')]?_[_0x741c('0x1b')](_0x3ca671['include'],function(_0x115610){return{'model':db[_0x115610[_0x741c('0x1c')]],'as':_0x115610['as'],'attributes':_0x115610['attributes']};}):[]};}):[]};}):[]:[]})[_0x741c('0xb')](function(_0x304471){logger[_0x741c('0xc')](_0x741c('0x1e'),_0x451130);logger[_0x741c('0xe')](_0x741c('0x1e'),_0x451130,JSON[_0x741c('0xf')](_0x304471));_0x8fb815(_0x304471);})[_0x741c('0x14')](function(_0x242fa4){logger[_0x741c('0x10')](_0x741c('0x1e'),_0x242fa4[_0x741c('0x13')],_0x451130);_0x224a58(_0x5ead15[_0x741c('0x10')](0x1f4,_0x242fa4['message']));});});};
\ No newline at end of file
+var _0xefd0=['debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowSugarcrmAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x32f670,_0xaa0493){var _0x3a1a59=function(_0x1b286b){while(--_0x1b286b){_0x32f670['push'](_0x32f670['shift']());}};_0x3a1a59(++_0xaa0493);}(_0xefd0,0x10c));var _0x0efd=function(_0x6d737,_0x3779f1){_0x6d737=_0x6d737-0x0;var _0x326336=_0xefd0[_0x6d737];return _0x326336;};'use strict';var _=require(_0x0efd('0x0'));var util=require('util');var moment=require(_0x0efd('0x1'));var BPromise=require('bluebird');var rs=require(_0x0efd('0x2'));var fs=require('fs');var Redis=require(_0x0efd('0x3'));var db=require(_0x0efd('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0efd('0x5'));var jayson=require(_0x0efd('0x6'));var client=jayson[_0x0efd('0x7')][_0x0efd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cd5d2,_0x5b9364,_0x7fd5d0){return new BPromise(function(_0x36980d,_0x4ccebb){return client[_0x0efd('0x9')](_0x5cd5d2,_0x7fd5d0)['then'](function(_0x5c9d29){logger[_0x0efd('0xa')]('SugarcrmAccount,\x20%s,\x20%s',_0x5b9364,_0x0efd('0xb'));logger[_0x0efd('0xc')](_0x0efd('0xd'),_0x5b9364,_0x0efd('0xb'),JSON[_0x0efd('0xe')](_0x5c9d29));if(_0x5c9d29[_0x0efd('0xf')]){if(_0x5c9d29['error'][_0x0efd('0x10')]===0x1f4){logger[_0x0efd('0xf')](_0x0efd('0x11'),_0x5b9364,_0x5c9d29[_0x0efd('0xf')][_0x0efd('0x12')]);return _0x4ccebb(_0x5c9d29[_0x0efd('0xf')][_0x0efd('0x12')]);}logger['error'](_0x0efd('0x11'),_0x5b9364,_0x5c9d29[_0x0efd('0xf')]['message']);return _0x36980d(_0x5c9d29[_0x0efd('0xf')]['message']);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x5b9364,'request\x20sent');_0x36980d(_0x5c9d29[_0x0efd('0x13')][_0x0efd('0x12')]);}})[_0x0efd('0x14')](function(_0x4c8d4b){logger[_0x0efd('0xf')](_0x0efd('0x11'),_0x5b9364,_0x4c8d4b);_0x4ccebb(_0x4c8d4b);});});}exports[_0x0efd('0x15')]=function(_0x249128){var _0x3cca3b=this;return new Promise(function(_0x30866e,_0x3ca6cf){return db[_0x0efd('0x16')][_0x0efd('0x17')]({'raw':_0x249128[_0x0efd('0x18')]?_0x249128[_0x0efd('0x18')][_0x0efd('0x19')]===undefined?!![]:![]:!![],'where':_0x249128[_0x0efd('0x18')]?_0x249128['options'][_0x0efd('0x1a')]||null:null,'attributes':_0x249128['options']?_0x249128[_0x0efd('0x18')][_0x0efd('0x1b')]||null:null,'limit':_0x249128[_0x0efd('0x18')]?_0x249128[_0x0efd('0x18')][_0x0efd('0x1c')]||null:null,'include':_0x249128[_0x0efd('0x18')]?_0x249128[_0x0efd('0x18')][_0x0efd('0x1d')]?_[_0x0efd('0x1e')](_0x249128[_0x0efd('0x18')][_0x0efd('0x1d')],function(_0x12d169){return{'model':db[_0x12d169[_0x0efd('0x1f')]],'as':_0x12d169['as'],'attributes':_0x12d169['attributes'],'include':_0x12d169['include']?_[_0x0efd('0x1e')](_0x12d169['include'],function(_0x40e79a){return{'model':db[_0x40e79a['model']],'as':_0x40e79a['as'],'attributes':_0x40e79a[_0x0efd('0x1b')],'include':_0x40e79a['include']?_['map'](_0x40e79a['include'],function(_0x1255f4){return{'model':db[_0x1255f4['model']],'as':_0x1255f4['as'],'attributes':_0x1255f4['attributes']};}):[]};}):[]};}):[]:[]})[_0x0efd('0x20')](function(_0x38f2d0){logger[_0x0efd('0xa')](_0x0efd('0x15'),_0x249128);logger[_0x0efd('0xc')](_0x0efd('0x15'),_0x249128,JSON[_0x0efd('0xe')](_0x38f2d0));_0x30866e(_0x38f2d0);})[_0x0efd('0x14')](function(_0x505cb6){logger[_0x0efd('0xf')](_0x0efd('0x15'),_0x505cb6[_0x0efd('0x12')],_0x249128);_0x3ca6cf(_0x3cca3b[_0x0efd('0xf')](0x1f4,_0x505cb6[_0x0efd('0x12')]));});});};exports[_0x0efd('0x21')]=function(_0x42e0ef){var _0x1ba561=this;return new Promise(function(_0x26e97c,_0x373d7d){return db[_0x0efd('0x16')][_0x0efd('0x22')]({'raw':_0x42e0ef[_0x0efd('0x18')]?_0x42e0ef[_0x0efd('0x18')][_0x0efd('0x19')]===undefined?!![]:![]:!![],'where':_0x42e0ef[_0x0efd('0x18')]?_0x42e0ef['options']['where']||null:null,'attributes':_0x42e0ef[_0x0efd('0x18')]?_0x42e0ef[_0x0efd('0x18')]['attributes']||null:null,'include':_0x42e0ef[_0x0efd('0x18')]?_0x42e0ef[_0x0efd('0x18')][_0x0efd('0x1d')]?_[_0x0efd('0x1e')](_0x42e0ef['options'][_0x0efd('0x1d')],function(_0x48cf15){return{'model':db[_0x48cf15['model']],'as':_0x48cf15['as'],'attributes':_0x48cf15['attributes'],'include':_0x48cf15[_0x0efd('0x1d')]?_[_0x0efd('0x1e')](_0x48cf15[_0x0efd('0x1d')],function(_0x1996ec){return{'model':db[_0x1996ec[_0x0efd('0x1f')]],'as':_0x1996ec['as'],'attributes':_0x1996ec[_0x0efd('0x1b')],'include':_0x1996ec['include']?_[_0x0efd('0x1e')](_0x1996ec[_0x0efd('0x1d')],function(_0x59e4d7){return{'model':db[_0x59e4d7[_0x0efd('0x1f')]],'as':_0x59e4d7['as'],'attributes':_0x59e4d7[_0x0efd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0efd('0x20')](function(_0x20dd8f){logger[_0x0efd('0xa')](_0x0efd('0x21'),_0x42e0ef);logger[_0x0efd('0xc')](_0x0efd('0x21'),_0x42e0ef,JSON['stringify'](_0x20dd8f));_0x26e97c(_0x20dd8f);})['catch'](function(_0x477b81){logger['error']('ShowSugarcrmAccount',_0x477b81[_0x0efd('0x12')],_0x42e0ef);_0x373d7d(_0x1ba561[_0x0efd('0xf')](0x1f4,_0x477b81[_0x0efd('0x12')]));});});};
\ No newline at end of file
index 497d533..799c692 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18f2=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router'];(function(_0x4375fb,_0x22650a){var _0x445a97=function(_0x37e046){while(--_0x37e046){_0x4375fb['push'](_0x4375fb['shift']());}};_0x445a97(++_0x22650a);}(_0x18f2,0x163));var _0x218f=function(_0x297494,_0xa54303){_0x297494=_0x297494-0x0;var _0x3623c8=_0x18f2[_0x297494];return _0x3623c8;};'use strict';var multer=require(_0x218f('0x0'));var util=require('util');var path=require(_0x218f('0x1'));var timeout=require(_0x218f('0x2'));var express=require(_0x218f('0x3'));var router=express[_0x218f('0x4')]();var fs_extra=require(_0x218f('0x5'));var auth=require(_0x218f('0x6'));var interaction=require(_0x218f('0x7'));var config=require(_0x218f('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x218f('0x9')]('/',auth[_0x218f('0xa')](),controller[_0x218f('0xb')]);router[_0x218f('0x9')](_0x218f('0xc'),auth[_0x218f('0xa')](),controller[_0x218f('0xd')]);router['get'](_0x218f('0xe'),auth['isAuthenticated'](),controller[_0x218f('0xf')]);router[_0x218f('0x9')]('/:id/subjects',auth[_0x218f('0xa')](),controller[_0x218f('0x10')]);router[_0x218f('0x9')](_0x218f('0x11'),auth[_0x218f('0xa')](),controller[_0x218f('0x12')]);router['post']('/',auth[_0x218f('0xa')](),controller[_0x218f('0x13')]);router[_0x218f('0x14')](_0x218f('0xc'),auth['isAuthenticated'](),controller[_0x218f('0x15')]);router[_0x218f('0x16')](_0x218f('0xc'),auth[_0x218f('0xa')](),controller[_0x218f('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x29a2=['getDescriptions','post','create','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x391a79,_0x5a1626){var _0x3cb7ad=function(_0x39215c){while(--_0x39215c){_0x391a79['push'](_0x391a79['shift']());}};_0x3cb7ad(++_0x5a1626);}(_0x29a2,0x18d));var _0x229a=function(_0xfb0cfd,_0x500179){_0xfb0cfd=_0xfb0cfd-0x0;var _0x2fd8aa=_0x29a2[_0xfb0cfd];return _0x2fd8aa;};'use strict';var multer=require('multer');var util=require(_0x229a('0x0'));var path=require('path');var timeout=require(_0x229a('0x1'));var express=require(_0x229a('0x2'));var router=express[_0x229a('0x3')]();var fs_extra=require(_0x229a('0x4'));var auth=require(_0x229a('0x5'));var interaction=require(_0x229a('0x6'));var config=require('../../config/environment');var controller=require(_0x229a('0x7'));router[_0x229a('0x8')]('/',auth[_0x229a('0x9')](),controller[_0x229a('0xa')]);router[_0x229a('0x8')](_0x229a('0xb'),auth['isAuthenticated'](),controller[_0x229a('0xc')]);router[_0x229a('0x8')]('/:id/fields',auth[_0x229a('0x9')](),controller[_0x229a('0xd')]);router[_0x229a('0x8')](_0x229a('0xe'),auth['isAuthenticated'](),controller[_0x229a('0xf')]);router[_0x229a('0x8')](_0x229a('0x10'),auth['isAuthenticated'](),controller[_0x229a('0x11')]);router[_0x229a('0x12')]('/',auth[_0x229a('0x9')](),controller[_0x229a('0x13')]);router['put']('/:id',auth[_0x229a('0x9')](),controller[_0x229a('0x14')]);router[_0x229a('0x15')]('/:id',auth[_0x229a('0x9')](),controller[_0x229a('0x16')]);module['exports']=router;
\ No newline at end of file
index 765f971..74d2fc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd80=['sequelize','STRING'];(function(_0x8f7140,_0x521a0f){var _0x50ccc8=function(_0x12e238){while(--_0x12e238){_0x8f7140['push'](_0x8f7140['shift']());}};_0x50ccc8(++_0x521a0f);}(_0xcd80,0x10e));var _0x0cd8=function(_0x33be9d,_0x41618e){_0x33be9d=_0x33be9d-0x0;var _0x4a9267=_0xcd80[_0x33be9d];return _0x4a9267;};'use strict';var Sequelize=require(_0x0cd8('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0cd8('0x1')]}};
\ No newline at end of file
+var _0x3067=['STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3067,0xa6));var _0x7306=function(_0x43fb03,_0x5add41){_0x43fb03=_0x43fb03-0x0;var _0x56aeb4=_0x3067[_0x43fb03];return _0x56aeb4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7306('0x0')]},'description':{'type':Sequelize[_0x7306('0x0')]}};
\ No newline at end of file
index 4c8e959..9bc4ecc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8949=['catch','show','keys','find','create','body','params','getFields','SugarcrmField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll'];(function(_0x3f37a0,_0x4f5821){var _0x1c5626=function(_0x298f4e){while(--_0x298f4e){_0x3f37a0['push'](_0x3f37a0['shift']());}};_0x1c5626(++_0x4f5821);}(_0x8949,0xb2));var _0x9894=function(_0x54dcad,_0x554f46){_0x54dcad=_0x54dcad-0x0;var _0x537c56=_0x8949[_0x54dcad];return _0x537c56;};'use strict';var emlformat=require(_0x9894('0x0'));var rimraf=require(_0x9894('0x1'));var zipdir=require(_0x9894('0x2'));var jsonpatch=require(_0x9894('0x3'));var rp=require(_0x9894('0x4'));var moment=require('moment');var BPromise=require(_0x9894('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9894('0x6'));var sox=require(_0x9894('0x7'));var csv=require(_0x9894('0x8'));var ejs=require(_0x9894('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9894('0xa'));var squel=require(_0x9894('0xb'));var crypto=require(_0x9894('0xc'));var jsforce=require(_0x9894('0xd'));var deskjs=require(_0x9894('0xe'));var toCsv=require(_0x9894('0x8'));var querystring=require(_0x9894('0xf'));var Papa=require(_0x9894('0x10'));var Redis=require('ioredis');var authService=require(_0x9894('0x11'));var qs=require(_0x9894('0x12'));var as=require(_0x9894('0x13'));var hardwareService=require(_0x9894('0x14'));var logger=require('../../config/logger')(_0x9894('0x15'));var utils=require('../../config/utils');var config=require(_0x9894('0x16'));var licenseUtil=require(_0x9894('0x17'));var db=require(_0x9894('0x18'))['db'];function respondWithStatusCode(_0x13d987,_0x56ed73){_0x56ed73=_0x56ed73||0xcc;return function(_0x28d392){if(_0x28d392){return _0x13d987[_0x9894('0x19')](_0x56ed73);}return _0x13d987['status'](_0x56ed73)[_0x9894('0x1a')]();};}function respondWithResult(_0x3712b9,_0x51158c){_0x51158c=_0x51158c||0xc8;return function(_0x2ee2ea){if(_0x2ee2ea){return _0x3712b9['status'](_0x51158c)[_0x9894('0x1b')](_0x2ee2ea);}};}function respondWithFilteredResult(_0x1146b3,_0x210021){return function(_0x23dd10){if(_0x23dd10){var _0x945407=typeof _0x210021[_0x9894('0x1c')]===_0x9894('0x1d')&&typeof _0x210021[_0x9894('0x1e')]===_0x9894('0x1d');var _0x1fa2e8=_0x23dd10[_0x9894('0x1f')];var _0x191e14=_0x945407?0x0:_0x210021[_0x9894('0x1c')];var _0x309198=_0x945407?_0x23dd10['count']:_0x210021[_0x9894('0x1c')]+_0x210021[_0x9894('0x1e')];var _0x4b70dd;if(_0x309198>=_0x1fa2e8){_0x309198=_0x1fa2e8;_0x4b70dd=0xc8;}else{_0x4b70dd=0xce;}_0x1146b3[_0x9894('0x20')](_0x4b70dd);return _0x1146b3[_0x9894('0x21')](_0x9894('0x22'),_0x191e14+'-'+_0x309198+'/'+_0x1fa2e8)['json'](_0x23dd10);}return null;};}function patchUpdates(_0x3d4823){return function(_0xa790cc){try{jsonpatch[_0x9894('0x23')](_0xa790cc,_0x3d4823,!![]);}catch(_0x22074c){return BPromise['reject'](_0x22074c);}return _0xa790cc[_0x9894('0x24')]();};}function saveUpdates(_0x596a21,_0x2f3d7f){return function(_0x1d09a4){if(_0x1d09a4){return _0x1d09a4[_0x9894('0x25')](_0x596a21)[_0x9894('0x26')](function(_0x2049a6){return _0x2049a6;});}return null;};}function removeEntity(_0x2308ad,_0x40dab8){return function(_0xb9cf24){if(_0xb9cf24){return _0xb9cf24[_0x9894('0x27')]()[_0x9894('0x26')](function(){_0x2308ad[_0x9894('0x20')](0xcc)[_0x9894('0x1a')]();});}};}function handleEntityNotFound(_0x1297f0,_0x1e1555){return function(_0x2f0a82){if(!_0x2f0a82){_0x1297f0[_0x9894('0x19')](0x194);}return _0x2f0a82;};}function handleError(_0x300eb8,_0x1a4bcd){_0x1a4bcd=_0x1a4bcd||0x1f4;return function(_0x4756b1){logger[_0x9894('0x28')](_0x4756b1[_0x9894('0x29')]);if(_0x4756b1[_0x9894('0x2a')]){delete _0x4756b1[_0x9894('0x2a')];}_0x300eb8['status'](_0x1a4bcd)[_0x9894('0x2b')](_0x4756b1);};}exports[_0x9894('0x2c')]=function(_0x5818f5,_0x3dce87){var _0x5c1d90={},_0x8de0a7={},_0x399b15={'count':0x0,'rows':[]};var _0x4a7a0f=_[_0x9894('0x2d')](db[_0x9894('0x2e')][_0x9894('0x2f')],function(_0x211dc7){return{'name':_0x211dc7[_0x9894('0x30')],'type':_0x211dc7[_0x9894('0x31')][_0x9894('0x32')]};});_0x8de0a7['model']=_[_0x9894('0x2d')](_0x4a7a0f,_0x9894('0x2a'));_0x8de0a7[_0x9894('0x33')]=_['keys'](_0x5818f5['query']);_0x8de0a7[_0x9894('0x34')]=_[_0x9894('0x35')](_0x8de0a7[_0x9894('0x36')],_0x8de0a7['query']);_0x5c1d90[_0x9894('0x37')]=_[_0x9894('0x35')](_0x8de0a7[_0x9894('0x36')],qs[_0x9894('0x38')](_0x5818f5[_0x9894('0x33')][_0x9894('0x38')]));_0x5c1d90[_0x9894('0x37')]=_0x5c1d90[_0x9894('0x37')][_0x9894('0x39')]?_0x5c1d90[_0x9894('0x37')]:_0x8de0a7['model'];if(!_0x5818f5['query'][_0x9894('0x3a')](_0x9894('0x3b'))){_0x5c1d90[_0x9894('0x1e')]=qs[_0x9894('0x1e')](_0x5818f5[_0x9894('0x33')][_0x9894('0x1e')]);_0x5c1d90[_0x9894('0x1c')]=qs[_0x9894('0x1c')](_0x5818f5[_0x9894('0x33')][_0x9894('0x1c')]);}_0x5c1d90[_0x9894('0x3c')]=qs[_0x9894('0x3d')](_0x5818f5[_0x9894('0x33')][_0x9894('0x3d')]);_0x5c1d90[_0x9894('0x3e')]=qs['filters'](_[_0x9894('0x3f')](_0x5818f5[_0x9894('0x33')],_0x8de0a7[_0x9894('0x34')]),_0x4a7a0f);if(_0x5818f5[_0x9894('0x33')]['filter']){_0x5c1d90[_0x9894('0x3e')]=_[_0x9894('0x40')](_0x5c1d90[_0x9894('0x3e')],{'$or':_[_0x9894('0x2d')](_0x4a7a0f,function(_0x22446d){if(_0x22446d[_0x9894('0x31')]!==_0x9894('0x41')){var _0x39c63e={};_0x39c63e[_0x22446d['name']]={'$like':'%'+_0x5818f5[_0x9894('0x33')][_0x9894('0x42')]+'%'};return _0x39c63e;}})});}_0x5c1d90=_['merge']({},_0x5c1d90,_0x5818f5[_0x9894('0x43')]);var _0x271f8d={'where':_0x5c1d90[_0x9894('0x3e')]};return db[_0x9894('0x2e')][_0x9894('0x1f')](_0x271f8d)['then'](function(_0x132f7f){_0x399b15['count']=_0x132f7f;if(_0x5818f5[_0x9894('0x33')][_0x9894('0x44')]){_0x5c1d90[_0x9894('0x45')]=[{'all':!![]}];}return db[_0x9894('0x2e')][_0x9894('0x46')](_0x5c1d90);})['then'](function(_0x5c000a){_0x399b15['rows']=_0x5c000a;return _0x399b15;})['then'](respondWithFilteredResult(_0x3dce87,_0x5c1d90))[_0x9894('0x47')](handleError(_0x3dce87,null));};exports[_0x9894('0x48')]=function(_0xaca7bd,_0x10e8c7){var _0x3023f2={'raw':![],'where':{'id':_0xaca7bd['params']['id']}},_0x2747dc={};_0x2747dc[_0x9894('0x36')]=_[_0x9894('0x49')](db['SugarcrmConfiguration'][_0x9894('0x2f')]);_0x2747dc[_0x9894('0x33')]=_[_0x9894('0x49')](_0xaca7bd[_0x9894('0x33')]);_0x2747dc[_0x9894('0x34')]=_['intersection'](_0x2747dc[_0x9894('0x36')],_0x2747dc['query']);_0x3023f2[_0x9894('0x37')]=_[_0x9894('0x35')](_0x2747dc['model'],qs[_0x9894('0x38')](_0xaca7bd[_0x9894('0x33')][_0x9894('0x38')]));_0x3023f2[_0x9894('0x37')]=_0x3023f2[_0x9894('0x37')]['length']?_0x3023f2[_0x9894('0x37')]:_0x2747dc[_0x9894('0x36')];if(_0xaca7bd[_0x9894('0x33')][_0x9894('0x44')]){_0x3023f2[_0x9894('0x45')]=[{'all':!![]}];}_0x3023f2=_[_0x9894('0x40')]({},_0x3023f2,_0xaca7bd[_0x9894('0x43')]);return db['SugarcrmConfiguration'][_0x9894('0x4a')](_0x3023f2)[_0x9894('0x26')](handleEntityNotFound(_0x10e8c7,null))[_0x9894('0x26')](respondWithResult(_0x10e8c7,null))[_0x9894('0x47')](handleError(_0x10e8c7,null));};exports['create']=function(_0x4278c9,_0x359837){return db[_0x9894('0x2e')][_0x9894('0x4b')](_0x4278c9[_0x9894('0x4c')],{})[_0x9894('0x26')](respondWithResult(_0x359837,0xc9))[_0x9894('0x47')](handleError(_0x359837,null));};exports[_0x9894('0x25')]=function(_0x262638,_0xe1b5f4){if(_0x262638[_0x9894('0x4c')]['id']){delete _0x262638[_0x9894('0x4c')]['id'];}return db[_0x9894('0x2e')][_0x9894('0x4a')]({'where':{'id':_0x262638['params']['id']}})[_0x9894('0x26')](handleEntityNotFound(_0xe1b5f4,null))[_0x9894('0x26')](saveUpdates(_0x262638[_0x9894('0x4c')],null))[_0x9894('0x26')](respondWithResult(_0xe1b5f4,null))[_0x9894('0x47')](handleError(_0xe1b5f4,null));};exports[_0x9894('0x27')]=function(_0x355fca,_0x61eb63){return db[_0x9894('0x2e')][_0x9894('0x4a')]({'where':{'id':_0x355fca[_0x9894('0x4d')]['id']}})[_0x9894('0x26')](handleEntityNotFound(_0x61eb63,null))['then'](removeEntity(_0x61eb63,null))[_0x9894('0x47')](handleError(_0x61eb63,null));};exports[_0x9894('0x4e')]=function(_0x51575c,_0x34619e,_0x29030a){var _0x1c2fc4={};var _0x3b7ea5={};var _0x5b5244;var _0x2d2751;return db[_0x9894('0x2e')]['findOne']({'where':{'id':_0x51575c[_0x9894('0x4d')]['id']}})[_0x9894('0x26')](handleEntityNotFound(_0x34619e,null))[_0x9894('0x26')](function(_0x115a76){if(_0x115a76){_0x5b5244=_0x115a76;_0x3b7ea5['model']=_[_0x9894('0x49')](db[_0x9894('0x4f')][_0x9894('0x2f')]);_0x3b7ea5[_0x9894('0x33')]=_[_0x9894('0x49')](_0x51575c[_0x9894('0x33')]);_0x3b7ea5['filters']=_[_0x9894('0x35')](_0x3b7ea5['model'],_0x3b7ea5['query']);_0x1c2fc4[_0x9894('0x37')]=_[_0x9894('0x35')](_0x3b7ea5['model'],qs[_0x9894('0x38')](_0x51575c[_0x9894('0x33')][_0x9894('0x38')]));_0x1c2fc4[_0x9894('0x37')]=_0x1c2fc4[_0x9894('0x37')]['length']?_0x1c2fc4[_0x9894('0x37')]:_0x3b7ea5[_0x9894('0x36')];_0x1c2fc4[_0x9894('0x3c')]=qs[_0x9894('0x3d')](_0x51575c['query'][_0x9894('0x3d')]);_0x1c2fc4['where']=qs['filters'](_[_0x9894('0x3f')](_0x51575c[_0x9894('0x33')],_0x3b7ea5[_0x9894('0x34')]));if(_0x51575c[_0x9894('0x33')][_0x9894('0x42')]){_0x1c2fc4[_0x9894('0x3e')]=_[_0x9894('0x40')](_0x1c2fc4[_0x9894('0x3e')],{'$or':_[_0x9894('0x2d')](_0x1c2fc4[_0x9894('0x37')],function(_0x44e344){var _0x42d418={};_0x42d418[_0x44e344]={'$like':'%'+_0x51575c['query'][_0x9894('0x42')]+'%'};return _0x42d418;})});}_0x1c2fc4=_['merge']({},_0x1c2fc4,_0x51575c[_0x9894('0x43')]);return _0x5b5244[_0x9894('0x4e')](_0x1c2fc4);}})[_0x9894('0x26')](function(_0x5f1b5d){if(_0x5f1b5d){_0x2d2751=_0x5f1b5d['length'];if(!_0x51575c[_0x9894('0x33')][_0x9894('0x3a')](_0x9894('0x3b'))){_0x1c2fc4[_0x9894('0x1e')]=qs[_0x9894('0x1e')](_0x51575c[_0x9894('0x33')][_0x9894('0x1e')]);_0x1c2fc4[_0x9894('0x1c')]=qs[_0x9894('0x1c')](_0x51575c['query'][_0x9894('0x1c')]);}return _0x5b5244['getFields'](_0x1c2fc4);}})[_0x9894('0x26')](function(_0x301c63){if(_0x301c63){return _0x301c63?{'count':_0x2d2751,'rows':_0x301c63}:null;}})['then'](respondWithResult(_0x34619e,null))[_0x9894('0x47')](handleError(_0x34619e,null));};exports[_0x9894('0x50')]=function(_0x50d4a7,_0x2e09bc,_0x1361f9){var _0x2d69b0={};var _0x15b6de={};var _0x469e0c;var _0x4fd9aa;return db[_0x9894('0x2e')][_0x9894('0x51')]({'where':{'id':_0x50d4a7[_0x9894('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2e09bc,null))['then'](function(_0x535ff7){if(_0x535ff7){_0x469e0c=_0x535ff7;_0x15b6de[_0x9894('0x36')]=_[_0x9894('0x49')](db['SugarcrmField'][_0x9894('0x2f')]);_0x15b6de['query']=_[_0x9894('0x49')](_0x50d4a7['query']);_0x15b6de[_0x9894('0x34')]=_[_0x9894('0x35')](_0x15b6de[_0x9894('0x36')],_0x15b6de[_0x9894('0x33')]);_0x2d69b0[_0x9894('0x37')]=_[_0x9894('0x35')](_0x15b6de[_0x9894('0x36')],qs['fields'](_0x50d4a7['query']['fields']));_0x2d69b0['attributes']=_0x2d69b0['attributes'][_0x9894('0x39')]?_0x2d69b0[_0x9894('0x37')]:_0x15b6de[_0x9894('0x36')];_0x2d69b0[_0x9894('0x3c')]=qs[_0x9894('0x3d')](_0x50d4a7[_0x9894('0x33')][_0x9894('0x3d')]);_0x2d69b0['where']=qs[_0x9894('0x34')](_['pick'](_0x50d4a7[_0x9894('0x33')],_0x15b6de[_0x9894('0x34')]));if(_0x50d4a7[_0x9894('0x33')][_0x9894('0x42')]){_0x2d69b0[_0x9894('0x3e')]=_[_0x9894('0x40')](_0x2d69b0[_0x9894('0x3e')],{'$or':_['map'](_0x2d69b0[_0x9894('0x37')],function(_0xc83633){var _0x308f95={};_0x308f95[_0xc83633]={'$like':'%'+_0x50d4a7['query']['filter']+'%'};return _0x308f95;})});}_0x2d69b0=_[_0x9894('0x40')]({},_0x2d69b0,_0x50d4a7['options']);return _0x469e0c['getSubjects'](_0x2d69b0);}})[_0x9894('0x26')](function(_0x157ed8){if(_0x157ed8){_0x4fd9aa=_0x157ed8['length'];if(!_0x50d4a7[_0x9894('0x33')][_0x9894('0x3a')](_0x9894('0x3b'))){_0x2d69b0[_0x9894('0x1e')]=qs[_0x9894('0x1e')](_0x50d4a7['query'][_0x9894('0x1e')]);_0x2d69b0['offset']=qs[_0x9894('0x1c')](_0x50d4a7[_0x9894('0x33')][_0x9894('0x1c')]);}return _0x469e0c['getSubjects'](_0x2d69b0);}})[_0x9894('0x26')](function(_0x509e1f){if(_0x509e1f){return _0x509e1f?{'count':_0x4fd9aa,'rows':_0x509e1f}:null;}})[_0x9894('0x26')](respondWithResult(_0x2e09bc,null))['catch'](handleError(_0x2e09bc,null));};exports['getDescriptions']=function(_0x2ed6ae,_0x32b838,_0x27706d){var _0x473125={};var _0x3294d={};var _0x3efa33;var _0x55c827;return db[_0x9894('0x2e')][_0x9894('0x51')]({'where':{'id':_0x2ed6ae[_0x9894('0x4d')]['id']}})[_0x9894('0x26')](handleEntityNotFound(_0x32b838,null))[_0x9894('0x26')](function(_0x572f9c){if(_0x572f9c){_0x3efa33=_0x572f9c;_0x3294d[_0x9894('0x36')]=_[_0x9894('0x49')](db['SugarcrmField'][_0x9894('0x2f')]);_0x3294d['query']=_[_0x9894('0x49')](_0x2ed6ae[_0x9894('0x33')]);_0x3294d[_0x9894('0x34')]=_['intersection'](_0x3294d[_0x9894('0x36')],_0x3294d['query']);_0x473125[_0x9894('0x37')]=_[_0x9894('0x35')](_0x3294d['model'],qs['fields'](_0x2ed6ae['query'][_0x9894('0x38')]));_0x473125[_0x9894('0x37')]=_0x473125[_0x9894('0x37')]['length']?_0x473125[_0x9894('0x37')]:_0x3294d[_0x9894('0x36')];_0x473125[_0x9894('0x3c')]=qs[_0x9894('0x3d')](_0x2ed6ae[_0x9894('0x33')][_0x9894('0x3d')]);_0x473125[_0x9894('0x3e')]=qs[_0x9894('0x34')](_[_0x9894('0x3f')](_0x2ed6ae[_0x9894('0x33')],_0x3294d[_0x9894('0x34')]));if(_0x2ed6ae[_0x9894('0x33')][_0x9894('0x42')]){_0x473125[_0x9894('0x3e')]=_['merge'](_0x473125[_0x9894('0x3e')],{'$or':_[_0x9894('0x2d')](_0x473125[_0x9894('0x37')],function(_0x85694b){var _0x3d31d3={};_0x3d31d3[_0x85694b]={'$like':'%'+_0x2ed6ae[_0x9894('0x33')][_0x9894('0x42')]+'%'};return _0x3d31d3;})});}_0x473125=_[_0x9894('0x40')]({},_0x473125,_0x2ed6ae['options']);return _0x3efa33[_0x9894('0x52')](_0x473125);}})['then'](function(_0x81f70c){if(_0x81f70c){_0x55c827=_0x81f70c[_0x9894('0x39')];if(!_0x2ed6ae[_0x9894('0x33')][_0x9894('0x3a')](_0x9894('0x3b'))){_0x473125[_0x9894('0x1e')]=qs[_0x9894('0x1e')](_0x2ed6ae['query'][_0x9894('0x1e')]);_0x473125[_0x9894('0x1c')]=qs[_0x9894('0x1c')](_0x2ed6ae['query'][_0x9894('0x1c')]);}return _0x3efa33[_0x9894('0x52')](_0x473125);}})[_0x9894('0x26')](function(_0x4d6fd7){if(_0x4d6fd7){return _0x4d6fd7?{'count':_0x55c827,'rows':_0x4d6fd7}:null;}})[_0x9894('0x26')](respondWithResult(_0x32b838,null))[_0x9894('0x47')](handleError(_0x32b838,null));};
\ No newline at end of file
+var _0xab5b=['end','undefined','count','limit','set','Content-Range','reject','update','destroy','stack','name','send','map','fieldName','type','model','query','filters','intersection','attributes','fields','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','SugarcrmConfiguration','findAll','rows','show','params','keys','length','find','catch','create','body','findOne','SugarcrmField','getFields','hasOwnProperty','getSubjects','rawAttributes','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xab5b,0xd2));var _0xbab5=function(_0x5a6ebb,_0xe107bb){_0x5a6ebb=_0x5a6ebb-0x0;var _0x1b6800=_0xab5b[_0x5a6ebb];return _0x1b6800;};'use strict';var emlformat=require(_0xbab5('0x0'));var rimraf=require(_0xbab5('0x1'));var zipdir=require(_0xbab5('0x2'));var jsonpatch=require(_0xbab5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbab5('0x4'));var Mustache=require(_0xbab5('0x5'));var util=require('util');var path=require(_0xbab5('0x6'));var sox=require(_0xbab5('0x7'));var csv=require(_0xbab5('0x8'));var ejs=require(_0xbab5('0x9'));var fs=require('fs');var fs_extra=require(_0xbab5('0xa'));var _=require(_0xbab5('0xb'));var squel=require(_0xbab5('0xc'));var crypto=require('crypto');var jsforce=require(_0xbab5('0xd'));var deskjs=require(_0xbab5('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbab5('0xf'));var Papa=require('papaparse');var Redis=require(_0xbab5('0x10'));var authService=require(_0xbab5('0x11'));var qs=require(_0xbab5('0x12'));var as=require(_0xbab5('0x13'));var hardwareService=require(_0xbab5('0x14'));var logger=require('../../config/logger')(_0xbab5('0x15'));var utils=require(_0xbab5('0x16'));var config=require(_0xbab5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbab5('0x18'))['db'];function respondWithStatusCode(_0xbc30d3,_0x498555){_0x498555=_0x498555||0xcc;return function(_0x3ddc23){if(_0x3ddc23){return _0xbc30d3[_0xbab5('0x19')](_0x498555);}return _0xbc30d3[_0xbab5('0x1a')](_0x498555)[_0xbab5('0x1b')]();};}function respondWithResult(_0x4cd246,_0x4e8411){_0x4e8411=_0x4e8411||0xc8;return function(_0x43dc04){if(_0x43dc04){return _0x4cd246[_0xbab5('0x1a')](_0x4e8411)['json'](_0x43dc04);}};}function respondWithFilteredResult(_0x4efc34,_0x14ec69){return function(_0x5958b6){if(_0x5958b6){var _0x2bbac0=typeof _0x14ec69['offset']==='undefined'&&typeof _0x14ec69['limit']===_0xbab5('0x1c');var _0x454e48=_0x5958b6[_0xbab5('0x1d')];var _0x161a2b=_0x2bbac0?0x0:_0x14ec69['offset'];var _0x3cded4=_0x2bbac0?_0x5958b6[_0xbab5('0x1d')]:_0x14ec69['offset']+_0x14ec69[_0xbab5('0x1e')];var _0x1c1349;if(_0x3cded4>=_0x454e48){_0x3cded4=_0x454e48;_0x1c1349=0xc8;}else{_0x1c1349=0xce;}_0x4efc34[_0xbab5('0x1a')](_0x1c1349);return _0x4efc34[_0xbab5('0x1f')](_0xbab5('0x20'),_0x161a2b+'-'+_0x3cded4+'/'+_0x454e48)['json'](_0x5958b6);}return null;};}function patchUpdates(_0x7feffe){return function(_0x536eec){try{jsonpatch['apply'](_0x536eec,_0x7feffe,!![]);}catch(_0x17f89e){return BPromise[_0xbab5('0x21')](_0x17f89e);}return _0x536eec['save']();};}function saveUpdates(_0x56108a,_0x209bf3){return function(_0x30106e){if(_0x30106e){return _0x30106e[_0xbab5('0x22')](_0x56108a)['then'](function(_0x53feb0){return _0x53feb0;});}return null;};}function removeEntity(_0x5d93d3,_0x453537){return function(_0x1a014d){if(_0x1a014d){return _0x1a014d[_0xbab5('0x23')]()['then'](function(){_0x5d93d3[_0xbab5('0x1a')](0xcc)[_0xbab5('0x1b')]();});}};}function handleEntityNotFound(_0x32355d,_0x482fb0){return function(_0x5bbc7e){if(!_0x5bbc7e){_0x32355d[_0xbab5('0x19')](0x194);}return _0x5bbc7e;};}function handleError(_0x89e85d,_0x5b5e58){_0x5b5e58=_0x5b5e58||0x1f4;return function(_0x473d61){logger['error'](_0x473d61[_0xbab5('0x24')]);if(_0x473d61[_0xbab5('0x25')]){delete _0x473d61['name'];}_0x89e85d['status'](_0x5b5e58)[_0xbab5('0x26')](_0x473d61);};}exports['index']=function(_0x34bfc0,_0x4fa819){var _0x16158b={},_0x437d82={},_0x578d4a={'count':0x0,'rows':[]};var _0xe118d5=_[_0xbab5('0x27')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x403e0d){return{'name':_0x403e0d[_0xbab5('0x28')],'type':_0x403e0d[_0xbab5('0x29')]['key']};});_0x437d82[_0xbab5('0x2a')]=_[_0xbab5('0x27')](_0xe118d5,_0xbab5('0x25'));_0x437d82[_0xbab5('0x2b')]=_['keys'](_0x34bfc0[_0xbab5('0x2b')]);_0x437d82[_0xbab5('0x2c')]=_[_0xbab5('0x2d')](_0x437d82[_0xbab5('0x2a')],_0x437d82[_0xbab5('0x2b')]);_0x16158b[_0xbab5('0x2e')]=_[_0xbab5('0x2d')](_0x437d82[_0xbab5('0x2a')],qs[_0xbab5('0x2f')](_0x34bfc0[_0xbab5('0x2b')][_0xbab5('0x2f')]));_0x16158b[_0xbab5('0x2e')]=_0x16158b['attributes']['length']?_0x16158b['attributes']:_0x437d82[_0xbab5('0x2a')];if(!_0x34bfc0[_0xbab5('0x2b')]['hasOwnProperty'](_0xbab5('0x30'))){_0x16158b['limit']=qs['limit'](_0x34bfc0[_0xbab5('0x2b')][_0xbab5('0x1e')]);_0x16158b['offset']=qs['offset'](_0x34bfc0[_0xbab5('0x2b')][_0xbab5('0x31')]);}_0x16158b[_0xbab5('0x32')]=qs['sort'](_0x34bfc0['query'][_0xbab5('0x33')]);_0x16158b[_0xbab5('0x34')]=qs[_0xbab5('0x2c')](_[_0xbab5('0x35')](_0x34bfc0['query'],_0x437d82[_0xbab5('0x2c')]),_0xe118d5);if(_0x34bfc0['query'][_0xbab5('0x36')]){_0x16158b[_0xbab5('0x34')]=_[_0xbab5('0x37')](_0x16158b[_0xbab5('0x34')],{'$or':_['map'](_0xe118d5,function(_0x346f9a){if(_0x346f9a[_0xbab5('0x29')]!==_0xbab5('0x38')){var _0x344bde={};_0x344bde[_0x346f9a[_0xbab5('0x25')]]={'$like':'%'+_0x34bfc0[_0xbab5('0x2b')][_0xbab5('0x36')]+'%'};return _0x344bde;}})});}_0x16158b=_[_0xbab5('0x37')]({},_0x16158b,_0x34bfc0[_0xbab5('0x39')]);var _0x5a762a={'where':_0x16158b[_0xbab5('0x34')]};return db['SugarcrmConfiguration'][_0xbab5('0x1d')](_0x5a762a)[_0xbab5('0x3a')](function(_0x1f360a){_0x578d4a[_0xbab5('0x1d')]=_0x1f360a;if(_0x34bfc0[_0xbab5('0x2b')][_0xbab5('0x3b')]){_0x16158b[_0xbab5('0x3c')]=[{'all':!![]}];}return db[_0xbab5('0x3d')][_0xbab5('0x3e')](_0x16158b);})[_0xbab5('0x3a')](function(_0x195e1e){_0x578d4a[_0xbab5('0x3f')]=_0x195e1e;return _0x578d4a;})[_0xbab5('0x3a')](respondWithFilteredResult(_0x4fa819,_0x16158b))['catch'](handleError(_0x4fa819,null));};exports[_0xbab5('0x40')]=function(_0x36de10,_0x56f2c7){var _0x19df4f={'raw':![],'where':{'id':_0x36de10[_0xbab5('0x41')]['id']}},_0x4a4ace={};_0x4a4ace[_0xbab5('0x2a')]=_[_0xbab5('0x42')](db[_0xbab5('0x3d')]['rawAttributes']);_0x4a4ace[_0xbab5('0x2b')]=_[_0xbab5('0x42')](_0x36de10[_0xbab5('0x2b')]);_0x4a4ace[_0xbab5('0x2c')]=_[_0xbab5('0x2d')](_0x4a4ace[_0xbab5('0x2a')],_0x4a4ace[_0xbab5('0x2b')]);_0x19df4f[_0xbab5('0x2e')]=_[_0xbab5('0x2d')](_0x4a4ace[_0xbab5('0x2a')],qs['fields'](_0x36de10[_0xbab5('0x2b')][_0xbab5('0x2f')]));_0x19df4f[_0xbab5('0x2e')]=_0x19df4f[_0xbab5('0x2e')][_0xbab5('0x43')]?_0x19df4f[_0xbab5('0x2e')]:_0x4a4ace[_0xbab5('0x2a')];if(_0x36de10[_0xbab5('0x2b')]['includeAll']){_0x19df4f[_0xbab5('0x3c')]=[{'all':!![]}];}_0x19df4f=_[_0xbab5('0x37')]({},_0x19df4f,_0x36de10[_0xbab5('0x39')]);return db[_0xbab5('0x3d')][_0xbab5('0x44')](_0x19df4f)[_0xbab5('0x3a')](handleEntityNotFound(_0x56f2c7,null))[_0xbab5('0x3a')](respondWithResult(_0x56f2c7,null))[_0xbab5('0x45')](handleError(_0x56f2c7,null));};exports[_0xbab5('0x46')]=function(_0xf79cba,_0x307d5b){return db['SugarcrmConfiguration'][_0xbab5('0x46')](_0xf79cba[_0xbab5('0x47')],{})[_0xbab5('0x3a')](respondWithResult(_0x307d5b,0xc9))[_0xbab5('0x45')](handleError(_0x307d5b,null));};exports[_0xbab5('0x22')]=function(_0x3f53b2,_0x1711a1){if(_0x3f53b2[_0xbab5('0x47')]['id']){delete _0x3f53b2[_0xbab5('0x47')]['id'];}return db['SugarcrmConfiguration'][_0xbab5('0x44')]({'where':{'id':_0x3f53b2[_0xbab5('0x41')]['id']}})[_0xbab5('0x3a')](handleEntityNotFound(_0x1711a1,null))[_0xbab5('0x3a')](saveUpdates(_0x3f53b2['body'],null))[_0xbab5('0x3a')](respondWithResult(_0x1711a1,null))[_0xbab5('0x45')](handleError(_0x1711a1,null));};exports[_0xbab5('0x23')]=function(_0xd53bae,_0x51f51e){return db[_0xbab5('0x3d')][_0xbab5('0x44')]({'where':{'id':_0xd53bae[_0xbab5('0x41')]['id']}})[_0xbab5('0x3a')](handleEntityNotFound(_0x51f51e,null))[_0xbab5('0x3a')](removeEntity(_0x51f51e,null))[_0xbab5('0x45')](handleError(_0x51f51e,null));};exports['getFields']=function(_0x5ad510,_0x20be61,_0xc48c6c){var _0x345371={};var _0x54c0ca={};var _0x324c96;var _0x5025fe;return db[_0xbab5('0x3d')][_0xbab5('0x48')]({'where':{'id':_0x5ad510[_0xbab5('0x41')]['id']}})[_0xbab5('0x3a')](handleEntityNotFound(_0x20be61,null))[_0xbab5('0x3a')](function(_0x3bb43a){if(_0x3bb43a){_0x324c96=_0x3bb43a;_0x54c0ca['model']=_[_0xbab5('0x42')](db[_0xbab5('0x49')]['rawAttributes']);_0x54c0ca[_0xbab5('0x2b')]=_[_0xbab5('0x42')](_0x5ad510[_0xbab5('0x2b')]);_0x54c0ca[_0xbab5('0x2c')]=_['intersection'](_0x54c0ca[_0xbab5('0x2a')],_0x54c0ca[_0xbab5('0x2b')]);_0x345371[_0xbab5('0x2e')]=_[_0xbab5('0x2d')](_0x54c0ca[_0xbab5('0x2a')],qs['fields'](_0x5ad510[_0xbab5('0x2b')]['fields']));_0x345371[_0xbab5('0x2e')]=_0x345371[_0xbab5('0x2e')]['length']?_0x345371['attributes']:_0x54c0ca[_0xbab5('0x2a')];_0x345371[_0xbab5('0x32')]=qs['sort'](_0x5ad510[_0xbab5('0x2b')][_0xbab5('0x33')]);_0x345371[_0xbab5('0x34')]=qs['filters'](_[_0xbab5('0x35')](_0x5ad510['query'],_0x54c0ca['filters']));if(_0x5ad510[_0xbab5('0x2b')][_0xbab5('0x36')]){_0x345371[_0xbab5('0x34')]=_[_0xbab5('0x37')](_0x345371[_0xbab5('0x34')],{'$or':_[_0xbab5('0x27')](_0x345371[_0xbab5('0x2e')],function(_0x57723b){var _0x381ffd={};_0x381ffd[_0x57723b]={'$like':'%'+_0x5ad510[_0xbab5('0x2b')][_0xbab5('0x36')]+'%'};return _0x381ffd;})});}_0x345371=_['merge']({},_0x345371,_0x5ad510[_0xbab5('0x39')]);return _0x324c96[_0xbab5('0x4a')](_0x345371);}})[_0xbab5('0x3a')](function(_0x9dc518){if(_0x9dc518){_0x5025fe=_0x9dc518['length'];if(!_0x5ad510['query'][_0xbab5('0x4b')](_0xbab5('0x30'))){_0x345371[_0xbab5('0x1e')]=qs[_0xbab5('0x1e')](_0x5ad510[_0xbab5('0x2b')][_0xbab5('0x1e')]);_0x345371['offset']=qs[_0xbab5('0x31')](_0x5ad510[_0xbab5('0x2b')]['offset']);}return _0x324c96[_0xbab5('0x4a')](_0x345371);}})[_0xbab5('0x3a')](function(_0x5751bf){if(_0x5751bf){return _0x5751bf?{'count':_0x5025fe,'rows':_0x5751bf}:null;}})[_0xbab5('0x3a')](respondWithResult(_0x20be61,null))[_0xbab5('0x45')](handleError(_0x20be61,null));};exports[_0xbab5('0x4c')]=function(_0x14e035,_0x282e6d,_0xd534e8){var _0x2d9c22={};var _0x4913d2={};var _0x1b9dd8;var _0x3eee93;return db[_0xbab5('0x3d')][_0xbab5('0x48')]({'where':{'id':_0x14e035['params']['id']}})[_0xbab5('0x3a')](handleEntityNotFound(_0x282e6d,null))[_0xbab5('0x3a')](function(_0x18e744){if(_0x18e744){_0x1b9dd8=_0x18e744;_0x4913d2[_0xbab5('0x2a')]=_[_0xbab5('0x42')](db[_0xbab5('0x49')][_0xbab5('0x4d')]);_0x4913d2['query']=_['keys'](_0x14e035['query']);_0x4913d2[_0xbab5('0x2c')]=_[_0xbab5('0x2d')](_0x4913d2[_0xbab5('0x2a')],_0x4913d2['query']);_0x2d9c22['attributes']=_[_0xbab5('0x2d')](_0x4913d2[_0xbab5('0x2a')],qs[_0xbab5('0x2f')](_0x14e035[_0xbab5('0x2b')][_0xbab5('0x2f')]));_0x2d9c22['attributes']=_0x2d9c22[_0xbab5('0x2e')]['length']?_0x2d9c22[_0xbab5('0x2e')]:_0x4913d2['model'];_0x2d9c22[_0xbab5('0x32')]=qs[_0xbab5('0x33')](_0x14e035[_0xbab5('0x2b')]['sort']);_0x2d9c22[_0xbab5('0x34')]=qs[_0xbab5('0x2c')](_[_0xbab5('0x35')](_0x14e035[_0xbab5('0x2b')],_0x4913d2['filters']));if(_0x14e035[_0xbab5('0x2b')]['filter']){_0x2d9c22['where']=_[_0xbab5('0x37')](_0x2d9c22[_0xbab5('0x34')],{'$or':_[_0xbab5('0x27')](_0x2d9c22[_0xbab5('0x2e')],function(_0x54c265){var _0x209994={};_0x209994[_0x54c265]={'$like':'%'+_0x14e035['query'][_0xbab5('0x36')]+'%'};return _0x209994;})});}_0x2d9c22=_['merge']({},_0x2d9c22,_0x14e035[_0xbab5('0x39')]);return _0x1b9dd8[_0xbab5('0x4c')](_0x2d9c22);}})['then'](function(_0x409ad3){if(_0x409ad3){_0x3eee93=_0x409ad3['length'];if(!_0x14e035[_0xbab5('0x2b')][_0xbab5('0x4b')](_0xbab5('0x30'))){_0x2d9c22[_0xbab5('0x1e')]=qs[_0xbab5('0x1e')](_0x14e035[_0xbab5('0x2b')]['limit']);_0x2d9c22['offset']=qs['offset'](_0x14e035[_0xbab5('0x2b')]['offset']);}return _0x1b9dd8[_0xbab5('0x4c')](_0x2d9c22);}})[_0xbab5('0x3a')](function(_0x475620){if(_0x475620){return _0x475620?{'count':_0x3eee93,'rows':_0x475620}:null;}})[_0xbab5('0x3a')](respondWithResult(_0x282e6d,null))[_0xbab5('0x45')](handleError(_0x282e6d,null));};exports[_0xbab5('0x4e')]=function(_0x26e8e6,_0x3d6f2b,_0x1b9289){var _0xa72572={};var _0x49ce3c={};var _0x164614;var _0xc3d15;return db[_0xbab5('0x3d')][_0xbab5('0x48')]({'where':{'id':_0x26e8e6['params']['id']}})[_0xbab5('0x3a')](handleEntityNotFound(_0x3d6f2b,null))[_0xbab5('0x3a')](function(_0x383193){if(_0x383193){_0x164614=_0x383193;_0x49ce3c[_0xbab5('0x2a')]=_[_0xbab5('0x42')](db[_0xbab5('0x49')]['rawAttributes']);_0x49ce3c[_0xbab5('0x2b')]=_[_0xbab5('0x42')](_0x26e8e6['query']);_0x49ce3c['filters']=_[_0xbab5('0x2d')](_0x49ce3c[_0xbab5('0x2a')],_0x49ce3c['query']);_0xa72572[_0xbab5('0x2e')]=_[_0xbab5('0x2d')](_0x49ce3c[_0xbab5('0x2a')],qs[_0xbab5('0x2f')](_0x26e8e6['query'][_0xbab5('0x2f')]));_0xa72572[_0xbab5('0x2e')]=_0xa72572['attributes']['length']?_0xa72572[_0xbab5('0x2e')]:_0x49ce3c['model'];_0xa72572[_0xbab5('0x32')]=qs['sort'](_0x26e8e6[_0xbab5('0x2b')]['sort']);_0xa72572[_0xbab5('0x34')]=qs[_0xbab5('0x2c')](_[_0xbab5('0x35')](_0x26e8e6['query'],_0x49ce3c['filters']));if(_0x26e8e6[_0xbab5('0x2b')][_0xbab5('0x36')]){_0xa72572[_0xbab5('0x34')]=_[_0xbab5('0x37')](_0xa72572[_0xbab5('0x34')],{'$or':_[_0xbab5('0x27')](_0xa72572['attributes'],function(_0x4d9ae7){var _0x57324a={};_0x57324a[_0x4d9ae7]={'$like':'%'+_0x26e8e6[_0xbab5('0x2b')][_0xbab5('0x36')]+'%'};return _0x57324a;})});}_0xa72572=_[_0xbab5('0x37')]({},_0xa72572,_0x26e8e6[_0xbab5('0x39')]);return _0x164614[_0xbab5('0x4e')](_0xa72572);}})[_0xbab5('0x3a')](function(_0x1a8fd3){if(_0x1a8fd3){_0xc3d15=_0x1a8fd3['length'];if(!_0x26e8e6['query']['hasOwnProperty']('nolimit')){_0xa72572[_0xbab5('0x1e')]=qs[_0xbab5('0x1e')](_0x26e8e6[_0xbab5('0x2b')][_0xbab5('0x1e')]);_0xa72572[_0xbab5('0x31')]=qs[_0xbab5('0x31')](_0x26e8e6[_0xbab5('0x2b')][_0xbab5('0x31')]);}return _0x164614[_0xbab5('0x4e')](_0xa72572);}})[_0xbab5('0x3a')](function(_0x17d130){if(_0x17d130){return _0x17d130?{'count':_0xc3d15,'rows':_0x17d130}:null;}})[_0xbab5('0x3a')](respondWithResult(_0x3d6f2b,null))[_0xbab5('0x45')](handleError(_0x3d6f2b,null));};
\ No newline at end of file
index 969746a..51a826d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa3f=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0xfa3f,0xb0));var _0xffa3=function(_0x3f0fce,_0x47a1b1){_0x3f0fce=_0x3f0fce-0x0;var _0x39b20a=_0xfa3f[_0x3f0fce];return _0x39b20a;};'use strict';var _=require(_0xffa3('0x0'));var util=require('util');var logger=require(_0xffa3('0x1'))(_0xffa3('0x2'));var moment=require('moment');var BPromise=require(_0xffa3('0x3'));var rp=require(_0xffa3('0x4'));var fs=require('fs');var path=require(_0xffa3('0x5'));var rimraf=require('rimraf');var config=require(_0xffa3('0x6'));var attributes=require(_0xffa3('0x7'));module[_0xffa3('0x8')]=function(_0x538359,_0xc54814){return _0x538359['define'](_0xffa3('0x9'),attributes,{'tableName':_0xffa3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf4c=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','util','../../config/logger','api','request-promise'];(function(_0x37d379,_0x2646d1){var _0x101168=function(_0x4d5c52){while(--_0x4d5c52){_0x37d379['push'](_0x37d379['shift']());}};_0x101168(++_0x2646d1);}(_0xaf4c,0xf9));var _0xcaf4=function(_0x4e9b35,_0x386e17){_0x4e9b35=_0x4e9b35-0x0;var _0x343fe1=_0xaf4c[_0x4e9b35];return _0x343fe1;};'use strict';var _=require('lodash');var util=require(_0xcaf4('0x0'));var logger=require(_0xcaf4('0x1'))(_0xcaf4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcaf4('0x3'));var fs=require('fs');var path=require(_0xcaf4('0x4'));var rimraf=require(_0xcaf4('0x5'));var config=require(_0xcaf4('0x6'));var attributes=require(_0xcaf4('0x7'));module[_0xcaf4('0x8')]=function(_0x5d7243,_0xad1465){return _0x5d7243[_0xcaf4('0x9')](_0xcaf4('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9c0cfff..8fc080c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa244=['info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x5822a6,_0xaf45ef){var _0x1cb200=function(_0x54834f){while(--_0x54834f){_0x5822a6['push'](_0x5822a6['shift']());}};_0x1cb200(++_0xaf45ef);}(_0xa244,0x1a8));var _0x4a24=function(_0x5a3169,_0xf62d84){_0x5a3169=_0x5a3169-0x0;var _0x3524a3=_0xa244[_0x5a3169];return _0x3524a3;};'use strict';var _=require(_0x4a24('0x0'));var util=require(_0x4a24('0x1'));var moment=require('moment');var BPromise=require(_0x4a24('0x2'));var rs=require(_0x4a24('0x3'));var fs=require('fs');var Redis=require(_0x4a24('0x4'));var db=require(_0x4a24('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a24('0x6'))(_0x4a24('0x7'));var config=require(_0x4a24('0x8'));var jayson=require(_0x4a24('0x9'));var client=jayson['client'][_0x4a24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37ce58,_0x740e0f,_0x33a355){return new BPromise(function(_0xf6ad16,_0x1f0649){return client[_0x4a24('0xb')](_0x37ce58,_0x33a355)[_0x4a24('0xc')](function(_0x5f59e2){logger[_0x4a24('0xd')](_0x4a24('0xe'),_0x740e0f,_0x4a24('0xf'));logger[_0x4a24('0x10')](_0x4a24('0x11'),_0x740e0f,'request\x20sent',JSON[_0x4a24('0x12')](_0x5f59e2));if(_0x5f59e2[_0x4a24('0x13')]){if(_0x5f59e2['error'][_0x4a24('0x14')]===0x1f4){logger[_0x4a24('0x13')](_0x4a24('0xe'),_0x740e0f,_0x5f59e2['error'][_0x4a24('0x15')]);return _0x1f0649(_0x5f59e2[_0x4a24('0x13')][_0x4a24('0x15')]);}logger[_0x4a24('0x13')](_0x4a24('0xe'),_0x740e0f,_0x5f59e2['error'][_0x4a24('0x15')]);return _0xf6ad16(_0x5f59e2[_0x4a24('0x13')]['message']);}else{logger[_0x4a24('0xd')](_0x4a24('0xe'),_0x740e0f,_0x4a24('0xf'));_0xf6ad16(_0x5f59e2['result'][_0x4a24('0x15')]);}})[_0x4a24('0x16')](function(_0x1d4c95){logger['error'](_0x4a24('0xe'),_0x740e0f,_0x1d4c95);_0x1f0649(_0x1d4c95);});});}
\ No newline at end of file
+var _0x9845=['debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x335f5c,_0xce622c){var _0x27458c=function(_0x108b7f){while(--_0x108b7f){_0x335f5c['push'](_0x335f5c['shift']());}};_0x27458c(++_0xce622c);}(_0x9845,0xc0));var _0x5984=function(_0xc6489d,_0x27d8d6){_0xc6489d=_0xc6489d-0x0;var _0x53618d=_0x9845[_0xc6489d];return _0x53618d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5984('0x0'));var BPromise=require(_0x5984('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5984('0x2'));var db=require(_0x5984('0x3'))['db'];var utils=require(_0x5984('0x4'));var logger=require(_0x5984('0x5'))(_0x5984('0x6'));var config=require(_0x5984('0x7'));var jayson=require(_0x5984('0x8'));var client=jayson[_0x5984('0x9')][_0x5984('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x94b725,_0x8d811c,_0x3b158d){return new BPromise(function(_0x157fcb,_0x4225b1){return client[_0x5984('0xb')](_0x94b725,_0x3b158d)['then'](function(_0x4bf902){logger[_0x5984('0xc')](_0x5984('0xd'),_0x8d811c,_0x5984('0xe'));logger[_0x5984('0xf')](_0x5984('0x10'),_0x8d811c,'request\x20sent',JSON[_0x5984('0x11')](_0x4bf902));if(_0x4bf902[_0x5984('0x12')]){if(_0x4bf902[_0x5984('0x12')][_0x5984('0x13')]===0x1f4){logger[_0x5984('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x8d811c,_0x4bf902[_0x5984('0x12')][_0x5984('0x14')]);return _0x4225b1(_0x4bf902[_0x5984('0x12')]['message']);}logger[_0x5984('0x12')](_0x5984('0xd'),_0x8d811c,_0x4bf902[_0x5984('0x12')][_0x5984('0x14')]);return _0x157fcb(_0x4bf902[_0x5984('0x12')][_0x5984('0x14')]);}else{logger[_0x5984('0xc')](_0x5984('0xd'),_0x8d811c,_0x5984('0xe'));_0x157fcb(_0x4bf902[_0x5984('0x15')][_0x5984('0x14')]);}})[_0x5984('0x16')](function(_0x4df9c1){logger[_0x5984('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x8d811c,_0x4df9c1);_0x4225b1(_0x4df9c1);});});}
\ No newline at end of file
index 9d16585..df7232e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d49=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy'];(function(_0x39b243,_0x54161f){var _0x26a069=function(_0x3e198f){while(--_0x3e198f){_0x39b243['push'](_0x39b243['shift']());}};_0x26a069(++_0x54161f);}(_0x1d49,0xbe));var _0x91d4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1d49[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x91d4('0x0'));var util=require(_0x91d4('0x1'));var path=require(_0x91d4('0x2'));var timeout=require(_0x91d4('0x3'));var express=require(_0x91d4('0x4'));var router=express[_0x91d4('0x5')]();var fs_extra=require(_0x91d4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x91d4('0x7'));var config=require(_0x91d4('0x8'));var controller=require(_0x91d4('0x9'));router[_0x91d4('0xa')]('/',auth[_0x91d4('0xb')](),controller[_0x91d4('0xc')]);router[_0x91d4('0xa')]('/:id',auth[_0x91d4('0xb')](),controller[_0x91d4('0xd')]);router[_0x91d4('0xe')]('/',auth['isAuthenticated'](),controller[_0x91d4('0xf')]);router['put'](_0x91d4('0x10'),auth[_0x91d4('0xb')](),controller[_0x91d4('0x11')]);router[_0x91d4('0x12')](_0x91d4('0x10'),auth[_0x91d4('0xb')](),controller[_0x91d4('0x13')]);module[_0x91d4('0x14')]=router;
\ No newline at end of file
+var _0x5258=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x1f77b0,_0x44e4e7){var _0xcefa51=function(_0x2194d1){while(--_0x2194d1){_0x1f77b0['push'](_0x1f77b0['shift']());}};_0xcefa51(++_0x44e4e7);}(_0x5258,0x95));var _0x8525=function(_0x48e645,_0x53cc57){_0x48e645=_0x48e645-0x0;var _0x2902f5=_0x5258[_0x48e645];return _0x2902f5;};'use strict';var multer=require(_0x8525('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8525('0x1'));var express=require(_0x8525('0x2'));var router=express[_0x8525('0x3')]();var fs_extra=require(_0x8525('0x4'));var auth=require(_0x8525('0x5'));var interaction=require(_0x8525('0x6'));var config=require('../../config/environment');var controller=require(_0x8525('0x7'));router[_0x8525('0x8')]('/',auth[_0x8525('0x9')](),controller[_0x8525('0xa')]);router[_0x8525('0x8')](_0x8525('0xb'),auth[_0x8525('0x9')](),controller[_0x8525('0xc')]);router[_0x8525('0xd')]('/',auth[_0x8525('0x9')](),controller['create']);router[_0x8525('0xe')](_0x8525('0xb'),auth[_0x8525('0x9')](),controller[_0x8525('0xf')]);router[_0x8525('0x10')](_0x8525('0xb'),auth[_0x8525('0x9')](),controller[_0x8525('0x11')]);module[_0x8525('0x12')]=router;
\ No newline at end of file
index 59e883f..f509a13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32c4=['string','STRING','BOOLEAN','sequelize','exports','variable','customVariable','keyValue','picklist','ENUM'];(function(_0x1cc1dd,_0x5a117b){var _0x5a5fbe=function(_0x438b23){while(--_0x438b23){_0x1cc1dd['push'](_0x1cc1dd['shift']());}};_0x5a5fbe(++_0x5a117b);}(_0x32c4,0x107));var _0x432c=function(_0x3a9e52,_0x4eafac){_0x3a9e52=_0x3a9e52-0x0;var _0x51e798=_0x32c4[_0x3a9e52];return _0x51e798;};'use strict';var Sequelize=require(_0x432c('0x0'));module[_0x432c('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x432c('0x2'),_0x432c('0x3'),_0x432c('0x4'),_0x432c('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x432c('0x6')](_0x432c('0x7'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x432c('0x8')]},'customField':{'type':Sequelize[_0x432c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x432c('0x8')]}};
\ No newline at end of file
+var _0xd839=['picklist','string','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','variable','keyValue'];(function(_0x498c9a,_0x43cd7f){var _0x63ef27=function(_0x7f9370){while(--_0x7f9370){_0x498c9a['push'](_0x498c9a['shift']());}};_0x63ef27(++_0x43cd7f);}(_0xd839,0x18c));var _0x9d83=function(_0x5c20e1,_0x816b03){_0x5c20e1=_0x5c20e1-0x0;var _0x1bb153=_0xd839[_0x5c20e1];return _0x1bb153;};'use strict';var Sequelize=require(_0x9d83('0x0'));module[_0x9d83('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x9d83('0x2'),'customVariable',_0x9d83('0x3'),_0x9d83('0x4')),'defaultValue':_0x9d83('0x5')},'content':{'type':Sequelize[_0x9d83('0x6')]},'key':{'type':Sequelize[_0x9d83('0x6')]},'keyType':{'type':Sequelize[_0x9d83('0x7')]('string',_0x9d83('0x2'),_0x9d83('0x8'))},'keyContent':{'type':Sequelize[_0x9d83('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9d83('0x6')]},'customField':{'type':Sequelize[_0x9d83('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9d83('0x6')]}};
\ No newline at end of file
index 332f682..3c80a24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7f6=['count','set','Content-Range','json','apply','save','update','then','destroy','name','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xf7f6,0xbe));var _0x6f7f=function(_0x1ccfb3,_0x14ff2b){_0x1ccfb3=_0x1ccfb3-0x0;var _0x3aef91=_0xf7f6[_0x1ccfb3];return _0x3aef91;};'use strict';var emlformat=require(_0x6f7f('0x0'));var rimraf=require(_0x6f7f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6f7f('0x2'));var moment=require(_0x6f7f('0x3'));var BPromise=require(_0x6f7f('0x4'));var Mustache=require(_0x6f7f('0x5'));var util=require(_0x6f7f('0x6'));var path=require(_0x6f7f('0x7'));var sox=require(_0x6f7f('0x8'));var csv=require(_0x6f7f('0x9'));var ejs=require(_0x6f7f('0xa'));var fs=require('fs');var fs_extra=require(_0x6f7f('0xb'));var _=require(_0x6f7f('0xc'));var squel=require(_0x6f7f('0xd'));var crypto=require(_0x6f7f('0xe'));var jsforce=require(_0x6f7f('0xf'));var deskjs=require(_0x6f7f('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6f7f('0x11'));var Papa=require(_0x6f7f('0x12'));var Redis=require(_0x6f7f('0x13'));var authService=require(_0x6f7f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6f7f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6f7f('0x16'));var config=require(_0x6f7f('0x17'));var licenseUtil=require(_0x6f7f('0x18'));var db=require(_0x6f7f('0x19'))['db'];function respondWithStatusCode(_0xf26944,_0x4626df){_0x4626df=_0x4626df||0xcc;return function(_0x351c42){if(_0x351c42){return _0xf26944[_0x6f7f('0x1a')](_0x4626df);}return _0xf26944[_0x6f7f('0x1b')](_0x4626df)[_0x6f7f('0x1c')]();};}function respondWithResult(_0x8738d4,_0x322b54){_0x322b54=_0x322b54||0xc8;return function(_0x1ce601){if(_0x1ce601){return _0x8738d4[_0x6f7f('0x1b')](_0x322b54)['json'](_0x1ce601);}};}function respondWithFilteredResult(_0x48fcdc,_0x138991){return function(_0x404714){if(_0x404714){var _0x6cdbac=typeof _0x138991[_0x6f7f('0x1d')]==='undefined'&&typeof _0x138991[_0x6f7f('0x1e')]===_0x6f7f('0x1f');var _0x1f3c6a=_0x404714[_0x6f7f('0x20')];var _0xbbc84b=_0x6cdbac?0x0:_0x138991['offset'];var _0x2e834e=_0x6cdbac?_0x404714[_0x6f7f('0x20')]:_0x138991[_0x6f7f('0x1d')]+_0x138991['limit'];var _0x4fe811;if(_0x2e834e>=_0x1f3c6a){_0x2e834e=_0x1f3c6a;_0x4fe811=0xc8;}else{_0x4fe811=0xce;}_0x48fcdc[_0x6f7f('0x1b')](_0x4fe811);return _0x48fcdc[_0x6f7f('0x21')](_0x6f7f('0x22'),_0xbbc84b+'-'+_0x2e834e+'/'+_0x1f3c6a)[_0x6f7f('0x23')](_0x404714);}return null;};}function patchUpdates(_0xe7bd0e){return function(_0x166ad4){try{jsonpatch[_0x6f7f('0x24')](_0x166ad4,_0xe7bd0e,!![]);}catch(_0x1eff7e){return BPromise['reject'](_0x1eff7e);}return _0x166ad4[_0x6f7f('0x25')]();};}function saveUpdates(_0x284571,_0x3c3cfd){return function(_0x5ada92){if(_0x5ada92){return _0x5ada92[_0x6f7f('0x26')](_0x284571)[_0x6f7f('0x27')](function(_0xcd19ac){return _0xcd19ac;});}return null;};}function removeEntity(_0x5e2e01,_0x2c23b6){return function(_0x5a0b45){if(_0x5a0b45){return _0x5a0b45[_0x6f7f('0x28')]()[_0x6f7f('0x27')](function(){_0x5e2e01['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19facc,_0x4cd7f3){return function(_0x1a8ea2){if(!_0x1a8ea2){_0x19facc[_0x6f7f('0x1a')](0x194);}return _0x1a8ea2;};}function handleError(_0x3372cd,_0xdf65b9){_0xdf65b9=_0xdf65b9||0x1f4;return function(_0x422ca8){logger['error'](_0x422ca8['stack']);if(_0x422ca8['name']){delete _0x422ca8[_0x6f7f('0x29')];}_0x3372cd[_0x6f7f('0x1b')](_0xdf65b9)['send'](_0x422ca8);};}exports[_0x6f7f('0x2a')]=function(_0x4d12b0,_0x240257){var _0x156e73={},_0x3d13d3={},_0x4fd1a8={'count':0x0,'rows':[]};var _0x238af5=_[_0x6f7f('0x2b')](db[_0x6f7f('0x2c')][_0x6f7f('0x2d')],function(_0x23278c){return{'name':_0x23278c[_0x6f7f('0x2e')],'type':_0x23278c[_0x6f7f('0x2f')][_0x6f7f('0x30')]};});_0x3d13d3[_0x6f7f('0x31')]=_[_0x6f7f('0x2b')](_0x238af5,_0x6f7f('0x29'));_0x3d13d3[_0x6f7f('0x32')]=_[_0x6f7f('0x33')](_0x4d12b0[_0x6f7f('0x32')]);_0x3d13d3[_0x6f7f('0x34')]=_[_0x6f7f('0x35')](_0x3d13d3[_0x6f7f('0x31')],_0x3d13d3[_0x6f7f('0x32')]);_0x156e73[_0x6f7f('0x36')]=_[_0x6f7f('0x35')](_0x3d13d3['model'],qs[_0x6f7f('0x37')](_0x4d12b0['query'][_0x6f7f('0x37')]));_0x156e73[_0x6f7f('0x36')]=_0x156e73['attributes'][_0x6f7f('0x38')]?_0x156e73['attributes']:_0x3d13d3['model'];if(!_0x4d12b0['query']['hasOwnProperty'](_0x6f7f('0x39'))){_0x156e73[_0x6f7f('0x1e')]=qs[_0x6f7f('0x1e')](_0x4d12b0[_0x6f7f('0x32')][_0x6f7f('0x1e')]);_0x156e73[_0x6f7f('0x1d')]=qs[_0x6f7f('0x1d')](_0x4d12b0['query'][_0x6f7f('0x1d')]);}_0x156e73['order']=qs[_0x6f7f('0x3a')](_0x4d12b0[_0x6f7f('0x32')][_0x6f7f('0x3a')]);_0x156e73[_0x6f7f('0x3b')]=qs[_0x6f7f('0x34')](_[_0x6f7f('0x3c')](_0x4d12b0[_0x6f7f('0x32')],_0x3d13d3[_0x6f7f('0x34')]),_0x238af5);if(_0x4d12b0[_0x6f7f('0x32')][_0x6f7f('0x3d')]){_0x156e73[_0x6f7f('0x3b')]=_['merge'](_0x156e73['where'],{'$or':_[_0x6f7f('0x2b')](_0x238af5,function(_0x5cc388){if(_0x5cc388[_0x6f7f('0x2f')]!=='VIRTUAL'){var _0x565686={};_0x565686[_0x5cc388[_0x6f7f('0x29')]]={'$like':'%'+_0x4d12b0[_0x6f7f('0x32')][_0x6f7f('0x3d')]+'%'};return _0x565686;}})});}_0x156e73=_[_0x6f7f('0x3e')]({},_0x156e73,_0x4d12b0[_0x6f7f('0x3f')]);var _0x7b6ffe={'where':_0x156e73[_0x6f7f('0x3b')]};return db[_0x6f7f('0x2c')][_0x6f7f('0x20')](_0x7b6ffe)[_0x6f7f('0x27')](function(_0x6b486b){_0x4fd1a8[_0x6f7f('0x20')]=_0x6b486b;if(_0x4d12b0[_0x6f7f('0x32')]['includeAll']){_0x156e73[_0x6f7f('0x40')]=[{'all':!![]}];}return db['SugarcrmField'][_0x6f7f('0x41')](_0x156e73);})[_0x6f7f('0x27')](function(_0x6e904a){_0x4fd1a8[_0x6f7f('0x42')]=_0x6e904a;return _0x4fd1a8;})[_0x6f7f('0x27')](respondWithFilteredResult(_0x240257,_0x156e73))[_0x6f7f('0x43')](handleError(_0x240257,null));};exports[_0x6f7f('0x44')]=function(_0x28f975,_0x372d84){var _0x96f8e8={'raw':!![],'where':{'id':_0x28f975[_0x6f7f('0x45')]['id']}},_0x417a42={};_0x417a42[_0x6f7f('0x31')]=_[_0x6f7f('0x33')](db[_0x6f7f('0x2c')]['rawAttributes']);_0x417a42[_0x6f7f('0x32')]=_[_0x6f7f('0x33')](_0x28f975['query']);_0x417a42['filters']=_['intersection'](_0x417a42[_0x6f7f('0x31')],_0x417a42[_0x6f7f('0x32')]);_0x96f8e8[_0x6f7f('0x36')]=_[_0x6f7f('0x35')](_0x417a42[_0x6f7f('0x31')],qs[_0x6f7f('0x37')](_0x28f975[_0x6f7f('0x32')][_0x6f7f('0x37')]));_0x96f8e8[_0x6f7f('0x36')]=_0x96f8e8[_0x6f7f('0x36')]['length']?_0x96f8e8['attributes']:_0x417a42[_0x6f7f('0x31')];if(_0x28f975[_0x6f7f('0x32')][_0x6f7f('0x46')]){_0x96f8e8[_0x6f7f('0x40')]=[{'all':!![]}];}_0x96f8e8=_['merge']({},_0x96f8e8,_0x28f975['options']);return db['SugarcrmField'][_0x6f7f('0x47')](_0x96f8e8)[_0x6f7f('0x27')](handleEntityNotFound(_0x372d84,null))['then'](respondWithResult(_0x372d84,null))['catch'](handleError(_0x372d84,null));};exports['create']=function(_0x263b14,_0x1ffee6){return db[_0x6f7f('0x2c')][_0x6f7f('0x48')](_0x263b14['body'],{})[_0x6f7f('0x27')](respondWithResult(_0x1ffee6,0xc9))[_0x6f7f('0x43')](handleError(_0x1ffee6,null));};exports[_0x6f7f('0x26')]=function(_0x14c81a,_0x208681){if(_0x14c81a[_0x6f7f('0x49')]['id']){delete _0x14c81a['body']['id'];}return db[_0x6f7f('0x2c')][_0x6f7f('0x47')]({'where':{'id':_0x14c81a[_0x6f7f('0x45')]['id']}})['then'](handleEntityNotFound(_0x208681,null))[_0x6f7f('0x27')](saveUpdates(_0x14c81a[_0x6f7f('0x49')],null))[_0x6f7f('0x27')](respondWithResult(_0x208681,null))[_0x6f7f('0x43')](handleError(_0x208681,null));};exports[_0x6f7f('0x28')]=function(_0x52191a,_0x4f3afd){return db['SugarcrmField'][_0x6f7f('0x47')]({'where':{'id':_0x52191a[_0x6f7f('0x45')]['id']}})[_0x6f7f('0x27')](handleEntityNotFound(_0x4f3afd,null))[_0x6f7f('0x27')](removeEntity(_0x4f3afd,null))[_0x6f7f('0x43')](handleError(_0x4f3afd,null));};
\ No newline at end of file
+var _0x5259=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','SugarcrmField','rawAttributes','type','map','keys','filters','intersection','model','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','eml-format','rimraf','zip-dir'];(function(_0x27b7be,_0x538e2d){var _0x1aa77e=function(_0x52a210){while(--_0x52a210){_0x27b7be['push'](_0x27b7be['shift']());}};_0x1aa77e(++_0x538e2d);}(_0x5259,0x1dd));var _0x9525=function(_0x3d3e03,_0x322473){_0x3d3e03=_0x3d3e03-0x0;var _0x2fb8a5=_0x5259[_0x3d3e03];return _0x2fb8a5;};'use strict';var emlformat=require(_0x9525('0x0'));var rimraf=require(_0x9525('0x1'));var zipdir=require(_0x9525('0x2'));var jsonpatch=require(_0x9525('0x3'));var rp=require(_0x9525('0x4'));var moment=require(_0x9525('0x5'));var BPromise=require(_0x9525('0x6'));var Mustache=require(_0x9525('0x7'));var util=require(_0x9525('0x8'));var path=require(_0x9525('0x9'));var sox=require(_0x9525('0xa'));var csv=require(_0x9525('0xb'));var ejs=require(_0x9525('0xc'));var fs=require('fs');var fs_extra=require(_0x9525('0xd'));var _=require(_0x9525('0xe'));var squel=require('squel');var crypto=require(_0x9525('0xf'));var jsforce=require(_0x9525('0x10'));var deskjs=require(_0x9525('0x11'));var toCsv=require(_0x9525('0xb'));var querystring=require(_0x9525('0x12'));var Papa=require(_0x9525('0x13'));var Redis=require('ioredis');var authService=require(_0x9525('0x14'));var qs=require(_0x9525('0x15'));var as=require(_0x9525('0x16'));var hardwareService=require(_0x9525('0x17'));var logger=require(_0x9525('0x18'))(_0x9525('0x19'));var utils=require(_0x9525('0x1a'));var config=require(_0x9525('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x9525('0x1c'))['db'];function respondWithStatusCode(_0x54b2da,_0x1761be){_0x1761be=_0x1761be||0xcc;return function(_0x5c1720){if(_0x5c1720){return _0x54b2da[_0x9525('0x1d')](_0x1761be);}return _0x54b2da[_0x9525('0x1e')](_0x1761be)[_0x9525('0x1f')]();};}function respondWithResult(_0x22932f,_0x2010b1){_0x2010b1=_0x2010b1||0xc8;return function(_0x5a6202){if(_0x5a6202){return _0x22932f['status'](_0x2010b1)[_0x9525('0x20')](_0x5a6202);}};}function respondWithFilteredResult(_0x334b5d,_0x46ebfc){return function(_0x18d115){if(_0x18d115){var _0x445801=typeof _0x46ebfc[_0x9525('0x21')]===_0x9525('0x22')&&typeof _0x46ebfc[_0x9525('0x23')]===_0x9525('0x22');var _0x465868=_0x18d115[_0x9525('0x24')];var _0x8e163=_0x445801?0x0:_0x46ebfc[_0x9525('0x21')];var _0x43ef5e=_0x445801?_0x18d115['count']:_0x46ebfc['offset']+_0x46ebfc['limit'];var _0x4c1567;if(_0x43ef5e>=_0x465868){_0x43ef5e=_0x465868;_0x4c1567=0xc8;}else{_0x4c1567=0xce;}_0x334b5d['status'](_0x4c1567);return _0x334b5d[_0x9525('0x25')](_0x9525('0x26'),_0x8e163+'-'+_0x43ef5e+'/'+_0x465868)[_0x9525('0x20')](_0x18d115);}return null;};}function patchUpdates(_0x5955b1){return function(_0xfb42a7){try{jsonpatch[_0x9525('0x27')](_0xfb42a7,_0x5955b1,!![]);}catch(_0x409d2e){return BPromise[_0x9525('0x28')](_0x409d2e);}return _0xfb42a7[_0x9525('0x29')]();};}function saveUpdates(_0x511410,_0x53e3c7){return function(_0x3d6df3){if(_0x3d6df3){return _0x3d6df3[_0x9525('0x2a')](_0x511410)['then'](function(_0x305db0){return _0x305db0;});}return null;};}function removeEntity(_0x40c880,_0x1bca11){return function(_0x3bf19e){if(_0x3bf19e){return _0x3bf19e[_0x9525('0x2b')]()['then'](function(){_0x40c880[_0x9525('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16c22d,_0x1de07f){return function(_0x1b628f){if(!_0x1b628f){_0x16c22d[_0x9525('0x1d')](0x194);}return _0x1b628f;};}function handleError(_0xfb9c5f,_0x2a3e77){_0x2a3e77=_0x2a3e77||0x1f4;return function(_0x20fa19){logger[_0x9525('0x2c')](_0x20fa19[_0x9525('0x2d')]);if(_0x20fa19['name']){delete _0x20fa19[_0x9525('0x2e')];}_0xfb9c5f[_0x9525('0x1e')](_0x2a3e77)[_0x9525('0x2f')](_0x20fa19);};}exports['index']=function(_0x5b2ecb,_0x395581){var _0x9872ad={},_0x28d1f2={},_0x31826f={'count':0x0,'rows':[]};var _0x1abe7a=_['map'](db[_0x9525('0x30')][_0x9525('0x31')],function(_0x41bce5){return{'name':_0x41bce5['fieldName'],'type':_0x41bce5[_0x9525('0x32')]['key']};});_0x28d1f2['model']=_[_0x9525('0x33')](_0x1abe7a,_0x9525('0x2e'));_0x28d1f2['query']=_[_0x9525('0x34')](_0x5b2ecb['query']);_0x28d1f2[_0x9525('0x35')]=_[_0x9525('0x36')](_0x28d1f2[_0x9525('0x37')],_0x28d1f2[_0x9525('0x38')]);_0x9872ad['attributes']=_[_0x9525('0x36')](_0x28d1f2[_0x9525('0x37')],qs[_0x9525('0x39')](_0x5b2ecb[_0x9525('0x38')][_0x9525('0x39')]));_0x9872ad['attributes']=_0x9872ad[_0x9525('0x3a')][_0x9525('0x3b')]?_0x9872ad['attributes']:_0x28d1f2[_0x9525('0x37')];if(!_0x5b2ecb[_0x9525('0x38')]['hasOwnProperty'](_0x9525('0x3c'))){_0x9872ad['limit']=qs[_0x9525('0x23')](_0x5b2ecb['query'][_0x9525('0x23')]);_0x9872ad[_0x9525('0x21')]=qs[_0x9525('0x21')](_0x5b2ecb[_0x9525('0x38')]['offset']);}_0x9872ad[_0x9525('0x3d')]=qs[_0x9525('0x3e')](_0x5b2ecb[_0x9525('0x38')][_0x9525('0x3e')]);_0x9872ad[_0x9525('0x3f')]=qs['filters'](_[_0x9525('0x40')](_0x5b2ecb['query'],_0x28d1f2[_0x9525('0x35')]),_0x1abe7a);if(_0x5b2ecb[_0x9525('0x38')][_0x9525('0x41')]){_0x9872ad[_0x9525('0x3f')]=_[_0x9525('0x42')](_0x9872ad[_0x9525('0x3f')],{'$or':_[_0x9525('0x33')](_0x1abe7a,function(_0x2c1655){if(_0x2c1655[_0x9525('0x32')]!==_0x9525('0x43')){var _0x1e9330={};_0x1e9330[_0x2c1655[_0x9525('0x2e')]]={'$like':'%'+_0x5b2ecb[_0x9525('0x38')][_0x9525('0x41')]+'%'};return _0x1e9330;}})});}_0x9872ad=_['merge']({},_0x9872ad,_0x5b2ecb['options']);var _0x5acccf={'where':_0x9872ad[_0x9525('0x3f')]};return db[_0x9525('0x30')]['count'](_0x5acccf)[_0x9525('0x44')](function(_0x408728){_0x31826f[_0x9525('0x24')]=_0x408728;if(_0x5b2ecb['query']['includeAll']){_0x9872ad[_0x9525('0x45')]=[{'all':!![]}];}return db[_0x9525('0x30')][_0x9525('0x46')](_0x9872ad);})[_0x9525('0x44')](function(_0x4f3d5c){_0x31826f[_0x9525('0x47')]=_0x4f3d5c;return _0x31826f;})[_0x9525('0x44')](respondWithFilteredResult(_0x395581,_0x9872ad))[_0x9525('0x48')](handleError(_0x395581,null));};exports[_0x9525('0x49')]=function(_0x49df84,_0x2aef99){var _0x396b61={'raw':!![],'where':{'id':_0x49df84[_0x9525('0x4a')]['id']}},_0x23a93d={};_0x23a93d[_0x9525('0x37')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x23a93d[_0x9525('0x38')]=_[_0x9525('0x34')](_0x49df84['query']);_0x23a93d['filters']=_[_0x9525('0x36')](_0x23a93d['model'],_0x23a93d[_0x9525('0x38')]);_0x396b61[_0x9525('0x3a')]=_['intersection'](_0x23a93d[_0x9525('0x37')],qs[_0x9525('0x39')](_0x49df84[_0x9525('0x38')]['fields']));_0x396b61['attributes']=_0x396b61[_0x9525('0x3a')][_0x9525('0x3b')]?_0x396b61[_0x9525('0x3a')]:_0x23a93d[_0x9525('0x37')];if(_0x49df84[_0x9525('0x38')][_0x9525('0x4b')]){_0x396b61[_0x9525('0x45')]=[{'all':!![]}];}_0x396b61=_[_0x9525('0x42')]({},_0x396b61,_0x49df84[_0x9525('0x4c')]);return db[_0x9525('0x30')][_0x9525('0x4d')](_0x396b61)[_0x9525('0x44')](handleEntityNotFound(_0x2aef99,null))[_0x9525('0x44')](respondWithResult(_0x2aef99,null))['catch'](handleError(_0x2aef99,null));};exports['create']=function(_0x3dd684,_0x440a58){return db[_0x9525('0x30')][_0x9525('0x4e')](_0x3dd684[_0x9525('0x4f')],{})[_0x9525('0x44')](respondWithResult(_0x440a58,0xc9))[_0x9525('0x48')](handleError(_0x440a58,null));};exports['update']=function(_0x28ad91,_0x4a8d6d){if(_0x28ad91[_0x9525('0x4f')]['id']){delete _0x28ad91[_0x9525('0x4f')]['id'];}return db['SugarcrmField'][_0x9525('0x4d')]({'where':{'id':_0x28ad91[_0x9525('0x4a')]['id']}})[_0x9525('0x44')](handleEntityNotFound(_0x4a8d6d,null))['then'](saveUpdates(_0x28ad91[_0x9525('0x4f')],null))['then'](respondWithResult(_0x4a8d6d,null))['catch'](handleError(_0x4a8d6d,null));};exports[_0x9525('0x2b')]=function(_0x17dacd,_0x31c2de){return db[_0x9525('0x30')][_0x9525('0x4d')]({'where':{'id':_0x17dacd[_0x9525('0x4a')]['id']}})[_0x9525('0x44')](handleEntityNotFound(_0x31c2de,null))['then'](removeEntity(_0x31c2de,null))[_0x9525('0x48')](handleError(_0x31c2de,null));};
\ No newline at end of file
index 58bc2ce..4b896e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20f5=['moment','request-promise','rimraf','./intSugarcrmField.attributes','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x4c574c,_0x3407ee){var _0x96c388=function(_0x33b334){while(--_0x33b334){_0x4c574c['push'](_0x4c574c['shift']());}};_0x96c388(++_0x3407ee);}(_0x20f5,0x1c0));var _0x520f=function(_0x31f5cb,_0x977fc5){_0x31f5cb=_0x31f5cb-0x0;var _0xbeddc3=_0x20f5[_0x31f5cb];return _0xbeddc3;};'use strict';var _=require(_0x520f('0x0'));var util=require(_0x520f('0x1'));var logger=require(_0x520f('0x2'))('api');var moment=require(_0x520f('0x3'));var BPromise=require('bluebird');var rp=require(_0x520f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x520f('0x5'));var config=require('../../config/environment');var attributes=require(_0x520f('0x6'));module['exports']=function(_0x3dd734,_0x3262a5){return _0x3dd734['define'](_0x520f('0x7'),attributes,{'tableName':_0x520f('0x8'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x520f('0x9'),_0x520f('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf99e=['moment','bluebird','request-promise','path','./intSugarcrmField.attributes','int_sugarcrm_fields','FieldId','util','../../config/logger','api'];(function(_0xa2c58f,_0x2ea843){var _0x40fc92=function(_0x24c36e){while(--_0x24c36e){_0xa2c58f['push'](_0xa2c58f['shift']());}};_0x40fc92(++_0x2ea843);}(_0xf99e,0x115));var _0xef99=function(_0x3d43ce,_0x433f16){_0x3d43ce=_0x3d43ce-0x0;var _0x5069e8=_0xf99e[_0x3d43ce];return _0x5069e8;};'use strict';var _=require('lodash');var util=require(_0xef99('0x0'));var logger=require(_0xef99('0x1'))(_0xef99('0x2'));var moment=require(_0xef99('0x3'));var BPromise=require(_0xef99('0x4'));var rp=require(_0xef99('0x5'));var fs=require('fs');var path=require(_0xef99('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xef99('0x7'));module['exports']=function(_0x411856,_0xbdcb23){return _0x411856['define']('SugarcrmField',attributes,{'tableName':_0xef99('0x8'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xef99('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 96e2efd..865bc4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb74d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb74d,0x1a2));var _0xdb74=function(_0x3df9dd,_0x26f5cd){_0x3df9dd=_0x3df9dd-0x0;var _0x4f11e4=_0xb74d[_0x3df9dd];return _0x4f11e4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdb74('0x0'));var BPromise=require(_0xdb74('0x1'));var rs=require(_0xdb74('0x2'));var fs=require('fs');var Redis=require(_0xdb74('0x3'));var db=require(_0xdb74('0x4'))['db'];var utils=require(_0xdb74('0x5'));var logger=require(_0xdb74('0x6'))(_0xdb74('0x7'));var config=require('../../config/environment');var jayson=require(_0xdb74('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x495512,_0x9d6c41,_0x1ff0b0){return new BPromise(function(_0x5ca7e7,_0x512e76){return client[_0xdb74('0x9')](_0x495512,_0x1ff0b0)['then'](function(_0x16c5af){logger[_0xdb74('0xa')](_0xdb74('0xb'),_0x9d6c41,'request\x20sent');logger[_0xdb74('0xc')](_0xdb74('0xd'),_0x9d6c41,_0xdb74('0xe'),JSON[_0xdb74('0xf')](_0x16c5af));if(_0x16c5af[_0xdb74('0x10')]){if(_0x16c5af[_0xdb74('0x10')]['code']===0x1f4){logger[_0xdb74('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x9d6c41,_0x16c5af[_0xdb74('0x10')][_0xdb74('0x11')]);return _0x512e76(_0x16c5af[_0xdb74('0x10')][_0xdb74('0x11')]);}logger[_0xdb74('0x10')](_0xdb74('0xb'),_0x9d6c41,_0x16c5af['error'][_0xdb74('0x11')]);return _0x5ca7e7(_0x16c5af[_0xdb74('0x10')][_0xdb74('0x11')]);}else{logger['info'](_0xdb74('0xb'),_0x9d6c41,_0xdb74('0xe'));_0x5ca7e7(_0x16c5af[_0xdb74('0x12')][_0xdb74('0x11')]);}})['catch'](function(_0x20b140){logger[_0xdb74('0x10')](_0xdb74('0xb'),_0x9d6c41,_0x20b140);_0x512e76(_0x20b140);});});}
\ No newline at end of file
+var _0x16f9=['request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http'];(function(_0x366553,_0x20eecc){var _0x52871d=function(_0x2d91e1){while(--_0x2d91e1){_0x366553['push'](_0x366553['shift']());}};_0x52871d(++_0x20eecc);}(_0x16f9,0x10f));var _0x916f=function(_0x3a0260,_0x89bb1){_0x3a0260=_0x3a0260-0x0;var _0x319e58=_0x16f9[_0x3a0260];return _0x319e58;};'use strict';var _=require(_0x916f('0x0'));var util=require(_0x916f('0x1'));var moment=require('moment');var BPromise=require(_0x916f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x916f('0x3'));var db=require(_0x916f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x916f('0x5'))(_0x916f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x916f('0x7')][_0x916f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2df043,_0x26b8a5,_0x5d407c){return new BPromise(function(_0x379943,_0x350d03){return client[_0x916f('0x9')](_0x2df043,_0x5d407c)[_0x916f('0xa')](function(_0x3a936e){logger[_0x916f('0xb')](_0x916f('0xc'),_0x26b8a5,_0x916f('0xd'));logger[_0x916f('0xe')](_0x916f('0xf'),_0x26b8a5,_0x916f('0xd'),JSON['stringify'](_0x3a936e));if(_0x3a936e[_0x916f('0x10')]){if(_0x3a936e[_0x916f('0x10')]['code']===0x1f4){logger[_0x916f('0x10')](_0x916f('0xc'),_0x26b8a5,_0x3a936e['error'][_0x916f('0x11')]);return _0x350d03(_0x3a936e['error'][_0x916f('0x11')]);}logger['error'](_0x916f('0xc'),_0x26b8a5,_0x3a936e[_0x916f('0x10')][_0x916f('0x11')]);return _0x379943(_0x3a936e[_0x916f('0x10')]['message']);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x26b8a5,'request\x20sent');_0x379943(_0x3a936e[_0x916f('0x12')][_0x916f('0x11')]);}})[_0x916f('0x13')](function(_0x5d179e){logger[_0x916f('0x10')](_0x916f('0xc'),_0x26b8a5,_0x5d179e);_0x350d03(_0x5d179e);});});}
\ No newline at end of file
index 052fbe6..53c1a44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18d6=['isAuthenticated','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0x18d6,0x166));var _0x618d=function(_0x5dc56b,_0x55f871){_0x5dc56b=_0x5dc56b-0x0;var _0x22f1fe=_0x18d6[_0x5dc56b];return _0x22f1fe;};'use strict';var multer=require(_0x618d('0x0'));var util=require(_0x618d('0x1'));var path=require('path');var timeout=require(_0x618d('0x2'));var express=require(_0x618d('0x3'));var router=express[_0x618d('0x4')]();var fs_extra=require(_0x618d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x618d('0x6'));var config=require(_0x618d('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x618d('0x8')]('/',auth['isAuthenticated'](),controller[_0x618d('0x9')]);router[_0x618d('0x8')]('/:id',auth[_0x618d('0xa')](),controller[_0x618d('0xb')]);router[_0x618d('0x8')](_0x618d('0xc'),auth[_0x618d('0xa')](),controller[_0x618d('0xd')]);router[_0x618d('0x8')]('/:id/fields',auth[_0x618d('0xa')](),controller[_0x618d('0xe')]);router['post']('/',auth[_0x618d('0xa')](),controller[_0x618d('0xf')]);router[_0x618d('0x10')](_0x618d('0xc'),auth[_0x618d('0xa')](),controller[_0x618d('0x11')]);router[_0x618d('0x12')](_0x618d('0x13'),auth[_0x618d('0xa')](),controller[_0x618d('0x14')]);router['delete']('/:id',auth[_0x618d('0xa')](),controller[_0x618d('0x15')]);module[_0x618d('0x16')]=router;
\ No newline at end of file
+var _0xa7b4=['Router','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','destroy','exports','util','path','express'];(function(_0xf37794,_0x4f62b9){var _0x3c08ca=function(_0x1479af){while(--_0x1479af){_0xf37794['push'](_0xf37794['shift']());}};_0x3c08ca(++_0x4f62b9);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x430a54,_0x1912b){_0x430a54=_0x430a54-0x0;var _0x50e04f=_0xa7b4[_0x430a54];return _0x50e04f;};'use strict';var multer=require('multer');var util=require(_0x4a7b('0x0'));var path=require(_0x4a7b('0x1'));var timeout=require('connect-timeout');var express=require(_0x4a7b('0x2'));var router=express[_0x4a7b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4a7b('0x4'));var controller=require(_0x4a7b('0x5'));router['get']('/',auth[_0x4a7b('0x6')](),controller[_0x4a7b('0x7')]);router[_0x4a7b('0x8')](_0x4a7b('0x9'),auth[_0x4a7b('0x6')](),controller[_0x4a7b('0xa')]);router[_0x4a7b('0x8')](_0x4a7b('0xb'),auth[_0x4a7b('0x6')](),controller[_0x4a7b('0xc')]);router[_0x4a7b('0x8')](_0x4a7b('0xd'),auth[_0x4a7b('0x6')](),controller['getFields']);router[_0x4a7b('0xe')]('/',auth['isAuthenticated'](),controller[_0x4a7b('0xf')]);router[_0x4a7b('0xe')](_0x4a7b('0xb'),auth[_0x4a7b('0x6')](),controller['addConfiguration']);router['put'](_0x4a7b('0x9'),auth[_0x4a7b('0x6')](),controller['update']);router['delete'](_0x4a7b('0x9'),auth[_0x4a7b('0x6')](),controller[_0x4a7b('0x10')]);module[_0x4a7b('0x11')]=router;
\ No newline at end of file
index bdcddc7..78b62a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2846=['STRING','sequelize','exports'];(function(_0x23db51,_0x177dea){var _0x4bfa5a=function(_0x5ee2ff){while(--_0x5ee2ff){_0x23db51['push'](_0x23db51['shift']());}};_0x4bfa5a(++_0x177dea);}(_0x2846,0x19f));var _0x6284=function(_0x5124be,_0x20765a){_0x5124be=_0x5124be-0x0;var _0x5580d7=_0x2846[_0x5124be];return _0x5580d7;};'use strict';var Sequelize=require(_0x6284('0x0'));module[_0x6284('0x1')]={'name':{'type':Sequelize[_0x6284('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6284('0x2')]},'username':{'type':Sequelize[_0x6284('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6284('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x6284('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6284('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x6284('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x6391=['HelpDesk','sequelize','STRING'];(function(_0x3c2ed9,_0x6b0e96){var _0x303040=function(_0x5d44f4){while(--_0x5d44f4){_0x3c2ed9['push'](_0x3c2ed9['shift']());}};_0x303040(++_0x6b0e96);}(_0x6391,0x1d8));var _0x1639=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x6391[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x1639('0x0'));module['exports']={'name':{'type':Sequelize[_0x1639('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1639('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1639('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x1639('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x1639('0x1')],'allowNull':![]}};
\ No newline at end of file
index 91aa5c2..b6039ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1530=['reference','owner','remove','editable','false','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','VtigerAccount','rawAttributes','type','key','model','map','keys','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','update','params','getConfigurations','pick','length','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerConfiguration','VtigerField','md5','getFields','findOne','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','result','success'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1530,0x103));var _0x0153=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x1530[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0x0153('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0153('0x1'));var jsonpatch=require(_0x0153('0x2'));var rp=require(_0x0153('0x3'));var moment=require(_0x0153('0x4'));var BPromise=require(_0x0153('0x5'));var Mustache=require(_0x0153('0x6'));var util=require('util');var path=require(_0x0153('0x7'));var sox=require(_0x0153('0x8'));var csv=require('to-csv');var ejs=require(_0x0153('0x9'));var fs=require('fs');var fs_extra=require(_0x0153('0xa'));var _=require(_0x0153('0xb'));var squel=require(_0x0153('0xc'));var crypto=require('crypto');var jsforce=require(_0x0153('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0153('0xe'));var Papa=require(_0x0153('0xf'));var Redis=require(_0x0153('0x10'));var authService=require(_0x0153('0x11'));var qs=require(_0x0153('0x12'));var as=require(_0x0153('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0153('0x14'))(_0x0153('0x15'));var utils=require(_0x0153('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5bebb3,_0x508395){_0x508395=_0x508395||0xcc;return function(_0x3eaae9){if(_0x3eaae9){return _0x5bebb3[_0x0153('0x17')](_0x508395);}return _0x5bebb3[_0x0153('0x18')](_0x508395)['end']();};}function respondWithResult(_0x222477,_0x2b04c4){_0x2b04c4=_0x2b04c4||0xc8;return function(_0x179c57){if(_0x179c57){return _0x222477[_0x0153('0x18')](_0x2b04c4)[_0x0153('0x19')](_0x179c57);}};}function respondWithFilteredResult(_0xba5aec,_0x482da2){return function(_0x58b224){if(_0x58b224){var _0x1c646e=typeof _0x482da2[_0x0153('0x1a')]==='undefined'&&typeof _0x482da2[_0x0153('0x1b')]===_0x0153('0x1c');var _0x59675c=_0x58b224[_0x0153('0x1d')];var _0x47745b=_0x1c646e?0x0:_0x482da2['offset'];var _0x23f235=_0x1c646e?_0x58b224[_0x0153('0x1d')]:_0x482da2[_0x0153('0x1a')]+_0x482da2[_0x0153('0x1b')];var _0x258ff1;if(_0x23f235>=_0x59675c){_0x23f235=_0x59675c;_0x258ff1=0xc8;}else{_0x258ff1=0xce;}_0xba5aec['status'](_0x258ff1);return _0xba5aec[_0x0153('0x1e')](_0x0153('0x1f'),_0x47745b+'-'+_0x23f235+'/'+_0x59675c)[_0x0153('0x19')](_0x58b224);}return null;};}function patchUpdates(_0x5a978b){return function(_0x21469b){try{jsonpatch[_0x0153('0x20')](_0x21469b,_0x5a978b,!![]);}catch(_0x227d3e){return BPromise[_0x0153('0x21')](_0x227d3e);}return _0x21469b[_0x0153('0x22')]();};}function saveUpdates(_0x4df1a8,_0x1115be){return function(_0x583ced){if(_0x583ced){return _0x583ced['update'](_0x4df1a8)[_0x0153('0x23')](function(_0x55d07f){return _0x55d07f;});}return null;};}function removeEntity(_0x55b425,_0x24a28d){return function(_0x5d4b13){if(_0x5d4b13){return _0x5d4b13[_0x0153('0x24')]()[_0x0153('0x23')](function(){_0x55b425[_0x0153('0x18')](0xcc)[_0x0153('0x25')]();});}};}function handleEntityNotFound(_0x4d654e,_0x193b46){return function(_0x48fca0){if(!_0x48fca0){_0x4d654e[_0x0153('0x17')](0x194);}return _0x48fca0;};}function handleError(_0xed973b,_0x5808f3){_0x5808f3=_0x5808f3||0x1f4;return function(_0x523da2){logger[_0x0153('0x26')](_0x523da2[_0x0153('0x27')]);if(_0x523da2[_0x0153('0x28')]){delete _0x523da2['name'];}_0xed973b[_0x0153('0x18')](_0x5808f3)['send'](_0x523da2);};}exports[_0x0153('0x29')]=function(_0x21b96e,_0x5c2948){var _0x17fa7c={},_0x7ab2e={},_0x54b07a={'count':0x0,'rows':[]};var _0x5c00f6=_['map'](db[_0x0153('0x2a')][_0x0153('0x2b')],function(_0x35c73a){return{'name':_0x35c73a['fieldName'],'type':_0x35c73a[_0x0153('0x2c')][_0x0153('0x2d')]};});_0x7ab2e[_0x0153('0x2e')]=_[_0x0153('0x2f')](_0x5c00f6,_0x0153('0x28'));_0x7ab2e['query']=_[_0x0153('0x30')](_0x21b96e[_0x0153('0x31')]);_0x7ab2e['filters']=_[_0x0153('0x32')](_0x7ab2e[_0x0153('0x2e')],_0x7ab2e['query']);_0x17fa7c['attributes']=_[_0x0153('0x32')](_0x7ab2e[_0x0153('0x2e')],qs[_0x0153('0x33')](_0x21b96e['query'][_0x0153('0x33')]));_0x17fa7c[_0x0153('0x34')]=_0x17fa7c[_0x0153('0x34')]['length']?_0x17fa7c['attributes']:_0x7ab2e[_0x0153('0x2e')];if(!_0x21b96e['query'][_0x0153('0x35')]('nolimit')){_0x17fa7c[_0x0153('0x1b')]=qs[_0x0153('0x1b')](_0x21b96e['query']['limit']);_0x17fa7c['offset']=qs[_0x0153('0x1a')](_0x21b96e[_0x0153('0x31')][_0x0153('0x1a')]);}_0x17fa7c[_0x0153('0x36')]=qs['sort'](_0x21b96e['query'][_0x0153('0x37')]);_0x17fa7c[_0x0153('0x38')]=qs['filters'](_['pick'](_0x21b96e['query'],_0x7ab2e[_0x0153('0x39')]),_0x5c00f6);if(_0x21b96e[_0x0153('0x31')][_0x0153('0x3a')]){_0x17fa7c[_0x0153('0x38')]=_[_0x0153('0x3b')](_0x17fa7c[_0x0153('0x38')],{'$or':_[_0x0153('0x2f')](_0x5c00f6,function(_0x46a15c){if(_0x46a15c['type']!==_0x0153('0x3c')){var _0x2b65f1={};_0x2b65f1[_0x46a15c['name']]={'$like':'%'+_0x21b96e['query'][_0x0153('0x3a')]+'%'};return _0x2b65f1;}})});}_0x17fa7c=_[_0x0153('0x3b')]({},_0x17fa7c,_0x21b96e[_0x0153('0x3d')]);var _0x450890={'where':_0x17fa7c['where']};return db[_0x0153('0x2a')][_0x0153('0x1d')](_0x450890)[_0x0153('0x23')](function(_0x315caa){_0x54b07a['count']=_0x315caa;if(_0x21b96e[_0x0153('0x31')][_0x0153('0x3e')]){_0x17fa7c[_0x0153('0x3f')]=[{'all':!![]}];}return db[_0x0153('0x2a')]['findAll'](_0x17fa7c);})[_0x0153('0x23')](function(_0x29c183){_0x54b07a[_0x0153('0x40')]=_0x29c183;return _0x54b07a;})[_0x0153('0x23')](respondWithFilteredResult(_0x5c2948,_0x17fa7c))[_0x0153('0x41')](handleError(_0x5c2948,null));};exports[_0x0153('0x42')]=function(_0x576951,_0x2fc15a){var _0x3be4a7={'raw':![],'where':{'id':_0x576951['params']['id']}},_0x3c612a={};_0x3c612a[_0x0153('0x2e')]=_[_0x0153('0x30')](db['VtigerAccount'][_0x0153('0x2b')]);_0x3c612a[_0x0153('0x31')]=_[_0x0153('0x30')](_0x576951[_0x0153('0x31')]);_0x3c612a[_0x0153('0x39')]=_['intersection'](_0x3c612a[_0x0153('0x2e')],_0x3c612a[_0x0153('0x31')]);_0x3be4a7[_0x0153('0x34')]=_['intersection'](_0x3c612a[_0x0153('0x2e')],qs[_0x0153('0x33')](_0x576951[_0x0153('0x31')]['fields']));_0x3be4a7[_0x0153('0x34')]=_0x3be4a7['attributes']['length']?_0x3be4a7[_0x0153('0x34')]:_0x3c612a[_0x0153('0x2e')];if(_0x576951[_0x0153('0x31')]['includeAll']){_0x3be4a7['include']=[{'all':!![]}];}_0x3be4a7=_['merge']({},_0x3be4a7,_0x576951[_0x0153('0x3d')]);return db['VtigerAccount'][_0x0153('0x43')](_0x3be4a7)[_0x0153('0x23')](handleEntityNotFound(_0x2fc15a,null))[_0x0153('0x23')](respondWithResult(_0x2fc15a,null))['catch'](handleError(_0x2fc15a,null));};exports[_0x0153('0x44')]=function(_0x173dbd,_0x2bffa5){return db['VtigerAccount']['create'](_0x173dbd[_0x0153('0x45')],{})[_0x0153('0x23')](respondWithResult(_0x2bffa5,0xc9))[_0x0153('0x41')](handleError(_0x2bffa5,null));};exports[_0x0153('0x46')]=function(_0x3951fb,_0x4f1937){if(_0x3951fb[_0x0153('0x45')]['id']){delete _0x3951fb[_0x0153('0x45')]['id'];}return db['VtigerAccount'][_0x0153('0x43')]({'where':{'id':_0x3951fb[_0x0153('0x47')]['id']}})[_0x0153('0x23')](handleEntityNotFound(_0x4f1937,null))[_0x0153('0x23')](saveUpdates(_0x3951fb['body'],null))[_0x0153('0x23')](respondWithResult(_0x4f1937,null))[_0x0153('0x41')](handleError(_0x4f1937,null));};exports[_0x0153('0x24')]=function(_0x11e581,_0x31001b){return db[_0x0153('0x2a')][_0x0153('0x43')]({'where':{'id':_0x11e581[_0x0153('0x47')]['id']}})[_0x0153('0x23')](handleEntityNotFound(_0x31001b,null))[_0x0153('0x23')](removeEntity(_0x31001b,null))[_0x0153('0x41')](handleError(_0x31001b,null));};exports[_0x0153('0x48')]=function(_0x1ab991,_0x2aed9b,_0x1ebd71){var _0x51e322={};var _0x418f59={};var _0x47a6a4;var _0x47a0a9;return db[_0x0153('0x2a')]['findOne']({'where':{'id':_0x1ab991[_0x0153('0x47')]['id']}})[_0x0153('0x23')](handleEntityNotFound(_0x2aed9b,null))[_0x0153('0x23')](function(_0x584715){if(_0x584715){_0x47a6a4=_0x584715;_0x418f59[_0x0153('0x2e')]=_[_0x0153('0x30')](db['VtigerConfiguration'][_0x0153('0x2b')]);_0x418f59[_0x0153('0x31')]=_[_0x0153('0x30')](_0x1ab991[_0x0153('0x31')]);_0x418f59[_0x0153('0x39')]=_[_0x0153('0x32')](_0x418f59[_0x0153('0x2e')],_0x418f59[_0x0153('0x31')]);_0x51e322[_0x0153('0x34')]=_[_0x0153('0x32')](_0x418f59[_0x0153('0x2e')],qs[_0x0153('0x33')](_0x1ab991[_0x0153('0x31')][_0x0153('0x33')]));_0x51e322[_0x0153('0x34')]=_0x51e322['attributes']['length']?_0x51e322[_0x0153('0x34')]:_0x418f59[_0x0153('0x2e')];_0x51e322[_0x0153('0x36')]=qs['sort'](_0x1ab991[_0x0153('0x31')][_0x0153('0x37')]);_0x51e322[_0x0153('0x38')]=qs['filters'](_[_0x0153('0x49')](_0x1ab991['query'],_0x418f59['filters']));if(_0x1ab991['query']['filter']){_0x51e322['where']=_[_0x0153('0x3b')](_0x51e322[_0x0153('0x38')],{'$or':_['map'](_0x51e322[_0x0153('0x34')],function(_0x3925b4){var _0xe89215={};_0xe89215[_0x3925b4]={'$like':'%'+_0x1ab991['query'][_0x0153('0x3a')]+'%'};return _0xe89215;})});}_0x51e322=_['merge']({},_0x51e322,_0x1ab991[_0x0153('0x3d')]);return _0x47a6a4[_0x0153('0x48')](_0x51e322);}})[_0x0153('0x23')](function(_0x34f827){if(_0x34f827){_0x47a0a9=_0x34f827[_0x0153('0x4a')];if(!_0x1ab991['query'][_0x0153('0x35')](_0x0153('0x4b'))){_0x51e322[_0x0153('0x1b')]=qs['limit'](_0x1ab991[_0x0153('0x31')][_0x0153('0x1b')]);_0x51e322[_0x0153('0x1a')]=qs['offset'](_0x1ab991['query'][_0x0153('0x1a')]);}return _0x47a6a4[_0x0153('0x48')](_0x51e322);}})[_0x0153('0x23')](function(_0x2c45a2){if(_0x2c45a2){return _0x2c45a2?{'count':_0x47a0a9,'rows':_0x2c45a2}:null;}})[_0x0153('0x23')](respondWithResult(_0x2aed9b,null))['catch'](handleError(_0x2aed9b,null));};exports[_0x0153('0x4c')]=function(_0x2a771b,_0x3a8e97,_0xb61499){if(_0x2a771b[_0x0153('0x45')]['id']){delete _0x2a771b['body']['id'];}return db[_0x0153('0x2a')]['findOne']({'where':{'id':_0x2a771b[_0x0153('0x47')]['id']}})[_0x0153('0x23')](handleEntityNotFound(_0x3a8e97,null))[_0x0153('0x23')](function(_0x6ee472){if(_0x6ee472){_0x2a771b[_0x0153('0x45')][_0x0153('0x4d')]=_0x6ee472['id'];_0x2a771b['body'][_0x0153('0x4e')]=integrations[_0x0153('0x4f')](_0x2a771b[_0x0153('0x45')][_0x0153('0x50')],_0x2a771b[_0x0153('0x45')][_0x0153('0x2c')]);_0x2a771b['body'][_0x0153('0x51')]=integrations['getDescriptions'](_0x2a771b['body'][_0x0153('0x50')],_0x2a771b[_0x0153('0x45')]['type']);return db[_0x0153('0x52')][_0x0153('0x44')](_0x2a771b['body'],{'include':[{'model':db[_0x0153('0x53')],'as':_0x0153('0x4e')},{'model':db[_0x0153('0x53')],'as':_0x0153('0x51')}]});}return null;})[_0x0153('0x23')](respondWithResult(_0x3a8e97,null))[_0x0153('0x41')](handleError(_0x3a8e97,null));};var md5=require(_0x0153('0x54'));exports[_0x0153('0x55')]=function(_0x41a01d,_0x2c2d61,_0x5a704b){var _0x5f5289=null;var _0x35ce9e=null;var _0x1c6ac1=null;var _0x57b4ab=null;var _0x2ac761='';return db[_0x0153('0x2a')][_0x0153('0x56')]({'where':{'id':_0x41a01d[_0x0153('0x47')]['id']},'attributes':['id',_0x0153('0x28'),_0x0153('0x57'),_0x0153('0x58'),_0x0153('0x59'),_0x0153('0x5a'),_0x0153('0x5b'),_0x0153('0x5c')]})[_0x0153('0x23')](handleEntityNotFound(_0x2c2d61,null))[_0x0153('0x23')](function(_0x31d000){if(_0x31d000){_0x5f5289=_0x31d000[_0x0153('0x57')];_0x35ce9e=_0x31d000[_0x0153('0x5c')];_0x1c6ac1=_0x31d000['moduleName'];_0x2ac761=_0x31d000[_0x0153('0x5a')];var _0x495edf=_0x2ac761[_0x0153('0x5d')](-0x1);if(_0x495edf==='/'){_0x2ac761=_0x2ac761[_0x0153('0x5e')](0x0,_0x2ac761[_0x0153('0x5f')](_0x495edf));}_0x57b4ab=util[_0x0153('0x60')](_0x0153('0x61'),_0x2ac761);var _0x3d97d9={'method':_0x0153('0x62'),'uri':_0x57b4ab,'qs':{'operation':_0x0153('0x63'),'username':_0x31d000[_0x0153('0x57')]},'json':!![]};return rp(_0x3d97d9);}})[_0x0153('0x23')](function(_0x1a91a3){if(_0x1a91a3['success']){var _0xa8c391={'method':_0x0153('0x64'),'uri':_0x57b4ab,'form':{'operation':_0x0153('0x65'),'username':_0x5f5289,'accessKey':md5(_0x1a91a3[_0x0153('0x66')]['token']+_0x35ce9e)},'json':!![]};return rp(_0xa8c391);}})[_0x0153('0x23')](function(_0x25e692){if(_0x25e692[_0x0153('0x67')]){var _0x30fa5b={'method':_0x0153('0x62'),'uri':_0x57b4ab,'qs':{'operation':'describe','username':_0x5f5289,'sessionName':_0x25e692['result']['sessionName'],'elementType':_0x1c6ac1},'json':!![]};return rp(_0x30fa5b);}})[_0x0153('0x23')](function(_0x3d7aa6){if(_0x3d7aa6[_0x0153('0x67')]){var _0x507185=['autogenerated',_0x0153('0x68'),_0x0153('0x69')];_[_0x0153('0x6a')](_0x3d7aa6[_0x0153('0x66')][_0x0153('0x33')],function(_0x23d1df){return _0x507185['includes'](_0x23d1df['type']['name']);});_[_0x0153('0x6a')](_0x3d7aa6[_0x0153('0x66')][_0x0153('0x33')],function(_0x503537){return _0x503537[_0x0153('0x6b')]===_0x0153('0x6c');});return{'count':_0x3d7aa6[_0x0153('0x66')][_0x0153('0x33')]['length'],'rows':_[_0x0153('0x2f')](_0x3d7aa6[_0x0153('0x66')][_0x0153('0x33')],function(_0x63335b){return{'id':_0x63335b[_0x0153('0x28')],'name':_0x63335b[_0x0153('0x6d')],'custom':_[_0x0153('0x6e')](_0x63335b[_0x0153('0x28')],_0x0153('0x6f'))?!![]:![],'options':_0x63335b[_0x0153('0x2c')][_0x0153('0x28')]===_0x0153('0x70')&&_0x63335b['type'][_0x0153('0x71')][_0x0153('0x4a')]>0x0?_[_0x0153('0x2f')](_0x63335b[_0x0153('0x2c')]['picklistValues'],function(_0x3da488){return{'name':_0x3da488['label'],'value':_0x3da488[_0x0153('0x72')]};}):[]};})};}})[_0x0153('0x23')](respondWithResult(_0x2c2d61,null))[_0x0153('0x41')](function(_0x30ec8a){console['log'](_0x0153('0x73')+_0x30ec8a);var _0x46b056=_0x41a01d[_0x0153('0x31')][_0x0153('0x74')]?0x1f4:_0x30ec8a[_0x0153('0x75')]||0x1f4;logger[_0x0153('0x26')](_0x0153('0x76'),_0x0153('0x55'),_0x46b056,JSON[_0x0153('0x77')](_0x30ec8a));delete _0x30ec8a['name'];if(_0x46b056===0x191){_0x46b056=0x190;}_0x2c2d61['status'](_0x46b056)['send'](_0x41a01d['query']['test']?{'message':_0x0153('0x78'),'statusCode':_0x30ec8a[_0x0153('0x75')]}:_0x30ec8a);});};
\ No newline at end of file
+var _0xdea4=['update','body','find','findOne','VtigerConfiguration','order','getConfigurations','addConfiguration','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','moduleName','remoteUri','serverUrl','accessKey','username','slice','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','describe','result','sessionName','autogenerated','reference','owner','remove','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','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','sendStatus','status','json','offset','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','nolimit','limit','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','VtigerAccount','includeAll','include','rows','params','create','catch'];(function(_0x4da5fc,_0xbb90b7){var _0x38cb55=function(_0x54483c){while(--_0x54483c){_0x4da5fc['push'](_0x4da5fc['shift']());}};_0x38cb55(++_0xbb90b7);}(_0xdea4,0x11a));var _0x4dea=function(_0x25dd30,_0x32672b){_0x25dd30=_0x25dd30-0x0;var _0x54c3a3=_0xdea4[_0x25dd30];return _0x54c3a3;};'use strict';var emlformat=require(_0x4dea('0x0'));var rimraf=require(_0x4dea('0x1'));var zipdir=require(_0x4dea('0x2'));var jsonpatch=require(_0x4dea('0x3'));var rp=require(_0x4dea('0x4'));var moment=require(_0x4dea('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4dea('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4dea('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4dea('0x8'));var _=require(_0x4dea('0x9'));var squel=require(_0x4dea('0xa'));var crypto=require('crypto');var jsforce=require(_0x4dea('0xb'));var deskjs=require(_0x4dea('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4dea('0xd'));var Papa=require(_0x4dea('0xe'));var Redis=require(_0x4dea('0xf'));var authService=require(_0x4dea('0x10'));var qs=require(_0x4dea('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4dea('0x12'));var logger=require(_0x4dea('0x13'))(_0x4dea('0x14'));var utils=require(_0x4dea('0x15'));var config=require(_0x4dea('0x16'));var licenseUtil=require(_0x4dea('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5e4e7a,_0x254628){_0x254628=_0x254628||0xcc;return function(_0x5c45a9){if(_0x5c45a9){return _0x5e4e7a[_0x4dea('0x18')](_0x254628);}return _0x5e4e7a[_0x4dea('0x19')](_0x254628)['end']();};}function respondWithResult(_0x34d273,_0x5f3a36){_0x5f3a36=_0x5f3a36||0xc8;return function(_0x12aa36){if(_0x12aa36){return _0x34d273[_0x4dea('0x19')](_0x5f3a36)[_0x4dea('0x1a')](_0x12aa36);}};}function respondWithFilteredResult(_0x57c874,_0x10a169){return function(_0x26ae07){if(_0x26ae07){var _0x56d20c=typeof _0x10a169[_0x4dea('0x1b')]==='undefined'&&typeof _0x10a169['limit']==='undefined';var _0xa87869=_0x26ae07[_0x4dea('0x1c')];var _0x44cb19=_0x56d20c?0x0:_0x10a169['offset'];var _0x2f0817=_0x56d20c?_0x26ae07[_0x4dea('0x1c')]:_0x10a169[_0x4dea('0x1b')]+_0x10a169['limit'];var _0xc271bf;if(_0x2f0817>=_0xa87869){_0x2f0817=_0xa87869;_0xc271bf=0xc8;}else{_0xc271bf=0xce;}_0x57c874['status'](_0xc271bf);return _0x57c874[_0x4dea('0x1d')](_0x4dea('0x1e'),_0x44cb19+'-'+_0x2f0817+'/'+_0xa87869)[_0x4dea('0x1a')](_0x26ae07);}return null;};}function patchUpdates(_0x33d17e){return function(_0x31d94c){try{jsonpatch[_0x4dea('0x1f')](_0x31d94c,_0x33d17e,!![]);}catch(_0x1b1096){return BPromise[_0x4dea('0x20')](_0x1b1096);}return _0x31d94c['save']();};}function saveUpdates(_0x30288a,_0x58f858){return function(_0x522117){if(_0x522117){return _0x522117['update'](_0x30288a)[_0x4dea('0x21')](function(_0x63331c){return _0x63331c;});}return null;};}function removeEntity(_0x4606f6,_0x3e2219){return function(_0x563f30){if(_0x563f30){return _0x563f30[_0x4dea('0x22')]()[_0x4dea('0x21')](function(){_0x4606f6['status'](0xcc)[_0x4dea('0x23')]();});}};}function handleEntityNotFound(_0x4ac07b,_0x96779f){return function(_0xec399f){if(!_0xec399f){_0x4ac07b['sendStatus'](0x194);}return _0xec399f;};}function handleError(_0xdb7831,_0x640f9e){_0x640f9e=_0x640f9e||0x1f4;return function(_0x58df2d){logger[_0x4dea('0x24')](_0x58df2d[_0x4dea('0x25')]);if(_0x58df2d[_0x4dea('0x26')]){delete _0x58df2d[_0x4dea('0x26')];}_0xdb7831[_0x4dea('0x19')](_0x640f9e)[_0x4dea('0x27')](_0x58df2d);};}exports['index']=function(_0x6e356b,_0x4cf5f4){var _0x50b8a7={},_0x49fe25={},_0x166ecd={'count':0x0,'rows':[]};var _0x5c24a1=_[_0x4dea('0x28')](db['VtigerAccount'][_0x4dea('0x29')],function(_0x2aac99){return{'name':_0x2aac99[_0x4dea('0x2a')],'type':_0x2aac99['type'][_0x4dea('0x2b')]};});_0x49fe25[_0x4dea('0x2c')]=_['map'](_0x5c24a1,_0x4dea('0x26'));_0x49fe25[_0x4dea('0x2d')]=_[_0x4dea('0x2e')](_0x6e356b[_0x4dea('0x2d')]);_0x49fe25['filters']=_['intersection'](_0x49fe25[_0x4dea('0x2c')],_0x49fe25['query']);_0x50b8a7[_0x4dea('0x2f')]=_[_0x4dea('0x30')](_0x49fe25[_0x4dea('0x2c')],qs[_0x4dea('0x31')](_0x6e356b[_0x4dea('0x2d')][_0x4dea('0x31')]));_0x50b8a7[_0x4dea('0x2f')]=_0x50b8a7[_0x4dea('0x2f')][_0x4dea('0x32')]?_0x50b8a7[_0x4dea('0x2f')]:_0x49fe25['model'];if(!_0x6e356b[_0x4dea('0x2d')]['hasOwnProperty'](_0x4dea('0x33'))){_0x50b8a7[_0x4dea('0x34')]=qs[_0x4dea('0x34')](_0x6e356b[_0x4dea('0x2d')][_0x4dea('0x34')]);_0x50b8a7[_0x4dea('0x1b')]=qs['offset'](_0x6e356b[_0x4dea('0x2d')]['offset']);}_0x50b8a7['order']=qs[_0x4dea('0x35')](_0x6e356b['query']['sort']);_0x50b8a7['where']=qs[_0x4dea('0x36')](_[_0x4dea('0x37')](_0x6e356b[_0x4dea('0x2d')],_0x49fe25[_0x4dea('0x36')]),_0x5c24a1);if(_0x6e356b['query'][_0x4dea('0x38')]){_0x50b8a7[_0x4dea('0x39')]=_[_0x4dea('0x3a')](_0x50b8a7[_0x4dea('0x39')],{'$or':_[_0x4dea('0x28')](_0x5c24a1,function(_0x167f93){if(_0x167f93[_0x4dea('0x3b')]!==_0x4dea('0x3c')){var _0x11fab0={};_0x11fab0[_0x167f93[_0x4dea('0x26')]]={'$like':'%'+_0x6e356b['query'][_0x4dea('0x38')]+'%'};return _0x11fab0;}})});}_0x50b8a7=_[_0x4dea('0x3a')]({},_0x50b8a7,_0x6e356b[_0x4dea('0x3d')]);var _0x258632={'where':_0x50b8a7[_0x4dea('0x39')]};return db[_0x4dea('0x3e')][_0x4dea('0x1c')](_0x258632)[_0x4dea('0x21')](function(_0x331d73){_0x166ecd['count']=_0x331d73;if(_0x6e356b[_0x4dea('0x2d')][_0x4dea('0x3f')]){_0x50b8a7[_0x4dea('0x40')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x50b8a7);})[_0x4dea('0x21')](function(_0x2fcab9){_0x166ecd[_0x4dea('0x41')]=_0x2fcab9;return _0x166ecd;})[_0x4dea('0x21')](respondWithFilteredResult(_0x4cf5f4,_0x50b8a7))['catch'](handleError(_0x4cf5f4,null));};exports['show']=function(_0x52ea90,_0x8bfcef){var _0x2adfbe={'raw':![],'where':{'id':_0x52ea90[_0x4dea('0x42')]['id']}},_0x1823af={};_0x1823af[_0x4dea('0x2c')]=_[_0x4dea('0x2e')](db[_0x4dea('0x3e')]['rawAttributes']);_0x1823af[_0x4dea('0x2d')]=_[_0x4dea('0x2e')](_0x52ea90['query']);_0x1823af[_0x4dea('0x36')]=_[_0x4dea('0x30')](_0x1823af[_0x4dea('0x2c')],_0x1823af['query']);_0x2adfbe[_0x4dea('0x2f')]=_[_0x4dea('0x30')](_0x1823af[_0x4dea('0x2c')],qs[_0x4dea('0x31')](_0x52ea90[_0x4dea('0x2d')][_0x4dea('0x31')]));_0x2adfbe[_0x4dea('0x2f')]=_0x2adfbe[_0x4dea('0x2f')][_0x4dea('0x32')]?_0x2adfbe[_0x4dea('0x2f')]:_0x1823af[_0x4dea('0x2c')];if(_0x52ea90['query'][_0x4dea('0x3f')]){_0x2adfbe[_0x4dea('0x40')]=[{'all':!![]}];}_0x2adfbe=_['merge']({},_0x2adfbe,_0x52ea90[_0x4dea('0x3d')]);return db['VtigerAccount']['find'](_0x2adfbe)[_0x4dea('0x21')](handleEntityNotFound(_0x8bfcef,null))[_0x4dea('0x21')](respondWithResult(_0x8bfcef,null))['catch'](handleError(_0x8bfcef,null));};exports[_0x4dea('0x43')]=function(_0x4aae94,_0x598c4a){return db['VtigerAccount'][_0x4dea('0x43')](_0x4aae94['body'],{})[_0x4dea('0x21')](respondWithResult(_0x598c4a,0xc9))[_0x4dea('0x44')](handleError(_0x598c4a,null));};exports[_0x4dea('0x45')]=function(_0x3e185d,_0x5cc23f){if(_0x3e185d[_0x4dea('0x46')]['id']){delete _0x3e185d[_0x4dea('0x46')]['id'];}return db[_0x4dea('0x3e')]['find']({'where':{'id':_0x3e185d[_0x4dea('0x42')]['id']}})[_0x4dea('0x21')](handleEntityNotFound(_0x5cc23f,null))[_0x4dea('0x21')](saveUpdates(_0x3e185d['body'],null))['then'](respondWithResult(_0x5cc23f,null))['catch'](handleError(_0x5cc23f,null));};exports[_0x4dea('0x22')]=function(_0x368af6,_0x5f0260){return db[_0x4dea('0x3e')][_0x4dea('0x47')]({'where':{'id':_0x368af6[_0x4dea('0x42')]['id']}})[_0x4dea('0x21')](handleEntityNotFound(_0x5f0260,null))[_0x4dea('0x21')](removeEntity(_0x5f0260,null))[_0x4dea('0x44')](handleError(_0x5f0260,null));};exports['getConfigurations']=function(_0xc39117,_0x2d5fcb,_0x28e985){var _0x1ca9ed={};var _0x2d97a4={};var _0x500bf6;var _0x2df820;return db[_0x4dea('0x3e')][_0x4dea('0x48')]({'where':{'id':_0xc39117[_0x4dea('0x42')]['id']}})[_0x4dea('0x21')](handleEntityNotFound(_0x2d5fcb,null))[_0x4dea('0x21')](function(_0x1e0cf7){if(_0x1e0cf7){_0x500bf6=_0x1e0cf7;_0x2d97a4[_0x4dea('0x2c')]=_[_0x4dea('0x2e')](db[_0x4dea('0x49')]['rawAttributes']);_0x2d97a4[_0x4dea('0x2d')]=_['keys'](_0xc39117[_0x4dea('0x2d')]);_0x2d97a4[_0x4dea('0x36')]=_[_0x4dea('0x30')](_0x2d97a4[_0x4dea('0x2c')],_0x2d97a4[_0x4dea('0x2d')]);_0x1ca9ed[_0x4dea('0x2f')]=_[_0x4dea('0x30')](_0x2d97a4[_0x4dea('0x2c')],qs[_0x4dea('0x31')](_0xc39117[_0x4dea('0x2d')][_0x4dea('0x31')]));_0x1ca9ed[_0x4dea('0x2f')]=_0x1ca9ed['attributes'][_0x4dea('0x32')]?_0x1ca9ed[_0x4dea('0x2f')]:_0x2d97a4[_0x4dea('0x2c')];_0x1ca9ed[_0x4dea('0x4a')]=qs[_0x4dea('0x35')](_0xc39117['query'][_0x4dea('0x35')]);_0x1ca9ed[_0x4dea('0x39')]=qs['filters'](_['pick'](_0xc39117[_0x4dea('0x2d')],_0x2d97a4[_0x4dea('0x36')]));if(_0xc39117[_0x4dea('0x2d')][_0x4dea('0x38')]){_0x1ca9ed[_0x4dea('0x39')]=_[_0x4dea('0x3a')](_0x1ca9ed['where'],{'$or':_[_0x4dea('0x28')](_0x1ca9ed[_0x4dea('0x2f')],function(_0x352e08){var _0x246076={};_0x246076[_0x352e08]={'$like':'%'+_0xc39117[_0x4dea('0x2d')][_0x4dea('0x38')]+'%'};return _0x246076;})});}_0x1ca9ed=_[_0x4dea('0x3a')]({},_0x1ca9ed,_0xc39117['options']);return _0x500bf6[_0x4dea('0x4b')](_0x1ca9ed);}})[_0x4dea('0x21')](function(_0x50c59b){if(_0x50c59b){_0x2df820=_0x50c59b[_0x4dea('0x32')];if(!_0xc39117[_0x4dea('0x2d')]['hasOwnProperty'](_0x4dea('0x33'))){_0x1ca9ed[_0x4dea('0x34')]=qs[_0x4dea('0x34')](_0xc39117[_0x4dea('0x2d')]['limit']);_0x1ca9ed[_0x4dea('0x1b')]=qs[_0x4dea('0x1b')](_0xc39117[_0x4dea('0x2d')]['offset']);}return _0x500bf6['getConfigurations'](_0x1ca9ed);}})[_0x4dea('0x21')](function(_0x554516){if(_0x554516){return _0x554516?{'count':_0x2df820,'rows':_0x554516}:null;}})[_0x4dea('0x21')](respondWithResult(_0x2d5fcb,null))[_0x4dea('0x44')](handleError(_0x2d5fcb,null));};exports[_0x4dea('0x4c')]=function(_0x1532df,_0xfca5c9,_0x4a9396){if(_0x1532df['body']['id']){delete _0x1532df[_0x4dea('0x46')]['id'];}return db[_0x4dea('0x3e')]['findOne']({'where':{'id':_0x1532df[_0x4dea('0x42')]['id']}})[_0x4dea('0x21')](handleEntityNotFound(_0xfca5c9,null))[_0x4dea('0x21')](function(_0x4ef05f){if(_0x4ef05f){_0x1532df[_0x4dea('0x46')]['AccountId']=_0x4ef05f['id'];_0x1532df['body'][_0x4dea('0x4d')]=integrations['getSubjects'](_0x1532df[_0x4dea('0x46')][_0x4dea('0x4e')],_0x1532df[_0x4dea('0x46')][_0x4dea('0x3b')]);_0x1532df['body'][_0x4dea('0x4f')]=integrations[_0x4dea('0x50')](_0x1532df[_0x4dea('0x46')]['channel'],_0x1532df['body'][_0x4dea('0x3b')]);return db[_0x4dea('0x49')]['create'](_0x1532df['body'],{'include':[{'model':db[_0x4dea('0x51')],'as':'Subjects'},{'model':db['VtigerField'],'as':_0x4dea('0x4f')}]});}return null;})[_0x4dea('0x21')](respondWithResult(_0xfca5c9,null))['catch'](handleError(_0xfca5c9,null));};var md5=require(_0x4dea('0x52'));exports[_0x4dea('0x53')]=function(_0x350ff3,_0x4b146e,_0x485909){var _0x4ce67c=null;var _0x11c21e=null;var _0x1b6567=null;var _0x337c5b=null;var _0x716e96='';return db[_0x4dea('0x3e')][_0x4dea('0x48')]({'where':{'id':_0x350ff3[_0x4dea('0x42')]['id']},'attributes':['id',_0x4dea('0x26'),'username','description',_0x4dea('0x54'),_0x4dea('0x55'),_0x4dea('0x56'),_0x4dea('0x57')]})['then'](handleEntityNotFound(_0x4b146e,null))['then'](function(_0x498cd0){if(_0x498cd0){_0x4ce67c=_0x498cd0[_0x4dea('0x58')];_0x11c21e=_0x498cd0[_0x4dea('0x57')];_0x1b6567=_0x498cd0['moduleName'];_0x716e96=_0x498cd0['remoteUri'];var _0x66d0fc=_0x716e96[_0x4dea('0x59')](-0x1);if(_0x66d0fc==='/'){_0x716e96=_0x716e96['substring'](0x0,_0x716e96[_0x4dea('0x5a')](_0x66d0fc));}_0x337c5b=util[_0x4dea('0x5b')](_0x4dea('0x5c'),_0x716e96);var _0x51066e={'method':_0x4dea('0x5d'),'uri':_0x337c5b,'qs':{'operation':'getchallenge','username':_0x498cd0[_0x4dea('0x58')]},'json':!![]};return rp(_0x51066e);}})[_0x4dea('0x21')](function(_0x47f5c9){if(_0x47f5c9[_0x4dea('0x5e')]){var _0x5d6082={'method':_0x4dea('0x5f'),'uri':_0x337c5b,'form':{'operation':_0x4dea('0x60'),'username':_0x4ce67c,'accessKey':md5(_0x47f5c9['result']['token']+_0x11c21e)},'json':!![]};return rp(_0x5d6082);}})['then'](function(_0x44341e){if(_0x44341e[_0x4dea('0x5e')]){var _0x22b5f5={'method':_0x4dea('0x5d'),'uri':_0x337c5b,'qs':{'operation':_0x4dea('0x61'),'username':_0x4ce67c,'sessionName':_0x44341e[_0x4dea('0x62')][_0x4dea('0x63')],'elementType':_0x1b6567},'json':!![]};return rp(_0x22b5f5);}})[_0x4dea('0x21')](function(_0x83695c){if(_0x83695c[_0x4dea('0x5e')]){var _0x84a96b=[_0x4dea('0x64'),_0x4dea('0x65'),_0x4dea('0x66')];_[_0x4dea('0x67')](_0x83695c[_0x4dea('0x62')][_0x4dea('0x31')],function(_0x2061ae){return _0x84a96b['includes'](_0x2061ae['type'][_0x4dea('0x26')]);});_['remove'](_0x83695c['result'][_0x4dea('0x31')],function(_0x2b3922){return _0x2b3922[_0x4dea('0x68')]===_0x4dea('0x69');});return{'count':_0x83695c[_0x4dea('0x62')]['fields'][_0x4dea('0x32')],'rows':_[_0x4dea('0x28')](_0x83695c[_0x4dea('0x62')][_0x4dea('0x31')],function(_0x5e017a){return{'id':_0x5e017a[_0x4dea('0x26')],'name':_0x5e017a[_0x4dea('0x6a')],'custom':_[_0x4dea('0x6b')](_0x5e017a[_0x4dea('0x26')],_0x4dea('0x6c'))?!![]:![],'options':_0x5e017a['type'][_0x4dea('0x26')]===_0x4dea('0x6d')&&_0x5e017a[_0x4dea('0x3b')][_0x4dea('0x6e')][_0x4dea('0x32')]>0x0?_[_0x4dea('0x28')](_0x5e017a[_0x4dea('0x3b')][_0x4dea('0x6e')],function(_0xd79b8){return{'name':_0xd79b8['label'],'value':_0xd79b8[_0x4dea('0x6f')]};}):[]};})};}})[_0x4dea('0x21')](respondWithResult(_0x4b146e,null))['catch'](function(_0x44ef19){console[_0x4dea('0x70')](_0x4dea('0x71')+_0x44ef19);var _0x35ef49=_0x350ff3[_0x4dea('0x2d')][_0x4dea('0x72')]?0x1f4:_0x44ef19[_0x4dea('0x73')]||0x1f4;logger[_0x4dea('0x24')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x35ef49,JSON[_0x4dea('0x74')](_0x44ef19));delete _0x44ef19[_0x4dea('0x26')];if(_0x35ef49===0x191){_0x35ef49=0x190;}_0x4b146e[_0x4dea('0x19')](_0x35ef49)['send'](_0x350ff3[_0x4dea('0x2d')][_0x4dea('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x44ef19['statusCode']}:_0x44ef19);});};
\ No newline at end of file
index 919fd95..dc9abe1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4f7=['bluebird','request-promise','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa4f7,0x97));var _0x7a4f=function(_0x28e7cf,_0x6239ce){_0x28e7cf=_0x28e7cf-0x0;var _0x349b37=_0xa4f7[_0x28e7cf];return _0x349b37;};'use strict';var _=require(_0x7a4f('0x0'));var util=require(_0x7a4f('0x1'));var logger=require(_0x7a4f('0x2'))(_0x7a4f('0x3'));var moment=require(_0x7a4f('0x4'));var BPromise=require(_0x7a4f('0x5'));var rp=require(_0x7a4f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7a4f('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x7a4f('0x8'));module[_0x7a4f('0x9')]=function(_0x3a3a9f,_0x501933){return _0x3a3a9f[_0x7a4f('0xa')](_0x7a4f('0xb'),attributes,{'tableName':_0x7a4f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd2f3=['moment','bluebird','../../config/environment','./intVtigerAccount.attributes','exports','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api'];(function(_0x214f8b,_0x39ff98){var _0x4aa3f5=function(_0x54b6b2){while(--_0x54b6b2){_0x214f8b['push'](_0x214f8b['shift']());}};_0x4aa3f5(++_0x39ff98);}(_0xd2f3,0xe3));var _0x3d2f=function(_0x5c71f3,_0x4f2be7){_0x5c71f3=_0x5c71f3-0x0;var _0x4d17c7=_0xd2f3[_0x5c71f3];return _0x4d17c7;};'use strict';var _=require('lodash');var util=require(_0x3d2f('0x0'));var logger=require(_0x3d2f('0x1'))(_0x3d2f('0x2'));var moment=require(_0x3d2f('0x3'));var BPromise=require(_0x3d2f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3d2f('0x5'));var attributes=require(_0x3d2f('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x3d2f('0x7')]=function(_0xe74323,_0x5b2ca4){return _0xe74323['define'](_0x3d2f('0x8'),attributes,{'tableName':_0x3d2f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2b34815..ead417d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['options','raw','where','attributes','limit','include','map','model','stringify','ShowVtigerAccount','VtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVtigerAccount','findAll'];(function(_0x148a88,_0x1ce566){var _0xdf93ff=function(_0x305b67){while(--_0x305b67){_0x148a88['push'](_0x148a88['shift']());}};_0xdf93ff(++_0x1ce566);}(_0xe706,0xa3));var _0x6e70=function(_0x4e26b8,_0x1a3c12){_0x4e26b8=_0x4e26b8-0x0;var _0x10a6f0=_0xe706[_0x4e26b8];return _0x10a6f0;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['VtigerAccount'][_0x6e70('0x1a')]({'raw':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'limit':_0x5ea7a5['options']?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1f')]||null:null,'include':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5['options'][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x5ea7a5[_0x6e70('0x1b')]['include'],function(_0x10fc91){return{'model':db[_0x10fc91['model']],'as':_0x10fc91['as'],'attributes':_0x10fc91['attributes'],'include':_0x10fc91['include']?_[_0x6e70('0x21')](_0x10fc91[_0x6e70('0x20')],function(_0x51d292){return{'model':db[_0x51d292[_0x6e70('0x22')]],'as':_0x51d292['as'],'attributes':_0x51d292[_0x6e70('0x1e')],'include':_0x51d292['include']?_[_0x6e70('0x21')](_0x51d292[_0x6e70('0x20')],function(_0x2bb231){return{'model':db[_0x2bb231['model']],'as':_0x2bb231['as'],'attributes':_0x2bb231['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x3af17f){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('GetVtigerAccount',_0x5ea7a5,JSON[_0x6e70('0x23')](_0x3af17f));_0x173afe(_0x3af17f);})[_0x6e70('0x18')](function(_0xecf336){logger[_0x6e70('0x14')](_0x6e70('0x19'),_0xecf336[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0xecf336[_0x6e70('0x16')]));});});};exports[_0x6e70('0x24')]=function(_0x3a5d30){var _0x4b1229=this;return new Promise(function(_0x1b27d8,_0x50d60b){return db[_0x6e70('0x25')]['find']({'raw':_0x3a5d30[_0x6e70('0x1b')]?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'include':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')],function(_0x1e3e76){return{'model':db[_0x1e3e76[_0x6e70('0x22')]],'as':_0x1e3e76['as'],'attributes':_0x1e3e76[_0x6e70('0x1e')],'include':_0x1e3e76[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x1e3e76['include'],function(_0x3b9c06){return{'model':db[_0x3b9c06['model']],'as':_0x3b9c06['as'],'attributes':_0x3b9c06[_0x6e70('0x1e')],'include':_0x3b9c06[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3b9c06[_0x6e70('0x20')],function(_0x233a83){return{'model':db[_0x233a83[_0x6e70('0x22')]],'as':_0x233a83['as'],'attributes':_0x233a83[_0x6e70('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x80bebb){logger[_0x6e70('0xf')](_0x6e70('0x24'),_0x3a5d30);logger[_0x6e70('0x12')](_0x6e70('0x24'),_0x3a5d30,JSON['stringify'](_0x80bebb));_0x1b27d8(_0x80bebb);})['catch'](function(_0x5424eb){logger[_0x6e70('0x14')](_0x6e70('0x24'),_0x5424eb[_0x6e70('0x16')],_0x3a5d30);_0x50d60b(_0x4b1229[_0x6e70('0x14')](0x1f4,_0x5424eb[_0x6e70('0x16')]));});});};
\ No newline at end of file
+var _0xd64b=['include','map','model','then','ShowVtigerAccount','find','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','options','where','attributes'];(function(_0x18be13,_0x12f269){var _0x17317b=function(_0x449d31){while(--_0x449d31){_0x18be13['push'](_0x18be13['shift']());}};_0x17317b(++_0x12f269);}(_0xd64b,0xc1));var _0xbd64=function(_0x3d5f2b,_0xd543d9){_0x3d5f2b=_0x3d5f2b-0x0;var _0x4efa84=_0xd64b[_0x3d5f2b];return _0x4efa84;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32995f,_0x3e700e,_0x38204e){return new BPromise(function(_0x3f1f17,_0x2b8543){return client[_0xbd64('0x8')](_0x32995f,_0x38204e)['then'](function(_0x5ae70c){logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));logger['debug'](_0xbd64('0xc'),_0x3e700e,_0xbd64('0xb'),JSON[_0xbd64('0xd')](_0x5ae70c));if(_0x5ae70c[_0xbd64('0xe')]){if(_0x5ae70c['error'][_0xbd64('0xf')]===0x1f4){logger['error'](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x2b8543(_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);}logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x3f1f17(_0x5ae70c['error'][_0xbd64('0x10')]);}else{logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));_0x3f1f17(_0x5ae70c[_0xbd64('0x11')]['message']);}})[_0xbd64('0x12')](function(_0x5332e0){logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5332e0);_0x2b8543(_0x5332e0);});});}exports[_0xbd64('0x13')]=function(_0x1d7a14){var _0x17d015=this;return new Promise(function(_0x2f4554,_0xa5491d){return db[_0xbd64('0x14')]['findAll']({'raw':_0x1d7a14[_0xbd64('0x15')]?_0x1d7a14[_0xbd64('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1d7a14['options']?_0x1d7a14[_0xbd64('0x15')][_0xbd64('0x16')]||null:null,'attributes':_0x1d7a14[_0xbd64('0x15')]?_0x1d7a14[_0xbd64('0x15')][_0xbd64('0x17')]||null:null,'limit':_0x1d7a14[_0xbd64('0x15')]?_0x1d7a14['options']['limit']||null:null,'include':_0x1d7a14[_0xbd64('0x15')]?_0x1d7a14[_0xbd64('0x15')][_0xbd64('0x18')]?_[_0xbd64('0x19')](_0x1d7a14['options']['include'],function(_0x28497c){return{'model':db[_0x28497c['model']],'as':_0x28497c['as'],'attributes':_0x28497c[_0xbd64('0x17')],'include':_0x28497c['include']?_[_0xbd64('0x19')](_0x28497c[_0xbd64('0x18')],function(_0x3d12a0){return{'model':db[_0x3d12a0[_0xbd64('0x1a')]],'as':_0x3d12a0['as'],'attributes':_0x3d12a0['attributes'],'include':_0x3d12a0[_0xbd64('0x18')]?_[_0xbd64('0x19')](_0x3d12a0[_0xbd64('0x18')],function(_0x2a44d0){return{'model':db[_0x2a44d0['model']],'as':_0x2a44d0['as'],'attributes':_0x2a44d0['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd64('0x1b')](function(_0x49eac5){logger['info'](_0xbd64('0x13'),_0x1d7a14);logger['debug'](_0xbd64('0x13'),_0x1d7a14,JSON['stringify'](_0x49eac5));_0x2f4554(_0x49eac5);})[_0xbd64('0x12')](function(_0x5d8c35){logger[_0xbd64('0xe')](_0xbd64('0x13'),_0x5d8c35[_0xbd64('0x10')],_0x1d7a14);_0xa5491d(_0x17d015[_0xbd64('0xe')](0x1f4,_0x5d8c35[_0xbd64('0x10')]));});});};exports[_0xbd64('0x1c')]=function(_0x4ed44a){var _0x35bdd5=this;return new Promise(function(_0xe876c9,_0xc44280){return db[_0xbd64('0x14')][_0xbd64('0x1d')]({'raw':_0x4ed44a[_0xbd64('0x15')]?_0x4ed44a['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ed44a[_0xbd64('0x15')]?_0x4ed44a['options'][_0xbd64('0x16')]||null:null,'attributes':_0x4ed44a[_0xbd64('0x15')]?_0x4ed44a['options']['attributes']||null:null,'include':_0x4ed44a[_0xbd64('0x15')]?_0x4ed44a['options']['include']?_[_0xbd64('0x19')](_0x4ed44a[_0xbd64('0x15')][_0xbd64('0x18')],function(_0x50c58e){return{'model':db[_0x50c58e[_0xbd64('0x1a')]],'as':_0x50c58e['as'],'attributes':_0x50c58e['attributes'],'include':_0x50c58e[_0xbd64('0x18')]?_[_0xbd64('0x19')](_0x50c58e[_0xbd64('0x18')],function(_0x243588){return{'model':db[_0x243588[_0xbd64('0x1a')]],'as':_0x243588['as'],'attributes':_0x243588[_0xbd64('0x17')],'include':_0x243588['include']?_['map'](_0x243588[_0xbd64('0x18')],function(_0x2be110){return{'model':db[_0x2be110[_0xbd64('0x1a')]],'as':_0x2be110['as'],'attributes':_0x2be110[_0xbd64('0x17')]};}):[]};}):[]};}):[]:[]})[_0xbd64('0x1b')](function(_0x3b245e){logger['info']('ShowVtigerAccount',_0x4ed44a);logger[_0xbd64('0x1e')](_0xbd64('0x1c'),_0x4ed44a,JSON[_0xbd64('0xd')](_0x3b245e));_0xe876c9(_0x3b245e);})['catch'](function(_0x5afe9b){logger[_0xbd64('0xe')]('ShowVtigerAccount',_0x5afe9b[_0xbd64('0x10')],_0x4ed44a);_0xc44280(_0x35bdd5['error'](0x1f4,_0x5afe9b[_0xbd64('0x10')]));});});};
\ No newline at end of file
index dedbd1e..cebd946 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d5f=['delete','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x55969b,_0x1ebe62){var _0x3d7fc1=function(_0x5f2dbe){while(--_0x5f2dbe){_0x55969b['push'](_0x55969b['shift']());}};_0x3d7fc1(++_0x1ebe62);}(_0x1d5f,0x6f));var _0xf1d5=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x1d5f[_0x374ccf];return _0x443cde;};'use strict';var multer=require(_0xf1d5('0x0'));var util=require(_0xf1d5('0x1'));var path=require(_0xf1d5('0x2'));var timeout=require('connect-timeout');var express=require(_0xf1d5('0x3'));var router=express['Router']();var fs_extra=require(_0xf1d5('0x4'));var auth=require(_0xf1d5('0x5'));var interaction=require(_0xf1d5('0x6'));var config=require(_0xf1d5('0x7'));var controller=require(_0xf1d5('0x8'));router['get']('/',auth[_0xf1d5('0x9')](),controller[_0xf1d5('0xa')]);router[_0xf1d5('0xb')](_0xf1d5('0xc'),auth[_0xf1d5('0x9')](),controller[_0xf1d5('0xd')]);router[_0xf1d5('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0xf1d5('0xe')]);router['get'](_0xf1d5('0xf'),auth['isAuthenticated'](),controller[_0xf1d5('0x10')]);router[_0xf1d5('0xb')](_0xf1d5('0x11'),auth['isAuthenticated'](),controller[_0xf1d5('0x12')]);router[_0xf1d5('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf1d5('0x14')](_0xf1d5('0xc'),auth[_0xf1d5('0x9')](),controller['update']);router[_0xf1d5('0x15')](_0xf1d5('0xc'),auth[_0xf1d5('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8e13=['isAuthenticated','index','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intVtigerConfiguration.controller','get'];(function(_0x3fa296,_0x2bd315){var _0x10b19f=function(_0x2c868d){while(--_0x2c868d){_0x3fa296['push'](_0x3fa296['shift']());}};_0x10b19f(++_0x2bd315);}(_0x8e13,0x11d));var _0x38e1=function(_0x5f54d5,_0x19fb8a){_0x5f54d5=_0x5f54d5-0x0;var _0x4978c2=_0x8e13[_0x5f54d5];return _0x4978c2;};'use strict';var multer=require('multer');var util=require(_0x38e1('0x0'));var path=require(_0x38e1('0x1'));var timeout=require(_0x38e1('0x2'));var express=require(_0x38e1('0x3'));var router=express[_0x38e1('0x4')]();var fs_extra=require(_0x38e1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x38e1('0x6'));var controller=require(_0x38e1('0x7'));router[_0x38e1('0x8')]('/',auth[_0x38e1('0x9')](),controller[_0x38e1('0xa')]);router['get'](_0x38e1('0xb'),auth[_0x38e1('0x9')](),controller[_0x38e1('0xc')]);router[_0x38e1('0x8')]('/:id/fields',auth[_0x38e1('0x9')](),controller[_0x38e1('0xd')]);router[_0x38e1('0x8')]('/:id/subjects',auth[_0x38e1('0x9')](),controller[_0x38e1('0xe')]);router[_0x38e1('0x8')](_0x38e1('0xf'),auth[_0x38e1('0x9')](),controller[_0x38e1('0x10')]);router[_0x38e1('0x11')]('/',auth[_0x38e1('0x9')](),controller['create']);router[_0x38e1('0x12')]('/:id',auth[_0x38e1('0x9')](),controller[_0x38e1('0x13')]);router[_0x38e1('0x14')](_0x38e1('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index ccb18b9..75876fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa090=['exports','STRING'];(function(_0x2eb00f,_0x5a3b6a){var _0xcae862=function(_0x3ac372){while(--_0x3ac372){_0x2eb00f['push'](_0x2eb00f['shift']());}};_0xcae862(++_0x5a3b6a);}(_0xa090,0x17c));var _0x0a09=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0xa090[_0x32b993];return _0x482780;};'use strict';var Sequelize=require('sequelize');module[_0x0a09('0x0')]={'name':{'type':Sequelize[_0x0a09('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0ecf=['STRING','sequelize','exports'];(function(_0x4c7b15,_0xebc65c){var _0x453453=function(_0x43140a){while(--_0x43140a){_0x4c7b15['push'](_0x4c7b15['shift']());}};_0x453453(++_0xebc65c);}(_0x0ecf,0xee));var _0xf0ec=function(_0x4fb924,_0x5bdc86){_0x4fb924=_0x4fb924-0x0;var _0x258391=_0x0ecf[_0x4fb924];return _0x258391;};'use strict';var Sequelize=require(_0xf0ec('0x0'));module[_0xf0ec('0x1')]={'name':{'type':Sequelize[_0xf0ec('0x2')]},'description':{'type':Sequelize[_0xf0ec('0x2')]}};
\ No newline at end of file
index 6c84c85..a6bcb47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88c9=['intersection','length','include','find','create','body','update','params','findOne','getSubjects','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','filters','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','VtigerConfiguration','includeAll','findAll','rows','catch','show','keys'];(function(_0x1f4d4d,_0x451e74){var _0x1c0eb4=function(_0x1c2a9b){while(--_0x1c2a9b){_0x1f4d4d['push'](_0x1f4d4d['shift']());}};_0x1c0eb4(++_0x451e74);}(_0x88c9,0x1f2));var _0x988c=function(_0x43671c,_0x562da0){_0x43671c=_0x43671c-0x0;var _0x59b230=_0x88c9[_0x43671c];return _0x59b230;};'use strict';var emlformat=require(_0x988c('0x0'));var rimraf=require(_0x988c('0x1'));var zipdir=require(_0x988c('0x2'));var jsonpatch=require(_0x988c('0x3'));var rp=require(_0x988c('0x4'));var moment=require('moment');var BPromise=require(_0x988c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x988c('0x6'));var sox=require(_0x988c('0x7'));var csv=require(_0x988c('0x8'));var ejs=require(_0x988c('0x9'));var fs=require('fs');var fs_extra=require(_0x988c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x988c('0xb'));var jsforce=require(_0x988c('0xc'));var deskjs=require(_0x988c('0xd'));var toCsv=require(_0x988c('0x8'));var querystring=require(_0x988c('0xe'));var Papa=require(_0x988c('0xf'));var Redis=require(_0x988c('0x10'));var authService=require(_0x988c('0x11'));var qs=require(_0x988c('0x12'));var as=require(_0x988c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x988c('0x14'))(_0x988c('0x15'));var utils=require(_0x988c('0x16'));var config=require(_0x988c('0x17'));var licenseUtil=require(_0x988c('0x18'));var db=require(_0x988c('0x19'))['db'];function respondWithStatusCode(_0x185782,_0x528dd4){_0x528dd4=_0x528dd4||0xcc;return function(_0x4ed9f2){if(_0x4ed9f2){return _0x185782['sendStatus'](_0x528dd4);}return _0x185782['status'](_0x528dd4)[_0x988c('0x1a')]();};}function respondWithResult(_0x4a5bb3,_0x4b4343){_0x4b4343=_0x4b4343||0xc8;return function(_0x4331cf){if(_0x4331cf){return _0x4a5bb3['status'](_0x4b4343)[_0x988c('0x1b')](_0x4331cf);}};}function respondWithFilteredResult(_0xe30832,_0x182d3c){return function(_0x5a6410){if(_0x5a6410){var _0x1c67b4=typeof _0x182d3c[_0x988c('0x1c')]===_0x988c('0x1d')&&typeof _0x182d3c[_0x988c('0x1e')]===_0x988c('0x1d');var _0x1edd02=_0x5a6410[_0x988c('0x1f')];var _0x1e73c1=_0x1c67b4?0x0:_0x182d3c[_0x988c('0x1c')];var _0x2d2281=_0x1c67b4?_0x5a6410['count']:_0x182d3c[_0x988c('0x1c')]+_0x182d3c[_0x988c('0x1e')];var _0x5cadf1;if(_0x2d2281>=_0x1edd02){_0x2d2281=_0x1edd02;_0x5cadf1=0xc8;}else{_0x5cadf1=0xce;}_0xe30832[_0x988c('0x20')](_0x5cadf1);return _0xe30832[_0x988c('0x21')](_0x988c('0x22'),_0x1e73c1+'-'+_0x2d2281+'/'+_0x1edd02)['json'](_0x5a6410);}return null;};}function patchUpdates(_0x506d21){return function(_0x6e5a70){try{jsonpatch[_0x988c('0x23')](_0x6e5a70,_0x506d21,!![]);}catch(_0x317f72){return BPromise[_0x988c('0x24')](_0x317f72);}return _0x6e5a70['save']();};}function saveUpdates(_0x2c539d,_0x216d3e){return function(_0x48c62f){if(_0x48c62f){return _0x48c62f['update'](_0x2c539d)[_0x988c('0x25')](function(_0xbb5203){return _0xbb5203;});}return null;};}function removeEntity(_0x57173b,_0x537e23){return function(_0x11656a){if(_0x11656a){return _0x11656a[_0x988c('0x26')]()[_0x988c('0x25')](function(){_0x57173b[_0x988c('0x20')](0xcc)[_0x988c('0x1a')]();});}};}function handleEntityNotFound(_0x2316c7,_0x3ea40d){return function(_0x304e83){if(!_0x304e83){_0x2316c7[_0x988c('0x27')](0x194);}return _0x304e83;};}function handleError(_0x111211,_0x239dc2){_0x239dc2=_0x239dc2||0x1f4;return function(_0x665c6){logger[_0x988c('0x28')](_0x665c6['stack']);if(_0x665c6[_0x988c('0x29')]){delete _0x665c6[_0x988c('0x29')];}_0x111211[_0x988c('0x20')](_0x239dc2)[_0x988c('0x2a')](_0x665c6);};}exports[_0x988c('0x2b')]=function(_0x5e320a,_0x3be720){var _0x156e9d={},_0x509f99={},_0x53c1a7={'count':0x0,'rows':[]};var _0x5d5992=_[_0x988c('0x2c')](db['VtigerConfiguration'][_0x988c('0x2d')],function(_0x1bc081){return{'name':_0x1bc081['fieldName'],'type':_0x1bc081['type']['key']};});_0x509f99['model']=_[_0x988c('0x2c')](_0x5d5992,'name');_0x509f99['query']=_['keys'](_0x5e320a['query']);_0x509f99[_0x988c('0x2e')]=_['intersection'](_0x509f99[_0x988c('0x2f')],_0x509f99[_0x988c('0x30')]);_0x156e9d[_0x988c('0x31')]=_['intersection'](_0x509f99[_0x988c('0x2f')],qs[_0x988c('0x32')](_0x5e320a[_0x988c('0x30')][_0x988c('0x32')]));_0x156e9d[_0x988c('0x31')]=_0x156e9d[_0x988c('0x31')]['length']?_0x156e9d[_0x988c('0x31')]:_0x509f99['model'];if(!_0x5e320a[_0x988c('0x30')][_0x988c('0x33')](_0x988c('0x34'))){_0x156e9d[_0x988c('0x1e')]=qs[_0x988c('0x1e')](_0x5e320a['query'][_0x988c('0x1e')]);_0x156e9d[_0x988c('0x1c')]=qs['offset'](_0x5e320a[_0x988c('0x30')][_0x988c('0x1c')]);}_0x156e9d[_0x988c('0x35')]=qs[_0x988c('0x36')](_0x5e320a[_0x988c('0x30')]['sort']);_0x156e9d[_0x988c('0x37')]=qs[_0x988c('0x2e')](_[_0x988c('0x38')](_0x5e320a[_0x988c('0x30')],_0x509f99[_0x988c('0x2e')]),_0x5d5992);if(_0x5e320a[_0x988c('0x30')][_0x988c('0x39')]){_0x156e9d[_0x988c('0x37')]=_['merge'](_0x156e9d[_0x988c('0x37')],{'$or':_[_0x988c('0x2c')](_0x5d5992,function(_0x4c421b){if(_0x4c421b[_0x988c('0x3a')]!==_0x988c('0x3b')){var _0x217b18={};_0x217b18[_0x4c421b['name']]={'$like':'%'+_0x5e320a[_0x988c('0x30')][_0x988c('0x39')]+'%'};return _0x217b18;}})});}_0x156e9d=_[_0x988c('0x3c')]({},_0x156e9d,_0x5e320a[_0x988c('0x3d')]);var _0x3a21a2={'where':_0x156e9d['where']};return db[_0x988c('0x3e')][_0x988c('0x1f')](_0x3a21a2)[_0x988c('0x25')](function(_0x37856f){_0x53c1a7[_0x988c('0x1f')]=_0x37856f;if(_0x5e320a[_0x988c('0x30')][_0x988c('0x3f')]){_0x156e9d['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0x988c('0x40')](_0x156e9d);})[_0x988c('0x25')](function(_0x54c075){_0x53c1a7[_0x988c('0x41')]=_0x54c075;return _0x53c1a7;})[_0x988c('0x25')](respondWithFilteredResult(_0x3be720,_0x156e9d))[_0x988c('0x42')](handleError(_0x3be720,null));};exports[_0x988c('0x43')]=function(_0x3266b0,_0x58c768){var _0x4a83d3={'raw':![],'where':{'id':_0x3266b0['params']['id']}},_0x1adb68={};_0x1adb68['model']=_[_0x988c('0x44')](db[_0x988c('0x3e')]['rawAttributes']);_0x1adb68[_0x988c('0x30')]=_[_0x988c('0x44')](_0x3266b0[_0x988c('0x30')]);_0x1adb68[_0x988c('0x2e')]=_[_0x988c('0x45')](_0x1adb68[_0x988c('0x2f')],_0x1adb68[_0x988c('0x30')]);_0x4a83d3['attributes']=_['intersection'](_0x1adb68[_0x988c('0x2f')],qs['fields'](_0x3266b0[_0x988c('0x30')][_0x988c('0x32')]));_0x4a83d3[_0x988c('0x31')]=_0x4a83d3[_0x988c('0x31')][_0x988c('0x46')]?_0x4a83d3[_0x988c('0x31')]:_0x1adb68['model'];if(_0x3266b0[_0x988c('0x30')][_0x988c('0x3f')]){_0x4a83d3[_0x988c('0x47')]=[{'all':!![]}];}_0x4a83d3=_[_0x988c('0x3c')]({},_0x4a83d3,_0x3266b0[_0x988c('0x3d')]);return db[_0x988c('0x3e')][_0x988c('0x48')](_0x4a83d3)['then'](handleEntityNotFound(_0x58c768,null))['then'](respondWithResult(_0x58c768,null))[_0x988c('0x42')](handleError(_0x58c768,null));};exports[_0x988c('0x49')]=function(_0x4246bf,_0x382030){return db['VtigerConfiguration']['create'](_0x4246bf[_0x988c('0x4a')],{})[_0x988c('0x25')](respondWithResult(_0x382030,0xc9))[_0x988c('0x42')](handleError(_0x382030,null));};exports[_0x988c('0x4b')]=function(_0x4b59dc,_0x32cdb6){if(_0x4b59dc[_0x988c('0x4a')]['id']){delete _0x4b59dc[_0x988c('0x4a')]['id'];}return db[_0x988c('0x3e')]['find']({'where':{'id':_0x4b59dc[_0x988c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x32cdb6,null))[_0x988c('0x25')](saveUpdates(_0x4b59dc[_0x988c('0x4a')],null))['then'](respondWithResult(_0x32cdb6,null))[_0x988c('0x42')](handleError(_0x32cdb6,null));};exports[_0x988c('0x26')]=function(_0x9993f4,_0x3dc5c5){return db[_0x988c('0x3e')][_0x988c('0x48')]({'where':{'id':_0x9993f4[_0x988c('0x4c')]['id']}})[_0x988c('0x25')](handleEntityNotFound(_0x3dc5c5,null))['then'](removeEntity(_0x3dc5c5,null))[_0x988c('0x42')](handleError(_0x3dc5c5,null));};exports['getFields']=function(_0x40dfed,_0x59da32,_0x4e1a2f){var _0x4b20b0={};var _0x10a0e8={};var _0x74cc54;var _0x3e0f59;return db[_0x988c('0x3e')][_0x988c('0x4d')]({'where':{'id':_0x40dfed[_0x988c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x59da32,null))['then'](function(_0x198ef9){if(_0x198ef9){_0x74cc54=_0x198ef9;_0x10a0e8[_0x988c('0x2f')]=_[_0x988c('0x44')](db['VtigerField'][_0x988c('0x2d')]);_0x10a0e8[_0x988c('0x30')]=_['keys'](_0x40dfed[_0x988c('0x30')]);_0x10a0e8[_0x988c('0x2e')]=_[_0x988c('0x45')](_0x10a0e8[_0x988c('0x2f')],_0x10a0e8['query']);_0x4b20b0[_0x988c('0x31')]=_['intersection'](_0x10a0e8[_0x988c('0x2f')],qs['fields'](_0x40dfed[_0x988c('0x30')][_0x988c('0x32')]));_0x4b20b0['attributes']=_0x4b20b0['attributes'][_0x988c('0x46')]?_0x4b20b0[_0x988c('0x31')]:_0x10a0e8[_0x988c('0x2f')];_0x4b20b0[_0x988c('0x35')]=qs[_0x988c('0x36')](_0x40dfed[_0x988c('0x30')][_0x988c('0x36')]);_0x4b20b0[_0x988c('0x37')]=qs[_0x988c('0x2e')](_[_0x988c('0x38')](_0x40dfed[_0x988c('0x30')],_0x10a0e8[_0x988c('0x2e')]));if(_0x40dfed['query'][_0x988c('0x39')]){_0x4b20b0['where']=_['merge'](_0x4b20b0['where'],{'$or':_[_0x988c('0x2c')](_0x4b20b0['attributes'],function(_0x549be){var _0x1f4858={};_0x1f4858[_0x549be]={'$like':'%'+_0x40dfed['query']['filter']+'%'};return _0x1f4858;})});}_0x4b20b0=_[_0x988c('0x3c')]({},_0x4b20b0,_0x40dfed[_0x988c('0x3d')]);return _0x74cc54['getFields'](_0x4b20b0);}})[_0x988c('0x25')](function(_0x2ad319){if(_0x2ad319){_0x3e0f59=_0x2ad319['length'];if(!_0x40dfed[_0x988c('0x30')][_0x988c('0x33')](_0x988c('0x34'))){_0x4b20b0[_0x988c('0x1e')]=qs[_0x988c('0x1e')](_0x40dfed[_0x988c('0x30')][_0x988c('0x1e')]);_0x4b20b0[_0x988c('0x1c')]=qs['offset'](_0x40dfed[_0x988c('0x30')][_0x988c('0x1c')]);}return _0x74cc54['getFields'](_0x4b20b0);}})[_0x988c('0x25')](function(_0x3f8c66){if(_0x3f8c66){return _0x3f8c66?{'count':_0x3e0f59,'rows':_0x3f8c66}:null;}})[_0x988c('0x25')](respondWithResult(_0x59da32,null))[_0x988c('0x42')](handleError(_0x59da32,null));};exports[_0x988c('0x4e')]=function(_0x36da29,_0x2251a2,_0x314967){var _0x2137fe={};var _0x44c12a={};var _0x8df555;var _0x8b8b07;return db[_0x988c('0x3e')][_0x988c('0x4d')]({'where':{'id':_0x36da29[_0x988c('0x4c')]['id']}})[_0x988c('0x25')](handleEntityNotFound(_0x2251a2,null))[_0x988c('0x25')](function(_0x2a43ff){if(_0x2a43ff){_0x8df555=_0x2a43ff;_0x44c12a[_0x988c('0x2f')]=_[_0x988c('0x44')](db[_0x988c('0x4f')][_0x988c('0x2d')]);_0x44c12a[_0x988c('0x30')]=_[_0x988c('0x44')](_0x36da29[_0x988c('0x30')]);_0x44c12a[_0x988c('0x2e')]=_[_0x988c('0x45')](_0x44c12a[_0x988c('0x2f')],_0x44c12a['query']);_0x2137fe['attributes']=_['intersection'](_0x44c12a[_0x988c('0x2f')],qs[_0x988c('0x32')](_0x36da29['query'][_0x988c('0x32')]));_0x2137fe[_0x988c('0x31')]=_0x2137fe[_0x988c('0x31')][_0x988c('0x46')]?_0x2137fe[_0x988c('0x31')]:_0x44c12a[_0x988c('0x2f')];_0x2137fe[_0x988c('0x35')]=qs[_0x988c('0x36')](_0x36da29[_0x988c('0x30')][_0x988c('0x36')]);_0x2137fe[_0x988c('0x37')]=qs[_0x988c('0x2e')](_['pick'](_0x36da29[_0x988c('0x30')],_0x44c12a['filters']));if(_0x36da29[_0x988c('0x30')][_0x988c('0x39')]){_0x2137fe[_0x988c('0x37')]=_['merge'](_0x2137fe[_0x988c('0x37')],{'$or':_[_0x988c('0x2c')](_0x2137fe[_0x988c('0x31')],function(_0x5616c9){var _0x280a57={};_0x280a57[_0x5616c9]={'$like':'%'+_0x36da29[_0x988c('0x30')][_0x988c('0x39')]+'%'};return _0x280a57;})});}_0x2137fe=_[_0x988c('0x3c')]({},_0x2137fe,_0x36da29[_0x988c('0x3d')]);return _0x8df555[_0x988c('0x4e')](_0x2137fe);}})[_0x988c('0x25')](function(_0x4ce05d){if(_0x4ce05d){_0x8b8b07=_0x4ce05d['length'];if(!_0x36da29[_0x988c('0x30')]['hasOwnProperty'](_0x988c('0x34'))){_0x2137fe['limit']=qs[_0x988c('0x1e')](_0x36da29[_0x988c('0x30')][_0x988c('0x1e')]);_0x2137fe['offset']=qs['offset'](_0x36da29['query'][_0x988c('0x1c')]);}return _0x8df555[_0x988c('0x4e')](_0x2137fe);}})[_0x988c('0x25')](function(_0x39df22){if(_0x39df22){return _0x39df22?{'count':_0x8b8b07,'rows':_0x39df22}:null;}})['then'](respondWithResult(_0x2251a2,null))[_0x988c('0x42')](handleError(_0x2251a2,null));};exports[_0x988c('0x50')]=function(_0x46154c,_0x3ea812,_0xb2afd6){var _0x29fa04={};var _0x523578={};var _0x5063c4;var _0x288007;return db[_0x988c('0x3e')][_0x988c('0x4d')]({'where':{'id':_0x46154c[_0x988c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3ea812,null))[_0x988c('0x25')](function(_0x187953){if(_0x187953){_0x5063c4=_0x187953;_0x523578['model']=_[_0x988c('0x44')](db['VtigerField']['rawAttributes']);_0x523578['query']=_[_0x988c('0x44')](_0x46154c[_0x988c('0x30')]);_0x523578['filters']=_[_0x988c('0x45')](_0x523578[_0x988c('0x2f')],_0x523578[_0x988c('0x30')]);_0x29fa04[_0x988c('0x31')]=_[_0x988c('0x45')](_0x523578[_0x988c('0x2f')],qs[_0x988c('0x32')](_0x46154c[_0x988c('0x30')][_0x988c('0x32')]));_0x29fa04[_0x988c('0x31')]=_0x29fa04[_0x988c('0x31')][_0x988c('0x46')]?_0x29fa04['attributes']:_0x523578[_0x988c('0x2f')];_0x29fa04[_0x988c('0x35')]=qs['sort'](_0x46154c['query'][_0x988c('0x36')]);_0x29fa04['where']=qs[_0x988c('0x2e')](_[_0x988c('0x38')](_0x46154c[_0x988c('0x30')],_0x523578[_0x988c('0x2e')]));if(_0x46154c[_0x988c('0x30')][_0x988c('0x39')]){_0x29fa04[_0x988c('0x37')]=_[_0x988c('0x3c')](_0x29fa04['where'],{'$or':_[_0x988c('0x2c')](_0x29fa04[_0x988c('0x31')],function(_0x53e193){var _0x4637d6={};_0x4637d6[_0x53e193]={'$like':'%'+_0x46154c[_0x988c('0x30')][_0x988c('0x39')]+'%'};return _0x4637d6;})});}_0x29fa04=_[_0x988c('0x3c')]({},_0x29fa04,_0x46154c[_0x988c('0x3d')]);return _0x5063c4[_0x988c('0x50')](_0x29fa04);}})[_0x988c('0x25')](function(_0x14f16e){if(_0x14f16e){_0x288007=_0x14f16e[_0x988c('0x46')];if(!_0x46154c[_0x988c('0x30')][_0x988c('0x33')](_0x988c('0x34'))){_0x29fa04['limit']=qs['limit'](_0x46154c['query']['limit']);_0x29fa04[_0x988c('0x1c')]=qs[_0x988c('0x1c')](_0x46154c[_0x988c('0x30')][_0x988c('0x1c')]);}return _0x5063c4[_0x988c('0x50')](_0x29fa04);}})[_0x988c('0x25')](function(_0x3d308d){if(_0x3d308d){return _0x3d308d?{'count':_0x288007,'rows':_0x3d308d}:null;}})[_0x988c('0x25')](respondWithResult(_0x3ea812,null))[_0x988c('0x42')](handleError(_0x3ea812,null));};
\ No newline at end of file
+var _0x951c=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','getFields','findOne','VtigerField','pick','nolimit','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','save','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName'];(function(_0x52ea96,_0x55bc71){var _0x111ecb=function(_0x23e780){while(--_0x23e780){_0x52ea96['push'](_0x52ea96['shift']());}};_0x111ecb(++_0x55bc71);}(_0x951c,0x71));var _0xc951=function(_0x508a61,_0x17a39c){_0x508a61=_0x508a61-0x0;var _0xcec36c=_0x951c[_0x508a61];return _0xcec36c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc951('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc951('0x1'));var rp=require(_0xc951('0x2'));var moment=require('moment');var BPromise=require(_0xc951('0x3'));var Mustache=require(_0xc951('0x4'));var util=require(_0xc951('0x5'));var path=require(_0xc951('0x6'));var sox=require(_0xc951('0x7'));var csv=require(_0xc951('0x8'));var ejs=require(_0xc951('0x9'));var fs=require('fs');var fs_extra=require(_0xc951('0xa'));var _=require(_0xc951('0xb'));var squel=require(_0xc951('0xc'));var crypto=require(_0xc951('0xd'));var jsforce=require(_0xc951('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc951('0x8'));var querystring=require('querystring');var Papa=require(_0xc951('0xf'));var Redis=require(_0xc951('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc951('0x11'));var as=require(_0xc951('0x12'));var hardwareService=require(_0xc951('0x13'));var logger=require('../../config/logger')(_0xc951('0x14'));var utils=require(_0xc951('0x15'));var config=require(_0xc951('0x16'));var licenseUtil=require(_0xc951('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f873f,_0x5c0fca){_0x5c0fca=_0x5c0fca||0xcc;return function(_0x500aa3){if(_0x500aa3){return _0x2f873f[_0xc951('0x18')](_0x5c0fca);}return _0x2f873f[_0xc951('0x19')](_0x5c0fca)[_0xc951('0x1a')]();};}function respondWithResult(_0x42c1d4,_0x5a34b4){_0x5a34b4=_0x5a34b4||0xc8;return function(_0x56d5eb){if(_0x56d5eb){return _0x42c1d4['status'](_0x5a34b4)[_0xc951('0x1b')](_0x56d5eb);}};}function respondWithFilteredResult(_0x2fe794,_0x518785){return function(_0x81aa6f){if(_0x81aa6f){var _0x51487f=typeof _0x518785['offset']===_0xc951('0x1c')&&typeof _0x518785['limit']===_0xc951('0x1c');var _0x32d851=_0x81aa6f[_0xc951('0x1d')];var _0x4d383a=_0x51487f?0x0:_0x518785['offset'];var _0x21d338=_0x51487f?_0x81aa6f[_0xc951('0x1d')]:_0x518785[_0xc951('0x1e')]+_0x518785[_0xc951('0x1f')];var _0x265c23;if(_0x21d338>=_0x32d851){_0x21d338=_0x32d851;_0x265c23=0xc8;}else{_0x265c23=0xce;}_0x2fe794['status'](_0x265c23);return _0x2fe794['set']('Content-Range',_0x4d383a+'-'+_0x21d338+'/'+_0x32d851)[_0xc951('0x1b')](_0x81aa6f);}return null;};}function patchUpdates(_0x351a9f){return function(_0x486556){try{jsonpatch['apply'](_0x486556,_0x351a9f,!![]);}catch(_0x4ea041){return BPromise['reject'](_0x4ea041);}return _0x486556[_0xc951('0x20')]();};}function saveUpdates(_0x1673f2,_0x4f7bae){return function(_0x14bad1){if(_0x14bad1){return _0x14bad1[_0xc951('0x21')](_0x1673f2)[_0xc951('0x22')](function(_0x2e0c54){return _0x2e0c54;});}return null;};}function removeEntity(_0x5221d1,_0x2229a4){return function(_0x458059){if(_0x458059){return _0x458059[_0xc951('0x23')]()[_0xc951('0x22')](function(){_0x5221d1['status'](0xcc)[_0xc951('0x1a')]();});}};}function handleEntityNotFound(_0x540fb4,_0x3eb624){return function(_0x39b09e){if(!_0x39b09e){_0x540fb4[_0xc951('0x18')](0x194);}return _0x39b09e;};}function handleError(_0x31a951,_0x46ed42){_0x46ed42=_0x46ed42||0x1f4;return function(_0x17448d){logger[_0xc951('0x24')](_0x17448d[_0xc951('0x25')]);if(_0x17448d[_0xc951('0x26')]){delete _0x17448d[_0xc951('0x26')];}_0x31a951[_0xc951('0x19')](_0x46ed42)[_0xc951('0x27')](_0x17448d);};}exports[_0xc951('0x28')]=function(_0x27e08c,_0x2446fc){var _0xfc7e4a={},_0x3456b6={},_0x2a18ca={'count':0x0,'rows':[]};var _0x507b0c=_[_0xc951('0x29')](db[_0xc951('0x2a')][_0xc951('0x2b')],function(_0x3f6d18){return{'name':_0x3f6d18[_0xc951('0x2c')],'type':_0x3f6d18[_0xc951('0x2d')][_0xc951('0x2e')]};});_0x3456b6[_0xc951('0x2f')]=_[_0xc951('0x29')](_0x507b0c,_0xc951('0x26'));_0x3456b6[_0xc951('0x30')]=_[_0xc951('0x31')](_0x27e08c[_0xc951('0x30')]);_0x3456b6[_0xc951('0x32')]=_[_0xc951('0x33')](_0x3456b6[_0xc951('0x2f')],_0x3456b6[_0xc951('0x30')]);_0xfc7e4a[_0xc951('0x34')]=_[_0xc951('0x33')](_0x3456b6[_0xc951('0x2f')],qs[_0xc951('0x35')](_0x27e08c['query'][_0xc951('0x35')]));_0xfc7e4a[_0xc951('0x34')]=_0xfc7e4a['attributes'][_0xc951('0x36')]?_0xfc7e4a['attributes']:_0x3456b6[_0xc951('0x2f')];if(!_0x27e08c[_0xc951('0x30')][_0xc951('0x37')]('nolimit')){_0xfc7e4a[_0xc951('0x1f')]=qs['limit'](_0x27e08c[_0xc951('0x30')][_0xc951('0x1f')]);_0xfc7e4a[_0xc951('0x1e')]=qs['offset'](_0x27e08c[_0xc951('0x30')][_0xc951('0x1e')]);}_0xfc7e4a[_0xc951('0x38')]=qs[_0xc951('0x39')](_0x27e08c[_0xc951('0x30')][_0xc951('0x39')]);_0xfc7e4a[_0xc951('0x3a')]=qs[_0xc951('0x32')](_['pick'](_0x27e08c['query'],_0x3456b6[_0xc951('0x32')]),_0x507b0c);if(_0x27e08c['query'][_0xc951('0x3b')]){_0xfc7e4a[_0xc951('0x3a')]=_[_0xc951('0x3c')](_0xfc7e4a[_0xc951('0x3a')],{'$or':_[_0xc951('0x29')](_0x507b0c,function(_0x5a3c33){if(_0x5a3c33[_0xc951('0x2d')]!=='VIRTUAL'){var _0x2c246f={};_0x2c246f[_0x5a3c33['name']]={'$like':'%'+_0x27e08c['query']['filter']+'%'};return _0x2c246f;}})});}_0xfc7e4a=_[_0xc951('0x3c')]({},_0xfc7e4a,_0x27e08c[_0xc951('0x3d')]);var _0x183626={'where':_0xfc7e4a[_0xc951('0x3a')]};return db[_0xc951('0x2a')][_0xc951('0x1d')](_0x183626)['then'](function(_0x1e8cf7){_0x2a18ca[_0xc951('0x1d')]=_0x1e8cf7;if(_0x27e08c[_0xc951('0x30')][_0xc951('0x3e')]){_0xfc7e4a[_0xc951('0x3f')]=[{'all':!![]}];}return db[_0xc951('0x2a')][_0xc951('0x40')](_0xfc7e4a);})[_0xc951('0x22')](function(_0x2d0b37){_0x2a18ca[_0xc951('0x41')]=_0x2d0b37;return _0x2a18ca;})[_0xc951('0x22')](respondWithFilteredResult(_0x2446fc,_0xfc7e4a))['catch'](handleError(_0x2446fc,null));};exports[_0xc951('0x42')]=function(_0x161b75,_0x1844b5){var _0x21f210={'raw':![],'where':{'id':_0x161b75[_0xc951('0x43')]['id']}},_0x2afbfe={};_0x2afbfe[_0xc951('0x2f')]=_[_0xc951('0x31')](db[_0xc951('0x2a')][_0xc951('0x2b')]);_0x2afbfe[_0xc951('0x30')]=_['keys'](_0x161b75['query']);_0x2afbfe['filters']=_[_0xc951('0x33')](_0x2afbfe[_0xc951('0x2f')],_0x2afbfe[_0xc951('0x30')]);_0x21f210[_0xc951('0x34')]=_[_0xc951('0x33')](_0x2afbfe[_0xc951('0x2f')],qs['fields'](_0x161b75[_0xc951('0x30')][_0xc951('0x35')]));_0x21f210[_0xc951('0x34')]=_0x21f210[_0xc951('0x34')][_0xc951('0x36')]?_0x21f210[_0xc951('0x34')]:_0x2afbfe[_0xc951('0x2f')];if(_0x161b75[_0xc951('0x30')][_0xc951('0x3e')]){_0x21f210[_0xc951('0x3f')]=[{'all':!![]}];}_0x21f210=_['merge']({},_0x21f210,_0x161b75[_0xc951('0x3d')]);return db[_0xc951('0x2a')][_0xc951('0x44')](_0x21f210)[_0xc951('0x22')](handleEntityNotFound(_0x1844b5,null))[_0xc951('0x22')](respondWithResult(_0x1844b5,null))[_0xc951('0x45')](handleError(_0x1844b5,null));};exports['create']=function(_0x4f2474,_0x2fb504){return db[_0xc951('0x2a')][_0xc951('0x46')](_0x4f2474[_0xc951('0x47')],{})[_0xc951('0x22')](respondWithResult(_0x2fb504,0xc9))[_0xc951('0x45')](handleError(_0x2fb504,null));};exports[_0xc951('0x21')]=function(_0xbe8777,_0x39d8eb){if(_0xbe8777[_0xc951('0x47')]['id']){delete _0xbe8777[_0xc951('0x47')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0xbe8777[_0xc951('0x43')]['id']}})[_0xc951('0x22')](handleEntityNotFound(_0x39d8eb,null))[_0xc951('0x22')](saveUpdates(_0xbe8777[_0xc951('0x47')],null))[_0xc951('0x22')](respondWithResult(_0x39d8eb,null))[_0xc951('0x45')](handleError(_0x39d8eb,null));};exports[_0xc951('0x23')]=function(_0x5193cc,_0x43f5b1){return db[_0xc951('0x2a')]['find']({'where':{'id':_0x5193cc[_0xc951('0x43')]['id']}})[_0xc951('0x22')](handleEntityNotFound(_0x43f5b1,null))[_0xc951('0x22')](removeEntity(_0x43f5b1,null))[_0xc951('0x45')](handleError(_0x43f5b1,null));};exports[_0xc951('0x48')]=function(_0x8fb874,_0x3278a3,_0x278bc9){var _0xf94d32={};var _0x23f9c7={};var _0x2de9d4;var _0x3a511f;return db[_0xc951('0x2a')][_0xc951('0x49')]({'where':{'id':_0x8fb874['params']['id']}})[_0xc951('0x22')](handleEntityNotFound(_0x3278a3,null))[_0xc951('0x22')](function(_0x2defea){if(_0x2defea){_0x2de9d4=_0x2defea;_0x23f9c7['model']=_[_0xc951('0x31')](db[_0xc951('0x4a')][_0xc951('0x2b')]);_0x23f9c7[_0xc951('0x30')]=_[_0xc951('0x31')](_0x8fb874[_0xc951('0x30')]);_0x23f9c7[_0xc951('0x32')]=_['intersection'](_0x23f9c7[_0xc951('0x2f')],_0x23f9c7[_0xc951('0x30')]);_0xf94d32[_0xc951('0x34')]=_[_0xc951('0x33')](_0x23f9c7[_0xc951('0x2f')],qs['fields'](_0x8fb874[_0xc951('0x30')][_0xc951('0x35')]));_0xf94d32[_0xc951('0x34')]=_0xf94d32[_0xc951('0x34')]['length']?_0xf94d32[_0xc951('0x34')]:_0x23f9c7[_0xc951('0x2f')];_0xf94d32['order']=qs['sort'](_0x8fb874[_0xc951('0x30')][_0xc951('0x39')]);_0xf94d32[_0xc951('0x3a')]=qs['filters'](_[_0xc951('0x4b')](_0x8fb874['query'],_0x23f9c7[_0xc951('0x32')]));if(_0x8fb874[_0xc951('0x30')][_0xc951('0x3b')]){_0xf94d32[_0xc951('0x3a')]=_[_0xc951('0x3c')](_0xf94d32[_0xc951('0x3a')],{'$or':_[_0xc951('0x29')](_0xf94d32[_0xc951('0x34')],function(_0x3c9ae7){var _0x58e487={};_0x58e487[_0x3c9ae7]={'$like':'%'+_0x8fb874[_0xc951('0x30')]['filter']+'%'};return _0x58e487;})});}_0xf94d32=_[_0xc951('0x3c')]({},_0xf94d32,_0x8fb874[_0xc951('0x3d')]);return _0x2de9d4[_0xc951('0x48')](_0xf94d32);}})[_0xc951('0x22')](function(_0x3ef610){if(_0x3ef610){_0x3a511f=_0x3ef610[_0xc951('0x36')];if(!_0x8fb874[_0xc951('0x30')][_0xc951('0x37')](_0xc951('0x4c'))){_0xf94d32[_0xc951('0x1f')]=qs[_0xc951('0x1f')](_0x8fb874[_0xc951('0x30')][_0xc951('0x1f')]);_0xf94d32[_0xc951('0x1e')]=qs[_0xc951('0x1e')](_0x8fb874['query'][_0xc951('0x1e')]);}return _0x2de9d4[_0xc951('0x48')](_0xf94d32);}})[_0xc951('0x22')](function(_0x5ecc65){if(_0x5ecc65){return _0x5ecc65?{'count':_0x3a511f,'rows':_0x5ecc65}:null;}})[_0xc951('0x22')](respondWithResult(_0x3278a3,null))[_0xc951('0x45')](handleError(_0x3278a3,null));};exports[_0xc951('0x4d')]=function(_0x22f3fb,_0x50c912,_0x40824d){var _0x798591={};var _0x176693={};var _0x2cba4e;var _0x19e97f;return db[_0xc951('0x2a')][_0xc951('0x49')]({'where':{'id':_0x22f3fb['params']['id']}})[_0xc951('0x22')](handleEntityNotFound(_0x50c912,null))[_0xc951('0x22')](function(_0x1d6973){if(_0x1d6973){_0x2cba4e=_0x1d6973;_0x176693[_0xc951('0x2f')]=_[_0xc951('0x31')](db[_0xc951('0x4a')][_0xc951('0x2b')]);_0x176693[_0xc951('0x30')]=_['keys'](_0x22f3fb[_0xc951('0x30')]);_0x176693[_0xc951('0x32')]=_[_0xc951('0x33')](_0x176693[_0xc951('0x2f')],_0x176693[_0xc951('0x30')]);_0x798591[_0xc951('0x34')]=_[_0xc951('0x33')](_0x176693[_0xc951('0x2f')],qs[_0xc951('0x35')](_0x22f3fb[_0xc951('0x30')][_0xc951('0x35')]));_0x798591[_0xc951('0x34')]=_0x798591[_0xc951('0x34')][_0xc951('0x36')]?_0x798591['attributes']:_0x176693[_0xc951('0x2f')];_0x798591[_0xc951('0x38')]=qs[_0xc951('0x39')](_0x22f3fb[_0xc951('0x30')][_0xc951('0x39')]);_0x798591[_0xc951('0x3a')]=qs['filters'](_[_0xc951('0x4b')](_0x22f3fb[_0xc951('0x30')],_0x176693[_0xc951('0x32')]));if(_0x22f3fb['query'][_0xc951('0x3b')]){_0x798591[_0xc951('0x3a')]=_[_0xc951('0x3c')](_0x798591['where'],{'$or':_[_0xc951('0x29')](_0x798591[_0xc951('0x34')],function(_0xb80cad){var _0x5c02a1={};_0x5c02a1[_0xb80cad]={'$like':'%'+_0x22f3fb[_0xc951('0x30')][_0xc951('0x3b')]+'%'};return _0x5c02a1;})});}_0x798591=_['merge']({},_0x798591,_0x22f3fb[_0xc951('0x3d')]);return _0x2cba4e[_0xc951('0x4d')](_0x798591);}})['then'](function(_0x573b12){if(_0x573b12){_0x19e97f=_0x573b12[_0xc951('0x36')];if(!_0x22f3fb[_0xc951('0x30')]['hasOwnProperty'](_0xc951('0x4c'))){_0x798591[_0xc951('0x1f')]=qs['limit'](_0x22f3fb[_0xc951('0x30')][_0xc951('0x1f')]);_0x798591[_0xc951('0x1e')]=qs[_0xc951('0x1e')](_0x22f3fb[_0xc951('0x30')][_0xc951('0x1e')]);}return _0x2cba4e[_0xc951('0x4d')](_0x798591);}})[_0xc951('0x22')](function(_0x5b3a66){if(_0x5b3a66){return _0x5b3a66?{'count':_0x19e97f,'rows':_0x5b3a66}:null;}})[_0xc951('0x22')](respondWithResult(_0x50c912,null))[_0xc951('0x45')](handleError(_0x50c912,null));};exports[_0xc951('0x4e')]=function(_0x475cfe,_0x3e5354,_0x14109c){var _0x437f17={};var _0x266e22={};var _0x3f4254;var _0x1cadf3;return db[_0xc951('0x2a')][_0xc951('0x49')]({'where':{'id':_0x475cfe['params']['id']}})[_0xc951('0x22')](handleEntityNotFound(_0x3e5354,null))[_0xc951('0x22')](function(_0x18a919){if(_0x18a919){_0x3f4254=_0x18a919;_0x266e22[_0xc951('0x2f')]=_['keys'](db[_0xc951('0x4a')][_0xc951('0x2b')]);_0x266e22['query']=_[_0xc951('0x31')](_0x475cfe[_0xc951('0x30')]);_0x266e22[_0xc951('0x32')]=_[_0xc951('0x33')](_0x266e22[_0xc951('0x2f')],_0x266e22[_0xc951('0x30')]);_0x437f17[_0xc951('0x34')]=_[_0xc951('0x33')](_0x266e22['model'],qs['fields'](_0x475cfe[_0xc951('0x30')][_0xc951('0x35')]));_0x437f17[_0xc951('0x34')]=_0x437f17['attributes'][_0xc951('0x36')]?_0x437f17[_0xc951('0x34')]:_0x266e22[_0xc951('0x2f')];_0x437f17[_0xc951('0x38')]=qs[_0xc951('0x39')](_0x475cfe[_0xc951('0x30')][_0xc951('0x39')]);_0x437f17[_0xc951('0x3a')]=qs[_0xc951('0x32')](_[_0xc951('0x4b')](_0x475cfe['query'],_0x266e22[_0xc951('0x32')]));if(_0x475cfe[_0xc951('0x30')]['filter']){_0x437f17[_0xc951('0x3a')]=_[_0xc951('0x3c')](_0x437f17[_0xc951('0x3a')],{'$or':_[_0xc951('0x29')](_0x437f17['attributes'],function(_0x1a9249){var _0x3fc4ad={};_0x3fc4ad[_0x1a9249]={'$like':'%'+_0x475cfe[_0xc951('0x30')][_0xc951('0x3b')]+'%'};return _0x3fc4ad;})});}_0x437f17=_[_0xc951('0x3c')]({},_0x437f17,_0x475cfe['options']);return _0x3f4254['getDescriptions'](_0x437f17);}})[_0xc951('0x22')](function(_0x174574){if(_0x174574){_0x1cadf3=_0x174574[_0xc951('0x36')];if(!_0x475cfe[_0xc951('0x30')][_0xc951('0x37')]('nolimit')){_0x437f17['limit']=qs[_0xc951('0x1f')](_0x475cfe[_0xc951('0x30')][_0xc951('0x1f')]);_0x437f17[_0xc951('0x1e')]=qs[_0xc951('0x1e')](_0x475cfe['query']['offset']);}return _0x3f4254[_0xc951('0x4e')](_0x437f17);}})['then'](function(_0x19039e){if(_0x19039e){return _0x19039e?{'count':_0x1cadf3,'rows':_0x19039e}:null;}})[_0xc951('0x22')](respondWithResult(_0x3e5354,null))[_0xc951('0x45')](handleError(_0x3e5354,null));};
\ No newline at end of file
index 9b3acd0..e485dc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1196=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','request-promise','path'];(function(_0x4b9c3f,_0x23c102){var _0x425a1b=function(_0x25f6f2){while(--_0x25f6f2){_0x4b9c3f['push'](_0x4b9c3f['shift']());}};_0x425a1b(++_0x23c102);}(_0x1196,0xd5));var _0x6119=function(_0x137aeb,_0x321e72){_0x137aeb=_0x137aeb-0x0;var _0x11246d=_0x1196[_0x137aeb];return _0x11246d;};'use strict';var _=require(_0x6119('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6119('0x1'));var fs=require('fs');var path=require(_0x6119('0x2'));var rimraf=require(_0x6119('0x3'));var config=require(_0x6119('0x4'));var attributes=require(_0x6119('0x5'));module[_0x6119('0x6')]=function(_0x3be4d2,_0x1fa6b2){return _0x3be4d2[_0x6119('0x7')]('VtigerConfiguration',attributes,{'tableName':_0x6119('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac3a=['int_vtiger_configurations','lodash','api','bluebird','rimraf','exports','VtigerConfiguration'];(function(_0x276b69,_0x37fcee){var _0x1d70ed=function(_0x53b6de){while(--_0x53b6de){_0x276b69['push'](_0x276b69['shift']());}};_0x1d70ed(++_0x37fcee);}(_0xac3a,0xd3));var _0xaac3=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0xac3a[_0x22b8a3];return _0x199a0c;};'use strict';var _=require(_0xaac3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaac3('0x1'));var moment=require('moment');var BPromise=require(_0xaac3('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaac3('0x3'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0xaac3('0x4')]=function(_0xab9cb7,_0x1b35af){return _0xab9cb7['define'](_0xaac3('0x5'),attributes,{'tableName':_0xaac3('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4fbd1be..382fe9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f62=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','VtigerConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x9f62,0x189));var _0x29f6=function(_0xdef85a,_0x241f54){_0xdef85a=_0xdef85a-0x0;var _0x3f5638=_0x9f62[_0xdef85a];return _0x3f5638;};'use strict';var _=require(_0x29f6('0x0'));var util=require(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rs=require(_0x29f6('0x4'));var fs=require('fs');var Redis=require(_0x29f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x29f6('0x6'));var logger=require(_0x29f6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x29f6('0x8')][_0x29f6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e23e7,_0x2abb2b,_0x2e6959){return new BPromise(function(_0xf89caa,_0x32ad6a){return client[_0x29f6('0xa')](_0x2e23e7,_0x2e6959)[_0x29f6('0xb')](function(_0x14fc0c){logger[_0x29f6('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x2abb2b,_0x29f6('0xd'));logger[_0x29f6('0xe')](_0x29f6('0xf'),_0x2abb2b,_0x29f6('0xd'),JSON['stringify'](_0x14fc0c));if(_0x14fc0c[_0x29f6('0x10')]){if(_0x14fc0c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x2abb2b,_0x14fc0c[_0x29f6('0x10')]['message']);return _0x32ad6a(_0x14fc0c[_0x29f6('0x10')][_0x29f6('0x12')]);}logger[_0x29f6('0x10')](_0x29f6('0x13'),_0x2abb2b,_0x14fc0c['error'][_0x29f6('0x12')]);return _0xf89caa(_0x14fc0c[_0x29f6('0x10')]['message']);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x2abb2b,'request\x20sent');_0xf89caa(_0x14fc0c[_0x29f6('0x14')][_0x29f6('0x12')]);}})[_0x29f6('0x15')](function(_0x21033f){logger['error'](_0x29f6('0x13'),_0x2abb2b,_0x21033f);_0x32ad6a(_0x21033f);});});}
\ No newline at end of file
+var _0xcb39=['request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0xb984a7,_0x564ef9){var _0x247044=function(_0x4142c7){while(--_0x4142c7){_0xb984a7['push'](_0xb984a7['shift']());}};_0x247044(++_0x564ef9);}(_0xcb39,0x1ed));var _0x9cb3=function(_0x25c73d,_0x986f2b){_0x25c73d=_0x25c73d-0x0;var _0x4c0313=_0xcb39[_0x25c73d];return _0x4c0313;};'use strict';var _=require(_0x9cb3('0x0'));var util=require(_0x9cb3('0x1'));var moment=require(_0x9cb3('0x2'));var BPromise=require(_0x9cb3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9cb3('0x4'))['db'];var utils=require(_0x9cb3('0x5'));var logger=require(_0x9cb3('0x6'))(_0x9cb3('0x7'));var config=require(_0x9cb3('0x8'));var jayson=require(_0x9cb3('0x9'));var client=jayson['client'][_0x9cb3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x111c18,_0x43cf14,_0x33c979){return new BPromise(function(_0x3d64d8,_0x4a9755){return client[_0x9cb3('0xb')](_0x111c18,_0x33c979)['then'](function(_0x45c354){logger[_0x9cb3('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x43cf14,_0x9cb3('0xd'));logger['debug'](_0x9cb3('0xe'),_0x43cf14,_0x9cb3('0xd'),JSON[_0x9cb3('0xf')](_0x45c354));if(_0x45c354['error']){if(_0x45c354['error'][_0x9cb3('0x10')]===0x1f4){logger[_0x9cb3('0x11')](_0x9cb3('0x12'),_0x43cf14,_0x45c354[_0x9cb3('0x11')]['message']);return _0x4a9755(_0x45c354['error'][_0x9cb3('0x13')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x43cf14,_0x45c354['error'][_0x9cb3('0x13')]);return _0x3d64d8(_0x45c354['error'][_0x9cb3('0x13')]);}else{logger[_0x9cb3('0xc')](_0x9cb3('0x12'),_0x43cf14,_0x9cb3('0xd'));_0x3d64d8(_0x45c354[_0x9cb3('0x14')][_0x9cb3('0x13')]);}})[_0x9cb3('0x15')](function(_0x51cdaa){logger['error'](_0x9cb3('0x12'),_0x43cf14,_0x51cdaa);_0x4a9755(_0x51cdaa);});});}
\ No newline at end of file
index 490f712..52ea43a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cfc=['post','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show'];(function(_0x5af5a8,_0x10ce33){var _0x414545=function(_0xb57b5c){while(--_0xb57b5c){_0x5af5a8['push'](_0x5af5a8['shift']());}};_0x414545(++_0x10ce33);}(_0x6cfc,0x135));var _0xc6cf=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0x6cfc[_0x1e06f1];return _0x34f77e;};'use strict';var multer=require('multer');var util=require(_0xc6cf('0x0'));var path=require(_0xc6cf('0x1'));var timeout=require(_0xc6cf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc6cf('0x3'));var auth=require(_0xc6cf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6cf('0x5'));var controller=require(_0xc6cf('0x6'));router[_0xc6cf('0x7')]('/',auth[_0xc6cf('0x8')](),controller[_0xc6cf('0x9')]);router[_0xc6cf('0x7')]('/:id',auth[_0xc6cf('0x8')](),controller[_0xc6cf('0xa')]);router[_0xc6cf('0xb')]('/',auth[_0xc6cf('0x8')](),controller['create']);router['put']('/:id',auth[_0xc6cf('0x8')](),controller[_0xc6cf('0xc')]);router[_0xc6cf('0xd')]('/:id',auth[_0xc6cf('0x8')](),controller[_0xc6cf('0xe')]);module[_0xc6cf('0xf')]=router;
\ No newline at end of file
+var _0xa6d0=['./intVtigerField.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5ddfe1,_0x27a8e6){var _0x3da73a=function(_0x50b16b){while(--_0x50b16b){_0x5ddfe1['push'](_0x5ddfe1['shift']());}};_0x3da73a(++_0x27a8e6);}(_0xa6d0,0xf6));var _0x0a6d=function(_0x117bdd,_0x29a86e){_0x117bdd=_0x117bdd-0x0;var _0x93ed36=_0xa6d0[_0x117bdd];return _0x93ed36;};'use strict';var multer=require(_0x0a6d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6d('0x1'));var router=express['Router']();var fs_extra=require(_0x0a6d('0x2'));var auth=require(_0x0a6d('0x3'));var interaction=require(_0x0a6d('0x4'));var config=require(_0x0a6d('0x5'));var controller=require(_0x0a6d('0x6'));router['get']('/',auth[_0x0a6d('0x7')](),controller[_0x0a6d('0x8')]);router['get'](_0x0a6d('0x9'),auth[_0x0a6d('0x7')](),controller[_0x0a6d('0xa')]);router[_0x0a6d('0xb')]('/',auth[_0x0a6d('0x7')](),controller[_0x0a6d('0xc')]);router[_0x0a6d('0xd')](_0x0a6d('0x9'),auth['isAuthenticated'](),controller[_0x0a6d('0xe')]);router[_0x0a6d('0xf')](_0x0a6d('0x9'),auth[_0x0a6d('0x7')](),controller[_0x0a6d('0x10')]);module[_0x0a6d('0x11')]=router;
\ No newline at end of file
index 39effb6..e804a77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x762b=['exports','string','variable','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize'];(function(_0x40dc22,_0x21aa75){var _0x413c19=function(_0x49c02c){while(--_0x49c02c){_0x40dc22['push'](_0x40dc22['shift']());}};_0x413c19(++_0x21aa75);}(_0x762b,0x14c));var _0xb762=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x762b[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xb762('0x0'));module[_0xb762('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb762('0x2'),_0xb762('0x3'),'customVariable','keyValue',_0xb762('0x4')),'defaultValue':_0xb762('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb762('0x5')]},'keyType':{'type':Sequelize[_0xb762('0x6')]('string','variable',_0xb762('0x7'))},'keyContent':{'type':Sequelize[_0xb762('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb762('0x5')]},'customField':{'type':Sequelize[_0xb762('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb762('0x5')]}};
\ No newline at end of file
+var _0x7d09=['exports','ENUM','customVariable','keyValue','picklist','STRING','string','variable','BOOLEAN','sequelize'];(function(_0x4a209a,_0x575ff9){var _0x4b3c20=function(_0x1a50c1){while(--_0x1a50c1){_0x4a209a['push'](_0x4a209a['shift']());}};_0x4b3c20(++_0x575ff9);}(_0x7d09,0x1e9));var _0x97d0=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0x7d09[_0x53b133];return _0x5647e0;};'use strict';var Sequelize=require(_0x97d0('0x0'));module[_0x97d0('0x1')]={'type':{'type':Sequelize[_0x97d0('0x2')]('string','variable',_0x97d0('0x3'),_0x97d0('0x4'),_0x97d0('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x97d0('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x97d0('0x2')](_0x97d0('0x7'),_0x97d0('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x97d0('0x6')]},'idField':{'type':Sequelize[_0x97d0('0x6')]},'nameField':{'type':Sequelize[_0x97d0('0x6')]},'customField':{'type':Sequelize[_0x97d0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 21c0019..0bf16e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf90=['rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','sendStatus','error','name','send','index','map','VtigerField'];(function(_0xc4b96d,_0xc752cd){var _0x27dea5=function(_0x191d94){while(--_0x191d94){_0xc4b96d['push'](_0xc4b96d['shift']());}};_0x27dea5(++_0xc752cd);}(_0xcf90,0x19b));var _0x0cf9=function(_0x4a57ab,_0x2baf24){_0x4a57ab=_0x4a57ab-0x0;var _0x45d2b6=_0xcf90[_0x4a57ab];return _0x45d2b6;};'use strict';var emlformat=require(_0x0cf9('0x0'));var rimraf=require(_0x0cf9('0x1'));var zipdir=require(_0x0cf9('0x2'));var jsonpatch=require(_0x0cf9('0x3'));var rp=require(_0x0cf9('0x4'));var moment=require(_0x0cf9('0x5'));var BPromise=require(_0x0cf9('0x6'));var Mustache=require(_0x0cf9('0x7'));var util=require(_0x0cf9('0x8'));var path=require(_0x0cf9('0x9'));var sox=require(_0x0cf9('0xa'));var csv=require(_0x0cf9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cf9('0xc'));var _=require(_0x0cf9('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0cf9('0xe'));var deskjs=require(_0x0cf9('0xf'));var toCsv=require(_0x0cf9('0xb'));var querystring=require('querystring');var Papa=require(_0x0cf9('0x10'));var Redis=require(_0x0cf9('0x11'));var authService=require(_0x0cf9('0x12'));var qs=require(_0x0cf9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0cf9('0x14'));var logger=require(_0x0cf9('0x15'))(_0x0cf9('0x16'));var utils=require(_0x0cf9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0cf9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8d893,_0x1d5926){_0x1d5926=_0x1d5926||0xcc;return function(_0x2aecd9){if(_0x2aecd9){return _0x8d893['sendStatus'](_0x1d5926);}return _0x8d893[_0x0cf9('0x19')](_0x1d5926)[_0x0cf9('0x1a')]();};}function respondWithResult(_0x25ec81,_0x1cbc2b){_0x1cbc2b=_0x1cbc2b||0xc8;return function(_0x181e1f){if(_0x181e1f){return _0x25ec81[_0x0cf9('0x19')](_0x1cbc2b)[_0x0cf9('0x1b')](_0x181e1f);}};}function respondWithFilteredResult(_0x52e6ae,_0x2d2fdf){return function(_0x294f79){if(_0x294f79){var _0x478b72=typeof _0x2d2fdf['offset']===_0x0cf9('0x1c')&&typeof _0x2d2fdf[_0x0cf9('0x1d')]===_0x0cf9('0x1c');var _0xac3079=_0x294f79[_0x0cf9('0x1e')];var _0x3ce34b=_0x478b72?0x0:_0x2d2fdf[_0x0cf9('0x1f')];var _0x5e63ef=_0x478b72?_0x294f79[_0x0cf9('0x1e')]:_0x2d2fdf[_0x0cf9('0x1f')]+_0x2d2fdf[_0x0cf9('0x1d')];var _0x2a0830;if(_0x5e63ef>=_0xac3079){_0x5e63ef=_0xac3079;_0x2a0830=0xc8;}else{_0x2a0830=0xce;}_0x52e6ae[_0x0cf9('0x19')](_0x2a0830);return _0x52e6ae[_0x0cf9('0x20')](_0x0cf9('0x21'),_0x3ce34b+'-'+_0x5e63ef+'/'+_0xac3079)[_0x0cf9('0x1b')](_0x294f79);}return null;};}function patchUpdates(_0x346eb6){return function(_0x28df59){try{jsonpatch[_0x0cf9('0x22')](_0x28df59,_0x346eb6,!![]);}catch(_0x269cc2){return BPromise[_0x0cf9('0x23')](_0x269cc2);}return _0x28df59['save']();};}function saveUpdates(_0x322fdc,_0x187e47){return function(_0xabe43){if(_0xabe43){return _0xabe43['update'](_0x322fdc)[_0x0cf9('0x24')](function(_0x32dd7a){return _0x32dd7a;});}return null;};}function removeEntity(_0x5a4bbb,_0x5e12fe){return function(_0x932049){if(_0x932049){return _0x932049[_0x0cf9('0x25')]()['then'](function(){_0x5a4bbb[_0x0cf9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aaba1,_0x114f1e){return function(_0x346a77){if(!_0x346a77){_0x3aaba1[_0x0cf9('0x26')](0x194);}return _0x346a77;};}function handleError(_0x243bb0,_0x4507ba){_0x4507ba=_0x4507ba||0x1f4;return function(_0x3cafbc){logger[_0x0cf9('0x27')](_0x3cafbc['stack']);if(_0x3cafbc[_0x0cf9('0x28')]){delete _0x3cafbc['name'];}_0x243bb0[_0x0cf9('0x19')](_0x4507ba)[_0x0cf9('0x29')](_0x3cafbc);};}exports[_0x0cf9('0x2a')]=function(_0x1b13b3,_0x4a2743){var _0x45b26d={},_0x33d15c={},_0x232f19={'count':0x0,'rows':[]};var _0x400f43=_[_0x0cf9('0x2b')](db[_0x0cf9('0x2c')][_0x0cf9('0x2d')],function(_0x1c30cd){return{'name':_0x1c30cd['fieldName'],'type':_0x1c30cd[_0x0cf9('0x2e')][_0x0cf9('0x2f')]};});_0x33d15c[_0x0cf9('0x30')]=_['map'](_0x400f43,_0x0cf9('0x28'));_0x33d15c[_0x0cf9('0x31')]=_[_0x0cf9('0x32')](_0x1b13b3['query']);_0x33d15c['filters']=_['intersection'](_0x33d15c[_0x0cf9('0x30')],_0x33d15c['query']);_0x45b26d[_0x0cf9('0x33')]=_[_0x0cf9('0x34')](_0x33d15c[_0x0cf9('0x30')],qs[_0x0cf9('0x35')](_0x1b13b3[_0x0cf9('0x31')][_0x0cf9('0x35')]));_0x45b26d['attributes']=_0x45b26d[_0x0cf9('0x33')][_0x0cf9('0x36')]?_0x45b26d[_0x0cf9('0x33')]:_0x33d15c['model'];if(!_0x1b13b3[_0x0cf9('0x31')][_0x0cf9('0x37')](_0x0cf9('0x38'))){_0x45b26d['limit']=qs[_0x0cf9('0x1d')](_0x1b13b3[_0x0cf9('0x31')][_0x0cf9('0x1d')]);_0x45b26d[_0x0cf9('0x1f')]=qs[_0x0cf9('0x1f')](_0x1b13b3['query'][_0x0cf9('0x1f')]);}_0x45b26d[_0x0cf9('0x39')]=qs[_0x0cf9('0x3a')](_0x1b13b3[_0x0cf9('0x31')][_0x0cf9('0x3a')]);_0x45b26d[_0x0cf9('0x3b')]=qs[_0x0cf9('0x3c')](_['pick'](_0x1b13b3[_0x0cf9('0x31')],_0x33d15c['filters']),_0x400f43);if(_0x1b13b3[_0x0cf9('0x31')][_0x0cf9('0x3d')]){_0x45b26d[_0x0cf9('0x3b')]=_[_0x0cf9('0x3e')](_0x45b26d['where'],{'$or':_[_0x0cf9('0x2b')](_0x400f43,function(_0x2a29f4){if(_0x2a29f4['type']!==_0x0cf9('0x3f')){var _0x476312={};_0x476312[_0x2a29f4[_0x0cf9('0x28')]]={'$like':'%'+_0x1b13b3[_0x0cf9('0x31')]['filter']+'%'};return _0x476312;}})});}_0x45b26d=_['merge']({},_0x45b26d,_0x1b13b3[_0x0cf9('0x40')]);var _0x2e29f7={'where':_0x45b26d[_0x0cf9('0x3b')]};return db[_0x0cf9('0x2c')][_0x0cf9('0x1e')](_0x2e29f7)[_0x0cf9('0x24')](function(_0x25f818){_0x232f19['count']=_0x25f818;if(_0x1b13b3[_0x0cf9('0x31')]['includeAll']){_0x45b26d[_0x0cf9('0x41')]=[{'all':!![]}];}return db[_0x0cf9('0x2c')][_0x0cf9('0x42')](_0x45b26d);})[_0x0cf9('0x24')](function(_0x31873d){_0x232f19[_0x0cf9('0x43')]=_0x31873d;return _0x232f19;})[_0x0cf9('0x24')](respondWithFilteredResult(_0x4a2743,_0x45b26d))[_0x0cf9('0x44')](handleError(_0x4a2743,null));};exports[_0x0cf9('0x45')]=function(_0x2238a3,_0x37f838){var _0x50e750={'raw':!![],'where':{'id':_0x2238a3['params']['id']}},_0x586754={};_0x586754['model']=_['keys'](db[_0x0cf9('0x2c')]['rawAttributes']);_0x586754[_0x0cf9('0x31')]=_[_0x0cf9('0x32')](_0x2238a3[_0x0cf9('0x31')]);_0x586754['filters']=_[_0x0cf9('0x34')](_0x586754[_0x0cf9('0x30')],_0x586754[_0x0cf9('0x31')]);_0x50e750['attributes']=_[_0x0cf9('0x34')](_0x586754[_0x0cf9('0x30')],qs['fields'](_0x2238a3['query'][_0x0cf9('0x35')]));_0x50e750[_0x0cf9('0x33')]=_0x50e750[_0x0cf9('0x33')][_0x0cf9('0x36')]?_0x50e750['attributes']:_0x586754['model'];if(_0x2238a3[_0x0cf9('0x31')][_0x0cf9('0x46')]){_0x50e750[_0x0cf9('0x41')]=[{'all':!![]}];}_0x50e750=_[_0x0cf9('0x3e')]({},_0x50e750,_0x2238a3[_0x0cf9('0x40')]);return db[_0x0cf9('0x2c')][_0x0cf9('0x47')](_0x50e750)[_0x0cf9('0x24')](handleEntityNotFound(_0x37f838,null))['then'](respondWithResult(_0x37f838,null))[_0x0cf9('0x44')](handleError(_0x37f838,null));};exports[_0x0cf9('0x48')]=function(_0x4281f7,_0x477c13){return db[_0x0cf9('0x2c')]['create'](_0x4281f7[_0x0cf9('0x49')],{})['then'](respondWithResult(_0x477c13,0xc9))['catch'](handleError(_0x477c13,null));};exports[_0x0cf9('0x4a')]=function(_0x3efc44,_0x2b13f8){if(_0x3efc44[_0x0cf9('0x49')]['id']){delete _0x3efc44['body']['id'];}return db[_0x0cf9('0x2c')]['find']({'where':{'id':_0x3efc44[_0x0cf9('0x4b')]['id']}})[_0x0cf9('0x24')](handleEntityNotFound(_0x2b13f8,null))['then'](saveUpdates(_0x3efc44[_0x0cf9('0x49')],null))['then'](respondWithResult(_0x2b13f8,null))['catch'](handleError(_0x2b13f8,null));};exports[_0x0cf9('0x25')]=function(_0x1e646e,_0x1c66d0){return db[_0x0cf9('0x2c')]['find']({'where':{'id':_0x1e646e[_0x0cf9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1c66d0,null))[_0x0cf9('0x24')](removeEntity(_0x1c66d0,null))[_0x0cf9('0x44')](handleError(_0x1c66d0,null));};
\ No newline at end of file
+var _0xcc63=['params','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','limit','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','VtigerField','findAll','rows','show'];(function(_0x38877e,_0x2e8104){var _0x2faaad=function(_0x2e1f19){while(--_0x2e1f19){_0x38877e['push'](_0x38877e['shift']());}};_0x2faaad(++_0x2e8104);}(_0xcc63,0xe7));var _0x3cc6=function(_0x2661a9,_0x44a38c){_0x2661a9=_0x2661a9-0x0;var _0x3409eb=_0xcc63[_0x2661a9];return _0x3409eb;};'use strict';var emlformat=require(_0x3cc6('0x0'));var rimraf=require(_0x3cc6('0x1'));var zipdir=require(_0x3cc6('0x2'));var jsonpatch=require(_0x3cc6('0x3'));var rp=require(_0x3cc6('0x4'));var moment=require(_0x3cc6('0x5'));var BPromise=require(_0x3cc6('0x6'));var Mustache=require('mustache');var util=require(_0x3cc6('0x7'));var path=require('path');var sox=require(_0x3cc6('0x8'));var csv=require(_0x3cc6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3cc6('0xa'));var _=require('lodash');var squel=require(_0x3cc6('0xb'));var crypto=require(_0x3cc6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3cc6('0xd'));var toCsv=require(_0x3cc6('0x9'));var querystring=require(_0x3cc6('0xe'));var Papa=require(_0x3cc6('0xf'));var Redis=require('ioredis');var authService=require(_0x3cc6('0x10'));var qs=require(_0x3cc6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3cc6('0x12'));var logger=require(_0x3cc6('0x13'))('api');var utils=require(_0x3cc6('0x14'));var config=require(_0x3cc6('0x15'));var licenseUtil=require(_0x3cc6('0x16'));var db=require(_0x3cc6('0x17'))['db'];function respondWithStatusCode(_0xd1c82e,_0x20c06){_0x20c06=_0x20c06||0xcc;return function(_0x535316){if(_0x535316){return _0xd1c82e[_0x3cc6('0x18')](_0x20c06);}return _0xd1c82e[_0x3cc6('0x19')](_0x20c06)[_0x3cc6('0x1a')]();};}function respondWithResult(_0x267ce1,_0x1ca0b7){_0x1ca0b7=_0x1ca0b7||0xc8;return function(_0x3adb1){if(_0x3adb1){return _0x267ce1[_0x3cc6('0x19')](_0x1ca0b7)[_0x3cc6('0x1b')](_0x3adb1);}};}function respondWithFilteredResult(_0x9a1e3f,_0xf72521){return function(_0x546dd6){if(_0x546dd6){var _0x42424d=typeof _0xf72521[_0x3cc6('0x1c')]===_0x3cc6('0x1d')&&typeof _0xf72521['limit']===_0x3cc6('0x1d');var _0x5eac3c=_0x546dd6[_0x3cc6('0x1e')];var _0x5f1b41=_0x42424d?0x0:_0xf72521[_0x3cc6('0x1c')];var _0x21d7ee=_0x42424d?_0x546dd6[_0x3cc6('0x1e')]:_0xf72521['offset']+_0xf72521['limit'];var _0x10b2d8;if(_0x21d7ee>=_0x5eac3c){_0x21d7ee=_0x5eac3c;_0x10b2d8=0xc8;}else{_0x10b2d8=0xce;}_0x9a1e3f[_0x3cc6('0x19')](_0x10b2d8);return _0x9a1e3f[_0x3cc6('0x1f')](_0x3cc6('0x20'),_0x5f1b41+'-'+_0x21d7ee+'/'+_0x5eac3c)['json'](_0x546dd6);}return null;};}function patchUpdates(_0x31ae85){return function(_0x3433cc){try{jsonpatch[_0x3cc6('0x21')](_0x3433cc,_0x31ae85,!![]);}catch(_0x1c3d51){return BPromise['reject'](_0x1c3d51);}return _0x3433cc[_0x3cc6('0x22')]();};}function saveUpdates(_0x454f6f,_0x5270b2){return function(_0x3eaa74){if(_0x3eaa74){return _0x3eaa74[_0x3cc6('0x23')](_0x454f6f)[_0x3cc6('0x24')](function(_0x2fe449){return _0x2fe449;});}return null;};}function removeEntity(_0x49a3bd,_0x2ddc01){return function(_0x192d15){if(_0x192d15){return _0x192d15[_0x3cc6('0x25')]()[_0x3cc6('0x24')](function(){_0x49a3bd[_0x3cc6('0x19')](0xcc)[_0x3cc6('0x1a')]();});}};}function handleEntityNotFound(_0x2aae0a,_0x116831){return function(_0x95c699){if(!_0x95c699){_0x2aae0a[_0x3cc6('0x18')](0x194);}return _0x95c699;};}function handleError(_0x3a1057,_0x5a3677){_0x5a3677=_0x5a3677||0x1f4;return function(_0x261714){logger['error'](_0x261714[_0x3cc6('0x26')]);if(_0x261714[_0x3cc6('0x27')]){delete _0x261714[_0x3cc6('0x27')];}_0x3a1057['status'](_0x5a3677)[_0x3cc6('0x28')](_0x261714);};}exports[_0x3cc6('0x29')]=function(_0x7bb0d5,_0x12fb01){var _0x560785={},_0x3c9c17={},_0x4f07f8={'count':0x0,'rows':[]};var _0x4d304b=_[_0x3cc6('0x2a')](db['VtigerField'][_0x3cc6('0x2b')],function(_0x1d341e){return{'name':_0x1d341e[_0x3cc6('0x2c')],'type':_0x1d341e['type'][_0x3cc6('0x2d')]};});_0x3c9c17[_0x3cc6('0x2e')]=_['map'](_0x4d304b,'name');_0x3c9c17[_0x3cc6('0x2f')]=_[_0x3cc6('0x30')](_0x7bb0d5[_0x3cc6('0x2f')]);_0x3c9c17[_0x3cc6('0x31')]=_[_0x3cc6('0x32')](_0x3c9c17[_0x3cc6('0x2e')],_0x3c9c17[_0x3cc6('0x2f')]);_0x560785['attributes']=_['intersection'](_0x3c9c17[_0x3cc6('0x2e')],qs[_0x3cc6('0x33')](_0x7bb0d5['query'][_0x3cc6('0x33')]));_0x560785['attributes']=_0x560785[_0x3cc6('0x34')]['length']?_0x560785['attributes']:_0x3c9c17[_0x3cc6('0x2e')];if(!_0x7bb0d5[_0x3cc6('0x2f')]['hasOwnProperty'](_0x3cc6('0x35'))){_0x560785[_0x3cc6('0x36')]=qs[_0x3cc6('0x36')](_0x7bb0d5['query'][_0x3cc6('0x36')]);_0x560785[_0x3cc6('0x1c')]=qs[_0x3cc6('0x1c')](_0x7bb0d5[_0x3cc6('0x2f')][_0x3cc6('0x1c')]);}_0x560785['order']=qs[_0x3cc6('0x37')](_0x7bb0d5[_0x3cc6('0x2f')][_0x3cc6('0x37')]);_0x560785['where']=qs['filters'](_[_0x3cc6('0x38')](_0x7bb0d5[_0x3cc6('0x2f')],_0x3c9c17[_0x3cc6('0x31')]),_0x4d304b);if(_0x7bb0d5[_0x3cc6('0x2f')][_0x3cc6('0x39')]){_0x560785['where']=_[_0x3cc6('0x3a')](_0x560785[_0x3cc6('0x3b')],{'$or':_[_0x3cc6('0x2a')](_0x4d304b,function(_0x49aebe){if(_0x49aebe[_0x3cc6('0x3c')]!==_0x3cc6('0x3d')){var _0x20d501={};_0x20d501[_0x49aebe['name']]={'$like':'%'+_0x7bb0d5['query'][_0x3cc6('0x39')]+'%'};return _0x20d501;}})});}_0x560785=_[_0x3cc6('0x3a')]({},_0x560785,_0x7bb0d5[_0x3cc6('0x3e')]);var _0x49b57a={'where':_0x560785[_0x3cc6('0x3b')]};return db['VtigerField']['count'](_0x49b57a)[_0x3cc6('0x24')](function(_0x1dbc43){_0x4f07f8['count']=_0x1dbc43;if(_0x7bb0d5[_0x3cc6('0x2f')][_0x3cc6('0x3f')]){_0x560785[_0x3cc6('0x40')]=[{'all':!![]}];}return db[_0x3cc6('0x41')][_0x3cc6('0x42')](_0x560785);})[_0x3cc6('0x24')](function(_0xb2d180){_0x4f07f8[_0x3cc6('0x43')]=_0xb2d180;return _0x4f07f8;})['then'](respondWithFilteredResult(_0x12fb01,_0x560785))['catch'](handleError(_0x12fb01,null));};exports[_0x3cc6('0x44')]=function(_0x1695f1,_0xc2dea7){var _0x3160fa={'raw':!![],'where':{'id':_0x1695f1[_0x3cc6('0x45')]['id']}},_0x532326={};_0x532326[_0x3cc6('0x2e')]=_[_0x3cc6('0x30')](db['VtigerField'][_0x3cc6('0x2b')]);_0x532326[_0x3cc6('0x2f')]=_['keys'](_0x1695f1['query']);_0x532326[_0x3cc6('0x31')]=_[_0x3cc6('0x32')](_0x532326[_0x3cc6('0x2e')],_0x532326[_0x3cc6('0x2f')]);_0x3160fa[_0x3cc6('0x34')]=_[_0x3cc6('0x32')](_0x532326[_0x3cc6('0x2e')],qs[_0x3cc6('0x33')](_0x1695f1[_0x3cc6('0x2f')]['fields']));_0x3160fa[_0x3cc6('0x34')]=_0x3160fa[_0x3cc6('0x34')][_0x3cc6('0x46')]?_0x3160fa['attributes']:_0x532326[_0x3cc6('0x2e')];if(_0x1695f1['query'][_0x3cc6('0x3f')]){_0x3160fa[_0x3cc6('0x40')]=[{'all':!![]}];}_0x3160fa=_[_0x3cc6('0x3a')]({},_0x3160fa,_0x1695f1[_0x3cc6('0x3e')]);return db[_0x3cc6('0x41')][_0x3cc6('0x47')](_0x3160fa)['then'](handleEntityNotFound(_0xc2dea7,null))[_0x3cc6('0x24')](respondWithResult(_0xc2dea7,null))[_0x3cc6('0x48')](handleError(_0xc2dea7,null));};exports[_0x3cc6('0x49')]=function(_0x381394,_0x50199e){return db[_0x3cc6('0x41')][_0x3cc6('0x49')](_0x381394[_0x3cc6('0x4a')],{})['then'](respondWithResult(_0x50199e,0xc9))[_0x3cc6('0x48')](handleError(_0x50199e,null));};exports[_0x3cc6('0x23')]=function(_0x41eb07,_0x163666){if(_0x41eb07[_0x3cc6('0x4a')]['id']){delete _0x41eb07[_0x3cc6('0x4a')]['id'];}return db[_0x3cc6('0x41')][_0x3cc6('0x47')]({'where':{'id':_0x41eb07[_0x3cc6('0x45')]['id']}})[_0x3cc6('0x24')](handleEntityNotFound(_0x163666,null))[_0x3cc6('0x24')](saveUpdates(_0x41eb07[_0x3cc6('0x4a')],null))[_0x3cc6('0x24')](respondWithResult(_0x163666,null))[_0x3cc6('0x48')](handleError(_0x163666,null));};exports[_0x3cc6('0x25')]=function(_0x5b36ff,_0x3e40a1){return db[_0x3cc6('0x41')][_0x3cc6('0x47')]({'where':{'id':_0x5b36ff[_0x3cc6('0x45')]['id']}})[_0x3cc6('0x24')](handleEntityNotFound(_0x3e40a1,null))[_0x3cc6('0x24')](removeEntity(_0x3e40a1,null))[_0x3cc6('0x48')](handleError(_0x3e40a1,null));};
\ No newline at end of file
index a9a468f..ab229e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a9a=['../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x324ce6,_0x6b3b52){var _0x3e90ed=function(_0x57a9db){while(--_0x57a9db){_0x324ce6['push'](_0x324ce6['shift']());}};_0x3e90ed(++_0x6b3b52);}(_0x1a9a,0x1b2));var _0xa1a9=function(_0x52f48b,_0x56b08b){_0x52f48b=_0x52f48b-0x0;var _0x268c0d=_0x1a9a[_0x52f48b];return _0x268c0d;};'use strict';var _=require(_0xa1a9('0x0'));var util=require(_0xa1a9('0x1'));var logger=require(_0xa1a9('0x2'))(_0xa1a9('0x3'));var moment=require(_0xa1a9('0x4'));var BPromise=require('bluebird');var rp=require(_0xa1a9('0x5'));var fs=require('fs');var path=require(_0xa1a9('0x6'));var rimraf=require(_0xa1a9('0x7'));var config=require(_0xa1a9('0x8'));var attributes=require(_0xa1a9('0x9'));module[_0xa1a9('0xa')]=function(_0x1b37f1,_0x287cef){return _0x1b37f1[_0xa1a9('0xb')](_0xa1a9('0xc'),attributes,{'tableName':_0xa1a9('0xd'),'paranoid':![],'indexes':[{'name':_0xa1a9('0xe'),'fields':[_0xa1a9('0xf'),_0xa1a9('0x10')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9443=['define','vtiger_unique_index','lodash','util','../../config/logger','moment','bluebird','../../config/environment'];(function(_0x3517a6,_0x3684f7){var _0x28c3f0=function(_0xfd1bb6){while(--_0xfd1bb6){_0x3517a6['push'](_0x3517a6['shift']());}};_0x28c3f0(++_0x3684f7);}(_0x9443,0xfa));var _0x3944=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0x9443[_0xa79977];return _0x109f10;};'use strict';var _=require(_0x3944('0x0'));var util=require(_0x3944('0x1'));var logger=require(_0x3944('0x2'))('api');var moment=require(_0x3944('0x3'));var BPromise=require(_0x3944('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3944('0x5'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x109686,_0x510bff){return _0x109686[_0x3944('0x6')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x3944('0x7'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index bb0cfe5..ea01a43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf498=['request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0xb76cb7,_0x530596){var _0x1d417b=function(_0x183576){while(--_0x183576){_0xb76cb7['push'](_0xb76cb7['shift']());}};_0x1d417b(++_0x530596);}(_0xf498,0x108));var _0x8f49=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xf498[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x8f49('0x0'));var util=require('util');var moment=require(_0x8f49('0x1'));var BPromise=require(_0x8f49('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f49('0x3'));var db=require(_0x8f49('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8f49('0x5'));var config=require(_0x8f49('0x6'));var jayson=require(_0x8f49('0x7'));var client=jayson['client'][_0x8f49('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25d471,_0x2b6f74,_0x211b5b){return new BPromise(function(_0x5b563b,_0x380320){return client[_0x8f49('0x9')](_0x25d471,_0x211b5b)['then'](function(_0x373bae){logger[_0x8f49('0xa')](_0x8f49('0xb'),_0x2b6f74,_0x8f49('0xc'));logger[_0x8f49('0xd')](_0x8f49('0xe'),_0x2b6f74,_0x8f49('0xc'),JSON[_0x8f49('0xf')](_0x373bae));if(_0x373bae[_0x8f49('0x10')]){if(_0x373bae[_0x8f49('0x10')][_0x8f49('0x11')]===0x1f4){logger[_0x8f49('0x10')](_0x8f49('0xb'),_0x2b6f74,_0x373bae[_0x8f49('0x10')][_0x8f49('0x12')]);return _0x380320(_0x373bae[_0x8f49('0x10')]['message']);}logger[_0x8f49('0x10')](_0x8f49('0xb'),_0x2b6f74,_0x373bae[_0x8f49('0x10')][_0x8f49('0x12')]);return _0x5b563b(_0x373bae[_0x8f49('0x10')][_0x8f49('0x12')]);}else{logger[_0x8f49('0xa')](_0x8f49('0xb'),_0x2b6f74,_0x8f49('0xc'));_0x5b563b(_0x373bae[_0x8f49('0x13')][_0x8f49('0x12')]);}})[_0x8f49('0x14')](function(_0x5aa68a){logger[_0x8f49('0x10')](_0x8f49('0xb'),_0x2b6f74,_0x5aa68a);_0x380320(_0x5aa68a);});});}
\ No newline at end of file
+var _0xe3cd=['jayson/promise','client','http','request','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','../../config/utils','rpc','../../config/environment'];(function(_0x3ca1dc,_0x42953d){var _0x4291bb=function(_0x5f0542){while(--_0x5f0542){_0x3ca1dc['push'](_0x3ca1dc['shift']());}};_0x4291bb(++_0x42953d);}(_0xe3cd,0x1cf));var _0xde3c=function(_0x55fea4,_0x399be6){_0x55fea4=_0x55fea4-0x0;var _0x4f7667=_0xe3cd[_0x55fea4];return _0x4f7667;};'use strict';var _=require('lodash');var util=require(_0xde3c('0x0'));var moment=require('moment');var BPromise=require(_0xde3c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xde3c('0x2'));var logger=require('../../config/logger')(_0xde3c('0x3'));var config=require(_0xde3c('0x4'));var jayson=require(_0xde3c('0x5'));var client=jayson[_0xde3c('0x6')][_0xde3c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x56914c,_0x135fba,_0x55ca60){return new BPromise(function(_0x4b3a1b,_0x4b3324){return client[_0xde3c('0x8')](_0x56914c,_0x55ca60)['then'](function(_0x35e45e){logger['info'](_0xde3c('0x9'),_0x135fba,_0xde3c('0xa'));logger['debug'](_0xde3c('0xb'),_0x135fba,_0xde3c('0xa'),JSON[_0xde3c('0xc')](_0x35e45e));if(_0x35e45e[_0xde3c('0xd')]){if(_0x35e45e[_0xde3c('0xd')][_0xde3c('0xe')]===0x1f4){logger['error'](_0xde3c('0x9'),_0x135fba,_0x35e45e[_0xde3c('0xd')][_0xde3c('0xf')]);return _0x4b3324(_0x35e45e[_0xde3c('0xd')][_0xde3c('0xf')]);}logger[_0xde3c('0xd')](_0xde3c('0x9'),_0x135fba,_0x35e45e[_0xde3c('0xd')][_0xde3c('0xf')]);return _0x4b3a1b(_0x35e45e[_0xde3c('0xd')][_0xde3c('0xf')]);}else{logger['info'](_0xde3c('0x9'),_0x135fba,_0xde3c('0xa'));_0x4b3a1b(_0x35e45e[_0xde3c('0x10')]['message']);}})[_0xde3c('0x11')](function(_0x588eab){logger[_0xde3c('0xd')](_0xde3c('0x9'),_0x135fba,_0x588eab);_0x4b3324(_0x588eab);});});}
\ No newline at end of file
index 1ba3fdc..b126e8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe084=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','addConfiguration','delete'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe084,0x192));var _0x4e08=function(_0x3c8c09,_0x2610c0){_0x3c8c09=_0x3c8c09-0x0;var _0x2c5c54=_0xe084[_0x3c8c09];return _0x2c5c54;};'use strict';var multer=require('multer');var util=require(_0x4e08('0x0'));var path=require(_0x4e08('0x1'));var timeout=require(_0x4e08('0x2'));var express=require(_0x4e08('0x3'));var router=express[_0x4e08('0x4')]();var fs_extra=require(_0x4e08('0x5'));var auth=require(_0x4e08('0x6'));var interaction=require(_0x4e08('0x7'));var config=require(_0x4e08('0x8'));var controller=require(_0x4e08('0x9'));router[_0x4e08('0xa')]('/',auth['isAuthenticated'](),controller[_0x4e08('0xb')]);router[_0x4e08('0xa')](_0x4e08('0xc'),auth['isAuthenticated'](),controller[_0x4e08('0xd')]);router[_0x4e08('0xa')](_0x4e08('0xe'),auth['isAuthenticated'](),controller[_0x4e08('0xf')]);router[_0x4e08('0xa')](_0x4e08('0x10'),auth[_0x4e08('0x11')](),controller[_0x4e08('0x12')]);router[_0x4e08('0x13')]('/',auth[_0x4e08('0x11')](),controller[_0x4e08('0x14')]);router[_0x4e08('0x13')](_0x4e08('0xe'),auth[_0x4e08('0x11')](),controller[_0x4e08('0x15')]);router['put']('/:id',auth[_0x4e08('0x11')](),controller['update']);router[_0x4e08('0x16')](_0x4e08('0xc'),auth[_0x4e08('0x11')](),controller[_0x4e08('0x17')]);module[_0x4e08('0x18')]=router;
\ No newline at end of file
+var _0xa489=['/:id/configurations','/:id','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','create','post'];(function(_0x5a8ed7,_0x25bbc1){var _0xf03e10=function(_0x223f66){while(--_0x223f66){_0x5a8ed7['push'](_0x5a8ed7['shift']());}};_0xf03e10(++_0x25bbc1);}(_0xa489,0xeb));var _0x9a48=function(_0x19336d,_0x268057){_0x19336d=_0x19336d-0x0;var _0x562673=_0xa489[_0x19336d];return _0x562673;};'use strict';var multer=require(_0x9a48('0x0'));var util=require(_0x9a48('0x1'));var path=require(_0x9a48('0x2'));var timeout=require(_0x9a48('0x3'));var express=require(_0x9a48('0x4'));var router=express['Router']();var fs_extra=require(_0x9a48('0x5'));var auth=require(_0x9a48('0x6'));var interaction=require(_0x9a48('0x7'));var config=require('../../config/environment');var controller=require(_0x9a48('0x8'));router[_0x9a48('0x9')]('/',auth[_0x9a48('0xa')](),controller[_0x9a48('0xb')]);router[_0x9a48('0x9')]('/:id',auth[_0x9a48('0xa')](),controller[_0x9a48('0xc')]);router[_0x9a48('0x9')]('/:id/configurations',auth[_0x9a48('0xa')](),controller[_0x9a48('0xd')]);router[_0x9a48('0x9')](_0x9a48('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x9a48('0xa')](),controller[_0x9a48('0xf')]);router[_0x9a48('0x10')](_0x9a48('0x11'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x9a48('0x12'),auth[_0x9a48('0xa')](),controller['update']);router[_0x9a48('0x13')](_0x9a48('0x12'),auth[_0x9a48('0xa')](),controller['destroy']);module[_0x9a48('0x14')]=router;
\ No newline at end of file
index 958b67a..058cdf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafb9=['exports','STRING','username','password','integrationTab','newTab','sequelize'];(function(_0x55677b,_0x3e5655){var _0x104b88=function(_0x78d34f){while(--_0x78d34f){_0x55677b['push'](_0x55677b['shift']());}};_0x104b88(++_0x3e5655);}(_0xafb9,0x68));var _0x9afb=function(_0x5973bd,_0x2955e2){_0x5973bd=_0x5973bd-0x0;var _0x342ec9=_0xafb9[_0x5973bd];return _0x342ec9;};'use strict';var Sequelize=require(_0x9afb('0x0'));module[_0x9afb('0x1')]={'name':{'type':Sequelize[_0x9afb('0x2')]},'description':{'type':Sequelize[_0x9afb('0x2')]},'username':{'type':Sequelize[_0x9afb('0x2')],'unique':_0x9afb('0x3')},'password':{'type':Sequelize[_0x9afb('0x2')]},'token':{'type':Sequelize[_0x9afb('0x2')]},'remoteUri':{'type':Sequelize[_0x9afb('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0x9afb('0x4'),'token'),'defaultValue':_0x9afb('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9afb('0x5'),_0x9afb('0x6')),'defaultValue':_0x9afb('0x5')}};
\ No newline at end of file
+var _0xa3e8=['exports','STRING','username','token','password','integrationTab','newTab','sequelize'];(function(_0x80307f,_0x418c11){var _0x210504=function(_0x2aa6ea){while(--_0x2aa6ea){_0x80307f['push'](_0x80307f['shift']());}};_0x210504(++_0x418c11);}(_0xa3e8,0x127));var _0x8a3e=function(_0x387b64,_0x42b049){_0x387b64=_0x387b64-0x0;var _0x16095d=_0xa3e8[_0x387b64];return _0x16095d;};'use strict';var Sequelize=require(_0x8a3e('0x0'));module[_0x8a3e('0x1')]={'name':{'type':Sequelize[_0x8a3e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8a3e('0x2')],'unique':_0x8a3e('0x3')},'password':{'type':Sequelize[_0x8a3e('0x2')]},'token':{'type':Sequelize[_0x8a3e('0x2')]},'remoteUri':{'type':Sequelize[_0x8a3e('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM']('password',_0x8a3e('0x4')),'defaultValue':_0x8a3e('0x5')},'serverUrl':{'type':Sequelize[_0x8a3e('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8a3e('0x6'),_0x8a3e('0x7')),'defaultValue':_0x8a3e('0x6')}};
\ No newline at end of file
index 18bb795..a3373f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd64b=['undefined','count','Content-Range','apply','update','then','stack','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','rows','catch','show','params','keys','includeAll','include','merge','options','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','subject','description','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit'];(function(_0x5ebb96,_0x12cc66){var _0x1c26e7=function(_0x4e8007){while(--_0x4e8007){_0x5ebb96['push'](_0x5ebb96['shift']());}};_0x1c26e7(++_0x12cc66);}(_0xd64b,0xc1));var _0xbd64=function(_0x49dba5,_0x1086fd){_0x49dba5=_0x49dba5-0x0;var _0x495fc6=_0xd64b[_0x49dba5];return _0x495fc6;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('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(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbd64('0x16'));function respondWithStatusCode(_0x2729d8,_0x3a941c){_0x3a941c=_0x3a941c||0xcc;return function(_0x2183e2){if(_0x2183e2){return _0x2729d8[_0xbd64('0x17')](_0x3a941c);}return _0x2729d8[_0xbd64('0x18')](_0x3a941c)[_0xbd64('0x19')]();};}function respondWithResult(_0x269e2f,_0x2b5808){_0x2b5808=_0x2b5808||0xc8;return function(_0x4ae471){if(_0x4ae471){return _0x269e2f[_0xbd64('0x18')](_0x2b5808)[_0xbd64('0x1a')](_0x4ae471);}};}function respondWithFilteredResult(_0x3ff550,_0x32fd34){return function(_0x29fc16){if(_0x29fc16){var _0x49a914=typeof _0x32fd34[_0xbd64('0x1b')]==='undefined'&&typeof _0x32fd34[_0xbd64('0x1c')]===_0xbd64('0x1d');var _0x3aef70=_0x29fc16[_0xbd64('0x1e')];var _0x17d015=_0x49a914?0x0:_0x32fd34[_0xbd64('0x1b')];var _0xa5491d=_0x49a914?_0x29fc16[_0xbd64('0x1e')]:_0x32fd34['offset']+_0x32fd34[_0xbd64('0x1c')];var _0x1f618b;if(_0xa5491d>=_0x3aef70){_0xa5491d=_0x3aef70;_0x1f618b=0xc8;}else{_0x1f618b=0xce;}_0x3ff550['status'](_0x1f618b);return _0x3ff550['set'](_0xbd64('0x1f'),_0x17d015+'-'+_0xa5491d+'/'+_0x3aef70)[_0xbd64('0x1a')](_0x29fc16);}return null;};}function patchUpdates(_0x196d21){return function(_0x39e2eb){try{jsonpatch[_0xbd64('0x20')](_0x39e2eb,_0x196d21,!![]);}catch(_0x816e00){return BPromise['reject'](_0x816e00);}return _0x39e2eb['save']();};}function saveUpdates(_0x6038f,_0x41f2f){return function(_0x12f67b){if(_0x12f67b){return _0x12f67b[_0xbd64('0x21')](_0x6038f)['then'](function(_0x51d118){return _0x51d118;});}return null;};}function removeEntity(_0x28497c,_0x4afaff){return function(_0x46ab38){if(_0x46ab38){return _0x46ab38['destroy']()[_0xbd64('0x22')](function(){_0x28497c[_0xbd64('0x18')](0xcc)[_0xbd64('0x19')]();});}};}function handleEntityNotFound(_0x2d0993,_0x5ae417){return function(_0x9d0fb8){if(!_0x9d0fb8){_0x2d0993[_0xbd64('0x17')](0x194);}return _0x9d0fb8;};}function handleError(_0x13f527,_0x2a44d0){_0x2a44d0=_0x2a44d0||0x1f4;return function(_0x4d1563){logger['error'](_0x4d1563[_0xbd64('0x23')]);if(_0x4d1563['name']){delete _0x4d1563['name'];}_0x13f527[_0xbd64('0x18')](_0x2a44d0)['send'](_0x4d1563);};}exports[_0xbd64('0x24')]=function(_0x5300e8,_0x28199c){var _0x5d8c35={},_0x1db9f3={},_0x3c0eaf={'count':0x0,'rows':[]};var _0x3be63a=_[_0xbd64('0x25')](db[_0xbd64('0x26')][_0xbd64('0x27')],function(_0x4ed44a){return{'name':_0x4ed44a[_0xbd64('0x28')],'type':_0x4ed44a[_0xbd64('0x29')][_0xbd64('0x2a')]};});_0x1db9f3[_0xbd64('0x2b')]=_[_0xbd64('0x25')](_0x3be63a,_0xbd64('0x2c'));_0x1db9f3['query']=_['keys'](_0x5300e8[_0xbd64('0x2d')]);_0x1db9f3['filters']=_[_0xbd64('0x2e')](_0x1db9f3[_0xbd64('0x2b')],_0x1db9f3['query']);_0x5d8c35['attributes']=_[_0xbd64('0x2e')](_0x1db9f3['model'],qs['fields'](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x5d8c35[_0xbd64('0x30')]=_0x5d8c35['attributes'][_0xbd64('0x31')]?_0x5d8c35['attributes']:_0x1db9f3[_0xbd64('0x2b')];if(!_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x32')](_0xbd64('0x33'))){_0x5d8c35[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x5300e8['query']['limit']);_0x5d8c35[_0xbd64('0x1b')]=qs[_0xbd64('0x1b')](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x1b')]);}_0x5d8c35[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x5300e8['query']['sort']);_0x5d8c35[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x5300e8['query'],_0x1db9f3['filters']),_0x3be63a);if(_0x5300e8[_0xbd64('0x2d')]['filter']){_0x5d8c35[_0xbd64('0x36')]=_['merge'](_0x5d8c35[_0xbd64('0x36')],{'$or':_[_0xbd64('0x25')](_0x3be63a,function(_0x550221){if(_0x550221[_0xbd64('0x29')]!=='VIRTUAL'){var _0x534091={};_0x534091[_0x550221[_0xbd64('0x2c')]]={'$like':'%'+_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x534091;}})});}_0x5d8c35=_['merge']({},_0x5d8c35,_0x5300e8['options']);var _0x5d6bcf={'where':_0x5d8c35[_0xbd64('0x36')]};return db[_0xbd64('0x26')]['count'](_0x5d6bcf)[_0xbd64('0x22')](function(_0x34b19a){_0x3c0eaf[_0xbd64('0x1e')]=_0x34b19a;if(_0x5300e8[_0xbd64('0x2d')]['includeAll']){_0x5d8c35['include']=[{'all':!![]}];}return db[_0xbd64('0x26')]['findAll'](_0x5d8c35);})['then'](function(_0x231fa6){_0x3c0eaf[_0xbd64('0x3a')]=_0x231fa6;return _0x3c0eaf;})[_0xbd64('0x22')](respondWithFilteredResult(_0x28199c,_0x5d8c35))[_0xbd64('0x3b')](handleError(_0x28199c,null));};exports[_0xbd64('0x3c')]=function(_0x3155b3,_0x247775){var _0x762380={'raw':![],'where':{'id':_0x3155b3[_0xbd64('0x3d')]['id']}},_0x4870fd={};_0x4870fd[_0xbd64('0x2b')]=_['keys'](db[_0xbd64('0x26')][_0xbd64('0x27')]);_0x4870fd[_0xbd64('0x2d')]=_[_0xbd64('0x3e')](_0x3155b3[_0xbd64('0x2d')]);_0x4870fd[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0x4870fd['model'],_0x4870fd[_0xbd64('0x2d')]);_0x762380['attributes']=_[_0xbd64('0x2e')](_0x4870fd['model'],qs[_0xbd64('0x2f')](_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x762380['attributes']=_0x762380[_0xbd64('0x30')]['length']?_0x762380['attributes']:_0x4870fd['model'];if(_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x3f')]){_0x762380[_0xbd64('0x40')]=[{'all':!![]}];}_0x762380=_[_0xbd64('0x41')]({},_0x762380,_0x3155b3[_0xbd64('0x42')]);return db[_0xbd64('0x26')][_0xbd64('0x43')](_0x762380)['then'](handleEntityNotFound(_0x247775,null))[_0xbd64('0x22')](respondWithResult(_0x247775,null))[_0xbd64('0x3b')](handleError(_0x247775,null));};exports[_0xbd64('0x44')]=function(_0x4e5efe,_0x105bee){return db[_0xbd64('0x26')][_0xbd64('0x44')](_0x4e5efe[_0xbd64('0x45')],{})[_0xbd64('0x22')](respondWithResult(_0x105bee,0xc9))['catch'](handleError(_0x105bee,null));};exports[_0xbd64('0x21')]=function(_0x1a9ec8,_0x2a8011){if(_0x1a9ec8[_0xbd64('0x45')]['id']){delete _0x1a9ec8['body']['id'];}return db['ZendeskAccount'][_0xbd64('0x43')]({'where':{'id':_0x1a9ec8[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2a8011,null))[_0xbd64('0x22')](saveUpdates(_0x1a9ec8[_0xbd64('0x45')],null))[_0xbd64('0x22')](respondWithResult(_0x2a8011,null))[_0xbd64('0x3b')](handleError(_0x2a8011,null));};exports[_0xbd64('0x46')]=function(_0x460158,_0x2709b2){return db[_0xbd64('0x26')][_0xbd64('0x43')]({'where':{'id':_0x460158[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2709b2,null))[_0xbd64('0x22')](removeEntity(_0x2709b2,null))['catch'](handleError(_0x2709b2,null));};exports[_0xbd64('0x47')]=function(_0x4952db,_0x5ede67,_0x552c95){var _0x4aa662={};var _0xced0ca={};var _0x2f56df;var _0x5480f5;return db[_0xbd64('0x26')][_0xbd64('0x48')]({'where':{'id':_0x4952db[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5ede67,null))[_0xbd64('0x22')](function(_0x371bad){if(_0x371bad){_0x2f56df=_0x371bad;_0xced0ca[_0xbd64('0x2b')]=_[_0xbd64('0x3e')](db[_0xbd64('0x49')][_0xbd64('0x27')]);_0xced0ca['query']=_['keys'](_0x4952db['query']);_0xced0ca[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],_0xced0ca[_0xbd64('0x2d')]);_0x4aa662['attributes']=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],qs[_0xbd64('0x2f')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x4aa662[_0xbd64('0x30')]=_0x4aa662['attributes'][_0xbd64('0x31')]?_0x4aa662[_0xbd64('0x30')]:_0xced0ca[_0xbd64('0x2b')];_0x4aa662[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x35')]);_0x4aa662[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x4952db[_0xbd64('0x2d')],_0xced0ca[_0xbd64('0x37')]));if(_0x4952db['query']['filter']){_0x4aa662[_0xbd64('0x36')]=_[_0xbd64('0x41')](_0x4aa662['where'],{'$or':_['map'](_0x4aa662[_0xbd64('0x30')],function(_0x12bc56){var _0x49051a={};_0x49051a[_0x12bc56]={'$like':'%'+_0x4952db[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x49051a;})});}_0x4aa662=_[_0xbd64('0x41')]({},_0x4aa662,_0x4952db[_0xbd64('0x42')]);return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x2d788){if(_0x2d788){_0x5480f5=_0x2d788[_0xbd64('0x31')];if(!_0x4952db[_0xbd64('0x2d')]['hasOwnProperty'](_0xbd64('0x33'))){_0x4aa662[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x4952db['query'][_0xbd64('0x1c')]);_0x4aa662[_0xbd64('0x1b')]=qs['offset'](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x1b')]);}return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x3615bc){if(_0x3615bc){return _0x3615bc?{'count':_0x5480f5,'rows':_0x3615bc}:null;}})[_0xbd64('0x22')](respondWithResult(_0x5ede67,null))['catch'](handleError(_0x5ede67,null));};exports[_0xbd64('0x4a')]=function(_0x1f3bd0,_0xc57eb1,_0x28d899){if(_0x1f3bd0['body']['id']){delete _0x1f3bd0[_0xbd64('0x45')]['id'];}return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x1f3bd0[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0xc57eb1,null))[_0xbd64('0x22')](function(_0x10e269){if(_0x10e269){_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4b')]=_0x10e269['id'];_0x1f3bd0['body'][_0xbd64('0x4c')]=integrations[_0xbd64('0x4d')](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);_0x1f3bd0['body']['Descriptions']=integrations['getDescriptions'](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);return db[_0xbd64('0x49')][_0xbd64('0x44')](_0x1f3bd0['body'],{'include':[{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x4c')},{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x50')}]});}return null;})[_0xbd64('0x22')](respondWithResult(_0xc57eb1,null))[_0xbd64('0x3b')](handleError(_0xc57eb1,null));};exports[_0xbd64('0x51')]=function(_0x3d7e47,_0x301f42,_0x18e724){var _0x32e611='';return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x3d7e47['params']['id']},'attributes':['id',_0xbd64('0x52'),_0xbd64('0x53'),_0xbd64('0x54'),'authType',_0xbd64('0x55')]})['then'](handleEntityNotFound(_0x301f42,null))[_0xbd64('0x22')](function(_0x36ebb5){if(_0x36ebb5){_0x32e611=_0x36ebb5[_0xbd64('0x55')];var _0x819774=_0x32e611['slice'](-0x1);if(_0x819774==='/'){_0x32e611=_0x32e611[_0xbd64('0x56')](0x0,_0x32e611['lastIndexOf'](_0x819774));}var _0x14f79e={'method':_0xbd64('0x57'),'uri':util[_0xbd64('0x58')](_0xbd64('0x59'),_0x32e611,_0xbd64('0x5a')),'json':!![]};switch(_0x36ebb5['authType']){case _0xbd64('0x53'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util['format'](_0xbd64('0x5c'),new Buffer(util[_0xbd64('0x58')](_0xbd64('0x5d'),_0x36ebb5[_0xbd64('0x52')],_0x36ebb5['password']))[_0xbd64('0x5e')]('base64'))};break;case _0xbd64('0x54'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util[_0xbd64('0x58')]('Basic\x20%s',new Buffer(util['format']('%s/token:%s',_0x36ebb5['username'],_0x36ebb5[_0xbd64('0x54')]))[_0xbd64('0x5e')](_0xbd64('0x5f')))};break;default:throw new db[(_0xbd64('0x60'))][(_0xbd64('0x61'))]('Unknown\x20authentication\x20type');}return rp(_0x14f79e);}})[_0xbd64('0x22')](function(_0x23de71){if(_0x23de71){var _0xac13e6=[_0xbd64('0x62'),_0xbd64('0x63'),'group',_0xbd64('0x64')];_[_0xbd64('0x65')](_0x23de71[_0xbd64('0x5a')],function(_0x808467){return _0xac13e6['includes'](_0x808467['type']);});return{'count':_0x23de71[_0xbd64('0x5a')][_0xbd64('0x31')],'rows':_[_0xbd64('0x25')](_0x23de71[_0xbd64('0x5a')],function(_0x18b0f0){return{'id':_0x18b0f0['id'],'name':_0x18b0f0[_0xbd64('0x66')]>0x7?_0x18b0f0[_0xbd64('0x67')]:_0x18b0f0[_0xbd64('0x29')],'custom':_0x18b0f0['position']>0x7?!![]:![],'options':_0x18b0f0[_0xbd64('0x68')]?_0x18b0f0['system_field_options']:_0x18b0f0[_0xbd64('0x69')]?_0x18b0f0[_0xbd64('0x69')]:[]};})};}})[_0xbd64('0x22')](respondWithResult(_0x301f42,null))['catch'](function(_0x15b625){var _0x5c30f9=_0x3d7e47['query'][_0xbd64('0x6a')]?0x1f4:_0x15b625[_0xbd64('0x6b')]||0x1f4;logger[_0xbd64('0x6c')]('getFields,\x20%s,\x20%s,\x20%s',_0xbd64('0x51'),_0x5c30f9,JSON[_0xbd64('0x6d')](_0x15b625));delete _0x15b625[_0xbd64('0x2c')];if(_0x5c30f9===0x191){_0x5c30f9=0x190;}_0x301f42[_0xbd64('0x18')](_0x5c30f9)['send'](_0x3d7e47[_0xbd64('0x2d')][_0xbd64('0x6a')]?{'message':_0xbd64('0x6e'),'statusCode':_0x15b625[_0xbd64('0x6b')]}:_0x15b625);});};
\ No newline at end of file
+var _0xea28=['stack','name','index','map','ZendeskAccount','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','length','find','catch','create','body','getConfigurations','ZendeskConfiguration','order','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','remoteUri','slice','lastIndexOf','GET','format','ticket_fields','authType','%s:%s','token','Basic\x20%s','%s/token:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','remove','title','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','error'];(function(_0x2b0114,_0x313283){var _0x20f9a1=function(_0x4a00e4){while(--_0x4a00e4){_0x2b0114['push'](_0x2b0114['shift']());}};_0x20f9a1(++_0x313283);}(_0xea28,0x13a));var _0x8ea2=function(_0x2f03d4,_0x2c216b){_0x2f03d4=_0x2f03d4-0x0;var _0x52712f=_0xea28[_0x2f03d4];return _0x52712f;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ea2('0x16'))(_0x8ea2('0x17'));var utils=require(_0x8ea2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8ea2('0x19'));var db=require(_0x8ea2('0x1a'))['db'];var integrations=require(_0x8ea2('0x1b'));function respondWithStatusCode(_0x10aead,_0xe47c0e){_0xe47c0e=_0xe47c0e||0xcc;return function(_0x5e662e){if(_0x5e662e){return _0x10aead[_0x8ea2('0x1c')](_0xe47c0e);}return _0x10aead['status'](_0xe47c0e)['end']();};}function respondWithResult(_0x772bad,_0x4726a7){_0x4726a7=_0x4726a7||0xc8;return function(_0x416bae){if(_0x416bae){return _0x772bad[_0x8ea2('0x1d')](_0x4726a7)[_0x8ea2('0x1e')](_0x416bae);}};}function respondWithFilteredResult(_0xbb9bd1,_0x3cff96){return function(_0x11f5e8){if(_0x11f5e8){var _0x474873=typeof _0x3cff96[_0x8ea2('0x1f')]===_0x8ea2('0x20')&&typeof _0x3cff96[_0x8ea2('0x21')]===_0x8ea2('0x20');var _0xaa8abf=_0x11f5e8[_0x8ea2('0x22')];var _0x174ef2=_0x474873?0x0:_0x3cff96[_0x8ea2('0x1f')];var _0x2a0329=_0x474873?_0x11f5e8[_0x8ea2('0x22')]:_0x3cff96[_0x8ea2('0x1f')]+_0x3cff96[_0x8ea2('0x21')];var _0x287597;if(_0x2a0329>=_0xaa8abf){_0x2a0329=_0xaa8abf;_0x287597=0xc8;}else{_0x287597=0xce;}_0xbb9bd1['status'](_0x287597);return _0xbb9bd1['set'](_0x8ea2('0x23'),_0x174ef2+'-'+_0x2a0329+'/'+_0xaa8abf)[_0x8ea2('0x1e')](_0x11f5e8);}return null;};}function patchUpdates(_0x29151a){return function(_0x5ebc04){try{jsonpatch[_0x8ea2('0x24')](_0x5ebc04,_0x29151a,!![]);}catch(_0x218bd0){return BPromise['reject'](_0x218bd0);}return _0x5ebc04[_0x8ea2('0x25')]();};}function saveUpdates(_0x283f00,_0x37229a){return function(_0x9f9548){if(_0x9f9548){return _0x9f9548[_0x8ea2('0x26')](_0x283f00)[_0x8ea2('0x27')](function(_0x199417){return _0x199417;});}return null;};}function removeEntity(_0x1e4cc9,_0x18ec34){return function(_0x4d5030){if(_0x4d5030){return _0x4d5030[_0x8ea2('0x28')]()['then'](function(){_0x1e4cc9[_0x8ea2('0x1d')](0xcc)[_0x8ea2('0x29')]();});}};}function handleEntityNotFound(_0x29b38f,_0x4e2106){return function(_0x53ed43){if(!_0x53ed43){_0x29b38f[_0x8ea2('0x1c')](0x194);}return _0x53ed43;};}function handleError(_0x4dc7bf,_0x200a49){_0x200a49=_0x200a49||0x1f4;return function(_0x4e786d){logger[_0x8ea2('0x2a')](_0x4e786d[_0x8ea2('0x2b')]);if(_0x4e786d[_0x8ea2('0x2c')]){delete _0x4e786d[_0x8ea2('0x2c')];}_0x4dc7bf['status'](_0x200a49)['send'](_0x4e786d);};}exports[_0x8ea2('0x2d')]=function(_0x4da5b3,_0x4a9875){var _0x287078={},_0x24f187={},_0x41f482={'count':0x0,'rows':[]};var _0x307c74=_[_0x8ea2('0x2e')](db[_0x8ea2('0x2f')][_0x8ea2('0x30')],function(_0x19e868){return{'name':_0x19e868[_0x8ea2('0x31')],'type':_0x19e868['type']['key']};});_0x24f187[_0x8ea2('0x32')]=_[_0x8ea2('0x2e')](_0x307c74,'name');_0x24f187['query']=_[_0x8ea2('0x33')](_0x4da5b3['query']);_0x24f187[_0x8ea2('0x34')]=_[_0x8ea2('0x35')](_0x24f187['model'],_0x24f187[_0x8ea2('0x36')]);_0x287078[_0x8ea2('0x37')]=_[_0x8ea2('0x35')](_0x24f187['model'],qs['fields'](_0x4da5b3['query'][_0x8ea2('0x38')]));_0x287078[_0x8ea2('0x37')]=_0x287078[_0x8ea2('0x37')]['length']?_0x287078[_0x8ea2('0x37')]:_0x24f187[_0x8ea2('0x32')];if(!_0x4da5b3[_0x8ea2('0x36')][_0x8ea2('0x39')](_0x8ea2('0x3a'))){_0x287078[_0x8ea2('0x21')]=qs[_0x8ea2('0x21')](_0x4da5b3[_0x8ea2('0x36')]['limit']);_0x287078[_0x8ea2('0x1f')]=qs[_0x8ea2('0x1f')](_0x4da5b3[_0x8ea2('0x36')][_0x8ea2('0x1f')]);}_0x287078['order']=qs[_0x8ea2('0x3b')](_0x4da5b3['query'][_0x8ea2('0x3b')]);_0x287078[_0x8ea2('0x3c')]=qs[_0x8ea2('0x34')](_[_0x8ea2('0x3d')](_0x4da5b3['query'],_0x24f187[_0x8ea2('0x34')]),_0x307c74);if(_0x4da5b3['query']['filter']){_0x287078[_0x8ea2('0x3c')]=_['merge'](_0x287078[_0x8ea2('0x3c')],{'$or':_[_0x8ea2('0x2e')](_0x307c74,function(_0x1c229d){if(_0x1c229d[_0x8ea2('0x3e')]!==_0x8ea2('0x3f')){var _0x4ae536={};_0x4ae536[_0x1c229d[_0x8ea2('0x2c')]]={'$like':'%'+_0x4da5b3['query'][_0x8ea2('0x40')]+'%'};return _0x4ae536;}})});}_0x287078=_[_0x8ea2('0x41')]({},_0x287078,_0x4da5b3[_0x8ea2('0x42')]);var _0x3995ff={'where':_0x287078['where']};return db[_0x8ea2('0x2f')]['count'](_0x3995ff)[_0x8ea2('0x27')](function(_0x5ba351){_0x41f482[_0x8ea2('0x22')]=_0x5ba351;if(_0x4da5b3[_0x8ea2('0x36')][_0x8ea2('0x43')]){_0x287078[_0x8ea2('0x44')]=[{'all':!![]}];}return db[_0x8ea2('0x2f')][_0x8ea2('0x45')](_0x287078);})[_0x8ea2('0x27')](function(_0x478d5c){_0x41f482['rows']=_0x478d5c;return _0x41f482;})[_0x8ea2('0x27')](respondWithFilteredResult(_0x4a9875,_0x287078))['catch'](handleError(_0x4a9875,null));};exports['show']=function(_0x59e2fa,_0x3cbc09){var _0x5d9ba0={'raw':![],'where':{'id':_0x59e2fa[_0x8ea2('0x46')]['id']}},_0x40a532={};_0x40a532[_0x8ea2('0x32')]=_[_0x8ea2('0x33')](db[_0x8ea2('0x2f')][_0x8ea2('0x30')]);_0x40a532[_0x8ea2('0x36')]=_[_0x8ea2('0x33')](_0x59e2fa['query']);_0x40a532[_0x8ea2('0x34')]=_[_0x8ea2('0x35')](_0x40a532[_0x8ea2('0x32')],_0x40a532['query']);_0x5d9ba0[_0x8ea2('0x37')]=_[_0x8ea2('0x35')](_0x40a532[_0x8ea2('0x32')],qs[_0x8ea2('0x38')](_0x59e2fa[_0x8ea2('0x36')]['fields']));_0x5d9ba0[_0x8ea2('0x37')]=_0x5d9ba0[_0x8ea2('0x37')][_0x8ea2('0x47')]?_0x5d9ba0['attributes']:_0x40a532[_0x8ea2('0x32')];if(_0x59e2fa[_0x8ea2('0x36')][_0x8ea2('0x43')]){_0x5d9ba0[_0x8ea2('0x44')]=[{'all':!![]}];}_0x5d9ba0=_[_0x8ea2('0x41')]({},_0x5d9ba0,_0x59e2fa[_0x8ea2('0x42')]);return db[_0x8ea2('0x2f')][_0x8ea2('0x48')](_0x5d9ba0)[_0x8ea2('0x27')](handleEntityNotFound(_0x3cbc09,null))[_0x8ea2('0x27')](respondWithResult(_0x3cbc09,null))[_0x8ea2('0x49')](handleError(_0x3cbc09,null));};exports[_0x8ea2('0x4a')]=function(_0x220970,_0x12e81f){return db['ZendeskAccount'][_0x8ea2('0x4a')](_0x220970[_0x8ea2('0x4b')],{})[_0x8ea2('0x27')](respondWithResult(_0x12e81f,0xc9))[_0x8ea2('0x49')](handleError(_0x12e81f,null));};exports[_0x8ea2('0x26')]=function(_0x1daa25,_0x11b3ef){if(_0x1daa25[_0x8ea2('0x4b')]['id']){delete _0x1daa25['body']['id'];}return db[_0x8ea2('0x2f')][_0x8ea2('0x48')]({'where':{'id':_0x1daa25[_0x8ea2('0x46')]['id']}})['then'](handleEntityNotFound(_0x11b3ef,null))['then'](saveUpdates(_0x1daa25[_0x8ea2('0x4b')],null))[_0x8ea2('0x27')](respondWithResult(_0x11b3ef,null))[_0x8ea2('0x49')](handleError(_0x11b3ef,null));};exports['destroy']=function(_0x3d86f3,_0x315b5d){return db[_0x8ea2('0x2f')][_0x8ea2('0x48')]({'where':{'id':_0x3d86f3[_0x8ea2('0x46')]['id']}})['then'](handleEntityNotFound(_0x315b5d,null))['then'](removeEntity(_0x315b5d,null))[_0x8ea2('0x49')](handleError(_0x315b5d,null));};exports[_0x8ea2('0x4c')]=function(_0x1b8c4b,_0x5e4268,_0x18cbe9){var _0x100e29={};var _0x442dce={};var _0x54c9d7;var _0x5c6524;return db['ZendeskAccount']['findOne']({'where':{'id':_0x1b8c4b['params']['id']}})[_0x8ea2('0x27')](handleEntityNotFound(_0x5e4268,null))[_0x8ea2('0x27')](function(_0x5f56f8){if(_0x5f56f8){_0x54c9d7=_0x5f56f8;_0x442dce['model']=_[_0x8ea2('0x33')](db[_0x8ea2('0x4d')][_0x8ea2('0x30')]);_0x442dce['query']=_[_0x8ea2('0x33')](_0x1b8c4b[_0x8ea2('0x36')]);_0x442dce['filters']=_[_0x8ea2('0x35')](_0x442dce[_0x8ea2('0x32')],_0x442dce[_0x8ea2('0x36')]);_0x100e29[_0x8ea2('0x37')]=_[_0x8ea2('0x35')](_0x442dce['model'],qs['fields'](_0x1b8c4b['query'][_0x8ea2('0x38')]));_0x100e29[_0x8ea2('0x37')]=_0x100e29[_0x8ea2('0x37')][_0x8ea2('0x47')]?_0x100e29[_0x8ea2('0x37')]:_0x442dce[_0x8ea2('0x32')];_0x100e29[_0x8ea2('0x4e')]=qs['sort'](_0x1b8c4b['query']['sort']);_0x100e29[_0x8ea2('0x3c')]=qs[_0x8ea2('0x34')](_[_0x8ea2('0x3d')](_0x1b8c4b[_0x8ea2('0x36')],_0x442dce['filters']));if(_0x1b8c4b[_0x8ea2('0x36')][_0x8ea2('0x40')]){_0x100e29['where']=_[_0x8ea2('0x41')](_0x100e29[_0x8ea2('0x3c')],{'$or':_[_0x8ea2('0x2e')](_0x100e29[_0x8ea2('0x37')],function(_0x3de1a2){var _0x48c1de={};_0x48c1de[_0x3de1a2]={'$like':'%'+_0x1b8c4b['query']['filter']+'%'};return _0x48c1de;})});}_0x100e29=_[_0x8ea2('0x41')]({},_0x100e29,_0x1b8c4b[_0x8ea2('0x42')]);return _0x54c9d7[_0x8ea2('0x4c')](_0x100e29);}})[_0x8ea2('0x27')](function(_0x3c44ef){if(_0x3c44ef){_0x5c6524=_0x3c44ef['length'];if(!_0x1b8c4b[_0x8ea2('0x36')][_0x8ea2('0x39')](_0x8ea2('0x3a'))){_0x100e29[_0x8ea2('0x21')]=qs['limit'](_0x1b8c4b[_0x8ea2('0x36')]['limit']);_0x100e29[_0x8ea2('0x1f')]=qs['offset'](_0x1b8c4b[_0x8ea2('0x36')][_0x8ea2('0x1f')]);}return _0x54c9d7['getConfigurations'](_0x100e29);}})['then'](function(_0x1d0326){if(_0x1d0326){return _0x1d0326?{'count':_0x5c6524,'rows':_0x1d0326}:null;}})['then'](respondWithResult(_0x5e4268,null))[_0x8ea2('0x49')](handleError(_0x5e4268,null));};exports[_0x8ea2('0x4f')]=function(_0x1c5489,_0x23185e,_0x4dab8f){if(_0x1c5489[_0x8ea2('0x4b')]['id']){delete _0x1c5489[_0x8ea2('0x4b')]['id'];}return db[_0x8ea2('0x2f')][_0x8ea2('0x50')]({'where':{'id':_0x1c5489[_0x8ea2('0x46')]['id']}})[_0x8ea2('0x27')](handleEntityNotFound(_0x23185e,null))[_0x8ea2('0x27')](function(_0x3a78c9){if(_0x3a78c9){_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x51')]=_0x3a78c9['id'];_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x52')]=integrations['getSubjects'](_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x53')],_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x3e')]);_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x54')]=integrations[_0x8ea2('0x55')](_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x53')],_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x3e')]);return db[_0x8ea2('0x4d')]['create'](_0x1c5489[_0x8ea2('0x4b')],{'include':[{'model':db[_0x8ea2('0x56')],'as':_0x8ea2('0x52')},{'model':db[_0x8ea2('0x56')],'as':_0x8ea2('0x54')}]});}return null;})['then'](respondWithResult(_0x23185e,null))['catch'](handleError(_0x23185e,null));};exports['getFields']=function(_0x17f2f2,_0xe8b3ed,_0x380066){var _0x31bda0='';return db[_0x8ea2('0x2f')][_0x8ea2('0x50')]({'where':{'id':_0x17f2f2['params']['id']},'attributes':['id',_0x8ea2('0x57'),_0x8ea2('0x58'),'token','authType',_0x8ea2('0x59')]})[_0x8ea2('0x27')](handleEntityNotFound(_0xe8b3ed,null))[_0x8ea2('0x27')](function(_0x289e74){if(_0x289e74){_0x31bda0=_0x289e74[_0x8ea2('0x59')];var _0x32a8f2=_0x31bda0[_0x8ea2('0x5a')](-0x1);if(_0x32a8f2==='/'){_0x31bda0=_0x31bda0['substring'](0x0,_0x31bda0[_0x8ea2('0x5b')](_0x32a8f2));}var _0x3fa2c8={'method':_0x8ea2('0x5c'),'uri':util[_0x8ea2('0x5d')]('%s/%s',_0x31bda0,_0x8ea2('0x5e')),'json':!![]};switch(_0x289e74[_0x8ea2('0x5f')]){case _0x8ea2('0x58'):_0x3fa2c8['headers']={'Authorization':util[_0x8ea2('0x5d')]('Basic\x20%s',new Buffer(util['format'](_0x8ea2('0x60'),_0x289e74[_0x8ea2('0x57')],_0x289e74['password']))['toString']('base64'))};break;case _0x8ea2('0x61'):_0x3fa2c8['headers']={'Authorization':util['format'](_0x8ea2('0x62'),new Buffer(util[_0x8ea2('0x5d')](_0x8ea2('0x63'),_0x289e74[_0x8ea2('0x57')],_0x289e74[_0x8ea2('0x61')]))[_0x8ea2('0x64')](_0x8ea2('0x65')))};break;default:throw new db[(_0x8ea2('0x66'))][(_0x8ea2('0x67'))](_0x8ea2('0x68'));}return rp(_0x3fa2c8);}})[_0x8ea2('0x27')](function(_0x15eab7){if(_0x15eab7){var _0x1961a9=[_0x8ea2('0x69'),'description',_0x8ea2('0x6a'),_0x8ea2('0x6b')];_[_0x8ea2('0x6c')](_0x15eab7['ticket_fields'],function(_0x1807bb){return _0x1961a9['includes'](_0x1807bb[_0x8ea2('0x3e')]);});return{'count':_0x15eab7['ticket_fields'][_0x8ea2('0x47')],'rows':_['map'](_0x15eab7[_0x8ea2('0x5e')],function(_0x165052){return{'id':_0x165052['id'],'name':_0x165052['position']>0x7?_0x165052[_0x8ea2('0x6d')]:_0x165052['type'],'custom':_0x165052[_0x8ea2('0x6e')]>0x7?!![]:![],'options':_0x165052[_0x8ea2('0x6f')]?_0x165052[_0x8ea2('0x6f')]:_0x165052[_0x8ea2('0x70')]?_0x165052[_0x8ea2('0x70')]:[]};})};}})['then'](respondWithResult(_0xe8b3ed,null))['catch'](function(_0x39d0d7){var _0x4b7e5e=_0x17f2f2[_0x8ea2('0x36')][_0x8ea2('0x71')]?0x1f4:_0x39d0d7[_0x8ea2('0x72')]||0x1f4;logger[_0x8ea2('0x2a')](_0x8ea2('0x73'),_0x8ea2('0x74'),_0x4b7e5e,JSON['stringify'](_0x39d0d7));delete _0x39d0d7['name'];if(_0x4b7e5e===0x191){_0x4b7e5e=0x190;}_0xe8b3ed['status'](_0x4b7e5e)[_0x8ea2('0x75')](_0x17f2f2['query'][_0x8ea2('0x71')]?{'message':_0x8ea2('0x76'),'statusCode':_0x39d0d7[_0x8ea2('0x72')]}:_0x39d0d7);});};
\ No newline at end of file
index 43a2f79..065fff3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x322f=['exports','define','int_zendesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x634811,_0xc4455c){var _0x31aa5b=function(_0xec9150){while(--_0xec9150){_0x634811['push'](_0x634811['shift']());}};_0x31aa5b(++_0xc4455c);}(_0x322f,0x1ed));var _0xf322=function(_0x498dc5,_0x2994ad){_0x498dc5=_0x498dc5-0x0;var _0x589e1d=_0x322f[_0x498dc5];return _0x589e1d;};'use strict';var _=require(_0xf322('0x0'));var util=require(_0xf322('0x1'));var logger=require(_0xf322('0x2'))(_0xf322('0x3'));var moment=require('moment');var BPromise=require(_0xf322('0x4'));var rp=require(_0xf322('0x5'));var fs=require('fs');var path=require(_0xf322('0x6'));var rimraf=require(_0xf322('0x7'));var config=require(_0xf322('0x8'));var attributes=require(_0xf322('0x9'));var integrations=require(_0xf322('0xa'));module[_0xf322('0xb')]=function(_0x413d91,_0x500279){return _0x413d91[_0xf322('0xc')]('ZendeskAccount',attributes,{'tableName':_0xf322('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd026=['moment','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','../../config/logger'];(function(_0x132a0c,_0x11adfd){var _0x25242b=function(_0x3e8fd9){while(--_0x3e8fd9){_0x132a0c['push'](_0x132a0c['shift']());}};_0x25242b(++_0x11adfd);}(_0xd026,0x1a2));var _0x6d02=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd026[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x6d02('0x0'));var util=require('util');var logger=require(_0x6d02('0x1'))('api');var moment=require(_0x6d02('0x2'));var BPromise=require('bluebird');var rp=require(_0x6d02('0x3'));var fs=require('fs');var path=require(_0x6d02('0x4'));var rimraf=require(_0x6d02('0x5'));var config=require(_0x6d02('0x6'));var attributes=require(_0x6d02('0x7'));var integrations=require(_0x6d02('0x8'));module[_0x6d02('0x9')]=function(_0x110411,_0x55bd77){return _0x110411[_0x6d02('0xa')]('ZendeskAccount',attributes,{'tableName':_0x6d02('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b3e7d74..d87346e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3d8=['ShowZendeskAccount','ZendeskAccount','find','raw','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','findAll','options','attributes','limit','include','map','model','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3d8,0xdc));var _0x8b3d=function(_0x17a5d6,_0xf59b28){_0x17a5d6=_0x17a5d6-0x0;var _0x4f56fa=_0xb3d8[_0x17a5d6];return _0x4f56fa;};'use strict';var _=require('lodash');var util=require(_0x8b3d('0x0'));var moment=require(_0x8b3d('0x1'));var BPromise=require(_0x8b3d('0x2'));var rs=require(_0x8b3d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8b3d('0x4'));var logger=require(_0x8b3d('0x5'))(_0x8b3d('0x6'));var config=require(_0x8b3d('0x7'));var jayson=require(_0x8b3d('0x8'));var client=jayson[_0x8b3d('0x9')][_0x8b3d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4447a2,_0x7ddf10,_0x5d3aeb){return new BPromise(function(_0x278a75,_0x2fef94){return client[_0x8b3d('0xb')](_0x4447a2,_0x5d3aeb)[_0x8b3d('0xc')](function(_0x375fa7){logger[_0x8b3d('0xd')](_0x8b3d('0xe'),_0x7ddf10,_0x8b3d('0xf'));logger[_0x8b3d('0x10')](_0x8b3d('0x11'),_0x7ddf10,'request\x20sent',JSON['stringify'](_0x375fa7));if(_0x375fa7[_0x8b3d('0x12')]){if(_0x375fa7[_0x8b3d('0x12')][_0x8b3d('0x13')]===0x1f4){logger[_0x8b3d('0x12')](_0x8b3d('0xe'),_0x7ddf10,_0x375fa7[_0x8b3d('0x12')][_0x8b3d('0x14')]);return _0x2fef94(_0x375fa7[_0x8b3d('0x12')][_0x8b3d('0x14')]);}logger[_0x8b3d('0x12')](_0x8b3d('0xe'),_0x7ddf10,_0x375fa7[_0x8b3d('0x12')][_0x8b3d('0x14')]);return _0x278a75(_0x375fa7[_0x8b3d('0x12')][_0x8b3d('0x14')]);}else{logger[_0x8b3d('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x7ddf10,_0x8b3d('0xf'));_0x278a75(_0x375fa7[_0x8b3d('0x15')]['message']);}})[_0x8b3d('0x16')](function(_0x1652e7){logger['error'](_0x8b3d('0xe'),_0x7ddf10,_0x1652e7);_0x2fef94(_0x1652e7);});});}exports[_0x8b3d('0x17')]=function(_0xcc9b46){var _0x3d733e=this;return new Promise(function(_0x1d96ae,_0x5bff55){return db['ZendeskAccount'][_0x8b3d('0x18')]({'raw':_0xcc9b46['options']?_0xcc9b46['options']['raw']===undefined?!![]:![]:!![],'where':_0xcc9b46[_0x8b3d('0x19')]?_0xcc9b46[_0x8b3d('0x19')]['where']||null:null,'attributes':_0xcc9b46[_0x8b3d('0x19')]?_0xcc9b46[_0x8b3d('0x19')][_0x8b3d('0x1a')]||null:null,'limit':_0xcc9b46[_0x8b3d('0x19')]?_0xcc9b46[_0x8b3d('0x19')][_0x8b3d('0x1b')]||null:null,'include':_0xcc9b46[_0x8b3d('0x19')]?_0xcc9b46[_0x8b3d('0x19')][_0x8b3d('0x1c')]?_[_0x8b3d('0x1d')](_0xcc9b46[_0x8b3d('0x19')]['include'],function(_0x37c98e){return{'model':db[_0x37c98e['model']],'as':_0x37c98e['as'],'attributes':_0x37c98e[_0x8b3d('0x1a')],'include':_0x37c98e[_0x8b3d('0x1c')]?_[_0x8b3d('0x1d')](_0x37c98e[_0x8b3d('0x1c')],function(_0x57fe10){return{'model':db[_0x57fe10[_0x8b3d('0x1e')]],'as':_0x57fe10['as'],'attributes':_0x57fe10['attributes'],'include':_0x57fe10['include']?_[_0x8b3d('0x1d')](_0x57fe10['include'],function(_0x4eefbf){return{'model':db[_0x4eefbf[_0x8b3d('0x1e')]],'as':_0x4eefbf['as'],'attributes':_0x4eefbf[_0x8b3d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5901f4){logger[_0x8b3d('0xd')](_0x8b3d('0x17'),_0xcc9b46);logger[_0x8b3d('0x10')](_0x8b3d('0x17'),_0xcc9b46,JSON[_0x8b3d('0x1f')](_0x5901f4));_0x1d96ae(_0x5901f4);})['catch'](function(_0x261070){logger[_0x8b3d('0x12')](_0x8b3d('0x17'),_0x261070[_0x8b3d('0x14')],_0xcc9b46);_0x5bff55(_0x3d733e[_0x8b3d('0x12')](0x1f4,_0x261070['message']));});});};exports[_0x8b3d('0x20')]=function(_0x3dae7e){var _0x20bc19=this;return new Promise(function(_0x36a125,_0x5cd208){return db[_0x8b3d('0x21')][_0x8b3d('0x22')]({'raw':_0x3dae7e[_0x8b3d('0x19')]?_0x3dae7e['options'][_0x8b3d('0x23')]===undefined?!![]:![]:!![],'where':_0x3dae7e[_0x8b3d('0x19')]?_0x3dae7e[_0x8b3d('0x19')]['where']||null:null,'attributes':_0x3dae7e['options']?_0x3dae7e[_0x8b3d('0x19')][_0x8b3d('0x1a')]||null:null,'include':_0x3dae7e[_0x8b3d('0x19')]?_0x3dae7e[_0x8b3d('0x19')][_0x8b3d('0x1c')]?_[_0x8b3d('0x1d')](_0x3dae7e[_0x8b3d('0x19')]['include'],function(_0x2c310a){return{'model':db[_0x2c310a[_0x8b3d('0x1e')]],'as':_0x2c310a['as'],'attributes':_0x2c310a[_0x8b3d('0x1a')],'include':_0x2c310a[_0x8b3d('0x1c')]?_[_0x8b3d('0x1d')](_0x2c310a[_0x8b3d('0x1c')],function(_0x1dfce0){return{'model':db[_0x1dfce0[_0x8b3d('0x1e')]],'as':_0x1dfce0['as'],'attributes':_0x1dfce0[_0x8b3d('0x1a')],'include':_0x1dfce0[_0x8b3d('0x1c')]?_[_0x8b3d('0x1d')](_0x1dfce0[_0x8b3d('0x1c')],function(_0xf56887){return{'model':db[_0xf56887[_0x8b3d('0x1e')]],'as':_0xf56887['as'],'attributes':_0xf56887[_0x8b3d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8b3d('0xc')](function(_0x607b86){logger['info']('ShowZendeskAccount',_0x3dae7e);logger[_0x8b3d('0x10')]('ShowZendeskAccount',_0x3dae7e,JSON[_0x8b3d('0x1f')](_0x607b86));_0x36a125(_0x607b86);})[_0x8b3d('0x16')](function(_0x218cef){logger['error']('ShowZendeskAccount',_0x218cef[_0x8b3d('0x14')],_0x3dae7e);_0x5cd208(_0x20bc19[_0x8b3d('0x12')](0x1f4,_0x218cef[_0x8b3d('0x14')]));});});};
\ No newline at end of file
+var _0xef17=['ZendeskAccount','options','attributes','limit','map','include','model','GetZendeskAccount','stringify','find','where','ShowZendeskAccount','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x8f73f4,_0x8cfafa){var _0x49fe0c=function(_0x4b7748){while(--_0x4b7748){_0x8f73f4['push'](_0x8f73f4['shift']());}};_0x49fe0c(++_0x8cfafa);}(_0xef17,0x136));var _0x7ef1=function(_0x4429f3,_0x59337e){_0x4429f3=_0x4429f3-0x0;var _0xb1ed3f=_0xef17[_0x4429f3];return _0xb1ed3f;};'use strict';var _=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var moment=require(_0x7ef1('0x2'));var BPromise=require(_0x7ef1('0x3'));var rs=require(_0x7ef1('0x4'));var fs=require('fs');var Redis=require(_0x7ef1('0x5'));var db=require(_0x7ef1('0x6'))['db'];var utils=require(_0x7ef1('0x7'));var logger=require(_0x7ef1('0x8'))('rpc');var config=require(_0x7ef1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7ef1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34a040,_0x4ba2f0,_0x5aec63){return new BPromise(function(_0x10c896,_0x3398a6){return client['request'](_0x34a040,_0x5aec63)[_0x7ef1('0xb')](function(_0x1d5b33){logger[_0x7ef1('0xc')](_0x7ef1('0xd'),_0x4ba2f0,_0x7ef1('0xe'));logger[_0x7ef1('0xf')](_0x7ef1('0x10'),_0x4ba2f0,'request\x20sent',JSON['stringify'](_0x1d5b33));if(_0x1d5b33[_0x7ef1('0x11')]){if(_0x1d5b33['error']['code']===0x1f4){logger['error'](_0x7ef1('0xd'),_0x4ba2f0,_0x1d5b33['error'][_0x7ef1('0x12')]);return _0x3398a6(_0x1d5b33[_0x7ef1('0x11')][_0x7ef1('0x12')]);}logger[_0x7ef1('0x11')](_0x7ef1('0xd'),_0x4ba2f0,_0x1d5b33[_0x7ef1('0x11')][_0x7ef1('0x12')]);return _0x10c896(_0x1d5b33[_0x7ef1('0x11')]['message']);}else{logger['info'](_0x7ef1('0xd'),_0x4ba2f0,'request\x20sent');_0x10c896(_0x1d5b33[_0x7ef1('0x13')][_0x7ef1('0x12')]);}})['catch'](function(_0x4e26d1){logger['error'](_0x7ef1('0xd'),_0x4ba2f0,_0x4e26d1);_0x3398a6(_0x4e26d1);});});}exports['GetZendeskAccount']=function(_0x3a5835){var _0x5c6333=this;return new Promise(function(_0x5a7b2b,_0x5b7e36){return db[_0x7ef1('0x14')]['findAll']({'raw':_0x3a5835[_0x7ef1('0x15')]?_0x3a5835[_0x7ef1('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3a5835['options']?_0x3a5835[_0x7ef1('0x15')]['where']||null:null,'attributes':_0x3a5835[_0x7ef1('0x15')]?_0x3a5835[_0x7ef1('0x15')][_0x7ef1('0x16')]||null:null,'limit':_0x3a5835[_0x7ef1('0x15')]?_0x3a5835[_0x7ef1('0x15')][_0x7ef1('0x17')]||null:null,'include':_0x3a5835[_0x7ef1('0x15')]?_0x3a5835[_0x7ef1('0x15')]['include']?_[_0x7ef1('0x18')](_0x3a5835[_0x7ef1('0x15')][_0x7ef1('0x19')],function(_0x3324d4){return{'model':db[_0x3324d4[_0x7ef1('0x1a')]],'as':_0x3324d4['as'],'attributes':_0x3324d4[_0x7ef1('0x16')],'include':_0x3324d4[_0x7ef1('0x19')]?_[_0x7ef1('0x18')](_0x3324d4['include'],function(_0x4b1ace){return{'model':db[_0x4b1ace[_0x7ef1('0x1a')]],'as':_0x4b1ace['as'],'attributes':_0x4b1ace[_0x7ef1('0x16')],'include':_0x4b1ace[_0x7ef1('0x19')]?_[_0x7ef1('0x18')](_0x4b1ace[_0x7ef1('0x19')],function(_0x4cfa16){return{'model':db[_0x4cfa16[_0x7ef1('0x1a')]],'as':_0x4cfa16['as'],'attributes':_0x4cfa16[_0x7ef1('0x16')]};}):[]};}):[]};}):[]:[]})[_0x7ef1('0xb')](function(_0x4af5f5){logger[_0x7ef1('0xc')](_0x7ef1('0x1b'),_0x3a5835);logger[_0x7ef1('0xf')]('GetZendeskAccount',_0x3a5835,JSON[_0x7ef1('0x1c')](_0x4af5f5));_0x5a7b2b(_0x4af5f5);})['catch'](function(_0x3306b0){logger[_0x7ef1('0x11')]('GetZendeskAccount',_0x3306b0['message'],_0x3a5835);_0x5b7e36(_0x5c6333[_0x7ef1('0x11')](0x1f4,_0x3306b0[_0x7ef1('0x12')]));});});};exports['ShowZendeskAccount']=function(_0xbf918d){var _0x56fe40=this;return new Promise(function(_0x3aa113,_0x47d6eb){return db[_0x7ef1('0x14')][_0x7ef1('0x1d')]({'raw':_0xbf918d['options']?_0xbf918d['options']['raw']===undefined?!![]:![]:!![],'where':_0xbf918d['options']?_0xbf918d[_0x7ef1('0x15')][_0x7ef1('0x1e')]||null:null,'attributes':_0xbf918d['options']?_0xbf918d[_0x7ef1('0x15')]['attributes']||null:null,'include':_0xbf918d['options']?_0xbf918d[_0x7ef1('0x15')]['include']?_[_0x7ef1('0x18')](_0xbf918d[_0x7ef1('0x15')][_0x7ef1('0x19')],function(_0x1bfa7b){return{'model':db[_0x1bfa7b['model']],'as':_0x1bfa7b['as'],'attributes':_0x1bfa7b[_0x7ef1('0x16')],'include':_0x1bfa7b[_0x7ef1('0x19')]?_['map'](_0x1bfa7b['include'],function(_0x4b8e6f){return{'model':db[_0x4b8e6f['model']],'as':_0x4b8e6f['as'],'attributes':_0x4b8e6f[_0x7ef1('0x16')],'include':_0x4b8e6f['include']?_[_0x7ef1('0x18')](_0x4b8e6f[_0x7ef1('0x19')],function(_0xebaf65){return{'model':db[_0xebaf65[_0x7ef1('0x1a')]],'as':_0xebaf65['as'],'attributes':_0xebaf65[_0x7ef1('0x16')]};}):[]};}):[]};}):[]:[]})[_0x7ef1('0xb')](function(_0x43c6c4){logger[_0x7ef1('0xc')](_0x7ef1('0x1f'),_0xbf918d);logger[_0x7ef1('0xf')](_0x7ef1('0x1f'),_0xbf918d,JSON['stringify'](_0x43c6c4));_0x3aa113(_0x43c6c4);})[_0x7ef1('0x20')](function(_0x1e9080){logger['error'](_0x7ef1('0x1f'),_0x1e9080[_0x7ef1('0x12')],_0xbf918d);_0x47d6eb(_0x56fe40[_0x7ef1('0x11')](0x1f4,_0x1e9080[_0x7ef1('0x12')]));});});};
\ No newline at end of file
index d05a93b..0fbf1f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa571=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','put','update','exports','multer'];(function(_0x36c8fb,_0xf1ca63){var _0x484022=function(_0x529c13){while(--_0x529c13){_0x36c8fb['push'](_0x36c8fb['shift']());}};_0x484022(++_0xf1ca63);}(_0xa571,0x107));var _0x1a57=function(_0x2b8a96,_0x30d1c6){_0x2b8a96=_0x2b8a96-0x0;var _0x319d3d=_0xa571[_0x2b8a96];return _0x319d3d;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./intZendeskConfiguration.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getFields']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['get']('/:id/tags',auth[_0x1a57('0x8')](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),controller['setTags']);router[_0x1a57('0x13')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x14')]);router['delete'](_0x1a57('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1a57('0x15')]=router;
\ No newline at end of file
+var _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(_0x555069,_0x23d66a){var _0x100af7=function(_0x1606bd){while(--_0x1606bd){_0x555069['push'](_0x555069['shift']());}};_0x100af7(++_0x23d66a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./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
index f9fd8b8..65dc5d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00e0=['STRING','exports'];(function(_0x4216f0,_0xcb74fd){var _0x46ed5c=function(_0x24a760){while(--_0x24a760){_0x4216f0['push'](_0x4216f0['shift']());}};_0x46ed5c(++_0xcb74fd);}(_0x00e0,0x95));var _0x000e=function(_0x8bddb1,_0x99ef55){_0x8bddb1=_0x8bddb1-0x0;var _0x58392c=_0x00e0[_0x8bddb1];return _0x58392c;};'use strict';var Sequelize=require('sequelize');module[_0x000e('0x0')]={'name':{'type':Sequelize[_0x000e('0x1')]},'description':{'type':Sequelize[_0x000e('0x1')]}};
\ No newline at end of file
+var _0xaa67=['STRING','sequelize'];(function(_0x2a25bd,_0x29c43f){var _0x153f11=function(_0x3db38d){while(--_0x3db38d){_0x2a25bd['push'](_0x2a25bd['shift']());}};_0x153f11(++_0x29c43f);}(_0xaa67,0x133));var _0x7aa6=function(_0x485d3f,_0x1cabb2){_0x485d3f=_0x485d3f-0x0;var _0x3f84ff=_0xaa67[_0x485d3f];return _0x3f84ff;};'use strict';var Sequelize=require(_0x7aa6('0x0'));module['exports']={'name':{'type':Sequelize[_0x7aa6('0x1')]},'description':{'type':Sequelize[_0x7aa6('0x1')]}};
\ No newline at end of file
index b819349..5180a5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcebf=['includeAll','include','then','rows','catch','show','params','keys','intersection','find','create','body','getFields','findOne','ZendeskField','length','order','filter','getSubjects','hasOwnProperty','getDescriptions','getTags','Tag','nolimit','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','set','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','type','key','model','query','filters','attributes','fields','offset','sort','where','pick','merge','VIRTUAL','options'];(function(_0x17ce9f,_0x380b89){var _0x5867b1=function(_0x43a7ee){while(--_0x43a7ee){_0x17ce9f['push'](_0x17ce9f['shift']());}};_0x5867b1(++_0x380b89);}(_0xcebf,0x113));var _0xfceb=function(_0x4903de,_0x2623b8){_0x4903de=_0x4903de-0x0;var _0x439a9c=_0xcebf[_0x4903de];return _0x439a9c;};'use strict';var emlformat=require(_0xfceb('0x0'));var rimraf=require(_0xfceb('0x1'));var zipdir=require(_0xfceb('0x2'));var jsonpatch=require(_0xfceb('0x3'));var rp=require('request-promise');var moment=require(_0xfceb('0x4'));var BPromise=require(_0xfceb('0x5'));var Mustache=require(_0xfceb('0x6'));var util=require(_0xfceb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfceb('0x8'));var ejs=require(_0xfceb('0x9'));var fs=require('fs');var fs_extra=require(_0xfceb('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfceb('0xb'));var deskjs=require(_0xfceb('0xc'));var toCsv=require(_0xfceb('0x8'));var querystring=require(_0xfceb('0xd'));var Papa=require('papaparse');var Redis=require(_0xfceb('0xe'));var authService=require(_0xfceb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfceb('0x10'));var hardwareService=require(_0xfceb('0x11'));var logger=require(_0xfceb('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xfceb('0x13'));var licenseUtil=require(_0xfceb('0x14'));var db=require(_0xfceb('0x15'))['db'];function respondWithStatusCode(_0x3949ed,_0xed14f9){_0xed14f9=_0xed14f9||0xcc;return function(_0x279737){if(_0x279737){return _0x3949ed['sendStatus'](_0xed14f9);}return _0x3949ed[_0xfceb('0x16')](_0xed14f9)[_0xfceb('0x17')]();};}function respondWithResult(_0x4dab1a,_0x35daa6){_0x35daa6=_0x35daa6||0xc8;return function(_0x35d4bd){if(_0x35d4bd){return _0x4dab1a[_0xfceb('0x16')](_0x35daa6)[_0xfceb('0x18')](_0x35d4bd);}};}function respondWithFilteredResult(_0x314671,_0x35f77c){return function(_0x2350f3){if(_0x2350f3){var _0x2a8cd3=typeof _0x35f77c['offset']===_0xfceb('0x19')&&typeof _0x35f77c[_0xfceb('0x1a')]===_0xfceb('0x19');var _0x32761a=_0x2350f3[_0xfceb('0x1b')];var _0x197994=_0x2a8cd3?0x0:_0x35f77c['offset'];var _0xdb6be4=_0x2a8cd3?_0x2350f3[_0xfceb('0x1b')]:_0x35f77c['offset']+_0x35f77c[_0xfceb('0x1a')];var _0x15a320;if(_0xdb6be4>=_0x32761a){_0xdb6be4=_0x32761a;_0x15a320=0xc8;}else{_0x15a320=0xce;}_0x314671[_0xfceb('0x16')](_0x15a320);return _0x314671[_0xfceb('0x1c')]('Content-Range',_0x197994+'-'+_0xdb6be4+'/'+_0x32761a)[_0xfceb('0x18')](_0x2350f3);}return null;};}function patchUpdates(_0x56d514){return function(_0x366e1d){try{jsonpatch[_0xfceb('0x1d')](_0x366e1d,_0x56d514,!![]);}catch(_0x4c831e){return BPromise[_0xfceb('0x1e')](_0x4c831e);}return _0x366e1d[_0xfceb('0x1f')]();};}function saveUpdates(_0x2ae07f,_0x27a751){return function(_0x276da7){if(_0x276da7){return _0x276da7[_0xfceb('0x20')](_0x2ae07f)['then'](function(_0xde46c9){return _0xde46c9;});}return null;};}function removeEntity(_0x3b25f6,_0xb4ee65){return function(_0x3a598f){if(_0x3a598f){return _0x3a598f[_0xfceb('0x21')]()['then'](function(){_0x3b25f6[_0xfceb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ca238,_0x1331b1){return function(_0x3e42c9){if(!_0x3e42c9){_0x4ca238[_0xfceb('0x22')](0x194);}return _0x3e42c9;};}function handleError(_0x1b34d2,_0x310f47){_0x310f47=_0x310f47||0x1f4;return function(_0x1e2ddb){logger[_0xfceb('0x23')](_0x1e2ddb[_0xfceb('0x24')]);if(_0x1e2ddb[_0xfceb('0x25')]){delete _0x1e2ddb[_0xfceb('0x25')];}_0x1b34d2['status'](_0x310f47)[_0xfceb('0x26')](_0x1e2ddb);};}exports[_0xfceb('0x27')]=function(_0x1c065e,_0x53cf07){var _0x235b6a={},_0x31e55f={},_0x50b8c9={'count':0x0,'rows':[]};var _0x3b1689=_[_0xfceb('0x28')](db[_0xfceb('0x29')][_0xfceb('0x2a')],function(_0x43a360){return{'name':_0x43a360['fieldName'],'type':_0x43a360[_0xfceb('0x2b')][_0xfceb('0x2c')]};});_0x31e55f[_0xfceb('0x2d')]=_[_0xfceb('0x28')](_0x3b1689,_0xfceb('0x25'));_0x31e55f[_0xfceb('0x2e')]=_['keys'](_0x1c065e['query']);_0x31e55f[_0xfceb('0x2f')]=_['intersection'](_0x31e55f[_0xfceb('0x2d')],_0x31e55f[_0xfceb('0x2e')]);_0x235b6a[_0xfceb('0x30')]=_['intersection'](_0x31e55f[_0xfceb('0x2d')],qs[_0xfceb('0x31')](_0x1c065e[_0xfceb('0x2e')][_0xfceb('0x31')]));_0x235b6a[_0xfceb('0x30')]=_0x235b6a[_0xfceb('0x30')]['length']?_0x235b6a[_0xfceb('0x30')]:_0x31e55f['model'];if(!_0x1c065e['query']['hasOwnProperty']('nolimit')){_0x235b6a['limit']=qs[_0xfceb('0x1a')](_0x1c065e['query']['limit']);_0x235b6a[_0xfceb('0x32')]=qs['offset'](_0x1c065e[_0xfceb('0x2e')]['offset']);}_0x235b6a['order']=qs['sort'](_0x1c065e[_0xfceb('0x2e')][_0xfceb('0x33')]);_0x235b6a[_0xfceb('0x34')]=qs[_0xfceb('0x2f')](_[_0xfceb('0x35')](_0x1c065e[_0xfceb('0x2e')],_0x31e55f[_0xfceb('0x2f')]),_0x3b1689);if(_0x1c065e[_0xfceb('0x2e')]['filter']){_0x235b6a[_0xfceb('0x34')]=_[_0xfceb('0x36')](_0x235b6a[_0xfceb('0x34')],{'$or':_[_0xfceb('0x28')](_0x3b1689,function(_0x508cc8){if(_0x508cc8[_0xfceb('0x2b')]!==_0xfceb('0x37')){var _0x1f06d5={};_0x1f06d5[_0x508cc8[_0xfceb('0x25')]]={'$like':'%'+_0x1c065e['query']['filter']+'%'};return _0x1f06d5;}})});}_0x235b6a=_[_0xfceb('0x36')]({},_0x235b6a,_0x1c065e[_0xfceb('0x38')]);var _0xeeabf7={'where':_0x235b6a[_0xfceb('0x34')]};return db[_0xfceb('0x29')]['count'](_0xeeabf7)['then'](function(_0x16b918){_0x50b8c9[_0xfceb('0x1b')]=_0x16b918;if(_0x1c065e['query'][_0xfceb('0x39')]){_0x235b6a[_0xfceb('0x3a')]=[{'all':!![]}];}return db[_0xfceb('0x29')]['findAll'](_0x235b6a);})[_0xfceb('0x3b')](function(_0x594aa7){_0x50b8c9[_0xfceb('0x3c')]=_0x594aa7;return _0x50b8c9;})['then'](respondWithFilteredResult(_0x53cf07,_0x235b6a))[_0xfceb('0x3d')](handleError(_0x53cf07,null));};exports[_0xfceb('0x3e')]=function(_0x315d8,_0x2c2820){var _0x34c062={'raw':![],'where':{'id':_0x315d8[_0xfceb('0x3f')]['id']}},_0x324bcf={};_0x324bcf[_0xfceb('0x2d')]=_[_0xfceb('0x40')](db[_0xfceb('0x29')][_0xfceb('0x2a')]);_0x324bcf[_0xfceb('0x2e')]=_[_0xfceb('0x40')](_0x315d8[_0xfceb('0x2e')]);_0x324bcf['filters']=_['intersection'](_0x324bcf[_0xfceb('0x2d')],_0x324bcf[_0xfceb('0x2e')]);_0x34c062['attributes']=_[_0xfceb('0x41')](_0x324bcf[_0xfceb('0x2d')],qs[_0xfceb('0x31')](_0x315d8[_0xfceb('0x2e')][_0xfceb('0x31')]));_0x34c062[_0xfceb('0x30')]=_0x34c062['attributes']['length']?_0x34c062[_0xfceb('0x30')]:_0x324bcf[_0xfceb('0x2d')];if(_0x315d8[_0xfceb('0x2e')][_0xfceb('0x39')]){_0x34c062['include']=[{'all':!![]}];}_0x34c062=_['merge']({},_0x34c062,_0x315d8[_0xfceb('0x38')]);return db[_0xfceb('0x29')][_0xfceb('0x42')](_0x34c062)['then'](handleEntityNotFound(_0x2c2820,null))['then'](respondWithResult(_0x2c2820,null))['catch'](handleError(_0x2c2820,null));};exports[_0xfceb('0x43')]=function(_0x1e6567,_0xc32f5b){return db[_0xfceb('0x29')][_0xfceb('0x43')](_0x1e6567[_0xfceb('0x44')],{})['then'](respondWithResult(_0xc32f5b,0xc9))['catch'](handleError(_0xc32f5b,null));};exports[_0xfceb('0x20')]=function(_0x203025,_0x1026ff){if(_0x203025['body']['id']){delete _0x203025[_0xfceb('0x44')]['id'];}return db[_0xfceb('0x29')][_0xfceb('0x42')]({'where':{'id':_0x203025['params']['id']}})[_0xfceb('0x3b')](handleEntityNotFound(_0x1026ff,null))[_0xfceb('0x3b')](saveUpdates(_0x203025[_0xfceb('0x44')],null))[_0xfceb('0x3b')](respondWithResult(_0x1026ff,null))[_0xfceb('0x3d')](handleError(_0x1026ff,null));};exports['destroy']=function(_0x36d7fc,_0x11292d){return db[_0xfceb('0x29')]['find']({'where':{'id':_0x36d7fc[_0xfceb('0x3f')]['id']}})[_0xfceb('0x3b')](handleEntityNotFound(_0x11292d,null))[_0xfceb('0x3b')](removeEntity(_0x11292d,null))[_0xfceb('0x3d')](handleError(_0x11292d,null));};exports[_0xfceb('0x45')]=function(_0xea6c6,_0x40f58e,_0x4f5172){var _0xecf140={};var _0x1f5c9f={};var _0x2c3161;var _0x445fb7;return db[_0xfceb('0x29')][_0xfceb('0x46')]({'where':{'id':_0xea6c6[_0xfceb('0x3f')]['id']}})[_0xfceb('0x3b')](handleEntityNotFound(_0x40f58e,null))['then'](function(_0x3618bc){if(_0x3618bc){_0x2c3161=_0x3618bc;_0x1f5c9f[_0xfceb('0x2d')]=_[_0xfceb('0x40')](db[_0xfceb('0x47')][_0xfceb('0x2a')]);_0x1f5c9f[_0xfceb('0x2e')]=_[_0xfceb('0x40')](_0xea6c6[_0xfceb('0x2e')]);_0x1f5c9f[_0xfceb('0x2f')]=_[_0xfceb('0x41')](_0x1f5c9f[_0xfceb('0x2d')],_0x1f5c9f[_0xfceb('0x2e')]);_0xecf140[_0xfceb('0x30')]=_[_0xfceb('0x41')](_0x1f5c9f[_0xfceb('0x2d')],qs['fields'](_0xea6c6[_0xfceb('0x2e')][_0xfceb('0x31')]));_0xecf140['attributes']=_0xecf140['attributes'][_0xfceb('0x48')]?_0xecf140['attributes']:_0x1f5c9f['model'];_0xecf140[_0xfceb('0x49')]=qs[_0xfceb('0x33')](_0xea6c6[_0xfceb('0x2e')]['sort']);_0xecf140[_0xfceb('0x34')]=qs[_0xfceb('0x2f')](_[_0xfceb('0x35')](_0xea6c6[_0xfceb('0x2e')],_0x1f5c9f['filters']));if(_0xea6c6[_0xfceb('0x2e')][_0xfceb('0x4a')]){_0xecf140['where']=_['merge'](_0xecf140['where'],{'$or':_[_0xfceb('0x28')](_0xecf140[_0xfceb('0x30')],function(_0xd536e8){var _0x2af32f={};_0x2af32f[_0xd536e8]={'$like':'%'+_0xea6c6['query']['filter']+'%'};return _0x2af32f;})});}_0xecf140=_[_0xfceb('0x36')]({},_0xecf140,_0xea6c6[_0xfceb('0x38')]);return _0x2c3161[_0xfceb('0x45')](_0xecf140);}})[_0xfceb('0x3b')](function(_0x9355c3){if(_0x9355c3){_0x445fb7=_0x9355c3[_0xfceb('0x48')];if(!_0xea6c6[_0xfceb('0x2e')]['hasOwnProperty']('nolimit')){_0xecf140[_0xfceb('0x1a')]=qs[_0xfceb('0x1a')](_0xea6c6[_0xfceb('0x2e')][_0xfceb('0x1a')]);_0xecf140['offset']=qs[_0xfceb('0x32')](_0xea6c6['query'][_0xfceb('0x32')]);}return _0x2c3161['getFields'](_0xecf140);}})[_0xfceb('0x3b')](function(_0x173aee){if(_0x173aee){return _0x173aee?{'count':_0x445fb7,'rows':_0x173aee}:null;}})[_0xfceb('0x3b')](respondWithResult(_0x40f58e,null))['catch'](handleError(_0x40f58e,null));};exports[_0xfceb('0x4b')]=function(_0x34357d,_0x707fca,_0x4d0130){var _0x3027e6={};var _0x314ac4={};var _0x83c3a5;var _0x549a0d;return db['ZendeskConfiguration'][_0xfceb('0x46')]({'where':{'id':_0x34357d[_0xfceb('0x3f')]['id']}})[_0xfceb('0x3b')](handleEntityNotFound(_0x707fca,null))['then'](function(_0x445897){if(_0x445897){_0x83c3a5=_0x445897;_0x314ac4['model']=_[_0xfceb('0x40')](db[_0xfceb('0x47')]['rawAttributes']);_0x314ac4[_0xfceb('0x2e')]=_[_0xfceb('0x40')](_0x34357d[_0xfceb('0x2e')]);_0x314ac4['filters']=_[_0xfceb('0x41')](_0x314ac4[_0xfceb('0x2d')],_0x314ac4['query']);_0x3027e6['attributes']=_[_0xfceb('0x41')](_0x314ac4[_0xfceb('0x2d')],qs[_0xfceb('0x31')](_0x34357d[_0xfceb('0x2e')]['fields']));_0x3027e6[_0xfceb('0x30')]=_0x3027e6[_0xfceb('0x30')]['length']?_0x3027e6['attributes']:_0x314ac4[_0xfceb('0x2d')];_0x3027e6['order']=qs[_0xfceb('0x33')](_0x34357d[_0xfceb('0x2e')][_0xfceb('0x33')]);_0x3027e6[_0xfceb('0x34')]=qs[_0xfceb('0x2f')](_['pick'](_0x34357d[_0xfceb('0x2e')],_0x314ac4['filters']));if(_0x34357d[_0xfceb('0x2e')][_0xfceb('0x4a')]){_0x3027e6[_0xfceb('0x34')]=_[_0xfceb('0x36')](_0x3027e6[_0xfceb('0x34')],{'$or':_[_0xfceb('0x28')](_0x3027e6['attributes'],function(_0x2e561c){var _0x31f922={};_0x31f922[_0x2e561c]={'$like':'%'+_0x34357d[_0xfceb('0x2e')]['filter']+'%'};return _0x31f922;})});}_0x3027e6=_[_0xfceb('0x36')]({},_0x3027e6,_0x34357d[_0xfceb('0x38')]);return _0x83c3a5[_0xfceb('0x4b')](_0x3027e6);}})[_0xfceb('0x3b')](function(_0x553b56){if(_0x553b56){_0x549a0d=_0x553b56[_0xfceb('0x48')];if(!_0x34357d[_0xfceb('0x2e')][_0xfceb('0x4c')]('nolimit')){_0x3027e6['limit']=qs['limit'](_0x34357d[_0xfceb('0x2e')]['limit']);_0x3027e6[_0xfceb('0x32')]=qs[_0xfceb('0x32')](_0x34357d[_0xfceb('0x2e')]['offset']);}return _0x83c3a5[_0xfceb('0x4b')](_0x3027e6);}})['then'](function(_0x250572){if(_0x250572){return _0x250572?{'count':_0x549a0d,'rows':_0x250572}:null;}})[_0xfceb('0x3b')](respondWithResult(_0x707fca,null))[_0xfceb('0x3d')](handleError(_0x707fca,null));};exports[_0xfceb('0x4d')]=function(_0x2a9950,_0x2a8ae3,_0x11cafc){var _0x12bb43={};var _0x294502={};var _0x43649d;var _0x47c2e8;return db[_0xfceb('0x29')]['findOne']({'where':{'id':_0x2a9950[_0xfceb('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2a8ae3,null))[_0xfceb('0x3b')](function(_0x58b8b0){if(_0x58b8b0){_0x43649d=_0x58b8b0;_0x294502[_0xfceb('0x2d')]=_['keys'](db['ZendeskField'][_0xfceb('0x2a')]);_0x294502[_0xfceb('0x2e')]=_['keys'](_0x2a9950[_0xfceb('0x2e')]);_0x294502['filters']=_[_0xfceb('0x41')](_0x294502[_0xfceb('0x2d')],_0x294502[_0xfceb('0x2e')]);_0x12bb43['attributes']=_['intersection'](_0x294502['model'],qs[_0xfceb('0x31')](_0x2a9950[_0xfceb('0x2e')][_0xfceb('0x31')]));_0x12bb43['attributes']=_0x12bb43[_0xfceb('0x30')][_0xfceb('0x48')]?_0x12bb43['attributes']:_0x294502['model'];_0x12bb43[_0xfceb('0x49')]=qs[_0xfceb('0x33')](_0x2a9950[_0xfceb('0x2e')][_0xfceb('0x33')]);_0x12bb43[_0xfceb('0x34')]=qs['filters'](_[_0xfceb('0x35')](_0x2a9950[_0xfceb('0x2e')],_0x294502[_0xfceb('0x2f')]));if(_0x2a9950['query'][_0xfceb('0x4a')]){_0x12bb43[_0xfceb('0x34')]=_[_0xfceb('0x36')](_0x12bb43[_0xfceb('0x34')],{'$or':_[_0xfceb('0x28')](_0x12bb43[_0xfceb('0x30')],function(_0x1421f5){var _0x726a1f={};_0x726a1f[_0x1421f5]={'$like':'%'+_0x2a9950[_0xfceb('0x2e')][_0xfceb('0x4a')]+'%'};return _0x726a1f;})});}_0x12bb43=_[_0xfceb('0x36')]({},_0x12bb43,_0x2a9950['options']);return _0x43649d[_0xfceb('0x4d')](_0x12bb43);}})[_0xfceb('0x3b')](function(_0x3950ce){if(_0x3950ce){_0x47c2e8=_0x3950ce['length'];if(!_0x2a9950[_0xfceb('0x2e')]['hasOwnProperty']('nolimit')){_0x12bb43['limit']=qs[_0xfceb('0x1a')](_0x2a9950['query'][_0xfceb('0x1a')]);_0x12bb43['offset']=qs[_0xfceb('0x32')](_0x2a9950[_0xfceb('0x2e')][_0xfceb('0x32')]);}return _0x43649d[_0xfceb('0x4d')](_0x12bb43);}})['then'](function(_0x7010e8){if(_0x7010e8){return _0x7010e8?{'count':_0x47c2e8,'rows':_0x7010e8}:null;}})[_0xfceb('0x3b')](respondWithResult(_0x2a8ae3,null))[_0xfceb('0x3d')](handleError(_0x2a8ae3,null));};exports[_0xfceb('0x4e')]=function(_0x512647,_0xaae00,_0x20ba6e){var _0x10d9dc={};var _0x1552d8={};var _0x2b8137;var _0x27315c;return db['ZendeskConfiguration'][_0xfceb('0x46')]({'where':{'id':_0x512647['params']['id']}})[_0xfceb('0x3b')](handleEntityNotFound(_0xaae00,null))['then'](function(_0x48abcd){if(_0x48abcd){_0x2b8137=_0x48abcd;_0x1552d8[_0xfceb('0x2d')]=_[_0xfceb('0x40')](db[_0xfceb('0x4f')][_0xfceb('0x2a')]);_0x1552d8[_0xfceb('0x2e')]=_[_0xfceb('0x40')](_0x512647['query']);_0x1552d8[_0xfceb('0x2f')]=_[_0xfceb('0x41')](_0x1552d8[_0xfceb('0x2d')],_0x1552d8[_0xfceb('0x2e')]);_0x10d9dc[_0xfceb('0x30')]=_[_0xfceb('0x41')](_0x1552d8[_0xfceb('0x2d')],qs[_0xfceb('0x31')](_0x512647[_0xfceb('0x2e')][_0xfceb('0x31')]));_0x10d9dc['attributes']=_0x10d9dc[_0xfceb('0x30')]['length']?_0x10d9dc['attributes']:_0x1552d8[_0xfceb('0x2d')];_0x10d9dc[_0xfceb('0x49')]=qs['sort'](_0x512647[_0xfceb('0x2e')]['sort']);_0x10d9dc[_0xfceb('0x34')]=qs[_0xfceb('0x2f')](_[_0xfceb('0x35')](_0x512647['query'],_0x1552d8[_0xfceb('0x2f')]));if(_0x512647[_0xfceb('0x2e')][_0xfceb('0x4a')]){_0x10d9dc[_0xfceb('0x34')]=_[_0xfceb('0x36')](_0x10d9dc[_0xfceb('0x34')],{'$or':_[_0xfceb('0x28')](_0x10d9dc[_0xfceb('0x30')],function(_0x348d86){var _0x22d8a4={};_0x22d8a4[_0x348d86]={'$like':'%'+_0x512647['query'][_0xfceb('0x4a')]+'%'};return _0x22d8a4;})});}_0x10d9dc=_[_0xfceb('0x36')]({},_0x10d9dc,_0x512647['options']);return _0x2b8137[_0xfceb('0x4e')](_0x10d9dc);}})['then'](function(_0x2be2a0){if(_0x2be2a0){_0x27315c=_0x2be2a0[_0xfceb('0x48')];if(!_0x512647[_0xfceb('0x2e')][_0xfceb('0x4c')](_0xfceb('0x50'))){_0x10d9dc['limit']=qs[_0xfceb('0x1a')](_0x512647[_0xfceb('0x2e')][_0xfceb('0x1a')]);_0x10d9dc[_0xfceb('0x32')]=qs[_0xfceb('0x32')](_0x512647[_0xfceb('0x2e')][_0xfceb('0x32')]);}return _0x2b8137[_0xfceb('0x4e')](_0x10d9dc);}})[_0xfceb('0x3b')](function(_0x55776f){if(_0x55776f){return _0x55776f?{'count':_0x27315c,'rows':_0x55776f}:null;}})['then'](respondWithResult(_0xaae00,null))[_0xfceb('0x3d')](handleError(_0xaae00,null));};exports[_0xfceb('0x51')]=function(_0x38b8c9,_0x31df7b,_0xf8e441){if(_0x38b8c9['body']['id']){delete _0x38b8c9['body']['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x38b8c9['params']['id']}})[_0xfceb('0x3b')](handleEntityNotFound(_0x31df7b,null))['then'](function(_0x4a0a62){if(_0x4a0a62){return _0x4a0a62[_0xfceb('0x51')](_0x38b8c9[_0xfceb('0x44')][_0xfceb('0x52')]||[]);}return null;})['then'](respondWithResult(_0x31df7b,null))[_0xfceb('0x3d')](handleError(_0x31df7b,null));};
\ No newline at end of file
+var _0x95e7=['rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','merge','find','create','body','getFields','findOne','ZendeskField','filters','getSubjects','filter','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','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','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','name','index','ZendeskConfiguration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95e7,0x17d));var _0x795e=function(_0x30bc1d,_0x5d6190){_0x30bc1d=_0x30bc1d-0x0;var _0x43f1c3=_0x95e7[_0x30bc1d];return _0x43f1c3;};'use strict';var emlformat=require(_0x795e('0x0'));var rimraf=require(_0x795e('0x1'));var zipdir=require(_0x795e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x795e('0x3'));var moment=require('moment');var BPromise=require(_0x795e('0x4'));var Mustache=require(_0x795e('0x5'));var util=require(_0x795e('0x6'));var path=require(_0x795e('0x7'));var sox=require(_0x795e('0x8'));var csv=require('to-csv');var ejs=require(_0x795e('0x9'));var fs=require('fs');var fs_extra=require(_0x795e('0xa'));var _=require(_0x795e('0xb'));var squel=require('squel');var crypto=require(_0x795e('0xc'));var jsforce=require(_0x795e('0xd'));var deskjs=require(_0x795e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x795e('0xf'));var Papa=require(_0x795e('0x10'));var Redis=require(_0x795e('0x11'));var authService=require(_0x795e('0x12'));var qs=require(_0x795e('0x13'));var as=require(_0x795e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x795e('0x15'))(_0x795e('0x16'));var utils=require(_0x795e('0x17'));var config=require(_0x795e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x795e('0x19'))['db'];function respondWithStatusCode(_0x4211b5,_0x3f8a11){_0x3f8a11=_0x3f8a11||0xcc;return function(_0x1a670b){if(_0x1a670b){return _0x4211b5[_0x795e('0x1a')](_0x3f8a11);}return _0x4211b5[_0x795e('0x1b')](_0x3f8a11)[_0x795e('0x1c')]();};}function respondWithResult(_0x575f06,_0x2f9823){_0x2f9823=_0x2f9823||0xc8;return function(_0x181309){if(_0x181309){return _0x575f06[_0x795e('0x1b')](_0x2f9823)[_0x795e('0x1d')](_0x181309);}};}function respondWithFilteredResult(_0x49270f,_0x54cb04){return function(_0x2b6ef8){if(_0x2b6ef8){var _0x35162e=typeof _0x54cb04[_0x795e('0x1e')]==='undefined'&&typeof _0x54cb04[_0x795e('0x1f')]===_0x795e('0x20');var _0xefb7b7=_0x2b6ef8[_0x795e('0x21')];var _0x2982f9=_0x35162e?0x0:_0x54cb04[_0x795e('0x1e')];var _0x29795a=_0x35162e?_0x2b6ef8['count']:_0x54cb04[_0x795e('0x1e')]+_0x54cb04[_0x795e('0x1f')];var _0x43a5c9;if(_0x29795a>=_0xefb7b7){_0x29795a=_0xefb7b7;_0x43a5c9=0xc8;}else{_0x43a5c9=0xce;}_0x49270f[_0x795e('0x1b')](_0x43a5c9);return _0x49270f['set'](_0x795e('0x22'),_0x2982f9+'-'+_0x29795a+'/'+_0xefb7b7)[_0x795e('0x1d')](_0x2b6ef8);}return null;};}function patchUpdates(_0x541956){return function(_0x539fcd){try{jsonpatch[_0x795e('0x23')](_0x539fcd,_0x541956,!![]);}catch(_0xcac42d){return BPromise[_0x795e('0x24')](_0xcac42d);}return _0x539fcd[_0x795e('0x25')]();};}function saveUpdates(_0x1c5ef1,_0x2d6d87){return function(_0x10841b){if(_0x10841b){return _0x10841b[_0x795e('0x26')](_0x1c5ef1)[_0x795e('0x27')](function(_0xe14a5){return _0xe14a5;});}return null;};}function removeEntity(_0x56d32b,_0x132bcd){return function(_0x4ce76f){if(_0x4ce76f){return _0x4ce76f[_0x795e('0x28')]()['then'](function(){_0x56d32b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d9bcb,_0x5d46aa){return function(_0x30258b){if(!_0x30258b){_0x5d9bcb[_0x795e('0x1a')](0x194);}return _0x30258b;};}function handleError(_0x4f9c3e,_0x45d46d){_0x45d46d=_0x45d46d||0x1f4;return function(_0x397a57){logger['error'](_0x397a57['stack']);if(_0x397a57[_0x795e('0x29')]){delete _0x397a57[_0x795e('0x29')];}_0x4f9c3e[_0x795e('0x1b')](_0x45d46d)['send'](_0x397a57);};}exports[_0x795e('0x2a')]=function(_0x343307,_0x3f5f88){var _0x353c01={},_0x4a3a61={},_0x4da4c9={'count':0x0,'rows':[]};var _0x2e5299=_['map'](db[_0x795e('0x2b')][_0x795e('0x2c')],function(_0x2fdc49){return{'name':_0x2fdc49[_0x795e('0x2d')],'type':_0x2fdc49[_0x795e('0x2e')][_0x795e('0x2f')]};});_0x4a3a61[_0x795e('0x30')]=_[_0x795e('0x31')](_0x2e5299,_0x795e('0x29'));_0x4a3a61[_0x795e('0x32')]=_[_0x795e('0x33')](_0x343307['query']);_0x4a3a61['filters']=_[_0x795e('0x34')](_0x4a3a61[_0x795e('0x30')],_0x4a3a61[_0x795e('0x32')]);_0x353c01[_0x795e('0x35')]=_[_0x795e('0x34')](_0x4a3a61[_0x795e('0x30')],qs[_0x795e('0x36')](_0x343307[_0x795e('0x32')]['fields']));_0x353c01[_0x795e('0x35')]=_0x353c01['attributes']['length']?_0x353c01[_0x795e('0x35')]:_0x4a3a61['model'];if(!_0x343307[_0x795e('0x32')][_0x795e('0x37')](_0x795e('0x38'))){_0x353c01[_0x795e('0x1f')]=qs[_0x795e('0x1f')](_0x343307[_0x795e('0x32')][_0x795e('0x1f')]);_0x353c01[_0x795e('0x1e')]=qs['offset'](_0x343307['query']['offset']);}_0x353c01[_0x795e('0x39')]=qs['sort'](_0x343307[_0x795e('0x32')][_0x795e('0x3a')]);_0x353c01['where']=qs['filters'](_[_0x795e('0x3b')](_0x343307[_0x795e('0x32')],_0x4a3a61['filters']),_0x2e5299);if(_0x343307[_0x795e('0x32')]['filter']){_0x353c01[_0x795e('0x3c')]=_['merge'](_0x353c01['where'],{'$or':_['map'](_0x2e5299,function(_0x2afe4f){if(_0x2afe4f[_0x795e('0x2e')]!==_0x795e('0x3d')){var _0x40cdd8={};_0x40cdd8[_0x2afe4f['name']]={'$like':'%'+_0x343307[_0x795e('0x32')]['filter']+'%'};return _0x40cdd8;}})});}_0x353c01=_['merge']({},_0x353c01,_0x343307[_0x795e('0x3e')]);var _0x56e6ed={'where':_0x353c01[_0x795e('0x3c')]};return db[_0x795e('0x2b')][_0x795e('0x21')](_0x56e6ed)[_0x795e('0x27')](function(_0x1bda82){_0x4da4c9[_0x795e('0x21')]=_0x1bda82;if(_0x343307[_0x795e('0x32')][_0x795e('0x3f')]){_0x353c01['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x795e('0x40')](_0x353c01);})[_0x795e('0x27')](function(_0x40e90b){_0x4da4c9[_0x795e('0x41')]=_0x40e90b;return _0x4da4c9;})[_0x795e('0x27')](respondWithFilteredResult(_0x3f5f88,_0x353c01))[_0x795e('0x42')](handleError(_0x3f5f88,null));};exports[_0x795e('0x43')]=function(_0x360f5e,_0x1e0c17){var _0x604527={'raw':![],'where':{'id':_0x360f5e[_0x795e('0x44')]['id']}},_0x49d5fb={};_0x49d5fb['model']=_['keys'](db[_0x795e('0x2b')]['rawAttributes']);_0x49d5fb['query']=_[_0x795e('0x33')](_0x360f5e['query']);_0x49d5fb['filters']=_['intersection'](_0x49d5fb[_0x795e('0x30')],_0x49d5fb[_0x795e('0x32')]);_0x604527[_0x795e('0x35')]=_[_0x795e('0x34')](_0x49d5fb[_0x795e('0x30')],qs[_0x795e('0x36')](_0x360f5e['query']['fields']));_0x604527['attributes']=_0x604527[_0x795e('0x35')][_0x795e('0x45')]?_0x604527[_0x795e('0x35')]:_0x49d5fb[_0x795e('0x30')];if(_0x360f5e[_0x795e('0x32')]['includeAll']){_0x604527[_0x795e('0x46')]=[{'all':!![]}];}_0x604527=_[_0x795e('0x47')]({},_0x604527,_0x360f5e[_0x795e('0x3e')]);return db[_0x795e('0x2b')][_0x795e('0x48')](_0x604527)[_0x795e('0x27')](handleEntityNotFound(_0x1e0c17,null))[_0x795e('0x27')](respondWithResult(_0x1e0c17,null))[_0x795e('0x42')](handleError(_0x1e0c17,null));};exports[_0x795e('0x49')]=function(_0x5639b6,_0x4bb0d8){return db[_0x795e('0x2b')][_0x795e('0x49')](_0x5639b6[_0x795e('0x4a')],{})['then'](respondWithResult(_0x4bb0d8,0xc9))[_0x795e('0x42')](handleError(_0x4bb0d8,null));};exports['update']=function(_0x296465,_0x3b4177){if(_0x296465[_0x795e('0x4a')]['id']){delete _0x296465['body']['id'];}return db[_0x795e('0x2b')][_0x795e('0x48')]({'where':{'id':_0x296465[_0x795e('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b4177,null))['then'](saveUpdates(_0x296465['body'],null))[_0x795e('0x27')](respondWithResult(_0x3b4177,null))[_0x795e('0x42')](handleError(_0x3b4177,null));};exports[_0x795e('0x28')]=function(_0x10eeb0,_0x34a0fb){return db['ZendeskConfiguration'][_0x795e('0x48')]({'where':{'id':_0x10eeb0[_0x795e('0x44')]['id']}})[_0x795e('0x27')](handleEntityNotFound(_0x34a0fb,null))[_0x795e('0x27')](removeEntity(_0x34a0fb,null))[_0x795e('0x42')](handleError(_0x34a0fb,null));};exports[_0x795e('0x4b')]=function(_0x56320d,_0x508461,_0x1cf10f){var _0x5b4e58={};var _0x464bb2={};var _0x2694e2;var _0x366b5c;return db[_0x795e('0x2b')][_0x795e('0x4c')]({'where':{'id':_0x56320d['params']['id']}})[_0x795e('0x27')](handleEntityNotFound(_0x508461,null))['then'](function(_0x357f12){if(_0x357f12){_0x2694e2=_0x357f12;_0x464bb2[_0x795e('0x30')]=_[_0x795e('0x33')](db[_0x795e('0x4d')]['rawAttributes']);_0x464bb2[_0x795e('0x32')]=_[_0x795e('0x33')](_0x56320d['query']);_0x464bb2['filters']=_[_0x795e('0x34')](_0x464bb2['model'],_0x464bb2[_0x795e('0x32')]);_0x5b4e58['attributes']=_[_0x795e('0x34')](_0x464bb2[_0x795e('0x30')],qs[_0x795e('0x36')](_0x56320d[_0x795e('0x32')]['fields']));_0x5b4e58[_0x795e('0x35')]=_0x5b4e58[_0x795e('0x35')]['length']?_0x5b4e58[_0x795e('0x35')]:_0x464bb2['model'];_0x5b4e58[_0x795e('0x39')]=qs[_0x795e('0x3a')](_0x56320d[_0x795e('0x32')][_0x795e('0x3a')]);_0x5b4e58[_0x795e('0x3c')]=qs[_0x795e('0x4e')](_[_0x795e('0x3b')](_0x56320d[_0x795e('0x32')],_0x464bb2['filters']));if(_0x56320d['query']['filter']){_0x5b4e58['where']=_[_0x795e('0x47')](_0x5b4e58[_0x795e('0x3c')],{'$or':_[_0x795e('0x31')](_0x5b4e58[_0x795e('0x35')],function(_0x3c12a4){var _0x595b71={};_0x595b71[_0x3c12a4]={'$like':'%'+_0x56320d[_0x795e('0x32')]['filter']+'%'};return _0x595b71;})});}_0x5b4e58=_[_0x795e('0x47')]({},_0x5b4e58,_0x56320d[_0x795e('0x3e')]);return _0x2694e2['getFields'](_0x5b4e58);}})[_0x795e('0x27')](function(_0x24210a){if(_0x24210a){_0x366b5c=_0x24210a[_0x795e('0x45')];if(!_0x56320d[_0x795e('0x32')]['hasOwnProperty'](_0x795e('0x38'))){_0x5b4e58['limit']=qs[_0x795e('0x1f')](_0x56320d['query'][_0x795e('0x1f')]);_0x5b4e58[_0x795e('0x1e')]=qs[_0x795e('0x1e')](_0x56320d[_0x795e('0x32')][_0x795e('0x1e')]);}return _0x2694e2[_0x795e('0x4b')](_0x5b4e58);}})[_0x795e('0x27')](function(_0x1c6b27){if(_0x1c6b27){return _0x1c6b27?{'count':_0x366b5c,'rows':_0x1c6b27}:null;}})['then'](respondWithResult(_0x508461,null))[_0x795e('0x42')](handleError(_0x508461,null));};exports[_0x795e('0x4f')]=function(_0x52ea54,_0x4aeeff,_0x1ed8e){var _0x7d05b={};var _0x2b762e={};var _0x2349d4;var _0x1647f6;return db['ZendeskConfiguration'][_0x795e('0x4c')]({'where':{'id':_0x52ea54[_0x795e('0x44')]['id']}})['then'](handleEntityNotFound(_0x4aeeff,null))['then'](function(_0x599d58){if(_0x599d58){_0x2349d4=_0x599d58;_0x2b762e[_0x795e('0x30')]=_[_0x795e('0x33')](db['ZendeskField'][_0x795e('0x2c')]);_0x2b762e[_0x795e('0x32')]=_[_0x795e('0x33')](_0x52ea54[_0x795e('0x32')]);_0x2b762e[_0x795e('0x4e')]=_[_0x795e('0x34')](_0x2b762e[_0x795e('0x30')],_0x2b762e[_0x795e('0x32')]);_0x7d05b[_0x795e('0x35')]=_[_0x795e('0x34')](_0x2b762e[_0x795e('0x30')],qs[_0x795e('0x36')](_0x52ea54[_0x795e('0x32')]['fields']));_0x7d05b[_0x795e('0x35')]=_0x7d05b[_0x795e('0x35')][_0x795e('0x45')]?_0x7d05b[_0x795e('0x35')]:_0x2b762e[_0x795e('0x30')];_0x7d05b[_0x795e('0x39')]=qs[_0x795e('0x3a')](_0x52ea54[_0x795e('0x32')][_0x795e('0x3a')]);_0x7d05b[_0x795e('0x3c')]=qs[_0x795e('0x4e')](_['pick'](_0x52ea54[_0x795e('0x32')],_0x2b762e[_0x795e('0x4e')]));if(_0x52ea54[_0x795e('0x32')][_0x795e('0x50')]){_0x7d05b['where']=_[_0x795e('0x47')](_0x7d05b['where'],{'$or':_[_0x795e('0x31')](_0x7d05b[_0x795e('0x35')],function(_0x5152e8){var _0x85994={};_0x85994[_0x5152e8]={'$like':'%'+_0x52ea54[_0x795e('0x32')]['filter']+'%'};return _0x85994;})});}_0x7d05b=_[_0x795e('0x47')]({},_0x7d05b,_0x52ea54[_0x795e('0x3e')]);return _0x2349d4[_0x795e('0x4f')](_0x7d05b);}})[_0x795e('0x27')](function(_0x36f042){if(_0x36f042){_0x1647f6=_0x36f042['length'];if(!_0x52ea54[_0x795e('0x32')][_0x795e('0x37')](_0x795e('0x38'))){_0x7d05b[_0x795e('0x1f')]=qs[_0x795e('0x1f')](_0x52ea54[_0x795e('0x32')]['limit']);_0x7d05b[_0x795e('0x1e')]=qs[_0x795e('0x1e')](_0x52ea54[_0x795e('0x32')][_0x795e('0x1e')]);}return _0x2349d4['getSubjects'](_0x7d05b);}})['then'](function(_0x58dc00){if(_0x58dc00){return _0x58dc00?{'count':_0x1647f6,'rows':_0x58dc00}:null;}})[_0x795e('0x27')](respondWithResult(_0x4aeeff,null))[_0x795e('0x42')](handleError(_0x4aeeff,null));};exports['getDescriptions']=function(_0x4addc1,_0x50eba2,_0x53e9b8){var _0x144b44={};var _0x5279c9={};var _0x2aa563;var _0x159356;return db['ZendeskConfiguration'][_0x795e('0x4c')]({'where':{'id':_0x4addc1[_0x795e('0x44')]['id']}})[_0x795e('0x27')](handleEntityNotFound(_0x50eba2,null))[_0x795e('0x27')](function(_0x53ca84){if(_0x53ca84){_0x2aa563=_0x53ca84;_0x5279c9['model']=_[_0x795e('0x33')](db[_0x795e('0x4d')]['rawAttributes']);_0x5279c9[_0x795e('0x32')]=_[_0x795e('0x33')](_0x4addc1['query']);_0x5279c9[_0x795e('0x4e')]=_[_0x795e('0x34')](_0x5279c9[_0x795e('0x30')],_0x5279c9['query']);_0x144b44[_0x795e('0x35')]=_['intersection'](_0x5279c9[_0x795e('0x30')],qs['fields'](_0x4addc1[_0x795e('0x32')][_0x795e('0x36')]));_0x144b44['attributes']=_0x144b44[_0x795e('0x35')][_0x795e('0x45')]?_0x144b44[_0x795e('0x35')]:_0x5279c9['model'];_0x144b44[_0x795e('0x39')]=qs[_0x795e('0x3a')](_0x4addc1[_0x795e('0x32')][_0x795e('0x3a')]);_0x144b44['where']=qs[_0x795e('0x4e')](_[_0x795e('0x3b')](_0x4addc1[_0x795e('0x32')],_0x5279c9[_0x795e('0x4e')]));if(_0x4addc1[_0x795e('0x32')][_0x795e('0x50')]){_0x144b44[_0x795e('0x3c')]=_[_0x795e('0x47')](_0x144b44[_0x795e('0x3c')],{'$or':_[_0x795e('0x31')](_0x144b44['attributes'],function(_0x45fe65){var _0x2adc62={};_0x2adc62[_0x45fe65]={'$like':'%'+_0x4addc1['query'][_0x795e('0x50')]+'%'};return _0x2adc62;})});}_0x144b44=_['merge']({},_0x144b44,_0x4addc1[_0x795e('0x3e')]);return _0x2aa563[_0x795e('0x51')](_0x144b44);}})[_0x795e('0x27')](function(_0x29ff26){if(_0x29ff26){_0x159356=_0x29ff26[_0x795e('0x45')];if(!_0x4addc1['query'][_0x795e('0x37')](_0x795e('0x38'))){_0x144b44[_0x795e('0x1f')]=qs[_0x795e('0x1f')](_0x4addc1[_0x795e('0x32')][_0x795e('0x1f')]);_0x144b44[_0x795e('0x1e')]=qs[_0x795e('0x1e')](_0x4addc1[_0x795e('0x32')]['offset']);}return _0x2aa563[_0x795e('0x51')](_0x144b44);}})[_0x795e('0x27')](function(_0x6014b7){if(_0x6014b7){return _0x6014b7?{'count':_0x159356,'rows':_0x6014b7}:null;}})[_0x795e('0x27')](respondWithResult(_0x50eba2,null))[_0x795e('0x42')](handleError(_0x50eba2,null));};exports[_0x795e('0x52')]=function(_0x24c848,_0x366b0a,_0x2cac09){var _0x224475={};var _0x12dd20={};var _0x15f5ec;var _0x561d4d;return db['ZendeskConfiguration'][_0x795e('0x4c')]({'where':{'id':_0x24c848['params']['id']}})[_0x795e('0x27')](handleEntityNotFound(_0x366b0a,null))['then'](function(_0x13f99f){if(_0x13f99f){_0x15f5ec=_0x13f99f;_0x12dd20[_0x795e('0x30')]=_[_0x795e('0x33')](db[_0x795e('0x53')][_0x795e('0x2c')]);_0x12dd20['query']=_[_0x795e('0x33')](_0x24c848[_0x795e('0x32')]);_0x12dd20[_0x795e('0x4e')]=_[_0x795e('0x34')](_0x12dd20['model'],_0x12dd20['query']);_0x224475[_0x795e('0x35')]=_[_0x795e('0x34')](_0x12dd20[_0x795e('0x30')],qs[_0x795e('0x36')](_0x24c848[_0x795e('0x32')]['fields']));_0x224475[_0x795e('0x35')]=_0x224475[_0x795e('0x35')][_0x795e('0x45')]?_0x224475[_0x795e('0x35')]:_0x12dd20['model'];_0x224475[_0x795e('0x39')]=qs['sort'](_0x24c848[_0x795e('0x32')][_0x795e('0x3a')]);_0x224475[_0x795e('0x3c')]=qs['filters'](_[_0x795e('0x3b')](_0x24c848['query'],_0x12dd20['filters']));if(_0x24c848[_0x795e('0x32')][_0x795e('0x50')]){_0x224475['where']=_[_0x795e('0x47')](_0x224475[_0x795e('0x3c')],{'$or':_[_0x795e('0x31')](_0x224475[_0x795e('0x35')],function(_0x22c201){var _0x693c69={};_0x693c69[_0x22c201]={'$like':'%'+_0x24c848['query'][_0x795e('0x50')]+'%'};return _0x693c69;})});}_0x224475=_['merge']({},_0x224475,_0x24c848['options']);return _0x15f5ec[_0x795e('0x52')](_0x224475);}})[_0x795e('0x27')](function(_0x292674){if(_0x292674){_0x561d4d=_0x292674['length'];if(!_0x24c848[_0x795e('0x32')][_0x795e('0x37')](_0x795e('0x38'))){_0x224475[_0x795e('0x1f')]=qs[_0x795e('0x1f')](_0x24c848[_0x795e('0x32')][_0x795e('0x1f')]);_0x224475[_0x795e('0x1e')]=qs['offset'](_0x24c848[_0x795e('0x32')][_0x795e('0x1e')]);}return _0x15f5ec[_0x795e('0x52')](_0x224475);}})[_0x795e('0x27')](function(_0x61226f){if(_0x61226f){return _0x61226f?{'count':_0x561d4d,'rows':_0x61226f}:null;}})[_0x795e('0x27')](respondWithResult(_0x366b0a,null))[_0x795e('0x42')](handleError(_0x366b0a,null));};exports[_0x795e('0x54')]=function(_0x162447,_0x5ac511,_0x48888f){if(_0x162447[_0x795e('0x4a')]['id']){delete _0x162447[_0x795e('0x4a')]['id'];}return db[_0x795e('0x2b')][_0x795e('0x4c')]({'where':{'id':_0x162447['params']['id']}})[_0x795e('0x27')](handleEntityNotFound(_0x5ac511,null))[_0x795e('0x27')](function(_0x35db05){if(_0x35db05){return _0x35db05[_0x795e('0x54')](_0x162447[_0x795e('0x4a')]['ids']||[]);}return null;})[_0x795e('0x27')](respondWithResult(_0x5ac511,null))[_0x795e('0x42')](handleError(_0x5ac511,null));};
\ No newline at end of file
index fd1b159..2999ec0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f6=['request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','lodash','util','moment','bluebird'];(function(_0x6b1acd,_0x45febf){var _0x360834=function(_0x2d01e5){while(--_0x2d01e5){_0x6b1acd['push'](_0x6b1acd['shift']());}};_0x360834(++_0x45febf);}(_0x13f6,0x124));var _0x613f=function(_0x5c23fb,_0xdb7d52){_0x5c23fb=_0x5c23fb-0x0;var _0x5c26c0=_0x13f6[_0x5c23fb];return _0x5c26c0;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x613f('0x2'));var BPromise=require(_0x613f('0x3'));var rp=require(_0x613f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var attributes=require(_0x613f('0x7'));module['exports']=function(_0x3f3525,_0x2367b3){return _0x3f3525['define']('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaebd=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','../../config/logger','api'];(function(_0xed0c1c,_0x376f3c){var _0xeba06c=function(_0x1b2a3b){while(--_0x1b2a3b){_0xed0c1c['push'](_0xed0c1c['shift']());}};_0xeba06c(++_0x376f3c);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x5a117a,_0x247779){_0x5a117a=_0x5a117a-0x0;var _0x173ef6=_0xaebd[_0x5a117a];return _0x173ef6;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var logger=require(_0xdaeb('0x1'))(_0xdaeb('0x2'));var moment=require(_0xdaeb('0x3'));var BPromise=require(_0xdaeb('0x4'));var rp=require(_0xdaeb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdaeb('0x6'));var config=require(_0xdaeb('0x7'));var attributes=require(_0xdaeb('0x8'));module[_0xdaeb('0x9')]=function(_0xee94f9,_0x4b7255){return _0xee94f9[_0xdaeb('0xa')](_0xdaeb('0xb'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 33deec9..ea61dbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2758=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x1d453f,_0x5793a9){var _0x50996a=function(_0x59bdf3){while(--_0x59bdf3){_0x1d453f['push'](_0x1d453f['shift']());}};_0x50996a(++_0x5793a9);}(_0x2758,0x19d));var _0x8275=function(_0x12da68,_0x168696){_0x12da68=_0x12da68-0x0;var _0x42875c=_0x2758[_0x12da68];return _0x42875c;};'use strict';var _=require(_0x8275('0x0'));var util=require(_0x8275('0x1'));var moment=require(_0x8275('0x2'));var BPromise=require(_0x8275('0x3'));var rs=require(_0x8275('0x4'));var fs=require('fs');var Redis=require(_0x8275('0x5'));var db=require(_0x8275('0x6'))['db'];var utils=require(_0x8275('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x8275('0x8'));var jayson=require(_0x8275('0x9'));var client=jayson[_0x8275('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd3efdc,_0x34a524,_0x5b705a){return new BPromise(function(_0x4e1db1,_0x5a029b){return client[_0x8275('0xb')](_0xd3efdc,_0x5b705a)[_0x8275('0xc')](function(_0x6b7f9e){logger[_0x8275('0xd')](_0x8275('0xe'),_0x34a524,'request\x20sent');logger['debug'](_0x8275('0xf'),_0x34a524,_0x8275('0x10'),JSON[_0x8275('0x11')](_0x6b7f9e));if(_0x6b7f9e['error']){if(_0x6b7f9e[_0x8275('0x12')][_0x8275('0x13')]===0x1f4){logger[_0x8275('0x12')](_0x8275('0xe'),_0x34a524,_0x6b7f9e[_0x8275('0x12')][_0x8275('0x14')]);return _0x5a029b(_0x6b7f9e[_0x8275('0x12')][_0x8275('0x14')]);}logger[_0x8275('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x34a524,_0x6b7f9e[_0x8275('0x12')][_0x8275('0x14')]);return _0x4e1db1(_0x6b7f9e[_0x8275('0x12')][_0x8275('0x14')]);}else{logger[_0x8275('0xd')](_0x8275('0xe'),_0x34a524,_0x8275('0x10'));_0x4e1db1(_0x6b7f9e[_0x8275('0x15')]['message']);}})[_0x8275('0x16')](function(_0x227aa3){logger[_0x8275('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x34a524,_0x227aa3);_0x5a029b(_0x227aa3);});});}
\ No newline at end of file
+var _0xb881=['code','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xb881,0x18a));var _0x1b88=function(_0x2b2e44,_0x36b38a){_0x2b2e44=_0x2b2e44-0x0;var _0x2d0b45=_0xb881[_0x2b2e44];return _0x2d0b45;};'use strict';var _=require(_0x1b88('0x0'));var util=require(_0x1b88('0x1'));var moment=require(_0x1b88('0x2'));var BPromise=require(_0x1b88('0x3'));var rs=require(_0x1b88('0x4'));var fs=require('fs');var Redis=require(_0x1b88('0x5'));var db=require(_0x1b88('0x6'))['db'];var utils=require(_0x1b88('0x7'));var logger=require(_0x1b88('0x8'))(_0x1b88('0x9'));var config=require(_0x1b88('0xa'));var jayson=require(_0x1b88('0xb'));var client=jayson[_0x1b88('0xc')][_0x1b88('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3bbf93,_0x24f44e,_0x128db2){return new BPromise(function(_0x158f8e,_0x1e6bc1){return client[_0x1b88('0xe')](_0x3bbf93,_0x128db2)[_0x1b88('0xf')](function(_0x471234){logger[_0x1b88('0x10')](_0x1b88('0x11'),_0x24f44e,'request\x20sent');logger[_0x1b88('0x12')](_0x1b88('0x13'),_0x24f44e,'request\x20sent',JSON[_0x1b88('0x14')](_0x471234));if(_0x471234[_0x1b88('0x15')]){if(_0x471234[_0x1b88('0x15')][_0x1b88('0x16')]===0x1f4){logger[_0x1b88('0x15')]('ZendeskConfiguration,\x20%s,\x20%s',_0x24f44e,_0x471234[_0x1b88('0x15')][_0x1b88('0x17')]);return _0x1e6bc1(_0x471234[_0x1b88('0x15')][_0x1b88('0x17')]);}logger['error'](_0x1b88('0x11'),_0x24f44e,_0x471234[_0x1b88('0x15')]['message']);return _0x158f8e(_0x471234[_0x1b88('0x15')][_0x1b88('0x17')]);}else{logger['info'](_0x1b88('0x11'),_0x24f44e,_0x1b88('0x18'));_0x158f8e(_0x471234[_0x1b88('0x19')][_0x1b88('0x17')]);}})['catch'](function(_0x127488){logger[_0x1b88('0x15')](_0x1b88('0x11'),_0x24f44e,_0x127488);_0x1e6bc1(_0x127488);});});}
\ No newline at end of file
index 02380de..0b92d64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a42=['../../config/environment','./intZendeskField.controller','index','get','show','post','create','/:id','isAuthenticated','update','delete','exports','util','path','connect-timeout','Router'];(function(_0x1684f4,_0x57e155){var _0x89f3c1=function(_0xc0d20e){while(--_0xc0d20e){_0x1684f4['push'](_0x1684f4['shift']());}};_0x89f3c1(++_0x57e155);}(_0x2a42,0xec));var _0x22a4=function(_0x589f38,_0x314b1a){_0x589f38=_0x589f38-0x0;var _0x33633b=_0x2a42[_0x589f38];return _0x33633b;};'use strict';var multer=require('multer');var util=require(_0x22a4('0x0'));var path=require(_0x22a4('0x1'));var timeout=require(_0x22a4('0x2'));var express=require('express');var router=express[_0x22a4('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x22a4('0x4'));var controller=require(_0x22a4('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x22a4('0x6')]);router[_0x22a4('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x22a4('0x8')]);router[_0x22a4('0x9')]('/',auth['isAuthenticated'](),controller[_0x22a4('0xa')]);router['put'](_0x22a4('0xb'),auth[_0x22a4('0xc')](),controller[_0x22a4('0xd')]);router[_0x22a4('0xe')](_0x22a4('0xb'),auth[_0x22a4('0xc')](),controller['destroy']);module[_0x22a4('0xf')]=router;
\ No newline at end of file
+var _0xdd1d=['create','/:id','destroy','exports','util','connect-timeout','fs-extra','../../config/environment','./intZendeskField.controller','get','isAuthenticated','show','post'];(function(_0x52ec8e,_0x236051){var _0x1b2440=function(_0x6fbee9){while(--_0x6fbee9){_0x52ec8e['push'](_0x52ec8e['shift']());}};_0x1b2440(++_0x236051);}(_0xdd1d,0x17d));var _0xddd1=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xdd1d[_0x35da42];return _0x370035;};'use strict';var multer=require('multer');var util=require(_0xddd1('0x0'));var path=require('path');var timeout=require(_0xddd1('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xddd1('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xddd1('0x3'));var controller=require(_0xddd1('0x4'));router[_0xddd1('0x5')]('/',auth[_0xddd1('0x6')](),controller['index']);router[_0xddd1('0x5')]('/:id',auth[_0xddd1('0x6')](),controller[_0xddd1('0x7')]);router[_0xddd1('0x8')]('/',auth[_0xddd1('0x6')](),controller[_0xddd1('0x9')]);router['put'](_0xddd1('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xddd1('0xa'),auth[_0xddd1('0x6')](),controller[_0xddd1('0xb')]);module[_0xddd1('0xc')]=router;
\ No newline at end of file
index c1543c5..f4e9d7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfa3=['customVariable','keyValue','string','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfa3,0x16e));var _0x3bfa=function(_0x12c7ff,_0x2d631c){_0x12c7ff=_0x12c7ff-0x0;var _0x5459d3=_0xbfa3[_0x12c7ff];return _0x5459d3;};'use strict';var Sequelize=require(_0x3bfa('0x0'));module[_0x3bfa('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x3bfa('0x2'),_0x3bfa('0x3'),'picklist'),'defaultValue':_0x3bfa('0x4')},'content':{'type':Sequelize[_0x3bfa('0x5')]},'key':{'type':Sequelize[_0x3bfa('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x3bfa('0x6'),_0x3bfa('0x2'))},'keyContent':{'type':Sequelize[_0x3bfa('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3bfa('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xcee3=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','string'];(function(_0x4d67a6,_0x49f3e5){var _0x5b48a9=function(_0x3e471a){while(--_0x3e471a){_0x4d67a6['push'](_0x4d67a6['shift']());}};_0x5b48a9(++_0x49f3e5);}(_0xcee3,0x77));var _0x3cee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcee3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3cee('0x0'));module[_0x3cee('0x1')]={'type':{'type':Sequelize[_0x3cee('0x2')]('string',_0x3cee('0x3'),_0x3cee('0x4'),_0x3cee('0x5'),'picklist'),'defaultValue':_0x3cee('0x6')},'content':{'type':Sequelize[_0x3cee('0x7')]},'key':{'type':Sequelize[_0x3cee('0x7')]},'keyType':{'type':Sequelize[_0x3cee('0x2')](_0x3cee('0x6'),_0x3cee('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x3cee('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3cee('0x7')]},'customField':{'type':Sequelize[_0x3cee('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3cee('0x7')]}};
\ No newline at end of file
index b789773..8fa25c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe032=['create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','rows','catch','show','params','include'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0xe032,0x175));var _0x2e03=function(_0x311374,_0x132c28){_0x311374=_0x311374-0x0;var _0x1bf041=_0xe032[_0x311374];return _0x1bf041;};'use strict';var emlformat=require(_0x2e03('0x0'));var rimraf=require(_0x2e03('0x1'));var zipdir=require(_0x2e03('0x2'));var jsonpatch=require(_0x2e03('0x3'));var rp=require(_0x2e03('0x4'));var moment=require(_0x2e03('0x5'));var BPromise=require(_0x2e03('0x6'));var Mustache=require('mustache');var util=require(_0x2e03('0x7'));var path=require('path');var sox=require(_0x2e03('0x8'));var csv=require('to-csv');var ejs=require(_0x2e03('0x9'));var fs=require('fs');var fs_extra=require(_0x2e03('0xa'));var _=require(_0x2e03('0xb'));var squel=require(_0x2e03('0xc'));var crypto=require(_0x2e03('0xd'));var jsforce=require(_0x2e03('0xe'));var deskjs=require(_0x2e03('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e03('0x10'));var Redis=require(_0x2e03('0x11'));var authService=require(_0x2e03('0x12'));var qs=require(_0x2e03('0x13'));var as=require(_0x2e03('0x14'));var hardwareService=require(_0x2e03('0x15'));var logger=require(_0x2e03('0x16'))(_0x2e03('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2e03('0x18'));var db=require(_0x2e03('0x19'))['db'];function respondWithStatusCode(_0xbd139c,_0x4b807d){_0x4b807d=_0x4b807d||0xcc;return function(_0x4bc361){if(_0x4bc361){return _0xbd139c[_0x2e03('0x1a')](_0x4b807d);}return _0xbd139c[_0x2e03('0x1b')](_0x4b807d)[_0x2e03('0x1c')]();};}function respondWithResult(_0x55f2af,_0x47f1a7){_0x47f1a7=_0x47f1a7||0xc8;return function(_0x21107a){if(_0x21107a){return _0x55f2af[_0x2e03('0x1b')](_0x47f1a7)[_0x2e03('0x1d')](_0x21107a);}};}function respondWithFilteredResult(_0x127c14,_0x3c75f4){return function(_0x190ca2){if(_0x190ca2){var _0x18ea08=typeof _0x3c75f4['offset']===_0x2e03('0x1e')&&typeof _0x3c75f4[_0x2e03('0x1f')]==='undefined';var _0x25c15c=_0x190ca2[_0x2e03('0x20')];var _0x1f12de=_0x18ea08?0x0:_0x3c75f4[_0x2e03('0x21')];var _0x362a8f=_0x18ea08?_0x190ca2[_0x2e03('0x20')]:_0x3c75f4[_0x2e03('0x21')]+_0x3c75f4['limit'];var _0x36574e;if(_0x362a8f>=_0x25c15c){_0x362a8f=_0x25c15c;_0x36574e=0xc8;}else{_0x36574e=0xce;}_0x127c14['status'](_0x36574e);return _0x127c14['set']('Content-Range',_0x1f12de+'-'+_0x362a8f+'/'+_0x25c15c)[_0x2e03('0x1d')](_0x190ca2);}return null;};}function patchUpdates(_0x22f9e8){return function(_0x33f6f1){try{jsonpatch[_0x2e03('0x22')](_0x33f6f1,_0x22f9e8,!![]);}catch(_0x409a1c){return BPromise[_0x2e03('0x23')](_0x409a1c);}return _0x33f6f1[_0x2e03('0x24')]();};}function saveUpdates(_0x577a5a,_0x536bd8){return function(_0x3d0660){if(_0x3d0660){return _0x3d0660[_0x2e03('0x25')](_0x577a5a)[_0x2e03('0x26')](function(_0x34b6f0){return _0x34b6f0;});}return null;};}function removeEntity(_0x4c08c1,_0x31d205){return function(_0x28319f){if(_0x28319f){return _0x28319f['destroy']()[_0x2e03('0x26')](function(){_0x4c08c1[_0x2e03('0x1b')](0xcc)[_0x2e03('0x1c')]();});}};}function handleEntityNotFound(_0x546946,_0x133316){return function(_0x3eae7e){if(!_0x3eae7e){_0x546946[_0x2e03('0x1a')](0x194);}return _0x3eae7e;};}function handleError(_0x2d5229,_0x15cd0a){_0x15cd0a=_0x15cd0a||0x1f4;return function(_0x153ee4){logger[_0x2e03('0x27')](_0x153ee4[_0x2e03('0x28')]);if(_0x153ee4[_0x2e03('0x29')]){delete _0x153ee4[_0x2e03('0x29')];}_0x2d5229[_0x2e03('0x1b')](_0x15cd0a)['send'](_0x153ee4);};}exports[_0x2e03('0x2a')]=function(_0x3a9fb3,_0x50b5a5){var _0x193da4={},_0x258819={},_0x3ca331={'count':0x0,'rows':[]};var _0x5f8230=_[_0x2e03('0x2b')](db[_0x2e03('0x2c')][_0x2e03('0x2d')],function(_0xd52061){return{'name':_0xd52061[_0x2e03('0x2e')],'type':_0xd52061['type'][_0x2e03('0x2f')]};});_0x258819[_0x2e03('0x30')]=_[_0x2e03('0x2b')](_0x5f8230,_0x2e03('0x29'));_0x258819['query']=_[_0x2e03('0x31')](_0x3a9fb3[_0x2e03('0x32')]);_0x258819[_0x2e03('0x33')]=_[_0x2e03('0x34')](_0x258819[_0x2e03('0x30')],_0x258819[_0x2e03('0x32')]);_0x193da4[_0x2e03('0x35')]=_[_0x2e03('0x34')](_0x258819[_0x2e03('0x30')],qs[_0x2e03('0x36')](_0x3a9fb3[_0x2e03('0x32')][_0x2e03('0x36')]));_0x193da4[_0x2e03('0x35')]=_0x193da4[_0x2e03('0x35')][_0x2e03('0x37')]?_0x193da4[_0x2e03('0x35')]:_0x258819[_0x2e03('0x30')];if(!_0x3a9fb3[_0x2e03('0x32')][_0x2e03('0x38')]('nolimit')){_0x193da4[_0x2e03('0x1f')]=qs[_0x2e03('0x1f')](_0x3a9fb3[_0x2e03('0x32')]['limit']);_0x193da4[_0x2e03('0x21')]=qs[_0x2e03('0x21')](_0x3a9fb3[_0x2e03('0x32')]['offset']);}_0x193da4[_0x2e03('0x39')]=qs[_0x2e03('0x3a')](_0x3a9fb3[_0x2e03('0x32')][_0x2e03('0x3a')]);_0x193da4[_0x2e03('0x3b')]=qs[_0x2e03('0x33')](_[_0x2e03('0x3c')](_0x3a9fb3[_0x2e03('0x32')],_0x258819[_0x2e03('0x33')]),_0x5f8230);if(_0x3a9fb3[_0x2e03('0x32')][_0x2e03('0x3d')]){_0x193da4[_0x2e03('0x3b')]=_[_0x2e03('0x3e')](_0x193da4[_0x2e03('0x3b')],{'$or':_['map'](_0x5f8230,function(_0x3a3584){if(_0x3a3584[_0x2e03('0x3f')]!==_0x2e03('0x40')){var _0x2864aa={};_0x2864aa[_0x3a3584[_0x2e03('0x29')]]={'$like':'%'+_0x3a9fb3[_0x2e03('0x32')][_0x2e03('0x3d')]+'%'};return _0x2864aa;}})});}_0x193da4=_[_0x2e03('0x3e')]({},_0x193da4,_0x3a9fb3['options']);var _0x396744={'where':_0x193da4['where']};return db['ZendeskField']['count'](_0x396744)[_0x2e03('0x26')](function(_0x1ade71){_0x3ca331[_0x2e03('0x20')]=_0x1ade71;if(_0x3a9fb3[_0x2e03('0x32')][_0x2e03('0x41')]){_0x193da4['include']=[{'all':!![]}];}return db[_0x2e03('0x2c')]['findAll'](_0x193da4);})[_0x2e03('0x26')](function(_0x15170a){_0x3ca331[_0x2e03('0x42')]=_0x15170a;return _0x3ca331;})[_0x2e03('0x26')](respondWithFilteredResult(_0x50b5a5,_0x193da4))[_0x2e03('0x43')](handleError(_0x50b5a5,null));};exports[_0x2e03('0x44')]=function(_0x2ba067,_0x524351){var _0x30c252={'raw':!![],'where':{'id':_0x2ba067[_0x2e03('0x45')]['id']}},_0x22a395={};_0x22a395[_0x2e03('0x30')]=_[_0x2e03('0x31')](db[_0x2e03('0x2c')][_0x2e03('0x2d')]);_0x22a395[_0x2e03('0x32')]=_[_0x2e03('0x31')](_0x2ba067[_0x2e03('0x32')]);_0x22a395['filters']=_['intersection'](_0x22a395['model'],_0x22a395[_0x2e03('0x32')]);_0x30c252[_0x2e03('0x35')]=_[_0x2e03('0x34')](_0x22a395['model'],qs[_0x2e03('0x36')](_0x2ba067[_0x2e03('0x32')][_0x2e03('0x36')]));_0x30c252['attributes']=_0x30c252[_0x2e03('0x35')]['length']?_0x30c252['attributes']:_0x22a395['model'];if(_0x2ba067['query'][_0x2e03('0x41')]){_0x30c252[_0x2e03('0x46')]=[{'all':!![]}];}_0x30c252=_[_0x2e03('0x3e')]({},_0x30c252,_0x2ba067['options']);return db[_0x2e03('0x2c')]['find'](_0x30c252)['then'](handleEntityNotFound(_0x524351,null))[_0x2e03('0x26')](respondWithResult(_0x524351,null))['catch'](handleError(_0x524351,null));};exports['create']=function(_0x33af1d,_0x28e26e){return db[_0x2e03('0x2c')][_0x2e03('0x47')](_0x33af1d[_0x2e03('0x48')],{})[_0x2e03('0x26')](respondWithResult(_0x28e26e,0xc9))[_0x2e03('0x43')](handleError(_0x28e26e,null));};exports[_0x2e03('0x25')]=function(_0x4560b9,_0x56d753){if(_0x4560b9[_0x2e03('0x48')]['id']){delete _0x4560b9['body']['id'];}return db['ZendeskField']['find']({'where':{'id':_0x4560b9[_0x2e03('0x45')]['id']}})[_0x2e03('0x26')](handleEntityNotFound(_0x56d753,null))['then'](saveUpdates(_0x4560b9[_0x2e03('0x48')],null))[_0x2e03('0x26')](respondWithResult(_0x56d753,null))[_0x2e03('0x43')](handleError(_0x56d753,null));};exports[_0x2e03('0x49')]=function(_0x1bce14,_0x4e94d5){return db[_0x2e03('0x2c')]['find']({'where':{'id':_0x1bce14['params']['id']}})[_0x2e03('0x26')](handleEntityNotFound(_0x4e94d5,null))[_0x2e03('0x26')](removeEntity(_0x4e94d5,null))[_0x2e03('0x43')](handleError(_0x4e94d5,null));};
\ No newline at end of file
+var _0xa391=['moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','ZendeskField','includeAll','include','rows','catch','show','params','keys','rawAttributes','options','body','find','destroy','rimraf','fast-json-patch','request-promise'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa391,0x1ee));var _0x1a39=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xa391[_0x4ff09b];return _0x3f5c2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a39('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a39('0x1'));var rp=require(_0x1a39('0x2'));var moment=require(_0x1a39('0x3'));var BPromise=require(_0x1a39('0x4'));var Mustache=require(_0x1a39('0x5'));var util=require('util');var path=require(_0x1a39('0x6'));var sox=require(_0x1a39('0x7'));var csv=require(_0x1a39('0x8'));var ejs=require(_0x1a39('0x9'));var fs=require('fs');var fs_extra=require(_0x1a39('0xa'));var _=require(_0x1a39('0xb'));var squel=require(_0x1a39('0xc'));var crypto=require('crypto');var jsforce=require(_0x1a39('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1a39('0x8'));var querystring=require(_0x1a39('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a39('0xf'));var authService=require(_0x1a39('0x10'));var qs=require(_0x1a39('0x11'));var as=require(_0x1a39('0x12'));var hardwareService=require(_0x1a39('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1a39('0x14'));var config=require(_0x1a39('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a39('0x16'))['db'];function respondWithStatusCode(_0x54f512,_0x4ba423){_0x4ba423=_0x4ba423||0xcc;return function(_0x23e95e){if(_0x23e95e){return _0x54f512[_0x1a39('0x17')](_0x4ba423);}return _0x54f512[_0x1a39('0x18')](_0x4ba423)[_0x1a39('0x19')]();};}function respondWithResult(_0x11f972,_0x4b48b6){_0x4b48b6=_0x4b48b6||0xc8;return function(_0x18203a){if(_0x18203a){return _0x11f972[_0x1a39('0x18')](_0x4b48b6)[_0x1a39('0x1a')](_0x18203a);}};}function respondWithFilteredResult(_0x4d0df9,_0x147907){return function(_0x4f44ea){if(_0x4f44ea){var _0x37e32d=typeof _0x147907[_0x1a39('0x1b')]===_0x1a39('0x1c')&&typeof _0x147907[_0x1a39('0x1d')]===_0x1a39('0x1c');var _0xc465a6=_0x4f44ea[_0x1a39('0x1e')];var _0x584fdc=_0x37e32d?0x0:_0x147907[_0x1a39('0x1b')];var _0x1f8dc7=_0x37e32d?_0x4f44ea[_0x1a39('0x1e')]:_0x147907['offset']+_0x147907[_0x1a39('0x1d')];var _0x4464c0;if(_0x1f8dc7>=_0xc465a6){_0x1f8dc7=_0xc465a6;_0x4464c0=0xc8;}else{_0x4464c0=0xce;}_0x4d0df9[_0x1a39('0x18')](_0x4464c0);return _0x4d0df9[_0x1a39('0x1f')]('Content-Range',_0x584fdc+'-'+_0x1f8dc7+'/'+_0xc465a6)['json'](_0x4f44ea);}return null;};}function patchUpdates(_0x50d678){return function(_0x4e57b3){try{jsonpatch[_0x1a39('0x20')](_0x4e57b3,_0x50d678,!![]);}catch(_0x3146e6){return BPromise[_0x1a39('0x21')](_0x3146e6);}return _0x4e57b3[_0x1a39('0x22')]();};}function saveUpdates(_0x62d2ac,_0x54b93c){return function(_0x1acd5d){if(_0x1acd5d){return _0x1acd5d[_0x1a39('0x23')](_0x62d2ac)[_0x1a39('0x24')](function(_0x151268){return _0x151268;});}return null;};}function removeEntity(_0xcbcd1e,_0x5577ed){return function(_0x4d5df4){if(_0x4d5df4){return _0x4d5df4['destroy']()[_0x1a39('0x24')](function(){_0xcbcd1e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd0591,_0x25f601){return function(_0x53799a){if(!_0x53799a){_0xd0591[_0x1a39('0x17')](0x194);}return _0x53799a;};}function handleError(_0x29a36e,_0x12185b){_0x12185b=_0x12185b||0x1f4;return function(_0x73426d){logger[_0x1a39('0x25')](_0x73426d[_0x1a39('0x26')]);if(_0x73426d[_0x1a39('0x27')]){delete _0x73426d[_0x1a39('0x27')];}_0x29a36e[_0x1a39('0x18')](_0x12185b)[_0x1a39('0x28')](_0x73426d);};}exports[_0x1a39('0x29')]=function(_0x4899c5,_0x35acca){var _0x45c0eb={},_0x4f6bba={},_0x2eab2f={'count':0x0,'rows':[]};var _0x462e68=_[_0x1a39('0x2a')](db['ZendeskField']['rawAttributes'],function(_0x5bcc24){return{'name':_0x5bcc24['fieldName'],'type':_0x5bcc24[_0x1a39('0x2b')][_0x1a39('0x2c')]};});_0x4f6bba[_0x1a39('0x2d')]=_[_0x1a39('0x2a')](_0x462e68,'name');_0x4f6bba[_0x1a39('0x2e')]=_['keys'](_0x4899c5[_0x1a39('0x2e')]);_0x4f6bba[_0x1a39('0x2f')]=_[_0x1a39('0x30')](_0x4f6bba[_0x1a39('0x2d')],_0x4f6bba[_0x1a39('0x2e')]);_0x45c0eb[_0x1a39('0x31')]=_[_0x1a39('0x30')](_0x4f6bba[_0x1a39('0x2d')],qs[_0x1a39('0x32')](_0x4899c5[_0x1a39('0x2e')]['fields']));_0x45c0eb['attributes']=_0x45c0eb[_0x1a39('0x31')][_0x1a39('0x33')]?_0x45c0eb[_0x1a39('0x31')]:_0x4f6bba[_0x1a39('0x2d')];if(!_0x4899c5[_0x1a39('0x2e')]['hasOwnProperty'](_0x1a39('0x34'))){_0x45c0eb[_0x1a39('0x1d')]=qs[_0x1a39('0x1d')](_0x4899c5[_0x1a39('0x2e')]['limit']);_0x45c0eb[_0x1a39('0x1b')]=qs[_0x1a39('0x1b')](_0x4899c5[_0x1a39('0x2e')]['offset']);}_0x45c0eb[_0x1a39('0x35')]=qs[_0x1a39('0x36')](_0x4899c5[_0x1a39('0x2e')][_0x1a39('0x36')]);_0x45c0eb[_0x1a39('0x37')]=qs[_0x1a39('0x2f')](_['pick'](_0x4899c5[_0x1a39('0x2e')],_0x4f6bba[_0x1a39('0x2f')]),_0x462e68);if(_0x4899c5['query'][_0x1a39('0x38')]){_0x45c0eb[_0x1a39('0x37')]=_['merge'](_0x45c0eb[_0x1a39('0x37')],{'$or':_[_0x1a39('0x2a')](_0x462e68,function(_0x450ca0){if(_0x450ca0[_0x1a39('0x2b')]!=='VIRTUAL'){var _0x511b9e={};_0x511b9e[_0x450ca0[_0x1a39('0x27')]]={'$like':'%'+_0x4899c5[_0x1a39('0x2e')][_0x1a39('0x38')]+'%'};return _0x511b9e;}})});}_0x45c0eb=_[_0x1a39('0x39')]({},_0x45c0eb,_0x4899c5['options']);var _0x153dfd={'where':_0x45c0eb[_0x1a39('0x37')]};return db[_0x1a39('0x3a')][_0x1a39('0x1e')](_0x153dfd)['then'](function(_0x5a23be){_0x2eab2f[_0x1a39('0x1e')]=_0x5a23be;if(_0x4899c5['query'][_0x1a39('0x3b')]){_0x45c0eb[_0x1a39('0x3c')]=[{'all':!![]}];}return db[_0x1a39('0x3a')]['findAll'](_0x45c0eb);})[_0x1a39('0x24')](function(_0x567b00){_0x2eab2f[_0x1a39('0x3d')]=_0x567b00;return _0x2eab2f;})['then'](respondWithFilteredResult(_0x35acca,_0x45c0eb))[_0x1a39('0x3e')](handleError(_0x35acca,null));};exports[_0x1a39('0x3f')]=function(_0x524528,_0x28af7e){var _0x30d0a7={'raw':!![],'where':{'id':_0x524528[_0x1a39('0x40')]['id']}},_0x24becf={};_0x24becf['model']=_[_0x1a39('0x41')](db[_0x1a39('0x3a')][_0x1a39('0x42')]);_0x24becf['query']=_['keys'](_0x524528[_0x1a39('0x2e')]);_0x24becf['filters']=_[_0x1a39('0x30')](_0x24becf[_0x1a39('0x2d')],_0x24becf[_0x1a39('0x2e')]);_0x30d0a7['attributes']=_[_0x1a39('0x30')](_0x24becf['model'],qs[_0x1a39('0x32')](_0x524528[_0x1a39('0x2e')][_0x1a39('0x32')]));_0x30d0a7['attributes']=_0x30d0a7[_0x1a39('0x31')][_0x1a39('0x33')]?_0x30d0a7[_0x1a39('0x31')]:_0x24becf[_0x1a39('0x2d')];if(_0x524528[_0x1a39('0x2e')][_0x1a39('0x3b')]){_0x30d0a7[_0x1a39('0x3c')]=[{'all':!![]}];}_0x30d0a7=_['merge']({},_0x30d0a7,_0x524528[_0x1a39('0x43')]);return db[_0x1a39('0x3a')]['find'](_0x30d0a7)[_0x1a39('0x24')](handleEntityNotFound(_0x28af7e,null))[_0x1a39('0x24')](respondWithResult(_0x28af7e,null))['catch'](handleError(_0x28af7e,null));};exports['create']=function(_0x29c833,_0x1a30e7){return db[_0x1a39('0x3a')]['create'](_0x29c833['body'],{})['then'](respondWithResult(_0x1a30e7,0xc9))[_0x1a39('0x3e')](handleError(_0x1a30e7,null));};exports[_0x1a39('0x23')]=function(_0xbdcac7,_0x359e50){if(_0xbdcac7[_0x1a39('0x44')]['id']){delete _0xbdcac7[_0x1a39('0x44')]['id'];}return db[_0x1a39('0x3a')][_0x1a39('0x45')]({'where':{'id':_0xbdcac7[_0x1a39('0x40')]['id']}})['then'](handleEntityNotFound(_0x359e50,null))[_0x1a39('0x24')](saveUpdates(_0xbdcac7[_0x1a39('0x44')],null))[_0x1a39('0x24')](respondWithResult(_0x359e50,null))[_0x1a39('0x3e')](handleError(_0x359e50,null));};exports[_0x1a39('0x46')]=function(_0x2a031b,_0x1cec3f){return db[_0x1a39('0x3a')][_0x1a39('0x45')]({'where':{'id':_0x2a031b[_0x1a39('0x40')]['id']}})['then'](handleEntityNotFound(_0x1cec3f,null))[_0x1a39('0x24')](removeEntity(_0x1cec3f,null))[_0x1a39('0x3e')](handleError(_0x1cec3f,null));};
\ No newline at end of file
index a63f83f..826833d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5feb=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash'];(function(_0x570c8a,_0x4a11cc){var _0x25dc12=function(_0x4585d9){while(--_0x4585d9){_0x570c8a['push'](_0x570c8a['shift']());}};_0x25dc12(++_0x4a11cc);}(_0x5feb,0x1c1));var _0xb5fe=function(_0x65cd03,_0x2913ee){_0x65cd03=_0x65cd03-0x0;var _0x21c579=_0x5feb[_0x65cd03];return _0x21c579;};'use strict';var _=require(_0xb5fe('0x0'));var util=require(_0xb5fe('0x1'));var logger=require(_0xb5fe('0x2'))(_0xb5fe('0x3'));var moment=require(_0xb5fe('0x4'));var BPromise=require(_0xb5fe('0x5'));var rp=require(_0xb5fe('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb5fe('0x7'));var config=require(_0xb5fe('0x8'));var attributes=require('./intZendeskField.attributes');module[_0xb5fe('0x9')]=function(_0x6569a5,_0x55821b){return _0x6569a5[_0xb5fe('0xa')](_0xb5fe('0xb'),attributes,{'tableName':_0xb5fe('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fe('0xd'),'fields':[_0xb5fe('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa604=['exports','define','zendesk_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4aa0ac,_0xcae15d){var _0x4405f6=function(_0x3e8621){while(--_0x3e8621){_0x4aa0ac['push'](_0x4aa0ac['shift']());}};_0x4405f6(++_0xcae15d);}(_0xa604,0x190));var _0x4a60=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa604[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4a60('0x0'));var util=require('util');var logger=require(_0x4a60('0x1'))(_0x4a60('0x2'));var moment=require(_0x4a60('0x3'));var BPromise=require(_0x4a60('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a60('0x5'));var rimraf=require(_0x4a60('0x6'));var config=require(_0x4a60('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x4a60('0x8')]=function(_0x42c565,_0x26a5e2){return _0x42c565[_0x4a60('0x9')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x4a60('0xa'),'fields':[_0x4a60('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 3be3399..999d27d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78ea=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x58063b,_0x1a76a1){var _0x313a60=function(_0x1a909e){while(--_0x1a909e){_0x58063b['push'](_0x58063b['shift']());}};_0x313a60(++_0x1a76a1);}(_0x78ea,0x18d));var _0xa78e=function(_0x314fc1,_0x28bab7){_0x314fc1=_0x314fc1-0x0;var _0x5bc3ad=_0x78ea[_0x314fc1];return _0x5bc3ad;};'use strict';var _=require(_0xa78e('0x0'));var util=require(_0xa78e('0x1'));var moment=require(_0xa78e('0x2'));var BPromise=require('bluebird');var rs=require(_0xa78e('0x3'));var fs=require('fs');var Redis=require(_0xa78e('0x4'));var db=require(_0xa78e('0x5'))['db'];var utils=require(_0xa78e('0x6'));var logger=require(_0xa78e('0x7'))(_0xa78e('0x8'));var config=require(_0xa78e('0x9'));var jayson=require(_0xa78e('0xa'));var client=jayson[_0xa78e('0xb')][_0xa78e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ca896,_0x5ce6f2,_0x2a5729){return new BPromise(function(_0x580912,_0x297d7c){return client['request'](_0x3ca896,_0x2a5729)['then'](function(_0x5a4f78){logger['info'](_0xa78e('0xd'),_0x5ce6f2,_0xa78e('0xe'));logger[_0xa78e('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x5ce6f2,_0xa78e('0xe'),JSON[_0xa78e('0x10')](_0x5a4f78));if(_0x5a4f78['error']){if(_0x5a4f78[_0xa78e('0x11')][_0xa78e('0x12')]===0x1f4){logger['error'](_0xa78e('0xd'),_0x5ce6f2,_0x5a4f78[_0xa78e('0x11')][_0xa78e('0x13')]);return _0x297d7c(_0x5a4f78[_0xa78e('0x11')][_0xa78e('0x13')]);}logger[_0xa78e('0x11')](_0xa78e('0xd'),_0x5ce6f2,_0x5a4f78['error'][_0xa78e('0x13')]);return _0x580912(_0x5a4f78[_0xa78e('0x11')]['message']);}else{logger[_0xa78e('0x14')](_0xa78e('0xd'),_0x5ce6f2,_0xa78e('0xe'));_0x580912(_0x5a4f78[_0xa78e('0x15')]['message']);}})['catch'](function(_0x400d7b){logger['error']('ZendeskField,\x20%s,\x20%s',_0x5ce6f2,_0x400d7b);_0x297d7c(_0x400d7b);});});}
\ No newline at end of file
+var _0xa1c6=['rpc','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x73b766,_0x55b500){var _0x91fcc8=function(_0x243980){while(--_0x243980){_0x73b766['push'](_0x73b766['shift']());}};_0x91fcc8(++_0x55b500);}(_0xa1c6,0x19d));var _0x6a1c=function(_0xbfc791,_0x56c656){_0xbfc791=_0xbfc791-0x0;var _0x11e604=_0xa1c6[_0xbfc791];return _0x11e604;};'use strict';var _=require(_0x6a1c('0x0'));var util=require(_0x6a1c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a1c('0x2'))['db'];var utils=require(_0x6a1c('0x3'));var logger=require(_0x6a1c('0x4'))(_0x6a1c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6a1c('0x6')][_0x6a1c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x54ce31,_0x6c5d0e,_0x1eb616){return new BPromise(function(_0x238f4e,_0x40a413){return client[_0x6a1c('0x8')](_0x54ce31,_0x1eb616)[_0x6a1c('0x9')](function(_0x1af32e){logger['info'](_0x6a1c('0xa'),_0x6c5d0e,_0x6a1c('0xb'));logger[_0x6a1c('0xc')](_0x6a1c('0xd'),_0x6c5d0e,_0x6a1c('0xb'),JSON['stringify'](_0x1af32e));if(_0x1af32e[_0x6a1c('0xe')]){if(_0x1af32e[_0x6a1c('0xe')][_0x6a1c('0xf')]===0x1f4){logger[_0x6a1c('0xe')](_0x6a1c('0xa'),_0x6c5d0e,_0x1af32e[_0x6a1c('0xe')]['message']);return _0x40a413(_0x1af32e['error'][_0x6a1c('0x10')]);}logger[_0x6a1c('0xe')](_0x6a1c('0xa'),_0x6c5d0e,_0x1af32e[_0x6a1c('0xe')][_0x6a1c('0x10')]);return _0x238f4e(_0x1af32e[_0x6a1c('0xe')]['message']);}else{logger[_0x6a1c('0x11')]('ZendeskField,\x20%s,\x20%s',_0x6c5d0e,_0x6a1c('0xb'));_0x238f4e(_0x1af32e['result']['message']);}})[_0x6a1c('0x12')](function(_0x247702){logger[_0x6a1c('0xe')]('ZendeskField,\x20%s,\x20%s',_0x6c5d0e,_0x247702);_0x40a413(_0x247702);});});}
\ No newline at end of file
index 682b621..9e66ea9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15c9=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','addConfiguration','put','delete','destroy','exports','multer','util'];(function(_0x40e977,_0x5f22c2){var _0x2b2fe9=function(_0xa7bfb7){while(--_0xa7bfb7){_0x40e977['push'](_0x40e977['shift']());}};_0x2b2fe9(++_0x5f22c2);}(_0x15c9,0x18a));var _0x915c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x15c9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x915c('0x0'));var util=require(_0x915c('0x1'));var path=require('path');var timeout=require(_0x915c('0x2'));var express=require(_0x915c('0x3'));var router=express[_0x915c('0x4')]();var fs_extra=require(_0x915c('0x5'));var auth=require(_0x915c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x915c('0x7'));var controller=require(_0x915c('0x8'));router['get']('/',auth[_0x915c('0x9')](),controller[_0x915c('0xa')]);router[_0x915c('0xb')](_0x915c('0xc'),auth['isAuthenticated'](),controller[_0x915c('0xd')]);router[_0x915c('0xb')](_0x915c('0xe'),auth['isAuthenticated'](),controller[_0x915c('0xf')]);router[_0x915c('0xb')](_0x915c('0x10'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x915c('0x9')](),controller['create']);router['post']('/:id/configurations',auth[_0x915c('0x9')](),controller[_0x915c('0x11')]);router[_0x915c('0x12')](_0x915c('0xc'),auth[_0x915c('0x9')](),controller['update']);router[_0x915c('0x13')](_0x915c('0xc'),auth[_0x915c('0x9')](),controller[_0x915c('0x14')]);module[_0x915c('0x15')]=router;
\ No newline at end of file
+var _0x9c77=['create','addConfiguration','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x173113,_0x316a7c){var _0x3bea89=function(_0xd33ac1){while(--_0xd33ac1){_0x173113['push'](_0x173113['shift']());}};_0x3bea89(++_0x316a7c);}(_0x9c77,0x12e));var _0x79c7=function(_0x355ce2,_0x3cb03e){_0x355ce2=_0x355ce2-0x0;var _0x42db93=_0x9c77[_0x355ce2];return _0x42db93;};'use strict';var multer=require(_0x79c7('0x0'));var util=require(_0x79c7('0x1'));var path=require(_0x79c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x79c7('0x3'));var router=express[_0x79c7('0x4')]();var fs_extra=require(_0x79c7('0x5'));var auth=require(_0x79c7('0x6'));var interaction=require(_0x79c7('0x7'));var config=require(_0x79c7('0x8'));var controller=require(_0x79c7('0x9'));router['get']('/',auth[_0x79c7('0xa')](),controller[_0x79c7('0xb')]);router[_0x79c7('0xc')](_0x79c7('0xd'),auth[_0x79c7('0xa')](),controller[_0x79c7('0xe')]);router[_0x79c7('0xc')](_0x79c7('0xf'),auth[_0x79c7('0xa')](),controller[_0x79c7('0x10')]);router[_0x79c7('0xc')](_0x79c7('0x11'),auth[_0x79c7('0xa')](),controller[_0x79c7('0x12')]);router[_0x79c7('0x13')]('/',auth[_0x79c7('0xa')](),controller[_0x79c7('0x14')]);router[_0x79c7('0x13')](_0x79c7('0xf'),auth[_0x79c7('0xa')](),controller[_0x79c7('0x15')]);router['put'](_0x79c7('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x79c7('0xa')](),controller[_0x79c7('0x16')]);module['exports']=router;
\ No newline at end of file
index cfe8dd7..55e8def 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['exports','STRING','sequelize'];(function(_0x21abf1,_0xcd06d){var _0x8f3ba=function(_0x1c904e){while(--_0x1c904e){_0x21abf1['push'](_0x21abf1['shift']());}};_0x8f3ba(++_0xcd06d);}(_0x008c,0x188));var _0xc008=function(_0x3c538b,_0x14cb10){_0x3c538b=_0x3c538b-0x0;var _0x4b8542=_0x008c[_0x3c538b];return _0x4b8542;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'name':{'type':Sequelize[_0xc008('0x2')]},'description':{'type':Sequelize[_0xc008('0x2')]},'host':{'type':Sequelize[_0xc008('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc008('0x2')]},'clientSecret':{'type':Sequelize[_0xc008('0x2')]},'serverUrl':{'type':Sequelize[_0xc008('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xc008('0x2')]},'refreshToken':{'type':Sequelize[_0xc008('0x2')]}};
\ No newline at end of file
+var _0xb821=['STRING','exports'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xb821,0xa7));var _0x1b82=function(_0xd5de29,_0x2f04a8){_0xd5de29=_0xd5de29-0x0;var _0x128323=_0xb821[_0xd5de29];return _0x128323;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'name':{'type':Sequelize[_0x1b82('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x1b82('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1b82('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x1b82('0x1')]},'refreshToken':{'type':Sequelize[_0x1b82('0x1')]}};
\ No newline at end of file
index 845b396..785892f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf420=['destroy','error','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','find','catch','create','body','params','findOne','ZohoConfiguration','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','data_type','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/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','reject','update','then'];(function(_0x347e7d,_0x9bc387){var _0x14f6fc=function(_0x2d3b0b){while(--_0x2d3b0b){_0x347e7d['push'](_0x347e7d['shift']());}};_0x14f6fc(++_0x9bc387);}(_0xf420,0x158));var _0x0f42=function(_0x228aae,_0x36f2a4){_0x228aae=_0x228aae-0x0;var _0x4c9447=_0xf420[_0x228aae];return _0x4c9447;};'use strict';var emlformat=require(_0x0f42('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0f42('0x1'));var rp=require(_0x0f42('0x2'));var moment=require(_0x0f42('0x3'));var BPromise=require(_0x0f42('0x4'));var Mustache=require(_0x0f42('0x5'));var util=require('util');var path=require(_0x0f42('0x6'));var sox=require(_0x0f42('0x7'));var csv=require(_0x0f42('0x8'));var ejs=require(_0x0f42('0x9'));var fs=require('fs');var fs_extra=require(_0x0f42('0xa'));var _=require(_0x0f42('0xb'));var squel=require(_0x0f42('0xc'));var crypto=require('crypto');var jsforce=require(_0x0f42('0xd'));var deskjs=require(_0x0f42('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0f42('0xf'));var Papa=require(_0x0f42('0x10'));var Redis=require(_0x0f42('0x11'));var authService=require(_0x0f42('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0f42('0x13'));var hardwareService=require(_0x0f42('0x14'));var logger=require(_0x0f42('0x15'))(_0x0f42('0x16'));var utils=require(_0x0f42('0x17'));var config=require(_0x0f42('0x18'));var licenseUtil=require(_0x0f42('0x19'));var db=require(_0x0f42('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x43b0dc,_0x8976dc){_0x8976dc=_0x8976dc||0xcc;return function(_0x22a7a){if(_0x22a7a){return _0x43b0dc[_0x0f42('0x1b')](_0x8976dc);}return _0x43b0dc[_0x0f42('0x1c')](_0x8976dc)[_0x0f42('0x1d')]();};}function respondWithResult(_0x8e8580,_0x27d455){_0x27d455=_0x27d455||0xc8;return function(_0x1bcef1){if(_0x1bcef1){return _0x8e8580[_0x0f42('0x1c')](_0x27d455)['json'](_0x1bcef1);}};}function respondWithFilteredResult(_0x132ffb,_0x2b9be4){return function(_0x500913){if(_0x500913){var _0x392f65=typeof _0x2b9be4[_0x0f42('0x1e')]===_0x0f42('0x1f')&&typeof _0x2b9be4[_0x0f42('0x20')]===_0x0f42('0x1f');var _0x25f017=_0x500913[_0x0f42('0x21')];var _0x592ac1=_0x392f65?0x0:_0x2b9be4[_0x0f42('0x1e')];var _0x19c002=_0x392f65?_0x500913[_0x0f42('0x21')]:_0x2b9be4[_0x0f42('0x1e')]+_0x2b9be4[_0x0f42('0x20')];var _0x5c09e3;if(_0x19c002>=_0x25f017){_0x19c002=_0x25f017;_0x5c09e3=0xc8;}else{_0x5c09e3=0xce;}_0x132ffb[_0x0f42('0x1c')](_0x5c09e3);return _0x132ffb[_0x0f42('0x22')](_0x0f42('0x23'),_0x592ac1+'-'+_0x19c002+'/'+_0x25f017)[_0x0f42('0x24')](_0x500913);}return null;};}function patchUpdates(_0x1502b6){return function(_0x50ba63){try{jsonpatch['apply'](_0x50ba63,_0x1502b6,!![]);}catch(_0x3efc03){return BPromise[_0x0f42('0x25')](_0x3efc03);}return _0x50ba63['save']();};}function saveUpdates(_0x1ea9b1,_0x3c1eb2){return function(_0x7359d0){if(_0x7359d0){return _0x7359d0[_0x0f42('0x26')](_0x1ea9b1)[_0x0f42('0x27')](function(_0x5c9b9c){return _0x5c9b9c;});}return null;};}function removeEntity(_0x5efcb1,_0x396149){return function(_0x4e2334){if(_0x4e2334){return _0x4e2334[_0x0f42('0x28')]()[_0x0f42('0x27')](function(){_0x5efcb1['status'](0xcc)[_0x0f42('0x1d')]();});}};}function handleEntityNotFound(_0x14711e,_0x5ebb5f){return function(_0x33bdb8){if(!_0x33bdb8){_0x14711e['sendStatus'](0x194);}return _0x33bdb8;};}function handleError(_0x3478c2,_0x53e7d3){_0x53e7d3=_0x53e7d3||0x1f4;return function(_0x31b7d7){logger[_0x0f42('0x29')](_0x31b7d7[_0x0f42('0x2a')]);if(_0x31b7d7[_0x0f42('0x2b')]){delete _0x31b7d7[_0x0f42('0x2b')];}_0x3478c2[_0x0f42('0x1c')](_0x53e7d3)[_0x0f42('0x2c')](_0x31b7d7);};}exports['index']=function(_0x5f3fe1,_0x4256fe){var _0x5f3fdc={},_0x2bc143={},_0x31964a={'count':0x0,'rows':[]};var _0x11648d=_[_0x0f42('0x2d')](db[_0x0f42('0x2e')][_0x0f42('0x2f')],function(_0x1b385a){return{'name':_0x1b385a[_0x0f42('0x30')],'type':_0x1b385a[_0x0f42('0x31')]['key']};});_0x2bc143['model']=_[_0x0f42('0x2d')](_0x11648d,_0x0f42('0x2b'));_0x2bc143[_0x0f42('0x32')]=_[_0x0f42('0x33')](_0x5f3fe1[_0x0f42('0x32')]);_0x2bc143['filters']=_[_0x0f42('0x34')](_0x2bc143['model'],_0x2bc143[_0x0f42('0x32')]);_0x5f3fdc[_0x0f42('0x35')]=_[_0x0f42('0x34')](_0x2bc143[_0x0f42('0x36')],qs['fields'](_0x5f3fe1[_0x0f42('0x32')][_0x0f42('0x37')]));_0x5f3fdc['attributes']=_0x5f3fdc[_0x0f42('0x35')][_0x0f42('0x38')]?_0x5f3fdc['attributes']:_0x2bc143[_0x0f42('0x36')];if(!_0x5f3fe1[_0x0f42('0x32')][_0x0f42('0x39')]('nolimit')){_0x5f3fdc[_0x0f42('0x20')]=qs[_0x0f42('0x20')](_0x5f3fe1['query'][_0x0f42('0x20')]);_0x5f3fdc[_0x0f42('0x1e')]=qs['offset'](_0x5f3fe1[_0x0f42('0x32')][_0x0f42('0x1e')]);}_0x5f3fdc['order']=qs[_0x0f42('0x3a')](_0x5f3fe1[_0x0f42('0x32')][_0x0f42('0x3a')]);_0x5f3fdc[_0x0f42('0x3b')]=qs[_0x0f42('0x3c')](_[_0x0f42('0x3d')](_0x5f3fe1[_0x0f42('0x32')],_0x2bc143[_0x0f42('0x3c')]),_0x11648d);if(_0x5f3fe1[_0x0f42('0x32')]['filter']){_0x5f3fdc[_0x0f42('0x3b')]=_['merge'](_0x5f3fdc[_0x0f42('0x3b')],{'$or':_[_0x0f42('0x2d')](_0x11648d,function(_0x1eda9d){if(_0x1eda9d[_0x0f42('0x31')]!=='VIRTUAL'){var _0x5de19a={};_0x5de19a[_0x1eda9d[_0x0f42('0x2b')]]={'$like':'%'+_0x5f3fe1[_0x0f42('0x32')][_0x0f42('0x3e')]+'%'};return _0x5de19a;}})});}_0x5f3fdc=_[_0x0f42('0x3f')]({},_0x5f3fdc,_0x5f3fe1[_0x0f42('0x40')]);var _0x649ed4={'where':_0x5f3fdc[_0x0f42('0x3b')]};return db['ZohoAccount'][_0x0f42('0x21')](_0x649ed4)['then'](function(_0x2d857a){_0x31964a[_0x0f42('0x21')]=_0x2d857a;if(_0x5f3fe1['query'][_0x0f42('0x41')]){_0x5f3fdc['include']=[{'all':!![]}];}return db[_0x0f42('0x2e')][_0x0f42('0x42')](_0x5f3fdc);})[_0x0f42('0x27')](function(_0x5c1b8e){_0x31964a[_0x0f42('0x43')]=_0x5c1b8e;return _0x31964a;})[_0x0f42('0x27')](respondWithFilteredResult(_0x4256fe,_0x5f3fdc))['catch'](handleError(_0x4256fe,null));};exports[_0x0f42('0x44')]=function(_0x16dbe3,_0x4f08de){var _0x1242ac={'raw':![],'where':{'id':_0x16dbe3['params']['id']}},_0x46689a={};_0x46689a[_0x0f42('0x36')]=_[_0x0f42('0x33')](db['ZohoAccount']['rawAttributes']);_0x46689a[_0x0f42('0x32')]=_['keys'](_0x16dbe3['query']);_0x46689a['filters']=_['intersection'](_0x46689a[_0x0f42('0x36')],_0x46689a['query']);_0x1242ac[_0x0f42('0x35')]=_['intersection'](_0x46689a[_0x0f42('0x36')],qs['fields'](_0x16dbe3[_0x0f42('0x32')][_0x0f42('0x37')]));_0x1242ac[_0x0f42('0x35')]=_0x1242ac[_0x0f42('0x35')][_0x0f42('0x38')]?_0x1242ac[_0x0f42('0x35')]:_0x46689a[_0x0f42('0x36')];if(_0x16dbe3[_0x0f42('0x32')][_0x0f42('0x41')]){_0x1242ac['include']=[{'all':!![]}];}_0x1242ac=_[_0x0f42('0x3f')]({},_0x1242ac,_0x16dbe3[_0x0f42('0x40')]);return db[_0x0f42('0x2e')][_0x0f42('0x45')](_0x1242ac)[_0x0f42('0x27')](handleEntityNotFound(_0x4f08de,null))[_0x0f42('0x27')](respondWithResult(_0x4f08de,null))[_0x0f42('0x46')](handleError(_0x4f08de,null));};exports['create']=function(_0x4cd62c,_0x233007){return db[_0x0f42('0x2e')][_0x0f42('0x47')](_0x4cd62c[_0x0f42('0x48')],{})[_0x0f42('0x27')](respondWithResult(_0x233007,0xc9))[_0x0f42('0x46')](handleError(_0x233007,null));};exports['update']=function(_0x56cf39,_0x12bda9){if(_0x56cf39[_0x0f42('0x48')]['id']){delete _0x56cf39['body']['id'];}return db[_0x0f42('0x2e')][_0x0f42('0x45')]({'where':{'id':_0x56cf39['params']['id']}})[_0x0f42('0x27')](handleEntityNotFound(_0x12bda9,null))[_0x0f42('0x27')](saveUpdates(_0x56cf39['body'],null))['then'](respondWithResult(_0x12bda9,null))['catch'](handleError(_0x12bda9,null));};exports[_0x0f42('0x28')]=function(_0x601a71,_0x4e10b4){return db[_0x0f42('0x2e')][_0x0f42('0x45')]({'where':{'id':_0x601a71[_0x0f42('0x49')]['id']}})[_0x0f42('0x27')](handleEntityNotFound(_0x4e10b4,null))['then'](removeEntity(_0x4e10b4,null))[_0x0f42('0x46')](handleError(_0x4e10b4,null));};exports['getConfigurations']=function(_0x4741f9,_0x42df31,_0x4a3dfc){var _0x31e1ed={};var _0x570dff={};var _0x22aab8;var _0x151118;return db[_0x0f42('0x2e')][_0x0f42('0x4a')]({'where':{'id':_0x4741f9[_0x0f42('0x49')]['id']}})['then'](handleEntityNotFound(_0x42df31,null))[_0x0f42('0x27')](function(_0xb70e1b){if(_0xb70e1b){_0x22aab8=_0xb70e1b;_0x570dff[_0x0f42('0x36')]=_[_0x0f42('0x33')](db[_0x0f42('0x4b')][_0x0f42('0x2f')]);_0x570dff[_0x0f42('0x32')]=_[_0x0f42('0x33')](_0x4741f9[_0x0f42('0x32')]);_0x570dff[_0x0f42('0x3c')]=_[_0x0f42('0x34')](_0x570dff['model'],_0x570dff[_0x0f42('0x32')]);_0x31e1ed['attributes']=_[_0x0f42('0x34')](_0x570dff[_0x0f42('0x36')],qs[_0x0f42('0x37')](_0x4741f9[_0x0f42('0x32')][_0x0f42('0x37')]));_0x31e1ed[_0x0f42('0x35')]=_0x31e1ed[_0x0f42('0x35')][_0x0f42('0x38')]?_0x31e1ed[_0x0f42('0x35')]:_0x570dff[_0x0f42('0x36')];_0x31e1ed['order']=qs[_0x0f42('0x3a')](_0x4741f9[_0x0f42('0x32')][_0x0f42('0x3a')]);_0x31e1ed[_0x0f42('0x3b')]=qs['filters'](_[_0x0f42('0x3d')](_0x4741f9[_0x0f42('0x32')],_0x570dff[_0x0f42('0x3c')]));if(_0x4741f9['query']['filter']){_0x31e1ed[_0x0f42('0x3b')]=_[_0x0f42('0x3f')](_0x31e1ed[_0x0f42('0x3b')],{'$or':_[_0x0f42('0x2d')](_0x31e1ed[_0x0f42('0x35')],function(_0x5bb846){var _0x5031ad={};_0x5031ad[_0x5bb846]={'$like':'%'+_0x4741f9[_0x0f42('0x32')][_0x0f42('0x3e')]+'%'};return _0x5031ad;})});}_0x31e1ed=_[_0x0f42('0x3f')]({},_0x31e1ed,_0x4741f9[_0x0f42('0x40')]);return _0x22aab8[_0x0f42('0x4c')](_0x31e1ed);}})[_0x0f42('0x27')](function(_0x2fdc83){if(_0x2fdc83){_0x151118=_0x2fdc83[_0x0f42('0x38')];if(!_0x4741f9[_0x0f42('0x32')][_0x0f42('0x39')](_0x0f42('0x4d'))){_0x31e1ed[_0x0f42('0x20')]=qs['limit'](_0x4741f9[_0x0f42('0x32')][_0x0f42('0x20')]);_0x31e1ed[_0x0f42('0x1e')]=qs[_0x0f42('0x1e')](_0x4741f9[_0x0f42('0x32')][_0x0f42('0x1e')]);}return _0x22aab8[_0x0f42('0x4c')](_0x31e1ed);}})[_0x0f42('0x27')](function(_0x291dd1){if(_0x291dd1){return _0x291dd1?{'count':_0x151118,'rows':_0x291dd1}:null;}})[_0x0f42('0x27')](respondWithResult(_0x42df31,null))['catch'](handleError(_0x42df31,null));};exports[_0x0f42('0x4e')]=function(_0x195eb4,_0x1a6706,_0x540f83){if(_0x195eb4[_0x0f42('0x48')]['id']){delete _0x195eb4[_0x0f42('0x48')]['id'];}return db[_0x0f42('0x2e')]['findOne']({'where':{'id':_0x195eb4[_0x0f42('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a6706,null))[_0x0f42('0x27')](function(_0x1cf894){if(_0x1cf894){_0x195eb4[_0x0f42('0x48')]['AccountId']=_0x1cf894['id'];_0x195eb4[_0x0f42('0x48')][_0x0f42('0x4f')]=integrations[_0x0f42('0x50')](_0x195eb4[_0x0f42('0x48')][_0x0f42('0x51')],_0x195eb4[_0x0f42('0x48')][_0x0f42('0x31')]);_0x195eb4[_0x0f42('0x48')][_0x0f42('0x52')]=integrations[_0x0f42('0x53')](_0x195eb4['body'][_0x0f42('0x51')],_0x195eb4[_0x0f42('0x48')][_0x0f42('0x31')]);return db[_0x0f42('0x4b')]['create'](_0x195eb4[_0x0f42('0x48')],{'include':[{'model':db[_0x0f42('0x54')],'as':'Subjects'},{'model':db[_0x0f42('0x54')],'as':_0x0f42('0x52')}]});}return null;})[_0x0f42('0x27')](respondWithResult(_0x1a6706,null))[_0x0f42('0x46')](handleError(_0x1a6706,null));};function getAccessToken(_0x5ce500){return new Promise(function(_0x169a7f,_0x482844){var _0x27a8c4;switch(_0x5ce500[_0x0f42('0x55')]){case'US':_0x27a8c4=_0x0f42('0x56');break;case'AU':_0x27a8c4='https://accounts.zoho.com.au';break;case'EU':_0x27a8c4=_0x0f42('0x57');break;case'IN':_0x27a8c4=_0x0f42('0x58');break;case'CN':_0x27a8c4=_0x0f42('0x59');break;default:_0x27a8c4=_0x0f42('0x57');break;}var _0xd76118={'method':'POST','uri':_0x27a8c4+_0x0f42('0x5a'),'qs':{'refresh_token':_0x5ce500[_0x0f42('0x5b')],'client_id':_0x5ce500[_0x0f42('0x5c')],'client_secret':_0x5ce500[_0x0f42('0x5d')],'grant_type':_0x0f42('0x5e')},'json':!![]};return rp(_0xd76118)[_0x0f42('0x27')](function(_0x5ac60d){if(_0x5ac60d[_0x0f42('0x5f')]){_0x169a7f(_0x5ac60d[_0x0f42('0x5f')]);}else{_0x482844(_0x0f42('0x60'));}})[_0x0f42('0x46')](function(_0x4ac47c){_0x482844(_0x4ac47c);});});}exports['getFields']=function(_0x26661b,_0x500854,_0x3e542e){var _0x13a1fe,_0x243d47,_0x66b316,_0x49afe0,_0x25c52d;return db['ZohoAccount'][_0x0f42('0x4a')]({'where':{'id':_0x26661b[_0x0f42('0x49')]['id']},'attributes':['id',_0x0f42('0x61'),_0x0f42('0x55'),_0x0f42('0x5c'),_0x0f42('0x5d'),_0x0f42('0x62'),_0x0f42('0x63'),_0x0f42('0x5b')]})[_0x0f42('0x27')](handleEntityNotFound(_0x500854,null))[_0x0f42('0x27')](function(_0x300cef){_0x25c52d=_0x300cef;_0x13a1fe=_0x25c52d['host'];_0x243d47=_0x13a1fe===_0x0f42('0x64')?'eu':_0x0f42('0x65');_0x66b316=_0x25c52d[_0x0f42('0x62')];var _0x30632c=_0x66b316[_0x0f42('0x66')](-0x1);if(_0x30632c==='/'||_0x30632c==='\x5c'||_0x30632c===':'){_0x66b316=_0x66b316[_0x0f42('0x67')](0x0,_0x66b316[_0x0f42('0x68')](_0x30632c));}if(!_0x25c52d[_0x0f42('0x5b')]){throw new Error(_0x0f42('0x69'));}return getAccessToken(_0x25c52d);})['then'](function(_0x34b072){if(_0x34b072){return rp({'method':_0x0f42('0x6a'),'uri':util['format'](_0x0f42('0x6b'),_0x243d47),'qs':{'module':_0x0f42('0x6c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x34b072},'json':!![]});}})[_0x0f42('0x27')](function(_0x2db327){if(_0x2db327){if(_0x2db327['response']&&_0x2db327[_0x0f42('0x6d')][_0x0f42('0x29')]){throw new Error(_0x2db327[_0x0f42('0x6d')][_0x0f42('0x29')][_0x0f42('0x6e')]);}var _0x66ed94=[];var _0x23d246=[];var _0x59e4dc=[_0x0f42('0x6f'),_0x0f42('0x70'),_0x0f42('0x71'),'WhoId',_0x0f42('0x72'),_0x0f42('0x73'),_0x0f42('0x74'),'Call_Type'];_0x23d246=_[_0x0f42('0x75')](_0x2db327[_0x0f42('0x37')],function(_0x402d77){return _0x59e4dc[_0x0f42('0x76')](_0x402d77[_0x0f42('0x77')]);});for(var _0xf91292=0x0;_0xf91292<_0x23d246[_0x0f42('0x38')];_0xf91292++){if(_0x23d246[_0xf91292][_0x0f42('0x78')]===![]){_0x66ed94['push']({'id':_0x23d246[_0xf91292]['id'],'name':_0x23d246[_0xf91292]['display_label'],'custom':_0x23d246[_0xf91292]['custom_field'],'options':_0x23d246[_0xf91292][_0x0f42('0x79')]==='picklist'&&_0x23d246[_0xf91292][_0x0f42('0x7a')][_0x0f42('0x38')]>-0x1?_['map'](_0x23d246[_0xf91292][_0x0f42('0x7a')],function(_0xb1832c){return{'name':_0xb1832c,'value':_0xb1832c};}):[]});}}return{'count':_0x66ed94[_0x0f42('0x38')],'rows':_0x66ed94};}else{return{'count':0x0,'rows':[]};}})[_0x0f42('0x27')](respondWithResult(_0x500854,null))[_0x0f42('0x46')](function(_0x4ad91d){var _0x42e81e=_0x26661b[_0x0f42('0x32')][_0x0f42('0x7b')]?0x1f4:_0x4ad91d['statusCode']||0x1f4;logger[_0x0f42('0x29')](_0x0f42('0x7c'),_0x0f42('0x7d'),_0x42e81e,JSON['stringify'](_0x4ad91d));delete _0x4ad91d[_0x0f42('0x2b')];if(_0x42e81e===0x191){_0x42e81e=0x190;}_0x500854[_0x0f42('0x1c')](_0x42e81e)[_0x0f42('0x2c')](_0x26661b[_0x0f42('0x32')][_0x0f42('0x7b')]?{'message':_0x0f42('0x7e'),'statusCode':_0x4ad91d[_0x0f42('0x7f')]}:_0x4ad91d);});};
\ No newline at end of file
+var _0x0143=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','ZohoAccount','rawAttributes','type','keys','query','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','fields','includeAll','find','catch','create','body','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoConfiguration','ZohoField','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','clientSecret','serverUrl','code','zoho.eu','slice','substring','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Type','remove','includes','api_name','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4b18ea,_0x2c070a){var _0x28ec1c=function(_0x251208){while(--_0x251208){_0x4b18ea['push'](_0x4b18ea['shift']());}};_0x28ec1c(++_0x2c070a);}(_0x0143,0x15e));var _0x3014=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0143[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x3014('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3014('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3014('0x2'));var moment=require(_0x3014('0x3'));var BPromise=require(_0x3014('0x4'));var Mustache=require(_0x3014('0x5'));var util=require('util');var path=require(_0x3014('0x6'));var sox=require(_0x3014('0x7'));var csv=require(_0x3014('0x8'));var ejs=require(_0x3014('0x9'));var fs=require('fs');var fs_extra=require(_0x3014('0xa'));var _=require(_0x3014('0xb'));var squel=require(_0x3014('0xc'));var crypto=require(_0x3014('0xd'));var jsforce=require(_0x3014('0xe'));var deskjs=require(_0x3014('0xf'));var toCsv=require(_0x3014('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3014('0x10'));var authService=require(_0x3014('0x11'));var qs=require(_0x3014('0x12'));var as=require(_0x3014('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3014('0x14'))(_0x3014('0x15'));var utils=require(_0x3014('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3014('0x17'));var db=require(_0x3014('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5bcad3,_0x1354ad){_0x1354ad=_0x1354ad||0xcc;return function(_0x139c6b){if(_0x139c6b){return _0x5bcad3[_0x3014('0x19')](_0x1354ad);}return _0x5bcad3[_0x3014('0x1a')](_0x1354ad)[_0x3014('0x1b')]();};}function respondWithResult(_0x29a7d9,_0xb28d5f){_0xb28d5f=_0xb28d5f||0xc8;return function(_0x4b7f42){if(_0x4b7f42){return _0x29a7d9[_0x3014('0x1a')](_0xb28d5f)[_0x3014('0x1c')](_0x4b7f42);}};}function respondWithFilteredResult(_0x2d4987,_0x18d140){return function(_0x54705d){if(_0x54705d){var _0x2ab293=typeof _0x18d140[_0x3014('0x1d')]==='undefined'&&typeof _0x18d140['limit']===_0x3014('0x1e');var _0x6b8b5a=_0x54705d[_0x3014('0x1f')];var _0x31b16a=_0x2ab293?0x0:_0x18d140['offset'];var _0x47793f=_0x2ab293?_0x54705d['count']:_0x18d140[_0x3014('0x1d')]+_0x18d140[_0x3014('0x20')];var _0x10a7fc;if(_0x47793f>=_0x6b8b5a){_0x47793f=_0x6b8b5a;_0x10a7fc=0xc8;}else{_0x10a7fc=0xce;}_0x2d4987[_0x3014('0x1a')](_0x10a7fc);return _0x2d4987[_0x3014('0x21')](_0x3014('0x22'),_0x31b16a+'-'+_0x47793f+'/'+_0x6b8b5a)[_0x3014('0x1c')](_0x54705d);}return null;};}function patchUpdates(_0x4fd933){return function(_0x292e34){try{jsonpatch[_0x3014('0x23')](_0x292e34,_0x4fd933,!![]);}catch(_0x4e1590){return BPromise['reject'](_0x4e1590);}return _0x292e34['save']();};}function saveUpdates(_0x16ac63,_0x593fcf){return function(_0x5ba037){if(_0x5ba037){return _0x5ba037[_0x3014('0x24')](_0x16ac63)[_0x3014('0x25')](function(_0x10035d){return _0x10035d;});}return null;};}function removeEntity(_0x5e4a70,_0x17fc5e){return function(_0x2789d1){if(_0x2789d1){return _0x2789d1[_0x3014('0x26')]()[_0x3014('0x25')](function(){_0x5e4a70[_0x3014('0x1a')](0xcc)[_0x3014('0x1b')]();});}};}function handleEntityNotFound(_0x194193,_0x3d3b7e){return function(_0xa173cb){if(!_0xa173cb){_0x194193['sendStatus'](0x194);}return _0xa173cb;};}function handleError(_0x114247,_0x4fcca8){_0x4fcca8=_0x4fcca8||0x1f4;return function(_0x195d81){logger[_0x3014('0x27')](_0x195d81[_0x3014('0x28')]);if(_0x195d81[_0x3014('0x29')]){delete _0x195d81['name'];}_0x114247[_0x3014('0x1a')](_0x4fcca8)[_0x3014('0x2a')](_0x195d81);};}exports[_0x3014('0x2b')]=function(_0x350b2c,_0x24b7c5){var _0xcafd3={},_0x652a5d={},_0x597732={'count':0x0,'rows':[]};var _0x3e394d=_[_0x3014('0x2c')](db[_0x3014('0x2d')][_0x3014('0x2e')],function(_0xb0eac7){return{'name':_0xb0eac7['fieldName'],'type':_0xb0eac7[_0x3014('0x2f')]['key']};});_0x652a5d['model']=_[_0x3014('0x2c')](_0x3e394d,_0x3014('0x29'));_0x652a5d['query']=_[_0x3014('0x30')](_0x350b2c[_0x3014('0x31')]);_0x652a5d[_0x3014('0x32')]=_['intersection'](_0x652a5d[_0x3014('0x33')],_0x652a5d['query']);_0xcafd3[_0x3014('0x34')]=_[_0x3014('0x35')](_0x652a5d['model'],qs['fields'](_0x350b2c[_0x3014('0x31')]['fields']));_0xcafd3[_0x3014('0x34')]=_0xcafd3[_0x3014('0x34')][_0x3014('0x36')]?_0xcafd3[_0x3014('0x34')]:_0x652a5d[_0x3014('0x33')];if(!_0x350b2c[_0x3014('0x31')][_0x3014('0x37')](_0x3014('0x38'))){_0xcafd3[_0x3014('0x20')]=qs[_0x3014('0x20')](_0x350b2c[_0x3014('0x31')][_0x3014('0x20')]);_0xcafd3['offset']=qs[_0x3014('0x1d')](_0x350b2c['query'][_0x3014('0x1d')]);}_0xcafd3[_0x3014('0x39')]=qs[_0x3014('0x3a')](_0x350b2c[_0x3014('0x31')][_0x3014('0x3a')]);_0xcafd3[_0x3014('0x3b')]=qs[_0x3014('0x32')](_[_0x3014('0x3c')](_0x350b2c[_0x3014('0x31')],_0x652a5d[_0x3014('0x32')]),_0x3e394d);if(_0x350b2c['query'][_0x3014('0x3d')]){_0xcafd3['where']=_[_0x3014('0x3e')](_0xcafd3[_0x3014('0x3b')],{'$or':_['map'](_0x3e394d,function(_0x595406){if(_0x595406['type']!==_0x3014('0x3f')){var _0x5cf608={};_0x5cf608[_0x595406[_0x3014('0x29')]]={'$like':'%'+_0x350b2c['query'][_0x3014('0x3d')]+'%'};return _0x5cf608;}})});}_0xcafd3=_[_0x3014('0x3e')]({},_0xcafd3,_0x350b2c[_0x3014('0x40')]);var _0x538f80={'where':_0xcafd3[_0x3014('0x3b')]};return db[_0x3014('0x2d')][_0x3014('0x1f')](_0x538f80)['then'](function(_0x425172){_0x597732[_0x3014('0x1f')]=_0x425172;if(_0x350b2c['query']['includeAll']){_0xcafd3[_0x3014('0x41')]=[{'all':!![]}];}return db[_0x3014('0x2d')][_0x3014('0x42')](_0xcafd3);})[_0x3014('0x25')](function(_0x2ca9da){_0x597732[_0x3014('0x43')]=_0x2ca9da;return _0x597732;})[_0x3014('0x25')](respondWithFilteredResult(_0x24b7c5,_0xcafd3))['catch'](handleError(_0x24b7c5,null));};exports[_0x3014('0x44')]=function(_0x1fc1b5,_0x472e05){var _0x473f7a={'raw':![],'where':{'id':_0x1fc1b5[_0x3014('0x45')]['id']}},_0x3032ad={};_0x3032ad[_0x3014('0x33')]=_[_0x3014('0x30')](db[_0x3014('0x2d')][_0x3014('0x2e')]);_0x3032ad[_0x3014('0x31')]=_[_0x3014('0x30')](_0x1fc1b5['query']);_0x3032ad[_0x3014('0x32')]=_[_0x3014('0x35')](_0x3032ad[_0x3014('0x33')],_0x3032ad['query']);_0x473f7a['attributes']=_[_0x3014('0x35')](_0x3032ad['model'],qs[_0x3014('0x46')](_0x1fc1b5['query']['fields']));_0x473f7a[_0x3014('0x34')]=_0x473f7a[_0x3014('0x34')][_0x3014('0x36')]?_0x473f7a['attributes']:_0x3032ad['model'];if(_0x1fc1b5[_0x3014('0x31')][_0x3014('0x47')]){_0x473f7a[_0x3014('0x41')]=[{'all':!![]}];}_0x473f7a=_['merge']({},_0x473f7a,_0x1fc1b5['options']);return db[_0x3014('0x2d')][_0x3014('0x48')](_0x473f7a)[_0x3014('0x25')](handleEntityNotFound(_0x472e05,null))[_0x3014('0x25')](respondWithResult(_0x472e05,null))[_0x3014('0x49')](handleError(_0x472e05,null));};exports[_0x3014('0x4a')]=function(_0x49f966,_0x144614){return db['ZohoAccount'][_0x3014('0x4a')](_0x49f966['body'],{})[_0x3014('0x25')](respondWithResult(_0x144614,0xc9))['catch'](handleError(_0x144614,null));};exports[_0x3014('0x24')]=function(_0x20eff8,_0x4acb7e){if(_0x20eff8[_0x3014('0x4b')]['id']){delete _0x20eff8[_0x3014('0x4b')]['id'];}return db[_0x3014('0x2d')][_0x3014('0x48')]({'where':{'id':_0x20eff8[_0x3014('0x45')]['id']}})[_0x3014('0x25')](handleEntityNotFound(_0x4acb7e,null))[_0x3014('0x25')](saveUpdates(_0x20eff8[_0x3014('0x4b')],null))[_0x3014('0x25')](respondWithResult(_0x4acb7e,null))['catch'](handleError(_0x4acb7e,null));};exports[_0x3014('0x26')]=function(_0x398ef4,_0x2e0bcd){return db['ZohoAccount'][_0x3014('0x48')]({'where':{'id':_0x398ef4[_0x3014('0x45')]['id']}})[_0x3014('0x25')](handleEntityNotFound(_0x2e0bcd,null))[_0x3014('0x25')](removeEntity(_0x2e0bcd,null))[_0x3014('0x49')](handleError(_0x2e0bcd,null));};exports[_0x3014('0x4c')]=function(_0x2eea88,_0x3b1086,_0x44e3d7){var _0x5c61aa={};var _0x11fa5a={};var _0x571263;var _0x38365e;return db[_0x3014('0x2d')][_0x3014('0x4d')]({'where':{'id':_0x2eea88[_0x3014('0x45')]['id']}})[_0x3014('0x25')](handleEntityNotFound(_0x3b1086,null))[_0x3014('0x25')](function(_0x16a71a){if(_0x16a71a){_0x571263=_0x16a71a;_0x11fa5a[_0x3014('0x33')]=_['keys'](db['ZohoConfiguration'][_0x3014('0x2e')]);_0x11fa5a['query']=_[_0x3014('0x30')](_0x2eea88[_0x3014('0x31')]);_0x11fa5a[_0x3014('0x32')]=_[_0x3014('0x35')](_0x11fa5a[_0x3014('0x33')],_0x11fa5a['query']);_0x5c61aa[_0x3014('0x34')]=_[_0x3014('0x35')](_0x11fa5a['model'],qs[_0x3014('0x46')](_0x2eea88[_0x3014('0x31')][_0x3014('0x46')]));_0x5c61aa['attributes']=_0x5c61aa[_0x3014('0x34')][_0x3014('0x36')]?_0x5c61aa[_0x3014('0x34')]:_0x11fa5a['model'];_0x5c61aa[_0x3014('0x39')]=qs['sort'](_0x2eea88[_0x3014('0x31')][_0x3014('0x3a')]);_0x5c61aa[_0x3014('0x3b')]=qs[_0x3014('0x32')](_[_0x3014('0x3c')](_0x2eea88[_0x3014('0x31')],_0x11fa5a[_0x3014('0x32')]));if(_0x2eea88[_0x3014('0x31')][_0x3014('0x3d')]){_0x5c61aa['where']=_['merge'](_0x5c61aa[_0x3014('0x3b')],{'$or':_[_0x3014('0x2c')](_0x5c61aa[_0x3014('0x34')],function(_0x5867d1){var _0x4e8cef={};_0x4e8cef[_0x5867d1]={'$like':'%'+_0x2eea88['query'][_0x3014('0x3d')]+'%'};return _0x4e8cef;})});}_0x5c61aa=_[_0x3014('0x3e')]({},_0x5c61aa,_0x2eea88[_0x3014('0x40')]);return _0x571263[_0x3014('0x4c')](_0x5c61aa);}})[_0x3014('0x25')](function(_0x1b4dbd){if(_0x1b4dbd){_0x38365e=_0x1b4dbd[_0x3014('0x36')];if(!_0x2eea88['query'][_0x3014('0x37')](_0x3014('0x38'))){_0x5c61aa['limit']=qs[_0x3014('0x20')](_0x2eea88[_0x3014('0x31')][_0x3014('0x20')]);_0x5c61aa['offset']=qs[_0x3014('0x1d')](_0x2eea88[_0x3014('0x31')]['offset']);}return _0x571263[_0x3014('0x4c')](_0x5c61aa);}})[_0x3014('0x25')](function(_0x56d5e0){if(_0x56d5e0){return _0x56d5e0?{'count':_0x38365e,'rows':_0x56d5e0}:null;}})[_0x3014('0x25')](respondWithResult(_0x3b1086,null))['catch'](handleError(_0x3b1086,null));};exports['addConfiguration']=function(_0x1cff44,_0x2d33ef,_0xad5095){if(_0x1cff44[_0x3014('0x4b')]['id']){delete _0x1cff44[_0x3014('0x4b')]['id'];}return db['ZohoAccount'][_0x3014('0x4d')]({'where':{'id':_0x1cff44[_0x3014('0x45')]['id']}})[_0x3014('0x25')](handleEntityNotFound(_0x2d33ef,null))[_0x3014('0x25')](function(_0x14f9bd){if(_0x14f9bd){_0x1cff44['body'][_0x3014('0x4e')]=_0x14f9bd['id'];_0x1cff44[_0x3014('0x4b')][_0x3014('0x4f')]=integrations[_0x3014('0x50')](_0x1cff44[_0x3014('0x4b')][_0x3014('0x51')],_0x1cff44[_0x3014('0x4b')][_0x3014('0x2f')]);_0x1cff44[_0x3014('0x4b')]['Descriptions']=integrations[_0x3014('0x52')](_0x1cff44[_0x3014('0x4b')][_0x3014('0x51')],_0x1cff44[_0x3014('0x4b')][_0x3014('0x2f')]);return db[_0x3014('0x53')][_0x3014('0x4a')](_0x1cff44[_0x3014('0x4b')],{'include':[{'model':db[_0x3014('0x54')],'as':_0x3014('0x4f')},{'model':db[_0x3014('0x54')],'as':'Descriptions'}]});}return null;})[_0x3014('0x25')](respondWithResult(_0x2d33ef,null))[_0x3014('0x49')](handleError(_0x2d33ef,null));};function getAccessToken(_0x2c9a81){return new Promise(function(_0x542c70,_0x45b376){var _0x4f0305;switch(_0x2c9a81['zone']){case'US':_0x4f0305=_0x3014('0x55');break;case'AU':_0x4f0305='https://accounts.zoho.com.au';break;case'EU':_0x4f0305='https://accounts.zoho.eu';break;case'IN':_0x4f0305=_0x3014('0x56');break;case'CN':_0x4f0305='https://accounts.zoho.com.cn';break;default:_0x4f0305=_0x3014('0x57');break;}var _0x1d0b52={'method':_0x3014('0x58'),'uri':_0x4f0305+'/oauth/v2/token','qs':{'refresh_token':_0x2c9a81[_0x3014('0x59')],'client_id':_0x2c9a81[_0x3014('0x5a')],'client_secret':_0x2c9a81['clientSecret'],'grant_type':_0x3014('0x5b')},'json':!![]};return rp(_0x1d0b52)[_0x3014('0x25')](function(_0x34f266){if(_0x34f266['access_token']){_0x542c70(_0x34f266[_0x3014('0x5c')]);}else{_0x45b376(_0x3014('0x5d'));}})[_0x3014('0x49')](function(_0x299eaa){_0x45b376(_0x299eaa);});});}exports[_0x3014('0x5e')]=function(_0x3c0a21,_0xb3cbdd,_0x412846){var _0x400cb1,_0x556a14,_0x29b00c,_0xe8fc51,_0x46c3f0;return db['ZohoAccount'][_0x3014('0x4d')]({'where':{'id':_0x3c0a21[_0x3014('0x45')]['id']},'attributes':['id',_0x3014('0x5f'),_0x3014('0x60'),'clientId',_0x3014('0x61'),_0x3014('0x62'),_0x3014('0x63'),_0x3014('0x59')]})[_0x3014('0x25')](handleEntityNotFound(_0xb3cbdd,null))[_0x3014('0x25')](function(_0x114ed2){_0x46c3f0=_0x114ed2;_0x400cb1=_0x46c3f0['host'];_0x556a14=_0x400cb1===_0x3014('0x64')?'eu':'com';_0x29b00c=_0x46c3f0[_0x3014('0x62')];var _0x5c2094=_0x29b00c[_0x3014('0x65')](-0x1);if(_0x5c2094==='/'||_0x5c2094==='\x5c'||_0x5c2094===':'){_0x29b00c=_0x29b00c[_0x3014('0x66')](0x0,_0x29b00c['lastIndexOf'](_0x5c2094));}if(!_0x46c3f0[_0x3014('0x59')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x46c3f0);})[_0x3014('0x25')](function(_0x2c990f){if(_0x2c990f){return rp({'method':_0x3014('0x67'),'uri':util[_0x3014('0x68')](_0x3014('0x69'),_0x556a14),'qs':{'module':'Calls'},'headers':{'Authorization':_0x3014('0x6a')+_0x2c990f},'json':!![]});}})['then'](function(_0x1e4607){if(_0x1e4607){if(_0x1e4607[_0x3014('0x6b')]&&_0x1e4607[_0x3014('0x6b')][_0x3014('0x27')]){throw new Error(_0x1e4607[_0x3014('0x6b')][_0x3014('0x27')][_0x3014('0x6c')]);}var _0x309b82=[];var _0x1f93e8=[];var _0x235c63=['Owner',_0x3014('0x6d'),_0x3014('0x6e'),_0x3014('0x6f'),'Call_Duration','Call_Result','Call_Start_Time',_0x3014('0x70')];_0x1f93e8=_[_0x3014('0x71')](_0x1e4607['fields'],function(_0x1fa6e7){return _0x235c63[_0x3014('0x72')](_0x1fa6e7[_0x3014('0x73')]);});for(var _0xaeef9=0x0;_0xaeef9<_0x1f93e8[_0x3014('0x36')];_0xaeef9++){if(_0x1f93e8[_0xaeef9]['system_mandatory']===![]){_0x309b82[_0x3014('0x74')]({'id':_0x1f93e8[_0xaeef9]['id'],'name':_0x1f93e8[_0xaeef9]['display_label'],'custom':_0x1f93e8[_0xaeef9][_0x3014('0x75')],'options':_0x1f93e8[_0xaeef9][_0x3014('0x76')]===_0x3014('0x77')&&_0x1f93e8[_0xaeef9][_0x3014('0x78')][_0x3014('0x36')]>-0x1?_[_0x3014('0x2c')](_0x1f93e8[_0xaeef9]['pick_list_values'],function(_0x464b74){return{'name':_0x464b74,'value':_0x464b74};}):[]});}}return{'count':_0x309b82[_0x3014('0x36')],'rows':_0x309b82};}else{return{'count':0x0,'rows':[]};}})[_0x3014('0x25')](respondWithResult(_0xb3cbdd,null))[_0x3014('0x49')](function(_0x17ac4b){var _0x234c0d=_0x3c0a21[_0x3014('0x31')][_0x3014('0x79')]?0x1f4:_0x17ac4b[_0x3014('0x7a')]||0x1f4;logger[_0x3014('0x27')](_0x3014('0x7b'),_0x3014('0x5e'),_0x234c0d,JSON[_0x3014('0x7c')](_0x17ac4b));delete _0x17ac4b[_0x3014('0x29')];if(_0x234c0d===0x191){_0x234c0d=0x190;}_0xb3cbdd[_0x3014('0x1a')](_0x234c0d)[_0x3014('0x2a')](_0x3c0a21['query'][_0x3014('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x17ac4b[_0x3014('0x7a')]}:_0x17ac4b);});};
\ No newline at end of file
index 3c123ca..8219d2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf455=['request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','serverUrl','application/x-www-form-urlencoded','parse','refresh_token','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','inspect','https://accounts.zoho.in','POST','authorization_code','then','refreshToken','catch','util','../../config/logger','api','moment'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xf455,0x176));var _0x5f45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf455[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5f45('0x0'));var logger=require(_0x5f45('0x1'))(_0x5f45('0x2'));var moment=require(_0x5f45('0x3'));var BPromise=require('bluebird');var rp=require(_0x5f45('0x4'));var fs=require('fs');var path=require(_0x5f45('0x5'));var rimraf=require('rimraf');var config=require(_0x5f45('0x6'));var attributes=require(_0x5f45('0x7'));var integrations=require(_0x5f45('0x8'));module['exports']=function(_0x5a8af8,_0x9c2cf2){return _0x5a8af8[_0x5f45('0x9')](_0x5f45('0xa'),attributes,{'tableName':_0x5f45('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x13ff9e,_0x226b91,_0x24bbc6){if(_0x13ff9e[_0x5f45('0xc')](_0x5f45('0xd'))||_0x13ff9e[_0x5f45('0xc')]('serverUrl')||_0x13ff9e[_0x5f45('0xc')](_0x5f45('0xe'))||_0x13ff9e['changed'](_0x5f45('0xf'))||_0x13ff9e[_0x5f45('0xc')](_0x5f45('0x10'))||_0x13ff9e[_0x5f45('0xc')](_0x5f45('0x11'))){var _0x42ddbf,_0x1f78d1;_0x42ddbf=_0x13ff9e['serverUrl'];var _0x141ffd=_0x42ddbf[_0x5f45('0x12')](-0x1);if(_0x141ffd==='/'||_0x141ffd==='\x5c'||_0x141ffd===':'){_0x42ddbf=_0x42ddbf[_0x5f45('0x13')](0x0,_0x42ddbf[_0x5f45('0x14')](_0x141ffd));}switch(_0x13ff9e[_0x5f45('0xd')]){case'US':_0x1f78d1=_0x5f45('0x15');break;case'AU':_0x1f78d1=_0x5f45('0x16');break;case'IN':_0x1f78d1='https://accounts.zoho.in';break;case'CN':_0x1f78d1=_0x5f45('0x17');break;default:_0x1f78d1=_0x5f45('0x18');break;}var _0x483228={'method':'POST','uri':_0x1f78d1+_0x5f45('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x13ff9e[_0x5f45('0xe')],'client_secret':_0x13ff9e[_0x5f45('0xf')],'redirect_uri':_0x13ff9e[_0x5f45('0x1a')],'code':_0x13ff9e[_0x5f45('0x10')]},'headers':{'Content-Type':_0x5f45('0x1b')}};return rp(_0x483228)['then'](function(_0x2b5ec5){var _0x4db7c4=JSON[_0x5f45('0x1c')](_0x2b5ec5);if(_0x4db7c4[_0x5f45('0x1d')]){_0x13ff9e['refreshToken']=_0x4db7c4['refresh_token'];logger['info'](util[_0x5f45('0x1e')](_0x5f45('0x1f'),_0x13ff9e[_0x5f45('0x20')],_0x13ff9e['id']));}else{logger[_0x5f45('0x21')](util[_0x5f45('0x1e')](_0x5f45('0x22'),_0x13ff9e[_0x5f45('0x20')],_0x13ff9e['id']),util[_0x5f45('0x23')](_0x4db7c4,{'showHidden':![],'depth':null}));}return _0x24bbc6(null,_0x226b91);})['catch'](function(_0x416580){logger[_0x5f45('0x21')](util['format'](_0x5f45('0x22'),_0x13ff9e['name'],_0x13ff9e['id']),util[_0x5f45('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x24bbc6(_0x416580);});}else{return _0x24bbc6(null,_0x226b91);}},'beforeUpdate':function(_0x4c70f2,_0x4c5b68,_0x4e6072){if(_0x4c70f2['changed'](_0x5f45('0xd'))||_0x4c70f2[_0x5f45('0xc')](_0x5f45('0x1a'))||_0x4c70f2[_0x5f45('0xc')](_0x5f45('0xe'))||_0x4c70f2[_0x5f45('0xc')](_0x5f45('0xf'))||_0x4c70f2[_0x5f45('0xc')](_0x5f45('0x10'))||_0x4c70f2[_0x5f45('0xc')](_0x5f45('0x11'))){var _0x5b333d,_0x285755;_0x5b333d=_0x4c70f2[_0x5f45('0x1a')];var _0x37e3d2=_0x5b333d[_0x5f45('0x12')](-0x1);if(_0x37e3d2==='/'||_0x37e3d2==='\x5c'||_0x37e3d2===':'){_0x5b333d=_0x5b333d[_0x5f45('0x13')](0x0,_0x5b333d[_0x5f45('0x14')](_0x37e3d2));}switch(_0x4c70f2[_0x5f45('0xd')]){case'US':_0x285755=_0x5f45('0x15');break;case'AU':_0x285755=_0x5f45('0x16');break;case'IN':_0x285755=_0x5f45('0x24');break;case'CN':_0x285755=_0x5f45('0x17');break;default:_0x285755=_0x5f45('0x18');break;}var _0x553bd7={'method':_0x5f45('0x25'),'uri':_0x285755+_0x5f45('0x19'),'form':{'grant_type':_0x5f45('0x26'),'client_id':_0x4c70f2[_0x5f45('0xe')],'client_secret':_0x4c70f2['clientSecret'],'redirect_uri':_0x4c70f2[_0x5f45('0x1a')],'code':_0x4c70f2['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x553bd7)[_0x5f45('0x27')](function(_0x1c2e90){var _0x46c2bd=JSON[_0x5f45('0x1c')](_0x1c2e90);if(_0x46c2bd[_0x5f45('0x1d')]){_0x4c70f2[_0x5f45('0x28')]=_0x46c2bd[_0x5f45('0x1d')];logger['info'](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4c70f2[_0x5f45('0x20')],_0x4c70f2['id']));}else{logger['error'](util[_0x5f45('0x1e')](_0x5f45('0x22'),_0x4c70f2[_0x5f45('0x20')],_0x4c70f2['id']),util['inspect'](_0x46c2bd,{'showHidden':![],'depth':null}));}return _0x4e6072(null,_0x4c5b68);})[_0x5f45('0x29')](function(_0x7f8c1f){logger[_0x5f45('0x21')](util[_0x5f45('0x1e')](_0x5f45('0x22'),_0x4c70f2[_0x5f45('0x20')],_0x4c70f2['id']),util[_0x5f45('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x4e6072(_0x7f8c1f);});}else{return _0x4e6072(null,_0x4c5b68);}}}});};
\ No newline at end of file
+var _0x5bbb=['request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','changed','serverUrl','clientId','clientSecret','code','host','slice','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','error','https://accounts.zoho.eu','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x5bbb,0x70));var _0xb5bb=function(_0x1641ee,_0x6669ad){_0x1641ee=_0x1641ee-0x0;var _0x3122ea=_0x5bbb[_0x1641ee];return _0x3122ea;};'use strict';var _=require(_0xb5bb('0x0'));var util=require(_0xb5bb('0x1'));var logger=require(_0xb5bb('0x2'))('api');var moment=require(_0xb5bb('0x3'));var BPromise=require(_0xb5bb('0x4'));var rp=require(_0xb5bb('0x5'));var fs=require('fs');var path=require(_0xb5bb('0x6'));var rimraf=require(_0xb5bb('0x7'));var config=require(_0xb5bb('0x8'));var attributes=require(_0xb5bb('0x9'));var integrations=require(_0xb5bb('0xa'));module[_0xb5bb('0xb')]=function(_0x71dae8,_0x51b813){return _0x71dae8['define'](_0xb5bb('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xe5f049,_0xfe0f85,_0x85b036){if(_0xe5f049['changed']('zone')||_0xe5f049[_0xb5bb('0xd')](_0xb5bb('0xe'))||_0xe5f049['changed'](_0xb5bb('0xf'))||_0xe5f049[_0xb5bb('0xd')](_0xb5bb('0x10'))||_0xe5f049[_0xb5bb('0xd')](_0xb5bb('0x11'))||_0xe5f049[_0xb5bb('0xd')](_0xb5bb('0x12'))){var _0x5ce3e4,_0x4d41b0;_0x5ce3e4=_0xe5f049['serverUrl'];var _0x50afeb=_0x5ce3e4[_0xb5bb('0x13')](-0x1);if(_0x50afeb==='/'||_0x50afeb==='\x5c'||_0x50afeb===':'){_0x5ce3e4=_0x5ce3e4['substring'](0x0,_0x5ce3e4[_0xb5bb('0x14')](_0x50afeb));}switch(_0xe5f049[_0xb5bb('0x15')]){case'US':_0x4d41b0=_0xb5bb('0x16');break;case'AU':_0x4d41b0=_0xb5bb('0x17');break;case'IN':_0x4d41b0='https://accounts.zoho.in';break;case'CN':_0x4d41b0=_0xb5bb('0x18');break;default:_0x4d41b0='https://accounts.zoho.eu';break;}var _0x133d3a={'method':_0xb5bb('0x19'),'uri':_0x4d41b0+_0xb5bb('0x1a'),'form':{'grant_type':_0xb5bb('0x1b'),'client_id':_0xe5f049[_0xb5bb('0xf')],'client_secret':_0xe5f049[_0xb5bb('0x10')],'redirect_uri':_0xe5f049[_0xb5bb('0xe')],'code':_0xe5f049[_0xb5bb('0x11')]},'headers':{'Content-Type':_0xb5bb('0x1c')}};return rp(_0x133d3a)['then'](function(_0x3133e0){var _0x8842d8=JSON['parse'](_0x3133e0);if(_0x8842d8['refresh_token']){_0xe5f049[_0xb5bb('0x1d')]=_0x8842d8[_0xb5bb('0x1e')];logger[_0xb5bb('0x1f')](util[_0xb5bb('0x20')](_0xb5bb('0x21'),_0xe5f049[_0xb5bb('0x22')],_0xe5f049['id']));}else{logger['error'](util[_0xb5bb('0x20')](_0xb5bb('0x23'),_0xe5f049[_0xb5bb('0x22')],_0xe5f049['id']),util[_0xb5bb('0x24')](_0x8842d8,{'showHidden':![],'depth':null}));}return _0x85b036(null,_0xfe0f85);})['catch'](function(_0x4da9d5){logger[_0xb5bb('0x25')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xe5f049[_0xb5bb('0x22')],_0xe5f049['id']),util[_0xb5bb('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x85b036(_0x4da9d5);});}else{return _0x85b036(null,_0xfe0f85);}},'beforeUpdate':function(_0x58a267,_0x1efb83,_0x1f4809){if(_0x58a267['changed']('zone')||_0x58a267[_0xb5bb('0xd')](_0xb5bb('0xe'))||_0x58a267[_0xb5bb('0xd')]('clientId')||_0x58a267[_0xb5bb('0xd')]('clientSecret')||_0x58a267[_0xb5bb('0xd')](_0xb5bb('0x11'))||_0x58a267[_0xb5bb('0xd')](_0xb5bb('0x12'))){var _0x5b6873,_0x144dcc;_0x5b6873=_0x58a267[_0xb5bb('0xe')];var _0x2a9d99=_0x5b6873[_0xb5bb('0x13')](-0x1);if(_0x2a9d99==='/'||_0x2a9d99==='\x5c'||_0x2a9d99===':'){_0x5b6873=_0x5b6873['substring'](0x0,_0x5b6873['lastIndexOf'](_0x2a9d99));}switch(_0x58a267[_0xb5bb('0x15')]){case'US':_0x144dcc=_0xb5bb('0x16');break;case'AU':_0x144dcc=_0xb5bb('0x17');break;case'IN':_0x144dcc='https://accounts.zoho.in';break;case'CN':_0x144dcc=_0xb5bb('0x18');break;default:_0x144dcc=_0xb5bb('0x26');break;}var _0x46dcaf={'method':_0xb5bb('0x19'),'uri':_0x144dcc+_0xb5bb('0x1a'),'form':{'grant_type':_0xb5bb('0x1b'),'client_id':_0x58a267[_0xb5bb('0xf')],'client_secret':_0x58a267[_0xb5bb('0x10')],'redirect_uri':_0x58a267[_0xb5bb('0xe')],'code':_0x58a267[_0xb5bb('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x46dcaf)['then'](function(_0x973962){var _0x19c255=JSON['parse'](_0x973962);if(_0x19c255['refresh_token']){_0x58a267['refreshToken']=_0x19c255[_0xb5bb('0x1e')];logger[_0xb5bb('0x1f')](util[_0xb5bb('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x58a267[_0xb5bb('0x22')],_0x58a267['id']));}else{logger[_0xb5bb('0x25')](util[_0xb5bb('0x20')](_0xb5bb('0x23'),_0x58a267[_0xb5bb('0x22')],_0x58a267['id']),util[_0xb5bb('0x24')](_0x19c255,{'showHidden':![],'depth':null}));}return _0x1f4809(null,_0x1efb83);})['catch'](function(_0x2f6d40){logger[_0xb5bb('0x25')](util[_0xb5bb('0x20')](_0xb5bb('0x23'),_0x58a267[_0xb5bb('0x22')],_0x58a267['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1f4809(_0x2f6d40);});}else{return _0x1f4809(null,_0x1efb83);}}}});};
\ No newline at end of file
index c13a34a..2fe10a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d38=['moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','GetZohoAccount','ZohoAccount','options','raw','where','attributes','include','model','debug','catch','ShowZohoAccount','find','map','util'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x6d38,0x1ef));var _0x86d3=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x6d38[_0x297fd3];return _0x2af381;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});}exports[_0x86d3('0x12')]=function(_0x46feec){var _0x120ef3=this;return new Promise(function(_0x33e459,_0x32dee7){return db[_0x86d3('0x13')]['findAll']({'raw':_0x46feec[_0x86d3('0x14')]?_0x46feec['options'][_0x86d3('0x15')]===undefined?!![]:![]:!![],'where':_0x46feec['options']?_0x46feec['options'][_0x86d3('0x16')]||null:null,'attributes':_0x46feec[_0x86d3('0x14')]?_0x46feec[_0x86d3('0x14')][_0x86d3('0x17')]||null:null,'limit':_0x46feec['options']?_0x46feec[_0x86d3('0x14')]['limit']||null:null,'include':_0x46feec[_0x86d3('0x14')]?_0x46feec[_0x86d3('0x14')][_0x86d3('0x18')]?_['map'](_0x46feec[_0x86d3('0x14')][_0x86d3('0x18')],function(_0x1fa4ac){return{'model':db[_0x1fa4ac['model']],'as':_0x1fa4ac['as'],'attributes':_0x1fa4ac['attributes'],'include':_0x1fa4ac[_0x86d3('0x18')]?_['map'](_0x1fa4ac[_0x86d3('0x18')],function(_0x1bea5e){return{'model':db[_0x1bea5e[_0x86d3('0x19')]],'as':_0x1bea5e['as'],'attributes':_0x1bea5e[_0x86d3('0x17')],'include':_0x1bea5e['include']?_['map'](_0x1bea5e[_0x86d3('0x18')],function(_0x611764){return{'model':db[_0x611764['model']],'as':_0x611764['as'],'attributes':_0x611764[_0x86d3('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42413c){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x46feec);logger[_0x86d3('0x1a')](_0x86d3('0x12'),_0x46feec,JSON[_0x86d3('0xd')](_0x42413c));_0x33e459(_0x42413c);})[_0x86d3('0x1b')](function(_0x35d708){logger[_0x86d3('0xe')](_0x86d3('0x12'),_0x35d708[_0x86d3('0xf')],_0x46feec);_0x32dee7(_0x120ef3[_0x86d3('0xe')](0x1f4,_0x35d708[_0x86d3('0xf')]));});});};exports[_0x86d3('0x1c')]=function(_0x5b09f6){var _0x120a0c=this;return new Promise(function(_0x403be3,_0x2bda35){return db[_0x86d3('0x13')][_0x86d3('0x1d')]({'raw':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6['options'][_0x86d3('0x15')]===undefined?!![]:![]:!![],'where':_0x5b09f6['options']?_0x5b09f6['options'][_0x86d3('0x16')]||null:null,'attributes':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6[_0x86d3('0x14')]['attributes']||null:null,'include':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6[_0x86d3('0x14')]['include']?_[_0x86d3('0x1e')](_0x5b09f6[_0x86d3('0x14')][_0x86d3('0x18')],function(_0x476eb3){return{'model':db[_0x476eb3[_0x86d3('0x19')]],'as':_0x476eb3['as'],'attributes':_0x476eb3[_0x86d3('0x17')],'include':_0x476eb3[_0x86d3('0x18')]?_[_0x86d3('0x1e')](_0x476eb3['include'],function(_0x4cdf45){return{'model':db[_0x4cdf45['model']],'as':_0x4cdf45['as'],'attributes':_0x4cdf45[_0x86d3('0x17')],'include':_0x4cdf45['include']?_[_0x86d3('0x1e')](_0x4cdf45['include'],function(_0x366943){return{'model':db[_0x366943[_0x86d3('0x19')]],'as':_0x366943['as'],'attributes':_0x366943[_0x86d3('0x17')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0xa')](function(_0x1e22c2){logger[_0x86d3('0x10')](_0x86d3('0x1c'),_0x5b09f6);logger['debug'](_0x86d3('0x1c'),_0x5b09f6,JSON[_0x86d3('0xd')](_0x1e22c2));_0x403be3(_0x1e22c2);})['catch'](function(_0x178fc6){logger[_0x86d3('0xe')](_0x86d3('0x1c'),_0x178fc6[_0x86d3('0xf')],_0x5b09f6);_0x2bda35(_0x120a0c['error'](0x1f4,_0x178fc6[_0x86d3('0xf')]));});});};
\ No newline at end of file
+var _0xda81=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowZohoAccount','lodash','util','moment','randomstring'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xda81,0x1c3));var _0x1da8=function(_0x45ecc3,_0x258aca){_0x45ecc3=_0x45ecc3-0x0;var _0x5bef6c=_0xda81[_0x45ecc3];return _0x5bef6c;};'use strict';var _=require(_0x1da8('0x0'));var util=require(_0x1da8('0x1'));var moment=require(_0x1da8('0x2'));var BPromise=require('bluebird');var rs=require(_0x1da8('0x3'));var fs=require('fs');var Redis=require(_0x1da8('0x4'));var db=require(_0x1da8('0x5'))['db'];var utils=require(_0x1da8('0x6'));var logger=require('../../config/logger')(_0x1da8('0x7'));var config=require(_0x1da8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1da8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x891482,_0x2c2bb4,_0xea1eb1){return new BPromise(function(_0x1a3278,_0x11dc1e){return client[_0x1da8('0xa')](_0x891482,_0xea1eb1)[_0x1da8('0xb')](function(_0x17a7fc){logger[_0x1da8('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x2c2bb4,_0x1da8('0xd'));logger[_0x1da8('0xe')](_0x1da8('0xf'),_0x2c2bb4,_0x1da8('0xd'),JSON[_0x1da8('0x10')](_0x17a7fc));if(_0x17a7fc['error']){if(_0x17a7fc[_0x1da8('0x11')]['code']===0x1f4){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x11dc1e(_0x17a7fc[_0x1da8('0x11')]['message']);}logger[_0x1da8('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x1a3278(_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);}else{logger[_0x1da8('0xc')](_0x1da8('0x12'),_0x2c2bb4,'request\x20sent');_0x1a3278(_0x17a7fc[_0x1da8('0x14')][_0x1da8('0x13')]);}})[_0x1da8('0x15')](function(_0x197b09){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x197b09);_0x11dc1e(_0x197b09);});});}exports[_0x1da8('0x16')]=function(_0x1258e3){var _0xbd6f6=this;return new Promise(function(_0x4ccb6e,_0x46ed0f){return db[_0x1da8('0x17')][_0x1da8('0x18')]({'raw':_0x1258e3[_0x1da8('0x19')]?_0x1258e3[_0x1da8('0x19')][_0x1da8('0x1a')]===undefined?!![]:![]:!![],'where':_0x1258e3['options']?_0x1258e3[_0x1da8('0x19')][_0x1da8('0x1b')]||null:null,'attributes':_0x1258e3[_0x1da8('0x19')]?_0x1258e3[_0x1da8('0x19')][_0x1da8('0x1c')]||null:null,'limit':_0x1258e3[_0x1da8('0x19')]?_0x1258e3['options'][_0x1da8('0x1d')]||null:null,'include':_0x1258e3['options']?_0x1258e3[_0x1da8('0x19')][_0x1da8('0x1e')]?_[_0x1da8('0x1f')](_0x1258e3[_0x1da8('0x19')][_0x1da8('0x1e')],function(_0x2ea607){return{'model':db[_0x2ea607[_0x1da8('0x20')]],'as':_0x2ea607['as'],'attributes':_0x2ea607['attributes'],'include':_0x2ea607['include']?_[_0x1da8('0x1f')](_0x2ea607[_0x1da8('0x1e')],function(_0x4e281e){return{'model':db[_0x4e281e[_0x1da8('0x20')]],'as':_0x4e281e['as'],'attributes':_0x4e281e[_0x1da8('0x1c')],'include':_0x4e281e[_0x1da8('0x1e')]?_[_0x1da8('0x1f')](_0x4e281e[_0x1da8('0x1e')],function(_0x46af20){return{'model':db[_0x46af20['model']],'as':_0x46af20['as'],'attributes':_0x46af20[_0x1da8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1da8('0xb')](function(_0x2d81cd){logger[_0x1da8('0xc')](_0x1da8('0x16'),_0x1258e3);logger[_0x1da8('0xe')](_0x1da8('0x16'),_0x1258e3,JSON[_0x1da8('0x10')](_0x2d81cd));_0x4ccb6e(_0x2d81cd);})[_0x1da8('0x15')](function(_0x21f3fe){logger['error'](_0x1da8('0x16'),_0x21f3fe['message'],_0x1258e3);_0x46ed0f(_0xbd6f6['error'](0x1f4,_0x21f3fe['message']));});});};exports['ShowZohoAccount']=function(_0x3e7c00){var _0x82c59d=this;return new Promise(function(_0x5293ed,_0x198b31){return db['ZohoAccount'][_0x1da8('0x21')]({'raw':_0x3e7c00[_0x1da8('0x19')]?_0x3e7c00[_0x1da8('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3e7c00[_0x1da8('0x19')]?_0x3e7c00[_0x1da8('0x19')][_0x1da8('0x1b')]||null:null,'attributes':_0x3e7c00[_0x1da8('0x19')]?_0x3e7c00['options'][_0x1da8('0x1c')]||null:null,'include':_0x3e7c00[_0x1da8('0x19')]?_0x3e7c00[_0x1da8('0x19')][_0x1da8('0x1e')]?_[_0x1da8('0x1f')](_0x3e7c00[_0x1da8('0x19')]['include'],function(_0x3903c4){return{'model':db[_0x3903c4[_0x1da8('0x20')]],'as':_0x3903c4['as'],'attributes':_0x3903c4[_0x1da8('0x1c')],'include':_0x3903c4['include']?_[_0x1da8('0x1f')](_0x3903c4[_0x1da8('0x1e')],function(_0x31995e){return{'model':db[_0x31995e[_0x1da8('0x20')]],'as':_0x31995e['as'],'attributes':_0x31995e[_0x1da8('0x1c')],'include':_0x31995e['include']?_[_0x1da8('0x1f')](_0x31995e[_0x1da8('0x1e')],function(_0x1a99bc){return{'model':db[_0x1a99bc['model']],'as':_0x1a99bc['as'],'attributes':_0x1a99bc['attributes']};}):[]};}):[]};}):[]:[]})[_0x1da8('0xb')](function(_0x5ad077){logger['info']('ShowZohoAccount',_0x3e7c00);logger[_0x1da8('0xe')](_0x1da8('0x22'),_0x3e7c00,JSON[_0x1da8('0x10')](_0x5ad077));_0x5293ed(_0x5ad077);})['catch'](function(_0x166934){logger['error'](_0x1da8('0x22'),_0x166934[_0x1da8('0x13')],_0x3e7c00);_0x198b31(_0x82c59d[_0x1da8('0x11')](0x1f4,_0x166934[_0x1da8('0x13')]));});});};
\ No newline at end of file
index 118390f..2f9a709 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa058=['multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','post','create','/:id','update','destroy'];(function(_0x46d926,_0x1469b0){var _0x3e1759=function(_0x2134d6){while(--_0x2134d6){_0x46d926['push'](_0x46d926['shift']());}};_0x3e1759(++_0x1469b0);}(_0xa058,0x111));var _0x8a05=function(_0x56fb33,_0x37be08){_0x56fb33=_0x56fb33-0x0;var _0x435ee4=_0xa058[_0x56fb33];return _0x435ee4;};'use strict';var multer=require(_0x8a05('0x0'));var util=require(_0x8a05('0x1'));var path=require(_0x8a05('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8a05('0x3')]();var fs_extra=require(_0x8a05('0x4'));var auth=require(_0x8a05('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8a05('0x6'));var controller=require(_0x8a05('0x7'));router[_0x8a05('0x8')]('/',auth[_0x8a05('0x9')](),controller[_0x8a05('0xa')]);router[_0x8a05('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8a05('0xb')]);router[_0x8a05('0x8')](_0x8a05('0xc'),auth[_0x8a05('0x9')](),controller[_0x8a05('0xd')]);router[_0x8a05('0x8')](_0x8a05('0xe'),auth[_0x8a05('0x9')](),controller[_0x8a05('0xf')]);router[_0x8a05('0x8')]('/:id/descriptions',auth[_0x8a05('0x9')](),controller['getDescriptions']);router[_0x8a05('0x10')]('/',auth['isAuthenticated'](),controller[_0x8a05('0x11')]);router['put'](_0x8a05('0x12'),auth[_0x8a05('0x9')](),controller[_0x8a05('0x13')]);router['delete']('/:id',auth[_0x8a05('0x9')](),controller[_0x8a05('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x5712=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0xf7feda,_0x2a5e88){var _0x5a5bb5=function(_0x6303f4){while(--_0x6303f4){_0xf7feda['push'](_0xf7feda['shift']());}};_0x5a5bb5(++_0x2a5e88);}(_0x5712,0x6a));var _0x2571=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5712[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x2571('0x0'));var util=require(_0x2571('0x1'));var path=require(_0x2571('0x2'));var timeout=require('connect-timeout');var express=require(_0x2571('0x3'));var router=express['Router']();var fs_extra=require(_0x2571('0x4'));var auth=require(_0x2571('0x5'));var interaction=require(_0x2571('0x6'));var config=require('../../config/environment');var controller=require(_0x2571('0x7'));router[_0x2571('0x8')]('/',auth[_0x2571('0x9')](),controller[_0x2571('0xa')]);router['get'](_0x2571('0xb'),auth[_0x2571('0x9')](),controller[_0x2571('0xc')]);router[_0x2571('0x8')]('/:id/fields',auth[_0x2571('0x9')](),controller[_0x2571('0xd')]);router[_0x2571('0x8')](_0x2571('0xe'),auth[_0x2571('0x9')](),controller[_0x2571('0xf')]);router[_0x2571('0x8')](_0x2571('0x10'),auth[_0x2571('0x9')](),controller[_0x2571('0x11')]);router[_0x2571('0x12')]('/',auth['isAuthenticated'](),controller[_0x2571('0x13')]);router[_0x2571('0x14')](_0x2571('0xb'),auth[_0x2571('0x9')](),controller['update']);router[_0x2571('0x15')](_0x2571('0xb'),auth[_0x2571('0x9')](),controller[_0x2571('0x16')]);module[_0x2571('0x17')]=router;
\ No newline at end of file
index 0cd501d..e1d68d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5699=['ENUM','contact_lead','sequelize','exports','lead','nothing'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x5699,0x68));var _0x9569=function(_0x1a5913,_0x7bbba){_0x1a5913=_0x1a5913-0x0;var _0x58f432=_0x5699[_0x1a5913];return _0x58f432;};'use strict';var Sequelize=require(_0x9569('0x0'));module[_0x9569('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0x9569('0x2'),'contact',_0x9569('0x3')),'defaultValue':_0x9569('0x2')},'moduleSearch':{'type':Sequelize[_0x9569('0x4')](_0x9569('0x5'),'contact','lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf7eb=['contact','nothing','contact_lead','exports','STRING','ENUM','lead'];(function(_0x1bdbde,_0xfde844){var _0x14c712=function(_0x2f1270){while(--_0x2f1270){_0x1bdbde['push'](_0x1bdbde['shift']());}};_0x14c712(++_0xfde844);}(_0xf7eb,0xe3));var _0xbf7e=function(_0x2acb43,_0x2b0bc6){_0x2acb43=_0x2acb43-0x0;var _0x939123=_0xf7eb[_0x2acb43];return _0x939123;};'use strict';var Sequelize=require('sequelize');module[_0xbf7e('0x0')]={'name':{'type':Sequelize[_0xbf7e('0x1')]},'moduleCreate':{'type':Sequelize[_0xbf7e('0x2')](_0xbf7e('0x3'),_0xbf7e('0x4'),_0xbf7e('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xbf7e('0x2')]('contact_lead',_0xbf7e('0x4'),_0xbf7e('0x3')),'defaultValue':_0xbf7e('0x6')},'description':{'type':Sequelize[_0xbf7e('0x1')]}};
\ No newline at end of file
index 8baed33..195ffc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a32=['key','model','map','query','keys','filters','attributes','intersection','fields','order','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','getFields','findOne','ZohoField','length','sort','nolimit','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','error','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','type'];(function(_0x573f1d,_0x1b033e){var _0x2f55ba=function(_0x2b0346){while(--_0x2b0346){_0x573f1d['push'](_0x573f1d['shift']());}};_0x2f55ba(++_0x1b033e);}(_0x5a32,0x11d));var _0x25a3=function(_0x1a4b83,_0x132caa){_0x1a4b83=_0x1a4b83-0x0;var _0x138c43=_0x5a32[_0x1a4b83];return _0x138c43;};'use strict';var emlformat=require(_0x25a3('0x0'));var rimraf=require(_0x25a3('0x1'));var zipdir=require(_0x25a3('0x2'));var jsonpatch=require(_0x25a3('0x3'));var rp=require(_0x25a3('0x4'));var moment=require(_0x25a3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x25a3('0x6'));var util=require(_0x25a3('0x7'));var path=require(_0x25a3('0x8'));var sox=require('sox');var csv=require(_0x25a3('0x9'));var ejs=require(_0x25a3('0xa'));var fs=require('fs');var fs_extra=require(_0x25a3('0xb'));var _=require(_0x25a3('0xc'));var squel=require(_0x25a3('0xd'));var crypto=require('crypto');var jsforce=require(_0x25a3('0xe'));var deskjs=require(_0x25a3('0xf'));var toCsv=require(_0x25a3('0x9'));var querystring=require(_0x25a3('0x10'));var Papa=require(_0x25a3('0x11'));var Redis=require(_0x25a3('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x25a3('0x13'));var hardwareService=require(_0x25a3('0x14'));var logger=require(_0x25a3('0x15'))(_0x25a3('0x16'));var utils=require('../../config/utils');var config=require(_0x25a3('0x17'));var licenseUtil=require(_0x25a3('0x18'));var db=require(_0x25a3('0x19'))['db'];function respondWithStatusCode(_0x2d53b8,_0x3de528){_0x3de528=_0x3de528||0xcc;return function(_0x4a1863){if(_0x4a1863){return _0x2d53b8[_0x25a3('0x1a')](_0x3de528);}return _0x2d53b8[_0x25a3('0x1b')](_0x3de528)[_0x25a3('0x1c')]();};}function respondWithResult(_0x1172c4,_0x115512){_0x115512=_0x115512||0xc8;return function(_0x1c2f05){if(_0x1c2f05){return _0x1172c4[_0x25a3('0x1b')](_0x115512)[_0x25a3('0x1d')](_0x1c2f05);}};}function respondWithFilteredResult(_0x58c3d4,_0x1aaf5e){return function(_0x1fd994){if(_0x1fd994){var _0x3c43b2=typeof _0x1aaf5e[_0x25a3('0x1e')]===_0x25a3('0x1f')&&typeof _0x1aaf5e[_0x25a3('0x20')]===_0x25a3('0x1f');var _0x5caaf7=_0x1fd994['count'];var _0x2138f7=_0x3c43b2?0x0:_0x1aaf5e[_0x25a3('0x1e')];var _0x2414e6=_0x3c43b2?_0x1fd994[_0x25a3('0x21')]:_0x1aaf5e[_0x25a3('0x1e')]+_0x1aaf5e[_0x25a3('0x20')];var _0xeade1d;if(_0x2414e6>=_0x5caaf7){_0x2414e6=_0x5caaf7;_0xeade1d=0xc8;}else{_0xeade1d=0xce;}_0x58c3d4['status'](_0xeade1d);return _0x58c3d4['set']('Content-Range',_0x2138f7+'-'+_0x2414e6+'/'+_0x5caaf7)[_0x25a3('0x1d')](_0x1fd994);}return null;};}function patchUpdates(_0x4ec5c1){return function(_0xd8c33a){try{jsonpatch['apply'](_0xd8c33a,_0x4ec5c1,!![]);}catch(_0xcf44c0){return BPromise[_0x25a3('0x22')](_0xcf44c0);}return _0xd8c33a[_0x25a3('0x23')]();};}function saveUpdates(_0xad4472,_0x4ae9ee){return function(_0x4413b6){if(_0x4413b6){return _0x4413b6[_0x25a3('0x24')](_0xad4472)[_0x25a3('0x25')](function(_0x355ccd){return _0x355ccd;});}return null;};}function removeEntity(_0x4f1c2e,_0x328037){return function(_0xd8ac33){if(_0xd8ac33){return _0xd8ac33['destroy']()[_0x25a3('0x25')](function(){_0x4f1c2e[_0x25a3('0x1b')](0xcc)[_0x25a3('0x1c')]();});}};}function handleEntityNotFound(_0x4eb647,_0x1e047b){return function(_0x404a99){if(!_0x404a99){_0x4eb647['sendStatus'](0x194);}return _0x404a99;};}function handleError(_0x513620,_0x34acbb){_0x34acbb=_0x34acbb||0x1f4;return function(_0x4ae6bf){logger[_0x25a3('0x26')](_0x4ae6bf[_0x25a3('0x27')]);if(_0x4ae6bf[_0x25a3('0x28')]){delete _0x4ae6bf['name'];}_0x513620['status'](_0x34acbb)[_0x25a3('0x29')](_0x4ae6bf);};}exports[_0x25a3('0x2a')]=function(_0x551e75,_0x24398b){var _0x577e11={},_0x3fd4a8={},_0x1bdce5={'count':0x0,'rows':[]};var _0x18d32a=_['map'](db[_0x25a3('0x2b')][_0x25a3('0x2c')],function(_0x307800){return{'name':_0x307800[_0x25a3('0x2d')],'type':_0x307800[_0x25a3('0x2e')][_0x25a3('0x2f')]};});_0x3fd4a8[_0x25a3('0x30')]=_[_0x25a3('0x31')](_0x18d32a,_0x25a3('0x28'));_0x3fd4a8[_0x25a3('0x32')]=_[_0x25a3('0x33')](_0x551e75[_0x25a3('0x32')]);_0x3fd4a8[_0x25a3('0x34')]=_['intersection'](_0x3fd4a8['model'],_0x3fd4a8[_0x25a3('0x32')]);_0x577e11[_0x25a3('0x35')]=_[_0x25a3('0x36')](_0x3fd4a8[_0x25a3('0x30')],qs['fields'](_0x551e75[_0x25a3('0x32')][_0x25a3('0x37')]));_0x577e11['attributes']=_0x577e11[_0x25a3('0x35')]['length']?_0x577e11[_0x25a3('0x35')]:_0x3fd4a8['model'];if(!_0x551e75[_0x25a3('0x32')]['hasOwnProperty']('nolimit')){_0x577e11['limit']=qs['limit'](_0x551e75[_0x25a3('0x32')]['limit']);_0x577e11[_0x25a3('0x1e')]=qs[_0x25a3('0x1e')](_0x551e75[_0x25a3('0x32')][_0x25a3('0x1e')]);}_0x577e11[_0x25a3('0x38')]=qs['sort'](_0x551e75[_0x25a3('0x32')]['sort']);_0x577e11['where']=qs[_0x25a3('0x34')](_[_0x25a3('0x39')](_0x551e75[_0x25a3('0x32')],_0x3fd4a8[_0x25a3('0x34')]),_0x18d32a);if(_0x551e75[_0x25a3('0x32')]['filter']){_0x577e11['where']=_['merge'](_0x577e11[_0x25a3('0x3a')],{'$or':_[_0x25a3('0x31')](_0x18d32a,function(_0x30aba1){if(_0x30aba1[_0x25a3('0x2e')]!==_0x25a3('0x3b')){var _0x1cfe21={};_0x1cfe21[_0x30aba1[_0x25a3('0x28')]]={'$like':'%'+_0x551e75[_0x25a3('0x32')][_0x25a3('0x3c')]+'%'};return _0x1cfe21;}})});}_0x577e11=_[_0x25a3('0x3d')]({},_0x577e11,_0x551e75[_0x25a3('0x3e')]);var _0x4bdf4c={'where':_0x577e11[_0x25a3('0x3a')]};return db[_0x25a3('0x2b')][_0x25a3('0x21')](_0x4bdf4c)[_0x25a3('0x25')](function(_0x8e1956){_0x1bdce5[_0x25a3('0x21')]=_0x8e1956;if(_0x551e75[_0x25a3('0x32')][_0x25a3('0x3f')]){_0x577e11[_0x25a3('0x40')]=[{'all':!![]}];}return db[_0x25a3('0x2b')][_0x25a3('0x41')](_0x577e11);})[_0x25a3('0x25')](function(_0xf42eea){_0x1bdce5[_0x25a3('0x42')]=_0xf42eea;return _0x1bdce5;})[_0x25a3('0x25')](respondWithFilteredResult(_0x24398b,_0x577e11))[_0x25a3('0x43')](handleError(_0x24398b,null));};exports[_0x25a3('0x44')]=function(_0x260e24,_0x4fe884){var _0x1294ab={'raw':![],'where':{'id':_0x260e24[_0x25a3('0x45')]['id']}},_0x11967a={};_0x11967a['model']=_[_0x25a3('0x33')](db['ZohoConfiguration'][_0x25a3('0x2c')]);_0x11967a[_0x25a3('0x32')]=_[_0x25a3('0x33')](_0x260e24['query']);_0x11967a['filters']=_[_0x25a3('0x36')](_0x11967a['model'],_0x11967a[_0x25a3('0x32')]);_0x1294ab[_0x25a3('0x35')]=_['intersection'](_0x11967a[_0x25a3('0x30')],qs[_0x25a3('0x37')](_0x260e24[_0x25a3('0x32')][_0x25a3('0x37')]));_0x1294ab[_0x25a3('0x35')]=_0x1294ab[_0x25a3('0x35')]['length']?_0x1294ab[_0x25a3('0x35')]:_0x11967a[_0x25a3('0x30')];if(_0x260e24[_0x25a3('0x32')][_0x25a3('0x3f')]){_0x1294ab[_0x25a3('0x40')]=[{'all':!![]}];}_0x1294ab=_[_0x25a3('0x3d')]({},_0x1294ab,_0x260e24[_0x25a3('0x3e')]);return db['ZohoConfiguration']['find'](_0x1294ab)['then'](handleEntityNotFound(_0x4fe884,null))['then'](respondWithResult(_0x4fe884,null))[_0x25a3('0x43')](handleError(_0x4fe884,null));};exports[_0x25a3('0x46')]=function(_0x614ed7,_0x1c64dd){return db[_0x25a3('0x2b')][_0x25a3('0x46')](_0x614ed7[_0x25a3('0x47')],{})[_0x25a3('0x25')](respondWithResult(_0x1c64dd,0xc9))['catch'](handleError(_0x1c64dd,null));};exports[_0x25a3('0x24')]=function(_0x11b16c,_0x3958b4){if(_0x11b16c[_0x25a3('0x47')]['id']){delete _0x11b16c[_0x25a3('0x47')]['id'];}return db[_0x25a3('0x2b')][_0x25a3('0x48')]({'where':{'id':_0x11b16c[_0x25a3('0x45')]['id']}})[_0x25a3('0x25')](handleEntityNotFound(_0x3958b4,null))[_0x25a3('0x25')](saveUpdates(_0x11b16c[_0x25a3('0x47')],null))[_0x25a3('0x25')](respondWithResult(_0x3958b4,null))[_0x25a3('0x43')](handleError(_0x3958b4,null));};exports[_0x25a3('0x49')]=function(_0x55f629,_0x235026){return db[_0x25a3('0x2b')][_0x25a3('0x48')]({'where':{'id':_0x55f629[_0x25a3('0x45')]['id']}})[_0x25a3('0x25')](handleEntityNotFound(_0x235026,null))[_0x25a3('0x25')](removeEntity(_0x235026,null))[_0x25a3('0x43')](handleError(_0x235026,null));};exports[_0x25a3('0x4a')]=function(_0x4b9ef0,_0x51a3eb,_0x38d18d){var _0x1b1e87={};var _0x5a8392={};var _0x45b119;var _0x3dafbd;return db[_0x25a3('0x2b')][_0x25a3('0x4b')]({'where':{'id':_0x4b9ef0[_0x25a3('0x45')]['id']}})[_0x25a3('0x25')](handleEntityNotFound(_0x51a3eb,null))[_0x25a3('0x25')](function(_0x2fec7e){if(_0x2fec7e){_0x45b119=_0x2fec7e;_0x5a8392[_0x25a3('0x30')]=_[_0x25a3('0x33')](db[_0x25a3('0x4c')][_0x25a3('0x2c')]);_0x5a8392[_0x25a3('0x32')]=_[_0x25a3('0x33')](_0x4b9ef0[_0x25a3('0x32')]);_0x5a8392[_0x25a3('0x34')]=_['intersection'](_0x5a8392['model'],_0x5a8392['query']);_0x1b1e87[_0x25a3('0x35')]=_[_0x25a3('0x36')](_0x5a8392[_0x25a3('0x30')],qs[_0x25a3('0x37')](_0x4b9ef0[_0x25a3('0x32')]['fields']));_0x1b1e87[_0x25a3('0x35')]=_0x1b1e87[_0x25a3('0x35')][_0x25a3('0x4d')]?_0x1b1e87[_0x25a3('0x35')]:_0x5a8392[_0x25a3('0x30')];_0x1b1e87[_0x25a3('0x38')]=qs[_0x25a3('0x4e')](_0x4b9ef0[_0x25a3('0x32')]['sort']);_0x1b1e87[_0x25a3('0x3a')]=qs['filters'](_[_0x25a3('0x39')](_0x4b9ef0[_0x25a3('0x32')],_0x5a8392[_0x25a3('0x34')]));if(_0x4b9ef0[_0x25a3('0x32')][_0x25a3('0x3c')]){_0x1b1e87[_0x25a3('0x3a')]=_['merge'](_0x1b1e87[_0x25a3('0x3a')],{'$or':_[_0x25a3('0x31')](_0x1b1e87[_0x25a3('0x35')],function(_0x3d24a6){var _0x242f96={};_0x242f96[_0x3d24a6]={'$like':'%'+_0x4b9ef0[_0x25a3('0x32')]['filter']+'%'};return _0x242f96;})});}_0x1b1e87=_[_0x25a3('0x3d')]({},_0x1b1e87,_0x4b9ef0['options']);return _0x45b119[_0x25a3('0x4a')](_0x1b1e87);}})[_0x25a3('0x25')](function(_0x38491e){if(_0x38491e){_0x3dafbd=_0x38491e[_0x25a3('0x4d')];if(!_0x4b9ef0['query']['hasOwnProperty'](_0x25a3('0x4f'))){_0x1b1e87[_0x25a3('0x20')]=qs['limit'](_0x4b9ef0[_0x25a3('0x32')][_0x25a3('0x20')]);_0x1b1e87[_0x25a3('0x1e')]=qs[_0x25a3('0x1e')](_0x4b9ef0[_0x25a3('0x32')]['offset']);}return _0x45b119[_0x25a3('0x4a')](_0x1b1e87);}})['then'](function(_0x403610){if(_0x403610){return _0x403610?{'count':_0x3dafbd,'rows':_0x403610}:null;}})[_0x25a3('0x25')](respondWithResult(_0x51a3eb,null))[_0x25a3('0x43')](handleError(_0x51a3eb,null));};exports[_0x25a3('0x50')]=function(_0x31a7bb,_0x19040c,_0x15ebee){var _0x37e48b={};var _0x29815b={};var _0x5b2df8;var _0x281e9a;return db['ZohoConfiguration'][_0x25a3('0x4b')]({'where':{'id':_0x31a7bb[_0x25a3('0x45')]['id']}})['then'](handleEntityNotFound(_0x19040c,null))[_0x25a3('0x25')](function(_0x2c1cf5){if(_0x2c1cf5){_0x5b2df8=_0x2c1cf5;_0x29815b[_0x25a3('0x30')]=_['keys'](db['ZohoField'][_0x25a3('0x2c')]);_0x29815b['query']=_[_0x25a3('0x33')](_0x31a7bb['query']);_0x29815b[_0x25a3('0x34')]=_[_0x25a3('0x36')](_0x29815b['model'],_0x29815b[_0x25a3('0x32')]);_0x37e48b[_0x25a3('0x35')]=_['intersection'](_0x29815b[_0x25a3('0x30')],qs['fields'](_0x31a7bb[_0x25a3('0x32')]['fields']));_0x37e48b[_0x25a3('0x35')]=_0x37e48b['attributes'][_0x25a3('0x4d')]?_0x37e48b[_0x25a3('0x35')]:_0x29815b['model'];_0x37e48b['order']=qs[_0x25a3('0x4e')](_0x31a7bb[_0x25a3('0x32')][_0x25a3('0x4e')]);_0x37e48b[_0x25a3('0x3a')]=qs[_0x25a3('0x34')](_['pick'](_0x31a7bb['query'],_0x29815b[_0x25a3('0x34')]));if(_0x31a7bb['query'][_0x25a3('0x3c')]){_0x37e48b[_0x25a3('0x3a')]=_[_0x25a3('0x3d')](_0x37e48b[_0x25a3('0x3a')],{'$or':_[_0x25a3('0x31')](_0x37e48b[_0x25a3('0x35')],function(_0x2295ad){var _0x16a2c9={};_0x16a2c9[_0x2295ad]={'$like':'%'+_0x31a7bb[_0x25a3('0x32')]['filter']+'%'};return _0x16a2c9;})});}_0x37e48b=_[_0x25a3('0x3d')]({},_0x37e48b,_0x31a7bb['options']);return _0x5b2df8['getSubjects'](_0x37e48b);}})[_0x25a3('0x25')](function(_0x38b643){if(_0x38b643){_0x281e9a=_0x38b643[_0x25a3('0x4d')];if(!_0x31a7bb[_0x25a3('0x32')][_0x25a3('0x51')](_0x25a3('0x4f'))){_0x37e48b['limit']=qs[_0x25a3('0x20')](_0x31a7bb['query'][_0x25a3('0x20')]);_0x37e48b[_0x25a3('0x1e')]=qs[_0x25a3('0x1e')](_0x31a7bb[_0x25a3('0x32')][_0x25a3('0x1e')]);}return _0x5b2df8[_0x25a3('0x50')](_0x37e48b);}})[_0x25a3('0x25')](function(_0x4130e5){if(_0x4130e5){return _0x4130e5?{'count':_0x281e9a,'rows':_0x4130e5}:null;}})[_0x25a3('0x25')](respondWithResult(_0x19040c,null))['catch'](handleError(_0x19040c,null));};exports[_0x25a3('0x52')]=function(_0x4381e,_0x97ee84,_0x49f251){var _0x81bfff={};var _0x5cec61={};var _0x2b058a;var _0xa6599c;return db[_0x25a3('0x2b')][_0x25a3('0x4b')]({'where':{'id':_0x4381e[_0x25a3('0x45')]['id']}})[_0x25a3('0x25')](handleEntityNotFound(_0x97ee84,null))[_0x25a3('0x25')](function(_0x24de0d){if(_0x24de0d){_0x2b058a=_0x24de0d;_0x5cec61[_0x25a3('0x30')]=_[_0x25a3('0x33')](db['ZohoField'][_0x25a3('0x2c')]);_0x5cec61['query']=_[_0x25a3('0x33')](_0x4381e[_0x25a3('0x32')]);_0x5cec61['filters']=_[_0x25a3('0x36')](_0x5cec61[_0x25a3('0x30')],_0x5cec61[_0x25a3('0x32')]);_0x81bfff[_0x25a3('0x35')]=_[_0x25a3('0x36')](_0x5cec61['model'],qs[_0x25a3('0x37')](_0x4381e[_0x25a3('0x32')][_0x25a3('0x37')]));_0x81bfff['attributes']=_0x81bfff[_0x25a3('0x35')][_0x25a3('0x4d')]?_0x81bfff[_0x25a3('0x35')]:_0x5cec61[_0x25a3('0x30')];_0x81bfff[_0x25a3('0x38')]=qs[_0x25a3('0x4e')](_0x4381e[_0x25a3('0x32')]['sort']);_0x81bfff[_0x25a3('0x3a')]=qs[_0x25a3('0x34')](_[_0x25a3('0x39')](_0x4381e['query'],_0x5cec61[_0x25a3('0x34')]));if(_0x4381e[_0x25a3('0x32')][_0x25a3('0x3c')]){_0x81bfff[_0x25a3('0x3a')]=_[_0x25a3('0x3d')](_0x81bfff[_0x25a3('0x3a')],{'$or':_[_0x25a3('0x31')](_0x81bfff[_0x25a3('0x35')],function(_0x45553b){var _0x36a809={};_0x36a809[_0x45553b]={'$like':'%'+_0x4381e[_0x25a3('0x32')]['filter']+'%'};return _0x36a809;})});}_0x81bfff=_[_0x25a3('0x3d')]({},_0x81bfff,_0x4381e[_0x25a3('0x3e')]);return _0x2b058a['getDescriptions'](_0x81bfff);}})[_0x25a3('0x25')](function(_0x31c800){if(_0x31c800){_0xa6599c=_0x31c800[_0x25a3('0x4d')];if(!_0x4381e[_0x25a3('0x32')][_0x25a3('0x51')]('nolimit')){_0x81bfff[_0x25a3('0x20')]=qs['limit'](_0x4381e[_0x25a3('0x32')][_0x25a3('0x20')]);_0x81bfff['offset']=qs[_0x25a3('0x1e')](_0x4381e[_0x25a3('0x32')][_0x25a3('0x1e')]);}return _0x2b058a[_0x25a3('0x52')](_0x81bfff);}})[_0x25a3('0x25')](function(_0x120284){if(_0x120284){return _0x120284?{'count':_0xa6599c,'rows':_0x120284}:null;}})[_0x25a3('0x25')](respondWithResult(_0x97ee84,null))['catch'](handleError(_0x97ee84,null));};
\ No newline at end of file
+var _0x5598=['end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','ZohoConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','options','count','include','catch','show','params','rawAttributes','find','create','body','findOne','sort','getFields','nolimit','getSubjects','getDescriptions','ZohoField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5598,0xcd));var _0x8559=function(_0x58e389,_0x3ab426){_0x58e389=_0x58e389-0x0;var _0x1437df=_0x5598[_0x58e389];return _0x1437df;};'use strict';var emlformat=require(_0x8559('0x0'));var rimraf=require(_0x8559('0x1'));var zipdir=require(_0x8559('0x2'));var jsonpatch=require(_0x8559('0x3'));var rp=require(_0x8559('0x4'));var moment=require(_0x8559('0x5'));var BPromise=require(_0x8559('0x6'));var Mustache=require(_0x8559('0x7'));var util=require('util');var path=require('path');var sox=require(_0x8559('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8559('0x9'));var _=require('lodash');var squel=require(_0x8559('0xa'));var crypto=require(_0x8559('0xb'));var jsforce=require(_0x8559('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8559('0xd'));var querystring=require(_0x8559('0xe'));var Papa=require(_0x8559('0xf'));var Redis=require(_0x8559('0x10'));var authService=require(_0x8559('0x11'));var qs=require(_0x8559('0x12'));var as=require(_0x8559('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8559('0x14'))(_0x8559('0x15'));var utils=require(_0x8559('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8559('0x17'));var db=require(_0x8559('0x18'))['db'];function respondWithStatusCode(_0x2de438,_0x5b9f80){_0x5b9f80=_0x5b9f80||0xcc;return function(_0x13b8f4){if(_0x13b8f4){return _0x2de438['sendStatus'](_0x5b9f80);}return _0x2de438[_0x8559('0x19')](_0x5b9f80)[_0x8559('0x1a')]();};}function respondWithResult(_0x54e409,_0x2d2d55){_0x2d2d55=_0x2d2d55||0xc8;return function(_0xf45d2f){if(_0xf45d2f){return _0x54e409[_0x8559('0x19')](_0x2d2d55)[_0x8559('0x1b')](_0xf45d2f);}};}function respondWithFilteredResult(_0x19f801,_0x3569be){return function(_0x337488){if(_0x337488){var _0x56adcb=typeof _0x3569be[_0x8559('0x1c')]===_0x8559('0x1d')&&typeof _0x3569be[_0x8559('0x1e')]===_0x8559('0x1d');var _0x172d64=_0x337488['count'];var _0x253d2f=_0x56adcb?0x0:_0x3569be[_0x8559('0x1c')];var _0x53dae8=_0x56adcb?_0x337488['count']:_0x3569be[_0x8559('0x1c')]+_0x3569be[_0x8559('0x1e')];var _0x242966;if(_0x53dae8>=_0x172d64){_0x53dae8=_0x172d64;_0x242966=0xc8;}else{_0x242966=0xce;}_0x19f801['status'](_0x242966);return _0x19f801[_0x8559('0x1f')]('Content-Range',_0x253d2f+'-'+_0x53dae8+'/'+_0x172d64)[_0x8559('0x1b')](_0x337488);}return null;};}function patchUpdates(_0x91c1a6){return function(_0x120900){try{jsonpatch[_0x8559('0x20')](_0x120900,_0x91c1a6,!![]);}catch(_0x5f5377){return BPromise[_0x8559('0x21')](_0x5f5377);}return _0x120900[_0x8559('0x22')]();};}function saveUpdates(_0x379591,_0x5baeb1){return function(_0x20fa0c){if(_0x20fa0c){return _0x20fa0c[_0x8559('0x23')](_0x379591)[_0x8559('0x24')](function(_0x384bb2){return _0x384bb2;});}return null;};}function removeEntity(_0xce7ee3,_0xe6dfcf){return function(_0x4f75e8){if(_0x4f75e8){return _0x4f75e8[_0x8559('0x25')]()[_0x8559('0x24')](function(){_0xce7ee3[_0x8559('0x19')](0xcc)[_0x8559('0x1a')]();});}};}function handleEntityNotFound(_0x3ceb8b,_0x2da94b){return function(_0x2c7efe){if(!_0x2c7efe){_0x3ceb8b[_0x8559('0x26')](0x194);}return _0x2c7efe;};}function handleError(_0x1af248,_0x13892e){_0x13892e=_0x13892e||0x1f4;return function(_0x5057f0){logger[_0x8559('0x27')](_0x5057f0['stack']);if(_0x5057f0[_0x8559('0x28')]){delete _0x5057f0[_0x8559('0x28')];}_0x1af248[_0x8559('0x19')](_0x13892e)['send'](_0x5057f0);};}exports[_0x8559('0x29')]=function(_0x3e87f6,_0x5f15b8){var _0x5d0c7a={},_0x17dbd3={},_0x1af44b={'count':0x0,'rows':[]};var _0x5d7c70=_[_0x8559('0x2a')](db[_0x8559('0x2b')]['rawAttributes'],function(_0x571d5c){return{'name':_0x571d5c['fieldName'],'type':_0x571d5c[_0x8559('0x2c')][_0x8559('0x2d')]};});_0x17dbd3[_0x8559('0x2e')]=_['map'](_0x5d7c70,_0x8559('0x28'));_0x17dbd3[_0x8559('0x2f')]=_[_0x8559('0x30')](_0x3e87f6[_0x8559('0x2f')]);_0x17dbd3[_0x8559('0x31')]=_[_0x8559('0x32')](_0x17dbd3[_0x8559('0x2e')],_0x17dbd3[_0x8559('0x2f')]);_0x5d0c7a[_0x8559('0x33')]=_[_0x8559('0x32')](_0x17dbd3[_0x8559('0x2e')],qs[_0x8559('0x34')](_0x3e87f6['query'][_0x8559('0x34')]));_0x5d0c7a[_0x8559('0x33')]=_0x5d0c7a[_0x8559('0x33')][_0x8559('0x35')]?_0x5d0c7a[_0x8559('0x33')]:_0x17dbd3[_0x8559('0x2e')];if(!_0x3e87f6['query'][_0x8559('0x36')]('nolimit')){_0x5d0c7a['limit']=qs[_0x8559('0x1e')](_0x3e87f6[_0x8559('0x2f')][_0x8559('0x1e')]);_0x5d0c7a['offset']=qs[_0x8559('0x1c')](_0x3e87f6[_0x8559('0x2f')][_0x8559('0x1c')]);}_0x5d0c7a[_0x8559('0x37')]=qs['sort'](_0x3e87f6['query']['sort']);_0x5d0c7a[_0x8559('0x38')]=qs['filters'](_[_0x8559('0x39')](_0x3e87f6[_0x8559('0x2f')],_0x17dbd3[_0x8559('0x31')]),_0x5d7c70);if(_0x3e87f6[_0x8559('0x2f')][_0x8559('0x3a')]){_0x5d0c7a['where']=_[_0x8559('0x3b')](_0x5d0c7a['where'],{'$or':_['map'](_0x5d7c70,function(_0x20521b){if(_0x20521b['type']!=='VIRTUAL'){var _0x161150={};_0x161150[_0x20521b['name']]={'$like':'%'+_0x3e87f6['query'][_0x8559('0x3a')]+'%'};return _0x161150;}})});}_0x5d0c7a=_[_0x8559('0x3b')]({},_0x5d0c7a,_0x3e87f6[_0x8559('0x3c')]);var _0x5f0639={'where':_0x5d0c7a['where']};return db['ZohoConfiguration'][_0x8559('0x3d')](_0x5f0639)[_0x8559('0x24')](function(_0x6cd95c){_0x1af44b[_0x8559('0x3d')]=_0x6cd95c;if(_0x3e87f6['query']['includeAll']){_0x5d0c7a[_0x8559('0x3e')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x5d0c7a);})[_0x8559('0x24')](function(_0x59b1d2){_0x1af44b['rows']=_0x59b1d2;return _0x1af44b;})[_0x8559('0x24')](respondWithFilteredResult(_0x5f15b8,_0x5d0c7a))[_0x8559('0x3f')](handleError(_0x5f15b8,null));};exports[_0x8559('0x40')]=function(_0x2e8113,_0x36a714){var _0x4a8e35={'raw':![],'where':{'id':_0x2e8113[_0x8559('0x41')]['id']}},_0x12a2bb={};_0x12a2bb[_0x8559('0x2e')]=_['keys'](db['ZohoConfiguration'][_0x8559('0x42')]);_0x12a2bb[_0x8559('0x2f')]=_[_0x8559('0x30')](_0x2e8113['query']);_0x12a2bb[_0x8559('0x31')]=_[_0x8559('0x32')](_0x12a2bb[_0x8559('0x2e')],_0x12a2bb[_0x8559('0x2f')]);_0x4a8e35[_0x8559('0x33')]=_[_0x8559('0x32')](_0x12a2bb['model'],qs[_0x8559('0x34')](_0x2e8113['query']['fields']));_0x4a8e35[_0x8559('0x33')]=_0x4a8e35[_0x8559('0x33')][_0x8559('0x35')]?_0x4a8e35[_0x8559('0x33')]:_0x12a2bb[_0x8559('0x2e')];if(_0x2e8113[_0x8559('0x2f')]['includeAll']){_0x4a8e35[_0x8559('0x3e')]=[{'all':!![]}];}_0x4a8e35=_[_0x8559('0x3b')]({},_0x4a8e35,_0x2e8113[_0x8559('0x3c')]);return db[_0x8559('0x2b')][_0x8559('0x43')](_0x4a8e35)[_0x8559('0x24')](handleEntityNotFound(_0x36a714,null))[_0x8559('0x24')](respondWithResult(_0x36a714,null))['catch'](handleError(_0x36a714,null));};exports[_0x8559('0x44')]=function(_0x268362,_0x2fa22a){return db[_0x8559('0x2b')][_0x8559('0x44')](_0x268362[_0x8559('0x45')],{})[_0x8559('0x24')](respondWithResult(_0x2fa22a,0xc9))[_0x8559('0x3f')](handleError(_0x2fa22a,null));};exports[_0x8559('0x23')]=function(_0x1a81fd,_0x1ea49c){if(_0x1a81fd[_0x8559('0x45')]['id']){delete _0x1a81fd['body']['id'];}return db[_0x8559('0x2b')][_0x8559('0x43')]({'where':{'id':_0x1a81fd[_0x8559('0x41')]['id']}})[_0x8559('0x24')](handleEntityNotFound(_0x1ea49c,null))[_0x8559('0x24')](saveUpdates(_0x1a81fd['body'],null))[_0x8559('0x24')](respondWithResult(_0x1ea49c,null))['catch'](handleError(_0x1ea49c,null));};exports[_0x8559('0x25')]=function(_0x5a2796,_0x21b575){return db[_0x8559('0x2b')][_0x8559('0x43')]({'where':{'id':_0x5a2796[_0x8559('0x41')]['id']}})[_0x8559('0x24')](handleEntityNotFound(_0x21b575,null))[_0x8559('0x24')](removeEntity(_0x21b575,null))[_0x8559('0x3f')](handleError(_0x21b575,null));};exports['getFields']=function(_0x135f86,_0xed2713,_0x4c3a0c){var _0x2f3cd8={};var _0x59f31c={};var _0x2925d6;var _0x3f1b1f;return db[_0x8559('0x2b')][_0x8559('0x46')]({'where':{'id':_0x135f86[_0x8559('0x41')]['id']}})['then'](handleEntityNotFound(_0xed2713,null))[_0x8559('0x24')](function(_0x169fa7){if(_0x169fa7){_0x2925d6=_0x169fa7;_0x59f31c[_0x8559('0x2e')]=_['keys'](db['ZohoField'][_0x8559('0x42')]);_0x59f31c[_0x8559('0x2f')]=_[_0x8559('0x30')](_0x135f86[_0x8559('0x2f')]);_0x59f31c['filters']=_['intersection'](_0x59f31c[_0x8559('0x2e')],_0x59f31c['query']);_0x2f3cd8[_0x8559('0x33')]=_[_0x8559('0x32')](_0x59f31c[_0x8559('0x2e')],qs[_0x8559('0x34')](_0x135f86[_0x8559('0x2f')][_0x8559('0x34')]));_0x2f3cd8[_0x8559('0x33')]=_0x2f3cd8[_0x8559('0x33')][_0x8559('0x35')]?_0x2f3cd8[_0x8559('0x33')]:_0x59f31c[_0x8559('0x2e')];_0x2f3cd8[_0x8559('0x37')]=qs[_0x8559('0x47')](_0x135f86[_0x8559('0x2f')][_0x8559('0x47')]);_0x2f3cd8[_0x8559('0x38')]=qs['filters'](_[_0x8559('0x39')](_0x135f86[_0x8559('0x2f')],_0x59f31c[_0x8559('0x31')]));if(_0x135f86[_0x8559('0x2f')][_0x8559('0x3a')]){_0x2f3cd8[_0x8559('0x38')]=_['merge'](_0x2f3cd8[_0x8559('0x38')],{'$or':_['map'](_0x2f3cd8['attributes'],function(_0x148c1c){var _0x88dd91={};_0x88dd91[_0x148c1c]={'$like':'%'+_0x135f86[_0x8559('0x2f')][_0x8559('0x3a')]+'%'};return _0x88dd91;})});}_0x2f3cd8=_['merge']({},_0x2f3cd8,_0x135f86['options']);return _0x2925d6[_0x8559('0x48')](_0x2f3cd8);}})[_0x8559('0x24')](function(_0x481f08){if(_0x481f08){_0x3f1b1f=_0x481f08['length'];if(!_0x135f86[_0x8559('0x2f')][_0x8559('0x36')](_0x8559('0x49'))){_0x2f3cd8['limit']=qs[_0x8559('0x1e')](_0x135f86['query'][_0x8559('0x1e')]);_0x2f3cd8['offset']=qs[_0x8559('0x1c')](_0x135f86['query'][_0x8559('0x1c')]);}return _0x2925d6[_0x8559('0x48')](_0x2f3cd8);}})[_0x8559('0x24')](function(_0xd50835){if(_0xd50835){return _0xd50835?{'count':_0x3f1b1f,'rows':_0xd50835}:null;}})[_0x8559('0x24')](respondWithResult(_0xed2713,null))[_0x8559('0x3f')](handleError(_0xed2713,null));};exports[_0x8559('0x4a')]=function(_0x9645ca,_0x411af8,_0x4e04c3){var _0x383526={};var _0x5221a5={};var _0x2250d6;var _0x3050ee;return db[_0x8559('0x2b')][_0x8559('0x46')]({'where':{'id':_0x9645ca['params']['id']}})['then'](handleEntityNotFound(_0x411af8,null))['then'](function(_0x36441c){if(_0x36441c){_0x2250d6=_0x36441c;_0x5221a5[_0x8559('0x2e')]=_[_0x8559('0x30')](db['ZohoField'][_0x8559('0x42')]);_0x5221a5['query']=_[_0x8559('0x30')](_0x9645ca[_0x8559('0x2f')]);_0x5221a5[_0x8559('0x31')]=_['intersection'](_0x5221a5[_0x8559('0x2e')],_0x5221a5[_0x8559('0x2f')]);_0x383526[_0x8559('0x33')]=_[_0x8559('0x32')](_0x5221a5[_0x8559('0x2e')],qs[_0x8559('0x34')](_0x9645ca['query']['fields']));_0x383526['attributes']=_0x383526[_0x8559('0x33')][_0x8559('0x35')]?_0x383526[_0x8559('0x33')]:_0x5221a5[_0x8559('0x2e')];_0x383526['order']=qs[_0x8559('0x47')](_0x9645ca['query']['sort']);_0x383526['where']=qs[_0x8559('0x31')](_['pick'](_0x9645ca[_0x8559('0x2f')],_0x5221a5['filters']));if(_0x9645ca[_0x8559('0x2f')][_0x8559('0x3a')]){_0x383526[_0x8559('0x38')]=_[_0x8559('0x3b')](_0x383526['where'],{'$or':_[_0x8559('0x2a')](_0x383526[_0x8559('0x33')],function(_0x2e7c1c){var _0x48c81d={};_0x48c81d[_0x2e7c1c]={'$like':'%'+_0x9645ca[_0x8559('0x2f')]['filter']+'%'};return _0x48c81d;})});}_0x383526=_[_0x8559('0x3b')]({},_0x383526,_0x9645ca[_0x8559('0x3c')]);return _0x2250d6[_0x8559('0x4a')](_0x383526);}})[_0x8559('0x24')](function(_0x4030a9){if(_0x4030a9){_0x3050ee=_0x4030a9[_0x8559('0x35')];if(!_0x9645ca[_0x8559('0x2f')]['hasOwnProperty'](_0x8559('0x49'))){_0x383526[_0x8559('0x1e')]=qs['limit'](_0x9645ca[_0x8559('0x2f')][_0x8559('0x1e')]);_0x383526[_0x8559('0x1c')]=qs['offset'](_0x9645ca[_0x8559('0x2f')][_0x8559('0x1c')]);}return _0x2250d6[_0x8559('0x4a')](_0x383526);}})[_0x8559('0x24')](function(_0x50e0bd){if(_0x50e0bd){return _0x50e0bd?{'count':_0x3050ee,'rows':_0x50e0bd}:null;}})[_0x8559('0x24')](respondWithResult(_0x411af8,null))['catch'](handleError(_0x411af8,null));};exports[_0x8559('0x4b')]=function(_0x27cd71,_0x9c78f1,_0x1ce109){var _0x4d9ff3={};var _0x2c9f21={};var _0x474093;var _0x15d875;return db[_0x8559('0x2b')][_0x8559('0x46')]({'where':{'id':_0x27cd71[_0x8559('0x41')]['id']}})['then'](handleEntityNotFound(_0x9c78f1,null))[_0x8559('0x24')](function(_0x42c9e3){if(_0x42c9e3){_0x474093=_0x42c9e3;_0x2c9f21['model']=_['keys'](db[_0x8559('0x4c')][_0x8559('0x42')]);_0x2c9f21['query']=_[_0x8559('0x30')](_0x27cd71[_0x8559('0x2f')]);_0x2c9f21[_0x8559('0x31')]=_['intersection'](_0x2c9f21[_0x8559('0x2e')],_0x2c9f21[_0x8559('0x2f')]);_0x4d9ff3[_0x8559('0x33')]=_['intersection'](_0x2c9f21[_0x8559('0x2e')],qs[_0x8559('0x34')](_0x27cd71[_0x8559('0x2f')][_0x8559('0x34')]));_0x4d9ff3[_0x8559('0x33')]=_0x4d9ff3[_0x8559('0x33')][_0x8559('0x35')]?_0x4d9ff3['attributes']:_0x2c9f21['model'];_0x4d9ff3[_0x8559('0x37')]=qs['sort'](_0x27cd71[_0x8559('0x2f')][_0x8559('0x47')]);_0x4d9ff3[_0x8559('0x38')]=qs[_0x8559('0x31')](_['pick'](_0x27cd71[_0x8559('0x2f')],_0x2c9f21['filters']));if(_0x27cd71[_0x8559('0x2f')][_0x8559('0x3a')]){_0x4d9ff3['where']=_[_0x8559('0x3b')](_0x4d9ff3[_0x8559('0x38')],{'$or':_[_0x8559('0x2a')](_0x4d9ff3[_0x8559('0x33')],function(_0x3b1bf3){var _0x43325e={};_0x43325e[_0x3b1bf3]={'$like':'%'+_0x27cd71['query'][_0x8559('0x3a')]+'%'};return _0x43325e;})});}_0x4d9ff3=_[_0x8559('0x3b')]({},_0x4d9ff3,_0x27cd71['options']);return _0x474093[_0x8559('0x4b')](_0x4d9ff3);}})[_0x8559('0x24')](function(_0x1e2c72){if(_0x1e2c72){_0x15d875=_0x1e2c72[_0x8559('0x35')];if(!_0x27cd71[_0x8559('0x2f')][_0x8559('0x36')](_0x8559('0x49'))){_0x4d9ff3[_0x8559('0x1e')]=qs[_0x8559('0x1e')](_0x27cd71[_0x8559('0x2f')][_0x8559('0x1e')]);_0x4d9ff3[_0x8559('0x1c')]=qs[_0x8559('0x1c')](_0x27cd71['query'][_0x8559('0x1c')]);}return _0x474093[_0x8559('0x4b')](_0x4d9ff3);}})['then'](function(_0x39ce12){if(_0x39ce12){return _0x39ce12?{'count':_0x15d875,'rows':_0x39ce12}:null;}})[_0x8559('0x24')](respondWithResult(_0x9c78f1,null))[_0x8559('0x3f')](handleError(_0x9c78f1,null));};
\ No newline at end of file
index 9d2b8cb..3604663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc2a=['request-promise','path','rimraf','../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x130c00,_0x80418e){var _0x1f582d=function(_0x39a208){while(--_0x39a208){_0x130c00['push'](_0x130c00['shift']());}};_0x1f582d(++_0x80418e);}(_0xbc2a,0x133));var _0xabc2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc2a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xabc2('0x0'));var util=require(_0xabc2('0x1'));var logger=require(_0xabc2('0x2'))(_0xabc2('0x3'));var moment=require(_0xabc2('0x4'));var BPromise=require('bluebird');var rp=require(_0xabc2('0x5'));var fs=require('fs');var path=require(_0xabc2('0x6'));var rimraf=require(_0xabc2('0x7'));var config=require(_0xabc2('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0xabc2('0x9')]=function(_0x558b0b,_0x41302f){return _0x558b0b[_0xabc2('0xa')](_0xabc2('0xb'),attributes,{'tableName':_0xabc2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6247=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util'];(function(_0x37da2e,_0xca87ff){var _0xcb74a=function(_0x3cc20a){while(--_0x3cc20a){_0x37da2e['push'](_0x37da2e['shift']());}};_0xcb74a(++_0xca87ff);}(_0x6247,0x1ed));var _0x7624=function(_0x56acb5,_0x64d19b){_0x56acb5=_0x56acb5-0x0;var _0x572cc0=_0x6247[_0x56acb5];return _0x572cc0;};'use strict';var _=require(_0x7624('0x0'));var util=require(_0x7624('0x1'));var logger=require(_0x7624('0x2'))(_0x7624('0x3'));var moment=require(_0x7624('0x4'));var BPromise=require(_0x7624('0x5'));var rp=require(_0x7624('0x6'));var fs=require('fs');var path=require(_0x7624('0x7'));var rimraf=require(_0x7624('0x8'));var config=require(_0x7624('0x9'));var attributes=require(_0x7624('0xa'));module[_0x7624('0xb')]=function(_0x111524,_0x108333){return _0x111524[_0x7624('0xc')](_0x7624('0xd'),attributes,{'tableName':_0x7624('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dad8c3b..844f59d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x680a=['http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x680a,0x1eb));var _0xa680=function(_0x54394e,_0x5d85f1){_0x54394e=_0x54394e-0x0;var _0x2fd92b=_0x680a[_0x54394e];return _0x2fd92b;};'use strict';var _=require(_0xa680('0x0'));var util=require(_0xa680('0x1'));var moment=require('moment');var BPromise=require(_0xa680('0x2'));var rs=require(_0xa680('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa680('0x4'));var logger=require(_0xa680('0x5'))(_0xa680('0x6'));var config=require(_0xa680('0x7'));var jayson=require(_0xa680('0x8'));var client=jayson['client'][_0xa680('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x539317,_0x544c24,_0x3b3166){return new BPromise(function(_0x5f38c6,_0x1fc085){return client[_0xa680('0xa')](_0x539317,_0x3b3166)[_0xa680('0xb')](function(_0x521d30){logger['info'](_0xa680('0xc'),_0x544c24,_0xa680('0xd'));logger['debug'](_0xa680('0xe'),_0x544c24,_0xa680('0xd'),JSON[_0xa680('0xf')](_0x521d30));if(_0x521d30['error']){if(_0x521d30['error']['code']===0x1f4){logger[_0xa680('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x544c24,_0x521d30[_0xa680('0x10')][_0xa680('0x11')]);return _0x1fc085(_0x521d30[_0xa680('0x10')][_0xa680('0x11')]);}logger[_0xa680('0x10')](_0xa680('0xc'),_0x544c24,_0x521d30[_0xa680('0x10')][_0xa680('0x11')]);return _0x5f38c6(_0x521d30[_0xa680('0x10')][_0xa680('0x11')]);}else{logger[_0xa680('0x12')](_0xa680('0xc'),_0x544c24,_0xa680('0xd'));_0x5f38c6(_0x521d30['result'][_0xa680('0x11')]);}})[_0xa680('0x13')](function(_0x1d1886){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x544c24,_0x1d1886);_0x1fc085(_0x1d1886);});});}
\ No newline at end of file
+var _0x7709=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','info'];(function(_0x5f0128,_0x1a260d){var _0x1697cc=function(_0x2ff667){while(--_0x2ff667){_0x5f0128['push'](_0x5f0128['shift']());}};_0x1697cc(++_0x1a260d);}(_0x7709,0x186));var _0x9770=function(_0x5bb445,_0x11c0c7){_0x5bb445=_0x5bb445-0x0;var _0x8e08e5=_0x7709[_0x5bb445];return _0x8e08e5;};'use strict';var _=require(_0x9770('0x0'));var util=require('util');var moment=require(_0x9770('0x1'));var BPromise=require(_0x9770('0x2'));var rs=require(_0x9770('0x3'));var fs=require('fs');var Redis=require(_0x9770('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9770('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9770('0x6'));var client=jayson[_0x9770('0x7')][_0x9770('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x497c79,_0x444d9c,_0x17544e){return new BPromise(function(_0x26fec5,_0x4d106b){return client['request'](_0x497c79,_0x17544e)['then'](function(_0x3da84c){logger[_0x9770('0x9')](_0x9770('0xa'),_0x444d9c,_0x9770('0xb'));logger[_0x9770('0xc')](_0x9770('0xd'),_0x444d9c,_0x9770('0xb'),JSON[_0x9770('0xe')](_0x3da84c));if(_0x3da84c[_0x9770('0xf')]){if(_0x3da84c[_0x9770('0xf')][_0x9770('0x10')]===0x1f4){logger[_0x9770('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x444d9c,_0x3da84c['error'][_0x9770('0x11')]);return _0x4d106b(_0x3da84c[_0x9770('0xf')]['message']);}logger[_0x9770('0xf')](_0x9770('0xa'),_0x444d9c,_0x3da84c[_0x9770('0xf')][_0x9770('0x11')]);return _0x26fec5(_0x3da84c['error'][_0x9770('0x11')]);}else{logger[_0x9770('0x9')](_0x9770('0xa'),_0x444d9c,_0x9770('0xb'));_0x26fec5(_0x3da84c[_0x9770('0x12')][_0x9770('0x11')]);}})[_0x9770('0x13')](function(_0x58cb94){logger[_0x9770('0xf')](_0x9770('0xa'),_0x444d9c,_0x58cb94);_0x4d106b(_0x58cb94);});});}
\ No newline at end of file
index 2611a71..08faacf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bbd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x2bbd,0x135));var _0xd2bb=function(_0x308f69,_0x281412){_0x308f69=_0x308f69-0x0;var _0x5353e8=_0x2bbd[_0x308f69];return _0x5353e8;};'use strict';var multer=require(_0xd2bb('0x0'));var util=require(_0xd2bb('0x1'));var path=require(_0xd2bb('0x2'));var timeout=require(_0xd2bb('0x3'));var express=require(_0xd2bb('0x4'));var router=express[_0xd2bb('0x5')]();var fs_extra=require(_0xd2bb('0x6'));var auth=require(_0xd2bb('0x7'));var interaction=require(_0xd2bb('0x8'));var config=require(_0xd2bb('0x9'));var controller=require(_0xd2bb('0xa'));router[_0xd2bb('0xb')]('/',auth[_0xd2bb('0xc')](),controller['index']);router[_0xd2bb('0xb')](_0xd2bb('0xd'),auth[_0xd2bb('0xc')](),controller[_0xd2bb('0xe')]);router[_0xd2bb('0xf')]('/',auth[_0xd2bb('0xc')](),controller[_0xd2bb('0x10')]);router[_0xd2bb('0x11')](_0xd2bb('0xd'),auth[_0xd2bb('0xc')](),controller[_0xd2bb('0x12')]);router[_0xd2bb('0x13')](_0xd2bb('0xd'),auth[_0xd2bb('0xc')](),controller['destroy']);module[_0xd2bb('0x14')]=router;
\ No newline at end of file
+var _0x2b12=['./intZohoField.controller','get','/:id','create','put','isAuthenticated','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5b1c80,_0x470328){var _0x1423dc=function(_0x5f1789){while(--_0x5f1789){_0x5b1c80['push'](_0x5b1c80['shift']());}};_0x1423dc(++_0x470328);}(_0x2b12,0x87));var _0x22b1=function(_0x8228f7,_0xdfbb10){_0x8228f7=_0x8228f7-0x0;var _0x4de151=_0x2b12[_0x8228f7];return _0x4de151;};'use strict';var multer=require(_0x22b1('0x0'));var util=require(_0x22b1('0x1'));var path=require(_0x22b1('0x2'));var timeout=require(_0x22b1('0x3'));var express=require(_0x22b1('0x4'));var router=express[_0x22b1('0x5')]();var fs_extra=require(_0x22b1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x22b1('0x7'));var config=require(_0x22b1('0x8'));var controller=require(_0x22b1('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x22b1('0xa')](_0x22b1('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x22b1('0xc')]);router[_0x22b1('0xd')](_0x22b1('0xb'),auth[_0x22b1('0xe')](),controller['update']);router[_0x22b1('0xf')](_0x22b1('0xb'),auth[_0x22b1('0xe')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 4542016..5449d3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b72=['keyValue','picklist','STRING','string','BOOLEAN','exports','ENUM','variable','customVariable'];(function(_0x49fac5,_0x410d28){var _0x2f0b73=function(_0x4a215e){while(--_0x4a215e){_0x49fac5['push'](_0x49fac5['shift']());}};_0x2f0b73(++_0x410d28);}(_0x3b72,0x11c));var _0x23b7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3b72[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x23b7('0x0')]={'type':{'type':Sequelize[_0x23b7('0x1')]('string',_0x23b7('0x2'),_0x23b7('0x3'),_0x23b7('0x4'),_0x23b7('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x23b7('0x6')]},'key':{'type':Sequelize[_0x23b7('0x6')]},'keyType':{'type':Sequelize[_0x23b7('0x1')](_0x23b7('0x7'),_0x23b7('0x2'),_0x23b7('0x3'))},'keyContent':{'type':Sequelize[_0x23b7('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x23b7('0x6')]},'customField':{'type':Sequelize[_0x23b7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x23b7('0x6')]}};
\ No newline at end of file
+var _0x2392=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x50e700,_0x5ac0a1){var _0x423e4f=function(_0x491d73){while(--_0x491d73){_0x50e700['push'](_0x50e700['shift']());}};_0x423e4f(++_0x5ac0a1);}(_0x2392,0x1bf));var _0x2239=function(_0x460ec9,_0x1aad32){_0x460ec9=_0x460ec9-0x0;var _0x5f2d54=_0x2392[_0x460ec9];return _0x5f2d54;};'use strict';var Sequelize=require(_0x2239('0x0'));module[_0x2239('0x1')]={'type':{'type':Sequelize[_0x2239('0x2')](_0x2239('0x3'),_0x2239('0x4'),_0x2239('0x5'),_0x2239('0x6'),_0x2239('0x7')),'defaultValue':_0x2239('0x3')},'content':{'type':Sequelize[_0x2239('0x8')]},'key':{'type':Sequelize[_0x2239('0x8')]},'keyType':{'type':Sequelize[_0x2239('0x2')](_0x2239('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x2239('0x8')]},'idField':{'type':Sequelize[_0x2239('0x8')]},'nameField':{'type':Sequelize[_0x2239('0x8')]},'customField':{'type':Sequelize[_0x2239('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2239('0x8')]}};
\ No newline at end of file
index 2906442..7977d55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05e5=['intersection','fields','length','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','show','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x05e5,0x17b));var _0x505e=function(_0x34e37e,_0x3db1ca){_0x34e37e=_0x34e37e-0x0;var _0x4eb5a3=_0x05e5[_0x34e37e];return _0x4eb5a3;};'use strict';var emlformat=require(_0x505e('0x0'));var rimraf=require(_0x505e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x505e('0x2'));var rp=require('request-promise');var moment=require(_0x505e('0x3'));var BPromise=require(_0x505e('0x4'));var Mustache=require(_0x505e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x505e('0x6'));var csv=require(_0x505e('0x7'));var ejs=require(_0x505e('0x8'));var fs=require('fs');var fs_extra=require(_0x505e('0x9'));var _=require(_0x505e('0xa'));var squel=require(_0x505e('0xb'));var crypto=require(_0x505e('0xc'));var jsforce=require(_0x505e('0xd'));var deskjs=require(_0x505e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x505e('0xf'));var Papa=require(_0x505e('0x10'));var Redis=require(_0x505e('0x11'));var authService=require(_0x505e('0x12'));var qs=require(_0x505e('0x13'));var as=require(_0x505e('0x14'));var hardwareService=require(_0x505e('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x505e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x72fd0,_0x2c7349){_0x2c7349=_0x2c7349||0xcc;return function(_0x591fd2){if(_0x591fd2){return _0x72fd0[_0x505e('0x17')](_0x2c7349);}return _0x72fd0[_0x505e('0x18')](_0x2c7349)[_0x505e('0x19')]();};}function respondWithResult(_0x18c922,_0x1d78de){_0x1d78de=_0x1d78de||0xc8;return function(_0xf83059){if(_0xf83059){return _0x18c922['status'](_0x1d78de)[_0x505e('0x1a')](_0xf83059);}};}function respondWithFilteredResult(_0xeb4982,_0x6a3833){return function(_0x6f0d7c){if(_0x6f0d7c){var _0xf0f28d=typeof _0x6a3833[_0x505e('0x1b')]===_0x505e('0x1c')&&typeof _0x6a3833[_0x505e('0x1d')]==='undefined';var _0x1b320c=_0x6f0d7c[_0x505e('0x1e')];var _0x40c958=_0xf0f28d?0x0:_0x6a3833['offset'];var _0x8564d=_0xf0f28d?_0x6f0d7c['count']:_0x6a3833['offset']+_0x6a3833[_0x505e('0x1d')];var _0xfeee4b;if(_0x8564d>=_0x1b320c){_0x8564d=_0x1b320c;_0xfeee4b=0xc8;}else{_0xfeee4b=0xce;}_0xeb4982[_0x505e('0x18')](_0xfeee4b);return _0xeb4982['set'](_0x505e('0x1f'),_0x40c958+'-'+_0x8564d+'/'+_0x1b320c)[_0x505e('0x1a')](_0x6f0d7c);}return null;};}function patchUpdates(_0x5e7afe){return function(_0x1fb48c){try{jsonpatch[_0x505e('0x20')](_0x1fb48c,_0x5e7afe,!![]);}catch(_0x195ee7){return BPromise[_0x505e('0x21')](_0x195ee7);}return _0x1fb48c[_0x505e('0x22')]();};}function saveUpdates(_0x2084bf,_0x1496c1){return function(_0x47179a){if(_0x47179a){return _0x47179a['update'](_0x2084bf)[_0x505e('0x23')](function(_0x33c529){return _0x33c529;});}return null;};}function removeEntity(_0x5d5899,_0xccd660){return function(_0x50964a){if(_0x50964a){return _0x50964a[_0x505e('0x24')]()['then'](function(){_0x5d5899[_0x505e('0x18')](0xcc)[_0x505e('0x19')]();});}};}function handleEntityNotFound(_0x2b1f83,_0x474db3){return function(_0x15866d){if(!_0x15866d){_0x2b1f83['sendStatus'](0x194);}return _0x15866d;};}function handleError(_0x186424,_0x5e4904){_0x5e4904=_0x5e4904||0x1f4;return function(_0xc9d21){logger[_0x505e('0x25')](_0xc9d21[_0x505e('0x26')]);if(_0xc9d21['name']){delete _0xc9d21[_0x505e('0x27')];}_0x186424[_0x505e('0x18')](_0x5e4904)[_0x505e('0x28')](_0xc9d21);};}exports[_0x505e('0x29')]=function(_0x89567b,_0x39fcef){var _0x22d36b={},_0x580fe6={},_0x8f2b00={'count':0x0,'rows':[]};var _0x3f9aa0=_[_0x505e('0x2a')](db[_0x505e('0x2b')][_0x505e('0x2c')],function(_0x463a16){return{'name':_0x463a16[_0x505e('0x2d')],'type':_0x463a16[_0x505e('0x2e')][_0x505e('0x2f')]};});_0x580fe6[_0x505e('0x30')]=_[_0x505e('0x2a')](_0x3f9aa0,_0x505e('0x27'));_0x580fe6[_0x505e('0x31')]=_[_0x505e('0x32')](_0x89567b['query']);_0x580fe6[_0x505e('0x33')]=_['intersection'](_0x580fe6[_0x505e('0x30')],_0x580fe6[_0x505e('0x31')]);_0x22d36b[_0x505e('0x34')]=_[_0x505e('0x35')](_0x580fe6[_0x505e('0x30')],qs[_0x505e('0x36')](_0x89567b[_0x505e('0x31')][_0x505e('0x36')]));_0x22d36b[_0x505e('0x34')]=_0x22d36b[_0x505e('0x34')][_0x505e('0x37')]?_0x22d36b['attributes']:_0x580fe6[_0x505e('0x30')];if(!_0x89567b[_0x505e('0x31')]['hasOwnProperty'](_0x505e('0x38'))){_0x22d36b['limit']=qs[_0x505e('0x1d')](_0x89567b[_0x505e('0x31')][_0x505e('0x1d')]);_0x22d36b['offset']=qs[_0x505e('0x1b')](_0x89567b['query'][_0x505e('0x1b')]);}_0x22d36b[_0x505e('0x39')]=qs[_0x505e('0x3a')](_0x89567b[_0x505e('0x31')][_0x505e('0x3a')]);_0x22d36b[_0x505e('0x3b')]=qs[_0x505e('0x33')](_[_0x505e('0x3c')](_0x89567b[_0x505e('0x31')],_0x580fe6[_0x505e('0x33')]),_0x3f9aa0);if(_0x89567b[_0x505e('0x31')]['filter']){_0x22d36b[_0x505e('0x3b')]=_[_0x505e('0x3d')](_0x22d36b['where'],{'$or':_[_0x505e('0x2a')](_0x3f9aa0,function(_0x837d68){if(_0x837d68[_0x505e('0x2e')]!=='VIRTUAL'){var _0x28c6a4={};_0x28c6a4[_0x837d68['name']]={'$like':'%'+_0x89567b[_0x505e('0x31')][_0x505e('0x3e')]+'%'};return _0x28c6a4;}})});}_0x22d36b=_[_0x505e('0x3d')]({},_0x22d36b,_0x89567b['options']);var _0x345f7e={'where':_0x22d36b['where']};return db[_0x505e('0x2b')]['count'](_0x345f7e)[_0x505e('0x23')](function(_0x132d17){_0x8f2b00[_0x505e('0x1e')]=_0x132d17;if(_0x89567b['query'][_0x505e('0x3f')]){_0x22d36b[_0x505e('0x40')]=[{'all':!![]}];}return db['ZohoField'][_0x505e('0x41')](_0x22d36b);})[_0x505e('0x23')](function(_0xbad0cd){_0x8f2b00['rows']=_0xbad0cd;return _0x8f2b00;})['then'](respondWithFilteredResult(_0x39fcef,_0x22d36b))['catch'](handleError(_0x39fcef,null));};exports[_0x505e('0x42')]=function(_0x314e65,_0x120422){var _0x1a4e91={'raw':!![],'where':{'id':_0x314e65['params']['id']}},_0x183f2b={};_0x183f2b['model']=_[_0x505e('0x32')](db[_0x505e('0x2b')][_0x505e('0x2c')]);_0x183f2b[_0x505e('0x31')]=_['keys'](_0x314e65[_0x505e('0x31')]);_0x183f2b[_0x505e('0x33')]=_[_0x505e('0x35')](_0x183f2b[_0x505e('0x30')],_0x183f2b[_0x505e('0x31')]);_0x1a4e91[_0x505e('0x34')]=_[_0x505e('0x35')](_0x183f2b[_0x505e('0x30')],qs[_0x505e('0x36')](_0x314e65[_0x505e('0x31')][_0x505e('0x36')]));_0x1a4e91['attributes']=_0x1a4e91[_0x505e('0x34')]['length']?_0x1a4e91['attributes']:_0x183f2b[_0x505e('0x30')];if(_0x314e65[_0x505e('0x31')]['includeAll']){_0x1a4e91[_0x505e('0x40')]=[{'all':!![]}];}_0x1a4e91=_['merge']({},_0x1a4e91,_0x314e65['options']);return db['ZohoField'][_0x505e('0x43')](_0x1a4e91)[_0x505e('0x23')](handleEntityNotFound(_0x120422,null))[_0x505e('0x23')](respondWithResult(_0x120422,null))[_0x505e('0x44')](handleError(_0x120422,null));};exports[_0x505e('0x45')]=function(_0x232a0d,_0x6afc67){return db[_0x505e('0x2b')][_0x505e('0x45')](_0x232a0d['body'],{})[_0x505e('0x23')](respondWithResult(_0x6afc67,0xc9))[_0x505e('0x44')](handleError(_0x6afc67,null));};exports['update']=function(_0x45d921,_0xaf62d7){if(_0x45d921['body']['id']){delete _0x45d921[_0x505e('0x46')]['id'];}return db[_0x505e('0x2b')][_0x505e('0x43')]({'where':{'id':_0x45d921[_0x505e('0x47')]['id']}})[_0x505e('0x23')](handleEntityNotFound(_0xaf62d7,null))[_0x505e('0x23')](saveUpdates(_0x45d921['body'],null))[_0x505e('0x23')](respondWithResult(_0xaf62d7,null))[_0x505e('0x44')](handleError(_0xaf62d7,null));};exports[_0x505e('0x24')]=function(_0x4a1a0d,_0x1d525e){return db['ZohoField'][_0x505e('0x43')]({'where':{'id':_0x4a1a0d[_0x505e('0x47')]['id']}})[_0x505e('0x23')](handleEntityNotFound(_0x1d525e,null))[_0x505e('0x23')](removeEntity(_0x1d525e,null))[_0x505e('0x44')](handleError(_0x1d525e,null));};
\ No newline at end of file
+var _0xcff3=['catch','keys','includeAll','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','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','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','sort','pick','filter','merge','where','VIRTUAL','options','include','rows'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xcff3,0x126));var _0x3cff=function(_0x5c0979,_0x287854){_0x5c0979=_0x5c0979-0x0;var _0x309972=_0xcff3[_0x5c0979];return _0x309972;};'use strict';var emlformat=require(_0x3cff('0x0'));var rimraf=require(_0x3cff('0x1'));var zipdir=require(_0x3cff('0x2'));var jsonpatch=require(_0x3cff('0x3'));var rp=require(_0x3cff('0x4'));var moment=require('moment');var BPromise=require(_0x3cff('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3cff('0x6'));var sox=require(_0x3cff('0x7'));var csv=require(_0x3cff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3cff('0x9'));var squel=require(_0x3cff('0xa'));var crypto=require('crypto');var jsforce=require(_0x3cff('0xb'));var deskjs=require(_0x3cff('0xc'));var toCsv=require(_0x3cff('0x8'));var querystring=require('querystring');var Papa=require(_0x3cff('0xd'));var Redis=require(_0x3cff('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3cff('0xf'));var as=require(_0x3cff('0x10'));var hardwareService=require(_0x3cff('0x11'));var logger=require('../../config/logger')(_0x3cff('0x12'));var utils=require(_0x3cff('0x13'));var config=require(_0x3cff('0x14'));var licenseUtil=require(_0x3cff('0x15'));var db=require(_0x3cff('0x16'))['db'];function respondWithStatusCode(_0x51ad0f,_0x497f40){_0x497f40=_0x497f40||0xcc;return function(_0x31a5d6){if(_0x31a5d6){return _0x51ad0f[_0x3cff('0x17')](_0x497f40);}return _0x51ad0f[_0x3cff('0x18')](_0x497f40)[_0x3cff('0x19')]();};}function respondWithResult(_0x5f237e,_0xad2b8){_0xad2b8=_0xad2b8||0xc8;return function(_0x5d0ac0){if(_0x5d0ac0){return _0x5f237e[_0x3cff('0x18')](_0xad2b8)[_0x3cff('0x1a')](_0x5d0ac0);}};}function respondWithFilteredResult(_0x109691,_0x59df43){return function(_0x209d03){if(_0x209d03){var _0x2b12bd=typeof _0x59df43[_0x3cff('0x1b')]===_0x3cff('0x1c')&&typeof _0x59df43[_0x3cff('0x1d')]===_0x3cff('0x1c');var _0x2562be=_0x209d03[_0x3cff('0x1e')];var _0x37511b=_0x2b12bd?0x0:_0x59df43[_0x3cff('0x1b')];var _0x36a3d6=_0x2b12bd?_0x209d03[_0x3cff('0x1e')]:_0x59df43[_0x3cff('0x1b')]+_0x59df43[_0x3cff('0x1d')];var _0x2cb9fa;if(_0x36a3d6>=_0x2562be){_0x36a3d6=_0x2562be;_0x2cb9fa=0xc8;}else{_0x2cb9fa=0xce;}_0x109691[_0x3cff('0x18')](_0x2cb9fa);return _0x109691[_0x3cff('0x1f')](_0x3cff('0x20'),_0x37511b+'-'+_0x36a3d6+'/'+_0x2562be)['json'](_0x209d03);}return null;};}function patchUpdates(_0x1f00fd){return function(_0x3a301d){try{jsonpatch[_0x3cff('0x21')](_0x3a301d,_0x1f00fd,!![]);}catch(_0x485bda){return BPromise[_0x3cff('0x22')](_0x485bda);}return _0x3a301d[_0x3cff('0x23')]();};}function saveUpdates(_0x57cf09,_0x3d33c0){return function(_0x119f92){if(_0x119f92){return _0x119f92[_0x3cff('0x24')](_0x57cf09)[_0x3cff('0x25')](function(_0x217221){return _0x217221;});}return null;};}function removeEntity(_0x53c556,_0x5ed819){return function(_0x1503d7){if(_0x1503d7){return _0x1503d7[_0x3cff('0x26')]()['then'](function(){_0x53c556[_0x3cff('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b3e5e,_0xfe4b19){return function(_0x43aee2){if(!_0x43aee2){_0x1b3e5e[_0x3cff('0x17')](0x194);}return _0x43aee2;};}function handleError(_0x4e572e,_0x3155fb){_0x3155fb=_0x3155fb||0x1f4;return function(_0xe541da){logger[_0x3cff('0x27')](_0xe541da[_0x3cff('0x28')]);if(_0xe541da[_0x3cff('0x29')]){delete _0xe541da[_0x3cff('0x29')];}_0x4e572e['status'](_0x3155fb)[_0x3cff('0x2a')](_0xe541da);};}exports[_0x3cff('0x2b')]=function(_0x123e71,_0x16a14c){var _0x3b33d0={},_0x4515cc={},_0x37bcfd={'count':0x0,'rows':[]};var _0x2ac6be=_[_0x3cff('0x2c')](db[_0x3cff('0x2d')][_0x3cff('0x2e')],function(_0x58d2a4){return{'name':_0x58d2a4[_0x3cff('0x2f')],'type':_0x58d2a4[_0x3cff('0x30')][_0x3cff('0x31')]};});_0x4515cc[_0x3cff('0x32')]=_[_0x3cff('0x2c')](_0x2ac6be,'name');_0x4515cc[_0x3cff('0x33')]=_['keys'](_0x123e71[_0x3cff('0x33')]);_0x4515cc[_0x3cff('0x34')]=_['intersection'](_0x4515cc[_0x3cff('0x32')],_0x4515cc[_0x3cff('0x33')]);_0x3b33d0['attributes']=_[_0x3cff('0x35')](_0x4515cc[_0x3cff('0x32')],qs[_0x3cff('0x36')](_0x123e71[_0x3cff('0x33')][_0x3cff('0x36')]));_0x3b33d0[_0x3cff('0x37')]=_0x3b33d0['attributes'][_0x3cff('0x38')]?_0x3b33d0[_0x3cff('0x37')]:_0x4515cc[_0x3cff('0x32')];if(!_0x123e71['query']['hasOwnProperty']('nolimit')){_0x3b33d0[_0x3cff('0x1d')]=qs[_0x3cff('0x1d')](_0x123e71[_0x3cff('0x33')][_0x3cff('0x1d')]);_0x3b33d0[_0x3cff('0x1b')]=qs['offset'](_0x123e71['query']['offset']);}_0x3b33d0['order']=qs[_0x3cff('0x39')](_0x123e71[_0x3cff('0x33')][_0x3cff('0x39')]);_0x3b33d0['where']=qs[_0x3cff('0x34')](_[_0x3cff('0x3a')](_0x123e71['query'],_0x4515cc[_0x3cff('0x34')]),_0x2ac6be);if(_0x123e71['query'][_0x3cff('0x3b')]){_0x3b33d0['where']=_[_0x3cff('0x3c')](_0x3b33d0[_0x3cff('0x3d')],{'$or':_[_0x3cff('0x2c')](_0x2ac6be,function(_0x88f358){if(_0x88f358[_0x3cff('0x30')]!==_0x3cff('0x3e')){var _0x54b76b={};_0x54b76b[_0x88f358['name']]={'$like':'%'+_0x123e71[_0x3cff('0x33')]['filter']+'%'};return _0x54b76b;}})});}_0x3b33d0=_[_0x3cff('0x3c')]({},_0x3b33d0,_0x123e71[_0x3cff('0x3f')]);var _0x31ab8f={'where':_0x3b33d0[_0x3cff('0x3d')]};return db[_0x3cff('0x2d')][_0x3cff('0x1e')](_0x31ab8f)[_0x3cff('0x25')](function(_0x37f72e){_0x37bcfd[_0x3cff('0x1e')]=_0x37f72e;if(_0x123e71[_0x3cff('0x33')]['includeAll']){_0x3b33d0[_0x3cff('0x40')]=[{'all':!![]}];}return db[_0x3cff('0x2d')]['findAll'](_0x3b33d0);})[_0x3cff('0x25')](function(_0x34debd){_0x37bcfd[_0x3cff('0x41')]=_0x34debd;return _0x37bcfd;})[_0x3cff('0x25')](respondWithFilteredResult(_0x16a14c,_0x3b33d0))[_0x3cff('0x42')](handleError(_0x16a14c,null));};exports['show']=function(_0x157625,_0x5084ba){var _0x870d7f={'raw':!![],'where':{'id':_0x157625['params']['id']}},_0x1a044c={};_0x1a044c['model']=_[_0x3cff('0x43')](db[_0x3cff('0x2d')][_0x3cff('0x2e')]);_0x1a044c['query']=_[_0x3cff('0x43')](_0x157625['query']);_0x1a044c[_0x3cff('0x34')]=_[_0x3cff('0x35')](_0x1a044c[_0x3cff('0x32')],_0x1a044c[_0x3cff('0x33')]);_0x870d7f[_0x3cff('0x37')]=_[_0x3cff('0x35')](_0x1a044c[_0x3cff('0x32')],qs[_0x3cff('0x36')](_0x157625[_0x3cff('0x33')][_0x3cff('0x36')]));_0x870d7f[_0x3cff('0x37')]=_0x870d7f[_0x3cff('0x37')][_0x3cff('0x38')]?_0x870d7f[_0x3cff('0x37')]:_0x1a044c[_0x3cff('0x32')];if(_0x157625[_0x3cff('0x33')][_0x3cff('0x44')]){_0x870d7f[_0x3cff('0x40')]=[{'all':!![]}];}_0x870d7f=_['merge']({},_0x870d7f,_0x157625[_0x3cff('0x3f')]);return db[_0x3cff('0x2d')]['find'](_0x870d7f)[_0x3cff('0x25')](handleEntityNotFound(_0x5084ba,null))[_0x3cff('0x25')](respondWithResult(_0x5084ba,null))[_0x3cff('0x42')](handleError(_0x5084ba,null));};exports['create']=function(_0x183198,_0x508887){return db[_0x3cff('0x2d')]['create'](_0x183198['body'],{})[_0x3cff('0x25')](respondWithResult(_0x508887,0xc9))[_0x3cff('0x42')](handleError(_0x508887,null));};exports[_0x3cff('0x24')]=function(_0x4408cf,_0x3dd609){if(_0x4408cf[_0x3cff('0x45')]['id']){delete _0x4408cf[_0x3cff('0x45')]['id'];}return db['ZohoField'][_0x3cff('0x46')]({'where':{'id':_0x4408cf[_0x3cff('0x47')]['id']}})[_0x3cff('0x25')](handleEntityNotFound(_0x3dd609,null))[_0x3cff('0x25')](saveUpdates(_0x4408cf[_0x3cff('0x45')],null))[_0x3cff('0x25')](respondWithResult(_0x3dd609,null))[_0x3cff('0x42')](handleError(_0x3dd609,null));};exports[_0x3cff('0x26')]=function(_0x1dc0c7,_0x4103b1){return db[_0x3cff('0x2d')][_0x3cff('0x46')]({'where':{'id':_0x1dc0c7[_0x3cff('0x47')]['id']}})[_0x3cff('0x25')](handleEntityNotFound(_0x4103b1,null))[_0x3cff('0x25')](removeEntity(_0x4103b1,null))['catch'](handleError(_0x4103b1,null));};
\ No newline at end of file
index ae0f27c..dbf7d16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['rimraf','../../config/environment','exports','int_zoho_fields','zoho_unique_index','lodash','util','moment','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb016,0x159));var _0x6b01=function(_0x291d2f,_0x455c36){_0x291d2f=_0x291d2f-0x0;var _0x1edb52=_0xb016[_0x291d2f];return _0x1edb52;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b01('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b01('0x3'));var fs=require('fs');var path=require(_0x6b01('0x4'));var rimraf=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var attributes=require('./intZohoField.attributes');module[_0x6b01('0x7')]=function(_0x65407a,_0x192b2d){return _0x65407a['define']('ZohoField',attributes,{'tableName':_0x6b01('0x8'),'paranoid':![],'indexes':[{'name':_0x6b01('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fab=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','FieldId'];(function(_0x1abfac,_0x45ae54){var _0x2f97e6=function(_0xa0fce4){while(--_0xa0fce4){_0x1abfac['push'](_0x1abfac['shift']());}};_0x2f97e6(++_0x45ae54);}(_0x5fab,0x177));var _0xb5fa=function(_0x2bc326,_0x473cf8){_0x2bc326=_0x2bc326-0x0;var _0x43722e=_0x5fab[_0x2bc326];return _0x43722e;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['idField',_0xb5fa('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 62c284a..529260d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12e0=['http','info','ZohoField,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client'];(function(_0x3734f3,_0xaac919){var _0x3f977c=function(_0xacb62){while(--_0xacb62){_0x3734f3['push'](_0x3734f3['shift']());}};_0x3f977c(++_0xaac919);}(_0x12e0,0x172));var _0x012e=function(_0x24af90,_0x9b21a7){_0x24af90=_0x24af90-0x0;var _0x2f35cd=_0x12e0[_0x24af90];return _0x2f35cd;};'use strict';var _=require('lodash');var util=require(_0x012e('0x0'));var moment=require(_0x012e('0x1'));var BPromise=require(_0x012e('0x2'));var rs=require(_0x012e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x012e('0x4'))['db'];var utils=require(_0x012e('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x012e('0x6'));var client=jayson[_0x012e('0x7')][_0x012e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c6025,_0x1def14,_0x5480e8){return new BPromise(function(_0x5c230c,_0x14f92e){return client['request'](_0x1c6025,_0x5480e8)['then'](function(_0x554ce0){logger[_0x012e('0x9')](_0x012e('0xa'),_0x1def14,'request\x20sent');logger[_0x012e('0xb')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x1def14,_0x012e('0xc'),JSON['stringify'](_0x554ce0));if(_0x554ce0[_0x012e('0xd')]){if(_0x554ce0[_0x012e('0xd')][_0x012e('0xe')]===0x1f4){logger['error'](_0x012e('0xa'),_0x1def14,_0x554ce0[_0x012e('0xd')]['message']);return _0x14f92e(_0x554ce0['error'][_0x012e('0xf')]);}logger[_0x012e('0xd')](_0x012e('0xa'),_0x1def14,_0x554ce0[_0x012e('0xd')][_0x012e('0xf')]);return _0x5c230c(_0x554ce0[_0x012e('0xd')][_0x012e('0xf')]);}else{logger[_0x012e('0x9')](_0x012e('0xa'),_0x1def14,_0x012e('0xc'));_0x5c230c(_0x554ce0[_0x012e('0x10')]['message']);}})[_0x012e('0x11')](function(_0x5a584e){logger[_0x012e('0xd')](_0x012e('0xa'),_0x1def14,_0x5a584e);_0x14f92e(_0x5a584e);});});}
\ No newline at end of file
+var _0x11c6=['http','request','then','info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3a5d04,_0x25f98b){var _0x14d52d=function(_0x61e4cf){while(--_0x61e4cf){_0x3a5d04['push'](_0x3a5d04['shift']());}};_0x14d52d(++_0x25f98b);}(_0x11c6,0x84));var _0x611c=function(_0x508911,_0x231622){_0x508911=_0x508911-0x0;var _0x3ce3c0=_0x11c6[_0x508911];return _0x3ce3c0;};'use strict';var _=require(_0x611c('0x0'));var util=require(_0x611c('0x1'));var moment=require(_0x611c('0x2'));var BPromise=require(_0x611c('0x3'));var rs=require(_0x611c('0x4'));var fs=require('fs');var Redis=require(_0x611c('0x5'));var db=require(_0x611c('0x6'))['db'];var utils=require(_0x611c('0x7'));var logger=require(_0x611c('0x8'))('rpc');var config=require(_0x611c('0x9'));var jayson=require(_0x611c('0xa'));var client=jayson[_0x611c('0xb')][_0x611c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41ad6a,_0x4b81c2,_0x2cccd5){return new BPromise(function(_0x134679,_0x2b7817){return client[_0x611c('0xd')](_0x41ad6a,_0x2cccd5)[_0x611c('0xe')](function(_0x372931){logger[_0x611c('0xf')](_0x611c('0x10'),_0x4b81c2,'request\x20sent');logger['debug'](_0x611c('0x11'),_0x4b81c2,_0x611c('0x12'),JSON[_0x611c('0x13')](_0x372931));if(_0x372931[_0x611c('0x14')]){if(_0x372931[_0x611c('0x14')][_0x611c('0x15')]===0x1f4){logger['error'](_0x611c('0x10'),_0x4b81c2,_0x372931[_0x611c('0x14')][_0x611c('0x16')]);return _0x2b7817(_0x372931[_0x611c('0x14')]['message']);}logger['error'](_0x611c('0x10'),_0x4b81c2,_0x372931['error'][_0x611c('0x16')]);return _0x134679(_0x372931[_0x611c('0x14')][_0x611c('0x16')]);}else{logger[_0x611c('0xf')](_0x611c('0x10'),_0x4b81c2,_0x611c('0x12'));_0x134679(_0x372931['result'][_0x611c('0x16')]);}})[_0x611c('0x17')](function(_0x34e52c){logger['error'](_0x611c('0x10'),_0x4b81c2,_0x34e52c);_0x2b7817(_0x34e52c);});});}
\ No newline at end of file
index bd0fa2a..cebf208 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x24ac73,_0x3423d7){var _0x4a7082=function(_0x4057e1){while(--_0x4057e1){_0x24ac73['push'](_0x24ac73['shift']());}};_0x4a7082(++_0x3423d7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x19fe0b,_0x4ffd05){var _0xc7180d=function(_0x22c9d0){while(--_0x22c9d0){_0x19fe0b['push'](_0x19fe0b['shift']());}};_0xc7180d(++_0x4ffd05);}(_0xedd9,0xfc));var _0x9edd=function(_0x3bda58,_0x25bd78){_0x3bda58=_0x3bda58-0x0;var _0x1a7bf8=_0xedd9[_0x3bda58];return _0x1a7bf8;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
index f92494f..61d4060 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83cd=['BOOLEAN','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x4cfec2,_0x3749a9){var _0x437d79=function(_0x44ec40){while(--_0x44ec40){_0x4cfec2['push'](_0x4cfec2['shift']());}};_0x437d79(++_0x3749a9);}(_0x83cd,0x17b));var _0xd83c=function(_0x157685,_0x4988d5){_0x157685=_0x157685-0x0;var _0x5d1042=_0x83cd[_0x157685];return _0x5d1042;};'use strict';var Sequelize=require(_0xd83c('0x0'));module[_0xd83c('0x1')]={'name':{'type':Sequelize[_0xd83c('0x2')],'allowNull':![],'unique':_0xd83c('0x3')},'version':{'type':Sequelize[_0xd83c('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xd83c('0x2')],'defaultValue':_0xd83c('0x4')},'filename':{'type':Sequelize[_0xd83c('0x2')]},'path':{'type':Sequelize[_0xd83c('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xd83c('0x5')]},'active':{'type':Sequelize[_0xd83c('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xd83c('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xd83c('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xd83c('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd83c('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
+var _0xc0ea=['unique_name_and_version','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xc0ea,0x12a));var _0xac0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0ea[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xac0e('0x0'));module[_0xac0e('0x1')]={'name':{'type':Sequelize[_0xac0e('0x2')],'allowNull':![],'unique':_0xac0e('0x3')},'version':{'type':Sequelize[_0xac0e('0x2')],'allowNull':![],'unique':_0xac0e('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xac0e('0x2')]},'path':{'type':Sequelize[_0xac0e('0x2')]},'type':{'type':Sequelize[_0xac0e('0x2')]},'size':{'type':Sequelize[_0xac0e('0x4')]},'active':{'type':Sequelize[_0xac0e('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xac0e('0x2')]},'logo':{'type':Sequelize[_0xac0e('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0xac0e('0x6')},'description':{'type':Sequelize[_0xac0e('0x2')]},'title':{'type':Sequelize[_0xac0e('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xac0e('0x2')],'defaultValue':'#'}};
\ No newline at end of file
index 3d50194..8a8471f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c60=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','Integration','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x4c60,0xc1));var _0x04c6=function(_0x215b2d,_0x70c665){_0x215b2d=_0x215b2d-0x0;var _0x233292=_0x4c60[_0x215b2d];return _0x233292;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['Integration'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['Integration'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['Integration'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['Integration'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['Integration'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));};
\ No newline at end of file
+var _0x1261=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','Integration','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','create','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x1261,0x144));var _0x1126=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0x1261[_0x3ec333];return _0x15ccb8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['Integration'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['Integration']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')](_0x512f60['body'],{})[_0x1126('0x25')](respondWithResult(_0x5111d3,0xc9))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports['update']=function(_0x3e4eeb,_0xbdde58){if(_0x3e4eeb[_0x1126('0x44')]['id']){delete _0x3e4eeb['body']['id'];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x3e4eeb[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0xbdde58,null))[_0x1126('0x25')](saveUpdates(_0x3e4eeb[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0xbdde58,null))[_0x1126('0x43')](handleError(_0xbdde58,null));};exports['destroy']=function(_0x1b8b83,_0x5a2287){return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x1b8b83['params']['id']}})['then'](handleEntityNotFound(_0x5a2287,null))[_0x1126('0x25')](removeEntity(_0x5a2287,null))[_0x1126('0x43')](handleError(_0x5a2287,null));};
\ No newline at end of file
index 0d9083d..9c833b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2969=['request-promise','path','rimraf','./integration.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1b1c02,_0x355676){var _0x4284d9=function(_0x4ab076){while(--_0x4ab076){_0x1b1c02['push'](_0x1b1c02['shift']());}};_0x4284d9(++_0x355676);}(_0x2969,0xf8));var _0x9296=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2969[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9296('0x0'));var util=require(_0x9296('0x1'));var logger=require(_0x9296('0x2'))('api');var moment=require(_0x9296('0x3'));var BPromise=require(_0x9296('0x4'));var rp=require(_0x9296('0x5'));var fs=require('fs');var path=require(_0x9296('0x6'));var rimraf=require(_0x9296('0x7'));var config=require('../../config/environment');var attributes=require(_0x9296('0x8'));module[_0x9296('0x9')]=function(_0xd64047,_0x486f2d){return _0xd64047[_0x9296('0xa')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ae2=['bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','Integration','integrations','util','api','moment'];(function(_0x493fea,_0x20646b){var _0x9e47a3=function(_0x1a1b7e){while(--_0x1a1b7e){_0x493fea['push'](_0x493fea['shift']());}};_0x9e47a3(++_0x20646b);}(_0x0ae2,0x171));var _0x20ae=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x0ae2[_0x397cfb];return _0x15fed9;};'use strict';var _=require('lodash');var util=require(_0x20ae('0x0'));var logger=require('../../config/logger')(_0x20ae('0x1'));var moment=require(_0x20ae('0x2'));var BPromise=require(_0x20ae('0x3'));var rp=require(_0x20ae('0x4'));var fs=require('fs');var path=require(_0x20ae('0x5'));var rimraf=require(_0x20ae('0x6'));var config=require(_0x20ae('0x7'));var attributes=require(_0x20ae('0x8'));module[_0x20ae('0x9')]=function(_0x569771,_0x4e1425){return _0x569771['define'](_0x20ae('0xa'),attributes,{'tableName':_0x20ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a4ce353..1960261 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','debug'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0x0b0e[_0x18cac4];return _0x2227c6;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Integration,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});}
\ No newline at end of file
+var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x69188b,_0x550923){var _0x3320f4=function(_0x27d05b){while(--_0x27d05b){_0x69188b['push'](_0x69188b['shift']());}};_0x3320f4(++_0x550923);}(_0xda2d,0x102));var _0xdda2=function(_0x24031f,_0x119eb6){_0x24031f=_0x24031f-0x0;var _0x200ee4=_0xda2d[_0x24031f];return _0x200ee4;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Integration,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});}
\ No newline at end of file
index 93587ab..fa260f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x545a3a,_0x3123aa){var _0x5a5493=function(_0x4e6bce){while(--_0x4e6bce){_0x545a3a['push'](_0x545a3a['shift']());}};_0x5a5493(++_0x3123aa);}(_0x9f0e,0x116));var _0xe9f0=function(_0x336854,_0x54c19a){_0x336854=_0x336854-0x0;var _0x421d70=_0x9f0e[_0x336854];return _0x421d70;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x0b0e=['get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller'];(function(_0x58a992,_0x29a806){var _0x3f85ed=function(_0x1bb730){while(--_0x1bb730){_0x58a992['push'](_0x58a992['shift']());}};_0x3f85ed(++_0x29a806);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4ce1b9,_0x397a4b){_0x4ce1b9=_0x4ce1b9-0x0;var _0x2bb15d=_0x0b0e[_0x4ce1b9];return _0x2bb15d;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0xe')]('/',auth[_0xe0b0('0xa')](),controller['create']);router[_0xe0b0('0xf')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);module[_0xe0b0('0x13')]=router;
\ No newline at end of file
index 6215d62..d58111d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0329=['FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x0329,0xd3));var _0x9032=function(_0x1235a8,_0x2db48e){_0x1235a8=_0x1235a8-0x0;var _0x41a2cf=_0x0329[_0x1235a8];return _0x41a2cf;};'use strict';var Sequelize=require('sequelize');module[_0x9032('0x0')]={'integration':{'type':Sequelize[_0x9032('0x1')]},'eventChannel':{'type':Sequelize[_0x9032('0x1')]},'exitStatus':{'type':Sequelize[_0x9032('0x1')]},'ticketId':{'type':Sequelize[_0x9032('0x1')]},'integrationId':{'type':Sequelize[_0x9032('0x2')]},'contacts':{'type':Sequelize[_0x9032('0x1')]},'uniqueid':{'type':Sequelize[_0x9032('0x1')]},'calleridnum':{'type':Sequelize[_0x9032('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x9032('0x1')]},'membername':{'type':Sequelize[_0x9032('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x9032('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x9032('0x3')]},'talktime':{'type':Sequelize[_0x9032('0x2')]},'agentacw':{'type':Sequelize[_0x9032('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x9032('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x9032('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x9032('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x9032('0x3')]},'lastevent':{'type':Sequelize[_0x9032('0x1')]},'channel':{'type':Sequelize[_0x9032('0x1')]},'channelstate':{'type':Sequelize[_0x9032('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9032('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9032('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9032('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9032('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x9032('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9032('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x9032('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9032('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9032('0x1')]},'destuniqueid':{'type':Sequelize[_0x9032('0x1')]},'messageId':{'type':Sequelize[_0x9032('0x1')]},'inReplyTo':{'type':Sequelize[_0x9032('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x9032('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x9032('0x5')]},'text':{'type':Sequelize[_0x9032('0x5')]},'status':{'type':Sequelize[_0x9032('0x6')](_0x9032('0x7'),_0x9032('0x8'),'RECEIVED',_0x9032('0x9'))},'url':{'type':Sequelize[_0x9032('0x1')]},'app':{'type':Sequelize[_0x9032('0x1')]},'appdata':{'type':Sequelize[_0x9032('0x1')]},'projectId':{'type':Sequelize[_0x9032('0x2')]}};
\ No newline at end of file
+var _0x92a1=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports'];(function(_0x4a7fc0,_0x59b818){var _0x41f0e0=function(_0x3e4486){while(--_0x3e4486){_0x4a7fc0['push'](_0x4a7fc0['shift']());}};_0x41f0e0(++_0x59b818);}(_0x92a1,0x1de));var _0x192a=function(_0xbd2432,_0xe2e3cc){_0xbd2432=_0xbd2432-0x0;var _0x4fb3e7=_0x92a1[_0xbd2432];return _0x4fb3e7;};'use strict';var Sequelize=require(_0x192a('0x0'));module[_0x192a('0x1')]={'integration':{'type':Sequelize[_0x192a('0x2')]},'eventChannel':{'type':Sequelize[_0x192a('0x2')]},'exitStatus':{'type':Sequelize[_0x192a('0x2')]},'ticketId':{'type':Sequelize[_0x192a('0x2')]},'integrationId':{'type':Sequelize[_0x192a('0x3')]},'contacts':{'type':Sequelize[_0x192a('0x2')]},'uniqueid':{'type':Sequelize[_0x192a('0x2')]},'calleridnum':{'type':Sequelize[_0x192a('0x2')]},'calleridname':{'type':Sequelize[_0x192a('0x2')]},'queue':{'type':Sequelize[_0x192a('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x192a('0x2')]},'agentcalledAt':{'type':Sequelize[_0x192a('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x192a('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x192a('0x4')]},'talktime':{'type':Sequelize[_0x192a('0x3')]},'agentacw':{'type':Sequelize[_0x192a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x192a('0x3')]},'reason':{'type':Sequelize[_0x192a('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x192a('0x4')]},'lastevent':{'type':Sequelize[_0x192a('0x2')]},'channel':{'type':Sequelize[_0x192a('0x2')]},'channelstate':{'type':Sequelize[_0x192a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x192a('0x2')]},'connectedlinenum':{'type':Sequelize[_0x192a('0x2')]},'connectedlinename':{'type':Sequelize[_0x192a('0x2')]},'language':{'type':Sequelize[_0x192a('0x2')]},'accountcode':{'type':Sequelize[_0x192a('0x2')]},'context':{'type':Sequelize[_0x192a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x192a('0x2')]},'destchannel':{'type':Sequelize[_0x192a('0x2')]},'destchannelstate':{'type':Sequelize[_0x192a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x192a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x192a('0x2')]},'destcalleridname':{'type':Sequelize[_0x192a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x192a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x192a('0x2')]},'destlanguage':{'type':Sequelize[_0x192a('0x2')]},'destaccountcode':{'type':Sequelize[_0x192a('0x2')]},'destcontext':{'type':Sequelize[_0x192a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x192a('0x2')]},'destuniqueid':{'type':Sequelize[_0x192a('0x2')]},'messageId':{'type':Sequelize[_0x192a('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x192a('0x2')]},'from':{'type':Sequelize[_0x192a('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x192a('0x2')]},'attachment':{'type':Sequelize[_0x192a('0x6')]},'html':{'type':Sequelize[_0x192a('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x192a('0x7')](_0x192a('0x8'),_0x192a('0x9'),_0x192a('0xa'),_0x192a('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x192a('0x2')]},'appdata':{'type':Sequelize[_0x192a('0x2')]},'projectId':{'type':Sequelize[_0x192a('0x3')]}};
\ No newline at end of file
index 38805f8..e2dc97e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x817a=['query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','IntegrationReport','includeAll','include','findAll','rows','show','intersection','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../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','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0xb6861e,_0x41f161){var _0x4e5910=function(_0x2b0edc){while(--_0x2b0edc){_0xb6861e['push'](_0xb6861e['shift']());}};_0x4e5910(++_0x41f161);}(_0x817a,0x68));var _0xa817=function(_0x28f5d4,_0xd9f3ae){_0x28f5d4=_0x28f5d4-0x0;var _0xea3ec4=_0x817a[_0x28f5d4];return _0xea3ec4;};'use strict';var emlformat=require(_0xa817('0x0'));var rimraf=require(_0xa817('0x1'));var zipdir=require(_0xa817('0x2'));var jsonpatch=require(_0xa817('0x3'));var rp=require(_0xa817('0x4'));var moment=require(_0xa817('0x5'));var BPromise=require(_0xa817('0x6'));var Mustache=require(_0xa817('0x7'));var util=require(_0xa817('0x8'));var path=require('path');var sox=require(_0xa817('0x9'));var csv=require(_0xa817('0xa'));var ejs=require(_0xa817('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa817('0xc'));var crypto=require(_0xa817('0xd'));var jsforce=require(_0xa817('0xe'));var deskjs=require(_0xa817('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa817('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa817('0x11'));var as=require(_0xa817('0x12'));var hardwareService=require(_0xa817('0x13'));var logger=require(_0xa817('0x14'))(_0xa817('0x15'));var utils=require('../../config/utils');var config=require(_0xa817('0x16'));var licenseUtil=require(_0xa817('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x318af1,_0x4cc8e7){_0x4cc8e7=_0x4cc8e7||0xcc;return function(_0x4b483b){if(_0x4b483b){return _0x318af1[_0xa817('0x18')](_0x4cc8e7);}return _0x318af1[_0xa817('0x19')](_0x4cc8e7)[_0xa817('0x1a')]();};}function respondWithResult(_0x3d0544,_0x24b03b){_0x24b03b=_0x24b03b||0xc8;return function(_0x583aa3){if(_0x583aa3){return _0x3d0544[_0xa817('0x19')](_0x24b03b)[_0xa817('0x1b')](_0x583aa3);}};}function respondWithFilteredResult(_0x478521,_0x4dbbe0){return function(_0x41b2bf){if(_0x41b2bf){var _0xa54d90=typeof _0x4dbbe0[_0xa817('0x1c')]===_0xa817('0x1d')&&typeof _0x4dbbe0['limit']===_0xa817('0x1d');var _0x47654f=_0x41b2bf['count'];var _0x142546=_0xa54d90?0x0:_0x4dbbe0[_0xa817('0x1c')];var _0x2b7a14=_0xa54d90?_0x41b2bf[_0xa817('0x1e')]:_0x4dbbe0[_0xa817('0x1c')]+_0x4dbbe0[_0xa817('0x1f')];var _0x2e7c99;if(_0x2b7a14>=_0x47654f){_0x2b7a14=_0x47654f;_0x2e7c99=0xc8;}else{_0x2e7c99=0xce;}_0x478521[_0xa817('0x19')](_0x2e7c99);return _0x478521[_0xa817('0x20')](_0xa817('0x21'),_0x142546+'-'+_0x2b7a14+'/'+_0x47654f)[_0xa817('0x1b')](_0x41b2bf);}return null;};}function patchUpdates(_0x4f624){return function(_0x41147b){try{jsonpatch[_0xa817('0x22')](_0x41147b,_0x4f624,!![]);}catch(_0x6af824){return BPromise[_0xa817('0x23')](_0x6af824);}return _0x41147b[_0xa817('0x24')]();};}function saveUpdates(_0x5a3383,_0x2c93b2){return function(_0x1cacd0){if(_0x1cacd0){return _0x1cacd0[_0xa817('0x25')](_0x5a3383)[_0xa817('0x26')](function(_0x444e62){return _0x444e62;});}return null;};}function removeEntity(_0x2042fd,_0xf67ec6){return function(_0x796e8c){if(_0x796e8c){return _0x796e8c['destroy']()['then'](function(){_0x2042fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5930bb,_0x5ea791){return function(_0x2f4be4){if(!_0x2f4be4){_0x5930bb[_0xa817('0x18')](0x194);}return _0x2f4be4;};}function handleError(_0x3e6d4e,_0x5a5d31){_0x5a5d31=_0x5a5d31||0x1f4;return function(_0x3d12f8){logger[_0xa817('0x27')](_0x3d12f8[_0xa817('0x28')]);if(_0x3d12f8['name']){delete _0x3d12f8[_0xa817('0x29')];}_0x3e6d4e[_0xa817('0x19')](_0x5a5d31)[_0xa817('0x2a')](_0x3d12f8);};}exports[_0xa817('0x2b')]=function(_0xf50f86,_0x4c64ba){var _0x345246={},_0x407294={},_0x22cf90={'count':0x0,'rows':[]};var _0x37cd8d=_[_0xa817('0x2c')](db['IntegrationReport'][_0xa817('0x2d')],function(_0x1ce815){return{'name':_0x1ce815[_0xa817('0x2e')],'type':_0x1ce815[_0xa817('0x2f')]['key']};});_0x407294['model']=_[_0xa817('0x2c')](_0x37cd8d,_0xa817('0x29'));_0x407294[_0xa817('0x30')]=_[_0xa817('0x31')](_0xf50f86['query']);_0x407294[_0xa817('0x32')]=_['intersection'](_0x407294[_0xa817('0x33')],_0x407294[_0xa817('0x30')]);_0x345246[_0xa817('0x34')]=_['intersection'](_0x407294['model'],qs[_0xa817('0x35')](_0xf50f86['query'][_0xa817('0x35')]));_0x345246[_0xa817('0x34')]=_0x345246[_0xa817('0x34')][_0xa817('0x36')]?_0x345246[_0xa817('0x34')]:_0x407294[_0xa817('0x33')];if(!_0xf50f86[_0xa817('0x30')][_0xa817('0x37')](_0xa817('0x38'))){_0x345246[_0xa817('0x1f')]=qs[_0xa817('0x1f')](_0xf50f86['query'][_0xa817('0x1f')]);_0x345246['offset']=qs[_0xa817('0x1c')](_0xf50f86[_0xa817('0x30')][_0xa817('0x1c')]);}_0x345246[_0xa817('0x39')]=qs[_0xa817('0x3a')](_0xf50f86[_0xa817('0x30')]['sort']);_0x345246[_0xa817('0x3b')]=qs[_0xa817('0x32')](_['pick'](_0xf50f86[_0xa817('0x30')],_0x407294[_0xa817('0x32')]),_0x37cd8d);if(_0xf50f86['query'][_0xa817('0x3c')]){_0x345246[_0xa817('0x3b')]=_[_0xa817('0x3d')](_0x345246['where'],{'$or':_['map'](_0x37cd8d,function(_0x160e20){if(_0x160e20[_0xa817('0x2f')]!==_0xa817('0x3e')){var _0x3219cf={};_0x3219cf[_0x160e20[_0xa817('0x29')]]={'$like':'%'+_0xf50f86[_0xa817('0x30')][_0xa817('0x3c')]+'%'};return _0x3219cf;}})});}_0x345246=_[_0xa817('0x3d')]({},_0x345246,_0xf50f86['options']);var _0x3ec307={'where':_0x345246['where']};return db[_0xa817('0x3f')]['count'](_0x3ec307)[_0xa817('0x26')](function(_0x34c34a){_0x22cf90[_0xa817('0x1e')]=_0x34c34a;if(_0xf50f86[_0xa817('0x30')][_0xa817('0x40')]){_0x345246[_0xa817('0x41')]=[{'all':!![]}];}return db[_0xa817('0x3f')][_0xa817('0x42')](_0x345246);})[_0xa817('0x26')](function(_0x33744e){_0x22cf90[_0xa817('0x43')]=_0x33744e;return _0x22cf90;})[_0xa817('0x26')](respondWithFilteredResult(_0x4c64ba,_0x345246))['catch'](handleError(_0x4c64ba,null));};exports[_0xa817('0x44')]=function(_0x51afed,_0x1930f9){var _0xaaa360={'raw':![],'where':{'id':_0x51afed['params']['id']}},_0x2bd689={};_0x2bd689['model']=_[_0xa817('0x31')](db['IntegrationReport'][_0xa817('0x2d')]);_0x2bd689[_0xa817('0x30')]=_[_0xa817('0x31')](_0x51afed[_0xa817('0x30')]);_0x2bd689[_0xa817('0x32')]=_[_0xa817('0x45')](_0x2bd689[_0xa817('0x33')],_0x2bd689[_0xa817('0x30')]);_0xaaa360[_0xa817('0x34')]=_[_0xa817('0x45')](_0x2bd689[_0xa817('0x33')],qs[_0xa817('0x35')](_0x51afed[_0xa817('0x30')][_0xa817('0x35')]));_0xaaa360[_0xa817('0x34')]=_0xaaa360[_0xa817('0x34')][_0xa817('0x36')]?_0xaaa360[_0xa817('0x34')]:_0x2bd689[_0xa817('0x33')];if(_0x51afed[_0xa817('0x30')]['includeAll']){_0xaaa360[_0xa817('0x41')]=[{'all':!![]}];}_0xaaa360=_[_0xa817('0x3d')]({},_0xaaa360,_0x51afed['options']);return db['IntegrationReport'][_0xa817('0x46')](_0xaaa360)['then'](handleEntityNotFound(_0x1930f9,null))[_0xa817('0x26')](respondWithResult(_0x1930f9,null))['catch'](handleError(_0x1930f9,null));};exports[_0xa817('0x47')]=function(_0xf172f6,_0x50f773){return db['IntegrationReport'][_0xa817('0x47')](_0xf172f6['body'],{})[_0xa817('0x26')](respondWithResult(_0x50f773,0xc9))[_0xa817('0x48')](handleError(_0x50f773,null));};exports[_0xa817('0x25')]=function(_0x2ae9a5,_0xe4bf04){if(_0x2ae9a5[_0xa817('0x49')]['id']){delete _0x2ae9a5[_0xa817('0x49')]['id'];}return db[_0xa817('0x3f')][_0xa817('0x46')]({'where':{'id':_0x2ae9a5[_0xa817('0x4a')]['id']}})['then'](handleEntityNotFound(_0xe4bf04,null))[_0xa817('0x26')](saveUpdates(_0x2ae9a5[_0xa817('0x49')],null))[_0xa817('0x26')](respondWithResult(_0xe4bf04,null))[_0xa817('0x48')](handleError(_0xe4bf04,null));};exports['destroy']=function(_0x1b6d4e,_0x11bcd9){return db[_0xa817('0x3f')][_0xa817('0x46')]({'where':{'id':_0x1b6d4e[_0xa817('0x4a')]['id']}})[_0xa817('0x26')](handleEntityNotFound(_0x11bcd9,null))['then'](removeEntity(_0x11bcd9,null))['catch'](handleError(_0x11bcd9,null));};exports[_0xa817('0x4b')]=function(_0x8172ab,_0x44adef){return db[_0xa817('0x3f')][_0xa817('0x4b')]()[_0xa817('0x26')](respondWithResult(_0x44adef,null))[_0xa817('0x48')](handleError(_0x44adef,null));};
\ No newline at end of file
+var _0xf5f0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','error','stack','name','send','map','IntegrationReport','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','then','findAll','rows','catch','params','rawAttributes','includeAll','include','find','create','body','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2d5aab,_0x546ecc){var _0x16bbfa=function(_0x490e0d){while(--_0x490e0d){_0x2d5aab['push'](_0x2d5aab['shift']());}};_0x16bbfa(++_0x546ecc);}(_0xf5f0,0x1d6));var _0x0f5f=function(_0x1a22da,_0x454373){_0x1a22da=_0x1a22da-0x0;var _0x226b3a=_0xf5f0[_0x1a22da];return _0x226b3a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0f5f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f5f('0x1'));var moment=require(_0x0f5f('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0f5f('0x3'));var path=require('path');var sox=require(_0x0f5f('0x4'));var csv=require(_0x0f5f('0x5'));var ejs=require(_0x0f5f('0x6'));var fs=require('fs');var fs_extra=require(_0x0f5f('0x7'));var _=require(_0x0f5f('0x8'));var squel=require(_0x0f5f('0x9'));var crypto=require(_0x0f5f('0xa'));var jsforce=require(_0x0f5f('0xb'));var deskjs=require(_0x0f5f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0f5f('0xd'));var Redis=require(_0x0f5f('0xe'));var authService=require(_0x0f5f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0f5f('0x10'));var hardwareService=require(_0x0f5f('0x11'));var logger=require(_0x0f5f('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x0f5f('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f5f('0x14'))['db'];function respondWithStatusCode(_0x228f6b,_0xf28508){_0xf28508=_0xf28508||0xcc;return function(_0x27a722){if(_0x27a722){return _0x228f6b[_0x0f5f('0x15')](_0xf28508);}return _0x228f6b[_0x0f5f('0x16')](_0xf28508)['end']();};}function respondWithResult(_0x59c2a4,_0x1ce9dd){_0x1ce9dd=_0x1ce9dd||0xc8;return function(_0x4d5931){if(_0x4d5931){return _0x59c2a4[_0x0f5f('0x16')](_0x1ce9dd)['json'](_0x4d5931);}};}function respondWithFilteredResult(_0x5a7a51,_0x114e74){return function(_0x262c36){if(_0x262c36){var _0x42bfbb=typeof _0x114e74[_0x0f5f('0x17')]===_0x0f5f('0x18')&&typeof _0x114e74['limit']===_0x0f5f('0x18');var _0x59ba77=_0x262c36[_0x0f5f('0x19')];var _0x4dc4a7=_0x42bfbb?0x0:_0x114e74[_0x0f5f('0x17')];var _0x1714ce=_0x42bfbb?_0x262c36[_0x0f5f('0x19')]:_0x114e74['offset']+_0x114e74[_0x0f5f('0x1a')];var _0x16705c;if(_0x1714ce>=_0x59ba77){_0x1714ce=_0x59ba77;_0x16705c=0xc8;}else{_0x16705c=0xce;}_0x5a7a51[_0x0f5f('0x16')](_0x16705c);return _0x5a7a51[_0x0f5f('0x1b')](_0x0f5f('0x1c'),_0x4dc4a7+'-'+_0x1714ce+'/'+_0x59ba77)[_0x0f5f('0x1d')](_0x262c36);}return null;};}function patchUpdates(_0x479bb6){return function(_0xcde4d4){try{jsonpatch['apply'](_0xcde4d4,_0x479bb6,!![]);}catch(_0x5bf33a){return BPromise[_0x0f5f('0x1e')](_0x5bf33a);}return _0xcde4d4[_0x0f5f('0x1f')]();};}function saveUpdates(_0x2e3451,_0xed55c0){return function(_0x327b96){if(_0x327b96){return _0x327b96[_0x0f5f('0x20')](_0x2e3451)['then'](function(_0x3832f7){return _0x3832f7;});}return null;};}function removeEntity(_0x510205,_0xab0a91){return function(_0x5d624a){if(_0x5d624a){return _0x5d624a[_0x0f5f('0x21')]()['then'](function(){_0x510205[_0x0f5f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20cdbe,_0x3fb16a){return function(_0x3a8195){if(!_0x3a8195){_0x20cdbe[_0x0f5f('0x15')](0x194);}return _0x3a8195;};}function handleError(_0x5291f6,_0xb63ea6){_0xb63ea6=_0xb63ea6||0x1f4;return function(_0x5a7b77){logger[_0x0f5f('0x22')](_0x5a7b77[_0x0f5f('0x23')]);if(_0x5a7b77[_0x0f5f('0x24')]){delete _0x5a7b77[_0x0f5f('0x24')];}_0x5291f6['status'](_0xb63ea6)[_0x0f5f('0x25')](_0x5a7b77);};}exports['index']=function(_0xacd740,_0xd78a73){var _0x48b2d8={},_0x2aafb9={},_0x84e20e={'count':0x0,'rows':[]};var _0x59b661=_[_0x0f5f('0x26')](db[_0x0f5f('0x27')]['rawAttributes'],function(_0x15abda){return{'name':_0x15abda[_0x0f5f('0x28')],'type':_0x15abda['type']['key']};});_0x2aafb9['model']=_[_0x0f5f('0x26')](_0x59b661,_0x0f5f('0x24'));_0x2aafb9[_0x0f5f('0x29')]=_[_0x0f5f('0x2a')](_0xacd740[_0x0f5f('0x29')]);_0x2aafb9[_0x0f5f('0x2b')]=_[_0x0f5f('0x2c')](_0x2aafb9[_0x0f5f('0x2d')],_0x2aafb9[_0x0f5f('0x29')]);_0x48b2d8[_0x0f5f('0x2e')]=_[_0x0f5f('0x2c')](_0x2aafb9['model'],qs[_0x0f5f('0x2f')](_0xacd740[_0x0f5f('0x29')][_0x0f5f('0x2f')]));_0x48b2d8[_0x0f5f('0x2e')]=_0x48b2d8[_0x0f5f('0x2e')][_0x0f5f('0x30')]?_0x48b2d8[_0x0f5f('0x2e')]:_0x2aafb9[_0x0f5f('0x2d')];if(!_0xacd740['query'][_0x0f5f('0x31')]('nolimit')){_0x48b2d8[_0x0f5f('0x1a')]=qs[_0x0f5f('0x1a')](_0xacd740['query']['limit']);_0x48b2d8[_0x0f5f('0x17')]=qs[_0x0f5f('0x17')](_0xacd740[_0x0f5f('0x29')]['offset']);}_0x48b2d8[_0x0f5f('0x32')]=qs[_0x0f5f('0x33')](_0xacd740[_0x0f5f('0x29')][_0x0f5f('0x33')]);_0x48b2d8['where']=qs[_0x0f5f('0x2b')](_[_0x0f5f('0x34')](_0xacd740['query'],_0x2aafb9[_0x0f5f('0x2b')]),_0x59b661);if(_0xacd740['query']['filter']){_0x48b2d8[_0x0f5f('0x35')]=_[_0x0f5f('0x36')](_0x48b2d8[_0x0f5f('0x35')],{'$or':_[_0x0f5f('0x26')](_0x59b661,function(_0x26397e){if(_0x26397e['type']!==_0x0f5f('0x37')){var _0x2c21bc={};_0x2c21bc[_0x26397e[_0x0f5f('0x24')]]={'$like':'%'+_0xacd740[_0x0f5f('0x29')][_0x0f5f('0x38')]+'%'};return _0x2c21bc;}})});}_0x48b2d8=_[_0x0f5f('0x36')]({},_0x48b2d8,_0xacd740[_0x0f5f('0x39')]);var _0x5d6de2={'where':_0x48b2d8[_0x0f5f('0x35')]};return db[_0x0f5f('0x27')]['count'](_0x5d6de2)[_0x0f5f('0x3a')](function(_0x52d0c8){_0x84e20e['count']=_0x52d0c8;if(_0xacd740['query']['includeAll']){_0x48b2d8['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x0f5f('0x3b')](_0x48b2d8);})[_0x0f5f('0x3a')](function(_0x2c1c5f){_0x84e20e[_0x0f5f('0x3c')]=_0x2c1c5f;return _0x84e20e;})[_0x0f5f('0x3a')](respondWithFilteredResult(_0xd78a73,_0x48b2d8))[_0x0f5f('0x3d')](handleError(_0xd78a73,null));};exports['show']=function(_0x35e933,_0x231d6d){var _0x5e3147={'raw':![],'where':{'id':_0x35e933[_0x0f5f('0x3e')]['id']}},_0x36c9e5={};_0x36c9e5[_0x0f5f('0x2d')]=_[_0x0f5f('0x2a')](db[_0x0f5f('0x27')][_0x0f5f('0x3f')]);_0x36c9e5[_0x0f5f('0x29')]=_[_0x0f5f('0x2a')](_0x35e933['query']);_0x36c9e5[_0x0f5f('0x2b')]=_[_0x0f5f('0x2c')](_0x36c9e5[_0x0f5f('0x2d')],_0x36c9e5['query']);_0x5e3147[_0x0f5f('0x2e')]=_[_0x0f5f('0x2c')](_0x36c9e5[_0x0f5f('0x2d')],qs['fields'](_0x35e933[_0x0f5f('0x29')]['fields']));_0x5e3147[_0x0f5f('0x2e')]=_0x5e3147[_0x0f5f('0x2e')]['length']?_0x5e3147[_0x0f5f('0x2e')]:_0x36c9e5['model'];if(_0x35e933[_0x0f5f('0x29')][_0x0f5f('0x40')]){_0x5e3147[_0x0f5f('0x41')]=[{'all':!![]}];}_0x5e3147=_[_0x0f5f('0x36')]({},_0x5e3147,_0x35e933[_0x0f5f('0x39')]);return db[_0x0f5f('0x27')][_0x0f5f('0x42')](_0x5e3147)[_0x0f5f('0x3a')](handleEntityNotFound(_0x231d6d,null))[_0x0f5f('0x3a')](respondWithResult(_0x231d6d,null))[_0x0f5f('0x3d')](handleError(_0x231d6d,null));};exports['create']=function(_0x2f1781,_0x590800){return db[_0x0f5f('0x27')][_0x0f5f('0x43')](_0x2f1781[_0x0f5f('0x44')],{})[_0x0f5f('0x3a')](respondWithResult(_0x590800,0xc9))[_0x0f5f('0x3d')](handleError(_0x590800,null));};exports['update']=function(_0x54cfdc,_0x723d31){if(_0x54cfdc[_0x0f5f('0x44')]['id']){delete _0x54cfdc[_0x0f5f('0x44')]['id'];}return db[_0x0f5f('0x27')][_0x0f5f('0x42')]({'where':{'id':_0x54cfdc[_0x0f5f('0x3e')]['id']}})[_0x0f5f('0x3a')](handleEntityNotFound(_0x723d31,null))[_0x0f5f('0x3a')](saveUpdates(_0x54cfdc[_0x0f5f('0x44')],null))['then'](respondWithResult(_0x723d31,null))[_0x0f5f('0x3d')](handleError(_0x723d31,null));};exports[_0x0f5f('0x21')]=function(_0xef293,_0x337b7f){return db[_0x0f5f('0x27')]['find']({'where':{'id':_0xef293['params']['id']}})[_0x0f5f('0x3a')](handleEntityNotFound(_0x337b7f,null))[_0x0f5f('0x3a')](removeEntity(_0x337b7f,null))['catch'](handleError(_0x337b7f,null));};exports['describe']=function(_0x2f7b78,_0x3be35c){return db[_0x0f5f('0x27')]['describe']()['then'](respondWithResult(_0x3be35c,null))[_0x0f5f('0x3d')](handleError(_0x3be35c,null));};
\ No newline at end of file
index 4fcc3f1..5aaa0a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0115=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash'];(function(_0x299d66,_0x29124d){var _0x59d564=function(_0x14a242){while(--_0x14a242){_0x299d66['push'](_0x299d66['shift']());}};_0x59d564(++_0x29124d);}(_0x0115,0x1c6));var _0x5011=function(_0xd91db0,_0x288c18){_0xd91db0=_0xd91db0-0x0;var _0x268487=_0x0115[_0xd91db0];return _0x268487;};'use strict';var _=require(_0x5011('0x0'));var util=require(_0x5011('0x1'));var logger=require(_0x5011('0x2'))(_0x5011('0x3'));var moment=require(_0x5011('0x4'));var BPromise=require('bluebird');var rp=require(_0x5011('0x5'));var fs=require('fs');var path=require(_0x5011('0x6'));var rimraf=require(_0x5011('0x7'));var config=require(_0x5011('0x8'));var attributes=require(_0x5011('0x9'));module[_0x5011('0xa')]=function(_0x5352e3,_0x8607db){return _0x5352e3[_0x5011('0xb')](_0x5011('0xc'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x62e8=['util','../../config/logger','api','bluebird','path','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x62e8,0x17c));var _0x862e=function(_0x1a122b,_0x199bef){_0x1a122b=_0x1a122b-0x0;var _0x267501=_0x62e8[_0x1a122b];return _0x267501;};'use strict';var _=require('lodash');var util=require(_0x862e('0x0'));var logger=require(_0x862e('0x1'))(_0x862e('0x2'));var moment=require('moment');var BPromise=require(_0x862e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x862e('0x4'));var rimraf=require('rimraf');var config=require(_0x862e('0x5'));var attributes=require(_0x862e('0x6'));module['exports']=function(_0x108f7a,_0x48d569){return _0x108f7a[_0x862e('0x7')](_0x862e('0x8'),attributes,{'tableName':_0x862e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d8828fc..06adbdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x452d6b,_0x3f053b){var _0x4b306d=function(_0x399296){while(--_0x399296){_0x452d6b['push'](_0x452d6b['shift']());}};_0x4b306d(++_0x3f053b);}(_0x4819,0xcd));var _0x9481=function(_0x1dad4f,_0x13b837){_0x1dad4f=_0x1dad4f-0x0;var _0x22468b=_0x4819[_0x1dad4f];return _0x22468b;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});}
\ No newline at end of file
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x53ec,0x192));var _0xc53e=function(_0x2ecbfd,_0x5bacbc){_0x2ecbfd=_0x2ecbfd-0x0;var _0x2c65a2=_0x53ec[_0x2ecbfd];return _0x2c65a2;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
index a47868b..802d667 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x553f=['addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./interval.controller','get','index','/:id','show','post','isAuthenticated'];(function(_0x6f6f18,_0x406aee){var _0x57c18c=function(_0x289369){while(--_0x289369){_0x6f6f18['push'](_0x6f6f18['shift']());}};_0x57c18c(++_0x406aee);}(_0x553f,0x1c0));var _0xf553=function(_0x2d357a,_0x3dc727){_0x2d357a=_0x2d357a-0x0;var _0x11935e=_0x553f[_0x2d357a];return _0x11935e;};'use strict';var multer=require(_0xf553('0x0'));var util=require(_0xf553('0x1'));var path=require(_0xf553('0x2'));var timeout=require(_0xf553('0x3'));var express=require(_0xf553('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf553('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf553('0x6'));var controller=require(_0xf553('0x7'));router[_0xf553('0x8')]('/',auth['isAuthenticated'](),controller[_0xf553('0x9')]);router[_0xf553('0x8')](_0xf553('0xa'),auth['isAuthenticated'](),controller[_0xf553('0xb')]);router[_0xf553('0x8')]('/:id/sub_intervals',auth['isAuthenticated'](),controller['getIntervals']);router[_0xf553('0xc')]('/',auth[_0xf553('0xd')](),controller['create']);router[_0xf553('0xc')]('/:id/sub_intervals',auth[_0xf553('0xd')](),controller[_0xf553('0xe')]);router['post'](_0xf553('0xf'),auth[_0xf553('0xd')](),controller[_0xf553('0x10')]);router[_0xf553('0x11')](_0xf553('0xa'),auth[_0xf553('0xd')](),controller[_0xf553('0x12')]);router[_0xf553('0x13')](_0xf553('0xa'),auth[_0xf553('0xd')](),controller['destroy']);module[_0xf553('0x14')]=router;
\ No newline at end of file
+var _0xc949=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete'];(function(_0x50f2dd,_0x5c0cd6){var _0x46e671=function(_0x10eef8){while(--_0x10eef8){_0x50f2dd['push'](_0x50f2dd['shift']());}};_0x46e671(++_0x5c0cd6);}(_0xc949,0x181));var _0x9c94=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xc949[_0x92c450];return _0x2a9599;};'use strict';var multer=require(_0x9c94('0x0'));var util=require('util');var path=require(_0x9c94('0x1'));var timeout=require(_0x9c94('0x2'));var express=require(_0x9c94('0x3'));var router=express[_0x9c94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c94('0x5'));var interaction=require(_0x9c94('0x6'));var config=require('../../config/environment');var controller=require(_0x9c94('0x7'));router[_0x9c94('0x8')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0xa')]);router['get'](_0x9c94('0xb'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xc')]);router[_0x9c94('0x8')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xe')]);router[_0x9c94('0xf')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0x10')]);router['post'](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x11')]);router[_0x9c94('0xf')](_0x9c94('0x12'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x13')]);router[_0x9c94('0x14')](_0x9c94('0xb'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x15')]);router[_0x9c94('0x16')](_0x9c94('0xb'),auth[_0x9c94('0x9')](),controller['destroy']);module[_0x9c94('0x17')]=router;
\ No newline at end of file
index 4c70933..c8b57d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a89=['STRING','sequelize','exports'];(function(_0x217372,_0x1822ce){var _0x2715a1=function(_0x5712db){while(--_0x5712db){_0x217372['push'](_0x217372['shift']());}};_0x2715a1(++_0x1822ce);}(_0x2a89,0x1c0));var _0x92a8=function(_0x1e2ab5,_0x132a15){_0x1e2ab5=_0x1e2ab5-0x0;var _0x25246c=_0x2a89[_0x1e2ab5];return _0x25246c;};'use strict';var Sequelize=require(_0x92a8('0x0'));module[_0x92a8('0x1')]={'name':{'type':Sequelize[_0x92a8('0x2')]},'description':{'type':Sequelize[_0x92a8('0x2')]},'interval':{'type':Sequelize[_0x92a8('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0x37f9=['exports','STRING','sequelize'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x37f9,0xe6));var _0x937f=function(_0x224aa6,_0x313213){_0x224aa6=_0x224aa6-0x0;var _0x313a61=_0x37f9[_0x224aa6];return _0x313a61;};'use strict';var Sequelize=require(_0x937f('0x0'));module[_0x937f('0x1')]={'name':{'type':Sequelize[_0x937f('0x2')]},'description':{'type':Sequelize[_0x937f('0x2')]},'interval':{'type':Sequelize[_0x937f('0x2')],'allowNull':!![]}};
\ No newline at end of file
index b50ff01..d7e7788 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ea3=['type','key','query','filters','intersection','model','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','params','keys','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','addIntervals','sequelize','transaction','bulkCreate','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Intervals','UserProfileResource','error','stack','name','send','map','Interval'];(function(_0x1afc35,_0x7184da){var _0x35b946=function(_0x116c03){while(--_0x116c03){_0x1afc35['push'](_0x1afc35['shift']());}};_0x35b946(++_0x7184da);}(_0x7ea3,0xd1));var _0x37ea=function(_0x12ca16,_0x281fd9){_0x12ca16=_0x12ca16-0x0;var _0x56fb78=_0x7ea3[_0x12ca16];return _0x56fb78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x37ea('0x0'));var zipdir=require(_0x37ea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x37ea('0x2'));var moment=require(_0x37ea('0x3'));var BPromise=require(_0x37ea('0x4'));var Mustache=require(_0x37ea('0x5'));var util=require('util');var path=require(_0x37ea('0x6'));var sox=require(_0x37ea('0x7'));var csv=require('to-csv');var ejs=require(_0x37ea('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x37ea('0x9'));var jsforce=require(_0x37ea('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x37ea('0xb'));var querystring=require(_0x37ea('0xc'));var Papa=require(_0x37ea('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x37ea('0xe'));var as=require(_0x37ea('0xf'));var hardwareService=require(_0x37ea('0x10'));var logger=require(_0x37ea('0x11'))(_0x37ea('0x12'));var utils=require(_0x37ea('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x37ea('0x14'))['db'];var extensions=require(_0x37ea('0x15'));function respondWithStatusCode(_0x4e6461,_0x580deb){_0x580deb=_0x580deb||0xcc;return function(_0x22d983){if(_0x22d983){return _0x4e6461[_0x37ea('0x16')](_0x580deb);}return _0x4e6461[_0x37ea('0x17')](_0x580deb)[_0x37ea('0x18')]();};}function respondWithResult(_0x25eaaf,_0x2bd3e9){_0x2bd3e9=_0x2bd3e9||0xc8;return function(_0xf77f49){if(_0xf77f49){return _0x25eaaf[_0x37ea('0x17')](_0x2bd3e9)[_0x37ea('0x19')](_0xf77f49);}};}function respondWithFilteredResult(_0x1a5575,_0x9ebb75){return function(_0x410dd1){if(_0x410dd1){var _0x28e821=typeof _0x9ebb75[_0x37ea('0x1a')]===_0x37ea('0x1b')&&typeof _0x9ebb75[_0x37ea('0x1c')]===_0x37ea('0x1b');var _0x3b6e32=_0x410dd1[_0x37ea('0x1d')];var _0x4c113b=_0x28e821?0x0:_0x9ebb75[_0x37ea('0x1a')];var _0x129ca3=_0x28e821?_0x410dd1[_0x37ea('0x1d')]:_0x9ebb75[_0x37ea('0x1a')]+_0x9ebb75[_0x37ea('0x1c')];var _0x6b2b5b;if(_0x129ca3>=_0x3b6e32){_0x129ca3=_0x3b6e32;_0x6b2b5b=0xc8;}else{_0x6b2b5b=0xce;}_0x1a5575[_0x37ea('0x17')](_0x6b2b5b);return _0x1a5575[_0x37ea('0x1e')](_0x37ea('0x1f'),_0x4c113b+'-'+_0x129ca3+'/'+_0x3b6e32)[_0x37ea('0x19')](_0x410dd1);}return null;};}function patchUpdates(_0x6a4f60){return function(_0xe2fae6){try{jsonpatch[_0x37ea('0x20')](_0xe2fae6,_0x6a4f60,!![]);}catch(_0x7b1cd){return BPromise['reject'](_0x7b1cd);}return _0xe2fae6[_0x37ea('0x21')]();};}function saveUpdates(_0x440f60,_0x42cc4c){return function(_0x17dae3){if(_0x17dae3){return _0x17dae3[_0x37ea('0x22')](_0x440f60)['then'](function(_0x3fcb7a){return _0x3fcb7a;});}return null;};}function removeEntity(_0x1996ec,_0x59af00){return function(_0x584da2){if(_0x584da2){return _0x584da2[_0x37ea('0x23')]()[_0x37ea('0x24')](function(){var _0xe2a737=_0x584da2[_0x37ea('0x25')]({'plain':!![]});var _0x1c2d1f=_0x37ea('0x26');return db[_0x37ea('0x27')][_0x37ea('0x23')]({'where':{'type':_0x1c2d1f,'resourceId':_0xe2a737['id']}})[_0x37ea('0x24')](function(){return _0x584da2;});})[_0x37ea('0x24')](function(){_0x1996ec[_0x37ea('0x17')](0xcc)[_0x37ea('0x18')]();});}};}function handleEntityNotFound(_0x31c09f,_0x16355a){return function(_0x49befd){if(!_0x49befd){_0x31c09f['sendStatus'](0x194);}return _0x49befd;};}function handleError(_0x3b12da,_0x4e7709){_0x4e7709=_0x4e7709||0x1f4;return function(_0x373695){logger[_0x37ea('0x28')](_0x373695[_0x37ea('0x29')]);if(_0x373695[_0x37ea('0x2a')]){delete _0x373695[_0x37ea('0x2a')];}_0x3b12da[_0x37ea('0x17')](_0x4e7709)[_0x37ea('0x2b')](_0x373695);};}exports['index']=function(_0x188de9,_0x14b65b){var _0x249439={},_0x25e811={},_0x3d7eec={'count':0x0,'rows':[]};var _0x4e88f9=_[_0x37ea('0x2c')](db[_0x37ea('0x2d')]['rawAttributes'],function(_0x33ba25){return{'name':_0x33ba25['fieldName'],'type':_0x33ba25[_0x37ea('0x2e')][_0x37ea('0x2f')]};});_0x25e811['model']=_[_0x37ea('0x2c')](_0x4e88f9,_0x37ea('0x2a'));_0x25e811[_0x37ea('0x30')]=_['keys'](_0x188de9[_0x37ea('0x30')]);_0x25e811[_0x37ea('0x31')]=_[_0x37ea('0x32')](_0x25e811[_0x37ea('0x33')],_0x25e811[_0x37ea('0x30')]);_0x249439[_0x37ea('0x34')]=_[_0x37ea('0x32')](_0x25e811['model'],qs[_0x37ea('0x35')](_0x188de9[_0x37ea('0x30')]['fields']));_0x249439['attributes']=_0x249439[_0x37ea('0x34')][_0x37ea('0x36')]?_0x249439[_0x37ea('0x34')]:_0x25e811['model'];if(!_0x188de9[_0x37ea('0x30')]['hasOwnProperty']('nolimit')){_0x249439['limit']=qs[_0x37ea('0x1c')](_0x188de9['query']['limit']);_0x249439['offset']=qs[_0x37ea('0x1a')](_0x188de9[_0x37ea('0x30')][_0x37ea('0x1a')]);}_0x249439['order']=qs['sort'](_0x188de9[_0x37ea('0x30')][_0x37ea('0x37')]);_0x249439['where']=qs['filters'](_[_0x37ea('0x38')](_0x188de9[_0x37ea('0x30')],_0x25e811[_0x37ea('0x31')]),_0x4e88f9);if(_0x188de9[_0x37ea('0x30')][_0x37ea('0x39')]){_0x249439[_0x37ea('0x3a')]=_[_0x37ea('0x3b')](_0x249439[_0x37ea('0x3a')],{'$or':_[_0x37ea('0x2c')](_0x4e88f9,function(_0x5ea83a){if(_0x5ea83a[_0x37ea('0x2e')]!==_0x37ea('0x3c')){var _0x183280={};_0x183280[_0x5ea83a[_0x37ea('0x2a')]]={'$like':'%'+_0x188de9[_0x37ea('0x30')][_0x37ea('0x39')]+'%'};return _0x183280;}})});}_0x249439=_[_0x37ea('0x3b')]({},_0x249439,_0x188de9[_0x37ea('0x3d')]);var _0x14b8dc={'where':_0x249439[_0x37ea('0x3a')]};return db[_0x37ea('0x2d')][_0x37ea('0x1d')](_0x14b8dc)[_0x37ea('0x24')](function(_0x29d4fd){_0x3d7eec[_0x37ea('0x1d')]=_0x29d4fd;if(_0x188de9[_0x37ea('0x30')][_0x37ea('0x3e')]){_0x249439[_0x37ea('0x3f')]=[{'all':!![]}];}return db[_0x37ea('0x2d')]['findAll'](_0x249439);})[_0x37ea('0x24')](function(_0x2bc380){_0x3d7eec['rows']=_0x2bc380;return _0x3d7eec;})[_0x37ea('0x24')](respondWithFilteredResult(_0x14b65b,_0x249439))[_0x37ea('0x40')](handleError(_0x14b65b,null));};exports['show']=function(_0x12b851,_0x3e3469){var _0x563f1a={'raw':!![],'where':{'id':_0x12b851[_0x37ea('0x41')]['id']}},_0x314a29={};_0x314a29[_0x37ea('0x33')]=_[_0x37ea('0x42')](db['Interval'][_0x37ea('0x43')]);_0x314a29[_0x37ea('0x30')]=_[_0x37ea('0x42')](_0x12b851['query']);_0x314a29[_0x37ea('0x31')]=_[_0x37ea('0x32')](_0x314a29['model'],_0x314a29['query']);_0x563f1a['attributes']=_[_0x37ea('0x32')](_0x314a29[_0x37ea('0x33')],qs[_0x37ea('0x35')](_0x12b851['query'][_0x37ea('0x35')]));_0x563f1a[_0x37ea('0x34')]=_0x563f1a['attributes']['length']?_0x563f1a[_0x37ea('0x34')]:_0x314a29[_0x37ea('0x33')];if(_0x12b851[_0x37ea('0x30')][_0x37ea('0x3e')]){_0x563f1a[_0x37ea('0x3f')]=[{'all':!![]}];}_0x563f1a=_['merge']({},_0x563f1a,_0x12b851[_0x37ea('0x3d')]);return db[_0x37ea('0x2d')][_0x37ea('0x44')](_0x563f1a)['then'](handleEntityNotFound(_0x3e3469,null))[_0x37ea('0x24')](respondWithResult(_0x3e3469,null))['catch'](handleError(_0x3e3469,null));};exports['create']=function(_0x435738,_0x4f81ae){return db['Interval']['create'](_0x435738[_0x37ea('0x45')],{})[_0x37ea('0x24')](function(_0x469272){var _0x4e9ff3=_0x435738[_0x37ea('0x46')]['get']({'plain':!![]});if(!_0x4e9ff3)throw new Error(_0x37ea('0x47'));if(_0x4e9ff3[_0x37ea('0x48')]===_0x37ea('0x46')){var _0x1bf3aa=_0x469272[_0x37ea('0x25')]({'plain':!![]});var _0x2a4784='Intervals';return db[_0x37ea('0x49')][_0x37ea('0x44')]({'where':{'name':_0x2a4784,'userProfileId':_0x4e9ff3['userProfileId']},'raw':!![]})['then'](function(_0x33af71){if(_0x33af71&&_0x33af71['autoAssociation']===0x0){return db[_0x37ea('0x27')][_0x37ea('0x4a')]({'name':_0x1bf3aa['name'],'resourceId':_0x1bf3aa['id'],'type':_0x33af71[_0x37ea('0x2a')],'sectionId':_0x33af71['id']},{})[_0x37ea('0x24')](function(){return _0x469272;});}else{return _0x469272;}})[_0x37ea('0x40')](function(_0x50f83f){logger['error'](_0x37ea('0x4b'),_0x50f83f);throw _0x50f83f;});}return _0x469272;})[_0x37ea('0x24')](respondWithResult(_0x4f81ae,0xc9))[_0x37ea('0x40')](handleError(_0x4f81ae,null));};exports['update']=function(_0x359f12,_0x4e9643){if(_0x359f12['body']['id']){delete _0x359f12[_0x37ea('0x45')]['id'];}return db[_0x37ea('0x2d')][_0x37ea('0x44')]({'where':{'id':_0x359f12[_0x37ea('0x41')]['id']}})[_0x37ea('0x24')](handleEntityNotFound(_0x4e9643,null))['then'](saveUpdates(_0x359f12['body'],null))['then'](respondWithResult(_0x4e9643,null))[_0x37ea('0x40')](handleError(_0x4e9643,null));};exports[_0x37ea('0x23')]=function(_0x1d38b3,_0xda39b2){return db['Interval'][_0x37ea('0x44')]({'where':{'id':_0x1d38b3[_0x37ea('0x41')]['id']}})['then'](handleEntityNotFound(_0xda39b2,null))[_0x37ea('0x24')](removeEntity(_0xda39b2,null))[_0x37ea('0x40')](handleError(_0xda39b2,null));};exports[_0x37ea('0x4c')]=function(_0x2c6e4c,_0x1d53a0,_0x6e7a1){if(_0x2c6e4c[_0x37ea('0x45')]['id']){delete _0x2c6e4c[_0x37ea('0x45')]['id'];}return db[_0x37ea('0x2d')][_0x37ea('0x44')]({'where':{'id':_0x2c6e4c[_0x37ea('0x41')]['id']}})[_0x37ea('0x24')](handleEntityNotFound(_0x1d53a0,null))['then'](function(_0x39d79e){if(_0x39d79e){_0x2c6e4c['body'][_0x37ea('0x4d')]=_0x39d79e['id'];return db[_0x37ea('0x2d')][_0x37ea('0x4a')](_0x2c6e4c[_0x37ea('0x45')]);}})[_0x37ea('0x24')](respondWithResult(_0x1d53a0,null))[_0x37ea('0x40')](handleError(_0x1d53a0,null));};exports[_0x37ea('0x4e')]=function(_0x56c2d5,_0x141879,_0xf5c856){var _0x54ba67={};var _0x519cf1={};var _0x194c48;var _0x5b5b27;return db[_0x37ea('0x2d')][_0x37ea('0x4f')]({'where':{'id':_0x56c2d5[_0x37ea('0x41')]['id']}})[_0x37ea('0x24')](handleEntityNotFound(_0x141879,null))[_0x37ea('0x24')](function(_0x288de6){if(_0x288de6){_0x194c48=_0x288de6;_0x519cf1[_0x37ea('0x33')]=_[_0x37ea('0x42')](db[_0x37ea('0x2d')][_0x37ea('0x43')]);_0x519cf1['query']=_[_0x37ea('0x42')](_0x56c2d5['query']);_0x519cf1['filters']=_[_0x37ea('0x32')](_0x519cf1[_0x37ea('0x33')],_0x519cf1[_0x37ea('0x30')]);_0x54ba67['attributes']=_[_0x37ea('0x32')](_0x519cf1[_0x37ea('0x33')],qs['fields'](_0x56c2d5[_0x37ea('0x30')][_0x37ea('0x35')]));_0x54ba67[_0x37ea('0x34')]=_0x54ba67[_0x37ea('0x34')]['length']?_0x54ba67[_0x37ea('0x34')]:_0x519cf1['model'];_0x54ba67['order']=qs[_0x37ea('0x37')](_0x56c2d5[_0x37ea('0x30')][_0x37ea('0x37')]);_0x54ba67[_0x37ea('0x3a')]=qs[_0x37ea('0x31')](_[_0x37ea('0x38')](_0x56c2d5[_0x37ea('0x30')],_0x519cf1[_0x37ea('0x31')]));if(_0x56c2d5['query']['filter']){_0x54ba67['where']=_[_0x37ea('0x3b')](_0x54ba67[_0x37ea('0x3a')],{'$or':_[_0x37ea('0x2c')](_0x54ba67[_0x37ea('0x34')],function(_0x79411){var _0x1f9d14={};_0x1f9d14[_0x79411]={'$like':'%'+_0x56c2d5[_0x37ea('0x30')]['filter']+'%'};return _0x1f9d14;})});}_0x54ba67=_[_0x37ea('0x3b')]({},_0x54ba67,_0x56c2d5[_0x37ea('0x3d')]);return _0x194c48[_0x37ea('0x4e')](_0x54ba67);}})[_0x37ea('0x24')](function(_0x10bf2a){if(_0x10bf2a){_0x5b5b27=_0x10bf2a[_0x37ea('0x36')];if(!_0x56c2d5[_0x37ea('0x30')][_0x37ea('0x50')]('nolimit')){_0x54ba67[_0x37ea('0x1c')]=qs[_0x37ea('0x1c')](_0x56c2d5[_0x37ea('0x30')][_0x37ea('0x1c')]);_0x54ba67['offset']=qs['offset'](_0x56c2d5[_0x37ea('0x30')][_0x37ea('0x1a')]);}return _0x194c48[_0x37ea('0x4e')](_0x54ba67);}})[_0x37ea('0x24')](function(_0x355313){if(_0x355313){return _0x355313?{'count':_0x5b5b27,'rows':_0x355313}:null;}})['then'](respondWithResult(_0x141879,null))[_0x37ea('0x40')](handleError(_0x141879,null));};exports[_0x37ea('0x51')]=function(_0x42925,_0x266e9d,_0x41c8e2){return db['Interval'][_0x37ea('0x4f')]({'where':{'id':_0x42925['params']['id']}})[_0x37ea('0x24')](handleEntityNotFound(_0x266e9d,null))[_0x37ea('0x24')](function(_0x2d1045){if(_0x2d1045){return db[_0x37ea('0x52')][_0x37ea('0x53')](function(_0xf27b33){return db[_0x37ea('0x2d')][_0x37ea('0x23')]({'where':{'IntervalId':_0x42925[_0x37ea('0x41')]['id']},'transaction':_0xf27b33})[_0x37ea('0x24')](function(_0x19b737){var _0x231304=_[_0x37ea('0x2c')](_0x42925[_0x37ea('0x45')],function(_0x15ee32){delete _0x15ee32['id'];_0x15ee32['IntervalId']=_0x42925[_0x37ea('0x41')]['id'];return _0x15ee32;});return db[_0x37ea('0x2d')][_0x37ea('0x54')](_0x231304,{'transaction':_0xf27b33});});})[_0x37ea('0x24')](function(){return db[_0x37ea('0x2d')]['findAll']({'where':{'IntervalId':_0x42925['params']['id']}});});}})['then'](respondWithResult(_0x266e9d,null))[_0x37ea('0x40')](handleError(_0x266e9d,null));};
\ No newline at end of file
+var _0x3b32=['role','Intervals','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','hasOwnProperty','addIntervals','sequelize','IntervalId','bulkCreate','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','save','then','destroy','get','UserProfileResource','name','index','Interval','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x1115c8,_0x4ac713){var _0x33b172=function(_0x2d1658){while(--_0x2d1658){_0x1115c8['push'](_0x1115c8['shift']());}};_0x33b172(++_0x4ac713);}(_0x3b32,0xbe));var _0x23b3=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x3b32[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0x23b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x23b3('0x1'));var jsonpatch=require(_0x23b3('0x2'));var rp=require('request-promise');var moment=require(_0x23b3('0x3'));var BPromise=require(_0x23b3('0x4'));var Mustache=require(_0x23b3('0x5'));var util=require(_0x23b3('0x6'));var path=require('path');var sox=require(_0x23b3('0x7'));var csv=require(_0x23b3('0x8'));var ejs=require(_0x23b3('0x9'));var fs=require('fs');var fs_extra=require(_0x23b3('0xa'));var _=require(_0x23b3('0xb'));var squel=require(_0x23b3('0xc'));var crypto=require(_0x23b3('0xd'));var jsforce=require(_0x23b3('0xe'));var deskjs=require(_0x23b3('0xf'));var toCsv=require(_0x23b3('0x8'));var querystring=require(_0x23b3('0x10'));var Papa=require(_0x23b3('0x11'));var Redis=require(_0x23b3('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x23b3('0x13'))(_0x23b3('0x14'));var utils=require(_0x23b3('0x15'));var config=require(_0x23b3('0x16'));var licenseUtil=require(_0x23b3('0x17'));var db=require(_0x23b3('0x18'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x23f7f6,_0x4f98e0){_0x4f98e0=_0x4f98e0||0xcc;return function(_0x5300b0){if(_0x5300b0){return _0x23f7f6[_0x23b3('0x19')](_0x4f98e0);}return _0x23f7f6[_0x23b3('0x1a')](_0x4f98e0)[_0x23b3('0x1b')]();};}function respondWithResult(_0x5a52fd,_0x408bc3){_0x408bc3=_0x408bc3||0xc8;return function(_0x287d96){if(_0x287d96){return _0x5a52fd[_0x23b3('0x1a')](_0x408bc3)['json'](_0x287d96);}};}function respondWithFilteredResult(_0x1adbe9,_0x3eba99){return function(_0x12a284){if(_0x12a284){var _0x4eebee=typeof _0x3eba99[_0x23b3('0x1c')]==='undefined'&&typeof _0x3eba99[_0x23b3('0x1d')]===_0x23b3('0x1e');var _0xa5b20=_0x12a284[_0x23b3('0x1f')];var _0x2d3bd8=_0x4eebee?0x0:_0x3eba99[_0x23b3('0x1c')];var _0x305a74=_0x4eebee?_0x12a284[_0x23b3('0x1f')]:_0x3eba99[_0x23b3('0x1c')]+_0x3eba99[_0x23b3('0x1d')];var _0x333646;if(_0x305a74>=_0xa5b20){_0x305a74=_0xa5b20;_0x333646=0xc8;}else{_0x333646=0xce;}_0x1adbe9[_0x23b3('0x1a')](_0x333646);return _0x1adbe9['set']('Content-Range',_0x2d3bd8+'-'+_0x305a74+'/'+_0xa5b20)[_0x23b3('0x20')](_0x12a284);}return null;};}function patchUpdates(_0x568412){return function(_0x548c4e){try{jsonpatch[_0x23b3('0x21')](_0x548c4e,_0x568412,!![]);}catch(_0x36d678){return BPromise[_0x23b3('0x22')](_0x36d678);}return _0x548c4e[_0x23b3('0x23')]();};}function saveUpdates(_0xd6c28d,_0x3d341e){return function(_0x34ae47){if(_0x34ae47){return _0x34ae47['update'](_0xd6c28d)[_0x23b3('0x24')](function(_0x4d5d0f){return _0x4d5d0f;});}return null;};}function removeEntity(_0x50fd51,_0x2159ec){return function(_0x652c70){if(_0x652c70){return _0x652c70[_0x23b3('0x25')]()[_0x23b3('0x24')](function(){var _0x3265b5=_0x652c70[_0x23b3('0x26')]({'plain':!![]});var _0x3baab7='Intervals';return db[_0x23b3('0x27')][_0x23b3('0x25')]({'where':{'type':_0x3baab7,'resourceId':_0x3265b5['id']}})[_0x23b3('0x24')](function(){return _0x652c70;});})['then'](function(){_0x50fd51[_0x23b3('0x1a')](0xcc)[_0x23b3('0x1b')]();});}};}function handleEntityNotFound(_0xa5d685,_0xaec8c1){return function(_0x1c95d5){if(!_0x1c95d5){_0xa5d685[_0x23b3('0x19')](0x194);}return _0x1c95d5;};}function handleError(_0x45149b,_0x4e43f6){_0x4e43f6=_0x4e43f6||0x1f4;return function(_0x3a9b2b){logger['error'](_0x3a9b2b['stack']);if(_0x3a9b2b[_0x23b3('0x28')]){delete _0x3a9b2b[_0x23b3('0x28')];}_0x45149b[_0x23b3('0x1a')](_0x4e43f6)['send'](_0x3a9b2b);};}exports[_0x23b3('0x29')]=function(_0x5258ad,_0x1cc6f4){var _0x32d6d4={},_0x5d45b5={},_0x2c2ee6={'count':0x0,'rows':[]};var _0x10a955=_['map'](db[_0x23b3('0x2a')][_0x23b3('0x2b')],function(_0x143185){return{'name':_0x143185[_0x23b3('0x2c')],'type':_0x143185[_0x23b3('0x2d')][_0x23b3('0x2e')]};});_0x5d45b5[_0x23b3('0x2f')]=_[_0x23b3('0x30')](_0x10a955,_0x23b3('0x28'));_0x5d45b5[_0x23b3('0x31')]=_[_0x23b3('0x32')](_0x5258ad['query']);_0x5d45b5['filters']=_[_0x23b3('0x33')](_0x5d45b5[_0x23b3('0x2f')],_0x5d45b5['query']);_0x32d6d4[_0x23b3('0x34')]=_[_0x23b3('0x33')](_0x5d45b5['model'],qs[_0x23b3('0x35')](_0x5258ad['query'][_0x23b3('0x35')]));_0x32d6d4[_0x23b3('0x34')]=_0x32d6d4[_0x23b3('0x34')][_0x23b3('0x36')]?_0x32d6d4[_0x23b3('0x34')]:_0x5d45b5['model'];if(!_0x5258ad['query']['hasOwnProperty'](_0x23b3('0x37'))){_0x32d6d4[_0x23b3('0x1d')]=qs[_0x23b3('0x1d')](_0x5258ad[_0x23b3('0x31')][_0x23b3('0x1d')]);_0x32d6d4[_0x23b3('0x1c')]=qs[_0x23b3('0x1c')](_0x5258ad[_0x23b3('0x31')][_0x23b3('0x1c')]);}_0x32d6d4['order']=qs[_0x23b3('0x38')](_0x5258ad[_0x23b3('0x31')][_0x23b3('0x38')]);_0x32d6d4[_0x23b3('0x39')]=qs[_0x23b3('0x3a')](_[_0x23b3('0x3b')](_0x5258ad['query'],_0x5d45b5[_0x23b3('0x3a')]),_0x10a955);if(_0x5258ad[_0x23b3('0x31')]['filter']){_0x32d6d4[_0x23b3('0x39')]=_['merge'](_0x32d6d4[_0x23b3('0x39')],{'$or':_['map'](_0x10a955,function(_0x555325){if(_0x555325[_0x23b3('0x2d')]!==_0x23b3('0x3c')){var _0x39247f={};_0x39247f[_0x555325['name']]={'$like':'%'+_0x5258ad['query'][_0x23b3('0x3d')]+'%'};return _0x39247f;}})});}_0x32d6d4=_[_0x23b3('0x3e')]({},_0x32d6d4,_0x5258ad[_0x23b3('0x3f')]);var _0x1aa788={'where':_0x32d6d4['where']};return db[_0x23b3('0x2a')][_0x23b3('0x1f')](_0x1aa788)[_0x23b3('0x24')](function(_0x213585){_0x2c2ee6[_0x23b3('0x1f')]=_0x213585;if(_0x5258ad[_0x23b3('0x31')]['includeAll']){_0x32d6d4[_0x23b3('0x40')]=[{'all':!![]}];}return db[_0x23b3('0x2a')][_0x23b3('0x41')](_0x32d6d4);})[_0x23b3('0x24')](function(_0x46870f){_0x2c2ee6[_0x23b3('0x42')]=_0x46870f;return _0x2c2ee6;})[_0x23b3('0x24')](respondWithFilteredResult(_0x1cc6f4,_0x32d6d4))[_0x23b3('0x43')](handleError(_0x1cc6f4,null));};exports['show']=function(_0x177431,_0x248db8){var _0x928250={'raw':!![],'where':{'id':_0x177431[_0x23b3('0x44')]['id']}},_0x2e42f7={};_0x2e42f7[_0x23b3('0x2f')]=_[_0x23b3('0x32')](db[_0x23b3('0x2a')][_0x23b3('0x2b')]);_0x2e42f7[_0x23b3('0x31')]=_['keys'](_0x177431[_0x23b3('0x31')]);_0x2e42f7[_0x23b3('0x3a')]=_[_0x23b3('0x33')](_0x2e42f7[_0x23b3('0x2f')],_0x2e42f7['query']);_0x928250[_0x23b3('0x34')]=_['intersection'](_0x2e42f7[_0x23b3('0x2f')],qs[_0x23b3('0x35')](_0x177431[_0x23b3('0x31')]['fields']));_0x928250[_0x23b3('0x34')]=_0x928250['attributes'][_0x23b3('0x36')]?_0x928250[_0x23b3('0x34')]:_0x2e42f7[_0x23b3('0x2f')];if(_0x177431[_0x23b3('0x31')]['includeAll']){_0x928250['include']=[{'all':!![]}];}_0x928250=_[_0x23b3('0x3e')]({},_0x928250,_0x177431['options']);return db['Interval'][_0x23b3('0x45')](_0x928250)[_0x23b3('0x24')](handleEntityNotFound(_0x248db8,null))[_0x23b3('0x24')](respondWithResult(_0x248db8,null))[_0x23b3('0x43')](handleError(_0x248db8,null));};exports[_0x23b3('0x46')]=function(_0x2e4513,_0x355829){return db[_0x23b3('0x2a')][_0x23b3('0x46')](_0x2e4513[_0x23b3('0x47')],{})['then'](function(_0x2ca738){var _0x4de510=_0x2e4513[_0x23b3('0x48')]['get']({'plain':!![]});if(!_0x4de510)throw new Error(_0x23b3('0x49'));if(_0x4de510[_0x23b3('0x4a')]==='user'){var _0x2d999f=_0x2ca738['get']({'plain':!![]});var _0xfc867e=_0x23b3('0x4b');return db[_0x23b3('0x4c')][_0x23b3('0x45')]({'where':{'name':_0xfc867e,'userProfileId':_0x4de510['userProfileId']},'raw':!![]})[_0x23b3('0x24')](function(_0x41282c){if(_0x41282c&&_0x41282c[_0x23b3('0x4d')]===0x0){return db[_0x23b3('0x27')][_0x23b3('0x46')]({'name':_0x2d999f[_0x23b3('0x28')],'resourceId':_0x2d999f['id'],'type':_0x41282c[_0x23b3('0x28')],'sectionId':_0x41282c['id']},{})[_0x23b3('0x24')](function(){return _0x2ca738;});}else{return _0x2ca738;}})[_0x23b3('0x43')](function(_0x4cd7e8){logger[_0x23b3('0x4e')](_0x23b3('0x4f'),_0x4cd7e8);throw _0x4cd7e8;});}return _0x2ca738;})[_0x23b3('0x24')](respondWithResult(_0x355829,0xc9))[_0x23b3('0x43')](handleError(_0x355829,null));};exports['update']=function(_0x572946,_0x257e9f){if(_0x572946[_0x23b3('0x47')]['id']){delete _0x572946[_0x23b3('0x47')]['id'];}return db[_0x23b3('0x2a')]['find']({'where':{'id':_0x572946[_0x23b3('0x44')]['id']}})['then'](handleEntityNotFound(_0x257e9f,null))[_0x23b3('0x24')](saveUpdates(_0x572946[_0x23b3('0x47')],null))[_0x23b3('0x24')](respondWithResult(_0x257e9f,null))[_0x23b3('0x43')](handleError(_0x257e9f,null));};exports[_0x23b3('0x25')]=function(_0x5f4b8c,_0x5f4192){return db[_0x23b3('0x2a')][_0x23b3('0x45')]({'where':{'id':_0x5f4b8c[_0x23b3('0x44')]['id']}})[_0x23b3('0x24')](handleEntityNotFound(_0x5f4192,null))[_0x23b3('0x24')](removeEntity(_0x5f4192,null))[_0x23b3('0x43')](handleError(_0x5f4192,null));};exports[_0x23b3('0x50')]=function(_0x58f6ae,_0x2beab0,_0xefb8){if(_0x58f6ae[_0x23b3('0x47')]['id']){delete _0x58f6ae[_0x23b3('0x47')]['id'];}return db[_0x23b3('0x2a')][_0x23b3('0x45')]({'where':{'id':_0x58f6ae[_0x23b3('0x44')]['id']}})[_0x23b3('0x24')](handleEntityNotFound(_0x2beab0,null))[_0x23b3('0x24')](function(_0xa3f7a4){if(_0xa3f7a4){_0x58f6ae[_0x23b3('0x47')]['IntervalId']=_0xa3f7a4['id'];return db[_0x23b3('0x2a')][_0x23b3('0x46')](_0x58f6ae[_0x23b3('0x47')]);}})[_0x23b3('0x24')](respondWithResult(_0x2beab0,null))[_0x23b3('0x43')](handleError(_0x2beab0,null));};exports[_0x23b3('0x51')]=function(_0x17279b,_0x35c7d9,_0x488db0){var _0x4954f8={};var _0x5ad4f6={};var _0x131611;var _0x49d375;return db[_0x23b3('0x2a')][_0x23b3('0x52')]({'where':{'id':_0x17279b[_0x23b3('0x44')]['id']}})[_0x23b3('0x24')](handleEntityNotFound(_0x35c7d9,null))[_0x23b3('0x24')](function(_0x11f05a){if(_0x11f05a){_0x131611=_0x11f05a;_0x5ad4f6[_0x23b3('0x2f')]=_[_0x23b3('0x32')](db[_0x23b3('0x2a')][_0x23b3('0x2b')]);_0x5ad4f6[_0x23b3('0x31')]=_['keys'](_0x17279b[_0x23b3('0x31')]);_0x5ad4f6[_0x23b3('0x3a')]=_['intersection'](_0x5ad4f6[_0x23b3('0x2f')],_0x5ad4f6[_0x23b3('0x31')]);_0x4954f8[_0x23b3('0x34')]=_['intersection'](_0x5ad4f6[_0x23b3('0x2f')],qs[_0x23b3('0x35')](_0x17279b[_0x23b3('0x31')][_0x23b3('0x35')]));_0x4954f8['attributes']=_0x4954f8[_0x23b3('0x34')][_0x23b3('0x36')]?_0x4954f8[_0x23b3('0x34')]:_0x5ad4f6['model'];_0x4954f8['order']=qs[_0x23b3('0x38')](_0x17279b[_0x23b3('0x31')][_0x23b3('0x38')]);_0x4954f8['where']=qs[_0x23b3('0x3a')](_[_0x23b3('0x3b')](_0x17279b[_0x23b3('0x31')],_0x5ad4f6[_0x23b3('0x3a')]));if(_0x17279b['query'][_0x23b3('0x3d')]){_0x4954f8[_0x23b3('0x39')]=_[_0x23b3('0x3e')](_0x4954f8[_0x23b3('0x39')],{'$or':_[_0x23b3('0x30')](_0x4954f8[_0x23b3('0x34')],function(_0x3c4a82){var _0x8b9fd9={};_0x8b9fd9[_0x3c4a82]={'$like':'%'+_0x17279b[_0x23b3('0x31')][_0x23b3('0x3d')]+'%'};return _0x8b9fd9;})});}_0x4954f8=_[_0x23b3('0x3e')]({},_0x4954f8,_0x17279b[_0x23b3('0x3f')]);return _0x131611[_0x23b3('0x51')](_0x4954f8);}})[_0x23b3('0x24')](function(_0x4be87c){if(_0x4be87c){_0x49d375=_0x4be87c[_0x23b3('0x36')];if(!_0x17279b['query'][_0x23b3('0x53')](_0x23b3('0x37'))){_0x4954f8[_0x23b3('0x1d')]=qs[_0x23b3('0x1d')](_0x17279b[_0x23b3('0x31')][_0x23b3('0x1d')]);_0x4954f8[_0x23b3('0x1c')]=qs[_0x23b3('0x1c')](_0x17279b[_0x23b3('0x31')][_0x23b3('0x1c')]);}return _0x131611[_0x23b3('0x51')](_0x4954f8);}})[_0x23b3('0x24')](function(_0x415ea0){if(_0x415ea0){return _0x415ea0?{'count':_0x49d375,'rows':_0x415ea0}:null;}})['then'](respondWithResult(_0x35c7d9,null))[_0x23b3('0x43')](handleError(_0x35c7d9,null));};exports[_0x23b3('0x54')]=function(_0x1c0cf9,_0x392f13,_0x44d82c){return db[_0x23b3('0x2a')][_0x23b3('0x52')]({'where':{'id':_0x1c0cf9[_0x23b3('0x44')]['id']}})[_0x23b3('0x24')](handleEntityNotFound(_0x392f13,null))['then'](function(_0x590b8e){if(_0x590b8e){return db[_0x23b3('0x55')]['transaction'](function(_0x28cc46){return db[_0x23b3('0x2a')]['destroy']({'where':{'IntervalId':_0x1c0cf9[_0x23b3('0x44')]['id']},'transaction':_0x28cc46})['then'](function(_0x554249){var _0xc7c220=_[_0x23b3('0x30')](_0x1c0cf9[_0x23b3('0x47')],function(_0x38164c){delete _0x38164c['id'];_0x38164c[_0x23b3('0x56')]=_0x1c0cf9[_0x23b3('0x44')]['id'];return _0x38164c;});return db[_0x23b3('0x2a')][_0x23b3('0x57')](_0xc7c220,{'transaction':_0x28cc46});});})[_0x23b3('0x24')](function(){return db[_0x23b3('0x2a')]['findAll']({'where':{'IntervalId':_0x1c0cf9['params']['id']}});});}})[_0x23b3('0x24')](respondWithResult(_0x392f13,null))[_0x23b3('0x43')](handleError(_0x392f13,null));};
\ No newline at end of file
index 641ecee..d2a853b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36fe=['bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','exports','define','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0x36fe,0x127));var _0xe36f=function(_0x197d5c,_0x1936b0){_0x197d5c=_0x197d5c-0x0;var _0x13dc71=_0x36fe[_0x197d5c];return _0x13dc71;};'use strict';var _=require(_0xe36f('0x0'));var util=require(_0xe36f('0x1'));var logger=require(_0xe36f('0x2'))(_0xe36f('0x3'));var moment=require(_0xe36f('0x4'));var BPromise=require(_0xe36f('0x5'));var rp=require(_0xe36f('0x6'));var fs=require('fs');var path=require(_0xe36f('0x7'));var rimraf=require(_0xe36f('0x8'));var config=require(_0xe36f('0x9'));var attributes=require(_0xe36f('0xa'));var extensions=require('../../components/extensions/rewrite');module[_0xe36f('0xb')]=function(_0x485a51,_0x349c9e){return _0x485a51[_0xe36f('0xc')]('Interval',attributes,{'tableName':_0xe36f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x21f2a5,_0x50fd83){extensions[_0xe36f('0xe')](_0x485a51,_0x21f2a5);},'afterBulkCreate':function(_0x386c00,_0xa26c3d,_0x44bc2f){_0x44bc2f();extensions[_0xe36f('0xe')](_0x485a51,_0x386c00[0x0]);},'afterUpdate':function(_0x5b23ff,_0x212ff9){extensions['rewrite'](_0x485a51,_0x5b23ff);},'afterDestroy':function(_0x2095e1,_0x2b1c1c){extensions[_0xe36f('0xe')](_0x485a51,_0x2095e1);}}});};
\ No newline at end of file
+var _0xa804=['./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','util','../../config/logger','api','moment','path','rimraf'];(function(_0x23ae1b,_0x2a11fe){var _0x3f2d67=function(_0xf14061){while(--_0xf14061){_0x23ae1b['push'](_0x23ae1b['shift']());}};_0x3f2d67(++_0x2a11fe);}(_0xa804,0x13f));var _0x4a80=function(_0x3034b7,_0x56fbbf){_0x3034b7=_0x3034b7-0x0;var _0x9e8066=_0xa804[_0x3034b7];return _0x9e8066;};'use strict';var _=require('lodash');var util=require(_0x4a80('0x0'));var logger=require(_0x4a80('0x1'))(_0x4a80('0x2'));var moment=require(_0x4a80('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a80('0x4'));var rimraf=require(_0x4a80('0x5'));var config=require('../../config/environment');var attributes=require(_0x4a80('0x6'));var extensions=require(_0x4a80('0x7'));module[_0x4a80('0x8')]=function(_0x10e4e1,_0x4e3f81){return _0x10e4e1[_0x4a80('0x9')](_0x4a80('0xa'),attributes,{'tableName':_0x4a80('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5025c9,_0x17ec2f){extensions[_0x4a80('0xc')](_0x10e4e1,_0x5025c9);},'afterBulkCreate':function(_0x565dc3,_0x3f5e20,_0x281848){_0x281848();extensions['rewrite'](_0x10e4e1,_0x565dc3[0x0]);},'afterUpdate':function(_0xc86912,_0x49f86d){extensions['rewrite'](_0x10e4e1,_0xc86912);},'afterDestroy':function(_0x5bfe2e,_0x3927d2){extensions['rewrite'](_0x10e4e1,_0x5bfe2e);}}});};
\ No newline at end of file
index 07f7f89..97adc67 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(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x82140,_0x3a9d87){var _0x2b15a6=function(_0x2b565e){while(--_0x2b565e){_0x82140['push'](_0x82140['shift']());}};_0x2b15a6(++_0x3a9d87);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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 8d816a7..a16c61b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x4c503f,_0x25fefa){var _0x483280=function(_0x48a649){while(--_0x48a649){_0x4c503f['push'](_0x4c503f['shift']());}};_0x483280(++_0x25fefa);}(_0x2032,0xd9));var _0x2203=function(_0x28a635,_0x42fdbf){_0x28a635=_0x28a635-0x0;var _0x2abd45=_0x2032[_0x28a635];return _0x2abd45;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x600a2c,_0x498481){var _0x25f7b2=function(_0x3aaf99){while(--_0x3aaf99){_0x600a2c['push'](_0x600a2c['shift']());}};_0x25f7b2(++_0x498481);}(_0xdb28,0x106));var _0x8db2=function(_0x5f234f,_0x567a52){_0x5f234f=_0x5f234f-0x0;var _0x329f5b=_0xdb28[_0x5f234f];return _0x329f5b;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router;
\ No newline at end of file
index 462c166..da44dee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48c9=['email','oldToken','customfield_11502','newToken','name','customfield_11504','reason','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','headers','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','../../config/logger','api','3eAmWpBVP0','MOTGUI','summary','description','stringify','issuetype','Bug','fields','customfield_11500'];(function(_0xda7fa9,_0x453ee5){var _0x4faa98=function(_0xea7b20){while(--_0xea7b20){_0xda7fa9['push'](_0xda7fa9['shift']());}};_0x4faa98(++_0x453ee5);}(_0x48c9,0x75));var _0x948c=function(_0x1709e3,_0x53bcdf){_0x1709e3=_0x1709e3-0x0;var _0x28683f=_0x48c9[_0x1709e3];return _0x28683f;};'use strict';var BPromise=require(_0x948c('0x0'));var https=require('https');var logger=require(_0x948c('0x1'))(_0x948c('0x2'));var USERNAME='support';var PASSWORD=_0x948c('0x3');function openIssue(_0x48b672,_0x1e7070){var _0x4be378={'fields':{'project':{'key':_0x48b672['key']||_0x948c('0x4')},'summary':(_0x48b672[_0x948c('0x5')]||'Report')+'\x20from\x20'+_0x48b672['ip'],'description':_0x48b672[_0x948c('0x6')]||JSON[_0x948c('0x7')](_0x48b672),'issuetype':{'name':_0x48b672[_0x948c('0x8')]||_0x948c('0x9')}}};_0x4be378[_0x948c('0xa')][_0x948c('0xb')]=_0x48b672[_0x948c('0xc')];_0x4be378[_0x948c('0xa')]['customfield_11501']=_0x48b672[_0x948c('0xd')];_0x4be378[_0x948c('0xa')][_0x948c('0xe')]=_0x48b672[_0x948c('0xf')];_0x4be378[_0x948c('0xa')]['customfield_11503']=_0x48b672[_0x948c('0x10')];_0x4be378[_0x948c('0xa')][_0x948c('0x11')]=_0x48b672[_0x948c('0x12')];_0x4be378[_0x948c('0xa')]['customfield_10102']=_0x48b672['ip'];var _0x3d1679={'host':_0x948c('0x13'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x948c('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x948c('0x15'),'Authorization':_0x948c('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x948c('0x17')](_0x948c('0x18'))}};var _0x571cf5=JSON['stringify'](_0x4be378);var _0x5d1405=https[_0x948c('0x19')](_0x3d1679,function(_0x25f31){_0x25f31[_0x948c('0x1a')](_0x948c('0x1b'));var _0x4fd0a2='';_0x25f31['on'](_0x948c('0x1c'),function(_0x141d7e){_0x4fd0a2+=_0x141d7e;});_0x25f31['on']('end',function(){if(_0x1e7070){return _0x1e7070[_0x948c('0x1d')](_0x25f31[_0x948c('0x1e')])[_0x948c('0x1f')](JSON[_0x948c('0x20')](_0x4fd0a2));}});});_0x5d1405['on'](_0x948c('0x21'),function(_0x4b2416){if(_0x1e7070){return _0x1e7070[_0x948c('0x1d')](0x1f4)[_0x948c('0x1f')]({'errors':[{'message':_0x948c('0x22'),'type':'api.jira'}]});}});_0x5d1405[_0x948c('0x23')](_0x571cf5);_0x5d1405['end']();}exports[_0x948c('0x24')]=openIssue;exports['send']=function(_0x6484e4,_0x5961db){_0x6484e4['body']['ip']=_0x6484e4[_0x948c('0x25')][_0x948c('0x26')]||_0x6484e4[_0x948c('0x27')][_0x948c('0x28')]||_0x6484e4['socket'][_0x948c('0x28')]||_0x6484e4[_0x948c('0x27')][_0x948c('0x29')]['remoteAddress'];return openIssue(_0x6484e4[_0x948c('0x2a')],_0x5961db);};
\ No newline at end of file
+var _0x58a7=['json','parse','error','write','end','headers','x-forwarded-for','remoteAddress','socket','connection','body','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','name','customfield_11504','reason','track.xcallymotion.com','POST','application/json','base64','request','setEncoding','utf8','data','status','statusCode'];(function(_0x320da1,_0x31e289){var _0x1a9db5=function(_0xe83b30){while(--_0xe83b30){_0x320da1['push'](_0x320da1['shift']());}};_0x1a9db5(++_0x31e289);}(_0x58a7,0x1a0));var _0x758a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x58a7[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x758a('0x0'));var https=require(_0x758a('0x1'));var logger=require(_0x758a('0x2'))(_0x758a('0x3'));var USERNAME=_0x758a('0x4');var PASSWORD=_0x758a('0x5');function openIssue(_0xdba6b7,_0x3d98f4){var _0xfeb2c3={'fields':{'project':{'key':_0xdba6b7[_0x758a('0x6')]||_0x758a('0x7')},'summary':(_0xdba6b7[_0x758a('0x8')]||_0x758a('0x9'))+_0x758a('0xa')+_0xdba6b7['ip'],'description':_0xdba6b7['description']||JSON[_0x758a('0xb')](_0xdba6b7),'issuetype':{'name':_0xdba6b7[_0x758a('0xc')]||_0x758a('0xd')}}};_0xfeb2c3[_0x758a('0xe')][_0x758a('0xf')]=_0xdba6b7[_0x758a('0x10')];_0xfeb2c3[_0x758a('0xe')][_0x758a('0x11')]=_0xdba6b7[_0x758a('0x12')];_0xfeb2c3['fields'][_0x758a('0x13')]=_0xdba6b7[_0x758a('0x14')];_0xfeb2c3[_0x758a('0xe')]['customfield_11503']=_0xdba6b7[_0x758a('0x15')];_0xfeb2c3['fields'][_0x758a('0x16')]=_0xdba6b7[_0x758a('0x17')];_0xfeb2c3['fields']['customfield_10102']=_0xdba6b7['ip'];var _0x85f45c={'host':_0x758a('0x18'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x758a('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0x758a('0x1a'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x758a('0x1b'))}};var _0x24b2dd=JSON['stringify'](_0xfeb2c3);var _0x453723=https[_0x758a('0x1c')](_0x85f45c,function(_0x5363b3){_0x5363b3[_0x758a('0x1d')](_0x758a('0x1e'));var _0xd6b7fe='';_0x5363b3['on'](_0x758a('0x1f'),function(_0x1b84b3){_0xd6b7fe+=_0x1b84b3;});_0x5363b3['on']('end',function(){if(_0x3d98f4){return _0x3d98f4[_0x758a('0x20')](_0x5363b3[_0x758a('0x21')])[_0x758a('0x22')](JSON[_0x758a('0x23')](_0xd6b7fe));}});});_0x453723['on'](_0x758a('0x24'),function(_0x5f2d73){if(_0x3d98f4){return _0x3d98f4[_0x758a('0x20')](0x1f4)[_0x758a('0x22')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x453723[_0x758a('0x25')](_0x24b2dd);_0x453723[_0x758a('0x26')]();}exports['openIssue']=openIssue;exports['send']=function(_0x5c5215,_0x26c3b9){_0x5c5215['body']['ip']=_0x5c5215[_0x758a('0x27')][_0x758a('0x28')]||_0x5c5215['connection'][_0x758a('0x29')]||_0x5c5215[_0x758a('0x2a')]['remoteAddress']||_0x5c5215[_0x758a('0x2b')]['socket']['remoteAddress'];return openIssue(_0x5c5215[_0x758a('0x2c')],_0x26c3b9);};
\ No newline at end of file
index e29048f..3e4c5dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x878f=['./jscriptyAnswerReport.controller','get','/describe','/:id','post','isAuthenticated','create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4582a9,_0x52e47d){var _0x49c003=function(_0x2b228d){while(--_0x2b228d){_0x4582a9['push'](_0x4582a9['shift']());}};_0x49c003(++_0x52e47d);}(_0x878f,0x173));var _0xf878=function(_0x3e8dc7,_0x147ccd){_0x3e8dc7=_0x3e8dc7-0x0;var _0x40c96f=_0x878f[_0x3e8dc7];return _0x40c96f;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf878('0xd')]('/',auth[_0xf878('0xe')](),controller[_0xf878('0xf')]);router['put'](_0xf878('0xc'),auth[_0xf878('0xe')](),controller['update']);router[_0xf878('0x10')]('/:id',auth[_0xf878('0xe')](),controller[_0xf878('0x11')]);module[_0xf878('0x12')]=router;
\ No newline at end of file
+var _0xee5b=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x477fb2,_0x404fb6){var _0x589040=function(_0x199dd3){while(--_0x199dd3){_0x477fb2['push'](_0x477fb2['shift']());}};_0x589040(++_0x404fb6);}(_0xee5b,0x1f4));var _0xbee5=function(_0x3cecf2,_0x2523f6){_0x3cecf2=_0x3cecf2-0x0;var _0x9669aa=_0xee5b[_0x3cecf2];return _0x9669aa;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var fs_extra=require(_0xbee5('0x4'));var auth=require(_0xbee5('0x5'));var interaction=require(_0xbee5('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyAnswerReport.controller');router[_0xbee5('0x7')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0x9')]);router[_0xbee5('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xbee5('0x8')](),controller[_0xbee5('0xa')]);router[_0xbee5('0xb')]('/',auth[_0xbee5('0x8')](),controller['create']);router[_0xbee5('0xc')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0xe')]);router[_0xbee5('0xf')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0x10')]);module[_0xbee5('0x11')]=router;
\ No newline at end of file
index 847edb5..4c43701 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7a54,0x106));var _0x47a5=function(_0x228078,_0x182e1a){_0x228078=_0x228078-0x0;var _0x4c03ba=_0x7a54[_0x228078];return _0x4c03ba;};'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(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x7a54,0x106));var _0x47a5=function(_0x31578f,_0x179211){_0x31578f=_0x31578f-0x0;var _0x5b28a5=_0x7a54[_0x31578f];return _0x5b28a5;};'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 479ea60..41745ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3148=['JscriptyAnswerReport','include','rows','catch','show','options','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','pick','filter','where','VIRTUAL','merge'];(function(_0x50958d,_0x39d85d){var _0x46ac68=function(_0x531c31){while(--_0x531c31){_0x50958d['push'](_0x50958d['shift']());}};_0x46ac68(++_0x39d85d);}(_0x3148,0x1d3));var _0x8314=function(_0x4c2c33,_0xef5944){_0x4c2c33=_0x4c2c33-0x0;var _0x4c3bff=_0x3148[_0x4c2c33];return _0x4c3bff;};'use strict';var emlformat=require(_0x8314('0x0'));var rimraf=require(_0x8314('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8314('0x2'));var rp=require(_0x8314('0x3'));var moment=require(_0x8314('0x4'));var BPromise=require(_0x8314('0x5'));var Mustache=require('mustache');var util=require(_0x8314('0x6'));var path=require(_0x8314('0x7'));var sox=require(_0x8314('0x8'));var csv=require(_0x8314('0x9'));var ejs=require(_0x8314('0xa'));var fs=require('fs');var fs_extra=require(_0x8314('0xb'));var _=require(_0x8314('0xc'));var squel=require('squel');var crypto=require(_0x8314('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8314('0xe'));var toCsv=require(_0x8314('0x9'));var querystring=require(_0x8314('0xf'));var Papa=require(_0x8314('0x10'));var Redis=require(_0x8314('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8314('0x12'));var hardwareService=require(_0x8314('0x13'));var logger=require(_0x8314('0x14'))(_0x8314('0x15'));var utils=require('../../config/utils');var config=require(_0x8314('0x16'));var licenseUtil=require(_0x8314('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f8231,_0x55e770){_0x55e770=_0x55e770||0xcc;return function(_0x5f17d8){if(_0x5f17d8){return _0x2f8231[_0x8314('0x18')](_0x55e770);}return _0x2f8231[_0x8314('0x19')](_0x55e770)[_0x8314('0x1a')]();};}function respondWithResult(_0x24c55c,_0x49587c){_0x49587c=_0x49587c||0xc8;return function(_0x9e90a6){if(_0x9e90a6){return _0x24c55c[_0x8314('0x19')](_0x49587c)[_0x8314('0x1b')](_0x9e90a6);}};}function respondWithFilteredResult(_0x136e09,_0x2c459e){return function(_0x6a588a){if(_0x6a588a){var _0x579a15=typeof _0x2c459e['offset']===_0x8314('0x1c')&&typeof _0x2c459e[_0x8314('0x1d')]===_0x8314('0x1c');var _0x570db3=_0x6a588a[_0x8314('0x1e')];var _0x10e256=_0x579a15?0x0:_0x2c459e['offset'];var _0x1ade63=_0x579a15?_0x6a588a[_0x8314('0x1e')]:_0x2c459e['offset']+_0x2c459e[_0x8314('0x1d')];var _0x55053a;if(_0x1ade63>=_0x570db3){_0x1ade63=_0x570db3;_0x55053a=0xc8;}else{_0x55053a=0xce;}_0x136e09[_0x8314('0x19')](_0x55053a);return _0x136e09[_0x8314('0x1f')](_0x8314('0x20'),_0x10e256+'-'+_0x1ade63+'/'+_0x570db3)['json'](_0x6a588a);}return null;};}function patchUpdates(_0x4ead11){return function(_0x240f4b){try{jsonpatch[_0x8314('0x21')](_0x240f4b,_0x4ead11,!![]);}catch(_0xc37d84){return BPromise[_0x8314('0x22')](_0xc37d84);}return _0x240f4b[_0x8314('0x23')]();};}function saveUpdates(_0x1b1579,_0x2e9052){return function(_0x9e2c24){if(_0x9e2c24){return _0x9e2c24[_0x8314('0x24')](_0x1b1579)[_0x8314('0x25')](function(_0x5c6fd1){return _0x5c6fd1;});}return null;};}function removeEntity(_0xf72fc9,_0x29535a){return function(_0x2b6183){if(_0x2b6183){return _0x2b6183[_0x8314('0x26')]()[_0x8314('0x25')](function(){_0xf72fc9['status'](0xcc)[_0x8314('0x1a')]();});}};}function handleEntityNotFound(_0x2405af,_0x3f3736){return function(_0x4b37de){if(!_0x4b37de){_0x2405af[_0x8314('0x18')](0x194);}return _0x4b37de;};}function handleError(_0x56a047,_0x4c55b1){_0x4c55b1=_0x4c55b1||0x1f4;return function(_0x30d0b2){logger['error'](_0x30d0b2[_0x8314('0x27')]);if(_0x30d0b2['name']){delete _0x30d0b2[_0x8314('0x28')];}_0x56a047[_0x8314('0x19')](_0x4c55b1)[_0x8314('0x29')](_0x30d0b2);};}exports[_0x8314('0x2a')]=function(_0x40efa3,_0x7acf62){var _0x56f1c1={},_0x59fbfc={},_0x33b7e2={'count':0x0,'rows':[]};var _0x19df1f=_[_0x8314('0x2b')](db['JscriptyAnswerReport'][_0x8314('0x2c')],function(_0x37a4a1){return{'name':_0x37a4a1[_0x8314('0x2d')],'type':_0x37a4a1[_0x8314('0x2e')][_0x8314('0x2f')]};});_0x59fbfc[_0x8314('0x30')]=_[_0x8314('0x2b')](_0x19df1f,_0x8314('0x28'));_0x59fbfc[_0x8314('0x31')]=_[_0x8314('0x32')](_0x40efa3[_0x8314('0x31')]);_0x59fbfc[_0x8314('0x33')]=_[_0x8314('0x34')](_0x59fbfc[_0x8314('0x30')],_0x59fbfc[_0x8314('0x31')]);_0x56f1c1[_0x8314('0x35')]=_[_0x8314('0x34')](_0x59fbfc['model'],qs['fields'](_0x40efa3[_0x8314('0x31')][_0x8314('0x36')]));_0x56f1c1['attributes']=_0x56f1c1['attributes'][_0x8314('0x37')]?_0x56f1c1[_0x8314('0x35')]:_0x59fbfc[_0x8314('0x30')];if(!_0x40efa3[_0x8314('0x31')]['hasOwnProperty'](_0x8314('0x38'))){_0x56f1c1[_0x8314('0x1d')]=qs[_0x8314('0x1d')](_0x40efa3[_0x8314('0x31')]['limit']);_0x56f1c1[_0x8314('0x39')]=qs[_0x8314('0x39')](_0x40efa3[_0x8314('0x31')]['offset']);}_0x56f1c1[_0x8314('0x3a')]=qs['sort'](_0x40efa3[_0x8314('0x31')][_0x8314('0x3b')]);_0x56f1c1['where']=qs['filters'](_[_0x8314('0x3c')](_0x40efa3['query'],_0x59fbfc[_0x8314('0x33')]),_0x19df1f);if(_0x40efa3['query'][_0x8314('0x3d')]){_0x56f1c1[_0x8314('0x3e')]=_['merge'](_0x56f1c1[_0x8314('0x3e')],{'$or':_[_0x8314('0x2b')](_0x19df1f,function(_0x207afd){if(_0x207afd[_0x8314('0x2e')]!==_0x8314('0x3f')){var _0x353566={};_0x353566[_0x207afd[_0x8314('0x28')]]={'$like':'%'+_0x40efa3[_0x8314('0x31')][_0x8314('0x3d')]+'%'};return _0x353566;}})});}_0x56f1c1=_[_0x8314('0x40')]({},_0x56f1c1,_0x40efa3['options']);var _0x464337={'where':_0x56f1c1[_0x8314('0x3e')]};return db[_0x8314('0x41')][_0x8314('0x1e')](_0x464337)[_0x8314('0x25')](function(_0x22fc1c){_0x33b7e2['count']=_0x22fc1c;if(_0x40efa3['query']['includeAll']){_0x56f1c1[_0x8314('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x56f1c1);})[_0x8314('0x25')](function(_0x57b751){_0x33b7e2[_0x8314('0x43')]=_0x57b751;return _0x33b7e2;})[_0x8314('0x25')](respondWithFilteredResult(_0x7acf62,_0x56f1c1))[_0x8314('0x44')](handleError(_0x7acf62,null));};exports[_0x8314('0x45')]=function(_0x1c331e,_0x437ae7){var _0x3d3e0d={'raw':!![],'where':{'id':_0x1c331e['params']['id']}},_0x5b369a={};_0x5b369a['model']=_[_0x8314('0x32')](db[_0x8314('0x41')]['rawAttributes']);_0x5b369a[_0x8314('0x31')]=_[_0x8314('0x32')](_0x1c331e[_0x8314('0x31')]);_0x5b369a[_0x8314('0x33')]=_[_0x8314('0x34')](_0x5b369a[_0x8314('0x30')],_0x5b369a[_0x8314('0x31')]);_0x3d3e0d[_0x8314('0x35')]=_[_0x8314('0x34')](_0x5b369a[_0x8314('0x30')],qs['fields'](_0x1c331e[_0x8314('0x31')][_0x8314('0x36')]));_0x3d3e0d[_0x8314('0x35')]=_0x3d3e0d[_0x8314('0x35')][_0x8314('0x37')]?_0x3d3e0d[_0x8314('0x35')]:_0x5b369a[_0x8314('0x30')];if(_0x1c331e[_0x8314('0x31')]['includeAll']){_0x3d3e0d[_0x8314('0x42')]=[{'all':!![]}];}_0x3d3e0d=_[_0x8314('0x40')]({},_0x3d3e0d,_0x1c331e[_0x8314('0x46')]);return db['JscriptyAnswerReport'][_0x8314('0x47')](_0x3d3e0d)[_0x8314('0x25')](handleEntityNotFound(_0x437ae7,null))[_0x8314('0x25')](respondWithResult(_0x437ae7,null))[_0x8314('0x44')](handleError(_0x437ae7,null));};exports[_0x8314('0x48')]=function(_0x3d0a69,_0x28cb99){return db[_0x8314('0x41')]['create'](_0x3d0a69[_0x8314('0x49')],{})[_0x8314('0x25')](respondWithResult(_0x28cb99,0xc9))[_0x8314('0x44')](handleError(_0x28cb99,null));};exports[_0x8314('0x24')]=function(_0x4260b8,_0x35adc0){if(_0x4260b8['body']['id']){delete _0x4260b8['body']['id'];}return db[_0x8314('0x41')][_0x8314('0x47')]({'where':{'id':_0x4260b8['params']['id']}})['then'](handleEntityNotFound(_0x35adc0,null))[_0x8314('0x25')](saveUpdates(_0x4260b8['body'],null))['then'](respondWithResult(_0x35adc0,null))['catch'](handleError(_0x35adc0,null));};exports[_0x8314('0x26')]=function(_0x7847cb,_0x17af9a){return db[_0x8314('0x41')][_0x8314('0x47')]({'where':{'id':_0x7847cb[_0x8314('0x4a')]['id']}})[_0x8314('0x25')](handleEntityNotFound(_0x17af9a,null))['then'](removeEntity(_0x17af9a,null))[_0x8314('0x44')](handleError(_0x17af9a,null));};exports[_0x8314('0x4b')]=function(_0x1a594e,_0x1dfd6b){return db[_0x8314('0x41')]['describe']()[_0x8314('0x25')](respondWithResult(_0x1dfd6b,null))[_0x8314('0x44')](handleError(_0x1dfd6b,null));};
\ No newline at end of file
+var _0x6d19=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','then','sendStatus','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','JscriptyAnswerReport','rows','show','params','length','include','find','catch','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x14e90f,_0x2e1597){var _0x4eb0e7=function(_0x2ec7c3){while(--_0x2ec7c3){_0x14e90f['push'](_0x14e90f['shift']());}};_0x4eb0e7(++_0x2e1597);}(_0x6d19,0x160));var _0x96d1=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0x6d19[_0x34ad72];return _0x5c9aa8;};'use strict';var emlformat=require(_0x96d1('0x0'));var rimraf=require(_0x96d1('0x1'));var zipdir=require(_0x96d1('0x2'));var jsonpatch=require(_0x96d1('0x3'));var rp=require(_0x96d1('0x4'));var moment=require(_0x96d1('0x5'));var BPromise=require(_0x96d1('0x6'));var Mustache=require('mustache');var util=require(_0x96d1('0x7'));var path=require(_0x96d1('0x8'));var sox=require(_0x96d1('0x9'));var csv=require(_0x96d1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96d1('0xb'));var _=require(_0x96d1('0xc'));var squel=require(_0x96d1('0xd'));var crypto=require('crypto');var jsforce=require(_0x96d1('0xe'));var deskjs=require(_0x96d1('0xf'));var toCsv=require(_0x96d1('0xa'));var querystring=require(_0x96d1('0x10'));var Papa=require(_0x96d1('0x11'));var Redis=require(_0x96d1('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x96d1('0x13'));var hardwareService=require(_0x96d1('0x14'));var logger=require('../../config/logger')(_0x96d1('0x15'));var utils=require('../../config/utils');var config=require(_0x96d1('0x16'));var licenseUtil=require(_0x96d1('0x17'));var db=require(_0x96d1('0x18'))['db'];function respondWithStatusCode(_0xb019fb,_0x46905e){_0x46905e=_0x46905e||0xcc;return function(_0x673a11){if(_0x673a11){return _0xb019fb['sendStatus'](_0x46905e);}return _0xb019fb[_0x96d1('0x19')](_0x46905e)[_0x96d1('0x1a')]();};}function respondWithResult(_0x10e057,_0xdcf1fc){_0xdcf1fc=_0xdcf1fc||0xc8;return function(_0x2fd5c6){if(_0x2fd5c6){return _0x10e057['status'](_0xdcf1fc)['json'](_0x2fd5c6);}};}function respondWithFilteredResult(_0x2e4cf5,_0x446023){return function(_0x21d7a4){if(_0x21d7a4){var _0x9eb2c4=typeof _0x446023[_0x96d1('0x1b')]===_0x96d1('0x1c')&&typeof _0x446023[_0x96d1('0x1d')]===_0x96d1('0x1c');var _0x913482=_0x21d7a4['count'];var _0x18c73f=_0x9eb2c4?0x0:_0x446023[_0x96d1('0x1b')];var _0x3ed4ff=_0x9eb2c4?_0x21d7a4[_0x96d1('0x1e')]:_0x446023[_0x96d1('0x1b')]+_0x446023['limit'];var _0x3c605a;if(_0x3ed4ff>=_0x913482){_0x3ed4ff=_0x913482;_0x3c605a=0xc8;}else{_0x3c605a=0xce;}_0x2e4cf5[_0x96d1('0x19')](_0x3c605a);return _0x2e4cf5[_0x96d1('0x1f')](_0x96d1('0x20'),_0x18c73f+'-'+_0x3ed4ff+'/'+_0x913482)['json'](_0x21d7a4);}return null;};}function patchUpdates(_0x17e281){return function(_0x11a666){try{jsonpatch[_0x96d1('0x21')](_0x11a666,_0x17e281,!![]);}catch(_0x31a7e5){return BPromise['reject'](_0x31a7e5);}return _0x11a666[_0x96d1('0x22')]();};}function saveUpdates(_0x3393ec,_0x186bae){return function(_0x1390ac){if(_0x1390ac){return _0x1390ac['update'](_0x3393ec)[_0x96d1('0x23')](function(_0x38f350){return _0x38f350;});}return null;};}function removeEntity(_0x5d7962,_0x14334a){return function(_0x29ea83){if(_0x29ea83){return _0x29ea83['destroy']()[_0x96d1('0x23')](function(){_0x5d7962[_0x96d1('0x19')](0xcc)[_0x96d1('0x1a')]();});}};}function handleEntityNotFound(_0x5462ec,_0x424d1e){return function(_0x46aa64){if(!_0x46aa64){_0x5462ec[_0x96d1('0x24')](0x194);}return _0x46aa64;};}function handleError(_0x56be7f,_0x511ebd){_0x511ebd=_0x511ebd||0x1f4;return function(_0xd88eb7){logger['error'](_0xd88eb7[_0x96d1('0x25')]);if(_0xd88eb7[_0x96d1('0x26')]){delete _0xd88eb7[_0x96d1('0x26')];}_0x56be7f[_0x96d1('0x19')](_0x511ebd)[_0x96d1('0x27')](_0xd88eb7);};}exports['index']=function(_0x1b42a0,_0xdfa409){var _0x433b36={},_0x443f9c={},_0x5a83e6={'count':0x0,'rows':[]};var _0x1b767b=_[_0x96d1('0x28')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x7ee767){return{'name':_0x7ee767[_0x96d1('0x29')],'type':_0x7ee767[_0x96d1('0x2a')][_0x96d1('0x2b')]};});_0x443f9c[_0x96d1('0x2c')]=_[_0x96d1('0x28')](_0x1b767b,'name');_0x443f9c[_0x96d1('0x2d')]=_[_0x96d1('0x2e')](_0x1b42a0[_0x96d1('0x2d')]);_0x443f9c[_0x96d1('0x2f')]=_[_0x96d1('0x30')](_0x443f9c[_0x96d1('0x2c')],_0x443f9c['query']);_0x433b36[_0x96d1('0x31')]=_[_0x96d1('0x30')](_0x443f9c[_0x96d1('0x2c')],qs[_0x96d1('0x32')](_0x1b42a0[_0x96d1('0x2d')][_0x96d1('0x32')]));_0x433b36['attributes']=_0x433b36[_0x96d1('0x31')]['length']?_0x433b36['attributes']:_0x443f9c['model'];if(!_0x1b42a0[_0x96d1('0x2d')][_0x96d1('0x33')](_0x96d1('0x34'))){_0x433b36[_0x96d1('0x1d')]=qs[_0x96d1('0x1d')](_0x1b42a0['query'][_0x96d1('0x1d')]);_0x433b36[_0x96d1('0x1b')]=qs[_0x96d1('0x1b')](_0x1b42a0[_0x96d1('0x2d')][_0x96d1('0x1b')]);}_0x433b36[_0x96d1('0x35')]=qs['sort'](_0x1b42a0[_0x96d1('0x2d')][_0x96d1('0x36')]);_0x433b36[_0x96d1('0x37')]=qs[_0x96d1('0x2f')](_[_0x96d1('0x38')](_0x1b42a0[_0x96d1('0x2d')],_0x443f9c[_0x96d1('0x2f')]),_0x1b767b);if(_0x1b42a0['query']['filter']){_0x433b36[_0x96d1('0x37')]=_[_0x96d1('0x39')](_0x433b36[_0x96d1('0x37')],{'$or':_[_0x96d1('0x28')](_0x1b767b,function(_0xc87d85){if(_0xc87d85['type']!==_0x96d1('0x3a')){var _0x4110ce={};_0x4110ce[_0xc87d85['name']]={'$like':'%'+_0x1b42a0[_0x96d1('0x2d')][_0x96d1('0x3b')]+'%'};return _0x4110ce;}})});}_0x433b36=_[_0x96d1('0x39')]({},_0x433b36,_0x1b42a0[_0x96d1('0x3c')]);var _0x53ed44={'where':_0x433b36[_0x96d1('0x37')]};return db['JscriptyAnswerReport']['count'](_0x53ed44)[_0x96d1('0x23')](function(_0x3e10f3){_0x5a83e6['count']=_0x3e10f3;if(_0x1b42a0['query'][_0x96d1('0x3d')]){_0x433b36['include']=[{'all':!![]}];}return db[_0x96d1('0x3e')]['findAll'](_0x433b36);})[_0x96d1('0x23')](function(_0x525045){_0x5a83e6[_0x96d1('0x3f')]=_0x525045;return _0x5a83e6;})['then'](respondWithFilteredResult(_0xdfa409,_0x433b36))['catch'](handleError(_0xdfa409,null));};exports[_0x96d1('0x40')]=function(_0x5c676e,_0x59f0e7){var _0x1244ed={'raw':!![],'where':{'id':_0x5c676e[_0x96d1('0x41')]['id']}},_0x1f7dde={};_0x1f7dde[_0x96d1('0x2c')]=_[_0x96d1('0x2e')](db['JscriptyAnswerReport']['rawAttributes']);_0x1f7dde['query']=_[_0x96d1('0x2e')](_0x5c676e[_0x96d1('0x2d')]);_0x1f7dde[_0x96d1('0x2f')]=_[_0x96d1('0x30')](_0x1f7dde[_0x96d1('0x2c')],_0x1f7dde[_0x96d1('0x2d')]);_0x1244ed['attributes']=_['intersection'](_0x1f7dde[_0x96d1('0x2c')],qs[_0x96d1('0x32')](_0x5c676e[_0x96d1('0x2d')][_0x96d1('0x32')]));_0x1244ed[_0x96d1('0x31')]=_0x1244ed[_0x96d1('0x31')][_0x96d1('0x42')]?_0x1244ed[_0x96d1('0x31')]:_0x1f7dde['model'];if(_0x5c676e['query'][_0x96d1('0x3d')]){_0x1244ed[_0x96d1('0x43')]=[{'all':!![]}];}_0x1244ed=_['merge']({},_0x1244ed,_0x5c676e[_0x96d1('0x3c')]);return db['JscriptyAnswerReport'][_0x96d1('0x44')](_0x1244ed)[_0x96d1('0x23')](handleEntityNotFound(_0x59f0e7,null))[_0x96d1('0x23')](respondWithResult(_0x59f0e7,null))[_0x96d1('0x45')](handleError(_0x59f0e7,null));};exports[_0x96d1('0x46')]=function(_0x1728e3,_0x59aa3c){return db[_0x96d1('0x3e')][_0x96d1('0x46')](_0x1728e3['body'],{})[_0x96d1('0x23')](respondWithResult(_0x59aa3c,0xc9))[_0x96d1('0x45')](handleError(_0x59aa3c,null));};exports[_0x96d1('0x47')]=function(_0x39e32b,_0x33970f){if(_0x39e32b[_0x96d1('0x48')]['id']){delete _0x39e32b[_0x96d1('0x48')]['id'];}return db[_0x96d1('0x3e')][_0x96d1('0x44')]({'where':{'id':_0x39e32b[_0x96d1('0x41')]['id']}})[_0x96d1('0x23')](handleEntityNotFound(_0x33970f,null))[_0x96d1('0x23')](saveUpdates(_0x39e32b[_0x96d1('0x48')],null))[_0x96d1('0x23')](respondWithResult(_0x33970f,null))['catch'](handleError(_0x33970f,null));};exports[_0x96d1('0x49')]=function(_0x13e9cc,_0x3f3a89){return db[_0x96d1('0x3e')][_0x96d1('0x44')]({'where':{'id':_0x13e9cc[_0x96d1('0x41')]['id']}})['then'](handleEntityNotFound(_0x3f3a89,null))[_0x96d1('0x23')](removeEntity(_0x3f3a89,null))[_0x96d1('0x45')](handleError(_0x3f3a89,null));};exports['describe']=function(_0x1c5f67,_0x1cbd18){return db[_0x96d1('0x3e')]['describe']()[_0x96d1('0x23')](respondWithResult(_0x1cbd18,null))['catch'](handleError(_0x1cbd18,null));};
\ No newline at end of file
index 71e1423..752f3a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ef4=['path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3e5b95,_0x47082e){var _0x30531e=function(_0x227d7e){while(--_0x227d7e){_0x3e5b95['push'](_0x3e5b95['shift']());}};_0x30531e(++_0x47082e);}(_0x5ef4,0x10c));var _0x45ef=function(_0x49fbdf,_0x2699ea){_0x49fbdf=_0x49fbdf-0x0;var _0x5e951e=_0x5ef4[_0x49fbdf];return _0x5e951e;};'use strict';var _=require('lodash');var util=require(_0x45ef('0x0'));var logger=require(_0x45ef('0x1'))(_0x45ef('0x2'));var moment=require('moment');var BPromise=require(_0x45ef('0x3'));var rp=require(_0x45ef('0x4'));var fs=require('fs');var path=require(_0x45ef('0x5'));var rimraf=require(_0x45ef('0x6'));var config=require(_0x45ef('0x7'));var attributes=require(_0x45ef('0x8'));module[_0x45ef('0x9')]=function(_0x4f4951,_0x553031){return _0x4f4951[_0x45ef('0xa')](_0x45ef('0xb'),attributes,{'tableName':_0x45ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d2a=['path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','util','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7d2a,0xa0));var _0xa7d2=function(_0x5ea894,_0x136f10){_0x5ea894=_0x5ea894-0x0;var _0x413bda=_0x7d2a[_0x5ea894];return _0x413bda;};'use strict';var _=require(_0xa7d2('0x0'));var util=require(_0xa7d2('0x1'));var logger=require('../../config/logger')(_0xa7d2('0x2'));var moment=require(_0xa7d2('0x3'));var BPromise=require(_0xa7d2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa7d2('0x5'));var rimraf=require('rimraf');var config=require(_0xa7d2('0x6'));var attributes=require(_0xa7d2('0x7'));module[_0xa7d2('0x8')]=function(_0xe40800,_0xddc453){return _0xe40800[_0xa7d2('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0xa7d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 46c96e7..f656763 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ac1=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','request\x20sent'];(function(_0xbfef73,_0x25027e){var _0x43c241=function(_0x1a3494){while(--_0x1a3494){_0xbfef73['push'](_0xbfef73['shift']());}};_0x43c241(++_0x25027e);}(_0x6ac1,0xf6));var _0x16ac=function(_0xdb47d8,_0x933e5b){_0xdb47d8=_0xdb47d8-0x0;var _0x5cdfd9=_0x6ac1[_0xdb47d8];return _0x5cdfd9;};'use strict';var _=require(_0x16ac('0x0'));var util=require(_0x16ac('0x1'));var moment=require(_0x16ac('0x2'));var BPromise=require(_0x16ac('0x3'));var rs=require(_0x16ac('0x4'));var fs=require('fs');var Redis=require(_0x16ac('0x5'));var db=require(_0x16ac('0x6'))['db'];var utils=require(_0x16ac('0x7'));var logger=require(_0x16ac('0x8'))(_0x16ac('0x9'));var config=require(_0x16ac('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf8ec0b,_0x200c34,_0x1c81e2){return new BPromise(function(_0x407359,_0x148048){return client['request'](_0xf8ec0b,_0x1c81e2)[_0x16ac('0xb')](function(_0x3a8854){logger[_0x16ac('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x200c34,_0x16ac('0xd'));logger[_0x16ac('0xe')](_0x16ac('0xf'),_0x200c34,_0x16ac('0xd'),JSON['stringify'](_0x3a8854));if(_0x3a8854[_0x16ac('0x10')]){if(_0x3a8854[_0x16ac('0x10')][_0x16ac('0x11')]===0x1f4){logger[_0x16ac('0x10')](_0x16ac('0x12'),_0x200c34,_0x3a8854[_0x16ac('0x10')][_0x16ac('0x13')]);return _0x148048(_0x3a8854[_0x16ac('0x10')][_0x16ac('0x13')]);}logger[_0x16ac('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x200c34,_0x3a8854[_0x16ac('0x10')][_0x16ac('0x13')]);return _0x407359(_0x3a8854[_0x16ac('0x10')][_0x16ac('0x13')]);}else{logger[_0x16ac('0xc')](_0x16ac('0x12'),_0x200c34,_0x16ac('0xd'));_0x407359(_0x3a8854['result'][_0x16ac('0x13')]);}})['catch'](function(_0xe62ad6){logger[_0x16ac('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x200c34,_0xe62ad6);_0x148048(_0xe62ad6);});});}
\ No newline at end of file
+var _0xffc5=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xffc5,0x7e));var _0x5ffc=function(_0x286726,_0x20a337){_0x286726=_0x286726-0x0;var _0xcd4fe9=_0xffc5[_0x286726];return _0xcd4fe9;};'use strict';var _=require(_0x5ffc('0x0'));var util=require('util');var moment=require(_0x5ffc('0x1'));var BPromise=require(_0x5ffc('0x2'));var rs=require(_0x5ffc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ffc('0x4'))['db'];var utils=require(_0x5ffc('0x5'));var logger=require(_0x5ffc('0x6'))(_0x5ffc('0x7'));var config=require('../../config/environment');var jayson=require(_0x5ffc('0x8'));var client=jayson[_0x5ffc('0x9')][_0x5ffc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f8cd5,_0x12de36,_0x39eec9){return new BPromise(function(_0x454d95,_0x255677){return client['request'](_0x1f8cd5,_0x39eec9)[_0x5ffc('0xb')](function(_0x27df88){logger['info'](_0x5ffc('0xc'),_0x12de36,_0x5ffc('0xd'));logger[_0x5ffc('0xe')](_0x5ffc('0xf'),_0x12de36,'request\x20sent',JSON[_0x5ffc('0x10')](_0x27df88));if(_0x27df88[_0x5ffc('0x11')]){if(_0x27df88[_0x5ffc('0x11')]['code']===0x1f4){logger[_0x5ffc('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x12de36,_0x27df88['error'][_0x5ffc('0x12')]);return _0x255677(_0x27df88[_0x5ffc('0x11')][_0x5ffc('0x12')]);}logger[_0x5ffc('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x12de36,_0x27df88['error'][_0x5ffc('0x12')]);return _0x454d95(_0x27df88[_0x5ffc('0x11')][_0x5ffc('0x12')]);}else{logger[_0x5ffc('0x13')](_0x5ffc('0xc'),_0x12de36,_0x5ffc('0xd'));_0x454d95(_0x27df88[_0x5ffc('0x14')][_0x5ffc('0x12')]);}})['catch'](function(_0x28ed83){logger[_0x5ffc('0x11')](_0x5ffc('0xc'),_0x12de36,_0x28ed83);_0x255677(_0x28ed83);});});}
\ No newline at end of file
index d3c5f1f..61eb344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebd0=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','/:id/sessions','getAnswers','/:id/summary','getSummary','create','post','/:id/clone','clone','put','/:id','update','delete','destroy','exports'];(function(_0x1b3643,_0x1e4ce5){var _0x5e7532=function(_0x2766bd){while(--_0x2766bd){_0x1b3643['push'](_0x1b3643['shift']());}};_0x5e7532(++_0x1e4ce5);}(_0xebd0,0x17a));var _0x0ebd=function(_0x185812,_0x213741){_0x185812=_0x185812-0x0;var _0x3ba116=_0xebd0[_0x185812];return _0x3ba116;};'use strict';var multer=require(_0x0ebd('0x0'));var util=require(_0x0ebd('0x1'));var path=require(_0x0ebd('0x2'));var timeout=require(_0x0ebd('0x3'));var express=require(_0x0ebd('0x4'));var router=express[_0x0ebd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0ebd('0x6'));var interaction=require(_0x0ebd('0x7'));var config=require(_0x0ebd('0x8'));var controller=require(_0x0ebd('0x9'));router['get']('/',auth[_0x0ebd('0xa')](),controller[_0x0ebd('0xb')]);router[_0x0ebd('0xc')]('/:id',auth[_0x0ebd('0xa')](),controller['show']);router[_0x0ebd('0xc')](_0x0ebd('0xd'),auth['isAuthenticated'](),controller['getSessions']);router['get']('/:id/answers',auth[_0x0ebd('0xa')](),controller[_0x0ebd('0xe')]);router[_0x0ebd('0xc')](_0x0ebd('0xf'),auth['isAuthenticated'](),timeout('30s'),controller[_0x0ebd('0x10')]);router['post']('/',auth[_0x0ebd('0xa')](),controller[_0x0ebd('0x11')]);router[_0x0ebd('0x12')](_0x0ebd('0x13'),auth[_0x0ebd('0xa')](),controller[_0x0ebd('0x14')]);router[_0x0ebd('0x15')](_0x0ebd('0x16'),auth[_0x0ebd('0xa')](),controller[_0x0ebd('0x17')]);router[_0x0ebd('0x18')](_0x0ebd('0x16'),auth[_0x0ebd('0xa')](),controller[_0x0ebd('0x19')]);module[_0x0ebd('0x1a')]=router;
\ No newline at end of file
+var _0xa693=['/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/sessions'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa693,0x1d5));var _0x3a69=function(_0x592d48,_0x23f1ba){_0x592d48=_0x592d48-0x0;var _0x5d789e=_0xa693[_0x592d48];return _0x5d789e;};'use strict';var multer=require(_0x3a69('0x0'));var util=require('util');var path=require(_0x3a69('0x1'));var timeout=require(_0x3a69('0x2'));var express=require('express');var router=express[_0x3a69('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3a69('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x3a69('0x5')]('/',auth[_0x3a69('0x6')](),controller[_0x3a69('0x7')]);router[_0x3a69('0x5')](_0x3a69('0x8'),auth[_0x3a69('0x6')](),controller[_0x3a69('0x9')]);router[_0x3a69('0x5')](_0x3a69('0xa'),auth[_0x3a69('0x6')](),controller['getSessions']);router['get'](_0x3a69('0xb'),auth[_0x3a69('0x6')](),controller[_0x3a69('0xc')]);router['get'](_0x3a69('0xd'),auth[_0x3a69('0x6')](),timeout(_0x3a69('0xe')),controller[_0x3a69('0xf')]);router[_0x3a69('0x10')]('/',auth[_0x3a69('0x6')](),controller[_0x3a69('0x11')]);router['post'](_0x3a69('0x12'),auth[_0x3a69('0x6')](),controller[_0x3a69('0x13')]);router['put'](_0x3a69('0x8'),auth[_0x3a69('0x6')](),controller[_0x3a69('0x14')]);router[_0x3a69('0x15')](_0x3a69('0x8'),auth[_0x3a69('0x6')](),controller[_0x3a69('0x16')]);module[_0x3a69('0x17')]=router;
\ No newline at end of file
index 86240bf..bd4a535 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0775=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','STRING','name','long','isObjectLike','formData','isString','setDataValue'];(function(_0xdb6f7f,_0x405e77){var _0x234452=function(_0x46434d){while(--_0x46434d){_0xdb6f7f['push'](_0xdb6f7f['shift']());}};_0x234452(++_0x405e77);}(_0x0775,0x17c));var _0x5077=function(_0x13c9c7,_0x1ce8bc){_0x13c9c7=_0x13c9c7-0x0;var _0x540402=_0x0775[_0x13c9c7];return _0x540402;};'use strict';var Sequelize=require(_0x5077('0x0'));var _=require(_0x5077('0x1'));var util=require(_0x5077('0x2'));module['exports']={'name':{'type':Sequelize[_0x5077('0x3')],'unique':_0x5077('0x4')},'description':{'type':Sequelize[_0x5077('0x3')]},'formData':{'type':Sequelize['TEXT'](_0x5077('0x5')),'set':function(_0x102522){if(_[_0x5077('0x6')](_0x102522)){this['setDataValue'](_0x5077('0x7'),JSON['stringify'](_0x102522));}else if(_[_0x5077('0x8')](_0x102522)){this[_0x5077('0x9')](_0x5077('0x7'),_0x102522);}else{this[_0x5077('0x9')](_0x5077('0x7'),util[_0x5077('0xa')](_0x5077('0xb'),this[_0x5077('0xc')](_0x5077('0x4'))||'',this[_0x5077('0xc')](_0x5077('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x5077('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x4507=['lodash','util','exports','STRING','name','TEXT','long','formData','stringify','isString','setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x4507,0x16f));var _0x7450=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4507[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x7450('0x0'));var _=require(_0x7450('0x1'));var util=require(_0x7450('0x2'));module[_0x7450('0x3')]={'name':{'type':Sequelize[_0x7450('0x4')],'unique':_0x7450('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x7450('0x6')](_0x7450('0x7')),'set':function(_0x576be8){if(_['isObjectLike'](_0x576be8)){this['setDataValue'](_0x7450('0x8'),JSON[_0x7450('0x9')](_0x576be8));}else if(_[_0x7450('0xa')](_0x576be8)){this[_0x7450('0xb')](_0x7450('0x8'),_0x576be8);}else{this[_0x7450('0xb')](_0x7450('0x8'),util['format'](_0x7450('0xc'),this[_0x7450('0xd')](_0x7450('0x5'))||'',this[_0x7450('0xd')](_0x7450('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x7450('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 376245e..8859de8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc5e=['Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','options','includeAll','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','include','merge','updatedAt','omit','createdAt','update','getSessions','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','ProjectId','apply','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename='];(function(_0x2ddb6d,_0x25d45b){var _0x56c103=function(_0x4f73c4){while(--_0x4f73c4){_0x2ddb6d['push'](_0x2ddb6d['shift']());}};_0x56c103(++_0x25d45b);}(_0xbc5e,0x7d));var _0xebc5=function(_0x4dfa2f,_0x1bed90){_0x4dfa2f=_0x4dfa2f-0x0;var _0x1f6a6a=_0xbc5e[_0x4dfa2f];return _0x1f6a6a;};'use strict';var emlformat=require(_0xebc5('0x0'));var rimraf=require(_0xebc5('0x1'));var zipdir=require(_0xebc5('0x2'));var jsonpatch=require(_0xebc5('0x3'));var rp=require(_0xebc5('0x4'));var moment=require(_0xebc5('0x5'));var BPromise=require(_0xebc5('0x6'));var Mustache=require(_0xebc5('0x7'));var util=require(_0xebc5('0x8'));var path=require('path');var sox=require(_0xebc5('0x9'));var csv=require(_0xebc5('0xa'));var ejs=require(_0xebc5('0xb'));var fs=require('fs');var fs_extra=require(_0xebc5('0xc'));var _=require(_0xebc5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xebc5('0xe'));var deskjs=require(_0xebc5('0xf'));var toCsv=require(_0xebc5('0xa'));var querystring=require(_0xebc5('0x10'));var Papa=require('papaparse');var Redis=require(_0xebc5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xebc5('0x12'));var as=require(_0xebc5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebc5('0x14'))(_0xebc5('0x15'));var utils=require(_0xebc5('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x564553,_0x477bc4){_0x477bc4=_0x477bc4||0xcc;return function(_0x30e6f4){if(_0x30e6f4){return _0x564553[_0xebc5('0x17')](_0x477bc4);}return _0x564553[_0xebc5('0x18')](_0x477bc4)[_0xebc5('0x19')]();};}function respondWithResult(_0x23805a,_0x5ba6c1){_0x5ba6c1=_0x5ba6c1||0xc8;return function(_0x375e29){if(_0x375e29){return _0x23805a['status'](_0x5ba6c1)[_0xebc5('0x1a')](_0x375e29);}};}function respondWithFilteredResult(_0x5eff85,_0x4ae3c6){return function(_0x3e903f){if(_0x3e903f){var _0x5489e9=typeof _0x4ae3c6['offset']===_0xebc5('0x1b')&&typeof _0x4ae3c6[_0xebc5('0x1c')]===_0xebc5('0x1b');var _0x21cbdf=_0x3e903f[_0xebc5('0x1d')];var _0x38d629=_0x5489e9?0x0:_0x4ae3c6['offset'];var _0x1aeef3=_0x5489e9?_0x3e903f[_0xebc5('0x1d')]:_0x4ae3c6['offset']+_0x4ae3c6[_0xebc5('0x1c')];var _0x1b1584;if(_0x1aeef3>=_0x21cbdf){_0x1aeef3=_0x21cbdf;_0x1b1584=0xc8;}else{_0x1b1584=0xce;}_0x5eff85['status'](_0x1b1584);return _0x5eff85[_0xebc5('0x1e')](_0xebc5('0x1f'),_0x38d629+'-'+_0x1aeef3+'/'+_0x21cbdf)[_0xebc5('0x1a')](_0x3e903f);}return null;};}function patchUpdates(_0x2170b6){return function(_0x3aff8d){try{jsonpatch['apply'](_0x3aff8d,_0x2170b6,!![]);}catch(_0x4f0a7f){return BPromise['reject'](_0x4f0a7f);}return _0x3aff8d[_0xebc5('0x20')]();};}function saveUpdates(_0x4af3d1,_0x257754){return function(_0x37ac8d){if(_0x37ac8d){return _0x37ac8d['update'](_0x4af3d1)[_0xebc5('0x21')](function(_0x1b247f){return _0x1b247f;});}return null;};}function removeEntity(_0x582541,_0x2be067){return function(_0x3ce69b){if(_0x3ce69b){return _0x3ce69b[_0xebc5('0x22')]()[_0xebc5('0x21')](function(){var _0x46394c=_0x3ce69b[_0xebc5('0x23')]({'plain':!![]});var _0x33bf29='Projects';return db[_0xebc5('0x24')]['destroy']({'where':{'type':_0x33bf29,'resourceId':_0x46394c['id']}})[_0xebc5('0x21')](function(){return _0x3ce69b;});})[_0xebc5('0x21')](function(){_0x582541[_0xebc5('0x18')](0xcc)[_0xebc5('0x19')]();});}};}function handleEntityNotFound(_0x5b6127,_0x193cfe){return function(_0x5dfe9f){if(!_0x5dfe9f){_0x5b6127[_0xebc5('0x17')](0x194);}return _0x5dfe9f;};}function handleError(_0x255b72,_0x36faa3){_0x36faa3=_0x36faa3||0x1f4;return function(_0x46a04e){logger[_0xebc5('0x25')](_0x46a04e[_0xebc5('0x26')]);if(_0x46a04e[_0xebc5('0x27')]){delete _0x46a04e[_0xebc5('0x27')];}_0x255b72[_0xebc5('0x18')](_0x36faa3)[_0xebc5('0x28')](_0x46a04e);};}exports[_0xebc5('0x29')]=function(_0x3e53d0,_0x2acf91){var _0x204113={},_0x531ec2={},_0x120574={'count':0x0,'rows':[]};var _0x55579d=_[_0xebc5('0x2a')](db[_0xebc5('0x2b')][_0xebc5('0x2c')],function(_0x9e791f){return{'name':_0x9e791f[_0xebc5('0x2d')],'type':_0x9e791f[_0xebc5('0x2e')][_0xebc5('0x2f')]};});_0x531ec2[_0xebc5('0x30')]=_[_0xebc5('0x2a')](_0x55579d,'name');_0x531ec2['query']=_['keys'](_0x3e53d0[_0xebc5('0x31')]);_0x531ec2['filters']=_[_0xebc5('0x32')](_0x531ec2[_0xebc5('0x30')],_0x531ec2['query']);_0x204113['attributes']=_['intersection'](_0x531ec2[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x33')]));_0x204113['attributes']=_0x204113[_0xebc5('0x34')]['length']?_0x204113[_0xebc5('0x34')]:_0x531ec2[_0xebc5('0x30')];if(!_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x35')](_0xebc5('0x36'))){_0x204113[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x3e53d0[_0xebc5('0x31')]['limit']);_0x204113[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x204113[_0xebc5('0x38')]=qs['sort'](_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x39')]);_0x204113[_0xebc5('0x3a')]=qs[_0xebc5('0x3b')](_[_0xebc5('0x3c')](_0x3e53d0[_0xebc5('0x31')],_0x531ec2[_0xebc5('0x3b')]),_0x55579d);if(_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x204113['where']=_['merge'](_0x204113[_0xebc5('0x3a')],{'$or':_[_0xebc5('0x2a')](_0x55579d,function(_0x191f1){if(_0x191f1['type']!=='VIRTUAL'){var _0x509adc={};_0x509adc[_0x191f1['name']]={'$like':'%'+_0x3e53d0[_0xebc5('0x31')]['filter']+'%'};return _0x509adc;}})});}_0x204113=_['merge']({},_0x204113,_0x3e53d0[_0xebc5('0x3e')]);var _0x25201a={'where':_0x204113[_0xebc5('0x3a')]};return db[_0xebc5('0x2b')][_0xebc5('0x1d')](_0x25201a)['then'](function(_0x529d35){_0x120574['count']=_0x529d35;if(_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x204113['include']=[{'all':!![]}];}return db[_0xebc5('0x2b')][_0xebc5('0x40')](_0x204113);})[_0xebc5('0x21')](function(_0x1135b9){_0x120574[_0xebc5('0x41')]=_0x1135b9;return _0x120574;})['then'](respondWithFilteredResult(_0x2acf91,_0x204113))[_0xebc5('0x42')](handleError(_0x2acf91,null));};exports[_0xebc5('0x43')]=function(_0x13640e,_0x476200){var _0x3c4801={'raw':![],'where':{'id':_0x13640e[_0xebc5('0x44')]['id']}},_0x4d802b={};_0x4d802b[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x2b')][_0xebc5('0x2c')]);_0x4d802b[_0xebc5('0x31')]=_[_0xebc5('0x45')](_0x13640e[_0xebc5('0x31')]);_0x4d802b[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x4d802b[_0xebc5('0x30')],_0x4d802b[_0xebc5('0x31')]);_0x3c4801[_0xebc5('0x34')]=_['intersection'](_0x4d802b[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x13640e['query'][_0xebc5('0x33')]));_0x3c4801[_0xebc5('0x34')]=_0x3c4801[_0xebc5('0x34')]['length']?_0x3c4801['attributes']:_0x4d802b['model'];if(_0x13640e[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x3c4801['include']=[{'all':!![]}];}_0x3c4801=_['merge']({},_0x3c4801,_0x13640e[_0xebc5('0x3e')]);return db['JscriptyProject'][_0xebc5('0x46')](_0x3c4801)[_0xebc5('0x21')](handleEntityNotFound(_0x476200,null))[_0xebc5('0x21')](respondWithResult(_0x476200,null))[_0xebc5('0x42')](handleError(_0x476200,null));};exports[_0xebc5('0x47')]=function(_0x2fb8b2,_0x5eff33){return db[_0xebc5('0x2b')][_0xebc5('0x47')](_0x2fb8b2[_0xebc5('0x48')],{})[_0xebc5('0x21')](function(_0x340c3e){var _0x3f9054=_0x2fb8b2[_0xebc5('0x49')][_0xebc5('0x23')]({'plain':!![]});if(!_0x3f9054)throw new Error(_0xebc5('0x4a'));if(_0x3f9054[_0xebc5('0x4b')]===_0xebc5('0x49')){var _0x57bbc9=_0x340c3e[_0xebc5('0x23')]({'plain':!![]});var _0x30242a=_0xebc5('0x4c');return db[_0xebc5('0x4d')][_0xebc5('0x46')]({'where':{'name':_0x30242a,'userProfileId':_0x3f9054[_0xebc5('0x4e')]},'raw':!![]})[_0xebc5('0x21')](function(_0x278810){if(_0x278810&&_0x278810[_0xebc5('0x4f')]===0x0){return db['UserProfileResource'][_0xebc5('0x47')]({'name':_0x57bbc9['name'],'resourceId':_0x57bbc9['id'],'type':_0x278810['name'],'sectionId':_0x278810['id']},{})[_0xebc5('0x21')](function(){return _0x340c3e;});}else{return _0x340c3e;}})[_0xebc5('0x42')](function(_0x456c82){logger[_0xebc5('0x25')](_0xebc5('0x50'),_0x456c82);throw _0x456c82;});}return _0x340c3e;})[_0xebc5('0x21')](respondWithResult(_0x5eff33,0xc9))[_0xebc5('0x42')](handleError(_0x5eff33,null));};exports[_0xebc5('0x51')]=function(_0x2d5eb0,_0x2f9d7e){var _0x160ba6={'where':{'id':_0x2d5eb0[_0xebc5('0x44')]['id']}},_0x3e68a9={};_0x3e68a9[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x2b')]['rawAttributes']);_0x160ba6[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x3e68a9[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x2d5eb0[_0xebc5('0x31')][_0xebc5('0x33')]));_0x160ba6[_0xebc5('0x34')]=_0x160ba6[_0xebc5('0x34')][_0xebc5('0x52')]?_0x160ba6[_0xebc5('0x34')]:_0x3e68a9[_0xebc5('0x30')];if(_0x2d5eb0[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x160ba6[_0xebc5('0x53')]=[{'all':!![]}];}_0x160ba6=_[_0xebc5('0x54')]({},_0x160ba6,_0x2d5eb0[_0xebc5('0x3e')]);return db[_0xebc5('0x2b')][_0xebc5('0x46')](_0x160ba6)[_0xebc5('0x21')](handleEntityNotFound(_0x2f9d7e,null))[_0xebc5('0x21')](function(_0x423615){if(_0x423615){var _0x1c49e2=_0x423615[_0xebc5('0x23')]({'plain':!![]});_0x1c49e2=qs['omit'](_0x1c49e2,['id','createdAt',_0xebc5('0x55')]);_0x2d5eb0[_0xebc5('0x48')]=_[_0xebc5('0x56')](_0x2d5eb0['body'],['id',_0xebc5('0x57'),_0xebc5('0x55')]);return db[_0xebc5('0x2b')][_0xebc5('0x47')](_[_0xebc5('0x54')](_0x1c49e2,_0x2d5eb0[_0xebc5('0x48')]),{'include':_0x2d5eb0[_0xebc5('0x31')][_0xebc5('0x3f')]?[{'all':!![]}]:undefined})[_0xebc5('0x21')](function(_0x37c1f5){var _0x467ace=_0x2d5eb0[_0xebc5('0x49')][_0xebc5('0x23')]({'plain':!![]});if(!_0x467ace)throw new Error(_0xebc5('0x4a'));if(_0x467ace[_0xebc5('0x4b')]==='user'){var _0x369fad=_0x37c1f5[_0xebc5('0x23')]({'plain':!![]});var _0x1d0cdd=_0xebc5('0x4c');return db[_0xebc5('0x4d')][_0xebc5('0x46')]({'where':{'name':_0x1d0cdd,'userProfileId':_0x467ace[_0xebc5('0x4e')]},'raw':!![]})[_0xebc5('0x21')](function(_0x2400bc){if(_0x2400bc&&_0x2400bc['autoAssociation']===0x0){return db['UserProfileResource'][_0xebc5('0x47')]({'name':_0x369fad[_0xebc5('0x27')],'resourceId':_0x369fad['id'],'type':_0x2400bc[_0xebc5('0x27')],'sectionId':_0x2400bc['id']},{})[_0xebc5('0x21')](function(){return _0x37c1f5;});}else{return _0x37c1f5;}})[_0xebc5('0x42')](function(_0x257c4f){logger[_0xebc5('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x257c4f);throw _0x257c4f;});}return _0x37c1f5;});}})[_0xebc5('0x21')](respondWithResult(_0x2f9d7e,0xc9))['catch'](handleError(_0x2f9d7e,null));};exports[_0xebc5('0x58')]=function(_0x5b9b89,_0x455776){if(_0x5b9b89[_0xebc5('0x48')]['id']){delete _0x5b9b89[_0xebc5('0x48')]['id'];}return db[_0xebc5('0x2b')][_0xebc5('0x46')]({'where':{'id':_0x5b9b89[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x455776,null))['then'](saveUpdates(_0x5b9b89[_0xebc5('0x48')],null))['then'](respondWithResult(_0x455776,null))['catch'](handleError(_0x455776,null));};exports[_0xebc5('0x22')]=function(_0x3fde32,_0x16ed66){return db[_0xebc5('0x2b')]['find']({'where':{'id':_0x3fde32[_0xebc5('0x44')]['id']}})['then'](handleEntityNotFound(_0x16ed66,null))[_0xebc5('0x21')](removeEntity(_0x16ed66,null))[_0xebc5('0x42')](handleError(_0x16ed66,null));};exports[_0xebc5('0x59')]=function(_0x1045ed,_0xaa81fe,_0x24b593){var _0x5ad9ca={'raw':!![],'where':{}};var _0x5bd876={};var _0x446431={'count':0x0,'rows':[]};return db[_0xebc5('0x2b')]['findOne']({'where':{'id':_0x1045ed[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0xaa81fe,null))[_0xebc5('0x21')](function(_0x539777){if(_0x539777){_0x5bd876[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x5a')][_0xebc5('0x2c')]);_0x5bd876['query']=_[_0xebc5('0x45')](_0x1045ed[_0xebc5('0x31')]);_0x5bd876[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x5bd876['model'],_0x5bd876[_0xebc5('0x31')]);_0x5ad9ca[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x5bd876[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x1045ed['query']['fields']));_0x5ad9ca[_0xebc5('0x34')]=_0x5ad9ca[_0xebc5('0x34')][_0xebc5('0x52')]?_0x5ad9ca['attributes']:_0x5bd876[_0xebc5('0x30')];if(!_0x1045ed[_0xebc5('0x31')][_0xebc5('0x35')](_0xebc5('0x36'))){_0x5ad9ca[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x1045ed[_0xebc5('0x31')][_0xebc5('0x1c')]);_0x5ad9ca[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0x1045ed[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x5ad9ca[_0xebc5('0x38')]=qs[_0xebc5('0x39')](_0x1045ed[_0xebc5('0x31')][_0xebc5('0x39')]);_0x5ad9ca[_0xebc5('0x3a')]=qs[_0xebc5('0x3b')](_[_0xebc5('0x3c')](_0x1045ed[_0xebc5('0x31')],_0x5bd876['filters']));_0x5ad9ca[_0xebc5('0x3a')]['ProjectId']=_0x539777['id'];if(_0x1045ed[_0xebc5('0x31')]['filter']){_0x5ad9ca[_0xebc5('0x3a')]=_[_0xebc5('0x54')](_0x5ad9ca[_0xebc5('0x3a')],{'$or':_['map'](_0x5ad9ca[_0xebc5('0x34')],function(_0x22c5b1){var _0xd9d7cd={};_0xd9d7cd[_0x22c5b1]={'$like':'%'+_0x1045ed[_0xebc5('0x31')][_0xebc5('0x3d')]+'%'};return _0xd9d7cd;})});}_0x5ad9ca=_[_0xebc5('0x54')]({},_0x5ad9ca,_0x1045ed[_0xebc5('0x3e')]);return db[_0xebc5('0x5a')]['count']({'where':_0x5ad9ca['where']})[_0xebc5('0x21')](function(_0x312e74){_0x446431[_0xebc5('0x1d')]=_0x312e74;if(_0x1045ed[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x5ad9ca[_0xebc5('0x53')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xebc5('0x40')](_0x5ad9ca);})['then'](function(_0x210c2e){_0x446431['rows']=_0x210c2e;return _0x446431;});}})[_0xebc5('0x21')](respondWithFilteredResult(_0xaa81fe,_0x5ad9ca))[_0xebc5('0x42')](handleError(_0xaa81fe,null));};exports[_0xebc5('0x5b')]=function(_0x489c71,_0x35cb37,_0x3f12a5){var _0x191376={'raw':!![],'where':{}};var _0x40cbd4={};var _0x44bbd6={'count':0x0,'rows':[]};return db[_0xebc5('0x2b')][_0xebc5('0x5c')]({'where':{'id':_0x489c71[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x35cb37,null))['then'](function(_0x340692){if(_0x340692){_0x40cbd4[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x5d')][_0xebc5('0x2c')]);_0x40cbd4['query']=_[_0xebc5('0x45')](_0x489c71[_0xebc5('0x31')]);_0x40cbd4[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x40cbd4[_0xebc5('0x30')],_0x40cbd4[_0xebc5('0x31')]);_0x191376[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x40cbd4[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x489c71[_0xebc5('0x31')][_0xebc5('0x33')]));_0x191376[_0xebc5('0x34')]=_0x191376['attributes']['length']?_0x191376[_0xebc5('0x34')]:_0x40cbd4['model'];if(!_0x489c71['query'][_0xebc5('0x35')](_0xebc5('0x36'))){_0x191376[_0xebc5('0x1c')]=qs['limit'](_0x489c71[_0xebc5('0x31')][_0xebc5('0x1c')]);_0x191376[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0x489c71[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x191376[_0xebc5('0x38')]=qs[_0xebc5('0x39')](_0x489c71['query'][_0xebc5('0x39')]);_0x191376[_0xebc5('0x3a')]=qs['filters'](_[_0xebc5('0x3c')](_0x489c71['query'],_0x40cbd4[_0xebc5('0x3b')]));_0x191376[_0xebc5('0x3a')][_0xebc5('0x5e')]=_0x340692['id'];if(_0x489c71[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x191376[_0xebc5('0x3a')]=_[_0xebc5('0x54')](_0x191376[_0xebc5('0x3a')],{'$or':_[_0xebc5('0x2a')](_0x191376[_0xebc5('0x34')],function(_0x2ba010){var _0x125536={};_0x125536[_0x2ba010]={'$like':'%'+_0x489c71[_0xebc5('0x31')][_0xebc5('0x3d')]+'%'};return _0x125536;})});}_0x191376=_[_0xebc5('0x54')]({},_0x191376,_0x489c71['options']);return db['JscriptyAnswerReport'][_0xebc5('0x1d')]({'where':_0x191376[_0xebc5('0x3a')]})[_0xebc5('0x21')](function(_0x1b8346){_0x44bbd6[_0xebc5('0x1d')]=_0x1b8346;if(_0x489c71['query'][_0xebc5('0x3f')]){_0x191376['include']=[{'all':!![]}];}return db[_0xebc5('0x5d')]['findAll'](_0x191376);})['then'](function(_0x1f10f5){_0x44bbd6[_0xebc5('0x41')]=_0x1f10f5;return _0x44bbd6;});}})[_0xebc5('0x21')](respondWithFilteredResult(_0x35cb37,_0x191376))[_0xebc5('0x42')](handleError(_0x35cb37,null));};function char(_0x6d153b){return'number'===typeof _0x6d153b?String['fromCharCode'][_0xebc5('0x5f')](null,arguments):_0x6d153b;}function needsEncapsulation(_0x15dc05){return!!_0x15dc05&&(_0x15dc05[_0xebc5('0x60')]()[_0xebc5('0x61')](char(0xd))>=0x0||_0x15dc05['toString']()['indexOf'](char(0xa))>=0x0||_0x15dc05[_0xebc5('0x60')]()[_0xebc5('0x61')](char(0x2c))>=0x0||_0x15dc05[_0xebc5('0x60')]()[_0xebc5('0x61')](char(0x22))>=0x0);}function encapsulate(_0x424e8f){var _0x3d34eb=char(0x22),_0x1bac41='\x5c'+char(0x22),_0xd18901=_0x424e8f['toString']()[_0xebc5('0x62')](new RegExp(_0x3d34eb,'g'),_0x1bac41);return _0x3d34eb+_0xd18901+_0x3d34eb;}exports[_0xebc5('0x63')]=function(_0x317d16,_0x4b3a6c,_0x213ea9){var _0x14c284,_0x2ba117;var _0x5cc8dc={'where':{'ProjectId':_0x317d16[_0xebc5('0x44')]['id']}};if(_0x317d16[_0xebc5('0x31')][_0xebc5('0x64')]){_0x5cc8dc['where'][_0xebc5('0x65')]=JSON[_0xebc5('0x66')](_0x317d16[_0xebc5('0x31')][_0xebc5('0x64')]);}return db['JscriptySessionReport'][_0xebc5('0x40')](_0x5cc8dc)[_0xebc5('0x21')](handleEntityNotFound(_0x4b3a6c,null))[_0xebc5('0x21')](function(_0x3329f6){if(_0x3329f6){_0x14c284=_0x3329f6;return db[_0xebc5('0x67')][_0xebc5('0x40')]({'where':{'SessionId':{'$in':_[_0xebc5('0x2a')](_0x14c284,'id')},'ProjectId':_0x317d16[_0xebc5('0x44')]['id']},'order':'-createdAt'});}})[_0xebc5('0x21')](handleEntityNotFound(_0x4b3a6c,null))['then'](function(_0x55d85f){if(_0x55d85f){_0x2ba117=_0x55d85f;var _0x16200e={};for(var _0x152314=0x0,_0x52280d=_0x2ba117[_0xebc5('0x52')];_0x152314<_0x52280d;_0x152314++){if(!_0x16200e[_0xebc5('0x35')](_0x2ba117[_0x152314][_0xebc5('0x68')])){_0x16200e[_0x2ba117[_0x152314][_0xebc5('0x68')]]=needsEncapsulation(_0x2ba117[_0x152314][_0xebc5('0x69')])?encapsulate(_0x2ba117[_0x152314][_0xebc5('0x69')]):_0x2ba117[_0x152314][_0xebc5('0x69')];}}var _0x5c0a46=[],_0x355ace={};for(var _0x1f83e6=0x0,_0x54770d=_0x14c284[_0xebc5('0x52')];_0x1f83e6<_0x54770d;_0x1f83e6++){_0x355ace={'ProjectId':_0x317d16['params']['id'],'SessionId':_0x14c284[_0x1f83e6]['id'],'StartTime':moment(_0x14c284[_0x1f83e6][_0xebc5('0x65')])[_0xebc5('0x6a')](_0xebc5('0x6b'))};for(var _0x2e4242=0x0,_0x210e2c=_0x2ba117['length'];_0x2e4242<_0x210e2c;_0x2e4242++){if(_0x2ba117[_0x2e4242][_0xebc5('0x6c')]==_0x14c284[_0x1f83e6]['id']&&_0x16200e['hasOwnProperty'](_0x2ba117[_0x2e4242][_0xebc5('0x68')])){_0x355ace[_0x16200e[_0x2ba117[_0x2e4242][_0xebc5('0x68')]]]=_0x2ba117[_0x2e4242][_0xebc5('0x6d')];}}for(var _0x124749 in _0x16200e){if(!_0x355ace[_0xebc5('0x35')](_0x16200e[_0x124749])){_0x355ace[_0x16200e[_0x124749]]=null;}}_0x5c0a46[_0xebc5('0x6e')](_0x355ace);}return _0x5c0a46;}})[_0xebc5('0x21')](function(_0x38c407){if(!_[_0xebc5('0x6f')](_0x38c407)){var _0x3acadc=toCsv(_0x38c407);var _0x17aefe=Date['now']();fs[_0xebc5('0x70')](util[_0xebc5('0x6a')](_0xebc5('0x71'),_0x317d16[_0xebc5('0x44')]['id'],_0x17aefe),_0x3acadc);_0x4b3a6c[_0xebc5('0x72')](_0xebc5('0x73'),_0xebc5('0x74')+util['format'](_0xebc5('0x75'),_0x317d16[_0xebc5('0x44')]['id'],_0x17aefe));_0x4b3a6c[_0xebc5('0x72')](_0xebc5('0x76'),_0xebc5('0x77'));return _0x4b3a6c[_0xebc5('0x78')](util['format'](_0xebc5('0x71'),_0x317d16[_0xebc5('0x44')]['id'],_0x17aefe));}else{return _0x4b3a6c[_0xebc5('0x17')](0xcc);}})[_0xebc5('0x42')](handleError(_0x4b3a6c,null));};
\ No newline at end of file
+var _0x60a5=['JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','startTime','starttime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','now','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','destroy','error','name','send','index','map','JscriptyProject','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','include','find','create','body','user','role','Projects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','UserProfileResource','params','getSessions','JscriptySessionReport','rawAttributes','ProjectId','getAnswers','findOne'];(function(_0x58e3e4,_0x4f64f1){var _0xa4bf76=function(_0x760cfd){while(--_0x760cfd){_0x58e3e4['push'](_0x58e3e4['shift']());}};_0xa4bf76(++_0x4f64f1);}(_0x60a5,0x83));var _0x560a=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x60a5[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x560a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x560a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x560a('0x2'));var Mustache=require(_0x560a('0x3'));var util=require(_0x560a('0x4'));var path=require('path');var sox=require(_0x560a('0x5'));var csv=require(_0x560a('0x6'));var ejs=require(_0x560a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x560a('0x8'));var deskjs=require(_0x560a('0x9'));var toCsv=require(_0x560a('0x6'));var querystring=require(_0x560a('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x560a('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x560a('0xc'));var hardwareService=require(_0x560a('0xd'));var logger=require('../../config/logger')(_0x560a('0xe'));var utils=require(_0x560a('0xf'));var config=require(_0x560a('0x10'));var licenseUtil=require(_0x560a('0x11'));var db=require(_0x560a('0x12'))['db'];function respondWithStatusCode(_0x87eb7e,_0x264f09){_0x264f09=_0x264f09||0xcc;return function(_0x276796){if(_0x276796){return _0x87eb7e[_0x560a('0x13')](_0x264f09);}return _0x87eb7e['status'](_0x264f09)[_0x560a('0x14')]();};}function respondWithResult(_0x102074,_0x24ed9b){_0x24ed9b=_0x24ed9b||0xc8;return function(_0x5c7c29){if(_0x5c7c29){return _0x102074[_0x560a('0x15')](_0x24ed9b)[_0x560a('0x16')](_0x5c7c29);}};}function respondWithFilteredResult(_0x99e26,_0x228b9b){return function(_0x54a445){if(_0x54a445){var _0x28c09d=typeof _0x228b9b[_0x560a('0x17')]===_0x560a('0x18')&&typeof _0x228b9b[_0x560a('0x19')]==='undefined';var _0x48acea=_0x54a445[_0x560a('0x1a')];var _0x251a08=_0x28c09d?0x0:_0x228b9b[_0x560a('0x17')];var _0x9729b8=_0x28c09d?_0x54a445['count']:_0x228b9b[_0x560a('0x17')]+_0x228b9b[_0x560a('0x19')];var _0xb24d7a;if(_0x9729b8>=_0x48acea){_0x9729b8=_0x48acea;_0xb24d7a=0xc8;}else{_0xb24d7a=0xce;}_0x99e26[_0x560a('0x15')](_0xb24d7a);return _0x99e26[_0x560a('0x1b')]('Content-Range',_0x251a08+'-'+_0x9729b8+'/'+_0x48acea)[_0x560a('0x16')](_0x54a445);}return null;};}function patchUpdates(_0x155c2b){return function(_0x1d2e4c){try{jsonpatch[_0x560a('0x1c')](_0x1d2e4c,_0x155c2b,!![]);}catch(_0x23bfd6){return BPromise[_0x560a('0x1d')](_0x23bfd6);}return _0x1d2e4c[_0x560a('0x1e')]();};}function saveUpdates(_0x4f33a8,_0x292a5a){return function(_0x1c1048){if(_0x1c1048){return _0x1c1048[_0x560a('0x1f')](_0x4f33a8)[_0x560a('0x20')](function(_0x29167f){return _0x29167f;});}return null;};}function removeEntity(_0x44d7e0,_0x359d60){return function(_0x423822){if(_0x423822){return _0x423822['destroy']()['then'](function(){var _0x535737=_0x423822[_0x560a('0x21')]({'plain':!![]});var _0x15b707='Projects';return db['UserProfileResource'][_0x560a('0x22')]({'where':{'type':_0x15b707,'resourceId':_0x535737['id']}})['then'](function(){return _0x423822;});})[_0x560a('0x20')](function(){_0x44d7e0[_0x560a('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6ad203,_0x4430e8){return function(_0x56557a){if(!_0x56557a){_0x6ad203[_0x560a('0x13')](0x194);}return _0x56557a;};}function handleError(_0x266717,_0x36efee){_0x36efee=_0x36efee||0x1f4;return function(_0x305bd9){logger[_0x560a('0x23')](_0x305bd9['stack']);if(_0x305bd9[_0x560a('0x24')]){delete _0x305bd9[_0x560a('0x24')];}_0x266717['status'](_0x36efee)[_0x560a('0x25')](_0x305bd9);};}exports[_0x560a('0x26')]=function(_0xf4a166,_0x6434c2){var _0x23138f={},_0x226c9c={},_0xbebcf8={'count':0x0,'rows':[]};var _0x54817a=_[_0x560a('0x27')](db[_0x560a('0x28')]['rawAttributes'],function(_0x5b79a3){return{'name':_0x5b79a3[_0x560a('0x29')],'type':_0x5b79a3[_0x560a('0x2a')][_0x560a('0x2b')]};});_0x226c9c[_0x560a('0x2c')]=_['map'](_0x54817a,'name');_0x226c9c['query']=_[_0x560a('0x2d')](_0xf4a166[_0x560a('0x2e')]);_0x226c9c[_0x560a('0x2f')]=_[_0x560a('0x30')](_0x226c9c[_0x560a('0x2c')],_0x226c9c[_0x560a('0x2e')]);_0x23138f[_0x560a('0x31')]=_[_0x560a('0x30')](_0x226c9c[_0x560a('0x2c')],qs[_0x560a('0x32')](_0xf4a166['query'][_0x560a('0x32')]));_0x23138f[_0x560a('0x31')]=_0x23138f[_0x560a('0x31')][_0x560a('0x33')]?_0x23138f[_0x560a('0x31')]:_0x226c9c['model'];if(!_0xf4a166['query'][_0x560a('0x34')](_0x560a('0x35'))){_0x23138f[_0x560a('0x19')]=qs[_0x560a('0x19')](_0xf4a166[_0x560a('0x2e')]['limit']);_0x23138f[_0x560a('0x17')]=qs[_0x560a('0x17')](_0xf4a166['query'][_0x560a('0x17')]);}_0x23138f[_0x560a('0x36')]=qs[_0x560a('0x37')](_0xf4a166[_0x560a('0x2e')][_0x560a('0x37')]);_0x23138f[_0x560a('0x38')]=qs['filters'](_[_0x560a('0x39')](_0xf4a166[_0x560a('0x2e')],_0x226c9c[_0x560a('0x2f')]),_0x54817a);if(_0xf4a166[_0x560a('0x2e')]['filter']){_0x23138f[_0x560a('0x38')]=_['merge'](_0x23138f[_0x560a('0x38')],{'$or':_[_0x560a('0x27')](_0x54817a,function(_0x2e7405){if(_0x2e7405[_0x560a('0x2a')]!==_0x560a('0x3a')){var _0x8f8f84={};_0x8f8f84[_0x2e7405[_0x560a('0x24')]]={'$like':'%'+_0xf4a166[_0x560a('0x2e')][_0x560a('0x3b')]+'%'};return _0x8f8f84;}})});}_0x23138f=_[_0x560a('0x3c')]({},_0x23138f,_0xf4a166[_0x560a('0x3d')]);var _0x1fd711={'where':_0x23138f[_0x560a('0x38')]};return db['JscriptyProject'][_0x560a('0x1a')](_0x1fd711)[_0x560a('0x20')](function(_0x2bbc11){_0xbebcf8[_0x560a('0x1a')]=_0x2bbc11;if(_0xf4a166['query'][_0x560a('0x3e')]){_0x23138f['include']=[{'all':!![]}];}return db['JscriptyProject'][_0x560a('0x3f')](_0x23138f);})[_0x560a('0x20')](function(_0x11c8bd){_0xbebcf8[_0x560a('0x40')]=_0x11c8bd;return _0xbebcf8;})[_0x560a('0x20')](respondWithFilteredResult(_0x6434c2,_0x23138f))[_0x560a('0x41')](handleError(_0x6434c2,null));};exports['show']=function(_0x2ffe3e,_0x456309){var _0x4eb404={'raw':![],'where':{'id':_0x2ffe3e['params']['id']}},_0x50a2b6={};_0x50a2b6[_0x560a('0x2c')]=_[_0x560a('0x2d')](db[_0x560a('0x28')]['rawAttributes']);_0x50a2b6['query']=_[_0x560a('0x2d')](_0x2ffe3e['query']);_0x50a2b6[_0x560a('0x2f')]=_[_0x560a('0x30')](_0x50a2b6[_0x560a('0x2c')],_0x50a2b6['query']);_0x4eb404[_0x560a('0x31')]=_[_0x560a('0x30')](_0x50a2b6[_0x560a('0x2c')],qs['fields'](_0x2ffe3e[_0x560a('0x2e')][_0x560a('0x32')]));_0x4eb404[_0x560a('0x31')]=_0x4eb404['attributes']['length']?_0x4eb404[_0x560a('0x31')]:_0x50a2b6['model'];if(_0x2ffe3e[_0x560a('0x2e')]['includeAll']){_0x4eb404[_0x560a('0x42')]=[{'all':!![]}];}_0x4eb404=_[_0x560a('0x3c')]({},_0x4eb404,_0x2ffe3e[_0x560a('0x3d')]);return db[_0x560a('0x28')][_0x560a('0x43')](_0x4eb404)[_0x560a('0x20')](handleEntityNotFound(_0x456309,null))[_0x560a('0x20')](respondWithResult(_0x456309,null))[_0x560a('0x41')](handleError(_0x456309,null));};exports['create']=function(_0x20852d,_0x49b90c){return db['JscriptyProject'][_0x560a('0x44')](_0x20852d[_0x560a('0x45')],{})[_0x560a('0x20')](function(_0x27f307){var _0x4d68e9=_0x20852d[_0x560a('0x46')][_0x560a('0x21')]({'plain':!![]});if(!_0x4d68e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d68e9[_0x560a('0x47')]===_0x560a('0x46')){var _0x4ce22d=_0x27f307[_0x560a('0x21')]({'plain':!![]});var _0x362a8c=_0x560a('0x48');return db[_0x560a('0x49')]['find']({'where':{'name':_0x362a8c,'userProfileId':_0x4d68e9[_0x560a('0x4a')]},'raw':!![]})[_0x560a('0x20')](function(_0x2f7878){if(_0x2f7878&&_0x2f7878[_0x560a('0x4b')]===0x0){return db['UserProfileResource'][_0x560a('0x44')]({'name':_0x4ce22d[_0x560a('0x24')],'resourceId':_0x4ce22d['id'],'type':_0x2f7878[_0x560a('0x24')],'sectionId':_0x2f7878['id']},{})[_0x560a('0x20')](function(){return _0x27f307;});}else{return _0x27f307;}})[_0x560a('0x41')](function(_0x1281c5){logger[_0x560a('0x23')](_0x560a('0x4c'),_0x1281c5);throw _0x1281c5;});}return _0x27f307;})['then'](respondWithResult(_0x49b90c,0xc9))[_0x560a('0x41')](handleError(_0x49b90c,null));};exports[_0x560a('0x4d')]=function(_0x215ad6,_0x496f07){var _0x5af9f3={'where':{'id':_0x215ad6['params']['id']}},_0x47454a={};_0x47454a[_0x560a('0x2c')]=_['keys'](db[_0x560a('0x28')]['rawAttributes']);_0x5af9f3[_0x560a('0x31')]=_[_0x560a('0x30')](_0x47454a[_0x560a('0x2c')],qs[_0x560a('0x32')](_0x215ad6[_0x560a('0x2e')][_0x560a('0x32')]));_0x5af9f3['attributes']=_0x5af9f3['attributes'][_0x560a('0x33')]?_0x5af9f3[_0x560a('0x31')]:_0x47454a[_0x560a('0x2c')];if(_0x215ad6[_0x560a('0x2e')][_0x560a('0x3e')]){_0x5af9f3[_0x560a('0x42')]=[{'all':!![]}];}_0x5af9f3=_[_0x560a('0x3c')]({},_0x5af9f3,_0x215ad6[_0x560a('0x3d')]);return db[_0x560a('0x28')]['find'](_0x5af9f3)[_0x560a('0x20')](handleEntityNotFound(_0x496f07,null))[_0x560a('0x20')](function(_0x5965a2){if(_0x5965a2){var _0x131744=_0x5965a2[_0x560a('0x21')]({'plain':!![]});_0x131744=qs[_0x560a('0x4e')](_0x131744,['id','createdAt',_0x560a('0x4f')]);_0x215ad6['body']=_[_0x560a('0x4e')](_0x215ad6[_0x560a('0x45')],['id',_0x560a('0x50'),'updatedAt']);return db[_0x560a('0x28')][_0x560a('0x44')](_[_0x560a('0x3c')](_0x131744,_0x215ad6[_0x560a('0x45')]),{'include':_0x215ad6['query'][_0x560a('0x3e')]?[{'all':!![]}]:undefined})[_0x560a('0x20')](function(_0x234c5b){var _0x5b4f15=_0x215ad6[_0x560a('0x46')]['get']({'plain':!![]});if(!_0x5b4f15)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b4f15['role']===_0x560a('0x46')){var _0x200474=_0x234c5b[_0x560a('0x21')]({'plain':!![]});var _0x25a7a3=_0x560a('0x48');return db[_0x560a('0x49')][_0x560a('0x43')]({'where':{'name':_0x25a7a3,'userProfileId':_0x5b4f15['userProfileId']},'raw':!![]})[_0x560a('0x20')](function(_0xf70a2d){if(_0xf70a2d&&_0xf70a2d[_0x560a('0x4b')]===0x0){return db[_0x560a('0x51')]['create']({'name':_0x200474[_0x560a('0x24')],'resourceId':_0x200474['id'],'type':_0xf70a2d[_0x560a('0x24')],'sectionId':_0xf70a2d['id']},{})[_0x560a('0x20')](function(){return _0x234c5b;});}else{return _0x234c5b;}})[_0x560a('0x41')](function(_0x3c3d3b){logger[_0x560a('0x23')](_0x560a('0x4c'),_0x3c3d3b);throw _0x3c3d3b;});}return _0x234c5b;});}})['then'](respondWithResult(_0x496f07,0xc9))[_0x560a('0x41')](handleError(_0x496f07,null));};exports['update']=function(_0x3874d2,_0x4b0bcc){if(_0x3874d2[_0x560a('0x45')]['id']){delete _0x3874d2[_0x560a('0x45')]['id'];}return db[_0x560a('0x28')]['find']({'where':{'id':_0x3874d2[_0x560a('0x52')]['id']}})[_0x560a('0x20')](handleEntityNotFound(_0x4b0bcc,null))[_0x560a('0x20')](saveUpdates(_0x3874d2[_0x560a('0x45')],null))['then'](respondWithResult(_0x4b0bcc,null))[_0x560a('0x41')](handleError(_0x4b0bcc,null));};exports[_0x560a('0x22')]=function(_0x326a69,_0x3bae0e){return db[_0x560a('0x28')]['find']({'where':{'id':_0x326a69[_0x560a('0x52')]['id']}})['then'](handleEntityNotFound(_0x3bae0e,null))[_0x560a('0x20')](removeEntity(_0x3bae0e,null))[_0x560a('0x41')](handleError(_0x3bae0e,null));};exports[_0x560a('0x53')]=function(_0x5c6bfe,_0x177f33,_0x15a58d){var _0x1b326c={'raw':!![],'where':{}};var _0x1f2aeb={};var _0x5f33b0={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x5c6bfe['params']['id']}})[_0x560a('0x20')](handleEntityNotFound(_0x177f33,null))[_0x560a('0x20')](function(_0x8c479f){if(_0x8c479f){_0x1f2aeb['model']=_[_0x560a('0x2d')](db[_0x560a('0x54')][_0x560a('0x55')]);_0x1f2aeb[_0x560a('0x2e')]=_[_0x560a('0x2d')](_0x5c6bfe[_0x560a('0x2e')]);_0x1f2aeb[_0x560a('0x2f')]=_[_0x560a('0x30')](_0x1f2aeb[_0x560a('0x2c')],_0x1f2aeb[_0x560a('0x2e')]);_0x1b326c['attributes']=_[_0x560a('0x30')](_0x1f2aeb[_0x560a('0x2c')],qs[_0x560a('0x32')](_0x5c6bfe[_0x560a('0x2e')][_0x560a('0x32')]));_0x1b326c[_0x560a('0x31')]=_0x1b326c['attributes']['length']?_0x1b326c[_0x560a('0x31')]:_0x1f2aeb[_0x560a('0x2c')];if(!_0x5c6bfe['query'][_0x560a('0x34')](_0x560a('0x35'))){_0x1b326c[_0x560a('0x19')]=qs[_0x560a('0x19')](_0x5c6bfe['query'][_0x560a('0x19')]);_0x1b326c[_0x560a('0x17')]=qs[_0x560a('0x17')](_0x5c6bfe[_0x560a('0x2e')][_0x560a('0x17')]);}_0x1b326c['order']=qs[_0x560a('0x37')](_0x5c6bfe[_0x560a('0x2e')][_0x560a('0x37')]);_0x1b326c[_0x560a('0x38')]=qs[_0x560a('0x2f')](_['pick'](_0x5c6bfe[_0x560a('0x2e')],_0x1f2aeb[_0x560a('0x2f')]));_0x1b326c[_0x560a('0x38')][_0x560a('0x56')]=_0x8c479f['id'];if(_0x5c6bfe[_0x560a('0x2e')][_0x560a('0x3b')]){_0x1b326c['where']=_['merge'](_0x1b326c[_0x560a('0x38')],{'$or':_[_0x560a('0x27')](_0x1b326c[_0x560a('0x31')],function(_0x1783be){var _0x465317={};_0x465317[_0x1783be]={'$like':'%'+_0x5c6bfe[_0x560a('0x2e')][_0x560a('0x3b')]+'%'};return _0x465317;})});}_0x1b326c=_[_0x560a('0x3c')]({},_0x1b326c,_0x5c6bfe[_0x560a('0x3d')]);return db['JscriptySessionReport']['count']({'where':_0x1b326c[_0x560a('0x38')]})[_0x560a('0x20')](function(_0x16a9ce){_0x5f33b0['count']=_0x16a9ce;if(_0x5c6bfe[_0x560a('0x2e')]['includeAll']){_0x1b326c[_0x560a('0x42')]=[{'all':!![]}];}return db[_0x560a('0x54')][_0x560a('0x3f')](_0x1b326c);})[_0x560a('0x20')](function(_0x36af8b){_0x5f33b0[_0x560a('0x40')]=_0x36af8b;return _0x5f33b0;});}})[_0x560a('0x20')](respondWithFilteredResult(_0x177f33,_0x1b326c))[_0x560a('0x41')](handleError(_0x177f33,null));};exports[_0x560a('0x57')]=function(_0x32af36,_0x5ac917,_0x4cc2bc){var _0x4e26b1={'raw':!![],'where':{}};var _0x3ce023={};var _0x573517={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x560a('0x58')]({'where':{'id':_0x32af36[_0x560a('0x52')]['id']}})[_0x560a('0x20')](handleEntityNotFound(_0x5ac917,null))[_0x560a('0x20')](function(_0x59b376){if(_0x59b376){_0x3ce023[_0x560a('0x2c')]=_[_0x560a('0x2d')](db[_0x560a('0x59')][_0x560a('0x55')]);_0x3ce023[_0x560a('0x2e')]=_['keys'](_0x32af36['query']);_0x3ce023[_0x560a('0x2f')]=_[_0x560a('0x30')](_0x3ce023['model'],_0x3ce023[_0x560a('0x2e')]);_0x4e26b1['attributes']=_[_0x560a('0x30')](_0x3ce023[_0x560a('0x2c')],qs[_0x560a('0x32')](_0x32af36[_0x560a('0x2e')][_0x560a('0x32')]));_0x4e26b1[_0x560a('0x31')]=_0x4e26b1[_0x560a('0x31')][_0x560a('0x33')]?_0x4e26b1['attributes']:_0x3ce023[_0x560a('0x2c')];if(!_0x32af36[_0x560a('0x2e')][_0x560a('0x34')]('nolimit')){_0x4e26b1['limit']=qs[_0x560a('0x19')](_0x32af36[_0x560a('0x2e')]['limit']);_0x4e26b1['offset']=qs['offset'](_0x32af36[_0x560a('0x2e')][_0x560a('0x17')]);}_0x4e26b1[_0x560a('0x36')]=qs[_0x560a('0x37')](_0x32af36[_0x560a('0x2e')][_0x560a('0x37')]);_0x4e26b1[_0x560a('0x38')]=qs[_0x560a('0x2f')](_['pick'](_0x32af36[_0x560a('0x2e')],_0x3ce023[_0x560a('0x2f')]));_0x4e26b1[_0x560a('0x38')][_0x560a('0x56')]=_0x59b376['id'];if(_0x32af36[_0x560a('0x2e')][_0x560a('0x3b')]){_0x4e26b1['where']=_[_0x560a('0x3c')](_0x4e26b1[_0x560a('0x38')],{'$or':_['map'](_0x4e26b1[_0x560a('0x31')],function(_0x49221a){var _0x44587e={};_0x44587e[_0x49221a]={'$like':'%'+_0x32af36[_0x560a('0x2e')][_0x560a('0x3b')]+'%'};return _0x44587e;})});}_0x4e26b1=_['merge']({},_0x4e26b1,_0x32af36[_0x560a('0x3d')]);return db[_0x560a('0x59')][_0x560a('0x1a')]({'where':_0x4e26b1[_0x560a('0x38')]})[_0x560a('0x20')](function(_0x239727){_0x573517[_0x560a('0x1a')]=_0x239727;if(_0x32af36[_0x560a('0x2e')][_0x560a('0x3e')]){_0x4e26b1[_0x560a('0x42')]=[{'all':!![]}];}return db[_0x560a('0x59')][_0x560a('0x3f')](_0x4e26b1);})['then'](function(_0x6dabbc){_0x573517[_0x560a('0x40')]=_0x6dabbc;return _0x573517;});}})['then'](respondWithFilteredResult(_0x5ac917,_0x4e26b1))[_0x560a('0x41')](handleError(_0x5ac917,null));};function char(_0x39b45f){return _0x560a('0x5a')===typeof _0x39b45f?String[_0x560a('0x5b')][_0x560a('0x1c')](null,arguments):_0x39b45f;}function needsEncapsulation(_0x490d54){return!!_0x490d54&&(_0x490d54[_0x560a('0x5c')]()['indexOf'](char(0xd))>=0x0||_0x490d54['toString']()[_0x560a('0x5d')](char(0xa))>=0x0||_0x490d54[_0x560a('0x5c')]()[_0x560a('0x5d')](char(0x2c))>=0x0||_0x490d54[_0x560a('0x5c')]()[_0x560a('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x4f765){var _0x1f4a1d=char(0x22),_0x5826c9='\x5c'+char(0x22),_0x9f1871=_0x4f765[_0x560a('0x5c')]()['replace'](new RegExp(_0x1f4a1d,'g'),_0x5826c9);return _0x1f4a1d+_0x9f1871+_0x1f4a1d;}exports[_0x560a('0x5e')]=function(_0xa60695,_0x96faea,_0xcff9f0){var _0x51fc49,_0x5b8709;var _0x94cd68={'where':{'ProjectId':_0xa60695[_0x560a('0x52')]['id']}};if(_0xa60695[_0x560a('0x2e')][_0x560a('0x5f')]){_0x94cd68[_0x560a('0x38')][_0x560a('0x60')]=JSON['parse'](_0xa60695[_0x560a('0x2e')]['startTime']);}return db[_0x560a('0x54')][_0x560a('0x3f')](_0x94cd68)[_0x560a('0x20')](handleEntityNotFound(_0x96faea,null))[_0x560a('0x20')](function(_0x520573){if(_0x520573){_0x51fc49=_0x520573;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0x560a('0x27')](_0x51fc49,'id')},'ProjectId':_0xa60695[_0x560a('0x52')]['id']},'order':_0x560a('0x61')});}})[_0x560a('0x20')](handleEntityNotFound(_0x96faea,null))[_0x560a('0x20')](function(_0x522c26){if(_0x522c26){_0x5b8709=_0x522c26;var _0x340a43={};for(var _0x20d8ca=0x0,_0x3e39f6=_0x5b8709[_0x560a('0x33')];_0x20d8ca<_0x3e39f6;_0x20d8ca++){if(!_0x340a43[_0x560a('0x34')](_0x5b8709[_0x20d8ca][_0x560a('0x62')])){_0x340a43[_0x5b8709[_0x20d8ca][_0x560a('0x62')]]=needsEncapsulation(_0x5b8709[_0x20d8ca][_0x560a('0x63')])?encapsulate(_0x5b8709[_0x20d8ca][_0x560a('0x63')]):_0x5b8709[_0x20d8ca][_0x560a('0x63')];}}var _0x277310=[],_0x18b3d8={};for(var _0x3357f0=0x0,_0x218553=_0x51fc49['length'];_0x3357f0<_0x218553;_0x3357f0++){_0x18b3d8={'ProjectId':_0xa60695[_0x560a('0x52')]['id'],'SessionId':_0x51fc49[_0x3357f0]['id'],'StartTime':moment(_0x51fc49[_0x3357f0][_0x560a('0x60')])[_0x560a('0x64')](_0x560a('0x65'))};for(var _0x46d539=0x0,_0x50415c=_0x5b8709['length'];_0x46d539<_0x50415c;_0x46d539++){if(_0x5b8709[_0x46d539][_0x560a('0x66')]==_0x51fc49[_0x3357f0]['id']&&_0x340a43[_0x560a('0x34')](_0x5b8709[_0x46d539][_0x560a('0x62')])){_0x18b3d8[_0x340a43[_0x5b8709[_0x46d539][_0x560a('0x62')]]]=_0x5b8709[_0x46d539]['answer'];}}for(var _0x28fd0f in _0x340a43){if(!_0x18b3d8[_0x560a('0x34')](_0x340a43[_0x28fd0f])){_0x18b3d8[_0x340a43[_0x28fd0f]]=null;}}_0x277310['push'](_0x18b3d8);}return _0x277310;}})['then'](function(_0x210bc8){if(!_['isEmpty'](_0x210bc8)){var _0x4a55a4=toCsv(_0x210bc8);var _0x50be50=Date[_0x560a('0x67')]();fs['writeFileSync'](util[_0x560a('0x64')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0xa60695['params']['id'],_0x50be50),_0x4a55a4);_0x96faea[_0x560a('0x68')](_0x560a('0x69'),_0x560a('0x6a')+util[_0x560a('0x64')]('Jscripty_Project_%d_Summary_%s.csv',_0xa60695[_0x560a('0x52')]['id'],_0x50be50));_0x96faea[_0x560a('0x68')](_0x560a('0x6b'),_0x560a('0x6c'));return _0x96faea[_0x560a('0x6d')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0xa60695['params']['id'],_0x50be50));}else{return _0x96faea['sendStatus'](0xcc);}})[_0x560a('0x41')](handleError(_0x96faea,null));};
\ No newline at end of file
index 0914ccc..d6dbaf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ade=['define','JscriptyProject','jscripty_projects','lodash','util','moment','request-promise','path','./jscriptyProject.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9ade,0x107));var _0xe9ad=function(_0x1e8ac9,_0x1bd0fe){_0x1e8ac9=_0x1e8ac9-0x0;var _0x4c895c=_0x9ade[_0x1e8ac9];return _0x4c895c;};'use strict';var _=require(_0xe9ad('0x0'));var util=require(_0xe9ad('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe9ad('0x2'));var BPromise=require('bluebird');var rp=require(_0xe9ad('0x3'));var fs=require('fs');var path=require(_0xe9ad('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe9ad('0x5'));module[_0xe9ad('0x6')]=function(_0xdd1549,_0x3e4092){return _0xdd1549[_0xe9ad('0x7')](_0xe9ad('0x8'),attributes,{'tableName':_0xe9ad('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd2bb=['moment','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util','api'];(function(_0x23f4ad,_0xb1c02f){var _0x42e2ec=function(_0x4f39e0){while(--_0x4f39e0){_0x23f4ad['push'](_0x23f4ad['shift']());}};_0x42e2ec(++_0xb1c02f);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x1db919,_0x55398b){_0x1db919=_0x1db919-0x0;var _0x2125d7=_0xd2bb[_0x1db919];return _0x2125d7;};'use strict';var _=require('lodash');var util=require(_0xbd2b('0x0'));var logger=require('../../config/logger')(_0xbd2b('0x1'));var moment=require(_0xbd2b('0x2'));var BPromise=require(_0xbd2b('0x3'));var rp=require(_0xbd2b('0x4'));var fs=require('fs');var path=require(_0xbd2b('0x5'));var rimraf=require(_0xbd2b('0x6'));var config=require('../../config/environment');var attributes=require(_0xbd2b('0x7'));module[_0xbd2b('0x8')]=function(_0xdcd8bd,_0x2f64a8){return _0xdcd8bd[_0xbd2b('0x9')](_0xbd2b('0xa'),attributes,{'tableName':_0xbd2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 422ac2d..75252b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['code','message','JscriptyProject,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x54a497,_0xca79ec){var _0x364671=function(_0x4f7e54){while(--_0x4f7e54){_0x54a497['push'](_0x54a497['shift']());}};_0x364671(++_0xca79ec);}(_0x9bde,0xe1));var _0xe9bd=function(_0x24b11c,_0x440d98){_0x24b11c=_0x24b11c-0x0;var _0xfafed6=_0x9bde[_0x24b11c];return _0xfafed6;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});}
\ No newline at end of file
+var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xfee3b9,_0x528ec5){var _0x5794ef=function(_0x2f776c){while(--_0x2f776c){_0xfee3b9['push'](_0xfee3b9['shift']());}};_0x5794ef(++_0x528ec5);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3eb1db,_0x3504c5){_0x3eb1db=_0x3eb1db-0x0;var _0x406814=_0xf4eb[_0x3eb1db];return _0x406814;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}
\ No newline at end of file
index 49bb5d9..eca98f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f7d=['index','/describe','describe','get','/:id','show','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated'];(function(_0x2a1465,_0x8bf785){var _0x128933=function(_0x4f2a1f){while(--_0x4f2a1f){_0x2a1465['push'](_0x2a1465['shift']());}};_0x128933(++_0x8bf785);}(_0x5f7d,0x15a));var _0xd5f7=function(_0x3f4932,_0x34425e){_0x3f4932=_0x3f4932-0x0;var _0xafc18b=_0x5f7d[_0x3f4932];return _0xafc18b;};'use strict';var multer=require(_0xd5f7('0x0'));var util=require(_0xd5f7('0x1'));var path=require(_0xd5f7('0x2'));var timeout=require(_0xd5f7('0x3'));var express=require(_0xd5f7('0x4'));var router=express[_0xd5f7('0x5')]();var fs_extra=require(_0xd5f7('0x6'));var auth=require(_0xd5f7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd5f7('0x8'));var controller=require(_0xd5f7('0x9'));router['get']('/',auth[_0xd5f7('0xa')](),controller[_0xd5f7('0xb')]);router['get'](_0xd5f7('0xc'),auth[_0xd5f7('0xa')](),controller[_0xd5f7('0xd')]);router[_0xd5f7('0xe')](_0xd5f7('0xf'),auth['isAuthenticated'](),controller[_0xd5f7('0x10')]);router['post']('/',auth[_0xd5f7('0xa')](),controller[_0xd5f7('0x11')]);router['put'](_0xd5f7('0xf'),auth[_0xd5f7('0xa')](),controller[_0xd5f7('0x12')]);router['delete'](_0xd5f7('0xf'),auth[_0xd5f7('0xa')](),controller[_0xd5f7('0x13')]);module[_0xd5f7('0x14')]=router;
\ No newline at end of file
+var _0x7c97=['/describe','describe','show','post','create','put','delete','/:id','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','isAuthenticated','index','get'];(function(_0x5c7a58,_0x359880){var _0x648396=function(_0x4bec24){while(--_0x4bec24){_0x5c7a58['push'](_0x5c7a58['shift']());}};_0x648396(++_0x359880);}(_0x7c97,0x160));var _0x77c9=function(_0x2bed2f,_0x2bfeb0){_0x2bed2f=_0x2bed2f-0x0;var _0x298e34=_0x7c97[_0x2bed2f];return _0x298e34;};'use strict';var multer=require(_0x77c9('0x0'));var util=require(_0x77c9('0x1'));var path=require(_0x77c9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x77c9('0x3'));var interaction=require(_0x77c9('0x4'));var config=require('../../config/environment');var controller=require(_0x77c9('0x5'));router['get']('/',auth[_0x77c9('0x6')](),controller[_0x77c9('0x7')]);router[_0x77c9('0x8')](_0x77c9('0x9'),auth[_0x77c9('0x6')](),controller[_0x77c9('0xa')]);router[_0x77c9('0x8')]('/:id',auth[_0x77c9('0x6')](),controller[_0x77c9('0xb')]);router[_0x77c9('0xc')]('/',auth[_0x77c9('0x6')](),controller[_0x77c9('0xd')]);router[_0x77c9('0xe')]('/:id',auth[_0x77c9('0x6')](),controller['update']);router[_0x77c9('0xf')](_0x77c9('0x10'),auth[_0x77c9('0x6')](),controller[_0x77c9('0x11')]);module[_0x77c9('0x12')]=router;
\ No newline at end of file
index db5c13d..6f4037f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a54,0x106));var _0x47a5=function(_0x272a31,_0x54de5c){_0x272a31=_0x272a31-0x0;var _0x1046b9=_0x7a54[_0x272a31];return _0x1046b9;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x3631fb,_0x58866b){_0x3631fb=_0x3631fb-0x0;var _0x120321=_0x7a54[_0x3631fb];return _0x120321;};'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 62e0e4a..1239380 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78d0=['lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','options','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x546502,_0x5b6818){var _0x457e70=function(_0x1e35b8){while(--_0x1e35b8){_0x546502['push'](_0x546502['shift']());}};_0x457e70(++_0x5b6818);}(_0x78d0,0x128));var _0x078d=function(_0xd5f7ea,_0x53604e){_0xd5f7ea=_0xd5f7ea-0x0;var _0x39bfd5=_0x78d0[_0xd5f7ea];return _0x39bfd5;};'use strict';var emlformat=require(_0x078d('0x0'));var rimraf=require(_0x078d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x078d('0x2'));var rp=require(_0x078d('0x3'));var moment=require(_0x078d('0x4'));var BPromise=require(_0x078d('0x5'));var Mustache=require('mustache');var util=require(_0x078d('0x6'));var path=require(_0x078d('0x7'));var sox=require(_0x078d('0x8'));var csv=require(_0x078d('0x9'));var ejs=require(_0x078d('0xa'));var fs=require('fs');var fs_extra=require(_0x078d('0xb'));var _=require(_0x078d('0xc'));var squel=require('squel');var crypto=require(_0x078d('0xd'));var jsforce=require(_0x078d('0xe'));var deskjs=require(_0x078d('0xf'));var toCsv=require(_0x078d('0x9'));var querystring=require('querystring');var Papa=require(_0x078d('0x10'));var Redis=require(_0x078d('0x11'));var authService=require(_0x078d('0x12'));var qs=require(_0x078d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x078d('0x14'));var logger=require(_0x078d('0x15'))('api');var utils=require(_0x078d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x078d('0x17'));var db=require(_0x078d('0x18'))['db'];function respondWithStatusCode(_0x2a39d9,_0x464533){_0x464533=_0x464533||0xcc;return function(_0x5d86f7){if(_0x5d86f7){return _0x2a39d9[_0x078d('0x19')](_0x464533);}return _0x2a39d9['status'](_0x464533)['end']();};}function respondWithResult(_0x9b001b,_0x92e405){_0x92e405=_0x92e405||0xc8;return function(_0xd27f36){if(_0xd27f36){return _0x9b001b[_0x078d('0x1a')](_0x92e405)['json'](_0xd27f36);}};}function respondWithFilteredResult(_0xdeafb1,_0x72e0a5){return function(_0x3d6623){if(_0x3d6623){var _0x3b8351=typeof _0x72e0a5[_0x078d('0x1b')]===_0x078d('0x1c')&&typeof _0x72e0a5[_0x078d('0x1d')]==='undefined';var _0x3b29e0=_0x3d6623[_0x078d('0x1e')];var _0x55271f=_0x3b8351?0x0:_0x72e0a5[_0x078d('0x1b')];var _0x25e099=_0x3b8351?_0x3d6623[_0x078d('0x1e')]:_0x72e0a5[_0x078d('0x1b')]+_0x72e0a5['limit'];var _0x32291a;if(_0x25e099>=_0x3b29e0){_0x25e099=_0x3b29e0;_0x32291a=0xc8;}else{_0x32291a=0xce;}_0xdeafb1[_0x078d('0x1a')](_0x32291a);return _0xdeafb1[_0x078d('0x1f')](_0x078d('0x20'),_0x55271f+'-'+_0x25e099+'/'+_0x3b29e0)['json'](_0x3d6623);}return null;};}function patchUpdates(_0x56158c){return function(_0x4967d8){try{jsonpatch[_0x078d('0x21')](_0x4967d8,_0x56158c,!![]);}catch(_0x4a8c8e){return BPromise[_0x078d('0x22')](_0x4a8c8e);}return _0x4967d8['save']();};}function saveUpdates(_0x56a515,_0x3afc9a){return function(_0x2d9a03){if(_0x2d9a03){return _0x2d9a03[_0x078d('0x23')](_0x56a515)[_0x078d('0x24')](function(_0x583497){return _0x583497;});}return null;};}function removeEntity(_0x1f893e,_0x3a1fd5){return function(_0x559229){if(_0x559229){return _0x559229[_0x078d('0x25')]()[_0x078d('0x24')](function(){_0x1f893e['status'](0xcc)[_0x078d('0x26')]();});}};}function handleEntityNotFound(_0x5e7d6f,_0x186c8e){return function(_0x5dcb38){if(!_0x5dcb38){_0x5e7d6f['sendStatus'](0x194);}return _0x5dcb38;};}function handleError(_0x4e7fc6,_0x19f352){_0x19f352=_0x19f352||0x1f4;return function(_0x3c59a1){logger[_0x078d('0x27')](_0x3c59a1[_0x078d('0x28')]);if(_0x3c59a1['name']){delete _0x3c59a1[_0x078d('0x29')];}_0x4e7fc6[_0x078d('0x1a')](_0x19f352)[_0x078d('0x2a')](_0x3c59a1);};}exports[_0x078d('0x2b')]=function(_0x2ec33d,_0x396c32){var _0x365d18={},_0xbb77a7={},_0x3bcfd1={'count':0x0,'rows':[]};var _0x480d4c=_[_0x078d('0x2c')](db[_0x078d('0x2d')]['rawAttributes'],function(_0x50b2b1){return{'name':_0x50b2b1[_0x078d('0x2e')],'type':_0x50b2b1[_0x078d('0x2f')][_0x078d('0x30')]};});_0xbb77a7[_0x078d('0x31')]=_[_0x078d('0x2c')](_0x480d4c,_0x078d('0x29'));_0xbb77a7[_0x078d('0x32')]=_[_0x078d('0x33')](_0x2ec33d[_0x078d('0x32')]);_0xbb77a7[_0x078d('0x34')]=_[_0x078d('0x35')](_0xbb77a7['model'],_0xbb77a7[_0x078d('0x32')]);_0x365d18[_0x078d('0x36')]=_[_0x078d('0x35')](_0xbb77a7[_0x078d('0x31')],qs[_0x078d('0x37')](_0x2ec33d['query'][_0x078d('0x37')]));_0x365d18['attributes']=_0x365d18[_0x078d('0x36')][_0x078d('0x38')]?_0x365d18[_0x078d('0x36')]:_0xbb77a7['model'];if(!_0x2ec33d['query']['hasOwnProperty'](_0x078d('0x39'))){_0x365d18[_0x078d('0x1d')]=qs[_0x078d('0x1d')](_0x2ec33d[_0x078d('0x32')][_0x078d('0x1d')]);_0x365d18[_0x078d('0x1b')]=qs[_0x078d('0x1b')](_0x2ec33d[_0x078d('0x32')][_0x078d('0x1b')]);}_0x365d18[_0x078d('0x3a')]=qs[_0x078d('0x3b')](_0x2ec33d['query'][_0x078d('0x3b')]);_0x365d18[_0x078d('0x3c')]=qs['filters'](_[_0x078d('0x3d')](_0x2ec33d['query'],_0xbb77a7[_0x078d('0x34')]),_0x480d4c);if(_0x2ec33d[_0x078d('0x32')][_0x078d('0x3e')]){_0x365d18[_0x078d('0x3c')]=_[_0x078d('0x3f')](_0x365d18[_0x078d('0x3c')],{'$or':_[_0x078d('0x2c')](_0x480d4c,function(_0x3933ef){if(_0x3933ef[_0x078d('0x2f')]!==_0x078d('0x40')){var _0x47b767={};_0x47b767[_0x3933ef[_0x078d('0x29')]]={'$like':'%'+_0x2ec33d['query'][_0x078d('0x3e')]+'%'};return _0x47b767;}})});}_0x365d18=_[_0x078d('0x3f')]({},_0x365d18,_0x2ec33d['options']);var _0x2810e3={'where':_0x365d18['where']};return db[_0x078d('0x2d')][_0x078d('0x1e')](_0x2810e3)[_0x078d('0x24')](function(_0x48de3e){_0x3bcfd1[_0x078d('0x1e')]=_0x48de3e;if(_0x2ec33d[_0x078d('0x32')][_0x078d('0x41')]){_0x365d18[_0x078d('0x42')]=[{'all':!![]}];}return db[_0x078d('0x2d')][_0x078d('0x43')](_0x365d18);})[_0x078d('0x24')](function(_0x370b8e){_0x3bcfd1[_0x078d('0x44')]=_0x370b8e;return _0x3bcfd1;})[_0x078d('0x24')](respondWithFilteredResult(_0x396c32,_0x365d18))['catch'](handleError(_0x396c32,null));};exports[_0x078d('0x45')]=function(_0x29ca66,_0x26611c){var _0x4edfe8={'raw':!![],'where':{'id':_0x29ca66['params']['id']}},_0x16f243={};_0x16f243[_0x078d('0x31')]=_[_0x078d('0x33')](db[_0x078d('0x2d')][_0x078d('0x46')]);_0x16f243[_0x078d('0x32')]=_[_0x078d('0x33')](_0x29ca66['query']);_0x16f243[_0x078d('0x34')]=_[_0x078d('0x35')](_0x16f243[_0x078d('0x31')],_0x16f243[_0x078d('0x32')]);_0x4edfe8[_0x078d('0x36')]=_[_0x078d('0x35')](_0x16f243[_0x078d('0x31')],qs[_0x078d('0x37')](_0x29ca66[_0x078d('0x32')][_0x078d('0x37')]));_0x4edfe8[_0x078d('0x36')]=_0x4edfe8['attributes'][_0x078d('0x38')]?_0x4edfe8['attributes']:_0x16f243[_0x078d('0x31')];if(_0x29ca66[_0x078d('0x32')][_0x078d('0x41')]){_0x4edfe8[_0x078d('0x42')]=[{'all':!![]}];}_0x4edfe8=_[_0x078d('0x3f')]({},_0x4edfe8,_0x29ca66[_0x078d('0x47')]);return db[_0x078d('0x2d')][_0x078d('0x48')](_0x4edfe8)[_0x078d('0x24')](handleEntityNotFound(_0x26611c,null))[_0x078d('0x24')](respondWithResult(_0x26611c,null))[_0x078d('0x49')](handleError(_0x26611c,null));};exports[_0x078d('0x4a')]=function(_0x42dfee,_0x4c38f){return db[_0x078d('0x2d')][_0x078d('0x4a')](_0x42dfee['body'],{})[_0x078d('0x24')](respondWithResult(_0x4c38f,0xc9))[_0x078d('0x49')](handleError(_0x4c38f,null));};exports['update']=function(_0x47bff4,_0x467637){if(_0x47bff4[_0x078d('0x4b')]['id']){delete _0x47bff4[_0x078d('0x4b')]['id'];}return db[_0x078d('0x2d')][_0x078d('0x48')]({'where':{'id':_0x47bff4['params']['id']}})[_0x078d('0x24')](handleEntityNotFound(_0x467637,null))['then'](saveUpdates(_0x47bff4[_0x078d('0x4b')],null))[_0x078d('0x24')](respondWithResult(_0x467637,null))['catch'](handleError(_0x467637,null));};exports[_0x078d('0x25')]=function(_0x2a3636,_0x1065d5){return db[_0x078d('0x2d')]['find']({'where':{'id':_0x2a3636['params']['id']}})['then'](handleEntityNotFound(_0x1065d5,null))[_0x078d('0x24')](removeEntity(_0x1065d5,null))['catch'](handleError(_0x1065d5,null));};exports[_0x078d('0x4c')]=function(_0x511fbf,_0x454096){return db[_0x078d('0x2d')][_0x078d('0x4c')]()['then'](respondWithResult(_0x454096,null))[_0x078d('0x49')](handleError(_0x454096,null));};
\ No newline at end of file
+var _0x5d14=['filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','length','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','end','sendStatus','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','map','query','keys'];(function(_0x4f58e6,_0x5a9ca7){var _0x43f986=function(_0x5e77d9){while(--_0x5e77d9){_0x4f58e6['push'](_0x4f58e6['shift']());}};_0x43f986(++_0x5a9ca7);}(_0x5d14,0xa9));var _0x45d1=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x5d14[_0x28aea5];return _0x6a55f9;};'use strict';var emlformat=require(_0x45d1('0x0'));var rimraf=require(_0x45d1('0x1'));var zipdir=require(_0x45d1('0x2'));var jsonpatch=require(_0x45d1('0x3'));var rp=require(_0x45d1('0x4'));var moment=require(_0x45d1('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x45d1('0x6'));var sox=require(_0x45d1('0x7'));var csv=require('to-csv');var ejs=require(_0x45d1('0x8'));var fs=require('fs');var fs_extra=require(_0x45d1('0x9'));var _=require('lodash');var squel=require(_0x45d1('0xa'));var crypto=require('crypto');var jsforce=require(_0x45d1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x45d1('0xc'));var querystring=require(_0x45d1('0xd'));var Papa=require(_0x45d1('0xe'));var Redis=require('ioredis');var authService=require(_0x45d1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x45d1('0x10'));var hardwareService=require(_0x45d1('0x11'));var logger=require(_0x45d1('0x12'))(_0x45d1('0x13'));var utils=require(_0x45d1('0x14'));var config=require(_0x45d1('0x15'));var licenseUtil=require(_0x45d1('0x16'));var db=require(_0x45d1('0x17'))['db'];function respondWithStatusCode(_0x525f9e,_0x5ef0f1){_0x5ef0f1=_0x5ef0f1||0xcc;return function(_0x5f4ad5){if(_0x5f4ad5){return _0x525f9e['sendStatus'](_0x5ef0f1);}return _0x525f9e[_0x45d1('0x18')](_0x5ef0f1)['end']();};}function respondWithResult(_0x2f6e7d,_0x5dab76){_0x5dab76=_0x5dab76||0xc8;return function(_0x1f2e80){if(_0x1f2e80){return _0x2f6e7d['status'](_0x5dab76)[_0x45d1('0x19')](_0x1f2e80);}};}function respondWithFilteredResult(_0x3b8518,_0x3d7d77){return function(_0x3e2b2c){if(_0x3e2b2c){var _0x4fa6cb=typeof _0x3d7d77[_0x45d1('0x1a')]===_0x45d1('0x1b')&&typeof _0x3d7d77[_0x45d1('0x1c')]===_0x45d1('0x1b');var _0x3f9a5c=_0x3e2b2c[_0x45d1('0x1d')];var _0x25fb02=_0x4fa6cb?0x0:_0x3d7d77[_0x45d1('0x1a')];var _0x51699b=_0x4fa6cb?_0x3e2b2c[_0x45d1('0x1d')]:_0x3d7d77[_0x45d1('0x1a')]+_0x3d7d77[_0x45d1('0x1c')];var _0x1bf6d8;if(_0x51699b>=_0x3f9a5c){_0x51699b=_0x3f9a5c;_0x1bf6d8=0xc8;}else{_0x1bf6d8=0xce;}_0x3b8518[_0x45d1('0x18')](_0x1bf6d8);return _0x3b8518[_0x45d1('0x1e')](_0x45d1('0x1f'),_0x25fb02+'-'+_0x51699b+'/'+_0x3f9a5c)[_0x45d1('0x19')](_0x3e2b2c);}return null;};}function patchUpdates(_0x38e074){return function(_0x414632){try{jsonpatch['apply'](_0x414632,_0x38e074,!![]);}catch(_0x1e1e94){return BPromise['reject'](_0x1e1e94);}return _0x414632['save']();};}function saveUpdates(_0x5657f1,_0x5e554b){return function(_0x150794){if(_0x150794){return _0x150794['update'](_0x5657f1)[_0x45d1('0x20')](function(_0x5467ae){return _0x5467ae;});}return null;};}function removeEntity(_0x410bd4,_0x3b9a83){return function(_0x2ed5d1){if(_0x2ed5d1){return _0x2ed5d1[_0x45d1('0x21')]()['then'](function(){_0x410bd4[_0x45d1('0x18')](0xcc)[_0x45d1('0x22')]();});}};}function handleEntityNotFound(_0x3b8458,_0x48f990){return function(_0x33e8d6){if(!_0x33e8d6){_0x3b8458[_0x45d1('0x23')](0x194);}return _0x33e8d6;};}function handleError(_0x4f63e4,_0x305d34){_0x305d34=_0x305d34||0x1f4;return function(_0x432dd8){logger['error'](_0x432dd8['stack']);if(_0x432dd8[_0x45d1('0x24')]){delete _0x432dd8[_0x45d1('0x24')];}_0x4f63e4[_0x45d1('0x18')](_0x305d34)[_0x45d1('0x25')](_0x432dd8);};}exports[_0x45d1('0x26')]=function(_0x3e7c8e,_0x12c9f3){var _0x458211={},_0x418859={},_0x41df19={'count':0x0,'rows':[]};var _0x56010b=_['map'](db[_0x45d1('0x27')][_0x45d1('0x28')],function(_0x3d0a6b){return{'name':_0x3d0a6b[_0x45d1('0x29')],'type':_0x3d0a6b[_0x45d1('0x2a')][_0x45d1('0x2b')]};});_0x418859['model']=_[_0x45d1('0x2c')](_0x56010b,_0x45d1('0x24'));_0x418859[_0x45d1('0x2d')]=_[_0x45d1('0x2e')](_0x3e7c8e['query']);_0x418859[_0x45d1('0x2f')]=_[_0x45d1('0x30')](_0x418859[_0x45d1('0x31')],_0x418859[_0x45d1('0x2d')]);_0x458211['attributes']=_[_0x45d1('0x30')](_0x418859[_0x45d1('0x31')],qs[_0x45d1('0x32')](_0x3e7c8e[_0x45d1('0x2d')][_0x45d1('0x32')]));_0x458211[_0x45d1('0x33')]=_0x458211[_0x45d1('0x33')]['length']?_0x458211[_0x45d1('0x33')]:_0x418859['model'];if(!_0x3e7c8e[_0x45d1('0x2d')][_0x45d1('0x34')]('nolimit')){_0x458211[_0x45d1('0x1c')]=qs['limit'](_0x3e7c8e[_0x45d1('0x2d')][_0x45d1('0x1c')]);_0x458211[_0x45d1('0x1a')]=qs[_0x45d1('0x1a')](_0x3e7c8e[_0x45d1('0x2d')][_0x45d1('0x1a')]);}_0x458211['order']=qs[_0x45d1('0x35')](_0x3e7c8e[_0x45d1('0x2d')]['sort']);_0x458211[_0x45d1('0x36')]=qs[_0x45d1('0x2f')](_[_0x45d1('0x37')](_0x3e7c8e[_0x45d1('0x2d')],_0x418859[_0x45d1('0x2f')]),_0x56010b);if(_0x3e7c8e[_0x45d1('0x2d')][_0x45d1('0x38')]){_0x458211['where']=_[_0x45d1('0x39')](_0x458211[_0x45d1('0x36')],{'$or':_[_0x45d1('0x2c')](_0x56010b,function(_0x10cc7c){if(_0x10cc7c[_0x45d1('0x2a')]!==_0x45d1('0x3a')){var _0x594dbe={};_0x594dbe[_0x10cc7c[_0x45d1('0x24')]]={'$like':'%'+_0x3e7c8e[_0x45d1('0x2d')][_0x45d1('0x38')]+'%'};return _0x594dbe;}})});}_0x458211=_['merge']({},_0x458211,_0x3e7c8e[_0x45d1('0x3b')]);var _0x1a6bc9={'where':_0x458211['where']};return db[_0x45d1('0x27')][_0x45d1('0x1d')](_0x1a6bc9)[_0x45d1('0x20')](function(_0x4cc2d5){_0x41df19[_0x45d1('0x1d')]=_0x4cc2d5;if(_0x3e7c8e[_0x45d1('0x2d')]['includeAll']){_0x458211[_0x45d1('0x3c')]=[{'all':!![]}];}return db[_0x45d1('0x27')]['findAll'](_0x458211);})[_0x45d1('0x20')](function(_0xad7fcd){_0x41df19[_0x45d1('0x3d')]=_0xad7fcd;return _0x41df19;})[_0x45d1('0x20')](respondWithFilteredResult(_0x12c9f3,_0x458211))[_0x45d1('0x3e')](handleError(_0x12c9f3,null));};exports[_0x45d1('0x3f')]=function(_0x365543,_0x3f42f8){var _0x18bcff={'raw':!![],'where':{'id':_0x365543[_0x45d1('0x40')]['id']}},_0x4e1066={};_0x4e1066[_0x45d1('0x31')]=_[_0x45d1('0x2e')](db[_0x45d1('0x27')][_0x45d1('0x28')]);_0x4e1066[_0x45d1('0x2d')]=_[_0x45d1('0x2e')](_0x365543[_0x45d1('0x2d')]);_0x4e1066['filters']=_[_0x45d1('0x30')](_0x4e1066[_0x45d1('0x31')],_0x4e1066[_0x45d1('0x2d')]);_0x18bcff['attributes']=_['intersection'](_0x4e1066[_0x45d1('0x31')],qs[_0x45d1('0x32')](_0x365543[_0x45d1('0x2d')]['fields']));_0x18bcff[_0x45d1('0x33')]=_0x18bcff[_0x45d1('0x33')][_0x45d1('0x41')]?_0x18bcff[_0x45d1('0x33')]:_0x4e1066[_0x45d1('0x31')];if(_0x365543[_0x45d1('0x2d')][_0x45d1('0x42')]){_0x18bcff['include']=[{'all':!![]}];}_0x18bcff=_[_0x45d1('0x39')]({},_0x18bcff,_0x365543['options']);return db[_0x45d1('0x27')][_0x45d1('0x43')](_0x18bcff)[_0x45d1('0x20')](handleEntityNotFound(_0x3f42f8,null))['then'](respondWithResult(_0x3f42f8,null))['catch'](handleError(_0x3f42f8,null));};exports[_0x45d1('0x44')]=function(_0x315081,_0x53682c){return db['JscriptyQuestionReport'][_0x45d1('0x44')](_0x315081[_0x45d1('0x45')],{})[_0x45d1('0x20')](respondWithResult(_0x53682c,0xc9))['catch'](handleError(_0x53682c,null));};exports[_0x45d1('0x46')]=function(_0x47bf07,_0x578d88){if(_0x47bf07[_0x45d1('0x45')]['id']){delete _0x47bf07[_0x45d1('0x45')]['id'];}return db['JscriptyQuestionReport'][_0x45d1('0x43')]({'where':{'id':_0x47bf07[_0x45d1('0x40')]['id']}})['then'](handleEntityNotFound(_0x578d88,null))[_0x45d1('0x20')](saveUpdates(_0x47bf07[_0x45d1('0x45')],null))[_0x45d1('0x20')](respondWithResult(_0x578d88,null))[_0x45d1('0x3e')](handleError(_0x578d88,null));};exports[_0x45d1('0x21')]=function(_0x112b5d,_0x5df0ac){return db[_0x45d1('0x27')][_0x45d1('0x43')]({'where':{'id':_0x112b5d['params']['id']}})[_0x45d1('0x20')](handleEntityNotFound(_0x5df0ac,null))[_0x45d1('0x20')](removeEntity(_0x5df0ac,null))[_0x45d1('0x3e')](handleError(_0x5df0ac,null));};exports[_0x45d1('0x47')]=function(_0x1d0707,_0x5d58a6){return db['JscriptyQuestionReport'][_0x45d1('0x47')]()[_0x45d1('0x20')](respondWithResult(_0x5d58a6,null))[_0x45d1('0x3e')](handleError(_0x5d58a6,null));};
\ No newline at end of file
index 01f93c9..0a5f8c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1104=['./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x1104,0xbb));var _0x4110=function(_0x3e566d,_0x5200e8){_0x3e566d=_0x3e566d-0x0;var _0x540851=_0x1104[_0x3e566d];return _0x540851;};'use strict';var _=require(_0x4110('0x0'));var util=require(_0x4110('0x1'));var logger=require(_0x4110('0x2'))(_0x4110('0x3'));var moment=require(_0x4110('0x4'));var BPromise=require(_0x4110('0x5'));var rp=require(_0x4110('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4110('0x7'));var config=require(_0x4110('0x8'));var attributes=require(_0x4110('0x9'));module[_0x4110('0xa')]=function(_0x49104f,_0x25837c){return _0x49104f[_0x4110('0xb')](_0x4110('0xc'),attributes,{'tableName':_0x4110('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1e8=['report_jscripty_questions','../../config/logger','api','bluebird','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0xf1e8,0x1a5));var _0x8f1e=function(_0xe8cfc2,_0x29ecd4){_0xe8cfc2=_0xe8cfc2-0x0;var _0x1ba7c9=_0xf1e8[_0xe8cfc2];return _0x1ba7c9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8f1e('0x0'))(_0x8f1e('0x1'));var moment=require('moment');var BPromise=require(_0x8f1e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f1e('0x3'));var rimraf=require('rimraf');var config=require(_0x8f1e('0x4'));var attributes=require(_0x8f1e('0x5'));module[_0x8f1e('0x6')]=function(_0x2d335c,_0x4b821a){return _0x2d335c[_0x8f1e('0x7')](_0x8f1e('0x8'),attributes,{'tableName':_0x8f1e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f43a117..a5e7b62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44f5=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash'];(function(_0x384837,_0x2bd5d3){var _0x393d61=function(_0x59bed4){while(--_0x59bed4){_0x384837['push'](_0x384837['shift']());}};_0x393d61(++_0x2bd5d3);}(_0x44f5,0x1b7));var _0x544f=function(_0x50b881,_0x33ba68){_0x50b881=_0x50b881-0x0;var _0x4ad702=_0x44f5[_0x50b881];return _0x4ad702;};'use strict';var _=require(_0x544f('0x0'));var util=require(_0x544f('0x1'));var moment=require(_0x544f('0x2'));var BPromise=require('bluebird');var rs=require(_0x544f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x544f('0x4'))['db'];var utils=require(_0x544f('0x5'));var logger=require(_0x544f('0x6'))(_0x544f('0x7'));var config=require(_0x544f('0x8'));var jayson=require(_0x544f('0x9'));var client=jayson[_0x544f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bc82a,_0x2fea84,_0x297f67){return new BPromise(function(_0x4e60fe,_0x21312b){return client[_0x544f('0xb')](_0x2bc82a,_0x297f67)['then'](function(_0xe283db){logger['info'](_0x544f('0xc'),_0x2fea84,_0x544f('0xd'));logger[_0x544f('0xe')](_0x544f('0xf'),_0x2fea84,'request\x20sent',JSON[_0x544f('0x10')](_0xe283db));if(_0xe283db[_0x544f('0x11')]){if(_0xe283db[_0x544f('0x11')]['code']===0x1f4){logger[_0x544f('0x11')](_0x544f('0xc'),_0x2fea84,_0xe283db[_0x544f('0x11')][_0x544f('0x12')]);return _0x21312b(_0xe283db[_0x544f('0x11')]['message']);}logger[_0x544f('0x11')](_0x544f('0xc'),_0x2fea84,_0xe283db[_0x544f('0x11')][_0x544f('0x12')]);return _0x4e60fe(_0xe283db[_0x544f('0x11')]['message']);}else{logger[_0x544f('0x13')](_0x544f('0xc'),_0x2fea84,_0x544f('0xd'));_0x4e60fe(_0xe283db[_0x544f('0x14')]['message']);}})[_0x544f('0x15')](function(_0x39455e){logger[_0x544f('0x11')](_0x544f('0xc'),_0x2fea84,_0x39455e);_0x21312b(_0x39455e);});});}
\ No newline at end of file
+var _0xccd0=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x36fbef,_0x4ffc84){var _0x45e270=function(_0x32dd95){while(--_0x32dd95){_0x36fbef['push'](_0x36fbef['shift']());}};_0x45e270(++_0x4ffc84);}(_0xccd0,0x85));var _0x0ccd=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xccd0[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x0ccd('0x0'));var util=require('util');var moment=require(_0x0ccd('0x1'));var BPromise=require(_0x0ccd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ccd('0x3'));var db=require(_0x0ccd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ccd('0x5'))(_0x0ccd('0x6'));var config=require(_0x0ccd('0x7'));var jayson=require(_0x0ccd('0x8'));var client=jayson[_0x0ccd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a3669,_0x59a03f,_0x5111fa){return new BPromise(function(_0x22e9f6,_0x1359b9){return client[_0x0ccd('0xa')](_0x4a3669,_0x5111fa)[_0x0ccd('0xb')](function(_0x229ec6){logger[_0x0ccd('0xc')](_0x0ccd('0xd'),_0x59a03f,'request\x20sent');logger['debug'](_0x0ccd('0xe'),_0x59a03f,'request\x20sent',JSON[_0x0ccd('0xf')](_0x229ec6));if(_0x229ec6['error']){if(_0x229ec6[_0x0ccd('0x10')][_0x0ccd('0x11')]===0x1f4){logger[_0x0ccd('0x10')](_0x0ccd('0xd'),_0x59a03f,_0x229ec6[_0x0ccd('0x10')]['message']);return _0x1359b9(_0x229ec6[_0x0ccd('0x10')]['message']);}logger['error'](_0x0ccd('0xd'),_0x59a03f,_0x229ec6['error'][_0x0ccd('0x12')]);return _0x22e9f6(_0x229ec6['error']['message']);}else{logger[_0x0ccd('0xc')](_0x0ccd('0xd'),_0x59a03f,_0x0ccd('0x13'));_0x22e9f6(_0x229ec6[_0x0ccd('0x14')][_0x0ccd('0x12')]);}})[_0x0ccd('0x15')](function(_0x1b82c8){logger[_0x0ccd('0x10')](_0x0ccd('0xd'),_0x59a03f,_0x1b82c8);_0x1359b9(_0x1b82c8);});});}
\ No newline at end of file
index 0e9f01d..70ef17e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1383=['isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x36170e,_0x59e049){var _0x19d7c5=function(_0x2bf217){while(--_0x2bf217){_0x36170e['push'](_0x36170e['shift']());}};_0x19d7c5(++_0x59e049);}(_0x1383,0xca));var _0x3138=function(_0x301f76,_0x4ab3b6){_0x301f76=_0x301f76-0x0;var _0x3225ae=_0x1383[_0x301f76];return _0x3225ae;};'use strict';var multer=require(_0x3138('0x0'));var util=require(_0x3138('0x1'));var path=require(_0x3138('0x2'));var timeout=require(_0x3138('0x3'));var express=require('express');var router=express[_0x3138('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3138('0x5'));var config=require(_0x3138('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0x3138('0x7')]('/',auth[_0x3138('0x8')](),controller[_0x3138('0x9')]);router['get'](_0x3138('0xa'),auth[_0x3138('0x8')](),controller[_0x3138('0xb')]);router[_0x3138('0x7')](_0x3138('0xc'),auth[_0x3138('0x8')](),controller[_0x3138('0xd')]);router[_0x3138('0x7')](_0x3138('0xe'),auth['isAuthenticated'](),controller[_0x3138('0xf')]);router['post']('/',auth[_0x3138('0x8')](),controller[_0x3138('0x10')]);router[_0x3138('0x11')](_0x3138('0xc'),auth['isAuthenticated'](),controller[_0x3138('0x12')]);router['delete'](_0x3138('0xc'),auth['isAuthenticated'](),controller[_0x3138('0x13')]);module[_0x3138('0x14')]=router;
\ No newline at end of file
+var _0x6257=['../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/questions','create','update','delete','destroy','path','connect-timeout','express','Router'];(function(_0x134f84,_0xedd439){var _0x4f0392=function(_0x296bfa){while(--_0x296bfa){_0x134f84['push'](_0x134f84['shift']());}};_0x4f0392(++_0xedd439);}(_0x6257,0xe6));var _0x7625=function(_0x38dbdf,_0x376978){_0x38dbdf=_0x38dbdf-0x0;var _0x4b2943=_0x6257[_0x38dbdf];return _0x4b2943;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7625('0x0'));var timeout=require(_0x7625('0x1'));var express=require(_0x7625('0x2'));var router=express[_0x7625('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7625('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7625('0x5'));var controller=require(_0x7625('0x6'));router[_0x7625('0x7')]('/',auth[_0x7625('0x8')](),controller[_0x7625('0x9')]);router[_0x7625('0x7')](_0x7625('0xa'),auth[_0x7625('0x8')](),controller['describe']);router[_0x7625('0x7')](_0x7625('0xb'),auth[_0x7625('0x8')](),controller[_0x7625('0xc')]);router[_0x7625('0x7')](_0x7625('0xd'),auth['isAuthenticated'](),controller['getQuestions']);router['post']('/',auth[_0x7625('0x8')](),controller[_0x7625('0xe')]);router['put'](_0x7625('0xb'),auth[_0x7625('0x8')](),controller[_0x7625('0xf')]);router[_0x7625('0x10')]('/:id',auth[_0x7625('0x8')](),controller[_0x7625('0x11')]);module['exports']=router;
\ No newline at end of file
index 7a30730..41f6e13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71df=['exports','DATE','setDataValue','starttime','endtime','format','STRING','moment','sequelize'];(function(_0x5f3562,_0x212f41){var _0x1b39b4=function(_0x153e49){while(--_0x153e49){_0x5f3562['push'](_0x5f3562['shift']());}};_0x1b39b4(++_0x212f41);}(_0x71df,0x6a));var _0xf71d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71df[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xf71d('0x0'));var Sequelize=require(_0xf71d('0x1'));module[_0xf71d('0x2')]={'starttime':{'type':Sequelize[_0xf71d('0x3')],'set':function(_0x4f32b1){this[_0xf71d('0x4')](_0xf71d('0x5'),_0x4f32b1);this[_0xf71d('0x4')](_0xf71d('0x6'),moment()[_0xf71d('0x7')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xf71d('0x3')]},'membername':{'type':Sequelize[_0xf71d('0x8')]},'projectname':{'type':Sequelize[_0xf71d('0x8')]},'queue':{'type':Sequelize[_0xf71d('0x8')]},'uniqueid':{'type':Sequelize[_0xf71d('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x55c2=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','exports','setDataValue'];(function(_0x3d316e,_0x3cbe2f){var _0x18f9b3=function(_0x432e23){while(--_0x432e23){_0x3d316e['push'](_0x3d316e['shift']());}};_0x18f9b3(++_0x3cbe2f);}(_0x55c2,0x1bf));var _0x255c=function(_0x14110b,_0x3ce4f6){_0x14110b=_0x14110b-0x0;var _0x33d8db=_0x55c2[_0x14110b];return _0x33d8db;};'use strict';var moment=require('moment');var Sequelize=require(_0x255c('0x0'));module[_0x255c('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x2d4b63){this[_0x255c('0x2')](_0x255c('0x3'),_0x2d4b63);this['setDataValue'](_0x255c('0x4'),moment()[_0x255c('0x5')](_0x255c('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x255c('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x255c('0x7')]},'calleridname':{'type':Sequelize[_0x255c('0x7')]},'calleridnum':{'type':Sequelize[_0x255c('0x7')]},'completed':{'type':Sequelize[_0x255c('0x8')],'defaultValue':![]}};
\ No newline at end of file
index 94d46a8..ecc323c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0342=['findOne','JscriptyQuestionReport','pick','SessionId','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','end','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','update','body','catch','destroy','describe'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x0342,0xeb));var _0x2034=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0x0342[_0xa3fadc];return _0x23ecb8;};'use strict';var emlformat=require(_0x2034('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2034('0x1'));var jsonpatch=require(_0x2034('0x2'));var rp=require(_0x2034('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2034('0x4'));var path=require(_0x2034('0x5'));var sox=require(_0x2034('0x6'));var csv=require('to-csv');var ejs=require(_0x2034('0x7'));var fs=require('fs');var fs_extra=require(_0x2034('0x8'));var _=require('lodash');var squel=require(_0x2034('0x9'));var crypto=require(_0x2034('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2034('0xb'));var Redis=require(_0x2034('0xc'));var authService=require(_0x2034('0xd'));var qs=require(_0x2034('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2034('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x2034('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x2034('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c44bb,_0x3d578c){_0x3d578c=_0x3d578c||0xcc;return function(_0x20e19e){if(_0x20e19e){return _0x4c44bb['sendStatus'](_0x3d578c);}return _0x4c44bb[_0x2034('0x12')](_0x3d578c)['end']();};}function respondWithResult(_0x368e55,_0x2218e1){_0x2218e1=_0x2218e1||0xc8;return function(_0x3398f6){if(_0x3398f6){return _0x368e55['status'](_0x2218e1)[_0x2034('0x13')](_0x3398f6);}};}function respondWithFilteredResult(_0x5767b0,_0x37f440){return function(_0x25d65c){if(_0x25d65c){var _0x3fb16b=typeof _0x37f440[_0x2034('0x14')]===_0x2034('0x15')&&typeof _0x37f440['limit']==='undefined';var _0x2319c1=_0x25d65c[_0x2034('0x16')];var _0x459d26=_0x3fb16b?0x0:_0x37f440['offset'];var _0xa50f00=_0x3fb16b?_0x25d65c['count']:_0x37f440[_0x2034('0x14')]+_0x37f440[_0x2034('0x17')];var _0x9f1047;if(_0xa50f00>=_0x2319c1){_0xa50f00=_0x2319c1;_0x9f1047=0xc8;}else{_0x9f1047=0xce;}_0x5767b0['status'](_0x9f1047);return _0x5767b0[_0x2034('0x18')](_0x2034('0x19'),_0x459d26+'-'+_0xa50f00+'/'+_0x2319c1)['json'](_0x25d65c);}return null;};}function patchUpdates(_0x1d6761){return function(_0x3cdb2e){try{jsonpatch[_0x2034('0x1a')](_0x3cdb2e,_0x1d6761,!![]);}catch(_0xcdd5c7){return BPromise[_0x2034('0x1b')](_0xcdd5c7);}return _0x3cdb2e[_0x2034('0x1c')]();};}function saveUpdates(_0x46fe8d,_0x4a130){return function(_0x310b05){if(_0x310b05){return _0x310b05['update'](_0x46fe8d)[_0x2034('0x1d')](function(_0xcfae2b){return _0xcfae2b;});}return null;};}function removeEntity(_0x4cf49e,_0x87c80d){return function(_0x58138e){if(_0x58138e){return _0x58138e['destroy']()['then'](function(){_0x4cf49e[_0x2034('0x12')](0xcc)[_0x2034('0x1e')]();});}};}function handleEntityNotFound(_0x5ca171,_0x11e3cb){return function(_0x51d372){if(!_0x51d372){_0x5ca171[_0x2034('0x1f')](0x194);}return _0x51d372;};}function handleError(_0x40569e,_0x22c7da){_0x22c7da=_0x22c7da||0x1f4;return function(_0x420352){logger[_0x2034('0x20')](_0x420352[_0x2034('0x21')]);if(_0x420352[_0x2034('0x22')]){delete _0x420352['name'];}_0x40569e['status'](_0x22c7da)[_0x2034('0x23')](_0x420352);};}exports[_0x2034('0x24')]=function(_0x400189,_0x44741f){var _0x3ea2cb={},_0x572a63={},_0x1c7b7b={'count':0x0,'rows':[]};var _0x13806c=_[_0x2034('0x25')](db[_0x2034('0x26')][_0x2034('0x27')],function(_0x547548){return{'name':_0x547548[_0x2034('0x28')],'type':_0x547548['type'][_0x2034('0x29')]};});_0x572a63[_0x2034('0x2a')]=_[_0x2034('0x25')](_0x13806c,_0x2034('0x22'));_0x572a63['query']=_[_0x2034('0x2b')](_0x400189['query']);_0x572a63['filters']=_[_0x2034('0x2c')](_0x572a63[_0x2034('0x2a')],_0x572a63[_0x2034('0x2d')]);_0x3ea2cb[_0x2034('0x2e')]=_[_0x2034('0x2c')](_0x572a63['model'],qs[_0x2034('0x2f')](_0x400189[_0x2034('0x2d')][_0x2034('0x2f')]));_0x3ea2cb[_0x2034('0x2e')]=_0x3ea2cb[_0x2034('0x2e')][_0x2034('0x30')]?_0x3ea2cb[_0x2034('0x2e')]:_0x572a63[_0x2034('0x2a')];if(!_0x400189[_0x2034('0x2d')][_0x2034('0x31')](_0x2034('0x32'))){_0x3ea2cb['limit']=qs[_0x2034('0x17')](_0x400189[_0x2034('0x2d')]['limit']);_0x3ea2cb[_0x2034('0x14')]=qs[_0x2034('0x14')](_0x400189['query']['offset']);}_0x3ea2cb[_0x2034('0x33')]=qs[_0x2034('0x34')](_0x400189[_0x2034('0x2d')][_0x2034('0x34')]);_0x3ea2cb['where']=qs[_0x2034('0x35')](_['pick'](_0x400189['query'],_0x572a63[_0x2034('0x35')]),_0x13806c);if(_0x400189[_0x2034('0x2d')][_0x2034('0x36')]){_0x3ea2cb[_0x2034('0x37')]=_[_0x2034('0x38')](_0x3ea2cb[_0x2034('0x37')],{'$or':_[_0x2034('0x25')](_0x13806c,function(_0x28c101){if(_0x28c101[_0x2034('0x39')]!==_0x2034('0x3a')){var _0x3d7fc8={};_0x3d7fc8[_0x28c101['name']]={'$like':'%'+_0x400189[_0x2034('0x2d')]['filter']+'%'};return _0x3d7fc8;}})});}_0x3ea2cb=_['merge']({},_0x3ea2cb,_0x400189[_0x2034('0x3b')]);var _0x1f0d17={'where':_0x3ea2cb[_0x2034('0x37')]};return db['JscriptySessionReport'][_0x2034('0x16')](_0x1f0d17)[_0x2034('0x1d')](function(_0x12a8a0){_0x1c7b7b['count']=_0x12a8a0;if(_0x400189['query'][_0x2034('0x3c')]){_0x3ea2cb[_0x2034('0x3d')]=[{'all':!![]}];}return db[_0x2034('0x26')][_0x2034('0x3e')](_0x3ea2cb);})[_0x2034('0x1d')](function(_0x505176){_0x1c7b7b[_0x2034('0x3f')]=_0x505176;return _0x1c7b7b;})['then'](respondWithFilteredResult(_0x44741f,_0x3ea2cb))['catch'](handleError(_0x44741f,null));};exports[_0x2034('0x40')]=function(_0x2a7c13,_0x49cfc5){var _0x55ccc0={'raw':!![],'where':{'id':_0x2a7c13[_0x2034('0x41')]['id']}},_0x15ffd4={};_0x15ffd4[_0x2034('0x2a')]=_[_0x2034('0x2b')](db['JscriptySessionReport'][_0x2034('0x27')]);_0x15ffd4[_0x2034('0x2d')]=_[_0x2034('0x2b')](_0x2a7c13[_0x2034('0x2d')]);_0x15ffd4['filters']=_['intersection'](_0x15ffd4[_0x2034('0x2a')],_0x15ffd4[_0x2034('0x2d')]);_0x55ccc0['attributes']=_[_0x2034('0x2c')](_0x15ffd4['model'],qs[_0x2034('0x2f')](_0x2a7c13['query'][_0x2034('0x2f')]));_0x55ccc0['attributes']=_0x55ccc0['attributes'][_0x2034('0x30')]?_0x55ccc0[_0x2034('0x2e')]:_0x15ffd4[_0x2034('0x2a')];if(_0x2a7c13[_0x2034('0x2d')][_0x2034('0x3c')]){_0x55ccc0[_0x2034('0x3d')]=[{'all':!![]}];}_0x55ccc0=_[_0x2034('0x38')]({},_0x55ccc0,_0x2a7c13['options']);return db['JscriptySessionReport'][_0x2034('0x42')](_0x55ccc0)[_0x2034('0x1d')](handleEntityNotFound(_0x49cfc5,null))[_0x2034('0x1d')](respondWithResult(_0x49cfc5,null))['catch'](handleError(_0x49cfc5,null));};exports[_0x2034('0x43')]=function(_0xf21ef1,_0x55f837){return db[_0x2034('0x26')]['create'](_0xf21ef1['body'],{})[_0x2034('0x1d')](respondWithResult(_0x55f837,0xc9))['catch'](handleError(_0x55f837,null));};exports[_0x2034('0x44')]=function(_0x114ef1,_0x2111e4){if(_0x114ef1[_0x2034('0x45')]['id']){delete _0x114ef1['body']['id'];}return db[_0x2034('0x26')]['find']({'where':{'id':_0x114ef1[_0x2034('0x41')]['id']}})[_0x2034('0x1d')](handleEntityNotFound(_0x2111e4,null))[_0x2034('0x1d')](saveUpdates(_0x114ef1[_0x2034('0x45')],null))[_0x2034('0x1d')](respondWithResult(_0x2111e4,null))[_0x2034('0x46')](handleError(_0x2111e4,null));};exports[_0x2034('0x47')]=function(_0x38a096,_0x374115){return db[_0x2034('0x26')][_0x2034('0x42')]({'where':{'id':_0x38a096[_0x2034('0x41')]['id']}})[_0x2034('0x1d')](handleEntityNotFound(_0x374115,null))[_0x2034('0x1d')](removeEntity(_0x374115,null))['catch'](handleError(_0x374115,null));};exports[_0x2034('0x48')]=function(_0x30ed30,_0x57be21){return db[_0x2034('0x26')][_0x2034('0x48')]()[_0x2034('0x1d')](respondWithResult(_0x57be21,null))[_0x2034('0x46')](handleError(_0x57be21,null));};exports['getQuestions']=function(_0x55ed89,_0x315e09,_0x551600){var _0x20c761={'raw':!![],'where':{}};var _0x309d10={};var _0x19a3ca={'count':0x0,'rows':[]};return db[_0x2034('0x26')][_0x2034('0x49')]({'where':{'id':_0x55ed89[_0x2034('0x41')]['id']}})[_0x2034('0x1d')](handleEntityNotFound(_0x315e09,null))[_0x2034('0x1d')](function(_0x2a1f9d){if(_0x2a1f9d){_0x309d10[_0x2034('0x2a')]=_[_0x2034('0x2b')](db[_0x2034('0x4a')][_0x2034('0x27')]);_0x309d10[_0x2034('0x2d')]=_['keys'](_0x55ed89['query']);_0x309d10[_0x2034('0x35')]=_[_0x2034('0x2c')](_0x309d10[_0x2034('0x2a')],_0x309d10['query']);_0x20c761['attributes']=_[_0x2034('0x2c')](_0x309d10[_0x2034('0x2a')],qs['fields'](_0x55ed89[_0x2034('0x2d')][_0x2034('0x2f')]));_0x20c761['attributes']=_0x20c761[_0x2034('0x2e')][_0x2034('0x30')]?_0x20c761[_0x2034('0x2e')]:_0x309d10[_0x2034('0x2a')];if(!_0x55ed89['query'][_0x2034('0x31')]('nolimit')){_0x20c761[_0x2034('0x17')]=qs[_0x2034('0x17')](_0x55ed89[_0x2034('0x2d')]['limit']);_0x20c761[_0x2034('0x14')]=qs['offset'](_0x55ed89[_0x2034('0x2d')][_0x2034('0x14')]);}_0x20c761[_0x2034('0x33')]=qs[_0x2034('0x34')](_0x55ed89[_0x2034('0x2d')][_0x2034('0x34')]);_0x20c761[_0x2034('0x37')]=qs[_0x2034('0x35')](_[_0x2034('0x4b')](_0x55ed89['query'],_0x309d10['filters']));_0x20c761['where'][_0x2034('0x4c')]=_0x2a1f9d['id'];if(_0x55ed89[_0x2034('0x2d')]['filter']){_0x20c761[_0x2034('0x37')]=_['merge'](_0x20c761['where'],{'$or':_['map'](_0x20c761[_0x2034('0x2e')],function(_0x4170f8){var _0x31fd53={};_0x31fd53[_0x4170f8]={'$like':'%'+_0x55ed89[_0x2034('0x2d')][_0x2034('0x36')]+'%'};return _0x31fd53;})});}_0x20c761=_['merge']({},_0x20c761,_0x55ed89[_0x2034('0x3b')]);return db[_0x2034('0x4a')]['count']({'where':_0x20c761[_0x2034('0x37')]})[_0x2034('0x1d')](function(_0x1894df){_0x19a3ca['count']=_0x1894df;if(_0x55ed89[_0x2034('0x2d')]['includeAll']){_0x20c761[_0x2034('0x3d')]=[{'all':!![]}];}return db[_0x2034('0x4a')][_0x2034('0x3e')](_0x20c761);})['then'](function(_0x1ac943){_0x19a3ca[_0x2034('0x3f')]=_0x1ac943;return _0x19a3ca;});}})[_0x2034('0x1d')](respondWithFilteredResult(_0x315e09,_0x20c761))['catch'](handleError(_0x315e09,null));};
\ No newline at end of file
+var _0x3e15=['then','destroy','error','name','index','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','JscriptySessionReport','includeAll','include','rows','show','params','intersection','find','catch','create','body','describe','getQuestions','hasOwnProperty','order','SessionId','JscriptyQuestionReport','count','findAll','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset','limit','reject','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e15,0x113));var _0x53e1=function(_0x9424d4,_0x162572){_0x9424d4=_0x9424d4-0x0;var _0x5dfa01=_0x3e15[_0x9424d4];return _0x5dfa01;};'use strict';var emlformat=require(_0x53e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x53e1('0x1'));var jsonpatch=require(_0x53e1('0x2'));var rp=require('request-promise');var moment=require(_0x53e1('0x3'));var BPromise=require(_0x53e1('0x4'));var Mustache=require(_0x53e1('0x5'));var util=require(_0x53e1('0x6'));var path=require(_0x53e1('0x7'));var sox=require(_0x53e1('0x8'));var csv=require(_0x53e1('0x9'));var ejs=require(_0x53e1('0xa'));var fs=require('fs');var fs_extra=require(_0x53e1('0xb'));var _=require(_0x53e1('0xc'));var squel=require(_0x53e1('0xd'));var crypto=require(_0x53e1('0xe'));var jsforce=require(_0x53e1('0xf'));var deskjs=require(_0x53e1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x53e1('0x11'));var Papa=require(_0x53e1('0x12'));var Redis=require(_0x53e1('0x13'));var authService=require(_0x53e1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x53e1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x53e1('0x16'))(_0x53e1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x53e1('0x18'))['db'];function respondWithStatusCode(_0x551d66,_0x3760d2){_0x3760d2=_0x3760d2||0xcc;return function(_0x247d21){if(_0x247d21){return _0x551d66[_0x53e1('0x19')](_0x3760d2);}return _0x551d66['status'](_0x3760d2)[_0x53e1('0x1a')]();};}function respondWithResult(_0x547aa6,_0x55926d){_0x55926d=_0x55926d||0xc8;return function(_0x3fa30c){if(_0x3fa30c){return _0x547aa6[_0x53e1('0x1b')](_0x55926d)[_0x53e1('0x1c')](_0x3fa30c);}};}function respondWithFilteredResult(_0x2ea006,_0x56d956){return function(_0x1c749a){if(_0x1c749a){var _0x514547=typeof _0x56d956[_0x53e1('0x1d')]==='undefined'&&typeof _0x56d956['limit']==='undefined';var _0x26a50d=_0x1c749a['count'];var _0x15d05f=_0x514547?0x0:_0x56d956[_0x53e1('0x1d')];var _0x80aecf=_0x514547?_0x1c749a['count']:_0x56d956[_0x53e1('0x1d')]+_0x56d956[_0x53e1('0x1e')];var _0x45ecbc;if(_0x80aecf>=_0x26a50d){_0x80aecf=_0x26a50d;_0x45ecbc=0xc8;}else{_0x45ecbc=0xce;}_0x2ea006[_0x53e1('0x1b')](_0x45ecbc);return _0x2ea006['set']('Content-Range',_0x15d05f+'-'+_0x80aecf+'/'+_0x26a50d)[_0x53e1('0x1c')](_0x1c749a);}return null;};}function patchUpdates(_0x5a010c){return function(_0x1a5317){try{jsonpatch['apply'](_0x1a5317,_0x5a010c,!![]);}catch(_0x3a7426){return BPromise[_0x53e1('0x1f')](_0x3a7426);}return _0x1a5317['save']();};}function saveUpdates(_0x5bea7b,_0x25d7ef){return function(_0x22776f){if(_0x22776f){return _0x22776f[_0x53e1('0x20')](_0x5bea7b)[_0x53e1('0x21')](function(_0x5c7b45){return _0x5c7b45;});}return null;};}function removeEntity(_0x497be8,_0x16c9a5){return function(_0x5d257f){if(_0x5d257f){return _0x5d257f[_0x53e1('0x22')]()[_0x53e1('0x21')](function(){_0x497be8[_0x53e1('0x1b')](0xcc)[_0x53e1('0x1a')]();});}};}function handleEntityNotFound(_0x45eb53,_0x5243ab){return function(_0x51806b){if(!_0x51806b){_0x45eb53[_0x53e1('0x19')](0x194);}return _0x51806b;};}function handleError(_0x118535,_0x45e0fa){_0x45e0fa=_0x45e0fa||0x1f4;return function(_0x767858){logger[_0x53e1('0x23')](_0x767858['stack']);if(_0x767858[_0x53e1('0x24')]){delete _0x767858[_0x53e1('0x24')];}_0x118535[_0x53e1('0x1b')](_0x45e0fa)['send'](_0x767858);};}exports[_0x53e1('0x25')]=function(_0x19fdfe,_0x1dbde9){var _0x289e2b={},_0x5a9ee3={},_0x5091c0={'count':0x0,'rows':[]};var _0x49f223=_['map'](db['JscriptySessionReport'][_0x53e1('0x26')],function(_0x2dc98d){return{'name':_0x2dc98d[_0x53e1('0x27')],'type':_0x2dc98d[_0x53e1('0x28')][_0x53e1('0x29')]};});_0x5a9ee3[_0x53e1('0x2a')]=_['map'](_0x49f223,_0x53e1('0x24'));_0x5a9ee3['query']=_[_0x53e1('0x2b')](_0x19fdfe[_0x53e1('0x2c')]);_0x5a9ee3[_0x53e1('0x2d')]=_['intersection'](_0x5a9ee3[_0x53e1('0x2a')],_0x5a9ee3[_0x53e1('0x2c')]);_0x289e2b[_0x53e1('0x2e')]=_['intersection'](_0x5a9ee3[_0x53e1('0x2a')],qs[_0x53e1('0x2f')](_0x19fdfe[_0x53e1('0x2c')][_0x53e1('0x2f')]));_0x289e2b['attributes']=_0x289e2b['attributes'][_0x53e1('0x30')]?_0x289e2b[_0x53e1('0x2e')]:_0x5a9ee3[_0x53e1('0x2a')];if(!_0x19fdfe[_0x53e1('0x2c')]['hasOwnProperty'](_0x53e1('0x31'))){_0x289e2b[_0x53e1('0x1e')]=qs['limit'](_0x19fdfe[_0x53e1('0x2c')][_0x53e1('0x1e')]);_0x289e2b[_0x53e1('0x1d')]=qs['offset'](_0x19fdfe['query']['offset']);}_0x289e2b['order']=qs[_0x53e1('0x32')](_0x19fdfe['query'][_0x53e1('0x32')]);_0x289e2b[_0x53e1('0x33')]=qs[_0x53e1('0x2d')](_[_0x53e1('0x34')](_0x19fdfe['query'],_0x5a9ee3[_0x53e1('0x2d')]),_0x49f223);if(_0x19fdfe[_0x53e1('0x2c')][_0x53e1('0x35')]){_0x289e2b[_0x53e1('0x33')]=_[_0x53e1('0x36')](_0x289e2b[_0x53e1('0x33')],{'$or':_[_0x53e1('0x37')](_0x49f223,function(_0x1cac2b){if(_0x1cac2b[_0x53e1('0x28')]!==_0x53e1('0x38')){var _0x30774c={};_0x30774c[_0x1cac2b[_0x53e1('0x24')]]={'$like':'%'+_0x19fdfe['query'][_0x53e1('0x35')]+'%'};return _0x30774c;}})});}_0x289e2b=_[_0x53e1('0x36')]({},_0x289e2b,_0x19fdfe[_0x53e1('0x39')]);var _0x381a8e={'where':_0x289e2b[_0x53e1('0x33')]};return db[_0x53e1('0x3a')]['count'](_0x381a8e)[_0x53e1('0x21')](function(_0x4f94cd){_0x5091c0['count']=_0x4f94cd;if(_0x19fdfe['query'][_0x53e1('0x3b')]){_0x289e2b[_0x53e1('0x3c')]=[{'all':!![]}];}return db[_0x53e1('0x3a')]['findAll'](_0x289e2b);})['then'](function(_0x44ef6f){_0x5091c0[_0x53e1('0x3d')]=_0x44ef6f;return _0x5091c0;})[_0x53e1('0x21')](respondWithFilteredResult(_0x1dbde9,_0x289e2b))['catch'](handleError(_0x1dbde9,null));};exports[_0x53e1('0x3e')]=function(_0x2e6a0e,_0x4d5546){var _0x54aa80={'raw':!![],'where':{'id':_0x2e6a0e[_0x53e1('0x3f')]['id']}},_0x1fdd47={};_0x1fdd47[_0x53e1('0x2a')]=_['keys'](db[_0x53e1('0x3a')]['rawAttributes']);_0x1fdd47['query']=_['keys'](_0x2e6a0e['query']);_0x1fdd47[_0x53e1('0x2d')]=_[_0x53e1('0x40')](_0x1fdd47['model'],_0x1fdd47[_0x53e1('0x2c')]);_0x54aa80[_0x53e1('0x2e')]=_[_0x53e1('0x40')](_0x1fdd47[_0x53e1('0x2a')],qs[_0x53e1('0x2f')](_0x2e6a0e[_0x53e1('0x2c')]['fields']));_0x54aa80[_0x53e1('0x2e')]=_0x54aa80['attributes'][_0x53e1('0x30')]?_0x54aa80[_0x53e1('0x2e')]:_0x1fdd47['model'];if(_0x2e6a0e['query'][_0x53e1('0x3b')]){_0x54aa80[_0x53e1('0x3c')]=[{'all':!![]}];}_0x54aa80=_[_0x53e1('0x36')]({},_0x54aa80,_0x2e6a0e['options']);return db[_0x53e1('0x3a')][_0x53e1('0x41')](_0x54aa80)[_0x53e1('0x21')](handleEntityNotFound(_0x4d5546,null))[_0x53e1('0x21')](respondWithResult(_0x4d5546,null))[_0x53e1('0x42')](handleError(_0x4d5546,null));};exports[_0x53e1('0x43')]=function(_0x308098,_0x53eec1){return db[_0x53e1('0x3a')][_0x53e1('0x43')](_0x308098[_0x53e1('0x44')],{})['then'](respondWithResult(_0x53eec1,0xc9))['catch'](handleError(_0x53eec1,null));};exports[_0x53e1('0x20')]=function(_0x2bccbd,_0x361c1c){if(_0x2bccbd[_0x53e1('0x44')]['id']){delete _0x2bccbd[_0x53e1('0x44')]['id'];}return db[_0x53e1('0x3a')][_0x53e1('0x41')]({'where':{'id':_0x2bccbd[_0x53e1('0x3f')]['id']}})[_0x53e1('0x21')](handleEntityNotFound(_0x361c1c,null))[_0x53e1('0x21')](saveUpdates(_0x2bccbd[_0x53e1('0x44')],null))[_0x53e1('0x21')](respondWithResult(_0x361c1c,null))[_0x53e1('0x42')](handleError(_0x361c1c,null));};exports['destroy']=function(_0x5f331e,_0xee668b){return db[_0x53e1('0x3a')][_0x53e1('0x41')]({'where':{'id':_0x5f331e['params']['id']}})[_0x53e1('0x21')](handleEntityNotFound(_0xee668b,null))['then'](removeEntity(_0xee668b,null))[_0x53e1('0x42')](handleError(_0xee668b,null));};exports[_0x53e1('0x45')]=function(_0x5e5793,_0x5d135b){return db[_0x53e1('0x3a')]['describe']()[_0x53e1('0x21')](respondWithResult(_0x5d135b,null))[_0x53e1('0x42')](handleError(_0x5d135b,null));};exports[_0x53e1('0x46')]=function(_0x3d10de,_0x20684a,_0x275be5){var _0x265615={'raw':!![],'where':{}};var _0x53b15f={};var _0xbebee8={'count':0x0,'rows':[]};return db[_0x53e1('0x3a')]['findOne']({'where':{'id':_0x3d10de['params']['id']}})[_0x53e1('0x21')](handleEntityNotFound(_0x20684a,null))[_0x53e1('0x21')](function(_0x3545d3){if(_0x3545d3){_0x53b15f[_0x53e1('0x2a')]=_[_0x53e1('0x2b')](db['JscriptyQuestionReport'][_0x53e1('0x26')]);_0x53b15f['query']=_['keys'](_0x3d10de[_0x53e1('0x2c')]);_0x53b15f[_0x53e1('0x2d')]=_[_0x53e1('0x40')](_0x53b15f[_0x53e1('0x2a')],_0x53b15f[_0x53e1('0x2c')]);_0x265615[_0x53e1('0x2e')]=_['intersection'](_0x53b15f['model'],qs[_0x53e1('0x2f')](_0x3d10de[_0x53e1('0x2c')]['fields']));_0x265615[_0x53e1('0x2e')]=_0x265615['attributes'][_0x53e1('0x30')]?_0x265615[_0x53e1('0x2e')]:_0x53b15f[_0x53e1('0x2a')];if(!_0x3d10de[_0x53e1('0x2c')][_0x53e1('0x47')]('nolimit')){_0x265615['limit']=qs['limit'](_0x3d10de['query'][_0x53e1('0x1e')]);_0x265615[_0x53e1('0x1d')]=qs['offset'](_0x3d10de[_0x53e1('0x2c')]['offset']);}_0x265615[_0x53e1('0x48')]=qs[_0x53e1('0x32')](_0x3d10de['query']['sort']);_0x265615['where']=qs['filters'](_[_0x53e1('0x34')](_0x3d10de[_0x53e1('0x2c')],_0x53b15f[_0x53e1('0x2d')]));_0x265615[_0x53e1('0x33')][_0x53e1('0x49')]=_0x3545d3['id'];if(_0x3d10de[_0x53e1('0x2c')][_0x53e1('0x35')]){_0x265615[_0x53e1('0x33')]=_['merge'](_0x265615[_0x53e1('0x33')],{'$or':_[_0x53e1('0x37')](_0x265615[_0x53e1('0x2e')],function(_0x2f3b47){var _0xe6e0df={};_0xe6e0df[_0x2f3b47]={'$like':'%'+_0x3d10de[_0x53e1('0x2c')][_0x53e1('0x35')]+'%'};return _0xe6e0df;})});}_0x265615=_[_0x53e1('0x36')]({},_0x265615,_0x3d10de[_0x53e1('0x39')]);return db[_0x53e1('0x4a')]['count']({'where':_0x265615['where']})['then'](function(_0x197fd4){_0xbebee8[_0x53e1('0x4b')]=_0x197fd4;if(_0x3d10de[_0x53e1('0x2c')]['includeAll']){_0x265615[_0x53e1('0x3c')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x53e1('0x4c')](_0x265615);})[_0x53e1('0x21')](function(_0xb5aa2a){_0xbebee8[_0x53e1('0x3d')]=_0xb5aa2a;return _0xbebee8;});}})['then'](respondWithFilteredResult(_0x20684a,_0x265615))['catch'](handleError(_0x20684a,null));};
\ No newline at end of file
index acc6bc9..a7e367c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['lodash','util','api','moment','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x46ed,0x168));var _0xd46e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x46ed[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x160bcf,_0x25cf78){return _0x160bcf[_0xd46e('0x9')](_0xd46e('0xa'),attributes,{'tableName':_0xd46e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa46e=['api','moment','bluebird','path','../../config/environment','exports','define','report_jscripty_sessions','lodash','util'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0xa46e,0x8a));var _0xea46=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0xa46e[_0x163040];return _0x364667;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var logger=require('../../config/logger')(_0xea46('0x2'));var moment=require(_0xea46('0x3'));var BPromise=require(_0xea46('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea46('0x5'));var rimraf=require('rimraf');var config=require(_0xea46('0x6'));var attributes=require('./jscriptySessionReport.attributes');module[_0xea46('0x7')]=function(_0x528404,_0x10bee5){return _0x528404[_0xea46('0x8')]('JscriptySessionReport',attributes,{'tableName':_0xea46('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 036f282..c540f89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d38=['request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x11220d,_0x3bf46d){var _0x5aa93f=function(_0xd921ba){while(--_0xd921ba){_0x11220d['push'](_0x11220d['shift']());}};_0x5aa93f(++_0x3bf46d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x6d38[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});}
\ No newline at end of file
+var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','JscriptySessionReport,\x20%s,\x20%s','message','catch','lodash'];(function(_0x15fd8f,_0xfc190b){var _0x3cc51a=function(_0x43d7b8){while(--_0x43d7b8){_0x15fd8f['push'](_0x15fd8f['shift']());}};_0x3cc51a(++_0xfc190b);}(_0x66fa,0x117));var _0xa66f=function(_0x261014,_0xb007e6){_0x261014=_0x261014-0x0;var _0x51a011=_0x66fa[_0x261014];return _0x51a011;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});}
\ No newline at end of file
index 5f26d40..d0cdf17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe2a=['../../components/interaction/service','./license.controller','get','index','put','/:id','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x300c5c,_0x376652){var _0x20d6f1=function(_0x2df0a8){while(--_0x2df0a8){_0x300c5c['push'](_0x300c5c['shift']());}};_0x20d6f1(++_0x376652);}(_0xbe2a,0x1d9));var _0xabe2=function(_0xf9ab09,_0x30399b){_0xf9ab09=_0xf9ab09-0x0;var _0x4de194=_0xbe2a[_0xf9ab09];return _0x4de194;};'use strict';var multer=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var path=require(_0xabe2('0x2'));var timeout=require(_0xabe2('0x3'));var express=require(_0xabe2('0x4'));var router=express[_0xabe2('0x5')]();var fs_extra=require(_0xabe2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xabe2('0x7'));var config=require('../../config/environment');var controller=require(_0xabe2('0x8'));router[_0xabe2('0x9')]('/',controller[_0xabe2('0xa')]);router[_0xabe2('0xb')](_0xabe2('0xc'),auth[_0xabe2('0xd')](),controller['update']);module[_0xabe2('0xe')]=router;
\ No newline at end of file
+var _0xd730=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','index','put','isAuthenticated','exports'];(function(_0x5972e2,_0x39173b){var _0x4478b6=function(_0x4342f0){while(--_0x4342f0){_0x5972e2['push'](_0x5972e2['shift']());}};_0x4478b6(++_0x39173b);}(_0xd730,0xfd));var _0x0d73=function(_0xd70835,_0xb0311b){_0xd70835=_0xd70835-0x0;var _0x28bcaf=_0xd730[_0xd70835];return _0x28bcaf;};'use strict';var multer=require('multer');var util=require(_0x0d73('0x0'));var path=require('path');var timeout=require(_0x0d73('0x1'));var express=require('express');var router=express[_0x0d73('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0d73('0x3'));var interaction=require(_0x0d73('0x4'));var config=require(_0x0d73('0x5'));var controller=require(_0x0d73('0x6'));router['get']('/',controller[_0x0d73('0x7')]);router[_0x0d73('0x8')]('/:id',auth[_0x0d73('0x9')](),controller['update']);module[_0x0d73('0xa')]=router;
\ No newline at end of file
index dcce7c3..010c842 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd24e=['TEXT','sequelize','exports'];(function(_0x4f74b8,_0x10a380){var _0x208b6b=function(_0x1e6d6d){while(--_0x1e6d6d){_0x4f74b8['push'](_0x4f74b8['shift']());}};_0x208b6b(++_0x10a380);}(_0xd24e,0x1a8));var _0xed24=function(_0x500221,_0x51d38b){_0x500221=_0x500221-0x0;var _0x7bd6f=_0xd24e[_0x500221];return _0x7bd6f;};'use strict';var Sequelize=require(_0xed24('0x0'));module[_0xed24('0x1')]={'license':{'type':Sequelize[_0xed24('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xb4e1=['INTEGER','exports','TEXT','STRING'];(function(_0x46319c,_0x5a5ea4){var _0x4b741b=function(_0x37a168){while(--_0x37a168){_0x46319c['push'](_0x46319c['shift']());}};_0x4b741b(++_0x5a5ea4);}(_0xb4e1,0x1c9));var _0x1b4e=function(_0x1a5ee2,_0x5ea7e3){_0x1a5ee2=_0x1a5ee2-0x0;var _0x5ca7bf=_0xb4e1[_0x1a5ee2];return _0x5ca7bf;};'use strict';var Sequelize=require('sequelize');module[_0x1b4e('0x0')]={'license':{'type':Sequelize[_0x1b4e('0x1')]},'data1':{'type':Sequelize[_0x1b4e('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x1b4e('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 4277d9f..0626595 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['name','index','model','query','keys','intersection','fields','attributes','length','options','getLicense','catch','body','License','find','params','get','key','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack'];(function(_0x261c59,_0x4cc696){var _0x3f4b42=function(_0x25f7fe){while(--_0x25f7fe){_0x261c59['push'](_0x261c59['shift']());}};_0x3f4b42(++_0x4cc696);}(_0x4975,0x86));var _0x5497=function(_0x512f55,_0x59a299){_0x512f55=_0x512f55-0x0;var _0x124703=_0x4975[_0x512f55];return _0x124703;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}var utilLicense=require('../../config/license/util');exports[_0x5497('0x29')]=function(_0x48d146,_0x5e9356){var _0xc3465={'raw':!![],'where':{'id':0x1}},_0xb14593={};_0xb14593[_0x5497('0x2a')]=_['keys'](db['License']['rawAttributes']);_0xb14593[_0x5497('0x2b')]=_[_0x5497('0x2c')](_0x48d146[_0x5497('0x2b')]);_0xb14593['filters']=_['intersection'](_0xb14593['model'],_0xb14593[_0x5497('0x2b')]);_0xc3465['attributes']=_[_0x5497('0x2d')](_0xb14593[_0x5497('0x2a')],qs[_0x5497('0x2e')](_0x48d146['query'][_0x5497('0x2e')]));_0xc3465[_0x5497('0x2f')]=_0xc3465['attributes'][_0x5497('0x30')]?_0xc3465[_0x5497('0x2f')]:_0xb14593[_0x5497('0x2a')];_0xc3465=_['merge']({},_0xc3465,_0x48d146[_0x5497('0x31')]);return utilLicense[_0x5497('0x32')](_0xc3465)[_0x5497('0x24')](respondWithResult(_0x5e9356,null))[_0x5497('0x33')](handleError(_0x5e9356,null));};exports[_0x5497('0x23')]=function(_0x4a6459,_0x386845){if(_0x4a6459[_0x5497('0x34')]['id']){delete _0x4a6459['body']['id'];}return db[_0x5497('0x35')][_0x5497('0x36')]({'where':{'id':_0x4a6459[_0x5497('0x37')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x386845,null))[_0x5497('0x24')](function(_0x37011c){var _0x580e86=_0x37011c[_0x5497('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0x580e86,_0x4a6459[_0x5497('0x34')][_0x5497('0x39')]);})[_0x5497('0x24')](function(_0x5ab18c){if(!_0x5ab18c['demo']){return saveUpdates(_0x4a6459[_0x5497('0x34')],null);}return _0x5ab18c;})[_0x5497('0x24')](respondWithResult(_0x386845,null))[_0x5497('0x33')](handleError(_0x386845,null));};
\ No newline at end of file
+var _0x1261=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','index','model','License','query','intersection','fields','attributes','merge','options','getLicense','catch','body','find','params','get','key','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x4cd3ad,_0x20b872){var _0x31f1f7=function(_0x192cbb){while(--_0x192cbb){_0x4cd3ad['push'](_0x4cd3ad['shift']());}};_0x31f1f7(++_0x20b872);}(_0x1261,0x144));var _0x1126=function(_0x2bcdf4,_0x1a2f20){_0x2bcdf4=_0x2bcdf4-0x0;var _0x4a0f7a=_0x1261[_0x2bcdf4];return _0x4a0f7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}var utilLicense=require('../../config/license/util');exports[_0x1126('0x29')]=function(_0x23d2bc,_0x4a334a){var _0x3fa694={'raw':!![],'where':{'id':0x1}},_0x4bf807={};_0x4bf807[_0x1126('0x2a')]=_['keys'](db[_0x1126('0x2b')]['rawAttributes']);_0x4bf807[_0x1126('0x2c')]=_['keys'](_0x23d2bc['query']);_0x4bf807['filters']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],_0x4bf807[_0x1126('0x2c')]);_0x3fa694['attributes']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],qs['fields'](_0x23d2bc[_0x1126('0x2c')][_0x1126('0x2e')]));_0x3fa694[_0x1126('0x2f')]=_0x3fa694[_0x1126('0x2f')]['length']?_0x3fa694['attributes']:_0x4bf807[_0x1126('0x2a')];_0x3fa694=_[_0x1126('0x30')]({},_0x3fa694,_0x23d2bc[_0x1126('0x31')]);return utilLicense[_0x1126('0x32')](_0x3fa694)['then'](respondWithResult(_0x4a334a,null))[_0x1126('0x33')](handleError(_0x4a334a,null));};exports[_0x1126('0x24')]=function(_0x313ebe,_0x22436c){if(_0x313ebe[_0x1126('0x34')]['id']){delete _0x313ebe['body']['id'];}return db[_0x1126('0x2b')][_0x1126('0x35')]({'where':{'id':_0x313ebe[_0x1126('0x36')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x22436c,null))['then'](function(_0x4ca51c){var _0x22827a=_0x4ca51c[_0x1126('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x22827a,_0x313ebe[_0x1126('0x34')][_0x1126('0x38')]);})[_0x1126('0x25')](function(_0x5c08b9){if(!_0x5c08b9['demo']){return saveUpdates(_0x313ebe[_0x1126('0x34')],null);}return _0x5c08b9;})[_0x1126('0x25')](respondWithResult(_0x22436c,null))[_0x1126('0x33')](handleError(_0x22436c,null));};
\ No newline at end of file
index b43b4fc..298acf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde18=['license','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./license.attributes','define','License'];(function(_0x59a0cf,_0x3616bd){var _0x1f70f4=function(_0x50c132){while(--_0x50c132){_0x59a0cf['push'](_0x59a0cf['shift']());}};_0x1f70f4(++_0x3616bd);}(_0xde18,0x1c9));var _0x8de1=function(_0x5de69d,_0x4c7e96){_0x5de69d=_0x5de69d-0x0;var _0x3cd098=_0xde18[_0x5de69d];return _0x3cd098;};'use strict';var _=require(_0x8de1('0x0'));var util=require(_0x8de1('0x1'));var logger=require(_0x8de1('0x2'))(_0x8de1('0x3'));var moment=require(_0x8de1('0x4'));var BPromise=require(_0x8de1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8de1('0x6'));var config=require(_0x8de1('0x7'));var attributes=require(_0x8de1('0x8'));module['exports']=function(_0x396681,_0x31179f){return _0x396681[_0x8de1('0x9')](_0x8de1('0xa'),attributes,{'tableName':_0x8de1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xffc1=['./license.attributes','license','lodash','util','moment','bluebird','path','rimraf'];(function(_0x348d83,_0x6f176e){var _0x22d465=function(_0x364446){while(--_0x364446){_0x348d83['push'](_0x348d83['shift']());}};_0x22d465(++_0x6f176e);}(_0xffc1,0xe2));var _0x1ffc=function(_0x13ccf2,_0x8d67fc){_0x13ccf2=_0x13ccf2-0x0;var _0xcaca5=_0xffc1[_0x13ccf2];return _0xcaca5;};'use strict';var _=require(_0x1ffc('0x0'));var util=require(_0x1ffc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1ffc('0x2'));var BPromise=require(_0x1ffc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ffc('0x4'));var rimraf=require(_0x1ffc('0x5'));var config=require('../../config/environment');var attributes=require(_0x1ffc('0x6'));module['exports']=function(_0x3400b0,_0x3dd189){return _0x3400b0['define']('License',attributes,{'tableName':_0x1ffc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a59624b..b8e6bb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb230=['then','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x87e36d,_0x1ba59a){var _0x27e87a=function(_0x159a00){while(--_0x159a00){_0x87e36d['push'](_0x87e36d['shift']());}};_0x27e87a(++_0x1ba59a);}(_0xb230,0x1d5));var _0x0b23=function(_0x163a40,_0x495763){_0x163a40=_0x163a40-0x0;var _0xa7ab3c=_0xb230[_0x163a40];return _0xa7ab3c;};'use strict';var _=require(_0x0b23('0x0'));var util=require(_0x0b23('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0b23('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0b23('0x3'));var logger=require(_0x0b23('0x4'))(_0x0b23('0x5'));var config=require(_0x0b23('0x6'));var jayson=require(_0x0b23('0x7'));var client=jayson[_0x0b23('0x8')][_0x0b23('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55022e,_0x40fcd7,_0x22db04){return new BPromise(function(_0x3351aa,_0x2bbec6){return client[_0x0b23('0xa')](_0x55022e,_0x22db04)[_0x0b23('0xb')](function(_0x5c18ee){logger['info'](_0x0b23('0xc'),_0x40fcd7,_0x0b23('0xd'));logger['debug'](_0x0b23('0xe'),_0x40fcd7,_0x0b23('0xd'),JSON['stringify'](_0x5c18ee));if(_0x5c18ee[_0x0b23('0xf')]){if(_0x5c18ee['error'][_0x0b23('0x10')]===0x1f4){logger[_0x0b23('0xf')](_0x0b23('0xc'),_0x40fcd7,_0x5c18ee[_0x0b23('0xf')][_0x0b23('0x11')]);return _0x2bbec6(_0x5c18ee[_0x0b23('0xf')]['message']);}logger[_0x0b23('0xf')]('License,\x20%s,\x20%s',_0x40fcd7,_0x5c18ee[_0x0b23('0xf')][_0x0b23('0x11')]);return _0x3351aa(_0x5c18ee[_0x0b23('0xf')][_0x0b23('0x11')]);}else{logger['info'](_0x0b23('0xc'),_0x40fcd7,_0x0b23('0xd'));_0x3351aa(_0x5c18ee[_0x0b23('0x12')][_0x0b23('0x11')]);}})[_0x0b23('0x13')](function(_0x33e027){logger['error'](_0x0b23('0xc'),_0x40fcd7,_0x33e027);_0x2bbec6(_0x33e027);});});}
\ No newline at end of file
+var _0xe1e6=['message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x18209d,_0x3b850f){var _0x159d81=function(_0x189ba7){while(--_0x189ba7){_0x18209d['push'](_0x18209d['shift']());}};_0x159d81(++_0x3b850f);}(_0xe1e6,0xc9));var _0x6e1e=function(_0x39e578,_0x2637ab){_0x39e578=_0x39e578-0x0;var _0x1d6c5a=_0xe1e6[_0x39e578];return _0x1d6c5a;};'use strict';var _=require('lodash');var util=require(_0x6e1e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6e1e('0x1'));var fs=require('fs');var Redis=require(_0x6e1e('0x2'));var db=require(_0x6e1e('0x3'))['db'];var utils=require(_0x6e1e('0x4'));var logger=require(_0x6e1e('0x5'))(_0x6e1e('0x6'));var config=require('../../config/environment');var jayson=require(_0x6e1e('0x7'));var client=jayson[_0x6e1e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d970c,_0xbb585e,_0x5903e0){return new BPromise(function(_0x1d00d1,_0x12d396){return client[_0x6e1e('0x9')](_0x3d970c,_0x5903e0)[_0x6e1e('0xa')](function(_0x1979cb){logger[_0x6e1e('0xb')](_0x6e1e('0xc'),_0xbb585e,_0x6e1e('0xd'));logger[_0x6e1e('0xe')](_0x6e1e('0xf'),_0xbb585e,_0x6e1e('0xd'),JSON[_0x6e1e('0x10')](_0x1979cb));if(_0x1979cb[_0x6e1e('0x11')]){if(_0x1979cb['error'][_0x6e1e('0x12')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0xbb585e,_0x1979cb['error'][_0x6e1e('0x13')]);return _0x12d396(_0x1979cb[_0x6e1e('0x11')]['message']);}logger[_0x6e1e('0x11')](_0x6e1e('0xc'),_0xbb585e,_0x1979cb[_0x6e1e('0x11')]['message']);return _0x1d00d1(_0x1979cb[_0x6e1e('0x11')][_0x6e1e('0x13')]);}else{logger[_0x6e1e('0xb')](_0x6e1e('0xc'),_0xbb585e,'request\x20sent');_0x1d00d1(_0x1979cb[_0x6e1e('0x14')]['message']);}})[_0x6e1e('0x15')](function(_0x4074f0){logger[_0x6e1e('0x11')](_0x6e1e('0xc'),_0xbb585e,_0x4074f0);_0x12d396(_0x4074f0);});});}
\ No newline at end of file
index 58d0abd..b82cf8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa734=['/describe','isAuthenticated','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/out_servers','addSmtp','addInteraction','/:id/send','send','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get'];(function(_0x1a10b4,_0x460241){var _0x1abeaf=function(_0x402dd7){while(--_0x402dd7){_0x1a10b4['push'](_0x1a10b4['shift']());}};_0x1abeaf(++_0x460241);}(_0xa734,0x1ae));var _0x4a73=function(_0x43fe5a,_0x124bc2){_0x43fe5a=_0x43fe5a-0x0;var _0xc7d660=_0xa734[_0x43fe5a];return _0xc7d660;};'use strict';var multer=require('multer');var util=require(_0x4a73('0x0'));var path=require(_0x4a73('0x1'));var timeout=require(_0x4a73('0x2'));var express=require(_0x4a73('0x3'));var router=express[_0x4a73('0x4')]();var fs_extra=require(_0x4a73('0x5'));var auth=require(_0x4a73('0x6'));var interaction=require(_0x4a73('0x7'));var config=require(_0x4a73('0x8'));var controller=require(_0x4a73('0x9'));router[_0x4a73('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4a73('0xa')](_0x4a73('0xb'),auth[_0x4a73('0xc')](),controller[_0x4a73('0xd')]);router[_0x4a73('0xa')]('/:id',auth[_0x4a73('0xc')](),controller['show']);router[_0x4a73('0xa')](_0x4a73('0xe'),auth[_0x4a73('0xc')](),controller[_0x4a73('0xf')]);router[_0x4a73('0xa')](_0x4a73('0x10'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x11')]);router[_0x4a73('0xa')](_0x4a73('0x12'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x13')]);router[_0x4a73('0xa')]('/:id/out_servers',auth[_0x4a73('0xc')](),controller[_0x4a73('0x14')]);router[_0x4a73('0xa')](_0x4a73('0x15'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x16')]);router[_0x4a73('0xa')](_0x4a73('0x17'),auth[_0x4a73('0xc')](),controller['getApplications']);router[_0x4a73('0xa')](_0x4a73('0x18'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x19')]);router[_0x4a73('0xa')](_0x4a73('0x1a'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x1b')]);router[_0x4a73('0xa')](_0x4a73('0x1c'),auth['isAuthenticated'](),controller[_0x4a73('0x1d')]);router[_0x4a73('0x1e')](_0x4a73('0xe'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x1f')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4a73('0x20')]);router[_0x4a73('0x1e')]('/',auth[_0x4a73('0xc')](),controller['create']);router['post'](_0x4a73('0x12'),auth[_0x4a73('0xc')](),controller['addImap']);router[_0x4a73('0x1e')](_0x4a73('0x21'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x22')]);router[_0x4a73('0x1e')](_0x4a73('0x15'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x23')]);router[_0x4a73('0x1e')](_0x4a73('0x17'),auth[_0x4a73('0xc')](),controller['addApplications']);router[_0x4a73('0x1e')](_0x4a73('0x24'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x25')]);router[_0x4a73('0x1e')](_0x4a73('0x1c'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x26')]);router[_0x4a73('0x27')](_0x4a73('0x28'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x29')]);router[_0x4a73('0x2a')](_0x4a73('0xe'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x2b')]);router[_0x4a73('0x2a')](_0x4a73('0x10'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x2c')]);router[_0x4a73('0x2a')](_0x4a73('0x12'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x2d')]);router[_0x4a73('0x2a')](_0x4a73('0x21'),auth[_0x4a73('0xc')](),controller['removeSmtp']);router['delete'](_0x4a73('0x28'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x2e')]);router['delete'](_0x4a73('0x1c'),auth['isAuthenticated'](),controller[_0x4a73('0x2f')]);module[_0x4a73('0x30')]=router;
\ No newline at end of file
+var _0xb571=['/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','create','addImap','/:id/out_servers','addSmtp','addInteraction','addApplications','send','addAgents','put','update','delete','removeAnswers','destroy','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages'];(function(_0xdbf8f2,_0x409a32){var _0x4ed5d2=function(_0xe7819c){while(--_0xe7819c){_0xdbf8f2['push'](_0xdbf8f2['shift']());}};_0x4ed5d2(++_0x409a32);}(_0xb571,0x73));var _0x1b57=function(_0x275cd3,_0x458f75){_0x275cd3=_0x275cd3-0x0;var _0xaa772a=_0xb571[_0x275cd3];return _0xaa772a;};'use strict';var multer=require('multer');var util=require(_0x1b57('0x0'));var path=require(_0x1b57('0x1'));var timeout=require(_0x1b57('0x2'));var express=require(_0x1b57('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1b57('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1b57('0x5'));var controller=require(_0x1b57('0x6'));router[_0x1b57('0x7')]('/',auth[_0x1b57('0x8')](),controller[_0x1b57('0x9')]);router[_0x1b57('0x7')](_0x1b57('0xa'),auth[_0x1b57('0x8')](),controller[_0x1b57('0xb')]);router[_0x1b57('0x7')](_0x1b57('0xc'),auth['isAuthenticated'](),controller[_0x1b57('0xd')]);router['get']('/:id/dispositions',auth[_0x1b57('0x8')](),controller[_0x1b57('0xe')]);router[_0x1b57('0x7')](_0x1b57('0xf'),auth[_0x1b57('0x8')](),controller['getAnswers']);router[_0x1b57('0x7')](_0x1b57('0x10'),auth[_0x1b57('0x8')](),controller[_0x1b57('0x11')]);router[_0x1b57('0x7')]('/:id/out_servers',auth[_0x1b57('0x8')](),controller[_0x1b57('0x12')]);router[_0x1b57('0x7')](_0x1b57('0x13'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x1b57('0x7')](_0x1b57('0x14'),auth[_0x1b57('0x8')](),controller[_0x1b57('0x15')]);router[_0x1b57('0x7')](_0x1b57('0x16'),auth['isAuthenticated'](),controller['getMessages']);router[_0x1b57('0x7')](_0x1b57('0x17'),auth[_0x1b57('0x8')](),controller[_0x1b57('0x18')]);router[_0x1b57('0x7')](_0x1b57('0x19'),auth[_0x1b57('0x8')](),controller[_0x1b57('0x1a')]);router[_0x1b57('0x1b')](_0x1b57('0x1c'),auth['isAuthenticated'](),controller[_0x1b57('0x1d')]);router[_0x1b57('0x1b')](_0x1b57('0xf'),auth[_0x1b57('0x8')](),controller[_0x1b57('0x1e')]);router['post']('/',auth[_0x1b57('0x8')](),controller[_0x1b57('0x1f')]);router[_0x1b57('0x1b')]('/:id/in_servers',auth[_0x1b57('0x8')](),controller[_0x1b57('0x20')]);router[_0x1b57('0x1b')](_0x1b57('0x21'),auth['isAuthenticated'](),controller[_0x1b57('0x22')]);router['post']('/:id/interactions',auth[_0x1b57('0x8')](),controller[_0x1b57('0x23')]);router['post'](_0x1b57('0x14'),auth['isAuthenticated'](),controller[_0x1b57('0x24')]);router[_0x1b57('0x1b')]('/:id/send',auth[_0x1b57('0x8')](),controller[_0x1b57('0x25')]);router['post']('/:id/users',auth[_0x1b57('0x8')](),controller[_0x1b57('0x26')]);router[_0x1b57('0x27')](_0x1b57('0xc'),auth[_0x1b57('0x8')](),controller[_0x1b57('0x28')]);router[_0x1b57('0x29')](_0x1b57('0x1c'),auth[_0x1b57('0x8')](),controller['removeDispositions']);router[_0x1b57('0x29')](_0x1b57('0xf'),auth[_0x1b57('0x8')](),controller[_0x1b57('0x2a')]);router['delete']('/:id/in_servers',auth[_0x1b57('0x8')](),controller['removeImap']);router['delete'](_0x1b57('0x21'),auth['isAuthenticated'](),controller['removeSmtp']);router['delete'](_0x1b57('0xc'),auth['isAuthenticated'](),controller[_0x1b57('0x2b')]);router[_0x1b57('0x29')]('/:id/users',auth['isAuthenticated'](),controller[_0x1b57('0x2c')]);module[_0x1b57('0x2d')]=router;
\ No newline at end of file
index e847cbd..7acb138 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca9e=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports'];(function(_0x4b7634,_0x12aca7){var _0x236d79=function(_0x5c83ce){while(--_0x5c83ce){_0x4b7634['push'](_0x4b7634['shift']());}};_0x236d79(++_0x12aca7);}(_0xca9e,0x136));var _0xeca9=function(_0x4d979e,_0x52cbd8){_0x4d979e=_0x4d979e-0x0;var _0x40a62a=_0xca9e[_0x4d979e];return _0x40a62a;};'use strict';var Sequelize=require(_0xeca9('0x0'));module[_0xeca9('0x1')]={'description':{'type':Sequelize[_0xeca9('0x2')]},'name':{'type':Sequelize[_0xeca9('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xeca9('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xeca9('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xeca9('0x4')]},'markAsUnread':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xeca9('0x2')],'allowNull':![],'defaultValue':_0xeca9('0x5')},'fontSize':{'type':Sequelize[_0xeca9('0x6')](0x2)[_0xeca9('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xeca9('0x8');}},'notificationSound':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeca9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeca9('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xeca9('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':![],'comment':_0xeca9('0xa'),'set':function(_0x19584d){if(!_0x19584d)this[_0xeca9('0xb')]('mandatoryDispositionPauseId',null);this[_0xeca9('0xb')](_0xeca9('0xc'),_0x19584d);}}};
\ No newline at end of file
+var _0x9d92=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x146a85,_0x529b52){var _0x1b59bf=function(_0x4af0fd){while(--_0x4af0fd){_0x146a85['push'](_0x146a85['shift']());}};_0x1b59bf(++_0x529b52);}(_0x9d92,0xdf));var _0x29d9=function(_0x2ade6c,_0x2d42f2){_0x2ade6c=_0x2ade6c-0x0;var _0x2cb372=_0x9d92[_0x2ade6c];return _0x2cb372;};'use strict';var Sequelize=require(_0x29d9('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x29d9('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x29d9('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x29d9('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x29d9('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x29d9('0x3')]},'markAsUnread':{'type':Sequelize[_0x29d9('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x29d9('0x1')],'allowNull':![],'defaultValue':_0x29d9('0x4')},'fontSize':{'type':Sequelize[_0x29d9('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x29d9('0x3')],'defaultValue':function(){return _0x29d9('0x6');}},'notificationSound':{'type':Sequelize[_0x29d9('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x29d9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x29d9('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x29d9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29d9('0x2')],'defaultValue':![],'comment':_0x29d9('0x7'),'set':function(_0x1a8f11){if(!_0x1a8f11)this['setDataValue'](_0x29d9('0x8'),null);this[_0x29d9('0x9')](_0x29d9('0xa'),_0x1a8f11);}}};
\ No newline at end of file
index 7e9fcbb..28e47b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e60=['Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','findAll','rows','show','params','MailServerOut','fields','length','includeAll','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','include','removeAnswers','key','email','ListId','isNil','active','cservice','cauthentication','user','cuser','password','pass','authentication','host','port','service','cpassword','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','addSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','fullname','internal','Tags','color','tag','sequelize','transaction','MailApplication','bulkCreate','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','server/files/attachments','basename','auth','secure','SendMail','List\x20not\x20found','List','messageId','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','User','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','html-to-text','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','request','request\x20sent','debug','error','MailAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','limit','count','offset','set','save','update','then','destroy','MailAccounts','UserProfileResource','name','send','index','MailServerIn','Imap'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x7e60,0x13e));var _0x07e6=function(_0x33f682,_0x3eb255){_0x33f682=_0x33f682-0x0;var _0x4ee206=_0x7e60[_0x33f682];return _0x4ee206;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07e6('0x0'));var zipdir=require(_0x07e6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07e6('0x2'));var moment=require(_0x07e6('0x3'));var BPromise=require(_0x07e6('0x4'));var Mustache=require(_0x07e6('0x5'));var util=require(_0x07e6('0x6'));var path=require(_0x07e6('0x7'));var sox=require(_0x07e6('0x8'));var csv=require(_0x07e6('0x9'));var ejs=require(_0x07e6('0xa'));var fs=require('fs');var fs_extra=require(_0x07e6('0xb'));var _=require(_0x07e6('0xc'));var squel=require(_0x07e6('0xd'));var crypto=require('crypto');var jsforce=require(_0x07e6('0xe'));var deskjs=require(_0x07e6('0xf'));var toCsv=require(_0x07e6('0x9'));var querystring=require(_0x07e6('0x10'));var Papa=require(_0x07e6('0x11'));var htmlToText=require(_0x07e6('0x12'));var juice=require(_0x07e6('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x07e6('0x14'));var as=require(_0x07e6('0x15'));var hardwareService=require(_0x07e6('0x16'));var logger=require(_0x07e6('0x17'))(_0x07e6('0x18'));var utils=require('../../config/utils');var config=require(_0x07e6('0x19'));var licenseUtil=require(_0x07e6('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x07e6('0x1b')](config[_0x07e6('0x1c')],{'host':_0x07e6('0x1d'),'port':0x18eb});var socket=require(_0x07e6('0x1e'))(new Redis(config[_0x07e6('0x1c')]));require(_0x07e6('0x1f'))[_0x07e6('0x20')](socket);var jayson=require(_0x07e6('0x21'));var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0xc3eda5,_0x3242e2,_0x67c9ad,_0x2d843b){return new BPromise(function(_0x42154a,_0x3fa0dd){var _0x14941e=_0x2d843b||client;return _0x14941e[_0x07e6('0x22')](_0xc3eda5,_0x67c9ad)['then'](function(_0x4e6131){logger['info']('MailAccount,\x20%s,\x20%s',_0x3242e2,_0x07e6('0x23'));logger[_0x07e6('0x24')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x3242e2,_0x07e6('0x23'),JSON['stringify'](_0x4e6131));if(_0x4e6131[_0x07e6('0x25')]){if(_0x4e6131[_0x07e6('0x25')]['code']===0x1f4){logger[_0x07e6('0x25')](_0x07e6('0x26'),_0x3242e2,_0x4e6131[_0x07e6('0x25')][_0x07e6('0x27')]);return _0x3fa0dd(_0x4e6131['error'][_0x07e6('0x27')]);}logger['error'](_0x07e6('0x26'),_0x3242e2,_0x4e6131[_0x07e6('0x25')][_0x07e6('0x27')]);return _0x42154a(_0x4e6131[_0x07e6('0x25')]['message']);}else{logger[_0x07e6('0x28')](_0x07e6('0x26'),_0x3242e2,'request\x20sent');_0x42154a(_0x4e6131[_0x07e6('0x29')][_0x07e6('0x27')]);}})[_0x07e6('0x2a')](function(_0x171680){logger[_0x07e6('0x25')](_0x07e6('0x26'),_0x3242e2,_0x171680);_0x3fa0dd(_0x171680);});});}function respondWithStatusCode(_0x4cf874,_0x1f8aab){_0x1f8aab=_0x1f8aab||0xcc;return function(_0x1e3385){if(_0x1e3385){return _0x4cf874[_0x07e6('0x2b')](_0x1f8aab);}return _0x4cf874[_0x07e6('0x2c')](_0x1f8aab)[_0x07e6('0x2d')]();};}function respondWithResult(_0x56bba3,_0x1f53eb){_0x1f53eb=_0x1f53eb||0xc8;return function(_0x17710f){if(_0x17710f){return _0x56bba3[_0x07e6('0x2c')](_0x1f53eb)[_0x07e6('0x2e')](_0x17710f);}};}function respondWithFilteredResult(_0x3ec4dc,_0x3d4c3a){return function(_0x5e6a36){if(_0x5e6a36){var _0x23cf72=typeof _0x3d4c3a['offset']==='undefined'&&typeof _0x3d4c3a[_0x07e6('0x2f')]==='undefined';var _0x37a51d=_0x5e6a36[_0x07e6('0x30')];var _0x4f08d0=_0x23cf72?0x0:_0x3d4c3a['offset'];var _0x160b7c=_0x23cf72?_0x5e6a36[_0x07e6('0x30')]:_0x3d4c3a[_0x07e6('0x31')]+_0x3d4c3a['limit'];var _0x38e4bc;if(_0x160b7c>=_0x37a51d){_0x160b7c=_0x37a51d;_0x38e4bc=0xc8;}else{_0x38e4bc=0xce;}_0x3ec4dc[_0x07e6('0x2c')](_0x38e4bc);return _0x3ec4dc[_0x07e6('0x32')]('Content-Range',_0x4f08d0+'-'+_0x160b7c+'/'+_0x37a51d)[_0x07e6('0x2e')](_0x5e6a36);}return null;};}function patchUpdates(_0x16fa73){return function(_0x1a933c){try{jsonpatch['apply'](_0x1a933c,_0x16fa73,!![]);}catch(_0x51556d){return BPromise['reject'](_0x51556d);}return _0x1a933c[_0x07e6('0x33')]();};}function saveUpdates(_0x90b1a0,_0x44c913){return function(_0x47bf1d){if(_0x47bf1d){return _0x47bf1d[_0x07e6('0x34')](_0x90b1a0)[_0x07e6('0x35')](function(_0x139821){return _0x139821;});}return null;};}function removeEntity(_0x406e7c,_0x17bab4){return function(_0x35199f){if(_0x35199f){return _0x35199f[_0x07e6('0x36')]()[_0x07e6('0x35')](function(){var _0x37aef4=_0x35199f['get']({'plain':!![]});var _0x2ee89f=_0x07e6('0x37');return db[_0x07e6('0x38')][_0x07e6('0x36')]({'where':{'type':_0x2ee89f,'resourceId':_0x37aef4['id']}})[_0x07e6('0x35')](function(){return _0x35199f;});})[_0x07e6('0x35')](function(){_0x406e7c[_0x07e6('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4748bc,_0x39929d){return function(_0x2b2270){if(!_0x2b2270){_0x4748bc[_0x07e6('0x2b')](0x194);}return _0x2b2270;};}function handleError(_0x3037a6,_0x26f557){_0x26f557=_0x26f557||0x1f4;return function(_0x548dc0){logger[_0x07e6('0x25')](_0x548dc0['stack']);if(_0x548dc0[_0x07e6('0x39')]){delete _0x548dc0[_0x07e6('0x39')];}_0x3037a6[_0x07e6('0x2c')](_0x26f557)[_0x07e6('0x3a')](_0x548dc0);};}exports[_0x07e6('0x3b')]=function(_0x4ef7db,_0x3a9e74){var _0x2987b6={'include':[{'model':db[_0x07e6('0x3c')],'as':_0x07e6('0x3d')},{'model':db['MailServerOut'],'as':_0x07e6('0x3e')},{'model':db[_0x07e6('0x3f')],'as':_0x07e6('0x40')}]},_0x65d3f3={},_0x45453e={'count':0x0,'rows':[]};var _0x4d6500=_[_0x07e6('0x41')](db[_0x07e6('0x42')][_0x07e6('0x43')],function(_0x191223){return{'name':_0x191223[_0x07e6('0x44')],'type':_0x191223[_0x07e6('0x45')]['key']};});_0x65d3f3[_0x07e6('0x46')]=_[_0x07e6('0x41')](_0x4d6500,_0x07e6('0x39'));_0x65d3f3[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x4ef7db[_0x07e6('0x47')]);_0x65d3f3['filters']=_[_0x07e6('0x49')](_0x65d3f3[_0x07e6('0x46')],_0x65d3f3[_0x07e6('0x47')]);_0x2987b6[_0x07e6('0x4a')]=_[_0x07e6('0x49')](_0x65d3f3[_0x07e6('0x46')],qs['fields'](_0x4ef7db[_0x07e6('0x47')]['fields']));_0x2987b6[_0x07e6('0x4a')]=_0x2987b6[_0x07e6('0x4a')]['length']?_0x2987b6[_0x07e6('0x4a')]:_0x65d3f3[_0x07e6('0x46')];if(!_0x4ef7db['query'][_0x07e6('0x4b')](_0x07e6('0x4c'))){_0x2987b6[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x4ef7db['query'][_0x07e6('0x2f')]);_0x2987b6[_0x07e6('0x31')]=qs[_0x07e6('0x31')](_0x4ef7db['query'][_0x07e6('0x31')]);}_0x2987b6['order']=qs[_0x07e6('0x4d')](_0x4ef7db['query']['sort']);_0x2987b6[_0x07e6('0x4e')]=qs[_0x07e6('0x4f')](_['pick'](_0x4ef7db[_0x07e6('0x47')],_0x65d3f3[_0x07e6('0x4f')]),_0x4d6500);if(_0x4ef7db['query'][_0x07e6('0x50')]){_0x2987b6[_0x07e6('0x4e')]=_[_0x07e6('0x51')](_0x2987b6[_0x07e6('0x4e')],{'$or':_[_0x07e6('0x41')](_0x4d6500,function(_0x359cca){if(_0x359cca[_0x07e6('0x45')]!==_0x07e6('0x52')){var _0x43cebd={};_0x43cebd[_0x359cca[_0x07e6('0x39')]]={'$like':'%'+_0x4ef7db[_0x07e6('0x47')]['filter']+'%'};return _0x43cebd;}})});}_0x2987b6=_[_0x07e6('0x51')]({},_0x2987b6,_0x4ef7db[_0x07e6('0x53')]);var _0x5e3b1c={'where':_0x2987b6[_0x07e6('0x4e')]};return db[_0x07e6('0x42')][_0x07e6('0x30')](_0x5e3b1c)['then'](function(_0x408b42){_0x45453e[_0x07e6('0x30')]=_0x408b42;if(_0x4ef7db['query']['includeAll']){_0x2987b6['include']=[{'all':!![]}];}return db['MailAccount'][_0x07e6('0x54')](_0x2987b6);})['then'](function(_0xae4b0a){_0x45453e[_0x07e6('0x55')]=_0xae4b0a;return _0x45453e;})[_0x07e6('0x35')](respondWithFilteredResult(_0x3a9e74,_0x2987b6))[_0x07e6('0x2a')](handleError(_0x3a9e74,null));};exports[_0x07e6('0x56')]=function(_0x1266a5,_0x3a75b6){var _0x565cf0={'raw':![],'where':{'id':_0x1266a5[_0x07e6('0x57')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x07e6('0x3d')},{'model':db[_0x07e6('0x58')],'as':_0x07e6('0x3e')},{'model':db[_0x07e6('0x3f')],'as':_0x07e6('0x40')}]},_0x5992a0={};_0x5992a0[_0x07e6('0x46')]=_[_0x07e6('0x48')](db[_0x07e6('0x42')][_0x07e6('0x43')]);_0x5992a0[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x1266a5[_0x07e6('0x47')]);_0x5992a0[_0x07e6('0x4f')]=_['intersection'](_0x5992a0[_0x07e6('0x46')],_0x5992a0[_0x07e6('0x47')]);_0x565cf0[_0x07e6('0x4a')]=_[_0x07e6('0x49')](_0x5992a0[_0x07e6('0x46')],qs[_0x07e6('0x59')](_0x1266a5[_0x07e6('0x47')]['fields']));_0x565cf0[_0x07e6('0x4a')]=_0x565cf0[_0x07e6('0x4a')][_0x07e6('0x5a')]?_0x565cf0['attributes']:_0x5992a0[_0x07e6('0x46')];if(_0x1266a5[_0x07e6('0x47')][_0x07e6('0x5b')]){_0x565cf0['include']=[{'all':!![]}];}_0x565cf0=_[_0x07e6('0x51')]({},_0x565cf0,_0x1266a5[_0x07e6('0x53')]);return db[_0x07e6('0x42')][_0x07e6('0x5c')](_0x565cf0)[_0x07e6('0x35')](handleEntityNotFound(_0x3a75b6,null))[_0x07e6('0x35')](respondWithResult(_0x3a75b6,null))[_0x07e6('0x2a')](handleError(_0x3a75b6,null));};exports[_0x07e6('0x34')]=function(_0x495cdc,_0xba9c55){if(_0x495cdc[_0x07e6('0x5d')]['id']){delete _0x495cdc[_0x07e6('0x5d')]['id'];}return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x495cdc[_0x07e6('0x57')]['id']},'include':[{'model':db[_0x07e6('0x3c')],'as':'Imap'},{'model':db[_0x07e6('0x58')],'as':_0x07e6('0x3e')},{'model':db[_0x07e6('0x3f')],'as':_0x07e6('0x40')}]})[_0x07e6('0x35')](handleEntityNotFound(_0xba9c55,null))[_0x07e6('0x35')](saveUpdates(_0x495cdc[_0x07e6('0x5d')],null))[_0x07e6('0x35')](function(_0x2a42f9){if(_0x2a42f9&&_0x495cdc[_0x07e6('0x5d')][_0x07e6('0x3d')]){return db['MailServerIn']['update'](_0x495cdc['body']['Imap'],{'where':{'MailAccountId':_0x2a42f9['id']}})['then'](function(){return _0x2a42f9;});}return _0x2a42f9;})['then'](function(_0x3ee3bd){if(_0x3ee3bd&&_0x495cdc[_0x07e6('0x5d')][_0x07e6('0x3e')]){return db[_0x07e6('0x58')][_0x07e6('0x34')](_0x495cdc[_0x07e6('0x5d')][_0x07e6('0x3e')],{'where':{'MailAccountId':_0x3ee3bd['id']}})[_0x07e6('0x35')](function(){return _0x3ee3bd;});}return _0x3ee3bd;})[_0x07e6('0x35')](respondWithResult(_0xba9c55,null))[_0x07e6('0x2a')](handleError(_0xba9c55,null));};exports[_0x07e6('0x5e')]=function(_0x4b1726,_0x5de323){return db['MailAccount']['describe']()[_0x07e6('0x35')](respondWithResult(_0x5de323,null))[_0x07e6('0x2a')](handleError(_0x5de323,null));};exports[_0x07e6('0x5f')]=function(_0x15697e,_0xa9e5f4,_0x290baa){if(_0x15697e['body']['id']){delete _0x15697e[_0x07e6('0x5d')]['id'];}return db[_0x07e6('0x42')]['find']({'where':{'id':_0x15697e['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0xa9e5f4,null))[_0x07e6('0x35')](function(_0x429fae){if(_0x429fae){_0x15697e['body'][_0x07e6('0x60')]=_0x429fae['id'];return db[_0x07e6('0x61')][_0x07e6('0x62')](_0x15697e[_0x07e6('0x5d')]);}})[_0x07e6('0x35')](respondWithResult(_0xa9e5f4,null))['catch'](handleError(_0xa9e5f4,null));};exports[_0x07e6('0x63')]=function(_0x27f47a,_0x783f4c,_0x50e99a){var _0x4bb0bf={'raw':![],'where':{}};var _0x940755={};var _0x27c28f={'count':0x0,'rows':[]};return db['MailAccount'][_0x07e6('0x64')]({'where':{'id':_0x27f47a[_0x07e6('0x57')]['id']}})['then'](handleEntityNotFound(_0x783f4c,null))['then'](function(_0x92ff0c){if(_0x92ff0c){_0x940755[_0x07e6('0x46')]=_[_0x07e6('0x48')](db[_0x07e6('0x61')][_0x07e6('0x43')]);_0x940755[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x27f47a[_0x07e6('0x47')]);_0x940755[_0x07e6('0x4f')]=_[_0x07e6('0x49')](_0x940755[_0x07e6('0x46')],_0x940755[_0x07e6('0x47')]);_0x4bb0bf[_0x07e6('0x4a')]=_['intersection'](_0x940755[_0x07e6('0x46')],qs[_0x07e6('0x59')](_0x27f47a[_0x07e6('0x47')][_0x07e6('0x59')]));_0x4bb0bf[_0x07e6('0x4a')]=_0x4bb0bf[_0x07e6('0x4a')][_0x07e6('0x5a')]?_0x4bb0bf[_0x07e6('0x4a')]:_0x940755['model'];if(!_0x27f47a[_0x07e6('0x47')]['hasOwnProperty']('nolimit')){_0x4bb0bf[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x27f47a[_0x07e6('0x47')][_0x07e6('0x2f')]);_0x4bb0bf[_0x07e6('0x31')]=qs[_0x07e6('0x31')](_0x27f47a['query'][_0x07e6('0x31')]);}_0x4bb0bf[_0x07e6('0x65')]=qs['sort'](_0x27f47a['query'][_0x07e6('0x4d')]);_0x4bb0bf[_0x07e6('0x4e')]=qs['filters'](_[_0x07e6('0x66')](_0x27f47a[_0x07e6('0x47')],_0x940755['filters']));_0x4bb0bf[_0x07e6('0x4e')]['MailAccountId']=_0x92ff0c['id'];if(_0x27f47a[_0x07e6('0x47')][_0x07e6('0x50')]){_0x4bb0bf[_0x07e6('0x4e')]=_[_0x07e6('0x51')](_0x4bb0bf[_0x07e6('0x4e')],{'$or':_['map'](_0x4bb0bf[_0x07e6('0x4a')],function(_0x4079f8){var _0xde2721={};_0xde2721[_0x4079f8]={'$like':'%'+_0x27f47a[_0x07e6('0x47')][_0x07e6('0x50')]+'%'};return _0xde2721;})});}_0x4bb0bf=_[_0x07e6('0x51')]({},_0x4bb0bf,_0x27f47a[_0x07e6('0x53')]);return db[_0x07e6('0x61')]['count']({'where':_0x4bb0bf['where']})[_0x07e6('0x35')](function(_0x24345d){_0x27c28f[_0x07e6('0x30')]=_0x24345d;if(_0x27f47a[_0x07e6('0x47')][_0x07e6('0x5b')]){_0x4bb0bf['include']=[{'all':!![]}];}return db[_0x07e6('0x61')][_0x07e6('0x54')](_0x4bb0bf);})[_0x07e6('0x35')](function(_0x1e8f56){_0x27c28f[_0x07e6('0x55')]=_0x1e8f56;return _0x27c28f;});}})['then'](respondWithFilteredResult(_0x783f4c,_0x4bb0bf))[_0x07e6('0x2a')](handleError(_0x783f4c,null));};exports[_0x07e6('0x67')]=function(_0x4b96b5,_0x197310,_0x59ed4a){return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x4b96b5[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x197310,null))[_0x07e6('0x35')](function(_0x49c220){if(_0x49c220){return _0x49c220[_0x07e6('0x67')](_0x4b96b5[_0x07e6('0x47')][_0x07e6('0x68')]);}})[_0x07e6('0x35')](respondWithStatusCode(_0x197310,null))[_0x07e6('0x2a')](handleError(_0x197310,null));};exports[_0x07e6('0x69')]=function(_0x45e38b,_0x13df5d,_0x11f2bb){if(_0x45e38b[_0x07e6('0x5d')]['id']){delete _0x45e38b[_0x07e6('0x5d')]['id'];}return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x45e38b['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x13df5d,null))[_0x07e6('0x35')](function(_0x32469e){if(_0x32469e){_0x45e38b['body'][_0x07e6('0x60')]=_0x32469e['id'];return db[_0x07e6('0x6a')][_0x07e6('0x62')](_0x45e38b[_0x07e6('0x5d')]);}})[_0x07e6('0x35')](respondWithResult(_0x13df5d,null))[_0x07e6('0x2a')](handleError(_0x13df5d,null));};exports['getAnswers']=function(_0x95e7b8,_0x1e6ad0,_0x313340){var _0x48745c={'raw':![],'where':{}};var _0x574e50={};var _0x3bae07={'count':0x0,'rows':[]};return db[_0x07e6('0x42')]['findOne']({'where':{'id':_0x95e7b8[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x1e6ad0,null))[_0x07e6('0x35')](function(_0x141ca2){if(_0x141ca2){_0x574e50[_0x07e6('0x46')]=_[_0x07e6('0x48')](db[_0x07e6('0x6a')][_0x07e6('0x43')]);_0x574e50[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x95e7b8[_0x07e6('0x47')]);_0x574e50['filters']=_[_0x07e6('0x49')](_0x574e50[_0x07e6('0x46')],_0x574e50['query']);_0x48745c[_0x07e6('0x4a')]=_[_0x07e6('0x49')](_0x574e50[_0x07e6('0x46')],qs[_0x07e6('0x59')](_0x95e7b8[_0x07e6('0x47')][_0x07e6('0x59')]));_0x48745c['attributes']=_0x48745c['attributes'][_0x07e6('0x5a')]?_0x48745c[_0x07e6('0x4a')]:_0x574e50[_0x07e6('0x46')];if(!_0x95e7b8[_0x07e6('0x47')][_0x07e6('0x4b')]('nolimit')){_0x48745c[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x95e7b8[_0x07e6('0x47')]['limit']);_0x48745c['offset']=qs[_0x07e6('0x31')](_0x95e7b8['query'][_0x07e6('0x31')]);}_0x48745c['order']=qs[_0x07e6('0x4d')](_0x95e7b8[_0x07e6('0x47')]['sort']);_0x48745c[_0x07e6('0x4e')]=qs[_0x07e6('0x4f')](_[_0x07e6('0x66')](_0x95e7b8['query'],_0x574e50[_0x07e6('0x4f')]));_0x48745c[_0x07e6('0x4e')][_0x07e6('0x60')]=_0x141ca2['id'];if(_0x95e7b8['query'][_0x07e6('0x50')]){_0x48745c[_0x07e6('0x4e')]=_['merge'](_0x48745c[_0x07e6('0x4e')],{'$or':_[_0x07e6('0x41')](_0x48745c['attributes'],function(_0x2fe49c){var _0x199bc4={};_0x199bc4[_0x2fe49c]={'$like':'%'+_0x95e7b8[_0x07e6('0x47')]['filter']+'%'};return _0x199bc4;})});}_0x48745c=_[_0x07e6('0x51')]({},_0x48745c,_0x95e7b8[_0x07e6('0x53')]);return db[_0x07e6('0x6a')][_0x07e6('0x30')]({'where':_0x48745c[_0x07e6('0x4e')]})[_0x07e6('0x35')](function(_0x2196b8){_0x3bae07[_0x07e6('0x30')]=_0x2196b8;if(_0x95e7b8[_0x07e6('0x47')][_0x07e6('0x5b')]){_0x48745c[_0x07e6('0x6b')]=[{'all':!![]}];}return db[_0x07e6('0x6a')][_0x07e6('0x54')](_0x48745c);})[_0x07e6('0x35')](function(_0x4531d6){_0x3bae07[_0x07e6('0x55')]=_0x4531d6;return _0x3bae07;});}})[_0x07e6('0x35')](respondWithFilteredResult(_0x1e6ad0,_0x48745c))[_0x07e6('0x2a')](handleError(_0x1e6ad0,null));};exports[_0x07e6('0x6c')]=function(_0x5b6e25,_0x5b8454,_0x3eb910){return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x5b6e25[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x5b8454,null))[_0x07e6('0x35')](function(_0x5c0a10){if(_0x5c0a10){return _0x5c0a10['removeAnswers'](_0x5b6e25['query']['ids']);}})[_0x07e6('0x35')](respondWithStatusCode(_0x5b8454,null))['catch'](handleError(_0x5b8454,null));};exports[_0x07e6('0x62')]=function(_0x36976d,_0x1ca6ea){var _0x104df1={'name':_0x36976d[_0x07e6('0x5d')]['name'],'key':_0x36976d['body'][_0x07e6('0x6d')],'email':_0x36976d[_0x07e6('0x5d')][_0x07e6('0x6e')],'ListId':_0x36976d['body'][_0x07e6('0x6f')],'active':!_[_0x07e6('0x70')](_0x36976d[_0x07e6('0x5d')]['active'])?_0x36976d[_0x07e6('0x5d')][_0x07e6('0x71')]:!![],'description':_0x36976d[_0x07e6('0x5d')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x07e6('0x70')](_0x36976d[_0x07e6('0x5d')][_0x07e6('0x72')])){if(_0x36976d[_0x07e6('0x5d')][_0x07e6('0x73')]){_0x104df1['Imap']['user']=_0x104df1[_0x07e6('0x3e')][_0x07e6('0x74')]=_0x36976d[_0x07e6('0x5d')][_0x07e6('0x75')];_0x104df1[_0x07e6('0x3d')][_0x07e6('0x76')]=_0x104df1[_0x07e6('0x3e')][_0x07e6('0x77')]=_0x36976d[_0x07e6('0x5d')]['cpassword'];}else{_0x104df1[_0x07e6('0x3d')][_0x07e6('0x78')]=_0x104df1[_0x07e6('0x3e')][_0x07e6('0x78')]=![];}_0x104df1['Imap'][_0x07e6('0x79')]=_0x36976d[_0x07e6('0x5d')][_0x07e6('0x3d')][_0x07e6('0x79')];_0x104df1[_0x07e6('0x3d')][_0x07e6('0x7a')]=_0x36976d[_0x07e6('0x5d')]['Imap']['port'];_0x104df1[_0x07e6('0x3e')][_0x07e6('0x79')]=_0x36976d[_0x07e6('0x5d')][_0x07e6('0x3e')][_0x07e6('0x79')];_0x104df1['Smtp'][_0x07e6('0x7a')]=_0x36976d['body'][_0x07e6('0x3e')][_0x07e6('0x7a')];}else{_0x104df1[_0x07e6('0x3d')][_0x07e6('0x7b')]=_0x104df1['Smtp']['service']=_0x36976d[_0x07e6('0x5d')][_0x07e6('0x72')];_0x104df1['Imap'][_0x07e6('0x74')]=_0x104df1[_0x07e6('0x3e')][_0x07e6('0x74')]=_0x36976d[_0x07e6('0x5d')][_0x07e6('0x75')];_0x104df1[_0x07e6('0x3d')][_0x07e6('0x76')]=_0x104df1['Smtp'][_0x07e6('0x77')]=_0x36976d['body'][_0x07e6('0x7c')];}return db[_0x07e6('0x42')]['create'](_0x104df1,{'include':[{'model':db['MailServerOut'],'as':_0x07e6('0x3e')},{'model':db[_0x07e6('0x3c')],'as':'Imap'}]})[_0x07e6('0x35')](function(_0xd40609){var _0x26fba7=_0x36976d['user'][_0x07e6('0x7d')]({'plain':!![]});if(!_0x26fba7)throw new Error(_0x07e6('0x7e'));if(_0x26fba7[_0x07e6('0x7f')]===_0x07e6('0x74')){var _0x1d06ae=_0xd40609[_0x07e6('0x7d')]({'plain':!![]});return db[_0x07e6('0x80')][_0x07e6('0x5c')]({'where':{'name':_0x07e6('0x37'),'userProfileId':_0x26fba7[_0x07e6('0x81')]},'raw':!![]})['then'](function(_0xd1c51a){if(_0xd1c51a&&_0xd1c51a['autoAssociation']===0x0){return db[_0x07e6('0x38')]['create']({'name':_0x1d06ae[_0x07e6('0x39')],'resourceId':_0x1d06ae['id'],'type':_0xd1c51a[_0x07e6('0x39')],'sectionId':_0xd1c51a['id']},{})['then'](function(){return _0xd40609;});}else{return _0xd40609;}})[_0x07e6('0x2a')](function(_0x3aee75){logger['error'](_0x07e6('0x82'),_0x3aee75);throw _0x3aee75;});}return _0xd40609;})[_0x07e6('0x35')](respondWithResult(_0x1ca6ea,0xc9))[_0x07e6('0x2a')](handleError(_0x1ca6ea,null));};exports[_0x07e6('0x83')]=function(_0x4b6463,_0x4d7c00,_0x1183d1){return db['MailAccount']['findOne']({'where':{'id':_0x4b6463['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x4d7c00,null))[_0x07e6('0x35')](function(_0x3296a7){if(_0x3296a7){return _0x3296a7[_0x07e6('0x83')]();}return null;})[_0x07e6('0x35')](respondWithResult(_0x4d7c00,null))['catch'](handleError(_0x4d7c00,null));};exports[_0x07e6('0x84')]=function(_0x5eb677,_0x34cd33,_0x459172){if(_0x5eb677[_0x07e6('0x5d')]['id']){delete _0x5eb677[_0x07e6('0x5d')]['id'];}return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x5eb677['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x34cd33,null))[_0x07e6('0x35')](function(_0x36afe4){if(_0x36afe4){_0x5eb677[_0x07e6('0x5d')][_0x07e6('0x60')]=_0x36afe4['id'];return db['MailServerIn'][_0x07e6('0x62')](_0x5eb677[_0x07e6('0x5d')]);}})[_0x07e6('0x35')](respondWithResult(_0x34cd33,null))[_0x07e6('0x2a')](handleError(_0x34cd33,null));};exports['removeImap']=function(_0x597300,_0x52253d,_0x126701){return db[_0x07e6('0x42')]['findOne']({'where':{'id':_0x597300[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x52253d,null))['then'](function(_0x427d4a){if(_0x427d4a){return _0x427d4a[_0x07e6('0x85')](null);}return null;})[_0x07e6('0x35')](respondWithStatusCode(_0x52253d,null))[_0x07e6('0x2a')](handleError(_0x52253d,null));};exports['getSmtp']=function(_0x2dec83,_0x593792,_0xd1fc87){return db[_0x07e6('0x42')][_0x07e6('0x64')]({'where':{'id':_0x2dec83['params']['id']}})['then'](handleEntityNotFound(_0x593792,null))['then'](function(_0x4b1711){if(_0x4b1711){return _0x4b1711['getSmtp']();}return null;})[_0x07e6('0x35')](respondWithResult(_0x593792,null))['catch'](handleError(_0x593792,null));};exports[_0x07e6('0x86')]=function(_0x316846,_0x434a62,_0x556aa8){if(_0x316846[_0x07e6('0x5d')]['id']){delete _0x316846[_0x07e6('0x5d')]['id'];}return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x316846[_0x07e6('0x57')]['id']}})['then'](handleEntityNotFound(_0x434a62,null))[_0x07e6('0x35')](function(_0x4407df){if(_0x4407df){_0x316846[_0x07e6('0x5d')][_0x07e6('0x60')]=_0x4407df['id'];return db[_0x07e6('0x58')]['create'](_0x316846[_0x07e6('0x5d')]);}})[_0x07e6('0x35')](respondWithResult(_0x434a62,null))['catch'](handleError(_0x434a62,null));};exports[_0x07e6('0x87')]=function(_0x2fcc30,_0x3fe51e,_0x582031){return db['MailAccount'][_0x07e6('0x64')]({'where':{'id':_0x2fcc30['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x3fe51e,null))[_0x07e6('0x35')](function(_0x2cc274){if(_0x2cc274){return _0x2cc274['setSmtp'](null);}return null;})[_0x07e6('0x35')](respondWithStatusCode(_0x3fe51e,null))[_0x07e6('0x2a')](handleError(_0x3fe51e,null));};exports[_0x07e6('0x88')]=function(_0x1ad922,_0x3ca014,_0x3ae590){return db[_0x07e6('0x89')][_0x07e6('0x5c')]({'where':{'id':_0x1ad922['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x3ca014,null))[_0x07e6('0x35')](function(_0x3a96ad){if(_0x3a96ad){return _0x3a96ad['addInteraction'](_0x1ad922['body'][_0x07e6('0x68')],_['omit'](_0x1ad922[_0x07e6('0x5d')],[_0x07e6('0x68'),'id'])||{});}})[_0x07e6('0x35')](respondWithResult(_0x3ca014,null))[_0x07e6('0x2a')](handleError(_0x3ca014,null));};exports[_0x07e6('0x8a')]=function(_0x1306a5,_0x1a24f1,_0x559190){var _0x3528aa={'raw':![],'where':{}};var _0x383ff1={};var _0x3359f6={'count':0x0,'rows':[]};return db[_0x07e6('0x42')][_0x07e6('0x64')]({'where':{'id':_0x1306a5['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x1a24f1,null))[_0x07e6('0x35')](function(_0x1d0729){if(_0x1d0729){_0x383ff1['model']=_[_0x07e6('0x48')](db[_0x07e6('0x89')]['rawAttributes']);_0x383ff1[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x1306a5['query']);_0x383ff1[_0x07e6('0x4f')]=_[_0x07e6('0x49')](_0x383ff1[_0x07e6('0x46')],_0x383ff1['query']);_0x3528aa[_0x07e6('0x4a')]=_[_0x07e6('0x49')](_0x383ff1[_0x07e6('0x46')],qs['fields'](_0x1306a5[_0x07e6('0x47')][_0x07e6('0x59')]));_0x3528aa[_0x07e6('0x4a')]=_0x3528aa[_0x07e6('0x4a')][_0x07e6('0x5a')]?_0x3528aa[_0x07e6('0x4a')]:_0x383ff1[_0x07e6('0x46')];if(!_0x1306a5[_0x07e6('0x47')][_0x07e6('0x4b')](_0x07e6('0x4c'))){_0x3528aa[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x1306a5[_0x07e6('0x47')]['limit']);_0x3528aa[_0x07e6('0x31')]=qs['offset'](_0x1306a5[_0x07e6('0x47')][_0x07e6('0x31')]);}_0x3528aa['order']=qs[_0x07e6('0x4d')](_0x1306a5['query']['sort']);_0x3528aa['where']=qs[_0x07e6('0x4f')](_[_0x07e6('0x66')](_0x1306a5[_0x07e6('0x47')],_0x383ff1[_0x07e6('0x4f')]));_0x3528aa[_0x07e6('0x4e')]['MailAccountId']=_0x1d0729['id'];if(_0x1306a5['query']['filter']){_0x3528aa[_0x07e6('0x4e')]=_[_0x07e6('0x51')](_0x3528aa['where'],{'$or':_[_0x07e6('0x41')](_0x3528aa[_0x07e6('0x4a')],function(_0xa20c67){var _0xf0c2a={};_0xf0c2a[_0xa20c67]={'$like':'%'+_0x1306a5[_0x07e6('0x47')][_0x07e6('0x50')]+'%'};return _0xf0c2a;})});}_0x3528aa=_[_0x07e6('0x51')]({},_0x3528aa,_0x1306a5[_0x07e6('0x53')]);return db[_0x07e6('0x89')][_0x07e6('0x30')]({'where':_0x3528aa[_0x07e6('0x4e')]})[_0x07e6('0x35')](function(_0x4076ae){_0x3359f6[_0x07e6('0x30')]=_0x4076ae;if(_0x1306a5['query'][_0x07e6('0x5b')]){_0x3528aa['include']=[{'model':db[_0x07e6('0x8b')],'as':_0x07e6('0x8c'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x07e6('0x39'),_0x07e6('0x8d'),_0x07e6('0x8e')],'required':![]},{'model':db['Tag'],'as':_0x07e6('0x8f'),'attributes':['id',_0x07e6('0x39'),_0x07e6('0x90')],'where':_0x1306a5[_0x07e6('0x47')][_0x07e6('0x91')]?{'id':_0x1306a5[_0x07e6('0x47')]['tag']}:undefined,'required':_0x1306a5[_0x07e6('0x47')][_0x07e6('0x91')]?!![]:![]}];}return db['MailInteraction'][_0x07e6('0x54')](_0x3528aa);})[_0x07e6('0x35')](function(_0x3e7fa0){_0x3359f6[_0x07e6('0x55')]=_0x3e7fa0;return _0x3359f6;});}})['then'](respondWithFilteredResult(_0x1a24f1,_0x3528aa))['catch'](handleError(_0x1a24f1,null));};exports['addApplications']=function(_0x33417e,_0x2d692a,_0x3d9714){return db[_0x07e6('0x42')][_0x07e6('0x64')]({'where':{'id':_0x33417e[_0x07e6('0x57')]['id']}})['then'](handleEntityNotFound(_0x2d692a,null))['then'](function(_0x4d6397){if(_0x4d6397){return db[_0x07e6('0x92')][_0x07e6('0x93')](function(_0x38e7c0){return db['MailApplication'][_0x07e6('0x36')]({'where':{'MailAccountId':_0x33417e['params']['id']},'transaction':_0x38e7c0})[_0x07e6('0x35')](function(_0x1bd8ff){var _0x196e3f=_[_0x07e6('0x41')](_0x33417e['body'],function(_0x42a226){_0x42a226['MailAccountId']=_0x33417e['params']['id'];return _0x42a226;});return db[_0x07e6('0x94')][_0x07e6('0x95')](_0x196e3f,{'transaction':_0x38e7c0});});})[_0x07e6('0x35')](function(){return db[_0x07e6('0x94')]['findAndCountAll']({'where':{'MailAccountId':_0x33417e[_0x07e6('0x57')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x2d692a,null))[_0x07e6('0x2a')](handleError(_0x2d692a,null));};exports['getApplications']=function(_0x38b129,_0x2dd1ef,_0x59d71c){var _0x15aba5={};var _0x2436e0={};var _0xfc9dad;var _0x561461;return db[_0x07e6('0x42')][_0x07e6('0x64')]({'where':{'id':_0x38b129[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x2dd1ef,null))[_0x07e6('0x35')](function(_0x23e709){if(_0x23e709){_0xfc9dad=_0x23e709;_0x2436e0[_0x07e6('0x46')]=_[_0x07e6('0x48')](db[_0x07e6('0x94')][_0x07e6('0x43')]);_0x2436e0[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x38b129[_0x07e6('0x47')]);_0x2436e0[_0x07e6('0x4f')]=_[_0x07e6('0x49')](_0x2436e0['model'],_0x2436e0['query']);_0x15aba5[_0x07e6('0x4a')]=_[_0x07e6('0x49')](_0x2436e0[_0x07e6('0x46')],qs[_0x07e6('0x59')](_0x38b129[_0x07e6('0x47')][_0x07e6('0x59')]));_0x15aba5[_0x07e6('0x4a')]=_0x15aba5[_0x07e6('0x4a')][_0x07e6('0x5a')]?_0x15aba5['attributes']:_0x2436e0[_0x07e6('0x46')];_0x15aba5[_0x07e6('0x65')]=qs[_0x07e6('0x4d')](_0x38b129['query']['sort']);_0x15aba5[_0x07e6('0x4e')]=qs[_0x07e6('0x4f')](_[_0x07e6('0x66')](_0x38b129['query'],_0x2436e0['filters']));if(_0x38b129['query']['filter']){_0x15aba5[_0x07e6('0x4e')]=_[_0x07e6('0x51')](_0x15aba5['where'],{'$or':_[_0x07e6('0x41')](_0x15aba5[_0x07e6('0x4a')],function(_0x39d016){var _0x14c062={};_0x14c062[_0x39d016]={'$like':'%'+_0x38b129[_0x07e6('0x47')][_0x07e6('0x50')]+'%'};return _0x14c062;})});}_0x15aba5=_['merge']({},_0x15aba5,_0x38b129[_0x07e6('0x53')]);return _0xfc9dad[_0x07e6('0x96')](_0x15aba5);}})[_0x07e6('0x35')](function(_0x6617b0){if(_0x6617b0){_0x561461=_0x6617b0['length'];if(!_0x38b129[_0x07e6('0x47')][_0x07e6('0x4b')](_0x07e6('0x4c'))){_0x15aba5[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x38b129[_0x07e6('0x47')]['limit']);_0x15aba5[_0x07e6('0x31')]=qs[_0x07e6('0x31')](_0x38b129['query'][_0x07e6('0x31')]);}return _0xfc9dad[_0x07e6('0x96')](_0x15aba5);}})[_0x07e6('0x35')](function(_0x36fe37){if(_0x36fe37){return _0x36fe37?{'count':_0x561461,'rows':_0x36fe37}:null;}})[_0x07e6('0x35')](respondWithResult(_0x2dd1ef,null))[_0x07e6('0x2a')](handleError(_0x2dd1ef,null));};exports[_0x07e6('0x97')]=function(_0x115dac,_0x56c28f,_0x580c3f){var _0x233b67={'raw':!![],'where':{}};var _0x5283a0={};var _0x204b77={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x115dac[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x56c28f,null))[_0x07e6('0x35')](function(_0x484b2c){if(_0x484b2c){_0x5283a0['model']=_[_0x07e6('0x48')](db[_0x07e6('0x98')]['rawAttributes']);_0x5283a0[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x115dac['query']);_0x5283a0[_0x07e6('0x4f')]=_[_0x07e6('0x49')](_0x5283a0[_0x07e6('0x46')],_0x5283a0['query']);_0x233b67['attributes']=_[_0x07e6('0x49')](_0x5283a0[_0x07e6('0x46')],qs[_0x07e6('0x59')](_0x115dac[_0x07e6('0x47')][_0x07e6('0x59')]));_0x233b67[_0x07e6('0x4a')]=_0x233b67[_0x07e6('0x4a')][_0x07e6('0x5a')]?_0x233b67[_0x07e6('0x4a')]:_0x5283a0[_0x07e6('0x46')];if(!_0x115dac[_0x07e6('0x47')]['hasOwnProperty'](_0x07e6('0x4c'))){_0x233b67[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x115dac[_0x07e6('0x47')]['limit']);_0x233b67[_0x07e6('0x31')]=qs[_0x07e6('0x31')](_0x115dac[_0x07e6('0x47')]['offset']);}_0x233b67[_0x07e6('0x65')]=qs[_0x07e6('0x4d')](_0x115dac[_0x07e6('0x47')][_0x07e6('0x4d')]);_0x233b67[_0x07e6('0x4e')]=qs[_0x07e6('0x4f')](_['pick'](_0x115dac[_0x07e6('0x47')],_0x5283a0[_0x07e6('0x4f')]));_0x233b67[_0x07e6('0x4e')]['MailAccountId']=_0x484b2c['id'];if(_0x115dac['query']['filter']){_0x233b67[_0x07e6('0x4e')]=_[_0x07e6('0x51')](_0x233b67[_0x07e6('0x4e')],{'$or':_['map'](_0x233b67[_0x07e6('0x4a')],function(_0x37cda3){var _0x975ea3={};_0x975ea3[_0x37cda3]={'$like':'%'+_0x115dac[_0x07e6('0x47')]['filter']+'%'};return _0x975ea3;})});}if(_0x115dac[_0x07e6('0x47')][_0x07e6('0x99')]){var _0x122662=_0x115dac['query'][_0x07e6('0x99')][_0x07e6('0x9a')](',');var _0xaebc58={};_0xaebc58[_0x122662[0x0]]={'$gte':moment(_0x122662[0x1])[_0x07e6('0x9b')](_0x07e6('0x9c'))};_0x233b67['where']=_[_0x07e6('0x51')](_0x233b67[_0x07e6('0x4e')],_0xaebc58);}_0x233b67=_[_0x07e6('0x51')]({},_0x233b67,_0x115dac[_0x07e6('0x53')]);return db['MailMessage'][_0x07e6('0x30')]({'where':_0x233b67[_0x07e6('0x4e')]})['then'](function(_0x4f20b3){_0x204b77[_0x07e6('0x30')]=_0x4f20b3;if(_0x115dac['query'][_0x07e6('0x5b')]){_0x233b67[_0x07e6('0x6b')]=[{'all':!![]}];}return db[_0x07e6('0x98')][_0x07e6('0x54')](_0x233b67);})[_0x07e6('0x35')](function(_0x530472){if(_0x115dac[_0x07e6('0x47')][_0x07e6('0x9d')]==='true'){for(var _0x2ed932=0x0;_0x2ed932<_0x530472[_0x07e6('0x5a')];_0x2ed932++){_0x530472[_0x2ed932][_0x07e6('0x5d')]=juice(_0x530472[_0x2ed932][_0x07e6('0x5d')]);}}_0x204b77[_0x07e6('0x55')]=_0x530472;return _0x204b77;});}})[_0x07e6('0x35')](respondWithFilteredResult(_0x56c28f,_0x233b67))[_0x07e6('0x2a')](handleError(_0x56c28f,null));};exports[_0x07e6('0x3a')]=function(_0x1dadde,_0x27121c,_0x2f6e5f){var _0x5ae603,_0x8c4e9e={},_0x579839;if(_0x1dadde['body']['to']){_0x579839=_0x1dadde[_0x07e6('0x5d')]['to']['split'](',')[0x0];}return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x1dadde[_0x07e6('0x57')]['id']},'include':[{'model':db[_0x07e6('0x9e')],'as':'List','include':[{'model':db[_0x07e6('0x8b')],'as':_0x07e6('0x9f'),'where':{'email':_0x579839},'limit':0x1,'order':[[_0x07e6('0xa0'),_0x07e6('0xa1')]]}]},{'model':db[_0x07e6('0x58')],'as':_0x07e6('0x3e'),'raw':!![]}]})[_0x07e6('0x35')](handleEntityNotFound(_0x27121c,null))[_0x07e6('0x35')](function(_0x351acf){if(_0x351acf){_0x5ae603=_0x351acf;if(_0x351acf[_0x07e6('0x3e')]){if(_[_0x07e6('0x70')](_0x1dadde['body'][_0x07e6('0xa2')])){_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xa2')]=util[_0x07e6('0x9b')](_0x07e6('0xa3'),_0x351acf[_0x07e6('0x39')],_0x351acf[_0x07e6('0x6e')]||_0x351acf[_0x07e6('0x3e')]['user']);}if(_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xa4')]&&_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xa4')][_0x07e6('0x5a')]){for(var _0x545dad=0x0;_0x545dad<_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xa4')][_0x07e6('0x5a')];_0x545dad+=0x1){_0x1dadde[_0x07e6('0x5d')]['attachments'][_0x545dad]={'filename':_0x1dadde[_0x07e6('0x5d')]['attachments'][_0x545dad][_0x07e6('0x39')],'path':path['join'](config['root'],_0x07e6('0xa5'),_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xa4')][_0x545dad][_0x07e6('0xa6')])};}}var _0x48db05={'tls':{'rejectUnauthorized':![]}};if(_[_0x07e6('0x70')](_0x351acf[_0x07e6('0x3e')][_0x07e6('0x7b')])){if(_0x351acf[_0x07e6('0x3e')][_0x07e6('0x78')]){_0x48db05[_0x07e6('0xa7')]={'user':_0x351acf['Smtp'][_0x07e6('0x74')],'pass':_0x351acf[_0x07e6('0x3e')][_0x07e6('0x77')]};}_0x48db05[_0x07e6('0x79')]=_0x351acf['Smtp'][_0x07e6('0x79')];_0x48db05[_0x07e6('0x7a')]=_0x351acf[_0x07e6('0x3e')][_0x07e6('0x7a')];_0x48db05[_0x07e6('0xa8')]=_0x351acf['Smtp'][_0x07e6('0xa8')];}else{_0x48db05[_0x07e6('0x7b')]=_0x351acf[_0x07e6('0x3e')][_0x07e6('0x7b')];_0x48db05['auth']={'user':_0x351acf[_0x07e6('0x3e')][_0x07e6('0x74')],'pass':_0x351acf[_0x07e6('0x3e')][_0x07e6('0x77')]};}return respondWithRpcPromise(_0x07e6('0xa9'),'sendMail',{'account':_0x48db05,'message':_0x1dadde[_0x07e6('0x5d')]});}else{throw new Error(_0x07e6('0xaa'));}}})[_0x07e6('0x35')](function(_0x4d9b64){if(_0x4d9b64){_0x8c4e9e=_0x4d9b64;if(_0x5ae603['List']){if(_0x5ae603[_0x07e6('0xab')][_0x07e6('0x9f')][_0x07e6('0x5a')]){return _0x5ae603[_0x07e6('0xab')][_0x07e6('0x9f')][0x0];}else{return db[_0x07e6('0x8b')]['create'](_[_0x07e6('0x1b')](_0x1dadde[_0x07e6('0x5d')],{'firstName':_0x1dadde[_0x07e6('0x5d')]['to'],'email':_0x1dadde[_0x07e6('0x5d')]['to'],'phone':_0x1dadde[_0x07e6('0x5d')]['to'],'ListId':_0x5ae603['ListId']}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0xe9cafb){if(_0xe9cafb){var _0x235f68={'UserId':_0x1dadde[_0x07e6('0x74')]['id'],'ContactId':_0xe9cafb['id'],'MailAccountId':_0x5ae603['id'],'inReplyTo':_0x8c4e9e[_0x07e6('0xac')],'to':_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xa2')],'cc':_0x1dadde[_0x07e6('0x5d')]['cc'],'subject':_0x1dadde['body']['subject'],'attach':_0x1dadde['body']['attach'],'firstMsgDirection':_0x07e6('0xad'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x07e6('0xad'),'Messages':[_[_0x07e6('0x51')](_0x1dadde[_0x07e6('0x5d')],{'messageId':_0x8c4e9e[_0x07e6('0xac')],'sentAt':moment()[_0x07e6('0x9b')](_0x07e6('0x9c')),'read':!![],'MailAccountId':_0x5ae603['id'],'UserId':_0x1dadde[_0x07e6('0x74')]['id'],'ContactId':_0xe9cafb['id']})]};if(_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xae')]){_0x235f68=_[_0x07e6('0x51')](_0x235f68,_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xae')]);}return db['MailInteraction'][_0x07e6('0x62')](_0x235f68,{'include':[{'model':db[_0x07e6('0x98')],'as':_0x07e6('0xaf')}]});}})[_0x07e6('0x35')](respondWithResult(_0x27121c,null))[_0x07e6('0x2a')](handleError(_0x27121c,null));};exports[_0x07e6('0xb0')]=function(_0x886ef3,_0x44a8f6,_0x5ae54a){return db[_0x07e6('0x42')]['find']({'where':{'id':_0x886ef3[_0x07e6('0x57')]['id']},'include':[{'model':db[_0x07e6('0x58')],'as':_0x07e6('0x3e'),'raw':!![]}]})[_0x07e6('0x35')](handleEntityNotFound(_0x44a8f6,null))['then'](function(_0x21315e){if(_0x21315e&&_0x21315e[_0x07e6('0x3e')]){var _0x1361dd={'id':_0x21315e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x21315e[_0x07e6('0x3e')][_0x07e6('0x7b')]){_0x1361dd[_0x07e6('0x7b')]=_0x21315e['Smtp']['service'];}else{_0x1361dd['host']=_0x21315e[_0x07e6('0x3e')]['host'];_0x1361dd[_0x07e6('0x7a')]=_0x21315e['Smtp'][_0x07e6('0x7a')];_0x1361dd[_0x07e6('0xa8')]=_0x21315e[_0x07e6('0x3e')][_0x07e6('0xa8')];}if(_0x21315e[_0x07e6('0x3e')]['authentication']){_0x1361dd[_0x07e6('0xa7')]={'user':_0x21315e[_0x07e6('0x3e')]['user'],'pass':_0x21315e[_0x07e6('0x3e')]['pass']};}return respondWithRpcPromise(_0x07e6('0xb1'),_0x07e6('0xb0'),{'account':_0x1361dd});}})[_0x07e6('0x35')](respondWithResult(_0x44a8f6,null))[_0x07e6('0x2a')](handleError(_0x44a8f6,null));};exports[_0x07e6('0x36')]=function(_0x242099,_0x24c11f){return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x242099[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x24c11f,null))[_0x07e6('0x35')](function(_0x44c21d){if(_0x44c21d&&_0x44c21d['service']){throw new db[(_0x07e6('0xb2'))][(_0x07e6('0xb3'))](_0x07e6('0xb4'));}return _0x44c21d;})[_0x07e6('0x35')](removeEntity(_0x24c11f,null))['catch'](handleError(_0x24c11f,null));};exports['addAgents']=function(_0x3d858b,_0x13b5d9,_0x58206b){return db[_0x07e6('0x42')]['find']({'where':{'id':_0x3d858b[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x13b5d9,null))[_0x07e6('0x35')](function(_0x44f3a4){if(_0x44f3a4){return _0x44f3a4['addAgents'](_0x3d858b[_0x07e6('0x5d')][_0x07e6('0x68')],_[_0x07e6('0xb5')](_0x3d858b[_0x07e6('0x5d')],[_0x07e6('0x68'),'id'])||{})[_0x07e6('0xb6')](function(_0x5ed699){for(var _0x1996fe=0x0;_0x1996fe<_0x3d858b[_0x07e6('0x5d')][_0x07e6('0x68')][_0x07e6('0x5a')];_0x1996fe+=0x1){socket[_0x07e6('0xb7')](_0x07e6('0xb8'),{'UserId':Number(_0x3d858b[_0x07e6('0x5d')][_0x07e6('0x68')][_0x1996fe]),'MailAccountId':Number(_0x3d858b[_0x07e6('0x57')]['id'])});}return _0x5ed699;});}})[_0x07e6('0x35')](respondWithResult(_0x13b5d9,null))[_0x07e6('0x2a')](handleError(_0x13b5d9,null));};exports[_0x07e6('0xb9')]=function(_0x2f7e38,_0x1ac489,_0x2e8c0d){return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x2f7e38['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x1ac489,null))[_0x07e6('0x35')](function(_0x42a83a){if(_0x42a83a){return _0x42a83a[_0x07e6('0xb9')](_0x2f7e38[_0x07e6('0x47')][_0x07e6('0x68')])[_0x07e6('0x35')](function(){if(_[_0x07e6('0xba')](_0x2f7e38[_0x07e6('0x47')][_0x07e6('0x68')])){for(var _0x567e3d=0x0;_0x567e3d<_0x2f7e38['query']['ids'][_0x07e6('0x5a')];_0x567e3d+=0x1){socket[_0x07e6('0xb7')](_0x07e6('0xbb'),{'UserId':Number(_0x2f7e38[_0x07e6('0x47')][_0x07e6('0x68')][_0x567e3d]),'MailAccountId':Number(_0x2f7e38[_0x07e6('0x57')]['id'])});}}else{socket[_0x07e6('0xb7')](_0x07e6('0xbb'),{'UserId':Number(_0x2f7e38[_0x07e6('0x47')]['ids']),'MailAccountId':Number(_0x2f7e38[_0x07e6('0x57')]['id'])});}});}})[_0x07e6('0x35')](respondWithStatusCode(_0x1ac489,null))[_0x07e6('0x2a')](handleError(_0x1ac489,null));};exports['getAgents']=function(_0x1f5039,_0x139a0e,_0x3c1179){var _0x22256e={};var _0x749e5b={};var _0x3494c2;var _0x4e6eb5;return db[_0x07e6('0x42')][_0x07e6('0x64')]({'where':{'id':_0x1f5039[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x139a0e,null))[_0x07e6('0x35')](function(_0x4be3d2){if(_0x4be3d2){_0x3494c2=_0x4be3d2;_0x749e5b[_0x07e6('0x46')]=_[_0x07e6('0x48')](db[_0x07e6('0xbc')]['rawAttributes']);_0x749e5b[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x1f5039[_0x07e6('0x47')]);_0x749e5b[_0x07e6('0x4f')]=_[_0x07e6('0x49')](_0x749e5b[_0x07e6('0x46')],_0x749e5b['query']);_0x22256e[_0x07e6('0x4a')]=_[_0x07e6('0x49')](_0x749e5b['model'],qs[_0x07e6('0x59')](_0x1f5039[_0x07e6('0x47')][_0x07e6('0x59')]));_0x22256e[_0x07e6('0x4a')]=_0x22256e[_0x07e6('0x4a')]['length']?_0x22256e['attributes']:_0x749e5b[_0x07e6('0x46')];_0x22256e[_0x07e6('0x65')]=qs[_0x07e6('0x4d')](_0x1f5039[_0x07e6('0x47')][_0x07e6('0x4d')]);_0x22256e[_0x07e6('0x4e')]=qs[_0x07e6('0x4f')](_[_0x07e6('0x66')](_0x1f5039['query'],_0x749e5b['filters']));if(_0x1f5039['query']['filter']){_0x22256e[_0x07e6('0x4e')]=_['merge'](_0x22256e[_0x07e6('0x4e')],{'$or':_[_0x07e6('0x41')](_0x22256e[_0x07e6('0x4a')],function(_0xb4cb2b){var _0x12f0ce={};_0x12f0ce[_0xb4cb2b]={'$like':'%'+_0x1f5039[_0x07e6('0x47')][_0x07e6('0x50')]+'%'};return _0x12f0ce;})});}_0x22256e=_[_0x07e6('0x51')]({},_0x22256e,_0x1f5039[_0x07e6('0x53')]);return _0x3494c2['getAgents'](_0x22256e);}})[_0x07e6('0x35')](function(_0x2ba256){if(_0x2ba256){_0x4e6eb5=_0x2ba256[_0x07e6('0x5a')];if(!_0x1f5039[_0x07e6('0x47')][_0x07e6('0x4b')](_0x07e6('0x4c'))){_0x22256e[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x1f5039['query'][_0x07e6('0x2f')]);_0x22256e['offset']=qs[_0x07e6('0x31')](_0x1f5039[_0x07e6('0x47')]['offset']);}return _0x3494c2[_0x07e6('0xbd')](_0x22256e);}})[_0x07e6('0x35')](function(_0x27307c){if(_0x27307c){return _0x27307c?{'count':_0x4e6eb5,'rows':_0x27307c}:null;}})[_0x07e6('0x35')](respondWithResult(_0x139a0e,null))[_0x07e6('0x2a')](handleError(_0x139a0e,null));};
\ No newline at end of file
+var _0x475e=['password','pass','authentication','host','port','service','cpassword','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','basename','auth','secure','sendMail','List\x20not\x20found','List','CmContact','subject','attach','out','messageId','Interaction','verifySmtp','VerifySmtp','Sequelize','addAgents','omit','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','http','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','status','json','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','MailAccounts','UserProfileResource','sendStatus','stack','name','send','index','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','MailServerIn','Imap','includeAll','find','body','catch','describe','MailAccountId','getDispositions','findOne','Disposition','findAll','removeDispositions','create','getAnswers','CannedAnswer','removeAnswers','ids','key','email','ListId','isNil','active','description','cservice','user'];(function(_0x12526c,_0x44640f){var _0x17f875=function(_0x1c28bf){while(--_0x1c28bf){_0x12526c['push'](_0x12526c['shift']());}};_0x17f875(++_0x44640f);}(_0x475e,0x1d7));var _0xe475=function(_0x4e136f,_0x417dae){_0x4e136f=_0x4e136f-0x0;var _0x35906d=_0x475e[_0x4e136f];return _0x35906d;};'use strict';var emlformat=require(_0xe475('0x0'));var rimraf=require(_0xe475('0x1'));var zipdir=require(_0xe475('0x2'));var jsonpatch=require(_0xe475('0x3'));var rp=require(_0xe475('0x4'));var moment=require('moment');var BPromise=require(_0xe475('0x5'));var Mustache=require('mustache');var util=require(_0xe475('0x6'));var path=require(_0xe475('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe475('0x8'));var fs=require('fs');var fs_extra=require(_0xe475('0x9'));var _=require(_0xe475('0xa'));var squel=require(_0xe475('0xb'));var crypto=require(_0xe475('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe475('0xd'));var toCsv=require(_0xe475('0xe'));var querystring=require(_0xe475('0xf'));var Papa=require(_0xe475('0x10'));var htmlToText=require('html-to-text');var juice=require('juice');var Redis=require(_0xe475('0x11'));var authService=require(_0xe475('0x12'));var qs=require(_0xe475('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe475('0x14'));var logger=require(_0xe475('0x15'))(_0xe475('0x16'));var utils=require(_0xe475('0x17'));var config=require(_0xe475('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe475('0x19'))['db'];config[_0xe475('0x1a')]=_['defaults'](config[_0xe475('0x1a')],{'host':_0xe475('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe475('0x1a')]));require('./mailAccount.socket')[_0xe475('0x1c')](socket);var jayson=require(_0xe475('0x1d'));var client=jayson['client'][_0xe475('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x2e5a23,_0x574bc9,_0x527b26,_0x32ab42){return new BPromise(function(_0x3c4e73,_0x58e8e6){var _0x4fde8e=_0x32ab42||client;return _0x4fde8e['request'](_0x2e5a23,_0x527b26)['then'](function(_0x25a74f){logger[_0xe475('0x1f')]('MailAccount,\x20%s,\x20%s',_0x574bc9,_0xe475('0x20'));logger[_0xe475('0x21')](_0xe475('0x22'),_0x574bc9,_0xe475('0x20'),JSON[_0xe475('0x23')](_0x25a74f));if(_0x25a74f[_0xe475('0x24')]){if(_0x25a74f['error'][_0xe475('0x25')]===0x1f4){logger['error'](_0xe475('0x26'),_0x574bc9,_0x25a74f[_0xe475('0x24')]['message']);return _0x58e8e6(_0x25a74f[_0xe475('0x24')]['message']);}logger['error'](_0xe475('0x26'),_0x574bc9,_0x25a74f[_0xe475('0x24')]['message']);return _0x3c4e73(_0x25a74f[_0xe475('0x24')][_0xe475('0x27')]);}else{logger[_0xe475('0x1f')](_0xe475('0x26'),_0x574bc9,'request\x20sent');_0x3c4e73(_0x25a74f[_0xe475('0x28')][_0xe475('0x27')]);}})['catch'](function(_0x56d332){logger['error']('MailAccount,\x20%s,\x20%s',_0x574bc9,_0x56d332);_0x58e8e6(_0x56d332);});});}function respondWithStatusCode(_0xffe3ba,_0x757161){_0x757161=_0x757161||0xcc;return function(_0x13251b){if(_0x13251b){return _0xffe3ba['sendStatus'](_0x757161);}return _0xffe3ba[_0xe475('0x29')](_0x757161)['end']();};}function respondWithResult(_0x317c3a,_0xe9f6cd){_0xe9f6cd=_0xe9f6cd||0xc8;return function(_0x60742f){if(_0x60742f){return _0x317c3a[_0xe475('0x29')](_0xe9f6cd)[_0xe475('0x2a')](_0x60742f);}};}function respondWithFilteredResult(_0x1072af,_0x1c7710){return function(_0x5b7623){if(_0x5b7623){var _0x1a2694=typeof _0x1c7710['offset']==='undefined'&&typeof _0x1c7710[_0xe475('0x2b')]==='undefined';var _0x1f69d2=_0x5b7623[_0xe475('0x2c')];var _0x15cf5f=_0x1a2694?0x0:_0x1c7710['offset'];var _0x525a25=_0x1a2694?_0x5b7623['count']:_0x1c7710[_0xe475('0x2d')]+_0x1c7710[_0xe475('0x2b')];var _0x3521f6;if(_0x525a25>=_0x1f69d2){_0x525a25=_0x1f69d2;_0x3521f6=0xc8;}else{_0x3521f6=0xce;}_0x1072af[_0xe475('0x29')](_0x3521f6);return _0x1072af['set'](_0xe475('0x2e'),_0x15cf5f+'-'+_0x525a25+'/'+_0x1f69d2)['json'](_0x5b7623);}return null;};}function patchUpdates(_0x526936){return function(_0x58dacb){try{jsonpatch[_0xe475('0x2f')](_0x58dacb,_0x526936,!![]);}catch(_0x1a2068){return BPromise[_0xe475('0x30')](_0x1a2068);}return _0x58dacb[_0xe475('0x31')]();};}function saveUpdates(_0x556c7b,_0x4ba761){return function(_0xbfe40c){if(_0xbfe40c){return _0xbfe40c[_0xe475('0x32')](_0x556c7b)[_0xe475('0x33')](function(_0x23cc55){return _0x23cc55;});}return null;};}function removeEntity(_0x41ee90,_0x5df699){return function(_0x5bffe7){if(_0x5bffe7){return _0x5bffe7[_0xe475('0x34')]()[_0xe475('0x33')](function(){var _0x505ce8=_0x5bffe7['get']({'plain':!![]});var _0x55db78=_0xe475('0x35');return db[_0xe475('0x36')]['destroy']({'where':{'type':_0x55db78,'resourceId':_0x505ce8['id']}})['then'](function(){return _0x5bffe7;});})['then'](function(){_0x41ee90['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1000a5,_0x8281a1){return function(_0x5911b0){if(!_0x5911b0){_0x1000a5[_0xe475('0x37')](0x194);}return _0x5911b0;};}function handleError(_0x58c70d,_0x2540fa){_0x2540fa=_0x2540fa||0x1f4;return function(_0x3a5df6){logger['error'](_0x3a5df6[_0xe475('0x38')]);if(_0x3a5df6[_0xe475('0x39')]){delete _0x3a5df6[_0xe475('0x39')];}_0x58c70d[_0xe475('0x29')](_0x2540fa)[_0xe475('0x3a')](_0x3a5df6);};}exports[_0xe475('0x3b')]=function(_0x3e01c8,_0x3ad034){var _0x58654f={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xe475('0x3c')],'as':_0xe475('0x3d')},{'model':db[_0xe475('0x3e')],'as':_0xe475('0x3f')}]},_0x94d374={},_0x3ff755={'count':0x0,'rows':[]};var _0x4920e5=_[_0xe475('0x40')](db[_0xe475('0x41')][_0xe475('0x42')],function(_0x20de8d){return{'name':_0x20de8d[_0xe475('0x43')],'type':_0x20de8d[_0xe475('0x44')]['key']};});_0x94d374[_0xe475('0x45')]=_[_0xe475('0x40')](_0x4920e5,_0xe475('0x39'));_0x94d374[_0xe475('0x46')]=_[_0xe475('0x47')](_0x3e01c8['query']);_0x94d374[_0xe475('0x48')]=_[_0xe475('0x49')](_0x94d374[_0xe475('0x45')],_0x94d374[_0xe475('0x46')]);_0x58654f[_0xe475('0x4a')]=_[_0xe475('0x49')](_0x94d374[_0xe475('0x45')],qs[_0xe475('0x4b')](_0x3e01c8[_0xe475('0x46')][_0xe475('0x4b')]));_0x58654f['attributes']=_0x58654f['attributes'][_0xe475('0x4c')]?_0x58654f[_0xe475('0x4a')]:_0x94d374[_0xe475('0x45')];if(!_0x3e01c8['query'][_0xe475('0x4d')](_0xe475('0x4e'))){_0x58654f[_0xe475('0x2b')]=qs['limit'](_0x3e01c8[_0xe475('0x46')]['limit']);_0x58654f[_0xe475('0x2d')]=qs[_0xe475('0x2d')](_0x3e01c8[_0xe475('0x46')][_0xe475('0x2d')]);}_0x58654f[_0xe475('0x4f')]=qs[_0xe475('0x50')](_0x3e01c8[_0xe475('0x46')][_0xe475('0x50')]);_0x58654f[_0xe475('0x51')]=qs['filters'](_[_0xe475('0x52')](_0x3e01c8[_0xe475('0x46')],_0x94d374['filters']),_0x4920e5);if(_0x3e01c8[_0xe475('0x46')][_0xe475('0x53')]){_0x58654f['where']=_[_0xe475('0x54')](_0x58654f[_0xe475('0x51')],{'$or':_[_0xe475('0x40')](_0x4920e5,function(_0x3fbfa1){if(_0x3fbfa1[_0xe475('0x44')]!==_0xe475('0x55')){var _0x21c942={};_0x21c942[_0x3fbfa1[_0xe475('0x39')]]={'$like':'%'+_0x3e01c8[_0xe475('0x46')][_0xe475('0x53')]+'%'};return _0x21c942;}})});}_0x58654f=_[_0xe475('0x54')]({},_0x58654f,_0x3e01c8[_0xe475('0x56')]);var _0x16d0a8={'where':_0x58654f[_0xe475('0x51')]};return db[_0xe475('0x41')][_0xe475('0x2c')](_0x16d0a8)[_0xe475('0x33')](function(_0x55c6f1){_0x3ff755[_0xe475('0x2c')]=_0x55c6f1;if(_0x3e01c8[_0xe475('0x46')]['includeAll']){_0x58654f[_0xe475('0x57')]=[{'all':!![]}];}return db[_0xe475('0x41')]['findAll'](_0x58654f);})[_0xe475('0x33')](function(_0x4ae8fd){_0x3ff755[_0xe475('0x58')]=_0x4ae8fd;return _0x3ff755;})[_0xe475('0x33')](respondWithFilteredResult(_0x3ad034,_0x58654f))['catch'](handleError(_0x3ad034,null));};exports[_0xe475('0x59')]=function(_0x5bff1e,_0x4f3c07){var _0x209b70={'raw':![],'where':{'id':_0x5bff1e[_0xe475('0x5a')]['id']},'include':[{'model':db[_0xe475('0x5b')],'as':_0xe475('0x5c')},{'model':db[_0xe475('0x3c')],'as':_0xe475('0x3d')},{'model':db['Pause'],'as':_0xe475('0x3f')}]},_0x54a731={};_0x54a731['model']=_[_0xe475('0x47')](db['MailAccount'][_0xe475('0x42')]);_0x54a731[_0xe475('0x46')]=_[_0xe475('0x47')](_0x5bff1e['query']);_0x54a731[_0xe475('0x48')]=_[_0xe475('0x49')](_0x54a731[_0xe475('0x45')],_0x54a731['query']);_0x209b70['attributes']=_[_0xe475('0x49')](_0x54a731[_0xe475('0x45')],qs[_0xe475('0x4b')](_0x5bff1e[_0xe475('0x46')][_0xe475('0x4b')]));_0x209b70['attributes']=_0x209b70[_0xe475('0x4a')][_0xe475('0x4c')]?_0x209b70['attributes']:_0x54a731['model'];if(_0x5bff1e['query'][_0xe475('0x5d')]){_0x209b70[_0xe475('0x57')]=[{'all':!![]}];}_0x209b70=_[_0xe475('0x54')]({},_0x209b70,_0x5bff1e[_0xe475('0x56')]);return db[_0xe475('0x41')][_0xe475('0x5e')](_0x209b70)['then'](handleEntityNotFound(_0x4f3c07,null))[_0xe475('0x33')](respondWithResult(_0x4f3c07,null))['catch'](handleError(_0x4f3c07,null));};exports[_0xe475('0x32')]=function(_0x475891,_0x122e51){if(_0x475891[_0xe475('0x5f')]['id']){delete _0x475891[_0xe475('0x5f')]['id'];}return db[_0xe475('0x41')]['find']({'where':{'id':_0x475891[_0xe475('0x5a')]['id']},'include':[{'model':db[_0xe475('0x5b')],'as':_0xe475('0x5c')},{'model':db['MailServerOut'],'as':_0xe475('0x3d')},{'model':db[_0xe475('0x3e')],'as':'mandatoryDispositionPause'}]})[_0xe475('0x33')](handleEntityNotFound(_0x122e51,null))[_0xe475('0x33')](saveUpdates(_0x475891[_0xe475('0x5f')],null))['then'](function(_0x2dbcec){if(_0x2dbcec&&_0x475891[_0xe475('0x5f')][_0xe475('0x5c')]){return db[_0xe475('0x5b')][_0xe475('0x32')](_0x475891['body'][_0xe475('0x5c')],{'where':{'MailAccountId':_0x2dbcec['id']}})[_0xe475('0x33')](function(){return _0x2dbcec;});}return _0x2dbcec;})[_0xe475('0x33')](function(_0x55e302){if(_0x55e302&&_0x475891[_0xe475('0x5f')][_0xe475('0x3d')]){return db[_0xe475('0x3c')][_0xe475('0x32')](_0x475891['body'][_0xe475('0x3d')],{'where':{'MailAccountId':_0x55e302['id']}})[_0xe475('0x33')](function(){return _0x55e302;});}return _0x55e302;})[_0xe475('0x33')](respondWithResult(_0x122e51,null))[_0xe475('0x60')](handleError(_0x122e51,null));};exports['describe']=function(_0x17ddfd,_0x39a1cd){return db[_0xe475('0x41')][_0xe475('0x61')]()[_0xe475('0x33')](respondWithResult(_0x39a1cd,null))[_0xe475('0x60')](handleError(_0x39a1cd,null));};exports['addDisposition']=function(_0xc76c87,_0x56cf6d,_0x547292){if(_0xc76c87[_0xe475('0x5f')]['id']){delete _0xc76c87[_0xe475('0x5f')]['id'];}return db[_0xe475('0x41')]['find']({'where':{'id':_0xc76c87[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x56cf6d,null))['then'](function(_0x585f6e){if(_0x585f6e){_0xc76c87[_0xe475('0x5f')][_0xe475('0x62')]=_0x585f6e['id'];return db['Disposition']['create'](_0xc76c87[_0xe475('0x5f')]);}})[_0xe475('0x33')](respondWithResult(_0x56cf6d,null))[_0xe475('0x60')](handleError(_0x56cf6d,null));};exports[_0xe475('0x63')]=function(_0x253220,_0xa5aae4,_0xaed725){var _0x5779fa={'raw':![],'where':{}};var _0x23348b={};var _0x84e64c={'count':0x0,'rows':[]};return db[_0xe475('0x41')][_0xe475('0x64')]({'where':{'id':_0x253220[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0xa5aae4,null))['then'](function(_0xe862a9){if(_0xe862a9){_0x23348b[_0xe475('0x45')]=_[_0xe475('0x47')](db[_0xe475('0x65')]['rawAttributes']);_0x23348b['query']=_['keys'](_0x253220[_0xe475('0x46')]);_0x23348b[_0xe475('0x48')]=_[_0xe475('0x49')](_0x23348b[_0xe475('0x45')],_0x23348b['query']);_0x5779fa[_0xe475('0x4a')]=_['intersection'](_0x23348b[_0xe475('0x45')],qs[_0xe475('0x4b')](_0x253220['query'][_0xe475('0x4b')]));_0x5779fa[_0xe475('0x4a')]=_0x5779fa[_0xe475('0x4a')][_0xe475('0x4c')]?_0x5779fa[_0xe475('0x4a')]:_0x23348b['model'];if(!_0x253220[_0xe475('0x46')][_0xe475('0x4d')](_0xe475('0x4e'))){_0x5779fa['limit']=qs[_0xe475('0x2b')](_0x253220[_0xe475('0x46')][_0xe475('0x2b')]);_0x5779fa[_0xe475('0x2d')]=qs[_0xe475('0x2d')](_0x253220[_0xe475('0x46')][_0xe475('0x2d')]);}_0x5779fa[_0xe475('0x4f')]=qs[_0xe475('0x50')](_0x253220[_0xe475('0x46')][_0xe475('0x50')]);_0x5779fa[_0xe475('0x51')]=qs['filters'](_[_0xe475('0x52')](_0x253220[_0xe475('0x46')],_0x23348b[_0xe475('0x48')]));_0x5779fa[_0xe475('0x51')][_0xe475('0x62')]=_0xe862a9['id'];if(_0x253220['query']['filter']){_0x5779fa[_0xe475('0x51')]=_[_0xe475('0x54')](_0x5779fa[_0xe475('0x51')],{'$or':_[_0xe475('0x40')](_0x5779fa[_0xe475('0x4a')],function(_0x2400be){var _0x989641={};_0x989641[_0x2400be]={'$like':'%'+_0x253220[_0xe475('0x46')][_0xe475('0x53')]+'%'};return _0x989641;})});}_0x5779fa=_[_0xe475('0x54')]({},_0x5779fa,_0x253220['options']);return db['Disposition'][_0xe475('0x2c')]({'where':_0x5779fa[_0xe475('0x51')]})[_0xe475('0x33')](function(_0x26c3d2){_0x84e64c['count']=_0x26c3d2;if(_0x253220[_0xe475('0x46')][_0xe475('0x5d')]){_0x5779fa[_0xe475('0x57')]=[{'all':!![]}];}return db[_0xe475('0x65')][_0xe475('0x66')](_0x5779fa);})[_0xe475('0x33')](function(_0x2645b1){_0x84e64c[_0xe475('0x58')]=_0x2645b1;return _0x84e64c;});}})[_0xe475('0x33')](respondWithFilteredResult(_0xa5aae4,_0x5779fa))[_0xe475('0x60')](handleError(_0xa5aae4,null));};exports[_0xe475('0x67')]=function(_0x25d358,_0x21db1b,_0x2f8389){return db[_0xe475('0x41')]['find']({'where':{'id':_0x25d358[_0xe475('0x5a')]['id']}})['then'](handleEntityNotFound(_0x21db1b,null))[_0xe475('0x33')](function(_0xc10266){if(_0xc10266){return _0xc10266[_0xe475('0x67')](_0x25d358[_0xe475('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x21db1b,null))[_0xe475('0x60')](handleError(_0x21db1b,null));};exports['addAnswer']=function(_0x40b4d1,_0x4368e1,_0x38d40e){if(_0x40b4d1[_0xe475('0x5f')]['id']){delete _0x40b4d1[_0xe475('0x5f')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x40b4d1[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x4368e1,null))['then'](function(_0x4f6ded){if(_0x4f6ded){_0x40b4d1['body']['MailAccountId']=_0x4f6ded['id'];return db['CannedAnswer'][_0xe475('0x68')](_0x40b4d1[_0xe475('0x5f')]);}})['then'](respondWithResult(_0x4368e1,null))['catch'](handleError(_0x4368e1,null));};exports[_0xe475('0x69')]=function(_0x3343ad,_0x1ef37d,_0x19b0a6){var _0x36dcd1={'raw':![],'where':{}};var _0x5e2f05={};var _0x4000ab={'count':0x0,'rows':[]};return db[_0xe475('0x41')][_0xe475('0x64')]({'where':{'id':_0x3343ad[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x1ef37d,null))[_0xe475('0x33')](function(_0x248d7b){if(_0x248d7b){_0x5e2f05[_0xe475('0x45')]=_[_0xe475('0x47')](db['CannedAnswer'][_0xe475('0x42')]);_0x5e2f05['query']=_['keys'](_0x3343ad[_0xe475('0x46')]);_0x5e2f05[_0xe475('0x48')]=_['intersection'](_0x5e2f05[_0xe475('0x45')],_0x5e2f05[_0xe475('0x46')]);_0x36dcd1[_0xe475('0x4a')]=_[_0xe475('0x49')](_0x5e2f05[_0xe475('0x45')],qs[_0xe475('0x4b')](_0x3343ad['query'][_0xe475('0x4b')]));_0x36dcd1[_0xe475('0x4a')]=_0x36dcd1[_0xe475('0x4a')][_0xe475('0x4c')]?_0x36dcd1[_0xe475('0x4a')]:_0x5e2f05[_0xe475('0x45')];if(!_0x3343ad['query'][_0xe475('0x4d')]('nolimit')){_0x36dcd1[_0xe475('0x2b')]=qs[_0xe475('0x2b')](_0x3343ad['query'][_0xe475('0x2b')]);_0x36dcd1[_0xe475('0x2d')]=qs['offset'](_0x3343ad['query']['offset']);}_0x36dcd1[_0xe475('0x4f')]=qs[_0xe475('0x50')](_0x3343ad[_0xe475('0x46')][_0xe475('0x50')]);_0x36dcd1[_0xe475('0x51')]=qs[_0xe475('0x48')](_[_0xe475('0x52')](_0x3343ad[_0xe475('0x46')],_0x5e2f05[_0xe475('0x48')]));_0x36dcd1[_0xe475('0x51')][_0xe475('0x62')]=_0x248d7b['id'];if(_0x3343ad[_0xe475('0x46')][_0xe475('0x53')]){_0x36dcd1[_0xe475('0x51')]=_[_0xe475('0x54')](_0x36dcd1['where'],{'$or':_[_0xe475('0x40')](_0x36dcd1[_0xe475('0x4a')],function(_0x23ba24){var _0x35735f={};_0x35735f[_0x23ba24]={'$like':'%'+_0x3343ad[_0xe475('0x46')][_0xe475('0x53')]+'%'};return _0x35735f;})});}_0x36dcd1=_[_0xe475('0x54')]({},_0x36dcd1,_0x3343ad['options']);return db[_0xe475('0x6a')][_0xe475('0x2c')]({'where':_0x36dcd1[_0xe475('0x51')]})[_0xe475('0x33')](function(_0x39d0fe){_0x4000ab[_0xe475('0x2c')]=_0x39d0fe;if(_0x3343ad['query']['includeAll']){_0x36dcd1[_0xe475('0x57')]=[{'all':!![]}];}return db[_0xe475('0x6a')]['findAll'](_0x36dcd1);})[_0xe475('0x33')](function(_0x1f2ae6){_0x4000ab['rows']=_0x1f2ae6;return _0x4000ab;});}})[_0xe475('0x33')](respondWithFilteredResult(_0x1ef37d,_0x36dcd1))[_0xe475('0x60')](handleError(_0x1ef37d,null));};exports[_0xe475('0x6b')]=function(_0x15b5b1,_0x325ad8,_0x58791d){return db[_0xe475('0x41')][_0xe475('0x5e')]({'where':{'id':_0x15b5b1[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x325ad8,null))['then'](function(_0x91c8a5){if(_0x91c8a5){return _0x91c8a5[_0xe475('0x6b')](_0x15b5b1['query'][_0xe475('0x6c')]);}})[_0xe475('0x33')](respondWithStatusCode(_0x325ad8,null))['catch'](handleError(_0x325ad8,null));};exports[_0xe475('0x68')]=function(_0x3acc93,_0x96b6df){var _0x5d81f0={'name':_0x3acc93[_0xe475('0x5f')][_0xe475('0x39')],'key':_0x3acc93['body'][_0xe475('0x6d')],'email':_0x3acc93['body'][_0xe475('0x6e')],'ListId':_0x3acc93[_0xe475('0x5f')][_0xe475('0x6f')],'active':!_[_0xe475('0x70')](_0x3acc93['body']['active'])?_0x3acc93[_0xe475('0x5f')][_0xe475('0x71')]:!![],'description':_0x3acc93[_0xe475('0x5f')][_0xe475('0x72')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x3acc93[_0xe475('0x5f')][_0xe475('0x73')])){if(_0x3acc93['body']['cauthentication']){_0x5d81f0[_0xe475('0x5c')][_0xe475('0x74')]=_0x5d81f0[_0xe475('0x3d')][_0xe475('0x74')]=_0x3acc93['body']['cuser'];_0x5d81f0['Imap'][_0xe475('0x75')]=_0x5d81f0[_0xe475('0x3d')][_0xe475('0x76')]=_0x3acc93[_0xe475('0x5f')]['cpassword'];}else{_0x5d81f0[_0xe475('0x5c')]['authentication']=_0x5d81f0[_0xe475('0x3d')][_0xe475('0x77')]=![];}_0x5d81f0[_0xe475('0x5c')][_0xe475('0x78')]=_0x3acc93[_0xe475('0x5f')][_0xe475('0x5c')]['host'];_0x5d81f0[_0xe475('0x5c')]['port']=_0x3acc93[_0xe475('0x5f')][_0xe475('0x5c')][_0xe475('0x79')];_0x5d81f0[_0xe475('0x3d')][_0xe475('0x78')]=_0x3acc93['body'][_0xe475('0x3d')][_0xe475('0x78')];_0x5d81f0['Smtp'][_0xe475('0x79')]=_0x3acc93[_0xe475('0x5f')][_0xe475('0x3d')]['port'];}else{_0x5d81f0[_0xe475('0x5c')][_0xe475('0x7a')]=_0x5d81f0[_0xe475('0x3d')][_0xe475('0x7a')]=_0x3acc93[_0xe475('0x5f')][_0xe475('0x73')];_0x5d81f0[_0xe475('0x5c')][_0xe475('0x74')]=_0x5d81f0['Smtp'][_0xe475('0x74')]=_0x3acc93[_0xe475('0x5f')]['cuser'];_0x5d81f0['Imap'][_0xe475('0x75')]=_0x5d81f0['Smtp']['pass']=_0x3acc93[_0xe475('0x5f')][_0xe475('0x7b')];}return db[_0xe475('0x41')][_0xe475('0x68')](_0x5d81f0,{'include':[{'model':db[_0xe475('0x3c')],'as':'Smtp'},{'model':db[_0xe475('0x5b')],'as':_0xe475('0x5c')}]})[_0xe475('0x33')](function(_0x2fa2a6){var _0x4d0e45=_0x3acc93[_0xe475('0x74')][_0xe475('0x7c')]({'plain':!![]});if(!_0x4d0e45)throw new Error(_0xe475('0x7d'));if(_0x4d0e45[_0xe475('0x7e')]===_0xe475('0x74')){var _0x30350d=_0x2fa2a6['get']({'plain':!![]});return db[_0xe475('0x7f')]['find']({'where':{'name':_0xe475('0x35'),'userProfileId':_0x4d0e45[_0xe475('0x80')]},'raw':!![]})[_0xe475('0x33')](function(_0x5bae78){if(_0x5bae78&&_0x5bae78[_0xe475('0x81')]===0x0){return db[_0xe475('0x36')]['create']({'name':_0x30350d[_0xe475('0x39')],'resourceId':_0x30350d['id'],'type':_0x5bae78[_0xe475('0x39')],'sectionId':_0x5bae78['id']},{})['then'](function(){return _0x2fa2a6;});}else{return _0x2fa2a6;}})[_0xe475('0x60')](function(_0xd6a6c9){logger['error'](_0xe475('0x82'),_0xd6a6c9);throw _0xd6a6c9;});}return _0x2fa2a6;})[_0xe475('0x33')](respondWithResult(_0x96b6df,0xc9))[_0xe475('0x60')](handleError(_0x96b6df,null));};exports[_0xe475('0x83')]=function(_0x26e729,_0xea7288,_0x5bb5c9){return db[_0xe475('0x41')]['findOne']({'where':{'id':_0x26e729[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0xea7288,null))[_0xe475('0x33')](function(_0x591bcb){if(_0x591bcb){return _0x591bcb[_0xe475('0x83')]();}return null;})[_0xe475('0x33')](respondWithResult(_0xea7288,null))[_0xe475('0x60')](handleError(_0xea7288,null));};exports[_0xe475('0x84')]=function(_0x1ca0fd,_0x8995cd,_0x215120){if(_0x1ca0fd[_0xe475('0x5f')]['id']){delete _0x1ca0fd['body']['id'];}return db[_0xe475('0x41')]['find']({'where':{'id':_0x1ca0fd[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x8995cd,null))[_0xe475('0x33')](function(_0xaa92a){if(_0xaa92a){_0x1ca0fd[_0xe475('0x5f')][_0xe475('0x62')]=_0xaa92a['id'];return db[_0xe475('0x5b')]['create'](_0x1ca0fd[_0xe475('0x5f')]);}})[_0xe475('0x33')](respondWithResult(_0x8995cd,null))[_0xe475('0x60')](handleError(_0x8995cd,null));};exports[_0xe475('0x85')]=function(_0x4d0dc5,_0x3b4eae,_0x2d6a6b){return db['MailAccount'][_0xe475('0x64')]({'where':{'id':_0x4d0dc5[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x3b4eae,null))['then'](function(_0x3b629a){if(_0x3b629a){return _0x3b629a[_0xe475('0x86')](null);}return null;})[_0xe475('0x33')](respondWithStatusCode(_0x3b4eae,null))[_0xe475('0x60')](handleError(_0x3b4eae,null));};exports[_0xe475('0x87')]=function(_0x7522d3,_0x5a10b4,_0x512fb0){return db['MailAccount']['findOne']({'where':{'id':_0x7522d3[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x5a10b4,null))[_0xe475('0x33')](function(_0x55b67e){if(_0x55b67e){return _0x55b67e[_0xe475('0x87')]();}return null;})[_0xe475('0x33')](respondWithResult(_0x5a10b4,null))[_0xe475('0x60')](handleError(_0x5a10b4,null));};exports[_0xe475('0x88')]=function(_0x3c85a1,_0x214c1e,_0x56447d){if(_0x3c85a1[_0xe475('0x5f')]['id']){delete _0x3c85a1['body']['id'];}return db[_0xe475('0x41')]['find']({'where':{'id':_0x3c85a1[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x214c1e,null))[_0xe475('0x33')](function(_0x5a0e57){if(_0x5a0e57){_0x3c85a1['body']['MailAccountId']=_0x5a0e57['id'];return db[_0xe475('0x3c')]['create'](_0x3c85a1[_0xe475('0x5f')]);}})[_0xe475('0x33')](respondWithResult(_0x214c1e,null))[_0xe475('0x60')](handleError(_0x214c1e,null));};exports['removeSmtp']=function(_0x4dfddd,_0x11afad,_0x3028d3){return db[_0xe475('0x41')][_0xe475('0x64')]({'where':{'id':_0x4dfddd[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x11afad,null))[_0xe475('0x33')](function(_0x1d9e04){if(_0x1d9e04){return _0x1d9e04[_0xe475('0x89')](null);}return null;})[_0xe475('0x33')](respondWithStatusCode(_0x11afad,null))[_0xe475('0x60')](handleError(_0x11afad,null));};exports[_0xe475('0x8a')]=function(_0x45f12b,_0x56ed3d,_0x1e98d6){return db[_0xe475('0x8b')][_0xe475('0x5e')]({'where':{'id':_0x45f12b[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x56ed3d,null))[_0xe475('0x33')](function(_0x429608){if(_0x429608){return _0x429608[_0xe475('0x8a')](_0x45f12b[_0xe475('0x5f')][_0xe475('0x6c')],_['omit'](_0x45f12b[_0xe475('0x5f')],['ids','id'])||{});}})[_0xe475('0x33')](respondWithResult(_0x56ed3d,null))[_0xe475('0x60')](handleError(_0x56ed3d,null));};exports[_0xe475('0x8c')]=function(_0x44ec1e,_0x4c1670,_0xff1901){var _0x1bd0f5={'raw':![],'where':{}};var _0x15b25d={};var _0x703db={'count':0x0,'rows':[]};return db[_0xe475('0x41')][_0xe475('0x64')]({'where':{'id':_0x44ec1e[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x4c1670,null))[_0xe475('0x33')](function(_0x4a3567){if(_0x4a3567){_0x15b25d[_0xe475('0x45')]=_['keys'](db[_0xe475('0x8b')]['rawAttributes']);_0x15b25d[_0xe475('0x46')]=_[_0xe475('0x47')](_0x44ec1e[_0xe475('0x46')]);_0x15b25d[_0xe475('0x48')]=_[_0xe475('0x49')](_0x15b25d[_0xe475('0x45')],_0x15b25d[_0xe475('0x46')]);_0x1bd0f5['attributes']=_[_0xe475('0x49')](_0x15b25d[_0xe475('0x45')],qs[_0xe475('0x4b')](_0x44ec1e[_0xe475('0x46')][_0xe475('0x4b')]));_0x1bd0f5[_0xe475('0x4a')]=_0x1bd0f5[_0xe475('0x4a')]['length']?_0x1bd0f5[_0xe475('0x4a')]:_0x15b25d[_0xe475('0x45')];if(!_0x44ec1e[_0xe475('0x46')][_0xe475('0x4d')]('nolimit')){_0x1bd0f5['limit']=qs[_0xe475('0x2b')](_0x44ec1e[_0xe475('0x46')][_0xe475('0x2b')]);_0x1bd0f5[_0xe475('0x2d')]=qs[_0xe475('0x2d')](_0x44ec1e['query'][_0xe475('0x2d')]);}_0x1bd0f5[_0xe475('0x4f')]=qs['sort'](_0x44ec1e[_0xe475('0x46')]['sort']);_0x1bd0f5[_0xe475('0x51')]=qs[_0xe475('0x48')](_['pick'](_0x44ec1e[_0xe475('0x46')],_0x15b25d[_0xe475('0x48')]));_0x1bd0f5['where'][_0xe475('0x62')]=_0x4a3567['id'];if(_0x44ec1e[_0xe475('0x46')]['filter']){_0x1bd0f5[_0xe475('0x51')]=_[_0xe475('0x54')](_0x1bd0f5[_0xe475('0x51')],{'$or':_['map'](_0x1bd0f5[_0xe475('0x4a')],function(_0x40ff2f){var _0x3740b7={};_0x3740b7[_0x40ff2f]={'$like':'%'+_0x44ec1e['query'][_0xe475('0x53')]+'%'};return _0x3740b7;})});}_0x1bd0f5=_[_0xe475('0x54')]({},_0x1bd0f5,_0x44ec1e[_0xe475('0x56')]);return db[_0xe475('0x8b')][_0xe475('0x2c')]({'where':_0x1bd0f5[_0xe475('0x51')]})[_0xe475('0x33')](function(_0x4826cb){_0x703db[_0xe475('0x2c')]=_0x4826cb;if(_0x44ec1e[_0xe475('0x46')][_0xe475('0x5d')]){_0x1bd0f5[_0xe475('0x57')]=[{'model':db['CmContact'],'as':_0xe475('0x8d'),'required':![]},{'model':db[_0xe475('0x8e')],'as':_0xe475('0x8f'),'attributes':['name',_0xe475('0x90'),_0xe475('0x91')],'required':![]},{'model':db[_0xe475('0x92')],'as':'Tags','attributes':['id',_0xe475('0x39'),_0xe475('0x93')],'where':_0x44ec1e[_0xe475('0x46')][_0xe475('0x94')]?{'id':_0x44ec1e[_0xe475('0x46')][_0xe475('0x94')]}:undefined,'required':_0x44ec1e[_0xe475('0x46')]['tag']?!![]:![]}];}return db[_0xe475('0x8b')][_0xe475('0x66')](_0x1bd0f5);})['then'](function(_0x293a89){_0x703db[_0xe475('0x58')]=_0x293a89;return _0x703db;});}})['then'](respondWithFilteredResult(_0x4c1670,_0x1bd0f5))['catch'](handleError(_0x4c1670,null));};exports[_0xe475('0x95')]=function(_0x31619e,_0x18fd79,_0xffa069){return db['MailAccount'][_0xe475('0x64')]({'where':{'id':_0x31619e['params']['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x18fd79,null))[_0xe475('0x33')](function(_0x4fe39e){if(_0x4fe39e){return db[_0xe475('0x96')]['transaction'](function(_0x5851d6){return db[_0xe475('0x97')][_0xe475('0x34')]({'where':{'MailAccountId':_0x31619e[_0xe475('0x5a')]['id']},'transaction':_0x5851d6})[_0xe475('0x33')](function(_0x33f6fe){var _0x11bf4a=_[_0xe475('0x40')](_0x31619e[_0xe475('0x5f')],function(_0x344c1f){_0x344c1f[_0xe475('0x62')]=_0x31619e['params']['id'];return _0x344c1f;});return db[_0xe475('0x97')][_0xe475('0x98')](_0x11bf4a,{'transaction':_0x5851d6});});})[_0xe475('0x33')](function(){return db['MailApplication'][_0xe475('0x99')]({'where':{'MailAccountId':_0x31619e[_0xe475('0x5a')]['id']},'order':_0xe475('0x9a')});});}})[_0xe475('0x33')](respondWithResult(_0x18fd79,null))[_0xe475('0x60')](handleError(_0x18fd79,null));};exports['getApplications']=function(_0xb2f1f0,_0x1521cf,_0x2530b2){var _0x189777={};var _0x2d0ea7={};var _0x4bc793;var _0x381e0c;return db[_0xe475('0x41')][_0xe475('0x64')]({'where':{'id':_0xb2f1f0['params']['id']}})['then'](handleEntityNotFound(_0x1521cf,null))[_0xe475('0x33')](function(_0x441292){if(_0x441292){_0x4bc793=_0x441292;_0x2d0ea7['model']=_[_0xe475('0x47')](db['MailApplication'][_0xe475('0x42')]);_0x2d0ea7['query']=_[_0xe475('0x47')](_0xb2f1f0[_0xe475('0x46')]);_0x2d0ea7[_0xe475('0x48')]=_[_0xe475('0x49')](_0x2d0ea7[_0xe475('0x45')],_0x2d0ea7['query']);_0x189777['attributes']=_[_0xe475('0x49')](_0x2d0ea7['model'],qs[_0xe475('0x4b')](_0xb2f1f0[_0xe475('0x46')][_0xe475('0x4b')]));_0x189777[_0xe475('0x4a')]=_0x189777[_0xe475('0x4a')]['length']?_0x189777[_0xe475('0x4a')]:_0x2d0ea7['model'];_0x189777[_0xe475('0x4f')]=qs[_0xe475('0x50')](_0xb2f1f0[_0xe475('0x46')][_0xe475('0x50')]);_0x189777[_0xe475('0x51')]=qs[_0xe475('0x48')](_[_0xe475('0x52')](_0xb2f1f0[_0xe475('0x46')],_0x2d0ea7[_0xe475('0x48')]));if(_0xb2f1f0['query'][_0xe475('0x53')]){_0x189777[_0xe475('0x51')]=_[_0xe475('0x54')](_0x189777['where'],{'$or':_[_0xe475('0x40')](_0x189777[_0xe475('0x4a')],function(_0x19bbb7){var _0x58ce41={};_0x58ce41[_0x19bbb7]={'$like':'%'+_0xb2f1f0['query']['filter']+'%'};return _0x58ce41;})});}_0x189777=_[_0xe475('0x54')]({},_0x189777,_0xb2f1f0[_0xe475('0x56')]);return _0x4bc793[_0xe475('0x9b')](_0x189777);}})['then'](function(_0x429892){if(_0x429892){_0x381e0c=_0x429892[_0xe475('0x4c')];if(!_0xb2f1f0[_0xe475('0x46')]['hasOwnProperty']('nolimit')){_0x189777[_0xe475('0x2b')]=qs[_0xe475('0x2b')](_0xb2f1f0[_0xe475('0x46')]['limit']);_0x189777['offset']=qs['offset'](_0xb2f1f0[_0xe475('0x46')][_0xe475('0x2d')]);}return _0x4bc793[_0xe475('0x9b')](_0x189777);}})[_0xe475('0x33')](function(_0x4b51a2){if(_0x4b51a2){return _0x4b51a2?{'count':_0x381e0c,'rows':_0x4b51a2}:null;}})[_0xe475('0x33')](respondWithResult(_0x1521cf,null))[_0xe475('0x60')](handleError(_0x1521cf,null));};exports[_0xe475('0x9c')]=function(_0x2c7486,_0x560ba4,_0x2e2afd){var _0x54bfaf={'raw':!![],'where':{}};var _0x7767e6={};var _0x51f02e={'count':0x0,'rows':[]};return db['MailAccount'][_0xe475('0x64')]({'where':{'id':_0x2c7486['params']['id']}})['then'](handleEntityNotFound(_0x560ba4,null))[_0xe475('0x33')](function(_0x3dd7da){if(_0x3dd7da){_0x7767e6[_0xe475('0x45')]=_[_0xe475('0x47')](db[_0xe475('0x9d')][_0xe475('0x42')]);_0x7767e6[_0xe475('0x46')]=_['keys'](_0x2c7486[_0xe475('0x46')]);_0x7767e6['filters']=_['intersection'](_0x7767e6['model'],_0x7767e6[_0xe475('0x46')]);_0x54bfaf['attributes']=_[_0xe475('0x49')](_0x7767e6['model'],qs[_0xe475('0x4b')](_0x2c7486[_0xe475('0x46')][_0xe475('0x4b')]));_0x54bfaf[_0xe475('0x4a')]=_0x54bfaf[_0xe475('0x4a')]['length']?_0x54bfaf[_0xe475('0x4a')]:_0x7767e6[_0xe475('0x45')];if(!_0x2c7486[_0xe475('0x46')][_0xe475('0x4d')]('nolimit')){_0x54bfaf[_0xe475('0x2b')]=qs[_0xe475('0x2b')](_0x2c7486[_0xe475('0x46')][_0xe475('0x2b')]);_0x54bfaf[_0xe475('0x2d')]=qs[_0xe475('0x2d')](_0x2c7486[_0xe475('0x46')][_0xe475('0x2d')]);}_0x54bfaf[_0xe475('0x4f')]=qs[_0xe475('0x50')](_0x2c7486['query'][_0xe475('0x50')]);_0x54bfaf[_0xe475('0x51')]=qs[_0xe475('0x48')](_[_0xe475('0x52')](_0x2c7486[_0xe475('0x46')],_0x7767e6[_0xe475('0x48')]));_0x54bfaf[_0xe475('0x51')][_0xe475('0x62')]=_0x3dd7da['id'];if(_0x2c7486[_0xe475('0x46')][_0xe475('0x53')]){_0x54bfaf[_0xe475('0x51')]=_[_0xe475('0x54')](_0x54bfaf[_0xe475('0x51')],{'$or':_[_0xe475('0x40')](_0x54bfaf[_0xe475('0x4a')],function(_0x8554ba){var _0x378b72={};_0x378b72[_0x8554ba]={'$like':'%'+_0x2c7486[_0xe475('0x46')]['filter']+'%'};return _0x378b72;})});}if(_0x2c7486[_0xe475('0x46')][_0xe475('0x9e')]){var _0xee087d=_0x2c7486[_0xe475('0x46')][_0xe475('0x9e')][_0xe475('0x9f')](',');var _0x4256c1={};_0x4256c1[_0xee087d[0x0]]={'$gte':moment(_0xee087d[0x1])[_0xe475('0xa0')](_0xe475('0xa1'))};_0x54bfaf[_0xe475('0x51')]=_['merge'](_0x54bfaf['where'],_0x4256c1);}_0x54bfaf=_[_0xe475('0x54')]({},_0x54bfaf,_0x2c7486[_0xe475('0x56')]);return db[_0xe475('0x9d')][_0xe475('0x2c')]({'where':_0x54bfaf['where']})[_0xe475('0x33')](function(_0x270521){_0x51f02e[_0xe475('0x2c')]=_0x270521;if(_0x2c7486[_0xe475('0x46')]['includeAll']){_0x54bfaf[_0xe475('0x57')]=[{'all':!![]}];}return db['MailMessage'][_0xe475('0x66')](_0x54bfaf);})[_0xe475('0x33')](function(_0x171d4d){if(_0x2c7486[_0xe475('0x46')][_0xe475('0xa2')]===_0xe475('0xa3')){for(var _0x482ead=0x0;_0x482ead<_0x171d4d[_0xe475('0x4c')];_0x482ead++){_0x171d4d[_0x482ead][_0xe475('0x5f')]=juice(_0x171d4d[_0x482ead][_0xe475('0x5f')]);}}_0x51f02e[_0xe475('0x58')]=_0x171d4d;return _0x51f02e;});}})['then'](respondWithFilteredResult(_0x560ba4,_0x54bfaf))['catch'](handleError(_0x560ba4,null));};exports['send']=function(_0x2aff3b,_0x46b646,_0xbdbd86){var _0x3079cd,_0x5c879d={},_0x24011b;if(_0x2aff3b['body']['to']){_0x24011b=_0x2aff3b['body']['to'][_0xe475('0x9f')](',')[0x0];}return db[_0xe475('0x41')][_0xe475('0x5e')]({'where':{'id':_0x2aff3b[_0xe475('0x5a')]['id']},'include':[{'model':db[_0xe475('0xa4')],'as':'List','include':[{'model':db['CmContact'],'as':_0xe475('0xa5'),'where':{'email':_0x24011b},'limit':0x1,'order':[[_0xe475('0xa6'),_0xe475('0xa7')]]}]},{'model':db['MailServerOut'],'as':_0xe475('0x3d'),'raw':!![]}]})[_0xe475('0x33')](handleEntityNotFound(_0x46b646,null))[_0xe475('0x33')](function(_0x17927b){if(_0x17927b){_0x3079cd=_0x17927b;if(_0x17927b['Smtp']){if(_[_0xe475('0x70')](_0x2aff3b[_0xe475('0x5f')][_0xe475('0xa8')])){_0x2aff3b['body'][_0xe475('0xa8')]=util['format'](_0xe475('0xa9'),_0x17927b[_0xe475('0x39')],_0x17927b[_0xe475('0x6e')]||_0x17927b[_0xe475('0x3d')][_0xe475('0x74')]);}if(_0x2aff3b[_0xe475('0x5f')][_0xe475('0xaa')]&&_0x2aff3b['body'][_0xe475('0xaa')]['length']){for(var _0x4e4be1=0x0;_0x4e4be1<_0x2aff3b[_0xe475('0x5f')][_0xe475('0xaa')][_0xe475('0x4c')];_0x4e4be1+=0x1){_0x2aff3b[_0xe475('0x5f')][_0xe475('0xaa')][_0x4e4be1]={'filename':_0x2aff3b[_0xe475('0x5f')][_0xe475('0xaa')][_0x4e4be1][_0xe475('0x39')],'path':path[_0xe475('0xab')](config[_0xe475('0xac')],'server/files/attachments',_0x2aff3b[_0xe475('0x5f')][_0xe475('0xaa')][_0x4e4be1][_0xe475('0xad')])};}}var _0x5ac483={'tls':{'rejectUnauthorized':![]}};if(_[_0xe475('0x70')](_0x17927b[_0xe475('0x3d')][_0xe475('0x7a')])){if(_0x17927b['Smtp'][_0xe475('0x77')]){_0x5ac483[_0xe475('0xae')]={'user':_0x17927b[_0xe475('0x3d')]['user'],'pass':_0x17927b[_0xe475('0x3d')][_0xe475('0x76')]};}_0x5ac483[_0xe475('0x78')]=_0x17927b[_0xe475('0x3d')][_0xe475('0x78')];_0x5ac483[_0xe475('0x79')]=_0x17927b[_0xe475('0x3d')]['port'];_0x5ac483[_0xe475('0xaf')]=_0x17927b[_0xe475('0x3d')][_0xe475('0xaf')];}else{_0x5ac483[_0xe475('0x7a')]=_0x17927b[_0xe475('0x3d')]['service'];_0x5ac483[_0xe475('0xae')]={'user':_0x17927b[_0xe475('0x3d')][_0xe475('0x74')],'pass':_0x17927b[_0xe475('0x3d')][_0xe475('0x76')]};}return respondWithRpcPromise('SendMail',_0xe475('0xb0'),{'account':_0x5ac483,'message':_0x2aff3b[_0xe475('0x5f')]});}else{throw new Error(_0xe475('0xb1'));}}})[_0xe475('0x33')](function(_0x539c2a){if(_0x539c2a){_0x5c879d=_0x539c2a;if(_0x3079cd[_0xe475('0xb2')]){if(_0x3079cd[_0xe475('0xb2')][_0xe475('0xa5')][_0xe475('0x4c')]){return _0x3079cd[_0xe475('0xb2')][_0xe475('0xa5')][0x0];}else{return db[_0xe475('0xb3')][_0xe475('0x68')](_['defaults'](_0x2aff3b[_0xe475('0x5f')],{'firstName':_0x2aff3b[_0xe475('0x5f')]['to'],'email':_0x2aff3b[_0xe475('0x5f')]['to'],'phone':_0x2aff3b[_0xe475('0x5f')]['to'],'ListId':_0x3079cd[_0xe475('0x6f')]}));}}else{throw new Error(_0xe475('0xb1'));}}})['then'](function(_0x4b0d64){if(_0x4b0d64){var _0x19e356={'UserId':_0x2aff3b[_0xe475('0x74')]['id'],'ContactId':_0x4b0d64['id'],'MailAccountId':_0x3079cd['id'],'inReplyTo':_0x5c879d['messageId'],'to':_0x2aff3b[_0xe475('0x5f')]['from'],'cc':_0x2aff3b[_0xe475('0x5f')]['cc'],'subject':_0x2aff3b[_0xe475('0x5f')][_0xe475('0xb4')],'attach':_0x2aff3b['body'][_0xe475('0xb5')],'firstMsgDirection':_0xe475('0xb6'),'lastMsgAt':moment()[_0xe475('0xa0')](_0xe475('0xa1')),'lastMsgDirection':'out','Messages':[_[_0xe475('0x54')](_0x2aff3b[_0xe475('0x5f')],{'messageId':_0x5c879d[_0xe475('0xb7')],'sentAt':moment()[_0xe475('0xa0')](_0xe475('0xa1')),'read':!![],'MailAccountId':_0x3079cd['id'],'UserId':_0x2aff3b[_0xe475('0x74')]['id'],'ContactId':_0x4b0d64['id']})]};if(_0x2aff3b[_0xe475('0x5f')][_0xe475('0xb8')]){_0x19e356=_[_0xe475('0x54')](_0x19e356,_0x2aff3b['body'][_0xe475('0xb8')]);}return db[_0xe475('0x8b')][_0xe475('0x68')](_0x19e356,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})['then'](respondWithResult(_0x46b646,null))['catch'](handleError(_0x46b646,null));};exports[_0xe475('0xb9')]=function(_0x355103,_0x1bc411,_0x352d93){return db[_0xe475('0x41')][_0xe475('0x5e')]({'where':{'id':_0x355103[_0xe475('0x5a')]['id']},'include':[{'model':db[_0xe475('0x3c')],'as':_0xe475('0x3d'),'raw':!![]}]})['then'](handleEntityNotFound(_0x1bc411,null))[_0xe475('0x33')](function(_0x31a881){if(_0x31a881&&_0x31a881['Smtp']){var _0x1991d8={'id':_0x31a881['id'],'tls':{'rejectUnauthorized':![]}};if(_0x31a881['Smtp'][_0xe475('0x7a')]){_0x1991d8[_0xe475('0x7a')]=_0x31a881[_0xe475('0x3d')][_0xe475('0x7a')];}else{_0x1991d8['host']=_0x31a881[_0xe475('0x3d')][_0xe475('0x78')];_0x1991d8[_0xe475('0x79')]=_0x31a881['Smtp'][_0xe475('0x79')];_0x1991d8['secure']=_0x31a881['Smtp'][_0xe475('0xaf')];}if(_0x31a881[_0xe475('0x3d')][_0xe475('0x77')]){_0x1991d8[_0xe475('0xae')]={'user':_0x31a881['Smtp'][_0xe475('0x74')],'pass':_0x31a881[_0xe475('0x3d')]['pass']};}return respondWithRpcPromise(_0xe475('0xba'),_0xe475('0xb9'),{'account':_0x1991d8});}})['then'](respondWithResult(_0x1bc411,null))[_0xe475('0x60')](handleError(_0x1bc411,null));};exports[_0xe475('0x34')]=function(_0x586f15,_0x14c817){return db[_0xe475('0x41')]['find']({'where':{'id':_0x586f15[_0xe475('0x5a')]['id']}})['then'](handleEntityNotFound(_0x14c817,null))[_0xe475('0x33')](function(_0x2ecdb9){if(_0x2ecdb9&&_0x2ecdb9[_0xe475('0x7a')]){throw new db[(_0xe475('0xbb'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x2ecdb9;})[_0xe475('0x33')](removeEntity(_0x14c817,null))[_0xe475('0x60')](handleError(_0x14c817,null));};exports[_0xe475('0xbc')]=function(_0x6982e8,_0x457d44,_0x35a48d){return db[_0xe475('0x41')][_0xe475('0x5e')]({'where':{'id':_0x6982e8[_0xe475('0x5a')]['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x457d44,null))[_0xe475('0x33')](function(_0x1e37bc){if(_0x1e37bc){return _0x1e37bc['addAgents'](_0x6982e8[_0xe475('0x5f')][_0xe475('0x6c')],_[_0xe475('0xbd')](_0x6982e8[_0xe475('0x5f')],[_0xe475('0x6c'),'id'])||{})[_0xe475('0xbe')](function(_0x3f146b){for(var _0x367193=0x0;_0x367193<_0x6982e8[_0xe475('0x5f')][_0xe475('0x6c')]['length'];_0x367193+=0x1){socket[_0xe475('0xbf')]('userMailAccount:save',{'UserId':Number(_0x6982e8[_0xe475('0x5f')][_0xe475('0x6c')][_0x367193]),'MailAccountId':Number(_0x6982e8[_0xe475('0x5a')]['id'])});}return _0x3f146b;});}})[_0xe475('0x33')](respondWithResult(_0x457d44,null))[_0xe475('0x60')](handleError(_0x457d44,null));};exports[_0xe475('0xc0')]=function(_0x2cff7e,_0x34de00,_0x2fbc60){return db['MailAccount'][_0xe475('0x5e')]({'where':{'id':_0x2cff7e['params']['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x34de00,null))['then'](function(_0x46c88f){if(_0x46c88f){return _0x46c88f['removeAgents'](_0x2cff7e[_0xe475('0x46')][_0xe475('0x6c')])['then'](function(){if(_[_0xe475('0xc1')](_0x2cff7e['query'][_0xe475('0x6c')])){for(var _0x3846cf=0x0;_0x3846cf<_0x2cff7e['query'][_0xe475('0x6c')][_0xe475('0x4c')];_0x3846cf+=0x1){socket[_0xe475('0xbf')](_0xe475('0xc2'),{'UserId':Number(_0x2cff7e[_0xe475('0x46')][_0xe475('0x6c')][_0x3846cf]),'MailAccountId':Number(_0x2cff7e[_0xe475('0x5a')]['id'])});}}else{socket[_0xe475('0xbf')](_0xe475('0xc2'),{'UserId':Number(_0x2cff7e[_0xe475('0x46')][_0xe475('0x6c')]),'MailAccountId':Number(_0x2cff7e['params']['id'])});}});}})[_0xe475('0x33')](respondWithStatusCode(_0x34de00,null))['catch'](handleError(_0x34de00,null));};exports[_0xe475('0xc3')]=function(_0x41a72a,_0x2d3e5a,_0x527594){var _0x3c0f61={};var _0x3137e7={};var _0x192470;var _0x4a395a;return db[_0xe475('0x41')]['findOne']({'where':{'id':_0x41a72a['params']['id']}})[_0xe475('0x33')](handleEntityNotFound(_0x2d3e5a,null))[_0xe475('0x33')](function(_0x2daab0){if(_0x2daab0){_0x192470=_0x2daab0;_0x3137e7[_0xe475('0x45')]=_['keys'](db[_0xe475('0x8e')][_0xe475('0x42')]);_0x3137e7[_0xe475('0x46')]=_[_0xe475('0x47')](_0x41a72a[_0xe475('0x46')]);_0x3137e7[_0xe475('0x48')]=_[_0xe475('0x49')](_0x3137e7[_0xe475('0x45')],_0x3137e7[_0xe475('0x46')]);_0x3c0f61['attributes']=_[_0xe475('0x49')](_0x3137e7[_0xe475('0x45')],qs[_0xe475('0x4b')](_0x41a72a[_0xe475('0x46')][_0xe475('0x4b')]));_0x3c0f61['attributes']=_0x3c0f61[_0xe475('0x4a')][_0xe475('0x4c')]?_0x3c0f61['attributes']:_0x3137e7[_0xe475('0x45')];_0x3c0f61[_0xe475('0x4f')]=qs[_0xe475('0x50')](_0x41a72a[_0xe475('0x46')]['sort']);_0x3c0f61[_0xe475('0x51')]=qs[_0xe475('0x48')](_[_0xe475('0x52')](_0x41a72a[_0xe475('0x46')],_0x3137e7[_0xe475('0x48')]));if(_0x41a72a[_0xe475('0x46')]['filter']){_0x3c0f61['where']=_[_0xe475('0x54')](_0x3c0f61['where'],{'$or':_[_0xe475('0x40')](_0x3c0f61[_0xe475('0x4a')],function(_0x53e763){var _0x155f57={};_0x155f57[_0x53e763]={'$like':'%'+_0x41a72a[_0xe475('0x46')][_0xe475('0x53')]+'%'};return _0x155f57;})});}_0x3c0f61=_[_0xe475('0x54')]({},_0x3c0f61,_0x41a72a[_0xe475('0x56')]);return _0x192470[_0xe475('0xc3')](_0x3c0f61);}})[_0xe475('0x33')](function(_0x4b59c3){if(_0x4b59c3){_0x4a395a=_0x4b59c3[_0xe475('0x4c')];if(!_0x41a72a[_0xe475('0x46')][_0xe475('0x4d')]('nolimit')){_0x3c0f61[_0xe475('0x2b')]=qs[_0xe475('0x2b')](_0x41a72a[_0xe475('0x46')][_0xe475('0x2b')]);_0x3c0f61[_0xe475('0x2d')]=qs['offset'](_0x41a72a[_0xe475('0x46')]['offset']);}return _0x192470[_0xe475('0xc3')](_0x3c0f61);}})['then'](function(_0x4a18e7){if(_0x4a18e7){return _0x4a18e7?{'count':_0x4a395a,'rows':_0x4a18e7}:null;}})[_0xe475('0x33')](respondWithResult(_0x2d3e5a,null))[_0xe475('0x60')](handleError(_0x2d3e5a,null));};
\ No newline at end of file
index 527b37f..c1e02e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd634=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailAccount','update','remove'];(function(_0xd6314a,_0x683bf1){var _0xc76b30=function(_0x1149b4){while(--_0x1149b4){_0xd6314a['push'](_0xd6314a['shift']());}};_0xc76b30(++_0x683bf1);}(_0xd634,0xf4));var _0x4d63=function(_0x687ddc,_0x2092fa){_0x687ddc=_0x687ddc-0x0;var _0x441991=_0xd634[_0x687ddc];return _0x441991;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x4d63('0x0'))['db'][_0x4d63('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d63('0x2'),'afterDestroy':_0x4d63('0x3')};function emitEvent(_0x478b56){return function(_0x4f99ac,_0x2b8d62,_0x35ba45){MailAccountEvents[_0x4d63('0x4')](_0x478b56+':'+_0x4f99ac['id'],_0x4f99ac);MailAccountEvents[_0x4d63('0x4')](_0x478b56,_0x4f99ac);_0x35ba45(null);};}for(var e in events){if(events[_0x4d63('0x5')](e)){var event=events[e];MailAccount[_0x4d63('0x6')](e,emitEvent(event));}}module[_0x4d63('0x7')]=MailAccountEvents;
\ No newline at end of file
+var _0x4c9d=['update','remove','emit','exports','events','../../mysqldb','MailAccount','save'];(function(_0x1b0c7c,_0x468383){var _0x44f649=function(_0x56fbc6){while(--_0x56fbc6){_0x1b0c7c['push'](_0x1b0c7c['shift']());}};_0x44f649(++_0x468383);}(_0x4c9d,0x7c));var _0xd4c9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4c9d[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0xd4c9('0x0'));var MailAccount=require(_0xd4c9('0x1'))['db'][_0xd4c9('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd4c9('0x3'),'afterUpdate':_0xd4c9('0x4'),'afterDestroy':_0xd4c9('0x5')};function emitEvent(_0x25a55d){return function(_0x102345,_0x2b30d0,_0xbbed9a){MailAccountEvents[_0xd4c9('0x6')](_0x25a55d+':'+_0x102345['id'],_0x102345);MailAccountEvents[_0xd4c9('0x6')](_0x25a55d,_0x102345);_0xbbed9a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xd4c9('0x7')]=MailAccountEvents;
\ No newline at end of file
index 04c9959..eb3a76b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3c2=['exports','MailAccount','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3771c2,_0x280bfb){var _0x36ec3d=function(_0x317997){while(--_0x317997){_0x3771c2['push'](_0x3771c2['shift']());}};_0x36ec3d(++_0x280bfb);}(_0xf3c2,0x134));var _0x2f3c=function(_0x438db6,_0x3f57b4){_0x438db6=_0x438db6-0x0;var _0x4b98ac=_0xf3c2[_0x438db6];return _0x4b98ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2f3c('0x0'))(_0x2f3c('0x1'));var moment=require(_0x2f3c('0x2'));var BPromise=require(_0x2f3c('0x3'));var rp=require(_0x2f3c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f3c('0x5'));var config=require(_0x2f3c('0x6'));var attributes=require('./mailAccount.attributes');module[_0x2f3c('0x7')]=function(_0x24abe7,_0x4730cc){return _0x24abe7['define'](_0x2f3c('0x8'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8e2a=['moment','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','util','../../config/logger'];(function(_0x38ed42,_0x3d9a37){var _0x474931=function(_0x1fa601){while(--_0x1fa601){_0x38ed42['push'](_0x38ed42['shift']());}};_0x474931(++_0x3d9a37);}(_0x8e2a,0xb2));var _0xa8e2=function(_0x1b44c1,_0x32444f){_0x1b44c1=_0x1b44c1-0x0;var _0x80567d=_0x8e2a[_0x1b44c1];return _0x80567d;};'use strict';var _=require('lodash');var util=require(_0xa8e2('0x0'));var logger=require(_0xa8e2('0x1'))('api');var moment=require(_0xa8e2('0x2'));var BPromise=require('bluebird');var rp=require(_0xa8e2('0x3'));var fs=require('fs');var path=require(_0xa8e2('0x4'));var rimraf=require(_0xa8e2('0x5'));var config=require(_0xa8e2('0x6'));var attributes=require(_0xa8e2('0x7'));module[_0xa8e2('0x8')]=function(_0x43c670,_0x49e051){return _0x43c670[_0xa8e2('0x9')](_0xa8e2('0xa'),attributes,{'tableName':_0xa8e2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7566be1..e3a6a05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0507=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetMailAccount','ShowMailAccount','find','stringify','mail','difference','keys','CmContact','rawAttributes','createdAt','body','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','updatedAt','DESC','MailApplication','Smtp','omit','Applications','list','applications','orderBy','asc','autoclose','length','close','*,*,*,*','ListId','from','create','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','subject','get','interaction','created','contact','attachments','originTo','originCc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','Attachments','UserId','User','unshift','name','waitForTheAssignedAgent','Start','startRouting','util'];(function(_0x37356a,_0x4c542d){var _0x4771ee=function(_0x1a4b22){while(--_0x1a4b22){_0x37356a['push'](_0x37356a['shift']());}};_0x4771ee(++_0x4c542d);}(_0x0507,0x66));var _0x7050=function(_0x351714,_0x4bc362){_0x351714=_0x351714-0x0;var _0x3605f8=_0x0507[_0x351714];return _0x3605f8;};'use strict';var _=require('lodash');var util=require(_0x7050('0x0'));var moment=require(_0x7050('0x1'));var BPromise=require(_0x7050('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7050('0x3'));var db=require(_0x7050('0x4'))['db'];var utils=require(_0x7050('0x5'));var logger=require(_0x7050('0x6'))(_0x7050('0x7'));var config=require(_0x7050('0x8'));var jayson=require(_0x7050('0x9'));var client=jayson['client'][_0x7050('0xa')]({'port':0x232c});config[_0x7050('0xb')]=_[_0x7050('0xc')](config[_0x7050('0xb')],{'host':_0x7050('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailAccount.socket')[_0x7050('0xe')](socket);function respondWithRpcPromise(_0x59c0a6,_0x2cc49d,_0x58ea29){return new BPromise(function(_0x3f07ae,_0x52c574){return client[_0x7050('0xf')](_0x59c0a6,_0x58ea29)[_0x7050('0x10')](function(_0x32fa4e){logger[_0x7050('0x11')](_0x7050('0x12'),_0x2cc49d,_0x7050('0x13'));logger[_0x7050('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2cc49d,'request\x20sent',JSON['stringify'](_0x32fa4e));if(_0x32fa4e[_0x7050('0x15')]){if(_0x32fa4e[_0x7050('0x15')][_0x7050('0x16')]===0x1f4){logger[_0x7050('0x15')](_0x7050('0x12'),_0x2cc49d,_0x32fa4e[_0x7050('0x15')][_0x7050('0x17')]);return _0x52c574(_0x32fa4e[_0x7050('0x15')]['message']);}logger[_0x7050('0x15')](_0x7050('0x12'),_0x2cc49d,_0x32fa4e['error'][_0x7050('0x17')]);return _0x3f07ae(_0x32fa4e[_0x7050('0x15')][_0x7050('0x17')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x2cc49d,_0x7050('0x13'));_0x3f07ae(_0x32fa4e[_0x7050('0x18')][_0x7050('0x17')]);}})[_0x7050('0x19')](function(_0x29bb6a){logger[_0x7050('0x15')](_0x7050('0x12'),_0x2cc49d,_0x29bb6a);_0x52c574(_0x29bb6a);});});}exports['GetMailAccount']=function(_0x60e18a){var _0x2189f6=this;return new Promise(function(_0xbc65de,_0x4c0035){return db[_0x7050('0x1a')][_0x7050('0x1b')]({'raw':_0x60e18a[_0x7050('0x1c')]?_0x60e18a[_0x7050('0x1c')][_0x7050('0x1d')]===undefined?!![]:![]:!![],'where':_0x60e18a[_0x7050('0x1c')]?_0x60e18a[_0x7050('0x1c')][_0x7050('0x1e')]||null:null,'attributes':_0x60e18a[_0x7050('0x1c')]?_0x60e18a[_0x7050('0x1c')][_0x7050('0x1f')]||null:null,'limit':_0x60e18a['options']?_0x60e18a['options'][_0x7050('0x20')]||null:null,'include':_0x60e18a[_0x7050('0x1c')]?_0x60e18a[_0x7050('0x1c')][_0x7050('0x21')]?_[_0x7050('0x22')](_0x60e18a[_0x7050('0x1c')][_0x7050('0x21')],function(_0x4e67f6){return{'model':db[_0x4e67f6[_0x7050('0x23')]],'as':_0x4e67f6['as'],'attributes':_0x4e67f6[_0x7050('0x1f')],'include':_0x4e67f6[_0x7050('0x21')]?_[_0x7050('0x22')](_0x4e67f6[_0x7050('0x21')],function(_0x5f0e72){return{'model':db[_0x5f0e72[_0x7050('0x23')]],'as':_0x5f0e72['as'],'attributes':_0x5f0e72[_0x7050('0x1f')],'include':_0x5f0e72[_0x7050('0x21')]?_['map'](_0x5f0e72[_0x7050('0x21')],function(_0x1fbfe3){return{'model':db[_0x1fbfe3[_0x7050('0x23')]],'as':_0x1fbfe3['as'],'attributes':_0x1fbfe3[_0x7050('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7050('0x10')](function(_0x482233){logger[_0x7050('0x11')](_0x7050('0x24'),_0x60e18a);logger[_0x7050('0x14')](_0x7050('0x24'),_0x60e18a,JSON['stringify'](_0x482233));_0xbc65de(_0x482233);})[_0x7050('0x19')](function(_0x3fcb42){logger['error'](_0x7050('0x24'),_0x3fcb42['message'],_0x60e18a);_0x4c0035(_0x2189f6[_0x7050('0x15')](0x1f4,_0x3fcb42[_0x7050('0x17')]));});});};exports[_0x7050('0x25')]=function(_0x21703c){var _0x372f8a=this;return new Promise(function(_0x58e0bd,_0x14181f){return db[_0x7050('0x1a')][_0x7050('0x26')]({'raw':_0x21703c[_0x7050('0x1c')]?_0x21703c[_0x7050('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x21703c[_0x7050('0x1c')]?_0x21703c['options'][_0x7050('0x1e')]||null:null,'attributes':_0x21703c[_0x7050('0x1c')]?_0x21703c['options'][_0x7050('0x1f')]||null:null,'include':_0x21703c['options']?_0x21703c['options'][_0x7050('0x21')]?_['map'](_0x21703c[_0x7050('0x1c')]['include'],function(_0x5a3464){return{'model':db[_0x5a3464['model']],'as':_0x5a3464['as'],'attributes':_0x5a3464['attributes'],'include':_0x5a3464[_0x7050('0x21')]?_[_0x7050('0x22')](_0x5a3464[_0x7050('0x21')],function(_0x16f884){return{'model':db[_0x16f884['model']],'as':_0x16f884['as'],'attributes':_0x16f884[_0x7050('0x1f')],'include':_0x16f884[_0x7050('0x21')]?_[_0x7050('0x22')](_0x16f884['include'],function(_0x2417da){return{'model':db[_0x2417da[_0x7050('0x23')]],'as':_0x2417da['as'],'attributes':_0x2417da[_0x7050('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7050('0x10')](function(_0x3e75d3){logger['info']('ShowMailAccount',_0x21703c);logger[_0x7050('0x14')]('ShowMailAccount',_0x21703c,JSON[_0x7050('0x27')](_0x3e75d3));_0x58e0bd(_0x3e75d3);})[_0x7050('0x19')](function(_0x437929){logger[_0x7050('0x15')](_0x7050('0x25'),_0x437929[_0x7050('0x17')],_0x21703c);_0x14181f(_0x372f8a[_0x7050('0x15')](0x1f4,_0x437929[_0x7050('0x17')]));});});};exports['NotifyMailAccount']=function(_0x3892b9){var _0x1467d9=this;return new Promise(function(_0xecc182,_0xc61cbe){var _0x28c2de={'body':_0x3892b9['body'],'channel':_0x7050('0x28')};var _0x17aa0c=_[_0x7050('0x29')](_[_0x7050('0x2a')](db[_0x7050('0x2b')][_0x7050('0x2c')]),[_0x7050('0x2d'),'updatedAt','CompanyId','ListId']);var _0x156506=![];if(_0x3892b9['body']['id']){delete _0x3892b9[_0x7050('0x2e')]['id'];}if(_[_0x7050('0x2f')](_0x3892b9[_0x7050('0x2e')]['from'])){return _0xc61cbe(_0x1467d9[_0x7050('0x15')](0x1f4,_0x7050('0x30')));}if(_[_0x7050('0x2f')](_0x3892b9[_0x7050('0x2e')][_0x7050('0x2e')])||_0x3892b9[_0x7050('0x2e')]['body']===''){return _0xc61cbe(_0x1467d9[_0x7050('0x15')](0x1f4,_0x7050('0x31')));}if(_['isNil'](_0x3892b9[_0x7050('0x2e')][_0x7050('0x32')])){return _0xc61cbe(_0x1467d9['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x17aa0c));}if(!_[_0x7050('0x33')](_0x17aa0c,_0x3892b9['body']['mapKey'])){return _0xc61cbe(_0x1467d9[_0x7050('0x15')](0x1f4,_0x7050('0x34')+_0x17aa0c));}var _0x59d00a={};_0x59d00a[_0x3892b9[_0x7050('0x2e')][_0x7050('0x32')]]=_0x3892b9[_0x7050('0x2e')]['from'];return db[_0x7050('0x1a')][_0x7050('0x26')]({'where':{'id':_0x3892b9[_0x7050('0x35')]['id']},'include':[{'model':db['CmList'],'as':_0x7050('0x36'),'include':[{'model':db[_0x7050('0x2b')],'as':_0x7050('0x37'),'where':_0x59d00a,'limit':0x1,'order':[[_0x7050('0x38'),_0x7050('0x39')]]}]},{'model':db[_0x7050('0x3a')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x7050('0x3b')}]})[_0x7050('0x10')](function(_0x362867){if(_0x362867&&_0x362867[_0x7050('0x36')]){var _0x42956d=_0x362867['get']({'plain':!![]});_0x28c2de['account']=_[_0x7050('0x3c')](_0x42956d,['Applications',_0x7050('0x36')]);_0x28c2de['applications']=_0x42956d[_0x7050('0x3d')];_0x28c2de[_0x7050('0x3e')]=_0x42956d[_0x7050('0x36')];_0x28c2de[_0x7050('0x3f')]=_[_0x7050('0x40')](_0x28c2de['applications'],['priority'],[_0x7050('0x41')]);if(_0x28c2de[_0x7050('0x35')]&&_0x28c2de[_0x7050('0x35')][_0x7050('0x42')]){_0x28c2de[_0x7050('0x3f')]['push']({'id':0x0,'priority':_0x28c2de[_0x7050('0x3f')][_0x7050('0x43')]+0x1,'app':_0x7050('0x44'),'appdata':_0x7050('0x42'),'interval':_0x7050('0x45')});}if(_0x28c2de['account']['Applications']){delete _0x28c2de['account'][_0x7050('0x3d')];}if(_0x28c2de[_0x7050('0x35')][_0x7050('0x36')]){delete _0x28c2de[_0x7050('0x35')]['List'];}if(_0x42956d[_0x7050('0x36')][_0x7050('0x37')][_0x7050('0x43')]){return _0x42956d[_0x7050('0x36')][_0x7050('0x37')][0x0];}var _0x3b1306=_[_0x7050('0xc')](_0x3892b9[_0x7050('0x2e')],{'firstName':_0x3892b9['body']['from'],'ListId':_0x42956d[_0x7050('0x46')]});_0x3b1306[_0x3892b9[_0x7050('0x2e')]['mapKey']]=_0x3892b9['body'][_0x7050('0x47')];return db['CmContact'][_0x7050('0x48')](_0x3b1306);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x57fb5c){_0x28c2de['contact']=_0x57fb5c;if(_0x57fb5c){if(!_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x49')]){_0x3892b9[_0x7050('0x2e')]['message'][_0x7050('0x49')]=rs[_0x7050('0x4a')]()+'\x20'+_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')]['from'];}var _0xc6a0e9={'ContactId':_0x57fb5c['id'],'MailAccountId':_0x3892b9[_0x7050('0x35')]['id'],'inReplyTo':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x49')],'to':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x47')],'cc':_0x3892b9[_0x7050('0x2e')]['message']['cc'],'subject':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')]['subject'],'attach':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x4b')],'lastMsgAt':moment()[_0x7050('0x4c')](_0x7050('0x4d')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x7050('0x26')]({'where':{'closed':![],'MailAccountId':_0x3892b9[_0x7050('0x35')]['id']},'include':[{'model':db[_0x7050('0x4e')],'as':_0x7050('0x4f'),'attributes':[_0x7050('0x49')],'where':{'messageId':_0x3892b9['body'][_0x7050('0x17')][_0x7050('0x50')]}}]})[_0x7050('0x10')](function(_0x147e56){if(_0x147e56){return[_0x147e56,![]];}return db[_0x7050('0x51')][_0x7050('0x48')](_0xc6a0e9)[_0x7050('0x10')](function(_0x3857e8){return[_0x3857e8,!![]];});});}else{throw new Error(_0x7050('0x52'));}})['spread'](function(_0x20cbc5,_0x3bf50d){if(_0x20cbc5){_0x156506=_0x3bf50d;if(!_0x3bf50d){return _0x20cbc5['update']({'inReplyTo':_0x3892b9[_0x7050('0x2e')]['message'][_0x7050('0x49')],'to':_0x3892b9[_0x7050('0x2e')]['message']['from'],'cc':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')]['cc'],'subject':_0x3892b9['body']['message'][_0x7050('0x53')],'attach':_0x20cbc5[_0x7050('0x4b')]?_0x20cbc5['attach']:_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x4b')],'substatus':null,'substatusAt':moment()['format'](_0x7050('0x4d')),'lastMsgAt':moment()[_0x7050('0x4c')](_0x7050('0x4d')),'lastMsgDirection':'in'});}else{return _0x20cbc5;}}})[_0x7050('0x10')](function(_0x57c9df){_0x28c2de['interaction']=_0x57c9df[_0x7050('0x54')]({'plain':!![]});_0x28c2de[_0x7050('0x55')][_0x7050('0x56')]=_0x156506;return db[_0x7050('0x4e')][_0x7050('0x48')]({'body':_0x3892b9[_0x7050('0x2e')][_0x7050('0x2e')],'MailAccountId':_0x3892b9[_0x7050('0x35')]['id'],'MailInteractionId':_0x57c9df['id'],'direction':'in','ContactId':_0x28c2de[_0x7050('0x57')]['id'],'messageId':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x49')],'from':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x47')],'to':_0x3892b9['body'][_0x7050('0x17')]['to'],'cc':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')]['cc'],'subject':_0x3892b9[_0x7050('0x2e')]['message']['subject'],'attach':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')]['attach'],'Attachments':_0x3892b9['body'][_0x7050('0x17')][_0x7050('0x58')],'originTo':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x59')],'originCc':_0x3892b9['body']['message'][_0x7050('0x5a')],'bcc':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')]['bcc'],'ChatWebsiteId':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x5b')]||null,'originChannel':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x5c')]||'Email','ChatOfflineMessageId':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x5d')]||null},{'include':[{'model':db[_0x7050('0x5e')],'as':_0x7050('0x5f')}]});})['then'](function(_0x25ac5a){_0x28c2de[_0x7050('0x17')]=_0x25ac5a;if(_0x28c2de[_0x7050('0x55')][_0x7050('0x60')]){return db[_0x7050('0x61')]['find']({'attributes':['id','name'],'where':{'id':_0x28c2de[_0x7050('0x55')][_0x7050('0x60')]}})['then'](function(_0xe58775){if(_0xe58775){_0x28c2de['applications'][_0x7050('0x62')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xe58775[_0x7050('0x63')]+','+(_0x28c2de[_0x7050('0x35')][_0x7050('0x64')]||0xa),'interval':_0x7050('0x45')});}return respondWithRpcPromise(_0x7050('0x65'),_0x7050('0x66'),_0x28c2de);});}return respondWithRpcPromise(_0x7050('0x65'),_0x7050('0x66'),_0x28c2de);})[_0x7050('0x10')](function(_0x216bab){_0xecc182(_0x216bab);})[_0x7050('0x19')](function(_0x1a2147){_0xc61cbe(_0x1467d9[_0x7050('0x15')](0x1f4,_0x1a2147[_0x7050('0x17')]));});});};
\ No newline at end of file
+var _0xc798=['startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','GetMailAccount','options','where','attributes','limit','include','model','map','stringify','catch','ShowMailAccount','MailAccount','raw','NotifyMailAccount','body','difference','CmContact','rawAttributes','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','updatedAt','DESC','Smtp','get','omit','Applications','list','orderBy','applications','asc','autoclose','push','close','*,*,*,*','length','create','contact','messageId','generate','attach','format','inReplyTo','Contact\x20not\x20found','update','subject','YYYY-MM-DD\x20HH:mm:ss','created','MailMessage','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','interaction','UserId','User','name','unshift','agent','Start'];(function(_0x219cc1,_0x3d03b5){var _0x177034=function(_0x45e0fe){while(--_0x45e0fe){_0x219cc1['push'](_0x219cc1['shift']());}};_0x177034(++_0x3d03b5);}(_0xc798,0x69));var _0x8c79=function(_0x288491,_0x41eec4){_0x288491=_0x288491-0x0;var _0xe2b018=_0xc798[_0x288491];return _0xe2b018;};'use strict';var _=require(_0x8c79('0x0'));var util=require(_0x8c79('0x1'));var moment=require('moment');var BPromise=require(_0x8c79('0x2'));var rs=require(_0x8c79('0x3'));var fs=require('fs');var Redis=require(_0x8c79('0x4'));var db=require(_0x8c79('0x5'))['db'];var utils=require(_0x8c79('0x6'));var logger=require(_0x8c79('0x7'))(_0x8c79('0x8'));var config=require(_0x8c79('0x9'));var jayson=require(_0x8c79('0xa'));var client=jayson[_0x8c79('0xb')]['http']({'port':0x232c});config[_0x8c79('0xc')]=_[_0x8c79('0xd')](config[_0x8c79('0xc')],{'host':_0x8c79('0xe'),'port':0x18eb});var socket=require(_0x8c79('0xf'))(new Redis(config[_0x8c79('0xc')]));require(_0x8c79('0x10'))[_0x8c79('0x11')](socket);function respondWithRpcPromise(_0x2a4e27,_0x2386cc,_0x5cca8a){return new BPromise(function(_0x54a212,_0x4a1bee){return client[_0x8c79('0x12')](_0x2a4e27,_0x5cca8a)[_0x8c79('0x13')](function(_0x584cf0){logger[_0x8c79('0x14')]('MailAccount,\x20%s,\x20%s',_0x2386cc,_0x8c79('0x15'));logger[_0x8c79('0x16')](_0x8c79('0x17'),_0x2386cc,_0x8c79('0x15'),JSON['stringify'](_0x584cf0));if(_0x584cf0[_0x8c79('0x18')]){if(_0x584cf0['error'][_0x8c79('0x19')]===0x1f4){logger[_0x8c79('0x18')](_0x8c79('0x1a'),_0x2386cc,_0x584cf0[_0x8c79('0x18')]['message']);return _0x4a1bee(_0x584cf0[_0x8c79('0x18')][_0x8c79('0x1b')]);}logger[_0x8c79('0x18')]('MailAccount,\x20%s,\x20%s',_0x2386cc,_0x584cf0[_0x8c79('0x18')]['message']);return _0x54a212(_0x584cf0[_0x8c79('0x18')][_0x8c79('0x1b')]);}else{logger[_0x8c79('0x14')](_0x8c79('0x1a'),_0x2386cc,_0x8c79('0x15'));_0x54a212(_0x584cf0['result']['message']);}})['catch'](function(_0x464829){logger[_0x8c79('0x18')](_0x8c79('0x1a'),_0x2386cc,_0x464829);_0x4a1bee(_0x464829);});});}exports[_0x8c79('0x1c')]=function(_0x354448){var _0x3d1be4=this;return new Promise(function(_0xcfd201,_0x585d17){return db['MailAccount']['findAll']({'raw':_0x354448['options']?_0x354448['options']['raw']===undefined?!![]:![]:!![],'where':_0x354448[_0x8c79('0x1d')]?_0x354448['options'][_0x8c79('0x1e')]||null:null,'attributes':_0x354448['options']?_0x354448[_0x8c79('0x1d')][_0x8c79('0x1f')]||null:null,'limit':_0x354448[_0x8c79('0x1d')]?_0x354448['options'][_0x8c79('0x20')]||null:null,'include':_0x354448[_0x8c79('0x1d')]?_0x354448[_0x8c79('0x1d')][_0x8c79('0x21')]?_['map'](_0x354448[_0x8c79('0x1d')]['include'],function(_0x2a2e2e){return{'model':db[_0x2a2e2e[_0x8c79('0x22')]],'as':_0x2a2e2e['as'],'attributes':_0x2a2e2e[_0x8c79('0x1f')],'include':_0x2a2e2e[_0x8c79('0x21')]?_[_0x8c79('0x23')](_0x2a2e2e[_0x8c79('0x21')],function(_0x258323){return{'model':db[_0x258323['model']],'as':_0x258323['as'],'attributes':_0x258323[_0x8c79('0x1f')],'include':_0x258323[_0x8c79('0x21')]?_[_0x8c79('0x23')](_0x258323[_0x8c79('0x21')],function(_0x224674){return{'model':db[_0x224674[_0x8c79('0x22')]],'as':_0x224674['as'],'attributes':_0x224674[_0x8c79('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x95d1af){logger[_0x8c79('0x14')](_0x8c79('0x1c'),_0x354448);logger[_0x8c79('0x16')](_0x8c79('0x1c'),_0x354448,JSON[_0x8c79('0x24')](_0x95d1af));_0xcfd201(_0x95d1af);})[_0x8c79('0x25')](function(_0x4b0e4d){logger[_0x8c79('0x18')](_0x8c79('0x1c'),_0x4b0e4d[_0x8c79('0x1b')],_0x354448);_0x585d17(_0x3d1be4['error'](0x1f4,_0x4b0e4d['message']));});});};exports[_0x8c79('0x26')]=function(_0x11489d){var _0x59e680=this;return new Promise(function(_0x4d3ac5,_0x5396ef){return db[_0x8c79('0x27')]['find']({'raw':_0x11489d['options']?_0x11489d[_0x8c79('0x1d')][_0x8c79('0x28')]===undefined?!![]:![]:!![],'where':_0x11489d[_0x8c79('0x1d')]?_0x11489d[_0x8c79('0x1d')][_0x8c79('0x1e')]||null:null,'attributes':_0x11489d['options']?_0x11489d[_0x8c79('0x1d')][_0x8c79('0x1f')]||null:null,'include':_0x11489d[_0x8c79('0x1d')]?_0x11489d[_0x8c79('0x1d')][_0x8c79('0x21')]?_[_0x8c79('0x23')](_0x11489d[_0x8c79('0x1d')]['include'],function(_0x5eb456){return{'model':db[_0x5eb456[_0x8c79('0x22')]],'as':_0x5eb456['as'],'attributes':_0x5eb456[_0x8c79('0x1f')],'include':_0x5eb456[_0x8c79('0x21')]?_['map'](_0x5eb456[_0x8c79('0x21')],function(_0x4cf2a0){return{'model':db[_0x4cf2a0[_0x8c79('0x22')]],'as':_0x4cf2a0['as'],'attributes':_0x4cf2a0[_0x8c79('0x1f')],'include':_0x4cf2a0[_0x8c79('0x21')]?_[_0x8c79('0x23')](_0x4cf2a0[_0x8c79('0x21')],function(_0x18fc23){return{'model':db[_0x18fc23['model']],'as':_0x18fc23['as'],'attributes':_0x18fc23[_0x8c79('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8c79('0x13')](function(_0x265c19){logger['info']('ShowMailAccount',_0x11489d);logger[_0x8c79('0x16')](_0x8c79('0x26'),_0x11489d,JSON['stringify'](_0x265c19));_0x4d3ac5(_0x265c19);})['catch'](function(_0x2af6a9){logger[_0x8c79('0x18')](_0x8c79('0x26'),_0x2af6a9[_0x8c79('0x1b')],_0x11489d);_0x5396ef(_0x59e680[_0x8c79('0x18')](0x1f4,_0x2af6a9[_0x8c79('0x1b')]));});});};exports[_0x8c79('0x29')]=function(_0x1df8cd){var _0x48ec2a=this;return new Promise(function(_0x1c593f,_0x32b4b6){var _0x2d3380={'body':_0x1df8cd[_0x8c79('0x2a')],'channel':'mail'};var _0x22b749=_[_0x8c79('0x2b')](_['keys'](db[_0x8c79('0x2c')][_0x8c79('0x2d')]),['createdAt','updatedAt',_0x8c79('0x2e'),_0x8c79('0x2f')]);var _0x104b6f=![];if(_0x1df8cd[_0x8c79('0x2a')]['id']){delete _0x1df8cd[_0x8c79('0x2a')]['id'];}if(_['isNil'](_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x30')])){return _0x32b4b6(_0x48ec2a[_0x8c79('0x18')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x2a')])||_0x1df8cd['body'][_0x8c79('0x2a')]===''){return _0x32b4b6(_0x48ec2a[_0x8c79('0x18')](0x1f4,_0x8c79('0x31')));}if(_['isNil'](_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x32')])){return _0x32b4b6(_0x48ec2a[_0x8c79('0x18')](0x1f4,_0x8c79('0x33')+_0x22b749));}if(!_[_0x8c79('0x34')](_0x22b749,_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x32')])){return _0x32b4b6(_0x48ec2a['error'](0x1f4,_0x8c79('0x35')+_0x22b749));}var _0x2fc136={};_0x2fc136[_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x32')]]=_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x30')];return db[_0x8c79('0x27')][_0x8c79('0x36')]({'where':{'id':_0x1df8cd[_0x8c79('0x37')]['id']},'include':[{'model':db[_0x8c79('0x38')],'as':_0x8c79('0x39'),'include':[{'model':db[_0x8c79('0x2c')],'as':_0x8c79('0x3a'),'where':_0x2fc136,'limit':0x1,'order':[[_0x8c79('0x3b'),_0x8c79('0x3c')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x8c79('0x3d')}]})['then'](function(_0x44e5cf){if(_0x44e5cf&&_0x44e5cf[_0x8c79('0x39')]){var _0x3b2bab=_0x44e5cf[_0x8c79('0x3e')]({'plain':!![]});_0x2d3380[_0x8c79('0x37')]=_[_0x8c79('0x3f')](_0x3b2bab,[_0x8c79('0x40'),_0x8c79('0x39')]);_0x2d3380['applications']=_0x3b2bab['Applications'];_0x2d3380[_0x8c79('0x41')]=_0x3b2bab['List'];_0x2d3380['applications']=_[_0x8c79('0x42')](_0x2d3380[_0x8c79('0x43')],['priority'],[_0x8c79('0x44')]);if(_0x2d3380[_0x8c79('0x37')]&&_0x2d3380['account'][_0x8c79('0x45')]){_0x2d3380[_0x8c79('0x43')][_0x8c79('0x46')]({'id':0x0,'priority':_0x2d3380['applications']['length']+0x1,'app':_0x8c79('0x47'),'appdata':_0x8c79('0x45'),'interval':_0x8c79('0x48')});}if(_0x2d3380[_0x8c79('0x37')][_0x8c79('0x40')]){delete _0x2d3380[_0x8c79('0x37')]['Applications'];}if(_0x2d3380[_0x8c79('0x37')][_0x8c79('0x39')]){delete _0x2d3380[_0x8c79('0x37')][_0x8c79('0x39')];}if(_0x3b2bab[_0x8c79('0x39')][_0x8c79('0x3a')][_0x8c79('0x49')]){return _0x3b2bab[_0x8c79('0x39')][_0x8c79('0x3a')][0x0];}var _0x12984c=_[_0x8c79('0xd')](_0x1df8cd['body'],{'firstName':_0x1df8cd['body'][_0x8c79('0x30')],'ListId':_0x3b2bab[_0x8c79('0x2f')]});_0x12984c[_0x1df8cd[_0x8c79('0x2a')]['mapKey']]=_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x30')];return db[_0x8c79('0x2c')][_0x8c79('0x4a')](_0x12984c);}else{throw new Error('List\x20not\x20found');}})[_0x8c79('0x13')](function(_0x330c5e){_0x2d3380[_0x8c79('0x4b')]=_0x330c5e;if(_0x330c5e){if(!_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')]['messageId']){_0x1df8cd['body'][_0x8c79('0x1b')][_0x8c79('0x4c')]=rs[_0x8c79('0x4d')]()+'\x20'+_0x1df8cd[_0x8c79('0x2a')]['message']['from'];}var _0x1405b9={'ContactId':_0x330c5e['id'],'MailAccountId':_0x1df8cd[_0x8c79('0x37')]['id'],'inReplyTo':_0x1df8cd['body'][_0x8c79('0x1b')][_0x8c79('0x4c')],'to':_0x1df8cd[_0x8c79('0x2a')]['message']['from'],'cc':_0x1df8cd['body'][_0x8c79('0x1b')]['cc'],'subject':_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')]['subject'],'attach':_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')][_0x8c79('0x4e')],'lastMsgAt':moment()[_0x8c79('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0x8c79('0x36')]({'where':{'closed':![],'MailAccountId':_0x1df8cd[_0x8c79('0x37')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x8c79('0x4c')],'where':{'messageId':_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')][_0x8c79('0x50')]}}]})[_0x8c79('0x13')](function(_0x2aaf6c){if(_0x2aaf6c){return[_0x2aaf6c,![]];}return db['MailInteraction']['create'](_0x1405b9)[_0x8c79('0x13')](function(_0x8c2d23){return[_0x8c2d23,!![]];});});}else{throw new Error(_0x8c79('0x51'));}})['spread'](function(_0x1185ae,_0x4f37c2){if(_0x1185ae){_0x104b6f=_0x4f37c2;if(!_0x4f37c2){return _0x1185ae[_0x8c79('0x52')]({'inReplyTo':_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')][_0x8c79('0x4c')],'to':_0x1df8cd['body'][_0x8c79('0x1b')][_0x8c79('0x30')],'cc':_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')]['cc'],'subject':_0x1df8cd['body'][_0x8c79('0x1b')][_0x8c79('0x53')],'attach':_0x1185ae[_0x8c79('0x4e')]?_0x1185ae['attach']:_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')][_0x8c79('0x4e')],'substatus':null,'substatusAt':moment()['format'](_0x8c79('0x54')),'lastMsgAt':moment()[_0x8c79('0x4f')](_0x8c79('0x54')),'lastMsgDirection':'in'});}else{return _0x1185ae;}}})[_0x8c79('0x13')](function(_0x22cda4){_0x2d3380['interaction']=_0x22cda4[_0x8c79('0x3e')]({'plain':!![]});_0x2d3380['interaction'][_0x8c79('0x55')]=_0x104b6f;return db[_0x8c79('0x56')][_0x8c79('0x4a')]({'body':_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x2a')],'MailAccountId':_0x1df8cd[_0x8c79('0x37')]['id'],'MailInteractionId':_0x22cda4['id'],'direction':'in','ContactId':_0x2d3380[_0x8c79('0x4b')]['id'],'messageId':_0x1df8cd['body'][_0x8c79('0x1b')][_0x8c79('0x4c')],'from':_0x1df8cd[_0x8c79('0x2a')]['message']['from'],'to':_0x1df8cd['body'][_0x8c79('0x1b')]['to'],'cc':_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')]['cc'],'subject':_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')]['subject'],'attach':_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')][_0x8c79('0x4e')],'Attachments':_0x1df8cd['body'][_0x8c79('0x1b')][_0x8c79('0x57')],'originTo':_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')][_0x8c79('0x58')],'originCc':_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')][_0x8c79('0x59')],'bcc':_0x1df8cd['body'][_0x8c79('0x1b')]['bcc'],'ChatWebsiteId':_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')][_0x8c79('0x5a')]||null,'originChannel':_0x1df8cd['body']['message'][_0x8c79('0x5b')]||_0x8c79('0x5c'),'ChatOfflineMessageId':_0x1df8cd[_0x8c79('0x2a')][_0x8c79('0x1b')][_0x8c79('0x5d')]||null},{'include':[{'model':db[_0x8c79('0x5e')],'as':_0x8c79('0x5f')}]});})[_0x8c79('0x13')](function(_0x493e08){_0x2d3380['message']=_0x493e08;if(_0x2d3380[_0x8c79('0x60')][_0x8c79('0x61')]){return db[_0x8c79('0x62')][_0x8c79('0x36')]({'attributes':['id',_0x8c79('0x63')],'where':{'id':_0x2d3380[_0x8c79('0x60')][_0x8c79('0x61')]}})[_0x8c79('0x13')](function(_0x5e9de7){if(_0x5e9de7){_0x2d3380[_0x8c79('0x43')][_0x8c79('0x64')]({'id':0x0,'priority':0x0,'app':_0x8c79('0x65'),'appdata':_0x5e9de7[_0x8c79('0x63')]+','+(_0x2d3380[_0x8c79('0x37')]['waitForTheAssignedAgent']||0xa),'interval':_0x8c79('0x48')});}return respondWithRpcPromise(_0x8c79('0x66'),_0x8c79('0x67'),_0x2d3380);});}return respondWithRpcPromise(_0x8c79('0x66'),_0x8c79('0x67'),_0x2d3380);})[_0x8c79('0x13')](function(_0x485575){_0x1c593f(_0x485575);})[_0x8c79('0x25')](function(_0x129c36){_0x32b4b6(_0x48ec2a[_0x8c79('0x18')](0x1f4,_0x129c36[_0x8c79('0x1b')]));});});};
\ No newline at end of file
index 8abe9a4..f1aa1f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb886=['update','emit','removeListener','register','length','./mailAccount.events','save','remove'];(function(_0x307e4f,_0x1f649f){var _0x5e8561=function(_0x1beb99){while(--_0x1beb99){_0x307e4f['push'](_0x307e4f['shift']());}};_0x5e8561(++_0x1f649f);}(_0xb886,0xf5));var _0x6b88=function(_0x5e0ceb,_0x2551a8){_0x5e0ceb=_0x5e0ceb-0x0;var _0x57f47d=_0xb886[_0x5e0ceb];return _0x57f47d;};'use strict';var MailAccountEvents=require(_0x6b88('0x0'));var events=[_0x6b88('0x1'),_0x6b88('0x2'),_0x6b88('0x3')];function createListener(_0x1227da,_0x24f91b){return function(_0x15bf58){_0x24f91b[_0x6b88('0x4')](_0x1227da,_0x15bf58);};}function removeListener(_0x5dc17b,_0x5007af){return function(){MailAccountEvents[_0x6b88('0x5')](_0x5dc17b,_0x5007af);};}exports[_0x6b88('0x6')]=function(_0x14acc6){for(var _0x23b99e=0x0,_0x2e0afb=events[_0x6b88('0x7')];_0x23b99e<_0x2e0afb;_0x23b99e++){var _0x4e15f1=events[_0x23b99e];var _0x154466=createListener('mailAccount:'+_0x4e15f1,_0x14acc6);MailAccountEvents['on'](_0x4e15f1,_0x154466);}};
\ No newline at end of file
+var _0x77d6=['emit','removeListener','register','length','mailAccount:','remove','update'];(function(_0x335475,_0x44f185){var _0x566ee2=function(_0x3719ff){while(--_0x3719ff){_0x335475['push'](_0x335475['shift']());}};_0x566ee2(++_0x44f185);}(_0x77d6,0x17f));var _0x677d=function(_0x15b580,_0x343baf){_0x15b580=_0x15b580-0x0;var _0x47cd5e=_0x77d6[_0x15b580];return _0x47cd5e;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0x677d('0x0'),_0x677d('0x1')];function createListener(_0x27b2fc,_0x2e06bb){return function(_0x136468){_0x2e06bb[_0x677d('0x2')](_0x27b2fc,_0x136468);};}function removeListener(_0x5921f0,_0x3149f9){return function(){MailAccountEvents[_0x677d('0x3')](_0x5921f0,_0x3149f9);};}exports[_0x677d('0x4')]=function(_0x24072f){for(var _0x4bf6c2=0x0,_0x30ceb1=events[_0x677d('0x5')];_0x4bf6c2<_0x30ceb1;_0x4bf6c2++){var _0x50e45b=events[_0x4bf6c2];var _0x11bdf3=createListener(_0x677d('0x6')+_0x50e45b,_0x24072f);MailAccountEvents['on'](_0x50e45b,_0x11bdf3);}};
\ No newline at end of file
index 7557e5f..75eb936 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x850c=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get','show','/:id','isAuthenticated'];(function(_0x15e69e,_0x35a42d){var _0x46a804=function(_0x500307){while(--_0x500307){_0x15e69e['push'](_0x15e69e['shift']());}};_0x46a804(++_0x35a42d);}(_0x850c,0xd0));var _0xc850=function(_0x46678a,_0x3915b7){_0x46678a=_0x46678a-0x0;var _0x561981=_0x850c[_0x46678a];return _0x561981;};'use strict';var multer=require(_0xc850('0x0'));var util=require('util');var path=require(_0xc850('0x1'));var timeout=require(_0xc850('0x2'));var express=require(_0xc850('0x3'));var router=express[_0xc850('0x4')]();var fs_extra=require(_0xc850('0x5'));var auth=require(_0xc850('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc850('0x7'));var controller=require(_0xc850('0x8'));router[_0xc850('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc850('0xa')]);router['put'](_0xc850('0xb'),auth[_0xc850('0xc')](),controller[_0xc850('0xd')]);router[_0xc850('0xe')]('/:id',auth[_0xc850('0xc')](),controller[_0xc850('0xf')]);module[_0xc850('0x10')]=router;
\ No newline at end of file
+var _0x7ec3=['get','/:id','put','isAuthenticated','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','./mailApplication.controller'];(function(_0x3a31dd,_0x67a5f9){var _0x259099=function(_0x44fe2a){while(--_0x44fe2a){_0x3a31dd['push'](_0x3a31dd['shift']());}};_0x259099(++_0x67a5f9);}(_0x7ec3,0x69));var _0x37ec=function(_0x59461e,_0x2e8fbf){_0x59461e=_0x59461e-0x0;var _0x4500fb=_0x7ec3[_0x59461e];return _0x4500fb;};'use strict';var multer=require(_0x37ec('0x0'));var util=require(_0x37ec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x37ec('0x2'));var router=express[_0x37ec('0x3')]();var fs_extra=require(_0x37ec('0x4'));var auth=require(_0x37ec('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x37ec('0x6'));router[_0x37ec('0x7')](_0x37ec('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x37ec('0x9')](_0x37ec('0x8'),auth[_0x37ec('0xa')](),controller[_0x37ec('0xb')]);router[_0x37ec('0xc')](_0x37ec('0x8'),auth[_0x37ec('0xa')](),controller[_0x37ec('0xd')]);module['exports']=router;
\ No newline at end of file
index da57e15..a848a79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0081=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x151bb5,_0x520405){var _0x2f2759=function(_0xdfffa6){while(--_0xdfffa6){_0x151bb5['push'](_0x151bb5['shift']());}};_0x2f2759(++_0x520405);}(_0x0081,0x11a));var _0x1008=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x0081[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require('sequelize');module[_0x1008('0x0')]={'priority':{'type':Sequelize[_0x1008('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1008('0x2')},'appdata':{'type':Sequelize[_0x1008('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1008('0x4')],'defaultValue':_0x1008('0x5')}};
\ No newline at end of file
+var _0x8973=['STRING','exports','INTEGER','noop','TEXT'];(function(_0x2ba271,_0x459df0){var _0x21e60d=function(_0x22deb1){while(--_0x22deb1){_0x2ba271['push'](_0x2ba271['shift']());}};_0x21e60d(++_0x459df0);}(_0x8973,0x74));var _0x3897=function(_0x44be07,_0x295e62){_0x44be07=_0x44be07-0x0;var _0x3856a8=_0x8973[_0x44be07];return _0x3856a8;};'use strict';var Sequelize=require('sequelize');module[_0x3897('0x0')]={'priority':{'type':Sequelize[_0x3897('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3897('0x2')},'appdata':{'type':Sequelize[_0x3897('0x3')]()},'description':{'type':Sequelize[_0x3897('0x4')]},'interval':{'type':Sequelize[_0x3897('0x4')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index c48e677..df9bb13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xaa88[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));};
\ No newline at end of file
+var _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x7edec1,_0x31f0f0){var _0x4c58c0=function(_0xa230a8){while(--_0xa230a8){_0x7edec1['push'](_0x7edec1['shift']());}};_0x4c58c0(++_0x31f0f0);}(_0x70e0,0x17b));var _0x070e=function(_0x35a886,_0x1bf7fd){_0x35a886=_0x35a886-0x0;var _0x4650a0=_0x70e0[_0x35a886];return _0x4650a0;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));};
\ No newline at end of file
index d15fe26..342c8a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc868=['define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports'];(function(_0x4ab7bc,_0x20c151){var _0x209ebd=function(_0x3289af){while(--_0x3289af){_0x4ab7bc['push'](_0x4ab7bc['shift']());}};_0x209ebd(++_0x20c151);}(_0xc868,0x13c));var _0x8c86=function(_0x1f33d1,_0x5b5d30){_0x1f33d1=_0x1f33d1-0x0;var _0x1b2156=_0xc868[_0x1f33d1];return _0x1b2156;};'use strict';var _=require(_0x8c86('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8c86('0x1'));var moment=require('moment');var BPromise=require(_0x8c86('0x2'));var rp=require(_0x8c86('0x3'));var fs=require('fs');var path=require(_0x8c86('0x4'));var rimraf=require(_0x8c86('0x5'));var config=require(_0x8c86('0x6'));var attributes=require(_0x8c86('0x7'));module[_0x8c86('0x8')]=function(_0x2713ee,_0x5ab955){return _0x2713ee[_0x8c86('0x9')]('MailApplication',attributes,{'tableName':_0x8c86('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c86('0xb'),'collate':_0x8c86('0xc')});};
\ No newline at end of file
+var _0xc9dd=['define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xc9dd,0x140));var _0xdc9d=function(_0x2d833d,_0x3c5fb2){_0x2d833d=_0x2d833d-0x0;var _0x3c69a0=_0xc9dd[_0x2d833d];return _0x3c69a0;};'use strict';var _=require(_0xdc9d('0x0'));var util=require(_0xdc9d('0x1'));var logger=require(_0xdc9d('0x2'))('api');var moment=require(_0xdc9d('0x3'));var BPromise=require(_0xdc9d('0x4'));var rp=require(_0xdc9d('0x5'));var fs=require('fs');var path=require(_0xdc9d('0x6'));var rimraf=require(_0xdc9d('0x7'));var config=require(_0xdc9d('0x8'));var attributes=require(_0xdc9d('0x9'));module['exports']=function(_0x1f8208,_0x304335){return _0x1f8208[_0xdc9d('0xa')](_0xdc9d('0xb'),attributes,{'tableName':_0xdc9d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdc9d('0xd'),'collate':_0xdc9d('0xe')});};
\ No newline at end of file
index 58048d1..d256256 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa4d=['where','attributes','stringify','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','MailApplication,\x20%s,\x20%s','message','info','result','UpdateMailApplication','MailApplication','update','options'];(function(_0x2fab2f,_0x2b7024){var _0x1d6c3e=function(_0x36f89b){while(--_0x36f89b){_0x2fab2f['push'](_0x2fab2f['shift']());}};_0x1d6c3e(++_0x2b7024);}(_0xfa4d,0x90));var _0xdfa4=function(_0x5c2f30,_0x51ef45){_0x5c2f30=_0x5c2f30-0x0;var _0x1ad965=_0xfa4d[_0x5c2f30];return _0x1ad965;};'use strict';var _=require(_0xdfa4('0x0'));var util=require(_0xdfa4('0x1'));var moment=require('moment');var BPromise=require(_0xdfa4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdfa4('0x3'));var logger=require(_0xdfa4('0x4'))(_0xdfa4('0x5'));var config=require(_0xdfa4('0x6'));var jayson=require(_0xdfa4('0x7'));var client=jayson[_0xdfa4('0x8')][_0xdfa4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc2219c,_0x3f80c9,_0x25babc){return new BPromise(function(_0x4513fd,_0x2cf122){return client[_0xdfa4('0xa')](_0xc2219c,_0x25babc)[_0xdfa4('0xb')](function(_0x5fd222){logger['info']('MailApplication,\x20%s,\x20%s',_0x3f80c9,_0xdfa4('0xc'));logger[_0xdfa4('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x3f80c9,_0xdfa4('0xc'),JSON['stringify'](_0x5fd222));if(_0x5fd222[_0xdfa4('0xe')]){if(_0x5fd222[_0xdfa4('0xe')][_0xdfa4('0xf')]===0x1f4){logger[_0xdfa4('0xe')](_0xdfa4('0x10'),_0x3f80c9,_0x5fd222[_0xdfa4('0xe')][_0xdfa4('0x11')]);return _0x2cf122(_0x5fd222[_0xdfa4('0xe')][_0xdfa4('0x11')]);}logger[_0xdfa4('0xe')](_0xdfa4('0x10'),_0x3f80c9,_0x5fd222[_0xdfa4('0xe')][_0xdfa4('0x11')]);return _0x4513fd(_0x5fd222['error'][_0xdfa4('0x11')]);}else{logger[_0xdfa4('0x12')](_0xdfa4('0x10'),_0x3f80c9,'request\x20sent');_0x4513fd(_0x5fd222[_0xdfa4('0x13')][_0xdfa4('0x11')]);}})['catch'](function(_0x9f8bd6){logger[_0xdfa4('0xe')](_0xdfa4('0x10'),_0x3f80c9,_0x9f8bd6);_0x2cf122(_0x9f8bd6);});});}exports[_0xdfa4('0x14')]=function(_0xed6924){var _0x4d6fe0=this;return new Promise(function(_0x5c2765,_0x280808){return db[_0xdfa4('0x15')][_0xdfa4('0x16')](_0xed6924['body'],{'raw':_0xed6924['options']?_0xed6924[_0xdfa4('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xed6924[_0xdfa4('0x17')]?_0xed6924[_0xdfa4('0x17')][_0xdfa4('0x18')]||null:null,'attributes':_0xed6924[_0xdfa4('0x17')]?_0xed6924[_0xdfa4('0x17')][_0xdfa4('0x19')]||null:null,'limit':_0xed6924[_0xdfa4('0x17')]?_0xed6924[_0xdfa4('0x17')]['limit']||null:null})[_0xdfa4('0xb')](function(_0x204f64){logger['info'](_0xdfa4('0x14'),_0xed6924);logger[_0xdfa4('0xd')]('UpdateMailApplication',_0xed6924,JSON[_0xdfa4('0x1a')](_0x204f64));_0x5c2765(_0x204f64);})[_0xdfa4('0x1b')](function(_0x46301b){logger['error'](_0xdfa4('0x14'),_0x46301b[_0xdfa4('0x11')],_0xed6924);_0x280808(_0x4d6fe0[_0xdfa4('0xe')](0x1f4,_0x46301b['message']));});});};
\ No newline at end of file
+var _0x82c2=['body','options','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','info','result','UpdateMailApplication','MailApplication','update'];(function(_0x2e21c0,_0x10a6e6){var _0x736e1e=function(_0x14cb9c){while(--_0x14cb9c){_0x2e21c0['push'](_0x2e21c0['shift']());}};_0x736e1e(++_0x10a6e6);}(_0x82c2,0x17a));var _0x282c=function(_0x4cb8e7,_0x2e1d22){_0x4cb8e7=_0x4cb8e7-0x0;var _0x3d0188=_0x82c2[_0x4cb8e7];return _0x3d0188;};'use strict';var _=require(_0x282c('0x0'));var util=require(_0x282c('0x1'));var moment=require(_0x282c('0x2'));var BPromise=require(_0x282c('0x3'));var rs=require(_0x282c('0x4'));var fs=require('fs');var Redis=require(_0x282c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x282c('0x6'));var logger=require(_0x282c('0x7'))(_0x282c('0x8'));var config=require(_0x282c('0x9'));var jayson=require(_0x282c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x28c08e,_0x307fb1,_0x5895d0){return new BPromise(function(_0x48612e,_0x2e8ffc){return client[_0x282c('0xb')](_0x28c08e,_0x5895d0)[_0x282c('0xc')](function(_0x1dc6ab){logger['info']('MailApplication,\x20%s,\x20%s',_0x307fb1,'request\x20sent');logger[_0x282c('0xd')](_0x282c('0xe'),_0x307fb1,'request\x20sent',JSON[_0x282c('0xf')](_0x1dc6ab));if(_0x1dc6ab[_0x282c('0x10')]){if(_0x1dc6ab[_0x282c('0x10')][_0x282c('0x11')]===0x1f4){logger[_0x282c('0x10')](_0x282c('0x12'),_0x307fb1,_0x1dc6ab[_0x282c('0x10')][_0x282c('0x13')]);return _0x2e8ffc(_0x1dc6ab[_0x282c('0x10')]['message']);}logger[_0x282c('0x10')]('MailApplication,\x20%s,\x20%s',_0x307fb1,_0x1dc6ab[_0x282c('0x10')][_0x282c('0x13')]);return _0x48612e(_0x1dc6ab['error'][_0x282c('0x13')]);}else{logger[_0x282c('0x14')](_0x282c('0x12'),_0x307fb1,'request\x20sent');_0x48612e(_0x1dc6ab[_0x282c('0x15')]['message']);}})['catch'](function(_0x3a5403){logger['error'](_0x282c('0x12'),_0x307fb1,_0x3a5403);_0x2e8ffc(_0x3a5403);});});}exports[_0x282c('0x16')]=function(_0x4a16b9){var _0x374184=this;return new Promise(function(_0xc7a79f,_0x581d55){return db[_0x282c('0x17')][_0x282c('0x18')](_0x4a16b9[_0x282c('0x19')],{'raw':_0x4a16b9[_0x282c('0x1a')]?_0x4a16b9[_0x282c('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a16b9[_0x282c('0x1a')]?_0x4a16b9[_0x282c('0x1a')][_0x282c('0x1b')]||null:null,'attributes':_0x4a16b9[_0x282c('0x1a')]?_0x4a16b9[_0x282c('0x1a')][_0x282c('0x1c')]||null:null,'limit':_0x4a16b9[_0x282c('0x1a')]?_0x4a16b9[_0x282c('0x1a')][_0x282c('0x1d')]||null:null})[_0x282c('0xc')](function(_0x2070c6){logger[_0x282c('0x14')](_0x282c('0x16'),_0x4a16b9);logger[_0x282c('0xd')](_0x282c('0x16'),_0x4a16b9,JSON[_0x282c('0xf')](_0x2070c6));_0xc7a79f(_0x2070c6);})[_0x282c('0x1e')](function(_0x2df539){logger[_0x282c('0x10')]('UpdateMailApplication',_0x2df539[_0x282c('0x13')],_0x4a16b9);_0x581d55(_0x374184[_0x282c('0x10')](0x1f4,_0x2df539[_0x282c('0x13')]));});});};
\ No newline at end of file
index b57f0f2..bb6575c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc93f=['Router','./mailInteraction.controller','get','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','put','/:id','mail','update','mailinteraction:destroy','destroy','delete','removeTags','exports'];(function(_0x4be503,_0x2f2549){var _0x2cdc68=function(_0xa6221c){while(--_0xa6221c){_0x4be503['push'](_0x4be503['shift']());}};_0x2cdc68(++_0x2f2549);}(_0xc93f,0x104));var _0xfc93=function(_0x123e23,_0x3e9870){_0x123e23=_0x123e23-0x0;var _0x369313=_0xc93f[_0x123e23];return _0x369313;};'use strict';var express=require('express');var router=express[_0xfc93('0x0')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0xfc93('0x1'));router[_0xfc93('0x2')]('/',auth[_0xfc93('0x3')](),controller['index']);router['get']('/describe',auth[_0xfc93('0x3')](),controller[_0xfc93('0x4')]);router[_0xfc93('0x2')]('/:id',auth['isAuthenticated'](),controller[_0xfc93('0x5')]);router[_0xfc93('0x2')](_0xfc93('0x6'),auth['isAuthenticated'](),controller[_0xfc93('0x7')]);router[_0xfc93('0x2')](_0xfc93('0x8'),auth['isAuthenticated'](),controller[_0xfc93('0x9')]);router[_0xfc93('0xa')]('/',auth['isAuthenticated'](),controller[_0xfc93('0xb')]);router[_0xfc93('0xa')](_0xfc93('0x6'),auth['isAuthenticated'](),controller[_0xfc93('0xc')]);router[_0xfc93('0xa')](_0xfc93('0xd'),auth[_0xfc93('0x3')](),interaction[_0xfc93('0xe')]('mail',_0xfc93('0xf')),controller[_0xfc93('0x10')]);router[_0xfc93('0x11')](_0xfc93('0x12'),auth[_0xfc93('0x3')](),interaction['tracked'](_0xfc93('0x13'),'mailinteraction:update'),controller[_0xfc93('0x14')]);router['delete'](_0xfc93('0x12'),auth[_0xfc93('0x3')](),interaction[_0xfc93('0xe')](_0xfc93('0x13'),_0xfc93('0x15')),controller[_0xfc93('0x16')]);router[_0xfc93('0x17')](_0xfc93('0xd'),auth[_0xfc93('0x3')](),controller[_0xfc93('0x18')]);module[_0xfc93('0x19')]=router;
\ No newline at end of file
+var _0x8424=['../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','tracked','mail','mailinteraction:addtags','addTags','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8424,0x132));var _0x4842=function(_0xa3480b,_0x3e8feb){_0xa3480b=_0xa3480b-0x0;var _0x33c28a=_0x8424[_0xa3480b];return _0x33c28a;};'use strict';var express=require(_0x4842('0x0'));var router=express[_0x4842('0x1')]();var auth=require(_0x4842('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x4842('0x3'));router[_0x4842('0x4')]('/',auth[_0x4842('0x5')](),controller[_0x4842('0x6')]);router[_0x4842('0x4')](_0x4842('0x7'),auth[_0x4842('0x5')](),controller[_0x4842('0x8')]);router[_0x4842('0x4')](_0x4842('0x9'),auth[_0x4842('0x5')](),controller[_0x4842('0xa')]);router[_0x4842('0x4')](_0x4842('0xb'),auth[_0x4842('0x5')](),controller['getMessages']);router[_0x4842('0x4')](_0x4842('0xc'),auth[_0x4842('0x5')](),controller[_0x4842('0xd')]);router[_0x4842('0xe')]('/',auth['isAuthenticated'](),controller[_0x4842('0xf')]);router[_0x4842('0xe')]('/:id/messages',auth[_0x4842('0x5')](),controller[_0x4842('0x10')]);router[_0x4842('0xe')]('/:id/tags',auth[_0x4842('0x5')](),interaction[_0x4842('0x11')](_0x4842('0x12'),_0x4842('0x13')),controller[_0x4842('0x14')]);router['put'](_0x4842('0x9'),auth[_0x4842('0x5')](),interaction[_0x4842('0x11')](_0x4842('0x12'),_0x4842('0x15')),controller[_0x4842('0x16')]);router[_0x4842('0x17')](_0x4842('0x9'),auth[_0x4842('0x5')](),interaction[_0x4842('0x11')](_0x4842('0x12'),_0x4842('0x18')),controller[_0x4842('0x19')]);router[_0x4842('0x17')]('/:id/tags',auth[_0x4842('0x5')](),controller[_0x4842('0x1a')]);module[_0x4842('0x1b')]=router;
\ No newline at end of file
index 8e2e9b4..ff3a6bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d50=['TEXT','long','DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x4886f7,_0x1b3735){var _0x2cb63c=function(_0x2b629e){while(--_0x2b629e){_0x4886f7['push'](_0x4886f7['shift']());}};_0x2cb63c(++_0x1b3735);}(_0x1d50,0x125));var _0x01d5=function(_0x573482,_0x19acd5){_0x573482=_0x573482-0x0;var _0x33b996=_0x1d50[_0x573482];return _0x33b996;};'use strict';var Sequelize=require(_0x01d5('0x0'));var iconv=require('iconv');module[_0x01d5('0x1')]={'closed':{'type':Sequelize[_0x01d5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x01d5('0x3')]},'thirdDisposition':{'type':Sequelize[_0x01d5('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x01d5('0x3')](0x1fe)},'to':{'type':Sequelize[_0x01d5('0x3')]},'cc':{'type':Sequelize[_0x01d5('0x4')](_0x01d5('0x5'))},'subject':{'type':Sequelize[_0x01d5('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x01d5('0x6')]},'substatus':{'type':Sequelize[_0x01d5('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x01d5('0x7')]('in',_0x01d5('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x01d5('0x7')]('in',_0x01d5('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x01d5('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2df4=['STRING','TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0x7b7f99,_0x337530){var _0x1ec4e5=function(_0x3be22d){while(--_0x3be22d){_0x7b7f99['push'](_0x7b7f99['shift']());}};_0x1ec4e5(++_0x337530);}(_0x2df4,0x13b));var _0x42df=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0x2df4[_0xc0d9bc];return _0x32ff73;};'use strict';var Sequelize=require(_0x42df('0x0'));var iconv=require(_0x42df('0x1'));module[_0x42df('0x2')]={'closed':{'type':Sequelize[_0x42df('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x42df('0x4')]},'disposition':{'type':Sequelize[_0x42df('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x42df('0x5')]},'note':{'type':Sequelize[_0x42df('0x5')]},'inReplyTo':{'type':Sequelize[_0x42df('0x5')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x42df('0x6')](_0x42df('0x7'))},'subject':{'type':Sequelize[_0x42df('0x6')]()},'attach':{'type':Sequelize[_0x42df('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x42df('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x42df('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x42df('0x8')]('in',_0x42df('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x42df('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x42df('0x8')]('in',_0x42df('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 0b73294..9ce9053 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','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','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','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','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb10b,0x12a));var _0xbb10=function(_0x32c8c2,_0x5e0ab0){_0x32c8c2=_0x32c8c2-0x0;var _0x16ed42=_0xb10b[_0x32c8c2];return _0x16ed42;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));};
\ No newline at end of file
+var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','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','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','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','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xb10b,0x12a));var _0xbb10=function(_0xe1770a,_0x4fc5d6){_0xe1770a=_0xe1770a-0x0;var _0x3e6274=_0xb10b[_0xe1770a];return _0x3e6274;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));};
\ No newline at end of file
index 355b2d5..796953d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4704=['remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hook','exports','events','MailInteraction','../../mysqldb','setMaxListeners','save','update'];(function(_0x704ab2,_0x2af0f5){var _0x52cbc2=function(_0x25387e){while(--_0x25387e){_0x704ab2['push'](_0x704ab2['shift']());}};_0x52cbc2(++_0x2af0f5);}(_0x4704,0x8a));var _0x4470=function(_0x9d9f9e,_0x52a029){_0x9d9f9e=_0x9d9f9e-0x0;var _0x48cb13=_0x4704[_0x9d9f9e];return _0x48cb13;};'use strict';var EventEmitter=require(_0x4470('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x4470('0x1')];var MailMessage=require(_0x4470('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4470('0x3')](0x0);var events={'afterCreate':_0x4470('0x4'),'afterUpdate':_0x4470('0x5'),'afterDestroy':_0x4470('0x6')};function emitEvent(_0x1ab609){return function(_0x3197ab,_0x399283,_0x2806f7){_0x3197ab[_0x4470('0x7')]({'attributes':['id'],'raw':!![]})[_0x4470('0x8')](function(_0x51b9cb){_0x3197ab[_0x4470('0x9')](_0x4470('0xa'),_0x51b9cb[_0x4470('0xb')](function(_0x3e8f0f){return{'id':_0x3e8f0f['id']};}));return MailMessage[_0x4470('0xc')]({'where':{'MailInteractionId':_0x3197ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4470('0x8')](function(_0x16c4e9){_0x3197ab[_0x4470('0x9')]('unreadMessages',_0x16c4e9[_0x4470('0xd')]);MailInteractionEvents[_0x4470('0xe')](_0x1ab609+':'+_0x3197ab['id'],_0x3197ab);MailInteractionEvents[_0x4470('0xe')](_0x1ab609,_0x3197ab);_0x2806f7(null);})[_0x4470('0xf')](_0x2806f7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x4470('0x10')](e,emitEvent(event));}}module[_0x4470('0x11')]=MailInteractionEvents;
\ No newline at end of file
+var _0x7308=['events','../../mysqldb','MailInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x509a50,_0x2dd339){var _0x15d652=function(_0x6f930d){while(--_0x6f930d){_0x509a50['push'](_0x509a50['shift']());}};_0x15d652(++_0x2dd339);}(_0x7308,0x1d4));var _0x8730=function(_0x5bfc3b,_0x5e7b27){_0x5bfc3b=_0x5bfc3b-0x0;var _0xb01a72=_0x7308[_0x5bfc3b];return _0xb01a72;};'use strict';var EventEmitter=require(_0x8730('0x0'));var MailInteraction=require(_0x8730('0x1'))['db'][_0x8730('0x2')];var MailMessage=require(_0x8730('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x8730('0x3')](0x0);var events={'afterCreate':_0x8730('0x4'),'afterUpdate':_0x8730('0x5'),'afterDestroy':_0x8730('0x6')};function emitEvent(_0x3cde18){return function(_0x5f42c0,_0xcdaf57,_0x26f215){_0x5f42c0[_0x8730('0x7')]({'attributes':['id'],'raw':!![]})[_0x8730('0x8')](function(_0x5bb56b){_0x5f42c0[_0x8730('0x9')](_0x8730('0xa'),_0x5bb56b['map'](function(_0x1bbf72){return{'id':_0x1bbf72['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x5f42c0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8730('0x8')](function(_0x50c98c){_0x5f42c0[_0x8730('0x9')](_0x8730('0xb'),_0x50c98c[_0x8730('0xc')]);MailInteractionEvents[_0x8730('0xd')](_0x3cde18+':'+_0x5f42c0['id'],_0x5f42c0);MailInteractionEvents[_0x8730('0xd')](_0x3cde18,_0x5f42c0);_0x26f215(null);})[_0x8730('0xe')](_0x26f215(null));};}for(var e in events){if(events[_0x8730('0xf')](e)){var event=events[e];MailInteraction[_0x8730('0x10')](e,emitEvent(event));}}module[_0x8730('0x11')]=MailInteractionEvents;
\ No newline at end of file
index 80c9c4e..1d31de5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc40d=['mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','closedAt','models','get','closed','MailMessage','update','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define'];(function(_0x422875,_0x55aeb2){var _0x55fc51=function(_0x5e6daf){while(--_0x5e6daf){_0x422875['push'](_0x422875['shift']());}};_0x55fc51(++_0x55aeb2);}(_0xc40d,0xdb));var _0xdc40=function(_0x5ce20f,_0x426943){_0x5ce20f=_0x5ce20f-0x0;var _0x5d6396=_0xc40d[_0x5ce20f];return _0x5d6396;};'use strict';var _=require(_0xdc40('0x0'));var util=require(_0xdc40('0x1'));var logger=require(_0xdc40('0x2'))(_0xdc40('0x3'));var moment=require(_0xdc40('0x4'));var BPromise=require(_0xdc40('0x5'));var rp=require(_0xdc40('0x6'));var fs=require('fs');var path=require(_0xdc40('0x7'));var rimraf=require(_0xdc40('0x8'));var config=require(_0xdc40('0x9'));var attributes=require(_0xdc40('0xa'));module[_0xdc40('0xb')]=function(_0x26822a,_0x3b2f41){return _0x26822a[_0xdc40('0xc')]('MailInteraction',attributes,{'tableName':_0xdc40('0xd'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xdc40('0xe'),'to'],'type':_0xdc40('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x38296b,_0x12c1f0,_0x512f12){if(_0x38296b[_0xdc40('0x10')]){_0x38296b[_0xdc40('0x11')]=moment()[_0xdc40('0x12')](_0xdc40('0x13'));}if(_0x38296b['closed']){_0x38296b['closedAt']=moment()[_0xdc40('0x12')](_0xdc40('0x13'));}_0x512f12(null,_0x12c1f0);},'beforeUpdate':function(_0x2e0279,_0x517e9a,_0x17369b){if(_0x2e0279[_0xdc40('0x14')](_0xdc40('0x10'))){_0x2e0279['substatusAt']=_0x2e0279[_0xdc40('0x10')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x2e0279[_0xdc40('0x14')]('closed')){_0x2e0279[_0xdc40('0x15')]=moment()['format'](_0xdc40('0x13'));_0x2e0279[_0xdc40('0x10')]=null;_0x2e0279[_0xdc40('0x11')]=null;}_0x17369b(null,_0x2e0279);},'afterUpdate':function(_0x14f357,_0x5f441e,_0x1b31f0){var _0x580719=_0x26822a[_0xdc40('0x16')];var _0x3aa15d=_0x14f357[_0xdc40('0x17')]({'plain':!![]});if(_0x3aa15d[_0xdc40('0x18')]){return _0x580719[_0xdc40('0x19')][_0xdc40('0x1a')]({'read':!![]},{'where':{'MailInteractionId':_0x3aa15d['id']}})['then'](function(){_0x1b31f0();})['catch'](function(_0x442295){_0x1b31f0(_0x442295);});}else{_0x1b31f0();}}},'charset':_0xdc40('0x1b'),'collate':_0xdc40('0x1c')});};
\ No newline at end of file
+var _0xa90c=['path','../../config/environment','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','MailMessage','then','catch','utf8mb4','lodash','../../config/logger','api','moment','bluebird'];(function(_0x36d82b,_0x29793d){var _0x2a8373=function(_0x3a81e2){while(--_0x3a81e2){_0x36d82b['push'](_0x36d82b['shift']());}};_0x2a8373(++_0x29793d);}(_0xa90c,0x140));var _0xca90=function(_0x1445cf,_0x54d819){_0x1445cf=_0x1445cf-0x0;var _0x35e077=_0xa90c[_0x1445cf];return _0x35e077;};'use strict';var _=require(_0xca90('0x0'));var util=require('util');var logger=require(_0xca90('0x1'))(_0xca90('0x2'));var moment=require(_0xca90('0x3'));var BPromise=require(_0xca90('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca90('0x5'));var rimraf=require('rimraf');var config=require(_0xca90('0x6'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x5aa605,_0x58f65d){return _0x5aa605[_0xca90('0x7')](_0xca90('0x8'),attributes,{'tableName':_0xca90('0x9'),'paranoid':![],'indexes':[{'name':_0xca90('0xa'),'fields':[_0xca90('0xb'),'to'],'type':_0xca90('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x418b6f,_0x1875e5,_0xa2a032){if(_0x418b6f[_0xca90('0xd')]){_0x418b6f[_0xca90('0xe')]=moment()['format'](_0xca90('0xf'));}if(_0x418b6f[_0xca90('0x10')]){_0x418b6f[_0xca90('0x11')]=moment()[_0xca90('0x12')](_0xca90('0xf'));}_0xa2a032(null,_0x1875e5);},'beforeUpdate':function(_0x5383ff,_0x4831cb,_0x176058){if(_0x5383ff[_0xca90('0x13')](_0xca90('0xd'))){_0x5383ff[_0xca90('0xe')]=_0x5383ff[_0xca90('0xd')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x5383ff[_0xca90('0x13')](_0xca90('0x10'))){_0x5383ff[_0xca90('0x11')]=moment()[_0xca90('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x5383ff[_0xca90('0xd')]=null;_0x5383ff[_0xca90('0xe')]=null;}_0x176058(null,_0x5383ff);},'afterUpdate':function(_0x16141e,_0x1d0a92,_0x277b61){var _0x1794cd=_0x5aa605[_0xca90('0x14')];var _0x1f893e=_0x16141e['get']({'plain':!![]});if(_0x1f893e['closed']){return _0x1794cd[_0xca90('0x15')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x1f893e['id']}})[_0xca90('0x16')](function(){_0x277b61();})[_0xca90('0x17')](function(_0xf67829){_0x277b61(_0xf67829);});}else{_0x277b61();}}},'charset':_0xca90('0x18'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 55cd9c1..6c5ba5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62a7=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailInteraction','update','body','options','raw','attributes','limit','UpdateMailInteraction','debug','where','addTags','ids','omit','spread','AddTags'];(function(_0x3efe4a,_0x22b55c){var _0x11e61e=function(_0x4cd240){while(--_0x4cd240){_0x3efe4a['push'](_0x3efe4a['shift']());}};_0x11e61e(++_0x22b55c);}(_0x62a7,0x84));var _0x762a=function(_0x53f3ad,_0x39163e){_0x53f3ad=_0x53f3ad-0x0;var _0x48b203=_0x62a7[_0x53f3ad];return _0x48b203;};'use strict';var _=require('lodash');var util=require(_0x762a('0x0'));var moment=require(_0x762a('0x1'));var BPromise=require(_0x762a('0x2'));var rs=require(_0x762a('0x3'));var fs=require('fs');var Redis=require(_0x762a('0x4'));var db=require(_0x762a('0x5'))['db'];var utils=require(_0x762a('0x6'));var logger=require(_0x762a('0x7'))(_0x762a('0x8'));var config=require('../../config/environment');var jayson=require(_0x762a('0x9'));var client=jayson[_0x762a('0xa')]['http']({'port':0x232a});config[_0x762a('0xb')]=_[_0x762a('0xc')](config[_0x762a('0xb')],{'host':_0x762a('0xd'),'port':0x18eb});var socket=require(_0x762a('0xe'))(new Redis(config[_0x762a('0xb')]));require(_0x762a('0xf'))[_0x762a('0x10')](socket);function respondWithRpcPromise(_0x4fb239,_0x44ddf8,_0x5c83ee){return new BPromise(function(_0x2c279a,_0x2ce08c){return client[_0x762a('0x11')](_0x4fb239,_0x5c83ee)[_0x762a('0x12')](function(_0x393371){logger[_0x762a('0x13')](_0x762a('0x14'),_0x44ddf8,_0x762a('0x15'));logger['debug'](_0x762a('0x16'),_0x44ddf8,_0x762a('0x15'),JSON[_0x762a('0x17')](_0x393371));if(_0x393371[_0x762a('0x18')]){if(_0x393371[_0x762a('0x18')][_0x762a('0x19')]===0x1f4){logger[_0x762a('0x18')](_0x762a('0x14'),_0x44ddf8,_0x393371[_0x762a('0x18')]['message']);return _0x2ce08c(_0x393371[_0x762a('0x18')]['message']);}logger[_0x762a('0x18')](_0x762a('0x14'),_0x44ddf8,_0x393371[_0x762a('0x18')][_0x762a('0x1a')]);return _0x2c279a(_0x393371[_0x762a('0x18')][_0x762a('0x1a')]);}else{logger[_0x762a('0x13')](_0x762a('0x14'),_0x44ddf8,'request\x20sent');_0x2c279a(_0x393371[_0x762a('0x1b')][_0x762a('0x1a')]);}})[_0x762a('0x1c')](function(_0x37bd4){logger[_0x762a('0x18')](_0x762a('0x14'),_0x44ddf8,_0x37bd4);_0x2ce08c(_0x37bd4);});});}exports['UpdateMailInteraction']=function(_0x117ab9){var _0xcab694=this;return new Promise(function(_0x2be2d7,_0x5f140f){return db[_0x762a('0x1d')][_0x762a('0x1e')](_0x117ab9[_0x762a('0x1f')],{'raw':_0x117ab9[_0x762a('0x20')]?_0x117ab9[_0x762a('0x20')][_0x762a('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x117ab9[_0x762a('0x20')]?_0x117ab9[_0x762a('0x20')]['where']||null:null,'attributes':_0x117ab9[_0x762a('0x20')]?_0x117ab9[_0x762a('0x20')][_0x762a('0x22')]||null:null,'limit':_0x117ab9['options']?_0x117ab9['options'][_0x762a('0x23')]||null:null})['then'](function(_0x38b378){logger[_0x762a('0x13')](_0x762a('0x24'),_0x117ab9);logger[_0x762a('0x25')]('UpdateMailInteraction',_0x117ab9,JSON[_0x762a('0x17')](_0x38b378));_0x2be2d7(_0x38b378);})[_0x762a('0x1c')](function(_0x3141a1){logger[_0x762a('0x18')](_0x762a('0x24'),_0x3141a1['message'],_0x117ab9);_0x5f140f(_0xcab694[_0x762a('0x18')](0x1f4,_0x3141a1[_0x762a('0x1a')]));});});};exports['AddTagsToMailInteraction']=function(_0x266544){return new Promise(function(_0x1bb9c5,_0xaa1ce4){return db[_0x762a('0x1d')]['find']({'where':_0x266544[_0x762a('0x20')]?_0x266544[_0x762a('0x20')][_0x762a('0x26')]||null:null})[_0x762a('0x12')](function(_0x35d1a9){if(_0x35d1a9){return _0x35d1a9[_0x762a('0x27')](_0x266544[_0x762a('0x1f')][_0x762a('0x28')],_[_0x762a('0x29')](_0x266544[_0x762a('0x1f')],[_0x762a('0x28'),'id'])||{});}})[_0x762a('0x2a')](function(_0x12bd7d){logger[_0x762a('0x13')](_0x762a('0x2b'),_0x266544);logger[_0x762a('0x25')](_0x762a('0x2b'),_0x266544,JSON[_0x762a('0x17')](_0x12bd7d));_0x1bb9c5(_0x12bd7d);})[_0x762a('0x1c')](function(_0x525fc9){logger['error']('AddTags',_0x525fc9['message'],_0x266544);_0xaa1ce4(_this[_0x762a('0x18')](0x1f4,_0x525fc9['message']));});});};
\ No newline at end of file
+var _0x1a0e=['omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailInteraction','body','options','raw','where','attributes','limit','UpdateMailInteraction','stringify','find','addTags'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x1a0e,0x1c6));var _0xe1a0=function(_0x2b8347,_0x14e3f2){_0x2b8347=_0x2b8347-0x0;var _0x15e93e=_0x1a0e[_0x2b8347];return _0x15e93e;};'use strict';var _=require(_0xe1a0('0x0'));var util=require(_0xe1a0('0x1'));var moment=require(_0xe1a0('0x2'));var BPromise=require(_0xe1a0('0x3'));var rs=require(_0xe1a0('0x4'));var fs=require('fs');var Redis=require(_0xe1a0('0x5'));var db=require(_0xe1a0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe1a0('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe1a0('0x8')][_0xe1a0('0x9')]({'port':0x232a});config[_0xe1a0('0xa')]=_[_0xe1a0('0xb')](config[_0xe1a0('0xa')],{'host':_0xe1a0('0xc'),'port':0x18eb});var socket=require(_0xe1a0('0xd'))(new Redis(config[_0xe1a0('0xa')]));require(_0xe1a0('0xe'))[_0xe1a0('0xf')](socket);function respondWithRpcPromise(_0x1cbcc4,_0x3728d9,_0x6b25aa){return new BPromise(function(_0x4f1099,_0x35f378){return client['request'](_0x1cbcc4,_0x6b25aa)[_0xe1a0('0x10')](function(_0x1a85d5){logger[_0xe1a0('0x11')](_0xe1a0('0x12'),_0x3728d9,_0xe1a0('0x13'));logger[_0xe1a0('0x14')](_0xe1a0('0x15'),_0x3728d9,_0xe1a0('0x13'),JSON['stringify'](_0x1a85d5));if(_0x1a85d5[_0xe1a0('0x16')]){if(_0x1a85d5['error'][_0xe1a0('0x17')]===0x1f4){logger[_0xe1a0('0x16')]('MailInteraction,\x20%s,\x20%s',_0x3728d9,_0x1a85d5[_0xe1a0('0x16')][_0xe1a0('0x18')]);return _0x35f378(_0x1a85d5[_0xe1a0('0x16')][_0xe1a0('0x18')]);}logger[_0xe1a0('0x16')]('MailInteraction,\x20%s,\x20%s',_0x3728d9,_0x1a85d5[_0xe1a0('0x16')][_0xe1a0('0x18')]);return _0x4f1099(_0x1a85d5[_0xe1a0('0x16')][_0xe1a0('0x18')]);}else{logger[_0xe1a0('0x11')](_0xe1a0('0x12'),_0x3728d9,_0xe1a0('0x13'));_0x4f1099(_0x1a85d5[_0xe1a0('0x19')][_0xe1a0('0x18')]);}})[_0xe1a0('0x1a')](function(_0xdd8c28){logger[_0xe1a0('0x16')]('MailInteraction,\x20%s,\x20%s',_0x3728d9,_0xdd8c28);_0x35f378(_0xdd8c28);});});}exports['UpdateMailInteraction']=function(_0x5c3831){var _0xc3dcb4=this;return new Promise(function(_0x470b87,_0x2e107f){return db[_0xe1a0('0x1b')]['update'](_0x5c3831[_0xe1a0('0x1c')],{'raw':_0x5c3831[_0xe1a0('0x1d')]?_0x5c3831['options'][_0xe1a0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c3831[_0xe1a0('0x1d')]?_0x5c3831['options'][_0xe1a0('0x1f')]||null:null,'attributes':_0x5c3831[_0xe1a0('0x1d')]?_0x5c3831[_0xe1a0('0x1d')][_0xe1a0('0x20')]||null:null,'limit':_0x5c3831[_0xe1a0('0x1d')]?_0x5c3831[_0xe1a0('0x1d')][_0xe1a0('0x21')]||null:null})[_0xe1a0('0x10')](function(_0x4993d2){logger[_0xe1a0('0x11')](_0xe1a0('0x22'),_0x5c3831);logger[_0xe1a0('0x14')](_0xe1a0('0x22'),_0x5c3831,JSON[_0xe1a0('0x23')](_0x4993d2));_0x470b87(_0x4993d2);})[_0xe1a0('0x1a')](function(_0x30b763){logger[_0xe1a0('0x16')](_0xe1a0('0x22'),_0x30b763[_0xe1a0('0x18')],_0x5c3831);_0x2e107f(_0xc3dcb4[_0xe1a0('0x16')](0x1f4,_0x30b763[_0xe1a0('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x4d46cd){return new Promise(function(_0x3e9d17,_0x45fd73){return db['MailInteraction'][_0xe1a0('0x24')]({'where':_0x4d46cd[_0xe1a0('0x1d')]?_0x4d46cd[_0xe1a0('0x1d')]['where']||null:null})[_0xe1a0('0x10')](function(_0x2aa1ea){if(_0x2aa1ea){return _0x2aa1ea[_0xe1a0('0x25')](_0x4d46cd[_0xe1a0('0x1c')]['ids'],_[_0xe1a0('0x26')](_0x4d46cd['body'],[_0xe1a0('0x27'),'id'])||{});}})['spread'](function(_0x2c790b){logger[_0xe1a0('0x11')](_0xe1a0('0x28'),_0x4d46cd);logger[_0xe1a0('0x14')]('AddTags',_0x4d46cd,JSON['stringify'](_0x2c790b));_0x3e9d17(_0x2c790b);})[_0xe1a0('0x1a')](function(_0x3f78f7){logger[_0xe1a0('0x16')](_0xe1a0('0x28'),_0x3f78f7[_0xe1a0('0x18')],_0x4d46cd);_0x45fd73(_this[_0xe1a0('0x16')](0x1f4,_0x3f78f7[_0xe1a0('0x18')]));});});};
\ No newline at end of file
index c77deb9..b16eed3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9598=['register','update','emit','removeListener'];(function(_0x1074fa,_0x5850ec){var _0x5d0478=function(_0x52b748){while(--_0x52b748){_0x1074fa['push'](_0x1074fa['shift']());}};_0x5d0478(++_0x5850ec);}(_0x9598,0x149));var _0x8959=function(_0x225bbd,_0x378910){_0x225bbd=_0x225bbd-0x0;var _0x44fd36=_0x9598[_0x225bbd];return _0x44fd36;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save','remove',_0x8959('0x0')];function createListener(_0x5824e2,_0x155b39){return function(_0x4fe795){_0x155b39[_0x8959('0x1')](_0x5824e2,_0x4fe795);};}function removeListener(_0x51cc98,_0x558e8b){return function(){MailInteractionEvents[_0x8959('0x2')](_0x51cc98,_0x558e8b);};}exports[_0x8959('0x3')]=function(_0x25dd8f){for(var _0x222db5=0x0,_0x33e9fa=events['length'];_0x222db5<_0x33e9fa;_0x222db5++){var _0x66f746=events[_0x222db5];var _0x2b04fc=createListener('mailInteraction:'+_0x66f746,_0x25dd8f);MailInteractionEvents['on'](_0x66f746,_0x2b04fc);}};
\ No newline at end of file
+var _0x10e3=['update','emit','register','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x10e3,0x12a));var _0x310e=function(_0x2d0f87,_0x23395a){_0x2d0f87=_0x2d0f87-0x0;var _0x47bea0=_0x10e3[_0x2d0f87];return _0x47bea0;};'use strict';var MailInteractionEvents=require(_0x310e('0x0'));var events=[_0x310e('0x1'),_0x310e('0x2'),_0x310e('0x3')];function createListener(_0x7be364,_0x2db449){return function(_0x114925){_0x2db449[_0x310e('0x4')](_0x7be364,_0x114925);};}function removeListener(_0x8ea80,_0x10e367){return function(){MailInteractionEvents['removeListener'](_0x8ea80,_0x10e367);};}exports[_0x310e('0x5')]=function(_0x508f66){for(var _0x1f223b=0x0,_0x1c0c15=events['length'];_0x1f223b<_0x1c0c15;_0x1f223b++){var _0x590a50=events[_0x1f223b];var _0x568919=createListener(_0x310e('0x6')+_0x590a50,_0x508f66);MailInteractionEvents['on'](_0x590a50,_0x568919);}};
\ No newline at end of file
index e4a54fe..57472e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85cf=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','download','tracked','mail','create','put','/:id/accept','accept','/:id/reject','reject','destroy','util','path'];(function(_0x50b65a,_0x1d594c){var _0x41e568=function(_0x221788){while(--_0x221788){_0x50b65a['push'](_0x50b65a['shift']());}};_0x41e568(++_0x1d594c);}(_0x85cf,0x76));var _0xf85c=function(_0xa91111,_0x22688c){_0xa91111=_0xa91111-0x0;var _0x235b0e=_0x85cf[_0xa91111];return _0x235b0e;};'use strict';var multer=require('multer');var util=require(_0xf85c('0x0'));var path=require(_0xf85c('0x1'));var timeout=require(_0xf85c('0x2'));var express=require(_0xf85c('0x3'));var router=express[_0xf85c('0x4')]();var fs_extra=require(_0xf85c('0x5'));var auth=require(_0xf85c('0x6'));var interaction=require(_0xf85c('0x7'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xf85c('0x8')]('/',auth[_0xf85c('0x9')](),controller['index']);router[_0xf85c('0x8')](_0xf85c('0xa'),auth[_0xf85c('0x9')](),controller[_0xf85c('0xb')]);router[_0xf85c('0x8')](_0xf85c('0xc'),auth['isAuthenticated'](),controller[_0xf85c('0xd')]);router[_0xf85c('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xf85c('0xe')]);router['post']('/',auth[_0xf85c('0x9')](),interaction[_0xf85c('0xf')](_0xf85c('0x10'),'mailmessage:create'),controller[_0xf85c('0x11')]);router[_0xf85c('0x12')](_0xf85c('0xc'),auth[_0xf85c('0x9')](),controller['update']);router[_0xf85c('0x12')](_0xf85c('0x13'),auth[_0xf85c('0x9')](),controller[_0xf85c('0x14')]);router['put'](_0xf85c('0x15'),auth['isAuthenticated'](),controller[_0xf85c('0x16')]);router['delete'](_0xf85c('0xc'),auth['isAuthenticated'](),controller[_0xf85c('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x3c8c=['mailmessage:create','put','update','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','post','mail'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0x3c8c,0xb0));var _0xc3c8=function(_0x38d945,_0x957fa5){_0x38d945=_0x38d945-0x0;var _0x42e270=_0x3c8c[_0x38d945];return _0x42e270;};'use strict';var multer=require(_0xc3c8('0x0'));var util=require(_0xc3c8('0x1'));var path=require(_0xc3c8('0x2'));var timeout=require(_0xc3c8('0x3'));var express=require('express');var router=express[_0xc3c8('0x4')]();var fs_extra=require(_0xc3c8('0x5'));var auth=require(_0xc3c8('0x6'));var interaction=require(_0xc3c8('0x7'));var config=require(_0xc3c8('0x8'));var controller=require('./mailMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc3c8('0x9')]);router[_0xc3c8('0xa')](_0xc3c8('0xb'),auth['isAuthenticated'](),controller[_0xc3c8('0xc')]);router[_0xc3c8('0xa')](_0xc3c8('0xd'),auth[_0xc3c8('0xe')](),controller[_0xc3c8('0xf')]);router[_0xc3c8('0xa')](_0xc3c8('0x10'),auth[_0xc3c8('0xe')](),controller[_0xc3c8('0x11')]);router[_0xc3c8('0x12')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xc3c8('0x13'),_0xc3c8('0x14')),controller['create']);router[_0xc3c8('0x15')]('/:id',auth[_0xc3c8('0xe')](),controller[_0xc3c8('0x16')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xc3c8('0x17')]);router[_0xc3c8('0x15')]('/:id/reject',auth[_0xc3c8('0xe')](),controller[_0xc3c8('0x18')]);router[_0xc3c8('0x19')](_0xc3c8('0xd'),auth[_0xc3c8('0xe')](),controller[_0xc3c8('0x1a')]);module[_0xc3c8('0x1b')]=router;
\ No newline at end of file
index 155d57f..4b5d607 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9238=['exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','INTEGER','DATE','Email','Chat','sequelize'];(function(_0x238c64,_0x578b99){var _0x51650b=function(_0x2a0fd9){while(--_0x2a0fd9){_0x238c64['push'](_0x238c64['shift']());}};_0x51650b(++_0x578b99);}(_0x9238,0x1ed));var _0x8923=function(_0x2eee90,_0x27cb14){_0x2eee90=_0x2eee90-0x0;var _0x6e2c21=_0x9238[_0x2eee90];return _0x6e2c21;};'use strict';var Sequelize=require(_0x8923('0x0'));var _=require('lodash');module[_0x8923('0x1')]={'body':{'type':Sequelize[_0x8923('0x2')](_0x8923('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x8923('0x2')](_0x8923('0x4'))},'read':{'type':Sequelize[_0x8923('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8923('0x6')]('in',_0x8923('0x7')),'defaultValue':_0x8923('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x8923('0x8')]},'to':{'type':Sequelize[_0x8923('0x2')](_0x8923('0x3'))},'cc':{'type':Sequelize[_0x8923('0x2')](_0x8923('0x3'))},'bcc':{'type':Sequelize[_0x8923('0x2')](_0x8923('0x3'))},'subject':{'type':Sequelize[_0x8923('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x8923('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8923('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8923('0xa')]},'originTo':{'type':Sequelize[_0x8923('0x2')](_0x8923('0x3'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x8923('0x6')](_0x8923('0xb'),_0x8923('0xc')),'defaultValue':_0x8923('0xb'),'allowNull':![]}};
\ No newline at end of file
+var _0x20e8=['INTEGER','Email','Chat','sequelize','lodash','exports','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x3e8cc2,_0x5dc53f){var _0x20400a=function(_0x12f5c2){while(--_0x12f5c2){_0x3e8cc2['push'](_0x3e8cc2['shift']());}};_0x20400a(++_0x5dc53f);}(_0x20e8,0x6b));var _0x820e=function(_0x33873f,_0x53b06b){_0x33873f=_0x33873f-0x0;var _0x376692=_0x20e8[_0x33873f];return _0x376692;};'use strict';var Sequelize=require(_0x820e('0x0'));var _=require(_0x820e('0x1'));module[_0x820e('0x2')]={'body':{'type':Sequelize[_0x820e('0x3')](_0x820e('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x820e('0x3')]('medium')},'read':{'type':Sequelize[_0x820e('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x820e('0x6')]('in',_0x820e('0x7')),'defaultValue':_0x820e('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x820e('0x8')](0x1fe)},'from':{'type':Sequelize[_0x820e('0x8')]},'to':{'type':Sequelize[_0x820e('0x3')]('long')},'cc':{'type':Sequelize['TEXT'](_0x820e('0x4'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x820e('0x3')]},'sentAt':{'type':Sequelize[_0x820e('0x9')]},'attach':{'type':Sequelize[_0x820e('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x820e('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x820e('0x3')](_0x820e('0x4'))},'originCc':{'type':Sequelize[_0x820e('0x3')](_0x820e('0x4'))},'originChannel':{'type':Sequelize[_0x820e('0x6')](_0x820e('0xb'),_0x820e('0xc')),'defaultValue':'Email','allowNull':![]}};
\ No newline at end of file
index 95532ae..ff41942 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0097=['json','undefined','limit','count','offset','update','end','stack','name','send','index','map','MailMessage','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','includeAll','findAll','rows','show','length','find','body','params','destroy','describe','create','out','split','MailAccount','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','user','pass','service','attachments','basename','ListId','SendMail','messageId','format','mail','read','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','interface','SIP/%s','rejectmessage','unix','toString','root','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','join','existsSync','push','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x0097,0x1c4));var _0x7009=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0097[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7009('0x0'));var moment=require(_0x7009('0x1'));var BPromise=require(_0x7009('0x2'));var util=require('util');var path=require(_0x7009('0x3'));var fs=require('fs');var _=require(_0x7009('0x4'));var Redis=require(_0x7009('0x5'));var htmlToText=require(_0x7009('0x6'));var qs=require(_0x7009('0x7'));var logger=require('../../config/logger')(_0x7009('0x8'));var interaction_log=require(_0x7009('0x9'))(_0x7009('0xa'));var config=require('../../config/environment');var db=require(_0x7009('0xb'))['db'];config[_0x7009('0xc')]=_[_0x7009('0xd')](config[_0x7009('0xc')],{'host':_0x7009('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7009('0xc')]));require('./mailMessage.socket')[_0x7009('0xf')](socket);var jayson=require(_0x7009('0x10'));var client=jayson[_0x7009('0x11')][_0x7009('0x12')]({'port':0x232c});var client9003=jayson['client'][_0x7009('0x12')]({'port':0x232b});var client9002=jayson[_0x7009('0x11')][_0x7009('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x362cbf,_0x102f19,_0x2c8427,_0x5f3c41){return new BPromise(function(_0x4f16b4,_0x395048){var _0x26ddbf=_0x5f3c41||client;return _0x26ddbf[_0x7009('0x13')](_0x362cbf,_0x2c8427)[_0x7009('0x14')](function(_0x44ffa1){logger[_0x7009('0x15')](_0x7009('0x16'),_0x102f19,_0x7009('0x17'));logger[_0x7009('0x18')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x102f19,_0x7009('0x17'),JSON['stringify'](_0x44ffa1));if(_0x44ffa1[_0x7009('0x19')]){if(_0x44ffa1[_0x7009('0x19')][_0x7009('0x1a')]===0x1f4){logger[_0x7009('0x19')](_0x7009('0x16'),_0x102f19,_0x44ffa1[_0x7009('0x19')][_0x7009('0x1b')]);return _0x395048(_0x44ffa1[_0x7009('0x19')][_0x7009('0x1b')]);}logger[_0x7009('0x19')](_0x7009('0x16'),_0x102f19,_0x44ffa1[_0x7009('0x19')][_0x7009('0x1b')]);return _0x4f16b4(_0x44ffa1[_0x7009('0x19')][_0x7009('0x1b')]);}else{logger[_0x7009('0x15')]('MailMessage,\x20%s,\x20%s',_0x102f19,_0x7009('0x17'));_0x4f16b4(_0x44ffa1[_0x7009('0x1c')][_0x7009('0x1b')]);}})[_0x7009('0x1d')](function(_0x405b71){logger[_0x7009('0x19')](_0x7009('0x16'),_0x102f19,_0x405b71);_0x395048(_0x405b71);});});}function respondWithResult(_0x14fc67,_0x277e6e){_0x277e6e=_0x277e6e||0xc8;return function(_0x1ab40d){if(_0x1ab40d){return _0x14fc67[_0x7009('0x1e')](_0x277e6e)[_0x7009('0x1f')](_0x1ab40d);}};}function respondWithFilteredResult(_0x39a227,_0x244dea){return function(_0x1622b6){if(_0x1622b6){var _0x466d7f=typeof _0x244dea['offset']===_0x7009('0x20')&&typeof _0x244dea[_0x7009('0x21')]===_0x7009('0x20');var _0x2efe95=_0x1622b6[_0x7009('0x22')];var _0x4a8aa1=_0x466d7f?0x0:_0x244dea[_0x7009('0x23')];var _0xa2c73b=_0x466d7f?_0x1622b6['count']:_0x244dea[_0x7009('0x23')]+_0x244dea[_0x7009('0x21')];var _0x4ce027;if(_0xa2c73b>=_0x2efe95){_0xa2c73b=_0x2efe95;_0x4ce027=0xc8;}else{_0x4ce027=0xce;}_0x39a227[_0x7009('0x1e')](_0x4ce027);return _0x39a227['set']('Content-Range',_0x4a8aa1+'-'+_0xa2c73b+'/'+_0x2efe95)[_0x7009('0x1f')](_0x1622b6);}return null;};}function saveUpdates(_0xfaa8b7){return function(_0x14e4a6){if(_0x14e4a6){return _0x14e4a6[_0x7009('0x24')](_0xfaa8b7)['then'](function(_0x31180c){return _0x31180c;});}return null;};}function removeEntity(_0x44aa26){return function(_0x3e0a9f){if(_0x3e0a9f){return _0x3e0a9f['destroy']()[_0x7009('0x14')](function(){_0x44aa26[_0x7009('0x1e')](0xcc)[_0x7009('0x25')]();});}};}function handleEntityNotFound(_0x5e0882){return function(_0x141942){if(!_0x141942){_0x5e0882['sendStatus'](0x194);}return _0x141942;};}function handleError(_0x1126a4,_0x438874){_0x438874=_0x438874||0x1f4;return function(_0x5dba02){logger['error'](_0x5dba02[_0x7009('0x26')]);if(_0x5dba02[_0x7009('0x27')]){delete _0x5dba02[_0x7009('0x27')];}_0x1126a4[_0x7009('0x1e')](_0x438874)[_0x7009('0x28')](_0x5dba02);};}exports[_0x7009('0x29')]=function(_0x48ee73,_0x11d1b6){var _0x229adb={},_0x2367c3={},_0xea37f2={'count':0x0,'rows':[]};var _0x159f08=_[_0x7009('0x2a')](db[_0x7009('0x2b')]['rawAttributes'],function(_0x14b52e){return{'name':_0x14b52e['fieldName'],'type':_0x14b52e[_0x7009('0x2c')]['key']};});_0x2367c3[_0x7009('0x2d')]=_['map'](_0x159f08,_0x7009('0x27'));_0x2367c3[_0x7009('0x2e')]=_[_0x7009('0x2f')](_0x48ee73[_0x7009('0x2e')]);_0x2367c3[_0x7009('0x30')]=_[_0x7009('0x31')](_0x2367c3[_0x7009('0x2d')],_0x2367c3[_0x7009('0x2e')]);_0x229adb[_0x7009('0x32')]=_[_0x7009('0x31')](_0x2367c3[_0x7009('0x2d')],qs[_0x7009('0x33')](_0x48ee73[_0x7009('0x2e')][_0x7009('0x33')]));_0x229adb[_0x7009('0x32')]=_0x229adb[_0x7009('0x32')]['length']?_0x229adb['attributes']:_0x2367c3[_0x7009('0x2d')];if(!_0x48ee73['query'][_0x7009('0x34')](_0x7009('0x35'))){_0x229adb[_0x7009('0x21')]=qs[_0x7009('0x21')](_0x48ee73[_0x7009('0x2e')]['limit']);_0x229adb[_0x7009('0x23')]=qs[_0x7009('0x23')](_0x48ee73['query'][_0x7009('0x23')]);}_0x229adb['order']=qs[_0x7009('0x36')](_0x48ee73[_0x7009('0x2e')][_0x7009('0x36')]);_0x229adb[_0x7009('0x37')]=qs['filters'](_[_0x7009('0x38')](_0x48ee73['query'],_0x2367c3[_0x7009('0x30')]),_0x159f08);if(_0x48ee73['query']['filter']){_0x229adb[_0x7009('0x37')]=_['merge'](_0x229adb[_0x7009('0x37')],{'$or':_[_0x7009('0x2a')](_0x159f08,function(_0x51519b){if(_0x51519b[_0x7009('0x2c')]!==_0x7009('0x39')){var _0x540673={};_0x540673[_0x51519b[_0x7009('0x27')]]={'$like':'%'+_0x48ee73[_0x7009('0x2e')]['filter']+'%'};return _0x540673;}})});}_0x229adb=_[_0x7009('0x3a')]({},_0x229adb,_0x48ee73[_0x7009('0x3b')]);var _0x2c9056={'where':_0x229adb[_0x7009('0x37')]};return db[_0x7009('0x2b')][_0x7009('0x22')](_0x2c9056)[_0x7009('0x14')](function(_0x380d3e){_0xea37f2[_0x7009('0x22')]=_0x380d3e;if(_0x48ee73[_0x7009('0x2e')][_0x7009('0x3c')]){_0x229adb['include']=[{'all':!![]}];}return db[_0x7009('0x2b')][_0x7009('0x3d')](_0x229adb);})['then'](function(_0x262ea4){_0xea37f2[_0x7009('0x3e')]=_0x262ea4;return _0xea37f2;})[_0x7009('0x14')](respondWithFilteredResult(_0x11d1b6,_0x229adb))[_0x7009('0x1d')](handleError(_0x11d1b6,null));};exports[_0x7009('0x3f')]=function(_0x4a0dcc,_0x53df71){var _0x5adfac={'raw':!![],'where':{'id':_0x4a0dcc['params']['id']}},_0x5bb4e5={};_0x5bb4e5[_0x7009('0x2d')]=_[_0x7009('0x2f')](db[_0x7009('0x2b')]['rawAttributes']);_0x5bb4e5['query']=_[_0x7009('0x2f')](_0x4a0dcc[_0x7009('0x2e')]);_0x5bb4e5[_0x7009('0x30')]=_['intersection'](_0x5bb4e5['model'],_0x5bb4e5['query']);_0x5adfac[_0x7009('0x32')]=_[_0x7009('0x31')](_0x5bb4e5['model'],qs[_0x7009('0x33')](_0x4a0dcc[_0x7009('0x2e')][_0x7009('0x33')]));_0x5adfac[_0x7009('0x32')]=_0x5adfac[_0x7009('0x32')][_0x7009('0x40')]?_0x5adfac[_0x7009('0x32')]:_0x5bb4e5[_0x7009('0x2d')];if(_0x4a0dcc['query'][_0x7009('0x3c')]){_0x5adfac['include']=[{'all':!![]}];}_0x5adfac=_[_0x7009('0x3a')]({},_0x5adfac,_0x4a0dcc[_0x7009('0x3b')]);return db['MailMessage'][_0x7009('0x41')](_0x5adfac)[_0x7009('0x14')](handleEntityNotFound(_0x53df71,null))['then'](respondWithResult(_0x53df71,null))[_0x7009('0x1d')](handleError(_0x53df71,null));};exports[_0x7009('0x24')]=function(_0x10647d,_0x49cc2a){if(_0x10647d[_0x7009('0x42')]['id']){delete _0x10647d[_0x7009('0x42')]['id'];}return db['MailMessage'][_0x7009('0x41')]({'where':{'id':_0x10647d[_0x7009('0x43')]['id']}})[_0x7009('0x14')](handleEntityNotFound(_0x49cc2a,null))['then'](saveUpdates(_0x10647d[_0x7009('0x42')],null))[_0x7009('0x14')](respondWithResult(_0x49cc2a,null))[_0x7009('0x1d')](handleError(_0x49cc2a,null));};exports[_0x7009('0x44')]=function(_0x237917,_0x96354c){return db[_0x7009('0x2b')][_0x7009('0x41')]({'where':{'id':_0x237917[_0x7009('0x43')]['id']}})[_0x7009('0x14')](handleEntityNotFound(_0x96354c,null))[_0x7009('0x14')](removeEntity(_0x96354c,null))[_0x7009('0x1d')](handleError(_0x96354c,null));};exports['describe']=function(_0x37048c,_0xb8d3d1){return db[_0x7009('0x2b')][_0x7009('0x45')]()[_0x7009('0x14')](respondWithResult(_0xb8d3d1,null))[_0x7009('0x1d')](handleError(_0xb8d3d1,null));};exports[_0x7009('0x46')]=function(_0x59d31a,_0x40a5a4){return db[_0x7009('0x2b')][_0x7009('0x46')](_0x59d31a[_0x7009('0x42')])[_0x7009('0x14')](function(_0x321ddb){if(_0x321ddb){if(_0x321ddb['direction']===_0x7009('0x47')&&!_0x321ddb['secret']){var _0x15516d,_0x585333,_0x31c222;if(_0x59d31a[_0x7009('0x42')]['to']){_0x585333=_0x59d31a[_0x7009('0x42')]['to'][_0x7009('0x48')](',')[0x0];}return db[_0x7009('0x49')]['findOne']({'where':{'id':_0x321ddb['MailAccountId']},'include':[{'model':db['CmList'],'as':_0x7009('0x4a'),'include':[{'model':db[_0x7009('0x4b')],'as':_0x7009('0x4c'),'where':{'email':_0x585333},'limit':0x1,'order':[[_0x7009('0x4d'),_0x7009('0x4e')]]}]},{'model':db[_0x7009('0x4f')],'as':_0x7009('0x50'),'raw':!![]}]})['then'](function(_0x4fc97d){_0x15516d=_0x4fc97d;if(_0x15516d&&_0x15516d['Smtp']){var _0x58ff5f={'tls':{'rejectUnauthorized':![]}};if(_[_0x7009('0x51')](_0x15516d[_0x7009('0x50')]['service'])){_0x58ff5f['host']=_0x15516d[_0x7009('0x50')][_0x7009('0x52')];_0x58ff5f[_0x7009('0x53')]=_0x15516d[_0x7009('0x50')][_0x7009('0x53')];_0x58ff5f[_0x7009('0x54')]=_0x15516d['Smtp'][_0x7009('0x54')];if(_0x15516d['Smtp'][_0x7009('0x55')]){_0x58ff5f[_0x7009('0x56')]={'user':_0x15516d['Smtp'][_0x7009('0x57')],'pass':_0x15516d[_0x7009('0x50')][_0x7009('0x58')]};}}else{_0x58ff5f[_0x7009('0x59')]=_0x15516d['Smtp'][_0x7009('0x59')];_0x58ff5f[_0x7009('0x56')]={'user':_0x15516d['Smtp'][_0x7009('0x57')],'pass':_0x15516d[_0x7009('0x50')]['pass']};_0x58ff5f[_0x7009('0x54')]=_0x15516d[_0x7009('0x50')][_0x7009('0x54')];}if(_0x59d31a['body'][_0x7009('0x5a')]&&_0x59d31a['body'][_0x7009('0x5a')]['length']){for(var _0x1df9a0=0x0;_0x1df9a0<_0x59d31a[_0x7009('0x42')][_0x7009('0x5a')][_0x7009('0x40')];_0x1df9a0+=0x1){_0x59d31a[_0x7009('0x42')][_0x7009('0x5a')][_0x1df9a0]={'filename':_0x59d31a[_0x7009('0x42')][_0x7009('0x5a')][_0x1df9a0][_0x7009('0x27')],'path':path['join'](config['root'],'server/files/attachments',_0x59d31a[_0x7009('0x42')][_0x7009('0x5a')][_0x1df9a0][_0x7009('0x5b')])};}}_0x31c222={'account':_0x58ff5f,'message':_0x59d31a[_0x7009('0x42')]};return;}})[_0x7009('0x14')](function(){if(_0x15516d[_0x7009('0x4a')]){if(_0x15516d['List'][_0x7009('0x4c')][_0x7009('0x40')]){return _0x15516d[_0x7009('0x4a')]['Contacts'][0x0];}else{return db[_0x7009('0x4b')]['create'](_['defaults'](_0x59d31a[_0x7009('0x42')],{'firstName':_0x59d31a[_0x7009('0x42')]['to'],'email':_0x59d31a[_0x7009('0x42')]['to'],'phone':_0x59d31a[_0x7009('0x42')]['to'],'ListId':_0x15516d[_0x7009('0x5c')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x7009('0x14')](function(){if(_0x31c222){return respondWithRpcPromise(_0x7009('0x5d'),'sendMail',_0x31c222,client9003)[_0x7009('0x14')](function(_0x49cc03){return _0x321ddb[_0x7009('0x24')]({'read':!![],'messageId':_0x49cc03[_0x7009('0x5e')],'sentAt':moment()[_0x7009('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x7009('0x1d')](function(_0x2083ca){logger['error']('%s',JSON['stringify'](_0x2083ca));return _0x321ddb;});}return _0x321ddb;});}return _0x321ddb;}})[_0x7009('0x14')](respondWithResult(_0x40a5a4,0xc9))[_0x7009('0x1d')](handleError(_0x40a5a4,null));};exports['accept']=function(_0x6fdfe0,_0x4eeb7e){var _0x577ff3={'agent':{},'channel':_0x7009('0x60')};if(_0x6fdfe0[_0x7009('0x42')]['id']){delete _0x6fdfe0[_0x7009('0x42')]['id'];}_0x6fdfe0[_0x7009('0x42')][_0x7009('0x61')]=!![];_0x6fdfe0[_0x7009('0x42')]['readAt']=moment()[_0x7009('0x5f')](_0x7009('0x62'));_0x6fdfe0[_0x7009('0x42')][_0x7009('0x63')]=_0x6fdfe0[_0x7009('0x42')][_0x7009('0x63')]||_0x6fdfe0[_0x7009('0x57')]['id'];_0x577ff3[_0x7009('0x64')]['id']=_0x6fdfe0[_0x7009('0x42')][_0x7009('0x63')];return db['MailMessage'][_0x7009('0x41')]({'where':{'id':_0x6fdfe0[_0x7009('0x43')]['id'],'UserId':null}})[_0x7009('0x14')](handleEntityNotFound(_0x4eeb7e,null))[_0x7009('0x14')](saveUpdates(_0x6fdfe0[_0x7009('0x42')],null))[_0x7009('0x14')](function(_0x5349d6){if(_0x5349d6){_0x577ff3[_0x7009('0x1b')]=_0x5349d6[_0x7009('0x65')]({'plain':!![]});return db[_0x7009('0x66')][_0x7009('0x41')]({'where':{'id':_0x5349d6['MailInteractionId']}});}return null;})[_0x7009('0x14')](handleEntityNotFound(_0x4eeb7e,null))[_0x7009('0x14')](function(_0x2834a2){if(_0x2834a2){return _0x2834a2[_0x7009('0x24')]({'UserId':_0x6fdfe0[_0x7009('0x42')][_0x7009('0x63')],'read1stAt':_[_0x7009('0x51')](_0x2834a2[_0x7009('0x67')])?moment()['format'](_0x7009('0x62')):undefined});}return null;})[_0x7009('0x14')](function(_0x1bf408){if(_0x1bf408){_0x577ff3[_0x7009('0x68')]=_0x1bf408['get']({'plain':!![]});interaction_log[_0x7009('0x15')](_0x7009('0x69'),_0x6fdfe0['user']['id'],_0x6fdfe0[_0x7009('0x57')]['name'],_0x6fdfe0['user']['role'],_0x577ff3[_0x7009('0x68')]['id'],_0x6fdfe0[_0x7009('0x42')]?JSON[_0x7009('0x6a')](_0x6fdfe0[_0x7009('0x42')]):_0x7009('0x6b'));return respondWithRpcPromise(_0x7009('0x6c'),_0x7009('0x6d'),_0x577ff3);}return null;})['then'](function(_0x25570e){var _0x217662=_0x7009('0x6e')+_0x25570e[_0x7009('0x1b')][_0x7009('0x6f')];return db[_0x7009('0x70')][_0x7009('0x2e')](_0x217662,{'type':db[_0x7009('0x71')][_0x7009('0x72')][_0x7009('0x73')],'raw':!![]})[_0x7009('0x14')](function(_0x269b45){return _0x269b45;});})[_0x7009('0x14')](function(_0x31882b){if(_0x31882b){_0x577ff3['message'][_0x7009('0x74')]=_0x31882b[0x0];if(!_0x6fdfe0[_0x7009('0x42')][_0x7009('0x63')])return;return db[_0x7009('0x75')][_0x7009('0x41')]({'where':{'id':_0x6fdfe0[_0x7009('0x42')]['UserId'],'role':_0x7009('0x64')},'attributes':['id','name',_0x7009('0x76'),_0x7009('0x77'),_0x7009('0x78')],'raw':!![]});}return null;})[_0x7009('0x14')](function(_0x47e0d1){if(!_0x47e0d1)return null;_0x577ff3['message'][_0x7009('0x64')]=_0x47e0d1;return _0x577ff3;})[_0x7009('0x14')](function(_0x2d3919){if(_0x2d3919){if(_0x6fdfe0[_0x7009('0x42')][_0x7009('0x79')]){_0x577ff3[_0x7009('0x1b')]['interface']=util[_0x7009('0x5f')]('SIP/%s',_0x6fdfe0[_0x7009('0x57')]['name']);_0x577ff3['message']['channel']=_0x577ff3[_0x7009('0x7a')];_0x577ff3['message'][_0x7009('0x7b')]=_0x577ff3[_0x7009('0x7a')];_0x577ff3[_0x7009('0x1b')][_0x7009('0x7c')]=_0x7009('0x7d');_0x577ff3[_0x7009('0x1b')]['body']=htmlToText[_0x7009('0x7e')](_0x577ff3[_0x7009('0x1b')][_0x7009('0x42')]);return respondWithRpcPromise(_0x7009('0x7f'),_0x7009('0x7f'),{'event':_0x7009('0x80'),'message':_0x577ff3['message']},client9002)[_0x7009('0x14')](function(){return _0x577ff3;});}return _0x577ff3;}return null;})[_0x7009('0x14')](respondWithResult(_0x4eeb7e,null))[_0x7009('0x1d')](handleError(_0x4eeb7e,null));};exports[_0x7009('0x81')]=function(_0x28b298,_0x32035b){var _0x26e555={'agent':{},'channel':'mail'};if(_0x28b298[_0x7009('0x42')]['id']){delete _0x28b298[_0x7009('0x42')]['id'];}_0x28b298[_0x7009('0x42')]['UserId']=_0x28b298[_0x7009('0x42')]['UserId']||_0x28b298[_0x7009('0x57')]['id'];_0x26e555[_0x7009('0x64')]['id']=_0x28b298[_0x7009('0x42')]['UserId'];return db[_0x7009('0x2b')][_0x7009('0x41')]({'where':{'id':_0x28b298[_0x7009('0x43')]['id'],'UserId':null}})[_0x7009('0x14')](handleEntityNotFound(_0x32035b,null))[_0x7009('0x14')](function(_0x11e1b3){if(_0x11e1b3){_0x26e555[_0x7009('0x1b')]=_0x11e1b3[_0x7009('0x65')]({'plain':!![]});return db[_0x7009('0x66')][_0x7009('0x41')]({'where':{'id':_0x11e1b3[_0x7009('0x82')]}});}return null;})[_0x7009('0x14')](handleEntityNotFound(_0x32035b,null))[_0x7009('0x14')](function(_0x1c6913){if(_0x1c6913){_0x26e555[_0x7009('0x68')]=_0x1c6913[_0x7009('0x65')]({'plain':!![]});interaction_log['info'](_0x7009('0x83'),_0x28b298['user']['id'],_0x28b298[_0x7009('0x57')]['name'],_0x28b298[_0x7009('0x57')][_0x7009('0x84')],_0x26e555['interaction']['id'],_0x28b298[_0x7009('0x42')]?JSON[_0x7009('0x6a')](_0x28b298[_0x7009('0x42')]):_0x7009('0x6b'));return respondWithRpcPromise('RejectMessage',_0x7009('0x85'),_0x26e555);}return null;})[_0x7009('0x14')](function(_0x2d91bc){var _0x3e1788='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2d91bc[_0x7009('0x1b')]['ContactId'];return db[_0x7009('0x70')][_0x7009('0x2e')](_0x3e1788,{'type':db[_0x7009('0x71')]['QueryTypes'][_0x7009('0x73')],'raw':!![]})[_0x7009('0x14')](function(_0x4c6c03){return _0x4c6c03;});})['then'](function(_0x4ba68b){if(_0x4ba68b){_0x26e555[_0x7009('0x1b')][_0x7009('0x74')]=_0x4ba68b[0x0];if(!_0x28b298['body'][_0x7009('0x63')])return;return db['User'][_0x7009('0x41')]({'where':{'id':_0x28b298[_0x7009('0x42')][_0x7009('0x63')],'role':_0x7009('0x64')},'attributes':['id','name','fullname','email',_0x7009('0x78')],'raw':!![]});}return null;})['then'](function(_0x105757){if(!_0x105757)return null;_0x26e555[_0x7009('0x1b')][_0x7009('0x64')]=_0x105757;return _0x26e555;})[_0x7009('0x14')](function(_0x4a42ec){if(_0x4a42ec){_0x4a42ec['message'][_0x7009('0x86')]=util[_0x7009('0x5f')](_0x7009('0x87'),_0x28b298['user']['name']);_0x4a42ec['message'][_0x7009('0x7a')]=_0x26e555[_0x7009('0x7a')];_0x4a42ec['message'][_0x7009('0x7b')]=_0x26e555['channel'];_0x4a42ec[_0x7009('0x1b')]['event']=_0x7009('0x81');_0x4a42ec[_0x7009('0x1b')][_0x7009('0x42')]=htmlToText[_0x7009('0x7e')](_0x26e555[_0x7009('0x1b')]['body']);respondWithRpcPromise('EventManager','EventManager',{'event':_0x7009('0x88'),'message':_0x4a42ec['message']},client9002);return _0x26e555;}return null;})['then'](respondWithResult(_0x32035b,null))[_0x7009('0x1d')](handleError(_0x32035b,null));};exports['download']=function(_0x42d686,_0x314a86){var _0x26bd2d=moment()[_0x7009('0x89')]()[_0x7009('0x8a')]();var _0x58013a=path['join'](config[_0x7009('0x8b')],_0x7009('0x8c'),_0x7009('0x8d'),_0x7009('0x8e'));var _0x275c9e=path['join'](config['root'],_0x7009('0x8c'),_0x7009('0x8d'),'attachments');var _0x3f7967=util['format'](_0x7009('0x8f'),_0x26bd2d);return db['MailMessage'][_0x7009('0x41')]({'where':{'id':_0x42d686['params']['id']},'attributes':['id',_0x7009('0x42'),'from','to','cc',_0x7009('0x90'),_0x7009('0x91'),_0x7009('0x92')],'include':_0x42d686[_0x7009('0x2e')][_0x7009('0x5a')]?[{'model':db[_0x7009('0x93')],'as':_0x7009('0x94')}]:undefined})[_0x7009('0x14')](handleEntityNotFound(_0x314a86,null))[_0x7009('0x14')](function(_0x4dc3b9){if(_0x4dc3b9){var _0x31bf42=_0x4dc3b9;var _0xa4a7f2={'from':_0x31bf42[_0x7009('0x95')],'to':_0x31bf42['to'],'subject':_0x31bf42[_0x7009('0x91')],'html':_0x31bf42[_0x7009('0x42')],'headers':{'Date':moment(_0x31bf42[_0x7009('0x92')])['format'](_0x7009('0x96'))},'attachments':[]};if(_0x4dc3b9['cc']){_0xa4a7f2[_0x7009('0x97')]['Cc']=_0x4dc3b9['cc'];}if(_0x4dc3b9[_0x7009('0x90')]){_0xa4a7f2[_0x7009('0x97')][_0x7009('0x98')]=_0x4dc3b9[_0x7009('0x90')];}return new BPromise(function(_0x1cd7d9,_0x33fc8c){if(_0x4dc3b9[_0x7009('0x94')]){for(var _0x20089a=0x0;_0x20089a<_0x4dc3b9[_0x7009('0x94')][_0x7009('0x40')];_0x20089a++){var _0x1ab157=_0x4dc3b9[_0x7009('0x94')][_0x20089a];var _0x53a336=path[_0x7009('0x99')](_0x275c9e,_0x1ab157['basename']);if(fs[_0x7009('0x9a')](_0x53a336)){_0xa4a7f2[_0x7009('0x5a')][_0x7009('0x9b')]({'name':_0x1ab157[_0x7009('0x27')],'contentType':_0x1ab157[_0x7009('0x2c')],'data':fs[_0x7009('0x9c')](_0x53a336)});}}}emlformat[_0x7009('0x9d')](_0xa4a7f2,function(_0x33e45e,_0x2e9014){if(_0x33e45e)return _0x33fc8c(_0x33e45e);fs[_0x7009('0x9e')](path[_0x7009('0x99')](_0x58013a,_0x3f7967),_0x2e9014);return _0x1cd7d9(_0x2e9014);});});}})[_0x7009('0x14')](function(_0x18f1aa){if(_0x18f1aa){return _0x314a86[_0x7009('0x9f')](path['join'](_0x58013a,_0x3f7967),_0x3f7967,function(_0x3330ac){if(!_0x3330ac)fs[_0x7009('0xa0')](path[_0x7009('0x99')](_0x58013a,_0x3f7967));});}})['catch'](handleError(_0x314a86,null));};
\ No newline at end of file
+var _0xfede=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','Sequelize','interface','SIP/%s','rejectmessage','unix','files','tmp','server','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','socket.io-emitter','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','json','undefined','count','offset','set','Content-Range','update','then','destroy','sendStatus','stack','name','send','index','map','MailMessage','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','filter','includeAll','include','rows','catch','show','params','keys','rawAttributes','options','find','body','describe','create','direction','secret','split','MailAccount','findOne','MailAccountId','CmList','DESC','Smtp','isNil','service','host','port','secure','auth','user','pass','attachments','join','root','server/files/attachments','List','Contacts','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null'];(function(_0xc15d2a,_0x473f53){var _0x3ed085=function(_0x42447a){while(--_0x42447a){_0xc15d2a['push'](_0xc15d2a['shift']());}};_0x3ed085(++_0x473f53);}(_0xfede,0x16a));var _0xefed=function(_0x2b85d5,_0x3115b7){_0x2b85d5=_0x2b85d5-0x0;var _0xe8c96f=_0xfede[_0x2b85d5];return _0xe8c96f;};'use strict';var emlformat=require(_0xefed('0x0'));var moment=require(_0xefed('0x1'));var BPromise=require(_0xefed('0x2'));var util=require(_0xefed('0x3'));var path=require(_0xefed('0x4'));var fs=require('fs');var _=require(_0xefed('0x5'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0xefed('0x6'));var logger=require(_0xefed('0x7'))(_0xefed('0x8'));var interaction_log=require('../../config/logger')(_0xefed('0x9'));var config=require(_0xefed('0xa'));var db=require('../../mysqldb')['db'];config[_0xefed('0xb')]=_['defaults'](config[_0xefed('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xefed('0xc'))(new Redis(config[_0xefed('0xb')]));require('./mailMessage.socket')[_0xefed('0xd')](socket);var jayson=require(_0xefed('0xe'));var client=jayson[_0xefed('0xf')][_0xefed('0x10')]({'port':0x232c});var client9003=jayson[_0xefed('0xf')][_0xefed('0x10')]({'port':0x232b});var client9002=jayson[_0xefed('0xf')][_0xefed('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x1bf614,_0x521b22,_0x58dc8f,_0x441cb6){return new BPromise(function(_0x2892ec,_0x19d357){var _0x2b68aa=_0x441cb6||client;return _0x2b68aa[_0xefed('0x11')](_0x1bf614,_0x58dc8f)['then'](function(_0x10e1a0){logger[_0xefed('0x12')](_0xefed('0x13'),_0x521b22,_0xefed('0x14'));logger[_0xefed('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x521b22,_0xefed('0x14'),JSON[_0xefed('0x16')](_0x10e1a0));if(_0x10e1a0[_0xefed('0x17')]){if(_0x10e1a0[_0xefed('0x17')][_0xefed('0x18')]===0x1f4){logger[_0xefed('0x17')]('MailMessage,\x20%s,\x20%s',_0x521b22,_0x10e1a0[_0xefed('0x17')][_0xefed('0x19')]);return _0x19d357(_0x10e1a0[_0xefed('0x17')][_0xefed('0x19')]);}logger[_0xefed('0x17')](_0xefed('0x13'),_0x521b22,_0x10e1a0[_0xefed('0x17')]['message']);return _0x2892ec(_0x10e1a0[_0xefed('0x17')][_0xefed('0x19')]);}else{logger[_0xefed('0x12')](_0xefed('0x13'),_0x521b22,_0xefed('0x14'));_0x2892ec(_0x10e1a0[_0xefed('0x1a')][_0xefed('0x19')]);}})['catch'](function(_0x3a9db7){logger[_0xefed('0x17')](_0xefed('0x13'),_0x521b22,_0x3a9db7);_0x19d357(_0x3a9db7);});});}function respondWithResult(_0x2d348d,_0xfeae21){_0xfeae21=_0xfeae21||0xc8;return function(_0x40bb8f){if(_0x40bb8f){return _0x2d348d[_0xefed('0x1b')](_0xfeae21)[_0xefed('0x1c')](_0x40bb8f);}};}function respondWithFilteredResult(_0x4c7669,_0x5f01d4){return function(_0x36a17f){if(_0x36a17f){var _0x2c10d5=typeof _0x5f01d4['offset']===_0xefed('0x1d')&&typeof _0x5f01d4['limit']==='undefined';var _0x47b3e6=_0x36a17f[_0xefed('0x1e')];var _0x20842d=_0x2c10d5?0x0:_0x5f01d4[_0xefed('0x1f')];var _0x3d251b=_0x2c10d5?_0x36a17f[_0xefed('0x1e')]:_0x5f01d4[_0xefed('0x1f')]+_0x5f01d4['limit'];var _0x408ca6;if(_0x3d251b>=_0x47b3e6){_0x3d251b=_0x47b3e6;_0x408ca6=0xc8;}else{_0x408ca6=0xce;}_0x4c7669[_0xefed('0x1b')](_0x408ca6);return _0x4c7669[_0xefed('0x20')](_0xefed('0x21'),_0x20842d+'-'+_0x3d251b+'/'+_0x47b3e6)[_0xefed('0x1c')](_0x36a17f);}return null;};}function saveUpdates(_0x22f04f){return function(_0x21e7ce){if(_0x21e7ce){return _0x21e7ce[_0xefed('0x22')](_0x22f04f)[_0xefed('0x23')](function(_0x4d644b){return _0x4d644b;});}return null;};}function removeEntity(_0x5cabd9){return function(_0x5cbf35){if(_0x5cbf35){return _0x5cbf35[_0xefed('0x24')]()[_0xefed('0x23')](function(){_0x5cabd9[_0xefed('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x160d3b){return function(_0xdc2d43){if(!_0xdc2d43){_0x160d3b[_0xefed('0x25')](0x194);}return _0xdc2d43;};}function handleError(_0x166981,_0x3a9b2a){_0x3a9b2a=_0x3a9b2a||0x1f4;return function(_0x156695){logger[_0xefed('0x17')](_0x156695[_0xefed('0x26')]);if(_0x156695['name']){delete _0x156695[_0xefed('0x27')];}_0x166981['status'](_0x3a9b2a)[_0xefed('0x28')](_0x156695);};}exports[_0xefed('0x29')]=function(_0x2624f3,_0x1b6714){var _0x377eb4={},_0xa284d2={},_0x18352b={'count':0x0,'rows':[]};var _0x3cc7ee=_[_0xefed('0x2a')](db[_0xefed('0x2b')]['rawAttributes'],function(_0x3c3500){return{'name':_0x3c3500[_0xefed('0x2c')],'type':_0x3c3500[_0xefed('0x2d')]['key']};});_0xa284d2[_0xefed('0x2e')]=_[_0xefed('0x2a')](_0x3cc7ee,_0xefed('0x27'));_0xa284d2[_0xefed('0x2f')]=_['keys'](_0x2624f3[_0xefed('0x2f')]);_0xa284d2['filters']=_[_0xefed('0x30')](_0xa284d2[_0xefed('0x2e')],_0xa284d2[_0xefed('0x2f')]);_0x377eb4[_0xefed('0x31')]=_['intersection'](_0xa284d2[_0xefed('0x2e')],qs[_0xefed('0x32')](_0x2624f3[_0xefed('0x2f')][_0xefed('0x32')]));_0x377eb4[_0xefed('0x31')]=_0x377eb4[_0xefed('0x31')][_0xefed('0x33')]?_0x377eb4[_0xefed('0x31')]:_0xa284d2[_0xefed('0x2e')];if(!_0x2624f3[_0xefed('0x2f')][_0xefed('0x34')]('nolimit')){_0x377eb4['limit']=qs['limit'](_0x2624f3[_0xefed('0x2f')]['limit']);_0x377eb4[_0xefed('0x1f')]=qs[_0xefed('0x1f')](_0x2624f3[_0xefed('0x2f')]['offset']);}_0x377eb4[_0xefed('0x35')]=qs[_0xefed('0x36')](_0x2624f3[_0xefed('0x2f')][_0xefed('0x36')]);_0x377eb4[_0xefed('0x37')]=qs['filters'](_[_0xefed('0x38')](_0x2624f3[_0xefed('0x2f')],_0xa284d2[_0xefed('0x39')]),_0x3cc7ee);if(_0x2624f3[_0xefed('0x2f')]['filter']){_0x377eb4[_0xefed('0x37')]=_[_0xefed('0x3a')](_0x377eb4[_0xefed('0x37')],{'$or':_[_0xefed('0x2a')](_0x3cc7ee,function(_0x319cb2){if(_0x319cb2[_0xefed('0x2d')]!=='VIRTUAL'){var _0x4ea817={};_0x4ea817[_0x319cb2[_0xefed('0x27')]]={'$like':'%'+_0x2624f3['query'][_0xefed('0x3b')]+'%'};return _0x4ea817;}})});}_0x377eb4=_[_0xefed('0x3a')]({},_0x377eb4,_0x2624f3['options']);var _0x276642={'where':_0x377eb4[_0xefed('0x37')]};return db['MailMessage'][_0xefed('0x1e')](_0x276642)['then'](function(_0x10843d){_0x18352b[_0xefed('0x1e')]=_0x10843d;if(_0x2624f3[_0xefed('0x2f')][_0xefed('0x3c')]){_0x377eb4[_0xefed('0x3d')]=[{'all':!![]}];}return db[_0xefed('0x2b')]['findAll'](_0x377eb4);})[_0xefed('0x23')](function(_0x4374fd){_0x18352b[_0xefed('0x3e')]=_0x4374fd;return _0x18352b;})[_0xefed('0x23')](respondWithFilteredResult(_0x1b6714,_0x377eb4))[_0xefed('0x3f')](handleError(_0x1b6714,null));};exports[_0xefed('0x40')]=function(_0x4b5c96,_0x415f0d){var _0x3fcbdc={'raw':!![],'where':{'id':_0x4b5c96[_0xefed('0x41')]['id']}},_0x54c133={};_0x54c133[_0xefed('0x2e')]=_[_0xefed('0x42')](db['MailMessage'][_0xefed('0x43')]);_0x54c133[_0xefed('0x2f')]=_['keys'](_0x4b5c96[_0xefed('0x2f')]);_0x54c133[_0xefed('0x39')]=_[_0xefed('0x30')](_0x54c133[_0xefed('0x2e')],_0x54c133['query']);_0x3fcbdc['attributes']=_['intersection'](_0x54c133['model'],qs['fields'](_0x4b5c96['query'][_0xefed('0x32')]));_0x3fcbdc['attributes']=_0x3fcbdc['attributes']['length']?_0x3fcbdc[_0xefed('0x31')]:_0x54c133[_0xefed('0x2e')];if(_0x4b5c96[_0xefed('0x2f')]['includeAll']){_0x3fcbdc[_0xefed('0x3d')]=[{'all':!![]}];}_0x3fcbdc=_[_0xefed('0x3a')]({},_0x3fcbdc,_0x4b5c96[_0xefed('0x44')]);return db[_0xefed('0x2b')][_0xefed('0x45')](_0x3fcbdc)[_0xefed('0x23')](handleEntityNotFound(_0x415f0d,null))[_0xefed('0x23')](respondWithResult(_0x415f0d,null))[_0xefed('0x3f')](handleError(_0x415f0d,null));};exports['update']=function(_0x2195ca,_0x2d47f3){if(_0x2195ca['body']['id']){delete _0x2195ca[_0xefed('0x46')]['id'];}return db[_0xefed('0x2b')][_0xefed('0x45')]({'where':{'id':_0x2195ca[_0xefed('0x41')]['id']}})[_0xefed('0x23')](handleEntityNotFound(_0x2d47f3,null))[_0xefed('0x23')](saveUpdates(_0x2195ca[_0xefed('0x46')],null))[_0xefed('0x23')](respondWithResult(_0x2d47f3,null))[_0xefed('0x3f')](handleError(_0x2d47f3,null));};exports[_0xefed('0x24')]=function(_0x51dbc6,_0x2866a5){return db['MailMessage']['find']({'where':{'id':_0x51dbc6['params']['id']}})[_0xefed('0x23')](handleEntityNotFound(_0x2866a5,null))[_0xefed('0x23')](removeEntity(_0x2866a5,null))[_0xefed('0x3f')](handleError(_0x2866a5,null));};exports[_0xefed('0x47')]=function(_0x54e834,_0x87e686){return db[_0xefed('0x2b')][_0xefed('0x47')]()[_0xefed('0x23')](respondWithResult(_0x87e686,null))[_0xefed('0x3f')](handleError(_0x87e686,null));};exports[_0xefed('0x48')]=function(_0x929459,_0x589704){return db[_0xefed('0x2b')][_0xefed('0x48')](_0x929459[_0xefed('0x46')])['then'](function(_0x2ba8d9){if(_0x2ba8d9){if(_0x2ba8d9[_0xefed('0x49')]==='out'&&!_0x2ba8d9[_0xefed('0x4a')]){var _0x3cc9f4,_0x5d60d8,_0x358b36;if(_0x929459['body']['to']){_0x5d60d8=_0x929459[_0xefed('0x46')]['to'][_0xefed('0x4b')](',')[0x0];}return db[_0xefed('0x4c')][_0xefed('0x4d')]({'where':{'id':_0x2ba8d9[_0xefed('0x4e')]},'include':[{'model':db[_0xefed('0x4f')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x5d60d8},'limit':0x1,'order':[['updatedAt',_0xefed('0x50')]]}]},{'model':db['MailServerOut'],'as':_0xefed('0x51'),'raw':!![]}]})[_0xefed('0x23')](function(_0x4c5e20){_0x3cc9f4=_0x4c5e20;if(_0x3cc9f4&&_0x3cc9f4[_0xefed('0x51')]){var _0x3ff059={'tls':{'rejectUnauthorized':![]}};if(_[_0xefed('0x52')](_0x3cc9f4[_0xefed('0x51')][_0xefed('0x53')])){_0x3ff059[_0xefed('0x54')]=_0x3cc9f4['Smtp'][_0xefed('0x54')];_0x3ff059[_0xefed('0x55')]=_0x3cc9f4[_0xefed('0x51')][_0xefed('0x55')];_0x3ff059[_0xefed('0x56')]=_0x3cc9f4[_0xefed('0x51')][_0xefed('0x56')];if(_0x3cc9f4[_0xefed('0x51')]['authentication']){_0x3ff059[_0xefed('0x57')]={'user':_0x3cc9f4[_0xefed('0x51')][_0xefed('0x58')],'pass':_0x3cc9f4[_0xefed('0x51')][_0xefed('0x59')]};}}else{_0x3ff059['service']=_0x3cc9f4[_0xefed('0x51')][_0xefed('0x53')];_0x3ff059[_0xefed('0x57')]={'user':_0x3cc9f4['Smtp'][_0xefed('0x58')],'pass':_0x3cc9f4[_0xefed('0x51')][_0xefed('0x59')]};_0x3ff059[_0xefed('0x56')]=_0x3cc9f4[_0xefed('0x51')][_0xefed('0x56')];}if(_0x929459[_0xefed('0x46')][_0xefed('0x5a')]&&_0x929459[_0xefed('0x46')]['attachments'][_0xefed('0x33')]){for(var _0x45f912=0x0;_0x45f912<_0x929459[_0xefed('0x46')][_0xefed('0x5a')][_0xefed('0x33')];_0x45f912+=0x1){_0x929459['body'][_0xefed('0x5a')][_0x45f912]={'filename':_0x929459[_0xefed('0x46')][_0xefed('0x5a')][_0x45f912][_0xefed('0x27')],'path':path[_0xefed('0x5b')](config[_0xefed('0x5c')],_0xefed('0x5d'),_0x929459[_0xefed('0x46')][_0xefed('0x5a')][_0x45f912]['basename'])};}}_0x358b36={'account':_0x3ff059,'message':_0x929459[_0xefed('0x46')]};return;}})['then'](function(){if(_0x3cc9f4[_0xefed('0x5e')]){if(_0x3cc9f4[_0xefed('0x5e')][_0xefed('0x5f')][_0xefed('0x33')]){return _0x3cc9f4[_0xefed('0x5e')][_0xefed('0x5f')][0x0];}else{return db['CmContact']['create'](_[_0xefed('0x60')](_0x929459[_0xefed('0x46')],{'firstName':_0x929459['body']['to'],'email':_0x929459[_0xefed('0x46')]['to'],'phone':_0x929459[_0xefed('0x46')]['to'],'ListId':_0x3cc9f4[_0xefed('0x61')]}));}}else{throw new Error(_0xefed('0x62'));}})['then'](function(){if(_0x358b36){return respondWithRpcPromise(_0xefed('0x63'),_0xefed('0x64'),_0x358b36,client9003)[_0xefed('0x23')](function(_0x599d3a){return _0x2ba8d9[_0xefed('0x22')]({'read':!![],'messageId':_0x599d3a[_0xefed('0x65')],'sentAt':moment()[_0xefed('0x66')](_0xefed('0x67'))});})[_0xefed('0x3f')](function(_0x1f1cb8){logger['error']('%s',JSON[_0xefed('0x16')](_0x1f1cb8));return _0x2ba8d9;});}return _0x2ba8d9;});}return _0x2ba8d9;}})[_0xefed('0x23')](respondWithResult(_0x589704,0xc9))['catch'](handleError(_0x589704,null));};exports[_0xefed('0x68')]=function(_0x396f40,_0x5e6a67){var _0x47ca61={'agent':{},'channel':_0xefed('0x69')};if(_0x396f40[_0xefed('0x46')]['id']){delete _0x396f40['body']['id'];}_0x396f40['body'][_0xefed('0x6a')]=!![];_0x396f40[_0xefed('0x46')][_0xefed('0x6b')]=moment()[_0xefed('0x66')](_0xefed('0x67'));_0x396f40[_0xefed('0x46')]['UserId']=_0x396f40[_0xefed('0x46')][_0xefed('0x6c')]||_0x396f40[_0xefed('0x58')]['id'];_0x47ca61[_0xefed('0x6d')]['id']=_0x396f40['body']['UserId'];return db['MailMessage']['find']({'where':{'id':_0x396f40[_0xefed('0x41')]['id'],'UserId':null}})[_0xefed('0x23')](handleEntityNotFound(_0x5e6a67,null))[_0xefed('0x23')](saveUpdates(_0x396f40[_0xefed('0x46')],null))[_0xefed('0x23')](function(_0x36c8c4){if(_0x36c8c4){_0x47ca61[_0xefed('0x19')]=_0x36c8c4[_0xefed('0x6e')]({'plain':!![]});return db[_0xefed('0x6f')][_0xefed('0x45')]({'where':{'id':_0x36c8c4[_0xefed('0x70')]}});}return null;})[_0xefed('0x23')](handleEntityNotFound(_0x5e6a67,null))['then'](function(_0x148a51){if(_0x148a51){return _0x148a51['update']({'UserId':_0x396f40['body'][_0xefed('0x6c')],'read1stAt':_['isNil'](_0x148a51[_0xefed('0x71')])?moment()[_0xefed('0x66')](_0xefed('0x67')):undefined});}return null;})[_0xefed('0x23')](function(_0x4b7e28){if(_0x4b7e28){_0x47ca61[_0xefed('0x72')]=_0x4b7e28[_0xefed('0x6e')]({'plain':!![]});interaction_log[_0xefed('0x12')](_0xefed('0x73'),_0x396f40[_0xefed('0x58')]['id'],_0x396f40[_0xefed('0x58')][_0xefed('0x27')],_0x396f40['user'][_0xefed('0x74')],_0x47ca61[_0xefed('0x72')]['id'],_0x396f40['body']?JSON[_0xefed('0x16')](_0x396f40[_0xefed('0x46')]):_0xefed('0x75'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x47ca61);}return null;})['then'](function(_0x172a04){var _0x30ec2e=_0xefed('0x76')+_0x172a04[_0xefed('0x19')][_0xefed('0x77')];return db[_0xefed('0x78')][_0xefed('0x2f')](_0x30ec2e,{'type':db['Sequelize'][_0xefed('0x79')][_0xefed('0x7a')],'raw':!![]})[_0xefed('0x23')](function(_0x5cc8ba){return _0x5cc8ba;});})['then'](function(_0x3784e9){if(_0x3784e9){_0x47ca61[_0xefed('0x19')][_0xefed('0x7b')]=_0x3784e9[0x0];if(!_0x396f40['body']['UserId'])return;return db[_0xefed('0x7c')][_0xefed('0x45')]({'where':{'id':_0x396f40[_0xefed('0x46')][_0xefed('0x6c')],'role':_0xefed('0x6d')},'attributes':['id',_0xefed('0x27'),_0xefed('0x7d'),_0xefed('0x7e'),_0xefed('0x7f')],'raw':!![]});}return null;})[_0xefed('0x23')](function(_0x1dd6f2){if(!_0x1dd6f2)return null;_0x47ca61[_0xefed('0x19')][_0xefed('0x6d')]=_0x1dd6f2;return _0x47ca61;})[_0xefed('0x23')](function(_0x5c48ef){if(_0x5c48ef){if(_0x396f40[_0xefed('0x46')]['manual']){_0x47ca61[_0xefed('0x19')]['interface']=util['format']('SIP/%s',_0x396f40[_0xefed('0x58')][_0xefed('0x27')]);_0x47ca61['message'][_0xefed('0x80')]=_0x47ca61[_0xefed('0x80')];_0x47ca61[_0xefed('0x19')][_0xefed('0x81')]=_0x47ca61[_0xefed('0x80')];_0x47ca61[_0xefed('0x19')][_0xefed('0x82')]=_0xefed('0x68');_0x47ca61[_0xefed('0x19')][_0xefed('0x46')]=htmlToText[_0xefed('0x83')](_0x47ca61[_0xefed('0x19')][_0xefed('0x46')]);return respondWithRpcPromise('EventManager',_0xefed('0x84'),{'event':_0xefed('0x85'),'message':_0x47ca61[_0xefed('0x19')]},client9002)[_0xefed('0x23')](function(){return _0x47ca61;});}return _0x47ca61;}return null;})[_0xefed('0x23')](respondWithResult(_0x5e6a67,null))[_0xefed('0x3f')](handleError(_0x5e6a67,null));};exports[_0xefed('0x86')]=function(_0x39f3f1,_0x1eedd2){var _0x1a5848={'agent':{},'channel':_0xefed('0x69')};if(_0x39f3f1[_0xefed('0x46')]['id']){delete _0x39f3f1[_0xefed('0x46')]['id'];}_0x39f3f1[_0xefed('0x46')][_0xefed('0x6c')]=_0x39f3f1[_0xefed('0x46')][_0xefed('0x6c')]||_0x39f3f1['user']['id'];_0x1a5848[_0xefed('0x6d')]['id']=_0x39f3f1['body'][_0xefed('0x6c')];return db['MailMessage'][_0xefed('0x45')]({'where':{'id':_0x39f3f1[_0xefed('0x41')]['id'],'UserId':null}})[_0xefed('0x23')](handleEntityNotFound(_0x1eedd2,null))[_0xefed('0x23')](function(_0x13368d){if(_0x13368d){_0x1a5848['message']=_0x13368d['get']({'plain':!![]});return db[_0xefed('0x6f')][_0xefed('0x45')]({'where':{'id':_0x13368d[_0xefed('0x70')]}});}return null;})['then'](handleEntityNotFound(_0x1eedd2,null))[_0xefed('0x23')](function(_0x4da2c2){if(_0x4da2c2){_0x1a5848['interaction']=_0x4da2c2[_0xefed('0x6e')]({'plain':!![]});interaction_log[_0xefed('0x12')](_0xefed('0x87'),_0x39f3f1['user']['id'],_0x39f3f1[_0xefed('0x58')][_0xefed('0x27')],_0x39f3f1[_0xefed('0x58')]['role'],_0x1a5848[_0xefed('0x72')]['id'],_0x39f3f1[_0xefed('0x46')]?JSON[_0xefed('0x16')](_0x39f3f1['body']):_0xefed('0x75'));return respondWithRpcPromise('RejectMessage',_0xefed('0x88'),_0x1a5848);}return null;})[_0xefed('0x23')](function(_0xd769b0){var _0xc0f557=_0xefed('0x76')+_0xd769b0[_0xefed('0x19')][_0xefed('0x77')];return db[_0xefed('0x78')]['query'](_0xc0f557,{'type':db[_0xefed('0x89')][_0xefed('0x79')]['SELECT'],'raw':!![]})[_0xefed('0x23')](function(_0x2c2245){return _0x2c2245;});})[_0xefed('0x23')](function(_0x1cec41){if(_0x1cec41){_0x1a5848[_0xefed('0x19')]['contact']=_0x1cec41[0x0];if(!_0x39f3f1[_0xefed('0x46')][_0xefed('0x6c')])return;return db[_0xefed('0x7c')]['find']({'where':{'id':_0x39f3f1['body'][_0xefed('0x6c')],'role':_0xefed('0x6d')},'attributes':['id',_0xefed('0x27'),_0xefed('0x7d'),_0xefed('0x7e'),_0xefed('0x7f')],'raw':!![]});}return null;})[_0xefed('0x23')](function(_0x4cf5a0){if(!_0x4cf5a0)return null;_0x1a5848[_0xefed('0x19')]['agent']=_0x4cf5a0;return _0x1a5848;})[_0xefed('0x23')](function(_0x2951c0){if(_0x2951c0){_0x2951c0[_0xefed('0x19')][_0xefed('0x8a')]=util['format'](_0xefed('0x8b'),_0x39f3f1[_0xefed('0x58')][_0xefed('0x27')]);_0x2951c0[_0xefed('0x19')][_0xefed('0x80')]=_0x1a5848[_0xefed('0x80')];_0x2951c0[_0xefed('0x19')]['motionChannel']=_0x1a5848['channel'];_0x2951c0['message']['event']=_0xefed('0x86');_0x2951c0['message'][_0xefed('0x46')]=htmlToText[_0xefed('0x83')](_0x1a5848[_0xefed('0x19')]['body']);respondWithRpcPromise(_0xefed('0x84'),_0xefed('0x84'),{'event':_0xefed('0x8c'),'message':_0x2951c0[_0xefed('0x19')]},client9002);return _0x1a5848;}return null;})['then'](respondWithResult(_0x1eedd2,null))[_0xefed('0x3f')](handleError(_0x1eedd2,null));};exports['download']=function(_0x41d798,_0x45b720){var _0xbf6b9=moment()[_0xefed('0x8d')]()['toString']();var _0x861a86=path[_0xefed('0x5b')](config[_0xefed('0x5c')],'server',_0xefed('0x8e'),_0xefed('0x8f'));var _0x37945d=path[_0xefed('0x5b')](config[_0xefed('0x5c')],_0xefed('0x90'),'files',_0xefed('0x5a'));var _0x564aff=util[_0xefed('0x66')](_0xefed('0x91'),_0xbf6b9);return db['MailMessage'][_0xefed('0x45')]({'where':{'id':_0x41d798[_0xefed('0x41')]['id']},'attributes':['id','body',_0xefed('0x92'),'to','cc',_0xefed('0x93'),_0xefed('0x94'),_0xefed('0x95')],'include':_0x41d798[_0xefed('0x2f')][_0xefed('0x5a')]?[{'model':db[_0xefed('0x96')],'as':_0xefed('0x97')}]:undefined})[_0xefed('0x23')](handleEntityNotFound(_0x45b720,null))[_0xefed('0x23')](function(_0x516c86){if(_0x516c86){var _0x2e2037=_0x516c86;var _0xe4511c={'from':_0x2e2037[_0xefed('0x92')],'to':_0x2e2037['to'],'subject':_0x2e2037[_0xefed('0x94')],'html':_0x2e2037[_0xefed('0x46')],'headers':{'Date':moment(_0x2e2037[_0xefed('0x95')])[_0xefed('0x66')](_0xefed('0x98'))},'attachments':[]};if(_0x516c86['cc']){_0xe4511c[_0xefed('0x99')]['Cc']=_0x516c86['cc'];}if(_0x516c86[_0xefed('0x93')]){_0xe4511c[_0xefed('0x99')][_0xefed('0x9a')]=_0x516c86[_0xefed('0x93')];}return new BPromise(function(_0x2d5d56,_0x58cb89){if(_0x516c86['Attachments']){for(var _0x42d06e=0x0;_0x42d06e<_0x516c86[_0xefed('0x97')][_0xefed('0x33')];_0x42d06e++){var _0x28b762=_0x516c86[_0xefed('0x97')][_0x42d06e];var _0x121e29=path[_0xefed('0x5b')](_0x37945d,_0x28b762[_0xefed('0x9b')]);if(fs[_0xefed('0x9c')](_0x121e29)){_0xe4511c[_0xefed('0x5a')]['push']({'name':_0x28b762[_0xefed('0x27')],'contentType':_0x28b762['type'],'data':fs[_0xefed('0x9d')](_0x121e29)});}}}emlformat['build'](_0xe4511c,function(_0x4e55a2,_0x260f62){if(_0x4e55a2)return _0x58cb89(_0x4e55a2);fs[_0xefed('0x9e')](path['join'](_0x861a86,_0x564aff),_0x260f62);return _0x2d5d56(_0x260f62);});});}})[_0xefed('0x23')](function(_0x5b1d2d){if(_0x5b1d2d){return _0x45b720['download'](path[_0xefed('0x5b')](_0x861a86,_0x564aff),_0x564aff,function(_0xc86640){if(!_0xc86640)fs[_0xefed('0x9f')](path['join'](_0x861a86,_0x564aff));});}})[_0xefed('0x3f')](handleError(_0x45b720,null));};
\ No newline at end of file
index 7cfdf41..6c91fbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd552=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','save','update'];(function(_0x20f900,_0x5e70e6){var _0x35a07c=function(_0xf9d90b){while(--_0xf9d90b){_0x20f900['push'](_0x20f900['shift']());}};_0x35a07c(++_0x5e70e6);}(_0xd552,0x194));var _0x2d55=function(_0x5f3b8e,_0x587b94){_0x5f3b8e=_0x5f3b8e-0x0;var _0x510d99=_0xd552[_0x5f3b8e];return _0x510d99;};'use strict';var EventEmitter=require(_0x2d55('0x0'));var MailMessage=require(_0x2d55('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2d55('0x2'),'afterUpdate':_0x2d55('0x3'),'afterDestroy':_0x2d55('0x4')};function emitEvent(_0x590c2c){return function(_0x487172,_0x39f578,_0x5e0a40){MailMessageEvents[_0x2d55('0x5')](_0x590c2c+':'+_0x487172['id'],_0x487172);MailMessageEvents[_0x2d55('0x5')](_0x590c2c,_0x487172);_0x5e0a40(null);};}for(var e in events){if(events[_0x2d55('0x6')](e)){var event=events[e];MailMessage[_0x2d55('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
+var _0x317f=['events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x317f,0x1cb));var _0xf317=function(_0x1c06f4,_0x2feba6){_0x1c06f4=_0x1c06f4-0x0;var _0x1a727e=_0x317f[_0x1c06f4];return _0x1a727e;};'use strict';var EventEmitter=require(_0xf317('0x0'));var MailMessage=require(_0xf317('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf317('0x2'),'afterUpdate':_0xf317('0x3'),'afterDestroy':_0xf317('0x4')};function emitEvent(_0x1a1fc7){return function(_0x418be9,_0x2f601b,_0x55fe1d){MailMessageEvents[_0xf317('0x5')](_0x1a1fc7+':'+_0x418be9['id'],_0x418be9);MailMessageEvents['emit'](_0x1a1fc7,_0x418be9);_0x55fe1d(null);};}for(var e in events){if(events[_0xf317('0x6')](e)){var event=events[e];MailMessage[_0xf317('0x7')](e,emitEvent(event));}}module[_0xf317('0x8')]=MailMessageEvents;
\ No newline at end of file
index 579f8de..d885e4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25a5=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','subject','FULLTEXT','body','models','get','toLowerCase','secret','isNil','MailInteraction','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x5edf79,_0x5ad1ae){var _0x23b949=function(_0x4eb1bc){while(--_0x4eb1bc){_0x5edf79['push'](_0x5edf79['shift']());}};_0x23b949(++_0x5ad1ae);}(_0x25a5,0x1cd));var _0x525a=function(_0x59a75c,_0x2596b0){_0x59a75c=_0x59a75c-0x0;var _0x41203f=_0x25a5[_0x59a75c];return _0x41203f;};'use strict';var _=require(_0x525a('0x0'));var util=require(_0x525a('0x1'));var logger=require(_0x525a('0x2'))(_0x525a('0x3'));var moment=require(_0x525a('0x4'));var BPromise=require(_0x525a('0x5'));var rp=require(_0x525a('0x6'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x525a('0x7'));var rimraf=require(_0x525a('0x8'));var config=require(_0x525a('0x9'));var attributes=require(_0x525a('0xa'));module[_0x525a('0xb')]=function(_0x5aff8d,_0x7f66bf){return _0x5aff8d['define'](_0x525a('0xc'),attributes,{'tableName':_0x525a('0xd'),'paranoid':![],'indexes':[{'name':_0x525a('0xe'),'fields':[_0x525a('0xe')]},{'name':'fti_mail_messages','fields':['plainBody',_0x525a('0xf')],'type':_0x525a('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x444d64,_0x442451,_0x5001ef){if(_0x444d64[_0x525a('0x11')]){_0x444d64['plainBody']=htmlToText['fromString'](_0x444d64['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5001ef(null,_0x442451);},'afterCreate':function(_0x67f75f,_0xea3f12,_0xf3a859){var _0x4dd511=_0x5aff8d[_0x525a('0x12')];var _0x5058e5=_0x67f75f[_0x525a('0x13')]({'plain':!![]});if(_0x5058e5['direction'][_0x525a('0x14')]()==='in'||_0x5058e5['direction']['toLowerCase']()==='out'&&!_0x5058e5[_0x525a('0x15')]&&!_[_0x525a('0x16')](_0x5058e5['UserId'])){_0x4dd511[_0x525a('0x17')][_0x525a('0x18')]({'where':{'id':_0x5058e5[_0x525a('0x19')]}})['then'](function(_0x5c1ed5){if(_0x5c1ed5){_0x5c1ed5[_0x525a('0x1a')]({'lastMsgAt':_0x5058e5[_0x525a('0x1b')],'lastMsgDirection':_0x5058e5['direction'][_0x525a('0x14')]()});}})[_0x525a('0x1c')](function(_0x1b5a33){console[_0x525a('0x1d')](_0x1b5a33);});}_0xf3a859();}},'charset':'utf8mb4','collate':_0x525a('0x1e')});};
\ No newline at end of file
+var _0xb4ed=['define','MailMessage','messageId','fti_mail_messages','subject','body','plainBody','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','exports'];(function(_0x598615,_0x19ad8d){var _0x1566e5=function(_0x2475b1){while(--_0x2475b1){_0x598615['push'](_0x598615['shift']());}};_0x1566e5(++_0x19ad8d);}(_0xb4ed,0x7d));var _0xdb4e=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0xb4ed[_0x529296];return _0x1796bf;};'use strict';var _=require('lodash');var util=require(_0xdb4e('0x0'));var logger=require(_0xdb4e('0x1'))(_0xdb4e('0x2'));var moment=require(_0xdb4e('0x3'));var BPromise=require(_0xdb4e('0x4'));var rp=require(_0xdb4e('0x5'));var htmlToText=require(_0xdb4e('0x6'));var fs=require('fs');var path=require(_0xdb4e('0x7'));var rimraf=require(_0xdb4e('0x8'));var config=require('../../config/environment');var attributes=require(_0xdb4e('0x9'));module[_0xdb4e('0xa')]=function(_0x203db6,_0x293ec8){return _0x203db6[_0xdb4e('0xb')](_0xdb4e('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xdb4e('0xd'),'fields':[_0xdb4e('0xd')]},{'name':_0xdb4e('0xe'),'fields':['plainBody',_0xdb4e('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2dcfe2,_0x3f9e64,_0x2bb858){if(_0x2dcfe2[_0xdb4e('0x10')]){_0x2dcfe2[_0xdb4e('0x11')]=htmlToText[_0xdb4e('0x12')](_0x2dcfe2['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2bb858(null,_0x3f9e64);},'afterCreate':function(_0x1b623f,_0x1f40df,_0x22e349){var _0x194db8=_0x203db6[_0xdb4e('0x13')];var _0x581c77=_0x1b623f[_0xdb4e('0x14')]({'plain':!![]});if(_0x581c77[_0xdb4e('0x15')][_0xdb4e('0x16')]()==='in'||_0x581c77[_0xdb4e('0x15')][_0xdb4e('0x16')]()===_0xdb4e('0x17')&&!_0x581c77[_0xdb4e('0x18')]&&!_[_0xdb4e('0x19')](_0x581c77[_0xdb4e('0x1a')])){_0x194db8[_0xdb4e('0x1b')][_0xdb4e('0x1c')]({'where':{'id':_0x581c77['MailInteractionId']}})[_0xdb4e('0x1d')](function(_0x292919){if(_0x292919){_0x292919[_0xdb4e('0x1e')]({'lastMsgAt':_0x581c77[_0xdb4e('0x1f')],'lastMsgDirection':_0x581c77[_0xdb4e('0x15')]['toLowerCase']()});}})['catch'](function(_0x7acf37){console['error'](_0x7acf37);});}_0x22e349();}},'charset':_0xdb4e('0x20'),'collate':_0xdb4e('0x21')});};
\ No newline at end of file
index 0156744..398058f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x896e=['request\x20sent','debug','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','options','raw','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s'];(function(_0x447c13,_0x294cfc){var _0x46a0dc=function(_0x19316c){while(--_0x19316c){_0x447c13['push'](_0x447c13['shift']());}};_0x46a0dc(++_0x294cfc);}(_0x896e,0x1e9));var _0xe896=function(_0x39f326,_0x5899b5){_0x39f326=_0x39f326-0x0;var _0x1407f0=_0x896e[_0x39f326];return _0x1407f0;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});config[_0xe896('0xd')]=_[_0xe896('0xe')](config[_0xe896('0xd')],{'host':_0xe896('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe896('0xd')]));require(_0xe896('0x10'))[_0xe896('0x11')](socket);function respondWithRpcPromise(_0x4afd3f,_0x305616,_0x48251e){return new BPromise(function(_0x45b15b,_0x5be679){return client[_0xe896('0x12')](_0x4afd3f,_0x48251e)[_0xe896('0x13')](function(_0xa00ae9){logger['info'](_0xe896('0x14'),_0x305616,_0xe896('0x15'));logger[_0xe896('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x305616,_0xe896('0x15'),JSON[_0xe896('0x17')](_0xa00ae9));if(_0xa00ae9[_0xe896('0x18')]){if(_0xa00ae9['error'][_0xe896('0x19')]===0x1f4){logger[_0xe896('0x18')](_0xe896('0x14'),_0x305616,_0xa00ae9['error']['message']);return _0x5be679(_0xa00ae9[_0xe896('0x18')][_0xe896('0x1a')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x305616,_0xa00ae9[_0xe896('0x18')][_0xe896('0x1a')]);return _0x45b15b(_0xa00ae9['error'][_0xe896('0x1a')]);}else{logger['info'](_0xe896('0x14'),_0x305616,_0xe896('0x15'));_0x45b15b(_0xa00ae9[_0xe896('0x1b')]['message']);}})[_0xe896('0x1c')](function(_0x9714f1){logger[_0xe896('0x18')](_0xe896('0x14'),_0x305616,_0x9714f1);_0x5be679(_0x9714f1);});});}exports[_0xe896('0x1d')]=function(_0x3ac8b8){var _0x388c2e=this;return new Promise(function(_0x32d3d3,_0x49547b){return db[_0xe896('0x1e')]['create'](_0x3ac8b8['body'],{'raw':_0x3ac8b8[_0xe896('0x1f')]?_0x3ac8b8[_0xe896('0x1f')][_0xe896('0x20')]===undefined?!![]:![]:!![]})[_0xe896('0x13')](function(_0x498469){logger[_0xe896('0x21')]('CreateMailMessage',_0x3ac8b8);logger['debug'](_0xe896('0x1d'),_0x3ac8b8,JSON[_0xe896('0x17')](_0x498469));_0x32d3d3(_0x498469);})[_0xe896('0x1c')](function(_0x2e2c10){logger[_0xe896('0x18')](_0xe896('0x1d'),_0x2e2c10[_0xe896('0x1a')],_0x3ac8b8);_0x49547b(_0x388c2e['error'](0x1f4,_0x2e2c10[_0xe896('0x1a')]));});});};
\ No newline at end of file
+var _0x36ee=['catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateMailMessage','MailMessage','create','body','options','debug'];(function(_0x51851d,_0x53b527){var _0x3aafd1=function(_0x4850c8){while(--_0x4850c8){_0x51851d['push'](_0x51851d['shift']());}};_0x3aafd1(++_0x53b527);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});config[_0xe36e('0xb')]=_[_0xe36e('0xc')](config['redis'],{'host':_0xe36e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe36e('0xb')]));require(_0xe36e('0xe'))[_0xe36e('0xf')](socket);function respondWithRpcPromise(_0x47ce3a,_0xf119e4,_0x48981b){return new BPromise(function(_0x2e968d,_0x2133cf){return client[_0xe36e('0x10')](_0x47ce3a,_0x48981b)[_0xe36e('0x11')](function(_0xce0110){logger[_0xe36e('0x12')](_0xe36e('0x13'),_0xf119e4,_0xe36e('0x14'));logger['debug'](_0xe36e('0x15'),_0xf119e4,_0xe36e('0x14'),JSON[_0xe36e('0x16')](_0xce0110));if(_0xce0110[_0xe36e('0x17')]){if(_0xce0110['error'][_0xe36e('0x18')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0xf119e4,_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);return _0x2133cf(_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);}logger[_0xe36e('0x17')](_0xe36e('0x13'),_0xf119e4,_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);return _0x2e968d(_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);}else{logger['info'](_0xe36e('0x13'),_0xf119e4,_0xe36e('0x14'));_0x2e968d(_0xce0110['result'][_0xe36e('0x19')]);}})['catch'](function(_0x471400){logger[_0xe36e('0x17')]('MailMessage,\x20%s,\x20%s',_0xf119e4,_0x471400);_0x2133cf(_0x471400);});});}exports[_0xe36e('0x1a')]=function(_0x6aa186){var _0x21efe7=this;return new Promise(function(_0x597331,_0x21e95e){return db[_0xe36e('0x1b')][_0xe36e('0x1c')](_0x6aa186[_0xe36e('0x1d')],{'raw':_0x6aa186[_0xe36e('0x1e')]?_0x6aa186[_0xe36e('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xe36e('0x11')](function(_0x4f214a){logger[_0xe36e('0x12')](_0xe36e('0x1a'),_0x6aa186);logger[_0xe36e('0x1f')]('CreateMailMessage',_0x6aa186,JSON['stringify'](_0x4f214a));_0x597331(_0x4f214a);})[_0xe36e('0x20')](function(_0x10818d){logger[_0xe36e('0x17')](_0xe36e('0x1a'),_0x10818d[_0xe36e('0x19')],_0x6aa186);_0x21e95e(_0x21efe7[_0xe36e('0x17')](0x1f4,_0x10818d[_0xe36e('0x19')]));});});};
\ No newline at end of file
index 288f497..6239c57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd53a=['remove','emit','removeListener','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x315f2a,_0x3246b1){var _0x233050=function(_0x439270){while(--_0x439270){_0x315f2a['push'](_0x315f2a['shift']());}};_0x233050(++_0x3246b1);}(_0xd53a,0x14e));var _0xad53=function(_0x17cfe3,_0x11e281){_0x17cfe3=_0x17cfe3-0x0;var _0x11954e=_0xd53a[_0x17cfe3];return _0x11954e;};'use strict';var MailMessageEvents=require(_0xad53('0x0'));var events=[_0xad53('0x1'),_0xad53('0x2'),'update'];function createListener(_0x2ac8e7,_0x36d642){return function(_0x116aba){_0x36d642[_0xad53('0x3')](_0x2ac8e7,_0x116aba);};}function removeListener(_0x2f1b3c,_0x19de86){return function(){MailMessageEvents[_0xad53('0x4')](_0x2f1b3c,_0x19de86);};}exports[_0xad53('0x5')]=function(_0x384211){for(var _0x1cceca=0x0,_0x2ee6bc=events[_0xad53('0x6')];_0x1cceca<_0x2ee6bc;_0x1cceca++){var _0xf4c56=events[_0x1cceca];var _0x32be8a=createListener(_0xad53('0x7')+_0xf4c56,_0x384211);MailMessageEvents['on'](_0xf4c56,_0x32be8a);}};
\ No newline at end of file
+var _0x9234=['emit','removeListener','register','length','mailMessage:','./mailMessage.events','remove','update'];(function(_0x268ac2,_0x23ce50){var _0x3311f0=function(_0x3c0485){while(--_0x3c0485){_0x268ac2['push'](_0x268ac2['shift']());}};_0x3311f0(++_0x23ce50);}(_0x9234,0x1bd));var _0x4923=function(_0x388b47,_0x5cdac5){_0x388b47=_0x388b47-0x0;var _0x4859df=_0x9234[_0x388b47];return _0x4859df;};'use strict';var MailMessageEvents=require(_0x4923('0x0'));var events=['save',_0x4923('0x1'),_0x4923('0x2')];function createListener(_0x1f0d3a,_0x34915b){return function(_0x481178){_0x34915b[_0x4923('0x3')](_0x1f0d3a,_0x481178);};}function removeListener(_0x436ce1,_0x4bf615){return function(){MailMessageEvents[_0x4923('0x4')](_0x436ce1,_0x4bf615);};}exports[_0x4923('0x5')]=function(_0x526ad7){for(var _0x3c5e3f=0x0,_0x17b854=events[_0x4923('0x6')];_0x3c5e3f<_0x17b854;_0x3c5e3f++){var _0x2de396=events[_0x3c5e3f];var _0x548676=createListener(_0x4923('0x7')+_0x2de396,_0x526ad7);MailMessageEvents['on'](_0x2de396,_0x548676);}};
\ No newline at end of file
index 1d7ef99..41f9888 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd726=['delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/members','getMembers','/:id/teams','getAgents','post','addTeams','/:id/users','addAgents','put','/:id'];(function(_0x3f37b4,_0x437f2b){var _0x208b61=function(_0x4bfca9){while(--_0x4bfca9){_0x3f37b4['push'](_0x3f37b4['shift']());}};_0x208b61(++_0x437f2b);}(_0xd726,0xd4));var _0x6d72=function(_0x5ccf52,_0x1c873e){_0x5ccf52=_0x5ccf52-0x0;var _0x36604a=_0xd726[_0x5ccf52];return _0x36604a;};'use strict';var multer=require(_0x6d72('0x0'));var util=require(_0x6d72('0x1'));var path=require(_0x6d72('0x2'));var timeout=require(_0x6d72('0x3'));var express=require(_0x6d72('0x4'));var router=express[_0x6d72('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6d72('0x6'));var interaction=require(_0x6d72('0x7'));var config=require(_0x6d72('0x8'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0x6d72('0x9')](),controller[_0x6d72('0xa')]);router[_0x6d72('0xb')]('/describe',auth[_0x6d72('0x9')](),controller['describe']);router[_0x6d72('0xb')]('/:id',auth[_0x6d72('0x9')](),controller['show']);router[_0x6d72('0xb')](_0x6d72('0xc'),auth[_0x6d72('0x9')](),controller[_0x6d72('0xd')]);router[_0x6d72('0xb')](_0x6d72('0xe'),auth[_0x6d72('0x9')](),controller['getTeams']);router[_0x6d72('0xb')]('/:id/users',auth[_0x6d72('0x9')](),controller[_0x6d72('0xf')]);router[_0x6d72('0x10')]('/',auth[_0x6d72('0x9')](),controller['create']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x6d72('0x11')]);router[_0x6d72('0x10')](_0x6d72('0x12'),auth[_0x6d72('0x9')](),controller[_0x6d72('0x13')]);router[_0x6d72('0x14')](_0x6d72('0x15'),auth[_0x6d72('0x9')](),controller['update']);router[_0x6d72('0x16')](_0x6d72('0x15'),auth[_0x6d72('0x9')](),controller['destroy']);router[_0x6d72('0x16')]('/:id/teams',auth[_0x6d72('0x9')](),controller[_0x6d72('0x17')]);router[_0x6d72('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x6d72('0x18')]);module[_0x6d72('0x19')]=router;
\ No newline at end of file
+var _0x25fa=['/:id/users','post','create','/:id/teams','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','getTeams'];(function(_0x4ab36f,_0x35d528){var _0x116f2e=function(_0x5097a8){while(--_0x5097a8){_0x4ab36f['push'](_0x4ab36f['shift']());}};_0x116f2e(++_0x35d528);}(_0x25fa,0x184));var _0xa25f=function(_0x49252d,_0x2077d7){_0x49252d=_0x49252d-0x0;var _0x77a1e2=_0x25fa[_0x49252d];return _0x77a1e2;};'use strict';var multer=require(_0xa25f('0x0'));var util=require('util');var path=require(_0xa25f('0x1'));var timeout=require(_0xa25f('0x2'));var express=require('express');var router=express[_0xa25f('0x3')]();var fs_extra=require(_0xa25f('0x4'));var auth=require(_0xa25f('0x5'));var interaction=require(_0xa25f('0x6'));var config=require(_0xa25f('0x7'));var controller=require(_0xa25f('0x8'));router[_0xa25f('0x9')]('/',auth[_0xa25f('0xa')](),controller[_0xa25f('0xb')]);router['get'](_0xa25f('0xc'),auth[_0xa25f('0xa')](),controller[_0xa25f('0xd')]);router['get'](_0xa25f('0xe'),auth[_0xa25f('0xa')](),controller['show']);router[_0xa25f('0x9')](_0xa25f('0xf'),auth[_0xa25f('0xa')](),controller[_0xa25f('0x10')]);router[_0xa25f('0x9')]('/:id/teams',auth[_0xa25f('0xa')](),controller[_0xa25f('0x11')]);router[_0xa25f('0x9')](_0xa25f('0x12'),auth['isAuthenticated'](),controller['getAgents']);router[_0xa25f('0x13')]('/',auth[_0xa25f('0xa')](),controller[_0xa25f('0x14')]);router[_0xa25f('0x13')](_0xa25f('0x15'),auth[_0xa25f('0xa')](),controller[_0xa25f('0x16')]);router['post'](_0xa25f('0x12'),auth[_0xa25f('0xa')](),controller['addAgents']);router['put']('/:id',auth[_0xa25f('0xa')](),controller[_0xa25f('0x17')]);router[_0xa25f('0x18')](_0xa25f('0xe'),auth[_0xa25f('0xa')](),controller[_0xa25f('0x19')]);router['delete'](_0xa25f('0x15'),auth[_0xa25f('0xa')](),controller[_0xa25f('0x1a')]);router[_0xa25f('0x18')](_0xa25f('0x12'),auth[_0xa25f('0xa')](),controller[_0xa25f('0x1b')]);module[_0xa25f('0x1c')]=router;
\ No newline at end of file
index caad1fe..e52d271 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebfb=['INTEGER','ENUM','rrmemory','roundrobin','STRING','name'];(function(_0x3bb706,_0xe79098){var _0x3e9bac=function(_0x51203d){while(--_0x51203d){_0x3bb706['push'](_0x3bb706['shift']());}};_0x3e9bac(++_0xe79098);}(_0xebfb,0xac));var _0xbebf=function(_0x38c77e,_0xc2d593){_0x38c77e=_0x38c77e-0x0;var _0x430fa5=_0xebfb[_0x38c77e];return _0x430fa5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbebf('0x0')],'unique':_0xbebf('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbebf('0x0')]},'timeout':{'type':Sequelize[_0xbebf('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbebf('0x3')](_0xbebf('0x4'),'beepall',_0xbebf('0x5'))}};
\ No newline at end of file
+var _0x13a6=['beepall','roundrobin','sequelize','exports','name','INTEGER','ENUM','rrmemory'];(function(_0x611c1b,_0x23f1d4){var _0x37f949=function(_0x5505fe){while(--_0x5505fe){_0x611c1b['push'](_0x611c1b['shift']());}};_0x37f949(++_0x23f1d4);}(_0x13a6,0x17a));var _0x613a=function(_0x506fd0,_0x475151){_0x506fd0=_0x506fd0-0x0;var _0x48e255=_0x13a6[_0x506fd0];return _0x48e255;};'use strict';var Sequelize=require(_0x613a('0x0'));module[_0x613a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x613a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x613a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x613a('0x4')](_0x613a('0x5'),_0x613a('0x6'),_0x613a('0x7'))}};
\ No newline at end of file
index 92bfd81..a9a7f5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x593e=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','getMembers','findOne','UserMailQueue','length','nolimit','MailQueueId','findAll','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','ids','Agents','online','interface','flatMap','sequelize','addTeams','emit','userMailQueue:save','removeTeams','User','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','transaction','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','count','Content-Range','reject','save','update','then','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x593e,0xcb));var _0xe593=function(_0x4ce692,_0x2f1a45){_0x4ce692=_0x4ce692-0x0;var _0x4a5ee7=_0x593e[_0x4ce692];return _0x4a5ee7;};'use strict';var emlformat=require(_0xe593('0x0'));var rimraf=require(_0xe593('0x1'));var zipdir=require(_0xe593('0x2'));var jsonpatch=require(_0xe593('0x3'));var rp=require(_0xe593('0x4'));var moment=require(_0xe593('0x5'));var BPromise=require(_0xe593('0x6'));var Mustache=require(_0xe593('0x7'));var util=require('util');var path=require(_0xe593('0x8'));var sox=require(_0xe593('0x9'));var csv=require(_0xe593('0xa'));var ejs=require(_0xe593('0xb'));var fs=require('fs');var fs_extra=require(_0xe593('0xc'));var _=require(_0xe593('0xd'));var squel=require(_0xe593('0xe'));var crypto=require(_0xe593('0xf'));var jsforce=require(_0xe593('0x10'));var deskjs=require(_0xe593('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe593('0x12'));var Papa=require(_0xe593('0x13'));var Redis=require(_0xe593('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe593('0x15'));var hardwareService=require(_0xe593('0x16'));var logger=require(_0xe593('0x17'))('api');var utils=require(_0xe593('0x18'));var config=require(_0xe593('0x19'));var licenseUtil=require(_0xe593('0x1a'));var db=require(_0xe593('0x1b'))['db'];config[_0xe593('0x1c')]=_[_0xe593('0x1d')](config[_0xe593('0x1c')],{'host':_0xe593('0x1e'),'port':0x18eb});var socket=require(_0xe593('0x1f'))(new Redis(config[_0xe593('0x1c')]));require('./mailQueue.socket')[_0xe593('0x20')](socket);function respondWithStatusCode(_0x1de391,_0x59f7c4){_0x59f7c4=_0x59f7c4||0xcc;return function(_0x38418c){if(_0x38418c){return _0x1de391[_0xe593('0x21')](_0x59f7c4);}return _0x1de391['status'](_0x59f7c4)[_0xe593('0x22')]();};}function respondWithResult(_0x40416c,_0x1c6de3){_0x1c6de3=_0x1c6de3||0xc8;return function(_0x2d525c){if(_0x2d525c){return _0x40416c[_0xe593('0x23')](_0x1c6de3)[_0xe593('0x24')](_0x2d525c);}};}function respondWithFilteredResult(_0x48f3b4,_0xfbc79f){return function(_0x470d07){if(_0x470d07){var _0x5f57ce=typeof _0xfbc79f[_0xe593('0x25')]===_0xe593('0x26')&&typeof _0xfbc79f['limit']===_0xe593('0x26');var _0x3dba1b=_0x470d07[_0xe593('0x27')];var _0x321115=_0x5f57ce?0x0:_0xfbc79f[_0xe593('0x25')];var _0x28ee05=_0x5f57ce?_0x470d07[_0xe593('0x27')]:_0xfbc79f['offset']+_0xfbc79f['limit'];var _0x1634d4;if(_0x28ee05>=_0x3dba1b){_0x28ee05=_0x3dba1b;_0x1634d4=0xc8;}else{_0x1634d4=0xce;}_0x48f3b4['status'](_0x1634d4);return _0x48f3b4['set'](_0xe593('0x28'),_0x321115+'-'+_0x28ee05+'/'+_0x3dba1b)[_0xe593('0x24')](_0x470d07);}return null;};}function patchUpdates(_0x57379d){return function(_0xf57cc4){try{jsonpatch['apply'](_0xf57cc4,_0x57379d,!![]);}catch(_0x1672bf){return BPromise[_0xe593('0x29')](_0x1672bf);}return _0xf57cc4[_0xe593('0x2a')]();};}function saveUpdates(_0x44d997,_0x39103d){return function(_0x1d57ca){if(_0x1d57ca){return _0x1d57ca[_0xe593('0x2b')](_0x44d997)[_0xe593('0x2c')](function(_0x4fc483){return _0x4fc483;});}return null;};}function removeEntity(_0x47aea,_0x347d7d){return function(_0x480218){if(_0x480218){return _0x480218['destroy']()[_0xe593('0x2c')](function(){var _0x25238f=_0x480218[_0xe593('0x2d')]({'plain':!![]});var _0x43699d=_0xe593('0x2e');return db[_0xe593('0x2f')]['destroy']({'where':{'type':_0x43699d,'resourceId':_0x25238f['id']}})[_0xe593('0x2c')](function(){return _0x480218;});})['then'](function(){_0x47aea[_0xe593('0x23')](0xcc)[_0xe593('0x22')]();});}};}function handleEntityNotFound(_0x4a2eaa,_0x337ee0){return function(_0x561a01){if(!_0x561a01){_0x4a2eaa[_0xe593('0x21')](0x194);}return _0x561a01;};}function handleError(_0x1c147b,_0x1618af){_0x1618af=_0x1618af||0x1f4;return function(_0x501e54){logger[_0xe593('0x30')](_0x501e54[_0xe593('0x31')]);if(_0x501e54[_0xe593('0x32')]){delete _0x501e54[_0xe593('0x32')];}_0x1c147b[_0xe593('0x23')](_0x1618af)[_0xe593('0x33')](_0x501e54);};}exports[_0xe593('0x34')]=function(_0x4efc93,_0x4098a9){var _0xc23a2f={},_0x4e8448={},_0xe5e728={'count':0x0,'rows':[]};var _0x571995=_[_0xe593('0x35')](db[_0xe593('0x36')][_0xe593('0x37')],function(_0x3f64d0){return{'name':_0x3f64d0[_0xe593('0x38')],'type':_0x3f64d0[_0xe593('0x39')][_0xe593('0x3a')]};});_0x4e8448[_0xe593('0x3b')]=_[_0xe593('0x35')](_0x571995,_0xe593('0x32'));_0x4e8448['query']=_[_0xe593('0x3c')](_0x4efc93[_0xe593('0x3d')]);_0x4e8448[_0xe593('0x3e')]=_['intersection'](_0x4e8448['model'],_0x4e8448[_0xe593('0x3d')]);_0xc23a2f['attributes']=_[_0xe593('0x3f')](_0x4e8448[_0xe593('0x3b')],qs[_0xe593('0x40')](_0x4efc93[_0xe593('0x3d')][_0xe593('0x40')]));_0xc23a2f[_0xe593('0x41')]=_0xc23a2f[_0xe593('0x41')]['length']?_0xc23a2f['attributes']:_0x4e8448[_0xe593('0x3b')];if(!_0x4efc93['query'][_0xe593('0x42')]('nolimit')){_0xc23a2f[_0xe593('0x43')]=qs['limit'](_0x4efc93['query'][_0xe593('0x43')]);_0xc23a2f[_0xe593('0x25')]=qs[_0xe593('0x25')](_0x4efc93['query']['offset']);}_0xc23a2f['order']=qs[_0xe593('0x44')](_0x4efc93['query'][_0xe593('0x44')]);_0xc23a2f[_0xe593('0x45')]=qs[_0xe593('0x3e')](_[_0xe593('0x46')](_0x4efc93['query'],_0x4e8448[_0xe593('0x3e')]),_0x571995);if(_0x4efc93['query'][_0xe593('0x47')]){_0xc23a2f['where']=_['merge'](_0xc23a2f['where'],{'$or':_[_0xe593('0x35')](_0x571995,function(_0x5c2bd2){if(_0x5c2bd2[_0xe593('0x39')]!==_0xe593('0x48')){var _0x35cfd9={};_0x35cfd9[_0x5c2bd2['name']]={'$like':'%'+_0x4efc93[_0xe593('0x3d')][_0xe593('0x47')]+'%'};return _0x35cfd9;}})});}_0xc23a2f=_[_0xe593('0x49')]({},_0xc23a2f,_0x4efc93[_0xe593('0x4a')]);var _0x26ff41={'where':_0xc23a2f[_0xe593('0x45')]};return db[_0xe593('0x36')][_0xe593('0x27')](_0x26ff41)['then'](function(_0x211065){_0xe5e728[_0xe593('0x27')]=_0x211065;if(_0x4efc93[_0xe593('0x3d')][_0xe593('0x4b')]){_0xc23a2f[_0xe593('0x4c')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0xc23a2f);})[_0xe593('0x2c')](function(_0x380429){_0xe5e728[_0xe593('0x4d')]=_0x380429;return _0xe5e728;})['then'](respondWithFilteredResult(_0x4098a9,_0xc23a2f))[_0xe593('0x4e')](handleError(_0x4098a9,null));};exports[_0xe593('0x4f')]=function(_0x53431a,_0x5a8055){var _0x122302={'raw':!![],'where':{'id':_0x53431a[_0xe593('0x50')]['id']}},_0x245eea={};_0x245eea['model']=_[_0xe593('0x3c')](db[_0xe593('0x36')][_0xe593('0x37')]);_0x245eea[_0xe593('0x3d')]=_['keys'](_0x53431a['query']);_0x245eea['filters']=_['intersection'](_0x245eea[_0xe593('0x3b')],_0x245eea['query']);_0x122302[_0xe593('0x41')]=_[_0xe593('0x3f')](_0x245eea[_0xe593('0x3b')],qs[_0xe593('0x40')](_0x53431a[_0xe593('0x3d')][_0xe593('0x40')]));_0x122302[_0xe593('0x41')]=_0x122302[_0xe593('0x41')]['length']?_0x122302[_0xe593('0x41')]:_0x245eea[_0xe593('0x3b')];if(_0x53431a[_0xe593('0x3d')]['includeAll']){_0x122302[_0xe593('0x4c')]=[{'all':!![]}];}_0x122302=_['merge']({},_0x122302,_0x53431a[_0xe593('0x4a')]);return db[_0xe593('0x36')][_0xe593('0x51')](_0x122302)['then'](handleEntityNotFound(_0x5a8055,null))['then'](respondWithResult(_0x5a8055,null))[_0xe593('0x4e')](handleError(_0x5a8055,null));};exports[_0xe593('0x52')]=function(_0x53db18,_0x4f6e9c){return db['MailQueue']['create'](_0x53db18['body'],{})[_0xe593('0x2c')](function(_0x1e48d8){var _0x1ed8b5=_0x53db18[_0xe593('0x53')][_0xe593('0x2d')]({'plain':!![]});if(!_0x1ed8b5)throw new Error(_0xe593('0x54'));if(_0x1ed8b5[_0xe593('0x55')]===_0xe593('0x53')){var _0x355ad8=_0x1e48d8[_0xe593('0x2d')]({'plain':!![]});var _0x12e09f=_0xe593('0x2e');return db[_0xe593('0x56')][_0xe593('0x51')]({'where':{'name':_0x12e09f,'userProfileId':_0x1ed8b5[_0xe593('0x57')]},'raw':!![]})[_0xe593('0x2c')](function(_0x5d60c3){if(_0x5d60c3&&_0x5d60c3[_0xe593('0x58')]===0x0){return db[_0xe593('0x2f')][_0xe593('0x52')]({'name':_0x355ad8[_0xe593('0x32')],'resourceId':_0x355ad8['id'],'type':_0x5d60c3[_0xe593('0x32')],'sectionId':_0x5d60c3['id']},{})[_0xe593('0x2c')](function(){return _0x1e48d8;});}else{return _0x1e48d8;}})[_0xe593('0x4e')](function(_0x41c6c1){logger[_0xe593('0x30')](_0xe593('0x59'),_0x41c6c1);throw _0x41c6c1;});}return _0x1e48d8;})[_0xe593('0x2c')](respondWithResult(_0x4f6e9c,0xc9))[_0xe593('0x4e')](handleError(_0x4f6e9c,null));};exports[_0xe593('0x2b')]=function(_0x2dcf22,_0x93ca5e){if(_0x2dcf22['body']['id']){delete _0x2dcf22[_0xe593('0x5a')]['id'];}return db[_0xe593('0x36')][_0xe593('0x51')]({'where':{'id':_0x2dcf22[_0xe593('0x50')]['id']}})[_0xe593('0x2c')](handleEntityNotFound(_0x93ca5e,null))['then'](saveUpdates(_0x2dcf22['body'],null))[_0xe593('0x2c')](respondWithResult(_0x93ca5e,null))[_0xe593('0x4e')](handleError(_0x93ca5e,null));};exports[_0xe593('0x5b')]=function(_0x335f68,_0x1b5643){return db[_0xe593('0x36')][_0xe593('0x51')]({'where':{'id':_0x335f68['params']['id']}})['then'](handleEntityNotFound(_0x1b5643,null))[_0xe593('0x2c')](removeEntity(_0x1b5643,null))[_0xe593('0x4e')](handleError(_0x1b5643,null));};exports['describe']=function(_0x103403,_0xf8ed1d){return db[_0xe593('0x36')][_0xe593('0x5c')]()[_0xe593('0x2c')](respondWithResult(_0xf8ed1d,null))[_0xe593('0x4e')](handleError(_0xf8ed1d,null));};exports[_0xe593('0x5d')]=function(_0x3b8b19,_0x1dc796,_0x3316b8){var _0x5b3fcc={'raw':!![],'where':{}},_0x36f38e={},_0x13e368;return db[_0xe593('0x36')][_0xe593('0x5e')]({'where':{'id':_0x3b8b19[_0xe593('0x50')]['id']}})[_0xe593('0x2c')](handleEntityNotFound(_0x1dc796,null))[_0xe593('0x2c')](function(_0x4cef3e){if(_0x4cef3e){_0x13e368=_0x4cef3e[_0xe593('0x2d')]({'plain':!![]});_0x36f38e[_0xe593('0x3b')]=_[_0xe593('0x3c')](db[_0xe593('0x5f')]['rawAttributes']);_0x36f38e[_0xe593('0x3d')]=_[_0xe593('0x3c')](_0x3b8b19[_0xe593('0x3d')]);_0x36f38e[_0xe593('0x3e')]=_[_0xe593('0x3f')](_0x36f38e['model'],_0x36f38e[_0xe593('0x3d')]);_0x5b3fcc[_0xe593('0x41')]=_[_0xe593('0x3f')](_0x36f38e[_0xe593('0x3b')],qs[_0xe593('0x40')](_0x3b8b19[_0xe593('0x3d')][_0xe593('0x40')]));_0x5b3fcc[_0xe593('0x41')]=_0x5b3fcc['attributes'][_0xe593('0x60')]?_0x5b3fcc[_0xe593('0x41')]:_0x36f38e[_0xe593('0x3b')];if(!_0x3b8b19[_0xe593('0x3d')][_0xe593('0x42')](_0xe593('0x61'))){_0x5b3fcc[_0xe593('0x43')]=qs[_0xe593('0x43')](_0x3b8b19[_0xe593('0x3d')][_0xe593('0x43')]);_0x5b3fcc['offset']=qs[_0xe593('0x25')](_0x3b8b19[_0xe593('0x3d')][_0xe593('0x25')]);}_0x5b3fcc['order']=qs[_0xe593('0x44')](_0x3b8b19[_0xe593('0x3d')][_0xe593('0x44')]);_0x5b3fcc[_0xe593('0x45')]=qs[_0xe593('0x3e')](_['pick'](_0x3b8b19[_0xe593('0x3d')],_0x36f38e[_0xe593('0x3e')]));_0x5b3fcc['where'][_0xe593('0x62')]=_0x4cef3e['id'];if(_0x3b8b19[_0xe593('0x3d')][_0xe593('0x47')]){_0x5b3fcc[_0xe593('0x45')]=_['merge'](_0x5b3fcc[_0xe593('0x45')],{'$or':_[_0xe593('0x35')](_0x5b3fcc[_0xe593('0x41')],function(_0x4dea3a){var _0x43dcb0={};_0x43dcb0[_0x4dea3a]={'$like':'%'+_0x3b8b19[_0xe593('0x3d')][_0xe593('0x47')]+'%'};return _0x43dcb0;})});}_0x5b3fcc=_['merge']({},_0x5b3fcc,_0x3b8b19[_0xe593('0x4a')]);return db[_0xe593('0x5f')][_0xe593('0x63')](_0x5b3fcc);}})[_0xe593('0x2c')](function(_0xe89d7e){if(_0xe89d7e){return db['User'][_0xe593('0x64')]({'where':{'id':_[_0xe593('0x35')](_0xe89d7e,_0xe593('0x65')),'role':_0xe593('0x66')},'attributes':['id',_0xe593('0x32'),_0xe593('0x67'),_0xe593('0x68'),_0xe593('0x69')]});}})[_0xe593('0x2c')](function(_0xb7d821){if(_0xb7d821){return{'count':_0xb7d821[_0xe593('0x27')],'rows':_[_0xe593('0x35')](_0xb7d821[_0xe593('0x4d')],function(_0x22e71a){return{'membername':_0x22e71a['name'],'UserId':_0x22e71a['id'],'queue_name':_0x13e368[_0xe593('0x32')],'MailQueueId':_0x13e368['id'],'interface':util[_0xe593('0x6a')](_0xe593('0x6b'),_0xe593('0x6c'),_0x22e71a[_0xe593('0x32')]),'penalty':0x0,'paused':_0x22e71a[_0xe593('0x67')],'createdAt':_0x22e71a[_0xe593('0x69')],'updatedAt':_0x22e71a[_0xe593('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1dc796,_0x5b3fcc))['catch'](handleError(_0x1dc796,null));};exports['getTeams']=function(_0x3baa10,_0x993a93,_0x45f9d5){var _0x48edd1={};var _0x5c3134={};var _0x45a9f5;var _0x4c7972;return db[_0xe593('0x36')][_0xe593('0x5e')]({'where':{'id':_0x3baa10[_0xe593('0x50')]['id']}})['then'](handleEntityNotFound(_0x993a93,null))[_0xe593('0x2c')](function(_0x2fea3f){if(_0x2fea3f){_0x45a9f5=_0x2fea3f;_0x5c3134[_0xe593('0x3b')]=_[_0xe593('0x3c')](db[_0xe593('0x6d')][_0xe593('0x37')]);_0x5c3134[_0xe593('0x3d')]=_['keys'](_0x3baa10[_0xe593('0x3d')]);_0x5c3134[_0xe593('0x3e')]=_['intersection'](_0x5c3134[_0xe593('0x3b')],_0x5c3134[_0xe593('0x3d')]);_0x48edd1[_0xe593('0x41')]=_['intersection'](_0x5c3134[_0xe593('0x3b')],qs[_0xe593('0x40')](_0x3baa10[_0xe593('0x3d')][_0xe593('0x40')]));_0x48edd1[_0xe593('0x41')]=_0x48edd1[_0xe593('0x41')]['length']?_0x48edd1['attributes']:_0x5c3134[_0xe593('0x3b')];_0x48edd1['order']=qs['sort'](_0x3baa10['query'][_0xe593('0x44')]);_0x48edd1[_0xe593('0x45')]=qs[_0xe593('0x3e')](_[_0xe593('0x46')](_0x3baa10[_0xe593('0x3d')],_0x5c3134['filters']));if(_0x3baa10['query'][_0xe593('0x47')]){_0x48edd1[_0xe593('0x45')]=_[_0xe593('0x49')](_0x48edd1[_0xe593('0x45')],{'$or':_['map'](_0x48edd1[_0xe593('0x41')],function(_0x328377){var _0x309b9c={};_0x309b9c[_0x328377]={'$like':'%'+_0x3baa10['query'][_0xe593('0x47')]+'%'};return _0x309b9c;})});}_0x48edd1=_[_0xe593('0x49')]({},_0x48edd1,_0x3baa10['options']);return _0x45a9f5[_0xe593('0x6e')](_0x48edd1);}})[_0xe593('0x2c')](function(_0x5566e0){if(_0x5566e0){_0x4c7972=_0x5566e0['length'];if(!_0x3baa10['query']['hasOwnProperty']('nolimit')){_0x48edd1['limit']=qs[_0xe593('0x43')](_0x3baa10['query'][_0xe593('0x43')]);_0x48edd1[_0xe593('0x25')]=qs[_0xe593('0x25')](_0x3baa10['query']['offset']);}return _0x45a9f5[_0xe593('0x6e')](_0x48edd1);}})[_0xe593('0x2c')](function(_0x3db9f1){if(_0x3db9f1){return _0x3db9f1?{'count':_0x4c7972,'rows':_0x3db9f1}:null;}})[_0xe593('0x2c')](respondWithResult(_0x993a93,null))['catch'](handleError(_0x993a93,null));};exports['addTeams']=function(_0x12f9c4,_0xf272d6,_0x5127da){var _0x2c7c37=_0x12f9c4[_0xe593('0x5a')][_0xe593('0x6f')];return db[_0xe593('0x6d')][_0xe593('0x63')]({'where':{'id':_0x2c7c37},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe593('0x70'),'attributes':['id','name',_0xe593('0x71'),'voicePause',_0xe593('0x72')],'raw':!![]}]})['then'](function(_0x50ab4d){if(_0x50ab4d){var _0x265fee=_[_0xe593('0x73')](_0x50ab4d,function(_0x30c283){var _0x4cabbb=_0x30c283[_0xe593('0x2d')]({'plain':!![]});return _0x4cabbb[_0xe593('0x70')];});return db[_0xe593('0x36')]['find']({'where':{'id':_0x12f9c4[_0xe593('0x50')]['id']}})['then'](function(_0x1d76d5){return db[_0xe593('0x74')]['transaction'](function(_0x4540ca){return _0x1d76d5[_0xe593('0x75')](_0x2c7c37,{'transaction':_0x4540ca})[_0xe593('0x2c')](function(){return BPromise['each'](_0x265fee,function(_0x591d29){return db[_0xe593('0x5f')]['findOrCreate']({'where':{'UserId':_0x591d29['id'],'MailQueueId':_0x12f9c4[_0xe593('0x50')]['id']},'transaction':_0x4540ca});});})[_0xe593('0x2c')](function(){_0x265fee['forEach'](function(_0x5e6456){socket[_0xe593('0x76')](_0xe593('0x77'),{'UserId':_0x5e6456['id'],'MailQueueId':_0x1d76d5['id']});});});});});}})[_0xe593('0x2c')](respondWithStatusCode(_0xf272d6,null))['catch'](handleError(_0xf272d6,null));};exports[_0xe593('0x78')]=function(_0xd79cda,_0x42369d,_0x2abd90){return db[_0xe593('0x6d')][_0xe593('0x63')]({'where':{'id':_0xd79cda['query'][_0xe593('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xe593('0x79')],'as':_0xe593('0x70'),'attributes':['id'],'raw':!![]}]})[_0xe593('0x2c')](handleEntityNotFound(_0x42369d,null))[_0xe593('0x2c')](function(_0x3f8cbf){var _0x7d000e=_['map'](_0x3f8cbf,'id');var _0xa7de6=[];var _0x20dc5f=[];var _0x37c62a=squel['select']();_0x37c62a['field']('tq.TeamId')[_0xe593('0x7a')](_0xe593('0x7b'),'tq')['join'](_0xe593('0x7c'),'ut',_0xe593('0x7d'))['where'](_0xe593('0x7e'),_0xd79cda['params']['id']);for(var _0x51a965=0x0;_0x51a965<_0x3f8cbf[_0xe593('0x60')];_0x51a965+=0x1){let _0x427472=_0x3f8cbf[_0x51a965];for(var _0x1aff4f=0x0;_0x1aff4f<_0x427472[_0xe593('0x70')][_0xe593('0x60')];_0x1aff4f+=0x1){let _0x49b999=_0x427472[_0xe593('0x70')][_0x1aff4f];var _0x42f34d=_0x37c62a['clone']();_0x42f34d[_0xe593('0x45')](_0xe593('0x7f'),_0x49b999['id']);_0x20dc5f[_0xe593('0x80')](db[_0xe593('0x74')][_0xe593('0x3d')](_0x42f34d[_0xe593('0x81')](),{'type':db['sequelize'][_0xe593('0x82')][_0xe593('0x83')]})[_0xe593('0x2c')](function(_0x2f8c46){if(_0x2f8c46[_0xe593('0x60')]===0x1){return _0x49b999['id'];}else{var _0x2de040=_['every'](_[_0xe593('0x35')](_0x2f8c46,_0xe593('0x84')),function(_0x4b31c8){return _[_0xe593('0x85')](_0x7d000e,_0x4b31c8);});if(_0x2de040){return _0x49b999['id'];}}}));}}return BPromise[_0xe593('0x86')](_0x20dc5f)['then'](function(_0x11abea){_0xa7de6=_(_0xa7de6)['union'](_0x11abea)['compact']()['value']();return db[_0xe593('0x36')]['find']({'where':{'id':_0xd79cda[_0xe593('0x50')]['id']}})[_0xe593('0x2c')](function(_0x48e462){return db[_0xe593('0x74')][_0xe593('0x87')](function(_0x3a2a3a){return _0x48e462[_0xe593('0x78')](_0xd79cda['query']['ids'],{'transaction':_0x3a2a3a})[_0xe593('0x2c')](function(){if(!_['isEmpty'](_0xa7de6)){return _0x48e462[_0xe593('0x88')](_0xa7de6,{'transaction':_0x3a2a3a});}})['then'](function(){_0xa7de6[_0xe593('0x89')](function(_0xd9c223){socket[_0xe593('0x76')](_0xe593('0x8a'),{'UserId':_0xd9c223,'MailQueueId':_0x48e462['id']});});});});});});})[_0xe593('0x2c')](respondWithStatusCode(_0x42369d,null))[_0xe593('0x4e')](handleError(_0x42369d,null));};exports['addAgents']=function(_0xb029b1,_0x409172,_0x490967){return db[_0xe593('0x36')]['find']({'where':{'id':_0xb029b1['params']['id']}})[_0xe593('0x2c')](handleEntityNotFound(_0x409172,null))[_0xe593('0x2c')](function(_0x232827){if(_0x232827){return _0x232827[_0xe593('0x8b')](_0xb029b1[_0xe593('0x5a')][_0xe593('0x6f')],_[_0xe593('0x8c')](_0xb029b1[_0xe593('0x5a')],[_0xe593('0x6f'),'id'])||{})[_0xe593('0x8d')](function(_0x2b6602){for(var _0x4dfe26=0x0;_0x4dfe26<_0xb029b1[_0xe593('0x5a')]['ids']['length'];_0x4dfe26+=0x1){socket[_0xe593('0x76')](_0xe593('0x77'),{'UserId':Number(_0xb029b1[_0xe593('0x5a')]['ids'][_0x4dfe26]),'MailQueueId':Number(_0xb029b1['params']['id'])});}return _0x2b6602;});}})[_0xe593('0x2c')](respondWithResult(_0x409172,null))[_0xe593('0x4e')](handleError(_0x409172,null));};exports[_0xe593('0x88')]=function(_0xa51f36,_0x4b1072,_0x287d15){return db[_0xe593('0x36')][_0xe593('0x51')]({'where':{'id':_0xa51f36[_0xe593('0x50')]['id']}})[_0xe593('0x2c')](handleEntityNotFound(_0x4b1072,null))[_0xe593('0x2c')](function(_0x4e69c6){if(_0x4e69c6){return _0x4e69c6['removeAgents'](_0xa51f36[_0xe593('0x3d')][_0xe593('0x6f')])[_0xe593('0x2c')](function(){if(_[_0xe593('0x8e')](_0xa51f36[_0xe593('0x3d')][_0xe593('0x6f')])){for(var _0x38d755=0x0;_0x38d755<_0xa51f36[_0xe593('0x3d')][_0xe593('0x6f')][_0xe593('0x60')];_0x38d755+=0x1){socket[_0xe593('0x76')]('userMailQueue:remove',{'UserId':Number(_0xa51f36['query'][_0xe593('0x6f')][_0x38d755]),'MailQueueId':Number(_0xa51f36[_0xe593('0x50')]['id'])});}}else{socket[_0xe593('0x76')](_0xe593('0x8a'),{'UserId':Number(_0xa51f36[_0xe593('0x3d')][_0xe593('0x6f')]),'MailQueueId':Number(_0xa51f36['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4b1072,null))[_0xe593('0x4e')](handleError(_0x4b1072,null));};exports[_0xe593('0x8f')]=function(_0x1bba7c,_0xf97248,_0x4dcf23){var _0x5207ee={};var _0x373d1e={};var _0xf40888;var _0x12c44b;return db[_0xe593('0x36')]['findOne']({'where':{'id':_0x1bba7c[_0xe593('0x50')]['id']}})[_0xe593('0x2c')](handleEntityNotFound(_0xf97248,null))[_0xe593('0x2c')](function(_0x31d9e6){if(_0x31d9e6){_0xf40888=_0x31d9e6;_0x373d1e[_0xe593('0x3b')]=_['keys'](db[_0xe593('0x79')][_0xe593('0x37')]);_0x373d1e['query']=_[_0xe593('0x3c')](_0x1bba7c[_0xe593('0x3d')]);_0x373d1e['filters']=_[_0xe593('0x3f')](_0x373d1e[_0xe593('0x3b')],_0x373d1e['query']);_0x5207ee[_0xe593('0x41')]=_[_0xe593('0x3f')](_0x373d1e['model'],qs[_0xe593('0x40')](_0x1bba7c[_0xe593('0x3d')][_0xe593('0x40')]));_0x5207ee[_0xe593('0x41')]=_0x5207ee[_0xe593('0x41')][_0xe593('0x60')]?_0x5207ee['attributes']:_0x373d1e[_0xe593('0x3b')];_0x5207ee[_0xe593('0x90')]=qs[_0xe593('0x44')](_0x1bba7c[_0xe593('0x3d')][_0xe593('0x44')]);_0x5207ee[_0xe593('0x45')]=qs[_0xe593('0x3e')](_[_0xe593('0x46')](_0x1bba7c['query'],_0x373d1e['filters']));if(_0x1bba7c['query'][_0xe593('0x47')]){_0x5207ee['where']=_[_0xe593('0x49')](_0x5207ee[_0xe593('0x45')],{'$or':_[_0xe593('0x35')](_0x5207ee[_0xe593('0x41')],function(_0x9f5937){var _0x1d9476={};_0x1d9476[_0x9f5937]={'$like':'%'+_0x1bba7c[_0xe593('0x3d')][_0xe593('0x47')]+'%'};return _0x1d9476;})});}_0x5207ee=_[_0xe593('0x49')]({},_0x5207ee,_0x1bba7c[_0xe593('0x4a')]);return _0xf40888[_0xe593('0x8f')](_0x5207ee);}})[_0xe593('0x2c')](function(_0x53212c){if(_0x53212c){_0x12c44b=_0x53212c[_0xe593('0x60')];if(!_0x1bba7c['query'][_0xe593('0x42')](_0xe593('0x61'))){_0x5207ee[_0xe593('0x43')]=qs['limit'](_0x1bba7c[_0xe593('0x3d')][_0xe593('0x43')]);_0x5207ee[_0xe593('0x25')]=qs[_0xe593('0x25')](_0x1bba7c[_0xe593('0x3d')][_0xe593('0x25')]);}return _0xf40888[_0xe593('0x8f')](_0x5207ee);}})['then'](function(_0x309305){if(_0x309305){return _0x309305?{'count':_0x12c44b,'rows':_0x309305}:null;}})[_0xe593('0x2c')](respondWithResult(_0xf97248,null))[_0xe593('0x4e')](handleError(_0xf97248,null));};
\ No newline at end of file
+var _0xd4b6=['interface','flatMap','sequelize','transaction','each','findOrCreate','emit','ids','select','field','tq.TeamId','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','fields','length','model','nolimit','order','sort','pick','filter','where','merge','options','include','MailQueue','rows','show','params','keys','includeAll','find','catch','create','body','user','UserProfileSection','userProfileId','getMembers','hasOwnProperty','UserMailQueue','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','Agents','online'];(function(_0xdd8bfc,_0x1d3ab9){var _0x4ceaba=function(_0x2a69bb){while(--_0x2a69bb){_0xdd8bfc['push'](_0xdd8bfc['shift']());}};_0x4ceaba(++_0x1d3ab9);}(_0xd4b6,0x13f));var _0x6d4b=function(_0x790177,_0x28362c){_0x790177=_0x790177-0x0;var _0x2de72c=_0xd4b6[_0x790177];return _0x2de72c;};'use strict';var emlformat=require(_0x6d4b('0x0'));var rimraf=require(_0x6d4b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d4b('0x2'));var rp=require(_0x6d4b('0x3'));var moment=require('moment');var BPromise=require(_0x6d4b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6d4b('0x5'));var csv=require(_0x6d4b('0x6'));var ejs=require(_0x6d4b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d4b('0x8'));var squel=require(_0x6d4b('0x9'));var crypto=require(_0x6d4b('0xa'));var jsforce=require(_0x6d4b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6d4b('0x6'));var querystring=require(_0x6d4b('0xc'));var Papa=require(_0x6d4b('0xd'));var Redis=require(_0x6d4b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6d4b('0xf'));var as=require(_0x6d4b('0x10'));var hardwareService=require(_0x6d4b('0x11'));var logger=require(_0x6d4b('0x12'))(_0x6d4b('0x13'));var utils=require(_0x6d4b('0x14'));var config=require(_0x6d4b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d4b('0x16'))['db'];config[_0x6d4b('0x17')]=_[_0x6d4b('0x18')](config['redis'],{'host':_0x6d4b('0x19'),'port':0x18eb});var socket=require(_0x6d4b('0x1a'))(new Redis(config[_0x6d4b('0x17')]));require(_0x6d4b('0x1b'))[_0x6d4b('0x1c')](socket);function respondWithStatusCode(_0x2bca8b,_0x2c6f88){_0x2c6f88=_0x2c6f88||0xcc;return function(_0x16e367){if(_0x16e367){return _0x2bca8b[_0x6d4b('0x1d')](_0x2c6f88);}return _0x2bca8b[_0x6d4b('0x1e')](_0x2c6f88)['end']();};}function respondWithResult(_0x303f52,_0x4d524d){_0x4d524d=_0x4d524d||0xc8;return function(_0x4739c7){if(_0x4739c7){return _0x303f52[_0x6d4b('0x1e')](_0x4d524d)['json'](_0x4739c7);}};}function respondWithFilteredResult(_0x53c61c,_0x2f0e20){return function(_0x3a30b2){if(_0x3a30b2){var _0x318b0f=typeof _0x2f0e20[_0x6d4b('0x1f')]===_0x6d4b('0x20')&&typeof _0x2f0e20[_0x6d4b('0x21')]===_0x6d4b('0x20');var _0x162865=_0x3a30b2[_0x6d4b('0x22')];var _0x34d9bf=_0x318b0f?0x0:_0x2f0e20['offset'];var _0x5c88a1=_0x318b0f?_0x3a30b2[_0x6d4b('0x22')]:_0x2f0e20[_0x6d4b('0x1f')]+_0x2f0e20[_0x6d4b('0x21')];var _0x5d5b72;if(_0x5c88a1>=_0x162865){_0x5c88a1=_0x162865;_0x5d5b72=0xc8;}else{_0x5d5b72=0xce;}_0x53c61c[_0x6d4b('0x1e')](_0x5d5b72);return _0x53c61c[_0x6d4b('0x23')](_0x6d4b('0x24'),_0x34d9bf+'-'+_0x5c88a1+'/'+_0x162865)[_0x6d4b('0x25')](_0x3a30b2);}return null;};}function patchUpdates(_0x4c46cf){return function(_0x43c861){try{jsonpatch[_0x6d4b('0x26')](_0x43c861,_0x4c46cf,!![]);}catch(_0x417853){return BPromise[_0x6d4b('0x27')](_0x417853);}return _0x43c861[_0x6d4b('0x28')]();};}function saveUpdates(_0x479bf4,_0x38dc85){return function(_0x48680b){if(_0x48680b){return _0x48680b[_0x6d4b('0x29')](_0x479bf4)[_0x6d4b('0x2a')](function(_0x55c1ac){return _0x55c1ac;});}return null;};}function removeEntity(_0x3d729f,_0x4b00e2){return function(_0x3a6e16){if(_0x3a6e16){return _0x3a6e16[_0x6d4b('0x2b')]()[_0x6d4b('0x2a')](function(){var _0x5cdfe1=_0x3a6e16[_0x6d4b('0x2c')]({'plain':!![]});var _0x4a4cb2=_0x6d4b('0x2d');return db[_0x6d4b('0x2e')][_0x6d4b('0x2b')]({'where':{'type':_0x4a4cb2,'resourceId':_0x5cdfe1['id']}})[_0x6d4b('0x2a')](function(){return _0x3a6e16;});})[_0x6d4b('0x2a')](function(){_0x3d729f[_0x6d4b('0x1e')](0xcc)[_0x6d4b('0x2f')]();});}};}function handleEntityNotFound(_0x4d88fc,_0x2427fd){return function(_0x4da458){if(!_0x4da458){_0x4d88fc[_0x6d4b('0x1d')](0x194);}return _0x4da458;};}function handleError(_0x5f29e1,_0x10807a){_0x10807a=_0x10807a||0x1f4;return function(_0x447ab7){logger[_0x6d4b('0x30')](_0x447ab7[_0x6d4b('0x31')]);if(_0x447ab7['name']){delete _0x447ab7[_0x6d4b('0x32')];}_0x5f29e1[_0x6d4b('0x1e')](_0x10807a)[_0x6d4b('0x33')](_0x447ab7);};}exports[_0x6d4b('0x34')]=function(_0x8dd9ab,_0x18ffc6){var _0xfdadd3={},_0x1371b9={},_0x4d17b0={'count':0x0,'rows':[]};var _0x4ab4d8=_[_0x6d4b('0x35')](db['MailQueue'][_0x6d4b('0x36')],function(_0xfa144a){return{'name':_0xfa144a[_0x6d4b('0x37')],'type':_0xfa144a[_0x6d4b('0x38')][_0x6d4b('0x39')]};});_0x1371b9['model']=_['map'](_0x4ab4d8,'name');_0x1371b9[_0x6d4b('0x3a')]=_['keys'](_0x8dd9ab[_0x6d4b('0x3a')]);_0x1371b9[_0x6d4b('0x3b')]=_['intersection'](_0x1371b9['model'],_0x1371b9['query']);_0xfdadd3[_0x6d4b('0x3c')]=_[_0x6d4b('0x3d')](_0x1371b9['model'],qs[_0x6d4b('0x3e')](_0x8dd9ab['query'][_0x6d4b('0x3e')]));_0xfdadd3[_0x6d4b('0x3c')]=_0xfdadd3[_0x6d4b('0x3c')][_0x6d4b('0x3f')]?_0xfdadd3['attributes']:_0x1371b9[_0x6d4b('0x40')];if(!_0x8dd9ab[_0x6d4b('0x3a')]['hasOwnProperty'](_0x6d4b('0x41'))){_0xfdadd3[_0x6d4b('0x21')]=qs['limit'](_0x8dd9ab[_0x6d4b('0x3a')][_0x6d4b('0x21')]);_0xfdadd3['offset']=qs[_0x6d4b('0x1f')](_0x8dd9ab[_0x6d4b('0x3a')][_0x6d4b('0x1f')]);}_0xfdadd3[_0x6d4b('0x42')]=qs['sort'](_0x8dd9ab[_0x6d4b('0x3a')][_0x6d4b('0x43')]);_0xfdadd3['where']=qs[_0x6d4b('0x3b')](_[_0x6d4b('0x44')](_0x8dd9ab[_0x6d4b('0x3a')],_0x1371b9['filters']),_0x4ab4d8);if(_0x8dd9ab[_0x6d4b('0x3a')][_0x6d4b('0x45')]){_0xfdadd3[_0x6d4b('0x46')]=_[_0x6d4b('0x47')](_0xfdadd3[_0x6d4b('0x46')],{'$or':_[_0x6d4b('0x35')](_0x4ab4d8,function(_0x3647ab){if(_0x3647ab['type']!=='VIRTUAL'){var _0x29627e={};_0x29627e[_0x3647ab[_0x6d4b('0x32')]]={'$like':'%'+_0x8dd9ab[_0x6d4b('0x3a')][_0x6d4b('0x45')]+'%'};return _0x29627e;}})});}_0xfdadd3=_['merge']({},_0xfdadd3,_0x8dd9ab[_0x6d4b('0x48')]);var _0x22a06c={'where':_0xfdadd3[_0x6d4b('0x46')]};return db['MailQueue'][_0x6d4b('0x22')](_0x22a06c)['then'](function(_0x303e99){_0x4d17b0[_0x6d4b('0x22')]=_0x303e99;if(_0x8dd9ab[_0x6d4b('0x3a')]['includeAll']){_0xfdadd3[_0x6d4b('0x49')]=[{'all':!![]}];}return db[_0x6d4b('0x4a')]['findAll'](_0xfdadd3);})[_0x6d4b('0x2a')](function(_0x274e78){_0x4d17b0[_0x6d4b('0x4b')]=_0x274e78;return _0x4d17b0;})[_0x6d4b('0x2a')](respondWithFilteredResult(_0x18ffc6,_0xfdadd3))['catch'](handleError(_0x18ffc6,null));};exports[_0x6d4b('0x4c')]=function(_0x4ae997,_0x524f5f){var _0x5219f4={'raw':!![],'where':{'id':_0x4ae997[_0x6d4b('0x4d')]['id']}},_0x6fc99b={};_0x6fc99b[_0x6d4b('0x40')]=_['keys'](db[_0x6d4b('0x4a')]['rawAttributes']);_0x6fc99b[_0x6d4b('0x3a')]=_[_0x6d4b('0x4e')](_0x4ae997[_0x6d4b('0x3a')]);_0x6fc99b['filters']=_[_0x6d4b('0x3d')](_0x6fc99b[_0x6d4b('0x40')],_0x6fc99b['query']);_0x5219f4['attributes']=_[_0x6d4b('0x3d')](_0x6fc99b[_0x6d4b('0x40')],qs[_0x6d4b('0x3e')](_0x4ae997[_0x6d4b('0x3a')][_0x6d4b('0x3e')]));_0x5219f4['attributes']=_0x5219f4[_0x6d4b('0x3c')][_0x6d4b('0x3f')]?_0x5219f4['attributes']:_0x6fc99b[_0x6d4b('0x40')];if(_0x4ae997[_0x6d4b('0x3a')][_0x6d4b('0x4f')]){_0x5219f4[_0x6d4b('0x49')]=[{'all':!![]}];}_0x5219f4=_[_0x6d4b('0x47')]({},_0x5219f4,_0x4ae997['options']);return db['MailQueue'][_0x6d4b('0x50')](_0x5219f4)[_0x6d4b('0x2a')](handleEntityNotFound(_0x524f5f,null))[_0x6d4b('0x2a')](respondWithResult(_0x524f5f,null))[_0x6d4b('0x51')](handleError(_0x524f5f,null));};exports[_0x6d4b('0x52')]=function(_0x3af57e,_0x1a1411){return db['MailQueue'][_0x6d4b('0x52')](_0x3af57e[_0x6d4b('0x53')],{})[_0x6d4b('0x2a')](function(_0xa6095e){var _0x54d237=_0x3af57e[_0x6d4b('0x54')][_0x6d4b('0x2c')]({'plain':!![]});if(!_0x54d237)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54d237['role']===_0x6d4b('0x54')){var _0x2f6202=_0xa6095e[_0x6d4b('0x2c')]({'plain':!![]});var _0x85ecc7=_0x6d4b('0x2d');return db[_0x6d4b('0x55')][_0x6d4b('0x50')]({'where':{'name':_0x85ecc7,'userProfileId':_0x54d237[_0x6d4b('0x56')]},'raw':!![]})[_0x6d4b('0x2a')](function(_0x4a827f){if(_0x4a827f&&_0x4a827f['autoAssociation']===0x0){return db[_0x6d4b('0x2e')][_0x6d4b('0x52')]({'name':_0x2f6202[_0x6d4b('0x32')],'resourceId':_0x2f6202['id'],'type':_0x4a827f[_0x6d4b('0x32')],'sectionId':_0x4a827f['id']},{})[_0x6d4b('0x2a')](function(){return _0xa6095e;});}else{return _0xa6095e;}})['catch'](function(_0x42a628){logger[_0x6d4b('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42a628);throw _0x42a628;});}return _0xa6095e;})[_0x6d4b('0x2a')](respondWithResult(_0x1a1411,0xc9))[_0x6d4b('0x51')](handleError(_0x1a1411,null));};exports[_0x6d4b('0x29')]=function(_0x4c46f0,_0x28c73b){if(_0x4c46f0[_0x6d4b('0x53')]['id']){delete _0x4c46f0[_0x6d4b('0x53')]['id'];}return db[_0x6d4b('0x4a')]['find']({'where':{'id':_0x4c46f0[_0x6d4b('0x4d')]['id']}})[_0x6d4b('0x2a')](handleEntityNotFound(_0x28c73b,null))['then'](saveUpdates(_0x4c46f0[_0x6d4b('0x53')],null))[_0x6d4b('0x2a')](respondWithResult(_0x28c73b,null))[_0x6d4b('0x51')](handleError(_0x28c73b,null));};exports[_0x6d4b('0x2b')]=function(_0x24e1ee,_0x29df79){return db['MailQueue'][_0x6d4b('0x50')]({'where':{'id':_0x24e1ee['params']['id']}})['then'](handleEntityNotFound(_0x29df79,null))[_0x6d4b('0x2a')](removeEntity(_0x29df79,null))[_0x6d4b('0x51')](handleError(_0x29df79,null));};exports['describe']=function(_0x35bc11,_0x2bf09b){return db[_0x6d4b('0x4a')]['describe']()[_0x6d4b('0x2a')](respondWithResult(_0x2bf09b,null))[_0x6d4b('0x51')](handleError(_0x2bf09b,null));};exports[_0x6d4b('0x57')]=function(_0x4dbda8,_0x3796bd,_0x2424a6){var _0x44a11f={'raw':!![],'where':{}},_0x3a3677={},_0x2a1808;return db[_0x6d4b('0x4a')]['findOne']({'where':{'id':_0x4dbda8[_0x6d4b('0x4d')]['id']}})[_0x6d4b('0x2a')](handleEntityNotFound(_0x3796bd,null))['then'](function(_0x46d706){if(_0x46d706){_0x2a1808=_0x46d706['get']({'plain':!![]});_0x3a3677['model']=_['keys'](db['UserMailQueue'][_0x6d4b('0x36')]);_0x3a3677['query']=_[_0x6d4b('0x4e')](_0x4dbda8[_0x6d4b('0x3a')]);_0x3a3677[_0x6d4b('0x3b')]=_['intersection'](_0x3a3677['model'],_0x3a3677[_0x6d4b('0x3a')]);_0x44a11f['attributes']=_[_0x6d4b('0x3d')](_0x3a3677[_0x6d4b('0x40')],qs[_0x6d4b('0x3e')](_0x4dbda8[_0x6d4b('0x3a')][_0x6d4b('0x3e')]));_0x44a11f[_0x6d4b('0x3c')]=_0x44a11f['attributes']['length']?_0x44a11f[_0x6d4b('0x3c')]:_0x3a3677['model'];if(!_0x4dbda8[_0x6d4b('0x3a')][_0x6d4b('0x58')]('nolimit')){_0x44a11f[_0x6d4b('0x21')]=qs[_0x6d4b('0x21')](_0x4dbda8[_0x6d4b('0x3a')]['limit']);_0x44a11f[_0x6d4b('0x1f')]=qs[_0x6d4b('0x1f')](_0x4dbda8[_0x6d4b('0x3a')][_0x6d4b('0x1f')]);}_0x44a11f['order']=qs[_0x6d4b('0x43')](_0x4dbda8[_0x6d4b('0x3a')]['sort']);_0x44a11f[_0x6d4b('0x46')]=qs[_0x6d4b('0x3b')](_[_0x6d4b('0x44')](_0x4dbda8[_0x6d4b('0x3a')],_0x3a3677[_0x6d4b('0x3b')]));_0x44a11f[_0x6d4b('0x46')]['MailQueueId']=_0x46d706['id'];if(_0x4dbda8[_0x6d4b('0x3a')][_0x6d4b('0x45')]){_0x44a11f[_0x6d4b('0x46')]=_[_0x6d4b('0x47')](_0x44a11f[_0x6d4b('0x46')],{'$or':_['map'](_0x44a11f['attributes'],function(_0x17165b){var _0xab09a4={};_0xab09a4[_0x17165b]={'$like':'%'+_0x4dbda8[_0x6d4b('0x3a')][_0x6d4b('0x45')]+'%'};return _0xab09a4;})});}_0x44a11f=_[_0x6d4b('0x47')]({},_0x44a11f,_0x4dbda8[_0x6d4b('0x48')]);return db[_0x6d4b('0x59')][_0x6d4b('0x5a')](_0x44a11f);}})[_0x6d4b('0x2a')](function(_0x3b1abc){if(_0x3b1abc){return db[_0x6d4b('0x5b')][_0x6d4b('0x5c')]({'where':{'id':_[_0x6d4b('0x35')](_0x3b1abc,_0x6d4b('0x5d')),'role':_0x6d4b('0x5e')},'attributes':['id',_0x6d4b('0x32'),_0x6d4b('0x5f'),_0x6d4b('0x60'),_0x6d4b('0x61')]});}})['then'](function(_0x428113){if(_0x428113){return{'count':_0x428113['count'],'rows':_[_0x6d4b('0x35')](_0x428113[_0x6d4b('0x4b')],function(_0x2a9b0f){return{'membername':_0x2a9b0f[_0x6d4b('0x32')],'UserId':_0x2a9b0f['id'],'queue_name':_0x2a1808[_0x6d4b('0x32')],'MailQueueId':_0x2a1808['id'],'interface':util[_0x6d4b('0x62')](_0x6d4b('0x63'),_0x6d4b('0x64'),_0x2a9b0f[_0x6d4b('0x32')]),'penalty':0x0,'paused':_0x2a9b0f[_0x6d4b('0x5f')],'createdAt':_0x2a9b0f[_0x6d4b('0x61')],'updatedAt':_0x2a9b0f[_0x6d4b('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6d4b('0x2a')](respondWithFilteredResult(_0x3796bd,_0x44a11f))[_0x6d4b('0x51')](handleError(_0x3796bd,null));};exports[_0x6d4b('0x65')]=function(_0x4ca926,_0x31674d,_0x1b32c5){var _0x46ebf7={};var _0x3d74c7={};var _0x5ed95d;var _0x40b8ca;return db[_0x6d4b('0x4a')][_0x6d4b('0x66')]({'where':{'id':_0x4ca926[_0x6d4b('0x4d')]['id']}})[_0x6d4b('0x2a')](handleEntityNotFound(_0x31674d,null))[_0x6d4b('0x2a')](function(_0x2654a1){if(_0x2654a1){_0x5ed95d=_0x2654a1;_0x3d74c7[_0x6d4b('0x40')]=_['keys'](db[_0x6d4b('0x67')][_0x6d4b('0x36')]);_0x3d74c7[_0x6d4b('0x3a')]=_['keys'](_0x4ca926[_0x6d4b('0x3a')]);_0x3d74c7[_0x6d4b('0x3b')]=_['intersection'](_0x3d74c7['model'],_0x3d74c7[_0x6d4b('0x3a')]);_0x46ebf7[_0x6d4b('0x3c')]=_['intersection'](_0x3d74c7['model'],qs[_0x6d4b('0x3e')](_0x4ca926['query']['fields']));_0x46ebf7[_0x6d4b('0x3c')]=_0x46ebf7[_0x6d4b('0x3c')]['length']?_0x46ebf7[_0x6d4b('0x3c')]:_0x3d74c7[_0x6d4b('0x40')];_0x46ebf7['order']=qs[_0x6d4b('0x43')](_0x4ca926['query'][_0x6d4b('0x43')]);_0x46ebf7[_0x6d4b('0x46')]=qs['filters'](_[_0x6d4b('0x44')](_0x4ca926[_0x6d4b('0x3a')],_0x3d74c7['filters']));if(_0x4ca926['query']['filter']){_0x46ebf7[_0x6d4b('0x46')]=_['merge'](_0x46ebf7[_0x6d4b('0x46')],{'$or':_[_0x6d4b('0x35')](_0x46ebf7['attributes'],function(_0xe7298e){var _0x35c1aa={};_0x35c1aa[_0xe7298e]={'$like':'%'+_0x4ca926[_0x6d4b('0x3a')]['filter']+'%'};return _0x35c1aa;})});}_0x46ebf7=_[_0x6d4b('0x47')]({},_0x46ebf7,_0x4ca926[_0x6d4b('0x48')]);return _0x5ed95d[_0x6d4b('0x65')](_0x46ebf7);}})[_0x6d4b('0x2a')](function(_0x190ebd){if(_0x190ebd){_0x40b8ca=_0x190ebd[_0x6d4b('0x3f')];if(!_0x4ca926[_0x6d4b('0x3a')][_0x6d4b('0x58')]('nolimit')){_0x46ebf7['limit']=qs[_0x6d4b('0x21')](_0x4ca926[_0x6d4b('0x3a')][_0x6d4b('0x21')]);_0x46ebf7[_0x6d4b('0x1f')]=qs[_0x6d4b('0x1f')](_0x4ca926[_0x6d4b('0x3a')]['offset']);}return _0x5ed95d[_0x6d4b('0x65')](_0x46ebf7);}})['then'](function(_0xab231){if(_0xab231){return _0xab231?{'count':_0x40b8ca,'rows':_0xab231}:null;}})[_0x6d4b('0x2a')](respondWithResult(_0x31674d,null))[_0x6d4b('0x51')](handleError(_0x31674d,null));};exports[_0x6d4b('0x68')]=function(_0x39c0d1,_0x2694fc,_0x37f1f5){var _0x2e285a=_0x39c0d1[_0x6d4b('0x53')]['ids'];return db[_0x6d4b('0x67')][_0x6d4b('0x5a')]({'where':{'id':_0x2e285a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6d4b('0x69'),'attributes':['id',_0x6d4b('0x32'),_0x6d4b('0x6a'),'voicePause',_0x6d4b('0x6b')],'raw':!![]}]})[_0x6d4b('0x2a')](function(_0x5c6f41){if(_0x5c6f41){var _0x3927d9=_[_0x6d4b('0x6c')](_0x5c6f41,function(_0x37c7a7){var _0x412700=_0x37c7a7[_0x6d4b('0x2c')]({'plain':!![]});return _0x412700[_0x6d4b('0x69')];});return db[_0x6d4b('0x4a')][_0x6d4b('0x50')]({'where':{'id':_0x39c0d1[_0x6d4b('0x4d')]['id']}})['then'](function(_0x85c657){return db[_0x6d4b('0x6d')][_0x6d4b('0x6e')](function(_0x10b2e8){return _0x85c657[_0x6d4b('0x68')](_0x2e285a,{'transaction':_0x10b2e8})[_0x6d4b('0x2a')](function(){return BPromise[_0x6d4b('0x6f')](_0x3927d9,function(_0x1b7fa7){return db[_0x6d4b('0x59')][_0x6d4b('0x70')]({'where':{'UserId':_0x1b7fa7['id'],'MailQueueId':_0x39c0d1['params']['id']},'transaction':_0x10b2e8});});})[_0x6d4b('0x2a')](function(){_0x3927d9['forEach'](function(_0x4ce48a){socket[_0x6d4b('0x71')]('userMailQueue:save',{'UserId':_0x4ce48a['id'],'MailQueueId':_0x85c657['id']});});});});});}})[_0x6d4b('0x2a')](respondWithStatusCode(_0x2694fc,null))['catch'](handleError(_0x2694fc,null));};exports['removeTeams']=function(_0x1265dc,_0x4384a3,_0x48d41a){return db['Team'][_0x6d4b('0x5a')]({'where':{'id':_0x1265dc[_0x6d4b('0x3a')][_0x6d4b('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6d4b('0x69'),'attributes':['id'],'raw':!![]}]})[_0x6d4b('0x2a')](handleEntityNotFound(_0x4384a3,null))[_0x6d4b('0x2a')](function(_0x2bce0f){var _0x5a6b97=_['map'](_0x2bce0f,'id');var _0x56c5eb=[];var _0x26bfac=[];var _0x42b67e=squel[_0x6d4b('0x73')]();_0x42b67e[_0x6d4b('0x74')](_0x6d4b('0x75'))['from'](_0x6d4b('0x76'),'tq')['join'](_0x6d4b('0x77'),'ut',_0x6d4b('0x78'))[_0x6d4b('0x46')](_0x6d4b('0x79'),_0x1265dc['params']['id']);for(var _0x2a043b=0x0;_0x2a043b<_0x2bce0f['length'];_0x2a043b+=0x1){let _0x52044c=_0x2bce0f[_0x2a043b];for(var _0x5b71d8=0x0;_0x5b71d8<_0x52044c[_0x6d4b('0x69')][_0x6d4b('0x3f')];_0x5b71d8+=0x1){let _0x1f5ade=_0x52044c['Agents'][_0x5b71d8];var _0x17f085=_0x42b67e[_0x6d4b('0x7a')]();_0x17f085[_0x6d4b('0x46')]('ut.UserId\x20=\x20?',_0x1f5ade['id']);_0x26bfac[_0x6d4b('0x7b')](db[_0x6d4b('0x6d')][_0x6d4b('0x3a')](_0x17f085['toString'](),{'type':db[_0x6d4b('0x6d')][_0x6d4b('0x7c')][_0x6d4b('0x7d')]})['then'](function(_0x53ecb9){if(_0x53ecb9['length']===0x1){return _0x1f5ade['id'];}else{var _0x3b1a51=_[_0x6d4b('0x7e')](_['map'](_0x53ecb9,_0x6d4b('0x7f')),function(_0x53f981){return _[_0x6d4b('0x80')](_0x5a6b97,_0x53f981);});if(_0x3b1a51){return _0x1f5ade['id'];}}}));}}return BPromise['all'](_0x26bfac)[_0x6d4b('0x2a')](function(_0x520351){_0x56c5eb=_(_0x56c5eb)[_0x6d4b('0x81')](_0x520351)[_0x6d4b('0x82')]()[_0x6d4b('0x83')]();return db['MailQueue'][_0x6d4b('0x50')]({'where':{'id':_0x1265dc[_0x6d4b('0x4d')]['id']}})[_0x6d4b('0x2a')](function(_0x3ca080){return db[_0x6d4b('0x6d')][_0x6d4b('0x6e')](function(_0x305780){return _0x3ca080['removeTeams'](_0x1265dc[_0x6d4b('0x3a')][_0x6d4b('0x72')],{'transaction':_0x305780})[_0x6d4b('0x2a')](function(){if(!_[_0x6d4b('0x84')](_0x56c5eb)){return _0x3ca080[_0x6d4b('0x85')](_0x56c5eb,{'transaction':_0x305780});}})['then'](function(){_0x56c5eb[_0x6d4b('0x86')](function(_0x2f196a){socket['emit'](_0x6d4b('0x87'),{'UserId':_0x2f196a,'MailQueueId':_0x3ca080['id']});});});});});});})[_0x6d4b('0x2a')](respondWithStatusCode(_0x4384a3,null))['catch'](handleError(_0x4384a3,null));};exports['addAgents']=function(_0x38af67,_0x61f053,_0x5dde88){return db[_0x6d4b('0x4a')][_0x6d4b('0x50')]({'where':{'id':_0x38af67[_0x6d4b('0x4d')]['id']}})[_0x6d4b('0x2a')](handleEntityNotFound(_0x61f053,null))['then'](function(_0x3fb9a6){if(_0x3fb9a6){return _0x3fb9a6[_0x6d4b('0x88')](_0x38af67[_0x6d4b('0x53')][_0x6d4b('0x72')],_[_0x6d4b('0x89')](_0x38af67[_0x6d4b('0x53')],['ids','id'])||{})[_0x6d4b('0x8a')](function(_0x32420d){for(var _0x48b91b=0x0;_0x48b91b<_0x38af67[_0x6d4b('0x53')][_0x6d4b('0x72')]['length'];_0x48b91b+=0x1){socket[_0x6d4b('0x71')](_0x6d4b('0x8b'),{'UserId':Number(_0x38af67[_0x6d4b('0x53')][_0x6d4b('0x72')][_0x48b91b]),'MailQueueId':Number(_0x38af67[_0x6d4b('0x4d')]['id'])});}return _0x32420d;});}})[_0x6d4b('0x2a')](respondWithResult(_0x61f053,null))[_0x6d4b('0x51')](handleError(_0x61f053,null));};exports[_0x6d4b('0x85')]=function(_0x3af029,_0x524344,_0x137281){return db['MailQueue'][_0x6d4b('0x50')]({'where':{'id':_0x3af029[_0x6d4b('0x4d')]['id']}})[_0x6d4b('0x2a')](handleEntityNotFound(_0x524344,null))[_0x6d4b('0x2a')](function(_0x9cc94f){if(_0x9cc94f){return _0x9cc94f['removeAgents'](_0x3af029[_0x6d4b('0x3a')][_0x6d4b('0x72')])[_0x6d4b('0x2a')](function(){if(_[_0x6d4b('0x8c')](_0x3af029[_0x6d4b('0x3a')][_0x6d4b('0x72')])){for(var _0x256ac6=0x0;_0x256ac6<_0x3af029[_0x6d4b('0x3a')][_0x6d4b('0x72')][_0x6d4b('0x3f')];_0x256ac6+=0x1){socket[_0x6d4b('0x71')](_0x6d4b('0x87'),{'UserId':Number(_0x3af029[_0x6d4b('0x3a')][_0x6d4b('0x72')][_0x256ac6]),'MailQueueId':Number(_0x3af029[_0x6d4b('0x4d')]['id'])});}}else{socket[_0x6d4b('0x71')](_0x6d4b('0x87'),{'UserId':Number(_0x3af029['query'][_0x6d4b('0x72')]),'MailQueueId':Number(_0x3af029[_0x6d4b('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x524344,null))['catch'](handleError(_0x524344,null));};exports[_0x6d4b('0x8d')]=function(_0x5b4a61,_0x110c17,_0x554fd2){var _0x2205ff={};var _0x22c375={};var _0x58661f;var _0x493fc0;return db[_0x6d4b('0x4a')][_0x6d4b('0x66')]({'where':{'id':_0x5b4a61['params']['id']}})[_0x6d4b('0x2a')](handleEntityNotFound(_0x110c17,null))[_0x6d4b('0x2a')](function(_0x39596c){if(_0x39596c){_0x58661f=_0x39596c;_0x22c375[_0x6d4b('0x40')]=_['keys'](db['User']['rawAttributes']);_0x22c375[_0x6d4b('0x3a')]=_[_0x6d4b('0x4e')](_0x5b4a61[_0x6d4b('0x3a')]);_0x22c375[_0x6d4b('0x3b')]=_[_0x6d4b('0x3d')](_0x22c375['model'],_0x22c375[_0x6d4b('0x3a')]);_0x2205ff['attributes']=_[_0x6d4b('0x3d')](_0x22c375[_0x6d4b('0x40')],qs[_0x6d4b('0x3e')](_0x5b4a61[_0x6d4b('0x3a')][_0x6d4b('0x3e')]));_0x2205ff['attributes']=_0x2205ff[_0x6d4b('0x3c')][_0x6d4b('0x3f')]?_0x2205ff['attributes']:_0x22c375[_0x6d4b('0x40')];_0x2205ff['order']=qs[_0x6d4b('0x43')](_0x5b4a61['query'][_0x6d4b('0x43')]);_0x2205ff[_0x6d4b('0x46')]=qs[_0x6d4b('0x3b')](_[_0x6d4b('0x44')](_0x5b4a61[_0x6d4b('0x3a')],_0x22c375['filters']));if(_0x5b4a61[_0x6d4b('0x3a')][_0x6d4b('0x45')]){_0x2205ff[_0x6d4b('0x46')]=_[_0x6d4b('0x47')](_0x2205ff[_0x6d4b('0x46')],{'$or':_['map'](_0x2205ff['attributes'],function(_0x58b2a3){var _0x4d7be3={};_0x4d7be3[_0x58b2a3]={'$like':'%'+_0x5b4a61['query'][_0x6d4b('0x45')]+'%'};return _0x4d7be3;})});}_0x2205ff=_[_0x6d4b('0x47')]({},_0x2205ff,_0x5b4a61['options']);return _0x58661f[_0x6d4b('0x8d')](_0x2205ff);}})['then'](function(_0x3ef057){if(_0x3ef057){_0x493fc0=_0x3ef057['length'];if(!_0x5b4a61[_0x6d4b('0x3a')][_0x6d4b('0x58')](_0x6d4b('0x41'))){_0x2205ff[_0x6d4b('0x21')]=qs[_0x6d4b('0x21')](_0x5b4a61['query'][_0x6d4b('0x21')]);_0x2205ff['offset']=qs[_0x6d4b('0x1f')](_0x5b4a61[_0x6d4b('0x3a')][_0x6d4b('0x1f')]);}return _0x58661f[_0x6d4b('0x8d')](_0x2205ff);}})[_0x6d4b('0x2a')](function(_0x3c1467){if(_0x3c1467){return _0x3c1467?{'count':_0x493fc0,'rows':_0x3c1467}:null;}})['then'](respondWithResult(_0x110c17,null))[_0x6d4b('0x51')](handleError(_0x110c17,null));};
\ No newline at end of file
index 6aaa1c8..5f603ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b77=['update','remove','emit','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x4dba92,_0x57b559){var _0x5951da=function(_0x304a1a){while(--_0x304a1a){_0x4dba92['push'](_0x4dba92['shift']());}};_0x5951da(++_0x57b559);}(_0x7b77,0x176));var _0x77b7=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x7b77[_0x265aa2];return _0x447a3a;};'use strict';var EventEmitter=require(_0x77b7('0x0'));var MailQueue=require(_0x77b7('0x1'))['db'][_0x77b7('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x77b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x77b7('0x4'),'afterDestroy':_0x77b7('0x5')};function emitEvent(_0x3ac221){return function(_0x2f9ed3,_0x187b49,_0x1e5afb){MailQueueEvents[_0x77b7('0x6')](_0x3ac221+':'+_0x2f9ed3['id'],_0x2f9ed3);MailQueueEvents[_0x77b7('0x6')](_0x3ac221,_0x2f9ed3);_0x1e5afb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x77b7('0x7')](e,emitEvent(event));}}module[_0x77b7('0x8')]=MailQueueEvents;
\ No newline at end of file
+var _0x2c6f=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x2c6f,0x1a0));var _0xf2c6=function(_0x3f6c8b,_0x475eae){_0x3f6c8b=_0x3f6c8b-0x0;var _0x1d93e4=_0x2c6f[_0x3f6c8b];return _0x1d93e4;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xf2c6('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xf2c6('0x1')](0x0);var events={'afterCreate':_0xf2c6('0x2'),'afterUpdate':_0xf2c6('0x3'),'afterDestroy':_0xf2c6('0x4')};function emitEvent(_0x555dcb){return function(_0x52237e,_0x338239,_0x7264c5){MailQueueEvents[_0xf2c6('0x5')](_0x555dcb+':'+_0x52237e['id'],_0x52237e);MailQueueEvents[_0xf2c6('0x5')](_0x555dcb,_0x52237e);_0x7264c5(null);};}for(var e in events){if(events[_0xf2c6('0x6')](e)){var event=events[e];MailQueue[_0xf2c6('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
index 916da02..2dbb0a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x785d=['exports','MailQueue','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x216008,_0x2d1023){var _0x4d384f=function(_0x3fd7e2){while(--_0x3fd7e2){_0x216008['push'](_0x216008['shift']());}};_0x4d384f(++_0x2d1023);}(_0x785d,0x174));var _0xd785=function(_0x282ac4,_0x1b9cc2){_0x282ac4=_0x282ac4-0x0;var _0xe77923=_0x785d[_0x282ac4];return _0xe77923;};'use strict';var _=require('lodash');var util=require(_0xd785('0x0'));var logger=require('../../config/logger')(_0xd785('0x1'));var moment=require(_0xd785('0x2'));var BPromise=require(_0xd785('0x3'));var rp=require(_0xd785('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd785('0x5'));var config=require(_0xd785('0x6'));var attributes=require(_0xd785('0x7'));module[_0xd785('0x8')]=function(_0x17f6e0,_0x45b1d9){return _0x17f6e0['define'](_0xd785('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4435=['bluebird','request-promise','../../config/environment','./mailQueue.attributes','exports','MailQueue','lodash','util','../../config/logger','api'];(function(_0x5b9d4d,_0x2c4c41){var _0x25a90d=function(_0x5ea624){while(--_0x5ea624){_0x5b9d4d['push'](_0x5b9d4d['shift']());}};_0x25a90d(++_0x2c4c41);}(_0x4435,0x1be));var _0x5443=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x4435[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0x5443('0x0'));var util=require(_0x5443('0x1'));var logger=require(_0x5443('0x2'))(_0x5443('0x3'));var moment=require('moment');var BPromise=require(_0x5443('0x4'));var rp=require(_0x5443('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5443('0x6'));var attributes=require(_0x5443('0x7'));module[_0x5443('0x8')]=function(_0x2c4131,_0x3b7630){return _0x2c4131['define'](_0x5443('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c1ef4ce..95ac748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3e7=['find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','map','model','then','info'];(function(_0x1bf06f,_0x164732){var _0x5092d5=function(_0x4d71c0){while(--_0x4d71c0){_0x1bf06f['push'](_0x1bf06f['shift']());}};_0x5092d5(++_0x164732);}(_0xc3e7,0xa1));var _0x7c3e=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xc3e7[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0x7c3e('0x0'));var util=require(_0x7c3e('0x1'));var moment=require('moment');var BPromise=require(_0x7c3e('0x2'));var rs=require(_0x7c3e('0x3'));var fs=require('fs');var Redis=require(_0x7c3e('0x4'));var db=require(_0x7c3e('0x5'))['db'];var utils=require(_0x7c3e('0x6'));var logger=require(_0x7c3e('0x7'))(_0x7c3e('0x8'));var config=require(_0x7c3e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7c3e('0xa')][_0x7c3e('0xb')]({'port':0x232a});config[_0x7c3e('0xc')]=_[_0x7c3e('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7c3e('0xe'))(new Redis(config[_0x7c3e('0xc')]));require('./mailQueue.socket')[_0x7c3e('0xf')](socket);function respondWithRpcPromise(_0x188f80,_0x4f1dd3,_0x3f5b31){return new BPromise(function(_0xb62c8f,_0x27a6d5){return client[_0x7c3e('0x10')](_0x188f80,_0x3f5b31)['then'](function(_0x4ab923){logger['info'](_0x7c3e('0x11'),_0x4f1dd3,_0x7c3e('0x12'));logger[_0x7c3e('0x13')](_0x7c3e('0x14'),_0x4f1dd3,_0x7c3e('0x12'),JSON[_0x7c3e('0x15')](_0x4ab923));if(_0x4ab923[_0x7c3e('0x16')]){if(_0x4ab923['error'][_0x7c3e('0x17')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x4f1dd3,_0x4ab923[_0x7c3e('0x16')][_0x7c3e('0x18')]);return _0x27a6d5(_0x4ab923[_0x7c3e('0x16')][_0x7c3e('0x18')]);}logger[_0x7c3e('0x16')]('MailQueue,\x20%s,\x20%s',_0x4f1dd3,_0x4ab923[_0x7c3e('0x16')]['message']);return _0xb62c8f(_0x4ab923[_0x7c3e('0x16')][_0x7c3e('0x18')]);}else{logger['info'](_0x7c3e('0x11'),_0x4f1dd3,_0x7c3e('0x12'));_0xb62c8f(_0x4ab923[_0x7c3e('0x19')][_0x7c3e('0x18')]);}})[_0x7c3e('0x1a')](function(_0x4db0aa){logger[_0x7c3e('0x16')](_0x7c3e('0x11'),_0x4f1dd3,_0x4db0aa);_0x27a6d5(_0x4db0aa);});});}exports[_0x7c3e('0x1b')]=function(_0x4826fb){var _0x2f7418=this;return new Promise(function(_0x4f32f3,_0xfc1305){return db[_0x7c3e('0x1c')]['findAll']({'raw':_0x4826fb[_0x7c3e('0x1d')]?_0x4826fb[_0x7c3e('0x1d')][_0x7c3e('0x1e')]===undefined?!![]:![]:!![],'where':_0x4826fb['options']?_0x4826fb[_0x7c3e('0x1d')][_0x7c3e('0x1f')]||null:null,'attributes':_0x4826fb[_0x7c3e('0x1d')]?_0x4826fb[_0x7c3e('0x1d')][_0x7c3e('0x20')]||null:null,'limit':_0x4826fb['options']?_0x4826fb['options'][_0x7c3e('0x21')]||null:null,'include':_0x4826fb[_0x7c3e('0x1d')]?_0x4826fb[_0x7c3e('0x1d')][_0x7c3e('0x22')]?_['map'](_0x4826fb[_0x7c3e('0x1d')]['include'],function(_0xf3487a){return{'model':db[_0xf3487a['model']],'as':_0xf3487a['as'],'attributes':_0xf3487a['attributes'],'include':_0xf3487a[_0x7c3e('0x22')]?_[_0x7c3e('0x23')](_0xf3487a[_0x7c3e('0x22')],function(_0x32dd6e){return{'model':db[_0x32dd6e['model']],'as':_0x32dd6e['as'],'attributes':_0x32dd6e['attributes'],'include':_0x32dd6e[_0x7c3e('0x22')]?_[_0x7c3e('0x23')](_0x32dd6e['include'],function(_0x14f1fe){return{'model':db[_0x14f1fe[_0x7c3e('0x24')]],'as':_0x14f1fe['as'],'attributes':_0x14f1fe['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c3e('0x25')](function(_0x2b8250){logger[_0x7c3e('0x26')](_0x7c3e('0x1b'),_0x4826fb);logger['debug'](_0x7c3e('0x1b'),_0x4826fb,JSON[_0x7c3e('0x15')](_0x2b8250));_0x4f32f3(_0x2b8250);})[_0x7c3e('0x1a')](function(_0x243fd9){logger[_0x7c3e('0x16')](_0x7c3e('0x1b'),_0x243fd9[_0x7c3e('0x18')],_0x4826fb);_0xfc1305(_0x2f7418['error'](0x1f4,_0x243fd9[_0x7c3e('0x18')]));});});};exports['ShowMailQueue']=function(_0x57b216){var _0x4fab9e=this;return new Promise(function(_0x3fd342,_0x5b5332){return db[_0x7c3e('0x1c')][_0x7c3e('0x27')]({'raw':_0x57b216['options']?_0x57b216[_0x7c3e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x57b216[_0x7c3e('0x1d')]?_0x57b216[_0x7c3e('0x1d')]['where']||null:null,'attributes':_0x57b216['options']?_0x57b216[_0x7c3e('0x1d')][_0x7c3e('0x20')]||null:null,'include':_0x57b216[_0x7c3e('0x1d')]?_0x57b216[_0x7c3e('0x1d')][_0x7c3e('0x22')]?_[_0x7c3e('0x23')](_0x57b216[_0x7c3e('0x1d')][_0x7c3e('0x22')],function(_0x3014f3){return{'model':db[_0x3014f3[_0x7c3e('0x24')]],'as':_0x3014f3['as'],'attributes':_0x3014f3['attributes'],'include':_0x3014f3['include']?_[_0x7c3e('0x23')](_0x3014f3[_0x7c3e('0x22')],function(_0x43faf0){return{'model':db[_0x43faf0[_0x7c3e('0x24')]],'as':_0x43faf0['as'],'attributes':_0x43faf0[_0x7c3e('0x20')],'include':_0x43faf0[_0x7c3e('0x22')]?_['map'](_0x43faf0[_0x7c3e('0x22')],function(_0x35a298){return{'model':db[_0x35a298[_0x7c3e('0x24')]],'as':_0x35a298['as'],'attributes':_0x35a298[_0x7c3e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x489c6f){logger['info']('ShowMailQueue',_0x57b216);logger[_0x7c3e('0x13')]('ShowMailQueue',_0x57b216,JSON[_0x7c3e('0x15')](_0x489c6f));_0x3fd342(_0x489c6f);})[_0x7c3e('0x1a')](function(_0xd92a94){logger[_0x7c3e('0x16')]('ShowMailQueue',_0xd92a94[_0x7c3e('0x18')],_0x57b216);_0x5b5332(_0x4fab9e['error'](0x1f4,_0xd92a94[_0x7c3e('0x18')]));});});};
\ No newline at end of file
+var _0xdfb5=['code','message','info','result','MailQueue','findAll','options','raw','attributes','include','map','model','GetMailQueue','stringify','catch','ShowMailQueue','find','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x4937e4,_0x156cff){var _0x3f13c6=function(_0x48a68c){while(--_0x48a68c){_0x4937e4['push'](_0x4937e4['shift']());}};_0x3f13c6(++_0x156cff);}(_0xdfb5,0x8a));var _0x5dfb=function(_0x1a8bbb,_0x8d9059){_0x1a8bbb=_0x1a8bbb-0x0;var _0x3b0190=_0xdfb5[_0x1a8bbb];return _0x3b0190;};'use strict';var _=require(_0x5dfb('0x0'));var util=require('util');var moment=require(_0x5dfb('0x1'));var BPromise=require(_0x5dfb('0x2'));var rs=require(_0x5dfb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5dfb('0x4'))['db'];var utils=require(_0x5dfb('0x5'));var logger=require(_0x5dfb('0x6'))(_0x5dfb('0x7'));var config=require('../../config/environment');var jayson=require(_0x5dfb('0x8'));var client=jayson[_0x5dfb('0x9')][_0x5dfb('0xa')]({'port':0x232a});config[_0x5dfb('0xb')]=_['defaults'](config[_0x5dfb('0xb')],{'host':_0x5dfb('0xc'),'port':0x18eb});var socket=require(_0x5dfb('0xd'))(new Redis(config[_0x5dfb('0xb')]));require(_0x5dfb('0xe'))[_0x5dfb('0xf')](socket);function respondWithRpcPromise(_0x542c8b,_0x22d963,_0x1b72f3){return new BPromise(function(_0x2528aa,_0x36c388){return client[_0x5dfb('0x10')](_0x542c8b,_0x1b72f3)['then'](function(_0x2210f7){logger['info'](_0x5dfb('0x11'),_0x22d963,_0x5dfb('0x12'));logger[_0x5dfb('0x13')](_0x5dfb('0x14'),_0x22d963,'request\x20sent',JSON['stringify'](_0x2210f7));if(_0x2210f7[_0x5dfb('0x15')]){if(_0x2210f7[_0x5dfb('0x15')][_0x5dfb('0x16')]===0x1f4){logger['error'](_0x5dfb('0x11'),_0x22d963,_0x2210f7[_0x5dfb('0x15')]['message']);return _0x36c388(_0x2210f7['error'][_0x5dfb('0x17')]);}logger[_0x5dfb('0x15')](_0x5dfb('0x11'),_0x22d963,_0x2210f7[_0x5dfb('0x15')][_0x5dfb('0x17')]);return _0x2528aa(_0x2210f7['error'][_0x5dfb('0x17')]);}else{logger[_0x5dfb('0x18')]('MailQueue,\x20%s,\x20%s',_0x22d963,_0x5dfb('0x12'));_0x2528aa(_0x2210f7[_0x5dfb('0x19')][_0x5dfb('0x17')]);}})['catch'](function(_0x32709c){logger['error'](_0x5dfb('0x11'),_0x22d963,_0x32709c);_0x36c388(_0x32709c);});});}exports['GetMailQueue']=function(_0x1b6bfd){var _0x5195cf=this;return new Promise(function(_0x205fdd,_0x2faaaf){return db[_0x5dfb('0x1a')][_0x5dfb('0x1b')]({'raw':_0x1b6bfd['options']?_0x1b6bfd[_0x5dfb('0x1c')][_0x5dfb('0x1d')]===undefined?!![]:![]:!![],'where':_0x1b6bfd[_0x5dfb('0x1c')]?_0x1b6bfd[_0x5dfb('0x1c')]['where']||null:null,'attributes':_0x1b6bfd[_0x5dfb('0x1c')]?_0x1b6bfd[_0x5dfb('0x1c')][_0x5dfb('0x1e')]||null:null,'limit':_0x1b6bfd[_0x5dfb('0x1c')]?_0x1b6bfd[_0x5dfb('0x1c')]['limit']||null:null,'include':_0x1b6bfd[_0x5dfb('0x1c')]?_0x1b6bfd[_0x5dfb('0x1c')][_0x5dfb('0x1f')]?_[_0x5dfb('0x20')](_0x1b6bfd[_0x5dfb('0x1c')][_0x5dfb('0x1f')],function(_0x551dd2){return{'model':db[_0x551dd2[_0x5dfb('0x21')]],'as':_0x551dd2['as'],'attributes':_0x551dd2['attributes'],'include':_0x551dd2['include']?_[_0x5dfb('0x20')](_0x551dd2[_0x5dfb('0x1f')],function(_0x11f712){return{'model':db[_0x11f712['model']],'as':_0x11f712['as'],'attributes':_0x11f712[_0x5dfb('0x1e')],'include':_0x11f712[_0x5dfb('0x1f')]?_[_0x5dfb('0x20')](_0x11f712[_0x5dfb('0x1f')],function(_0x224fb8){return{'model':db[_0x224fb8[_0x5dfb('0x21')]],'as':_0x224fb8['as'],'attributes':_0x224fb8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cf3f9){logger[_0x5dfb('0x18')]('GetMailQueue',_0x1b6bfd);logger[_0x5dfb('0x13')](_0x5dfb('0x22'),_0x1b6bfd,JSON[_0x5dfb('0x23')](_0x2cf3f9));_0x205fdd(_0x2cf3f9);})[_0x5dfb('0x24')](function(_0x3f4f12){logger[_0x5dfb('0x15')]('GetMailQueue',_0x3f4f12['message'],_0x1b6bfd);_0x2faaaf(_0x5195cf[_0x5dfb('0x15')](0x1f4,_0x3f4f12['message']));});});};exports[_0x5dfb('0x25')]=function(_0x1ff31b){var _0x29c4fa=this;return new Promise(function(_0x439de8,_0xe2d270){return db[_0x5dfb('0x1a')][_0x5dfb('0x26')]({'raw':_0x1ff31b[_0x5dfb('0x1c')]?_0x1ff31b[_0x5dfb('0x1c')][_0x5dfb('0x1d')]===undefined?!![]:![]:!![],'where':_0x1ff31b[_0x5dfb('0x1c')]?_0x1ff31b['options']['where']||null:null,'attributes':_0x1ff31b[_0x5dfb('0x1c')]?_0x1ff31b[_0x5dfb('0x1c')]['attributes']||null:null,'include':_0x1ff31b['options']?_0x1ff31b[_0x5dfb('0x1c')]['include']?_[_0x5dfb('0x20')](_0x1ff31b[_0x5dfb('0x1c')][_0x5dfb('0x1f')],function(_0x28fcda){return{'model':db[_0x28fcda[_0x5dfb('0x21')]],'as':_0x28fcda['as'],'attributes':_0x28fcda['attributes'],'include':_0x28fcda[_0x5dfb('0x1f')]?_[_0x5dfb('0x20')](_0x28fcda[_0x5dfb('0x1f')],function(_0x10ee58){return{'model':db[_0x10ee58[_0x5dfb('0x21')]],'as':_0x10ee58['as'],'attributes':_0x10ee58[_0x5dfb('0x1e')],'include':_0x10ee58[_0x5dfb('0x1f')]?_['map'](_0x10ee58[_0x5dfb('0x1f')],function(_0x440e8c){return{'model':db[_0x440e8c[_0x5dfb('0x21')]],'as':_0x440e8c['as'],'attributes':_0x440e8c[_0x5dfb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5dfb('0x27')](function(_0x5e8784){logger[_0x5dfb('0x18')](_0x5dfb('0x25'),_0x1ff31b);logger['debug']('ShowMailQueue',_0x1ff31b,JSON[_0x5dfb('0x23')](_0x5e8784));_0x439de8(_0x5e8784);})[_0x5dfb('0x24')](function(_0x4b6df0){logger[_0x5dfb('0x15')](_0x5dfb('0x25'),_0x4b6df0[_0x5dfb('0x17')],_0x1ff31b);_0xe2d270(_0x29c4fa[_0x5dfb('0x15')](0x1f4,_0x4b6df0[_0x5dfb('0x17')]));});});};
\ No newline at end of file
index d4be372..451a005 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45eb=['remove','update','emit','removeListener','register','length','mailQueue:','./mailQueue.events','save'];(function(_0xcdea3,_0x21cc0b){var _0x4a54be=function(_0x263464){while(--_0x263464){_0xcdea3['push'](_0xcdea3['shift']());}};_0x4a54be(++_0x21cc0b);}(_0x45eb,0xc4));var _0xb45e=function(_0x2de2e3,_0x4c11dc){_0x2de2e3=_0x2de2e3-0x0;var _0x2d632b=_0x45eb[_0x2de2e3];return _0x2d632b;};'use strict';var MailQueueEvents=require(_0xb45e('0x0'));var events=[_0xb45e('0x1'),_0xb45e('0x2'),_0xb45e('0x3')];function createListener(_0x9dd904,_0x536a3d){return function(_0x1afb1a){_0x536a3d[_0xb45e('0x4')](_0x9dd904,_0x1afb1a);};}function removeListener(_0x5e39b,_0x2ae453){return function(){MailQueueEvents[_0xb45e('0x5')](_0x5e39b,_0x2ae453);};}exports[_0xb45e('0x6')]=function(_0x2dfa3e){for(var _0xab2812=0x0,_0x3169fe=events[_0xb45e('0x7')];_0xab2812<_0x3169fe;_0xab2812++){var _0xa12282=events[_0xab2812];var _0x1a6bd8=createListener(_0xb45e('0x8')+_0xa12282,_0x2dfa3e);MailQueueEvents['on'](_0xa12282,_0x1a6bd8);}};
\ No newline at end of file
+var _0xc466=['remove','update','emit','register','save'];(function(_0x3b204d,_0x2868c6){var _0x31c4dd=function(_0x531033){while(--_0x531033){_0x3b204d['push'](_0x3b204d['shift']());}};_0x31c4dd(++_0x2868c6);}(_0xc466,0x1bc));var _0x6c46=function(_0x297b59,_0x70ce07){_0x297b59=_0x297b59-0x0;var _0x38be67=_0xc466[_0x297b59];return _0x38be67;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x6c46('0x0'),_0x6c46('0x1'),_0x6c46('0x2')];function createListener(_0x559bc6,_0x5e8fbd){return function(_0x3fe3ae){_0x5e8fbd[_0x6c46('0x3')](_0x559bc6,_0x3fe3ae);};}function removeListener(_0x3719b7,_0xdd0f72){return function(){MailQueueEvents['removeListener'](_0x3719b7,_0xdd0f72);};}exports[_0x6c46('0x4')]=function(_0x4f4500){for(var _0x3efc58=0x0,_0xec5f6f=events['length'];_0x3efc58<_0xec5f6f;_0x3efc58++){var _0x596090=events[_0x3efc58];var _0x4c1a19=createListener('mailQueue:'+_0x596090,_0x4f4500);MailQueueEvents['on'](_0x596090,_0x4c1a19);}};
\ No newline at end of file
index 42c8983..a4d83ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x969f=['/describe','isAuthenticated','describe','show','post','create','put','update','delete','destroy','exports','multer','util','express','../../components/auth/service','./mailQueueReport.controller','get','index'];(function(_0x3198b5,_0x564ac4){var _0x5baf7f=function(_0x5bce27){while(--_0x5bce27){_0x3198b5['push'](_0x3198b5['shift']());}};_0x5baf7f(++_0x564ac4);}(_0x969f,0x197));var _0xf969=function(_0x363319,_0x4fa1a1){_0x363319=_0x363319-0x0;var _0x182a62=_0x969f[_0x363319];return _0x182a62;};'use strict';var multer=require(_0xf969('0x0'));var util=require(_0xf969('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf969('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf969('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf969('0x4'));router[_0xf969('0x5')]('/',auth['isAuthenticated'](),controller[_0xf969('0x6')]);router[_0xf969('0x5')](_0xf969('0x7'),auth[_0xf969('0x8')](),controller[_0xf969('0x9')]);router[_0xf969('0x5')]('/:id',auth[_0xf969('0x8')](),controller[_0xf969('0xa')]);router[_0xf969('0xb')]('/',auth['isAuthenticated'](),controller[_0xf969('0xc')]);router[_0xf969('0xd')]('/:id',auth[_0xf969('0x8')](),controller[_0xf969('0xe')]);router[_0xf969('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf969('0x10')]);module[_0xf969('0x11')]=router;
\ No newline at end of file
+var _0x1658=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x48ee9c,_0x2434b9){var _0x40100b=function(_0x526048){while(--_0x526048){_0x48ee9c['push'](_0x48ee9c['shift']());}};_0x40100b(++_0x2434b9);}(_0x1658,0x106));var _0x8165=function(_0x508ad,_0x4f29c1){_0x508ad=_0x508ad-0x0;var _0x2cf39d=_0x1658[_0x508ad];return _0x2cf39d;};'use strict';var multer=require(_0x8165('0x0'));var util=require(_0x8165('0x1'));var path=require('path');var timeout=require(_0x8165('0x2'));var express=require('express');var router=express[_0x8165('0x3')]();var fs_extra=require(_0x8165('0x4'));var auth=require(_0x8165('0x5'));var interaction=require(_0x8165('0x6'));var config=require(_0x8165('0x7'));var controller=require('./mailQueueReport.controller');router[_0x8165('0x8')]('/',auth[_0x8165('0x9')](),controller[_0x8165('0xa')]);router[_0x8165('0x8')](_0x8165('0xb'),auth[_0x8165('0x9')](),controller[_0x8165('0xc')]);router['get'](_0x8165('0xd'),auth[_0x8165('0x9')](),controller[_0x8165('0xe')]);router[_0x8165('0xf')]('/',auth['isAuthenticated'](),controller[_0x8165('0x10')]);router[_0x8165('0x11')](_0x8165('0xd'),auth[_0x8165('0x9')](),controller[_0x8165('0x12')]);router[_0x8165('0x13')](_0x8165('0xd'),auth[_0x8165('0x9')](),controller[_0x8165('0x14')]);module[_0x8165('0x15')]=router;
\ No newline at end of file
index 529d551..58b4219 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2a2=['moment','sequelize','STRING','DATE'];(function(_0x33b4f,_0x415988){var _0x1919c6=function(_0x26077f){while(--_0x26077f){_0x33b4f['push'](_0x33b4f['shift']());}};_0x1919c6(++_0x415988);}(_0xc2a2,0x98));var _0x2c2a=function(_0x549b73,_0x4612db){_0x549b73=_0x549b73-0x0;var _0x43684d=_0xc2a2[_0x549b73];return _0x43684d;};'use strict';var moment=require(_0x2c2a('0x0'));var Sequelize=require(_0x2c2a('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x2c2a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2c2a('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2c2a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb961=['sequelize','exports','STRING','DATE','moment'];(function(_0x2718f7,_0x49485a){var _0x2e3513=function(_0x16a3f9){while(--_0x16a3f9){_0x2718f7['push'](_0x2718f7['shift']());}};_0x2e3513(++_0x49485a);}(_0xb961,0x1c1));var _0x1b96=function(_0x48c9d1,_0x440c30){_0x48c9d1=_0x48c9d1-0x0;var _0x1c3d1a=_0xb961[_0x48c9d1];return _0x1c3d1a;};'use strict';var moment=require(_0x1b96('0x0'));var Sequelize=require(_0x1b96('0x1'));module[_0x1b96('0x2')]={'uniqueid':{'type':Sequelize[_0x1b96('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1b96('0x3')]},'joinAt':{'type':Sequelize[_0x1b96('0x4')]},'leaveAt':{'type':Sequelize[_0x1b96('0x4')]},'acceptAt':{'type':Sequelize[_0x1b96('0x4')]},'exitAt':{'type':Sequelize[_0x1b96('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 540ed9c..ac09ca7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x958a=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','MailQueueReport','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','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'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x958a,0x128));var _0xa958=function(_0x15df48,_0x2dda25){_0x15df48=_0x15df48-0x0;var _0x4f23df=_0x958a[_0x15df48];return _0x4f23df;};'use strict';var emlformat=require(_0xa958('0x0'));var rimraf=require(_0xa958('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa958('0x2'));var rp=require(_0xa958('0x3'));var moment=require(_0xa958('0x4'));var BPromise=require(_0xa958('0x5'));var Mustache=require(_0xa958('0x6'));var util=require('util');var path=require(_0xa958('0x7'));var sox=require('sox');var csv=require(_0xa958('0x8'));var ejs=require(_0xa958('0x9'));var fs=require('fs');var fs_extra=require(_0xa958('0xa'));var _=require(_0xa958('0xb'));var squel=require(_0xa958('0xc'));var crypto=require(_0xa958('0xd'));var jsforce=require(_0xa958('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa958('0xf'));var Papa=require(_0xa958('0x10'));var Redis=require(_0xa958('0x11'));var authService=require(_0xa958('0x12'));var qs=require(_0xa958('0x13'));var as=require(_0xa958('0x14'));var hardwareService=require(_0xa958('0x15'));var logger=require(_0xa958('0x16'))(_0xa958('0x17'));var utils=require(_0xa958('0x18'));var config=require(_0xa958('0x19'));var licenseUtil=require(_0xa958('0x1a'));var db=require(_0xa958('0x1b'))['db'];function respondWithStatusCode(_0x53bf27,_0x5063ae){_0x5063ae=_0x5063ae||0xcc;return function(_0x5bcc66){if(_0x5bcc66){return _0x53bf27[_0xa958('0x1c')](_0x5063ae);}return _0x53bf27[_0xa958('0x1d')](_0x5063ae)[_0xa958('0x1e')]();};}function respondWithResult(_0x591d4d,_0x3ebc66){_0x3ebc66=_0x3ebc66||0xc8;return function(_0x54c439){if(_0x54c439){return _0x591d4d['status'](_0x3ebc66)['json'](_0x54c439);}};}function respondWithFilteredResult(_0x1fe41e,_0x15fca8){return function(_0xb90ac6){if(_0xb90ac6){var _0x6a81c7=typeof _0x15fca8[_0xa958('0x1f')]===_0xa958('0x20')&&typeof _0x15fca8[_0xa958('0x21')]===_0xa958('0x20');var _0x4d836f=_0xb90ac6[_0xa958('0x22')];var _0x4eadc9=_0x6a81c7?0x0:_0x15fca8[_0xa958('0x1f')];var _0x70d13e=_0x6a81c7?_0xb90ac6['count']:_0x15fca8[_0xa958('0x1f')]+_0x15fca8[_0xa958('0x21')];var _0x47636f;if(_0x70d13e>=_0x4d836f){_0x70d13e=_0x4d836f;_0x47636f=0xc8;}else{_0x47636f=0xce;}_0x1fe41e[_0xa958('0x1d')](_0x47636f);return _0x1fe41e[_0xa958('0x23')](_0xa958('0x24'),_0x4eadc9+'-'+_0x70d13e+'/'+_0x4d836f)['json'](_0xb90ac6);}return null;};}function patchUpdates(_0x4a90c2){return function(_0x373661){try{jsonpatch[_0xa958('0x25')](_0x373661,_0x4a90c2,!![]);}catch(_0x16c0be){return BPromise['reject'](_0x16c0be);}return _0x373661[_0xa958('0x26')]();};}function saveUpdates(_0x383aa3,_0x5c091a){return function(_0x28cf12){if(_0x28cf12){return _0x28cf12[_0xa958('0x27')](_0x383aa3)['then'](function(_0x5c5a2b){return _0x5c5a2b;});}return null;};}function removeEntity(_0x201ed3,_0x40b51e){return function(_0x50b3c3){if(_0x50b3c3){return _0x50b3c3[_0xa958('0x28')]()[_0xa958('0x29')](function(){_0x201ed3[_0xa958('0x1d')](0xcc)[_0xa958('0x1e')]();});}};}function handleEntityNotFound(_0x16b04a,_0xf1436e){return function(_0x50fdb1){if(!_0x50fdb1){_0x16b04a[_0xa958('0x1c')](0x194);}return _0x50fdb1;};}function handleError(_0x48ef34,_0x43df63){_0x43df63=_0x43df63||0x1f4;return function(_0x3c2ea3){logger[_0xa958('0x2a')](_0x3c2ea3[_0xa958('0x2b')]);if(_0x3c2ea3[_0xa958('0x2c')]){delete _0x3c2ea3[_0xa958('0x2c')];}_0x48ef34[_0xa958('0x1d')](_0x43df63)[_0xa958('0x2d')](_0x3c2ea3);};}exports[_0xa958('0x2e')]=function(_0x404d07,_0x4c4c37){var _0x47895c={},_0xd2fcc9={},_0x4ef4f6={'count':0x0,'rows':[]};var _0x1febd2=_[_0xa958('0x2f')](db['MailQueueReport'][_0xa958('0x30')],function(_0x3d4711){return{'name':_0x3d4711[_0xa958('0x31')],'type':_0x3d4711[_0xa958('0x32')][_0xa958('0x33')]};});_0xd2fcc9['model']=_['map'](_0x1febd2,_0xa958('0x2c'));_0xd2fcc9['query']=_['keys'](_0x404d07[_0xa958('0x34')]);_0xd2fcc9[_0xa958('0x35')]=_[_0xa958('0x36')](_0xd2fcc9[_0xa958('0x37')],_0xd2fcc9[_0xa958('0x34')]);_0x47895c[_0xa958('0x38')]=_['intersection'](_0xd2fcc9[_0xa958('0x37')],qs['fields'](_0x404d07['query'][_0xa958('0x39')]));_0x47895c[_0xa958('0x38')]=_0x47895c[_0xa958('0x38')][_0xa958('0x3a')]?_0x47895c[_0xa958('0x38')]:_0xd2fcc9[_0xa958('0x37')];if(!_0x404d07[_0xa958('0x34')][_0xa958('0x3b')]('nolimit')){_0x47895c['limit']=qs[_0xa958('0x21')](_0x404d07[_0xa958('0x34')][_0xa958('0x21')]);_0x47895c[_0xa958('0x1f')]=qs[_0xa958('0x1f')](_0x404d07['query'][_0xa958('0x1f')]);}_0x47895c[_0xa958('0x3c')]=qs[_0xa958('0x3d')](_0x404d07[_0xa958('0x34')]['sort']);_0x47895c[_0xa958('0x3e')]=qs[_0xa958('0x35')](_[_0xa958('0x3f')](_0x404d07[_0xa958('0x34')],_0xd2fcc9[_0xa958('0x35')]),_0x1febd2);if(_0x404d07['query'][_0xa958('0x40')]){_0x47895c[_0xa958('0x3e')]=_[_0xa958('0x41')](_0x47895c[_0xa958('0x3e')],{'$or':_[_0xa958('0x2f')](_0x1febd2,function(_0x45603f){if(_0x45603f[_0xa958('0x32')]!==_0xa958('0x42')){var _0x2378df={};_0x2378df[_0x45603f[_0xa958('0x2c')]]={'$like':'%'+_0x404d07['query'][_0xa958('0x40')]+'%'};return _0x2378df;}})});}_0x47895c=_[_0xa958('0x41')]({},_0x47895c,_0x404d07[_0xa958('0x43')]);var _0x5d5ae1={'where':_0x47895c[_0xa958('0x3e')]};return db[_0xa958('0x44')]['count'](_0x5d5ae1)['then'](function(_0x53710e){_0x4ef4f6['count']=_0x53710e;if(_0x404d07[_0xa958('0x34')]['includeAll']){_0x47895c[_0xa958('0x45')]=[{'all':!![]}];}return db['MailQueueReport'][_0xa958('0x46')](_0x47895c);})[_0xa958('0x29')](function(_0x44fa44){_0x4ef4f6[_0xa958('0x47')]=_0x44fa44;return _0x4ef4f6;})[_0xa958('0x29')](respondWithFilteredResult(_0x4c4c37,_0x47895c))[_0xa958('0x48')](handleError(_0x4c4c37,null));};exports[_0xa958('0x49')]=function(_0x18f110,_0x517319){var _0x10e4ee={'raw':!![],'where':{'id':_0x18f110[_0xa958('0x4a')]['id']}},_0x38dfb4={};_0x38dfb4['model']=_['keys'](db['MailQueueReport'][_0xa958('0x30')]);_0x38dfb4[_0xa958('0x34')]=_[_0xa958('0x4b')](_0x18f110[_0xa958('0x34')]);_0x38dfb4[_0xa958('0x35')]=_['intersection'](_0x38dfb4[_0xa958('0x37')],_0x38dfb4[_0xa958('0x34')]);_0x10e4ee[_0xa958('0x38')]=_[_0xa958('0x36')](_0x38dfb4[_0xa958('0x37')],qs[_0xa958('0x39')](_0x18f110[_0xa958('0x34')][_0xa958('0x39')]));_0x10e4ee[_0xa958('0x38')]=_0x10e4ee[_0xa958('0x38')][_0xa958('0x3a')]?_0x10e4ee[_0xa958('0x38')]:_0x38dfb4[_0xa958('0x37')];if(_0x18f110[_0xa958('0x34')][_0xa958('0x4c')]){_0x10e4ee[_0xa958('0x45')]=[{'all':!![]}];}_0x10e4ee=_[_0xa958('0x41')]({},_0x10e4ee,_0x18f110['options']);return db['MailQueueReport']['find'](_0x10e4ee)[_0xa958('0x29')](handleEntityNotFound(_0x517319,null))[_0xa958('0x29')](respondWithResult(_0x517319,null))[_0xa958('0x48')](handleError(_0x517319,null));};exports[_0xa958('0x4d')]=function(_0x55ab45,_0x34faa2){return db[_0xa958('0x44')][_0xa958('0x4d')](_0x55ab45[_0xa958('0x4e')],{})[_0xa958('0x29')](respondWithResult(_0x34faa2,0xc9))['catch'](handleError(_0x34faa2,null));};exports[_0xa958('0x27')]=function(_0x2bbb2e,_0x3f8407){if(_0x2bbb2e['body']['id']){delete _0x2bbb2e[_0xa958('0x4e')]['id'];}return db['MailQueueReport'][_0xa958('0x4f')]({'where':{'id':_0x2bbb2e[_0xa958('0x4a')]['id']}})[_0xa958('0x29')](handleEntityNotFound(_0x3f8407,null))['then'](saveUpdates(_0x2bbb2e[_0xa958('0x4e')],null))['then'](respondWithResult(_0x3f8407,null))[_0xa958('0x48')](handleError(_0x3f8407,null));};exports[_0xa958('0x28')]=function(_0x85fc0d,_0x402d0a){return db[_0xa958('0x44')]['find']({'where':{'id':_0x85fc0d[_0xa958('0x4a')]['id']}})['then'](handleEntityNotFound(_0x402d0a,null))[_0xa958('0x29')](removeEntity(_0x402d0a,null))[_0xa958('0x48')](handleError(_0x402d0a,null));};exports['describe']=function(_0x17e4e7,_0x4f0a27){return db[_0xa958('0x44')][_0xa958('0x50')]()[_0xa958('0x29')](respondWithResult(_0x4f0a27,null))[_0xa958('0x48')](handleError(_0x4f0a27,null));};
\ No newline at end of file
+var _0x2a07=['index','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2a07,0x74));var _0x72a0=function(_0x5a0247,_0x4043d0){_0x5a0247=_0x5a0247-0x0;var _0x2197c6=_0x2a07[_0x5a0247];return _0x2197c6;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':!![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['MailQueueReport'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['MailQueueReport']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));};exports[_0x72a0('0x4f')]=function(_0x50c8d7,_0xc0f323){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0xc0f323,null))[_0x72a0('0x46')](handleError(_0xc0f323,null));};
\ No newline at end of file
index b682ee6..60240e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3360=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3360,0x1c8));var _0x0336=function(_0x3270f9,_0x407457){_0x3270f9=_0x3270f9-0x0;var _0x26006d=_0x3360[_0x3270f9];return _0x26006d;};'use strict';var _=require(_0x0336('0x0'));var util=require(_0x0336('0x1'));var logger=require(_0x0336('0x2'))(_0x0336('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0336('0x4'));var fs=require('fs');var path=require(_0x0336('0x5'));var rimraf=require(_0x0336('0x6'));var config=require(_0x0336('0x7'));var attributes=require(_0x0336('0x8'));module[_0x0336('0x9')]=function(_0x5b8d5a,_0x224b5a){return _0x5b8d5a[_0x0336('0xa')](_0x0336('0xb'),attributes,{'tableName':_0x0336('0xc'),'paranoid':![],'indexes':[{'name':_0x0336('0xd'),'fields':[_0x0336('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b6e=['report_mail_queue','uniqueid','util','moment','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x6c8c0a,_0x216867){var _0x44f188=function(_0x1056b1){while(--_0x1056b1){_0x6c8c0a['push'](_0x6c8c0a['shift']());}};_0x44f188(++_0x216867);}(_0x5b6e,0x152));var _0xe5b6=function(_0x4086fb,_0x3f083f){_0x4086fb=_0x4086fb-0x0;var _0x2e8494=_0x5b6e[_0x4086fb];return _0x2e8494;};'use strict';var _=require('lodash');var util=require(_0xe5b6('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe5b6('0x1'));var BPromise=require('bluebird');var rp=require(_0xe5b6('0x2'));var fs=require('fs');var path=require(_0xe5b6('0x3'));var rimraf=require(_0xe5b6('0x4'));var config=require(_0xe5b6('0x5'));var attributes=require(_0xe5b6('0x6'));module[_0xe5b6('0x7')]=function(_0x1834d3,_0x5232ce){return _0x1834d3[_0xe5b6('0x8')](_0xe5b6('0x9'),attributes,{'tableName':_0xe5b6('0xa'),'paranoid':![],'indexes':[{'name':_0xe5b6('0xb'),'fields':[_0xe5b6('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 56fbe6d..dd618d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x342869,_0x49b132){var _0x5ef3b2=function(_0x48b45a){while(--_0x48b45a){_0x342869['push'](_0x342869['shift']());}};_0x5ef3b2(++_0x49b132);}(_0xadb5,0xad));var _0x5adb=function(_0x12dc4d,_0x3ab286){_0x12dc4d=_0x12dc4d-0x0;var _0xb1ef5a=_0xadb5[_0x12dc4d];return _0xb1ef5a;};'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
+var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x3a6a09,_0x784489){var _0x30cd99=function(_0x274a79){while(--_0x274a79){_0x3a6a09['push'](_0x3a6a09['shift']());}};_0x30cd99(++_0x784489);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc4aa[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});};
\ No newline at end of file
index 01da451..17e546e 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(_0x40176b,_0x168e9f){var _0x874f78=function(_0x241b18){while(--_0x241b18){_0x40176b['push'](_0x40176b['shift']());}};_0x874f78(++_0x168e9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=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(_0x2ffefe,_0x55d760){var _0x1002e1=function(_0x504faa){while(--_0x504faa){_0x2ffefe['push'](_0x2ffefe['shift']());}};_0x1002e1(++_0x55d760);}(_0xe706,0xa3));var _0x6e70=function(_0x7e6cf7,_0x4c8e23){_0x7e6cf7=_0x7e6cf7-0x0;var _0x18d4ee=_0xe706[_0x7e6cf7];return _0x18d4ee;};'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 c734228..9b61368 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b87=['STRING','BOOLEAN','INTEGER','INBOX','sequelize','exports'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0x9b87,0x8e));var _0x79b8=function(_0xdeb8d2,_0x5cbbb3){_0xdeb8d2=_0xdeb8d2-0x0;var _0x19f939=_0x9b87[_0xdeb8d2];return _0x19f939;};'use strict';var Sequelize=require(_0x79b8('0x0'));module[_0x79b8('0x1')]={'description':{'type':Sequelize[_0x79b8('0x2')]},'host':{'type':Sequelize[_0x79b8('0x2')]},'authentication':{'type':Sequelize[_0x79b8('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x79b8('0x2')]},'password':{'type':Sequelize[_0x79b8('0x2')]},'port':{'type':Sequelize[_0x79b8('0x4')]},'tls':{'type':Sequelize[_0x79b8('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x79b8('0x2')],'defaultValue':_0x79b8('0x5')},'connTimeout':{'type':Sequelize[_0x79b8('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x79b8('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x79b8('0x2')]}};
\ No newline at end of file
+var _0xb9a7=['STRING','INTEGER','BOOLEAN','INBOX','exports'];(function(_0x289d9d,_0x12e632){var _0xd908a8=function(_0x3177e6){while(--_0x3177e6){_0x289d9d['push'](_0x289d9d['shift']());}};_0xd908a8(++_0x12e632);}(_0xb9a7,0x112));var _0x7b9a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb9a7[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require('sequelize');module[_0x7b9a('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x7b9a('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x7b9a('0x2')]},'tls':{'type':Sequelize[_0x7b9a('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7b9a('0x1')],'defaultValue':_0x7b9a('0x4')},'connTimeout':{'type':Sequelize[_0x7b9a('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x7b9a('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x7b9a('0x1')]}};
\ No newline at end of file
index e057006..f7c1a67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56d7=['./mailServerIn.attributes','exports','define','MailServerIn','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1b5838,_0x25ec5b){var _0x213065=function(_0xde01bf){while(--_0xde01bf){_0x1b5838['push'](_0x1b5838['shift']());}};_0x213065(++_0x25ec5b);}(_0x56d7,0xe0));var _0x756d=function(_0x12e31d,_0x4b76fb){_0x12e31d=_0x12e31d-0x0;var _0x506d58=_0x56d7[_0x12e31d];return _0x506d58;};'use strict';var _=require('lodash');var util=require(_0x756d('0x0'));var logger=require(_0x756d('0x1'))('api');var moment=require(_0x756d('0x2'));var BPromise=require(_0x756d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x756d('0x4'));var rimraf=require(_0x756d('0x5'));var config=require(_0x756d('0x6'));var attributes=require(_0x756d('0x7'));module[_0x756d('0x8')]=function(_0x21effd,_0x9d291c){return _0x21effd[_0x756d('0x9')](_0x756d('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb0c=['mail_servers_in','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','MailServerIn'];(function(_0x194ff2,_0x566ca5){var _0x10c4a3=function(_0x2e614e){while(--_0x2e614e){_0x194ff2['push'](_0x194ff2['shift']());}};_0x10c4a3(++_0x566ca5);}(_0xfb0c,0x153));var _0xcfb0=function(_0x361b1c,_0x266d31){_0x361b1c=_0x361b1c-0x0;var _0x385418=_0xfb0c[_0x361b1c];return _0x385418;};'use strict';var _=require(_0xcfb0('0x0'));var util=require(_0xcfb0('0x1'));var logger=require(_0xcfb0('0x2'))(_0xcfb0('0x3'));var moment=require(_0xcfb0('0x4'));var BPromise=require('bluebird');var rp=require(_0xcfb0('0x5'));var fs=require('fs');var path=require(_0xcfb0('0x6'));var rimraf=require(_0xcfb0('0x7'));var config=require(_0xcfb0('0x8'));var attributes=require('./mailServerIn.attributes');module[_0xcfb0('0x9')]=function(_0x474d4,_0x120b55){return _0x474d4[_0xcfb0('0xa')](_0xcfb0('0xb'),attributes,{'tableName':_0xcfb0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 035566b..c24ea76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2f2=['stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','attributes','include','model','map','then','GetMailServerIn'];(function(_0x11c6b8,_0x5b2d7b){var _0x38b38f=function(_0x641ad0){while(--_0x641ad0){_0x11c6b8['push'](_0x11c6b8['shift']());}};_0x38b38f(++_0x5b2d7b);}(_0xf2f2,0x101));var _0x2f2f=function(_0x133e8d,_0x4648f1){_0x133e8d=_0x133e8d-0x0;var _0x10ce55=_0xf2f2[_0x133e8d];return _0x10ce55;};'use strict';var _=require(_0x2f2f('0x0'));var util=require('util');var moment=require(_0x2f2f('0x1'));var BPromise=require(_0x2f2f('0x2'));var rs=require(_0x2f2f('0x3'));var fs=require('fs');var Redis=require(_0x2f2f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f2f('0x5'));var logger=require('../../config/logger')(_0x2f2f('0x6'));var config=require(_0x2f2f('0x7'));var jayson=require(_0x2f2f('0x8'));var client=jayson[_0x2f2f('0x9')][_0x2f2f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34540d,_0x5d5438,_0x5a8100){return new BPromise(function(_0xc86ee6,_0x15f60c){return client['request'](_0x34540d,_0x5a8100)['then'](function(_0x4aae7c){logger[_0x2f2f('0xb')](_0x2f2f('0xc'),_0x5d5438,_0x2f2f('0xd'));logger[_0x2f2f('0xe')](_0x2f2f('0xf'),_0x5d5438,_0x2f2f('0xd'),JSON['stringify'](_0x4aae7c));if(_0x4aae7c[_0x2f2f('0x10')]){if(_0x4aae7c['error'][_0x2f2f('0x11')]===0x1f4){logger['error'](_0x2f2f('0xc'),_0x5d5438,_0x4aae7c[_0x2f2f('0x10')][_0x2f2f('0x12')]);return _0x15f60c(_0x4aae7c[_0x2f2f('0x10')][_0x2f2f('0x12')]);}logger['error'](_0x2f2f('0xc'),_0x5d5438,_0x4aae7c[_0x2f2f('0x10')][_0x2f2f('0x12')]);return _0xc86ee6(_0x4aae7c[_0x2f2f('0x10')][_0x2f2f('0x12')]);}else{logger[_0x2f2f('0xb')]('MailServerIn,\x20%s,\x20%s',_0x5d5438,_0x2f2f('0xd'));_0xc86ee6(_0x4aae7c[_0x2f2f('0x13')][_0x2f2f('0x12')]);}})[_0x2f2f('0x14')](function(_0x364336){logger[_0x2f2f('0x10')](_0x2f2f('0xc'),_0x5d5438,_0x364336);_0x15f60c(_0x364336);});});}exports['GetMailServerIn']=function(_0xdab861){var _0xd6b51b=this;return new Promise(function(_0x53a55c,_0x5034f0){return db['MailServerIn'][_0x2f2f('0x15')]({'raw':_0xdab861[_0x2f2f('0x16')]?_0xdab861[_0x2f2f('0x16')][_0x2f2f('0x17')]===undefined?!![]:![]:!![],'where':_0xdab861[_0x2f2f('0x16')]?_0xdab861[_0x2f2f('0x16')][_0x2f2f('0x18')]||null:null,'attributes':_0xdab861[_0x2f2f('0x16')]?_0xdab861['options'][_0x2f2f('0x19')]||null:null,'limit':_0xdab861[_0x2f2f('0x16')]?_0xdab861[_0x2f2f('0x16')]['limit']||null:null,'include':_0xdab861[_0x2f2f('0x16')]?_0xdab861[_0x2f2f('0x16')][_0x2f2f('0x1a')]?_['map'](_0xdab861['options'][_0x2f2f('0x1a')],function(_0x10a7e4){return{'model':db[_0x10a7e4[_0x2f2f('0x1b')]],'as':_0x10a7e4['as'],'attributes':_0x10a7e4[_0x2f2f('0x19')],'include':_0x10a7e4[_0x2f2f('0x1a')]?_[_0x2f2f('0x1c')](_0x10a7e4['include'],function(_0x43bffc){return{'model':db[_0x43bffc[_0x2f2f('0x1b')]],'as':_0x43bffc['as'],'attributes':_0x43bffc['attributes'],'include':_0x43bffc['include']?_[_0x2f2f('0x1c')](_0x43bffc['include'],function(_0x14448a){return{'model':db[_0x14448a[_0x2f2f('0x1b')]],'as':_0x14448a['as'],'attributes':_0x14448a['attributes']};}):[]};}):[]};}):[]:[]})[_0x2f2f('0x1d')](function(_0xe19fb9){logger[_0x2f2f('0xb')]('GetMailServerIn',_0xdab861);logger['debug'](_0x2f2f('0x1e'),_0xdab861,JSON[_0x2f2f('0x1f')](_0xe19fb9));_0x53a55c(_0xe19fb9);})[_0x2f2f('0x14')](function(_0x378dbe){logger[_0x2f2f('0x10')](_0x2f2f('0x1e'),_0x378dbe[_0x2f2f('0x12')],_0xdab861);_0x5034f0(_0xd6b51b['error'](0x1f4,_0x378dbe[_0x2f2f('0x12')]));});});};
\ No newline at end of file
+var _0x1a66=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','then','MailServerIn,\x20%s,\x20%s','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetMailServerIn','MailServerIn','findAll','options','where','attributes','limit','include','map','model','catch','lodash','util','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1a66,0x102));var _0x61a6=function(_0x6ca870,_0x3e8567){_0x6ca870=_0x6ca870-0x0;var _0x2b328c=_0x1a66[_0x6ca870];return _0x2b328c;};'use strict';var _=require(_0x61a6('0x0'));var util=require(_0x61a6('0x1'));var moment=require(_0x61a6('0x2'));var BPromise=require(_0x61a6('0x3'));var rs=require(_0x61a6('0x4'));var fs=require('fs');var Redis=require(_0x61a6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x61a6('0x6'))(_0x61a6('0x7'));var config=require(_0x61a6('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b5da7,_0x357097,_0x8a2c87){return new BPromise(function(_0x50a8d8,_0x2058ce){return client['request'](_0x4b5da7,_0x8a2c87)[_0x61a6('0x9')](function(_0x7363c4){logger['info'](_0x61a6('0xa'),_0x357097,'request\x20sent');logger['debug'](_0x61a6('0xb'),_0x357097,_0x61a6('0xc'),JSON[_0x61a6('0xd')](_0x7363c4));if(_0x7363c4[_0x61a6('0xe')]){if(_0x7363c4['error'][_0x61a6('0xf')]===0x1f4){logger[_0x61a6('0xe')]('MailServerIn,\x20%s,\x20%s',_0x357097,_0x7363c4[_0x61a6('0xe')]['message']);return _0x2058ce(_0x7363c4[_0x61a6('0xe')]['message']);}logger['error'](_0x61a6('0xa'),_0x357097,_0x7363c4[_0x61a6('0xe')][_0x61a6('0x10')]);return _0x50a8d8(_0x7363c4[_0x61a6('0xe')][_0x61a6('0x10')]);}else{logger[_0x61a6('0x11')](_0x61a6('0xa'),_0x357097,_0x61a6('0xc'));_0x50a8d8(_0x7363c4['result'][_0x61a6('0x10')]);}})['catch'](function(_0xd232d8){logger[_0x61a6('0xe')](_0x61a6('0xa'),_0x357097,_0xd232d8);_0x2058ce(_0xd232d8);});});}exports[_0x61a6('0x12')]=function(_0x365bb2){var _0x2a66e7=this;return new Promise(function(_0x493dd6,_0x230a36){return db[_0x61a6('0x13')][_0x61a6('0x14')]({'raw':_0x365bb2['options']?_0x365bb2[_0x61a6('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x365bb2[_0x61a6('0x15')]?_0x365bb2[_0x61a6('0x15')][_0x61a6('0x16')]||null:null,'attributes':_0x365bb2[_0x61a6('0x15')]?_0x365bb2['options'][_0x61a6('0x17')]||null:null,'limit':_0x365bb2[_0x61a6('0x15')]?_0x365bb2['options'][_0x61a6('0x18')]||null:null,'include':_0x365bb2['options']?_0x365bb2['options'][_0x61a6('0x19')]?_[_0x61a6('0x1a')](_0x365bb2[_0x61a6('0x15')]['include'],function(_0x514a73){return{'model':db[_0x514a73[_0x61a6('0x1b')]],'as':_0x514a73['as'],'attributes':_0x514a73['attributes'],'include':_0x514a73[_0x61a6('0x19')]?_[_0x61a6('0x1a')](_0x514a73[_0x61a6('0x19')],function(_0x17269b){return{'model':db[_0x17269b['model']],'as':_0x17269b['as'],'attributes':_0x17269b['attributes'],'include':_0x17269b[_0x61a6('0x19')]?_[_0x61a6('0x1a')](_0x17269b[_0x61a6('0x19')],function(_0x1fed6b){return{'model':db[_0x1fed6b[_0x61a6('0x1b')]],'as':_0x1fed6b['as'],'attributes':_0x1fed6b[_0x61a6('0x17')]};}):[]};}):[]};}):[]:[]})[_0x61a6('0x9')](function(_0x1ba337){logger[_0x61a6('0x11')](_0x61a6('0x12'),_0x365bb2);logger['debug'](_0x61a6('0x12'),_0x365bb2,JSON[_0x61a6('0xd')](_0x1ba337));_0x493dd6(_0x1ba337);})[_0x61a6('0x1c')](function(_0x51063c){logger[_0x61a6('0xe')](_0x61a6('0x12'),_0x51063c[_0x61a6('0x10')],_0x365bb2);_0x230a36(_0x2a66e7[_0x61a6('0xe')](0x1f4,_0x51063c[_0x61a6('0x10')]));});});};
\ No newline at end of file
index 5ad3545..d581e2b 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(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
+var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
index e8909c4..f6e0fb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad0d=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x589d0c,_0xaeea04){var _0x1a73c2=function(_0x10da0a){while(--_0x10da0a){_0x589d0c['push'](_0x589d0c['shift']());}};_0x1a73c2(++_0xaeea04);}(_0xad0d,0x77));var _0xdad0=function(_0x17628a,_0x1b4b71){_0x17628a=_0x17628a-0x0;var _0x12c2a0=_0xad0d[_0x17628a];return _0x12c2a0;};'use strict';var Sequelize=require(_0xdad0('0x0'));module[_0xdad0('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xdad0('0x2')]},'user':{'type':Sequelize[_0xdad0('0x2')]},'pass':{'type':Sequelize[_0xdad0('0x2')]},'port':{'type':Sequelize[_0xdad0('0x3')]},'secure':{'type':Sequelize[_0xdad0('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xdad0('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xbd3a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x2d6fbd,_0x5daa95){var _0x3ecfd8=function(_0x28bf53){while(--_0x28bf53){_0x2d6fbd['push'](_0x2d6fbd['shift']());}};_0x3ecfd8(++_0x5daa95);}(_0xbd3a,0x103));var _0xabd3=function(_0x23fff9,_0xb2c5f3){_0x23fff9=_0x23fff9-0x0;var _0x1940d0=_0xbd3a[_0x23fff9];return _0x1940d0;};'use strict';var Sequelize=require(_0xabd3('0x0'));module[_0xabd3('0x1')]={'description':{'type':Sequelize[_0xabd3('0x2')]},'host':{'type':Sequelize[_0xabd3('0x2')]},'user':{'type':Sequelize[_0xabd3('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xabd3('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xabd3('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 4a2829d..f474ea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe38d=['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','count','set','Content-Range','apply','reject','then','destroy','stack','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','create','update','body','params','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash'];(function(_0xab4a7c,_0x28b640){var _0x4b0bd2=function(_0x254009){while(--_0x254009){_0xab4a7c['push'](_0xab4a7c['shift']());}};_0x4b0bd2(++_0x28b640);}(_0xe38d,0x119));var _0xde38=function(_0x191731,_0x1615ef){_0x191731=_0x191731-0x0;var _0x1b098d=_0xe38d[_0x191731];return _0x1b098d;};'use strict';var emlformat=require(_0xde38('0x0'));var rimraf=require(_0xde38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde38('0x2'));var rp=require(_0xde38('0x3'));var moment=require(_0xde38('0x4'));var BPromise=require(_0xde38('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xde38('0x6'));var sox=require(_0xde38('0x7'));var csv=require('to-csv');var ejs=require(_0xde38('0x8'));var fs=require('fs');var fs_extra=require(_0xde38('0x9'));var _=require(_0xde38('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xde38('0xb'));var deskjs=require(_0xde38('0xc'));var toCsv=require('to-csv');var querystring=require(_0xde38('0xd'));var Papa=require('papaparse');var Redis=require(_0xde38('0xe'));var authService=require(_0xde38('0xf'));var qs=require(_0xde38('0x10'));var as=require(_0xde38('0x11'));var hardwareService=require(_0xde38('0x12'));var logger=require(_0xde38('0x13'))(_0xde38('0x14'));var utils=require(_0xde38('0x15'));var config=require(_0xde38('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a3a37,_0x3a3161){_0x3a3161=_0x3a3161||0xcc;return function(_0x1b74b3){if(_0x1b74b3){return _0x1a3a37[_0xde38('0x17')](_0x3a3161);}return _0x1a3a37[_0xde38('0x18')](_0x3a3161)[_0xde38('0x19')]();};}function respondWithResult(_0x26bfb3,_0x8f040e){_0x8f040e=_0x8f040e||0xc8;return function(_0x480cc7){if(_0x480cc7){return _0x26bfb3['status'](_0x8f040e)[_0xde38('0x1a')](_0x480cc7);}};}function respondWithFilteredResult(_0x528c06,_0x57b30b){return function(_0x36082d){if(_0x36082d){var _0x2fcf06=typeof _0x57b30b[_0xde38('0x1b')]===_0xde38('0x1c')&&typeof _0x57b30b[_0xde38('0x1d')]===_0xde38('0x1c');var _0x246f5e=_0x36082d[_0xde38('0x1e')];var _0x1e01a4=_0x2fcf06?0x0:_0x57b30b[_0xde38('0x1b')];var _0xe8d984=_0x2fcf06?_0x36082d[_0xde38('0x1e')]:_0x57b30b[_0xde38('0x1b')]+_0x57b30b[_0xde38('0x1d')];var _0xd048df;if(_0xe8d984>=_0x246f5e){_0xe8d984=_0x246f5e;_0xd048df=0xc8;}else{_0xd048df=0xce;}_0x528c06['status'](_0xd048df);return _0x528c06[_0xde38('0x1f')](_0xde38('0x20'),_0x1e01a4+'-'+_0xe8d984+'/'+_0x246f5e)['json'](_0x36082d);}return null;};}function patchUpdates(_0x1efa8d){return function(_0x1ee44a){try{jsonpatch[_0xde38('0x21')](_0x1ee44a,_0x1efa8d,!![]);}catch(_0x1105ee){return BPromise[_0xde38('0x22')](_0x1105ee);}return _0x1ee44a['save']();};}function saveUpdates(_0x70132,_0x555f6c){return function(_0x309878){if(_0x309878){return _0x309878['update'](_0x70132)[_0xde38('0x23')](function(_0x4b91eb){return _0x4b91eb;});}return null;};}function removeEntity(_0x5bcfdd,_0x2c7ecc){return function(_0x4ea4f0){if(_0x4ea4f0){return _0x4ea4f0[_0xde38('0x24')]()[_0xde38('0x23')](function(){_0x5bcfdd[_0xde38('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38198f,_0xb811b0){return function(_0x493d62){if(!_0x493d62){_0x38198f[_0xde38('0x17')](0x194);}return _0x493d62;};}function handleError(_0x5d82d1,_0xfea01d){_0xfea01d=_0xfea01d||0x1f4;return function(_0x23e938){logger['error'](_0x23e938[_0xde38('0x25')]);if(_0x23e938[_0xde38('0x26')]){delete _0x23e938[_0xde38('0x26')];}_0x5d82d1[_0xde38('0x18')](_0xfea01d)['send'](_0x23e938);};}exports[_0xde38('0x27')]=function(_0x5e2363,_0x4b9475){var _0x57ac92={},_0x4bd153={},_0x2df1a3={'count':0x0,'rows':[]};var _0x451c15=_[_0xde38('0x28')](db[_0xde38('0x29')][_0xde38('0x2a')],function(_0x4a6da9){return{'name':_0x4a6da9[_0xde38('0x2b')],'type':_0x4a6da9[_0xde38('0x2c')][_0xde38('0x2d')]};});_0x4bd153[_0xde38('0x2e')]=_[_0xde38('0x28')](_0x451c15,_0xde38('0x26'));_0x4bd153[_0xde38('0x2f')]=_[_0xde38('0x30')](_0x5e2363[_0xde38('0x2f')]);_0x4bd153['filters']=_[_0xde38('0x31')](_0x4bd153[_0xde38('0x2e')],_0x4bd153[_0xde38('0x2f')]);_0x57ac92[_0xde38('0x32')]=_[_0xde38('0x31')](_0x4bd153['model'],qs[_0xde38('0x33')](_0x5e2363[_0xde38('0x2f')][_0xde38('0x33')]));_0x57ac92[_0xde38('0x32')]=_0x57ac92['attributes'][_0xde38('0x34')]?_0x57ac92[_0xde38('0x32')]:_0x4bd153[_0xde38('0x2e')];if(!_0x5e2363['query'][_0xde38('0x35')](_0xde38('0x36'))){_0x57ac92[_0xde38('0x1d')]=qs[_0xde38('0x1d')](_0x5e2363[_0xde38('0x2f')][_0xde38('0x1d')]);_0x57ac92['offset']=qs[_0xde38('0x1b')](_0x5e2363[_0xde38('0x2f')][_0xde38('0x1b')]);}_0x57ac92[_0xde38('0x37')]=qs[_0xde38('0x38')](_0x5e2363[_0xde38('0x2f')]['sort']);_0x57ac92[_0xde38('0x39')]=qs[_0xde38('0x3a')](_[_0xde38('0x3b')](_0x5e2363['query'],_0x4bd153[_0xde38('0x3a')]),_0x451c15);if(_0x5e2363['query'][_0xde38('0x3c')]){_0x57ac92[_0xde38('0x39')]=_[_0xde38('0x3d')](_0x57ac92[_0xde38('0x39')],{'$or':_[_0xde38('0x28')](_0x451c15,function(_0x425d96){if(_0x425d96['type']!==_0xde38('0x3e')){var _0x1ef0a9={};_0x1ef0a9[_0x425d96[_0xde38('0x26')]]={'$like':'%'+_0x5e2363[_0xde38('0x2f')][_0xde38('0x3c')]+'%'};return _0x1ef0a9;}})});}_0x57ac92=_[_0xde38('0x3d')]({},_0x57ac92,_0x5e2363[_0xde38('0x3f')]);var _0x25e29c={'where':_0x57ac92[_0xde38('0x39')]};return db[_0xde38('0x29')][_0xde38('0x1e')](_0x25e29c)['then'](function(_0x224596){_0x2df1a3['count']=_0x224596;if(_0x5e2363[_0xde38('0x2f')][_0xde38('0x40')]){_0x57ac92[_0xde38('0x41')]=[{'all':!![]}];}return db['MailServerOut'][_0xde38('0x42')](_0x57ac92);})['then'](function(_0x569f1e){_0x2df1a3['rows']=_0x569f1e;return _0x2df1a3;})[_0xde38('0x23')](respondWithFilteredResult(_0x4b9475,_0x57ac92))[_0xde38('0x43')](handleError(_0x4b9475,null));};exports['show']=function(_0x1ad531,_0x65ef93){var _0x2bee12={'raw':!![],'where':{'id':_0x1ad531['params']['id']}},_0x38efb6={};_0x38efb6[_0xde38('0x2e')]=_[_0xde38('0x30')](db['MailServerOut']['rawAttributes']);_0x38efb6['query']=_[_0xde38('0x30')](_0x1ad531[_0xde38('0x2f')]);_0x38efb6['filters']=_[_0xde38('0x31')](_0x38efb6['model'],_0x38efb6[_0xde38('0x2f')]);_0x2bee12[_0xde38('0x32')]=_[_0xde38('0x31')](_0x38efb6['model'],qs['fields'](_0x1ad531[_0xde38('0x2f')][_0xde38('0x33')]));_0x2bee12[_0xde38('0x32')]=_0x2bee12[_0xde38('0x32')][_0xde38('0x34')]?_0x2bee12[_0xde38('0x32')]:_0x38efb6[_0xde38('0x2e')];if(_0x1ad531[_0xde38('0x2f')][_0xde38('0x40')]){_0x2bee12['include']=[{'all':!![]}];}_0x2bee12=_[_0xde38('0x3d')]({},_0x2bee12,_0x1ad531[_0xde38('0x3f')]);return db[_0xde38('0x29')]['find'](_0x2bee12)['then'](handleEntityNotFound(_0x65ef93,null))[_0xde38('0x23')](respondWithResult(_0x65ef93,null))[_0xde38('0x43')](handleError(_0x65ef93,null));};exports[_0xde38('0x44')]=function(_0x7126df,_0x281d0a){return db[_0xde38('0x29')][_0xde38('0x44')](_0x7126df['body'],{})[_0xde38('0x23')](respondWithResult(_0x281d0a,0xc9))[_0xde38('0x43')](handleError(_0x281d0a,null));};exports[_0xde38('0x45')]=function(_0x1fabf6,_0xb2e660){if(_0x1fabf6[_0xde38('0x46')]['id']){delete _0x1fabf6[_0xde38('0x46')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x1fabf6[_0xde38('0x47')]['id']}})[_0xde38('0x23')](handleEntityNotFound(_0xb2e660,null))['then'](saveUpdates(_0x1fabf6['body'],null))[_0xde38('0x23')](respondWithResult(_0xb2e660,null))[_0xde38('0x43')](handleError(_0xb2e660,null));};exports[_0xde38('0x24')]=function(_0x415f1c,_0x239f8a){return db[_0xde38('0x29')][_0xde38('0x48')]({'where':{'id':_0x415f1c['params']['id']}})[_0xde38('0x23')](handleEntityNotFound(_0x239f8a,null))['then'](removeEntity(_0x239f8a,null))[_0xde38('0x43')](handleError(_0x239f8a,null));};
\ No newline at end of file
+var _0x40e0=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','then','destroy','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x40e0,0x160));var _0x040e=function(_0x5318ac,_0x296579){_0x5318ac=_0x5318ac-0x0;var _0x568be8=_0x40e0[_0x5318ac];return _0x568be8;};'use strict';var emlformat=require(_0x040e('0x0'));var rimraf=require(_0x040e('0x1'));var zipdir=require(_0x040e('0x2'));var jsonpatch=require(_0x040e('0x3'));var rp=require(_0x040e('0x4'));var moment=require(_0x040e('0x5'));var BPromise=require(_0x040e('0x6'));var Mustache=require('mustache');var util=require(_0x040e('0x7'));var path=require(_0x040e('0x8'));var sox=require('sox');var csv=require(_0x040e('0x9'));var ejs=require(_0x040e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x040e('0xb'));var crypto=require(_0x040e('0xc'));var jsforce=require(_0x040e('0xd'));var deskjs=require(_0x040e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x040e('0xf'));var Papa=require(_0x040e('0x10'));var Redis=require('ioredis');var authService=require(_0x040e('0x11'));var qs=require(_0x040e('0x12'));var as=require(_0x040e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x040e('0x14'));var utils=require(_0x040e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x040e('0x16'));var db=require(_0x040e('0x17'))['db'];function respondWithStatusCode(_0x55371b,_0x384f2b){_0x384f2b=_0x384f2b||0xcc;return function(_0x47b87d){if(_0x47b87d){return _0x55371b[_0x040e('0x18')](_0x384f2b);}return _0x55371b[_0x040e('0x19')](_0x384f2b)[_0x040e('0x1a')]();};}function respondWithResult(_0x33532c,_0x253ff6){_0x253ff6=_0x253ff6||0xc8;return function(_0x4e7435){if(_0x4e7435){return _0x33532c[_0x040e('0x19')](_0x253ff6)[_0x040e('0x1b')](_0x4e7435);}};}function respondWithFilteredResult(_0x7c7ea1,_0x50bb08){return function(_0x30ed44){if(_0x30ed44){var _0x17093e=typeof _0x50bb08[_0x040e('0x1c')]==='undefined'&&typeof _0x50bb08[_0x040e('0x1d')]==='undefined';var _0x168323=_0x30ed44[_0x040e('0x1e')];var _0x5b2784=_0x17093e?0x0:_0x50bb08[_0x040e('0x1c')];var _0x399999=_0x17093e?_0x30ed44[_0x040e('0x1e')]:_0x50bb08[_0x040e('0x1c')]+_0x50bb08[_0x040e('0x1d')];var _0x3a28aa;if(_0x399999>=_0x168323){_0x399999=_0x168323;_0x3a28aa=0xc8;}else{_0x3a28aa=0xce;}_0x7c7ea1[_0x040e('0x19')](_0x3a28aa);return _0x7c7ea1[_0x040e('0x1f')]('Content-Range',_0x5b2784+'-'+_0x399999+'/'+_0x168323)[_0x040e('0x1b')](_0x30ed44);}return null;};}function patchUpdates(_0xdd7888){return function(_0x328b3f){try{jsonpatch[_0x040e('0x20')](_0x328b3f,_0xdd7888,!![]);}catch(_0x2708e3){return BPromise[_0x040e('0x21')](_0x2708e3);}return _0x328b3f['save']();};}function saveUpdates(_0x23d040,_0x14b1b2){return function(_0x41f432){if(_0x41f432){return _0x41f432['update'](_0x23d040)[_0x040e('0x22')](function(_0x23d4b1){return _0x23d4b1;});}return null;};}function removeEntity(_0x51e9d2,_0x44c261){return function(_0x436471){if(_0x436471){return _0x436471[_0x040e('0x23')]()[_0x040e('0x22')](function(){_0x51e9d2[_0x040e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x551713,_0x42db8b){return function(_0x5417ca){if(!_0x5417ca){_0x551713[_0x040e('0x18')](0x194);}return _0x5417ca;};}function handleError(_0x5d7e6f,_0x51f536){_0x51f536=_0x51f536||0x1f4;return function(_0x426514){logger[_0x040e('0x24')](_0x426514[_0x040e('0x25')]);if(_0x426514[_0x040e('0x26')]){delete _0x426514[_0x040e('0x26')];}_0x5d7e6f[_0x040e('0x19')](_0x51f536)[_0x040e('0x27')](_0x426514);};}exports[_0x040e('0x28')]=function(_0x535827,_0x220063){var _0x124e40={},_0x39d3b8={},_0x5f5dfd={'count':0x0,'rows':[]};var _0x2ae56d=_[_0x040e('0x29')](db[_0x040e('0x2a')][_0x040e('0x2b')],function(_0x5a4802){return{'name':_0x5a4802[_0x040e('0x2c')],'type':_0x5a4802[_0x040e('0x2d')]['key']};});_0x39d3b8[_0x040e('0x2e')]=_[_0x040e('0x29')](_0x2ae56d,_0x040e('0x26'));_0x39d3b8[_0x040e('0x2f')]=_[_0x040e('0x30')](_0x535827[_0x040e('0x2f')]);_0x39d3b8[_0x040e('0x31')]=_[_0x040e('0x32')](_0x39d3b8[_0x040e('0x2e')],_0x39d3b8[_0x040e('0x2f')]);_0x124e40[_0x040e('0x33')]=_[_0x040e('0x32')](_0x39d3b8[_0x040e('0x2e')],qs[_0x040e('0x34')](_0x535827['query'][_0x040e('0x34')]));_0x124e40[_0x040e('0x33')]=_0x124e40[_0x040e('0x33')][_0x040e('0x35')]?_0x124e40[_0x040e('0x33')]:_0x39d3b8[_0x040e('0x2e')];if(!_0x535827[_0x040e('0x2f')][_0x040e('0x36')](_0x040e('0x37'))){_0x124e40[_0x040e('0x1d')]=qs[_0x040e('0x1d')](_0x535827['query'][_0x040e('0x1d')]);_0x124e40[_0x040e('0x1c')]=qs['offset'](_0x535827[_0x040e('0x2f')]['offset']);}_0x124e40[_0x040e('0x38')]=qs[_0x040e('0x39')](_0x535827['query'][_0x040e('0x39')]);_0x124e40[_0x040e('0x3a')]=qs[_0x040e('0x31')](_[_0x040e('0x3b')](_0x535827['query'],_0x39d3b8[_0x040e('0x31')]),_0x2ae56d);if(_0x535827[_0x040e('0x2f')]['filter']){_0x124e40[_0x040e('0x3a')]=_[_0x040e('0x3c')](_0x124e40[_0x040e('0x3a')],{'$or':_[_0x040e('0x29')](_0x2ae56d,function(_0x1f6051){if(_0x1f6051['type']!==_0x040e('0x3d')){var _0x24c8e8={};_0x24c8e8[_0x1f6051[_0x040e('0x26')]]={'$like':'%'+_0x535827[_0x040e('0x2f')][_0x040e('0x3e')]+'%'};return _0x24c8e8;}})});}_0x124e40=_[_0x040e('0x3c')]({},_0x124e40,_0x535827[_0x040e('0x3f')]);var _0x5cff77={'where':_0x124e40[_0x040e('0x3a')]};return db['MailServerOut']['count'](_0x5cff77)[_0x040e('0x22')](function(_0x29313f){_0x5f5dfd[_0x040e('0x1e')]=_0x29313f;if(_0x535827['query'][_0x040e('0x40')]){_0x124e40['include']=[{'all':!![]}];}return db[_0x040e('0x2a')][_0x040e('0x41')](_0x124e40);})[_0x040e('0x22')](function(_0x329a1f){_0x5f5dfd[_0x040e('0x42')]=_0x329a1f;return _0x5f5dfd;})[_0x040e('0x22')](respondWithFilteredResult(_0x220063,_0x124e40))[_0x040e('0x43')](handleError(_0x220063,null));};exports[_0x040e('0x44')]=function(_0xeb2286,_0x59f824){var _0x58ad21={'raw':!![],'where':{'id':_0xeb2286['params']['id']}},_0x1468c0={};_0x1468c0[_0x040e('0x2e')]=_[_0x040e('0x30')](db[_0x040e('0x2a')][_0x040e('0x2b')]);_0x1468c0['query']=_[_0x040e('0x30')](_0xeb2286[_0x040e('0x2f')]);_0x1468c0[_0x040e('0x31')]=_[_0x040e('0x32')](_0x1468c0[_0x040e('0x2e')],_0x1468c0[_0x040e('0x2f')]);_0x58ad21[_0x040e('0x33')]=_['intersection'](_0x1468c0[_0x040e('0x2e')],qs[_0x040e('0x34')](_0xeb2286[_0x040e('0x2f')][_0x040e('0x34')]));_0x58ad21[_0x040e('0x33')]=_0x58ad21[_0x040e('0x33')][_0x040e('0x35')]?_0x58ad21[_0x040e('0x33')]:_0x1468c0[_0x040e('0x2e')];if(_0xeb2286['query'][_0x040e('0x40')]){_0x58ad21[_0x040e('0x45')]=[{'all':!![]}];}_0x58ad21=_[_0x040e('0x3c')]({},_0x58ad21,_0xeb2286[_0x040e('0x3f')]);return db['MailServerOut'][_0x040e('0x46')](_0x58ad21)['then'](handleEntityNotFound(_0x59f824,null))['then'](respondWithResult(_0x59f824,null))[_0x040e('0x43')](handleError(_0x59f824,null));};exports[_0x040e('0x47')]=function(_0x52e077,_0x53fe73){return db['MailServerOut']['create'](_0x52e077[_0x040e('0x48')],{})[_0x040e('0x22')](respondWithResult(_0x53fe73,0xc9))[_0x040e('0x43')](handleError(_0x53fe73,null));};exports['update']=function(_0x58ca14,_0x4a330b){if(_0x58ca14[_0x040e('0x48')]['id']){delete _0x58ca14[_0x040e('0x48')]['id'];}return db[_0x040e('0x2a')][_0x040e('0x46')]({'where':{'id':_0x58ca14['params']['id']}})[_0x040e('0x22')](handleEntityNotFound(_0x4a330b,null))['then'](saveUpdates(_0x58ca14[_0x040e('0x48')],null))[_0x040e('0x22')](respondWithResult(_0x4a330b,null))[_0x040e('0x43')](handleError(_0x4a330b,null));};exports[_0x040e('0x23')]=function(_0x2930b2,_0x5f0ba5){return db[_0x040e('0x2a')][_0x040e('0x46')]({'where':{'id':_0x2930b2[_0x040e('0x49')]['id']}})[_0x040e('0x22')](handleEntityNotFound(_0x5f0ba5,null))['then'](removeEntity(_0x5f0ba5,null))['catch'](handleError(_0x5f0ba5,null));};
\ No newline at end of file
index 8548f16..55763d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb081=['bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes','define','mail_servers_out','lodash','util','../../config/logger','api','moment'];(function(_0x1118b8,_0x7976bb){var _0x5f0c74=function(_0xaad0bf){while(--_0xaad0bf){_0x1118b8['push'](_0x1118b8['shift']());}};_0x5f0c74(++_0x7976bb);}(_0xb081,0x8b));var _0x1b08=function(_0x11fcba,_0x46ac13){_0x11fcba=_0x11fcba-0x0;var _0x2c792a=_0xb081[_0x11fcba];return _0x2c792a;};'use strict';var _=require(_0x1b08('0x0'));var util=require(_0x1b08('0x1'));var logger=require(_0x1b08('0x2'))(_0x1b08('0x3'));var moment=require(_0x1b08('0x4'));var BPromise=require(_0x1b08('0x5'));var rp=require(_0x1b08('0x6'));var fs=require('fs');var path=require(_0x1b08('0x7'));var rimraf=require('rimraf');var config=require(_0x1b08('0x8'));var attributes=require(_0x1b08('0x9'));module['exports']=function(_0x5b7a3f,_0x32b761){return _0x5b7a3f[_0x1b08('0xa')]('MailServerOut',attributes,{'tableName':_0x1b08('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a76=['exports','define','MailServerOut','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x4a76,0x189));var _0x64a7=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x4a76[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x64a7('0x0'));var util=require('util');var logger=require(_0x64a7('0x1'))(_0x64a7('0x2'));var moment=require(_0x64a7('0x3'));var BPromise=require(_0x64a7('0x4'));var rp=require(_0x64a7('0x5'));var fs=require('fs');var path=require(_0x64a7('0x6'));var rimraf=require(_0x64a7('0x7'));var config=require(_0x64a7('0x8'));var attributes=require(_0x64a7('0x9'));module[_0x64a7('0xa')]=function(_0x3f690c,_0x3ff0be){return _0x3f690c[_0x64a7('0xb')](_0x64a7('0xc'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 083521c..9e7ce43 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','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x301bba,_0x98b972){var _0x42b891=function(_0x1a9638){while(--_0x1a9638){_0x301bba['push'](_0x301bba['shift']());}};_0x42b891(++_0x98b972);}(_0xdb28,0x106));var _0x8db2=function(_0x57eb24,_0x1f4d9b){_0x57eb24=_0x57eb24-0x0;var _0x5dbbaf=_0xdb28[_0x57eb24];return _0x5dbbaf;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+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(_0x2bc4df,_0x397a6f){var _0x4bcc54=function(_0xc72ce8){while(--_0xc72ce8){_0x2bc4df['push'](_0x2bc4df['shift']());}};_0x4bcc54(++_0x397a6f);}(_0xadb5,0xad));var _0x5adb=function(_0x5513a9,_0x560573){_0x5513a9=_0x5513a9-0x0;var _0x421745=_0xadb5[_0x5513a9];return _0x421745;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
index 926a154..26225f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f82=['get','isAuthenticated','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','./mailSubstatus.controller'];(function(_0x14d103,_0x2db6f8){var _0x3f4dfd=function(_0x21586f){while(--_0x21586f){_0x14d103['push'](_0x14d103['shift']());}};_0x3f4dfd(++_0x2db6f8);}(_0x9f82,0x90));var _0x29f8=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x9f82[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x29f8('0x0'));var util=require(_0x29f8('0x1'));var path=require('path');var timeout=require(_0x29f8('0x2'));var express=require(_0x29f8('0x3'));var router=express[_0x29f8('0x4')]();var fs_extra=require(_0x29f8('0x5'));var auth=require(_0x29f8('0x6'));var interaction=require(_0x29f8('0x7'));var config=require(_0x29f8('0x8'));var controller=require(_0x29f8('0x9'));router[_0x29f8('0xa')]('/',auth[_0x29f8('0xb')](),controller[_0x29f8('0xc')]);router[_0x29f8('0xa')]('/describe',auth[_0x29f8('0xb')](),controller[_0x29f8('0xd')]);router[_0x29f8('0xa')](_0x29f8('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x29f8('0xf')]('/',auth[_0x29f8('0xb')](),controller[_0x29f8('0x10')]);router[_0x29f8('0x11')](_0x29f8('0xe'),auth[_0x29f8('0xb')](),controller[_0x29f8('0x12')]);router[_0x29f8('0x13')]('/:id',auth[_0x29f8('0xb')](),controller[_0x29f8('0x14')]);module[_0x29f8('0x15')]=router;
\ No newline at end of file
+var _0xf771=['describe','post','create','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe'];(function(_0x3dc55d,_0xd07e93){var _0x3aa7f3=function(_0x506b46){while(--_0x506b46){_0x3dc55d['push'](_0x3dc55d['shift']());}};_0x3aa7f3(++_0xd07e93);}(_0xf771,0x181));var _0x1f77=function(_0x340499,_0x3610c5){_0x340499=_0x340499-0x0;var _0x5d0745=_0xf771[_0x340499];return _0x5d0745;};'use strict';var multer=require('multer');var util=require(_0x1f77('0x0'));var path=require(_0x1f77('0x1'));var timeout=require(_0x1f77('0x2'));var express=require(_0x1f77('0x3'));var router=express[_0x1f77('0x4')]();var fs_extra=require(_0x1f77('0x5'));var auth=require(_0x1f77('0x6'));var interaction=require(_0x1f77('0x7'));var config=require(_0x1f77('0x8'));var controller=require(_0x1f77('0x9'));router[_0x1f77('0xa')]('/',auth[_0x1f77('0xb')](),controller[_0x1f77('0xc')]);router['get'](_0x1f77('0xd'),auth[_0x1f77('0xb')](),controller[_0x1f77('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1f77('0xf')]('/',auth[_0x1f77('0xb')](),controller[_0x1f77('0x10')]);router['put'](_0x1f77('0x11'),auth[_0x1f77('0xb')](),controller['update']);router['delete'](_0x1f77('0x11'),auth['isAuthenticated'](),controller[_0x1f77('0x12')]);module['exports']=router;
\ No newline at end of file
index 62cb6ac..8eb96a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27a0=['STRING','name','exports'];(function(_0x2d636c,_0x165153){var _0x2d7070=function(_0x18c847){while(--_0x18c847){_0x2d636c['push'](_0x2d636c['shift']());}};_0x2d7070(++_0x165153);}(_0x27a0,0xbf));var _0x027a=function(_0x3383bd,_0x2fc545){_0x3383bd=_0x3383bd-0x0;var _0x31e6a9=_0x27a0[_0x3383bd];return _0x31e6a9;};'use strict';var Sequelize=require('sequelize');module[_0x027a('0x0')]={'name':{'type':Sequelize[_0x027a('0x1')],'unique':_0x027a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x027a('0x1')]}};
\ No newline at end of file
+var _0x1b65=['sequelize','exports','STRING','name'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1b65,0x1b4));var _0x51b6=function(_0x1bded9,_0x34c1d0){_0x1bded9=_0x1bded9-0x0;var _0x76ab36=_0x1b65[_0x1bded9];return _0x76ab36;};'use strict';var Sequelize=require(_0x51b6('0x0'));module[_0x51b6('0x1')]={'name':{'type':Sequelize[_0x51b6('0x2')],'unique':_0x51b6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 007035d..8ef462d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa11=['stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','MailSubstatus','rows','catch','show','params','includeAll','include','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','offset','count','set','apply','reject','save','then','error'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xaa11,0x110));var _0x1aa1=function(_0x54eab6,_0x5e262f){_0x54eab6=_0x54eab6-0x0;var _0x1e7435=_0xaa11[_0x54eab6];return _0x1e7435;};'use strict';var emlformat=require(_0x1aa1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1aa1('0x1'));var jsonpatch=require(_0x1aa1('0x2'));var rp=require(_0x1aa1('0x3'));var moment=require(_0x1aa1('0x4'));var BPromise=require(_0x1aa1('0x5'));var Mustache=require(_0x1aa1('0x6'));var util=require(_0x1aa1('0x7'));var path=require(_0x1aa1('0x8'));var sox=require(_0x1aa1('0x9'));var csv=require(_0x1aa1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1aa1('0xb'));var _=require(_0x1aa1('0xc'));var squel=require(_0x1aa1('0xd'));var crypto=require(_0x1aa1('0xe'));var jsforce=require(_0x1aa1('0xf'));var deskjs=require(_0x1aa1('0x10'));var toCsv=require(_0x1aa1('0xa'));var querystring=require(_0x1aa1('0x11'));var Papa=require(_0x1aa1('0x12'));var Redis=require(_0x1aa1('0x13'));var authService=require(_0x1aa1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1aa1('0x15'));var hardwareService=require(_0x1aa1('0x16'));var logger=require(_0x1aa1('0x17'))(_0x1aa1('0x18'));var utils=require(_0x1aa1('0x19'));var config=require(_0x1aa1('0x1a'));var licenseUtil=require(_0x1aa1('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10b62b,_0x4069fb){_0x4069fb=_0x4069fb||0xcc;return function(_0x4bbd4d){if(_0x4bbd4d){return _0x10b62b['sendStatus'](_0x4069fb);}return _0x10b62b['status'](_0x4069fb)['end']();};}function respondWithResult(_0x8df802,_0x917d2e){_0x917d2e=_0x917d2e||0xc8;return function(_0x28e674){if(_0x28e674){return _0x8df802[_0x1aa1('0x1c')](_0x917d2e)[_0x1aa1('0x1d')](_0x28e674);}};}function respondWithFilteredResult(_0x352623,_0x79c295){return function(_0x54b068){if(_0x54b068){var _0x16ddd9=typeof _0x79c295['offset']===_0x1aa1('0x1e')&&typeof _0x79c295[_0x1aa1('0x1f')]===_0x1aa1('0x1e');var _0x4aeba2=_0x54b068['count'];var _0x164ac8=_0x16ddd9?0x0:_0x79c295[_0x1aa1('0x20')];var _0xf9fc1f=_0x16ddd9?_0x54b068[_0x1aa1('0x21')]:_0x79c295['offset']+_0x79c295['limit'];var _0x202b7b;if(_0xf9fc1f>=_0x4aeba2){_0xf9fc1f=_0x4aeba2;_0x202b7b=0xc8;}else{_0x202b7b=0xce;}_0x352623[_0x1aa1('0x1c')](_0x202b7b);return _0x352623[_0x1aa1('0x22')]('Content-Range',_0x164ac8+'-'+_0xf9fc1f+'/'+_0x4aeba2)['json'](_0x54b068);}return null;};}function patchUpdates(_0x12f365){return function(_0x57ccc6){try{jsonpatch[_0x1aa1('0x23')](_0x57ccc6,_0x12f365,!![]);}catch(_0x2ba513){return BPromise[_0x1aa1('0x24')](_0x2ba513);}return _0x57ccc6[_0x1aa1('0x25')]();};}function saveUpdates(_0x3d0a5d,_0x285940){return function(_0x121023){if(_0x121023){return _0x121023['update'](_0x3d0a5d)[_0x1aa1('0x26')](function(_0x1569d3){return _0x1569d3;});}return null;};}function removeEntity(_0x1a8091,_0x3df041){return function(_0x37430a){if(_0x37430a){return _0x37430a['destroy']()['then'](function(){_0x1a8091[_0x1aa1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11e815,_0x4bf27a){return function(_0x4a9819){if(!_0x4a9819){_0x11e815['sendStatus'](0x194);}return _0x4a9819;};}function handleError(_0x7a99e1,_0x409464){_0x409464=_0x409464||0x1f4;return function(_0x2452a0){logger[_0x1aa1('0x27')](_0x2452a0[_0x1aa1('0x28')]);if(_0x2452a0[_0x1aa1('0x29')]){delete _0x2452a0['name'];}_0x7a99e1['status'](_0x409464)['send'](_0x2452a0);};}exports[_0x1aa1('0x2a')]=function(_0x482317,_0x3f2353){var _0x13aaf5={},_0x490b10={},_0x100067={'count':0x0,'rows':[]};var _0x321629=_[_0x1aa1('0x2b')](db['MailSubstatus'][_0x1aa1('0x2c')],function(_0x284b28){return{'name':_0x284b28[_0x1aa1('0x2d')],'type':_0x284b28[_0x1aa1('0x2e')][_0x1aa1('0x2f')]};});_0x490b10[_0x1aa1('0x30')]=_[_0x1aa1('0x2b')](_0x321629,_0x1aa1('0x29'));_0x490b10['query']=_[_0x1aa1('0x31')](_0x482317[_0x1aa1('0x32')]);_0x490b10['filters']=_[_0x1aa1('0x33')](_0x490b10[_0x1aa1('0x30')],_0x490b10[_0x1aa1('0x32')]);_0x13aaf5[_0x1aa1('0x34')]=_[_0x1aa1('0x33')](_0x490b10['model'],qs[_0x1aa1('0x35')](_0x482317[_0x1aa1('0x32')][_0x1aa1('0x35')]));_0x13aaf5[_0x1aa1('0x34')]=_0x13aaf5[_0x1aa1('0x34')][_0x1aa1('0x36')]?_0x13aaf5['attributes']:_0x490b10[_0x1aa1('0x30')];if(!_0x482317[_0x1aa1('0x32')][_0x1aa1('0x37')](_0x1aa1('0x38'))){_0x13aaf5[_0x1aa1('0x1f')]=qs[_0x1aa1('0x1f')](_0x482317['query'][_0x1aa1('0x1f')]);_0x13aaf5['offset']=qs[_0x1aa1('0x20')](_0x482317['query']['offset']);}_0x13aaf5[_0x1aa1('0x39')]=qs[_0x1aa1('0x3a')](_0x482317['query'][_0x1aa1('0x3a')]);_0x13aaf5[_0x1aa1('0x3b')]=qs['filters'](_[_0x1aa1('0x3c')](_0x482317[_0x1aa1('0x32')],_0x490b10[_0x1aa1('0x3d')]),_0x321629);if(_0x482317[_0x1aa1('0x32')][_0x1aa1('0x3e')]){_0x13aaf5['where']=_[_0x1aa1('0x3f')](_0x13aaf5['where'],{'$or':_[_0x1aa1('0x2b')](_0x321629,function(_0x70e3aa){if(_0x70e3aa[_0x1aa1('0x2e')]!==_0x1aa1('0x40')){var _0x201aca={};_0x201aca[_0x70e3aa['name']]={'$like':'%'+_0x482317['query'][_0x1aa1('0x3e')]+'%'};return _0x201aca;}})});}_0x13aaf5=_[_0x1aa1('0x3f')]({},_0x13aaf5,_0x482317[_0x1aa1('0x41')]);var _0x37fef3={'where':_0x13aaf5[_0x1aa1('0x3b')]};return db[_0x1aa1('0x42')][_0x1aa1('0x21')](_0x37fef3)['then'](function(_0x545fd2){_0x100067[_0x1aa1('0x21')]=_0x545fd2;if(_0x482317['query']['includeAll']){_0x13aaf5['include']=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x13aaf5);})['then'](function(_0x427727){_0x100067[_0x1aa1('0x43')]=_0x427727;return _0x100067;})[_0x1aa1('0x26')](respondWithFilteredResult(_0x3f2353,_0x13aaf5))[_0x1aa1('0x44')](handleError(_0x3f2353,null));};exports[_0x1aa1('0x45')]=function(_0x3f58f4,_0x2579ed){var _0x5a3e60={'raw':!![],'where':{'id':_0x3f58f4[_0x1aa1('0x46')]['id']}},_0x4c2c5c={};_0x4c2c5c['model']=_[_0x1aa1('0x31')](db['MailSubstatus'][_0x1aa1('0x2c')]);_0x4c2c5c[_0x1aa1('0x32')]=_['keys'](_0x3f58f4['query']);_0x4c2c5c['filters']=_['intersection'](_0x4c2c5c[_0x1aa1('0x30')],_0x4c2c5c[_0x1aa1('0x32')]);_0x5a3e60[_0x1aa1('0x34')]=_[_0x1aa1('0x33')](_0x4c2c5c['model'],qs[_0x1aa1('0x35')](_0x3f58f4[_0x1aa1('0x32')][_0x1aa1('0x35')]));_0x5a3e60[_0x1aa1('0x34')]=_0x5a3e60[_0x1aa1('0x34')][_0x1aa1('0x36')]?_0x5a3e60['attributes']:_0x4c2c5c[_0x1aa1('0x30')];if(_0x3f58f4[_0x1aa1('0x32')][_0x1aa1('0x47')]){_0x5a3e60[_0x1aa1('0x48')]=[{'all':!![]}];}_0x5a3e60=_[_0x1aa1('0x3f')]({},_0x5a3e60,_0x3f58f4[_0x1aa1('0x41')]);return db[_0x1aa1('0x42')][_0x1aa1('0x49')](_0x5a3e60)['then'](handleEntityNotFound(_0x2579ed,null))[_0x1aa1('0x26')](respondWithResult(_0x2579ed,null))[_0x1aa1('0x44')](handleError(_0x2579ed,null));};exports[_0x1aa1('0x4a')]=function(_0x14389f,_0x5436ba){return db['MailSubstatus']['create'](_0x14389f[_0x1aa1('0x4b')],{})['then'](respondWithResult(_0x5436ba,0xc9))['catch'](handleError(_0x5436ba,null));};exports[_0x1aa1('0x4c')]=function(_0x511df5,_0x55d11c){if(_0x511df5[_0x1aa1('0x4b')]['id']){delete _0x511df5['body']['id'];}return db[_0x1aa1('0x42')][_0x1aa1('0x49')]({'where':{'id':_0x511df5[_0x1aa1('0x46')]['id']}})[_0x1aa1('0x26')](handleEntityNotFound(_0x55d11c,null))[_0x1aa1('0x26')](saveUpdates(_0x511df5[_0x1aa1('0x4b')],null))[_0x1aa1('0x26')](respondWithResult(_0x55d11c,null))[_0x1aa1('0x44')](handleError(_0x55d11c,null));};exports['destroy']=function(_0x38e4d2,_0x340000){return db[_0x1aa1('0x42')][_0x1aa1('0x49')]({'where':{'id':_0x38e4d2['params']['id']}})['then'](handleEntityNotFound(_0x340000,null))['then'](removeEntity(_0x340000,null))[_0x1aa1('0x44')](handleError(_0x340000,null));};exports[_0x1aa1('0x4d')]=function(_0x2a25b8,_0x58b549){return db['MailSubstatus'][_0x1aa1('0x4d')]()[_0x1aa1('0x26')](respondWithResult(_0x58b549,null))['catch'](handleError(_0x58b549,null));};
\ No newline at end of file
+var _0x95ca=['sox','to-csv','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','json','offset','limit','set','Content-Range','reject','destroy','end','stack','name','index','MailSubstatus','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','then','include','findAll','params','includeAll','find','create','body','catch','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x168057,_0x18fae0){var _0x470c2f=function(_0x540df1){while(--_0x540df1){_0x168057['push'](_0x168057['shift']());}};_0x470c2f(++_0x18fae0);}(_0x95ca,0x8c));var _0xa95c=function(_0x3942f2,_0x59d821){_0x3942f2=_0x3942f2-0x0;var _0x4ab245=_0x95ca[_0x3942f2];return _0x4ab245;};'use strict';var emlformat=require(_0xa95c('0x0'));var rimraf=require(_0xa95c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa95c('0x2'));var rp=require(_0xa95c('0x3'));var moment=require(_0xa95c('0x4'));var BPromise=require(_0xa95c('0x5'));var Mustache=require('mustache');var util=require(_0xa95c('0x6'));var path=require(_0xa95c('0x7'));var sox=require(_0xa95c('0x8'));var csv=require(_0xa95c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa95c('0xa'));var squel=require(_0xa95c('0xb'));var crypto=require('crypto');var jsforce=require(_0xa95c('0xc'));var deskjs=require(_0xa95c('0xd'));var toCsv=require(_0xa95c('0x9'));var querystring=require('querystring');var Papa=require(_0xa95c('0xe'));var Redis=require(_0xa95c('0xf'));var authService=require(_0xa95c('0x10'));var qs=require(_0xa95c('0x11'));var as=require(_0xa95c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa95c('0x13'))(_0xa95c('0x14'));var utils=require(_0xa95c('0x15'));var config=require(_0xa95c('0x16'));var licenseUtil=require(_0xa95c('0x17'));var db=require(_0xa95c('0x18'))['db'];function respondWithStatusCode(_0x275ab7,_0x533500){_0x533500=_0x533500||0xcc;return function(_0x475a6a){if(_0x475a6a){return _0x275ab7[_0xa95c('0x19')](_0x533500);}return _0x275ab7[_0xa95c('0x1a')](_0x533500)['end']();};}function respondWithResult(_0x811e76,_0x57863e){_0x57863e=_0x57863e||0xc8;return function(_0x13f2b4){if(_0x13f2b4){return _0x811e76['status'](_0x57863e)[_0xa95c('0x1b')](_0x13f2b4);}};}function respondWithFilteredResult(_0x1a2703,_0x16ba74){return function(_0x2bdda2){if(_0x2bdda2){var _0x4c7cec=typeof _0x16ba74[_0xa95c('0x1c')]==='undefined'&&typeof _0x16ba74[_0xa95c('0x1d')]==='undefined';var _0x4c8cc4=_0x2bdda2['count'];var _0x5418c0=_0x4c7cec?0x0:_0x16ba74[_0xa95c('0x1c')];var _0x535878=_0x4c7cec?_0x2bdda2['count']:_0x16ba74[_0xa95c('0x1c')]+_0x16ba74[_0xa95c('0x1d')];var _0x40fed4;if(_0x535878>=_0x4c8cc4){_0x535878=_0x4c8cc4;_0x40fed4=0xc8;}else{_0x40fed4=0xce;}_0x1a2703[_0xa95c('0x1a')](_0x40fed4);return _0x1a2703[_0xa95c('0x1e')](_0xa95c('0x1f'),_0x5418c0+'-'+_0x535878+'/'+_0x4c8cc4)[_0xa95c('0x1b')](_0x2bdda2);}return null;};}function patchUpdates(_0x215552){return function(_0x41318f){try{jsonpatch['apply'](_0x41318f,_0x215552,!![]);}catch(_0x51e920){return BPromise[_0xa95c('0x20')](_0x51e920);}return _0x41318f['save']();};}function saveUpdates(_0x53ebd2,_0x53106f){return function(_0x161794){if(_0x161794){return _0x161794['update'](_0x53ebd2)['then'](function(_0x561ec0){return _0x561ec0;});}return null;};}function removeEntity(_0x24dc28,_0x1e7696){return function(_0x39c563){if(_0x39c563){return _0x39c563[_0xa95c('0x21')]()['then'](function(){_0x24dc28['status'](0xcc)[_0xa95c('0x22')]();});}};}function handleEntityNotFound(_0x2db7c2,_0x548ff3){return function(_0x2c2ae8){if(!_0x2c2ae8){_0x2db7c2[_0xa95c('0x19')](0x194);}return _0x2c2ae8;};}function handleError(_0x52d3c3,_0x5a609c){_0x5a609c=_0x5a609c||0x1f4;return function(_0x74b148){logger['error'](_0x74b148[_0xa95c('0x23')]);if(_0x74b148[_0xa95c('0x24')]){delete _0x74b148[_0xa95c('0x24')];}_0x52d3c3['status'](_0x5a609c)['send'](_0x74b148);};}exports[_0xa95c('0x25')]=function(_0x531bcd,_0x2f82a7){var _0x4218a1={},_0x3c0fbf={},_0x46f3ac={'count':0x0,'rows':[]};var _0x80a6de=_['map'](db[_0xa95c('0x26')][_0xa95c('0x27')],function(_0x1806fe){return{'name':_0x1806fe[_0xa95c('0x28')],'type':_0x1806fe['type'][_0xa95c('0x29')]};});_0x3c0fbf[_0xa95c('0x2a')]=_[_0xa95c('0x2b')](_0x80a6de,_0xa95c('0x24'));_0x3c0fbf[_0xa95c('0x2c')]=_[_0xa95c('0x2d')](_0x531bcd[_0xa95c('0x2c')]);_0x3c0fbf[_0xa95c('0x2e')]=_[_0xa95c('0x2f')](_0x3c0fbf[_0xa95c('0x2a')],_0x3c0fbf[_0xa95c('0x2c')]);_0x4218a1[_0xa95c('0x30')]=_[_0xa95c('0x2f')](_0x3c0fbf[_0xa95c('0x2a')],qs[_0xa95c('0x31')](_0x531bcd[_0xa95c('0x2c')][_0xa95c('0x31')]));_0x4218a1['attributes']=_0x4218a1['attributes'][_0xa95c('0x32')]?_0x4218a1['attributes']:_0x3c0fbf[_0xa95c('0x2a')];if(!_0x531bcd['query'][_0xa95c('0x33')](_0xa95c('0x34'))){_0x4218a1['limit']=qs['limit'](_0x531bcd['query']['limit']);_0x4218a1['offset']=qs[_0xa95c('0x1c')](_0x531bcd[_0xa95c('0x2c')][_0xa95c('0x1c')]);}_0x4218a1[_0xa95c('0x35')]=qs['sort'](_0x531bcd[_0xa95c('0x2c')][_0xa95c('0x36')]);_0x4218a1[_0xa95c('0x37')]=qs[_0xa95c('0x2e')](_[_0xa95c('0x38')](_0x531bcd['query'],_0x3c0fbf[_0xa95c('0x2e')]),_0x80a6de);if(_0x531bcd[_0xa95c('0x2c')][_0xa95c('0x39')]){_0x4218a1['where']=_[_0xa95c('0x3a')](_0x4218a1[_0xa95c('0x37')],{'$or':_[_0xa95c('0x2b')](_0x80a6de,function(_0x49821e){if(_0x49821e[_0xa95c('0x3b')]!==_0xa95c('0x3c')){var _0x6f165f={};_0x6f165f[_0x49821e['name']]={'$like':'%'+_0x531bcd[_0xa95c('0x2c')][_0xa95c('0x39')]+'%'};return _0x6f165f;}})});}_0x4218a1=_[_0xa95c('0x3a')]({},_0x4218a1,_0x531bcd[_0xa95c('0x3d')]);var _0x5af994={'where':_0x4218a1[_0xa95c('0x37')]};return db[_0xa95c('0x26')][_0xa95c('0x3e')](_0x5af994)[_0xa95c('0x3f')](function(_0x5f41c9){_0x46f3ac['count']=_0x5f41c9;if(_0x531bcd[_0xa95c('0x2c')]['includeAll']){_0x4218a1[_0xa95c('0x40')]=[{'all':!![]}];}return db[_0xa95c('0x26')][_0xa95c('0x41')](_0x4218a1);})[_0xa95c('0x3f')](function(_0x11b75a){_0x46f3ac['rows']=_0x11b75a;return _0x46f3ac;})[_0xa95c('0x3f')](respondWithFilteredResult(_0x2f82a7,_0x4218a1))['catch'](handleError(_0x2f82a7,null));};exports['show']=function(_0x17a773,_0x3e3854){var _0xe12056={'raw':!![],'where':{'id':_0x17a773[_0xa95c('0x42')]['id']}},_0x138115={};_0x138115[_0xa95c('0x2a')]=_[_0xa95c('0x2d')](db[_0xa95c('0x26')][_0xa95c('0x27')]);_0x138115['query']=_[_0xa95c('0x2d')](_0x17a773[_0xa95c('0x2c')]);_0x138115[_0xa95c('0x2e')]=_['intersection'](_0x138115[_0xa95c('0x2a')],_0x138115[_0xa95c('0x2c')]);_0xe12056[_0xa95c('0x30')]=_[_0xa95c('0x2f')](_0x138115['model'],qs[_0xa95c('0x31')](_0x17a773[_0xa95c('0x2c')][_0xa95c('0x31')]));_0xe12056[_0xa95c('0x30')]=_0xe12056[_0xa95c('0x30')][_0xa95c('0x32')]?_0xe12056[_0xa95c('0x30')]:_0x138115['model'];if(_0x17a773[_0xa95c('0x2c')][_0xa95c('0x43')]){_0xe12056[_0xa95c('0x40')]=[{'all':!![]}];}_0xe12056=_['merge']({},_0xe12056,_0x17a773[_0xa95c('0x3d')]);return db[_0xa95c('0x26')][_0xa95c('0x44')](_0xe12056)[_0xa95c('0x3f')](handleEntityNotFound(_0x3e3854,null))['then'](respondWithResult(_0x3e3854,null))['catch'](handleError(_0x3e3854,null));};exports[_0xa95c('0x45')]=function(_0x2375b1,_0x27e499){return db[_0xa95c('0x26')][_0xa95c('0x45')](_0x2375b1[_0xa95c('0x46')],{})[_0xa95c('0x3f')](respondWithResult(_0x27e499,0xc9))[_0xa95c('0x47')](handleError(_0x27e499,null));};exports[_0xa95c('0x48')]=function(_0x453525,_0x323c05){if(_0x453525['body']['id']){delete _0x453525[_0xa95c('0x46')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x453525[_0xa95c('0x42')]['id']}})[_0xa95c('0x3f')](handleEntityNotFound(_0x323c05,null))[_0xa95c('0x3f')](saveUpdates(_0x453525[_0xa95c('0x46')],null))[_0xa95c('0x3f')](respondWithResult(_0x323c05,null))[_0xa95c('0x47')](handleError(_0x323c05,null));};exports[_0xa95c('0x21')]=function(_0x25307b,_0x432b22){return db['MailSubstatus']['find']({'where':{'id':_0x25307b['params']['id']}})[_0xa95c('0x3f')](handleEntityNotFound(_0x432b22,null))['then'](removeEntity(_0x432b22,null))[_0xa95c('0x47')](handleError(_0x432b22,null));};exports[_0xa95c('0x49')]=function(_0x31e987,_0x3bc725){return db[_0xa95c('0x26')][_0xa95c('0x49')]()[_0xa95c('0x3f')](respondWithResult(_0x3bc725,null))[_0xa95c('0x47')](handleError(_0x3bc725,null));};
\ No newline at end of file
index 55b84fa..8283c93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8a6=['hook','exports','events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x1db370,_0x261a4f){var _0x4379fb=function(_0x2af54d){while(--_0x2af54d){_0x1db370['push'](_0x1db370['shift']());}};_0x4379fb(++_0x261a4f);}(_0xa8a6,0xca));var _0x6a8a=function(_0x375879,_0x277cf9){_0x375879=_0x375879-0x0;var _0x2ea96f=_0xa8a6[_0x375879];return _0x2ea96f;};'use strict';var EventEmitter=require(_0x6a8a('0x0'));var MailSubstatus=require(_0x6a8a('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x6a8a('0x2')](0x0);var events={'afterUpdate':_0x6a8a('0x3')};function emitEvent(_0x1f33b9){return function(_0x11678a,_0x4db244,_0x522f6d){MailSubstatusEvents[_0x6a8a('0x4')](_0x1f33b9+':'+_0x11678a['id'],_0x11678a);MailSubstatusEvents[_0x6a8a('0x4')](_0x1f33b9,_0x11678a);_0x522f6d(null);};}for(var e in events){if(events[_0x6a8a('0x5')](e)){var event=events[e];MailSubstatus[_0x6a8a('0x6')](e,emitEvent(event));}}module[_0x6a8a('0x7')]=MailSubstatusEvents;
\ No newline at end of file
+var _0x1703=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','update'];(function(_0x212802,_0x7d2d78){var _0xeaa35b=function(_0x4fcdcf){while(--_0x4fcdcf){_0x212802['push'](_0x212802['shift']());}};_0xeaa35b(++_0x7d2d78);}(_0x1703,0x96));var _0x3170=function(_0x103ea5,_0x17394c){_0x103ea5=_0x103ea5-0x0;var _0x2ac5d8=_0x1703[_0x103ea5];return _0x2ac5d8;};'use strict';var EventEmitter=require(_0x3170('0x0'));var MailSubstatus=require(_0x3170('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x3170('0x2')](0x0);var events={'afterUpdate':_0x3170('0x3')};function emitEvent(_0x5ecb16){return function(_0xa41211,_0x598346,_0x3845af){MailSubstatusEvents[_0x3170('0x4')](_0x5ecb16+':'+_0xa41211['id'],_0xa41211);MailSubstatusEvents[_0x3170('0x4')](_0x5ecb16,_0xa41211);_0x3845af(null);};}for(var e in events){if(events[_0x3170('0x5')](e)){var event=events[e];MailSubstatus[_0x3170('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents;
\ No newline at end of file
index 19b1add..4ca9eb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a48=['define','MailSubstatus','update','mailSubstatus','_previousDataValues','name','then','catch','./mailSubstatus.attributes','models'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a48,0x116));var _0x87a4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7a48[_0x17d9e3];return _0x14192d;};'use strict';var attributes=require(_0x87a4('0x0'));module['exports']=function(_0x571b6f){var _0x39133c=_0x571b6f[_0x87a4('0x1')];return _0x571b6f[_0x87a4('0x2')](_0x87a4('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x809893,_0x16b66a,_0x4c67ee){return _0x39133c['Condition'][_0x87a4('0x4')]({'value':_0x809893['name']},{'where':{'field':_0x87a4('0x5'),'value':_0x809893[_0x87a4('0x6')][_0x87a4('0x7')]}})[_0x87a4('0x8')](function(){_0x4c67ee();})[_0x87a4('0x9')](function(_0x15a176){_0x4c67ee(_0x15a176);});}}});};
\ No newline at end of file
+var _0xf893=['catch','exports','define','MailSubstatus','update','name','mailSubstatus','_previousDataValues','then'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xf893,0x172));var _0x3f89=function(_0x571247,_0x38ee5a){_0x571247=_0x571247-0x0;var _0x594afd=_0xf893[_0x571247];return _0x594afd;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x3f89('0x0')]=function(_0x5dc4a9){var _0x178f3c=_0x5dc4a9['models'];return _0x5dc4a9[_0x3f89('0x1')](_0x3f89('0x2'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x7e7ba7,_0x20bbf6,_0x44569d){return _0x178f3c['Condition'][_0x3f89('0x3')]({'value':_0x7e7ba7[_0x3f89('0x4')]},{'where':{'field':_0x3f89('0x5'),'value':_0x7e7ba7[_0x3f89('0x6')][_0x3f89('0x4')]}})[_0x3f89('0x7')](function(){_0x44569d();})[_0x3f89('0x8')](function(_0x255032){_0x44569d(_0x255032);});}}});};
\ No newline at end of file
index f8a98cf..a85e770 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46b6=['error','code','message','MailSubstatus,\x20%s,\x20%s','info','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x46b6,0xe2));var _0x646b=function(_0xc9a976,_0x204756){_0xc9a976=_0xc9a976-0x0;var _0x128b43=_0x46b6[_0xc9a976];return _0x128b43;};'use strict';var _=require(_0x646b('0x0'));var util=require(_0x646b('0x1'));var moment=require(_0x646b('0x2'));var BPromise=require(_0x646b('0x3'));var rs=require(_0x646b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x646b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x646b('0x6'));var jayson=require(_0x646b('0x7'));var client=jayson[_0x646b('0x8')][_0x646b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d7b3d,_0x238b79,_0xe563b2){return new BPromise(function(_0x1f27ab,_0x58a856){return client[_0x646b('0xa')](_0x1d7b3d,_0xe563b2)['then'](function(_0x3eb00f){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x238b79,_0x646b('0xb'));logger[_0x646b('0xc')](_0x646b('0xd'),_0x238b79,_0x646b('0xb'),JSON['stringify'](_0x3eb00f));if(_0x3eb00f[_0x646b('0xe')]){if(_0x3eb00f[_0x646b('0xe')][_0x646b('0xf')]===0x1f4){logger[_0x646b('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x238b79,_0x3eb00f[_0x646b('0xe')]['message']);return _0x58a856(_0x3eb00f[_0x646b('0xe')][_0x646b('0x10')]);}logger[_0x646b('0xe')](_0x646b('0x11'),_0x238b79,_0x3eb00f[_0x646b('0xe')][_0x646b('0x10')]);return _0x1f27ab(_0x3eb00f[_0x646b('0xe')][_0x646b('0x10')]);}else{logger[_0x646b('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x238b79,_0x646b('0xb'));_0x1f27ab(_0x3eb00f['result'][_0x646b('0x10')]);}})[_0x646b('0x13')](function(_0x2176a3){logger[_0x646b('0xe')](_0x646b('0x11'),_0x238b79,_0x2176a3);_0x58a856(_0x2176a3);});});}
\ No newline at end of file
+var _0x7704=['jayson/promise','client','http','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x67a6cc,_0x5187c4){var _0xa4cb56=function(_0x1a26f){while(--_0x1a26f){_0x67a6cc['push'](_0x67a6cc['shift']());}};_0xa4cb56(++_0x5187c4);}(_0x7704,0x1f1));var _0x4770=function(_0x117507,_0x486535){_0x117507=_0x117507-0x0;var _0x46f4f0=_0x7704[_0x117507];return _0x46f4f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4770('0x0'));var BPromise=require(_0x4770('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4770('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4770('0x3'));var logger=require(_0x4770('0x4'))(_0x4770('0x5'));var config=require(_0x4770('0x6'));var jayson=require(_0x4770('0x7'));var client=jayson[_0x4770('0x8')][_0x4770('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe6e1ec,_0x5ee735,_0x5c2728){return new BPromise(function(_0x2aab97,_0x237c1c){return client['request'](_0xe6e1ec,_0x5c2728)['then'](function(_0x269cae){logger[_0x4770('0xa')](_0x4770('0xb'),_0x5ee735,_0x4770('0xc'));logger[_0x4770('0xd')](_0x4770('0xe'),_0x5ee735,_0x4770('0xc'),JSON[_0x4770('0xf')](_0x269cae));if(_0x269cae[_0x4770('0x10')]){if(_0x269cae[_0x4770('0x10')][_0x4770('0x11')]===0x1f4){logger[_0x4770('0x10')](_0x4770('0xb'),_0x5ee735,_0x269cae[_0x4770('0x10')][_0x4770('0x12')]);return _0x237c1c(_0x269cae[_0x4770('0x10')]['message']);}logger[_0x4770('0x10')](_0x4770('0xb'),_0x5ee735,_0x269cae[_0x4770('0x10')]['message']);return _0x2aab97(_0x269cae[_0x4770('0x10')][_0x4770('0x12')]);}else{logger[_0x4770('0xa')](_0x4770('0xb'),_0x5ee735,_0x4770('0xc'));_0x2aab97(_0x269cae[_0x4770('0x13')][_0x4770('0x12')]);}})[_0x4770('0x14')](function(_0x504386){logger['error'](_0x4770('0xb'),_0x5ee735,_0x504386);_0x237c1c(_0x504386);});});}
\ No newline at end of file
index f67bf43..9a97d39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1344=['update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','create'];(function(_0xae8f97,_0x1553fb){var _0x27cc2d=function(_0x1ea885){while(--_0x1ea885){_0xae8f97['push'](_0xae8f97['shift']());}};_0x27cc2d(++_0x1553fb);}(_0x1344,0x18f));var _0x4134=function(_0x17ebe2,_0x1072c9){_0x17ebe2=_0x17ebe2-0x0;var _0x2694d7=_0x1344[_0x17ebe2];return _0x2694d7;};'use strict';var multer=require(_0x4134('0x0'));var util=require(_0x4134('0x1'));var path=require(_0x4134('0x2'));var timeout=require(_0x4134('0x3'));var express=require('express');var router=express[_0x4134('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4134('0x5'));var config=require(_0x4134('0x6'));var controller=require(_0x4134('0x7'));router[_0x4134('0x8')]('/',auth['isAuthenticated'](),controller[_0x4134('0x9')]);router[_0x4134('0x8')](_0x4134('0xa'),auth['isAuthenticated'](),controller[_0x4134('0xb')]);router[_0x4134('0x8')](_0x4134('0xc'),auth[_0x4134('0xd')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x4134('0xe')]);router['put'](_0x4134('0xc'),auth['isAuthenticated'](),controller[_0x4134('0xf')]);router['delete']('/:id',auth[_0x4134('0xd')](),controller[_0x4134('0x10')]);module[_0x4134('0x11')]=router;
\ No newline at end of file
+var _0x429a=['index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x455f2c,_0xc4bd3a){var _0x21784d=function(_0x6d9d76){while(--_0x6d9d76){_0x455f2c['push'](_0x455f2c['shift']());}};_0x21784d(++_0xc4bd3a);}(_0x429a,0x15f));var _0xa429=function(_0x333fed,_0x3d2122){_0x333fed=_0x333fed-0x0;var _0x12cac2=_0x429a[_0x333fed];return _0x12cac2;};'use strict';var multer=require(_0xa429('0x0'));var util=require('util');var path=require(_0xa429('0x1'));var timeout=require(_0xa429('0x2'));var express=require('express');var router=express[_0xa429('0x3')]();var fs_extra=require(_0xa429('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa429('0x5'));var config=require(_0xa429('0x6'));var controller=require('./mailTransferReport.controller');router[_0xa429('0x7')]('/',auth[_0xa429('0x8')](),controller[_0xa429('0x9')]);router[_0xa429('0x7')](_0xa429('0xa'),auth[_0xa429('0x8')](),controller[_0xa429('0xb')]);router[_0xa429('0x7')](_0xa429('0xc'),auth[_0xa429('0x8')](),controller[_0xa429('0xd')]);router[_0xa429('0xe')]('/',auth[_0xa429('0x8')](),controller[_0xa429('0xf')]);router['put'](_0xa429('0xc'),auth[_0xa429('0x8')](),controller[_0xa429('0x10')]);router[_0xa429('0x11')]('/:id',auth[_0xa429('0x8')](),controller[_0xa429('0x12')]);module[_0xa429('0x13')]=router;
\ No newline at end of file
index 64991fa..f93a5f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x162b94,_0x1ac55f){var _0x452a7c=function(_0x444047){while(--_0x444047){_0x162b94['push'](_0x162b94['shift']());}};_0x452a7c(++_0x1ac55f);}(_0xe706,0xa3));var _0x6e70=function(_0x21f013,_0x3a2050){_0x21f013=_0x21f013-0x0;var _0x1addf8=_0xe706[_0x21f013];return _0x1addf8;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
+var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x35d0a9,_0x44a844){var _0x240221=function(_0x4728c6){while(--_0x4728c6){_0x35d0a9['push'](_0x35d0a9['shift']());}};_0x240221(++_0x44a844);}(_0xe706,0xa3));var _0x6e70=function(_0x141177,_0x2944fc){_0x141177=_0x141177-0x0;var _0x3014ad=_0xe706[_0x141177];return _0x3014ad;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
index e914fe7..87c337f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8371=['intersection','create','body','catch','describe','eml-format','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','show','params'];(function(_0x525a8e,_0x158506){var _0x4617a8=function(_0x163602){while(--_0x163602){_0x525a8e['push'](_0x525a8e['shift']());}};_0x4617a8(++_0x158506);}(_0x8371,0xce));var _0x1837=function(_0x5eb8b,_0x189af2){_0x5eb8b=_0x5eb8b-0x0;var _0x261b65=_0x8371[_0x5eb8b];return _0x261b65;};'use strict';var emlformat=require(_0x1837('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1837('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1837('0x2'));var util=require(_0x1837('0x3'));var path=require(_0x1837('0x4'));var sox=require(_0x1837('0x5'));var csv=require(_0x1837('0x6'));var ejs=require(_0x1837('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1837('0x8'));var squel=require('squel');var crypto=require(_0x1837('0x9'));var jsforce=require(_0x1837('0xa'));var deskjs=require(_0x1837('0xb'));var toCsv=require(_0x1837('0x6'));var querystring=require(_0x1837('0xc'));var Papa=require('papaparse');var Redis=require(_0x1837('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1837('0xe'));var logger=require(_0x1837('0xf'))(_0x1837('0x10'));var utils=require(_0x1837('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1837('0x12'))['db'];function respondWithStatusCode(_0x1448da,_0x47430d){_0x47430d=_0x47430d||0xcc;return function(_0x4b0aa5){if(_0x4b0aa5){return _0x1448da[_0x1837('0x13')](_0x47430d);}return _0x1448da[_0x1837('0x14')](_0x47430d)['end']();};}function respondWithResult(_0x514b5f,_0x242af0){_0x242af0=_0x242af0||0xc8;return function(_0x5e4cd7){if(_0x5e4cd7){return _0x514b5f[_0x1837('0x14')](_0x242af0)['json'](_0x5e4cd7);}};}function respondWithFilteredResult(_0x139af5,_0x3dd7d0){return function(_0xac69d9){if(_0xac69d9){var _0x3a0461=typeof _0x3dd7d0[_0x1837('0x15')]===_0x1837('0x16')&&typeof _0x3dd7d0['limit']===_0x1837('0x16');var _0x37abe7=_0xac69d9[_0x1837('0x17')];var _0x46c5b4=_0x3a0461?0x0:_0x3dd7d0[_0x1837('0x15')];var _0x428647=_0x3a0461?_0xac69d9['count']:_0x3dd7d0[_0x1837('0x15')]+_0x3dd7d0[_0x1837('0x18')];var _0x952a11;if(_0x428647>=_0x37abe7){_0x428647=_0x37abe7;_0x952a11=0xc8;}else{_0x952a11=0xce;}_0x139af5[_0x1837('0x14')](_0x952a11);return _0x139af5[_0x1837('0x19')](_0x1837('0x1a'),_0x46c5b4+'-'+_0x428647+'/'+_0x37abe7)['json'](_0xac69d9);}return null;};}function patchUpdates(_0xe037c8){return function(_0x154807){try{jsonpatch[_0x1837('0x1b')](_0x154807,_0xe037c8,!![]);}catch(_0x5a8a4c){return BPromise[_0x1837('0x1c')](_0x5a8a4c);}return _0x154807[_0x1837('0x1d')]();};}function saveUpdates(_0x3d4dc8,_0x2b8e9c){return function(_0xe8cce3){if(_0xe8cce3){return _0xe8cce3['update'](_0x3d4dc8)[_0x1837('0x1e')](function(_0x4c96ba){return _0x4c96ba;});}return null;};}function removeEntity(_0x14e39f,_0x5c4506){return function(_0x755fe8){if(_0x755fe8){return _0x755fe8[_0x1837('0x1f')]()[_0x1837('0x1e')](function(){_0x14e39f[_0x1837('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18a994,_0x3e9d84){return function(_0x3833b3){if(!_0x3833b3){_0x18a994['sendStatus'](0x194);}return _0x3833b3;};}function handleError(_0x344ac1,_0x3ec9dd){_0x3ec9dd=_0x3ec9dd||0x1f4;return function(_0x4d6670){logger[_0x1837('0x20')](_0x4d6670[_0x1837('0x21')]);if(_0x4d6670[_0x1837('0x22')]){delete _0x4d6670['name'];}_0x344ac1[_0x1837('0x14')](_0x3ec9dd)['send'](_0x4d6670);};}exports[_0x1837('0x23')]=function(_0x30d8f,_0xbb2432){var _0x3ab864={},_0x233e49={},_0x49615f={'count':0x0,'rows':[]};var _0x16afb0=_[_0x1837('0x24')](db[_0x1837('0x25')][_0x1837('0x26')],function(_0x1da2af){return{'name':_0x1da2af[_0x1837('0x27')],'type':_0x1da2af[_0x1837('0x28')][_0x1837('0x29')]};});_0x233e49['model']=_[_0x1837('0x24')](_0x16afb0,_0x1837('0x22'));_0x233e49['query']=_[_0x1837('0x2a')](_0x30d8f[_0x1837('0x2b')]);_0x233e49[_0x1837('0x2c')]=_['intersection'](_0x233e49['model'],_0x233e49[_0x1837('0x2b')]);_0x3ab864[_0x1837('0x2d')]=_['intersection'](_0x233e49[_0x1837('0x2e')],qs[_0x1837('0x2f')](_0x30d8f['query']['fields']));_0x3ab864[_0x1837('0x2d')]=_0x3ab864[_0x1837('0x2d')][_0x1837('0x30')]?_0x3ab864[_0x1837('0x2d')]:_0x233e49['model'];if(!_0x30d8f[_0x1837('0x2b')][_0x1837('0x31')](_0x1837('0x32'))){_0x3ab864[_0x1837('0x18')]=qs[_0x1837('0x18')](_0x30d8f[_0x1837('0x2b')][_0x1837('0x18')]);_0x3ab864[_0x1837('0x15')]=qs[_0x1837('0x15')](_0x30d8f[_0x1837('0x2b')][_0x1837('0x15')]);}_0x3ab864['order']=qs[_0x1837('0x33')](_0x30d8f['query'][_0x1837('0x33')]);_0x3ab864[_0x1837('0x34')]=qs[_0x1837('0x2c')](_[_0x1837('0x35')](_0x30d8f[_0x1837('0x2b')],_0x233e49[_0x1837('0x2c')]),_0x16afb0);if(_0x30d8f[_0x1837('0x2b')]['filter']){_0x3ab864[_0x1837('0x34')]=_[_0x1837('0x36')](_0x3ab864[_0x1837('0x34')],{'$or':_['map'](_0x16afb0,function(_0x193ff2){if(_0x193ff2[_0x1837('0x28')]!==_0x1837('0x37')){var _0x165a0e={};_0x165a0e[_0x193ff2[_0x1837('0x22')]]={'$like':'%'+_0x30d8f[_0x1837('0x2b')][_0x1837('0x38')]+'%'};return _0x165a0e;}})});}_0x3ab864=_['merge']({},_0x3ab864,_0x30d8f[_0x1837('0x39')]);var _0x938bd0={'where':_0x3ab864[_0x1837('0x34')]};return db[_0x1837('0x25')]['count'](_0x938bd0)[_0x1837('0x1e')](function(_0x34e4c2){_0x49615f[_0x1837('0x17')]=_0x34e4c2;if(_0x30d8f[_0x1837('0x2b')][_0x1837('0x3a')]){_0x3ab864[_0x1837('0x3b')]=[{'all':!![]}];}return db[_0x1837('0x25')]['findAll'](_0x3ab864);})[_0x1837('0x1e')](function(_0x146b5d){_0x49615f['rows']=_0x146b5d;return _0x49615f;})['then'](respondWithFilteredResult(_0xbb2432,_0x3ab864))['catch'](handleError(_0xbb2432,null));};exports[_0x1837('0x3c')]=function(_0x364047,_0xbcfbb9){var _0x14ebce={'raw':!![],'where':{'id':_0x364047[_0x1837('0x3d')]['id']}},_0x5cc59d={};_0x5cc59d['model']=_[_0x1837('0x2a')](db[_0x1837('0x25')][_0x1837('0x26')]);_0x5cc59d[_0x1837('0x2b')]=_[_0x1837('0x2a')](_0x364047[_0x1837('0x2b')]);_0x5cc59d[_0x1837('0x2c')]=_[_0x1837('0x3e')](_0x5cc59d['model'],_0x5cc59d[_0x1837('0x2b')]);_0x14ebce[_0x1837('0x2d')]=_[_0x1837('0x3e')](_0x5cc59d[_0x1837('0x2e')],qs['fields'](_0x364047[_0x1837('0x2b')]['fields']));_0x14ebce[_0x1837('0x2d')]=_0x14ebce[_0x1837('0x2d')][_0x1837('0x30')]?_0x14ebce['attributes']:_0x5cc59d[_0x1837('0x2e')];if(_0x364047[_0x1837('0x2b')][_0x1837('0x3a')]){_0x14ebce[_0x1837('0x3b')]=[{'all':!![]}];}_0x14ebce=_[_0x1837('0x36')]({},_0x14ebce,_0x364047['options']);return db[_0x1837('0x25')]['find'](_0x14ebce)[_0x1837('0x1e')](handleEntityNotFound(_0xbcfbb9,null))[_0x1837('0x1e')](respondWithResult(_0xbcfbb9,null))['catch'](handleError(_0xbcfbb9,null));};exports[_0x1837('0x3f')]=function(_0x2122da,_0x7ece84){return db[_0x1837('0x25')][_0x1837('0x3f')](_0x2122da[_0x1837('0x40')],{})['then'](respondWithResult(_0x7ece84,0xc9))[_0x1837('0x41')](handleError(_0x7ece84,null));};exports['update']=function(_0x5eab7d,_0x12ae9e){if(_0x5eab7d[_0x1837('0x40')]['id']){delete _0x5eab7d['body']['id'];}return db[_0x1837('0x25')]['find']({'where':{'id':_0x5eab7d[_0x1837('0x3d')]['id']}})[_0x1837('0x1e')](handleEntityNotFound(_0x12ae9e,null))[_0x1837('0x1e')](saveUpdates(_0x5eab7d[_0x1837('0x40')],null))[_0x1837('0x1e')](respondWithResult(_0x12ae9e,null))[_0x1837('0x41')](handleError(_0x12ae9e,null));};exports[_0x1837('0x1f')]=function(_0x49777e,_0x4dad5c){return db[_0x1837('0x25')]['find']({'where':{'id':_0x49777e['params']['id']}})[_0x1837('0x1e')](handleEntityNotFound(_0x4dad5c,null))[_0x1837('0x1e')](removeEntity(_0x4dad5c,null))[_0x1837('0x41')](handleError(_0x4dad5c,null));};exports['describe']=function(_0x2b101c,_0x9a274e){return db[_0x1837('0x25')][_0x1837('0x42')]()[_0x1837('0x1e')](respondWithResult(_0x9a274e,null))['catch'](handleError(_0x9a274e,null));};
\ No newline at end of file
+var _0x1bec=['order','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','status','sendStatus','error','stack','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x1dd79d,_0x23b0a4){var _0x2d7816=function(_0x45e990){while(--_0x45e990){_0x1dd79d['push'](_0x1dd79d['shift']());}};_0x2d7816(++_0x23b0a4);}(_0x1bec,0xaa));var _0xc1be=function(_0x59cd25,_0x55b586){_0x59cd25=_0x59cd25-0x0;var _0x1efadf=_0x1bec[_0x59cd25];return _0x1efadf;};'use strict';var emlformat=require(_0xc1be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc1be('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1be('0x2'));var moment=require(_0xc1be('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc1be('0x4'));var util=require(_0xc1be('0x5'));var path=require(_0xc1be('0x6'));var sox=require(_0xc1be('0x7'));var csv=require(_0xc1be('0x8'));var ejs=require(_0xc1be('0x9'));var fs=require('fs');var fs_extra=require(_0xc1be('0xa'));var _=require('lodash');var squel=require(_0xc1be('0xb'));var crypto=require('crypto');var jsforce=require(_0xc1be('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc1be('0x8'));var querystring=require(_0xc1be('0xd'));var Papa=require('papaparse');var Redis=require(_0xc1be('0xe'));var authService=require(_0xc1be('0xf'));var qs=require(_0xc1be('0x10'));var as=require(_0xc1be('0x11'));var hardwareService=require(_0xc1be('0x12'));var logger=require(_0xc1be('0x13'))(_0xc1be('0x14'));var utils=require(_0xc1be('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc1be('0x16'));var db=require(_0xc1be('0x17'))['db'];function respondWithStatusCode(_0x784de7,_0x1d40a8){_0x1d40a8=_0x1d40a8||0xcc;return function(_0x2e4bcc){if(_0x2e4bcc){return _0x784de7['sendStatus'](_0x1d40a8);}return _0x784de7['status'](_0x1d40a8)[_0xc1be('0x18')]();};}function respondWithResult(_0x5e346a,_0x53346d){_0x53346d=_0x53346d||0xc8;return function(_0x4c426d){if(_0x4c426d){return _0x5e346a['status'](_0x53346d)[_0xc1be('0x19')](_0x4c426d);}};}function respondWithFilteredResult(_0x420582,_0x4124d4){return function(_0x5a311d){if(_0x5a311d){var _0x2bf5a5=typeof _0x4124d4[_0xc1be('0x1a')]===_0xc1be('0x1b')&&typeof _0x4124d4[_0xc1be('0x1c')]===_0xc1be('0x1b');var _0x4dd267=_0x5a311d['count'];var _0x2c8fba=_0x2bf5a5?0x0:_0x4124d4['offset'];var _0x2abc56=_0x2bf5a5?_0x5a311d['count']:_0x4124d4[_0xc1be('0x1a')]+_0x4124d4[_0xc1be('0x1c')];var _0x1be58e;if(_0x2abc56>=_0x4dd267){_0x2abc56=_0x4dd267;_0x1be58e=0xc8;}else{_0x1be58e=0xce;}_0x420582['status'](_0x1be58e);return _0x420582[_0xc1be('0x1d')]('Content-Range',_0x2c8fba+'-'+_0x2abc56+'/'+_0x4dd267)[_0xc1be('0x19')](_0x5a311d);}return null;};}function patchUpdates(_0x23a236){return function(_0x307816){try{jsonpatch[_0xc1be('0x1e')](_0x307816,_0x23a236,!![]);}catch(_0x3a44ac){return BPromise[_0xc1be('0x1f')](_0x3a44ac);}return _0x307816[_0xc1be('0x20')]();};}function saveUpdates(_0x2d40af,_0x3f54ba){return function(_0x296db8){if(_0x296db8){return _0x296db8[_0xc1be('0x21')](_0x2d40af)[_0xc1be('0x22')](function(_0x5e2ff9){return _0x5e2ff9;});}return null;};}function removeEntity(_0x429369,_0x3da459){return function(_0x2ad69f){if(_0x2ad69f){return _0x2ad69f[_0xc1be('0x23')]()[_0xc1be('0x22')](function(){_0x429369[_0xc1be('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f7c91,_0x2e9bb2){return function(_0x22a7cc){if(!_0x22a7cc){_0x3f7c91[_0xc1be('0x25')](0x194);}return _0x22a7cc;};}function handleError(_0x2bd9d7,_0x367f81){_0x367f81=_0x367f81||0x1f4;return function(_0x5517d0){logger[_0xc1be('0x26')](_0x5517d0[_0xc1be('0x27')]);if(_0x5517d0[_0xc1be('0x28')]){delete _0x5517d0['name'];}_0x2bd9d7[_0xc1be('0x24')](_0x367f81)[_0xc1be('0x29')](_0x5517d0);};}exports['index']=function(_0x2d102e,_0x31529f){var _0x40e0dc={},_0x97629e={},_0x35072d={'count':0x0,'rows':[]};var _0x1fce6a=_[_0xc1be('0x2a')](db[_0xc1be('0x2b')][_0xc1be('0x2c')],function(_0x19524d){return{'name':_0x19524d[_0xc1be('0x2d')],'type':_0x19524d[_0xc1be('0x2e')][_0xc1be('0x2f')]};});_0x97629e['model']=_[_0xc1be('0x2a')](_0x1fce6a,_0xc1be('0x28'));_0x97629e[_0xc1be('0x30')]=_[_0xc1be('0x31')](_0x2d102e[_0xc1be('0x30')]);_0x97629e[_0xc1be('0x32')]=_[_0xc1be('0x33')](_0x97629e[_0xc1be('0x34')],_0x97629e['query']);_0x40e0dc['attributes']=_[_0xc1be('0x33')](_0x97629e[_0xc1be('0x34')],qs['fields'](_0x2d102e[_0xc1be('0x30')][_0xc1be('0x35')]));_0x40e0dc[_0xc1be('0x36')]=_0x40e0dc['attributes'][_0xc1be('0x37')]?_0x40e0dc['attributes']:_0x97629e[_0xc1be('0x34')];if(!_0x2d102e['query'][_0xc1be('0x38')](_0xc1be('0x39'))){_0x40e0dc[_0xc1be('0x1c')]=qs[_0xc1be('0x1c')](_0x2d102e[_0xc1be('0x30')][_0xc1be('0x1c')]);_0x40e0dc[_0xc1be('0x1a')]=qs[_0xc1be('0x1a')](_0x2d102e[_0xc1be('0x30')]['offset']);}_0x40e0dc[_0xc1be('0x3a')]=qs[_0xc1be('0x3b')](_0x2d102e[_0xc1be('0x30')]['sort']);_0x40e0dc[_0xc1be('0x3c')]=qs['filters'](_[_0xc1be('0x3d')](_0x2d102e[_0xc1be('0x30')],_0x97629e[_0xc1be('0x32')]),_0x1fce6a);if(_0x2d102e[_0xc1be('0x30')][_0xc1be('0x3e')]){_0x40e0dc[_0xc1be('0x3c')]=_[_0xc1be('0x3f')](_0x40e0dc[_0xc1be('0x3c')],{'$or':_[_0xc1be('0x2a')](_0x1fce6a,function(_0xcc49a1){if(_0xcc49a1[_0xc1be('0x2e')]!==_0xc1be('0x40')){var _0x114cd9={};_0x114cd9[_0xcc49a1[_0xc1be('0x28')]]={'$like':'%'+_0x2d102e[_0xc1be('0x30')]['filter']+'%'};return _0x114cd9;}})});}_0x40e0dc=_[_0xc1be('0x3f')]({},_0x40e0dc,_0x2d102e['options']);var _0x154801={'where':_0x40e0dc[_0xc1be('0x3c')]};return db[_0xc1be('0x2b')][_0xc1be('0x41')](_0x154801)['then'](function(_0x531739){_0x35072d['count']=_0x531739;if(_0x2d102e[_0xc1be('0x30')]['includeAll']){_0x40e0dc[_0xc1be('0x42')]=[{'all':!![]}];}return db[_0xc1be('0x2b')][_0xc1be('0x43')](_0x40e0dc);})['then'](function(_0x2af2d5){_0x35072d[_0xc1be('0x44')]=_0x2af2d5;return _0x35072d;})[_0xc1be('0x22')](respondWithFilteredResult(_0x31529f,_0x40e0dc))[_0xc1be('0x45')](handleError(_0x31529f,null));};exports[_0xc1be('0x46')]=function(_0x3bc697,_0x16cbe3){var _0x54722b={'raw':!![],'where':{'id':_0x3bc697[_0xc1be('0x47')]['id']}},_0x2512e6={};_0x2512e6[_0xc1be('0x34')]=_[_0xc1be('0x31')](db[_0xc1be('0x2b')]['rawAttributes']);_0x2512e6['query']=_['keys'](_0x3bc697[_0xc1be('0x30')]);_0x2512e6[_0xc1be('0x32')]=_[_0xc1be('0x33')](_0x2512e6[_0xc1be('0x34')],_0x2512e6[_0xc1be('0x30')]);_0x54722b[_0xc1be('0x36')]=_[_0xc1be('0x33')](_0x2512e6[_0xc1be('0x34')],qs['fields'](_0x3bc697[_0xc1be('0x30')][_0xc1be('0x35')]));_0x54722b[_0xc1be('0x36')]=_0x54722b['attributes'][_0xc1be('0x37')]?_0x54722b['attributes']:_0x2512e6[_0xc1be('0x34')];if(_0x3bc697[_0xc1be('0x30')]['includeAll']){_0x54722b['include']=[{'all':!![]}];}_0x54722b=_[_0xc1be('0x3f')]({},_0x54722b,_0x3bc697['options']);return db['MailTransferReport'][_0xc1be('0x48')](_0x54722b)[_0xc1be('0x22')](handleEntityNotFound(_0x16cbe3,null))[_0xc1be('0x22')](respondWithResult(_0x16cbe3,null))[_0xc1be('0x45')](handleError(_0x16cbe3,null));};exports[_0xc1be('0x49')]=function(_0x30dd29,_0x7623bb){return db[_0xc1be('0x2b')][_0xc1be('0x49')](_0x30dd29[_0xc1be('0x4a')],{})[_0xc1be('0x22')](respondWithResult(_0x7623bb,0xc9))['catch'](handleError(_0x7623bb,null));};exports['update']=function(_0x40cc45,_0x16c795){if(_0x40cc45[_0xc1be('0x4a')]['id']){delete _0x40cc45['body']['id'];}return db['MailTransferReport'][_0xc1be('0x48')]({'where':{'id':_0x40cc45[_0xc1be('0x47')]['id']}})[_0xc1be('0x22')](handleEntityNotFound(_0x16c795,null))[_0xc1be('0x22')](saveUpdates(_0x40cc45[_0xc1be('0x4a')],null))['then'](respondWithResult(_0x16c795,null))[_0xc1be('0x45')](handleError(_0x16c795,null));};exports['destroy']=function(_0x2383df,_0x5f34a3){return db['MailTransferReport'][_0xc1be('0x48')]({'where':{'id':_0x2383df[_0xc1be('0x47')]['id']}})['then'](handleEntityNotFound(_0x5f34a3,null))[_0xc1be('0x22')](removeEntity(_0x5f34a3,null))['catch'](handleError(_0x5f34a3,null));};exports['describe']=function(_0x572f93,_0x14f087){return db[_0xc1be('0x2b')][_0xc1be('0x4b')]()[_0xc1be('0x22')](respondWithResult(_0x14f087,null))['catch'](handleError(_0x14f087,null));};
\ No newline at end of file
index c95b24c..7acb2da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5da1=['uniqueid','api','moment','bluebird','path','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer'];(function(_0x5249b9,_0x3acf1){var _0x4f4abf=function(_0x5dfeb0){while(--_0x5dfeb0){_0x5249b9['push'](_0x5249b9['shift']());}};_0x4f4abf(++_0x3acf1);}(_0x5da1,0xbf));var _0x15da=function(_0x2aee77,_0x3fefdc){_0x2aee77=_0x2aee77-0x0;var _0xa0a8f3=_0x5da1[_0x2aee77];return _0xa0a8f3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x15da('0x0'));var moment=require(_0x15da('0x1'));var BPromise=require(_0x15da('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15da('0x3'));var rimraf=require('rimraf');var config=require(_0x15da('0x4'));var attributes=require(_0x15da('0x5'));module['exports']=function(_0x261900,_0x4054bd){return _0x261900[_0x15da('0x6')](_0x15da('0x7'),attributes,{'tableName':_0x15da('0x8'),'paranoid':![],'indexes':[{'name':_0x15da('0x9'),'fields':[_0x15da('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a25=['lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x5224b9,_0x195fcb){var _0x363bcc=function(_0x3d219a){while(--_0x3d219a){_0x5224b9['push'](_0x5224b9['shift']());}};_0x363bcc(++_0x195fcb);}(_0x4a25,0x1d4));var _0x54a2=function(_0x289a67,_0x1e5a3c){_0x289a67=_0x289a67-0x0;var _0x572b49=_0x4a25[_0x289a67];return _0x572b49;};'use strict';var _=require(_0x54a2('0x0'));var util=require('util');var logger=require(_0x54a2('0x1'))('api');var moment=require(_0x54a2('0x2'));var BPromise=require(_0x54a2('0x3'));var rp=require(_0x54a2('0x4'));var fs=require('fs');var path=require(_0x54a2('0x5'));var rimraf=require('rimraf');var config=require(_0x54a2('0x6'));var attributes=require(_0x54a2('0x7'));module[_0x54a2('0x8')]=function(_0x3ecde5,_0x472eed){return _0x3ecde5['define'](_0x54a2('0x9'),attributes,{'tableName':_0x54a2('0xa'),'paranoid':![],'indexes':[{'name':_0x54a2('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index e28831d..a14de29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefbf=['MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','then','info','MailTransferReport,\x20%s,\x20%s','debug'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xefbf,0xbc));var _0xfefb=function(_0x3e460f,_0x40264d){_0x3e460f=_0x3e460f-0x0;var _0x1ee41b=_0xefbf[_0x3e460f];return _0x1ee41b;};'use strict';var _=require('lodash');var util=require(_0xfefb('0x0'));var moment=require('moment');var BPromise=require(_0xfefb('0x1'));var rs=require(_0xfefb('0x2'));var fs=require('fs');var Redis=require(_0xfefb('0x3'));var db=require(_0xfefb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfefb('0x5'))(_0xfefb('0x6'));var config=require(_0xfefb('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5648db,_0x4595d1,_0x207330){return new BPromise(function(_0x24011e,_0x1da601){return client['request'](_0x5648db,_0x207330)[_0xfefb('0x8')](function(_0x155881){logger[_0xfefb('0x9')](_0xfefb('0xa'),_0x4595d1,'request\x20sent');logger[_0xfefb('0xb')](_0xfefb('0xc'),_0x4595d1,_0xfefb('0xd'),JSON[_0xfefb('0xe')](_0x155881));if(_0x155881[_0xfefb('0xf')]){if(_0x155881[_0xfefb('0xf')][_0xfefb('0x10')]===0x1f4){logger[_0xfefb('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x4595d1,_0x155881[_0xfefb('0xf')]['message']);return _0x1da601(_0x155881['error'][_0xfefb('0x11')]);}logger['error'](_0xfefb('0xa'),_0x4595d1,_0x155881[_0xfefb('0xf')]['message']);return _0x24011e(_0x155881[_0xfefb('0xf')][_0xfefb('0x11')]);}else{logger['info'](_0xfefb('0xa'),_0x4595d1,_0xfefb('0xd'));_0x24011e(_0x155881[_0xfefb('0x12')][_0xfefb('0x11')]);}})[_0xfefb('0x13')](function(_0x54377e){logger['error'](_0xfefb('0xa'),_0x4595d1,_0x54377e);_0x1da601(_0x54377e);});});}
\ No newline at end of file
+var _0xeed9=['stringify','error','code','message','MailTransferReport,\x20%s,\x20%s','info','catch','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x5dc8e5,_0x458932){var _0xb578f3=function(_0x23bf5c){while(--_0x23bf5c){_0x5dc8e5['push'](_0x5dc8e5['shift']());}};_0xb578f3(++_0x458932);}(_0xeed9,0x197));var _0x9eed=function(_0x5df25b,_0x1bc928){_0x5df25b=_0x5df25b-0x0;var _0x19f252=_0xeed9[_0x5df25b];return _0x19f252;};'use strict';var _=require('lodash');var util=require(_0x9eed('0x0'));var moment=require(_0x9eed('0x1'));var BPromise=require('bluebird');var rs=require(_0x9eed('0x2'));var fs=require('fs');var Redis=require(_0x9eed('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9eed('0x4'))('rpc');var config=require(_0x9eed('0x5'));var jayson=require(_0x9eed('0x6'));var client=jayson[_0x9eed('0x7')][_0x9eed('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42c589,_0xefc6ce,_0x58397d){return new BPromise(function(_0x159e3c,_0x1a49eb){return client[_0x9eed('0x9')](_0x42c589,_0x58397d)[_0x9eed('0xa')](function(_0x4e7c72){logger['info']('MailTransferReport,\x20%s,\x20%s',_0xefc6ce,_0x9eed('0xb'));logger[_0x9eed('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xefc6ce,_0x9eed('0xb'),JSON[_0x9eed('0xd')](_0x4e7c72));if(_0x4e7c72['error']){if(_0x4e7c72[_0x9eed('0xe')][_0x9eed('0xf')]===0x1f4){logger[_0x9eed('0xe')]('MailTransferReport,\x20%s,\x20%s',_0xefc6ce,_0x4e7c72[_0x9eed('0xe')][_0x9eed('0x10')]);return _0x1a49eb(_0x4e7c72['error'][_0x9eed('0x10')]);}logger[_0x9eed('0xe')](_0x9eed('0x11'),_0xefc6ce,_0x4e7c72[_0x9eed('0xe')][_0x9eed('0x10')]);return _0x159e3c(_0x4e7c72[_0x9eed('0xe')]['message']);}else{logger[_0x9eed('0x12')](_0x9eed('0x11'),_0xefc6ce,_0x9eed('0xb'));_0x159e3c(_0x4e7c72['result'][_0x9eed('0x10')]);}})[_0x9eed('0x13')](function(_0x42af37){logger[_0x9eed('0xe')](_0x9eed('0x11'),_0xefc6ce,_0x42af37);_0x1a49eb(_0x42af37);});});}
\ No newline at end of file
index 2d6f69e..5e745be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb7a=['put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x2be716,_0x3fd1e4){var _0x287c18=function(_0x3c2d11){while(--_0x3c2d11){_0x2be716['push'](_0x2be716['shift']());}};_0x287c18(++_0x3fd1e4);}(_0xbb7a,0x9d));var _0xabb7=function(_0x5b8d6c,_0x2bfefe){_0x5b8d6c=_0x5b8d6c-0x0;var _0x3ab6d1=_0xbb7a[_0x5b8d6c];return _0x3ab6d1;};'use strict';var multer=require(_0xabb7('0x0'));var util=require('util');var path=require(_0xabb7('0x1'));var timeout=require('connect-timeout');var express=require(_0xabb7('0x2'));var router=express[_0xabb7('0x3')]();var fs_extra=require(_0xabb7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xabb7('0x5'));var config=require('../../config/environment');var controller=require(_0xabb7('0x6'));router[_0xabb7('0x7')]('/',auth[_0xabb7('0x8')](),controller[_0xabb7('0x9')]);router[_0xabb7('0x7')]('/describe',auth[_0xabb7('0x8')](),controller['describe']);router[_0xabb7('0x7')](_0xabb7('0xa'),auth[_0xabb7('0x8')](),controller[_0xabb7('0xb')]);router['post']('/',auth[_0xabb7('0x8')](),controller[_0xabb7('0xc')]);router[_0xabb7('0xd')]('/:id',auth[_0xabb7('0x8')](),controller[_0xabb7('0xe')]);router['delete'](_0xabb7('0xa'),auth['isAuthenticated'](),controller[_0xabb7('0xf')]);module[_0xabb7('0x10')]=router;
\ No newline at end of file
+var _0x17dc=['path','Router','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17dc,0xbc));var _0xc17d=function(_0x43f61d,_0x559906){_0x43f61d=_0x43f61d-0x0;var _0x4410ab=_0x17dc[_0x43f61d];return _0x4410ab;};'use strict';var multer=require(_0xc17d('0x0'));var util=require(_0xc17d('0x1'));var path=require(_0xc17d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc17d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc17d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc17d('0x5'));var controller=require(_0xc17d('0x6'));router[_0xc17d('0x7')]('/',auth[_0xc17d('0x8')](),controller['index']);router[_0xc17d('0x7')](_0xc17d('0x9'),auth[_0xc17d('0x8')](),controller[_0xc17d('0xa')]);router[_0xc17d('0x7')](_0xc17d('0xb'),auth[_0xc17d('0x8')](),controller[_0xc17d('0xc')]);router[_0xc17d('0xd')]('/',auth['isAuthenticated'](),controller[_0xc17d('0xe')]);router['put'](_0xc17d('0xb'),auth[_0xc17d('0x8')](),controller[_0xc17d('0xf')]);router[_0xc17d('0x10')](_0xc17d('0xb'),auth[_0xc17d('0x8')](),controller[_0xc17d('0x11')]);module[_0xc17d('0x12')]=router;
\ No newline at end of file
index d3bfe9c..fed29f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3379=['diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue'];(function(_0x3f409b,_0x385e0e){var _0x465dcd=function(_0xd174fe){while(--_0xd174fe){_0x3f409b['push'](_0x3f409b['shift']());}};_0x465dcd(++_0x385e0e);}(_0x3379,0x115));var _0x9337=function(_0x5bb5f1,_0x5d6ddd){_0x5bb5f1=_0x5bb5f1-0x0;var _0x2ef021=_0x3379[_0x5bb5f1];return _0x2ef021;};'use strict';var Sequelize=require(_0x9337('0x0'));var moment=require(_0x9337('0x1'));module[_0x9337('0x2')]={'channel':{'type':Sequelize[_0x9337('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x9337('0x3')]},'type':{'type':Sequelize[_0x9337('0x3')],'defaultValue':_0x9337('0x4'),'comment':_0x9337('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x9337('0x6')]},'exitAt':{'type':Sequelize[_0x9337('0x6')],'set':function(_0x390772){var _0x677c38=moment(_0x390772);var _0x5a59ab=moment(this[_0x9337('0x7')]('enterAt'));var _0x268943=_0x677c38[_0x9337('0x8')](_0x5a59ab,_0x9337('0x9'));this[_0x9337('0xa')](_0x9337('0xb'),_0x390772);this['setDataValue'](_0x9337('0xc'),_0x268943||null);}},'data1':{'type':Sequelize[_0x9337('0x3')],'comment':_0x9337('0xd')},'data2':{'type':Sequelize[_0x9337('0x3')],'comment':_0x9337('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0x9337('0xf')},'data4':{'type':Sequelize[_0x9337('0x3')],'comment':_0x9337('0x10')},'data5':{'type':Sequelize[_0x9337('0x3')],'comment':_0x9337('0x11')},'role':{'type':Sequelize[_0x9337('0x3')]},'internal':{'type':Sequelize[_0x9337('0x12')]},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x50a6=['DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','INTEGER','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x5d8afd,_0xd7f769){var _0x336c61=function(_0x539e58){while(--_0x539e58){_0x5d8afd['push'](_0x5d8afd['shift']());}};_0x336c61(++_0xd7f769);}(_0x50a6,0xa4));var _0x650a=function(_0x4145ed,_0x1965e3){_0x4145ed=_0x4145ed-0x0;var _0x2294a6=_0x50a6[_0x4145ed];return _0x2294a6;};'use strict';var Sequelize=require(_0x650a('0x0'));var moment=require(_0x650a('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x650a('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x650a('0x2')],'defaultValue':_0x650a('0x3'),'comment':_0x650a('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x650a('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x4eabde){var _0x2d486d=moment(_0x4eabde);var _0x2d1bb4=moment(this[_0x650a('0x6')](_0x650a('0x7')));var _0x56d38f=_0x2d486d[_0x650a('0x8')](_0x2d1bb4,'seconds');this[_0x650a('0x9')](_0x650a('0xa'),_0x4eabde);this['setDataValue'](_0x650a('0xb'),_0x56d38f||null);}},'data1':{'type':Sequelize[_0x650a('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x650a('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x650a('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x650a('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x650a('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x650a('0x2')]},'internal':{'type':Sequelize[_0x650a('0xc')]},'uniqueid':{'type':Sequelize[_0x650a('0x2')]}};
\ No newline at end of file
index 58dd7fb..7aae315 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(_0xb4947e,_0x39de27){var _0x2af6df=function(_0x308271){while(--_0x308271){_0xb4947e['push'](_0xb4947e['shift']());}};_0x2af6df(++_0x39de27);}(_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['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 _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xedd9,0xfc));var _0x9edd=function(_0x40648d,_0x5ddbcf){_0x40648d=_0x40648d-0x0;var _0x521402=_0xedd9[_0x40648d];return _0x521402;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));};
\ No newline at end of file
index cb43bd2..ae82267 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a30=['request-promise','path','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','util','../../config/logger','api','moment','bluebird'];(function(_0x2545b0,_0x3691fb){var _0x19bdbb=function(_0x935340){while(--_0x935340){_0x2545b0['push'](_0x2545b0['shift']());}};_0x19bdbb(++_0x3691fb);}(_0x4a30,0xbb));var _0x04a3=function(_0x4111a5,_0x57cb18){_0x4111a5=_0x4111a5-0x0;var _0x12967a=_0x4a30[_0x4111a5];return _0x12967a;};'use strict';var _=require('lodash');var util=require(_0x04a3('0x0'));var logger=require(_0x04a3('0x1'))(_0x04a3('0x2'));var moment=require(_0x04a3('0x3'));var BPromise=require(_0x04a3('0x4'));var rp=require(_0x04a3('0x5'));var fs=require('fs');var path=require(_0x04a3('0x6'));var rimraf=require('rimraf');var config=require(_0x04a3('0x7'));var attributes=require(_0x04a3('0x8'));module[_0x04a3('0x9')]=function(_0x17c2da,_0x4a0a33){return _0x17c2da[_0x04a3('0xa')](_0x04a3('0xb'),attributes,{'tableName':_0x04a3('0xc'),'paranoid':![],'indexes':[{'name':_0x04a3('0xd'),'fields':[_0x04a3('0xe'),_0x04a3('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5932=['path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api','moment'];(function(_0x11776d,_0x4bb864){var _0x3fc129=function(_0x55ea08){while(--_0x55ea08){_0x11776d['push'](_0x11776d['shift']());}};_0x3fc129(++_0x4bb864);}(_0x5932,0x172));var _0x2593=function(_0x5e091c,_0x477d37){_0x5e091c=_0x5e091c-0x0;var _0x320474=_0x5932[_0x5e091c];return _0x320474;};'use strict';var _=require(_0x2593('0x0'));var util=require(_0x2593('0x1'));var logger=require(_0x2593('0x2'))(_0x2593('0x3'));var moment=require(_0x2593('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2593('0x5'));var rimraf=require(_0x2593('0x6'));var config=require(_0x2593('0x7'));var attributes=require(_0x2593('0x8'));module[_0x2593('0x9')]=function(_0x16f0f2,_0x1212d1){return _0x16f0f2[_0x2593('0xa')](_0x2593('0xb'),attributes,{'tableName':_0x2593('0xc'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x2593('0xd'),_0x2593('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 09b5fcf..2bd223b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58e6=['model','create','body','CreateMemberReport','update','UpdateMemberReport','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x544362,_0xc31c04){var _0x5c12f9=function(_0x365c8b){while(--_0x365c8b){_0x544362['push'](_0x544362['shift']());}};_0x5c12f9(++_0xc31c04);}(_0x58e6,0x1c2));var _0x658e=function(_0x45335e,_0x4f15c2){_0x45335e=_0x45335e-0x0;var _0xaf11e0=_0x58e6[_0x45335e];return _0xaf11e0;};'use strict';var _=require(_0x658e('0x0'));var util=require(_0x658e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x658e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x658e('0x3'));var logger=require(_0x658e('0x4'))(_0x658e('0x5'));var config=require(_0x658e('0x6'));var jayson=require(_0x658e('0x7'));var client=jayson[_0x658e('0x8')][_0x658e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ea631,_0x5460ae,_0x7a343){return new BPromise(function(_0xa73acf,_0x1e2c26){return client['request'](_0x4ea631,_0x7a343)[_0x658e('0xa')](function(_0x6ea6e){logger[_0x658e('0xb')](_0x658e('0xc'),_0x5460ae,_0x658e('0xd'));logger[_0x658e('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x5460ae,'request\x20sent',JSON[_0x658e('0xf')](_0x6ea6e));if(_0x6ea6e[_0x658e('0x10')]){if(_0x6ea6e[_0x658e('0x10')][_0x658e('0x11')]===0x1f4){logger[_0x658e('0x10')](_0x658e('0xc'),_0x5460ae,_0x6ea6e[_0x658e('0x10')]['message']);return _0x1e2c26(_0x6ea6e[_0x658e('0x10')][_0x658e('0x12')]);}logger[_0x658e('0x10')](_0x658e('0xc'),_0x5460ae,_0x6ea6e['error'][_0x658e('0x12')]);return _0xa73acf(_0x6ea6e[_0x658e('0x10')]['message']);}else{logger['info'](_0x658e('0xc'),_0x5460ae,_0x658e('0xd'));_0xa73acf(_0x6ea6e[_0x658e('0x13')]['message']);}})[_0x658e('0x14')](function(_0x4f9ccd){logger[_0x658e('0x10')](_0x658e('0xc'),_0x5460ae,_0x4f9ccd);_0x1e2c26(_0x4f9ccd);});});}exports[_0x658e('0x15')]=function(_0x155db8){var _0x23bb10=this;return new Promise(function(_0x2fd15f,_0x508f72){return db[_0x658e('0x16')][_0x658e('0x17')]({'raw':_0x155db8[_0x658e('0x18')]?_0x155db8[_0x658e('0x18')][_0x658e('0x19')]===undefined?!![]:![]:!![],'where':_0x155db8['options']?_0x155db8['options'][_0x658e('0x1a')]||null:null,'attributes':_0x155db8[_0x658e('0x18')]?_0x155db8['options'][_0x658e('0x1b')]||null:null,'limit':_0x155db8[_0x658e('0x18')]?_0x155db8[_0x658e('0x18')][_0x658e('0x1c')]||null:null,'include':_0x155db8['options']?_0x155db8[_0x658e('0x18')][_0x658e('0x1d')]?_[_0x658e('0x1e')](_0x155db8[_0x658e('0x18')][_0x658e('0x1d')],function(_0x431e89){return{'model':db[_0x431e89[_0x658e('0x1f')]],'as':_0x431e89['as'],'attributes':_0x431e89[_0x658e('0x1b')],'include':_0x431e89[_0x658e('0x1d')]?_[_0x658e('0x1e')](_0x431e89[_0x658e('0x1d')],function(_0x4ec2ed){return{'model':db[_0x4ec2ed[_0x658e('0x1f')]],'as':_0x4ec2ed['as'],'attributes':_0x4ec2ed[_0x658e('0x1b')],'include':_0x4ec2ed['include']?_[_0x658e('0x1e')](_0x4ec2ed[_0x658e('0x1d')],function(_0x410642){return{'model':db[_0x410642[_0x658e('0x1f')]],'as':_0x410642['as'],'attributes':_0x410642[_0x658e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x658e('0xa')](function(_0x5d23dd){logger['info']('GetMemberReport',_0x155db8);logger[_0x658e('0xe')](_0x658e('0x15'),_0x155db8,JSON[_0x658e('0xf')](_0x5d23dd));_0x2fd15f(_0x5d23dd);})['catch'](function(_0x5b6b33){logger[_0x658e('0x10')](_0x658e('0x15'),_0x5b6b33['message'],_0x155db8);_0x508f72(_0x23bb10['error'](0x1f4,_0x5b6b33[_0x658e('0x12')]));});});};exports['CreateMemberReport']=function(_0x2df833){var _0x190d6a=this;return new Promise(function(_0x2411ab,_0x10aabc){return db[_0x658e('0x16')][_0x658e('0x20')](_0x2df833[_0x658e('0x21')],{'raw':_0x2df833['options']?_0x2df833[_0x658e('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x658e('0xa')](function(_0x1dd959){logger['info'](_0x658e('0x22'),_0x2df833);logger[_0x658e('0xe')](_0x658e('0x22'),_0x2df833,JSON[_0x658e('0xf')](_0x1dd959));_0x2411ab(_0x1dd959);})['catch'](function(_0x4d2bd8){logger[_0x658e('0x10')](_0x658e('0x22'),_0x4d2bd8['message'],_0x2df833);_0x10aabc(_0x190d6a['error'](0x1f4,_0x4d2bd8[_0x658e('0x12')]));});});};exports['UpdateMemberReport']=function(_0x1d616a){var _0x3708e3=this;return new Promise(function(_0x3f2fe9,_0x5224d8){return db['MemberReport'][_0x658e('0x23')](_0x1d616a['body'],{'raw':_0x1d616a[_0x658e('0x18')]?_0x1d616a[_0x658e('0x18')][_0x658e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d616a[_0x658e('0x18')]?_0x1d616a[_0x658e('0x18')][_0x658e('0x1a')]||null:null,'attributes':_0x1d616a[_0x658e('0x18')]?_0x1d616a[_0x658e('0x18')]['attributes']||null:null,'limit':_0x1d616a['options']?_0x1d616a[_0x658e('0x18')][_0x658e('0x1c')]||null:null})['then'](function(_0x142b22){logger[_0x658e('0xb')](_0x658e('0x24'),_0x1d616a);logger['debug'](_0x658e('0x24'),_0x1d616a,JSON['stringify'](_0x142b22));_0x3f2fe9(_0x142b22);})[_0x658e('0x14')](function(_0x2a6b4d){logger[_0x658e('0x10')](_0x658e('0x24'),_0x2a6b4d[_0x658e('0x12')],_0x1d616a);_0x5224d8(_0x3708e3[_0x658e('0x10')](0x1f4,_0x2a6b4d[_0x658e('0x12')]));});});};
\ No newline at end of file
+var _0xc9c3=['limit','include','map','model','catch','CreateMemberReport','create','body','UpdateMemberReport','update','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','GetMemberReport','MemberReport','options','raw','where','attributes'];(function(_0x57a4bf,_0x1bfa6e){var _0x7b03da=function(_0x235071){while(--_0x235071){_0x57a4bf['push'](_0x57a4bf['shift']());}};_0x7b03da(++_0x1bfa6e);}(_0xc9c3,0x96));var _0x3c9c=function(_0x42ed11,_0x200648){_0x42ed11=_0x42ed11-0x0;var _0x13aaad=_0xc9c3[_0x42ed11];return _0x13aaad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c9c('0x0'));var BPromise=require('bluebird');var rs=require(_0x3c9c('0x1'));var fs=require('fs');var Redis=require(_0x3c9c('0x2'));var db=require(_0x3c9c('0x3'))['db'];var utils=require(_0x3c9c('0x4'));var logger=require(_0x3c9c('0x5'))(_0x3c9c('0x6'));var config=require(_0x3c9c('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a2836,_0x3ca0ce,_0xc35e75){return new BPromise(function(_0x2eb946,_0x3e5ccb){return client[_0x3c9c('0x8')](_0x5a2836,_0xc35e75)[_0x3c9c('0x9')](function(_0x302ab7){logger[_0x3c9c('0xa')](_0x3c9c('0xb'),_0x3ca0ce,'request\x20sent');logger[_0x3c9c('0xc')](_0x3c9c('0xd'),_0x3ca0ce,'request\x20sent',JSON[_0x3c9c('0xe')](_0x302ab7));if(_0x302ab7['error']){if(_0x302ab7[_0x3c9c('0xf')][_0x3c9c('0x10')]===0x1f4){logger[_0x3c9c('0xf')](_0x3c9c('0xb'),_0x3ca0ce,_0x302ab7['error']['message']);return _0x3e5ccb(_0x302ab7['error'][_0x3c9c('0x11')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x3ca0ce,_0x302ab7['error'][_0x3c9c('0x11')]);return _0x2eb946(_0x302ab7['error'][_0x3c9c('0x11')]);}else{logger[_0x3c9c('0xa')](_0x3c9c('0xb'),_0x3ca0ce,_0x3c9c('0x12'));_0x2eb946(_0x302ab7['result'][_0x3c9c('0x11')]);}})['catch'](function(_0x558101){logger['error'](_0x3c9c('0xb'),_0x3ca0ce,_0x558101);_0x3e5ccb(_0x558101);});});}exports[_0x3c9c('0x13')]=function(_0x216fd8){var _0x3eee19=this;return new Promise(function(_0x3e63e0,_0x220b23){return db[_0x3c9c('0x14')]['findAll']({'raw':_0x216fd8[_0x3c9c('0x15')]?_0x216fd8['options'][_0x3c9c('0x16')]===undefined?!![]:![]:!![],'where':_0x216fd8['options']?_0x216fd8[_0x3c9c('0x15')][_0x3c9c('0x17')]||null:null,'attributes':_0x216fd8['options']?_0x216fd8[_0x3c9c('0x15')][_0x3c9c('0x18')]||null:null,'limit':_0x216fd8[_0x3c9c('0x15')]?_0x216fd8['options'][_0x3c9c('0x19')]||null:null,'include':_0x216fd8[_0x3c9c('0x15')]?_0x216fd8[_0x3c9c('0x15')][_0x3c9c('0x1a')]?_[_0x3c9c('0x1b')](_0x216fd8[_0x3c9c('0x15')][_0x3c9c('0x1a')],function(_0x32e4c2){return{'model':db[_0x32e4c2['model']],'as':_0x32e4c2['as'],'attributes':_0x32e4c2[_0x3c9c('0x18')],'include':_0x32e4c2['include']?_[_0x3c9c('0x1b')](_0x32e4c2[_0x3c9c('0x1a')],function(_0x4ca078){return{'model':db[_0x4ca078['model']],'as':_0x4ca078['as'],'attributes':_0x4ca078[_0x3c9c('0x18')],'include':_0x4ca078[_0x3c9c('0x1a')]?_[_0x3c9c('0x1b')](_0x4ca078[_0x3c9c('0x1a')],function(_0x4c283d){return{'model':db[_0x4c283d[_0x3c9c('0x1c')]],'as':_0x4c283d['as'],'attributes':_0x4c283d[_0x3c9c('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xafa3aa){logger['info']('GetMemberReport',_0x216fd8);logger[_0x3c9c('0xc')](_0x3c9c('0x13'),_0x216fd8,JSON[_0x3c9c('0xe')](_0xafa3aa));_0x3e63e0(_0xafa3aa);})[_0x3c9c('0x1d')](function(_0x7bdf33){logger['error'](_0x3c9c('0x13'),_0x7bdf33['message'],_0x216fd8);_0x220b23(_0x3eee19[_0x3c9c('0xf')](0x1f4,_0x7bdf33[_0x3c9c('0x11')]));});});};exports[_0x3c9c('0x1e')]=function(_0x10f439){var _0x5793c1=this;return new Promise(function(_0x257470,_0x39e4ed){return db[_0x3c9c('0x14')][_0x3c9c('0x1f')](_0x10f439[_0x3c9c('0x20')],{'raw':_0x10f439[_0x3c9c('0x15')]?_0x10f439[_0x3c9c('0x15')][_0x3c9c('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x173fa0){logger[_0x3c9c('0xa')](_0x3c9c('0x1e'),_0x10f439);logger[_0x3c9c('0xc')](_0x3c9c('0x1e'),_0x10f439,JSON[_0x3c9c('0xe')](_0x173fa0));_0x257470(_0x173fa0);})[_0x3c9c('0x1d')](function(_0x2d84e8){logger[_0x3c9c('0xf')](_0x3c9c('0x1e'),_0x2d84e8[_0x3c9c('0x11')],_0x10f439);_0x39e4ed(_0x5793c1[_0x3c9c('0xf')](0x1f4,_0x2d84e8[_0x3c9c('0x11')]));});});};exports[_0x3c9c('0x21')]=function(_0x5f4f64){var _0xa1d0f=this;return new Promise(function(_0x34266f,_0x3ae727){return db['MemberReport'][_0x3c9c('0x22')](_0x5f4f64[_0x3c9c('0x20')],{'raw':_0x5f4f64[_0x3c9c('0x15')]?_0x5f4f64[_0x3c9c('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f4f64['options']?_0x5f4f64[_0x3c9c('0x15')][_0x3c9c('0x17')]||null:null,'attributes':_0x5f4f64[_0x3c9c('0x15')]?_0x5f4f64['options']['attributes']||null:null,'limit':_0x5f4f64[_0x3c9c('0x15')]?_0x5f4f64['options']['limit']||null:null})[_0x3c9c('0x9')](function(_0xbe5c79){logger[_0x3c9c('0xa')]('UpdateMemberReport',_0x5f4f64);logger[_0x3c9c('0xc')](_0x3c9c('0x21'),_0x5f4f64,JSON[_0x3c9c('0xe')](_0xbe5c79));_0x34266f(_0xbe5c79);})['catch'](function(_0x54c14c){logger['error'](_0x3c9c('0x21'),_0x54c14c[_0x3c9c('0x11')],_0x5f4f64);_0x3ae727(_0xa1d0f[_0x3c9c('0xf')](0x1f4,_0x54c14c[_0x3c9c('0x11')]));});});};
\ No newline at end of file
index 42daa33..47edc1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe52=['../../config/environment','./migration.controller','get','index','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0xbe52,0x164));var _0x2be5=function(_0x131eea,_0x112132){_0x131eea=_0x131eea-0x0;var _0x49c7c0=_0xbe52[_0x131eea];return _0x49c7c0;};'use strict';var multer=require(_0x2be5('0x0'));var util=require(_0x2be5('0x1'));var path=require(_0x2be5('0x2'));var timeout=require(_0x2be5('0x3'));var express=require(_0x2be5('0x4'));var router=express['Router']();var fs_extra=require(_0x2be5('0x5'));var auth=require(_0x2be5('0x6'));var interaction=require(_0x2be5('0x7'));var config=require(_0x2be5('0x8'));var controller=require(_0x2be5('0x9'));router[_0x2be5('0xa')]('/',controller[_0x2be5('0xb')]);module[_0x2be5('0xc')]=router;
\ No newline at end of file
+var _0x5d7d=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','exports'];(function(_0x3d3e5d,_0xafef02){var _0x76d3cc=function(_0x45de8d){while(--_0x45de8d){_0x3d3e5d['push'](_0x3d3e5d['shift']());}};_0x76d3cc(++_0xafef02);}(_0x5d7d,0xc6));var _0xd5d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d7d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd5d7('0x0'));var util=require(_0xd5d7('0x1'));var path=require('path');var timeout=require(_0xd5d7('0x2'));var express=require(_0xd5d7('0x3'));var router=express[_0xd5d7('0x4')]();var fs_extra=require(_0xd5d7('0x5'));var auth=require(_0xd5d7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd5d7('0x7'));var controller=require('./migration.controller');router[_0xd5d7('0x8')]('/',controller[_0xd5d7('0x9')]);module[_0xd5d7('0xa')]=router;
\ No newline at end of file
index be83181..8013d07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe529=['STRING','version','sequelize'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xe529,0x8c));var _0x9e52=function(_0x4871a9,_0x8e0e9e){_0x4871a9=_0x4871a9-0x0;var _0x43279e=_0xe529[_0x4871a9];return _0x43279e;};'use strict';var Sequelize=require(_0x9e52('0x0'));module['exports']={'version':{'type':Sequelize[_0x9e52('0x1')],'unique':_0x9e52('0x2')}};
\ No newline at end of file
+var _0x68e7=['exports','STRING','sequelize'];(function(_0x48cbfa,_0x80864){var _0x1cea43=function(_0x59a25f){while(--_0x59a25f){_0x48cbfa['push'](_0x48cbfa['shift']());}};_0x1cea43(++_0x80864);}(_0x68e7,0x10d));var _0x768e=function(_0x3ef592,_0x2fcbba){_0x3ef592=_0x3ef592-0x0;var _0x5c6211=_0x68e7[_0x3ef592];return _0x5c6211;};'use strict';var Sequelize=require(_0x768e('0x0'));module[_0x768e('0x1')]={'version':{'type':Sequelize[_0x768e('0x2')],'unique':'version'}};
\ No newline at end of file
index bf0b479..c0ab018 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1260=['model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','Migration','rawAttributes','fieldName','type','key','map','query','filters','intersection'];(function(_0x260d55,_0x25239a){var _0x26c788=function(_0x162323){while(--_0x162323){_0x260d55['push'](_0x260d55['shift']());}};_0x26c788(++_0x25239a);}(_0x1260,0x15d));var _0x0126=function(_0x387a96,_0x9a8506){_0x387a96=_0x387a96-0x0;var _0x1cfdde=_0x1260[_0x387a96];return _0x1cfdde;};'use strict';var emlformat=require(_0x0126('0x0'));var rimraf=require(_0x0126('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0126('0x2'));var rp=require('request-promise');var moment=require(_0x0126('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0126('0x4'));var path=require(_0x0126('0x5'));var sox=require(_0x0126('0x6'));var csv=require(_0x0126('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0126('0x8'));var _=require(_0x0126('0x9'));var squel=require(_0x0126('0xa'));var crypto=require(_0x0126('0xb'));var jsforce=require(_0x0126('0xc'));var deskjs=require(_0x0126('0xd'));var toCsv=require(_0x0126('0x7'));var querystring=require(_0x0126('0xe'));var Papa=require(_0x0126('0xf'));var Redis=require(_0x0126('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0126('0x11'));var hardwareService=require(_0x0126('0x12'));var logger=require(_0x0126('0x13'))(_0x0126('0x14'));var utils=require(_0x0126('0x15'));var config=require(_0x0126('0x16'));var licenseUtil=require(_0x0126('0x17'));var db=require(_0x0126('0x18'))['db'];function respondWithStatusCode(_0xfe826d,_0x192e55){_0x192e55=_0x192e55||0xcc;return function(_0x349005){if(_0x349005){return _0xfe826d[_0x0126('0x19')](_0x192e55);}return _0xfe826d['status'](_0x192e55)[_0x0126('0x1a')]();};}function respondWithResult(_0x316d5a,_0x55cfba){_0x55cfba=_0x55cfba||0xc8;return function(_0x45c2e7){if(_0x45c2e7){return _0x316d5a[_0x0126('0x1b')](_0x55cfba)[_0x0126('0x1c')](_0x45c2e7);}};}function respondWithFilteredResult(_0x389a18,_0x12ba75){return function(_0x121003){if(_0x121003){var _0x45556f=typeof _0x12ba75[_0x0126('0x1d')]===_0x0126('0x1e')&&typeof _0x12ba75[_0x0126('0x1f')]===_0x0126('0x1e');var _0x390588=_0x121003[_0x0126('0x20')];var _0x5aba56=_0x45556f?0x0:_0x12ba75[_0x0126('0x1d')];var _0x466bf0=_0x45556f?_0x121003[_0x0126('0x20')]:_0x12ba75[_0x0126('0x1d')]+_0x12ba75[_0x0126('0x1f')];var _0x40360f;if(_0x466bf0>=_0x390588){_0x466bf0=_0x390588;_0x40360f=0xc8;}else{_0x40360f=0xce;}_0x389a18[_0x0126('0x1b')](_0x40360f);return _0x389a18['set'](_0x0126('0x21'),_0x5aba56+'-'+_0x466bf0+'/'+_0x390588)[_0x0126('0x1c')](_0x121003);}return null;};}function patchUpdates(_0x49ad88){return function(_0x4ae1bc){try{jsonpatch[_0x0126('0x22')](_0x4ae1bc,_0x49ad88,!![]);}catch(_0x217a5f){return BPromise[_0x0126('0x23')](_0x217a5f);}return _0x4ae1bc['save']();};}function saveUpdates(_0x5beed7,_0x18df37){return function(_0x464287){if(_0x464287){return _0x464287[_0x0126('0x24')](_0x5beed7)[_0x0126('0x25')](function(_0x31b4ac){return _0x31b4ac;});}return null;};}function removeEntity(_0xde1aa8,_0x16a315){return function(_0x2ba5e5){if(_0x2ba5e5){return _0x2ba5e5[_0x0126('0x26')]()[_0x0126('0x25')](function(){_0xde1aa8[_0x0126('0x1b')](0xcc)[_0x0126('0x1a')]();});}};}function handleEntityNotFound(_0x4aec8f,_0x4426a0){return function(_0x5e3727){if(!_0x5e3727){_0x4aec8f['sendStatus'](0x194);}return _0x5e3727;};}function handleError(_0x54717b,_0x397708){_0x397708=_0x397708||0x1f4;return function(_0x1fe739){logger[_0x0126('0x27')](_0x1fe739[_0x0126('0x28')]);if(_0x1fe739[_0x0126('0x29')]){delete _0x1fe739['name'];}_0x54717b['status'](_0x397708)[_0x0126('0x2a')](_0x1fe739);};}exports[_0x0126('0x2b')]=function(_0x5325e5,_0xd845d1){var _0x292114={},_0x5cb9bf={},_0x16487e={'count':0x0,'rows':[]};var _0x1bb7da=_['map'](db[_0x0126('0x2c')][_0x0126('0x2d')],function(_0xe4a3c6){return{'name':_0xe4a3c6[_0x0126('0x2e')],'type':_0xe4a3c6[_0x0126('0x2f')][_0x0126('0x30')]};});_0x5cb9bf['model']=_[_0x0126('0x31')](_0x1bb7da,_0x0126('0x29'));_0x5cb9bf[_0x0126('0x32')]=_['keys'](_0x5325e5[_0x0126('0x32')]);_0x5cb9bf[_0x0126('0x33')]=_[_0x0126('0x34')](_0x5cb9bf[_0x0126('0x35')],_0x5cb9bf[_0x0126('0x32')]);_0x292114['attributes']=_['intersection'](_0x5cb9bf[_0x0126('0x35')],qs[_0x0126('0x36')](_0x5325e5[_0x0126('0x32')][_0x0126('0x36')]));_0x292114[_0x0126('0x37')]=_0x292114[_0x0126('0x37')]['length']?_0x292114[_0x0126('0x37')]:_0x5cb9bf['model'];if(!_0x5325e5[_0x0126('0x32')][_0x0126('0x38')](_0x0126('0x39'))){_0x292114[_0x0126('0x1f')]=qs['limit'](_0x5325e5[_0x0126('0x32')][_0x0126('0x1f')]);_0x292114[_0x0126('0x1d')]=qs['offset'](_0x5325e5['query'][_0x0126('0x1d')]);}_0x292114[_0x0126('0x3a')]=qs[_0x0126('0x3b')](_0x5325e5[_0x0126('0x32')][_0x0126('0x3b')]);_0x292114[_0x0126('0x3c')]=qs[_0x0126('0x33')](_[_0x0126('0x3d')](_0x5325e5[_0x0126('0x32')],_0x5cb9bf[_0x0126('0x33')]),_0x1bb7da);if(_0x5325e5['query']['filter']){_0x292114[_0x0126('0x3c')]=_[_0x0126('0x3e')](_0x292114['where'],{'$or':_[_0x0126('0x31')](_0x1bb7da,function(_0x23d463){if(_0x23d463[_0x0126('0x2f')]!==_0x0126('0x3f')){var _0x31e610={};_0x31e610[_0x23d463['name']]={'$like':'%'+_0x5325e5[_0x0126('0x32')]['filter']+'%'};return _0x31e610;}})});}_0x292114=_[_0x0126('0x3e')]({},_0x292114,_0x5325e5['options']);var _0x71d226={'where':_0x292114[_0x0126('0x3c')]};return db[_0x0126('0x2c')][_0x0126('0x20')](_0x71d226)[_0x0126('0x25')](function(_0x28ad08){_0x16487e['count']=_0x28ad08;if(_0x5325e5[_0x0126('0x32')][_0x0126('0x40')]){_0x292114['include']=[{'all':!![]}];}return db[_0x0126('0x2c')][_0x0126('0x41')](_0x292114);})[_0x0126('0x25')](function(_0x3c7cf2){_0x16487e[_0x0126('0x42')]=_0x3c7cf2;return _0x16487e;})[_0x0126('0x25')](respondWithFilteredResult(_0xd845d1,_0x292114))['catch'](handleError(_0xd845d1,null));};
\ No newline at end of file
+var _0x5870=['Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','merge','where','type','VIRTUAL','filter','options','then','includeAll','include','Migration','findAll','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0x5870,0xf7));var _0x0587=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5870[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x0587('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0587('0x1'));var jsonpatch=require(_0x0587('0x2'));var rp=require(_0x0587('0x3'));var moment=require(_0x0587('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0587('0x5'));var path=require(_0x0587('0x6'));var sox=require(_0x0587('0x7'));var csv=require(_0x0587('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0587('0x9'));var _=require(_0x0587('0xa'));var squel=require(_0x0587('0xb'));var crypto=require(_0x0587('0xc'));var jsforce=require(_0x0587('0xd'));var deskjs=require(_0x0587('0xe'));var toCsv=require(_0x0587('0x8'));var querystring=require(_0x0587('0xf'));var Papa=require('papaparse');var Redis=require(_0x0587('0x10'));var authService=require(_0x0587('0x11'));var qs=require(_0x0587('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0587('0x13'));var logger=require(_0x0587('0x14'))(_0x0587('0x15'));var utils=require(_0x0587('0x16'));var config=require(_0x0587('0x17'));var licenseUtil=require(_0x0587('0x18'));var db=require(_0x0587('0x19'))['db'];function respondWithStatusCode(_0x7bfdf9,_0x274fd1){_0x274fd1=_0x274fd1||0xcc;return function(_0x19f723){if(_0x19f723){return _0x7bfdf9['sendStatus'](_0x274fd1);}return _0x7bfdf9[_0x0587('0x1a')](_0x274fd1)[_0x0587('0x1b')]();};}function respondWithResult(_0x5a4970,_0x448101){_0x448101=_0x448101||0xc8;return function(_0x39c745){if(_0x39c745){return _0x5a4970[_0x0587('0x1a')](_0x448101)[_0x0587('0x1c')](_0x39c745);}};}function respondWithFilteredResult(_0x1ccd5d,_0x19e471){return function(_0x47035e){if(_0x47035e){var _0x9e205a=typeof _0x19e471[_0x0587('0x1d')]===_0x0587('0x1e')&&typeof _0x19e471['limit']==='undefined';var _0x484437=_0x47035e[_0x0587('0x1f')];var _0x2b3c1c=_0x9e205a?0x0:_0x19e471['offset'];var _0x5d2e97=_0x9e205a?_0x47035e[_0x0587('0x1f')]:_0x19e471[_0x0587('0x1d')]+_0x19e471['limit'];var _0x44490e;if(_0x5d2e97>=_0x484437){_0x5d2e97=_0x484437;_0x44490e=0xc8;}else{_0x44490e=0xce;}_0x1ccd5d['status'](_0x44490e);return _0x1ccd5d[_0x0587('0x20')](_0x0587('0x21'),_0x2b3c1c+'-'+_0x5d2e97+'/'+_0x484437)['json'](_0x47035e);}return null;};}function patchUpdates(_0x3f3ddb){return function(_0x41e5e1){try{jsonpatch[_0x0587('0x22')](_0x41e5e1,_0x3f3ddb,!![]);}catch(_0x535ad4){return BPromise[_0x0587('0x23')](_0x535ad4);}return _0x41e5e1['save']();};}function saveUpdates(_0x42027c,_0xb8ff52){return function(_0x3280ee){if(_0x3280ee){return _0x3280ee[_0x0587('0x24')](_0x42027c)['then'](function(_0x47324e){return _0x47324e;});}return null;};}function removeEntity(_0x2d2595,_0x18b2df){return function(_0x4b2044){if(_0x4b2044){return _0x4b2044[_0x0587('0x25')]()['then'](function(){_0x2d2595[_0x0587('0x1a')](0xcc)[_0x0587('0x1b')]();});}};}function handleEntityNotFound(_0x3409a9,_0x77bb0d){return function(_0x4139e6){if(!_0x4139e6){_0x3409a9['sendStatus'](0x194);}return _0x4139e6;};}function handleError(_0x3d0f3c,_0x3a3089){_0x3a3089=_0x3a3089||0x1f4;return function(_0x3c1c75){logger[_0x0587('0x26')](_0x3c1c75[_0x0587('0x27')]);if(_0x3c1c75[_0x0587('0x28')]){delete _0x3c1c75[_0x0587('0x28')];}_0x3d0f3c[_0x0587('0x1a')](_0x3a3089)[_0x0587('0x29')](_0x3c1c75);};}exports[_0x0587('0x2a')]=function(_0x296ba0,_0x176357){var _0x4ba387={},_0x2eba2b={},_0x1312b9={'count':0x0,'rows':[]};var _0x26af4e=_[_0x0587('0x2b')](db['Migration']['rawAttributes'],function(_0x132c50){return{'name':_0x132c50[_0x0587('0x2c')],'type':_0x132c50['type'][_0x0587('0x2d')]};});_0x2eba2b[_0x0587('0x2e')]=_[_0x0587('0x2b')](_0x26af4e,_0x0587('0x28'));_0x2eba2b[_0x0587('0x2f')]=_[_0x0587('0x30')](_0x296ba0[_0x0587('0x2f')]);_0x2eba2b['filters']=_['intersection'](_0x2eba2b[_0x0587('0x2e')],_0x2eba2b[_0x0587('0x2f')]);_0x4ba387['attributes']=_[_0x0587('0x31')](_0x2eba2b[_0x0587('0x2e')],qs['fields'](_0x296ba0[_0x0587('0x2f')]['fields']));_0x4ba387[_0x0587('0x32')]=_0x4ba387[_0x0587('0x32')][_0x0587('0x33')]?_0x4ba387[_0x0587('0x32')]:_0x2eba2b['model'];if(!_0x296ba0[_0x0587('0x2f')][_0x0587('0x34')](_0x0587('0x35'))){_0x4ba387[_0x0587('0x36')]=qs[_0x0587('0x36')](_0x296ba0[_0x0587('0x2f')][_0x0587('0x36')]);_0x4ba387[_0x0587('0x1d')]=qs[_0x0587('0x1d')](_0x296ba0['query'][_0x0587('0x1d')]);}_0x4ba387[_0x0587('0x37')]=qs[_0x0587('0x38')](_0x296ba0[_0x0587('0x2f')][_0x0587('0x38')]);_0x4ba387['where']=qs[_0x0587('0x39')](_['pick'](_0x296ba0['query'],_0x2eba2b[_0x0587('0x39')]),_0x26af4e);if(_0x296ba0[_0x0587('0x2f')]['filter']){_0x4ba387['where']=_[_0x0587('0x3a')](_0x4ba387[_0x0587('0x3b')],{'$or':_[_0x0587('0x2b')](_0x26af4e,function(_0x141613){if(_0x141613[_0x0587('0x3c')]!==_0x0587('0x3d')){var _0x1a41a6={};_0x1a41a6[_0x141613[_0x0587('0x28')]]={'$like':'%'+_0x296ba0[_0x0587('0x2f')][_0x0587('0x3e')]+'%'};return _0x1a41a6;}})});}_0x4ba387=_['merge']({},_0x4ba387,_0x296ba0[_0x0587('0x3f')]);var _0x5a6bc9={'where':_0x4ba387[_0x0587('0x3b')]};return db['Migration']['count'](_0x5a6bc9)[_0x0587('0x40')](function(_0x4b539b){_0x1312b9[_0x0587('0x1f')]=_0x4b539b;if(_0x296ba0[_0x0587('0x2f')][_0x0587('0x41')]){_0x4ba387[_0x0587('0x42')]=[{'all':!![]}];}return db[_0x0587('0x43')][_0x0587('0x44')](_0x4ba387);})[_0x0587('0x40')](function(_0x2a343c){_0x1312b9['rows']=_0x2a343c;return _0x1312b9;})['then'](respondWithFilteredResult(_0x176357,_0x4ba387))[_0x0587('0x45')](handleError(_0x176357,null));};
\ No newline at end of file
index 640e530..49cc31a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56cf=['./migration.attributes','exports','define','Migration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x30c7ca,_0x3c5c3c){var _0x52739b=function(_0x4c7f15){while(--_0x4c7f15){_0x30c7ca['push'](_0x30c7ca['shift']());}};_0x52739b(++_0x3c5c3c);}(_0x56cf,0x170));var _0xf56c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56cf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf56c('0x0'));var util=require(_0xf56c('0x1'));var logger=require(_0xf56c('0x2'))(_0xf56c('0x3'));var moment=require(_0xf56c('0x4'));var BPromise=require(_0xf56c('0x5'));var rp=require(_0xf56c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf56c('0x7'));var config=require(_0xf56c('0x8'));var attributes=require(_0xf56c('0x9'));module[_0xf56c('0xa')]=function(_0x9aced6,_0x5c63ca){return _0x9aced6[_0xf56c('0xb')](_0xf56c('0xc'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x951f=['api','moment','bluebird','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger'];(function(_0x565f85,_0x4f7489){var _0x33f6e3=function(_0x33e0c5){while(--_0x33e0c5){_0x565f85['push'](_0x565f85['shift']());}};_0x33f6e3(++_0x4f7489);}(_0x951f,0x72));var _0xf951=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x951f[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0xf951('0x0'));var util=require(_0xf951('0x1'));var logger=require(_0xf951('0x2'))(_0xf951('0x3'));var moment=require(_0xf951('0x4'));var BPromise=require(_0xf951('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf951('0x6'));var config=require(_0xf951('0x7'));var attributes=require(_0xf951('0x8'));module[_0xf951('0x9')]=function(_0x22511c,_0x263f05){return _0x22511c[_0xf951('0xa')](_0xf951('0xb'),attributes,{'tableName':_0xf951('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7af7c7c..865abca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1120=['stringify','error','code','message','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x4203a4,_0x56b4de){var _0x2cc285=function(_0x21318f){while(--_0x21318f){_0x4203a4['push'](_0x4203a4['shift']());}};_0x2cc285(++_0x56b4de);}(_0x1120,0x140));var _0x0112=function(_0x1e6e4e,_0x2b1b09){_0x1e6e4e=_0x1e6e4e-0x0;var _0x3d746b=_0x1120[_0x1e6e4e];return _0x3d746b;};'use strict';var _=require(_0x0112('0x0'));var util=require(_0x0112('0x1'));var moment=require(_0x0112('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0112('0x3'));var logger=require(_0x0112('0x4'))(_0x0112('0x5'));var config=require(_0x0112('0x6'));var jayson=require(_0x0112('0x7'));var client=jayson[_0x0112('0x8')][_0x0112('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40ad0d,_0x31d67a,_0x444422){return new BPromise(function(_0x2fd18c,_0x1e87af){return client['request'](_0x40ad0d,_0x444422)[_0x0112('0xa')](function(_0x26fd2e){logger[_0x0112('0xb')](_0x0112('0xc'),_0x31d67a,_0x0112('0xd'));logger[_0x0112('0xe')](_0x0112('0xf'),_0x31d67a,'request\x20sent',JSON[_0x0112('0x10')](_0x26fd2e));if(_0x26fd2e[_0x0112('0x11')]){if(_0x26fd2e[_0x0112('0x11')][_0x0112('0x12')]===0x1f4){logger['error'](_0x0112('0xc'),_0x31d67a,_0x26fd2e[_0x0112('0x11')][_0x0112('0x13')]);return _0x1e87af(_0x26fd2e[_0x0112('0x11')]['message']);}logger['error'](_0x0112('0xc'),_0x31d67a,_0x26fd2e['error'][_0x0112('0x13')]);return _0x2fd18c(_0x26fd2e['error'][_0x0112('0x13')]);}else{logger[_0x0112('0xb')](_0x0112('0xc'),_0x31d67a,_0x0112('0xd'));_0x2fd18c(_0x26fd2e['result'][_0x0112('0x13')]);}})[_0x0112('0x14')](function(_0x5ef9fe){logger['error']('Migration,\x20%s,\x20%s',_0x31d67a,_0x5ef9fe);_0x1e87af(_0x5ef9fe);});});}
\ No newline at end of file
+var _0x4522=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','../../mysqldb'];(function(_0x460632,_0x2bf513){var _0xb058d1=function(_0x301bf5){while(--_0x301bf5){_0x460632['push'](_0x460632['shift']());}};_0xb058d1(++_0x2bf513);}(_0x4522,0x1a0));var _0x2452=function(_0x52675d,_0x4f07b2){_0x52675d=_0x52675d-0x0;var _0x36b591=_0x4522[_0x52675d];return _0x36b591;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2452('0x0'));var BPromise=require(_0x2452('0x1'));var rs=require(_0x2452('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2452('0x3'))['db'];var utils=require(_0x2452('0x4'));var logger=require(_0x2452('0x5'))(_0x2452('0x6'));var config=require(_0x2452('0x7'));var jayson=require(_0x2452('0x8'));var client=jayson[_0x2452('0x9')][_0x2452('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0139,_0x149807,_0x3bc193){return new BPromise(function(_0x33b935,_0x24073f){return client[_0x2452('0xb')](_0x2f0139,_0x3bc193)[_0x2452('0xc')](function(_0x2995b5){logger['info']('Migration,\x20%s,\x20%s',_0x149807,_0x2452('0xd'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x149807,_0x2452('0xd'),JSON[_0x2452('0xe')](_0x2995b5));if(_0x2995b5[_0x2452('0xf')]){if(_0x2995b5[_0x2452('0xf')][_0x2452('0x10')]===0x1f4){logger[_0x2452('0xf')](_0x2452('0x11'),_0x149807,_0x2995b5[_0x2452('0xf')]['message']);return _0x24073f(_0x2995b5['error']['message']);}logger[_0x2452('0xf')]('Migration,\x20%s,\x20%s',_0x149807,_0x2995b5[_0x2452('0xf')]['message']);return _0x33b935(_0x2995b5[_0x2452('0xf')][_0x2452('0x12')]);}else{logger['info'](_0x2452('0x11'),_0x149807,'request\x20sent');_0x33b935(_0x2995b5[_0x2452('0x13')][_0x2452('0x12')]);}})[_0x2452('0x14')](function(_0xdede20){logger['error'](_0x2452('0x11'),_0x149807,_0xdede20);_0x24073f(_0xdede20);});});}
\ No newline at end of file
index e51a3c7..8c21c3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf40=['/:id','show','create','put','delete','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xbf40,0x1f4));var _0x0bf4=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xbf40[_0x45783c];return _0x1161da;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0bf4('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0bf4('0x1')]();var fs_extra=require(_0x0bf4('0x2'));var auth=require(_0x0bf4('0x3'));var interaction=require(_0x0bf4('0x4'));var config=require(_0x0bf4('0x5'));var controller=require(_0x0bf4('0x6'));router[_0x0bf4('0x7')]('/',auth[_0x0bf4('0x8')](),controller[_0x0bf4('0x9')]);router[_0x0bf4('0x7')](_0x0bf4('0xa'),auth['isAuthenticated'](),controller[_0x0bf4('0xb')]);router['post']('/',auth[_0x0bf4('0x8')](),controller[_0x0bf4('0xc')]);router[_0x0bf4('0xd')](_0x0bf4('0xa'),auth[_0x0bf4('0x8')](),controller['update']);router[_0x0bf4('0xe')](_0x0bf4('0xa'),auth[_0x0bf4('0x8')](),controller[_0x0bf4('0xf')]);module[_0x0bf4('0x10')]=router;
\ No newline at end of file
+var _0xbbaf=['show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id'];(function(_0x4f8873,_0x10483b){var _0x575d6d=function(_0x4ec8e6){while(--_0x4ec8e6){_0x4f8873['push'](_0x4f8873['shift']());}};_0x575d6d(++_0x10483b);}(_0xbbaf,0x158));var _0xfbba=function(_0x17e069,_0x3a0dfd){_0x17e069=_0x17e069-0x0;var _0x461041=_0xbbaf[_0x17e069];return _0x461041;};'use strict';var multer=require(_0xfbba('0x0'));var util=require(_0xfbba('0x1'));var path=require(_0xfbba('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfbba('0x3')]();var fs_extra=require(_0xfbba('0x4'));var auth=require(_0xfbba('0x5'));var interaction=require(_0xfbba('0x6'));var config=require(_0xfbba('0x7'));var controller=require(_0xfbba('0x8'));router[_0xfbba('0x9')]('/',auth[_0xfbba('0xa')](),controller[_0xfbba('0xb')]);router[_0xfbba('0x9')](_0xfbba('0xc'),auth[_0xfbba('0xa')](),controller[_0xfbba('0xd')]);router[_0xfbba('0xe')]('/',auth[_0xfbba('0xa')](),controller[_0xfbba('0xf')]);router[_0xfbba('0x10')](_0xfbba('0xc'),auth[_0xfbba('0xa')](),controller[_0xfbba('0x11')]);router[_0xfbba('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xfbba('0x13')]);module[_0xfbba('0x14')]=router;
\ No newline at end of file
index f962eee..4589855 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad25=['localnet','externip','turn','sequelize','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xad25,0xcb));var _0x5ad2=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xad25[_0x599f41];return _0x2e4d58;};'use strict';var Sequelize=require(_0x5ad2('0x0'));module[_0x5ad2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5ad2('0x2'),_0x5ad2('0x3'),'stun',_0x5ad2('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf033=['sequelize','localnet','stun','turn','STRING'];(function(_0x294f4d,_0x35032d){var _0x3519ce=function(_0x3b2115){while(--_0x3b2115){_0x294f4d['push'](_0x294f4d['shift']());}};_0x3519ce(++_0x35032d);}(_0xf033,0xc8));var _0x3f03=function(_0x23a971,_0x70b461){_0x23a971=_0x23a971-0x0;var _0x36c6d3=_0xf033[_0x23a971];return _0x36c6d3;};'use strict';var Sequelize=require(_0x3f03('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x3f03('0x1'),'externip',_0x3f03('0x2'),_0x3f03('0x3'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x3f03('0x4')]}};
\ No newline at end of file
index 7e4ddfb..48cec37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2029=['filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','Network','include','find','catch','create','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','join','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','transaction','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','save','destroy','name','send','map','rawAttributes','fieldName','type','query','keys'];(function(_0x4934aa,_0x55d2a3){var _0x59dd38=function(_0x306717){while(--_0x306717){_0x4934aa['push'](_0x4934aa['shift']());}};_0x59dd38(++_0x55d2a3);}(_0x2029,0x171));var _0x9202=function(_0x174363,_0x9477c){_0x174363=_0x174363-0x0;var _0x329ae3=_0x2029[_0x174363];return _0x329ae3;};'use strict';var emlformat=require(_0x9202('0x0'));var rimraf=require(_0x9202('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9202('0x2'));var rp=require(_0x9202('0x3'));var moment=require(_0x9202('0x4'));var BPromise=require(_0x9202('0x5'));var Mustache=require(_0x9202('0x6'));var util=require(_0x9202('0x7'));var path=require(_0x9202('0x8'));var sox=require(_0x9202('0x9'));var csv=require(_0x9202('0xa'));var ejs=require(_0x9202('0xb'));var fs=require('fs');var fs_extra=require(_0x9202('0xc'));var _=require(_0x9202('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9202('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9202('0xa'));var querystring=require(_0x9202('0xf'));var Papa=require('papaparse');var Redis=require(_0x9202('0x10'));var authService=require(_0x9202('0x11'));var qs=require(_0x9202('0x12'));var as=require(_0x9202('0x13'));var hardwareService=require(_0x9202('0x14'));var logger=require(_0x9202('0x15'))(_0x9202('0x16'));var utils=require(_0x9202('0x17'));var config=require(_0x9202('0x18'));var licenseUtil=require(_0x9202('0x19'));var db=require(_0x9202('0x1a'))['db'];var jayson=require(_0x9202('0x1b'));var client=jayson[_0x9202('0x1c')][_0x9202('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1890ac,_0x4093bc,_0x152ef0,_0x597e0f){return new BPromise(function(_0x45cec7,_0x24e8fe){var _0x22e15d=_0x597e0f||client;return _0x22e15d[_0x9202('0x1e')](_0x1890ac,_0x152ef0)[_0x9202('0x1f')](function(_0x141a17){logger[_0x9202('0x20')](_0x9202('0x21'),_0x4093bc,_0x9202('0x22'));logger[_0x9202('0x23')]('Network,\x20%s,\x20%s,\x20%s',_0x4093bc,_0x9202('0x22'),JSON[_0x9202('0x24')](_0x141a17));if(_0x141a17[_0x9202('0x25')]){if(_0x141a17[_0x9202('0x25')][_0x9202('0x26')]===0x1f4){logger[_0x9202('0x25')](_0x9202('0x21'),_0x4093bc,_0x141a17[_0x9202('0x25')][_0x9202('0x27')]);return _0x24e8fe(_0x141a17['error']['message']);}logger[_0x9202('0x25')](_0x9202('0x21'),_0x4093bc,_0x141a17[_0x9202('0x25')][_0x9202('0x27')]);return _0x45cec7(_0x141a17['error'][_0x9202('0x27')]);}else{logger['info'](_0x9202('0x21'),_0x4093bc,_0x9202('0x22'));_0x45cec7(_0x141a17['result'][_0x9202('0x27')]);}})['catch'](function(_0x2b0ef1){logger[_0x9202('0x25')](_0x9202('0x21'),_0x4093bc,_0x2b0ef1);_0x24e8fe(_0x2b0ef1);});});}function respondWithStatusCode(_0x35fbf8,_0x2cdeb8){_0x2cdeb8=_0x2cdeb8||0xcc;return function(_0xf535c6){if(_0xf535c6){return _0x35fbf8[_0x9202('0x28')](_0x2cdeb8);}return _0x35fbf8['status'](_0x2cdeb8)[_0x9202('0x29')]();};}function respondWithResult(_0x22c330,_0x2dab50){_0x2dab50=_0x2dab50||0xc8;return function(_0x2f4988){if(_0x2f4988){return _0x22c330[_0x9202('0x2a')](_0x2dab50)[_0x9202('0x2b')](_0x2f4988);}};}function respondWithFilteredResult(_0x547328,_0x42756e){return function(_0x2484ef){if(_0x2484ef){var _0x3ecfc6=typeof _0x42756e['offset']==='undefined'&&typeof _0x42756e['limit']===_0x9202('0x2c');var _0x17d7e8=_0x2484ef[_0x9202('0x2d')];var _0x5459a0=_0x3ecfc6?0x0:_0x42756e[_0x9202('0x2e')];var _0x5e9ca2=_0x3ecfc6?_0x2484ef[_0x9202('0x2d')]:_0x42756e[_0x9202('0x2e')]+_0x42756e[_0x9202('0x2f')];var _0x1223a4;if(_0x5e9ca2>=_0x17d7e8){_0x5e9ca2=_0x17d7e8;_0x1223a4=0xc8;}else{_0x1223a4=0xce;}_0x547328[_0x9202('0x2a')](_0x1223a4);return _0x547328['set'](_0x9202('0x30'),_0x5459a0+'-'+_0x5e9ca2+'/'+_0x17d7e8)['json'](_0x2484ef);}return null;};}function patchUpdates(_0x1666ed){return function(_0x390f8f){try{jsonpatch['apply'](_0x390f8f,_0x1666ed,!![]);}catch(_0x5b4170){return BPromise['reject'](_0x5b4170);}return _0x390f8f[_0x9202('0x31')]();};}function saveUpdates(_0xbe9701,_0x251254){return function(_0x3766ce){if(_0x3766ce){return _0x3766ce['update'](_0xbe9701)[_0x9202('0x1f')](function(_0x1c0d75){return _0x1c0d75;});}return null;};}function removeEntity(_0x15591f,_0x4e7c30){return function(_0x2de068){if(_0x2de068){return _0x2de068[_0x9202('0x32')]()[_0x9202('0x1f')](function(){_0x15591f[_0x9202('0x2a')](0xcc)[_0x9202('0x29')]();});}};}function handleEntityNotFound(_0x46519a,_0xa4564a){return function(_0x46d641){if(!_0x46d641){_0x46519a[_0x9202('0x28')](0x194);}return _0x46d641;};}function handleError(_0x2bf740,_0x26697a){_0x26697a=_0x26697a||0x1f4;return function(_0x3f34ca){logger[_0x9202('0x25')](_0x3f34ca['stack']);if(_0x3f34ca[_0x9202('0x33')]){delete _0x3f34ca[_0x9202('0x33')];}_0x2bf740['status'](_0x26697a)[_0x9202('0x34')](_0x3f34ca);};}exports['index']=function(_0x9ce64,_0x265220){var _0x3308e4={},_0x3c4c1f={},_0xd688c6={'count':0x0,'rows':[]};var _0x538109=_[_0x9202('0x35')](db['Network'][_0x9202('0x36')],function(_0xc0da2a){return{'name':_0xc0da2a[_0x9202('0x37')],'type':_0xc0da2a[_0x9202('0x38')]['key']};});_0x3c4c1f['model']=_['map'](_0x538109,_0x9202('0x33'));_0x3c4c1f[_0x9202('0x39')]=_[_0x9202('0x3a')](_0x9ce64[_0x9202('0x39')]);_0x3c4c1f[_0x9202('0x3b')]=_['intersection'](_0x3c4c1f[_0x9202('0x3c')],_0x3c4c1f[_0x9202('0x39')]);_0x3308e4[_0x9202('0x3d')]=_[_0x9202('0x3e')](_0x3c4c1f[_0x9202('0x3c')],qs['fields'](_0x9ce64[_0x9202('0x39')][_0x9202('0x3f')]));_0x3308e4[_0x9202('0x3d')]=_0x3308e4[_0x9202('0x3d')][_0x9202('0x40')]?_0x3308e4[_0x9202('0x3d')]:_0x3c4c1f['model'];if(!_0x9ce64[_0x9202('0x39')][_0x9202('0x41')](_0x9202('0x42'))){_0x3308e4[_0x9202('0x2f')]=qs[_0x9202('0x2f')](_0x9ce64['query'][_0x9202('0x2f')]);_0x3308e4[_0x9202('0x2e')]=qs[_0x9202('0x2e')](_0x9ce64[_0x9202('0x39')]['offset']);}_0x3308e4[_0x9202('0x43')]=qs['sort'](_0x9ce64[_0x9202('0x39')][_0x9202('0x44')]);_0x3308e4['where']=qs['filters'](_[_0x9202('0x45')](_0x9ce64['query'],_0x3c4c1f[_0x9202('0x3b')]),_0x538109);if(_0x9ce64[_0x9202('0x39')][_0x9202('0x46')]){_0x3308e4[_0x9202('0x47')]=_[_0x9202('0x48')](_0x3308e4[_0x9202('0x47')],{'$or':_['map'](_0x538109,function(_0x725c70){if(_0x725c70[_0x9202('0x38')]!==_0x9202('0x49')){var _0x2327b1={};_0x2327b1[_0x725c70['name']]={'$like':'%'+_0x9ce64['query'][_0x9202('0x46')]+'%'};return _0x2327b1;}})});}_0x3308e4=_[_0x9202('0x48')]({},_0x3308e4,_0x9ce64[_0x9202('0x4a')]);var _0x5c1930={'where':_0x3308e4['where']};return db['Network'][_0x9202('0x2d')](_0x5c1930)[_0x9202('0x1f')](function(_0x36b6c9){_0xd688c6[_0x9202('0x2d')]=_0x36b6c9;if(_0x9ce64[_0x9202('0x39')][_0x9202('0x4b')]){_0x3308e4['include']=[{'all':!![]}];}return db['Network'][_0x9202('0x4c')](_0x3308e4);})[_0x9202('0x1f')](function(_0x132b50){_0xd688c6[_0x9202('0x4d')]=_0x132b50;return _0xd688c6;})['then'](respondWithFilteredResult(_0x265220,_0x3308e4))['catch'](handleError(_0x265220,null));};exports['show']=function(_0x448784,_0x411c3a){var _0x4b9d05={'raw':!![],'where':{'id':_0x448784[_0x9202('0x4e')]['id']}},_0x2b12a7={};_0x2b12a7[_0x9202('0x3c')]=_[_0x9202('0x3a')](db[_0x9202('0x4f')][_0x9202('0x36')]);_0x2b12a7[_0x9202('0x39')]=_['keys'](_0x448784[_0x9202('0x39')]);_0x2b12a7[_0x9202('0x3b')]=_[_0x9202('0x3e')](_0x2b12a7['model'],_0x2b12a7[_0x9202('0x39')]);_0x4b9d05[_0x9202('0x3d')]=_[_0x9202('0x3e')](_0x2b12a7[_0x9202('0x3c')],qs['fields'](_0x448784[_0x9202('0x39')]['fields']));_0x4b9d05[_0x9202('0x3d')]=_0x4b9d05[_0x9202('0x3d')][_0x9202('0x40')]?_0x4b9d05[_0x9202('0x3d')]:_0x2b12a7[_0x9202('0x3c')];if(_0x448784[_0x9202('0x39')][_0x9202('0x4b')]){_0x4b9d05[_0x9202('0x50')]=[{'all':!![]}];}_0x4b9d05=_[_0x9202('0x48')]({},_0x4b9d05,_0x448784[_0x9202('0x4a')]);return db[_0x9202('0x4f')][_0x9202('0x51')](_0x4b9d05)[_0x9202('0x1f')](handleEntityNotFound(_0x411c3a,null))[_0x9202('0x1f')](respondWithResult(_0x411c3a,null))[_0x9202('0x52')](handleError(_0x411c3a,null));};exports[_0x9202('0x53')]=function(_0xc366dc,_0x5cbe49,_0x5e072c){var _0xba47e7;return db['sequelize']['transaction'](function(_0xf9757){return db[_0x9202('0x4f')][_0x9202('0x53')](_0xc366dc[_0x9202('0x54')],{'raw':!![]})['then'](function(_0x38f8cf){_0xba47e7=_0x38f8cf;return db[_0x9202('0x4f')][_0x9202('0x4c')]({'where':{'type':_0xc366dc[_0x9202('0x54')][_0x9202('0x38')]},'raw':!![]});})['then'](function(_0x2b2724){if(_0xba47e7[_0x9202('0x38')][_0x9202('0x55')]()==_0x9202('0x56')){var _0x5b0ece=fs[_0x9202('0x57')](path['join'](config[_0x9202('0x58')],_0x9202('0x59')),_0x9202('0x5a'));var _0x556031=ejs[_0x9202('0x5b')](_0x5b0ece,{'networks':_0x2b2724||[]});fs[_0x9202('0x5c')](_0x9202('0x5d'),_0x556031);return respondWithRpcPromise(_0x9202('0x5e'),'create',{'module':'res_stun_monitor.so'});}else if(_0xba47e7[_0x9202('0x38')][_0x9202('0x55')]()==_0x9202('0x5f')){var _0x6e1b88=fs[_0x9202('0x57')](path[_0x9202('0x60')](config['root'],_0x9202('0x61')),_0x9202('0x5a'));var _0x5689cf=ejs[_0x9202('0x5b')](_0x6e1b88,{'networks':_0x2b2724||[]});fs[_0x9202('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x5689cf);return respondWithRpcPromise('Reload',_0x9202('0x53'),{'module':'res_stun_monitor.so'});}else{var _0x590f9f=fs[_0x9202('0x57')](path[_0x9202('0x60')](config[_0x9202('0x58')],_0x9202('0x62')),_0x9202('0x5a'));var _0x1e6be4=ejs[_0x9202('0x5b')](_0x590f9f,{'networks':_0x2b2724||[]});fs[_0x9202('0x5c')](util[_0x9202('0x63')](_0x9202('0x64'),_0xc366dc[_0x9202('0x54')][_0x9202('0x38')][_0x9202('0x65')]()),_0x1e6be4);return respondWithRpcPromise(_0x9202('0x5e'),_0x9202('0x53'),{'module':_0x9202('0x66')});}return null;})[_0x9202('0x1f')](function(){return _0xba47e7;});})[_0x9202('0x1f')](respondWithResult(_0x5cbe49,0xc9))['catch'](handleError(_0x5cbe49,null));};exports[_0x9202('0x67')]=function(_0xdef345,_0x3013bf,_0x28e852){var _0x24d03b;return db['sequelize'][_0x9202('0x68')](function(_0x2e84c9){return db[_0x9202('0x4f')][_0x9202('0x51')]({'where':{'id':_0xdef345['params']['id']}})[_0x9202('0x1f')](handleEntityNotFound(_0x3013bf,null))['then'](saveUpdates(_0xdef345[_0x9202('0x54')],null))[_0x9202('0x1f')](function(_0x5209ba){if(_0x5209ba){_0x24d03b=_0x5209ba;return db[_0x9202('0x4f')][_0x9202('0x4c')]({'where':{'type':_0x24d03b['type']},'raw':!![]});}return null;})[_0x9202('0x1f')](function(_0x12b935){if(_0x24d03b[_0x9202('0x38')][_0x9202('0x55')]()==_0x9202('0x56')){var _0x1a552b=fs[_0x9202('0x57')](path[_0x9202('0x60')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x9202('0x5a'));var _0x409167=ejs[_0x9202('0x5b')](_0x1a552b,{'networks':_0x12b935||[]});fs[_0x9202('0x5c')](_0x9202('0x5d'),_0x409167);return respondWithRpcPromise(_0x9202('0x5e'),_0x9202('0x67'),{'module':'res_stun_monitor.so'});}else if(_0x24d03b[_0x9202('0x38')][_0x9202('0x55')]()==_0x9202('0x5f')){var _0x562719=fs[_0x9202('0x57')](path[_0x9202('0x60')](config[_0x9202('0x58')],'server/files/templates/turn_multiple.ejs'),_0x9202('0x5a'));var _0xc4cdee=ejs[_0x9202('0x5b')](_0x562719,{'networks':_0x12b935||[]});fs['writeFileSync'](_0x9202('0x69'),_0xc4cdee);return respondWithRpcPromise(_0x9202('0x5e'),'update',{'module':_0x9202('0x6a')});}else{var _0x9bdac9=fs[_0x9202('0x57')](path[_0x9202('0x60')](config[_0x9202('0x58')],'server/files/templates/network.ejs'),_0x9202('0x5a'));var _0x13135f=ejs[_0x9202('0x5b')](_0x9bdac9,{'networks':_0x12b935||[]});fs[_0x9202('0x5c')](util[_0x9202('0x63')](_0x9202('0x64'),_0xdef345[_0x9202('0x54')][_0x9202('0x38')][_0x9202('0x65')]()),_0x13135f);return respondWithRpcPromise('Reload','update',{'module':_0x9202('0x66')});}return null;})['then'](function(_0x2e3f76){if(_0x2e3f76){return _0x24d03b;}return null;});})[_0x9202('0x1f')](respondWithResult(_0x3013bf,null))[_0x9202('0x52')](handleError(_0x3013bf,null));};exports['destroy']=function(_0xbc1c7b,_0x1c267e,_0x1563ce){var _0x4794ed;return db[_0x9202('0x4f')][_0x9202('0x51')]({'where':{'id':_0xbc1c7b[_0x9202('0x4e')]['id']}})[_0x9202('0x1f')](function(_0x13b3c8){_0x4794ed=_0x13b3c8;return _0x13b3c8;})['then'](handleEntityNotFound(_0x1c267e,null))[_0x9202('0x1f')](removeEntity(_0x1c267e,null))[_0x9202('0x1f')](function(){if(_0x4794ed){return db[_0x9202('0x4f')][_0x9202('0x4c')]({'where':{'type':_0x4794ed[_0x9202('0x38')]},'raw':!![]});}})['then'](function(_0x151838){if(_0x4794ed[_0x9202('0x38')]['toUpperCase']()==_0x9202('0x56')){var _0x44d1c5=fs[_0x9202('0x57')](path[_0x9202('0x60')](config[_0x9202('0x58')],_0x9202('0x59')),_0x9202('0x5a'));var _0x25c6a4=ejs[_0x9202('0x5b')](_0x44d1c5,{'networks':_0x151838||[]});fs[_0x9202('0x5c')](_0x9202('0x5d'),_0x25c6a4);return respondWithRpcPromise(_0x9202('0x5e'),_0x9202('0x32'),{'module':_0x9202('0x6a')});}else if(_0x4794ed[_0x9202('0x38')]['toUpperCase']()==_0x9202('0x5f')){var _0x349809=fs[_0x9202('0x57')](path[_0x9202('0x60')](config[_0x9202('0x58')],'server/files/templates/turn_multiple.ejs'),_0x9202('0x5a'));var _0x1163ee=ejs[_0x9202('0x5b')](_0x349809,{'networks':_0x151838||[]});fs[_0x9202('0x5c')](_0x9202('0x69'),_0x1163ee);return respondWithRpcPromise('Reload',_0x9202('0x32'),{'module':_0x9202('0x6a')});}else{var _0x3b7e14=fs[_0x9202('0x57')](path[_0x9202('0x60')](config[_0x9202('0x58')],'server/files/templates/network.ejs'),_0x9202('0x5a'));var _0x513a67=ejs['render'](_0x3b7e14,{'networks':_0x151838||[]});fs[_0x9202('0x5c')](util[_0x9202('0x63')]('/etc/asterisk/sip_xcally_%s.conf',_0xbc1c7b[_0x9202('0x54')][_0x9202('0x38')][_0x9202('0x65')]()),_0x513a67);return respondWithRpcPromise('Reload',_0x9202('0x32'),{'module':_0x9202('0x66')});}return null;})['catch'](handleError(_0x1c267e,null));};
\ No newline at end of file
+var _0xa5b4=['options','Network','includeAll','include','findAll','rows','keys','length','find','create','sequelize','transaction','body','STUN','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','toUpperCase','TURN','readFileSync','join','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','jayson/promise','client','http','Network,\x20%s,\x20%s','request\x20sent','debug','error','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x20d688,_0xa63340){var _0x95d018=function(_0x3c4bba){while(--_0x3c4bba){_0x20d688['push'](_0x20d688['shift']());}};_0x95d018(++_0xa63340);}(_0xa5b4,0xf4));var _0x4a5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5b4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a5b('0x0'));var zipdir=require(_0x4a5b('0x1'));var jsonpatch=require(_0x4a5b('0x2'));var rp=require(_0x4a5b('0x3'));var moment=require(_0x4a5b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4a5b('0x5'));var util=require(_0x4a5b('0x6'));var path=require(_0x4a5b('0x7'));var sox=require(_0x4a5b('0x8'));var csv=require(_0x4a5b('0x9'));var ejs=require(_0x4a5b('0xa'));var fs=require('fs');var fs_extra=require(_0x4a5b('0xb'));var _=require(_0x4a5b('0xc'));var squel=require(_0x4a5b('0xd'));var crypto=require(_0x4a5b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4a5b('0xf'));var toCsv=require(_0x4a5b('0x9'));var querystring=require(_0x4a5b('0x10'));var Papa=require(_0x4a5b('0x11'));var Redis=require(_0x4a5b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4a5b('0x13'));var as=require(_0x4a5b('0x14'));var hardwareService=require(_0x4a5b('0x15'));var logger=require(_0x4a5b('0x16'))(_0x4a5b('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4a5b('0x18'))['db'];var jayson=require(_0x4a5b('0x19'));var client=jayson[_0x4a5b('0x1a')][_0x4a5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xe6d671,_0xb0021b,_0x58814e,_0x295d0e){return new BPromise(function(_0x1863ff,_0x29c184){var _0x1932cd=_0x295d0e||client;return _0x1932cd['request'](_0xe6d671,_0x58814e)['then'](function(_0x1640f7){logger['info'](_0x4a5b('0x1c'),_0xb0021b,_0x4a5b('0x1d'));logger[_0x4a5b('0x1e')]('Network,\x20%s,\x20%s,\x20%s',_0xb0021b,_0x4a5b('0x1d'),JSON['stringify'](_0x1640f7));if(_0x1640f7['error']){if(_0x1640f7[_0x4a5b('0x1f')]['code']===0x1f4){logger[_0x4a5b('0x1f')](_0x4a5b('0x1c'),_0xb0021b,_0x1640f7[_0x4a5b('0x1f')][_0x4a5b('0x20')]);return _0x29c184(_0x1640f7[_0x4a5b('0x1f')][_0x4a5b('0x20')]);}logger[_0x4a5b('0x1f')](_0x4a5b('0x1c'),_0xb0021b,_0x1640f7[_0x4a5b('0x1f')]['message']);return _0x1863ff(_0x1640f7[_0x4a5b('0x1f')][_0x4a5b('0x20')]);}else{logger[_0x4a5b('0x21')](_0x4a5b('0x1c'),_0xb0021b,_0x4a5b('0x1d'));_0x1863ff(_0x1640f7['result'][_0x4a5b('0x20')]);}})[_0x4a5b('0x22')](function(_0xee2c0b){logger['error'](_0x4a5b('0x1c'),_0xb0021b,_0xee2c0b);_0x29c184(_0xee2c0b);});});}function respondWithStatusCode(_0x3011ee,_0x108061){_0x108061=_0x108061||0xcc;return function(_0x2ea4fb){if(_0x2ea4fb){return _0x3011ee[_0x4a5b('0x23')](_0x108061);}return _0x3011ee[_0x4a5b('0x24')](_0x108061)[_0x4a5b('0x25')]();};}function respondWithResult(_0x339376,_0x33774b){_0x33774b=_0x33774b||0xc8;return function(_0x81db09){if(_0x81db09){return _0x339376[_0x4a5b('0x24')](_0x33774b)[_0x4a5b('0x26')](_0x81db09);}};}function respondWithFilteredResult(_0x323689,_0x5e97a3){return function(_0x55d013){if(_0x55d013){var _0x2bf2e2=typeof _0x5e97a3[_0x4a5b('0x27')]===_0x4a5b('0x28')&&typeof _0x5e97a3[_0x4a5b('0x29')]==='undefined';var _0xc6a08f=_0x55d013[_0x4a5b('0x2a')];var _0x188053=_0x2bf2e2?0x0:_0x5e97a3[_0x4a5b('0x27')];var _0x47f4d0=_0x2bf2e2?_0x55d013['count']:_0x5e97a3[_0x4a5b('0x27')]+_0x5e97a3[_0x4a5b('0x29')];var _0x4d98fc;if(_0x47f4d0>=_0xc6a08f){_0x47f4d0=_0xc6a08f;_0x4d98fc=0xc8;}else{_0x4d98fc=0xce;}_0x323689[_0x4a5b('0x24')](_0x4d98fc);return _0x323689[_0x4a5b('0x2b')](_0x4a5b('0x2c'),_0x188053+'-'+_0x47f4d0+'/'+_0xc6a08f)[_0x4a5b('0x26')](_0x55d013);}return null;};}function patchUpdates(_0x7b52cd){return function(_0x2d3bbc){try{jsonpatch[_0x4a5b('0x2d')](_0x2d3bbc,_0x7b52cd,!![]);}catch(_0x2b65bd){return BPromise['reject'](_0x2b65bd);}return _0x2d3bbc['save']();};}function saveUpdates(_0x301463,_0x106e19){return function(_0x4ed004){if(_0x4ed004){return _0x4ed004[_0x4a5b('0x2e')](_0x301463)[_0x4a5b('0x2f')](function(_0x3b93b8){return _0x3b93b8;});}return null;};}function removeEntity(_0x225789,_0x530a52){return function(_0x2a36e3){if(_0x2a36e3){return _0x2a36e3[_0x4a5b('0x30')]()[_0x4a5b('0x2f')](function(){_0x225789[_0x4a5b('0x24')](0xcc)[_0x4a5b('0x25')]();});}};}function handleEntityNotFound(_0x9661ad,_0x2def31){return function(_0x26e690){if(!_0x26e690){_0x9661ad['sendStatus'](0x194);}return _0x26e690;};}function handleError(_0x22d4fe,_0x1b0ff1){_0x1b0ff1=_0x1b0ff1||0x1f4;return function(_0x181c20){logger[_0x4a5b('0x1f')](_0x181c20[_0x4a5b('0x31')]);if(_0x181c20[_0x4a5b('0x32')]){delete _0x181c20['name'];}_0x22d4fe['status'](_0x1b0ff1)[_0x4a5b('0x33')](_0x181c20);};}exports[_0x4a5b('0x34')]=function(_0x5c60aa,_0x1009b7){var _0x3dcdf7={},_0x5ad202={},_0xcf07c2={'count':0x0,'rows':[]};var _0x51a4ea=_[_0x4a5b('0x35')](db['Network'][_0x4a5b('0x36')],function(_0x2c0999){return{'name':_0x2c0999['fieldName'],'type':_0x2c0999['type'][_0x4a5b('0x37')]};});_0x5ad202[_0x4a5b('0x38')]=_[_0x4a5b('0x35')](_0x51a4ea,_0x4a5b('0x32'));_0x5ad202['query']=_['keys'](_0x5c60aa[_0x4a5b('0x39')]);_0x5ad202[_0x4a5b('0x3a')]=_[_0x4a5b('0x3b')](_0x5ad202['model'],_0x5ad202[_0x4a5b('0x39')]);_0x3dcdf7[_0x4a5b('0x3c')]=_[_0x4a5b('0x3b')](_0x5ad202[_0x4a5b('0x38')],qs[_0x4a5b('0x3d')](_0x5c60aa[_0x4a5b('0x39')][_0x4a5b('0x3d')]));_0x3dcdf7[_0x4a5b('0x3c')]=_0x3dcdf7[_0x4a5b('0x3c')]['length']?_0x3dcdf7['attributes']:_0x5ad202['model'];if(!_0x5c60aa[_0x4a5b('0x39')][_0x4a5b('0x3e')](_0x4a5b('0x3f'))){_0x3dcdf7[_0x4a5b('0x29')]=qs[_0x4a5b('0x29')](_0x5c60aa[_0x4a5b('0x39')]['limit']);_0x3dcdf7[_0x4a5b('0x27')]=qs['offset'](_0x5c60aa[_0x4a5b('0x39')][_0x4a5b('0x27')]);}_0x3dcdf7['order']=qs[_0x4a5b('0x40')](_0x5c60aa[_0x4a5b('0x39')]['sort']);_0x3dcdf7[_0x4a5b('0x41')]=qs[_0x4a5b('0x3a')](_[_0x4a5b('0x42')](_0x5c60aa[_0x4a5b('0x39')],_0x5ad202[_0x4a5b('0x3a')]),_0x51a4ea);if(_0x5c60aa[_0x4a5b('0x39')][_0x4a5b('0x43')]){_0x3dcdf7[_0x4a5b('0x41')]=_[_0x4a5b('0x44')](_0x3dcdf7[_0x4a5b('0x41')],{'$or':_[_0x4a5b('0x35')](_0x51a4ea,function(_0x15796f){if(_0x15796f[_0x4a5b('0x45')]!==_0x4a5b('0x46')){var _0x1b9d84={};_0x1b9d84[_0x15796f['name']]={'$like':'%'+_0x5c60aa[_0x4a5b('0x39')][_0x4a5b('0x43')]+'%'};return _0x1b9d84;}})});}_0x3dcdf7=_[_0x4a5b('0x44')]({},_0x3dcdf7,_0x5c60aa[_0x4a5b('0x47')]);var _0x11f076={'where':_0x3dcdf7[_0x4a5b('0x41')]};return db[_0x4a5b('0x48')][_0x4a5b('0x2a')](_0x11f076)[_0x4a5b('0x2f')](function(_0x2a7f88){_0xcf07c2['count']=_0x2a7f88;if(_0x5c60aa['query'][_0x4a5b('0x49')]){_0x3dcdf7[_0x4a5b('0x4a')]=[{'all':!![]}];}return db[_0x4a5b('0x48')][_0x4a5b('0x4b')](_0x3dcdf7);})[_0x4a5b('0x2f')](function(_0x500a25){_0xcf07c2[_0x4a5b('0x4c')]=_0x500a25;return _0xcf07c2;})[_0x4a5b('0x2f')](respondWithFilteredResult(_0x1009b7,_0x3dcdf7))[_0x4a5b('0x22')](handleError(_0x1009b7,null));};exports['show']=function(_0x57fb3a,_0x765b91){var _0x290e1e={'raw':!![],'where':{'id':_0x57fb3a['params']['id']}},_0x2b0833={};_0x2b0833[_0x4a5b('0x38')]=_[_0x4a5b('0x4d')](db[_0x4a5b('0x48')][_0x4a5b('0x36')]);_0x2b0833['query']=_[_0x4a5b('0x4d')](_0x57fb3a[_0x4a5b('0x39')]);_0x2b0833[_0x4a5b('0x3a')]=_['intersection'](_0x2b0833[_0x4a5b('0x38')],_0x2b0833[_0x4a5b('0x39')]);_0x290e1e[_0x4a5b('0x3c')]=_['intersection'](_0x2b0833[_0x4a5b('0x38')],qs[_0x4a5b('0x3d')](_0x57fb3a[_0x4a5b('0x39')][_0x4a5b('0x3d')]));_0x290e1e[_0x4a5b('0x3c')]=_0x290e1e[_0x4a5b('0x3c')][_0x4a5b('0x4e')]?_0x290e1e[_0x4a5b('0x3c')]:_0x2b0833[_0x4a5b('0x38')];if(_0x57fb3a[_0x4a5b('0x39')][_0x4a5b('0x49')]){_0x290e1e[_0x4a5b('0x4a')]=[{'all':!![]}];}_0x290e1e=_['merge']({},_0x290e1e,_0x57fb3a[_0x4a5b('0x47')]);return db[_0x4a5b('0x48')][_0x4a5b('0x4f')](_0x290e1e)[_0x4a5b('0x2f')](handleEntityNotFound(_0x765b91,null))[_0x4a5b('0x2f')](respondWithResult(_0x765b91,null))[_0x4a5b('0x22')](handleError(_0x765b91,null));};exports[_0x4a5b('0x50')]=function(_0x13fc66,_0x2bbbcf,_0x5e33f5){var _0x4ba21c;return db[_0x4a5b('0x51')][_0x4a5b('0x52')](function(_0xd2c13c){return db[_0x4a5b('0x48')][_0x4a5b('0x50')](_0x13fc66[_0x4a5b('0x53')],{'raw':!![]})[_0x4a5b('0x2f')](function(_0x247d61){_0x4ba21c=_0x247d61;return db[_0x4a5b('0x48')]['findAll']({'where':{'type':_0x13fc66[_0x4a5b('0x53')][_0x4a5b('0x45')]},'raw':!![]});})[_0x4a5b('0x2f')](function(_0x8dcbf0){if(_0x4ba21c[_0x4a5b('0x45')]['toUpperCase']()==_0x4a5b('0x54')){var _0x1dda89=fs['readFileSync'](path['join'](config[_0x4a5b('0x55')],_0x4a5b('0x56')),_0x4a5b('0x57'));var _0x3995ff=ejs['render'](_0x1dda89,{'networks':_0x8dcbf0||[]});fs[_0x4a5b('0x58')](_0x4a5b('0x59'),_0x3995ff);return respondWithRpcPromise('Reload',_0x4a5b('0x50'),{'module':_0x4a5b('0x5a')});}else if(_0x4ba21c[_0x4a5b('0x45')][_0x4a5b('0x5b')]()==_0x4a5b('0x5c')){var _0x9f17b6=fs[_0x4a5b('0x5d')](path[_0x4a5b('0x5e')](config[_0x4a5b('0x55')],_0x4a5b('0x5f')),_0x4a5b('0x57'));var _0x253123=ejs[_0x4a5b('0x60')](_0x9f17b6,{'networks':_0x8dcbf0||[]});fs[_0x4a5b('0x58')](_0x4a5b('0x61'),_0x253123);return respondWithRpcPromise(_0x4a5b('0x62'),_0x4a5b('0x50'),{'module':'res_stun_monitor.so'});}else{var _0x27695d=fs[_0x4a5b('0x5d')](path['join'](config[_0x4a5b('0x55')],_0x4a5b('0x63')),'utf8');var _0xbfadaa=ejs[_0x4a5b('0x60')](_0x27695d,{'networks':_0x8dcbf0||[]});fs[_0x4a5b('0x58')](util[_0x4a5b('0x64')](_0x4a5b('0x65'),_0x13fc66['body']['type'][_0x4a5b('0x66')]()),_0xbfadaa);return respondWithRpcPromise(_0x4a5b('0x62'),_0x4a5b('0x50'),{'module':_0x4a5b('0x67')});}return null;})[_0x4a5b('0x2f')](function(){return _0x4ba21c;});})[_0x4a5b('0x2f')](respondWithResult(_0x2bbbcf,0xc9))[_0x4a5b('0x22')](handleError(_0x2bbbcf,null));};exports[_0x4a5b('0x2e')]=function(_0x4c847f,_0x12aaf0,_0x21db72){var _0x2ea73a;return db[_0x4a5b('0x51')]['transaction'](function(_0x1deeda){return db['Network'][_0x4a5b('0x4f')]({'where':{'id':_0x4c847f[_0x4a5b('0x68')]['id']}})[_0x4a5b('0x2f')](handleEntityNotFound(_0x12aaf0,null))[_0x4a5b('0x2f')](saveUpdates(_0x4c847f[_0x4a5b('0x53')],null))[_0x4a5b('0x2f')](function(_0x2eadf4){if(_0x2eadf4){_0x2ea73a=_0x2eadf4;return db[_0x4a5b('0x48')][_0x4a5b('0x4b')]({'where':{'type':_0x2ea73a[_0x4a5b('0x45')]},'raw':!![]});}return null;})['then'](function(_0x928a68){if(_0x2ea73a[_0x4a5b('0x45')][_0x4a5b('0x5b')]()==_0x4a5b('0x54')){var _0x2063c7=fs[_0x4a5b('0x5d')](path[_0x4a5b('0x5e')](config[_0x4a5b('0x55')],_0x4a5b('0x56')),'utf8');var _0x12e4cc=ejs[_0x4a5b('0x60')](_0x2063c7,{'networks':_0x928a68||[]});fs[_0x4a5b('0x58')](_0x4a5b('0x59'),_0x12e4cc);return respondWithRpcPromise(_0x4a5b('0x62'),_0x4a5b('0x2e'),{'module':_0x4a5b('0x5a')});}else if(_0x2ea73a[_0x4a5b('0x45')]['toUpperCase']()==_0x4a5b('0x5c')){var _0x4a9703=fs[_0x4a5b('0x5d')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0x4a5b('0x57'));var _0x1ed44a=ejs['render'](_0x4a9703,{'networks':_0x928a68||[]});fs[_0x4a5b('0x58')](_0x4a5b('0x61'),_0x1ed44a);return respondWithRpcPromise(_0x4a5b('0x62'),_0x4a5b('0x2e'),{'module':_0x4a5b('0x5a')});}else{var _0x5b1cbc=fs[_0x4a5b('0x5d')](path['join'](config[_0x4a5b('0x55')],_0x4a5b('0x63')),_0x4a5b('0x57'));var _0xbab8be=ejs[_0x4a5b('0x60')](_0x5b1cbc,{'networks':_0x928a68||[]});fs['writeFileSync'](util[_0x4a5b('0x64')](_0x4a5b('0x65'),_0x4c847f[_0x4a5b('0x53')][_0x4a5b('0x45')][_0x4a5b('0x66')]()),_0xbab8be);return respondWithRpcPromise(_0x4a5b('0x62'),_0x4a5b('0x2e'),{'module':_0x4a5b('0x67')});}return null;})[_0x4a5b('0x2f')](function(_0x272dcb){if(_0x272dcb){return _0x2ea73a;}return null;});})[_0x4a5b('0x2f')](respondWithResult(_0x12aaf0,null))[_0x4a5b('0x22')](handleError(_0x12aaf0,null));};exports[_0x4a5b('0x30')]=function(_0x2954a9,_0xafbf66,_0x2c0705){var _0x2e7bdb;return db['Network'][_0x4a5b('0x4f')]({'where':{'id':_0x2954a9[_0x4a5b('0x68')]['id']}})[_0x4a5b('0x2f')](function(_0x129fc8){_0x2e7bdb=_0x129fc8;return _0x129fc8;})[_0x4a5b('0x2f')](handleEntityNotFound(_0xafbf66,null))[_0x4a5b('0x2f')](removeEntity(_0xafbf66,null))['then'](function(){if(_0x2e7bdb){return db[_0x4a5b('0x48')][_0x4a5b('0x4b')]({'where':{'type':_0x2e7bdb[_0x4a5b('0x45')]},'raw':!![]});}})['then'](function(_0x1e054a){if(_0x2e7bdb[_0x4a5b('0x45')][_0x4a5b('0x5b')]()==_0x4a5b('0x54')){var _0x57fac9=fs[_0x4a5b('0x5d')](path[_0x4a5b('0x5e')](config[_0x4a5b('0x55')],_0x4a5b('0x56')),_0x4a5b('0x57'));var _0x5954be=ejs[_0x4a5b('0x60')](_0x57fac9,{'networks':_0x1e054a||[]});fs[_0x4a5b('0x58')](_0x4a5b('0x59'),_0x5954be);return respondWithRpcPromise('Reload','destroy',{'module':'res_stun_monitor.so'});}else if(_0x2e7bdb[_0x4a5b('0x45')][_0x4a5b('0x5b')]()==_0x4a5b('0x5c')){var _0xf9a735=fs[_0x4a5b('0x5d')](path['join'](config[_0x4a5b('0x55')],_0x4a5b('0x5f')),'utf8');var _0x4159e5=ejs['render'](_0xf9a735,{'networks':_0x1e054a||[]});fs['writeFileSync'](_0x4a5b('0x61'),_0x4159e5);return respondWithRpcPromise(_0x4a5b('0x62'),_0x4a5b('0x30'),{'module':_0x4a5b('0x5a')});}else{var _0x2f2b21=fs[_0x4a5b('0x5d')](path['join'](config['root'],'server/files/templates/network.ejs'),_0x4a5b('0x57'));var _0x19c736=ejs['render'](_0x2f2b21,{'networks':_0x1e054a||[]});fs[_0x4a5b('0x58')](util[_0x4a5b('0x64')](_0x4a5b('0x65'),_0x2954a9[_0x4a5b('0x53')][_0x4a5b('0x45')][_0x4a5b('0x66')]()),_0x19c736);return respondWithRpcPromise(_0x4a5b('0x62'),_0x4a5b('0x30'),{'module':'chan_sip.so'});}return null;})['catch'](handleError(_0xafbf66,null));};
\ No newline at end of file
index 2400f0c..d5ff625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3d1=['../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x323728,_0x2c419b){var _0x4ad0c3=function(_0x475577){while(--_0x475577){_0x323728['push'](_0x323728['shift']());}};_0x4ad0c3(++_0x2c419b);}(_0xd3d1,0x172));var _0x1d3d=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd3d1[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1d3d('0x2'));var BPromise=require(_0x1d3d('0x3'));var rp=require(_0x1d3d('0x4'));var fs=require('fs');var path=require(_0x1d3d('0x5'));var rimraf=require(_0x1d3d('0x6'));var config=require(_0x1d3d('0x7'));var attributes=require(_0x1d3d('0x8'));module[_0x1d3d('0x9')]=function(_0x1cbe06,_0x449475){return _0x1cbe06[_0x1d3d('0xa')](_0x1d3d('0xb'),attributes,{'tableName':_0x1d3d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e0d=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','define','Network','network'];(function(_0x2c2244,_0x197be1){var _0x1e3b27=function(_0x2b8e83){while(--_0x2b8e83){_0x2c2244['push'](_0x2c2244['shift']());}};_0x1e3b27(++_0x197be1);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x14d477,_0x259495){_0x14d477=_0x14d477-0x0;var _0x1366f0=_0x9e0d[_0x14d477];return _0x1366f0;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var logger=require(_0xd9e0('0x2'))(_0xd9e0('0x3'));var moment=require('moment');var BPromise=require(_0xd9e0('0x4'));var rp=require(_0xd9e0('0x5'));var fs=require('fs');var path=require(_0xd9e0('0x6'));var rimraf=require(_0xd9e0('0x7'));var config=require(_0xd9e0('0x8'));var attributes=require(_0xd9e0('0x9'));module['exports']=function(_0x570a07,_0x22e726){return _0x570a07[_0xd9e0('0xa')](_0xd9e0('0xb'),attributes,{'tableName':_0xd9e0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b76b87f..2efeeb3 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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x3ec75d,_0x169449){_0x3ec75d=_0x3ec75d-0x0;var _0x12c33c=_0x7a54[_0x3ec75d];return _0x12c33c;};'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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x5a5bfe,_0x408939){_0x5a5bfe=_0x5a5bfe-0x0;var _0x1f7f6e=_0x7a54[_0x5a5bfe];return _0x1f7f6e;};'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 0be026a..d03a486 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4769=['/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getApplications','/:id/interactions','getInteractions','getAgents','create','post','/:id/notify','notify','/:id/applications','addApplications','/:id/users','addAgents','/:id/send','send','update','destroy','delete','removeAnswers','removeAgents','exports','util','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x2b7c7,_0x2635c7){var _0x5a394c=function(_0x17eeea){while(--_0x17eeea){_0x2b7c7['push'](_0x2b7c7['shift']());}};_0x5a394c(++_0x2635c7);}(_0x4769,0x164));var _0x9476=function(_0x1f6224,_0x39ffdc){_0x1f6224=_0x1f6224-0x0;var _0x1ee572=_0x4769[_0x1f6224];return _0x1ee572;};'use strict';var multer=require('multer');var util=require(_0x9476('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9476('0x1')]();var fs_extra=require(_0x9476('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x9476('0x3'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x9476('0x4')]('/',auth[_0x9476('0x5')](),controller[_0x9476('0x6')]);router[_0x9476('0x4')](_0x9476('0x7'),auth['isAuthenticated'](),controller[_0x9476('0x8')]);router[_0x9476('0x4')](_0x9476('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9476('0x4')](_0x9476('0xa'),auth[_0x9476('0x5')](),controller[_0x9476('0xb')]);router[_0x9476('0x4')](_0x9476('0xc'),auth[_0x9476('0x5')](),controller['getAnswers']);router[_0x9476('0x4')]('/:id/applications',auth['isAuthenticated'](),controller[_0x9476('0xd')]);router['get'](_0x9476('0xe'),auth['isAuthenticated'](),controller[_0x9476('0xf')]);router[_0x9476('0x4')]('/:id/users',auth['isAuthenticated'](),controller[_0x9476('0x10')]);router['post']('/',auth[_0x9476('0x5')](),controller[_0x9476('0x11')]);router[_0x9476('0x12')](_0x9476('0xa'),auth[_0x9476('0x5')](),controller['addDisposition']);router[_0x9476('0x12')](_0x9476('0xc'),auth[_0x9476('0x5')](),controller['addAnswer']);router[_0x9476('0x12')](_0x9476('0x13'),controller[_0x9476('0x14')]);router['post'](_0x9476('0x15'),auth['isAuthenticated'](),controller[_0x9476('0x16')]);router[_0x9476('0x12')](_0x9476('0x17'),auth[_0x9476('0x5')](),controller[_0x9476('0x18')]);router[_0x9476('0x12')](_0x9476('0x19'),auth['isAuthenticated'](),controller[_0x9476('0x1a')]);router['put']('/:id',auth[_0x9476('0x5')](),controller[_0x9476('0x1b')]);router['delete'](_0x9476('0x9'),auth[_0x9476('0x5')](),controller[_0x9476('0x1c')]);router[_0x9476('0x1d')]('/:id/dispositions',auth[_0x9476('0x5')](),controller['removeDispositions']);router[_0x9476('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9476('0x1e')]);router[_0x9476('0x1d')](_0x9476('0x17'),auth['isAuthenticated'](),controller[_0x9476('0x1f')]);module[_0x9476('0x20')]=router;
\ No newline at end of file
+var _0x5f75=['addApplications','addAgents','/:id/send','send','put','delete','destroy','removeAnswers','removeAgents','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/users','post','/:id/dispositions','addAnswer','notify'];(function(_0x158e25,_0x433f79){var _0x1ef362=function(_0x11713b){while(--_0x11713b){_0x158e25['push'](_0x158e25['shift']());}};_0x1ef362(++_0x433f79);}(_0x5f75,0x1c4));var _0x55f7=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x5f75[_0x175e89];return _0x2ed996;};'use strict';var multer=require(_0x55f7('0x0'));var util=require(_0x55f7('0x1'));var path=require('path');var timeout=require(_0x55f7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x55f7('0x3'));var auth=require(_0x55f7('0x4'));var interaction=require(_0x55f7('0x5'));var config=require(_0x55f7('0x6'));var controller=require(_0x55f7('0x7'));router[_0x55f7('0x8')]('/',auth[_0x55f7('0x9')](),controller[_0x55f7('0xa')]);router[_0x55f7('0x8')](_0x55f7('0xb'),auth[_0x55f7('0x9')](),controller[_0x55f7('0xc')]);router[_0x55f7('0x8')](_0x55f7('0xd'),auth[_0x55f7('0x9')](),controller['show']);router['get']('/:id/dispositions',auth[_0x55f7('0x9')](),controller[_0x55f7('0xe')]);router[_0x55f7('0x8')](_0x55f7('0xf'),auth[_0x55f7('0x9')](),controller[_0x55f7('0x10')]);router[_0x55f7('0x8')](_0x55f7('0x11'),auth['isAuthenticated'](),controller[_0x55f7('0x12')]);router[_0x55f7('0x8')]('/:id/interactions',auth[_0x55f7('0x9')](),controller['getInteractions']);router['get'](_0x55f7('0x13'),auth[_0x55f7('0x9')](),controller['getAgents']);router['post']('/',auth[_0x55f7('0x9')](),controller['create']);router[_0x55f7('0x14')](_0x55f7('0x15'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x55f7('0xf'),auth['isAuthenticated'](),controller[_0x55f7('0x16')]);router[_0x55f7('0x14')]('/:id/notify',controller[_0x55f7('0x17')]);router[_0x55f7('0x14')](_0x55f7('0x11'),auth[_0x55f7('0x9')](),controller[_0x55f7('0x18')]);router[_0x55f7('0x14')]('/:id/users',auth[_0x55f7('0x9')](),controller[_0x55f7('0x19')]);router[_0x55f7('0x14')](_0x55f7('0x1a'),auth[_0x55f7('0x9')](),controller[_0x55f7('0x1b')]);router[_0x55f7('0x1c')]('/:id',auth[_0x55f7('0x9')](),controller['update']);router[_0x55f7('0x1d')](_0x55f7('0xd'),auth['isAuthenticated'](),controller[_0x55f7('0x1e')]);router[_0x55f7('0x1d')]('/:id/dispositions',auth[_0x55f7('0x9')](),controller['removeDispositions']);router[_0x55f7('0x1d')]('/:id/canned_answers',auth[_0x55f7('0x9')](),controller[_0x55f7('0x1f')]);router[_0x55f7('0x1d')](_0x55f7('0x13'),auth[_0x55f7('0x9')](),controller[_0x55f7('0x20')]);module[_0x55f7('0x21')]=router;
\ No newline at end of file
index ae7795d..3c6e02a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae09=['STRING','name','generate','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','sequelize','exports'];(function(_0x413aac,_0x5e2430){var _0x569b11=function(_0x52e060){while(--_0x52e060){_0x413aac['push'](_0x413aac['shift']());}};_0x569b11(++_0x5e2430);}(_0xae09,0x18a));var _0x9ae0=function(_0x26447e,_0x2e9c94){_0x26447e=_0x26447e-0x0;var _0x38cc1a=_0xae09[_0x26447e];return _0x38cc1a;};'use strict';var Sequelize=require(_0x9ae0('0x0'));var rs=require('randomstring');module[_0x9ae0('0x1')]={'name':{'type':Sequelize[_0x9ae0('0x2')],'unique':_0x9ae0('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9ae0('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9ae0('0x4')]();}},'replyUri':{'type':Sequelize[_0x9ae0('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9ae0('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9ae0('0x5');}},'notificationSound':{'type':Sequelize[_0x9ae0('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9ae0('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9ae0('0x2')]},'queueTransfer':{'type':Sequelize[_0x9ae0('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9ae0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9ae0('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9ae0('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x9ae0('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x9ae0('0x6')],'defaultValue':![],'comment':_0x9ae0('0x9'),'set':function(_0x3c4e73){if(!_0x3c4e73)this[_0x9ae0('0xa')]('mandatoryDispositionPauseId',null);this[_0x9ae0('0xa')]('mandatoryDisposition',_0x3c4e73);}}};
\ No newline at end of file
+var _0x08b3=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x08b3,0x1f2));var _0x308b=function(_0x210a0a,_0x26fdd5){_0x210a0a=_0x210a0a-0x0;var _0x235872=_0x08b3[_0x210a0a];return _0x235872;};'use strict';var Sequelize=require(_0x308b('0x0'));var rs=require(_0x308b('0x1'));module['exports']={'name':{'type':Sequelize[_0x308b('0x2')],'unique':_0x308b('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x308b('0x2')]},'token':{'type':Sequelize[_0x308b('0x2')],'defaultValue':function(){return rs[_0x308b('0x4')]();}},'replyUri':{'type':Sequelize[_0x308b('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x308b('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x308b('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x308b('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x308b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x308b('0x2')]},'queueTransfer':{'type':Sequelize[_0x308b('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x308b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x308b('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x308b('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x308b('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x308b('0x6')],'defaultValue':![],'comment':_0x308b('0x9'),'set':function(_0x5660e5){if(!_0x5660e5)this[_0x308b('0xa')](_0x308b('0xb'),null);this[_0x308b('0xa')](_0x308b('0xc'),_0x5660e5);}}};
\ No newline at end of file
index d095f8b..6438972 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa696=['fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','get','OpenchannelAccounts','UserProfileResource','destroy','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','fieldName','type','key','query','keys','filters','model','attributes','length','order','sort','pick','where','merge','filter','options','OpenchannelAccount','includeAll','include','findAll','rows','catch','rawAttributes','intersection','fields','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','Disposition','nolimit','removeDispositions','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','DESC','OpenchannelApplication','List','account','Applications','list','applications','orderBy','priority','asc','Contacts','ListId','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','spread','contact','messageId','interaction','created','autoclose','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','bulkCreate','findOne','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','ids','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs'];(function(_0x4e0ab8,_0x401afb){var _0x4c1f40=function(_0x7f95ef){while(--_0x7f95ef){_0x4e0ab8['push'](_0x4e0ab8['shift']());}};_0x4c1f40(++_0x401afb);}(_0xa696,0xb0));var _0x6a69=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xa696[_0x1eda20];return _0x31b953;};'use strict';var emlformat=require(_0x6a69('0x0'));var rimraf=require(_0x6a69('0x1'));var zipdir=require(_0x6a69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a69('0x3'));var moment=require(_0x6a69('0x4'));var BPromise=require(_0x6a69('0x5'));var Mustache=require('mustache');var util=require(_0x6a69('0x6'));var path=require(_0x6a69('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6a69('0x8'));var fs=require('fs');var fs_extra=require(_0x6a69('0x9'));var _=require(_0x6a69('0xa'));var squel=require(_0x6a69('0xb'));var crypto=require('crypto');var jsforce=require(_0x6a69('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a69('0xd'));var Papa=require('papaparse');var Redis=require(_0x6a69('0xe'));var authService=require(_0x6a69('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6a69('0x10'));var hardwareService=require(_0x6a69('0x11'));var logger=require(_0x6a69('0x12'))(_0x6a69('0x13'));var utils=require(_0x6a69('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6a69('0x15')]=_[_0x6a69('0x16')](config['redis'],{'host':_0x6a69('0x17'),'port':0x18eb});var socket=require(_0x6a69('0x18'))(new Redis(config[_0x6a69('0x15')]));require(_0x6a69('0x19'))['register'](socket);var jayson=require(_0x6a69('0x1a'));var client=jayson[_0x6a69('0x1b')][_0x6a69('0x1c')]({'port':0x232c});var client9002=jayson[_0x6a69('0x1b')][_0x6a69('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5626d8,_0x469791,_0x52b016,_0x40f7ab){return new BPromise(function(_0x2b510f,_0x2b0ec2){var _0x17c882=_0x40f7ab||client;return _0x17c882[_0x6a69('0x1d')](_0x5626d8,_0x52b016)[_0x6a69('0x1e')](function(_0x54fa45){logger[_0x6a69('0x1f')](_0x6a69('0x20'),_0x469791,_0x6a69('0x21'));logger['debug'](_0x6a69('0x22'),_0x469791,_0x6a69('0x21'),JSON[_0x6a69('0x23')](_0x54fa45));if(_0x54fa45['error']){if(_0x54fa45[_0x6a69('0x24')][_0x6a69('0x25')]===0x1f4){logger[_0x6a69('0x24')](_0x6a69('0x20'),_0x469791,_0x54fa45[_0x6a69('0x24')][_0x6a69('0x26')]);return _0x2b0ec2(_0x54fa45[_0x6a69('0x24')][_0x6a69('0x26')]);}logger[_0x6a69('0x24')](_0x6a69('0x20'),_0x469791,_0x54fa45['error']['message']);return _0x2b510f(_0x54fa45['error'][_0x6a69('0x26')]);}else{logger['info'](_0x6a69('0x20'),_0x469791,_0x6a69('0x21'));_0x2b510f(_0x54fa45[_0x6a69('0x27')][_0x6a69('0x26')]);}})['catch'](function(_0x44b096){logger['error'](_0x6a69('0x20'),_0x469791,_0x44b096);_0x2b0ec2(_0x44b096);});});}function respondWithStatusCode(_0x25872a,_0x134dad){_0x134dad=_0x134dad||0xcc;return function(_0x177d46){if(_0x177d46){return _0x25872a['sendStatus'](_0x134dad);}return _0x25872a[_0x6a69('0x28')](_0x134dad)[_0x6a69('0x29')]();};}function respondWithResult(_0x3bcb54,_0x231eb4){_0x231eb4=_0x231eb4||0xc8;return function(_0x1ababd){if(_0x1ababd){return _0x3bcb54[_0x6a69('0x28')](_0x231eb4)[_0x6a69('0x2a')](_0x1ababd);}};}function respondWithFilteredResult(_0x18dcb6,_0xee5c5b){return function(_0x108d42){if(_0x108d42){var _0x4562bf=typeof _0xee5c5b[_0x6a69('0x2b')]===_0x6a69('0x2c')&&typeof _0xee5c5b[_0x6a69('0x2d')]===_0x6a69('0x2c');var _0x215643=_0x108d42[_0x6a69('0x2e')];var _0x399791=_0x4562bf?0x0:_0xee5c5b['offset'];var _0x339920=_0x4562bf?_0x108d42[_0x6a69('0x2e')]:_0xee5c5b[_0x6a69('0x2b')]+_0xee5c5b['limit'];var _0x58a539;if(_0x339920>=_0x215643){_0x339920=_0x215643;_0x58a539=0xc8;}else{_0x58a539=0xce;}_0x18dcb6[_0x6a69('0x28')](_0x58a539);return _0x18dcb6['set'](_0x6a69('0x2f'),_0x399791+'-'+_0x339920+'/'+_0x215643)['json'](_0x108d42);}return null;};}function patchUpdates(_0x5e8b14){return function(_0x2ba9dc){try{jsonpatch['apply'](_0x2ba9dc,_0x5e8b14,!![]);}catch(_0x117135){return BPromise[_0x6a69('0x30')](_0x117135);}return _0x2ba9dc[_0x6a69('0x31')]();};}function saveUpdates(_0x3d1337,_0x32e823){return function(_0xd077d6){if(_0xd077d6){return _0xd077d6[_0x6a69('0x32')](_0x3d1337)[_0x6a69('0x1e')](function(_0xc2a3a8){return _0xc2a3a8;});}return null;};}function removeEntity(_0x167f43,_0x4d6af9){return function(_0xb04eb2){if(_0xb04eb2){return _0xb04eb2['destroy']()[_0x6a69('0x1e')](function(){var _0x4d903e=_0xb04eb2[_0x6a69('0x33')]({'plain':!![]});var _0x564c5f=_0x6a69('0x34');return db[_0x6a69('0x35')][_0x6a69('0x36')]({'where':{'type':_0x564c5f,'resourceId':_0x4d903e['id']}})[_0x6a69('0x1e')](function(){return _0xb04eb2;});})[_0x6a69('0x1e')](function(){_0x167f43[_0x6a69('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa998b9,_0x42ad63){return function(_0x527ee9){if(!_0x527ee9){_0xa998b9[_0x6a69('0x37')](0x194);}return _0x527ee9;};}function handleError(_0x2c6ea9,_0x4449a4){_0x4449a4=_0x4449a4||0x1f4;return function(_0x5b6a38){logger[_0x6a69('0x24')](_0x5b6a38[_0x6a69('0x38')]);if(_0x5b6a38['name']){delete _0x5b6a38[_0x6a69('0x39')];}_0x2c6ea9['status'](_0x4449a4)[_0x6a69('0x3a')](_0x5b6a38);};}exports['index']=function(_0x41393f,_0x22e116){var _0x435bb0={'include':[{'model':db[_0x6a69('0x3b')],'as':_0x6a69('0x3c')}]},_0x241ca7={},_0x512e9d={'count':0x0,'rows':[]};var _0x13180c=_[_0x6a69('0x3d')](db['OpenchannelAccount']['rawAttributes'],function(_0x529f8c){return{'name':_0x529f8c[_0x6a69('0x3e')],'type':_0x529f8c[_0x6a69('0x3f')][_0x6a69('0x40')]};});_0x241ca7['model']=_[_0x6a69('0x3d')](_0x13180c,'name');_0x241ca7[_0x6a69('0x41')]=_[_0x6a69('0x42')](_0x41393f[_0x6a69('0x41')]);_0x241ca7[_0x6a69('0x43')]=_['intersection'](_0x241ca7[_0x6a69('0x44')],_0x241ca7[_0x6a69('0x41')]);_0x435bb0[_0x6a69('0x45')]=_['intersection'](_0x241ca7['model'],qs['fields'](_0x41393f['query']['fields']));_0x435bb0[_0x6a69('0x45')]=_0x435bb0['attributes'][_0x6a69('0x46')]?_0x435bb0[_0x6a69('0x45')]:_0x241ca7[_0x6a69('0x44')];if(!_0x41393f[_0x6a69('0x41')]['hasOwnProperty']('nolimit')){_0x435bb0[_0x6a69('0x2d')]=qs['limit'](_0x41393f[_0x6a69('0x41')][_0x6a69('0x2d')]);_0x435bb0[_0x6a69('0x2b')]=qs[_0x6a69('0x2b')](_0x41393f[_0x6a69('0x41')][_0x6a69('0x2b')]);}_0x435bb0[_0x6a69('0x47')]=qs[_0x6a69('0x48')](_0x41393f[_0x6a69('0x41')]['sort']);_0x435bb0['where']=qs[_0x6a69('0x43')](_[_0x6a69('0x49')](_0x41393f[_0x6a69('0x41')],_0x241ca7[_0x6a69('0x43')]),_0x13180c);if(_0x41393f[_0x6a69('0x41')]['filter']){_0x435bb0[_0x6a69('0x4a')]=_[_0x6a69('0x4b')](_0x435bb0['where'],{'$or':_[_0x6a69('0x3d')](_0x13180c,function(_0x162894){if(_0x162894[_0x6a69('0x3f')]!=='VIRTUAL'){var _0x1d53bc={};_0x1d53bc[_0x162894[_0x6a69('0x39')]]={'$like':'%'+_0x41393f[_0x6a69('0x41')][_0x6a69('0x4c')]+'%'};return _0x1d53bc;}})});}_0x435bb0=_[_0x6a69('0x4b')]({},_0x435bb0,_0x41393f[_0x6a69('0x4d')]);var _0x55f482={'where':_0x435bb0[_0x6a69('0x4a')]};return db[_0x6a69('0x4e')][_0x6a69('0x2e')](_0x55f482)['then'](function(_0x2ee30c){_0x512e9d['count']=_0x2ee30c;if(_0x41393f['query'][_0x6a69('0x4f')]){_0x435bb0[_0x6a69('0x50')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x6a69('0x51')](_0x435bb0);})[_0x6a69('0x1e')](function(_0x1c6021){_0x512e9d[_0x6a69('0x52')]=_0x1c6021;return _0x512e9d;})[_0x6a69('0x1e')](respondWithFilteredResult(_0x22e116,_0x435bb0))[_0x6a69('0x53')](handleError(_0x22e116,null));};exports['show']=function(_0x140f8c,_0x97c380){var _0x4c96c5={'raw':![],'where':{'id':_0x140f8c['params']['id']},'include':[{'model':db[_0x6a69('0x3b')],'as':_0x6a69('0x3c')}]},_0x428634={};_0x428634['model']=_[_0x6a69('0x42')](db[_0x6a69('0x4e')][_0x6a69('0x54')]);_0x428634['query']=_[_0x6a69('0x42')](_0x140f8c['query']);_0x428634['filters']=_[_0x6a69('0x55')](_0x428634['model'],_0x428634[_0x6a69('0x41')]);_0x4c96c5[_0x6a69('0x45')]=_['intersection'](_0x428634[_0x6a69('0x44')],qs[_0x6a69('0x56')](_0x140f8c[_0x6a69('0x41')][_0x6a69('0x56')]));_0x4c96c5[_0x6a69('0x45')]=_0x4c96c5[_0x6a69('0x45')][_0x6a69('0x46')]?_0x4c96c5[_0x6a69('0x45')]:_0x428634[_0x6a69('0x44')];if(_0x140f8c[_0x6a69('0x41')]['includeAll']){_0x4c96c5['include']=[{'all':!![]}];}_0x4c96c5=_['merge']({},_0x4c96c5,_0x140f8c[_0x6a69('0x4d')]);return db[_0x6a69('0x4e')][_0x6a69('0x57')](_0x4c96c5)[_0x6a69('0x1e')](handleEntityNotFound(_0x97c380,null))['then'](respondWithResult(_0x97c380,null))[_0x6a69('0x53')](handleError(_0x97c380,null));};exports[_0x6a69('0x58')]=function(_0x54faa4,_0x332fd1){return db[_0x6a69('0x4e')][_0x6a69('0x58')](_0x54faa4[_0x6a69('0x59')],{})[_0x6a69('0x1e')](function(_0x169098){var _0x21ce38=_0x54faa4[_0x6a69('0x5a')][_0x6a69('0x33')]({'plain':!![]});if(!_0x21ce38)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21ce38[_0x6a69('0x5b')]===_0x6a69('0x5a')){var _0x1c1eb7=_0x169098['get']({'plain':!![]});var _0x5361c2='OpenchannelAccounts';return db[_0x6a69('0x5c')][_0x6a69('0x57')]({'where':{'name':_0x5361c2,'userProfileId':_0x21ce38[_0x6a69('0x5d')]},'raw':!![]})['then'](function(_0x253718){if(_0x253718&&_0x253718['autoAssociation']===0x0){return db[_0x6a69('0x35')][_0x6a69('0x58')]({'name':_0x1c1eb7[_0x6a69('0x39')],'resourceId':_0x1c1eb7['id'],'type':_0x253718[_0x6a69('0x39')],'sectionId':_0x253718['id']},{})[_0x6a69('0x1e')](function(){return _0x169098;});}else{return _0x169098;}})[_0x6a69('0x53')](function(_0x2745ba){logger[_0x6a69('0x24')](_0x6a69('0x5e'),_0x2745ba);throw _0x2745ba;});}return _0x169098;})[_0x6a69('0x1e')](respondWithResult(_0x332fd1,0xc9))['catch'](handleError(_0x332fd1,null));};exports[_0x6a69('0x32')]=function(_0x360a78,_0x15116b){if(_0x360a78['body']['id']){delete _0x360a78[_0x6a69('0x59')]['id'];}return db[_0x6a69('0x4e')][_0x6a69('0x57')]({'where':{'id':_0x360a78[_0x6a69('0x5f')]['id']},'include':[{'model':db[_0x6a69('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x6a69('0x1e')](handleEntityNotFound(_0x15116b,null))[_0x6a69('0x1e')](saveUpdates(_0x360a78['body'],null))[_0x6a69('0x1e')](respondWithResult(_0x15116b,null))[_0x6a69('0x53')](handleError(_0x15116b,null));};exports[_0x6a69('0x36')]=function(_0x24dec2,_0x4de2e1){return db[_0x6a69('0x4e')]['find']({'where':{'id':_0x24dec2[_0x6a69('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4de2e1,null))['then'](removeEntity(_0x4de2e1,null))[_0x6a69('0x53')](handleError(_0x4de2e1,null));};exports[_0x6a69('0x60')]=function(_0x47eff7,_0xad08fc){return db['OpenchannelAccount'][_0x6a69('0x60')]()['then'](respondWithResult(_0xad08fc,null))[_0x6a69('0x53')](handleError(_0xad08fc,null));};exports[_0x6a69('0x61')]=function(_0x233dd5,_0x4db267,_0x47dcf8){if(_0x233dd5[_0x6a69('0x59')]['id']){delete _0x233dd5[_0x6a69('0x59')]['id'];}return db[_0x6a69('0x4e')][_0x6a69('0x57')]({'where':{'id':_0x233dd5[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x4db267,null))[_0x6a69('0x1e')](function(_0x1e7c9e){if(_0x1e7c9e){_0x233dd5['body'][_0x6a69('0x62')]=_0x1e7c9e['id'];return db[_0x6a69('0x63')]['create'](_0x233dd5['body']);}})[_0x6a69('0x1e')](respondWithResult(_0x4db267,null))['catch'](handleError(_0x4db267,null));};exports['getDispositions']=function(_0x4858e8,_0x5a8025,_0x3f16ff){var _0x4d2569={'raw':![],'where':{}};var _0x4f7055={};var _0x4f785a={'count':0x0,'rows':[]};return db[_0x6a69('0x4e')]['findOne']({'where':{'id':_0x4858e8[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x5a8025,null))['then'](function(_0x116c82){if(_0x116c82){_0x4f7055[_0x6a69('0x44')]=_['keys'](db[_0x6a69('0x63')][_0x6a69('0x54')]);_0x4f7055['query']=_[_0x6a69('0x42')](_0x4858e8[_0x6a69('0x41')]);_0x4f7055[_0x6a69('0x43')]=_['intersection'](_0x4f7055[_0x6a69('0x44')],_0x4f7055['query']);_0x4d2569[_0x6a69('0x45')]=_[_0x6a69('0x55')](_0x4f7055[_0x6a69('0x44')],qs[_0x6a69('0x56')](_0x4858e8[_0x6a69('0x41')][_0x6a69('0x56')]));_0x4d2569[_0x6a69('0x45')]=_0x4d2569[_0x6a69('0x45')][_0x6a69('0x46')]?_0x4d2569[_0x6a69('0x45')]:_0x4f7055[_0x6a69('0x44')];if(!_0x4858e8[_0x6a69('0x41')]['hasOwnProperty'](_0x6a69('0x64'))){_0x4d2569[_0x6a69('0x2d')]=qs[_0x6a69('0x2d')](_0x4858e8[_0x6a69('0x41')][_0x6a69('0x2d')]);_0x4d2569['offset']=qs[_0x6a69('0x2b')](_0x4858e8[_0x6a69('0x41')]['offset']);}_0x4d2569[_0x6a69('0x47')]=qs[_0x6a69('0x48')](_0x4858e8[_0x6a69('0x41')]['sort']);_0x4d2569['where']=qs[_0x6a69('0x43')](_[_0x6a69('0x49')](_0x4858e8[_0x6a69('0x41')],_0x4f7055['filters']));_0x4d2569[_0x6a69('0x4a')]['OpenchannelAccountId']=_0x116c82['id'];if(_0x4858e8[_0x6a69('0x41')][_0x6a69('0x4c')]){_0x4d2569[_0x6a69('0x4a')]=_[_0x6a69('0x4b')](_0x4d2569[_0x6a69('0x4a')],{'$or':_[_0x6a69('0x3d')](_0x4d2569[_0x6a69('0x45')],function(_0x4bee4f){var _0x36ae18={};_0x36ae18[_0x4bee4f]={'$like':'%'+_0x4858e8[_0x6a69('0x41')][_0x6a69('0x4c')]+'%'};return _0x36ae18;})});}_0x4d2569=_['merge']({},_0x4d2569,_0x4858e8[_0x6a69('0x4d')]);return db[_0x6a69('0x63')][_0x6a69('0x2e')]({'where':_0x4d2569[_0x6a69('0x4a')]})['then'](function(_0x33260e){_0x4f785a[_0x6a69('0x2e')]=_0x33260e;if(_0x4858e8[_0x6a69('0x41')]['includeAll']){_0x4d2569[_0x6a69('0x50')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4d2569);})[_0x6a69('0x1e')](function(_0x332ca6){_0x4f785a[_0x6a69('0x52')]=_0x332ca6;return _0x4f785a;});}})[_0x6a69('0x1e')](respondWithFilteredResult(_0x5a8025,_0x4d2569))[_0x6a69('0x53')](handleError(_0x5a8025,null));};exports[_0x6a69('0x65')]=function(_0xdbc6a8,_0x5a48a0,_0x19f972){return db[_0x6a69('0x4e')]['find']({'where':{'id':_0xdbc6a8[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x5a48a0,null))[_0x6a69('0x1e')](function(_0x5157b8){if(_0x5157b8){return _0x5157b8[_0x6a69('0x65')](_0xdbc6a8['query']['ids']);}})[_0x6a69('0x1e')](respondWithStatusCode(_0x5a48a0,null))[_0x6a69('0x53')](handleError(_0x5a48a0,null));};exports[_0x6a69('0x66')]=function(_0x38b429,_0x17508f,_0x178b06){if(_0x38b429['body']['id']){delete _0x38b429[_0x6a69('0x59')]['id'];}return db['OpenchannelAccount'][_0x6a69('0x57')]({'where':{'id':_0x38b429['params']['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x17508f,null))[_0x6a69('0x1e')](function(_0x27ac8e){if(_0x27ac8e){_0x38b429[_0x6a69('0x59')][_0x6a69('0x62')]=_0x27ac8e['id'];return db[_0x6a69('0x67')][_0x6a69('0x58')](_0x38b429['body']);}})[_0x6a69('0x1e')](respondWithResult(_0x17508f,null))[_0x6a69('0x53')](handleError(_0x17508f,null));};exports[_0x6a69('0x68')]=function(_0x4b3bb0,_0x26cba8,_0x6e94d6){var _0x382e6d={'raw':![],'where':{}};var _0x317615={};var _0x208d34={'count':0x0,'rows':[]};return db[_0x6a69('0x4e')]['findOne']({'where':{'id':_0x4b3bb0[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x26cba8,null))['then'](function(_0x1fe7f7){if(_0x1fe7f7){_0x317615[_0x6a69('0x44')]=_[_0x6a69('0x42')](db[_0x6a69('0x67')][_0x6a69('0x54')]);_0x317615[_0x6a69('0x41')]=_[_0x6a69('0x42')](_0x4b3bb0[_0x6a69('0x41')]);_0x317615['filters']=_[_0x6a69('0x55')](_0x317615[_0x6a69('0x44')],_0x317615[_0x6a69('0x41')]);_0x382e6d['attributes']=_[_0x6a69('0x55')](_0x317615['model'],qs[_0x6a69('0x56')](_0x4b3bb0['query'][_0x6a69('0x56')]));_0x382e6d['attributes']=_0x382e6d[_0x6a69('0x45')][_0x6a69('0x46')]?_0x382e6d['attributes']:_0x317615['model'];if(!_0x4b3bb0[_0x6a69('0x41')][_0x6a69('0x69')](_0x6a69('0x64'))){_0x382e6d['limit']=qs[_0x6a69('0x2d')](_0x4b3bb0[_0x6a69('0x41')][_0x6a69('0x2d')]);_0x382e6d[_0x6a69('0x2b')]=qs[_0x6a69('0x2b')](_0x4b3bb0[_0x6a69('0x41')][_0x6a69('0x2b')]);}_0x382e6d[_0x6a69('0x47')]=qs[_0x6a69('0x48')](_0x4b3bb0[_0x6a69('0x41')]['sort']);_0x382e6d[_0x6a69('0x4a')]=qs[_0x6a69('0x43')](_[_0x6a69('0x49')](_0x4b3bb0[_0x6a69('0x41')],_0x317615[_0x6a69('0x43')]));_0x382e6d['where'][_0x6a69('0x62')]=_0x1fe7f7['id'];if(_0x4b3bb0['query'][_0x6a69('0x4c')]){_0x382e6d[_0x6a69('0x4a')]=_[_0x6a69('0x4b')](_0x382e6d[_0x6a69('0x4a')],{'$or':_[_0x6a69('0x3d')](_0x382e6d[_0x6a69('0x45')],function(_0x1ef9a5){var _0x45467d={};_0x45467d[_0x1ef9a5]={'$like':'%'+_0x4b3bb0[_0x6a69('0x41')][_0x6a69('0x4c')]+'%'};return _0x45467d;})});}_0x382e6d=_['merge']({},_0x382e6d,_0x4b3bb0[_0x6a69('0x4d')]);return db[_0x6a69('0x67')][_0x6a69('0x2e')]({'where':_0x382e6d[_0x6a69('0x4a')]})['then'](function(_0x3495bd){_0x208d34['count']=_0x3495bd;if(_0x4b3bb0['query'][_0x6a69('0x4f')]){_0x382e6d[_0x6a69('0x50')]=[{'all':!![]}];}return db[_0x6a69('0x67')][_0x6a69('0x51')](_0x382e6d);})[_0x6a69('0x1e')](function(_0x252830){_0x208d34[_0x6a69('0x52')]=_0x252830;return _0x208d34;});}})[_0x6a69('0x1e')](respondWithFilteredResult(_0x26cba8,_0x382e6d))[_0x6a69('0x53')](handleError(_0x26cba8,null));};exports['removeAnswers']=function(_0x14e91c,_0x55e509,_0x51fb83){return db[_0x6a69('0x4e')]['find']({'where':{'id':_0x14e91c[_0x6a69('0x5f')]['id']}})['then'](handleEntityNotFound(_0x55e509,null))[_0x6a69('0x1e')](function(_0x5dd1fb){if(_0x5dd1fb){return _0x5dd1fb[_0x6a69('0x6a')](_0x14e91c[_0x6a69('0x41')]['ids']);}})[_0x6a69('0x1e')](respondWithStatusCode(_0x55e509,null))[_0x6a69('0x53')](handleError(_0x55e509,null));};exports[_0x6a69('0x6b')]=function(_0xc5073d,_0x173945,_0x243b0c){var _0x3c049d={'body':_0xc5073d[_0x6a69('0x59')],'channel':'openchannel'};var _0x236f6f=[];var _0x1dd72b=[];var _0x3b515b={};var _0x53de21=![];return db[_0x6a69('0x6c')][_0x6a69('0x60')]()[_0x6a69('0x1e')](function(_0x2543f6){if(!_0x2543f6){throw new db[(_0x6a69('0x6d'))][(_0x6a69('0x6e'))](_0x6a69('0x6f'));}_0x236f6f=_['difference'](_[_0x6a69('0x42')](_0x2543f6),[_0x6a69('0x70'),_0x6a69('0x71')]);_0x1dd72b=_[_0x6a69('0x72')](_[_0x6a69('0x42')](_0x2543f6),[_0x6a69('0x70'),'updatedAt',_0x6a69('0x73'),'ListId']);if(_0xc5073d[_0x6a69('0x59')]['id']){delete _0xc5073d[_0x6a69('0x59')]['id'];}if(_['isNil'](_0xc5073d[_0x6a69('0x59')]['from'])){throw new db[(_0x6a69('0x6d'))]['ValidationError'](_0x6a69('0x74'));}if(_[_0x6a69('0x75')](_0xc5073d[_0x6a69('0x59')][_0x6a69('0x59')])||_0xc5073d['body'][_0x6a69('0x59')]===''){throw new db[(_0x6a69('0x6d'))]['ValidationError'](_0x6a69('0x76'));}if(_[_0x6a69('0x75')](_0xc5073d[_0x6a69('0x59')][_0x6a69('0x77')])){throw new db['Sequelize'][(_0x6a69('0x6e'))](_0x6a69('0x78')+_0x1dd72b);}if(!_[_0x6a69('0x79')](_0x1dd72b,_0xc5073d[_0x6a69('0x59')][_0x6a69('0x77')])){throw new db[(_0x6a69('0x6d'))][(_0x6a69('0x6e'))](_0x6a69('0x7a')+_0x1dd72b);}_0x3b515b[_0xc5073d[_0x6a69('0x59')][_0x6a69('0x77')]]=_0xc5073d[_0x6a69('0x59')][_0x6a69('0x7b')];})['then'](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0xc5073d[_0x6a69('0x5f')]['id']},'include':[{'model':db[_0x6a69('0x7c')],'as':'List','include':[{'model':db[_0x6a69('0x6c')],'as':'Contacts','where':_0x3b515b,'limit':0x1,'order':[[_0x6a69('0x71'),_0x6a69('0x7d')]]}]},{'model':db[_0x6a69('0x7e')],'as':'Applications'}]});})[_0x6a69('0x1e')](handleEntityNotFound(_0x173945,null))[_0x6a69('0x1e')](function(_0x4b088a){if(_0x4b088a&&_0x4b088a[_0x6a69('0x7f')]){_0x3c049d[_0x6a69('0x80')]=_0x4b088a;_0x3c049d['applications']=_0x4b088a[_0x6a69('0x81')];_0x3c049d[_0x6a69('0x82')]=_0x4b088a[_0x6a69('0x7f')];_0x3c049d[_0x6a69('0x83')]=_[_0x6a69('0x84')](_0x3c049d[_0x6a69('0x83')],[_0x6a69('0x85')],[_0x6a69('0x86')]);if(_0x3c049d[_0x6a69('0x80')]['Applications']){delete _0x3c049d[_0x6a69('0x80')][_0x6a69('0x81')];}if(_0x3c049d[_0x6a69('0x80')][_0x6a69('0x7f')]&&_0x3c049d[_0x6a69('0x80')][_0x6a69('0x7f')][_0x6a69('0x87')]['length']){return _0x3c049d[_0x6a69('0x80')][_0x6a69('0x7f')]['Contacts'][0x0];}var _0x3a794c=_['defaults'](_0xc5073d[_0x6a69('0x59')],{'firstName':_0xc5073d[_0x6a69('0x59')][_0x6a69('0x7b')],'ListId':_0x4b088a[_0x6a69('0x88')]});_0x3a794c[_0xc5073d['body'][_0x6a69('0x77')]]=_0xc5073d[_0x6a69('0x59')][_0x6a69('0x7b')];return db[_0x6a69('0x6c')][_0x6a69('0x58')](_0x3a794c,{'fields':_0x236f6f,'raw':!![]});}})[_0x6a69('0x1e')](handleEntityNotFound(_0x173945,null))[_0x6a69('0x1e')](function(_0x249c39){_0x3c049d['contact']=_0x249c39;if(_0x249c39){var _0x30e25c={'ContactId':_0x249c39['id'],'OpenchannelAccountId':_0xc5073d[_0x6a69('0x5f')]['id'],'from':(_0x249c39[_0x6a69('0x89')]||'')+'\x20'+(_0x249c39[_0x6a69('0x8a')]||'')};var _0x2aa218={'OpenchannelAccountId':_0xc5073d[_0x6a69('0x5f')]['id'],'closed':![]};if(_0xc5073d['body'][_0x6a69('0x8b')]){_0x2aa218[_0x6a69('0x8b')]=_0xc5073d['body']['threadId'];return db['OpenchannelInteraction']['find']({'where':_0x2aa218})[_0x6a69('0x1e')](function(_0x595858){if(_0x595858){return[_0x595858,![]];}_0x30e25c[_0x6a69('0x8b')]=_0xc5073d[_0x6a69('0x59')][_0x6a69('0x8b')];_0x30e25c['externalUrl']=_0xc5073d['body'][_0x6a69('0x8c')];return db[_0x6a69('0x8d')][_0x6a69('0x58')](_0x30e25c)[_0x6a69('0x1e')](function(_0x210817){return[_0x210817,!![]];});});}else{_0x2aa218[_0x6a69('0x8b')]=null;}_0x2aa218['ContactId']=_0x249c39['id'];return db['OpenchannelInteraction']['find']({'where':_0x2aa218})[_0x6a69('0x1e')](function(_0x3d9c6b){if(_0x3d9c6b){return[_0x3d9c6b,![]];}return db['OpenchannelInteraction'][_0x6a69('0x58')](_0x30e25c)[_0x6a69('0x1e')](function(_0xcfd715){return[_0xcfd715,!![]];});});}})[_0x6a69('0x8e')](function(_0x1b6fa7,_0xc490bb){if(_0x1b6fa7){_0x53de21=_0xc490bb;if(!_0xc490bb){var _0x233f43={'from':(_0x3c049d[_0x6a69('0x8f')][_0x6a69('0x89')]||'')+'\x20'+(_0x3c049d[_0x6a69('0x8f')][_0x6a69('0x8a')]||'')};if(_0xc5073d[_0x6a69('0x59')][_0x6a69('0x8b')]&&_0xc5073d[_0x6a69('0x59')][_0x6a69('0x90')]&&_0xc5073d[_0x6a69('0x59')][_0x6a69('0x8b')]!=_0xc5073d[_0x6a69('0x59')]['messageId']){_0x233f43['threadId']=_0xc5073d[_0x6a69('0x59')]['messageId'];}return _0x1b6fa7[_0x6a69('0x32')](_0x233f43);}else{return _0x1b6fa7;}}})[_0x6a69('0x1e')](function(_0x525da0){_0x3c049d['interaction']=_0x525da0[_0x6a69('0x33')]({'plain':!![]});_0x3c049d[_0x6a69('0x91')][_0x6a69('0x92')]=_0x53de21;if(_0x3c049d['interaction']['created']){if(_0x3c049d[_0x6a69('0x80')][_0x6a69('0x93')]){_0x3c049d[_0x6a69('0x83')]['push']({'id':0x0,'priority':_0x3c049d[_0x6a69('0x83')][_0x6a69('0x46')]+0x1,'app':_0x6a69('0x94'),'appdata':'unmanaged','interval':_0x6a69('0x95')});}}return db[_0x6a69('0x96')]['create']({'body':_0xc5073d[_0x6a69('0x59')][_0x6a69('0x59')],'OpenchannelAccountId':_0xc5073d['params']['id'],'OpenchannelInteractionId':_0x525da0['id'],'direction':'in','ContactId':_0x3c049d['contact']['id'],'AttachmentId':_0xc5073d[_0x6a69('0x59')][_0x6a69('0x97')]});})[_0x6a69('0x1e')](function(_0x4370f0){_0x3c049d['message']=_0x4370f0;if(_0x3c049d[_0x6a69('0x91')][_0x6a69('0x98')]){return db[_0x6a69('0x99')]['find']({'attributes':['id',_0x6a69('0x39')],'where':{'id':_0x3c049d['interaction'][_0x6a69('0x98')]}})[_0x6a69('0x1e')](function(_0x3f8426){if(_0x3f8426){_0x3c049d['applications'][_0x6a69('0x9a')]({'id':0x0,'priority':0x0,'app':_0x6a69('0x9b'),'appdata':_0x3f8426[_0x6a69('0x39')]+','+(_0x3c049d[_0x6a69('0x80')][_0x6a69('0x9c')]||0xa),'interval':_0x6a69('0x95')});_0x3c049d[_0x6a69('0x9d')]=![];}return respondWithRpcPromise(_0x6a69('0x9e'),_0x6a69('0x9f'),_0x3c049d);});}return respondWithRpcPromise(_0x6a69('0x9e'),'startRouting',_0x3c049d);})[_0x6a69('0x1e')](function(_0x49e6e3){respondWithRpcPromise(_0x6a69('0xa0'),_0x6a69('0xa0'),{'event':_0x6a69('0x6b'),'message':_0x49e6e3},client9002);return _0x49e6e3;})[_0x6a69('0x1e')](respondWithResult(_0x173945,null))[_0x6a69('0x53')](handleError(_0x173945,null));};exports[_0x6a69('0xa1')]=function(_0x2a18a7,_0x246a71,_0xf8d120){return db[_0x6a69('0x4e')]['findOne']({'where':{'id':_0x2a18a7[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x246a71,null))[_0x6a69('0x1e')](function(_0x32de35){if(_0x32de35){return db[_0x6a69('0xa2')]['transaction'](function(_0x5b880a){return db[_0x6a69('0x7e')]['destroy']({'where':{'OpenchannelAccountId':_0x2a18a7[_0x6a69('0x5f')]['id']},'transaction':_0x5b880a})[_0x6a69('0x1e')](function(_0x5cf37c){var _0x4ca351=_[_0x6a69('0x3d')](_0x2a18a7['body'],function(_0x5575a9){_0x5575a9[_0x6a69('0x62')]=_0x2a18a7[_0x6a69('0x5f')]['id'];return _0x5575a9;});return db[_0x6a69('0x7e')][_0x6a69('0xa3')](_0x4ca351,{'transaction':_0x5b880a});});})['then'](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x2a18a7['params']['id']},'order':_0x6a69('0x85')});});}})[_0x6a69('0x1e')](respondWithResult(_0x246a71,null))[_0x6a69('0x53')](handleError(_0x246a71,null));};exports['getApplications']=function(_0x39145e,_0x4f8cc5,_0x4eed90){var _0x1922df={};var _0x4bcdcf={};var _0x4e3f2c;var _0x32b66d;return db[_0x6a69('0x4e')][_0x6a69('0xa4')]({'where':{'id':_0x39145e[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x4f8cc5,null))[_0x6a69('0x1e')](function(_0x382ac4){if(_0x382ac4){_0x4e3f2c=_0x382ac4;_0x4bcdcf['model']=_['keys'](db['OpenchannelApplication'][_0x6a69('0x54')]);_0x4bcdcf['query']=_[_0x6a69('0x42')](_0x39145e[_0x6a69('0x41')]);_0x4bcdcf['filters']=_[_0x6a69('0x55')](_0x4bcdcf[_0x6a69('0x44')],_0x4bcdcf[_0x6a69('0x41')]);_0x1922df['attributes']=_[_0x6a69('0x55')](_0x4bcdcf[_0x6a69('0x44')],qs[_0x6a69('0x56')](_0x39145e[_0x6a69('0x41')][_0x6a69('0x56')]));_0x1922df[_0x6a69('0x45')]=_0x1922df[_0x6a69('0x45')][_0x6a69('0x46')]?_0x1922df[_0x6a69('0x45')]:_0x4bcdcf[_0x6a69('0x44')];_0x1922df[_0x6a69('0x47')]=qs[_0x6a69('0x48')](_0x39145e['query']['sort']);_0x1922df[_0x6a69('0x4a')]=qs[_0x6a69('0x43')](_[_0x6a69('0x49')](_0x39145e['query'],_0x4bcdcf[_0x6a69('0x43')]));if(_0x39145e[_0x6a69('0x41')][_0x6a69('0x4c')]){_0x1922df[_0x6a69('0x4a')]=_[_0x6a69('0x4b')](_0x1922df[_0x6a69('0x4a')],{'$or':_[_0x6a69('0x3d')](_0x1922df[_0x6a69('0x45')],function(_0x584922){var _0xe5cf72={};_0xe5cf72[_0x584922]={'$like':'%'+_0x39145e[_0x6a69('0x41')]['filter']+'%'};return _0xe5cf72;})});}_0x1922df=_[_0x6a69('0x4b')]({},_0x1922df,_0x39145e[_0x6a69('0x4d')]);return _0x4e3f2c['getApplications'](_0x1922df);}})[_0x6a69('0x1e')](function(_0x243b3b){if(_0x243b3b){_0x32b66d=_0x243b3b['length'];if(!_0x39145e[_0x6a69('0x41')][_0x6a69('0x69')](_0x6a69('0x64'))){_0x1922df[_0x6a69('0x2d')]=qs[_0x6a69('0x2d')](_0x39145e[_0x6a69('0x41')][_0x6a69('0x2d')]);_0x1922df[_0x6a69('0x2b')]=qs[_0x6a69('0x2b')](_0x39145e['query']['offset']);}return _0x4e3f2c[_0x6a69('0xa5')](_0x1922df);}})[_0x6a69('0x1e')](function(_0x2319d3){if(_0x2319d3){return _0x2319d3?{'count':_0x32b66d,'rows':_0x2319d3}:null;}})[_0x6a69('0x1e')](respondWithResult(_0x4f8cc5,null))[_0x6a69('0x53')](handleError(_0x4f8cc5,null));};exports[_0x6a69('0xa6')]=function(_0x37ce9f,_0x31a3e5,_0x5a92ce){var _0x2f6585={'raw':![],'where':{}};var _0x1434d7={};var _0x323c6b={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x37ce9f[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x31a3e5,null))[_0x6a69('0x1e')](function(_0x2fc64e){if(_0x2fc64e){_0x1434d7[_0x6a69('0x44')]=_[_0x6a69('0x42')](db[_0x6a69('0x8d')][_0x6a69('0x54')]);_0x1434d7[_0x6a69('0x41')]=_['keys'](_0x37ce9f['query']);_0x1434d7['filters']=_[_0x6a69('0x55')](_0x1434d7[_0x6a69('0x44')],_0x1434d7[_0x6a69('0x41')]);_0x2f6585[_0x6a69('0x45')]=_[_0x6a69('0x55')](_0x1434d7[_0x6a69('0x44')],qs['fields'](_0x37ce9f[_0x6a69('0x41')][_0x6a69('0x56')]));_0x2f6585[_0x6a69('0x45')]=_0x2f6585[_0x6a69('0x45')][_0x6a69('0x46')]?_0x2f6585[_0x6a69('0x45')]:_0x1434d7[_0x6a69('0x44')];if(!_0x37ce9f['query'][_0x6a69('0x69')]('nolimit')){_0x2f6585[_0x6a69('0x2d')]=qs['limit'](_0x37ce9f[_0x6a69('0x41')][_0x6a69('0x2d')]);_0x2f6585[_0x6a69('0x2b')]=qs[_0x6a69('0x2b')](_0x37ce9f[_0x6a69('0x41')][_0x6a69('0x2b')]);}_0x2f6585['order']=qs[_0x6a69('0x48')](_0x37ce9f[_0x6a69('0x41')][_0x6a69('0x48')]);_0x2f6585['where']=qs[_0x6a69('0x43')](_[_0x6a69('0x49')](_0x37ce9f[_0x6a69('0x41')],_0x1434d7[_0x6a69('0x43')]));_0x2f6585['where'][_0x6a69('0x62')]=_0x2fc64e['id'];if(_0x37ce9f[_0x6a69('0x41')][_0x6a69('0x4c')]){_0x2f6585[_0x6a69('0x4a')]=_[_0x6a69('0x4b')](_0x2f6585['where'],{'$or':_[_0x6a69('0x3d')](_0x2f6585['attributes'],function(_0x877017){var _0x332ea2={};_0x332ea2[_0x877017]={'$like':'%'+_0x37ce9f['query'][_0x6a69('0x4c')]+'%'};return _0x332ea2;})});}_0x2f6585=_['merge']({},_0x2f6585,_0x37ce9f[_0x6a69('0x4d')]);return db[_0x6a69('0x8d')]['count']({'where':_0x2f6585[_0x6a69('0x4a')]})[_0x6a69('0x1e')](function(_0x411da1){_0x323c6b[_0x6a69('0x2e')]=_0x411da1;if(_0x37ce9f['query'][_0x6a69('0x4f')]){_0x2f6585['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0x6a69('0xa7'),'attributes':[_0x6a69('0x39'),_0x6a69('0xa8'),_0x6a69('0xa9')],'required':![]},{'model':db[_0x6a69('0xaa')],'as':_0x6a69('0xab'),'attributes':['id',_0x6a69('0x39'),_0x6a69('0xac')],'where':_0x37ce9f[_0x6a69('0x41')]['tag']?{'id':_0x37ce9f[_0x6a69('0x41')][_0x6a69('0xad')]}:undefined,'required':_0x37ce9f[_0x6a69('0x41')]['tag']?!![]:![]}];}return db[_0x6a69('0x8d')][_0x6a69('0x51')](_0x2f6585);})[_0x6a69('0x1e')](function(_0x1663d4){_0x323c6b[_0x6a69('0x52')]=_0x1663d4;return _0x323c6b;});}})[_0x6a69('0x1e')](respondWithFilteredResult(_0x31a3e5,_0x2f6585))[_0x6a69('0x53')](handleError(_0x31a3e5,null));};exports[_0x6a69('0xae')]=function(_0x2a61d2,_0x3b4890,_0x1715f0){return db[_0x6a69('0x4e')]['find']({'where':{'id':_0x2a61d2['params']['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x3b4890,null))[_0x6a69('0x1e')](function(_0x28de00){if(_0x28de00){return _0x28de00[_0x6a69('0xae')](_0x2a61d2[_0x6a69('0x59')]['ids'],_['omit'](_0x2a61d2[_0x6a69('0x59')],[_0x6a69('0xaf'),'id'])||{})[_0x6a69('0x8e')](function(_0x153f1a){for(var _0x17b92a=0x0;_0x17b92a<_0x2a61d2[_0x6a69('0x59')][_0x6a69('0xaf')][_0x6a69('0x46')];_0x17b92a+=0x1){socket[_0x6a69('0xb0')]('userOpenchannelAccount:save',{'UserId':Number(_0x2a61d2[_0x6a69('0x59')][_0x6a69('0xaf')][_0x17b92a]),'OpenchannelAccountId':Number(_0x2a61d2[_0x6a69('0x5f')]['id'])});}return _0x153f1a;});}})[_0x6a69('0x1e')](respondWithResult(_0x3b4890,null))['catch'](handleError(_0x3b4890,null));};exports[_0x6a69('0xb1')]=function(_0x2c2d0e,_0x1e2ea7,_0x38ee92){return db[_0x6a69('0x4e')][_0x6a69('0x57')]({'where':{'id':_0x2c2d0e[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x1e2ea7,null))['then'](function(_0x3e82c5){if(_0x3e82c5){return _0x3e82c5[_0x6a69('0xb1')](_0x2c2d0e[_0x6a69('0x41')][_0x6a69('0xaf')])[_0x6a69('0x1e')](function(){if(_[_0x6a69('0xb2')](_0x2c2d0e['query'][_0x6a69('0xaf')])){for(var _0x484e14=0x0;_0x484e14<_0x2c2d0e['query'][_0x6a69('0xaf')]['length'];_0x484e14+=0x1){socket['emit'](_0x6a69('0xb3'),{'UserId':Number(_0x2c2d0e[_0x6a69('0x41')][_0x6a69('0xaf')][_0x484e14]),'OpenchannelAccountId':Number(_0x2c2d0e[_0x6a69('0x5f')]['id'])});}}else{socket['emit'](_0x6a69('0xb3'),{'UserId':Number(_0x2c2d0e[_0x6a69('0x41')][_0x6a69('0xaf')]),'OpenchannelAccountId':Number(_0x2c2d0e[_0x6a69('0x5f')]['id'])});}});}})[_0x6a69('0x1e')](respondWithStatusCode(_0x1e2ea7,null))['catch'](handleError(_0x1e2ea7,null));};exports[_0x6a69('0xb4')]=function(_0x16774c,_0x106ac3,_0x15be4f){var _0x550259={};var _0x31d634={};var _0x4d72da;var _0x264a41;return db[_0x6a69('0x4e')]['findOne']({'where':{'id':_0x16774c[_0x6a69('0x5f')]['id']}})['then'](handleEntityNotFound(_0x106ac3,null))['then'](function(_0x7ae4af){if(_0x7ae4af){_0x4d72da=_0x7ae4af;_0x31d634['model']=_['keys'](db[_0x6a69('0x99')][_0x6a69('0x54')]);_0x31d634[_0x6a69('0x41')]=_[_0x6a69('0x42')](_0x16774c['query']);_0x31d634[_0x6a69('0x43')]=_[_0x6a69('0x55')](_0x31d634[_0x6a69('0x44')],_0x31d634[_0x6a69('0x41')]);_0x550259[_0x6a69('0x45')]=_[_0x6a69('0x55')](_0x31d634['model'],qs[_0x6a69('0x56')](_0x16774c[_0x6a69('0x41')][_0x6a69('0x56')]));_0x550259[_0x6a69('0x45')]=_0x550259['attributes'][_0x6a69('0x46')]?_0x550259[_0x6a69('0x45')]:_0x31d634[_0x6a69('0x44')];_0x550259[_0x6a69('0x47')]=qs[_0x6a69('0x48')](_0x16774c[_0x6a69('0x41')][_0x6a69('0x48')]);_0x550259[_0x6a69('0x4a')]=qs[_0x6a69('0x43')](_[_0x6a69('0x49')](_0x16774c[_0x6a69('0x41')],_0x31d634['filters']));if(_0x16774c['query']['filter']){_0x550259[_0x6a69('0x4a')]=_['merge'](_0x550259[_0x6a69('0x4a')],{'$or':_[_0x6a69('0x3d')](_0x550259['attributes'],function(_0x1933cf){var _0x2c7522={};_0x2c7522[_0x1933cf]={'$like':'%'+_0x16774c[_0x6a69('0x41')][_0x6a69('0x4c')]+'%'};return _0x2c7522;})});}_0x550259=_['merge']({},_0x550259,_0x16774c[_0x6a69('0x4d')]);return _0x4d72da['getAgents'](_0x550259);}})[_0x6a69('0x1e')](function(_0x3ed4a2){if(_0x3ed4a2){_0x264a41=_0x3ed4a2['length'];if(!_0x16774c[_0x6a69('0x41')][_0x6a69('0x69')](_0x6a69('0x64'))){_0x550259[_0x6a69('0x2d')]=qs[_0x6a69('0x2d')](_0x16774c[_0x6a69('0x41')][_0x6a69('0x2d')]);_0x550259[_0x6a69('0x2b')]=qs[_0x6a69('0x2b')](_0x16774c[_0x6a69('0x41')][_0x6a69('0x2b')]);}return _0x4d72da[_0x6a69('0xb4')](_0x550259);}})[_0x6a69('0x1e')](function(_0x4fbbd4){if(_0x4fbbd4){return _0x4fbbd4?{'count':_0x264a41,'rows':_0x4fbbd4}:null;}})[_0x6a69('0x1e')](respondWithResult(_0x106ac3,null))[_0x6a69('0x53')](handleError(_0x106ac3,null));};exports['send']=function(_0x23db08,_0x5aa969,_0x242386){var _0x536ad9,_0x40a012,_0x29ece2;if(_[_0x6a69('0x75')](_0x23db08['body'][_0x6a69('0x59')])||_0x23db08['body'][_0x6a69('0x59')]===''){throw new db[(_0x6a69('0x6d'))][(_0x6a69('0x6e'))](_0x6a69('0x76'));}if(_[_0x6a69('0x75')](_0x23db08[_0x6a69('0x59')]['to'])){}_0x536ad9=_0x23db08['body']['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x23db08[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x5aa969,null))[_0x6a69('0x1e')](function(_0x1038b0){if(_0x1038b0){return db[_0x6a69('0x4e')]['find']({'where':{'id':_0x1038b0['id']},'include':[{'model':db[_0x6a69('0x7c')],'as':_0x6a69('0x7f'),'include':[{'model':db['CmContact'],'as':_0x6a69('0x87'),'where':{[_0x1038b0['mapKey']]:_0x536ad9},'limit':0x1,'order':[['updatedAt',_0x6a69('0x7d')]]}]}]})[_0x6a69('0x1e')](handleEntityNotFound(_0x5aa969,null))['then'](function(_0x4af49f){if(_0x4af49f&&_0x4af49f[_0x6a69('0x7f')]){_0x40a012=_0x4af49f[_0x6a69('0x33')]({'plain':!![]});if(_0x40a012[_0x6a69('0x7f')]&&_0x40a012['List'][_0x6a69('0x87')][_0x6a69('0x46')]){return _0x40a012['List']['Contacts'][0x0];}return db[_0x6a69('0x6c')]['create'](_[_0x6a69('0x16')](_0x23db08['body'],{'firstName':_0x536ad9,[_0x4af49f['mapKey']]:_0x536ad9,'phone':_0x536ad9,'ListId':_0x40a012[_0x6a69('0x88')]}));}})[_0x6a69('0x1e')](handleEntityNotFound(_0x5aa969,null))[_0x6a69('0x1e')](function(_0x5ca71a){if(_0x5ca71a){_0x29ece2=_0x5ca71a;return db[_0x6a69('0x8d')][_0x6a69('0x57')]({'where':{'ContactId':_0x29ece2['id'],'closed':![],'OpenchannelAccountId':_0x40a012['id']}})['then'](function(_0x3c980f){if(_0x3c980f){return[_0x3c980f,![]];}return db[_0x6a69('0x8d')]['create']({'UserId':_0x23db08[_0x6a69('0x5a')]['id'],'ContactId':_0x29ece2['id'],'OpenchannelAccountId':_0x40a012['id'],'lastMsgDirection':_0x6a69('0xb5'),'Messages':[_[_0x6a69('0x4b')](_0x23db08[_0x6a69('0x59')],{'read':![],'body':_0x23db08[_0x6a69('0x59')][_0x6a69('0x59')],'OpenchannelAccountId':_0x40a012['id'],'UserId':_0x23db08[_0x6a69('0x5a')]['id'],'ContactId':_0x29ece2['id']})]},{'include':[{'model':db[_0x6a69('0x96')],'as':_0x6a69('0xb6')}]})['then'](function(_0x5d9f47){return[_0x5d9f47,!![]];});});}})[_0x6a69('0x8e')](function(_0x17e37b,_0x124b08){if(_0x124b08){return _0x17e37b;}return db['OpenchannelMessage'][_0x6a69('0x58')](_[_0x6a69('0x4b')](_0x23db08['body'],{'read':![],'body':_0x23db08[_0x6a69('0x59')]['body'],'OpenchannelAccountId':_0x40a012['id'],'OpenchannelInteractionId':_0x17e37b['id'],'UserId':_0x23db08[_0x6a69('0x5a')]['id'],'ContactId':_0x29ece2['id']}))[_0x6a69('0x1e')](function(_0x1a7ce4){_0x17e37b[_0x6a69('0xb7')][_0x6a69('0xb6')]=[];_0x17e37b['dataValues']['Messages'][_0x6a69('0xb8')](_0x1a7ce4[_0x6a69('0xb7')]);return _0x17e37b;});});}})[_0x6a69('0x1e')](respondWithResult(_0x5aa969,null))['catch'](handleError(_0x5aa969,null));};
\ No newline at end of file
+var _0x797a=['*,*,*,*','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','fullname','Tag','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','defaults','out','Messages','OpenchannelMessage','dataValues','rimraf','request-promise','moment','bluebird','mustache','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','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','UserProfileResource','name','index','Pause','map','OpenchannelAccount','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged'];(function(_0x549a74,_0x4884ec){var _0x2e33a0=function(_0x4346c8){while(--_0x4346c8){_0x549a74['push'](_0x549a74['shift']());}};_0x2e33a0(++_0x4884ec);}(_0x797a,0xe4));var _0xa797=function(_0x3c952f,_0x45b12b){_0x3c952f=_0x3c952f-0x0;var _0x5b945e=_0x797a[_0x3c952f];return _0x5b945e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa797('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa797('0x1'));var moment=require(_0xa797('0x2'));var BPromise=require(_0xa797('0x3'));var Mustache=require(_0xa797('0x4'));var util=require(_0xa797('0x5'));var path=require(_0xa797('0x6'));var sox=require(_0xa797('0x7'));var csv=require(_0xa797('0x8'));var ejs=require(_0xa797('0x9'));var fs=require('fs');var fs_extra=require(_0xa797('0xa'));var _=require(_0xa797('0xb'));var squel=require('squel');var crypto=require(_0xa797('0xc'));var jsforce=require(_0xa797('0xd'));var deskjs=require(_0xa797('0xe'));var toCsv=require(_0xa797('0x8'));var querystring=require('querystring');var Papa=require(_0xa797('0xf'));var Redis=require('ioredis');var authService=require(_0xa797('0x10'));var qs=require(_0xa797('0x11'));var as=require(_0xa797('0x12'));var hardwareService=require(_0xa797('0x13'));var logger=require(_0xa797('0x14'))('api');var utils=require(_0xa797('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xa797('0x16')],{'host':_0xa797('0x17'),'port':0x18eb});var socket=require(_0xa797('0x18'))(new Redis(config['redis']));require(_0xa797('0x19'))[_0xa797('0x1a')](socket);var jayson=require(_0xa797('0x1b'));var client=jayson[_0xa797('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xa797('0x1c')][_0xa797('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x292874,_0x2b0e20,_0x232378,_0xf7b266){return new BPromise(function(_0x44fd48,_0x5be928){var _0x496e1a=_0xf7b266||client;return _0x496e1a[_0xa797('0x1e')](_0x292874,_0x232378)[_0xa797('0x1f')](function(_0x58ba0a){logger[_0xa797('0x20')](_0xa797('0x21'),_0x2b0e20,_0xa797('0x22'));logger[_0xa797('0x23')](_0xa797('0x24'),_0x2b0e20,_0xa797('0x22'),JSON[_0xa797('0x25')](_0x58ba0a));if(_0x58ba0a[_0xa797('0x26')]){if(_0x58ba0a[_0xa797('0x26')]['code']===0x1f4){logger[_0xa797('0x26')](_0xa797('0x21'),_0x2b0e20,_0x58ba0a['error']['message']);return _0x5be928(_0x58ba0a[_0xa797('0x26')][_0xa797('0x27')]);}logger['error'](_0xa797('0x21'),_0x2b0e20,_0x58ba0a[_0xa797('0x26')][_0xa797('0x27')]);return _0x44fd48(_0x58ba0a['error']['message']);}else{logger[_0xa797('0x20')](_0xa797('0x21'),_0x2b0e20,_0xa797('0x22'));_0x44fd48(_0x58ba0a[_0xa797('0x28')][_0xa797('0x27')]);}})[_0xa797('0x29')](function(_0x5bcedc){logger[_0xa797('0x26')](_0xa797('0x21'),_0x2b0e20,_0x5bcedc);_0x5be928(_0x5bcedc);});});}function respondWithStatusCode(_0x23ec68,_0x1b9b60){_0x1b9b60=_0x1b9b60||0xcc;return function(_0x48aa30){if(_0x48aa30){return _0x23ec68[_0xa797('0x2a')](_0x1b9b60);}return _0x23ec68[_0xa797('0x2b')](_0x1b9b60)[_0xa797('0x2c')]();};}function respondWithResult(_0x2d2701,_0x219a6e){_0x219a6e=_0x219a6e||0xc8;return function(_0x47f82d){if(_0x47f82d){return _0x2d2701['status'](_0x219a6e)[_0xa797('0x2d')](_0x47f82d);}};}function respondWithFilteredResult(_0x245cfb,_0x44c234){return function(_0x5cad3d){if(_0x5cad3d){var _0x5948cc=typeof _0x44c234[_0xa797('0x2e')]===_0xa797('0x2f')&&typeof _0x44c234['limit']===_0xa797('0x2f');var _0x4523fe=_0x5cad3d[_0xa797('0x30')];var _0x5d98d8=_0x5948cc?0x0:_0x44c234[_0xa797('0x2e')];var _0x2f36c8=_0x5948cc?_0x5cad3d[_0xa797('0x30')]:_0x44c234[_0xa797('0x2e')]+_0x44c234['limit'];var _0x5b35b5;if(_0x2f36c8>=_0x4523fe){_0x2f36c8=_0x4523fe;_0x5b35b5=0xc8;}else{_0x5b35b5=0xce;}_0x245cfb[_0xa797('0x2b')](_0x5b35b5);return _0x245cfb[_0xa797('0x31')](_0xa797('0x32'),_0x5d98d8+'-'+_0x2f36c8+'/'+_0x4523fe)['json'](_0x5cad3d);}return null;};}function patchUpdates(_0x138964){return function(_0x316b70){try{jsonpatch[_0xa797('0x33')](_0x316b70,_0x138964,!![]);}catch(_0x156afd){return BPromise[_0xa797('0x34')](_0x156afd);}return _0x316b70[_0xa797('0x35')]();};}function saveUpdates(_0x681183,_0x42a0ea){return function(_0x3ac174){if(_0x3ac174){return _0x3ac174['update'](_0x681183)[_0xa797('0x1f')](function(_0xc041c4){return _0xc041c4;});}return null;};}function removeEntity(_0x1f9cee,_0x14dfa7){return function(_0x8440a){if(_0x8440a){return _0x8440a[_0xa797('0x36')]()['then'](function(){var _0x34be47=_0x8440a['get']({'plain':!![]});var _0x457de5='OpenchannelAccounts';return db[_0xa797('0x37')][_0xa797('0x36')]({'where':{'type':_0x457de5,'resourceId':_0x34be47['id']}})[_0xa797('0x1f')](function(){return _0x8440a;});})[_0xa797('0x1f')](function(){_0x1f9cee['status'](0xcc)[_0xa797('0x2c')]();});}};}function handleEntityNotFound(_0x369bce,_0x2b9e63){return function(_0x1fbbd7){if(!_0x1fbbd7){_0x369bce[_0xa797('0x2a')](0x194);}return _0x1fbbd7;};}function handleError(_0x132f61,_0x50e225){_0x50e225=_0x50e225||0x1f4;return function(_0x1aea0b){logger[_0xa797('0x26')](_0x1aea0b['stack']);if(_0x1aea0b[_0xa797('0x38')]){delete _0x1aea0b[_0xa797('0x38')];}_0x132f61[_0xa797('0x2b')](_0x50e225)['send'](_0x1aea0b);};}exports[_0xa797('0x39')]=function(_0x111e6a,_0xaef55d){var _0x3edc72={'include':[{'model':db[_0xa797('0x3a')],'as':'mandatoryDispositionPause'}]},_0x3e174d={},_0x4f39fb={'count':0x0,'rows':[]};var _0x455a38=_[_0xa797('0x3b')](db[_0xa797('0x3c')]['rawAttributes'],function(_0x50fe6c){return{'name':_0x50fe6c[_0xa797('0x3d')],'type':_0x50fe6c['type'][_0xa797('0x3e')]};});_0x3e174d[_0xa797('0x3f')]=_['map'](_0x455a38,_0xa797('0x38'));_0x3e174d[_0xa797('0x40')]=_[_0xa797('0x41')](_0x111e6a[_0xa797('0x40')]);_0x3e174d['filters']=_[_0xa797('0x42')](_0x3e174d[_0xa797('0x3f')],_0x3e174d['query']);_0x3edc72[_0xa797('0x43')]=_[_0xa797('0x42')](_0x3e174d[_0xa797('0x3f')],qs[_0xa797('0x44')](_0x111e6a[_0xa797('0x40')][_0xa797('0x44')]));_0x3edc72[_0xa797('0x43')]=_0x3edc72[_0xa797('0x43')][_0xa797('0x45')]?_0x3edc72[_0xa797('0x43')]:_0x3e174d['model'];if(!_0x111e6a[_0xa797('0x40')][_0xa797('0x46')](_0xa797('0x47'))){_0x3edc72['limit']=qs[_0xa797('0x48')](_0x111e6a[_0xa797('0x40')]['limit']);_0x3edc72[_0xa797('0x2e')]=qs[_0xa797('0x2e')](_0x111e6a[_0xa797('0x40')][_0xa797('0x2e')]);}_0x3edc72[_0xa797('0x49')]=qs[_0xa797('0x4a')](_0x111e6a[_0xa797('0x40')]['sort']);_0x3edc72[_0xa797('0x4b')]=qs[_0xa797('0x4c')](_[_0xa797('0x4d')](_0x111e6a[_0xa797('0x40')],_0x3e174d[_0xa797('0x4c')]),_0x455a38);if(_0x111e6a[_0xa797('0x40')][_0xa797('0x4e')]){_0x3edc72[_0xa797('0x4b')]=_[_0xa797('0x4f')](_0x3edc72[_0xa797('0x4b')],{'$or':_[_0xa797('0x3b')](_0x455a38,function(_0x26c818){if(_0x26c818[_0xa797('0x50')]!==_0xa797('0x51')){var _0x4494bd={};_0x4494bd[_0x26c818['name']]={'$like':'%'+_0x111e6a[_0xa797('0x40')][_0xa797('0x4e')]+'%'};return _0x4494bd;}})});}_0x3edc72=_[_0xa797('0x4f')]({},_0x3edc72,_0x111e6a[_0xa797('0x52')]);var _0x31fbfe={'where':_0x3edc72[_0xa797('0x4b')]};return db[_0xa797('0x3c')]['count'](_0x31fbfe)[_0xa797('0x1f')](function(_0x48f16d){_0x4f39fb[_0xa797('0x30')]=_0x48f16d;if(_0x111e6a['query'][_0xa797('0x53')]){_0x3edc72['include']=[{'all':!![]}];}return db[_0xa797('0x3c')][_0xa797('0x54')](_0x3edc72);})[_0xa797('0x1f')](function(_0x1d92dd){_0x4f39fb[_0xa797('0x55')]=_0x1d92dd;return _0x4f39fb;})['then'](respondWithFilteredResult(_0xaef55d,_0x3edc72))[_0xa797('0x29')](handleError(_0xaef55d,null));};exports[_0xa797('0x56')]=function(_0x4a4d7e,_0x93a919){var _0x1c8e92={'raw':![],'where':{'id':_0x4a4d7e[_0xa797('0x57')]['id']},'include':[{'model':db[_0xa797('0x3a')],'as':_0xa797('0x58')}]},_0x5eb135={};_0x5eb135[_0xa797('0x3f')]=_['keys'](db[_0xa797('0x3c')][_0xa797('0x59')]);_0x5eb135[_0xa797('0x40')]=_[_0xa797('0x41')](_0x4a4d7e[_0xa797('0x40')]);_0x5eb135['filters']=_[_0xa797('0x42')](_0x5eb135[_0xa797('0x3f')],_0x5eb135[_0xa797('0x40')]);_0x1c8e92[_0xa797('0x43')]=_['intersection'](_0x5eb135[_0xa797('0x3f')],qs['fields'](_0x4a4d7e[_0xa797('0x40')][_0xa797('0x44')]));_0x1c8e92[_0xa797('0x43')]=_0x1c8e92[_0xa797('0x43')][_0xa797('0x45')]?_0x1c8e92['attributes']:_0x5eb135[_0xa797('0x3f')];if(_0x4a4d7e['query'][_0xa797('0x53')]){_0x1c8e92[_0xa797('0x5a')]=[{'all':!![]}];}_0x1c8e92=_[_0xa797('0x4f')]({},_0x1c8e92,_0x4a4d7e['options']);return db[_0xa797('0x3c')][_0xa797('0x5b')](_0x1c8e92)[_0xa797('0x1f')](handleEntityNotFound(_0x93a919,null))[_0xa797('0x1f')](respondWithResult(_0x93a919,null))[_0xa797('0x29')](handleError(_0x93a919,null));};exports[_0xa797('0x5c')]=function(_0x106bb5,_0x1f582a){return db[_0xa797('0x3c')][_0xa797('0x5c')](_0x106bb5[_0xa797('0x5d')],{})[_0xa797('0x1f')](function(_0x19fe44){var _0x24fe13=_0x106bb5[_0xa797('0x5e')][_0xa797('0x5f')]({'plain':!![]});if(!_0x24fe13)throw new Error(_0xa797('0x60'));if(_0x24fe13[_0xa797('0x61')]===_0xa797('0x5e')){var _0x437e17=_0x19fe44[_0xa797('0x5f')]({'plain':!![]});var _0x1f08ca='OpenchannelAccounts';return db[_0xa797('0x62')][_0xa797('0x5b')]({'where':{'name':_0x1f08ca,'userProfileId':_0x24fe13[_0xa797('0x63')]},'raw':!![]})[_0xa797('0x1f')](function(_0xe9e502){if(_0xe9e502&&_0xe9e502['autoAssociation']===0x0){return db[_0xa797('0x37')][_0xa797('0x5c')]({'name':_0x437e17[_0xa797('0x38')],'resourceId':_0x437e17['id'],'type':_0xe9e502['name'],'sectionId':_0xe9e502['id']},{})[_0xa797('0x1f')](function(){return _0x19fe44;});}else{return _0x19fe44;}})[_0xa797('0x29')](function(_0x53180f){logger['error'](_0xa797('0x64'),_0x53180f);throw _0x53180f;});}return _0x19fe44;})[_0xa797('0x1f')](respondWithResult(_0x1f582a,0xc9))[_0xa797('0x29')](handleError(_0x1f582a,null));};exports['update']=function(_0x1ea3f2,_0x4c73df){if(_0x1ea3f2['body']['id']){delete _0x1ea3f2[_0xa797('0x5d')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x1ea3f2['params']['id']},'include':[{'model':db[_0xa797('0x3a')],'as':'mandatoryDispositionPause'}]})[_0xa797('0x1f')](handleEntityNotFound(_0x4c73df,null))[_0xa797('0x1f')](saveUpdates(_0x1ea3f2[_0xa797('0x5d')],null))[_0xa797('0x1f')](respondWithResult(_0x4c73df,null))[_0xa797('0x29')](handleError(_0x4c73df,null));};exports[_0xa797('0x36')]=function(_0x1d49f2,_0x37a8eb){return db[_0xa797('0x3c')][_0xa797('0x5b')]({'where':{'id':_0x1d49f2['params']['id']}})[_0xa797('0x1f')](handleEntityNotFound(_0x37a8eb,null))[_0xa797('0x1f')](removeEntity(_0x37a8eb,null))['catch'](handleError(_0x37a8eb,null));};exports[_0xa797('0x65')]=function(_0x565b96,_0x5bd8b3){return db[_0xa797('0x3c')][_0xa797('0x65')]()[_0xa797('0x1f')](respondWithResult(_0x5bd8b3,null))[_0xa797('0x29')](handleError(_0x5bd8b3,null));};exports['addDisposition']=function(_0x11768c,_0x3da112,_0x5d681e){if(_0x11768c['body']['id']){delete _0x11768c[_0xa797('0x5d')]['id'];}return db[_0xa797('0x3c')][_0xa797('0x5b')]({'where':{'id':_0x11768c[_0xa797('0x57')]['id']}})[_0xa797('0x1f')](handleEntityNotFound(_0x3da112,null))[_0xa797('0x1f')](function(_0x24eb32){if(_0x24eb32){_0x11768c['body'][_0xa797('0x66')]=_0x24eb32['id'];return db[_0xa797('0x67')]['create'](_0x11768c['body']);}})[_0xa797('0x1f')](respondWithResult(_0x3da112,null))['catch'](handleError(_0x3da112,null));};exports[_0xa797('0x68')]=function(_0x8d9a41,_0x169cac,_0x32489e){var _0x2346a7={'raw':![],'where':{}};var _0x3b9e6a={};var _0x4d1376={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xa797('0x69')]({'where':{'id':_0x8d9a41[_0xa797('0x57')]['id']}})['then'](handleEntityNotFound(_0x169cac,null))[_0xa797('0x1f')](function(_0x5ebb8b){if(_0x5ebb8b){_0x3b9e6a[_0xa797('0x3f')]=_[_0xa797('0x41')](db[_0xa797('0x67')]['rawAttributes']);_0x3b9e6a['query']=_[_0xa797('0x41')](_0x8d9a41['query']);_0x3b9e6a[_0xa797('0x4c')]=_['intersection'](_0x3b9e6a[_0xa797('0x3f')],_0x3b9e6a['query']);_0x2346a7[_0xa797('0x43')]=_[_0xa797('0x42')](_0x3b9e6a[_0xa797('0x3f')],qs[_0xa797('0x44')](_0x8d9a41[_0xa797('0x40')][_0xa797('0x44')]));_0x2346a7['attributes']=_0x2346a7[_0xa797('0x43')]['length']?_0x2346a7[_0xa797('0x43')]:_0x3b9e6a[_0xa797('0x3f')];if(!_0x8d9a41[_0xa797('0x40')]['hasOwnProperty'](_0xa797('0x47'))){_0x2346a7['limit']=qs[_0xa797('0x48')](_0x8d9a41[_0xa797('0x40')][_0xa797('0x48')]);_0x2346a7[_0xa797('0x2e')]=qs[_0xa797('0x2e')](_0x8d9a41[_0xa797('0x40')][_0xa797('0x2e')]);}_0x2346a7[_0xa797('0x49')]=qs['sort'](_0x8d9a41['query']['sort']);_0x2346a7[_0xa797('0x4b')]=qs[_0xa797('0x4c')](_['pick'](_0x8d9a41[_0xa797('0x40')],_0x3b9e6a[_0xa797('0x4c')]));_0x2346a7[_0xa797('0x4b')]['OpenchannelAccountId']=_0x5ebb8b['id'];if(_0x8d9a41[_0xa797('0x40')][_0xa797('0x4e')]){_0x2346a7[_0xa797('0x4b')]=_['merge'](_0x2346a7[_0xa797('0x4b')],{'$or':_[_0xa797('0x3b')](_0x2346a7['attributes'],function(_0x3c6469){var _0x4a9244={};_0x4a9244[_0x3c6469]={'$like':'%'+_0x8d9a41[_0xa797('0x40')][_0xa797('0x4e')]+'%'};return _0x4a9244;})});}_0x2346a7=_['merge']({},_0x2346a7,_0x8d9a41['options']);return db[_0xa797('0x67')][_0xa797('0x30')]({'where':_0x2346a7[_0xa797('0x4b')]})[_0xa797('0x1f')](function(_0xfb9cf8){_0x4d1376['count']=_0xfb9cf8;if(_0x8d9a41[_0xa797('0x40')]['includeAll']){_0x2346a7[_0xa797('0x5a')]=[{'all':!![]}];}return db[_0xa797('0x67')][_0xa797('0x54')](_0x2346a7);})['then'](function(_0x543177){_0x4d1376[_0xa797('0x55')]=_0x543177;return _0x4d1376;});}})[_0xa797('0x1f')](respondWithFilteredResult(_0x169cac,_0x2346a7))[_0xa797('0x29')](handleError(_0x169cac,null));};exports[_0xa797('0x6a')]=function(_0x7ec9c3,_0x4e1282,_0x360431){return db['OpenchannelAccount'][_0xa797('0x5b')]({'where':{'id':_0x7ec9c3[_0xa797('0x57')]['id']}})[_0xa797('0x1f')](handleEntityNotFound(_0x4e1282,null))[_0xa797('0x1f')](function(_0x4cf7c9){if(_0x4cf7c9){return _0x4cf7c9['removeDispositions'](_0x7ec9c3['query'][_0xa797('0x6b')]);}})[_0xa797('0x1f')](respondWithStatusCode(_0x4e1282,null))[_0xa797('0x29')](handleError(_0x4e1282,null));};exports[_0xa797('0x6c')]=function(_0x49e8cf,_0x9ae209,_0x655fc5){if(_0x49e8cf[_0xa797('0x5d')]['id']){delete _0x49e8cf[_0xa797('0x5d')]['id'];}return db[_0xa797('0x3c')]['find']({'where':{'id':_0x49e8cf[_0xa797('0x57')]['id']}})[_0xa797('0x1f')](handleEntityNotFound(_0x9ae209,null))['then'](function(_0x57b0f7){if(_0x57b0f7){_0x49e8cf[_0xa797('0x5d')][_0xa797('0x66')]=_0x57b0f7['id'];return db[_0xa797('0x6d')][_0xa797('0x5c')](_0x49e8cf[_0xa797('0x5d')]);}})['then'](respondWithResult(_0x9ae209,null))['catch'](handleError(_0x9ae209,null));};exports[_0xa797('0x6e')]=function(_0x4ea681,_0x589be2,_0x96b52){var _0x31f6b2={'raw':![],'where':{}};var _0x1ab61b={};var _0x52b7df={'count':0x0,'rows':[]};return db[_0xa797('0x3c')][_0xa797('0x69')]({'where':{'id':_0x4ea681[_0xa797('0x57')]['id']}})[_0xa797('0x1f')](handleEntityNotFound(_0x589be2,null))['then'](function(_0x16e6df){if(_0x16e6df){_0x1ab61b[_0xa797('0x3f')]=_[_0xa797('0x41')](db[_0xa797('0x6d')][_0xa797('0x59')]);_0x1ab61b[_0xa797('0x40')]=_[_0xa797('0x41')](_0x4ea681[_0xa797('0x40')]);_0x1ab61b['filters']=_[_0xa797('0x42')](_0x1ab61b['model'],_0x1ab61b['query']);_0x31f6b2[_0xa797('0x43')]=_[_0xa797('0x42')](_0x1ab61b[_0xa797('0x3f')],qs[_0xa797('0x44')](_0x4ea681[_0xa797('0x40')][_0xa797('0x44')]));_0x31f6b2['attributes']=_0x31f6b2['attributes'][_0xa797('0x45')]?_0x31f6b2[_0xa797('0x43')]:_0x1ab61b[_0xa797('0x3f')];if(!_0x4ea681[_0xa797('0x40')]['hasOwnProperty'](_0xa797('0x47'))){_0x31f6b2['limit']=qs[_0xa797('0x48')](_0x4ea681[_0xa797('0x40')][_0xa797('0x48')]);_0x31f6b2[_0xa797('0x2e')]=qs[_0xa797('0x2e')](_0x4ea681[_0xa797('0x40')][_0xa797('0x2e')]);}_0x31f6b2['order']=qs[_0xa797('0x4a')](_0x4ea681['query'][_0xa797('0x4a')]);_0x31f6b2[_0xa797('0x4b')]=qs['filters'](_['pick'](_0x4ea681['query'],_0x1ab61b['filters']));_0x31f6b2[_0xa797('0x4b')][_0xa797('0x66')]=_0x16e6df['id'];if(_0x4ea681[_0xa797('0x40')]['filter']){_0x31f6b2['where']=_[_0xa797('0x4f')](_0x31f6b2[_0xa797('0x4b')],{'$or':_[_0xa797('0x3b')](_0x31f6b2[_0xa797('0x43')],function(_0x4c663c){var _0x4ce8c6={};_0x4ce8c6[_0x4c663c]={'$like':'%'+_0x4ea681[_0xa797('0x40')][_0xa797('0x4e')]+'%'};return _0x4ce8c6;})});}_0x31f6b2=_['merge']({},_0x31f6b2,_0x4ea681[_0xa797('0x52')]);return db['CannedAnswer'][_0xa797('0x30')]({'where':_0x31f6b2[_0xa797('0x4b')]})[_0xa797('0x1f')](function(_0x5e4336){_0x52b7df[_0xa797('0x30')]=_0x5e4336;if(_0x4ea681[_0xa797('0x40')]['includeAll']){_0x31f6b2['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xa797('0x54')](_0x31f6b2);})[_0xa797('0x1f')](function(_0x5d4996){_0x52b7df[_0xa797('0x55')]=_0x5d4996;return _0x52b7df;});}})[_0xa797('0x1f')](respondWithFilteredResult(_0x589be2,_0x31f6b2))[_0xa797('0x29')](handleError(_0x589be2,null));};exports[_0xa797('0x6f')]=function(_0x56972e,_0x8b89e5,_0xcd855c){return db[_0xa797('0x3c')][_0xa797('0x5b')]({'where':{'id':_0x56972e[_0xa797('0x57')]['id']}})[_0xa797('0x1f')](handleEntityNotFound(_0x8b89e5,null))[_0xa797('0x1f')](function(_0x360d71){if(_0x360d71){return _0x360d71[_0xa797('0x6f')](_0x56972e[_0xa797('0x40')]['ids']);}})['then'](respondWithStatusCode(_0x8b89e5,null))['catch'](handleError(_0x8b89e5,null));};exports[_0xa797('0x70')]=function(_0x50a9e8,_0xdd1c3,_0x35a1d5){var _0x4b4c58={'body':_0x50a9e8[_0xa797('0x5d')],'channel':'openchannel'};var _0x56c3d5=[];var _0x54a307=[];var _0x3bd34c={};var _0x33c94c=![];return db[_0xa797('0x71')][_0xa797('0x65')]()[_0xa797('0x1f')](function(_0x42278f){if(!_0x42278f){throw new db['Sequelize']['ValidationError'](_0xa797('0x72'));}_0x56c3d5=_[_0xa797('0x73')](_[_0xa797('0x41')](_0x42278f),[_0xa797('0x74'),_0xa797('0x75')]);_0x54a307=_[_0xa797('0x73')](_[_0xa797('0x41')](_0x42278f),[_0xa797('0x74'),_0xa797('0x75'),_0xa797('0x76'),_0xa797('0x77')]);if(_0x50a9e8[_0xa797('0x5d')]['id']){delete _0x50a9e8[_0xa797('0x5d')]['id'];}if(_[_0xa797('0x78')](_0x50a9e8[_0xa797('0x5d')][_0xa797('0x79')])){throw new db[(_0xa797('0x7a'))][(_0xa797('0x7b'))](_0xa797('0x7c'));}if(_[_0xa797('0x78')](_0x50a9e8['body'][_0xa797('0x5d')])||_0x50a9e8[_0xa797('0x5d')][_0xa797('0x5d')]===''){throw new db[(_0xa797('0x7a'))][(_0xa797('0x7b'))](_0xa797('0x7d'));}if(_[_0xa797('0x78')](_0x50a9e8[_0xa797('0x5d')][_0xa797('0x7e')])){throw new db[(_0xa797('0x7a'))][(_0xa797('0x7b'))](_0xa797('0x7f')+_0x54a307);}if(!_[_0xa797('0x80')](_0x54a307,_0x50a9e8[_0xa797('0x5d')]['mapKey'])){throw new db[(_0xa797('0x7a'))][(_0xa797('0x7b'))](_0xa797('0x81')+_0x54a307);}_0x3bd34c[_0x50a9e8[_0xa797('0x5d')][_0xa797('0x7e')]]=_0x50a9e8['body'][_0xa797('0x79')];})[_0xa797('0x1f')](function(){return db[_0xa797('0x3c')][_0xa797('0x5b')]({'where':{'id':_0x50a9e8[_0xa797('0x57')]['id']},'include':[{'model':db[_0xa797('0x82')],'as':_0xa797('0x83'),'include':[{'model':db[_0xa797('0x71')],'as':_0xa797('0x84'),'where':_0x3bd34c,'limit':0x1,'order':[[_0xa797('0x75'),_0xa797('0x85')]]}]},{'model':db['OpenchannelApplication'],'as':_0xa797('0x86')}]});})[_0xa797('0x1f')](handleEntityNotFound(_0xdd1c3,null))[_0xa797('0x1f')](function(_0xd89c45){if(_0xd89c45&&_0xd89c45[_0xa797('0x83')]){_0x4b4c58[_0xa797('0x87')]=_0xd89c45;_0x4b4c58['applications']=_0xd89c45[_0xa797('0x86')];_0x4b4c58['list']=_0xd89c45['List'];_0x4b4c58[_0xa797('0x88')]=_['orderBy'](_0x4b4c58[_0xa797('0x88')],[_0xa797('0x89')],[_0xa797('0x8a')]);if(_0x4b4c58[_0xa797('0x87')][_0xa797('0x86')]){delete _0x4b4c58['account']['Applications'];}if(_0x4b4c58['account'][_0xa797('0x83')]&&_0x4b4c58[_0xa797('0x87')][_0xa797('0x83')]['Contacts'][_0xa797('0x45')]){return _0x4b4c58[_0xa797('0x87')][_0xa797('0x83')][_0xa797('0x84')][0x0];}var _0xcc9fbb=_['defaults'](_0x50a9e8[_0xa797('0x5d')],{'firstName':_0x50a9e8[_0xa797('0x5d')][_0xa797('0x79')],'ListId':_0xd89c45['ListId']});_0xcc9fbb[_0x50a9e8[_0xa797('0x5d')][_0xa797('0x7e')]]=_0x50a9e8[_0xa797('0x5d')][_0xa797('0x79')];return db[_0xa797('0x71')][_0xa797('0x5c')](_0xcc9fbb,{'fields':_0x56c3d5,'raw':!![]});}})[_0xa797('0x1f')](handleEntityNotFound(_0xdd1c3,null))[_0xa797('0x1f')](function(_0x469407){_0x4b4c58[_0xa797('0x8b')]=_0x469407;if(_0x469407){var _0x1c410a={'ContactId':_0x469407['id'],'OpenchannelAccountId':_0x50a9e8[_0xa797('0x57')]['id'],'from':(_0x469407[_0xa797('0x8c')]||'')+'\x20'+(_0x469407[_0xa797('0x8d')]||'')};var _0x55e023={'OpenchannelAccountId':_0x50a9e8['params']['id'],'closed':![]};if(_0x50a9e8['body'][_0xa797('0x8e')]){_0x55e023[_0xa797('0x8e')]=_0x50a9e8['body'][_0xa797('0x8e')];return db[_0xa797('0x8f')]['find']({'where':_0x55e023})[_0xa797('0x1f')](function(_0x193c09){if(_0x193c09){return[_0x193c09,![]];}_0x1c410a[_0xa797('0x8e')]=_0x50a9e8['body'][_0xa797('0x8e')];_0x1c410a['externalUrl']=_0x50a9e8[_0xa797('0x5d')][_0xa797('0x90')];return db[_0xa797('0x8f')][_0xa797('0x5c')](_0x1c410a)[_0xa797('0x1f')](function(_0xa76bd7){return[_0xa76bd7,!![]];});});}else{_0x55e023[_0xa797('0x8e')]=null;}_0x55e023[_0xa797('0x91')]=_0x469407['id'];return db[_0xa797('0x8f')][_0xa797('0x5b')]({'where':_0x55e023})[_0xa797('0x1f')](function(_0x3e26bc){if(_0x3e26bc){return[_0x3e26bc,![]];}return db[_0xa797('0x8f')]['create'](_0x1c410a)[_0xa797('0x1f')](function(_0x36ddf0){return[_0x36ddf0,!![]];});});}})[_0xa797('0x92')](function(_0x39f9e7,_0x47eefc){if(_0x39f9e7){_0x33c94c=_0x47eefc;if(!_0x47eefc){var _0x303ec4={'from':(_0x4b4c58[_0xa797('0x8b')][_0xa797('0x8c')]||'')+'\x20'+(_0x4b4c58[_0xa797('0x8b')][_0xa797('0x8d')]||'')};if(_0x50a9e8[_0xa797('0x5d')][_0xa797('0x8e')]&&_0x50a9e8[_0xa797('0x5d')][_0xa797('0x93')]&&_0x50a9e8[_0xa797('0x5d')][_0xa797('0x8e')]!=_0x50a9e8[_0xa797('0x5d')][_0xa797('0x93')]){_0x303ec4[_0xa797('0x8e')]=_0x50a9e8[_0xa797('0x5d')][_0xa797('0x93')];}return _0x39f9e7['update'](_0x303ec4);}else{return _0x39f9e7;}}})[_0xa797('0x1f')](function(_0xeb4415){_0x4b4c58[_0xa797('0x94')]=_0xeb4415[_0xa797('0x5f')]({'plain':!![]});_0x4b4c58['interaction']['created']=_0x33c94c;if(_0x4b4c58[_0xa797('0x94')][_0xa797('0x95')]){if(_0x4b4c58[_0xa797('0x87')][_0xa797('0x96')]){_0x4b4c58['applications'][_0xa797('0x97')]({'id':0x0,'priority':_0x4b4c58[_0xa797('0x88')][_0xa797('0x45')]+0x1,'app':_0xa797('0x98'),'appdata':_0xa797('0x99'),'interval':_0xa797('0x9a')});}}return db['OpenchannelMessage'][_0xa797('0x5c')]({'body':_0x50a9e8[_0xa797('0x5d')][_0xa797('0x5d')],'OpenchannelAccountId':_0x50a9e8[_0xa797('0x57')]['id'],'OpenchannelInteractionId':_0xeb4415['id'],'direction':'in','ContactId':_0x4b4c58[_0xa797('0x8b')]['id'],'AttachmentId':_0x50a9e8['body'][_0xa797('0x9b')]});})[_0xa797('0x1f')](function(_0x5db87c){_0x4b4c58[_0xa797('0x27')]=_0x5db87c;if(_0x4b4c58[_0xa797('0x94')]['UserId']){return db[_0xa797('0x9c')][_0xa797('0x5b')]({'attributes':['id','name'],'where':{'id':_0x4b4c58[_0xa797('0x94')][_0xa797('0x9d')]}})[_0xa797('0x1f')](function(_0x206a8a){if(_0x206a8a){_0x4b4c58[_0xa797('0x88')][_0xa797('0x9e')]({'id':0x0,'priority':0x0,'app':_0xa797('0x9f'),'appdata':_0x206a8a[_0xa797('0x38')]+','+(_0x4b4c58[_0xa797('0x87')][_0xa797('0xa0')]||0xa),'interval':_0xa797('0x9a')});_0x4b4c58[_0xa797('0xa1')]=![];}return respondWithRpcPromise(_0xa797('0xa2'),_0xa797('0xa3'),_0x4b4c58);});}return respondWithRpcPromise(_0xa797('0xa2'),_0xa797('0xa3'),_0x4b4c58);})['then'](function(_0x3612aa){respondWithRpcPromise('EventManager',_0xa797('0xa4'),{'event':_0xa797('0x70'),'message':_0x3612aa},client9002);return _0x3612aa;})[_0xa797('0x1f')](respondWithResult(_0xdd1c3,null))[_0xa797('0x29')](handleError(_0xdd1c3,null));};exports[_0xa797('0xa5')]=function(_0x4bdca4,_0x21c55b,_0xfdb699){return db[_0xa797('0x3c')][_0xa797('0x69')]({'where':{'id':_0x4bdca4[_0xa797('0x57')]['id']}})[_0xa797('0x1f')](handleEntityNotFound(_0x21c55b,null))[_0xa797('0x1f')](function(_0x52765f){if(_0x52765f){return db[_0xa797('0xa6')][_0xa797('0xa7')](function(_0x38a011){return db[_0xa797('0xa8')][_0xa797('0x36')]({'where':{'OpenchannelAccountId':_0x4bdca4[_0xa797('0x57')]['id']},'transaction':_0x38a011})[_0xa797('0x1f')](function(_0x5053e1){var _0x435e38=_[_0xa797('0x3b')](_0x4bdca4[_0xa797('0x5d')],function(_0x55c23b){_0x55c23b[_0xa797('0x66')]=_0x4bdca4[_0xa797('0x57')]['id'];return _0x55c23b;});return db[_0xa797('0xa8')][_0xa797('0xa9')](_0x435e38,{'transaction':_0x38a011});});})[_0xa797('0x1f')](function(){return db[_0xa797('0xa8')][_0xa797('0xaa')]({'where':{'OpenchannelAccountId':_0x4bdca4[_0xa797('0x57')]['id']},'order':_0xa797('0x89')});});}})[_0xa797('0x1f')](respondWithResult(_0x21c55b,null))[_0xa797('0x29')](handleError(_0x21c55b,null));};exports[_0xa797('0xab')]=function(_0x325cd2,_0x3c664c,_0x119589){var _0x468a8a={};var _0x21a5b7={};var _0x3ffc71;var _0x1110b0;return db['OpenchannelAccount'][_0xa797('0x69')]({'where':{'id':_0x325cd2[_0xa797('0x57')]['id']}})[_0xa797('0x1f')](handleEntityNotFound(_0x3c664c,null))[_0xa797('0x1f')](function(_0x455815){if(_0x455815){_0x3ffc71=_0x455815;_0x21a5b7['model']=_[_0xa797('0x41')](db[_0xa797('0xa8')][_0xa797('0x59')]);_0x21a5b7[_0xa797('0x40')]=_[_0xa797('0x41')](_0x325cd2[_0xa797('0x40')]);_0x21a5b7[_0xa797('0x4c')]=_[_0xa797('0x42')](_0x21a5b7['model'],_0x21a5b7['query']);_0x468a8a[_0xa797('0x43')]=_[_0xa797('0x42')](_0x21a5b7[_0xa797('0x3f')],qs['fields'](_0x325cd2[_0xa797('0x40')][_0xa797('0x44')]));_0x468a8a[_0xa797('0x43')]=_0x468a8a['attributes']['length']?_0x468a8a['attributes']:_0x21a5b7[_0xa797('0x3f')];_0x468a8a['order']=qs['sort'](_0x325cd2[_0xa797('0x40')][_0xa797('0x4a')]);_0x468a8a[_0xa797('0x4b')]=qs[_0xa797('0x4c')](_[_0xa797('0x4d')](_0x325cd2[_0xa797('0x40')],_0x21a5b7['filters']));if(_0x325cd2[_0xa797('0x40')][_0xa797('0x4e')]){_0x468a8a[_0xa797('0x4b')]=_[_0xa797('0x4f')](_0x468a8a['where'],{'$or':_[_0xa797('0x3b')](_0x468a8a[_0xa797('0x43')],function(_0x50a2a3){var _0x19502b={};_0x19502b[_0x50a2a3]={'$like':'%'+_0x325cd2[_0xa797('0x40')][_0xa797('0x4e')]+'%'};return _0x19502b;})});}_0x468a8a=_['merge']({},_0x468a8a,_0x325cd2[_0xa797('0x52')]);return _0x3ffc71[_0xa797('0xab')](_0x468a8a);}})[_0xa797('0x1f')](function(_0x4d5ca5){if(_0x4d5ca5){_0x1110b0=_0x4d5ca5['length'];if(!_0x325cd2[_0xa797('0x40')][_0xa797('0x46')](_0xa797('0x47'))){_0x468a8a[_0xa797('0x48')]=qs[_0xa797('0x48')](_0x325cd2[_0xa797('0x40')]['limit']);_0x468a8a[_0xa797('0x2e')]=qs['offset'](_0x325cd2[_0xa797('0x40')]['offset']);}return _0x3ffc71[_0xa797('0xab')](_0x468a8a);}})[_0xa797('0x1f')](function(_0x537686){if(_0x537686){return _0x537686?{'count':_0x1110b0,'rows':_0x537686}:null;}})[_0xa797('0x1f')](respondWithResult(_0x3c664c,null))['catch'](handleError(_0x3c664c,null));};exports[_0xa797('0xac')]=function(_0xe60b83,_0x74252b,_0x54ef86){var _0x17645f={'raw':![],'where':{}};var _0x50889e={};var _0x55c433={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xa797('0x69')]({'where':{'id':_0xe60b83[_0xa797('0x57')]['id']}})[_0xa797('0x1f')](handleEntityNotFound(_0x74252b,null))[_0xa797('0x1f')](function(_0x29e865){if(_0x29e865){_0x50889e[_0xa797('0x3f')]=_[_0xa797('0x41')](db[_0xa797('0x8f')]['rawAttributes']);_0x50889e[_0xa797('0x40')]=_['keys'](_0xe60b83[_0xa797('0x40')]);_0x50889e['filters']=_[_0xa797('0x42')](_0x50889e[_0xa797('0x3f')],_0x50889e[_0xa797('0x40')]);_0x17645f['attributes']=_[_0xa797('0x42')](_0x50889e[_0xa797('0x3f')],qs[_0xa797('0x44')](_0xe60b83[_0xa797('0x40')][_0xa797('0x44')]));_0x17645f['attributes']=_0x17645f[_0xa797('0x43')][_0xa797('0x45')]?_0x17645f[_0xa797('0x43')]:_0x50889e['model'];if(!_0xe60b83[_0xa797('0x40')][_0xa797('0x46')](_0xa797('0x47'))){_0x17645f[_0xa797('0x48')]=qs[_0xa797('0x48')](_0xe60b83[_0xa797('0x40')][_0xa797('0x48')]);_0x17645f[_0xa797('0x2e')]=qs['offset'](_0xe60b83[_0xa797('0x40')][_0xa797('0x2e')]);}_0x17645f[_0xa797('0x49')]=qs[_0xa797('0x4a')](_0xe60b83['query'][_0xa797('0x4a')]);_0x17645f[_0xa797('0x4b')]=qs[_0xa797('0x4c')](_[_0xa797('0x4d')](_0xe60b83[_0xa797('0x40')],_0x50889e[_0xa797('0x4c')]));_0x17645f['where'][_0xa797('0x66')]=_0x29e865['id'];if(_0xe60b83[_0xa797('0x40')][_0xa797('0x4e')]){_0x17645f['where']=_[_0xa797('0x4f')](_0x17645f['where'],{'$or':_[_0xa797('0x3b')](_0x17645f['attributes'],function(_0x4f93a1){var _0x4169c4={};_0x4169c4[_0x4f93a1]={'$like':'%'+_0xe60b83['query'][_0xa797('0x4e')]+'%'};return _0x4169c4;})});}_0x17645f=_[_0xa797('0x4f')]({},_0x17645f,_0xe60b83[_0xa797('0x52')]);return db[_0xa797('0x8f')][_0xa797('0x30')]({'where':_0x17645f[_0xa797('0x4b')]})[_0xa797('0x1f')](function(_0x48ea4c){_0x55c433[_0xa797('0x30')]=_0x48ea4c;if(_0xe60b83[_0xa797('0x40')][_0xa797('0x53')]){_0x17645f[_0xa797('0x5a')]=[{'model':db[_0xa797('0x71')],'as':'Contact','required':![]},{'model':db[_0xa797('0x9c')],'as':'Owner','attributes':[_0xa797('0x38'),_0xa797('0xad'),'internal'],'required':![]},{'model':db[_0xa797('0xae')],'as':_0xa797('0xaf'),'attributes':['id',_0xa797('0x38'),'color'],'where':_0xe60b83[_0xa797('0x40')][_0xa797('0xb0')]?{'id':_0xe60b83[_0xa797('0x40')]['tag']}:undefined,'required':_0xe60b83[_0xa797('0x40')][_0xa797('0xb0')]?!![]:![]}];}return db[_0xa797('0x8f')][_0xa797('0x54')](_0x17645f);})['then'](function(_0x52ea68){_0x55c433['rows']=_0x52ea68;return _0x55c433;});}})[_0xa797('0x1f')](respondWithFilteredResult(_0x74252b,_0x17645f))['catch'](handleError(_0x74252b,null));};exports['addAgents']=function(_0x39a334,_0x4fa0f6,_0x1ebcd9){return db[_0xa797('0x3c')][_0xa797('0x5b')]({'where':{'id':_0x39a334[_0xa797('0x57')]['id']}})[_0xa797('0x1f')](handleEntityNotFound(_0x4fa0f6,null))['then'](function(_0x231dc2){if(_0x231dc2){return _0x231dc2[_0xa797('0xb1')](_0x39a334[_0xa797('0x5d')][_0xa797('0x6b')],_[_0xa797('0xb2')](_0x39a334['body'],[_0xa797('0x6b'),'id'])||{})[_0xa797('0x92')](function(_0xb4aa30){for(var _0x4fce46=0x0;_0x4fce46<_0x39a334['body'][_0xa797('0x6b')]['length'];_0x4fce46+=0x1){socket[_0xa797('0xb3')](_0xa797('0xb4'),{'UserId':Number(_0x39a334[_0xa797('0x5d')][_0xa797('0x6b')][_0x4fce46]),'OpenchannelAccountId':Number(_0x39a334['params']['id'])});}return _0xb4aa30;});}})[_0xa797('0x1f')](respondWithResult(_0x4fa0f6,null))[_0xa797('0x29')](handleError(_0x4fa0f6,null));};exports[_0xa797('0xb5')]=function(_0x5ef06f,_0x3ac0cd,_0x3824de){return db['OpenchannelAccount'][_0xa797('0x5b')]({'where':{'id':_0x5ef06f[_0xa797('0x57')]['id']}})[_0xa797('0x1f')](handleEntityNotFound(_0x3ac0cd,null))[_0xa797('0x1f')](function(_0x23aa09){if(_0x23aa09){return _0x23aa09[_0xa797('0xb5')](_0x5ef06f[_0xa797('0x40')][_0xa797('0x6b')])[_0xa797('0x1f')](function(){if(_[_0xa797('0xb6')](_0x5ef06f[_0xa797('0x40')][_0xa797('0x6b')])){for(var _0x752ab7=0x0;_0x752ab7<_0x5ef06f['query'][_0xa797('0x6b')][_0xa797('0x45')];_0x752ab7+=0x1){socket[_0xa797('0xb3')](_0xa797('0xb7'),{'UserId':Number(_0x5ef06f[_0xa797('0x40')][_0xa797('0x6b')][_0x752ab7]),'OpenchannelAccountId':Number(_0x5ef06f[_0xa797('0x57')]['id'])});}}else{socket[_0xa797('0xb3')]('userOpenchannelAccount:remove',{'UserId':Number(_0x5ef06f[_0xa797('0x40')][_0xa797('0x6b')]),'OpenchannelAccountId':Number(_0x5ef06f[_0xa797('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x3ac0cd,null))[_0xa797('0x29')](handleError(_0x3ac0cd,null));};exports[_0xa797('0xb8')]=function(_0x2c0071,_0x29203e,_0x44b64b){var _0x4ff083={};var _0x5f4181={};var _0x55387f;var _0x2a4c11;return db[_0xa797('0x3c')][_0xa797('0x69')]({'where':{'id':_0x2c0071['params']['id']}})[_0xa797('0x1f')](handleEntityNotFound(_0x29203e,null))['then'](function(_0x90c033){if(_0x90c033){_0x55387f=_0x90c033;_0x5f4181[_0xa797('0x3f')]=_['keys'](db['User'][_0xa797('0x59')]);_0x5f4181[_0xa797('0x40')]=_['keys'](_0x2c0071['query']);_0x5f4181[_0xa797('0x4c')]=_[_0xa797('0x42')](_0x5f4181[_0xa797('0x3f')],_0x5f4181[_0xa797('0x40')]);_0x4ff083[_0xa797('0x43')]=_[_0xa797('0x42')](_0x5f4181[_0xa797('0x3f')],qs[_0xa797('0x44')](_0x2c0071[_0xa797('0x40')][_0xa797('0x44')]));_0x4ff083[_0xa797('0x43')]=_0x4ff083[_0xa797('0x43')][_0xa797('0x45')]?_0x4ff083[_0xa797('0x43')]:_0x5f4181[_0xa797('0x3f')];_0x4ff083[_0xa797('0x49')]=qs[_0xa797('0x4a')](_0x2c0071[_0xa797('0x40')]['sort']);_0x4ff083['where']=qs[_0xa797('0x4c')](_[_0xa797('0x4d')](_0x2c0071[_0xa797('0x40')],_0x5f4181[_0xa797('0x4c')]));if(_0x2c0071[_0xa797('0x40')][_0xa797('0x4e')]){_0x4ff083[_0xa797('0x4b')]=_['merge'](_0x4ff083[_0xa797('0x4b')],{'$or':_[_0xa797('0x3b')](_0x4ff083[_0xa797('0x43')],function(_0x32b956){var _0x4af595={};_0x4af595[_0x32b956]={'$like':'%'+_0x2c0071[_0xa797('0x40')]['filter']+'%'};return _0x4af595;})});}_0x4ff083=_[_0xa797('0x4f')]({},_0x4ff083,_0x2c0071[_0xa797('0x52')]);return _0x55387f[_0xa797('0xb8')](_0x4ff083);}})[_0xa797('0x1f')](function(_0x25ad4d){if(_0x25ad4d){_0x2a4c11=_0x25ad4d['length'];if(!_0x2c0071['query'][_0xa797('0x46')]('nolimit')){_0x4ff083[_0xa797('0x48')]=qs[_0xa797('0x48')](_0x2c0071['query'][_0xa797('0x48')]);_0x4ff083[_0xa797('0x2e')]=qs[_0xa797('0x2e')](_0x2c0071['query'][_0xa797('0x2e')]);}return _0x55387f[_0xa797('0xb8')](_0x4ff083);}})[_0xa797('0x1f')](function(_0x182474){if(_0x182474){return _0x182474?{'count':_0x2a4c11,'rows':_0x182474}:null;}})[_0xa797('0x1f')](respondWithResult(_0x29203e,null))[_0xa797('0x29')](handleError(_0x29203e,null));};exports[_0xa797('0xb9')]=function(_0x41859a,_0x5d308a,_0x3c2258){var _0x41c778,_0x46fcd8,_0x10ae88;if(_[_0xa797('0x78')](_0x41859a['body']['body'])||_0x41859a[_0xa797('0x5d')][_0xa797('0x5d')]===''){throw new db['Sequelize']['ValidationError'](_0xa797('0x7d'));}if(_['isNil'](_0x41859a['body']['to'])){}_0x41c778=_0x41859a[_0xa797('0x5d')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x41859a[_0xa797('0x57')]['id']}})[_0xa797('0x1f')](handleEntityNotFound(_0x5d308a,null))['then'](function(_0x1e7b4c){if(_0x1e7b4c){return db[_0xa797('0x3c')][_0xa797('0x5b')]({'where':{'id':_0x1e7b4c['id']},'include':[{'model':db[_0xa797('0x82')],'as':_0xa797('0x83'),'include':[{'model':db[_0xa797('0x71')],'as':_0xa797('0x84'),'where':{[_0x1e7b4c[_0xa797('0x7e')]]:_0x41c778},'limit':0x1,'order':[[_0xa797('0x75'),_0xa797('0x85')]]}]}]})['then'](handleEntityNotFound(_0x5d308a,null))['then'](function(_0x30525){if(_0x30525&&_0x30525[_0xa797('0x83')]){_0x46fcd8=_0x30525[_0xa797('0x5f')]({'plain':!![]});if(_0x46fcd8['List']&&_0x46fcd8[_0xa797('0x83')][_0xa797('0x84')]['length']){return _0x46fcd8[_0xa797('0x83')][_0xa797('0x84')][0x0];}return db[_0xa797('0x71')][_0xa797('0x5c')](_[_0xa797('0xba')](_0x41859a[_0xa797('0x5d')],{'firstName':_0x41c778,[_0x30525['mapKey']]:_0x41c778,'phone':_0x41c778,'ListId':_0x46fcd8[_0xa797('0x77')]}));}})[_0xa797('0x1f')](handleEntityNotFound(_0x5d308a,null))[_0xa797('0x1f')](function(_0x1ef574){if(_0x1ef574){_0x10ae88=_0x1ef574;return db[_0xa797('0x8f')][_0xa797('0x5b')]({'where':{'ContactId':_0x10ae88['id'],'closed':![],'OpenchannelAccountId':_0x46fcd8['id']}})['then'](function(_0x4a9210){if(_0x4a9210){return[_0x4a9210,![]];}return db[_0xa797('0x8f')][_0xa797('0x5c')]({'UserId':_0x41859a[_0xa797('0x5e')]['id'],'ContactId':_0x10ae88['id'],'OpenchannelAccountId':_0x46fcd8['id'],'lastMsgDirection':_0xa797('0xbb'),'Messages':[_[_0xa797('0x4f')](_0x41859a[_0xa797('0x5d')],{'read':![],'body':_0x41859a[_0xa797('0x5d')][_0xa797('0x5d')],'OpenchannelAccountId':_0x46fcd8['id'],'UserId':_0x41859a['user']['id'],'ContactId':_0x10ae88['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xa797('0xbc')}]})[_0xa797('0x1f')](function(_0x48311d){return[_0x48311d,!![]];});});}})[_0xa797('0x92')](function(_0x33d22b,_0x5c602d){if(_0x5c602d){return _0x33d22b;}return db[_0xa797('0xbd')][_0xa797('0x5c')](_['merge'](_0x41859a['body'],{'read':![],'body':_0x41859a[_0xa797('0x5d')]['body'],'OpenchannelAccountId':_0x46fcd8['id'],'OpenchannelInteractionId':_0x33d22b['id'],'UserId':_0x41859a['user']['id'],'ContactId':_0x10ae88['id']}))['then'](function(_0x9b50cd){_0x33d22b['dataValues'][_0xa797('0xbc')]=[];_0x33d22b[_0xa797('0xbe')][_0xa797('0xbc')][_0xa797('0x97')](_0x9b50cd[_0xa797('0xbe')]);return _0x33d22b;});});}})[_0xa797('0x1f')](respondWithResult(_0x5d308a,null))['catch'](handleError(_0x5d308a,null));};
\ No newline at end of file
index 1ca2838..6676649 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec56=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x546ab6,_0x357f23){var _0x3952ca=function(_0x29dcfa){while(--_0x29dcfa){_0x546ab6['push'](_0x546ab6['shift']());}};_0x3952ca(++_0x357f23);}(_0xec56,0x1bd));var _0x6ec5=function(_0x3c611c,_0x5b3145){_0x3c611c=_0x3c611c-0x0;var _0x5da866=_0xec56[_0x3c611c];return _0x5da866;};'use strict';var EventEmitter=require(_0x6ec5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6ec5('0x1')](0x0);var events={'afterCreate':_0x6ec5('0x2'),'afterUpdate':_0x6ec5('0x3'),'afterDestroy':_0x6ec5('0x4')};function emitEvent(_0x43c2cd){return function(_0x399441,_0x469679,_0x173aeb){OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd+':'+_0x399441['id'],_0x399441);OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd,_0x399441);_0x173aeb(null);};}for(var e in events){if(events[_0x6ec5('0x6')](e)){var event=events[e];OpenchannelAccount[_0x6ec5('0x7')](e,emitEvent(event));}}module[_0x6ec5('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x5b02=['exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','remove','emit','hook'];(function(_0x406957,_0x36fc08){var _0x803a57=function(_0x27f25f){while(--_0x27f25f){_0x406957['push'](_0x406957['shift']());}};_0x803a57(++_0x36fc08);}(_0x5b02,0xe9));var _0x25b0=function(_0x2f7d3a,_0x19add6){_0x2f7d3a=_0x2f7d3a-0x0;var _0x167d10=_0x5b02[_0x2f7d3a];return _0x167d10;};'use strict';var EventEmitter=require(_0x25b0('0x0'));var OpenchannelAccount=require(_0x25b0('0x1'))['db'][_0x25b0('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x25b0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x25b0('0x4')};function emitEvent(_0x53493e){return function(_0x3e1d20,_0x31c9c2,_0x38dc14){OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e+':'+_0x3e1d20['id'],_0x3e1d20);OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e,_0x3e1d20);_0x38dc14(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x25b0('0x6')](e,emitEvent(event));}}module[_0x25b0('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
index d02d1ba..ad89cf9 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(_0x1bbf62,_0x48e738){var _0x18d64a=function(_0x23a36d){while(--_0x23a36d){_0x1bbf62['push'](_0x1bbf62['shift']());}};_0x18d64a(++_0x48e738);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x533237,_0x18a210){var _0x5645e1=function(_0x1663f6){while(--_0x1663f6){_0x533237['push'](_0x533237['shift']());}};_0x5645e1(++_0x18a210);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 5701f18..8c0a379 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7b4=['result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xf7b4,0x152));var _0x4f7b=function(_0x37ca27,_0x14cff9){_0x37ca27=_0x37ca27-0x0;var _0xe53602=_0xf7b4[_0x37ca27];return _0xe53602;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});config[_0x4f7b('0xa')]=_[_0x4f7b('0xb')](config[_0x4f7b('0xa')],{'host':_0x4f7b('0xc'),'port':0x18eb});var socket=require(_0x4f7b('0xd'))(new Redis(config[_0x4f7b('0xa')]));require('./openchannelAccount.socket')[_0x4f7b('0xe')](socket);function respondWithRpcPromise(_0x1016e0,_0x479208,_0xdd1aab){return new BPromise(function(_0x3a3d6c,_0x408e01){return client[_0x4f7b('0xf')](_0x1016e0,_0xdd1aab)[_0x4f7b('0x10')](function(_0x55d69f){logger[_0x4f7b('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x479208,'request\x20sent');logger[_0x4f7b('0x12')](_0x4f7b('0x13'),_0x479208,_0x4f7b('0x14'),JSON[_0x4f7b('0x15')](_0x55d69f));if(_0x55d69f['error']){if(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x17')]===0x1f4){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x408e01(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);}logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x3a3d6c(_0x55d69f['error'][_0x4f7b('0x19')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x479208,_0x4f7b('0x14'));_0x3a3d6c(_0x55d69f[_0x4f7b('0x1a')]['message']);}})[_0x4f7b('0x1b')](function(_0x24c460){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x24c460);_0x408e01(_0x24c460);});});}
\ No newline at end of file
+var _0x4e81=['request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x4e81,0x1bc));var _0x14e8=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0x4e81[_0x396466];return _0x5e9ab4;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x14e8('0x9')]=_[_0x14e8('0xa')](config[_0x14e8('0x9')],{'host':_0x14e8('0xb'),'port':0x18eb});var socket=require(_0x14e8('0xc'))(new Redis(config[_0x14e8('0x9')]));require(_0x14e8('0xd'))[_0x14e8('0xe')](socket);function respondWithRpcPromise(_0x294b39,_0x5602cc,_0xbd3b87){return new BPromise(function(_0x3c6bdd,_0x43bfcd){return client[_0x14e8('0xf')](_0x294b39,_0xbd3b87)[_0x14e8('0x10')](function(_0x3ce648){logger[_0x14e8('0x11')](_0x14e8('0x12'),_0x5602cc,'request\x20sent');logger[_0x14e8('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5602cc,_0x14e8('0x14'),JSON[_0x14e8('0x15')](_0x3ce648));if(_0x3ce648[_0x14e8('0x16')]){if(_0x3ce648['error'][_0x14e8('0x17')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x5602cc,_0x3ce648['error'][_0x14e8('0x18')]);return _0x43bfcd(_0x3ce648[_0x14e8('0x16')][_0x14e8('0x18')]);}logger[_0x14e8('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x5602cc,_0x3ce648[_0x14e8('0x16')][_0x14e8('0x18')]);return _0x3c6bdd(_0x3ce648[_0x14e8('0x16')][_0x14e8('0x18')]);}else{logger[_0x14e8('0x11')](_0x14e8('0x12'),_0x5602cc,_0x14e8('0x14'));_0x3c6bdd(_0x3ce648[_0x14e8('0x19')]['message']);}})[_0x14e8('0x1a')](function(_0x233cd8){logger[_0x14e8('0x16')](_0x14e8('0x12'),_0x5602cc,_0x233cd8);_0x43bfcd(_0x233cd8);});});}
\ No newline at end of file
index 9499491..c38ce73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dc2=['remove','update','emit','removeListener','register','length','openchannelAccount:'];(function(_0x40622e,_0x1d071b){var _0x1a0072=function(_0x15d7e3){while(--_0x15d7e3){_0x40622e['push'](_0x40622e['shift']());}};_0x1a0072(++_0x1d071b);}(_0x7dc2,0x19d));var _0x27dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7dc2[_0x20a584];return _0x4b41a8;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x27dc('0x0'),_0x27dc('0x1')];function createListener(_0x49a9e7,_0x426f56){return function(_0x57d4b4){_0x426f56[_0x27dc('0x2')](_0x49a9e7,_0x57d4b4);};}function removeListener(_0x29ba23,_0x52337b){return function(){OpenchannelAccountEvents[_0x27dc('0x3')](_0x29ba23,_0x52337b);};}exports[_0x27dc('0x4')]=function(_0x5a442a){for(var _0x29eaac=0x0,_0x4d2e10=events[_0x27dc('0x5')];_0x29eaac<_0x4d2e10;_0x29eaac++){var _0x3b3eee=events[_0x29eaac];var _0x5181ab=createListener(_0x27dc('0x6')+_0x3b3eee,_0x5a442a);OpenchannelAccountEvents['on'](_0x3b3eee,_0x5181ab);}};
\ No newline at end of file
+var _0xf2fa=['emit','length','openchannelAccount:','./openchannelAccount.events','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2fa,0xd0));var _0xaf2f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf2fa[_0x321bb2];return _0x9c12ed;};'use strict';var OpenchannelAccountEvents=require(_0xaf2f('0x0'));var events=['save','remove',_0xaf2f('0x1')];function createListener(_0x27bac6,_0x46bd9d){return function(_0x339a31){_0x46bd9d[_0xaf2f('0x2')](_0x27bac6,_0x339a31);};}function removeListener(_0x45ae14,_0x96c9f7){return function(){OpenchannelAccountEvents['removeListener'](_0x45ae14,_0x96c9f7);};}exports['register']=function(_0x3709f9){for(var _0x49e700=0x0,_0x45e164=events[_0xaf2f('0x3')];_0x49e700<_0x45e164;_0x49e700++){var _0x1c3cfa=events[_0x49e700];var _0x312d3b=createListener(_0xaf2f('0x4')+_0x1c3cfa,_0x3709f9);OpenchannelAccountEvents['on'](_0x1c3cfa,_0x312d3b);}};
\ No newline at end of file
index fbc1553..509aa01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf148=['/:id','show','post','update','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4cde9e,_0x57150a){var _0x38df0c=function(_0x50cdb6){while(--_0x50cdb6){_0x4cde9e['push'](_0x4cde9e['shift']());}};_0x38df0c(++_0x57150a);}(_0xf148,0x86));var _0x8f14=function(_0x143be1,_0x5cf797){_0x143be1=_0x143be1-0x0;var _0x307071=_0xf148[_0x143be1];return _0x307071;};'use strict';var multer=require(_0x8f14('0x0'));var util=require(_0x8f14('0x1'));var path=require(_0x8f14('0x2'));var timeout=require('connect-timeout');var express=require(_0x8f14('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8f14('0x4'));var interaction=require(_0x8f14('0x5'));var config=require(_0x8f14('0x6'));var controller=require('./openchannelApplication.controller');router[_0x8f14('0x7')]('/',auth[_0x8f14('0x8')](),controller[_0x8f14('0x9')]);router[_0x8f14('0x7')](_0x8f14('0xa'),auth[_0x8f14('0x8')](),controller[_0x8f14('0xb')]);router[_0x8f14('0xc')]('/',auth[_0x8f14('0x8')](),controller['create']);router['put'](_0x8f14('0xa'),auth[_0x8f14('0x8')](),controller[_0x8f14('0xd')]);router['delete'](_0x8f14('0xa'),auth[_0x8f14('0x8')](),controller[_0x8f14('0xe')]);module[_0x8f14('0xf')]=router;
\ No newline at end of file
+var _0xb3bd=['/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','show','create','put'];(function(_0x1807f1,_0x511b83){var _0x4472f5=function(_0x326d5a){while(--_0x326d5a){_0x1807f1['push'](_0x1807f1['shift']());}};_0x4472f5(++_0x511b83);}(_0xb3bd,0x158));var _0xdb3b=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0xb3bd[_0x4c0622];return _0x1799d8;};'use strict';var multer=require(_0xdb3b('0x0'));var util=require(_0xdb3b('0x1'));var path=require(_0xdb3b('0x2'));var timeout=require(_0xdb3b('0x3'));var express=require(_0xdb3b('0x4'));var router=express['Router']();var fs_extra=require(_0xdb3b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdb3b('0x6'));var controller=require(_0xdb3b('0x7'));router['get']('/',auth[_0xdb3b('0x8')](),controller[_0xdb3b('0x9')]);router['get']('/:id',auth[_0xdb3b('0x8')](),controller[_0xdb3b('0xa')]);router['post']('/',auth[_0xdb3b('0x8')](),controller[_0xdb3b('0xb')]);router[_0xdb3b('0xc')](_0xdb3b('0xd'),auth[_0xdb3b('0x8')](),controller[_0xdb3b('0xe')]);router[_0xdb3b('0xf')](_0xdb3b('0xd'),auth[_0xdb3b('0x8')](),controller['destroy']);module[_0xdb3b('0x10')]=router;
\ No newline at end of file
index b2046ea..69416e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44bd=['sequelize','INTEGER','STRING','noop','*,*,*,*'];(function(_0x1d0bf6,_0x960455){var _0x125c60=function(_0x492764){while(--_0x492764){_0x1d0bf6['push'](_0x1d0bf6['shift']());}};_0x125c60(++_0x960455);}(_0x44bd,0x172));var _0xd44b=function(_0xb09a5f,_0x3707b8){_0xb09a5f=_0xb09a5f-0x0;var _0x3de467=_0x44bd[_0xb09a5f];return _0x3de467;};'use strict';var Sequelize=require(_0xd44b('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd44b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd44b('0x2')],'allowNull':![],'defaultValue':_0xd44b('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd44b('0x2')]},'interval':{'type':Sequelize[_0xd44b('0x2')],'defaultValue':_0xd44b('0x4')}};
\ No newline at end of file
+var _0x3fb0=['sequelize','STRING','noop','TEXT','*,*,*,*'];(function(_0xd0dab5,_0x4d80fd){var _0x227b3b=function(_0x4ae780){while(--_0x4ae780){_0xd0dab5['push'](_0xd0dab5['shift']());}};_0x227b3b(++_0x4d80fd);}(_0x3fb0,0x168));var _0x03fb=function(_0xf86312,_0x3f41f7){_0xf86312=_0xf86312-0x0;var _0x35d4f3=_0x3fb0[_0xf86312];return _0x35d4f3;};'use strict';var Sequelize=require(_0x03fb('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x03fb('0x1')],'allowNull':![],'defaultValue':_0x03fb('0x2')},'appdata':{'type':Sequelize[_0x03fb('0x3')]()},'description':{'type':Sequelize[_0x03fb('0x1')]},'interval':{'type':Sequelize[_0x03fb('0x1')],'defaultValue':_0x03fb('0x4')}};
\ No newline at end of file
index 50ccff0..655e5f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa52b=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','end','error','name','send','map','OpenchannelApplication','fieldName','type','key','query','keys','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','options','find','body','update','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x283692,_0x32baab){var _0x28c7c6=function(_0x135c63){while(--_0x135c63){_0x283692['push'](_0x283692['shift']());}};_0x28c7c6(++_0x32baab);}(_0xa52b,0x8a));var _0xba52=function(_0x3b15f7,_0x2b5591){_0x3b15f7=_0x3b15f7-0x0;var _0x5abb2c=_0xa52b[_0x3b15f7];return _0x5abb2c;};'use strict';var emlformat=require(_0xba52('0x0'));var rimraf=require(_0xba52('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba52('0x2'));var rp=require(_0xba52('0x3'));var moment=require(_0xba52('0x4'));var BPromise=require(_0xba52('0x5'));var Mustache=require('mustache');var util=require(_0xba52('0x6'));var path=require(_0xba52('0x7'));var sox=require(_0xba52('0x8'));var csv=require(_0xba52('0x9'));var ejs=require(_0xba52('0xa'));var fs=require('fs');var fs_extra=require(_0xba52('0xb'));var _=require(_0xba52('0xc'));var squel=require('squel');var crypto=require(_0xba52('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xba52('0xe'));var toCsv=require(_0xba52('0x9'));var querystring=require(_0xba52('0xf'));var Papa=require(_0xba52('0x10'));var Redis=require(_0xba52('0x11'));var authService=require(_0xba52('0x12'));var qs=require(_0xba52('0x13'));var as=require(_0xba52('0x14'));var hardwareService=require(_0xba52('0x15'));var logger=require(_0xba52('0x16'))(_0xba52('0x17'));var utils=require(_0xba52('0x18'));var config=require(_0xba52('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xba52('0x1a'))['db'];function respondWithStatusCode(_0x415c92,_0xd5d3de){_0xd5d3de=_0xd5d3de||0xcc;return function(_0x2b86c7){if(_0x2b86c7){return _0x415c92[_0xba52('0x1b')](_0xd5d3de);}return _0x415c92[_0xba52('0x1c')](_0xd5d3de)['end']();};}function respondWithResult(_0x1b6db4,_0x320666){_0x320666=_0x320666||0xc8;return function(_0x18c9f3){if(_0x18c9f3){return _0x1b6db4['status'](_0x320666)[_0xba52('0x1d')](_0x18c9f3);}};}function respondWithFilteredResult(_0x325d87,_0x23e6e3){return function(_0x4289b4){if(_0x4289b4){var _0x51ba3f=typeof _0x23e6e3[_0xba52('0x1e')]===_0xba52('0x1f')&&typeof _0x23e6e3['limit']===_0xba52('0x1f');var _0x365894=_0x4289b4[_0xba52('0x20')];var _0x3cf90f=_0x51ba3f?0x0:_0x23e6e3[_0xba52('0x1e')];var _0x5c8432=_0x51ba3f?_0x4289b4['count']:_0x23e6e3[_0xba52('0x1e')]+_0x23e6e3[_0xba52('0x21')];var _0x5cab74;if(_0x5c8432>=_0x365894){_0x5c8432=_0x365894;_0x5cab74=0xc8;}else{_0x5cab74=0xce;}_0x325d87['status'](_0x5cab74);return _0x325d87[_0xba52('0x22')](_0xba52('0x23'),_0x3cf90f+'-'+_0x5c8432+'/'+_0x365894)[_0xba52('0x1d')](_0x4289b4);}return null;};}function patchUpdates(_0x9a9fd){return function(_0x57f18b){try{jsonpatch[_0xba52('0x24')](_0x57f18b,_0x9a9fd,!![]);}catch(_0xd3d8c9){return BPromise[_0xba52('0x25')](_0xd3d8c9);}return _0x57f18b[_0xba52('0x26')]();};}function saveUpdates(_0x3c1863,_0x17061c){return function(_0x14da6b){if(_0x14da6b){return _0x14da6b['update'](_0x3c1863)[_0xba52('0x27')](function(_0x3cab8d){return _0x3cab8d;});}return null;};}function removeEntity(_0x3a2c26,_0x409252){return function(_0x4d4fb5){if(_0x4d4fb5){return _0x4d4fb5['destroy']()[_0xba52('0x27')](function(){_0x3a2c26[_0xba52('0x1c')](0xcc)[_0xba52('0x28')]();});}};}function handleEntityNotFound(_0x5eb62c,_0x33a96e){return function(_0x3d2e5d){if(!_0x3d2e5d){_0x5eb62c[_0xba52('0x1b')](0x194);}return _0x3d2e5d;};}function handleError(_0x11e4fd,_0x250542){_0x250542=_0x250542||0x1f4;return function(_0x247ff8){logger[_0xba52('0x29')](_0x247ff8['stack']);if(_0x247ff8[_0xba52('0x2a')]){delete _0x247ff8[_0xba52('0x2a')];}_0x11e4fd['status'](_0x250542)[_0xba52('0x2b')](_0x247ff8);};}exports['index']=function(_0xcb16b4,_0x1dc2ed){var _0xbc949={},_0x51d65b={},_0x4d0b34={'count':0x0,'rows':[]};var _0x475d8f=_[_0xba52('0x2c')](db[_0xba52('0x2d')]['rawAttributes'],function(_0x367618){return{'name':_0x367618[_0xba52('0x2e')],'type':_0x367618[_0xba52('0x2f')][_0xba52('0x30')]};});_0x51d65b['model']=_[_0xba52('0x2c')](_0x475d8f,_0xba52('0x2a'));_0x51d65b[_0xba52('0x31')]=_[_0xba52('0x32')](_0xcb16b4['query']);_0x51d65b['filters']=_['intersection'](_0x51d65b[_0xba52('0x33')],_0x51d65b['query']);_0xbc949['attributes']=_[_0xba52('0x34')](_0x51d65b[_0xba52('0x33')],qs[_0xba52('0x35')](_0xcb16b4[_0xba52('0x31')][_0xba52('0x35')]));_0xbc949[_0xba52('0x36')]=_0xbc949[_0xba52('0x36')]['length']?_0xbc949[_0xba52('0x36')]:_0x51d65b['model'];if(!_0xcb16b4[_0xba52('0x31')][_0xba52('0x37')](_0xba52('0x38'))){_0xbc949[_0xba52('0x21')]=qs[_0xba52('0x21')](_0xcb16b4[_0xba52('0x31')][_0xba52('0x21')]);_0xbc949[_0xba52('0x1e')]=qs['offset'](_0xcb16b4['query'][_0xba52('0x1e')]);}_0xbc949[_0xba52('0x39')]=qs[_0xba52('0x3a')](_0xcb16b4[_0xba52('0x31')][_0xba52('0x3a')]);_0xbc949[_0xba52('0x3b')]=qs[_0xba52('0x3c')](_[_0xba52('0x3d')](_0xcb16b4['query'],_0x51d65b['filters']),_0x475d8f);if(_0xcb16b4[_0xba52('0x31')]['filter']){_0xbc949['where']=_[_0xba52('0x3e')](_0xbc949['where'],{'$or':_[_0xba52('0x2c')](_0x475d8f,function(_0x13927f){if(_0x13927f[_0xba52('0x2f')]!==_0xba52('0x3f')){var _0x2dae61={};_0x2dae61[_0x13927f[_0xba52('0x2a')]]={'$like':'%'+_0xcb16b4[_0xba52('0x31')][_0xba52('0x40')]+'%'};return _0x2dae61;}})});}_0xbc949=_[_0xba52('0x3e')]({},_0xbc949,_0xcb16b4['options']);var _0x2c31b0={'where':_0xbc949[_0xba52('0x3b')]};return db[_0xba52('0x2d')]['count'](_0x2c31b0)['then'](function(_0x315bff){_0x4d0b34[_0xba52('0x20')]=_0x315bff;if(_0xcb16b4[_0xba52('0x31')][_0xba52('0x41')]){_0xbc949[_0xba52('0x42')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0xbc949);})[_0xba52('0x27')](function(_0x104293){_0x4d0b34[_0xba52('0x43')]=_0x104293;return _0x4d0b34;})['then'](respondWithFilteredResult(_0x1dc2ed,_0xbc949))[_0xba52('0x44')](handleError(_0x1dc2ed,null));};exports[_0xba52('0x45')]=function(_0x27a78a,_0x3caf50){var _0x244102={'raw':!![],'where':{'id':_0x27a78a[_0xba52('0x46')]['id']}},_0x3f5366={};_0x3f5366['model']=_[_0xba52('0x32')](db[_0xba52('0x2d')][_0xba52('0x47')]);_0x3f5366[_0xba52('0x31')]=_[_0xba52('0x32')](_0x27a78a[_0xba52('0x31')]);_0x3f5366['filters']=_[_0xba52('0x34')](_0x3f5366[_0xba52('0x33')],_0x3f5366['query']);_0x244102[_0xba52('0x36')]=_['intersection'](_0x3f5366['model'],qs[_0xba52('0x35')](_0x27a78a['query'][_0xba52('0x35')]));_0x244102[_0xba52('0x36')]=_0x244102['attributes'][_0xba52('0x48')]?_0x244102['attributes']:_0x3f5366[_0xba52('0x33')];if(_0x27a78a['query'][_0xba52('0x41')]){_0x244102[_0xba52('0x42')]=[{'all':!![]}];}_0x244102=_[_0xba52('0x3e')]({},_0x244102,_0x27a78a[_0xba52('0x49')]);return db['OpenchannelApplication'][_0xba52('0x4a')](_0x244102)[_0xba52('0x27')](handleEntityNotFound(_0x3caf50,null))[_0xba52('0x27')](respondWithResult(_0x3caf50,null))[_0xba52('0x44')](handleError(_0x3caf50,null));};exports['create']=function(_0x681aa8,_0x1fddc8){return db[_0xba52('0x2d')]['create'](_0x681aa8[_0xba52('0x4b')],{})[_0xba52('0x27')](respondWithResult(_0x1fddc8,0xc9))[_0xba52('0x44')](handleError(_0x1fddc8,null));};exports[_0xba52('0x4c')]=function(_0x2419e5,_0x53f5ad){if(_0x2419e5[_0xba52('0x4b')]['id']){delete _0x2419e5[_0xba52('0x4b')]['id'];}return db[_0xba52('0x2d')][_0xba52('0x4a')]({'where':{'id':_0x2419e5['params']['id']}})['then'](handleEntityNotFound(_0x53f5ad,null))[_0xba52('0x27')](saveUpdates(_0x2419e5[_0xba52('0x4b')],null))['then'](respondWithResult(_0x53f5ad,null))[_0xba52('0x44')](handleError(_0x53f5ad,null));};exports[_0xba52('0x4d')]=function(_0x3438bb,_0x1fd8d4){return db['OpenchannelApplication'][_0xba52('0x4a')]({'where':{'id':_0x3438bb[_0xba52('0x46')]['id']}})[_0xba52('0x27')](handleEntityNotFound(_0x1fd8d4,null))[_0xba52('0x27')](removeEntity(_0x1fd8d4,null))[_0xba52('0x44')](handleError(_0x1fd8d4,null));};
\ No newline at end of file
+var _0x16d1=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','end','error','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','filter','merge','where','options','OpenchannelApplication','includeAll','include','findAll','show','params','fields','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x5654b9,_0x45e210){var _0x159945=function(_0x504dce){while(--_0x504dce){_0x5654b9['push'](_0x5654b9['shift']());}};_0x159945(++_0x45e210);}(_0x16d1,0x1dc));var _0x116d=function(_0x4542b7,_0x45b947){_0x4542b7=_0x4542b7-0x0;var _0x226db6=_0x16d1[_0x4542b7];return _0x226db6;};'use strict';var emlformat=require(_0x116d('0x0'));var rimraf=require(_0x116d('0x1'));var zipdir=require(_0x116d('0x2'));var jsonpatch=require(_0x116d('0x3'));var rp=require(_0x116d('0x4'));var moment=require('moment');var BPromise=require(_0x116d('0x5'));var Mustache=require(_0x116d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x116d('0x7'));var csv=require(_0x116d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x116d('0x9'));var _=require(_0x116d('0xa'));var squel=require(_0x116d('0xb'));var crypto=require(_0x116d('0xc'));var jsforce=require(_0x116d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x116d('0x8'));var querystring=require('querystring');var Papa=require(_0x116d('0xe'));var Redis=require(_0x116d('0xf'));var authService=require(_0x116d('0x10'));var qs=require(_0x116d('0x11'));var as=require(_0x116d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x116d('0x13'))('api');var utils=require(_0x116d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x116d('0x15'));var db=require(_0x116d('0x16'))['db'];function respondWithStatusCode(_0xb28490,_0x231364){_0x231364=_0x231364||0xcc;return function(_0x2371e8){if(_0x2371e8){return _0xb28490[_0x116d('0x17')](_0x231364);}return _0xb28490[_0x116d('0x18')](_0x231364)['end']();};}function respondWithResult(_0x1d2a45,_0x4d0b7c){_0x4d0b7c=_0x4d0b7c||0xc8;return function(_0x46e257){if(_0x46e257){return _0x1d2a45[_0x116d('0x18')](_0x4d0b7c)['json'](_0x46e257);}};}function respondWithFilteredResult(_0xd15947,_0x5ad11a){return function(_0x260b64){if(_0x260b64){var _0x1b1706=typeof _0x5ad11a[_0x116d('0x19')]===_0x116d('0x1a')&&typeof _0x5ad11a[_0x116d('0x1b')]===_0x116d('0x1a');var _0x1b2f2d=_0x260b64[_0x116d('0x1c')];var _0x563ecd=_0x1b1706?0x0:_0x5ad11a['offset'];var _0x1056ee=_0x1b1706?_0x260b64[_0x116d('0x1c')]:_0x5ad11a[_0x116d('0x19')]+_0x5ad11a[_0x116d('0x1b')];var _0x538c84;if(_0x1056ee>=_0x1b2f2d){_0x1056ee=_0x1b2f2d;_0x538c84=0xc8;}else{_0x538c84=0xce;}_0xd15947[_0x116d('0x18')](_0x538c84);return _0xd15947['set'](_0x116d('0x1d'),_0x563ecd+'-'+_0x1056ee+'/'+_0x1b2f2d)['json'](_0x260b64);}return null;};}function patchUpdates(_0x1cb039){return function(_0x3c60da){try{jsonpatch['apply'](_0x3c60da,_0x1cb039,!![]);}catch(_0x9190fc){return BPromise[_0x116d('0x1e')](_0x9190fc);}return _0x3c60da[_0x116d('0x1f')]();};}function saveUpdates(_0x34d49a,_0x45da12){return function(_0x51468f){if(_0x51468f){return _0x51468f[_0x116d('0x20')](_0x34d49a)['then'](function(_0x106a02){return _0x106a02;});}return null;};}function removeEntity(_0x2a6eb8,_0x312ed7){return function(_0x16b7f6){if(_0x16b7f6){return _0x16b7f6[_0x116d('0x21')]()[_0x116d('0x22')](function(){_0x2a6eb8['status'](0xcc)[_0x116d('0x23')]();});}};}function handleEntityNotFound(_0x463e73,_0x55f741){return function(_0xfdc814){if(!_0xfdc814){_0x463e73['sendStatus'](0x194);}return _0xfdc814;};}function handleError(_0xf53e5c,_0x2586cd){_0x2586cd=_0x2586cd||0x1f4;return function(_0x97351c){logger[_0x116d('0x24')](_0x97351c['stack']);if(_0x97351c[_0x116d('0x25')]){delete _0x97351c['name'];}_0xf53e5c['status'](_0x2586cd)[_0x116d('0x26')](_0x97351c);};}exports[_0x116d('0x27')]=function(_0x40baa6,_0x293c26){var _0x44e7ae={},_0x140323={},_0x15f93e={'count':0x0,'rows':[]};var _0x3c3753=_[_0x116d('0x28')](db['OpenchannelApplication'][_0x116d('0x29')],function(_0x4cd095){return{'name':_0x4cd095['fieldName'],'type':_0x4cd095[_0x116d('0x2a')][_0x116d('0x2b')]};});_0x140323[_0x116d('0x2c')]=_[_0x116d('0x28')](_0x3c3753,_0x116d('0x25'));_0x140323['query']=_[_0x116d('0x2d')](_0x40baa6[_0x116d('0x2e')]);_0x140323[_0x116d('0x2f')]=_[_0x116d('0x30')](_0x140323['model'],_0x140323[_0x116d('0x2e')]);_0x44e7ae[_0x116d('0x31')]=_[_0x116d('0x30')](_0x140323[_0x116d('0x2c')],qs['fields'](_0x40baa6[_0x116d('0x2e')]['fields']));_0x44e7ae[_0x116d('0x31')]=_0x44e7ae[_0x116d('0x31')]['length']?_0x44e7ae['attributes']:_0x140323[_0x116d('0x2c')];if(!_0x40baa6[_0x116d('0x2e')][_0x116d('0x32')](_0x116d('0x33'))){_0x44e7ae[_0x116d('0x1b')]=qs['limit'](_0x40baa6['query'][_0x116d('0x1b')]);_0x44e7ae[_0x116d('0x19')]=qs['offset'](_0x40baa6['query'][_0x116d('0x19')]);}_0x44e7ae[_0x116d('0x34')]=qs['sort'](_0x40baa6['query'][_0x116d('0x35')]);_0x44e7ae['where']=qs['filters'](_['pick'](_0x40baa6[_0x116d('0x2e')],_0x140323[_0x116d('0x2f')]),_0x3c3753);if(_0x40baa6[_0x116d('0x2e')][_0x116d('0x36')]){_0x44e7ae['where']=_[_0x116d('0x37')](_0x44e7ae[_0x116d('0x38')],{'$or':_[_0x116d('0x28')](_0x3c3753,function(_0x257dc4){if(_0x257dc4[_0x116d('0x2a')]!=='VIRTUAL'){var _0x4266f5={};_0x4266f5[_0x257dc4[_0x116d('0x25')]]={'$like':'%'+_0x40baa6['query']['filter']+'%'};return _0x4266f5;}})});}_0x44e7ae=_['merge']({},_0x44e7ae,_0x40baa6[_0x116d('0x39')]);var _0x2000ee={'where':_0x44e7ae[_0x116d('0x38')]};return db[_0x116d('0x3a')][_0x116d('0x1c')](_0x2000ee)[_0x116d('0x22')](function(_0x211426){_0x15f93e[_0x116d('0x1c')]=_0x211426;if(_0x40baa6[_0x116d('0x2e')][_0x116d('0x3b')]){_0x44e7ae[_0x116d('0x3c')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x116d('0x3d')](_0x44e7ae);})['then'](function(_0x42faeb){_0x15f93e['rows']=_0x42faeb;return _0x15f93e;})[_0x116d('0x22')](respondWithFilteredResult(_0x293c26,_0x44e7ae))['catch'](handleError(_0x293c26,null));};exports[_0x116d('0x3e')]=function(_0x1aa130,_0x5ee158){var _0x291818={'raw':!![],'where':{'id':_0x1aa130[_0x116d('0x3f')]['id']}},_0x112d4={};_0x112d4[_0x116d('0x2c')]=_[_0x116d('0x2d')](db[_0x116d('0x3a')][_0x116d('0x29')]);_0x112d4[_0x116d('0x2e')]=_[_0x116d('0x2d')](_0x1aa130['query']);_0x112d4[_0x116d('0x2f')]=_[_0x116d('0x30')](_0x112d4[_0x116d('0x2c')],_0x112d4[_0x116d('0x2e')]);_0x291818[_0x116d('0x31')]=_[_0x116d('0x30')](_0x112d4[_0x116d('0x2c')],qs[_0x116d('0x40')](_0x1aa130[_0x116d('0x2e')][_0x116d('0x40')]));_0x291818[_0x116d('0x31')]=_0x291818[_0x116d('0x31')][_0x116d('0x41')]?_0x291818[_0x116d('0x31')]:_0x112d4['model'];if(_0x1aa130[_0x116d('0x2e')][_0x116d('0x3b')]){_0x291818[_0x116d('0x3c')]=[{'all':!![]}];}_0x291818=_[_0x116d('0x37')]({},_0x291818,_0x1aa130[_0x116d('0x39')]);return db[_0x116d('0x3a')][_0x116d('0x42')](_0x291818)['then'](handleEntityNotFound(_0x5ee158,null))['then'](respondWithResult(_0x5ee158,null))[_0x116d('0x43')](handleError(_0x5ee158,null));};exports[_0x116d('0x44')]=function(_0x4515b6,_0x351df1){return db['OpenchannelApplication'][_0x116d('0x44')](_0x4515b6[_0x116d('0x45')],{})[_0x116d('0x22')](respondWithResult(_0x351df1,0xc9))[_0x116d('0x43')](handleError(_0x351df1,null));};exports[_0x116d('0x20')]=function(_0x57cc28,_0x252d4a){if(_0x57cc28[_0x116d('0x45')]['id']){delete _0x57cc28[_0x116d('0x45')]['id'];}return db[_0x116d('0x3a')][_0x116d('0x42')]({'where':{'id':_0x57cc28[_0x116d('0x3f')]['id']}})[_0x116d('0x22')](handleEntityNotFound(_0x252d4a,null))['then'](saveUpdates(_0x57cc28[_0x116d('0x45')],null))[_0x116d('0x22')](respondWithResult(_0x252d4a,null))['catch'](handleError(_0x252d4a,null));};exports['destroy']=function(_0x1e189c,_0x353bb6){return db[_0x116d('0x3a')][_0x116d('0x42')]({'where':{'id':_0x1e189c[_0x116d('0x3f')]['id']}})[_0x116d('0x22')](handleEntityNotFound(_0x353bb6,null))[_0x116d('0x22')](removeEntity(_0x353bb6,null))[_0x116d('0x43')](handleError(_0x353bb6,null));};
\ No newline at end of file
index a18acac..2685521 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96b2=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','./openchannelApplication.attributes','utf8mb4'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x96b2,0x171));var _0x296b=function(_0x3cf5a8,_0x57b46b){_0x3cf5a8=_0x3cf5a8-0x0;var _0x50c206=_0x96b2[_0x3cf5a8];return _0x50c206;};'use strict';var _=require(_0x296b('0x0'));var util=require('util');var logger=require(_0x296b('0x1'))(_0x296b('0x2'));var moment=require(_0x296b('0x3'));var BPromise=require('bluebird');var rp=require(_0x296b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x296b('0x5'));module['exports']=function(_0x4fba01,_0x3db0fd){return _0x4fba01['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x296b('0x6'),'collate':_0x296b('0x7')});};
\ No newline at end of file
+var _0x98be=['request-promise','path','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x98be,0x113));var _0xe98b=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x98be[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0xe98b('0x0'));var util=require(_0xe98b('0x1'));var logger=require(_0xe98b('0x2'))(_0xe98b('0x3'));var moment=require('moment');var BPromise=require(_0xe98b('0x4'));var rp=require(_0xe98b('0x5'));var fs=require('fs');var path=require(_0xe98b('0x6'));var rimraf=require('rimraf');var config=require(_0xe98b('0x7'));var attributes=require(_0xe98b('0x8'));module[_0xe98b('0x9')]=function(_0x66e825,_0x2dfaef){return _0x66e825['define'](_0xe98b('0xa'),attributes,{'tableName':_0xe98b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe98b('0xc'),'collate':_0xe98b('0xd')});};
\ No newline at end of file
index f19f565..3a9bfa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1862=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','info','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','OpenchannelApplication,\x20%s,\x20%s','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','then','debug','util'];(function(_0x62317d,_0x3ec508){var _0x590a7a=function(_0x10f95a){while(--_0x10f95a){_0x62317d['push'](_0x62317d['shift']());}};_0x590a7a(++_0x3ec508);}(_0x1862,0xbc));var _0x2186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1862[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2186('0x0'));var moment=require('moment');var BPromise=require(_0x2186('0x1'));var rs=require(_0x2186('0x2'));var fs=require('fs');var Redis=require(_0x2186('0x3'));var db=require(_0x2186('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2186('0x5'))(_0x2186('0x6'));var config=require('../../config/environment');var jayson=require(_0x2186('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5bc0fc,_0x28500a,_0x206251){return new BPromise(function(_0x4e2f8a,_0xae2aa7){return client['request'](_0x5bc0fc,_0x206251)['then'](function(_0x24625b){logger[_0x2186('0x8')]('OpenchannelApplication,\x20%s,\x20%s',_0x28500a,'request\x20sent');logger['debug'](_0x2186('0x9'),_0x28500a,_0x2186('0xa'),JSON[_0x2186('0xb')](_0x24625b));if(_0x24625b['error']){if(_0x24625b['error'][_0x2186('0xc')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x28500a,_0x24625b[_0x2186('0xd')][_0x2186('0xe')]);return _0xae2aa7(_0x24625b[_0x2186('0xd')][_0x2186('0xe')]);}logger[_0x2186('0xd')](_0x2186('0xf'),_0x28500a,_0x24625b['error'][_0x2186('0xe')]);return _0x4e2f8a(_0x24625b[_0x2186('0xd')][_0x2186('0xe')]);}else{logger[_0x2186('0x8')](_0x2186('0xf'),_0x28500a,'request\x20sent');_0x4e2f8a(_0x24625b['result'][_0x2186('0xe')]);}})[_0x2186('0x10')](function(_0x3c3e7e){logger[_0x2186('0xd')](_0x2186('0xf'),_0x28500a,_0x3c3e7e);_0xae2aa7(_0x3c3e7e);});});}exports[_0x2186('0x11')]=function(_0x234770){var _0x3eda76=this;return new Promise(function(_0x11668a,_0x589d19){return db[_0x2186('0x12')][_0x2186('0x13')](_0x234770[_0x2186('0x14')],{'raw':_0x234770[_0x2186('0x15')]?_0x234770['options'][_0x2186('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x234770[_0x2186('0x15')]?_0x234770[_0x2186('0x15')][_0x2186('0x17')]||null:null,'attributes':_0x234770['options']?_0x234770[_0x2186('0x15')][_0x2186('0x18')]||null:null,'limit':_0x234770[_0x2186('0x15')]?_0x234770[_0x2186('0x15')]['limit']||null:null})[_0x2186('0x19')](function(_0x501b64){logger[_0x2186('0x8')](_0x2186('0x11'),_0x234770);logger[_0x2186('0x1a')](_0x2186('0x11'),_0x234770,JSON[_0x2186('0xb')](_0x501b64));_0x11668a(_0x501b64);})['catch'](function(_0x56061a){logger[_0x2186('0xd')](_0x2186('0x11'),_0x56061a['message'],_0x234770);_0x589d19(_0x3eda76[_0x2186('0xd')](0x1f4,_0x56061a[_0x2186('0xe')]));});});};
\ No newline at end of file
+var _0x25fc=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','body','options','where','limit','then','lodash','util'];(function(_0x33b996,_0x280abe){var _0xfda066=function(_0x3d47bb){while(--_0x3d47bb){_0x33b996['push'](_0x33b996['shift']());}};_0xfda066(++_0x280abe);}(_0x25fc,0x116));var _0xc25f=function(_0x31e5f9,_0x1ec016){_0x31e5f9=_0x31e5f9-0x0;var _0x485bf8=_0x25fc[_0x31e5f9];return _0x485bf8;};'use strict';var _=require(_0xc25f('0x0'));var util=require(_0xc25f('0x1'));var moment=require('moment');var BPromise=require(_0xc25f('0x2'));var rs=require(_0xc25f('0x3'));var fs=require('fs');var Redis=require(_0xc25f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc25f('0x5'))(_0xc25f('0x6'));var config=require(_0xc25f('0x7'));var jayson=require(_0xc25f('0x8'));var client=jayson[_0xc25f('0x9')][_0xc25f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47ff97,_0x789345,_0x36c747){return new BPromise(function(_0xb056a2,_0x2ea710){return client['request'](_0x47ff97,_0x36c747)['then'](function(_0x5e4590){logger[_0xc25f('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x789345,_0xc25f('0xc'));logger[_0xc25f('0xd')](_0xc25f('0xe'),_0x789345,'request\x20sent',JSON[_0xc25f('0xf')](_0x5e4590));if(_0x5e4590[_0xc25f('0x10')]){if(_0x5e4590[_0xc25f('0x10')][_0xc25f('0x11')]===0x1f4){logger[_0xc25f('0x10')](_0xc25f('0x12'),_0x789345,_0x5e4590['error']['message']);return _0x2ea710(_0x5e4590[_0xc25f('0x10')][_0xc25f('0x13')]);}logger[_0xc25f('0x10')](_0xc25f('0x12'),_0x789345,_0x5e4590[_0xc25f('0x10')][_0xc25f('0x13')]);return _0xb056a2(_0x5e4590[_0xc25f('0x10')][_0xc25f('0x13')]);}else{logger[_0xc25f('0xb')](_0xc25f('0x12'),_0x789345,'request\x20sent');_0xb056a2(_0x5e4590[_0xc25f('0x14')][_0xc25f('0x13')]);}})[_0xc25f('0x15')](function(_0x519ac5){logger[_0xc25f('0x10')](_0xc25f('0x12'),_0x789345,_0x519ac5);_0x2ea710(_0x519ac5);});});}exports[_0xc25f('0x16')]=function(_0x2dfd2e){var _0x14c7e5=this;return new Promise(function(_0x38fc85,_0x590bd6){return db['OpenchannelApplication']['update'](_0x2dfd2e[_0xc25f('0x17')],{'raw':_0x2dfd2e[_0xc25f('0x18')]?_0x2dfd2e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dfd2e['options']?_0x2dfd2e[_0xc25f('0x18')][_0xc25f('0x19')]||null:null,'attributes':_0x2dfd2e[_0xc25f('0x18')]?_0x2dfd2e[_0xc25f('0x18')]['attributes']||null:null,'limit':_0x2dfd2e[_0xc25f('0x18')]?_0x2dfd2e[_0xc25f('0x18')][_0xc25f('0x1a')]||null:null})[_0xc25f('0x1b')](function(_0x1656fe){logger['info'](_0xc25f('0x16'),_0x2dfd2e);logger['debug'](_0xc25f('0x16'),_0x2dfd2e,JSON[_0xc25f('0xf')](_0x1656fe));_0x38fc85(_0x1656fe);})['catch'](function(_0x51b743){logger[_0xc25f('0x10')](_0xc25f('0x16'),_0x51b743[_0xc25f('0x13')],_0x2dfd2e);_0x590bd6(_0x14c7e5[_0xc25f('0x10')](0x1f4,_0x51b743[_0xc25f('0x13')]));});});};
\ No newline at end of file
index b080e92..93a0dd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29a5=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','delete','removeTags','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x228e57,_0x333af4){var _0x475abe=function(_0x59f35f){while(--_0x59f35f){_0x228e57['push'](_0x228e57['shift']());}};_0x475abe(++_0x333af4);}(_0x29a5,0x11a));var _0x529a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x29a5[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x529a('0x0'));var util=require(_0x529a('0x1'));var path=require(_0x529a('0x2'));var timeout=require('connect-timeout');var express=require(_0x529a('0x3'));var router=express[_0x529a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x529a('0x5'));var interaction=require(_0x529a('0x6'));var config=require(_0x529a('0x7'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0x529a('0x8')](),controller[_0x529a('0x9')]);router[_0x529a('0xa')]('/describe',auth[_0x529a('0x8')](),controller[_0x529a('0xb')]);router['get'](_0x529a('0xc'),auth[_0x529a('0x8')](),controller[_0x529a('0xd')]);router[_0x529a('0xa')](_0x529a('0xe'),auth['isAuthenticated'](),controller['getMessages']);router[_0x529a('0xa')](_0x529a('0xf'),auth[_0x529a('0x8')](),controller[_0x529a('0x10')]);router[_0x529a('0x11')]('/',auth[_0x529a('0x8')](),controller[_0x529a('0x12')]);router['post'](_0x529a('0xe'),auth[_0x529a('0x8')](),controller[_0x529a('0x13')]);router[_0x529a('0x11')](_0x529a('0x14'),auth[_0x529a('0x8')](),interaction[_0x529a('0x15')](_0x529a('0x16'),_0x529a('0x17')),controller[_0x529a('0x18')]);router[_0x529a('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x529a('0x15')](_0x529a('0x16'),_0x529a('0x1a')),controller[_0x529a('0x1b')]);router['delete'](_0x529a('0xc'),auth[_0x529a('0x8')](),interaction['tracked'](_0x529a('0x16'),_0x529a('0x1c')),controller['destroy']);router[_0x529a('0x1d')](_0x529a('0x14'),auth['isAuthenticated'](),controller[_0x529a('0x1e')]);module[_0x529a('0x1f')]=router;
\ No newline at end of file
+var _0x433b=['openchannelinteraction:update','update','delete','removeTags','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./openchannelInteraction.controller','get','index','/describe','describe','isAuthenticated','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','/:id','openchannel'];(function(_0x249d99,_0x16b584){var _0x5bfb05=function(_0x4f4d67){while(--_0x4f4d67){_0x249d99['push'](_0x249d99['shift']());}};_0x5bfb05(++_0x16b584);}(_0x433b,0xb8));var _0xb433=function(_0x443f79,_0x33e446){_0x443f79=_0x443f79-0x0;var _0x3847e4=_0x433b[_0x443f79];return _0x3847e4;};'use strict';var multer=require(_0xb433('0x0'));var util=require(_0xb433('0x1'));var path=require(_0xb433('0x2'));var timeout=require(_0xb433('0x3'));var express=require(_0xb433('0x4'));var router=express['Router']();var fs_extra=require(_0xb433('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb433('0x6'));var config=require('../../config/environment');var controller=require(_0xb433('0x7'));router[_0xb433('0x8')]('/',auth['isAuthenticated'](),controller[_0xb433('0x9')]);router[_0xb433('0x8')](_0xb433('0xa'),auth['isAuthenticated'](),controller[_0xb433('0xb')]);router[_0xb433('0x8')]('/:id',auth[_0xb433('0xc')](),controller['show']);router['get']('/:id/messages',auth[_0xb433('0xc')](),controller[_0xb433('0xd')]);router[_0xb433('0x8')](_0xb433('0xe'),auth[_0xb433('0xc')](),controller[_0xb433('0xf')]);router['post']('/',auth[_0xb433('0xc')](),controller[_0xb433('0x10')]);router[_0xb433('0x11')]('/:id/messages',auth[_0xb433('0xc')](),controller[_0xb433('0x12')]);router['post'](_0xb433('0x13'),auth['isAuthenticated'](),interaction[_0xb433('0x14')]('openchannel',_0xb433('0x15')),controller[_0xb433('0x16')]);router[_0xb433('0x17')](_0xb433('0x18'),auth[_0xb433('0xc')](),interaction[_0xb433('0x14')](_0xb433('0x19'),_0xb433('0x1a')),controller[_0xb433('0x1b')]);router[_0xb433('0x1c')](_0xb433('0x18'),auth[_0xb433('0xc')](),interaction[_0xb433('0x14')](_0xb433('0x19'),'openchannelinteraction:destroy'),controller['destroy']);router['delete']('/:id/tags',auth[_0xb433('0xc')](),controller[_0xb433('0x1d')]);module['exports']=router;
\ No newline at end of file
index c502ce1..886e235 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23bb=['ENUM','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x29f80e,_0x9027ff){var _0x5c7eaa=function(_0x48ec7c){while(--_0x48ec7c){_0x29f80e['push'](_0x29f80e['shift']());}};_0x5c7eaa(++_0x9027ff);}(_0x23bb,0xc1));var _0xb23b=function(_0x28fde4,_0x4fbc40){_0x28fde4=_0x28fde4-0x0;var _0xdc3f1b=_0x23bb[_0x28fde4];return _0xdc3f1b;};'use strict';var Sequelize=require(_0xb23b('0x0'));module[_0xb23b('0x1')]={'closed':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb23b('0x3')]},'disposition':{'type':Sequelize[_0xb23b('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb23b('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb23b('0x3')]},'threadId':{'type':Sequelize[_0xb23b('0x4')]},'externalUrl':{'type':Sequelize[_0xb23b('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb23b('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb23b('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb4e6=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x2cbf96,_0x56ec67){var _0x376e73=function(_0x34d96c){while(--_0x34d96c){_0x2cbf96['push'](_0x2cbf96['shift']());}};_0x376e73(++_0x56ec67);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0xb4e6[_0x4347ec];return _0x4c8314;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module[_0x6b4e('0x1')]={'closed':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6b4e('0x3')]},'disposition':{'type':Sequelize[_0x6b4e('0x4')]},'secondDisposition':{'type':Sequelize[_0x6b4e('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6b4e('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x6b4e('0x4')]},'externalUrl':{'type':Sequelize[_0x6b4e('0x4')]},'lastMsgAt':{'type':Sequelize[_0x6b4e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x6b4e('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6b4e('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':![]}};
\ No newline at end of file
index a3abbfa..5423f9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0d1=['fs-extra','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','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','destroy','end','stack','name','send','Users','map','fullname','TagIds','forEach','Tags','OpenchannelInteraction','rawAttributes','fieldName','type','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','field','from','tools_tags','select','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','conditions','unreadMessages','value','having','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','buildExpression','some','isEmpty','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','role','sequelize','toString','keyBy','a.key','a.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','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','push','all','rows','catch','show','params','intersection','includeAll','include','merge','options','find','create','describe','OpenchannelMessage','ids','omit','getMessages','findOne','pick','OpenchannelInteractionId','format','findAll','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','mkdirSync','Openchannel','Owner','N.A.','closedAt','disposition','threadId','Private','basename','createReadStream','pipe','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','System','out','downloadInteraction.ejs','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x407399,_0x28a31f){var _0x5e9ae9=function(_0x3cb0a1){while(--_0x3cb0a1){_0x407399['push'](_0x407399['shift']());}};_0x5e9ae9(++_0x28a31f);}(_0xd0d1,0xdd));var _0x1d0d=function(_0x406edb,_0x6f937){_0x406edb=_0x406edb-0x0;var _0x107a20=_0xd0d1[_0x406edb];return _0x107a20;};'use strict';var emlformat=require(_0x1d0d('0x0'));var rimraf=require(_0x1d0d('0x1'));var zipdir=require(_0x1d0d('0x2'));var jsonpatch=require(_0x1d0d('0x3'));var rp=require('request-promise');var moment=require(_0x1d0d('0x4'));var BPromise=require(_0x1d0d('0x5'));var Mustache=require(_0x1d0d('0x6'));var util=require(_0x1d0d('0x7'));var path=require(_0x1d0d('0x8'));var sox=require(_0x1d0d('0x9'));var csv=require(_0x1d0d('0xa'));var ejs=require(_0x1d0d('0xb'));var fs=require('fs');var fs_extra=require(_0x1d0d('0xc'));var _=require('lodash');var squel=require(_0x1d0d('0xd'));var crypto=require(_0x1d0d('0xe'));var jsforce=require(_0x1d0d('0xf'));var deskjs=require(_0x1d0d('0x10'));var toCsv=require(_0x1d0d('0xa'));var querystring=require(_0x1d0d('0x11'));var Papa=require('papaparse');var Redis=require(_0x1d0d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1d0d('0x13'));var as=require(_0x1d0d('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x1d0d('0x15'));var logger=require('../../config/logger')(_0x1d0d('0x16'));var utils=require(_0x1d0d('0x17'));var config=require(_0x1d0d('0x18'));var licenseUtil=require(_0x1d0d('0x19'));var db=require(_0x1d0d('0x1a'))['db'];config[_0x1d0d('0x1b')]=_[_0x1d0d('0x1c')](config[_0x1d0d('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x1d0d('0x1d'))(new Redis(config['redis']));require(_0x1d0d('0x1e'))[_0x1d0d('0x1f')](socket);function respondWithStatusCode(_0x11a45a,_0x1b1806){_0x1b1806=_0x1b1806||0xcc;return function(_0x2ec4bd){if(_0x2ec4bd){return _0x11a45a[_0x1d0d('0x20')](_0x1b1806);}return _0x11a45a[_0x1d0d('0x21')](_0x1b1806)['end']();};}function respondWithResult(_0x224ea6,_0x3e7529){_0x3e7529=_0x3e7529||0xc8;return function(_0x4a77b9){if(_0x4a77b9){return _0x224ea6[_0x1d0d('0x21')](_0x3e7529)['json'](_0x4a77b9);}};}function respondWithFilteredResult(_0x3ea721,_0x460c7d){return function(_0x259245){if(_0x259245){var _0x39155a=typeof _0x460c7d[_0x1d0d('0x22')]===_0x1d0d('0x23')&&typeof _0x460c7d['limit']===_0x1d0d('0x23');var _0x13144b=_0x259245[_0x1d0d('0x24')];var _0x31949d=_0x39155a?0x0:_0x460c7d['offset'];var _0xe16cd4=_0x39155a?_0x259245[_0x1d0d('0x24')]:_0x460c7d[_0x1d0d('0x22')]+_0x460c7d[_0x1d0d('0x25')];var _0x483400;if(_0xe16cd4>=_0x13144b){_0xe16cd4=_0x13144b;_0x483400=0xc8;}else{_0x483400=0xce;}_0x3ea721[_0x1d0d('0x21')](_0x483400);return _0x3ea721[_0x1d0d('0x26')](_0x1d0d('0x27'),_0x31949d+'-'+_0xe16cd4+'/'+_0x13144b)[_0x1d0d('0x28')](_0x259245);}return null;};}function patchUpdates(_0x4937bf){return function(_0x141daa){try{jsonpatch['apply'](_0x141daa,_0x4937bf,!![]);}catch(_0x2267b6){return BPromise[_0x1d0d('0x29')](_0x2267b6);}return _0x141daa[_0x1d0d('0x2a')]();};}function saveUpdates(_0x52f73,_0x5d4fd4){return function(_0x165a4b){if(_0x165a4b){return _0x165a4b['update'](_0x52f73)[_0x1d0d('0x2b')](function(_0x2f946b){return _0x2f946b;});}return null;};}function removeEntity(_0x3570bf,_0x3824d3){return function(_0x595b10){if(_0x595b10){return _0x595b10[_0x1d0d('0x2c')]()['then'](function(){_0x3570bf[_0x1d0d('0x21')](0xcc)[_0x1d0d('0x2d')]();});}};}function handleEntityNotFound(_0x1a1095,_0x2aed61){return function(_0x4d1bb0){if(!_0x4d1bb0){_0x1a1095[_0x1d0d('0x20')](0x194);}return _0x4d1bb0;};}function handleError(_0x34b6c4,_0x4a25af){_0x4a25af=_0x4a25af||0x1f4;return function(_0x16ee2f){logger['error'](_0x16ee2f[_0x1d0d('0x2e')]);if(_0x16ee2f[_0x1d0d('0x2f')]){delete _0x16ee2f[_0x1d0d('0x2f')];}_0x34b6c4['status'](_0x4a25af)[_0x1d0d('0x30')](_0x16ee2f);};}function getInteractionUsers(_0x5517d3,_0x5bd665){return new BPromise(function(_0x1a3f49,_0x2a7aea){try{if(_0x5bd665[_0x5517d3['id']]){_0x5517d3[_0x1d0d('0x31')]=_[_0x1d0d('0x32')](_0x5bd665[_0x5517d3['id']],function(_0x19b0b6){return{'id':_0x19b0b6['id'],'fullname':_0x19b0b6[_0x1d0d('0x33')]};});}}catch(_0x1cd41a){_0x2a7aea(_0x1cd41a);}_0x1a3f49(_0x5517d3);});}function getInteractionTags(_0x364ea1,_0x212afe){return new BPromise(function(_0x1197ef,_0x13ffb3){try{if(_0x364ea1[_0x1d0d('0x34')]){_0x364ea1['Tags']=[];_0x364ea1[_0x1d0d('0x34')]['split'](',')[_0x1d0d('0x35')](function(_0x3818e9){_0x364ea1[_0x1d0d('0x36')]['push'](_0x212afe[_0x3818e9]);});}delete _0x364ea1['TagIds'];}catch(_0x2ab2bd){_0x13ffb3(_0x2ab2bd);}_0x1197ef(_0x364ea1);});}function updateOpenchannelInteraction(_0xa96032,_0x5e93d7,_0x4287b9){return new BPromise(function(_0x3d1656,_0x1ee441){return getInteractionUsers(_0xa96032,_0x4287b9)[_0x1d0d('0x2b')](function(_0x2cb444){return getInteractionTags(_0x2cb444,_0x5e93d7);})[_0x1d0d('0x2b')](function(_0x42c95b){_0x3d1656(_0x42c95b);})['catch'](function(_0x5bea09){_0x1ee441(_0x5bea09);});});}exports['index']=function(_0xb0cce0,_0x4e1c9d){var _0x2c6e73={},_0xf8e419={},_0x183e59={'count':0x0,'rows':[]};var _0x3e26a4=_[_0x1d0d('0x32')](db[_0x1d0d('0x37')][_0x1d0d('0x38')],function(_0x5a2a76){return{'name':_0x5a2a76[_0x1d0d('0x39')],'type':_0x5a2a76[_0x1d0d('0x3a')]['key']};});_0xf8e419['model']=_['map'](_0x3e26a4,'name');_0xf8e419[_0x1d0d('0x3b')]=_[_0x1d0d('0x3c')](_0xb0cce0[_0x1d0d('0x3b')]);_0xf8e419[_0x1d0d('0x3d')]=_['intersection'](_0xf8e419[_0x1d0d('0x3e')],_0xf8e419[_0x1d0d('0x3b')]);_0x2c6e73['attributes']=_['intersection'](_0xf8e419[_0x1d0d('0x3e')],qs[_0x1d0d('0x3f')](_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x3f')]));_0x2c6e73[_0x1d0d('0x40')]=_0x2c6e73[_0x1d0d('0x40')][_0x1d0d('0x41')]?_0x2c6e73[_0x1d0d('0x40')]:_0xf8e419[_0x1d0d('0x3e')];if(!_0xb0cce0['query'][_0x1d0d('0x42')]('nolimit')){_0x2c6e73[_0x1d0d('0x25')]=qs[_0x1d0d('0x25')](_0xb0cce0['query'][_0x1d0d('0x25')]);_0x2c6e73[_0x1d0d('0x22')]=qs[_0x1d0d('0x22')](_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x22')]);}_0x2c6e73[_0x1d0d('0x43')]=qs[_0x1d0d('0x44')](_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x44')]);_0x2c6e73[_0x1d0d('0x45')]=qs[_0x1d0d('0x3d')](_['pick'](_0xb0cce0[_0x1d0d('0x3b')],_0xf8e419[_0x1d0d('0x3d')]),_0x3e26a4);var _0x53bd9f=[];var _0x5e2dc4=squel['select']()[_0x1d0d('0x46')]('id')[_0x1d0d('0x46')]('name')[_0x1d0d('0x46')]('color')[_0x1d0d('0x47')](_0x1d0d('0x48'));var _0x5469be=squel[_0x1d0d('0x49')]()[_0x1d0d('0x46')](_0x1d0d('0x4a'))[_0x1d0d('0x46')](_0x1d0d('0x4b'))[_0x1d0d('0x46')]('ui.OpenchannelInteractionId')[_0x1d0d('0x47')]('user_has_openchannel_interactions','ui')['left_join'](_0x1d0d('0x4c'),'u',_0x1d0d('0x4d'));var _0x108937=squel[_0x1d0d('0x49')]()[_0x1d0d('0x47')](_0x1d0d('0x4e'),'i')[_0x1d0d('0x4f')]('cm_contacts','c',_0x1d0d('0x50'))[_0x1d0d('0x4f')]('users','o',_0x1d0d('0x51'))[_0x1d0d('0x4f')](_0x1d0d('0x52'),'a',_0x1d0d('0x53'))['left_join'](_0x1d0d('0x54'),'me',_0x1d0d('0x55'))['left_join'](_0x1d0d('0x56'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0x1d0d('0x48'),'t',_0x1d0d('0x57'));var _0xbbbfa4=squel[_0x1d0d('0x58')]();var _0x44a003=[];var _0x4d49c2=squel[_0x1d0d('0x58')]();var _0x186b28;if(_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x59')]){_0x186b28=as['parseSearch'](_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x59')]);var _0x28aa62=_0x186b28['sqlOperator'];for(var _0x99a1b5=0x0;_0x99a1b5<_0x186b28['conditions'][_0x1d0d('0x41')];_0x99a1b5++){var _0x18309e=_0x186b28[_0x1d0d('0x5a')][_0x99a1b5];var _0x257445='i';var _0xb7502e=_['find'](_0x3e26a4,[_0x1d0d('0x2f'),_0x18309e[_0x1d0d('0x46')]]);if(!_0xb7502e){switch(_0x18309e[_0x1d0d('0x46')]){case _0x1d0d('0x5b'):if(_0x18309e[_0x1d0d('0x5c')]==0x1){_0x108937['having']('`'+_0x18309e[_0x1d0d('0x46')]+'`\x20=\x200');}else{_0x108937[_0x1d0d('0x5d')]('`'+_0x18309e[_0x1d0d('0x46')]+'`\x20>\x200');}break;case'Contact':if(_0x18309e[_0x1d0d('0x5e')]===_0x1d0d('0x5f')){if(_0x18309e[_0x1d0d('0x5c')][_0x1d0d('0x60')]('\x20')[_0x1d0d('0x41')]>0x1){_0xbbbfa4[_0x28aa62](_0x1d0d('0x61'),qs['getFullTextValue'](_0x18309e[_0x1d0d('0x5c')]),null);}else{var _0x34dcfa='%'+_0x18309e[_0x1d0d('0x5c')]+'%';_0xbbbfa4[_0x28aa62](_0x1d0d('0x62'),_0x34dcfa,_0x34dcfa,_0x34dcfa);}}else{_0xb7502e=_['find'](_0x3e26a4,[_0x1d0d('0x2f'),'ContactId']);_0x18309e[_0x1d0d('0x46')]=_0x1d0d('0x63');_0x35453c=as['buildExpression'](_0x257445,_0xb7502e[_0x1d0d('0x3a')],_0x18309e);_0xbbbfa4[_0x28aa62](_0x35453c[_0x1d0d('0x64')],_0x35453c['value']['start'],_0x35453c['value']['end']);}break;case _0x1d0d('0x65'):var _0x3ef5fe=_0x18309e[_0x1d0d('0x5c')][_0x1d0d('0x60')](',')['map'](function(_0x23fa70){return Number(_0x23fa70);});_0x3ef5fe[_0x1d0d('0x35')](function(_0x35f081){_0x4d49c2['or'](_0x1d0d('0x66'),'%,'+_0x35f081+',%');});_0x44a003=_['union'](_0x44a003,_0x3ef5fe);break;case _0x1d0d('0x67'):if(_0x18309e[_0x1d0d('0x5e')]===_0x1d0d('0x5f')){_0xbbbfa4[_0x28aa62](_0x1d0d('0x68'),'%'+_0x18309e['value']+'%',null);}else{_0xb7502e=_['find'](_0x3e26a4,[_0x1d0d('0x2f'),_0x1d0d('0x69')]);_0x18309e['field']=_0x1d0d('0x69');_0x35453c=as['buildExpression'](_0x257445,_0xb7502e[_0x1d0d('0x3a')],_0x18309e);_0xbbbfa4[_0x28aa62](_0x35453c[_0x1d0d('0x64')],_0x35453c[_0x1d0d('0x5c')][_0x1d0d('0x6a')],_0x35453c[_0x1d0d('0x5c')][_0x1d0d('0x2d')]);}break;case _0x1d0d('0x6b'):_0x35453c=as[_0x1d0d('0x6c')]('me',null,_0x18309e);_0xbbbfa4[_0x28aa62](_0x35453c[_0x1d0d('0x64')],_0x35453c[_0x1d0d('0x5c')][_0x1d0d('0x6a')],_0x35453c['value'][_0x1d0d('0x2d')]);break;}}else{var _0x35453c=as[_0x1d0d('0x6c')](_0x257445,_0xb7502e['type'],_0x18309e);_0xbbbfa4[_0x28aa62](_0x35453c['text'],_0x35453c[_0x1d0d('0x5c')][_0x1d0d('0x6a')],_0x35453c[_0x1d0d('0x5c')]['end']);}}}else{var _0x2663a6=_(_0xb0cce0[_0x1d0d('0x3b')])[_0x1d0d('0x3c')]()[_0x1d0d('0x32')](function(_0x1031b5){return _[_0x1d0d('0x6d')](_0x3e26a4,['name',_0x1031b5])?_0x1031b5:undefined;})['compact']()['value']();if(!_[_0x1d0d('0x6e')](_0x2663a6)){_0x2663a6[_0x1d0d('0x35')](function(_0x215371){if(_0x215371==='OpenchannelAccountId'){_0x108937['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0x1d0d('0x6f')](_0xb0cce0[_0x1d0d('0x3b')][_0x215371]));}else if(_0x215371===_0x1d0d('0x70')){var _0x4b440=JSON[_0x1d0d('0x71')](_0xb0cce0[_0x1d0d('0x3b')][_0x215371])[_0x1d0d('0x72')];var _0x102c78=JSON[_0x1d0d('0x71')](_0xb0cce0[_0x1d0d('0x3b')][_0x215371])[_0x1d0d('0x73')];_0x108937[_0x1d0d('0x45')](_0x1d0d('0x74'),_0x4b440,_0x102c78);}else{if(_0xb0cce0[_0x1d0d('0x3b')][_0x215371]===_0x1d0d('0x75')){_0x108937[_0x1d0d('0x45')]('i.'+_0x215371+_0x1d0d('0x76'));}else{_0x108937[_0x1d0d('0x45')]('i.'+_0x215371+'\x20=\x20?',_0xb0cce0['query'][_0x215371]);}}});}if(_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x77')]){if(_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x77')]==0x1){_0x108937[_0x1d0d('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x108937[_0x1d0d('0x5d')](_0x1d0d('0x78'));}}if(_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x79')]){_0x44a003=_[_0x1d0d('0x7a')](_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x79')])?_0xb0cce0[_0x1d0d('0x3b')]['tag']:new Array(_0xb0cce0['query']['tag']);_0x44a003[_0x1d0d('0x35')](function(_0x3bf367){_0x4d49c2['or'](_0x1d0d('0x66'),'%,'+_0x3bf367+',%');});}if(_0xb0cce0[_0x1d0d('0x3b')]['filter']){var _0x142770=_0xb0cce0['query'][_0x1d0d('0x7b')][_0x1d0d('0x7c')]('\x5c','\x5c\x5c')[_0x1d0d('0x7c')](/'/g,'\x27\x27');if(qs[_0x1d0d('0x7d')](_0x142770)){_0xbbbfa4['or'](_0x1d0d('0x7e'),_0x142770+'%');}else{_0xbbbfa4['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1d0d('0x7f')](_0x142770))['or'](_0x1d0d('0x80'),_0x142770+'%')['or'](_0x1d0d('0x81'),_0x142770+'%');}}}_0x108937['where'](_0xbbbfa4);_0x108937['group'](_0x1d0d('0x82'));var _0x584e67={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x31fd64=_0x108937[_0x1d0d('0x83')]();_0x31fd64[_0x1d0d('0x46')](_0x1d0d('0x82'));_0x31fd64[_0x1d0d('0x46')](_0x1d0d('0x84'),'unreadMessages');if(_0x2c6e73[_0x1d0d('0x43')]){_0x2c6e73['order'][_0x1d0d('0x35')](function(_0x2cd70c){var _0x1ced87=_0x2cd70c[0x0]===_0x1d0d('0x85')?_0x2cd70c[0x0]:'i.'+_0x2cd70c[0x0];_0x108937[_0x1d0d('0x43')](_0x1ced87,_0x2cd70c[0x1]===_0x1d0d('0x86')?![]:!![]);});}if(!_[_0x1d0d('0x6e')](_0x44a003)){_0x108937['having'](_0x4d49c2);_0x31fd64[_0x1d0d('0x45')]('t.id\x20IN\x20?',_0x44a003);}BPromise[_0x1d0d('0x87')]()[_0x1d0d('0x2b')](function(){if(!_0x186b28){if(_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x88')])return;_0x31fd64['where'](_0x1d0d('0x89'));_0x108937['where'](_0x1d0d('0x89'));return;}if(_0xb0cce0[_0x1d0d('0x8a')]['role']!==_0x1d0d('0x8b'))return;return _0xb0cce0[_0x1d0d('0x8a')][_0x1d0d('0x8c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x562c5e){if(_[_0x1d0d('0x6e')](_0x562c5e)){_0x31fd64[_0x1d0d('0x45')](_0x1d0d('0x8d'));_0x108937[_0x1d0d('0x45')](_0x1d0d('0x8d'));}else{_0x31fd64[_0x1d0d('0x45')](_0x1d0d('0x8e'),_[_0x1d0d('0x32')](_0x562c5e,'id'));_0x108937['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0x1d0d('0x32')](_0x562c5e,'id'));}});})[_0x1d0d('0x2b')](function(){if(_0xb0cce0[_0x1d0d('0x8a')][_0x1d0d('0x8f')]===_0x1d0d('0x8b')&&!_0x186b28&&!_0xb0cce0[_0x1d0d('0x3b')]['OpenchannelAccountId'])return[];return db[_0x1d0d('0x90')][_0x1d0d('0x3b')](_0x31fd64['toString'](),_0x584e67);})[_0x1d0d('0x2b')](function(_0x4041a1){_0x183e59[_0x1d0d('0x24')]=_0x4041a1[_0x1d0d('0x41')];if(_0x183e59[_0x1d0d('0x24')]===0x0)return[];return db[_0x1d0d('0x90')]['query'](_0x5e2dc4[_0x1d0d('0x91')](),_0x584e67)[_0x1d0d('0x2b')](function(_0xef6a30){_0x53bd9f=_[_0x1d0d('0x92')](_0xef6a30,'id');_0x584e67=_['merge'](_0x584e67,{'model':db[_0x1d0d('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x3f')]){_0x2c6e73[_0x1d0d('0x40')][_0x1d0d('0x35')](function(_0xfde76d){_0x108937[_0x1d0d('0x46')]('i.'+_0xfde76d);});}else{_0x108937['field'](_0x1d0d('0x84'),_0x1d0d('0x5b'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0x93'),'Account.key');_0x108937['field'](_0x1d0d('0x94'),'Account.mandatoryDisposition');_0x108937[_0x1d0d('0x46')](_0x1d0d('0x95'),_0x1d0d('0x85'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0x96'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0x97'),_0x1d0d('0x98'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0x99'),_0x1d0d('0x9a'));_0x108937[_0x1d0d('0x46')]('c.email',_0x1d0d('0x9b'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0x9c'),_0x1d0d('0x9d'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0x9e'),_0x1d0d('0x9f'));_0x108937[_0x1d0d('0x46')]('c.fax',_0x1d0d('0xa0'));_0x108937['field'](_0x1d0d('0xa1'),'Owner.fullname');_0x108937[_0x1d0d('0x46')]('o.internal',_0x1d0d('0xa2'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0xa3'),_0x1d0d('0x34'));}if(_0x2c6e73[_0x1d0d('0x25')])_0x108937[_0x1d0d('0x25')](_0x2c6e73[_0x1d0d('0x25')]);if(_0x2c6e73[_0x1d0d('0x22')])_0x108937[_0x1d0d('0x22')](_0x2c6e73['offset']);return db['sequelize']['query'](_0x108937['toString'](),_0x584e67);})['then'](function(_0x35e8f4){if(_0x35e8f4[_0x1d0d('0x41')]>0x0)_0x5469be[_0x1d0d('0x45')](_0x1d0d('0xa4'),_[_0x1d0d('0x32')](_0x35e8f4,'id'));return db[_0x1d0d('0x90')]['query'](_0x5469be['toString'](),_0x584e67)[_0x1d0d('0x2b')](function(_0xd45ce0){var _0x5514ee=_[_0x1d0d('0xa5')](_0xd45ce0,'OpenchannelInteractionId');var _0xec356=[];_0x35e8f4[_0x1d0d('0x35')](function(_0x551ddd){_0xec356[_0x1d0d('0xa6')](updateOpenchannelInteraction(_0x551ddd,_0x53bd9f,_0x5514ee));});return BPromise[_0x1d0d('0xa7')](_0xec356);});});})[_0x1d0d('0x2b')](function(_0x1e9644){_0x183e59[_0x1d0d('0xa8')]=_0x1e9644;return _0x183e59;})['then'](respondWithFilteredResult(_0x4e1c9d,_0x2c6e73))[_0x1d0d('0xa9')](handleError(_0x4e1c9d,null));};exports[_0x1d0d('0xaa')]=function(_0x57bdac,_0xf7fe9){var _0xc123b0={};if(_0x57bdac['query'][_0x1d0d('0x3a')]&&_0x57bdac['query']['type']===_0x1d0d('0x47')){_0xc123b0[_0x1d0d('0x47')]=_0x57bdac['params']['id'];}else{_0xc123b0['id']=_0x57bdac[_0x1d0d('0xab')]['id'];}var _0x11ac2b={'raw':![],'where':_0xc123b0},_0x51a34f={};_0x51a34f[_0x1d0d('0x3e')]=_[_0x1d0d('0x3c')](db[_0x1d0d('0x37')]['rawAttributes']);_0x51a34f[_0x1d0d('0x3b')]=_[_0x1d0d('0x3c')](_0x57bdac['query']);_0x51a34f[_0x1d0d('0x3d')]=_[_0x1d0d('0xac')](_0x51a34f['model'],_0x51a34f[_0x1d0d('0x3b')]);_0x11ac2b['attributes']=_['intersection'](_0x51a34f['model'],qs[_0x1d0d('0x3f')](_0x57bdac['query']['fields']));_0x11ac2b[_0x1d0d('0x40')]=_0x11ac2b[_0x1d0d('0x40')]['length']?_0x11ac2b[_0x1d0d('0x40')]:_0x51a34f[_0x1d0d('0x3e')];if(_0x57bdac['query'][_0x1d0d('0xad')]){_0x11ac2b[_0x1d0d('0xae')]=[{'all':!![]}];}_0x11ac2b=_[_0x1d0d('0xaf')]({},_0x11ac2b,_0x57bdac[_0x1d0d('0xb0')]);return db[_0x1d0d('0x37')][_0x1d0d('0xb1')](_0x11ac2b)[_0x1d0d('0x2b')](handleEntityNotFound(_0xf7fe9,null))['then'](respondWithResult(_0xf7fe9,null))[_0x1d0d('0xa9')](handleError(_0xf7fe9,null));};exports[_0x1d0d('0xb2')]=function(_0x2c7f0b,_0x37cc5f){return db[_0x1d0d('0x37')][_0x1d0d('0xb2')](_0x2c7f0b[_0x1d0d('0x6b')],{})[_0x1d0d('0x2b')](respondWithResult(_0x37cc5f,0xc9))[_0x1d0d('0xa9')](handleError(_0x37cc5f,null));};exports['update']=function(_0x3fdc17,_0x2a68c3){if(_0x3fdc17[_0x1d0d('0x6b')]['id']){delete _0x3fdc17[_0x1d0d('0x6b')]['id'];}return db[_0x1d0d('0x37')][_0x1d0d('0xb1')]({'where':{'id':_0x3fdc17[_0x1d0d('0xab')]['id']}})['then'](handleEntityNotFound(_0x2a68c3,null))['then'](saveUpdates(_0x3fdc17[_0x1d0d('0x6b')],null))['then'](respondWithResult(_0x2a68c3,null))['catch'](handleError(_0x2a68c3,null));};exports[_0x1d0d('0x2c')]=function(_0x3a6e50,_0x53f7eb){return db[_0x1d0d('0x37')][_0x1d0d('0xb1')]({'where':{'id':_0x3a6e50[_0x1d0d('0xab')]['id']}})[_0x1d0d('0x2b')](handleEntityNotFound(_0x53f7eb,null))[_0x1d0d('0x2b')](removeEntity(_0x53f7eb,null))[_0x1d0d('0xa9')](handleError(_0x53f7eb,null));};exports[_0x1d0d('0xb3')]=function(_0xa8b5ce,_0x35bfb6){return db['OpenchannelInteraction']['describe']()['then'](respondWithResult(_0x35bfb6,null))[_0x1d0d('0xa9')](handleError(_0x35bfb6,null));};exports['addMessage']=function(_0x1fb3d4,_0x58b652,_0x4a9104){return db[_0x1d0d('0xb4')]['find']({'where':{'id':_0x1fb3d4[_0x1d0d('0xab')]['id']}})[_0x1d0d('0x2b')](handleEntityNotFound(_0x58b652,null))['then'](function(_0x4ae597){if(_0x4ae597){return _0x4ae597['addMessage'](_0x1fb3d4[_0x1d0d('0x6b')][_0x1d0d('0xb5')],_[_0x1d0d('0xb6')](_0x1fb3d4['body'],[_0x1d0d('0xb5'),'id'])||{});}})[_0x1d0d('0x2b')](respondWithResult(_0x58b652,null))['catch'](handleError(_0x58b652,null));};exports[_0x1d0d('0xb7')]=function(_0x26d43f,_0x47e31b,_0x339fae){var _0x1dea7a={'raw':![],'where':{}};var _0x2b0b60={};var _0x1de17d={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x1d0d('0xb8')]({'where':{'id':_0x26d43f[_0x1d0d('0xab')]['id']}})['then'](handleEntityNotFound(_0x47e31b,null))[_0x1d0d('0x2b')](function(_0x429efa){if(_0x429efa){_0x2b0b60[_0x1d0d('0x3e')]=_['keys'](db[_0x1d0d('0xb4')][_0x1d0d('0x38')]);_0x2b0b60[_0x1d0d('0x3b')]=_[_0x1d0d('0x3c')](_0x26d43f[_0x1d0d('0x3b')]);_0x2b0b60[_0x1d0d('0x3d')]=_[_0x1d0d('0xac')](_0x2b0b60['model'],_0x2b0b60[_0x1d0d('0x3b')]);_0x1dea7a[_0x1d0d('0x40')]=_['intersection'](_0x2b0b60[_0x1d0d('0x3e')],qs[_0x1d0d('0x3f')](_0x26d43f[_0x1d0d('0x3b')][_0x1d0d('0x3f')]));_0x1dea7a['attributes']=_0x1dea7a[_0x1d0d('0x40')][_0x1d0d('0x41')]?_0x1dea7a[_0x1d0d('0x40')]:_0x2b0b60[_0x1d0d('0x3e')];if(!_0x26d43f[_0x1d0d('0x3b')]['hasOwnProperty']('nolimit')){_0x1dea7a[_0x1d0d('0x25')]=qs[_0x1d0d('0x25')](_0x26d43f['query']['limit']);_0x1dea7a[_0x1d0d('0x22')]=qs[_0x1d0d('0x22')](_0x26d43f['query'][_0x1d0d('0x22')]);}_0x1dea7a[_0x1d0d('0x43')]=qs[_0x1d0d('0x44')](_0x26d43f['query'][_0x1d0d('0x44')]);_0x1dea7a[_0x1d0d('0x45')]=qs[_0x1d0d('0x3d')](_[_0x1d0d('0xb9')](_0x26d43f[_0x1d0d('0x3b')],_0x2b0b60[_0x1d0d('0x3d')]));_0x1dea7a[_0x1d0d('0x45')][_0x1d0d('0xba')]=_0x429efa['id'];if(_0x26d43f['query'][_0x1d0d('0x7b')]){_0x1dea7a[_0x1d0d('0x45')]=_[_0x1d0d('0xaf')](_0x1dea7a[_0x1d0d('0x45')],{'$or':_['map'](_0x1dea7a[_0x1d0d('0x40')],function(_0x3fdb89){var _0x511e17={};_0x511e17[_0x3fdb89]={'$like':'%'+_0x26d43f['query'][_0x1d0d('0x7b')]+'%'};return _0x511e17;})});}if(_0x26d43f[_0x1d0d('0x3b')][_0x1d0d('0x72')]){var _0x39f79f=_0x26d43f[_0x1d0d('0x3b')][_0x1d0d('0x72')]['split'](',');var _0x423ca0={};_0x423ca0[_0x39f79f[0x0]]={'$gte':moment(_0x39f79f[0x1])[_0x1d0d('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1dea7a[_0x1d0d('0x45')]=_[_0x1d0d('0xaf')](_0x1dea7a['where'],_0x423ca0);}_0x1dea7a=_['merge']({},_0x1dea7a,_0x26d43f[_0x1d0d('0xb0')]);return db[_0x1d0d('0xb4')]['count']({'where':_0x1dea7a[_0x1d0d('0x45')]})[_0x1d0d('0x2b')](function(_0x137d3d){_0x1de17d['count']=_0x137d3d;if(_0x26d43f[_0x1d0d('0x3b')][_0x1d0d('0xad')]){_0x1dea7a['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x1d0d('0xbc')](_0x1dea7a);})[_0x1d0d('0x2b')](function(_0x102f2e){_0x1de17d[_0x1d0d('0xa8')]=_0x102f2e;return _0x1de17d;});}})[_0x1d0d('0x2b')](respondWithFilteredResult(_0x47e31b,_0x1dea7a))[_0x1d0d('0xa9')](handleError(_0x47e31b,null));};exports[_0x1d0d('0xbd')]=function(_0x222585,_0x35fe49,_0xf1354e){return db['OpenchannelInteraction'][_0x1d0d('0xb1')]({'where':{'id':_0x222585[_0x1d0d('0xab')]['id']}})[_0x1d0d('0x2b')](handleEntityNotFound(_0x35fe49,null))[_0x1d0d('0x2b')](function(_0x4e6ec9){if(_0x4e6ec9){return _0x4e6ec9[_0x1d0d('0xbe')](_0x222585[_0x1d0d('0x6b')]['ids'],_['omit'](_0x222585[_0x1d0d('0x6b')],[_0x1d0d('0xb5'),'id'])||{})[_0x1d0d('0xbf')](function(){return db[_0x1d0d('0x65')][_0x1d0d('0xbc')]({'attributes':['id',_0x1d0d('0x2f'),_0x1d0d('0xc0')],'where':{'id':_0x222585[_0x1d0d('0x6b')]['ids']}});})[_0x1d0d('0x2b')](function(_0x294244){socket[_0x1d0d('0xc1')](_0x1d0d('0xc2'),{'id':Number(_0x222585[_0x1d0d('0xab')]['id']),'tags':_0x294244||[]});return{'id':Number(_0x222585[_0x1d0d('0xab')]['id']),'tags':_0x294244||[]};});}})[_0x1d0d('0x2b')](respondWithResult(_0x35fe49,null))[_0x1d0d('0xa9')](handleError(_0x35fe49,null));};exports[_0x1d0d('0xc3')]=function(_0xed11ba,_0x223e3d,_0xd6c165){return db[_0x1d0d('0x37')][_0x1d0d('0xb1')]({'where':{'id':_0xed11ba[_0x1d0d('0xab')]['id']}})['then'](handleEntityNotFound(_0x223e3d,null))[_0x1d0d('0x2b')](function(_0x573358){if(_0x573358){return _0x573358['removeTags'](_0xed11ba[_0x1d0d('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x223e3d,null))[_0x1d0d('0xa9')](handleError(_0x223e3d,null));};exports[_0x1d0d('0xc4')]=function(_0x508284,_0x5a49b0){var _0x43b2f3=moment()[_0x1d0d('0xc5')]()[_0x1d0d('0x91')]();var _0x1efa41=path[_0x1d0d('0xc6')](config[_0x1d0d('0xc7')],_0x1d0d('0xc8'),_0x1d0d('0xc9'),_0x1d0d('0xca'));var _0x225695=path[_0x1d0d('0xc6')](config[_0x1d0d('0xc7')],_0x1d0d('0xc8'),_0x1d0d('0xc9'),_0x1d0d('0xcb'));var _0x840e9b=path['join'](_0x1efa41,_0x43b2f3);var _0x5dc32f=util[_0x1d0d('0xbb')](_0x1d0d('0xcc'),_0x508284['params']['id'],_0x43b2f3);var _0x3f8c75=path[_0x1d0d('0xc6')](_0x1efa41,_0x5dc32f);var _0x18ca80=[];_0x18ca80['push']({'model':db[_0x1d0d('0x67')],'as':'User','attributes':['id',_0x1d0d('0x33')],'raw':!![]});_0x18ca80[_0x1d0d('0xa6')]({'model':db[_0x1d0d('0xcd')],'as':_0x1d0d('0xce'),'attributes':['id',_0x1d0d('0xcf'),_0x1d0d('0xd0')],'raw':!![]});if(_0x508284[_0x1d0d('0x3b')][_0x1d0d('0xcb')]){_0x18ca80['push']({'model':db[_0x1d0d('0xd1')],'as':_0x1d0d('0xd1'),'raw':!![]});}var _0x4c2d61=[{'model':db[_0x1d0d('0xb4')],'as':_0x1d0d('0xd2'),'attributes':['id',_0x1d0d('0x6b'),_0x1d0d('0x70'),_0x1d0d('0xd3'),_0x1d0d('0xd4'),_0x1d0d('0x77')],'include':_0x18ca80}];_0x4c2d61['push']({'model':db[_0x1d0d('0xd5')],'as':_0x1d0d('0xd6'),'attributes':['id',_0x1d0d('0x2f')]});_0x4c2d61['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x1d0d('0x33')]});return db[_0x1d0d('0x37')]['find']({'where':{'id':_0x508284[_0x1d0d('0xab')]['id']},'include':_0x4c2d61})[_0x1d0d('0x2b')](handleEntityNotFound(_0x5a49b0,null))['then'](function(_0x4cacd6){if(_0x4cacd6){var _0x1fc09d=_0x4cacd6['get']({'plain':!![]});fs[_0x1d0d('0xd7')](_0x840e9b);var _0x3d3628={'channel':_0x1d0d('0xd8'),'account':_0x1fc09d[_0x1d0d('0xd6')]['name'],'agent':_0x1fc09d['Owner']?_0x1fc09d[_0x1d0d('0xd9')][_0x1d0d('0x33')]:_0x1d0d('0xda'),'createdAt':moment(_0x1fc09d['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x1fc09d['closed']?moment(_0x1fc09d[_0x1d0d('0xdb')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x1d0d('0x91')]():'','disposition':_0x1fc09d[_0x1d0d('0xdc')],'visibility':_0x1fc09d[_0x1d0d('0xdd')]?'Public':_0x1d0d('0xde'),'messages':_(_0x1fc09d[_0x1d0d('0xd2')])[_0x1d0d('0x7b')]({'secret':![]})[_0x1d0d('0x32')](function(_0x5efaa6){if(_0x5efaa6[_0x1d0d('0xd1')]){var _0x339167=path[_0x1d0d('0xc6')](_0x225695,_0x5efaa6['Attachment'][_0x1d0d('0xdf')]);if(fs['existsSync'](_0x339167)){fs[_0x1d0d('0xe0')](_0x339167)[_0x1d0d('0xe1')](fs[_0x1d0d('0xe2')](path[_0x1d0d('0xc6')](_0x840e9b,_0x5efaa6[_0x1d0d('0xd1')][_0x1d0d('0xdf')])));}}return{'date':moment(_0x5efaa6[_0x1d0d('0x70')])['format'](_0x1d0d('0xe3'))[_0x1d0d('0x91')](),'sender':_0x5efaa6[_0x1d0d('0xd3')]==='out'?_0x5efaa6[_0x1d0d('0x67')]?_0x5efaa6['User']['fullname']:_0x1d0d('0xe4'):_0x5efaa6[_0x1d0d('0xce')][_0x1d0d('0xcf')]+(_0x5efaa6[_0x1d0d('0xce')][_0x1d0d('0xd0')]?'\x20'+_0x5efaa6['Contact'][_0x1d0d('0xd0')]:''),'body':_0x5efaa6[_0x1d0d('0xd1')]?_0x5efaa6[_0x1d0d('0xd1')][_0x1d0d('0xdf')]:_0x5efaa6[_0x1d0d('0x6b')],'direction':_0x5efaa6['direction']===_0x1d0d('0xe5')?'A':'C','secret':_0x5efaa6[_0x1d0d('0xd4')],'read':_0x5efaa6[_0x1d0d('0x77')],'attachment':_0x5efaa6[_0x1d0d('0xd1')]};})[_0x1d0d('0x5c')]()};return ejs['renderFile'](path[_0x1d0d('0xc6')](config[_0x1d0d('0xc7')],_0x1d0d('0xc8'),'views',_0x1d0d('0xe6')),{'interaction':_0x3d3628})[_0x1d0d('0x2b')](function(_0x7419d2){var _0x1cf4a1=path[_0x1d0d('0xc6')](_0x840e9b,'transcript-'+_0x1fc09d['id']+'-'+_0x43b2f3+'.pdf');var _0x1956a1={'path':_0x1cf4a1,'channel':_0x1d0d('0xd8'),'interactionId':_0x1fc09d['id']};return pdf['createPdfFromHTML'](_0x7419d2,_0x1956a1);})[_0x1d0d('0x2b')](function(){return new BPromise(function(_0x5f0fba,_0x3670c6){zipdir(_0x840e9b,{'saveTo':_0x3f8c75},function(_0x5b5f51,_0x34aa91){if(_0x5b5f51)return _0x3670c6(_0x5b5f51);return _0x5f0fba(_0x34aa91);});})[_0x1d0d('0x2b')](function(){return new BPromise(function(_0x1cb8fc,_0x3156e5){rimraf(_0x840e9b,function(_0x22b5d1){if(_0x22b5d1)_0x3156e5(_0x22b5d1);return _0x1cb8fc();});});})[_0x1d0d('0x2b')](function(){return _0x5a49b0[_0x1d0d('0xc4')](_0x3f8c75,_0x5dc32f,function(_0x375df5){if(_0x375df5){console[_0x1d0d('0xe7')](_0x1d0d('0xe8'),_0x375df5);}else{fs['unlinkSync'](_0x3f8c75);}});});});}else{return _0x5a49b0[_0x1d0d('0x20')](0xc8);}})['catch'](handleError(_0x5a49b0,null));};
\ No newline at end of file
+var _0x30d1=['fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','field','color','tools_tags','select','from','user_has_openchannel_interactions','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','left_join','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','split','getFullTextValue','ContactId','buildExpression','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','body','some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','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','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','OpenchannelInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','show','params','includeAll','include','options','create','update','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','nolimit','$gte','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','emit','openchannelInteractionTags:save','removeTags','root','files','tmp','join','server','format','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','secret','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','N.A.','closedAt','threadId','Public','Private','basename','createReadStream','pipe','direction','out','renderFile','views','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','catch','index','rawAttributes'];(function(_0x9e699f,_0xd06638){var _0x3faa19=function(_0x186fbc){while(--_0x186fbc){_0x9e699f['push'](_0x9e699f['shift']());}};_0x3faa19(++_0xd06638);}(_0x30d1,0xb5));var _0x130d=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0x30d1[_0x47408e];return _0x1636bc;};'use strict';var emlformat=require(_0x130d('0x0'));var rimraf=require(_0x130d('0x1'));var zipdir=require(_0x130d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x130d('0x3'));var BPromise=require(_0x130d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x130d('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x130d('0x6'));var fs=require('fs');var fs_extra=require(_0x130d('0x7'));var _=require(_0x130d('0x8'));var squel=require(_0x130d('0x9'));var crypto=require(_0x130d('0xa'));var jsforce=require(_0x130d('0xb'));var deskjs=require(_0x130d('0xc'));var toCsv=require(_0x130d('0xd'));var querystring=require(_0x130d('0xe'));var Papa=require(_0x130d('0xf'));var Redis=require(_0x130d('0x10'));var authService=require(_0x130d('0x11'));var qs=require(_0x130d('0x12'));var as=require(_0x130d('0x13'));var pdf=require(_0x130d('0x14'));var hardwareService=require(_0x130d('0x15'));var logger=require(_0x130d('0x16'))(_0x130d('0x17'));var utils=require('../../config/utils');var config=require(_0x130d('0x18'));var licenseUtil=require(_0x130d('0x19'));var db=require('../../mysqldb')['db'];config[_0x130d('0x1a')]=_[_0x130d('0x1b')](config[_0x130d('0x1a')],{'host':_0x130d('0x1c'),'port':0x18eb});var socket=require(_0x130d('0x1d'))(new Redis(config[_0x130d('0x1a')]));require(_0x130d('0x1e'))[_0x130d('0x1f')](socket);function respondWithStatusCode(_0x15325f,_0x517a95){_0x517a95=_0x517a95||0xcc;return function(_0x474450){if(_0x474450){return _0x15325f[_0x130d('0x20')](_0x517a95);}return _0x15325f['status'](_0x517a95)[_0x130d('0x21')]();};}function respondWithResult(_0x1c0c07,_0x45fac2){_0x45fac2=_0x45fac2||0xc8;return function(_0x55e15b){if(_0x55e15b){return _0x1c0c07[_0x130d('0x22')](_0x45fac2)[_0x130d('0x23')](_0x55e15b);}};}function respondWithFilteredResult(_0x3b55e5,_0x364ad7){return function(_0x53ae99){if(_0x53ae99){var _0x4c973e=typeof _0x364ad7[_0x130d('0x24')]===_0x130d('0x25')&&typeof _0x364ad7[_0x130d('0x26')]===_0x130d('0x25');var _0xa74ce2=_0x53ae99[_0x130d('0x27')];var _0x5dec90=_0x4c973e?0x0:_0x364ad7[_0x130d('0x24')];var _0x13849d=_0x4c973e?_0x53ae99[_0x130d('0x27')]:_0x364ad7[_0x130d('0x24')]+_0x364ad7[_0x130d('0x26')];var _0x53d15a;if(_0x13849d>=_0xa74ce2){_0x13849d=_0xa74ce2;_0x53d15a=0xc8;}else{_0x53d15a=0xce;}_0x3b55e5[_0x130d('0x22')](_0x53d15a);return _0x3b55e5[_0x130d('0x28')](_0x130d('0x29'),_0x5dec90+'-'+_0x13849d+'/'+_0xa74ce2)[_0x130d('0x23')](_0x53ae99);}return null;};}function patchUpdates(_0x2ad0e2){return function(_0x1fb71f){try{jsonpatch[_0x130d('0x2a')](_0x1fb71f,_0x2ad0e2,!![]);}catch(_0x4a2279){return BPromise[_0x130d('0x2b')](_0x4a2279);}return _0x1fb71f[_0x130d('0x2c')]();};}function saveUpdates(_0xdf300,_0x37246d){return function(_0xa2ac60){if(_0xa2ac60){return _0xa2ac60['update'](_0xdf300)[_0x130d('0x2d')](function(_0x4fb165){return _0x4fb165;});}return null;};}function removeEntity(_0x4cc333,_0x433efb){return function(_0x57b8b3){if(_0x57b8b3){return _0x57b8b3[_0x130d('0x2e')]()[_0x130d('0x2d')](function(){_0x4cc333[_0x130d('0x22')](0xcc)[_0x130d('0x21')]();});}};}function handleEntityNotFound(_0x4384b3,_0x13c86c){return function(_0x35e80e){if(!_0x35e80e){_0x4384b3['sendStatus'](0x194);}return _0x35e80e;};}function handleError(_0x4fe568,_0x4ea8c3){_0x4ea8c3=_0x4ea8c3||0x1f4;return function(_0x3f3b10){logger[_0x130d('0x2f')](_0x3f3b10[_0x130d('0x30')]);if(_0x3f3b10[_0x130d('0x31')]){delete _0x3f3b10[_0x130d('0x31')];}_0x4fe568[_0x130d('0x22')](_0x4ea8c3)[_0x130d('0x32')](_0x3f3b10);};}function getInteractionUsers(_0x103e68,_0x1bb822){return new BPromise(function(_0x2aef0b,_0x367e0a){try{if(_0x1bb822[_0x103e68['id']]){_0x103e68[_0x130d('0x33')]=_[_0x130d('0x34')](_0x1bb822[_0x103e68['id']],function(_0x2062fc){return{'id':_0x2062fc['id'],'fullname':_0x2062fc[_0x130d('0x35')]};});}}catch(_0x4fa237){_0x367e0a(_0x4fa237);}_0x2aef0b(_0x103e68);});}function getInteractionTags(_0x4fb7e4,_0x5d1769){return new BPromise(function(_0x45a38b,_0x5f16f7){try{if(_0x4fb7e4[_0x130d('0x36')]){_0x4fb7e4[_0x130d('0x37')]=[];_0x4fb7e4['TagIds']['split'](',')[_0x130d('0x38')](function(_0x220549){_0x4fb7e4[_0x130d('0x37')][_0x130d('0x39')](_0x5d1769[_0x220549]);});}delete _0x4fb7e4['TagIds'];}catch(_0x1af36e){_0x5f16f7(_0x1af36e);}_0x45a38b(_0x4fb7e4);});}function updateOpenchannelInteraction(_0x51b73d,_0x6ff2d3,_0x50a357){return new BPromise(function(_0x13708e,_0x54b4ec){return getInteractionUsers(_0x51b73d,_0x50a357)[_0x130d('0x2d')](function(_0xe587cb){return getInteractionTags(_0xe587cb,_0x6ff2d3);})[_0x130d('0x2d')](function(_0x13870f){_0x13708e(_0x13870f);})[_0x130d('0x3a')](function(_0x12e98f){_0x54b4ec(_0x12e98f);});});}exports[_0x130d('0x3b')]=function(_0x203b35,_0x44797f){var _0x3ed4c4={},_0x95336e={},_0x155f7d={'count':0x0,'rows':[]};var _0x3d825a=_[_0x130d('0x34')](db['OpenchannelInteraction'][_0x130d('0x3c')],function(_0x439f9a){return{'name':_0x439f9a[_0x130d('0x3d')],'type':_0x439f9a[_0x130d('0x3e')][_0x130d('0x3f')]};});_0x95336e[_0x130d('0x40')]=_[_0x130d('0x34')](_0x3d825a,_0x130d('0x31'));_0x95336e['query']=_[_0x130d('0x41')](_0x203b35['query']);_0x95336e[_0x130d('0x42')]=_[_0x130d('0x43')](_0x95336e[_0x130d('0x40')],_0x95336e[_0x130d('0x44')]);_0x3ed4c4['attributes']=_[_0x130d('0x43')](_0x95336e[_0x130d('0x40')],qs[_0x130d('0x45')](_0x203b35[_0x130d('0x44')][_0x130d('0x45')]));_0x3ed4c4[_0x130d('0x46')]=_0x3ed4c4[_0x130d('0x46')][_0x130d('0x47')]?_0x3ed4c4[_0x130d('0x46')]:_0x95336e[_0x130d('0x40')];if(!_0x203b35[_0x130d('0x44')][_0x130d('0x48')]('nolimit')){_0x3ed4c4['limit']=qs[_0x130d('0x26')](_0x203b35['query']['limit']);_0x3ed4c4['offset']=qs[_0x130d('0x24')](_0x203b35['query']['offset']);}_0x3ed4c4[_0x130d('0x49')]=qs[_0x130d('0x4a')](_0x203b35[_0x130d('0x44')][_0x130d('0x4a')]);_0x3ed4c4[_0x130d('0x4b')]=qs[_0x130d('0x42')](_[_0x130d('0x4c')](_0x203b35['query'],_0x95336e[_0x130d('0x42')]),_0x3d825a);var _0x117d24=[];var _0x52e90c=squel['select']()[_0x130d('0x4d')]('id')[_0x130d('0x4d')]('name')[_0x130d('0x4d')](_0x130d('0x4e'))['from'](_0x130d('0x4f'));var _0x5a6855=squel[_0x130d('0x50')]()[_0x130d('0x4d')]('u.id')[_0x130d('0x4d')]('u.fullname')['field']('ui.OpenchannelInteractionId')[_0x130d('0x51')](_0x130d('0x52'),'ui')['left_join']('users','u',_0x130d('0x53'));var _0x347f89=squel[_0x130d('0x50')]()[_0x130d('0x51')](_0x130d('0x54'),'i')['left_join'](_0x130d('0x55'),'c',_0x130d('0x56'))['left_join'](_0x130d('0x57'),'o',_0x130d('0x58'))[_0x130d('0x59')]('openchannel_accounts','a',_0x130d('0x5a'))[_0x130d('0x59')]('openchannel_messages','me',_0x130d('0x5b'))[_0x130d('0x59')](_0x130d('0x5c'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x130d('0x59')](_0x130d('0x4f'),'t',_0x130d('0x5d'));var _0x2a609a=squel[_0x130d('0x5e')]();var _0x5f18ea=[];var _0xb15ffa=squel['expr']();var _0x4364bb;if(_0x203b35['query'][_0x130d('0x5f')]){_0x4364bb=as[_0x130d('0x60')](_0x203b35[_0x130d('0x44')][_0x130d('0x5f')]);var _0x40b086=_0x4364bb[_0x130d('0x61')];for(var _0x327740=0x0;_0x327740<_0x4364bb['conditions'][_0x130d('0x47')];_0x327740++){var _0x30c234=_0x4364bb[_0x130d('0x62')][_0x327740];var _0x2b2690='i';var _0x3caf1e=_[_0x130d('0x63')](_0x3d825a,['name',_0x30c234[_0x130d('0x4d')]]);if(!_0x3caf1e){switch(_0x30c234[_0x130d('0x4d')]){case _0x130d('0x64'):if(_0x30c234['value']==0x1){_0x347f89[_0x130d('0x65')]('`'+_0x30c234['field']+_0x130d('0x66'));}else{_0x347f89[_0x130d('0x65')]('`'+_0x30c234[_0x130d('0x4d')]+_0x130d('0x67'));}break;case _0x130d('0x68'):if(_0x30c234[_0x130d('0x69')]===_0x130d('0x6a')){if(_0x30c234[_0x130d('0x6b')][_0x130d('0x6c')]('\x20')[_0x130d('0x47')]>0x1){_0x2a609a[_0x40b086]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x130d('0x6d')](_0x30c234[_0x130d('0x6b')]),null);}else{var _0xae8ea3='%'+_0x30c234[_0x130d('0x6b')]+'%';_0x2a609a[_0x40b086]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xae8ea3,_0xae8ea3,_0xae8ea3);}}else{_0x3caf1e=_[_0x130d('0x63')](_0x3d825a,[_0x130d('0x31'),_0x130d('0x6e')]);_0x30c234['field']=_0x130d('0x6e');_0x5d9ccc=as[_0x130d('0x6f')](_0x2b2690,_0x3caf1e['type'],_0x30c234);_0x2a609a[_0x40b086](_0x5d9ccc['text'],_0x5d9ccc[_0x130d('0x6b')]['start'],_0x5d9ccc['value'][_0x130d('0x21')]);}break;case _0x130d('0x70'):var _0xfd8fd3=_0x30c234[_0x130d('0x6b')][_0x130d('0x6c')](',')['map'](function(_0x4e0f26){return Number(_0x4e0f26);});_0xfd8fd3[_0x130d('0x38')](function(_0x3f7783){_0xb15ffa['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3f7783+',%');});_0x5f18ea=_['union'](_0x5f18ea,_0xfd8fd3);break;case _0x130d('0x71'):if(_0x30c234[_0x130d('0x69')]==='$substring'){_0x2a609a[_0x40b086](_0x130d('0x72'),'%'+_0x30c234[_0x130d('0x6b')]+'%',null);}else{_0x3caf1e=_[_0x130d('0x63')](_0x3d825a,[_0x130d('0x31'),'UserId']);_0x30c234[_0x130d('0x4d')]='UserId';_0x5d9ccc=as[_0x130d('0x6f')](_0x2b2690,_0x3caf1e[_0x130d('0x3e')],_0x30c234);_0x2a609a[_0x40b086](_0x5d9ccc[_0x130d('0x73')],_0x5d9ccc[_0x130d('0x6b')][_0x130d('0x74')],_0x5d9ccc[_0x130d('0x6b')][_0x130d('0x21')]);}break;case _0x130d('0x75'):_0x5d9ccc=as[_0x130d('0x6f')]('me',null,_0x30c234);_0x2a609a[_0x40b086](_0x5d9ccc[_0x130d('0x73')],_0x5d9ccc[_0x130d('0x6b')][_0x130d('0x74')],_0x5d9ccc[_0x130d('0x6b')]['end']);break;}}else{var _0x5d9ccc=as[_0x130d('0x6f')](_0x2b2690,_0x3caf1e[_0x130d('0x3e')],_0x30c234);_0x2a609a[_0x40b086](_0x5d9ccc[_0x130d('0x73')],_0x5d9ccc[_0x130d('0x6b')][_0x130d('0x74')],_0x5d9ccc[_0x130d('0x6b')][_0x130d('0x21')]);}}}else{var _0x5565f1=_(_0x203b35[_0x130d('0x44')])[_0x130d('0x41')]()['map'](function(_0x1cefa7){return _[_0x130d('0x76')](_0x3d825a,[_0x130d('0x31'),_0x1cefa7])?_0x1cefa7:undefined;})['compact']()[_0x130d('0x6b')]();if(!_[_0x130d('0x77')](_0x5565f1)){_0x5565f1[_0x130d('0x38')](function(_0x4183a6){if(_0x4183a6===_0x130d('0x78')){_0x347f89['where'](_0x130d('0x79'),[][_0x130d('0x7a')](_0x203b35[_0x130d('0x44')][_0x4183a6]));}else if(_0x4183a6===_0x130d('0x7b')){var _0x1a364e=JSON[_0x130d('0x7c')](_0x203b35[_0x130d('0x44')][_0x4183a6])['$gte'];var _0x4e14d9=JSON[_0x130d('0x7c')](_0x203b35[_0x130d('0x44')][_0x4183a6])['$lte'];_0x347f89[_0x130d('0x4b')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1a364e,_0x4e14d9);}else{if(_0x203b35['query'][_0x4183a6]==='null'){_0x347f89['where']('i.'+_0x4183a6+_0x130d('0x7d'));}else{_0x347f89['where']('i.'+_0x4183a6+_0x130d('0x7e'),_0x203b35[_0x130d('0x44')][_0x4183a6]);}}});}if(_0x203b35[_0x130d('0x44')]['read']){if(_0x203b35[_0x130d('0x44')][_0x130d('0x7f')]==0x1){_0x347f89['having']('`unreadMessages`\x20=\x200');}else{_0x347f89[_0x130d('0x65')](_0x130d('0x80'));}}if(_0x203b35['query'][_0x130d('0x81')]){_0x5f18ea=_[_0x130d('0x82')](_0x203b35[_0x130d('0x44')]['tag'])?_0x203b35[_0x130d('0x44')]['tag']:new Array(_0x203b35[_0x130d('0x44')]['tag']);_0x5f18ea[_0x130d('0x38')](function(_0x2f6e0d){_0xb15ffa['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2f6e0d+',%');});}if(_0x203b35[_0x130d('0x44')][_0x130d('0x83')]){var _0x109254=_0x203b35[_0x130d('0x44')]['filter'][_0x130d('0x84')]('\x5c','\x5c\x5c')[_0x130d('0x84')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x109254)){_0x2a609a['or'](_0x130d('0x85'),_0x109254+'%');}else{_0x2a609a['or'](_0x130d('0x86'),qs[_0x130d('0x6d')](_0x109254))['or'](_0x130d('0x87'),_0x109254+'%')['or'](_0x130d('0x88'),_0x109254+'%');}}}_0x347f89['where'](_0x2a609a);_0x347f89[_0x130d('0x89')](_0x130d('0x8a'));var _0x5dd833={'type':db['Sequelize'][_0x130d('0x8b')][_0x130d('0x8c')],'raw':!![]};var _0x7c0064=_0x347f89[_0x130d('0x8d')]();_0x7c0064[_0x130d('0x4d')]('i.id');_0x7c0064[_0x130d('0x4d')](_0x130d('0x8e'),_0x130d('0x64'));if(_0x3ed4c4[_0x130d('0x49')]){_0x3ed4c4[_0x130d('0x49')]['forEach'](function(_0x1681f5){var _0x47d49f=_0x1681f5[0x0]===_0x130d('0x8f')?_0x1681f5[0x0]:'i.'+_0x1681f5[0x0];_0x347f89['order'](_0x47d49f,_0x1681f5[0x1]===_0x130d('0x90')?![]:!![]);});}if(!_[_0x130d('0x77')](_0x5f18ea)){_0x347f89[_0x130d('0x65')](_0xb15ffa);_0x7c0064[_0x130d('0x4b')](_0x130d('0x91'),_0x5f18ea);}BPromise[_0x130d('0x92')]()[_0x130d('0x2d')](function(){if(!_0x4364bb){if(_0x203b35[_0x130d('0x44')]['OpenchannelAccountId'])return;_0x7c0064['where'](_0x130d('0x93'));_0x347f89[_0x130d('0x4b')](_0x130d('0x93'));return;}if(_0x203b35[_0x130d('0x94')][_0x130d('0x95')]!==_0x130d('0x96'))return;return _0x203b35['user'][_0x130d('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3b56ed){if(_[_0x130d('0x77')](_0x3b56ed)){_0x7c0064[_0x130d('0x4b')](_0x130d('0x98'));_0x347f89['where'](_0x130d('0x98'));}else{_0x7c0064[_0x130d('0x4b')](_0x130d('0x79'),_[_0x130d('0x34')](_0x3b56ed,'id'));_0x347f89[_0x130d('0x4b')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x3b56ed,'id'));}});})[_0x130d('0x2d')](function(){if(_0x203b35[_0x130d('0x94')]['role']===_0x130d('0x96')&&!_0x4364bb&&!_0x203b35[_0x130d('0x44')][_0x130d('0x78')])return[];return db[_0x130d('0x99')][_0x130d('0x44')](_0x7c0064[_0x130d('0x9a')](),_0x5dd833);})[_0x130d('0x2d')](function(_0x519706){_0x155f7d[_0x130d('0x27')]=_0x519706[_0x130d('0x47')];if(_0x155f7d[_0x130d('0x27')]===0x0)return[];return db['sequelize'][_0x130d('0x44')](_0x52e90c['toString'](),_0x5dd833)[_0x130d('0x2d')](function(_0x366f3b){_0x117d24=_[_0x130d('0x9b')](_0x366f3b,'id');_0x5dd833=_[_0x130d('0x9c')](_0x5dd833,{'model':db[_0x130d('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x203b35[_0x130d('0x44')][_0x130d('0x45')]){_0x3ed4c4[_0x130d('0x46')]['forEach'](function(_0x445289){_0x347f89[_0x130d('0x4d')]('i.'+_0x445289);});}else{_0x347f89['field'](_0x130d('0x8e'),'unreadMessages');_0x347f89[_0x130d('0x4d')](_0x130d('0x9e'),_0x130d('0x9f'));_0x347f89[_0x130d('0x4d')](_0x130d('0xa0'),_0x130d('0xa1'));_0x347f89[_0x130d('0x4d')]('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',_0x130d('0x8f'));_0x347f89['field'](_0x130d('0xa2'));_0x347f89[_0x130d('0x4d')](_0x130d('0xa3'),_0x130d('0xa4'));_0x347f89[_0x130d('0x4d')](_0x130d('0xa5'),_0x130d('0xa6'));_0x347f89[_0x130d('0x4d')](_0x130d('0xa7'),'Contact.email');_0x347f89[_0x130d('0x4d')](_0x130d('0xa8'),_0x130d('0xa9'));_0x347f89['field']('c.mobile',_0x130d('0xaa'));_0x347f89[_0x130d('0x4d')](_0x130d('0xab'),_0x130d('0xac'));_0x347f89[_0x130d('0x4d')](_0x130d('0xad'),_0x130d('0xae'));_0x347f89[_0x130d('0x4d')]('o.internal',_0x130d('0xaf'));_0x347f89['field'](_0x130d('0xb0'),_0x130d('0x36'));}if(_0x3ed4c4[_0x130d('0x26')])_0x347f89[_0x130d('0x26')](_0x3ed4c4['limit']);if(_0x3ed4c4['offset'])_0x347f89[_0x130d('0x24')](_0x3ed4c4[_0x130d('0x24')]);return db[_0x130d('0x99')][_0x130d('0x44')](_0x347f89[_0x130d('0x9a')](),_0x5dd833);})[_0x130d('0x2d')](function(_0x323d4f){if(_0x323d4f[_0x130d('0x47')]>0x0)_0x5a6855[_0x130d('0x4b')](_0x130d('0xb1'),_[_0x130d('0x34')](_0x323d4f,'id'));return db[_0x130d('0x99')][_0x130d('0x44')](_0x5a6855['toString'](),_0x5dd833)['then'](function(_0x307d66){var _0x5d9b41=_[_0x130d('0xb2')](_0x307d66,_0x130d('0xb3'));var _0x159f10=[];_0x323d4f[_0x130d('0x38')](function(_0x3de25c){_0x159f10[_0x130d('0x39')](updateOpenchannelInteraction(_0x3de25c,_0x117d24,_0x5d9b41));});return BPromise['all'](_0x159f10);});});})[_0x130d('0x2d')](function(_0x47c5d8){_0x155f7d['rows']=_0x47c5d8;return _0x155f7d;})['then'](respondWithFilteredResult(_0x44797f,_0x3ed4c4))['catch'](handleError(_0x44797f,null));};exports[_0x130d('0xb4')]=function(_0x4ea06e,_0xaae0d){var _0x152cf2={};if(_0x4ea06e[_0x130d('0x44')][_0x130d('0x3e')]&&_0x4ea06e[_0x130d('0x44')][_0x130d('0x3e')]===_0x130d('0x51')){_0x152cf2['from']=_0x4ea06e[_0x130d('0xb5')]['id'];}else{_0x152cf2['id']=_0x4ea06e[_0x130d('0xb5')]['id'];}var _0x438c3a={'raw':![],'where':_0x152cf2},_0x1a540b={};_0x1a540b[_0x130d('0x40')]=_[_0x130d('0x41')](db[_0x130d('0x9d')][_0x130d('0x3c')]);_0x1a540b['query']=_['keys'](_0x4ea06e[_0x130d('0x44')]);_0x1a540b[_0x130d('0x42')]=_[_0x130d('0x43')](_0x1a540b[_0x130d('0x40')],_0x1a540b[_0x130d('0x44')]);_0x438c3a['attributes']=_[_0x130d('0x43')](_0x1a540b['model'],qs[_0x130d('0x45')](_0x4ea06e[_0x130d('0x44')][_0x130d('0x45')]));_0x438c3a['attributes']=_0x438c3a[_0x130d('0x46')][_0x130d('0x47')]?_0x438c3a[_0x130d('0x46')]:_0x1a540b[_0x130d('0x40')];if(_0x4ea06e[_0x130d('0x44')][_0x130d('0xb6')]){_0x438c3a[_0x130d('0xb7')]=[{'all':!![]}];}_0x438c3a=_[_0x130d('0x9c')]({},_0x438c3a,_0x4ea06e[_0x130d('0xb8')]);return db[_0x130d('0x9d')][_0x130d('0x63')](_0x438c3a)['then'](handleEntityNotFound(_0xaae0d,null))['then'](respondWithResult(_0xaae0d,null))['catch'](handleError(_0xaae0d,null));};exports[_0x130d('0xb9')]=function(_0x5e1ac2,_0x10c93c){return db[_0x130d('0x9d')]['create'](_0x5e1ac2[_0x130d('0x75')],{})[_0x130d('0x2d')](respondWithResult(_0x10c93c,0xc9))[_0x130d('0x3a')](handleError(_0x10c93c,null));};exports[_0x130d('0xba')]=function(_0xdc5510,_0x7a037e){if(_0xdc5510[_0x130d('0x75')]['id']){delete _0xdc5510[_0x130d('0x75')]['id'];}return db[_0x130d('0x9d')][_0x130d('0x63')]({'where':{'id':_0xdc5510[_0x130d('0xb5')]['id']}})[_0x130d('0x2d')](handleEntityNotFound(_0x7a037e,null))[_0x130d('0x2d')](saveUpdates(_0xdc5510[_0x130d('0x75')],null))[_0x130d('0x2d')](respondWithResult(_0x7a037e,null))[_0x130d('0x3a')](handleError(_0x7a037e,null));};exports[_0x130d('0x2e')]=function(_0x4647d7,_0x903039){return db['OpenchannelInteraction'][_0x130d('0x63')]({'where':{'id':_0x4647d7[_0x130d('0xb5')]['id']}})[_0x130d('0x2d')](handleEntityNotFound(_0x903039,null))['then'](removeEntity(_0x903039,null))[_0x130d('0x3a')](handleError(_0x903039,null));};exports[_0x130d('0xbb')]=function(_0x57f3a4,_0x48acff){return db['OpenchannelInteraction'][_0x130d('0xbb')]()['then'](respondWithResult(_0x48acff,null))[_0x130d('0x3a')](handleError(_0x48acff,null));};exports[_0x130d('0xbc')]=function(_0x7d549,_0x3d5e7e,_0x432db3){return db[_0x130d('0xbd')][_0x130d('0x63')]({'where':{'id':_0x7d549['params']['id']}})['then'](handleEntityNotFound(_0x3d5e7e,null))[_0x130d('0x2d')](function(_0x1602e1){if(_0x1602e1){return _0x1602e1['addMessage'](_0x7d549[_0x130d('0x75')][_0x130d('0xbe')],_[_0x130d('0xbf')](_0x7d549[_0x130d('0x75')],['ids','id'])||{});}})[_0x130d('0x2d')](respondWithResult(_0x3d5e7e,null))[_0x130d('0x3a')](handleError(_0x3d5e7e,null));};exports[_0x130d('0xc0')]=function(_0x54bf29,_0x69367b,_0x10a92d){var _0x49e531={'raw':![],'where':{}};var _0x498722={};var _0x5c6712={'count':0x0,'rows':[]};return db[_0x130d('0x9d')][_0x130d('0xc1')]({'where':{'id':_0x54bf29['params']['id']}})[_0x130d('0x2d')](handleEntityNotFound(_0x69367b,null))[_0x130d('0x2d')](function(_0xc71060){if(_0xc71060){_0x498722[_0x130d('0x40')]=_[_0x130d('0x41')](db[_0x130d('0xbd')][_0x130d('0x3c')]);_0x498722[_0x130d('0x44')]=_['keys'](_0x54bf29[_0x130d('0x44')]);_0x498722[_0x130d('0x42')]=_[_0x130d('0x43')](_0x498722[_0x130d('0x40')],_0x498722['query']);_0x49e531[_0x130d('0x46')]=_[_0x130d('0x43')](_0x498722[_0x130d('0x40')],qs['fields'](_0x54bf29[_0x130d('0x44')][_0x130d('0x45')]));_0x49e531[_0x130d('0x46')]=_0x49e531[_0x130d('0x46')]['length']?_0x49e531[_0x130d('0x46')]:_0x498722[_0x130d('0x40')];if(!_0x54bf29['query'][_0x130d('0x48')](_0x130d('0xc2'))){_0x49e531[_0x130d('0x26')]=qs[_0x130d('0x26')](_0x54bf29['query'][_0x130d('0x26')]);_0x49e531[_0x130d('0x24')]=qs[_0x130d('0x24')](_0x54bf29[_0x130d('0x44')][_0x130d('0x24')]);}_0x49e531[_0x130d('0x49')]=qs[_0x130d('0x4a')](_0x54bf29[_0x130d('0x44')][_0x130d('0x4a')]);_0x49e531[_0x130d('0x4b')]=qs['filters'](_[_0x130d('0x4c')](_0x54bf29[_0x130d('0x44')],_0x498722[_0x130d('0x42')]));_0x49e531[_0x130d('0x4b')][_0x130d('0xb3')]=_0xc71060['id'];if(_0x54bf29[_0x130d('0x44')]['filter']){_0x49e531[_0x130d('0x4b')]=_['merge'](_0x49e531[_0x130d('0x4b')],{'$or':_[_0x130d('0x34')](_0x49e531[_0x130d('0x46')],function(_0x1bd03f){var _0x56aaae={};_0x56aaae[_0x1bd03f]={'$like':'%'+_0x54bf29[_0x130d('0x44')][_0x130d('0x83')]+'%'};return _0x56aaae;})});}if(_0x54bf29[_0x130d('0x44')][_0x130d('0xc3')]){var _0x189a32=_0x54bf29[_0x130d('0x44')]['$gte'][_0x130d('0x6c')](',');var _0x385a95={};_0x385a95[_0x189a32[0x0]]={'$gte':moment(_0x189a32[0x1])['format'](_0x130d('0xc4'))};_0x49e531[_0x130d('0x4b')]=_[_0x130d('0x9c')](_0x49e531['where'],_0x385a95);}_0x49e531=_[_0x130d('0x9c')]({},_0x49e531,_0x54bf29[_0x130d('0xb8')]);return db['OpenchannelMessage'][_0x130d('0x27')]({'where':_0x49e531['where']})[_0x130d('0x2d')](function(_0x2593dc){_0x5c6712[_0x130d('0x27')]=_0x2593dc;if(_0x54bf29[_0x130d('0x44')]['includeAll']){_0x49e531[_0x130d('0xb7')]=[{'all':!![]}];}return db[_0x130d('0xbd')]['findAll'](_0x49e531);})[_0x130d('0x2d')](function(_0x3d6177){_0x5c6712['rows']=_0x3d6177;return _0x5c6712;});}})[_0x130d('0x2d')](respondWithFilteredResult(_0x69367b,_0x49e531))[_0x130d('0x3a')](handleError(_0x69367b,null));};exports[_0x130d('0xc5')]=function(_0x52fb0b,_0xe114eb,_0x1be1ba){return db[_0x130d('0x9d')][_0x130d('0x63')]({'where':{'id':_0x52fb0b[_0x130d('0xb5')]['id']}})[_0x130d('0x2d')](handleEntityNotFound(_0xe114eb,null))[_0x130d('0x2d')](function(_0x1f12c4){if(_0x1f12c4){return _0x1f12c4[_0x130d('0xc6')](_0x52fb0b[_0x130d('0x75')]['ids'],_['omit'](_0x52fb0b[_0x130d('0x75')],[_0x130d('0xbe'),'id'])||{})[_0x130d('0xc7')](function(){return db['Tag'][_0x130d('0xc8')]({'attributes':['id',_0x130d('0x31'),_0x130d('0x4e')],'where':{'id':_0x52fb0b[_0x130d('0x75')][_0x130d('0xbe')]}});})[_0x130d('0x2d')](function(_0x112bd2){socket[_0x130d('0xc9')](_0x130d('0xca'),{'id':Number(_0x52fb0b[_0x130d('0xb5')]['id']),'tags':_0x112bd2||[]});return{'id':Number(_0x52fb0b[_0x130d('0xb5')]['id']),'tags':_0x112bd2||[]};});}})['then'](respondWithResult(_0xe114eb,null))[_0x130d('0x3a')](handleError(_0xe114eb,null));};exports[_0x130d('0xcb')]=function(_0x497f77,_0x595510,_0x4a3a5e){return db['OpenchannelInteraction']['find']({'where':{'id':_0x497f77[_0x130d('0xb5')]['id']}})[_0x130d('0x2d')](handleEntityNotFound(_0x595510,null))[_0x130d('0x2d')](function(_0x33365c){if(_0x33365c){return _0x33365c[_0x130d('0xcb')](_0x497f77[_0x130d('0x44')]['ids']);}})[_0x130d('0x2d')](respondWithStatusCode(_0x595510,null))[_0x130d('0x3a')](handleError(_0x595510,null));};exports['download']=function(_0x505eba,_0x59df63){var _0x4637c5=moment()['unix']()[_0x130d('0x9a')]();var _0x4d65f6=path['join'](config[_0x130d('0xcc')],'server',_0x130d('0xcd'),_0x130d('0xce'));var _0xc491bf=path[_0x130d('0xcf')](config[_0x130d('0xcc')],_0x130d('0xd0'),_0x130d('0xcd'),'attachments');var _0x280230=path['join'](_0x4d65f6,_0x4637c5);var _0x32e966=util[_0x130d('0xd1')](_0x130d('0xd2'),_0x505eba[_0x130d('0xb5')]['id'],_0x4637c5);var _0xb821a1=path[_0x130d('0xcf')](_0x4d65f6,_0x32e966);var _0x103beb=[];_0x103beb['push']({'model':db['User'],'as':_0x130d('0x71'),'attributes':['id',_0x130d('0x35')],'raw':!![]});_0x103beb[_0x130d('0x39')]({'model':db[_0x130d('0xd3')],'as':_0x130d('0x68'),'attributes':['id',_0x130d('0xd4'),_0x130d('0xd5')],'raw':!![]});if(_0x505eba[_0x130d('0x44')][_0x130d('0xd6')]){_0x103beb[_0x130d('0x39')]({'model':db['Attachment'],'as':_0x130d('0xd7'),'raw':!![]});}var _0x250bde=[{'model':db[_0x130d('0xbd')],'as':_0x130d('0xd8'),'attributes':['id',_0x130d('0x75'),_0x130d('0x7b'),'direction',_0x130d('0xd9'),_0x130d('0x7f')],'include':_0x103beb}];_0x250bde[_0x130d('0x39')]({'model':db[_0x130d('0xda')],'as':_0x130d('0xdb'),'attributes':['id','name']});_0x250bde['push']({'model':db['User'],'as':_0x130d('0xdc'),'attributes':['id',_0x130d('0x35')]});return db[_0x130d('0x9d')][_0x130d('0x63')]({'where':{'id':_0x505eba[_0x130d('0xb5')]['id']},'include':_0x250bde})['then'](handleEntityNotFound(_0x59df63,null))[_0x130d('0x2d')](function(_0x52f7b4){if(_0x52f7b4){var _0x1e286e=_0x52f7b4['get']({'plain':!![]});fs[_0x130d('0xdd')](_0x280230);var _0x4124d8={'channel':_0x130d('0xde'),'account':_0x1e286e[_0x130d('0xdb')][_0x130d('0x31')],'agent':_0x1e286e[_0x130d('0xdc')]?_0x1e286e[_0x130d('0xdc')]['fullname']:_0x130d('0xdf'),'createdAt':moment(_0x1e286e['createdAt'])[_0x130d('0xd1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x130d('0x9a')](),'closedAt':_0x1e286e['closed']?moment(_0x1e286e[_0x130d('0xe0')])[_0x130d('0xd1')](_0x130d('0xc4'))[_0x130d('0x9a')]():'','disposition':_0x1e286e['disposition'],'visibility':_0x1e286e[_0x130d('0xe1')]?_0x130d('0xe2'):_0x130d('0xe3'),'messages':_(_0x1e286e[_0x130d('0xd8')])[_0x130d('0x83')]({'secret':![]})[_0x130d('0x34')](function(_0x39afbe){if(_0x39afbe[_0x130d('0xd7')]){var _0x29e98c=path[_0x130d('0xcf')](_0xc491bf,_0x39afbe[_0x130d('0xd7')][_0x130d('0xe4')]);if(fs['existsSync'](_0x29e98c)){fs[_0x130d('0xe5')](_0x29e98c)[_0x130d('0xe6')](fs['createWriteStream'](path['join'](_0x280230,_0x39afbe[_0x130d('0xd7')][_0x130d('0xe4')])));}}return{'date':moment(_0x39afbe[_0x130d('0x7b')])['format'](_0x130d('0xc4'))[_0x130d('0x9a')](),'sender':_0x39afbe[_0x130d('0xe7')]==='out'?_0x39afbe[_0x130d('0x71')]?_0x39afbe[_0x130d('0x71')][_0x130d('0x35')]:'System':_0x39afbe[_0x130d('0x68')]['firstName']+(_0x39afbe[_0x130d('0x68')][_0x130d('0xd5')]?'\x20'+_0x39afbe['Contact'][_0x130d('0xd5')]:''),'body':_0x39afbe['Attachment']?_0x39afbe[_0x130d('0xd7')][_0x130d('0xe4')]:_0x39afbe[_0x130d('0x75')],'direction':_0x39afbe[_0x130d('0xe7')]===_0x130d('0xe8')?'A':'C','secret':_0x39afbe['secret'],'read':_0x39afbe['read'],'attachment':_0x39afbe[_0x130d('0xd7')]};})[_0x130d('0x6b')]()};return ejs[_0x130d('0xe9')](path[_0x130d('0xcf')](config['root'],_0x130d('0xd0'),_0x130d('0xea'),'downloadInteraction.ejs'),{'interaction':_0x4124d8})['then'](function(_0xb9ee4a){var _0x2e0c11=path['join'](_0x280230,_0x130d('0xeb')+_0x1e286e['id']+'-'+_0x4637c5+_0x130d('0xec'));var _0x1dd804={'path':_0x2e0c11,'channel':_0x130d('0xde'),'interactionId':_0x1e286e['id']};return pdf[_0x130d('0xed')](_0xb9ee4a,_0x1dd804);})['then'](function(){return new BPromise(function(_0x365a80,_0x5edde0){zipdir(_0x280230,{'saveTo':_0xb821a1},function(_0xef095f,_0x24c6bd){if(_0xef095f)return _0x5edde0(_0xef095f);return _0x365a80(_0x24c6bd);});})[_0x130d('0x2d')](function(){return new BPromise(function(_0x2c9de8,_0x24e683){rimraf(_0x280230,function(_0x406c2b){if(_0x406c2b)_0x24e683(_0x406c2b);return _0x2c9de8();});});})['then'](function(){return _0x59df63[_0x130d('0xee')](_0xb821a1,_0x32e966,function(_0x547286){if(_0x547286){console[_0x130d('0xef')](_0x130d('0xf0'),_0x547286);}else{fs[_0x130d('0xf1')](_0xb821a1);}});});});}else{return _0x59df63['sendStatus'](0xc8);}})[_0x130d('0x3a')](handleError(_0x59df63,null));};
\ No newline at end of file
index 958a6a0..7703cba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xece0=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','then','setDataValue','findAll','unreadMessages','length','emit'];(function(_0x1342fe,_0x515ab9){var _0x2a7b38=function(_0x49fa8c){while(--_0x49fa8c){_0x1342fe['push'](_0x1342fe['shift']());}};_0x2a7b38(++_0x515ab9);}(_0xece0,0x148));var _0x0ece=function(_0x2bafdc,_0x3e5c3b){_0x2bafdc=_0x2bafdc-0x0;var _0x50ed6b=_0xece0[_0x2bafdc];return _0x50ed6b;};'use strict';var EventEmitter=require(_0x0ece('0x0'));var OpenchannelInteraction=require(_0x0ece('0x1'))['db'][_0x0ece('0x2')];var OpenchannelMessage=require(_0x0ece('0x1'))['db'][_0x0ece('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x0ece('0x4')](0x0);var events={'afterCreate':_0x0ece('0x5'),'afterUpdate':_0x0ece('0x6'),'afterDestroy':_0x0ece('0x7')};function emitEvent(_0x15ef88){return function(_0x200008,_0xf5ffcc,_0x1953b8){_0x200008['getUsers']({'attributes':['id'],'raw':!![]})[_0x0ece('0x8')](function(_0x386b59){_0x200008[_0x0ece('0x9')]('Users',_0x386b59['map'](function(_0x579d69){return{'id':_0x579d69['id']};}));return OpenchannelMessage[_0x0ece('0xa')]({'where':{'OpenchannelInteractionId':_0x200008['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ece('0x8')](function(_0x4442d7){_0x200008['setDataValue'](_0x0ece('0xb'),_0x4442d7[_0x0ece('0xc')]);OpenchannelInteractionEvents[_0x0ece('0xd')](_0x15ef88+':'+_0x200008['id'],_0x200008);OpenchannelInteractionEvents[_0x0ece('0xd')](_0x15ef88,_0x200008);_0x1953b8(null);})[_0x0ece('0xe')](_0x1953b8(null));};}for(var e in events){if(events[_0x0ece('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x0ece('0x10')](e,emitEvent(event));}}module[_0x0ece('0x11')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x05db=['remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','setMaxListeners'];(function(_0xbeb93e,_0x4ca263){var _0x514fcd=function(_0x22cd2a){while(--_0x22cd2a){_0xbeb93e['push'](_0xbeb93e['shift']());}};_0x514fcd(++_0x4ca263);}(_0x05db,0xdd));var _0xb05d=function(_0x442f02,_0x47d845){_0x442f02=_0x442f02-0x0;var _0xab6ef1=_0x05db[_0x442f02];return _0xab6ef1;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xb05d('0x0'))['db'][_0xb05d('0x1')];var OpenchannelMessage=require(_0xb05d('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb05d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb05d('0x3')};function emitEvent(_0x514992){return function(_0x181746,_0x5dd35e,_0x46995c){_0x181746['getUsers']({'attributes':['id'],'raw':!![]})[_0xb05d('0x4')](function(_0x3bc6c8){_0x181746[_0xb05d('0x5')](_0xb05d('0x6'),_0x3bc6c8[_0xb05d('0x7')](function(_0x730817){return{'id':_0x730817['id']};}));return OpenchannelMessage[_0xb05d('0x8')]({'where':{'OpenchannelInteractionId':_0x181746['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb05d('0x4')](function(_0x130ce2){_0x181746['setDataValue'](_0xb05d('0x9'),_0x130ce2[_0xb05d('0xa')]);OpenchannelInteractionEvents[_0xb05d('0xb')](_0x514992+':'+_0x181746['id'],_0x181746);OpenchannelInteractionEvents[_0xb05d('0xb')](_0x514992,_0x181746);_0x46995c(null);})[_0xb05d('0xc')](_0x46995c(null));};}for(var e in events){if(events[_0xb05d('0xd')](e)){var event=events[e];OpenchannelInteraction[_0xb05d('0xe')](e,emitEvent(event));}}module[_0xb05d('0xf')]=OpenchannelInteractionEvents;
\ No newline at end of file
index 62a1823..1313b3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe55d=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction'];(function(_0x277352,_0x665a1a){var _0x32065f=function(_0x566b24){while(--_0x566b24){_0x277352['push'](_0x277352['shift']());}};_0x32065f(++_0x665a1a);}(_0xe55d,0x126));var _0xde55=function(_0x208d4b,_0x29ab0d){_0x208d4b=_0x208d4b-0x0;var _0xee9377=_0xe55d[_0x208d4b];return _0xee9377;};'use strict';var _=require(_0xde55('0x0'));var util=require(_0xde55('0x1'));var logger=require('../../config/logger')(_0xde55('0x2'));var moment=require(_0xde55('0x3'));var BPromise=require(_0xde55('0x4'));var rp=require(_0xde55('0x5'));var fs=require('fs');var path=require(_0xde55('0x6'));var rimraf=require(_0xde55('0x7'));var config=require('../../config/environment');var attributes=require(_0xde55('0x8'));module[_0xde55('0x9')]=function(_0x3b2c0a,_0x55d5fa){return _0x3b2c0a[_0xde55('0xa')](_0xde55('0xb'),attributes,{'tableName':_0xde55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde55('0xd'),'collate':_0xde55('0xe'),'hooks':{'beforeUpdate':function(_0x40bad4,_0x51f649,_0x11aa16){if(_0x40bad4[_0xde55('0xf')]('closed')){_0x40bad4['closedAt']=moment()[_0xde55('0x10')](_0xde55('0x11'));}_0x11aa16(null,_0x40bad4);}}});};
\ No newline at end of file
+var _0xe546=['closedAt','format','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed'];(function(_0x1b0047,_0x16b6bb){var _0x1a66cf=function(_0x434984){while(--_0x434984){_0x1b0047['push'](_0x1b0047['shift']());}};_0x1a66cf(++_0x16b6bb);}(_0xe546,0x6e));var _0x6e54=function(_0x45cd8e,_0x420fe5){_0x45cd8e=_0x45cd8e-0x0;var _0x1ebc3f=_0xe546[_0x45cd8e];return _0x1ebc3f;};'use strict';var _=require(_0x6e54('0x0'));var util=require('util');var logger=require(_0x6e54('0x1'))(_0x6e54('0x2'));var moment=require(_0x6e54('0x3'));var BPromise=require(_0x6e54('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e54('0x5'));var rimraf=require(_0x6e54('0x6'));var config=require(_0x6e54('0x7'));var attributes=require(_0x6e54('0x8'));module[_0x6e54('0x9')]=function(_0x5e69be,_0x41f411){return _0x5e69be[_0x6e54('0xa')]('OpenchannelInteraction',attributes,{'tableName':_0x6e54('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e54('0xc'),'collate':_0x6e54('0xd'),'hooks':{'beforeUpdate':function(_0x465d54,_0x1009ed,_0x116243){if(_0x465d54[_0x6e54('0xe')](_0x6e54('0xf'))){_0x465d54[_0x6e54('0x10')]=moment()[_0x6e54('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x116243(null,_0x465d54);}}});};
\ No newline at end of file
index 2f90262..abf9ff6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c75=['register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','socket.io-emitter'];(function(_0x3b6453,_0xcc7a50){var _0x28879f=function(_0xa30ae7){while(--_0xa30ae7){_0x3b6453['push'](_0x3b6453['shift']());}};_0x28879f(++_0xcc7a50);}(_0x1c75,0x98));var _0x51c7=function(_0x4c0155,_0x5b20db){_0x4c0155=_0x4c0155-0x0;var _0x1276db=_0x1c75[_0x4c0155];return _0x1276db;};'use strict';var _=require(_0x51c7('0x0'));var util=require(_0x51c7('0x1'));var moment=require('moment');var BPromise=require(_0x51c7('0x2'));var rs=require(_0x51c7('0x3'));var fs=require('fs');var Redis=require(_0x51c7('0x4'));var db=require(_0x51c7('0x5'))['db'];var utils=require(_0x51c7('0x6'));var logger=require('../../config/logger')(_0x51c7('0x7'));var config=require(_0x51c7('0x8'));var jayson=require(_0x51c7('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x51c7('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x51c7('0xb'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x51c7('0xc')](socket);function respondWithRpcPromise(_0x407996,_0x34994a,_0x3546a6){return new BPromise(function(_0x438da7,_0x324562){return client['request'](_0x407996,_0x3546a6)[_0x51c7('0xd')](function(_0x7c33f6){logger[_0x51c7('0xe')](_0x51c7('0xf'),_0x34994a,_0x51c7('0x10'));logger[_0x51c7('0x11')](_0x51c7('0x12'),_0x34994a,_0x51c7('0x10'),JSON[_0x51c7('0x13')](_0x7c33f6));if(_0x7c33f6[_0x51c7('0x14')]){if(_0x7c33f6['error'][_0x51c7('0x15')]===0x1f4){logger[_0x51c7('0x14')](_0x51c7('0xf'),_0x34994a,_0x7c33f6['error']['message']);return _0x324562(_0x7c33f6[_0x51c7('0x14')][_0x51c7('0x16')]);}logger[_0x51c7('0x14')](_0x51c7('0xf'),_0x34994a,_0x7c33f6[_0x51c7('0x14')][_0x51c7('0x16')]);return _0x438da7(_0x7c33f6['error']['message']);}else{logger[_0x51c7('0xe')](_0x51c7('0xf'),_0x34994a,_0x51c7('0x10'));_0x438da7(_0x7c33f6[_0x51c7('0x17')][_0x51c7('0x16')]);}})[_0x51c7('0x18')](function(_0x1cac25){logger[_0x51c7('0x14')](_0x51c7('0xf'),_0x34994a,_0x1cac25);_0x324562(_0x1cac25);});});}exports[_0x51c7('0x19')]=function(_0x17941c){var _0x447804=this;return new Promise(function(_0x340527,_0x5ee0f2){return db[_0x51c7('0x1a')][_0x51c7('0x1b')](_0x17941c[_0x51c7('0x1c')],{'raw':_0x17941c[_0x51c7('0x1d')]?_0x17941c[_0x51c7('0x1d')][_0x51c7('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17941c[_0x51c7('0x1d')]?_0x17941c[_0x51c7('0x1d')][_0x51c7('0x1f')]||null:null,'attributes':_0x17941c['options']?_0x17941c[_0x51c7('0x1d')][_0x51c7('0x20')]||null:null,'limit':_0x17941c[_0x51c7('0x1d')]?_0x17941c[_0x51c7('0x1d')][_0x51c7('0x21')]||null:null})['then'](function(_0x185b6a){logger[_0x51c7('0xe')]('UpdateOpenchannelInteraction',_0x17941c);logger[_0x51c7('0x11')](_0x51c7('0x19'),_0x17941c,JSON[_0x51c7('0x13')](_0x185b6a));_0x340527(_0x185b6a);})[_0x51c7('0x18')](function(_0x18ebae){logger['error'](_0x51c7('0x19'),_0x18ebae[_0x51c7('0x16')],_0x17941c);_0x5ee0f2(_0x447804[_0x51c7('0x14')](0x1f4,_0x18ebae[_0x51c7('0x16')]));});});};exports[_0x51c7('0x22')]=function(_0x2ea386){return new Promise(function(_0x378469,_0x481461){return db[_0x51c7('0x1a')][_0x51c7('0x23')]({'where':_0x2ea386['options']?_0x2ea386[_0x51c7('0x1d')][_0x51c7('0x1f')]||null:null})[_0x51c7('0xd')](function(_0x3992ba){if(_0x3992ba){return _0x3992ba[_0x51c7('0x24')](_0x2ea386[_0x51c7('0x1c')][_0x51c7('0x25')],_[_0x51c7('0x26')](_0x2ea386[_0x51c7('0x1c')],[_0x51c7('0x25'),'id'])||{});}})[_0x51c7('0x27')](function(_0x4c359e){logger['info'](_0x51c7('0x28'),_0x2ea386);logger[_0x51c7('0x11')]('AddTags',_0x2ea386,JSON['stringify'](_0x4c359e));_0x378469(_0x4c359e);})[_0x51c7('0x18')](function(_0x45ff6f){logger[_0x51c7('0x14')](_0x51c7('0x28'),_0x45ff6f[_0x51c7('0x16')],_0x2ea386);_0x481461(_this[_0x51c7('0x14')](0x1f4,_0x45ff6f[_0x51c7('0x16')]));});});};
\ No newline at end of file
+var _0x6389=['request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','update','options','raw','where','attributes','limit','debug','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','body','ids','spread','info','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s'];(function(_0x3b942a,_0x3e8ead){var _0x2b2a02=function(_0x5a96c2){while(--_0x5a96c2){_0x3b942a['push'](_0x3b942a['shift']());}};_0x2b2a02(++_0x3e8ead);}(_0x6389,0x9c));var _0x9638=function(_0x36f569,_0x419f2e){_0x36f569=_0x36f569-0x0;var _0x2f1ee9=_0x6389[_0x36f569];return _0x2f1ee9;};'use strict';var _=require(_0x9638('0x0'));var util=require(_0x9638('0x1'));var moment=require(_0x9638('0x2'));var BPromise=require('bluebird');var rs=require(_0x9638('0x3'));var fs=require('fs');var Redis=require(_0x9638('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9638('0x5'));var logger=require(_0x9638('0x6'))(_0x9638('0x7'));var config=require(_0x9638('0x8'));var jayson=require(_0x9638('0x9'));var client=jayson[_0x9638('0xa')][_0x9638('0xb')]({'port':0x232a});config['redis']=_[_0x9638('0xc')](config[_0x9638('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x9638('0xe'))(new Redis(config[_0x9638('0xd')]));require(_0x9638('0xf'))[_0x9638('0x10')](socket);function respondWithRpcPromise(_0x4b5985,_0x25e381,_0x39eeb7){return new BPromise(function(_0x44429a,_0x4e9fbc){return client[_0x9638('0x11')](_0x4b5985,_0x39eeb7)[_0x9638('0x12')](function(_0x56e64c){logger['info'](_0x9638('0x13'),_0x25e381,'request\x20sent');logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x25e381,_0x9638('0x14'),JSON[_0x9638('0x15')](_0x56e64c));if(_0x56e64c[_0x9638('0x16')]){if(_0x56e64c[_0x9638('0x16')][_0x9638('0x17')]===0x1f4){logger[_0x9638('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x25e381,_0x56e64c[_0x9638('0x16')][_0x9638('0x18')]);return _0x4e9fbc(_0x56e64c[_0x9638('0x16')][_0x9638('0x18')]);}logger[_0x9638('0x16')](_0x9638('0x13'),_0x25e381,_0x56e64c['error']['message']);return _0x44429a(_0x56e64c[_0x9638('0x16')][_0x9638('0x18')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x25e381,_0x9638('0x14'));_0x44429a(_0x56e64c[_0x9638('0x19')][_0x9638('0x18')]);}})[_0x9638('0x1a')](function(_0x5d295e){logger[_0x9638('0x16')](_0x9638('0x13'),_0x25e381,_0x5d295e);_0x4e9fbc(_0x5d295e);});});}exports[_0x9638('0x1b')]=function(_0x67b104){var _0x24f9d8=this;return new Promise(function(_0x465634,_0x29f8c5){return db['OpenchannelInteraction'][_0x9638('0x1c')](_0x67b104['body'],{'raw':_0x67b104[_0x9638('0x1d')]?_0x67b104['options'][_0x9638('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x67b104['options']?_0x67b104['options'][_0x9638('0x1f')]||null:null,'attributes':_0x67b104[_0x9638('0x1d')]?_0x67b104['options'][_0x9638('0x20')]||null:null,'limit':_0x67b104[_0x9638('0x1d')]?_0x67b104['options'][_0x9638('0x21')]||null:null})[_0x9638('0x12')](function(_0x2c3850){logger['info'](_0x9638('0x1b'),_0x67b104);logger[_0x9638('0x22')]('UpdateOpenchannelInteraction',_0x67b104,JSON[_0x9638('0x15')](_0x2c3850));_0x465634(_0x2c3850);})[_0x9638('0x1a')](function(_0x379e35){logger[_0x9638('0x16')](_0x9638('0x1b'),_0x379e35['message'],_0x67b104);_0x29f8c5(_0x24f9d8[_0x9638('0x16')](0x1f4,_0x379e35['message']));});});};exports[_0x9638('0x23')]=function(_0x50a93c){return new Promise(function(_0x5bf8f7,_0x24015c){return db[_0x9638('0x24')][_0x9638('0x25')]({'where':_0x50a93c[_0x9638('0x1d')]?_0x50a93c[_0x9638('0x1d')][_0x9638('0x1f')]||null:null})[_0x9638('0x12')](function(_0x1dfa17){if(_0x1dfa17){return _0x1dfa17[_0x9638('0x26')](_0x50a93c[_0x9638('0x27')][_0x9638('0x28')],_['omit'](_0x50a93c[_0x9638('0x27')],['ids','id'])||{});}})[_0x9638('0x29')](function(_0x3559af){logger[_0x9638('0x2a')](_0x9638('0x2b'),_0x50a93c);logger[_0x9638('0x22')](_0x9638('0x2b'),_0x50a93c,JSON[_0x9638('0x15')](_0x3559af));_0x5bf8f7(_0x3559af);})[_0x9638('0x1a')](function(_0x3b3f87){logger[_0x9638('0x16')](_0x9638('0x2b'),_0x3b3f87['message'],_0x50a93c);_0x24015c(_this[_0x9638('0x16')](0x1f4,_0x3b3f87[_0x9638('0x18')]));});});};
\ No newline at end of file
index 7d49d51..49a812b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02fb=['length','openchannelInteraction:','./openchannelInteraction.events','remove','emit','removeListener','register'];(function(_0x1e8934,_0x2f41b3){var _0x4bb2c5=function(_0x4e4944){while(--_0x4e4944){_0x1e8934['push'](_0x1e8934['shift']());}};_0x4bb2c5(++_0x2f41b3);}(_0x02fb,0x159));var _0xb02f=function(_0x34e823,_0x517158){_0x34e823=_0x34e823-0x0;var _0x1819b4=_0x02fb[_0x34e823];return _0x1819b4;};'use strict';var OpenchannelInteractionEvents=require(_0xb02f('0x0'));var events=['save',_0xb02f('0x1'),'update'];function createListener(_0x2ef22d,_0x50a057){return function(_0x278e4f){_0x50a057[_0xb02f('0x2')](_0x2ef22d,_0x278e4f);};}function removeListener(_0x5ba26f,_0x337834){return function(){OpenchannelInteractionEvents[_0xb02f('0x3')](_0x5ba26f,_0x337834);};}exports[_0xb02f('0x4')]=function(_0x183f91){for(var _0x3c3e1e=0x0,_0x367647=events[_0xb02f('0x5')];_0x3c3e1e<_0x367647;_0x3c3e1e++){var _0x15e0b9=events[_0x3c3e1e];var _0x305b3e=createListener(_0xb02f('0x6')+_0x15e0b9,_0x183f91);OpenchannelInteractionEvents['on'](_0x15e0b9,_0x305b3e);}};
\ No newline at end of file
+var _0xbaf8=['openchannelInteraction:','./openchannelInteraction.events','save','removeListener'];(function(_0x50faaa,_0x2f840a){var _0x1edd36=function(_0x433d0e){while(--_0x433d0e){_0x50faaa['push'](_0x50faaa['shift']());}};_0x1edd36(++_0x2f840a);}(_0xbaf8,0xbd));var _0x8baf=function(_0x27acbf,_0xe7afec){_0x27acbf=_0x27acbf-0x0;var _0xf93fc8=_0xbaf8[_0x27acbf];return _0xf93fc8;};'use strict';var OpenchannelInteractionEvents=require(_0x8baf('0x0'));var events=[_0x8baf('0x1'),'remove','update'];function createListener(_0xa4e330,_0x331620){return function(_0x325301){_0x331620['emit'](_0xa4e330,_0x325301);};}function removeListener(_0x321956,_0x49187a){return function(){OpenchannelInteractionEvents[_0x8baf('0x2')](_0x321956,_0x49187a);};}exports['register']=function(_0x260822){for(var _0x1085bb=0x0,_0x42387c=events['length'];_0x1085bb<_0x42387c;_0x1085bb++){var _0x28dad3=events[_0x1085bb];var _0x1147fc=createListener(_0x8baf('0x3')+_0x28dad3,_0x260822);OpenchannelInteractionEvents['on'](_0x28dad3,_0x1147fc);}};
\ No newline at end of file
index 7feced5..5086596 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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x241819,_0x156f0d){_0x241819=_0x241819-0x0;var _0x1147e4=_0x70e0[_0x241819];return _0x1147e4;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x5344cd,_0x3d7976){var _0x1d3c5c=function(_0x3cad5e){while(--_0x3cad5e){_0x5344cd['push'](_0x5344cd['shift']());}};_0x1d3c5c(++_0x3d7976);}(_0xedd9,0xfc));var _0x9edd=function(_0x8a29bb,_0x365eb4){_0x8a29bb=_0x8a29bb-0x0;var _0xbaeeb8=_0xedd9[_0x8a29bb];return _0xbaeeb8;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router;
\ No newline at end of file
index e775765..fe0b9c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x915a=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x542d43,_0x40b0e2){var _0x930303=function(_0x11cfce){while(--_0x11cfce){_0x542d43['push'](_0x542d43['shift']());}};_0x930303(++_0x40b0e2);}(_0x915a,0x1d2));var _0xa915=function(_0xa0a958,_0x3d3a50){_0xa0a958=_0xa0a958-0x0;var _0x5ccbc1=_0x915a[_0xa0a958];return _0x5ccbc1;};'use strict';var Sequelize=require(_0xa915('0x0'));module[_0xa915('0x1')]={'body':{'type':Sequelize[_0xa915('0x2')](_0xa915('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa915('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa915('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xa915('0x6')]},'providerName':{'type':Sequelize[_0xa915('0x7')]},'providerResponse':{'type':Sequelize[_0xa915('0x2')]}};
\ No newline at end of file
+var _0x6215=['out','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5621('0x0'));module[_0x5621('0x1')]={'body':{'type':Sequelize[_0x5621('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5621('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5621('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5621('0x4')]('in',_0x5621('0x5')),'defaultValue':_0x5621('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5621('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 6acbef2..16e2ce6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa36=['fields','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','merge','options','includeAll','include','show','params','model','keys','rawAttributes','length','find','create','body','update','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','channel','event','acceptmessage','openchannel','get','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','User','SIP/%s','EventManager','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','name','send','index','OpenchannelMessage','fieldName','type','key','map','query','filters','attributes','intersection'];(function(_0x138fbf,_0x1068fa){var _0x86e835=function(_0x5d2c80){while(--_0x5d2c80){_0x138fbf['push'](_0x138fbf['shift']());}};_0x86e835(++_0x1068fa);}(_0xaa36,0xc7));var _0x6aa3=function(_0x74d219,_0xc27d5a){_0x74d219=_0x74d219-0x0;var _0x38d652=_0xaa36[_0x74d219];return _0x38d652;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6aa3('0x0'));var zipdir=require(_0x6aa3('0x1'));var jsonpatch=require(_0x6aa3('0x2'));var rp=require(_0x6aa3('0x3'));var moment=require(_0x6aa3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6aa3('0x5'));var util=require('util');var path=require(_0x6aa3('0x6'));var sox=require('sox');var csv=require(_0x6aa3('0x7'));var ejs=require(_0x6aa3('0x8'));var fs=require('fs');var fs_extra=require(_0x6aa3('0x9'));var _=require('lodash');var squel=require(_0x6aa3('0xa'));var crypto=require('crypto');var jsforce=require(_0x6aa3('0xb'));var deskjs=require(_0x6aa3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6aa3('0xd'));var Papa=require(_0x6aa3('0xe'));var Redis=require(_0x6aa3('0xf'));var authService=require(_0x6aa3('0x10'));var qs=require(_0x6aa3('0x11'));var as=require(_0x6aa3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6aa3('0x13'))(_0x6aa3('0x14'));var utils=require(_0x6aa3('0x15'));var config=require(_0x6aa3('0x16'));var licenseUtil=require(_0x6aa3('0x17'));var db=require(_0x6aa3('0x18'))['db'];config[_0x6aa3('0x19')]=_['defaults'](config[_0x6aa3('0x19')],{'host':_0x6aa3('0x1a'),'port':0x18eb});var socket=require(_0x6aa3('0x1b'))(new Redis(config['redis']));require(_0x6aa3('0x1c'))[_0x6aa3('0x1d')](socket);var jayson=require(_0x6aa3('0x1e'));var client=jayson[_0x6aa3('0x1f')][_0x6aa3('0x20')]({'port':0x232c});var client9002=jayson[_0x6aa3('0x1f')][_0x6aa3('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2a751f,_0x1aa501,_0x43f59e,_0x2371a0){return new BPromise(function(_0x28a5e2,_0x5abf34){var _0x428804=_0x2371a0||client;return _0x428804['request'](_0x2a751f,_0x43f59e)[_0x6aa3('0x21')](function(_0x4143db){logger[_0x6aa3('0x22')](_0x6aa3('0x23'),_0x1aa501,_0x6aa3('0x24'));logger[_0x6aa3('0x25')](_0x6aa3('0x26'),_0x1aa501,'request\x20sent',JSON['stringify'](_0x4143db));if(_0x4143db[_0x6aa3('0x27')]){if(_0x4143db[_0x6aa3('0x27')][_0x6aa3('0x28')]===0x1f4){logger[_0x6aa3('0x27')](_0x6aa3('0x23'),_0x1aa501,_0x4143db[_0x6aa3('0x27')][_0x6aa3('0x29')]);return _0x5abf34(_0x4143db['error'][_0x6aa3('0x29')]);}logger['error'](_0x6aa3('0x23'),_0x1aa501,_0x4143db[_0x6aa3('0x27')][_0x6aa3('0x29')]);return _0x28a5e2(_0x4143db[_0x6aa3('0x27')]['message']);}else{logger[_0x6aa3('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x1aa501,_0x6aa3('0x24'));_0x28a5e2(_0x4143db[_0x6aa3('0x2a')][_0x6aa3('0x29')]);}})[_0x6aa3('0x2b')](function(_0x32df95){logger[_0x6aa3('0x27')](_0x6aa3('0x23'),_0x1aa501,_0x32df95);_0x5abf34(_0x32df95);});});}function respondWithStatusCode(_0x28fd91,_0x84333a){_0x84333a=_0x84333a||0xcc;return function(_0x271f5f){if(_0x271f5f){return _0x28fd91[_0x6aa3('0x2c')](_0x84333a);}return _0x28fd91[_0x6aa3('0x2d')](_0x84333a)['end']();};}function respondWithResult(_0x41e5e2,_0x21d7a7){_0x21d7a7=_0x21d7a7||0xc8;return function(_0x5f5d74){if(_0x5f5d74){return _0x41e5e2[_0x6aa3('0x2d')](_0x21d7a7)['json'](_0x5f5d74);}};}function respondWithFilteredResult(_0x1d175a,_0x548f31){return function(_0x2b13ea){if(_0x2b13ea){var _0x251820=typeof _0x548f31[_0x6aa3('0x2e')]===_0x6aa3('0x2f')&&typeof _0x548f31[_0x6aa3('0x30')]===_0x6aa3('0x2f');var _0x3bd9e1=_0x2b13ea[_0x6aa3('0x31')];var _0x2cefd0=_0x251820?0x0:_0x548f31[_0x6aa3('0x2e')];var _0xa105d5=_0x251820?_0x2b13ea['count']:_0x548f31[_0x6aa3('0x2e')]+_0x548f31[_0x6aa3('0x30')];var _0x5680e8;if(_0xa105d5>=_0x3bd9e1){_0xa105d5=_0x3bd9e1;_0x5680e8=0xc8;}else{_0x5680e8=0xce;}_0x1d175a['status'](_0x5680e8);return _0x1d175a[_0x6aa3('0x32')](_0x6aa3('0x33'),_0x2cefd0+'-'+_0xa105d5+'/'+_0x3bd9e1)[_0x6aa3('0x34')](_0x2b13ea);}return null;};}function patchUpdates(_0x2e9f07){return function(_0x4ae382){try{jsonpatch[_0x6aa3('0x35')](_0x4ae382,_0x2e9f07,!![]);}catch(_0x4755d9){return BPromise[_0x6aa3('0x36')](_0x4755d9);}return _0x4ae382[_0x6aa3('0x37')]();};}function saveUpdates(_0x2c9d15,_0x488191){return function(_0x3b26af){if(_0x3b26af){return _0x3b26af['update'](_0x2c9d15)['then'](function(_0x3a8b8e){return _0x3a8b8e;});}return null;};}function removeEntity(_0x33c3c9,_0x38213c){return function(_0x2a0761){if(_0x2a0761){return _0x2a0761[_0x6aa3('0x38')]()[_0x6aa3('0x21')](function(){_0x33c3c9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12fe90,_0x24742f){return function(_0x246a52){if(!_0x246a52){_0x12fe90['sendStatus'](0x194);}return _0x246a52;};}function handleError(_0x14568e,_0x179856){_0x179856=_0x179856||0x1f4;return function(_0x3f141e){logger['error'](_0x3f141e['stack']);if(_0x3f141e['name']){delete _0x3f141e[_0x6aa3('0x39')];}_0x14568e[_0x6aa3('0x2d')](_0x179856)[_0x6aa3('0x3a')](_0x3f141e);};}exports[_0x6aa3('0x3b')]=function(_0x452e0e,_0x5bb500){var _0x7f9c04={},_0x8ccf23={},_0x69c908={'count':0x0,'rows':[]};var _0xd48012=_['map'](db[_0x6aa3('0x3c')]['rawAttributes'],function(_0x3b4e14){return{'name':_0x3b4e14[_0x6aa3('0x3d')],'type':_0x3b4e14[_0x6aa3('0x3e')][_0x6aa3('0x3f')]};});_0x8ccf23['model']=_[_0x6aa3('0x40')](_0xd48012,_0x6aa3('0x39'));_0x8ccf23[_0x6aa3('0x41')]=_['keys'](_0x452e0e[_0x6aa3('0x41')]);_0x8ccf23[_0x6aa3('0x42')]=_['intersection'](_0x8ccf23['model'],_0x8ccf23['query']);_0x7f9c04[_0x6aa3('0x43')]=_[_0x6aa3('0x44')](_0x8ccf23['model'],qs['fields'](_0x452e0e[_0x6aa3('0x41')][_0x6aa3('0x45')]));_0x7f9c04[_0x6aa3('0x43')]=_0x7f9c04[_0x6aa3('0x43')]['length']?_0x7f9c04[_0x6aa3('0x43')]:_0x8ccf23['model'];if(!_0x452e0e['query'][_0x6aa3('0x46')](_0x6aa3('0x47'))){_0x7f9c04[_0x6aa3('0x30')]=qs[_0x6aa3('0x30')](_0x452e0e[_0x6aa3('0x41')][_0x6aa3('0x30')]);_0x7f9c04[_0x6aa3('0x2e')]=qs[_0x6aa3('0x2e')](_0x452e0e[_0x6aa3('0x41')][_0x6aa3('0x2e')]);}_0x7f9c04['order']=qs['sort'](_0x452e0e['query'][_0x6aa3('0x48')]);_0x7f9c04['where']=qs[_0x6aa3('0x42')](_[_0x6aa3('0x49')](_0x452e0e[_0x6aa3('0x41')],_0x8ccf23[_0x6aa3('0x42')]),_0xd48012);if(_0x452e0e[_0x6aa3('0x41')]['filter']){_0x7f9c04[_0x6aa3('0x4a')]=_['merge'](_0x7f9c04[_0x6aa3('0x4a')],{'$or':_[_0x6aa3('0x40')](_0xd48012,function(_0x2cb09c){if(_0x2cb09c[_0x6aa3('0x3e')]!==_0x6aa3('0x4b')){var _0x27e11={};_0x27e11[_0x2cb09c[_0x6aa3('0x39')]]={'$like':'%'+_0x452e0e[_0x6aa3('0x41')]['filter']+'%'};return _0x27e11;}})});}_0x7f9c04=_[_0x6aa3('0x4c')]({},_0x7f9c04,_0x452e0e[_0x6aa3('0x4d')]);var _0x17343f={'where':_0x7f9c04['where']};return db[_0x6aa3('0x3c')][_0x6aa3('0x31')](_0x17343f)[_0x6aa3('0x21')](function(_0x2d868d){_0x69c908[_0x6aa3('0x31')]=_0x2d868d;if(_0x452e0e[_0x6aa3('0x41')][_0x6aa3('0x4e')]){_0x7f9c04[_0x6aa3('0x4f')]=[{'all':!![]}];}return db[_0x6aa3('0x3c')]['findAll'](_0x7f9c04);})[_0x6aa3('0x21')](function(_0x4d52bb){_0x69c908['rows']=_0x4d52bb;return _0x69c908;})[_0x6aa3('0x21')](respondWithFilteredResult(_0x5bb500,_0x7f9c04))['catch'](handleError(_0x5bb500,null));};exports[_0x6aa3('0x50')]=function(_0x42da87,_0x21f785){var _0xc1c6d9={'raw':!![],'where':{'id':_0x42da87[_0x6aa3('0x51')]['id']}},_0x466a06={};_0x466a06[_0x6aa3('0x52')]=_[_0x6aa3('0x53')](db[_0x6aa3('0x3c')][_0x6aa3('0x54')]);_0x466a06['query']=_[_0x6aa3('0x53')](_0x42da87['query']);_0x466a06[_0x6aa3('0x42')]=_[_0x6aa3('0x44')](_0x466a06[_0x6aa3('0x52')],_0x466a06['query']);_0xc1c6d9['attributes']=_[_0x6aa3('0x44')](_0x466a06[_0x6aa3('0x52')],qs['fields'](_0x42da87['query'][_0x6aa3('0x45')]));_0xc1c6d9[_0x6aa3('0x43')]=_0xc1c6d9[_0x6aa3('0x43')][_0x6aa3('0x55')]?_0xc1c6d9[_0x6aa3('0x43')]:_0x466a06[_0x6aa3('0x52')];if(_0x42da87[_0x6aa3('0x41')][_0x6aa3('0x4e')]){_0xc1c6d9['include']=[{'all':!![]}];}_0xc1c6d9=_[_0x6aa3('0x4c')]({},_0xc1c6d9,_0x42da87[_0x6aa3('0x4d')]);return db['OpenchannelMessage'][_0x6aa3('0x56')](_0xc1c6d9)['then'](handleEntityNotFound(_0x21f785,null))[_0x6aa3('0x21')](respondWithResult(_0x21f785,null))[_0x6aa3('0x2b')](handleError(_0x21f785,null));};exports[_0x6aa3('0x57')]=function(_0x1542c5,_0x118473){return db[_0x6aa3('0x3c')]['create'](_0x1542c5[_0x6aa3('0x58')],{})[_0x6aa3('0x21')](respondWithResult(_0x118473,0xc9))[_0x6aa3('0x2b')](handleError(_0x118473,null));};exports[_0x6aa3('0x59')]=function(_0x6eada9,_0x22aa71){if(_0x6eada9[_0x6aa3('0x58')]['id']){delete _0x6eada9[_0x6aa3('0x58')]['id'];}return db[_0x6aa3('0x3c')][_0x6aa3('0x56')]({'where':{'id':_0x6eada9['params']['id']}})[_0x6aa3('0x21')](handleEntityNotFound(_0x22aa71,null))['then'](saveUpdates(_0x6eada9[_0x6aa3('0x58')],null))[_0x6aa3('0x21')](respondWithResult(_0x22aa71,null))[_0x6aa3('0x2b')](handleError(_0x22aa71,null));};exports[_0x6aa3('0x38')]=function(_0x2afbea,_0x1ec751){return db['OpenchannelMessage'][_0x6aa3('0x56')]({'where':{'id':_0x2afbea[_0x6aa3('0x51')]['id']}})[_0x6aa3('0x21')](handleEntityNotFound(_0x1ec751,null))['then'](removeEntity(_0x1ec751,null))['catch'](handleError(_0x1ec751,null));};exports['describe']=function(_0x398059,_0x1d9dbe){return db[_0x6aa3('0x3c')][_0x6aa3('0x5a')]()[_0x6aa3('0x21')](respondWithResult(_0x1d9dbe,null))[_0x6aa3('0x2b')](handleError(_0x1d9dbe,null));};var interaction_log=require(_0x6aa3('0x13'))(_0x6aa3('0x5b'));exports[_0x6aa3('0x5c')]=function(_0x412bac,_0x30c3f8,_0xd2761f){var _0xecd64e={'agent':{},'channel':'openchannel'};if(_0x412bac[_0x6aa3('0x58')]['id']){delete _0x412bac[_0x6aa3('0x58')]['id'];}_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x5d')]=!![];_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x5e')]=moment()[_0x6aa3('0x5f')](_0x6aa3('0x60'));_0x412bac['body'][_0x6aa3('0x61')]=_0x412bac['body']['UserId']||_0x412bac['user']['id'];_0xecd64e[_0x6aa3('0x62')]['id']=_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x61')];return db['OpenchannelMessage'][_0x6aa3('0x56')]({'where':{'id':_0x412bac['params']['id'],'UserId':null}})[_0x6aa3('0x21')](handleEntityNotFound(_0x30c3f8,null))['then'](saveUpdates(_0x412bac[_0x6aa3('0x58')],null))[_0x6aa3('0x21')](function(_0x5cdecc){if(_0x5cdecc){_0xecd64e[_0x6aa3('0x29')]=_0x5cdecc['get']({'plain':!![]});return db[_0x6aa3('0x63')][_0x6aa3('0x56')]({'where':{'id':_0x5cdecc['OpenchannelInteractionId']}});}return null;})[_0x6aa3('0x21')](handleEntityNotFound(_0x30c3f8,null))['then'](function(_0x365b65){if(_0x365b65){return _0x365b65[_0x6aa3('0x59')]({'UserId':_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x61')],'read1stAt':_[_0x6aa3('0x64')](_0x365b65[_0x6aa3('0x65')])?moment()[_0x6aa3('0x5f')](_0x6aa3('0x60')):undefined});}return null;})[_0x6aa3('0x21')](function(_0x537a96){if(_0x537a96){_0xecd64e[_0x6aa3('0x66')]=_0x537a96['get']({'plain':!![]});interaction_log['info'](_0x6aa3('0x67'),_0x412bac[_0x6aa3('0x68')]['id'],_0x412bac[_0x6aa3('0x68')][_0x6aa3('0x39')],_0x412bac[_0x6aa3('0x68')][_0x6aa3('0x69')],_0xecd64e['interaction']['id'],_0x412bac[_0x6aa3('0x58')]?JSON['stringify'](_0x412bac[_0x6aa3('0x58')]):_0x6aa3('0x6a'));return respondWithRpcPromise(_0x6aa3('0x6b'),_0x6aa3('0x6c'),_0xecd64e);}return null;})['then'](function(_0x3d1824){var _0x194c20=_0x6aa3('0x6d')+_0x3d1824[_0x6aa3('0x29')][_0x6aa3('0x6e')];return db[_0x6aa3('0x6f')][_0x6aa3('0x41')](_0x194c20,{'type':db['Sequelize'][_0x6aa3('0x70')][_0x6aa3('0x71')],'raw':!![]})['then'](function(_0x5ee411){return _0x5ee411;});})[_0x6aa3('0x21')](function(_0x2062e5){if(_0x2062e5){_0xecd64e[_0x6aa3('0x29')][_0x6aa3('0x72')]=_0x2062e5[0x0];if(!_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x61')])return;return db['User'][_0x6aa3('0x56')]({'where':{'id':_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x61')],'role':_0x6aa3('0x62')},'attributes':['id','name',_0x6aa3('0x73'),_0x6aa3('0x74'),_0x6aa3('0x75')],'raw':!![]});}return null;})['then'](function(_0x2708db){if(!_0x2708db)return null;_0xecd64e['message'][_0x6aa3('0x62')]=_0x2708db;return _0xecd64e;})[_0x6aa3('0x21')](function(_0x4f1857){if(_0x4f1857){if(_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x76')]){_0xecd64e['message'][_0x6aa3('0x77')]=util[_0x6aa3('0x5f')]('SIP/%s',_0x412bac[_0x6aa3('0x68')][_0x6aa3('0x39')]);_0xecd64e[_0x6aa3('0x29')][_0x6aa3('0x78')]=_0xecd64e[_0x6aa3('0x78')];_0xecd64e['message']['motionChannel']=_0xecd64e[_0x6aa3('0x78')];_0xecd64e[_0x6aa3('0x29')][_0x6aa3('0x79')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x6aa3('0x7a'),'message':_0xecd64e[_0x6aa3('0x29')]},client9002)['then'](function(){return _0xecd64e;});}return _0xecd64e;}return null;})[_0x6aa3('0x21')](respondWithResult(_0x30c3f8,null))[_0x6aa3('0x2b')](handleError(_0x30c3f8,null));};var interaction_log=require(_0x6aa3('0x13'))('openchannel-interactions');exports['reject']=function(_0x7a4893,_0x4022fb,_0x52125c){var _0x1336e2={'agent':{},'channel':_0x6aa3('0x7b')};if(_0x7a4893[_0x6aa3('0x58')]['id']){delete _0x7a4893['body']['id'];}_0x7a4893[_0x6aa3('0x58')][_0x6aa3('0x61')]=_0x7a4893['body'][_0x6aa3('0x61')]||_0x7a4893[_0x6aa3('0x68')]['id'];_0x1336e2[_0x6aa3('0x62')]['id']=_0x7a4893[_0x6aa3('0x58')][_0x6aa3('0x61')];return db[_0x6aa3('0x3c')][_0x6aa3('0x56')]({'where':{'id':_0x7a4893[_0x6aa3('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4022fb,null))['then'](function(_0x5b693b){if(_0x5b693b){_0x1336e2['message']=_0x5b693b[_0x6aa3('0x7c')]({'plain':!![]});return db[_0x6aa3('0x63')][_0x6aa3('0x56')]({'where':{'id':_0x5b693b[_0x6aa3('0x7d')]}});}return null;})[_0x6aa3('0x21')](handleEntityNotFound(_0x4022fb,null))[_0x6aa3('0x21')](function(_0x124aaf){if(_0x124aaf){_0x1336e2['interaction']=_0x124aaf[_0x6aa3('0x7c')]({'plain':!![]});interaction_log[_0x6aa3('0x22')](_0x6aa3('0x7e'),_0x7a4893[_0x6aa3('0x68')]['id'],_0x7a4893[_0x6aa3('0x68')][_0x6aa3('0x39')],_0x7a4893[_0x6aa3('0x68')][_0x6aa3('0x69')],_0x1336e2[_0x6aa3('0x66')]['id'],_0x7a4893['body']?JSON['stringify'](_0x7a4893[_0x6aa3('0x58')]):_0x6aa3('0x6a'));return respondWithRpcPromise(_0x6aa3('0x7f'),_0x6aa3('0x80'),_0x1336e2);}return null;})[_0x6aa3('0x21')](function(_0x1e4997){var _0x2ef1cf=_0x6aa3('0x6d')+_0x1e4997[_0x6aa3('0x29')]['ContactId'];return db[_0x6aa3('0x6f')]['query'](_0x2ef1cf,{'type':db[_0x6aa3('0x81')][_0x6aa3('0x70')][_0x6aa3('0x71')],'raw':!![]})[_0x6aa3('0x21')](function(_0x5521a3){return _0x5521a3;});})[_0x6aa3('0x21')](function(_0x46daea){if(_0x46daea){_0x1336e2[_0x6aa3('0x29')][_0x6aa3('0x72')]=_0x46daea[0x0];if(!_0x7a4893[_0x6aa3('0x58')][_0x6aa3('0x61')])return;return db[_0x6aa3('0x82')][_0x6aa3('0x56')]({'where':{'id':_0x7a4893[_0x6aa3('0x58')][_0x6aa3('0x61')],'role':_0x6aa3('0x62')},'attributes':['id','name',_0x6aa3('0x73'),_0x6aa3('0x74'),_0x6aa3('0x75')],'raw':!![]});}return null;})[_0x6aa3('0x21')](function(_0x5da712){if(!_0x5da712)return null;_0x1336e2['message'][_0x6aa3('0x62')]=_0x5da712;return _0x1336e2;})[_0x6aa3('0x21')](function(_0x94625d){if(_0x94625d){_0x94625d[_0x6aa3('0x29')][_0x6aa3('0x77')]=util[_0x6aa3('0x5f')](_0x6aa3('0x83'),_0x7a4893[_0x6aa3('0x68')][_0x6aa3('0x39')]);_0x94625d[_0x6aa3('0x29')][_0x6aa3('0x78')]=_0x1336e2['channel'];_0x94625d['message']['motionChannel']=_0x1336e2[_0x6aa3('0x78')];_0x94625d['message'][_0x6aa3('0x79')]=_0x6aa3('0x36');respondWithRpcPromise(_0x6aa3('0x84'),_0x6aa3('0x84'),{'event':_0x6aa3('0x85'),'message':_0x94625d[_0x6aa3('0x29')]},client9002);return _0x1336e2;}return null;})[_0x6aa3('0x21')](respondWithResult(_0x4022fb,null))[_0x6aa3('0x2b')](handleError(_0x4022fb,null));};
\ No newline at end of file
+var _0x1b64=['to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','debug','request\x20sent','stringify','error','code','message','OpenchannelMessage,\x20%s,\x20%s','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','params','include','options','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','rejectmessage','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js'];(function(_0x560def,_0x3aff6d){var _0x415f9d=function(_0xd0f651){while(--_0xd0f651){_0x560def['push'](_0x560def['shift']());}};_0x415f9d(++_0x3aff6d);}(_0x1b64,0x76));var _0x41b6=function(_0x1a9e20,_0x45eed7){_0x1a9e20=_0x1a9e20-0x0;var _0x1c41fc=_0x1b64[_0x1a9e20];return _0x1c41fc;};'use strict';var emlformat=require(_0x41b6('0x0'));var rimraf=require(_0x41b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x41b6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x41b6('0x3'));var util=require(_0x41b6('0x4'));var path=require(_0x41b6('0x5'));var sox=require(_0x41b6('0x6'));var csv=require('to-csv');var ejs=require(_0x41b6('0x7'));var fs=require('fs');var fs_extra=require(_0x41b6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x41b6('0x9'));var deskjs=require(_0x41b6('0xa'));var toCsv=require(_0x41b6('0xb'));var querystring=require(_0x41b6('0xc'));var Papa=require(_0x41b6('0xd'));var Redis=require(_0x41b6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x41b6('0xf'));var as=require(_0x41b6('0x10'));var hardwareService=require(_0x41b6('0x11'));var logger=require(_0x41b6('0x12'))(_0x41b6('0x13'));var utils=require(_0x41b6('0x14'));var config=require(_0x41b6('0x15'));var licenseUtil=require(_0x41b6('0x16'));var db=require(_0x41b6('0x17'))['db'];config[_0x41b6('0x18')]=_[_0x41b6('0x19')](config[_0x41b6('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x41b6('0x1a'))(new Redis(config[_0x41b6('0x18')]));require(_0x41b6('0x1b'))[_0x41b6('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x41b6('0x1d')][_0x41b6('0x1e')]({'port':0x232c});var client9002=jayson[_0x41b6('0x1d')][_0x41b6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1d4441,_0x1bd0b0,_0x30f076,_0x4805de){return new BPromise(function(_0x13ce57,_0xf0d6ae){var _0x1b2500=_0x4805de||client;return _0x1b2500[_0x41b6('0x1f')](_0x1d4441,_0x30f076)[_0x41b6('0x20')](function(_0x47feb9){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x1bd0b0,'request\x20sent');logger[_0x41b6('0x21')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x1bd0b0,_0x41b6('0x22'),JSON[_0x41b6('0x23')](_0x47feb9));if(_0x47feb9[_0x41b6('0x24')]){if(_0x47feb9[_0x41b6('0x24')][_0x41b6('0x25')]===0x1f4){logger[_0x41b6('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x1bd0b0,_0x47feb9['error'][_0x41b6('0x26')]);return _0xf0d6ae(_0x47feb9['error'][_0x41b6('0x26')]);}logger[_0x41b6('0x24')](_0x41b6('0x27'),_0x1bd0b0,_0x47feb9[_0x41b6('0x24')][_0x41b6('0x26')]);return _0x13ce57(_0x47feb9[_0x41b6('0x24')][_0x41b6('0x26')]);}else{logger[_0x41b6('0x28')](_0x41b6('0x27'),_0x1bd0b0,_0x41b6('0x22'));_0x13ce57(_0x47feb9[_0x41b6('0x29')]['message']);}})[_0x41b6('0x2a')](function(_0x2c1290){logger['error'](_0x41b6('0x27'),_0x1bd0b0,_0x2c1290);_0xf0d6ae(_0x2c1290);});});}function respondWithStatusCode(_0x358872,_0x4f98de){_0x4f98de=_0x4f98de||0xcc;return function(_0x22d399){if(_0x22d399){return _0x358872[_0x41b6('0x2b')](_0x4f98de);}return _0x358872[_0x41b6('0x2c')](_0x4f98de)['end']();};}function respondWithResult(_0x40a466,_0x5e431d){_0x5e431d=_0x5e431d||0xc8;return function(_0x49142b){if(_0x49142b){return _0x40a466['status'](_0x5e431d)[_0x41b6('0x2d')](_0x49142b);}};}function respondWithFilteredResult(_0x425c16,_0x5b5ca7){return function(_0x2dee1f){if(_0x2dee1f){var _0x45f9e2=typeof _0x5b5ca7[_0x41b6('0x2e')]===_0x41b6('0x2f')&&typeof _0x5b5ca7[_0x41b6('0x30')]==='undefined';var _0x5a0554=_0x2dee1f[_0x41b6('0x31')];var _0x37bd7a=_0x45f9e2?0x0:_0x5b5ca7[_0x41b6('0x2e')];var _0x56b365=_0x45f9e2?_0x2dee1f[_0x41b6('0x31')]:_0x5b5ca7[_0x41b6('0x2e')]+_0x5b5ca7['limit'];var _0x27a737;if(_0x56b365>=_0x5a0554){_0x56b365=_0x5a0554;_0x27a737=0xc8;}else{_0x27a737=0xce;}_0x425c16[_0x41b6('0x2c')](_0x27a737);return _0x425c16[_0x41b6('0x32')](_0x41b6('0x33'),_0x37bd7a+'-'+_0x56b365+'/'+_0x5a0554)[_0x41b6('0x2d')](_0x2dee1f);}return null;};}function patchUpdates(_0x2ac3a7){return function(_0x1c47b1){try{jsonpatch['apply'](_0x1c47b1,_0x2ac3a7,!![]);}catch(_0x13562f){return BPromise['reject'](_0x13562f);}return _0x1c47b1['save']();};}function saveUpdates(_0x2235fd,_0x4cf4d5){return function(_0x207412){if(_0x207412){return _0x207412[_0x41b6('0x34')](_0x2235fd)[_0x41b6('0x20')](function(_0x435639){return _0x435639;});}return null;};}function removeEntity(_0xc97805,_0x3c5141){return function(_0x420e40){if(_0x420e40){return _0x420e40[_0x41b6('0x35')]()['then'](function(){_0xc97805[_0x41b6('0x2c')](0xcc)[_0x41b6('0x36')]();});}};}function handleEntityNotFound(_0x326e10,_0x459186){return function(_0x13f0ad){if(!_0x13f0ad){_0x326e10[_0x41b6('0x2b')](0x194);}return _0x13f0ad;};}function handleError(_0x462340,_0x58112e){_0x58112e=_0x58112e||0x1f4;return function(_0x69277a){logger['error'](_0x69277a['stack']);if(_0x69277a[_0x41b6('0x37')]){delete _0x69277a[_0x41b6('0x37')];}_0x462340[_0x41b6('0x2c')](_0x58112e)[_0x41b6('0x38')](_0x69277a);};}exports[_0x41b6('0x39')]=function(_0x2291ba,_0x5b7e9d){var _0x19a73e={},_0x4313a5={},_0x2c3f43={'count':0x0,'rows':[]};var _0x442ec7=_[_0x41b6('0x3a')](db[_0x41b6('0x3b')][_0x41b6('0x3c')],function(_0x565ff8){return{'name':_0x565ff8[_0x41b6('0x3d')],'type':_0x565ff8[_0x41b6('0x3e')][_0x41b6('0x3f')]};});_0x4313a5[_0x41b6('0x40')]=_[_0x41b6('0x3a')](_0x442ec7,_0x41b6('0x37'));_0x4313a5[_0x41b6('0x41')]=_[_0x41b6('0x42')](_0x2291ba[_0x41b6('0x41')]);_0x4313a5[_0x41b6('0x43')]=_[_0x41b6('0x44')](_0x4313a5[_0x41b6('0x40')],_0x4313a5['query']);_0x19a73e[_0x41b6('0x45')]=_[_0x41b6('0x44')](_0x4313a5[_0x41b6('0x40')],qs[_0x41b6('0x46')](_0x2291ba[_0x41b6('0x41')][_0x41b6('0x46')]));_0x19a73e['attributes']=_0x19a73e['attributes'][_0x41b6('0x47')]?_0x19a73e[_0x41b6('0x45')]:_0x4313a5['model'];if(!_0x2291ba['query'][_0x41b6('0x48')](_0x41b6('0x49'))){_0x19a73e[_0x41b6('0x30')]=qs['limit'](_0x2291ba['query'][_0x41b6('0x30')]);_0x19a73e['offset']=qs[_0x41b6('0x2e')](_0x2291ba[_0x41b6('0x41')][_0x41b6('0x2e')]);}_0x19a73e[_0x41b6('0x4a')]=qs[_0x41b6('0x4b')](_0x2291ba['query'][_0x41b6('0x4b')]);_0x19a73e[_0x41b6('0x4c')]=qs[_0x41b6('0x43')](_[_0x41b6('0x4d')](_0x2291ba['query'],_0x4313a5[_0x41b6('0x43')]),_0x442ec7);if(_0x2291ba[_0x41b6('0x41')][_0x41b6('0x4e')]){_0x19a73e[_0x41b6('0x4c')]=_[_0x41b6('0x4f')](_0x19a73e[_0x41b6('0x4c')],{'$or':_[_0x41b6('0x3a')](_0x442ec7,function(_0x575e7f){if(_0x575e7f[_0x41b6('0x3e')]!=='VIRTUAL'){var _0x2e2764={};_0x2e2764[_0x575e7f[_0x41b6('0x37')]]={'$like':'%'+_0x2291ba['query'][_0x41b6('0x4e')]+'%'};return _0x2e2764;}})});}_0x19a73e=_[_0x41b6('0x4f')]({},_0x19a73e,_0x2291ba['options']);var _0x11c8b5={'where':_0x19a73e[_0x41b6('0x4c')]};return db[_0x41b6('0x3b')][_0x41b6('0x31')](_0x11c8b5)[_0x41b6('0x20')](function(_0x5ac0b2){_0x2c3f43[_0x41b6('0x31')]=_0x5ac0b2;if(_0x2291ba[_0x41b6('0x41')][_0x41b6('0x50')]){_0x19a73e['include']=[{'all':!![]}];}return db[_0x41b6('0x3b')][_0x41b6('0x51')](_0x19a73e);})[_0x41b6('0x20')](function(_0xdc4286){_0x2c3f43[_0x41b6('0x52')]=_0xdc4286;return _0x2c3f43;})[_0x41b6('0x20')](respondWithFilteredResult(_0x5b7e9d,_0x19a73e))[_0x41b6('0x2a')](handleError(_0x5b7e9d,null));};exports['show']=function(_0x565d5d,_0x2384bb){var _0x4eca3a={'raw':!![],'where':{'id':_0x565d5d[_0x41b6('0x53')]['id']}},_0x489186={};_0x489186[_0x41b6('0x40')]=_[_0x41b6('0x42')](db[_0x41b6('0x3b')][_0x41b6('0x3c')]);_0x489186[_0x41b6('0x41')]=_['keys'](_0x565d5d[_0x41b6('0x41')]);_0x489186['filters']=_[_0x41b6('0x44')](_0x489186['model'],_0x489186[_0x41b6('0x41')]);_0x4eca3a[_0x41b6('0x45')]=_['intersection'](_0x489186[_0x41b6('0x40')],qs[_0x41b6('0x46')](_0x565d5d[_0x41b6('0x41')][_0x41b6('0x46')]));_0x4eca3a[_0x41b6('0x45')]=_0x4eca3a[_0x41b6('0x45')][_0x41b6('0x47')]?_0x4eca3a[_0x41b6('0x45')]:_0x489186[_0x41b6('0x40')];if(_0x565d5d[_0x41b6('0x41')][_0x41b6('0x50')]){_0x4eca3a[_0x41b6('0x54')]=[{'all':!![]}];}_0x4eca3a=_[_0x41b6('0x4f')]({},_0x4eca3a,_0x565d5d[_0x41b6('0x55')]);return db[_0x41b6('0x3b')][_0x41b6('0x56')](_0x4eca3a)['then'](handleEntityNotFound(_0x2384bb,null))['then'](respondWithResult(_0x2384bb,null))['catch'](handleError(_0x2384bb,null));};exports[_0x41b6('0x57')]=function(_0x208dd9,_0x1d5dad){return db[_0x41b6('0x3b')][_0x41b6('0x57')](_0x208dd9[_0x41b6('0x58')],{})[_0x41b6('0x20')](respondWithResult(_0x1d5dad,0xc9))[_0x41b6('0x2a')](handleError(_0x1d5dad,null));};exports[_0x41b6('0x34')]=function(_0x1b69e3,_0x4f918c){if(_0x1b69e3['body']['id']){delete _0x1b69e3[_0x41b6('0x58')]['id'];}return db[_0x41b6('0x3b')][_0x41b6('0x56')]({'where':{'id':_0x1b69e3[_0x41b6('0x53')]['id']}})[_0x41b6('0x20')](handleEntityNotFound(_0x4f918c,null))[_0x41b6('0x20')](saveUpdates(_0x1b69e3[_0x41b6('0x58')],null))[_0x41b6('0x20')](respondWithResult(_0x4f918c,null))[_0x41b6('0x2a')](handleError(_0x4f918c,null));};exports[_0x41b6('0x35')]=function(_0x2a5185,_0xea54ab){return db['OpenchannelMessage'][_0x41b6('0x56')]({'where':{'id':_0x2a5185[_0x41b6('0x53')]['id']}})[_0x41b6('0x20')](handleEntityNotFound(_0xea54ab,null))[_0x41b6('0x20')](removeEntity(_0xea54ab,null))['catch'](handleError(_0xea54ab,null));};exports['describe']=function(_0x1e8ddb,_0x575806){return db['OpenchannelMessage'][_0x41b6('0x59')]()[_0x41b6('0x20')](respondWithResult(_0x575806,null))[_0x41b6('0x2a')](handleError(_0x575806,null));};var interaction_log=require(_0x41b6('0x12'))(_0x41b6('0x5a'));exports[_0x41b6('0x5b')]=function(_0x5f033b,_0x2a00b7,_0x3b6854){var _0x4f52fe={'agent':{},'channel':_0x41b6('0x5c')};if(_0x5f033b[_0x41b6('0x58')]['id']){delete _0x5f033b['body']['id'];}_0x5f033b[_0x41b6('0x58')][_0x41b6('0x5d')]=!![];_0x5f033b[_0x41b6('0x58')][_0x41b6('0x5e')]=moment()[_0x41b6('0x5f')](_0x41b6('0x60'));_0x5f033b[_0x41b6('0x58')][_0x41b6('0x61')]=_0x5f033b[_0x41b6('0x58')][_0x41b6('0x61')]||_0x5f033b['user']['id'];_0x4f52fe[_0x41b6('0x62')]['id']=_0x5f033b[_0x41b6('0x58')][_0x41b6('0x61')];return db[_0x41b6('0x3b')][_0x41b6('0x56')]({'where':{'id':_0x5f033b[_0x41b6('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2a00b7,null))[_0x41b6('0x20')](saveUpdates(_0x5f033b[_0x41b6('0x58')],null))[_0x41b6('0x20')](function(_0x5bf8d5){if(_0x5bf8d5){_0x4f52fe['message']=_0x5bf8d5[_0x41b6('0x63')]({'plain':!![]});return db[_0x41b6('0x64')]['find']({'where':{'id':_0x5bf8d5['OpenchannelInteractionId']}});}return null;})[_0x41b6('0x20')](handleEntityNotFound(_0x2a00b7,null))['then'](function(_0x32fa3f){if(_0x32fa3f){return _0x32fa3f[_0x41b6('0x34')]({'UserId':_0x5f033b[_0x41b6('0x58')]['UserId'],'read1stAt':_[_0x41b6('0x65')](_0x32fa3f[_0x41b6('0x66')])?moment()['format'](_0x41b6('0x60')):undefined});}return null;})['then'](function(_0x29863e){if(_0x29863e){_0x4f52fe[_0x41b6('0x67')]=_0x29863e[_0x41b6('0x63')]({'plain':!![]});interaction_log[_0x41b6('0x28')](_0x41b6('0x68'),_0x5f033b[_0x41b6('0x69')]['id'],_0x5f033b['user']['name'],_0x5f033b[_0x41b6('0x69')]['role'],_0x4f52fe[_0x41b6('0x67')]['id'],_0x5f033b[_0x41b6('0x58')]?JSON[_0x41b6('0x23')](_0x5f033b[_0x41b6('0x58')]):'null');return respondWithRpcPromise('AcceptMessage',_0x41b6('0x6a'),_0x4f52fe);}return null;})[_0x41b6('0x20')](function(_0x5c5941){var _0x3c175c=_0x41b6('0x6b')+_0x5c5941['message'][_0x41b6('0x6c')];return db[_0x41b6('0x6d')][_0x41b6('0x41')](_0x3c175c,{'type':db[_0x41b6('0x6e')][_0x41b6('0x6f')][_0x41b6('0x70')],'raw':!![]})[_0x41b6('0x20')](function(_0x4cd1e1){return _0x4cd1e1;});})[_0x41b6('0x20')](function(_0x2f21b5){if(_0x2f21b5){_0x4f52fe[_0x41b6('0x26')][_0x41b6('0x71')]=_0x2f21b5[0x0];if(!_0x5f033b[_0x41b6('0x58')]['UserId'])return;return db[_0x41b6('0x72')][_0x41b6('0x56')]({'where':{'id':_0x5f033b[_0x41b6('0x58')][_0x41b6('0x61')],'role':_0x41b6('0x62')},'attributes':['id',_0x41b6('0x37'),_0x41b6('0x73'),_0x41b6('0x74'),_0x41b6('0x75')],'raw':!![]});}return null;})[_0x41b6('0x20')](function(_0x139c80){if(!_0x139c80)return null;_0x4f52fe[_0x41b6('0x26')][_0x41b6('0x62')]=_0x139c80;return _0x4f52fe;})[_0x41b6('0x20')](function(_0x58bec3){if(_0x58bec3){if(_0x5f033b[_0x41b6('0x58')][_0x41b6('0x76')]){_0x4f52fe['message'][_0x41b6('0x77')]=util[_0x41b6('0x5f')](_0x41b6('0x78'),_0x5f033b['user'][_0x41b6('0x37')]);_0x4f52fe['message'][_0x41b6('0x79')]=_0x4f52fe['channel'];_0x4f52fe[_0x41b6('0x26')][_0x41b6('0x7a')]=_0x4f52fe[_0x41b6('0x79')];_0x4f52fe['message'][_0x41b6('0x7b')]='accept';return respondWithRpcPromise(_0x41b6('0x7c'),_0x41b6('0x7c'),{'event':'acceptmessage','message':_0x4f52fe[_0x41b6('0x26')]},client9002)[_0x41b6('0x20')](function(){return _0x4f52fe;});}return _0x4f52fe;}return null;})[_0x41b6('0x20')](respondWithResult(_0x2a00b7,null))[_0x41b6('0x2a')](handleError(_0x2a00b7,null));};var interaction_log=require(_0x41b6('0x12'))(_0x41b6('0x5a'));exports['reject']=function(_0x4fd1ca,_0xa6a559,_0x5ad34e){var _0x4c866f={'agent':{},'channel':_0x41b6('0x5c')};if(_0x4fd1ca[_0x41b6('0x58')]['id']){delete _0x4fd1ca['body']['id'];}_0x4fd1ca[_0x41b6('0x58')][_0x41b6('0x61')]=_0x4fd1ca[_0x41b6('0x58')][_0x41b6('0x61')]||_0x4fd1ca[_0x41b6('0x69')]['id'];_0x4c866f['agent']['id']=_0x4fd1ca['body'][_0x41b6('0x61')];return db[_0x41b6('0x3b')][_0x41b6('0x56')]({'where':{'id':_0x4fd1ca[_0x41b6('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xa6a559,null))['then'](function(_0x17405a){if(_0x17405a){_0x4c866f[_0x41b6('0x26')]=_0x17405a[_0x41b6('0x63')]({'plain':!![]});return db[_0x41b6('0x64')]['find']({'where':{'id':_0x17405a['OpenchannelInteractionId']}});}return null;})[_0x41b6('0x20')](handleEntityNotFound(_0xa6a559,null))[_0x41b6('0x20')](function(_0x442eaa){if(_0x442eaa){_0x4c866f[_0x41b6('0x67')]=_0x442eaa[_0x41b6('0x63')]({'plain':!![]});interaction_log['info'](_0x41b6('0x7d'),_0x4fd1ca['user']['id'],_0x4fd1ca[_0x41b6('0x69')][_0x41b6('0x37')],_0x4fd1ca[_0x41b6('0x69')]['role'],_0x4c866f['interaction']['id'],_0x4fd1ca[_0x41b6('0x58')]?JSON['stringify'](_0x4fd1ca[_0x41b6('0x58')]):_0x41b6('0x7e'));return respondWithRpcPromise('RejectMessage',_0x41b6('0x7f'),_0x4c866f);}return null;})[_0x41b6('0x20')](function(_0x2919b2){var _0x5d1f05='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2919b2[_0x41b6('0x26')][_0x41b6('0x6c')];return db[_0x41b6('0x6d')][_0x41b6('0x41')](_0x5d1f05,{'type':db[_0x41b6('0x6e')][_0x41b6('0x6f')][_0x41b6('0x70')],'raw':!![]})['then'](function(_0x104edd){return _0x104edd;});})[_0x41b6('0x20')](function(_0x6afdc3){if(_0x6afdc3){_0x4c866f['message'][_0x41b6('0x71')]=_0x6afdc3[0x0];if(!_0x4fd1ca['body'][_0x41b6('0x61')])return;return db[_0x41b6('0x72')][_0x41b6('0x56')]({'where':{'id':_0x4fd1ca['body']['UserId'],'role':_0x41b6('0x62')},'attributes':['id','name',_0x41b6('0x73'),_0x41b6('0x74'),_0x41b6('0x75')],'raw':!![]});}return null;})['then'](function(_0x5851ab){if(!_0x5851ab)return null;_0x4c866f[_0x41b6('0x26')]['agent']=_0x5851ab;return _0x4c866f;})[_0x41b6('0x20')](function(_0x206e03){if(_0x206e03){_0x206e03[_0x41b6('0x26')]['interface']=util[_0x41b6('0x5f')]('SIP/%s',_0x4fd1ca[_0x41b6('0x69')][_0x41b6('0x37')]);_0x206e03[_0x41b6('0x26')][_0x41b6('0x79')]=_0x4c866f['channel'];_0x206e03[_0x41b6('0x26')][_0x41b6('0x7a')]=_0x4c866f[_0x41b6('0x79')];_0x206e03[_0x41b6('0x26')][_0x41b6('0x7b')]='reject';respondWithRpcPromise(_0x41b6('0x7c'),'EventManager',{'event':_0x41b6('0x80'),'message':_0x206e03[_0x41b6('0x26')]},client9002);return _0x4c866f;}return null;})[_0x41b6('0x20')](respondWithResult(_0xa6a559,null))[_0x41b6('0x2a')](handleError(_0xa6a559,null));};
\ No newline at end of file
index 4106b2f..4c1548e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x356d=['save','update','remove','emit','hasOwnProperty','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x26ab3b,_0x1bc9bf){var _0xac513f=function(_0x18851e){while(--_0x18851e){_0x26ab3b['push'](_0x26ab3b['shift']());}};_0xac513f(++_0x1bc9bf);}(_0x356d,0x105));var _0xd356=function(_0x5dee5e,_0x2fd6fb){_0x5dee5e=_0x5dee5e-0x0;var _0x14caf0=_0x356d[_0x5dee5e];return _0x14caf0;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xd356('0x0'))['db'][_0xd356('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd356('0x2')](0x0);var events={'afterCreate':_0xd356('0x3'),'afterUpdate':_0xd356('0x4'),'afterDestroy':_0xd356('0x5')};function emitEvent(_0x3f17c3){return function(_0x2400da,_0x3a1cd6,_0x255332){OpenchannelMessageEvents[_0xd356('0x6')](_0x3f17c3+':'+_0x2400da['id'],_0x2400da);OpenchannelMessageEvents[_0xd356('0x6')](_0x3f17c3,_0x2400da);_0x255332(null);};}for(var e in events){if(events[_0xd356('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x625f=['OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x625f,0xa8));var _0xf625=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x625f[_0x492af5];return _0x59f529;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0xf625('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xf625('0x1')](0x0);var events={'afterCreate':_0xf625('0x2'),'afterUpdate':_0xf625('0x3'),'afterDestroy':_0xf625('0x4')};function emitEvent(_0x38d8d8){return function(_0x123e37,_0x2dfece,_0x301972){OpenchannelMessageEvents[_0xf625('0x5')](_0x38d8d8+':'+_0x123e37['id'],_0x123e37);OpenchannelMessageEvents[_0xf625('0x5')](_0x38d8d8,_0x123e37);_0x301972(null);};}for(var e in events){if(events[_0xf625('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xf625('0x7')]=OpenchannelMessageEvents;
\ No newline at end of file
index ae5d580..bf122a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','method','GET','POST','afterCreate','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','catch','error','out','CmContact','describe','then'];(function(_0xc1f95f,_0x2ccf17){var _0x33c4ac=function(_0x1fb48d){while(--_0x1fb48d){_0xc1f95f['push'](_0xc1f95f['shift']());}};_0x33c4ac(++_0x2ccf17);}(_0xb10b,0x12a));var _0xbb10=function(_0x340da7,_0x13d6fc){_0x340da7=_0x340da7-0x0;var _0x43b466=_0xb10b[_0x340da7];return _0x43b466;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('OpenchannelMessage',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xd')],'type':_0xbb10('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2353ef,_0x1ce33e,_0x229887){var _0xa3adc8=_0x481979['models'];var _0x4e47f8=_0x2353ef[_0xbb10('0xf')]({'plain':!![]});if(_0x4e47f8[_0xbb10('0x10')][_0xbb10('0x11')]()==='in'||_0x4e47f8['direction'][_0xbb10('0x11')]()==='out'&&!_0x4e47f8[_0xbb10('0x12')]&&!_[_0xbb10('0x13')](_0x4e47f8[_0xbb10('0x14')])){_0xa3adc8[_0xbb10('0x15')][_0xbb10('0x16')]({'where':{'id':_0x4e47f8[_0xbb10('0x17')]}})['then'](function(_0x26e021){if(_0x26e021){_0x26e021[_0xbb10('0x18')]({'lastMsgAt':_0x4e47f8[_0xbb10('0x19')],'lastMsgDirection':_0x4e47f8[_0xbb10('0x10')][_0xbb10('0x11')]()});}})[_0xbb10('0x1a')](function(_0x24a57b){console[_0xbb10('0x1b')](_0x24a57b);});}if(_0x4e47f8[_0xbb10('0x10')]===_0xbb10('0x1c')&&!_0x4e47f8['secret']){var _0x2eca0f;_0xa3adc8[_0xbb10('0x1d')][_0xbb10('0x1e')]()[_0xbb10('0x1f')](function(_0x378da8){return _0xa3adc8[_0xbb10('0x20')][_0xbb10('0x21')]({'where':{'id':_0x4e47f8[_0xbb10('0x22')]},'include':[{'model':_0xa3adc8[_0xbb10('0x15')],'as':_0xbb10('0x23'),'where':{'id':_0x4e47f8['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0xa3adc8[_0xbb10('0x1d')],'as':_0xbb10('0x24'),'attributes':_[_0xbb10('0x25')](_0x378da8)}]}]});})[_0xbb10('0x1f')](function(_0xdf237d){_0x2eca0f=_0xdf237d[_0xbb10('0xf')]({'plain':!![]});if(_0x2eca0f&&_0x2eca0f['replyUri']){logger[_0xbb10('0x26')](_0xbb10('0x27'),'afterCreate',util['format'](_0xbb10('0x28'),_0x4e47f8['id'],_0x2eca0f[_0xbb10('0x29')]));if(_0x2eca0f[_0xbb10('0x23')]&&_0x2eca0f[_0xbb10('0x23')][_0xbb10('0x2a')]){_0x4e47f8[_0xbb10('0x2b')]=_[_0xbb10('0x2c')](_0x2eca0f[_0xbb10('0x23')][0x0],_0xbb10('0x24'));_0x4e47f8[_0xbb10('0x24')]=_0x2eca0f[_0xbb10('0x23')][0x0][_0xbb10('0x24')];}var _0x1ce33e={'method':'POST','uri':encodeURI(_0x2eca0f['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1ce33e[_0xbb10('0x2d')]){case _0xbb10('0x2e'):_0x1ce33e['qs']=_0x4e47f8;break;case _0xbb10('0x2f'):_0x1ce33e['body']=_0x4e47f8;break;}return rp(_0x1ce33e)[_0xbb10('0x1f')](function(_0x24d586){logger[_0xbb10('0x26')](_0xbb10('0x27'),_0xbb10('0x30'),util[_0xbb10('0x31')](_0xbb10('0x32'),_0x4e47f8['id'],_0x2eca0f['replyUri']));if(_0x24d586[_0xbb10('0xd')][_0xbb10('0x33')]&&_0x24d586[_0xbb10('0xd')][_0xbb10('0x33')]!=_0x4e47f8[_0xbb10('0x2b')][_0xbb10('0x33')]){return _0xa3adc8['OpenchannelInteraction'][_0xbb10('0x18')]({'threadId':_0x24d586['body'][_0xbb10('0x33')]},{'logging':!![],'where':{'id':_0x4e47f8['Interaction']['id']}});}else{return;}})[_0xbb10('0x1f')](function(){return _0x2353ef[_0xbb10('0x18')]({'read':!![]});})[_0xbb10('0x1a')](function(_0x491db4){logger['error'](_0xbb10('0x27'),_0xbb10('0x30'),util['inspect'](_0x491db4,{'showHidden':![],'depth':null}));_0x229887();});}else{_0x229887();}})[_0xbb10('0x34')](function(){_0x229887();});}else{_0x229887();}}},'charset':_0xbb10('0x35'),'collate':_0xbb10('0x36')});};
\ No newline at end of file
+var _0x8952=['POST','GET','threadId','inspect','finally','utf8mb4','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','toLowerCase','direction','secret','isNil','OpenchannelInteraction','findOne','update','catch','error','out','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Interactions','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','Interaction','omit','Contact'];(function(_0x18078d,_0x110b00){var _0x480605=function(_0xa17ebe){while(--_0xa17ebe){_0x18078d['push'](_0x18078d['shift']());}};_0x480605(++_0x110b00);}(_0x8952,0x17e));var _0x2895=function(_0x4db868,_0x6252f){_0x4db868=_0x4db868-0x0;var _0x1bca7c=_0x8952[_0x4db868];return _0x1bca7c;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var logger=require(_0x2895('0x1'))(_0x2895('0x2'));var moment=require(_0x2895('0x3'));var BPromise=require(_0x2895('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2895('0x5'));var rimraf=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x2895('0x8')]=function(_0x73c245,_0x37305b){return _0x73c245['define']('OpenchannelMessage',attributes,{'tableName':_0x2895('0x9'),'paranoid':![],'indexes':[{'name':_0x2895('0xa'),'fields':[_0x2895('0xb')],'type':_0x2895('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x384cc6,_0x4952fa,_0x14fb67){var _0x5f2632=_0x73c245[_0x2895('0xd')];var _0x5af454=_0x384cc6['get']({'plain':!![]});if(_0x5af454['direction'][_0x2895('0xe')]()==='in'||_0x5af454[_0x2895('0xf')][_0x2895('0xe')]()==='out'&&!_0x5af454[_0x2895('0x10')]&&!_[_0x2895('0x11')](_0x5af454['UserId'])){_0x5f2632[_0x2895('0x12')][_0x2895('0x13')]({'where':{'id':_0x5af454['OpenchannelInteractionId']}})['then'](function(_0x1d1493){if(_0x1d1493){_0x1d1493[_0x2895('0x14')]({'lastMsgAt':_0x5af454['createdAt'],'lastMsgDirection':_0x5af454[_0x2895('0xf')][_0x2895('0xe')]()});}})[_0x2895('0x15')](function(_0x1ae013){console[_0x2895('0x16')](_0x1ae013);});}if(_0x5af454[_0x2895('0xf')]===_0x2895('0x17')&&!_0x5af454[_0x2895('0x10')]){var _0x3e96d7;_0x5f2632[_0x2895('0x18')][_0x2895('0x19')]()[_0x2895('0x1a')](function(_0xbf8b63){return _0x5f2632[_0x2895('0x1b')][_0x2895('0x1c')]({'where':{'id':_0x5af454[_0x2895('0x1d')]},'include':[{'model':_0x5f2632[_0x2895('0x12')],'as':_0x2895('0x1e'),'where':{'id':_0x5af454['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x5f2632['CmContact'],'as':'Contact','attributes':_[_0x2895('0x1f')](_0xbf8b63)}]}]});})[_0x2895('0x1a')](function(_0x3ec4da){_0x3e96d7=_0x3ec4da['get']({'plain':!![]});if(_0x3e96d7&&_0x3e96d7[_0x2895('0x20')]){logger[_0x2895('0x21')](_0x2895('0x22'),_0x2895('0x23'),util[_0x2895('0x24')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x5af454['id'],_0x3e96d7[_0x2895('0x20')]));if(_0x3e96d7[_0x2895('0x1e')]&&_0x3e96d7['Interactions'][_0x2895('0x25')]){_0x5af454[_0x2895('0x26')]=_[_0x2895('0x27')](_0x3e96d7['Interactions'][0x0],'Contact');_0x5af454[_0x2895('0x28')]=_0x3e96d7[_0x2895('0x1e')][0x0][_0x2895('0x28')];}var _0x4952fa={'method':_0x2895('0x29'),'uri':encodeURI(_0x3e96d7[_0x2895('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4952fa['method']){case _0x2895('0x2a'):_0x4952fa['qs']=_0x5af454;break;case _0x2895('0x29'):_0x4952fa[_0x2895('0xb')]=_0x5af454;break;}return rp(_0x4952fa)['then'](function(_0x320661){logger[_0x2895('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x2895('0x23'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x5af454['id'],_0x3e96d7[_0x2895('0x20')]));if(_0x320661['body'][_0x2895('0x2b')]&&_0x320661[_0x2895('0xb')]['threadId']!=_0x5af454['Interaction'][_0x2895('0x2b')]){return _0x5f2632[_0x2895('0x12')][_0x2895('0x14')]({'threadId':_0x320661[_0x2895('0xb')][_0x2895('0x2b')]},{'logging':!![],'where':{'id':_0x5af454[_0x2895('0x26')]['id']}});}else{return;}})[_0x2895('0x1a')](function(){return _0x384cc6['update']({'read':!![]});})[_0x2895('0x15')](function(_0xd45db5){logger[_0x2895('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x2895('0x23'),util[_0x2895('0x2c')](_0xd45db5,{'showHidden':![],'depth':null}));_0x14fb67();});}else{_0x14fb67();}})[_0x2895('0x2d')](function(){_0x14fb67();});}else{_0x14fb67();}}},'charset':_0x2895('0x2e'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index fe14510..b5e7f1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x258150,_0x3c6757){var _0x26be3b=function(_0x5caf58){while(--_0x5caf58){_0x258150['push'](_0x258150['shift']());}};_0x26be3b(++_0x3c6757);}(_0xdb28,0x106));var _0x8db2=function(_0x2f6ace,_0x59ac98){_0x2f6ace=_0x2f6ace-0x0;var _0x56d88a=_0xdb28[_0x2f6ace];return _0x56d88a;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});};
\ No newline at end of file
+var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x44c583,_0xdc4d48){var _0x396a41=function(_0x1f3e0d){while(--_0x1f3e0d){_0x44c583['push'](_0x44c583['shift']());}};_0x396a41(++_0xdc4d48);}(_0xdb28,0x106));var _0x8db2=function(_0x10ca49,_0x15e9c7){_0x10ca49=_0x10ca49-0x0;var _0x29ddc9=_0xdb28[_0x10ca49];return _0x29ddc9;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});};
\ No newline at end of file
index d2b5bac..22d02a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50d8=['update','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','remove'];(function(_0x1b7bb9,_0x2dc3ac){var _0x4d2ebc=function(_0x2b30a4){while(--_0x2b30a4){_0x1b7bb9['push'](_0x1b7bb9['shift']());}};_0x4d2ebc(++_0x2dc3ac);}(_0x50d8,0x12b));var _0x850d=function(_0x32bd70,_0x5b7f07){_0x32bd70=_0x32bd70-0x0;var _0x1b076a=_0x50d8[_0x32bd70];return _0x1b076a;};'use strict';var OpenchannelMessageEvents=require(_0x850d('0x0'));var events=['save',_0x850d('0x1'),_0x850d('0x2')];function createListener(_0x4b90e2,_0x1bc032){return function(_0x53ea5e){_0x1bc032['emit'](_0x4b90e2,_0x53ea5e);};}function removeListener(_0x3c91c1,_0x10858c){return function(){OpenchannelMessageEvents[_0x850d('0x3')](_0x3c91c1,_0x10858c);};}exports[_0x850d('0x4')]=function(_0x54470c){for(var _0x5e7c62=0x0,_0x9dd636=events[_0x850d('0x5')];_0x5e7c62<_0x9dd636;_0x5e7c62++){var _0x1cce5c=events[_0x5e7c62];var _0x1f443a=createListener(_0x850d('0x6')+_0x1cce5c,_0x54470c);OpenchannelMessageEvents['on'](_0x1cce5c,_0x1f443a);}};
\ No newline at end of file
+var _0x423b=['update','removeListener','length','openchannelMessage:','save'];(function(_0x427b65,_0x41683d){var _0xa87a7c=function(_0x235b2a){while(--_0x235b2a){_0x427b65['push'](_0x427b65['shift']());}};_0xa87a7c(++_0x41683d);}(_0x423b,0x12b));var _0xb423=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x423b[_0x616290];return _0x453879;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xb423('0x0'),'remove',_0xb423('0x1')];function createListener(_0x54e396,_0x3dbb0c){return function(_0x4b4acf){_0x3dbb0c['emit'](_0x54e396,_0x4b4acf);};}function removeListener(_0x50f31a,_0x2fa5da){return function(){OpenchannelMessageEvents[_0xb423('0x2')](_0x50f31a,_0x2fa5da);};}exports['register']=function(_0x1be92e){for(var _0x3e6b18=0x0,_0x49eabb=events[_0xb423('0x3')];_0x3e6b18<_0x49eabb;_0x3e6b18++){var _0x573e95=events[_0x3e6b18];var _0x4119d7=createListener(_0xb423('0x4')+_0x573e95,_0x1be92e);OpenchannelMessageEvents['on'](_0x573e95,_0x4119d7);}};
\ No newline at end of file
index c4285cb..b986f58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3dc=['update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','/:id'];(function(_0x49fb1c,_0x113891){var _0x36cc02=function(_0x308d72){while(--_0x308d72){_0x49fb1c['push'](_0x49fb1c['shift']());}};_0x36cc02(++_0x113891);}(_0xd3dc,0x14e));var _0xcd3d=function(_0x1c056d,_0x5790bc){_0x1c056d=_0x1c056d-0x0;var _0x2f2d8a=_0xd3dc[_0x1c056d];return _0x2f2d8a;};'use strict';var multer=require(_0xcd3d('0x0'));var util=require(_0xcd3d('0x1'));var path=require(_0xcd3d('0x2'));var timeout=require(_0xcd3d('0x3'));var express=require('express');var router=express[_0xcd3d('0x4')]();var fs_extra=require(_0xcd3d('0x5'));var auth=require(_0xcd3d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcd3d('0x7'));var controller=require(_0xcd3d('0x8'));router['get']('/',auth[_0xcd3d('0x9')](),controller[_0xcd3d('0xa')]);router[_0xcd3d('0xb')](_0xcd3d('0xc'),auth['isAuthenticated'](),controller[_0xcd3d('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcd3d('0xe')]);router['get'](_0xcd3d('0xf'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x10')]);router['get'](_0xcd3d('0x11'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x12')]);router[_0xcd3d('0xb')](_0xcd3d('0x13'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x14')]);router[_0xcd3d('0x15')]('/',auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x16')]);router[_0xcd3d('0x15')](_0xcd3d('0x11'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x17')]);router[_0xcd3d('0x15')]('/:id/users',auth[_0xcd3d('0x9')](),controller['addAgents']);router[_0xcd3d('0x18')](_0xcd3d('0x19'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x1a')]);router['delete']('/:id',auth[_0xcd3d('0x9')](),controller['destroy']);router[_0xcd3d('0x1b')](_0xcd3d('0x11'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x1c')]);router['delete'](_0xcd3d('0x13'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x1d')]);module['exports']=router;
\ No newline at end of file
+var _0x9a95=['post','create','addAgents','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0x9a95,0xe8));var _0x59a9=function(_0x555a52,_0x548b2e){_0x555a52=_0x555a52-0x0;var _0x49e035=_0x9a95[_0x555a52];return _0x49e035;};'use strict';var multer=require(_0x59a9('0x0'));var util=require('util');var path=require(_0x59a9('0x1'));var timeout=require(_0x59a9('0x2'));var express=require(_0x59a9('0x3'));var router=express[_0x59a9('0x4')]();var fs_extra=require(_0x59a9('0x5'));var auth=require(_0x59a9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x59a9('0x7'));var controller=require(_0x59a9('0x8'));router[_0x59a9('0x9')]('/',auth[_0x59a9('0xa')](),controller[_0x59a9('0xb')]);router[_0x59a9('0x9')](_0x59a9('0xc'),auth[_0x59a9('0xa')](),controller[_0x59a9('0xd')]);router[_0x59a9('0x9')](_0x59a9('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x59a9('0x9')]('/:id/members',auth[_0x59a9('0xa')](),controller[_0x59a9('0xf')]);router[_0x59a9('0x9')](_0x59a9('0x10'),auth['isAuthenticated'](),controller[_0x59a9('0x11')]);router[_0x59a9('0x9')](_0x59a9('0x12'),auth[_0x59a9('0xa')](),controller[_0x59a9('0x13')]);router[_0x59a9('0x14')]('/',auth[_0x59a9('0xa')](),controller[_0x59a9('0x15')]);router['post'](_0x59a9('0x10'),auth[_0x59a9('0xa')](),controller['addTeams']);router['post'](_0x59a9('0x12'),auth['isAuthenticated'](),controller[_0x59a9('0x16')]);router['put'](_0x59a9('0xe'),auth['isAuthenticated'](),controller[_0x59a9('0x17')]);router[_0x59a9('0x18')](_0x59a9('0xe'),auth[_0x59a9('0xa')](),controller[_0x59a9('0x19')]);router['delete'](_0x59a9('0x10'),auth[_0x59a9('0xa')](),controller[_0x59a9('0x1a')]);router['delete'](_0x59a9('0x12'),auth[_0x59a9('0xa')](),controller[_0x59a9('0x1b')]);module['exports']=router;
\ No newline at end of file
index 7965e1a..6959803 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55d1=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x2a61b4,_0x16df2d){var _0x3191cd=function(_0x3b4c00){while(--_0x3b4c00){_0x2a61b4['push'](_0x2a61b4['shift']());}};_0x3191cd(++_0x16df2d);}(_0x55d1,0x13b));var _0x155d=function(_0x2538cc,_0x19ea15){_0x2538cc=_0x2538cc-0x0;var _0xa8c32e=_0x55d1[_0x2538cc];return _0xa8c32e;};'use strict';var Sequelize=require(_0x155d('0x0'));module[_0x155d('0x1')]={'name':{'type':Sequelize[_0x155d('0x2')],'unique':_0x155d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x155d('0x2')]},'timeout':{'type':Sequelize[_0x155d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x155d('0x5')](_0x155d('0x6'),'beepall',_0x155d('0x7'))}};
\ No newline at end of file
+var _0x3a7a=['ENUM','rrmemory','roundrobin','sequelize','exports','name','STRING','INTEGER'];(function(_0x53fbee,_0x82231){var _0x5007d1=function(_0x4c63a1){while(--_0x4c63a1){_0x53fbee['push'](_0x53fbee['shift']());}};_0x5007d1(++_0x82231);}(_0x3a7a,0x17b));var _0xa3a7=function(_0x50a1f6,_0x238fd8){_0x50a1f6=_0x50a1f6-0x0;var _0x84f8d4=_0x3a7a[_0x50a1f6];return _0x84f8d4;};'use strict';var Sequelize=require(_0xa3a7('0x0'));module[_0xa3a7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa3a7('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa3a7('0x3')]},'timeout':{'type':Sequelize[_0xa3a7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa3a7('0x5')](_0xa3a7('0x6'),'beepall',_0xa3a7('0x7'))}};
\ No newline at end of file
index d8d5e72..3f7ddae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e8c=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','order','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','SIP','findOne','Team','getTeams','Agents','voicePause','interface','sequelize','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','value','transaction','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','offset','undefined','limit','count','json','apply','reject','update','then','destroy','get','OpenchannelQueues','end','sendStatus','error','stack','name','send','map','OpenchannelQueue','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','merge','catch','create','body','user','role','find','userProfileId','autoAssociation'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7e8c,0x1cc));var _0xc7e8=function(_0x112424,_0x2fd141){_0x112424=_0x112424-0x0;var _0x22fc9c=_0x7e8c[_0x112424];return _0x22fc9c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc7e8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc7e8('0x1'));var rp=require('request-promise');var moment=require(_0xc7e8('0x2'));var BPromise=require(_0xc7e8('0x3'));var Mustache=require('mustache');var util=require(_0xc7e8('0x4'));var path=require(_0xc7e8('0x5'));var sox=require(_0xc7e8('0x6'));var csv=require(_0xc7e8('0x7'));var ejs=require(_0xc7e8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc7e8('0x9'));var squel=require(_0xc7e8('0xa'));var crypto=require('crypto');var jsforce=require(_0xc7e8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc7e8('0x7'));var querystring=require(_0xc7e8('0xc'));var Papa=require('papaparse');var Redis=require(_0xc7e8('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc7e8('0xe'));var as=require(_0xc7e8('0xf'));var hardwareService=require(_0xc7e8('0x10'));var logger=require(_0xc7e8('0x11'))(_0xc7e8('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc7e8('0x13'));var db=require(_0xc7e8('0x14'))['db'];config[_0xc7e8('0x15')]=_[_0xc7e8('0x16')](config[_0xc7e8('0x15')],{'host':_0xc7e8('0x17'),'port':0x18eb});var socket=require(_0xc7e8('0x18'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xc7e8('0x19')](socket);function respondWithStatusCode(_0xaeffb4,_0x170b4a){_0x170b4a=_0x170b4a||0xcc;return function(_0x3b0f2b){if(_0x3b0f2b){return _0xaeffb4['sendStatus'](_0x170b4a);}return _0xaeffb4[_0xc7e8('0x1a')](_0x170b4a)['end']();};}function respondWithResult(_0x322b28,_0x5044df){_0x5044df=_0x5044df||0xc8;return function(_0x1fc44c){if(_0x1fc44c){return _0x322b28[_0xc7e8('0x1a')](_0x5044df)['json'](_0x1fc44c);}};}function respondWithFilteredResult(_0x1b1e70,_0x319124){return function(_0x4c3e02){if(_0x4c3e02){var _0x49aa73=typeof _0x319124[_0xc7e8('0x1b')]===_0xc7e8('0x1c')&&typeof _0x319124[_0xc7e8('0x1d')]===_0xc7e8('0x1c');var _0x172ee5=_0x4c3e02['count'];var _0x337f8b=_0x49aa73?0x0:_0x319124[_0xc7e8('0x1b')];var _0x143023=_0x49aa73?_0x4c3e02[_0xc7e8('0x1e')]:_0x319124[_0xc7e8('0x1b')]+_0x319124[_0xc7e8('0x1d')];var _0x209484;if(_0x143023>=_0x172ee5){_0x143023=_0x172ee5;_0x209484=0xc8;}else{_0x209484=0xce;}_0x1b1e70['status'](_0x209484);return _0x1b1e70['set']('Content-Range',_0x337f8b+'-'+_0x143023+'/'+_0x172ee5)[_0xc7e8('0x1f')](_0x4c3e02);}return null;};}function patchUpdates(_0x5e1dfa){return function(_0x4ba4c7){try{jsonpatch[_0xc7e8('0x20')](_0x4ba4c7,_0x5e1dfa,!![]);}catch(_0x2b1ff4){return BPromise[_0xc7e8('0x21')](_0x2b1ff4);}return _0x4ba4c7['save']();};}function saveUpdates(_0x45d454,_0x44d6d7){return function(_0x2dd31c){if(_0x2dd31c){return _0x2dd31c[_0xc7e8('0x22')](_0x45d454)[_0xc7e8('0x23')](function(_0x5c2aef){return _0x5c2aef;});}return null;};}function removeEntity(_0x5211fa,_0x25e78b){return function(_0x4efb9e){if(_0x4efb9e){return _0x4efb9e[_0xc7e8('0x24')]()[_0xc7e8('0x23')](function(){var _0x4de457=_0x4efb9e[_0xc7e8('0x25')]({'plain':!![]});var _0x4b027e=_0xc7e8('0x26');return db['UserProfileResource'][_0xc7e8('0x24')]({'where':{'type':_0x4b027e,'resourceId':_0x4de457['id']}})[_0xc7e8('0x23')](function(){return _0x4efb9e;});})[_0xc7e8('0x23')](function(){_0x5211fa[_0xc7e8('0x1a')](0xcc)[_0xc7e8('0x27')]();});}};}function handleEntityNotFound(_0x1776d9,_0x26e575){return function(_0x55c0c1){if(!_0x55c0c1){_0x1776d9[_0xc7e8('0x28')](0x194);}return _0x55c0c1;};}function handleError(_0x154e78,_0x291ace){_0x291ace=_0x291ace||0x1f4;return function(_0x20afff){logger[_0xc7e8('0x29')](_0x20afff[_0xc7e8('0x2a')]);if(_0x20afff['name']){delete _0x20afff[_0xc7e8('0x2b')];}_0x154e78[_0xc7e8('0x1a')](_0x291ace)[_0xc7e8('0x2c')](_0x20afff);};}exports['index']=function(_0x3e7b2b,_0x26524c){var _0x5632ea={},_0x139123={},_0x24c4f5={'count':0x0,'rows':[]};var _0x1cc685=_[_0xc7e8('0x2d')](db[_0xc7e8('0x2e')]['rawAttributes'],function(_0x52718e){return{'name':_0x52718e['fieldName'],'type':_0x52718e[_0xc7e8('0x2f')][_0xc7e8('0x30')]};});_0x139123[_0xc7e8('0x31')]=_[_0xc7e8('0x2d')](_0x1cc685,_0xc7e8('0x2b'));_0x139123[_0xc7e8('0x32')]=_[_0xc7e8('0x33')](_0x3e7b2b[_0xc7e8('0x32')]);_0x139123['filters']=_[_0xc7e8('0x34')](_0x139123[_0xc7e8('0x31')],_0x139123[_0xc7e8('0x32')]);_0x5632ea[_0xc7e8('0x35')]=_[_0xc7e8('0x34')](_0x139123[_0xc7e8('0x31')],qs[_0xc7e8('0x36')](_0x3e7b2b['query']['fields']));_0x5632ea[_0xc7e8('0x35')]=_0x5632ea['attributes'][_0xc7e8('0x37')]?_0x5632ea[_0xc7e8('0x35')]:_0x139123['model'];if(!_0x3e7b2b[_0xc7e8('0x32')][_0xc7e8('0x38')](_0xc7e8('0x39'))){_0x5632ea['limit']=qs[_0xc7e8('0x1d')](_0x3e7b2b[_0xc7e8('0x32')][_0xc7e8('0x1d')]);_0x5632ea[_0xc7e8('0x1b')]=qs[_0xc7e8('0x1b')](_0x3e7b2b[_0xc7e8('0x32')][_0xc7e8('0x1b')]);}_0x5632ea['order']=qs[_0xc7e8('0x3a')](_0x3e7b2b[_0xc7e8('0x32')][_0xc7e8('0x3a')]);_0x5632ea['where']=qs[_0xc7e8('0x3b')](_[_0xc7e8('0x3c')](_0x3e7b2b[_0xc7e8('0x32')],_0x139123['filters']),_0x1cc685);if(_0x3e7b2b[_0xc7e8('0x32')][_0xc7e8('0x3d')]){_0x5632ea['where']=_['merge'](_0x5632ea[_0xc7e8('0x3e')],{'$or':_['map'](_0x1cc685,function(_0x5942b8){if(_0x5942b8[_0xc7e8('0x2f')]!==_0xc7e8('0x3f')){var _0x36288c={};_0x36288c[_0x5942b8['name']]={'$like':'%'+_0x3e7b2b[_0xc7e8('0x32')]['filter']+'%'};return _0x36288c;}})});}_0x5632ea=_['merge']({},_0x5632ea,_0x3e7b2b[_0xc7e8('0x40')]);var _0x4085ef={'where':_0x5632ea[_0xc7e8('0x3e')]};return db[_0xc7e8('0x2e')][_0xc7e8('0x1e')](_0x4085ef)[_0xc7e8('0x23')](function(_0x129604){_0x24c4f5[_0xc7e8('0x1e')]=_0x129604;if(_0x3e7b2b[_0xc7e8('0x32')][_0xc7e8('0x41')]){_0x5632ea[_0xc7e8('0x42')]=[{'all':!![]}];}return db[_0xc7e8('0x2e')][_0xc7e8('0x43')](_0x5632ea);})[_0xc7e8('0x23')](function(_0x409376){_0x24c4f5[_0xc7e8('0x44')]=_0x409376;return _0x24c4f5;})[_0xc7e8('0x23')](respondWithFilteredResult(_0x26524c,_0x5632ea))['catch'](handleError(_0x26524c,null));};exports['show']=function(_0x10ee19,_0x357815){var _0x22aa08={'raw':!![],'where':{'id':_0x10ee19[_0xc7e8('0x45')]['id']}},_0x16d3f9={};_0x16d3f9[_0xc7e8('0x31')]=_[_0xc7e8('0x33')](db[_0xc7e8('0x2e')][_0xc7e8('0x46')]);_0x16d3f9['query']=_[_0xc7e8('0x33')](_0x10ee19[_0xc7e8('0x32')]);_0x16d3f9[_0xc7e8('0x3b')]=_[_0xc7e8('0x34')](_0x16d3f9['model'],_0x16d3f9[_0xc7e8('0x32')]);_0x22aa08[_0xc7e8('0x35')]=_[_0xc7e8('0x34')](_0x16d3f9['model'],qs[_0xc7e8('0x36')](_0x10ee19[_0xc7e8('0x32')][_0xc7e8('0x36')]));_0x22aa08[_0xc7e8('0x35')]=_0x22aa08['attributes'][_0xc7e8('0x37')]?_0x22aa08[_0xc7e8('0x35')]:_0x16d3f9[_0xc7e8('0x31')];if(_0x10ee19[_0xc7e8('0x32')]['includeAll']){_0x22aa08[_0xc7e8('0x42')]=[{'all':!![]}];}_0x22aa08=_[_0xc7e8('0x47')]({},_0x22aa08,_0x10ee19[_0xc7e8('0x40')]);return db[_0xc7e8('0x2e')]['find'](_0x22aa08)[_0xc7e8('0x23')](handleEntityNotFound(_0x357815,null))['then'](respondWithResult(_0x357815,null))[_0xc7e8('0x48')](handleError(_0x357815,null));};exports['create']=function(_0x5500ce,_0x240f3d){return db[_0xc7e8('0x2e')][_0xc7e8('0x49')](_0x5500ce[_0xc7e8('0x4a')],{})[_0xc7e8('0x23')](function(_0x437a65){var _0x3b2951=_0x5500ce[_0xc7e8('0x4b')]['get']({'plain':!![]});if(!_0x3b2951)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b2951[_0xc7e8('0x4c')]===_0xc7e8('0x4b')){var _0x4c893d=_0x437a65[_0xc7e8('0x25')]({'plain':!![]});var _0x120d12=_0xc7e8('0x26');return db['UserProfileSection'][_0xc7e8('0x4d')]({'where':{'name':_0x120d12,'userProfileId':_0x3b2951[_0xc7e8('0x4e')]},'raw':!![]})[_0xc7e8('0x23')](function(_0x41513e){if(_0x41513e&&_0x41513e[_0xc7e8('0x4f')]===0x0){return db['UserProfileResource'][_0xc7e8('0x49')]({'name':_0x4c893d[_0xc7e8('0x2b')],'resourceId':_0x4c893d['id'],'type':_0x41513e[_0xc7e8('0x2b')],'sectionId':_0x41513e['id']},{})[_0xc7e8('0x23')](function(){return _0x437a65;});}else{return _0x437a65;}})['catch'](function(_0x1b6d3d){logger[_0xc7e8('0x29')](_0xc7e8('0x50'),_0x1b6d3d);throw _0x1b6d3d;});}return _0x437a65;})['then'](respondWithResult(_0x240f3d,0xc9))[_0xc7e8('0x48')](handleError(_0x240f3d,null));};exports[_0xc7e8('0x22')]=function(_0x555467,_0x54c1f9){if(_0x555467[_0xc7e8('0x4a')]['id']){delete _0x555467[_0xc7e8('0x4a')]['id'];}return db[_0xc7e8('0x2e')][_0xc7e8('0x4d')]({'where':{'id':_0x555467[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](handleEntityNotFound(_0x54c1f9,null))[_0xc7e8('0x23')](saveUpdates(_0x555467[_0xc7e8('0x4a')],null))[_0xc7e8('0x23')](respondWithResult(_0x54c1f9,null))[_0xc7e8('0x48')](handleError(_0x54c1f9,null));};exports[_0xc7e8('0x24')]=function(_0x10a5a0,_0x24d84b){return db[_0xc7e8('0x2e')][_0xc7e8('0x4d')]({'where':{'id':_0x10a5a0['params']['id']}})['then'](handleEntityNotFound(_0x24d84b,null))[_0xc7e8('0x23')](removeEntity(_0x24d84b,null))['catch'](handleError(_0x24d84b,null));};exports[_0xc7e8('0x51')]=function(_0x48b8f0,_0x252c2f){return db['OpenchannelQueue']['describe']()[_0xc7e8('0x23')](respondWithResult(_0x252c2f,null))['catch'](handleError(_0x252c2f,null));};exports[_0xc7e8('0x52')]=function(_0x458d36,_0x293571,_0x346d08){var _0x9cf427={'raw':!![],'where':{}},_0x3cb2ed={},_0x112e56;return db[_0xc7e8('0x2e')]['findOne']({'where':{'id':_0x458d36['params']['id']}})[_0xc7e8('0x23')](handleEntityNotFound(_0x293571,null))[_0xc7e8('0x23')](function(_0x5087ed){if(_0x5087ed){_0x112e56=_0x5087ed[_0xc7e8('0x25')]({'plain':!![]});_0x3cb2ed['model']=_[_0xc7e8('0x33')](db[_0xc7e8('0x53')][_0xc7e8('0x46')]);_0x3cb2ed[_0xc7e8('0x32')]=_[_0xc7e8('0x33')](_0x458d36[_0xc7e8('0x32')]);_0x3cb2ed[_0xc7e8('0x3b')]=_[_0xc7e8('0x34')](_0x3cb2ed[_0xc7e8('0x31')],_0x3cb2ed['query']);_0x9cf427[_0xc7e8('0x35')]=_[_0xc7e8('0x34')](_0x3cb2ed[_0xc7e8('0x31')],qs[_0xc7e8('0x36')](_0x458d36[_0xc7e8('0x32')]['fields']));_0x9cf427['attributes']=_0x9cf427[_0xc7e8('0x35')][_0xc7e8('0x37')]?_0x9cf427[_0xc7e8('0x35')]:_0x3cb2ed['model'];if(!_0x458d36[_0xc7e8('0x32')]['hasOwnProperty'](_0xc7e8('0x39'))){_0x9cf427[_0xc7e8('0x1d')]=qs[_0xc7e8('0x1d')](_0x458d36[_0xc7e8('0x32')]['limit']);_0x9cf427[_0xc7e8('0x1b')]=qs[_0xc7e8('0x1b')](_0x458d36[_0xc7e8('0x32')][_0xc7e8('0x1b')]);}_0x9cf427[_0xc7e8('0x54')]=qs[_0xc7e8('0x3a')](_0x458d36[_0xc7e8('0x32')]['sort']);_0x9cf427['where']=qs['filters'](_[_0xc7e8('0x3c')](_0x458d36[_0xc7e8('0x32')],_0x3cb2ed[_0xc7e8('0x3b')]));_0x9cf427[_0xc7e8('0x3e')][_0xc7e8('0x55')]=_0x5087ed['id'];if(_0x458d36[_0xc7e8('0x32')][_0xc7e8('0x3d')]){_0x9cf427[_0xc7e8('0x3e')]=_[_0xc7e8('0x47')](_0x9cf427[_0xc7e8('0x3e')],{'$or':_[_0xc7e8('0x2d')](_0x9cf427['attributes'],function(_0x4bcb1a){var _0x463995={};_0x463995[_0x4bcb1a]={'$like':'%'+_0x458d36[_0xc7e8('0x32')]['filter']+'%'};return _0x463995;})});}_0x9cf427=_[_0xc7e8('0x47')]({},_0x9cf427,_0x458d36[_0xc7e8('0x40')]);return db[_0xc7e8('0x53')][_0xc7e8('0x43')](_0x9cf427);}})[_0xc7e8('0x23')](function(_0x37ea31){if(_0x37ea31){return db[_0xc7e8('0x56')][_0xc7e8('0x57')]({'where':{'id':_[_0xc7e8('0x2d')](_0x37ea31,_0xc7e8('0x58')),'role':_0xc7e8('0x59')},'attributes':['id',_0xc7e8('0x2b'),_0xc7e8('0x5a'),_0xc7e8('0x5b'),_0xc7e8('0x5c')]});}})['then'](function(_0x96b14e){if(_0x96b14e){return{'count':_0x96b14e[_0xc7e8('0x1e')],'rows':_['map'](_0x96b14e['rows'],function(_0x5e7ca3){return{'membername':_0x5e7ca3[_0xc7e8('0x2b')],'UserId':_0x5e7ca3['id'],'queue_name':_0x112e56[_0xc7e8('0x2b')],'OpenchannelQueueId':_0x112e56['id'],'interface':util[_0xc7e8('0x5d')]('%s/%s',_0xc7e8('0x5e'),_0x5e7ca3[_0xc7e8('0x2b')]),'penalty':0x0,'paused':_0x5e7ca3[_0xc7e8('0x5a')],'createdAt':_0x5e7ca3['createdAt'],'updatedAt':_0x5e7ca3[_0xc7e8('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc7e8('0x23')](respondWithFilteredResult(_0x293571,_0x9cf427))[_0xc7e8('0x48')](handleError(_0x293571,null));};exports['getTeams']=function(_0x534bff,_0x5717be,_0x584d27){var _0x3b7bc8={};var _0x1aa5a6={};var _0x210597;var _0x5ec06d;return db[_0xc7e8('0x2e')][_0xc7e8('0x5f')]({'where':{'id':_0x534bff[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](handleEntityNotFound(_0x5717be,null))[_0xc7e8('0x23')](function(_0x426fe6){if(_0x426fe6){_0x210597=_0x426fe6;_0x1aa5a6['model']=_[_0xc7e8('0x33')](db[_0xc7e8('0x60')]['rawAttributes']);_0x1aa5a6[_0xc7e8('0x32')]=_[_0xc7e8('0x33')](_0x534bff[_0xc7e8('0x32')]);_0x1aa5a6['filters']=_[_0xc7e8('0x34')](_0x1aa5a6['model'],_0x1aa5a6[_0xc7e8('0x32')]);_0x3b7bc8[_0xc7e8('0x35')]=_[_0xc7e8('0x34')](_0x1aa5a6[_0xc7e8('0x31')],qs[_0xc7e8('0x36')](_0x534bff[_0xc7e8('0x32')][_0xc7e8('0x36')]));_0x3b7bc8['attributes']=_0x3b7bc8['attributes'][_0xc7e8('0x37')]?_0x3b7bc8['attributes']:_0x1aa5a6[_0xc7e8('0x31')];_0x3b7bc8[_0xc7e8('0x54')]=qs[_0xc7e8('0x3a')](_0x534bff[_0xc7e8('0x32')]['sort']);_0x3b7bc8[_0xc7e8('0x3e')]=qs[_0xc7e8('0x3b')](_[_0xc7e8('0x3c')](_0x534bff['query'],_0x1aa5a6[_0xc7e8('0x3b')]));if(_0x534bff[_0xc7e8('0x32')][_0xc7e8('0x3d')]){_0x3b7bc8['where']=_[_0xc7e8('0x47')](_0x3b7bc8[_0xc7e8('0x3e')],{'$or':_['map'](_0x3b7bc8[_0xc7e8('0x35')],function(_0x589e8b){var _0x84d89b={};_0x84d89b[_0x589e8b]={'$like':'%'+_0x534bff['query']['filter']+'%'};return _0x84d89b;})});}_0x3b7bc8=_[_0xc7e8('0x47')]({},_0x3b7bc8,_0x534bff[_0xc7e8('0x40')]);return _0x210597[_0xc7e8('0x61')](_0x3b7bc8);}})[_0xc7e8('0x23')](function(_0x18787f){if(_0x18787f){_0x5ec06d=_0x18787f[_0xc7e8('0x37')];if(!_0x534bff[_0xc7e8('0x32')][_0xc7e8('0x38')](_0xc7e8('0x39'))){_0x3b7bc8[_0xc7e8('0x1d')]=qs[_0xc7e8('0x1d')](_0x534bff[_0xc7e8('0x32')][_0xc7e8('0x1d')]);_0x3b7bc8[_0xc7e8('0x1b')]=qs[_0xc7e8('0x1b')](_0x534bff['query'][_0xc7e8('0x1b')]);}return _0x210597[_0xc7e8('0x61')](_0x3b7bc8);}})[_0xc7e8('0x23')](function(_0x5d21f5){if(_0x5d21f5){return _0x5d21f5?{'count':_0x5ec06d,'rows':_0x5d21f5}:null;}})[_0xc7e8('0x23')](respondWithResult(_0x5717be,null))[_0xc7e8('0x48')](handleError(_0x5717be,null));};exports['addTeams']=function(_0x1bd27e,_0xcffbe0,_0x5ba0cd){var _0x10558e=_0x1bd27e[_0xc7e8('0x4a')]['ids'];return db[_0xc7e8('0x60')][_0xc7e8('0x43')]({'where':{'id':_0x10558e},'attributes':['id'],'include':[{'model':db[_0xc7e8('0x56')],'as':_0xc7e8('0x62'),'attributes':['id','name','online',_0xc7e8('0x63'),_0xc7e8('0x64')],'raw':!![]}]})[_0xc7e8('0x23')](function(_0x32b002){if(_0x32b002){var _0x516aa9=_['flatMap'](_0x32b002,function(_0x5a8938){var _0x5b2d9f=_0x5a8938['get']({'plain':!![]});return _0x5b2d9f[_0xc7e8('0x62')];});return db[_0xc7e8('0x2e')][_0xc7e8('0x4d')]({'where':{'id':_0x1bd27e[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](function(_0xb3ff73){return db[_0xc7e8('0x65')]['transaction'](function(_0x59d630){return _0xb3ff73['addTeams'](_0x10558e,{'transaction':_0x59d630})[_0xc7e8('0x23')](function(){return BPromise[_0xc7e8('0x66')](_0x516aa9,function(_0x2b602a){return db[_0xc7e8('0x53')][_0xc7e8('0x67')]({'where':{'UserId':_0x2b602a['id'],'OpenchannelQueueId':_0x1bd27e['params']['id']},'transaction':_0x59d630});});})[_0xc7e8('0x23')](function(){_0x516aa9['forEach'](function(_0x3bf848){socket[_0xc7e8('0x68')](_0xc7e8('0x69'),{'UserId':_0x3bf848['id'],'OpenchannelQueueId':_0xb3ff73['id']});});});});});}})[_0xc7e8('0x23')](respondWithStatusCode(_0xcffbe0,null))[_0xc7e8('0x48')](handleError(_0xcffbe0,null));};exports[_0xc7e8('0x6a')]=function(_0x4d36ac,_0x4d74d0,_0x47983a){return db[_0xc7e8('0x60')][_0xc7e8('0x43')]({'where':{'id':_0x4d36ac['query'][_0xc7e8('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xc7e8('0x56')],'as':_0xc7e8('0x62'),'attributes':['id'],'raw':!![]}]})[_0xc7e8('0x23')](handleEntityNotFound(_0x4d74d0,null))[_0xc7e8('0x23')](function(_0x45c6ec){var _0x576b81=_['map'](_0x45c6ec,'id');var _0x35a75a=[];var _0x41556f=[];var _0x1a1d5d=squel[_0xc7e8('0x6c')]();_0x1a1d5d[_0xc7e8('0x6d')](_0xc7e8('0x6e'))[_0xc7e8('0x6f')](_0xc7e8('0x70'),'tq')[_0xc7e8('0x71')](_0xc7e8('0x72'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc7e8('0x3e')](_0xc7e8('0x73'),_0x4d36ac[_0xc7e8('0x45')]['id']);for(var _0x3c97ac=0x0;_0x3c97ac<_0x45c6ec['length'];_0x3c97ac+=0x1){let _0xcdffd1=_0x45c6ec[_0x3c97ac];for(var _0x4113cf=0x0;_0x4113cf<_0xcdffd1['Agents']['length'];_0x4113cf+=0x1){let _0x344db1=_0xcdffd1['Agents'][_0x4113cf];var _0x3a2948=_0x1a1d5d[_0xc7e8('0x74')]();_0x3a2948[_0xc7e8('0x3e')](_0xc7e8('0x75'),_0x344db1['id']);_0x41556f[_0xc7e8('0x76')](db[_0xc7e8('0x65')]['query'](_0x3a2948[_0xc7e8('0x77')](),{'type':db[_0xc7e8('0x65')]['QueryTypes'][_0xc7e8('0x78')]})[_0xc7e8('0x23')](function(_0x135b41){if(_0x135b41[_0xc7e8('0x37')]===0x1){return _0x344db1['id'];}else{var _0x109ebf=_[_0xc7e8('0x79')](_[_0xc7e8('0x2d')](_0x135b41,_0xc7e8('0x7a')),function(_0x475c93){return _[_0xc7e8('0x7b')](_0x576b81,_0x475c93);});if(_0x109ebf){return _0x344db1['id'];}}}));}}return BPromise['all'](_0x41556f)[_0xc7e8('0x23')](function(_0x5bdee5){_0x35a75a=_(_0x35a75a)['union'](_0x5bdee5)['compact']()[_0xc7e8('0x7c')]();return db[_0xc7e8('0x2e')]['find']({'where':{'id':_0x4d36ac[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](function(_0x5e3a42){return db['sequelize'][_0xc7e8('0x7d')](function(_0x28e77d){return _0x5e3a42[_0xc7e8('0x6a')](_0x4d36ac[_0xc7e8('0x32')][_0xc7e8('0x6b')],{'transaction':_0x28e77d})[_0xc7e8('0x23')](function(){if(!_[_0xc7e8('0x7e')](_0x35a75a)){return _0x5e3a42[_0xc7e8('0x7f')](_0x35a75a,{'transaction':_0x28e77d});}})['then'](function(){_0x35a75a[_0xc7e8('0x80')](function(_0x1fe96c){socket[_0xc7e8('0x68')](_0xc7e8('0x81'),{'UserId':_0x1fe96c,'OpenchannelQueueId':_0x5e3a42['id']});});});});});});})[_0xc7e8('0x23')](respondWithStatusCode(_0x4d74d0,null))[_0xc7e8('0x48')](handleError(_0x4d74d0,null));};exports['addAgents']=function(_0x36a331,_0x483c2b,_0x305ccb){return db[_0xc7e8('0x2e')][_0xc7e8('0x4d')]({'where':{'id':_0x36a331[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](handleEntityNotFound(_0x483c2b,null))['then'](function(_0xb05b8f){if(_0xb05b8f){return _0xb05b8f[_0xc7e8('0x82')](_0x36a331['body'][_0xc7e8('0x6b')],_[_0xc7e8('0x83')](_0x36a331[_0xc7e8('0x4a')],[_0xc7e8('0x6b'),'id'])||{})[_0xc7e8('0x84')](function(_0x740dc5){for(var _0x19e6bc=0x0;_0x19e6bc<_0x36a331['body'][_0xc7e8('0x6b')]['length'];_0x19e6bc+=0x1){socket[_0xc7e8('0x68')](_0xc7e8('0x69'),{'UserId':Number(_0x36a331[_0xc7e8('0x4a')]['ids'][_0x19e6bc]),'OpenchannelQueueId':Number(_0x36a331[_0xc7e8('0x45')]['id'])});}return _0x740dc5;});}})[_0xc7e8('0x23')](respondWithResult(_0x483c2b,null))['catch'](handleError(_0x483c2b,null));};exports[_0xc7e8('0x7f')]=function(_0x95da0d,_0x82a199,_0x27eb7a){return db[_0xc7e8('0x2e')]['find']({'where':{'id':_0x95da0d[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](handleEntityNotFound(_0x82a199,null))['then'](function(_0x21f145){if(_0x21f145){return _0x21f145['removeAgents'](_0x95da0d[_0xc7e8('0x32')][_0xc7e8('0x6b')])[_0xc7e8('0x23')](function(){if(_[_0xc7e8('0x85')](_0x95da0d[_0xc7e8('0x32')][_0xc7e8('0x6b')])){for(var _0x588bf1=0x0;_0x588bf1<_0x95da0d[_0xc7e8('0x32')][_0xc7e8('0x6b')][_0xc7e8('0x37')];_0x588bf1+=0x1){socket[_0xc7e8('0x68')]('userOpenchannelQueue:remove',{'UserId':Number(_0x95da0d[_0xc7e8('0x32')]['ids'][_0x588bf1]),'OpenchannelQueueId':Number(_0x95da0d[_0xc7e8('0x45')]['id'])});}}else{socket[_0xc7e8('0x68')](_0xc7e8('0x81'),{'UserId':Number(_0x95da0d[_0xc7e8('0x32')][_0xc7e8('0x6b')]),'OpenchannelQueueId':Number(_0x95da0d[_0xc7e8('0x45')]['id'])});}});}})[_0xc7e8('0x23')](respondWithStatusCode(_0x82a199,null))[_0xc7e8('0x48')](handleError(_0x82a199,null));};exports[_0xc7e8('0x86')]=function(_0x4c5456,_0x4440bc,_0x290bb2){var _0xfc110c={};var _0x34df41={};var _0x412ab3;var _0x414d8b;return db[_0xc7e8('0x2e')][_0xc7e8('0x5f')]({'where':{'id':_0x4c5456[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](handleEntityNotFound(_0x4440bc,null))[_0xc7e8('0x23')](function(_0x1208c){if(_0x1208c){_0x412ab3=_0x1208c;_0x34df41[_0xc7e8('0x31')]=_[_0xc7e8('0x33')](db['User'][_0xc7e8('0x46')]);_0x34df41[_0xc7e8('0x32')]=_[_0xc7e8('0x33')](_0x4c5456[_0xc7e8('0x32')]);_0x34df41[_0xc7e8('0x3b')]=_[_0xc7e8('0x34')](_0x34df41[_0xc7e8('0x31')],_0x34df41[_0xc7e8('0x32')]);_0xfc110c['attributes']=_[_0xc7e8('0x34')](_0x34df41[_0xc7e8('0x31')],qs[_0xc7e8('0x36')](_0x4c5456[_0xc7e8('0x32')][_0xc7e8('0x36')]));_0xfc110c[_0xc7e8('0x35')]=_0xfc110c['attributes'][_0xc7e8('0x37')]?_0xfc110c['attributes']:_0x34df41[_0xc7e8('0x31')];_0xfc110c[_0xc7e8('0x54')]=qs[_0xc7e8('0x3a')](_0x4c5456[_0xc7e8('0x32')][_0xc7e8('0x3a')]);_0xfc110c[_0xc7e8('0x3e')]=qs[_0xc7e8('0x3b')](_[_0xc7e8('0x3c')](_0x4c5456['query'],_0x34df41[_0xc7e8('0x3b')]));if(_0x4c5456[_0xc7e8('0x32')][_0xc7e8('0x3d')]){_0xfc110c[_0xc7e8('0x3e')]=_[_0xc7e8('0x47')](_0xfc110c[_0xc7e8('0x3e')],{'$or':_[_0xc7e8('0x2d')](_0xfc110c[_0xc7e8('0x35')],function(_0x989ab0){var _0x2402ab={};_0x2402ab[_0x989ab0]={'$like':'%'+_0x4c5456[_0xc7e8('0x32')][_0xc7e8('0x3d')]+'%'};return _0x2402ab;})});}_0xfc110c=_[_0xc7e8('0x47')]({},_0xfc110c,_0x4c5456[_0xc7e8('0x40')]);return _0x412ab3[_0xc7e8('0x86')](_0xfc110c);}})[_0xc7e8('0x23')](function(_0x88c6a5){if(_0x88c6a5){_0x414d8b=_0x88c6a5[_0xc7e8('0x37')];if(!_0x4c5456[_0xc7e8('0x32')][_0xc7e8('0x38')](_0xc7e8('0x39'))){_0xfc110c[_0xc7e8('0x1d')]=qs['limit'](_0x4c5456['query'][_0xc7e8('0x1d')]);_0xfc110c['offset']=qs[_0xc7e8('0x1b')](_0x4c5456[_0xc7e8('0x32')][_0xc7e8('0x1b')]);}return _0x412ab3[_0xc7e8('0x86')](_0xfc110c);}})[_0xc7e8('0x23')](function(_0x1375bb){if(_0x1375bb){return _0x1375bb?{'count':_0x414d8b,'rows':_0x1375bb}:null;}})[_0xc7e8('0x23')](respondWithResult(_0x4440bc,null))['catch'](handleError(_0x4440bc,null));};
\ No newline at end of file
+var _0xf4c1=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','localhost','./openchannelQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','UserProfileResource','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','OpenchannelQueue','includeAll','findAll','rows','catch','show','params','keys','length','options','create','user','get','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','filter','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','Team','getTeams','Agents','online','interface','flatMap','addTeams','each','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','every','TeamId','includes','all','compact','value','transaction','ids','isEmpty','forEach','emit','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format'];(function(_0x540dd3,_0x222a68){var _0x5d6aa6=function(_0x21a161){while(--_0x21a161){_0x540dd3['push'](_0x540dd3['shift']());}};_0x5d6aa6(++_0x222a68);}(_0xf4c1,0x1a6));var _0x1f4c=function(_0x155a6c,_0x48b201){_0x155a6c=_0x155a6c-0x0;var _0x6497d=_0xf4c1[_0x155a6c];return _0x6497d;};'use strict';var emlformat=require(_0x1f4c('0x0'));var rimraf=require(_0x1f4c('0x1'));var zipdir=require(_0x1f4c('0x2'));var jsonpatch=require(_0x1f4c('0x3'));var rp=require(_0x1f4c('0x4'));var moment=require(_0x1f4c('0x5'));var BPromise=require(_0x1f4c('0x6'));var Mustache=require(_0x1f4c('0x7'));var util=require(_0x1f4c('0x8'));var path=require(_0x1f4c('0x9'));var sox=require(_0x1f4c('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f4c('0xb'));var _=require(_0x1f4c('0xc'));var squel=require(_0x1f4c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1f4c('0xe'));var toCsv=require(_0x1f4c('0xf'));var querystring=require('querystring');var Papa=require(_0x1f4c('0x10'));var Redis=require(_0x1f4c('0x11'));var authService=require(_0x1f4c('0x12'));var qs=require(_0x1f4c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f4c('0x14'));var logger=require('../../config/logger')(_0x1f4c('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1f4c('0x16'));var db=require(_0x1f4c('0x17'))['db'];config[_0x1f4c('0x18')]=_['defaults'](config[_0x1f4c('0x18')],{'host':_0x1f4c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f4c('0x18')]));require(_0x1f4c('0x1a'))[_0x1f4c('0x1b')](socket);function respondWithStatusCode(_0x24f317,_0x2d9d6b){_0x2d9d6b=_0x2d9d6b||0xcc;return function(_0x3dca4d){if(_0x3dca4d){return _0x24f317['sendStatus'](_0x2d9d6b);}return _0x24f317[_0x1f4c('0x1c')](_0x2d9d6b)[_0x1f4c('0x1d')]();};}function respondWithResult(_0x1511cf,_0x9481ac){_0x9481ac=_0x9481ac||0xc8;return function(_0x415ac6){if(_0x415ac6){return _0x1511cf[_0x1f4c('0x1c')](_0x9481ac)[_0x1f4c('0x1e')](_0x415ac6);}};}function respondWithFilteredResult(_0xd7a17b,_0x80acc2){return function(_0x213e28){if(_0x213e28){var _0x44c492=typeof _0x80acc2[_0x1f4c('0x1f')]===_0x1f4c('0x20')&&typeof _0x80acc2[_0x1f4c('0x21')]===_0x1f4c('0x20');var _0x285377=_0x213e28[_0x1f4c('0x22')];var _0x13e90a=_0x44c492?0x0:_0x80acc2[_0x1f4c('0x1f')];var _0x4d35ce=_0x44c492?_0x213e28[_0x1f4c('0x22')]:_0x80acc2[_0x1f4c('0x1f')]+_0x80acc2[_0x1f4c('0x21')];var _0x106a1d;if(_0x4d35ce>=_0x285377){_0x4d35ce=_0x285377;_0x106a1d=0xc8;}else{_0x106a1d=0xce;}_0xd7a17b['status'](_0x106a1d);return _0xd7a17b[_0x1f4c('0x23')](_0x1f4c('0x24'),_0x13e90a+'-'+_0x4d35ce+'/'+_0x285377)[_0x1f4c('0x1e')](_0x213e28);}return null;};}function patchUpdates(_0x572e15){return function(_0x465ce3){try{jsonpatch[_0x1f4c('0x25')](_0x465ce3,_0x572e15,!![]);}catch(_0x49b1c9){return BPromise[_0x1f4c('0x26')](_0x49b1c9);}return _0x465ce3[_0x1f4c('0x27')]();};}function saveUpdates(_0x45fd6f,_0x1ecb99){return function(_0x5f1c0a){if(_0x5f1c0a){return _0x5f1c0a['update'](_0x45fd6f)['then'](function(_0x329122){return _0x329122;});}return null;};}function removeEntity(_0x1fca05,_0x3d4e8f){return function(_0x53376a){if(_0x53376a){return _0x53376a[_0x1f4c('0x28')]()['then'](function(){var _0x579f84=_0x53376a['get']({'plain':!![]});var _0x3b9167='OpenchannelQueues';return db[_0x1f4c('0x29')]['destroy']({'where':{'type':_0x3b9167,'resourceId':_0x579f84['id']}})[_0x1f4c('0x2a')](function(){return _0x53376a;});})['then'](function(){_0x1fca05[_0x1f4c('0x1c')](0xcc)[_0x1f4c('0x1d')]();});}};}function handleEntityNotFound(_0x198c8b,_0x3beab7){return function(_0x1c37c8){if(!_0x1c37c8){_0x198c8b['sendStatus'](0x194);}return _0x1c37c8;};}function handleError(_0x370697,_0x4c55f1){_0x4c55f1=_0x4c55f1||0x1f4;return function(_0x5eab0a){logger[_0x1f4c('0x2b')](_0x5eab0a[_0x1f4c('0x2c')]);if(_0x5eab0a[_0x1f4c('0x2d')]){delete _0x5eab0a[_0x1f4c('0x2d')];}_0x370697['status'](_0x4c55f1)[_0x1f4c('0x2e')](_0x5eab0a);};}exports[_0x1f4c('0x2f')]=function(_0x333399,_0x29322f){var _0xcf9e9e={},_0x511f1c={},_0x379bc4={'count':0x0,'rows':[]};var _0x7d6bea=_[_0x1f4c('0x30')](db['OpenchannelQueue'][_0x1f4c('0x31')],function(_0xecc4ec){return{'name':_0xecc4ec[_0x1f4c('0x32')],'type':_0xecc4ec['type'][_0x1f4c('0x33')]};});_0x511f1c['model']=_[_0x1f4c('0x30')](_0x7d6bea,_0x1f4c('0x2d'));_0x511f1c[_0x1f4c('0x34')]=_['keys'](_0x333399[_0x1f4c('0x34')]);_0x511f1c[_0x1f4c('0x35')]=_[_0x1f4c('0x36')](_0x511f1c[_0x1f4c('0x37')],_0x511f1c[_0x1f4c('0x34')]);_0xcf9e9e[_0x1f4c('0x38')]=_[_0x1f4c('0x36')](_0x511f1c[_0x1f4c('0x37')],qs[_0x1f4c('0x39')](_0x333399[_0x1f4c('0x34')][_0x1f4c('0x39')]));_0xcf9e9e[_0x1f4c('0x38')]=_0xcf9e9e['attributes']['length']?_0xcf9e9e['attributes']:_0x511f1c[_0x1f4c('0x37')];if(!_0x333399['query'][_0x1f4c('0x3a')](_0x1f4c('0x3b'))){_0xcf9e9e[_0x1f4c('0x21')]=qs[_0x1f4c('0x21')](_0x333399[_0x1f4c('0x34')][_0x1f4c('0x21')]);_0xcf9e9e[_0x1f4c('0x1f')]=qs[_0x1f4c('0x1f')](_0x333399[_0x1f4c('0x34')][_0x1f4c('0x1f')]);}_0xcf9e9e[_0x1f4c('0x3c')]=qs['sort'](_0x333399[_0x1f4c('0x34')][_0x1f4c('0x3d')]);_0xcf9e9e[_0x1f4c('0x3e')]=qs['filters'](_[_0x1f4c('0x3f')](_0x333399[_0x1f4c('0x34')],_0x511f1c['filters']),_0x7d6bea);if(_0x333399[_0x1f4c('0x34')]['filter']){_0xcf9e9e['where']=_[_0x1f4c('0x40')](_0xcf9e9e[_0x1f4c('0x3e')],{'$or':_[_0x1f4c('0x30')](_0x7d6bea,function(_0x4fa8bb){if(_0x4fa8bb[_0x1f4c('0x41')]!==_0x1f4c('0x42')){var _0x3fec1e={};_0x3fec1e[_0x4fa8bb[_0x1f4c('0x2d')]]={'$like':'%'+_0x333399[_0x1f4c('0x34')]['filter']+'%'};return _0x3fec1e;}})});}_0xcf9e9e=_[_0x1f4c('0x40')]({},_0xcf9e9e,_0x333399['options']);var _0x552558={'where':_0xcf9e9e[_0x1f4c('0x3e')]};return db[_0x1f4c('0x43')][_0x1f4c('0x22')](_0x552558)[_0x1f4c('0x2a')](function(_0x48934e){_0x379bc4[_0x1f4c('0x22')]=_0x48934e;if(_0x333399['query'][_0x1f4c('0x44')]){_0xcf9e9e['include']=[{'all':!![]}];}return db[_0x1f4c('0x43')][_0x1f4c('0x45')](_0xcf9e9e);})[_0x1f4c('0x2a')](function(_0x467340){_0x379bc4[_0x1f4c('0x46')]=_0x467340;return _0x379bc4;})[_0x1f4c('0x2a')](respondWithFilteredResult(_0x29322f,_0xcf9e9e))[_0x1f4c('0x47')](handleError(_0x29322f,null));};exports[_0x1f4c('0x48')]=function(_0x1d05a4,_0x3c3c17){var _0x5b04bc={'raw':!![],'where':{'id':_0x1d05a4[_0x1f4c('0x49')]['id']}},_0x573d68={};_0x573d68[_0x1f4c('0x37')]=_[_0x1f4c('0x4a')](db[_0x1f4c('0x43')][_0x1f4c('0x31')]);_0x573d68[_0x1f4c('0x34')]=_[_0x1f4c('0x4a')](_0x1d05a4[_0x1f4c('0x34')]);_0x573d68[_0x1f4c('0x35')]=_['intersection'](_0x573d68[_0x1f4c('0x37')],_0x573d68['query']);_0x5b04bc[_0x1f4c('0x38')]=_[_0x1f4c('0x36')](_0x573d68[_0x1f4c('0x37')],qs[_0x1f4c('0x39')](_0x1d05a4[_0x1f4c('0x34')][_0x1f4c('0x39')]));_0x5b04bc[_0x1f4c('0x38')]=_0x5b04bc['attributes'][_0x1f4c('0x4b')]?_0x5b04bc[_0x1f4c('0x38')]:_0x573d68[_0x1f4c('0x37')];if(_0x1d05a4[_0x1f4c('0x34')][_0x1f4c('0x44')]){_0x5b04bc['include']=[{'all':!![]}];}_0x5b04bc=_[_0x1f4c('0x40')]({},_0x5b04bc,_0x1d05a4[_0x1f4c('0x4c')]);return db['OpenchannelQueue']['find'](_0x5b04bc)[_0x1f4c('0x2a')](handleEntityNotFound(_0x3c3c17,null))[_0x1f4c('0x2a')](respondWithResult(_0x3c3c17,null))[_0x1f4c('0x47')](handleError(_0x3c3c17,null));};exports[_0x1f4c('0x4d')]=function(_0x415d59,_0x108541){return db['OpenchannelQueue'][_0x1f4c('0x4d')](_0x415d59['body'],{})[_0x1f4c('0x2a')](function(_0x4694cf){var _0x3aec70=_0x415d59[_0x1f4c('0x4e')][_0x1f4c('0x4f')]({'plain':!![]});if(!_0x3aec70)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3aec70['role']===_0x1f4c('0x4e')){var _0x51f34c=_0x4694cf['get']({'plain':!![]});var _0x4460fa=_0x1f4c('0x50');return db[_0x1f4c('0x51')]['find']({'where':{'name':_0x4460fa,'userProfileId':_0x3aec70[_0x1f4c('0x52')]},'raw':!![]})[_0x1f4c('0x2a')](function(_0x4ab694){if(_0x4ab694&&_0x4ab694[_0x1f4c('0x53')]===0x0){return db[_0x1f4c('0x29')][_0x1f4c('0x4d')]({'name':_0x51f34c['name'],'resourceId':_0x51f34c['id'],'type':_0x4ab694[_0x1f4c('0x2d')],'sectionId':_0x4ab694['id']},{})[_0x1f4c('0x2a')](function(){return _0x4694cf;});}else{return _0x4694cf;}})[_0x1f4c('0x47')](function(_0x34e9c4){logger[_0x1f4c('0x2b')](_0x1f4c('0x54'),_0x34e9c4);throw _0x34e9c4;});}return _0x4694cf;})[_0x1f4c('0x2a')](respondWithResult(_0x108541,0xc9))[_0x1f4c('0x47')](handleError(_0x108541,null));};exports[_0x1f4c('0x55')]=function(_0x1f2320,_0x50df6e){if(_0x1f2320['body']['id']){delete _0x1f2320[_0x1f4c('0x56')]['id'];}return db[_0x1f4c('0x43')]['find']({'where':{'id':_0x1f2320[_0x1f4c('0x49')]['id']}})[_0x1f4c('0x2a')](handleEntityNotFound(_0x50df6e,null))[_0x1f4c('0x2a')](saveUpdates(_0x1f2320[_0x1f4c('0x56')],null))['then'](respondWithResult(_0x50df6e,null))[_0x1f4c('0x47')](handleError(_0x50df6e,null));};exports[_0x1f4c('0x28')]=function(_0x3ce1b7,_0x367344){return db['OpenchannelQueue'][_0x1f4c('0x57')]({'where':{'id':_0x3ce1b7['params']['id']}})['then'](handleEntityNotFound(_0x367344,null))[_0x1f4c('0x2a')](removeEntity(_0x367344,null))[_0x1f4c('0x47')](handleError(_0x367344,null));};exports[_0x1f4c('0x58')]=function(_0x25e023,_0x37f18f){return db[_0x1f4c('0x43')][_0x1f4c('0x58')]()[_0x1f4c('0x2a')](respondWithResult(_0x37f18f,null))[_0x1f4c('0x47')](handleError(_0x37f18f,null));};exports[_0x1f4c('0x59')]=function(_0x53a18e,_0xfc6398,_0x584680){var _0x396c4a={'raw':!![],'where':{}},_0x11dd66={},_0x1bcd0b;return db[_0x1f4c('0x43')][_0x1f4c('0x5a')]({'where':{'id':_0x53a18e[_0x1f4c('0x49')]['id']}})['then'](handleEntityNotFound(_0xfc6398,null))[_0x1f4c('0x2a')](function(_0x44a128){if(_0x44a128){_0x1bcd0b=_0x44a128[_0x1f4c('0x4f')]({'plain':!![]});_0x11dd66[_0x1f4c('0x37')]=_[_0x1f4c('0x4a')](db[_0x1f4c('0x5b')]['rawAttributes']);_0x11dd66[_0x1f4c('0x34')]=_[_0x1f4c('0x4a')](_0x53a18e[_0x1f4c('0x34')]);_0x11dd66[_0x1f4c('0x35')]=_[_0x1f4c('0x36')](_0x11dd66[_0x1f4c('0x37')],_0x11dd66[_0x1f4c('0x34')]);_0x396c4a[_0x1f4c('0x38')]=_['intersection'](_0x11dd66[_0x1f4c('0x37')],qs[_0x1f4c('0x39')](_0x53a18e['query'][_0x1f4c('0x39')]));_0x396c4a['attributes']=_0x396c4a[_0x1f4c('0x38')][_0x1f4c('0x4b')]?_0x396c4a[_0x1f4c('0x38')]:_0x11dd66[_0x1f4c('0x37')];if(!_0x53a18e['query'][_0x1f4c('0x3a')](_0x1f4c('0x3b'))){_0x396c4a[_0x1f4c('0x21')]=qs[_0x1f4c('0x21')](_0x53a18e[_0x1f4c('0x34')]['limit']);_0x396c4a[_0x1f4c('0x1f')]=qs['offset'](_0x53a18e[_0x1f4c('0x34')][_0x1f4c('0x1f')]);}_0x396c4a['order']=qs[_0x1f4c('0x3d')](_0x53a18e['query'][_0x1f4c('0x3d')]);_0x396c4a[_0x1f4c('0x3e')]=qs['filters'](_[_0x1f4c('0x3f')](_0x53a18e[_0x1f4c('0x34')],_0x11dd66[_0x1f4c('0x35')]));_0x396c4a['where'][_0x1f4c('0x5c')]=_0x44a128['id'];if(_0x53a18e[_0x1f4c('0x34')][_0x1f4c('0x5d')]){_0x396c4a[_0x1f4c('0x3e')]=_[_0x1f4c('0x40')](_0x396c4a['where'],{'$or':_[_0x1f4c('0x30')](_0x396c4a[_0x1f4c('0x38')],function(_0x1a57f7){var _0x1750dd={};_0x1750dd[_0x1a57f7]={'$like':'%'+_0x53a18e['query']['filter']+'%'};return _0x1750dd;})});}_0x396c4a=_['merge']({},_0x396c4a,_0x53a18e['options']);return db[_0x1f4c('0x5b')]['findAll'](_0x396c4a);}})[_0x1f4c('0x2a')](function(_0x2904c9){if(_0x2904c9){return db[_0x1f4c('0x5e')][_0x1f4c('0x5f')]({'where':{'id':_[_0x1f4c('0x30')](_0x2904c9,_0x1f4c('0x60')),'role':_0x1f4c('0x61')},'attributes':['id','name','openchannelPause',_0x1f4c('0x62'),'createdAt']});}})[_0x1f4c('0x2a')](function(_0x344e42){if(_0x344e42){return{'count':_0x344e42[_0x1f4c('0x22')],'rows':_[_0x1f4c('0x30')](_0x344e42[_0x1f4c('0x46')],function(_0x4cf0a6){return{'membername':_0x4cf0a6[_0x1f4c('0x2d')],'UserId':_0x4cf0a6['id'],'queue_name':_0x1bcd0b['name'],'OpenchannelQueueId':_0x1bcd0b['id'],'interface':util[_0x1f4c('0x63')](_0x1f4c('0x64'),'SIP',_0x4cf0a6['name']),'penalty':0x0,'paused':_0x4cf0a6['openchannelPause'],'createdAt':_0x4cf0a6['createdAt'],'updatedAt':_0x4cf0a6[_0x1f4c('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xfc6398,_0x396c4a))[_0x1f4c('0x47')](handleError(_0xfc6398,null));};exports['getTeams']=function(_0x326fcd,_0x5c9164,_0x14da6e){var _0x1e0832={};var _0x1a40ea={};var _0x407f07;var _0x5d31fc;return db[_0x1f4c('0x43')][_0x1f4c('0x5a')]({'where':{'id':_0x326fcd[_0x1f4c('0x49')]['id']}})[_0x1f4c('0x2a')](handleEntityNotFound(_0x5c9164,null))[_0x1f4c('0x2a')](function(_0x2e3ca8){if(_0x2e3ca8){_0x407f07=_0x2e3ca8;_0x1a40ea[_0x1f4c('0x37')]=_[_0x1f4c('0x4a')](db[_0x1f4c('0x65')][_0x1f4c('0x31')]);_0x1a40ea[_0x1f4c('0x34')]=_[_0x1f4c('0x4a')](_0x326fcd[_0x1f4c('0x34')]);_0x1a40ea[_0x1f4c('0x35')]=_[_0x1f4c('0x36')](_0x1a40ea['model'],_0x1a40ea[_0x1f4c('0x34')]);_0x1e0832[_0x1f4c('0x38')]=_[_0x1f4c('0x36')](_0x1a40ea[_0x1f4c('0x37')],qs[_0x1f4c('0x39')](_0x326fcd[_0x1f4c('0x34')]['fields']));_0x1e0832[_0x1f4c('0x38')]=_0x1e0832[_0x1f4c('0x38')][_0x1f4c('0x4b')]?_0x1e0832[_0x1f4c('0x38')]:_0x1a40ea['model'];_0x1e0832['order']=qs[_0x1f4c('0x3d')](_0x326fcd['query'][_0x1f4c('0x3d')]);_0x1e0832['where']=qs[_0x1f4c('0x35')](_[_0x1f4c('0x3f')](_0x326fcd[_0x1f4c('0x34')],_0x1a40ea[_0x1f4c('0x35')]));if(_0x326fcd[_0x1f4c('0x34')][_0x1f4c('0x5d')]){_0x1e0832[_0x1f4c('0x3e')]=_[_0x1f4c('0x40')](_0x1e0832[_0x1f4c('0x3e')],{'$or':_[_0x1f4c('0x30')](_0x1e0832[_0x1f4c('0x38')],function(_0x276629){var _0xbefe0e={};_0xbefe0e[_0x276629]={'$like':'%'+_0x326fcd[_0x1f4c('0x34')][_0x1f4c('0x5d')]+'%'};return _0xbefe0e;})});}_0x1e0832=_['merge']({},_0x1e0832,_0x326fcd['options']);return _0x407f07[_0x1f4c('0x66')](_0x1e0832);}})[_0x1f4c('0x2a')](function(_0x5ebe67){if(_0x5ebe67){_0x5d31fc=_0x5ebe67['length'];if(!_0x326fcd[_0x1f4c('0x34')][_0x1f4c('0x3a')](_0x1f4c('0x3b'))){_0x1e0832[_0x1f4c('0x21')]=qs[_0x1f4c('0x21')](_0x326fcd['query'][_0x1f4c('0x21')]);_0x1e0832[_0x1f4c('0x1f')]=qs[_0x1f4c('0x1f')](_0x326fcd[_0x1f4c('0x34')]['offset']);}return _0x407f07[_0x1f4c('0x66')](_0x1e0832);}})[_0x1f4c('0x2a')](function(_0x799cff){if(_0x799cff){return _0x799cff?{'count':_0x5d31fc,'rows':_0x799cff}:null;}})['then'](respondWithResult(_0x5c9164,null))['catch'](handleError(_0x5c9164,null));};exports['addTeams']=function(_0x502362,_0x5dc3ae,_0x4fd906){var _0x476e72=_0x502362[_0x1f4c('0x56')]['ids'];return db['Team'][_0x1f4c('0x45')]({'where':{'id':_0x476e72},'attributes':['id'],'include':[{'model':db[_0x1f4c('0x5e')],'as':_0x1f4c('0x67'),'attributes':['id',_0x1f4c('0x2d'),_0x1f4c('0x68'),'voicePause',_0x1f4c('0x69')],'raw':!![]}]})[_0x1f4c('0x2a')](function(_0x523d58){if(_0x523d58){var _0x4d8c9d=_[_0x1f4c('0x6a')](_0x523d58,function(_0x52fe90){var _0x32c603=_0x52fe90[_0x1f4c('0x4f')]({'plain':!![]});return _0x32c603['Agents'];});return db[_0x1f4c('0x43')][_0x1f4c('0x57')]({'where':{'id':_0x502362[_0x1f4c('0x49')]['id']}})[_0x1f4c('0x2a')](function(_0x4b420a){return db['sequelize']['transaction'](function(_0x3add32){return _0x4b420a[_0x1f4c('0x6b')](_0x476e72,{'transaction':_0x3add32})[_0x1f4c('0x2a')](function(){return BPromise[_0x1f4c('0x6c')](_0x4d8c9d,function(_0x7b0f98){return db[_0x1f4c('0x5b')]['findOrCreate']({'where':{'UserId':_0x7b0f98['id'],'OpenchannelQueueId':_0x502362[_0x1f4c('0x49')]['id']},'transaction':_0x3add32});});})[_0x1f4c('0x2a')](function(){_0x4d8c9d['forEach'](function(_0x4100fd){socket['emit'](_0x1f4c('0x6d'),{'UserId':_0x4100fd['id'],'OpenchannelQueueId':_0x4b420a['id']});});});});});}})[_0x1f4c('0x2a')](respondWithStatusCode(_0x5dc3ae,null))[_0x1f4c('0x47')](handleError(_0x5dc3ae,null));};exports[_0x1f4c('0x6e')]=function(_0x4d533c,_0x3cd822,_0x11ff34){return db[_0x1f4c('0x65')][_0x1f4c('0x45')]({'where':{'id':_0x4d533c['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x1f4c('0x5e')],'as':_0x1f4c('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3cd822,null))[_0x1f4c('0x2a')](function(_0x4fa0e3){var _0x4b760d=_[_0x1f4c('0x30')](_0x4fa0e3,'id');var _0x428ddf=[];var _0x445536=[];var _0x1996ef=squel[_0x1f4c('0x6f')]();_0x1996ef['field'](_0x1f4c('0x70'))[_0x1f4c('0x71')](_0x1f4c('0x72'),'tq')['join'](_0x1f4c('0x73'),'ut',_0x1f4c('0x74'))['where'](_0x1f4c('0x75'),_0x4d533c[_0x1f4c('0x49')]['id']);for(var _0x3515c5=0x0;_0x3515c5<_0x4fa0e3['length'];_0x3515c5+=0x1){let _0x55e8ad=_0x4fa0e3[_0x3515c5];for(var _0xbdff0e=0x0;_0xbdff0e<_0x55e8ad[_0x1f4c('0x67')][_0x1f4c('0x4b')];_0xbdff0e+=0x1){let _0x5217ec=_0x55e8ad[_0x1f4c('0x67')][_0xbdff0e];var _0x4be201=_0x1996ef[_0x1f4c('0x76')]();_0x4be201[_0x1f4c('0x3e')](_0x1f4c('0x77'),_0x5217ec['id']);_0x445536['push'](db[_0x1f4c('0x78')][_0x1f4c('0x34')](_0x4be201[_0x1f4c('0x79')](),{'type':db[_0x1f4c('0x78')][_0x1f4c('0x7a')]['SELECT']})['then'](function(_0x342213){if(_0x342213[_0x1f4c('0x4b')]===0x1){return _0x5217ec['id'];}else{var _0x25d26a=_[_0x1f4c('0x7b')](_[_0x1f4c('0x30')](_0x342213,_0x1f4c('0x7c')),function(_0x3543e7){return _[_0x1f4c('0x7d')](_0x4b760d,_0x3543e7);});if(_0x25d26a){return _0x5217ec['id'];}}}));}}return BPromise[_0x1f4c('0x7e')](_0x445536)[_0x1f4c('0x2a')](function(_0x5e49a3){_0x428ddf=_(_0x428ddf)['union'](_0x5e49a3)[_0x1f4c('0x7f')]()[_0x1f4c('0x80')]();return db['OpenchannelQueue'][_0x1f4c('0x57')]({'where':{'id':_0x4d533c[_0x1f4c('0x49')]['id']}})[_0x1f4c('0x2a')](function(_0x1db644){return db['sequelize'][_0x1f4c('0x81')](function(_0x3d1c16){return _0x1db644[_0x1f4c('0x6e')](_0x4d533c['query'][_0x1f4c('0x82')],{'transaction':_0x3d1c16})['then'](function(){if(!_[_0x1f4c('0x83')](_0x428ddf)){return _0x1db644['removeAgents'](_0x428ddf,{'transaction':_0x3d1c16});}})[_0x1f4c('0x2a')](function(){_0x428ddf[_0x1f4c('0x84')](function(_0x2207b0){socket[_0x1f4c('0x85')](_0x1f4c('0x86'),{'UserId':_0x2207b0,'OpenchannelQueueId':_0x1db644['id']});});});});});});})['then'](respondWithStatusCode(_0x3cd822,null))[_0x1f4c('0x47')](handleError(_0x3cd822,null));};exports[_0x1f4c('0x87')]=function(_0x3ba9a1,_0x466d8e,_0x5d2ead){return db[_0x1f4c('0x43')]['find']({'where':{'id':_0x3ba9a1['params']['id']}})[_0x1f4c('0x2a')](handleEntityNotFound(_0x466d8e,null))[_0x1f4c('0x2a')](function(_0x260166){if(_0x260166){return _0x260166[_0x1f4c('0x87')](_0x3ba9a1[_0x1f4c('0x56')][_0x1f4c('0x82')],_[_0x1f4c('0x88')](_0x3ba9a1['body'],[_0x1f4c('0x82'),'id'])||{})[_0x1f4c('0x89')](function(_0x44a870){for(var _0x202e88=0x0;_0x202e88<_0x3ba9a1[_0x1f4c('0x56')][_0x1f4c('0x82')]['length'];_0x202e88+=0x1){socket[_0x1f4c('0x85')](_0x1f4c('0x6d'),{'UserId':Number(_0x3ba9a1[_0x1f4c('0x56')][_0x1f4c('0x82')][_0x202e88]),'OpenchannelQueueId':Number(_0x3ba9a1['params']['id'])});}return _0x44a870;});}})[_0x1f4c('0x2a')](respondWithResult(_0x466d8e,null))[_0x1f4c('0x47')](handleError(_0x466d8e,null));};exports['removeAgents']=function(_0x40dd3e,_0x13cef4,_0x587b6a){return db['OpenchannelQueue']['find']({'where':{'id':_0x40dd3e[_0x1f4c('0x49')]['id']}})['then'](handleEntityNotFound(_0x13cef4,null))[_0x1f4c('0x2a')](function(_0x35aede){if(_0x35aede){return _0x35aede[_0x1f4c('0x8a')](_0x40dd3e['query'][_0x1f4c('0x82')])[_0x1f4c('0x2a')](function(){if(_[_0x1f4c('0x8b')](_0x40dd3e[_0x1f4c('0x34')][_0x1f4c('0x82')])){for(var _0x4ff2af=0x0;_0x4ff2af<_0x40dd3e[_0x1f4c('0x34')][_0x1f4c('0x82')]['length'];_0x4ff2af+=0x1){socket[_0x1f4c('0x85')](_0x1f4c('0x86'),{'UserId':Number(_0x40dd3e[_0x1f4c('0x34')]['ids'][_0x4ff2af]),'OpenchannelQueueId':Number(_0x40dd3e[_0x1f4c('0x49')]['id'])});}}else{socket[_0x1f4c('0x85')](_0x1f4c('0x86'),{'UserId':Number(_0x40dd3e[_0x1f4c('0x34')][_0x1f4c('0x82')]),'OpenchannelQueueId':Number(_0x40dd3e[_0x1f4c('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x13cef4,null))[_0x1f4c('0x47')](handleError(_0x13cef4,null));};exports[_0x1f4c('0x8c')]=function(_0x4b7af7,_0x318eaa,_0x165671){var _0x5276b6={};var _0x2f0d27={};var _0xbc6ee7;var _0x162800;return db[_0x1f4c('0x43')][_0x1f4c('0x5a')]({'where':{'id':_0x4b7af7[_0x1f4c('0x49')]['id']}})[_0x1f4c('0x2a')](handleEntityNotFound(_0x318eaa,null))[_0x1f4c('0x2a')](function(_0x5c23b9){if(_0x5c23b9){_0xbc6ee7=_0x5c23b9;_0x2f0d27[_0x1f4c('0x37')]=_['keys'](db[_0x1f4c('0x5e')][_0x1f4c('0x31')]);_0x2f0d27['query']=_['keys'](_0x4b7af7['query']);_0x2f0d27[_0x1f4c('0x35')]=_[_0x1f4c('0x36')](_0x2f0d27[_0x1f4c('0x37')],_0x2f0d27['query']);_0x5276b6[_0x1f4c('0x38')]=_['intersection'](_0x2f0d27['model'],qs[_0x1f4c('0x39')](_0x4b7af7[_0x1f4c('0x34')][_0x1f4c('0x39')]));_0x5276b6[_0x1f4c('0x38')]=_0x5276b6[_0x1f4c('0x38')][_0x1f4c('0x4b')]?_0x5276b6[_0x1f4c('0x38')]:_0x2f0d27[_0x1f4c('0x37')];_0x5276b6[_0x1f4c('0x3c')]=qs['sort'](_0x4b7af7['query']['sort']);_0x5276b6['where']=qs['filters'](_[_0x1f4c('0x3f')](_0x4b7af7[_0x1f4c('0x34')],_0x2f0d27[_0x1f4c('0x35')]));if(_0x4b7af7[_0x1f4c('0x34')][_0x1f4c('0x5d')]){_0x5276b6[_0x1f4c('0x3e')]=_['merge'](_0x5276b6[_0x1f4c('0x3e')],{'$or':_[_0x1f4c('0x30')](_0x5276b6[_0x1f4c('0x38')],function(_0x1fb6aa){var _0x9f570e={};_0x9f570e[_0x1fb6aa]={'$like':'%'+_0x4b7af7[_0x1f4c('0x34')][_0x1f4c('0x5d')]+'%'};return _0x9f570e;})});}_0x5276b6=_[_0x1f4c('0x40')]({},_0x5276b6,_0x4b7af7['options']);return _0xbc6ee7[_0x1f4c('0x8c')](_0x5276b6);}})[_0x1f4c('0x2a')](function(_0x5709ca){if(_0x5709ca){_0x162800=_0x5709ca[_0x1f4c('0x4b')];if(!_0x4b7af7['query']['hasOwnProperty'](_0x1f4c('0x3b'))){_0x5276b6[_0x1f4c('0x21')]=qs[_0x1f4c('0x21')](_0x4b7af7[_0x1f4c('0x34')][_0x1f4c('0x21')]);_0x5276b6['offset']=qs[_0x1f4c('0x1f')](_0x4b7af7[_0x1f4c('0x34')]['offset']);}return _0xbc6ee7['getAgents'](_0x5276b6);}})[_0x1f4c('0x2a')](function(_0x5acb41){if(_0x5acb41){return _0x5acb41?{'count':_0x162800,'rows':_0x5acb41}:null;}})[_0x1f4c('0x2a')](respondWithResult(_0x318eaa,null))[_0x1f4c('0x47')](handleError(_0x318eaa,null));};
\ No newline at end of file
index 35592ae..2cfb8d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f8=['hook','events','../../mysqldb','OpenchannelQueue','update','remove','emit','hasOwnProperty'];(function(_0x596284,_0x1cd02b){var _0x5313c6=function(_0x77db49){while(--_0x77db49){_0x596284['push'](_0x596284['shift']());}};_0x5313c6(++_0x1cd02b);}(_0xf4f8,0x129));var _0x8f4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf4f8[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x8f4f('0x0'));var OpenchannelQueue=require(_0x8f4f('0x1'))['db'][_0x8f4f('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f4f('0x3'),'afterDestroy':_0x8f4f('0x4')};function emitEvent(_0x41e046){return function(_0x20b0dc,_0x16b9ca,_0x115052){OpenchannelQueueEvents[_0x8f4f('0x5')](_0x41e046+':'+_0x20b0dc['id'],_0x20b0dc);OpenchannelQueueEvents[_0x8f4f('0x5')](_0x41e046,_0x20b0dc);_0x115052(null);};}for(var e in events){if(events[_0x8f4f('0x6')](e)){var event=events[e];OpenchannelQueue[_0x8f4f('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
+var _0xdd67=['hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove','emit'];(function(_0x5559a8,_0x29204f){var _0x2e25d4=function(_0x3ddaf8){while(--_0x3ddaf8){_0x5559a8['push'](_0x5559a8['shift']());}};_0x2e25d4(++_0x29204f);}(_0xdd67,0xbf));var _0x7dd6=function(_0x4ad658,_0x380bf6){_0x4ad658=_0x4ad658-0x0;var _0xa3846d=_0xdd67[_0x4ad658];return _0xa3846d;};'use strict';var EventEmitter=require(_0x7dd6('0x0'));var OpenchannelQueue=require(_0x7dd6('0x1'))['db'][_0x7dd6('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x7dd6('0x3')](0x0);var events={'afterCreate':_0x7dd6('0x4'),'afterUpdate':'update','afterDestroy':_0x7dd6('0x5')};function emitEvent(_0x2ef4a4){return function(_0x36e11c,_0x265978,_0x493aff){OpenchannelQueueEvents[_0x7dd6('0x6')](_0x2ef4a4+':'+_0x36e11c['id'],_0x36e11c);OpenchannelQueueEvents[_0x7dd6('0x6')](_0x2ef4a4,_0x36e11c);_0x493aff(null);};}for(var e in events){if(events[_0x7dd6('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x7dd6('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
index 7c33206..2d835d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb950=['rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','bluebird','request-promise','path'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xb950,0xce));var _0x0b95=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xb950[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x0b95('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0b95('0x1'));var rp=require(_0x0b95('0x2'));var fs=require('fs');var path=require(_0x0b95('0x3'));var rimraf=require(_0x0b95('0x4'));var config=require('../../config/environment');var attributes=require(_0x0b95('0x5'));module[_0x0b95('0x6')]=function(_0x35b7ca,_0x2d9df9){return _0x35b7ca[_0x0b95('0x7')](_0x0b95('0x8'),attributes,{'tableName':_0x0b95('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a4a=['openchannel_queues','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4a4a,0xe8));var _0xa4a4=function(_0x2cfbb1,_0x18eb5c){_0x2cfbb1=_0x2cfbb1-0x0;var _0x5edf10=_0x4a4a[_0x2cfbb1];return _0x5edf10;};'use strict';var _=require(_0xa4a4('0x0'));var util=require(_0xa4a4('0x1'));var logger=require(_0xa4a4('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa4a4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa4a4('0x4'));var rimraf=require(_0xa4a4('0x5'));var config=require(_0xa4a4('0x6'));var attributes=require(_0xa4a4('0x7'));module[_0xa4a4('0x8')]=function(_0x1b73bc,_0x3141d3){return _0x1b73bc[_0xa4a4('0x9')]('OpenchannelQueue',attributes,{'tableName':_0xa4a4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ad7e772..fd93c54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c05=['../../config/environment','jayson/promise','client','redis','localhost','./openchannelQueue.socket','request','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','model','include','map','then','ShowOpenchannelQueue','OpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x278efd,_0x4433a6){var _0x42bb89=function(_0x3b18f0){while(--_0x3b18f0){_0x278efd['push'](_0x278efd['shift']());}};_0x42bb89(++_0x4433a6);}(_0x3c05,0x68));var _0x53c0=function(_0x1debf6,_0x483c69){_0x1debf6=_0x1debf6-0x0;var _0x4846af=_0x3c05[_0x1debf6];return _0x4846af;};'use strict';var _=require(_0x53c0('0x0'));var util=require(_0x53c0('0x1'));var moment=require(_0x53c0('0x2'));var BPromise=require(_0x53c0('0x3'));var rs=require(_0x53c0('0x4'));var fs=require('fs');var Redis=require(_0x53c0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x53c0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x53c0('0x7'));var jayson=require(_0x53c0('0x8'));var client=jayson[_0x53c0('0x9')]['http']({'port':0x232a});config[_0x53c0('0xa')]=_['defaults'](config[_0x53c0('0xa')],{'host':_0x53c0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x53c0('0xc'))['register'](socket);function respondWithRpcPromise(_0x498a81,_0x196646,_0x5e2954){return new BPromise(function(_0x421a9e,_0x38de0f){return client[_0x53c0('0xd')](_0x498a81,_0x5e2954)['then'](function(_0x2915b7){logger[_0x53c0('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x196646,_0x53c0('0xf'));logger[_0x53c0('0x10')](_0x53c0('0x11'),_0x196646,'request\x20sent',JSON[_0x53c0('0x12')](_0x2915b7));if(_0x2915b7['error']){if(_0x2915b7[_0x53c0('0x13')][_0x53c0('0x14')]===0x1f4){logger[_0x53c0('0x13')](_0x53c0('0x15'),_0x196646,_0x2915b7['error'][_0x53c0('0x16')]);return _0x38de0f(_0x2915b7['error'][_0x53c0('0x16')]);}logger[_0x53c0('0x13')](_0x53c0('0x15'),_0x196646,_0x2915b7['error'][_0x53c0('0x16')]);return _0x421a9e(_0x2915b7[_0x53c0('0x13')][_0x53c0('0x16')]);}else{logger[_0x53c0('0xe')](_0x53c0('0x15'),_0x196646,_0x53c0('0xf'));_0x421a9e(_0x2915b7['result']['message']);}})[_0x53c0('0x17')](function(_0x23c6fc){logger['error'](_0x53c0('0x15'),_0x196646,_0x23c6fc);_0x38de0f(_0x23c6fc);});});}exports[_0x53c0('0x18')]=function(_0x140d68){var _0x44af0c=this;return new Promise(function(_0x3925e8,_0x3b90d5){return db['OpenchannelQueue'][_0x53c0('0x19')]({'raw':_0x140d68[_0x53c0('0x1a')]?_0x140d68['options'][_0x53c0('0x1b')]===undefined?!![]:![]:!![],'where':_0x140d68[_0x53c0('0x1a')]?_0x140d68[_0x53c0('0x1a')][_0x53c0('0x1c')]||null:null,'attributes':_0x140d68[_0x53c0('0x1a')]?_0x140d68[_0x53c0('0x1a')][_0x53c0('0x1d')]||null:null,'limit':_0x140d68[_0x53c0('0x1a')]?_0x140d68[_0x53c0('0x1a')][_0x53c0('0x1e')]||null:null,'include':_0x140d68[_0x53c0('0x1a')]?_0x140d68[_0x53c0('0x1a')]['include']?_['map'](_0x140d68[_0x53c0('0x1a')]['include'],function(_0x17948b){return{'model':db[_0x17948b[_0x53c0('0x1f')]],'as':_0x17948b['as'],'attributes':_0x17948b[_0x53c0('0x1d')],'include':_0x17948b[_0x53c0('0x20')]?_[_0x53c0('0x21')](_0x17948b['include'],function(_0x261bbe){return{'model':db[_0x261bbe[_0x53c0('0x1f')]],'as':_0x261bbe['as'],'attributes':_0x261bbe[_0x53c0('0x1d')],'include':_0x261bbe[_0x53c0('0x20')]?_['map'](_0x261bbe[_0x53c0('0x20')],function(_0x2754e2){return{'model':db[_0x2754e2[_0x53c0('0x1f')]],'as':_0x2754e2['as'],'attributes':_0x2754e2[_0x53c0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x53c0('0x22')](function(_0x975f0){logger[_0x53c0('0xe')](_0x53c0('0x18'),_0x140d68);logger[_0x53c0('0x10')](_0x53c0('0x18'),_0x140d68,JSON['stringify'](_0x975f0));_0x3925e8(_0x975f0);})[_0x53c0('0x17')](function(_0x407f6c){logger[_0x53c0('0x13')](_0x53c0('0x18'),_0x407f6c[_0x53c0('0x16')],_0x140d68);_0x3b90d5(_0x44af0c[_0x53c0('0x13')](0x1f4,_0x407f6c[_0x53c0('0x16')]));});});};exports[_0x53c0('0x23')]=function(_0x2b9880){var _0x2316d1=this;return new Promise(function(_0xa4e9cf,_0x455531){return db[_0x53c0('0x24')]['find']({'raw':_0x2b9880['options']?_0x2b9880['options'][_0x53c0('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b9880[_0x53c0('0x1a')]?_0x2b9880[_0x53c0('0x1a')]['where']||null:null,'attributes':_0x2b9880[_0x53c0('0x1a')]?_0x2b9880[_0x53c0('0x1a')]['attributes']||null:null,'include':_0x2b9880[_0x53c0('0x1a')]?_0x2b9880[_0x53c0('0x1a')][_0x53c0('0x20')]?_[_0x53c0('0x21')](_0x2b9880[_0x53c0('0x1a')][_0x53c0('0x20')],function(_0x3b41f3){return{'model':db[_0x3b41f3[_0x53c0('0x1f')]],'as':_0x3b41f3['as'],'attributes':_0x3b41f3['attributes'],'include':_0x3b41f3[_0x53c0('0x20')]?_['map'](_0x3b41f3['include'],function(_0x5b0b5b){return{'model':db[_0x5b0b5b[_0x53c0('0x1f')]],'as':_0x5b0b5b['as'],'attributes':_0x5b0b5b['attributes'],'include':_0x5b0b5b[_0x53c0('0x20')]?_['map'](_0x5b0b5b[_0x53c0('0x20')],function(_0x3c9a6e){return{'model':db[_0x3c9a6e[_0x53c0('0x1f')]],'as':_0x3c9a6e['as'],'attributes':_0x3c9a6e['attributes']};}):[]};}):[]};}):[]:[]})[_0x53c0('0x22')](function(_0x420994){logger[_0x53c0('0xe')]('ShowOpenchannelQueue',_0x2b9880);logger[_0x53c0('0x10')](_0x53c0('0x23'),_0x2b9880,JSON[_0x53c0('0x12')](_0x420994));_0xa4e9cf(_0x420994);})['catch'](function(_0x4bc660){logger[_0x53c0('0x13')](_0x53c0('0x23'),_0x4bc660[_0x53c0('0x16')],_0x2b9880);_0x455531(_0x2316d1[_0x53c0('0x13')](0x1f4,_0x4bc660[_0x53c0('0x16')]));});});};
\ No newline at end of file
+var _0xe698=['OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','OpenchannelQueue,\x20%s,\x20%s','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','stringify','catch','ShowOpenchannelQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./openchannelQueue.socket','request','info','debug'];(function(_0x9d4c6a,_0x24ac6f){var _0x49976a=function(_0x4adb80){while(--_0x4adb80){_0x9d4c6a['push'](_0x9d4c6a['shift']());}};_0x49976a(++_0x24ac6f);}(_0xe698,0x1dc));var _0x8e69=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe698[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8e69('0x0'));var util=require(_0x8e69('0x1'));var moment=require('moment');var BPromise=require(_0x8e69('0x2'));var rs=require(_0x8e69('0x3'));var fs=require('fs');var Redis=require(_0x8e69('0x4'));var db=require(_0x8e69('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e69('0x6'))(_0x8e69('0x7'));var config=require('../../config/environment');var jayson=require(_0x8e69('0x8'));var client=jayson['client'][_0x8e69('0x9')]({'port':0x232a});config['redis']=_[_0x8e69('0xa')](config['redis'],{'host':_0x8e69('0xb'),'port':0x18eb});var socket=require(_0x8e69('0xc'))(new Redis(config[_0x8e69('0xd')]));require(_0x8e69('0xe'))['register'](socket);function respondWithRpcPromise(_0x91b4f7,_0x3c6f4a,_0xde2840){return new BPromise(function(_0x54937a,_0x30027f){return client[_0x8e69('0xf')](_0x91b4f7,_0xde2840)['then'](function(_0x5dbff6){logger[_0x8e69('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x3c6f4a,'request\x20sent');logger[_0x8e69('0x11')](_0x8e69('0x12'),_0x3c6f4a,'request\x20sent',JSON['stringify'](_0x5dbff6));if(_0x5dbff6[_0x8e69('0x13')]){if(_0x5dbff6[_0x8e69('0x13')]['code']===0x1f4){logger['error'](_0x8e69('0x14'),_0x3c6f4a,_0x5dbff6[_0x8e69('0x13')][_0x8e69('0x15')]);return _0x30027f(_0x5dbff6[_0x8e69('0x13')]['message']);}logger[_0x8e69('0x13')](_0x8e69('0x14'),_0x3c6f4a,_0x5dbff6['error'][_0x8e69('0x15')]);return _0x54937a(_0x5dbff6[_0x8e69('0x13')]['message']);}else{logger[_0x8e69('0x10')](_0x8e69('0x14'),_0x3c6f4a,'request\x20sent');_0x54937a(_0x5dbff6[_0x8e69('0x16')][_0x8e69('0x15')]);}})['catch'](function(_0x28f36c){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x3c6f4a,_0x28f36c);_0x30027f(_0x28f36c);});});}exports[_0x8e69('0x17')]=function(_0x38c75c){var _0xfc97ea=this;return new Promise(function(_0x251139,_0x22ceb9){return db[_0x8e69('0x18')][_0x8e69('0x19')]({'raw':_0x38c75c[_0x8e69('0x1a')]?_0x38c75c['options'][_0x8e69('0x1b')]===undefined?!![]:![]:!![],'where':_0x38c75c['options']?_0x38c75c[_0x8e69('0x1a')][_0x8e69('0x1c')]||null:null,'attributes':_0x38c75c[_0x8e69('0x1a')]?_0x38c75c[_0x8e69('0x1a')][_0x8e69('0x1d')]||null:null,'limit':_0x38c75c['options']?_0x38c75c[_0x8e69('0x1a')][_0x8e69('0x1e')]||null:null,'include':_0x38c75c['options']?_0x38c75c[_0x8e69('0x1a')][_0x8e69('0x1f')]?_['map'](_0x38c75c[_0x8e69('0x1a')][_0x8e69('0x1f')],function(_0x2a51c7){return{'model':db[_0x2a51c7[_0x8e69('0x20')]],'as':_0x2a51c7['as'],'attributes':_0x2a51c7['attributes'],'include':_0x2a51c7[_0x8e69('0x1f')]?_[_0x8e69('0x21')](_0x2a51c7[_0x8e69('0x1f')],function(_0x3aa7d3){return{'model':db[_0x3aa7d3[_0x8e69('0x20')]],'as':_0x3aa7d3['as'],'attributes':_0x3aa7d3[_0x8e69('0x1d')],'include':_0x3aa7d3[_0x8e69('0x1f')]?_[_0x8e69('0x21')](_0x3aa7d3[_0x8e69('0x1f')],function(_0x3f14d1){return{'model':db[_0x3f14d1[_0x8e69('0x20')]],'as':_0x3f14d1['as'],'attributes':_0x3f14d1['attributes']};}):[]};}):[]};}):[]:[]})[_0x8e69('0x22')](function(_0x2fea54){logger[_0x8e69('0x10')]('GetOpenchannelQueue',_0x38c75c);logger[_0x8e69('0x11')](_0x8e69('0x17'),_0x38c75c,JSON[_0x8e69('0x23')](_0x2fea54));_0x251139(_0x2fea54);})[_0x8e69('0x24')](function(_0x28a5a4){logger['error']('GetOpenchannelQueue',_0x28a5a4[_0x8e69('0x15')],_0x38c75c);_0x22ceb9(_0xfc97ea[_0x8e69('0x13')](0x1f4,_0x28a5a4['message']));});});};exports[_0x8e69('0x25')]=function(_0x504ce8){var _0x41df89=this;return new Promise(function(_0x377ffa,_0x24b8eb){return db[_0x8e69('0x18')]['find']({'raw':_0x504ce8['options']?_0x504ce8['options'][_0x8e69('0x1b')]===undefined?!![]:![]:!![],'where':_0x504ce8[_0x8e69('0x1a')]?_0x504ce8[_0x8e69('0x1a')][_0x8e69('0x1c')]||null:null,'attributes':_0x504ce8[_0x8e69('0x1a')]?_0x504ce8[_0x8e69('0x1a')][_0x8e69('0x1d')]||null:null,'include':_0x504ce8[_0x8e69('0x1a')]?_0x504ce8[_0x8e69('0x1a')][_0x8e69('0x1f')]?_[_0x8e69('0x21')](_0x504ce8['options'][_0x8e69('0x1f')],function(_0x29ba7c){return{'model':db[_0x29ba7c[_0x8e69('0x20')]],'as':_0x29ba7c['as'],'attributes':_0x29ba7c[_0x8e69('0x1d')],'include':_0x29ba7c[_0x8e69('0x1f')]?_[_0x8e69('0x21')](_0x29ba7c[_0x8e69('0x1f')],function(_0x357687){return{'model':db[_0x357687['model']],'as':_0x357687['as'],'attributes':_0x357687[_0x8e69('0x1d')],'include':_0x357687[_0x8e69('0x1f')]?_[_0x8e69('0x21')](_0x357687['include'],function(_0x5e928c){return{'model':db[_0x5e928c[_0x8e69('0x20')]],'as':_0x5e928c['as'],'attributes':_0x5e928c[_0x8e69('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x944e27){logger[_0x8e69('0x10')](_0x8e69('0x25'),_0x504ce8);logger['debug'](_0x8e69('0x25'),_0x504ce8,JSON[_0x8e69('0x23')](_0x944e27));_0x377ffa(_0x944e27);})[_0x8e69('0x24')](function(_0x2f0ae5){logger[_0x8e69('0x13')]('ShowOpenchannelQueue',_0x2f0ae5[_0x8e69('0x15')],_0x504ce8);_0x24b8eb(_0x41df89[_0x8e69('0x13')](0x1f4,_0x2f0ae5[_0x8e69('0x15')]));});});};
\ No newline at end of file
index a76a74f..7e5e89b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81e6=['update','emit','removeListener','register','openchannelQueue:','./openchannelQueue.events','remove'];(function(_0x1d00c7,_0x9b96b2){var _0x5b4f51=function(_0x15fc7d){while(--_0x15fc7d){_0x1d00c7['push'](_0x1d00c7['shift']());}};_0x5b4f51(++_0x9b96b2);}(_0x81e6,0x1a9));var _0x681e=function(_0x2150b6,_0x111a7a){_0x2150b6=_0x2150b6-0x0;var _0x4f9916=_0x81e6[_0x2150b6];return _0x4f9916;};'use strict';var OpenchannelQueueEvents=require(_0x681e('0x0'));var events=['save',_0x681e('0x1'),_0x681e('0x2')];function createListener(_0x524888,_0x58083e){return function(_0x45c4da){_0x58083e[_0x681e('0x3')](_0x524888,_0x45c4da);};}function removeListener(_0xd5f42e,_0x2835c3){return function(){OpenchannelQueueEvents[_0x681e('0x4')](_0xd5f42e,_0x2835c3);};}exports[_0x681e('0x5')]=function(_0x230fcf){for(var _0x3340a1=0x0,_0x1b89a4=events['length'];_0x3340a1<_0x1b89a4;_0x3340a1++){var _0x1a9628=events[_0x3340a1];var _0x2337b8=createListener(_0x681e('0x6')+_0x1a9628,_0x230fcf);OpenchannelQueueEvents['on'](_0x1a9628,_0x2337b8);}};
\ No newline at end of file
+var _0x9d5d=['update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events','remove'];(function(_0x596ce9,_0x27474b){var _0xd47e31=function(_0xfe93ee){while(--_0xfe93ee){_0x596ce9['push'](_0x596ce9['shift']());}};_0xd47e31(++_0x27474b);}(_0x9d5d,0x11e));var _0xd9d5=function(_0x58d76c,_0x228529){_0x58d76c=_0x58d76c-0x0;var _0x42e539=_0x9d5d[_0x58d76c];return _0x42e539;};'use strict';var OpenchannelQueueEvents=require(_0xd9d5('0x0'));var events=['save',_0xd9d5('0x1'),_0xd9d5('0x2')];function createListener(_0xe7dadb,_0xf1ffc5){return function(_0x4c04fb){_0xf1ffc5[_0xd9d5('0x3')](_0xe7dadb,_0x4c04fb);};}function removeListener(_0x39f0ed,_0x9f5214){return function(){OpenchannelQueueEvents[_0xd9d5('0x4')](_0x39f0ed,_0x9f5214);};}exports[_0xd9d5('0x5')]=function(_0x2d979f){for(var _0x7f7746=0x0,_0x30fc50=events[_0xd9d5('0x6')];_0x7f7746<_0x30fc50;_0x7f7746++){var _0x5c1527=events[_0x7f7746];var _0x3cbba4=createListener(_0xd9d5('0x7')+_0x5c1527,_0x2d979f);OpenchannelQueueEvents['on'](_0x5c1527,_0x3cbba4);}};
\ No newline at end of file
index 2887c92..a6fb631 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a85=['post','create','put','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x15e874,_0x4b2dad){var _0x388440=function(_0x11d310){while(--_0x11d310){_0x15e874['push'](_0x15e874['shift']());}};_0x388440(++_0x4b2dad);}(_0x3a85,0xe1));var _0x53a8=function(_0xcaa3f4,_0x1a38e6){_0xcaa3f4=_0xcaa3f4-0x0;var _0x246970=_0x3a85[_0xcaa3f4];return _0x246970;};'use strict';var multer=require(_0x53a8('0x0'));var util=require(_0x53a8('0x1'));var path=require(_0x53a8('0x2'));var timeout=require(_0x53a8('0x3'));var express=require(_0x53a8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x53a8('0x5'));var interaction=require(_0x53a8('0x6'));var config=require(_0x53a8('0x7'));var controller=require(_0x53a8('0x8'));router[_0x53a8('0x9')]('/',auth['isAuthenticated'](),controller[_0x53a8('0xa')]);router[_0x53a8('0x9')](_0x53a8('0xb'),auth[_0x53a8('0xc')](),controller['describe']);router[_0x53a8('0x9')](_0x53a8('0xd'),auth[_0x53a8('0xc')](),controller[_0x53a8('0xe')]);router[_0x53a8('0xf')]('/',auth[_0x53a8('0xc')](),controller[_0x53a8('0x10')]);router[_0x53a8('0x11')](_0x53a8('0xd'),auth[_0x53a8('0xc')](),controller['update']);router[_0x53a8('0x12')](_0x53a8('0xd'),auth[_0x53a8('0xc')](),controller['destroy']);module[_0x53a8('0x13')]=router;
\ No newline at end of file
+var _0x08c3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','update','delete','/:id','destroy','exports','multer','util','path','fs-extra'];(function(_0x6404ed,_0x1da2d0){var _0x353e91=function(_0x1001a9){while(--_0x1001a9){_0x6404ed['push'](_0x6404ed['shift']());}};_0x353e91(++_0x1da2d0);}(_0x08c3,0x1df));var _0x308c=function(_0x1feb65,_0x59d59b){_0x1feb65=_0x1feb65-0x0;var _0xb2dbb3=_0x08c3[_0x1feb65];return _0xb2dbb3;};'use strict';var multer=require(_0x308c('0x0'));var util=require(_0x308c('0x1'));var path=require(_0x308c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x308c('0x3'));var auth=require(_0x308c('0x4'));var interaction=require(_0x308c('0x5'));var config=require(_0x308c('0x6'));var controller=require(_0x308c('0x7'));router[_0x308c('0x8')]('/',auth[_0x308c('0x9')](),controller[_0x308c('0xa')]);router[_0x308c('0x8')](_0x308c('0xb'),auth[_0x308c('0x9')](),controller[_0x308c('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x308c('0xd')]);router[_0x308c('0xe')]('/',auth[_0x308c('0x9')](),controller[_0x308c('0xf')]);router['put']('/:id',auth[_0x308c('0x9')](),controller[_0x308c('0x10')]);router[_0x308c('0x11')](_0x308c('0x12'),auth[_0x308c('0x9')](),controller[_0x308c('0x13')]);module[_0x308c('0x14')]=router;
\ No newline at end of file
index 00ae026..5bf2f0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb9=['STRING','DATE','moment','sequelize','exports'];(function(_0x14f21c,_0x315b28){var _0x2b509b=function(_0x19ea1f){while(--_0x19ea1f){_0x14f21c['push'](_0x14f21c['shift']());}};_0x2b509b(++_0x315b28);}(_0xbdb9,0xac));var _0x9bdb=function(_0x1f6bbb,_0xfb84c3){_0x1f6bbb=_0x1f6bbb-0x0;var _0x5bcc93=_0xbdb9[_0x1f6bbb];return _0x5bcc93;};'use strict';var moment=require(_0x9bdb('0x0'));var Sequelize=require(_0x9bdb('0x1'));module[_0x9bdb('0x2')]={'uniqueid':{'type':Sequelize[_0x9bdb('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9bdb('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9bdb('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd018=['STRING','DATE','moment','sequelize'];(function(_0xb04d32,_0x31993a){var _0x19dac4=function(_0xa91e36){while(--_0xa91e36){_0xb04d32['push'](_0xb04d32['shift']());}};_0x19dac4(++_0x31993a);}(_0xd018,0xda));var _0x8d01=function(_0x52694d,_0x2ec701){_0x52694d=_0x52694d-0x0;var _0x605bbc=_0xd018[_0x52694d];return _0x605bbc;};'use strict';var moment=require(_0x8d01('0x0'));var Sequelize=require(_0x8d01('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8d01('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x8d01('0x2')]},'joinAt':{'type':Sequelize[_0x8d01('0x3')]},'leaveAt':{'type':Sequelize[_0x8d01('0x3')]},'acceptAt':{'type':Sequelize[_0x8d01('0x3')]},'exitAt':{'type':Sequelize[_0x8d01('0x3')]},'reason':{'type':Sequelize[_0x8d01('0x2')]}};
\ No newline at end of file
index 0191806..541fa44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa93=['reject','save','update','then','error','stack','name','send','map','rawAttributes','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','OpenchannelQueueReport','includeAll','rows','catch','show','params','include','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','apply'];(function(_0x1082ca,_0xf509b1){var _0x36ecc0=function(_0x532301){while(--_0x532301){_0x1082ca['push'](_0x1082ca['shift']());}};_0x36ecc0(++_0xf509b1);}(_0xfa93,0x1b4));var _0x3fa9=function(_0x5aa8fe,_0x1f3b43){_0x5aa8fe=_0x5aa8fe-0x0;var _0x314b3f=_0xfa93[_0x5aa8fe];return _0x314b3f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3fa9('0x0'));var zipdir=require(_0x3fa9('0x1'));var jsonpatch=require(_0x3fa9('0x2'));var rp=require(_0x3fa9('0x3'));var moment=require(_0x3fa9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3fa9('0x5'));var util=require(_0x3fa9('0x6'));var path=require(_0x3fa9('0x7'));var sox=require(_0x3fa9('0x8'));var csv=require(_0x3fa9('0x9'));var ejs=require(_0x3fa9('0xa'));var fs=require('fs');var fs_extra=require(_0x3fa9('0xb'));var _=require(_0x3fa9('0xc'));var squel=require(_0x3fa9('0xd'));var crypto=require(_0x3fa9('0xe'));var jsforce=require(_0x3fa9('0xf'));var deskjs=require(_0x3fa9('0x10'));var toCsv=require(_0x3fa9('0x9'));var querystring=require(_0x3fa9('0x11'));var Papa=require(_0x3fa9('0x12'));var Redis=require(_0x3fa9('0x13'));var authService=require(_0x3fa9('0x14'));var qs=require(_0x3fa9('0x15'));var as=require(_0x3fa9('0x16'));var hardwareService=require(_0x3fa9('0x17'));var logger=require('../../config/logger')(_0x3fa9('0x18'));var utils=require(_0x3fa9('0x19'));var config=require(_0x3fa9('0x1a'));var licenseUtil=require(_0x3fa9('0x1b'));var db=require(_0x3fa9('0x1c'))['db'];function respondWithStatusCode(_0x68cbbc,_0x5d3159){_0x5d3159=_0x5d3159||0xcc;return function(_0x1dfa86){if(_0x1dfa86){return _0x68cbbc[_0x3fa9('0x1d')](_0x5d3159);}return _0x68cbbc[_0x3fa9('0x1e')](_0x5d3159)[_0x3fa9('0x1f')]();};}function respondWithResult(_0xa34a54,_0x2eda76){_0x2eda76=_0x2eda76||0xc8;return function(_0x51a1cd){if(_0x51a1cd){return _0xa34a54[_0x3fa9('0x1e')](_0x2eda76)[_0x3fa9('0x20')](_0x51a1cd);}};}function respondWithFilteredResult(_0x21ce14,_0x54aafe){return function(_0x60893c){if(_0x60893c){var _0x5a555f=typeof _0x54aafe['offset']==='undefined'&&typeof _0x54aafe[_0x3fa9('0x21')]===_0x3fa9('0x22');var _0xd22fe3=_0x60893c['count'];var _0x51b5b7=_0x5a555f?0x0:_0x54aafe[_0x3fa9('0x23')];var _0x50dfbd=_0x5a555f?_0x60893c[_0x3fa9('0x24')]:_0x54aafe['offset']+_0x54aafe[_0x3fa9('0x21')];var _0x4c220b;if(_0x50dfbd>=_0xd22fe3){_0x50dfbd=_0xd22fe3;_0x4c220b=0xc8;}else{_0x4c220b=0xce;}_0x21ce14[_0x3fa9('0x1e')](_0x4c220b);return _0x21ce14['set']('Content-Range',_0x51b5b7+'-'+_0x50dfbd+'/'+_0xd22fe3)[_0x3fa9('0x20')](_0x60893c);}return null;};}function patchUpdates(_0x5b96ec){return function(_0x53e2da){try{jsonpatch[_0x3fa9('0x25')](_0x53e2da,_0x5b96ec,!![]);}catch(_0x39d392){return BPromise[_0x3fa9('0x26')](_0x39d392);}return _0x53e2da[_0x3fa9('0x27')]();};}function saveUpdates(_0x5f3edc,_0x4e8cd1){return function(_0x3439f1){if(_0x3439f1){return _0x3439f1[_0x3fa9('0x28')](_0x5f3edc)[_0x3fa9('0x29')](function(_0x78b2bc){return _0x78b2bc;});}return null;};}function removeEntity(_0x41a505,_0x2f5593){return function(_0x3071e3){if(_0x3071e3){return _0x3071e3['destroy']()[_0x3fa9('0x29')](function(){_0x41a505[_0x3fa9('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b8500,_0x305586){return function(_0x277944){if(!_0x277944){_0x3b8500[_0x3fa9('0x1d')](0x194);}return _0x277944;};}function handleError(_0x167c06,_0x29af2a){_0x29af2a=_0x29af2a||0x1f4;return function(_0x333e29){logger[_0x3fa9('0x2a')](_0x333e29[_0x3fa9('0x2b')]);if(_0x333e29[_0x3fa9('0x2c')]){delete _0x333e29[_0x3fa9('0x2c')];}_0x167c06['status'](_0x29af2a)[_0x3fa9('0x2d')](_0x333e29);};}exports['index']=function(_0x20497b,_0x329fd0){var _0x57f830={},_0x3b0d0e={},_0x5b911b={'count':0x0,'rows':[]};var _0x559db1=_[_0x3fa9('0x2e')](db['OpenchannelQueueReport'][_0x3fa9('0x2f')],function(_0x2fd641){return{'name':_0x2fd641['fieldName'],'type':_0x2fd641[_0x3fa9('0x30')][_0x3fa9('0x31')]};});_0x3b0d0e[_0x3fa9('0x32')]=_[_0x3fa9('0x2e')](_0x559db1,_0x3fa9('0x2c'));_0x3b0d0e['query']=_[_0x3fa9('0x33')](_0x20497b['query']);_0x3b0d0e[_0x3fa9('0x34')]=_['intersection'](_0x3b0d0e['model'],_0x3b0d0e[_0x3fa9('0x35')]);_0x57f830[_0x3fa9('0x36')]=_[_0x3fa9('0x37')](_0x3b0d0e['model'],qs['fields'](_0x20497b[_0x3fa9('0x35')][_0x3fa9('0x38')]));_0x57f830['attributes']=_0x57f830[_0x3fa9('0x36')][_0x3fa9('0x39')]?_0x57f830[_0x3fa9('0x36')]:_0x3b0d0e[_0x3fa9('0x32')];if(!_0x20497b[_0x3fa9('0x35')][_0x3fa9('0x3a')](_0x3fa9('0x3b'))){_0x57f830[_0x3fa9('0x21')]=qs['limit'](_0x20497b[_0x3fa9('0x35')][_0x3fa9('0x21')]);_0x57f830[_0x3fa9('0x23')]=qs['offset'](_0x20497b[_0x3fa9('0x35')]['offset']);}_0x57f830[_0x3fa9('0x3c')]=qs[_0x3fa9('0x3d')](_0x20497b['query'][_0x3fa9('0x3d')]);_0x57f830['where']=qs[_0x3fa9('0x34')](_['pick'](_0x20497b['query'],_0x3b0d0e[_0x3fa9('0x34')]),_0x559db1);if(_0x20497b[_0x3fa9('0x35')]['filter']){_0x57f830[_0x3fa9('0x3e')]=_[_0x3fa9('0x3f')](_0x57f830[_0x3fa9('0x3e')],{'$or':_[_0x3fa9('0x2e')](_0x559db1,function(_0x5eb496){if(_0x5eb496['type']!==_0x3fa9('0x40')){var _0x31f909={};_0x31f909[_0x5eb496[_0x3fa9('0x2c')]]={'$like':'%'+_0x20497b[_0x3fa9('0x35')][_0x3fa9('0x41')]+'%'};return _0x31f909;}})});}_0x57f830=_[_0x3fa9('0x3f')]({},_0x57f830,_0x20497b[_0x3fa9('0x42')]);var _0x26cc93={'where':_0x57f830[_0x3fa9('0x3e')]};return db[_0x3fa9('0x43')]['count'](_0x26cc93)[_0x3fa9('0x29')](function(_0x7b5983){_0x5b911b['count']=_0x7b5983;if(_0x20497b[_0x3fa9('0x35')][_0x3fa9('0x44')]){_0x57f830['include']=[{'all':!![]}];}return db[_0x3fa9('0x43')]['findAll'](_0x57f830);})[_0x3fa9('0x29')](function(_0x280379){_0x5b911b[_0x3fa9('0x45')]=_0x280379;return _0x5b911b;})['then'](respondWithFilteredResult(_0x329fd0,_0x57f830))[_0x3fa9('0x46')](handleError(_0x329fd0,null));};exports[_0x3fa9('0x47')]=function(_0x196a53,_0x52c071){var _0xe6ab97={'raw':!![],'where':{'id':_0x196a53[_0x3fa9('0x48')]['id']}},_0x589484={};_0x589484[_0x3fa9('0x32')]=_[_0x3fa9('0x33')](db[_0x3fa9('0x43')]['rawAttributes']);_0x589484[_0x3fa9('0x35')]=_[_0x3fa9('0x33')](_0x196a53['query']);_0x589484[_0x3fa9('0x34')]=_[_0x3fa9('0x37')](_0x589484[_0x3fa9('0x32')],_0x589484['query']);_0xe6ab97[_0x3fa9('0x36')]=_['intersection'](_0x589484[_0x3fa9('0x32')],qs[_0x3fa9('0x38')](_0x196a53[_0x3fa9('0x35')][_0x3fa9('0x38')]));_0xe6ab97['attributes']=_0xe6ab97[_0x3fa9('0x36')][_0x3fa9('0x39')]?_0xe6ab97[_0x3fa9('0x36')]:_0x589484['model'];if(_0x196a53[_0x3fa9('0x35')]['includeAll']){_0xe6ab97[_0x3fa9('0x49')]=[{'all':!![]}];}_0xe6ab97=_[_0x3fa9('0x3f')]({},_0xe6ab97,_0x196a53['options']);return db[_0x3fa9('0x43')][_0x3fa9('0x4a')](_0xe6ab97)[_0x3fa9('0x29')](handleEntityNotFound(_0x52c071,null))[_0x3fa9('0x29')](respondWithResult(_0x52c071,null))[_0x3fa9('0x46')](handleError(_0x52c071,null));};exports[_0x3fa9('0x4b')]=function(_0x20582f,_0x58646e){return db[_0x3fa9('0x43')][_0x3fa9('0x4b')](_0x20582f[_0x3fa9('0x4c')],{})['then'](respondWithResult(_0x58646e,0xc9))[_0x3fa9('0x46')](handleError(_0x58646e,null));};exports[_0x3fa9('0x28')]=function(_0x35ea12,_0x2f5a5c){if(_0x35ea12[_0x3fa9('0x4c')]['id']){delete _0x35ea12[_0x3fa9('0x4c')]['id'];}return db[_0x3fa9('0x43')]['find']({'where':{'id':_0x35ea12['params']['id']}})[_0x3fa9('0x29')](handleEntityNotFound(_0x2f5a5c,null))[_0x3fa9('0x29')](saveUpdates(_0x35ea12[_0x3fa9('0x4c')],null))['then'](respondWithResult(_0x2f5a5c,null))[_0x3fa9('0x46')](handleError(_0x2f5a5c,null));};exports[_0x3fa9('0x4d')]=function(_0x12b429,_0x1d144c){return db[_0x3fa9('0x43')][_0x3fa9('0x4a')]({'where':{'id':_0x12b429[_0x3fa9('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d144c,null))[_0x3fa9('0x29')](removeEntity(_0x1d144c,null))[_0x3fa9('0x46')](handleError(_0x1d144c,null));};exports[_0x3fa9('0x4e')]=function(_0x135726,_0x3a2a10){return db[_0x3fa9('0x43')][_0x3fa9('0x4e')]()[_0x3fa9('0x29')](respondWithResult(_0x3a2a10,null))[_0x3fa9('0x46')](handleError(_0x3a2a10,null));};
\ No newline at end of file
+var _0xe949=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','fields','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe949,0xd5));var _0x9e94=function(_0x10d5a0,_0x49e0bc){_0x10d5a0=_0x10d5a0-0x0;var _0x2c6540=_0xe949[_0x10d5a0];return _0x2c6540;};'use strict';var emlformat=require(_0x9e94('0x0'));var rimraf=require(_0x9e94('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e94('0x2'));var rp=require(_0x9e94('0x3'));var moment=require(_0x9e94('0x4'));var BPromise=require(_0x9e94('0x5'));var Mustache=require(_0x9e94('0x6'));var util=require(_0x9e94('0x7'));var path=require(_0x9e94('0x8'));var sox=require(_0x9e94('0x9'));var csv=require(_0x9e94('0xa'));var ejs=require(_0x9e94('0xb'));var fs=require('fs');var fs_extra=require(_0x9e94('0xc'));var _=require(_0x9e94('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9e94('0xe'));var deskjs=require(_0x9e94('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9e94('0x10'));var Redis=require(_0x9e94('0x11'));var authService=require(_0x9e94('0x12'));var qs=require(_0x9e94('0x13'));var as=require(_0x9e94('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e94('0x15'))(_0x9e94('0x16'));var utils=require(_0x9e94('0x17'));var config=require(_0x9e94('0x18'));var licenseUtil=require(_0x9e94('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c3d27,_0x16b7e3){_0x16b7e3=_0x16b7e3||0xcc;return function(_0x426e68){if(_0x426e68){return _0x4c3d27['sendStatus'](_0x16b7e3);}return _0x4c3d27[_0x9e94('0x1a')](_0x16b7e3)[_0x9e94('0x1b')]();};}function respondWithResult(_0x2cb1a6,_0x232502){_0x232502=_0x232502||0xc8;return function(_0x180acc){if(_0x180acc){return _0x2cb1a6['status'](_0x232502)['json'](_0x180acc);}};}function respondWithFilteredResult(_0x1bd4aa,_0x17f4ac){return function(_0x1b050a){if(_0x1b050a){var _0x39134e=typeof _0x17f4ac[_0x9e94('0x1c')]===_0x9e94('0x1d')&&typeof _0x17f4ac[_0x9e94('0x1e')]==='undefined';var _0x51d569=_0x1b050a['count'];var _0x1dc1fd=_0x39134e?0x0:_0x17f4ac[_0x9e94('0x1c')];var _0x37cd50=_0x39134e?_0x1b050a[_0x9e94('0x1f')]:_0x17f4ac['offset']+_0x17f4ac['limit'];var _0x8a2d24;if(_0x37cd50>=_0x51d569){_0x37cd50=_0x51d569;_0x8a2d24=0xc8;}else{_0x8a2d24=0xce;}_0x1bd4aa[_0x9e94('0x1a')](_0x8a2d24);return _0x1bd4aa[_0x9e94('0x20')](_0x9e94('0x21'),_0x1dc1fd+'-'+_0x37cd50+'/'+_0x51d569)[_0x9e94('0x22')](_0x1b050a);}return null;};}function patchUpdates(_0x2f27ae){return function(_0x4879d3){try{jsonpatch[_0x9e94('0x23')](_0x4879d3,_0x2f27ae,!![]);}catch(_0x131538){return BPromise['reject'](_0x131538);}return _0x4879d3[_0x9e94('0x24')]();};}function saveUpdates(_0x5a56de,_0x2569fd){return function(_0x396d20){if(_0x396d20){return _0x396d20[_0x9e94('0x25')](_0x5a56de)[_0x9e94('0x26')](function(_0x44ba32){return _0x44ba32;});}return null;};}function removeEntity(_0x224c81,_0x35895b){return function(_0x4cb61a){if(_0x4cb61a){return _0x4cb61a['destroy']()['then'](function(){_0x224c81['status'](0xcc)[_0x9e94('0x1b')]();});}};}function handleEntityNotFound(_0x410f28,_0x363719){return function(_0x4856d0){if(!_0x4856d0){_0x410f28[_0x9e94('0x27')](0x194);}return _0x4856d0;};}function handleError(_0x370dd3,_0x4578b8){_0x4578b8=_0x4578b8||0x1f4;return function(_0x382d81){logger[_0x9e94('0x28')](_0x382d81[_0x9e94('0x29')]);if(_0x382d81[_0x9e94('0x2a')]){delete _0x382d81['name'];}_0x370dd3['status'](_0x4578b8)['send'](_0x382d81);};}exports['index']=function(_0x7c23e1,_0x2072ab){var _0x10a067={},_0x7162db={},_0x38bd75={'count':0x0,'rows':[]};var _0x2335fd=_[_0x9e94('0x2b')](db[_0x9e94('0x2c')][_0x9e94('0x2d')],function(_0x4a5db8){return{'name':_0x4a5db8[_0x9e94('0x2e')],'type':_0x4a5db8[_0x9e94('0x2f')][_0x9e94('0x30')]};});_0x7162db['model']=_['map'](_0x2335fd,_0x9e94('0x2a'));_0x7162db[_0x9e94('0x31')]=_[_0x9e94('0x32')](_0x7c23e1[_0x9e94('0x31')]);_0x7162db['filters']=_[_0x9e94('0x33')](_0x7162db[_0x9e94('0x34')],_0x7162db[_0x9e94('0x31')]);_0x10a067[_0x9e94('0x35')]=_[_0x9e94('0x33')](_0x7162db[_0x9e94('0x34')],qs['fields'](_0x7c23e1[_0x9e94('0x31')]['fields']));_0x10a067['attributes']=_0x10a067['attributes'][_0x9e94('0x36')]?_0x10a067[_0x9e94('0x35')]:_0x7162db[_0x9e94('0x34')];if(!_0x7c23e1[_0x9e94('0x31')][_0x9e94('0x37')](_0x9e94('0x38'))){_0x10a067[_0x9e94('0x1e')]=qs['limit'](_0x7c23e1[_0x9e94('0x31')][_0x9e94('0x1e')]);_0x10a067[_0x9e94('0x1c')]=qs[_0x9e94('0x1c')](_0x7c23e1[_0x9e94('0x31')]['offset']);}_0x10a067[_0x9e94('0x39')]=qs[_0x9e94('0x3a')](_0x7c23e1[_0x9e94('0x31')]['sort']);_0x10a067[_0x9e94('0x3b')]=qs['filters'](_[_0x9e94('0x3c')](_0x7c23e1[_0x9e94('0x31')],_0x7162db[_0x9e94('0x3d')]),_0x2335fd);if(_0x7c23e1[_0x9e94('0x31')][_0x9e94('0x3e')]){_0x10a067[_0x9e94('0x3b')]=_[_0x9e94('0x3f')](_0x10a067[_0x9e94('0x3b')],{'$or':_[_0x9e94('0x2b')](_0x2335fd,function(_0x176fb2){if(_0x176fb2['type']!=='VIRTUAL'){var _0x5b923d={};_0x5b923d[_0x176fb2[_0x9e94('0x2a')]]={'$like':'%'+_0x7c23e1[_0x9e94('0x31')][_0x9e94('0x3e')]+'%'};return _0x5b923d;}})});}_0x10a067=_[_0x9e94('0x3f')]({},_0x10a067,_0x7c23e1[_0x9e94('0x40')]);var _0x233d4b={'where':_0x10a067[_0x9e94('0x3b')]};return db[_0x9e94('0x2c')][_0x9e94('0x1f')](_0x233d4b)[_0x9e94('0x26')](function(_0x36543e){_0x38bd75['count']=_0x36543e;if(_0x7c23e1[_0x9e94('0x31')][_0x9e94('0x41')]){_0x10a067['include']=[{'all':!![]}];}return db[_0x9e94('0x2c')][_0x9e94('0x42')](_0x10a067);})[_0x9e94('0x26')](function(_0x55d005){_0x38bd75[_0x9e94('0x43')]=_0x55d005;return _0x38bd75;})['then'](respondWithFilteredResult(_0x2072ab,_0x10a067))[_0x9e94('0x44')](handleError(_0x2072ab,null));};exports[_0x9e94('0x45')]=function(_0x578ebc,_0x5797ef){var _0x3ac573={'raw':!![],'where':{'id':_0x578ebc[_0x9e94('0x46')]['id']}},_0x5db990={};_0x5db990['model']=_[_0x9e94('0x32')](db[_0x9e94('0x2c')][_0x9e94('0x2d')]);_0x5db990[_0x9e94('0x31')]=_[_0x9e94('0x32')](_0x578ebc[_0x9e94('0x31')]);_0x5db990[_0x9e94('0x3d')]=_[_0x9e94('0x33')](_0x5db990[_0x9e94('0x34')],_0x5db990[_0x9e94('0x31')]);_0x3ac573['attributes']=_[_0x9e94('0x33')](_0x5db990[_0x9e94('0x34')],qs[_0x9e94('0x47')](_0x578ebc[_0x9e94('0x31')]['fields']));_0x3ac573[_0x9e94('0x35')]=_0x3ac573['attributes']['length']?_0x3ac573[_0x9e94('0x35')]:_0x5db990[_0x9e94('0x34')];if(_0x578ebc[_0x9e94('0x31')]['includeAll']){_0x3ac573['include']=[{'all':!![]}];}_0x3ac573=_[_0x9e94('0x3f')]({},_0x3ac573,_0x578ebc[_0x9e94('0x40')]);return db[_0x9e94('0x2c')][_0x9e94('0x48')](_0x3ac573)[_0x9e94('0x26')](handleEntityNotFound(_0x5797ef,null))[_0x9e94('0x26')](respondWithResult(_0x5797ef,null))['catch'](handleError(_0x5797ef,null));};exports[_0x9e94('0x49')]=function(_0x2400a8,_0x795f56){return db[_0x9e94('0x2c')]['create'](_0x2400a8[_0x9e94('0x4a')],{})['then'](respondWithResult(_0x795f56,0xc9))[_0x9e94('0x44')](handleError(_0x795f56,null));};exports[_0x9e94('0x25')]=function(_0x3e2ea9,_0x1a9731){if(_0x3e2ea9[_0x9e94('0x4a')]['id']){delete _0x3e2ea9[_0x9e94('0x4a')]['id'];}return db[_0x9e94('0x2c')][_0x9e94('0x48')]({'where':{'id':_0x3e2ea9['params']['id']}})['then'](handleEntityNotFound(_0x1a9731,null))[_0x9e94('0x26')](saveUpdates(_0x3e2ea9[_0x9e94('0x4a')],null))[_0x9e94('0x26')](respondWithResult(_0x1a9731,null))[_0x9e94('0x44')](handleError(_0x1a9731,null));};exports[_0x9e94('0x4b')]=function(_0x216ef5,_0x4bd0e3){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x216ef5[_0x9e94('0x46')]['id']}})[_0x9e94('0x26')](handleEntityNotFound(_0x4bd0e3,null))['then'](removeEntity(_0x4bd0e3,null))[_0x9e94('0x44')](handleError(_0x4bd0e3,null));};exports[_0x9e94('0x4c')]=function(_0x55e332,_0x39bb5f){return db[_0x9e94('0x2c')][_0x9e94('0x4c')]()[_0x9e94('0x26')](respondWithResult(_0x39bb5f,null))[_0x9e94('0x44')](handleError(_0x39bb5f,null));};
\ No newline at end of file
index ef34f0c..022b1c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x49b38f,_0x1828f1){var _0x3fa66d=function(_0x204d0d){while(--_0x204d0d){_0x49b38f['push'](_0x49b38f['shift']());}};_0x3fa66d(++_0x1828f1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0x5fc3[_0x43a5c7];return _0x3b12a2;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x131422,_0x1874dd){var _0x1e9bcd=function(_0x5e1618){while(--_0x5e1618){_0x131422['push'](_0x131422['shift']());}};_0x1e9bcd(++_0x1874dd);}(_0x1261,0x144));var _0x1126=function(_0xbf19d7,_0x58b2bf){_0xbf19d7=_0xbf19d7-0x0;var _0x376e11=_0x1261[_0xbf19d7];return _0x376e11;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 3351977..ff1b8e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bc6=['catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','OpenchannelQueueReport,\x20%s,\x20%s','result'];(function(_0x7dee5a,_0x134236){var _0x43b613=function(_0x8a9e3b){while(--_0x8a9e3b){_0x7dee5a['push'](_0x7dee5a['shift']());}};_0x43b613(++_0x134236);}(_0x1bc6,0x94));var _0x61bc=function(_0x22bc24,_0x248df8){_0x22bc24=_0x22bc24-0x0;var _0x45ceba=_0x1bc6[_0x22bc24];return _0x45ceba;};'use strict';var _=require(_0x61bc('0x0'));var util=require(_0x61bc('0x1'));var moment=require(_0x61bc('0x2'));var BPromise=require(_0x61bc('0x3'));var rs=require(_0x61bc('0x4'));var fs=require('fs');var Redis=require(_0x61bc('0x5'));var db=require(_0x61bc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x61bc('0x7'))(_0x61bc('0x8'));var config=require(_0x61bc('0x9'));var jayson=require(_0x61bc('0xa'));var client=jayson[_0x61bc('0xb')][_0x61bc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410656,_0x1b29e3,_0x151ef4){return new BPromise(function(_0x5ebb87,_0x339305){return client['request'](_0x410656,_0x151ef4)[_0x61bc('0xd')](function(_0x502dc0){logger[_0x61bc('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b29e3,_0x61bc('0xf'));logger[_0x61bc('0x10')](_0x61bc('0x11'),_0x1b29e3,'request\x20sent',JSON['stringify'](_0x502dc0));if(_0x502dc0['error']){if(_0x502dc0['error']['code']===0x1f4){logger[_0x61bc('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b29e3,_0x502dc0[_0x61bc('0x12')][_0x61bc('0x13')]);return _0x339305(_0x502dc0['error']['message']);}logger['error'](_0x61bc('0x14'),_0x1b29e3,_0x502dc0[_0x61bc('0x12')]['message']);return _0x5ebb87(_0x502dc0[_0x61bc('0x12')][_0x61bc('0x13')]);}else{logger[_0x61bc('0xe')](_0x61bc('0x14'),_0x1b29e3,_0x61bc('0xf'));_0x5ebb87(_0x502dc0[_0x61bc('0x15')]['message']);}})[_0x61bc('0x16')](function(_0x21b974){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b29e3,_0x21b974);_0x339305(_0x21b974);});});}exports[_0x61bc('0x17')]=function(_0x2a6f35){var _0x96cd3=this;return new Promise(function(_0x4ca1c3,_0x457702){return db[_0x61bc('0x18')][_0x61bc('0x19')](_0x2a6f35[_0x61bc('0x1a')],{'raw':_0x2a6f35['options']?_0x2a6f35[_0x61bc('0x1b')][_0x61bc('0x1c')]===undefined?!![]:![]:!![]})[_0x61bc('0xd')](function(_0x144b07){logger['info'](_0x61bc('0x17'),_0x2a6f35);logger[_0x61bc('0x10')](_0x61bc('0x17'),_0x2a6f35,JSON[_0x61bc('0x1d')](_0x144b07));_0x4ca1c3(_0x144b07);})[_0x61bc('0x16')](function(_0x141db2){logger[_0x61bc('0x12')]('CreateOpenchannelQueueReport',_0x141db2[_0x61bc('0x13')],_0x2a6f35);_0x457702(_0x96cd3[_0x61bc('0x12')](0x1f4,_0x141db2[_0x61bc('0x13')]));});});};exports[_0x61bc('0x1e')]=function(_0x270f1c){var _0x567632=this;return new Promise(function(_0xc25ed5,_0x40cb55){return db[_0x61bc('0x18')][_0x61bc('0x1f')](_0x270f1c[_0x61bc('0x1a')],{'raw':_0x270f1c['options']?_0x270f1c['options'][_0x61bc('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x270f1c['options']?_0x270f1c[_0x61bc('0x1b')][_0x61bc('0x20')]||null:null,'attributes':_0x270f1c[_0x61bc('0x1b')]?_0x270f1c[_0x61bc('0x1b')]['attributes']||null:null,'limit':_0x270f1c[_0x61bc('0x1b')]?_0x270f1c[_0x61bc('0x1b')][_0x61bc('0x21')]||null:null})[_0x61bc('0xd')](function(_0x364600){logger[_0x61bc('0xe')](_0x61bc('0x1e'),_0x270f1c);logger[_0x61bc('0x10')](_0x61bc('0x1e'),_0x270f1c,JSON[_0x61bc('0x1d')](_0x364600));_0xc25ed5(_0x364600);})['catch'](function(_0x173e7b){logger[_0x61bc('0x12')](_0x61bc('0x1e'),_0x173e7b[_0x61bc('0x13')],_0x270f1c);_0x40cb55(_0x567632[_0x61bc('0x12')](0x1f4,_0x173e7b[_0x61bc('0x13')]));});});};
\ No newline at end of file
+var _0x0598=['where','limit','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','then','UpdateOpenchannelQueueReport','raw'];(function(_0x41533f,_0x557acd){var _0x9ec316=function(_0x377720){while(--_0x377720){_0x41533f['push'](_0x41533f['shift']());}};_0x9ec316(++_0x557acd);}(_0x0598,0x92));var _0x8059=function(_0x539edf,_0x3139c8){_0x539edf=_0x539edf-0x0;var _0x2a23ff=_0x0598[_0x539edf];return _0x2a23ff;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}exports[_0x8059('0xf')]=function(_0x4b6d55){var _0x10ad98=this;return new Promise(function(_0x2bb670,_0x37e926){return db[_0x8059('0x10')]['create'](_0x4b6d55[_0x8059('0x11')],{'raw':_0x4b6d55['options']?_0x4b6d55[_0x8059('0x12')]['raw']===undefined?!![]:![]:!![]})[_0x8059('0x13')](function(_0x56d794){logger[_0x8059('0x7')](_0x8059('0xf'),_0x4b6d55);logger[_0x8059('0xa')]('CreateOpenchannelQueueReport',_0x4b6d55,JSON['stringify'](_0x56d794));_0x2bb670(_0x56d794);})[_0x8059('0xe')](function(_0x232f1b){logger[_0x8059('0xc')](_0x8059('0xf'),_0x232f1b['message'],_0x4b6d55);_0x37e926(_0x10ad98[_0x8059('0xc')](0x1f4,_0x232f1b[_0x8059('0xd')]));});});};exports[_0x8059('0x14')]=function(_0x5449d9){var _0xe9a72d=this;return new Promise(function(_0x2256b1,_0x3e1067){return db[_0x8059('0x10')]['update'](_0x5449d9[_0x8059('0x11')],{'raw':_0x5449d9[_0x8059('0x12')]?_0x5449d9[_0x8059('0x12')][_0x8059('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5449d9[_0x8059('0x12')]?_0x5449d9['options'][_0x8059('0x16')]||null:null,'attributes':_0x5449d9[_0x8059('0x12')]?_0x5449d9[_0x8059('0x12')]['attributes']||null:null,'limit':_0x5449d9['options']?_0x5449d9['options'][_0x8059('0x17')]||null:null})[_0x8059('0x13')](function(_0xc32b1f){logger[_0x8059('0x7')]('UpdateOpenchannelQueueReport',_0x5449d9);logger[_0x8059('0xa')]('UpdateOpenchannelQueueReport',_0x5449d9,JSON[_0x8059('0xb')](_0xc32b1f));_0x2256b1(_0xc32b1f);})[_0x8059('0xe')](function(_0x5ecf7f){logger[_0x8059('0xc')](_0x8059('0x14'),_0x5ecf7f[_0x8059('0xd')],_0x5449d9);_0x3e1067(_0xe9a72d[_0x8059('0xc')](0x1f4,_0x5ecf7f[_0x8059('0xd')]));});});};
\ No newline at end of file
index 3a2dc87..851cfa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8d2=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x22cd57,_0x16af54){var _0x3e057c=function(_0x2e8afb){while(--_0x2e8afb){_0x22cd57['push'](_0x22cd57['shift']());}};_0x3e057c(++_0x16af54);}(_0xf8d2,0xcc));var _0x2f8d=function(_0x25216e,_0x77c03a){_0x25216e=_0x25216e-0x0;var _0x58cfab=_0xf8d2[_0x25216e];return _0x58cfab;};'use strict';var multer=require(_0x2f8d('0x0'));var util=require(_0x2f8d('0x1'));var path=require(_0x2f8d('0x2'));var timeout=require(_0x2f8d('0x3'));var express=require(_0x2f8d('0x4'));var router=express[_0x2f8d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2f8d('0x6'));var interaction=require(_0x2f8d('0x7'));var config=require(_0x2f8d('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0x2f8d('0x9')]('/',auth[_0x2f8d('0xa')](),controller[_0x2f8d('0xb')]);router[_0x2f8d('0x9')](_0x2f8d('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x2f8d('0x9')](_0x2f8d('0xd'),auth['isAuthenticated'](),controller[_0x2f8d('0xe')]);router[_0x2f8d('0xf')]('/',auth[_0x2f8d('0xa')](),controller[_0x2f8d('0x10')]);router[_0x2f8d('0x11')](_0x2f8d('0xd'),auth[_0x2f8d('0xa')](),controller[_0x2f8d('0x12')]);router[_0x2f8d('0x13')](_0x2f8d('0xd'),auth[_0x2f8d('0xa')](),controller[_0x2f8d('0x14')]);module[_0x2f8d('0x15')]=router;
\ No newline at end of file
+var _0x20bd=['show','post','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x1e117b,_0x171189){var _0x50f64b=function(_0x51fa0f){while(--_0x51fa0f){_0x1e117b['push'](_0x1e117b['shift']());}};_0x50f64b(++_0x171189);}(_0x20bd,0xae));var _0xd20b=function(_0x4f213b,_0x1e83f0){_0x4f213b=_0x4f213b-0x0;var _0x4e16e6=_0x20bd[_0x4f213b];return _0x4e16e6;};'use strict';var multer=require('multer');var util=require(_0xd20b('0x0'));var path=require(_0xd20b('0x1'));var timeout=require('connect-timeout');var express=require(_0xd20b('0x2'));var router=express[_0xd20b('0x3')]();var fs_extra=require(_0xd20b('0x4'));var auth=require(_0xd20b('0x5'));var interaction=require(_0xd20b('0x6'));var config=require(_0xd20b('0x7'));var controller=require(_0xd20b('0x8'));router[_0xd20b('0x9')]('/',auth[_0xd20b('0xa')](),controller[_0xd20b('0xb')]);router[_0xd20b('0x9')](_0xd20b('0xc'),auth[_0xd20b('0xa')](),controller[_0xd20b('0xd')]);router[_0xd20b('0x9')](_0xd20b('0xe'),auth['isAuthenticated'](),controller[_0xd20b('0xf')]);router[_0xd20b('0x10')]('/',auth[_0xd20b('0xa')](),controller['create']);router[_0xd20b('0x11')]('/:id',auth[_0xd20b('0xa')](),controller[_0xd20b('0x12')]);router[_0xd20b('0x13')](_0xd20b('0xe'),auth[_0xd20b('0xa')](),controller['destroy']);module[_0xd20b('0x14')]=router;
\ No newline at end of file
index 9d33b07..b6219f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x2786ea,_0x16c3c3){var _0x5c38e5=function(_0x5a53c5){while(--_0x5a53c5){_0x2786ea['push'](_0x2786ea['shift']());}};_0x5c38e5(++_0x16c3c3);}(_0xb43b,0x1b2));var _0xbb43=function(_0x12531a,_0x270206){_0x12531a=_0x12531a-0x0;var _0x11e648=_0xb43b[_0x12531a];return _0x11e648;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3fbdb6,_0x511c27){_0x3fbdb6=_0x3fbdb6-0x0;var _0x12475e=_0xb43b[_0x3fbdb6];return _0x12475e;};'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 2b1ff31..128f83e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e17=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','stack','name','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','OpenchannelTransferReport','include','findAll','rows','params','rawAttributes','length','find','create','body','destroy','catch','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0xee95aa,_0x56bc39){var _0x301db2=function(_0x1162b1){while(--_0x1162b1){_0xee95aa['push'](_0xee95aa['shift']());}};_0x301db2(++_0x56bc39);}(_0x7e17,0x89));var _0x77e1=function(_0xe5366,_0x32ea05){_0xe5366=_0xe5366-0x0;var _0x3dfd7d=_0x7e17[_0xe5366];return _0x3dfd7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x77e1('0x0'));var zipdir=require(_0x77e1('0x1'));var jsonpatch=require(_0x77e1('0x2'));var rp=require('request-promise');var moment=require(_0x77e1('0x3'));var BPromise=require(_0x77e1('0x4'));var Mustache=require(_0x77e1('0x5'));var util=require(_0x77e1('0x6'));var path=require(_0x77e1('0x7'));var sox=require('sox');var csv=require(_0x77e1('0x8'));var ejs=require(_0x77e1('0x9'));var fs=require('fs');var fs_extra=require(_0x77e1('0xa'));var _=require(_0x77e1('0xb'));var squel=require(_0x77e1('0xc'));var crypto=require('crypto');var jsforce=require(_0x77e1('0xd'));var deskjs=require(_0x77e1('0xe'));var toCsv=require(_0x77e1('0x8'));var querystring=require(_0x77e1('0xf'));var Papa=require('papaparse');var Redis=require(_0x77e1('0x10'));var authService=require(_0x77e1('0x11'));var qs=require(_0x77e1('0x12'));var as=require(_0x77e1('0x13'));var hardwareService=require(_0x77e1('0x14'));var logger=require(_0x77e1('0x15'))(_0x77e1('0x16'));var utils=require('../../config/utils');var config=require(_0x77e1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x77e1('0x18'))['db'];function respondWithStatusCode(_0x5d157e,_0x5af085){_0x5af085=_0x5af085||0xcc;return function(_0x69efbb){if(_0x69efbb){return _0x5d157e[_0x77e1('0x19')](_0x5af085);}return _0x5d157e[_0x77e1('0x1a')](_0x5af085)['end']();};}function respondWithResult(_0x4017e6,_0xa915e5){_0xa915e5=_0xa915e5||0xc8;return function(_0x3abc31){if(_0x3abc31){return _0x4017e6[_0x77e1('0x1a')](_0xa915e5)[_0x77e1('0x1b')](_0x3abc31);}};}function respondWithFilteredResult(_0x5259a6,_0xaf2dd1){return function(_0x2aa001){if(_0x2aa001){var _0xc2f6f2=typeof _0xaf2dd1[_0x77e1('0x1c')]===_0x77e1('0x1d')&&typeof _0xaf2dd1[_0x77e1('0x1e')]===_0x77e1('0x1d');var _0x13467f=_0x2aa001['count'];var _0x59b306=_0xc2f6f2?0x0:_0xaf2dd1[_0x77e1('0x1c')];var _0x1ca9a6=_0xc2f6f2?_0x2aa001[_0x77e1('0x1f')]:_0xaf2dd1[_0x77e1('0x1c')]+_0xaf2dd1[_0x77e1('0x1e')];var _0x401a49;if(_0x1ca9a6>=_0x13467f){_0x1ca9a6=_0x13467f;_0x401a49=0xc8;}else{_0x401a49=0xce;}_0x5259a6[_0x77e1('0x1a')](_0x401a49);return _0x5259a6[_0x77e1('0x20')]('Content-Range',_0x59b306+'-'+_0x1ca9a6+'/'+_0x13467f)[_0x77e1('0x1b')](_0x2aa001);}return null;};}function patchUpdates(_0x384513){return function(_0x518e1e){try{jsonpatch[_0x77e1('0x21')](_0x518e1e,_0x384513,!![]);}catch(_0x149987){return BPromise[_0x77e1('0x22')](_0x149987);}return _0x518e1e[_0x77e1('0x23')]();};}function saveUpdates(_0x59741a,_0x48930b){return function(_0x5add5e){if(_0x5add5e){return _0x5add5e[_0x77e1('0x24')](_0x59741a)[_0x77e1('0x25')](function(_0x11e829){return _0x11e829;});}return null;};}function removeEntity(_0x480d3f,_0x1a4b9a){return function(_0x23013e){if(_0x23013e){return _0x23013e['destroy']()[_0x77e1('0x25')](function(){_0x480d3f['status'](0xcc)[_0x77e1('0x26')]();});}};}function handleEntityNotFound(_0x2ae970,_0x1a1658){return function(_0x28c72c){if(!_0x28c72c){_0x2ae970['sendStatus'](0x194);}return _0x28c72c;};}function handleError(_0x508588,_0x278dba){_0x278dba=_0x278dba||0x1f4;return function(_0x23d1e6){logger['error'](_0x23d1e6[_0x77e1('0x27')]);if(_0x23d1e6['name']){delete _0x23d1e6[_0x77e1('0x28')];}_0x508588[_0x77e1('0x1a')](_0x278dba)['send'](_0x23d1e6);};}exports['index']=function(_0x3e9247,_0x36e569){var _0x4b4289={},_0x45736={},_0x977d82={'count':0x0,'rows':[]};var _0x361e25=_['map'](db['OpenchannelTransferReport']['rawAttributes'],function(_0x10a7d8){return{'name':_0x10a7d8[_0x77e1('0x29')],'type':_0x10a7d8[_0x77e1('0x2a')][_0x77e1('0x2b')]};});_0x45736[_0x77e1('0x2c')]=_[_0x77e1('0x2d')](_0x361e25,'name');_0x45736['query']=_[_0x77e1('0x2e')](_0x3e9247[_0x77e1('0x2f')]);_0x45736[_0x77e1('0x30')]=_[_0x77e1('0x31')](_0x45736[_0x77e1('0x2c')],_0x45736['query']);_0x4b4289['attributes']=_[_0x77e1('0x31')](_0x45736['model'],qs[_0x77e1('0x32')](_0x3e9247[_0x77e1('0x2f')][_0x77e1('0x32')]));_0x4b4289[_0x77e1('0x33')]=_0x4b4289[_0x77e1('0x33')]['length']?_0x4b4289[_0x77e1('0x33')]:_0x45736[_0x77e1('0x2c')];if(!_0x3e9247['query'][_0x77e1('0x34')](_0x77e1('0x35'))){_0x4b4289[_0x77e1('0x1e')]=qs[_0x77e1('0x1e')](_0x3e9247[_0x77e1('0x2f')]['limit']);_0x4b4289[_0x77e1('0x1c')]=qs[_0x77e1('0x1c')](_0x3e9247[_0x77e1('0x2f')]['offset']);}_0x4b4289[_0x77e1('0x36')]=qs['sort'](_0x3e9247[_0x77e1('0x2f')][_0x77e1('0x37')]);_0x4b4289['where']=qs[_0x77e1('0x30')](_[_0x77e1('0x38')](_0x3e9247[_0x77e1('0x2f')],_0x45736['filters']),_0x361e25);if(_0x3e9247[_0x77e1('0x2f')]['filter']){_0x4b4289[_0x77e1('0x39')]=_[_0x77e1('0x3a')](_0x4b4289[_0x77e1('0x39')],{'$or':_[_0x77e1('0x2d')](_0x361e25,function(_0x391bd3){if(_0x391bd3[_0x77e1('0x2a')]!==_0x77e1('0x3b')){var _0x56761a={};_0x56761a[_0x391bd3[_0x77e1('0x28')]]={'$like':'%'+_0x3e9247[_0x77e1('0x2f')][_0x77e1('0x3c')]+'%'};return _0x56761a;}})});}_0x4b4289=_[_0x77e1('0x3a')]({},_0x4b4289,_0x3e9247[_0x77e1('0x3d')]);var _0x41d646={'where':_0x4b4289['where']};return db[_0x77e1('0x3e')][_0x77e1('0x1f')](_0x41d646)[_0x77e1('0x25')](function(_0x576b9b){_0x977d82[_0x77e1('0x1f')]=_0x576b9b;if(_0x3e9247[_0x77e1('0x2f')]['includeAll']){_0x4b4289[_0x77e1('0x3f')]=[{'all':!![]}];}return db[_0x77e1('0x3e')][_0x77e1('0x40')](_0x4b4289);})['then'](function(_0x499993){_0x977d82[_0x77e1('0x41')]=_0x499993;return _0x977d82;})[_0x77e1('0x25')](respondWithFilteredResult(_0x36e569,_0x4b4289))['catch'](handleError(_0x36e569,null));};exports['show']=function(_0x1f081b,_0x4252c4){var _0x188823={'raw':!![],'where':{'id':_0x1f081b[_0x77e1('0x42')]['id']}},_0x3b240a={};_0x3b240a[_0x77e1('0x2c')]=_[_0x77e1('0x2e')](db['OpenchannelTransferReport'][_0x77e1('0x43')]);_0x3b240a[_0x77e1('0x2f')]=_[_0x77e1('0x2e')](_0x1f081b[_0x77e1('0x2f')]);_0x3b240a[_0x77e1('0x30')]=_[_0x77e1('0x31')](_0x3b240a[_0x77e1('0x2c')],_0x3b240a[_0x77e1('0x2f')]);_0x188823[_0x77e1('0x33')]=_[_0x77e1('0x31')](_0x3b240a[_0x77e1('0x2c')],qs[_0x77e1('0x32')](_0x1f081b['query']['fields']));_0x188823['attributes']=_0x188823['attributes'][_0x77e1('0x44')]?_0x188823[_0x77e1('0x33')]:_0x3b240a[_0x77e1('0x2c')];if(_0x1f081b[_0x77e1('0x2f')]['includeAll']){_0x188823['include']=[{'all':!![]}];}_0x188823=_[_0x77e1('0x3a')]({},_0x188823,_0x1f081b['options']);return db[_0x77e1('0x3e')][_0x77e1('0x45')](_0x188823)[_0x77e1('0x25')](handleEntityNotFound(_0x4252c4,null))[_0x77e1('0x25')](respondWithResult(_0x4252c4,null))['catch'](handleError(_0x4252c4,null));};exports[_0x77e1('0x46')]=function(_0x4f32f5,_0x49c365){return db[_0x77e1('0x3e')][_0x77e1('0x46')](_0x4f32f5[_0x77e1('0x47')],{})[_0x77e1('0x25')](respondWithResult(_0x49c365,0xc9))['catch'](handleError(_0x49c365,null));};exports[_0x77e1('0x24')]=function(_0x1e129c,_0x352ef5){if(_0x1e129c[_0x77e1('0x47')]['id']){delete _0x1e129c[_0x77e1('0x47')]['id'];}return db['OpenchannelTransferReport'][_0x77e1('0x45')]({'where':{'id':_0x1e129c[_0x77e1('0x42')]['id']}})[_0x77e1('0x25')](handleEntityNotFound(_0x352ef5,null))[_0x77e1('0x25')](saveUpdates(_0x1e129c['body'],null))[_0x77e1('0x25')](respondWithResult(_0x352ef5,null))['catch'](handleError(_0x352ef5,null));};exports[_0x77e1('0x48')]=function(_0x119298,_0x34445d){return db[_0x77e1('0x3e')][_0x77e1('0x45')]({'where':{'id':_0x119298[_0x77e1('0x42')]['id']}})[_0x77e1('0x25')](handleEntityNotFound(_0x34445d,null))[_0x77e1('0x25')](removeEntity(_0x34445d,null))[_0x77e1('0x49')](handleError(_0x34445d,null));};exports['describe']=function(_0x2e0a08,_0x2e404d){return db['OpenchannelTransferReport'][_0x77e1('0x4a')]()[_0x77e1('0x25')](respondWithResult(_0x2e404d,null))[_0x77e1('0x49')](handleError(_0x2e404d,null));};
\ No newline at end of file
+var _0x0e36=['nolimit','sort','where','pick','merge','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','type','query','filters','intersection','model','fields','attributes'];(function(_0x3b3481,_0x35af41){var _0x86064e=function(_0x16e4fb){while(--_0x16e4fb){_0x3b3481['push'](_0x3b3481['shift']());}};_0x86064e(++_0x35af41);}(_0x0e36,0x9a));var _0x60e3=function(_0x19924b,_0x90795c){_0x19924b=_0x19924b-0x0;var _0x3121fd=_0x0e36[_0x19924b];return _0x3121fd;};'use strict';var emlformat=require(_0x60e3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x60e3('0x1'));var jsonpatch=require(_0x60e3('0x2'));var rp=require(_0x60e3('0x3'));var moment=require(_0x60e3('0x4'));var BPromise=require(_0x60e3('0x5'));var Mustache=require(_0x60e3('0x6'));var util=require(_0x60e3('0x7'));var path=require(_0x60e3('0x8'));var sox=require('sox');var csv=require(_0x60e3('0x9'));var ejs=require(_0x60e3('0xa'));var fs=require('fs');var fs_extra=require(_0x60e3('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x60e3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x60e3('0xd'));var toCsv=require(_0x60e3('0x9'));var querystring=require('querystring');var Papa=require(_0x60e3('0xe'));var Redis=require(_0x60e3('0xf'));var authService=require(_0x60e3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x60e3('0x11'));var logger=require(_0x60e3('0x12'))('api');var utils=require(_0x60e3('0x13'));var config=require(_0x60e3('0x14'));var licenseUtil=require(_0x60e3('0x15'));var db=require(_0x60e3('0x16'))['db'];function respondWithStatusCode(_0x1436e6,_0x2a54dc){_0x2a54dc=_0x2a54dc||0xcc;return function(_0x50b47f){if(_0x50b47f){return _0x1436e6[_0x60e3('0x17')](_0x2a54dc);}return _0x1436e6[_0x60e3('0x18')](_0x2a54dc)[_0x60e3('0x19')]();};}function respondWithResult(_0x37e987,_0x18f065){_0x18f065=_0x18f065||0xc8;return function(_0xd10046){if(_0xd10046){return _0x37e987['status'](_0x18f065)[_0x60e3('0x1a')](_0xd10046);}};}function respondWithFilteredResult(_0x1af2a6,_0x3b73c6){return function(_0x2cfeff){if(_0x2cfeff){var _0x4779b3=typeof _0x3b73c6[_0x60e3('0x1b')]===_0x60e3('0x1c')&&typeof _0x3b73c6[_0x60e3('0x1d')]===_0x60e3('0x1c');var _0x3545e1=_0x2cfeff[_0x60e3('0x1e')];var _0x1d4782=_0x4779b3?0x0:_0x3b73c6[_0x60e3('0x1b')];var _0x1f284b=_0x4779b3?_0x2cfeff['count']:_0x3b73c6[_0x60e3('0x1b')]+_0x3b73c6[_0x60e3('0x1d')];var _0x313b6c;if(_0x1f284b>=_0x3545e1){_0x1f284b=_0x3545e1;_0x313b6c=0xc8;}else{_0x313b6c=0xce;}_0x1af2a6['status'](_0x313b6c);return _0x1af2a6[_0x60e3('0x1f')]('Content-Range',_0x1d4782+'-'+_0x1f284b+'/'+_0x3545e1)[_0x60e3('0x1a')](_0x2cfeff);}return null;};}function patchUpdates(_0x1a8377){return function(_0x546ccb){try{jsonpatch['apply'](_0x546ccb,_0x1a8377,!![]);}catch(_0x4a1884){return BPromise['reject'](_0x4a1884);}return _0x546ccb[_0x60e3('0x20')]();};}function saveUpdates(_0xa88c11,_0x42fac1){return function(_0x4efe5e){if(_0x4efe5e){return _0x4efe5e[_0x60e3('0x21')](_0xa88c11)[_0x60e3('0x22')](function(_0x58a1b6){return _0x58a1b6;});}return null;};}function removeEntity(_0x4dc0cb,_0x52a256){return function(_0x44f789){if(_0x44f789){return _0x44f789[_0x60e3('0x23')]()[_0x60e3('0x22')](function(){_0x4dc0cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c77c8,_0x92e952){return function(_0x214ab9){if(!_0x214ab9){_0x3c77c8[_0x60e3('0x17')](0x194);}return _0x214ab9;};}function handleError(_0x2bece4,_0x2032c7){_0x2032c7=_0x2032c7||0x1f4;return function(_0x390582){logger[_0x60e3('0x24')](_0x390582[_0x60e3('0x25')]);if(_0x390582[_0x60e3('0x26')]){delete _0x390582['name'];}_0x2bece4[_0x60e3('0x18')](_0x2032c7)[_0x60e3('0x27')](_0x390582);};}exports['index']=function(_0x5a92eb,_0x4bbe3e){var _0x23e0f4={},_0x4b5bc2={},_0x4078be={'count':0x0,'rows':[]};var _0x418db7=_[_0x60e3('0x28')](db[_0x60e3('0x29')][_0x60e3('0x2a')],function(_0x2d0085){return{'name':_0x2d0085['fieldName'],'type':_0x2d0085[_0x60e3('0x2b')]['key']};});_0x4b5bc2['model']=_[_0x60e3('0x28')](_0x418db7,_0x60e3('0x26'));_0x4b5bc2['query']=_['keys'](_0x5a92eb[_0x60e3('0x2c')]);_0x4b5bc2[_0x60e3('0x2d')]=_[_0x60e3('0x2e')](_0x4b5bc2[_0x60e3('0x2f')],_0x4b5bc2['query']);_0x23e0f4['attributes']=_['intersection'](_0x4b5bc2['model'],qs['fields'](_0x5a92eb[_0x60e3('0x2c')][_0x60e3('0x30')]));_0x23e0f4[_0x60e3('0x31')]=_0x23e0f4[_0x60e3('0x31')]['length']?_0x23e0f4[_0x60e3('0x31')]:_0x4b5bc2[_0x60e3('0x2f')];if(!_0x5a92eb[_0x60e3('0x2c')]['hasOwnProperty'](_0x60e3('0x32'))){_0x23e0f4[_0x60e3('0x1d')]=qs['limit'](_0x5a92eb[_0x60e3('0x2c')][_0x60e3('0x1d')]);_0x23e0f4[_0x60e3('0x1b')]=qs['offset'](_0x5a92eb['query'][_0x60e3('0x1b')]);}_0x23e0f4['order']=qs[_0x60e3('0x33')](_0x5a92eb[_0x60e3('0x2c')][_0x60e3('0x33')]);_0x23e0f4[_0x60e3('0x34')]=qs['filters'](_[_0x60e3('0x35')](_0x5a92eb[_0x60e3('0x2c')],_0x4b5bc2[_0x60e3('0x2d')]),_0x418db7);if(_0x5a92eb[_0x60e3('0x2c')]['filter']){_0x23e0f4[_0x60e3('0x34')]=_[_0x60e3('0x36')](_0x23e0f4[_0x60e3('0x34')],{'$or':_['map'](_0x418db7,function(_0x55a5cf){if(_0x55a5cf['type']!=='VIRTUAL'){var _0x12b362={};_0x12b362[_0x55a5cf[_0x60e3('0x26')]]={'$like':'%'+_0x5a92eb['query']['filter']+'%'};return _0x12b362;}})});}_0x23e0f4=_[_0x60e3('0x36')]({},_0x23e0f4,_0x5a92eb[_0x60e3('0x37')]);var _0x3a517c={'where':_0x23e0f4[_0x60e3('0x34')]};return db['OpenchannelTransferReport'][_0x60e3('0x1e')](_0x3a517c)[_0x60e3('0x22')](function(_0x5e0465){_0x4078be[_0x60e3('0x1e')]=_0x5e0465;if(_0x5a92eb[_0x60e3('0x2c')][_0x60e3('0x38')]){_0x23e0f4[_0x60e3('0x39')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x60e3('0x3a')](_0x23e0f4);})[_0x60e3('0x22')](function(_0x1d751a){_0x4078be['rows']=_0x1d751a;return _0x4078be;})[_0x60e3('0x22')](respondWithFilteredResult(_0x4bbe3e,_0x23e0f4))[_0x60e3('0x3b')](handleError(_0x4bbe3e,null));};exports[_0x60e3('0x3c')]=function(_0x5393c3,_0x3664e9){var _0x261dc2={'raw':!![],'where':{'id':_0x5393c3[_0x60e3('0x3d')]['id']}},_0x44216b={};_0x44216b[_0x60e3('0x2f')]=_[_0x60e3('0x3e')](db[_0x60e3('0x29')][_0x60e3('0x2a')]);_0x44216b['query']=_[_0x60e3('0x3e')](_0x5393c3[_0x60e3('0x2c')]);_0x44216b[_0x60e3('0x2d')]=_['intersection'](_0x44216b[_0x60e3('0x2f')],_0x44216b['query']);_0x261dc2[_0x60e3('0x31')]=_[_0x60e3('0x2e')](_0x44216b['model'],qs[_0x60e3('0x30')](_0x5393c3[_0x60e3('0x2c')]['fields']));_0x261dc2['attributes']=_0x261dc2[_0x60e3('0x31')][_0x60e3('0x3f')]?_0x261dc2[_0x60e3('0x31')]:_0x44216b[_0x60e3('0x2f')];if(_0x5393c3[_0x60e3('0x2c')][_0x60e3('0x38')]){_0x261dc2['include']=[{'all':!![]}];}_0x261dc2=_['merge']({},_0x261dc2,_0x5393c3[_0x60e3('0x37')]);return db[_0x60e3('0x29')][_0x60e3('0x40')](_0x261dc2)[_0x60e3('0x22')](handleEntityNotFound(_0x3664e9,null))[_0x60e3('0x22')](respondWithResult(_0x3664e9,null))[_0x60e3('0x3b')](handleError(_0x3664e9,null));};exports[_0x60e3('0x41')]=function(_0x4276f8,_0x3f176f){return db[_0x60e3('0x29')][_0x60e3('0x41')](_0x4276f8['body'],{})['then'](respondWithResult(_0x3f176f,0xc9))[_0x60e3('0x3b')](handleError(_0x3f176f,null));};exports['update']=function(_0x4c0553,_0xd27904){if(_0x4c0553[_0x60e3('0x42')]['id']){delete _0x4c0553[_0x60e3('0x42')]['id'];}return db[_0x60e3('0x29')][_0x60e3('0x40')]({'where':{'id':_0x4c0553[_0x60e3('0x3d')]['id']}})[_0x60e3('0x22')](handleEntityNotFound(_0xd27904,null))[_0x60e3('0x22')](saveUpdates(_0x4c0553[_0x60e3('0x42')],null))[_0x60e3('0x22')](respondWithResult(_0xd27904,null))['catch'](handleError(_0xd27904,null));};exports['destroy']=function(_0x166768,_0x6471c0){return db[_0x60e3('0x29')][_0x60e3('0x40')]({'where':{'id':_0x166768[_0x60e3('0x3d')]['id']}})[_0x60e3('0x22')](handleEntityNotFound(_0x6471c0,null))[_0x60e3('0x22')](removeEntity(_0x6471c0,null))[_0x60e3('0x3b')](handleError(_0x6471c0,null));};exports[_0x60e3('0x43')]=function(_0x1e142a,_0x521569){return db[_0x60e3('0x29')][_0x60e3('0x43')]()[_0x60e3('0x22')](respondWithResult(_0x521569,null))[_0x60e3('0x3b')](handleError(_0x521569,null));};
\ No newline at end of file
index 4c48c3f..a0852fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55a7=['moment','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api'];(function(_0x2eebff,_0x1f4d5b){var _0x21fdb4=function(_0x567356){while(--_0x567356){_0x2eebff['push'](_0x2eebff['shift']());}};_0x21fdb4(++_0x1f4d5b);}(_0x55a7,0x151));var _0x755a=function(_0xf6f5eb,_0x231e80){_0xf6f5eb=_0xf6f5eb-0x0;var _0x5e45a9=_0x55a7[_0xf6f5eb];return _0x5e45a9;};'use strict';var _=require(_0x755a('0x0'));var util=require('util');var logger=require(_0x755a('0x1'))(_0x755a('0x2'));var moment=require(_0x755a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x755a('0x4'));var rimraf=require(_0x755a('0x5'));var config=require(_0x755a('0x6'));var attributes=require(_0x755a('0x7'));module['exports']=function(_0x2aba76,_0x304e48){return _0x2aba76['define']('OpenchannelTransferReport',attributes,{'tableName':_0x755a('0x8'),'paranoid':![],'indexes':[{'name':_0x755a('0x9'),'fields':[_0x755a('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x35fe=['rimraf','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3aea6a,_0x423bff){var _0x549f79=function(_0x447d3b){while(--_0x447d3b){_0x3aea6a['push'](_0x3aea6a['shift']());}};_0x549f79(++_0x423bff);}(_0x35fe,0x1aa));var _0xe35f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x35fe[_0x432682];return _0x463d05;};'use strict';var _=require(_0xe35f('0x0'));var util=require(_0xe35f('0x1'));var logger=require(_0xe35f('0x2'))('api');var moment=require(_0xe35f('0x3'));var BPromise=require(_0xe35f('0x4'));var rp=require(_0xe35f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe35f('0x6'));var config=require('../../config/environment');var attributes=require(_0xe35f('0x7'));module[_0xe35f('0x8')]=function(_0x13e6b7,_0x13bc2a){return _0x13e6b7['define'](_0xe35f('0x9'),attributes,{'tableName':_0xe35f('0xa'),'paranoid':![],'indexes':[{'name':_0xe35f('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 5b98778..de56ca1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f74=['http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x12b8d6,_0x1d9ca5){var _0x4b0dfa=function(_0x3597b2){while(--_0x3597b2){_0x12b8d6['push'](_0x12b8d6['shift']());}};_0x4b0dfa(++_0x1d9ca5);}(_0x2f74,0x7b));var _0x42f7=function(_0x218c0c,_0x2b21e3){_0x218c0c=_0x218c0c-0x0;var _0xf0347d=_0x2f74[_0x218c0c];return _0xf0347d;};'use strict';var _=require(_0x42f7('0x0'));var util=require('util');var moment=require(_0x42f7('0x1'));var BPromise=require(_0x42f7('0x2'));var rs=require(_0x42f7('0x3'));var fs=require('fs');var Redis=require(_0x42f7('0x4'));var db=require(_0x42f7('0x5'))['db'];var utils=require(_0x42f7('0x6'));var logger=require(_0x42f7('0x7'))(_0x42f7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x42f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cb6e0,_0x20ff46,_0x36b55e){return new BPromise(function(_0x2c64b2,_0x28fc83){return client[_0x42f7('0xa')](_0x1cb6e0,_0x36b55e)[_0x42f7('0xb')](function(_0x5772a8){logger[_0x42f7('0xc')](_0x42f7('0xd'),_0x20ff46,_0x42f7('0xe'));logger[_0x42f7('0xf')](_0x42f7('0x10'),_0x20ff46,_0x42f7('0xe'),JSON['stringify'](_0x5772a8));if(_0x5772a8[_0x42f7('0x11')]){if(_0x5772a8[_0x42f7('0x11')][_0x42f7('0x12')]===0x1f4){logger[_0x42f7('0x11')](_0x42f7('0xd'),_0x20ff46,_0x5772a8[_0x42f7('0x11')][_0x42f7('0x13')]);return _0x28fc83(_0x5772a8[_0x42f7('0x11')]['message']);}logger['error'](_0x42f7('0xd'),_0x20ff46,_0x5772a8[_0x42f7('0x11')][_0x42f7('0x13')]);return _0x2c64b2(_0x5772a8[_0x42f7('0x11')][_0x42f7('0x13')]);}else{logger['info'](_0x42f7('0xd'),_0x20ff46,'request\x20sent');_0x2c64b2(_0x5772a8[_0x42f7('0x14')][_0x42f7('0x13')]);}})[_0x42f7('0x15')](function(_0x19eff3){logger[_0x42f7('0x11')](_0x42f7('0xd'),_0x20ff46,_0x19eff3);_0x28fc83(_0x19eff3);});});}
\ No newline at end of file
+var _0x5183=['../../config/utils','../../config/logger','jayson/promise','client','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x4a5f6c,_0x4f532e){var _0x281ffd=function(_0x4c68e3){while(--_0x4c68e3){_0x4a5f6c['push'](_0x4a5f6c['shift']());}};_0x281ffd(++_0x4f532e);}(_0x5183,0x13e));var _0x3518=function(_0x3205b3,_0x45591a){_0x3205b3=_0x3205b3-0x0;var _0x3150a9=_0x5183[_0x3205b3];return _0x3150a9;};'use strict';var _=require(_0x3518('0x0'));var util=require(_0x3518('0x1'));var moment=require(_0x3518('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3518('0x3'));var db=require(_0x3518('0x4'))['db'];var utils=require(_0x3518('0x5'));var logger=require(_0x3518('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3518('0x7'));var client=jayson[_0x3518('0x8')][_0x3518('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x482b2d,_0x5cd139,_0x488c52){return new BPromise(function(_0x147b59,_0x33e66c){return client[_0x3518('0xa')](_0x482b2d,_0x488c52)['then'](function(_0x12530b){logger['info'](_0x3518('0xb'),_0x5cd139,_0x3518('0xc'));logger[_0x3518('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x5cd139,_0x3518('0xc'),JSON[_0x3518('0xe')](_0x12530b));if(_0x12530b['error']){if(_0x12530b[_0x3518('0xf')][_0x3518('0x10')]===0x1f4){logger[_0x3518('0xf')](_0x3518('0xb'),_0x5cd139,_0x12530b['error']['message']);return _0x33e66c(_0x12530b[_0x3518('0xf')][_0x3518('0x11')]);}logger[_0x3518('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5cd139,_0x12530b['error'][_0x3518('0x11')]);return _0x147b59(_0x12530b[_0x3518('0xf')][_0x3518('0x11')]);}else{logger['info'](_0x3518('0xb'),_0x5cd139,_0x3518('0xc'));_0x147b59(_0x12530b[_0x3518('0x12')][_0x3518('0x11')]);}})['catch'](function(_0xc7f658){logger['error'](_0x3518('0xb'),_0x5cd139,_0xc7f658);_0x33e66c(_0xc7f658);});});}
\ No newline at end of file
index 2e549b8..ce87324 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe619=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x43116a,_0x29b5c8){var _0x1450dc=function(_0xac4ec7){while(--_0xac4ec7){_0x43116a['push'](_0x43116a['shift']());}};_0x1450dc(++_0x29b5c8);}(_0xe619,0xfa));var _0x9e61=function(_0x4c8232,_0x4e0dea){_0x4c8232=_0x4c8232-0x0;var _0x3cc8e5=_0xe619[_0x4c8232];return _0x3cc8e5;};'use strict';var multer=require(_0x9e61('0x0'));var util=require(_0x9e61('0x1'));var path=require(_0x9e61('0x2'));var timeout=require(_0x9e61('0x3'));var express=require(_0x9e61('0x4'));var router=express[_0x9e61('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9e61('0x6'));var interaction=require(_0x9e61('0x7'));var config=require(_0x9e61('0x8'));var controller=require(_0x9e61('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x9e61('0xa')]);router['get'](_0x9e61('0xb'),auth[_0x9e61('0xc')](),controller[_0x9e61('0xd')]);router[_0x9e61('0xe')]('/',auth['isAuthenticated'](),controller[_0x9e61('0xf')]);router[_0x9e61('0x10')](_0x9e61('0xb'),auth['isAuthenticated'](),controller[_0x9e61('0x11')]);router[_0x9e61('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9e61('0x13')]);module[_0x9e61('0x14')]=router;
\ No newline at end of file
+var _0x8d33=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x423035,_0x51ddeb){var _0x3645fc=function(_0x2205f8){while(--_0x2205f8){_0x423035['push'](_0x423035['shift']());}};_0x3645fc(++_0x51ddeb);}(_0x8d33,0x188));var _0x38d3=function(_0x2905e5,_0x2e4016){_0x2905e5=_0x2905e5-0x0;var _0x5d56e7=_0x8d33[_0x2905e5];return _0x5d56e7;};'use strict';var multer=require('multer');var util=require(_0x38d3('0x0'));var path=require(_0x38d3('0x1'));var timeout=require(_0x38d3('0x2'));var express=require(_0x38d3('0x3'));var router=express['Router']();var fs_extra=require(_0x38d3('0x4'));var auth=require(_0x38d3('0x5'));var interaction=require(_0x38d3('0x6'));var config=require(_0x38d3('0x7'));var controller=require('./pause.controller');router[_0x38d3('0x8')]('/',auth[_0x38d3('0x9')](),controller[_0x38d3('0xa')]);router[_0x38d3('0x8')](_0x38d3('0xb'),auth[_0x38d3('0x9')](),controller['show']);router[_0x38d3('0xc')]('/',auth['isAuthenticated'](),controller[_0x38d3('0xd')]);router[_0x38d3('0xe')](_0x38d3('0xb'),auth['isAuthenticated'](),controller[_0x38d3('0xf')]);router[_0x38d3('0x10')](_0x38d3('0xb'),auth['isAuthenticated'](),controller[_0x38d3('0x11')]);module['exports']=router;
\ No newline at end of file
index 33bf215..4184f88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf007=['exports','STRING','sequelize'];(function(_0x4892e9,_0x2cdb5c){var _0x180a79=function(_0x1310f2){while(--_0x1310f2){_0x4892e9['push'](_0x4892e9['shift']());}};_0x180a79(++_0x2cdb5c);}(_0xf007,0xce));var _0x7f00=function(_0x1db863,_0x8f181d){_0x1db863=_0x1db863-0x0;var _0x18b578=_0xf007[_0x1db863];return _0x18b578;};'use strict';var Sequelize=require(_0x7f00('0x0'));module[_0x7f00('0x1')]={'name':{'type':Sequelize[_0x7f00('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7228=['exports','name','STRING','sequelize'];(function(_0x9acae8,_0x382e85){var _0x57a5e4=function(_0x49fdcf){while(--_0x49fdcf){_0x9acae8['push'](_0x9acae8['shift']());}};_0x57a5e4(++_0x382e85);}(_0x7228,0x123));var _0x8722=function(_0x174c14,_0xca5059){_0x174c14=_0x174c14-0x0;var _0x23eadc=_0x7228[_0x174c14];return _0x23eadc;};'use strict';var Sequelize=require(_0x8722('0x0'));module[_0x8722('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8722('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8722('0x3')]}};
\ No newline at end of file
index 0df44bf..e237598 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b26=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','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','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','Pauses','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','Pause','rows','show','params','length','catch'];(function(_0x5a87fb,_0x2c2d6d){var _0x5c1ac5=function(_0x23183c){while(--_0x23183c){_0x5a87fb['push'](_0x5a87fb['shift']());}};_0x5c1ac5(++_0x2c2d6d);}(_0x1b26,0x1c1));var _0x61b2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1b26[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x61b2('0x0'));var rimraf=require(_0x61b2('0x1'));var zipdir=require(_0x61b2('0x2'));var jsonpatch=require(_0x61b2('0x3'));var rp=require(_0x61b2('0x4'));var moment=require(_0x61b2('0x5'));var BPromise=require(_0x61b2('0x6'));var Mustache=require(_0x61b2('0x7'));var util=require(_0x61b2('0x8'));var path=require(_0x61b2('0x9'));var sox=require(_0x61b2('0xa'));var csv=require(_0x61b2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x61b2('0xc'));var squel=require(_0x61b2('0xd'));var crypto=require(_0x61b2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x61b2('0xf'));var toCsv=require(_0x61b2('0xb'));var querystring=require(_0x61b2('0x10'));var Papa=require(_0x61b2('0x11'));var Redis=require(_0x61b2('0x12'));var authService=require(_0x61b2('0x13'));var qs=require(_0x61b2('0x14'));var as=require(_0x61b2('0x15'));var hardwareService=require(_0x61b2('0x16'));var logger=require(_0x61b2('0x17'))('api');var utils=require(_0x61b2('0x18'));var config=require(_0x61b2('0x19'));var licenseUtil=require(_0x61b2('0x1a'));var db=require(_0x61b2('0x1b'))['db'];function respondWithStatusCode(_0x5942e2,_0x5708a9){_0x5708a9=_0x5708a9||0xcc;return function(_0x388511){if(_0x388511){return _0x5942e2[_0x61b2('0x1c')](_0x5708a9);}return _0x5942e2[_0x61b2('0x1d')](_0x5708a9)[_0x61b2('0x1e')]();};}function respondWithResult(_0x3d6bd8,_0x86394c){_0x86394c=_0x86394c||0xc8;return function(_0x375187){if(_0x375187){return _0x3d6bd8[_0x61b2('0x1d')](_0x86394c)[_0x61b2('0x1f')](_0x375187);}};}function respondWithFilteredResult(_0x5d9846,_0x4ce944){return function(_0x51b232){if(_0x51b232){var _0x3ca434=typeof _0x4ce944[_0x61b2('0x20')]===_0x61b2('0x21')&&typeof _0x4ce944[_0x61b2('0x22')]===_0x61b2('0x21');var _0x42e0a5=_0x51b232[_0x61b2('0x23')];var _0x30205c=_0x3ca434?0x0:_0x4ce944['offset'];var _0x48557f=_0x3ca434?_0x51b232[_0x61b2('0x23')]:_0x4ce944[_0x61b2('0x20')]+_0x4ce944[_0x61b2('0x22')];var _0x3cd2a5;if(_0x48557f>=_0x42e0a5){_0x48557f=_0x42e0a5;_0x3cd2a5=0xc8;}else{_0x3cd2a5=0xce;}_0x5d9846[_0x61b2('0x1d')](_0x3cd2a5);return _0x5d9846['set'](_0x61b2('0x24'),_0x30205c+'-'+_0x48557f+'/'+_0x42e0a5)[_0x61b2('0x1f')](_0x51b232);}return null;};}function patchUpdates(_0x4f4abb){return function(_0x50977b){try{jsonpatch['apply'](_0x50977b,_0x4f4abb,!![]);}catch(_0x3af777){return BPromise[_0x61b2('0x25')](_0x3af777);}return _0x50977b[_0x61b2('0x26')]();};}function saveUpdates(_0x2e94dc,_0x2ace49){return function(_0x129c3e){if(_0x129c3e){return _0x129c3e[_0x61b2('0x27')](_0x2e94dc)[_0x61b2('0x28')](function(_0x350f18){return _0x350f18;});}return null;};}function removeEntity(_0x4f5d0a,_0x59f994){return function(_0x3e423a){if(_0x3e423a){return _0x3e423a[_0x61b2('0x29')]()[_0x61b2('0x28')](function(){var _0x130b03=_0x3e423a['get']({'plain':!![]});var _0x29626c=_0x61b2('0x2a');return db[_0x61b2('0x2b')]['destroy']({'where':{'type':_0x29626c,'resourceId':_0x130b03['id']}})[_0x61b2('0x28')](function(){return _0x3e423a;});})['then'](function(){_0x4f5d0a[_0x61b2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f6dfb,_0x50a429){return function(_0x3cfe71){if(!_0x3cfe71){_0x3f6dfb[_0x61b2('0x1c')](0x194);}return _0x3cfe71;};}function handleError(_0x4d8484,_0x399cce){_0x399cce=_0x399cce||0x1f4;return function(_0x2ebbc3){logger[_0x61b2('0x2c')](_0x2ebbc3[_0x61b2('0x2d')]);if(_0x2ebbc3[_0x61b2('0x2e')]){delete _0x2ebbc3[_0x61b2('0x2e')];}_0x4d8484[_0x61b2('0x1d')](_0x399cce)[_0x61b2('0x2f')](_0x2ebbc3);};}exports[_0x61b2('0x30')]=function(_0x27f2fd,_0x372b78){var _0x498af7={},_0x19d166={},_0x32725e={'count':0x0,'rows':[]};var _0xb2e227=_[_0x61b2('0x31')](db['Pause'][_0x61b2('0x32')],function(_0x5c0675){return{'name':_0x5c0675[_0x61b2('0x33')],'type':_0x5c0675['type'][_0x61b2('0x34')]};});_0x19d166[_0x61b2('0x35')]=_['map'](_0xb2e227,_0x61b2('0x2e'));_0x19d166[_0x61b2('0x36')]=_[_0x61b2('0x37')](_0x27f2fd['query']);_0x19d166[_0x61b2('0x38')]=_[_0x61b2('0x39')](_0x19d166['model'],_0x19d166[_0x61b2('0x36')]);_0x498af7['attributes']=_[_0x61b2('0x39')](_0x19d166[_0x61b2('0x35')],qs[_0x61b2('0x3a')](_0x27f2fd['query'][_0x61b2('0x3a')]));_0x498af7[_0x61b2('0x3b')]=_0x498af7['attributes']['length']?_0x498af7[_0x61b2('0x3b')]:_0x19d166[_0x61b2('0x35')];if(!_0x27f2fd[_0x61b2('0x36')][_0x61b2('0x3c')](_0x61b2('0x3d'))){_0x498af7['limit']=qs[_0x61b2('0x22')](_0x27f2fd['query']['limit']);_0x498af7[_0x61b2('0x20')]=qs['offset'](_0x27f2fd['query'][_0x61b2('0x20')]);}_0x498af7[_0x61b2('0x3e')]=qs[_0x61b2('0x3f')](_0x27f2fd[_0x61b2('0x36')]['sort']);_0x498af7[_0x61b2('0x40')]=qs[_0x61b2('0x38')](_[_0x61b2('0x41')](_0x27f2fd[_0x61b2('0x36')],_0x19d166[_0x61b2('0x38')]),_0xb2e227);if(_0x27f2fd[_0x61b2('0x36')][_0x61b2('0x42')]){_0x498af7[_0x61b2('0x40')]=_[_0x61b2('0x43')](_0x498af7['where'],{'$or':_[_0x61b2('0x31')](_0xb2e227,function(_0x4f9793){if(_0x4f9793[_0x61b2('0x44')]!==_0x61b2('0x45')){var _0x33c160={};_0x33c160[_0x4f9793[_0x61b2('0x2e')]]={'$like':'%'+_0x27f2fd[_0x61b2('0x36')][_0x61b2('0x42')]+'%'};return _0x33c160;}})});}_0x498af7=_[_0x61b2('0x43')]({},_0x498af7,_0x27f2fd[_0x61b2('0x46')]);var _0x1870b9={'where':_0x498af7[_0x61b2('0x40')]};return db['Pause'][_0x61b2('0x23')](_0x1870b9)[_0x61b2('0x28')](function(_0x487107){_0x32725e[_0x61b2('0x23')]=_0x487107;if(_0x27f2fd[_0x61b2('0x36')][_0x61b2('0x47')]){_0x498af7[_0x61b2('0x48')]=[{'all':!![]}];}return db[_0x61b2('0x49')]['findAll'](_0x498af7);})[_0x61b2('0x28')](function(_0x4ae493){_0x32725e[_0x61b2('0x4a')]=_0x4ae493;return _0x32725e;})[_0x61b2('0x28')](respondWithFilteredResult(_0x372b78,_0x498af7))['catch'](handleError(_0x372b78,null));};exports[_0x61b2('0x4b')]=function(_0x84728,_0x303b7c){var _0x17437f={'raw':!![],'where':{'id':_0x84728[_0x61b2('0x4c')]['id']}},_0x34ffd9={};_0x34ffd9['model']=_[_0x61b2('0x37')](db[_0x61b2('0x49')][_0x61b2('0x32')]);_0x34ffd9[_0x61b2('0x36')]=_['keys'](_0x84728['query']);_0x34ffd9[_0x61b2('0x38')]=_[_0x61b2('0x39')](_0x34ffd9[_0x61b2('0x35')],_0x34ffd9[_0x61b2('0x36')]);_0x17437f[_0x61b2('0x3b')]=_[_0x61b2('0x39')](_0x34ffd9[_0x61b2('0x35')],qs[_0x61b2('0x3a')](_0x84728[_0x61b2('0x36')]['fields']));_0x17437f[_0x61b2('0x3b')]=_0x17437f[_0x61b2('0x3b')][_0x61b2('0x4d')]?_0x17437f[_0x61b2('0x3b')]:_0x34ffd9[_0x61b2('0x35')];if(_0x84728[_0x61b2('0x36')][_0x61b2('0x47')]){_0x17437f[_0x61b2('0x48')]=[{'all':!![]}];}_0x17437f=_[_0x61b2('0x43')]({},_0x17437f,_0x84728[_0x61b2('0x46')]);return db['Pause']['find'](_0x17437f)[_0x61b2('0x28')](handleEntityNotFound(_0x303b7c,null))[_0x61b2('0x28')](respondWithResult(_0x303b7c,null))[_0x61b2('0x4e')](handleError(_0x303b7c,null));};exports[_0x61b2('0x4f')]=function(_0x34e562,_0xc29036){return db['Pause'][_0x61b2('0x4f')](_0x34e562[_0x61b2('0x50')],{})[_0x61b2('0x28')](function(_0x1d3d39){var _0x33d0d3=_0x34e562[_0x61b2('0x51')]['get']({'plain':!![]});if(!_0x33d0d3)throw new Error(_0x61b2('0x52'));if(_0x33d0d3[_0x61b2('0x53')]==='user'){var _0x45e0a4=_0x1d3d39['get']({'plain':!![]});var _0x13e829=_0x61b2('0x2a');return db[_0x61b2('0x54')][_0x61b2('0x55')]({'where':{'name':_0x13e829,'userProfileId':_0x33d0d3['userProfileId']},'raw':!![]})['then'](function(_0x17b346){if(_0x17b346&&_0x17b346[_0x61b2('0x56')]===0x0){return db[_0x61b2('0x2b')][_0x61b2('0x4f')]({'name':_0x45e0a4[_0x61b2('0x2e')],'resourceId':_0x45e0a4['id'],'type':_0x17b346[_0x61b2('0x2e')],'sectionId':_0x17b346['id']},{})['then'](function(){return _0x1d3d39;});}else{return _0x1d3d39;}})[_0x61b2('0x4e')](function(_0x3fc6b8){logger[_0x61b2('0x2c')](_0x61b2('0x57'),_0x3fc6b8);throw _0x3fc6b8;});}return _0x1d3d39;})[_0x61b2('0x28')](respondWithResult(_0xc29036,0xc9))['catch'](handleError(_0xc29036,null));};exports[_0x61b2('0x27')]=function(_0x3da468,_0x37c2b0){if(_0x3da468[_0x61b2('0x50')]['id']){delete _0x3da468['body']['id'];}return db['Pause']['find']({'where':{'id':_0x3da468[_0x61b2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x37c2b0,null))[_0x61b2('0x28')](saveUpdates(_0x3da468[_0x61b2('0x50')],null))['then'](respondWithResult(_0x37c2b0,null))['catch'](handleError(_0x37c2b0,null));};exports['destroy']=function(_0x3c87ea,_0x5109c7){return db['Pause'][_0x61b2('0x55')]({'where':{'id':_0x3c87ea['params']['id']}})[_0x61b2('0x28')](handleEntityNotFound(_0x5109c7,null))[_0x61b2('0x28')](removeEntity(_0x5109c7,null))[_0x61b2('0x4e')](handleError(_0x5109c7,null));};
\ No newline at end of file
+var _0x8ef5=['index','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Pause','include','rows','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../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','reject','save','update','then','destroy','get','Pauses','UserProfileResource','sendStatus','stack','name','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ef5,0x76));var _0x58ef=function(_0x2271ec,_0x5a98f8){_0x2271ec=_0x2271ec-0x0;var _0x4347cd=_0x8ef5[_0x2271ec];return _0x4347cd;};'use strict';var emlformat=require(_0x58ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x58ef('0x1'));var jsonpatch=require(_0x58ef('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x58ef('0x3'));var Mustache=require(_0x58ef('0x4'));var util=require(_0x58ef('0x5'));var path=require(_0x58ef('0x6'));var sox=require(_0x58ef('0x7'));var csv=require(_0x58ef('0x8'));var ejs=require(_0x58ef('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x58ef('0xa'));var squel=require(_0x58ef('0xb'));var crypto=require('crypto');var jsforce=require(_0x58ef('0xc'));var deskjs=require(_0x58ef('0xd'));var toCsv=require(_0x58ef('0x8'));var querystring=require(_0x58ef('0xe'));var Papa=require(_0x58ef('0xf'));var Redis=require(_0x58ef('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x58ef('0x11'));var hardwareService=require(_0x58ef('0x12'));var logger=require(_0x58ef('0x13'))('api');var utils=require(_0x58ef('0x14'));var config=require(_0x58ef('0x15'));var licenseUtil=require(_0x58ef('0x16'));var db=require(_0x58ef('0x17'))['db'];function respondWithStatusCode(_0x4f91d8,_0x288864){_0x288864=_0x288864||0xcc;return function(_0x76cfca){if(_0x76cfca){return _0x4f91d8['sendStatus'](_0x288864);}return _0x4f91d8[_0x58ef('0x18')](_0x288864)[_0x58ef('0x19')]();};}function respondWithResult(_0x4d5516,_0x39fba1){_0x39fba1=_0x39fba1||0xc8;return function(_0x146e12){if(_0x146e12){return _0x4d5516[_0x58ef('0x18')](_0x39fba1)[_0x58ef('0x1a')](_0x146e12);}};}function respondWithFilteredResult(_0x3c6dcf,_0x221675){return function(_0x2cd06a){if(_0x2cd06a){var _0x36e136=typeof _0x221675['offset']===_0x58ef('0x1b')&&typeof _0x221675[_0x58ef('0x1c')]===_0x58ef('0x1b');var _0x14a000=_0x2cd06a[_0x58ef('0x1d')];var _0x5b4e31=_0x36e136?0x0:_0x221675[_0x58ef('0x1e')];var _0x34bb95=_0x36e136?_0x2cd06a[_0x58ef('0x1d')]:_0x221675[_0x58ef('0x1e')]+_0x221675['limit'];var _0x1dfe75;if(_0x34bb95>=_0x14a000){_0x34bb95=_0x14a000;_0x1dfe75=0xc8;}else{_0x1dfe75=0xce;}_0x3c6dcf[_0x58ef('0x18')](_0x1dfe75);return _0x3c6dcf[_0x58ef('0x1f')](_0x58ef('0x20'),_0x5b4e31+'-'+_0x34bb95+'/'+_0x14a000)[_0x58ef('0x1a')](_0x2cd06a);}return null;};}function patchUpdates(_0x364246){return function(_0x5e435b){try{jsonpatch[_0x58ef('0x21')](_0x5e435b,_0x364246,!![]);}catch(_0x449044){return BPromise[_0x58ef('0x22')](_0x449044);}return _0x5e435b[_0x58ef('0x23')]();};}function saveUpdates(_0x125497,_0x50c277){return function(_0x85e3bd){if(_0x85e3bd){return _0x85e3bd[_0x58ef('0x24')](_0x125497)[_0x58ef('0x25')](function(_0x71e893){return _0x71e893;});}return null;};}function removeEntity(_0x2aaf23,_0x129dc5){return function(_0x3bc625){if(_0x3bc625){return _0x3bc625[_0x58ef('0x26')]()[_0x58ef('0x25')](function(){var _0x587844=_0x3bc625[_0x58ef('0x27')]({'plain':!![]});var _0x53d180=_0x58ef('0x28');return db[_0x58ef('0x29')][_0x58ef('0x26')]({'where':{'type':_0x53d180,'resourceId':_0x587844['id']}})[_0x58ef('0x25')](function(){return _0x3bc625;});})[_0x58ef('0x25')](function(){_0x2aaf23[_0x58ef('0x18')](0xcc)[_0x58ef('0x19')]();});}};}function handleEntityNotFound(_0x45fa82,_0x342963){return function(_0x19d84d){if(!_0x19d84d){_0x45fa82[_0x58ef('0x2a')](0x194);}return _0x19d84d;};}function handleError(_0x12436b,_0xcccbc0){_0xcccbc0=_0xcccbc0||0x1f4;return function(_0x422999){logger['error'](_0x422999[_0x58ef('0x2b')]);if(_0x422999[_0x58ef('0x2c')]){delete _0x422999[_0x58ef('0x2c')];}_0x12436b[_0x58ef('0x18')](_0xcccbc0)[_0x58ef('0x2d')](_0x422999);};}exports[_0x58ef('0x2e')]=function(_0x296cf3,_0x29e8dd){var _0xe6d9ba={},_0x411316={},_0x4e636f={'count':0x0,'rows':[]};var _0x1c39b3=_['map'](db['Pause'][_0x58ef('0x2f')],function(_0x5084d6){return{'name':_0x5084d6['fieldName'],'type':_0x5084d6['type'][_0x58ef('0x30')]};});_0x411316[_0x58ef('0x31')]=_[_0x58ef('0x32')](_0x1c39b3,_0x58ef('0x2c'));_0x411316[_0x58ef('0x33')]=_[_0x58ef('0x34')](_0x296cf3['query']);_0x411316[_0x58ef('0x35')]=_[_0x58ef('0x36')](_0x411316[_0x58ef('0x31')],_0x411316[_0x58ef('0x33')]);_0xe6d9ba[_0x58ef('0x37')]=_['intersection'](_0x411316[_0x58ef('0x31')],qs[_0x58ef('0x38')](_0x296cf3['query'][_0x58ef('0x38')]));_0xe6d9ba[_0x58ef('0x37')]=_0xe6d9ba[_0x58ef('0x37')][_0x58ef('0x39')]?_0xe6d9ba[_0x58ef('0x37')]:_0x411316[_0x58ef('0x31')];if(!_0x296cf3[_0x58ef('0x33')][_0x58ef('0x3a')](_0x58ef('0x3b'))){_0xe6d9ba[_0x58ef('0x1c')]=qs['limit'](_0x296cf3[_0x58ef('0x33')][_0x58ef('0x1c')]);_0xe6d9ba[_0x58ef('0x1e')]=qs['offset'](_0x296cf3[_0x58ef('0x33')][_0x58ef('0x1e')]);}_0xe6d9ba[_0x58ef('0x3c')]=qs['sort'](_0x296cf3[_0x58ef('0x33')][_0x58ef('0x3d')]);_0xe6d9ba[_0x58ef('0x3e')]=qs[_0x58ef('0x35')](_['pick'](_0x296cf3[_0x58ef('0x33')],_0x411316[_0x58ef('0x35')]),_0x1c39b3);if(_0x296cf3[_0x58ef('0x33')][_0x58ef('0x3f')]){_0xe6d9ba[_0x58ef('0x3e')]=_[_0x58ef('0x40')](_0xe6d9ba['where'],{'$or':_[_0x58ef('0x32')](_0x1c39b3,function(_0x1425b4){if(_0x1425b4['type']!==_0x58ef('0x41')){var _0x4aa9c6={};_0x4aa9c6[_0x1425b4['name']]={'$like':'%'+_0x296cf3[_0x58ef('0x33')][_0x58ef('0x3f')]+'%'};return _0x4aa9c6;}})});}_0xe6d9ba=_['merge']({},_0xe6d9ba,_0x296cf3[_0x58ef('0x42')]);var _0x48892d={'where':_0xe6d9ba['where']};return db[_0x58ef('0x43')]['count'](_0x48892d)[_0x58ef('0x25')](function(_0x217325){_0x4e636f['count']=_0x217325;if(_0x296cf3['query']['includeAll']){_0xe6d9ba[_0x58ef('0x44')]=[{'all':!![]}];}return db[_0x58ef('0x43')]['findAll'](_0xe6d9ba);})[_0x58ef('0x25')](function(_0x24788c){_0x4e636f[_0x58ef('0x45')]=_0x24788c;return _0x4e636f;})[_0x58ef('0x25')](respondWithFilteredResult(_0x29e8dd,_0xe6d9ba))['catch'](handleError(_0x29e8dd,null));};exports['show']=function(_0x3bd9df,_0x5d345c){var _0x57d45d={'raw':!![],'where':{'id':_0x3bd9df['params']['id']}},_0x107db9={};_0x107db9[_0x58ef('0x31')]=_[_0x58ef('0x34')](db[_0x58ef('0x43')][_0x58ef('0x2f')]);_0x107db9[_0x58ef('0x33')]=_[_0x58ef('0x34')](_0x3bd9df['query']);_0x107db9[_0x58ef('0x35')]=_[_0x58ef('0x36')](_0x107db9[_0x58ef('0x31')],_0x107db9[_0x58ef('0x33')]);_0x57d45d[_0x58ef('0x37')]=_['intersection'](_0x107db9[_0x58ef('0x31')],qs[_0x58ef('0x38')](_0x3bd9df[_0x58ef('0x33')][_0x58ef('0x38')]));_0x57d45d['attributes']=_0x57d45d['attributes'][_0x58ef('0x39')]?_0x57d45d[_0x58ef('0x37')]:_0x107db9[_0x58ef('0x31')];if(_0x3bd9df[_0x58ef('0x33')]['includeAll']){_0x57d45d['include']=[{'all':!![]}];}_0x57d45d=_[_0x58ef('0x40')]({},_0x57d45d,_0x3bd9df[_0x58ef('0x42')]);return db[_0x58ef('0x43')][_0x58ef('0x46')](_0x57d45d)[_0x58ef('0x25')](handleEntityNotFound(_0x5d345c,null))[_0x58ef('0x25')](respondWithResult(_0x5d345c,null))['catch'](handleError(_0x5d345c,null));};exports[_0x58ef('0x47')]=function(_0x2ca1c3,_0x2df34f){return db[_0x58ef('0x43')][_0x58ef('0x47')](_0x2ca1c3[_0x58ef('0x48')],{})[_0x58ef('0x25')](function(_0x44d4f8){var _0xfcabc7=_0x2ca1c3[_0x58ef('0x49')][_0x58ef('0x27')]({'plain':!![]});if(!_0xfcabc7)throw new Error(_0x58ef('0x4a'));if(_0xfcabc7[_0x58ef('0x4b')]===_0x58ef('0x49')){var _0xf01207=_0x44d4f8[_0x58ef('0x27')]({'plain':!![]});var _0x50080f=_0x58ef('0x28');return db[_0x58ef('0x4c')][_0x58ef('0x46')]({'where':{'name':_0x50080f,'userProfileId':_0xfcabc7[_0x58ef('0x4d')]},'raw':!![]})[_0x58ef('0x25')](function(_0xb462ca){if(_0xb462ca&&_0xb462ca[_0x58ef('0x4e')]===0x0){return db[_0x58ef('0x29')]['create']({'name':_0xf01207[_0x58ef('0x2c')],'resourceId':_0xf01207['id'],'type':_0xb462ca[_0x58ef('0x2c')],'sectionId':_0xb462ca['id']},{})[_0x58ef('0x25')](function(){return _0x44d4f8;});}else{return _0x44d4f8;}})[_0x58ef('0x4f')](function(_0x3e3420){logger['error'](_0x58ef('0x50'),_0x3e3420);throw _0x3e3420;});}return _0x44d4f8;})[_0x58ef('0x25')](respondWithResult(_0x2df34f,0xc9))[_0x58ef('0x4f')](handleError(_0x2df34f,null));};exports[_0x58ef('0x24')]=function(_0x5ac65a,_0x17f194){if(_0x5ac65a[_0x58ef('0x48')]['id']){delete _0x5ac65a[_0x58ef('0x48')]['id'];}return db['Pause'][_0x58ef('0x46')]({'where':{'id':_0x5ac65a[_0x58ef('0x51')]['id']}})[_0x58ef('0x25')](handleEntityNotFound(_0x17f194,null))[_0x58ef('0x25')](saveUpdates(_0x5ac65a[_0x58ef('0x48')],null))[_0x58ef('0x25')](respondWithResult(_0x17f194,null))[_0x58ef('0x4f')](handleError(_0x17f194,null));};exports['destroy']=function(_0x22178f,_0x9490f0){return db['Pause'][_0x58ef('0x46')]({'where':{'id':_0x22178f[_0x58ef('0x51')]['id']}})['then'](handleEntityNotFound(_0x9490f0,null))[_0x58ef('0x25')](removeEntity(_0x9490f0,null))['catch'](handleError(_0x9490f0,null));};
\ No newline at end of file
index 52501d0..750dc69 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(_0x513f27,_0x1cbc87){var _0xa316b7=function(_0x3b592d){while(--_0x3b592d){_0x513f27['push'](_0x513f27['shift']());}};_0xa316b7(++_0x1cbc87);}(_0x7217,0x19e));var _0x7721=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x7217[_0x12d033];return _0x3b4e80;};'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 _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'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':[],'timestamps':!![]});};
\ No newline at end of file
index 059e1f1..a95944c 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(_0xc2eb36,_0x556307){var _0x150821=function(_0x1935be){while(--_0x1935be){_0xc2eb36['push'](_0xc2eb36['shift']());}};_0x150821(++_0x556307);}(_0xb10b,0x12a));var _0xbb10=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xb10b[_0x45bf86];return _0x1f02b7;};'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(_0x16cb0f,_0x5d75cb){var _0xbc1aa=function(_0x21686f){while(--_0x21686f){_0x16cb0f['push'](_0x16cb0f['shift']());}};_0xbc1aa(++_0x5d75cb);}(_0xb10b,0x12a));var _0xbb10=function(_0xae282f,_0x2d9368){_0xae282f=_0xae282f-0x0;var _0x5f46d4=_0xb10b[_0xae282f];return _0x5f46d4;};'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 22cf9fb..c682125 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb903=['replace','basename','originalname','now','extname','post','single','/webhook','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','webhookGet','/:id','isAuthenticated','join','root'];(function(_0x5618d3,_0x3155d7){var _0x486284=function(_0x269230){while(--_0x269230){_0x5618d3['push'](_0x5618d3['shift']());}};_0x486284(++_0x3155d7);}(_0xb903,0x185));var _0x3b90=function(_0x48e788,_0x58e586){_0x48e788=_0x48e788-0x0;var _0x38c19a=_0xb903[_0x48e788];return _0x38c19a;};'use strict';var multer=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var path=require(_0x3b90('0x2'));var timeout=require(_0x3b90('0x3'));var express=require('express');var router=express[_0x3b90('0x4')]();var fs_extra=require(_0x3b90('0x5'));var auth=require(_0x3b90('0x6'));var interaction=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var controller=require(_0x3b90('0x9'));router[_0x3b90('0xa')]('/',auth['isAuthenticated'](),controller[_0x3b90('0xb')]);router['get']('/webhook',controller[_0x3b90('0xc')]);router[_0x3b90('0xa')](_0x3b90('0xd'),auth[_0x3b90('0xe')](),controller['show']);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x336913,_0x5af39c,_0x574955){_0x574955(null,path[_0x3b90('0xf')](config[_0x3b90('0x10')],'server/files/plugins'));},'filename':function(_0x45b75f,_0x174c0d,_0x43c08c){_0x174c0d['originalname']=_0x174c0d['originalname'][_0x3b90('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x43c08c(null,util['format']('%s-%s%s',path[_0x3b90('0x12')](_0x174c0d[_0x3b90('0x13')],path['extname'](_0x174c0d['originalname'])),Date[_0x3b90('0x14')](),path[_0x3b90('0x15')](_0x174c0d[_0x3b90('0x13')])));}})});router[_0x3b90('0x16')]('/',upload[_0x3b90('0x17')]('file'),controller['upload']);router[_0x3b90('0x16')](_0x3b90('0x18'),controller['webhookPost']);router[_0x3b90('0x19')](_0x3b90('0xd'),auth[_0x3b90('0xe')](),controller[_0x3b90('0x1a')]);router['delete'](_0x3b90('0xd'),auth['isAuthenticated'](),controller[_0x3b90('0x1b')]);module[_0x3b90('0x1c')]=router;
\ No newline at end of file
+var _0xf3cd=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','update'];(function(_0x408108,_0x50e688){var _0x37d44e=function(_0x159b84){while(--_0x159b84){_0x408108['push'](_0x408108['shift']());}};_0x37d44e(++_0x50e688);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x26641c,_0x1ba2a5){_0x26641c=_0x26641c-0x0;var _0x42c01a=_0xf3cd[_0x26641c];return _0x42c01a;};'use strict';var multer=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var timeout=require(_0xdf3c('0x3'));var express=require(_0xdf3c('0x4'));var router=express[_0xdf3c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdf3c('0x6'));var interaction=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var controller=require('./plugin.controller');router[_0xdf3c('0x9')]('/',auth[_0xdf3c('0xa')](),controller[_0xdf3c('0xb')]);router[_0xdf3c('0x9')](_0xdf3c('0xc'),controller[_0xdf3c('0xd')]);router['get'](_0xdf3c('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xdf3c('0x9')](_0xdf3c('0xf'),auth['isAuthenticated'](),controller[_0xdf3c('0x10')]);var upload=multer({'storage':multer[_0xdf3c('0x11')]({'destination':function(_0x2d420c,_0x21a6e5,_0x3a3154){_0x3a3154(null,path[_0xdf3c('0x12')](config[_0xdf3c('0x13')],_0xdf3c('0x14')));},'filename':function(_0x5e8925,_0x1d483c,_0x166ae5){_0x1d483c[_0xdf3c('0x15')]=_0x1d483c[_0xdf3c('0x15')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x166ae5(null,util[_0xdf3c('0x16')](_0xdf3c('0x17'),path[_0xdf3c('0x18')](_0x1d483c['originalname'],path[_0xdf3c('0x19')](_0x1d483c[_0xdf3c('0x15')])),Date[_0xdf3c('0x1a')](),path[_0xdf3c('0x19')](_0x1d483c[_0xdf3c('0x15')])));}})});router[_0xdf3c('0x1b')]('/',upload[_0xdf3c('0x1c')](_0xdf3c('0x1d')),controller[_0xdf3c('0x1e')]);router[_0xdf3c('0x1b')]('/webhook',controller[_0xdf3c('0x1f')]);router[_0xdf3c('0x20')](_0xdf3c('0xe'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x21')]);router[_0xdf3c('0x22')](_0xdf3c('0xe'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x22')]);module[_0xdf3c('0x23')]=router;
\ No newline at end of file
index 4838cca..a082dce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6d0=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','ENUM','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x58b3ca,_0x4183bc){var _0x1dfab9=function(_0xa24c69){while(--_0xa24c69){_0x58b3ca['push'](_0x58b3ca['shift']());}};_0x1dfab9(++_0x4183bc);}(_0xb6d0,0x19e));var _0x0b6d=function(_0x3c307c,_0x1b06c4){_0x3c307c=_0x3c307c-0x0;var _0x32cf08=_0xb6d0[_0x3c307c];return _0x32cf08;};'use strict';var Sequelize=require(_0x0b6d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0b6d('0x1')](_0x0b6d('0x2'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x0b6d('0x3')]},'path':{'type':Sequelize[_0x0b6d('0x4')],'comment':_0x0b6d('0x5')},'active':{'type':Sequelize[_0x0b6d('0x6')],'defaultValue':0x0,'comment':_0x0b6d('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x0b6d('0x8'),_0x0b6d('0x9'),'always','never'),'defaultValue':_0x0b6d('0xa'),'comment':_0x0b6d('0xb')},'icon':{'type':Sequelize[_0x0b6d('0x4')]},'adminUrl':{'type':Sequelize[_0x0b6d('0x4')]},'agentUrl':{'type':Sequelize[_0x0b6d('0x4')]},'scriptName':{'type':Sequelize[_0x0b6d('0x4')]},'scriptPath':{'type':Sequelize[_0x0b6d('0x4')]}};
\ No newline at end of file
+var _0x8d80=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','agentOnly','always','never','exports','STRING','ENUM','html','script','TEXT'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8d80,0x9a));var _0x08d8=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0x8d80[_0xb66df];return _0x42a702;};'use strict';var Sequelize=require('sequelize');module[_0x08d8('0x0')]={'name':{'type':Sequelize[_0x08d8('0x1')]},'type':{'type':Sequelize[_0x08d8('0x2')](_0x08d8('0x3'),_0x08d8('0x4'))},'description':{'type':Sequelize[_0x08d8('0x5')]},'version':{'type':Sequelize[_0x08d8('0x5')]},'path':{'type':Sequelize[_0x08d8('0x1')],'comment':_0x08d8('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x08d8('0x2')]('adminOnly',_0x08d8('0x7'),_0x08d8('0x8'),_0x08d8('0x9')),'defaultValue':_0x08d8('0x8'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x08d8('0x1')]},'adminUrl':{'type':Sequelize[_0x08d8('0x1')]},'agentUrl':{'type':Sequelize[_0x08d8('0x1')]},'scriptName':{'type':Sequelize[_0x08d8('0x1')]},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f65cacb..2c1661e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7746=['Extracted\x20folder\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','port','encoding','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','sendStatus','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','extract-zip','rimraf','archiver','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./plugin.socket','status','end','json','offset','undefined','count','set','Content-Range','reject','update','destroy','get','Plugins','then','name','send','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','pick','filter','where','merge','VIRTUAL','includeAll','include','Plugin','findAll','rows','catch','show','rawAttributes','length','options','find','download','params','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','error','Invalid\x20plugin\x20structure','isDirectory','some','Plugin\x20manifest\x20missing','manifest.json','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','version','plugins','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3fcbf9,_0x57c9a2){var _0x2b5636=function(_0x236b29){while(--_0x236b29){_0x3fcbf9['push'](_0x3fcbf9['shift']());}};_0x2b5636(++_0x57c9a2);}(_0x7746,0x151));var _0x6774=function(_0x1d3817,_0x2f6516){_0x1d3817=_0x1d3817-0x0;var _0x3aa463=_0x7746[_0x1d3817];return _0x3aa463;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6774('0x0'));var jsonpatch=require(_0x6774('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6774('0x2'));var Mustache=require(_0x6774('0x3'));var util=require('util');var path=require(_0x6774('0x4'));var sox=require(_0x6774('0x5'));var csv=require('to-csv');var ejs=require(_0x6774('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6774('0x7'));var squel=require('squel');var crypto=require(_0x6774('0x8'));var jsforce=require(_0x6774('0x9'));var deskjs=require(_0x6774('0xa'));var toCsv=require(_0x6774('0xb'));var querystring=require('querystring');var Papa=require(_0x6774('0xc'));var extract=require(_0x6774('0xd'));var rimraf=require(_0x6774('0xe'));var archiver=require(_0x6774('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6774('0x10'));var as=require(_0x6774('0x11'));var hardwareService=require(_0x6774('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6774('0x13'))['db'];config['redis']=_[_0x6774('0x14')](config['redis'],{'host':_0x6774('0x15'),'port':0x18eb});var socket=require(_0x6774('0x16'))(new Redis(config[_0x6774('0x17')]));require(_0x6774('0x18'))['register'](socket);function respondWithStatusCode(_0x340c7e,_0x2afaee){_0x2afaee=_0x2afaee||0xcc;return function(_0x304529){if(_0x304529){return _0x340c7e['sendStatus'](_0x2afaee);}return _0x340c7e[_0x6774('0x19')](_0x2afaee)[_0x6774('0x1a')]();};}function respondWithResult(_0x2d1ace,_0x2bb826){_0x2bb826=_0x2bb826||0xc8;return function(_0x41dc72){if(_0x41dc72){return _0x2d1ace[_0x6774('0x19')](_0x2bb826)[_0x6774('0x1b')](_0x41dc72);}};}function respondWithFilteredResult(_0x5cd27a,_0x6e504b){return function(_0xc4d439){if(_0xc4d439){var _0x24f1ac=typeof _0x6e504b[_0x6774('0x1c')]===_0x6774('0x1d')&&typeof _0x6e504b['limit']===_0x6774('0x1d');var _0x1894c2=_0xc4d439[_0x6774('0x1e')];var _0x47e3f7=_0x24f1ac?0x0:_0x6e504b['offset'];var _0x15df2f=_0x24f1ac?_0xc4d439[_0x6774('0x1e')]:_0x6e504b[_0x6774('0x1c')]+_0x6e504b['limit'];var _0x243253;if(_0x15df2f>=_0x1894c2){_0x15df2f=_0x1894c2;_0x243253=0xc8;}else{_0x243253=0xce;}_0x5cd27a[_0x6774('0x19')](_0x243253);return _0x5cd27a[_0x6774('0x1f')](_0x6774('0x20'),_0x47e3f7+'-'+_0x15df2f+'/'+_0x1894c2)[_0x6774('0x1b')](_0xc4d439);}return null;};}function patchUpdates(_0x53a862){return function(_0x423e31){try{jsonpatch['apply'](_0x423e31,_0x53a862,!![]);}catch(_0x3b1ed3){return BPromise[_0x6774('0x21')](_0x3b1ed3);}return _0x423e31['save']();};}function saveUpdates(_0x4c1af1,_0x2bd50f){return function(_0x5aa7d1){if(_0x5aa7d1){return _0x5aa7d1[_0x6774('0x22')](_0x4c1af1)['then'](function(_0x4771f4){return _0x4771f4;});}return null;};}function removeEntity(_0x168911,_0x1f2e36){return function(_0x196ac4){if(_0x196ac4){return _0x196ac4[_0x6774('0x23')]()['then'](function(){var _0x4813f6=_0x196ac4[_0x6774('0x24')]({'plain':!![]});var _0x5b8625=_0x6774('0x25');return db['UserProfileResource'][_0x6774('0x23')]({'where':{'type':_0x5b8625,'resourceId':_0x4813f6['id']}})[_0x6774('0x26')](function(){return _0x196ac4;});})['then'](function(){_0x168911[_0x6774('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f5486,_0x265b9e){return function(_0x490c8f){if(!_0x490c8f){_0x1f5486['sendStatus'](0x194);}return _0x490c8f;};}function handleError(_0x38f5e7,_0x3adf95){_0x3adf95=_0x3adf95||0x1f4;return function(_0x2b8add){logger['error'](_0x2b8add['stack']);if(_0x2b8add[_0x6774('0x27')]){delete _0x2b8add['name'];}_0x38f5e7['status'](_0x3adf95)[_0x6774('0x28')](_0x2b8add);};}exports['index']=function(_0x35ca52,_0x5afb77){var _0x2602ad={},_0x5dbb03={},_0x2bd7e0={'count':0x0,'rows':[]};var _0x197243=_['map'](db['Plugin']['rawAttributes'],function(_0x28567e){return{'name':_0x28567e[_0x6774('0x29')],'type':_0x28567e[_0x6774('0x2a')]['key']};});_0x5dbb03['model']=_['map'](_0x197243,_0x6774('0x27'));_0x5dbb03[_0x6774('0x2b')]=_[_0x6774('0x2c')](_0x35ca52['query']);_0x5dbb03[_0x6774('0x2d')]=_[_0x6774('0x2e')](_0x5dbb03[_0x6774('0x2f')],_0x5dbb03[_0x6774('0x2b')]);_0x2602ad[_0x6774('0x30')]=_[_0x6774('0x2e')](_0x5dbb03[_0x6774('0x2f')],qs[_0x6774('0x31')](_0x35ca52[_0x6774('0x2b')]['fields']));_0x2602ad[_0x6774('0x30')]=_0x2602ad['attributes']['length']?_0x2602ad['attributes']:_0x5dbb03[_0x6774('0x2f')];if(!_0x35ca52[_0x6774('0x2b')][_0x6774('0x32')](_0x6774('0x33'))){_0x2602ad[_0x6774('0x34')]=qs['limit'](_0x35ca52[_0x6774('0x2b')][_0x6774('0x34')]);_0x2602ad[_0x6774('0x1c')]=qs[_0x6774('0x1c')](_0x35ca52[_0x6774('0x2b')]['offset']);}_0x2602ad[_0x6774('0x35')]=qs['sort'](_0x35ca52[_0x6774('0x2b')]['sort']);_0x2602ad['where']=qs[_0x6774('0x2d')](_[_0x6774('0x36')](_0x35ca52['query'],_0x5dbb03[_0x6774('0x2d')]),_0x197243);if(_0x35ca52[_0x6774('0x2b')][_0x6774('0x37')]){_0x2602ad[_0x6774('0x38')]=_[_0x6774('0x39')](_0x2602ad[_0x6774('0x38')],{'$or':_['map'](_0x197243,function(_0x176a11){if(_0x176a11['type']!==_0x6774('0x3a')){var _0x44e3d4={};_0x44e3d4[_0x176a11[_0x6774('0x27')]]={'$like':'%'+_0x35ca52[_0x6774('0x2b')][_0x6774('0x37')]+'%'};return _0x44e3d4;}})});}_0x2602ad=_[_0x6774('0x39')]({},_0x2602ad,_0x35ca52['options']);var _0x3a1229={'where':_0x2602ad[_0x6774('0x38')]};return db['Plugin'][_0x6774('0x1e')](_0x3a1229)[_0x6774('0x26')](function(_0x291e5b){_0x2bd7e0['count']=_0x291e5b;if(_0x35ca52[_0x6774('0x2b')][_0x6774('0x3b')]){_0x2602ad[_0x6774('0x3c')]=[{'all':!![]}];}return db[_0x6774('0x3d')][_0x6774('0x3e')](_0x2602ad);})[_0x6774('0x26')](function(_0x48f83e){_0x2bd7e0[_0x6774('0x3f')]=_0x48f83e;return _0x2bd7e0;})['then'](respondWithFilteredResult(_0x5afb77,_0x2602ad))[_0x6774('0x40')](handleError(_0x5afb77,null));};exports[_0x6774('0x41')]=function(_0x2a0c38,_0x19fecc){var _0x23b470={'raw':!![],'where':{'id':_0x2a0c38['params']['id']}},_0x4d79e4={};_0x4d79e4[_0x6774('0x2f')]=_[_0x6774('0x2c')](db['Plugin'][_0x6774('0x42')]);_0x4d79e4[_0x6774('0x2b')]=_[_0x6774('0x2c')](_0x2a0c38[_0x6774('0x2b')]);_0x4d79e4[_0x6774('0x2d')]=_['intersection'](_0x4d79e4['model'],_0x4d79e4[_0x6774('0x2b')]);_0x23b470[_0x6774('0x30')]=_[_0x6774('0x2e')](_0x4d79e4[_0x6774('0x2f')],qs[_0x6774('0x31')](_0x2a0c38[_0x6774('0x2b')][_0x6774('0x31')]));_0x23b470[_0x6774('0x30')]=_0x23b470[_0x6774('0x30')][_0x6774('0x43')]?_0x23b470[_0x6774('0x30')]:_0x4d79e4[_0x6774('0x2f')];if(_0x2a0c38[_0x6774('0x2b')][_0x6774('0x3b')]){_0x23b470[_0x6774('0x3c')]=[{'all':!![]}];}_0x23b470=_[_0x6774('0x39')]({},_0x23b470,_0x2a0c38[_0x6774('0x44')]);return db[_0x6774('0x3d')][_0x6774('0x45')](_0x23b470)[_0x6774('0x26')](handleEntityNotFound(_0x19fecc,null))[_0x6774('0x26')](respondWithResult(_0x19fecc,null))[_0x6774('0x40')](handleError(_0x19fecc,null));};exports[_0x6774('0x46')]=function(_0x398b3d,_0x2ffccc,_0x5a7027){return db[_0x6774('0x3d')]['find']({'where':{'id':_0x398b3d[_0x6774('0x47')]['id']},'attributes':[_0x6774('0x27'),_0x6774('0x4')],'raw':!![]})['then'](handleEntityNotFound(_0x2ffccc,null))[_0x6774('0x26')](function(_0x3a3ee6){if(_0x3a3ee6){var _0x5cabb1=path[_0x6774('0x48')](config[_0x6774('0x49')],_0x6774('0x4a'),util[_0x6774('0x4b')](_0x6774('0x4c'),path[_0x6774('0x4d')](_0x3a3ee6[_0x6774('0x4')])));var _0x15558d=fs[_0x6774('0x4e')](_0x5cabb1);var _0x4438b4=archiver(_0x6774('0x4f'),{'zlib':{'level':0x9}});_0x4438b4['on'](_0x6774('0x50'),function(_0x9245ae){if(_0x9245ae[_0x6774('0x51')]===_0x6774('0x52')){logger['error'](_0x9245ae);}else{throw new db[(_0x6774('0x53'))][(_0x6774('0x54'))](_0x6774('0x55'));}});_0x4438b4['on']('error',function(_0x3365b9){throw new db['Sequelize'][(_0x6774('0x54'))](_0x6774('0x55'));});_0x4438b4['pipe'](_0x15558d);_0x4438b4['glob'](_0x6774('0x56'),{'cwd':path[_0x6774('0x48')](config[_0x6774('0x49')],_0x6774('0x4a'),path[_0x6774('0x57')](_0x3a3ee6[_0x6774('0x4')])),'ignore':[path[_0x6774('0x48')](path[_0x6774('0x4d')](_0x3a3ee6['path']),'node_modules/**/*'),path[_0x6774('0x48')](path[_0x6774('0x4d')](_0x3a3ee6[_0x6774('0x4')]),_0x6774('0x58'))],'nodir':!![]})[_0x6774('0x59')]();_0x15558d['on'](_0x6774('0x5a'),function(){if(!fs[_0x6774('0x5b')](_0x5cabb1)){throw new db[(_0x6774('0x53'))][(_0x6774('0x54'))](_0x6774('0x5c'));}return _0x2ffccc[_0x6774('0x46')](_0x5cabb1,util[_0x6774('0x4b')]('%s.zip',path[_0x6774('0x4d')](_0x3a3ee6[_0x6774('0x4')])),function(_0x531433){if(_0x531433){throw new db[(_0x6774('0x53'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x6774('0x5d')](_0x5cabb1);logger['info']('Download\x20completed');logger[_0x6774('0x5e')](_0x6774('0x5f'));});});}return null;})[_0x6774('0x40')](handleError(_0x2ffccc,null));};exports[_0x6774('0x60')]=function(_0x50fc15,_0x598b20,_0xca880f){var _0x586b80=path[_0x6774('0x4d')](_0x50fc15[_0x6774('0x61')][_0x6774('0x62')],path[_0x6774('0x63')](_0x50fc15[_0x6774('0x61')]['filename']));var _0x259ed7=path[_0x6774('0x48')](config['root'],_0x6774('0x4a'),_0x50fc15[_0x6774('0x61')][_0x6774('0x62')]);var _0x563c02=path[_0x6774('0x48')](config['root'],_0x6774('0x4a'),_0x586b80);logger[_0x6774('0x5e')](_0x6774('0x64'),_0x259ed7);logger[_0x6774('0x5e')](_0x6774('0x65'),_0x563c02);try{fs[_0x6774('0x66')](_0x259ed7,parseInt(_0x6774('0x67'),0x8));extract(_0x259ed7,{'dir':_0x563c02},function(_0x19af06){if(_0x19af06){logger['error'](_0x19af06);handleError(_0x19af06,!![]);};var _0x78028e=fs[_0x6774('0x68')](_0x563c02);if(_0x78028e[_0x6774('0x43')]>0x1){removeReferences(_0x259ed7,_0x563c02);logger[_0x6774('0x69')]('Invalid\x20plugin\x20structure');return _0xca880f(new Error(_0x6774('0x6a')));}var _0xe407c9=fs['lstatSync'](path[_0x6774('0x48')](_0x563c02,_0x78028e[0x0]));if(_0xe407c9['isFile']()){removeReferences(_0x259ed7,_0x563c02);logger[_0x6774('0x69')](_0x6774('0x6a'));return _0xca880f(new Error(_0x6774('0x6a')));}if(_0xe407c9[_0x6774('0x6b')]()){var _0x53d604=fs[_0x6774('0x68')](path[_0x6774('0x48')](_0x563c02,_0x78028e[0x0]));if(_0x53d604['length']===0x0){removeReferences(_0x259ed7,_0x563c02);logger[_0x6774('0x69')](_0x6774('0x6a'));return _0xca880f(new Error(_0x6774('0x6a')));}var _0x2c64a0=_0x53d604[_0x6774('0x6c')](function(_0x1fc7a5){return _0x1fc7a5==='manifest.json';});if(!_0x2c64a0){return _0xca880f(new Error(_0x6774('0x6d')));}var _0x19308a=fs['readFileSync'](path[_0x6774('0x48')](_0x563c02,_0x78028e[0x0],_0x6774('0x6e')));var _0x40a1cd=JSON['parse'](_0x19308a);if(_0x6774('0x1d')==typeof _0x40a1cd[_0x6774('0x27')]){return _0xca880f(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x6774('0x1d')==typeof _0x40a1cd[_0x6774('0x2a')]){return _0xca880f(new Error(_0x6774('0x6f')));}if(_0x6774('0x1d')==typeof _0x40a1cd['version']){return _0xca880f(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x6774('0x1d')==typeof _0x40a1cd[_0x6774('0x70')]){return _0xca880f(new Error(_0x6774('0x71')));}if(_0x40a1cd['type']===_0x6774('0x72')){if(_0x6774('0x1d')==typeof _0x40a1cd['parameters'][_0x6774('0x73')]){return _0xca880f(new Error(_0x6774('0x74')));}if(_0x6774('0x1d')==typeof _0x40a1cd[_0x6774('0x70')][_0x6774('0x73')][_0x6774('0x75')]&&_0x6774('0x1d')==typeof _0x40a1cd['parameters']['views'][_0x6774('0x76')]){return _0xca880f(new Error(_0x6774('0x77')));}}else if(_0x40a1cd['type']===_0x6774('0x78')){if(_0x6774('0x1d')==typeof _0x40a1cd['parameters'][_0x6774('0x79')]){return _0xca880f(new Error(_0x6774('0x7a')));}if('undefined'==typeof _0x40a1cd[_0x6774('0x70')][_0x6774('0x7b')]){return _0xca880f(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0xca880f(new Error(_0x6774('0x7c')));}var _0x13f605=_0x40a1cd[_0x6774('0x27')];var _0x38007f=_0x40a1cd[_0x6774('0x7d')];var _0x23a63b=_0x40a1cd['type'];var _0x316f9e=_0x40a1cd[_0x6774('0x7e')]?_0x40a1cd['sidebar']:'always';var _0x581442=_0x40a1cd[_0x6774('0x7f')]?_0x40a1cd[_0x6774('0x7f')]:_0x6774('0x80');var _0x4021a2='';var _0x14ff60='';var _0x4d9796='';var _0x1e2ae6='';var _0x3221a9=_0x40a1cd[_0x6774('0x81')];if(_0x23a63b===_0x6774('0x72')){if(_0x6774('0x1d')!=typeof _0x40a1cd['parameters'][_0x6774('0x73')][_0x6774('0x75')]){var _0x4da5ff=_0x40a1cd[_0x6774('0x70')]['views'][_0x6774('0x75')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4da5ff)){_0x4021a2=path[_0x6774('0x48')](_0x6774('0x82'),_0x586b80,_0x78028e[0x0],_0x4da5ff);}else{_0x4021a2=_0x4da5ff;}}else{logger[_0x6774('0x5e')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x6774('0x1d')!=typeof _0x40a1cd[_0x6774('0x70')][_0x6774('0x73')]['agent']){var _0x3d6be2=_0x40a1cd[_0x6774('0x70')][_0x6774('0x73')][_0x6774('0x76')];if(!/^(f|ht)tps?:\/\//i[_0x6774('0x83')](_0x3d6be2)){_0x14ff60=path[_0x6774('0x48')](_0x6774('0x82'),_0x586b80,_0x78028e[0x0],_0x3d6be2);}else{_0x14ff60=_0x3d6be2;}}else{logger[_0x6774('0x5e')](_0x6774('0x84'));}}else if(_0x23a63b===_0x6774('0x78')){_0x4d9796=_0x40a1cd[_0x6774('0x70')]['scriptName'];_0x1e2ae6=_0x40a1cd[_0x6774('0x70')]['scriptPath'];if('undefined'!=typeof _0x40a1cd[_0x6774('0x70')][_0x6774('0x73')]){if(_0x6774('0x1d')!=typeof _0x40a1cd[_0x6774('0x70')][_0x6774('0x73')][_0x6774('0x75')]){var _0x4da5ff=_0x40a1cd['parameters'][_0x6774('0x73')][_0x6774('0x75')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4da5ff)){_0x4021a2=path[_0x6774('0x48')](_0x6774('0x82'),_0x586b80,_0x78028e[0x0],_0x4da5ff);}else{_0x4021a2=_0x4da5ff;}}if(_0x6774('0x1d')!=typeof _0x40a1cd[_0x6774('0x70')][_0x6774('0x73')][_0x6774('0x76')]){var _0x3d6be2=_0x40a1cd[_0x6774('0x70')][_0x6774('0x73')][_0x6774('0x76')];if(!/^(f|ht)tps?:\/\//i[_0x6774('0x83')](_0x3d6be2)){_0x14ff60=path['join'](_0x6774('0x82'),_0x586b80,_0x78028e[0x0],_0x3d6be2);}else{_0x14ff60=_0x3d6be2;}}}}var _0x5126f7={'name':_0x13f605,'description':_0x38007f,'path':path['join'](_0x586b80,_0x78028e[0x0]),'type':_0x23a63b,'sidebar':_0x316f9e,'icon':_0x581442,'adminUrl':_0x4021a2,'agentUrl':_0x14ff60,'scriptName':_0x4d9796,'scriptPath':_0x1e2ae6,'version':_0x3221a9};removeReferences(_0x259ed7,null);return db[_0x6774('0x3d')][_0x6774('0x85')](_0x5126f7)['then'](function(_0xa59451){var _0x56b870={'role':_0x50fc15[_0x6774('0x86')]['role'],'userProfileId':_0x50fc15[_0x6774('0x86')][_0x6774('0x87')]};if(!_0x56b870)throw new Error(_0x6774('0x88'));if(_0x56b870[_0x6774('0x89')]===_0x6774('0x8a')){var _0x9c1461=_0xa59451[_0x6774('0x24')]({'plain':!![]});return db[_0x6774('0x8b')][_0x6774('0x45')]({'where':{'name':_0x6774('0x25'),'userProfileId':_0x56b870[_0x6774('0x87')]},'raw':!![]})[_0x6774('0x26')](function(_0x2b26b7){if(_0x2b26b7&&_0x2b26b7[_0x6774('0x8c')]===0x0){return db[_0x6774('0x8d')][_0x6774('0x85')]({'name':_0x9c1461[_0x6774('0x27')],'resourceId':_0x9c1461['id'],'type':_0x2b26b7[_0x6774('0x27')],'sectionId':_0x2b26b7['id']},{})['then'](function(){return _0xa59451;});}else{return _0xa59451;}})['catch'](function(_0x45f5a1){logger[_0x6774('0x69')](_0x6774('0x8e'),_0x45f5a1);throw _0x45f5a1;});}return _0xa59451;})[_0x6774('0x26')](respondWithResult(_0x598b20,null))[_0x6774('0x40')](handleError(_0x598b20,null));}});}catch(_0x5a26b4){_0x598b20[_0x6774('0x19')](0x1f4)[_0x6774('0x28')](_0x5a26b4);}};function removeReferences(_0x393403,_0x2373b9){try{if(_0x393403){fs[_0x6774('0x5d')](_0x393403);logger[_0x6774('0x5e')]('Zip\x20archive\x20removed');}if(_0x2373b9){rimraf(_0x2373b9,function(){});logger[_0x6774('0x5e')](_0x6774('0x8f'));}}catch(_0x113570){logger['error'](_0x113570);}}exports[_0x6774('0x22')]=function(_0x2a6a8c,_0x32bab0,_0x2ed26b){return db[_0x6774('0x3d')][_0x6774('0x45')]({'where':{'id':_0x2a6a8c['params']['id']}})[_0x6774('0x26')](handleEntityNotFound(_0x32bab0,null))[_0x6774('0x26')](saveUpdates(_0x2a6a8c[_0x6774('0x86')],null))['then'](respondWithResult(_0x32bab0,null))[_0x6774('0x40')](handleError(_0x32bab0,null));};exports[_0x6774('0x90')]=function(_0x428d74,_0x5c804c,_0x1d0afc){return db[_0x6774('0x3d')]['find']({'where':{'id':_0x428d74['params']['id']}})[_0x6774('0x26')](function(_0x3375bb){if(_0x3375bb){return _0x3375bb[_0x6774('0x23')]();}})[_0x6774('0x26')](function(_0x44eb73){rimraf(path[_0x6774('0x48')](config['root'],_0x6774('0x4a'),path[_0x6774('0x57')](_0x44eb73[_0x6774('0x4')])),function(){});return _0x44eb73;})['then'](handleEntityNotFound(_0x5c804c,null))['then'](respondWithStatusCode(_0x5c804c,null))[_0x6774('0x40')](handleError(_0x5c804c,null));};exports[_0x6774('0x91')]=function(_0x4bb616,_0x26c42a,_0x15c3e1){return BPromise['resolve']()['then'](function(){if(!_0x4bb616[_0x6774('0x2b')][_0x6774('0x4')]){throw new Error(_0x6774('0x92'));}if(!_0x4bb616[_0x6774('0x2b')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3cb7b1=_0x4bb616[_0x6774('0x2b')][_0x6774('0x93')]?_0x4bb616[_0x6774('0x2b')][_0x6774('0x93')]+':'+_0x4bb616[_0x6774('0x2b')][_0x6774('0x94')]:'http://localhost:'+_0x4bb616[_0x6774('0x2b')][_0x6774('0x94')];var _0x557c50=_0x4bb616[_0x6774('0x2b')][_0x6774('0x1b')]?_0x4bb616[_0x6774('0x2b')][_0x6774('0x1b')]:!![];var _0x4b251b=_0x4bb616[_0x6774('0x2b')][_0x6774('0x95')]?_0x4bb616[_0x6774('0x2b')][_0x6774('0x95')]:null;var _0x51b286={'method':_0x4bb616['method'],'uri':util[_0x6774('0x4b')]('%s%s',_0x3cb7b1,_0x4bb616[_0x6774('0x2b')][_0x6774('0x4')]),'json':_0x557c50,'resolveWithFullResponse':!![],'encoding':_0x4b251b,'qs':_0x4bb616['query']};if(_0x4bb616[_0x6774('0x96')]){_0x51b286[_0x6774('0x96')]=_0x4bb616[_0x6774('0x96')];if(_0x51b286[_0x6774('0x96')][_0x6774('0x97')]){delete _0x51b286[_0x6774('0x96')]['content-length'];}}if(_0x51b286['headers'][_0x6774('0x98')]){delete _0x51b286['headers']['content-type'];}return rp(_0x51b286);})['then'](function(_0x5f38dc){if(_0x5f38dc){_0x26c42a[_0x6774('0x1f')](_0x5f38dc[_0x6774('0x96')]);logger[_0x6774('0x5e')](_0x5f38dc[_0x6774('0x86')]);if(_[_0x6774('0x99')](_0x4bb616[_0x6774('0x2b')][_0x6774('0x4')],_0x6774('0x46'))&&_0x5f38dc[_0x6774('0x9a')]==0x1f4){return _0x26c42a['sendStatus'](_0x5f38dc[_0x6774('0x9a')]);}else{return _0x26c42a[_0x6774('0x19')](_0x5f38dc[_0x6774('0x9a')])[_0x6774('0x28')](_0x5f38dc[_0x6774('0x86')]);}}else{return _0x26c42a['sendStatus'](0xc8);}})['catch'](handleError(_0x26c42a,null));};exports[_0x6774('0x9b')]=function(_0x2605eb,_0x299dbf,_0x42a8a7){return BPromise[_0x6774('0x9c')]()[_0x6774('0x26')](function(){if(!_0x2605eb[_0x6774('0x2b')][_0x6774('0x4')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2605eb[_0x6774('0x2b')]['port']){throw new Error(_0x6774('0x9d'));}var _0x22d156=_0x2605eb[_0x6774('0x2b')]['hostname']?_0x2605eb[_0x6774('0x2b')][_0x6774('0x93')]+':'+_0x2605eb[_0x6774('0x2b')][_0x6774('0x94')]:_0x6774('0x9e')+_0x2605eb['query'][_0x6774('0x94')];var _0x4ff7b9=_0x2605eb['query'][_0x6774('0x1b')]?_0x2605eb[_0x6774('0x2b')][_0x6774('0x1b')]:!![];var _0x46373b=_0x2605eb[_0x6774('0x2b')]['encoding']?_0x2605eb['query'][_0x6774('0x95')]:null;var _0x787ee1={'method':_0x2605eb['method'],'uri':util[_0x6774('0x4b')]('%s%s',_0x22d156,_0x2605eb[_0x6774('0x2b')][_0x6774('0x4')]),'json':_0x4ff7b9,'resolveWithFullResponse':!![],'encoding':_0x46373b,'body':_0x2605eb['body']};if(_0x2605eb[_0x6774('0x96')]){_0x787ee1[_0x6774('0x96')]=_0x2605eb[_0x6774('0x96')];if(_0x787ee1[_0x6774('0x96')][_0x6774('0x97')]){delete _0x787ee1['headers'][_0x6774('0x97')];}}if(_0x787ee1[_0x6774('0x96')]['content-type']){delete _0x787ee1['headers']['content-type'];}return rp(_0x787ee1);})[_0x6774('0x26')](function(_0x1bce97){if(_0x1bce97){_0x299dbf[_0x6774('0x1f')](_0x1bce97['headers']);logger[_0x6774('0x5e')](_0x1bce97[_0x6774('0x86')]);return _0x299dbf[_0x6774('0x19')](_0x1bce97[_0x6774('0x9a')])[_0x6774('0x28')](_0x1bce97[_0x6774('0x86')]);}else{return _0x299dbf[_0x6774('0x9f')](0xc8);}})[_0x6774('0x40')](handleError(_0x299dbf,null));};
\ No newline at end of file
+var _0xca89=['Download\x20completed','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','Warning:\x20agent\x20view\x20not\x20specified','script','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','destroy','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','headers','content-length','content-type','body','endsWith','statusCode','sendStatus','webhookPost','port','method','%s%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','localhost','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Plugins','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','Plugin','findAll','rows','catch','show','params','rawAttributes','options','find','download','join','root','server/files/plugins','format','%s.zip','basename','zip','warning','code','ENOENT','Error','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','dirname','node_modules/**/*','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync'];(function(_0x25c1bd,_0x2b9085){var _0x1eea5f=function(_0x3b720c){while(--_0x3b720c){_0x25c1bd['push'](_0x25c1bd['shift']());}};_0x1eea5f(++_0x2b9085);}(_0xca89,0x1a8));var _0x9ca8=function(_0x3273f1,_0x16c85a){_0x3273f1=_0x3273f1-0x0;var _0x149a6e=_0xca89[_0x3273f1];return _0x149a6e;};'use strict';var emlformat=require(_0x9ca8('0x0'));var rimraf=require(_0x9ca8('0x1'));var zipdir=require(_0x9ca8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9ca8('0x3'));var BPromise=require(_0x9ca8('0x4'));var Mustache=require('mustache');var util=require(_0x9ca8('0x5'));var path=require(_0x9ca8('0x6'));var sox=require(_0x9ca8('0x7'));var csv=require('to-csv');var ejs=require(_0x9ca8('0x8'));var fs=require('fs');var fs_extra=require(_0x9ca8('0x9'));var _=require(_0x9ca8('0xa'));var squel=require(_0x9ca8('0xb'));var crypto=require(_0x9ca8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9ca8('0xd'));var toCsv=require(_0x9ca8('0xe'));var querystring=require(_0x9ca8('0xf'));var Papa=require(_0x9ca8('0x10'));var extract=require(_0x9ca8('0x11'));var rimraf=require(_0x9ca8('0x1'));var archiver=require(_0x9ca8('0x12'));var Redis=require(_0x9ca8('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9ca8('0x14'));var as=require(_0x9ca8('0x15'));var hardwareService=require(_0x9ca8('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x9ca8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9ca8('0x18'));var db=require('../../mysqldb')['db'];config[_0x9ca8('0x19')]=_[_0x9ca8('0x1a')](config[_0x9ca8('0x19')],{'host':_0x9ca8('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ca8('0x19')]));require('./plugin.socket')[_0x9ca8('0x1c')](socket);function respondWithStatusCode(_0x536e5f,_0x30dd1f){_0x30dd1f=_0x30dd1f||0xcc;return function(_0x50c552){if(_0x50c552){return _0x536e5f['sendStatus'](_0x30dd1f);}return _0x536e5f[_0x9ca8('0x1d')](_0x30dd1f)[_0x9ca8('0x1e')]();};}function respondWithResult(_0x42ebc4,_0x182371){_0x182371=_0x182371||0xc8;return function(_0x5a5021){if(_0x5a5021){return _0x42ebc4[_0x9ca8('0x1d')](_0x182371)[_0x9ca8('0x1f')](_0x5a5021);}};}function respondWithFilteredResult(_0x519e92,_0x3aec52){return function(_0x5067bb){if(_0x5067bb){var _0x4a9272=typeof _0x3aec52[_0x9ca8('0x20')]===_0x9ca8('0x21')&&typeof _0x3aec52[_0x9ca8('0x22')]===_0x9ca8('0x21');var _0x49069f=_0x5067bb[_0x9ca8('0x23')];var _0x259b28=_0x4a9272?0x0:_0x3aec52[_0x9ca8('0x20')];var _0x58cff4=_0x4a9272?_0x5067bb[_0x9ca8('0x23')]:_0x3aec52[_0x9ca8('0x20')]+_0x3aec52['limit'];var _0x1ee5f0;if(_0x58cff4>=_0x49069f){_0x58cff4=_0x49069f;_0x1ee5f0=0xc8;}else{_0x1ee5f0=0xce;}_0x519e92['status'](_0x1ee5f0);return _0x519e92[_0x9ca8('0x24')](_0x9ca8('0x25'),_0x259b28+'-'+_0x58cff4+'/'+_0x49069f)[_0x9ca8('0x1f')](_0x5067bb);}return null;};}function patchUpdates(_0x283270){return function(_0x213cf7){try{jsonpatch[_0x9ca8('0x26')](_0x213cf7,_0x283270,!![]);}catch(_0x2e35af){return BPromise[_0x9ca8('0x27')](_0x2e35af);}return _0x213cf7[_0x9ca8('0x28')]();};}function saveUpdates(_0x113e59,_0xe4a5c7){return function(_0x3545e8){if(_0x3545e8){return _0x3545e8[_0x9ca8('0x29')](_0x113e59)[_0x9ca8('0x2a')](function(_0x303901){return _0x303901;});}return null;};}function removeEntity(_0x525f00,_0xafbf08){return function(_0x4319de){if(_0x4319de){return _0x4319de['destroy']()[_0x9ca8('0x2a')](function(){var _0x2341cd=_0x4319de[_0x9ca8('0x2b')]({'plain':!![]});var _0x2c2ccf=_0x9ca8('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x2c2ccf,'resourceId':_0x2341cd['id']}})[_0x9ca8('0x2a')](function(){return _0x4319de;});})[_0x9ca8('0x2a')](function(){_0x525f00['status'](0xcc)[_0x9ca8('0x1e')]();});}};}function handleEntityNotFound(_0x4c97df,_0x3f0d0b){return function(_0x488b4b){if(!_0x488b4b){_0x4c97df['sendStatus'](0x194);}return _0x488b4b;};}function handleError(_0x5e56ed,_0x9bcc1c){_0x9bcc1c=_0x9bcc1c||0x1f4;return function(_0x10ad2b){logger['error'](_0x10ad2b[_0x9ca8('0x2d')]);if(_0x10ad2b[_0x9ca8('0x2e')]){delete _0x10ad2b[_0x9ca8('0x2e')];}_0x5e56ed[_0x9ca8('0x1d')](_0x9bcc1c)[_0x9ca8('0x2f')](_0x10ad2b);};}exports['index']=function(_0x49d279,_0x742a23){var _0x374da0={},_0x4820e4={},_0x6d07af={'count':0x0,'rows':[]};var _0x55a0b5=_[_0x9ca8('0x30')](db['Plugin']['rawAttributes'],function(_0x559be6){return{'name':_0x559be6[_0x9ca8('0x31')],'type':_0x559be6[_0x9ca8('0x32')][_0x9ca8('0x33')]};});_0x4820e4[_0x9ca8('0x34')]=_[_0x9ca8('0x30')](_0x55a0b5,_0x9ca8('0x2e'));_0x4820e4[_0x9ca8('0x35')]=_[_0x9ca8('0x36')](_0x49d279['query']);_0x4820e4[_0x9ca8('0x37')]=_[_0x9ca8('0x38')](_0x4820e4[_0x9ca8('0x34')],_0x4820e4[_0x9ca8('0x35')]);_0x374da0[_0x9ca8('0x39')]=_[_0x9ca8('0x38')](_0x4820e4[_0x9ca8('0x34')],qs[_0x9ca8('0x3a')](_0x49d279[_0x9ca8('0x35')][_0x9ca8('0x3a')]));_0x374da0['attributes']=_0x374da0[_0x9ca8('0x39')][_0x9ca8('0x3b')]?_0x374da0[_0x9ca8('0x39')]:_0x4820e4[_0x9ca8('0x34')];if(!_0x49d279[_0x9ca8('0x35')][_0x9ca8('0x3c')](_0x9ca8('0x3d'))){_0x374da0['limit']=qs[_0x9ca8('0x22')](_0x49d279[_0x9ca8('0x35')][_0x9ca8('0x22')]);_0x374da0[_0x9ca8('0x20')]=qs[_0x9ca8('0x20')](_0x49d279[_0x9ca8('0x35')][_0x9ca8('0x20')]);}_0x374da0[_0x9ca8('0x3e')]=qs[_0x9ca8('0x3f')](_0x49d279[_0x9ca8('0x35')]['sort']);_0x374da0[_0x9ca8('0x40')]=qs['filters'](_[_0x9ca8('0x41')](_0x49d279['query'],_0x4820e4['filters']),_0x55a0b5);if(_0x49d279[_0x9ca8('0x35')][_0x9ca8('0x42')]){_0x374da0['where']=_[_0x9ca8('0x43')](_0x374da0[_0x9ca8('0x40')],{'$or':_[_0x9ca8('0x30')](_0x55a0b5,function(_0x2a08d6){if(_0x2a08d6['type']!=='VIRTUAL'){var _0x4b9931={};_0x4b9931[_0x2a08d6[_0x9ca8('0x2e')]]={'$like':'%'+_0x49d279[_0x9ca8('0x35')][_0x9ca8('0x42')]+'%'};return _0x4b9931;}})});}_0x374da0=_[_0x9ca8('0x43')]({},_0x374da0,_0x49d279['options']);var _0x348487={'where':_0x374da0[_0x9ca8('0x40')]};return db['Plugin'][_0x9ca8('0x23')](_0x348487)['then'](function(_0x13204d){_0x6d07af[_0x9ca8('0x23')]=_0x13204d;if(_0x49d279[_0x9ca8('0x35')][_0x9ca8('0x44')]){_0x374da0[_0x9ca8('0x45')]=[{'all':!![]}];}return db[_0x9ca8('0x46')][_0x9ca8('0x47')](_0x374da0);})[_0x9ca8('0x2a')](function(_0x23f212){_0x6d07af[_0x9ca8('0x48')]=_0x23f212;return _0x6d07af;})['then'](respondWithFilteredResult(_0x742a23,_0x374da0))[_0x9ca8('0x49')](handleError(_0x742a23,null));};exports[_0x9ca8('0x4a')]=function(_0x41e427,_0x5591a0){var _0x13d9da={'raw':!![],'where':{'id':_0x41e427[_0x9ca8('0x4b')]['id']}},_0x110812={};_0x110812[_0x9ca8('0x34')]=_[_0x9ca8('0x36')](db[_0x9ca8('0x46')][_0x9ca8('0x4c')]);_0x110812[_0x9ca8('0x35')]=_['keys'](_0x41e427[_0x9ca8('0x35')]);_0x110812[_0x9ca8('0x37')]=_[_0x9ca8('0x38')](_0x110812['model'],_0x110812[_0x9ca8('0x35')]);_0x13d9da[_0x9ca8('0x39')]=_[_0x9ca8('0x38')](_0x110812[_0x9ca8('0x34')],qs[_0x9ca8('0x3a')](_0x41e427[_0x9ca8('0x35')][_0x9ca8('0x3a')]));_0x13d9da[_0x9ca8('0x39')]=_0x13d9da[_0x9ca8('0x39')]['length']?_0x13d9da['attributes']:_0x110812['model'];if(_0x41e427['query'][_0x9ca8('0x44')]){_0x13d9da[_0x9ca8('0x45')]=[{'all':!![]}];}_0x13d9da=_[_0x9ca8('0x43')]({},_0x13d9da,_0x41e427[_0x9ca8('0x4d')]);return db[_0x9ca8('0x46')][_0x9ca8('0x4e')](_0x13d9da)[_0x9ca8('0x2a')](handleEntityNotFound(_0x5591a0,null))['then'](respondWithResult(_0x5591a0,null))[_0x9ca8('0x49')](handleError(_0x5591a0,null));};exports[_0x9ca8('0x4f')]=function(_0xd576e2,_0x4bff64,_0xd2a73){return db[_0x9ca8('0x46')][_0x9ca8('0x4e')]({'where':{'id':_0xd576e2[_0x9ca8('0x4b')]['id']},'attributes':[_0x9ca8('0x2e'),_0x9ca8('0x6')],'raw':!![]})[_0x9ca8('0x2a')](handleEntityNotFound(_0x4bff64,null))['then'](function(_0x19e0c2){if(_0x19e0c2){var _0x4bf638=path[_0x9ca8('0x50')](config[_0x9ca8('0x51')],_0x9ca8('0x52'),util[_0x9ca8('0x53')](_0x9ca8('0x54'),path[_0x9ca8('0x55')](_0x19e0c2[_0x9ca8('0x6')])));var _0x50ae7f=fs['createWriteStream'](_0x4bf638);var _0x3fc2b6=archiver(_0x9ca8('0x56'),{'zlib':{'level':0x9}});_0x3fc2b6['on'](_0x9ca8('0x57'),function(_0x3c8b17){if(_0x3c8b17[_0x9ca8('0x58')]===_0x9ca8('0x59')){logger['error'](_0x3c8b17);}else{throw new db['Sequelize'][(_0x9ca8('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x3fc2b6['on'](_0x9ca8('0x5b'),function(_0x216c61){throw new db[(_0x9ca8('0x5c'))][(_0x9ca8('0x5a'))](_0x9ca8('0x5d'));});_0x3fc2b6['pipe'](_0x50ae7f);_0x3fc2b6[_0x9ca8('0x5e')]('**/*',{'cwd':path['join'](config[_0x9ca8('0x51')],_0x9ca8('0x52'),path[_0x9ca8('0x5f')](_0x19e0c2[_0x9ca8('0x6')])),'ignore':[path['join'](path['basename'](_0x19e0c2[_0x9ca8('0x6')]),_0x9ca8('0x60')),path[_0x9ca8('0x50')](path[_0x9ca8('0x55')](_0x19e0c2[_0x9ca8('0x6')]),'attachments/**/*')],'nodir':!![]})['finalize']();_0x50ae7f['on']('close',function(){if(!fs[_0x9ca8('0x61')](_0x4bf638)){throw new db[(_0x9ca8('0x5c'))][(_0x9ca8('0x5a'))](_0x9ca8('0x62'));}return _0x4bff64[_0x9ca8('0x4f')](_0x4bf638,util['format']('%s.zip',path[_0x9ca8('0x55')](_0x19e0c2[_0x9ca8('0x6')])),function(_0x1dadf4){if(_0x1dadf4){throw new db[(_0x9ca8('0x5c'))][(_0x9ca8('0x5a'))](_0x9ca8('0x63'));}fs[_0x9ca8('0x64')](_0x4bf638);logger['info'](_0x9ca8('0x65'));logger[_0x9ca8('0x66')](_0x9ca8('0x67'));});});}return null;})['catch'](handleError(_0x4bff64,null));};exports[_0x9ca8('0x68')]=function(_0x564c71,_0x2e67fc,_0x4acace){var _0x3d4fcb=path[_0x9ca8('0x55')](_0x564c71[_0x9ca8('0x69')][_0x9ca8('0x6a')],path[_0x9ca8('0x6b')](_0x564c71['file'][_0x9ca8('0x6a')]));var _0x333d1a=path[_0x9ca8('0x50')](config[_0x9ca8('0x51')],_0x9ca8('0x52'),_0x564c71['file'][_0x9ca8('0x6a')]);var _0x506ea9=path['join'](config['root'],_0x9ca8('0x52'),_0x3d4fcb);logger[_0x9ca8('0x66')](_0x9ca8('0x6c'),_0x333d1a);logger[_0x9ca8('0x66')](_0x9ca8('0x6d'),_0x506ea9);try{fs['chmodSync'](_0x333d1a,parseInt(_0x9ca8('0x6e'),0x8));extract(_0x333d1a,{'dir':_0x506ea9},function(_0x41dc33){if(_0x41dc33){logger['error'](_0x41dc33);handleError(_0x41dc33,!![]);};var _0x451b0a=fs[_0x9ca8('0x6f')](_0x506ea9);if(_0x451b0a[_0x9ca8('0x3b')]>0x1){removeReferences(_0x333d1a,_0x506ea9);logger[_0x9ca8('0x5b')](_0x9ca8('0x70'));return _0x4acace(new Error(_0x9ca8('0x70')));}var _0x291b37=fs[_0x9ca8('0x71')](path[_0x9ca8('0x50')](_0x506ea9,_0x451b0a[0x0]));if(_0x291b37['isFile']()){removeReferences(_0x333d1a,_0x506ea9);logger[_0x9ca8('0x5b')](_0x9ca8('0x70'));return _0x4acace(new Error(_0x9ca8('0x70')));}if(_0x291b37['isDirectory']()){var _0x18cd2c=fs[_0x9ca8('0x6f')](path[_0x9ca8('0x50')](_0x506ea9,_0x451b0a[0x0]));if(_0x18cd2c[_0x9ca8('0x3b')]===0x0){removeReferences(_0x333d1a,_0x506ea9);logger[_0x9ca8('0x5b')](_0x9ca8('0x70'));return _0x4acace(new Error(_0x9ca8('0x70')));}var _0xfd6a3a=_0x18cd2c[_0x9ca8('0x72')](function(_0x5536dc){return _0x5536dc===_0x9ca8('0x73');});if(!_0xfd6a3a){return _0x4acace(new Error('Plugin\x20manifest\x20missing'));}var _0x34d086=fs[_0x9ca8('0x74')](path[_0x9ca8('0x50')](_0x506ea9,_0x451b0a[0x0],_0x9ca8('0x73')));var _0x467882=JSON[_0x9ca8('0x75')](_0x34d086);if(_0x9ca8('0x21')==typeof _0x467882[_0x9ca8('0x2e')]){return _0x4acace(new Error(_0x9ca8('0x76')));}if(_0x9ca8('0x21')==typeof _0x467882[_0x9ca8('0x32')]){return _0x4acace(new Error(_0x9ca8('0x77')));}if(_0x9ca8('0x21')==typeof _0x467882[_0x9ca8('0x78')]){return _0x4acace(new Error(_0x9ca8('0x79')));}if(_0x9ca8('0x21')==typeof _0x467882[_0x9ca8('0x7a')]){return _0x4acace(new Error(_0x9ca8('0x7b')));}if(_0x467882[_0x9ca8('0x32')]===_0x9ca8('0x7c')){if(_0x9ca8('0x21')==typeof _0x467882[_0x9ca8('0x7a')][_0x9ca8('0x7d')]){return _0x4acace(new Error(_0x9ca8('0x7e')));}if(_0x9ca8('0x21')==typeof _0x467882[_0x9ca8('0x7a')][_0x9ca8('0x7d')][_0x9ca8('0x7f')]&&_0x9ca8('0x21')==typeof _0x467882[_0x9ca8('0x7a')][_0x9ca8('0x7d')]['agent']){return _0x4acace(new Error(_0x9ca8('0x80')));}}else if(_0x467882[_0x9ca8('0x32')]==='script'){if(_0x9ca8('0x21')==typeof _0x467882[_0x9ca8('0x7a')][_0x9ca8('0x81')]){return _0x4acace(new Error(_0x9ca8('0x82')));}if(_0x9ca8('0x21')==typeof _0x467882[_0x9ca8('0x7a')][_0x9ca8('0x83')]){return _0x4acace(new Error(_0x9ca8('0x84')));}}else{return _0x4acace(new Error(_0x9ca8('0x85')));}var _0x3342db=_0x467882[_0x9ca8('0x2e')];var _0x17f66f=_0x467882['description'];var _0x1646fd=_0x467882[_0x9ca8('0x32')];var _0x592d1b=_0x467882[_0x9ca8('0x86')]?_0x467882[_0x9ca8('0x86')]:_0x9ca8('0x87');var _0x316ab3=_0x467882[_0x9ca8('0x88')]?_0x467882[_0x9ca8('0x88')]:_0x9ca8('0x89');var _0x4f222f='';var _0x32bda8='';var _0x244139='';var _0x16937b='';var _0x5aa2da=_0x467882['version'];if(_0x1646fd===_0x9ca8('0x7c')){if(_0x9ca8('0x21')!=typeof _0x467882[_0x9ca8('0x7a')][_0x9ca8('0x7d')][_0x9ca8('0x7f')]){var _0x5c2de1=_0x467882['parameters'][_0x9ca8('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5c2de1)){_0x4f222f=path['join'](_0x9ca8('0x8a'),_0x3d4fcb,_0x451b0a[0x0],_0x5c2de1);}else{_0x4f222f=_0x5c2de1;}}else{logger[_0x9ca8('0x66')](_0x9ca8('0x8b'));}if(_0x9ca8('0x21')!=typeof _0x467882[_0x9ca8('0x7a')][_0x9ca8('0x7d')][_0x9ca8('0x8c')]){var _0x373bf2=_0x467882[_0x9ca8('0x7a')][_0x9ca8('0x7d')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x9ca8('0x8d')](_0x373bf2)){_0x32bda8=path[_0x9ca8('0x50')](_0x9ca8('0x8a'),_0x3d4fcb,_0x451b0a[0x0],_0x373bf2);}else{_0x32bda8=_0x373bf2;}}else{logger['info'](_0x9ca8('0x8e'));}}else if(_0x1646fd===_0x9ca8('0x8f')){_0x244139=_0x467882['parameters'][_0x9ca8('0x81')];_0x16937b=_0x467882[_0x9ca8('0x7a')][_0x9ca8('0x83')];if(_0x9ca8('0x21')!=typeof _0x467882['parameters'][_0x9ca8('0x7d')]){if(_0x9ca8('0x21')!=typeof _0x467882[_0x9ca8('0x7a')][_0x9ca8('0x7d')][_0x9ca8('0x7f')]){var _0x5c2de1=_0x467882[_0x9ca8('0x7a')]['views'][_0x9ca8('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x9ca8('0x8d')](_0x5c2de1)){_0x4f222f=path['join'](_0x9ca8('0x8a'),_0x3d4fcb,_0x451b0a[0x0],_0x5c2de1);}else{_0x4f222f=_0x5c2de1;}}if(_0x9ca8('0x21')!=typeof _0x467882[_0x9ca8('0x7a')]['views']['agent']){var _0x373bf2=_0x467882[_0x9ca8('0x7a')][_0x9ca8('0x7d')][_0x9ca8('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x9ca8('0x8d')](_0x373bf2)){_0x32bda8=path[_0x9ca8('0x50')](_0x9ca8('0x8a'),_0x3d4fcb,_0x451b0a[0x0],_0x373bf2);}else{_0x32bda8=_0x373bf2;}}}}var _0x47cabf={'name':_0x3342db,'description':_0x17f66f,'path':path[_0x9ca8('0x50')](_0x3d4fcb,_0x451b0a[0x0]),'type':_0x1646fd,'sidebar':_0x592d1b,'icon':_0x316ab3,'adminUrl':_0x4f222f,'agentUrl':_0x32bda8,'scriptName':_0x244139,'scriptPath':_0x16937b,'version':_0x5aa2da};removeReferences(_0x333d1a,null);return db[_0x9ca8('0x46')][_0x9ca8('0x90')](_0x47cabf)[_0x9ca8('0x2a')](function(_0x54606b){var _0x4b2ad6={'role':_0x564c71['body']['role'],'userProfileId':_0x564c71['body']['userProfileId']};if(!_0x4b2ad6)throw new Error(_0x9ca8('0x91'));if(_0x4b2ad6[_0x9ca8('0x92')]===_0x9ca8('0x93')){var _0x3f6526=_0x54606b[_0x9ca8('0x2b')]({'plain':!![]});return db[_0x9ca8('0x94')][_0x9ca8('0x4e')]({'where':{'name':_0x9ca8('0x2c'),'userProfileId':_0x4b2ad6[_0x9ca8('0x95')]},'raw':!![]})[_0x9ca8('0x2a')](function(_0x5ea1cf){if(_0x5ea1cf&&_0x5ea1cf[_0x9ca8('0x96')]===0x0){return db[_0x9ca8('0x97')][_0x9ca8('0x90')]({'name':_0x3f6526[_0x9ca8('0x2e')],'resourceId':_0x3f6526['id'],'type':_0x5ea1cf[_0x9ca8('0x2e')],'sectionId':_0x5ea1cf['id']},{})['then'](function(){return _0x54606b;});}else{return _0x54606b;}})[_0x9ca8('0x49')](function(_0x3dffe9){logger['error'](_0x9ca8('0x98'),_0x3dffe9);throw _0x3dffe9;});}return _0x54606b;})['then'](respondWithResult(_0x2e67fc,null))[_0x9ca8('0x49')](handleError(_0x2e67fc,null));}});}catch(_0x1050ff){_0x2e67fc[_0x9ca8('0x1d')](0x1f4)[_0x9ca8('0x2f')](_0x1050ff);}};function removeReferences(_0x7d6fae,_0x5e11a6){try{if(_0x7d6fae){fs['unlinkSync'](_0x7d6fae);logger[_0x9ca8('0x66')](_0x9ca8('0x99'));}if(_0x5e11a6){rimraf(_0x5e11a6,function(){});logger[_0x9ca8('0x66')](_0x9ca8('0x9a'));}}catch(_0x189dea){logger[_0x9ca8('0x5b')](_0x189dea);}}exports[_0x9ca8('0x29')]=function(_0x3a9291,_0x5e58f7,_0x2ab3f6){return db[_0x9ca8('0x46')][_0x9ca8('0x4e')]({'where':{'id':_0x3a9291[_0x9ca8('0x4b')]['id']}})[_0x9ca8('0x2a')](handleEntityNotFound(_0x5e58f7,null))['then'](saveUpdates(_0x3a9291['body'],null))['then'](respondWithResult(_0x5e58f7,null))[_0x9ca8('0x49')](handleError(_0x5e58f7,null));};exports[_0x9ca8('0x9b')]=function(_0x2c1f70,_0x5dd08c,_0x352763){return db[_0x9ca8('0x46')]['find']({'where':{'id':_0x2c1f70[_0x9ca8('0x4b')]['id']}})[_0x9ca8('0x2a')](function(_0x4f82c3){if(_0x4f82c3){return _0x4f82c3[_0x9ca8('0x9c')]();}})['then'](function(_0x2a0b7d){rimraf(path[_0x9ca8('0x50')](config[_0x9ca8('0x51')],'server/files/plugins',path[_0x9ca8('0x5f')](_0x2a0b7d['path'])),function(){});return _0x2a0b7d;})[_0x9ca8('0x2a')](handleEntityNotFound(_0x5dd08c,null))['then'](respondWithStatusCode(_0x5dd08c,null))[_0x9ca8('0x49')](handleError(_0x5dd08c,null));};exports[_0x9ca8('0x9d')]=function(_0xfb4de,_0x37444b,_0x539ce0){return BPromise[_0x9ca8('0x9e')]()['then'](function(){if(!_0xfb4de[_0x9ca8('0x35')][_0x9ca8('0x6')]){throw new Error(_0x9ca8('0x9f'));}if(!_0xfb4de[_0x9ca8('0x35')]['port']){throw new Error(_0x9ca8('0xa0'));}var _0x2b927a=_0xfb4de['query'][_0x9ca8('0xa1')]?_0xfb4de[_0x9ca8('0x35')][_0x9ca8('0xa1')]+':'+_0xfb4de[_0x9ca8('0x35')]['port']:_0x9ca8('0xa2')+_0xfb4de[_0x9ca8('0x35')]['port'];var _0x3eeaa5=_0xfb4de[_0x9ca8('0x35')][_0x9ca8('0x1f')]?_0xfb4de[_0x9ca8('0x35')][_0x9ca8('0x1f')]:!![];var _0x522e17=_0xfb4de[_0x9ca8('0x35')][_0x9ca8('0xa3')]?_0xfb4de[_0x9ca8('0x35')][_0x9ca8('0xa3')]:null;var _0x71dfe1={'method':_0xfb4de['method'],'uri':util[_0x9ca8('0x53')]('%s%s',_0x2b927a,_0xfb4de[_0x9ca8('0x35')][_0x9ca8('0x6')]),'json':_0x3eeaa5,'resolveWithFullResponse':!![],'encoding':_0x522e17,'qs':_0xfb4de[_0x9ca8('0x35')]};if(_0xfb4de[_0x9ca8('0xa4')]){_0x71dfe1[_0x9ca8('0xa4')]=_0xfb4de[_0x9ca8('0xa4')];if(_0x71dfe1[_0x9ca8('0xa4')]['content-length']){delete _0x71dfe1[_0x9ca8('0xa4')][_0x9ca8('0xa5')];}}if(_0x71dfe1[_0x9ca8('0xa4')][_0x9ca8('0xa6')]){delete _0x71dfe1[_0x9ca8('0xa4')][_0x9ca8('0xa6')];}return rp(_0x71dfe1);})[_0x9ca8('0x2a')](function(_0x4201f2){if(_0x4201f2){_0x37444b['set'](_0x4201f2[_0x9ca8('0xa4')]);logger['info'](_0x4201f2[_0x9ca8('0xa7')]);if(_[_0x9ca8('0xa8')](_0xfb4de['query'][_0x9ca8('0x6')],_0x9ca8('0x4f'))&&_0x4201f2[_0x9ca8('0xa9')]==0x1f4){return _0x37444b[_0x9ca8('0xaa')](_0x4201f2[_0x9ca8('0xa9')]);}else{return _0x37444b['status'](_0x4201f2['statusCode'])['send'](_0x4201f2['body']);}}else{return _0x37444b['sendStatus'](0xc8);}})[_0x9ca8('0x49')](handleError(_0x37444b,null));};exports[_0x9ca8('0xab')]=function(_0x1805d9,_0x38787d,_0x1c0d1e){return BPromise[_0x9ca8('0x9e')]()[_0x9ca8('0x2a')](function(){if(!_0x1805d9[_0x9ca8('0x35')][_0x9ca8('0x6')]){throw new Error(_0x9ca8('0x9f'));}if(!_0x1805d9[_0x9ca8('0x35')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x250eb7=_0x1805d9[_0x9ca8('0x35')][_0x9ca8('0xa1')]?_0x1805d9[_0x9ca8('0x35')][_0x9ca8('0xa1')]+':'+_0x1805d9[_0x9ca8('0x35')][_0x9ca8('0xac')]:_0x9ca8('0xa2')+_0x1805d9[_0x9ca8('0x35')]['port'];var _0x2f4667=_0x1805d9[_0x9ca8('0x35')][_0x9ca8('0x1f')]?_0x1805d9['query'][_0x9ca8('0x1f')]:!![];var _0x42b7ff=_0x1805d9[_0x9ca8('0x35')]['encoding']?_0x1805d9[_0x9ca8('0x35')][_0x9ca8('0xa3')]:null;var _0x5c41cc={'method':_0x1805d9[_0x9ca8('0xad')],'uri':util[_0x9ca8('0x53')](_0x9ca8('0xae'),_0x250eb7,_0x1805d9[_0x9ca8('0x35')][_0x9ca8('0x6')]),'json':_0x2f4667,'resolveWithFullResponse':!![],'encoding':_0x42b7ff,'body':_0x1805d9[_0x9ca8('0xa7')]};if(_0x1805d9[_0x9ca8('0xa4')]){_0x5c41cc[_0x9ca8('0xa4')]=_0x1805d9[_0x9ca8('0xa4')];if(_0x5c41cc[_0x9ca8('0xa4')]['content-length']){delete _0x5c41cc['headers'][_0x9ca8('0xa5')];}}if(_0x5c41cc[_0x9ca8('0xa4')]['content-type']){delete _0x5c41cc[_0x9ca8('0xa4')][_0x9ca8('0xa6')];}return rp(_0x5c41cc);})[_0x9ca8('0x2a')](function(_0x5c175d){if(_0x5c175d){_0x38787d[_0x9ca8('0x24')](_0x5c175d[_0x9ca8('0xa4')]);logger[_0x9ca8('0x66')](_0x5c175d[_0x9ca8('0xa7')]);return _0x38787d[_0x9ca8('0x1d')](_0x5c175d[_0x9ca8('0xa9')])[_0x9ca8('0x2f')](_0x5c175d[_0x9ca8('0xa7')]);}else{return _0x38787d['sendStatus'](0xc8);}})[_0x9ca8('0x49')](handleError(_0x38787d,null));};
\ No newline at end of file
index 62159f4..dd622a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f7a=['hasOwnProperty','events','../../mysqldb','Plugin','setMaxListeners','update'];(function(_0x1f184a,_0x19ff0c){var _0x5780b1=function(_0x290490){while(--_0x290490){_0x1f184a['push'](_0x1f184a['shift']());}};_0x5780b1(++_0x19ff0c);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x9f7a[_0x50aa2e];return _0x5e07f0;};'use strict';var EventEmitter=require(_0xa9f7('0x0'));var Plugin=require(_0xa9f7('0x1'))['db'][_0xa9f7('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xa9f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa9f7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4d188f){return function(_0x59823f,_0x22dbdd,_0x44545d){PluginEvents['emit'](_0x4d188f+':'+_0x59823f['id'],_0x59823f);PluginEvents['emit'](_0x4d188f,_0x59823f);_0x44545d(null);};}for(var e in events){if(events[_0xa9f7('0x5')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
+var _0xed1f=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed1f,0x170));var _0xfed1=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xed1f[_0x2f45ea];return _0x485a84;};'use strict';var EventEmitter=require(_0xfed1('0x0'));var Plugin=require(_0xfed1('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfed1('0x2'),'afterUpdate':'update','afterDestroy':_0xfed1('0x3')};function emitEvent(_0x501da6){return function(_0x444ba8,_0x423af3,_0x198341){PluginEvents[_0xfed1('0x4')](_0x501da6+':'+_0x444ba8['id'],_0x444ba8);PluginEvents[_0xfed1('0x4')](_0x501da6,_0x444ba8);_0x198341(null);};}for(var e in events){if(events[_0xfed1('0x5')](e)){var event=events[e];Plugin[_0xfed1('0x6')](e,emitEvent(event));}}module[_0xfed1('0x7')]=PluginEvents;
\ No newline at end of file
index 5166013..170cebf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fc5=['plugins','lodash','util','../../config/logger','moment','bluebird','rimraf','exports','define'];(function(_0x43c3b9,_0x2fa9c8){var _0x4d26ad=function(_0x566159){while(--_0x566159){_0x43c3b9['push'](_0x43c3b9['shift']());}};_0x4d26ad(++_0x2fa9c8);}(_0x7fc5,0x160));var _0x57fc=function(_0xeb58a3,_0x1739dd){_0xeb58a3=_0xeb58a3-0x0;var _0x286d9e=_0x7fc5[_0xeb58a3];return _0x286d9e;};'use strict';var _=require(_0x57fc('0x0'));var util=require(_0x57fc('0x1'));var logger=require(_0x57fc('0x2'))('api');var moment=require(_0x57fc('0x3'));var BPromise=require(_0x57fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x57fc('0x5'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0x57fc('0x6')]=function(_0x831dc4,_0x922e85){return _0x831dc4[_0x57fc('0x7')]('Plugin',attributes,{'tableName':_0x57fc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0791=['../../config/environment','./plugin.attributes','define','plugins','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x41acb5,_0x57a2e8){var _0x58dd3a=function(_0x17ea5e){while(--_0x17ea5e){_0x41acb5['push'](_0x41acb5['shift']());}};_0x58dd3a(++_0x57a2e8);}(_0x0791,0x1bc));var _0x1079=function(_0x5224ba,_0x3fb4e1){_0x5224ba=_0x5224ba-0x0;var _0x459bd2=_0x0791[_0x5224ba];return _0x459bd2;};'use strict';var _=require(_0x1079('0x0'));var util=require('util');var logger=require(_0x1079('0x1'))(_0x1079('0x2'));var moment=require(_0x1079('0x3'));var BPromise=require(_0x1079('0x4'));var rp=require(_0x1079('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1079('0x6'));var attributes=require(_0x1079('0x7'));module['exports']=function(_0x18e9fc,_0x4fd65f){return _0x18e9fc[_0x1079('0x8')]('Plugin',attributes,{'tableName':_0x1079('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f0abe6e..1fa083c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5106=['Plugin,\x20%s,\x20%s','message','result','CreatePlugin','create','body','options','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','redis','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x5106,0x116));var _0x6510=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5106[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x6510('0x0'));var util=require('util');var moment=require(_0x6510('0x1'));var BPromise=require('bluebird');var rs=require(_0x6510('0x2'));var fs=require('fs');var Redis=require(_0x6510('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6510('0x4'))(_0x6510('0x5'));var config=require(_0x6510('0x6'));var jayson=require(_0x6510('0x7'));var client=jayson[_0x6510('0x8')][_0x6510('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6510('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6510('0xb')]));require('./plugin.socket')[_0x6510('0xc')](socket);function respondWithRpcPromise(_0x2c4c38,_0x340531,_0x586cea){return new BPromise(function(_0x53a80e,_0x1dcf14){return client[_0x6510('0xd')](_0x2c4c38,_0x586cea)[_0x6510('0xe')](function(_0xb96205){logger[_0x6510('0xf')]('Plugin,\x20%s,\x20%s',_0x340531,_0x6510('0x10'));logger[_0x6510('0x11')](_0x6510('0x12'),_0x340531,_0x6510('0x10'),JSON[_0x6510('0x13')](_0xb96205));if(_0xb96205['error']){if(_0xb96205['error'][_0x6510('0x14')]===0x1f4){logger[_0x6510('0x15')](_0x6510('0x16'),_0x340531,_0xb96205[_0x6510('0x15')][_0x6510('0x17')]);return _0x1dcf14(_0xb96205['error']['message']);}logger[_0x6510('0x15')](_0x6510('0x16'),_0x340531,_0xb96205[_0x6510('0x15')][_0x6510('0x17')]);return _0x53a80e(_0xb96205['error'][_0x6510('0x17')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x340531,_0x6510('0x10'));_0x53a80e(_0xb96205[_0x6510('0x18')][_0x6510('0x17')]);}})['catch'](function(_0xf4a3c3){logger[_0x6510('0x15')]('Plugin,\x20%s,\x20%s',_0x340531,_0xf4a3c3);_0x1dcf14(_0xf4a3c3);});});}exports[_0x6510('0x19')]=function(_0x7a9a7c){var _0x13c847=this;return new Promise(function(_0x42f8dc,_0xb5bff){return db['Plugin'][_0x6510('0x1a')](_0x7a9a7c[_0x6510('0x1b')],{'raw':_0x7a9a7c['options']?_0x7a9a7c[_0x6510('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x6510('0xe')](function(_0x36da2f){logger['info'](_0x6510('0x19'),_0x7a9a7c);logger[_0x6510('0x11')](_0x6510('0x19'),_0x7a9a7c,JSON[_0x6510('0x13')](_0x36da2f));_0x42f8dc(_0x36da2f);})[_0x6510('0x1d')](function(_0x4feb7d){logger[_0x6510('0x15')](_0x6510('0x19'),_0x4feb7d['message'],_0x7a9a7c);_0xb5bff(_0x13c847[_0x6510('0x15')](0x1f4,_0x4feb7d[_0x6510('0x17')]));});});};
\ No newline at end of file
+var _0x81af=['redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','Plugin','create','body','options','CreatePlugin','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1ca4c3,_0x554126){var _0x4426a6=function(_0x11e9b0){while(--_0x11e9b0){_0x1ca4c3['push'](_0x1ca4c3['shift']());}};_0x4426a6(++_0x554126);}(_0x81af,0x106));var _0xf81a=function(_0x2ec2f2,_0x2f3697){_0x2ec2f2=_0x2ec2f2-0x0;var _0xeb0aa8=_0x81af[_0x2ec2f2];return _0xeb0aa8;};'use strict';var _=require(_0xf81a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf81a('0x1'));var rs=require(_0xf81a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf81a('0x3'));var logger=require(_0xf81a('0x4'))(_0xf81a('0x5'));var config=require(_0xf81a('0x6'));var jayson=require(_0xf81a('0x7'));var client=jayson[_0xf81a('0x8')][_0xf81a('0x9')]({'port':0x232a});config[_0xf81a('0xa')]=_[_0xf81a('0xb')](config['redis'],{'host':_0xf81a('0xc'),'port':0x18eb});var socket=require(_0xf81a('0xd'))(new Redis(config[_0xf81a('0xa')]));require(_0xf81a('0xe'))[_0xf81a('0xf')](socket);function respondWithRpcPromise(_0x27f444,_0x3f26c8,_0x468a8e){return new BPromise(function(_0x286264,_0x1e90b5){return client[_0xf81a('0x10')](_0x27f444,_0x468a8e)[_0xf81a('0x11')](function(_0x4a44c7){logger[_0xf81a('0x12')]('Plugin,\x20%s,\x20%s',_0x3f26c8,_0xf81a('0x13'));logger[_0xf81a('0x14')](_0xf81a('0x15'),_0x3f26c8,_0xf81a('0x13'),JSON[_0xf81a('0x16')](_0x4a44c7));if(_0x4a44c7[_0xf81a('0x17')]){if(_0x4a44c7[_0xf81a('0x17')][_0xf81a('0x18')]===0x1f4){logger[_0xf81a('0x17')](_0xf81a('0x19'),_0x3f26c8,_0x4a44c7[_0xf81a('0x17')][_0xf81a('0x1a')]);return _0x1e90b5(_0x4a44c7[_0xf81a('0x17')][_0xf81a('0x1a')]);}logger[_0xf81a('0x17')](_0xf81a('0x19'),_0x3f26c8,_0x4a44c7[_0xf81a('0x17')][_0xf81a('0x1a')]);return _0x286264(_0x4a44c7[_0xf81a('0x17')][_0xf81a('0x1a')]);}else{logger[_0xf81a('0x12')]('Plugin,\x20%s,\x20%s',_0x3f26c8,'request\x20sent');_0x286264(_0x4a44c7[_0xf81a('0x1b')][_0xf81a('0x1a')]);}})['catch'](function(_0x4ec28c){logger[_0xf81a('0x17')](_0xf81a('0x19'),_0x3f26c8,_0x4ec28c);_0x1e90b5(_0x4ec28c);});});}exports['CreatePlugin']=function(_0x1316c5){var _0x3333f8=this;return new Promise(function(_0x2fa5de,_0x1e6159){return db[_0xf81a('0x1c')][_0xf81a('0x1d')](_0x1316c5[_0xf81a('0x1e')],{'raw':_0x1316c5[_0xf81a('0x1f')]?_0x1316c5['options']['raw']===undefined?!![]:![]:!![]})[_0xf81a('0x11')](function(_0x4be91c){logger['info']('CreatePlugin',_0x1316c5);logger['debug'](_0xf81a('0x20'),_0x1316c5,JSON[_0xf81a('0x16')](_0x4be91c));_0x2fa5de(_0x4be91c);})[_0xf81a('0x21')](function(_0x586541){logger[_0xf81a('0x17')](_0xf81a('0x20'),_0x586541['message'],_0x1316c5);_0x1e6159(_0x3333f8[_0xf81a('0x17')](0x1f4,_0x586541['message']));});});};
\ No newline at end of file
index f4c8c1a..2d06ed0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d27=['plugin:','./plugin.events','save','remove','update','emit','removeListener','register','length'];(function(_0x1b540f,_0xbf66e0){var _0x1259f4=function(_0x27faef){while(--_0x27faef){_0x1b540f['push'](_0x1b540f['shift']());}};_0x1259f4(++_0xbf66e0);}(_0x3d27,0xe2));var _0x73d2=function(_0x2718c7,_0x5a1636){_0x2718c7=_0x2718c7-0x0;var _0x59d89c=_0x3d27[_0x2718c7];return _0x59d89c;};'use strict';var PluginEvents=require(_0x73d2('0x0'));var events=[_0x73d2('0x1'),_0x73d2('0x2'),_0x73d2('0x3')];function createListener(_0x23083e,_0x4ca8a9){return function(_0x3af7d1){_0x4ca8a9[_0x73d2('0x4')](_0x23083e,_0x3af7d1);};}function removeListener(_0x915beb,_0x240ef3){return function(){PluginEvents[_0x73d2('0x5')](_0x915beb,_0x240ef3);};}exports[_0x73d2('0x6')]=function(_0x18b0d0){for(var _0x5b97c4=0x0,_0x1f9cb5=events[_0x73d2('0x7')];_0x5b97c4<_0x1f9cb5;_0x5b97c4++){var _0x51df35=events[_0x5b97c4];var _0x5a468d=createListener(_0x73d2('0x8')+_0x51df35,_0x18b0d0);PluginEvents['on'](_0x51df35,_0x5a468d);}};
\ No newline at end of file
+var _0x9bcc=['remove','emit','removeListener','register','length','plugin:','./plugin.events','save'];(function(_0x3c7936,_0x4bf3ec){var _0x56df6c=function(_0x18a2cf){while(--_0x18a2cf){_0x3c7936['push'](_0x3c7936['shift']());}};_0x56df6c(++_0x4bf3ec);}(_0x9bcc,0x15e));var _0xc9bc=function(_0x503306,_0x356f2f){_0x503306=_0x503306-0x0;var _0x44a99d=_0x9bcc[_0x503306];return _0x44a99d;};'use strict';var PluginEvents=require(_0xc9bc('0x0'));var events=[_0xc9bc('0x1'),_0xc9bc('0x2'),'update'];function createListener(_0x61c9d1,_0x2e4466){return function(_0x94ac74){_0x2e4466[_0xc9bc('0x3')](_0x61c9d1,_0x94ac74);};}function removeListener(_0x29c671,_0x465998){return function(){PluginEvents[_0xc9bc('0x4')](_0x29c671,_0x465998);};}exports[_0xc9bc('0x5')]=function(_0x507f21){for(var _0x2b7225=0x0,_0x3fa5f1=events[_0xc9bc('0x6')];_0x2b7225<_0x3fa5f1;_0x2b7225++){var _0x238856=events[_0x2b7225];var _0x5a3ba8=createListener(_0xc9bc('0x7')+_0x238856,_0x507f21);PluginEvents['on'](_0x238856,_0x5a3ba8);}};
\ No newline at end of file
index 7f3faa4..4575ee4 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(_0x35da96,_0x14f90e){var _0x34c6ed=function(_0x12e038){while(--_0x12e038){_0x35da96['push'](_0x35da96['shift']());}};_0x34c6ed(++_0x14f90e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x1f2928,_0x4f41ed){var _0x37badd=function(_0xe6bcc0){while(--_0xe6bcc0){_0x1f2928['push'](_0x1f2928['shift']());}};_0x37badd(++_0x4f41ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 f871cc6..7f6b2a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc788=['body','script','join','../../files/plugins','chdir','dirname','start','dump','send','update','stop','hasOwnProperty','Unknown\x20status','params','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','bluebird','sendStatus','status','error','stack','name','info','index','list','then','reject','motion2','catch','show','describe'];(function(_0x5a427c,_0x1c7b6f){var _0xc17e0d=function(_0x3b82a7){while(--_0x3b82a7){_0x5a427c['push'](_0x5a427c['shift']());}};_0xc17e0d(++_0x1c7b6f);}(_0xc788,0xc4));var _0x8c78=function(_0x253bd2,_0x4e88ff){_0x253bd2=_0x253bd2-0x0;var _0x457ff9=_0xc788[_0x253bd2];return _0x457ff9;};'use strict';var _=require(_0x8c78('0x0'));var pm2=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var path=require('path');var exec=require(_0x8c78('0x3'))[_0x8c78('0x4')];var BPromise=require(_0x8c78('0x5'));function handleEntityNotFound(_0x1d0670,_0x386f0a){return function(_0x5498f9){if(!_0x5498f9){_0x1d0670[_0x8c78('0x6')](0x194);;}return _0x5498f9;};}function respondWithResult(_0x4555da,_0x329152){_0x329152=_0x329152||0xc8;return function(_0x1ac27f){if(_0x1ac27f){return _0x4555da[_0x8c78('0x7')](_0x329152)['json'](_0x1ac27f);}return null;};}function handleError(_0x247188,_0x299d9d){_0x299d9d=_0x299d9d||0x1f4;return function(_0x9bc075){logger[_0x8c78('0x8')](_0x9bc075[_0x8c78('0x9')]);if(_0x9bc075[_0x8c78('0xa')]){delete _0x9bc075['name'];}_0x247188[_0x8c78('0x7')](_0x299d9d)['send'](_0x9bc075);};}function execChildProcess(){return new BPromise(function(_0x3d55f0,_0x45935a){exec('npm\x20install',function(_0x1a05a7,_0x95e78e,_0x5ee642){logger[_0x8c78('0xb')](_0x95e78e);logger['info'](_0x5ee642);if(_0x1a05a7){logger['error'](_0x1a05a7);return _0x45935a(_0x1a05a7);}return _0x3d55f0(_0x95e78e);});});}exports[_0x8c78('0xc')]=function(_0x1b1d0e,_0x26178c){return pm2[_0x8c78('0xd')]()[_0x8c78('0xe')](function(_0x3d1306){if(_0x3d1306){var _0xe5f8ae=_[_0x8c78('0xf')](_0x3d1306,function(_0x2f44af){return _0x2f44af[_0x8c78('0xa')]==='express'||_0x2f44af[_0x8c78('0xa')]===_0x8c78('0x10');});return{'rows':_0xe5f8ae,'count':_0xe5f8ae['length']};}return null;})[_0x8c78('0xe')](respondWithResult(_0x26178c,null))[_0x8c78('0x11')](handleError(_0x26178c,null));};exports[_0x8c78('0x12')]=function(_0x23824e,_0x2a982c){return pm2[_0x8c78('0x13')](_0x23824e['params']['id'])['then'](respondWithResult(_0x2a982c,null))[_0x8c78('0xe')](handleEntityNotFound(_0x2a982c,null))['catch'](handleError(_0x2a982c,null));};exports['create']=function(_0xece4f0,_0x56c191){if(_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')]&&_0xece4f0['body'][_0x8c78('0x15')]){var _0x5b111b=path[_0x8c78('0x16')](__dirname,_0x8c78('0x17'),_0xece4f0['body'][_0x8c78('0x15')]);var _0x188cc3=process['cwd']();process[_0x8c78('0x18')](path[_0x8c78('0x19')](_0x5b111b));return execChildProcess()[_0x8c78('0xe')](function(_0x9581c6){process[_0x8c78('0x18')](_0x188cc3);return pm2[_0x8c78('0x1a')]({'name':_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')],'script':_0x5b111b});})[_0x8c78('0xe')](function(_0x4a7d20){pm2[_0x8c78('0x1b')]();return _0x4a7d20[0x0];})[_0x8c78('0xe')](respondWithResult(_0x56c191,0xc9))[_0x8c78('0x11')](handleError(_0x56c191,null));}else{return _0x56c191['status'](0x1f4)[_0x8c78('0x1c')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8c78('0x1d')]=function(_0x24f9a7,_0x8d9ff9){if(_0x24f9a7['body']['id']){delete _0x24f9a7[_0x8c78('0x14')]['id'];}var _0x2568d5={'online':'restart','stopped':_0x8c78('0x1e')};if(_0x2568d5[_0x8c78('0x1f')](_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')])){return pm2[_0x2568d5[_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')]]](_0x24f9a7['params']['id'])[_0x8c78('0xe')](respondWithResult(_0x8d9ff9,0xc8))['catch'](handleError(_0x8d9ff9,null));}else{return _0x8d9ff9[_0x8c78('0x7')](0x1f4)[_0x8c78('0x1c')]({'message':_0x8c78('0x20')});}};exports['destroy']=function(_0x1f1a0c,_0x3816d2){if(_0x1f1a0c['body']['id']){delete _0x1f1a0c[_0x8c78('0x14')]['id'];}if(_0x1f1a0c[_0x8c78('0x21')]['id']){return pm2[_0x8c78('0x22')](_0x1f1a0c['params']['id'])[_0x8c78('0xe')](function(_0x63307e){pm2[_0x8c78('0x1b')]();return _0x63307e[0x0];})['then'](respondWithResult(_0x3816d2,null))[_0x8c78('0x11')](handleError(_0x3816d2,null));}else{return _0x3816d2[_0x8c78('0x7')](0x1f4)['send']({'message':_0x8c78('0x23')});}};
\ No newline at end of file
+var _0x3667=['lodash','../../config/pm2','../../config/logger','api','path','exec','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','create','body','join','script','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty','params','destroy','delete'];(function(_0x26b9ac,_0x23c607){var _0xb7b337=function(_0xefd141){while(--_0xefd141){_0x26b9ac['push'](_0x26b9ac['shift']());}};_0xb7b337(++_0x23c607);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var pm2=require(_0x7366('0x1'));var logger=require(_0x7366('0x2'))(_0x7366('0x3'));var path=require(_0x7366('0x4'));var exec=require('child_process')[_0x7366('0x5')];var BPromise=require(_0x7366('0x6'));function handleEntityNotFound(_0x4b32a7,_0x27726b){return function(_0x22bfc0){if(!_0x22bfc0){_0x4b32a7[_0x7366('0x7')](0x194);;}return _0x22bfc0;};}function respondWithResult(_0x1c0cf4,_0x101e3d){_0x101e3d=_0x101e3d||0xc8;return function(_0x589397){if(_0x589397){return _0x1c0cf4[_0x7366('0x8')](_0x101e3d)[_0x7366('0x9')](_0x589397);}return null;};}function handleError(_0x2dd32b,_0x26e9a9){_0x26e9a9=_0x26e9a9||0x1f4;return function(_0x171fe2){logger[_0x7366('0xa')](_0x171fe2[_0x7366('0xb')]);if(_0x171fe2[_0x7366('0xc')]){delete _0x171fe2[_0x7366('0xc')];}_0x2dd32b[_0x7366('0x8')](_0x26e9a9)[_0x7366('0xd')](_0x171fe2);};}function execChildProcess(){return new BPromise(function(_0x2d7e38,_0x57ea7f){exec(_0x7366('0xe'),function(_0x2694fc,_0xbcd488,_0x4718db){logger[_0x7366('0xf')](_0xbcd488);logger[_0x7366('0xf')](_0x4718db);if(_0x2694fc){logger[_0x7366('0xa')](_0x2694fc);return _0x57ea7f(_0x2694fc);}return _0x2d7e38(_0xbcd488);});});}exports[_0x7366('0x10')]=function(_0x37e47e,_0x1813b7){return pm2[_0x7366('0x11')]()[_0x7366('0x12')](function(_0x27500c){if(_0x27500c){var _0x22562f=_[_0x7366('0x13')](_0x27500c,function(_0x4dd111){return _0x4dd111[_0x7366('0xc')]===_0x7366('0x14')||_0x4dd111[_0x7366('0xc')]===_0x7366('0x15');});return{'rows':_0x22562f,'count':_0x22562f[_0x7366('0x16')]};}return null;})[_0x7366('0x12')](respondWithResult(_0x1813b7,null))[_0x7366('0x17')](handleError(_0x1813b7,null));};exports[_0x7366('0x18')]=function(_0x83e5d5,_0x41113f){return pm2[_0x7366('0x19')](_0x83e5d5['params']['id'])[_0x7366('0x12')](respondWithResult(_0x41113f,null))['then'](handleEntityNotFound(_0x41113f,null))[_0x7366('0x17')](handleError(_0x41113f,null));};exports[_0x7366('0x1a')]=function(_0x3f23cd,_0x52b43e){if(_0x3f23cd[_0x7366('0x1b')][_0x7366('0xc')]&&_0x3f23cd[_0x7366('0x1b')]['script']){var _0x16e038=path[_0x7366('0x1c')](__dirname,'../../files/plugins',_0x3f23cd[_0x7366('0x1b')][_0x7366('0x1d')]);var _0xaab659=process[_0x7366('0x1e')]();process[_0x7366('0x1f')](path[_0x7366('0x20')](_0x16e038));return execChildProcess()[_0x7366('0x12')](function(_0x22ed7e){process[_0x7366('0x1f')](_0xaab659);return pm2[_0x7366('0x21')]({'name':_0x3f23cd[_0x7366('0x1b')][_0x7366('0xc')],'script':_0x16e038});})[_0x7366('0x12')](function(_0x563b22){pm2[_0x7366('0x22')]();return _0x563b22[0x0];})['then'](respondWithResult(_0x52b43e,0xc9))[_0x7366('0x17')](handleError(_0x52b43e,null));}else{return _0x52b43e['status'](0x1f4)['send']({'message':_0x7366('0x23')});}};exports['update']=function(_0x254374,_0x4ac138){if(_0x254374[_0x7366('0x1b')]['id']){delete _0x254374[_0x7366('0x1b')]['id'];}var _0x5c37e2={'online':_0x7366('0x24'),'stopped':'stop'};if(_0x5c37e2[_0x7366('0x25')](_0x254374[_0x7366('0x1b')]['status'])){return pm2[_0x5c37e2[_0x254374[_0x7366('0x1b')]['status']]](_0x254374[_0x7366('0x26')]['id'])[_0x7366('0x12')](respondWithResult(_0x4ac138,0xc8))[_0x7366('0x17')](handleError(_0x4ac138,null));}else{return _0x4ac138[_0x7366('0x8')](0x1f4)[_0x7366('0xd')]({'message':'Unknown\x20status'});}};exports[_0x7366('0x27')]=function(_0x447807,_0x538d42){if(_0x447807['body']['id']){delete _0x447807['body']['id'];}if(_0x447807['params']['id']){return pm2[_0x7366('0x28')](_0x447807[_0x7366('0x26')]['id'])[_0x7366('0x12')](function(_0x15286a){pm2['dump']();return _0x15286a[0x0];})[_0x7366('0x12')](respondWithResult(_0x538d42,null))[_0x7366('0x17')](handleError(_0x538d42,null));}else{return _0x538d42[_0x7366('0x8')](0x1f4)[_0x7366('0xd')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
index 3bff837..b6fb87b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe230=['express','Router','get','/queues','isAuthenticated','getQueues','exports'];(function(_0x1746f9,_0x291df3){var _0x670782=function(_0x5d99ef){while(--_0x5d99ef){_0x1746f9['push'](_0x1746f9['shift']());}};_0x670782(++_0x291df3);}(_0xe230,0x85));var _0x0e23=function(_0x14f4c0,_0x3bf915){_0x14f4c0=_0x14f4c0-0x0;var _0x2f7bdf=_0xe230[_0x14f4c0];return _0x2f7bdf;};'use strict';var express=require(_0x0e23('0x0'));var router=express[_0x0e23('0x1')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0x0e23('0x2')](_0x0e23('0x3'),auth[_0x0e23('0x4')](),controller[_0x0e23('0x5')]);module[_0x0e23('0x6')]=router;
\ No newline at end of file
+var _0x6257=['express','../../components/auth/service','/queues','isAuthenticated','getQueues','exports'];(function(_0x507a19,_0xe0e75c){var _0x2dd75f=function(_0x1f72a2){while(--_0x1f72a2){_0x507a19['push'](_0x507a19['shift']());}};_0x2dd75f(++_0xe0e75c);}(_0x6257,0x1d4));var _0x7625=function(_0x165f7e,_0x4e1736){_0x165f7e=_0x165f7e-0x0;var _0x499595=_0x6257[_0x165f7e];return _0x499595;};'use strict';var express=require(_0x7625('0x0'));var router=express['Router']();var auth=require(_0x7625('0x1'));var controller=require('./realtime.controller');router['get'](_0x7625('0x2'),auth[_0x7625('0x3')](),controller[_0x7625('0x4')]);module[_0x7625('0x5')]=router;
\ No newline at end of file
index 40ced49..3c54555 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8fb=['rawAttributes','fieldName','type','key','getOptions','user','role','userProfileId','outbound','QueueCampaigns','Queues','filter','UserProfile','getResources','findAndCountAll','then','count','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','available','waiting','talking','push','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','paused','loggedInDb','pTalking','agents','find','merge','getAgents','getMembers','length','online','Pause','findAll','QueueId','User','UserId','agent','all','catch','util','lodash','jayson/promise','../../components/parsers/qs','client','http','offset','limit','undefined','set','Content-Range','json','error','stack','name','status','send','getQueues','mail','chat','openchannel','fax','voice','resolve','channel','Invalid\x20channel','query','toLowerCase','startCase','Queue','map'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5d57a4,_0x36f48d){_0x5d57a4=_0x5d57a4-0x0;var _0x1edfb8=_0xd8fb[_0x5d57a4];return _0x1edfb8;};'use strict';var util=require(_0xbd8f('0x0'));var _=require(_0xbd8f('0x1'));var jayson=require(_0xbd8f('0x2'));var qs=require(_0xbd8f('0x3'));var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var client=jayson[_0xbd8f('0x4')][_0xbd8f('0x5')]({'port':0x232a});var routingClient=jayson['client'][_0xbd8f('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x2343bf,_0x5543b2){return function(_0x33d541){if(_0x33d541){var _0x4e97cf=typeof _0x5543b2[_0xbd8f('0x6')]==='undefined'&&typeof _0x5543b2[_0xbd8f('0x7')]===_0xbd8f('0x8');var _0x493298=_0x33d541['count'];var _0x3caa93=_0x4e97cf?0x0:_0x5543b2[_0xbd8f('0x6')];var _0x2a55b5=_0x4e97cf?_0x33d541['count']:_0x5543b2[_0xbd8f('0x6')]+_0x5543b2[_0xbd8f('0x7')];var _0x5b834b;if(_0x2a55b5>=_0x493298){_0x2a55b5=_0x493298;_0x5b834b=0xc8;}else{_0x5b834b=0xce;}_0x2343bf['status'](_0x5b834b);return _0x2343bf[_0xbd8f('0x9')](_0xbd8f('0xa'),_0x3caa93+'-'+_0x2a55b5+'/'+_0x493298)[_0xbd8f('0xb')](_0x33d541);}return null;};}function handleError(_0x5d5705,_0x230988){_0x230988=_0x230988||0x1f4;return function(_0x159f09){logger[_0xbd8f('0xc')](_0x159f09[_0xbd8f('0xd')]);if(_0x159f09[_0xbd8f('0xe')]){delete _0x159f09[_0xbd8f('0xe')];}_0x5d5705[_0xbd8f('0xf')](_0x230988)[_0xbd8f('0x10')](_0x159f09);};}exports[_0xbd8f('0x11')]=function(_0x5e59ae,_0x31573c){var _0x829fb2=[_0xbd8f('0x12'),_0xbd8f('0x13'),'sms',_0xbd8f('0x14'),_0xbd8f('0x15'),'whatsapp',_0xbd8f('0x16')];var _0xf5e7a={'count':0x0,'rows':[]},_0x504adb={},_0x4435b9;Promise[_0xbd8f('0x17')]()['then'](function(){if(_0x5e59ae['query'][_0xbd8f('0x18')]){if(!_['includes'](_0x829fb2,_0x5e59ae['query'][_0xbd8f('0x18')]['toLowerCase']()))throw new Error(_0xbd8f('0x19'));_0x4435b9=_0x5e59ae[_0xbd8f('0x1a')][_0xbd8f('0x18')][_0xbd8f('0x1b')]();}var _0xdc11cc=_[_0xbd8f('0x1c')](_0x4435b9)+_0xbd8f('0x1d');var _0x90eff8=_[_0xbd8f('0x1e')](db[_0xdc11cc][_0xbd8f('0x1f')],function(_0xfe4048){return{'name':_0xfe4048[_0xbd8f('0x20')],'type':_0xfe4048[_0xbd8f('0x21')][_0xbd8f('0x22')]};});_0x504adb=qs[_0xbd8f('0x23')](_0x90eff8,_0x5e59ae);if(_0x5e59ae[_0xbd8f('0x24')][_0xbd8f('0x25')]==='user'){var _0x359ead={'params':{'id':_0x5e59ae[_0xbd8f('0x24')][_0xbd8f('0x26')]},'query':{'section':_0x4435b9===_0xbd8f('0x16')&&_0x5e59ae[_0xbd8f('0x1a')][_0xbd8f('0x21')]===_0xbd8f('0x27')?_0xbd8f('0x28'):_['startCase'](_0x4435b9)+_0xbd8f('0x29'),'type':_0x5e59ae[_0xbd8f('0x1a')]['type'],'nolimit':!![],'sort':_0xbd8f('0xe'),'filter':_0x5e59ae['query'][_0xbd8f('0x2a')]}};return db[_0xbd8f('0x2b')][_0xbd8f('0x2c')](_0x359ead);}return db[_0xdc11cc][_0xbd8f('0x2d')](_0x504adb);})[_0xbd8f('0x2e')](function(_0x247b07){_0xf5e7a['count']=_0x247b07[_0xbd8f('0x2f')];var _0x14f3cb=_0x4435b9===_0xbd8f('0x16')?client:routingClient;return _0x14f3cb[_0xbd8f('0x30')](_[_0xbd8f('0x1c')](_0x4435b9)+_0xbd8f('0x29'),_0x5e59ae)[_0xbd8f('0x2e')](function(_0x479a0c){if(_0x479a0c[_0xbd8f('0xc')])throw new Error(util[_0xbd8f('0x31')](_0xbd8f('0x32'),_0x4435b9));var _0x7ca145=_0x479a0c['result'];var _0x555f4b=[_0xbd8f('0x33'),_0xbd8f('0x34'),_0xbd8f('0x35'),_0xbd8f('0x36'),'paused'];if(_0x4435b9===_0xbd8f('0x16')&&_0x5e59ae[_0xbd8f('0x1a')][_0xbd8f('0x21')]===_0xbd8f('0x27')){_0x555f4b[_0xbd8f('0x37')]('pTalking',_0xbd8f('0x38'),_0xbd8f('0x39'),_0xbd8f('0x3a'),_0xbd8f('0x3b'),_0xbd8f('0x3c'),'startPredictive',_0xbd8f('0x3d'),'erlangCalls',_0xbd8f('0x3e'),_0xbd8f('0x3f'),_0xbd8f('0x40'),_0xbd8f('0x41'),_0xbd8f('0x42'),_0xbd8f('0x43'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0xbd8f('0x44'),_0xbd8f('0x45'),_0xbd8f('0x46'),_0xbd8f('0x47'));}var _0xc0aaee=_0x247b07[_0xbd8f('0x48')][_0xbd8f('0x1e')](function(_0x30c1c2){var _0x2d4882=_0x30c1c2[_0xbd8f('0x49')]({'plain':!![]});_0x2d4882[_0xbd8f('0x4a')]=0x0;_0x2d4882[_0xbd8f('0x4b')]=0x0;_0x2d4882[_0xbd8f('0x33')]=0x0;_0x2d4882[_0xbd8f('0x34')]=0x0;_0x2d4882[_0xbd8f('0x4a')]=0x0;_0x2d4882['waiting']=0x0;if(_0x4435b9===_0xbd8f('0x16')){_0x2d4882[_0xbd8f('0x36')]=0x0;if(_0x5e59ae['query'][_0xbd8f('0x21')]===_0xbd8f('0x27')){_0x2d4882[_0xbd8f('0x4c')]=0x0;_0x2d4882['originated']=0x0;}}_0x2d4882[_0xbd8f('0x4d')]=[];var _0x5d4151=_[_0xbd8f('0x4e')](_0x7ca145[_0xbd8f('0x48')],['id',_0x2d4882['id']]);if(_0x5d4151)_[_0xbd8f('0x4f')](_0x2d4882,_['pick'](_0x5d4151,_0x555f4b));if(_0x4435b9===_0xbd8f('0x16')){return _0x30c1c2[_0xbd8f('0x50')]({'attributes':['id',_0xbd8f('0xe'),'online'],'joinTableAttributes':[],'raw':!![]})[_0xbd8f('0x2e')](function(_0x3d82ef){return _0x30c1c2[_0xbd8f('0x51')]({'raw':!![]})[_0xbd8f('0x2e')](function(_0x280d95){for(var _0x1db8c7=0x0;_0x1db8c7<_0x3d82ef[_0xbd8f('0x52')];_0x1db8c7++){var _0xb453a8=_[_0xbd8f('0x4e')](_0x280d95,['UserId',_0x3d82ef[_0x1db8c7]['id']]);var _0x52c62b={'id':_0x3d82ef[_0x1db8c7]['id'],'name':_0x3d82ef[_0x1db8c7][_0xbd8f('0xe')],'online':Boolean(_0x3d82ef[_0x1db8c7][_0xbd8f('0x53')]),'paused':_0xb453a8?Boolean(_0xb453a8[_0xbd8f('0x4a')]):![]};if(_0x52c62b[_0xbd8f('0x53')])_0x2d4882['loggedInDb']++;if(_0x52c62b[_0xbd8f('0x4a')])_0x2d4882[_0xbd8f('0x4a')]++;_0x2d4882[_0xbd8f('0x4d')][_0xbd8f('0x37')](_0x52c62b);}return _0x2d4882;});});}else{var _0x753f0='User'+_['startCase'](_0x4435b9)+_0xbd8f('0x1d');var _0x490d15=_0x4435b9+_0xbd8f('0x54');return db[_0x753f0][_0xbd8f('0x55')]({'where':{[_[_0xbd8f('0x1c')](_0x4435b9)+_0xbd8f('0x56')]:_0x30c1c2['id']},'raw':!![]})[_0xbd8f('0x2e')](function(_0x151f82){return db[_0xbd8f('0x57')][_0xbd8f('0x55')]({'attributes':['id','name',_0xbd8f('0x53'),_0x490d15],'where':{'id':_[_0xbd8f('0x1e')](_0x151f82,_0xbd8f('0x58')),'role':_0xbd8f('0x59')},'raw':!![]});})[_0xbd8f('0x2e')](function(_0x43298f){for(var _0x272f70=0x0;_0x272f70<_0x43298f[_0xbd8f('0x52')];_0x272f70++){var _0x5668b6={'id':_0x43298f[_0x272f70]['id'],'name':_0x43298f[_0x272f70][_0xbd8f('0xe')],'online':Boolean(_0x43298f[_0x272f70][_0xbd8f('0x53')]),'paused':Boolean(_0x43298f[_0x272f70][_0x490d15])};if(_0x5668b6[_0xbd8f('0x53')])_0x2d4882[_0xbd8f('0x4b')]++;if(_0x5668b6[_0xbd8f('0x4a')])_0x2d4882[_0xbd8f('0x4a')]++;_0x2d4882[_0xbd8f('0x4d')][_0xbd8f('0x37')](_0x5668b6);}return _0x2d4882;});}});return Promise[_0xbd8f('0x5a')](_0xc0aaee);});})[_0xbd8f('0x2e')](function(_0x406741){_0xf5e7a[_0xbd8f('0x48')]=_0x406741;return _0xf5e7a;})[_0xbd8f('0x2e')](respondWithFilteredResult(_0x31573c,_0x504adb))[_0xbd8f('0x5b')](handleError(_0x31573c,null));};
\ No newline at end of file
+var _0x4bd3=['request','result','loggedIn','waiting','talking','paused','push','originated','message','dialActive','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','available','outbound','agents','find','rows','pick','getAgents','getMembers','UserId','online','Pause','findAll','QueueId','User','agent','all','catch','util','jayson/promise','../../components/parsers/qs','client','http','offset','limit','undefined','count','Content-Range','error','stack','name','status','send','getQueues','chat','sms','openchannel','fax','whatsapp','voice','resolve','then','channel','includes','query','toLowerCase','Invalid\x20channel','startCase','Queue','map','rawAttributes','getOptions','role','user','userProfileId','type','QueueCampaigns','Queues','UserProfile','getResources','findAndCountAll'];(function(_0x3bb028,_0x36d70f){var _0x95983=function(_0x409038){while(--_0x409038){_0x3bb028['push'](_0x3bb028['shift']());}};_0x95983(++_0x36d70f);}(_0x4bd3,0x174));var _0x34bd=function(_0x22eac2,_0x189c50){_0x22eac2=_0x22eac2-0x0;var _0x3fabb3=_0x4bd3[_0x22eac2];return _0x3fabb3;};'use strict';var util=require(_0x34bd('0x0'));var _=require('lodash');var jayson=require(_0x34bd('0x1'));var qs=require(_0x34bd('0x2'));var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var client=jayson[_0x34bd('0x3')][_0x34bd('0x4')]({'port':0x232a});var routingClient=jayson[_0x34bd('0x3')]['http']({'port':0x232c});function respondWithFilteredResult(_0x2133c5,_0x2a15a2){return function(_0x5c2a7a){if(_0x5c2a7a){var _0x3e8744=typeof _0x2a15a2[_0x34bd('0x5')]==='undefined'&&typeof _0x2a15a2[_0x34bd('0x6')]===_0x34bd('0x7');var _0x3260ff=_0x5c2a7a[_0x34bd('0x8')];var _0x1ac77f=_0x3e8744?0x0:_0x2a15a2[_0x34bd('0x5')];var _0x4db0ba=_0x3e8744?_0x5c2a7a[_0x34bd('0x8')]:_0x2a15a2[_0x34bd('0x5')]+_0x2a15a2[_0x34bd('0x6')];var _0x7c7992;if(_0x4db0ba>=_0x3260ff){_0x4db0ba=_0x3260ff;_0x7c7992=0xc8;}else{_0x7c7992=0xce;}_0x2133c5['status'](_0x7c7992);return _0x2133c5['set'](_0x34bd('0x9'),_0x1ac77f+'-'+_0x4db0ba+'/'+_0x3260ff)['json'](_0x5c2a7a);}return null;};}function handleError(_0x4ac0dc,_0x275d80){_0x275d80=_0x275d80||0x1f4;return function(_0x1f19b9){logger[_0x34bd('0xa')](_0x1f19b9[_0x34bd('0xb')]);if(_0x1f19b9[_0x34bd('0xc')]){delete _0x1f19b9[_0x34bd('0xc')];}_0x4ac0dc[_0x34bd('0xd')](_0x275d80)[_0x34bd('0xe')](_0x1f19b9);};}exports[_0x34bd('0xf')]=function(_0x59ed5d,_0x3fa6a8){var _0x4d4955=['mail',_0x34bd('0x10'),_0x34bd('0x11'),_0x34bd('0x12'),_0x34bd('0x13'),_0x34bd('0x14'),_0x34bd('0x15')];var _0xd39d72={'count':0x0,'rows':[]},_0x1c12e8={},_0x3b4bf8;Promise[_0x34bd('0x16')]()[_0x34bd('0x17')](function(){if(_0x59ed5d['query'][_0x34bd('0x18')]){if(!_[_0x34bd('0x19')](_0x4d4955,_0x59ed5d[_0x34bd('0x1a')][_0x34bd('0x18')][_0x34bd('0x1b')]()))throw new Error(_0x34bd('0x1c'));_0x3b4bf8=_0x59ed5d[_0x34bd('0x1a')][_0x34bd('0x18')][_0x34bd('0x1b')]();}var _0x55538e=_[_0x34bd('0x1d')](_0x3b4bf8)+_0x34bd('0x1e');var _0x49f625=_[_0x34bd('0x1f')](db[_0x55538e][_0x34bd('0x20')],function(_0x5e0c06){return{'name':_0x5e0c06['fieldName'],'type':_0x5e0c06['type']['key']};});_0x1c12e8=qs[_0x34bd('0x21')](_0x49f625,_0x59ed5d);if(_0x59ed5d['user'][_0x34bd('0x22')]===_0x34bd('0x23')){var _0x428140={'params':{'id':_0x59ed5d['user'][_0x34bd('0x24')]},'query':{'section':_0x3b4bf8===_0x34bd('0x15')&&_0x59ed5d[_0x34bd('0x1a')][_0x34bd('0x25')]==='outbound'?_0x34bd('0x26'):_[_0x34bd('0x1d')](_0x3b4bf8)+_0x34bd('0x27'),'type':_0x59ed5d[_0x34bd('0x1a')]['type'],'nolimit':!![],'sort':_0x34bd('0xc'),'filter':_0x59ed5d[_0x34bd('0x1a')]['filter']}};return db[_0x34bd('0x28')][_0x34bd('0x29')](_0x428140);}return db[_0x55538e][_0x34bd('0x2a')](_0x1c12e8);})[_0x34bd('0x17')](function(_0x26b8e7){_0xd39d72[_0x34bd('0x8')]=_0x26b8e7[_0x34bd('0x8')];var _0x58b431=_0x3b4bf8===_0x34bd('0x15')?client:routingClient;return _0x58b431[_0x34bd('0x2b')](_['startCase'](_0x3b4bf8)+'Queues',_0x59ed5d)[_0x34bd('0x17')](function(_0xca9897){if(_0xca9897[_0x34bd('0xa')])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x3b4bf8));var _0x3cf514=_0xca9897[_0x34bd('0x2c')];var _0x1387b5=[_0x34bd('0x2d'),'available',_0x34bd('0x2e'),_0x34bd('0x2f'),_0x34bd('0x30')];if(_0x3b4bf8===_0x34bd('0x15')&&_0x59ed5d[_0x34bd('0x1a')][_0x34bd('0x25')]==='outbound'){_0x1387b5[_0x34bd('0x31')]('pTalking',_0x34bd('0x32'),_0x34bd('0x33'),_0x34bd('0x34'),'dialMethod',_0x34bd('0x35'),_0x34bd('0x36'),'startProgressive',_0x34bd('0x37'),_0x34bd('0x38'),_0x34bd('0x39'),'erlangBusyFactor',_0x34bd('0x3a'),_0x34bd('0x3b'),'dialPredictiveIntervalMinThreshold',_0x34bd('0x3c'),_0x34bd('0x3d'),_0x34bd('0x3e'),_0x34bd('0x3f'),_0x34bd('0x40'),_0x34bd('0x41'),'predictiveIntervalAvgTalktime');}var _0x49c3ef=_0x26b8e7['rows'][_0x34bd('0x1f')](function(_0x1258cf){var _0x5e30c5=_0x1258cf['get']({'plain':!![]});_0x5e30c5[_0x34bd('0x30')]=0x0;_0x5e30c5['loggedInDb']=0x0;_0x5e30c5['loggedIn']=0x0;_0x5e30c5[_0x34bd('0x42')]=0x0;_0x5e30c5[_0x34bd('0x30')]=0x0;_0x5e30c5[_0x34bd('0x2e')]=0x0;if(_0x3b4bf8===_0x34bd('0x15')){_0x5e30c5[_0x34bd('0x2f')]=0x0;if(_0x59ed5d['query']['type']===_0x34bd('0x43')){_0x5e30c5['pTalking']=0x0;_0x5e30c5[_0x34bd('0x32')]=0x0;}}_0x5e30c5[_0x34bd('0x44')]=[];var _0x3fc418=_[_0x34bd('0x45')](_0x3cf514[_0x34bd('0x46')],['id',_0x5e30c5['id']]);if(_0x3fc418)_['merge'](_0x5e30c5,_[_0x34bd('0x47')](_0x3fc418,_0x1387b5));if(_0x3b4bf8===_0x34bd('0x15')){return _0x1258cf[_0x34bd('0x48')]({'attributes':['id',_0x34bd('0xc'),'online'],'joinTableAttributes':[],'raw':!![]})[_0x34bd('0x17')](function(_0x55e2d4){return _0x1258cf[_0x34bd('0x49')]({'raw':!![]})[_0x34bd('0x17')](function(_0x561f95){for(var _0x279765=0x0;_0x279765<_0x55e2d4['length'];_0x279765++){var _0x1bd8d8=_[_0x34bd('0x45')](_0x561f95,[_0x34bd('0x4a'),_0x55e2d4[_0x279765]['id']]);var _0x42a424={'id':_0x55e2d4[_0x279765]['id'],'name':_0x55e2d4[_0x279765][_0x34bd('0xc')],'online':Boolean(_0x55e2d4[_0x279765][_0x34bd('0x4b')]),'paused':_0x1bd8d8?Boolean(_0x1bd8d8[_0x34bd('0x30')]):![]};if(_0x42a424['online'])_0x5e30c5['loggedInDb']++;if(_0x42a424['paused'])_0x5e30c5[_0x34bd('0x30')]++;_0x5e30c5[_0x34bd('0x44')][_0x34bd('0x31')](_0x42a424);}return _0x5e30c5;});});}else{var _0x787f74='User'+_[_0x34bd('0x1d')](_0x3b4bf8)+_0x34bd('0x1e');var _0x1c652a=_0x3b4bf8+_0x34bd('0x4c');return db[_0x787f74][_0x34bd('0x4d')]({'where':{[_['startCase'](_0x3b4bf8)+_0x34bd('0x4e')]:_0x1258cf['id']},'raw':!![]})['then'](function(_0x589874){return db[_0x34bd('0x4f')]['findAll']({'attributes':['id',_0x34bd('0xc'),_0x34bd('0x4b'),_0x1c652a],'where':{'id':_[_0x34bd('0x1f')](_0x589874,_0x34bd('0x4a')),'role':_0x34bd('0x50')},'raw':!![]});})['then'](function(_0x4d22ff){for(var _0x33e8e8=0x0;_0x33e8e8<_0x4d22ff['length'];_0x33e8e8++){var _0x1f3db3={'id':_0x4d22ff[_0x33e8e8]['id'],'name':_0x4d22ff[_0x33e8e8][_0x34bd('0xc')],'online':Boolean(_0x4d22ff[_0x33e8e8][_0x34bd('0x4b')]),'paused':Boolean(_0x4d22ff[_0x33e8e8][_0x1c652a])};if(_0x1f3db3['online'])_0x5e30c5['loggedInDb']++;if(_0x1f3db3['paused'])_0x5e30c5['paused']++;_0x5e30c5[_0x34bd('0x44')]['push'](_0x1f3db3);}return _0x5e30c5;});}});return Promise[_0x34bd('0x51')](_0x49c3ef);});})['then'](function(_0x24033f){_0xd39d72[_0x34bd('0x46')]=_0x24033f;return _0xd39d72;})[_0x34bd('0x17')](respondWithFilteredResult(_0x3fa6a8,_0x1c12e8))[_0x34bd('0x52')](handleError(_0x3fa6a8,null));};
\ No newline at end of file
index 7597af7..076f659 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(_0x3c874e,_0x551f01){var _0x5a647b=function(_0x70c339){while(--_0x70c339){_0x3c874e['push'](_0x3c874e['shift']());}};_0x5a647b(++_0x551f01);}(_0xe706,0xa3));var _0x6e70=function(_0x3e9942,_0x12e0e6){_0x3e9942=_0x3e9942-0x0;var _0x2f7e3f=_0xe706[_0x3e9942];return _0x2f7e3f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xaa656e,_0x250a02){var _0x2b2d99=function(_0x56d72f){while(--_0x56d72f){_0xaa656e['push'](_0xaa656e['shift']());}};_0x2b2d99(++_0x250a02);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'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 a0509ff..c48c96f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x103f=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0x103f,0x13e));var _0xf103=function(_0xc8aa9b,_0x122b00){_0xc8aa9b=_0xc8aa9b-0x0;var _0x5cd9b2=_0x103f[_0xc8aa9b];return _0x5cd9b2;};'use strict';var Sequelize=require(_0xf103('0x0'));module[_0xf103('0x1')]={'state':{'type':Sequelize[_0xf103('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xf103('0x3')]},'scheduledat':{'type':Sequelize[_0xf103('0x4')]},'uniqueid':{'type':Sequelize[_0xf103('0x3')]},'starttime':{'type':Sequelize[_0xf103('0x4')]},'responsetime':{'type':Sequelize[_0xf103('0x4')]},'ringtime':{'type':Sequelize[_0xf103('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf103('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf103('0x3')]}};
\ No newline at end of file
+var _0xe3da=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x5a74e0,_0x59b890){var _0x21c639=function(_0x3750c7){while(--_0x3750c7){_0x5a74e0['push'](_0x5a74e0['shift']());}};_0x21c639(++_0x59b890);}(_0xe3da,0x1cd));var _0xae3d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe3da[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xae3d('0x0'));module[_0xae3d('0x1')]={'state':{'type':Sequelize[_0xae3d('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xae3d('0x3')]},'scheduledat':{'type':Sequelize[_0xae3d('0x4')]},'uniqueid':{'type':Sequelize[_0xae3d('0x3')]},'starttime':{'type':Sequelize[_0xae3d('0x4')]},'responsetime':{'type':Sequelize[_0xae3d('0x4')]},'ringtime':{'type':Sequelize[_0xae3d('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xae3d('0x3')]},'campaigntype':{'type':Sequelize[_0xae3d('0x3')]},'membername':{'type':Sequelize[_0xae3d('0x3')]}};
\ No newline at end of file
index 9d1c6e2..cd09302 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4229=['report_agent_preview','util','../../config/logger','api','moment','bluebird','path','exports','define','ReportAgentPreview'];(function(_0x17c542,_0x41a04b){var _0x29e2fc=function(_0x5a9ffa){while(--_0x5a9ffa){_0x17c542['push'](_0x17c542['shift']());}};_0x29e2fc(++_0x41a04b);}(_0x4229,0x83));var _0x9422=function(_0x5d6f87,_0x39026d){_0x5d6f87=_0x5d6f87-0x0;var _0x4b9208=_0x4229[_0x5d6f87];return _0x4b9208;};'use strict';var _=require('lodash');var util=require(_0x9422('0x0'));var logger=require(_0x9422('0x1'))(_0x9422('0x2'));var moment=require(_0x9422('0x3'));var BPromise=require(_0x9422('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9422('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0x9422('0x6')]=function(_0x21909f,_0x1af42c){return _0x21909f[_0x9422('0x7')](_0x9422('0x8'),attributes,{'tableName':_0x9422('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d0e=['request-promise','path','rimraf','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','util','../../config/logger','moment','bluebird'];(function(_0xcd639a,_0x54b7e5){var _0x33b6fb=function(_0x106bb1){while(--_0x106bb1){_0xcd639a['push'](_0xcd639a['shift']());}};_0x33b6fb(++_0x54b7e5);}(_0x5d0e,0x1ca));var _0xe5d0=function(_0x39baf5,_0x3baff3){_0x39baf5=_0x39baf5-0x0;var _0x57597e=_0x5d0e[_0x39baf5];return _0x57597e;};'use strict';var _=require('lodash');var util=require(_0xe5d0('0x0'));var logger=require(_0xe5d0('0x1'))('api');var moment=require(_0xe5d0('0x2'));var BPromise=require(_0xe5d0('0x3'));var rp=require(_0xe5d0('0x4'));var fs=require('fs');var path=require(_0xe5d0('0x5'));var rimraf=require(_0xe5d0('0x6'));var config=require('../../config/environment');var attributes=require(_0xe5d0('0x7'));module[_0xe5d0('0x8')]=function(_0x4bac69,_0xeee469){return _0x4bac69['define'](_0xe5d0('0x9'),attributes,{'tableName':_0xe5d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 947632f..a410713 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab76=['ReportAgentPreview','body','options','raw','CreateReportAgentPreview','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xab76,0x96));var _0x6ab7=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xab76[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x6ab7('0x0'));var util=require(_0x6ab7('0x1'));var moment=require(_0x6ab7('0x2'));var BPromise=require(_0x6ab7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ab7('0x4'));var db=require(_0x6ab7('0x5'))['db'];var utils=require(_0x6ab7('0x6'));var logger=require(_0x6ab7('0x7'))(_0x6ab7('0x8'));var config=require('../../config/environment');var jayson=require(_0x6ab7('0x9'));var client=jayson[_0x6ab7('0xa')][_0x6ab7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f6e94,_0x1d0066,_0x36ec19){return new BPromise(function(_0x4df11d,_0x2a057a){return client['request'](_0x1f6e94,_0x36ec19)[_0x6ab7('0xc')](function(_0x4c5850){logger[_0x6ab7('0xd')](_0x6ab7('0xe'),_0x1d0066,'request\x20sent');logger[_0x6ab7('0xf')](_0x6ab7('0x10'),_0x1d0066,_0x6ab7('0x11'),JSON[_0x6ab7('0x12')](_0x4c5850));if(_0x4c5850['error']){if(_0x4c5850[_0x6ab7('0x13')][_0x6ab7('0x14')]===0x1f4){logger['error'](_0x6ab7('0xe'),_0x1d0066,_0x4c5850['error'][_0x6ab7('0x15')]);return _0x2a057a(_0x4c5850[_0x6ab7('0x13')][_0x6ab7('0x15')]);}logger['error'](_0x6ab7('0xe'),_0x1d0066,_0x4c5850[_0x6ab7('0x13')][_0x6ab7('0x15')]);return _0x4df11d(_0x4c5850[_0x6ab7('0x13')][_0x6ab7('0x15')]);}else{logger['info'](_0x6ab7('0xe'),_0x1d0066,_0x6ab7('0x11'));_0x4df11d(_0x4c5850[_0x6ab7('0x16')][_0x6ab7('0x15')]);}})[_0x6ab7('0x17')](function(_0x16a18a){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x1d0066,_0x16a18a);_0x2a057a(_0x16a18a);});});}exports['CreateReportAgentPreview']=function(_0x21b616){var _0x3830e6=this;return new Promise(function(_0x240d68,_0x13111a){return db[_0x6ab7('0x18')]['create'](_0x21b616[_0x6ab7('0x19')],{'raw':_0x21b616[_0x6ab7('0x1a')]?_0x21b616[_0x6ab7('0x1a')][_0x6ab7('0x1b')]===undefined?!![]:![]:!![]})[_0x6ab7('0xc')](function(_0x1ed7e5){logger[_0x6ab7('0xd')](_0x6ab7('0x1c'),_0x21b616);logger['debug']('CreateReportAgentPreview',_0x21b616,JSON[_0x6ab7('0x12')](_0x1ed7e5));_0x240d68(_0x1ed7e5);})[_0x6ab7('0x17')](function(_0x21ff3c){logger[_0x6ab7('0x13')](_0x6ab7('0x1c'),_0x21ff3c['message'],_0x21b616);_0x13111a(_0x3830e6[_0x6ab7('0x13')](0x1f4,_0x21ff3c['message']));});});};
\ No newline at end of file
+var _0xd2e5=['error','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0xd2e5,0x1cc));var _0x5d2e=function(_0x1d3019,_0x8dbbd5){_0x1d3019=_0x1d3019-0x0;var _0x36458e=_0xd2e5[_0x1d3019];return _0x36458e;};'use strict';var _=require('lodash');var util=require(_0x5d2e('0x0'));var moment=require(_0x5d2e('0x1'));var BPromise=require(_0x5d2e('0x2'));var rs=require(_0x5d2e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d2e('0x4'))['db'];var utils=require(_0x5d2e('0x5'));var logger=require(_0x5d2e('0x6'))(_0x5d2e('0x7'));var config=require(_0x5d2e('0x8'));var jayson=require(_0x5d2e('0x9'));var client=jayson[_0x5d2e('0xa')][_0x5d2e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d5266,_0x12b0f1,_0x28ff68){return new BPromise(function(_0x36b3f3,_0x151962){return client[_0x5d2e('0xc')](_0x3d5266,_0x28ff68)[_0x5d2e('0xd')](function(_0x19e70b){logger[_0x5d2e('0xe')](_0x5d2e('0xf'),_0x12b0f1,_0x5d2e('0x10'));logger[_0x5d2e('0x11')](_0x5d2e('0x12'),_0x12b0f1,'request\x20sent',JSON[_0x5d2e('0x13')](_0x19e70b));if(_0x19e70b[_0x5d2e('0x14')]){if(_0x19e70b[_0x5d2e('0x14')]['code']===0x1f4){logger[_0x5d2e('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0x12b0f1,_0x19e70b[_0x5d2e('0x14')]['message']);return _0x151962(_0x19e70b[_0x5d2e('0x14')]['message']);}logger[_0x5d2e('0x14')](_0x5d2e('0xf'),_0x12b0f1,_0x19e70b[_0x5d2e('0x14')][_0x5d2e('0x15')]);return _0x36b3f3(_0x19e70b[_0x5d2e('0x14')][_0x5d2e('0x15')]);}else{logger[_0x5d2e('0xe')](_0x5d2e('0xf'),_0x12b0f1,_0x5d2e('0x10'));_0x36b3f3(_0x19e70b[_0x5d2e('0x16')][_0x5d2e('0x15')]);}})[_0x5d2e('0x17')](function(_0x3a48ab){logger[_0x5d2e('0x14')](_0x5d2e('0xf'),_0x12b0f1,_0x3a48ab);_0x151962(_0x3a48ab);});});}exports[_0x5d2e('0x18')]=function(_0x25a796){var _0x142e23=this;return new Promise(function(_0xab4333,_0x10ee40){return db[_0x5d2e('0x19')][_0x5d2e('0x1a')](_0x25a796[_0x5d2e('0x1b')],{'raw':_0x25a796[_0x5d2e('0x1c')]?_0x25a796[_0x5d2e('0x1c')][_0x5d2e('0x1d')]===undefined?!![]:![]:!![]})[_0x5d2e('0xd')](function(_0x393d93){logger[_0x5d2e('0xe')](_0x5d2e('0x18'),_0x25a796);logger[_0x5d2e('0x11')]('CreateReportAgentPreview',_0x25a796,JSON[_0x5d2e('0x13')](_0x393d93));_0xab4333(_0x393d93);})[_0x5d2e('0x17')](function(_0x40f223){logger[_0x5d2e('0x14')](_0x5d2e('0x18'),_0x40f223['message'],_0x25a796);_0x10ee40(_0x142e23[_0x5d2e('0x14')](0x1f4,_0x40f223['message']));});});};
\ No newline at end of file
index 11649b6..e27b584 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b72=['/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','agentNotify','exports','util','path','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','outboundChannels','agents','/agents/:id/capacity','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions'];(function(_0x1b5480,_0x3f117a){var _0x244c85=function(_0x3883b4){while(--_0x3883b4){_0x1b5480['push'](_0x1b5480['shift']());}};_0x244c85(++_0x3f117a);}(_0x1b72,0x67));var _0x21b7=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x1b72[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require('multer');var util=require(_0x21b7('0x0'));var path=require(_0x21b7('0x1'));var express=require('express');var router=express[_0x21b7('0x2')]();var auth=require(_0x21b7('0x3'));var controller=require('./rpc.controller');router[_0x21b7('0x4')](_0x21b7('0x5'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x7')]);router['get'](_0x21b7('0x8'),auth['isAuthenticated'](),controller[_0x21b7('0x9')]);router[_0x21b7('0x4')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x21b7('0x6')](),controller[_0x21b7('0xa')]);router['get'](_0x21b7('0xb'),auth['isAuthenticated'](),controller[_0x21b7('0xc')]);router['get'](_0x21b7('0xd'),auth[_0x21b7('0x6')](),controller[_0x21b7('0xe')]);router['get']('/mail/queues',auth['isAuthenticated'](),controller[_0x21b7('0xf')]);router[_0x21b7('0x4')](_0x21b7('0x10'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x11')]);router[_0x21b7('0x4')]('/openchannel/queues',auth[_0x21b7('0x6')](),controller[_0x21b7('0x12')]);router[_0x21b7('0x4')]('/sms/queues',auth[_0x21b7('0x6')](),controller['smsQueues']);router[_0x21b7('0x4')]('/whatsapp/queues',auth[_0x21b7('0x6')](),controller[_0x21b7('0x13')]);router[_0x21b7('0x4')](_0x21b7('0x14'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x15')]);router[_0x21b7('0x4')]('/voice/queues/preview/:id',auth[_0x21b7('0x6')](),controller['voiceQueuesPreview']);router[_0x21b7('0x4')](_0x21b7('0x16'),auth['isAuthenticated'](),controller[_0x21b7('0x17')]);router[_0x21b7('0x4')](_0x21b7('0x18'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x21b7('0x4')](_0x21b7('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x21b7('0x4')](_0x21b7('0x1a'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x1b')]);router[_0x21b7('0x4')](_0x21b7('0x1c'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x1d')]);router['put'](_0x21b7('0x1c'),auth[_0x21b7('0x6')](),controller['updateVoiceQueue']);router[_0x21b7('0x4')](_0x21b7('0x1e'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x1f')]);router[_0x21b7('0x4')]('/outbound/channels',auth[_0x21b7('0x6')](),controller[_0x21b7('0x20')]);router[_0x21b7('0x4')]('/agents',auth[_0x21b7('0x6')](),controller[_0x21b7('0x21')]);router['put'](_0x21b7('0x22'),auth[_0x21b7('0x6')](),controller['agentCapacity']);router[_0x21b7('0x4')]('/telephones',auth[_0x21b7('0x6')](),controller['telephones']);router[_0x21b7('0x4')](_0x21b7('0x23'),auth['isAuthenticated'](),controller[_0x21b7('0x24')]);router[_0x21b7('0x4')](_0x21b7('0x25'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x26')]);router[_0x21b7('0x4')](_0x21b7('0x27'),auth[_0x21b7('0x6')](),controller['faxAccounts']);router[_0x21b7('0x4')](_0x21b7('0x28'),auth[_0x21b7('0x6')](),controller['chatQueuesWaitingInteractions']);router[_0x21b7('0x4')](_0x21b7('0x29'),auth[_0x21b7('0x6')](),controller['mailQueuesWaitingInteractions']);router[_0x21b7('0x4')](_0x21b7('0x2a'),auth['isAuthenticated'](),controller[_0x21b7('0x2b')]);router[_0x21b7('0x4')]('/openchannel/queues/:id/waitinginteractions',auth[_0x21b7('0x6')](),controller[_0x21b7('0x2c')]);router[_0x21b7('0x4')](_0x21b7('0x2d'),auth['isAuthenticated'](),controller[_0x21b7('0x2e')]);router[_0x21b7('0x4')](_0x21b7('0x2f'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x30')]);router[_0x21b7('0x4')](_0x21b7('0x31'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x32')]);router[_0x21b7('0x33')]('/mail/queues/:id/notify',auth[_0x21b7('0x6')](),controller[_0x21b7('0x34')](_0x21b7('0x35')));router[_0x21b7('0x4')](_0x21b7('0x36'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x37')]);router['post']('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x21b7('0x34')](_0x21b7('0x38')));router[_0x21b7('0x4')]('/chat/queues/:id',auth['isAuthenticated'](),controller[_0x21b7('0x39')]);router[_0x21b7('0x33')](_0x21b7('0x3a'),auth['isAuthenticated'](),controller[_0x21b7('0x34')](_0x21b7('0x3b')));router['get'](_0x21b7('0x3c'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x3d')]);router['post'](_0x21b7('0x3e'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x34')](_0x21b7('0x3f')));router[_0x21b7('0x4')](_0x21b7('0x40'),auth[_0x21b7('0x6')](),controller['showOpenchannelQueues']);router['post'](_0x21b7('0x41'),auth['isAuthenticated'](),controller['queueNotify'](_0x21b7('0x42')));router['post'](_0x21b7('0x43'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x34')](_0x21b7('0x44')));router[_0x21b7('0x4')](_0x21b7('0x45'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x46')]);router['get']('/whatsapp/queues/:id',auth[_0x21b7('0x6')](),controller[_0x21b7('0x47')]);router[_0x21b7('0x33')]('/agents/:id/notify',auth[_0x21b7('0x6')](),controller[_0x21b7('0x48')]);module[_0x21b7('0x49')]=router;
\ No newline at end of file
+var _0x2d33=['openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','exports','multer','path','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','/outbound','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions'];(function(_0x539415,_0x2661ec){var _0x20e5cd=function(_0x2cb4da){while(--_0x2cb4da){_0x539415['push'](_0x539415['shift']());}};_0x20e5cd(++_0x2661ec);}(_0x2d33,0x6e));var _0x32d3=function(_0x1ebe2e,_0x18b57a){_0x1ebe2e=_0x1ebe2e-0x0;var _0x4c883b=_0x2d33[_0x1ebe2e];return _0x4c883b;};'use strict';var multer=require(_0x32d3('0x0'));var util=require('util');var path=require(_0x32d3('0x1'));var express=require(_0x32d3('0x2'));var router=express[_0x32d3('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x32d3('0x4'));router[_0x32d3('0x5')](_0x32d3('0x6'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x8')]);router[_0x32d3('0x5')](_0x32d3('0x9'),auth[_0x32d3('0x7')](),controller[_0x32d3('0xa')]);router[_0x32d3('0x5')](_0x32d3('0xb'),auth[_0x32d3('0x7')](),controller[_0x32d3('0xc')]);router['get']('/voice/queues',auth[_0x32d3('0x7')](),controller[_0x32d3('0xd')]);router[_0x32d3('0x5')](_0x32d3('0xe'),auth[_0x32d3('0x7')](),controller[_0x32d3('0xf')]);router[_0x32d3('0x5')]('/mail/queues',auth[_0x32d3('0x7')](),controller[_0x32d3('0x10')]);router[_0x32d3('0x5')](_0x32d3('0x11'),auth['isAuthenticated'](),controller[_0x32d3('0x12')]);router[_0x32d3('0x5')](_0x32d3('0x13'),auth['isAuthenticated'](),controller['openchannelQueues']);router['get'](_0x32d3('0x14'),auth['isAuthenticated'](),controller['smsQueues']);router['get'](_0x32d3('0x15'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x16')]);router[_0x32d3('0x5')](_0x32d3('0x17'),auth[_0x32d3('0x7')](),controller['faxQueues']);router['get'](_0x32d3('0x18'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x19')]);router['get'](_0x32d3('0x1a'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x1b')]);router[_0x32d3('0x5')]('/voice/queues/channels/:uniqueid',auth[_0x32d3('0x7')](),controller[_0x32d3('0x1c')]);router[_0x32d3('0x5')](_0x32d3('0x1d'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x1e')]);router[_0x32d3('0x5')](_0x32d3('0x1f'),auth['isAuthenticated'](),controller[_0x32d3('0x20')]);router['get'](_0x32d3('0x21'),auth[_0x32d3('0x7')](),controller['showVoiceQueues']);router['put'](_0x32d3('0x21'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x22')]);router[_0x32d3('0x5')](_0x32d3('0x23'),auth[_0x32d3('0x7')](),controller['outbound']);router['get']('/outbound/channels',auth[_0x32d3('0x7')](),controller[_0x32d3('0x24')]);router[_0x32d3('0x5')](_0x32d3('0x25'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x26')]);router[_0x32d3('0x27')](_0x32d3('0x28'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x29')]);router[_0x32d3('0x5')](_0x32d3('0x2a'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x2b')]);router[_0x32d3('0x5')](_0x32d3('0x2c'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x2d')]);router[_0x32d3('0x5')]('/campaigns',auth[_0x32d3('0x7')](),controller[_0x32d3('0x2e')]);router['get'](_0x32d3('0x2f'),auth['isAuthenticated'](),controller[_0x32d3('0x30')]);router[_0x32d3('0x5')](_0x32d3('0x31'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x32d3('0x5')](_0x32d3('0x32'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x33')]);router[_0x32d3('0x5')]('/openchannel/queues/waitinginteractions',auth[_0x32d3('0x7')](),controller[_0x32d3('0x34')]);router['get'](_0x32d3('0x35'),auth['isAuthenticated'](),controller[_0x32d3('0x36')]);router[_0x32d3('0x5')](_0x32d3('0x37'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x38')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x32d3('0x7')](),controller['whatsappQueuesWaitingInteractions']);router[_0x32d3('0x5')](_0x32d3('0x39'),auth['isAuthenticated'](),controller[_0x32d3('0x3a')]);router['post'](_0x32d3('0x3b'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x3c')](_0x32d3('0x3d')));router['get'](_0x32d3('0x3e'),auth['isAuthenticated'](),controller[_0x32d3('0x3f')]);router[_0x32d3('0x40')](_0x32d3('0x41'),auth['isAuthenticated'](),controller['queueNotify'](_0x32d3('0x42')));router[_0x32d3('0x5')](_0x32d3('0x43'),auth['isAuthenticated'](),controller[_0x32d3('0x44')]);router[_0x32d3('0x40')](_0x32d3('0x45'),auth['isAuthenticated'](),controller[_0x32d3('0x3c')](_0x32d3('0x46')));router[_0x32d3('0x5')](_0x32d3('0x47'),auth['isAuthenticated'](),controller[_0x32d3('0x48')]);router[_0x32d3('0x40')](_0x32d3('0x49'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x3c')](_0x32d3('0x4a')));router['get']('/openchannel/queues/:id',auth[_0x32d3('0x7')](),controller[_0x32d3('0x4b')]);router[_0x32d3('0x40')]('/sms/queues/:id/notify',auth[_0x32d3('0x7')](),controller[_0x32d3('0x3c')]('sms'));router['post']('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller[_0x32d3('0x3c')](_0x32d3('0x4c')));router[_0x32d3('0x5')](_0x32d3('0x4d'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x4e')]);router[_0x32d3('0x5')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0x32d3('0x4f')]);router[_0x32d3('0x40')](_0x32d3('0x50'),auth[_0x32d3('0x7')](),controller['agentNotify']);module[_0x32d3('0x51')]=router;
\ No newline at end of file
index 27eb08a..8e8a466 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','chat','User','\x20Message\x20not\x20found','Start','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','status','json','sendStatus','name','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','format','length','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions'];(function(_0x18b9d9,_0x461b5a){var _0x4d844c=function(_0x126b0a){while(--_0x126b0a){_0x18b9d9['push'](_0x18b9d9['shift']());}};_0x4d844c(++_0x461b5a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x5fc3[_0x5756c6];return _0x4b5806;};'use strict';var BPromise=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));var _=require('lodash');var util=require(_0x35fc('0x2'));var db=require(_0x35fc('0x3'))['db'];var logger=require(_0x35fc('0x4'))(_0x35fc('0x5'));var jayson=require(_0x35fc('0x6'));var amiClient=jayson['client'][_0x35fc('0x7')]({'port':0x232a});var mailClient=jayson[_0x35fc('0x8')][_0x35fc('0x7')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){var _0x1e5f90=_0x16e153?_0x16e153:amiClient;return _0x1e5f90[_0x35fc('0x9')](_0x19a0d1,_0x508b32)[_0x35fc('0xa')](function(_0x2051ab){if(_0x2051ab['error']){if(_0x2051ab[_0x35fc('0xb')][_0x35fc('0xc')]===0x1f4){return _0xc72d93(_0x2051ab['error'][_0x35fc('0xd')]);}return _0x27524f(_0x2051ab[_0x35fc('0xb')]['message']);}else{_0x27524f(_0x2051ab[_0x35fc('0xe')]);}})[_0x35fc('0xf')](function(_0x5469f5){_0xc72d93(_0x5469f5);});});}function respondWithResult(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xc8;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x10')](_0x409357)[_0x35fc('0x11')](_0x5d462a);}return _0x4cbe74[_0x35fc('0x12')](0x194);};}function handleError(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0x1f4;return function(_0x5cfe94){logger['error'](_0x5cfe94['stack']);if(_0x5cfe94['name']){delete _0x5cfe94[_0x35fc('0x13')];}_0x29730f[_0x35fc('0x10')](_0x38d9f2)[_0x35fc('0x14')](_0x5cfe94);};}function findById(_0x154958){return function(_0x227a49){if(!_[_0x35fc('0x15')](_0x154958)&&!_['isNil'](_0x227a49)&&!_[_0x35fc('0x15')](_0x227a49[_0x35fc('0x16')])){return _['find'](_0x227a49[_0x35fc('0x16')],function(_0x363e47){return _0x363e47['id']==_0x154958;});}return null;};}exports[_0x35fc('0x17')]=function(_0x5f56c6,_0x1a86e9){return respondWithRpcPromise(_0x35fc('0x18'),_0x5f56c6[_0x35fc('0x19')])['then'](respondWithResult(_0x1a86e9,null))[_0x35fc('0xf')](handleError(_0x1a86e9,null));};exports[_0x35fc('0x1a')]=function(_0x3229d1,_0x251a1f){return respondWithRpcPromise(_0x35fc('0x1b'),_[_0x35fc('0x1c')](_0x3229d1[_0x35fc('0x19')],_0x3229d1[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x251a1f,null))[_0x35fc('0xf')](handleError(_0x251a1f,null));};exports['voiceChannelStopMixMonitor']=function(_0x323aee,_0xd5399f){return respondWithRpcPromise(_0x35fc('0x1e'),_[_0x35fc('0x1c')](_0x323aee[_0x35fc('0x19')],_0x323aee['params']))[_0x35fc('0xa')](respondWithResult(_0xd5399f,null))[_0x35fc('0xf')](handleError(_0xd5399f,null));};exports['voiceQueues']=function(_0x265324,_0x5a93df){return respondWithRpcPromise(_0x35fc('0x1f'),_0x265324['query'])[_0x35fc('0xa')](respondWithResult(_0x5a93df,null))['catch'](handleError(_0x5a93df,null));};exports[_0x35fc('0x20')]=function(_0xdfab9f,_0x5cb986){return respondWithRpcPromise('VoiceQueues',_0xdfab9f[_0x35fc('0x19')])['then'](findById(_0xdfab9f[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x5cb986,null))['catch'](handleError(_0x5cb986,null));};exports[_0x35fc('0x21')]=function(_0x645eac,_0x383837){return respondWithRpcPromise(_0x35fc('0x22'),_[_0x35fc('0x1c')](_0x645eac[_0x35fc('0x23')],_0x645eac[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x383837,null))['catch'](handleError(_0x383837,null));};exports[_0x35fc('0x24')]=function(_0x220931,_0x22af18){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x35fc('0x1c')](_0x220931[_0x35fc('0x19')],_0x220931[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x22af18,null))[_0x35fc('0xf')](handleError(_0x22af18,null));};exports[_0x35fc('0x25')]=function(_0x222ddb,_0x37b435){return respondWithRpcPromise(_0x35fc('0x26'),_0x222ddb[_0x35fc('0x19')])['then'](respondWithResult(_0x37b435,null))['catch'](handleError(_0x37b435,null));};exports[_0x35fc('0x27')]=function(_0x4af5fe,_0x37b394){return respondWithRpcPromise(_0x35fc('0x28'),_[_0x35fc('0x1c')](_0x4af5fe[_0x35fc('0x19')],_0x4af5fe[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x37b394,null))['catch'](handleError(_0x37b394,null));};exports[_0x35fc('0x29')]=function(_0x330a14,_0x46b9ef){return respondWithRpcPromise(_0x35fc('0x2a'),_[_0x35fc('0x1c')](_0x330a14[_0x35fc('0x19')],_0x330a14['params']))[_0x35fc('0xa')](respondWithResult(_0x46b9ef,null))[_0x35fc('0xf')](handleError(_0x46b9ef,null));};exports[_0x35fc('0x2b')]=function(_0x52f53d,_0x2c657d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x35fc('0x1c')](_0x52f53d[_0x35fc('0x19')],_0x52f53d[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x2c657d,null))['catch'](handleError(_0x2c657d,null));};exports['outbound']=function(_0x59e4fb,_0x20f5fe){return respondWithRpcPromise('Outbound',_0x59e4fb[_0x35fc('0x19')])['then'](respondWithResult(_0x20f5fe,null))[_0x35fc('0xf')](handleError(_0x20f5fe,null));};exports[_0x35fc('0x2c')]=function(_0x2ca9ac,_0x22b724){return respondWithRpcPromise(_0x35fc('0x2d'),_0x2ca9ac[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x22b724,null))['catch'](handleError(_0x22b724,null));};exports[_0x35fc('0x2e')]=function(_0x16087d,_0x4e0ce3){var _0x1feda5;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d[_0x35fc('0x19')])[_0x35fc('0xa')](function(_0x813866){_0x1feda5=_0x813866;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d['query'],routingClient);})[_0x35fc('0xa')](function(_0x267858){return _[_0x35fc('0x1c')]({},_0x267858,_0x1feda5);})['then'](respondWithResult(_0x4e0ce3,null))[_0x35fc('0xf')](handleError(_0x4e0ce3,null));};exports[_0x35fc('0x30')]=function(_0x596919,_0x237548){if(_0x596919[_0x35fc('0x23')]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]&&_0x596919[_0x35fc('0x32')]&&_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]){for(var _0x3ec51f in _0x596919['body']['interaction']){if(_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]['hasOwnProperty'](_0x3ec51f)){db['MemberReport']['findAll']({'where':{'channel':_0x3ec51f,'membername':_0x596919[_0x35fc('0x32')][_0x35fc('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length']?{'$notIn':_0x596919['body']['interaction'][_0x3ec51f]}:{'$ne':null}}})['then'](function(_0x56bdb9){var _0xb26e3f=moment()[_0x35fc('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x119925=0x0,_0x56cf1f=_0x56bdb9[_0x35fc('0x34')];_0x119925<_0x56cf1f;_0x119925+=0x1){_0x56bdb9[_0x119925][_0x35fc('0x35')]({'exitAt':_0xb26e3f});}});for(var _0x350237=0x0;_0x350237<_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length'];_0x350237+=0x1){db[_0x35fc('0x36')][_0x35fc('0x37')]({'where':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'type':_0x35fc('0x38'),'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237],'exitAt':null},'defaults':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'interface':_['isNil'](_0x596919['user'][_0x35fc('0x39')])?util[_0x35fc('0x33')](_0x35fc('0x3a'),_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]):_0x596919[_0x35fc('0x32')][_0x35fc('0x39')],'type':_0x35fc('0x38'),'enterAt':moment()['format'](_0x35fc('0x3b')),'role':_0x35fc('0x3c'),'internal':_0x596919[_0x35fc('0x32')][_0x35fc('0x3d')],'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237]}});}}}}return respondWithRpcPromise(_0x35fc('0x3e'),{'id':_0x596919[_0x35fc('0x1d')]['id'],'capacity':_0x596919[_0x35fc('0x23')][_0x35fc('0x3f')]},routingClient)[_0x35fc('0xa')](respondWithResult(_0x237548,null))[_0x35fc('0xf')](handleError(_0x237548,null));};exports[_0x35fc('0x40')]=function(_0x3146e2,_0x59c666){return respondWithRpcPromise('Telephones',_0x3146e2[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x59c666,null))[_0x35fc('0xf')](handleError(_0x59c666,null));};exports[_0x35fc('0x41')]=function(_0x3ee296,_0x3e6494){return respondWithRpcPromise('Trunks',_0x3ee296['query'])[_0x35fc('0xa')](respondWithResult(_0x3e6494,null))[_0x35fc('0xf')](handleError(_0x3e6494,null));};exports[_0x35fc('0x42')]=function(_0x38bc78,_0x5b2595){return respondWithRpcPromise(_0x35fc('0x43'),_0x38bc78[_0x35fc('0x19')])['then'](respondWithResult(_0x5b2595,null))[_0x35fc('0xf')](handleError(_0x5b2595,null));};exports[_0x35fc('0x44')]=function(_0x590faa,_0x3e12e4){return respondWithRpcPromise(_0x35fc('0x45'),_0x590faa[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x3e12e4,null))['catch'](handleError(_0x3e12e4,null));};exports['showChatQueues']=function(_0x502a15,_0x240338){return respondWithRpcPromise(_0x35fc('0x45'),_0x502a15['query'],routingClient)[_0x35fc('0xa')](findById(_0x502a15[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x240338,null))[_0x35fc('0xf')](handleError(_0x240338,null));};exports[_0x35fc('0x46')]=function(_0x538be0,_0x2d9d45){return respondWithRpcPromise(_0x35fc('0x47'),_0x538be0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x2d9d45,null))[_0x35fc('0xf')](handleError(_0x2d9d45,null));};exports[_0x35fc('0x48')]=function(_0x47fb1a,_0x35a676){return respondWithRpcPromise(_0x35fc('0x47'),_0x47fb1a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x47fb1a[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x35a676,null))[_0x35fc('0xf')](handleError(_0x35a676,null));};exports[_0x35fc('0x49')]=function(_0x53a79d,_0x10a5b8){return respondWithRpcPromise(_0x35fc('0x4a'),_0x53a79d[_0x35fc('0x19')],mailClient)['then'](respondWithResult(_0x10a5b8,null))[_0x35fc('0xf')](handleError(_0x10a5b8,null));};exports['openchannelQueues']=function(_0x4ceacc,_0x5d4a39){return respondWithRpcPromise(_0x35fc('0x4b'),_0x4ceacc[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x5d4a39,null))[_0x35fc('0xf')](handleError(_0x5d4a39,null));};exports[_0x35fc('0x4c')]=function(_0x4bbea0,_0x579f5a){return respondWithRpcPromise('OpenchannelQueues',_0x4bbea0['query'],routingClient)['then'](findById(_0x4bbea0[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x579f5a,null))[_0x35fc('0xf')](handleError(_0x579f5a,null));};exports[_0x35fc('0x4d')]=function(_0x511e8b,_0x458eb8){return respondWithRpcPromise(_0x35fc('0x4e'),_0x511e8b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x458eb8,null))[_0x35fc('0xf')](handleError(_0x458eb8,null));};exports[_0x35fc('0x4f')]=function(_0x27071b,_0x2127e0){return respondWithRpcPromise(_0x35fc('0x4e'),_0x27071b['query'],routingClient)[_0x35fc('0xa')](findById(_0x27071b['params']['id']))[_0x35fc('0xa')](respondWithResult(_0x2127e0,null))[_0x35fc('0xf')](handleError(_0x2127e0,null));};exports[_0x35fc('0x50')]=function(_0x2bc76c,_0x4bdde7){return respondWithRpcPromise(_0x35fc('0x51'),_0x2bc76c['query'],routingClient)['then'](respondWithResult(_0x4bdde7,null))['catch'](handleError(_0x4bdde7,null));};exports[_0x35fc('0x52')]=function(_0x5dfeb7,_0x3c9027){return respondWithRpcPromise('WhatsappQueues',_0x5dfeb7[_0x35fc('0x19')],routingClient)['then'](findById(_0x5dfeb7[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x3c9027,null))[_0x35fc('0xf')](handleError(_0x3c9027,null));};exports[_0x35fc('0x53')]=function(_0x5c2ec0,_0x3d0ecc){return respondWithRpcPromise(_0x35fc('0x54'),_0x5c2ec0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x3d0ecc,null))[_0x35fc('0xf')](handleError(_0x3d0ecc,null));};exports[_0x35fc('0x55')]=function(_0x37764b,_0x3c1b56){return respondWithRpcPromise(_0x35fc('0x54'),_0x37764b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x37764b[_0x35fc('0x1d')]['id']))['then'](respondWithResult(_0x3c1b56,null))[_0x35fc('0xf')](handleError(_0x3c1b56,null));};exports[_0x35fc('0x56')]=function(_0x2600d2,_0x4a926d){return respondWithRpcPromise(_0x35fc('0x57'),_0x2600d2[_0x35fc('0x19')])['then'](respondWithResult(_0x4a926d,null))['catch'](handleError(_0x4a926d,null));};exports[_0x35fc('0x58')]=function(_0x4835c2,_0x223ad3){return respondWithRpcPromise(_0x35fc('0x59'),_0x4835c2[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x223ad3,null))[_0x35fc('0xf')](handleError(_0x223ad3,null));};exports[_0x35fc('0x5a')]=function(_0x13f602,_0x104b1d){return respondWithRpcPromise(_0x35fc('0x5b'),_0x13f602[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x104b1d,null))[_0x35fc('0xf')](handleError(_0x104b1d,null));};exports[_0x35fc('0x5c')]=function(_0x9f034e,_0x184f28){return respondWithRpcPromise(_0x35fc('0x5d'),_0x9f034e[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x184f28,null))[_0x35fc('0xf')](handleError(_0x184f28,null));};exports[_0x35fc('0x5e')]=function(_0x4ba1b0,_0x1797d0){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4ba1b0[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](function(_0x2185ce){if(_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')]!==undefined){var _0x3f56f4=_(_0x2185ce[_0x35fc('0x16')])[_0x35fc('0x60')]([_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')],_0x4ba1b0[_0x35fc('0x1d')]['id']])['map'](_0x35fc('0x61'))[_0x35fc('0x62')]()[_0x35fc('0x63')]();return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x41a6de){return _0x3f56f4['indexOf'](_0x41a6de[_0x35fc('0x61')])>-0x1;});}else{return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x23206d){return _0x23206d[_0x35fc('0x61')]===parseInt(_0x4ba1b0[_0x35fc('0x1d')]['id']);});}})[_0x35fc('0xa')](respondWithResult(_0x1797d0,null))[_0x35fc('0xf')](handleError(_0x1797d0,null));};exports[_0x35fc('0x64')]=function(_0x5f23d8,_0x28f02b){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x5f23d8[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x28f02b,null))['catch'](handleError(_0x28f02b,null));};exports[_0x35fc('0x65')]=function(_0x41002a,_0xcaa49){return respondWithRpcPromise(_0x35fc('0x66'),_0x41002a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0xcaa49,null))[_0x35fc('0xf')](handleError(_0xcaa49,null));};exports[_0x35fc('0x67')]=function(_0x25ee61,_0x5806bf){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x25ee61['query'],routingClient)['then'](respondWithResult(_0x5806bf,null))[_0x35fc('0xf')](handleError(_0x5806bf,null));};exports[_0x35fc('0x68')]=function(_0x8fc410){return function(_0x1f5cbc,_0x35ef53){var _0x4f535a,_0x226fdf;var _0x19682e=_[_0x35fc('0x69')](_0x8fc410);var _0x169ea2=_0x8fc410==='chat'?_0x35fc('0x6a'):_0x35fc('0x6b');return db[_0x19682e+_0x35fc('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x1f5cbc[_0x35fc('0x1d')]['id']}})[_0x35fc('0xa')](function(_0x319033){if(_[_0x35fc('0x15')](_0x319033)){throw new Error(_0x19682e+_0x35fc('0x6d'));}_0x4f535a=_0x319033;return db[_0x19682e+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x1f5cbc[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x19682e+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x19682e+_0x169ea2],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x221c5b){if(_[_0x35fc('0x15')](_0x221c5b)){throw new Error(_0x19682e+'\x20Message\x20not\x20found');}_0x226fdf=_0x221c5b;return _0x221c5b[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4855ee={'uniqueid':_0x8fc410+'.'+_0x226fdf['id']+'.'+_0x226fdf[_0x35fc('0x70')]['id'],'FromUserId':_0x1f5cbc['user']['id'],'type':_0x35fc('0x72')};_0x4855ee[_0x19682e+_0x35fc('0x73')]=_0x226fdf['id'];_0x4855ee[_0x19682e+_0x35fc('0x74')]=_0x226fdf['Interaction']['id'];_0x4855ee[_0x35fc('0x75')+_0x19682e+_0x169ea2+'Id']=_0x226fdf[_0x35fc('0x6b')]['id'];_0x4855ee['To'+_0x19682e+_0x35fc('0x76')]=_0x4f535a['id'];return db[_0x19682e+_0x35fc('0x77')][_0x35fc('0x78')](_0x4855ee);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x8fc410,'interaction':_0x226fdf['Interaction'],'message':_0x226fdf,'account':_0x226fdf[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4f535a[_0x35fc('0x13')]+','+(_0x226fdf[_0x35fc('0x6b')][_0x35fc('0x79')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})['then'](respondWithResult(_0x35ef53,null))[_0x35fc('0xf')](handleError(_0x35ef53,null));};};exports[_0x35fc('0x7b')]=function(_0x312827,_0x47c507){var _0x128286,_0x175cc7;if(_[_0x35fc('0x15')](_0x312827['body']['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x32b9e1=_0x312827[_0x35fc('0x23')][_0x35fc('0x7c')];var _0x3858a9=_['capitalize'](_0x32b9e1);var _0x3ead4e=_0x32b9e1===_0x35fc('0x7d')?'Website':'Account';return db[_0x35fc('0x7e')][_0x35fc('0x6f')]({'raw':!![],'where':{'id':_0x312827[_0x35fc('0x1d')]['id'],'role':'agent'}})['then'](function(_0x134e60){if(_[_0x35fc('0x15')](_0x134e60)){throw new Error('Agent\x20not\x20found');}_0x128286=_0x134e60;return db[_0x3858a9+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x312827[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x3858a9+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x3858a9+_0x3ead4e],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x4fd676){if(_[_0x35fc('0x15')](_0x4fd676)){throw new Error(_0x3858a9+_0x35fc('0x7f'));}_0x175cc7=_0x4fd676;return _0x4fd676[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x96dfc={'uniqueid':_0x32b9e1+'.'+_0x175cc7['id']+'.'+_0x175cc7[_0x35fc('0x70')]['id'],'FromUserId':_0x312827[_0x35fc('0x32')]['id'],'type':'queue','ToUserId':_0x128286['id']};_0x96dfc[_0x3858a9+_0x35fc('0x73')]=_0x175cc7['id'];_0x96dfc[_0x3858a9+_0x35fc('0x74')]=_0x175cc7['Interaction']['id'];_0x96dfc[_0x35fc('0x75')+_0x3858a9+_0x3ead4e+'Id']=_0x175cc7[_0x35fc('0x6b')]['id'];return db[_0x3858a9+_0x35fc('0x77')][_0x35fc('0x78')](_0x96dfc);})[_0x35fc('0xa')](function(){return respondWithRpcPromise(_0x35fc('0x80'),{'channel':_0x32b9e1,'interaction':_0x175cc7[_0x35fc('0x70')],'message':_0x175cc7,'account':_0x175cc7[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x35fc('0x3c'),'appdata':_0x128286['name']+','+(_0x175cc7[_0x35fc('0x6b')][_0x35fc('0x81')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})[_0x35fc('0xa')](respondWithResult(_0x47c507,null))['catch'](handleError(_0x47c507,null));};
\ No newline at end of file
+var _0x7da7=['value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','isNil','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','From','QueueId','TransferReport','create','Start','Account','queue','agentNotify','channel','User','Agent\x20not\x20found','InteractionId','bluebird','moment','lodash','../../config/logger','api','client','http','request','error','message','catch','status','json','name','send','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','VoiceChannelStopMixMonitor','params','then','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agentCapacity','interaction','user','hasOwnProperty','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','SIP/%s','INTERACTION','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','showWhatsappQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq'];(function(_0x460fd7,_0x2012db){var _0x44d1c2=function(_0x545e11){while(--_0x545e11){_0x460fd7['push'](_0x460fd7['shift']());}};_0x44d1c2(++_0x2012db);}(_0x7da7,0x10d));var _0x77da=function(_0x2ff4bd,_0x4780a6){_0x2ff4bd=_0x2ff4bd-0x0;var _0x28edc6=_0x7da7[_0x2ff4bd];return _0x28edc6;};'use strict';var BPromise=require(_0x77da('0x0'));var moment=require(_0x77da('0x1'));var _=require(_0x77da('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x77da('0x3'))(_0x77da('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x77da('0x5')][_0x77da('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x77da('0x6')]({'port':0x232b});var routingClient=jayson[_0x77da('0x5')]['http']({'port':0x232c});function respondWithRpcPromise(_0x30afe0,_0x47cf1d,_0x1191de){return new BPromise(function(_0x13992e,_0x37c5ab){var _0x910e5b=_0x1191de?_0x1191de:amiClient;return _0x910e5b[_0x77da('0x7')](_0x30afe0,_0x47cf1d)['then'](function(_0x40c86e){if(_0x40c86e[_0x77da('0x8')]){if(_0x40c86e[_0x77da('0x8')]['code']===0x1f4){return _0x37c5ab(_0x40c86e[_0x77da('0x8')][_0x77da('0x9')]);}return _0x13992e(_0x40c86e[_0x77da('0x8')][_0x77da('0x9')]);}else{_0x13992e(_0x40c86e['result']);}})[_0x77da('0xa')](function(_0x3bcea0){_0x37c5ab(_0x3bcea0);});});}function respondWithResult(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xc8;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0xb')](_0x5d6e2f)[_0x77da('0xc')](_0x4a7748);}return _0x2acc65['sendStatus'](0x194);};}function handleError(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0x1f4;return function(_0x355719){logger[_0x77da('0x8')](_0x355719['stack']);if(_0x355719[_0x77da('0xd')]){delete _0x355719['name'];}_0x3b0ff2[_0x77da('0xb')](_0x369df0)[_0x77da('0xe')](_0x355719);};}function findById(_0x1b0e17){return function(_0x4500c4){if(!_['isNil'](_0x1b0e17)&&!_['isNil'](_0x4500c4)&&!_['isNil'](_0x4500c4['rows'])){return _[_0x77da('0xf')](_0x4500c4[_0x77da('0x10')],function(_0x289887){return _0x289887['id']==_0x1b0e17;});}return null;};}exports[_0x77da('0x11')]=function(_0x19a00c,_0x12d2b1){return respondWithRpcPromise(_0x77da('0x12'),_0x19a00c[_0x77da('0x13')])['then'](respondWithResult(_0x12d2b1,null))['catch'](handleError(_0x12d2b1,null));};exports[_0x77da('0x14')]=function(_0x4d1512,_0x507979){return respondWithRpcPromise(_0x77da('0x15'),_[_0x77da('0x16')](_0x4d1512[_0x77da('0x13')],_0x4d1512['params']))['then'](respondWithResult(_0x507979,null))[_0x77da('0xa')](handleError(_0x507979,null));};exports['voiceChannelStopMixMonitor']=function(_0x175ac4,_0x1c27aa){return respondWithRpcPromise(_0x77da('0x17'),_[_0x77da('0x16')](_0x175ac4[_0x77da('0x13')],_0x175ac4[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x1c27aa,null))['catch'](handleError(_0x1c27aa,null));};exports['voiceQueues']=function(_0xfd160,_0x2d009f){return respondWithRpcPromise(_0x77da('0x1a'),_0xfd160[_0x77da('0x13')])['then'](respondWithResult(_0x2d009f,null))[_0x77da('0xa')](handleError(_0x2d009f,null));};exports[_0x77da('0x1b')]=function(_0x470c9f,_0x36115b){return respondWithRpcPromise(_0x77da('0x1a'),_0x470c9f['query'])[_0x77da('0x19')](findById(_0x470c9f[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x36115b,null))[_0x77da('0xa')](handleError(_0x36115b,null));};exports['updateVoiceQueue']=function(_0x5b4638,_0x4d395a){return respondWithRpcPromise(_0x77da('0x1c'),_[_0x77da('0x16')](_0x5b4638[_0x77da('0x1d')],_0x5b4638[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x4d395a,null))['catch'](handleError(_0x4d395a,null));};exports[_0x77da('0x1e')]=function(_0x26f5a0,_0x356bfb){return respondWithRpcPromise(_0x77da('0x1f'),_[_0x77da('0x16')](_0x26f5a0[_0x77da('0x13')],_0x26f5a0['params']))[_0x77da('0x19')](respondWithResult(_0x356bfb,null))[_0x77da('0xa')](handleError(_0x356bfb,null));};exports[_0x77da('0x20')]=function(_0x38643a,_0x3c3c64){return respondWithRpcPromise(_0x77da('0x21'),_0x38643a[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x3c3c64,null))['catch'](handleError(_0x3c3c64,null));};exports['voiceQueuesChannel']=function(_0x1366b4,_0x8e6181){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x77da('0x16')](_0x1366b4[_0x77da('0x13')],_0x1366b4[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x8e6181,null))[_0x77da('0xa')](handleError(_0x8e6181,null));};exports[_0x77da('0x22')]=function(_0x20d1cc,_0x5c4a03){return respondWithRpcPromise(_0x77da('0x23'),_['merge'](_0x20d1cc['query'],_0x20d1cc['params']))[_0x77da('0x19')](respondWithResult(_0x5c4a03,null))['catch'](handleError(_0x5c4a03,null));};exports[_0x77da('0x24')]=function(_0xdac1a4,_0xce9df2){return respondWithRpcPromise(_0x77da('0x25'),_[_0x77da('0x16')](_0xdac1a4[_0x77da('0x13')],_0xdac1a4[_0x77da('0x18')]))['then'](respondWithResult(_0xce9df2,null))[_0x77da('0xa')](handleError(_0xce9df2,null));};exports[_0x77da('0x26')]=function(_0x1ca53a,_0x32785f){return respondWithRpcPromise(_0x77da('0x27'),_0x1ca53a[_0x77da('0x13')])['then'](respondWithResult(_0x32785f,null))[_0x77da('0xa')](handleError(_0x32785f,null));};exports[_0x77da('0x28')]=function(_0x2cd190,_0x4d04cd){return respondWithRpcPromise(_0x77da('0x29'),_0x2cd190['query'])['then'](respondWithResult(_0x4d04cd,null))['catch'](handleError(_0x4d04cd,null));};exports['agents']=function(_0x19f9f7,_0x1adba5){var _0xebdea1;return respondWithRpcPromise('Agents',_0x19f9f7[_0x77da('0x13')])['then'](function(_0xf79c20){_0xebdea1=_0xf79c20;return respondWithRpcPromise('Agents',_0x19f9f7[_0x77da('0x13')],routingClient);})[_0x77da('0x19')](function(_0x290667){return _[_0x77da('0x16')]({},_0x290667,_0xebdea1);})[_0x77da('0x19')](respondWithResult(_0x1adba5,null))['catch'](handleError(_0x1adba5,null));};exports[_0x77da('0x2a')]=function(_0x1f48bd,_0x44717a){if(_0x1f48bd[_0x77da('0x1d')]&&_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')]&&_0x1f48bd['user']&&_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')]){for(var _0x21de41 in _0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')]){if(_0x1f48bd[_0x77da('0x1d')]['interaction'][_0x77da('0x2d')](_0x21de41)){db['MemberReport'][_0x77da('0x2e')]({'where':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41]&&_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x77da('0x2f')]?{'$notIn':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41]}:{'$ne':null}}})[_0x77da('0x19')](function(_0x1bb77c){var _0x5964da=moment()[_0x77da('0x30')](_0x77da('0x31'));for(var _0x46f289=0x0,_0x287cf0=_0x1bb77c[_0x77da('0x2f')];_0x46f289<_0x287cf0;_0x46f289+=0x1){_0x1bb77c[_0x46f289][_0x77da('0x32')]({'exitAt':_0x5964da});}});for(var _0x558023=0x0;_0x558023<_0x1f48bd['body'][_0x77da('0x2b')][_0x21de41][_0x77da('0x2f')];_0x558023+=0x1){db[_0x77da('0x33')][_0x77da('0x34')]({'where':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'type':'INTERACTION','uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x558023],'exitAt':null},'defaults':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'interface':_['isNil'](_0x1f48bd[_0x77da('0x2c')]['interface'])?util['format'](_0x77da('0x35'),_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')]):_0x1f48bd[_0x77da('0x2c')]['interface'],'type':_0x77da('0x36'),'enterAt':moment()[_0x77da('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x77da('0x37'),'internal':_0x1f48bd[_0x77da('0x2c')]['internal'],'uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x558023]}});}}}}return respondWithRpcPromise(_0x77da('0x38'),{'id':_0x1f48bd[_0x77da('0x18')]['id'],'capacity':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x39')]},routingClient)[_0x77da('0x19')](respondWithResult(_0x44717a,null))[_0x77da('0xa')](handleError(_0x44717a,null));};exports[_0x77da('0x3a')]=function(_0x3a34a8,_0x52aa0a){return respondWithRpcPromise(_0x77da('0x3b'),_0x3a34a8['query'])[_0x77da('0x19')](respondWithResult(_0x52aa0a,null))[_0x77da('0xa')](handleError(_0x52aa0a,null));};exports[_0x77da('0x3c')]=function(_0x2eca67,_0x374179){return respondWithRpcPromise(_0x77da('0x3d'),_0x2eca67[_0x77da('0x13')])['then'](respondWithResult(_0x374179,null))[_0x77da('0xa')](handleError(_0x374179,null));};exports[_0x77da('0x3e')]=function(_0x1a7115,_0x353be9){return respondWithRpcPromise('Campaigns',_0x1a7115[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x353be9,null))[_0x77da('0xa')](handleError(_0x353be9,null));};exports['chatQueues']=function(_0x5a7ba7,_0x332763){return respondWithRpcPromise(_0x77da('0x3f'),_0x5a7ba7[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x332763,null))[_0x77da('0xa')](handleError(_0x332763,null));};exports['showChatQueues']=function(_0x50437b,_0x365e91){return respondWithRpcPromise(_0x77da('0x3f'),_0x50437b['query'],routingClient)[_0x77da('0x19')](findById(_0x50437b[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x365e91,null))['catch'](handleError(_0x365e91,null));};exports[_0x77da('0x40')]=function(_0x111260,_0x5a5309){return respondWithRpcPromise(_0x77da('0x41'),_0x111260[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x5a5309,null))[_0x77da('0xa')](handleError(_0x5a5309,null));};exports[_0x77da('0x42')]=function(_0x99ac27,_0x1dc4ab){return respondWithRpcPromise(_0x77da('0x41'),_0x99ac27[_0x77da('0x13')],routingClient)['then'](findById(_0x99ac27[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x1dc4ab,null))[_0x77da('0xa')](handleError(_0x1dc4ab,null));};exports[_0x77da('0x43')]=function(_0x329c6b,_0x3a0160){return respondWithRpcPromise('MailAccounts',_0x329c6b[_0x77da('0x13')],mailClient)[_0x77da('0x19')](respondWithResult(_0x3a0160,null))[_0x77da('0xa')](handleError(_0x3a0160,null));};exports['openchannelQueues']=function(_0x3e5dd9,_0x2f7cd8){return respondWithRpcPromise(_0x77da('0x44'),_0x3e5dd9[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x2f7cd8,null))[_0x77da('0xa')](handleError(_0x2f7cd8,null));};exports[_0x77da('0x45')]=function(_0x53a9ee,_0x100094){return respondWithRpcPromise('OpenchannelQueues',_0x53a9ee[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x53a9ee[_0x77da('0x18')]['id']))['then'](respondWithResult(_0x100094,null))[_0x77da('0xa')](handleError(_0x100094,null));};exports[_0x77da('0x46')]=function(_0x282481,_0x30ea29){return respondWithRpcPromise('SmsQueues',_0x282481['query'],routingClient)['then'](respondWithResult(_0x30ea29,null))[_0x77da('0xa')](handleError(_0x30ea29,null));};exports[_0x77da('0x47')]=function(_0x2c4d7c,_0x2c7c8e){return respondWithRpcPromise(_0x77da('0x48'),_0x2c4d7c[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x2c4d7c[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x2c7c8e,null))[_0x77da('0xa')](handleError(_0x2c7c8e,null));};exports['whatsappQueues']=function(_0x3028ca,_0x6dd79f){return respondWithRpcPromise('WhatsappQueues',_0x3028ca['query'],routingClient)[_0x77da('0x19')](respondWithResult(_0x6dd79f,null))['catch'](handleError(_0x6dd79f,null));};exports[_0x77da('0x49')]=function(_0x1adab0,_0x1ff554){return respondWithRpcPromise('WhatsappQueues',_0x1adab0[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x1adab0[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x1ff554,null))[_0x77da('0xa')](handleError(_0x1ff554,null));};exports['faxQueues']=function(_0x1f4c49,_0x20a636){return respondWithRpcPromise('FaxQueues',_0x1f4c49[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x20a636,null))[_0x77da('0xa')](handleError(_0x20a636,null));};exports[_0x77da('0x4a')]=function(_0x14496e,_0xdf9393){return respondWithRpcPromise(_0x77da('0x4b'),_0x14496e['query'],routingClient)[_0x77da('0x19')](findById(_0x14496e['params']['id']))[_0x77da('0x19')](respondWithResult(_0xdf9393,null))[_0x77da('0xa')](handleError(_0xdf9393,null));};exports[_0x77da('0x4c')]=function(_0x19b514,_0x470619){return respondWithRpcPromise(_0x77da('0x4d'),_0x19b514[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x470619,null))[_0x77da('0xa')](handleError(_0x470619,null));};exports[_0x77da('0x4e')]=function(_0x3c9ca7,_0x19065e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x3c9ca7[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x19065e,null))[_0x77da('0xa')](handleError(_0x19065e,null));};exports[_0x77da('0x4f')]=function(_0x57b710,_0x293b5c){return respondWithRpcPromise(_0x77da('0x50'),_0x57b710[_0x77da('0x13')],routingClient)['then'](respondWithResult(_0x293b5c,null))[_0x77da('0xa')](handleError(_0x293b5c,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x579314,_0x2a4f85){return respondWithRpcPromise(_0x77da('0x51'),_0x579314[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x2a4f85,null))[_0x77da('0xa')](handleError(_0x2a4f85,null));};exports[_0x77da('0x52')]=function(_0x14dec8,_0xf95d48){return respondWithRpcPromise(_0x77da('0x51'),_0x14dec8['query'],routingClient)[_0x77da('0x19')](function(_0xfcf09c){if(_0x14dec8[_0x77da('0x13')][_0x77da('0x53')]!==undefined){var _0x17175=_(_0xfcf09c['rows'])[_0x77da('0x54')]([_0x14dec8[_0x77da('0x13')][_0x77da('0x53')],_0x14dec8[_0x77da('0x18')]['id']])[_0x77da('0x55')](_0x77da('0x56'))[_0x77da('0x57')]()[_0x77da('0x58')]();return _0xfcf09c[_0x77da('0x10')][_0x77da('0x54')](function(_0x4df868){return _0x17175['indexOf'](_0x4df868['queue_id'])>-0x1;});}else{return _0xfcf09c[_0x77da('0x10')][_0x77da('0x54')](function(_0x41fb81){return _0x41fb81['queue_id']===parseInt(_0x14dec8['params']['id']);});}})[_0x77da('0x19')](respondWithResult(_0xf95d48,null))[_0x77da('0xa')](handleError(_0xf95d48,null));};exports[_0x77da('0x59')]=function(_0x3a42e5,_0x1a92fd){return respondWithRpcPromise(_0x77da('0x5a'),_0x3a42e5[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x1a92fd,null))[_0x77da('0xa')](handleError(_0x1a92fd,null));};exports[_0x77da('0x5b')]=function(_0x27a462,_0x4cbd40){return respondWithRpcPromise(_0x77da('0x5c'),_0x27a462['query'],routingClient)['then'](respondWithResult(_0x4cbd40,null))[_0x77da('0xa')](handleError(_0x4cbd40,null));};exports['faxQueuesWaitingInteractions']=function(_0x4f9121,_0x22de60){return respondWithRpcPromise(_0x77da('0x5d'),_0x4f9121[_0x77da('0x13')],routingClient)['then'](respondWithResult(_0x22de60,null))['catch'](handleError(_0x22de60,null));};exports[_0x77da('0x5e')]=function(_0x4f1ae0){return function(_0x278f20,_0x1b85aa){var _0x554c44,_0x31834a;var _0x505520=_[_0x77da('0x5f')](_0x4f1ae0);var _0x45b0a5=_0x4f1ae0===_0x77da('0x60')?_0x77da('0x61'):'Account';return db[_0x505520+_0x77da('0x62')][_0x77da('0x63')]({'raw':!![],'where':{'id':_0x278f20[_0x77da('0x18')]['id']}})[_0x77da('0x19')](function(_0x3fd7c8){if(_[_0x77da('0x64')](_0x3fd7c8)){throw new Error(_0x505520+_0x77da('0x65'));}_0x554c44=_0x3fd7c8;return db[_0x505520+'Message']['findOne']({'where':{'id':_0x278f20[_0x77da('0x1d')][_0x77da('0x66')]},'include':[{'model':db[_0x505520+_0x77da('0x67')],'as':'Interaction'},{'model':db[_0x505520+_0x45b0a5],'as':'Account'}]});})['then'](function(_0x5aaafb){if(_[_0x77da('0x64')](_0x5aaafb)){throw new Error(_0x505520+_0x77da('0x68'));}_0x31834a=_0x5aaafb;return _0x5aaafb[_0x77da('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x1636d6={'uniqueid':_0x4f1ae0+'.'+_0x31834a['id']+'.'+_0x31834a['Interaction']['id'],'FromUserId':_0x278f20[_0x77da('0x2c')]['id'],'type':'queue'};_0x1636d6[_0x505520+_0x77da('0x6a')]=_0x31834a['id'];_0x1636d6[_0x505520+'InteractionId']=_0x31834a[_0x77da('0x67')]['id'];_0x1636d6[_0x77da('0x6b')+_0x505520+_0x45b0a5+'Id']=_0x31834a['Account']['id'];_0x1636d6['To'+_0x505520+_0x77da('0x6c')]=_0x554c44['id'];return db[_0x505520+_0x77da('0x6d')][_0x77da('0x6e')](_0x1636d6);})[_0x77da('0x19')](function(){return respondWithRpcPromise(_0x77da('0x6f'),{'channel':_0x4f1ae0,'interaction':_0x31834a[_0x77da('0x67')],'message':_0x31834a,'account':_0x31834a[_0x77da('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0x77da('0x71'),'appdata':_0x554c44[_0x77da('0xd')]+','+(_0x31834a['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x77da('0x19')](respondWithResult(_0x1b85aa,null))[_0x77da('0xa')](handleError(_0x1b85aa,null));};};exports[_0x77da('0x72')]=function(_0x56efcf,_0x186d22){var _0x52638b,_0x5e93b1;if(_[_0x77da('0x64')](_0x56efcf[_0x77da('0x1d')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x3c0cde=_0x56efcf[_0x77da('0x1d')][_0x77da('0x73')];var _0x5d9750=_[_0x77da('0x5f')](_0x3c0cde);var _0x5384d2=_0x3c0cde===_0x77da('0x60')?_0x77da('0x61'):_0x77da('0x70');return db[_0x77da('0x74')][_0x77da('0x63')]({'raw':!![],'where':{'id':_0x56efcf[_0x77da('0x18')]['id'],'role':'agent'}})[_0x77da('0x19')](function(_0x2410ae){if(_[_0x77da('0x64')](_0x2410ae)){throw new Error(_0x77da('0x75'));}_0x52638b=_0x2410ae;return db[_0x5d9750+'Message'][_0x77da('0x63')]({'where':{'id':_0x56efcf['body'][_0x77da('0x66')]},'include':[{'model':db[_0x5d9750+_0x77da('0x67')],'as':_0x77da('0x67')},{'model':db[_0x5d9750+_0x5384d2],'as':_0x77da('0x70')}]});})[_0x77da('0x19')](function(_0x2c3bcc){if(_[_0x77da('0x64')](_0x2c3bcc)){throw new Error(_0x5d9750+_0x77da('0x68'));}_0x5e93b1=_0x2c3bcc;return _0x2c3bcc['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x77da('0x19')](function(){var _0x3132f0={'uniqueid':_0x3c0cde+'.'+_0x5e93b1['id']+'.'+_0x5e93b1[_0x77da('0x67')]['id'],'FromUserId':_0x56efcf[_0x77da('0x2c')]['id'],'type':_0x77da('0x71'),'ToUserId':_0x52638b['id']};_0x3132f0[_0x5d9750+_0x77da('0x6a')]=_0x5e93b1['id'];_0x3132f0[_0x5d9750+_0x77da('0x76')]=_0x5e93b1[_0x77da('0x67')]['id'];_0x3132f0['From'+_0x5d9750+_0x5384d2+'Id']=_0x5e93b1['Account']['id'];return db[_0x5d9750+_0x77da('0x6d')][_0x77da('0x6e')](_0x3132f0);})[_0x77da('0x19')](function(){return respondWithRpcPromise('Start',{'channel':_0x3c0cde,'interaction':_0x5e93b1[_0x77da('0x67')],'message':_0x5e93b1,'account':_0x5e93b1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x77da('0x37'),'appdata':_0x52638b[_0x77da('0xd')]+','+(_0x5e93b1[_0x77da('0x70')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x77da('0x19')](respondWithResult(_0x186d22,null))['catch'](handleError(_0x186d22,null));};
\ No newline at end of file
index a081668..9641c68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x724c=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get'];(function(_0x49c209,_0x34b181){var _0x35861b=function(_0x4d1067){while(--_0x4d1067){_0x49c209['push'](_0x49c209['shift']());}};_0x35861b(++_0x34b181);}(_0x724c,0x14d));var _0xc724=function(_0x32e699,_0x2001b3){_0x32e699=_0x32e699-0x0;var _0x59121c=_0x724c[_0x32e699];return _0x59121c;};'use strict';var multer=require('multer');var util=require(_0xc724('0x0'));var path=require(_0xc724('0x1'));var timeout=require(_0xc724('0x2'));var express=require(_0xc724('0x3'));var router=express['Router']();var fs_extra=require(_0xc724('0x4'));var auth=require(_0xc724('0x5'));var interaction=require(_0xc724('0x6'));var config=require('../../config/environment');var controller=require(_0xc724('0x7'));router[_0xc724('0x8')]('/',auth[_0xc724('0x9')](),controller[_0xc724('0xa')]);router[_0xc724('0x8')](_0xc724('0xb'),auth[_0xc724('0x9')](),controller[_0xc724('0xc')]);router[_0xc724('0x8')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0xc724('0xd')]('/',auth[_0xc724('0x9')](),controller['create']);router[_0xc724('0xe')](_0xc724('0xb'),auth[_0xc724('0x9')](),controller[_0xc724('0xf')]);router[_0xc724('0x10')](_0xc724('0xb'),auth[_0xc724('0x9')](),controller[_0xc724('0x11')]);module[_0xc724('0x12')]=router;
\ No newline at end of file
+var _0x4c65=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/run','run','post','create','put','update','delete','/:id','destroy','exports','util'];(function(_0x17763a,_0x141191){var _0xb60cac=function(_0xaad43){while(--_0xaad43){_0x17763a['push'](_0x17763a['shift']());}};_0xb60cac(++_0x141191);}(_0x4c65,0x68));var _0x54c6=function(_0x3d8c4d,_0x6518ca){_0x3d8c4d=_0x3d8c4d-0x0;var _0x382c4e=_0x4c65[_0x3d8c4d];return _0x382c4e;};'use strict';var multer=require('multer');var util=require(_0x54c6('0x0'));var path=require(_0x54c6('0x1'));var timeout=require('connect-timeout');var express=require(_0x54c6('0x2'));var router=express[_0x54c6('0x3')]();var fs_extra=require(_0x54c6('0x4'));var auth=require(_0x54c6('0x5'));var interaction=require(_0x54c6('0x6'));var config=require(_0x54c6('0x7'));var controller=require('./schedule.controller');router['get']('/',auth[_0x54c6('0x8')](),controller[_0x54c6('0x9')]);router[_0x54c6('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x54c6('0xa')](_0x54c6('0xb'),auth[_0x54c6('0x8')](),controller[_0x54c6('0xc')]);router[_0x54c6('0xd')]('/',auth[_0x54c6('0x8')](),controller[_0x54c6('0xe')]);router[_0x54c6('0xf')]('/:id',auth[_0x54c6('0x8')](),controller[_0x54c6('0x10')]);router[_0x54c6('0x11')](_0x54c6('0x12'),auth[_0x54c6('0x8')](),controller[_0x54c6('0x13')]);module[_0x54c6('0x14')]=router;
\ No newline at end of file
index 3764dcf..77cb06f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97bb=['quarters','months','weeks','hours','csv','xlsx','custom','STRING','TEXT','sequelize','0\x200\x20*\x20*\x20*','DATE','ENUM','years'];(function(_0x585fce,_0x429688){var _0x1f3d2d=function(_0x50db6b){while(--_0x50db6b){_0x585fce['push'](_0x585fce['shift']());}};_0x1f3d2d(++_0x429688);}(_0x97bb,0xdb));var _0xb97b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x97bb[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xb97b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb97b('0x1')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xb97b('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb97b('0x3')](_0xb97b('0x4'),_0xb97b('0x5'),_0xb97b('0x6'),_0xb97b('0x7'),'days',_0xb97b('0x8'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xb97b('0x3')](_0xb97b('0x9'),'pdf',_0xb97b('0xa')),'allowNull':![],'defaultValue':_0xb97b('0x9')},'type':{'type':Sequelize[_0xb97b('0x3')](_0xb97b('0xb'),'default'),'allowNull':![],'defaultValue':_0xb97b('0xb')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xb97b('0xc')]},'cc':{'type':Sequelize[_0xb97b('0xd')]},'bcc':{'type':Sequelize[_0xb97b('0xd')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x3b2b=['months','weeks','hours','minutes','days','csv','pdf','xlsx','custom','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters'];(function(_0x525cf8,_0x2a6778){var _0x1a03af=function(_0x5b6644){while(--_0x5b6644){_0x525cf8['push'](_0x525cf8['shift']());}};_0x1a03af(++_0x2a6778);}(_0x3b2b,0x1a8));var _0xb3b2=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3b2b[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xb3b2('0x0'));module[_0xb3b2('0x1')]={'name':{'type':Sequelize[_0xb3b2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb3b2('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xb3b2('0x2')],'allowNull':![],'defaultValue':_0xb3b2('0x3')},'startAt':{'type':Sequelize[_0xb3b2('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xb3b2('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb3b2('0x5')](_0xb3b2('0x6'),_0xb3b2('0x7'),_0xb3b2('0x8'),_0xb3b2('0x9'),'days',_0xb3b2('0xa'),_0xb3b2('0xb')),'allowNull':![],'defaultValue':_0xb3b2('0xc')},'output':{'type':Sequelize['ENUM'](_0xb3b2('0xd'),_0xb3b2('0xe'),_0xb3b2('0xf')),'allowNull':![],'defaultValue':_0xb3b2('0xd')},'type':{'type':Sequelize[_0xb3b2('0x5')]('custom','default'),'allowNull':![],'defaultValue':_0xb3b2('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xb3b2('0x11')]},'bcc':{'type':Sequelize[_0xb3b2('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index d796ed5..bb82d8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb3b=['nolimit','order','sort','where','pick','merge','VIRTUAL','Schedule','includeAll','include','findAll','rows','catch','show','params','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','run','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','Scheduler','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x23f98a,_0x374f32){var _0x36e301=function(_0x4d1509){while(--_0x4d1509){_0x23f98a['push'](_0x23f98a['shift']());}};_0x36e301(++_0x374f32);}(_0xdb3b,0xc5));var _0xbdb3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdb3b[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xbdb3('0x0'));var rimraf=require(_0xbdb3('0x1'));var zipdir=require(_0xbdb3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbdb3('0x3'));var BPromise=require(_0xbdb3('0x4'));var Mustache=require('mustache');var util=require(_0xbdb3('0x5'));var path=require(_0xbdb3('0x6'));var sox=require(_0xbdb3('0x7'));var csv=require('to-csv');var ejs=require(_0xbdb3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbdb3('0x9'));var squel=require('squel');var crypto=require(_0xbdb3('0xa'));var jsforce=require(_0xbdb3('0xb'));var deskjs=require(_0xbdb3('0xc'));var toCsv=require(_0xbdb3('0xd'));var querystring=require(_0xbdb3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbdb3('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbdb3('0x10'));var logger=require(_0xbdb3('0x11'))('api');var utils=require(_0xbdb3('0x12'));var config=require(_0xbdb3('0x13'));var licenseUtil=require(_0xbdb3('0x14'));var db=require(_0xbdb3('0x15'))['db'];function respondWithStatusCode(_0x3f09c5,_0x511450){_0x511450=_0x511450||0xcc;return function(_0x380f63){if(_0x380f63){return _0x3f09c5[_0xbdb3('0x16')](_0x511450);}return _0x3f09c5[_0xbdb3('0x17')](_0x511450)['end']();};}function respondWithResult(_0x565630,_0x35c7ec){_0x35c7ec=_0x35c7ec||0xc8;return function(_0x413663){if(_0x413663){return _0x565630[_0xbdb3('0x17')](_0x35c7ec)[_0xbdb3('0x18')](_0x413663);}};}function respondWithFilteredResult(_0x5eb59a,_0x1c6a77){return function(_0x567d03){if(_0x567d03){var _0x157290=typeof _0x1c6a77[_0xbdb3('0x19')]===_0xbdb3('0x1a')&&typeof _0x1c6a77[_0xbdb3('0x1b')]===_0xbdb3('0x1a');var _0xd4a33=_0x567d03[_0xbdb3('0x1c')];var _0x3d8bb1=_0x157290?0x0:_0x1c6a77[_0xbdb3('0x19')];var _0x32e72b=_0x157290?_0x567d03[_0xbdb3('0x1c')]:_0x1c6a77[_0xbdb3('0x19')]+_0x1c6a77[_0xbdb3('0x1b')];var _0x52a83f;if(_0x32e72b>=_0xd4a33){_0x32e72b=_0xd4a33;_0x52a83f=0xc8;}else{_0x52a83f=0xce;}_0x5eb59a[_0xbdb3('0x17')](_0x52a83f);return _0x5eb59a['set'](_0xbdb3('0x1d'),_0x3d8bb1+'-'+_0x32e72b+'/'+_0xd4a33)[_0xbdb3('0x18')](_0x567d03);}return null;};}function patchUpdates(_0x19cf63){return function(_0x3053f0){try{jsonpatch[_0xbdb3('0x1e')](_0x3053f0,_0x19cf63,!![]);}catch(_0x42c8d2){return BPromise['reject'](_0x42c8d2);}return _0x3053f0[_0xbdb3('0x1f')]();};}function saveUpdates(_0x48317a,_0x42e027){return function(_0x5de89c){if(_0x5de89c){return _0x5de89c[_0xbdb3('0x20')](_0x48317a)['then'](function(_0x59ff29){return _0x59ff29;});}return null;};}function removeEntity(_0x15c9a8,_0x11e1a1){return function(_0x475ad3){if(_0x475ad3){return _0x475ad3[_0xbdb3('0x21')]()[_0xbdb3('0x22')](function(){var _0xe6580e=_0x475ad3['get']({'plain':!![]});var _0x2b323b=_0xbdb3('0x23');return db[_0xbdb3('0x24')]['destroy']({'where':{'type':_0x2b323b,'resourceId':_0xe6580e['id']}})[_0xbdb3('0x22')](function(){return _0x475ad3;});})[_0xbdb3('0x22')](function(){_0x15c9a8[_0xbdb3('0x17')](0xcc)[_0xbdb3('0x25')]();});}};}function handleEntityNotFound(_0x1c37b6,_0x4d6c74){return function(_0x12d910){if(!_0x12d910){_0x1c37b6[_0xbdb3('0x16')](0x194);}return _0x12d910;};}function handleError(_0x3ccf54,_0x99e143){_0x99e143=_0x99e143||0x1f4;return function(_0x5d587f){logger[_0xbdb3('0x26')](_0x5d587f[_0xbdb3('0x27')]);if(_0x5d587f[_0xbdb3('0x28')]){delete _0x5d587f[_0xbdb3('0x28')];}_0x3ccf54[_0xbdb3('0x17')](_0x99e143)[_0xbdb3('0x29')](_0x5d587f);};}exports[_0xbdb3('0x2a')]=function(_0x52d129,_0x30c939){var _0x597f5b={},_0x37bb3c={},_0x22f5ab={'count':0x0,'rows':[]};var _0x3ab0b4=_[_0xbdb3('0x2b')](db['Schedule'][_0xbdb3('0x2c')],function(_0x8e8574){return{'name':_0x8e8574['fieldName'],'type':_0x8e8574[_0xbdb3('0x2d')][_0xbdb3('0x2e')]};});_0x37bb3c[_0xbdb3('0x2f')]=_[_0xbdb3('0x2b')](_0x3ab0b4,'name');_0x37bb3c[_0xbdb3('0x30')]=_[_0xbdb3('0x31')](_0x52d129['query']);_0x37bb3c[_0xbdb3('0x32')]=_[_0xbdb3('0x33')](_0x37bb3c[_0xbdb3('0x2f')],_0x37bb3c[_0xbdb3('0x30')]);_0x597f5b['attributes']=_['intersection'](_0x37bb3c[_0xbdb3('0x2f')],qs[_0xbdb3('0x34')](_0x52d129[_0xbdb3('0x30')]['fields']));_0x597f5b['attributes']=_0x597f5b['attributes']['length']?_0x597f5b[_0xbdb3('0x35')]:_0x37bb3c[_0xbdb3('0x2f')];if(!_0x52d129[_0xbdb3('0x30')][_0xbdb3('0x36')](_0xbdb3('0x37'))){_0x597f5b[_0xbdb3('0x1b')]=qs['limit'](_0x52d129[_0xbdb3('0x30')][_0xbdb3('0x1b')]);_0x597f5b[_0xbdb3('0x19')]=qs[_0xbdb3('0x19')](_0x52d129[_0xbdb3('0x30')][_0xbdb3('0x19')]);}_0x597f5b[_0xbdb3('0x38')]=qs[_0xbdb3('0x39')](_0x52d129[_0xbdb3('0x30')]['sort']);_0x597f5b[_0xbdb3('0x3a')]=qs['filters'](_[_0xbdb3('0x3b')](_0x52d129[_0xbdb3('0x30')],_0x37bb3c['filters']),_0x3ab0b4);if(_0x52d129[_0xbdb3('0x30')]['filter']){_0x597f5b[_0xbdb3('0x3a')]=_[_0xbdb3('0x3c')](_0x597f5b[_0xbdb3('0x3a')],{'$or':_['map'](_0x3ab0b4,function(_0x555e12){if(_0x555e12[_0xbdb3('0x2d')]!==_0xbdb3('0x3d')){var _0x1a94fb={};_0x1a94fb[_0x555e12[_0xbdb3('0x28')]]={'$like':'%'+_0x52d129[_0xbdb3('0x30')]['filter']+'%'};return _0x1a94fb;}})});}_0x597f5b=_[_0xbdb3('0x3c')]({},_0x597f5b,_0x52d129['options']);var _0x2f24ef={'where':_0x597f5b[_0xbdb3('0x3a')]};return db[_0xbdb3('0x3e')][_0xbdb3('0x1c')](_0x2f24ef)[_0xbdb3('0x22')](function(_0x13ab99){_0x22f5ab[_0xbdb3('0x1c')]=_0x13ab99;if(_0x52d129[_0xbdb3('0x30')][_0xbdb3('0x3f')]){_0x597f5b[_0xbdb3('0x40')]=[{'all':!![]}];}return db['Schedule'][_0xbdb3('0x41')](_0x597f5b);})[_0xbdb3('0x22')](function(_0x57f114){_0x22f5ab[_0xbdb3('0x42')]=_0x57f114;return _0x22f5ab;})[_0xbdb3('0x22')](respondWithFilteredResult(_0x30c939,_0x597f5b))[_0xbdb3('0x43')](handleError(_0x30c939,null));};exports[_0xbdb3('0x44')]=function(_0x39024d,_0x2a2566){var _0x1df700={'raw':![],'where':{'id':_0x39024d[_0xbdb3('0x45')]['id']}},_0x383f44={};_0x383f44[_0xbdb3('0x2f')]=_['keys'](db['Schedule'][_0xbdb3('0x2c')]);_0x383f44['query']=_[_0xbdb3('0x31')](_0x39024d[_0xbdb3('0x30')]);_0x383f44[_0xbdb3('0x32')]=_[_0xbdb3('0x33')](_0x383f44['model'],_0x383f44['query']);_0x1df700[_0xbdb3('0x35')]=_[_0xbdb3('0x33')](_0x383f44[_0xbdb3('0x2f')],qs[_0xbdb3('0x34')](_0x39024d[_0xbdb3('0x30')][_0xbdb3('0x34')]));_0x1df700[_0xbdb3('0x35')]=_0x1df700[_0xbdb3('0x35')][_0xbdb3('0x46')]?_0x1df700[_0xbdb3('0x35')]:_0x383f44[_0xbdb3('0x2f')];if(_0x39024d['query'][_0xbdb3('0x3f')]){_0x1df700['include']=[{'all':!![]}];}_0x1df700=_[_0xbdb3('0x3c')]({},_0x1df700,_0x39024d[_0xbdb3('0x47')]);return db['Schedule'][_0xbdb3('0x48')](_0x1df700)[_0xbdb3('0x22')](handleEntityNotFound(_0x2a2566,null))[_0xbdb3('0x22')](respondWithResult(_0x2a2566,null))['catch'](handleError(_0x2a2566,null));};exports[_0xbdb3('0x49')]=function(_0x17f1ea,_0x21083a){return db[_0xbdb3('0x3e')][_0xbdb3('0x49')](_0x17f1ea[_0xbdb3('0x4a')],{})['then'](function(_0x1448e2){var _0x59a67b=_0x17f1ea[_0xbdb3('0x4b')][_0xbdb3('0x4c')]({'plain':!![]});if(!_0x59a67b)throw new Error(_0xbdb3('0x4d'));if(_0x59a67b[_0xbdb3('0x4e')]===_0xbdb3('0x4b')){var _0x3717e6=_0x1448e2[_0xbdb3('0x4c')]({'plain':!![]});var _0x20e038=_0xbdb3('0x23');return db[_0xbdb3('0x4f')][_0xbdb3('0x48')]({'where':{'name':_0x20e038,'userProfileId':_0x59a67b[_0xbdb3('0x50')]},'raw':!![]})['then'](function(_0x59e2a7){if(_0x59e2a7&&_0x59e2a7[_0xbdb3('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x3717e6[_0xbdb3('0x28')],'resourceId':_0x3717e6['id'],'type':_0x59e2a7[_0xbdb3('0x28')],'sectionId':_0x59e2a7['id']},{})[_0xbdb3('0x22')](function(){return _0x1448e2;});}else{return _0x1448e2;}})[_0xbdb3('0x43')](function(_0x1d95e3){logger[_0xbdb3('0x26')](_0xbdb3('0x52'),_0x1d95e3);throw _0x1d95e3;});}return _0x1448e2;})[_0xbdb3('0x22')](respondWithResult(_0x21083a,0xc9))[_0xbdb3('0x43')](handleError(_0x21083a,null));};exports[_0xbdb3('0x20')]=function(_0x1532aa,_0x410064){if(_0x1532aa[_0xbdb3('0x4a')]['id']){delete _0x1532aa[_0xbdb3('0x4a')]['id'];}return db['Schedule'][_0xbdb3('0x48')]({'where':{'id':_0x1532aa[_0xbdb3('0x45')]['id']}})[_0xbdb3('0x22')](handleEntityNotFound(_0x410064,null))[_0xbdb3('0x22')](saveUpdates(_0x1532aa[_0xbdb3('0x4a')],null))[_0xbdb3('0x22')](respondWithResult(_0x410064,null))[_0xbdb3('0x43')](handleError(_0x410064,null));};exports[_0xbdb3('0x21')]=function(_0x3a9009,_0xcd30d9){return db[_0xbdb3('0x3e')]['find']({'where':{'id':_0x3a9009[_0xbdb3('0x45')]['id']}})[_0xbdb3('0x22')](handleEntityNotFound(_0xcd30d9,null))[_0xbdb3('0x22')](removeEntity(_0xcd30d9,null))[_0xbdb3('0x43')](handleError(_0xcd30d9,null));};exports[_0xbdb3('0x53')]=function(_0x472781,_0x5487e0,_0x4af142){var _0x48e8c7=require('../../config/schedule');return db[_0xbdb3('0x3e')][_0xbdb3('0x48')]({'where':{'id':_0x472781['params']['id']},'raw':!![]})[_0xbdb3('0x22')](handleEntityNotFound(_0x5487e0,null))[_0xbdb3('0x22')](function(){_0x48e8c7[_0xbdb3('0x53')](_0x472781[_0xbdb3('0x45')]['id']);})[_0xbdb3('0x22')](respondWithStatusCode(_0x5487e0,null))['catch'](handleError(_0x5487e0,null));};
\ No newline at end of file
+var _0xd9ec=['ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','name','send','map','Schedule','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xd9ec,0x15a));var _0xcd9e=function(_0x1194cf,_0x2ec3a8){_0x1194cf=_0x1194cf-0x0;var _0x193f18=_0xd9ec[_0x1194cf];return _0x193f18;};'use strict';var emlformat=require(_0xcd9e('0x0'));var rimraf=require(_0xcd9e('0x1'));var zipdir=require(_0xcd9e('0x2'));var jsonpatch=require(_0xcd9e('0x3'));var rp=require(_0xcd9e('0x4'));var moment=require(_0xcd9e('0x5'));var BPromise=require(_0xcd9e('0x6'));var Mustache=require(_0xcd9e('0x7'));var util=require(_0xcd9e('0x8'));var path=require(_0xcd9e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcd9e('0xa'));var fs=require('fs');var fs_extra=require(_0xcd9e('0xb'));var _=require(_0xcd9e('0xc'));var squel=require(_0xcd9e('0xd'));var crypto=require('crypto');var jsforce=require(_0xcd9e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcd9e('0xf'));var querystring=require(_0xcd9e('0x10'));var Papa=require(_0xcd9e('0x11'));var Redis=require(_0xcd9e('0x12'));var authService=require(_0xcd9e('0x13'));var qs=require(_0xcd9e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd9e('0x15'));var logger=require(_0xcd9e('0x16'))(_0xcd9e('0x17'));var utils=require(_0xcd9e('0x18'));var config=require(_0xcd9e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd9e('0x1a'))['db'];function respondWithStatusCode(_0x3ad4ed,_0x1b5358){_0x1b5358=_0x1b5358||0xcc;return function(_0x4b60a5){if(_0x4b60a5){return _0x3ad4ed[_0xcd9e('0x1b')](_0x1b5358);}return _0x3ad4ed[_0xcd9e('0x1c')](_0x1b5358)[_0xcd9e('0x1d')]();};}function respondWithResult(_0x133bab,_0x477047){_0x477047=_0x477047||0xc8;return function(_0x47c0f4){if(_0x47c0f4){return _0x133bab['status'](_0x477047)[_0xcd9e('0x1e')](_0x47c0f4);}};}function respondWithFilteredResult(_0xce27ac,_0x1a349e){return function(_0x3f55c8){if(_0x3f55c8){var _0x17d3b4=typeof _0x1a349e[_0xcd9e('0x1f')]===_0xcd9e('0x20')&&typeof _0x1a349e[_0xcd9e('0x21')]===_0xcd9e('0x20');var _0x355aa9=_0x3f55c8[_0xcd9e('0x22')];var _0x18bcf6=_0x17d3b4?0x0:_0x1a349e[_0xcd9e('0x1f')];var _0x442909=_0x17d3b4?_0x3f55c8[_0xcd9e('0x22')]:_0x1a349e[_0xcd9e('0x1f')]+_0x1a349e[_0xcd9e('0x21')];var _0x3c2b57;if(_0x442909>=_0x355aa9){_0x442909=_0x355aa9;_0x3c2b57=0xc8;}else{_0x3c2b57=0xce;}_0xce27ac[_0xcd9e('0x1c')](_0x3c2b57);return _0xce27ac[_0xcd9e('0x23')](_0xcd9e('0x24'),_0x18bcf6+'-'+_0x442909+'/'+_0x355aa9)[_0xcd9e('0x1e')](_0x3f55c8);}return null;};}function patchUpdates(_0x3d06d0){return function(_0x144bd9){try{jsonpatch[_0xcd9e('0x25')](_0x144bd9,_0x3d06d0,!![]);}catch(_0x2ed8c3){return BPromise[_0xcd9e('0x26')](_0x2ed8c3);}return _0x144bd9[_0xcd9e('0x27')]();};}function saveUpdates(_0xc9415a,_0x12aaa1){return function(_0x2613ab){if(_0x2613ab){return _0x2613ab[_0xcd9e('0x28')](_0xc9415a)[_0xcd9e('0x29')](function(_0x155ca5){return _0x155ca5;});}return null;};}function removeEntity(_0x4f228e,_0x1bdc9e){return function(_0x2353d3){if(_0x2353d3){return _0x2353d3[_0xcd9e('0x2a')]()[_0xcd9e('0x29')](function(){var _0x283c1c=_0x2353d3[_0xcd9e('0x2b')]({'plain':!![]});var _0x3b57b8=_0xcd9e('0x2c');return db[_0xcd9e('0x2d')]['destroy']({'where':{'type':_0x3b57b8,'resourceId':_0x283c1c['id']}})[_0xcd9e('0x29')](function(){return _0x2353d3;});})[_0xcd9e('0x29')](function(){_0x4f228e[_0xcd9e('0x1c')](0xcc)[_0xcd9e('0x1d')]();});}};}function handleEntityNotFound(_0x157851,_0x4f1dd2){return function(_0x45d4fb){if(!_0x45d4fb){_0x157851[_0xcd9e('0x1b')](0x194);}return _0x45d4fb;};}function handleError(_0x3dff83,_0x3b9fca){_0x3b9fca=_0x3b9fca||0x1f4;return function(_0x5ef2ae){logger['error'](_0x5ef2ae['stack']);if(_0x5ef2ae[_0xcd9e('0x2e')]){delete _0x5ef2ae['name'];}_0x3dff83[_0xcd9e('0x1c')](_0x3b9fca)[_0xcd9e('0x2f')](_0x5ef2ae);};}exports['index']=function(_0x388d5b,_0x40cec9){var _0x296745={},_0x5e4c7b={},_0x4727fb={'count':0x0,'rows':[]};var _0x4ca65f=_[_0xcd9e('0x30')](db[_0xcd9e('0x31')][_0xcd9e('0x32')],function(_0x5b46b9){return{'name':_0x5b46b9[_0xcd9e('0x33')],'type':_0x5b46b9[_0xcd9e('0x34')][_0xcd9e('0x35')]};});_0x5e4c7b[_0xcd9e('0x36')]=_[_0xcd9e('0x30')](_0x4ca65f,'name');_0x5e4c7b[_0xcd9e('0x37')]=_[_0xcd9e('0x38')](_0x388d5b['query']);_0x5e4c7b['filters']=_['intersection'](_0x5e4c7b[_0xcd9e('0x36')],_0x5e4c7b[_0xcd9e('0x37')]);_0x296745['attributes']=_[_0xcd9e('0x39')](_0x5e4c7b[_0xcd9e('0x36')],qs[_0xcd9e('0x3a')](_0x388d5b[_0xcd9e('0x37')]['fields']));_0x296745[_0xcd9e('0x3b')]=_0x296745[_0xcd9e('0x3b')][_0xcd9e('0x3c')]?_0x296745[_0xcd9e('0x3b')]:_0x5e4c7b[_0xcd9e('0x36')];if(!_0x388d5b[_0xcd9e('0x37')][_0xcd9e('0x3d')](_0xcd9e('0x3e'))){_0x296745[_0xcd9e('0x21')]=qs[_0xcd9e('0x21')](_0x388d5b[_0xcd9e('0x37')]['limit']);_0x296745['offset']=qs[_0xcd9e('0x1f')](_0x388d5b[_0xcd9e('0x37')][_0xcd9e('0x1f')]);}_0x296745[_0xcd9e('0x3f')]=qs[_0xcd9e('0x40')](_0x388d5b[_0xcd9e('0x37')][_0xcd9e('0x40')]);_0x296745[_0xcd9e('0x41')]=qs[_0xcd9e('0x42')](_[_0xcd9e('0x43')](_0x388d5b['query'],_0x5e4c7b['filters']),_0x4ca65f);if(_0x388d5b[_0xcd9e('0x37')]['filter']){_0x296745[_0xcd9e('0x41')]=_[_0xcd9e('0x44')](_0x296745[_0xcd9e('0x41')],{'$or':_['map'](_0x4ca65f,function(_0x1d9671){if(_0x1d9671['type']!==_0xcd9e('0x45')){var _0x158a81={};_0x158a81[_0x1d9671['name']]={'$like':'%'+_0x388d5b['query'][_0xcd9e('0x46')]+'%'};return _0x158a81;}})});}_0x296745=_[_0xcd9e('0x44')]({},_0x296745,_0x388d5b[_0xcd9e('0x47')]);var _0x4570ac={'where':_0x296745[_0xcd9e('0x41')]};return db[_0xcd9e('0x31')]['count'](_0x4570ac)['then'](function(_0x1a3f88){_0x4727fb[_0xcd9e('0x22')]=_0x1a3f88;if(_0x388d5b[_0xcd9e('0x37')][_0xcd9e('0x48')]){_0x296745['include']=[{'all':!![]}];}return db['Schedule'][_0xcd9e('0x49')](_0x296745);})[_0xcd9e('0x29')](function(_0x5be062){_0x4727fb[_0xcd9e('0x4a')]=_0x5be062;return _0x4727fb;})[_0xcd9e('0x29')](respondWithFilteredResult(_0x40cec9,_0x296745))['catch'](handleError(_0x40cec9,null));};exports['show']=function(_0x27c605,_0x3e5e96){var _0x1d956c={'raw':![],'where':{'id':_0x27c605[_0xcd9e('0x4b')]['id']}},_0x378557={};_0x378557[_0xcd9e('0x36')]=_[_0xcd9e('0x38')](db['Schedule'][_0xcd9e('0x32')]);_0x378557['query']=_[_0xcd9e('0x38')](_0x27c605[_0xcd9e('0x37')]);_0x378557[_0xcd9e('0x42')]=_[_0xcd9e('0x39')](_0x378557['model'],_0x378557['query']);_0x1d956c['attributes']=_[_0xcd9e('0x39')](_0x378557[_0xcd9e('0x36')],qs[_0xcd9e('0x3a')](_0x27c605[_0xcd9e('0x37')][_0xcd9e('0x3a')]));_0x1d956c[_0xcd9e('0x3b')]=_0x1d956c[_0xcd9e('0x3b')][_0xcd9e('0x3c')]?_0x1d956c['attributes']:_0x378557[_0xcd9e('0x36')];if(_0x27c605[_0xcd9e('0x37')][_0xcd9e('0x48')]){_0x1d956c['include']=[{'all':!![]}];}_0x1d956c=_[_0xcd9e('0x44')]({},_0x1d956c,_0x27c605[_0xcd9e('0x47')]);return db[_0xcd9e('0x31')][_0xcd9e('0x4c')](_0x1d956c)[_0xcd9e('0x29')](handleEntityNotFound(_0x3e5e96,null))[_0xcd9e('0x29')](respondWithResult(_0x3e5e96,null))['catch'](handleError(_0x3e5e96,null));};exports[_0xcd9e('0x4d')]=function(_0x4531cb,_0x1ed9e1){return db[_0xcd9e('0x31')][_0xcd9e('0x4d')](_0x4531cb[_0xcd9e('0x4e')],{})[_0xcd9e('0x29')](function(_0x4ee224){var _0x59a5d6=_0x4531cb[_0xcd9e('0x4f')][_0xcd9e('0x2b')]({'plain':!![]});if(!_0x59a5d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59a5d6[_0xcd9e('0x50')]==='user'){var _0x3e8acf=_0x4ee224[_0xcd9e('0x2b')]({'plain':!![]});var _0x523d23=_0xcd9e('0x2c');return db[_0xcd9e('0x51')][_0xcd9e('0x4c')]({'where':{'name':_0x523d23,'userProfileId':_0x59a5d6[_0xcd9e('0x52')]},'raw':!![]})['then'](function(_0x47afee){if(_0x47afee&&_0x47afee[_0xcd9e('0x53')]===0x0){return db[_0xcd9e('0x2d')]['create']({'name':_0x3e8acf[_0xcd9e('0x2e')],'resourceId':_0x3e8acf['id'],'type':_0x47afee['name'],'sectionId':_0x47afee['id']},{})[_0xcd9e('0x29')](function(){return _0x4ee224;});}else{return _0x4ee224;}})['catch'](function(_0x29b1dd){logger[_0xcd9e('0x54')](_0xcd9e('0x55'),_0x29b1dd);throw _0x29b1dd;});}return _0x4ee224;})[_0xcd9e('0x29')](respondWithResult(_0x1ed9e1,0xc9))[_0xcd9e('0x56')](handleError(_0x1ed9e1,null));};exports['update']=function(_0x13b732,_0x284c5e){if(_0x13b732['body']['id']){delete _0x13b732['body']['id'];}return db['Schedule'][_0xcd9e('0x4c')]({'where':{'id':_0x13b732['params']['id']}})[_0xcd9e('0x29')](handleEntityNotFound(_0x284c5e,null))[_0xcd9e('0x29')](saveUpdates(_0x13b732[_0xcd9e('0x4e')],null))['then'](respondWithResult(_0x284c5e,null))[_0xcd9e('0x56')](handleError(_0x284c5e,null));};exports['destroy']=function(_0xe6eebb,_0x4556cc){return db['Schedule']['find']({'where':{'id':_0xe6eebb[_0xcd9e('0x4b')]['id']}})[_0xcd9e('0x29')](handleEntityNotFound(_0x4556cc,null))[_0xcd9e('0x29')](removeEntity(_0x4556cc,null))['catch'](handleError(_0x4556cc,null));};exports[_0xcd9e('0x57')]=function(_0x514df8,_0x214a2f,_0x221457){var _0x50cc24=require(_0xcd9e('0x58'));return db[_0xcd9e('0x31')][_0xcd9e('0x4c')]({'where':{'id':_0x514df8[_0xcd9e('0x4b')]['id']},'raw':!![]})[_0xcd9e('0x29')](handleEntityNotFound(_0x214a2f,null))[_0xcd9e('0x29')](function(){_0x50cc24[_0xcd9e('0x57')](_0x514df8[_0xcd9e('0x4b')]['id']);})[_0xcd9e('0x29')](respondWithStatusCode(_0x214a2f,null))['catch'](handleError(_0x214a2f,null));};
\ No newline at end of file
index 3d12a92..6b33cdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ee6=['Schedule','util','../../config/logger','api','bluebird','request-promise','path','./schedule.attributes','define'];(function(_0x3faa55,_0xde3411){var _0x124d89=function(_0x591f91){while(--_0x591f91){_0x3faa55['push'](_0x3faa55['shift']());}};_0x124d89(++_0xde3411);}(_0x0ee6,0x1cc));var _0x60ee=function(_0x3c024b,_0x3d93ec){_0x3c024b=_0x3c024b-0x0;var _0x298183=_0x0ee6[_0x3c024b];return _0x298183;};'use strict';var _=require('lodash');var util=require(_0x60ee('0x0'));var logger=require(_0x60ee('0x1'))(_0x60ee('0x2'));var moment=require('moment');var BPromise=require(_0x60ee('0x3'));var rp=require(_0x60ee('0x4'));var fs=require('fs');var path=require(_0x60ee('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x60ee('0x6'));module['exports']=function(_0x591f8e,_0x2764c2){return _0x591f8e[_0x60ee('0x7')](_0x60ee('0x8'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x953d=['./schedule.attributes','exports','Schedule','tools_schedules','lodash','util','../../config/logger','moment','request-promise'];(function(_0x5a75c6,_0x238c61){var _0x49e9af=function(_0x463c5c){while(--_0x463c5c){_0x5a75c6['push'](_0x5a75c6['shift']());}};_0x49e9af(++_0x238c61);}(_0x953d,0xaf));var _0xd953=function(_0x1f98c0,_0x4ddddf){_0x1f98c0=_0x1f98c0-0x0;var _0x1cc656=_0x953d[_0x1f98c0];return _0x1cc656;};'use strict';var _=require(_0xd953('0x0'));var util=require(_0xd953('0x1'));var logger=require(_0xd953('0x2'))('api');var moment=require(_0xd953('0x3'));var BPromise=require('bluebird');var rp=require(_0xd953('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd953('0x5'));module[_0xd953('0x6')]=function(_0xbad4a,_0x43767d){return _0xbad4a['define'](_0xd953('0x7'),attributes,{'tableName':_0xd953('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7c18f22..0d30acf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61dd=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x52b81c,_0x5490aa){var _0xa843f1=function(_0x4c24c7){while(--_0x4c24c7){_0x52b81c['push'](_0x52b81c['shift']());}};_0xa843f1(++_0x5490aa);}(_0x61dd,0x165));var _0xd61d=function(_0x957193,_0x3fec8b){_0x957193=_0x957193-0x0;var _0x9473f8=_0x61dd[_0x957193];return _0x9473f8;};'use strict';var _=require(_0xd61d('0x0'));var util=require(_0xd61d('0x1'));var moment=require(_0xd61d('0x2'));var BPromise=require(_0xd61d('0x3'));var rs=require(_0xd61d('0x4'));var fs=require('fs');var Redis=require(_0xd61d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd61d('0x6'));var logger=require(_0xd61d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd61d('0x8'));var client=jayson[_0xd61d('0x9')][_0xd61d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x290b90,_0x2a6d14,_0x25fec9){return new BPromise(function(_0x286d8b,_0x53f8b3){return client[_0xd61d('0xb')](_0x290b90,_0x25fec9)['then'](function(_0x557a52){logger[_0xd61d('0xc')](_0xd61d('0xd'),_0x2a6d14,_0xd61d('0xe'));logger['debug'](_0xd61d('0xf'),_0x2a6d14,_0xd61d('0xe'),JSON[_0xd61d('0x10')](_0x557a52));if(_0x557a52[_0xd61d('0x11')]){if(_0x557a52[_0xd61d('0x11')][_0xd61d('0x12')]===0x1f4){logger['error'](_0xd61d('0xd'),_0x2a6d14,_0x557a52['error']['message']);return _0x53f8b3(_0x557a52[_0xd61d('0x11')]['message']);}logger[_0xd61d('0x11')](_0xd61d('0xd'),_0x2a6d14,_0x557a52[_0xd61d('0x11')][_0xd61d('0x13')]);return _0x286d8b(_0x557a52[_0xd61d('0x11')][_0xd61d('0x13')]);}else{logger[_0xd61d('0xc')]('Schedule,\x20%s,\x20%s',_0x2a6d14,_0xd61d('0xe'));_0x286d8b(_0x557a52[_0xd61d('0x14')][_0xd61d('0x13')]);}})[_0xd61d('0x15')](function(_0x3c865d){logger[_0xd61d('0x11')]('Schedule,\x20%s,\x20%s',_0x2a6d14,_0x3c865d);_0x53f8b3(_0x3c865d);});});}
\ No newline at end of file
+var _0xc2f2=['stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x58bec4,_0x28e39f){var _0x35dd22=function(_0x23ecb0){while(--_0x23ecb0){_0x58bec4['push'](_0x58bec4['shift']());}};_0x35dd22(++_0x28e39f);}(_0xc2f2,0x1bc));var _0x2c2f=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xc2f2[_0x1b7368];return _0x25d54c;};'use strict';var _=require('lodash');var util=require(_0x2c2f('0x0'));var moment=require(_0x2c2f('0x1'));var BPromise=require(_0x2c2f('0x2'));var rs=require(_0x2c2f('0x3'));var fs=require('fs');var Redis=require(_0x2c2f('0x4'));var db=require(_0x2c2f('0x5'))['db'];var utils=require(_0x2c2f('0x6'));var logger=require(_0x2c2f('0x7'))(_0x2c2f('0x8'));var config=require(_0x2c2f('0x9'));var jayson=require(_0x2c2f('0xa'));var client=jayson['client'][_0x2c2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x397f9b,_0x4cf1c7,_0x520966){return new BPromise(function(_0x2514c7,_0x6f5d6a){return client[_0x2c2f('0xc')](_0x397f9b,_0x520966)['then'](function(_0x8b6b9b){logger[_0x2c2f('0xd')](_0x2c2f('0xe'),_0x4cf1c7,_0x2c2f('0xf'));logger[_0x2c2f('0x10')](_0x2c2f('0x11'),_0x4cf1c7,'request\x20sent',JSON[_0x2c2f('0x12')](_0x8b6b9b));if(_0x8b6b9b[_0x2c2f('0x13')]){if(_0x8b6b9b[_0x2c2f('0x13')]['code']===0x1f4){logger[_0x2c2f('0x13')]('Schedule,\x20%s,\x20%s',_0x4cf1c7,_0x8b6b9b['error'][_0x2c2f('0x14')]);return _0x6f5d6a(_0x8b6b9b[_0x2c2f('0x13')][_0x2c2f('0x14')]);}logger['error'](_0x2c2f('0xe'),_0x4cf1c7,_0x8b6b9b[_0x2c2f('0x13')]['message']);return _0x2514c7(_0x8b6b9b[_0x2c2f('0x13')]['message']);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x4cf1c7,_0x2c2f('0xf'));_0x2514c7(_0x8b6b9b['result']['message']);}})[_0x2c2f('0x15')](function(_0xb7f9b7){logger[_0x2c2f('0x13')](_0x2c2f('0xe'),_0x4cf1c7,_0xb7f9b7);_0x6f5d6a(_0xb7f9b7);});});}
\ No newline at end of file
index a743f5f..ae129cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ab1=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','post'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2ab1,0x1a3));var _0x12ab=function(_0x59884a,_0x3b50e3){_0x59884a=_0x59884a-0x0;var _0x4cd0b9=_0x2ab1[_0x59884a];return _0x4cd0b9;};'use strict';var multer=require(_0x12ab('0x0'));var util=require(_0x12ab('0x1'));var path=require(_0x12ab('0x2'));var timeout=require(_0x12ab('0x3'));var express=require('express');var router=express[_0x12ab('0x4')]();var fs_extra=require(_0x12ab('0x5'));var auth=require(_0x12ab('0x6'));var interaction=require(_0x12ab('0x7'));var config=require(_0x12ab('0x8'));var controller=require(_0x12ab('0x9'));router[_0x12ab('0xa')]('/',auth[_0x12ab('0xb')](),controller[_0x12ab('0xc')]);router['get'](_0x12ab('0xd'),auth[_0x12ab('0xb')](),controller['describe']);router[_0x12ab('0xa')](_0x12ab('0xe'),auth[_0x12ab('0xb')](),controller[_0x12ab('0xf')]);router[_0x12ab('0xa')](_0x12ab('0x10'),auth[_0x12ab('0xb')](),controller['download']);router[_0x12ab('0x11')]('/',auth[_0x12ab('0xb')](),controller['create']);router[_0x12ab('0x12')](_0x12ab('0xe'),auth[_0x12ab('0xb')](),controller[_0x12ab('0x13')]);router[_0x12ab('0x14')]('/:id',auth[_0x12ab('0xb')](),controller[_0x12ab('0x15')]);module[_0x12ab('0x16')]=router;
\ No newline at end of file
+var _0x85a9=['/:id/download','download','post','create','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated'];(function(_0x1d7605,_0x14e4b2){var _0x199c18=function(_0x3080c7){while(--_0x3080c7){_0x1d7605['push'](_0x1d7605['shift']());}};_0x199c18(++_0x14e4b2);}(_0x85a9,0x1ac));var _0x985a=function(_0x50cd41,_0x4874a7){_0x50cd41=_0x50cd41-0x0;var _0x399475=_0x85a9[_0x50cd41];return _0x399475;};'use strict';var multer=require(_0x985a('0x0'));var util=require(_0x985a('0x1'));var path=require('path');var timeout=require(_0x985a('0x2'));var express=require(_0x985a('0x3'));var router=express[_0x985a('0x4')]();var fs_extra=require(_0x985a('0x5'));var auth=require(_0x985a('0x6'));var interaction=require(_0x985a('0x7'));var config=require(_0x985a('0x8'));var controller=require(_0x985a('0x9'));router[_0x985a('0xa')]('/',auth[_0x985a('0xb')](),controller['index']);router[_0x985a('0xa')]('/describe',auth[_0x985a('0xb')](),controller['describe']);router[_0x985a('0xa')]('/:id',auth[_0x985a('0xb')](),controller['show']);router[_0x985a('0xa')](_0x985a('0xc'),auth[_0x985a('0xb')](),controller[_0x985a('0xd')]);router[_0x985a('0xe')]('/',auth[_0x985a('0xb')](),controller[_0x985a('0xf')]);router[_0x985a('0x10')]('/:id',auth[_0x985a('0xb')](),controller[_0x985a('0x11')]);router[_0x985a('0x12')](_0x985a('0x13'),auth[_0x985a('0xb')](),controller[_0x985a('0x14')]);module[_0x985a('0x15')]=router;
\ No newline at end of file
index 776dbe8..5c4d816 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5386=['path','../../config/environment','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','format','sequelize','moment'];(function(_0x416b67,_0x1b1eec){var _0x5a6cf3=function(_0x43a6e4){while(--_0x43a6e4){_0x416b67['push'](_0x416b67['shift']());}};_0x5a6cf3(++_0x1b1eec);}(_0x5386,0x1e1));var _0x6538=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0x5386[_0x1e48d3];return _0x2852b1;};'use strict';var Sequelize=require(_0x6538('0x0'));var moment=require(_0x6538('0x1'));var path=require(_0x6538('0x2'));var config=require(_0x6538('0x3'));module['exports']={'format':{'type':Sequelize[_0x6538('0x4')],'get':function(){return this[_0x6538('0x5')](_0x6538('0x6'))?path[_0x6538('0x7')](this[_0x6538('0x5')](_0x6538('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x6538('0x8')]},'channel':{'type':Sequelize[_0x6538('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x16c291){var _0x4b0e05=_0x16c291[_0x6538('0x9')](/\\/g,'/');this[_0x6538('0xa')](_0x6538('0x6'),_0x4b0e05);}},'rating':{'type':Sequelize[_0x6538('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6538('0xb')],'set':function(_0x2bce05){this[_0x6538('0xa')](_0x6538('0xc'),moment()[_0x6538('0xd')](_0x2bce05,'ms'));this[_0x6538('0xa')]('closedAt',moment());this[_0x6538('0xa')](_0x6538('0xe'),_0x2bce05);}},'startedAt':{'type':Sequelize[_0x6538('0xf')],'get':function(){return moment(this['getDataValue'](_0x6538('0xc')))['format'](_0x6538('0x10'))[_0x6538('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6538('0x5')](_0x6538('0x12')))['format'](_0x6538('0x10'))[_0x6538('0x11')]();}},'createdAt':{'type':Sequelize[_0x6538('0xf')],'get':function(){return moment(this['getDataValue'](_0x6538('0x13')))['format'](_0x6538('0x10'))[_0x6538('0x11')]();}},'updatedAt':{'type':Sequelize[_0x6538('0xf')],'get':function(){return moment(this[_0x6538('0x5')]('updatedAt'))[_0x6538('0x14')](_0x6538('0x10'))['toString']();}}};
\ No newline at end of file
+var _0xf811=['updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x2de369,_0x3c9578){var _0xcceb20=function(_0x8d8c7e){while(--_0x8d8c7e){_0x2de369['push'](_0x2de369['shift']());}};_0xcceb20(++_0x3c9578);}(_0xf811,0x6f));var _0x1f81=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xf811[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x1f81('0x0'));var moment=require(_0x1f81('0x1'));var path=require(_0x1f81('0x2'));var config=require(_0x1f81('0x3'));module[_0x1f81('0x4')]={'format':{'type':Sequelize[_0x1f81('0x5')],'get':function(){return this[_0x1f81('0x6')](_0x1f81('0x7'))?path[_0x1f81('0x8')](this[_0x1f81('0x6')](_0x1f81('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x1f81('0x9')]},'channel':{'type':Sequelize[_0x1f81('0x9')]},'value':{'type':Sequelize[_0x1f81('0x9')],'set':function(_0x57c512){var _0x2238b2=_0x57c512[_0x1f81('0xa')](/\\/g,'/');this[_0x1f81('0xb')]('value',_0x2238b2);}},'rating':{'type':Sequelize[_0x1f81('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x1f81('0xc')],'set':function(_0x4af394){this[_0x1f81('0xb')]('startedAt',moment()[_0x1f81('0xd')](_0x4af394,'ms'));this[_0x1f81('0xb')](_0x1f81('0xe'),moment());this[_0x1f81('0xb')](_0x1f81('0xf'),_0x4af394);}},'startedAt':{'type':Sequelize[_0x1f81('0x10')],'get':function(){return moment(this[_0x1f81('0x6')](_0x1f81('0x11')))[_0x1f81('0x12')](_0x1f81('0x13'))[_0x1f81('0x14')]();}},'closedAt':{'type':Sequelize[_0x1f81('0x10')],'get':function(){return moment(this[_0x1f81('0x6')](_0x1f81('0xe')))[_0x1f81('0x12')](_0x1f81('0x13'))['toString']();}},'createdAt':{'type':Sequelize[_0x1f81('0x10')],'get':function(){return moment(this[_0x1f81('0x6')]('createdAt'))['format'](_0x1f81('0x13'))[_0x1f81('0x14')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x1f81('0x6')](_0x1f81('0x15')))[_0x1f81('0x12')](_0x1f81('0x13'))['toString']();}}};
\ No newline at end of file
index 2f642d8..2c25f77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a19=['limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','type','key','model','differenceBy','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','duration','value','find','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','status','end','offset','undefined'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x9a19,0x114));var _0x99a1=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x9a19[_0x235f49];return _0x551139;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0x3c813,_0x491341){return function(_0x4fe7f7){if(!_0x4fe7f7){_0x3c813[_0x99a1('0x19')](0x194);}return _0x4fe7f7;};}function handleError(_0x5dabd9,_0x5dc733){_0x5dc733=_0x5dc733||0x1f4;return function(_0xafea84){logger[_0x99a1('0x25')](_0xafea84[_0x99a1('0x26')]);if(_0xafea84[_0x99a1('0x27')]){delete _0xafea84[_0x99a1('0x27')];}_0x5dabd9[_0x99a1('0x1a')](_0x5dc733)[_0x99a1('0x28')](_0xafea84);};}exports['index']=function(_0xf41b0d,_0x499eef){var _0x255197={},_0x1137f2={},_0x26fbae={'count':0x0,'rows':[]};var _0x523668=_[_0x99a1('0x29')](db[_0x99a1('0x2a')]['rawAttributes'],function(_0x37514e){return{'name':_0x37514e[_0x99a1('0x2b')],'type':_0x37514e[_0x99a1('0x2c')][_0x99a1('0x2d')]};});_0x1137f2[_0x99a1('0x2e')]=_[_0x99a1('0x2f')](_[_0x99a1('0x29')](_0x523668,_0x99a1('0x27')),['format']);_0x1137f2['query']=_[_0x99a1('0x30')](_0xf41b0d['query']);_0x1137f2[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x1137f2['model'],_0x1137f2[_0x99a1('0x33')]);_0x255197[_0x99a1('0x34')]=_[_0x99a1('0x32')](_0x1137f2[_0x99a1('0x2e')],qs[_0x99a1('0x35')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x35')]));_0x255197[_0x99a1('0x34')]=_0x255197[_0x99a1('0x34')][_0x99a1('0x36')]?_0x255197[_0x99a1('0x34')]:_0x1137f2[_0x99a1('0x2e')];if(!_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x37')]('nolimit')){_0x255197['limit']=qs[_0x99a1('0x1e')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1e')]);_0x255197[_0x99a1('0x1c')]=qs[_0x99a1('0x1c')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1c')]);}_0x255197['order']=qs[_0x99a1('0x38')](_0xf41b0d[_0x99a1('0x33')]['sort']);_0x255197[_0x99a1('0x39')]=qs[_0x99a1('0x31')](_[_0x99a1('0x3a')](_0xf41b0d[_0x99a1('0x33')],_0x1137f2[_0x99a1('0x31')]),_0x523668);if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]){_0x255197[_0x99a1('0x39')]=_[_0x99a1('0x3c')](_0x255197[_0x99a1('0x39')],{'$or':_[_0x99a1('0x29')](_0x523668,function(_0x152969){if(_0x152969[_0x99a1('0x2c')]!=='VIRTUAL'){var _0x5553e4={};_0x5553e4[_0x152969['name']]={'$like':'%'+_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]+'%'};return _0x5553e4;}})});}_0x255197=_[_0x99a1('0x3c')]({},_0x255197,_0xf41b0d[_0x99a1('0x3d')]);var _0x40613a={'where':_0x255197['where']};return db[_0x99a1('0x2a')][_0x99a1('0x1f')](_0x40613a)[_0x99a1('0x23')](function(_0x51efe5){_0x26fbae['count']=_0x51efe5;if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x255197[_0x99a1('0x3f')]=[{'all':!![]}];}return db['ScreenRecording'][_0x99a1('0x40')](_0x255197);})[_0x99a1('0x23')](function(_0x1b5d2d){_0x26fbae[_0x99a1('0x41')]=_0x1b5d2d;return _0x26fbae;})[_0x99a1('0x23')](respondWithFilteredResult(_0x499eef,_0x255197))[_0x99a1('0x42')](handleError(_0x499eef,null));};exports[_0x99a1('0x43')]=function(_0x29d0a0,_0x1c4ce4){var _0x2be9e3={'raw':![],'where':{'id':_0x29d0a0[_0x99a1('0x44')]['id']}},_0x4b40e1={};_0x4b40e1[_0x99a1('0x2e')]=_[_0x99a1('0x30')](db['ScreenRecording'][_0x99a1('0x45')]);_0x4b40e1['query']=_[_0x99a1('0x30')](_0x29d0a0[_0x99a1('0x33')]);_0x4b40e1[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x4b40e1[_0x99a1('0x2e')],_0x4b40e1[_0x99a1('0x33')]);_0x2be9e3['attributes']=_[_0x99a1('0x32')](_0x4b40e1['model'],qs[_0x99a1('0x35')](_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x35')]));_0x2be9e3[_0x99a1('0x34')]=_0x2be9e3[_0x99a1('0x34')][_0x99a1('0x36')]?_0x2be9e3[_0x99a1('0x34')]:_0x4b40e1[_0x99a1('0x2e')];if(_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x2be9e3[_0x99a1('0x3f')]=[{'all':!![]}];}_0x2be9e3=_['merge']({},_0x2be9e3,_0x29d0a0[_0x99a1('0x3d')]);return db[_0x99a1('0x2a')]['find'](_0x2be9e3)[_0x99a1('0x23')](handleEntityNotFound(_0x1c4ce4,null))[_0x99a1('0x23')](respondWithResult(_0x1c4ce4,null))[_0x99a1('0x42')](handleError(_0x1c4ce4,null));};exports[_0x99a1('0x46')]=function(_0x113dd9,_0x254c41){return db[_0x99a1('0x2a')]['create'](_0x113dd9[_0x99a1('0x47')],{})['then'](respondWithResult(_0x254c41,0xc9))[_0x99a1('0x42')](handleError(_0x254c41,null));};exports[_0x99a1('0x48')]=function(_0x566442,_0x5433f2){if(_0x566442[_0x99a1('0x47')]['id']){delete _0x566442[_0x99a1('0x47')]['id'];}delete _0x566442[_0x99a1('0x47')][_0x99a1('0x49')];delete _0x566442[_0x99a1('0x47')]['createdAt'];delete _0x566442['body']['closedAt'];delete _0x566442[_0x99a1('0x47')][_0x99a1('0x4a')];return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':{'id':_0x566442[_0x99a1('0x44')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x5433f2,null))[_0x99a1('0x23')](saveUpdates(_0x566442['body'],null))[_0x99a1('0x23')](respondWithResult(_0x5433f2,null))[_0x99a1('0x42')](handleError(_0x5433f2,null));};exports[_0x99a1('0x4c')]=function(_0x5e877f,_0x81e218){return db['ScreenRecording']['describe']()[_0x99a1('0x23')](respondWithResult(_0x81e218,null))[_0x99a1('0x42')](handleError(_0x81e218,null));};exports[_0x99a1('0x4d')]=function(_0x175f6d,_0x11632d,_0xf8208a){var _0x240d2e=require(_0x99a1('0x4e'));var _0x16641e=![];var _0x53e9eb={};if(_0x175f6d[_0x99a1('0x33')]['type']&&_0x175f6d[_0x99a1('0x33')][_0x99a1('0x2c')]==='uniqueid'){_0x53e9eb[_0x99a1('0x4f')]=_0x175f6d[_0x99a1('0x44')]['id'];}else{_0x53e9eb['id']=_0x175f6d[_0x99a1('0x44')]['id'];}return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':_0x53e9eb,'attributes':['id',_0x99a1('0x4a')],'raw':!![]})[_0x99a1('0x23')](handleEntityNotFound(_0x11632d,null))[_0x99a1('0x23')](function(_0x28ba8f){if(_0x28ba8f){var _0x1c2926=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x28ba8f['value']);var _0x2e3e08=util[_0x99a1('0x52')](_0x99a1('0x53'),_0x1c2926);if(fs[_0x99a1('0x54')](_0x2e3e08)){_0x16641e=!![];return _0x240d2e[_0x99a1('0x55')](_0x2e3e08,_0x1c2926,config['secrets'][_0x99a1('0x56')])[_0x99a1('0x23')](function(){return _0x28ba8f;});}return _0x28ba8f;}})['then'](function(_0x6107cd){if(_0x6107cd){var _0x95f20a=path[_0x99a1('0x50')](config[_0x99a1('0x51')],_0x99a1('0x57'),_0x6107cd['value']);if(!fs[_0x99a1('0x54')](_0x95f20a)){throw new db[(_0x99a1('0x58'))][(_0x99a1('0x59'))](_0x99a1('0x5a'));}if(_0x6107cd[_0x99a1('0x5b')]){return _0x11632d[_0x99a1('0x4d')](_0x95f20a,_0x6107cd['filename']+path[_0x99a1('0x5c')](_0x95f20a),function(){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}else{return _0x11632d['download'](_0x95f20a,function(_0x33feb9){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}}})[_0x99a1('0x42')](function(_0xb126dd){if(_0xb126dd[_0x99a1('0x5e')]==='ScreenRecording\x20not\x20found'){_0x11632d[_0x99a1('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x11632d,null);}});};exports['destroy']=function(_0x38ce3c,_0x3f7c16){return db['ScreenRecording']['find']({'where':{'id':_0x38ce3c[_0x99a1('0x44')]['id']}})['then'](function(_0x21a5f6){if(_[_0x99a1('0x5f')](_0x21a5f6)){throw new ReferenceError(_0x99a1('0x60'));}return _0x21a5f6;})[_0x99a1('0x23')](function(_0x56d6cf){var _0x18f74b=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x56d6cf[_0x99a1('0x4a')]);logger['info'](_0x99a1('0x61'),_0x18f74b);if(!_[_0x99a1('0x5f')](_0x56d6cf[_0x99a1('0x4a')])&&fs[_0x99a1('0x54')](_0x18f74b)){logger[_0x99a1('0x62')]('File:\x20\x22'+_0x18f74b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x18f74b);}_0x18f74b=_0x18f74b+_0x99a1('0x63');if(!_[_0x99a1('0x5f')](_0x56d6cf['value'])&&fs['existsSync'](_0x18f74b)){logger[_0x99a1('0x62')](_0x99a1('0x64')+_0x18f74b+_0x99a1('0x65'));fs['unlinkSync'](_0x18f74b);}return _0x56d6cf;})['then'](function(_0x2b8df8){if(!_0x2b8df8)throw new InternalError();return _0x2b8df8['destroy']();})[_0x99a1('0x23')](function(){_0x3f7c16[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();})['catch'](handleError(_0x3f7c16,null));};
\ No newline at end of file
+var _0x7bae=['zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','params','options','find','create','body','duration','createdAt','value','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','secrets','recording','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x19c860,_0x568e76){var _0x25aa01=function(_0x40be14){while(--_0x40be14){_0x19c860['push'](_0x19c860['shift']());}};_0x25aa01(++_0x568e76);}(_0x7bae,0x13b));var _0xe7ba=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x7bae[_0x5608a3];return _0x1ed50a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7ba('0x0'));var jsonpatch=require(_0xe7ba('0x1'));var rp=require('request-promise');var moment=require(_0xe7ba('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe7ba('0x3'));var util=require(_0xe7ba('0x4'));var path=require(_0xe7ba('0x5'));var sox=require(_0xe7ba('0x6'));var csv=require(_0xe7ba('0x7'));var ejs=require(_0xe7ba('0x8'));var fs=require('fs');var fs_extra=require(_0xe7ba('0x9'));var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x7'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var authService=require(_0xe7ba('0x11'));var qs=require(_0xe7ba('0x12'));var as=require(_0xe7ba('0x13'));var hardwareService=require(_0xe7ba('0x14'));var logger=require(_0xe7ba('0x15'))(_0xe7ba('0x16'));var utils=require(_0xe7ba('0x17'));var config=require(_0xe7ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ba('0x19'))['db'];function respondWithStatusCode(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xcc;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0x1a')](_0x602b1);}return _0x588c8b[_0xe7ba('0x1b')](_0x602b1)[_0xe7ba('0x1c')]();};}function respondWithResult(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0xc8;return function(_0x561c48){if(_0x561c48){return _0x41369f[_0xe7ba('0x1b')](_0x561dbb)[_0xe7ba('0x1d')](_0x561c48);}};}function respondWithFilteredResult(_0x359f6f,_0x5d1d03){return function(_0x4390e3){if(_0x4390e3){var _0x4b20fd=typeof _0x5d1d03['offset']==='undefined'&&typeof _0x5d1d03[_0xe7ba('0x1e')]==='undefined';var _0x41a773=_0x4390e3['count'];var _0x4e3021=_0x4b20fd?0x0:_0x5d1d03['offset'];var _0x3f326a=_0x4b20fd?_0x4390e3[_0xe7ba('0x1f')]:_0x5d1d03[_0xe7ba('0x20')]+_0x5d1d03[_0xe7ba('0x1e')];var _0x1c8b5b;if(_0x3f326a>=_0x41a773){_0x3f326a=_0x41a773;_0x1c8b5b=0xc8;}else{_0x1c8b5b=0xce;}_0x359f6f['status'](_0x1c8b5b);return _0x359f6f[_0xe7ba('0x21')](_0xe7ba('0x22'),_0x4e3021+'-'+_0x3f326a+'/'+_0x41a773)[_0xe7ba('0x1d')](_0x4390e3);}return null;};}function patchUpdates(_0x136ec6){return function(_0x4aaf35){try{jsonpatch[_0xe7ba('0x23')](_0x4aaf35,_0x136ec6,!![]);}catch(_0x2936b7){return BPromise['reject'](_0x2936b7);}return _0x4aaf35[_0xe7ba('0x24')]();};}function saveUpdates(_0x4514e8,_0x27c882){return function(_0x7ab9e4){if(_0x7ab9e4){return _0x7ab9e4[_0xe7ba('0x25')](_0x4514e8)[_0xe7ba('0x26')](function(_0x293b14){return _0x293b14;});}return null;};}function removeEntity(_0x2b29f0,_0x41cbd9){return function(_0xa72f1c){if(_0xa72f1c){return _0xa72f1c['destroy']()['then'](function(){_0x2b29f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4363a8,_0x576513){return function(_0x4ecc0d){if(!_0x4ecc0d){_0x4363a8['sendStatus'](0x194);}return _0x4ecc0d;};}function handleError(_0x255def,_0x32cc00){_0x32cc00=_0x32cc00||0x1f4;return function(_0xe32862){logger[_0xe7ba('0x27')](_0xe32862[_0xe7ba('0x28')]);if(_0xe32862[_0xe7ba('0x29')]){delete _0xe32862[_0xe7ba('0x29')];}_0x255def[_0xe7ba('0x1b')](_0x32cc00)['send'](_0xe32862);};}exports[_0xe7ba('0x2a')]=function(_0x48c869,_0x102925){var _0x92fe7={},_0x369451={},_0x4bf5f9={'count':0x0,'rows':[]};var _0x587c7d=_[_0xe7ba('0x2b')](db[_0xe7ba('0x2c')][_0xe7ba('0x2d')],function(_0x20b6cd){return{'name':_0x20b6cd[_0xe7ba('0x2e')],'type':_0x20b6cd['type'][_0xe7ba('0x2f')]};});_0x369451[_0xe7ba('0x30')]=_['differenceBy'](_[_0xe7ba('0x2b')](_0x587c7d,'name'),['format']);_0x369451[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x48c869[_0xe7ba('0x31')]);_0x369451['filters']=_[_0xe7ba('0x33')](_0x369451['model'],_0x369451[_0xe7ba('0x31')]);_0x92fe7[_0xe7ba('0x34')]=_[_0xe7ba('0x33')](_0x369451[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x48c869['query'][_0xe7ba('0x35')]));_0x92fe7[_0xe7ba('0x34')]=_0x92fe7['attributes'][_0xe7ba('0x36')]?_0x92fe7[_0xe7ba('0x34')]:_0x369451[_0xe7ba('0x30')];if(!_0x48c869['query'][_0xe7ba('0x37')](_0xe7ba('0x38'))){_0x92fe7['limit']=qs[_0xe7ba('0x1e')](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x1e')]);_0x92fe7['offset']=qs[_0xe7ba('0x20')](_0x48c869[_0xe7ba('0x31')]['offset']);}_0x92fe7[_0xe7ba('0x39')]=qs[_0xe7ba('0x3a')](_0x48c869[_0xe7ba('0x31')]['sort']);_0x92fe7['where']=qs[_0xe7ba('0x3b')](_[_0xe7ba('0x3c')](_0x48c869[_0xe7ba('0x31')],_0x369451[_0xe7ba('0x3b')]),_0x587c7d);if(_0x48c869[_0xe7ba('0x31')]['filter']){_0x92fe7[_0xe7ba('0x3d')]=_[_0xe7ba('0x3e')](_0x92fe7[_0xe7ba('0x3d')],{'$or':_[_0xe7ba('0x2b')](_0x587c7d,function(_0x5e9619){if(_0x5e9619[_0xe7ba('0x3f')]!==_0xe7ba('0x40')){var _0x46e31a={};_0x46e31a[_0x5e9619[_0xe7ba('0x29')]]={'$like':'%'+_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x41')]+'%'};return _0x46e31a;}})});}_0x92fe7=_[_0xe7ba('0x3e')]({},_0x92fe7,_0x48c869['options']);var _0x3429fa={'where':_0x92fe7[_0xe7ba('0x3d')]};return db[_0xe7ba('0x2c')][_0xe7ba('0x1f')](_0x3429fa)[_0xe7ba('0x26')](function(_0x3b3abe){_0x4bf5f9[_0xe7ba('0x1f')]=_0x3b3abe;if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x42')]){_0x92fe7['include']=[{'all':!![]}];}return db[_0xe7ba('0x2c')][_0xe7ba('0x43')](_0x92fe7);})['then'](function(_0x5dae52){_0x4bf5f9[_0xe7ba('0x44')]=_0x5dae52;return _0x4bf5f9;})[_0xe7ba('0x26')](respondWithFilteredResult(_0x102925,_0x92fe7))[_0xe7ba('0x45')](handleError(_0x102925,null));};exports['show']=function(_0x249e1d,_0x82246e){var _0x3569b6={'raw':![],'where':{'id':_0x249e1d[_0xe7ba('0x46')]['id']}},_0x12770d={};_0x12770d['model']=_[_0xe7ba('0x32')](db['ScreenRecording'][_0xe7ba('0x2d')]);_0x12770d[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x249e1d[_0xe7ba('0x31')]);_0x12770d[_0xe7ba('0x3b')]=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],_0x12770d[_0xe7ba('0x31')]);_0x3569b6['attributes']=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x249e1d[_0xe7ba('0x31')][_0xe7ba('0x35')]));_0x3569b6[_0xe7ba('0x34')]=_0x3569b6[_0xe7ba('0x34')][_0xe7ba('0x36')]?_0x3569b6[_0xe7ba('0x34')]:_0x12770d[_0xe7ba('0x30')];if(_0x249e1d['query'][_0xe7ba('0x42')]){_0x3569b6['include']=[{'all':!![]}];}_0x3569b6=_[_0xe7ba('0x3e')]({},_0x3569b6,_0x249e1d[_0xe7ba('0x47')]);return db[_0xe7ba('0x2c')][_0xe7ba('0x48')](_0x3569b6)[_0xe7ba('0x26')](handleEntityNotFound(_0x82246e,null))[_0xe7ba('0x26')](respondWithResult(_0x82246e,null))['catch'](handleError(_0x82246e,null));};exports[_0xe7ba('0x49')]=function(_0x1cc668,_0x3f17ed){return db[_0xe7ba('0x2c')][_0xe7ba('0x49')](_0x1cc668[_0xe7ba('0x4a')],{})[_0xe7ba('0x26')](respondWithResult(_0x3f17ed,0xc9))[_0xe7ba('0x45')](handleError(_0x3f17ed,null));};exports[_0xe7ba('0x25')]=function(_0x1189bd,_0xbe2a32){if(_0x1189bd['body']['id']){delete _0x1189bd[_0xe7ba('0x4a')]['id'];}delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4b')];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4c')];delete _0x1189bd[_0xe7ba('0x4a')]['closedAt'];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4d')];return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x1189bd[_0xe7ba('0x46')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0xbe2a32,null))[_0xe7ba('0x26')](saveUpdates(_0x1189bd['body'],null))['then'](respondWithResult(_0xbe2a32,null))[_0xe7ba('0x45')](handleError(_0xbe2a32,null));};exports[_0xe7ba('0x4e')]=function(_0x285743,_0x5af106){return db[_0xe7ba('0x2c')][_0xe7ba('0x4e')]()[_0xe7ba('0x26')](respondWithResult(_0x5af106,null))[_0xe7ba('0x45')](handleError(_0x5af106,null));};exports[_0xe7ba('0x4f')]=function(_0x6b6f1,_0xf3a41f,_0x5e6612){var _0x2a6fdd=require(_0xe7ba('0x50'));var _0x316b51=![];var _0x5863c8={};if(_0x6b6f1[_0xe7ba('0x31')][_0xe7ba('0x3f')]&&_0x6b6f1['query'][_0xe7ba('0x3f')]===_0xe7ba('0x51')){_0x5863c8['uniqueid']=_0x6b6f1[_0xe7ba('0x46')]['id'];}else{_0x5863c8['id']=_0x6b6f1['params']['id'];}return db[_0xe7ba('0x2c')][_0xe7ba('0x48')]({'where':_0x5863c8,'attributes':['id',_0xe7ba('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0xf3a41f,null))[_0xe7ba('0x26')](function(_0x1128be){if(_0x1128be){var _0x314549=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],'server/files/screen_recordings',_0x1128be[_0xe7ba('0x4d')]);var _0x455e50=util[_0xe7ba('0x54')](_0xe7ba('0x55'),_0x314549);if(fs[_0xe7ba('0x56')](_0x455e50)){_0x316b51=!![];return _0x2a6fdd['decryptFile'](_0x455e50,_0x314549,config[_0xe7ba('0x57')][_0xe7ba('0x58')])[_0xe7ba('0x26')](function(){return _0x1128be;});}return _0x1128be;}})[_0xe7ba('0x26')](function(_0x57b23e){if(_0x57b23e){var _0x3e31c1=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],_0xe7ba('0x59'),_0x57b23e[_0xe7ba('0x4d')]);if(!fs[_0xe7ba('0x56')](_0x3e31c1)){throw new db['Sequelize'][(_0xe7ba('0x5a'))](_0xe7ba('0x5b'));}if(_0x57b23e[_0xe7ba('0x5c')]){return _0xf3a41f['download'](_0x3e31c1,_0x57b23e[_0xe7ba('0x5c')]+path[_0xe7ba('0x5d')](_0x3e31c1),function(){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}else{return _0xf3a41f[_0xe7ba('0x4f')](_0x3e31c1,function(_0x45fb0f){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}}})[_0xe7ba('0x45')](function(_0x3351d5){if(_0x3351d5[_0xe7ba('0x5f')]===_0xe7ba('0x5b')){_0xf3a41f[_0xe7ba('0x1b')](0x194)[_0xe7ba('0x60')]('Not\x20found');}else{return handleError(_0xf3a41f,null);}});};exports[_0xe7ba('0x61')]=function(_0x384cea,_0x357af4){return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x384cea['params']['id']}})[_0xe7ba('0x26')](function(_0x194dff){if(_[_0xe7ba('0x62')](_0x194dff)){throw new ReferenceError('Entity\x20not\x20found');}return _0x194dff;})['then'](function(_0x46d06e){var _0x2812af=path[_0xe7ba('0x52')](config['root'],_0xe7ba('0x59'),_0x46d06e[_0xe7ba('0x4d')]);logger[_0xe7ba('0x63')](_0xe7ba('0x64'),_0x2812af);if(!_[_0xe7ba('0x62')](_0x46d06e['value'])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe7ba('0x66')](_0x2812af);}_0x2812af=_0x2812af+_0xe7ba('0x67');if(!_[_0xe7ba('0x62')](_0x46d06e[_0xe7ba('0x4d')])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+_0xe7ba('0x68'));fs[_0xe7ba('0x66')](_0x2812af);}return _0x46d06e;})[_0xe7ba('0x26')](function(_0x5a5394){if(!_0x5a5394)throw new InternalError();return _0x5a5394[_0xe7ba('0x61')]();})[_0xe7ba('0x26')](function(){_0x357af4[_0xe7ba('0x1b')](0xcc)[_0xe7ba('0x1c')]();})['catch'](handleError(_0x357af4,null));};
\ No newline at end of file
index ead9eab..002e88e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfba2=['path','../../config/environment','./screenRecording.attributes','exports','screen_recordings','interactionid','util','../../config/logger','api','moment','request-promise'];(function(_0x1d8199,_0xe98f8c){var _0x2b8e8d=function(_0x44283d){while(--_0x44283d){_0x1d8199['push'](_0x1d8199['shift']());}};_0x2b8e8d(++_0xe98f8c);}(_0xfba2,0x95));var _0x2fba=function(_0xcf7a81,_0x1338b9){_0xcf7a81=_0xcf7a81-0x0;var _0x22dd8a=_0xfba2[_0xcf7a81];return _0x22dd8a;};'use strict';var _=require('lodash');var util=require(_0x2fba('0x0'));var logger=require(_0x2fba('0x1'))(_0x2fba('0x2'));var moment=require(_0x2fba('0x3'));var BPromise=require('bluebird');var rp=require(_0x2fba('0x4'));var fs=require('fs');var path=require(_0x2fba('0x5'));var rimraf=require('rimraf');var config=require(_0x2fba('0x6'));var attributes=require(_0x2fba('0x7'));module[_0x2fba('0x8')]=function(_0x5a834a,_0x517ffc){return _0x5a834a['define']('ScreenRecording',attributes,{'tableName':_0x2fba('0x9'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x2fba('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xecc4=['exports','define','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xd86cd4,_0x37c142){var _0x5358d6=function(_0x51590c){while(--_0x51590c){_0xd86cd4['push'](_0xd86cd4['shift']());}};_0x5358d6(++_0x37c142);}(_0xecc4,0x1d9));var _0x4ecc=function(_0x5b3300,_0x3f7b35){_0x5b3300=_0x5b3300-0x0;var _0xe6e6bf=_0xecc4[_0x5b3300];return _0xe6e6bf;};'use strict';var _=require('lodash');var util=require(_0x4ecc('0x0'));var logger=require(_0x4ecc('0x1'))('api');var moment=require(_0x4ecc('0x2'));var BPromise=require(_0x4ecc('0x3'));var rp=require(_0x4ecc('0x4'));var fs=require('fs');var path=require(_0x4ecc('0x5'));var rimraf=require('rimraf');var config=require(_0x4ecc('0x6'));var attributes=require('./screenRecording.attributes');module[_0x4ecc('0x7')]=function(_0x3e6847,_0x2e758d){return _0x3e6847[_0x4ecc('0x8')](_0x4ecc('0x9'),attributes,{'tableName':_0x4ecc('0xa'),'paranoid':![],'indexes':[{'name':_0x4ecc('0xb'),'fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
index 1a70eda..2626370 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8699=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x430205,_0x328c94){var _0x3f5146=function(_0x3cd6bd){while(--_0x3cd6bd){_0x430205['push'](_0x430205['shift']());}};_0x3f5146(++_0x328c94);}(_0x8699,0x109));var _0x9869=function(_0x5541ae,_0x4a902d){_0x5541ae=_0x5541ae-0x0;var _0x42adf6=_0x8699[_0x5541ae];return _0x42adf6;};'use strict';var _=require(_0x9869('0x0'));var util=require('util');var moment=require(_0x9869('0x1'));var BPromise=require(_0x9869('0x2'));var rs=require(_0x9869('0x3'));var fs=require('fs');var Redis=require(_0x9869('0x4'));var db=require(_0x9869('0x5'))['db'];var utils=require(_0x9869('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9869('0x7'));var client=jayson[_0x9869('0x8')][_0x9869('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33976a,_0x2376f1,_0x2c30dc){return new BPromise(function(_0x445496,_0x4b34ba){return client[_0x9869('0xa')](_0x33976a,_0x2c30dc)[_0x9869('0xb')](function(_0x587fa5){logger[_0x9869('0xc')](_0x9869('0xd'),_0x2376f1,_0x9869('0xe'));logger[_0x9869('0xf')](_0x9869('0x10'),_0x2376f1,'request\x20sent',JSON[_0x9869('0x11')](_0x587fa5));if(_0x587fa5['error']){if(_0x587fa5[_0x9869('0x12')][_0x9869('0x13')]===0x1f4){logger[_0x9869('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x2376f1,_0x587fa5[_0x9869('0x12')][_0x9869('0x14')]);return _0x4b34ba(_0x587fa5['error'][_0x9869('0x14')]);}logger[_0x9869('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x2376f1,_0x587fa5['error'][_0x9869('0x14')]);return _0x445496(_0x587fa5[_0x9869('0x12')][_0x9869('0x14')]);}else{logger[_0x9869('0xc')](_0x9869('0xd'),_0x2376f1,_0x9869('0xe'));_0x445496(_0x587fa5['result'][_0x9869('0x14')]);}})[_0x9869('0x15')](function(_0x2e8546){logger[_0x9869('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x2376f1,_0x2e8546);_0x4b34ba(_0x2e8546);});});}
\ No newline at end of file
+var _0xb4a5=['result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','error','message','info'];(function(_0x39acf0,_0x1d1829){var _0x108857=function(_0xdd7c81){while(--_0xdd7c81){_0x39acf0['push'](_0x39acf0['shift']());}};_0x108857(++_0x1d1829);}(_0xb4a5,0x87));var _0x5b4a=function(_0x34b152,_0x37678b){_0x34b152=_0x34b152-0x0;var _0x360a8c=_0xb4a5[_0x34b152];return _0x360a8c;};'use strict';var _=require('lodash');var util=require(_0x5b4a('0x0'));var moment=require(_0x5b4a('0x1'));var BPromise=require(_0x5b4a('0x2'));var rs=require(_0x5b4a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b4a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b4a('0x5'))('rpc');var config=require(_0x5b4a('0x6'));var jayson=require(_0x5b4a('0x7'));var client=jayson[_0x5b4a('0x8')][_0x5b4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfec49,_0x16b562,_0x3c11cb){return new BPromise(function(_0x33ced9,_0x82f9ad){return client['request'](_0xfec49,_0x3c11cb)[_0x5b4a('0xa')](function(_0x2d0072){logger['info'](_0x5b4a('0xb'),_0x16b562,_0x5b4a('0xc'));logger[_0x5b4a('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x16b562,_0x5b4a('0xc'),JSON['stringify'](_0x2d0072));if(_0x2d0072['error']){if(_0x2d0072[_0x5b4a('0xe')]['code']===0x1f4){logger['error'](_0x5b4a('0xb'),_0x16b562,_0x2d0072['error'][_0x5b4a('0xf')]);return _0x82f9ad(_0x2d0072[_0x5b4a('0xe')][_0x5b4a('0xf')]);}logger['error'](_0x5b4a('0xb'),_0x16b562,_0x2d0072['error'][_0x5b4a('0xf')]);return _0x33ced9(_0x2d0072[_0x5b4a('0xe')][_0x5b4a('0xf')]);}else{logger[_0x5b4a('0x10')](_0x5b4a('0xb'),_0x16b562,_0x5b4a('0xc'));_0x33ced9(_0x2d0072[_0x5b4a('0x11')][_0x5b4a('0xf')]);}})[_0x5b4a('0x12')](function(_0x1b350c){logger['error'](_0x5b4a('0xb'),_0x16b562,_0x1b350c);_0x82f9ad(_0x1b350c);});});}
\ No newline at end of file
index 48ca5a2..2d89796 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ea4=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','logo','extname','originalname','file','format','logologin','post','single','addLogoLogin','preferred','favicon','/:id/favicon','put','update','exports','multer','util'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5ea4,0x181));var _0x45ea=function(_0x4b3d8b,_0xe8da7f){_0x4b3d8b=_0x4b3d8b-0x0;var _0x50878b=_0x5ea4[_0x4b3d8b];return _0x50878b;};'use strict';var multer=require(_0x45ea('0x0'));var util=require(_0x45ea('0x1'));var path=require(_0x45ea('0x2'));var timeout=require(_0x45ea('0x3'));var express=require(_0x45ea('0x4'));var router=express[_0x45ea('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x45ea('0x6'));var interaction=require(_0x45ea('0x7'));var config=require(_0x45ea('0x8'));var controller=require(_0x45ea('0x9'));router[_0x45ea('0xa')]('/',auth[_0x45ea('0xb')](),controller[_0x45ea('0xc')]);router[_0x45ea('0xa')](_0x45ea('0xd'),controller['getDate']);router[_0x45ea('0xa')](_0x45ea('0xe'),controller['show']);router['get'](_0x45ea('0xf'),controller[_0x45ea('0x10')]);router[_0x45ea('0xa')](_0x45ea('0x11'),controller['getLogoLogin']);router[_0x45ea('0xa')](_0x45ea('0x12'),controller[_0x45ea('0x13')]);router[_0x45ea('0xa')](_0x45ea('0x14'),controller[_0x45ea('0x15')]);router[_0x45ea('0xa')]('/:id/favicon',controller[_0x45ea('0x16')]);var upload=multer({'storage':multer[_0x45ea('0x17')]({'destination':function(_0x2078b5,_0x3e7436,_0x3745c2){_0x3745c2(null,path[_0x45ea('0x18')](config[_0x45ea('0x19')],_0x45ea('0x1a')));},'filename':function(_0x5ac8bc,_0x17524c,_0x394f3b){_0x394f3b(null,util['format'](_0x45ea('0x1b'),_0x45ea('0x1c'),path[_0x45ea('0x1d')](_0x17524c[_0x45ea('0x1e')])));}})});router['post'](_0x45ea('0xf'),upload['single'](_0x45ea('0x1f')),controller['addLogo']);var upload=multer({'storage':multer[_0x45ea('0x17')]({'destination':function(_0x53c59f,_0x11669a,_0x589814){_0x589814(null,path['join'](config[_0x45ea('0x19')],_0x45ea('0x1a')));},'filename':function(_0x539689,_0x45e533,_0x4707ad){_0x4707ad(null,util[_0x45ea('0x20')](_0x45ea('0x1b'),_0x45ea('0x21'),path[_0x45ea('0x1d')](_0x45e533[_0x45ea('0x1e')])));}})});router[_0x45ea('0x22')](_0x45ea('0x11'),upload[_0x45ea('0x23')](_0x45ea('0x1f')),controller[_0x45ea('0x24')]);var upload=multer({'storage':multer[_0x45ea('0x17')]({'destination':function(_0x1708c5,_0x1ef917,_0x3f5718){_0x3f5718(null,path['join'](config[_0x45ea('0x19')],_0x45ea('0x1a')));},'filename':function(_0x378279,_0x5e0ef3,_0x478c9c){_0x478c9c(null,util[_0x45ea('0x20')](_0x45ea('0x1b'),_0x45ea('0x25'),path[_0x45ea('0x1d')](_0x5e0ef3['originalname'])));}})});router[_0x45ea('0x22')](_0x45ea('0x14'),upload['single'](_0x45ea('0x1f')),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54ae1f,_0x32e816,_0x23840b){_0x23840b(null,path[_0x45ea('0x18')](config[_0x45ea('0x19')],'server/files/images/logos/'));},'filename':function(_0x555741,_0x3a282f,_0x22b154){_0x22b154(null,util['format'](_0x45ea('0x1b'),_0x45ea('0x26'),path[_0x45ea('0x1d')](_0x3a282f[_0x45ea('0x1e')])));}})});router[_0x45ea('0x22')](_0x45ea('0x27'),upload[_0x45ea('0x23')](_0x45ea('0x1f')),controller['addFavicon']);router[_0x45ea('0x28')]('/:id',auth[_0x45ea('0xb')](),controller[_0x45ea('0x29')]);module[_0x45ea('0x2a')]=router;
\ No newline at end of file
+var _0x2e95=['../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','format','%s%s','logo','originalname','single','root','server/files/images/logos/','logologin','extname','file','addLogoLogin','preferred','post','addPreferred','favicon','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x468edb,_0x39ce26){var _0x501507=function(_0x1e4f87){while(--_0x1e4f87){_0x468edb['push'](_0x468edb['shift']());}};_0x501507(++_0x39ce26);}(_0x2e95,0x1cf));var _0x52e9=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x2e95[_0x490be3];return _0x3f5140;};'use strict';var multer=require(_0x52e9('0x0'));var util=require(_0x52e9('0x1'));var path=require(_0x52e9('0x2'));var timeout=require(_0x52e9('0x3'));var express=require(_0x52e9('0x4'));var router=express[_0x52e9('0x5')]();var fs_extra=require(_0x52e9('0x6'));var auth=require(_0x52e9('0x7'));var interaction=require(_0x52e9('0x8'));var config=require(_0x52e9('0x9'));var controller=require(_0x52e9('0xa'));router['get']('/',auth[_0x52e9('0xb')](),controller[_0x52e9('0xc')]);router[_0x52e9('0xd')](_0x52e9('0xe'),controller[_0x52e9('0xf')]);router[_0x52e9('0xd')](_0x52e9('0x10'),controller[_0x52e9('0x11')]);router[_0x52e9('0xd')](_0x52e9('0x12'),controller[_0x52e9('0x13')]);router[_0x52e9('0xd')](_0x52e9('0x14'),controller[_0x52e9('0x15')]);router['get'](_0x52e9('0x16'),controller[_0x52e9('0x17')]);router[_0x52e9('0xd')](_0x52e9('0x18'),controller[_0x52e9('0x19')]);router['get'](_0x52e9('0x1a'),controller[_0x52e9('0x1b')]);var upload=multer({'storage':multer[_0x52e9('0x1c')]({'destination':function(_0x2a6bde,_0x7475e7,_0x5e511c){_0x5e511c(null,path[_0x52e9('0x1d')](config['root'],'server/files/images/logos/'));},'filename':function(_0x2c9e8f,_0x43c39e,_0x5ddd0e){_0x5ddd0e(null,util[_0x52e9('0x1e')](_0x52e9('0x1f'),_0x52e9('0x20'),path['extname'](_0x43c39e[_0x52e9('0x21')])));}})});router['post']('/:id/logo',upload[_0x52e9('0x22')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x52e9('0x1c')]({'destination':function(_0x103cd2,_0x43229e,_0x15d57f){_0x15d57f(null,path[_0x52e9('0x1d')](config[_0x52e9('0x23')],_0x52e9('0x24')));},'filename':function(_0xc39d86,_0x1b4d46,_0x33bc88){_0x33bc88(null,util[_0x52e9('0x1e')](_0x52e9('0x1f'),_0x52e9('0x25'),path[_0x52e9('0x26')](_0x1b4d46['originalname'])));}})});router['post'](_0x52e9('0x14'),upload[_0x52e9('0x22')](_0x52e9('0x27')),controller[_0x52e9('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x273ecd,_0x12024c,_0x45a723){_0x45a723(null,path[_0x52e9('0x1d')](config[_0x52e9('0x23')],_0x52e9('0x24')));},'filename':function(_0x2da410,_0x545890,_0x2ea74e){_0x2ea74e(null,util[_0x52e9('0x1e')](_0x52e9('0x1f'),_0x52e9('0x29'),path[_0x52e9('0x26')](_0x545890['originalname'])));}})});router[_0x52e9('0x2a')]('/:id/preferred',upload[_0x52e9('0x22')](_0x52e9('0x27')),controller[_0x52e9('0x2b')]);var upload=multer({'storage':multer[_0x52e9('0x1c')]({'destination':function(_0x8710c2,_0x26a001,_0x425e7f){_0x425e7f(null,path[_0x52e9('0x1d')](config[_0x52e9('0x23')],'server/files/images/logos/'));},'filename':function(_0x2b33a1,_0x1d3d92,_0x1b7c57){_0x1b7c57(null,util[_0x52e9('0x1e')](_0x52e9('0x1f'),_0x52e9('0x2c'),path['extname'](_0x1d3d92[_0x52e9('0x21')])));}})});router[_0x52e9('0x2a')](_0x52e9('0x1a'),upload[_0x52e9('0x22')](_0x52e9('0x27')),controller['addFavicon']);router['put'](_0x52e9('0x10'),auth[_0x52e9('0xb')](),controller[_0x52e9('0x2d')]);module[_0x52e9('0x2e')]=router;
\ No newline at end of file
index bee6647..7b1ca88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','sequelize','exports','INTEGER','min_internal'];(function(_0x209425,_0x40fbba){var _0xd880a8=function(_0x15b320){while(--_0x15b320){_0x209425['push'](_0x209425['shift']());}};_0xd880a8(++_0x40fbba);}(_0x2ef3,0xba));var _0x32ef=function(_0x59f68b,_0x50ba79){_0x59f68b=_0x59f68b-0x0;var _0x32ba9e=_0x2ef3[_0x59f68b];return _0x32ba9e;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'min_internal':{'type':Sequelize[_0x32ef('0x2')](0xb),'unique':_0x32ef('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x32ef('0x2')](0xb),'unique':_0x32ef('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':_0x32ef('0x6')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x32ef('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x32ef('0x5')]},'turnaddr':{'type':Sequelize[_0x32ef('0x5')]},'turnusername':{'type':Sequelize[_0x32ef('0x5')]},'turnpassword':{'type':Sequelize[_0x32ef('0x5')]},'pageTitle':{'type':Sequelize[_0x32ef('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':_0x32ef('0x8')},'enableEmailPreview':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x32ef('0x5')]},'defaultFavicon':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x32ef('0x2')]},'transcribeRegion':{'type':Sequelize[_0x32ef('0x5')]},'sentiment':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x32ef('0x5')]},'language':{'type':Sequelize[_0x32ef('0x5')]},'bucket':{'type':Sequelize[_0x32ef('0x5')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x32ef('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0xadb5=['https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','exports','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0xadb5,0xad));var _0x5adb=function(_0x2df465,_0xc15cdb){_0x2df465=_0x2df465-0x0;var _0x52b9cb=_0xadb5[_0x2df465];return _0x52b9cb;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x5adb('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x5adb('0x2')](0xb),'unique':_0x5adb('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':_0x5adb('0x5')},'logo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5adb('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnusername':{'type':Sequelize[_0x5adb('0x4')]},'turnpassword':{'type':Sequelize[_0x5adb('0x4')]},'pageTitle':{'type':Sequelize[_0x5adb('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x5adb('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x5adb('0x7')},'enableEmailPreview':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x5adb('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x5adb('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x5adb('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x5adb('0x2')]},'transcribeRegion':{'type':Sequelize[_0x5adb('0x4')]},'sentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x5adb('0x2')]},'sentimentRegion':{'type':Sequelize[_0x5adb('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x5adb('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x5adb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]}};
\ No newline at end of file
index 103c171..09a9f32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8b7=['order','sort','where','filter','options','includeAll','include','show','params','find','body','addLogo','file','logo','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','default_loginLogo.svg','Sequelize','gdpr','addPreferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','utcOffset','now','format','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','destroy','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x41a6a2,_0x396ae0){var _0x1f369c=function(_0x2406c4){while(--_0x2406c4){_0x41a6a2['push'](_0x41a6a2['shift']());}};_0x1f369c(++_0x396ae0);}(_0xb8b7,0x114));var _0x7b8b=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xb8b7[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b8b('0x0'));var BPromise=require(_0x7b8b('0x1'));var Mustache=require(_0x7b8b('0x2'));var util=require('util');var path=require(_0x7b8b('0x3'));var sox=require(_0x7b8b('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b8b('0x5'));var _=require(_0x7b8b('0x6'));var squel=require(_0x7b8b('0x7'));var crypto=require(_0x7b8b('0x8'));var jsforce=require(_0x7b8b('0x9'));var deskjs=require(_0x7b8b('0xa'));var toCsv=require(_0x7b8b('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7b8b('0xc'));var authService=require(_0x7b8b('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b8b('0xe'));var logger=require(_0x7b8b('0xf'))(_0x7b8b('0x10'));var utils=require(_0x7b8b('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x7b8b('0x12'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7b8b('0x13'));var client=jayson['client'][_0x7b8b('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x23d19c,_0x213a64,_0x3c5a24,_0x5df638){return new BPromise(function(_0x47791d,_0x3f0cdc){var _0x4616d8=_0x5df638||client;return _0x4616d8[_0x7b8b('0x15')](_0x23d19c,_0x3c5a24)[_0x7b8b('0x16')](function(_0x9a8531){logger[_0x7b8b('0x17')](_0x7b8b('0x18'),_0x213a64,_0x7b8b('0x19'));logger[_0x7b8b('0x1a')](_0x7b8b('0x1b'),_0x213a64,'request\x20sent',JSON['stringify'](_0x9a8531));if(_0x9a8531[_0x7b8b('0x1c')]){if(_0x9a8531[_0x7b8b('0x1c')][_0x7b8b('0x1d')]===0x1f4){logger[_0x7b8b('0x1c')](_0x7b8b('0x18'),_0x213a64,_0x9a8531['error'][_0x7b8b('0x1e')]);return _0x3f0cdc(_0x9a8531[_0x7b8b('0x1c')][_0x7b8b('0x1e')]);}logger[_0x7b8b('0x1c')](_0x7b8b('0x18'),_0x213a64,_0x9a8531[_0x7b8b('0x1c')][_0x7b8b('0x1e')]);return _0x47791d(_0x9a8531[_0x7b8b('0x1c')][_0x7b8b('0x1e')]);}else{logger['info'](_0x7b8b('0x18'),_0x213a64,_0x7b8b('0x19'));_0x47791d(_0x9a8531[_0x7b8b('0x1f')]['message']);}})[_0x7b8b('0x20')](function(_0x1bb0d2){logger[_0x7b8b('0x1c')]('Setting,\x20%s,\x20%s',_0x213a64,_0x1bb0d2);_0x3f0cdc(_0x1bb0d2);});});}function respondWithStatusCode(_0x48db41,_0x173d36){_0x173d36=_0x173d36||0xcc;return function(_0x17d2b6){if(_0x17d2b6){return _0x48db41[_0x7b8b('0x21')](_0x173d36);}return _0x48db41[_0x7b8b('0x22')](_0x173d36)[_0x7b8b('0x23')]();};}function respondWithResult(_0xcca4,_0x106993){_0x106993=_0x106993||0xc8;return function(_0x14c51c){if(_0x14c51c){return _0xcca4['status'](_0x106993)['json'](_0x14c51c);}};}function respondWithFilteredResult(_0x95d76,_0x1a8a03){return function(_0x5a6b8e){if(_0x5a6b8e){var _0x12a015=typeof _0x1a8a03['offset']===_0x7b8b('0x24')&&typeof _0x1a8a03[_0x7b8b('0x25')]===_0x7b8b('0x24');var _0x1fef87=_0x5a6b8e[_0x7b8b('0x26')];var _0x593070=_0x12a015?0x0:_0x1a8a03[_0x7b8b('0x27')];var _0x53c6c4=_0x12a015?_0x5a6b8e[_0x7b8b('0x26')]:_0x1a8a03[_0x7b8b('0x27')]+_0x1a8a03[_0x7b8b('0x25')];var _0x2de27c;if(_0x53c6c4>=_0x1fef87){_0x53c6c4=_0x1fef87;_0x2de27c=0xc8;}else{_0x2de27c=0xce;}_0x95d76[_0x7b8b('0x22')](_0x2de27c);return _0x95d76[_0x7b8b('0x28')](_0x7b8b('0x29'),_0x593070+'-'+_0x53c6c4+'/'+_0x1fef87)[_0x7b8b('0x2a')](_0x5a6b8e);}return null;};}function patchUpdates(_0x26bcdc){return function(_0x564d7e){try{jsonpatch[_0x7b8b('0x2b')](_0x564d7e,_0x26bcdc,!![]);}catch(_0x250074){return BPromise[_0x7b8b('0x2c')](_0x250074);}return _0x564d7e['save']();};}function saveUpdates(_0x3ba29d,_0x57ad8e){return function(_0x5a09d6){if(_0x5a09d6){return _0x5a09d6[_0x7b8b('0x2d')](_0x3ba29d)[_0x7b8b('0x16')](function(_0x2db8b6){return _0x2db8b6;});}return null;};}function removeEntity(_0x25f7c1,_0x269cd6){return function(_0x95a28d){if(_0x95a28d){return _0x95a28d[_0x7b8b('0x2e')]()['then'](function(){_0x25f7c1[_0x7b8b('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x281f36,_0x392625){return function(_0x511539){if(!_0x511539){_0x281f36[_0x7b8b('0x21')](0x194);}return _0x511539;};}function handleError(_0xb44565,_0x2aea40){_0x2aea40=_0x2aea40||0x1f4;return function(_0x3e4704){logger[_0x7b8b('0x1c')](_0x3e4704['stack']);if(_0x3e4704[_0x7b8b('0x2f')]){delete _0x3e4704[_0x7b8b('0x2f')];}_0xb44565[_0x7b8b('0x22')](_0x2aea40)[_0x7b8b('0x30')](_0x3e4704);};}exports[_0x7b8b('0x31')]=function(_0x26ed8d,_0x281854){var _0x417826={},_0x14200a={},_0x4c6242={'count':0x0,'rows':[]};var _0x2e9462=_[_0x7b8b('0x32')](db[_0x7b8b('0x33')][_0x7b8b('0x34')],function(_0x5df136){return{'name':_0x5df136[_0x7b8b('0x35')],'type':_0x5df136[_0x7b8b('0x36')][_0x7b8b('0x37')]};});_0x14200a[_0x7b8b('0x38')]=_[_0x7b8b('0x32')](_0x2e9462,_0x7b8b('0x2f'));_0x14200a[_0x7b8b('0x39')]=_[_0x7b8b('0x3a')](_0x26ed8d['query']);_0x14200a[_0x7b8b('0x3b')]=_[_0x7b8b('0x3c')](_0x14200a['model'],_0x14200a['query']);_0x417826[_0x7b8b('0x3d')]=_[_0x7b8b('0x3c')](_0x14200a['model'],qs['fields'](_0x26ed8d['query'][_0x7b8b('0x3e')]));_0x417826['attributes']=_0x417826[_0x7b8b('0x3d')][_0x7b8b('0x3f')]?_0x417826['attributes']:_0x14200a[_0x7b8b('0x38')];if(!_0x26ed8d[_0x7b8b('0x39')][_0x7b8b('0x40')](_0x7b8b('0x41'))){_0x417826[_0x7b8b('0x25')]=qs[_0x7b8b('0x25')](_0x26ed8d[_0x7b8b('0x39')][_0x7b8b('0x25')]);_0x417826[_0x7b8b('0x27')]=qs[_0x7b8b('0x27')](_0x26ed8d[_0x7b8b('0x39')][_0x7b8b('0x27')]);}_0x417826[_0x7b8b('0x42')]=qs[_0x7b8b('0x43')](_0x26ed8d[_0x7b8b('0x39')][_0x7b8b('0x43')]);_0x417826[_0x7b8b('0x44')]=qs[_0x7b8b('0x3b')](_['pick'](_0x26ed8d[_0x7b8b('0x39')],_0x14200a['filters']),_0x2e9462);if(_0x26ed8d[_0x7b8b('0x39')][_0x7b8b('0x45')]){_0x417826[_0x7b8b('0x44')]=_['merge'](_0x417826['where'],{'$or':_['map'](_0x2e9462,function(_0x2fadbe){if(_0x2fadbe[_0x7b8b('0x36')]!=='VIRTUAL'){var _0x2f5190={};_0x2f5190[_0x2fadbe[_0x7b8b('0x2f')]]={'$like':'%'+_0x26ed8d['query'][_0x7b8b('0x45')]+'%'};return _0x2f5190;}})});}_0x417826=_['merge']({},_0x417826,_0x26ed8d[_0x7b8b('0x46')]);var _0x2c0568={'where':_0x417826[_0x7b8b('0x44')]};return db[_0x7b8b('0x33')]['count'](_0x2c0568)[_0x7b8b('0x16')](function(_0x582793){_0x4c6242[_0x7b8b('0x26')]=_0x582793;if(_0x26ed8d[_0x7b8b('0x39')][_0x7b8b('0x47')]){_0x417826[_0x7b8b('0x48')]=[{'all':!![]}];}return db[_0x7b8b('0x33')]['findAll'](_0x417826);})[_0x7b8b('0x16')](function(_0x1f507d){_0x4c6242['rows']=_0x1f507d;return _0x4c6242;})['then'](respondWithFilteredResult(_0x281854,_0x417826))['catch'](handleError(_0x281854,null));};exports[_0x7b8b('0x49')]=function(_0x161278,_0x3d8355){var _0x51abbb={'raw':![],'where':{'id':_0x161278[_0x7b8b('0x4a')]['id']}},_0x222cb8={};_0x222cb8['model']=_[_0x7b8b('0x3a')](db[_0x7b8b('0x33')][_0x7b8b('0x34')]);_0x222cb8['query']=_[_0x7b8b('0x3a')](_0x161278[_0x7b8b('0x39')]);_0x222cb8['filters']=_['intersection'](_0x222cb8[_0x7b8b('0x38')],_0x222cb8['query']);_0x51abbb['attributes']=_[_0x7b8b('0x3c')](_0x222cb8[_0x7b8b('0x38')],qs[_0x7b8b('0x3e')](_0x161278[_0x7b8b('0x39')][_0x7b8b('0x3e')]));_0x51abbb[_0x7b8b('0x3d')]=_0x51abbb[_0x7b8b('0x3d')][_0x7b8b('0x3f')]?_0x51abbb[_0x7b8b('0x3d')]:_0x222cb8[_0x7b8b('0x38')];if(_0x161278['query'][_0x7b8b('0x47')]){_0x51abbb[_0x7b8b('0x48')]=[{'all':!![]}];}_0x51abbb=_['merge']({},_0x51abbb,_0x161278['options']);return db[_0x7b8b('0x33')][_0x7b8b('0x4b')](_0x51abbb)['then'](handleEntityNotFound(_0x3d8355,null))[_0x7b8b('0x16')](respondWithResult(_0x3d8355,null))[_0x7b8b('0x20')](handleError(_0x3d8355,null));};exports[_0x7b8b('0x2d')]=function(_0x298952,_0x458b05){if(_0x298952[_0x7b8b('0x4c')]['id']){delete _0x298952[_0x7b8b('0x4c')]['id'];}return db['Setting'][_0x7b8b('0x4b')]({'where':{'id':_0x298952[_0x7b8b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x458b05,null))[_0x7b8b('0x16')](saveUpdates(_0x298952['body'],null))[_0x7b8b('0x16')](respondWithResult(_0x458b05,null))[_0x7b8b('0x20')](handleError(_0x458b05,null));};exports[_0x7b8b('0x4d')]=function(_0x3092a5,_0x2ee9d4,_0x3d3780){if(_0x3092a5[_0x7b8b('0x4e')]&&_0x3092a5['file']['filename']){_0x3092a5['body'][_0x7b8b('0x4f')]=_0x3092a5[_0x7b8b('0x4e')][_0x7b8b('0x50')];}return db[_0x7b8b('0x33')][_0x7b8b('0x4b')]({'where':{'id':_0x3092a5['params']['id']}})['then'](handleEntityNotFound(_0x2ee9d4,null))[_0x7b8b('0x16')](saveUpdates(_0x3092a5['body'],null))[_0x7b8b('0x16')](respondWithResult(_0x2ee9d4,null))[_0x7b8b('0x20')](handleError(_0x2ee9d4,null));};exports[_0x7b8b('0x51')]=function(_0x513ef0,_0xa0925c,_0x4e36c5){if(_0x513ef0[_0x7b8b('0x4e')]&&_0x513ef0[_0x7b8b('0x4e')][_0x7b8b('0x50')]){_0x513ef0[_0x7b8b('0x4c')][_0x7b8b('0x52')]=_0x513ef0[_0x7b8b('0x4e')][_0x7b8b('0x50')];}return db['Setting'][_0x7b8b('0x4b')]({'where':{'id':_0x513ef0[_0x7b8b('0x4a')]['id']}})[_0x7b8b('0x16')](handleEntityNotFound(_0xa0925c,null))['then'](saveUpdates(_0x513ef0['body'],null))[_0x7b8b('0x16')](respondWithResult(_0xa0925c,null))[_0x7b8b('0x20')](handleError(_0xa0925c,null));};var utilLicense=require(_0x7b8b('0x12'));exports[_0x7b8b('0x53')]=function(_0x24f596,_0x4eb0c3,_0x3ae166){var _0x4fb094=_0x7b8b('0x54');var _0x1b9c02={'custom':![]};return utilLicense['getLicense']()[_0x7b8b('0x16')](function(_0x374b5a){if(_0x374b5a){_0x1b9c02=_0x374b5a;}return db[_0x7b8b('0x33')][_0x7b8b('0x4b')]({'where':{'id':_0x24f596[_0x7b8b('0x4a')]['id']},'attributes':['logo',_0x7b8b('0x52'),_0x7b8b('0x55'),_0x7b8b('0x56'),'defaultLogo',_0x7b8b('0x57'),_0x7b8b('0x58'),_0x7b8b('0x59')],'raw':!![]});})[_0x7b8b('0x16')](handleEntityNotFound(_0x4eb0c3,null))['then'](function(_0x335116){if(_0x335116){var _0x350242=_0x335116[_0x7b8b('0x4f')]&&fs[_0x7b8b('0x5a')](path[_0x7b8b('0x5b')](config['root'],_0x4fb094,_[_0x7b8b('0x5c')](_0x335116[_0x7b8b('0x4f')])))?path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x4fb094,_[_0x7b8b('0x5c')](_0x335116[_0x7b8b('0x4f')])):path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x4fb094,_['toLower'](_0x7b8b('0x5e')));var _0x27a146=_0x7b8b('0x5f')+_[_0x7b8b('0x60')](_0x7b8b('0x4f'));if(_0x335116[_0x27a146]||!_0x1b9c02[_0x7b8b('0x61')]){_0x350242=path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x4fb094,_['toLower'](_0x7b8b('0x5e')));}if(!fs[_0x7b8b('0x5a')](_0x350242)){throw new db['Sequelize'][(_0x7b8b('0x62'))](_[_0x7b8b('0x60')](_0x7b8b('0x4f'))+_0x7b8b('0x63'));}return _0x4eb0c3[_0x7b8b('0x64')](_0x350242);}})[_0x7b8b('0x20')](handleError(_0x4eb0c3,null));};var utilLicense=require(_0x7b8b('0x12'));exports[_0x7b8b('0x65')]=function(_0x168685,_0x2e335b,_0xc19272){var _0x1c5206=_0x7b8b('0x54');var _0x55f2fb={'custom':![]};return utilLicense[_0x7b8b('0x66')]()[_0x7b8b('0x16')](function(_0x428b5e){if(_0x428b5e){_0x55f2fb=_0x428b5e;}return db[_0x7b8b('0x33')][_0x7b8b('0x4b')]({'where':{'id':_0x168685[_0x7b8b('0x4a')]['id']},'attributes':[_0x7b8b('0x4f'),_0x7b8b('0x52'),_0x7b8b('0x55'),_0x7b8b('0x56'),'defaultLogo',_0x7b8b('0x57'),_0x7b8b('0x58'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x2e335b,null))[_0x7b8b('0x16')](function(_0x44bb11){if(_0x44bb11){var _0x2a0826=_0x44bb11[_0x7b8b('0x52')]&&fs['existsSync'](path['join'](config[_0x7b8b('0x5d')],_0x1c5206,_[_0x7b8b('0x5c')](_0x44bb11[_0x7b8b('0x52')])))?path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x1c5206,_['toLower'](_0x44bb11['loginLogo'])):path['join'](config[_0x7b8b('0x5d')],_0x1c5206,_[_0x7b8b('0x5c')](_0x7b8b('0x67')));var _0x303863=_0x7b8b('0x5f')+_[_0x7b8b('0x60')](_0x7b8b('0x52'));if(_0x44bb11[_0x303863]||!_0x55f2fb['custom']){_0x2a0826=path[_0x7b8b('0x5b')](config['root'],_0x1c5206,_[_0x7b8b('0x5c')](_0x7b8b('0x67')));}if(!fs[_0x7b8b('0x5a')](_0x2a0826)){throw new db[(_0x7b8b('0x68'))]['ValidationError'](_['upperFirst'](_0x7b8b('0x52'))+'\x20not\x20found');}return _0x2e335b[_0x7b8b('0x64')](_0x2a0826);}})['catch'](handleError(_0x2e335b,null));};exports[_0x7b8b('0x69')]=function(_0x246636,_0x4a15a7){return db[_0x7b8b('0x33')]['find']({'where':{'id':_0x246636['params']['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x4a15a7,null))[_0x7b8b('0x20')](handleError(_0x4a15a7,null));};exports[_0x7b8b('0x6a')]=function(_0x99ff43,_0x2d0f3e,_0x36a0a8){if(_0x99ff43['file']&&_0x99ff43[_0x7b8b('0x4e')][_0x7b8b('0x50')]){_0x99ff43[_0x7b8b('0x4c')][_0x7b8b('0x55')]=_0x99ff43[_0x7b8b('0x4e')][_0x7b8b('0x50')];}return db['Setting']['find']({'where':{'id':_0x99ff43[_0x7b8b('0x4a')]['id']}})[_0x7b8b('0x16')](handleEntityNotFound(_0x2d0f3e,null))['then'](saveUpdates(_0x99ff43[_0x7b8b('0x4c')],null))[_0x7b8b('0x16')](respondWithResult(_0x2d0f3e,null))[_0x7b8b('0x20')](handleError(_0x2d0f3e,null));};var utilLicense=require(_0x7b8b('0x12'));exports[_0x7b8b('0x6b')]=function(_0xc2affc,_0x567b31,_0x3c6a3c){var _0x3a65d1=_0x7b8b('0x54');var _0x1777c7={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x16dedd){if(_0x16dedd){_0x1777c7=_0x16dedd;}return db[_0x7b8b('0x33')][_0x7b8b('0x4b')]({'where':{'id':_0xc2affc[_0x7b8b('0x4a')]['id']},'attributes':[_0x7b8b('0x4f'),_0x7b8b('0x52'),_0x7b8b('0x55'),_0x7b8b('0x56'),'defaultLogo',_0x7b8b('0x57'),_0x7b8b('0x58'),_0x7b8b('0x59')],'raw':!![]});})['then'](handleEntityNotFound(_0x567b31,null))[_0x7b8b('0x16')](function(_0x4c9933){if(_0x4c9933){var _0x12c008=_0x4c9933[_0x7b8b('0x55')]&&fs['existsSync'](path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x3a65d1,_[_0x7b8b('0x5c')](_0x4c9933[_0x7b8b('0x55')])))?path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x3a65d1,_[_0x7b8b('0x5c')](_0x4c9933[_0x7b8b('0x55')])):path['join'](config['root'],_0x3a65d1,_[_0x7b8b('0x5c')](_0x7b8b('0x6c')));var _0x29691a=_0x7b8b('0x5f')+_['upperFirst']('preferred');if(_0x4c9933[_0x29691a]||!_0x1777c7[_0x7b8b('0x61')]||!_0x1777c7[_0x7b8b('0x55')]){_0x12c008=path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x3a65d1,_[_0x7b8b('0x5c')](_0x7b8b('0x6c')));}if(!fs[_0x7b8b('0x5a')](_0x12c008)){throw new db['Sequelize'][(_0x7b8b('0x62'))](_['upperFirst']('preferred')+_0x7b8b('0x63'));}return _0x567b31[_0x7b8b('0x64')](_0x12c008);}})[_0x7b8b('0x20')](handleError(_0x567b31,null));};exports['addFavicon']=function(_0x56ecaf,_0x4f2849,_0x4d560e){if(_0x56ecaf[_0x7b8b('0x4e')]&&_0x56ecaf['file'][_0x7b8b('0x50')]){_0x56ecaf[_0x7b8b('0x4c')][_0x7b8b('0x56')]=_0x56ecaf[_0x7b8b('0x4e')][_0x7b8b('0x50')];}return db[_0x7b8b('0x33')][_0x7b8b('0x4b')]({'where':{'id':_0x56ecaf[_0x7b8b('0x4a')]['id']}})[_0x7b8b('0x16')](handleEntityNotFound(_0x4f2849,null))[_0x7b8b('0x16')](saveUpdates(_0x56ecaf[_0x7b8b('0x4c')],null))[_0x7b8b('0x16')](respondWithResult(_0x4f2849,null))[_0x7b8b('0x20')](handleError(_0x4f2849,null));};var utilLicense=require(_0x7b8b('0x12'));exports[_0x7b8b('0x6d')]=function(_0x33efdc,_0x52bafd,_0x78176b){var _0x293d0b=_0x7b8b('0x54');var _0x5d0bf9={'custom':![]};return utilLicense['getLicense']()[_0x7b8b('0x16')](function(_0x400235){if(_0x400235){_0x5d0bf9=_0x400235;}return db[_0x7b8b('0x33')][_0x7b8b('0x4b')]({'where':{'id':_0x33efdc[_0x7b8b('0x4a')]['id']},'attributes':[_0x7b8b('0x4f'),_0x7b8b('0x52'),_0x7b8b('0x55'),'favicon','defaultLogo','defaultLoginLogo',_0x7b8b('0x58'),'defaultFavicon'],'raw':!![]});})[_0x7b8b('0x16')](handleEntityNotFound(_0x52bafd,null))[_0x7b8b('0x16')](function(_0x31b3e9){if(_0x31b3e9){var _0x2d25e9=_0x31b3e9[_0x7b8b('0x56')]&&fs[_0x7b8b('0x5a')](path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x293d0b,_[_0x7b8b('0x5c')](_0x31b3e9[_0x7b8b('0x56')])))?path[_0x7b8b('0x5b')](config['root'],_0x293d0b,_[_0x7b8b('0x5c')](_0x31b3e9['favicon'])):path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x293d0b,_[_0x7b8b('0x5c')](_0x7b8b('0x6e')));var _0x457820=_0x7b8b('0x5f')+_[_0x7b8b('0x60')]('favicon');if(_0x31b3e9[_0x457820]||!_0x5d0bf9[_0x7b8b('0x61')]){_0x2d25e9=path[_0x7b8b('0x5b')](config['root'],_0x293d0b,_[_0x7b8b('0x5c')](_0x7b8b('0x6e')));}if(!fs[_0x7b8b('0x5a')](_0x2d25e9)){throw new db[(_0x7b8b('0x68'))][(_0x7b8b('0x62'))](_['upperFirst'](_0x7b8b('0x56'))+_0x7b8b('0x63'));}return _0x52bafd[_0x7b8b('0x64')](_0x2d25e9);}})[_0x7b8b('0x20')](handleError(_0x52bafd,null));};exports['getDate']=function(_0x5eb67b,_0x8bfe82){var _0x15f482={'offset':moment()[_0x7b8b('0x6f')]()};_0x15f482[_0x7b8b('0x70')]=moment()[_0x7b8b('0x6f')](_0x15f482[_0x7b8b('0x27')])[_0x7b8b('0x71')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x8bfe82[_0x7b8b('0x22')](0xc8)[_0x7b8b('0x30')](_0x15f482);};
\ No newline at end of file
+var _0xf3cc=['toLower','default_logo.svg','default','custom','Sequelize','ValidationError','download','default_loginLogo.svg','upperFirst','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','request','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Setting','includeAll','findAll','rows','catch','show','rawAttributes','fields','body','find','params','addLogo','file','filename','addLogoLogin','getLogo','server/files/images/logos','getLicense','logo','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root'];(function(_0x1c7917,_0x49efff){var _0x26530e=function(_0xaa6458){while(--_0xaa6458){_0x1c7917['push'](_0x1c7917['shift']());}};_0x26530e(++_0x49efff);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x56ce7d,_0x57d050){_0x56ce7d=_0x56ce7d-0x0;var _0x72a880=_0xf3cc[_0x56ce7d];return _0x72a880;};'use strict';var emlformat=require(_0xcf3c('0x0'));var rimraf=require(_0xcf3c('0x1'));var zipdir=require(_0xcf3c('0x2'));var jsonpatch=require(_0xcf3c('0x3'));var rp=require('request-promise');var moment=require(_0xcf3c('0x4'));var BPromise=require(_0xcf3c('0x5'));var Mustache=require(_0xcf3c('0x6'));var util=require('util');var path=require(_0xcf3c('0x7'));var sox=require(_0xcf3c('0x8'));var csv=require('to-csv');var ejs=require(_0xcf3c('0x9'));var fs=require('fs');var fs_extra=require(_0xcf3c('0xa'));var _=require(_0xcf3c('0xb'));var squel=require(_0xcf3c('0xc'));var crypto=require(_0xcf3c('0xd'));var jsforce=require(_0xcf3c('0xe'));var deskjs=require(_0xcf3c('0xf'));var toCsv=require(_0xcf3c('0x10'));var querystring=require(_0xcf3c('0x11'));var Papa=require(_0xcf3c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf3c('0x13'));var as=require(_0xcf3c('0x14'));var hardwareService=require(_0xcf3c('0x15'));var logger=require(_0xcf3c('0x16'))(_0xcf3c('0x17'));var utils=require(_0xcf3c('0x18'));var config=require(_0xcf3c('0x19'));var licenseUtil=require(_0xcf3c('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xcf3c('0x1b'));var client=jayson[_0xcf3c('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x60e424,_0x4e6c38,_0x55ef34,_0x56261f){return new BPromise(function(_0x3fd714,_0x598576){var _0x2f387b=_0x56261f||client;return _0x2f387b[_0xcf3c('0x1d')](_0x60e424,_0x55ef34)['then'](function(_0x3e759f){logger['info'](_0xcf3c('0x1e'),_0x4e6c38,_0xcf3c('0x1f'));logger[_0xcf3c('0x20')]('Setting,\x20%s,\x20%s,\x20%s',_0x4e6c38,_0xcf3c('0x1f'),JSON[_0xcf3c('0x21')](_0x3e759f));if(_0x3e759f[_0xcf3c('0x22')]){if(_0x3e759f[_0xcf3c('0x22')]['code']===0x1f4){logger[_0xcf3c('0x22')](_0xcf3c('0x1e'),_0x4e6c38,_0x3e759f[_0xcf3c('0x22')][_0xcf3c('0x23')]);return _0x598576(_0x3e759f[_0xcf3c('0x22')][_0xcf3c('0x23')]);}logger[_0xcf3c('0x22')](_0xcf3c('0x1e'),_0x4e6c38,_0x3e759f[_0xcf3c('0x22')][_0xcf3c('0x23')]);return _0x3fd714(_0x3e759f[_0xcf3c('0x22')][_0xcf3c('0x23')]);}else{logger['info'](_0xcf3c('0x1e'),_0x4e6c38,'request\x20sent');_0x3fd714(_0x3e759f[_0xcf3c('0x24')][_0xcf3c('0x23')]);}})['catch'](function(_0x1bd0f2){logger[_0xcf3c('0x22')](_0xcf3c('0x1e'),_0x4e6c38,_0x1bd0f2);_0x598576(_0x1bd0f2);});});}function respondWithStatusCode(_0x1d7e79,_0x32bbd5){_0x32bbd5=_0x32bbd5||0xcc;return function(_0x3f1771){if(_0x3f1771){return _0x1d7e79[_0xcf3c('0x25')](_0x32bbd5);}return _0x1d7e79[_0xcf3c('0x26')](_0x32bbd5)['end']();};}function respondWithResult(_0x771a9f,_0x4ce43c){_0x4ce43c=_0x4ce43c||0xc8;return function(_0x2281b6){if(_0x2281b6){return _0x771a9f[_0xcf3c('0x26')](_0x4ce43c)[_0xcf3c('0x27')](_0x2281b6);}};}function respondWithFilteredResult(_0x35e546,_0x181c90){return function(_0x43c912){if(_0x43c912){var _0x5631f1=typeof _0x181c90[_0xcf3c('0x28')]==='undefined'&&typeof _0x181c90[_0xcf3c('0x29')]===_0xcf3c('0x2a');var _0x3b253d=_0x43c912['count'];var _0x397996=_0x5631f1?0x0:_0x181c90['offset'];var _0x1d8223=_0x5631f1?_0x43c912[_0xcf3c('0x2b')]:_0x181c90[_0xcf3c('0x28')]+_0x181c90[_0xcf3c('0x29')];var _0x5835b2;if(_0x1d8223>=_0x3b253d){_0x1d8223=_0x3b253d;_0x5835b2=0xc8;}else{_0x5835b2=0xce;}_0x35e546[_0xcf3c('0x26')](_0x5835b2);return _0x35e546[_0xcf3c('0x2c')](_0xcf3c('0x2d'),_0x397996+'-'+_0x1d8223+'/'+_0x3b253d)[_0xcf3c('0x27')](_0x43c912);}return null;};}function patchUpdates(_0x502bca){return function(_0x1fae74){try{jsonpatch[_0xcf3c('0x2e')](_0x1fae74,_0x502bca,!![]);}catch(_0x2b2915){return BPromise['reject'](_0x2b2915);}return _0x1fae74[_0xcf3c('0x2f')]();};}function saveUpdates(_0x185868,_0x196b02){return function(_0x5f376e){if(_0x5f376e){return _0x5f376e[_0xcf3c('0x30')](_0x185868)[_0xcf3c('0x31')](function(_0x45a611){return _0x45a611;});}return null;};}function removeEntity(_0x2e7b19,_0x1b15cf){return function(_0x534f56){if(_0x534f56){return _0x534f56[_0xcf3c('0x32')]()['then'](function(){_0x2e7b19[_0xcf3c('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a78f2,_0x1daba1){return function(_0x32b41d){if(!_0x32b41d){_0x2a78f2[_0xcf3c('0x25')](0x194);}return _0x32b41d;};}function handleError(_0x2a014a,_0x3a54bf){_0x3a54bf=_0x3a54bf||0x1f4;return function(_0x7933ca){logger[_0xcf3c('0x22')](_0x7933ca['stack']);if(_0x7933ca[_0xcf3c('0x33')]){delete _0x7933ca[_0xcf3c('0x33')];}_0x2a014a[_0xcf3c('0x26')](_0x3a54bf)[_0xcf3c('0x34')](_0x7933ca);};}exports[_0xcf3c('0x35')]=function(_0x161ef9,_0x9a64be){var _0xff382e={},_0x16f81d={},_0x22fed3={'count':0x0,'rows':[]};var _0x4ad15a=_[_0xcf3c('0x36')](db['Setting']['rawAttributes'],function(_0x517e98){return{'name':_0x517e98[_0xcf3c('0x37')],'type':_0x517e98[_0xcf3c('0x38')][_0xcf3c('0x39')]};});_0x16f81d[_0xcf3c('0x3a')]=_['map'](_0x4ad15a,'name');_0x16f81d[_0xcf3c('0x3b')]=_[_0xcf3c('0x3c')](_0x161ef9[_0xcf3c('0x3b')]);_0x16f81d[_0xcf3c('0x3d')]=_[_0xcf3c('0x3e')](_0x16f81d[_0xcf3c('0x3a')],_0x16f81d['query']);_0xff382e[_0xcf3c('0x3f')]=_[_0xcf3c('0x3e')](_0x16f81d[_0xcf3c('0x3a')],qs['fields'](_0x161ef9[_0xcf3c('0x3b')]['fields']));_0xff382e['attributes']=_0xff382e[_0xcf3c('0x3f')][_0xcf3c('0x40')]?_0xff382e[_0xcf3c('0x3f')]:_0x16f81d[_0xcf3c('0x3a')];if(!_0x161ef9[_0xcf3c('0x3b')][_0xcf3c('0x41')](_0xcf3c('0x42'))){_0xff382e[_0xcf3c('0x29')]=qs[_0xcf3c('0x29')](_0x161ef9['query']['limit']);_0xff382e[_0xcf3c('0x28')]=qs[_0xcf3c('0x28')](_0x161ef9['query'][_0xcf3c('0x28')]);}_0xff382e['order']=qs[_0xcf3c('0x43')](_0x161ef9[_0xcf3c('0x3b')][_0xcf3c('0x43')]);_0xff382e[_0xcf3c('0x44')]=qs[_0xcf3c('0x3d')](_[_0xcf3c('0x45')](_0x161ef9[_0xcf3c('0x3b')],_0x16f81d[_0xcf3c('0x3d')]),_0x4ad15a);if(_0x161ef9[_0xcf3c('0x3b')][_0xcf3c('0x46')]){_0xff382e[_0xcf3c('0x44')]=_[_0xcf3c('0x47')](_0xff382e[_0xcf3c('0x44')],{'$or':_[_0xcf3c('0x36')](_0x4ad15a,function(_0x256e00){if(_0x256e00[_0xcf3c('0x38')]!==_0xcf3c('0x48')){var _0xf7b7a4={};_0xf7b7a4[_0x256e00['name']]={'$like':'%'+_0x161ef9['query'][_0xcf3c('0x46')]+'%'};return _0xf7b7a4;}})});}_0xff382e=_['merge']({},_0xff382e,_0x161ef9[_0xcf3c('0x49')]);var _0x3d9265={'where':_0xff382e[_0xcf3c('0x44')]};return db[_0xcf3c('0x4a')][_0xcf3c('0x2b')](_0x3d9265)['then'](function(_0x5b6802){_0x22fed3['count']=_0x5b6802;if(_0x161ef9[_0xcf3c('0x3b')][_0xcf3c('0x4b')]){_0xff382e['include']=[{'all':!![]}];}return db[_0xcf3c('0x4a')][_0xcf3c('0x4c')](_0xff382e);})[_0xcf3c('0x31')](function(_0x2800d4){_0x22fed3[_0xcf3c('0x4d')]=_0x2800d4;return _0x22fed3;})[_0xcf3c('0x31')](respondWithFilteredResult(_0x9a64be,_0xff382e))[_0xcf3c('0x4e')](handleError(_0x9a64be,null));};exports[_0xcf3c('0x4f')]=function(_0x31124d,_0x2c8234){var _0x25d090={'raw':![],'where':{'id':_0x31124d['params']['id']}},_0x2cfc0b={};_0x2cfc0b[_0xcf3c('0x3a')]=_[_0xcf3c('0x3c')](db[_0xcf3c('0x4a')][_0xcf3c('0x50')]);_0x2cfc0b['query']=_[_0xcf3c('0x3c')](_0x31124d['query']);_0x2cfc0b[_0xcf3c('0x3d')]=_['intersection'](_0x2cfc0b['model'],_0x2cfc0b['query']);_0x25d090['attributes']=_[_0xcf3c('0x3e')](_0x2cfc0b[_0xcf3c('0x3a')],qs['fields'](_0x31124d[_0xcf3c('0x3b')][_0xcf3c('0x51')]));_0x25d090[_0xcf3c('0x3f')]=_0x25d090['attributes']['length']?_0x25d090[_0xcf3c('0x3f')]:_0x2cfc0b[_0xcf3c('0x3a')];if(_0x31124d['query']['includeAll']){_0x25d090['include']=[{'all':!![]}];}_0x25d090=_[_0xcf3c('0x47')]({},_0x25d090,_0x31124d['options']);return db[_0xcf3c('0x4a')]['find'](_0x25d090)[_0xcf3c('0x31')](handleEntityNotFound(_0x2c8234,null))[_0xcf3c('0x31')](respondWithResult(_0x2c8234,null))[_0xcf3c('0x4e')](handleError(_0x2c8234,null));};exports[_0xcf3c('0x30')]=function(_0x2d0710,_0x4cb19d){if(_0x2d0710[_0xcf3c('0x52')]['id']){delete _0x2d0710[_0xcf3c('0x52')]['id'];}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x2d0710[_0xcf3c('0x54')]['id']}})[_0xcf3c('0x31')](handleEntityNotFound(_0x4cb19d,null))[_0xcf3c('0x31')](saveUpdates(_0x2d0710['body'],null))['then'](respondWithResult(_0x4cb19d,null))['catch'](handleError(_0x4cb19d,null));};exports[_0xcf3c('0x55')]=function(_0x4b902b,_0x5a7c0f,_0x340b82){if(_0x4b902b[_0xcf3c('0x56')]&&_0x4b902b[_0xcf3c('0x56')]['filename']){_0x4b902b[_0xcf3c('0x52')]['logo']=_0x4b902b[_0xcf3c('0x56')][_0xcf3c('0x57')];}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x4b902b[_0xcf3c('0x54')]['id']}})[_0xcf3c('0x31')](handleEntityNotFound(_0x5a7c0f,null))[_0xcf3c('0x31')](saveUpdates(_0x4b902b[_0xcf3c('0x52')],null))[_0xcf3c('0x31')](respondWithResult(_0x5a7c0f,null))[_0xcf3c('0x4e')](handleError(_0x5a7c0f,null));};exports[_0xcf3c('0x58')]=function(_0x5578c4,_0x2bae67,_0x191cfb){if(_0x5578c4[_0xcf3c('0x56')]&&_0x5578c4[_0xcf3c('0x56')][_0xcf3c('0x57')]){_0x5578c4[_0xcf3c('0x52')]['loginLogo']=_0x5578c4[_0xcf3c('0x56')]['filename'];}return db[_0xcf3c('0x4a')]['find']({'where':{'id':_0x5578c4['params']['id']}})['then'](handleEntityNotFound(_0x2bae67,null))[_0xcf3c('0x31')](saveUpdates(_0x5578c4[_0xcf3c('0x52')],null))['then'](respondWithResult(_0x2bae67,null))[_0xcf3c('0x4e')](handleError(_0x2bae67,null));};var utilLicense=require(_0xcf3c('0x1a'));exports[_0xcf3c('0x59')]=function(_0x4084ac,_0x121907,_0x4518dd){var _0x4db5f8=_0xcf3c('0x5a');var _0x32cdec={'custom':![]};return utilLicense[_0xcf3c('0x5b')]()[_0xcf3c('0x31')](function(_0x4419e2){if(_0x4419e2){_0x32cdec=_0x4419e2;}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x4084ac[_0xcf3c('0x54')]['id']},'attributes':[_0xcf3c('0x5c'),_0xcf3c('0x5d'),_0xcf3c('0x5e'),_0xcf3c('0x5f'),_0xcf3c('0x60'),_0xcf3c('0x61'),_0xcf3c('0x62'),_0xcf3c('0x63')],'raw':!![]});})[_0xcf3c('0x31')](handleEntityNotFound(_0x121907,null))[_0xcf3c('0x31')](function(_0x50b802){if(_0x50b802){var _0x19680d=_0x50b802[_0xcf3c('0x5c')]&&fs[_0xcf3c('0x64')](path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x4db5f8,_[_0xcf3c('0x67')](_0x50b802[_0xcf3c('0x5c')])))?path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x4db5f8,_['toLower'](_0x50b802[_0xcf3c('0x5c')])):path['join'](config[_0xcf3c('0x66')],_0x4db5f8,_[_0xcf3c('0x67')](_0xcf3c('0x68')));var _0x295d39=_0xcf3c('0x69')+_['upperFirst']('logo');if(_0x50b802[_0x295d39]||!_0x32cdec[_0xcf3c('0x6a')]){_0x19680d=path['join'](config['root'],_0x4db5f8,_['toLower'](_0xcf3c('0x68')));}if(!fs[_0xcf3c('0x64')](_0x19680d)){throw new db[(_0xcf3c('0x6b'))][(_0xcf3c('0x6c'))](_['upperFirst'](_0xcf3c('0x5c'))+'\x20not\x20found');}return _0x121907[_0xcf3c('0x6d')](_0x19680d);}})[_0xcf3c('0x4e')](handleError(_0x121907,null));};var utilLicense=require(_0xcf3c('0x1a'));exports['getLogoLogin']=function(_0x29c7ab,_0xe2d51a,_0x3c940d){var _0x95ce18=_0xcf3c('0x5a');var _0x1f2ef2={'custom':![]};return utilLicense[_0xcf3c('0x5b')]()[_0xcf3c('0x31')](function(_0x219dc0){if(_0x219dc0){_0x1f2ef2=_0x219dc0;}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x29c7ab[_0xcf3c('0x54')]['id']},'attributes':[_0xcf3c('0x5c'),_0xcf3c('0x5d'),_0xcf3c('0x5e'),_0xcf3c('0x5f'),'defaultLogo',_0xcf3c('0x61'),_0xcf3c('0x62'),_0xcf3c('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0xe2d51a,null))[_0xcf3c('0x31')](function(_0x381d5b){if(_0x381d5b){var _0xdfd54f=_0x381d5b[_0xcf3c('0x5d')]&&fs[_0xcf3c('0x64')](path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x95ce18,_[_0xcf3c('0x67')](_0x381d5b['loginLogo'])))?path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x95ce18,_['toLower'](_0x381d5b[_0xcf3c('0x5d')])):path['join'](config[_0xcf3c('0x66')],_0x95ce18,_[_0xcf3c('0x67')](_0xcf3c('0x6e')));var _0x3f9165='default'+_[_0xcf3c('0x6f')](_0xcf3c('0x5d'));if(_0x381d5b[_0x3f9165]||!_0x1f2ef2['custom']){_0xdfd54f=path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x95ce18,_[_0xcf3c('0x67')](_0xcf3c('0x6e')));}if(!fs[_0xcf3c('0x64')](_0xdfd54f)){throw new db['Sequelize'][(_0xcf3c('0x6c'))](_[_0xcf3c('0x6f')](_0xcf3c('0x5d'))+_0xcf3c('0x70'));}return _0xe2d51a[_0xcf3c('0x6d')](_0xdfd54f);}})[_0xcf3c('0x4e')](handleError(_0xe2d51a,null));};exports[_0xcf3c('0x71')]=function(_0x43763c,_0x4e8ada){return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x43763c[_0xcf3c('0x54')]['id']},'attributes':[_0xcf3c('0x72')]})[_0xcf3c('0x31')](respondWithResult(_0x4e8ada,null))['catch'](handleError(_0x4e8ada,null));};exports[_0xcf3c('0x73')]=function(_0x235263,_0x4db968,_0x59eb68){if(_0x235263[_0xcf3c('0x56')]&&_0x235263[_0xcf3c('0x56')][_0xcf3c('0x57')]){_0x235263[_0xcf3c('0x52')][_0xcf3c('0x5e')]=_0x235263[_0xcf3c('0x56')]['filename'];}return db[_0xcf3c('0x4a')]['find']({'where':{'id':_0x235263['params']['id']}})['then'](handleEntityNotFound(_0x4db968,null))['then'](saveUpdates(_0x235263['body'],null))['then'](respondWithResult(_0x4db968,null))['catch'](handleError(_0x4db968,null));};var utilLicense=require(_0xcf3c('0x1a'));exports[_0xcf3c('0x74')]=function(_0x21aecd,_0x509239,_0x45df41){var _0x20fb50=_0xcf3c('0x5a');var _0x2c6e5c={'custom':![]};return utilLicense[_0xcf3c('0x5b')]()[_0xcf3c('0x31')](function(_0x4994d9){if(_0x4994d9){_0x2c6e5c=_0x4994d9;}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x21aecd['params']['id']},'attributes':[_0xcf3c('0x5c'),'loginLogo','preferred',_0xcf3c('0x5f'),_0xcf3c('0x60'),_0xcf3c('0x61'),_0xcf3c('0x62'),_0xcf3c('0x63')],'raw':!![]});})[_0xcf3c('0x31')](handleEntityNotFound(_0x509239,null))[_0xcf3c('0x31')](function(_0x473df3){if(_0x473df3){var _0x181fe0=_0x473df3[_0xcf3c('0x5e')]&&fs[_0xcf3c('0x64')](path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x20fb50,_['toLower'](_0x473df3[_0xcf3c('0x5e')])))?path['join'](config['root'],_0x20fb50,_[_0xcf3c('0x67')](_0x473df3[_0xcf3c('0x5e')])):path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x20fb50,_['toLower'](_0xcf3c('0x75')));var _0x17d364=_0xcf3c('0x69')+_[_0xcf3c('0x6f')](_0xcf3c('0x5e'));if(_0x473df3[_0x17d364]||!_0x2c6e5c[_0xcf3c('0x6a')]||!_0x2c6e5c[_0xcf3c('0x5e')]){_0x181fe0=path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x20fb50,_[_0xcf3c('0x67')](_0xcf3c('0x75')));}if(!fs[_0xcf3c('0x64')](_0x181fe0)){throw new db[(_0xcf3c('0x6b'))][(_0xcf3c('0x6c'))](_[_0xcf3c('0x6f')](_0xcf3c('0x5e'))+_0xcf3c('0x70'));}return _0x509239['download'](_0x181fe0);}})[_0xcf3c('0x4e')](handleError(_0x509239,null));};exports[_0xcf3c('0x76')]=function(_0x501227,_0x36efdf,_0x4cfebf){if(_0x501227[_0xcf3c('0x56')]&&_0x501227['file'][_0xcf3c('0x57')]){_0x501227[_0xcf3c('0x52')][_0xcf3c('0x5f')]=_0x501227[_0xcf3c('0x56')]['filename'];}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x501227[_0xcf3c('0x54')]['id']}})[_0xcf3c('0x31')](handleEntityNotFound(_0x36efdf,null))[_0xcf3c('0x31')](saveUpdates(_0x501227[_0xcf3c('0x52')],null))['then'](respondWithResult(_0x36efdf,null))['catch'](handleError(_0x36efdf,null));};var utilLicense=require(_0xcf3c('0x1a'));exports[_0xcf3c('0x77')]=function(_0x3412f4,_0x2b1153,_0x227087){var _0x23b1af=_0xcf3c('0x5a');var _0x581ead={'custom':![]};return utilLicense[_0xcf3c('0x5b')]()[_0xcf3c('0x31')](function(_0x303467){if(_0x303467){_0x581ead=_0x303467;}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x3412f4[_0xcf3c('0x54')]['id']},'attributes':['logo','loginLogo',_0xcf3c('0x5e'),'favicon',_0xcf3c('0x60'),_0xcf3c('0x61'),'defaultPreferred',_0xcf3c('0x63')],'raw':!![]});})[_0xcf3c('0x31')](handleEntityNotFound(_0x2b1153,null))['then'](function(_0x38ce58){if(_0x38ce58){var _0x255bb4=_0x38ce58[_0xcf3c('0x5f')]&&fs[_0xcf3c('0x64')](path['join'](config[_0xcf3c('0x66')],_0x23b1af,_[_0xcf3c('0x67')](_0x38ce58['favicon'])))?path[_0xcf3c('0x65')](config['root'],_0x23b1af,_[_0xcf3c('0x67')](_0x38ce58[_0xcf3c('0x5f')])):path['join'](config[_0xcf3c('0x66')],_0x23b1af,_[_0xcf3c('0x67')](_0xcf3c('0x78')));var _0x36d9eb=_0xcf3c('0x69')+_[_0xcf3c('0x6f')]('favicon');if(_0x38ce58[_0x36d9eb]||!_0x581ead['custom']){_0x255bb4=path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x23b1af,_[_0xcf3c('0x67')](_0xcf3c('0x78')));}if(!fs['existsSync'](_0x255bb4)){throw new db[(_0xcf3c('0x6b'))]['ValidationError'](_[_0xcf3c('0x6f')](_0xcf3c('0x5f'))+_0xcf3c('0x70'));}return _0x2b1153[_0xcf3c('0x6d')](_0x255bb4);}})['catch'](handleError(_0x2b1153,null));};exports[_0xcf3c('0x79')]=function(_0xf0a123,_0x35ec88){var _0x2a1d6d={'offset':moment()[_0xcf3c('0x7a')]()};_0x2a1d6d['now']=moment()[_0xcf3c('0x7a')](_0x2a1d6d['offset'])[_0xcf3c('0x7b')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x35ec88[_0xcf3c('0x26')](0xc8)['send'](_0x2a1d6d);};
\ No newline at end of file
index 8274585..490b603 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x170cbb,_0x9093e){var _0x39fae4=function(_0x120b6b){while(--_0x120b6b){_0x170cbb['push'](_0x170cbb['shift']());}};_0x39fae4(++_0x9093e);}(_0x3e74,0x175));var _0x43e7=function(_0x554aa6,_0x2b4f13){_0x554aa6=_0x554aa6-0x0;var _0x2a901a=_0x3e74[_0x554aa6];return _0x2a901a;};'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 _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x50b1c1,_0x269522){var _0x456372=function(_0x39b571){while(--_0x39b571){_0x50b1c1['push'](_0x50b1c1['shift']());}};_0x456372(++_0x269522);}(_0xe14b,0x93));var _0xbe14=function(_0x20a354,_0x1b7a3f){_0x20a354=_0x20a354-0x0;var _0x588c73=_0xe14b[_0x20a354];return _0x588c73;};'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 9bdf48e..28e9f88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2a2=['stringify','error','message','result','ShowSetting','Setting','find','options','where','attributes','include','map','model','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2aa0ee,_0x21c751){var _0x10d12c=function(_0x5e8a52){while(--_0x5e8a52){_0x2aa0ee['push'](_0x2aa0ee['shift']());}};_0x10d12c(++_0x21c751);}(_0xf2a2,0x177));var _0x2f2a=function(_0x3bc72d,_0x5aaa33){_0x3bc72d=_0x3bc72d-0x0;var _0x3b7fbf=_0xf2a2[_0x3bc72d];return _0x3b7fbf;};'use strict';var _=require('lodash');var util=require(_0x2f2a('0x0'));var moment=require(_0x2f2a('0x1'));var BPromise=require(_0x2f2a('0x2'));var rs=require(_0x2f2a('0x3'));var fs=require('fs');var Redis=require(_0x2f2a('0x4'));var db=require(_0x2f2a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f2a('0x6'))('rpc');var config=require(_0x2f2a('0x7'));var jayson=require(_0x2f2a('0x8'));var client=jayson[_0x2f2a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52405d,_0x31e544,_0xa3a1d9){return new BPromise(function(_0x28f40b,_0x33cf08){return client['request'](_0x52405d,_0xa3a1d9)[_0x2f2a('0xa')](function(_0x163bbe){logger[_0x2f2a('0xb')](_0x2f2a('0xc'),_0x31e544,'request\x20sent');logger['debug'](_0x2f2a('0xd'),_0x31e544,_0x2f2a('0xe'),JSON[_0x2f2a('0xf')](_0x163bbe));if(_0x163bbe[_0x2f2a('0x10')]){if(_0x163bbe[_0x2f2a('0x10')]['code']===0x1f4){logger[_0x2f2a('0x10')]('Setting,\x20%s,\x20%s',_0x31e544,_0x163bbe[_0x2f2a('0x10')][_0x2f2a('0x11')]);return _0x33cf08(_0x163bbe[_0x2f2a('0x10')][_0x2f2a('0x11')]);}logger['error'](_0x2f2a('0xc'),_0x31e544,_0x163bbe['error'][_0x2f2a('0x11')]);return _0x28f40b(_0x163bbe['error']['message']);}else{logger[_0x2f2a('0xb')](_0x2f2a('0xc'),_0x31e544,_0x2f2a('0xe'));_0x28f40b(_0x163bbe[_0x2f2a('0x12')][_0x2f2a('0x11')]);}})['catch'](function(_0x22ead0){logger['error'](_0x2f2a('0xc'),_0x31e544,_0x22ead0);_0x33cf08(_0x22ead0);});});}exports[_0x2f2a('0x13')]=function(_0x185fda){var _0x566ba2=this;return new Promise(function(_0x24d9d9,_0x2aa0e4){return db[_0x2f2a('0x14')][_0x2f2a('0x15')]({'raw':_0x185fda[_0x2f2a('0x16')]?_0x185fda['options']['raw']===undefined?!![]:![]:!![],'where':_0x185fda[_0x2f2a('0x16')]?_0x185fda[_0x2f2a('0x16')][_0x2f2a('0x17')]||null:null,'attributes':_0x185fda[_0x2f2a('0x16')]?_0x185fda['options'][_0x2f2a('0x18')]||null:null,'include':_0x185fda[_0x2f2a('0x16')]?_0x185fda[_0x2f2a('0x16')][_0x2f2a('0x19')]?_[_0x2f2a('0x1a')](_0x185fda[_0x2f2a('0x16')][_0x2f2a('0x19')],function(_0x450f34){return{'model':db[_0x450f34[_0x2f2a('0x1b')]],'as':_0x450f34['as'],'attributes':_0x450f34['attributes'],'include':_0x450f34[_0x2f2a('0x19')]?_[_0x2f2a('0x1a')](_0x450f34[_0x2f2a('0x19')],function(_0x4cd68d){return{'model':db[_0x4cd68d[_0x2f2a('0x1b')]],'as':_0x4cd68d['as'],'attributes':_0x4cd68d[_0x2f2a('0x18')],'include':_0x4cd68d[_0x2f2a('0x19')]?_[_0x2f2a('0x1a')](_0x4cd68d[_0x2f2a('0x19')],function(_0x32ac1d){return{'model':db[_0x32ac1d[_0x2f2a('0x1b')]],'as':_0x32ac1d['as'],'attributes':_0x32ac1d[_0x2f2a('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2f2a('0xa')](function(_0x5a172f){logger[_0x2f2a('0xb')](_0x2f2a('0x13'),_0x185fda);logger[_0x2f2a('0x1c')](_0x2f2a('0x13'),_0x185fda,JSON[_0x2f2a('0xf')](_0x5a172f));_0x24d9d9(_0x5a172f);})[_0x2f2a('0x1d')](function(_0x40b2c5){logger[_0x2f2a('0x10')](_0x2f2a('0x13'),_0x40b2c5[_0x2f2a('0x11')],_0x185fda);_0x2aa0e4(_0x566ba2['error'](0x1f4,_0x40b2c5[_0x2f2a('0x11')]));});});};
\ No newline at end of file
+var _0xebf8=['stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','error','code','message','Setting,\x20%s,\x20%s','info','catch','ShowSetting','Setting','find','options','raw','where','include','map','model','attributes'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0xebf8,0x7d));var _0x8ebf=function(_0x6dd9da,_0x53f022){_0x6dd9da=_0x6dd9da-0x0;var _0x2276f7=_0xebf8[_0x6dd9da];return _0x2276f7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8ebf('0x0'));var BPromise=require(_0x8ebf('0x1'));var rs=require(_0x8ebf('0x2'));var fs=require('fs');var Redis=require(_0x8ebf('0x3'));var db=require(_0x8ebf('0x4'))['db'];var utils=require(_0x8ebf('0x5'));var logger=require(_0x8ebf('0x6'))(_0x8ebf('0x7'));var config=require(_0x8ebf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8ebf('0x9')][_0x8ebf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51e1d4,_0x5bd7c2,_0x1b13ac){return new BPromise(function(_0x12f67c,_0x4a66b2){return client['request'](_0x51e1d4,_0x1b13ac)[_0x8ebf('0xb')](function(_0x340d57){logger['info']('Setting,\x20%s,\x20%s',_0x5bd7c2,_0x8ebf('0xc'));logger[_0x8ebf('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x5bd7c2,_0x8ebf('0xc'),JSON['stringify'](_0x340d57));if(_0x340d57[_0x8ebf('0xe')]){if(_0x340d57[_0x8ebf('0xe')][_0x8ebf('0xf')]===0x1f4){logger[_0x8ebf('0xe')]('Setting,\x20%s,\x20%s',_0x5bd7c2,_0x340d57[_0x8ebf('0xe')][_0x8ebf('0x10')]);return _0x4a66b2(_0x340d57[_0x8ebf('0xe')][_0x8ebf('0x10')]);}logger[_0x8ebf('0xe')](_0x8ebf('0x11'),_0x5bd7c2,_0x340d57['error']['message']);return _0x12f67c(_0x340d57[_0x8ebf('0xe')][_0x8ebf('0x10')]);}else{logger[_0x8ebf('0x12')]('Setting,\x20%s,\x20%s',_0x5bd7c2,_0x8ebf('0xc'));_0x12f67c(_0x340d57['result'][_0x8ebf('0x10')]);}})[_0x8ebf('0x13')](function(_0x32700a){logger['error']('Setting,\x20%s,\x20%s',_0x5bd7c2,_0x32700a);_0x4a66b2(_0x32700a);});});}exports[_0x8ebf('0x14')]=function(_0x20ebde){var _0xff3d4b=this;return new Promise(function(_0x2f1bef,_0x1c89c3){return db[_0x8ebf('0x15')][_0x8ebf('0x16')]({'raw':_0x20ebde['options']?_0x20ebde[_0x8ebf('0x17')][_0x8ebf('0x18')]===undefined?!![]:![]:!![],'where':_0x20ebde[_0x8ebf('0x17')]?_0x20ebde[_0x8ebf('0x17')][_0x8ebf('0x19')]||null:null,'attributes':_0x20ebde['options']?_0x20ebde['options']['attributes']||null:null,'include':_0x20ebde[_0x8ebf('0x17')]?_0x20ebde[_0x8ebf('0x17')][_0x8ebf('0x1a')]?_[_0x8ebf('0x1b')](_0x20ebde[_0x8ebf('0x17')][_0x8ebf('0x1a')],function(_0x2e6df8){return{'model':db[_0x2e6df8[_0x8ebf('0x1c')]],'as':_0x2e6df8['as'],'attributes':_0x2e6df8[_0x8ebf('0x1d')],'include':_0x2e6df8[_0x8ebf('0x1a')]?_[_0x8ebf('0x1b')](_0x2e6df8[_0x8ebf('0x1a')],function(_0x3d0b82){return{'model':db[_0x3d0b82[_0x8ebf('0x1c')]],'as':_0x3d0b82['as'],'attributes':_0x3d0b82[_0x8ebf('0x1d')],'include':_0x3d0b82[_0x8ebf('0x1a')]?_[_0x8ebf('0x1b')](_0x3d0b82[_0x8ebf('0x1a')],function(_0x47927d){return{'model':db[_0x47927d['model']],'as':_0x47927d['as'],'attributes':_0x47927d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x20d9b4){logger[_0x8ebf('0x12')](_0x8ebf('0x14'),_0x20ebde);logger['debug'](_0x8ebf('0x14'),_0x20ebde,JSON[_0x8ebf('0x1e')](_0x20d9b4));_0x2f1bef(_0x20d9b4);})[_0x8ebf('0x13')](function(_0x4c1ac8){logger['error'](_0x8ebf('0x14'),_0x4c1ac8['message'],_0x20ebde);_0x1c89c3(_0xff3d4b['error'](0x1f4,_0x4c1ac8['message']));});});};
\ No newline at end of file
index 8485a9f..a43a9a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x3bff96,_0x5c063b){var _0x3af2e9=function(_0x1c3cd9){while(--_0x1c3cd9){_0x3bff96['push'](_0x3bff96['shift']());}};_0x3af2e9(++_0x5c063b);}(_0xe14b,0x93));var _0xbe14=function(_0x9f50b2,_0x101a14){_0x9f50b2=_0x9f50b2-0x0;var _0x341bb1=_0xe14b[_0x9f50b2];return _0x341bb1;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router;
\ No newline at end of file
+var _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0x2b7531,_0x5b1544){var _0x2c987d=function(_0x29a1fd){while(--_0x29a1fd){_0x2b7531['push'](_0x2b7531['shift']());}};_0x2c987d(++_0x5b1544);}(_0x53ec,0x192));var _0xc53e=function(_0x5f3de3,_0x40f0f5){_0x5f3de3=_0x5f3de3-0x0;var _0x287e0d=_0x53ec[_0x5f3de3];return _0x287e0d;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router;
\ No newline at end of file
index 703718f..8bab8fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa04c=['BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','intelepeer'];(function(_0x4998ec,_0x15af49){var _0x22a4bb=function(_0x6f7001){while(--_0x6f7001){_0x4998ec['push'](_0x4998ec['shift']());}};_0x22a4bb(++_0x15af49);}(_0xa04c,0x6d));var _0xca04=function(_0x229667,_0x13e37e){_0x229667=_0x229667-0x0;var _0xa2abe4=_0xa04c[_0x229667];return _0xa2abe4;};'use strict';var Sequelize=require(_0xca04('0x0'));var rs=require(_0xca04('0x1'));module[_0xca04('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xca04('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xca04('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xca04('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xca04('0x5')]();}},'phone':{'type':Sequelize[_0xca04('0x4')]},'type':{'type':Sequelize[_0xca04('0x6')](_0xca04('0x7'),_0xca04('0x8'),_0xca04('0x9'),_0xca04('0xa'),_0xca04('0xb'),_0xca04('0xc'),_0xca04('0xd'),_0xca04('0xe'),'infobip',_0xca04('0xf'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xca04('0x4')]},'authToken':{'type':Sequelize[_0xca04('0x4')]},'smsMethod':{'type':Sequelize[_0xca04('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0xca04('0x4')]},'password':{'type':Sequelize[_0xca04('0x4')]},'apiKey':{'type':Sequelize[_0xca04('0x4')]},'applicationId':{'type':Sequelize[_0xca04('0x4')]},'accountId':{'type':Sequelize[_0xca04('0x4')]},'senderString':{'type':Sequelize[_0xca04('0x4')]},'deliveryReport':{'type':Sequelize[_0xca04('0x10')],'defaultValue':![]},'description':{'type':Sequelize[_0xca04('0x4')]},'notificationTemplate':{'type':Sequelize[_0xca04('0x11')],'defaultValue':function(){return _0xca04('0x12');}},'notificationSound':{'type':Sequelize[_0xca04('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xca04('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xca04('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xca04('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xca04('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xca04('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xca04('0x13')],'comment':_0xca04('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xca04('0x10')],'defaultValue':![],'comment':_0xca04('0x15'),'set':function(_0x532434){if(!_0x532434)this[_0xca04('0x16')](_0xca04('0x17'),null);this[_0xca04('0x16')](_0xca04('0x18'),_0x532434);}}};
\ No newline at end of file
+var _0xad6b=['skebby','connectel','clickatell','csc','infobip','ENUM','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','exports','STRING','name','generate'];(function(_0x4ae459,_0x3bf329){var _0x51d0c9=function(_0x1ce66b){while(--_0x1ce66b){_0x4ae459['push'](_0x4ae459['shift']());}};_0x51d0c9(++_0x3bf329);}(_0xad6b,0x1dc));var _0xbad6=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xad6b[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xbad6('0x0')]={'name':{'type':Sequelize[_0xbad6('0x1')],'unique':_0xbad6('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xbad6('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xbad6('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbad6('0x3')]();}},'phone':{'type':Sequelize[_0xbad6('0x1')]},'type':{'type':Sequelize['ENUM']('twilio',_0xbad6('0x4'),_0xbad6('0x5'),'clicksend','plivo',_0xbad6('0x6'),'bandwidth',_0xbad6('0x7'),_0xbad6('0x8'),'intelepeer')},'accountSid':{'type':Sequelize[_0xbad6('0x1')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xbad6('0x1')]},'smsMethod':{'type':Sequelize[_0xbad6('0x9')]('SI','TI','GP')},'username':{'type':Sequelize[_0xbad6('0x1')]},'password':{'type':Sequelize[_0xbad6('0x1')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xbad6('0x1')]},'accountId':{'type':Sequelize[_0xbad6('0x1')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xbad6('0xa')],'defaultValue':![]},'description':{'type':Sequelize[_0xbad6('0x1')]},'notificationTemplate':{'type':Sequelize[_0xbad6('0xb')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbad6('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbad6('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbad6('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbad6('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xbad6('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbad6('0xc')],'comment':_0xbad6('0xd')},'mandatoryDisposition':{'type':Sequelize[_0xbad6('0xa')],'defaultValue':![],'comment':_0xbad6('0xe'),'set':function(_0x838655){if(!_0x838655)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x838655);}}};
\ No newline at end of file
index e4adeee..9483e90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e58=['isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','Contacts','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','rows','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','clickatell','redif','update','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','omit','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','show','params','find','create','body','role','user','UserProfileSection','autoAssociation','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','getAnswers','includeAll','CannedAnswer','removeAnswers','ids','notify','sms','SmsApplication','Applications','applications','orderBy','priority','asc','account','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','Text','MessageUUID','infobip','results','csc','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer'];(function(_0x27ea19,_0x49a3b0){var _0x589a74=function(_0xf93322){while(--_0xf93322){_0x27ea19['push'](_0x27ea19['shift']());}};_0x589a74(++_0x49a3b0);}(_0x7e58,0x12d));var _0x87e5=function(_0x6baa84,_0x48ccd6){_0x6baa84=_0x6baa84-0x0;var _0x49c292=_0x7e58[_0x6baa84];return _0x49c292;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x87e5('0x0'));var jsonpatch=require(_0x87e5('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x87e5('0x2'));var Mustache=require(_0x87e5('0x3'));var util=require('util');var path=require(_0x87e5('0x4'));var sox=require(_0x87e5('0x5'));var csv=require('to-csv');var ejs=require(_0x87e5('0x6'));var fs=require('fs');var fs_extra=require(_0x87e5('0x7'));var _=require(_0x87e5('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x87e5('0x9'));var toCsv=require(_0x87e5('0xa'));var querystring=require(_0x87e5('0xb'));var Papa=require(_0x87e5('0xc'));var Redis=require(_0x87e5('0xd'));var authService=require(_0x87e5('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87e5('0xf'));var logger=require(_0x87e5('0x10'))(_0x87e5('0x11'));var utils=require('../../config/utils');var config=require(_0x87e5('0x12'));var licenseUtil=require(_0x87e5('0x13'));var db=require(_0x87e5('0x14'))['db'];config['redis']=_[_0x87e5('0x15')](config[_0x87e5('0x16')],{'host':_0x87e5('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x87e5('0x16')]));require(_0x87e5('0x18'))[_0x87e5('0x19')](socket);var jayson=require(_0x87e5('0x1a'));var client=jayson[_0x87e5('0x1b')][_0x87e5('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x2029bf,_0x3852ee,_0x4aa239,_0x587881){return new BPromise(function(_0x5e5862,_0x7c3600){var _0x3a5fc6=_0x587881||client;return _0x3a5fc6[_0x87e5('0x1d')](_0x2029bf,_0x4aa239)[_0x87e5('0x1e')](function(_0x48276a){logger[_0x87e5('0x1f')](_0x87e5('0x20'),_0x3852ee,_0x87e5('0x21'));logger[_0x87e5('0x22')](_0x87e5('0x23'),_0x3852ee,_0x87e5('0x21'),JSON[_0x87e5('0x24')](_0x48276a));if(_0x48276a[_0x87e5('0x25')]){if(_0x48276a['error'][_0x87e5('0x26')]===0x1f4){logger['error'](_0x87e5('0x20'),_0x3852ee,_0x48276a[_0x87e5('0x25')]['message']);return _0x7c3600(_0x48276a[_0x87e5('0x25')][_0x87e5('0x27')]);}logger[_0x87e5('0x25')]('SmsAccount,\x20%s,\x20%s',_0x3852ee,_0x48276a[_0x87e5('0x25')][_0x87e5('0x27')]);return _0x5e5862(_0x48276a[_0x87e5('0x25')][_0x87e5('0x27')]);}else{logger[_0x87e5('0x1f')](_0x87e5('0x20'),_0x3852ee,'request\x20sent');_0x5e5862(_0x48276a['result'][_0x87e5('0x27')]);}})[_0x87e5('0x28')](function(_0x1efbfc){logger[_0x87e5('0x25')](_0x87e5('0x20'),_0x3852ee,_0x1efbfc);_0x7c3600(_0x1efbfc);});});}function respondWithStatusCode(_0x3ee846,_0x2d449e){_0x2d449e=_0x2d449e||0xcc;return function(_0x37f173){if(_0x37f173){return _0x3ee846[_0x87e5('0x29')](_0x2d449e);}return _0x3ee846[_0x87e5('0x2a')](_0x2d449e)[_0x87e5('0x2b')]();};}function respondWithResult(_0x1ab97d,_0x32ce81){_0x32ce81=_0x32ce81||0xc8;return function(_0xb26e06){if(_0xb26e06){return _0x1ab97d[_0x87e5('0x2a')](_0x32ce81)[_0x87e5('0x2c')](_0xb26e06);}};}function respondWithFilteredResult(_0x553482,_0x531a6f){return function(_0x58a842){if(_0x58a842){var _0x156264=typeof _0x531a6f[_0x87e5('0x2d')]==='undefined'&&typeof _0x531a6f[_0x87e5('0x2e')]===_0x87e5('0x2f');var _0x7d7d9d=_0x58a842[_0x87e5('0x30')];var _0x21e76f=_0x156264?0x0:_0x531a6f[_0x87e5('0x2d')];var _0x5dda07=_0x156264?_0x58a842['count']:_0x531a6f[_0x87e5('0x2d')]+_0x531a6f[_0x87e5('0x2e')];var _0x48c0e6;if(_0x5dda07>=_0x7d7d9d){_0x5dda07=_0x7d7d9d;_0x48c0e6=0xc8;}else{_0x48c0e6=0xce;}_0x553482[_0x87e5('0x2a')](_0x48c0e6);return _0x553482[_0x87e5('0x31')]('Content-Range',_0x21e76f+'-'+_0x5dda07+'/'+_0x7d7d9d)['json'](_0x58a842);}return null;};}function patchUpdates(_0x58dc1e){return function(_0x76f202){try{jsonpatch[_0x87e5('0x32')](_0x76f202,_0x58dc1e,!![]);}catch(_0xc48c67){return BPromise['reject'](_0xc48c67);}return _0x76f202[_0x87e5('0x33')]();};}function saveUpdates(_0x596d95,_0x33114d){return function(_0x469aa0){if(_0x469aa0){return _0x469aa0['update'](_0x596d95)['then'](function(_0x1133c3){return _0x1133c3;});}return null;};}function removeEntity(_0x1d28f6,_0x493e6f){return function(_0x7598e4){if(_0x7598e4){return _0x7598e4[_0x87e5('0x34')]()[_0x87e5('0x1e')](function(){var _0x1a6eb7=_0x7598e4[_0x87e5('0x35')]({'plain':!![]});var _0x32a476=_0x87e5('0x36');return db[_0x87e5('0x37')][_0x87e5('0x34')]({'where':{'type':_0x32a476,'resourceId':_0x1a6eb7['id']}})[_0x87e5('0x1e')](function(){return _0x7598e4;});})[_0x87e5('0x1e')](function(){_0x1d28f6['status'](0xcc)[_0x87e5('0x2b')]();});}};}function handleEntityNotFound(_0x4d95e7,_0x5cf7d3){return function(_0x5a5e74){if(!_0x5a5e74){_0x4d95e7[_0x87e5('0x29')](0x194);}return _0x5a5e74;};}function handleError(_0x1ca1e4,_0x125e16){_0x125e16=_0x125e16||0x1f4;return function(_0x8fa24e){logger['error'](_0x8fa24e[_0x87e5('0x38')]);if(_0x8fa24e[_0x87e5('0x39')]){delete _0x8fa24e[_0x87e5('0x39')];}_0x1ca1e4[_0x87e5('0x2a')](_0x125e16)[_0x87e5('0x3a')](_0x8fa24e);};}exports[_0x87e5('0x3b')]=function(_0x104321,_0x54e9db){var _0x2faa57={'include':[{'model':db[_0x87e5('0x3c')],'as':_0x87e5('0x3d')}]},_0x2e4fbb={},_0x55aaaf={'count':0x0,'rows':[]};var _0x59f9d8=_['map'](db[_0x87e5('0x3e')][_0x87e5('0x3f')],function(_0x457346){return{'name':_0x457346[_0x87e5('0x40')],'type':_0x457346[_0x87e5('0x41')][_0x87e5('0x42')]};});_0x2e4fbb['model']=_[_0x87e5('0x43')](_0x59f9d8,_0x87e5('0x39'));_0x2e4fbb[_0x87e5('0x44')]=_[_0x87e5('0x45')](_0x104321[_0x87e5('0x44')]);_0x2e4fbb[_0x87e5('0x46')]=_[_0x87e5('0x47')](_0x2e4fbb[_0x87e5('0x48')],_0x2e4fbb[_0x87e5('0x44')]);_0x2faa57[_0x87e5('0x49')]=_[_0x87e5('0x47')](_0x2e4fbb[_0x87e5('0x48')],qs[_0x87e5('0x4a')](_0x104321[_0x87e5('0x44')][_0x87e5('0x4a')]));_0x2faa57[_0x87e5('0x49')]=_0x2faa57[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x2faa57[_0x87e5('0x49')]:_0x2e4fbb[_0x87e5('0x48')];if(!_0x104321[_0x87e5('0x44')][_0x87e5('0x4c')](_0x87e5('0x4d'))){_0x2faa57[_0x87e5('0x2e')]=qs[_0x87e5('0x2e')](_0x104321[_0x87e5('0x44')][_0x87e5('0x2e')]);_0x2faa57['offset']=qs[_0x87e5('0x2d')](_0x104321['query'][_0x87e5('0x2d')]);}_0x2faa57[_0x87e5('0x4e')]=qs['sort'](_0x104321[_0x87e5('0x44')][_0x87e5('0x4f')]);_0x2faa57[_0x87e5('0x50')]=qs[_0x87e5('0x46')](_[_0x87e5('0x51')](_0x104321[_0x87e5('0x44')],_0x2e4fbb['filters']),_0x59f9d8);if(_0x104321[_0x87e5('0x44')][_0x87e5('0x52')]){_0x2faa57[_0x87e5('0x50')]=_[_0x87e5('0x53')](_0x2faa57['where'],{'$or':_[_0x87e5('0x43')](_0x59f9d8,function(_0x3f8b21){if(_0x3f8b21['type']!=='VIRTUAL'){var _0x27e9e9={};_0x27e9e9[_0x3f8b21[_0x87e5('0x39')]]={'$like':'%'+_0x104321[_0x87e5('0x44')][_0x87e5('0x52')]+'%'};return _0x27e9e9;}})});}_0x2faa57=_[_0x87e5('0x53')]({},_0x2faa57,_0x104321[_0x87e5('0x54')]);var _0x13c317={'where':_0x2faa57[_0x87e5('0x50')]};return db[_0x87e5('0x3e')]['count'](_0x13c317)[_0x87e5('0x1e')](function(_0x242e91){_0x55aaaf[_0x87e5('0x30')]=_0x242e91;if(_0x104321[_0x87e5('0x44')]['includeAll']){_0x2faa57[_0x87e5('0x55')]=[{'all':!![]}];}return db[_0x87e5('0x3e')][_0x87e5('0x56')](_0x2faa57);})[_0x87e5('0x1e')](function(_0x17103a){_0x55aaaf['rows']=_0x17103a;return _0x55aaaf;})['then'](respondWithFilteredResult(_0x54e9db,_0x2faa57))[_0x87e5('0x28')](handleError(_0x54e9db,null));};exports[_0x87e5('0x57')]=function(_0x27b767,_0x36ad2c){var _0x27a9de={'raw':![],'where':{'id':_0x27b767[_0x87e5('0x58')]['id']},'include':[{'model':db[_0x87e5('0x3c')],'as':_0x87e5('0x3d')}]},_0x5bec8e={};_0x5bec8e[_0x87e5('0x48')]=_['keys'](db[_0x87e5('0x3e')][_0x87e5('0x3f')]);_0x5bec8e[_0x87e5('0x44')]=_[_0x87e5('0x45')](_0x27b767[_0x87e5('0x44')]);_0x5bec8e[_0x87e5('0x46')]=_[_0x87e5('0x47')](_0x5bec8e['model'],_0x5bec8e['query']);_0x27a9de[_0x87e5('0x49')]=_[_0x87e5('0x47')](_0x5bec8e[_0x87e5('0x48')],qs[_0x87e5('0x4a')](_0x27b767[_0x87e5('0x44')][_0x87e5('0x4a')]));_0x27a9de[_0x87e5('0x49')]=_0x27a9de[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x27a9de['attributes']:_0x5bec8e[_0x87e5('0x48')];if(_0x27b767['query']['includeAll']){_0x27a9de[_0x87e5('0x55')]=[{'all':!![]}];}_0x27a9de=_['merge']({},_0x27a9de,_0x27b767[_0x87e5('0x54')]);return db[_0x87e5('0x3e')][_0x87e5('0x59')](_0x27a9de)['then'](handleEntityNotFound(_0x36ad2c,null))[_0x87e5('0x1e')](respondWithResult(_0x36ad2c,null))[_0x87e5('0x28')](handleError(_0x36ad2c,null));};exports[_0x87e5('0x5a')]=function(_0x901cb7,_0x3d4c49){return db[_0x87e5('0x3e')][_0x87e5('0x5a')](_0x901cb7[_0x87e5('0x5b')],{})[_0x87e5('0x1e')](function(_0x4ca94d){var _0x5ecfb5=_0x901cb7['user'][_0x87e5('0x35')]({'plain':!![]});if(!_0x5ecfb5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ecfb5[_0x87e5('0x5c')]===_0x87e5('0x5d')){var _0x415bab=_0x4ca94d['get']({'plain':!![]});var _0x50eca0=_0x87e5('0x36');return db[_0x87e5('0x5e')]['find']({'where':{'name':_0x50eca0,'userProfileId':_0x5ecfb5['userProfileId']},'raw':!![]})['then'](function(_0x1ddce0){if(_0x1ddce0&&_0x1ddce0[_0x87e5('0x5f')]===0x0){return db[_0x87e5('0x37')][_0x87e5('0x5a')]({'name':_0x415bab['name'],'resourceId':_0x415bab['id'],'type':_0x1ddce0[_0x87e5('0x39')],'sectionId':_0x1ddce0['id']},{})[_0x87e5('0x1e')](function(){return _0x4ca94d;});}else{return _0x4ca94d;}})[_0x87e5('0x28')](function(_0x5ee170){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ee170);throw _0x5ee170;});}return _0x4ca94d;})[_0x87e5('0x1e')](respondWithResult(_0x3d4c49,0xc9))[_0x87e5('0x28')](handleError(_0x3d4c49,null));};exports['update']=function(_0x8f0169,_0xcf62a8){if(_0x8f0169[_0x87e5('0x5b')]['id']){delete _0x8f0169[_0x87e5('0x5b')]['id'];}return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x8f0169[_0x87e5('0x58')]['id']},'include':[{'model':db[_0x87e5('0x3c')],'as':_0x87e5('0x3d')}]})[_0x87e5('0x1e')](handleEntityNotFound(_0xcf62a8,null))[_0x87e5('0x1e')](saveUpdates(_0x8f0169['body'],null))[_0x87e5('0x1e')](respondWithResult(_0xcf62a8,null))['catch'](handleError(_0xcf62a8,null));};exports['destroy']=function(_0x63cad0,_0x30692d){return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x63cad0[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x30692d,null))['then'](removeEntity(_0x30692d,null))[_0x87e5('0x28')](handleError(_0x30692d,null));};exports['describe']=function(_0x369b86,_0x153c8c){return db['SmsAccount']['describe']()['then'](respondWithResult(_0x153c8c,null))['catch'](handleError(_0x153c8c,null));};exports['addDisposition']=function(_0x125128,_0x4a406a,_0x1eca66){if(_0x125128[_0x87e5('0x5b')]['id']){delete _0x125128['body']['id'];}return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x125128[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x4a406a,null))[_0x87e5('0x1e')](function(_0x3d1604){if(_0x3d1604){_0x125128['body'][_0x87e5('0x60')]=_0x3d1604['id'];return db[_0x87e5('0x61')][_0x87e5('0x5a')](_0x125128[_0x87e5('0x5b')]);}})['then'](respondWithResult(_0x4a406a,null))[_0x87e5('0x28')](handleError(_0x4a406a,null));};exports[_0x87e5('0x62')]=function(_0xa3c652,_0xc325ed,_0x362ab4){var _0x349bfd={'raw':![],'where':{}};var _0x34b7f4={};var _0x1d31c1={'count':0x0,'rows':[]};return db[_0x87e5('0x3e')][_0x87e5('0x63')]({'where':{'id':_0xa3c652[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0xc325ed,null))[_0x87e5('0x1e')](function(_0x2a0c6c){if(_0x2a0c6c){_0x34b7f4[_0x87e5('0x48')]=_['keys'](db[_0x87e5('0x61')]['rawAttributes']);_0x34b7f4[_0x87e5('0x44')]=_[_0x87e5('0x45')](_0xa3c652['query']);_0x34b7f4[_0x87e5('0x46')]=_[_0x87e5('0x47')](_0x34b7f4['model'],_0x34b7f4[_0x87e5('0x44')]);_0x349bfd[_0x87e5('0x49')]=_[_0x87e5('0x47')](_0x34b7f4['model'],qs[_0x87e5('0x4a')](_0xa3c652['query']['fields']));_0x349bfd[_0x87e5('0x49')]=_0x349bfd[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x349bfd[_0x87e5('0x49')]:_0x34b7f4[_0x87e5('0x48')];if(!_0xa3c652[_0x87e5('0x44')][_0x87e5('0x4c')](_0x87e5('0x4d'))){_0x349bfd[_0x87e5('0x2e')]=qs[_0x87e5('0x2e')](_0xa3c652['query'][_0x87e5('0x2e')]);_0x349bfd['offset']=qs[_0x87e5('0x2d')](_0xa3c652['query']['offset']);}_0x349bfd[_0x87e5('0x4e')]=qs['sort'](_0xa3c652[_0x87e5('0x44')]['sort']);_0x349bfd['where']=qs[_0x87e5('0x46')](_[_0x87e5('0x51')](_0xa3c652[_0x87e5('0x44')],_0x34b7f4[_0x87e5('0x46')]));_0x349bfd[_0x87e5('0x50')]['SmsAccountId']=_0x2a0c6c['id'];if(_0xa3c652[_0x87e5('0x44')][_0x87e5('0x52')]){_0x349bfd[_0x87e5('0x50')]=_[_0x87e5('0x53')](_0x349bfd['where'],{'$or':_[_0x87e5('0x43')](_0x349bfd[_0x87e5('0x49')],function(_0xee8d05){var _0x11dc71={};_0x11dc71[_0xee8d05]={'$like':'%'+_0xa3c652['query'][_0x87e5('0x52')]+'%'};return _0x11dc71;})});}_0x349bfd=_['merge']({},_0x349bfd,_0xa3c652[_0x87e5('0x54')]);return db[_0x87e5('0x61')][_0x87e5('0x30')]({'where':_0x349bfd[_0x87e5('0x50')]})[_0x87e5('0x1e')](function(_0x3ff725){_0x1d31c1[_0x87e5('0x30')]=_0x3ff725;if(_0xa3c652[_0x87e5('0x44')]['includeAll']){_0x349bfd['include']=[{'all':!![]}];}return db['Disposition'][_0x87e5('0x56')](_0x349bfd);})['then'](function(_0x5ebee5){_0x1d31c1['rows']=_0x5ebee5;return _0x1d31c1;});}})['then'](respondWithFilteredResult(_0xc325ed,_0x349bfd))[_0x87e5('0x28')](handleError(_0xc325ed,null));};exports[_0x87e5('0x64')]=function(_0x15e00c,_0x2fddff,_0x478ee6){return db['SmsAccount'][_0x87e5('0x59')]({'where':{'id':_0x15e00c[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x2fddff,null))[_0x87e5('0x1e')](function(_0x4575e6){if(_0x4575e6){return _0x4575e6[_0x87e5('0x64')](_0x15e00c[_0x87e5('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x2fddff,null))[_0x87e5('0x28')](handleError(_0x2fddff,null));};exports[_0x87e5('0x65')]=function(_0x3b5829,_0x3d757b,_0x1db51c){if(_0x3b5829[_0x87e5('0x5b')]['id']){delete _0x3b5829[_0x87e5('0x5b')]['id'];}return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x3b5829['params']['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x3d757b,null))['then'](function(_0x2fd821){if(_0x2fd821){_0x3b5829['body']['SmsAccountId']=_0x2fd821['id'];return db['CannedAnswer'][_0x87e5('0x5a')](_0x3b5829[_0x87e5('0x5b')]);}})[_0x87e5('0x1e')](respondWithResult(_0x3d757b,null))['catch'](handleError(_0x3d757b,null));};exports[_0x87e5('0x66')]=function(_0x1938d7,_0x3817d5,_0x187bc9){var _0x39cbdf={'raw':![],'where':{}};var _0x1466c7={};var _0x34b9b4={'count':0x0,'rows':[]};return db[_0x87e5('0x3e')][_0x87e5('0x63')]({'where':{'id':_0x1938d7['params']['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x3817d5,null))[_0x87e5('0x1e')](function(_0x195ee0){if(_0x195ee0){_0x1466c7['model']=_[_0x87e5('0x45')](db['CannedAnswer'][_0x87e5('0x3f')]);_0x1466c7[_0x87e5('0x44')]=_[_0x87e5('0x45')](_0x1938d7[_0x87e5('0x44')]);_0x1466c7[_0x87e5('0x46')]=_[_0x87e5('0x47')](_0x1466c7[_0x87e5('0x48')],_0x1466c7[_0x87e5('0x44')]);_0x39cbdf[_0x87e5('0x49')]=_[_0x87e5('0x47')](_0x1466c7[_0x87e5('0x48')],qs[_0x87e5('0x4a')](_0x1938d7['query']['fields']));_0x39cbdf['attributes']=_0x39cbdf[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x39cbdf['attributes']:_0x1466c7[_0x87e5('0x48')];if(!_0x1938d7[_0x87e5('0x44')][_0x87e5('0x4c')](_0x87e5('0x4d'))){_0x39cbdf[_0x87e5('0x2e')]=qs[_0x87e5('0x2e')](_0x1938d7['query'][_0x87e5('0x2e')]);_0x39cbdf[_0x87e5('0x2d')]=qs[_0x87e5('0x2d')](_0x1938d7['query'][_0x87e5('0x2d')]);}_0x39cbdf[_0x87e5('0x4e')]=qs['sort'](_0x1938d7[_0x87e5('0x44')][_0x87e5('0x4f')]);_0x39cbdf[_0x87e5('0x50')]=qs['filters'](_[_0x87e5('0x51')](_0x1938d7[_0x87e5('0x44')],_0x1466c7[_0x87e5('0x46')]));_0x39cbdf[_0x87e5('0x50')][_0x87e5('0x60')]=_0x195ee0['id'];if(_0x1938d7['query'][_0x87e5('0x52')]){_0x39cbdf[_0x87e5('0x50')]=_['merge'](_0x39cbdf[_0x87e5('0x50')],{'$or':_[_0x87e5('0x43')](_0x39cbdf[_0x87e5('0x49')],function(_0x6ba753){var _0x5e88c0={};_0x5e88c0[_0x6ba753]={'$like':'%'+_0x1938d7['query']['filter']+'%'};return _0x5e88c0;})});}_0x39cbdf=_[_0x87e5('0x53')]({},_0x39cbdf,_0x1938d7[_0x87e5('0x54')]);return db['CannedAnswer'][_0x87e5('0x30')]({'where':_0x39cbdf[_0x87e5('0x50')]})[_0x87e5('0x1e')](function(_0x300853){_0x34b9b4[_0x87e5('0x30')]=_0x300853;if(_0x1938d7[_0x87e5('0x44')][_0x87e5('0x67')]){_0x39cbdf[_0x87e5('0x55')]=[{'all':!![]}];}return db[_0x87e5('0x68')][_0x87e5('0x56')](_0x39cbdf);})[_0x87e5('0x1e')](function(_0x2dddbe){_0x34b9b4['rows']=_0x2dddbe;return _0x34b9b4;});}})[_0x87e5('0x1e')](respondWithFilteredResult(_0x3817d5,_0x39cbdf))['catch'](handleError(_0x3817d5,null));};exports['removeAnswers']=function(_0x4b88f5,_0x410f04,_0x2e7280){return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x4b88f5[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x410f04,null))[_0x87e5('0x1e')](function(_0x44eb24){if(_0x44eb24){return _0x44eb24[_0x87e5('0x69')](_0x4b88f5['query'][_0x87e5('0x6a')]);}})[_0x87e5('0x1e')](respondWithStatusCode(_0x410f04,null))['catch'](handleError(_0x410f04,null));};exports[_0x87e5('0x6b')]=function(_0x5660ca,_0xac696b,_0x27c7b7){var _0x2f665c={'channel':_0x87e5('0x6c')};var _0x249013=[];var _0x12dd55=[];var _0x14abf6={};return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x5660ca[_0x87e5('0x58')]['id']},'include':[{'model':db[_0x87e5('0x6d')],'as':_0x87e5('0x6e')}]})[_0x87e5('0x1e')](handleEntityNotFound(_0xac696b,null))[_0x87e5('0x1e')](function(_0x11142d){_0x2f665c['account']=_0x11142d;_0x2f665c[_0x87e5('0x6f')]=_[_0x87e5('0x70')](_0x11142d[_0x87e5('0x6e')],[_0x87e5('0x71')],[_0x87e5('0x72')]);if(_0x2f665c['account'][_0x87e5('0x6e')]){delete _0x2f665c[_0x87e5('0x73')][_0x87e5('0x6e')];}return db[_0x87e5('0x74')][_0x87e5('0x75')]();})[_0x87e5('0x1e')](function(_0x14a82b){if(!_0x14a82b){throw new db['Sequelize'][(_0x87e5('0x76'))](_0x87e5('0x77'));}_0x249013=_[_0x87e5('0x78')](_[_0x87e5('0x45')](_0x14a82b),[_0x87e5('0x79'),_0x87e5('0x7a')]);_0x12dd55=_[_0x87e5('0x78')](_[_0x87e5('0x45')](_0x14a82b),[_0x87e5('0x79'),_0x87e5('0x7a'),_0x87e5('0x7b'),_0x87e5('0x7c')]);_0x2f665c['body']={'mapKey':'mobile'};if(_0x2f665c['account'][_0x87e5('0x41')]){switch(_0x2f665c[_0x87e5('0x73')]['type']){case _0x87e5('0x7d'):_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x7f')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')]=_0x5660ca['body'][_0x87e5('0x80')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')]=_0x5660ca['body'][_0x87e5('0x82')];break;case _0x87e5('0x83'):_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')]='+'+_0x5660ca['body'][_0x87e5('0x84')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x85')];break;case _0x87e5('0x86'):_0x2f665c['body'][_0x87e5('0x7e')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x7e')];_0x2f665c['body']['body']=_0x5660ca['body']['message'];break;case _0x87e5('0x87'):_0x2f665c['body'][_0x87e5('0x7e')]=_0x5660ca['body'][_0x87e5('0x7e')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')]=_0x5660ca['body'][_0x87e5('0x5b')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x88')];break;case'plivo':_0x2f665c[_0x87e5('0x5b')]['from']=_0x5660ca['body'][_0x87e5('0x7f')];_0x2f665c['body'][_0x87e5('0x5b')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x89')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x8a')];break;case _0x87e5('0x8b'):_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')]='+'+_0x5660ca['body'][_0x87e5('0x8c')][0x0]['from'];_0x2f665c[_0x87e5('0x5b')]['body']=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x8c')][0x0][_0x87e5('0x85')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')]=_0x5660ca['body']['results'][0x0][_0x87e5('0x81')];break;case _0x87e5('0x8d'):_0x2f665c[_0x87e5('0x5b')]['from']=_0x5660ca[_0x87e5('0x5b')]['originatingAddress'];_0x2f665c['body']['body']=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x8e')][_0x87e5('0x27')];break;case'clickatell':_0x2f665c[_0x87e5('0x5b')]['from']=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x8f')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x85')];_0x2f665c['body'][_0x87e5('0x81')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x90')];break;case _0x87e5('0x91'):_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')]=_0x5660ca[_0x87e5('0x5b')][0x0]['message']['id'];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')]=_0x5660ca[_0x87e5('0x5b')][0x0][_0x87e5('0x27')][_0x87e5('0x7e')];_0x2f665c[_0x87e5('0x5b')]['body']=_0x5660ca[_0x87e5('0x5b')][0x0]['message'][_0x87e5('0x85')];break;case _0x87e5('0x92'):_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')]=_0x5660ca['body'][_0x87e5('0x7e')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x27')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')]=_0x5660ca[_0x87e5('0x5b')]['refid'];break;}}if(_0x2f665c['body']['id']){delete _0x2f665c[_0x87e5('0x5b')]['id'];}if(_[_0x87e5('0x93')](_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')])){throw new db[(_0x87e5('0x94'))]['ValidationError'](_0x87e5('0x95'));}if(_[_0x87e5('0x93')](_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')])||_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')]===''){throw new db[(_0x87e5('0x94'))]['ValidationError'](_0x87e5('0x96'));}if(_['isNil'](_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x97')])){throw new db[(_0x87e5('0x94'))][(_0x87e5('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x12dd55);}if(!_[_0x87e5('0x98')](_0x12dd55,_0x2f665c['body'][_0x87e5('0x97')])){throw new db[(_0x87e5('0x94'))]['ValidationError'](_0x87e5('0x99')+_0x12dd55);}_0x14abf6[_0x2f665c[_0x87e5('0x5b')]['mapKey']]=_0x2f665c['body'][_0x87e5('0x7e')];return db[_0x87e5('0x9a')][_0x87e5('0x59')]({'where':{'id':_0x2f665c[_0x87e5('0x73')][_0x87e5('0x7c')]},'include':[{'model':db[_0x87e5('0x74')],'as':'Contacts','where':_0x14abf6,'limit':0x1,'order':[[_0x87e5('0x7a'),'DESC']]}]});})[_0x87e5('0x1e')](handleEntityNotFound(_0xac696b,null))['then'](function(_0x11851f){if(_0x11851f){_0x2f665c[_0x87e5('0x9b')]=_['omit'](_0x11851f,['Contacts']);if(_0x11851f[_0x87e5('0x9c')][_0x87e5('0x4b')]){return _0x11851f['Contacts'][0x0];}var _0x504ad9=_[_0x87e5('0x15')](_0x2f665c[_0x87e5('0x5b')],{'firstName':_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')],'ListId':_0x11851f['id']});_0x504ad9[_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x97')]]=_0x2f665c[_0x87e5('0x5b')]['from'];return db[_0x87e5('0x74')][_0x87e5('0x5a')](_0x504ad9,{'fields':_0x249013,'raw':!![]});}})['then'](handleEntityNotFound(_0xac696b,null))[_0x87e5('0x1e')](function(_0x23e571){if(_0x23e571){_0x2f665c['contact']=_0x23e571;var _0x5eed0e={'ContactId':_0x23e571['id'],'phone':_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')],'SmsAccountId':_0x5660ca[_0x87e5('0x58')]['id']};var _0x49bd6a={'ContactId':_0x23e571['id'],'SmsAccountId':_0x5660ca[_0x87e5('0x58')]['id'],'closed':![]};return db[_0x87e5('0x9d')][_0x87e5('0x59')]({'where':_0x49bd6a})[_0x87e5('0x1e')](function(_0x28d15f){if(_0x28d15f){return[_0x28d15f,![]];}return db[_0x87e5('0x9d')][_0x87e5('0x5a')](_0x5eed0e)[_0x87e5('0x1e')](function(_0x59a30c){return[_0x59a30c,!![]];});});}})[_0x87e5('0x9e')](function(_0x1243c4,_0x2adffb){_0x2f665c[_0x87e5('0x9f')]=_0x1243c4[_0x87e5('0x35')]({'plain':!![]});_0x2f665c['interaction'][_0x87e5('0xa0')]=![];if(_0x2adffb){if(_0x2f665c[_0x87e5('0x73')][_0x87e5('0xa1')]){_0x2f665c['applications'][_0x87e5('0xa2')]({'id':0x0,'priority':_0x2f665c[_0x87e5('0x6f')][_0x87e5('0x4b')]+0x1,'app':_0x87e5('0xa3'),'appdata':_0x87e5('0xa4'),'interval':_0x87e5('0xa5')});}_0x2f665c['interaction'][_0x87e5('0xa0')]=!![];}return db[_0x87e5('0xa6')]['create']({'phone':_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')],'messageId':_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')],'body':_0x2f665c['body'][_0x87e5('0x5b')],'SmsAccountId':_0x5660ca[_0x87e5('0x58')]['id'],'SmsInteractionId':_0x1243c4['id'],'direction':'in','ContactId':_0x1243c4['ContactId'],'AttachmentId':_0x2f665c[_0x87e5('0x5b')][_0x87e5('0xa7')]});})[_0x87e5('0x1e')](function(_0x494530){_0x2f665c[_0x87e5('0x27')]=_0x494530;if(_0x2f665c[_0x87e5('0x9f')][_0x87e5('0xa8')]){return db[_0x87e5('0xa9')][_0x87e5('0x59')]({'attributes':['id',_0x87e5('0x39')],'where':{'id':_0x2f665c['interaction'][_0x87e5('0xa8')]}})['then'](function(_0x5d8468){if(_0x5d8468){_0x2f665c[_0x87e5('0x6f')][_0x87e5('0xaa')]({'id':0x0,'priority':0x0,'app':_0x87e5('0xab'),'appdata':_0x5d8468['name']+','+(_0x2f665c[_0x87e5('0x73')][_0x87e5('0xac')]||0xa),'interval':_0x87e5('0xa5')});}return respondWithRpcPromise('Start',_0x87e5('0xad'),_0x2f665c);});}return respondWithRpcPromise(_0x87e5('0xae'),_0x87e5('0xad'),_0x2f665c);})[_0x87e5('0x1e')](function(_0x50118a){if(_0x50118a){var _0x4daf11=0xc8;var _0x1242e9=_0x87e5('0xaf');logger[_0x87e5('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1242e9,_0x4daf11,'entity\x20found');logger[_0x87e5('0x22')](_0x87e5('0xb0'),_0x1242e9,_0x4daf11,_0x87e5('0xb1'),JSON[_0x87e5('0x24')](_0x50118a));if(_0x2f665c[_0x87e5('0x73')]['type']===_0x87e5('0x7d')){return _0xac696b['status'](_0x4daf11)[_0x87e5('0x31')]('Content-Type','text/xml')['send'](_0x87e5('0xb2'));}else{return _0xac696b['status'](_0x4daf11)[_0x87e5('0x2c')](_0x50118a);}}})['catch'](handleError(_0xac696b,null));};exports['addApplications']=function(_0xda63fd,_0x42e02c,_0x4cdb0b){return db[_0x87e5('0x3e')][_0x87e5('0x63')]({'where':{'id':_0xda63fd['params']['id']}})['then'](handleEntityNotFound(_0x42e02c,null))[_0x87e5('0x1e')](function(_0x1aa9f4){if(_0x1aa9f4){return db[_0x87e5('0xb3')][_0x87e5('0xb4')](function(_0x5013c4){return db[_0x87e5('0x6d')][_0x87e5('0x34')]({'where':{'SmsAccountId':_0xda63fd[_0x87e5('0x58')]['id']},'transaction':_0x5013c4})[_0x87e5('0x1e')](function(_0x285251){var _0x520fc8=_['map'](_0xda63fd[_0x87e5('0x5b')],function(_0x38ef45){_0x38ef45['SmsAccountId']=_0xda63fd['params']['id'];return _0x38ef45;});return db['SmsApplication'][_0x87e5('0xb5')](_0x520fc8,{'transaction':_0x5013c4});});})['then'](function(){return db[_0x87e5('0x6d')][_0x87e5('0xb6')]({'where':{'SmsAccountId':_0xda63fd['params']['id']},'order':_0x87e5('0x71')});});}})[_0x87e5('0x1e')](respondWithResult(_0x42e02c,null))[_0x87e5('0x28')](handleError(_0x42e02c,null));};exports['getApplications']=function(_0x3189a5,_0xf8ae95,_0x445401){var _0x20af2f={};var _0x4279b1={};var _0x35ee0f;var _0x55606c;return db[_0x87e5('0x3e')][_0x87e5('0x63')]({'where':{'id':_0x3189a5[_0x87e5('0x58')]['id']}})['then'](handleEntityNotFound(_0xf8ae95,null))['then'](function(_0x176fc2){if(_0x176fc2){_0x35ee0f=_0x176fc2;_0x4279b1[_0x87e5('0x48')]=_[_0x87e5('0x45')](db['SmsApplication'][_0x87e5('0x3f')]);_0x4279b1[_0x87e5('0x44')]=_['keys'](_0x3189a5[_0x87e5('0x44')]);_0x4279b1[_0x87e5('0x46')]=_['intersection'](_0x4279b1[_0x87e5('0x48')],_0x4279b1[_0x87e5('0x44')]);_0x20af2f['attributes']=_[_0x87e5('0x47')](_0x4279b1['model'],qs[_0x87e5('0x4a')](_0x3189a5[_0x87e5('0x44')][_0x87e5('0x4a')]));_0x20af2f[_0x87e5('0x49')]=_0x20af2f[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x20af2f[_0x87e5('0x49')]:_0x4279b1[_0x87e5('0x48')];_0x20af2f[_0x87e5('0x4e')]=qs[_0x87e5('0x4f')](_0x3189a5[_0x87e5('0x44')][_0x87e5('0x4f')]);_0x20af2f['where']=qs[_0x87e5('0x46')](_['pick'](_0x3189a5[_0x87e5('0x44')],_0x4279b1[_0x87e5('0x46')]));if(_0x3189a5[_0x87e5('0x44')][_0x87e5('0x52')]){_0x20af2f[_0x87e5('0x50')]=_[_0x87e5('0x53')](_0x20af2f['where'],{'$or':_[_0x87e5('0x43')](_0x20af2f['attributes'],function(_0x46e825){var _0x55f620={};_0x55f620[_0x46e825]={'$like':'%'+_0x3189a5['query'][_0x87e5('0x52')]+'%'};return _0x55f620;})});}_0x20af2f=_[_0x87e5('0x53')]({},_0x20af2f,_0x3189a5['options']);return _0x35ee0f[_0x87e5('0xb7')](_0x20af2f);}})['then'](function(_0x2c017b){if(_0x2c017b){_0x55606c=_0x2c017b[_0x87e5('0x4b')];if(!_0x3189a5[_0x87e5('0x44')][_0x87e5('0x4c')](_0x87e5('0x4d'))){_0x20af2f['limit']=qs[_0x87e5('0x2e')](_0x3189a5[_0x87e5('0x44')][_0x87e5('0x2e')]);_0x20af2f[_0x87e5('0x2d')]=qs['offset'](_0x3189a5[_0x87e5('0x44')]['offset']);}return _0x35ee0f[_0x87e5('0xb7')](_0x20af2f);}})['then'](function(_0x10c35d){if(_0x10c35d){return _0x10c35d?{'count':_0x55606c,'rows':_0x10c35d}:null;}})[_0x87e5('0x1e')](respondWithResult(_0xf8ae95,null))[_0x87e5('0x28')](handleError(_0xf8ae95,null));};exports[_0x87e5('0xb8')]=function(_0x235147,_0x5de6ce,_0x76c5cd){var _0x479f88={'raw':![],'where':{}};var _0x1cb3c1={};var _0x496542={'count':0x0,'rows':[]};return db[_0x87e5('0x3e')][_0x87e5('0x63')]({'where':{'id':_0x235147[_0x87e5('0x58')]['id']}})['then'](handleEntityNotFound(_0x5de6ce,null))[_0x87e5('0x1e')](function(_0x4c92ae){if(_0x4c92ae){_0x1cb3c1['model']=_[_0x87e5('0x45')](db['SmsInteraction'][_0x87e5('0x3f')]);_0x1cb3c1[_0x87e5('0x44')]=_[_0x87e5('0x45')](_0x235147[_0x87e5('0x44')]);_0x1cb3c1[_0x87e5('0x46')]=_[_0x87e5('0x47')](_0x1cb3c1[_0x87e5('0x48')],_0x1cb3c1['query']);_0x479f88[_0x87e5('0x49')]=_[_0x87e5('0x47')](_0x1cb3c1[_0x87e5('0x48')],qs[_0x87e5('0x4a')](_0x235147[_0x87e5('0x44')][_0x87e5('0x4a')]));_0x479f88[_0x87e5('0x49')]=_0x479f88[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x479f88[_0x87e5('0x49')]:_0x1cb3c1[_0x87e5('0x48')];if(!_0x235147['query'][_0x87e5('0x4c')]('nolimit')){_0x479f88[_0x87e5('0x2e')]=qs[_0x87e5('0x2e')](_0x235147[_0x87e5('0x44')][_0x87e5('0x2e')]);_0x479f88[_0x87e5('0x2d')]=qs[_0x87e5('0x2d')](_0x235147[_0x87e5('0x44')][_0x87e5('0x2d')]);}_0x479f88[_0x87e5('0x4e')]=qs['sort'](_0x235147[_0x87e5('0x44')][_0x87e5('0x4f')]);_0x479f88[_0x87e5('0x50')]=qs[_0x87e5('0x46')](_[_0x87e5('0x51')](_0x235147[_0x87e5('0x44')],_0x1cb3c1['filters']));_0x479f88[_0x87e5('0x50')][_0x87e5('0x60')]=_0x4c92ae['id'];if(_0x235147[_0x87e5('0x44')]['filter']){_0x479f88['where']=_[_0x87e5('0x53')](_0x479f88['where'],{'$or':_[_0x87e5('0x43')](_0x479f88['attributes'],function(_0x30f2f3){var _0x4c2720={};_0x4c2720[_0x30f2f3]={'$like':'%'+_0x235147['query'][_0x87e5('0x52')]+'%'};return _0x4c2720;})});}_0x479f88=_[_0x87e5('0x53')]({},_0x479f88,_0x235147[_0x87e5('0x54')]);return db[_0x87e5('0x9d')][_0x87e5('0x30')]({'where':_0x479f88['where']})['then'](function(_0x4ab199){_0x496542[_0x87e5('0x30')]=_0x4ab199;if(_0x235147['query'][_0x87e5('0x67')]){_0x479f88[_0x87e5('0x55')]=[{'model':db['CmContact'],'as':_0x87e5('0xb9'),'required':![]},{'model':db[_0x87e5('0xa9')],'as':'Owner','attributes':[_0x87e5('0x39'),_0x87e5('0xba'),_0x87e5('0xbb')],'required':![]},{'model':db['Tag'],'as':_0x87e5('0xbc'),'attributes':['id',_0x87e5('0x39'),_0x87e5('0xbd')],'where':_0x235147[_0x87e5('0x44')][_0x87e5('0xbe')]?{'id':_0x235147['query'][_0x87e5('0xbe')]}:undefined,'required':_0x235147['query'][_0x87e5('0xbe')]?!![]:![]}];}return db[_0x87e5('0x9d')][_0x87e5('0x56')](_0x479f88);})['then'](function(_0x4d331b){_0x496542[_0x87e5('0xbf')]=_0x4d331b;return _0x496542;});}})[_0x87e5('0x1e')](respondWithFilteredResult(_0x5de6ce,_0x479f88))[_0x87e5('0x28')](handleError(_0x5de6ce,null));};exports[_0x87e5('0x3a')]=function(_0x2bbc91,_0x2c567b,_0x10cc90){var _0x3133a7,_0x381745,_0x89b883;if(_[_0x87e5('0x93')](_0x2bbc91['body'][_0x87e5('0x5b')])||_0x2bbc91[_0x87e5('0x5b')][_0x87e5('0x5b')]===''){throw new db[(_0x87e5('0x94'))][(_0x87e5('0x76'))](_0x87e5('0x96'));}if(_[_0x87e5('0x93')](_0x2bbc91['body']['to'])){throw new db[(_0x87e5('0x94'))][(_0x87e5('0x76'))](_0x87e5('0xc0'));}_0x3133a7=_0x2bbc91['body']['to'];return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x2bbc91[_0x87e5('0x58')]['id']},'include':[{'model':db[_0x87e5('0x9a')],'as':_0x87e5('0xc1'),'include':[{'model':db[_0x87e5('0x74')],'as':_0x87e5('0x9c'),'where':{'mobile':_0x3133a7},'limit':0x1,'order':[[_0x87e5('0x7a'),_0x87e5('0xc2')]]}]}]})[_0x87e5('0x1e')](handleEntityNotFound(_0x2c567b,null))[_0x87e5('0x1e')](function(_0x3b427a){if(_0x3b427a&&_0x3b427a[_0x87e5('0xc1')]){_0x381745=_0x3b427a[_0x87e5('0x35')]({'plain':!![]});if(_0x381745[_0x87e5('0xc1')]&&_0x381745[_0x87e5('0xc1')]['Contacts'][_0x87e5('0x4b')]){return _0x381745['List'][_0x87e5('0x9c')][0x0];}return db[_0x87e5('0x74')]['create'](_[_0x87e5('0x15')](_0x2bbc91[_0x87e5('0x5b')],{'firstName':_0x3133a7,'mobile':_0x3133a7,'phone':_0x3133a7,'ListId':_0x381745[_0x87e5('0x7c')]}));}})[_0x87e5('0x1e')](handleEntityNotFound(_0x2c567b,null))[_0x87e5('0x1e')](function(_0x361d8d){if(_0x361d8d){_0x89b883=_0x361d8d;return db[_0x87e5('0x9d')][_0x87e5('0x59')]({'where':{'ContactId':_0x89b883['id'],'closed':![],'SmsAccountId':_0x381745['id']}})[_0x87e5('0x1e')](function(_0x6db049){if(_0x6db049){return[_0x6db049,![]];}return db['SmsInteraction']['create']({'UserId':_0x2bbc91[_0x87e5('0x5d')]['id'],'ContactId':_0x89b883['id'],'SmsAccountId':_0x381745['id'],'phone':_0x3133a7,'firstMsgDirection':_0x87e5('0xc3'),'Messages':[_['merge'](_0x2bbc91[_0x87e5('0x5b')],{'read':![],'body':_0x2bbc91[_0x87e5('0x5b')][_0x87e5('0x5b')],'phone':_0x3133a7,'SmsAccountId':_0x381745['id'],'UserId':_0x2bbc91['user']['id'],'ContactId':_0x89b883['id']})]},{'include':[{'model':db[_0x87e5('0xa6')],'as':_0x87e5('0xc4')}]})[_0x87e5('0x1e')](function(_0x4ff16d){return[_0x4ff16d,!![]];});});}})[_0x87e5('0x9e')](function(_0x49867f,_0x2073e5){if(_0x2073e5){return _0x49867f;}return db[_0x87e5('0xa6')][_0x87e5('0x5a')](_[_0x87e5('0x53')](_0x2bbc91['body'],{'read':![],'body':_0x2bbc91[_0x87e5('0x5b')]['body'],'phone':_0x3133a7,'SmsAccountId':_0x381745['id'],'SmsInteractionId':_0x49867f['id'],'UserId':_0x2bbc91[_0x87e5('0x5d')]['id'],'ContactId':_0x89b883['id']}))[_0x87e5('0x1e')](function(_0x1deceb){_0x49867f[_0x87e5('0xc5')]['Messages']=[];_0x49867f['dataValues'][_0x87e5('0xc4')]['push'](_0x1deceb[_0x87e5('0xc5')]);return _0x49867f;});})[_0x87e5('0x1e')](respondWithResult(_0x2c567b,null))[_0x87e5('0x28')](handleError(_0x2c567b,null));};exports['status']=function(_0x14c064,_0x36a7b6,_0x23f83e){if(_0x14c064[_0x87e5('0x5b')]['id']){delete _0x14c064[_0x87e5('0x5b')]['id'];}var _0x2e74d3,_0xfe8602,_0x286de2;return db[_0x87e5('0x3e')]['find']({'where':{'id':_0x14c064[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x36a7b6,null))[_0x87e5('0x1e')](function(_0x451df6){if(_0x451df6){_0x286de2=_0x451df6;logger[_0x87e5('0x22')](_0x87e5('0x23'),_0x87e5('0x2a'),_0x87e5('0xc6'),_0x451df6['type'],util[_0x87e5('0xc7')](_0x14c064['body'],{'showHidden':![],'depth':null}));switch(_0x451df6['type']){case _0x87e5('0x83'):if(_0x14c064[_0x87e5('0x5b')]['skebby_dispatch_id']&&_0x14c064['body']['status']){_0xfe8602=_0x14c064['body'][_0x87e5('0x2a')];return db['SmsMessage'][_0x87e5('0x59')]({'where':{'messageId':_0x14c064[_0x87e5('0x5b')][_0x87e5('0xc8')]}});}break;case _0x87e5('0x86'):if(_0x14c064[_0x87e5('0x5b')][_0x87e5('0xc9')]&&_0x14c064[_0x87e5('0x5b')][_0x87e5('0xca')]){_0xfe8602=_0x14c064[_0x87e5('0x5b')]['statusInt'];return db[_0x87e5('0xa6')]['find']({'where':{'messageId':_0x14c064[_0x87e5('0x5b')]['requestid']}});}break;case _0x87e5('0x87'):if(_0x14c064['body'][_0x87e5('0x88')]&&_0x14c064[_0x87e5('0x5b')][_0x87e5('0xcb')]){_0xfe8602=_0x14c064[_0x87e5('0x5b')][_0x87e5('0xcb')];return db['SmsMessage'][_0x87e5('0x59')]({'where':{'messageId':_0x14c064[_0x87e5('0x5b')][_0x87e5('0x88')]}});}break;case'infobip':var _0x183fb3=_0x14c064[_0x87e5('0x5b')]['results'][0x0];if(_0x183fb3[_0x87e5('0x81')]&&_0x183fb3[_0x87e5('0x2a')]['groupName']===_0x87e5('0xcc')){_0xfe8602=_0x183fb3[_0x87e5('0x2a')][_0x87e5('0xcd')];return db['SmsMessage'][_0x87e5('0x59')]({'where':{'messageId':_0x183fb3[_0x87e5('0x81')]}});}break;case _0x87e5('0xce'):if(_0x14c064[_0x87e5('0x5b')][_0x87e5('0x81')]&&_0x14c064[_0x87e5('0x5b')][_0x87e5('0x2a')]){_0xfe8602=_0x14c064[_0x87e5('0x5b')][_0x87e5('0x2a')];return db['SmsMessage'][_0x87e5('0x59')]({'where':{'messageId':_0x14c064['body'][_0x87e5('0x81')]}});}break;case _0x87e5('0x91'):if(_0x14c064[_0x87e5('0x5b')][0x0][_0x87e5('0x27')]['id']){_0xfe8602=_0x14c064[_0x87e5('0x5b')][0x0][_0x87e5('0x41')];return db[_0x87e5('0xa6')][_0x87e5('0x59')]({'where':{'messageId':_0x14c064['body'][0x0]['message']['id']}});}break;case'intelepeer':if(_0x14c064['body'][_0x87e5('0xcf')]&&_0x14c064[_0x87e5('0x5b')]['status']){_0xfe8602=_0x14c064[_0x87e5('0x5b')][_0x87e5('0x2a')];return db[_0x87e5('0xa6')]['find']({'where':{'messageId':_0x14c064[_0x87e5('0x5b')][_0x87e5('0xcf')]}});}break;}}})[_0x87e5('0x1e')](handleEntityNotFound(_0x36a7b6,null))['then'](function(_0x9fa00e){if(_0x9fa00e){_0x2e74d3=_0x9fa00e;switch(_0x286de2[_0x87e5('0x41')]){case _0x87e5('0x83'):if(_0xfe8602==='DELIVERED'){return _0x2e74d3[_0x87e5('0xd0')]({'read':!![]});}else{logger['error'](_0x87e5('0x23'),_0x87e5('0x2a'),'skebby',util[_0x87e5('0xc7')](_0x14c064['body'],{'showHidden':![],'depth':null}));}break;case _0x87e5('0x86'):if(_0xfe8602==='1'){return _0x2e74d3[_0x87e5('0xd0')]({'read':!![]});}else{logger[_0x87e5('0x25')](_0x87e5('0x23'),_0x87e5('0x2a'),_0x87e5('0x83'),util[_0x87e5('0xc7')](_0x14c064[_0x87e5('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x87e5('0x87'):if(!_0x14c064['body'][_0x87e5('0xd1')]&&_0xfe8602>=0xc8&&_0xfe8602<=0xce){return _0x2e74d3[_0x87e5('0xd0')]({'read':!![]});}else{logger[_0x87e5('0x25')](_0x87e5('0x23'),'status',_0x87e5('0x87'),util[_0x87e5('0xc7')](_0x14c064[_0x87e5('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x87e5('0x8b'):var _0x5a7a44=_0x14c064['body'][_0x87e5('0x8c')][0x0];if(_0x5a7a44['status']['groupName']===_0x87e5('0xcc')){return _0x2e74d3[_0x87e5('0xd0')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x87e5('0x2a'),_0x87e5('0x8b'),util[_0x87e5('0xc7')](_0x14c064[_0x87e5('0x5b')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0xfe8602==_0x87e5('0xd2')||_0xfe8602=='RECEIVED_BY_RECIPIENT'){return _0x2e74d3[_0x87e5('0xd0')]({'read':!![]});}else{logger[_0x87e5('0x25')](_0x87e5('0x23'),_0x87e5('0x2a'),_0x87e5('0xce'),util[_0x87e5('0xc7')](_0x14c064['body'],{'showHidden':![],'depth':null}));}break;case _0x87e5('0x91'):if(_0xfe8602==_0x87e5('0xd3')){return _0x2e74d3[_0x87e5('0xd0')]({'read':!![]});}else{logger[_0x87e5('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x87e5('0x91'),util['inspect'](_0x14c064[_0x87e5('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x87e5('0x92'):if(_0xfe8602===_0x87e5('0xd4')||_0xfe8602===_0x87e5('0xd5')){return _0x2e74d3['update']({'read':!![]});}else{logger['error'](_0x87e5('0x23'),_0x87e5('0x2a'),'intelepeer',util[_0x87e5('0xc7')](_0x14c064[_0x87e5('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x2e74d3;}})['then'](respondWithResult(_0x36a7b6,null))[_0x87e5('0x28')](handleError(_0x36a7b6,null));};exports[_0x87e5('0xd6')]=function(_0x42b186,_0x87760e,_0x3f1d4d){var _0x5cfffc,_0x23dd2b,_0x194024;return db[_0x87e5('0x3e')]['find']({'where':{'id':_0x42b186[_0x87e5('0x58')]['id']}})['then'](handleEntityNotFound(_0x87760e,null))['then'](function(_0x56d9c8){if(_0x56d9c8){_0x194024=_0x56d9c8;logger[_0x87e5('0x22')](_0x87e5('0x23'),_0x87e5('0x2a'),_0x87e5('0xc6'),_0x56d9c8[_0x87e5('0x41')],util['inspect'](_0x42b186[_0x87e5('0x44')],{'showHidden':![],'depth':null}));switch(_0x56d9c8['type']){case _0x87e5('0x8d'):if(_0x42b186[_0x87e5('0x44')][_0x87e5('0xd7')]&&_0x42b186[_0x87e5('0x44')][_0x87e5('0xd8')]){_0x23dd2b=_0x42b186[_0x87e5('0x44')][_0x87e5('0xd8')];return db[_0x87e5('0xa6')][_0x87e5('0x59')]({'where':{'messageId':_0x42b186['query'][_0x87e5('0xd7')]}});}break;}}})[_0x87e5('0x1e')](handleEntityNotFound(_0x87760e,null))[_0x87e5('0x1e')](function(_0x34fc35){if(_0x34fc35){_0x5cfffc=_0x34fc35;switch(_0x194024[_0x87e5('0x41')]){case _0x87e5('0x8d'):if(_0x23dd2b==='2'||_0x23dd2b==='6'){return _0x5cfffc[_0x87e5('0xd0')]({'read':!![]});}else{logger[_0x87e5('0x25')](_0x87e5('0x23'),_0x87e5('0x2a'),'csc',util['inspect'](_0x42b186['query'],{'showHidden':![],'depth':null}));};break;}return _0x5cfffc;}})[_0x87e5('0x1e')](respondWithResult(_0x87760e,null))[_0x87e5('0x28')](handleError(_0x87760e,null));};exports[_0x87e5('0xd9')]=function(_0x297c54,_0x1e7096,_0x52b219){return db[_0x87e5('0x3e')]['find']({'where':{'id':_0x297c54[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x1e7096,null))[_0x87e5('0x1e')](function(_0x4773de){if(_0x4773de){return _0x4773de[_0x87e5('0xd9')](_0x297c54[_0x87e5('0x5b')][_0x87e5('0x6a')],_[_0x87e5('0xda')](_0x297c54[_0x87e5('0x5b')],[_0x87e5('0x6a'),'id'])||{})[_0x87e5('0x9e')](function(_0xb5d408){for(var _0x53b2ad=0x0;_0x53b2ad<_0x297c54[_0x87e5('0x5b')][_0x87e5('0x6a')]['length'];_0x53b2ad+=0x1){socket[_0x87e5('0xdb')]('userSmsAccount:save',{'UserId':Number(_0x297c54['body']['ids'][_0x53b2ad]),'SmsAccountId':Number(_0x297c54['params']['id'])});}return _0xb5d408;});}})[_0x87e5('0x1e')](respondWithResult(_0x1e7096,null))[_0x87e5('0x28')](handleError(_0x1e7096,null));};exports[_0x87e5('0xdc')]=function(_0x39ce1a,_0x248ad8,_0x40956c){return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x39ce1a[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x248ad8,null))[_0x87e5('0x1e')](function(_0x1dc613){if(_0x1dc613){return _0x1dc613[_0x87e5('0xdc')](_0x39ce1a[_0x87e5('0x44')]['ids'])['then'](function(){if(_[_0x87e5('0xdd')](_0x39ce1a[_0x87e5('0x44')][_0x87e5('0x6a')])){for(var _0x860828=0x0;_0x860828<_0x39ce1a['query']['ids'][_0x87e5('0x4b')];_0x860828+=0x1){socket['emit'](_0x87e5('0xde'),{'UserId':Number(_0x39ce1a[_0x87e5('0x44')][_0x87e5('0x6a')][_0x860828]),'SmsAccountId':Number(_0x39ce1a[_0x87e5('0x58')]['id'])});}}else{socket[_0x87e5('0xdb')]('userSmsAccount:remove',{'UserId':Number(_0x39ce1a[_0x87e5('0x44')][_0x87e5('0x6a')]),'SmsAccountId':Number(_0x39ce1a[_0x87e5('0x58')]['id'])});}});}})[_0x87e5('0x1e')](respondWithStatusCode(_0x248ad8,null))['catch'](handleError(_0x248ad8,null));};exports[_0x87e5('0xdf')]=function(_0x4bf8ae,_0x72f43c,_0x545919){var _0x1ced23={};var _0xfdba32={};var _0x4a4364;var _0x885b72;return db[_0x87e5('0x3e')][_0x87e5('0x63')]({'where':{'id':_0x4bf8ae[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x72f43c,null))[_0x87e5('0x1e')](function(_0x1ad5cd){if(_0x1ad5cd){_0x4a4364=_0x1ad5cd;_0xfdba32['model']=_[_0x87e5('0x45')](db[_0x87e5('0xa9')]['rawAttributes']);_0xfdba32[_0x87e5('0x44')]=_['keys'](_0x4bf8ae[_0x87e5('0x44')]);_0xfdba32[_0x87e5('0x46')]=_[_0x87e5('0x47')](_0xfdba32[_0x87e5('0x48')],_0xfdba32[_0x87e5('0x44')]);_0x1ced23['attributes']=_['intersection'](_0xfdba32['model'],qs['fields'](_0x4bf8ae[_0x87e5('0x44')][_0x87e5('0x4a')]));_0x1ced23[_0x87e5('0x49')]=_0x1ced23[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x1ced23[_0x87e5('0x49')]:_0xfdba32['model'];_0x1ced23[_0x87e5('0x4e')]=qs[_0x87e5('0x4f')](_0x4bf8ae[_0x87e5('0x44')][_0x87e5('0x4f')]);_0x1ced23['where']=qs['filters'](_[_0x87e5('0x51')](_0x4bf8ae[_0x87e5('0x44')],_0xfdba32['filters']));if(_0x4bf8ae[_0x87e5('0x44')]['filter']){_0x1ced23[_0x87e5('0x50')]=_['merge'](_0x1ced23[_0x87e5('0x50')],{'$or':_[_0x87e5('0x43')](_0x1ced23[_0x87e5('0x49')],function(_0x12f310){var _0x3ff4d8={};_0x3ff4d8[_0x12f310]={'$like':'%'+_0x4bf8ae[_0x87e5('0x44')][_0x87e5('0x52')]+'%'};return _0x3ff4d8;})});}_0x1ced23=_[_0x87e5('0x53')]({},_0x1ced23,_0x4bf8ae[_0x87e5('0x54')]);return _0x4a4364[_0x87e5('0xdf')](_0x1ced23);}})[_0x87e5('0x1e')](function(_0x4f0d5c){if(_0x4f0d5c){_0x885b72=_0x4f0d5c[_0x87e5('0x4b')];if(!_0x4bf8ae[_0x87e5('0x44')][_0x87e5('0x4c')](_0x87e5('0x4d'))){_0x1ced23[_0x87e5('0x2e')]=qs[_0x87e5('0x2e')](_0x4bf8ae[_0x87e5('0x44')][_0x87e5('0x2e')]);_0x1ced23[_0x87e5('0x2d')]=qs[_0x87e5('0x2d')](_0x4bf8ae[_0x87e5('0x44')][_0x87e5('0x2d')]);}return _0x4a4364[_0x87e5('0xdf')](_0x1ced23);}})['then'](function(_0x303700){if(_0x303700){return _0x303700?{'count':_0x885b72,'rows':_0x303700}:null;}})[_0x87e5('0x1e')](respondWithResult(_0x72f43c,null))[_0x87e5('0x28')](handleError(_0x72f43c,null));};
\ No newline at end of file
+var _0x2ff2=['dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','SmsMessage','requestid','statusInt','status_code','infobip','groupName','DELIVERED','bandwidth','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','message-id','state','addAgents','ids','userSmsAccount:save','removeAgents','emit','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','findOne','addAnswer','CannedAnswer','pick','removeAnswers','notify','sms','SmsApplication','account','applications','orderBy','Applications','asc','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','skebby','sender','text','connectel','clicksend','message_id','plivo','From','Text','MessageUUID','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','omit','contact','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','agent','Start','receiveMessage','entity\x20found','debug','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','DESC','user','out','Messages'];(function(_0x267a30,_0x1f688a){var _0x4f525f=function(_0x3b0c97){while(--_0x3b0c97){_0x267a30['push'](_0x267a30['shift']());}};_0x4f525f(++_0x1f688a);}(_0x2ff2,0x1e4));var _0x22ff=function(_0x5d5177,_0x24d3c8){_0x5d5177=_0x5d5177-0x0;var _0x195c11=_0x2ff2[_0x5d5177];return _0x195c11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22ff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x22ff('0x1'));var rp=require(_0x22ff('0x2'));var moment=require(_0x22ff('0x3'));var BPromise=require(_0x22ff('0x4'));var Mustache=require('mustache');var util=require(_0x22ff('0x5'));var path=require(_0x22ff('0x6'));var sox=require(_0x22ff('0x7'));var csv=require(_0x22ff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x22ff('0x9'));var _=require(_0x22ff('0xa'));var squel=require('squel');var crypto=require(_0x22ff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x22ff('0xc'));var toCsv=require(_0x22ff('0x8'));var querystring=require(_0x22ff('0xd'));var Papa=require('papaparse');var Redis=require(_0x22ff('0xe'));var authService=require(_0x22ff('0xf'));var qs=require(_0x22ff('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x22ff('0x11'));var logger=require(_0x22ff('0x12'))(_0x22ff('0x13'));var utils=require(_0x22ff('0x14'));var config=require(_0x22ff('0x15'));var licenseUtil=require(_0x22ff('0x16'));var db=require(_0x22ff('0x17'))['db'];config[_0x22ff('0x18')]=_[_0x22ff('0x19')](config[_0x22ff('0x18')],{'host':_0x22ff('0x1a'),'port':0x18eb});var socket=require(_0x22ff('0x1b'))(new Redis(config[_0x22ff('0x18')]));require(_0x22ff('0x1c'))[_0x22ff('0x1d')](socket);var jayson=require(_0x22ff('0x1e'));var client=jayson[_0x22ff('0x1f')][_0x22ff('0x20')]({'port':0x232c});function respondWithRpcPromise(_0xf0651f,_0x5a4aed,_0x5d9b26,_0x3eb6a9){return new BPromise(function(_0xdf4695,_0x427186){var _0x1323a4=_0x3eb6a9||client;return _0x1323a4[_0x22ff('0x21')](_0xf0651f,_0x5d9b26)[_0x22ff('0x22')](function(_0x4d951c){logger[_0x22ff('0x23')](_0x22ff('0x24'),_0x5a4aed,_0x22ff('0x25'));logger['debug'](_0x22ff('0x26'),_0x5a4aed,_0x22ff('0x25'),JSON[_0x22ff('0x27')](_0x4d951c));if(_0x4d951c['error']){if(_0x4d951c[_0x22ff('0x28')][_0x22ff('0x29')]===0x1f4){logger['error'](_0x22ff('0x24'),_0x5a4aed,_0x4d951c['error'][_0x22ff('0x2a')]);return _0x427186(_0x4d951c['error'][_0x22ff('0x2a')]);}logger[_0x22ff('0x28')]('SmsAccount,\x20%s,\x20%s',_0x5a4aed,_0x4d951c['error'][_0x22ff('0x2a')]);return _0xdf4695(_0x4d951c[_0x22ff('0x28')][_0x22ff('0x2a')]);}else{logger[_0x22ff('0x23')](_0x22ff('0x24'),_0x5a4aed,'request\x20sent');_0xdf4695(_0x4d951c['result'][_0x22ff('0x2a')]);}})[_0x22ff('0x2b')](function(_0xf6131c){logger[_0x22ff('0x28')]('SmsAccount,\x20%s,\x20%s',_0x5a4aed,_0xf6131c);_0x427186(_0xf6131c);});});}function respondWithStatusCode(_0x584ab3,_0x55b2c3){_0x55b2c3=_0x55b2c3||0xcc;return function(_0x5de73b){if(_0x5de73b){return _0x584ab3[_0x22ff('0x2c')](_0x55b2c3);}return _0x584ab3[_0x22ff('0x2d')](_0x55b2c3)[_0x22ff('0x2e')]();};}function respondWithResult(_0x42e11d,_0x170132){_0x170132=_0x170132||0xc8;return function(_0x24a3e9){if(_0x24a3e9){return _0x42e11d[_0x22ff('0x2d')](_0x170132)[_0x22ff('0x2f')](_0x24a3e9);}};}function respondWithFilteredResult(_0x105310,_0x2d7f5e){return function(_0x2c2268){if(_0x2c2268){var _0x4b50cf=typeof _0x2d7f5e[_0x22ff('0x30')]==='undefined'&&typeof _0x2d7f5e[_0x22ff('0x31')]===_0x22ff('0x32');var _0x56286e=_0x2c2268[_0x22ff('0x33')];var _0x52b8d3=_0x4b50cf?0x0:_0x2d7f5e[_0x22ff('0x30')];var _0x578fb9=_0x4b50cf?_0x2c2268[_0x22ff('0x33')]:_0x2d7f5e[_0x22ff('0x30')]+_0x2d7f5e[_0x22ff('0x31')];var _0xb8bce6;if(_0x578fb9>=_0x56286e){_0x578fb9=_0x56286e;_0xb8bce6=0xc8;}else{_0xb8bce6=0xce;}_0x105310['status'](_0xb8bce6);return _0x105310[_0x22ff('0x34')](_0x22ff('0x35'),_0x52b8d3+'-'+_0x578fb9+'/'+_0x56286e)[_0x22ff('0x2f')](_0x2c2268);}return null;};}function patchUpdates(_0x4d0c4b){return function(_0xc3579d){try{jsonpatch[_0x22ff('0x36')](_0xc3579d,_0x4d0c4b,!![]);}catch(_0x58892f){return BPromise[_0x22ff('0x37')](_0x58892f);}return _0xc3579d[_0x22ff('0x38')]();};}function saveUpdates(_0x38f30f,_0x593857){return function(_0xdc7eec){if(_0xdc7eec){return _0xdc7eec[_0x22ff('0x39')](_0x38f30f)[_0x22ff('0x22')](function(_0x12de45){return _0x12de45;});}return null;};}function removeEntity(_0x29504b,_0x441c49){return function(_0x4e985a){if(_0x4e985a){return _0x4e985a[_0x22ff('0x3a')]()[_0x22ff('0x22')](function(){var _0x498468=_0x4e985a[_0x22ff('0x3b')]({'plain':!![]});var _0x331af7=_0x22ff('0x3c');return db[_0x22ff('0x3d')]['destroy']({'where':{'type':_0x331af7,'resourceId':_0x498468['id']}})['then'](function(){return _0x4e985a;});})[_0x22ff('0x22')](function(){_0x29504b['status'](0xcc)[_0x22ff('0x2e')]();});}};}function handleEntityNotFound(_0x3174d2,_0x114bfb){return function(_0x5c4850){if(!_0x5c4850){_0x3174d2[_0x22ff('0x2c')](0x194);}return _0x5c4850;};}function handleError(_0x5a3ab2,_0x50aa51){_0x50aa51=_0x50aa51||0x1f4;return function(_0x1c35a4){logger[_0x22ff('0x28')](_0x1c35a4[_0x22ff('0x3e')]);if(_0x1c35a4[_0x22ff('0x3f')]){delete _0x1c35a4[_0x22ff('0x3f')];}_0x5a3ab2[_0x22ff('0x2d')](_0x50aa51)[_0x22ff('0x40')](_0x1c35a4);};}exports[_0x22ff('0x41')]=function(_0x19198b,_0x19adae){var _0x213bde={'include':[{'model':db[_0x22ff('0x42')],'as':_0x22ff('0x43')}]},_0x4ec3d6={},_0x153d86={'count':0x0,'rows':[]};var _0x1e74cd=_[_0x22ff('0x44')](db[_0x22ff('0x45')][_0x22ff('0x46')],function(_0x2a5485){return{'name':_0x2a5485[_0x22ff('0x47')],'type':_0x2a5485['type'][_0x22ff('0x48')]};});_0x4ec3d6['model']=_[_0x22ff('0x44')](_0x1e74cd,'name');_0x4ec3d6[_0x22ff('0x49')]=_[_0x22ff('0x4a')](_0x19198b[_0x22ff('0x49')]);_0x4ec3d6['filters']=_[_0x22ff('0x4b')](_0x4ec3d6[_0x22ff('0x4c')],_0x4ec3d6[_0x22ff('0x49')]);_0x213bde['attributes']=_['intersection'](_0x4ec3d6[_0x22ff('0x4c')],qs[_0x22ff('0x4d')](_0x19198b['query'][_0x22ff('0x4d')]));_0x213bde[_0x22ff('0x4e')]=_0x213bde[_0x22ff('0x4e')][_0x22ff('0x4f')]?_0x213bde['attributes']:_0x4ec3d6['model'];if(!_0x19198b[_0x22ff('0x49')][_0x22ff('0x50')](_0x22ff('0x51'))){_0x213bde[_0x22ff('0x31')]=qs[_0x22ff('0x31')](_0x19198b[_0x22ff('0x49')]['limit']);_0x213bde[_0x22ff('0x30')]=qs[_0x22ff('0x30')](_0x19198b[_0x22ff('0x49')][_0x22ff('0x30')]);}_0x213bde[_0x22ff('0x52')]=qs['sort'](_0x19198b[_0x22ff('0x49')][_0x22ff('0x53')]);_0x213bde[_0x22ff('0x54')]=qs[_0x22ff('0x55')](_['pick'](_0x19198b['query'],_0x4ec3d6[_0x22ff('0x55')]),_0x1e74cd);if(_0x19198b['query'][_0x22ff('0x56')]){_0x213bde[_0x22ff('0x54')]=_['merge'](_0x213bde[_0x22ff('0x54')],{'$or':_['map'](_0x1e74cd,function(_0x3b32a2){if(_0x3b32a2[_0x22ff('0x57')]!==_0x22ff('0x58')){var _0x609f98={};_0x609f98[_0x3b32a2[_0x22ff('0x3f')]]={'$like':'%'+_0x19198b[_0x22ff('0x49')]['filter']+'%'};return _0x609f98;}})});}_0x213bde=_[_0x22ff('0x59')]({},_0x213bde,_0x19198b[_0x22ff('0x5a')]);var _0x580ff1={'where':_0x213bde[_0x22ff('0x54')]};return db['SmsAccount'][_0x22ff('0x33')](_0x580ff1)[_0x22ff('0x22')](function(_0x5579e2){_0x153d86['count']=_0x5579e2;if(_0x19198b['query'][_0x22ff('0x5b')]){_0x213bde[_0x22ff('0x5c')]=[{'all':!![]}];}return db[_0x22ff('0x45')][_0x22ff('0x5d')](_0x213bde);})[_0x22ff('0x22')](function(_0x2b4d13){_0x153d86[_0x22ff('0x5e')]=_0x2b4d13;return _0x153d86;})[_0x22ff('0x22')](respondWithFilteredResult(_0x19adae,_0x213bde))[_0x22ff('0x2b')](handleError(_0x19adae,null));};exports[_0x22ff('0x5f')]=function(_0x3e385f,_0x33108b){var _0x687740={'raw':![],'where':{'id':_0x3e385f[_0x22ff('0x60')]['id']},'include':[{'model':db['Pause'],'as':_0x22ff('0x43')}]},_0xfd3dad={};_0xfd3dad[_0x22ff('0x4c')]=_[_0x22ff('0x4a')](db[_0x22ff('0x45')]['rawAttributes']);_0xfd3dad[_0x22ff('0x49')]=_['keys'](_0x3e385f[_0x22ff('0x49')]);_0xfd3dad[_0x22ff('0x55')]=_[_0x22ff('0x4b')](_0xfd3dad[_0x22ff('0x4c')],_0xfd3dad['query']);_0x687740[_0x22ff('0x4e')]=_[_0x22ff('0x4b')](_0xfd3dad[_0x22ff('0x4c')],qs[_0x22ff('0x4d')](_0x3e385f[_0x22ff('0x49')]['fields']));_0x687740[_0x22ff('0x4e')]=_0x687740[_0x22ff('0x4e')][_0x22ff('0x4f')]?_0x687740[_0x22ff('0x4e')]:_0xfd3dad[_0x22ff('0x4c')];if(_0x3e385f[_0x22ff('0x49')][_0x22ff('0x5b')]){_0x687740[_0x22ff('0x5c')]=[{'all':!![]}];}_0x687740=_[_0x22ff('0x59')]({},_0x687740,_0x3e385f[_0x22ff('0x5a')]);return db[_0x22ff('0x45')][_0x22ff('0x61')](_0x687740)[_0x22ff('0x22')](handleEntityNotFound(_0x33108b,null))[_0x22ff('0x22')](respondWithResult(_0x33108b,null))[_0x22ff('0x2b')](handleError(_0x33108b,null));};exports['create']=function(_0x477297,_0x247c63){return db['SmsAccount'][_0x22ff('0x62')](_0x477297[_0x22ff('0x63')],{})['then'](function(_0xee0201){var _0xc3ebd1=_0x477297['user']['get']({'plain':!![]});if(!_0xc3ebd1)throw new Error(_0x22ff('0x64'));if(_0xc3ebd1['role']==='user'){var _0x449eea=_0xee0201['get']({'plain':!![]});var _0x350b64=_0x22ff('0x3c');return db['UserProfileSection']['find']({'where':{'name':_0x350b64,'userProfileId':_0xc3ebd1[_0x22ff('0x65')]},'raw':!![]})[_0x22ff('0x22')](function(_0x5cd59c){if(_0x5cd59c&&_0x5cd59c[_0x22ff('0x66')]===0x0){return db[_0x22ff('0x3d')][_0x22ff('0x62')]({'name':_0x449eea['name'],'resourceId':_0x449eea['id'],'type':_0x5cd59c[_0x22ff('0x3f')],'sectionId':_0x5cd59c['id']},{})[_0x22ff('0x22')](function(){return _0xee0201;});}else{return _0xee0201;}})[_0x22ff('0x2b')](function(_0x456883){logger[_0x22ff('0x28')](_0x22ff('0x67'),_0x456883);throw _0x456883;});}return _0xee0201;})['then'](respondWithResult(_0x247c63,0xc9))[_0x22ff('0x2b')](handleError(_0x247c63,null));};exports[_0x22ff('0x39')]=function(_0x53f8fd,_0xe5804d){if(_0x53f8fd[_0x22ff('0x63')]['id']){delete _0x53f8fd[_0x22ff('0x63')]['id'];}return db[_0x22ff('0x45')][_0x22ff('0x61')]({'where':{'id':_0x53f8fd[_0x22ff('0x60')]['id']},'include':[{'model':db[_0x22ff('0x42')],'as':_0x22ff('0x43')}]})['then'](handleEntityNotFound(_0xe5804d,null))[_0x22ff('0x22')](saveUpdates(_0x53f8fd['body'],null))[_0x22ff('0x22')](respondWithResult(_0xe5804d,null))[_0x22ff('0x2b')](handleError(_0xe5804d,null));};exports[_0x22ff('0x3a')]=function(_0x2fe389,_0x44f644){return db[_0x22ff('0x45')][_0x22ff('0x61')]({'where':{'id':_0x2fe389[_0x22ff('0x60')]['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0x44f644,null))[_0x22ff('0x22')](removeEntity(_0x44f644,null))['catch'](handleError(_0x44f644,null));};exports[_0x22ff('0x68')]=function(_0x3eea89,_0x1e4c5){return db[_0x22ff('0x45')][_0x22ff('0x68')]()[_0x22ff('0x22')](respondWithResult(_0x1e4c5,null))[_0x22ff('0x2b')](handleError(_0x1e4c5,null));};exports[_0x22ff('0x69')]=function(_0x2df7f5,_0x27aed4,_0x5a20cb){if(_0x2df7f5[_0x22ff('0x63')]['id']){delete _0x2df7f5[_0x22ff('0x63')]['id'];}return db[_0x22ff('0x45')]['find']({'where':{'id':_0x2df7f5[_0x22ff('0x60')]['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0x27aed4,null))[_0x22ff('0x22')](function(_0x2838ed){if(_0x2838ed){_0x2df7f5['body'][_0x22ff('0x6a')]=_0x2838ed['id'];return db[_0x22ff('0x6b')]['create'](_0x2df7f5[_0x22ff('0x63')]);}})[_0x22ff('0x22')](respondWithResult(_0x27aed4,null))[_0x22ff('0x2b')](handleError(_0x27aed4,null));};exports['getDispositions']=function(_0x5c194c,_0xb1e259,_0x1b2be1){var _0x4aa535={'raw':![],'where':{}};var _0x3c138b={};var _0x1e37a4={'count':0x0,'rows':[]};return db[_0x22ff('0x45')][_0x22ff('0x6c')]({'where':{'id':_0x5c194c[_0x22ff('0x60')]['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0xb1e259,null))['then'](function(_0x57b78e){if(_0x57b78e){_0x3c138b[_0x22ff('0x4c')]=_[_0x22ff('0x4a')](db[_0x22ff('0x6b')]['rawAttributes']);_0x3c138b[_0x22ff('0x49')]=_['keys'](_0x5c194c[_0x22ff('0x49')]);_0x3c138b[_0x22ff('0x55')]=_[_0x22ff('0x4b')](_0x3c138b[_0x22ff('0x4c')],_0x3c138b[_0x22ff('0x49')]);_0x4aa535['attributes']=_[_0x22ff('0x4b')](_0x3c138b[_0x22ff('0x4c')],qs[_0x22ff('0x4d')](_0x5c194c[_0x22ff('0x49')][_0x22ff('0x4d')]));_0x4aa535[_0x22ff('0x4e')]=_0x4aa535['attributes']['length']?_0x4aa535[_0x22ff('0x4e')]:_0x3c138b['model'];if(!_0x5c194c[_0x22ff('0x49')]['hasOwnProperty'](_0x22ff('0x51'))){_0x4aa535['limit']=qs[_0x22ff('0x31')](_0x5c194c[_0x22ff('0x49')][_0x22ff('0x31')]);_0x4aa535['offset']=qs['offset'](_0x5c194c[_0x22ff('0x49')]['offset']);}_0x4aa535[_0x22ff('0x52')]=qs[_0x22ff('0x53')](_0x5c194c[_0x22ff('0x49')]['sort']);_0x4aa535[_0x22ff('0x54')]=qs[_0x22ff('0x55')](_['pick'](_0x5c194c[_0x22ff('0x49')],_0x3c138b['filters']));_0x4aa535[_0x22ff('0x54')][_0x22ff('0x6a')]=_0x57b78e['id'];if(_0x5c194c[_0x22ff('0x49')][_0x22ff('0x56')]){_0x4aa535[_0x22ff('0x54')]=_['merge'](_0x4aa535[_0x22ff('0x54')],{'$or':_[_0x22ff('0x44')](_0x4aa535[_0x22ff('0x4e')],function(_0x556f01){var _0x5d1b96={};_0x5d1b96[_0x556f01]={'$like':'%'+_0x5c194c[_0x22ff('0x49')][_0x22ff('0x56')]+'%'};return _0x5d1b96;})});}_0x4aa535=_['merge']({},_0x4aa535,_0x5c194c[_0x22ff('0x5a')]);return db[_0x22ff('0x6b')][_0x22ff('0x33')]({'where':_0x4aa535[_0x22ff('0x54')]})[_0x22ff('0x22')](function(_0x2ffee1){_0x1e37a4['count']=_0x2ffee1;if(_0x5c194c[_0x22ff('0x49')][_0x22ff('0x5b')]){_0x4aa535[_0x22ff('0x5c')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4aa535);})[_0x22ff('0x22')](function(_0x518410){_0x1e37a4[_0x22ff('0x5e')]=_0x518410;return _0x1e37a4;});}})[_0x22ff('0x22')](respondWithFilteredResult(_0xb1e259,_0x4aa535))[_0x22ff('0x2b')](handleError(_0xb1e259,null));};exports['removeDispositions']=function(_0x1cfd31,_0x31505c,_0x43cc52){return db[_0x22ff('0x45')][_0x22ff('0x61')]({'where':{'id':_0x1cfd31[_0x22ff('0x60')]['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0x31505c,null))[_0x22ff('0x22')](function(_0x12167c){if(_0x12167c){return _0x12167c['removeDispositions'](_0x1cfd31[_0x22ff('0x49')]['ids']);}})[_0x22ff('0x22')](respondWithStatusCode(_0x31505c,null))['catch'](handleError(_0x31505c,null));};exports[_0x22ff('0x6d')]=function(_0x97db71,_0x42f061,_0x1bfdd4){if(_0x97db71[_0x22ff('0x63')]['id']){delete _0x97db71[_0x22ff('0x63')]['id'];}return db[_0x22ff('0x45')][_0x22ff('0x61')]({'where':{'id':_0x97db71[_0x22ff('0x60')]['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0x42f061,null))[_0x22ff('0x22')](function(_0x49009b){if(_0x49009b){_0x97db71[_0x22ff('0x63')][_0x22ff('0x6a')]=_0x49009b['id'];return db[_0x22ff('0x6e')][_0x22ff('0x62')](_0x97db71[_0x22ff('0x63')]);}})[_0x22ff('0x22')](respondWithResult(_0x42f061,null))[_0x22ff('0x2b')](handleError(_0x42f061,null));};exports['getAnswers']=function(_0x416394,_0x28bec3,_0x585e8c){var _0xce1bf6={'raw':![],'where':{}};var _0x3812c2={};var _0x3bf41c={'count':0x0,'rows':[]};return db['SmsAccount'][_0x22ff('0x6c')]({'where':{'id':_0x416394[_0x22ff('0x60')]['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0x28bec3,null))[_0x22ff('0x22')](function(_0x182a92){if(_0x182a92){_0x3812c2[_0x22ff('0x4c')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x3812c2['query']=_['keys'](_0x416394['query']);_0x3812c2[_0x22ff('0x55')]=_[_0x22ff('0x4b')](_0x3812c2[_0x22ff('0x4c')],_0x3812c2[_0x22ff('0x49')]);_0xce1bf6['attributes']=_[_0x22ff('0x4b')](_0x3812c2['model'],qs[_0x22ff('0x4d')](_0x416394[_0x22ff('0x49')][_0x22ff('0x4d')]));_0xce1bf6[_0x22ff('0x4e')]=_0xce1bf6[_0x22ff('0x4e')]['length']?_0xce1bf6['attributes']:_0x3812c2['model'];if(!_0x416394[_0x22ff('0x49')][_0x22ff('0x50')](_0x22ff('0x51'))){_0xce1bf6[_0x22ff('0x31')]=qs[_0x22ff('0x31')](_0x416394[_0x22ff('0x49')][_0x22ff('0x31')]);_0xce1bf6[_0x22ff('0x30')]=qs[_0x22ff('0x30')](_0x416394['query'][_0x22ff('0x30')]);}_0xce1bf6[_0x22ff('0x52')]=qs[_0x22ff('0x53')](_0x416394[_0x22ff('0x49')][_0x22ff('0x53')]);_0xce1bf6[_0x22ff('0x54')]=qs[_0x22ff('0x55')](_[_0x22ff('0x6f')](_0x416394[_0x22ff('0x49')],_0x3812c2[_0x22ff('0x55')]));_0xce1bf6[_0x22ff('0x54')]['SmsAccountId']=_0x182a92['id'];if(_0x416394[_0x22ff('0x49')]['filter']){_0xce1bf6[_0x22ff('0x54')]=_['merge'](_0xce1bf6[_0x22ff('0x54')],{'$or':_['map'](_0xce1bf6['attributes'],function(_0x289011){var _0x394351={};_0x394351[_0x289011]={'$like':'%'+_0x416394[_0x22ff('0x49')][_0x22ff('0x56')]+'%'};return _0x394351;})});}_0xce1bf6=_[_0x22ff('0x59')]({},_0xce1bf6,_0x416394[_0x22ff('0x5a')]);return db[_0x22ff('0x6e')][_0x22ff('0x33')]({'where':_0xce1bf6[_0x22ff('0x54')]})[_0x22ff('0x22')](function(_0x2582ce){_0x3bf41c[_0x22ff('0x33')]=_0x2582ce;if(_0x416394[_0x22ff('0x49')][_0x22ff('0x5b')]){_0xce1bf6[_0x22ff('0x5c')]=[{'all':!![]}];}return db[_0x22ff('0x6e')]['findAll'](_0xce1bf6);})['then'](function(_0x7f8621){_0x3bf41c['rows']=_0x7f8621;return _0x3bf41c;});}})['then'](respondWithFilteredResult(_0x28bec3,_0xce1bf6))[_0x22ff('0x2b')](handleError(_0x28bec3,null));};exports[_0x22ff('0x70')]=function(_0x426490,_0x49232e,_0x487faa){return db[_0x22ff('0x45')][_0x22ff('0x61')]({'where':{'id':_0x426490[_0x22ff('0x60')]['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0x49232e,null))[_0x22ff('0x22')](function(_0x914c60){if(_0x914c60){return _0x914c60[_0x22ff('0x70')](_0x426490['query']['ids']);}})[_0x22ff('0x22')](respondWithStatusCode(_0x49232e,null))[_0x22ff('0x2b')](handleError(_0x49232e,null));};exports[_0x22ff('0x71')]=function(_0x582481,_0x2ab20e,_0x33ab84){var _0x1543cb={'channel':_0x22ff('0x72')};var _0x46c240=[];var _0x2db680=[];var _0x253db8={};return db[_0x22ff('0x45')][_0x22ff('0x61')]({'where':{'id':_0x582481['params']['id']},'include':[{'model':db[_0x22ff('0x73')],'as':'Applications'}]})[_0x22ff('0x22')](handleEntityNotFound(_0x2ab20e,null))['then'](function(_0x5ddae4){_0x1543cb[_0x22ff('0x74')]=_0x5ddae4;_0x1543cb[_0x22ff('0x75')]=_[_0x22ff('0x76')](_0x5ddae4[_0x22ff('0x77')],['priority'],[_0x22ff('0x78')]);if(_0x1543cb[_0x22ff('0x74')][_0x22ff('0x77')]){delete _0x1543cb['account'][_0x22ff('0x77')];}return db[_0x22ff('0x79')]['describe']();})[_0x22ff('0x22')](function(_0x11dbca){if(!_0x11dbca){throw new db['Sequelize']['ValidationError'](_0x22ff('0x7a'));}_0x46c240=_[_0x22ff('0x7b')](_[_0x22ff('0x4a')](_0x11dbca),[_0x22ff('0x7c'),_0x22ff('0x7d')]);_0x2db680=_[_0x22ff('0x7b')](_[_0x22ff('0x4a')](_0x11dbca),[_0x22ff('0x7c'),_0x22ff('0x7d'),_0x22ff('0x7e'),_0x22ff('0x7f')]);_0x1543cb[_0x22ff('0x63')]={'mapKey':_0x22ff('0x80')};if(_0x1543cb[_0x22ff('0x74')][_0x22ff('0x57')]){switch(_0x1543cb[_0x22ff('0x74')][_0x22ff('0x57')]){case _0x22ff('0x81'):_0x1543cb[_0x22ff('0x63')][_0x22ff('0x82')]=_0x582481[_0x22ff('0x63')]['From'];_0x1543cb[_0x22ff('0x63')][_0x22ff('0x63')]=_0x582481[_0x22ff('0x63')][_0x22ff('0x83')];_0x1543cb[_0x22ff('0x63')][_0x22ff('0x84')]=_0x582481[_0x22ff('0x63')]['MessageSid'];break;case _0x22ff('0x85'):_0x1543cb[_0x22ff('0x63')]['from']='+'+_0x582481[_0x22ff('0x63')][_0x22ff('0x86')];_0x1543cb['body'][_0x22ff('0x63')]=_0x582481[_0x22ff('0x63')][_0x22ff('0x87')];break;case _0x22ff('0x88'):_0x1543cb['body'][_0x22ff('0x82')]=_0x582481[_0x22ff('0x63')][_0x22ff('0x82')];_0x1543cb[_0x22ff('0x63')][_0x22ff('0x63')]=_0x582481['body']['message'];break;case _0x22ff('0x89'):_0x1543cb['body']['from']=_0x582481['body'][_0x22ff('0x82')];_0x1543cb[_0x22ff('0x63')][_0x22ff('0x63')]=_0x582481[_0x22ff('0x63')]['body'];_0x1543cb[_0x22ff('0x63')][_0x22ff('0x84')]=_0x582481[_0x22ff('0x63')][_0x22ff('0x8a')];break;case _0x22ff('0x8b'):_0x1543cb['body'][_0x22ff('0x82')]=_0x582481[_0x22ff('0x63')][_0x22ff('0x8c')];_0x1543cb[_0x22ff('0x63')]['body']=_0x582481[_0x22ff('0x63')][_0x22ff('0x8d')];_0x1543cb[_0x22ff('0x63')]['messageId']=_0x582481[_0x22ff('0x63')][_0x22ff('0x8e')];break;case'infobip':_0x1543cb['body'][_0x22ff('0x82')]='+'+_0x582481[_0x22ff('0x63')][_0x22ff('0x8f')][0x0][_0x22ff('0x82')];_0x1543cb['body'][_0x22ff('0x63')]=_0x582481[_0x22ff('0x63')][_0x22ff('0x8f')][0x0][_0x22ff('0x87')];_0x1543cb[_0x22ff('0x63')][_0x22ff('0x84')]=_0x582481[_0x22ff('0x63')]['results'][0x0][_0x22ff('0x84')];break;case _0x22ff('0x90'):_0x1543cb[_0x22ff('0x63')][_0x22ff('0x82')]=_0x582481[_0x22ff('0x63')]['originatingAddress'];_0x1543cb['body'][_0x22ff('0x63')]=_0x582481[_0x22ff('0x63')][_0x22ff('0x91')][_0x22ff('0x2a')];break;case _0x22ff('0x92'):_0x1543cb[_0x22ff('0x63')][_0x22ff('0x82')]=_0x582481['body'][_0x22ff('0x93')];_0x1543cb[_0x22ff('0x63')][_0x22ff('0x63')]=_0x582481['body'][_0x22ff('0x87')];_0x1543cb[_0x22ff('0x63')][_0x22ff('0x84')]=_0x582481[_0x22ff('0x63')][_0x22ff('0x94')];break;case'bandwidth':_0x1543cb['body'][_0x22ff('0x84')]=_0x582481['body'][0x0]['message']['id'];_0x1543cb['body'][_0x22ff('0x82')]=_0x582481['body'][0x0][_0x22ff('0x2a')]['from'];_0x1543cb[_0x22ff('0x63')][_0x22ff('0x63')]=_0x582481[_0x22ff('0x63')][0x0][_0x22ff('0x2a')][_0x22ff('0x87')];break;case _0x22ff('0x95'):_0x1543cb['body'][_0x22ff('0x82')]=_0x582481[_0x22ff('0x63')][_0x22ff('0x82')];_0x1543cb['body'][_0x22ff('0x63')]=_0x582481[_0x22ff('0x63')]['message'];_0x1543cb['body']['messageId']=_0x582481[_0x22ff('0x63')][_0x22ff('0x96')];break;}}if(_0x1543cb[_0x22ff('0x63')]['id']){delete _0x1543cb[_0x22ff('0x63')]['id'];}if(_[_0x22ff('0x97')](_0x1543cb[_0x22ff('0x63')]['from'])){throw new db[(_0x22ff('0x98'))][(_0x22ff('0x99'))](_0x22ff('0x9a'));}if(_['isNil'](_0x1543cb['body'][_0x22ff('0x63')])||_0x1543cb[_0x22ff('0x63')][_0x22ff('0x63')]===''){throw new db[(_0x22ff('0x98'))][(_0x22ff('0x99'))](_0x22ff('0x9b'));}if(_[_0x22ff('0x97')](_0x1543cb['body'][_0x22ff('0x9c')])){throw new db[(_0x22ff('0x98'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2db680);}if(!_['includes'](_0x2db680,_0x1543cb['body'][_0x22ff('0x9c')])){throw new db['Sequelize']['ValidationError'](_0x22ff('0x9d')+_0x2db680);}_0x253db8[_0x1543cb[_0x22ff('0x63')][_0x22ff('0x9c')]]=_0x1543cb[_0x22ff('0x63')][_0x22ff('0x82')];return db[_0x22ff('0x9e')][_0x22ff('0x61')]({'where':{'id':_0x1543cb[_0x22ff('0x74')][_0x22ff('0x7f')]},'include':[{'model':db[_0x22ff('0x79')],'as':_0x22ff('0x9f'),'where':_0x253db8,'limit':0x1,'order':[[_0x22ff('0x7d'),'DESC']]}]});})[_0x22ff('0x22')](handleEntityNotFound(_0x2ab20e,null))['then'](function(_0x402765){if(_0x402765){_0x1543cb['list']=_[_0x22ff('0xa0')](_0x402765,['Contacts']);if(_0x402765['Contacts'][_0x22ff('0x4f')]){return _0x402765[_0x22ff('0x9f')][0x0];}var _0xb2eaf8=_['defaults'](_0x1543cb[_0x22ff('0x63')],{'firstName':_0x1543cb['body']['from'],'ListId':_0x402765['id']});_0xb2eaf8[_0x1543cb[_0x22ff('0x63')][_0x22ff('0x9c')]]=_0x1543cb[_0x22ff('0x63')]['from'];return db[_0x22ff('0x79')][_0x22ff('0x62')](_0xb2eaf8,{'fields':_0x46c240,'raw':!![]});}})[_0x22ff('0x22')](handleEntityNotFound(_0x2ab20e,null))['then'](function(_0x229444){if(_0x229444){_0x1543cb[_0x22ff('0xa1')]=_0x229444;var _0x4c7458={'ContactId':_0x229444['id'],'phone':_0x1543cb[_0x22ff('0x63')][_0x22ff('0x82')],'SmsAccountId':_0x582481['params']['id']};var _0x23391a={'ContactId':_0x229444['id'],'SmsAccountId':_0x582481[_0x22ff('0x60')]['id'],'closed':![]};return db[_0x22ff('0xa2')][_0x22ff('0x61')]({'where':_0x23391a})[_0x22ff('0x22')](function(_0x441534){if(_0x441534){return[_0x441534,![]];}return db[_0x22ff('0xa2')]['create'](_0x4c7458)[_0x22ff('0x22')](function(_0xa00077){return[_0xa00077,!![]];});});}})[_0x22ff('0xa3')](function(_0x22b913,_0x6cc988){_0x1543cb['interaction']=_0x22b913[_0x22ff('0x3b')]({'plain':!![]});_0x1543cb[_0x22ff('0xa4')][_0x22ff('0xa5')]=![];if(_0x6cc988){if(_0x1543cb[_0x22ff('0x74')][_0x22ff('0xa6')]){_0x1543cb[_0x22ff('0x75')]['push']({'id':0x0,'priority':_0x1543cb[_0x22ff('0x75')]['length']+0x1,'app':_0x22ff('0xa7'),'appdata':_0x22ff('0xa8'),'interval':_0x22ff('0xa9')});}_0x1543cb[_0x22ff('0xa4')][_0x22ff('0xa5')]=!![];}return db['SmsMessage'][_0x22ff('0x62')]({'phone':_0x1543cb[_0x22ff('0x63')][_0x22ff('0x82')],'messageId':_0x1543cb[_0x22ff('0x63')]['messageId'],'body':_0x1543cb[_0x22ff('0x63')][_0x22ff('0x63')],'SmsAccountId':_0x582481['params']['id'],'SmsInteractionId':_0x22b913['id'],'direction':'in','ContactId':_0x22b913[_0x22ff('0xaa')],'AttachmentId':_0x1543cb[_0x22ff('0x63')][_0x22ff('0xab')]});})['then'](function(_0x2e837e){_0x1543cb[_0x22ff('0x2a')]=_0x2e837e;if(_0x1543cb['interaction'][_0x22ff('0xac')]){return db[_0x22ff('0xad')][_0x22ff('0x61')]({'attributes':['id',_0x22ff('0x3f')],'where':{'id':_0x1543cb[_0x22ff('0xa4')][_0x22ff('0xac')]}})[_0x22ff('0x22')](function(_0x2d5365){if(_0x2d5365){_0x1543cb['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x22ff('0xae'),'appdata':_0x2d5365[_0x22ff('0x3f')]+','+(_0x1543cb[_0x22ff('0x74')]['waitForTheAssignedAgent']||0xa),'interval':_0x22ff('0xa9')});}return respondWithRpcPromise('Start','startRouting',_0x1543cb);});}return respondWithRpcPromise(_0x22ff('0xaf'),'startRouting',_0x1543cb);})['then'](function(_0x592d24){if(_0x592d24){var _0x5a33c4=0xc8;var _0x542ada=_0x22ff('0xb0');logger[_0x22ff('0x23')](_0x22ff('0x26'),_0x542ada,_0x5a33c4,_0x22ff('0xb1'));logger[_0x22ff('0xb2')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x542ada,_0x5a33c4,_0x22ff('0xb1'),JSON[_0x22ff('0x27')](_0x592d24));if(_0x1543cb[_0x22ff('0x74')]['type']===_0x22ff('0x81')){return _0x2ab20e[_0x22ff('0x2d')](_0x5a33c4)[_0x22ff('0x34')](_0x22ff('0xb3'),_0x22ff('0xb4'))[_0x22ff('0x40')](_0x22ff('0xb5'));}else{return _0x2ab20e[_0x22ff('0x2d')](_0x5a33c4)[_0x22ff('0x2f')](_0x592d24);}}})['catch'](handleError(_0x2ab20e,null));};exports['addApplications']=function(_0x311ffe,_0x4596e9,_0x15e663){return db[_0x22ff('0x45')][_0x22ff('0x6c')]({'where':{'id':_0x311ffe[_0x22ff('0x60')]['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0x4596e9,null))['then'](function(_0xad57e9){if(_0xad57e9){return db[_0x22ff('0xb6')][_0x22ff('0xb7')](function(_0xa4b6d9){return db[_0x22ff('0x73')][_0x22ff('0x3a')]({'where':{'SmsAccountId':_0x311ffe[_0x22ff('0x60')]['id']},'transaction':_0xa4b6d9})[_0x22ff('0x22')](function(_0x55eb81){var _0x303de1=_[_0x22ff('0x44')](_0x311ffe['body'],function(_0x5a649b){_0x5a649b['SmsAccountId']=_0x311ffe[_0x22ff('0x60')]['id'];return _0x5a649b;});return db[_0x22ff('0x73')][_0x22ff('0xb8')](_0x303de1,{'transaction':_0xa4b6d9});});})[_0x22ff('0x22')](function(){return db['SmsApplication'][_0x22ff('0xb9')]({'where':{'SmsAccountId':_0x311ffe[_0x22ff('0x60')]['id']},'order':'priority'});});}})[_0x22ff('0x22')](respondWithResult(_0x4596e9,null))[_0x22ff('0x2b')](handleError(_0x4596e9,null));};exports[_0x22ff('0xba')]=function(_0x468eff,_0x1c38f6,_0x54ec8d){var _0x1e0f80={};var _0x39f51a={};var _0x3ad324;var _0x3bcc89;return db['SmsAccount'][_0x22ff('0x6c')]({'where':{'id':_0x468eff[_0x22ff('0x60')]['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0x1c38f6,null))[_0x22ff('0x22')](function(_0x254522){if(_0x254522){_0x3ad324=_0x254522;_0x39f51a['model']=_[_0x22ff('0x4a')](db[_0x22ff('0x73')][_0x22ff('0x46')]);_0x39f51a[_0x22ff('0x49')]=_['keys'](_0x468eff[_0x22ff('0x49')]);_0x39f51a[_0x22ff('0x55')]=_['intersection'](_0x39f51a[_0x22ff('0x4c')],_0x39f51a[_0x22ff('0x49')]);_0x1e0f80[_0x22ff('0x4e')]=_[_0x22ff('0x4b')](_0x39f51a[_0x22ff('0x4c')],qs[_0x22ff('0x4d')](_0x468eff['query']['fields']));_0x1e0f80[_0x22ff('0x4e')]=_0x1e0f80[_0x22ff('0x4e')][_0x22ff('0x4f')]?_0x1e0f80['attributes']:_0x39f51a[_0x22ff('0x4c')];_0x1e0f80['order']=qs[_0x22ff('0x53')](_0x468eff[_0x22ff('0x49')]['sort']);_0x1e0f80['where']=qs[_0x22ff('0x55')](_[_0x22ff('0x6f')](_0x468eff['query'],_0x39f51a[_0x22ff('0x55')]));if(_0x468eff[_0x22ff('0x49')][_0x22ff('0x56')]){_0x1e0f80[_0x22ff('0x54')]=_[_0x22ff('0x59')](_0x1e0f80[_0x22ff('0x54')],{'$or':_['map'](_0x1e0f80['attributes'],function(_0x35a9f8){var _0x27bd26={};_0x27bd26[_0x35a9f8]={'$like':'%'+_0x468eff[_0x22ff('0x49')][_0x22ff('0x56')]+'%'};return _0x27bd26;})});}_0x1e0f80=_['merge']({},_0x1e0f80,_0x468eff[_0x22ff('0x5a')]);return _0x3ad324[_0x22ff('0xba')](_0x1e0f80);}})[_0x22ff('0x22')](function(_0x19d931){if(_0x19d931){_0x3bcc89=_0x19d931[_0x22ff('0x4f')];if(!_0x468eff['query'][_0x22ff('0x50')]('nolimit')){_0x1e0f80[_0x22ff('0x31')]=qs[_0x22ff('0x31')](_0x468eff[_0x22ff('0x49')]['limit']);_0x1e0f80[_0x22ff('0x30')]=qs[_0x22ff('0x30')](_0x468eff[_0x22ff('0x49')]['offset']);}return _0x3ad324['getApplications'](_0x1e0f80);}})[_0x22ff('0x22')](function(_0x18d72a){if(_0x18d72a){return _0x18d72a?{'count':_0x3bcc89,'rows':_0x18d72a}:null;}})['then'](respondWithResult(_0x1c38f6,null))[_0x22ff('0x2b')](handleError(_0x1c38f6,null));};exports[_0x22ff('0xbb')]=function(_0x46035f,_0x44071e,_0x53a719){var _0x3dd64e={'raw':![],'where':{}};var _0x1ebd3f={};var _0x326ea6={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x46035f['params']['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0x44071e,null))['then'](function(_0x49af60){if(_0x49af60){_0x1ebd3f[_0x22ff('0x4c')]=_[_0x22ff('0x4a')](db['SmsInteraction']['rawAttributes']);_0x1ebd3f[_0x22ff('0x49')]=_['keys'](_0x46035f[_0x22ff('0x49')]);_0x1ebd3f[_0x22ff('0x55')]=_[_0x22ff('0x4b')](_0x1ebd3f['model'],_0x1ebd3f[_0x22ff('0x49')]);_0x3dd64e['attributes']=_[_0x22ff('0x4b')](_0x1ebd3f[_0x22ff('0x4c')],qs['fields'](_0x46035f[_0x22ff('0x49')]['fields']));_0x3dd64e['attributes']=_0x3dd64e[_0x22ff('0x4e')][_0x22ff('0x4f')]?_0x3dd64e[_0x22ff('0x4e')]:_0x1ebd3f[_0x22ff('0x4c')];if(!_0x46035f[_0x22ff('0x49')][_0x22ff('0x50')](_0x22ff('0x51'))){_0x3dd64e['limit']=qs[_0x22ff('0x31')](_0x46035f[_0x22ff('0x49')][_0x22ff('0x31')]);_0x3dd64e[_0x22ff('0x30')]=qs[_0x22ff('0x30')](_0x46035f['query'][_0x22ff('0x30')]);}_0x3dd64e[_0x22ff('0x52')]=qs[_0x22ff('0x53')](_0x46035f[_0x22ff('0x49')][_0x22ff('0x53')]);_0x3dd64e[_0x22ff('0x54')]=qs['filters'](_[_0x22ff('0x6f')](_0x46035f['query'],_0x1ebd3f[_0x22ff('0x55')]));_0x3dd64e[_0x22ff('0x54')][_0x22ff('0x6a')]=_0x49af60['id'];if(_0x46035f['query'][_0x22ff('0x56')]){_0x3dd64e[_0x22ff('0x54')]=_['merge'](_0x3dd64e['where'],{'$or':_[_0x22ff('0x44')](_0x3dd64e['attributes'],function(_0x104968){var _0x2d729e={};_0x2d729e[_0x104968]={'$like':'%'+_0x46035f[_0x22ff('0x49')][_0x22ff('0x56')]+'%'};return _0x2d729e;})});}_0x3dd64e=_[_0x22ff('0x59')]({},_0x3dd64e,_0x46035f[_0x22ff('0x5a')]);return db[_0x22ff('0xa2')]['count']({'where':_0x3dd64e[_0x22ff('0x54')]})['then'](function(_0xdfb5c2){_0x326ea6[_0x22ff('0x33')]=_0xdfb5c2;if(_0x46035f['query'][_0x22ff('0x5b')]){_0x3dd64e[_0x22ff('0x5c')]=[{'model':db[_0x22ff('0x79')],'as':_0x22ff('0xbc'),'required':![]},{'model':db[_0x22ff('0xad')],'as':'Owner','attributes':['name',_0x22ff('0xbd'),_0x22ff('0xbe')],'required':![]},{'model':db['Tag'],'as':_0x22ff('0xbf'),'attributes':['id',_0x22ff('0x3f'),_0x22ff('0xc0')],'where':_0x46035f['query'][_0x22ff('0xc1')]?{'id':_0x46035f['query'][_0x22ff('0xc1')]}:undefined,'required':_0x46035f[_0x22ff('0x49')]['tag']?!![]:![]}];}return db[_0x22ff('0xa2')][_0x22ff('0x5d')](_0x3dd64e);})[_0x22ff('0x22')](function(_0x330eb1){_0x326ea6[_0x22ff('0x5e')]=_0x330eb1;return _0x326ea6;});}})[_0x22ff('0x22')](respondWithFilteredResult(_0x44071e,_0x3dd64e))[_0x22ff('0x2b')](handleError(_0x44071e,null));};exports[_0x22ff('0x40')]=function(_0x4f464c,_0x5f3a0d,_0x5c1888){var _0x2f942b,_0x282433,_0x30cc14;if(_['isNil'](_0x4f464c[_0x22ff('0x63')][_0x22ff('0x63')])||_0x4f464c[_0x22ff('0x63')][_0x22ff('0x63')]===''){throw new db['Sequelize'][(_0x22ff('0x99'))](_0x22ff('0x9b'));}if(_['isNil'](_0x4f464c[_0x22ff('0x63')]['to'])){throw new db[(_0x22ff('0x98'))]['ValidationError'](_0x22ff('0xc2'));}_0x2f942b=_0x4f464c[_0x22ff('0x63')]['to'];return db['SmsAccount'][_0x22ff('0x61')]({'where':{'id':_0x4f464c[_0x22ff('0x60')]['id']},'include':[{'model':db[_0x22ff('0x9e')],'as':_0x22ff('0xc3'),'include':[{'model':db[_0x22ff('0x79')],'as':_0x22ff('0x9f'),'where':{'mobile':_0x2f942b},'limit':0x1,'order':[[_0x22ff('0x7d'),_0x22ff('0xc4')]]}]}]})[_0x22ff('0x22')](handleEntityNotFound(_0x5f3a0d,null))[_0x22ff('0x22')](function(_0x19abc4){if(_0x19abc4&&_0x19abc4['List']){_0x282433=_0x19abc4[_0x22ff('0x3b')]({'plain':!![]});if(_0x282433[_0x22ff('0xc3')]&&_0x282433[_0x22ff('0xc3')]['Contacts'][_0x22ff('0x4f')]){return _0x282433[_0x22ff('0xc3')][_0x22ff('0x9f')][0x0];}return db['CmContact'][_0x22ff('0x62')](_[_0x22ff('0x19')](_0x4f464c[_0x22ff('0x63')],{'firstName':_0x2f942b,'mobile':_0x2f942b,'phone':_0x2f942b,'ListId':_0x282433[_0x22ff('0x7f')]}));}})[_0x22ff('0x22')](handleEntityNotFound(_0x5f3a0d,null))[_0x22ff('0x22')](function(_0x173624){if(_0x173624){_0x30cc14=_0x173624;return db[_0x22ff('0xa2')][_0x22ff('0x61')]({'where':{'ContactId':_0x30cc14['id'],'closed':![],'SmsAccountId':_0x282433['id']}})[_0x22ff('0x22')](function(_0x22e1d6){if(_0x22e1d6){return[_0x22e1d6,![]];}return db['SmsInteraction'][_0x22ff('0x62')]({'UserId':_0x4f464c[_0x22ff('0xc5')]['id'],'ContactId':_0x30cc14['id'],'SmsAccountId':_0x282433['id'],'phone':_0x2f942b,'firstMsgDirection':_0x22ff('0xc6'),'Messages':[_[_0x22ff('0x59')](_0x4f464c[_0x22ff('0x63')],{'read':![],'body':_0x4f464c['body'][_0x22ff('0x63')],'phone':_0x2f942b,'SmsAccountId':_0x282433['id'],'UserId':_0x4f464c[_0x22ff('0xc5')]['id'],'ContactId':_0x30cc14['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x22ff('0xc7')}]})[_0x22ff('0x22')](function(_0x1b981e){return[_0x1b981e,!![]];});});}})[_0x22ff('0xa3')](function(_0x12e648,_0x394989){if(_0x394989){return _0x12e648;}return db['SmsMessage']['create'](_[_0x22ff('0x59')](_0x4f464c['body'],{'read':![],'body':_0x4f464c[_0x22ff('0x63')]['body'],'phone':_0x2f942b,'SmsAccountId':_0x282433['id'],'SmsInteractionId':_0x12e648['id'],'UserId':_0x4f464c[_0x22ff('0xc5')]['id'],'ContactId':_0x30cc14['id']}))[_0x22ff('0x22')](function(_0x2b5390){_0x12e648['dataValues'][_0x22ff('0xc7')]=[];_0x12e648[_0x22ff('0xc8')][_0x22ff('0xc7')][_0x22ff('0xc9')](_0x2b5390['dataValues']);return _0x12e648;});})['then'](respondWithResult(_0x5f3a0d,null))[_0x22ff('0x2b')](handleError(_0x5f3a0d,null));};exports[_0x22ff('0x2d')]=function(_0x24d07f,_0x20ad69,_0x489cb0){if(_0x24d07f[_0x22ff('0x63')]['id']){delete _0x24d07f[_0x22ff('0x63')]['id'];}var _0x135a45,_0x5538fb,_0x584ca5;return db[_0x22ff('0x45')]['find']({'where':{'id':_0x24d07f[_0x22ff('0x60')]['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0x20ad69,null))[_0x22ff('0x22')](function(_0x3743f5){if(_0x3743f5){_0x584ca5=_0x3743f5;logger[_0x22ff('0xb2')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x22ff('0xca'),_0x3743f5[_0x22ff('0x57')],util[_0x22ff('0xcb')](_0x24d07f[_0x22ff('0x63')],{'showHidden':![],'depth':null}));switch(_0x3743f5[_0x22ff('0x57')]){case _0x22ff('0x85'):if(_0x24d07f['body'][_0x22ff('0xcc')]&&_0x24d07f[_0x22ff('0x63')][_0x22ff('0x2d')]){_0x5538fb=_0x24d07f[_0x22ff('0x63')][_0x22ff('0x2d')];return db[_0x22ff('0xcd')][_0x22ff('0x61')]({'where':{'messageId':_0x24d07f['body'][_0x22ff('0xcc')]}});}break;case _0x22ff('0x88'):if(_0x24d07f[_0x22ff('0x63')][_0x22ff('0xce')]&&_0x24d07f[_0x22ff('0x63')][_0x22ff('0xcf')]){_0x5538fb=_0x24d07f[_0x22ff('0x63')]['statusInt'];return db[_0x22ff('0xcd')][_0x22ff('0x61')]({'where':{'messageId':_0x24d07f[_0x22ff('0x63')][_0x22ff('0xce')]}});}break;case _0x22ff('0x89'):if(_0x24d07f[_0x22ff('0x63')][_0x22ff('0x8a')]&&_0x24d07f[_0x22ff('0x63')][_0x22ff('0xd0')]){_0x5538fb=_0x24d07f[_0x22ff('0x63')]['status_code'];return db[_0x22ff('0xcd')][_0x22ff('0x61')]({'where':{'messageId':_0x24d07f[_0x22ff('0x63')]['message_id']}});}break;case _0x22ff('0xd1'):var _0x434a46=_0x24d07f[_0x22ff('0x63')][_0x22ff('0x8f')][0x0];if(_0x434a46[_0x22ff('0x84')]&&_0x434a46[_0x22ff('0x2d')][_0x22ff('0xd2')]===_0x22ff('0xd3')){_0x5538fb=_0x434a46[_0x22ff('0x2d')][_0x22ff('0xd2')];return db[_0x22ff('0xcd')][_0x22ff('0x61')]({'where':{'messageId':_0x434a46[_0x22ff('0x84')]}});}break;case'clickatell':if(_0x24d07f[_0x22ff('0x63')][_0x22ff('0x84')]&&_0x24d07f[_0x22ff('0x63')][_0x22ff('0x2d')]){_0x5538fb=_0x24d07f[_0x22ff('0x63')]['status'];return db[_0x22ff('0xcd')][_0x22ff('0x61')]({'where':{'messageId':_0x24d07f[_0x22ff('0x63')][_0x22ff('0x84')]}});}break;case _0x22ff('0xd4'):if(_0x24d07f[_0x22ff('0x63')][0x0]['message']['id']){_0x5538fb=_0x24d07f['body'][0x0]['type'];return db[_0x22ff('0xcd')]['find']({'where':{'messageId':_0x24d07f[_0x22ff('0x63')][0x0][_0x22ff('0x2a')]['id']}});}break;case _0x22ff('0x95'):if(_0x24d07f[_0x22ff('0x63')][_0x22ff('0xd5')]&&_0x24d07f['body']['status']){_0x5538fb=_0x24d07f[_0x22ff('0x63')]['status'];return db[_0x22ff('0xcd')][_0x22ff('0x61')]({'where':{'messageId':_0x24d07f[_0x22ff('0x63')][_0x22ff('0xd5')]}});}break;}}})['then'](handleEntityNotFound(_0x20ad69,null))['then'](function(_0x3fa024){if(_0x3fa024){_0x135a45=_0x3fa024;switch(_0x584ca5[_0x22ff('0x57')]){case _0x22ff('0x85'):if(_0x5538fb===_0x22ff('0xd3')){return _0x135a45[_0x22ff('0x39')]({'read':!![]});}else{logger[_0x22ff('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x22ff('0x2d'),_0x22ff('0x85'),util['inspect'](_0x24d07f[_0x22ff('0x63')],{'showHidden':![],'depth':null}));}break;case _0x22ff('0x88'):if(_0x5538fb==='1'){return _0x135a45[_0x22ff('0x39')]({'read':!![]});}else{logger['error'](_0x22ff('0x26'),_0x22ff('0x2d'),'skebby',util[_0x22ff('0xcb')](_0x24d07f[_0x22ff('0x63')],{'showHidden':![],'depth':null}));}break;case _0x22ff('0x89'):if(!_0x24d07f[_0x22ff('0x63')][_0x22ff('0xd6')]&&_0x5538fb>=0xc8&&_0x5538fb<=0xce){return _0x135a45[_0x22ff('0x39')]({'read':!![]});}else{logger[_0x22ff('0x28')](_0x22ff('0x26'),'status',_0x22ff('0x89'),util[_0x22ff('0xcb')](_0x24d07f['body'],{'showHidden':![],'depth':null}));}break;case _0x22ff('0xd1'):var _0x12820d=_0x24d07f[_0x22ff('0x63')][_0x22ff('0x8f')][0x0];if(_0x12820d[_0x22ff('0x2d')][_0x22ff('0xd2')]===_0x22ff('0xd3')){return _0x135a45[_0x22ff('0x39')]({'read':!![]});}else{logger[_0x22ff('0x28')](_0x22ff('0x26'),_0x22ff('0x2d'),'infobip',util['inspect'](_0x24d07f['body'],{'showHidden':![],'depth':null}));}break;case _0x22ff('0x92'):if(_0x5538fb==_0x22ff('0xd7')||_0x5538fb==_0x22ff('0xd8')){return _0x135a45['update']({'read':!![]});}else{logger['error'](_0x22ff('0x26'),_0x22ff('0x2d'),_0x22ff('0x92'),util['inspect'](_0x24d07f['body'],{'showHidden':![],'depth':null}));}break;case _0x22ff('0xd4'):if(_0x5538fb==_0x22ff('0xd9')){return _0x135a45[_0x22ff('0x39')]({'read':!![]});}else{logger[_0x22ff('0x28')](_0x22ff('0x26'),_0x22ff('0x2d'),_0x22ff('0xd4'),util[_0x22ff('0xcb')](_0x24d07f[_0x22ff('0x63')],{'showHidden':![],'depth':null}));}break;case _0x22ff('0x95'):if(_0x5538fb==='DELIVRD'||_0x5538fb===_0x22ff('0xda')){return _0x135a45[_0x22ff('0x39')]({'read':!![]});}else{logger[_0x22ff('0x28')](_0x22ff('0x26'),'status','intelepeer',util[_0x22ff('0xcb')](_0x24d07f['body'],{'showHidden':![],'depth':null}));}break;}return _0x135a45;}})[_0x22ff('0x22')](respondWithResult(_0x20ad69,null))[_0x22ff('0x2b')](handleError(_0x20ad69,null));};exports['statusGet']=function(_0x23d551,_0x2afe28,_0x2c65da){var _0x587fa6,_0x2a7380,_0x91cd8d;return db[_0x22ff('0x45')][_0x22ff('0x61')]({'where':{'id':_0x23d551[_0x22ff('0x60')]['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0x2afe28,null))['then'](function(_0x13ca09){if(_0x13ca09){_0x91cd8d=_0x13ca09;logger[_0x22ff('0xb2')](_0x22ff('0x26'),_0x22ff('0x2d'),_0x22ff('0xca'),_0x13ca09[_0x22ff('0x57')],util['inspect'](_0x23d551[_0x22ff('0x49')],{'showHidden':![],'depth':null}));switch(_0x13ca09[_0x22ff('0x57')]){case _0x22ff('0x90'):if(_0x23d551[_0x22ff('0x49')][_0x22ff('0xdb')]&&_0x23d551[_0x22ff('0x49')][_0x22ff('0xdc')]){_0x2a7380=_0x23d551[_0x22ff('0x49')][_0x22ff('0xdc')];return db[_0x22ff('0xcd')][_0x22ff('0x61')]({'where':{'messageId':_0x23d551['query'][_0x22ff('0xdb')]}});}break;}}})['then'](handleEntityNotFound(_0x2afe28,null))[_0x22ff('0x22')](function(_0x284603){if(_0x284603){_0x587fa6=_0x284603;switch(_0x91cd8d[_0x22ff('0x57')]){case _0x22ff('0x90'):if(_0x2a7380==='2'||_0x2a7380==='6'){return _0x587fa6[_0x22ff('0x39')]({'read':!![]});}else{logger[_0x22ff('0x28')](_0x22ff('0x26'),_0x22ff('0x2d'),_0x22ff('0x90'),util['inspect'](_0x23d551['query'],{'showHidden':![],'depth':null}));};break;}return _0x587fa6;}})['then'](respondWithResult(_0x2afe28,null))[_0x22ff('0x2b')](handleError(_0x2afe28,null));};exports['addAgents']=function(_0x1752f0,_0x264bd8,_0x4631b2){return db[_0x22ff('0x45')]['find']({'where':{'id':_0x1752f0[_0x22ff('0x60')]['id']}})['then'](handleEntityNotFound(_0x264bd8,null))['then'](function(_0x53af28){if(_0x53af28){return _0x53af28[_0x22ff('0xdd')](_0x1752f0[_0x22ff('0x63')][_0x22ff('0xde')],_[_0x22ff('0xa0')](_0x1752f0[_0x22ff('0x63')],[_0x22ff('0xde'),'id'])||{})[_0x22ff('0xa3')](function(_0x111ea4){for(var _0xfbe7f2=0x0;_0xfbe7f2<_0x1752f0[_0x22ff('0x63')][_0x22ff('0xde')][_0x22ff('0x4f')];_0xfbe7f2+=0x1){socket['emit'](_0x22ff('0xdf'),{'UserId':Number(_0x1752f0['body'][_0x22ff('0xde')][_0xfbe7f2]),'SmsAccountId':Number(_0x1752f0['params']['id'])});}return _0x111ea4;});}})['then'](respondWithResult(_0x264bd8,null))[_0x22ff('0x2b')](handleError(_0x264bd8,null));};exports[_0x22ff('0xe0')]=function(_0x4a737a,_0x443173,_0x1b73e1){return db[_0x22ff('0x45')][_0x22ff('0x61')]({'where':{'id':_0x4a737a[_0x22ff('0x60')]['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0x443173,null))[_0x22ff('0x22')](function(_0x56183c){if(_0x56183c){return _0x56183c[_0x22ff('0xe0')](_0x4a737a['query']['ids'])['then'](function(){if(_['isArray'](_0x4a737a[_0x22ff('0x49')][_0x22ff('0xde')])){for(var _0x3c423a=0x0;_0x3c423a<_0x4a737a[_0x22ff('0x49')][_0x22ff('0xde')][_0x22ff('0x4f')];_0x3c423a+=0x1){socket[_0x22ff('0xe1')](_0x22ff('0xe2'),{'UserId':Number(_0x4a737a[_0x22ff('0x49')][_0x22ff('0xde')][_0x3c423a]),'SmsAccountId':Number(_0x4a737a[_0x22ff('0x60')]['id'])});}}else{socket[_0x22ff('0xe1')](_0x22ff('0xe2'),{'UserId':Number(_0x4a737a[_0x22ff('0x49')][_0x22ff('0xde')]),'SmsAccountId':Number(_0x4a737a[_0x22ff('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x443173,null))[_0x22ff('0x2b')](handleError(_0x443173,null));};exports[_0x22ff('0xe3')]=function(_0x397bd6,_0x16c442,_0x3a8cf2){var _0x4c2070={};var _0x20ca9b={};var _0x14c34f;var _0x18ee02;return db['SmsAccount'][_0x22ff('0x6c')]({'where':{'id':_0x397bd6['params']['id']}})[_0x22ff('0x22')](handleEntityNotFound(_0x16c442,null))['then'](function(_0x113913){if(_0x113913){_0x14c34f=_0x113913;_0x20ca9b[_0x22ff('0x4c')]=_[_0x22ff('0x4a')](db[_0x22ff('0xad')]['rawAttributes']);_0x20ca9b[_0x22ff('0x49')]=_[_0x22ff('0x4a')](_0x397bd6[_0x22ff('0x49')]);_0x20ca9b[_0x22ff('0x55')]=_[_0x22ff('0x4b')](_0x20ca9b[_0x22ff('0x4c')],_0x20ca9b['query']);_0x4c2070[_0x22ff('0x4e')]=_[_0x22ff('0x4b')](_0x20ca9b[_0x22ff('0x4c')],qs['fields'](_0x397bd6[_0x22ff('0x49')][_0x22ff('0x4d')]));_0x4c2070[_0x22ff('0x4e')]=_0x4c2070[_0x22ff('0x4e')][_0x22ff('0x4f')]?_0x4c2070[_0x22ff('0x4e')]:_0x20ca9b[_0x22ff('0x4c')];_0x4c2070[_0x22ff('0x52')]=qs[_0x22ff('0x53')](_0x397bd6[_0x22ff('0x49')][_0x22ff('0x53')]);_0x4c2070[_0x22ff('0x54')]=qs[_0x22ff('0x55')](_[_0x22ff('0x6f')](_0x397bd6[_0x22ff('0x49')],_0x20ca9b[_0x22ff('0x55')]));if(_0x397bd6[_0x22ff('0x49')][_0x22ff('0x56')]){_0x4c2070[_0x22ff('0x54')]=_[_0x22ff('0x59')](_0x4c2070['where'],{'$or':_[_0x22ff('0x44')](_0x4c2070[_0x22ff('0x4e')],function(_0xd14cf5){var _0x465a96={};_0x465a96[_0xd14cf5]={'$like':'%'+_0x397bd6[_0x22ff('0x49')][_0x22ff('0x56')]+'%'};return _0x465a96;})});}_0x4c2070=_['merge']({},_0x4c2070,_0x397bd6[_0x22ff('0x5a')]);return _0x14c34f[_0x22ff('0xe3')](_0x4c2070);}})[_0x22ff('0x22')](function(_0x23b2fa){if(_0x23b2fa){_0x18ee02=_0x23b2fa['length'];if(!_0x397bd6[_0x22ff('0x49')]['hasOwnProperty']('nolimit')){_0x4c2070[_0x22ff('0x31')]=qs['limit'](_0x397bd6[_0x22ff('0x49')][_0x22ff('0x31')]);_0x4c2070['offset']=qs[_0x22ff('0x30')](_0x397bd6[_0x22ff('0x49')][_0x22ff('0x30')]);}return _0x14c34f[_0x22ff('0xe3')](_0x4c2070);}})[_0x22ff('0x22')](function(_0x1a2cd5){if(_0x1a2cd5){return _0x1a2cd5?{'count':_0x18ee02,'rows':_0x1a2cd5}:null;}})[_0x22ff('0x22')](respondWithResult(_0x16c442,null))[_0x22ff('0x2b')](handleError(_0x16c442,null));};
\ No newline at end of file
index 4dff986..d8133dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10f4=['exports','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x34cad9,_0xe4d7c5){var _0x421786=function(_0xbb897f){while(--_0xbb897f){_0x34cad9['push'](_0x34cad9['shift']());}};_0x421786(++_0xe4d7c5);}(_0x10f4,0xc1));var _0x410f=function(_0x57966a,_0x477964){_0x57966a=_0x57966a-0x0;var _0x191765=_0x10f4[_0x57966a];return _0x191765;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x410f('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x410f('0x1')](0x0);var events={'afterCreate':_0x410f('0x2'),'afterUpdate':_0x410f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4fb4bd){return function(_0xa486bf,_0x459cc8,_0x4deeee){SmsAccountEvents[_0x410f('0x4')](_0x4fb4bd+':'+_0xa486bf['id'],_0xa486bf);SmsAccountEvents[_0x410f('0x4')](_0x4fb4bd,_0xa486bf);_0x4deeee(null);};}for(var e in events){if(events[_0x410f('0x5')](e)){var event=events[e];SmsAccount[_0x410f('0x6')](e,emitEvent(event));}}module[_0x410f('0x7')]=SmsAccountEvents;
\ No newline at end of file
+var _0xdb4d=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit'];(function(_0x40babb,_0x40158f){var _0x1f91a1=function(_0x4b1c07){while(--_0x4b1c07){_0x40babb['push'](_0x40babb['shift']());}};_0x1f91a1(++_0x40158f);}(_0xdb4d,0x12f));var _0xddb4=function(_0x41cfe8,_0xbe9580){_0x41cfe8=_0x41cfe8-0x0;var _0x3c3735=_0xdb4d[_0x41cfe8];return _0x3c3735;};'use strict';var EventEmitter=require(_0xddb4('0x0'));var SmsAccount=require(_0xddb4('0x1'))['db'][_0xddb4('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xddb4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xddb4('0x4'),'afterDestroy':_0xddb4('0x5')};function emitEvent(_0xf2c5e9){return function(_0xa9e364,_0x128c11,_0x209898){SmsAccountEvents['emit'](_0xf2c5e9+':'+_0xa9e364['id'],_0xa9e364);SmsAccountEvents[_0xddb4('0x6')](_0xf2c5e9,_0xa9e364);_0x209898(null);};}for(var e in events){if(events[_0xddb4('0x7')](e)){var event=events[e];SmsAccount[_0xddb4('0x8')](e,emitEvent(event));}}module[_0xddb4('0x9')]=SmsAccountEvents;
\ No newline at end of file
index 805c16f..a90315e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0801=['request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger'];(function(_0x3e82a0,_0x16e564){var _0x4ea8a7=function(_0x1bc288){while(--_0x1bc288){_0x3e82a0['push'](_0x3e82a0['shift']());}};_0x4ea8a7(++_0x16e564);}(_0x0801,0x1a1));var _0x1080=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x0801[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x1080('0x0'));var util=require(_0x1080('0x1'));var logger=require(_0x1080('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1080('0x3'));var fs=require('fs');var path=require(_0x1080('0x4'));var rimraf=require(_0x1080('0x5'));var config=require(_0x1080('0x6'));var attributes=require(_0x1080('0x7'));module[_0x1080('0x8')]=function(_0x285d80,_0x100cf9){return _0x285d80[_0x1080('0x9')](_0x1080('0xa'),attributes,{'tableName':_0x1080('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b34=['bluebird','request-promise','path','../../config/environment','exports','define','SmsAccount','lodash','util','api','moment'];(function(_0x4e8a55,_0x5d4aa7){var _0x1863dc=function(_0x100f18){while(--_0x100f18){_0x4e8a55['push'](_0x4e8a55['shift']());}};_0x1863dc(++_0x5d4aa7);}(_0x9b34,0x1a9));var _0x49b3=function(_0x5c9793,_0x520e91){_0x5c9793=_0x5c9793-0x0;var _0x321d47=_0x9b34[_0x5c9793];return _0x321d47;};'use strict';var _=require(_0x49b3('0x0'));var util=require(_0x49b3('0x1'));var logger=require('../../config/logger')(_0x49b3('0x2'));var moment=require(_0x49b3('0x3'));var BPromise=require(_0x49b3('0x4'));var rp=require(_0x49b3('0x5'));var fs=require('fs');var path=require(_0x49b3('0x6'));var rimraf=require('rimraf');var config=require(_0x49b3('0x7'));var attributes=require('./smsAccount.attributes');module[_0x49b3('0x8')]=function(_0x44887f,_0x11a410){return _0x44887f[_0x49b3('0x9')](_0x49b3('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f741a84..50df6b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12de=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','include','map','attributes','model','lodash','util'];(function(_0x3fb035,_0x34bfb8){var _0xfc03ed=function(_0x599a4b){while(--_0x599a4b){_0x3fb035['push'](_0x3fb035['shift']());}};_0xfc03ed(++_0x34bfb8);}(_0x12de,0x6d));var _0xe12d=function(_0x48b1c1,_0x1951bc){_0x48b1c1=_0x48b1c1-0x0;var _0x4f741e=_0x12de[_0x48b1c1];return _0x4f741e;};'use strict';var _=require(_0xe12d('0x0'));var util=require(_0xe12d('0x1'));var moment=require(_0xe12d('0x2'));var BPromise=require(_0xe12d('0x3'));var rs=require(_0xe12d('0x4'));var fs=require('fs');var Redis=require(_0xe12d('0x5'));var db=require(_0xe12d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe12d('0x7'))(_0xe12d('0x8'));var config=require('../../config/environment');var jayson=require(_0xe12d('0x9'));var client=jayson[_0xe12d('0xa')]['http']({'port':0x232a});config[_0xe12d('0xb')]=_[_0xe12d('0xc')](config['redis'],{'host':_0xe12d('0xd'),'port':0x18eb});var socket=require(_0xe12d('0xe'))(new Redis(config[_0xe12d('0xb')]));require(_0xe12d('0xf'))['register'](socket);function respondWithRpcPromise(_0x52920a,_0x139c49,_0x260ce7){return new BPromise(function(_0x3af1d5,_0x35be75){return client[_0xe12d('0x10')](_0x52920a,_0x260ce7)[_0xe12d('0x11')](function(_0x272b0f){logger[_0xe12d('0x12')](_0xe12d('0x13'),_0x139c49,_0xe12d('0x14'));logger[_0xe12d('0x15')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x139c49,_0xe12d('0x14'),JSON[_0xe12d('0x16')](_0x272b0f));if(_0x272b0f['error']){if(_0x272b0f[_0xe12d('0x17')]['code']===0x1f4){logger['error'](_0xe12d('0x13'),_0x139c49,_0x272b0f[_0xe12d('0x17')][_0xe12d('0x18')]);return _0x35be75(_0x272b0f[_0xe12d('0x17')][_0xe12d('0x18')]);}logger[_0xe12d('0x17')]('SmsAccount,\x20%s,\x20%s',_0x139c49,_0x272b0f[_0xe12d('0x17')][_0xe12d('0x18')]);return _0x3af1d5(_0x272b0f[_0xe12d('0x17')][_0xe12d('0x18')]);}else{logger[_0xe12d('0x12')](_0xe12d('0x13'),_0x139c49,'request\x20sent');_0x3af1d5(_0x272b0f[_0xe12d('0x19')][_0xe12d('0x18')]);}})[_0xe12d('0x1a')](function(_0x3f7b5){logger[_0xe12d('0x17')](_0xe12d('0x13'),_0x139c49,_0x3f7b5);_0x35be75(_0x3f7b5);});});}exports[_0xe12d('0x1b')]=function(_0x1c215e){var _0x3af8b0=this;return new Promise(function(_0x40cb18,_0x585587){return db[_0xe12d('0x1c')][_0xe12d('0x1d')]({'raw':_0x1c215e[_0xe12d('0x1e')]?_0x1c215e[_0xe12d('0x1e')][_0xe12d('0x1f')]===undefined?!![]:![]:!![],'where':_0x1c215e[_0xe12d('0x1e')]?_0x1c215e[_0xe12d('0x1e')][_0xe12d('0x20')]||null:null,'attributes':_0x1c215e[_0xe12d('0x1e')]?_0x1c215e['options']['attributes']||null:null,'include':_0x1c215e['options']?_0x1c215e[_0xe12d('0x1e')][_0xe12d('0x21')]?_[_0xe12d('0x22')](_0x1c215e[_0xe12d('0x1e')][_0xe12d('0x21')],function(_0xa62aa2){return{'model':db[_0xa62aa2['model']],'as':_0xa62aa2['as'],'attributes':_0xa62aa2['attributes'],'include':_0xa62aa2['include']?_['map'](_0xa62aa2[_0xe12d('0x21')],function(_0x11568e){return{'model':db[_0x11568e['model']],'as':_0x11568e['as'],'attributes':_0x11568e[_0xe12d('0x23')],'include':_0x11568e[_0xe12d('0x21')]?_[_0xe12d('0x22')](_0x11568e['include'],function(_0x33e8b5){return{'model':db[_0x33e8b5[_0xe12d('0x24')]],'as':_0x33e8b5['as'],'attributes':_0x33e8b5[_0xe12d('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe12d('0x11')](function(_0x4462c5){logger[_0xe12d('0x12')](_0xe12d('0x1b'),_0x1c215e);logger['debug'](_0xe12d('0x1b'),_0x1c215e,JSON['stringify'](_0x4462c5));_0x40cb18(_0x4462c5);})[_0xe12d('0x1a')](function(_0x5e39c4){logger['error'](_0xe12d('0x1b'),_0x5e39c4[_0xe12d('0x18')],_0x1c215e);_0x585587(_0x3af8b0[_0xe12d('0x17')](0x1f4,_0x5e39c4[_0xe12d('0x18')]));});});};
\ No newline at end of file
+var _0x2bc1=['defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','info','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis'];(function(_0x2f439e,_0x27cda1){var _0x162274=function(_0x217e49){while(--_0x217e49){_0x2f439e['push'](_0x2f439e['shift']());}};_0x162274(++_0x27cda1);}(_0x2bc1,0x11e));var _0x12bc=function(_0x51a46c,_0x37f7a4){_0x51a46c=_0x51a46c-0x0;var _0x2fa786=_0x2bc1[_0x51a46c];return _0x2fa786;};'use strict';var _=require('lodash');var util=require(_0x12bc('0x0'));var moment=require(_0x12bc('0x1'));var BPromise=require('bluebird');var rs=require(_0x12bc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x12bc('0x3'))['db'];var utils=require(_0x12bc('0x4'));var logger=require(_0x12bc('0x5'))(_0x12bc('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x12bc('0x7')][_0x12bc('0x8')]({'port':0x232a});config[_0x12bc('0x9')]=_[_0x12bc('0xa')](config[_0x12bc('0x9')],{'host':_0x12bc('0xb'),'port':0x18eb});var socket=require(_0x12bc('0xc'))(new Redis(config[_0x12bc('0x9')]));require(_0x12bc('0xd'))[_0x12bc('0xe')](socket);function respondWithRpcPromise(_0x731ac6,_0x5a3828,_0x25353d){return new BPromise(function(_0x38ee4a,_0x37d29d){return client[_0x12bc('0xf')](_0x731ac6,_0x25353d)[_0x12bc('0x10')](function(_0x479a99){logger['info'](_0x12bc('0x11'),_0x5a3828,_0x12bc('0x12'));logger[_0x12bc('0x13')](_0x12bc('0x14'),_0x5a3828,'request\x20sent',JSON[_0x12bc('0x15')](_0x479a99));if(_0x479a99[_0x12bc('0x16')]){if(_0x479a99['error'][_0x12bc('0x17')]===0x1f4){logger[_0x12bc('0x16')](_0x12bc('0x11'),_0x5a3828,_0x479a99['error'][_0x12bc('0x18')]);return _0x37d29d(_0x479a99['error'][_0x12bc('0x18')]);}logger[_0x12bc('0x16')](_0x12bc('0x11'),_0x5a3828,_0x479a99['error'][_0x12bc('0x18')]);return _0x38ee4a(_0x479a99['error']['message']);}else{logger['info'](_0x12bc('0x11'),_0x5a3828,_0x12bc('0x12'));_0x38ee4a(_0x479a99['result'][_0x12bc('0x18')]);}})['catch'](function(_0x4cee78){logger[_0x12bc('0x16')]('SmsAccount,\x20%s,\x20%s',_0x5a3828,_0x4cee78);_0x37d29d(_0x4cee78);});});}exports[_0x12bc('0x19')]=function(_0x29f940){var _0xa20c5e=this;return new Promise(function(_0x3803cc,_0x3d0a40){return db[_0x12bc('0x1a')][_0x12bc('0x1b')]({'raw':_0x29f940[_0x12bc('0x1c')]?_0x29f940['options'][_0x12bc('0x1d')]===undefined?!![]:![]:!![],'where':_0x29f940[_0x12bc('0x1c')]?_0x29f940['options'][_0x12bc('0x1e')]||null:null,'attributes':_0x29f940[_0x12bc('0x1c')]?_0x29f940[_0x12bc('0x1c')][_0x12bc('0x1f')]||null:null,'include':_0x29f940[_0x12bc('0x1c')]?_0x29f940[_0x12bc('0x1c')][_0x12bc('0x20')]?_[_0x12bc('0x21')](_0x29f940[_0x12bc('0x1c')][_0x12bc('0x20')],function(_0x4cb41a){return{'model':db[_0x4cb41a[_0x12bc('0x22')]],'as':_0x4cb41a['as'],'attributes':_0x4cb41a['attributes'],'include':_0x4cb41a[_0x12bc('0x20')]?_[_0x12bc('0x21')](_0x4cb41a[_0x12bc('0x20')],function(_0x268301){return{'model':db[_0x268301['model']],'as':_0x268301['as'],'attributes':_0x268301['attributes'],'include':_0x268301[_0x12bc('0x20')]?_['map'](_0x268301[_0x12bc('0x20')],function(_0x119423){return{'model':db[_0x119423[_0x12bc('0x22')]],'as':_0x119423['as'],'attributes':_0x119423['attributes']};}):[]};}):[]};}):[]:[]})[_0x12bc('0x10')](function(_0x280b67){logger[_0x12bc('0x23')](_0x12bc('0x19'),_0x29f940);logger['debug'](_0x12bc('0x19'),_0x29f940,JSON[_0x12bc('0x15')](_0x280b67));_0x3803cc(_0x280b67);})[_0x12bc('0x24')](function(_0x2517a4){logger['error']('ShowSmsAccount',_0x2517a4[_0x12bc('0x18')],_0x29f940);_0x3d0a40(_0xa20c5e[_0x12bc('0x16')](0x1f4,_0x2517a4['message']));});});};
\ No newline at end of file
index 5d28d8e..cea861c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 df6328b..2415612 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2a8474,_0x264a6e){var _0x38222c=function(_0x4d29f5){while(--_0x4d29f5){_0x2a8474['push'](_0x2a8474['shift']());}};_0x38222c(++_0x264a6e);}(_0xedd9,0xfc));var _0x9edd=function(_0x1141a2,_0x165358){_0x1141a2=_0x1141a2-0x0;var _0x2098a6=_0xedd9[_0x1141a2];return _0x2098a6;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router;
\ No newline at end of file
+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(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
index f6d0d4b..5e2be28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x448c=['INTEGER','STRING','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x448c,0x1d9));var _0xc448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x448c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xc448('0x0')]={'priority':{'type':Sequelize[_0xc448('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc448('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc448('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x2d4a=['STRING','noop','exports','INTEGER'];(function(_0x4e6d1c,_0x52b8a4){var _0x421559=function(_0x3a95e8){while(--_0x3a95e8){_0x4e6d1c['push'](_0x4e6d1c['shift']());}};_0x421559(++_0x52b8a4);}(_0x2d4a,0xae));var _0xa2d4=function(_0xd54777,_0xab9baf){_0xd54777=_0xd54777-0x0;var _0x4eb1e2=_0x2d4a[_0xd54777];return _0x4eb1e2;};'use strict';var Sequelize=require('sequelize');module[_0xa2d4('0x0')]={'priority':{'type':Sequelize[_0xa2d4('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa2d4('0x2')],'allowNull':![],'defaultValue':_0xa2d4('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa2d4('0x2')]},'interval':{'type':Sequelize[_0xa2d4('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 9e29bd7..0ef9b6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c65=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','pick','merge','options','where','SmsApplication','includeAll','include','findAll','rows','catch','length','find','create','body','params','rimraf','zip-dir'];(function(_0x1be2da,_0x27c015){var _0x3550c6=function(_0x5abf24){while(--_0x5abf24){_0x1be2da['push'](_0x1be2da['shift']());}};_0x3550c6(++_0x27c015);}(_0x1c65,0x1ae));var _0x51c6=function(_0x3e95bd,_0x162447){_0x3e95bd=_0x3e95bd-0x0;var _0x3e0ae3=_0x1c65[_0x3e95bd];return _0x3e0ae3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51c6('0x0'));var zipdir=require(_0x51c6('0x1'));var jsonpatch=require(_0x51c6('0x2'));var rp=require(_0x51c6('0x3'));var moment=require(_0x51c6('0x4'));var BPromise=require(_0x51c6('0x5'));var Mustache=require(_0x51c6('0x6'));var util=require(_0x51c6('0x7'));var path=require(_0x51c6('0x8'));var sox=require(_0x51c6('0x9'));var csv=require(_0x51c6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x51c6('0xb'));var crypto=require(_0x51c6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x51c6('0xd'));var toCsv=require(_0x51c6('0xa'));var querystring=require('querystring');var Papa=require(_0x51c6('0xe'));var Redis=require(_0x51c6('0xf'));var authService=require(_0x51c6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x51c6('0x11'));var hardwareService=require(_0x51c6('0x12'));var logger=require(_0x51c6('0x13'))(_0x51c6('0x14'));var utils=require(_0x51c6('0x15'));var config=require(_0x51c6('0x16'));var licenseUtil=require(_0x51c6('0x17'));var db=require(_0x51c6('0x18'))['db'];function respondWithStatusCode(_0x1335eb,_0x2b4ebc){_0x2b4ebc=_0x2b4ebc||0xcc;return function(_0x4d6a86){if(_0x4d6a86){return _0x1335eb[_0x51c6('0x19')](_0x2b4ebc);}return _0x1335eb[_0x51c6('0x1a')](_0x2b4ebc)['end']();};}function respondWithResult(_0x4d7c36,_0x4ee6c5){_0x4ee6c5=_0x4ee6c5||0xc8;return function(_0x3d1f26){if(_0x3d1f26){return _0x4d7c36[_0x51c6('0x1a')](_0x4ee6c5)['json'](_0x3d1f26);}};}function respondWithFilteredResult(_0x4b7590,_0x210e9b){return function(_0x5bd4f0){if(_0x5bd4f0){var _0x4b88a6=typeof _0x210e9b[_0x51c6('0x1b')]==='undefined'&&typeof _0x210e9b[_0x51c6('0x1c')]===_0x51c6('0x1d');var _0x323990=_0x5bd4f0[_0x51c6('0x1e')];var _0x217c74=_0x4b88a6?0x0:_0x210e9b['offset'];var _0x204461=_0x4b88a6?_0x5bd4f0[_0x51c6('0x1e')]:_0x210e9b[_0x51c6('0x1b')]+_0x210e9b[_0x51c6('0x1c')];var _0x6af083;if(_0x204461>=_0x323990){_0x204461=_0x323990;_0x6af083=0xc8;}else{_0x6af083=0xce;}_0x4b7590[_0x51c6('0x1a')](_0x6af083);return _0x4b7590[_0x51c6('0x1f')]('Content-Range',_0x217c74+'-'+_0x204461+'/'+_0x323990)[_0x51c6('0x20')](_0x5bd4f0);}return null;};}function patchUpdates(_0x4dbd3b){return function(_0x1edd12){try{jsonpatch[_0x51c6('0x21')](_0x1edd12,_0x4dbd3b,!![]);}catch(_0x361543){return BPromise[_0x51c6('0x22')](_0x361543);}return _0x1edd12[_0x51c6('0x23')]();};}function saveUpdates(_0x21d620,_0x2ffa79){return function(_0x4637d9){if(_0x4637d9){return _0x4637d9[_0x51c6('0x24')](_0x21d620)[_0x51c6('0x25')](function(_0x169710){return _0x169710;});}return null;};}function removeEntity(_0x489007,_0x366695){return function(_0x133d5f){if(_0x133d5f){return _0x133d5f[_0x51c6('0x26')]()[_0x51c6('0x25')](function(){_0x489007[_0x51c6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e7fbb,_0x5d4967){return function(_0x22816d){if(!_0x22816d){_0x1e7fbb[_0x51c6('0x19')](0x194);}return _0x22816d;};}function handleError(_0x48155e,_0x125adc){_0x125adc=_0x125adc||0x1f4;return function(_0x84362a){logger[_0x51c6('0x27')](_0x84362a[_0x51c6('0x28')]);if(_0x84362a['name']){delete _0x84362a[_0x51c6('0x29')];}_0x48155e[_0x51c6('0x1a')](_0x125adc)['send'](_0x84362a);};}exports[_0x51c6('0x2a')]=function(_0x19f5c6,_0x5eb4b2){var _0x29e2b3={},_0x7028e1={},_0x56c93a={'count':0x0,'rows':[]};var _0x5a070f=_['map'](db['SmsApplication'][_0x51c6('0x2b')],function(_0x47510d){return{'name':_0x47510d[_0x51c6('0x2c')],'type':_0x47510d[_0x51c6('0x2d')][_0x51c6('0x2e')]};});_0x7028e1['model']=_[_0x51c6('0x2f')](_0x5a070f,_0x51c6('0x29'));_0x7028e1[_0x51c6('0x30')]=_[_0x51c6('0x31')](_0x19f5c6[_0x51c6('0x30')]);_0x7028e1[_0x51c6('0x32')]=_[_0x51c6('0x33')](_0x7028e1[_0x51c6('0x34')],_0x7028e1[_0x51c6('0x30')]);_0x29e2b3['attributes']=_[_0x51c6('0x33')](_0x7028e1['model'],qs[_0x51c6('0x35')](_0x19f5c6[_0x51c6('0x30')][_0x51c6('0x35')]));_0x29e2b3[_0x51c6('0x36')]=_0x29e2b3[_0x51c6('0x36')]['length']?_0x29e2b3[_0x51c6('0x36')]:_0x7028e1[_0x51c6('0x34')];if(!_0x19f5c6[_0x51c6('0x30')][_0x51c6('0x37')]('nolimit')){_0x29e2b3[_0x51c6('0x1c')]=qs[_0x51c6('0x1c')](_0x19f5c6[_0x51c6('0x30')][_0x51c6('0x1c')]);_0x29e2b3[_0x51c6('0x1b')]=qs[_0x51c6('0x1b')](_0x19f5c6[_0x51c6('0x30')][_0x51c6('0x1b')]);}_0x29e2b3[_0x51c6('0x38')]=qs['sort'](_0x19f5c6['query']['sort']);_0x29e2b3['where']=qs['filters'](_[_0x51c6('0x39')](_0x19f5c6[_0x51c6('0x30')],_0x7028e1[_0x51c6('0x32')]),_0x5a070f);if(_0x19f5c6[_0x51c6('0x30')]['filter']){_0x29e2b3['where']=_[_0x51c6('0x3a')](_0x29e2b3['where'],{'$or':_[_0x51c6('0x2f')](_0x5a070f,function(_0x2f5327){if(_0x2f5327[_0x51c6('0x2d')]!=='VIRTUAL'){var _0x2823f9={};_0x2823f9[_0x2f5327['name']]={'$like':'%'+_0x19f5c6[_0x51c6('0x30')]['filter']+'%'};return _0x2823f9;}})});}_0x29e2b3=_['merge']({},_0x29e2b3,_0x19f5c6[_0x51c6('0x3b')]);var _0x1d7736={'where':_0x29e2b3[_0x51c6('0x3c')]};return db[_0x51c6('0x3d')][_0x51c6('0x1e')](_0x1d7736)[_0x51c6('0x25')](function(_0x3b8da4){_0x56c93a[_0x51c6('0x1e')]=_0x3b8da4;if(_0x19f5c6[_0x51c6('0x30')][_0x51c6('0x3e')]){_0x29e2b3[_0x51c6('0x3f')]=[{'all':!![]}];}return db[_0x51c6('0x3d')][_0x51c6('0x40')](_0x29e2b3);})['then'](function(_0xe838d9){_0x56c93a[_0x51c6('0x41')]=_0xe838d9;return _0x56c93a;})[_0x51c6('0x25')](respondWithFilteredResult(_0x5eb4b2,_0x29e2b3))[_0x51c6('0x42')](handleError(_0x5eb4b2,null));};exports['show']=function(_0x148c6c,_0x4bb6ea){var _0x1f24e5={'raw':!![],'where':{'id':_0x148c6c['params']['id']}},_0x1397b1={};_0x1397b1[_0x51c6('0x34')]=_['keys'](db[_0x51c6('0x3d')]['rawAttributes']);_0x1397b1[_0x51c6('0x30')]=_['keys'](_0x148c6c[_0x51c6('0x30')]);_0x1397b1[_0x51c6('0x32')]=_['intersection'](_0x1397b1[_0x51c6('0x34')],_0x1397b1['query']);_0x1f24e5[_0x51c6('0x36')]=_[_0x51c6('0x33')](_0x1397b1[_0x51c6('0x34')],qs['fields'](_0x148c6c[_0x51c6('0x30')][_0x51c6('0x35')]));_0x1f24e5['attributes']=_0x1f24e5[_0x51c6('0x36')][_0x51c6('0x43')]?_0x1f24e5[_0x51c6('0x36')]:_0x1397b1[_0x51c6('0x34')];if(_0x148c6c[_0x51c6('0x30')][_0x51c6('0x3e')]){_0x1f24e5[_0x51c6('0x3f')]=[{'all':!![]}];}_0x1f24e5=_[_0x51c6('0x3a')]({},_0x1f24e5,_0x148c6c[_0x51c6('0x3b')]);return db[_0x51c6('0x3d')][_0x51c6('0x44')](_0x1f24e5)[_0x51c6('0x25')](handleEntityNotFound(_0x4bb6ea,null))['then'](respondWithResult(_0x4bb6ea,null))['catch'](handleError(_0x4bb6ea,null));};exports[_0x51c6('0x45')]=function(_0x3a568e,_0x500b86){return db[_0x51c6('0x3d')][_0x51c6('0x45')](_0x3a568e[_0x51c6('0x46')],{})[_0x51c6('0x25')](respondWithResult(_0x500b86,0xc9))[_0x51c6('0x42')](handleError(_0x500b86,null));};exports[_0x51c6('0x24')]=function(_0x154a64,_0x5b8b92){if(_0x154a64['body']['id']){delete _0x154a64[_0x51c6('0x46')]['id'];}return db[_0x51c6('0x3d')][_0x51c6('0x44')]({'where':{'id':_0x154a64[_0x51c6('0x47')]['id']}})[_0x51c6('0x25')](handleEntityNotFound(_0x5b8b92,null))[_0x51c6('0x25')](saveUpdates(_0x154a64[_0x51c6('0x46')],null))[_0x51c6('0x25')](respondWithResult(_0x5b8b92,null))[_0x51c6('0x42')](handleError(_0x5b8b92,null));};exports[_0x51c6('0x26')]=function(_0x6c4963,_0x6364bc){return db[_0x51c6('0x3d')][_0x51c6('0x44')]({'where':{'id':_0x6c4963[_0x51c6('0x47')]['id']}})['then'](handleEntityNotFound(_0x6364bc,null))['then'](removeEntity(_0x6364bc,null))[_0x51c6('0x42')](handleError(_0x6364bc,null));};
\ No newline at end of file
+var _0x6545=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','catch','show','params','keys','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','SmsApplication','rawAttributes','type','model','query','filters','intersection','attributes','fields','length'];(function(_0x51fdbd,_0x43975b){var _0x91cee5=function(_0x5f5251){while(--_0x5f5251){_0x51fdbd['push'](_0x51fdbd['shift']());}};_0x91cee5(++_0x43975b);}(_0x6545,0xed));var _0x5654=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6545[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x5654('0x0'));var rimraf=require(_0x5654('0x1'));var zipdir=require(_0x5654('0x2'));var jsonpatch=require(_0x5654('0x3'));var rp=require(_0x5654('0x4'));var moment=require(_0x5654('0x5'));var BPromise=require(_0x5654('0x6'));var Mustache=require(_0x5654('0x7'));var util=require(_0x5654('0x8'));var path=require(_0x5654('0x9'));var sox=require(_0x5654('0xa'));var csv=require(_0x5654('0xb'));var ejs=require(_0x5654('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5654('0xd'));var crypto=require(_0x5654('0xe'));var jsforce=require(_0x5654('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5654('0x10'));var Papa=require(_0x5654('0x11'));var Redis=require(_0x5654('0x12'));var authService=require(_0x5654('0x13'));var qs=require(_0x5654('0x14'));var as=require(_0x5654('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5654('0x16'))('api');var utils=require(_0x5654('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5654('0x18'));var db=require(_0x5654('0x19'))['db'];function respondWithStatusCode(_0x4dd174,_0x50d886){_0x50d886=_0x50d886||0xcc;return function(_0xcfe0a0){if(_0xcfe0a0){return _0x4dd174[_0x5654('0x1a')](_0x50d886);}return _0x4dd174[_0x5654('0x1b')](_0x50d886)[_0x5654('0x1c')]();};}function respondWithResult(_0x392c8d,_0x5cbc8c){_0x5cbc8c=_0x5cbc8c||0xc8;return function(_0x293be1){if(_0x293be1){return _0x392c8d[_0x5654('0x1b')](_0x5cbc8c)[_0x5654('0x1d')](_0x293be1);}};}function respondWithFilteredResult(_0x51aa39,_0x5720b1){return function(_0x23fbb4){if(_0x23fbb4){var _0x366048=typeof _0x5720b1[_0x5654('0x1e')]==='undefined'&&typeof _0x5720b1[_0x5654('0x1f')]===_0x5654('0x20');var _0x132b6a=_0x23fbb4['count'];var _0x4233a3=_0x366048?0x0:_0x5720b1[_0x5654('0x1e')];var _0x32f36e=_0x366048?_0x23fbb4[_0x5654('0x21')]:_0x5720b1['offset']+_0x5720b1[_0x5654('0x1f')];var _0x34f991;if(_0x32f36e>=_0x132b6a){_0x32f36e=_0x132b6a;_0x34f991=0xc8;}else{_0x34f991=0xce;}_0x51aa39['status'](_0x34f991);return _0x51aa39[_0x5654('0x22')](_0x5654('0x23'),_0x4233a3+'-'+_0x32f36e+'/'+_0x132b6a)[_0x5654('0x1d')](_0x23fbb4);}return null;};}function patchUpdates(_0x25c34a){return function(_0x20159d){try{jsonpatch[_0x5654('0x24')](_0x20159d,_0x25c34a,!![]);}catch(_0x34b3d1){return BPromise[_0x5654('0x25')](_0x34b3d1);}return _0x20159d[_0x5654('0x26')]();};}function saveUpdates(_0x5c0d39,_0x3915ad){return function(_0x4d8246){if(_0x4d8246){return _0x4d8246['update'](_0x5c0d39)[_0x5654('0x27')](function(_0x254972){return _0x254972;});}return null;};}function removeEntity(_0x362eef,_0x2f25f1){return function(_0xc4a1d2){if(_0xc4a1d2){return _0xc4a1d2[_0x5654('0x28')]()[_0x5654('0x27')](function(){_0x362eef['status'](0xcc)[_0x5654('0x1c')]();});}};}function handleEntityNotFound(_0x350c74,_0x39f7d1){return function(_0x4ebaf9){if(!_0x4ebaf9){_0x350c74[_0x5654('0x1a')](0x194);}return _0x4ebaf9;};}function handleError(_0x19307b,_0x59969a){_0x59969a=_0x59969a||0x1f4;return function(_0x25dd11){logger[_0x5654('0x29')](_0x25dd11[_0x5654('0x2a')]);if(_0x25dd11[_0x5654('0x2b')]){delete _0x25dd11[_0x5654('0x2b')];}_0x19307b[_0x5654('0x1b')](_0x59969a)['send'](_0x25dd11);};}exports['index']=function(_0x25e788,_0x2d001a){var _0x324cac={},_0x234ab6={},_0x1c57d7={'count':0x0,'rows':[]};var _0x3ef393=_[_0x5654('0x2c')](db[_0x5654('0x2d')][_0x5654('0x2e')],function(_0x32c2c5){return{'name':_0x32c2c5['fieldName'],'type':_0x32c2c5[_0x5654('0x2f')]['key']};});_0x234ab6[_0x5654('0x30')]=_[_0x5654('0x2c')](_0x3ef393,_0x5654('0x2b'));_0x234ab6[_0x5654('0x31')]=_['keys'](_0x25e788[_0x5654('0x31')]);_0x234ab6[_0x5654('0x32')]=_[_0x5654('0x33')](_0x234ab6[_0x5654('0x30')],_0x234ab6['query']);_0x324cac[_0x5654('0x34')]=_['intersection'](_0x234ab6[_0x5654('0x30')],qs[_0x5654('0x35')](_0x25e788[_0x5654('0x31')][_0x5654('0x35')]));_0x324cac[_0x5654('0x34')]=_0x324cac[_0x5654('0x34')][_0x5654('0x36')]?_0x324cac[_0x5654('0x34')]:_0x234ab6['model'];if(!_0x25e788[_0x5654('0x31')][_0x5654('0x37')](_0x5654('0x38'))){_0x324cac[_0x5654('0x1f')]=qs[_0x5654('0x1f')](_0x25e788[_0x5654('0x31')][_0x5654('0x1f')]);_0x324cac[_0x5654('0x1e')]=qs[_0x5654('0x1e')](_0x25e788[_0x5654('0x31')][_0x5654('0x1e')]);}_0x324cac['order']=qs[_0x5654('0x39')](_0x25e788[_0x5654('0x31')][_0x5654('0x39')]);_0x324cac[_0x5654('0x3a')]=qs['filters'](_[_0x5654('0x3b')](_0x25e788['query'],_0x234ab6[_0x5654('0x32')]),_0x3ef393);if(_0x25e788['query'][_0x5654('0x3c')]){_0x324cac['where']=_[_0x5654('0x3d')](_0x324cac['where'],{'$or':_[_0x5654('0x2c')](_0x3ef393,function(_0x570204){if(_0x570204[_0x5654('0x2f')]!==_0x5654('0x3e')){var _0x33dd79={};_0x33dd79[_0x570204[_0x5654('0x2b')]]={'$like':'%'+_0x25e788[_0x5654('0x31')][_0x5654('0x3c')]+'%'};return _0x33dd79;}})});}_0x324cac=_[_0x5654('0x3d')]({},_0x324cac,_0x25e788['options']);var _0x1a9dcd={'where':_0x324cac['where']};return db[_0x5654('0x2d')]['count'](_0x1a9dcd)[_0x5654('0x27')](function(_0x2915d1){_0x1c57d7['count']=_0x2915d1;if(_0x25e788[_0x5654('0x31')][_0x5654('0x3f')]){_0x324cac['include']=[{'all':!![]}];}return db[_0x5654('0x2d')]['findAll'](_0x324cac);})[_0x5654('0x27')](function(_0x2c0af8){_0x1c57d7['rows']=_0x2c0af8;return _0x1c57d7;})['then'](respondWithFilteredResult(_0x2d001a,_0x324cac))[_0x5654('0x40')](handleError(_0x2d001a,null));};exports[_0x5654('0x41')]=function(_0x28d03e,_0x3456bc){var _0x566b5b={'raw':!![],'where':{'id':_0x28d03e[_0x5654('0x42')]['id']}},_0x53437b={};_0x53437b['model']=_[_0x5654('0x43')](db[_0x5654('0x2d')]['rawAttributes']);_0x53437b[_0x5654('0x31')]=_['keys'](_0x28d03e[_0x5654('0x31')]);_0x53437b['filters']=_[_0x5654('0x33')](_0x53437b[_0x5654('0x30')],_0x53437b[_0x5654('0x31')]);_0x566b5b['attributes']=_[_0x5654('0x33')](_0x53437b[_0x5654('0x30')],qs[_0x5654('0x35')](_0x28d03e[_0x5654('0x31')][_0x5654('0x35')]));_0x566b5b[_0x5654('0x34')]=_0x566b5b[_0x5654('0x34')][_0x5654('0x36')]?_0x566b5b[_0x5654('0x34')]:_0x53437b[_0x5654('0x30')];if(_0x28d03e[_0x5654('0x31')][_0x5654('0x3f')]){_0x566b5b[_0x5654('0x44')]=[{'all':!![]}];}_0x566b5b=_['merge']({},_0x566b5b,_0x28d03e[_0x5654('0x45')]);return db['SmsApplication'][_0x5654('0x46')](_0x566b5b)[_0x5654('0x27')](handleEntityNotFound(_0x3456bc,null))[_0x5654('0x27')](respondWithResult(_0x3456bc,null))[_0x5654('0x40')](handleError(_0x3456bc,null));};exports['create']=function(_0xe9d19d,_0x37f783){return db['SmsApplication'][_0x5654('0x47')](_0xe9d19d[_0x5654('0x48')],{})['then'](respondWithResult(_0x37f783,0xc9))['catch'](handleError(_0x37f783,null));};exports['update']=function(_0x3610ef,_0x2e6456){if(_0x3610ef[_0x5654('0x48')]['id']){delete _0x3610ef[_0x5654('0x48')]['id'];}return db[_0x5654('0x2d')]['find']({'where':{'id':_0x3610ef['params']['id']}})['then'](handleEntityNotFound(_0x2e6456,null))[_0x5654('0x27')](saveUpdates(_0x3610ef[_0x5654('0x48')],null))[_0x5654('0x27')](respondWithResult(_0x2e6456,null))[_0x5654('0x40')](handleError(_0x2e6456,null));};exports[_0x5654('0x28')]=function(_0x56c642,_0x5d1569){return db[_0x5654('0x2d')][_0x5654('0x46')]({'where':{'id':_0x56c642['params']['id']}})[_0x5654('0x27')](handleEntityNotFound(_0x5d1569,null))['then'](removeEntity(_0x5d1569,null))['catch'](handleError(_0x5d1569,null));};
\ No newline at end of file
index 4166f79..090eefb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad01=['define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x104f39,_0x387e28){var _0x5a1155=function(_0x530f66){while(--_0x530f66){_0x104f39['push'](_0x104f39['shift']());}};_0x5a1155(++_0x387e28);}(_0xad01,0x1d4));var _0x1ad0=function(_0x76d2ec,_0x45ea7c){_0x76d2ec=_0x76d2ec-0x0;var _0x540bdc=_0xad01[_0x76d2ec];return _0x540bdc;};'use strict';var _=require(_0x1ad0('0x0'));var util=require(_0x1ad0('0x1'));var logger=require(_0x1ad0('0x2'))(_0x1ad0('0x3'));var moment=require(_0x1ad0('0x4'));var BPromise=require(_0x1ad0('0x5'));var rp=require(_0x1ad0('0x6'));var fs=require('fs');var path=require(_0x1ad0('0x7'));var rimraf=require(_0x1ad0('0x8'));var config=require(_0x1ad0('0x9'));var attributes=require(_0x1ad0('0xa'));module[_0x1ad0('0xb')]=function(_0x132409,_0xf8911){return _0x132409[_0x1ad0('0xc')](_0x1ad0('0xd'),attributes,{'tableName':_0x1ad0('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1ad0('0xf')});};
\ No newline at end of file
+var _0x44c3=['SmsApplication','sms_applications','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0x232e75,_0x2c4504){var _0x129ed6=function(_0x3c490f){while(--_0x3c490f){_0x232e75['push'](_0x232e75['shift']());}};_0x129ed6(++_0x2c4504);}(_0x44c3,0x1a6));var _0x344c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x44c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x344c('0x0'));var util=require(_0x344c('0x1'));var logger=require(_0x344c('0x2'))(_0x344c('0x3'));var moment=require('moment');var BPromise=require(_0x344c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x344c('0x5'));var config=require(_0x344c('0x6'));var attributes=require(_0x344c('0x7'));module[_0x344c('0x8')]=function(_0x4f875b,_0x284ef7){return _0x4f875b[_0x344c('0x9')](_0x344c('0xa'),attributes,{'tableName':_0x344c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index dcf7548..4a25435 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf61e=['info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x40843f,_0x558857){var _0x177176=function(_0x553c9e){while(--_0x553c9e){_0x40843f['push'](_0x40843f['shift']());}};_0x177176(++_0x558857);}(_0xf61e,0x191));var _0xef61=function(_0x4a80b8,_0x553756){_0x4a80b8=_0x4a80b8-0x0;var _0x7e80c3=_0xf61e[_0x4a80b8];return _0x7e80c3;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});}
\ No newline at end of file
+var _0xd05a=['info','result','catch','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd05a,0x143));var _0xad05=function(_0x2cdf25,_0x3bef72){_0x2cdf25=_0x2cdf25-0x0;var _0x20fe2a=_0xd05a[_0x2cdf25];return _0x20fe2a;};'use strict';var _=require('lodash');var util=require(_0xad05('0x0'));var moment=require(_0xad05('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(_0xad05('0x2'));var logger=require(_0xad05('0x3'))(_0xad05('0x4'));var config=require(_0xad05('0x5'));var jayson=require(_0xad05('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39ddaf,_0x45303c,_0xd12d76){return new BPromise(function(_0x565f85,_0x17ec26){return client[_0xad05('0x7')](_0x39ddaf,_0xd12d76)[_0xad05('0x8')](function(_0x573acb){logger['info'](_0xad05('0x9'),_0x45303c,'request\x20sent');logger[_0xad05('0xa')](_0xad05('0xb'),_0x45303c,_0xad05('0xc'),JSON[_0xad05('0xd')](_0x573acb));if(_0x573acb[_0xad05('0xe')]){if(_0x573acb[_0xad05('0xe')][_0xad05('0xf')]===0x1f4){logger[_0xad05('0xe')](_0xad05('0x9'),_0x45303c,_0x573acb[_0xad05('0xe')]['message']);return _0x17ec26(_0x573acb[_0xad05('0xe')]['message']);}logger[_0xad05('0xe')]('SmsApplication,\x20%s,\x20%s',_0x45303c,_0x573acb[_0xad05('0xe')][_0xad05('0x10')]);return _0x565f85(_0x573acb[_0xad05('0xe')]['message']);}else{logger[_0xad05('0x11')]('SmsApplication,\x20%s,\x20%s',_0x45303c,_0xad05('0xc'));_0x565f85(_0x573acb[_0xad05('0x12')][_0xad05('0x10')]);}})[_0xad05('0x13')](function(_0x43ab03){logger[_0xad05('0xe')]('SmsApplication,\x20%s,\x20%s',_0x45303c,_0x43ab03);_0x17ec26(_0x43ab03);});});}
\ No newline at end of file
index 37e1423..585a0af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea28=['put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','create','post','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x5da953,_0x52de6b){var _0x1c8aee=function(_0x4a14ba){while(--_0x4a14ba){_0x5da953['push'](_0x5da953['shift']());}};_0x1c8aee(++_0x52de6b);}(_0xea28,0x13a));var _0x8ea2=function(_0x11f76e,_0x33569a){_0x11f76e=_0x11f76e-0x0;var _0x152655=_0xea28[_0x11f76e];return _0x152655;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getMessages']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['post']('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x14')]);router[_0x8ea2('0x15')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['addMessage']);router[_0x8ea2('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x18')),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1b')),controller[_0x8ea2('0x1c')]);router[_0x8ea2('0x1d')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1e')),controller[_0x8ea2('0x1f')]);router[_0x8ea2('0x1d')](_0x8ea2('0x20'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x21')]);module['exports']=router;
\ No newline at end of file
+var _0x3423=['/:id','/:id/messages','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','put','delete','smsinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var fs_extra=require(_0x3342('0x4'));var auth=require(_0x3342('0x5'));var interaction=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var controller=require(_0x3342('0x8'));router[_0x3342('0x9')]('/',auth[_0x3342('0xa')](),controller[_0x3342('0xb')]);router[_0x3342('0x9')](_0x3342('0xc'),auth[_0x3342('0xa')](),controller[_0x3342('0xd')]);router[_0x3342('0x9')](_0x3342('0xe'),auth[_0x3342('0xa')](),controller['show']);router['get'](_0x3342('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth[_0x3342('0xa')](),controller[_0x3342('0x10')]);router['post']('/',auth[_0x3342('0xa')](),controller['create']);router[_0x3342('0x11')](_0x3342('0xf'),auth['isAuthenticated'](),controller[_0x3342('0x12')]);router[_0x3342('0x11')](_0x3342('0x13'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x16')),controller['addTags']);router[_0x3342('0x17')](_0x3342('0xe'),auth['isAuthenticated'](),interaction[_0x3342('0x14')](_0x3342('0x15'),'smsinteraction:update'),controller['update']);router[_0x3342('0x18')](_0x3342('0xe'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x19')),controller[_0x3342('0x1a')]);router[_0x3342('0x18')](_0x3342('0x13'),auth['isAuthenticated'](),controller[_0x3342('0x1b')]);module[_0x3342('0x1c')]=router;
\ No newline at end of file
index 2bb6829..4534ff1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8832=['ENUM','out','BOOLEAN','sequelize','moment','DATE','STRING'];(function(_0x493150,_0x107958){var _0x3fe8da=function(_0xce7a75){while(--_0xce7a75){_0x493150['push'](_0x493150['shift']());}};_0x3fe8da(++_0x107958);}(_0x8832,0x1f4));var _0x2883=function(_0x28eaaa,_0x633d6){_0x28eaaa=_0x28eaaa-0x0;var _0xca07f=_0x8832[_0x28eaaa];return _0xca07f;};'use strict';var Sequelize=require(_0x2883('0x0'));var moment=require(_0x2883('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2883('0x2')]},'disposition':{'type':Sequelize[_0x2883('0x3')]},'secondDisposition':{'type':Sequelize[_0x2883('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2883('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2883('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x2883('0x4')]('in',_0x2883('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2883('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2883('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe0ae=['BOOLEAN','STRING','DATE','ENUM','out','exports'];(function(_0x3c6249,_0x741b9c){var _0x503b14=function(_0x53362b){while(--_0x53362b){_0x3c6249['push'](_0x3c6249['shift']());}};_0x503b14(++_0x741b9c);}(_0xe0ae,0xa1));var _0xee0a=function(_0x1b8d87,_0x4168fb){_0x1b8d87=_0x1b8d87-0x0;var _0x182b74=_0xe0ae[_0x1b8d87];return _0x182b74;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xee0a('0x0')]={'closed':{'type':Sequelize[_0xee0a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xee0a('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xee0a('0x2')]},'note':{'type':Sequelize[_0xee0a('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xee0a('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xee0a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xee0a('0x4')]('in',_0xee0a('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xee0a('0x1')],'defaultValue':![]}};
\ No newline at end of file
index 601829a..7d2c88b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d2e=['a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','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','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','all','catch','params','rawAttributes','includeAll','include','merge','options','create','update','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','SmsInteractionId','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','findAll','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','createdAt','SmsAccount','Account','Owner','get','Sms','N.A.','closed','closedAt','disposition','direction','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','name','send','fullname','TagIds','split','forEach','Tags','push','index','map','SmsInteraction','fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts'];(function(_0x2d6c35,_0x281143){var _0x11a97d=function(_0x5e98a8){while(--_0x5e98a8){_0x2d6c35['push'](_0x2d6c35['shift']());}};_0x11a97d(++_0x281143);}(_0x9d2e,0x97));var _0xe9d2=function(_0x46cfcf,_0x23dfed){_0x46cfcf=_0x46cfcf-0x0;var _0x31cabd=_0x9d2e[_0x46cfcf];return _0x31cabd;};'use strict';var emlformat=require(_0xe9d2('0x0'));var rimraf=require(_0xe9d2('0x1'));var zipdir=require(_0xe9d2('0x2'));var jsonpatch=require(_0xe9d2('0x3'));var rp=require(_0xe9d2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9d2('0x5'));var util=require(_0xe9d2('0x6'));var path=require(_0xe9d2('0x7'));var sox=require(_0xe9d2('0x8'));var csv=require('to-csv');var ejs=require(_0xe9d2('0x9'));var fs=require('fs');var fs_extra=require(_0xe9d2('0xa'));var _=require(_0xe9d2('0xb'));var squel=require(_0xe9d2('0xc'));var crypto=require(_0xe9d2('0xd'));var jsforce=require(_0xe9d2('0xe'));var deskjs=require(_0xe9d2('0xf'));var toCsv=require(_0xe9d2('0x10'));var querystring=require(_0xe9d2('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe9d2('0x12'));var qs=require(_0xe9d2('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xe9d2('0x14'));var hardwareService=require(_0xe9d2('0x15'));var logger=require(_0xe9d2('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xe9d2('0x17'));var licenseUtil=require(_0xe9d2('0x18'));var db=require(_0xe9d2('0x19'))['db'];config[_0xe9d2('0x1a')]=_[_0xe9d2('0x1b')](config[_0xe9d2('0x1a')],{'host':_0xe9d2('0x1c'),'port':0x18eb});var socket=require(_0xe9d2('0x1d'))(new Redis(config[_0xe9d2('0x1a')]));require('./smsInteraction.socket')[_0xe9d2('0x1e')](socket);function respondWithStatusCode(_0x384c74,_0x2bfbec){_0x2bfbec=_0x2bfbec||0xcc;return function(_0x3c94db){if(_0x3c94db){return _0x384c74[_0xe9d2('0x1f')](_0x2bfbec);}return _0x384c74[_0xe9d2('0x20')](_0x2bfbec)[_0xe9d2('0x21')]();};}function respondWithResult(_0x50eae8,_0x4ae885){_0x4ae885=_0x4ae885||0xc8;return function(_0x3d4226){if(_0x3d4226){return _0x50eae8[_0xe9d2('0x20')](_0x4ae885)['json'](_0x3d4226);}};}function respondWithFilteredResult(_0x391ddf,_0x232fef){return function(_0x2e17b2){if(_0x2e17b2){var _0x5b5341=typeof _0x232fef[_0xe9d2('0x22')]===_0xe9d2('0x23')&&typeof _0x232fef[_0xe9d2('0x24')]==='undefined';var _0x56db63=_0x2e17b2[_0xe9d2('0x25')];var _0x1a89c5=_0x5b5341?0x0:_0x232fef[_0xe9d2('0x22')];var _0x5d8d41=_0x5b5341?_0x2e17b2[_0xe9d2('0x25')]:_0x232fef[_0xe9d2('0x22')]+_0x232fef['limit'];var _0x1eed75;if(_0x5d8d41>=_0x56db63){_0x5d8d41=_0x56db63;_0x1eed75=0xc8;}else{_0x1eed75=0xce;}_0x391ddf['status'](_0x1eed75);return _0x391ddf[_0xe9d2('0x26')](_0xe9d2('0x27'),_0x1a89c5+'-'+_0x5d8d41+'/'+_0x56db63)[_0xe9d2('0x28')](_0x2e17b2);}return null;};}function patchUpdates(_0x299edb){return function(_0x386db3){try{jsonpatch[_0xe9d2('0x29')](_0x386db3,_0x299edb,!![]);}catch(_0x46709c){return BPromise['reject'](_0x46709c);}return _0x386db3[_0xe9d2('0x2a')]();};}function saveUpdates(_0xa04c67,_0x294fe3){return function(_0x2e4e09){if(_0x2e4e09){return _0x2e4e09['update'](_0xa04c67)[_0xe9d2('0x2b')](function(_0x2c4907){return _0x2c4907;});}return null;};}function removeEntity(_0x685133,_0x53d5de){return function(_0x55b26d){if(_0x55b26d){return _0x55b26d[_0xe9d2('0x2c')]()[_0xe9d2('0x2b')](function(){_0x685133[_0xe9d2('0x20')](0xcc)[_0xe9d2('0x21')]();});}};}function handleEntityNotFound(_0x456412,_0x53387f){return function(_0x211638){if(!_0x211638){_0x456412[_0xe9d2('0x1f')](0x194);}return _0x211638;};}function handleError(_0x4cbb03,_0xdc4f4b){_0xdc4f4b=_0xdc4f4b||0x1f4;return function(_0x4c797c){logger[_0xe9d2('0x2d')](_0x4c797c['stack']);if(_0x4c797c['name']){delete _0x4c797c[_0xe9d2('0x2e')];}_0x4cbb03[_0xe9d2('0x20')](_0xdc4f4b)[_0xe9d2('0x2f')](_0x4c797c);};}function getInteractionUsers(_0x223950,_0x57f8b9){return new BPromise(function(_0xf50f9b,_0x35e919){try{if(_0x57f8b9[_0x223950['id']]){_0x223950['Users']=_['map'](_0x57f8b9[_0x223950['id']],function(_0x4a12bb){return{'id':_0x4a12bb['id'],'fullname':_0x4a12bb[_0xe9d2('0x30')]};});}}catch(_0x155527){_0x35e919(_0x155527);}_0xf50f9b(_0x223950);});}function getInteractionTags(_0x1371cb,_0x2afe59){return new BPromise(function(_0x43311f,_0x3ab2f1){try{if(_0x1371cb['TagIds']){_0x1371cb['Tags']=[];_0x1371cb[_0xe9d2('0x31')][_0xe9d2('0x32')](',')[_0xe9d2('0x33')](function(_0x4be664){_0x1371cb[_0xe9d2('0x34')][_0xe9d2('0x35')](_0x2afe59[_0x4be664]);});}delete _0x1371cb[_0xe9d2('0x31')];}catch(_0xb2b11f){_0x3ab2f1(_0xb2b11f);}_0x43311f(_0x1371cb);});}function updateSmsInteraction(_0x447c74,_0x2a0ef6,_0x1e7c40){return new BPromise(function(_0x4d3bca,_0x205157){return getInteractionUsers(_0x447c74,_0x1e7c40)[_0xe9d2('0x2b')](function(_0x1b8697){return getInteractionTags(_0x1b8697,_0x2a0ef6);})[_0xe9d2('0x2b')](function(_0x3d205a){_0x4d3bca(_0x3d205a);})['catch'](function(_0x5704f5){_0x205157(_0x5704f5);});});}exports[_0xe9d2('0x36')]=function(_0xbb5d98,_0x114fea){var _0xebb6d8={},_0x50a394={},_0x5089c0={'count':0x0,'rows':[]};var _0x529960=_[_0xe9d2('0x37')](db[_0xe9d2('0x38')]['rawAttributes'],function(_0x27ec5a){return{'name':_0x27ec5a[_0xe9d2('0x39')],'type':_0x27ec5a[_0xe9d2('0x3a')]['key']};});_0x50a394[_0xe9d2('0x3b')]=_[_0xe9d2('0x37')](_0x529960,'name');_0x50a394[_0xe9d2('0x3c')]=_['keys'](_0xbb5d98[_0xe9d2('0x3c')]);_0x50a394[_0xe9d2('0x3d')]=_[_0xe9d2('0x3e')](_0x50a394['model'],_0x50a394['query']);_0xebb6d8['attributes']=_[_0xe9d2('0x3e')](_0x50a394[_0xe9d2('0x3b')],qs[_0xe9d2('0x3f')](_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x3f')]));_0xebb6d8['attributes']=_0xebb6d8[_0xe9d2('0x40')][_0xe9d2('0x41')]?_0xebb6d8[_0xe9d2('0x40')]:_0x50a394[_0xe9d2('0x3b')];if(!_0xbb5d98['query']['hasOwnProperty'](_0xe9d2('0x42'))){_0xebb6d8[_0xe9d2('0x24')]=qs[_0xe9d2('0x24')](_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x24')]);_0xebb6d8['offset']=qs[_0xe9d2('0x22')](_0xbb5d98['query'][_0xe9d2('0x22')]);}_0xebb6d8[_0xe9d2('0x43')]=qs[_0xe9d2('0x44')](_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x44')]);_0xebb6d8[_0xe9d2('0x45')]=qs[_0xe9d2('0x3d')](_[_0xe9d2('0x46')](_0xbb5d98[_0xe9d2('0x3c')],_0x50a394[_0xe9d2('0x3d')]),_0x529960);var _0x3ecc56=[];var _0x380c12=squel[_0xe9d2('0x47')]()[_0xe9d2('0x48')]('id')['field'](_0xe9d2('0x2e'))[_0xe9d2('0x48')](_0xe9d2('0x49'))[_0xe9d2('0x4a')](_0xe9d2('0x4b'));var _0x2b8527=squel['select']()[_0xe9d2('0x48')](_0xe9d2('0x4c'))[_0xe9d2('0x48')]('u.fullname')[_0xe9d2('0x48')]('ui.SmsInteractionId')[_0xe9d2('0x4a')](_0xe9d2('0x4d'),'ui')[_0xe9d2('0x4e')](_0xe9d2('0x4f'),'u',_0xe9d2('0x50'));var _0x1e3934=squel[_0xe9d2('0x47')]()[_0xe9d2('0x4a')](_0xe9d2('0x51'),'i')['left_join'](_0xe9d2('0x52'),'c',_0xe9d2('0x53'))[_0xe9d2('0x4e')](_0xe9d2('0x4f'),'o',_0xe9d2('0x54'))[_0xe9d2('0x4e')](_0xe9d2('0x55'),'a',_0xe9d2('0x56'))['left_join']('sms_messages','me',_0xe9d2('0x57'))[_0xe9d2('0x4e')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')[_0xe9d2('0x4e')](_0xe9d2('0x4b'),'t',_0xe9d2('0x58'));var _0x34ed8b=squel[_0xe9d2('0x59')]();var _0x3e3a2e=[];var _0xa384ca=squel[_0xe9d2('0x59')]();var _0x1e837d;if(_0xbb5d98['query'][_0xe9d2('0x5a')]){_0x1e837d=as['parseSearch'](_0xbb5d98['query'][_0xe9d2('0x5a')]);var _0x4ed84c=_0x1e837d[_0xe9d2('0x5b')];for(var _0x39f060=0x0;_0x39f060<_0x1e837d[_0xe9d2('0x5c')][_0xe9d2('0x41')];_0x39f060++){var _0x1815ef=_0x1e837d[_0xe9d2('0x5c')][_0x39f060];var _0x21fe11='i';var _0x7f7b76=_[_0xe9d2('0x5d')](_0x529960,[_0xe9d2('0x2e'),_0x1815ef[_0xe9d2('0x48')]]);if(!_0x7f7b76){switch(_0x1815ef[_0xe9d2('0x48')]){case _0xe9d2('0x5e'):if(_0x1815ef[_0xe9d2('0x5f')]==0x1){_0x1e3934[_0xe9d2('0x60')]('`'+_0x1815ef[_0xe9d2('0x48')]+_0xe9d2('0x61'));}else{_0x1e3934[_0xe9d2('0x60')]('`'+_0x1815ef[_0xe9d2('0x48')]+_0xe9d2('0x62'));}break;case _0xe9d2('0x63'):if(_0x1815ef[_0xe9d2('0x64')]===_0xe9d2('0x65')){if(_0x1815ef[_0xe9d2('0x5f')]['split']('\x20')['length']>0x1){_0x34ed8b[_0x4ed84c](_0xe9d2('0x66'),qs[_0xe9d2('0x67')](_0x1815ef[_0xe9d2('0x5f')]),null);}else{var _0x51ff31='%'+_0x1815ef[_0xe9d2('0x5f')]+'%';_0x34ed8b[_0x4ed84c](_0xe9d2('0x68'),_0x51ff31,_0x51ff31,_0x51ff31);}}else{_0x7f7b76=_[_0xe9d2('0x5d')](_0x529960,[_0xe9d2('0x2e'),_0xe9d2('0x69')]);_0x1815ef[_0xe9d2('0x48')]=_0xe9d2('0x69');_0x5874fd=as[_0xe9d2('0x6a')](_0x21fe11,_0x7f7b76[_0xe9d2('0x3a')],_0x1815ef);_0x34ed8b[_0x4ed84c](_0x5874fd[_0xe9d2('0x6b')],_0x5874fd[_0xe9d2('0x5f')][_0xe9d2('0x6c')],_0x5874fd[_0xe9d2('0x5f')][_0xe9d2('0x21')]);}break;case _0xe9d2('0x6d'):var _0x20f725=_0x1815ef[_0xe9d2('0x5f')][_0xe9d2('0x32')](',')['map'](function(_0x1a3499){return Number(_0x1a3499);});_0x20f725['forEach'](function(_0x182abd){_0xa384ca['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x182abd+',%');});_0x3e3a2e=_[_0xe9d2('0x6e')](_0x3e3a2e,_0x20f725);break;case _0xe9d2('0x6f'):if(_0x1815ef[_0xe9d2('0x64')]===_0xe9d2('0x65')){_0x34ed8b[_0x4ed84c](_0xe9d2('0x70'),'%'+_0x1815ef[_0xe9d2('0x5f')]+'%',null);}else{_0x7f7b76=_['find'](_0x529960,[_0xe9d2('0x2e'),_0xe9d2('0x71')]);_0x1815ef[_0xe9d2('0x48')]=_0xe9d2('0x71');_0x5874fd=as[_0xe9d2('0x6a')](_0x21fe11,_0x7f7b76['type'],_0x1815ef);_0x34ed8b[_0x4ed84c](_0x5874fd[_0xe9d2('0x6b')],_0x5874fd[_0xe9d2('0x5f')][_0xe9d2('0x6c')],_0x5874fd['value'][_0xe9d2('0x21')]);}break;case _0xe9d2('0x72'):_0x5874fd=as['buildExpression']('me',null,_0x1815ef);_0x34ed8b[_0x4ed84c](_0x5874fd['text'],_0x5874fd[_0xe9d2('0x5f')][_0xe9d2('0x6c')],_0x5874fd[_0xe9d2('0x5f')][_0xe9d2('0x21')]);break;}}else{var _0x5874fd=as[_0xe9d2('0x6a')](_0x21fe11,_0x7f7b76['type'],_0x1815ef);_0x34ed8b[_0x4ed84c](_0x5874fd[_0xe9d2('0x6b')],_0x5874fd[_0xe9d2('0x5f')][_0xe9d2('0x6c')],_0x5874fd['value']['end']);}}}else{var _0x32d387=_(_0xbb5d98[_0xe9d2('0x3c')])[_0xe9d2('0x73')]()['map'](function(_0x3ae2d7){return _[_0xe9d2('0x74')](_0x529960,[_0xe9d2('0x2e'),_0x3ae2d7])?_0x3ae2d7:undefined;})[_0xe9d2('0x75')]()[_0xe9d2('0x5f')]();if(!_[_0xe9d2('0x76')](_0x32d387)){_0x32d387[_0xe9d2('0x33')](function(_0x2a099b){if(_0x2a099b===_0xe9d2('0x77')){_0x1e3934[_0xe9d2('0x45')](_0xe9d2('0x78'),[][_0xe9d2('0x79')](_0xbb5d98[_0xe9d2('0x3c')][_0x2a099b]));}else if(_0x2a099b==='createdAt'){var _0xc145af=JSON[_0xe9d2('0x7a')](_0xbb5d98[_0xe9d2('0x3c')][_0x2a099b])[_0xe9d2('0x7b')];var _0x265051=JSON[_0xe9d2('0x7a')](_0xbb5d98['query'][_0x2a099b])[_0xe9d2('0x7c')];_0x1e3934['where'](_0xe9d2('0x7d'),_0xc145af,_0x265051);}else{if(_0xbb5d98['query'][_0x2a099b]===_0xe9d2('0x7e')){_0x1e3934[_0xe9d2('0x45')]('i.'+_0x2a099b+_0xe9d2('0x7f'));}else{_0x1e3934['where']('i.'+_0x2a099b+_0xe9d2('0x80'),_0xbb5d98[_0xe9d2('0x3c')][_0x2a099b]);}}});}if(_0xbb5d98['query'][_0xe9d2('0x81')]){if(_0xbb5d98[_0xe9d2('0x3c')]['read']==0x1){_0x1e3934[_0xe9d2('0x60')]('`unreadMessages`\x20=\x200');}else{_0x1e3934[_0xe9d2('0x60')](_0xe9d2('0x82'));}}if(_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x83')]){_0x3e3a2e=_[_0xe9d2('0x84')](_0xbb5d98['query'][_0xe9d2('0x83')])?_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x83')]:new Array(_0xbb5d98['query'][_0xe9d2('0x83')]);_0x3e3a2e[_0xe9d2('0x33')](function(_0x50dbdf){_0xa384ca['or'](_0xe9d2('0x85'),'%,'+_0x50dbdf+',%');});}if(_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x86')]){var _0x382374=_0xbb5d98[_0xe9d2('0x3c')]['filter'][_0xe9d2('0x87')]('\x5c','\x5c\x5c')[_0xe9d2('0x87')](/'/g,'\x27\x27');if(qs[_0xe9d2('0x88')](_0x382374)){_0x34ed8b['or'](_0xe9d2('0x89'),_0x382374+'%')['or'](_0xe9d2('0x8a'),_0x382374+'%');}else{_0x34ed8b['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe9d2('0x67')](_0x382374))['or'](_0xe9d2('0x8b'),_0x382374+'%');}}}_0x1e3934['where'](_0x34ed8b);_0x1e3934[_0xe9d2('0x8c')]('i.id');var _0x293ab2={'type':db[_0xe9d2('0x8d')][_0xe9d2('0x8e')][_0xe9d2('0x8f')],'raw':!![]};var _0x533ca7=_0x1e3934[_0xe9d2('0x90')]();_0x533ca7['field'](_0xe9d2('0x91'));_0x533ca7[_0xe9d2('0x48')](_0xe9d2('0x92'),_0xe9d2('0x5e'));if(_0xebb6d8[_0xe9d2('0x43')]){_0xebb6d8[_0xe9d2('0x43')][_0xe9d2('0x33')](function(_0x3c68b1){var _0x56c5e7=_0x3c68b1[0x0]===_0xe9d2('0x93')?_0x3c68b1[0x0]:'i.'+_0x3c68b1[0x0];_0x1e3934[_0xe9d2('0x43')](_0x56c5e7,_0x3c68b1[0x1]===_0xe9d2('0x94')?![]:!![]);});}if(!_[_0xe9d2('0x76')](_0x3e3a2e)){_0x1e3934[_0xe9d2('0x60')](_0xa384ca);_0x533ca7[_0xe9d2('0x45')]('t.id\x20IN\x20?',_0x3e3a2e);}BPromise[_0xe9d2('0x95')]()[_0xe9d2('0x2b')](function(){if(!_0x1e837d){if(_0xbb5d98['query']['SmsAccountId'])return;_0x533ca7[_0xe9d2('0x45')](_0xe9d2('0x96'));_0x1e3934[_0xe9d2('0x45')](_0xe9d2('0x96'));return;}if(_0xbb5d98[_0xe9d2('0x97')]['role']!==_0xe9d2('0x98'))return;return _0xbb5d98[_0xe9d2('0x97')][_0xe9d2('0x99')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38f4dd){if(_['isEmpty'](_0x38f4dd)){_0x533ca7[_0xe9d2('0x45')](_0xe9d2('0x9a'));_0x1e3934[_0xe9d2('0x45')](_0xe9d2('0x9a'));}else{_0x533ca7[_0xe9d2('0x45')](_0xe9d2('0x78'),_[_0xe9d2('0x37')](_0x38f4dd,'id'));_0x1e3934['where'](_0xe9d2('0x78'),_[_0xe9d2('0x37')](_0x38f4dd,'id'));}});})[_0xe9d2('0x2b')](function(){if(_0xbb5d98[_0xe9d2('0x97')]['role']===_0xe9d2('0x98')&&!_0x1e837d&&!_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x77')])return[];return db[_0xe9d2('0x9b')][_0xe9d2('0x3c')](_0x533ca7[_0xe9d2('0x9c')](),_0x293ab2);})[_0xe9d2('0x2b')](function(_0x292fa8){_0x5089c0['count']=_0x292fa8[_0xe9d2('0x41')];if(_0x5089c0[_0xe9d2('0x25')]===0x0)return[];return db[_0xe9d2('0x9b')][_0xe9d2('0x3c')](_0x380c12[_0xe9d2('0x9c')](),_0x293ab2)[_0xe9d2('0x2b')](function(_0x5e457b){_0x3ecc56=_[_0xe9d2('0x9d')](_0x5e457b,'id');_0x293ab2=_['merge'](_0x293ab2,{'model':db[_0xe9d2('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x3f')]){_0xebb6d8[_0xe9d2('0x40')][_0xe9d2('0x33')](function(_0x18a453){_0x1e3934['field']('i.'+_0x18a453);});}else{_0x1e3934['field'](_0xe9d2('0x92'),_0xe9d2('0x5e'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0x9e'),_0xe9d2('0x9f'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xa0'),_0xe9d2('0xa1'));_0x1e3934[_0xe9d2('0x48')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xe9d2('0x93'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xa2'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xa3'),_0xe9d2('0xa4'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xa5'),_0xe9d2('0xa6'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xa7'),'Contact.email');_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xa8'),_0xe9d2('0xa9'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xaa'),_0xe9d2('0xab'));_0x1e3934[_0xe9d2('0x48')]('c.fax',_0xe9d2('0xac'));_0x1e3934['field']('o.fullname',_0xe9d2('0xad'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xae'),_0xe9d2('0xaf'));_0x1e3934[_0xe9d2('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xe9d2('0x31'));}if(_0xebb6d8[_0xe9d2('0x24')])_0x1e3934[_0xe9d2('0x24')](_0xebb6d8['limit']);if(_0xebb6d8[_0xe9d2('0x22')])_0x1e3934[_0xe9d2('0x22')](_0xebb6d8['offset']);return db[_0xe9d2('0x9b')][_0xe9d2('0x3c')](_0x1e3934['toString'](),_0x293ab2);})[_0xe9d2('0x2b')](function(_0x48a0bc){if(_0x48a0bc['length']>0x0)_0x2b8527['where'](_0xe9d2('0xb0'),_[_0xe9d2('0x37')](_0x48a0bc,'id'));return db[_0xe9d2('0x9b')][_0xe9d2('0x3c')](_0x2b8527[_0xe9d2('0x9c')](),_0x293ab2)['then'](function(_0x2186e8){var _0x2d2c0e=_[_0xe9d2('0xb1')](_0x2186e8,'SmsInteractionId');var _0x3355d3=[];_0x48a0bc[_0xe9d2('0x33')](function(_0x47f0de){_0x3355d3[_0xe9d2('0x35')](updateSmsInteraction(_0x47f0de,_0x3ecc56,_0x2d2c0e));});return BPromise[_0xe9d2('0xb2')](_0x3355d3);});});})['then'](function(_0x7b96ee){_0x5089c0['rows']=_0x7b96ee;return _0x5089c0;})[_0xe9d2('0x2b')](respondWithFilteredResult(_0x114fea,_0xebb6d8))[_0xe9d2('0xb3')](handleError(_0x114fea,null));};exports['show']=function(_0x148302,_0x3b6675){var _0x5d6033={'raw':![],'where':{'id':_0x148302[_0xe9d2('0xb4')]['id']}},_0x35e388={};_0x35e388['model']=_[_0xe9d2('0x73')](db[_0xe9d2('0x38')][_0xe9d2('0xb5')]);_0x35e388['query']=_[_0xe9d2('0x73')](_0x148302[_0xe9d2('0x3c')]);_0x35e388['filters']=_[_0xe9d2('0x3e')](_0x35e388['model'],_0x35e388[_0xe9d2('0x3c')]);_0x5d6033['attributes']=_[_0xe9d2('0x3e')](_0x35e388['model'],qs[_0xe9d2('0x3f')](_0x148302[_0xe9d2('0x3c')][_0xe9d2('0x3f')]));_0x5d6033[_0xe9d2('0x40')]=_0x5d6033['attributes']['length']?_0x5d6033[_0xe9d2('0x40')]:_0x35e388[_0xe9d2('0x3b')];if(_0x148302['query'][_0xe9d2('0xb6')]){_0x5d6033[_0xe9d2('0xb7')]=[{'all':!![]}];}_0x5d6033=_[_0xe9d2('0xb8')]({},_0x5d6033,_0x148302[_0xe9d2('0xb9')]);return db[_0xe9d2('0x38')][_0xe9d2('0x5d')](_0x5d6033)[_0xe9d2('0x2b')](handleEntityNotFound(_0x3b6675,null))[_0xe9d2('0x2b')](respondWithResult(_0x3b6675,null))[_0xe9d2('0xb3')](handleError(_0x3b6675,null));};exports['create']=function(_0xc72c5b,_0x200836){return db[_0xe9d2('0x38')][_0xe9d2('0xba')](_0xc72c5b[_0xe9d2('0x72')],{})['then'](respondWithResult(_0x200836,0xc9))[_0xe9d2('0xb3')](handleError(_0x200836,null));};exports[_0xe9d2('0xbb')]=function(_0xd9ea3,_0x21fd41){if(_0xd9ea3[_0xe9d2('0x72')]['id']){delete _0xd9ea3[_0xe9d2('0x72')]['id'];}return db['SmsInteraction'][_0xe9d2('0x5d')]({'where':{'id':_0xd9ea3['params']['id']}})[_0xe9d2('0x2b')](handleEntityNotFound(_0x21fd41,null))[_0xe9d2('0x2b')](saveUpdates(_0xd9ea3[_0xe9d2('0x72')],null))['then'](respondWithResult(_0x21fd41,null))[_0xe9d2('0xb3')](handleError(_0x21fd41,null));};exports[_0xe9d2('0x2c')]=function(_0x187e5f,_0x46537f){return db[_0xe9d2('0x38')][_0xe9d2('0x5d')]({'where':{'id':_0x187e5f[_0xe9d2('0xb4')]['id']}})['then'](handleEntityNotFound(_0x46537f,null))['then'](removeEntity(_0x46537f,null))[_0xe9d2('0xb3')](handleError(_0x46537f,null));};exports[_0xe9d2('0xbc')]=function(_0x1999e8,_0x2be7f5){return db[_0xe9d2('0x38')][_0xe9d2('0xbc')]()['then'](respondWithResult(_0x2be7f5,null))['catch'](handleError(_0x2be7f5,null));};exports[_0xe9d2('0xbd')]=function(_0x2f9f53,_0x530e92,_0x4a5490){return db[_0xe9d2('0xbe')][_0xe9d2('0x5d')]({'where':{'id':_0x2f9f53[_0xe9d2('0xb4')]['id']}})['then'](handleEntityNotFound(_0x530e92,null))['then'](function(_0x1da96e){if(_0x1da96e){return _0x1da96e[_0xe9d2('0xbd')](_0x2f9f53[_0xe9d2('0x72')][_0xe9d2('0xbf')],_[_0xe9d2('0xc0')](_0x2f9f53[_0xe9d2('0x72')],['ids','id'])||{});}})[_0xe9d2('0x2b')](respondWithResult(_0x530e92,null))[_0xe9d2('0xb3')](handleError(_0x530e92,null));};exports[_0xe9d2('0xc1')]=function(_0x5b186f,_0x587c23,_0x355a24){var _0x34c1dd={'raw':![],'where':{}};var _0x5a6a34={};var _0x5870bd={'count':0x0,'rows':[]};return db[_0xe9d2('0x38')][_0xe9d2('0xc2')]({'where':{'id':_0x5b186f[_0xe9d2('0xb4')]['id']}})['then'](handleEntityNotFound(_0x587c23,null))[_0xe9d2('0x2b')](function(_0x4b1462){if(_0x4b1462){_0x5a6a34[_0xe9d2('0x3b')]=_[_0xe9d2('0x73')](db[_0xe9d2('0xbe')][_0xe9d2('0xb5')]);_0x5a6a34[_0xe9d2('0x3c')]=_[_0xe9d2('0x73')](_0x5b186f[_0xe9d2('0x3c')]);_0x5a6a34[_0xe9d2('0x3d')]=_[_0xe9d2('0x3e')](_0x5a6a34[_0xe9d2('0x3b')],_0x5a6a34[_0xe9d2('0x3c')]);_0x34c1dd['attributes']=_[_0xe9d2('0x3e')](_0x5a6a34[_0xe9d2('0x3b')],qs['fields'](_0x5b186f[_0xe9d2('0x3c')][_0xe9d2('0x3f')]));_0x34c1dd['attributes']=_0x34c1dd[_0xe9d2('0x40')][_0xe9d2('0x41')]?_0x34c1dd[_0xe9d2('0x40')]:_0x5a6a34[_0xe9d2('0x3b')];if(!_0x5b186f[_0xe9d2('0x3c')]['hasOwnProperty'](_0xe9d2('0x42'))){_0x34c1dd[_0xe9d2('0x24')]=qs[_0xe9d2('0x24')](_0x5b186f[_0xe9d2('0x3c')][_0xe9d2('0x24')]);_0x34c1dd[_0xe9d2('0x22')]=qs[_0xe9d2('0x22')](_0x5b186f[_0xe9d2('0x3c')][_0xe9d2('0x22')]);}_0x34c1dd[_0xe9d2('0x43')]=qs['sort'](_0x5b186f[_0xe9d2('0x3c')]['sort']);_0x34c1dd['where']=qs['filters'](_[_0xe9d2('0x46')](_0x5b186f['query'],_0x5a6a34[_0xe9d2('0x3d')]));_0x34c1dd[_0xe9d2('0x45')][_0xe9d2('0xc3')]=_0x4b1462['id'];if(_0x5b186f['query']['filter']){_0x34c1dd[_0xe9d2('0x45')]=_[_0xe9d2('0xb8')](_0x34c1dd[_0xe9d2('0x45')],{'$or':_[_0xe9d2('0x37')](_0x34c1dd[_0xe9d2('0x40')],function(_0x316bc7){var _0x4020d6={};_0x4020d6[_0x316bc7]={'$like':'%'+_0x5b186f[_0xe9d2('0x3c')][_0xe9d2('0x86')]+'%'};return _0x4020d6;})});}if(_0x5b186f[_0xe9d2('0x3c')][_0xe9d2('0x7b')]){var _0x128eca=_0x5b186f[_0xe9d2('0x3c')]['$gte'][_0xe9d2('0x32')](',');var _0x27cf00={};_0x27cf00[_0x128eca[0x0]]={'$gte':moment(_0x128eca[0x1])['format'](_0xe9d2('0xc4'))};_0x34c1dd[_0xe9d2('0x45')]=_[_0xe9d2('0xb8')](_0x34c1dd['where'],_0x27cf00);}_0x34c1dd=_['merge']({},_0x34c1dd,_0x5b186f[_0xe9d2('0xb9')]);return db[_0xe9d2('0xbe')][_0xe9d2('0x25')]({'where':_0x34c1dd[_0xe9d2('0x45')]})[_0xe9d2('0x2b')](function(_0x34638b){_0x5870bd[_0xe9d2('0x25')]=_0x34638b;if(_0x5b186f[_0xe9d2('0x3c')]['includeAll']){_0x34c1dd[_0xe9d2('0xb7')]=[{'all':!![]}];}return db[_0xe9d2('0xbe')]['findAll'](_0x34c1dd);})[_0xe9d2('0x2b')](function(_0x5187df){_0x5870bd[_0xe9d2('0xc5')]=_0x5187df;return _0x5870bd;});}})['then'](respondWithFilteredResult(_0x587c23,_0x34c1dd))[_0xe9d2('0xb3')](handleError(_0x587c23,null));};exports[_0xe9d2('0xc6')]=function(_0x52da40,_0x56587b,_0x4f2adb){return db[_0xe9d2('0x38')][_0xe9d2('0x5d')]({'where':{'id':_0x52da40['params']['id']}})[_0xe9d2('0x2b')](handleEntityNotFound(_0x56587b,null))[_0xe9d2('0x2b')](function(_0x1c9b30){if(_0x1c9b30){return _0x1c9b30[_0xe9d2('0xc7')](_0x52da40[_0xe9d2('0x72')]['ids'],_[_0xe9d2('0xc0')](_0x52da40['body'],[_0xe9d2('0xbf'),'id'])||{})[_0xe9d2('0xc8')](function(){return db[_0xe9d2('0x6d')][_0xe9d2('0xc9')]({'attributes':['id',_0xe9d2('0x2e'),'color'],'where':{'id':_0x52da40[_0xe9d2('0x72')][_0xe9d2('0xbf')]}});})[_0xe9d2('0x2b')](function(_0x1d60f6){socket['emit'](_0xe9d2('0xca'),{'id':Number(_0x52da40[_0xe9d2('0xb4')]['id']),'tags':_0x1d60f6||[]});return{'id':Number(_0x52da40[_0xe9d2('0xb4')]['id']),'tags':_0x1d60f6||[]};});}})[_0xe9d2('0x2b')](respondWithResult(_0x56587b,null))[_0xe9d2('0xb3')](handleError(_0x56587b,null));};exports[_0xe9d2('0xcb')]=function(_0x219df4,_0x587cab,_0x2edba4){return db['SmsInteraction'][_0xe9d2('0x5d')]({'where':{'id':_0x219df4[_0xe9d2('0xb4')]['id']}})['then'](handleEntityNotFound(_0x587cab,null))[_0xe9d2('0x2b')](function(_0x57662b){if(_0x57662b){return _0x57662b[_0xe9d2('0xcb')](_0x219df4[_0xe9d2('0x3c')][_0xe9d2('0xbf')]);}})[_0xe9d2('0x2b')](respondWithStatusCode(_0x587cab,null))[_0xe9d2('0xb3')](handleError(_0x587cab,null));};exports[_0xe9d2('0xcc')]=function(_0x8e3279,_0x2ba0d4){var _0x52ead5=moment()[_0xe9d2('0xcd')]()[_0xe9d2('0x9c')]();var _0x413c87=path[_0xe9d2('0xce')](config[_0xe9d2('0xcf')],_0xe9d2('0xd0'),_0xe9d2('0xd1'),_0xe9d2('0xd2'));var _0x3f23e9=path['join'](config['root'],_0xe9d2('0xd0'),_0xe9d2('0xd1'),_0xe9d2('0xd3'));var _0x38524a=path[_0xe9d2('0xce')](_0x413c87,_0x52ead5);var _0x433ce8=util[_0xe9d2('0xd4')](_0xe9d2('0xd5'),_0x8e3279[_0xe9d2('0xb4')]['id'],_0x52ead5);var _0x208aa6=path[_0xe9d2('0xce')](_0x413c87,_0x433ce8);var _0x213a49=[];_0x213a49[_0xe9d2('0x35')]({'model':db[_0xe9d2('0x6f')],'as':_0xe9d2('0x6f'),'attributes':['id',_0xe9d2('0x30')],'raw':!![]});_0x213a49[_0xe9d2('0x35')]({'model':db[_0xe9d2('0xd6')],'as':_0xe9d2('0x63'),'attributes':['id',_0xe9d2('0xd7'),_0xe9d2('0xd8')],'raw':!![]});var _0x1d6e3f=[{'model':db[_0xe9d2('0xbe')],'as':_0xe9d2('0xd9'),'attributes':['id',_0xe9d2('0x72'),_0xe9d2('0xda'),'direction','secret',_0xe9d2('0x81')],'include':_0x213a49}];_0x1d6e3f['push']({'model':db[_0xe9d2('0xdb')],'as':_0xe9d2('0xdc'),'attributes':['id','name']});_0x1d6e3f['push']({'model':db['User'],'as':_0xe9d2('0xdd'),'attributes':['id','fullname']});return db[_0xe9d2('0x38')]['find']({'where':{'id':_0x8e3279[_0xe9d2('0xb4')]['id']},'include':_0x1d6e3f})[_0xe9d2('0x2b')](handleEntityNotFound(_0x2ba0d4,null))[_0xe9d2('0x2b')](function(_0x19add8){if(_0x19add8){var _0x58e1ad=_0x19add8[_0xe9d2('0xde')]({'plain':!![]});fs['mkdirSync'](_0x38524a);var _0x4fdcb6={'channel':_0xe9d2('0xdf'),'account':_0x58e1ad['Account']['name'],'agent':_0x58e1ad['Owner']?_0x58e1ad['Owner']['fullname']:_0xe9d2('0xe0'),'createdAt':moment(_0x58e1ad['createdAt'])[_0xe9d2('0xd4')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe9d2('0x9c')](),'closedAt':_0x58e1ad[_0xe9d2('0xe1')]?moment(_0x58e1ad[_0xe9d2('0xe2')])[_0xe9d2('0xd4')](_0xe9d2('0xc4'))[_0xe9d2('0x9c')]():'','disposition':_0x58e1ad[_0xe9d2('0xe3')],'messages':_(_0x58e1ad[_0xe9d2('0xd9')])[_0xe9d2('0x86')]({'secret':![]})[_0xe9d2('0x37')](function(_0x3764cb){return{'date':moment(_0x3764cb[_0xe9d2('0xda')])[_0xe9d2('0xd4')](_0xe9d2('0xc4'))['toString'](),'sender':_0x3764cb[_0xe9d2('0xe4')]==='out'?_0x3764cb[_0xe9d2('0x6f')]?_0x3764cb[_0xe9d2('0x6f')][_0xe9d2('0x30')]:'System':_0x3764cb[_0xe9d2('0x63')]['firstName']+(_0x3764cb[_0xe9d2('0x63')][_0xe9d2('0xd8')]?'\x20'+_0x3764cb[_0xe9d2('0x63')][_0xe9d2('0xd8')]:''),'body':_0x3764cb['body'],'direction':_0x3764cb['direction']==='out'?'A':'C','secret':_0x3764cb['secret'],'read':_0x3764cb[_0xe9d2('0x81')]};})[_0xe9d2('0x5f')]()};return ejs[_0xe9d2('0xe5')](path['join'](config[_0xe9d2('0xcf')],_0xe9d2('0xd0'),_0xe9d2('0xe6'),_0xe9d2('0xe7')),{'interaction':_0x4fdcb6})[_0xe9d2('0x2b')](function(_0x1e213b){var _0x47fb02=path['join'](_0x38524a,_0xe9d2('0xe8')+_0x58e1ad['id']+'-'+_0x52ead5+_0xe9d2('0xe9'));var _0x140ae4={'path':_0x47fb02,'channel':_0xe9d2('0xdf'),'interactionId':_0x58e1ad['id']};return pdf[_0xe9d2('0xea')](_0x1e213b,_0x140ae4);})['then'](function(){return new BPromise(function(_0x33535f,_0x3c653d){zipdir(_0x38524a,{'saveTo':_0x208aa6},function(_0x5edbda,_0x3f31ab){if(_0x5edbda)return _0x3c653d(_0x5edbda);return _0x33535f(_0x3f31ab);});})[_0xe9d2('0x2b')](function(){return new BPromise(function(_0x44b09a,_0x24b436){rimraf(_0x38524a,function(_0x49f97c){if(_0x49f97c)_0x24b436(_0x49f97c);return _0x44b09a();});});})[_0xe9d2('0x2b')](function(){return _0x2ba0d4[_0xe9d2('0xcc')](_0x208aa6,_0x433ce8,function(_0x5eb6e5){if(_0x5eb6e5){console['log'](_0xe9d2('0xeb'),_0x5eb6e5);}else{fs[_0xe9d2('0xec')](_0x208aa6);}});});});}else{return _0x2ba0d4[_0xe9d2('0x1f')](0xc8);}})[_0xe9d2('0xb3')](handleError(_0x2ba0d4,null));};
\ No newline at end of file
+var _0x609a=['create','describe','ids','omit','findOne','SmsMessage','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','removeTags','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Messages','secret','SmsAccount','Account','Owner','get','N.A.','closed','closedAt','disposition','direction','out','System','renderFile','downloadInteraction.ejs','.pdf','Sms','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','apply','reject','update','destroy','error','stack','name','send','map','fullname','Tags','TagIds','split','forEach','push','then','index','SmsInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','select','field','color','from','tools_tags','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','UserId','body','compact','i.SmsAccountId\x20IN\x20?','concat','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','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','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','isEmpty','i.SmsAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','show','params','rawAttributes','includeAll','include','options','catch'];(function(_0x483529,_0x4c6a70){var _0x124618=function(_0x140a97){while(--_0x140a97){_0x483529['push'](_0x483529['shift']());}};_0x124618(++_0x4c6a70);}(_0x609a,0x11c));var _0xa609=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x609a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xa609('0x0'));var rimraf=require(_0xa609('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa609('0x2'));var rp=require(_0xa609('0x3'));var moment=require('moment');var BPromise=require(_0xa609('0x4'));var Mustache=require(_0xa609('0x5'));var util=require(_0xa609('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa609('0x7'));var ejs=require(_0xa609('0x8'));var fs=require('fs');var fs_extra=require(_0xa609('0x9'));var _=require(_0xa609('0xa'));var squel=require(_0xa609('0xb'));var crypto=require(_0xa609('0xc'));var jsforce=require(_0xa609('0xd'));var deskjs=require(_0xa609('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa609('0xf'));var Papa=require(_0xa609('0x10'));var Redis=require(_0xa609('0x11'));var authService=require(_0xa609('0x12'));var qs=require(_0xa609('0x13'));var as=require(_0xa609('0x14'));var pdf=require(_0xa609('0x15'));var hardwareService=require(_0xa609('0x16'));var logger=require(_0xa609('0x17'))(_0xa609('0x18'));var utils=require(_0xa609('0x19'));var config=require(_0xa609('0x1a'));var licenseUtil=require(_0xa609('0x1b'));var db=require(_0xa609('0x1c'))['db'];config[_0xa609('0x1d')]=_[_0xa609('0x1e')](config[_0xa609('0x1d')],{'host':_0xa609('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa609('0x1d')]));require(_0xa609('0x20'))[_0xa609('0x21')](socket);function respondWithStatusCode(_0x19d179,_0x4899ee){_0x4899ee=_0x4899ee||0xcc;return function(_0x928cdc){if(_0x928cdc){return _0x19d179[_0xa609('0x22')](_0x4899ee);}return _0x19d179[_0xa609('0x23')](_0x4899ee)[_0xa609('0x24')]();};}function respondWithResult(_0x3b41b3,_0x561be7){_0x561be7=_0x561be7||0xc8;return function(_0x4c45ad){if(_0x4c45ad){return _0x3b41b3[_0xa609('0x23')](_0x561be7)[_0xa609('0x25')](_0x4c45ad);}};}function respondWithFilteredResult(_0xb6c9fa,_0x7406b0){return function(_0x52064e){if(_0x52064e){var _0x32eb1e=typeof _0x7406b0[_0xa609('0x26')]===_0xa609('0x27')&&typeof _0x7406b0['limit']==='undefined';var _0x22f233=_0x52064e[_0xa609('0x28')];var _0x2c4bb7=_0x32eb1e?0x0:_0x7406b0[_0xa609('0x26')];var _0x28515c=_0x32eb1e?_0x52064e[_0xa609('0x28')]:_0x7406b0[_0xa609('0x26')]+_0x7406b0['limit'];var _0x486f2b;if(_0x28515c>=_0x22f233){_0x28515c=_0x22f233;_0x486f2b=0xc8;}else{_0x486f2b=0xce;}_0xb6c9fa[_0xa609('0x23')](_0x486f2b);return _0xb6c9fa['set']('Content-Range',_0x2c4bb7+'-'+_0x28515c+'/'+_0x22f233)['json'](_0x52064e);}return null;};}function patchUpdates(_0x20d24f){return function(_0x369f3b){try{jsonpatch[_0xa609('0x29')](_0x369f3b,_0x20d24f,!![]);}catch(_0x4223cf){return BPromise[_0xa609('0x2a')](_0x4223cf);}return _0x369f3b['save']();};}function saveUpdates(_0x49a22d,_0x475237){return function(_0x4eefce){if(_0x4eefce){return _0x4eefce[_0xa609('0x2b')](_0x49a22d)['then'](function(_0x4e1753){return _0x4e1753;});}return null;};}function removeEntity(_0x1e455c,_0x4dbc8b){return function(_0x3ad791){if(_0x3ad791){return _0x3ad791[_0xa609('0x2c')]()['then'](function(){_0x1e455c['status'](0xcc)[_0xa609('0x24')]();});}};}function handleEntityNotFound(_0x21adf4,_0x1b0db3){return function(_0x4ea7f2){if(!_0x4ea7f2){_0x21adf4[_0xa609('0x22')](0x194);}return _0x4ea7f2;};}function handleError(_0x24ebff,_0x187da6){_0x187da6=_0x187da6||0x1f4;return function(_0xf01172){logger[_0xa609('0x2d')](_0xf01172[_0xa609('0x2e')]);if(_0xf01172[_0xa609('0x2f')]){delete _0xf01172[_0xa609('0x2f')];}_0x24ebff[_0xa609('0x23')](_0x187da6)[_0xa609('0x30')](_0xf01172);};}function getInteractionUsers(_0x21450a,_0x4a745b){return new BPromise(function(_0x5e2640,_0x44dd25){try{if(_0x4a745b[_0x21450a['id']]){_0x21450a['Users']=_[_0xa609('0x31')](_0x4a745b[_0x21450a['id']],function(_0x5efb48){return{'id':_0x5efb48['id'],'fullname':_0x5efb48[_0xa609('0x32')]};});}}catch(_0x3780ec){_0x44dd25(_0x3780ec);}_0x5e2640(_0x21450a);});}function getInteractionTags(_0x263550,_0x1141c5){return new BPromise(function(_0x5938d8,_0x5d43f0){try{if(_0x263550['TagIds']){_0x263550[_0xa609('0x33')]=[];_0x263550[_0xa609('0x34')][_0xa609('0x35')](',')[_0xa609('0x36')](function(_0x11bed2){_0x263550[_0xa609('0x33')][_0xa609('0x37')](_0x1141c5[_0x11bed2]);});}delete _0x263550[_0xa609('0x34')];}catch(_0x208be1){_0x5d43f0(_0x208be1);}_0x5938d8(_0x263550);});}function updateSmsInteraction(_0x1fe25c,_0x4db2ed,_0x5a34aa){return new BPromise(function(_0x5eb51f,_0x17a77e){return getInteractionUsers(_0x1fe25c,_0x5a34aa)[_0xa609('0x38')](function(_0x469881){return getInteractionTags(_0x469881,_0x4db2ed);})[_0xa609('0x38')](function(_0x6f9bf7){_0x5eb51f(_0x6f9bf7);})['catch'](function(_0x1c5bb6){_0x17a77e(_0x1c5bb6);});});}exports[_0xa609('0x39')]=function(_0x1a59c4,_0x468dbd){var _0x5ea709={},_0x325414={},_0x2a3b4f={'count':0x0,'rows':[]};var _0x1af3b5=_[_0xa609('0x31')](db[_0xa609('0x3a')]['rawAttributes'],function(_0x370f88){return{'name':_0x370f88[_0xa609('0x3b')],'type':_0x370f88[_0xa609('0x3c')][_0xa609('0x3d')]};});_0x325414[_0xa609('0x3e')]=_[_0xa609('0x31')](_0x1af3b5,_0xa609('0x2f'));_0x325414[_0xa609('0x3f')]=_[_0xa609('0x40')](_0x1a59c4[_0xa609('0x3f')]);_0x325414[_0xa609('0x41')]=_[_0xa609('0x42')](_0x325414[_0xa609('0x3e')],_0x325414[_0xa609('0x3f')]);_0x5ea709[_0xa609('0x43')]=_[_0xa609('0x42')](_0x325414[_0xa609('0x3e')],qs[_0xa609('0x44')](_0x1a59c4[_0xa609('0x3f')][_0xa609('0x44')]));_0x5ea709['attributes']=_0x5ea709[_0xa609('0x43')][_0xa609('0x45')]?_0x5ea709[_0xa609('0x43')]:_0x325414[_0xa609('0x3e')];if(!_0x1a59c4['query'][_0xa609('0x46')](_0xa609('0x47'))){_0x5ea709[_0xa609('0x48')]=qs[_0xa609('0x48')](_0x1a59c4[_0xa609('0x3f')][_0xa609('0x48')]);_0x5ea709[_0xa609('0x26')]=qs['offset'](_0x1a59c4[_0xa609('0x3f')][_0xa609('0x26')]);}_0x5ea709[_0xa609('0x49')]=qs['sort'](_0x1a59c4['query'][_0xa609('0x4a')]);_0x5ea709[_0xa609('0x4b')]=qs['filters'](_['pick'](_0x1a59c4[_0xa609('0x3f')],_0x325414[_0xa609('0x41')]),_0x1af3b5);var _0x351c0a=[];var _0x3b0d76=squel[_0xa609('0x4c')]()[_0xa609('0x4d')]('id')[_0xa609('0x4d')](_0xa609('0x2f'))[_0xa609('0x4d')](_0xa609('0x4e'))[_0xa609('0x4f')](_0xa609('0x50'));var _0x3003ba=squel[_0xa609('0x4c')]()[_0xa609('0x4d')]('u.id')[_0xa609('0x4d')](_0xa609('0x51'))[_0xa609('0x4d')](_0xa609('0x52'))[_0xa609('0x4f')](_0xa609('0x53'),'ui')[_0xa609('0x54')](_0xa609('0x55'),'u',_0xa609('0x56'));var _0x99f42d=squel[_0xa609('0x4c')]()[_0xa609('0x4f')](_0xa609('0x57'),'i')[_0xa609('0x54')]('cm_contacts','c',_0xa609('0x58'))[_0xa609('0x54')]('users','o',_0xa609('0x59'))[_0xa609('0x54')](_0xa609('0x5a'),'a',_0xa609('0x5b'))[_0xa609('0x54')](_0xa609('0x5c'),'me',_0xa609('0x5d'))[_0xa609('0x54')](_0xa609('0x5e'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xa609('0x54')](_0xa609('0x50'),'t',_0xa609('0x5f'));var _0x24d327=squel[_0xa609('0x60')]();var _0x4a4d38=[];var _0x34b339=squel[_0xa609('0x60')]();var _0x2223cf;if(_0x1a59c4[_0xa609('0x3f')][_0xa609('0x61')]){_0x2223cf=as[_0xa609('0x62')](_0x1a59c4[_0xa609('0x3f')][_0xa609('0x61')]);var _0x2c7cbe=_0x2223cf[_0xa609('0x63')];for(var _0x49ea31=0x0;_0x49ea31<_0x2223cf[_0xa609('0x64')][_0xa609('0x45')];_0x49ea31++){var _0x4e9411=_0x2223cf[_0xa609('0x64')][_0x49ea31];var _0x3f3ede='i';var _0x132689=_['find'](_0x1af3b5,[_0xa609('0x2f'),_0x4e9411[_0xa609('0x4d')]]);if(!_0x132689){switch(_0x4e9411[_0xa609('0x4d')]){case'unreadMessages':if(_0x4e9411[_0xa609('0x65')]==0x1){_0x99f42d['having']('`'+_0x4e9411[_0xa609('0x4d')]+_0xa609('0x66'));}else{_0x99f42d[_0xa609('0x67')]('`'+_0x4e9411[_0xa609('0x4d')]+_0xa609('0x68'));}break;case _0xa609('0x69'):if(_0x4e9411[_0xa609('0x6a')]===_0xa609('0x6b')){if(_0x4e9411['value'][_0xa609('0x35')]('\x20')[_0xa609('0x45')]>0x1){_0x24d327[_0x2c7cbe]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa609('0x6c')](_0x4e9411[_0xa609('0x65')]),null);}else{var _0x387ec1='%'+_0x4e9411[_0xa609('0x65')]+'%';_0x24d327[_0x2c7cbe](_0xa609('0x6d'),_0x387ec1,_0x387ec1,_0x387ec1);}}else{_0x132689=_[_0xa609('0x6e')](_0x1af3b5,[_0xa609('0x2f'),'ContactId']);_0x4e9411[_0xa609('0x4d')]=_0xa609('0x6f');_0x51b37e=as[_0xa609('0x70')](_0x3f3ede,_0x132689[_0xa609('0x3c')],_0x4e9411);_0x24d327[_0x2c7cbe](_0x51b37e[_0xa609('0x71')],_0x51b37e['value'][_0xa609('0x72')],_0x51b37e[_0xa609('0x65')]['end']);}break;case _0xa609('0x73'):var _0x307a58=_0x4e9411[_0xa609('0x65')]['split'](',')[_0xa609('0x31')](function(_0x167cd2){return Number(_0x167cd2);});_0x307a58[_0xa609('0x36')](function(_0x2a26c2){_0x34b339['or'](_0xa609('0x74'),'%,'+_0x2a26c2+',%');});_0x4a4d38=_['union'](_0x4a4d38,_0x307a58);break;case'User':if(_0x4e9411['operator']==='$substring'){_0x24d327[_0x2c7cbe]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4e9411['value']+'%',null);}else{_0x132689=_[_0xa609('0x6e')](_0x1af3b5,['name',_0xa609('0x75')]);_0x4e9411[_0xa609('0x4d')]=_0xa609('0x75');_0x51b37e=as['buildExpression'](_0x3f3ede,_0x132689[_0xa609('0x3c')],_0x4e9411);_0x24d327[_0x2c7cbe](_0x51b37e[_0xa609('0x71')],_0x51b37e[_0xa609('0x65')][_0xa609('0x72')],_0x51b37e['value'][_0xa609('0x24')]);}break;case _0xa609('0x76'):_0x51b37e=as[_0xa609('0x70')]('me',null,_0x4e9411);_0x24d327[_0x2c7cbe](_0x51b37e[_0xa609('0x71')],_0x51b37e['value']['start'],_0x51b37e[_0xa609('0x65')][_0xa609('0x24')]);break;}}else{var _0x51b37e=as[_0xa609('0x70')](_0x3f3ede,_0x132689['type'],_0x4e9411);_0x24d327[_0x2c7cbe](_0x51b37e[_0xa609('0x71')],_0x51b37e[_0xa609('0x65')][_0xa609('0x72')],_0x51b37e[_0xa609('0x65')]['end']);}}}else{var _0x3625ce=_(_0x1a59c4[_0xa609('0x3f')])['keys']()['map'](function(_0xe3baa1){return _['some'](_0x1af3b5,[_0xa609('0x2f'),_0xe3baa1])?_0xe3baa1:undefined;})[_0xa609('0x77')]()[_0xa609('0x65')]();if(!_['isEmpty'](_0x3625ce)){_0x3625ce[_0xa609('0x36')](function(_0x222d05){if(_0x222d05==='SmsAccountId'){_0x99f42d[_0xa609('0x4b')](_0xa609('0x78'),[][_0xa609('0x79')](_0x1a59c4[_0xa609('0x3f')][_0x222d05]));}else if(_0x222d05===_0xa609('0x7a')){var _0x473596=JSON[_0xa609('0x7b')](_0x1a59c4[_0xa609('0x3f')][_0x222d05])[_0xa609('0x7c')];var _0x2f18d6=JSON['parse'](_0x1a59c4[_0xa609('0x3f')][_0x222d05])[_0xa609('0x7d')];_0x99f42d['where'](_0xa609('0x7e'),_0x473596,_0x2f18d6);}else{if(_0x1a59c4[_0xa609('0x3f')][_0x222d05]===_0xa609('0x7f')){_0x99f42d[_0xa609('0x4b')]('i.'+_0x222d05+_0xa609('0x80'));}else{_0x99f42d['where']('i.'+_0x222d05+_0xa609('0x81'),_0x1a59c4[_0xa609('0x3f')][_0x222d05]);}}});}if(_0x1a59c4['query'][_0xa609('0x82')]){if(_0x1a59c4[_0xa609('0x3f')]['read']==0x1){_0x99f42d[_0xa609('0x67')](_0xa609('0x83'));}else{_0x99f42d[_0xa609('0x67')](_0xa609('0x84'));}}if(_0x1a59c4[_0xa609('0x3f')][_0xa609('0x85')]){_0x4a4d38=_[_0xa609('0x86')](_0x1a59c4[_0xa609('0x3f')][_0xa609('0x85')])?_0x1a59c4[_0xa609('0x3f')][_0xa609('0x85')]:new Array(_0x1a59c4[_0xa609('0x3f')][_0xa609('0x85')]);_0x4a4d38[_0xa609('0x36')](function(_0x985954){_0x34b339['or'](_0xa609('0x74'),'%,'+_0x985954+',%');});}if(_0x1a59c4[_0xa609('0x3f')][_0xa609('0x87')]){var _0x59e62b=_0x1a59c4['query'][_0xa609('0x87')][_0xa609('0x88')]('\x5c','\x5c\x5c')[_0xa609('0x88')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x59e62b)){_0x24d327['or'](_0xa609('0x89'),_0x59e62b+'%')['or'](_0xa609('0x8a'),_0x59e62b+'%');}else{_0x24d327['or'](_0xa609('0x8b'),qs[_0xa609('0x6c')](_0x59e62b))['or'](_0xa609('0x8c'),_0x59e62b+'%');}}}_0x99f42d['where'](_0x24d327);_0x99f42d[_0xa609('0x8d')](_0xa609('0x8e'));var _0x3c1505={'type':db[_0xa609('0x8f')]['QueryTypes']['SELECT'],'raw':!![]};var _0x41457f=_0x99f42d[_0xa609('0x90')]();_0x41457f[_0xa609('0x4d')](_0xa609('0x8e'));_0x41457f['field'](_0xa609('0x91'),_0xa609('0x92'));if(_0x5ea709['order']){_0x5ea709[_0xa609('0x49')][_0xa609('0x36')](function(_0x26e356){var _0x58ea79=_0x26e356[0x0]===_0xa609('0x93')?_0x26e356[0x0]:'i.'+_0x26e356[0x0];_0x99f42d[_0xa609('0x49')](_0x58ea79,_0x26e356[0x1]===_0xa609('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x4a4d38)){_0x99f42d['having'](_0x34b339);_0x41457f[_0xa609('0x4b')](_0xa609('0x95'),_0x4a4d38);}BPromise[_0xa609('0x96')]()['then'](function(){if(!_0x2223cf){if(_0x1a59c4[_0xa609('0x3f')][_0xa609('0x97')])return;_0x41457f[_0xa609('0x4b')](_0xa609('0x98'));_0x99f42d[_0xa609('0x4b')](_0xa609('0x98'));return;}if(_0x1a59c4[_0xa609('0x99')][_0xa609('0x9a')]!==_0xa609('0x9b'))return;return _0x1a59c4[_0xa609('0x99')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0xa609('0x38')](function(_0x5aa52c){if(_[_0xa609('0x9c')](_0x5aa52c)){_0x41457f[_0xa609('0x4b')](_0xa609('0x9d'));_0x99f42d[_0xa609('0x4b')](_0xa609('0x9d'));}else{_0x41457f[_0xa609('0x4b')](_0xa609('0x78'),_[_0xa609('0x31')](_0x5aa52c,'id'));_0x99f42d[_0xa609('0x4b')]('i.SmsAccountId\x20IN\x20?',_[_0xa609('0x31')](_0x5aa52c,'id'));}});})['then'](function(){if(_0x1a59c4[_0xa609('0x99')][_0xa609('0x9a')]===_0xa609('0x9b')&&!_0x2223cf&&!_0x1a59c4[_0xa609('0x3f')][_0xa609('0x97')])return[];return db['sequelize']['query'](_0x41457f[_0xa609('0x9e')](),_0x3c1505);})['then'](function(_0x422973){_0x2a3b4f['count']=_0x422973[_0xa609('0x45')];if(_0x2a3b4f[_0xa609('0x28')]===0x0)return[];return db[_0xa609('0x9f')][_0xa609('0x3f')](_0x3b0d76['toString'](),_0x3c1505)[_0xa609('0x38')](function(_0x301576){_0x351c0a=_[_0xa609('0xa0')](_0x301576,'id');_0x3c1505=_[_0xa609('0xa1')](_0x3c1505,{'model':db[_0xa609('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1a59c4[_0xa609('0x3f')][_0xa609('0x44')]){_0x5ea709[_0xa609('0x43')]['forEach'](function(_0x204df0){_0x99f42d[_0xa609('0x4d')]('i.'+_0x204df0);});}else{_0x99f42d['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa609('0x92'));_0x99f42d['field']('a.key',_0xa609('0xa2'));_0x99f42d[_0xa609('0x4d')](_0xa609('0xa3'),_0xa609('0xa4'));_0x99f42d['field'](_0xa609('0xa5'),'contactName');_0x99f42d[_0xa609('0x4d')](_0xa609('0xa6'));_0x99f42d['field'](_0xa609('0xa7'),_0xa609('0xa8'));_0x99f42d[_0xa609('0x4d')]('c.lastName',_0xa609('0xa9'));_0x99f42d[_0xa609('0x4d')]('c.email',_0xa609('0xaa'));_0x99f42d[_0xa609('0x4d')]('c.phone',_0xa609('0xab'));_0x99f42d['field'](_0xa609('0xac'),_0xa609('0xad'));_0x99f42d['field'](_0xa609('0xae'),_0xa609('0xaf'));_0x99f42d[_0xa609('0x4d')]('o.fullname','Owner.fullname');_0x99f42d[_0xa609('0x4d')]('o.internal','Owner.internal');_0x99f42d[_0xa609('0x4d')](_0xa609('0xb0'),'TagIds');}if(_0x5ea709['limit'])_0x99f42d['limit'](_0x5ea709[_0xa609('0x48')]);if(_0x5ea709[_0xa609('0x26')])_0x99f42d['offset'](_0x5ea709[_0xa609('0x26')]);return db[_0xa609('0x9f')]['query'](_0x99f42d['toString'](),_0x3c1505);})[_0xa609('0x38')](function(_0x498878){if(_0x498878[_0xa609('0x45')]>0x0)_0x3003ba[_0xa609('0x4b')](_0xa609('0xb1'),_[_0xa609('0x31')](_0x498878,'id'));return db[_0xa609('0x9f')]['query'](_0x3003ba[_0xa609('0x9e')](),_0x3c1505)['then'](function(_0x37ec18){var _0x5b6868=_[_0xa609('0xb2')](_0x37ec18,_0xa609('0xb3'));var _0x47f7cc=[];_0x498878[_0xa609('0x36')](function(_0x2d7e2c){_0x47f7cc[_0xa609('0x37')](updateSmsInteraction(_0x2d7e2c,_0x351c0a,_0x5b6868));});return BPromise['all'](_0x47f7cc);});});})['then'](function(_0x3b1599){_0x2a3b4f[_0xa609('0xb4')]=_0x3b1599;return _0x2a3b4f;})[_0xa609('0x38')](respondWithFilteredResult(_0x468dbd,_0x5ea709))['catch'](handleError(_0x468dbd,null));};exports[_0xa609('0xb5')]=function(_0x599aa6,_0x76706d){var _0x1d8d01={'raw':![],'where':{'id':_0x599aa6[_0xa609('0xb6')]['id']}},_0xd925cd={};_0xd925cd[_0xa609('0x3e')]=_[_0xa609('0x40')](db[_0xa609('0x3a')][_0xa609('0xb7')]);_0xd925cd[_0xa609('0x3f')]=_[_0xa609('0x40')](_0x599aa6[_0xa609('0x3f')]);_0xd925cd[_0xa609('0x41')]=_[_0xa609('0x42')](_0xd925cd['model'],_0xd925cd[_0xa609('0x3f')]);_0x1d8d01['attributes']=_['intersection'](_0xd925cd[_0xa609('0x3e')],qs[_0xa609('0x44')](_0x599aa6[_0xa609('0x3f')]['fields']));_0x1d8d01[_0xa609('0x43')]=_0x1d8d01[_0xa609('0x43')][_0xa609('0x45')]?_0x1d8d01[_0xa609('0x43')]:_0xd925cd[_0xa609('0x3e')];if(_0x599aa6[_0xa609('0x3f')][_0xa609('0xb8')]){_0x1d8d01[_0xa609('0xb9')]=[{'all':!![]}];}_0x1d8d01=_[_0xa609('0xa1')]({},_0x1d8d01,_0x599aa6[_0xa609('0xba')]);return db[_0xa609('0x3a')]['find'](_0x1d8d01)[_0xa609('0x38')](handleEntityNotFound(_0x76706d,null))['then'](respondWithResult(_0x76706d,null))[_0xa609('0xbb')](handleError(_0x76706d,null));};exports['create']=function(_0x2c0174,_0x431693){return db[_0xa609('0x3a')][_0xa609('0xbc')](_0x2c0174[_0xa609('0x76')],{})[_0xa609('0x38')](respondWithResult(_0x431693,0xc9))[_0xa609('0xbb')](handleError(_0x431693,null));};exports[_0xa609('0x2b')]=function(_0xd6531b,_0x5f3ebe){if(_0xd6531b[_0xa609('0x76')]['id']){delete _0xd6531b[_0xa609('0x76')]['id'];}return db[_0xa609('0x3a')][_0xa609('0x6e')]({'where':{'id':_0xd6531b[_0xa609('0xb6')]['id']}})[_0xa609('0x38')](handleEntityNotFound(_0x5f3ebe,null))[_0xa609('0x38')](saveUpdates(_0xd6531b[_0xa609('0x76')],null))[_0xa609('0x38')](respondWithResult(_0x5f3ebe,null))[_0xa609('0xbb')](handleError(_0x5f3ebe,null));};exports[_0xa609('0x2c')]=function(_0x35b1a0,_0x62eefd){return db[_0xa609('0x3a')][_0xa609('0x6e')]({'where':{'id':_0x35b1a0[_0xa609('0xb6')]['id']}})[_0xa609('0x38')](handleEntityNotFound(_0x62eefd,null))[_0xa609('0x38')](removeEntity(_0x62eefd,null))[_0xa609('0xbb')](handleError(_0x62eefd,null));};exports[_0xa609('0xbd')]=function(_0x5401e7,_0x1e6128){return db['SmsInteraction'][_0xa609('0xbd')]()[_0xa609('0x38')](respondWithResult(_0x1e6128,null))['catch'](handleError(_0x1e6128,null));};exports['addMessage']=function(_0x237573,_0x429a56,_0x301281){return db['SmsMessage'][_0xa609('0x6e')]({'where':{'id':_0x237573[_0xa609('0xb6')]['id']}})['then'](handleEntityNotFound(_0x429a56,null))['then'](function(_0x2e9521){if(_0x2e9521){return _0x2e9521['addMessage'](_0x237573[_0xa609('0x76')][_0xa609('0xbe')],_[_0xa609('0xbf')](_0x237573[_0xa609('0x76')],['ids','id'])||{});}})['then'](respondWithResult(_0x429a56,null))[_0xa609('0xbb')](handleError(_0x429a56,null));};exports['getMessages']=function(_0x2895e7,_0x115d07,_0x416c05){var _0x290b0a={'raw':![],'where':{}};var _0x1ac4e1={};var _0x198e7e={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xa609('0xc0')]({'where':{'id':_0x2895e7[_0xa609('0xb6')]['id']}})[_0xa609('0x38')](handleEntityNotFound(_0x115d07,null))[_0xa609('0x38')](function(_0x1b7635){if(_0x1b7635){_0x1ac4e1[_0xa609('0x3e')]=_['keys'](db[_0xa609('0xc1')][_0xa609('0xb7')]);_0x1ac4e1[_0xa609('0x3f')]=_[_0xa609('0x40')](_0x2895e7['query']);_0x1ac4e1[_0xa609('0x41')]=_[_0xa609('0x42')](_0x1ac4e1[_0xa609('0x3e')],_0x1ac4e1['query']);_0x290b0a[_0xa609('0x43')]=_['intersection'](_0x1ac4e1['model'],qs[_0xa609('0x44')](_0x2895e7[_0xa609('0x3f')][_0xa609('0x44')]));_0x290b0a['attributes']=_0x290b0a['attributes']['length']?_0x290b0a[_0xa609('0x43')]:_0x1ac4e1[_0xa609('0x3e')];if(!_0x2895e7[_0xa609('0x3f')][_0xa609('0x46')](_0xa609('0x47'))){_0x290b0a[_0xa609('0x48')]=qs[_0xa609('0x48')](_0x2895e7[_0xa609('0x3f')][_0xa609('0x48')]);_0x290b0a['offset']=qs[_0xa609('0x26')](_0x2895e7[_0xa609('0x3f')][_0xa609('0x26')]);}_0x290b0a[_0xa609('0x49')]=qs[_0xa609('0x4a')](_0x2895e7['query']['sort']);_0x290b0a[_0xa609('0x4b')]=qs[_0xa609('0x41')](_[_0xa609('0xc2')](_0x2895e7[_0xa609('0x3f')],_0x1ac4e1['filters']));_0x290b0a[_0xa609('0x4b')][_0xa609('0xb3')]=_0x1b7635['id'];if(_0x2895e7[_0xa609('0x3f')][_0xa609('0x87')]){_0x290b0a['where']=_[_0xa609('0xa1')](_0x290b0a[_0xa609('0x4b')],{'$or':_[_0xa609('0x31')](_0x290b0a[_0xa609('0x43')],function(_0x4c83be){var _0x4f99c7={};_0x4f99c7[_0x4c83be]={'$like':'%'+_0x2895e7[_0xa609('0x3f')][_0xa609('0x87')]+'%'};return _0x4f99c7;})});}if(_0x2895e7['query']['$gte']){var _0x58a5fc=_0x2895e7['query'][_0xa609('0x7c')]['split'](',');var _0x476fd3={};_0x476fd3[_0x58a5fc[0x0]]={'$gte':moment(_0x58a5fc[0x1])['format'](_0xa609('0xc3'))};_0x290b0a['where']=_[_0xa609('0xa1')](_0x290b0a[_0xa609('0x4b')],_0x476fd3);}_0x290b0a=_[_0xa609('0xa1')]({},_0x290b0a,_0x2895e7[_0xa609('0xba')]);return db[_0xa609('0xc1')][_0xa609('0x28')]({'where':_0x290b0a[_0xa609('0x4b')]})['then'](function(_0x2aa74e){_0x198e7e[_0xa609('0x28')]=_0x2aa74e;if(_0x2895e7[_0xa609('0x3f')][_0xa609('0xb8')]){_0x290b0a['include']=[{'all':!![]}];}return db[_0xa609('0xc1')][_0xa609('0xc4')](_0x290b0a);})['then'](function(_0x243d47){_0x198e7e[_0xa609('0xb4')]=_0x243d47;return _0x198e7e;});}})[_0xa609('0x38')](respondWithFilteredResult(_0x115d07,_0x290b0a))[_0xa609('0xbb')](handleError(_0x115d07,null));};exports[_0xa609('0xc5')]=function(_0xf3b355,_0x30a606,_0x39c864){return db['SmsInteraction'][_0xa609('0x6e')]({'where':{'id':_0xf3b355[_0xa609('0xb6')]['id']}})[_0xa609('0x38')](handleEntityNotFound(_0x30a606,null))['then'](function(_0x273ce9){if(_0x273ce9){return _0x273ce9[_0xa609('0xc6')](_0xf3b355[_0xa609('0x76')]['ids'],_[_0xa609('0xbf')](_0xf3b355[_0xa609('0x76')],[_0xa609('0xbe'),'id'])||{})[_0xa609('0xc7')](function(){return db[_0xa609('0x73')]['findAll']({'attributes':['id',_0xa609('0x2f'),'color'],'where':{'id':_0xf3b355[_0xa609('0x76')][_0xa609('0xbe')]}});})[_0xa609('0x38')](function(_0x1a88a8){socket[_0xa609('0xc8')]('smsInteractionTags:save',{'id':Number(_0xf3b355[_0xa609('0xb6')]['id']),'tags':_0x1a88a8||[]});return{'id':Number(_0xf3b355[_0xa609('0xb6')]['id']),'tags':_0x1a88a8||[]};});}})[_0xa609('0x38')](respondWithResult(_0x30a606,null))[_0xa609('0xbb')](handleError(_0x30a606,null));};exports[_0xa609('0xc9')]=function(_0x51b2bf,_0x9b65bf,_0x1c894e){return db[_0xa609('0x3a')][_0xa609('0x6e')]({'where':{'id':_0x51b2bf['params']['id']}})['then'](handleEntityNotFound(_0x9b65bf,null))[_0xa609('0x38')](function(_0x2d7caf){if(_0x2d7caf){return _0x2d7caf[_0xa609('0xc9')](_0x51b2bf[_0xa609('0x3f')][_0xa609('0xbe')]);}})[_0xa609('0x38')](respondWithStatusCode(_0x9b65bf,null))[_0xa609('0xbb')](handleError(_0x9b65bf,null));};exports['download']=function(_0x119e5e,_0xc60536){var _0x42f623=moment()[_0xa609('0xca')]()[_0xa609('0x9e')]();var _0x51574a=path[_0xa609('0xcb')](config[_0xa609('0xcc')],_0xa609('0xcd'),_0xa609('0xce'),_0xa609('0xcf'));var _0x494ed6=path[_0xa609('0xcb')](config[_0xa609('0xcc')],_0xa609('0xcd'),_0xa609('0xce'),_0xa609('0xd0'));var _0x3af6a6=path[_0xa609('0xcb')](_0x51574a,_0x42f623);var _0x897026=util[_0xa609('0xd1')](_0xa609('0xd2'),_0x119e5e[_0xa609('0xb6')]['id'],_0x42f623);var _0x4a754d=path[_0xa609('0xcb')](_0x51574a,_0x897026);var _0x44c91f=[];_0x44c91f[_0xa609('0x37')]({'model':db[_0xa609('0xd3')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x44c91f[_0xa609('0x37')]({'model':db[_0xa609('0xd4')],'as':_0xa609('0x69'),'attributes':['id',_0xa609('0xd5'),_0xa609('0xd6')],'raw':!![]});var _0x52f3f5=[{'model':db[_0xa609('0xc1')],'as':_0xa609('0xd7'),'attributes':['id',_0xa609('0x76'),_0xa609('0x7a'),'direction',_0xa609('0xd8'),_0xa609('0x82')],'include':_0x44c91f}];_0x52f3f5['push']({'model':db[_0xa609('0xd9')],'as':_0xa609('0xda'),'attributes':['id',_0xa609('0x2f')]});_0x52f3f5[_0xa609('0x37')]({'model':db[_0xa609('0xd3')],'as':_0xa609('0xdb'),'attributes':['id',_0xa609('0x32')]});return db['SmsInteraction'][_0xa609('0x6e')]({'where':{'id':_0x119e5e[_0xa609('0xb6')]['id']},'include':_0x52f3f5})['then'](handleEntityNotFound(_0xc60536,null))[_0xa609('0x38')](function(_0x44571c){if(_0x44571c){var _0x35ce28=_0x44571c[_0xa609('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x3af6a6);var _0x827868={'channel':'Sms','account':_0x35ce28[_0xa609('0xda')][_0xa609('0x2f')],'agent':_0x35ce28[_0xa609('0xdb')]?_0x35ce28[_0xa609('0xdb')][_0xa609('0x32')]:_0xa609('0xdd'),'createdAt':moment(_0x35ce28[_0xa609('0x7a')])[_0xa609('0xd1')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa609('0x9e')](),'closedAt':_0x35ce28[_0xa609('0xde')]?moment(_0x35ce28[_0xa609('0xdf')])[_0xa609('0xd1')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa609('0x9e')]():'','disposition':_0x35ce28[_0xa609('0xe0')],'messages':_(_0x35ce28[_0xa609('0xd7')])[_0xa609('0x87')]({'secret':![]})['map'](function(_0x43ac40){return{'date':moment(_0x43ac40[_0xa609('0x7a')])[_0xa609('0xd1')](_0xa609('0xc3'))[_0xa609('0x9e')](),'sender':_0x43ac40[_0xa609('0xe1')]===_0xa609('0xe2')?_0x43ac40['User']?_0x43ac40['User'][_0xa609('0x32')]:_0xa609('0xe3'):_0x43ac40[_0xa609('0x69')][_0xa609('0xd5')]+(_0x43ac40['Contact'][_0xa609('0xd6')]?'\x20'+_0x43ac40[_0xa609('0x69')][_0xa609('0xd6')]:''),'body':_0x43ac40['body'],'direction':_0x43ac40[_0xa609('0xe1')]===_0xa609('0xe2')?'A':'C','secret':_0x43ac40[_0xa609('0xd8')],'read':_0x43ac40['read']};})[_0xa609('0x65')]()};return ejs[_0xa609('0xe4')](path[_0xa609('0xcb')](config['root'],_0xa609('0xcd'),'views',_0xa609('0xe5')),{'interaction':_0x827868})[_0xa609('0x38')](function(_0x3eb89c){var _0x23a63a=path[_0xa609('0xcb')](_0x3af6a6,'transcript-'+_0x35ce28['id']+'-'+_0x42f623+_0xa609('0xe6'));var _0x5041bf={'path':_0x23a63a,'channel':_0xa609('0xe7'),'interactionId':_0x35ce28['id']};return pdf[_0xa609('0xe8')](_0x3eb89c,_0x5041bf);})[_0xa609('0x38')](function(){return new BPromise(function(_0x446ed5,_0x1d1e65){zipdir(_0x3af6a6,{'saveTo':_0x4a754d},function(_0xad1485,_0x297150){if(_0xad1485)return _0x1d1e65(_0xad1485);return _0x446ed5(_0x297150);});})[_0xa609('0x38')](function(){return new BPromise(function(_0x4620c3,_0x17efbe){rimraf(_0x3af6a6,function(_0xfa0cc7){if(_0xfa0cc7)_0x17efbe(_0xfa0cc7);return _0x4620c3();});});})[_0xa609('0x38')](function(){return _0xc60536[_0xa609('0xe9')](_0x4a754d,_0x897026,function(_0x2911d9){if(_0x2911d9){console['log'](_0xa609('0xea'),_0x2911d9);}else{fs[_0xa609('0xeb')](_0x4a754d);}});});});}else{return _0xc60536[_0xa609('0x22')](0xc8);}})[_0xa609('0xbb')](handleError(_0xc60536,null));};
\ No newline at end of file
index d105182..0e0155a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25e7=['hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x35ef7a,_0x2b3df3){var _0x3e1c56=function(_0x38b48f){while(--_0x38b48f){_0x35ef7a['push'](_0x35ef7a['shift']());}};_0x3e1c56(++_0x2b3df3);}(_0x25e7,0x1d6));var _0x725e=function(_0x35b99b,_0x2efd45){_0x35b99b=_0x35b99b-0x0;var _0xc34057=_0x25e7[_0x35b99b];return _0xc34057;};'use strict';var EventEmitter=require(_0x725e('0x0'));var SmsInteraction=require(_0x725e('0x1'))['db'][_0x725e('0x2')];var SmsMessage=require(_0x725e('0x1'))['db'][_0x725e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x725e('0x4')](0x0);var events={'afterCreate':_0x725e('0x5'),'afterUpdate':_0x725e('0x6'),'afterDestroy':_0x725e('0x7')};function emitEvent(_0x3da706){return function(_0x493364,_0x5e17a9,_0x2497a5){_0x493364['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x111a50){_0x493364[_0x725e('0x8')](_0x725e('0x9'),_0x111a50[_0x725e('0xa')](function(_0x40d238){return{'id':_0x40d238['id']};}));return SmsMessage[_0x725e('0xb')]({'where':{'SmsInteractionId':_0x493364['id'],'direction':'in','read':![]},'raw':!![]});})[_0x725e('0xc')](function(_0x7c40ff){_0x493364[_0x725e('0x8')](_0x725e('0xd'),_0x7c40ff[_0x725e('0xe')]);SmsInteractionEvents[_0x725e('0xf')](_0x3da706+':'+_0x493364['id'],_0x493364);SmsInteractionEvents['emit'](_0x3da706,_0x493364);_0x2497a5(null);})['catch'](_0x2497a5(null));};}for(var e in events){if(events[_0x725e('0x10')](e)){var event=events[e];SmsInteraction[_0x725e('0x11')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
+var _0x0972=['save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x1aa2f6,_0x5b2c75){var _0x5c0308=function(_0x1be43c){while(--_0x1be43c){_0x1aa2f6['push'](_0x1aa2f6['shift']());}};_0x5c0308(++_0x5b2c75);}(_0x0972,0x64));var _0x2097=function(_0x286ca0,_0x1b15a8){_0x286ca0=_0x286ca0-0x0;var _0x2e5945=_0x0972[_0x286ca0];return _0x2e5945;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x2097('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0x2097('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2097('0x1')](0x0);var events={'afterCreate':_0x2097('0x2'),'afterUpdate':'update','afterDestroy':_0x2097('0x3')};function emitEvent(_0x431d1c){return function(_0xe6fbae,_0x1a7d26,_0x2f84d8){_0xe6fbae[_0x2097('0x4')]({'attributes':['id'],'raw':!![]})[_0x2097('0x5')](function(_0x59739f){_0xe6fbae[_0x2097('0x6')](_0x2097('0x7'),_0x59739f[_0x2097('0x8')](function(_0x1d94e2){return{'id':_0x1d94e2['id']};}));return SmsMessage[_0x2097('0x9')]({'where':{'SmsInteractionId':_0xe6fbae['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e0024){_0xe6fbae[_0x2097('0x6')](_0x2097('0xa'),_0x2e0024[_0x2097('0xb')]);SmsInteractionEvents[_0x2097('0xc')](_0x431d1c+':'+_0xe6fbae['id'],_0xe6fbae);SmsInteractionEvents[_0x2097('0xc')](_0x431d1c,_0xe6fbae);_0x2f84d8(null);})[_0x2097('0xd')](_0x2f84d8(null));};}for(var e in events){if(events[_0x2097('0xe')](e)){var event=events[e];SmsInteraction[_0x2097('0xf')](e,emitEvent(event));}}module[_0x2097('0x10')]=SmsInteractionEvents;
\ No newline at end of file
index 109b488..f84428b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb8=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format'];(function(_0x4654d4,_0x293a9f){var _0x53a60d=function(_0x3fcd78){while(--_0x3fcd78){_0x4654d4['push'](_0x4654d4['shift']());}};_0x53a60d(++_0x293a9f);}(_0xbdb8,0x17b));var _0x8bdb=function(_0x14e001,_0x569bf){_0x14e001=_0x14e001-0x0;var _0x2c09da=_0xbdb8[_0x14e001];return _0x2c09da;};'use strict';var _=require(_0x8bdb('0x0'));var util=require(_0x8bdb('0x1'));var logger=require(_0x8bdb('0x2'))(_0x8bdb('0x3'));var moment=require('moment');var BPromise=require(_0x8bdb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bdb('0x5'));var rimraf=require(_0x8bdb('0x6'));var config=require(_0x8bdb('0x7'));var attributes=require(_0x8bdb('0x8'));module[_0x8bdb('0x9')]=function(_0x55c374,_0x329ea9){return _0x55c374[_0x8bdb('0xa')](_0x8bdb('0xb'),attributes,{'tableName':_0x8bdb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c85e6,_0x25997c,_0x50a054){if(_0x1c85e6[_0x8bdb('0xd')](_0x8bdb('0xe'))){_0x1c85e6[_0x8bdb('0xf')]=moment()[_0x8bdb('0x10')](_0x8bdb('0x11'));}_0x50a054(null,_0x1c85e6);}}});};
\ No newline at end of file
+var _0x21a4=['rimraf','./smsInteraction.attributes','exports','define','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','bluebird','request-promise'];(function(_0x3c3698,_0xa0bf08){var _0x4e6637=function(_0x1fc9a4){while(--_0x1fc9a4){_0x3c3698['push'](_0x3c3698['shift']());}};_0x4e6637(++_0xa0bf08);}(_0x21a4,0x98));var _0x421a=function(_0x8634df,_0x194224){_0x8634df=_0x8634df-0x0;var _0x2dffb9=_0x21a4[_0x8634df];return _0x2dffb9;};'use strict';var _=require('lodash');var util=require(_0x421a('0x0'));var logger=require('../../config/logger')(_0x421a('0x1'));var moment=require('moment');var BPromise=require(_0x421a('0x2'));var rp=require(_0x421a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x421a('0x4'));var config=require('../../config/environment');var attributes=require(_0x421a('0x5'));module[_0x421a('0x6')]=function(_0x56cf10,_0x4efa19){return _0x56cf10[_0x421a('0x7')]('SmsInteraction',attributes,{'tableName':_0x421a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22dac1,_0x5dd979,_0x40ada1){if(_0x22dac1[_0x421a('0x9')]('closed')){_0x22dac1[_0x421a('0xa')]=moment()[_0x421a('0xb')](_0x421a('0xc'));}_0x40ada1(null,_0x22dac1);}}});};
\ No newline at end of file
index 9d4b040..1dee2ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x888a=['util','moment','ioredis','../../config/logger','jayson/promise','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','result','UpdateSmsInteraction','SmsInteraction','body','options','raw','attributes','limit','stringify','catch','AddTagsToSmsInteraction','find','where','addTags','omit','ids','spread','AddTags','lodash'];(function(_0x416fc4,_0x5c283e){var _0xcdb058=function(_0x3e012e){while(--_0x3e012e){_0x416fc4['push'](_0x416fc4['shift']());}};_0xcdb058(++_0x5c283e);}(_0x888a,0x1d3));var _0xa888=function(_0x44d9f0,_0x149367){_0x44d9f0=_0x44d9f0-0x0;var _0x4af22d=_0x888a[_0x44d9f0];return _0x4af22d;};'use strict';var _=require(_0xa888('0x0'));var util=require(_0xa888('0x1'));var moment=require(_0xa888('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa888('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa888('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa888('0x5'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xa888('0x6')](config[_0xa888('0x7')],{'host':_0xa888('0x8'),'port':0x18eb});var socket=require(_0xa888('0x9'))(new Redis(config[_0xa888('0x7')]));require(_0xa888('0xa'))[_0xa888('0xb')](socket);function respondWithRpcPromise(_0x41c8db,_0x517f1b,_0x51663e){return new BPromise(function(_0x3915d1,_0x4b7022){return client[_0xa888('0xc')](_0x41c8db,_0x51663e)[_0xa888('0xd')](function(_0x5b8c5d){logger[_0xa888('0xe')](_0xa888('0xf'),_0x517f1b,_0xa888('0x10'));logger[_0xa888('0x11')](_0xa888('0x12'),_0x517f1b,_0xa888('0x10'),JSON['stringify'](_0x5b8c5d));if(_0x5b8c5d['error']){if(_0x5b8c5d[_0xa888('0x13')]['code']===0x1f4){logger[_0xa888('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x517f1b,_0x5b8c5d[_0xa888('0x13')][_0xa888('0x14')]);return _0x4b7022(_0x5b8c5d['error'][_0xa888('0x14')]);}logger[_0xa888('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x517f1b,_0x5b8c5d[_0xa888('0x13')][_0xa888('0x14')]);return _0x3915d1(_0x5b8c5d[_0xa888('0x13')][_0xa888('0x14')]);}else{logger[_0xa888('0xe')](_0xa888('0xf'),_0x517f1b,_0xa888('0x10'));_0x3915d1(_0x5b8c5d[_0xa888('0x15')][_0xa888('0x14')]);}})['catch'](function(_0x4f57b4){logger[_0xa888('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x517f1b,_0x4f57b4);_0x4b7022(_0x4f57b4);});});}exports[_0xa888('0x16')]=function(_0x27eedf){var _0x2c3b77=this;return new Promise(function(_0x26f7a6,_0x58ea77){return db[_0xa888('0x17')]['update'](_0x27eedf[_0xa888('0x18')],{'raw':_0x27eedf[_0xa888('0x19')]?_0x27eedf[_0xa888('0x19')][_0xa888('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27eedf[_0xa888('0x19')]?_0x27eedf[_0xa888('0x19')]['where']||null:null,'attributes':_0x27eedf[_0xa888('0x19')]?_0x27eedf['options'][_0xa888('0x1b')]||null:null,'limit':_0x27eedf[_0xa888('0x19')]?_0x27eedf['options'][_0xa888('0x1c')]||null:null})['then'](function(_0x3adfe3){logger[_0xa888('0xe')](_0xa888('0x16'),_0x27eedf);logger[_0xa888('0x11')](_0xa888('0x16'),_0x27eedf,JSON[_0xa888('0x1d')](_0x3adfe3));_0x26f7a6(_0x3adfe3);})[_0xa888('0x1e')](function(_0x12f1de){logger['error']('UpdateSmsInteraction',_0x12f1de[_0xa888('0x14')],_0x27eedf);_0x58ea77(_0x2c3b77[_0xa888('0x13')](0x1f4,_0x12f1de[_0xa888('0x14')]));});});};exports[_0xa888('0x1f')]=function(_0xc5a563){return new Promise(function(_0x22a100,_0x40f8a6){return db[_0xa888('0x17')][_0xa888('0x20')]({'where':_0xc5a563[_0xa888('0x19')]?_0xc5a563[_0xa888('0x19')][_0xa888('0x21')]||null:null})[_0xa888('0xd')](function(_0x44059c){if(_0x44059c){return _0x44059c[_0xa888('0x22')](_0xc5a563[_0xa888('0x18')]['ids'],_[_0xa888('0x23')](_0xc5a563[_0xa888('0x18')],[_0xa888('0x24'),'id'])||{});}})[_0xa888('0x25')](function(_0x302859){logger[_0xa888('0xe')](_0xa888('0x26'),_0xc5a563);logger[_0xa888('0x11')](_0xa888('0x26'),_0xc5a563,JSON[_0xa888('0x1d')](_0x302859));_0x22a100(_0x302859);})[_0xa888('0x1e')](function(_0x5e5f34){logger[_0xa888('0x13')]('AddTags',_0x5e5f34['message'],_0xc5a563);_0x40f8a6(_this[_0xa888('0x13')](0x1f4,_0x5e5f34[_0xa888('0x14')]));});});};
\ No newline at end of file
+var _0xf1e4=['client','redis','defaults','localhost','socket.io-emitter','register','then','info','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','SmsInteraction,\x20%s,\x20%s','message','result','catch','SmsInteraction','options','raw','limit','UpdateSmsInteraction','debug','AddTagsToSmsInteraction','find','where','addTags','ids','body','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4f82bb,_0x2a0185){var _0x8e29a7=function(_0x29a6f1){while(--_0x29a6f1){_0x4f82bb['push'](_0x4f82bb['shift']());}};_0x8e29a7(++_0x2a0185);}(_0xf1e4,0x1b9));var _0x4f1e=function(_0x117340,_0x767a60){_0x117340=_0x117340-0x0;var _0x493a27=_0xf1e4[_0x117340];return _0x493a27;};'use strict';var _=require(_0x4f1e('0x0'));var util=require(_0x4f1e('0x1'));var moment=require(_0x4f1e('0x2'));var BPromise=require(_0x4f1e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f1e('0x4'))['db'];var utils=require(_0x4f1e('0x5'));var logger=require(_0x4f1e('0x6'))(_0x4f1e('0x7'));var config=require(_0x4f1e('0x8'));var jayson=require(_0x4f1e('0x9'));var client=jayson[_0x4f1e('0xa')]['http']({'port':0x232a});config[_0x4f1e('0xb')]=_[_0x4f1e('0xc')](config[_0x4f1e('0xb')],{'host':_0x4f1e('0xd'),'port':0x18eb});var socket=require(_0x4f1e('0xe'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x4f1e('0xf')](socket);function respondWithRpcPromise(_0x236ae0,_0x45b74f,_0x1c9330){return new BPromise(function(_0x545dc0,_0xeea0c2){return client['request'](_0x236ae0,_0x1c9330)[_0x4f1e('0x10')](function(_0x3e9883){logger[_0x4f1e('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x45b74f,'request\x20sent');logger['debug'](_0x4f1e('0x12'),_0x45b74f,_0x4f1e('0x13'),JSON[_0x4f1e('0x14')](_0x3e9883));if(_0x3e9883['error']){if(_0x3e9883['error'][_0x4f1e('0x15')]===0x1f4){logger[_0x4f1e('0x16')](_0x4f1e('0x17'),_0x45b74f,_0x3e9883[_0x4f1e('0x16')][_0x4f1e('0x18')]);return _0xeea0c2(_0x3e9883[_0x4f1e('0x16')][_0x4f1e('0x18')]);}logger[_0x4f1e('0x16')](_0x4f1e('0x17'),_0x45b74f,_0x3e9883['error'][_0x4f1e('0x18')]);return _0x545dc0(_0x3e9883[_0x4f1e('0x16')]['message']);}else{logger[_0x4f1e('0x11')](_0x4f1e('0x17'),_0x45b74f,_0x4f1e('0x13'));_0x545dc0(_0x3e9883[_0x4f1e('0x19')]['message']);}})[_0x4f1e('0x1a')](function(_0x803a0){logger[_0x4f1e('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x45b74f,_0x803a0);_0xeea0c2(_0x803a0);});});}exports['UpdateSmsInteraction']=function(_0x377866){var _0x16bb2e=this;return new Promise(function(_0x13f0d0,_0x3e7246){return db[_0x4f1e('0x1b')]['update'](_0x377866['body'],{'raw':_0x377866[_0x4f1e('0x1c')]?_0x377866['options'][_0x4f1e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x377866[_0x4f1e('0x1c')]?_0x377866['options']['where']||null:null,'attributes':_0x377866['options']?_0x377866[_0x4f1e('0x1c')]['attributes']||null:null,'limit':_0x377866[_0x4f1e('0x1c')]?_0x377866['options'][_0x4f1e('0x1e')]||null:null})[_0x4f1e('0x10')](function(_0x345ae7){logger[_0x4f1e('0x11')](_0x4f1e('0x1f'),_0x377866);logger[_0x4f1e('0x20')](_0x4f1e('0x1f'),_0x377866,JSON['stringify'](_0x345ae7));_0x13f0d0(_0x345ae7);})[_0x4f1e('0x1a')](function(_0x2f70a5){logger[_0x4f1e('0x16')](_0x4f1e('0x1f'),_0x2f70a5[_0x4f1e('0x18')],_0x377866);_0x3e7246(_0x16bb2e['error'](0x1f4,_0x2f70a5[_0x4f1e('0x18')]));});});};exports[_0x4f1e('0x21')]=function(_0x48435f){return new Promise(function(_0x5857b9,_0x26b3ae){return db[_0x4f1e('0x1b')][_0x4f1e('0x22')]({'where':_0x48435f[_0x4f1e('0x1c')]?_0x48435f['options'][_0x4f1e('0x23')]||null:null})[_0x4f1e('0x10')](function(_0x35ff5b){if(_0x35ff5b){return _0x35ff5b[_0x4f1e('0x24')](_0x48435f['body'][_0x4f1e('0x25')],_['omit'](_0x48435f[_0x4f1e('0x26')],[_0x4f1e('0x25'),'id'])||{});}})[_0x4f1e('0x27')](function(_0x1637dd){logger['info'](_0x4f1e('0x28'),_0x48435f);logger[_0x4f1e('0x20')]('AddTags',_0x48435f,JSON[_0x4f1e('0x14')](_0x1637dd));_0x5857b9(_0x1637dd);})['catch'](function(_0x4473a4){logger[_0x4f1e('0x16')](_0x4f1e('0x28'),_0x4473a4[_0x4f1e('0x18')],_0x48435f);_0x26b3ae(_this[_0x4f1e('0x16')](0x1f4,_0x4473a4[_0x4f1e('0x18')]));});});};
\ No newline at end of file
index d759920..a8098b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ce1=['./smsInteraction.events','update','emit','register','length','smsInteraction:'];(function(_0x5b0af8,_0x4724c2){var _0xc8aef=function(_0xeb5a82){while(--_0xeb5a82){_0x5b0af8['push'](_0x5b0af8['shift']());}};_0xc8aef(++_0x4724c2);}(_0x3ce1,0x108));var _0x13ce=function(_0x6b6c52,_0x3ae5c0){_0x6b6c52=_0x6b6c52-0x0;var _0x57d09e=_0x3ce1[_0x6b6c52];return _0x57d09e;};'use strict';var SmsInteractionEvents=require(_0x13ce('0x0'));var events=['save','remove',_0x13ce('0x1')];function createListener(_0x79e5a7,_0x3187d6){return function(_0x4fbe50){_0x3187d6[_0x13ce('0x2')](_0x79e5a7,_0x4fbe50);};}function removeListener(_0x58d0d5,_0x23969e){return function(){SmsInteractionEvents['removeListener'](_0x58d0d5,_0x23969e);};}exports[_0x13ce('0x3')]=function(_0x2dd04e){for(var _0x4158e4=0x0,_0x4d412e=events[_0x13ce('0x4')];_0x4158e4<_0x4d412e;_0x4158e4++){var _0x1d677e=events[_0x4158e4];var _0x197a48=createListener(_0x13ce('0x5')+_0x1d677e,_0x2dd04e);SmsInteractionEvents['on'](_0x1d677e,_0x197a48);}};
\ No newline at end of file
+var _0xfe36=['removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0xf06245,_0x568049){var _0x4e486b=function(_0x21f336){while(--_0x21f336){_0xf06245['push'](_0xf06245['shift']());}};_0x4e486b(++_0x568049);}(_0xfe36,0x15b));var _0x6fe3=function(_0x303896,_0x51b124){_0x303896=_0x303896-0x0;var _0x3e9021=_0xfe36[_0x303896];return _0x3e9021;};'use strict';var SmsInteractionEvents=require(_0x6fe3('0x0'));var events=[_0x6fe3('0x1'),_0x6fe3('0x2'),'update'];function createListener(_0x221dc2,_0x23880b){return function(_0x3ac521){_0x23880b['emit'](_0x221dc2,_0x3ac521);};}function removeListener(_0x5ba921,_0x104864){return function(){SmsInteractionEvents[_0x6fe3('0x3')](_0x5ba921,_0x104864);};}exports[_0x6fe3('0x4')]=function(_0x3e4f27){for(var _0x504046=0x0,_0xf91044=events[_0x6fe3('0x5')];_0x504046<_0xf91044;_0x504046++){var _0x48b969=events[_0x504046];var _0x392a1f=createListener(_0x6fe3('0x6')+_0x48b969,_0x3e4f27);SmsInteractionEvents['on'](_0x48b969,_0x392a1f);}};
\ No newline at end of file
index a9e87fd..8d1ebd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x920b=['/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put'];(function(_0x1a38c4,_0x24f5cd){var _0x448659=function(_0x1f1dcd){while(--_0x1f1dcd){_0x1a38c4['push'](_0x1a38c4['shift']());}};_0x448659(++_0x24f5cd);}(_0x920b,0x11d));var _0xb920=function(_0x6383d9,_0x32a0f9){_0x6383d9=_0x6383d9-0x0;var _0x2a0e66=_0x920b[_0x6383d9];return _0x2a0e66;};'use strict';var multer=require(_0xb920('0x0'));var util=require(_0xb920('0x1'));var path=require(_0xb920('0x2'));var timeout=require(_0xb920('0x3'));var express=require(_0xb920('0x4'));var router=express[_0xb920('0x5')]();var fs_extra=require(_0xb920('0x6'));var auth=require(_0xb920('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb920('0x8'));var controller=require(_0xb920('0x9'));router[_0xb920('0xa')]('/',auth[_0xb920('0xb')](),controller['index']);router[_0xb920('0xa')]('/describe',auth[_0xb920('0xb')](),controller[_0xb920('0xc')]);router[_0xb920('0xa')](_0xb920('0xd'),auth[_0xb920('0xb')](),controller[_0xb920('0xe')]);router[_0xb920('0xf')]('/',auth['isAuthenticated'](),interaction[_0xb920('0x10')](_0xb920('0x11'),_0xb920('0x12')),controller[_0xb920('0x13')]);router[_0xb920('0xf')](_0xb920('0x14'),controller[_0xb920('0x15')]);router[_0xb920('0x16')](_0xb920('0xd'),auth[_0xb920('0xb')](),controller['update']);router['put']('/:id/accept',auth[_0xb920('0xb')](),controller['accept']);router[_0xb920('0x16')](_0xb920('0x17'),auth['isAuthenticated'](),controller[_0xb920('0x18')]);router[_0xb920('0x19')](_0xb920('0xd'),auth[_0xb920('0xb')](),controller[_0xb920('0x1a')]);module[_0xb920('0x1b')]=router;
\ No newline at end of file
+var _0x9d55=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','put','update','/:id/accept','reject','delete','destroy','exports','multer','path'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x9d55,0xac));var _0x59d5=function(_0x245c66,_0x15b63a){_0x245c66=_0x245c66-0x0;var _0x3372ce=_0x9d55[_0x245c66];return _0x3372ce;};'use strict';var multer=require(_0x59d5('0x0'));var util=require('util');var path=require(_0x59d5('0x1'));var timeout=require(_0x59d5('0x2'));var express=require(_0x59d5('0x3'));var router=express[_0x59d5('0x4')]();var fs_extra=require(_0x59d5('0x5'));var auth=require(_0x59d5('0x6'));var interaction=require(_0x59d5('0x7'));var config=require(_0x59d5('0x8'));var controller=require(_0x59d5('0x9'));router[_0x59d5('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x59d5('0xb'),auth[_0x59d5('0xc')](),controller[_0x59d5('0xd')]);router[_0x59d5('0xa')](_0x59d5('0xe'),auth[_0x59d5('0xc')](),controller[_0x59d5('0xf')]);router[_0x59d5('0x10')]('/',auth[_0x59d5('0xc')](),interaction[_0x59d5('0x11')](_0x59d5('0x12'),_0x59d5('0x13')),controller[_0x59d5('0x14')]);router[_0x59d5('0x10')](_0x59d5('0x15'),controller['status']);router[_0x59d5('0x16')]('/:id',auth[_0x59d5('0xc')](),controller[_0x59d5('0x17')]);router[_0x59d5('0x16')](_0x59d5('0x18'),auth[_0x59d5('0xc')](),controller['accept']);router[_0x59d5('0x16')]('/:id/reject',auth[_0x59d5('0xc')](),controller[_0x59d5('0x19')]);router[_0x59d5('0x1a')](_0x59d5('0xe'),auth[_0x59d5('0xc')](),controller[_0x59d5('0x1b')]);module[_0x59d5('0x1c')]=router;
\ No newline at end of file
index b428ad3..aed8b60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14d8=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x4c5936,_0x313184){var _0x7c93fa=function(_0x1146e1){while(--_0x1146e1){_0x4c5936['push'](_0x4c5936['shift']());}};_0x7c93fa(++_0x313184);}(_0x14d8,0x9f));var _0x814d=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x14d8[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0x814d('0x0'));module[_0x814d('0x1')]={'body':{'type':Sequelize[_0x814d('0x2')](_0x814d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x814d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x814d('0x5')]('in',_0x814d('0x6')),'defaultValue':_0x814d('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x814d('0x7')](0xbe)},'phone':{'type':Sequelize[_0x814d('0x7')]},'readAt':{'type':Sequelize[_0x814d('0x8')]},'secret':{'type':Sequelize[_0x814d('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x814d('0x7')]},'providerResponse':{'type':Sequelize[_0x814d('0x2')]}};
\ No newline at end of file
+var _0x98ac=['exports','out','STRING','BOOLEAN','TEXT','sequelize'];(function(_0xce50e,_0x5077fe){var _0x4528c7=function(_0x5ea446){while(--_0x5ea446){_0xce50e['push'](_0xce50e['shift']());}};_0x4528c7(++_0x5077fe);}(_0x98ac,0x16d));var _0xc98a=function(_0x3b04bb,_0x4aea8a){_0x3b04bb=_0x3b04bb-0x0;var _0x323ea3=_0x98ac[_0x3b04bb];return _0x323ea3;};'use strict';var Sequelize=require(_0xc98a('0x0'));module[_0xc98a('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc98a('0x2')),'defaultValue':_0xc98a('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc98a('0x3')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xc98a('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc98a('0x3')]},'providerResponse':{'type':Sequelize[_0xc98a('0x5')]}};
\ No newline at end of file
index dba8ba7..012934f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x253d=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','request','info','debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','sendStatus','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','show','params','include','options','find','create','body','describe','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','isNil','read1stAt','interaction','get','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','User','fullname','email','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','contact','interface','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','results','groupName','DELIVERED','infobip','eml-format','moment','bluebird'];(function(_0x28294a,_0x542642){var _0x3bef7d=function(_0x2229f4){while(--_0x2229f4){_0x28294a['push'](_0x28294a['shift']());}};_0x3bef7d(++_0x542642);}(_0x253d,0x1b3));var _0xd253=function(_0x5588d7,_0x2d8daf){_0x5588d7=_0x5588d7-0x0;var _0x4dfa03=_0x253d[_0x5588d7];return _0x4dfa03;};'use strict';var emlformat=require(_0xd253('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd253('0x1'));var BPromise=require(_0xd253('0x2'));var Mustache=require(_0xd253('0x3'));var util=require(_0xd253('0x4'));var path=require(_0xd253('0x5'));var sox=require('sox');var csv=require(_0xd253('0x6'));var ejs=require(_0xd253('0x7'));var fs=require('fs');var fs_extra=require(_0xd253('0x8'));var _=require(_0xd253('0x9'));var squel=require(_0xd253('0xa'));var crypto=require('crypto');var jsforce=require(_0xd253('0xb'));var deskjs=require(_0xd253('0xc'));var toCsv=require(_0xd253('0x6'));var querystring=require(_0xd253('0xd'));var Papa=require(_0xd253('0xe'));var Redis=require(_0xd253('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd253('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd253('0x11'))(_0xd253('0x12'));var utils=require(_0xd253('0x13'));var config=require(_0xd253('0x14'));var licenseUtil=require(_0xd253('0x15'));var db=require(_0xd253('0x16'))['db'];config['redis']=_['defaults'](config[_0xd253('0x17')],{'host':_0xd253('0x18'),'port':0x18eb});var socket=require(_0xd253('0x19'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xd253('0x1a')](socket);var jayson=require(_0xd253('0x1b'));var client=jayson[_0xd253('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xd253('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8b15a6,_0x435711,_0x24fa24,_0x5196a3){return new BPromise(function(_0x1b7ed1,_0x5bb9c9){var _0x427c6a=_0x5196a3||client;return _0x427c6a[_0xd253('0x1d')](_0x8b15a6,_0x24fa24)['then'](function(_0x2496cb){logger[_0xd253('0x1e')]('SmsMessage,\x20%s,\x20%s',_0x435711,'request\x20sent');logger[_0xd253('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x435711,'request\x20sent',JSON[_0xd253('0x20')](_0x2496cb));if(_0x2496cb['error']){if(_0x2496cb[_0xd253('0x21')][_0xd253('0x22')]===0x1f4){logger[_0xd253('0x21')](_0xd253('0x23'),_0x435711,_0x2496cb['error'][_0xd253('0x24')]);return _0x5bb9c9(_0x2496cb['error'][_0xd253('0x24')]);}logger['error'](_0xd253('0x23'),_0x435711,_0x2496cb[_0xd253('0x21')][_0xd253('0x24')]);return _0x1b7ed1(_0x2496cb[_0xd253('0x21')]['message']);}else{logger[_0xd253('0x1e')](_0xd253('0x23'),_0x435711,'request\x20sent');_0x1b7ed1(_0x2496cb[_0xd253('0x25')][_0xd253('0x24')]);}})[_0xd253('0x26')](function(_0x336736){logger[_0xd253('0x21')](_0xd253('0x23'),_0x435711,_0x336736);_0x5bb9c9(_0x336736);});});}function respondWithStatusCode(_0xb9a661,_0x55851f){_0x55851f=_0x55851f||0xcc;return function(_0x10b635){if(_0x10b635){return _0xb9a661['sendStatus'](_0x55851f);}return _0xb9a661['status'](_0x55851f)[_0xd253('0x27')]();};}function respondWithResult(_0x3e36cc,_0x4a4ba1){_0x4a4ba1=_0x4a4ba1||0xc8;return function(_0x542494){if(_0x542494){return _0x3e36cc[_0xd253('0x28')](_0x4a4ba1)[_0xd253('0x29')](_0x542494);}};}function respondWithFilteredResult(_0x566e37,_0x3955a0){return function(_0x382c5f){if(_0x382c5f){var _0x1c6f39=typeof _0x3955a0[_0xd253('0x2a')]===_0xd253('0x2b')&&typeof _0x3955a0['limit']===_0xd253('0x2b');var _0x31a217=_0x382c5f[_0xd253('0x2c')];var _0x5dc9c9=_0x1c6f39?0x0:_0x3955a0[_0xd253('0x2a')];var _0x51b8dd=_0x1c6f39?_0x382c5f[_0xd253('0x2c')]:_0x3955a0[_0xd253('0x2a')]+_0x3955a0[_0xd253('0x2d')];var _0x2934a5;if(_0x51b8dd>=_0x31a217){_0x51b8dd=_0x31a217;_0x2934a5=0xc8;}else{_0x2934a5=0xce;}_0x566e37[_0xd253('0x28')](_0x2934a5);return _0x566e37[_0xd253('0x2e')](_0xd253('0x2f'),_0x5dc9c9+'-'+_0x51b8dd+'/'+_0x31a217)[_0xd253('0x29')](_0x382c5f);}return null;};}function patchUpdates(_0x42eefe){return function(_0x2a730d){try{jsonpatch['apply'](_0x2a730d,_0x42eefe,!![]);}catch(_0x341ae1){return BPromise[_0xd253('0x30')](_0x341ae1);}return _0x2a730d['save']();};}function saveUpdates(_0x4eba8c,_0x15f42b){return function(_0x4f48f7){if(_0x4f48f7){return _0x4f48f7[_0xd253('0x31')](_0x4eba8c)[_0xd253('0x32')](function(_0x44a1a0){return _0x44a1a0;});}return null;};}function removeEntity(_0x13880e,_0x59d326){return function(_0x2677db){if(_0x2677db){return _0x2677db[_0xd253('0x33')]()[_0xd253('0x32')](function(){_0x13880e[_0xd253('0x28')](0xcc)[_0xd253('0x27')]();});}};}function handleEntityNotFound(_0x3142b5,_0x1c328e){return function(_0x5e2be8){if(!_0x5e2be8){_0x3142b5[_0xd253('0x34')](0x194);}return _0x5e2be8;};}function handleError(_0x22f60a,_0x93325c){_0x93325c=_0x93325c||0x1f4;return function(_0x14cb05){logger[_0xd253('0x21')](_0x14cb05['stack']);if(_0x14cb05[_0xd253('0x35')]){delete _0x14cb05['name'];}_0x22f60a[_0xd253('0x28')](_0x93325c)[_0xd253('0x36')](_0x14cb05);};}exports[_0xd253('0x37')]=function(_0x477433,_0x5c388e){var _0x10f132={},_0x2ee9ba={},_0x1425fd={'count':0x0,'rows':[]};var _0x380bd2=_[_0xd253('0x38')](db[_0xd253('0x39')][_0xd253('0x3a')],function(_0x667d6a){return{'name':_0x667d6a[_0xd253('0x3b')],'type':_0x667d6a[_0xd253('0x3c')][_0xd253('0x3d')]};});_0x2ee9ba[_0xd253('0x3e')]=_[_0xd253('0x38')](_0x380bd2,_0xd253('0x35'));_0x2ee9ba['query']=_[_0xd253('0x3f')](_0x477433[_0xd253('0x40')]);_0x2ee9ba[_0xd253('0x41')]=_['intersection'](_0x2ee9ba[_0xd253('0x3e')],_0x2ee9ba[_0xd253('0x40')]);_0x10f132[_0xd253('0x42')]=_[_0xd253('0x43')](_0x2ee9ba['model'],qs[_0xd253('0x44')](_0x477433[_0xd253('0x40')]['fields']));_0x10f132[_0xd253('0x42')]=_0x10f132[_0xd253('0x42')][_0xd253('0x45')]?_0x10f132[_0xd253('0x42')]:_0x2ee9ba[_0xd253('0x3e')];if(!_0x477433[_0xd253('0x40')][_0xd253('0x46')](_0xd253('0x47'))){_0x10f132[_0xd253('0x2d')]=qs[_0xd253('0x2d')](_0x477433['query'][_0xd253('0x2d')]);_0x10f132[_0xd253('0x2a')]=qs[_0xd253('0x2a')](_0x477433[_0xd253('0x40')]['offset']);}_0x10f132['order']=qs[_0xd253('0x48')](_0x477433[_0xd253('0x40')][_0xd253('0x48')]);_0x10f132[_0xd253('0x49')]=qs[_0xd253('0x41')](_[_0xd253('0x4a')](_0x477433[_0xd253('0x40')],_0x2ee9ba['filters']),_0x380bd2);if(_0x477433[_0xd253('0x40')][_0xd253('0x4b')]){_0x10f132['where']=_[_0xd253('0x4c')](_0x10f132[_0xd253('0x49')],{'$or':_[_0xd253('0x38')](_0x380bd2,function(_0x3e914f){if(_0x3e914f['type']!==_0xd253('0x4d')){var _0x585c78={};_0x585c78[_0x3e914f[_0xd253('0x35')]]={'$like':'%'+_0x477433['query'][_0xd253('0x4b')]+'%'};return _0x585c78;}})});}_0x10f132=_[_0xd253('0x4c')]({},_0x10f132,_0x477433['options']);var _0x5964ba={'where':_0x10f132['where']};return db[_0xd253('0x39')]['count'](_0x5964ba)['then'](function(_0x41a68d){_0x1425fd[_0xd253('0x2c')]=_0x41a68d;if(_0x477433[_0xd253('0x40')][_0xd253('0x4e')]){_0x10f132['include']=[{'all':!![]}];}return db[_0xd253('0x39')]['findAll'](_0x10f132);})['then'](function(_0x2a4e0){_0x1425fd[_0xd253('0x4f')]=_0x2a4e0;return _0x1425fd;})[_0xd253('0x32')](respondWithFilteredResult(_0x5c388e,_0x10f132))[_0xd253('0x26')](handleError(_0x5c388e,null));};exports[_0xd253('0x50')]=function(_0x33479c,_0x16ab6b){var _0x2fb051={'raw':!![],'where':{'id':_0x33479c[_0xd253('0x51')]['id']}},_0x2c6af6={};_0x2c6af6[_0xd253('0x3e')]=_[_0xd253('0x3f')](db[_0xd253('0x39')][_0xd253('0x3a')]);_0x2c6af6[_0xd253('0x40')]=_[_0xd253('0x3f')](_0x33479c[_0xd253('0x40')]);_0x2c6af6[_0xd253('0x41')]=_[_0xd253('0x43')](_0x2c6af6[_0xd253('0x3e')],_0x2c6af6[_0xd253('0x40')]);_0x2fb051[_0xd253('0x42')]=_[_0xd253('0x43')](_0x2c6af6[_0xd253('0x3e')],qs[_0xd253('0x44')](_0x33479c[_0xd253('0x40')]['fields']));_0x2fb051[_0xd253('0x42')]=_0x2fb051[_0xd253('0x42')][_0xd253('0x45')]?_0x2fb051['attributes']:_0x2c6af6[_0xd253('0x3e')];if(_0x33479c['query'][_0xd253('0x4e')]){_0x2fb051[_0xd253('0x52')]=[{'all':!![]}];}_0x2fb051=_[_0xd253('0x4c')]({},_0x2fb051,_0x33479c[_0xd253('0x53')]);return db[_0xd253('0x39')][_0xd253('0x54')](_0x2fb051)[_0xd253('0x32')](handleEntityNotFound(_0x16ab6b,null))[_0xd253('0x32')](respondWithResult(_0x16ab6b,null))[_0xd253('0x26')](handleError(_0x16ab6b,null));};exports[_0xd253('0x55')]=function(_0x1efb92,_0x2d6b0d){return db[_0xd253('0x39')][_0xd253('0x55')](_0x1efb92[_0xd253('0x56')],{})[_0xd253('0x32')](respondWithResult(_0x2d6b0d,0xc9))['catch'](handleError(_0x2d6b0d,null));};exports[_0xd253('0x31')]=function(_0x2ac8e2,_0x5505bc){if(_0x2ac8e2[_0xd253('0x56')]['id']){delete _0x2ac8e2['body']['id'];}return db[_0xd253('0x39')]['find']({'where':{'id':_0x2ac8e2[_0xd253('0x51')]['id']}})[_0xd253('0x32')](handleEntityNotFound(_0x5505bc,null))[_0xd253('0x32')](saveUpdates(_0x2ac8e2[_0xd253('0x56')],null))[_0xd253('0x32')](respondWithResult(_0x5505bc,null))[_0xd253('0x26')](handleError(_0x5505bc,null));};exports[_0xd253('0x33')]=function(_0x29b06a,_0xbdbc65){return db['SmsMessage'][_0xd253('0x54')]({'where':{'id':_0x29b06a['params']['id']}})['then'](handleEntityNotFound(_0xbdbc65,null))[_0xd253('0x32')](removeEntity(_0xbdbc65,null))[_0xd253('0x26')](handleError(_0xbdbc65,null));};exports[_0xd253('0x57')]=function(_0x2a24cb,_0x15d966){return db[_0xd253('0x39')][_0xd253('0x57')]()['then'](respondWithResult(_0x15d966,null))['catch'](handleError(_0x15d966,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0xd253('0x58')]=function(_0x264438,_0xf7cadc,_0x55b545){var _0x308557={'agent':{},'channel':_0xd253('0x59')};if(_0x264438[_0xd253('0x56')]['id']){delete _0x264438[_0xd253('0x56')]['id'];}_0x264438[_0xd253('0x56')][_0xd253('0x5a')]=!![];_0x264438['body'][_0xd253('0x5b')]=moment()[_0xd253('0x5c')](_0xd253('0x5d'));_0x264438[_0xd253('0x56')][_0xd253('0x5e')]=_0x264438['body'][_0xd253('0x5e')]||_0x264438[_0xd253('0x5f')]['id'];_0x308557[_0xd253('0x60')]['id']=_0x264438[_0xd253('0x56')][_0xd253('0x5e')];return db[_0xd253('0x39')][_0xd253('0x54')]({'where':{'id':_0x264438['params']['id'],'UserId':null}})[_0xd253('0x32')](handleEntityNotFound(_0xf7cadc,null))[_0xd253('0x32')](saveUpdates(_0x264438[_0xd253('0x56')],null))[_0xd253('0x32')](function(_0x2ec973){if(_0x2ec973){_0x308557[_0xd253('0x24')]=_0x2ec973['get']({'plain':!![]});return db[_0xd253('0x61')][_0xd253('0x54')]({'where':{'id':_0x2ec973['SmsInteractionId']}});}return null;})[_0xd253('0x32')](handleEntityNotFound(_0xf7cadc,null))[_0xd253('0x32')](function(_0x17e13d){if(_0x17e13d){return _0x17e13d[_0xd253('0x31')]({'UserId':_0x264438[_0xd253('0x56')]['UserId'],'read1stAt':_[_0xd253('0x62')](_0x17e13d[_0xd253('0x63')])?moment()['format'](_0xd253('0x5d')):undefined});}return null;})['then'](function(_0x265e9d){if(_0x265e9d){_0x308557[_0xd253('0x64')]=_0x265e9d[_0xd253('0x65')]({'plain':!![]});interaction_log[_0xd253('0x1e')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x264438[_0xd253('0x5f')]['id'],_0x264438[_0xd253('0x5f')][_0xd253('0x35')],_0x264438[_0xd253('0x5f')][_0xd253('0x66')],_0x308557[_0xd253('0x64')]['id'],_0x264438[_0xd253('0x56')]?JSON[_0xd253('0x20')](_0x264438['body']):_0xd253('0x67'));return respondWithRpcPromise(_0xd253('0x68'),_0xd253('0x69'),_0x308557);}return null;})[_0xd253('0x32')](function(_0x216267){var _0x5dc0ee=_0xd253('0x6a')+_0x216267[_0xd253('0x24')][_0xd253('0x6b')];return db[_0xd253('0x6c')][_0xd253('0x40')](_0x5dc0ee,{'type':db['Sequelize'][_0xd253('0x6d')]['SELECT'],'raw':!![]})[_0xd253('0x32')](function(_0x2e5c8a){return _0x2e5c8a;});})[_0xd253('0x32')](function(_0x2448a0){if(_0x2448a0){_0x308557[_0xd253('0x24')]['contact']=_0x2448a0[0x0];if(!_0x264438[_0xd253('0x56')][_0xd253('0x5e')])return;return db[_0xd253('0x6e')][_0xd253('0x54')]({'where':{'id':_0x264438[_0xd253('0x56')][_0xd253('0x5e')],'role':_0xd253('0x60')},'attributes':['id',_0xd253('0x35'),_0xd253('0x6f'),_0xd253('0x70'),'internal'],'raw':!![]});}return null;})[_0xd253('0x32')](function(_0x39f4ab){if(!_0x39f4ab)return null;_0x308557['message'][_0xd253('0x60')]=_0x39f4ab;return _0x308557;})[_0xd253('0x32')](function(_0x428618){if(_0x428618){if(_0x264438[_0xd253('0x56')]['manual']){_0x308557[_0xd253('0x24')]['interface']=util[_0xd253('0x5c')](_0xd253('0x71'),_0x264438[_0xd253('0x5f')][_0xd253('0x35')]);_0x308557[_0xd253('0x24')]['channel']=_0x308557[_0xd253('0x72')];_0x308557[_0xd253('0x24')][_0xd253('0x73')]=_0x308557['channel'];_0x308557['message']['event']=_0xd253('0x58');return respondWithRpcPromise(_0xd253('0x74'),_0xd253('0x74'),{'event':_0xd253('0x75'),'message':_0x308557[_0xd253('0x24')]},client9002)['then'](function(){return _0x308557;});}return _0x308557;}return null;})[_0xd253('0x32')](respondWithResult(_0xf7cadc,null))[_0xd253('0x26')](handleError(_0xf7cadc,null));};var interaction_log=require(_0xd253('0x11'))('sms-interactions');exports[_0xd253('0x30')]=function(_0x5ae835,_0x6cd92d,_0x31db11){var _0x805e05={'agent':{},'channel':_0xd253('0x59')};if(_0x5ae835[_0xd253('0x56')]['id']){delete _0x5ae835['body']['id'];}_0x5ae835['body'][_0xd253('0x5e')]=_0x5ae835[_0xd253('0x56')][_0xd253('0x5e')]||_0x5ae835['user']['id'];_0x805e05[_0xd253('0x60')]['id']=_0x5ae835[_0xd253('0x56')][_0xd253('0x5e')];return db[_0xd253('0x39')][_0xd253('0x54')]({'where':{'id':_0x5ae835[_0xd253('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x6cd92d,null))[_0xd253('0x32')](function(_0x1f9f34){if(_0x1f9f34){_0x805e05['message']=_0x1f9f34[_0xd253('0x65')]({'plain':!![]});return db[_0xd253('0x61')][_0xd253('0x54')]({'where':{'id':_0x1f9f34['SmsInteractionId']}});}return null;})[_0xd253('0x32')](handleEntityNotFound(_0x6cd92d,null))[_0xd253('0x32')](function(_0xd2089){if(_0xd2089){_0x805e05[_0xd253('0x64')]=_0xd2089[_0xd253('0x65')]({'plain':!![]});interaction_log[_0xd253('0x1e')](_0xd253('0x76'),_0x5ae835['user']['id'],_0x5ae835['user'][_0xd253('0x35')],_0x5ae835[_0xd253('0x5f')][_0xd253('0x66')],_0x805e05['interaction']['id'],_0x5ae835[_0xd253('0x56')]?JSON['stringify'](_0x5ae835[_0xd253('0x56')]):_0xd253('0x67'));return respondWithRpcPromise(_0xd253('0x77'),_0xd253('0x78'),_0x805e05);}return null;})['then'](function(_0x1ad8aa){var _0x484128='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1ad8aa[_0xd253('0x24')]['ContactId'];return db[_0xd253('0x6c')][_0xd253('0x40')](_0x484128,{'type':db[_0xd253('0x79')]['QueryTypes'][_0xd253('0x7a')],'raw':!![]})['then'](function(_0x4a6e27){return _0x4a6e27;});})[_0xd253('0x32')](function(_0x12e16f){if(_0x12e16f){_0x805e05['message'][_0xd253('0x7b')]=_0x12e16f[0x0];if(!_0x5ae835[_0xd253('0x56')][_0xd253('0x5e')])return;return db[_0xd253('0x6e')][_0xd253('0x54')]({'where':{'id':_0x5ae835[_0xd253('0x56')][_0xd253('0x5e')],'role':'agent'},'attributes':['id','name',_0xd253('0x6f'),_0xd253('0x70'),'internal'],'raw':!![]});}return null;})[_0xd253('0x32')](function(_0x26b00b){if(!_0x26b00b)return null;_0x805e05[_0xd253('0x24')][_0xd253('0x60')]=_0x26b00b;return _0x805e05;})[_0xd253('0x32')](function(_0x2d4251){if(_0x2d4251){_0x2d4251[_0xd253('0x24')][_0xd253('0x7c')]=util[_0xd253('0x5c')](_0xd253('0x71'),_0x5ae835[_0xd253('0x5f')][_0xd253('0x35')]);_0x2d4251[_0xd253('0x24')][_0xd253('0x72')]=_0x805e05['channel'];_0x2d4251[_0xd253('0x24')][_0xd253('0x73')]=_0x805e05[_0xd253('0x72')];_0x2d4251['message']['event']='reject';respondWithRpcPromise(_0xd253('0x74'),_0xd253('0x74'),{'event':_0xd253('0x7d'),'message':_0x2d4251[_0xd253('0x24')]},client9002);return _0x805e05;}return null;})['then'](respondWithResult(_0x6cd92d,null))[_0xd253('0x26')](handleError(_0x6cd92d,null));};exports['status']=function(_0x1f344b,_0x2cbf53,_0xc1f0ca){if(_0x1f344b[_0xd253('0x56')]['id']){delete _0x1f344b['body']['id'];}var _0xc5000;return db[_0xd253('0x39')]['find']({'where':{'id':_0x1f344b['params']['id']}})[_0xd253('0x32')](handleEntityNotFound(_0x2cbf53,null))['then'](function(_0x40b770){if(_0x40b770){_0xc5000=_0x40b770;return db[_0xd253('0x7e')][_0xd253('0x54')]({'where':{'id':_0x40b770[_0xd253('0x7f')]}});}})['then'](handleEntityNotFound(_0x2cbf53,null))['then'](function(_0x4ea468){if(_0x4ea468){logger[_0xd253('0x1f')](_0xd253('0x80'),'status',_0xd253('0x81'),_0x4ea468['type'],util[_0xd253('0x82')](_0x1f344b[_0xd253('0x56')],{'showHidden':![],'depth':null}));switch(_0x4ea468[_0xd253('0x3c')]){case _0xd253('0x83'):if(_0x1f344b[_0xd253('0x56')]['MessageSid']&&_0x1f344b[_0xd253('0x56')][_0xd253('0x84')]===_0xc5000[_0xd253('0x85')]){return _0xc5000[_0xd253('0x31')]({'read':!![]});}else{logger[_0xd253('0x21')](_0xd253('0x86'),'status','twilio',util[_0xd253('0x82')](_0x1f344b[_0xd253('0x56')],{'showHidden':![],'depth':null}));}break;case _0xd253('0x87'):if(_0x1f344b[_0xd253('0x56')][_0xd253('0x88')]&&_0x1f344b[_0xd253('0x56')][_0xd253('0x88')]===_0xc5000[_0xd253('0x85')]&&_[_0xd253('0x89')]([_0xd253('0x8a'),_0xd253('0x8b')],_0x1f344b[_0xd253('0x56')][_0xd253('0x8c')])>=0x0){return _0xc5000[_0xd253('0x31')]({'read':!![]});}else{logger[_0xd253('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd253('0x28'),_0xd253('0x8d'),util[_0xd253('0x82')](_0x1f344b[_0xd253('0x56')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x364396=_0x1f344b['body'][_0xd253('0x8e')][0x0];if(_0x364396[_0xd253('0x28')][_0xd253('0x8f')]===_0xd253('0x90')){return _0xc5000['update']({'read':!![]});}else{logger[_0xd253('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xd253('0x91'),util['inspect'](_0x1f344b[_0xd253('0x56')],{'showHidden':![],'depth':null}));}break;}return _0xc5000;}})['then'](respondWithResult(_0x2cbf53,null))[_0xd253('0x26')](handleError(_0x2cbf53,null));};
\ No newline at end of file
+var _0x96be=['inspect','MessageSid','messageId','twilio','plivo','MessageUUID','delivered','Status','results','groupName','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','code','error','message','SmsMessage,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','update','end','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','destroy','describe','sms','read','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','get','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','sms-interactions','params','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','fullname','format','event','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from'];(function(_0x4fc897,_0x489fee){var _0xf87d07=function(_0x473327){while(--_0x473327){_0x4fc897['push'](_0x4fc897['shift']());}};_0xf87d07(++_0x489fee);}(_0x96be,0x1c9));var _0xe96b=function(_0xf38355,_0x490f67){_0xf38355=_0xf38355-0x0;var _0x44c3d1=_0x96be[_0xf38355];return _0x44c3d1;};'use strict';var emlformat=require(_0xe96b('0x0'));var rimraf=require(_0xe96b('0x1'));var zipdir=require(_0xe96b('0x2'));var jsonpatch=require(_0xe96b('0x3'));var rp=require(_0xe96b('0x4'));var moment=require(_0xe96b('0x5'));var BPromise=require(_0xe96b('0x6'));var Mustache=require(_0xe96b('0x7'));var util=require(_0xe96b('0x8'));var path=require(_0xe96b('0x9'));var sox=require(_0xe96b('0xa'));var csv=require(_0xe96b('0xb'));var ejs=require(_0xe96b('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe96b('0xd'));var deskjs=require(_0xe96b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe96b('0xf'));var authService=require(_0xe96b('0x10'));var qs=require(_0xe96b('0x11'));var as=require(_0xe96b('0x12'));var hardwareService=require(_0xe96b('0x13'));var logger=require(_0xe96b('0x14'))(_0xe96b('0x15'));var utils=require(_0xe96b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe96b('0x17'));var db=require(_0xe96b('0x18'))['db'];config[_0xe96b('0x19')]=_[_0xe96b('0x1a')](config[_0xe96b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe96b('0x1b'))(new Redis(config[_0xe96b('0x19')]));require('./smsMessage.socket')[_0xe96b('0x1c')](socket);var jayson=require(_0xe96b('0x1d'));var client=jayson[_0xe96b('0x1e')][_0xe96b('0x1f')]({'port':0x232c});var client9002=jayson[_0xe96b('0x1e')][_0xe96b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5b454c,_0x44258a,_0x18686b,_0x1fe92f){return new BPromise(function(_0x189296,_0x55bbe1){var _0x43c406=_0x1fe92f||client;return _0x43c406['request'](_0x5b454c,_0x18686b)[_0xe96b('0x20')](function(_0x3216c5){logger['info']('SmsMessage,\x20%s,\x20%s',_0x44258a,_0xe96b('0x21'));logger[_0xe96b('0x22')](_0xe96b('0x23'),_0x44258a,_0xe96b('0x21'),JSON['stringify'](_0x3216c5));if(_0x3216c5['error']){if(_0x3216c5['error'][_0xe96b('0x24')]===0x1f4){logger[_0xe96b('0x25')]('SmsMessage,\x20%s,\x20%s',_0x44258a,_0x3216c5[_0xe96b('0x25')][_0xe96b('0x26')]);return _0x55bbe1(_0x3216c5[_0xe96b('0x25')][_0xe96b('0x26')]);}logger['error'](_0xe96b('0x27'),_0x44258a,_0x3216c5[_0xe96b('0x25')][_0xe96b('0x26')]);return _0x189296(_0x3216c5[_0xe96b('0x25')][_0xe96b('0x26')]);}else{logger['info'](_0xe96b('0x27'),_0x44258a,_0xe96b('0x21'));_0x189296(_0x3216c5[_0xe96b('0x28')][_0xe96b('0x26')]);}})[_0xe96b('0x29')](function(_0x26e01a){logger['error']('SmsMessage,\x20%s,\x20%s',_0x44258a,_0x26e01a);_0x55bbe1(_0x26e01a);});});}function respondWithStatusCode(_0x81e434,_0x5e5f88){_0x5e5f88=_0x5e5f88||0xcc;return function(_0x4d0607){if(_0x4d0607){return _0x81e434[_0xe96b('0x2a')](_0x5e5f88);}return _0x81e434['status'](_0x5e5f88)['end']();};}function respondWithResult(_0x599cce,_0x215ea4){_0x215ea4=_0x215ea4||0xc8;return function(_0x5dfd36){if(_0x5dfd36){return _0x599cce[_0xe96b('0x2b')](_0x215ea4)[_0xe96b('0x2c')](_0x5dfd36);}};}function respondWithFilteredResult(_0xff6a97,_0x58d494){return function(_0x2580b7){if(_0x2580b7){var _0x2b78a9=typeof _0x58d494[_0xe96b('0x2d')]===_0xe96b('0x2e')&&typeof _0x58d494['limit']===_0xe96b('0x2e');var _0x5ef5a0=_0x2580b7[_0xe96b('0x2f')];var _0x577cf0=_0x2b78a9?0x0:_0x58d494[_0xe96b('0x2d')];var _0x2af3a5=_0x2b78a9?_0x2580b7['count']:_0x58d494[_0xe96b('0x2d')]+_0x58d494['limit'];var _0x5e9ae0;if(_0x2af3a5>=_0x5ef5a0){_0x2af3a5=_0x5ef5a0;_0x5e9ae0=0xc8;}else{_0x5e9ae0=0xce;}_0xff6a97['status'](_0x5e9ae0);return _0xff6a97[_0xe96b('0x30')](_0xe96b('0x31'),_0x577cf0+'-'+_0x2af3a5+'/'+_0x5ef5a0)[_0xe96b('0x2c')](_0x2580b7);}return null;};}function patchUpdates(_0x154a18){return function(_0x2cd30b){try{jsonpatch['apply'](_0x2cd30b,_0x154a18,!![]);}catch(_0x43be3d){return BPromise[_0xe96b('0x32')](_0x43be3d);}return _0x2cd30b['save']();};}function saveUpdates(_0x1de83b,_0x22c7b4){return function(_0x5e6f13){if(_0x5e6f13){return _0x5e6f13[_0xe96b('0x33')](_0x1de83b)[_0xe96b('0x20')](function(_0x241501){return _0x241501;});}return null;};}function removeEntity(_0x4d45e7,_0x2be03d){return function(_0x3fceda){if(_0x3fceda){return _0x3fceda['destroy']()[_0xe96b('0x20')](function(){_0x4d45e7[_0xe96b('0x2b')](0xcc)[_0xe96b('0x34')]();});}};}function handleEntityNotFound(_0xefcac1,_0x5245e9){return function(_0x189221){if(!_0x189221){_0xefcac1['sendStatus'](0x194);}return _0x189221;};}function handleError(_0x5a58a4,_0x21d5ba){_0x21d5ba=_0x21d5ba||0x1f4;return function(_0x55ed3e){logger['error'](_0x55ed3e[_0xe96b('0x35')]);if(_0x55ed3e[_0xe96b('0x36')]){delete _0x55ed3e[_0xe96b('0x36')];}_0x5a58a4['status'](_0x21d5ba)[_0xe96b('0x37')](_0x55ed3e);};}exports[_0xe96b('0x38')]=function(_0x2761b4,_0x2a65b1){var _0xeb8f29={},_0x44af63={},_0x51083e={'count':0x0,'rows':[]};var _0x136e43=_[_0xe96b('0x39')](db[_0xe96b('0x3a')][_0xe96b('0x3b')],function(_0x576082){return{'name':_0x576082[_0xe96b('0x3c')],'type':_0x576082[_0xe96b('0x3d')]['key']};});_0x44af63[_0xe96b('0x3e')]=_[_0xe96b('0x39')](_0x136e43,_0xe96b('0x36'));_0x44af63['query']=_[_0xe96b('0x3f')](_0x2761b4[_0xe96b('0x40')]);_0x44af63[_0xe96b('0x41')]=_[_0xe96b('0x42')](_0x44af63[_0xe96b('0x3e')],_0x44af63[_0xe96b('0x40')]);_0xeb8f29[_0xe96b('0x43')]=_[_0xe96b('0x42')](_0x44af63[_0xe96b('0x3e')],qs[_0xe96b('0x44')](_0x2761b4['query'][_0xe96b('0x44')]));_0xeb8f29[_0xe96b('0x43')]=_0xeb8f29[_0xe96b('0x43')][_0xe96b('0x45')]?_0xeb8f29[_0xe96b('0x43')]:_0x44af63[_0xe96b('0x3e')];if(!_0x2761b4[_0xe96b('0x40')][_0xe96b('0x46')](_0xe96b('0x47'))){_0xeb8f29[_0xe96b('0x48')]=qs[_0xe96b('0x48')](_0x2761b4[_0xe96b('0x40')][_0xe96b('0x48')]);_0xeb8f29[_0xe96b('0x2d')]=qs[_0xe96b('0x2d')](_0x2761b4[_0xe96b('0x40')][_0xe96b('0x2d')]);}_0xeb8f29['order']=qs[_0xe96b('0x49')](_0x2761b4[_0xe96b('0x40')][_0xe96b('0x49')]);_0xeb8f29[_0xe96b('0x4a')]=qs[_0xe96b('0x41')](_[_0xe96b('0x4b')](_0x2761b4['query'],_0x44af63[_0xe96b('0x41')]),_0x136e43);if(_0x2761b4[_0xe96b('0x40')][_0xe96b('0x4c')]){_0xeb8f29['where']=_[_0xe96b('0x4d')](_0xeb8f29[_0xe96b('0x4a')],{'$or':_[_0xe96b('0x39')](_0x136e43,function(_0xff5da8){if(_0xff5da8[_0xe96b('0x3d')]!==_0xe96b('0x4e')){var _0x14a30c={};_0x14a30c[_0xff5da8['name']]={'$like':'%'+_0x2761b4[_0xe96b('0x40')][_0xe96b('0x4c')]+'%'};return _0x14a30c;}})});}_0xeb8f29=_[_0xe96b('0x4d')]({},_0xeb8f29,_0x2761b4[_0xe96b('0x4f')]);var _0x893c52={'where':_0xeb8f29[_0xe96b('0x4a')]};return db['SmsMessage']['count'](_0x893c52)[_0xe96b('0x20')](function(_0x5d563a){_0x51083e[_0xe96b('0x2f')]=_0x5d563a;if(_0x2761b4[_0xe96b('0x40')][_0xe96b('0x50')]){_0xeb8f29[_0xe96b('0x51')]=[{'all':!![]}];}return db[_0xe96b('0x3a')][_0xe96b('0x52')](_0xeb8f29);})[_0xe96b('0x20')](function(_0x1cb439){_0x51083e[_0xe96b('0x53')]=_0x1cb439;return _0x51083e;})['then'](respondWithFilteredResult(_0x2a65b1,_0xeb8f29))[_0xe96b('0x29')](handleError(_0x2a65b1,null));};exports[_0xe96b('0x54')]=function(_0x3b7805,_0x51e2a3){var _0xf9888c={'raw':!![],'where':{'id':_0x3b7805['params']['id']}},_0x2d3d7a={};_0x2d3d7a[_0xe96b('0x3e')]=_[_0xe96b('0x3f')](db[_0xe96b('0x3a')][_0xe96b('0x3b')]);_0x2d3d7a['query']=_['keys'](_0x3b7805[_0xe96b('0x40')]);_0x2d3d7a[_0xe96b('0x41')]=_[_0xe96b('0x42')](_0x2d3d7a[_0xe96b('0x3e')],_0x2d3d7a[_0xe96b('0x40')]);_0xf9888c[_0xe96b('0x43')]=_[_0xe96b('0x42')](_0x2d3d7a[_0xe96b('0x3e')],qs[_0xe96b('0x44')](_0x3b7805[_0xe96b('0x40')][_0xe96b('0x44')]));_0xf9888c[_0xe96b('0x43')]=_0xf9888c[_0xe96b('0x43')][_0xe96b('0x45')]?_0xf9888c[_0xe96b('0x43')]:_0x2d3d7a[_0xe96b('0x3e')];if(_0x3b7805[_0xe96b('0x40')]['includeAll']){_0xf9888c[_0xe96b('0x51')]=[{'all':!![]}];}_0xf9888c=_[_0xe96b('0x4d')]({},_0xf9888c,_0x3b7805[_0xe96b('0x4f')]);return db['SmsMessage'][_0xe96b('0x55')](_0xf9888c)[_0xe96b('0x20')](handleEntityNotFound(_0x51e2a3,null))['then'](respondWithResult(_0x51e2a3,null))[_0xe96b('0x29')](handleError(_0x51e2a3,null));};exports[_0xe96b('0x56')]=function(_0x2bf201,_0x4e4b09){return db[_0xe96b('0x3a')]['create'](_0x2bf201[_0xe96b('0x57')],{})[_0xe96b('0x20')](respondWithResult(_0x4e4b09,0xc9))['catch'](handleError(_0x4e4b09,null));};exports[_0xe96b('0x33')]=function(_0x15e920,_0xd60e71){if(_0x15e920[_0xe96b('0x57')]['id']){delete _0x15e920[_0xe96b('0x57')]['id'];}return db[_0xe96b('0x3a')][_0xe96b('0x55')]({'where':{'id':_0x15e920['params']['id']}})['then'](handleEntityNotFound(_0xd60e71,null))[_0xe96b('0x20')](saveUpdates(_0x15e920[_0xe96b('0x57')],null))['then'](respondWithResult(_0xd60e71,null))['catch'](handleError(_0xd60e71,null));};exports[_0xe96b('0x58')]=function(_0x2a4008,_0x11b4a0){return db[_0xe96b('0x3a')][_0xe96b('0x55')]({'where':{'id':_0x2a4008['params']['id']}})[_0xe96b('0x20')](handleEntityNotFound(_0x11b4a0,null))[_0xe96b('0x20')](removeEntity(_0x11b4a0,null))[_0xe96b('0x29')](handleError(_0x11b4a0,null));};exports[_0xe96b('0x59')]=function(_0x11d55c,_0x500f59){return db['SmsMessage']['describe']()[_0xe96b('0x20')](respondWithResult(_0x500f59,null))[_0xe96b('0x29')](handleError(_0x500f59,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports['accept']=function(_0x557c6a,_0xa8fecb,_0x18eaed){var _0x43f519={'agent':{},'channel':_0xe96b('0x5a')};if(_0x557c6a[_0xe96b('0x57')]['id']){delete _0x557c6a[_0xe96b('0x57')]['id'];}_0x557c6a['body'][_0xe96b('0x5b')]=!![];_0x557c6a['body']['readAt']=moment()['format'](_0xe96b('0x5c'));_0x557c6a[_0xe96b('0x57')]['UserId']=_0x557c6a[_0xe96b('0x57')][_0xe96b('0x5d')]||_0x557c6a['user']['id'];_0x43f519[_0xe96b('0x5e')]['id']=_0x557c6a[_0xe96b('0x57')][_0xe96b('0x5d')];return db[_0xe96b('0x3a')][_0xe96b('0x55')]({'where':{'id':_0x557c6a['params']['id'],'UserId':null}})[_0xe96b('0x20')](handleEntityNotFound(_0xa8fecb,null))[_0xe96b('0x20')](saveUpdates(_0x557c6a[_0xe96b('0x57')],null))['then'](function(_0xd6cb3a){if(_0xd6cb3a){_0x43f519[_0xe96b('0x26')]=_0xd6cb3a['get']({'plain':!![]});return db[_0xe96b('0x5f')][_0xe96b('0x55')]({'where':{'id':_0xd6cb3a[_0xe96b('0x60')]}});}return null;})[_0xe96b('0x20')](handleEntityNotFound(_0xa8fecb,null))[_0xe96b('0x20')](function(_0x2ea37b){if(_0x2ea37b){return _0x2ea37b[_0xe96b('0x33')]({'UserId':_0x557c6a[_0xe96b('0x57')][_0xe96b('0x5d')],'read1stAt':_[_0xe96b('0x61')](_0x2ea37b[_0xe96b('0x62')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe96b('0x20')](function(_0x302bc7){if(_0x302bc7){_0x43f519['interaction']=_0x302bc7[_0xe96b('0x63')]({'plain':!![]});interaction_log[_0xe96b('0x64')](_0xe96b('0x65'),_0x557c6a[_0xe96b('0x66')]['id'],_0x557c6a[_0xe96b('0x66')][_0xe96b('0x36')],_0x557c6a['user']['role'],_0x43f519[_0xe96b('0x67')]['id'],_0x557c6a[_0xe96b('0x57')]?JSON[_0xe96b('0x68')](_0x557c6a[_0xe96b('0x57')]):_0xe96b('0x69'));return respondWithRpcPromise(_0xe96b('0x6a'),_0xe96b('0x6b'),_0x43f519);}return null;})[_0xe96b('0x20')](function(_0x4bd405){var _0x1c69aa=_0xe96b('0x6c')+_0x4bd405[_0xe96b('0x26')]['ContactId'];return db[_0xe96b('0x6d')]['query'](_0x1c69aa,{'type':db['Sequelize'][_0xe96b('0x6e')][_0xe96b('0x6f')],'raw':!![]})[_0xe96b('0x20')](function(_0x201acf){return _0x201acf;});})['then'](function(_0xee70e9){if(_0xee70e9){_0x43f519[_0xe96b('0x26')][_0xe96b('0x70')]=_0xee70e9[0x0];if(!_0x557c6a[_0xe96b('0x57')][_0xe96b('0x5d')])return;return db[_0xe96b('0x71')][_0xe96b('0x55')]({'where':{'id':_0x557c6a['body']['UserId'],'role':_0xe96b('0x5e')},'attributes':['id',_0xe96b('0x36'),'fullname','email',_0xe96b('0x72')],'raw':!![]});}return null;})[_0xe96b('0x20')](function(_0x458c29){if(!_0x458c29)return null;_0x43f519[_0xe96b('0x26')][_0xe96b('0x5e')]=_0x458c29;return _0x43f519;})[_0xe96b('0x20')](function(_0x4cd2f6){if(_0x4cd2f6){if(_0x557c6a[_0xe96b('0x57')][_0xe96b('0x73')]){_0x43f519['message'][_0xe96b('0x74')]=util['format'](_0xe96b('0x75'),_0x557c6a[_0xe96b('0x66')][_0xe96b('0x36')]);_0x43f519['message'][_0xe96b('0x76')]=_0x43f519[_0xe96b('0x76')];_0x43f519['message'][_0xe96b('0x77')]=_0x43f519[_0xe96b('0x76')];_0x43f519[_0xe96b('0x26')]['event']=_0xe96b('0x78');return respondWithRpcPromise(_0xe96b('0x79'),'EventManager',{'event':_0xe96b('0x7a'),'message':_0x43f519[_0xe96b('0x26')]},client9002)[_0xe96b('0x20')](function(){return _0x43f519;});}return _0x43f519;}return null;})[_0xe96b('0x20')](respondWithResult(_0xa8fecb,null))[_0xe96b('0x29')](handleError(_0xa8fecb,null));};var interaction_log=require(_0xe96b('0x14'))(_0xe96b('0x7b'));exports[_0xe96b('0x32')]=function(_0x1717dc,_0x20a841,_0x424b65){var _0x2ab51c={'agent':{},'channel':'sms'};if(_0x1717dc[_0xe96b('0x57')]['id']){delete _0x1717dc[_0xe96b('0x57')]['id'];}_0x1717dc[_0xe96b('0x57')][_0xe96b('0x5d')]=_0x1717dc[_0xe96b('0x57')]['UserId']||_0x1717dc[_0xe96b('0x66')]['id'];_0x2ab51c[_0xe96b('0x5e')]['id']=_0x1717dc[_0xe96b('0x57')][_0xe96b('0x5d')];return db[_0xe96b('0x3a')]['find']({'where':{'id':_0x1717dc[_0xe96b('0x7c')]['id'],'UserId':null}})[_0xe96b('0x20')](handleEntityNotFound(_0x20a841,null))[_0xe96b('0x20')](function(_0x652f67){if(_0x652f67){_0x2ab51c['message']=_0x652f67[_0xe96b('0x63')]({'plain':!![]});return db[_0xe96b('0x5f')][_0xe96b('0x55')]({'where':{'id':_0x652f67[_0xe96b('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x20a841,null))[_0xe96b('0x20')](function(_0x176dc2){if(_0x176dc2){_0x2ab51c[_0xe96b('0x67')]=_0x176dc2[_0xe96b('0x63')]({'plain':!![]});interaction_log[_0xe96b('0x64')](_0xe96b('0x7d'),_0x1717dc[_0xe96b('0x66')]['id'],_0x1717dc[_0xe96b('0x66')][_0xe96b('0x36')],_0x1717dc['user']['role'],_0x2ab51c[_0xe96b('0x67')]['id'],_0x1717dc['body']?JSON['stringify'](_0x1717dc[_0xe96b('0x57')]):'null');return respondWithRpcPromise(_0xe96b('0x7e'),_0xe96b('0x7f'),_0x2ab51c);}return null;})[_0xe96b('0x20')](function(_0x21f339){var _0x433f4f=_0xe96b('0x6c')+_0x21f339[_0xe96b('0x26')][_0xe96b('0x80')];return db[_0xe96b('0x6d')]['query'](_0x433f4f,{'type':db['Sequelize'][_0xe96b('0x6e')][_0xe96b('0x6f')],'raw':!![]})[_0xe96b('0x20')](function(_0x52253f){return _0x52253f;});})[_0xe96b('0x20')](function(_0x5f77d8){if(_0x5f77d8){_0x2ab51c[_0xe96b('0x26')][_0xe96b('0x70')]=_0x5f77d8[0x0];if(!_0x1717dc['body'][_0xe96b('0x5d')])return;return db['User'][_0xe96b('0x55')]({'where':{'id':_0x1717dc['body'][_0xe96b('0x5d')],'role':_0xe96b('0x5e')},'attributes':['id','name',_0xe96b('0x81'),'email',_0xe96b('0x72')],'raw':!![]});}return null;})[_0xe96b('0x20')](function(_0x3ba0be){if(!_0x3ba0be)return null;_0x2ab51c['message'][_0xe96b('0x5e')]=_0x3ba0be;return _0x2ab51c;})[_0xe96b('0x20')](function(_0x14f15d){if(_0x14f15d){_0x14f15d[_0xe96b('0x26')]['interface']=util[_0xe96b('0x82')](_0xe96b('0x75'),_0x1717dc[_0xe96b('0x66')][_0xe96b('0x36')]);_0x14f15d[_0xe96b('0x26')][_0xe96b('0x76')]=_0x2ab51c['channel'];_0x14f15d[_0xe96b('0x26')]['motionChannel']=_0x2ab51c[_0xe96b('0x76')];_0x14f15d[_0xe96b('0x26')][_0xe96b('0x83')]=_0xe96b('0x32');respondWithRpcPromise(_0xe96b('0x79'),'EventManager',{'event':'rejectmessage','message':_0x14f15d[_0xe96b('0x26')]},client9002);return _0x2ab51c;}return null;})[_0xe96b('0x20')](respondWithResult(_0x20a841,null))[_0xe96b('0x29')](handleError(_0x20a841,null));};exports['status']=function(_0x3a740e,_0x2b2a22,_0x5956a8){if(_0x3a740e[_0xe96b('0x57')]['id']){delete _0x3a740e[_0xe96b('0x57')]['id'];}var _0x23f5ce;return db['SmsMessage'][_0xe96b('0x55')]({'where':{'id':_0x3a740e[_0xe96b('0x7c')]['id']}})[_0xe96b('0x20')](handleEntityNotFound(_0x2b2a22,null))[_0xe96b('0x20')](function(_0x572f4e){if(_0x572f4e){_0x23f5ce=_0x572f4e;return db[_0xe96b('0x84')]['find']({'where':{'id':_0x572f4e[_0xe96b('0x85')]}});}})['then'](handleEntityNotFound(_0x2b2a22,null))[_0xe96b('0x20')](function(_0x57bee0){if(_0x57bee0){logger[_0xe96b('0x22')](_0xe96b('0x23'),_0xe96b('0x2b'),_0xe96b('0x86'),_0x57bee0[_0xe96b('0x3d')],util[_0xe96b('0x87')](_0x3a740e[_0xe96b('0x57')],{'showHidden':![],'depth':null}));switch(_0x57bee0[_0xe96b('0x3d')]){case'twilio':if(_0x3a740e[_0xe96b('0x57')][_0xe96b('0x88')]&&_0x3a740e[_0xe96b('0x57')][_0xe96b('0x88')]===_0x23f5ce[_0xe96b('0x89')]){return _0x23f5ce[_0xe96b('0x33')]({'read':!![]});}else{logger[_0xe96b('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe96b('0x2b'),_0xe96b('0x8a'),util['inspect'](_0x3a740e[_0xe96b('0x57')],{'showHidden':![],'depth':null}));}break;case _0xe96b('0x8b'):if(_0x3a740e[_0xe96b('0x57')][_0xe96b('0x8c')]&&_0x3a740e['body'][_0xe96b('0x8c')]===_0x23f5ce['messageId']&&_['indexOf'](['sent',_0xe96b('0x8d')],_0x3a740e[_0xe96b('0x57')][_0xe96b('0x8e')])>=0x0){return _0x23f5ce[_0xe96b('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe96b('0x2b'),'plivio',util[_0xe96b('0x87')](_0x3a740e[_0xe96b('0x57')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5d83ff=_0x3a740e[_0xe96b('0x57')][_0xe96b('0x8f')][0x0];if(_0x5d83ff[_0xe96b('0x2b')][_0xe96b('0x90')]===_0xe96b('0x91')){return _0x23f5ce[_0xe96b('0x33')]({'read':!![]});}else{logger['error'](_0xe96b('0x92'),_0xe96b('0x2b'),_0xe96b('0x93'),util['inspect'](_0x3a740e[_0xe96b('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x23f5ce;}})[_0xe96b('0x20')](respondWithResult(_0x2b2a22,null))[_0xe96b('0x29')](handleError(_0x2b2a22,null));};
\ No newline at end of file
index a0539ad..ecda79b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd403=['exports','events','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x5bd626,_0xdbf46d){var _0x2661ca=function(_0x421ff4){while(--_0x421ff4){_0x5bd626['push'](_0x5bd626['shift']());}};_0x2661ca(++_0xdbf46d);}(_0xd403,0xf1));var _0x3d40=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xd403[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require(_0x3d40('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x3d40('0x1')](0x0);var events={'afterCreate':_0x3d40('0x2'),'afterUpdate':_0x3d40('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2c758d){return function(_0x391adf,_0x42ce54,_0x43de0b){SmsMessageEvents['emit'](_0x2c758d+':'+_0x391adf['id'],_0x391adf);SmsMessageEvents[_0x3d40('0x4')](_0x2c758d,_0x391adf);_0x43de0b(null);};}for(var e in events){if(events[_0x3d40('0x5')](e)){var event=events[e];SmsMessage[_0x3d40('0x6')](e,emitEvent(event));}}module[_0x3d40('0x7')]=SmsMessageEvents;
\ No newline at end of file
+var _0x3225=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x5e726a,_0x2c08dd){var _0x75b2a3=function(_0x1a64db){while(--_0x1a64db){_0x5e726a['push'](_0x5e726a['shift']());}};_0x75b2a3(++_0x2c08dd);}(_0x3225,0x7f));var _0x5322=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3225[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5322('0x0'));var SmsMessage=require(_0x5322('0x1'))['db'][_0x5322('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5322('0x3')](0x0);var events={'afterCreate':_0x5322('0x4'),'afterUpdate':_0x5322('0x5'),'afterDestroy':_0x5322('0x6')};function emitEvent(_0x342038){return function(_0xeec95f,_0x268915,_0x15e350){SmsMessageEvents[_0x5322('0x7')](_0x342038+':'+_0xeec95f['id'],_0xeec95f);SmsMessageEvents[_0x5322('0x7')](_0x342038,_0xeec95f);_0x15e350(null);};}for(var e in events){if(events[_0x5322('0x8')](e)){var event=events[e];SmsMessage[_0x5322('0x9')](e,emitEvent(event));}}module[_0x5322('0xa')]=SmsMessageEvents;
\ No newline at end of file
index 3e487d8..69c6244 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6308=['UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','get','direction','toLowerCase','isNil','UserId','findOne','then','update','catch','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','body','phone','remote','/api/sms/messages/','/status?token=','sid','afterCreate','inspect','error','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','split','sms','user_key','session_key','total_sent','deliveryReport','read','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','messages','csc','crypto','apiKey','login','timestamp','sort','length','createHash','md5','digest','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','uuid'];(function(_0x53d05e,_0x3ec9c6){var _0x106788=function(_0xe35d14){while(--_0xe35d14){_0x53d05e['push'](_0x53d05e['shift']());}};_0x106788(++_0x3ec9c6);}(_0x6308,0x1f2));var _0x8630=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x6308[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x8630('0x0'));var util=require('util');var logger=require(_0x8630('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8630('0x2'));var rp=require(_0x8630('0x3'));var fs=require('fs');var path=require(_0x8630('0x4'));var rimraf=require(_0x8630('0x5'));var config=require(_0x8630('0x6'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x1d62c8,_0x571543){return _0x1d62c8[_0x8630('0x7')](_0x8630('0x8'),attributes,{'tableName':_0x8630('0x9'),'paranoid':![],'indexes':[{'name':_0x8630('0xa'),'fields':[_0x8630('0xa')]},{'name':_0x8630('0xb'),'fields':['body'],'type':_0x8630('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5726fd,_0x3dc3c8,_0x399bb0){var _0x2155fd=_0x1d62c8['models'];var _0x37219b=_0x5726fd[_0x8630('0xd')]({'plain':!![]});if(_0x37219b[_0x8630('0xe')]['toLowerCase']()==='in'||_0x37219b[_0x8630('0xe')][_0x8630('0xf')]()==='out'&&!_0x37219b['secret']&&!_[_0x8630('0x10')](_0x37219b[_0x8630('0x11')])){_0x2155fd['SmsInteraction'][_0x8630('0x12')]({'where':{'id':_0x37219b['SmsInteractionId']}})[_0x8630('0x13')](function(_0x4cc542){if(_0x4cc542){_0x4cc542[_0x8630('0x14')]({'lastMsgAt':_0x37219b['createdAt'],'lastMsgDirection':_0x37219b['direction'][_0x8630('0xf')]()});}})[_0x8630('0x15')](function(_0x49fce1){console['error'](_0x49fce1);});}if(_0x37219b[_0x8630('0xe')]==='out'&&!_0x37219b[_0x8630('0x16')]){var _0x18a874;_0x2155fd[_0x8630('0x17')][_0x8630('0x18')]({'where':{'id':_0x37219b[_0x8630('0x19')]},'raw':!![]})[_0x8630('0x13')](function(_0x4356b9){_0x18a874=_0x4356b9;if(_0x18a874&&_0x18a874[_0x8630('0x1a')]){switch(_0x18a874[_0x8630('0x1a')]){case'twilio':var _0x59bda7=require(_0x8630('0x1b'));if(_0x18a874[_0x8630('0x1c')]&&_0x18a874['authToken']&&_0x18a874['phone']){var _0x1325dc=new _0x59bda7(_0x18a874[_0x8630('0x1c')],_0x18a874[_0x8630('0x1d')]);_0x1325dc['messages']['create']({'body':_0x37219b[_0x8630('0x1e')],'to':_0x37219b['phone'],'from':_0x18a874[_0x8630('0x1f')],'statusCallback':_0x18a874[_0x8630('0x20')]+_0x8630('0x21')+_0x37219b['id']+_0x8630('0x22')+_0x18a874['token']})[_0x8630('0x13')](function(_0xf24c11){if(_0xf24c11[_0x8630('0x23')]){return _0x5726fd[_0x8630('0x14')]({'messageId':_0xf24c11[_0x8630('0x23')]});}})[_0x8630('0x15')](function(_0x37b7aa){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8630('0x24'),_0x8630('0x1b'),util[_0x8630('0x25')](_0x37b7aa,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x1b'),_0x8630('0x28'));}break;case _0x8630('0x29'):var _0x357c15=_0x8630('0x2a');if(_0x18a874[_0x8630('0x2b')]&&_0x18a874[_0x8630('0x2c')]){var _0x4285ee={'recipient':[_0x37219b[_0x8630('0x1f')]],'message':_0x37219b[_0x8630('0x1e')],'message_type':_0x18a874[_0x8630('0x2d')]};if(_0x18a874['smsMethod']&&_0x18a874[_0x8630('0x2d')]!=='SI'){_0x4285ee[_0x8630('0x2e')]=_0x18a874[_0x8630('0x1f')];}var _0x104491={'url':_0x357c15+'login?username='+_0x18a874[_0x8630('0x2b')]+_0x8630('0x2f')+_0x18a874[_0x8630('0x2c')],'method':_0x8630('0x30')};rp(_0x104491)[_0x8630('0x13')](function(_0x32f4fd){var _0x534401=_0x32f4fd[_0x8630('0x31')](';');var _0x2121bd={'user_key':_0x534401[0x0],'session_key':_0x534401[0x1]};_0x104491={'url':_0x357c15+_0x8630('0x32'),'method':'POST','headers':{'user_key':_0x2121bd[_0x8630('0x33')],'Session_key':_0x2121bd[_0x8630('0x34')]},'json':!![],'body':_0x4285ee};return rp(_0x104491);})[_0x8630('0x13')](function(_0x235407){if(_0x235407[_0x8630('0x35')]>=0x1){var _0x3aae35={'messageId':_0x235407['internal_order_id']};if(_0x18a874[_0x8630('0x2d')]!=='GP'||!_0x18a874[_0x8630('0x36')]){_0x3aae35[_0x8630('0x37')]=!![];}return _0x5726fd[_0x8630('0x14')](_0x3aae35);}else{return logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x29'),util[_0x8630('0x25')](_0x235407,{'showHidden':![],'depth':null}));}})[_0x8630('0x15')](function(_0x396b2c){return logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x29'),util[_0x8630('0x25')](_0x396b2c,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8630('0x24'),_0x8630('0x29'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x18a874[_0x8630('0x1d')]){var _0x1d957c={'recipient':_0x37219b[_0x8630('0x1f')],'message':_0x37219b[_0x8630('0x1e')],'sender':_0x18a874[_0x8630('0x38')]||_0x18a874['phone'],'authorization':_0x18a874[_0x8630('0x1d')]};var _0x3dc3c8={'method':_0x8630('0x39'),'uri':_0x8630('0x3a'),'body':_0x1d957c,'json':!![]};rp(_0x3dc3c8)['then'](function(_0xac2876){var _0x437fde={'messageId':_0xac2876[_0x8630('0x3b')]};if(!_0x18a874[_0x8630('0x36')]){_0x437fde[_0x8630('0x37')]=!![];}return _0x5726fd[_0x8630('0x14')](_0x437fde);})[_0x8630('0x15')](function(_0x58ba3a){logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x3c'),util[_0x8630('0x25')](_0x58ba3a,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x3c'),_0x8630('0x3d'));}break;case'clicksend':if(_0x18a874[_0x8630('0x2b')]&&_0x18a874['password']){var _0x1d957c={'messages':[{'source':_0x8630('0x3e'),'to':_0x37219b[_0x8630('0x1f')],'body':_0x37219b[_0x8630('0x1e')],'from':_0x18a874[_0x8630('0x38')]||_0x18a874[_0x8630('0x1f')]}]};var _0x3c2db7=util[_0x8630('0x3f')](_0x8630('0x40'),_0x18a874[_0x8630('0x2b')],_0x18a874['password']);var _0x3dc3c8={'method':_0x8630('0x39'),'uri':_0x8630('0x41'),'body':_0x1d957c,'headers':{'Authorization':util[_0x8630('0x3f')](_0x8630('0x42'),new Buffer(_0x3c2db7)[_0x8630('0x43')]('base64'))},'json':!![]};rp(_0x3dc3c8)[_0x8630('0x13')](function(_0x186cc1){if(_0x186cc1[_0x8630('0x44')]>=0xc8&&_0x186cc1['http_code']<=0xce){if(_0x186cc1[_0x8630('0x45')]&&_0x186cc1[_0x8630('0x45')]['queued_count']>0x0){var _0x25d178=_[_0x8630('0x46')](_0x186cc1[_0x8630('0x45')]['messages']);var _0x4e439a={'messageId':_0x25d178[_0x8630('0x47')]};if(!_0x18a874['deliveryReport']){_0x4e439a['read']=!![];}return _0x5726fd[_0x8630('0x14')](_0x4e439a);}else{logger['error'](_0x8630('0x27'),_0x8630('0x24'),'clickSend',util[_0x8630('0x25')](_0x186cc1,{'showHidden':![],'depth':null}));}}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x48'),util['inspect'](_0x186cc1,{'showHidden':![],'depth':null}));}})[_0x8630('0x15')](function(_0x231289){logger['error'](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x48'),util['inspect'](_0x231289,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x48'),_0x8630('0x49'));}break;case _0x8630('0x4a'):if(_0x18a874[_0x8630('0x4b')]&&_0x18a874[_0x8630('0x1d')]){var _0x1d957c={'dst':_0x37219b['phone'],'text':_0x37219b['body'],'src':_0x18a874[_0x8630('0x38')]||_0x18a874[_0x8630('0x1f')],'url':_0x18a874[_0x8630('0x20')]+_0x8630('0x21')+_0x37219b['id']+_0x8630('0x22')+_0x18a874[_0x8630('0x4c')]};var _0x3c2db7=util['format'](_0x8630('0x40'),_0x18a874[_0x8630('0x4b')],_0x18a874[_0x8630('0x1d')]);var _0x3dc3c8={'method':_0x8630('0x39'),'uri':util['format'](_0x8630('0x4d'),_0x18a874[_0x8630('0x4b')]),'body':_0x1d957c,'headers':{'Authorization':util[_0x8630('0x3f')](_0x8630('0x42'),new Buffer(_0x3c2db7)['toString'](_0x8630('0x4e')))},'json':!![]};rp(_0x3dc3c8)[_0x8630('0x13')](function(_0x5b7391){var _0x2edc3d={'messageId':_0x5b7391[_0x8630('0x4f')][0x0]};return _0x5726fd[_0x8630('0x14')](_0x2edc3d);})[_0x8630('0x15')](function(_0x536e32){logger[_0x8630('0x26')](_0x8630('0x27'),'afterCreate','plivo',util[_0x8630('0x25')](_0x536e32,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8630('0x24'),'plivo',_0x8630('0x50'));}break;case _0x8630('0x51'):if(_0x18a874[_0x8630('0x2b')]&&_0x18a874['password']){if(_0x18a874[_0x8630('0x52')]){var _0x16eace={'method':_0x8630('0x39'),'uri':_0x18a874[_0x8630('0x52')]+_0x8630('0x53'),'body':{'username':_0x18a874[_0x8630('0x2b')],'password':_0x18a874[_0x8630('0x2c')]},'json':!![]};return rp(_0x16eace)['then'](function(_0x2d9303){var _0x1162fd={'method':_0x8630('0x39'),'uri':_0x18a874['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x18a874[_0x8630('0x1f')],'destinations':[{'to':_0x37219b['phone']}],'text':_0x37219b[_0x8630('0x1e')],'notifyUrl':_0x18a874[_0x8630('0x20')]+'/api/sms/messages/'+_0x37219b['id']+_0x8630('0x22')+_0x18a874[_0x8630('0x4c')],'notifyContentType':_0x8630('0x54'),'callbackData':_0x18a874[_0x8630('0x1f')]+';'+_0x37219b['body']}]},'headers':{'Authorization':_0x8630('0x55')+_0x2d9303[_0x8630('0x4c')]},'json':!![]};return rp(_0x1162fd)[_0x8630('0x13')](function(_0x540664){if(_0x540664['messages']){var _0x4d32ac={'messageId':_0x540664[_0x8630('0x56')][0x0][_0x8630('0xa')]};if(!_0x18a874[_0x8630('0x36')]){_0x4d32ac[_0x8630('0x37')]=!![];}return _0x5726fd[_0x8630('0x14')](_0x4d32ac);}else{return logger['error'](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x51'),util['inspect'](_0x540664,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x15b4aa){return logger[_0x8630('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8630('0x24'),'infobip',util[_0x8630('0x25')](_0x15b4aa,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x51'),'Missing\x20parameters:\x20base_url');}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8630('0x24'),_0x8630('0x51'),_0x8630('0x49'));}break;case _0x8630('0x57'):var _0xf8296e=require(_0x8630('0x58'));if(_0x18a874[_0x8630('0x59')]){var _0x2e7d3b={};_0x2e7d3b[_0x8630('0x5a')]=_0x18a874[_0x8630('0x2b')];_0x2e7d3b[_0x8630('0x1f')]=_0x37219b[_0x8630('0x1f')];_0x2e7d3b['sender']=_0x18a874[_0x8630('0x1f')];_0x2e7d3b['text']=_0x37219b[_0x8630('0x1e')];_0x2e7d3b[_0x8630('0x5b')]=+new Date();var _0x446f1a='';var _0x2d924d='';var _0x4beca1=Object['keys'](_0x2e7d3b);_0x4beca1[_0x8630('0x5c')]();for(var _0x1c074f=0x0;_0x1c074f<_0x4beca1[_0x8630('0x5d')];_0x1c074f++){if(_0x446f1a!=''){_0x446f1a+='&';}_0x446f1a+=_0x4beca1[_0x1c074f]+'='+encodeURIComponent(_0x2e7d3b[_0x4beca1[_0x1c074f]]);_0x2d924d+=_0x2e7d3b[_0x4beca1[_0x1c074f]];}_0x2d924d+=_0x18a874['apiKey'];_0x2d924d=_0xf8296e[_0x8630('0x5e')](_0x8630('0x5f'))['update'](_0x2d924d)[_0x8630('0x60')](_0x8630('0x61'));if(_0x446f1a!==''){_0x446f1a+='&';}_0x446f1a+=_0x8630('0x62')+_0x2d924d;var _0x104491={'method':_0x8630('0x30'),'uri':_0x18a874['baseUrl']+'/external/get/send.php?'+_0x446f1a,'json':!![]};return rp(_0x104491)[_0x8630('0x13')](function(_0x2268d7){var _0x2ab2e1=Object['keys'](_0x2268d7);if(_0x2268d7[_0x2ab2e1[0x0]][_0x8630('0x26')]&&parseInt(_0x2268d7[_0x2ab2e1[0x0]][_0x8630('0x26')])===0x0){var _0x5b1e48={'messageId':_0x2268d7[_0x2ab2e1[0x0]][_0x8630('0x63')]};if(!_0x18a874[_0x8630('0x36')]){_0x5b1e48[_0x8630('0x37')]=!![];}return _0x5726fd[_0x8630('0x14')](_0x5b1e48);}else{return logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x57'),util[_0x8630('0x25')](_0x2268d7['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x118391){return logger[_0x8630('0x26')](_0x8630('0x27'),'afterCreate',_0x8630('0x57'),util['inspect'](_0x118391,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x57'),_0x8630('0x64'));}break;case'clickatell':if(_0x18a874[_0x8630('0x59')]){var _0x1d3ccd={'method':_0x8630('0x39'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x18a874[_0x8630('0x59')]},'body':{'content':_0x37219b[_0x8630('0x1e')],'to':[_0x37219b[_0x8630('0x1f')]],'from':_0x18a874[_0x8630('0x1f')],'binary':![],'clientMessageId':_0x8630('0x65'),'charset':_0x8630('0x66')},'json':!![]};rp(_0x1d3ccd)[_0x8630('0x13')](function(_0x3edb06){if(!_0x3edb06[_0x8630('0x26')]){var _0x2c14f4={'messageId':_0x3edb06['messages'][0x0][_0x8630('0x67')]};if(!_0x18a874[_0x8630('0x36')]){_0x2c14f4[_0x8630('0x37')]=!![];}return _0x5726fd[_0x8630('0x14')](_0x2c14f4);}else{return logger[_0x8630('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8630('0x24'),_0x8630('0x68'),util['inspect'](_0x3edb06[_0x8630('0x26')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x269de1){return logger[_0x8630('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util['inspect'](_0x269de1,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),'clickatell',_0x8630('0x64'));}break;case _0x8630('0x69'):if(_0x18a874['username']&&_0x18a874['password']){var _0x3c2db7=util[_0x8630('0x3f')](_0x8630('0x40'),_0x18a874['username'],_0x18a874[_0x8630('0x2c')]);var _0x3dc3c8={'method':_0x8630('0x39'),'uri':_0x8630('0x6a')+_0x18a874['accountId']+_0x8630('0x6b'),'body':{'to':[_0x37219b[_0x8630('0x1f')]],'text':_0x37219b['body'],'from':_0x18a874[_0x8630('0x1f')],'applicationId':_0x18a874[_0x8630('0x6c')]},'headers':{'Authorization':util[_0x8630('0x3f')](_0x8630('0x42'),new Buffer(_0x3c2db7)['toString'](_0x8630('0x4e')))},'json':!![]};rp(_0x3dc3c8)[_0x8630('0x13')](function(_0x1d518d){if(_0x1d518d['id']){var _0x52259b={'messageId':_0x1d518d['id']};return _0x5726fd[_0x8630('0x14')](_0x52259b);}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),'bandwidth',util['inspect'](_0x1d518d,{'showHidden':![],'depth':null}));}})[_0x8630('0x15')](function(_0x5e2e27){logger['error'](_0x8630('0x27'),_0x8630('0x24'),'bandwidth',util['inspect'](_0x5e2e27,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x69'),_0x8630('0x49'));}break;case'intelepeer':if(_0x18a874['apiKey']){var _0x10b926={};var _0x104491={'method':_0x8630('0x39'),'uri':_0x8630('0x6d'),'headers':{'Authorization':_0x8630('0x6e')+_0x18a874[_0x8630('0x59')],'Content-Type':'application/json'},'body':{'from':_0x18a874[_0x8630('0x1f')],'to':_0x37219b[_0x8630('0x1f')],'text':_0x37219b[_0x8630('0x1e')]},'json':!![]};return rp(_0x104491)[_0x8630('0x13')](function(_0x23d6e4){if(_0x23d6e4[_0x8630('0x6f')]==0xca){_0x10b926['message']=_0x23d6e4;var _0x2ed569={'method':'POST','uri':_0x8630('0x70'),'headers':{'Authorization':_0x8630('0x6e')+_0x18a874[_0x8630('0x59')],'Content-Type':_0x8630('0x54')},'body':{'refid':_0x10b926[_0x8630('0x71')][_0x8630('0x72')]},'json':!![]};return rp(_0x2ed569)[_0x8630('0x13')](function(_0x44e38b){_0x10b926[_0x8630('0x73')]=_0x44e38b;var _0x45813d={'messageId':_0x10b926[_0x8630('0x71')][_0x8630('0x72')],'read':!![]};return _0x5726fd[_0x8630('0x14')](_0x45813d);});}else{return logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),'intelepeer',util['inspect'](_0x23d6e4,{'showHidden':![],'depth':null}));}})[_0x8630('0x15')](function(_0x15ed2a){return logger['error'](_0x8630('0x27'),'afterCreate','intelepeer',util[_0x8630('0x25')](_0x15ed2a,{'showHidden':![],'depth':null}));});}else{return logger[_0x8630('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8630('0x74'),_0x8630('0x75'));}break;}}})['finally'](function(){_0x399bb0();});}else{_0x399bb0();}}},'charset':_0x8630('0x76'),'collate':_0x8630('0x77')});};
\ No newline at end of file
+var _0x3750=['sender','login?username=','&password=','split','POST','user_key','session_key','read','afterCreate','Missing\x20parameters:\x20username,\x20password','connectel','requestid','Missing\x20parameters:\x20authToken','senderString','%s:%s','https://rest.clicksend.com/v3/sms/send','format','toString','data','queued_count','message_id','clickSend','authId','token','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','base64','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/sms/2/text/advanced','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','signature=','GET','id_sms','deliveryReport','https://platform.clickatell.com/messages','uuid','UTF-8','clickatell','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','findOne','then','update','createdAt','catch','error','find','type','twilio','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','sid','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod'];(function(_0x56d22d,_0x37ba68){var _0x33e47f=function(_0x1bb7d8){while(--_0x1bb7d8){_0x56d22d['push'](_0x56d22d['shift']());}};_0x33e47f(++_0x37ba68);}(_0x3750,0xbb));var _0x0375=function(_0x1a57d1,_0x4281ff){_0x1a57d1=_0x1a57d1-0x0;var _0x394876=_0x3750[_0x1a57d1];return _0x394876;};'use strict';var _=require(_0x0375('0x0'));var util=require(_0x0375('0x1'));var logger=require(_0x0375('0x2'))(_0x0375('0x3'));var moment=require(_0x0375('0x4'));var BPromise=require('bluebird');var rp=require(_0x0375('0x5'));var fs=require('fs');var path=require(_0x0375('0x6'));var rimraf=require('rimraf');var config=require(_0x0375('0x7'));var attributes=require(_0x0375('0x8'));module[_0x0375('0x9')]=function(_0x405517,_0xd3c20a){return _0x405517[_0x0375('0xa')]('SmsMessage',attributes,{'tableName':_0x0375('0xb'),'paranoid':![],'indexes':[{'name':_0x0375('0xc'),'fields':[_0x0375('0xc')]},{'name':_0x0375('0xd'),'fields':[_0x0375('0xe')],'type':_0x0375('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x57c040,_0x7d6563,_0x2b667c){var _0x257974=_0x405517[_0x0375('0x10')];var _0x38a528=_0x57c040[_0x0375('0x11')]({'plain':!![]});if(_0x38a528[_0x0375('0x12')][_0x0375('0x13')]()==='in'||_0x38a528[_0x0375('0x12')][_0x0375('0x13')]()===_0x0375('0x14')&&!_0x38a528[_0x0375('0x15')]&&!_['isNil'](_0x38a528[_0x0375('0x16')])){_0x257974['SmsInteraction'][_0x0375('0x17')]({'where':{'id':_0x38a528['SmsInteractionId']}})[_0x0375('0x18')](function(_0x54e289){if(_0x54e289){_0x54e289[_0x0375('0x19')]({'lastMsgAt':_0x38a528[_0x0375('0x1a')],'lastMsgDirection':_0x38a528[_0x0375('0x12')][_0x0375('0x13')]()});}})[_0x0375('0x1b')](function(_0x12d950){console[_0x0375('0x1c')](_0x12d950);});}if(_0x38a528[_0x0375('0x12')]===_0x0375('0x14')&&!_0x38a528['secret']){var _0x4b5869;_0x257974['SmsAccount'][_0x0375('0x1d')]({'where':{'id':_0x38a528['SmsAccountId']},'raw':!![]})['then'](function(_0x2e13a1){_0x4b5869=_0x2e13a1;if(_0x4b5869&&_0x4b5869[_0x0375('0x1e')]){switch(_0x4b5869[_0x0375('0x1e')]){case'twilio':var _0xf0d52e=require(_0x0375('0x1f'));if(_0x4b5869['accountSid']&&_0x4b5869['authToken']&&_0x4b5869['phone']){var _0x300629=new _0xf0d52e(_0x4b5869['accountSid'],_0x4b5869[_0x0375('0x20')]);_0x300629[_0x0375('0x21')][_0x0375('0x22')]({'body':_0x38a528[_0x0375('0xe')],'to':_0x38a528[_0x0375('0x23')],'from':_0x4b5869['phone'],'statusCallback':_0x4b5869[_0x0375('0x24')]+_0x0375('0x25')+_0x38a528['id']+_0x0375('0x26')+_0x4b5869['token']})[_0x0375('0x18')](function(_0x3c884d){if(_0x3c884d[_0x0375('0x27')]){return _0x57c040[_0x0375('0x19')]({'messageId':_0x3c884d['sid']});}})[_0x0375('0x1b')](function(_0x256426){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',util[_0x0375('0x28')](_0x256426,{'showHidden':![],'depth':null}));});}else{logger[_0x0375('0x1c')](_0x0375('0x29'),'afterCreate',_0x0375('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x0375('0x2a'):var _0x2f07ec=_0x0375('0x2b');if(_0x4b5869[_0x0375('0x2c')]&&_0x4b5869[_0x0375('0x2d')]){var _0x275a50={'recipient':[_0x38a528[_0x0375('0x23')]],'message':_0x38a528['body'],'message_type':_0x4b5869[_0x0375('0x2e')]};if(_0x4b5869[_0x0375('0x2e')]&&_0x4b5869['smsMethod']!=='SI'){_0x275a50[_0x0375('0x2f')]=_0x4b5869['phone'];}var _0x926b2={'url':_0x2f07ec+_0x0375('0x30')+_0x4b5869['username']+_0x0375('0x31')+_0x4b5869[_0x0375('0x2d')],'method':'GET'};rp(_0x926b2)['then'](function(_0x411f8c){var _0x3379ed=_0x411f8c[_0x0375('0x32')](';');var _0x5f15a5={'user_key':_0x3379ed[0x0],'session_key':_0x3379ed[0x1]};_0x926b2={'url':_0x2f07ec+'sms','method':_0x0375('0x33'),'headers':{'user_key':_0x5f15a5[_0x0375('0x34')],'Session_key':_0x5f15a5[_0x0375('0x35')]},'json':!![],'body':_0x275a50};return rp(_0x926b2);})[_0x0375('0x18')](function(_0x91dcd3){if(_0x91dcd3['total_sent']>=0x1){var _0x5711c8={'messageId':_0x91dcd3['internal_order_id']};if(_0x4b5869['smsMethod']!=='GP'||!_0x4b5869['deliveryReport']){_0x5711c8[_0x0375('0x36')]=!![];}return _0x57c040[_0x0375('0x19')](_0x5711c8);}else{return logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),'skebby',util[_0x0375('0x28')](_0x91dcd3,{'showHidden':![],'depth':null}));}})[_0x0375('0x1b')](function(_0x506832){return logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),_0x0375('0x2a'),util[_0x0375('0x28')](_0x506832,{'showHidden':![],'depth':null}));});}else{logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),'skebby',_0x0375('0x38'));}break;case _0x0375('0x39'):if(_0x4b5869[_0x0375('0x20')]){var _0x16a20e={'recipient':_0x38a528[_0x0375('0x23')],'message':_0x38a528[_0x0375('0xe')],'sender':_0x4b5869['senderString']||_0x4b5869[_0x0375('0x23')],'authorization':_0x4b5869['authToken']};var _0x7d6563={'method':_0x0375('0x33'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x16a20e,'json':!![]};rp(_0x7d6563)[_0x0375('0x18')](function(_0x480cbb){var _0x2a9e85={'messageId':_0x480cbb[_0x0375('0x3a')]};if(!_0x4b5869['deliveryReport']){_0x2a9e85['read']=!![];}return _0x57c040[_0x0375('0x19')](_0x2a9e85);})[_0x0375('0x1b')](function(_0x1f2065){logger[_0x0375('0x1c')](_0x0375('0x29'),'afterCreate',_0x0375('0x39'),util[_0x0375('0x28')](_0x1f2065,{'showHidden':![],'depth':null}));});}else{logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),_0x0375('0x39'),_0x0375('0x3b'));}break;case'clicksend':if(_0x4b5869[_0x0375('0x2c')]&&_0x4b5869[_0x0375('0x2d')]){var _0x16a20e={'messages':[{'source':'xCALLY\x20Motion','to':_0x38a528[_0x0375('0x23')],'body':_0x38a528['body'],'from':_0x4b5869[_0x0375('0x3c')]||_0x4b5869[_0x0375('0x23')]}]};var _0xa41956=util['format'](_0x0375('0x3d'),_0x4b5869[_0x0375('0x2c')],_0x4b5869[_0x0375('0x2d')]);var _0x7d6563={'method':_0x0375('0x33'),'uri':_0x0375('0x3e'),'body':_0x16a20e,'headers':{'Authorization':util[_0x0375('0x3f')]('Basic\x20%s',new Buffer(_0xa41956)[_0x0375('0x40')]('base64'))},'json':!![]};rp(_0x7d6563)[_0x0375('0x18')](function(_0x1793a3){if(_0x1793a3['http_code']>=0xc8&&_0x1793a3['http_code']<=0xce){if(_0x1793a3['data']&&_0x1793a3[_0x0375('0x41')][_0x0375('0x42')]>0x0){var _0x3fbce9=_['head'](_0x1793a3[_0x0375('0x41')]['messages']);var _0x4fdf44={'messageId':_0x3fbce9[_0x0375('0x43')]};if(!_0x4b5869['deliveryReport']){_0x4fdf44[_0x0375('0x36')]=!![];}return _0x57c040[_0x0375('0x19')](_0x4fdf44);}else{logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),'clickSend',util[_0x0375('0x28')](_0x1793a3,{'showHidden':![],'depth':null}));}}else{logger[_0x0375('0x1c')](_0x0375('0x29'),'afterCreate',_0x0375('0x44'),util[_0x0375('0x28')](_0x1793a3,{'showHidden':![],'depth':null}));}})[_0x0375('0x1b')](function(_0x50fad9){logger['error'](_0x0375('0x29'),_0x0375('0x37'),_0x0375('0x44'),util[_0x0375('0x28')](_0x50fad9,{'showHidden':![],'depth':null}));});}else{logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),_0x0375('0x44'),_0x0375('0x38'));}break;case'plivo':if(_0x4b5869[_0x0375('0x45')]&&_0x4b5869[_0x0375('0x20')]){var _0x16a20e={'dst':_0x38a528[_0x0375('0x23')],'text':_0x38a528[_0x0375('0xe')],'src':_0x4b5869[_0x0375('0x3c')]||_0x4b5869[_0x0375('0x23')],'url':_0x4b5869['remote']+_0x0375('0x25')+_0x38a528['id']+'/status?token='+_0x4b5869[_0x0375('0x46')]};var _0xa41956=util[_0x0375('0x3f')](_0x0375('0x3d'),_0x4b5869[_0x0375('0x45')],_0x4b5869[_0x0375('0x20')]);var _0x7d6563={'method':'POST','uri':util[_0x0375('0x3f')](_0x0375('0x47'),_0x4b5869[_0x0375('0x45')]),'body':_0x16a20e,'headers':{'Authorization':util[_0x0375('0x3f')](_0x0375('0x48'),new Buffer(_0xa41956)[_0x0375('0x40')](_0x0375('0x49')))},'json':!![]};rp(_0x7d6563)['then'](function(_0x108e46){var _0x1e2bc9={'messageId':_0x108e46[_0x0375('0x4a')][0x0]};return _0x57c040[_0x0375('0x19')](_0x1e2bc9);})[_0x0375('0x1b')](function(_0x2084d0){logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),_0x0375('0x4b'),util['inspect'](_0x2084d0,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0375('0x37'),_0x0375('0x4b'),_0x0375('0x4c'));}break;case'infobip':if(_0x4b5869['username']&&_0x4b5869[_0x0375('0x2d')]){if(_0x4b5869[_0x0375('0x4d')]){var _0x3eb067={'method':_0x0375('0x33'),'uri':_0x4b5869[_0x0375('0x4d')]+'/auth/1/session','body':{'username':_0x4b5869[_0x0375('0x2c')],'password':_0x4b5869[_0x0375('0x2d')]},'json':!![]};return rp(_0x3eb067)[_0x0375('0x18')](function(_0x571433){var _0x5ecb91={'method':_0x0375('0x33'),'uri':_0x4b5869[_0x0375('0x4d')]+_0x0375('0x4e'),'body':{'messages':[{'from':_0x4b5869[_0x0375('0x23')],'destinations':[{'to':_0x38a528[_0x0375('0x23')]}],'text':_0x38a528['body'],'notifyUrl':_0x4b5869[_0x0375('0x24')]+_0x0375('0x25')+_0x38a528['id']+'/status?token='+_0x4b5869[_0x0375('0x46')],'notifyContentType':'application/json','callbackData':_0x4b5869[_0x0375('0x23')]+';'+_0x38a528[_0x0375('0xe')]}]},'headers':{'Authorization':_0x0375('0x4f')+_0x571433[_0x0375('0x46')]},'json':!![]};return rp(_0x5ecb91)['then'](function(_0x1d5246){if(_0x1d5246[_0x0375('0x21')]){var _0x1cba5f={'messageId':_0x1d5246['messages'][0x0][_0x0375('0xc')]};if(!_0x4b5869['deliveryReport']){_0x1cba5f[_0x0375('0x36')]=!![];}return _0x57c040[_0x0375('0x19')](_0x1cba5f);}else{return logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),'infobip',util['inspect'](_0x1d5246,{'showHidden':![],'depth':null}));}});})[_0x0375('0x1b')](function(_0x501080){return logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),_0x0375('0x50'),util[_0x0375('0x28')](_0x501080,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0375('0x29'),'afterCreate','infobip',_0x0375('0x51'));}}else{logger[_0x0375('0x1c')](_0x0375('0x29'),'afterCreate','infobip',_0x0375('0x38'));}break;case _0x0375('0x52'):var _0x33e84c=require('crypto');if(_0x4b5869[_0x0375('0x53')]){var _0x4a5fc0={};_0x4a5fc0[_0x0375('0x54')]=_0x4b5869[_0x0375('0x2c')];_0x4a5fc0[_0x0375('0x23')]=_0x38a528[_0x0375('0x23')];_0x4a5fc0[_0x0375('0x2f')]=_0x4b5869['phone'];_0x4a5fc0[_0x0375('0x55')]=_0x38a528['body'];_0x4a5fc0[_0x0375('0x56')]=+new Date();var _0x3e7ce4='';var _0x2b0cc2='';var _0x2a119a=Object[_0x0375('0x57')](_0x4a5fc0);_0x2a119a[_0x0375('0x58')]();for(var _0x101d63=0x0;_0x101d63<_0x2a119a[_0x0375('0x59')];_0x101d63++){if(_0x3e7ce4!=''){_0x3e7ce4+='&';}_0x3e7ce4+=_0x2a119a[_0x101d63]+'='+encodeURIComponent(_0x4a5fc0[_0x2a119a[_0x101d63]]);_0x2b0cc2+=_0x4a5fc0[_0x2a119a[_0x101d63]];}_0x2b0cc2+=_0x4b5869[_0x0375('0x53')];_0x2b0cc2=_0x33e84c[_0x0375('0x5a')](_0x0375('0x5b'))[_0x0375('0x19')](_0x2b0cc2)['digest']('hex');if(_0x3e7ce4!==''){_0x3e7ce4+='&';}_0x3e7ce4+=_0x0375('0x5c')+_0x2b0cc2;var _0x926b2={'method':_0x0375('0x5d'),'uri':_0x4b5869[_0x0375('0x4d')]+'/external/get/send.php?'+_0x3e7ce4,'json':!![]};return rp(_0x926b2)[_0x0375('0x18')](function(_0x576d09){var _0x1d1552=Object[_0x0375('0x57')](_0x576d09);if(_0x576d09[_0x1d1552[0x0]]['error']&&parseInt(_0x576d09[_0x1d1552[0x0]][_0x0375('0x1c')])===0x0){var _0x438622={'messageId':_0x576d09[_0x1d1552[0x0]][_0x0375('0x5e')]};if(!_0x4b5869[_0x0375('0x5f')]){_0x438622['read']=!![];}return _0x57c040[_0x0375('0x19')](_0x438622);}else{return logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),_0x0375('0x52'),util[_0x0375('0x28')](_0x576d09[_0x0375('0x1c')],{'showHidden':![],'depth':null}));}})[_0x0375('0x1b')](function(_0x11471f){return logger['error'](_0x0375('0x29'),_0x0375('0x37'),_0x0375('0x52'),util['inspect'](_0x11471f,{'showHidden':![],'depth':null}));});}else{logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),_0x0375('0x52'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x4b5869[_0x0375('0x53')]){var _0x468fe7={'method':_0x0375('0x33'),'uri':_0x0375('0x60'),'headers':{'Authorization':_0x4b5869[_0x0375('0x53')]},'body':{'content':_0x38a528['body'],'to':[_0x38a528[_0x0375('0x23')]],'from':_0x4b5869[_0x0375('0x23')],'binary':![],'clientMessageId':_0x0375('0x61'),'charset':_0x0375('0x62')},'json':!![]};rp(_0x468fe7)[_0x0375('0x18')](function(_0x4a62bb){if(!_0x4a62bb[_0x0375('0x1c')]){var _0xd1ed00={'messageId':_0x4a62bb[_0x0375('0x21')][0x0]['apiMessageId']};if(!_0x4b5869[_0x0375('0x5f')]){_0xd1ed00[_0x0375('0x36')]=!![];}return _0x57c040[_0x0375('0x19')](_0xd1ed00);}else{return logger['error'](_0x0375('0x29'),_0x0375('0x37'),_0x0375('0x63'),util[_0x0375('0x28')](_0x4a62bb[_0x0375('0x1c')],{'showHidden':![],'depth':null}));}})[_0x0375('0x1b')](function(_0x5056c3){return logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),'clickatell',util[_0x0375('0x28')](_0x5056c3,{'showHidden':![],'depth':null}));});}else{logger[_0x0375('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0375('0x37'),_0x0375('0x63'),_0x0375('0x64'));}break;case _0x0375('0x65'):if(_0x4b5869[_0x0375('0x2c')]&&_0x4b5869[_0x0375('0x2d')]){var _0xa41956=util[_0x0375('0x3f')](_0x0375('0x3d'),_0x4b5869['username'],_0x4b5869[_0x0375('0x2d')]);var _0x7d6563={'method':_0x0375('0x33'),'uri':_0x0375('0x66')+_0x4b5869['accountId']+_0x0375('0x67'),'body':{'to':[_0x38a528[_0x0375('0x23')]],'text':_0x38a528[_0x0375('0xe')],'from':_0x4b5869[_0x0375('0x23')],'applicationId':_0x4b5869[_0x0375('0x68')]},'headers':{'Authorization':util[_0x0375('0x3f')]('Basic\x20%s',new Buffer(_0xa41956)[_0x0375('0x40')](_0x0375('0x49')))},'json':!![]};rp(_0x7d6563)[_0x0375('0x18')](function(_0x244fb1){if(_0x244fb1['id']){var _0x50fbfb={'messageId':_0x244fb1['id']};return _0x57c040[_0x0375('0x19')](_0x50fbfb);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0375('0x37'),_0x0375('0x65'),util[_0x0375('0x28')](_0x244fb1,{'showHidden':![],'depth':null}));}})[_0x0375('0x1b')](function(_0x45eeed){logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),_0x0375('0x65'),util[_0x0375('0x28')](_0x45eeed,{'showHidden':![],'depth':null}));});}else{logger[_0x0375('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0375('0x65'),_0x0375('0x38'));}break;case'intelepeer':if(_0x4b5869[_0x0375('0x53')]){var _0x3e6c6c={};var _0x926b2={'method':'POST','uri':_0x0375('0x69'),'headers':{'Authorization':_0x0375('0x6a')+_0x4b5869['apiKey'],'Content-Type':_0x0375('0x6b')},'body':{'from':_0x4b5869[_0x0375('0x23')],'to':_0x38a528[_0x0375('0x23')],'text':_0x38a528[_0x0375('0xe')]},'json':!![]};return rp(_0x926b2)[_0x0375('0x18')](function(_0x5b1c6d){if(_0x5b1c6d[_0x0375('0x6c')]==0xca){_0x3e6c6c[_0x0375('0x6d')]=_0x5b1c6d;var _0x33434b={'method':_0x0375('0x33'),'uri':_0x0375('0x6e'),'headers':{'Authorization':_0x0375('0x6a')+_0x4b5869[_0x0375('0x53')],'Content-Type':_0x0375('0x6b')},'body':{'refid':_0x3e6c6c[_0x0375('0x6d')][_0x0375('0x6f')]},'json':!![]};return rp(_0x33434b)['then'](function(_0x55810c){_0x3e6c6c[_0x0375('0x70')]=_0x55810c;var _0x245090={'messageId':_0x3e6c6c[_0x0375('0x6d')][_0x0375('0x6f')],'read':!![]};return _0x57c040[_0x0375('0x19')](_0x245090);});}else{return logger[_0x0375('0x1c')](_0x0375('0x29'),'afterCreate',_0x0375('0x71'),util[_0x0375('0x28')](_0x5b1c6d,{'showHidden':![],'depth':null}));}})[_0x0375('0x1b')](function(_0x31a5b3){return logger['error'](_0x0375('0x29'),_0x0375('0x37'),_0x0375('0x71'),util[_0x0375('0x28')](_0x31a5b3,{'showHidden':![],'depth':null}));});}else{return logger[_0x0375('0x1c')](_0x0375('0x29'),_0x0375('0x37'),_0x0375('0x71'),_0x0375('0x72'));}break;}}})['finally'](function(){_0x2b667c();});}else{_0x2b667c();}}},'charset':_0x0375('0x73'),'collate':_0x0375('0x74')});};
\ No newline at end of file
index 0d5ac5d..ba63237 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd52=['moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','./smsMessage.socket','register','request','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message','info','result','catch','CreateSmsMessage','SmsMessage','options','raw','debug','stringify','util'];(function(_0xd518ce,_0x5eb808){var _0x5f02f7=function(_0x4355fc){while(--_0x4355fc){_0xd518ce['push'](_0xd518ce['shift']());}};_0x5f02f7(++_0x5eb808);}(_0xfd52,0x117));var _0x2fd5=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xfd52[_0x1eda20];return _0x31b953;};'use strict';var _=require('lodash');var util=require(_0x2fd5('0x0'));var moment=require(_0x2fd5('0x1'));var BPromise=require(_0x2fd5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fd5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2fd5('0x4'));var logger=require('../../config/logger')(_0x2fd5('0x5'));var config=require(_0x2fd5('0x6'));var jayson=require(_0x2fd5('0x7'));var client=jayson['client'][_0x2fd5('0x8')]({'port':0x232a});config[_0x2fd5('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2fd5('0x9')]));require(_0x2fd5('0xa'))[_0x2fd5('0xb')](socket);function respondWithRpcPromise(_0x1ca058,_0x421a9a,_0x29329a){return new BPromise(function(_0x724d0,_0x39f8ee){return client[_0x2fd5('0xc')](_0x1ca058,_0x29329a)['then'](function(_0x3a7bbc){logger['info']('SmsMessage,\x20%s,\x20%s',_0x421a9a,_0x2fd5('0xd'));logger['debug'](_0x2fd5('0xe'),_0x421a9a,'request\x20sent',JSON['stringify'](_0x3a7bbc));if(_0x3a7bbc[_0x2fd5('0xf')]){if(_0x3a7bbc[_0x2fd5('0xf')][_0x2fd5('0x10')]===0x1f4){logger[_0x2fd5('0xf')](_0x2fd5('0x11'),_0x421a9a,_0x3a7bbc[_0x2fd5('0xf')][_0x2fd5('0x12')]);return _0x39f8ee(_0x3a7bbc[_0x2fd5('0xf')][_0x2fd5('0x12')]);}logger[_0x2fd5('0xf')]('SmsMessage,\x20%s,\x20%s',_0x421a9a,_0x3a7bbc[_0x2fd5('0xf')]['message']);return _0x724d0(_0x3a7bbc[_0x2fd5('0xf')][_0x2fd5('0x12')]);}else{logger[_0x2fd5('0x13')](_0x2fd5('0x11'),_0x421a9a,'request\x20sent');_0x724d0(_0x3a7bbc[_0x2fd5('0x14')][_0x2fd5('0x12')]);}})[_0x2fd5('0x15')](function(_0x838052){logger[_0x2fd5('0xf')]('SmsMessage,\x20%s,\x20%s',_0x421a9a,_0x838052);_0x39f8ee(_0x838052);});});}exports[_0x2fd5('0x16')]=function(_0x5345c6){var _0x3f6493=this;return new Promise(function(_0x2b2b6b,_0x21035f){return db[_0x2fd5('0x17')]['create'](_0x5345c6['body'],{'raw':_0x5345c6[_0x2fd5('0x18')]?_0x5345c6[_0x2fd5('0x18')][_0x2fd5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x530cd8){logger[_0x2fd5('0x13')]('CreateSmsMessage',_0x5345c6);logger[_0x2fd5('0x1a')]('CreateSmsMessage',_0x5345c6,JSON[_0x2fd5('0x1b')](_0x530cd8));_0x2b2b6b(_0x530cd8);})['catch'](function(_0x385482){logger[_0x2fd5('0xf')]('CreateSmsMessage',_0x385482[_0x2fd5('0x12')],_0x5345c6);_0x21035f(_0x3f6493['error'](0x1f4,_0x385482[_0x2fd5('0x12')]));});});};
\ No newline at end of file
+var _0xba95=['result','CreateSmsMessage','SmsMessage','create','body','options','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3d7eeb,_0x21bc4e){var _0x4a02ef=function(_0x39a86d){while(--_0x39a86d){_0x3d7eeb['push'](_0x3d7eeb['shift']());}};_0x4a02ef(++_0x21bc4e);}(_0xba95,0x6d));var _0x5ba9=function(_0x233a0e,_0x3dada5){_0x233a0e=_0x233a0e-0x0;var _0x35baa0=_0xba95[_0x233a0e];return _0x35baa0;};'use strict';var _=require('lodash');var util=require(_0x5ba9('0x0'));var moment=require('moment');var BPromise=require(_0x5ba9('0x1'));var rs=require(_0x5ba9('0x2'));var fs=require('fs');var Redis=require(_0x5ba9('0x3'));var db=require(_0x5ba9('0x4'))['db'];var utils=require(_0x5ba9('0x5'));var logger=require(_0x5ba9('0x6'))(_0x5ba9('0x7'));var config=require(_0x5ba9('0x8'));var jayson=require(_0x5ba9('0x9'));var client=jayson[_0x5ba9('0xa')][_0x5ba9('0xb')]({'port':0x232a});config[_0x5ba9('0xc')]=_['defaults'](config[_0x5ba9('0xc')],{'host':_0x5ba9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ba9('0xc')]));require(_0x5ba9('0xe'))[_0x5ba9('0xf')](socket);function respondWithRpcPromise(_0x34d2aa,_0x1304ec,_0x33a62e){return new BPromise(function(_0x31d395,_0x349f8f){return client[_0x5ba9('0x10')](_0x34d2aa,_0x33a62e)[_0x5ba9('0x11')](function(_0x1b41e5){logger[_0x5ba9('0x12')](_0x5ba9('0x13'),_0x1304ec,'request\x20sent');logger[_0x5ba9('0x14')](_0x5ba9('0x15'),_0x1304ec,_0x5ba9('0x16'),JSON[_0x5ba9('0x17')](_0x1b41e5));if(_0x1b41e5[_0x5ba9('0x18')]){if(_0x1b41e5[_0x5ba9('0x18')][_0x5ba9('0x19')]===0x1f4){logger['error'](_0x5ba9('0x13'),_0x1304ec,_0x1b41e5['error'][_0x5ba9('0x1a')]);return _0x349f8f(_0x1b41e5[_0x5ba9('0x18')]['message']);}logger[_0x5ba9('0x18')](_0x5ba9('0x13'),_0x1304ec,_0x1b41e5[_0x5ba9('0x18')][_0x5ba9('0x1a')]);return _0x31d395(_0x1b41e5[_0x5ba9('0x18')][_0x5ba9('0x1a')]);}else{logger['info'](_0x5ba9('0x13'),_0x1304ec,_0x5ba9('0x16'));_0x31d395(_0x1b41e5[_0x5ba9('0x1b')][_0x5ba9('0x1a')]);}})['catch'](function(_0x47254d){logger[_0x5ba9('0x18')](_0x5ba9('0x13'),_0x1304ec,_0x47254d);_0x349f8f(_0x47254d);});});}exports[_0x5ba9('0x1c')]=function(_0x47a944){var _0xa79f8=this;return new Promise(function(_0x148a67,_0x9cfd5c){return db[_0x5ba9('0x1d')][_0x5ba9('0x1e')](_0x47a944[_0x5ba9('0x1f')],{'raw':_0x47a944['options']?_0x47a944[_0x5ba9('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x5ba9('0x11')](function(_0x5dfe9f){logger[_0x5ba9('0x12')](_0x5ba9('0x1c'),_0x47a944);logger[_0x5ba9('0x14')](_0x5ba9('0x1c'),_0x47a944,JSON[_0x5ba9('0x17')](_0x5dfe9f));_0x148a67(_0x5dfe9f);})[_0x5ba9('0x21')](function(_0x462c73){logger[_0x5ba9('0x18')](_0x5ba9('0x1c'),_0x462c73[_0x5ba9('0x1a')],_0x47a944);_0x9cfd5c(_0xa79f8[_0x5ba9('0x18')](0x1f4,_0x462c73[_0x5ba9('0x1a')]));});});};
\ No newline at end of file
index f567429..dc626cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f02=['./smsMessage.events','remove','update','emit','register','smsMessage:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3f02,0x78));var _0x23f0=function(_0x340756,_0xad31ae){_0x340756=_0x340756-0x0;var _0x2ef745=_0x3f02[_0x340756];return _0x2ef745;};'use strict';var SmsMessageEvents=require(_0x23f0('0x0'));var events=['save',_0x23f0('0x1'),_0x23f0('0x2')];function createListener(_0xc97825,_0x32cc03){return function(_0x2592ce){_0x32cc03[_0x23f0('0x3')](_0xc97825,_0x2592ce);};}function removeListener(_0x55e292,_0x4a9e15){return function(){SmsMessageEvents['removeListener'](_0x55e292,_0x4a9e15);};}exports[_0x23f0('0x4')]=function(_0x5660f8){for(var _0x5d0b77=0x0,_0x51eabc=events['length'];_0x5d0b77<_0x51eabc;_0x5d0b77++){var _0x123452=events[_0x5d0b77];var _0x2cbe1d=createListener(_0x23f0('0x5')+_0x123452,_0x5660f8);SmsMessageEvents['on'](_0x123452,_0x2cbe1d);}};
\ No newline at end of file
+var _0xecaa=['save','remove','register'];(function(_0x22c519,_0x562209){var _0x240467=function(_0x6e904f){while(--_0x6e904f){_0x22c519['push'](_0x22c519['shift']());}};_0x240467(++_0x562209);}(_0xecaa,0x1ef));var _0xaeca=function(_0x5f2c1c,_0x1a55dd){_0x5f2c1c=_0x5f2c1c-0x0;var _0x2275ae=_0xecaa[_0x5f2c1c];return _0x2275ae;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xaeca('0x0'),_0xaeca('0x1'),'update'];function createListener(_0x4d22d4,_0x3ea9b8){return function(_0x3864c6){_0x3ea9b8['emit'](_0x4d22d4,_0x3864c6);};}function removeListener(_0x37a66b,_0x402ab1){return function(){SmsMessageEvents['removeListener'](_0x37a66b,_0x402ab1);};}exports[_0xaeca('0x2')]=function(_0x58dff9){for(var _0x571ed1=0x0,_0x4d8d17=events['length'];_0x571ed1<_0x4d8d17;_0x571ed1++){var _0x204476=events[_0x571ed1];var _0x28a48f=createListener('smsMessage:'+_0x204476,_0x58dff9);SmsMessageEvents['on'](_0x204476,_0x28a48f);}};
\ No newline at end of file
index d6f15d2..b1582fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0524=['removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','delete'];(function(_0x3165af,_0x215128){var _0x49047d=function(_0x27a312){while(--_0x27a312){_0x3165af['push'](_0x3165af['shift']());}};_0x49047d(++_0x215128);}(_0x0524,0x93));var _0x4052=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x0524[_0x587fb5];return _0x551105;};'use strict';var multer=require('multer');var util=require(_0x4052('0x0'));var path=require(_0x4052('0x1'));var timeout=require(_0x4052('0x2'));var express=require(_0x4052('0x3'));var router=express[_0x4052('0x4')]();var fs_extra=require(_0x4052('0x5'));var auth=require(_0x4052('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4052('0x7'));var controller=require(_0x4052('0x8'));router[_0x4052('0x9')]('/',auth[_0x4052('0xa')](),controller['index']);router[_0x4052('0x9')](_0x4052('0xb'),auth['isAuthenticated'](),controller[_0x4052('0xc')]);router['get'](_0x4052('0xd'),auth[_0x4052('0xa')](),controller[_0x4052('0xe')]);router[_0x4052('0x9')](_0x4052('0xf'),auth[_0x4052('0xa')](),controller[_0x4052('0x10')]);router[_0x4052('0x9')](_0x4052('0x11'),auth[_0x4052('0xa')](),controller[_0x4052('0x12')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x4052('0x13')]);router[_0x4052('0x14')]('/',auth[_0x4052('0xa')](),controller[_0x4052('0x15')]);router[_0x4052('0x14')](_0x4052('0x11'),auth[_0x4052('0xa')](),controller[_0x4052('0x16')]);router['post'](_0x4052('0x17'),auth[_0x4052('0xa')](),controller[_0x4052('0x18')]);router[_0x4052('0x19')](_0x4052('0xd'),auth[_0x4052('0xa')](),controller['update']);router[_0x4052('0x1a')](_0x4052('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x4052('0x1a')](_0x4052('0x11'),auth[_0x4052('0xa')](),controller[_0x4052('0x1b')]);router[_0x4052('0x1a')](_0x4052('0x17'),auth[_0x4052('0xa')](),controller['removeAgents']);module[_0x4052('0x1c')]=router;
\ No newline at end of file
+var _0x20e3=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/:id','show','/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','destroy','delete','removeTeams','removeAgents','multer','path','connect-timeout'];(function(_0x477186,_0xb79e7d){var _0x51f31c=function(_0x3309b2){while(--_0x3309b2){_0x477186['push'](_0x477186['shift']());}};_0x51f31c(++_0xb79e7d);}(_0x20e3,0x102));var _0x320e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x20e3[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x320e('0x0'));var util=require('util');var path=require(_0x320e('0x1'));var timeout=require(_0x320e('0x2'));var express=require(_0x320e('0x3'));var router=express[_0x320e('0x4')]();var fs_extra=require(_0x320e('0x5'));var auth=require(_0x320e('0x6'));var interaction=require(_0x320e('0x7'));var config=require(_0x320e('0x8'));var controller=require(_0x320e('0x9'));router[_0x320e('0xa')]('/',auth[_0x320e('0xb')](),controller['index']);router['get']('/describe',auth[_0x320e('0xb')](),controller['describe']);router[_0x320e('0xa')](_0x320e('0xc'),auth[_0x320e('0xb')](),controller[_0x320e('0xd')]);router[_0x320e('0xa')](_0x320e('0xe'),auth[_0x320e('0xb')](),controller['getMembers']);router[_0x320e('0xa')](_0x320e('0xf'),auth['isAuthenticated'](),controller[_0x320e('0x10')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x320e('0x11')]);router[_0x320e('0x12')]('/',auth[_0x320e('0xb')](),controller[_0x320e('0x13')]);router[_0x320e('0x12')]('/:id/teams',auth[_0x320e('0xb')](),controller[_0x320e('0x14')]);router[_0x320e('0x12')](_0x320e('0x15'),auth[_0x320e('0xb')](),controller[_0x320e('0x16')]);router[_0x320e('0x17')]('/:id',auth[_0x320e('0xb')](),controller[_0x320e('0x18')]);router['delete']('/:id',auth[_0x320e('0xb')](),controller[_0x320e('0x19')]);router[_0x320e('0x1a')](_0x320e('0xf'),auth['isAuthenticated'](),controller[_0x320e('0x1b')]);router[_0x320e('0x1a')](_0x320e('0x15'),auth[_0x320e('0xb')](),controller[_0x320e('0x1c')]);module['exports']=router;
\ No newline at end of file
index 08f5fe3..3471f31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf7a=['roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x5815af,_0x361f0b){var _0x3f14cb=function(_0x422c47){while(--_0x422c47){_0x5815af['push'](_0x5815af['shift']());}};_0x3f14cb(++_0x361f0b);}(_0xbf7a,0xd3));var _0xabf7=function(_0x581fd5,_0x5eb367){_0x581fd5=_0x581fd5-0x0;var _0x301075=_0xbf7a[_0x581fd5];return _0x301075;};'use strict';var Sequelize=require(_0xabf7('0x0'));module[_0xabf7('0x1')]={'name':{'type':Sequelize[_0xabf7('0x2')],'unique':_0xabf7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xabf7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xabf7('0x5'))}};
\ No newline at end of file
+var _0x54b6=['exports','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x52e629,_0x2d192e){var _0x2bf4f6=function(_0x1bce69){while(--_0x1bce69){_0x52e629['push'](_0x52e629['shift']());}};_0x2bf4f6(++_0x2d192e);}(_0x54b6,0x7e));var _0x654b=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x54b6[_0x47e549];return _0x251374;};'use strict';var Sequelize=require('sequelize');module[_0x654b('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x654b('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x654b('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x654b('0x3')](_0x654b('0x4'),_0x654b('0x5'),_0x654b('0x6'))}};
\ No newline at end of file
index e1a161e..bec3b77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf946=['ids','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','Agents','select','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','count','offset','set','apply','reject','save','update','then','SmsQueues','UserProfileResource','destroy','error','name','send','SmsQueue','fieldName','type','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','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','params','describe','getMembers','findOne','UserSmsQueue','pick','SmsQueueId','User','findAndCountAll','UserId','agent','createdAt','format','smsPause','updatedAt','getTeams','Team','addTeams'];(function(_0x5bfd4a,_0x2b1f9a){var _0xcf41b1=function(_0x4f28f8){while(--_0x4f28f8){_0x5bfd4a['push'](_0x5bfd4a['shift']());}};_0xcf41b1(++_0x2b1f9a);}(_0xf946,0x14f));var _0x6f94=function(_0x53ddcb,_0xc1a547){_0x53ddcb=_0x53ddcb-0x0;var _0x48afdb=_0xf946[_0x53ddcb];return _0x48afdb;};'use strict';var emlformat=require(_0x6f94('0x0'));var rimraf=require(_0x6f94('0x1'));var zipdir=require(_0x6f94('0x2'));var jsonpatch=require(_0x6f94('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6f94('0x4'));var path=require(_0x6f94('0x5'));var sox=require(_0x6f94('0x6'));var csv=require('to-csv');var ejs=require(_0x6f94('0x7'));var fs=require('fs');var fs_extra=require(_0x6f94('0x8'));var _=require(_0x6f94('0x9'));var squel=require(_0x6f94('0xa'));var crypto=require(_0x6f94('0xb'));var jsforce=require(_0x6f94('0xc'));var deskjs=require(_0x6f94('0xd'));var toCsv=require(_0x6f94('0xe'));var querystring=require(_0x6f94('0xf'));var Papa=require(_0x6f94('0x10'));var Redis=require(_0x6f94('0x11'));var authService=require(_0x6f94('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6f94('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f94('0x14'))(_0x6f94('0x15'));var utils=require(_0x6f94('0x16'));var config=require(_0x6f94('0x17'));var licenseUtil=require(_0x6f94('0x18'));var db=require(_0x6f94('0x19'))['db'];config[_0x6f94('0x1a')]=_['defaults'](config[_0x6f94('0x1a')],{'host':_0x6f94('0x1b'),'port':0x18eb});var socket=require(_0x6f94('0x1c'))(new Redis(config[_0x6f94('0x1a')]));require('./smsQueue.socket')[_0x6f94('0x1d')](socket);function respondWithStatusCode(_0x21efa5,_0x5b1072){_0x5b1072=_0x5b1072||0xcc;return function(_0x35f995){if(_0x35f995){return _0x21efa5[_0x6f94('0x1e')](_0x5b1072);}return _0x21efa5[_0x6f94('0x1f')](_0x5b1072)[_0x6f94('0x20')]();};}function respondWithResult(_0x16dcdc,_0x21c306){_0x21c306=_0x21c306||0xc8;return function(_0x540f1f){if(_0x540f1f){return _0x16dcdc[_0x6f94('0x1f')](_0x21c306)['json'](_0x540f1f);}};}function respondWithFilteredResult(_0x373b42,_0x12cab3){return function(_0x408f90){if(_0x408f90){var _0x54f67d=typeof _0x12cab3['offset']===_0x6f94('0x21')&&typeof _0x12cab3[_0x6f94('0x22')]==='undefined';var _0x424d3a=_0x408f90[_0x6f94('0x23')];var _0x5ab4d8=_0x54f67d?0x0:_0x12cab3[_0x6f94('0x24')];var _0x5f0ff1=_0x54f67d?_0x408f90[_0x6f94('0x23')]:_0x12cab3[_0x6f94('0x24')]+_0x12cab3[_0x6f94('0x22')];var _0x35f3bc;if(_0x5f0ff1>=_0x424d3a){_0x5f0ff1=_0x424d3a;_0x35f3bc=0xc8;}else{_0x35f3bc=0xce;}_0x373b42[_0x6f94('0x1f')](_0x35f3bc);return _0x373b42[_0x6f94('0x25')]('Content-Range',_0x5ab4d8+'-'+_0x5f0ff1+'/'+_0x424d3a)['json'](_0x408f90);}return null;};}function patchUpdates(_0x59a714){return function(_0x33ad5c){try{jsonpatch[_0x6f94('0x26')](_0x33ad5c,_0x59a714,!![]);}catch(_0x42369f){return BPromise[_0x6f94('0x27')](_0x42369f);}return _0x33ad5c[_0x6f94('0x28')]();};}function saveUpdates(_0x41ecac,_0xe4ff53){return function(_0x1f0bcf){if(_0x1f0bcf){return _0x1f0bcf[_0x6f94('0x29')](_0x41ecac)[_0x6f94('0x2a')](function(_0x1b55a5){return _0x1b55a5;});}return null;};}function removeEntity(_0xc12e7b,_0x1d720c){return function(_0x41fcd3){if(_0x41fcd3){return _0x41fcd3['destroy']()[_0x6f94('0x2a')](function(){var _0x1032a7=_0x41fcd3['get']({'plain':!![]});var _0x48a014=_0x6f94('0x2b');return db[_0x6f94('0x2c')][_0x6f94('0x2d')]({'where':{'type':_0x48a014,'resourceId':_0x1032a7['id']}})['then'](function(){return _0x41fcd3;});})[_0x6f94('0x2a')](function(){_0xc12e7b[_0x6f94('0x1f')](0xcc)[_0x6f94('0x20')]();});}};}function handleEntityNotFound(_0x2d536b,_0x391d9e){return function(_0x4cabf2){if(!_0x4cabf2){_0x2d536b[_0x6f94('0x1e')](0x194);}return _0x4cabf2;};}function handleError(_0x4a9c18,_0x1f4a71){_0x1f4a71=_0x1f4a71||0x1f4;return function(_0x45ec34){logger[_0x6f94('0x2e')](_0x45ec34['stack']);if(_0x45ec34[_0x6f94('0x2f')]){delete _0x45ec34['name'];}_0x4a9c18[_0x6f94('0x1f')](_0x1f4a71)[_0x6f94('0x30')](_0x45ec34);};}exports['index']=function(_0x602dcf,_0x3b2c10){var _0x43a2e6={},_0x561610={},_0x1ff5b7={'count':0x0,'rows':[]};var _0x510854=_['map'](db[_0x6f94('0x31')]['rawAttributes'],function(_0x744c01){return{'name':_0x744c01[_0x6f94('0x32')],'type':_0x744c01[_0x6f94('0x33')]['key']};});_0x561610[_0x6f94('0x34')]=_[_0x6f94('0x35')](_0x510854,_0x6f94('0x2f'));_0x561610['query']=_[_0x6f94('0x36')](_0x602dcf[_0x6f94('0x37')]);_0x561610[_0x6f94('0x38')]=_['intersection'](_0x561610[_0x6f94('0x34')],_0x561610[_0x6f94('0x37')]);_0x43a2e6[_0x6f94('0x39')]=_['intersection'](_0x561610[_0x6f94('0x34')],qs['fields'](_0x602dcf[_0x6f94('0x37')][_0x6f94('0x3a')]));_0x43a2e6[_0x6f94('0x39')]=_0x43a2e6[_0x6f94('0x39')][_0x6f94('0x3b')]?_0x43a2e6['attributes']:_0x561610['model'];if(!_0x602dcf['query'][_0x6f94('0x3c')](_0x6f94('0x3d'))){_0x43a2e6['limit']=qs['limit'](_0x602dcf['query'][_0x6f94('0x22')]);_0x43a2e6[_0x6f94('0x24')]=qs[_0x6f94('0x24')](_0x602dcf[_0x6f94('0x37')]['offset']);}_0x43a2e6[_0x6f94('0x3e')]=qs[_0x6f94('0x3f')](_0x602dcf[_0x6f94('0x37')][_0x6f94('0x3f')]);_0x43a2e6[_0x6f94('0x40')]=qs['filters'](_['pick'](_0x602dcf[_0x6f94('0x37')],_0x561610['filters']),_0x510854);if(_0x602dcf[_0x6f94('0x37')]['filter']){_0x43a2e6['where']=_[_0x6f94('0x41')](_0x43a2e6['where'],{'$or':_[_0x6f94('0x35')](_0x510854,function(_0x1c53b8){if(_0x1c53b8[_0x6f94('0x33')]!==_0x6f94('0x42')){var _0x2fa1b3={};_0x2fa1b3[_0x1c53b8[_0x6f94('0x2f')]]={'$like':'%'+_0x602dcf[_0x6f94('0x37')][_0x6f94('0x43')]+'%'};return _0x2fa1b3;}})});}_0x43a2e6=_['merge']({},_0x43a2e6,_0x602dcf[_0x6f94('0x44')]);var _0x197e0a={'where':_0x43a2e6[_0x6f94('0x40')]};return db['SmsQueue']['count'](_0x197e0a)[_0x6f94('0x2a')](function(_0x4854b6){_0x1ff5b7[_0x6f94('0x23')]=_0x4854b6;if(_0x602dcf[_0x6f94('0x37')][_0x6f94('0x45')]){_0x43a2e6[_0x6f94('0x46')]=[{'all':!![]}];}return db[_0x6f94('0x31')][_0x6f94('0x47')](_0x43a2e6);})[_0x6f94('0x2a')](function(_0xb197a5){_0x1ff5b7[_0x6f94('0x48')]=_0xb197a5;return _0x1ff5b7;})['then'](respondWithFilteredResult(_0x3b2c10,_0x43a2e6))[_0x6f94('0x49')](handleError(_0x3b2c10,null));};exports[_0x6f94('0x4a')]=function(_0x4cce6d,_0x1c2bb9){var _0x44a7d8={'raw':!![],'where':{'id':_0x4cce6d['params']['id']}},_0x2cd378={};_0x2cd378[_0x6f94('0x34')]=_[_0x6f94('0x36')](db['SmsQueue'][_0x6f94('0x4b')]);_0x2cd378[_0x6f94('0x37')]=_[_0x6f94('0x36')](_0x4cce6d['query']);_0x2cd378[_0x6f94('0x38')]=_[_0x6f94('0x4c')](_0x2cd378[_0x6f94('0x34')],_0x2cd378['query']);_0x44a7d8['attributes']=_[_0x6f94('0x4c')](_0x2cd378[_0x6f94('0x34')],qs[_0x6f94('0x3a')](_0x4cce6d[_0x6f94('0x37')][_0x6f94('0x3a')]));_0x44a7d8[_0x6f94('0x39')]=_0x44a7d8[_0x6f94('0x39')][_0x6f94('0x3b')]?_0x44a7d8[_0x6f94('0x39')]:_0x2cd378['model'];if(_0x4cce6d[_0x6f94('0x37')][_0x6f94('0x45')]){_0x44a7d8[_0x6f94('0x46')]=[{'all':!![]}];}_0x44a7d8=_[_0x6f94('0x41')]({},_0x44a7d8,_0x4cce6d[_0x6f94('0x44')]);return db[_0x6f94('0x31')]['find'](_0x44a7d8)[_0x6f94('0x2a')](handleEntityNotFound(_0x1c2bb9,null))['then'](respondWithResult(_0x1c2bb9,null))[_0x6f94('0x49')](handleError(_0x1c2bb9,null));};exports['create']=function(_0x345bbf,_0x2ceab0){return db['SmsQueue'][_0x6f94('0x4d')](_0x345bbf[_0x6f94('0x4e')],{})['then'](function(_0x47dc7b){var _0x4c07c4=_0x345bbf[_0x6f94('0x4f')][_0x6f94('0x50')]({'plain':!![]});if(!_0x4c07c4)throw new Error(_0x6f94('0x51'));if(_0x4c07c4[_0x6f94('0x52')]===_0x6f94('0x4f')){var _0x478385=_0x47dc7b[_0x6f94('0x50')]({'plain':!![]});var _0x5648c9=_0x6f94('0x2b');return db[_0x6f94('0x53')]['find']({'where':{'name':_0x5648c9,'userProfileId':_0x4c07c4[_0x6f94('0x54')]},'raw':!![]})[_0x6f94('0x2a')](function(_0x272e79){if(_0x272e79&&_0x272e79[_0x6f94('0x55')]===0x0){return db[_0x6f94('0x2c')]['create']({'name':_0x478385[_0x6f94('0x2f')],'resourceId':_0x478385['id'],'type':_0x272e79[_0x6f94('0x2f')],'sectionId':_0x272e79['id']},{})[_0x6f94('0x2a')](function(){return _0x47dc7b;});}else{return _0x47dc7b;}})[_0x6f94('0x49')](function(_0x443352){logger[_0x6f94('0x2e')](_0x6f94('0x56'),_0x443352);throw _0x443352;});}return _0x47dc7b;})[_0x6f94('0x2a')](respondWithResult(_0x2ceab0,0xc9))['catch'](handleError(_0x2ceab0,null));};exports[_0x6f94('0x29')]=function(_0x270391,_0x2cdd52){if(_0x270391[_0x6f94('0x4e')]['id']){delete _0x270391['body']['id'];}return db[_0x6f94('0x31')][_0x6f94('0x57')]({'where':{'id':_0x270391[_0x6f94('0x58')]['id']}})['then'](handleEntityNotFound(_0x2cdd52,null))[_0x6f94('0x2a')](saveUpdates(_0x270391[_0x6f94('0x4e')],null))['then'](respondWithResult(_0x2cdd52,null))['catch'](handleError(_0x2cdd52,null));};exports[_0x6f94('0x2d')]=function(_0x4cfd1b,_0x5f50ad){return db[_0x6f94('0x31')][_0x6f94('0x57')]({'where':{'id':_0x4cfd1b[_0x6f94('0x58')]['id']}})[_0x6f94('0x2a')](handleEntityNotFound(_0x5f50ad,null))['then'](removeEntity(_0x5f50ad,null))[_0x6f94('0x49')](handleError(_0x5f50ad,null));};exports['describe']=function(_0x470271,_0xf29b7a){return db[_0x6f94('0x31')][_0x6f94('0x59')]()[_0x6f94('0x2a')](respondWithResult(_0xf29b7a,null))[_0x6f94('0x49')](handleError(_0xf29b7a,null));};exports[_0x6f94('0x5a')]=function(_0x284d84,_0x4ca731,_0x531ab4){var _0x5ca408={'raw':!![],'where':{}},_0x3662ee={},_0x16cd5d;return db[_0x6f94('0x31')][_0x6f94('0x5b')]({'where':{'id':_0x284d84[_0x6f94('0x58')]['id']}})[_0x6f94('0x2a')](handleEntityNotFound(_0x4ca731,null))[_0x6f94('0x2a')](function(_0x1dee21){if(_0x1dee21){_0x16cd5d=_0x1dee21[_0x6f94('0x50')]({'plain':!![]});_0x3662ee[_0x6f94('0x34')]=_[_0x6f94('0x36')](db[_0x6f94('0x5c')][_0x6f94('0x4b')]);_0x3662ee[_0x6f94('0x37')]=_[_0x6f94('0x36')](_0x284d84[_0x6f94('0x37')]);_0x3662ee[_0x6f94('0x38')]=_[_0x6f94('0x4c')](_0x3662ee['model'],_0x3662ee[_0x6f94('0x37')]);_0x5ca408[_0x6f94('0x39')]=_[_0x6f94('0x4c')](_0x3662ee[_0x6f94('0x34')],qs['fields'](_0x284d84['query'][_0x6f94('0x3a')]));_0x5ca408[_0x6f94('0x39')]=_0x5ca408['attributes'][_0x6f94('0x3b')]?_0x5ca408[_0x6f94('0x39')]:_0x3662ee[_0x6f94('0x34')];if(!_0x284d84['query'][_0x6f94('0x3c')](_0x6f94('0x3d'))){_0x5ca408[_0x6f94('0x22')]=qs[_0x6f94('0x22')](_0x284d84[_0x6f94('0x37')][_0x6f94('0x22')]);_0x5ca408['offset']=qs[_0x6f94('0x24')](_0x284d84['query'][_0x6f94('0x24')]);}_0x5ca408[_0x6f94('0x3e')]=qs[_0x6f94('0x3f')](_0x284d84['query'][_0x6f94('0x3f')]);_0x5ca408[_0x6f94('0x40')]=qs[_0x6f94('0x38')](_[_0x6f94('0x5d')](_0x284d84[_0x6f94('0x37')],_0x3662ee[_0x6f94('0x38')]));_0x5ca408['where'][_0x6f94('0x5e')]=_0x1dee21['id'];if(_0x284d84[_0x6f94('0x37')][_0x6f94('0x43')]){_0x5ca408[_0x6f94('0x40')]=_[_0x6f94('0x41')](_0x5ca408[_0x6f94('0x40')],{'$or':_[_0x6f94('0x35')](_0x5ca408['attributes'],function(_0x364667){var _0x74e0f7={};_0x74e0f7[_0x364667]={'$like':'%'+_0x284d84['query'][_0x6f94('0x43')]+'%'};return _0x74e0f7;})});}_0x5ca408=_[_0x6f94('0x41')]({},_0x5ca408,_0x284d84[_0x6f94('0x44')]);return db['UserSmsQueue'][_0x6f94('0x47')](_0x5ca408);}})[_0x6f94('0x2a')](function(_0xeb9435){if(_0xeb9435){return db[_0x6f94('0x5f')][_0x6f94('0x60')]({'where':{'id':_[_0x6f94('0x35')](_0xeb9435,_0x6f94('0x61')),'role':_0x6f94('0x62')},'attributes':['id','name','smsPause','updatedAt',_0x6f94('0x63')]});}})[_0x6f94('0x2a')](function(_0x122979){if(_0x122979){return{'count':_0x122979['count'],'rows':_[_0x6f94('0x35')](_0x122979[_0x6f94('0x48')],function(_0x265bb7){return{'membername':_0x265bb7[_0x6f94('0x2f')],'UserId':_0x265bb7['id'],'queue_name':_0x16cd5d[_0x6f94('0x2f')],'SmsQueueId':_0x16cd5d['id'],'interface':util[_0x6f94('0x64')]('%s/%s','SIP',_0x265bb7[_0x6f94('0x2f')]),'penalty':0x0,'paused':_0x265bb7[_0x6f94('0x65')],'createdAt':_0x265bb7[_0x6f94('0x63')],'updatedAt':_0x265bb7[_0x6f94('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6f94('0x2a')](respondWithFilteredResult(_0x4ca731,_0x5ca408))['catch'](handleError(_0x4ca731,null));};exports[_0x6f94('0x67')]=function(_0x56280b,_0x1cb3d1,_0x23f8e6){var _0x391e9c={};var _0x675182={};var _0x46dce9;var _0x150fb5;return db[_0x6f94('0x31')][_0x6f94('0x5b')]({'where':{'id':_0x56280b[_0x6f94('0x58')]['id']}})[_0x6f94('0x2a')](handleEntityNotFound(_0x1cb3d1,null))[_0x6f94('0x2a')](function(_0x225944){if(_0x225944){_0x46dce9=_0x225944;_0x675182[_0x6f94('0x34')]=_[_0x6f94('0x36')](db[_0x6f94('0x68')][_0x6f94('0x4b')]);_0x675182[_0x6f94('0x37')]=_[_0x6f94('0x36')](_0x56280b[_0x6f94('0x37')]);_0x675182['filters']=_[_0x6f94('0x4c')](_0x675182[_0x6f94('0x34')],_0x675182[_0x6f94('0x37')]);_0x391e9c[_0x6f94('0x39')]=_[_0x6f94('0x4c')](_0x675182[_0x6f94('0x34')],qs[_0x6f94('0x3a')](_0x56280b[_0x6f94('0x37')]['fields']));_0x391e9c[_0x6f94('0x39')]=_0x391e9c[_0x6f94('0x39')]['length']?_0x391e9c[_0x6f94('0x39')]:_0x675182[_0x6f94('0x34')];_0x391e9c['order']=qs[_0x6f94('0x3f')](_0x56280b[_0x6f94('0x37')][_0x6f94('0x3f')]);_0x391e9c[_0x6f94('0x40')]=qs[_0x6f94('0x38')](_['pick'](_0x56280b[_0x6f94('0x37')],_0x675182['filters']));if(_0x56280b[_0x6f94('0x37')][_0x6f94('0x43')]){_0x391e9c[_0x6f94('0x40')]=_[_0x6f94('0x41')](_0x391e9c['where'],{'$or':_[_0x6f94('0x35')](_0x391e9c[_0x6f94('0x39')],function(_0x32426b){var _0x43cd21={};_0x43cd21[_0x32426b]={'$like':'%'+_0x56280b[_0x6f94('0x37')]['filter']+'%'};return _0x43cd21;})});}_0x391e9c=_[_0x6f94('0x41')]({},_0x391e9c,_0x56280b[_0x6f94('0x44')]);return _0x46dce9['getTeams'](_0x391e9c);}})[_0x6f94('0x2a')](function(_0xf669){if(_0xf669){_0x150fb5=_0xf669[_0x6f94('0x3b')];if(!_0x56280b['query']['hasOwnProperty']('nolimit')){_0x391e9c[_0x6f94('0x22')]=qs[_0x6f94('0x22')](_0x56280b['query'][_0x6f94('0x22')]);_0x391e9c['offset']=qs[_0x6f94('0x24')](_0x56280b[_0x6f94('0x37')][_0x6f94('0x24')]);}return _0x46dce9[_0x6f94('0x67')](_0x391e9c);}})[_0x6f94('0x2a')](function(_0x151b39){if(_0x151b39){return _0x151b39?{'count':_0x150fb5,'rows':_0x151b39}:null;}})[_0x6f94('0x2a')](respondWithResult(_0x1cb3d1,null))[_0x6f94('0x49')](handleError(_0x1cb3d1,null));};exports[_0x6f94('0x69')]=function(_0x5df339,_0x3e8faf,_0x2f9e6f){var _0x15d5d5=_0x5df339[_0x6f94('0x4e')][_0x6f94('0x6a')];return db['Team'][_0x6f94('0x47')]({'where':{'id':_0x15d5d5},'attributes':['id'],'include':[{'model':db[_0x6f94('0x5f')],'as':'Agents','attributes':['id','name',_0x6f94('0x6b'),_0x6f94('0x6c'),_0x6f94('0x6d')],'raw':!![]}]})[_0x6f94('0x2a')](function(_0x3edb2e){if(_0x3edb2e){var _0x441e88=_[_0x6f94('0x6e')](_0x3edb2e,function(_0x4cd16d){var _0x274440=_0x4cd16d[_0x6f94('0x50')]({'plain':!![]});return _0x274440['Agents'];});return db[_0x6f94('0x31')][_0x6f94('0x57')]({'where':{'id':_0x5df339[_0x6f94('0x58')]['id']}})[_0x6f94('0x2a')](function(_0x54a601){return db[_0x6f94('0x6f')][_0x6f94('0x70')](function(_0x18d591){return _0x54a601[_0x6f94('0x69')](_0x15d5d5,{'transaction':_0x18d591})[_0x6f94('0x2a')](function(){return BPromise[_0x6f94('0x71')](_0x441e88,function(_0x19e1a1){return db[_0x6f94('0x5c')][_0x6f94('0x72')]({'where':{'UserId':_0x19e1a1['id'],'SmsQueueId':_0x5df339[_0x6f94('0x58')]['id']},'transaction':_0x18d591});});})[_0x6f94('0x2a')](function(){_0x441e88[_0x6f94('0x73')](function(_0x3b1402){socket[_0x6f94('0x74')](_0x6f94('0x75'),{'UserId':_0x3b1402['id'],'SmsQueueId':_0x54a601['id']});});});});});}})[_0x6f94('0x2a')](respondWithStatusCode(_0x3e8faf,null))['catch'](handleError(_0x3e8faf,null));};exports[_0x6f94('0x76')]=function(_0x22b062,_0x1d0766,_0x5710d9){return db['Team'][_0x6f94('0x47')]({'where':{'id':_0x22b062[_0x6f94('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6f94('0x5f')],'as':_0x6f94('0x77'),'attributes':['id'],'raw':!![]}]})[_0x6f94('0x2a')](handleEntityNotFound(_0x1d0766,null))[_0x6f94('0x2a')](function(_0x5c628c){var _0x1e36c=_[_0x6f94('0x35')](_0x5c628c,'id');var _0x2d3a5b=[];var _0x2e5f57=[];var _0x5d58d7=squel[_0x6f94('0x78')]();_0x5d58d7['field'](_0x6f94('0x79'))[_0x6f94('0x7a')](_0x6f94('0x7b'),'tq')['join'](_0x6f94('0x7c'),'ut',_0x6f94('0x7d'))[_0x6f94('0x40')](_0x6f94('0x7e'),_0x22b062[_0x6f94('0x58')]['id']);for(var _0x27dcaa=0x0;_0x27dcaa<_0x5c628c[_0x6f94('0x3b')];_0x27dcaa+=0x1){let _0x570a5b=_0x5c628c[_0x27dcaa];for(var _0x4bcb99=0x0;_0x4bcb99<_0x570a5b[_0x6f94('0x77')][_0x6f94('0x3b')];_0x4bcb99+=0x1){let _0x344e9d=_0x570a5b[_0x6f94('0x77')][_0x4bcb99];var _0x290935=_0x5d58d7[_0x6f94('0x7f')]();_0x290935[_0x6f94('0x40')](_0x6f94('0x80'),_0x344e9d['id']);_0x2e5f57[_0x6f94('0x81')](db[_0x6f94('0x6f')][_0x6f94('0x37')](_0x290935[_0x6f94('0x82')](),{'type':db[_0x6f94('0x6f')][_0x6f94('0x83')]['SELECT']})[_0x6f94('0x2a')](function(_0x274d15){if(_0x274d15['length']===0x1){return _0x344e9d['id'];}else{var _0x36763c=_[_0x6f94('0x84')](_[_0x6f94('0x35')](_0x274d15,_0x6f94('0x85')),function(_0xf9988e){return _[_0x6f94('0x86')](_0x1e36c,_0xf9988e);});if(_0x36763c){return _0x344e9d['id'];}}}));}}return BPromise[_0x6f94('0x87')](_0x2e5f57)['then'](function(_0x2cf359){_0x2d3a5b=_(_0x2d3a5b)[_0x6f94('0x88')](_0x2cf359)[_0x6f94('0x89')]()[_0x6f94('0x8a')]();return db[_0x6f94('0x31')]['find']({'where':{'id':_0x22b062[_0x6f94('0x58')]['id']}})[_0x6f94('0x2a')](function(_0x452b83){return db[_0x6f94('0x6f')][_0x6f94('0x70')](function(_0x4cbc48){return _0x452b83[_0x6f94('0x76')](_0x22b062[_0x6f94('0x37')][_0x6f94('0x6a')],{'transaction':_0x4cbc48})[_0x6f94('0x2a')](function(){if(!_[_0x6f94('0x8b')](_0x2d3a5b)){return _0x452b83['removeAgents'](_0x2d3a5b,{'transaction':_0x4cbc48});}})[_0x6f94('0x2a')](function(){_0x2d3a5b[_0x6f94('0x73')](function(_0xa2f0f6){socket[_0x6f94('0x74')](_0x6f94('0x8c'),{'UserId':_0xa2f0f6,'SmsQueueId':_0x452b83['id']});});});});});});})[_0x6f94('0x2a')](respondWithStatusCode(_0x1d0766,null))[_0x6f94('0x49')](handleError(_0x1d0766,null));};exports[_0x6f94('0x8d')]=function(_0x894f12,_0x1a66fa,_0x1cafeb){return db[_0x6f94('0x31')][_0x6f94('0x57')]({'where':{'id':_0x894f12['params']['id']}})[_0x6f94('0x2a')](handleEntityNotFound(_0x1a66fa,null))[_0x6f94('0x2a')](function(_0x2028ba){if(_0x2028ba){return _0x2028ba[_0x6f94('0x8d')](_0x894f12[_0x6f94('0x4e')][_0x6f94('0x6a')],_[_0x6f94('0x8e')](_0x894f12[_0x6f94('0x4e')],[_0x6f94('0x6a'),'id'])||{})[_0x6f94('0x8f')](function(_0x2cdb85){for(var _0x5020f2=0x0;_0x5020f2<_0x894f12['body'][_0x6f94('0x6a')][_0x6f94('0x3b')];_0x5020f2+=0x1){socket['emit'](_0x6f94('0x75'),{'UserId':Number(_0x894f12[_0x6f94('0x4e')][_0x6f94('0x6a')][_0x5020f2]),'SmsQueueId':Number(_0x894f12[_0x6f94('0x58')]['id'])});}return _0x2cdb85;});}})['then'](respondWithResult(_0x1a66fa,null))[_0x6f94('0x49')](handleError(_0x1a66fa,null));};exports[_0x6f94('0x90')]=function(_0x583371,_0x281f2c,_0x3b934a){return db[_0x6f94('0x31')][_0x6f94('0x57')]({'where':{'id':_0x583371[_0x6f94('0x58')]['id']}})['then'](handleEntityNotFound(_0x281f2c,null))['then'](function(_0x173099){if(_0x173099){return _0x173099[_0x6f94('0x90')](_0x583371[_0x6f94('0x37')]['ids'])[_0x6f94('0x2a')](function(){if(_[_0x6f94('0x91')](_0x583371['query']['ids'])){for(var _0xad46b9=0x0;_0xad46b9<_0x583371['query'][_0x6f94('0x6a')][_0x6f94('0x3b')];_0xad46b9+=0x1){socket[_0x6f94('0x74')]('userSmsQueue:remove',{'UserId':Number(_0x583371['query'][_0x6f94('0x6a')][_0xad46b9]),'SmsQueueId':Number(_0x583371[_0x6f94('0x58')]['id'])});}}else{socket[_0x6f94('0x74')](_0x6f94('0x8c'),{'UserId':Number(_0x583371[_0x6f94('0x37')][_0x6f94('0x6a')]),'SmsQueueId':Number(_0x583371[_0x6f94('0x58')]['id'])});}});}})[_0x6f94('0x2a')](respondWithStatusCode(_0x281f2c,null))['catch'](handleError(_0x281f2c,null));};exports['getAgents']=function(_0x5e1aae,_0x1e0f1c,_0x1b3448){var _0x2c12ae={};var _0x1c9429={};var _0x81032;var _0x2d6244;return db[_0x6f94('0x31')][_0x6f94('0x5b')]({'where':{'id':_0x5e1aae[_0x6f94('0x58')]['id']}})[_0x6f94('0x2a')](handleEntityNotFound(_0x1e0f1c,null))['then'](function(_0x2dc5b3){if(_0x2dc5b3){_0x81032=_0x2dc5b3;_0x1c9429['model']=_[_0x6f94('0x36')](db[_0x6f94('0x5f')][_0x6f94('0x4b')]);_0x1c9429[_0x6f94('0x37')]=_['keys'](_0x5e1aae[_0x6f94('0x37')]);_0x1c9429[_0x6f94('0x38')]=_[_0x6f94('0x4c')](_0x1c9429[_0x6f94('0x34')],_0x1c9429[_0x6f94('0x37')]);_0x2c12ae[_0x6f94('0x39')]=_[_0x6f94('0x4c')](_0x1c9429[_0x6f94('0x34')],qs[_0x6f94('0x3a')](_0x5e1aae[_0x6f94('0x37')][_0x6f94('0x3a')]));_0x2c12ae[_0x6f94('0x39')]=_0x2c12ae['attributes'][_0x6f94('0x3b')]?_0x2c12ae[_0x6f94('0x39')]:_0x1c9429[_0x6f94('0x34')];_0x2c12ae[_0x6f94('0x3e')]=qs[_0x6f94('0x3f')](_0x5e1aae[_0x6f94('0x37')]['sort']);_0x2c12ae[_0x6f94('0x40')]=qs['filters'](_['pick'](_0x5e1aae[_0x6f94('0x37')],_0x1c9429['filters']));if(_0x5e1aae['query'][_0x6f94('0x43')]){_0x2c12ae[_0x6f94('0x40')]=_['merge'](_0x2c12ae[_0x6f94('0x40')],{'$or':_[_0x6f94('0x35')](_0x2c12ae[_0x6f94('0x39')],function(_0x597a30){var _0xeec2a2={};_0xeec2a2[_0x597a30]={'$like':'%'+_0x5e1aae['query'][_0x6f94('0x43')]+'%'};return _0xeec2a2;})});}_0x2c12ae=_['merge']({},_0x2c12ae,_0x5e1aae[_0x6f94('0x44')]);return _0x81032[_0x6f94('0x92')](_0x2c12ae);}})[_0x6f94('0x2a')](function(_0x414710){if(_0x414710){_0x2d6244=_0x414710['length'];if(!_0x5e1aae[_0x6f94('0x37')][_0x6f94('0x3c')](_0x6f94('0x3d'))){_0x2c12ae[_0x6f94('0x22')]=qs[_0x6f94('0x22')](_0x5e1aae[_0x6f94('0x37')][_0x6f94('0x22')]);_0x2c12ae['offset']=qs[_0x6f94('0x24')](_0x5e1aae[_0x6f94('0x37')][_0x6f94('0x24')]);}return _0x81032[_0x6f94('0x92')](_0x2c12ae);}})[_0x6f94('0x2a')](function(_0x1ac483){if(_0x1ac483){return _0x1ac483?{'count':_0x2d6244,'rows':_0x1ac483}:null;}})[_0x6f94('0x2a')](respondWithResult(_0x1e0f1c,null))[_0x6f94('0x49')](handleError(_0x1e0f1c,null));};
\ No newline at end of file
+var _0xe05d=['online','voicePause','interface','flatMap','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','Team','ids','select','field','from','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','includes','all','union','compact','value','transaction','isEmpty','addAgents','spread','removeAgents','isArray','userSmsQueue:remove','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','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','SmsQueues','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SmsQueue','includeAll','include','findAll','rows','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','body','describe','findOne','UserSmsQueue','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','smsPause','updatedAt','getTeams','addTeams','Agents'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe05d,0x1d2));var _0xde05=function(_0x244920,_0x2d1ac0){_0x244920=_0x244920-0x0;var _0x26534e=_0xe05d[_0x244920];return _0x26534e;};'use strict';var emlformat=require(_0xde05('0x0'));var rimraf=require(_0xde05('0x1'));var zipdir=require(_0xde05('0x2'));var jsonpatch=require(_0xde05('0x3'));var rp=require(_0xde05('0x4'));var moment=require(_0xde05('0x5'));var BPromise=require(_0xde05('0x6'));var Mustache=require(_0xde05('0x7'));var util=require(_0xde05('0x8'));var path=require(_0xde05('0x9'));var sox=require(_0xde05('0xa'));var csv=require(_0xde05('0xb'));var ejs=require(_0xde05('0xc'));var fs=require('fs');var fs_extra=require(_0xde05('0xd'));var _=require(_0xde05('0xe'));var squel=require(_0xde05('0xf'));var crypto=require(_0xde05('0x10'));var jsforce=require(_0xde05('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xde05('0xb'));var querystring=require('querystring');var Papa=require(_0xde05('0x12'));var Redis=require(_0xde05('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xde05('0x14'));var as=require(_0xde05('0x15'));var hardwareService=require(_0xde05('0x16'));var logger=require(_0xde05('0x17'))(_0xde05('0x18'));var utils=require('../../config/utils');var config=require(_0xde05('0x19'));var licenseUtil=require(_0xde05('0x1a'));var db=require(_0xde05('0x1b'))['db'];config[_0xde05('0x1c')]=_[_0xde05('0x1d')](config[_0xde05('0x1c')],{'host':_0xde05('0x1e'),'port':0x18eb});var socket=require(_0xde05('0x1f'))(new Redis(config['redis']));require(_0xde05('0x20'))[_0xde05('0x21')](socket);function respondWithStatusCode(_0x4cc532,_0x528d9e){_0x528d9e=_0x528d9e||0xcc;return function(_0x52c377){if(_0x52c377){return _0x4cc532[_0xde05('0x22')](_0x528d9e);}return _0x4cc532['status'](_0x528d9e)[_0xde05('0x23')]();};}function respondWithResult(_0x5ea3a1,_0x3a6b32){_0x3a6b32=_0x3a6b32||0xc8;return function(_0x578f7a){if(_0x578f7a){return _0x5ea3a1[_0xde05('0x24')](_0x3a6b32)['json'](_0x578f7a);}};}function respondWithFilteredResult(_0x4fe4d4,_0x3404de){return function(_0x1393d9){if(_0x1393d9){var _0x33aef5=typeof _0x3404de[_0xde05('0x25')]===_0xde05('0x26')&&typeof _0x3404de[_0xde05('0x27')]===_0xde05('0x26');var _0x243834=_0x1393d9['count'];var _0x17d54=_0x33aef5?0x0:_0x3404de[_0xde05('0x25')];var _0xdffc27=_0x33aef5?_0x1393d9[_0xde05('0x28')]:_0x3404de[_0xde05('0x25')]+_0x3404de[_0xde05('0x27')];var _0x32ed76;if(_0xdffc27>=_0x243834){_0xdffc27=_0x243834;_0x32ed76=0xc8;}else{_0x32ed76=0xce;}_0x4fe4d4[_0xde05('0x24')](_0x32ed76);return _0x4fe4d4[_0xde05('0x29')]('Content-Range',_0x17d54+'-'+_0xdffc27+'/'+_0x243834)[_0xde05('0x2a')](_0x1393d9);}return null;};}function patchUpdates(_0x47ffea){return function(_0x3c79ca){try{jsonpatch[_0xde05('0x2b')](_0x3c79ca,_0x47ffea,!![]);}catch(_0x540b37){return BPromise[_0xde05('0x2c')](_0x540b37);}return _0x3c79ca[_0xde05('0x2d')]();};}function saveUpdates(_0x5a91ae,_0x474319){return function(_0x1a387a){if(_0x1a387a){return _0x1a387a[_0xde05('0x2e')](_0x5a91ae)[_0xde05('0x2f')](function(_0x4b8699){return _0x4b8699;});}return null;};}function removeEntity(_0x9f76ee,_0xc1095f){return function(_0x20342a){if(_0x20342a){return _0x20342a[_0xde05('0x30')]()['then'](function(){var _0x66ee12=_0x20342a['get']({'plain':!![]});var _0x50f027=_0xde05('0x31');return db['UserProfileResource']['destroy']({'where':{'type':_0x50f027,'resourceId':_0x66ee12['id']}})['then'](function(){return _0x20342a;});})[_0xde05('0x2f')](function(){_0x9f76ee[_0xde05('0x24')](0xcc)[_0xde05('0x23')]();});}};}function handleEntityNotFound(_0x41aff2,_0x5b1172){return function(_0x2532a6){if(!_0x2532a6){_0x41aff2[_0xde05('0x22')](0x194);}return _0x2532a6;};}function handleError(_0x705ddb,_0x3dfc80){_0x3dfc80=_0x3dfc80||0x1f4;return function(_0x42eeb3){logger['error'](_0x42eeb3[_0xde05('0x32')]);if(_0x42eeb3[_0xde05('0x33')]){delete _0x42eeb3[_0xde05('0x33')];}_0x705ddb[_0xde05('0x24')](_0x3dfc80)['send'](_0x42eeb3);};}exports[_0xde05('0x34')]=function(_0x39d9eb,_0x438687){var _0x54cfc6={},_0x144283={},_0x1b0a8a={'count':0x0,'rows':[]};var _0x1ec518=_['map'](db['SmsQueue'][_0xde05('0x35')],function(_0x289f54){return{'name':_0x289f54[_0xde05('0x36')],'type':_0x289f54[_0xde05('0x37')][_0xde05('0x38')]};});_0x144283[_0xde05('0x39')]=_[_0xde05('0x3a')](_0x1ec518,_0xde05('0x33'));_0x144283[_0xde05('0x3b')]=_[_0xde05('0x3c')](_0x39d9eb[_0xde05('0x3b')]);_0x144283[_0xde05('0x3d')]=_[_0xde05('0x3e')](_0x144283[_0xde05('0x39')],_0x144283[_0xde05('0x3b')]);_0x54cfc6[_0xde05('0x3f')]=_[_0xde05('0x3e')](_0x144283[_0xde05('0x39')],qs['fields'](_0x39d9eb[_0xde05('0x3b')][_0xde05('0x40')]));_0x54cfc6['attributes']=_0x54cfc6[_0xde05('0x3f')][_0xde05('0x41')]?_0x54cfc6[_0xde05('0x3f')]:_0x144283[_0xde05('0x39')];if(!_0x39d9eb['query'][_0xde05('0x42')](_0xde05('0x43'))){_0x54cfc6['limit']=qs[_0xde05('0x27')](_0x39d9eb[_0xde05('0x3b')][_0xde05('0x27')]);_0x54cfc6[_0xde05('0x25')]=qs[_0xde05('0x25')](_0x39d9eb[_0xde05('0x3b')][_0xde05('0x25')]);}_0x54cfc6[_0xde05('0x44')]=qs[_0xde05('0x45')](_0x39d9eb['query'][_0xde05('0x45')]);_0x54cfc6[_0xde05('0x46')]=qs[_0xde05('0x3d')](_[_0xde05('0x47')](_0x39d9eb['query'],_0x144283[_0xde05('0x3d')]),_0x1ec518);if(_0x39d9eb[_0xde05('0x3b')][_0xde05('0x48')]){_0x54cfc6[_0xde05('0x46')]=_[_0xde05('0x49')](_0x54cfc6['where'],{'$or':_[_0xde05('0x3a')](_0x1ec518,function(_0x4f97c2){if(_0x4f97c2['type']!=='VIRTUAL'){var _0x37c1b9={};_0x37c1b9[_0x4f97c2[_0xde05('0x33')]]={'$like':'%'+_0x39d9eb[_0xde05('0x3b')][_0xde05('0x48')]+'%'};return _0x37c1b9;}})});}_0x54cfc6=_[_0xde05('0x49')]({},_0x54cfc6,_0x39d9eb[_0xde05('0x4a')]);var _0x8db29a={'where':_0x54cfc6[_0xde05('0x46')]};return db[_0xde05('0x4b')][_0xde05('0x28')](_0x8db29a)[_0xde05('0x2f')](function(_0x465480){_0x1b0a8a[_0xde05('0x28')]=_0x465480;if(_0x39d9eb[_0xde05('0x3b')][_0xde05('0x4c')]){_0x54cfc6[_0xde05('0x4d')]=[{'all':!![]}];}return db[_0xde05('0x4b')][_0xde05('0x4e')](_0x54cfc6);})[_0xde05('0x2f')](function(_0x417f63){_0x1b0a8a[_0xde05('0x4f')]=_0x417f63;return _0x1b0a8a;})[_0xde05('0x2f')](respondWithFilteredResult(_0x438687,_0x54cfc6))[_0xde05('0x50')](handleError(_0x438687,null));};exports[_0xde05('0x51')]=function(_0x2bf268,_0x496f96){var _0x4299aa={'raw':!![],'where':{'id':_0x2bf268[_0xde05('0x52')]['id']}},_0x515967={};_0x515967[_0xde05('0x39')]=_['keys'](db[_0xde05('0x4b')]['rawAttributes']);_0x515967[_0xde05('0x3b')]=_[_0xde05('0x3c')](_0x2bf268['query']);_0x515967['filters']=_[_0xde05('0x3e')](_0x515967[_0xde05('0x39')],_0x515967[_0xde05('0x3b')]);_0x4299aa['attributes']=_[_0xde05('0x3e')](_0x515967[_0xde05('0x39')],qs[_0xde05('0x40')](_0x2bf268[_0xde05('0x3b')][_0xde05('0x40')]));_0x4299aa['attributes']=_0x4299aa[_0xde05('0x3f')][_0xde05('0x41')]?_0x4299aa[_0xde05('0x3f')]:_0x515967[_0xde05('0x39')];if(_0x2bf268['query'][_0xde05('0x4c')]){_0x4299aa[_0xde05('0x4d')]=[{'all':!![]}];}_0x4299aa=_[_0xde05('0x49')]({},_0x4299aa,_0x2bf268[_0xde05('0x4a')]);return db[_0xde05('0x4b')][_0xde05('0x53')](_0x4299aa)[_0xde05('0x2f')](handleEntityNotFound(_0x496f96,null))['then'](respondWithResult(_0x496f96,null))['catch'](handleError(_0x496f96,null));};exports[_0xde05('0x54')]=function(_0x567607,_0x2e937e){return db['SmsQueue']['create'](_0x567607['body'],{})[_0xde05('0x2f')](function(_0x4841e9){var _0x50d341=_0x567607[_0xde05('0x55')][_0xde05('0x56')]({'plain':!![]});if(!_0x50d341)throw new Error(_0xde05('0x57'));if(_0x50d341[_0xde05('0x58')]===_0xde05('0x55')){var _0x5facc5=_0x4841e9['get']({'plain':!![]});var _0xc8e5b3=_0xde05('0x31');return db['UserProfileSection'][_0xde05('0x53')]({'where':{'name':_0xc8e5b3,'userProfileId':_0x50d341[_0xde05('0x59')]},'raw':!![]})[_0xde05('0x2f')](function(_0x4083ed){if(_0x4083ed&&_0x4083ed[_0xde05('0x5a')]===0x0){return db[_0xde05('0x5b')][_0xde05('0x54')]({'name':_0x5facc5[_0xde05('0x33')],'resourceId':_0x5facc5['id'],'type':_0x4083ed[_0xde05('0x33')],'sectionId':_0x4083ed['id']},{})['then'](function(){return _0x4841e9;});}else{return _0x4841e9;}})[_0xde05('0x50')](function(_0x5c8543){logger[_0xde05('0x5c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c8543);throw _0x5c8543;});}return _0x4841e9;})[_0xde05('0x2f')](respondWithResult(_0x2e937e,0xc9))['catch'](handleError(_0x2e937e,null));};exports[_0xde05('0x2e')]=function(_0x10cec1,_0x3c4a04){if(_0x10cec1[_0xde05('0x5d')]['id']){delete _0x10cec1[_0xde05('0x5d')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x10cec1[_0xde05('0x52')]['id']}})['then'](handleEntityNotFound(_0x3c4a04,null))['then'](saveUpdates(_0x10cec1[_0xde05('0x5d')],null))[_0xde05('0x2f')](respondWithResult(_0x3c4a04,null))[_0xde05('0x50')](handleError(_0x3c4a04,null));};exports[_0xde05('0x30')]=function(_0x3aafcb,_0x42668f){return db['SmsQueue'][_0xde05('0x53')]({'where':{'id':_0x3aafcb['params']['id']}})[_0xde05('0x2f')](handleEntityNotFound(_0x42668f,null))[_0xde05('0x2f')](removeEntity(_0x42668f,null))[_0xde05('0x50')](handleError(_0x42668f,null));};exports[_0xde05('0x5e')]=function(_0x56aeba,_0x26bb68){return db[_0xde05('0x4b')][_0xde05('0x5e')]()[_0xde05('0x2f')](respondWithResult(_0x26bb68,null))[_0xde05('0x50')](handleError(_0x26bb68,null));};exports['getMembers']=function(_0xdd6d8f,_0x3cef28,_0x29e7a7){var _0x28188f={'raw':!![],'where':{}},_0x38072e={},_0x24ee22;return db[_0xde05('0x4b')][_0xde05('0x5f')]({'where':{'id':_0xdd6d8f[_0xde05('0x52')]['id']}})[_0xde05('0x2f')](handleEntityNotFound(_0x3cef28,null))['then'](function(_0x25325e){if(_0x25325e){_0x24ee22=_0x25325e[_0xde05('0x56')]({'plain':!![]});_0x38072e['model']=_['keys'](db[_0xde05('0x60')][_0xde05('0x35')]);_0x38072e[_0xde05('0x3b')]=_[_0xde05('0x3c')](_0xdd6d8f[_0xde05('0x3b')]);_0x38072e[_0xde05('0x3d')]=_['intersection'](_0x38072e[_0xde05('0x39')],_0x38072e['query']);_0x28188f['attributes']=_[_0xde05('0x3e')](_0x38072e[_0xde05('0x39')],qs[_0xde05('0x40')](_0xdd6d8f[_0xde05('0x3b')][_0xde05('0x40')]));_0x28188f[_0xde05('0x3f')]=_0x28188f[_0xde05('0x3f')][_0xde05('0x41')]?_0x28188f[_0xde05('0x3f')]:_0x38072e['model'];if(!_0xdd6d8f[_0xde05('0x3b')][_0xde05('0x42')](_0xde05('0x43'))){_0x28188f['limit']=qs[_0xde05('0x27')](_0xdd6d8f[_0xde05('0x3b')][_0xde05('0x27')]);_0x28188f['offset']=qs[_0xde05('0x25')](_0xdd6d8f['query'][_0xde05('0x25')]);}_0x28188f['order']=qs[_0xde05('0x45')](_0xdd6d8f[_0xde05('0x3b')][_0xde05('0x45')]);_0x28188f[_0xde05('0x46')]=qs['filters'](_[_0xde05('0x47')](_0xdd6d8f[_0xde05('0x3b')],_0x38072e['filters']));_0x28188f['where']['SmsQueueId']=_0x25325e['id'];if(_0xdd6d8f['query'][_0xde05('0x48')]){_0x28188f['where']=_['merge'](_0x28188f['where'],{'$or':_[_0xde05('0x3a')](_0x28188f[_0xde05('0x3f')],function(_0x5bf8fd){var _0x4ba752={};_0x4ba752[_0x5bf8fd]={'$like':'%'+_0xdd6d8f[_0xde05('0x3b')]['filter']+'%'};return _0x4ba752;})});}_0x28188f=_['merge']({},_0x28188f,_0xdd6d8f['options']);return db[_0xde05('0x60')][_0xde05('0x4e')](_0x28188f);}})[_0xde05('0x2f')](function(_0x11493c){if(_0x11493c){return db[_0xde05('0x61')][_0xde05('0x62')]({'where':{'id':_['map'](_0x11493c,_0xde05('0x63')),'role':_0xde05('0x64')},'attributes':['id','name','smsPause','updatedAt',_0xde05('0x65')]});}})[_0xde05('0x2f')](function(_0x5c2cba){if(_0x5c2cba){return{'count':_0x5c2cba[_0xde05('0x28')],'rows':_[_0xde05('0x3a')](_0x5c2cba[_0xde05('0x4f')],function(_0x40df5f){return{'membername':_0x40df5f['name'],'UserId':_0x40df5f['id'],'queue_name':_0x24ee22['name'],'SmsQueueId':_0x24ee22['id'],'interface':util[_0xde05('0x66')](_0xde05('0x67'),_0xde05('0x68'),_0x40df5f['name']),'penalty':0x0,'paused':_0x40df5f[_0xde05('0x69')],'createdAt':_0x40df5f['createdAt'],'updatedAt':_0x40df5f[_0xde05('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xde05('0x2f')](respondWithFilteredResult(_0x3cef28,_0x28188f))[_0xde05('0x50')](handleError(_0x3cef28,null));};exports[_0xde05('0x6b')]=function(_0x57dda3,_0x58bfb3,_0x4d268f){var _0x504ace={};var _0x8d8a4d={};var _0x329179;var _0x2c9dd1;return db[_0xde05('0x4b')]['findOne']({'where':{'id':_0x57dda3['params']['id']}})[_0xde05('0x2f')](handleEntityNotFound(_0x58bfb3,null))[_0xde05('0x2f')](function(_0x2e3cdb){if(_0x2e3cdb){_0x329179=_0x2e3cdb;_0x8d8a4d[_0xde05('0x39')]=_[_0xde05('0x3c')](db['Team'][_0xde05('0x35')]);_0x8d8a4d[_0xde05('0x3b')]=_['keys'](_0x57dda3[_0xde05('0x3b')]);_0x8d8a4d[_0xde05('0x3d')]=_[_0xde05('0x3e')](_0x8d8a4d[_0xde05('0x39')],_0x8d8a4d[_0xde05('0x3b')]);_0x504ace[_0xde05('0x3f')]=_['intersection'](_0x8d8a4d[_0xde05('0x39')],qs[_0xde05('0x40')](_0x57dda3[_0xde05('0x3b')]['fields']));_0x504ace[_0xde05('0x3f')]=_0x504ace[_0xde05('0x3f')][_0xde05('0x41')]?_0x504ace[_0xde05('0x3f')]:_0x8d8a4d[_0xde05('0x39')];_0x504ace[_0xde05('0x44')]=qs['sort'](_0x57dda3[_0xde05('0x3b')][_0xde05('0x45')]);_0x504ace[_0xde05('0x46')]=qs[_0xde05('0x3d')](_['pick'](_0x57dda3[_0xde05('0x3b')],_0x8d8a4d[_0xde05('0x3d')]));if(_0x57dda3[_0xde05('0x3b')][_0xde05('0x48')]){_0x504ace['where']=_[_0xde05('0x49')](_0x504ace[_0xde05('0x46')],{'$or':_['map'](_0x504ace[_0xde05('0x3f')],function(_0x2721d0){var _0x45dea1={};_0x45dea1[_0x2721d0]={'$like':'%'+_0x57dda3[_0xde05('0x3b')][_0xde05('0x48')]+'%'};return _0x45dea1;})});}_0x504ace=_[_0xde05('0x49')]({},_0x504ace,_0x57dda3[_0xde05('0x4a')]);return _0x329179[_0xde05('0x6b')](_0x504ace);}})[_0xde05('0x2f')](function(_0x2b198f){if(_0x2b198f){_0x2c9dd1=_0x2b198f[_0xde05('0x41')];if(!_0x57dda3[_0xde05('0x3b')]['hasOwnProperty']('nolimit')){_0x504ace[_0xde05('0x27')]=qs['limit'](_0x57dda3[_0xde05('0x3b')]['limit']);_0x504ace[_0xde05('0x25')]=qs['offset'](_0x57dda3['query'][_0xde05('0x25')]);}return _0x329179['getTeams'](_0x504ace);}})['then'](function(_0x196e8a){if(_0x196e8a){return _0x196e8a?{'count':_0x2c9dd1,'rows':_0x196e8a}:null;}})[_0xde05('0x2f')](respondWithResult(_0x58bfb3,null))[_0xde05('0x50')](handleError(_0x58bfb3,null));};exports[_0xde05('0x6c')]=function(_0x49858d,_0x32ca50,_0x39babd){var _0x2ad40f=_0x49858d[_0xde05('0x5d')]['ids'];return db['Team'][_0xde05('0x4e')]({'where':{'id':_0x2ad40f},'attributes':['id'],'include':[{'model':db[_0xde05('0x61')],'as':_0xde05('0x6d'),'attributes':['id',_0xde05('0x33'),_0xde05('0x6e'),_0xde05('0x6f'),_0xde05('0x70')],'raw':!![]}]})[_0xde05('0x2f')](function(_0xe904d8){if(_0xe904d8){var _0x11d486=_[_0xde05('0x71')](_0xe904d8,function(_0x32f636){var _0x354bdd=_0x32f636[_0xde05('0x56')]({'plain':!![]});return _0x354bdd[_0xde05('0x6d')];});return db[_0xde05('0x4b')][_0xde05('0x53')]({'where':{'id':_0x49858d[_0xde05('0x52')]['id']}})[_0xde05('0x2f')](function(_0x5f0faf){return db['sequelize']['transaction'](function(_0x2d9224){return _0x5f0faf[_0xde05('0x6c')](_0x2ad40f,{'transaction':_0x2d9224})[_0xde05('0x2f')](function(){return BPromise['each'](_0x11d486,function(_0x25d62b){return db[_0xde05('0x60')][_0xde05('0x72')]({'where':{'UserId':_0x25d62b['id'],'SmsQueueId':_0x49858d['params']['id']},'transaction':_0x2d9224});});})[_0xde05('0x2f')](function(){_0x11d486[_0xde05('0x73')](function(_0x94b19){socket[_0xde05('0x74')](_0xde05('0x75'),{'UserId':_0x94b19['id'],'SmsQueueId':_0x5f0faf['id']});});});});});}})[_0xde05('0x2f')](respondWithStatusCode(_0x32ca50,null))['catch'](handleError(_0x32ca50,null));};exports[_0xde05('0x76')]=function(_0x15981d,_0x1e1d9a,_0x5ef1f2){return db[_0xde05('0x77')][_0xde05('0x4e')]({'where':{'id':_0x15981d[_0xde05('0x3b')][_0xde05('0x78')]},'attributes':['id'],'include':[{'model':db[_0xde05('0x61')],'as':_0xde05('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xde05('0x2f')](handleEntityNotFound(_0x1e1d9a,null))[_0xde05('0x2f')](function(_0x27a075){var _0x3b6aeb=_['map'](_0x27a075,'id');var _0x55b74a=[];var _0x31d169=[];var _0x3add19=squel[_0xde05('0x79')]();_0x3add19[_0xde05('0x7a')]('tq.TeamId')[_0xde05('0x7b')]('team_has_sms_queues','tq')[_0xde05('0x7c')]('user_has_teams','ut',_0xde05('0x7d'))[_0xde05('0x46')](_0xde05('0x7e'),_0x15981d[_0xde05('0x52')]['id']);for(var _0x4d76e0=0x0;_0x4d76e0<_0x27a075[_0xde05('0x41')];_0x4d76e0+=0x1){let _0x3a1761=_0x27a075[_0x4d76e0];for(var _0x33a193=0x0;_0x33a193<_0x3a1761[_0xde05('0x6d')][_0xde05('0x41')];_0x33a193+=0x1){let _0x8a9ba9=_0x3a1761[_0xde05('0x6d')][_0x33a193];var _0x33961d=_0x3add19['clone']();_0x33961d[_0xde05('0x46')](_0xde05('0x7f'),_0x8a9ba9['id']);_0x31d169[_0xde05('0x80')](db[_0xde05('0x81')][_0xde05('0x3b')](_0x33961d['toString'](),{'type':db[_0xde05('0x81')][_0xde05('0x82')][_0xde05('0x83')]})[_0xde05('0x2f')](function(_0x320441){if(_0x320441[_0xde05('0x41')]===0x1){return _0x8a9ba9['id'];}else{var _0x499127=_['every'](_[_0xde05('0x3a')](_0x320441,'TeamId'),function(_0x39b8ec){return _[_0xde05('0x84')](_0x3b6aeb,_0x39b8ec);});if(_0x499127){return _0x8a9ba9['id'];}}}));}}return BPromise[_0xde05('0x85')](_0x31d169)['then'](function(_0x24e47e){_0x55b74a=_(_0x55b74a)[_0xde05('0x86')](_0x24e47e)[_0xde05('0x87')]()[_0xde05('0x88')]();return db[_0xde05('0x4b')]['find']({'where':{'id':_0x15981d['params']['id']}})[_0xde05('0x2f')](function(_0x178faa){return db[_0xde05('0x81')][_0xde05('0x89')](function(_0xf356f7){return _0x178faa['removeTeams'](_0x15981d[_0xde05('0x3b')][_0xde05('0x78')],{'transaction':_0xf356f7})['then'](function(){if(!_[_0xde05('0x8a')](_0x55b74a)){return _0x178faa['removeAgents'](_0x55b74a,{'transaction':_0xf356f7});}})[_0xde05('0x2f')](function(){_0x55b74a[_0xde05('0x73')](function(_0x1f1e5e){socket['emit']('userSmsQueue:remove',{'UserId':_0x1f1e5e,'SmsQueueId':_0x178faa['id']});});});});});});})[_0xde05('0x2f')](respondWithStatusCode(_0x1e1d9a,null))[_0xde05('0x50')](handleError(_0x1e1d9a,null));};exports[_0xde05('0x8b')]=function(_0x3cef8c,_0x1a265a,_0x45b8c5){return db[_0xde05('0x4b')][_0xde05('0x53')]({'where':{'id':_0x3cef8c[_0xde05('0x52')]['id']}})[_0xde05('0x2f')](handleEntityNotFound(_0x1a265a,null))['then'](function(_0x1f6d36){if(_0x1f6d36){return _0x1f6d36['addAgents'](_0x3cef8c[_0xde05('0x5d')][_0xde05('0x78')],_['omit'](_0x3cef8c[_0xde05('0x5d')],[_0xde05('0x78'),'id'])||{})[_0xde05('0x8c')](function(_0x4703df){for(var _0x5c2cd7=0x0;_0x5c2cd7<_0x3cef8c[_0xde05('0x5d')]['ids'][_0xde05('0x41')];_0x5c2cd7+=0x1){socket[_0xde05('0x74')](_0xde05('0x75'),{'UserId':Number(_0x3cef8c['body'][_0xde05('0x78')][_0x5c2cd7]),'SmsQueueId':Number(_0x3cef8c[_0xde05('0x52')]['id'])});}return _0x4703df;});}})[_0xde05('0x2f')](respondWithResult(_0x1a265a,null))['catch'](handleError(_0x1a265a,null));};exports[_0xde05('0x8d')]=function(_0x2f67b8,_0x461f04,_0xab2ac3){return db['SmsQueue']['find']({'where':{'id':_0x2f67b8[_0xde05('0x52')]['id']}})['then'](handleEntityNotFound(_0x461f04,null))[_0xde05('0x2f')](function(_0x41600c){if(_0x41600c){return _0x41600c[_0xde05('0x8d')](_0x2f67b8[_0xde05('0x3b')][_0xde05('0x78')])['then'](function(){if(_[_0xde05('0x8e')](_0x2f67b8['query']['ids'])){for(var _0x4fa2bb=0x0;_0x4fa2bb<_0x2f67b8[_0xde05('0x3b')]['ids'][_0xde05('0x41')];_0x4fa2bb+=0x1){socket['emit'](_0xde05('0x8f'),{'UserId':Number(_0x2f67b8['query']['ids'][_0x4fa2bb]),'SmsQueueId':Number(_0x2f67b8[_0xde05('0x52')]['id'])});}}else{socket[_0xde05('0x74')]('userSmsQueue:remove',{'UserId':Number(_0x2f67b8['query'][_0xde05('0x78')]),'SmsQueueId':Number(_0x2f67b8[_0xde05('0x52')]['id'])});}});}})[_0xde05('0x2f')](respondWithStatusCode(_0x461f04,null))[_0xde05('0x50')](handleError(_0x461f04,null));};exports['getAgents']=function(_0x2cebc1,_0x5504d5,_0x400616){var _0x5ee049={};var _0x58cebe={};var _0x4c9a23;var _0x454614;return db['SmsQueue'][_0xde05('0x5f')]({'where':{'id':_0x2cebc1[_0xde05('0x52')]['id']}})[_0xde05('0x2f')](handleEntityNotFound(_0x5504d5,null))['then'](function(_0x3b7479){if(_0x3b7479){_0x4c9a23=_0x3b7479;_0x58cebe['model']=_[_0xde05('0x3c')](db[_0xde05('0x61')]['rawAttributes']);_0x58cebe[_0xde05('0x3b')]=_['keys'](_0x2cebc1['query']);_0x58cebe[_0xde05('0x3d')]=_['intersection'](_0x58cebe['model'],_0x58cebe[_0xde05('0x3b')]);_0x5ee049[_0xde05('0x3f')]=_[_0xde05('0x3e')](_0x58cebe[_0xde05('0x39')],qs[_0xde05('0x40')](_0x2cebc1[_0xde05('0x3b')][_0xde05('0x40')]));_0x5ee049[_0xde05('0x3f')]=_0x5ee049[_0xde05('0x3f')]['length']?_0x5ee049['attributes']:_0x58cebe[_0xde05('0x39')];_0x5ee049[_0xde05('0x44')]=qs[_0xde05('0x45')](_0x2cebc1[_0xde05('0x3b')][_0xde05('0x45')]);_0x5ee049[_0xde05('0x46')]=qs[_0xde05('0x3d')](_['pick'](_0x2cebc1['query'],_0x58cebe[_0xde05('0x3d')]));if(_0x2cebc1[_0xde05('0x3b')]['filter']){_0x5ee049['where']=_[_0xde05('0x49')](_0x5ee049[_0xde05('0x46')],{'$or':_['map'](_0x5ee049[_0xde05('0x3f')],function(_0xbad710){var _0x3029fa={};_0x3029fa[_0xbad710]={'$like':'%'+_0x2cebc1[_0xde05('0x3b')][_0xde05('0x48')]+'%'};return _0x3029fa;})});}_0x5ee049=_[_0xde05('0x49')]({},_0x5ee049,_0x2cebc1['options']);return _0x4c9a23['getAgents'](_0x5ee049);}})[_0xde05('0x2f')](function(_0x3b89d9){if(_0x3b89d9){_0x454614=_0x3b89d9[_0xde05('0x41')];if(!_0x2cebc1['query'][_0xde05('0x42')](_0xde05('0x43'))){_0x5ee049['limit']=qs['limit'](_0x2cebc1[_0xde05('0x3b')]['limit']);_0x5ee049[_0xde05('0x25')]=qs['offset'](_0x2cebc1[_0xde05('0x3b')][_0xde05('0x25')]);}return _0x4c9a23['getAgents'](_0x5ee049);}})[_0xde05('0x2f')](function(_0x2b1ae2){if(_0x2b1ae2){return _0x2b1ae2?{'count':_0x454614,'rows':_0x2b1ae2}:null;}})[_0xde05('0x2f')](respondWithResult(_0x5504d5,null))[_0xde05('0x50')](handleError(_0x5504d5,null));};
\ No newline at end of file
index 34acd90..9c8dd30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9a8=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x523d5b,_0x1808f0){var _0x4d5b4c=function(_0x2e80a6){while(--_0x2e80a6){_0x523d5b['push'](_0x523d5b['shift']());}};_0x4d5b4c(++_0x1808f0);}(_0xd9a8,0x16e));var _0x8d9a=function(_0x3241e0,_0x5f3409){_0x3241e0=_0x3241e0-0x0;var _0x4361f7=_0xd9a8[_0x3241e0];return _0x4361f7;};'use strict';var EventEmitter=require(_0x8d9a('0x0'));var SmsQueue=require(_0x8d9a('0x1'))['db'][_0x8d9a('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x8d9a('0x3')](0x0);var events={'afterCreate':_0x8d9a('0x4'),'afterUpdate':_0x8d9a('0x5'),'afterDestroy':_0x8d9a('0x6')};function emitEvent(_0x124db7){return function(_0x22e422,_0x503cfc,_0x35741f){SmsQueueEvents[_0x8d9a('0x7')](_0x124db7+':'+_0x22e422['id'],_0x22e422);SmsQueueEvents[_0x8d9a('0x7')](_0x124db7,_0x22e422);_0x35741f(null);};}for(var e in events){if(events[_0x8d9a('0x8')](e)){var event=events[e];SmsQueue[_0x8d9a('0x9')](e,emitEvent(event));}}module[_0x8d9a('0xa')]=SmsQueueEvents;
\ No newline at end of file
+var _0xb41d=['save','remove','emit','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb41d,0x71));var _0xdb41=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xb41d[_0x3d42d8];return _0x27fc41;};'use strict';var EventEmitter=require(_0xdb41('0x0'));var SmsQueue=require(_0xdb41('0x1'))['db'][_0xdb41('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xdb41('0x3')](0x0);var events={'afterCreate':_0xdb41('0x4'),'afterUpdate':'update','afterDestroy':_0xdb41('0x5')};function emitEvent(_0x1f3512){return function(_0x34ea26,_0x311277,_0x109e8b){SmsQueueEvents[_0xdb41('0x6')](_0x1f3512+':'+_0x34ea26['id'],_0x34ea26);SmsQueueEvents[_0xdb41('0x6')](_0x1f3512,_0x34ea26);_0x109e8b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xdb41('0x7')](e,emitEvent(event));}}module[_0xdb41('0x8')]=SmsQueueEvents;
\ No newline at end of file
index 7e39482..13f8fef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd581=['SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','define'];(function(_0x254461,_0x45615a){var _0x28ee0e=function(_0x3f9881){while(--_0x3f9881){_0x254461['push'](_0x254461['shift']());}};_0x28ee0e(++_0x45615a);}(_0xd581,0x1a2));var _0x1d58=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xd581[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0x1d58('0x0'));var util=require(_0x1d58('0x1'));var logger=require(_0x1d58('0x2'))(_0x1d58('0x3'));var moment=require(_0x1d58('0x4'));var BPromise=require(_0x1d58('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d58('0x6'));var rimraf=require(_0x1d58('0x7'));var config=require(_0x1d58('0x8'));var attributes=require(_0x1d58('0x9'));module['exports']=function(_0x55f3c1,_0x384788){return _0x55f3c1[_0x1d58('0xa')](_0x1d58('0xb'),attributes,{'tableName':_0x1d58('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe141=['../../config/logger','moment','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','lodash','util'];(function(_0x4d0bba,_0x182ff7){var _0x38a857=function(_0x2a7f73){while(--_0x2a7f73){_0x4d0bba['push'](_0x4d0bba['shift']());}};_0x38a857(++_0x182ff7);}(_0xe141,0x169));var _0x1e14=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0xe141[_0x1f44e4];return _0x591989;};'use strict';var _=require(_0x1e14('0x0'));var util=require(_0x1e14('0x1'));var logger=require(_0x1e14('0x2'))('api');var moment=require(_0x1e14('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e14('0x4'));var rimraf=require(_0x1e14('0x5'));var config=require(_0x1e14('0x6'));var attributes=require(_0x1e14('0x7'));module[_0x1e14('0x8')]=function(_0x134b8e,_0x5284f9){return _0x134b8e[_0x1e14('0x9')](_0x1e14('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fe345ad..d49f742 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb2=['jayson/promise','client','http','redis','localhost','./smsQueue.socket','register','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','map','model','then','stringify','ShowSmsQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1cb2,0x10e));var _0x21cb=function(_0x1df3e5,_0x2d37f1){_0x1df3e5=_0x1df3e5-0x0;var _0x422d0c=_0x1cb2[_0x1df3e5];return _0x422d0c;};'use strict';var _=require(_0x21cb('0x0'));var util=require(_0x21cb('0x1'));var moment=require(_0x21cb('0x2'));var BPromise=require(_0x21cb('0x3'));var rs=require(_0x21cb('0x4'));var fs=require('fs');var Redis=require(_0x21cb('0x5'));var db=require(_0x21cb('0x6'))['db'];var utils=require(_0x21cb('0x7'));var logger=require('../../config/logger')(_0x21cb('0x8'));var config=require(_0x21cb('0x9'));var jayson=require(_0x21cb('0xa'));var client=jayson[_0x21cb('0xb')][_0x21cb('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x21cb('0xd')],{'host':_0x21cb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x21cb('0xd')]));require(_0x21cb('0xf'))[_0x21cb('0x10')](socket);function respondWithRpcPromise(_0x28b21c,_0x4539d9,_0x22781b){return new BPromise(function(_0x1c2b61,_0x531927){return client['request'](_0x28b21c,_0x22781b)['then'](function(_0x3d4e15){logger[_0x21cb('0x11')](_0x21cb('0x12'),_0x4539d9,_0x21cb('0x13'));logger[_0x21cb('0x14')](_0x21cb('0x15'),_0x4539d9,'request\x20sent',JSON['stringify'](_0x3d4e15));if(_0x3d4e15[_0x21cb('0x16')]){if(_0x3d4e15[_0x21cb('0x16')]['code']===0x1f4){logger[_0x21cb('0x16')](_0x21cb('0x12'),_0x4539d9,_0x3d4e15[_0x21cb('0x16')][_0x21cb('0x17')]);return _0x531927(_0x3d4e15[_0x21cb('0x16')][_0x21cb('0x17')]);}logger[_0x21cb('0x16')](_0x21cb('0x12'),_0x4539d9,_0x3d4e15['error'][_0x21cb('0x17')]);return _0x1c2b61(_0x3d4e15['error'][_0x21cb('0x17')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x4539d9,_0x21cb('0x13'));_0x1c2b61(_0x3d4e15['result'][_0x21cb('0x17')]);}})[_0x21cb('0x18')](function(_0x3d088b){logger[_0x21cb('0x16')](_0x21cb('0x12'),_0x4539d9,_0x3d088b);_0x531927(_0x3d088b);});});}exports[_0x21cb('0x19')]=function(_0x1390d0){var _0x43f66f=this;return new Promise(function(_0x4e9980,_0x151637){return db[_0x21cb('0x1a')][_0x21cb('0x1b')]({'raw':_0x1390d0[_0x21cb('0x1c')]?_0x1390d0[_0x21cb('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1390d0[_0x21cb('0x1c')]?_0x1390d0[_0x21cb('0x1c')][_0x21cb('0x1d')]||null:null,'attributes':_0x1390d0[_0x21cb('0x1c')]?_0x1390d0[_0x21cb('0x1c')][_0x21cb('0x1e')]||null:null,'limit':_0x1390d0['options']?_0x1390d0[_0x21cb('0x1c')][_0x21cb('0x1f')]||null:null,'include':_0x1390d0[_0x21cb('0x1c')]?_0x1390d0['options'][_0x21cb('0x20')]?_[_0x21cb('0x21')](_0x1390d0[_0x21cb('0x1c')][_0x21cb('0x20')],function(_0x485e43){return{'model':db[_0x485e43[_0x21cb('0x22')]],'as':_0x485e43['as'],'attributes':_0x485e43[_0x21cb('0x1e')],'include':_0x485e43[_0x21cb('0x20')]?_[_0x21cb('0x21')](_0x485e43['include'],function(_0x16a244){return{'model':db[_0x16a244[_0x21cb('0x22')]],'as':_0x16a244['as'],'attributes':_0x16a244[_0x21cb('0x1e')],'include':_0x16a244[_0x21cb('0x20')]?_[_0x21cb('0x21')](_0x16a244[_0x21cb('0x20')],function(_0x1d7df4){return{'model':db[_0x1d7df4[_0x21cb('0x22')]],'as':_0x1d7df4['as'],'attributes':_0x1d7df4['attributes']};}):[]};}):[]};}):[]:[]})[_0x21cb('0x23')](function(_0x1ad7c5){logger['info'](_0x21cb('0x19'),_0x1390d0);logger['debug'](_0x21cb('0x19'),_0x1390d0,JSON[_0x21cb('0x24')](_0x1ad7c5));_0x4e9980(_0x1ad7c5);})[_0x21cb('0x18')](function(_0x407521){logger[_0x21cb('0x16')](_0x21cb('0x19'),_0x407521[_0x21cb('0x17')],_0x1390d0);_0x151637(_0x43f66f['error'](0x1f4,_0x407521['message']));});});};exports[_0x21cb('0x25')]=function(_0x2923b7){var _0x48c7c8=this;return new Promise(function(_0x46d888,_0x178371){return db[_0x21cb('0x1a')][_0x21cb('0x26')]({'raw':_0x2923b7[_0x21cb('0x1c')]?_0x2923b7[_0x21cb('0x1c')][_0x21cb('0x27')]===undefined?!![]:![]:!![],'where':_0x2923b7[_0x21cb('0x1c')]?_0x2923b7[_0x21cb('0x1c')][_0x21cb('0x1d')]||null:null,'attributes':_0x2923b7[_0x21cb('0x1c')]?_0x2923b7[_0x21cb('0x1c')][_0x21cb('0x1e')]||null:null,'include':_0x2923b7[_0x21cb('0x1c')]?_0x2923b7[_0x21cb('0x1c')][_0x21cb('0x20')]?_[_0x21cb('0x21')](_0x2923b7['options'][_0x21cb('0x20')],function(_0x4e1a3a){return{'model':db[_0x4e1a3a[_0x21cb('0x22')]],'as':_0x4e1a3a['as'],'attributes':_0x4e1a3a[_0x21cb('0x1e')],'include':_0x4e1a3a['include']?_[_0x21cb('0x21')](_0x4e1a3a[_0x21cb('0x20')],function(_0x523542){return{'model':db[_0x523542[_0x21cb('0x22')]],'as':_0x523542['as'],'attributes':_0x523542['attributes'],'include':_0x523542[_0x21cb('0x20')]?_[_0x21cb('0x21')](_0x523542['include'],function(_0x16fc01){return{'model':db[_0x16fc01[_0x21cb('0x22')]],'as':_0x16fc01['as'],'attributes':_0x16fc01[_0x21cb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x21cb('0x23')](function(_0x7f9d43){logger[_0x21cb('0x11')](_0x21cb('0x25'),_0x2923b7);logger[_0x21cb('0x14')](_0x21cb('0x25'),_0x2923b7,JSON['stringify'](_0x7f9d43));_0x46d888(_0x7f9d43);})[_0x21cb('0x18')](function(_0x25f3ab){logger[_0x21cb('0x16')]('ShowSmsQueue',_0x25f3ab[_0x21cb('0x17')],_0x2923b7);_0x178371(_0x48c7c8[_0x21cb('0x16')](0x1f4,_0x25f3ab[_0x21cb('0x17')]));});});};
\ No newline at end of file
+var _0x23c5=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','map','model','attributes','include','ShowSmsQueue','stringify','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x23c5,0x110));var _0x523c=function(_0x5ed775,_0x2a5f1c){_0x5ed775=_0x5ed775-0x0;var _0x304c4d=_0x23c5[_0x5ed775];return _0x304c4d;};'use strict';var _=require(_0x523c('0x0'));var util=require(_0x523c('0x1'));var moment=require(_0x523c('0x2'));var BPromise=require(_0x523c('0x3'));var rs=require(_0x523c('0x4'));var fs=require('fs');var Redis=require(_0x523c('0x5'));var db=require(_0x523c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x523c('0x7'))('rpc');var config=require(_0x523c('0x8'));var jayson=require(_0x523c('0x9'));var client=jayson[_0x523c('0xa')]['http']({'port':0x232a});config['redis']=_[_0x523c('0xb')](config[_0x523c('0xc')],{'host':_0x523c('0xd'),'port':0x18eb});var socket=require(_0x523c('0xe'))(new Redis(config[_0x523c('0xc')]));require('./smsQueue.socket')[_0x523c('0xf')](socket);function respondWithRpcPromise(_0x16f22d,_0x1ca1c5,_0x2c8d8c){return new BPromise(function(_0x5972c4,_0x27c7b0){return client['request'](_0x16f22d,_0x2c8d8c)[_0x523c('0x10')](function(_0x256c80){logger[_0x523c('0x11')](_0x523c('0x12'),_0x1ca1c5,'request\x20sent');logger[_0x523c('0x13')](_0x523c('0x14'),_0x1ca1c5,'request\x20sent',JSON['stringify'](_0x256c80));if(_0x256c80['error']){if(_0x256c80[_0x523c('0x15')][_0x523c('0x16')]===0x1f4){logger[_0x523c('0x15')](_0x523c('0x12'),_0x1ca1c5,_0x256c80[_0x523c('0x15')][_0x523c('0x17')]);return _0x27c7b0(_0x256c80[_0x523c('0x15')][_0x523c('0x17')]);}logger[_0x523c('0x15')](_0x523c('0x12'),_0x1ca1c5,_0x256c80[_0x523c('0x15')][_0x523c('0x17')]);return _0x5972c4(_0x256c80[_0x523c('0x15')][_0x523c('0x17')]);}else{logger[_0x523c('0x11')](_0x523c('0x12'),_0x1ca1c5,_0x523c('0x18'));_0x5972c4(_0x256c80[_0x523c('0x19')][_0x523c('0x17')]);}})[_0x523c('0x1a')](function(_0x587222){logger[_0x523c('0x15')]('SmsQueue,\x20%s,\x20%s',_0x1ca1c5,_0x587222);_0x27c7b0(_0x587222);});});}exports[_0x523c('0x1b')]=function(_0x24a673){var _0x2aec46=this;return new Promise(function(_0xee33df,_0x32057c){return db[_0x523c('0x1c')][_0x523c('0x1d')]({'raw':_0x24a673[_0x523c('0x1e')]?_0x24a673[_0x523c('0x1e')][_0x523c('0x1f')]===undefined?!![]:![]:!![],'where':_0x24a673[_0x523c('0x1e')]?_0x24a673['options'][_0x523c('0x20')]||null:null,'attributes':_0x24a673['options']?_0x24a673[_0x523c('0x1e')]['attributes']||null:null,'limit':_0x24a673[_0x523c('0x1e')]?_0x24a673['options']['limit']||null:null,'include':_0x24a673[_0x523c('0x1e')]?_0x24a673['options']['include']?_[_0x523c('0x21')](_0x24a673[_0x523c('0x1e')]['include'],function(_0x4a50b7){return{'model':db[_0x4a50b7[_0x523c('0x22')]],'as':_0x4a50b7['as'],'attributes':_0x4a50b7[_0x523c('0x23')],'include':_0x4a50b7[_0x523c('0x24')]?_[_0x523c('0x21')](_0x4a50b7['include'],function(_0x31654f){return{'model':db[_0x31654f[_0x523c('0x22')]],'as':_0x31654f['as'],'attributes':_0x31654f['attributes'],'include':_0x31654f[_0x523c('0x24')]?_[_0x523c('0x21')](_0x31654f[_0x523c('0x24')],function(_0x22cb98){return{'model':db[_0x22cb98[_0x523c('0x22')]],'as':_0x22cb98['as'],'attributes':_0x22cb98['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43b00f){logger[_0x523c('0x11')](_0x523c('0x1b'),_0x24a673);logger[_0x523c('0x13')]('GetSmsQueue',_0x24a673,JSON['stringify'](_0x43b00f));_0xee33df(_0x43b00f);})[_0x523c('0x1a')](function(_0x331779){logger[_0x523c('0x15')](_0x523c('0x1b'),_0x331779[_0x523c('0x17')],_0x24a673);_0x32057c(_0x2aec46[_0x523c('0x15')](0x1f4,_0x331779[_0x523c('0x17')]));});});};exports[_0x523c('0x25')]=function(_0x5a5036){var _0x4cd48c=this;return new Promise(function(_0x415007,_0x565dca){return db[_0x523c('0x1c')]['find']({'raw':_0x5a5036[_0x523c('0x1e')]?_0x5a5036[_0x523c('0x1e')][_0x523c('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a5036[_0x523c('0x1e')]?_0x5a5036[_0x523c('0x1e')][_0x523c('0x20')]||null:null,'attributes':_0x5a5036[_0x523c('0x1e')]?_0x5a5036['options']['attributes']||null:null,'include':_0x5a5036[_0x523c('0x1e')]?_0x5a5036[_0x523c('0x1e')][_0x523c('0x24')]?_[_0x523c('0x21')](_0x5a5036['options'][_0x523c('0x24')],function(_0x4e1e56){return{'model':db[_0x4e1e56[_0x523c('0x22')]],'as':_0x4e1e56['as'],'attributes':_0x4e1e56[_0x523c('0x23')],'include':_0x4e1e56[_0x523c('0x24')]?_[_0x523c('0x21')](_0x4e1e56['include'],function(_0x570ed9){return{'model':db[_0x570ed9[_0x523c('0x22')]],'as':_0x570ed9['as'],'attributes':_0x570ed9[_0x523c('0x23')],'include':_0x570ed9[_0x523c('0x24')]?_[_0x523c('0x21')](_0x570ed9[_0x523c('0x24')],function(_0xaed066){return{'model':db[_0xaed066[_0x523c('0x22')]],'as':_0xaed066['as'],'attributes':_0xaed066[_0x523c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x523c('0x10')](function(_0x374629){logger[_0x523c('0x11')]('ShowSmsQueue',_0x5a5036);logger[_0x523c('0x13')](_0x523c('0x25'),_0x5a5036,JSON[_0x523c('0x26')](_0x374629));_0x415007(_0x374629);})['catch'](function(_0x389e53){logger[_0x523c('0x15')]('ShowSmsQueue',_0x389e53['message'],_0x5a5036);_0x565dca(_0x4cd48c[_0x523c('0x15')](0x1f4,_0x389e53[_0x523c('0x17')]));});});};
\ No newline at end of file
index 1bfdfb2..849a8d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1b7=['register','length','smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener'];(function(_0x741cc3,_0xf44e7c){var _0x5e992f=function(_0x2f0214){while(--_0x2f0214){_0x741cc3['push'](_0x741cc3['shift']());}};_0x5e992f(++_0xf44e7c);}(_0xb1b7,0x8a));var _0x7b1b=function(_0x2bf59d,_0x432996){_0x2bf59d=_0x2bf59d-0x0;var _0x2e012d=_0xb1b7[_0x2bf59d];return _0x2e012d;};'use strict';var SmsQueueEvents=require(_0x7b1b('0x0'));var events=[_0x7b1b('0x1'),_0x7b1b('0x2'),_0x7b1b('0x3')];function createListener(_0x3662d4,_0x4f4166){return function(_0x34f6a4){_0x4f4166[_0x7b1b('0x4')](_0x3662d4,_0x34f6a4);};}function removeListener(_0x2eb4be,_0xd91bf1){return function(){SmsQueueEvents[_0x7b1b('0x5')](_0x2eb4be,_0xd91bf1);};}exports[_0x7b1b('0x6')]=function(_0x5c6828){for(var _0x3c1b09=0x0,_0x321df3=events[_0x7b1b('0x7')];_0x3c1b09<_0x321df3;_0x3c1b09++){var _0x4cce68=events[_0x3c1b09];var _0xcbc749=createListener(_0x7b1b('0x8')+_0x4cce68,_0x5c6828);SmsQueueEvents['on'](_0x4cce68,_0xcbc749);}};
\ No newline at end of file
+var _0x2799=['./smsQueue.events','save','remove','update','emit','removeListener','length','smsQueue:'];(function(_0x547262,_0x4a7b2e){var _0x1972f1=function(_0x5ad844){while(--_0x5ad844){_0x547262['push'](_0x547262['shift']());}};_0x1972f1(++_0x4a7b2e);}(_0x2799,0x110));var _0x9279=function(_0x47719d,_0x489789){_0x47719d=_0x47719d-0x0;var _0x5d74ce=_0x2799[_0x47719d];return _0x5d74ce;};'use strict';var SmsQueueEvents=require(_0x9279('0x0'));var events=[_0x9279('0x1'),_0x9279('0x2'),_0x9279('0x3')];function createListener(_0x4c4a17,_0x301bc9){return function(_0x2c1fc5){_0x301bc9[_0x9279('0x4')](_0x4c4a17,_0x2c1fc5);};}function removeListener(_0x387da9,_0x1c8717){return function(){SmsQueueEvents[_0x9279('0x5')](_0x387da9,_0x1c8717);};}exports['register']=function(_0x5036c5){for(var _0x52d214=0x0,_0x13ea92=events[_0x9279('0x6')];_0x52d214<_0x13ea92;_0x52d214++){var _0x22af98=events[_0x52d214];var _0x4fc4a0=createListener(_0x9279('0x7')+_0x22af98,_0x5036c5);SmsQueueEvents['on'](_0x22af98,_0x4fc4a0);}};
\ No newline at end of file
index 62f4043..d21f536 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc5d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','get','/describe','describe','post','create','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x16c6c6,_0x35bad8){var _0x2ada32=function(_0x7b3282){while(--_0x7b3282){_0x16c6c6['push'](_0x16c6c6['shift']());}};_0x2ada32(++_0x35bad8);}(_0xbc5d,0x19e));var _0xdbc5=function(_0x491df9,_0x45d7f1){_0x491df9=_0x491df9-0x0;var _0x461a78=_0xbc5d[_0x491df9];return _0x461a78;};'use strict';var multer=require('multer');var util=require(_0xdbc5('0x0'));var path=require(_0xdbc5('0x1'));var timeout=require(_0xdbc5('0x2'));var express=require(_0xdbc5('0x3'));var router=express[_0xdbc5('0x4')]();var fs_extra=require(_0xdbc5('0x5'));var auth=require(_0xdbc5('0x6'));var interaction=require(_0xdbc5('0x7'));var config=require(_0xdbc5('0x8'));var controller=require(_0xdbc5('0x9'));router['get']('/',auth[_0xdbc5('0xa')](),controller['index']);router[_0xdbc5('0xb')](_0xdbc5('0xc'),auth[_0xdbc5('0xa')](),controller[_0xdbc5('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xdbc5('0xe')]('/',auth[_0xdbc5('0xa')](),controller[_0xdbc5('0xf')]);router['put'](_0xdbc5('0x10'),auth[_0xdbc5('0xa')](),controller[_0xdbc5('0x11')]);router['delete'](_0xdbc5('0x10'),auth[_0xdbc5('0xa')](),controller[_0xdbc5('0x12')]);module[_0xdbc5('0x13')]=router;
\ No newline at end of file
+var _0x0763=['../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x4ad6e4,_0x103161){var _0x11e62a=function(_0x10dc1e){while(--_0x10dc1e){_0x4ad6e4['push'](_0x4ad6e4['shift']());}};_0x11e62a(++_0x103161);}(_0x0763,0x87));var _0x3076=function(_0x2ab3d9,_0x50e716){_0x2ab3d9=_0x2ab3d9-0x0;var _0x210a54=_0x0763[_0x2ab3d9];return _0x210a54;};'use strict';var multer=require(_0x3076('0x0'));var util=require('util');var path=require(_0x3076('0x1'));var timeout=require(_0x3076('0x2'));var express=require('express');var router=express[_0x3076('0x3')]();var fs_extra=require(_0x3076('0x4'));var auth=require(_0x3076('0x5'));var interaction=require(_0x3076('0x6'));var config=require('../../config/environment');var controller=require(_0x3076('0x7'));router[_0x3076('0x8')]('/',auth[_0x3076('0x9')](),controller[_0x3076('0xa')]);router[_0x3076('0x8')](_0x3076('0xb'),auth[_0x3076('0x9')](),controller[_0x3076('0xc')]);router[_0x3076('0x8')](_0x3076('0xd'),auth['isAuthenticated'](),controller[_0x3076('0xe')]);router[_0x3076('0xf')]('/',auth[_0x3076('0x9')](),controller['create']);router['put'](_0x3076('0xd'),auth[_0x3076('0x9')](),controller[_0x3076('0x10')]);router[_0x3076('0x11')](_0x3076('0xd'),auth['isAuthenticated'](),controller[_0x3076('0x12')]);module[_0x3076('0x13')]=router;
\ No newline at end of file
index 56c6a46..601e792 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7ba=['sequelize','exports','STRING','DATE','moment'];(function(_0x4dfa20,_0x35afb5){var _0x146afc=function(_0x5a4344){while(--_0x5a4344){_0x4dfa20['push'](_0x4dfa20['shift']());}};_0x146afc(++_0x35afb5);}(_0xd7ba,0xef));var _0xad7b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd7ba[_0x19e35c];return _0x3e1fe8;};'use strict';var moment=require(_0xad7b('0x0'));var Sequelize=require(_0xad7b('0x1'));module[_0xad7b('0x2')]={'uniqueid':{'type':Sequelize[_0xad7b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xad7b('0x3')]},'joinAt':{'type':Sequelize[_0xad7b('0x4')]},'leaveAt':{'type':Sequelize[_0xad7b('0x4')]},'acceptAt':{'type':Sequelize[_0xad7b('0x4')]},'exitAt':{'type':Sequelize[_0xad7b('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0f37=['STRING','DATE','sequelize'];(function(_0x31ff78,_0x423e2c){var _0x484272=function(_0x33783a){while(--_0x33783a){_0x31ff78['push'](_0x31ff78['shift']());}};_0x484272(++_0x423e2c);}(_0x0f37,0x191));var _0x70f3=function(_0xf24612,_0x288e25){_0xf24612=_0xf24612-0x0;var _0x3388ee=_0x0f37[_0xf24612];return _0x3388ee;};'use strict';var moment=require('moment');var Sequelize=require(_0x70f3('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x70f3('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x70f3('0x1')]},'joinAt':{'type':Sequelize[_0x70f3('0x2')]},'leaveAt':{'type':Sequelize[_0x70f3('0x2')]},'acceptAt':{'type':Sequelize[_0x70f3('0x2')]},'exitAt':{'type':Sequelize[_0x70f3('0x2')]},'reason':{'type':Sequelize[_0x70f3('0x1')]}};
\ No newline at end of file
index 292db25..68c6eb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7e3=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','offset','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','send','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','show','params','keys','merge','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x4a6979,_0x5f3d1a){var _0x226f93=function(_0x471572){while(--_0x471572){_0x4a6979['push'](_0x4a6979['shift']());}};_0x226f93(++_0x5f3d1a);}(_0xf7e3,0xdf));var _0x3f7e=function(_0x327fde,_0x5536f3){_0x327fde=_0x327fde-0x0;var _0x2cd41e=_0xf7e3[_0x327fde];return _0x2cd41e;};'use strict';var emlformat=require(_0x3f7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f7e('0x1'));var jsonpatch=require(_0x3f7e('0x2'));var rp=require(_0x3f7e('0x3'));var moment=require(_0x3f7e('0x4'));var BPromise=require(_0x3f7e('0x5'));var Mustache=require(_0x3f7e('0x6'));var util=require('util');var path=require(_0x3f7e('0x7'));var sox=require(_0x3f7e('0x8'));var csv=require(_0x3f7e('0x9'));var ejs=require(_0x3f7e('0xa'));var fs=require('fs');var fs_extra=require(_0x3f7e('0xb'));var _=require(_0x3f7e('0xc'));var squel=require(_0x3f7e('0xd'));var crypto=require('crypto');var jsforce=require(_0x3f7e('0xe'));var deskjs=require(_0x3f7e('0xf'));var toCsv=require(_0x3f7e('0x9'));var querystring=require(_0x3f7e('0x10'));var Papa=require(_0x3f7e('0x11'));var Redis=require(_0x3f7e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3f7e('0x13'));var as=require(_0x3f7e('0x14'));var hardwareService=require(_0x3f7e('0x15'));var logger=require(_0x3f7e('0x16'))(_0x3f7e('0x17'));var utils=require(_0x3f7e('0x18'));var config=require(_0x3f7e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f7e('0x1a'))['db'];function respondWithStatusCode(_0x51ae98,_0x5c4815){_0x5c4815=_0x5c4815||0xcc;return function(_0x282122){if(_0x282122){return _0x51ae98['sendStatus'](_0x5c4815);}return _0x51ae98[_0x3f7e('0x1b')](_0x5c4815)[_0x3f7e('0x1c')]();};}function respondWithResult(_0x506aed,_0x1707e7){_0x1707e7=_0x1707e7||0xc8;return function(_0x14921b){if(_0x14921b){return _0x506aed[_0x3f7e('0x1b')](_0x1707e7)[_0x3f7e('0x1d')](_0x14921b);}};}function respondWithFilteredResult(_0x1bdf09,_0xbe408e){return function(_0x3ff15d){if(_0x3ff15d){var _0x4d2d75=typeof _0xbe408e['offset']==='undefined'&&typeof _0xbe408e[_0x3f7e('0x1e')]===_0x3f7e('0x1f');var _0x106795=_0x3ff15d['count'];var _0x39845b=_0x4d2d75?0x0:_0xbe408e[_0x3f7e('0x20')];var _0x4cb51c=_0x4d2d75?_0x3ff15d[_0x3f7e('0x21')]:_0xbe408e[_0x3f7e('0x20')]+_0xbe408e['limit'];var _0x372403;if(_0x4cb51c>=_0x106795){_0x4cb51c=_0x106795;_0x372403=0xc8;}else{_0x372403=0xce;}_0x1bdf09[_0x3f7e('0x1b')](_0x372403);return _0x1bdf09[_0x3f7e('0x22')](_0x3f7e('0x23'),_0x39845b+'-'+_0x4cb51c+'/'+_0x106795)[_0x3f7e('0x1d')](_0x3ff15d);}return null;};}function patchUpdates(_0x2784f1){return function(_0x40ac2c){try{jsonpatch['apply'](_0x40ac2c,_0x2784f1,!![]);}catch(_0xcb9cbf){return BPromise[_0x3f7e('0x24')](_0xcb9cbf);}return _0x40ac2c[_0x3f7e('0x25')]();};}function saveUpdates(_0x20b5dd,_0x1ee44a){return function(_0x4e1c48){if(_0x4e1c48){return _0x4e1c48[_0x3f7e('0x26')](_0x20b5dd)[_0x3f7e('0x27')](function(_0x1b82b7){return _0x1b82b7;});}return null;};}function removeEntity(_0x2b965d,_0x445f74){return function(_0x414453){if(_0x414453){return _0x414453[_0x3f7e('0x28')]()[_0x3f7e('0x27')](function(){_0x2b965d[_0x3f7e('0x1b')](0xcc)[_0x3f7e('0x1c')]();});}};}function handleEntityNotFound(_0x3e937c,_0x5edace){return function(_0x1e0f92){if(!_0x1e0f92){_0x3e937c[_0x3f7e('0x29')](0x194);}return _0x1e0f92;};}function handleError(_0x4a15e2,_0x2f0fc2){_0x2f0fc2=_0x2f0fc2||0x1f4;return function(_0xec40ee){logger[_0x3f7e('0x2a')](_0xec40ee[_0x3f7e('0x2b')]);if(_0xec40ee['name']){delete _0xec40ee['name'];}_0x4a15e2[_0x3f7e('0x1b')](_0x2f0fc2)[_0x3f7e('0x2c')](_0xec40ee);};}exports['index']=function(_0x922fed,_0x2dff10){var _0x9ede9={},_0x25cc7a={},_0x50e445={'count':0x0,'rows':[]};var _0x136af0=_[_0x3f7e('0x2d')](db[_0x3f7e('0x2e')][_0x3f7e('0x2f')],function(_0x1ce6df){return{'name':_0x1ce6df[_0x3f7e('0x30')],'type':_0x1ce6df[_0x3f7e('0x31')][_0x3f7e('0x32')]};});_0x25cc7a[_0x3f7e('0x33')]=_['map'](_0x136af0,_0x3f7e('0x34'));_0x25cc7a[_0x3f7e('0x35')]=_['keys'](_0x922fed[_0x3f7e('0x35')]);_0x25cc7a['filters']=_[_0x3f7e('0x36')](_0x25cc7a[_0x3f7e('0x33')],_0x25cc7a[_0x3f7e('0x35')]);_0x9ede9[_0x3f7e('0x37')]=_['intersection'](_0x25cc7a[_0x3f7e('0x33')],qs[_0x3f7e('0x38')](_0x922fed[_0x3f7e('0x35')][_0x3f7e('0x38')]));_0x9ede9[_0x3f7e('0x37')]=_0x9ede9[_0x3f7e('0x37')][_0x3f7e('0x39')]?_0x9ede9[_0x3f7e('0x37')]:_0x25cc7a[_0x3f7e('0x33')];if(!_0x922fed[_0x3f7e('0x35')][_0x3f7e('0x3a')]('nolimit')){_0x9ede9[_0x3f7e('0x1e')]=qs[_0x3f7e('0x1e')](_0x922fed['query']['limit']);_0x9ede9[_0x3f7e('0x20')]=qs['offset'](_0x922fed['query']['offset']);}_0x9ede9[_0x3f7e('0x3b')]=qs[_0x3f7e('0x3c')](_0x922fed['query'][_0x3f7e('0x3c')]);_0x9ede9[_0x3f7e('0x3d')]=qs[_0x3f7e('0x3e')](_[_0x3f7e('0x3f')](_0x922fed[_0x3f7e('0x35')],_0x25cc7a['filters']),_0x136af0);if(_0x922fed[_0x3f7e('0x35')][_0x3f7e('0x40')]){_0x9ede9[_0x3f7e('0x3d')]=_['merge'](_0x9ede9[_0x3f7e('0x3d')],{'$or':_[_0x3f7e('0x2d')](_0x136af0,function(_0x3d784a){if(_0x3d784a[_0x3f7e('0x31')]!==_0x3f7e('0x41')){var _0x2042b7={};_0x2042b7[_0x3d784a[_0x3f7e('0x34')]]={'$like':'%'+_0x922fed[_0x3f7e('0x35')]['filter']+'%'};return _0x2042b7;}})});}_0x9ede9=_['merge']({},_0x9ede9,_0x922fed[_0x3f7e('0x42')]);var _0x2fb078={'where':_0x9ede9[_0x3f7e('0x3d')]};return db['SmsQueueReport'][_0x3f7e('0x21')](_0x2fb078)[_0x3f7e('0x27')](function(_0x399022){_0x50e445[_0x3f7e('0x21')]=_0x399022;if(_0x922fed['query'][_0x3f7e('0x43')]){_0x9ede9[_0x3f7e('0x44')]=[{'all':!![]}];}return db[_0x3f7e('0x2e')][_0x3f7e('0x45')](_0x9ede9);})[_0x3f7e('0x27')](function(_0x4e53f1){_0x50e445['rows']=_0x4e53f1;return _0x50e445;})[_0x3f7e('0x27')](respondWithFilteredResult(_0x2dff10,_0x9ede9))['catch'](handleError(_0x2dff10,null));};exports[_0x3f7e('0x46')]=function(_0x107d53,_0x44b640){var _0x43c9b5={'raw':!![],'where':{'id':_0x107d53[_0x3f7e('0x47')]['id']}},_0x75d7a5={};_0x75d7a5[_0x3f7e('0x33')]=_[_0x3f7e('0x48')](db['SmsQueueReport'][_0x3f7e('0x2f')]);_0x75d7a5[_0x3f7e('0x35')]=_[_0x3f7e('0x48')](_0x107d53['query']);_0x75d7a5[_0x3f7e('0x3e')]=_[_0x3f7e('0x36')](_0x75d7a5[_0x3f7e('0x33')],_0x75d7a5[_0x3f7e('0x35')]);_0x43c9b5[_0x3f7e('0x37')]=_[_0x3f7e('0x36')](_0x75d7a5[_0x3f7e('0x33')],qs[_0x3f7e('0x38')](_0x107d53[_0x3f7e('0x35')][_0x3f7e('0x38')]));_0x43c9b5[_0x3f7e('0x37')]=_0x43c9b5[_0x3f7e('0x37')]['length']?_0x43c9b5['attributes']:_0x75d7a5[_0x3f7e('0x33')];if(_0x107d53[_0x3f7e('0x35')][_0x3f7e('0x43')]){_0x43c9b5['include']=[{'all':!![]}];}_0x43c9b5=_[_0x3f7e('0x49')]({},_0x43c9b5,_0x107d53[_0x3f7e('0x42')]);return db[_0x3f7e('0x2e')]['find'](_0x43c9b5)[_0x3f7e('0x27')](handleEntityNotFound(_0x44b640,null))[_0x3f7e('0x27')](respondWithResult(_0x44b640,null))[_0x3f7e('0x4a')](handleError(_0x44b640,null));};exports['create']=function(_0x3e5290,_0x5c86a2){return db[_0x3f7e('0x2e')][_0x3f7e('0x4b')](_0x3e5290[_0x3f7e('0x4c')],{})[_0x3f7e('0x27')](respondWithResult(_0x5c86a2,0xc9))[_0x3f7e('0x4a')](handleError(_0x5c86a2,null));};exports[_0x3f7e('0x26')]=function(_0x5683ab,_0x3bc02b){if(_0x5683ab['body']['id']){delete _0x5683ab[_0x3f7e('0x4c')]['id'];}return db[_0x3f7e('0x2e')]['find']({'where':{'id':_0x5683ab['params']['id']}})[_0x3f7e('0x27')](handleEntityNotFound(_0x3bc02b,null))['then'](saveUpdates(_0x5683ab[_0x3f7e('0x4c')],null))[_0x3f7e('0x27')](respondWithResult(_0x3bc02b,null))[_0x3f7e('0x4a')](handleError(_0x3bc02b,null));};exports['destroy']=function(_0x244913,_0x472049){return db['SmsQueueReport'][_0x3f7e('0x4d')]({'where':{'id':_0x244913[_0x3f7e('0x47')]['id']}})['then'](handleEntityNotFound(_0x472049,null))[_0x3f7e('0x27')](removeEntity(_0x472049,null))[_0x3f7e('0x4a')](handleError(_0x472049,null));};exports[_0x3f7e('0x4e')]=function(_0x414019,_0x529c13){return db[_0x3f7e('0x2e')][_0x3f7e('0x4e')]()['then'](respondWithResult(_0x529c13,null))['catch'](handleError(_0x529c13,null));};
\ No newline at end of file
+var _0xd248=['params','describe','eml-format','zip-dir','fast-json-patch','request-promise','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','index','map','SmsQueueReport','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','options','find','body'];(function(_0x371d28,_0x5ae85c){var _0x4073ec=function(_0x580cbe){while(--_0x580cbe){_0x371d28['push'](_0x371d28['shift']());}};_0x4073ec(++_0x5ae85c);}(_0xd248,0x16a));var _0x8d24=function(_0x324d77,_0x307ef7){_0x324d77=_0x324d77-0x0;var _0x2a77a7=_0xd248[_0x324d77];return _0x2a77a7;};'use strict';var emlformat=require(_0x8d24('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d24('0x1'));var jsonpatch=require(_0x8d24('0x2'));var rp=require(_0x8d24('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8d24('0x4'));var csv=require('to-csv');var ejs=require(_0x8d24('0x5'));var fs=require('fs');var fs_extra=require(_0x8d24('0x6'));var _=require(_0x8d24('0x7'));var squel=require(_0x8d24('0x8'));var crypto=require(_0x8d24('0x9'));var jsforce=require(_0x8d24('0xa'));var deskjs=require(_0x8d24('0xb'));var toCsv=require(_0x8d24('0xc'));var querystring=require(_0x8d24('0xd'));var Papa=require(_0x8d24('0xe'));var Redis=require('ioredis');var authService=require(_0x8d24('0xf'));var qs=require(_0x8d24('0x10'));var as=require(_0x8d24('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d24('0x12'))('api');var utils=require(_0x8d24('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8d24('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50328a,_0x4523c3){_0x4523c3=_0x4523c3||0xcc;return function(_0x2c4526){if(_0x2c4526){return _0x50328a['sendStatus'](_0x4523c3);}return _0x50328a[_0x8d24('0x15')](_0x4523c3)[_0x8d24('0x16')]();};}function respondWithResult(_0x36e6aa,_0x34edab){_0x34edab=_0x34edab||0xc8;return function(_0x3c82c0){if(_0x3c82c0){return _0x36e6aa[_0x8d24('0x15')](_0x34edab)[_0x8d24('0x17')](_0x3c82c0);}};}function respondWithFilteredResult(_0x17344b,_0x149f9e){return function(_0x5efed5){if(_0x5efed5){var _0x61f522=typeof _0x149f9e[_0x8d24('0x18')]===_0x8d24('0x19')&&typeof _0x149f9e[_0x8d24('0x1a')]===_0x8d24('0x19');var _0x4e9ada=_0x5efed5['count'];var _0x520d38=_0x61f522?0x0:_0x149f9e['offset'];var _0x56bcae=_0x61f522?_0x5efed5[_0x8d24('0x1b')]:_0x149f9e[_0x8d24('0x18')]+_0x149f9e[_0x8d24('0x1a')];var _0x4f2053;if(_0x56bcae>=_0x4e9ada){_0x56bcae=_0x4e9ada;_0x4f2053=0xc8;}else{_0x4f2053=0xce;}_0x17344b['status'](_0x4f2053);return _0x17344b[_0x8d24('0x1c')](_0x8d24('0x1d'),_0x520d38+'-'+_0x56bcae+'/'+_0x4e9ada)[_0x8d24('0x17')](_0x5efed5);}return null;};}function patchUpdates(_0x59e8a0){return function(_0xacb32c){try{jsonpatch[_0x8d24('0x1e')](_0xacb32c,_0x59e8a0,!![]);}catch(_0x883d6){return BPromise['reject'](_0x883d6);}return _0xacb32c[_0x8d24('0x1f')]();};}function saveUpdates(_0x2048af,_0x346611){return function(_0x4e2902){if(_0x4e2902){return _0x4e2902[_0x8d24('0x20')](_0x2048af)[_0x8d24('0x21')](function(_0x1233a7){return _0x1233a7;});}return null;};}function removeEntity(_0x498bbd,_0x2d7903){return function(_0x540b97){if(_0x540b97){return _0x540b97['destroy']()[_0x8d24('0x21')](function(){_0x498bbd[_0x8d24('0x15')](0xcc)[_0x8d24('0x16')]();});}};}function handleEntityNotFound(_0x4c9b8c,_0x5c348f){return function(_0x5aa77a){if(!_0x5aa77a){_0x4c9b8c[_0x8d24('0x22')](0x194);}return _0x5aa77a;};}function handleError(_0x2871dd,_0x2e1920){_0x2e1920=_0x2e1920||0x1f4;return function(_0x32dc23){logger[_0x8d24('0x23')](_0x32dc23[_0x8d24('0x24')]);if(_0x32dc23['name']){delete _0x32dc23[_0x8d24('0x25')];}_0x2871dd[_0x8d24('0x15')](_0x2e1920)['send'](_0x32dc23);};}exports[_0x8d24('0x26')]=function(_0x29246a,_0x525f1e){var _0x4c798f={},_0x5a78ad={},_0x502ce9={'count':0x0,'rows':[]};var _0x302c6e=_[_0x8d24('0x27')](db[_0x8d24('0x28')]['rawAttributes'],function(_0x2d0313){return{'name':_0x2d0313[_0x8d24('0x29')],'type':_0x2d0313[_0x8d24('0x2a')][_0x8d24('0x2b')]};});_0x5a78ad[_0x8d24('0x2c')]=_[_0x8d24('0x27')](_0x302c6e,_0x8d24('0x25'));_0x5a78ad[_0x8d24('0x2d')]=_['keys'](_0x29246a[_0x8d24('0x2d')]);_0x5a78ad['filters']=_[_0x8d24('0x2e')](_0x5a78ad[_0x8d24('0x2c')],_0x5a78ad[_0x8d24('0x2d')]);_0x4c798f[_0x8d24('0x2f')]=_['intersection'](_0x5a78ad[_0x8d24('0x2c')],qs[_0x8d24('0x30')](_0x29246a['query']['fields']));_0x4c798f[_0x8d24('0x2f')]=_0x4c798f['attributes'][_0x8d24('0x31')]?_0x4c798f[_0x8d24('0x2f')]:_0x5a78ad[_0x8d24('0x2c')];if(!_0x29246a[_0x8d24('0x2d')]['hasOwnProperty'](_0x8d24('0x32'))){_0x4c798f[_0x8d24('0x1a')]=qs['limit'](_0x29246a[_0x8d24('0x2d')][_0x8d24('0x1a')]);_0x4c798f[_0x8d24('0x18')]=qs[_0x8d24('0x18')](_0x29246a['query']['offset']);}_0x4c798f[_0x8d24('0x33')]=qs[_0x8d24('0x34')](_0x29246a[_0x8d24('0x2d')]['sort']);_0x4c798f['where']=qs[_0x8d24('0x35')](_[_0x8d24('0x36')](_0x29246a[_0x8d24('0x2d')],_0x5a78ad[_0x8d24('0x35')]),_0x302c6e);if(_0x29246a[_0x8d24('0x2d')]['filter']){_0x4c798f[_0x8d24('0x37')]=_[_0x8d24('0x38')](_0x4c798f[_0x8d24('0x37')],{'$or':_[_0x8d24('0x27')](_0x302c6e,function(_0x4b1de7){if(_0x4b1de7[_0x8d24('0x2a')]!==_0x8d24('0x39')){var _0x3f7c09={};_0x3f7c09[_0x4b1de7[_0x8d24('0x25')]]={'$like':'%'+_0x29246a[_0x8d24('0x2d')][_0x8d24('0x3a')]+'%'};return _0x3f7c09;}})});}_0x4c798f=_[_0x8d24('0x38')]({},_0x4c798f,_0x29246a['options']);var _0x5d5003={'where':_0x4c798f[_0x8d24('0x37')]};return db[_0x8d24('0x28')][_0x8d24('0x1b')](_0x5d5003)[_0x8d24('0x21')](function(_0x581f70){_0x502ce9[_0x8d24('0x1b')]=_0x581f70;if(_0x29246a['query'][_0x8d24('0x3b')]){_0x4c798f['include']=[{'all':!![]}];}return db[_0x8d24('0x28')][_0x8d24('0x3c')](_0x4c798f);})['then'](function(_0x58e27d){_0x502ce9[_0x8d24('0x3d')]=_0x58e27d;return _0x502ce9;})[_0x8d24('0x21')](respondWithFilteredResult(_0x525f1e,_0x4c798f))[_0x8d24('0x3e')](handleError(_0x525f1e,null));};exports[_0x8d24('0x3f')]=function(_0xf2e1f1,_0x11dff1){var _0x9eca1d={'raw':!![],'where':{'id':_0xf2e1f1['params']['id']}},_0x1f1d07={};_0x1f1d07[_0x8d24('0x2c')]=_[_0x8d24('0x40')](db[_0x8d24('0x28')][_0x8d24('0x41')]);_0x1f1d07[_0x8d24('0x2d')]=_['keys'](_0xf2e1f1[_0x8d24('0x2d')]);_0x1f1d07[_0x8d24('0x35')]=_[_0x8d24('0x2e')](_0x1f1d07[_0x8d24('0x2c')],_0x1f1d07[_0x8d24('0x2d')]);_0x9eca1d[_0x8d24('0x2f')]=_[_0x8d24('0x2e')](_0x1f1d07[_0x8d24('0x2c')],qs['fields'](_0xf2e1f1[_0x8d24('0x2d')][_0x8d24('0x30')]));_0x9eca1d[_0x8d24('0x2f')]=_0x9eca1d[_0x8d24('0x2f')][_0x8d24('0x31')]?_0x9eca1d[_0x8d24('0x2f')]:_0x1f1d07[_0x8d24('0x2c')];if(_0xf2e1f1[_0x8d24('0x2d')][_0x8d24('0x3b')]){_0x9eca1d[_0x8d24('0x42')]=[{'all':!![]}];}_0x9eca1d=_[_0x8d24('0x38')]({},_0x9eca1d,_0xf2e1f1[_0x8d24('0x43')]);return db[_0x8d24('0x28')][_0x8d24('0x44')](_0x9eca1d)['then'](handleEntityNotFound(_0x11dff1,null))[_0x8d24('0x21')](respondWithResult(_0x11dff1,null))[_0x8d24('0x3e')](handleError(_0x11dff1,null));};exports['create']=function(_0x2eb49a,_0x412468){return db['SmsQueueReport']['create'](_0x2eb49a['body'],{})['then'](respondWithResult(_0x412468,0xc9))[_0x8d24('0x3e')](handleError(_0x412468,null));};exports['update']=function(_0x2fd5a8,_0x7b04e6){if(_0x2fd5a8[_0x8d24('0x45')]['id']){delete _0x2fd5a8[_0x8d24('0x45')]['id'];}return db[_0x8d24('0x28')][_0x8d24('0x44')]({'where':{'id':_0x2fd5a8['params']['id']}})['then'](handleEntityNotFound(_0x7b04e6,null))['then'](saveUpdates(_0x2fd5a8['body'],null))[_0x8d24('0x21')](respondWithResult(_0x7b04e6,null))[_0x8d24('0x3e')](handleError(_0x7b04e6,null));};exports['destroy']=function(_0x3770ef,_0x125e86){return db[_0x8d24('0x28')]['find']({'where':{'id':_0x3770ef[_0x8d24('0x46')]['id']}})[_0x8d24('0x21')](handleEntityNotFound(_0x125e86,null))['then'](removeEntity(_0x125e86,null))[_0x8d24('0x3e')](handleError(_0x125e86,null));};exports['describe']=function(_0x34d57b,_0x1640d0){return db[_0x8d24('0x28')][_0x8d24('0x47')]()['then'](respondWithResult(_0x1640d0,null))[_0x8d24('0x3e')](handleError(_0x1640d0,null));};
\ No newline at end of file
index 5d30fd0..03e09d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index a0d53cb..ec8dc21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc40e=['limit','UpdateSmsQueueReport','lodash','util','bluebird','randomstring','../../config/utils','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','SmsQueueReport','create','options','raw','CreateSmsQueueReport','catch','update','body','where','attributes'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0xc40e,0xdb));var _0xec40=function(_0x3428e2,_0x262c7c){_0x3428e2=_0x3428e2-0x0;var _0x3b2c8a=_0xc40e[_0x3428e2];return _0x3b2c8a;};'use strict';var _=require(_0xec40('0x0'));var util=require(_0xec40('0x1'));var moment=require('moment');var BPromise=require(_0xec40('0x2'));var rs=require(_0xec40('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xec40('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xec40('0x5'));var client=jayson[_0xec40('0x6')][_0xec40('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x774e90,_0x39f78e,_0xc49cf4){return new BPromise(function(_0x40a2cb,_0x3fa5ca){return client[_0xec40('0x8')](_0x774e90,_0xc49cf4)[_0xec40('0x9')](function(_0x589b5b){logger[_0xec40('0xa')](_0xec40('0xb'),_0x39f78e,_0xec40('0xc'));logger[_0xec40('0xd')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x39f78e,'request\x20sent',JSON[_0xec40('0xe')](_0x589b5b));if(_0x589b5b[_0xec40('0xf')]){if(_0x589b5b[_0xec40('0xf')][_0xec40('0x10')]===0x1f4){logger[_0xec40('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x39f78e,_0x589b5b[_0xec40('0xf')][_0xec40('0x11')]);return _0x3fa5ca(_0x589b5b[_0xec40('0xf')][_0xec40('0x11')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x39f78e,_0x589b5b[_0xec40('0xf')][_0xec40('0x11')]);return _0x40a2cb(_0x589b5b['error'][_0xec40('0x11')]);}else{logger[_0xec40('0xa')](_0xec40('0xb'),_0x39f78e,_0xec40('0xc'));_0x40a2cb(_0x589b5b[_0xec40('0x12')][_0xec40('0x11')]);}})['catch'](function(_0x24751f){logger[_0xec40('0xf')](_0xec40('0xb'),_0x39f78e,_0x24751f);_0x3fa5ca(_0x24751f);});});}exports['CreateSmsQueueReport']=function(_0x3f5496){var _0x4397ee=this;return new Promise(function(_0xf259a2,_0x55fa31){return db[_0xec40('0x13')][_0xec40('0x14')](_0x3f5496['body'],{'raw':_0x3f5496[_0xec40('0x15')]?_0x3f5496['options'][_0xec40('0x16')]===undefined?!![]:![]:!![]})[_0xec40('0x9')](function(_0x20870d){logger[_0xec40('0xa')](_0xec40('0x17'),_0x3f5496);logger[_0xec40('0xd')](_0xec40('0x17'),_0x3f5496,JSON[_0xec40('0xe')](_0x20870d));_0xf259a2(_0x20870d);})[_0xec40('0x18')](function(_0x6a6424){logger[_0xec40('0xf')](_0xec40('0x17'),_0x6a6424['message'],_0x3f5496);_0x55fa31(_0x4397ee[_0xec40('0xf')](0x1f4,_0x6a6424['message']));});});};exports['UpdateSmsQueueReport']=function(_0x57db5c){var _0x22cdc2=this;return new Promise(function(_0x54dfa7,_0x1ef0ee){return db[_0xec40('0x13')][_0xec40('0x19')](_0x57db5c[_0xec40('0x1a')],{'raw':_0x57db5c[_0xec40('0x15')]?_0x57db5c['options'][_0xec40('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57db5c['options']?_0x57db5c[_0xec40('0x15')][_0xec40('0x1b')]||null:null,'attributes':_0x57db5c['options']?_0x57db5c[_0xec40('0x15')][_0xec40('0x1c')]||null:null,'limit':_0x57db5c['options']?_0x57db5c[_0xec40('0x15')][_0xec40('0x1d')]||null:null})[_0xec40('0x9')](function(_0xeba3fb){logger['info'](_0xec40('0x1e'),_0x57db5c);logger[_0xec40('0xd')](_0xec40('0x1e'),_0x57db5c,JSON[_0xec40('0xe')](_0xeba3fb));_0x54dfa7(_0xeba3fb);})[_0xec40('0x18')](function(_0x14c637){logger[_0xec40('0xf')](_0xec40('0x1e'),_0x14c637['message'],_0x57db5c);_0x1ef0ee(_0x22cdc2[_0xec40('0xf')](0x1f4,_0x14c637['message']));});});};
\ No newline at end of file
+var _0x4594=['request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsQueueReport','create','catch','SmsQueueReport','update','body','options','raw','where','limit','UpdateSmsQueueReport','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4594,0xb7));var _0x4459=function(_0x4f4c04,_0x429264){_0x4f4c04=_0x4f4c04-0x0;var _0x5e0abe=_0x4594[_0x4f4c04];return _0x5e0abe;};'use strict';var _=require('lodash');var util=require(_0x4459('0x0'));var moment=require(_0x4459('0x1'));var BPromise=require(_0x4459('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4459('0x3'))['db'];var utils=require(_0x4459('0x4'));var logger=require('../../config/logger')(_0x4459('0x5'));var config=require(_0x4459('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4459('0x7')][_0x4459('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x570cc1,_0xf71cbe,_0x5e07c8){return new BPromise(function(_0x2eca9a,_0x2d1405){return client[_0x4459('0x9')](_0x570cc1,_0x5e07c8)[_0x4459('0xa')](function(_0x419d7c){logger[_0x4459('0xb')](_0x4459('0xc'),_0xf71cbe,_0x4459('0xd'));logger[_0x4459('0xe')](_0x4459('0xf'),_0xf71cbe,_0x4459('0xd'),JSON[_0x4459('0x10')](_0x419d7c));if(_0x419d7c[_0x4459('0x11')]){if(_0x419d7c[_0x4459('0x11')][_0x4459('0x12')]===0x1f4){logger[_0x4459('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0xf71cbe,_0x419d7c[_0x4459('0x11')]['message']);return _0x2d1405(_0x419d7c['error'][_0x4459('0x13')]);}logger[_0x4459('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0xf71cbe,_0x419d7c[_0x4459('0x11')][_0x4459('0x13')]);return _0x2eca9a(_0x419d7c[_0x4459('0x11')][_0x4459('0x13')]);}else{logger[_0x4459('0xb')](_0x4459('0xc'),_0xf71cbe,_0x4459('0xd'));_0x2eca9a(_0x419d7c[_0x4459('0x14')]['message']);}})['catch'](function(_0x530878){logger[_0x4459('0x11')](_0x4459('0xc'),_0xf71cbe,_0x530878);_0x2d1405(_0x530878);});});}exports[_0x4459('0x15')]=function(_0x1ce168){var _0x323087=this;return new Promise(function(_0x29a50e,_0x2b9120){return db['SmsQueueReport'][_0x4459('0x16')](_0x1ce168['body'],{'raw':_0x1ce168['options']?_0x1ce168['options']['raw']===undefined?!![]:![]:!![]})[_0x4459('0xa')](function(_0x251e40){logger[_0x4459('0xb')]('CreateSmsQueueReport',_0x1ce168);logger['debug'](_0x4459('0x15'),_0x1ce168,JSON['stringify'](_0x251e40));_0x29a50e(_0x251e40);})[_0x4459('0x17')](function(_0x20ea13){logger[_0x4459('0x11')]('CreateSmsQueueReport',_0x20ea13['message'],_0x1ce168);_0x2b9120(_0x323087[_0x4459('0x11')](0x1f4,_0x20ea13[_0x4459('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x251529){var _0x51c6e1=this;return new Promise(function(_0x55c40f,_0x548c2f){return db[_0x4459('0x18')][_0x4459('0x19')](_0x251529[_0x4459('0x1a')],{'raw':_0x251529[_0x4459('0x1b')]?_0x251529['options'][_0x4459('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x251529[_0x4459('0x1b')]?_0x251529['options'][_0x4459('0x1d')]||null:null,'attributes':_0x251529[_0x4459('0x1b')]?_0x251529[_0x4459('0x1b')]['attributes']||null:null,'limit':_0x251529[_0x4459('0x1b')]?_0x251529[_0x4459('0x1b')][_0x4459('0x1e')]||null:null})[_0x4459('0xa')](function(_0x45d312){logger[_0x4459('0xb')](_0x4459('0x1f'),_0x251529);logger[_0x4459('0xe')](_0x4459('0x1f'),_0x251529,JSON[_0x4459('0x10')](_0x45d312));_0x55c40f(_0x45d312);})[_0x4459('0x17')](function(_0x214789){logger['error']('UpdateSmsQueueReport',_0x214789[_0x4459('0x13')],_0x251529);_0x548c2f(_0x51c6e1[_0x4459('0x11')](0x1f4,_0x214789[_0x4459('0x13')]));});});};
\ No newline at end of file
index f439d80..b68c583 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ab0=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x35b3ca,_0x37b8ac){var _0x1eec14=function(_0x228f50){while(--_0x228f50){_0x35b3ca['push'](_0x35b3ca['shift']());}};_0x1eec14(++_0x37b8ac);}(_0x4ab0,0xd5));var _0x04ab=function(_0x19769a,_0x5c0121){_0x19769a=_0x19769a-0x0;var _0x41dc2d=_0x4ab0[_0x19769a];return _0x41dc2d;};'use strict';var multer=require('multer');var util=require(_0x04ab('0x0'));var path=require(_0x04ab('0x1'));var timeout=require(_0x04ab('0x2'));var express=require(_0x04ab('0x3'));var router=express[_0x04ab('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x04ab('0x5'));var config=require(_0x04ab('0x6'));var controller=require('./smsTransferReport.controller');router[_0x04ab('0x7')]('/',auth[_0x04ab('0x8')](),controller['index']);router[_0x04ab('0x7')](_0x04ab('0x9'),auth[_0x04ab('0x8')](),controller['describe']);router[_0x04ab('0x7')](_0x04ab('0xa'),auth[_0x04ab('0x8')](),controller[_0x04ab('0xb')]);router['post']('/',auth[_0x04ab('0x8')](),controller[_0x04ab('0xc')]);router[_0x04ab('0xd')](_0x04ab('0xa'),auth['isAuthenticated'](),controller[_0x04ab('0xe')]);router[_0x04ab('0xf')](_0x04ab('0xa'),auth[_0x04ab('0x8')](),controller[_0x04ab('0x10')]);module[_0x04ab('0x11')]=router;
\ No newline at end of file
+var _0x3248=['Router','fs-extra','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe','/:id','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x4bede8,_0x2590a7){var _0x15dff8=function(_0x503c81){while(--_0x503c81){_0x4bede8['push'](_0x4bede8['shift']());}};_0x15dff8(++_0x2590a7);}(_0x3248,0x1b0));var _0x8324=function(_0x10b50c,_0x36eb70){_0x10b50c=_0x10b50c-0x0;var _0x584216=_0x3248[_0x10b50c];return _0x584216;};'use strict';var multer=require(_0x8324('0x0'));var util=require(_0x8324('0x1'));var path=require(_0x8324('0x2'));var timeout=require(_0x8324('0x3'));var express=require(_0x8324('0x4'));var router=express[_0x8324('0x5')]();var fs_extra=require(_0x8324('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8324('0x7'));var controller=require(_0x8324('0x8'));router['get']('/',auth[_0x8324('0x9')](),controller[_0x8324('0xa')]);router[_0x8324('0xb')](_0x8324('0xc'),auth[_0x8324('0x9')](),controller['describe']);router[_0x8324('0xb')](_0x8324('0xd'),auth[_0x8324('0x9')](),controller['show']);router['post']('/',auth[_0x8324('0x9')](),controller[_0x8324('0xe')]);router[_0x8324('0xf')]('/:id',auth[_0x8324('0x9')](),controller[_0x8324('0x10')]);router[_0x8324('0x11')](_0x8324('0xd'),auth[_0x8324('0x9')](),controller[_0x8324('0x12')]);module['exports']=router;
\ No newline at end of file
index 8e6dac5..2d08864 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4835ca,_0x391238){var _0x131b60=function(_0x579360){while(--_0x579360){_0x4835ca['push'](_0x4835ca['shift']());}};_0x131b60(++_0x391238);}(_0x008c,0x188));var _0xc008=function(_0x4b4865,_0xb43449){_0x4b4865=_0x4b4865-0x0;var _0x190dc2=_0x008c[_0x4b4865];return _0x190dc2;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x465147,_0x240ccd){var _0x5449b5=function(_0x3d7dce){while(--_0x3d7dce){_0x465147['push'](_0x465147['shift']());}};_0x5449b5(++_0x240ccd);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
index 5fc6519..3a031d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x743c=['map','SmsTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','fields','includeAll','include','find','create','body','describe','eml-format','rimraf','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','name','send','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x743c,0x1d8));var _0xc743=function(_0x4fd9b9,_0x4baad2){_0x4fd9b9=_0x4fd9b9-0x0;var _0x41907a=_0x743c[_0x4fd9b9];return _0x41907a;};'use strict';var emlformat=require(_0xc743('0x0'));var rimraf=require(_0xc743('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc743('0x2'));var moment=require(_0xc743('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc743('0x4'));var util=require(_0xc743('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc743('0x6'));var ejs=require(_0xc743('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc743('0x8'));var squel=require(_0xc743('0x9'));var crypto=require(_0xc743('0xa'));var jsforce=require(_0xc743('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc743('0xc'));var Papa=require(_0xc743('0xd'));var Redis=require(_0xc743('0xe'));var authService=require(_0xc743('0xf'));var qs=require(_0xc743('0x10'));var as=require(_0xc743('0x11'));var hardwareService=require(_0xc743('0x12'));var logger=require('../../config/logger')(_0xc743('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc743('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55d0cf,_0x464aee){_0x464aee=_0x464aee||0xcc;return function(_0x13638a){if(_0x13638a){return _0x55d0cf[_0xc743('0x15')](_0x464aee);}return _0x55d0cf[_0xc743('0x16')](_0x464aee)[_0xc743('0x17')]();};}function respondWithResult(_0x2e74f4,_0x137ef6){_0x137ef6=_0x137ef6||0xc8;return function(_0x88ead8){if(_0x88ead8){return _0x2e74f4['status'](_0x137ef6)[_0xc743('0x18')](_0x88ead8);}};}function respondWithFilteredResult(_0xba25c,_0x5a9647){return function(_0x4974bf){if(_0x4974bf){var _0x24fd7a=typeof _0x5a9647['offset']===_0xc743('0x19')&&typeof _0x5a9647[_0xc743('0x1a')]===_0xc743('0x19');var _0x1c74a0=_0x4974bf[_0xc743('0x1b')];var _0xdcc240=_0x24fd7a?0x0:_0x5a9647[_0xc743('0x1c')];var _0x3e1963=_0x24fd7a?_0x4974bf[_0xc743('0x1b')]:_0x5a9647['offset']+_0x5a9647[_0xc743('0x1a')];var _0x110d30;if(_0x3e1963>=_0x1c74a0){_0x3e1963=_0x1c74a0;_0x110d30=0xc8;}else{_0x110d30=0xce;}_0xba25c[_0xc743('0x16')](_0x110d30);return _0xba25c['set'](_0xc743('0x1d'),_0xdcc240+'-'+_0x3e1963+'/'+_0x1c74a0)['json'](_0x4974bf);}return null;};}function patchUpdates(_0x584a85){return function(_0x4b35cd){try{jsonpatch[_0xc743('0x1e')](_0x4b35cd,_0x584a85,!![]);}catch(_0x3fc5c0){return BPromise[_0xc743('0x1f')](_0x3fc5c0);}return _0x4b35cd['save']();};}function saveUpdates(_0x24037c,_0x598b16){return function(_0x74f431){if(_0x74f431){return _0x74f431[_0xc743('0x20')](_0x24037c)[_0xc743('0x21')](function(_0x262c43){return _0x262c43;});}return null;};}function removeEntity(_0x203975,_0x925482){return function(_0x437dcc){if(_0x437dcc){return _0x437dcc[_0xc743('0x22')]()['then'](function(){_0x203975[_0xc743('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d209,_0x2fb1e3){return function(_0x4d1689){if(!_0x4d1689){_0x50d209[_0xc743('0x15')](0x194);}return _0x4d1689;};}function handleError(_0x9fd93c,_0x119e03){_0x119e03=_0x119e03||0x1f4;return function(_0x2c0792){logger[_0xc743('0x23')](_0x2c0792['stack']);if(_0x2c0792[_0xc743('0x24')]){delete _0x2c0792['name'];}_0x9fd93c['status'](_0x119e03)[_0xc743('0x25')](_0x2c0792);};}exports[_0xc743('0x26')]=function(_0x5a7114,_0x4ce7dc){var _0xbbd14b={},_0x5f0ac0={},_0x4737b0={'count':0x0,'rows':[]};var _0x284800=_[_0xc743('0x27')](db[_0xc743('0x28')][_0xc743('0x29')],function(_0x3b4549){return{'name':_0x3b4549[_0xc743('0x2a')],'type':_0x3b4549['type'][_0xc743('0x2b')]};});_0x5f0ac0[_0xc743('0x2c')]=_[_0xc743('0x27')](_0x284800,'name');_0x5f0ac0[_0xc743('0x2d')]=_[_0xc743('0x2e')](_0x5a7114[_0xc743('0x2d')]);_0x5f0ac0[_0xc743('0x2f')]=_[_0xc743('0x30')](_0x5f0ac0[_0xc743('0x2c')],_0x5f0ac0['query']);_0xbbd14b[_0xc743('0x31')]=_[_0xc743('0x30')](_0x5f0ac0[_0xc743('0x2c')],qs['fields'](_0x5a7114['query']['fields']));_0xbbd14b['attributes']=_0xbbd14b[_0xc743('0x31')][_0xc743('0x32')]?_0xbbd14b['attributes']:_0x5f0ac0['model'];if(!_0x5a7114['query'][_0xc743('0x33')](_0xc743('0x34'))){_0xbbd14b[_0xc743('0x1a')]=qs[_0xc743('0x1a')](_0x5a7114[_0xc743('0x2d')][_0xc743('0x1a')]);_0xbbd14b['offset']=qs[_0xc743('0x1c')](_0x5a7114[_0xc743('0x2d')][_0xc743('0x1c')]);}_0xbbd14b[_0xc743('0x35')]=qs[_0xc743('0x36')](_0x5a7114[_0xc743('0x2d')]['sort']);_0xbbd14b[_0xc743('0x37')]=qs[_0xc743('0x2f')](_[_0xc743('0x38')](_0x5a7114[_0xc743('0x2d')],_0x5f0ac0[_0xc743('0x2f')]),_0x284800);if(_0x5a7114['query']['filter']){_0xbbd14b[_0xc743('0x37')]=_[_0xc743('0x39')](_0xbbd14b['where'],{'$or':_[_0xc743('0x27')](_0x284800,function(_0x7eb9e2){if(_0x7eb9e2['type']!==_0xc743('0x3a')){var _0x17827a={};_0x17827a[_0x7eb9e2['name']]={'$like':'%'+_0x5a7114['query'][_0xc743('0x3b')]+'%'};return _0x17827a;}})});}_0xbbd14b=_[_0xc743('0x39')]({},_0xbbd14b,_0x5a7114[_0xc743('0x3c')]);var _0x4c244f={'where':_0xbbd14b[_0xc743('0x37')]};return db[_0xc743('0x28')][_0xc743('0x1b')](_0x4c244f)['then'](function(_0x4a588c){_0x4737b0[_0xc743('0x1b')]=_0x4a588c;if(_0x5a7114[_0xc743('0x2d')]['includeAll']){_0xbbd14b['include']=[{'all':!![]}];}return db[_0xc743('0x28')][_0xc743('0x3d')](_0xbbd14b);})[_0xc743('0x21')](function(_0x29eafa){_0x4737b0[_0xc743('0x3e')]=_0x29eafa;return _0x4737b0;})[_0xc743('0x21')](respondWithFilteredResult(_0x4ce7dc,_0xbbd14b))[_0xc743('0x3f')](handleError(_0x4ce7dc,null));};exports[_0xc743('0x40')]=function(_0x29a868,_0x565a6f){var _0x2540e8={'raw':!![],'where':{'id':_0x29a868[_0xc743('0x41')]['id']}},_0x18a149={};_0x18a149['model']=_[_0xc743('0x2e')](db[_0xc743('0x28')]['rawAttributes']);_0x18a149[_0xc743('0x2d')]=_['keys'](_0x29a868['query']);_0x18a149[_0xc743('0x2f')]=_['intersection'](_0x18a149[_0xc743('0x2c')],_0x18a149[_0xc743('0x2d')]);_0x2540e8[_0xc743('0x31')]=_[_0xc743('0x30')](_0x18a149['model'],qs[_0xc743('0x42')](_0x29a868[_0xc743('0x2d')][_0xc743('0x42')]));_0x2540e8[_0xc743('0x31')]=_0x2540e8[_0xc743('0x31')][_0xc743('0x32')]?_0x2540e8[_0xc743('0x31')]:_0x18a149[_0xc743('0x2c')];if(_0x29a868[_0xc743('0x2d')][_0xc743('0x43')]){_0x2540e8[_0xc743('0x44')]=[{'all':!![]}];}_0x2540e8=_[_0xc743('0x39')]({},_0x2540e8,_0x29a868[_0xc743('0x3c')]);return db[_0xc743('0x28')][_0xc743('0x45')](_0x2540e8)[_0xc743('0x21')](handleEntityNotFound(_0x565a6f,null))[_0xc743('0x21')](respondWithResult(_0x565a6f,null))['catch'](handleError(_0x565a6f,null));};exports[_0xc743('0x46')]=function(_0x5df54c,_0xadaa44){return db[_0xc743('0x28')][_0xc743('0x46')](_0x5df54c[_0xc743('0x47')],{})[_0xc743('0x21')](respondWithResult(_0xadaa44,0xc9))[_0xc743('0x3f')](handleError(_0xadaa44,null));};exports[_0xc743('0x20')]=function(_0x39bdb3,_0x3cf36f){if(_0x39bdb3[_0xc743('0x47')]['id']){delete _0x39bdb3[_0xc743('0x47')]['id'];}return db['SmsTransferReport'][_0xc743('0x45')]({'where':{'id':_0x39bdb3[_0xc743('0x41')]['id']}})[_0xc743('0x21')](handleEntityNotFound(_0x3cf36f,null))[_0xc743('0x21')](saveUpdates(_0x39bdb3['body'],null))[_0xc743('0x21')](respondWithResult(_0x3cf36f,null))[_0xc743('0x3f')](handleError(_0x3cf36f,null));};exports['destroy']=function(_0x426131,_0x4ca5c4){return db['SmsTransferReport'][_0xc743('0x45')]({'where':{'id':_0x426131['params']['id']}})[_0xc743('0x21')](handleEntityNotFound(_0x4ca5c4,null))[_0xc743('0x21')](removeEntity(_0x4ca5c4,null))[_0xc743('0x3f')](handleError(_0x4ca5c4,null));};exports[_0xc743('0x48')]=function(_0x503df4,_0x2c1fab){return db[_0xc743('0x28')][_0xc743('0x48')]()[_0xc743('0x21')](respondWithResult(_0x2c1fab,null))['catch'](handleError(_0x2c1fab,null));};
\ No newline at end of file
+var _0x8ab5=['util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','key','keys','query','model','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','then','catch','show','params','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4dccd9,_0x586412){var _0x37ef2c=function(_0x464e12){while(--_0x464e12){_0x4dccd9['push'](_0x4dccd9['shift']());}};_0x37ef2c(++_0x586412);}(_0x8ab5,0xe8));var _0x58ab=function(_0x368b70,_0xa1bbc7){_0x368b70=_0x368b70-0x0;var _0x106a38=_0x8ab5[_0x368b70];return _0x106a38;};'use strict';var emlformat=require(_0x58ab('0x0'));var rimraf=require(_0x58ab('0x1'));var zipdir=require(_0x58ab('0x2'));var jsonpatch=require(_0x58ab('0x3'));var rp=require(_0x58ab('0x4'));var moment=require(_0x58ab('0x5'));var BPromise=require(_0x58ab('0x6'));var Mustache=require(_0x58ab('0x7'));var util=require(_0x58ab('0x8'));var path=require(_0x58ab('0x9'));var sox=require(_0x58ab('0xa'));var csv=require('to-csv');var ejs=require(_0x58ab('0xb'));var fs=require('fs');var fs_extra=require(_0x58ab('0xc'));var _=require(_0x58ab('0xd'));var squel=require(_0x58ab('0xe'));var crypto=require(_0x58ab('0xf'));var jsforce=require(_0x58ab('0x10'));var deskjs=require(_0x58ab('0x11'));var toCsv=require(_0x58ab('0x12'));var querystring=require(_0x58ab('0x13'));var Papa=require(_0x58ab('0x14'));var Redis=require('ioredis');var authService=require(_0x58ab('0x15'));var qs=require(_0x58ab('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x58ab('0x17'));var logger=require('../../config/logger')(_0x58ab('0x18'));var utils=require('../../config/utils');var config=require(_0x58ab('0x19'));var licenseUtil=require(_0x58ab('0x1a'));var db=require(_0x58ab('0x1b'))['db'];function respondWithStatusCode(_0x444e49,_0x1daaaf){_0x1daaaf=_0x1daaaf||0xcc;return function(_0x218795){if(_0x218795){return _0x444e49[_0x58ab('0x1c')](_0x1daaaf);}return _0x444e49[_0x58ab('0x1d')](_0x1daaaf)[_0x58ab('0x1e')]();};}function respondWithResult(_0x75ee42,_0x383040){_0x383040=_0x383040||0xc8;return function(_0x214e89){if(_0x214e89){return _0x75ee42[_0x58ab('0x1d')](_0x383040)[_0x58ab('0x1f')](_0x214e89);}};}function respondWithFilteredResult(_0x41916f,_0x407d7b){return function(_0xa17c31){if(_0xa17c31){var _0xa248e=typeof _0x407d7b['offset']===_0x58ab('0x20')&&typeof _0x407d7b[_0x58ab('0x21')]===_0x58ab('0x20');var _0x11f7fd=_0xa17c31[_0x58ab('0x22')];var _0xa22826=_0xa248e?0x0:_0x407d7b[_0x58ab('0x23')];var _0x33c493=_0xa248e?_0xa17c31['count']:_0x407d7b[_0x58ab('0x23')]+_0x407d7b[_0x58ab('0x21')];var _0x20562a;if(_0x33c493>=_0x11f7fd){_0x33c493=_0x11f7fd;_0x20562a=0xc8;}else{_0x20562a=0xce;}_0x41916f[_0x58ab('0x1d')](_0x20562a);return _0x41916f[_0x58ab('0x24')](_0x58ab('0x25'),_0xa22826+'-'+_0x33c493+'/'+_0x11f7fd)['json'](_0xa17c31);}return null;};}function patchUpdates(_0x337697){return function(_0x3367b2){try{jsonpatch[_0x58ab('0x26')](_0x3367b2,_0x337697,!![]);}catch(_0x3c43c1){return BPromise[_0x58ab('0x27')](_0x3c43c1);}return _0x3367b2[_0x58ab('0x28')]();};}function saveUpdates(_0xf643bd,_0x3ecbdb){return function(_0x1f772c){if(_0x1f772c){return _0x1f772c[_0x58ab('0x29')](_0xf643bd)['then'](function(_0x4df463){return _0x4df463;});}return null;};}function removeEntity(_0x4f45d7,_0x16c314){return function(_0x3dfc34){if(_0x3dfc34){return _0x3dfc34['destroy']()['then'](function(){_0x4f45d7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56b5ba,_0x81ee7c){return function(_0x360c3f){if(!_0x360c3f){_0x56b5ba[_0x58ab('0x1c')](0x194);}return _0x360c3f;};}function handleError(_0x7eaf55,_0x1cfecd){_0x1cfecd=_0x1cfecd||0x1f4;return function(_0xb45233){logger[_0x58ab('0x2a')](_0xb45233[_0x58ab('0x2b')]);if(_0xb45233[_0x58ab('0x2c')]){delete _0xb45233[_0x58ab('0x2c')];}_0x7eaf55[_0x58ab('0x1d')](_0x1cfecd)[_0x58ab('0x2d')](_0xb45233);};}exports[_0x58ab('0x2e')]=function(_0x82367d,_0x327420){var _0x5153a6={},_0x233f2f={},_0x93f655={'count':0x0,'rows':[]};var _0x4a56d7=_[_0x58ab('0x2f')](db[_0x58ab('0x30')][_0x58ab('0x31')],function(_0xe0cb53){return{'name':_0xe0cb53['fieldName'],'type':_0xe0cb53['type'][_0x58ab('0x32')]};});_0x233f2f['model']=_['map'](_0x4a56d7,_0x58ab('0x2c'));_0x233f2f['query']=_[_0x58ab('0x33')](_0x82367d[_0x58ab('0x34')]);_0x233f2f['filters']=_['intersection'](_0x233f2f[_0x58ab('0x35')],_0x233f2f[_0x58ab('0x34')]);_0x5153a6['attributes']=_[_0x58ab('0x36')](_0x233f2f[_0x58ab('0x35')],qs[_0x58ab('0x37')](_0x82367d[_0x58ab('0x34')][_0x58ab('0x37')]));_0x5153a6['attributes']=_0x5153a6[_0x58ab('0x38')][_0x58ab('0x39')]?_0x5153a6[_0x58ab('0x38')]:_0x233f2f[_0x58ab('0x35')];if(!_0x82367d['query']['hasOwnProperty'](_0x58ab('0x3a'))){_0x5153a6[_0x58ab('0x21')]=qs['limit'](_0x82367d[_0x58ab('0x34')][_0x58ab('0x21')]);_0x5153a6[_0x58ab('0x23')]=qs[_0x58ab('0x23')](_0x82367d[_0x58ab('0x34')]['offset']);}_0x5153a6[_0x58ab('0x3b')]=qs['sort'](_0x82367d['query'][_0x58ab('0x3c')]);_0x5153a6[_0x58ab('0x3d')]=qs[_0x58ab('0x3e')](_[_0x58ab('0x3f')](_0x82367d['query'],_0x233f2f[_0x58ab('0x3e')]),_0x4a56d7);if(_0x82367d[_0x58ab('0x34')][_0x58ab('0x40')]){_0x5153a6[_0x58ab('0x3d')]=_[_0x58ab('0x41')](_0x5153a6[_0x58ab('0x3d')],{'$or':_[_0x58ab('0x2f')](_0x4a56d7,function(_0x43bab1){if(_0x43bab1[_0x58ab('0x42')]!=='VIRTUAL'){var _0x44177e={};_0x44177e[_0x43bab1[_0x58ab('0x2c')]]={'$like':'%'+_0x82367d[_0x58ab('0x34')][_0x58ab('0x40')]+'%'};return _0x44177e;}})});}_0x5153a6=_['merge']({},_0x5153a6,_0x82367d['options']);var _0x49c398={'where':_0x5153a6[_0x58ab('0x3d')]};return db[_0x58ab('0x30')][_0x58ab('0x22')](_0x49c398)['then'](function(_0x22a8dd){_0x93f655[_0x58ab('0x22')]=_0x22a8dd;if(_0x82367d[_0x58ab('0x34')][_0x58ab('0x43')]){_0x5153a6[_0x58ab('0x44')]=[{'all':!![]}];}return db[_0x58ab('0x30')][_0x58ab('0x45')](_0x5153a6);})[_0x58ab('0x46')](function(_0x43f97b){_0x93f655['rows']=_0x43f97b;return _0x93f655;})['then'](respondWithFilteredResult(_0x327420,_0x5153a6))[_0x58ab('0x47')](handleError(_0x327420,null));};exports[_0x58ab('0x48')]=function(_0x107f45,_0x18d3cd){var _0x5b0da3={'raw':!![],'where':{'id':_0x107f45[_0x58ab('0x49')]['id']}},_0x2bb39f={};_0x2bb39f['model']=_['keys'](db[_0x58ab('0x30')][_0x58ab('0x31')]);_0x2bb39f[_0x58ab('0x34')]=_[_0x58ab('0x33')](_0x107f45[_0x58ab('0x34')]);_0x2bb39f[_0x58ab('0x3e')]=_[_0x58ab('0x36')](_0x2bb39f[_0x58ab('0x35')],_0x2bb39f[_0x58ab('0x34')]);_0x5b0da3[_0x58ab('0x38')]=_[_0x58ab('0x36')](_0x2bb39f[_0x58ab('0x35')],qs['fields'](_0x107f45[_0x58ab('0x34')][_0x58ab('0x37')]));_0x5b0da3[_0x58ab('0x38')]=_0x5b0da3[_0x58ab('0x38')][_0x58ab('0x39')]?_0x5b0da3['attributes']:_0x2bb39f['model'];if(_0x107f45[_0x58ab('0x34')]['includeAll']){_0x5b0da3[_0x58ab('0x44')]=[{'all':!![]}];}_0x5b0da3=_[_0x58ab('0x41')]({},_0x5b0da3,_0x107f45[_0x58ab('0x4a')]);return db['SmsTransferReport'][_0x58ab('0x4b')](_0x5b0da3)[_0x58ab('0x46')](handleEntityNotFound(_0x18d3cd,null))[_0x58ab('0x46')](respondWithResult(_0x18d3cd,null))['catch'](handleError(_0x18d3cd,null));};exports[_0x58ab('0x4c')]=function(_0x7fc191,_0x552228){return db[_0x58ab('0x30')]['create'](_0x7fc191[_0x58ab('0x4d')],{})[_0x58ab('0x46')](respondWithResult(_0x552228,0xc9))[_0x58ab('0x47')](handleError(_0x552228,null));};exports[_0x58ab('0x29')]=function(_0x2100b8,_0x11dc15){if(_0x2100b8[_0x58ab('0x4d')]['id']){delete _0x2100b8[_0x58ab('0x4d')]['id'];}return db[_0x58ab('0x30')][_0x58ab('0x4b')]({'where':{'id':_0x2100b8['params']['id']}})[_0x58ab('0x46')](handleEntityNotFound(_0x11dc15,null))['then'](saveUpdates(_0x2100b8[_0x58ab('0x4d')],null))[_0x58ab('0x46')](respondWithResult(_0x11dc15,null))[_0x58ab('0x47')](handleError(_0x11dc15,null));};exports[_0x58ab('0x4e')]=function(_0x403006,_0x2c147a){return db['SmsTransferReport'][_0x58ab('0x4b')]({'where':{'id':_0x403006['params']['id']}})[_0x58ab('0x46')](handleEntityNotFound(_0x2c147a,null))[_0x58ab('0x46')](removeEntity(_0x2c147a,null))[_0x58ab('0x47')](handleError(_0x2c147a,null));};exports['describe']=function(_0x1aa64,_0x51ffd2){return db['SmsTransferReport'][_0x58ab('0x4f')]()['then'](respondWithResult(_0x51ffd2,null))['catch'](handleError(_0x51ffd2,null));};
\ No newline at end of file
index 686a102..72d9c9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc997=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','util'];(function(_0x50b6f4,_0x2f35dd){var _0x5657fe=function(_0x196fc3){while(--_0x196fc3){_0x50b6f4['push'](_0x50b6f4['shift']());}};_0x5657fe(++_0x2f35dd);}(_0xc997,0x1ac));var _0x7c99=function(_0x7490e9,_0x4015a2){_0x7490e9=_0x7490e9-0x0;var _0x150fc2=_0xc997[_0x7490e9];return _0x150fc2;};'use strict';var _=require('lodash');var util=require(_0x7c99('0x0'));var logger=require(_0x7c99('0x1'))(_0x7c99('0x2'));var moment=require(_0x7c99('0x3'));var BPromise=require(_0x7c99('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c99('0x5'));var rimraf=require(_0x7c99('0x6'));var config=require(_0x7c99('0x7'));var attributes=require(_0x7c99('0x8'));module[_0x7c99('0x9')]=function(_0x404ffb,_0x1a21e1){return _0x404ffb[_0x7c99('0xa')]('SmsTransferReport',attributes,{'tableName':_0x7c99('0xb'),'paranoid':![],'indexes':[{'name':_0x7c99('0xc'),'fields':[_0x7c99('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ef8=['api','moment','bluebird','path','rimraf','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util'];(function(_0xf12b8a,_0x67d7fe){var _0x13ba73=function(_0x148bc3){while(--_0x148bc3){_0xf12b8a['push'](_0xf12b8a['shift']());}};_0x13ba73(++_0x67d7fe);}(_0x9ef8,0x17f));var _0x89ef=function(_0x427217,_0x4039b1){_0x427217=_0x427217-0x0;var _0x5b28fb=_0x9ef8[_0x427217];return _0x5b28fb;};'use strict';var _=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var logger=require('../../config/logger')(_0x89ef('0x2'));var moment=require(_0x89ef('0x3'));var BPromise=require(_0x89ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89ef('0x5'));var rimraf=require(_0x89ef('0x6'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x383019,_0x2e117e){return _0x383019[_0x89ef('0x7')](_0x89ef('0x8'),attributes,{'tableName':_0x89ef('0x9'),'paranoid':![],'indexes':[{'name':_0x89ef('0xa'),'fields':[_0x89ef('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index f49d60b..e1ca992 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38d3=['SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x43e515,_0x7d3d8e){var _0x276517=function(_0x2946b1){while(--_0x2946b1){_0x43e515['push'](_0x43e515['shift']());}};_0x276517(++_0x7d3d8e);}(_0x38d3,0x1a7));var _0x338d=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x38d3[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x338d('0x0'));var util=require(_0x338d('0x1'));var moment=require('moment');var BPromise=require(_0x338d('0x2'));var rs=require(_0x338d('0x3'));var fs=require('fs');var Redis=require(_0x338d('0x4'));var db=require(_0x338d('0x5'))['db'];var utils=require(_0x338d('0x6'));var logger=require(_0x338d('0x7'))(_0x338d('0x8'));var config=require(_0x338d('0x9'));var jayson=require(_0x338d('0xa'));var client=jayson['client'][_0x338d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2012c3,_0x439f4b,_0x2b7aab){return new BPromise(function(_0x60eaa1,_0x46b758){return client[_0x338d('0xc')](_0x2012c3,_0x2b7aab)['then'](function(_0x264986){logger[_0x338d('0xd')](_0x338d('0xe'),_0x439f4b,_0x338d('0xf'));logger[_0x338d('0x10')](_0x338d('0x11'),_0x439f4b,'request\x20sent',JSON[_0x338d('0x12')](_0x264986));if(_0x264986[_0x338d('0x13')]){if(_0x264986[_0x338d('0x13')][_0x338d('0x14')]===0x1f4){logger[_0x338d('0x13')](_0x338d('0xe'),_0x439f4b,_0x264986[_0x338d('0x13')][_0x338d('0x15')]);return _0x46b758(_0x264986['error']['message']);}logger['error'](_0x338d('0xe'),_0x439f4b,_0x264986[_0x338d('0x13')]['message']);return _0x60eaa1(_0x264986[_0x338d('0x13')]['message']);}else{logger[_0x338d('0xd')](_0x338d('0xe'),_0x439f4b,_0x338d('0xf'));_0x60eaa1(_0x264986['result']['message']);}})['catch'](function(_0x2b8fd5){logger['error'](_0x338d('0xe'),_0x439f4b,_0x2b8fd5);_0x46b758(_0x2b8fd5);});});}
\ No newline at end of file
+var _0xad78=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x1c6c03,_0x580c1c){var _0x18a6a5=function(_0x508c5d){while(--_0x508c5d){_0x1c6c03['push'](_0x1c6c03['shift']());}};_0x18a6a5(++_0x580c1c);}(_0xad78,0x149));var _0x8ad7=function(_0x2825b3,_0x144539){_0x2825b3=_0x2825b3-0x0;var _0x2870b7=_0xad78[_0x2825b3];return _0x2870b7;};'use strict';var _=require(_0x8ad7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8ad7('0x1'));var rs=require(_0x8ad7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ad7('0x3'))['db'];var utils=require(_0x8ad7('0x4'));var logger=require(_0x8ad7('0x5'))(_0x8ad7('0x6'));var config=require(_0x8ad7('0x7'));var jayson=require(_0x8ad7('0x8'));var client=jayson[_0x8ad7('0x9')][_0x8ad7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x415e9c,_0x3daa2d,_0x49aeb1){return new BPromise(function(_0x4822d3,_0x336b3a){return client[_0x8ad7('0xb')](_0x415e9c,_0x49aeb1)[_0x8ad7('0xc')](function(_0x152b82){logger[_0x8ad7('0xd')](_0x8ad7('0xe'),_0x3daa2d,_0x8ad7('0xf'));logger['debug'](_0x8ad7('0x10'),_0x3daa2d,_0x8ad7('0xf'),JSON[_0x8ad7('0x11')](_0x152b82));if(_0x152b82['error']){if(_0x152b82[_0x8ad7('0x12')][_0x8ad7('0x13')]===0x1f4){logger[_0x8ad7('0x12')](_0x8ad7('0xe'),_0x3daa2d,_0x152b82[_0x8ad7('0x12')][_0x8ad7('0x14')]);return _0x336b3a(_0x152b82[_0x8ad7('0x12')][_0x8ad7('0x14')]);}logger[_0x8ad7('0x12')](_0x8ad7('0xe'),_0x3daa2d,_0x152b82[_0x8ad7('0x12')]['message']);return _0x4822d3(_0x152b82['error'][_0x8ad7('0x14')]);}else{logger['info'](_0x8ad7('0xe'),_0x3daa2d,_0x8ad7('0xf'));_0x4822d3(_0x152b82['result']['message']);}})[_0x8ad7('0x15')](function(_0x1607c9){logger[_0x8ad7('0x12')](_0x8ad7('0xe'),_0x3daa2d,_0x1607c9);_0x336b3a(_0x1607c9);});});}
\ No newline at end of file
index 3591238..fc59d77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe874=['put','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/download','join','server/files/sounds/original/','originalname','%s-%s%s','basename','now','extname','post','single','create'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0xe874,0x13b));var _0x4e87=function(_0x21f98f,_0x3a67da){_0x21f98f=_0x21f98f-0x0;var _0x48fc8d=_0xe874[_0x21f98f];return _0x48fc8d;};'use strict';var multer=require(_0x4e87('0x0'));var util=require('util');var path=require(_0x4e87('0x1'));var timeout=require(_0x4e87('0x2'));var express=require(_0x4e87('0x3'));var router=express['Router']();var fs_extra=require(_0x4e87('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4e87('0x5'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x4e87('0x6')]('/',auth[_0x4e87('0x7')](),controller[_0x4e87('0x8')]);router['get'](_0x4e87('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x4e87('0xa'),auth[_0x4e87('0x7')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x35369c,_0x417c89,_0x38644c){_0x38644c(null,path[_0x4e87('0xb')](config['root'],_0x4e87('0xc')));},'filename':function(_0x2c3c0f,_0x202a95,_0x70b6bd){_0x202a95[_0x4e87('0xd')]=_0x202a95['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x70b6bd(null,util['format'](_0x4e87('0xe'),path[_0x4e87('0xf')](_0x202a95['originalname'],path['extname'](_0x202a95[_0x4e87('0xd')])),Date[_0x4e87('0x10')](),path[_0x4e87('0x11')](_0x202a95[_0x4e87('0xd')])));}})});router[_0x4e87('0x12')]('/',upload[_0x4e87('0x13')]('file'),controller[_0x4e87('0x14')]);router[_0x4e87('0x15')](_0x4e87('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4e87('0x16')](_0x4e87('0x9'),auth['isAuthenticated'](),controller[_0x4e87('0x16')]);module[_0x4e87('0x17')]=router;
\ No newline at end of file
+var _0xb312=['../../config/environment','get','isAuthenticated','index','/:id','show','join','root','originalname','replace','format','%s-%s%s','extname','now','post','single','file','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x435efe,_0x15f36e){var _0x11a9b0=function(_0x19e07d){while(--_0x19e07d){_0x435efe['push'](_0x435efe['shift']());}};_0x11a9b0(++_0x15f36e);}(_0xb312,0x142));var _0x2b31=function(_0x51a0f7,_0x2f28e7){_0x51a0f7=_0x51a0f7-0x0;var _0x59bce9=_0xb312[_0x51a0f7];return _0x59bce9;};'use strict';var multer=require('multer');var util=require(_0x2b31('0x0'));var path=require(_0x2b31('0x1'));var timeout=require(_0x2b31('0x2'));var express=require(_0x2b31('0x3'));var router=express[_0x2b31('0x4')]();var fs_extra=require(_0x2b31('0x5'));var auth=require(_0x2b31('0x6'));var interaction=require(_0x2b31('0x7'));var config=require(_0x2b31('0x8'));var controller=require('./sound.controller');router[_0x2b31('0x9')]('/',auth[_0x2b31('0xa')](),controller[_0x2b31('0xb')]);router[_0x2b31('0x9')](_0x2b31('0xc'),auth[_0x2b31('0xa')](),controller[_0x2b31('0xd')]);router[_0x2b31('0x9')]('/:id/download',auth[_0x2b31('0xa')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x902812,_0x2f52ca,_0xcae607){_0xcae607(null,path[_0x2b31('0xe')](config[_0x2b31('0xf')],'server/files/sounds/original/'));},'filename':function(_0x5e184a,_0x4b86d6,_0xfdc039){_0x4b86d6[_0x2b31('0x10')]=_0x4b86d6['originalname'][_0x2b31('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xfdc039(null,util[_0x2b31('0x12')](_0x2b31('0x13'),path['basename'](_0x4b86d6[_0x2b31('0x10')],path[_0x2b31('0x14')](_0x4b86d6['originalname'])),Date[_0x2b31('0x15')](),path[_0x2b31('0x14')](_0x4b86d6[_0x2b31('0x10')])));}})});router[_0x2b31('0x16')]('/',upload[_0x2b31('0x17')](_0x2b31('0x18')),controller[_0x2b31('0x19')]);router[_0x2b31('0x1a')](_0x2b31('0xc'),auth[_0x2b31('0xa')](),controller[_0x2b31('0x1b')]);router['delete'](_0x2b31('0xc'),auth[_0x2b31('0xa')](),controller[_0x2b31('0x1c')]);module[_0x2b31('0x1d')]=router;
\ No newline at end of file
index eb38ccc..18f5d41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbd6=['INTEGER','exports','name','STRING','FLOAT','BIGINT'];(function(_0x990ae5,_0x5b4c84){var _0x37607e=function(_0x7633dc){while(--_0x7633dc){_0x990ae5['push'](_0x990ae5['shift']());}};_0x37607e(++_0x5b4c84);}(_0xfbd6,0x175));var _0x6fbd=function(_0x5679f4,_0x193f2d){_0x5679f4=_0x5679f4-0x0;var _0x37eaec=_0xfbd6[_0x5679f4];return _0x37eaec;};'use strict';var Sequelize=require('sequelize');module[_0x6fbd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x6fbd('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x6fbd('0x2')]},'display_name':{'type':Sequelize[_0x6fbd('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x6fbd('0x2')]},'original_format':{'type':Sequelize[_0x6fbd('0x2')]},'original_duration':{'type':Sequelize[_0x6fbd('0x3')]},'original_sampleCount':{'type':Sequelize[_0x6fbd('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x6fbd('0x4')]},'original_sampleRate':{'type':Sequelize[_0x6fbd('0x5')]},'converted_format':{'type':Sequelize[_0x6fbd('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x6fbd('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x6fbd('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x6fbd('0x5')]}};
\ No newline at end of file
+var _0xee06=['name','FLOAT','BIGINT','INTEGER','sequelize','STRING'];(function(_0x49cf40,_0x2d907e){var _0x5a608f=function(_0x131e5){while(--_0x131e5){_0x49cf40['push'](_0x49cf40['shift']());}};_0x5a608f(++_0x2d907e);}(_0xee06,0x94));var _0x6ee0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee06[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6ee0('0x0'));module['exports']={'name':{'type':Sequelize[_0x6ee0('0x1')],'unique':_0x6ee0('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x6ee0('0x1')]},'original_format':{'type':Sequelize[_0x6ee0('0x1')]},'original_duration':{'type':Sequelize[_0x6ee0('0x3')]},'original_sampleCount':{'type':Sequelize[_0x6ee0('0x4')]},'original_channelCount':{'type':Sequelize[_0x6ee0('0x5')]},'original_bitRate':{'type':Sequelize[_0x6ee0('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x6ee0('0x5')]},'converted_bitRate':{'type':Sequelize[_0x6ee0('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x6ee0('0x5')]}};
\ No newline at end of file
index 73a6eca..2303466 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5800=['query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','rows','catch','show','params','keys','intersection','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','download','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_bitRate','converted_sampleRate','chmodSync','body','role','userProfileId','user','get','UserProfileSection','autoAssociation','start','update','delete','original_format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','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/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','save','then','destroy','Sounds','UserProfileResource','end','error','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model'];(function(_0x426442,_0x152382){var _0x37b69a=function(_0x39b306){while(--_0x39b306){_0x426442['push'](_0x426442['shift']());}};_0x37b69a(++_0x152382);}(_0x5800,0xc3));var _0x0580=function(_0x135f39,_0x3623e2){_0x135f39=_0x135f39-0x0;var _0x5e9e09=_0x5800[_0x135f39];return _0x5e9e09;};'use strict';var emlformat=require(_0x0580('0x0'));var rimraf=require(_0x0580('0x1'));var zipdir=require(_0x0580('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0580('0x3'));var moment=require(_0x0580('0x4'));var BPromise=require(_0x0580('0x5'));var Mustache=require(_0x0580('0x6'));var util=require(_0x0580('0x7'));var path=require('path');var sox=require(_0x0580('0x8'));var csv=require('to-csv');var ejs=require(_0x0580('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0580('0xa'));var crypto=require(_0x0580('0xb'));var jsforce=require(_0x0580('0xc'));var deskjs=require(_0x0580('0xd'));var toCsv=require(_0x0580('0xe'));var querystring=require(_0x0580('0xf'));var Papa=require(_0x0580('0x10'));var Redis=require(_0x0580('0x11'));var authService=require(_0x0580('0x12'));var qs=require(_0x0580('0x13'));var as=require(_0x0580('0x14'));var hardwareService=require(_0x0580('0x15'));var logger=require('../../config/logger')(_0x0580('0x16'));var utils=require(_0x0580('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0580('0x18'));var db=require(_0x0580('0x19'))['db'];function respondWithStatusCode(_0x3b87d6,_0x31f8d4){_0x31f8d4=_0x31f8d4||0xcc;return function(_0x2c933c){if(_0x2c933c){return _0x3b87d6['sendStatus'](_0x31f8d4);}return _0x3b87d6[_0x0580('0x1a')](_0x31f8d4)['end']();};}function respondWithResult(_0x2507bf,_0x49b2a5){_0x49b2a5=_0x49b2a5||0xc8;return function(_0x573a6a){if(_0x573a6a){return _0x2507bf[_0x0580('0x1a')](_0x49b2a5)[_0x0580('0x1b')](_0x573a6a);}};}function respondWithFilteredResult(_0x43756d,_0x30b1a8){return function(_0x545756){if(_0x545756){var _0x552933=typeof _0x30b1a8[_0x0580('0x1c')]===_0x0580('0x1d')&&typeof _0x30b1a8['limit']===_0x0580('0x1d');var _0x30eed7=_0x545756[_0x0580('0x1e')];var _0x46fecd=_0x552933?0x0:_0x30b1a8[_0x0580('0x1c')];var _0x5c89a2=_0x552933?_0x545756[_0x0580('0x1e')]:_0x30b1a8[_0x0580('0x1c')]+_0x30b1a8[_0x0580('0x1f')];var _0x4197b6;if(_0x5c89a2>=_0x30eed7){_0x5c89a2=_0x30eed7;_0x4197b6=0xc8;}else{_0x4197b6=0xce;}_0x43756d['status'](_0x4197b6);return _0x43756d[_0x0580('0x20')](_0x0580('0x21'),_0x46fecd+'-'+_0x5c89a2+'/'+_0x30eed7)[_0x0580('0x1b')](_0x545756);}return null;};}function patchUpdates(_0x190610){return function(_0x295d24){try{jsonpatch['apply'](_0x295d24,_0x190610,!![]);}catch(_0x3cb506){return BPromise['reject'](_0x3cb506);}return _0x295d24[_0x0580('0x22')]();};}function saveUpdates(_0xe3e4d1,_0x46f03d){return function(_0x375617){if(_0x375617){return _0x375617['update'](_0xe3e4d1)[_0x0580('0x23')](function(_0x34a49d){return _0x34a49d;});}return null;};}function removeEntity(_0x38347c,_0x3be8a9){return function(_0x48d76c){if(_0x48d76c){return _0x48d76c[_0x0580('0x24')]()['then'](function(){var _0x482309=_0x48d76c['get']({'plain':!![]});var _0x3edea9=_0x0580('0x25');return db[_0x0580('0x26')][_0x0580('0x24')]({'where':{'type':_0x3edea9,'resourceId':_0x482309['id']}})[_0x0580('0x23')](function(){return _0x48d76c;});})[_0x0580('0x23')](function(){_0x38347c[_0x0580('0x1a')](0xcc)[_0x0580('0x27')]();});}};}function handleEntityNotFound(_0x1ec07d,_0x1e9ffa){return function(_0x30eae7){if(!_0x30eae7){_0x1ec07d['sendStatus'](0x194);}return _0x30eae7;};}function handleError(_0x520c9e,_0x8cdaca){_0x8cdaca=_0x8cdaca||0x1f4;return function(_0x5eb122){logger[_0x0580('0x28')](_0x5eb122['stack']);if(_0x5eb122[_0x0580('0x29')]){delete _0x5eb122[_0x0580('0x29')];}_0x520c9e[_0x0580('0x1a')](_0x8cdaca)[_0x0580('0x2a')](_0x5eb122);};}exports[_0x0580('0x2b')]=function(_0x118380,_0x4e1653){var _0xa10f6a={},_0xa1eaec={},_0x200be8={'count':0x0,'rows':[]};var _0x55e58b=_[_0x0580('0x2c')](db[_0x0580('0x2d')][_0x0580('0x2e')],function(_0x2b8378){return{'name':_0x2b8378[_0x0580('0x2f')],'type':_0x2b8378[_0x0580('0x30')][_0x0580('0x31')]};});_0xa1eaec[_0x0580('0x32')]=_['map'](_0x55e58b,_0x0580('0x29'));_0xa1eaec[_0x0580('0x33')]=_['keys'](_0x118380[_0x0580('0x33')]);_0xa1eaec[_0x0580('0x34')]=_['intersection'](_0xa1eaec[_0x0580('0x32')],_0xa1eaec['query']);_0xa10f6a[_0x0580('0x35')]=_['intersection'](_0xa1eaec[_0x0580('0x32')],qs['fields'](_0x118380['query'][_0x0580('0x36')]));_0xa10f6a[_0x0580('0x35')]=_0xa10f6a[_0x0580('0x35')][_0x0580('0x37')]?_0xa10f6a[_0x0580('0x35')]:_0xa1eaec['model'];if(!_0x118380[_0x0580('0x33')][_0x0580('0x38')]('nolimit')){_0xa10f6a[_0x0580('0x1f')]=qs[_0x0580('0x1f')](_0x118380[_0x0580('0x33')][_0x0580('0x1f')]);_0xa10f6a['offset']=qs[_0x0580('0x1c')](_0x118380['query']['offset']);}_0xa10f6a[_0x0580('0x39')]=qs[_0x0580('0x3a')](_0x118380[_0x0580('0x33')][_0x0580('0x3a')]);_0xa10f6a[_0x0580('0x3b')]=qs[_0x0580('0x34')](_[_0x0580('0x3c')](_0x118380[_0x0580('0x33')],_0xa1eaec[_0x0580('0x34')]),_0x55e58b);if(_0x118380['query'][_0x0580('0x3d')]){_0xa10f6a[_0x0580('0x3b')]=_[_0x0580('0x3e')](_0xa10f6a['where'],{'$or':_[_0x0580('0x2c')](_0x55e58b,function(_0x4c8749){if(_0x4c8749[_0x0580('0x30')]!=='VIRTUAL'){var _0x49aab3={};_0x49aab3[_0x4c8749['name']]={'$like':'%'+_0x118380[_0x0580('0x33')][_0x0580('0x3d')]+'%'};return _0x49aab3;}})});}_0xa10f6a=_['merge']({},_0xa10f6a,_0x118380[_0x0580('0x3f')]);var _0x5c7e3c={'where':_0xa10f6a['where']};return db['Sound']['count'](_0x5c7e3c)[_0x0580('0x23')](function(_0x231073){_0x200be8[_0x0580('0x1e')]=_0x231073;if(_0x118380['query']['includeAll']){_0xa10f6a['include']=[{'all':!![]}];}return db[_0x0580('0x2d')]['findAll'](_0xa10f6a);})[_0x0580('0x23')](function(_0x369f5d){_0x200be8[_0x0580('0x40')]=_0x369f5d;return _0x200be8;})['then'](respondWithFilteredResult(_0x4e1653,_0xa10f6a))[_0x0580('0x41')](handleError(_0x4e1653,null));};exports[_0x0580('0x42')]=function(_0x3b0b0b,_0x1ddba0){var _0x1bb0a7={'raw':!![],'where':{'id':_0x3b0b0b[_0x0580('0x43')]['id']}},_0x593e03={};_0x593e03[_0x0580('0x32')]=_['keys'](db[_0x0580('0x2d')][_0x0580('0x2e')]);_0x593e03['query']=_[_0x0580('0x44')](_0x3b0b0b['query']);_0x593e03[_0x0580('0x34')]=_['intersection'](_0x593e03[_0x0580('0x32')],_0x593e03[_0x0580('0x33')]);_0x1bb0a7[_0x0580('0x35')]=_[_0x0580('0x45')](_0x593e03['model'],qs['fields'](_0x3b0b0b['query']['fields']));_0x1bb0a7[_0x0580('0x35')]=_0x1bb0a7[_0x0580('0x35')][_0x0580('0x37')]?_0x1bb0a7[_0x0580('0x35')]:_0x593e03['model'];if(_0x3b0b0b[_0x0580('0x33')]['includeAll']){_0x1bb0a7['include']=[{'all':!![]}];}_0x1bb0a7=_[_0x0580('0x3e')]({},_0x1bb0a7,_0x3b0b0b[_0x0580('0x3f')]);return db[_0x0580('0x2d')][_0x0580('0x46')](_0x1bb0a7)[_0x0580('0x23')](handleEntityNotFound(_0x1ddba0,null))['then'](respondWithResult(_0x1ddba0,null))[_0x0580('0x41')](handleError(_0x1ddba0,null));};exports['download']=function(_0x4e472e,_0x7927d3,_0x55ef4d){return db[_0x0580('0x2d')][_0x0580('0x46')]({'where':{'id':_0x4e472e['params']['id']},'attributes':[_0x0580('0x29'),_0x0580('0x47'),_0x0580('0x48')],'raw':!![]})[_0x0580('0x23')](handleEntityNotFound(_0x7927d3,null))[_0x0580('0x23')](function(_0x2567eb){if(_0x2567eb){if(!fs[_0x0580('0x49')](path[_0x0580('0x4a')](config[_0x0580('0x4b')],_0x0580('0x4c'),_0x2567eb[_0x0580('0x47')]+'.'+_0x2567eb['converted_format']))){throw new db[(_0x0580('0x4d'))][(_0x0580('0x4e'))](_0x0580('0x4f'));}return _0x7927d3[_0x0580('0x50')](path[_0x0580('0x4a')](config[_0x0580('0x4b')],'server/files/sounds/converted',util[_0x0580('0x51')](_0x0580('0x52'),_0x2567eb['save_name'],_0x2567eb['converted_format'])),util[_0x0580('0x51')](_0x0580('0x52'),_0x2567eb[_0x0580('0x29')],_0x2567eb['converted_format']));}return null;})[_0x0580('0x41')](handleError(_0x7927d3,null));};exports[_0x0580('0x53')]=function(_0x48a43b,_0x21d91a,_0x102b52){var _0x16ca7b={'name':path[_0x0580('0x54')](_0x48a43b[_0x0580('0x55')][_0x0580('0x56')],path[_0x0580('0x57')](_0x48a43b['file'][_0x0580('0x56')])),'save_name':path[_0x0580('0x54')](_0x48a43b[_0x0580('0x55')][_0x0580('0x58')],path[_0x0580('0x57')](_0x48a43b['file'][_0x0580('0x58')])),'original_format':path[_0x0580('0x57')](_0x48a43b['file'][_0x0580('0x56')])[_0x0580('0x59')](0x1),'converted_format':_0x0580('0x5a')};var _0x244798=path[_0x0580('0x4a')](config[_0x0580('0x4b')],_0x0580('0x5b'),_0x48a43b[_0x0580('0x55')][_0x0580('0x58')]);var _0x53156c=path['join'](config[_0x0580('0x4b')],_0x0580('0x4c'),util[_0x0580('0x51')](_0x0580('0x52'),path['basename'](_0x48a43b[_0x0580('0x55')][_0x0580('0x58')],path['extname'](_0x48a43b[_0x0580('0x55')][_0x0580('0x58')])),_0x16ca7b['converted_format']));logger[_0x0580('0x5c')](_0x0580('0x5d'),_0x244798);logger[_0x0580('0x5c')](_0x0580('0x5e'),_0x53156c);try{fs['chmodSync'](_0x244798,parseInt(_0x0580('0x5f'),0x8));var _0x4749b8=sox[_0x0580('0x60')](_0x244798,_0x53156c,{'sampleRate':0x1f40,'format':_0x0580('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4749b8['on']('error',function(_0xd0a249){fs[_0x0580('0x61')](_0x244798);_0x21d91a[_0x0580('0x1a')](0x1f4)[_0x0580('0x2a')](_0xd0a249);});_0x4749b8['on'](_0x0580('0x62'),function(_0x5235dc){_0x16ca7b[_0x0580('0x63')]=isNaN(_0x5235dc['duration'])?null:_0x5235dc[_0x0580('0x64')]*0x3e8;_0x16ca7b['original_sampleCount']=isNaN(_0x5235dc[_0x0580('0x65')])?null:_0x5235dc[_0x0580('0x65')];_0x16ca7b[_0x0580('0x66')]=isNaN(_0x5235dc[_0x0580('0x67')])?null:_0x5235dc['channelCount'];_0x16ca7b[_0x0580('0x68')]=isNaN(_0x5235dc[_0x0580('0x69')])?null:_0x5235dc[_0x0580('0x69')];_0x16ca7b[_0x0580('0x6a')]=isNaN(_0x5235dc[_0x0580('0x6b')])?null:_0x5235dc['sampleRate'];});_0x4749b8['on'](_0x0580('0x6c'),function(_0x16924e){_0x16ca7b['converted_duration']=isNaN(_0x16924e[_0x0580('0x64')])?null:_0x16924e['duration']*0x3e8;_0x16ca7b['converted_sampleCount']=isNaN(_0x16924e[_0x0580('0x65')])?null:_0x16924e[_0x0580('0x65')];_0x16ca7b['converted_channelCount']=isNaN(_0x16924e[_0x0580('0x67')])?null:_0x16924e[_0x0580('0x67')];_0x16ca7b[_0x0580('0x6d')]=isNaN(_0x16924e[_0x0580('0x69')])?null:_0x16924e[_0x0580('0x69')];_0x16ca7b[_0x0580('0x6e')]=isNaN(_0x16924e[_0x0580('0x6b')])?null:_0x16924e[_0x0580('0x6b')];});_0x4749b8['on'](_0x0580('0x27'),function(){fs[_0x0580('0x6f')](_0x53156c,parseInt(_0x0580('0x5f'),0x8));return db[_0x0580('0x2d')]['create'](_0x16ca7b)['then'](function(_0x5d2569){var _0x19bd91={'role':_0x48a43b[_0x0580('0x70')][_0x0580('0x71')],'userProfileId':_0x48a43b[_0x0580('0x70')][_0x0580('0x72')]};if(!_0x19bd91)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19bd91[_0x0580('0x71')]===_0x0580('0x73')){var _0x5bdd1d=_0x5d2569[_0x0580('0x74')]({'plain':!![]});return db[_0x0580('0x75')][_0x0580('0x46')]({'where':{'name':_0x0580('0x25'),'userProfileId':_0x19bd91[_0x0580('0x72')]},'raw':!![]})[_0x0580('0x23')](function(_0x38655b){if(_0x38655b&&_0x38655b[_0x0580('0x76')]===0x0){return db[_0x0580('0x26')][_0x0580('0x53')]({'name':_0x5bdd1d[_0x0580('0x29')],'resourceId':_0x5bdd1d['id'],'type':_0x38655b[_0x0580('0x29')],'sectionId':_0x38655b['id']},{})[_0x0580('0x23')](function(){return _0x5d2569;});}else{return _0x5d2569;}})[_0x0580('0x41')](function(_0x57be16){logger[_0x0580('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57be16);throw _0x57be16;});}return _0x5d2569;})[_0x0580('0x23')](respondWithResult(_0x21d91a,null))['catch'](handleError(_0x21d91a,null));});_0x4749b8[_0x0580('0x77')]();}catch(_0x53007e){_0x21d91a[_0x0580('0x1a')](0x1f4)[_0x0580('0x2a')](_0x53007e);}};exports[_0x0580('0x78')]=function(_0x3e9b8d,_0x1238cf,_0x3fad49){return db[_0x0580('0x2d')][_0x0580('0x46')]({'where':{'id':_0x3e9b8d['params']['id']}})[_0x0580('0x23')](handleEntityNotFound(_0x1238cf,null))[_0x0580('0x23')](saveUpdates(_[_0x0580('0x3c')](_0x3e9b8d['body'],[_0x0580('0x29'),'description']),null))[_0x0580('0x23')](respondWithResult(_0x1238cf,null))[_0x0580('0x41')](handleError(_0x1238cf,null));};exports[_0x0580('0x79')]=function(_0x261402,_0x35f934,_0xf8fa5a){return db['Sound'][_0x0580('0x46')]({'where':{'id':_0x261402['params']['id']}})['then'](function(_0x2a2159){if(_0x2a2159){return _0x2a2159[_0x0580('0x24')]();}})[_0x0580('0x23')](function(_0x3d9227){var _0x32bcc1=path[_0x0580('0x4a')](config[_0x0580('0x4b')],_0x0580('0x5b'),util[_0x0580('0x51')](_0x0580('0x52'),_0x3d9227[_0x0580('0x47')],_0x3d9227[_0x0580('0x7a')]));var _0x2e90a7=path[_0x0580('0x4a')](config[_0x0580('0x4b')],'server/files/sounds/converted',util[_0x0580('0x51')](_0x0580('0x52'),_0x3d9227[_0x0580('0x47')],_0x3d9227[_0x0580('0x48')]));fs[_0x0580('0x61')](_0x32bcc1);fs[_0x0580('0x61')](_0x2e90a7);return _0x3d9227;})[_0x0580('0x23')](function(_0x5da484){if(_0x5da484){return _0x35f934['status'](0xcc)[_0x0580('0x27')]();}})['then'](handleEntityNotFound(_0x35f934,null))[_0x0580('0x41')](handleError(_0x35f934,null));};
\ No newline at end of file
+var _0x6189=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','Sounds','UserProfileResource','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','findAll','params','includeAll','include','options','find','catch','download','save_name','converted_format','existsSync','join','root','Sequelize','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname','substring','wav','server/files/sounds/original','filename','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','duration','original_sampleCount','sampleCount','original_channelCount','original_bitRate','bitRate','original_sampleRate','dest','converted_sampleCount','converted_channelCount','channelCount','converted_bitRate','sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x6189,0x67));var _0x9618=function(_0x5ce2bb,_0x2111cc){_0x5ce2bb=_0x5ce2bb-0x0;var _0x1f33c3=_0x6189[_0x5ce2bb];return _0x1f33c3;};'use strict';var emlformat=require(_0x9618('0x0'));var rimraf=require(_0x9618('0x1'));var zipdir=require(_0x9618('0x2'));var jsonpatch=require(_0x9618('0x3'));var rp=require(_0x9618('0x4'));var moment=require('moment');var BPromise=require(_0x9618('0x5'));var Mustache=require(_0x9618('0x6'));var util=require(_0x9618('0x7'));var path=require(_0x9618('0x8'));var sox=require(_0x9618('0x9'));var csv=require(_0x9618('0xa'));var ejs=require(_0x9618('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9618('0xc'));var squel=require(_0x9618('0xd'));var crypto=require(_0x9618('0xe'));var jsforce=require(_0x9618('0xf'));var deskjs=require(_0x9618('0x10'));var toCsv=require(_0x9618('0xa'));var querystring=require(_0x9618('0x11'));var Papa=require(_0x9618('0x12'));var Redis=require('ioredis');var authService=require(_0x9618('0x13'));var qs=require(_0x9618('0x14'));var as=require(_0x9618('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9618('0x16'))('api');var utils=require(_0x9618('0x17'));var config=require(_0x9618('0x18'));var licenseUtil=require(_0x9618('0x19'));var db=require(_0x9618('0x1a'))['db'];function respondWithStatusCode(_0x4c5f09,_0x2bd1f5){_0x2bd1f5=_0x2bd1f5||0xcc;return function(_0x3b0bfd){if(_0x3b0bfd){return _0x4c5f09[_0x9618('0x1b')](_0x2bd1f5);}return _0x4c5f09['status'](_0x2bd1f5)[_0x9618('0x1c')]();};}function respondWithResult(_0x5337d5,_0x46f2d4){_0x46f2d4=_0x46f2d4||0xc8;return function(_0xd0557d){if(_0xd0557d){return _0x5337d5[_0x9618('0x1d')](_0x46f2d4)[_0x9618('0x1e')](_0xd0557d);}};}function respondWithFilteredResult(_0x93a62f,_0x5ce833){return function(_0x41ae62){if(_0x41ae62){var _0x5d38b8=typeof _0x5ce833['offset']===_0x9618('0x1f')&&typeof _0x5ce833['limit']===_0x9618('0x1f');var _0x3cb60b=_0x41ae62[_0x9618('0x20')];var _0x1dfc4e=_0x5d38b8?0x0:_0x5ce833[_0x9618('0x21')];var _0x2c8e59=_0x5d38b8?_0x41ae62['count']:_0x5ce833[_0x9618('0x21')]+_0x5ce833[_0x9618('0x22')];var _0x5f0bbb;if(_0x2c8e59>=_0x3cb60b){_0x2c8e59=_0x3cb60b;_0x5f0bbb=0xc8;}else{_0x5f0bbb=0xce;}_0x93a62f[_0x9618('0x1d')](_0x5f0bbb);return _0x93a62f[_0x9618('0x23')](_0x9618('0x24'),_0x1dfc4e+'-'+_0x2c8e59+'/'+_0x3cb60b)[_0x9618('0x1e')](_0x41ae62);}return null;};}function patchUpdates(_0x370da3){return function(_0x402625){try{jsonpatch['apply'](_0x402625,_0x370da3,!![]);}catch(_0x28be09){return BPromise[_0x9618('0x25')](_0x28be09);}return _0x402625[_0x9618('0x26')]();};}function saveUpdates(_0x3d35b5,_0x5ea770){return function(_0x1acfd9){if(_0x1acfd9){return _0x1acfd9[_0x9618('0x27')](_0x3d35b5)[_0x9618('0x28')](function(_0x25a333){return _0x25a333;});}return null;};}function removeEntity(_0x2572e4,_0x1e9b69){return function(_0x28b6c3){if(_0x28b6c3){return _0x28b6c3[_0x9618('0x29')]()[_0x9618('0x28')](function(){var _0x4ad2d9=_0x28b6c3['get']({'plain':!![]});var _0x3ac0b4=_0x9618('0x2a');return db[_0x9618('0x2b')]['destroy']({'where':{'type':_0x3ac0b4,'resourceId':_0x4ad2d9['id']}})[_0x9618('0x28')](function(){return _0x28b6c3;});})[_0x9618('0x28')](function(){_0x2572e4[_0x9618('0x1d')](0xcc)[_0x9618('0x1c')]();});}};}function handleEntityNotFound(_0x90d29c,_0x506570){return function(_0x1996f8){if(!_0x1996f8){_0x90d29c['sendStatus'](0x194);}return _0x1996f8;};}function handleError(_0x25ba78,_0x291293){_0x291293=_0x291293||0x1f4;return function(_0xf0724e){logger['error'](_0xf0724e[_0x9618('0x2c')]);if(_0xf0724e[_0x9618('0x2d')]){delete _0xf0724e['name'];}_0x25ba78[_0x9618('0x1d')](_0x291293)[_0x9618('0x2e')](_0xf0724e);};}exports[_0x9618('0x2f')]=function(_0x776b14,_0x1ad951){var _0x48308f={},_0x2b00fb={},_0x2ed35e={'count':0x0,'rows':[]};var _0x515a1f=_[_0x9618('0x30')](db[_0x9618('0x31')][_0x9618('0x32')],function(_0x30a922){return{'name':_0x30a922[_0x9618('0x33')],'type':_0x30a922[_0x9618('0x34')][_0x9618('0x35')]};});_0x2b00fb['model']=_['map'](_0x515a1f,_0x9618('0x2d'));_0x2b00fb[_0x9618('0x36')]=_[_0x9618('0x37')](_0x776b14[_0x9618('0x36')]);_0x2b00fb[_0x9618('0x38')]=_[_0x9618('0x39')](_0x2b00fb[_0x9618('0x3a')],_0x2b00fb[_0x9618('0x36')]);_0x48308f['attributes']=_[_0x9618('0x39')](_0x2b00fb[_0x9618('0x3a')],qs[_0x9618('0x3b')](_0x776b14[_0x9618('0x36')][_0x9618('0x3b')]));_0x48308f[_0x9618('0x3c')]=_0x48308f[_0x9618('0x3c')][_0x9618('0x3d')]?_0x48308f[_0x9618('0x3c')]:_0x2b00fb[_0x9618('0x3a')];if(!_0x776b14[_0x9618('0x36')][_0x9618('0x3e')](_0x9618('0x3f'))){_0x48308f['limit']=qs[_0x9618('0x22')](_0x776b14[_0x9618('0x36')][_0x9618('0x22')]);_0x48308f[_0x9618('0x21')]=qs[_0x9618('0x21')](_0x776b14[_0x9618('0x36')]['offset']);}_0x48308f['order']=qs[_0x9618('0x40')](_0x776b14[_0x9618('0x36')][_0x9618('0x40')]);_0x48308f[_0x9618('0x41')]=qs[_0x9618('0x38')](_[_0x9618('0x42')](_0x776b14[_0x9618('0x36')],_0x2b00fb['filters']),_0x515a1f);if(_0x776b14[_0x9618('0x36')][_0x9618('0x43')]){_0x48308f[_0x9618('0x41')]=_[_0x9618('0x44')](_0x48308f['where'],{'$or':_[_0x9618('0x30')](_0x515a1f,function(_0x266c62){if(_0x266c62[_0x9618('0x34')]!==_0x9618('0x45')){var _0x675ab5={};_0x675ab5[_0x266c62[_0x9618('0x2d')]]={'$like':'%'+_0x776b14[_0x9618('0x36')][_0x9618('0x43')]+'%'};return _0x675ab5;}})});}_0x48308f=_[_0x9618('0x44')]({},_0x48308f,_0x776b14['options']);var _0x63f6dc={'where':_0x48308f['where']};return db[_0x9618('0x31')][_0x9618('0x20')](_0x63f6dc)['then'](function(_0x37db46){_0x2ed35e[_0x9618('0x20')]=_0x37db46;if(_0x776b14[_0x9618('0x36')]['includeAll']){_0x48308f['include']=[{'all':!![]}];}return db[_0x9618('0x31')][_0x9618('0x46')](_0x48308f);})['then'](function(_0x4c16de){_0x2ed35e['rows']=_0x4c16de;return _0x2ed35e;})['then'](respondWithFilteredResult(_0x1ad951,_0x48308f))['catch'](handleError(_0x1ad951,null));};exports['show']=function(_0x59ba37,_0x99585b){var _0x53c472={'raw':!![],'where':{'id':_0x59ba37[_0x9618('0x47')]['id']}},_0x34c3ee={};_0x34c3ee[_0x9618('0x3a')]=_[_0x9618('0x37')](db[_0x9618('0x31')][_0x9618('0x32')]);_0x34c3ee[_0x9618('0x36')]=_[_0x9618('0x37')](_0x59ba37['query']);_0x34c3ee[_0x9618('0x38')]=_[_0x9618('0x39')](_0x34c3ee[_0x9618('0x3a')],_0x34c3ee[_0x9618('0x36')]);_0x53c472['attributes']=_[_0x9618('0x39')](_0x34c3ee[_0x9618('0x3a')],qs[_0x9618('0x3b')](_0x59ba37[_0x9618('0x36')][_0x9618('0x3b')]));_0x53c472['attributes']=_0x53c472['attributes'][_0x9618('0x3d')]?_0x53c472['attributes']:_0x34c3ee[_0x9618('0x3a')];if(_0x59ba37['query'][_0x9618('0x48')]){_0x53c472[_0x9618('0x49')]=[{'all':!![]}];}_0x53c472=_[_0x9618('0x44')]({},_0x53c472,_0x59ba37[_0x9618('0x4a')]);return db[_0x9618('0x31')][_0x9618('0x4b')](_0x53c472)[_0x9618('0x28')](handleEntityNotFound(_0x99585b,null))['then'](respondWithResult(_0x99585b,null))[_0x9618('0x4c')](handleError(_0x99585b,null));};exports[_0x9618('0x4d')]=function(_0x239fc3,_0x2036f0,_0x3a9c2a){return db['Sound'][_0x9618('0x4b')]({'where':{'id':_0x239fc3[_0x9618('0x47')]['id']},'attributes':[_0x9618('0x2d'),_0x9618('0x4e'),_0x9618('0x4f')],'raw':!![]})[_0x9618('0x28')](handleEntityNotFound(_0x2036f0,null))[_0x9618('0x28')](function(_0x195823){if(_0x195823){if(!fs[_0x9618('0x50')](path[_0x9618('0x51')](config[_0x9618('0x52')],'server/files/sounds/converted',_0x195823[_0x9618('0x4e')]+'.'+_0x195823['converted_format']))){throw new db[(_0x9618('0x53'))]['ValidationError'](_0x9618('0x54'));}return _0x2036f0[_0x9618('0x4d')](path['join'](config['root'],_0x9618('0x55'),util[_0x9618('0x56')]('%s.%s',_0x195823[_0x9618('0x4e')],_0x195823[_0x9618('0x4f')])),util['format'](_0x9618('0x57'),_0x195823[_0x9618('0x2d')],_0x195823[_0x9618('0x4f')]));}return null;})[_0x9618('0x4c')](handleError(_0x2036f0,null));};exports[_0x9618('0x58')]=function(_0x580480,_0x41207d,_0x1af209){var _0x586c3d={'name':path[_0x9618('0x59')](_0x580480[_0x9618('0x5a')][_0x9618('0x5b')],path['extname'](_0x580480[_0x9618('0x5a')][_0x9618('0x5b')])),'save_name':path[_0x9618('0x59')](_0x580480[_0x9618('0x5a')]['filename'],path[_0x9618('0x5c')](_0x580480[_0x9618('0x5a')]['filename'])),'original_format':path[_0x9618('0x5c')](_0x580480[_0x9618('0x5a')]['originalname'])[_0x9618('0x5d')](0x1),'converted_format':_0x9618('0x5e')};var _0x386cfe=path['join'](config[_0x9618('0x52')],_0x9618('0x5f'),_0x580480['file'][_0x9618('0x60')]);var _0x1f772f=path[_0x9618('0x51')](config['root'],_0x9618('0x55'),util[_0x9618('0x56')]('%s.%s',path['basename'](_0x580480[_0x9618('0x5a')][_0x9618('0x60')],path[_0x9618('0x5c')](_0x580480[_0x9618('0x5a')][_0x9618('0x60')])),_0x586c3d[_0x9618('0x4f')]));logger[_0x9618('0x61')]('Sound\x20upload\x20filepath:\x20%s',_0x386cfe);logger[_0x9618('0x61')](_0x9618('0x62'),_0x1f772f);try{fs[_0x9618('0x63')](_0x386cfe,parseInt(_0x9618('0x64'),0x8));var _0x2633c5=sox[_0x9618('0x65')](_0x386cfe,_0x1f772f,{'sampleRate':0x1f40,'format':_0x9618('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2633c5['on'](_0x9618('0x66'),function(_0x233080){fs[_0x9618('0x67')](_0x386cfe);_0x41207d[_0x9618('0x1d')](0x1f4)[_0x9618('0x2e')](_0x233080);});_0x2633c5['on']('src',function(_0x1587fa){_0x586c3d['original_duration']=isNaN(_0x1587fa['duration'])?null:_0x1587fa[_0x9618('0x68')]*0x3e8;_0x586c3d[_0x9618('0x69')]=isNaN(_0x1587fa['sampleCount'])?null:_0x1587fa[_0x9618('0x6a')];_0x586c3d[_0x9618('0x6b')]=isNaN(_0x1587fa['channelCount'])?null:_0x1587fa['channelCount'];_0x586c3d[_0x9618('0x6c')]=isNaN(_0x1587fa[_0x9618('0x6d')])?null:_0x1587fa['bitRate'];_0x586c3d[_0x9618('0x6e')]=isNaN(_0x1587fa['sampleRate'])?null:_0x1587fa['sampleRate'];});_0x2633c5['on'](_0x9618('0x6f'),function(_0x502d34){_0x586c3d['converted_duration']=isNaN(_0x502d34[_0x9618('0x68')])?null:_0x502d34['duration']*0x3e8;_0x586c3d[_0x9618('0x70')]=isNaN(_0x502d34[_0x9618('0x6a')])?null:_0x502d34[_0x9618('0x6a')];_0x586c3d[_0x9618('0x71')]=isNaN(_0x502d34['channelCount'])?null:_0x502d34[_0x9618('0x72')];_0x586c3d[_0x9618('0x73')]=isNaN(_0x502d34['bitRate'])?null:_0x502d34[_0x9618('0x6d')];_0x586c3d['converted_sampleRate']=isNaN(_0x502d34[_0x9618('0x74')])?null:_0x502d34['sampleRate'];});_0x2633c5['on'](_0x9618('0x1c'),function(){fs[_0x9618('0x63')](_0x1f772f,parseInt(_0x9618('0x64'),0x8));return db[_0x9618('0x31')][_0x9618('0x58')](_0x586c3d)[_0x9618('0x28')](function(_0xe70c21){var _0x53c053={'role':_0x580480[_0x9618('0x75')][_0x9618('0x76')],'userProfileId':_0x580480['body'][_0x9618('0x77')]};if(!_0x53c053)throw new Error(_0x9618('0x78'));if(_0x53c053[_0x9618('0x76')]==='user'){var _0x49b1e8=_0xe70c21[_0x9618('0x79')]({'plain':!![]});return db[_0x9618('0x7a')][_0x9618('0x4b')]({'where':{'name':_0x9618('0x2a'),'userProfileId':_0x53c053['userProfileId']},'raw':!![]})[_0x9618('0x28')](function(_0x1a001d){if(_0x1a001d&&_0x1a001d[_0x9618('0x7b')]===0x0){return db[_0x9618('0x2b')]['create']({'name':_0x49b1e8['name'],'resourceId':_0x49b1e8['id'],'type':_0x1a001d['name'],'sectionId':_0x1a001d['id']},{})[_0x9618('0x28')](function(){return _0xe70c21;});}else{return _0xe70c21;}})[_0x9618('0x4c')](function(_0x1a70b9){logger[_0x9618('0x66')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a70b9);throw _0x1a70b9;});}return _0xe70c21;})[_0x9618('0x28')](respondWithResult(_0x41207d,null))[_0x9618('0x4c')](handleError(_0x41207d,null));});_0x2633c5['start']();}catch(_0x52fe81){_0x41207d['status'](0x1f4)['send'](_0x52fe81);}};exports[_0x9618('0x27')]=function(_0x17f90b,_0x1138fe,_0xf55603){return db['Sound']['find']({'where':{'id':_0x17f90b[_0x9618('0x47')]['id']}})[_0x9618('0x28')](handleEntityNotFound(_0x1138fe,null))[_0x9618('0x28')](saveUpdates(_[_0x9618('0x42')](_0x17f90b['body'],[_0x9618('0x2d'),'description']),null))[_0x9618('0x28')](respondWithResult(_0x1138fe,null))['catch'](handleError(_0x1138fe,null));};exports['delete']=function(_0x57299e,_0x2634ea,_0x52e787){return db[_0x9618('0x31')][_0x9618('0x4b')]({'where':{'id':_0x57299e['params']['id']}})[_0x9618('0x28')](function(_0x3078a1){if(_0x3078a1){return _0x3078a1['destroy']();}})[_0x9618('0x28')](function(_0x49306c){var _0x3d84ac=path['join'](config[_0x9618('0x52')],'server/files/sounds/original',util[_0x9618('0x56')]('%s.%s',_0x49306c[_0x9618('0x4e')],_0x49306c[_0x9618('0x7c')]));var _0x50b620=path['join'](config[_0x9618('0x52')],_0x9618('0x55'),util['format']('%s.%s',_0x49306c['save_name'],_0x49306c[_0x9618('0x4f')]));fs[_0x9618('0x67')](_0x3d84ac);fs[_0x9618('0x67')](_0x50b620);return _0x49306c;})[_0x9618('0x28')](function(_0x25486d){if(_0x25486d){return _0x2634ea[_0x9618('0x1d')](0xcc)['end']();}})[_0x9618('0x28')](handleEntityNotFound(_0x2634ea,null))['catch'](handleError(_0x2634ea,null));};
\ No newline at end of file
index dc354a4..53a981f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b6e=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds','lodash','util','../../config/logger'];(function(_0x26aded,_0x512143){var _0x3f6429=function(_0x1745be){while(--_0x1745be){_0x26aded['push'](_0x26aded['shift']());}};_0x3f6429(++_0x512143);}(_0x0b6e,0xa6));var _0xe0b6=function(_0x1c4651,_0x404598){_0x1c4651=_0x1c4651-0x0;var _0x179f88=_0x0b6e[_0x1c4651];return _0x179f88;};'use strict';var _=require(_0xe0b6('0x0'));var util=require(_0xe0b6('0x1'));var logger=require(_0xe0b6('0x2'))(_0xe0b6('0x3'));var moment=require(_0xe0b6('0x4'));var BPromise=require(_0xe0b6('0x5'));var rp=require(_0xe0b6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0b6('0x7'));var config=require(_0xe0b6('0x8'));var attributes=require(_0xe0b6('0x9'));module['exports']=function(_0x41d46d,_0x13f790){return _0x41d46d[_0xe0b6('0xa')](_0xe0b6('0xb'),attributes,{'tableName':_0xe0b6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d81=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','tools_sounds'];(function(_0xc9396b,_0x734ceb){var _0x56d6ee=function(_0x2456c0){while(--_0x2456c0){_0xc9396b['push'](_0xc9396b['shift']());}};_0x56d6ee(++_0x734ceb);}(_0x2d81,0x18c));var _0x12d8=function(_0x3987df,_0x5c2a7a){_0x3987df=_0x3987df-0x0;var _0x3543f9=_0x2d81[_0x3987df];return _0x3543f9;};'use strict';var _=require(_0x12d8('0x0'));var util=require('util');var logger=require(_0x12d8('0x1'))('api');var moment=require(_0x12d8('0x2'));var BPromise=require(_0x12d8('0x3'));var rp=require(_0x12d8('0x4'));var fs=require('fs');var path=require(_0x12d8('0x5'));var rimraf=require(_0x12d8('0x6'));var config=require(_0x12d8('0x7'));var attributes=require('./sound.attributes');module[_0x12d8('0x8')]=function(_0x826697,_0x317178){return _0x826697[_0x12d8('0x9')]('Sound',attributes,{'tableName':_0x12d8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e372b3c..6727c1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3402=['info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Sound','find','options','where','attributes','include','map','model','ShowSound','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then'];(function(_0x40dcbd,_0x1a9fe5){var _0x1ec7d5=function(_0x32db90){while(--_0x32db90){_0x40dcbd['push'](_0x40dcbd['shift']());}};_0x1ec7d5(++_0x1a9fe5);}(_0x3402,0xde));var _0x2340=function(_0x2726c4,_0x1349af){_0x2726c4=_0x2726c4-0x0;var _0x3891d4=_0x3402[_0x2726c4];return _0x3891d4;};'use strict';var _=require(_0x2340('0x0'));var util=require('util');var moment=require(_0x2340('0x1'));var BPromise=require('bluebird');var rs=require(_0x2340('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2340('0x3'))['db'];var utils=require(_0x2340('0x4'));var logger=require(_0x2340('0x5'))(_0x2340('0x6'));var config=require('../../config/environment');var jayson=require(_0x2340('0x7'));var client=jayson['client'][_0x2340('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4459df,_0x776063,_0x1faadb){return new BPromise(function(_0x4efa4a,_0x37c71e){return client['request'](_0x4459df,_0x1faadb)[_0x2340('0x9')](function(_0x32c7d9){logger[_0x2340('0xa')](_0x2340('0xb'),_0x776063,_0x2340('0xc'));logger[_0x2340('0xd')](_0x2340('0xe'),_0x776063,_0x2340('0xc'),JSON[_0x2340('0xf')](_0x32c7d9));if(_0x32c7d9[_0x2340('0x10')]){if(_0x32c7d9[_0x2340('0x10')]['code']===0x1f4){logger[_0x2340('0x10')](_0x2340('0xb'),_0x776063,_0x32c7d9[_0x2340('0x10')][_0x2340('0x11')]);return _0x37c71e(_0x32c7d9['error'][_0x2340('0x11')]);}logger[_0x2340('0x10')](_0x2340('0xb'),_0x776063,_0x32c7d9[_0x2340('0x10')][_0x2340('0x11')]);return _0x4efa4a(_0x32c7d9[_0x2340('0x10')][_0x2340('0x11')]);}else{logger[_0x2340('0xa')](_0x2340('0xb'),_0x776063,_0x2340('0xc'));_0x4efa4a(_0x32c7d9[_0x2340('0x12')]['message']);}})[_0x2340('0x13')](function(_0x432e5e){logger['error']('Sound,\x20%s,\x20%s',_0x776063,_0x432e5e);_0x37c71e(_0x432e5e);});});}exports['ShowSound']=function(_0x1cf83e){var _0x4936fd=this;return new Promise(function(_0x380d66,_0x297439){return db[_0x2340('0x14')][_0x2340('0x15')]({'raw':_0x1cf83e[_0x2340('0x16')]?_0x1cf83e[_0x2340('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1cf83e[_0x2340('0x16')]?_0x1cf83e[_0x2340('0x16')][_0x2340('0x17')]||null:null,'attributes':_0x1cf83e[_0x2340('0x16')]?_0x1cf83e['options'][_0x2340('0x18')]||null:null,'include':_0x1cf83e['options']?_0x1cf83e[_0x2340('0x16')][_0x2340('0x19')]?_[_0x2340('0x1a')](_0x1cf83e[_0x2340('0x16')]['include'],function(_0x291110){return{'model':db[_0x291110['model']],'as':_0x291110['as'],'attributes':_0x291110['attributes'],'include':_0x291110[_0x2340('0x19')]?_[_0x2340('0x1a')](_0x291110[_0x2340('0x19')],function(_0x2e29c4){return{'model':db[_0x2e29c4[_0x2340('0x1b')]],'as':_0x2e29c4['as'],'attributes':_0x2e29c4[_0x2340('0x18')],'include':_0x2e29c4['include']?_['map'](_0x2e29c4[_0x2340('0x19')],function(_0x342e94){return{'model':db[_0x342e94[_0x2340('0x1b')]],'as':_0x342e94['as'],'attributes':_0x342e94[_0x2340('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2340('0x9')](function(_0x50ba42){logger[_0x2340('0xa')](_0x2340('0x1c'),_0x1cf83e);logger[_0x2340('0xd')](_0x2340('0x1c'),_0x1cf83e,JSON['stringify'](_0x50ba42));_0x380d66(_0x50ba42);})[_0x2340('0x13')](function(_0x29757b){logger[_0x2340('0x10')](_0x2340('0x1c'),_0x29757b['message'],_0x1cf83e);_0x297439(_0x4936fd[_0x2340('0x10')](0x1f4,_0x29757b[_0x2340('0x11')]));});});};
\ No newline at end of file
+var _0xb2bb=['ShowSound','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','Sound,\x20%s,\x20%s','result','catch','Sound','options','raw','where','attributes','include','map','model'];(function(_0x22aa45,_0x1dae79){var _0x3b073b=function(_0x23cca9){while(--_0x23cca9){_0x22aa45['push'](_0x22aa45['shift']());}};_0x3b073b(++_0x1dae79);}(_0xb2bb,0x197));var _0xbb2b=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0xb2bb[_0x4f4d19];return _0x27a258;};'use strict';var _=require(_0xbb2b('0x0'));var util=require(_0xbb2b('0x1'));var moment=require('moment');var BPromise=require(_0xbb2b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb2b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb2b('0x4'))('rpc');var config=require(_0xbb2b('0x5'));var jayson=require(_0xbb2b('0x6'));var client=jayson[_0xbb2b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54a485,_0x35c68c,_0x1784bf){return new BPromise(function(_0x3bb027,_0x525320){return client[_0xbb2b('0x8')](_0x54a485,_0x1784bf)[_0xbb2b('0x9')](function(_0x24656a){logger[_0xbb2b('0xa')]('Sound,\x20%s,\x20%s',_0x35c68c,_0xbb2b('0xb'));logger[_0xbb2b('0xc')](_0xbb2b('0xd'),_0x35c68c,_0xbb2b('0xb'),JSON[_0xbb2b('0xe')](_0x24656a));if(_0x24656a[_0xbb2b('0xf')]){if(_0x24656a['error']['code']===0x1f4){logger[_0xbb2b('0xf')]('Sound,\x20%s,\x20%s',_0x35c68c,_0x24656a[_0xbb2b('0xf')][_0xbb2b('0x10')]);return _0x525320(_0x24656a[_0xbb2b('0xf')][_0xbb2b('0x10')]);}logger['error'](_0xbb2b('0x11'),_0x35c68c,_0x24656a[_0xbb2b('0xf')][_0xbb2b('0x10')]);return _0x3bb027(_0x24656a['error'][_0xbb2b('0x10')]);}else{logger['info'](_0xbb2b('0x11'),_0x35c68c,'request\x20sent');_0x3bb027(_0x24656a[_0xbb2b('0x12')][_0xbb2b('0x10')]);}})[_0xbb2b('0x13')](function(_0x3992c8){logger[_0xbb2b('0xf')]('Sound,\x20%s,\x20%s',_0x35c68c,_0x3992c8);_0x525320(_0x3992c8);});});}exports['ShowSound']=function(_0x553c7){var _0x23a8a2=this;return new Promise(function(_0x540ac2,_0x412460){return db[_0xbb2b('0x14')]['find']({'raw':_0x553c7['options']?_0x553c7[_0xbb2b('0x15')][_0xbb2b('0x16')]===undefined?!![]:![]:!![],'where':_0x553c7[_0xbb2b('0x15')]?_0x553c7[_0xbb2b('0x15')][_0xbb2b('0x17')]||null:null,'attributes':_0x553c7['options']?_0x553c7[_0xbb2b('0x15')][_0xbb2b('0x18')]||null:null,'include':_0x553c7[_0xbb2b('0x15')]?_0x553c7[_0xbb2b('0x15')][_0xbb2b('0x19')]?_[_0xbb2b('0x1a')](_0x553c7[_0xbb2b('0x15')]['include'],function(_0x5df4dc){return{'model':db[_0x5df4dc[_0xbb2b('0x1b')]],'as':_0x5df4dc['as'],'attributes':_0x5df4dc[_0xbb2b('0x18')],'include':_0x5df4dc[_0xbb2b('0x19')]?_['map'](_0x5df4dc[_0xbb2b('0x19')],function(_0x43c72d){return{'model':db[_0x43c72d[_0xbb2b('0x1b')]],'as':_0x43c72d['as'],'attributes':_0x43c72d[_0xbb2b('0x18')],'include':_0x43c72d['include']?_[_0xbb2b('0x1a')](_0x43c72d[_0xbb2b('0x19')],function(_0x585daf){return{'model':db[_0x585daf[_0xbb2b('0x1b')]],'as':_0x585daf['as'],'attributes':_0x585daf[_0xbb2b('0x18')]};}):[]};}):[]};}):[]:[]})[_0xbb2b('0x9')](function(_0x13e569){logger[_0xbb2b('0xa')](_0xbb2b('0x1c'),_0x553c7);logger[_0xbb2b('0xc')](_0xbb2b('0x1c'),_0x553c7,JSON[_0xbb2b('0xe')](_0x13e569));_0x540ac2(_0x13e569);})['catch'](function(_0x4d3ab4){logger[_0xbb2b('0xf')](_0xbb2b('0x1c'),_0x4d3ab4[_0xbb2b('0x10')],_0x553c7);_0x412460(_0x23a8a2['error'](0x1f4,_0x4d3ab4[_0xbb2b('0x10')]));});});};
\ No newline at end of file
index 5816c74..72553fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x51992c,_0x1cd557){var _0x3c004a=function(_0x1629db){while(--_0x1629db){_0x51992c['push'](_0x51992c['shift']());}};_0x3c004a(++_0x1cd557);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xb7e7[_0x1b7368];return _0x25d54c;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router;
\ No newline at end of file
+var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x318372,_0x56ae1e){var _0x518e04=function(_0x3bf1c5){while(--_0x3bf1c5){_0x318372['push'](_0x318372['shift']());}};_0x518e04(++_0x56ae1e);}(_0xda3f,0xec));var _0xfda3=function(_0x3fe0de,_0x3bfd98){_0x3fe0de=_0x3fe0de-0x0;var _0x5f5343=_0xda3f[_0x3fe0de];return _0x5f5343;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router;
\ No newline at end of file
index 2c2f453..961346e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f5b=['medium','ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x573a42,_0x364e60){var _0x45b48a=function(_0x175aa6){while(--_0x175aa6){_0x573a42['push'](_0x573a42['shift']());}};_0x45b48a(++_0x364e60);}(_0x6f5b,0x6c));var _0xb6f5=function(_0x3dab0f,_0x2e0806){_0x3dab0f=_0x3dab0f-0x0;var _0x135382=_0x6f5b[_0x3dab0f];return _0x135382;};'use strict';var Sequelize=require(_0xb6f5('0x0'));module[_0xb6f5('0x1')]={'uniqueid':{'type':Sequelize[_0xb6f5('0x2')]},'body':{'type':Sequelize[_0xb6f5('0x3')](_0xb6f5('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xb6f5('0x5')]('in',_0xb6f5('0x6')),'defaultValue':_0xb6f5('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xb6f5('0x2')]},'providerResponse':{'type':Sequelize[_0xb6f5('0x3')]}};
\ No newline at end of file
+var _0x1ed2=['sequelize','exports','medium','ENUM','out','TEXT'];(function(_0x41d8d8,_0x495ecc){var _0x35f492=function(_0x2443e0){while(--_0x2443e0){_0x41d8d8['push'](_0x41d8d8['shift']());}};_0x35f492(++_0x495ecc);}(_0x1ed2,0x1a4));var _0x21ed=function(_0x1da7b,_0x3ce5ec){_0x1da7b=_0x1da7b-0x0;var _0x4bf8e3=_0x1ed2[_0x1da7b];return _0x4bf8e3;};'use strict';var Sequelize=require(_0x21ed('0x0'));module[_0x21ed('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0x21ed('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x21ed('0x3')]('in',_0x21ed('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x21ed('0x5')]}};
\ No newline at end of file
index d913ed2..9fc32df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c43=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','error','name','send','map','SquareMessage','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel'];(function(_0x360fc0,_0x280ca1){var _0x5417f9=function(_0x88a9ea){while(--_0x88a9ea){_0x360fc0['push'](_0x360fc0['shift']());}};_0x5417f9(++_0x280ca1);}(_0x8c43,0x1e5));var _0x38c4=function(_0x21baeb,_0x5039ce){_0x21baeb=_0x21baeb-0x0;var _0x3b444c=_0x8c43[_0x21baeb];return _0x3b444c;};'use strict';var emlformat=require(_0x38c4('0x0'));var rimraf=require(_0x38c4('0x1'));var zipdir=require(_0x38c4('0x2'));var jsonpatch=require(_0x38c4('0x3'));var rp=require(_0x38c4('0x4'));var moment=require('moment');var BPromise=require(_0x38c4('0x5'));var Mustache=require(_0x38c4('0x6'));var util=require('util');var path=require('path');var sox=require(_0x38c4('0x7'));var csv=require(_0x38c4('0x8'));var ejs=require(_0x38c4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x38c4('0xa'));var squel=require(_0x38c4('0xb'));var crypto=require(_0x38c4('0xc'));var jsforce=require(_0x38c4('0xd'));var deskjs=require(_0x38c4('0xe'));var toCsv=require(_0x38c4('0x8'));var querystring=require(_0x38c4('0xf'));var Papa=require(_0x38c4('0x10'));var Redis=require('ioredis');var authService=require(_0x38c4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x38c4('0x12'));var hardwareService=require(_0x38c4('0x13'));var logger=require(_0x38c4('0x14'))(_0x38c4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x38c4('0x16'));var db=require(_0x38c4('0x17'))['db'];function respondWithStatusCode(_0xcc7576,_0x5bbcac){_0x5bbcac=_0x5bbcac||0xcc;return function(_0x42886b){if(_0x42886b){return _0xcc7576[_0x38c4('0x18')](_0x5bbcac);}return _0xcc7576[_0x38c4('0x19')](_0x5bbcac)[_0x38c4('0x1a')]();};}function respondWithResult(_0x5bd524,_0x4d52d2){_0x4d52d2=_0x4d52d2||0xc8;return function(_0x513ea7){if(_0x513ea7){return _0x5bd524['status'](_0x4d52d2)['json'](_0x513ea7);}};}function respondWithFilteredResult(_0x1f0e59,_0x5513c7){return function(_0x10e7c8){if(_0x10e7c8){var _0x521e56=typeof _0x5513c7[_0x38c4('0x1b')]===_0x38c4('0x1c')&&typeof _0x5513c7[_0x38c4('0x1d')]===_0x38c4('0x1c');var _0x45001e=_0x10e7c8[_0x38c4('0x1e')];var _0x5df375=_0x521e56?0x0:_0x5513c7['offset'];var _0x39d616=_0x521e56?_0x10e7c8[_0x38c4('0x1e')]:_0x5513c7['offset']+_0x5513c7[_0x38c4('0x1d')];var _0x5bbcb1;if(_0x39d616>=_0x45001e){_0x39d616=_0x45001e;_0x5bbcb1=0xc8;}else{_0x5bbcb1=0xce;}_0x1f0e59[_0x38c4('0x19')](_0x5bbcb1);return _0x1f0e59['set'](_0x38c4('0x1f'),_0x5df375+'-'+_0x39d616+'/'+_0x45001e)[_0x38c4('0x20')](_0x10e7c8);}return null;};}function patchUpdates(_0x17663a){return function(_0x4304ca){try{jsonpatch[_0x38c4('0x21')](_0x4304ca,_0x17663a,!![]);}catch(_0x22f7a4){return BPromise['reject'](_0x22f7a4);}return _0x4304ca[_0x38c4('0x22')]();};}function saveUpdates(_0x2360cf,_0xe0dc0f){return function(_0xd1c90e){if(_0xd1c90e){return _0xd1c90e[_0x38c4('0x23')](_0x2360cf)[_0x38c4('0x24')](function(_0x4ab306){return _0x4ab306;});}return null;};}function removeEntity(_0x2cc90b,_0x1d1c08){return function(_0x1495b1){if(_0x1495b1){return _0x1495b1[_0x38c4('0x25')]()[_0x38c4('0x24')](function(){_0x2cc90b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x433fa4,_0x3fe828){return function(_0x4cebce){if(!_0x4cebce){_0x433fa4[_0x38c4('0x18')](0x194);}return _0x4cebce;};}function handleError(_0x42e41c,_0x22e3df){_0x22e3df=_0x22e3df||0x1f4;return function(_0x55bc20){logger[_0x38c4('0x26')](_0x55bc20['stack']);if(_0x55bc20[_0x38c4('0x27')]){delete _0x55bc20['name'];}_0x42e41c[_0x38c4('0x19')](_0x22e3df)[_0x38c4('0x28')](_0x55bc20);};}exports['index']=function(_0xba9861,_0x5c1e56){var _0x126f1a={},_0x6c9d1d={},_0x1db9c9={'count':0x0,'rows':[]};var _0x211f77=_[_0x38c4('0x29')](db[_0x38c4('0x2a')]['rawAttributes'],function(_0x37dd6b){return{'name':_0x37dd6b['fieldName'],'type':_0x37dd6b['type']['key']};});_0x6c9d1d[_0x38c4('0x2b')]=_[_0x38c4('0x29')](_0x211f77,_0x38c4('0x27'));_0x6c9d1d[_0x38c4('0x2c')]=_[_0x38c4('0x2d')](_0xba9861[_0x38c4('0x2c')]);_0x6c9d1d['filters']=_[_0x38c4('0x2e')](_0x6c9d1d[_0x38c4('0x2b')],_0x6c9d1d[_0x38c4('0x2c')]);_0x126f1a['attributes']=_['intersection'](_0x6c9d1d[_0x38c4('0x2b')],qs[_0x38c4('0x2f')](_0xba9861[_0x38c4('0x2c')][_0x38c4('0x2f')]));_0x126f1a['attributes']=_0x126f1a[_0x38c4('0x30')][_0x38c4('0x31')]?_0x126f1a['attributes']:_0x6c9d1d[_0x38c4('0x2b')];if(!_0xba9861[_0x38c4('0x2c')]['hasOwnProperty'](_0x38c4('0x32'))){_0x126f1a[_0x38c4('0x1d')]=qs[_0x38c4('0x1d')](_0xba9861['query'][_0x38c4('0x1d')]);_0x126f1a[_0x38c4('0x1b')]=qs[_0x38c4('0x1b')](_0xba9861['query'][_0x38c4('0x1b')]);}_0x126f1a[_0x38c4('0x33')]=qs[_0x38c4('0x34')](_0xba9861[_0x38c4('0x2c')][_0x38c4('0x34')]);_0x126f1a[_0x38c4('0x35')]=qs[_0x38c4('0x36')](_[_0x38c4('0x37')](_0xba9861[_0x38c4('0x2c')],_0x6c9d1d[_0x38c4('0x36')]),_0x211f77);if(_0xba9861[_0x38c4('0x2c')][_0x38c4('0x38')]){_0x126f1a[_0x38c4('0x35')]=_[_0x38c4('0x39')](_0x126f1a[_0x38c4('0x35')],{'$or':_['map'](_0x211f77,function(_0xa2828d){if(_0xa2828d['type']!==_0x38c4('0x3a')){var _0x41baa5={};_0x41baa5[_0xa2828d[_0x38c4('0x27')]]={'$like':'%'+_0xba9861['query']['filter']+'%'};return _0x41baa5;}})});}_0x126f1a=_[_0x38c4('0x39')]({},_0x126f1a,_0xba9861[_0x38c4('0x3b')]);var _0x421baf={'where':_0x126f1a[_0x38c4('0x35')]};return db[_0x38c4('0x2a')][_0x38c4('0x1e')](_0x421baf)['then'](function(_0x42f587){_0x1db9c9[_0x38c4('0x1e')]=_0x42f587;if(_0xba9861[_0x38c4('0x2c')][_0x38c4('0x3c')]){_0x126f1a['include']=[{'all':!![]}];}return db[_0x38c4('0x2a')][_0x38c4('0x3d')](_0x126f1a);})[_0x38c4('0x24')](function(_0xe419){_0x1db9c9[_0x38c4('0x3e')]=_0xe419;return _0x1db9c9;})[_0x38c4('0x24')](respondWithFilteredResult(_0x5c1e56,_0x126f1a))[_0x38c4('0x3f')](handleError(_0x5c1e56,null));};exports[_0x38c4('0x40')]=function(_0x1a235b,_0x14a66c){var _0x48d860={'raw':!![],'where':{'id':_0x1a235b[_0x38c4('0x41')]['id']}},_0x127fd0={};_0x127fd0[_0x38c4('0x2b')]=_[_0x38c4('0x2d')](db[_0x38c4('0x2a')][_0x38c4('0x42')]);_0x127fd0[_0x38c4('0x2c')]=_[_0x38c4('0x2d')](_0x1a235b[_0x38c4('0x2c')]);_0x127fd0[_0x38c4('0x36')]=_['intersection'](_0x127fd0[_0x38c4('0x2b')],_0x127fd0[_0x38c4('0x2c')]);_0x48d860[_0x38c4('0x30')]=_[_0x38c4('0x2e')](_0x127fd0[_0x38c4('0x2b')],qs[_0x38c4('0x2f')](_0x1a235b[_0x38c4('0x2c')][_0x38c4('0x2f')]));_0x48d860[_0x38c4('0x30')]=_0x48d860[_0x38c4('0x30')][_0x38c4('0x31')]?_0x48d860[_0x38c4('0x30')]:_0x127fd0[_0x38c4('0x2b')];if(_0x1a235b['query']['includeAll']){_0x48d860[_0x38c4('0x43')]=[{'all':!![]}];}_0x48d860=_[_0x38c4('0x39')]({},_0x48d860,_0x1a235b[_0x38c4('0x3b')]);return db[_0x38c4('0x2a')][_0x38c4('0x44')](_0x48d860)['then'](handleEntityNotFound(_0x14a66c,null))[_0x38c4('0x24')](respondWithResult(_0x14a66c,null))[_0x38c4('0x3f')](handleError(_0x14a66c,null));};exports['create']=function(_0xb63477,_0x5349be){return db[_0x38c4('0x2a')][_0x38c4('0x45')](_0xb63477['body'],{})['then'](respondWithResult(_0x5349be,0xc9))[_0x38c4('0x3f')](handleError(_0x5349be,null));};exports[_0x38c4('0x23')]=function(_0x4d1f09,_0x199878){if(_0x4d1f09[_0x38c4('0x46')]['id']){delete _0x4d1f09[_0x38c4('0x46')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x4d1f09['params']['id']}})[_0x38c4('0x24')](handleEntityNotFound(_0x199878,null))[_0x38c4('0x24')](saveUpdates(_0x4d1f09[_0x38c4('0x46')],null))[_0x38c4('0x24')](respondWithResult(_0x199878,null))[_0x38c4('0x3f')](handleError(_0x199878,null));};exports['destroy']=function(_0x103ee5,_0x59dbb0){return db[_0x38c4('0x2a')][_0x38c4('0x44')]({'where':{'id':_0x103ee5[_0x38c4('0x41')]['id']}})[_0x38c4('0x24')](handleEntityNotFound(_0x59dbb0,null))[_0x38c4('0x24')](removeEntity(_0x59dbb0,null))[_0x38c4('0x3f')](handleError(_0x59dbb0,null));};
\ No newline at end of file
+var _0xa1c9=['where','VIRTUAL','filter','SquareMessage','findAll','rows','catch','show','rawAttributes','intersection','includeAll','include','merge','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','type','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','pick'];(function(_0x4ff30d,_0x822aa){var _0x15b604=function(_0x171ddc){while(--_0x171ddc){_0x4ff30d['push'](_0x4ff30d['shift']());}};_0x15b604(++_0x822aa);}(_0xa1c9,0x135));var _0x9a1c=function(_0x5f3096,_0x58c5dc){_0x5f3096=_0x5f3096-0x0;var _0x3cd091=_0xa1c9[_0x5f3096];return _0x3cd091;};'use strict';var emlformat=require(_0x9a1c('0x0'));var rimraf=require(_0x9a1c('0x1'));var zipdir=require(_0x9a1c('0x2'));var jsonpatch=require(_0x9a1c('0x3'));var rp=require(_0x9a1c('0x4'));var moment=require(_0x9a1c('0x5'));var BPromise=require(_0x9a1c('0x6'));var Mustache=require(_0x9a1c('0x7'));var util=require(_0x9a1c('0x8'));var path=require('path');var sox=require(_0x9a1c('0x9'));var csv=require(_0x9a1c('0xa'));var ejs=require(_0x9a1c('0xb'));var fs=require('fs');var fs_extra=require(_0x9a1c('0xc'));var _=require(_0x9a1c('0xd'));var squel=require('squel');var crypto=require(_0x9a1c('0xe'));var jsforce=require(_0x9a1c('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9a1c('0x10'));var authService=require(_0x9a1c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9a1c('0x12'));var hardwareService=require(_0x9a1c('0x13'));var logger=require(_0x9a1c('0x14'))(_0x9a1c('0x15'));var utils=require(_0x9a1c('0x16'));var config=require(_0x9a1c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a1c('0x18'))['db'];function respondWithStatusCode(_0x9e9fa7,_0x5f4b4a){_0x5f4b4a=_0x5f4b4a||0xcc;return function(_0x55b576){if(_0x55b576){return _0x9e9fa7[_0x9a1c('0x19')](_0x5f4b4a);}return _0x9e9fa7[_0x9a1c('0x1a')](_0x5f4b4a)['end']();};}function respondWithResult(_0x7eda6,_0x2fc38c){_0x2fc38c=_0x2fc38c||0xc8;return function(_0x40bd35){if(_0x40bd35){return _0x7eda6[_0x9a1c('0x1a')](_0x2fc38c)[_0x9a1c('0x1b')](_0x40bd35);}};}function respondWithFilteredResult(_0x5c3dbd,_0x10d080){return function(_0x3e1349){if(_0x3e1349){var _0x5c327b=typeof _0x10d080[_0x9a1c('0x1c')]==='undefined'&&typeof _0x10d080[_0x9a1c('0x1d')]==='undefined';var _0x5bbfc=_0x3e1349['count'];var _0xcca0e5=_0x5c327b?0x0:_0x10d080[_0x9a1c('0x1c')];var _0x5f3403=_0x5c327b?_0x3e1349[_0x9a1c('0x1e')]:_0x10d080[_0x9a1c('0x1c')]+_0x10d080[_0x9a1c('0x1d')];var _0x3c8d9d;if(_0x5f3403>=_0x5bbfc){_0x5f3403=_0x5bbfc;_0x3c8d9d=0xc8;}else{_0x3c8d9d=0xce;}_0x5c3dbd[_0x9a1c('0x1a')](_0x3c8d9d);return _0x5c3dbd['set'](_0x9a1c('0x1f'),_0xcca0e5+'-'+_0x5f3403+'/'+_0x5bbfc)[_0x9a1c('0x1b')](_0x3e1349);}return null;};}function patchUpdates(_0x5ef70a){return function(_0x43eae5){try{jsonpatch[_0x9a1c('0x20')](_0x43eae5,_0x5ef70a,!![]);}catch(_0x24254c){return BPromise[_0x9a1c('0x21')](_0x24254c);}return _0x43eae5[_0x9a1c('0x22')]();};}function saveUpdates(_0x3a8a12,_0x3a69ef){return function(_0x231764){if(_0x231764){return _0x231764[_0x9a1c('0x23')](_0x3a8a12)[_0x9a1c('0x24')](function(_0x45fa32){return _0x45fa32;});}return null;};}function removeEntity(_0x5558c8,_0x128bba){return function(_0x156f52){if(_0x156f52){return _0x156f52[_0x9a1c('0x25')]()[_0x9a1c('0x24')](function(){_0x5558c8['status'](0xcc)[_0x9a1c('0x26')]();});}};}function handleEntityNotFound(_0x3da3ce,_0x3978c3){return function(_0xa6519e){if(!_0xa6519e){_0x3da3ce[_0x9a1c('0x19')](0x194);}return _0xa6519e;};}function handleError(_0x3cf5a6,_0x28c240){_0x28c240=_0x28c240||0x1f4;return function(_0x36194e){logger['error'](_0x36194e[_0x9a1c('0x27')]);if(_0x36194e[_0x9a1c('0x28')]){delete _0x36194e[_0x9a1c('0x28')];}_0x3cf5a6[_0x9a1c('0x1a')](_0x28c240)[_0x9a1c('0x29')](_0x36194e);};}exports[_0x9a1c('0x2a')]=function(_0x40ad2f,_0x4a0226){var _0x887ca6={},_0x32ece9={},_0x28becc={'count':0x0,'rows':[]};var _0x52248e=_[_0x9a1c('0x2b')](db['SquareMessage']['rawAttributes'],function(_0x37e741){return{'name':_0x37e741['fieldName'],'type':_0x37e741[_0x9a1c('0x2c')]['key']};});_0x32ece9[_0x9a1c('0x2d')]=_['map'](_0x52248e,_0x9a1c('0x28'));_0x32ece9['query']=_[_0x9a1c('0x2e')](_0x40ad2f[_0x9a1c('0x2f')]);_0x32ece9[_0x9a1c('0x30')]=_['intersection'](_0x32ece9[_0x9a1c('0x2d')],_0x32ece9[_0x9a1c('0x2f')]);_0x887ca6[_0x9a1c('0x31')]=_['intersection'](_0x32ece9[_0x9a1c('0x2d')],qs[_0x9a1c('0x32')](_0x40ad2f[_0x9a1c('0x2f')][_0x9a1c('0x32')]));_0x887ca6['attributes']=_0x887ca6[_0x9a1c('0x31')][_0x9a1c('0x33')]?_0x887ca6[_0x9a1c('0x31')]:_0x32ece9['model'];if(!_0x40ad2f['query'][_0x9a1c('0x34')](_0x9a1c('0x35'))){_0x887ca6[_0x9a1c('0x1d')]=qs['limit'](_0x40ad2f[_0x9a1c('0x2f')]['limit']);_0x887ca6[_0x9a1c('0x1c')]=qs[_0x9a1c('0x1c')](_0x40ad2f[_0x9a1c('0x2f')]['offset']);}_0x887ca6[_0x9a1c('0x36')]=qs['sort'](_0x40ad2f[_0x9a1c('0x2f')]['sort']);_0x887ca6['where']=qs[_0x9a1c('0x30')](_[_0x9a1c('0x37')](_0x40ad2f[_0x9a1c('0x2f')],_0x32ece9[_0x9a1c('0x30')]),_0x52248e);if(_0x40ad2f[_0x9a1c('0x2f')]['filter']){_0x887ca6[_0x9a1c('0x38')]=_['merge'](_0x887ca6[_0x9a1c('0x38')],{'$or':_[_0x9a1c('0x2b')](_0x52248e,function(_0x5b1eee){if(_0x5b1eee['type']!==_0x9a1c('0x39')){var _0x3fbbed={};_0x3fbbed[_0x5b1eee[_0x9a1c('0x28')]]={'$like':'%'+_0x40ad2f[_0x9a1c('0x2f')][_0x9a1c('0x3a')]+'%'};return _0x3fbbed;}})});}_0x887ca6=_['merge']({},_0x887ca6,_0x40ad2f['options']);var _0x252355={'where':_0x887ca6[_0x9a1c('0x38')]};return db[_0x9a1c('0x3b')][_0x9a1c('0x1e')](_0x252355)[_0x9a1c('0x24')](function(_0x49fb74){_0x28becc[_0x9a1c('0x1e')]=_0x49fb74;if(_0x40ad2f[_0x9a1c('0x2f')]['includeAll']){_0x887ca6['include']=[{'all':!![]}];}return db[_0x9a1c('0x3b')][_0x9a1c('0x3c')](_0x887ca6);})['then'](function(_0x2367a2){_0x28becc[_0x9a1c('0x3d')]=_0x2367a2;return _0x28becc;})[_0x9a1c('0x24')](respondWithFilteredResult(_0x4a0226,_0x887ca6))[_0x9a1c('0x3e')](handleError(_0x4a0226,null));};exports[_0x9a1c('0x3f')]=function(_0x3606cf,_0x3ec2de){var _0x3634e6={'raw':!![],'where':{'id':_0x3606cf['params']['id']}},_0x4efb97={};_0x4efb97[_0x9a1c('0x2d')]=_[_0x9a1c('0x2e')](db[_0x9a1c('0x3b')][_0x9a1c('0x40')]);_0x4efb97[_0x9a1c('0x2f')]=_['keys'](_0x3606cf['query']);_0x4efb97[_0x9a1c('0x30')]=_['intersection'](_0x4efb97[_0x9a1c('0x2d')],_0x4efb97[_0x9a1c('0x2f')]);_0x3634e6['attributes']=_[_0x9a1c('0x41')](_0x4efb97[_0x9a1c('0x2d')],qs['fields'](_0x3606cf[_0x9a1c('0x2f')][_0x9a1c('0x32')]));_0x3634e6[_0x9a1c('0x31')]=_0x3634e6[_0x9a1c('0x31')][_0x9a1c('0x33')]?_0x3634e6[_0x9a1c('0x31')]:_0x4efb97[_0x9a1c('0x2d')];if(_0x3606cf[_0x9a1c('0x2f')][_0x9a1c('0x42')]){_0x3634e6[_0x9a1c('0x43')]=[{'all':!![]}];}_0x3634e6=_[_0x9a1c('0x44')]({},_0x3634e6,_0x3606cf['options']);return db[_0x9a1c('0x3b')][_0x9a1c('0x45')](_0x3634e6)[_0x9a1c('0x24')](handleEntityNotFound(_0x3ec2de,null))['then'](respondWithResult(_0x3ec2de,null))[_0x9a1c('0x3e')](handleError(_0x3ec2de,null));};exports[_0x9a1c('0x46')]=function(_0x471e9c,_0xf0cef5){return db[_0x9a1c('0x3b')][_0x9a1c('0x46')](_0x471e9c['body'],{})[_0x9a1c('0x24')](respondWithResult(_0xf0cef5,0xc9))['catch'](handleError(_0xf0cef5,null));};exports[_0x9a1c('0x23')]=function(_0x396945,_0x502a8b){if(_0x396945[_0x9a1c('0x47')]['id']){delete _0x396945[_0x9a1c('0x47')]['id'];}return db['SquareMessage'][_0x9a1c('0x45')]({'where':{'id':_0x396945['params']['id']}})[_0x9a1c('0x24')](handleEntityNotFound(_0x502a8b,null))['then'](saveUpdates(_0x396945[_0x9a1c('0x47')],null))[_0x9a1c('0x24')](respondWithResult(_0x502a8b,null))[_0x9a1c('0x3e')](handleError(_0x502a8b,null));};exports[_0x9a1c('0x25')]=function(_0x11ba5b,_0x5ccc32){return db[_0x9a1c('0x3b')][_0x9a1c('0x45')]({'where':{'id':_0x11ba5b[_0x9a1c('0x48')]['id']}})[_0x9a1c('0x24')](handleEntityNotFound(_0x5ccc32,null))[_0x9a1c('0x24')](removeEntity(_0x5ccc32,null))[_0x9a1c('0x3e')](handleError(_0x5ccc32,null));};
\ No newline at end of file
index 37329fb..0a28cc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9e1=['path','rimraf','define','SquareMessage','lodash','../../config/logger','api','moment','request-promise'];(function(_0x4a58eb,_0x5aac55){var _0x1ce75c=function(_0x3d565c){while(--_0x3d565c){_0x4a58eb['push'](_0x4a58eb['shift']());}};_0x1ce75c(++_0x5aac55);}(_0xc9e1,0x109));var _0x1c9e=function(_0x177ddc,_0x23af36){_0x177ddc=_0x177ddc-0x0;var _0x3767a7=_0xc9e1[_0x177ddc];return _0x3767a7;};'use strict';var _=require(_0x1c9e('0x0'));var util=require('util');var logger=require(_0x1c9e('0x1'))(_0x1c9e('0x2'));var moment=require(_0x1c9e('0x3'));var BPromise=require('bluebird');var rp=require(_0x1c9e('0x4'));var fs=require('fs');var path=require(_0x1c9e('0x5'));var rimraf=require(_0x1c9e('0x6'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module['exports']=function(_0x19e751,_0x3fe68a){return _0x19e751[_0x1c9e('0x7')](_0x1c9e('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d20=['bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment'];(function(_0x3e54b0,_0x4432a8){var _0x1534c4=function(_0x2f660a){while(--_0x2f660a){_0x3e54b0['push'](_0x3e54b0['shift']());}};_0x1534c4(++_0x4432a8);}(_0x4d20,0x183));var _0x04d2=function(_0x3c7344,_0x1894a9){_0x3c7344=_0x3c7344-0x0;var _0x2d15ed=_0x4d20[_0x3c7344];return _0x2d15ed;};'use strict';var _=require(_0x04d2('0x0'));var util=require(_0x04d2('0x1'));var logger=require(_0x04d2('0x2'))(_0x04d2('0x3'));var moment=require(_0x04d2('0x4'));var BPromise=require(_0x04d2('0x5'));var rp=require(_0x04d2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x04d2('0x7'));var config=require(_0x04d2('0x8'));var attributes=require(_0x04d2('0x9'));module[_0x04d2('0xa')]=function(_0x44f52e,_0x3ced4d){return _0x44f52e[_0x04d2('0xb')](_0x04d2('0xc'),attributes,{'tableName':_0x04d2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 16bf4c6..bb86083 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcacb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','stringify','lodash','util'];(function(_0x2814a0,_0x3c6ba6){var _0x19aca1=function(_0x12acd8){while(--_0x12acd8){_0x2814a0['push'](_0x2814a0['shift']());}};_0x19aca1(++_0x3c6ba6);}(_0xcacb,0x8f));var _0xbcac=function(_0x55daf2,_0x1b48de){_0x55daf2=_0x55daf2-0x0;var _0x1c8500=_0xcacb[_0x55daf2];return _0x1c8500;};'use strict';var _=require(_0xbcac('0x0'));var util=require(_0xbcac('0x1'));var moment=require(_0xbcac('0x2'));var BPromise=require(_0xbcac('0x3'));var rs=require(_0xbcac('0x4'));var fs=require('fs');var Redis=require(_0xbcac('0x5'));var db=require(_0xbcac('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcac('0x7'))(_0xbcac('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbcac('0x9')][_0xbcac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2061b1,_0xfeb9bc,_0x3c375d){return new BPromise(function(_0x5c677f,_0x2a4944){return client[_0xbcac('0xb')](_0x2061b1,_0x3c375d)[_0xbcac('0xc')](function(_0x3b525f){logger[_0xbcac('0xd')](_0xbcac('0xe'),_0xfeb9bc,_0xbcac('0xf'));logger[_0xbcac('0x10')](_0xbcac('0x11'),_0xfeb9bc,'request\x20sent',JSON['stringify'](_0x3b525f));if(_0x3b525f[_0xbcac('0x12')]){if(_0x3b525f['error'][_0xbcac('0x13')]===0x1f4){logger[_0xbcac('0x12')](_0xbcac('0xe'),_0xfeb9bc,_0x3b525f[_0xbcac('0x12')][_0xbcac('0x14')]);return _0x2a4944(_0x3b525f[_0xbcac('0x12')][_0xbcac('0x14')]);}logger[_0xbcac('0x12')](_0xbcac('0xe'),_0xfeb9bc,_0x3b525f['error'][_0xbcac('0x14')]);return _0x5c677f(_0x3b525f['error'][_0xbcac('0x14')]);}else{logger[_0xbcac('0xd')](_0xbcac('0xe'),_0xfeb9bc,_0xbcac('0xf'));_0x5c677f(_0x3b525f['result']['message']);}})[_0xbcac('0x15')](function(_0xa2b6b){logger[_0xbcac('0x12')]('SquareMessage,\x20%s,\x20%s',_0xfeb9bc,_0xa2b6b);_0x2a4944(_0xa2b6b);});});}exports[_0xbcac('0x16')]=function(_0x2e27f2){var _0x53500a=this;return new Promise(function(_0x2d2c86,_0x357ead){return db[_0xbcac('0x17')][_0xbcac('0x18')](_0x2e27f2[_0xbcac('0x19')],{'raw':_0x2e27f2[_0xbcac('0x1a')]?_0x2e27f2[_0xbcac('0x1a')][_0xbcac('0x1b')]===undefined?!![]:![]:!![]})[_0xbcac('0xc')](function(_0x377c9a){logger[_0xbcac('0xd')](_0xbcac('0x16'),_0x2e27f2);logger[_0xbcac('0x10')]('CreateSquareMessage',_0x2e27f2,JSON[_0xbcac('0x1c')](_0x377c9a));_0x2d2c86(_0x377c9a);})[_0xbcac('0x15')](function(_0x5749ee){logger[_0xbcac('0x12')]('CreateSquareMessage',_0x5749ee['message'],_0x2e27f2);_0x357ead(_0x53500a[_0xbcac('0x12')](0x1f4,_0x5749ee[_0xbcac('0x14')]));});});};
\ No newline at end of file
+var _0x0654=['stringify','error','code','message','info','catch','CreateSquareMessage','SquareMessage','create','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0x0654,0x1aa));var _0x4065=function(_0x2a0edd,_0x599c55){_0x2a0edd=_0x2a0edd-0x0;var _0x2325ac=_0x0654[_0x2a0edd];return _0x2325ac;};'use strict';var _=require(_0x4065('0x0'));var util=require(_0x4065('0x1'));var moment=require(_0x4065('0x2'));var BPromise=require(_0x4065('0x3'));var rs=require(_0x4065('0x4'));var fs=require('fs');var Redis=require(_0x4065('0x5'));var db=require(_0x4065('0x6'))['db'];var utils=require(_0x4065('0x7'));var logger=require(_0x4065('0x8'))('rpc');var config=require(_0x4065('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c5beb,_0x5e54ad,_0x5770e9){return new BPromise(function(_0x4632e8,_0x38db2b){return client[_0x4065('0xa')](_0x4c5beb,_0x5770e9)[_0x4065('0xb')](function(_0x4e252c){logger['info'](_0x4065('0xc'),_0x5e54ad,_0x4065('0xd'));logger[_0x4065('0xe')](_0x4065('0xf'),_0x5e54ad,_0x4065('0xd'),JSON[_0x4065('0x10')](_0x4e252c));if(_0x4e252c[_0x4065('0x11')]){if(_0x4e252c[_0x4065('0x11')][_0x4065('0x12')]===0x1f4){logger[_0x4065('0x11')](_0x4065('0xc'),_0x5e54ad,_0x4e252c[_0x4065('0x11')][_0x4065('0x13')]);return _0x38db2b(_0x4e252c[_0x4065('0x11')]['message']);}logger[_0x4065('0x11')](_0x4065('0xc'),_0x5e54ad,_0x4e252c['error'][_0x4065('0x13')]);return _0x4632e8(_0x4e252c['error'][_0x4065('0x13')]);}else{logger[_0x4065('0x14')](_0x4065('0xc'),_0x5e54ad,_0x4065('0xd'));_0x4632e8(_0x4e252c['result'][_0x4065('0x13')]);}})[_0x4065('0x15')](function(_0x4ff81b){logger['error']('SquareMessage,\x20%s,\x20%s',_0x5e54ad,_0x4ff81b);_0x38db2b(_0x4ff81b);});});}exports[_0x4065('0x16')]=function(_0x54e852){var _0x27cca3=this;return new Promise(function(_0x5f4c75,_0x3c091d){return db[_0x4065('0x17')][_0x4065('0x18')](_0x54e852['body'],{'raw':_0x54e852[_0x4065('0x19')]?_0x54e852[_0x4065('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x4065('0xb')](function(_0x2a6d57){logger[_0x4065('0x14')](_0x4065('0x16'),_0x54e852);logger['debug'](_0x4065('0x16'),_0x54e852,JSON[_0x4065('0x10')](_0x2a6d57));_0x5f4c75(_0x2a6d57);})[_0x4065('0x15')](function(_0xbd1eef){logger[_0x4065('0x11')](_0x4065('0x16'),_0xbd1eef[_0x4065('0x13')],_0x54e852);_0x3c091d(_0x27cca3[_0x4065('0x11')](0x1f4,_0xbd1eef['message']));});});};
\ No newline at end of file
index aa75073..86966bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7ef=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareOdbc.controller','get','index','isAuthenticated','show','/:id/test','15s','test','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x77b5d5,_0x336eca){var _0x41493f=function(_0x25990c){while(--_0x25990c){_0x77b5d5['push'](_0x77b5d5['shift']());}};_0x41493f(++_0x336eca);}(_0xb7ef,0x111));var _0xfb7e=function(_0x4bb1b3,_0x446a44){_0x4bb1b3=_0x4bb1b3-0x0;var _0x6b3651=_0xb7ef[_0x4bb1b3];return _0x6b3651;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfb7e('0x0'));var express=require(_0xfb7e('0x1'));var router=express[_0xfb7e('0x2')]();var fs_extra=require(_0xfb7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfb7e('0x4'));var config=require('../../config/environment');var controller=require(_0xfb7e('0x5'));router[_0xfb7e('0x6')]('/',auth['isAuthenticated'](),controller[_0xfb7e('0x7')]);router[_0xfb7e('0x6')]('/:id',auth[_0xfb7e('0x8')](),controller[_0xfb7e('0x9')]);router[_0xfb7e('0x6')](_0xfb7e('0xa'),auth[_0xfb7e('0x8')](),timeout(_0xfb7e('0xb')),controller[_0xfb7e('0xc')]);router[_0xfb7e('0xd')]('/',auth['isAuthenticated'](),controller[_0xfb7e('0xe')]);router[_0xfb7e('0xf')]('/:id',auth[_0xfb7e('0x8')](),controller[_0xfb7e('0x10')]);router[_0xfb7e('0x11')](_0xfb7e('0x12'),auth[_0xfb7e('0x8')](),controller[_0xfb7e('0x13')]);module[_0xfb7e('0x14')]=router;
\ No newline at end of file
+var _0x0408=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','get','/:id','show','/:id/test','15s','test','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0408,0x1dd));var _0x8040=function(_0x7d93fe,_0x17dbed){_0x7d93fe=_0x7d93fe-0x0;var _0x165cba=_0x0408[_0x7d93fe];return _0x165cba;};'use strict';var multer=require(_0x8040('0x0'));var util=require(_0x8040('0x1'));var path=require(_0x8040('0x2'));var timeout=require(_0x8040('0x3'));var express=require(_0x8040('0x4'));var router=express[_0x8040('0x5')]();var fs_extra=require(_0x8040('0x6'));var auth=require(_0x8040('0x7'));var interaction=require(_0x8040('0x8'));var config=require(_0x8040('0x9'));var controller=require(_0x8040('0xa'));router['get']('/',auth[_0x8040('0xb')](),controller['index']);router[_0x8040('0xc')](_0x8040('0xd'),auth['isAuthenticated'](),controller[_0x8040('0xe')]);router[_0x8040('0xc')](_0x8040('0xf'),auth[_0x8040('0xb')](),timeout(_0x8040('0x10')),controller[_0x8040('0x11')]);router[_0x8040('0x12')]('/',auth[_0x8040('0xb')](),controller[_0x8040('0x13')]);router[_0x8040('0x14')](_0x8040('0xd'),auth[_0x8040('0xb')](),controller['update']);router[_0x8040('0x15')](_0x8040('0xd'),auth[_0x8040('0xb')](),controller[_0x8040('0x16')]);module[_0x8040('0x17')]=router;
\ No newline at end of file
index 50a5094..e705062 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd586=['STRING','name','exports'];(function(_0x913b85,_0x213182){var _0x1ce434=function(_0x4c9c8b){while(--_0x4c9c8b){_0x913b85['push'](_0x913b85['shift']());}};_0x1ce434(++_0x213182);}(_0xd586,0x65));var _0x6d58=function(_0x4879e7,_0x5b0bc4){_0x4879e7=_0x4879e7-0x0;var _0x4155cc=_0xd586[_0x4879e7];return _0x4155cc;};'use strict';var Sequelize=require('sequelize');module[_0x6d58('0x0')]={'name':{'type':Sequelize[_0x6d58('0x1')],'unique':_0x6d58('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xcb69=['sequelize','exports','STRING','name'];(function(_0x9e5cfb,_0x5e1a0f){var _0x5a3140=function(_0x287290){while(--_0x287290){_0x9e5cfb['push'](_0x9e5cfb['shift']());}};_0x5a3140(++_0x5e1a0f);}(_0xcb69,0x1a0));var _0x9cb6=function(_0x2fbeb5,_0x5417e8){_0x2fbeb5=_0x2fbeb5-0x0;var _0x56254f=_0xcb69[_0x2fbeb5];return _0x56254f;};'use strict';var Sequelize=require(_0x9cb6('0x0'));module[_0x9cb6('0x1')]={'name':{'type':Sequelize[_0x9cb6('0x2')],'unique':_0x9cb6('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9cb6('0x2')]}};
\ No newline at end of file
index bd4261f..c80384c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8498=['map','SquareOdbc','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','merge','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ODBC','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send'];(function(_0xdad6d6,_0x2d2fde){var _0x57f076=function(_0x1d3d22){while(--_0x1d3d22){_0xdad6d6['push'](_0xdad6d6['shift']());}};_0x57f076(++_0x2d2fde);}(_0x8498,0x131));var _0x8849=function(_0x343c7c,_0x2fb412){_0x343c7c=_0x343c7c-0x0;var _0x16cadb=_0x8498[_0x343c7c];return _0x16cadb;};'use strict';var emlformat=require(_0x8849('0x0'));var rimraf=require(_0x8849('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8849('0x2'));var rp=require(_0x8849('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8849('0x4'));var util=require('util');var path=require(_0x8849('0x5'));var sox=require(_0x8849('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8849('0x7'));var _=require(_0x8849('0x8'));var squel=require(_0x8849('0x9'));var crypto=require(_0x8849('0xa'));var jsforce=require(_0x8849('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8849('0xc'));var querystring=require(_0x8849('0xd'));var Papa=require(_0x8849('0xe'));var Redis=require(_0x8849('0xf'));var authService=require(_0x8849('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8849('0x11'));var hardwareService=require(_0x8849('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x8849('0x13'));var config=require(_0x8849('0x14'));var licenseUtil=require(_0x8849('0x15'));var db=require(_0x8849('0x16'))['db'];function respondWithStatusCode(_0xd7b452,_0x599005){_0x599005=_0x599005||0xcc;return function(_0x3b5d3e){if(_0x3b5d3e){return _0xd7b452[_0x8849('0x17')](_0x599005);}return _0xd7b452[_0x8849('0x18')](_0x599005)[_0x8849('0x19')]();};}function respondWithResult(_0x2b3db4,_0x4ee6ba){_0x4ee6ba=_0x4ee6ba||0xc8;return function(_0x2aaf0f){if(_0x2aaf0f){return _0x2b3db4[_0x8849('0x18')](_0x4ee6ba)[_0x8849('0x1a')](_0x2aaf0f);}};}function respondWithFilteredResult(_0x155de8,_0x4f7e2d){return function(_0x467afa){if(_0x467afa){var _0x54533b=typeof _0x4f7e2d[_0x8849('0x1b')]==='undefined'&&typeof _0x4f7e2d['limit']===_0x8849('0x1c');var _0x520a47=_0x467afa[_0x8849('0x1d')];var _0x1b0957=_0x54533b?0x0:_0x4f7e2d['offset'];var _0x5a5ba1=_0x54533b?_0x467afa[_0x8849('0x1d')]:_0x4f7e2d[_0x8849('0x1b')]+_0x4f7e2d['limit'];var _0x47ca6e;if(_0x5a5ba1>=_0x520a47){_0x5a5ba1=_0x520a47;_0x47ca6e=0xc8;}else{_0x47ca6e=0xce;}_0x155de8[_0x8849('0x18')](_0x47ca6e);return _0x155de8[_0x8849('0x1e')](_0x8849('0x1f'),_0x1b0957+'-'+_0x5a5ba1+'/'+_0x520a47)[_0x8849('0x1a')](_0x467afa);}return null;};}function patchUpdates(_0x259e5d){return function(_0x4b1bae){try{jsonpatch[_0x8849('0x20')](_0x4b1bae,_0x259e5d,!![]);}catch(_0x3f67f3){return BPromise['reject'](_0x3f67f3);}return _0x4b1bae[_0x8849('0x21')]();};}function saveUpdates(_0x1d6c9c,_0x407672){return function(_0x7bc97f){if(_0x7bc97f){return _0x7bc97f[_0x8849('0x22')](_0x1d6c9c)[_0x8849('0x23')](function(_0x11cba2){return _0x11cba2;});}return null;};}function removeEntity(_0x52812a,_0x9eb5c9){return function(_0x2404c9){if(_0x2404c9){return _0x2404c9[_0x8849('0x24')]()['then'](function(){var _0x8d9aae=_0x2404c9[_0x8849('0x25')]({'plain':!![]});var _0x2365f8='ODBC';return db[_0x8849('0x26')][_0x8849('0x24')]({'where':{'type':_0x2365f8,'resourceId':_0x8d9aae['id']}})[_0x8849('0x23')](function(){return _0x2404c9;});})['then'](function(){_0x52812a[_0x8849('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa1e52,_0x478df9){return function(_0x2d62a4){if(!_0x2d62a4){_0xaa1e52[_0x8849('0x17')](0x194);}return _0x2d62a4;};}function handleError(_0x5a07fc,_0x327130){_0x327130=_0x327130||0x1f4;return function(_0x52736e){logger[_0x8849('0x27')](_0x52736e[_0x8849('0x28')]);if(_0x52736e['name']){delete _0x52736e[_0x8849('0x29')];}_0x5a07fc[_0x8849('0x18')](_0x327130)[_0x8849('0x2a')](_0x52736e);};}exports['index']=function(_0x27c2b6,_0x59152e){var _0x363878={},_0xe5ada3={},_0x26460b={'count':0x0,'rows':[]};var _0x2c69e9=_[_0x8849('0x2b')](db[_0x8849('0x2c')][_0x8849('0x2d')],function(_0x5a66a1){return{'name':_0x5a66a1[_0x8849('0x2e')],'type':_0x5a66a1[_0x8849('0x2f')]['key']};});_0xe5ada3[_0x8849('0x30')]=_[_0x8849('0x2b')](_0x2c69e9,'name');_0xe5ada3[_0x8849('0x31')]=_[_0x8849('0x32')](_0x27c2b6[_0x8849('0x31')]);_0xe5ada3[_0x8849('0x33')]=_[_0x8849('0x34')](_0xe5ada3['model'],_0xe5ada3['query']);_0x363878[_0x8849('0x35')]=_[_0x8849('0x34')](_0xe5ada3[_0x8849('0x30')],qs[_0x8849('0x36')](_0x27c2b6[_0x8849('0x31')][_0x8849('0x36')]));_0x363878[_0x8849('0x35')]=_0x363878[_0x8849('0x35')][_0x8849('0x37')]?_0x363878[_0x8849('0x35')]:_0xe5ada3['model'];if(!_0x27c2b6[_0x8849('0x31')]['hasOwnProperty'](_0x8849('0x38'))){_0x363878[_0x8849('0x39')]=qs[_0x8849('0x39')](_0x27c2b6[_0x8849('0x31')][_0x8849('0x39')]);_0x363878[_0x8849('0x1b')]=qs[_0x8849('0x1b')](_0x27c2b6[_0x8849('0x31')][_0x8849('0x1b')]);}_0x363878[_0x8849('0x3a')]=qs[_0x8849('0x3b')](_0x27c2b6['query'][_0x8849('0x3b')]);_0x363878[_0x8849('0x3c')]=qs['filters'](_[_0x8849('0x3d')](_0x27c2b6[_0x8849('0x31')],_0xe5ada3['filters']),_0x2c69e9);if(_0x27c2b6[_0x8849('0x31')][_0x8849('0x3e')]){_0x363878[_0x8849('0x3c')]=_['merge'](_0x363878[_0x8849('0x3c')],{'$or':_[_0x8849('0x2b')](_0x2c69e9,function(_0x482ef5){if(_0x482ef5[_0x8849('0x2f')]!==_0x8849('0x3f')){var _0x1f5f6b={};_0x1f5f6b[_0x482ef5[_0x8849('0x29')]]={'$like':'%'+_0x27c2b6[_0x8849('0x31')][_0x8849('0x3e')]+'%'};return _0x1f5f6b;}})});}_0x363878=_['merge']({},_0x363878,_0x27c2b6[_0x8849('0x40')]);var _0x11944f={'where':_0x363878[_0x8849('0x3c')]};return db['SquareOdbc'][_0x8849('0x1d')](_0x11944f)[_0x8849('0x23')](function(_0x25f693){_0x26460b[_0x8849('0x1d')]=_0x25f693;if(_0x27c2b6[_0x8849('0x31')]['includeAll']){_0x363878[_0x8849('0x41')]=[{'all':!![]}];}return db[_0x8849('0x2c')][_0x8849('0x42')](_0x363878);})[_0x8849('0x23')](function(_0x162528){_0x26460b[_0x8849('0x43')]=_0x162528;return _0x26460b;})[_0x8849('0x23')](respondWithFilteredResult(_0x59152e,_0x363878))[_0x8849('0x44')](handleError(_0x59152e,null));};exports[_0x8849('0x45')]=function(_0x28d0e8,_0x150bb8){var _0x425da0={'raw':!![],'where':{'id':_0x28d0e8[_0x8849('0x46')]['id']}},_0x1b9c25={};_0x1b9c25[_0x8849('0x30')]=_[_0x8849('0x32')](db[_0x8849('0x2c')][_0x8849('0x2d')]);_0x1b9c25[_0x8849('0x31')]=_[_0x8849('0x32')](_0x28d0e8['query']);_0x1b9c25[_0x8849('0x33')]=_[_0x8849('0x34')](_0x1b9c25[_0x8849('0x30')],_0x1b9c25['query']);_0x425da0[_0x8849('0x35')]=_[_0x8849('0x34')](_0x1b9c25['model'],qs[_0x8849('0x36')](_0x28d0e8[_0x8849('0x31')][_0x8849('0x36')]));_0x425da0[_0x8849('0x35')]=_0x425da0[_0x8849('0x35')][_0x8849('0x37')]?_0x425da0[_0x8849('0x35')]:_0x1b9c25['model'];if(_0x28d0e8[_0x8849('0x31')][_0x8849('0x47')]){_0x425da0[_0x8849('0x41')]=[{'all':!![]}];}_0x425da0=_[_0x8849('0x48')]({},_0x425da0,_0x28d0e8['options']);return db[_0x8849('0x2c')]['find'](_0x425da0)['then'](handleEntityNotFound(_0x150bb8,null))['then'](respondWithResult(_0x150bb8,null))[_0x8849('0x44')](handleError(_0x150bb8,null));};exports[_0x8849('0x49')]=function(_0x31913a,_0x307ec8){return db[_0x8849('0x2c')][_0x8849('0x49')](_0x31913a[_0x8849('0x4a')],{})['then'](function(_0xc668f){var _0x546b79=_0x31913a['user'][_0x8849('0x25')]({'plain':!![]});if(!_0x546b79)throw new Error(_0x8849('0x4b'));if(_0x546b79['role']===_0x8849('0x4c')){var _0x2c2016=_0xc668f[_0x8849('0x25')]({'plain':!![]});var _0x49708e=_0x8849('0x4d');return db[_0x8849('0x4e')][_0x8849('0x4f')]({'where':{'name':_0x49708e,'userProfileId':_0x546b79['userProfileId']},'raw':!![]})['then'](function(_0x29eae8){if(_0x29eae8&&_0x29eae8[_0x8849('0x50')]===0x0){return db[_0x8849('0x26')][_0x8849('0x49')]({'name':_0x2c2016[_0x8849('0x29')],'resourceId':_0x2c2016['id'],'type':_0x29eae8[_0x8849('0x29')],'sectionId':_0x29eae8['id']},{})['then'](function(){return _0xc668f;});}else{return _0xc668f;}})[_0x8849('0x44')](function(_0x3bde61){logger[_0x8849('0x27')](_0x8849('0x51'),_0x3bde61);throw _0x3bde61;});}return _0xc668f;})[_0x8849('0x23')](respondWithResult(_0x307ec8,0xc9))[_0x8849('0x44')](handleError(_0x307ec8,null));};exports['update']=function(_0x572c8b,_0x1bad4d){if(_0x572c8b[_0x8849('0x4a')]['id']){delete _0x572c8b[_0x8849('0x4a')]['id'];}return db[_0x8849('0x2c')][_0x8849('0x4f')]({'where':{'id':_0x572c8b[_0x8849('0x46')]['id']}})['then'](handleEntityNotFound(_0x1bad4d,null))[_0x8849('0x23')](saveUpdates(_0x572c8b[_0x8849('0x4a')],null))[_0x8849('0x23')](respondWithResult(_0x1bad4d,null))[_0x8849('0x44')](handleError(_0x1bad4d,null));};exports[_0x8849('0x24')]=function(_0xa30ebd,_0x4c476a){return db[_0x8849('0x2c')][_0x8849('0x4f')]({'where':{'id':_0xa30ebd[_0x8849('0x46')]['id']}})[_0x8849('0x23')](handleEntityNotFound(_0x4c476a,null))['then'](removeEntity(_0x4c476a,null))[_0x8849('0x44')](handleError(_0x4c476a,null));};exports[_0x8849('0x52')]=function(_0x40a566,_0x3e3440,_0x373bd9){var _0x4c8925;return db[_0x8849('0x2c')][_0x8849('0x4f')]({'where':{'id':_0x40a566[_0x8849('0x46')]['id']},'attributes':['id',_0x8849('0x53')]})[_0x8849('0x23')](handleEntityNotFound(_0x3e3440,null))['then'](function(_0x1a1277){if(_0x1a1277){var _0x1980e1=require(_0x8849('0x54'))();_0x1980e1[_0x8849('0x55')](_0x1a1277[_0x8849('0x53')]);_0x1980e1[_0x8849('0x56')]();return _0x1a1277;}})[_0x8849('0x23')](respondWithResult(_0x3e3440,null))[_0x8849('0x44')](handleError(_0x3e3440,null));};
\ No newline at end of file
+var _0x1561=['mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','get','ODBC','stack','name','send','index','SquareOdbc','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','openSync','dsn','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x1561,0x15e));var _0x1156=function(_0x503fdc,_0xf4871){_0x503fdc=_0x503fdc-0x0;var _0xfc3cd7=_0x1561[_0x503fdc];return _0xfc3cd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1156('0x0'));var zipdir=require(_0x1156('0x1'));var jsonpatch=require(_0x1156('0x2'));var rp=require(_0x1156('0x3'));var moment=require(_0x1156('0x4'));var BPromise=require(_0x1156('0x5'));var Mustache=require(_0x1156('0x6'));var util=require('util');var path=require(_0x1156('0x7'));var sox=require(_0x1156('0x8'));var csv=require('to-csv');var ejs=require(_0x1156('0x9'));var fs=require('fs');var fs_extra=require(_0x1156('0xa'));var _=require(_0x1156('0xb'));var squel=require(_0x1156('0xc'));var crypto=require(_0x1156('0xd'));var jsforce=require(_0x1156('0xe'));var deskjs=require(_0x1156('0xf'));var toCsv=require(_0x1156('0x10'));var querystring=require(_0x1156('0x11'));var Papa=require('papaparse');var Redis=require(_0x1156('0x12'));var authService=require(_0x1156('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1156('0x14'));var hardwareService=require(_0x1156('0x15'));var logger=require(_0x1156('0x16'))(_0x1156('0x17'));var utils=require(_0x1156('0x18'));var config=require(_0x1156('0x19'));var licenseUtil=require(_0x1156('0x1a'));var db=require(_0x1156('0x1b'))['db'];function respondWithStatusCode(_0x10e6f8,_0x418a31){_0x418a31=_0x418a31||0xcc;return function(_0x422258){if(_0x422258){return _0x10e6f8[_0x1156('0x1c')](_0x418a31);}return _0x10e6f8['status'](_0x418a31)[_0x1156('0x1d')]();};}function respondWithResult(_0x24865f,_0x33d6f3){_0x33d6f3=_0x33d6f3||0xc8;return function(_0x66b484){if(_0x66b484){return _0x24865f[_0x1156('0x1e')](_0x33d6f3)['json'](_0x66b484);}};}function respondWithFilteredResult(_0x31c362,_0x1e344e){return function(_0x5a5c35){if(_0x5a5c35){var _0x15b141=typeof _0x1e344e['offset']===_0x1156('0x1f')&&typeof _0x1e344e[_0x1156('0x20')]===_0x1156('0x1f');var _0x2613c4=_0x5a5c35[_0x1156('0x21')];var _0x5753fb=_0x15b141?0x0:_0x1e344e[_0x1156('0x22')];var _0x317b4d=_0x15b141?_0x5a5c35[_0x1156('0x21')]:_0x1e344e[_0x1156('0x22')]+_0x1e344e[_0x1156('0x20')];var _0x5b836c;if(_0x317b4d>=_0x2613c4){_0x317b4d=_0x2613c4;_0x5b836c=0xc8;}else{_0x5b836c=0xce;}_0x31c362[_0x1156('0x1e')](_0x5b836c);return _0x31c362[_0x1156('0x23')](_0x1156('0x24'),_0x5753fb+'-'+_0x317b4d+'/'+_0x2613c4)['json'](_0x5a5c35);}return null;};}function patchUpdates(_0x49f81e){return function(_0x44a647){try{jsonpatch[_0x1156('0x25')](_0x44a647,_0x49f81e,!![]);}catch(_0x204c4d){return BPromise['reject'](_0x204c4d);}return _0x44a647[_0x1156('0x26')]();};}function saveUpdates(_0x51b741,_0x30b24f){return function(_0x55b84d){if(_0x55b84d){return _0x55b84d['update'](_0x51b741)[_0x1156('0x27')](function(_0x174842){return _0x174842;});}return null;};}function removeEntity(_0x3dbb0a,_0x15fbbb){return function(_0x23159b){if(_0x23159b){return _0x23159b[_0x1156('0x28')]()[_0x1156('0x27')](function(){var _0xce1c9c=_0x23159b[_0x1156('0x29')]({'plain':!![]});var _0x36ff54=_0x1156('0x2a');return db['UserProfileResource'][_0x1156('0x28')]({'where':{'type':_0x36ff54,'resourceId':_0xce1c9c['id']}})[_0x1156('0x27')](function(){return _0x23159b;});})[_0x1156('0x27')](function(){_0x3dbb0a[_0x1156('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2832da,_0x6e1a2f){return function(_0x19a298){if(!_0x19a298){_0x2832da['sendStatus'](0x194);}return _0x19a298;};}function handleError(_0x922ae5,_0x1ea25b){_0x1ea25b=_0x1ea25b||0x1f4;return function(_0x3d8ba2){logger['error'](_0x3d8ba2[_0x1156('0x2b')]);if(_0x3d8ba2[_0x1156('0x2c')]){delete _0x3d8ba2[_0x1156('0x2c')];}_0x922ae5['status'](_0x1ea25b)[_0x1156('0x2d')](_0x3d8ba2);};}exports[_0x1156('0x2e')]=function(_0x4e2cf8,_0x3b1811){var _0x21ce21={},_0x454c6e={},_0x4d4e27={'count':0x0,'rows':[]};var _0x44e96a=_['map'](db[_0x1156('0x2f')][_0x1156('0x30')],function(_0x26abd4){return{'name':_0x26abd4[_0x1156('0x31')],'type':_0x26abd4[_0x1156('0x32')]['key']};});_0x454c6e['model']=_[_0x1156('0x33')](_0x44e96a,'name');_0x454c6e[_0x1156('0x34')]=_[_0x1156('0x35')](_0x4e2cf8[_0x1156('0x34')]);_0x454c6e[_0x1156('0x36')]=_[_0x1156('0x37')](_0x454c6e[_0x1156('0x38')],_0x454c6e['query']);_0x21ce21[_0x1156('0x39')]=_['intersection'](_0x454c6e[_0x1156('0x38')],qs[_0x1156('0x3a')](_0x4e2cf8['query'][_0x1156('0x3a')]));_0x21ce21[_0x1156('0x39')]=_0x21ce21[_0x1156('0x39')]['length']?_0x21ce21[_0x1156('0x39')]:_0x454c6e['model'];if(!_0x4e2cf8[_0x1156('0x34')][_0x1156('0x3b')](_0x1156('0x3c'))){_0x21ce21['limit']=qs['limit'](_0x4e2cf8['query']['limit']);_0x21ce21[_0x1156('0x22')]=qs[_0x1156('0x22')](_0x4e2cf8['query']['offset']);}_0x21ce21['order']=qs[_0x1156('0x3d')](_0x4e2cf8[_0x1156('0x34')][_0x1156('0x3d')]);_0x21ce21['where']=qs['filters'](_[_0x1156('0x3e')](_0x4e2cf8[_0x1156('0x34')],_0x454c6e['filters']),_0x44e96a);if(_0x4e2cf8[_0x1156('0x34')]['filter']){_0x21ce21['where']=_['merge'](_0x21ce21[_0x1156('0x3f')],{'$or':_[_0x1156('0x33')](_0x44e96a,function(_0x5069da){if(_0x5069da[_0x1156('0x32')]!==_0x1156('0x40')){var _0xbb005c={};_0xbb005c[_0x5069da['name']]={'$like':'%'+_0x4e2cf8[_0x1156('0x34')][_0x1156('0x41')]+'%'};return _0xbb005c;}})});}_0x21ce21=_['merge']({},_0x21ce21,_0x4e2cf8[_0x1156('0x42')]);var _0xc23f75={'where':_0x21ce21[_0x1156('0x3f')]};return db['SquareOdbc'][_0x1156('0x21')](_0xc23f75)[_0x1156('0x27')](function(_0x2e8d80){_0x4d4e27[_0x1156('0x21')]=_0x2e8d80;if(_0x4e2cf8[_0x1156('0x34')][_0x1156('0x43')]){_0x21ce21['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x1156('0x44')](_0x21ce21);})['then'](function(_0x7059ff){_0x4d4e27['rows']=_0x7059ff;return _0x4d4e27;})[_0x1156('0x27')](respondWithFilteredResult(_0x3b1811,_0x21ce21))[_0x1156('0x45')](handleError(_0x3b1811,null));};exports[_0x1156('0x46')]=function(_0x39f612,_0x48aedb){var _0x239ebd={'raw':!![],'where':{'id':_0x39f612[_0x1156('0x47')]['id']}},_0x347b17={};_0x347b17['model']=_[_0x1156('0x35')](db[_0x1156('0x2f')][_0x1156('0x30')]);_0x347b17[_0x1156('0x34')]=_[_0x1156('0x35')](_0x39f612[_0x1156('0x34')]);_0x347b17['filters']=_[_0x1156('0x37')](_0x347b17[_0x1156('0x38')],_0x347b17[_0x1156('0x34')]);_0x239ebd[_0x1156('0x39')]=_[_0x1156('0x37')](_0x347b17[_0x1156('0x38')],qs[_0x1156('0x3a')](_0x39f612[_0x1156('0x34')][_0x1156('0x3a')]));_0x239ebd[_0x1156('0x39')]=_0x239ebd[_0x1156('0x39')][_0x1156('0x48')]?_0x239ebd[_0x1156('0x39')]:_0x347b17[_0x1156('0x38')];if(_0x39f612[_0x1156('0x34')][_0x1156('0x43')]){_0x239ebd[_0x1156('0x49')]=[{'all':!![]}];}_0x239ebd=_['merge']({},_0x239ebd,_0x39f612[_0x1156('0x42')]);return db[_0x1156('0x2f')][_0x1156('0x4a')](_0x239ebd)[_0x1156('0x27')](handleEntityNotFound(_0x48aedb,null))[_0x1156('0x27')](respondWithResult(_0x48aedb,null))['catch'](handleError(_0x48aedb,null));};exports[_0x1156('0x4b')]=function(_0x3f0514,_0x2cdd74){return db[_0x1156('0x2f')][_0x1156('0x4b')](_0x3f0514[_0x1156('0x4c')],{})[_0x1156('0x27')](function(_0x2fd7bd){var _0x16d0ac=_0x3f0514[_0x1156('0x4d')]['get']({'plain':!![]});if(!_0x16d0ac)throw new Error(_0x1156('0x4e'));if(_0x16d0ac[_0x1156('0x4f')]==='user'){var _0x5b441b=_0x2fd7bd['get']({'plain':!![]});var _0xbee72e=_0x1156('0x2a');return db[_0x1156('0x50')][_0x1156('0x4a')]({'where':{'name':_0xbee72e,'userProfileId':_0x16d0ac['userProfileId']},'raw':!![]})[_0x1156('0x27')](function(_0x465799){if(_0x465799&&_0x465799[_0x1156('0x51')]===0x0){return db[_0x1156('0x52')]['create']({'name':_0x5b441b[_0x1156('0x2c')],'resourceId':_0x5b441b['id'],'type':_0x465799[_0x1156('0x2c')],'sectionId':_0x465799['id']},{})[_0x1156('0x27')](function(){return _0x2fd7bd;});}else{return _0x2fd7bd;}})[_0x1156('0x45')](function(_0x3b9f80){logger[_0x1156('0x53')](_0x1156('0x54'),_0x3b9f80);throw _0x3b9f80;});}return _0x2fd7bd;})[_0x1156('0x27')](respondWithResult(_0x2cdd74,0xc9))[_0x1156('0x45')](handleError(_0x2cdd74,null));};exports[_0x1156('0x55')]=function(_0x3b4ff5,_0xaad8cf){if(_0x3b4ff5[_0x1156('0x4c')]['id']){delete _0x3b4ff5['body']['id'];}return db[_0x1156('0x2f')][_0x1156('0x4a')]({'where':{'id':_0x3b4ff5[_0x1156('0x47')]['id']}})[_0x1156('0x27')](handleEntityNotFound(_0xaad8cf,null))[_0x1156('0x27')](saveUpdates(_0x3b4ff5[_0x1156('0x4c')],null))[_0x1156('0x27')](respondWithResult(_0xaad8cf,null))[_0x1156('0x45')](handleError(_0xaad8cf,null));};exports[_0x1156('0x28')]=function(_0x355157,_0x1ed70b){return db[_0x1156('0x2f')]['find']({'where':{'id':_0x355157[_0x1156('0x47')]['id']}})[_0x1156('0x27')](handleEntityNotFound(_0x1ed70b,null))[_0x1156('0x27')](removeEntity(_0x1ed70b,null))[_0x1156('0x45')](handleError(_0x1ed70b,null));};exports['test']=function(_0x411e83,_0xcea18c,_0x281bed){var _0xf21413;return db['SquareOdbc']['find']({'where':{'id':_0x411e83[_0x1156('0x47')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0xcea18c,null))[_0x1156('0x27')](function(_0x1a4575){if(_0x1a4575){var _0x3a3d69=require('odbc')();_0x3a3d69[_0x1156('0x56')](_0x1a4575[_0x1156('0x57')]);_0x3a3d69[_0x1156('0x58')]();return _0x1a4575;}})['then'](respondWithResult(_0xcea18c,null))[_0x1156('0x45')](handleError(_0xcea18c,null));};
\ No newline at end of file
index 1d7e73a..d8bfd38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5f6=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc','square_odbc','lodash','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe5f6,0x8e));var _0x6e5f=function(_0x217acd,_0x3ddf49){_0x217acd=_0x217acd-0x0;var _0x3850f8=_0xe5f6[_0x217acd];return _0x3850f8;};'use strict';var _=require(_0x6e5f('0x0'));var util=require(_0x6e5f('0x1'));var logger=require(_0x6e5f('0x2'))(_0x6e5f('0x3'));var moment=require('moment');var BPromise=require(_0x6e5f('0x4'));var rp=require(_0x6e5f('0x5'));var fs=require('fs');var path=require(_0x6e5f('0x6'));var rimraf=require(_0x6e5f('0x7'));var config=require(_0x6e5f('0x8'));var attributes=require(_0x6e5f('0x9'));module['exports']=function(_0x50e7a5,_0x515112){return _0x50e7a5['define'](_0x6e5f('0xa'),attributes,{'tableName':_0x6e5f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7091=['moment','bluebird','request-promise','path','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc','square_odbc','lodash','util','../../config/logger','api'];(function(_0x3b5383,_0xccef3){var _0x3fc014=function(_0x4d53af){while(--_0x4d53af){_0x3b5383['push'](_0x3b5383['shift']());}};_0x3fc014(++_0xccef3);}(_0x7091,0x141));var _0x1709=function(_0x570fdb,_0x447b67){_0x570fdb=_0x570fdb-0x0;var _0x3cd315=_0x7091[_0x570fdb];return _0x3cd315;};'use strict';var _=require(_0x1709('0x0'));var util=require(_0x1709('0x1'));var logger=require(_0x1709('0x2'))(_0x1709('0x3'));var moment=require(_0x1709('0x4'));var BPromise=require(_0x1709('0x5'));var rp=require(_0x1709('0x6'));var fs=require('fs');var path=require(_0x1709('0x7'));var rimraf=require('rimraf');var config=require(_0x1709('0x8'));var attributes=require(_0x1709('0x9'));module[_0x1709('0xa')]=function(_0xd6178b,_0x46070c){return _0xd6178b['define'](_0x1709('0xb'),attributes,{'tableName':_0x1709('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9ea8c7e..ca0da2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1053=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','SquareOdbc','find','options','raw','where','attributes','include','map','model','ShowSquareOdbc','lodash','moment','bluebird','randomstring'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x1053,0xea));var _0x3105=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0x1053[_0xca1f0e];return _0x35e4ef;};'use strict';var _=require(_0x3105('0x0'));var util=require('util');var moment=require(_0x3105('0x1'));var BPromise=require(_0x3105('0x2'));var rs=require(_0x3105('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3105('0x4'))['db'];var utils=require(_0x3105('0x5'));var logger=require(_0x3105('0x6'))(_0x3105('0x7'));var config=require(_0x3105('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3105('0x9')][_0x3105('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4796af,_0x20c643,_0x4d5f97){return new BPromise(function(_0x28c551,_0x2f76a1){return client[_0x3105('0xb')](_0x4796af,_0x4d5f97)[_0x3105('0xc')](function(_0x34658a){logger[_0x3105('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x20c643,_0x3105('0xe'));logger[_0x3105('0xf')](_0x3105('0x10'),_0x20c643,_0x3105('0xe'),JSON[_0x3105('0x11')](_0x34658a));if(_0x34658a[_0x3105('0x12')]){if(_0x34658a[_0x3105('0x12')][_0x3105('0x13')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x20c643,_0x34658a['error'][_0x3105('0x14')]);return _0x2f76a1(_0x34658a[_0x3105('0x12')][_0x3105('0x14')]);}logger[_0x3105('0x12')](_0x3105('0x15'),_0x20c643,_0x34658a[_0x3105('0x12')][_0x3105('0x14')]);return _0x28c551(_0x34658a[_0x3105('0x12')]['message']);}else{logger[_0x3105('0xd')](_0x3105('0x15'),_0x20c643,_0x3105('0xe'));_0x28c551(_0x34658a[_0x3105('0x16')][_0x3105('0x14')]);}})[_0x3105('0x17')](function(_0x5c3f0d){logger[_0x3105('0x12')](_0x3105('0x15'),_0x20c643,_0x5c3f0d);_0x2f76a1(_0x5c3f0d);});});}exports['ShowSquareOdbc']=function(_0x2580dd){var _0x9ec8c6=this;return new Promise(function(_0xcbb60d,_0x2b245a){return db[_0x3105('0x18')][_0x3105('0x19')]({'raw':_0x2580dd[_0x3105('0x1a')]?_0x2580dd['options'][_0x3105('0x1b')]===undefined?!![]:![]:!![],'where':_0x2580dd[_0x3105('0x1a')]?_0x2580dd['options'][_0x3105('0x1c')]||null:null,'attributes':_0x2580dd[_0x3105('0x1a')]?_0x2580dd[_0x3105('0x1a')][_0x3105('0x1d')]||null:null,'include':_0x2580dd[_0x3105('0x1a')]?_0x2580dd[_0x3105('0x1a')][_0x3105('0x1e')]?_[_0x3105('0x1f')](_0x2580dd[_0x3105('0x1a')][_0x3105('0x1e')],function(_0x6d358f){return{'model':db[_0x6d358f[_0x3105('0x20')]],'as':_0x6d358f['as'],'attributes':_0x6d358f[_0x3105('0x1d')],'include':_0x6d358f[_0x3105('0x1e')]?_[_0x3105('0x1f')](_0x6d358f['include'],function(_0x4ede23){return{'model':db[_0x4ede23[_0x3105('0x20')]],'as':_0x4ede23['as'],'attributes':_0x4ede23[_0x3105('0x1d')],'include':_0x4ede23[_0x3105('0x1e')]?_[_0x3105('0x1f')](_0x4ede23[_0x3105('0x1e')],function(_0x13be30){return{'model':db[_0x13be30['model']],'as':_0x13be30['as'],'attributes':_0x13be30['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x35d3c8){logger[_0x3105('0xd')](_0x3105('0x21'),_0x2580dd);logger['debug'](_0x3105('0x21'),_0x2580dd,JSON[_0x3105('0x11')](_0x35d3c8));_0xcbb60d(_0x35d3c8);})['catch'](function(_0xd53888){logger[_0x3105('0x12')](_0x3105('0x21'),_0xd53888[_0x3105('0x14')],_0x2580dd);_0x2b245a(_0x9ec8c6[_0x3105('0x12')](0x1f4,_0xd53888[_0x3105('0x14')]));});});};
\ No newline at end of file
+var _0xadb3=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareOdbc','find','options','raw','where','attributes','include','map','model','then','ShowSquareOdbc','debug','lodash','util','moment'];(function(_0x571f2e,_0x53f476){var _0x540a52=function(_0x455ea3){while(--_0x455ea3){_0x571f2e['push'](_0x571f2e['shift']());}};_0x540a52(++_0x53f476);}(_0xadb3,0x115));var _0x3adb=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xadb3[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x3adb('0x0'));var util=require(_0x3adb('0x1'));var moment=require(_0x3adb('0x2'));var BPromise=require(_0x3adb('0x3'));var rs=require(_0x3adb('0x4'));var fs=require('fs');var Redis=require(_0x3adb('0x5'));var db=require(_0x3adb('0x6'))['db'];var utils=require(_0x3adb('0x7'));var logger=require('../../config/logger')(_0x3adb('0x8'));var config=require(_0x3adb('0x9'));var jayson=require(_0x3adb('0xa'));var client=jayson[_0x3adb('0xb')][_0x3adb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x289954,_0x3cbd9a,_0x273f77){return new BPromise(function(_0x399eba,_0x13020c){return client[_0x3adb('0xd')](_0x289954,_0x273f77)['then'](function(_0x557f1a){logger[_0x3adb('0xe')](_0x3adb('0xf'),_0x3cbd9a,_0x3adb('0x10'));logger['debug'](_0x3adb('0x11'),_0x3cbd9a,'request\x20sent',JSON[_0x3adb('0x12')](_0x557f1a));if(_0x557f1a[_0x3adb('0x13')]){if(_0x557f1a[_0x3adb('0x13')]['code']===0x1f4){logger[_0x3adb('0x13')](_0x3adb('0xf'),_0x3cbd9a,_0x557f1a[_0x3adb('0x13')][_0x3adb('0x14')]);return _0x13020c(_0x557f1a[_0x3adb('0x13')]['message']);}logger[_0x3adb('0x13')](_0x3adb('0xf'),_0x3cbd9a,_0x557f1a[_0x3adb('0x13')][_0x3adb('0x14')]);return _0x399eba(_0x557f1a['error']['message']);}else{logger[_0x3adb('0xe')](_0x3adb('0xf'),_0x3cbd9a,_0x3adb('0x10'));_0x399eba(_0x557f1a[_0x3adb('0x15')][_0x3adb('0x14')]);}})[_0x3adb('0x16')](function(_0x270102){logger[_0x3adb('0x13')](_0x3adb('0xf'),_0x3cbd9a,_0x270102);_0x13020c(_0x270102);});});}exports['ShowSquareOdbc']=function(_0x2ee28f){var _0x26e34f=this;return new Promise(function(_0x225d52,_0x1367e4){return db[_0x3adb('0x17')][_0x3adb('0x18')]({'raw':_0x2ee28f[_0x3adb('0x19')]?_0x2ee28f[_0x3adb('0x19')][_0x3adb('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ee28f[_0x3adb('0x19')]?_0x2ee28f[_0x3adb('0x19')][_0x3adb('0x1b')]||null:null,'attributes':_0x2ee28f[_0x3adb('0x19')]?_0x2ee28f[_0x3adb('0x19')][_0x3adb('0x1c')]||null:null,'include':_0x2ee28f['options']?_0x2ee28f['options'][_0x3adb('0x1d')]?_[_0x3adb('0x1e')](_0x2ee28f['options'][_0x3adb('0x1d')],function(_0x41491e){return{'model':db[_0x41491e['model']],'as':_0x41491e['as'],'attributes':_0x41491e[_0x3adb('0x1c')],'include':_0x41491e['include']?_['map'](_0x41491e['include'],function(_0x51a123){return{'model':db[_0x51a123[_0x3adb('0x1f')]],'as':_0x51a123['as'],'attributes':_0x51a123[_0x3adb('0x1c')],'include':_0x51a123[_0x3adb('0x1d')]?_[_0x3adb('0x1e')](_0x51a123[_0x3adb('0x1d')],function(_0x27dd81){return{'model':db[_0x27dd81[_0x3adb('0x1f')]],'as':_0x27dd81['as'],'attributes':_0x27dd81[_0x3adb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3adb('0x20')](function(_0x250aaf){logger[_0x3adb('0xe')](_0x3adb('0x21'),_0x2ee28f);logger[_0x3adb('0x22')](_0x3adb('0x21'),_0x2ee28f,JSON[_0x3adb('0x12')](_0x250aaf));_0x225d52(_0x250aaf);})[_0x3adb('0x16')](function(_0x222a38){logger[_0x3adb('0x13')](_0x3adb('0x21'),_0x222a38[_0x3adb('0x14')],_0x2ee28f);_0x1367e4(_0x26e34f[_0x3adb('0x13')](0x1f4,_0x222a38['message']));});});};
\ No newline at end of file
index 917b683..9a7feaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc23d=['put','update','delete','/:id','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id/users','getUsers','post','create','addUsers'];(function(_0x86938f,_0x5801d2){var _0x37db36=function(_0x22a9c2){while(--_0x22a9c2){_0x86938f['push'](_0x86938f['shift']());}};_0x37db36(++_0x5801d2);}(_0xc23d,0x7f));var _0xdc23=function(_0xa46b86,_0x5c1465){_0xa46b86=_0xa46b86-0x0;var _0x417360=_0xc23d[_0xa46b86];return _0x417360;};'use strict';var multer=require(_0xdc23('0x0'));var util=require(_0xdc23('0x1'));var path=require(_0xdc23('0x2'));var timeout=require(_0xdc23('0x3'));var express=require(_0xdc23('0x4'));var router=express[_0xdc23('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdc23('0x6'));var interaction=require(_0xdc23('0x7'));var config=require(_0xdc23('0x8'));var controller=require(_0xdc23('0x9'));router[_0xdc23('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdc23('0xa')]('/:id',auth[_0xdc23('0xb')](),controller['show']);router[_0xdc23('0xa')](_0xdc23('0xc'),auth[_0xdc23('0xb')](),controller[_0xdc23('0xd')]);router[_0xdc23('0xe')]('/',auth['isAuthenticated'](),controller[_0xdc23('0xf')]);router[_0xdc23('0xe')](_0xdc23('0xc'),auth[_0xdc23('0xb')](),controller[_0xdc23('0x10')]);router[_0xdc23('0x11')]('/:id',auth[_0xdc23('0xb')](),controller[_0xdc23('0x12')]);router[_0xdc23('0x13')](_0xdc23('0x14'),auth['isAuthenticated'](),controller[_0xdc23('0x15')]);router[_0xdc23('0x13')](_0xdc23('0xc'),auth[_0xdc23('0xb')](),controller[_0xdc23('0x16')]);module[_0xdc23('0x17')]=router;
\ No newline at end of file
+var _0x390a=['./squareProject.controller','get','isAuthenticated','/:id','/:id/users','getUsers','post','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x84a32d,_0xe5edad){var _0x4542e9=function(_0x5c600c){while(--_0x5c600c){_0x84a32d['push'](_0x84a32d['shift']());}};_0x4542e9(++_0xe5edad);}(_0x390a,0xc9));var _0xa390=function(_0x8e20a8,_0x32b5ca){_0x8e20a8=_0x8e20a8-0x0;var _0x111e4c=_0x390a[_0x8e20a8];return _0x111e4c;};'use strict';var multer=require(_0xa390('0x0'));var util=require(_0xa390('0x1'));var path=require(_0xa390('0x2'));var timeout=require(_0xa390('0x3'));var express=require('express');var router=express[_0xa390('0x4')]();var fs_extra=require(_0xa390('0x5'));var auth=require(_0xa390('0x6'));var interaction=require(_0xa390('0x7'));var config=require('../../config/environment');var controller=require(_0xa390('0x8'));router[_0xa390('0x9')]('/',auth[_0xa390('0xa')](),controller['index']);router[_0xa390('0x9')](_0xa390('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa390('0x9')](_0xa390('0xc'),auth[_0xa390('0xa')](),controller[_0xa390('0xd')]);router[_0xa390('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa390('0xe')](_0xa390('0xc'),auth[_0xa390('0xa')](),controller['addUsers']);router[_0xa390('0xf')](_0xa390('0xb'),auth['isAuthenticated'](),controller[_0xa390('0x10')]);router[_0xa390('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa390('0x12')]);router[_0xa390('0x11')]('/:id/users',auth[_0xa390('0xa')](),controller['removeUsers']);module['exports']=router;
\ No newline at end of file
index 41c6e9a..7d458c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9592=['name','TEXT','long','getDataValue','preproduction','toString','utf8','BLOB','production','DATE','sequelize','exports','STRING'];(function(_0x4a2193,_0x312076){var _0x634e78=function(_0x35b0b7){while(--_0x35b0b7){_0x4a2193['push'](_0x4a2193['shift']());}};_0x634e78(++_0x312076);}(_0x9592,0x8c));var _0x2959=function(_0x9d9dba,_0x39b98f){_0x9d9dba=_0x9d9dba-0x0;var _0x530ead=_0x9592[_0x9d9dba];return _0x530ead;};'use strict';var Sequelize=require(_0x2959('0x0'));module[_0x2959('0x1')]={'name':{'type':Sequelize[_0x2959('0x2')],'unique':_0x2959('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2959('0x2')]},'notes':{'type':Sequelize[_0x2959('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x2959('0x5')),'get':function(){if(this[_0x2959('0x6')](_0x2959('0x7'))){return this['getDataValue'](_0x2959('0x7'))[_0x2959('0x8')](_0x2959('0x9'));}}},'production':{'type':Sequelize[_0x2959('0xa')]('long'),'get':function(){if(this['getDataValue'](_0x2959('0xb'))){return this[_0x2959('0x6')](_0x2959('0xb'))['toString'](_0x2959('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x2959('0xc')]}};
\ No newline at end of file
+var _0x5f19=['long','preproduction','getDataValue','toString','utf8','production','DATE','sequelize','STRING','name','TEXT','BLOB'];(function(_0x1fb6a7,_0x23a815){var _0x49b1ab=function(_0x544e0b){while(--_0x544e0b){_0x1fb6a7['push'](_0x1fb6a7['shift']());}};_0x49b1ab(++_0x23a815);}(_0x5f19,0xc7));var _0x95f1=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x5f19[_0x381589];return _0x2a075d;};'use strict';var Sequelize=require(_0x95f1('0x0'));module['exports']={'name':{'type':Sequelize[_0x95f1('0x1')],'unique':_0x95f1('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x95f1('0x1')]},'notes':{'type':Sequelize[_0x95f1('0x3')]},'preproduction':{'type':Sequelize[_0x95f1('0x4')](_0x95f1('0x5')),'get':function(){if(this['getDataValue'](_0x95f1('0x6'))){return this[_0x95f1('0x7')]('preproduction')[_0x95f1('0x8')](_0x95f1('0x9'));}}},'production':{'type':Sequelize['BLOB'](_0x95f1('0x5')),'get':function(){if(this['getDataValue'](_0x95f1('0xa'))){return this[_0x95f1('0x7')](_0x95f1('0xa'))[_0x95f1('0x8')](_0x95f1('0x9'));}}},'savedAt':{'type':Sequelize[_0x95f1('0xb')]},'publishedAt':{'type':Sequelize[_0x95f1('0xb')]}};
\ No newline at end of file
index b01b29c..7b7fefb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99cd=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./squareProject.socket','register','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','get','SquareProjects','UserProfileResource','destroy','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','addUsers','ids','omit','removeUsers','emit','getUsers','length','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra'];(function(_0x1d4bf4,_0x341a91){var _0x2d9639=function(_0x187880){while(--_0x187880){_0x1d4bf4['push'](_0x1d4bf4['shift']());}};_0x2d9639(++_0x341a91);}(_0x99cd,0x1d4));var _0xd99c=function(_0x47df56,_0x14356a){_0x47df56=_0x47df56-0x0;var _0xed4913=_0x99cd[_0x47df56];return _0xed4913;};'use strict';var emlformat=require(_0xd99c('0x0'));var rimraf=require(_0xd99c('0x1'));var zipdir=require(_0xd99c('0x2'));var jsonpatch=require(_0xd99c('0x3'));var rp=require(_0xd99c('0x4'));var moment=require(_0xd99c('0x5'));var BPromise=require(_0xd99c('0x6'));var Mustache=require(_0xd99c('0x7'));var util=require('util');var path=require(_0xd99c('0x8'));var sox=require('sox');var csv=require(_0xd99c('0x9'));var ejs=require(_0xd99c('0xa'));var fs=require('fs');var fs_extra=require(_0xd99c('0xb'));var _=require(_0xd99c('0xc'));var squel=require(_0xd99c('0xd'));var crypto=require(_0xd99c('0xe'));var jsforce=require(_0xd99c('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd99c('0x10'));var Papa=require(_0xd99c('0x11'));var Redis=require(_0xd99c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd99c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd99c('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd99c('0x15'));var config=require(_0xd99c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd99c('0x17'))['db'];config[_0xd99c('0x18')]=_[_0xd99c('0x19')](config[_0xd99c('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd99c('0x18')]));require(_0xd99c('0x1a'))[_0xd99c('0x1b')](socket);function respondWithStatusCode(_0x319ac4,_0x239bba){_0x239bba=_0x239bba||0xcc;return function(_0x27fcd6){if(_0x27fcd6){return _0x319ac4[_0xd99c('0x1c')](_0x239bba);}return _0x319ac4[_0xd99c('0x1d')](_0x239bba)[_0xd99c('0x1e')]();};}function respondWithResult(_0x4f099f,_0x1910e5){_0x1910e5=_0x1910e5||0xc8;return function(_0xaff3aa){if(_0xaff3aa){return _0x4f099f[_0xd99c('0x1d')](_0x1910e5)[_0xd99c('0x1f')](_0xaff3aa);}};}function respondWithFilteredResult(_0x54ec49,_0x2ede98){return function(_0x59c8ff){if(_0x59c8ff){var _0x41a901=typeof _0x2ede98['offset']==='undefined'&&typeof _0x2ede98['limit']===_0xd99c('0x20');var _0x5d017c=_0x59c8ff[_0xd99c('0x21')];var _0x43b4ae=_0x41a901?0x0:_0x2ede98[_0xd99c('0x22')];var _0x5c9159=_0x41a901?_0x59c8ff[_0xd99c('0x21')]:_0x2ede98[_0xd99c('0x22')]+_0x2ede98['limit'];var _0x460a03;if(_0x5c9159>=_0x5d017c){_0x5c9159=_0x5d017c;_0x460a03=0xc8;}else{_0x460a03=0xce;}_0x54ec49[_0xd99c('0x1d')](_0x460a03);return _0x54ec49[_0xd99c('0x23')](_0xd99c('0x24'),_0x43b4ae+'-'+_0x5c9159+'/'+_0x5d017c)[_0xd99c('0x1f')](_0x59c8ff);}return null;};}function patchUpdates(_0x3f4435){return function(_0x341cf2){try{jsonpatch[_0xd99c('0x25')](_0x341cf2,_0x3f4435,!![]);}catch(_0x36dff6){return BPromise[_0xd99c('0x26')](_0x36dff6);}return _0x341cf2[_0xd99c('0x27')]();};}function saveUpdates(_0x4be5ec,_0x26a2cf){return function(_0x5869d1){if(_0x5869d1){return _0x5869d1[_0xd99c('0x28')](_0x4be5ec)[_0xd99c('0x29')](function(_0x298146){return _0x298146;});}return null;};}function removeEntity(_0x372c37,_0x437dcd){return function(_0x2003ab){if(_0x2003ab){return _0x2003ab['destroy']()[_0xd99c('0x29')](function(){var _0x5d3af5=_0x2003ab[_0xd99c('0x2a')]({'plain':!![]});var _0xb15f3=_0xd99c('0x2b');return db[_0xd99c('0x2c')][_0xd99c('0x2d')]({'where':{'type':_0xb15f3,'resourceId':_0x5d3af5['id']}})['then'](function(){return _0x2003ab;});})[_0xd99c('0x29')](function(){_0x372c37[_0xd99c('0x1d')](0xcc)[_0xd99c('0x1e')]();});}};}function handleEntityNotFound(_0x2277fb,_0x58fad0){return function(_0x1a7bb2){if(!_0x1a7bb2){_0x2277fb[_0xd99c('0x1c')](0x194);}return _0x1a7bb2;};}function handleError(_0x24d6ad,_0x4150dc){_0x4150dc=_0x4150dc||0x1f4;return function(_0x28b54d){logger[_0xd99c('0x2e')](_0x28b54d[_0xd99c('0x2f')]);if(_0x28b54d[_0xd99c('0x30')]){delete _0x28b54d[_0xd99c('0x30')];}_0x24d6ad['status'](_0x4150dc)[_0xd99c('0x31')](_0x28b54d);};}exports[_0xd99c('0x32')]=function(_0x17f36a,_0x3b51c1){var _0x58d414={},_0xeb8d32={},_0x459e0c={'count':0x0,'rows':[]};var _0x2a5cb5=_[_0xd99c('0x33')](db[_0xd99c('0x34')][_0xd99c('0x35')],function(_0x3e36c1){return{'name':_0x3e36c1[_0xd99c('0x36')],'type':_0x3e36c1[_0xd99c('0x37')][_0xd99c('0x38')]};});_0xeb8d32[_0xd99c('0x39')]=_[_0xd99c('0x33')](_0x2a5cb5,_0xd99c('0x30'));_0xeb8d32[_0xd99c('0x3a')]=_[_0xd99c('0x3b')](_0x17f36a[_0xd99c('0x3a')]);_0xeb8d32[_0xd99c('0x3c')]=_[_0xd99c('0x3d')](_0xeb8d32[_0xd99c('0x39')],_0xeb8d32['query']);_0x58d414[_0xd99c('0x3e')]=_[_0xd99c('0x3d')](_0xeb8d32['model'],qs[_0xd99c('0x3f')](_0x17f36a[_0xd99c('0x3a')]['fields']));_0x58d414[_0xd99c('0x3e')]=_0x58d414[_0xd99c('0x3e')]['length']?_0x58d414[_0xd99c('0x3e')]:_0xeb8d32[_0xd99c('0x39')];if(!_0x17f36a['query'][_0xd99c('0x40')]('nolimit')){_0x58d414[_0xd99c('0x41')]=qs[_0xd99c('0x41')](_0x17f36a['query'][_0xd99c('0x41')]);_0x58d414[_0xd99c('0x22')]=qs['offset'](_0x17f36a['query'][_0xd99c('0x22')]);}_0x58d414[_0xd99c('0x42')]=qs['sort'](_0x17f36a[_0xd99c('0x3a')][_0xd99c('0x43')]);_0x58d414['where']=qs[_0xd99c('0x3c')](_[_0xd99c('0x44')](_0x17f36a['query'],_0xeb8d32[_0xd99c('0x3c')]),_0x2a5cb5);if(_0x17f36a[_0xd99c('0x3a')]['filter']){_0x58d414['where']=_['merge'](_0x58d414[_0xd99c('0x45')],{'$or':_[_0xd99c('0x33')](_0x2a5cb5,function(_0x4c70ce){if(_0x4c70ce[_0xd99c('0x37')]!==_0xd99c('0x46')){var _0x25cc22={};_0x25cc22[_0x4c70ce[_0xd99c('0x30')]]={'$like':'%'+_0x17f36a[_0xd99c('0x3a')][_0xd99c('0x47')]+'%'};return _0x25cc22;}})});}_0x58d414=_[_0xd99c('0x48')]({},_0x58d414,_0x17f36a[_0xd99c('0x49')]);var _0x3cc558={'where':_0x58d414[_0xd99c('0x45')]};return db[_0xd99c('0x34')][_0xd99c('0x21')](_0x3cc558)['then'](function(_0xa25781){_0x459e0c[_0xd99c('0x21')]=_0xa25781;if(_0x17f36a[_0xd99c('0x3a')][_0xd99c('0x4a')]){_0x58d414[_0xd99c('0x4b')]=[{'all':!![]}];}return db[_0xd99c('0x34')][_0xd99c('0x4c')](_0x58d414);})[_0xd99c('0x29')](function(_0x3d2093){_0x459e0c[_0xd99c('0x4d')]=_0x3d2093;return _0x459e0c;})['then'](respondWithFilteredResult(_0x3b51c1,_0x58d414))[_0xd99c('0x4e')](handleError(_0x3b51c1,null));};exports['show']=function(_0x301ad4,_0x3acc32){var _0x2a4281={'raw':![],'where':{'id':_0x301ad4[_0xd99c('0x4f')]['id']}},_0x3c96ca={};_0x3c96ca[_0xd99c('0x39')]=_[_0xd99c('0x3b')](db['SquareProject']['rawAttributes']);_0x3c96ca[_0xd99c('0x3a')]=_['keys'](_0x301ad4[_0xd99c('0x3a')]);_0x3c96ca[_0xd99c('0x3c')]=_[_0xd99c('0x3d')](_0x3c96ca[_0xd99c('0x39')],_0x3c96ca[_0xd99c('0x3a')]);_0x2a4281[_0xd99c('0x3e')]=_[_0xd99c('0x3d')](_0x3c96ca[_0xd99c('0x39')],qs['fields'](_0x301ad4[_0xd99c('0x3a')][_0xd99c('0x3f')]));_0x2a4281[_0xd99c('0x3e')]=_0x2a4281[_0xd99c('0x3e')]['length']?_0x2a4281[_0xd99c('0x3e')]:_0x3c96ca[_0xd99c('0x39')];if(_0x301ad4[_0xd99c('0x3a')][_0xd99c('0x4a')]){_0x2a4281[_0xd99c('0x4b')]=[{'all':!![]}];}_0x2a4281=_['merge']({},_0x2a4281,_0x301ad4[_0xd99c('0x49')]);return db[_0xd99c('0x34')]['find'](_0x2a4281)[_0xd99c('0x29')](handleEntityNotFound(_0x3acc32,null))[_0xd99c('0x29')](respondWithResult(_0x3acc32,null))[_0xd99c('0x4e')](handleError(_0x3acc32,null));};exports[_0xd99c('0x50')]=function(_0x5d9f27,_0x33df5e){return db[_0xd99c('0x34')][_0xd99c('0x50')](_0x5d9f27[_0xd99c('0x51')],{})[_0xd99c('0x29')](function(_0x1f7b12){var _0xa0d445=_0x5d9f27[_0xd99c('0x52')][_0xd99c('0x2a')]({'plain':!![]});if(!_0xa0d445)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa0d445[_0xd99c('0x53')]===_0xd99c('0x52')){var _0x33a423=_0x1f7b12[_0xd99c('0x2a')]({'plain':!![]});var _0x152171=_0xd99c('0x2b');return db[_0xd99c('0x54')][_0xd99c('0x55')]({'where':{'name':_0x152171,'userProfileId':_0xa0d445[_0xd99c('0x56')]},'raw':!![]})[_0xd99c('0x29')](function(_0x288cd4){if(_0x288cd4&&_0x288cd4[_0xd99c('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x33a423[_0xd99c('0x30')],'resourceId':_0x33a423['id'],'type':_0x288cd4[_0xd99c('0x30')],'sectionId':_0x288cd4['id']},{})['then'](function(){return _0x1f7b12;});}else{return _0x1f7b12;}})[_0xd99c('0x4e')](function(_0x1a127d){logger[_0xd99c('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a127d);throw _0x1a127d;});}return _0x1f7b12;})[_0xd99c('0x29')](respondWithResult(_0x33df5e,0xc9))[_0xd99c('0x4e')](handleError(_0x33df5e,null));};exports[_0xd99c('0x28')]=function(_0x546ed1,_0x27bd08){if(_0x546ed1[_0xd99c('0x51')]['id']){delete _0x546ed1[_0xd99c('0x51')]['id'];}return db[_0xd99c('0x34')][_0xd99c('0x55')]({'where':{'id':_0x546ed1[_0xd99c('0x4f')]['id']}})[_0xd99c('0x29')](handleEntityNotFound(_0x27bd08,null))[_0xd99c('0x29')](saveUpdates(_0x546ed1['body'],null))['then'](respondWithResult(_0x27bd08,null))['catch'](handleError(_0x27bd08,null));};exports[_0xd99c('0x2d')]=function(_0x447fcc,_0x57456f){return db[_0xd99c('0x34')][_0xd99c('0x55')]({'where':{'id':_0x447fcc[_0xd99c('0x4f')]['id']}})[_0xd99c('0x29')](handleEntityNotFound(_0x57456f,null))[_0xd99c('0x29')](removeEntity(_0x57456f,null))['catch'](handleError(_0x57456f,null));};exports[_0xd99c('0x58')]=function(_0x32fa10,_0x3d58b1,_0x215e82){return db[_0xd99c('0x34')][_0xd99c('0x55')]({'where':{'id':_0x32fa10[_0xd99c('0x4f')]['id']}})[_0xd99c('0x29')](handleEntityNotFound(_0x3d58b1,null))['then'](function(_0x1fc8d2){if(_0x1fc8d2){return _0x1fc8d2[_0xd99c('0x58')](_0x32fa10['body'][_0xd99c('0x59')],_[_0xd99c('0x5a')](_0x32fa10['body'],['ids','id'])||{});}})[_0xd99c('0x29')](respondWithResult(_0x3d58b1,null))[_0xd99c('0x4e')](handleError(_0x3d58b1,null));};exports[_0xd99c('0x5b')]=function(_0xaecb65,_0x30917f,_0x1bd9ef){return db['SquareProject']['find']({'where':{'id':_0xaecb65[_0xd99c('0x4f')]['id']}})[_0xd99c('0x29')](handleEntityNotFound(_0x30917f,null))[_0xd99c('0x29')](function(_0x58b2c1){if(_0x58b2c1){return _0x58b2c1['removeUsers'](_0xaecb65[_0xd99c('0x3a')][_0xd99c('0x59')])[_0xd99c('0x29')](function(){if(_['isArray'](_0xaecb65['query'][_0xd99c('0x59')])){for(var _0x12ce6f=0x0;_0x12ce6f<_0xaecb65[_0xd99c('0x3a')]['ids']['length'];_0x12ce6f+=0x1){socket[_0xd99c('0x5c')]('userSquareProject:remove',{'UserId':Number(_0xaecb65[_0xd99c('0x3a')][_0xd99c('0x59')][_0x12ce6f]),'SquareProjectId':Number(_0xaecb65[_0xd99c('0x4f')]['id'])});}}else{socket[_0xd99c('0x5c')]('userSquareProject:remove',{'UserId':Number(_0xaecb65[_0xd99c('0x3a')][_0xd99c('0x59')]),'SquareProjectId':Number(_0xaecb65[_0xd99c('0x4f')]['id'])});}});}})[_0xd99c('0x29')](respondWithStatusCode(_0x30917f,null))['catch'](handleError(_0x30917f,null));};exports[_0xd99c('0x5d')]=function(_0x41f687,_0x3076a7,_0x4ea21d){var _0x53d1ee={};var _0x2735b7={};var _0x158041;var _0x245920;return db[_0xd99c('0x34')]['findOne']({'where':{'id':_0x41f687[_0xd99c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3076a7,null))[_0xd99c('0x29')](function(_0x5dcae6){if(_0x5dcae6){_0x158041=_0x5dcae6;_0x2735b7[_0xd99c('0x39')]=_[_0xd99c('0x3b')](db['User']['rawAttributes']);_0x2735b7[_0xd99c('0x3a')]=_[_0xd99c('0x3b')](_0x41f687[_0xd99c('0x3a')]);_0x2735b7[_0xd99c('0x3c')]=_[_0xd99c('0x3d')](_0x2735b7[_0xd99c('0x39')],_0x2735b7[_0xd99c('0x3a')]);_0x53d1ee[_0xd99c('0x3e')]=_[_0xd99c('0x3d')](_0x2735b7['model'],qs['fields'](_0x41f687[_0xd99c('0x3a')][_0xd99c('0x3f')]));_0x53d1ee[_0xd99c('0x3e')]=_0x53d1ee[_0xd99c('0x3e')][_0xd99c('0x5e')]?_0x53d1ee[_0xd99c('0x3e')]:_0x2735b7[_0xd99c('0x39')];_0x53d1ee[_0xd99c('0x42')]=qs[_0xd99c('0x43')](_0x41f687['query'][_0xd99c('0x43')]);_0x53d1ee[_0xd99c('0x45')]=qs[_0xd99c('0x3c')](_['pick'](_0x41f687['query'],_0x2735b7[_0xd99c('0x3c')]));if(_0x41f687['query']['filter']){_0x53d1ee[_0xd99c('0x45')]=_[_0xd99c('0x48')](_0x53d1ee[_0xd99c('0x45')],{'$or':_[_0xd99c('0x33')](_0x53d1ee[_0xd99c('0x3e')],function(_0x26561d){var _0x578658={};_0x578658[_0x26561d]={'$like':'%'+_0x41f687[_0xd99c('0x3a')][_0xd99c('0x47')]+'%'};return _0x578658;})});}_0x53d1ee=_['merge']({},_0x53d1ee,_0x41f687['options']);return _0x158041[_0xd99c('0x5d')](_0x53d1ee);}})[_0xd99c('0x29')](function(_0xdc961){if(_0xdc961){_0x245920=_0xdc961['length'];if(!_0x41f687[_0xd99c('0x3a')][_0xd99c('0x40')](_0xd99c('0x5f'))){_0x53d1ee[_0xd99c('0x41')]=qs[_0xd99c('0x41')](_0x41f687['query'][_0xd99c('0x41')]);_0x53d1ee[_0xd99c('0x22')]=qs['offset'](_0x41f687[_0xd99c('0x3a')]['offset']);}return _0x158041['getUsers'](_0x53d1ee);}})[_0xd99c('0x29')](function(_0x5edf37){if(_0x5edf37){return _0x5edf37?{'count':_0x245920,'rows':_0x5edf37}:null;}})[_0xd99c('0x29')](respondWithResult(_0x3076a7,null))[_0xd99c('0x4e')](handleError(_0x3076a7,null));};
\ No newline at end of file
+var _0x1773=['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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','SquareProjects','UserProfileResource','send','map','fieldName','type','keys','query','attributes','intersection','model','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','name','options','includeAll','include','SquareProject','rows','show','params','rawAttributes','length','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','findOne','pick','getUsers','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x1773,0x11a));var _0x3177=function(_0x460321,_0x5bc325){_0x460321=_0x460321-0x0;var _0x4a7888=_0x1773[_0x460321];return _0x4a7888;};'use strict';var emlformat=require(_0x3177('0x0'));var rimraf=require(_0x3177('0x1'));var zipdir=require(_0x3177('0x2'));var jsonpatch=require(_0x3177('0x3'));var rp=require(_0x3177('0x4'));var moment=require(_0x3177('0x5'));var BPromise=require(_0x3177('0x6'));var Mustache=require('mustache');var util=require(_0x3177('0x7'));var path=require(_0x3177('0x8'));var sox=require(_0x3177('0x9'));var csv=require(_0x3177('0xa'));var ejs=require(_0x3177('0xb'));var fs=require('fs');var fs_extra=require(_0x3177('0xc'));var _=require(_0x3177('0xd'));var squel=require(_0x3177('0xe'));var crypto=require('crypto');var jsforce=require(_0x3177('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3177('0xa'));var querystring=require(_0x3177('0x10'));var Papa=require('papaparse');var Redis=require(_0x3177('0x11'));var authService=require(_0x3177('0x12'));var qs=require(_0x3177('0x13'));var as=require(_0x3177('0x14'));var hardwareService=require(_0x3177('0x15'));var logger=require(_0x3177('0x16'))(_0x3177('0x17'));var utils=require(_0x3177('0x18'));var config=require(_0x3177('0x19'));var licenseUtil=require(_0x3177('0x1a'));var db=require(_0x3177('0x1b'))['db'];config[_0x3177('0x1c')]=_[_0x3177('0x1d')](config[_0x3177('0x1c')],{'host':_0x3177('0x1e'),'port':0x18eb});var socket=require(_0x3177('0x1f'))(new Redis(config[_0x3177('0x1c')]));require(_0x3177('0x20'))['register'](socket);function respondWithStatusCode(_0x2219d8,_0x45d6c8){_0x45d6c8=_0x45d6c8||0xcc;return function(_0x33f8e9){if(_0x33f8e9){return _0x2219d8[_0x3177('0x21')](_0x45d6c8);}return _0x2219d8[_0x3177('0x22')](_0x45d6c8)[_0x3177('0x23')]();};}function respondWithResult(_0x246c59,_0x39afe2){_0x39afe2=_0x39afe2||0xc8;return function(_0x264d61){if(_0x264d61){return _0x246c59[_0x3177('0x22')](_0x39afe2)['json'](_0x264d61);}};}function respondWithFilteredResult(_0x440a68,_0x3fb97c){return function(_0x24cd4c){if(_0x24cd4c){var _0x46bb1d=typeof _0x3fb97c[_0x3177('0x24')]===_0x3177('0x25')&&typeof _0x3fb97c[_0x3177('0x26')]==='undefined';var _0x472cb9=_0x24cd4c['count'];var _0x260bba=_0x46bb1d?0x0:_0x3fb97c['offset'];var _0x5d00d5=_0x46bb1d?_0x24cd4c[_0x3177('0x27')]:_0x3fb97c[_0x3177('0x24')]+_0x3fb97c[_0x3177('0x26')];var _0x2ac37b;if(_0x5d00d5>=_0x472cb9){_0x5d00d5=_0x472cb9;_0x2ac37b=0xc8;}else{_0x2ac37b=0xce;}_0x440a68[_0x3177('0x22')](_0x2ac37b);return _0x440a68[_0x3177('0x28')]('Content-Range',_0x260bba+'-'+_0x5d00d5+'/'+_0x472cb9)[_0x3177('0x29')](_0x24cd4c);}return null;};}function patchUpdates(_0x58d42e){return function(_0x1b1078){try{jsonpatch[_0x3177('0x2a')](_0x1b1078,_0x58d42e,!![]);}catch(_0x3694e1){return BPromise[_0x3177('0x2b')](_0x3694e1);}return _0x1b1078[_0x3177('0x2c')]();};}function saveUpdates(_0x1f6f24,_0x4dddb8){return function(_0x354bc1){if(_0x354bc1){return _0x354bc1[_0x3177('0x2d')](_0x1f6f24)['then'](function(_0x13e19a){return _0x13e19a;});}return null;};}function removeEntity(_0x40187c,_0x2f2fb4){return function(_0x4fcbf1){if(_0x4fcbf1){return _0x4fcbf1[_0x3177('0x2e')]()[_0x3177('0x2f')](function(){var _0x30c53f=_0x4fcbf1['get']({'plain':!![]});var _0x48896e=_0x3177('0x30');return db[_0x3177('0x31')]['destroy']({'where':{'type':_0x48896e,'resourceId':_0x30c53f['id']}})[_0x3177('0x2f')](function(){return _0x4fcbf1;});})['then'](function(){_0x40187c[_0x3177('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x320339,_0x428a1c){return function(_0x316169){if(!_0x316169){_0x320339['sendStatus'](0x194);}return _0x316169;};}function handleError(_0x32f730,_0x113a36){_0x113a36=_0x113a36||0x1f4;return function(_0x5bcf6c){logger['error'](_0x5bcf6c['stack']);if(_0x5bcf6c['name']){delete _0x5bcf6c['name'];}_0x32f730[_0x3177('0x22')](_0x113a36)[_0x3177('0x32')](_0x5bcf6c);};}exports['index']=function(_0x3a6ee0,_0x4eeba8){var _0x2714be={},_0x57073f={},_0x51a13f={'count':0x0,'rows':[]};var _0x44567a=_[_0x3177('0x33')](db['SquareProject']['rawAttributes'],function(_0x273344){return{'name':_0x273344[_0x3177('0x34')],'type':_0x273344[_0x3177('0x35')]['key']};});_0x57073f['model']=_['map'](_0x44567a,'name');_0x57073f['query']=_[_0x3177('0x36')](_0x3a6ee0[_0x3177('0x37')]);_0x57073f['filters']=_['intersection'](_0x57073f['model'],_0x57073f['query']);_0x2714be[_0x3177('0x38')]=_[_0x3177('0x39')](_0x57073f[_0x3177('0x3a')],qs[_0x3177('0x3b')](_0x3a6ee0['query'][_0x3177('0x3b')]));_0x2714be[_0x3177('0x38')]=_0x2714be[_0x3177('0x38')]['length']?_0x2714be['attributes']:_0x57073f[_0x3177('0x3a')];if(!_0x3a6ee0[_0x3177('0x37')][_0x3177('0x3c')]('nolimit')){_0x2714be[_0x3177('0x26')]=qs['limit'](_0x3a6ee0[_0x3177('0x37')][_0x3177('0x26')]);_0x2714be[_0x3177('0x24')]=qs['offset'](_0x3a6ee0[_0x3177('0x37')]['offset']);}_0x2714be[_0x3177('0x3d')]=qs[_0x3177('0x3e')](_0x3a6ee0[_0x3177('0x37')][_0x3177('0x3e')]);_0x2714be[_0x3177('0x3f')]=qs[_0x3177('0x40')](_['pick'](_0x3a6ee0[_0x3177('0x37')],_0x57073f['filters']),_0x44567a);if(_0x3a6ee0[_0x3177('0x37')][_0x3177('0x41')]){_0x2714be['where']=_[_0x3177('0x42')](_0x2714be[_0x3177('0x3f')],{'$or':_[_0x3177('0x33')](_0x44567a,function(_0x5c7ef7){if(_0x5c7ef7[_0x3177('0x35')]!==_0x3177('0x43')){var _0x3c17ef={};_0x3c17ef[_0x5c7ef7[_0x3177('0x44')]]={'$like':'%'+_0x3a6ee0['query'][_0x3177('0x41')]+'%'};return _0x3c17ef;}})});}_0x2714be=_[_0x3177('0x42')]({},_0x2714be,_0x3a6ee0[_0x3177('0x45')]);var _0x222406={'where':_0x2714be['where']};return db['SquareProject'][_0x3177('0x27')](_0x222406)[_0x3177('0x2f')](function(_0x2f4f8a){_0x51a13f[_0x3177('0x27')]=_0x2f4f8a;if(_0x3a6ee0[_0x3177('0x37')][_0x3177('0x46')]){_0x2714be[_0x3177('0x47')]=[{'all':!![]}];}return db[_0x3177('0x48')]['findAll'](_0x2714be);})[_0x3177('0x2f')](function(_0x2af973){_0x51a13f[_0x3177('0x49')]=_0x2af973;return _0x51a13f;})[_0x3177('0x2f')](respondWithFilteredResult(_0x4eeba8,_0x2714be))['catch'](handleError(_0x4eeba8,null));};exports[_0x3177('0x4a')]=function(_0x284102,_0x47d216){var _0x4b037b={'raw':![],'where':{'id':_0x284102[_0x3177('0x4b')]['id']}},_0x5e553b={};_0x5e553b['model']=_[_0x3177('0x36')](db[_0x3177('0x48')][_0x3177('0x4c')]);_0x5e553b['query']=_[_0x3177('0x36')](_0x284102[_0x3177('0x37')]);_0x5e553b[_0x3177('0x40')]=_[_0x3177('0x39')](_0x5e553b['model'],_0x5e553b[_0x3177('0x37')]);_0x4b037b[_0x3177('0x38')]=_[_0x3177('0x39')](_0x5e553b[_0x3177('0x3a')],qs[_0x3177('0x3b')](_0x284102[_0x3177('0x37')]['fields']));_0x4b037b['attributes']=_0x4b037b[_0x3177('0x38')][_0x3177('0x4d')]?_0x4b037b[_0x3177('0x38')]:_0x5e553b[_0x3177('0x3a')];if(_0x284102[_0x3177('0x37')][_0x3177('0x46')]){_0x4b037b[_0x3177('0x47')]=[{'all':!![]}];}_0x4b037b=_[_0x3177('0x42')]({},_0x4b037b,_0x284102[_0x3177('0x45')]);return db[_0x3177('0x48')]['find'](_0x4b037b)[_0x3177('0x2f')](handleEntityNotFound(_0x47d216,null))[_0x3177('0x2f')](respondWithResult(_0x47d216,null))[_0x3177('0x4e')](handleError(_0x47d216,null));};exports[_0x3177('0x4f')]=function(_0xa15053,_0x589fd7){return db[_0x3177('0x48')][_0x3177('0x4f')](_0xa15053[_0x3177('0x50')],{})[_0x3177('0x2f')](function(_0x52c4dc){var _0x5101e8=_0xa15053['user'][_0x3177('0x51')]({'plain':!![]});if(!_0x5101e8)throw new Error(_0x3177('0x52'));if(_0x5101e8[_0x3177('0x53')]==='user'){var _0x2c66e9=_0x52c4dc[_0x3177('0x51')]({'plain':!![]});var _0x3a545a=_0x3177('0x30');return db[_0x3177('0x54')][_0x3177('0x55')]({'where':{'name':_0x3a545a,'userProfileId':_0x5101e8[_0x3177('0x56')]},'raw':!![]})[_0x3177('0x2f')](function(_0x410f98){if(_0x410f98&&_0x410f98['autoAssociation']===0x0){return db['UserProfileResource'][_0x3177('0x4f')]({'name':_0x2c66e9[_0x3177('0x44')],'resourceId':_0x2c66e9['id'],'type':_0x410f98[_0x3177('0x44')],'sectionId':_0x410f98['id']},{})[_0x3177('0x2f')](function(){return _0x52c4dc;});}else{return _0x52c4dc;}})[_0x3177('0x4e')](function(_0x190dab){logger[_0x3177('0x57')](_0x3177('0x58'),_0x190dab);throw _0x190dab;});}return _0x52c4dc;})[_0x3177('0x2f')](respondWithResult(_0x589fd7,0xc9))['catch'](handleError(_0x589fd7,null));};exports[_0x3177('0x2d')]=function(_0x122ae4,_0x333847){if(_0x122ae4[_0x3177('0x50')]['id']){delete _0x122ae4[_0x3177('0x50')]['id'];}return db[_0x3177('0x48')][_0x3177('0x55')]({'where':{'id':_0x122ae4[_0x3177('0x4b')]['id']}})['then'](handleEntityNotFound(_0x333847,null))[_0x3177('0x2f')](saveUpdates(_0x122ae4['body'],null))['then'](respondWithResult(_0x333847,null))['catch'](handleError(_0x333847,null));};exports['destroy']=function(_0x1a09e7,_0x4eb3f4){return db[_0x3177('0x48')][_0x3177('0x55')]({'where':{'id':_0x1a09e7['params']['id']}})['then'](handleEntityNotFound(_0x4eb3f4,null))[_0x3177('0x2f')](removeEntity(_0x4eb3f4,null))['catch'](handleError(_0x4eb3f4,null));};exports[_0x3177('0x59')]=function(_0x1a7c19,_0x26fab4,_0x33b064){return db['SquareProject'][_0x3177('0x55')]({'where':{'id':_0x1a7c19[_0x3177('0x4b')]['id']}})[_0x3177('0x2f')](handleEntityNotFound(_0x26fab4,null))[_0x3177('0x2f')](function(_0xdcc028){if(_0xdcc028){return _0xdcc028[_0x3177('0x59')](_0x1a7c19[_0x3177('0x50')][_0x3177('0x5a')],_[_0x3177('0x5b')](_0x1a7c19['body'],[_0x3177('0x5a'),'id'])||{});}})[_0x3177('0x2f')](respondWithResult(_0x26fab4,null))[_0x3177('0x4e')](handleError(_0x26fab4,null));};exports[_0x3177('0x5c')]=function(_0xf7f50c,_0x49eeb9,_0x221b3f){return db[_0x3177('0x48')][_0x3177('0x55')]({'where':{'id':_0xf7f50c['params']['id']}})[_0x3177('0x2f')](handleEntityNotFound(_0x49eeb9,null))[_0x3177('0x2f')](function(_0x19d051){if(_0x19d051){return _0x19d051['removeUsers'](_0xf7f50c[_0x3177('0x37')]['ids'])[_0x3177('0x2f')](function(){if(_['isArray'](_0xf7f50c[_0x3177('0x37')][_0x3177('0x5a')])){for(var _0xdf67dd=0x0;_0xdf67dd<_0xf7f50c[_0x3177('0x37')][_0x3177('0x5a')]['length'];_0xdf67dd+=0x1){socket[_0x3177('0x5d')](_0x3177('0x5e'),{'UserId':Number(_0xf7f50c[_0x3177('0x37')][_0x3177('0x5a')][_0xdf67dd]),'SquareProjectId':Number(_0xf7f50c[_0x3177('0x4b')]['id'])});}}else{socket[_0x3177('0x5d')]('userSquareProject:remove',{'UserId':Number(_0xf7f50c[_0x3177('0x37')][_0x3177('0x5a')]),'SquareProjectId':Number(_0xf7f50c[_0x3177('0x4b')]['id'])});}});}})[_0x3177('0x2f')](respondWithStatusCode(_0x49eeb9,null))[_0x3177('0x4e')](handleError(_0x49eeb9,null));};exports['getUsers']=function(_0xd6d8d0,_0x1cc9ce,_0x1e81fc){var _0x4abbea={};var _0x238f3c={};var _0x519b36;var _0xc940d4;return db['SquareProject'][_0x3177('0x5f')]({'where':{'id':_0xd6d8d0['params']['id']}})[_0x3177('0x2f')](handleEntityNotFound(_0x1cc9ce,null))['then'](function(_0x1bd554){if(_0x1bd554){_0x519b36=_0x1bd554;_0x238f3c[_0x3177('0x3a')]=_['keys'](db['User'][_0x3177('0x4c')]);_0x238f3c[_0x3177('0x37')]=_[_0x3177('0x36')](_0xd6d8d0['query']);_0x238f3c[_0x3177('0x40')]=_[_0x3177('0x39')](_0x238f3c[_0x3177('0x3a')],_0x238f3c[_0x3177('0x37')]);_0x4abbea[_0x3177('0x38')]=_[_0x3177('0x39')](_0x238f3c[_0x3177('0x3a')],qs[_0x3177('0x3b')](_0xd6d8d0[_0x3177('0x37')][_0x3177('0x3b')]));_0x4abbea['attributes']=_0x4abbea[_0x3177('0x38')][_0x3177('0x4d')]?_0x4abbea[_0x3177('0x38')]:_0x238f3c[_0x3177('0x3a')];_0x4abbea[_0x3177('0x3d')]=qs[_0x3177('0x3e')](_0xd6d8d0[_0x3177('0x37')][_0x3177('0x3e')]);_0x4abbea[_0x3177('0x3f')]=qs['filters'](_[_0x3177('0x60')](_0xd6d8d0[_0x3177('0x37')],_0x238f3c[_0x3177('0x40')]));if(_0xd6d8d0[_0x3177('0x37')][_0x3177('0x41')]){_0x4abbea[_0x3177('0x3f')]=_[_0x3177('0x42')](_0x4abbea[_0x3177('0x3f')],{'$or':_['map'](_0x4abbea[_0x3177('0x38')],function(_0x21ecc8){var _0x2f1e1d={};_0x2f1e1d[_0x21ecc8]={'$like':'%'+_0xd6d8d0[_0x3177('0x37')][_0x3177('0x41')]+'%'};return _0x2f1e1d;})});}_0x4abbea=_['merge']({},_0x4abbea,_0xd6d8d0[_0x3177('0x45')]);return _0x519b36[_0x3177('0x61')](_0x4abbea);}})[_0x3177('0x2f')](function(_0xd46512){if(_0xd46512){_0xc940d4=_0xd46512['length'];if(!_0xd6d8d0[_0x3177('0x37')][_0x3177('0x3c')](_0x3177('0x62'))){_0x4abbea[_0x3177('0x26')]=qs[_0x3177('0x26')](_0xd6d8d0[_0x3177('0x37')][_0x3177('0x26')]);_0x4abbea[_0x3177('0x24')]=qs[_0x3177('0x24')](_0xd6d8d0[_0x3177('0x37')]['offset']);}return _0x519b36[_0x3177('0x61')](_0x4abbea);}})[_0x3177('0x2f')](function(_0x195369){if(_0x195369){return _0x195369?{'count':_0xc940d4,'rows':_0x195369}:null;}})['then'](respondWithResult(_0x1cc9ce,null))[_0x3177('0x4e')](handleError(_0x1cc9ce,null));};
\ No newline at end of file
index 358f1d3..b6413e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd48=['emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x51b690,_0x380f88){var _0x15e2c3=function(_0x5577c8){while(--_0x5577c8){_0x51b690['push'](_0x51b690['shift']());}};_0x15e2c3(++_0x380f88);}(_0xdd48,0x81));var _0x8dd4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xdd48[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x8dd4('0x0'));var SquareProject=require(_0x8dd4('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8dd4('0x2')](0x0);var events={'afterCreate':_0x8dd4('0x3'),'afterUpdate':_0x8dd4('0x4'),'afterDestroy':_0x8dd4('0x5')};function emitEvent(_0x20985c){return function(_0x5eac4b,_0x246d05,_0x386f91){SquareProjectEvents[_0x8dd4('0x6')](_0x20985c+':'+_0x5eac4b['id'],_0x5eac4b);SquareProjectEvents[_0x8dd4('0x6')](_0x20985c,_0x5eac4b);_0x386f91(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x8dd4('0x7')](e,emitEvent(event));}}module[_0x8dd4('0x8')]=SquareProjectEvents;
\ No newline at end of file
+var _0x0778=['events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xeeb156,_0x5392f4){var _0x4b7c74=function(_0x5705bb){while(--_0x5705bb){_0xeeb156['push'](_0xeeb156['shift']());}};_0x4b7c74(++_0x5392f4);}(_0x0778,0x1ad));var _0x8077=function(_0x3eaf4c,_0x564662){_0x3eaf4c=_0x3eaf4c-0x0;var _0x4a4d88=_0x0778[_0x3eaf4c];return _0x4a4d88;};'use strict';var EventEmitter=require(_0x8077('0x0'));var SquareProject=require(_0x8077('0x1'))['db'][_0x8077('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8077('0x3')](0x0);var events={'afterCreate':_0x8077('0x4'),'afterUpdate':_0x8077('0x5'),'afterDestroy':_0x8077('0x6')};function emitEvent(_0x3fd60a){return function(_0x79478b,_0x598f77,_0x45aa3c){SquareProjectEvents['emit'](_0x3fd60a+':'+_0x79478b['id'],_0x79478b);SquareProjectEvents[_0x8077('0x7')](_0x3fd60a,_0x79478b);_0x45aa3c(null);};}for(var e in events){if(events[_0x8077('0x8')](e)){var event=events[e];SquareProject[_0x8077('0x9')](e,emitEvent(event));}}module[_0x8077('0xa')]=SquareProjectEvents;
\ No newline at end of file
index c74624d..2dcf1af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ee9=['changed','preproduction','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8ee9,0x190));var _0x98ee=function(_0x180a9c,_0x330b9b){_0x180a9c=_0x180a9c-0x0;var _0x3acfcd=_0x8ee9[_0x180a9c];return _0x3acfcd;};'use strict';var _=require(_0x98ee('0x0'));var util=require(_0x98ee('0x1'));var logger=require('../../config/logger')(_0x98ee('0x2'));var moment=require(_0x98ee('0x3'));var BPromise=require(_0x98ee('0x4'));var rp=require(_0x98ee('0x5'));var fs=require('fs');var path=require(_0x98ee('0x6'));var rimraf=require(_0x98ee('0x7'));var config=require(_0x98ee('0x8'));var attributes=require(_0x98ee('0x9'));module[_0x98ee('0xa')]=function(_0x53af0b,_0x1be989){return _0x53af0b[_0x98ee('0xb')](_0x98ee('0xc'),attributes,{'tableName':_0x98ee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1516e0,_0x51c133,_0x2a13c1){if(_0x1516e0[_0x98ee('0xe')](_0x98ee('0xf'))){_0x1516e0['savedAt']=moment()['format'](_0x98ee('0x10'));}if(_0x1516e0[_0x98ee('0xe')]('production')){_0x1516e0[_0x98ee('0x11')]=moment()['format'](_0x98ee('0x10'));}_0x2a13c1(null,_0x1516e0);}}});};
\ No newline at end of file
+var _0xb7af=['square_projects','changed','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api','path','rimraf','./squareProject.attributes','define','SquareProject'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xb7af,0x76));var _0xfb7a=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0xb7af[_0x4c2f30];return _0xb8854d;};'use strict';var _=require(_0xfb7a('0x0'));var util=require(_0xfb7a('0x1'));var logger=require('../../config/logger')(_0xfb7a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb7a('0x3'));var rimraf=require(_0xfb7a('0x4'));var config=require('../../config/environment');var attributes=require(_0xfb7a('0x5'));module['exports']=function(_0x46e9c9,_0x5e8a47){return _0x46e9c9[_0xfb7a('0x6')](_0xfb7a('0x7'),attributes,{'tableName':_0xfb7a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x395d08,_0x364e26,_0x5e4aef){if(_0x395d08[_0xfb7a('0x9')]('preproduction')){_0x395d08['savedAt']=moment()[_0xfb7a('0xa')](_0xfb7a('0xb'));}if(_0x395d08['changed'](_0xfb7a('0xc'))){_0x395d08[_0xfb7a('0xd')]=moment()[_0xfb7a('0xa')](_0xfb7a('0xb'));}_0x5e4aef(null,_0x395d08);}}});};
\ No newline at end of file
index 66c42c6..23ddf32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed2b=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','SquareProject,\x20%s,\x20%s','result','catch','find','options','raw','include','map','model','attributes','ShowSquareProject','debug','stringify','lodash','util','bluebird'];(function(_0x119be0,_0x30f510){var _0x2c5aa2=function(_0x284174){while(--_0x284174){_0x119be0['push'](_0x119be0['shift']());}};_0x2c5aa2(++_0x30f510);}(_0xed2b,0xbb));var _0xbed2=function(_0x588cbd,_0x43b872){_0x588cbd=_0x588cbd-0x0;var _0x571e75=_0xed2b[_0x588cbd];return _0x571e75;};'use strict';var _=require(_0xbed2('0x0'));var util=require(_0xbed2('0x1'));var moment=require('moment');var BPromise=require(_0xbed2('0x2'));var rs=require(_0xbed2('0x3'));var fs=require('fs');var Redis=require(_0xbed2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbed2('0x5'));var logger=require(_0xbed2('0x6'))('rpc');var config=require(_0xbed2('0x7'));var jayson=require(_0xbed2('0x8'));var client=jayson[_0xbed2('0x9')][_0xbed2('0xa')]({'port':0x232a});config['redis']=_[_0xbed2('0xb')](config[_0xbed2('0xc')],{'host':_0xbed2('0xd'),'port':0x18eb});var socket=require(_0xbed2('0xe'))(new Redis(config['redis']));require(_0xbed2('0xf'))[_0xbed2('0x10')](socket);function respondWithRpcPromise(_0x588596,_0x170137,_0x4cf29f){return new BPromise(function(_0x39527b,_0x464a1c){return client[_0xbed2('0x11')](_0x588596,_0x4cf29f)[_0xbed2('0x12')](function(_0x3f96b9){logger[_0xbed2('0x13')]('SquareProject,\x20%s,\x20%s',_0x170137,_0xbed2('0x14'));logger['debug'](_0xbed2('0x15'),_0x170137,_0xbed2('0x14'),JSON['stringify'](_0x3f96b9));if(_0x3f96b9[_0xbed2('0x16')]){if(_0x3f96b9[_0xbed2('0x16')][_0xbed2('0x17')]===0x1f4){logger[_0xbed2('0x16')]('SquareProject,\x20%s,\x20%s',_0x170137,_0x3f96b9[_0xbed2('0x16')]['message']);return _0x464a1c(_0x3f96b9[_0xbed2('0x16')][_0xbed2('0x18')]);}logger[_0xbed2('0x16')](_0xbed2('0x19'),_0x170137,_0x3f96b9[_0xbed2('0x16')]['message']);return _0x39527b(_0x3f96b9['error'][_0xbed2('0x18')]);}else{logger[_0xbed2('0x13')](_0xbed2('0x19'),_0x170137,_0xbed2('0x14'));_0x39527b(_0x3f96b9[_0xbed2('0x1a')][_0xbed2('0x18')]);}})[_0xbed2('0x1b')](function(_0x1691b1){logger[_0xbed2('0x16')](_0xbed2('0x19'),_0x170137,_0x1691b1);_0x464a1c(_0x1691b1);});});}exports['ShowSquareProject']=function(_0xbaeff0){var _0x8c5e1f=this;return new Promise(function(_0x18525f,_0x11b444){return db['SquareProject'][_0xbed2('0x1c')]({'raw':_0xbaeff0[_0xbed2('0x1d')]?_0xbaeff0[_0xbed2('0x1d')][_0xbed2('0x1e')]===undefined?!![]:![]:!![],'where':_0xbaeff0[_0xbed2('0x1d')]?_0xbaeff0['options']['where']||null:null,'attributes':_0xbaeff0[_0xbed2('0x1d')]?_0xbaeff0[_0xbed2('0x1d')]['attributes']||null:null,'include':_0xbaeff0[_0xbed2('0x1d')]?_0xbaeff0[_0xbed2('0x1d')][_0xbed2('0x1f')]?_[_0xbed2('0x20')](_0xbaeff0['options']['include'],function(_0x55ae07){return{'model':db[_0x55ae07[_0xbed2('0x21')]],'as':_0x55ae07['as'],'attributes':_0x55ae07['attributes'],'include':_0x55ae07[_0xbed2('0x1f')]?_['map'](_0x55ae07[_0xbed2('0x1f')],function(_0x3eb881){return{'model':db[_0x3eb881['model']],'as':_0x3eb881['as'],'attributes':_0x3eb881[_0xbed2('0x22')],'include':_0x3eb881[_0xbed2('0x1f')]?_[_0xbed2('0x20')](_0x3eb881['include'],function(_0x5e5d96){return{'model':db[_0x5e5d96['model']],'as':_0x5e5d96['as'],'attributes':_0x5e5d96[_0xbed2('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbed2('0x12')](function(_0x5e12a8){logger[_0xbed2('0x13')](_0xbed2('0x23'),_0xbaeff0);logger[_0xbed2('0x24')]('ShowSquareProject',_0xbaeff0,JSON[_0xbed2('0x25')](_0x5e12a8));_0x18525f(_0x5e12a8);})[_0xbed2('0x1b')](function(_0x59888e){logger[_0xbed2('0x16')](_0xbed2('0x23'),_0x59888e[_0xbed2('0x18')],_0xbaeff0);_0x11b444(_0x8c5e1f[_0xbed2('0x16')](0x1f4,_0x59888e[_0xbed2('0x18')]));});});};
\ No newline at end of file
+var _0xcc34=['catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','info','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./squareProject.socket','register','request','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5713a7,_0x2b0b3f){var _0x534434=function(_0x3cb572){while(--_0x3cb572){_0x5713a7['push'](_0x5713a7['shift']());}};_0x534434(++_0x2b0b3f);}(_0xcc34,0x7e));var _0x4cc3=function(_0x3973e9,_0x14b807){_0x3973e9=_0x3973e9-0x0;var _0x2b28dd=_0xcc34[_0x3973e9];return _0x2b28dd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4cc3('0x0'));var BPromise=require('bluebird');var rs=require(_0x4cc3('0x1'));var fs=require('fs');var Redis=require(_0x4cc3('0x2'));var db=require(_0x4cc3('0x3'))['db'];var utils=require(_0x4cc3('0x4'));var logger=require(_0x4cc3('0x5'))(_0x4cc3('0x6'));var config=require(_0x4cc3('0x7'));var jayson=require(_0x4cc3('0x8'));var client=jayson[_0x4cc3('0x9')][_0x4cc3('0xa')]({'port':0x232a});config['redis']=_[_0x4cc3('0xb')](config[_0x4cc3('0xc')],{'host':_0x4cc3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4cc3('0xc')]));require(_0x4cc3('0xe'))[_0x4cc3('0xf')](socket);function respondWithRpcPromise(_0x4bf7a3,_0x30adb2,_0x198aab){return new BPromise(function(_0x1af791,_0x2d54a8){return client[_0x4cc3('0x10')](_0x4bf7a3,_0x198aab)[_0x4cc3('0x11')](function(_0x3ed734){logger['info'](_0x4cc3('0x12'),_0x30adb2,_0x4cc3('0x13'));logger[_0x4cc3('0x14')](_0x4cc3('0x15'),_0x30adb2,_0x4cc3('0x13'),JSON[_0x4cc3('0x16')](_0x3ed734));if(_0x3ed734[_0x4cc3('0x17')]){if(_0x3ed734['error']['code']===0x1f4){logger[_0x4cc3('0x17')](_0x4cc3('0x12'),_0x30adb2,_0x3ed734[_0x4cc3('0x17')][_0x4cc3('0x18')]);return _0x2d54a8(_0x3ed734[_0x4cc3('0x17')][_0x4cc3('0x18')]);}logger[_0x4cc3('0x17')]('SquareProject,\x20%s,\x20%s',_0x30adb2,_0x3ed734[_0x4cc3('0x17')][_0x4cc3('0x18')]);return _0x1af791(_0x3ed734['error'][_0x4cc3('0x18')]);}else{logger['info'](_0x4cc3('0x12'),_0x30adb2,_0x4cc3('0x13'));_0x1af791(_0x3ed734[_0x4cc3('0x19')][_0x4cc3('0x18')]);}})[_0x4cc3('0x1a')](function(_0x184e5b){logger['error'](_0x4cc3('0x12'),_0x30adb2,_0x184e5b);_0x2d54a8(_0x184e5b);});});}exports[_0x4cc3('0x1b')]=function(_0x56d384){var _0x3d4975=this;return new Promise(function(_0x279875,_0x119a38){return db[_0x4cc3('0x1c')][_0x4cc3('0x1d')]({'raw':_0x56d384['options']?_0x56d384[_0x4cc3('0x1e')][_0x4cc3('0x1f')]===undefined?!![]:![]:!![],'where':_0x56d384[_0x4cc3('0x1e')]?_0x56d384[_0x4cc3('0x1e')][_0x4cc3('0x20')]||null:null,'attributes':_0x56d384[_0x4cc3('0x1e')]?_0x56d384[_0x4cc3('0x1e')][_0x4cc3('0x21')]||null:null,'include':_0x56d384['options']?_0x56d384['options'][_0x4cc3('0x22')]?_[_0x4cc3('0x23')](_0x56d384[_0x4cc3('0x1e')][_0x4cc3('0x22')],function(_0x36b8e3){return{'model':db[_0x36b8e3[_0x4cc3('0x24')]],'as':_0x36b8e3['as'],'attributes':_0x36b8e3['attributes'],'include':_0x36b8e3[_0x4cc3('0x22')]?_[_0x4cc3('0x23')](_0x36b8e3[_0x4cc3('0x22')],function(_0x235654){return{'model':db[_0x235654['model']],'as':_0x235654['as'],'attributes':_0x235654[_0x4cc3('0x21')],'include':_0x235654[_0x4cc3('0x22')]?_[_0x4cc3('0x23')](_0x235654['include'],function(_0x2ff287){return{'model':db[_0x2ff287['model']],'as':_0x2ff287['as'],'attributes':_0x2ff287[_0x4cc3('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4cc3('0x11')](function(_0x878501){logger[_0x4cc3('0x25')](_0x4cc3('0x1b'),_0x56d384);logger[_0x4cc3('0x14')](_0x4cc3('0x1b'),_0x56d384,JSON['stringify'](_0x878501));_0x279875(_0x878501);})[_0x4cc3('0x1a')](function(_0x52fd9a){logger[_0x4cc3('0x17')]('ShowSquareProject',_0x52fd9a[_0x4cc3('0x18')],_0x56d384);_0x119a38(_0x3d4975[_0x4cc3('0x17')](0x1f4,_0x52fd9a['message']));});});};
\ No newline at end of file
index bd4729d..bfc4afe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc75=['emit','removeListener','register','squareProject:','./squareProject.events','save','remove','update'];(function(_0xe3a39a,_0x34a536){var _0x432501=function(_0x164844){while(--_0x164844){_0xe3a39a['push'](_0xe3a39a['shift']());}};_0x432501(++_0x34a536);}(_0xfc75,0x19c));var _0x5fc7=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfc75[_0x502c7d];return _0x30b7ed;};'use strict';var SquareProjectEvents=require(_0x5fc7('0x0'));var events=[_0x5fc7('0x1'),_0x5fc7('0x2'),_0x5fc7('0x3')];function createListener(_0x51b514,_0x91081c){return function(_0x23639a){_0x91081c[_0x5fc7('0x4')](_0x51b514,_0x23639a);};}function removeListener(_0x80e365,_0x25da93){return function(){SquareProjectEvents[_0x5fc7('0x5')](_0x80e365,_0x25da93);};}exports[_0x5fc7('0x6')]=function(_0x15d3c4){for(var _0x5e9c3a=0x0,_0x5b4253=events['length'];_0x5e9c3a<_0x5b4253;_0x5e9c3a++){var _0x10c9bf=events[_0x5e9c3a];var _0x11b7ab=createListener(_0x5fc7('0x7')+_0x10c9bf,_0x15d3c4);SquareProjectEvents['on'](_0x10c9bf,_0x11b7ab);}};
\ No newline at end of file
+var _0x3519=['./squareProject.events','save','remove','update','length','squareProject:'];(function(_0x4ca966,_0x6fdc8){var _0x2312b4=function(_0x495b5d){while(--_0x495b5d){_0x4ca966['push'](_0x4ca966['shift']());}};_0x2312b4(++_0x6fdc8);}(_0x3519,0x192));var _0x9351=function(_0x1c208e,_0x2a0a5b){_0x1c208e=_0x1c208e-0x0;var _0x5104ff=_0x3519[_0x1c208e];return _0x5104ff;};'use strict';var SquareProjectEvents=require(_0x9351('0x0'));var events=[_0x9351('0x1'),_0x9351('0x2'),_0x9351('0x3')];function createListener(_0x497173,_0xe0b184){return function(_0x3b1acb){_0xe0b184['emit'](_0x497173,_0x3b1acb);};}function removeListener(_0x40649b,_0x3cdd95){return function(){SquareProjectEvents['removeListener'](_0x40649b,_0x3cdd95);};}exports['register']=function(_0x4ae1ff){for(var _0x1d930d=0x0,_0x3b0eae=events[_0x9351('0x4')];_0x1d930d<_0x3b0eae;_0x1d930d++){var _0xe8f3c=events[_0x1d930d];var _0x356240=createListener(_0x9351('0x5')+_0xe8f3c,_0x4ae1ff);SquareProjectEvents['on'](_0xe8f3c,_0x356240);}};
\ No newline at end of file
index 083db32..dc547e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2cabc7,_0x4378ca){var _0x4aed93=function(_0xeb8f07){while(--_0xeb8f07){_0x2cabc7['push'](_0x2cabc7['shift']());}};_0x4aed93(++_0x4378ca);}(_0x4975,0x86));var _0x5497=function(_0x574491,_0x36459e){_0x574491=_0x574491-0x0;var _0x49e592=_0x4975[_0x574491];return _0x49e592;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router;
\ No newline at end of file
+var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x112d2e,_0x34d10d){var _0xe21b9e=function(_0x3e8295){while(--_0x3e8295){_0x112d2e['push'](_0x112d2e['shift']());}};_0xe21b9e(++_0x34d10d);}(_0x4975,0x86));var _0x5497=function(_0x18ce7f,_0x2005e8){_0x18ce7f=_0x18ce7f-0x0;var _0x45b169=_0x4975[_0x18ce7f];return _0x45b169;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router;
\ No newline at end of file
index 7440475..ac8a29a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x207c=['savePath','substring','exports','STRING','VIRTUAL','getDataValue'];(function(_0x2d94a5,_0x4af2a5){var _0x16cc8e=function(_0x2b0bee){while(--_0x2b0bee){_0x2d94a5['push'](_0x2d94a5['shift']());}};_0x16cc8e(++_0x4af2a5);}(_0x207c,0x1e8));var _0xc207=function(_0x1f184a,_0x19ff0c){_0x1f184a=_0x1f184a-0x0;var _0x5780b1=_0x207c[_0x1f184a];return _0x5780b1;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'uniqueid':{'type':Sequelize[_0xc207('0x1')]},'callerid':{'type':Sequelize[_0xc207('0x1')]},'calleridname':{'type':Sequelize[_0xc207('0x1')]},'context':{'type':Sequelize[_0xc207('0x1')]},'extension':{'type':Sequelize[_0xc207('0x1')]},'priority':{'type':Sequelize[_0xc207('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xc207('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xc207('0x1')]},'format':{'type':Sequelize[_0xc207('0x2')],'get':function(){var _0x3395e4='';var _0x59ff6f=this[_0xc207('0x3')](_0xc207('0x4'));if(_0x59ff6f){_0x3395e4=_0x59ff6f[_0xc207('0x5')](_0x59ff6f['lastIndexOf']('.'));}return _0x3395e4;}}};
\ No newline at end of file
+var _0x5fd1=['STRING','VIRTUAL','getDataValue','savePath','substring','sequelize'];(function(_0x7c0b3e,_0x5be1dc){var _0x4907d5=function(_0x42c418){while(--_0x42c418){_0x7c0b3e['push'](_0x7c0b3e['shift']());}};_0x4907d5(++_0x5be1dc);}(_0x5fd1,0x155));var _0x15fd=function(_0x327c67,_0x2e6c3e){_0x327c67=_0x327c67-0x0;var _0x68e813=_0x5fd1[_0x327c67];return _0x68e813;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x15fd('0x1')]},'callerid':{'type':Sequelize[_0x15fd('0x1')]},'calleridname':{'type':Sequelize[_0x15fd('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x15fd('0x1')]},'accountcode':{'type':Sequelize[_0x15fd('0x1')]},'dnid':{'type':Sequelize[_0x15fd('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x15fd('0x1')]},'filename':{'type':Sequelize[_0x15fd('0x1')]},'savePath':{'type':Sequelize[_0x15fd('0x1')]},'format':{'type':Sequelize[_0x15fd('0x2')],'get':function(){var _0x225728='';var _0x534e63=this[_0x15fd('0x3')](_0x15fd('0x4'));if(_0x534e63){_0x225728=_0x534e63[_0x15fd('0x5')](_0x534e63['lastIndexOf']('.'));}return _0x225728;}}};
\ No newline at end of file
index a40af4c..01b5146 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd588=['model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','SquareRecording','includeAll','findAll','rows','show','params','keys','rawAttributes','length','include','find','catch','create','body','update','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','recording','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','query','filters','intersection'];(function(_0x53f122,_0x2cdeca){var _0x59a134=function(_0x41468d){while(--_0x41468d){_0x53f122['push'](_0x53f122['shift']());}};_0x59a134(++_0x2cdeca);}(_0xd588,0x90));var _0x8d58=function(_0x56442c,_0x46f7cd){_0x56442c=_0x56442c-0x0;var _0x5ed5dc=_0xd588[_0x56442c];return _0x5ed5dc;};'use strict';var emlformat=require(_0x8d58('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d58('0x1'));var jsonpatch=require(_0x8d58('0x2'));var rp=require(_0x8d58('0x3'));var moment=require('moment');var BPromise=require(_0x8d58('0x4'));var Mustache=require(_0x8d58('0x5'));var util=require('util');var path=require(_0x8d58('0x6'));var sox=require(_0x8d58('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d58('0x8'));var _=require(_0x8d58('0x9'));var squel=require(_0x8d58('0xa'));var crypto=require(_0x8d58('0xb'));var jsforce=require(_0x8d58('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8d58('0xd'));var Papa=require(_0x8d58('0xe'));var Redis=require(_0x8d58('0xf'));var authService=require(_0x8d58('0x10'));var qs=require(_0x8d58('0x11'));var as=require(_0x8d58('0x12'));var hardwareService=require(_0x8d58('0x13'));var logger=require(_0x8d58('0x14'))(_0x8d58('0x15'));var utils=require(_0x8d58('0x16'));var config=require(_0x8d58('0x17'));var licenseUtil=require(_0x8d58('0x18'));var db=require(_0x8d58('0x19'))['db'];function respondWithStatusCode(_0x38a7c8,_0x2abc35){_0x2abc35=_0x2abc35||0xcc;return function(_0x3d57b7){if(_0x3d57b7){return _0x38a7c8[_0x8d58('0x1a')](_0x2abc35);}return _0x38a7c8[_0x8d58('0x1b')](_0x2abc35)['end']();};}function respondWithResult(_0x190e28,_0x37b7fd){_0x37b7fd=_0x37b7fd||0xc8;return function(_0x5c54d8){if(_0x5c54d8){return _0x190e28[_0x8d58('0x1b')](_0x37b7fd)[_0x8d58('0x1c')](_0x5c54d8);}};}function respondWithFilteredResult(_0x3a0eb2,_0x4b1d6c){return function(_0x1f6245){if(_0x1f6245){var _0x4fc422=typeof _0x4b1d6c[_0x8d58('0x1d')]===_0x8d58('0x1e')&&typeof _0x4b1d6c[_0x8d58('0x1f')]==='undefined';var _0x2e21b6=_0x1f6245['count'];var _0x517bad=_0x4fc422?0x0:_0x4b1d6c[_0x8d58('0x1d')];var _0xc6bd9c=_0x4fc422?_0x1f6245[_0x8d58('0x20')]:_0x4b1d6c[_0x8d58('0x1d')]+_0x4b1d6c[_0x8d58('0x1f')];var _0x1b39ca;if(_0xc6bd9c>=_0x2e21b6){_0xc6bd9c=_0x2e21b6;_0x1b39ca=0xc8;}else{_0x1b39ca=0xce;}_0x3a0eb2[_0x8d58('0x1b')](_0x1b39ca);return _0x3a0eb2[_0x8d58('0x21')]('Content-Range',_0x517bad+'-'+_0xc6bd9c+'/'+_0x2e21b6)[_0x8d58('0x1c')](_0x1f6245);}return null;};}function patchUpdates(_0x3e6ef0){return function(_0x246e36){try{jsonpatch['apply'](_0x246e36,_0x3e6ef0,!![]);}catch(_0x4566e2){return BPromise[_0x8d58('0x22')](_0x4566e2);}return _0x246e36['save']();};}function saveUpdates(_0x3a47aa,_0x45e4a9){return function(_0x390f16){if(_0x390f16){return _0x390f16['update'](_0x3a47aa)[_0x8d58('0x23')](function(_0x357dac){return _0x357dac;});}return null;};}function removeEntity(_0x40fff2,_0x4f2989){return function(_0x54afdc){if(_0x54afdc){return _0x54afdc[_0x8d58('0x24')]()[_0x8d58('0x23')](function(){_0x40fff2['status'](0xcc)[_0x8d58('0x25')]();});}};}function handleEntityNotFound(_0x4d94ee,_0x51488c){return function(_0x1ca8ec){if(!_0x1ca8ec){_0x4d94ee[_0x8d58('0x1a')](0x194);}return _0x1ca8ec;};}function handleError(_0x1f2ce9,_0x545764){_0x545764=_0x545764||0x1f4;return function(_0x5ba7dd){logger[_0x8d58('0x26')](_0x5ba7dd[_0x8d58('0x27')]);if(_0x5ba7dd[_0x8d58('0x28')]){delete _0x5ba7dd[_0x8d58('0x28')];}_0x1f2ce9[_0x8d58('0x1b')](_0x545764)[_0x8d58('0x29')](_0x5ba7dd);};}exports[_0x8d58('0x2a')]=function(_0x1d4eb5,_0x48cb62){var _0x1446aa={},_0x1f3920={},_0x32e267={'count':0x0,'rows':[]};var _0x5430fd=_[_0x8d58('0x2b')](db['SquareRecording']['rawAttributes'],function(_0x5d3886){return{'name':_0x5d3886[_0x8d58('0x2c')],'type':_0x5d3886[_0x8d58('0x2d')][_0x8d58('0x2e')]};});_0x1f3920['model']=_[_0x8d58('0x2b')](_0x5430fd,_0x8d58('0x28'));_0x1f3920[_0x8d58('0x2f')]=_['keys'](_0x1d4eb5[_0x8d58('0x2f')]);_0x1f3920[_0x8d58('0x30')]=_[_0x8d58('0x31')](_0x1f3920[_0x8d58('0x32')],_0x1f3920[_0x8d58('0x2f')]);_0x1446aa[_0x8d58('0x33')]=_[_0x8d58('0x31')](_0x1f3920[_0x8d58('0x32')],qs[_0x8d58('0x34')](_0x1d4eb5[_0x8d58('0x2f')][_0x8d58('0x34')]));_0x1446aa[_0x8d58('0x33')]=_0x1446aa[_0x8d58('0x33')]['length']?_0x1446aa['attributes']:_0x1f3920['model'];if(!_0x1d4eb5['query'][_0x8d58('0x35')](_0x8d58('0x36'))){_0x1446aa[_0x8d58('0x1f')]=qs[_0x8d58('0x1f')](_0x1d4eb5['query'][_0x8d58('0x1f')]);_0x1446aa['offset']=qs[_0x8d58('0x1d')](_0x1d4eb5[_0x8d58('0x2f')][_0x8d58('0x1d')]);}_0x1446aa['order']=qs[_0x8d58('0x37')](_0x1d4eb5[_0x8d58('0x2f')][_0x8d58('0x37')]);_0x1446aa[_0x8d58('0x38')]=qs[_0x8d58('0x30')](_['pick'](_0x1d4eb5[_0x8d58('0x2f')],_0x1f3920[_0x8d58('0x30')]),_0x5430fd);if(_0x1d4eb5[_0x8d58('0x2f')][_0x8d58('0x39')]){_0x1446aa[_0x8d58('0x38')]=_['merge'](_0x1446aa[_0x8d58('0x38')],{'$or':_['map'](_0x5430fd,function(_0x339653){if(_0x339653[_0x8d58('0x2d')]!==_0x8d58('0x3a')){var _0x3a1a12={};_0x3a1a12[_0x339653[_0x8d58('0x28')]]={'$like':'%'+_0x1d4eb5[_0x8d58('0x2f')][_0x8d58('0x39')]+'%'};return _0x3a1a12;}})});}_0x1446aa=_[_0x8d58('0x3b')]({},_0x1446aa,_0x1d4eb5[_0x8d58('0x3c')]);var _0x1718bd={'where':_0x1446aa[_0x8d58('0x38')]};return db[_0x8d58('0x3d')][_0x8d58('0x20')](_0x1718bd)[_0x8d58('0x23')](function(_0x312214){_0x32e267['count']=_0x312214;if(_0x1d4eb5[_0x8d58('0x2f')][_0x8d58('0x3e')]){_0x1446aa['include']=[{'all':!![]}];}return db['SquareRecording'][_0x8d58('0x3f')](_0x1446aa);})[_0x8d58('0x23')](function(_0x1a4ab6){_0x32e267[_0x8d58('0x40')]=_0x1a4ab6;return _0x32e267;})['then'](respondWithFilteredResult(_0x48cb62,_0x1446aa))['catch'](handleError(_0x48cb62,null));};exports[_0x8d58('0x41')]=function(_0x42f4f1,_0x4453a6){var _0x1cc66b={'raw':!![],'where':{'id':_0x42f4f1[_0x8d58('0x42')]['id']}},_0x4782dd={};_0x4782dd[_0x8d58('0x32')]=_[_0x8d58('0x43')](db[_0x8d58('0x3d')][_0x8d58('0x44')]);_0x4782dd[_0x8d58('0x2f')]=_[_0x8d58('0x43')](_0x42f4f1[_0x8d58('0x2f')]);_0x4782dd[_0x8d58('0x30')]=_[_0x8d58('0x31')](_0x4782dd[_0x8d58('0x32')],_0x4782dd[_0x8d58('0x2f')]);_0x1cc66b[_0x8d58('0x33')]=_[_0x8d58('0x31')](_0x4782dd['model'],qs['fields'](_0x42f4f1[_0x8d58('0x2f')][_0x8d58('0x34')]));_0x1cc66b['attributes']=_0x1cc66b['attributes'][_0x8d58('0x45')]?_0x1cc66b[_0x8d58('0x33')]:_0x4782dd['model'];if(_0x42f4f1[_0x8d58('0x2f')][_0x8d58('0x3e')]){_0x1cc66b[_0x8d58('0x46')]=[{'all':!![]}];}_0x1cc66b=_[_0x8d58('0x3b')]({},_0x1cc66b,_0x42f4f1['options']);return db[_0x8d58('0x3d')][_0x8d58('0x47')](_0x1cc66b)[_0x8d58('0x23')](handleEntityNotFound(_0x4453a6,null))['then'](respondWithResult(_0x4453a6,null))[_0x8d58('0x48')](handleError(_0x4453a6,null));};exports[_0x8d58('0x49')]=function(_0x3e357c,_0x462eb1){return db[_0x8d58('0x3d')][_0x8d58('0x49')](_0x3e357c[_0x8d58('0x4a')],{})[_0x8d58('0x23')](respondWithResult(_0x462eb1,0xc9))[_0x8d58('0x48')](handleError(_0x462eb1,null));};exports[_0x8d58('0x4b')]=function(_0x107eea,_0x2d13ac){if(_0x107eea[_0x8d58('0x4a')]['id']){delete _0x107eea['body']['id'];}return db[_0x8d58('0x3d')][_0x8d58('0x47')]({'where':{'id':_0x107eea['params']['id']}})['then'](handleEntityNotFound(_0x2d13ac,null))[_0x8d58('0x23')](saveUpdates(_0x107eea[_0x8d58('0x4a')],null))[_0x8d58('0x23')](respondWithResult(_0x2d13ac,null))[_0x8d58('0x48')](handleError(_0x2d13ac,null));};exports['download']=function(_0x5d9e79,_0x205010,_0x15f0e6){var _0x2b3820=require(_0x8d58('0x4c'));var _0x55b192=![];var _0x59c767={};if(_0x5d9e79[_0x8d58('0x2f')][_0x8d58('0x2d')]&&_0x5d9e79[_0x8d58('0x2f')][_0x8d58('0x2d')]===_0x8d58('0x4d')){_0x59c767[_0x8d58('0x4d')]=_0x5d9e79[_0x8d58('0x42')]['id'];}else{_0x59c767['id']=_0x5d9e79[_0x8d58('0x42')]['id'];}return db['SquareRecording'][_0x8d58('0x47')]({'where':_0x59c767,'attributes':['id',_0x8d58('0x4e'),_0x8d58('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x205010,null))[_0x8d58('0x23')](function(_0x1d1e12){if(_0x1d1e12){var _0x571e51=_0x1d1e12[_0x8d58('0x4e')];var _0x173e2b=util[_0x8d58('0x50')](_0x8d58('0x51'),_0x571e51);if(fs[_0x8d58('0x52')](_0x173e2b)){_0x55b192=!![];return _0x2b3820['decryptFile'](_0x173e2b,_0x571e51,config[_0x8d58('0x53')][_0x8d58('0x54')])[_0x8d58('0x23')](function(){return _0x1d1e12;});}return _0x1d1e12;}})[_0x8d58('0x23')](function(_0x3cfac2){if(_0x3cfac2){var _0x4636fb=_0x3cfac2[_0x8d58('0x4e')];if(!fs[_0x8d58('0x52')](_0x4636fb)){throw new db['Sequelize'][(_0x8d58('0x55'))](_0x8d58('0x56'));}if(_0x3cfac2['filename']){return _0x205010[_0x8d58('0x57')](_0x4636fb,_0x3cfac2[_0x8d58('0x4f')]+path[_0x8d58('0x58')](_0x4636fb),function(){if(_0x55b192){fs['unlink'](_0x4636fb);}});}else{return _0x205010[_0x8d58('0x57')](_0x4636fb,function(_0x24a37c){if(_0x55b192){fs[_0x8d58('0x59')](_0x4636fb);}});}}})['catch'](function(_0x37db03){if(_0x37db03['message']===_0x8d58('0x56')){_0x205010[_0x8d58('0x1b')](0x194)['send'](_0x8d58('0x5a'));}else{return handleError(_0x205010,null);}});};exports[_0x8d58('0x24')]=function(_0x401d02,_0x496a1e){return db[_0x8d58('0x3d')][_0x8d58('0x47')]({'where':{'id':_0x401d02[_0x8d58('0x42')]['id']}})[_0x8d58('0x23')](function(_0x3fe5d7){if(_[_0x8d58('0x5b')](_0x3fe5d7)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3fe5d7;})[_0x8d58('0x23')](function(_0x321d4b){var _0x37ad59=_0x321d4b['savePath'];logger[_0x8d58('0x5c')](_0x8d58('0x5d'),_0x37ad59);if(!_['isNil'](_0x321d4b[_0x8d58('0x4e')])&&fs['existsSync'](_0x37ad59)){logger[_0x8d58('0x5c')](_0x8d58('0x5e')+_0x37ad59+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x37ad59);}_0x37ad59=_0x37ad59+'.cypher';if(!_['isNil'](_0x321d4b[_0x8d58('0x4e')])&&fs['existsSync'](_0x37ad59)){logger[_0x8d58('0x5c')]('File:\x20\x22'+_0x37ad59+_0x8d58('0x5f'));fs[_0x8d58('0x60')](_0x37ad59);}return _0x321d4b;})[_0x8d58('0x23')](function(_0x9fe9ae){if(!_0x9fe9ae)throw new InternalError();return _0x9fe9ae[_0x8d58('0x24')]();})[_0x8d58('0x23')](function(){_0x496a1e[_0x8d58('0x1b')](0xcc)[_0x8d58('0x25')]();})[_0x8d58('0x48')](handleError(_0x496a1e,null));};
\ No newline at end of file
+var _0x21b3=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','SquareRecording','includeAll','include','findAll','rows','catch','show','find','create','body','download','../../components/encryptor','uniqueid','params','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','filename','extname','unlink','message','send','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse'];(function(_0x15c142,_0x53102c){var _0x8d26cd=function(_0x44aca6){while(--_0x44aca6){_0x15c142['push'](_0x15c142['shift']());}};_0x8d26cd(++_0x53102c);}(_0x21b3,0x11b));var _0x321b=function(_0x592cf8,_0x3e6e12){_0x592cf8=_0x592cf8-0x0;var _0x547790=_0x21b3[_0x592cf8];return _0x547790;};'use strict';var emlformat=require(_0x321b('0x0'));var rimraf=require(_0x321b('0x1'));var zipdir=require(_0x321b('0x2'));var jsonpatch=require(_0x321b('0x3'));var rp=require('request-promise');var moment=require(_0x321b('0x4'));var BPromise=require(_0x321b('0x5'));var Mustache=require('mustache');var util=require(_0x321b('0x6'));var path=require(_0x321b('0x7'));var sox=require(_0x321b('0x8'));var csv=require(_0x321b('0x9'));var ejs=require(_0x321b('0xa'));var fs=require('fs');var fs_extra=require(_0x321b('0xb'));var _=require(_0x321b('0xc'));var squel=require(_0x321b('0xd'));var crypto=require(_0x321b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x321b('0x9'));var querystring=require(_0x321b('0xf'));var Papa=require(_0x321b('0x10'));var Redis=require(_0x321b('0x11'));var authService=require(_0x321b('0x12'));var qs=require(_0x321b('0x13'));var as=require(_0x321b('0x14'));var hardwareService=require(_0x321b('0x15'));var logger=require('../../config/logger')(_0x321b('0x16'));var utils=require(_0x321b('0x17'));var config=require(_0x321b('0x18'));var licenseUtil=require(_0x321b('0x19'));var db=require(_0x321b('0x1a'))['db'];function respondWithStatusCode(_0x35c50d,_0x15a7cc){_0x15a7cc=_0x15a7cc||0xcc;return function(_0x53ace7){if(_0x53ace7){return _0x35c50d[_0x321b('0x1b')](_0x15a7cc);}return _0x35c50d['status'](_0x15a7cc)[_0x321b('0x1c')]();};}function respondWithResult(_0x121eae,_0x30a08e){_0x30a08e=_0x30a08e||0xc8;return function(_0x1e9cbb){if(_0x1e9cbb){return _0x121eae['status'](_0x30a08e)[_0x321b('0x1d')](_0x1e9cbb);}};}function respondWithFilteredResult(_0x1afc1f,_0x201653){return function(_0x2d011f){if(_0x2d011f){var _0x5763b8=typeof _0x201653[_0x321b('0x1e')]===_0x321b('0x1f')&&typeof _0x201653[_0x321b('0x20')]===_0x321b('0x1f');var _0x1f9110=_0x2d011f['count'];var _0x4eb8a0=_0x5763b8?0x0:_0x201653[_0x321b('0x1e')];var _0x479fe8=_0x5763b8?_0x2d011f[_0x321b('0x21')]:_0x201653['offset']+_0x201653[_0x321b('0x20')];var _0x1bfca5;if(_0x479fe8>=_0x1f9110){_0x479fe8=_0x1f9110;_0x1bfca5=0xc8;}else{_0x1bfca5=0xce;}_0x1afc1f[_0x321b('0x22')](_0x1bfca5);return _0x1afc1f[_0x321b('0x23')]('Content-Range',_0x4eb8a0+'-'+_0x479fe8+'/'+_0x1f9110)[_0x321b('0x1d')](_0x2d011f);}return null;};}function patchUpdates(_0xc893d3){return function(_0x5e460c){try{jsonpatch['apply'](_0x5e460c,_0xc893d3,!![]);}catch(_0x5033ec){return BPromise[_0x321b('0x24')](_0x5033ec);}return _0x5e460c[_0x321b('0x25')]();};}function saveUpdates(_0x5e97e5,_0x9549b6){return function(_0x563b04){if(_0x563b04){return _0x563b04[_0x321b('0x26')](_0x5e97e5)[_0x321b('0x27')](function(_0x26875a){return _0x26875a;});}return null;};}function removeEntity(_0x44aaed,_0x273224){return function(_0x19bb24){if(_0x19bb24){return _0x19bb24[_0x321b('0x28')]()[_0x321b('0x27')](function(){_0x44aaed[_0x321b('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5939ed,_0x355122){return function(_0xab3225){if(!_0xab3225){_0x5939ed[_0x321b('0x1b')](0x194);}return _0xab3225;};}function handleError(_0x20e196,_0x4f8e38){_0x4f8e38=_0x4f8e38||0x1f4;return function(_0x1db369){logger[_0x321b('0x29')](_0x1db369['stack']);if(_0x1db369[_0x321b('0x2a')]){delete _0x1db369[_0x321b('0x2a')];}_0x20e196[_0x321b('0x22')](_0x4f8e38)['send'](_0x1db369);};}exports[_0x321b('0x2b')]=function(_0x2e0568,_0x41998a){var _0x4694f7={},_0x10a674={},_0xd36f2f={'count':0x0,'rows':[]};var _0x501583=_[_0x321b('0x2c')](db['SquareRecording'][_0x321b('0x2d')],function(_0x51c0e8){return{'name':_0x51c0e8[_0x321b('0x2e')],'type':_0x51c0e8[_0x321b('0x2f')][_0x321b('0x30')]};});_0x10a674[_0x321b('0x31')]=_[_0x321b('0x2c')](_0x501583,'name');_0x10a674[_0x321b('0x32')]=_[_0x321b('0x33')](_0x2e0568[_0x321b('0x32')]);_0x10a674['filters']=_['intersection'](_0x10a674['model'],_0x10a674[_0x321b('0x32')]);_0x4694f7[_0x321b('0x34')]=_[_0x321b('0x35')](_0x10a674[_0x321b('0x31')],qs['fields'](_0x2e0568[_0x321b('0x32')][_0x321b('0x36')]));_0x4694f7[_0x321b('0x34')]=_0x4694f7[_0x321b('0x34')][_0x321b('0x37')]?_0x4694f7['attributes']:_0x10a674[_0x321b('0x31')];if(!_0x2e0568[_0x321b('0x32')]['hasOwnProperty']('nolimit')){_0x4694f7[_0x321b('0x20')]=qs[_0x321b('0x20')](_0x2e0568[_0x321b('0x32')][_0x321b('0x20')]);_0x4694f7[_0x321b('0x1e')]=qs[_0x321b('0x1e')](_0x2e0568[_0x321b('0x32')][_0x321b('0x1e')]);}_0x4694f7[_0x321b('0x38')]=qs[_0x321b('0x39')](_0x2e0568[_0x321b('0x32')][_0x321b('0x39')]);_0x4694f7[_0x321b('0x3a')]=qs[_0x321b('0x3b')](_[_0x321b('0x3c')](_0x2e0568[_0x321b('0x32')],_0x10a674[_0x321b('0x3b')]),_0x501583);if(_0x2e0568[_0x321b('0x32')]['filter']){_0x4694f7['where']=_[_0x321b('0x3d')](_0x4694f7[_0x321b('0x3a')],{'$or':_['map'](_0x501583,function(_0x4bea7f){if(_0x4bea7f[_0x321b('0x2f')]!==_0x321b('0x3e')){var _0x2073ee={};_0x2073ee[_0x4bea7f[_0x321b('0x2a')]]={'$like':'%'+_0x2e0568[_0x321b('0x32')][_0x321b('0x3f')]+'%'};return _0x2073ee;}})});}_0x4694f7=_['merge']({},_0x4694f7,_0x2e0568[_0x321b('0x40')]);var _0x407c32={'where':_0x4694f7[_0x321b('0x3a')]};return db[_0x321b('0x41')]['count'](_0x407c32)[_0x321b('0x27')](function(_0x2cf98d){_0xd36f2f['count']=_0x2cf98d;if(_0x2e0568[_0x321b('0x32')][_0x321b('0x42')]){_0x4694f7[_0x321b('0x43')]=[{'all':!![]}];}return db[_0x321b('0x41')][_0x321b('0x44')](_0x4694f7);})[_0x321b('0x27')](function(_0x4c67fc){_0xd36f2f[_0x321b('0x45')]=_0x4c67fc;return _0xd36f2f;})['then'](respondWithFilteredResult(_0x41998a,_0x4694f7))[_0x321b('0x46')](handleError(_0x41998a,null));};exports[_0x321b('0x47')]=function(_0x12320b,_0x619294){var _0x2dfcad={'raw':!![],'where':{'id':_0x12320b['params']['id']}},_0x393ba5={};_0x393ba5[_0x321b('0x31')]=_['keys'](db[_0x321b('0x41')]['rawAttributes']);_0x393ba5[_0x321b('0x32')]=_[_0x321b('0x33')](_0x12320b[_0x321b('0x32')]);_0x393ba5[_0x321b('0x3b')]=_['intersection'](_0x393ba5[_0x321b('0x31')],_0x393ba5[_0x321b('0x32')]);_0x2dfcad['attributes']=_['intersection'](_0x393ba5[_0x321b('0x31')],qs['fields'](_0x12320b[_0x321b('0x32')]['fields']));_0x2dfcad[_0x321b('0x34')]=_0x2dfcad[_0x321b('0x34')][_0x321b('0x37')]?_0x2dfcad[_0x321b('0x34')]:_0x393ba5[_0x321b('0x31')];if(_0x12320b[_0x321b('0x32')][_0x321b('0x42')]){_0x2dfcad[_0x321b('0x43')]=[{'all':!![]}];}_0x2dfcad=_[_0x321b('0x3d')]({},_0x2dfcad,_0x12320b['options']);return db[_0x321b('0x41')][_0x321b('0x48')](_0x2dfcad)[_0x321b('0x27')](handleEntityNotFound(_0x619294,null))['then'](respondWithResult(_0x619294,null))[_0x321b('0x46')](handleError(_0x619294,null));};exports[_0x321b('0x49')]=function(_0x29ad11,_0x4e2bff){return db['SquareRecording'][_0x321b('0x49')](_0x29ad11[_0x321b('0x4a')],{})[_0x321b('0x27')](respondWithResult(_0x4e2bff,0xc9))['catch'](handleError(_0x4e2bff,null));};exports[_0x321b('0x26')]=function(_0x2b2517,_0x111644){if(_0x2b2517[_0x321b('0x4a')]['id']){delete _0x2b2517[_0x321b('0x4a')]['id'];}return db['SquareRecording'][_0x321b('0x48')]({'where':{'id':_0x2b2517['params']['id']}})[_0x321b('0x27')](handleEntityNotFound(_0x111644,null))[_0x321b('0x27')](saveUpdates(_0x2b2517[_0x321b('0x4a')],null))[_0x321b('0x27')](respondWithResult(_0x111644,null))['catch'](handleError(_0x111644,null));};exports[_0x321b('0x4b')]=function(_0xe1d036,_0x35058c,_0x1b3d4d){var _0x55f207=require(_0x321b('0x4c'));var _0x2e835a=![];var _0x37f20e={};if(_0xe1d036['query'][_0x321b('0x2f')]&&_0xe1d036['query'][_0x321b('0x2f')]===_0x321b('0x4d')){_0x37f20e[_0x321b('0x4d')]=_0xe1d036[_0x321b('0x4e')]['id'];}else{_0x37f20e['id']=_0xe1d036['params']['id'];}return db['SquareRecording'][_0x321b('0x48')]({'where':_0x37f20e,'attributes':['id',_0x321b('0x4f'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x35058c,null))[_0x321b('0x27')](function(_0x58393e){if(_0x58393e){var _0x3f7d7e=_0x58393e[_0x321b('0x4f')];var _0x213ad6=util[_0x321b('0x50')](_0x321b('0x51'),_0x3f7d7e);if(fs[_0x321b('0x52')](_0x213ad6)){_0x2e835a=!![];return _0x55f207[_0x321b('0x53')](_0x213ad6,_0x3f7d7e,config[_0x321b('0x54')][_0x321b('0x55')])[_0x321b('0x27')](function(){return _0x58393e;});}return _0x58393e;}})[_0x321b('0x27')](function(_0x36b768){if(_0x36b768){var _0x126772=_0x36b768[_0x321b('0x4f')];if(!fs[_0x321b('0x52')](_0x126772)){throw new db[(_0x321b('0x56'))]['ValidationError'](_0x321b('0x57'));}if(_0x36b768[_0x321b('0x58')]){return _0x35058c[_0x321b('0x4b')](_0x126772,_0x36b768[_0x321b('0x58')]+path[_0x321b('0x59')](_0x126772),function(){if(_0x2e835a){fs[_0x321b('0x5a')](_0x126772);}});}else{return _0x35058c['download'](_0x126772,function(_0x4a2d2b){if(_0x2e835a){fs['unlink'](_0x126772);}});}}})[_0x321b('0x46')](function(_0x219935){if(_0x219935[_0x321b('0x5b')]==='SquareRecording\x20not\x20found'){_0x35058c[_0x321b('0x22')](0x194)[_0x321b('0x5c')]('Not\x20found');}else{return handleError(_0x35058c,null);}});};exports[_0x321b('0x28')]=function(_0x29ff20,_0x47d1a6){return db[_0x321b('0x41')][_0x321b('0x48')]({'where':{'id':_0x29ff20[_0x321b('0x4e')]['id']}})[_0x321b('0x27')](function(_0x23c11b){if(_[_0x321b('0x5d')](_0x23c11b)){throw new ReferenceError('Entity\x20not\x20found');}return _0x23c11b;})[_0x321b('0x27')](function(_0x7298a0){var _0x41b19c=_0x7298a0[_0x321b('0x4f')];logger[_0x321b('0x5e')](_0x321b('0x5f'),_0x41b19c);if(!_[_0x321b('0x5d')](_0x7298a0[_0x321b('0x4f')])&&fs['existsSync'](_0x41b19c)){logger['info'](_0x321b('0x60')+_0x41b19c+_0x321b('0x61'));fs['unlinkSync'](_0x41b19c);}_0x41b19c=_0x41b19c+_0x321b('0x62');if(!_['isNil'](_0x7298a0[_0x321b('0x4f')])&&fs[_0x321b('0x52')](_0x41b19c)){logger[_0x321b('0x5e')]('File:\x20\x22'+_0x41b19c+_0x321b('0x61'));fs[_0x321b('0x63')](_0x41b19c);}return _0x7298a0;})[_0x321b('0x27')](function(_0x4bd477){if(!_0x4bd477)throw new InternalError();return _0x4bd477[_0x321b('0x28')]();})[_0x321b('0x27')](function(){_0x47d1a6['status'](0xcc)['end']();})[_0x321b('0x46')](handleError(_0x47d1a6,null));};
\ No newline at end of file
index 6263631..687e8dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2087=['square_recordings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','SquareRecording'];(function(_0x1452af,_0x21d2e1){var _0xdd46f4=function(_0x7bc5e6){while(--_0x7bc5e6){_0x1452af['push'](_0x1452af['shift']());}};_0xdd46f4(++_0x21d2e1);}(_0x2087,0xf3));var _0x7208=function(_0x3b44b3,_0x3f62a0){_0x3b44b3=_0x3b44b3-0x0;var _0x952c11=_0x2087[_0x3b44b3];return _0x952c11;};'use strict';var _=require(_0x7208('0x0'));var util=require(_0x7208('0x1'));var logger=require(_0x7208('0x2'))(_0x7208('0x3'));var moment=require('moment');var BPromise=require(_0x7208('0x4'));var rp=require(_0x7208('0x5'));var fs=require('fs');var path=require(_0x7208('0x6'));var rimraf=require(_0x7208('0x7'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0x7208('0x8')]=function(_0x5cc93f,_0x3c7d9d){return _0x5cc93f['define'](_0x7208('0x9'),attributes,{'tableName':_0x7208('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7374=['SquareRecording','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0x30de8a,_0x37c08f){var _0x366468=function(_0x231595){while(--_0x231595){_0x30de8a['push'](_0x30de8a['shift']());}};_0x366468(++_0x37c08f);}(_0x7374,0x1b9));var _0x4737=function(_0x48fea0,_0x5c92a2){_0x48fea0=_0x48fea0-0x0;var _0x32143a=_0x7374[_0x48fea0];return _0x32143a;};'use strict';var _=require(_0x4737('0x0'));var util=require(_0x4737('0x1'));var logger=require(_0x4737('0x2'))(_0x4737('0x3'));var moment=require(_0x4737('0x4'));var BPromise=require('bluebird');var rp=require(_0x4737('0x5'));var fs=require('fs');var path=require(_0x4737('0x6'));var rimraf=require(_0x4737('0x7'));var config=require(_0x4737('0x8'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x162bf0,_0xc35930){return _0x162bf0[_0x4737('0x9')](_0x4737('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 23fbaf6..dd4b8c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cc6=['raw','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','result','CreateSquareRecording','SquareRecording','create','body','options'];(function(_0x3b0a54,_0xbe0c37){var _0x5fffbf=function(_0x111940){while(--_0x111940){_0x3b0a54['push'](_0x3b0a54['shift']());}};_0x5fffbf(++_0xbe0c37);}(_0x3cc6,0x191));var _0x63cc=function(_0x3063e,_0x3a3ca2){_0x3063e=_0x3063e-0x0;var _0x2ae708=_0x3cc6[_0x3063e];return _0x2ae708;};'use strict';var _=require(_0x63cc('0x0'));var util=require(_0x63cc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x63cc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63cc('0x3'))['db'];var utils=require(_0x63cc('0x4'));var logger=require(_0x63cc('0x5'))(_0x63cc('0x6'));var config=require('../../config/environment');var jayson=require(_0x63cc('0x7'));var client=jayson[_0x63cc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29cd06,_0x1eea87,_0x17f138){return new BPromise(function(_0xf7927a,_0xd7bbd1){return client[_0x63cc('0x9')](_0x29cd06,_0x17f138)[_0x63cc('0xa')](function(_0x2c5aad){logger[_0x63cc('0xb')](_0x63cc('0xc'),_0x1eea87,_0x63cc('0xd'));logger[_0x63cc('0xe')](_0x63cc('0xf'),_0x1eea87,_0x63cc('0xd'),JSON['stringify'](_0x2c5aad));if(_0x2c5aad['error']){if(_0x2c5aad[_0x63cc('0x10')]['code']===0x1f4){logger[_0x63cc('0x10')]('SquareRecording,\x20%s,\x20%s',_0x1eea87,_0x2c5aad[_0x63cc('0x10')][_0x63cc('0x11')]);return _0xd7bbd1(_0x2c5aad['error']['message']);}logger[_0x63cc('0x10')](_0x63cc('0xc'),_0x1eea87,_0x2c5aad['error'][_0x63cc('0x11')]);return _0xf7927a(_0x2c5aad[_0x63cc('0x10')]['message']);}else{logger[_0x63cc('0xb')]('SquareRecording,\x20%s,\x20%s',_0x1eea87,_0x63cc('0xd'));_0xf7927a(_0x2c5aad[_0x63cc('0x12')][_0x63cc('0x11')]);}})['catch'](function(_0x2bcbd9){logger[_0x63cc('0x10')](_0x63cc('0xc'),_0x1eea87,_0x2bcbd9);_0xd7bbd1(_0x2bcbd9);});});}exports[_0x63cc('0x13')]=function(_0x31b167){var _0x526495=this;return new Promise(function(_0x842db6,_0x5934a2){return db[_0x63cc('0x14')][_0x63cc('0x15')](_0x31b167[_0x63cc('0x16')],{'raw':_0x31b167[_0x63cc('0x17')]?_0x31b167[_0x63cc('0x17')][_0x63cc('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0xacb99f){logger['info'](_0x63cc('0x13'),_0x31b167);logger[_0x63cc('0xe')]('CreateSquareRecording',_0x31b167,JSON['stringify'](_0xacb99f));_0x842db6(_0xacb99f);})['catch'](function(_0x4e35e1){logger[_0x63cc('0x10')]('CreateSquareRecording',_0x4e35e1[_0x63cc('0x11')],_0x31b167);_0x5934a2(_0x526495[_0x63cc('0x10')](0x1f4,_0x4e35e1[_0x63cc('0x11')]));});});};
\ No newline at end of file
+var _0xc9bf=['error','message','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xc9bf,0x159));var _0xfc9b=function(_0x3c3f11,_0x45368d){_0x3c3f11=_0x3c3f11-0x0;var _0x390f9d=_0xc9bf[_0x3c3f11];return _0x390f9d;};'use strict';var _=require(_0xfc9b('0x0'));var util=require(_0xfc9b('0x1'));var moment=require(_0xfc9b('0x2'));var BPromise=require(_0xfc9b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc9b('0x4'));var db=require(_0xfc9b('0x5'))['db'];var utils=require(_0xfc9b('0x6'));var logger=require(_0xfc9b('0x7'))(_0xfc9b('0x8'));var config=require(_0xfc9b('0x9'));var jayson=require(_0xfc9b('0xa'));var client=jayson[_0xfc9b('0xb')][_0xfc9b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6895e2,_0x5d6db8,_0xa52a90){return new BPromise(function(_0x59854a,_0x6f606e){return client['request'](_0x6895e2,_0xa52a90)[_0xfc9b('0xd')](function(_0x30e458){logger[_0xfc9b('0xe')](_0xfc9b('0xf'),_0x5d6db8,_0xfc9b('0x10'));logger[_0xfc9b('0x11')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x5d6db8,_0xfc9b('0x10'),JSON[_0xfc9b('0x12')](_0x30e458));if(_0x30e458[_0xfc9b('0x13')]){if(_0x30e458['error']['code']===0x1f4){logger[_0xfc9b('0x13')](_0xfc9b('0xf'),_0x5d6db8,_0x30e458['error'][_0xfc9b('0x14')]);return _0x6f606e(_0x30e458[_0xfc9b('0x13')][_0xfc9b('0x14')]);}logger[_0xfc9b('0x13')](_0xfc9b('0xf'),_0x5d6db8,_0x30e458[_0xfc9b('0x13')]['message']);return _0x59854a(_0x30e458['error'][_0xfc9b('0x14')]);}else{logger[_0xfc9b('0xe')]('SquareRecording,\x20%s,\x20%s',_0x5d6db8,_0xfc9b('0x10'));_0x59854a(_0x30e458['result'][_0xfc9b('0x14')]);}})[_0xfc9b('0x15')](function(_0x3185fe){logger[_0xfc9b('0x13')]('SquareRecording,\x20%s,\x20%s',_0x5d6db8,_0x3185fe);_0x6f606e(_0x3185fe);});});}exports[_0xfc9b('0x16')]=function(_0x44e6e5){var _0xb9eaba=this;return new Promise(function(_0x1ccb8c,_0x3b3feb){return db[_0xfc9b('0x17')][_0xfc9b('0x18')](_0x44e6e5[_0xfc9b('0x19')],{'raw':_0x44e6e5[_0xfc9b('0x1a')]?_0x44e6e5[_0xfc9b('0x1a')][_0xfc9b('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x5e0d25){logger['info']('CreateSquareRecording',_0x44e6e5);logger[_0xfc9b('0x11')](_0xfc9b('0x16'),_0x44e6e5,JSON['stringify'](_0x5e0d25));_0x1ccb8c(_0x5e0d25);})['catch'](function(_0x4ad0d4){logger[_0xfc9b('0x13')](_0xfc9b('0x16'),_0x4ad0d4[_0xfc9b('0x14')],_0x44e6e5);_0x3b3feb(_0xb9eaba[_0xfc9b('0x13')](0x1f4,_0x4ad0d4[_0xfc9b('0x14')]));});});};
\ No newline at end of file
index e3f3dd7..513daf0 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(_0x15c5ff,_0x501524){var _0x395d33=function(_0x4e80c8){while(--_0x4e80c8){_0x15c5ff['push'](_0x15c5ff['shift']());}};_0x395d33(++_0x501524);}(_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(_0x41360f,_0x7d8652){var _0x5a6a4c=function(_0x2eb599){while(--_0x2eb599){_0x41360f['push'](_0x41360f['shift']());}};_0x5a6a4c(++_0x7d8652);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router;
\ No newline at end of file
index 6a2c38e..5c152ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4222=['BOOLEAN','sequelize','STRING','DATE'];(function(_0x2ddce7,_0x5e5d9f){var _0x454a43=function(_0x425834){while(--_0x425834){_0x2ddce7['push'](_0x2ddce7['shift']());}};_0x454a43(++_0x5e5d9f);}(_0x4222,0x105));var _0x2422=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x4222[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require(_0x2422('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x2422('0x1')]},'request':{'type':Sequelize[_0x2422('0x1')]},'channel':{'type':Sequelize[_0x2422('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2422('0x1')]},'uniqueid':{'type':Sequelize[_0x2422('0x1')]},'version':{'type':Sequelize[_0x2422('0x1')]},'callerid':{'type':Sequelize[_0x2422('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x2422('0x1')]},'callingani2':{'type':Sequelize[_0x2422('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x2422('0x1')]},'dnid':{'type':Sequelize[_0x2422('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2422('0x1')]},'extension':{'type':Sequelize[_0x2422('0x1')]},'priority':{'type':Sequelize[_0x2422('0x1')]},'enhanced':{'type':Sequelize[_0x2422('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x2422('0x1')]},'project_name':{'type':Sequelize[_0x2422('0x1')]},'joinAt':{'type':Sequelize[_0x2422('0x2')]},'leaveAt':{'type':Sequelize[_0x2422('0x2')]},'bot':{'type':Sequelize[_0x2422('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6826=['sequelize','STRING','DATE'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x6826,0x75));var _0x6682=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0x6826[_0x136a0d];return _0x212ea5;};'use strict';var Sequelize=require(_0x6682('0x0'));module['exports']={'network':{'type':Sequelize[_0x6682('0x1')]},'network_script':{'type':Sequelize[_0x6682('0x1')]},'request':{'type':Sequelize[_0x6682('0x1')]},'channel':{'type':Sequelize[_0x6682('0x1')]},'language':{'type':Sequelize[_0x6682('0x1')]},'type':{'type':Sequelize[_0x6682('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x6682('0x1')]},'calleridname':{'type':Sequelize[_0x6682('0x1')]},'callingpres':{'type':Sequelize[_0x6682('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x6682('0x1')]},'callingtns':{'type':Sequelize[_0x6682('0x1')]},'dnid':{'type':Sequelize[_0x6682('0x1')]},'rdnis':{'type':Sequelize[_0x6682('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x6682('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x6682('0x1')]},'accountcode':{'type':Sequelize[_0x6682('0x1')]},'threadid':{'type':Sequelize[_0x6682('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6682('0x2')]},'leaveAt':{'type':Sequelize[_0x6682('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 9fa7029..fa25dc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0609=['includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','reject','save','then','error','name','send','map','SquareReport','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','rows','catch','show','params','length'];(function(_0x2d2201,_0x3cfe3d){var _0x12e6cd=function(_0x5e4cf6){while(--_0x5e4cf6){_0x2d2201['push'](_0x2d2201['shift']());}};_0x12e6cd(++_0x3cfe3d);}(_0x0609,0xde));var _0x9060=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x0609[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0x9060('0x0'));var rimraf=require(_0x9060('0x1'));var zipdir=require(_0x9060('0x2'));var jsonpatch=require(_0x9060('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9060('0x4'));var Mustache=require(_0x9060('0x5'));var util=require(_0x9060('0x6'));var path=require(_0x9060('0x7'));var sox=require(_0x9060('0x8'));var csv=require(_0x9060('0x9'));var ejs=require(_0x9060('0xa'));var fs=require('fs');var fs_extra=require(_0x9060('0xb'));var _=require(_0x9060('0xc'));var squel=require(_0x9060('0xd'));var crypto=require(_0x9060('0xe'));var jsforce=require(_0x9060('0xf'));var deskjs=require(_0x9060('0x10'));var toCsv=require(_0x9060('0x9'));var querystring=require(_0x9060('0x11'));var Papa=require(_0x9060('0x12'));var Redis=require(_0x9060('0x13'));var authService=require(_0x9060('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9060('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9060('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9060('0x17'));var db=require(_0x9060('0x18'))['db'];function respondWithStatusCode(_0x43b659,_0x25b143){_0x25b143=_0x25b143||0xcc;return function(_0x1e82fc){if(_0x1e82fc){return _0x43b659[_0x9060('0x19')](_0x25b143);}return _0x43b659['status'](_0x25b143)[_0x9060('0x1a')]();};}function respondWithResult(_0x3968b8,_0x3c666c){_0x3c666c=_0x3c666c||0xc8;return function(_0x4889e0){if(_0x4889e0){return _0x3968b8[_0x9060('0x1b')](_0x3c666c)[_0x9060('0x1c')](_0x4889e0);}};}function respondWithFilteredResult(_0x48fef8,_0x57da9b){return function(_0x5574f9){if(_0x5574f9){var _0x35f2d7=typeof _0x57da9b[_0x9060('0x1d')]==='undefined'&&typeof _0x57da9b[_0x9060('0x1e')]==='undefined';var _0x1539cd=_0x5574f9['count'];var _0x2df5ab=_0x35f2d7?0x0:_0x57da9b[_0x9060('0x1d')];var _0x4c28ab=_0x35f2d7?_0x5574f9['count']:_0x57da9b[_0x9060('0x1d')]+_0x57da9b[_0x9060('0x1e')];var _0x3bd1db;if(_0x4c28ab>=_0x1539cd){_0x4c28ab=_0x1539cd;_0x3bd1db=0xc8;}else{_0x3bd1db=0xce;}_0x48fef8['status'](_0x3bd1db);return _0x48fef8['set'](_0x9060('0x1f'),_0x2df5ab+'-'+_0x4c28ab+'/'+_0x1539cd)[_0x9060('0x1c')](_0x5574f9);}return null;};}function patchUpdates(_0x4aee89){return function(_0x35fe4b){try{jsonpatch['apply'](_0x35fe4b,_0x4aee89,!![]);}catch(_0x399751){return BPromise[_0x9060('0x20')](_0x399751);}return _0x35fe4b[_0x9060('0x21')]();};}function saveUpdates(_0x49e7c3,_0x1f41e4){return function(_0x13c262){if(_0x13c262){return _0x13c262['update'](_0x49e7c3)[_0x9060('0x22')](function(_0x43ada2){return _0x43ada2;});}return null;};}function removeEntity(_0xe73f36,_0x2fbbe1){return function(_0x309c01){if(_0x309c01){return _0x309c01['destroy']()[_0x9060('0x22')](function(){_0xe73f36[_0x9060('0x1b')](0xcc)[_0x9060('0x1a')]();});}};}function handleEntityNotFound(_0x407804,_0x52394a){return function(_0x124c8b){if(!_0x124c8b){_0x407804['sendStatus'](0x194);}return _0x124c8b;};}function handleError(_0x998c47,_0x5b1005){_0x5b1005=_0x5b1005||0x1f4;return function(_0x106573){logger[_0x9060('0x23')](_0x106573['stack']);if(_0x106573[_0x9060('0x24')]){delete _0x106573[_0x9060('0x24')];}_0x998c47[_0x9060('0x1b')](_0x5b1005)[_0x9060('0x25')](_0x106573);};}exports['index']=function(_0x3957d2,_0x41ed91){var _0x57b7ad={},_0xa5bff3={},_0x4b5625={'count':0x0,'rows':[]};var _0x417708=_[_0x9060('0x26')](db[_0x9060('0x27')][_0x9060('0x28')],function(_0xdeb88){return{'name':_0xdeb88['fieldName'],'type':_0xdeb88['type'][_0x9060('0x29')]};});_0xa5bff3['model']=_[_0x9060('0x26')](_0x417708,'name');_0xa5bff3[_0x9060('0x2a')]=_[_0x9060('0x2b')](_0x3957d2[_0x9060('0x2a')]);_0xa5bff3[_0x9060('0x2c')]=_[_0x9060('0x2d')](_0xa5bff3[_0x9060('0x2e')],_0xa5bff3[_0x9060('0x2a')]);_0x57b7ad[_0x9060('0x2f')]=_[_0x9060('0x2d')](_0xa5bff3[_0x9060('0x2e')],qs['fields'](_0x3957d2[_0x9060('0x2a')][_0x9060('0x30')]));_0x57b7ad[_0x9060('0x2f')]=_0x57b7ad[_0x9060('0x2f')]['length']?_0x57b7ad[_0x9060('0x2f')]:_0xa5bff3[_0x9060('0x2e')];if(!_0x3957d2[_0x9060('0x2a')]['hasOwnProperty']('nolimit')){_0x57b7ad['limit']=qs['limit'](_0x3957d2[_0x9060('0x2a')][_0x9060('0x1e')]);_0x57b7ad[_0x9060('0x1d')]=qs[_0x9060('0x1d')](_0x3957d2[_0x9060('0x2a')]['offset']);}_0x57b7ad[_0x9060('0x31')]=qs[_0x9060('0x32')](_0x3957d2[_0x9060('0x2a')]['sort']);_0x57b7ad[_0x9060('0x33')]=qs[_0x9060('0x2c')](_[_0x9060('0x34')](_0x3957d2[_0x9060('0x2a')],_0xa5bff3[_0x9060('0x2c')]),_0x417708);if(_0x3957d2[_0x9060('0x2a')][_0x9060('0x35')]){_0x57b7ad[_0x9060('0x33')]=_[_0x9060('0x36')](_0x57b7ad['where'],{'$or':_[_0x9060('0x26')](_0x417708,function(_0x749e40){if(_0x749e40[_0x9060('0x37')]!==_0x9060('0x38')){var _0x5b22ac={};_0x5b22ac[_0x749e40[_0x9060('0x24')]]={'$like':'%'+_0x3957d2[_0x9060('0x2a')]['filter']+'%'};return _0x5b22ac;}})});}_0x57b7ad=_['merge']({},_0x57b7ad,_0x3957d2[_0x9060('0x39')]);var _0x2a0abf={'where':_0x57b7ad[_0x9060('0x33')]};return db['SquareReport'][_0x9060('0x3a')](_0x2a0abf)[_0x9060('0x22')](function(_0x1420e4){_0x4b5625[_0x9060('0x3a')]=_0x1420e4;if(_0x3957d2[_0x9060('0x2a')]['includeAll']){_0x57b7ad[_0x9060('0x3b')]=[{'all':!![]}];}return db[_0x9060('0x27')][_0x9060('0x3c')](_0x57b7ad);})['then'](function(_0x1066d1){_0x4b5625[_0x9060('0x3d')]=_0x1066d1;return _0x4b5625;})[_0x9060('0x22')](respondWithFilteredResult(_0x41ed91,_0x57b7ad))[_0x9060('0x3e')](handleError(_0x41ed91,null));};exports[_0x9060('0x3f')]=function(_0x1c40ca,_0x49c6be){var _0x4bdda0={'raw':!![],'where':{'id':_0x1c40ca[_0x9060('0x40')]['id']}},_0x2b9ad1={};_0x2b9ad1[_0x9060('0x2e')]=_['keys'](db[_0x9060('0x27')][_0x9060('0x28')]);_0x2b9ad1[_0x9060('0x2a')]=_[_0x9060('0x2b')](_0x1c40ca[_0x9060('0x2a')]);_0x2b9ad1[_0x9060('0x2c')]=_[_0x9060('0x2d')](_0x2b9ad1[_0x9060('0x2e')],_0x2b9ad1[_0x9060('0x2a')]);_0x4bdda0[_0x9060('0x2f')]=_[_0x9060('0x2d')](_0x2b9ad1[_0x9060('0x2e')],qs[_0x9060('0x30')](_0x1c40ca['query'][_0x9060('0x30')]));_0x4bdda0[_0x9060('0x2f')]=_0x4bdda0[_0x9060('0x2f')][_0x9060('0x41')]?_0x4bdda0['attributes']:_0x2b9ad1[_0x9060('0x2e')];if(_0x1c40ca[_0x9060('0x2a')][_0x9060('0x42')]){_0x4bdda0[_0x9060('0x3b')]=[{'all':!![]}];}_0x4bdda0=_[_0x9060('0x36')]({},_0x4bdda0,_0x1c40ca[_0x9060('0x39')]);return db['SquareReport'][_0x9060('0x43')](_0x4bdda0)[_0x9060('0x22')](handleEntityNotFound(_0x49c6be,null))[_0x9060('0x22')](respondWithResult(_0x49c6be,null))[_0x9060('0x3e')](handleError(_0x49c6be,null));};exports[_0x9060('0x44')]=function(_0x1b3803,_0x3a8b9b){return db[_0x9060('0x27')][_0x9060('0x44')](_0x1b3803[_0x9060('0x45')],{})[_0x9060('0x22')](respondWithResult(_0x3a8b9b,0xc9))[_0x9060('0x3e')](handleError(_0x3a8b9b,null));};exports[_0x9060('0x46')]=function(_0x68c5cb,_0x2e1fec){if(_0x68c5cb[_0x9060('0x45')]['id']){delete _0x68c5cb[_0x9060('0x45')]['id'];}return db[_0x9060('0x27')]['find']({'where':{'id':_0x68c5cb[_0x9060('0x40')]['id']}})['then'](handleEntityNotFound(_0x2e1fec,null))[_0x9060('0x22')](saveUpdates(_0x68c5cb[_0x9060('0x45')],null))['then'](respondWithResult(_0x2e1fec,null))[_0x9060('0x3e')](handleError(_0x2e1fec,null));};exports['destroy']=function(_0x243f4b,_0x1e9a46){return db[_0x9060('0x27')]['find']({'where':{'id':_0x243f4b[_0x9060('0x40')]['id']}})['then'](handleEntityNotFound(_0x1e9a46,null))[_0x9060('0x22')](removeEntity(_0x1e9a46,null))[_0x9060('0x3e')](handleError(_0x1e9a46,null));};exports[_0x9060('0x47')]=function(_0xda4a17,_0x4cd1d5){return db[_0x9060('0x27')][_0x9060('0x47')]()[_0x9060('0x22')](respondWithResult(_0x4cd1d5,null))[_0x9060('0x3e')](handleError(_0x4cd1d5,null));};
\ No newline at end of file
+var _0xb7b6=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','find','destroy','describe','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','SquareReport','rawAttributes','fieldName','model','query','keys','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7b6,0xbc));var _0x6b7b=function(_0x120e0a,_0x2967de){_0x120e0a=_0x120e0a-0x0;var _0x48adb9=_0xb7b6[_0x120e0a];return _0x48adb9;};'use strict';var emlformat=require(_0x6b7b('0x0'));var rimraf=require(_0x6b7b('0x1'));var zipdir=require(_0x6b7b('0x2'));var jsonpatch=require(_0x6b7b('0x3'));var rp=require(_0x6b7b('0x4'));var moment=require(_0x6b7b('0x5'));var BPromise=require(_0x6b7b('0x6'));var Mustache=require(_0x6b7b('0x7'));var util=require(_0x6b7b('0x8'));var path=require(_0x6b7b('0x9'));var sox=require(_0x6b7b('0xa'));var csv=require(_0x6b7b('0xb'));var ejs=require(_0x6b7b('0xc'));var fs=require('fs');var fs_extra=require(_0x6b7b('0xd'));var _=require(_0x6b7b('0xe'));var squel=require('squel');var crypto=require(_0x6b7b('0xf'));var jsforce=require(_0x6b7b('0x10'));var deskjs=require(_0x6b7b('0x11'));var toCsv=require(_0x6b7b('0xb'));var querystring=require(_0x6b7b('0x12'));var Papa=require('papaparse');var Redis=require(_0x6b7b('0x13'));var authService=require(_0x6b7b('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6b7b('0x15'));var hardwareService=require(_0x6b7b('0x16'));var logger=require(_0x6b7b('0x17'))(_0x6b7b('0x18'));var utils=require(_0x6b7b('0x19'));var config=require(_0x6b7b('0x1a'));var licenseUtil=require(_0x6b7b('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x510b8f,_0x2caadb){_0x2caadb=_0x2caadb||0xcc;return function(_0xd3ef45){if(_0xd3ef45){return _0x510b8f[_0x6b7b('0x1c')](_0x2caadb);}return _0x510b8f['status'](_0x2caadb)[_0x6b7b('0x1d')]();};}function respondWithResult(_0x1cf023,_0x57dcaf){_0x57dcaf=_0x57dcaf||0xc8;return function(_0x3de22c){if(_0x3de22c){return _0x1cf023[_0x6b7b('0x1e')](_0x57dcaf)[_0x6b7b('0x1f')](_0x3de22c);}};}function respondWithFilteredResult(_0x192d8a,_0x5e4c65){return function(_0x4309f0){if(_0x4309f0){var _0x324db0=typeof _0x5e4c65[_0x6b7b('0x20')]===_0x6b7b('0x21')&&typeof _0x5e4c65[_0x6b7b('0x22')]===_0x6b7b('0x21');var _0x350af2=_0x4309f0[_0x6b7b('0x23')];var _0x265d4e=_0x324db0?0x0:_0x5e4c65[_0x6b7b('0x20')];var _0xea2145=_0x324db0?_0x4309f0[_0x6b7b('0x23')]:_0x5e4c65[_0x6b7b('0x20')]+_0x5e4c65[_0x6b7b('0x22')];var _0x57c257;if(_0xea2145>=_0x350af2){_0xea2145=_0x350af2;_0x57c257=0xc8;}else{_0x57c257=0xce;}_0x192d8a[_0x6b7b('0x1e')](_0x57c257);return _0x192d8a[_0x6b7b('0x24')](_0x6b7b('0x25'),_0x265d4e+'-'+_0xea2145+'/'+_0x350af2)[_0x6b7b('0x1f')](_0x4309f0);}return null;};}function patchUpdates(_0x20e8b4){return function(_0x11c89a){try{jsonpatch[_0x6b7b('0x26')](_0x11c89a,_0x20e8b4,!![]);}catch(_0x1f4be3){return BPromise[_0x6b7b('0x27')](_0x1f4be3);}return _0x11c89a[_0x6b7b('0x28')]();};}function saveUpdates(_0x58485c,_0x3935ed){return function(_0x595e5d){if(_0x595e5d){return _0x595e5d[_0x6b7b('0x29')](_0x58485c)['then'](function(_0x4be885){return _0x4be885;});}return null;};}function removeEntity(_0x3f65dc,_0x1994c6){return function(_0x3c148c){if(_0x3c148c){return _0x3c148c['destroy']()[_0x6b7b('0x2a')](function(){_0x3f65dc[_0x6b7b('0x1e')](0xcc)[_0x6b7b('0x1d')]();});}};}function handleEntityNotFound(_0x4fbe32,_0x24a01e){return function(_0x3fcd4b){if(!_0x3fcd4b){_0x4fbe32[_0x6b7b('0x1c')](0x194);}return _0x3fcd4b;};}function handleError(_0x133792,_0x3d703f){_0x3d703f=_0x3d703f||0x1f4;return function(_0x34a5fd){logger[_0x6b7b('0x2b')](_0x34a5fd[_0x6b7b('0x2c')]);if(_0x34a5fd[_0x6b7b('0x2d')]){delete _0x34a5fd[_0x6b7b('0x2d')];}_0x133792['status'](_0x3d703f)['send'](_0x34a5fd);};}exports[_0x6b7b('0x2e')]=function(_0x4fcd68,_0xba1dd4){var _0x52e488={},_0x8df1e9={},_0x40a513={'count':0x0,'rows':[]};var _0xb5f4fa=_[_0x6b7b('0x2f')](db[_0x6b7b('0x30')][_0x6b7b('0x31')],function(_0x17ee45){return{'name':_0x17ee45[_0x6b7b('0x32')],'type':_0x17ee45['type']['key']};});_0x8df1e9[_0x6b7b('0x33')]=_[_0x6b7b('0x2f')](_0xb5f4fa,_0x6b7b('0x2d'));_0x8df1e9[_0x6b7b('0x34')]=_[_0x6b7b('0x35')](_0x4fcd68[_0x6b7b('0x34')]);_0x8df1e9[_0x6b7b('0x36')]=_['intersection'](_0x8df1e9[_0x6b7b('0x33')],_0x8df1e9[_0x6b7b('0x34')]);_0x52e488['attributes']=_[_0x6b7b('0x37')](_0x8df1e9['model'],qs[_0x6b7b('0x38')](_0x4fcd68[_0x6b7b('0x34')][_0x6b7b('0x38')]));_0x52e488['attributes']=_0x52e488[_0x6b7b('0x39')][_0x6b7b('0x3a')]?_0x52e488['attributes']:_0x8df1e9[_0x6b7b('0x33')];if(!_0x4fcd68[_0x6b7b('0x34')][_0x6b7b('0x3b')](_0x6b7b('0x3c'))){_0x52e488['limit']=qs[_0x6b7b('0x22')](_0x4fcd68['query'][_0x6b7b('0x22')]);_0x52e488['offset']=qs[_0x6b7b('0x20')](_0x4fcd68[_0x6b7b('0x34')][_0x6b7b('0x20')]);}_0x52e488[_0x6b7b('0x3d')]=qs[_0x6b7b('0x3e')](_0x4fcd68[_0x6b7b('0x34')][_0x6b7b('0x3e')]);_0x52e488['where']=qs[_0x6b7b('0x36')](_[_0x6b7b('0x3f')](_0x4fcd68['query'],_0x8df1e9[_0x6b7b('0x36')]),_0xb5f4fa);if(_0x4fcd68[_0x6b7b('0x34')][_0x6b7b('0x40')]){_0x52e488[_0x6b7b('0x41')]=_[_0x6b7b('0x42')](_0x52e488[_0x6b7b('0x41')],{'$or':_['map'](_0xb5f4fa,function(_0x2115ab){if(_0x2115ab[_0x6b7b('0x43')]!==_0x6b7b('0x44')){var _0x409375={};_0x409375[_0x2115ab[_0x6b7b('0x2d')]]={'$like':'%'+_0x4fcd68['query']['filter']+'%'};return _0x409375;}})});}_0x52e488=_[_0x6b7b('0x42')]({},_0x52e488,_0x4fcd68['options']);var _0x3bfafb={'where':_0x52e488['where']};return db[_0x6b7b('0x30')]['count'](_0x3bfafb)[_0x6b7b('0x2a')](function(_0x203189){_0x40a513['count']=_0x203189;if(_0x4fcd68[_0x6b7b('0x34')][_0x6b7b('0x45')]){_0x52e488[_0x6b7b('0x46')]=[{'all':!![]}];}return db['SquareReport'][_0x6b7b('0x47')](_0x52e488);})[_0x6b7b('0x2a')](function(_0x27e4d0){_0x40a513['rows']=_0x27e4d0;return _0x40a513;})[_0x6b7b('0x2a')](respondWithFilteredResult(_0xba1dd4,_0x52e488))[_0x6b7b('0x48')](handleError(_0xba1dd4,null));};exports[_0x6b7b('0x49')]=function(_0x2b4876,_0x557de2){var _0x5e5c39={'raw':!![],'where':{'id':_0x2b4876[_0x6b7b('0x4a')]['id']}},_0x35d496={};_0x35d496[_0x6b7b('0x33')]=_[_0x6b7b('0x35')](db[_0x6b7b('0x30')][_0x6b7b('0x31')]);_0x35d496['query']=_[_0x6b7b('0x35')](_0x2b4876[_0x6b7b('0x34')]);_0x35d496[_0x6b7b('0x36')]=_[_0x6b7b('0x37')](_0x35d496[_0x6b7b('0x33')],_0x35d496[_0x6b7b('0x34')]);_0x5e5c39['attributes']=_[_0x6b7b('0x37')](_0x35d496['model'],qs[_0x6b7b('0x38')](_0x2b4876[_0x6b7b('0x34')]['fields']));_0x5e5c39[_0x6b7b('0x39')]=_0x5e5c39['attributes']['length']?_0x5e5c39['attributes']:_0x35d496[_0x6b7b('0x33')];if(_0x2b4876[_0x6b7b('0x34')]['includeAll']){_0x5e5c39['include']=[{'all':!![]}];}_0x5e5c39=_[_0x6b7b('0x42')]({},_0x5e5c39,_0x2b4876[_0x6b7b('0x4b')]);return db[_0x6b7b('0x30')]['find'](_0x5e5c39)[_0x6b7b('0x2a')](handleEntityNotFound(_0x557de2,null))[_0x6b7b('0x2a')](respondWithResult(_0x557de2,null))['catch'](handleError(_0x557de2,null));};exports[_0x6b7b('0x4c')]=function(_0x3077f3,_0x27db7e){return db[_0x6b7b('0x30')][_0x6b7b('0x4c')](_0x3077f3[_0x6b7b('0x4d')],{})[_0x6b7b('0x2a')](respondWithResult(_0x27db7e,0xc9))['catch'](handleError(_0x27db7e,null));};exports[_0x6b7b('0x29')]=function(_0xae13a,_0x2acf00){if(_0xae13a['body']['id']){delete _0xae13a['body']['id'];}return db[_0x6b7b('0x30')][_0x6b7b('0x4e')]({'where':{'id':_0xae13a[_0x6b7b('0x4a')]['id']}})[_0x6b7b('0x2a')](handleEntityNotFound(_0x2acf00,null))[_0x6b7b('0x2a')](saveUpdates(_0xae13a[_0x6b7b('0x4d')],null))[_0x6b7b('0x2a')](respondWithResult(_0x2acf00,null))[_0x6b7b('0x48')](handleError(_0x2acf00,null));};exports[_0x6b7b('0x4f')]=function(_0x57595c,_0x76d2cb){return db[_0x6b7b('0x30')]['find']({'where':{'id':_0x57595c[_0x6b7b('0x4a')]['id']}})[_0x6b7b('0x2a')](handleEntityNotFound(_0x76d2cb,null))[_0x6b7b('0x2a')](removeEntity(_0x76d2cb,null))[_0x6b7b('0x48')](handleError(_0x76d2cb,null));};exports[_0x6b7b('0x50')]=function(_0x4ebdb0,_0x4aa34c){return db[_0x6b7b('0x30')][_0x6b7b('0x50')]()[_0x6b7b('0x2a')](respondWithResult(_0x4aa34c,null))['catch'](handleError(_0x4aa34c,null));};
\ No newline at end of file
index e531d6a..b78ece7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd082=['SquareReport','report_square','uid_pname','leaveAt','lodash','util','bluebird','request-promise','path','../../config/environment','define'];(function(_0xa554a7,_0x14d2ee){var _0x427726=function(_0x28d262){while(--_0x28d262){_0xa554a7['push'](_0xa554a7['shift']());}};_0x427726(++_0x14d2ee);}(_0xd082,0x10c));var _0x2d08=function(_0x4fb858,_0x99042d){_0x4fb858=_0x4fb858-0x0;var _0x1bbc57=_0xd082[_0x4fb858];return _0x1bbc57;};'use strict';var _=require(_0x2d08('0x0'));var util=require(_0x2d08('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2d08('0x2'));var rp=require(_0x2d08('0x3'));var fs=require('fs');var path=require(_0x2d08('0x4'));var rimraf=require('rimraf');var config=require(_0x2d08('0x5'));var attributes=require('./squareReport.attributes');module['exports']=function(_0x583010,_0x438343){return _0x583010[_0x2d08('0x6')](_0x2d08('0x7'),attributes,{'tableName':_0x2d08('0x8'),'paranoid':![],'indexes':[{'name':_0x2d08('0x9'),'fields':['uniqueid','project_name']},{'name':_0x2d08('0xa'),'fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1f8=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','project_name','leaveAt','util'];(function(_0xdbd9bc,_0x2c4222){var _0x48f6c4=function(_0x1da7f0){while(--_0x1da7f0){_0xdbd9bc['push'](_0xdbd9bc['shift']());}};_0x48f6c4(++_0x2c4222);}(_0xb1f8,0x95));var _0x8b1f=function(_0x276c42,_0x241a7d){_0x276c42=_0x276c42-0x0;var _0x41a60b=_0xb1f8[_0x276c42];return _0x41a60b;};'use strict';var _=require('lodash');var util=require(_0x8b1f('0x0'));var logger=require(_0x8b1f('0x1'))('api');var moment=require(_0x8b1f('0x2'));var BPromise=require('bluebird');var rp=require(_0x8b1f('0x3'));var fs=require('fs');var path=require(_0x8b1f('0x4'));var rimraf=require(_0x8b1f('0x5'));var config=require(_0x8b1f('0x6'));var attributes=require(_0x8b1f('0x7'));module[_0x8b1f('0x8')]=function(_0x2b9cd4,_0x1e2a2f){return _0x2b9cd4[_0x8b1f('0x9')](_0x8b1f('0xa'),attributes,{'tableName':_0x8b1f('0xb'),'paranoid':![],'indexes':[{'name':_0x8b1f('0xc'),'fields':['uniqueid',_0x8b1f('0xd')]},{'name':_0x8b1f('0xe'),'fields':[_0x8b1f('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index c2fa7eb..3f670ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaa8=['SquareReport','create','options','raw','debug','CreateSquareReport','UpdateSquareReport','update','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','code','error','message','catch'];(function(_0x1e0139,_0x4970a3){var _0xbfc2ba=function(_0x20ee9e){while(--_0x20ee9e){_0x1e0139['push'](_0x1e0139['shift']());}};_0xbfc2ba(++_0x4970a3);}(_0xcaa8,0x8c));var _0x8caa=function(_0xe9693c,_0x24a041){_0xe9693c=_0xe9693c-0x0;var _0x275c7d=_0xcaa8[_0xe9693c];return _0x275c7d;};'use strict';var _=require(_0x8caa('0x0'));var util=require(_0x8caa('0x1'));var moment=require(_0x8caa('0x2'));var BPromise=require(_0x8caa('0x3'));var rs=require(_0x8caa('0x4'));var fs=require('fs');var Redis=require(_0x8caa('0x5'));var db=require(_0x8caa('0x6'))['db'];var utils=require(_0x8caa('0x7'));var logger=require(_0x8caa('0x8'))(_0x8caa('0x9'));var config=require(_0x8caa('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8caa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ade4f,_0x44fc47,_0x44a9a6){return new BPromise(function(_0xc091d4,_0x66553d){return client['request'](_0x3ade4f,_0x44a9a6)[_0x8caa('0xc')](function(_0x2ebc28){logger[_0x8caa('0xd')](_0x8caa('0xe'),_0x44fc47,_0x8caa('0xf'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x44fc47,_0x8caa('0xf'),JSON['stringify'](_0x2ebc28));if(_0x2ebc28['error']){if(_0x2ebc28['error'][_0x8caa('0x10')]===0x1f4){logger[_0x8caa('0x11')](_0x8caa('0xe'),_0x44fc47,_0x2ebc28[_0x8caa('0x11')][_0x8caa('0x12')]);return _0x66553d(_0x2ebc28[_0x8caa('0x11')]['message']);}logger['error'](_0x8caa('0xe'),_0x44fc47,_0x2ebc28['error']['message']);return _0xc091d4(_0x2ebc28['error'][_0x8caa('0x12')]);}else{logger[_0x8caa('0xd')](_0x8caa('0xe'),_0x44fc47,_0x8caa('0xf'));_0xc091d4(_0x2ebc28['result'][_0x8caa('0x12')]);}})[_0x8caa('0x13')](function(_0x835ad2){logger['error']('SquareReport,\x20%s,\x20%s',_0x44fc47,_0x835ad2);_0x66553d(_0x835ad2);});});}exports['CreateSquareReport']=function(_0x41f366){var _0xb0c1d5=this;return new Promise(function(_0x5e2fc6,_0x5b0d3d){return db[_0x8caa('0x14')][_0x8caa('0x15')](_0x41f366['body'],{'raw':_0x41f366[_0x8caa('0x16')]?_0x41f366['options'][_0x8caa('0x17')]===undefined?!![]:![]:!![]})[_0x8caa('0xc')](function(_0x4ce26f){logger['info']('CreateSquareReport',_0x41f366);logger[_0x8caa('0x18')]('CreateSquareReport',_0x41f366,JSON['stringify'](_0x4ce26f));_0x5e2fc6(_0x4ce26f);})[_0x8caa('0x13')](function(_0x40882f){logger[_0x8caa('0x11')](_0x8caa('0x19'),_0x40882f[_0x8caa('0x12')],_0x41f366);_0x5b0d3d(_0xb0c1d5['error'](0x1f4,_0x40882f[_0x8caa('0x12')]));});});};exports[_0x8caa('0x1a')]=function(_0x143c04){var _0x29911b=this;return new Promise(function(_0x192fce,_0x6681e7){return db[_0x8caa('0x14')][_0x8caa('0x1b')](_0x143c04['body'],{'raw':_0x143c04[_0x8caa('0x16')]?_0x143c04[_0x8caa('0x16')][_0x8caa('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x143c04[_0x8caa('0x16')]?_0x143c04[_0x8caa('0x16')][_0x8caa('0x1c')]||null:null,'attributes':_0x143c04[_0x8caa('0x16')]?_0x143c04[_0x8caa('0x16')][_0x8caa('0x1d')]||null:null,'limit':_0x143c04[_0x8caa('0x16')]?_0x143c04[_0x8caa('0x16')][_0x8caa('0x1e')]||null:null})[_0x8caa('0xc')](function(_0x361041){logger[_0x8caa('0xd')](_0x8caa('0x1a'),_0x143c04);logger[_0x8caa('0x18')](_0x8caa('0x1a'),_0x143c04,JSON[_0x8caa('0x1f')](_0x361041));_0x192fce(_0x361041);})['catch'](function(_0x51df43){logger[_0x8caa('0x11')]('UpdateSquareReport',_0x51df43[_0x8caa('0x12')],_0x143c04);_0x6681e7(_0x29911b['error'](0x1f4,_0x51df43[_0x8caa('0x12')]));});});};
\ No newline at end of file
+var _0x73bb=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','CreateSquareReport','create','body','options','raw','UpdateSquareReport','SquareReport','update','attributes','bluebird'];(function(_0x3eb795,_0x329b65){var _0x1fd6b5=function(_0x5390bb){while(--_0x5390bb){_0x3eb795['push'](_0x3eb795['shift']());}};_0x1fd6b5(++_0x329b65);}(_0x73bb,0x185));var _0xb73b=function(_0xd2f4ac,_0x5aa8e5){_0xd2f4ac=_0xd2f4ac-0x0;var _0x9757b2=_0x73bb[_0xd2f4ac];return _0x9757b2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb73b('0x0'));var rs=require(_0xb73b('0x1'));var fs=require('fs');var Redis=require(_0xb73b('0x2'));var db=require(_0xb73b('0x3'))['db'];var utils=require(_0xb73b('0x4'));var logger=require(_0xb73b('0x5'))(_0xb73b('0x6'));var config=require(_0xb73b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb73b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30a6d7,_0x20d6c5,_0x12ef74){return new BPromise(function(_0x28cfdd,_0x1e554d){return client[_0xb73b('0x9')](_0x30a6d7,_0x12ef74)[_0xb73b('0xa')](function(_0x4dad25){logger['info'](_0xb73b('0xb'),_0x20d6c5,'request\x20sent');logger[_0xb73b('0xc')](_0xb73b('0xd'),_0x20d6c5,'request\x20sent',JSON['stringify'](_0x4dad25));if(_0x4dad25[_0xb73b('0xe')]){if(_0x4dad25[_0xb73b('0xe')][_0xb73b('0xf')]===0x1f4){logger['error'](_0xb73b('0xb'),_0x20d6c5,_0x4dad25['error']['message']);return _0x1e554d(_0x4dad25[_0xb73b('0xe')]['message']);}logger['error'](_0xb73b('0xb'),_0x20d6c5,_0x4dad25[_0xb73b('0xe')][_0xb73b('0x10')]);return _0x28cfdd(_0x4dad25[_0xb73b('0xe')][_0xb73b('0x10')]);}else{logger[_0xb73b('0x11')](_0xb73b('0xb'),_0x20d6c5,_0xb73b('0x12'));_0x28cfdd(_0x4dad25[_0xb73b('0x13')][_0xb73b('0x10')]);}})[_0xb73b('0x14')](function(_0xb66000){logger['error'](_0xb73b('0xb'),_0x20d6c5,_0xb66000);_0x1e554d(_0xb66000);});});}exports[_0xb73b('0x15')]=function(_0x49c3ce){var _0x5f27a0=this;return new Promise(function(_0x4b8712,_0x304f7f){return db['SquareReport'][_0xb73b('0x16')](_0x49c3ce[_0xb73b('0x17')],{'raw':_0x49c3ce[_0xb73b('0x18')]?_0x49c3ce[_0xb73b('0x18')][_0xb73b('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x53ba60){logger[_0xb73b('0x11')](_0xb73b('0x15'),_0x49c3ce);logger[_0xb73b('0xc')](_0xb73b('0x15'),_0x49c3ce,JSON['stringify'](_0x53ba60));_0x4b8712(_0x53ba60);})['catch'](function(_0x181340){logger[_0xb73b('0xe')](_0xb73b('0x15'),_0x181340[_0xb73b('0x10')],_0x49c3ce);_0x304f7f(_0x5f27a0[_0xb73b('0xe')](0x1f4,_0x181340[_0xb73b('0x10')]));});});};exports[_0xb73b('0x1a')]=function(_0x3da6fc){var _0x4e36ea=this;return new Promise(function(_0xabaee0,_0x23f742){return db[_0xb73b('0x1b')][_0xb73b('0x1c')](_0x3da6fc[_0xb73b('0x17')],{'raw':_0x3da6fc[_0xb73b('0x18')]?_0x3da6fc[_0xb73b('0x18')][_0xb73b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3da6fc[_0xb73b('0x18')]?_0x3da6fc[_0xb73b('0x18')]['where']||null:null,'attributes':_0x3da6fc['options']?_0x3da6fc[_0xb73b('0x18')][_0xb73b('0x1d')]||null:null,'limit':_0x3da6fc['options']?_0x3da6fc['options']['limit']||null:null})[_0xb73b('0xa')](function(_0x3ab732){logger[_0xb73b('0x11')](_0xb73b('0x1a'),_0x3da6fc);logger[_0xb73b('0xc')](_0xb73b('0x1a'),_0x3da6fc,JSON['stringify'](_0x3ab732));_0xabaee0(_0x3ab732);})['catch'](function(_0x70f78c){logger[_0xb73b('0xe')]('UpdateSquareReport',_0x70f78c[_0xb73b('0x10')],_0x3da6fc);_0x23f742(_0x4e36ea[_0xb73b('0xe')](0x1f4,_0x70f78c[_0xb73b('0x10')]));});});};
\ No newline at end of file
index 9810d3f..1bb2355 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3471=['../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x8b95cc,_0x4b3d4d){var _0x17483c=function(_0x55f214){while(--_0x55f214){_0x8b95cc['push'](_0x8b95cc['shift']());}};_0x17483c(++_0x4b3d4d);}(_0x3471,0x19e));var _0x1347=function(_0x969146,_0x4c519c){_0x969146=_0x969146-0x0;var _0x17db3e=_0x3471[_0x969146];return _0x17db3e;};'use strict';var multer=require('multer');var util=require(_0x1347('0x0'));var path=require(_0x1347('0x1'));var timeout=require(_0x1347('0x2'));var express=require(_0x1347('0x3'));var router=express[_0x1347('0x4')]();var fs_extra=require(_0x1347('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1347('0x6'));var config=require(_0x1347('0x7'));var controller=require(_0x1347('0x8'));router[_0x1347('0x9')]('/',auth[_0x1347('0xa')](),controller[_0x1347('0xb')]);router[_0x1347('0x9')]('/describe',auth[_0x1347('0xa')](),controller[_0x1347('0xc')]);router[_0x1347('0x9')](_0x1347('0xd'),auth[_0x1347('0xa')](),controller[_0x1347('0xe')]);router[_0x1347('0xf')]('/',auth[_0x1347('0xa')](),controller['create']);router['put'](_0x1347('0xd'),auth['isAuthenticated'](),controller[_0x1347('0x10')]);router[_0x1347('0x11')](_0x1347('0xd'),auth['isAuthenticated'](),controller[_0x1347('0x12')]);module[_0x1347('0x13')]=router;
\ No newline at end of file
+var _0x6b6e=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x6b6e,0xa8));var _0xe6b6=function(_0x325b9e,_0x4db05d){_0x325b9e=_0x325b9e-0x0;var _0x1b91ca=_0x6b6e[_0x325b9e];return _0x1b91ca;};'use strict';var multer=require(_0xe6b6('0x0'));var util=require(_0xe6b6('0x1'));var path=require('path');var timeout=require(_0xe6b6('0x2'));var express=require(_0xe6b6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe6b6('0x4'));var interaction=require(_0xe6b6('0x5'));var config=require(_0xe6b6('0x6'));var controller=require(_0xe6b6('0x7'));router[_0xe6b6('0x8')]('/',auth[_0xe6b6('0x9')](),controller[_0xe6b6('0xa')]);router[_0xe6b6('0x8')](_0xe6b6('0xb'),auth[_0xe6b6('0x9')](),controller[_0xe6b6('0xc')]);router[_0xe6b6('0x8')](_0xe6b6('0xd'),auth['isAuthenticated'](),controller[_0xe6b6('0xe')]);router[_0xe6b6('0xf')]('/',auth['isAuthenticated'](),controller[_0xe6b6('0x10')]);router['put'](_0xe6b6('0xd'),auth[_0xe6b6('0x9')](),controller[_0xe6b6('0x11')]);router[_0xe6b6('0x12')](_0xe6b6('0xd'),auth[_0xe6b6('0x9')](),controller[_0xe6b6('0x13')]);module[_0xe6b6('0x14')]=router;
\ No newline at end of file
index 3d98dd0..4573565 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07ec=['exports','STRING','TEXT','sequelize'];(function(_0x5dc80c,_0x301bdf){var _0x32cbbd=function(_0x3313b8){while(--_0x3313b8){_0x5dc80c['push'](_0x5dc80c['shift']());}};_0x32cbbd(++_0x301bdf);}(_0x07ec,0x19f));var _0xc07e=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0x07ec[_0x3b3210];return _0x5b5484;};'use strict';var Sequelize=require(_0xc07e('0x0'));module[_0xc07e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xc07e('0x2')]},'application':{'type':Sequelize[_0xc07e('0x2')]},'data':{'type':Sequelize[_0xc07e('0x3')]},'project_name':{'type':Sequelize[_0xc07e('0x2')]},'callerid':{'type':Sequelize[_0xc07e('0x2')]}};
\ No newline at end of file
+var _0x2bcc=['sequelize','exports','STRING','TEXT'];(function(_0x4fd6ce,_0x428b9e){var _0x4c9aaa=function(_0x1dfdfb){while(--_0x1dfdfb){_0x4fd6ce['push'](_0x4fd6ce['shift']());}};_0x4c9aaa(++_0x428b9e);}(_0x2bcc,0x1e8));var _0xc2bc=function(_0x2bd263,_0x5b4f20){_0x2bd263=_0x2bd263-0x0;var _0x5ca663=_0x2bcc[_0x2bd263];return _0x5ca663;};'use strict';var Sequelize=require(_0xc2bc('0x0'));module[_0xc2bc('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xc2bc('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xc2bc('0x3')]},'project_name':{'type':Sequelize[_0xc2bc('0x2')]},'callerid':{'type':Sequelize[_0xc2bc('0x2')]}};
\ No newline at end of file
index a6c1b0c..73a86be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee2d=['order','sort','where','filter','merge','VIRTUAL','options','SquareDetailsReport','includeAll','findAll','catch','show','params','include','find','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','map','keys','filters','intersection','model','query','attributes','fields','length','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee2d,0x132));var _0xdee2=function(_0x102cce,_0x1f2f45){_0x102cce=_0x102cce-0x0;var _0x189976=_0xee2d[_0x102cce];return _0x189976;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdee2('0x0'));var zipdir=require(_0xdee2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdee2('0x2'));var moment=require(_0xdee2('0x3'));var BPromise=require(_0xdee2('0x4'));var Mustache=require(_0xdee2('0x5'));var util=require('util');var path=require(_0xdee2('0x6'));var sox=require(_0xdee2('0x7'));var csv=require('to-csv');var ejs=require(_0xdee2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdee2('0x9'));var squel=require('squel');var crypto=require(_0xdee2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdee2('0xb'));var querystring=require(_0xdee2('0xc'));var Papa=require('papaparse');var Redis=require(_0xdee2('0xd'));var authService=require(_0xdee2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xdee2('0xf'));var hardwareService=require(_0xdee2('0x10'));var logger=require(_0xdee2('0x11'))(_0xdee2('0x12'));var utils=require('../../config/utils');var config=require(_0xdee2('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xdee2('0x14'))['db'];function respondWithStatusCode(_0x4e4b54,_0x466631){_0x466631=_0x466631||0xcc;return function(_0x187cb8){if(_0x187cb8){return _0x4e4b54[_0xdee2('0x15')](_0x466631);}return _0x4e4b54['status'](_0x466631)[_0xdee2('0x16')]();};}function respondWithResult(_0x169207,_0x23563e){_0x23563e=_0x23563e||0xc8;return function(_0x428d6f){if(_0x428d6f){return _0x169207[_0xdee2('0x17')](_0x23563e)[_0xdee2('0x18')](_0x428d6f);}};}function respondWithFilteredResult(_0x4eafd9,_0x537bae){return function(_0x2d641a){if(_0x2d641a){var _0x34343e=typeof _0x537bae[_0xdee2('0x19')]===_0xdee2('0x1a')&&typeof _0x537bae['limit']==='undefined';var _0x1216f2=_0x2d641a[_0xdee2('0x1b')];var _0x5d6747=_0x34343e?0x0:_0x537bae[_0xdee2('0x19')];var _0x2218d=_0x34343e?_0x2d641a[_0xdee2('0x1b')]:_0x537bae[_0xdee2('0x19')]+_0x537bae[_0xdee2('0x1c')];var _0x493a39;if(_0x2218d>=_0x1216f2){_0x2218d=_0x1216f2;_0x493a39=0xc8;}else{_0x493a39=0xce;}_0x4eafd9[_0xdee2('0x17')](_0x493a39);return _0x4eafd9[_0xdee2('0x1d')](_0xdee2('0x1e'),_0x5d6747+'-'+_0x2218d+'/'+_0x1216f2)['json'](_0x2d641a);}return null;};}function patchUpdates(_0x4be664){return function(_0x20002b){try{jsonpatch[_0xdee2('0x1f')](_0x20002b,_0x4be664,!![]);}catch(_0x5bd162){return BPromise[_0xdee2('0x20')](_0x5bd162);}return _0x20002b[_0xdee2('0x21')]();};}function saveUpdates(_0x1f5cc1,_0x568578){return function(_0x1bb7ac){if(_0x1bb7ac){return _0x1bb7ac[_0xdee2('0x22')](_0x1f5cc1)[_0xdee2('0x23')](function(_0xcfe27c){return _0xcfe27c;});}return null;};}function removeEntity(_0x1888b8,_0x1eac0c){return function(_0x5ca631){if(_0x5ca631){return _0x5ca631['destroy']()[_0xdee2('0x23')](function(){_0x1888b8[_0xdee2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e009,_0x5858e9){return function(_0x317ebd){if(!_0x317ebd){_0x5e009[_0xdee2('0x15')](0x194);}return _0x317ebd;};}function handleError(_0xb96093,_0x16c8d5){_0x16c8d5=_0x16c8d5||0x1f4;return function(_0x4a745a){logger[_0xdee2('0x24')](_0x4a745a[_0xdee2('0x25')]);if(_0x4a745a[_0xdee2('0x26')]){delete _0x4a745a[_0xdee2('0x26')];}_0xb96093['status'](_0x16c8d5)[_0xdee2('0x27')](_0x4a745a);};}exports['index']=function(_0xee2df5,_0x43027f){var _0x1c0b1e={},_0x10967a={},_0xfce182={'count':0x0,'rows':[]};var _0x225ce3=_['map'](db['SquareDetailsReport'][_0xdee2('0x28')],function(_0x360ea0){return{'name':_0x360ea0[_0xdee2('0x29')],'type':_0x360ea0[_0xdee2('0x2a')][_0xdee2('0x2b')]};});_0x10967a['model']=_[_0xdee2('0x2c')](_0x225ce3,_0xdee2('0x26'));_0x10967a['query']=_[_0xdee2('0x2d')](_0xee2df5['query']);_0x10967a[_0xdee2('0x2e')]=_[_0xdee2('0x2f')](_0x10967a[_0xdee2('0x30')],_0x10967a[_0xdee2('0x31')]);_0x1c0b1e[_0xdee2('0x32')]=_[_0xdee2('0x2f')](_0x10967a[_0xdee2('0x30')],qs['fields'](_0xee2df5[_0xdee2('0x31')][_0xdee2('0x33')]));_0x1c0b1e['attributes']=_0x1c0b1e[_0xdee2('0x32')][_0xdee2('0x34')]?_0x1c0b1e[_0xdee2('0x32')]:_0x10967a[_0xdee2('0x30')];if(!_0xee2df5[_0xdee2('0x31')]['hasOwnProperty'](_0xdee2('0x35'))){_0x1c0b1e[_0xdee2('0x1c')]=qs[_0xdee2('0x1c')](_0xee2df5['query'][_0xdee2('0x1c')]);_0x1c0b1e[_0xdee2('0x19')]=qs[_0xdee2('0x19')](_0xee2df5['query'][_0xdee2('0x19')]);}_0x1c0b1e[_0xdee2('0x36')]=qs['sort'](_0xee2df5['query'][_0xdee2('0x37')]);_0x1c0b1e[_0xdee2('0x38')]=qs[_0xdee2('0x2e')](_['pick'](_0xee2df5[_0xdee2('0x31')],_0x10967a[_0xdee2('0x2e')]),_0x225ce3);if(_0xee2df5[_0xdee2('0x31')][_0xdee2('0x39')]){_0x1c0b1e['where']=_[_0xdee2('0x3a')](_0x1c0b1e[_0xdee2('0x38')],{'$or':_['map'](_0x225ce3,function(_0x42722c){if(_0x42722c[_0xdee2('0x2a')]!==_0xdee2('0x3b')){var _0x5a4024={};_0x5a4024[_0x42722c[_0xdee2('0x26')]]={'$like':'%'+_0xee2df5[_0xdee2('0x31')][_0xdee2('0x39')]+'%'};return _0x5a4024;}})});}_0x1c0b1e=_['merge']({},_0x1c0b1e,_0xee2df5[_0xdee2('0x3c')]);var _0x1647e8={'where':_0x1c0b1e[_0xdee2('0x38')]};return db[_0xdee2('0x3d')][_0xdee2('0x1b')](_0x1647e8)[_0xdee2('0x23')](function(_0x28ef52){_0xfce182['count']=_0x28ef52;if(_0xee2df5[_0xdee2('0x31')][_0xdee2('0x3e')]){_0x1c0b1e['include']=[{'all':!![]}];}return db[_0xdee2('0x3d')][_0xdee2('0x3f')](_0x1c0b1e);})[_0xdee2('0x23')](function(_0x39fd8d){_0xfce182['rows']=_0x39fd8d;return _0xfce182;})['then'](respondWithFilteredResult(_0x43027f,_0x1c0b1e))[_0xdee2('0x40')](handleError(_0x43027f,null));};exports[_0xdee2('0x41')]=function(_0x18df45,_0x29ac74){var _0x62f310={'raw':!![],'where':{'id':_0x18df45[_0xdee2('0x42')]['id']}},_0x2d5440={};_0x2d5440[_0xdee2('0x30')]=_[_0xdee2('0x2d')](db['SquareDetailsReport'][_0xdee2('0x28')]);_0x2d5440['query']=_[_0xdee2('0x2d')](_0x18df45[_0xdee2('0x31')]);_0x2d5440[_0xdee2('0x2e')]=_[_0xdee2('0x2f')](_0x2d5440[_0xdee2('0x30')],_0x2d5440[_0xdee2('0x31')]);_0x62f310[_0xdee2('0x32')]=_['intersection'](_0x2d5440['model'],qs[_0xdee2('0x33')](_0x18df45['query'][_0xdee2('0x33')]));_0x62f310[_0xdee2('0x32')]=_0x62f310[_0xdee2('0x32')][_0xdee2('0x34')]?_0x62f310[_0xdee2('0x32')]:_0x2d5440['model'];if(_0x18df45[_0xdee2('0x31')][_0xdee2('0x3e')]){_0x62f310[_0xdee2('0x43')]=[{'all':!![]}];}_0x62f310=_[_0xdee2('0x3a')]({},_0x62f310,_0x18df45['options']);return db['SquareDetailsReport'][_0xdee2('0x44')](_0x62f310)[_0xdee2('0x23')](handleEntityNotFound(_0x29ac74,null))[_0xdee2('0x23')](respondWithResult(_0x29ac74,null))[_0xdee2('0x40')](handleError(_0x29ac74,null));};exports['create']=function(_0x1de5b8,_0x19fc00){return db[_0xdee2('0x3d')]['create'](_0x1de5b8[_0xdee2('0x45')],{})['then'](respondWithResult(_0x19fc00,0xc9))['catch'](handleError(_0x19fc00,null));};exports['update']=function(_0x4e1668,_0x201132){if(_0x4e1668[_0xdee2('0x45')]['id']){delete _0x4e1668[_0xdee2('0x45')]['id'];}return db[_0xdee2('0x3d')][_0xdee2('0x44')]({'where':{'id':_0x4e1668[_0xdee2('0x42')]['id']}})[_0xdee2('0x23')](handleEntityNotFound(_0x201132,null))[_0xdee2('0x23')](saveUpdates(_0x4e1668[_0xdee2('0x45')],null))[_0xdee2('0x23')](respondWithResult(_0x201132,null))[_0xdee2('0x40')](handleError(_0x201132,null));};exports[_0xdee2('0x46')]=function(_0x57fee1,_0x398085){return db[_0xdee2('0x3d')][_0xdee2('0x44')]({'where':{'id':_0x57fee1[_0xdee2('0x42')]['id']}})[_0xdee2('0x23')](handleEntityNotFound(_0x398085,null))['then'](removeEntity(_0x398085,null))[_0xdee2('0x40')](handleError(_0x398085,null));};exports[_0xdee2('0x47')]=function(_0x403ce5,_0x11f075){return db[_0xdee2('0x3d')][_0xdee2('0x47')]()[_0xdee2('0x23')](respondWithResult(_0x11f075,null))[_0xdee2('0x40')](handleError(_0x11f075,null));};
\ No newline at end of file
+var _0xa4f5=['filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','length','attributes','nolimit','sort','where','pick'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0xa4f5,0xa2));var _0x5a4f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa4f5[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x5a4f('0x0'));var rimraf=require(_0x5a4f('0x1'));var zipdir=require(_0x5a4f('0x2'));var jsonpatch=require(_0x5a4f('0x3'));var rp=require(_0x5a4f('0x4'));var moment=require(_0x5a4f('0x5'));var BPromise=require(_0x5a4f('0x6'));var Mustache=require('mustache');var util=require(_0x5a4f('0x7'));var path=require(_0x5a4f('0x8'));var sox=require('sox');var csv=require(_0x5a4f('0x9'));var ejs=require(_0x5a4f('0xa'));var fs=require('fs');var fs_extra=require(_0x5a4f('0xb'));var _=require(_0x5a4f('0xc'));var squel=require('squel');var crypto=require(_0x5a4f('0xd'));var jsforce=require(_0x5a4f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5a4f('0xf'));var Papa=require(_0x5a4f('0x10'));var Redis=require(_0x5a4f('0x11'));var authService=require(_0x5a4f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5a4f('0x13'));var hardwareService=require(_0x5a4f('0x14'));var logger=require(_0x5a4f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5a4f('0x16'))['db'];function respondWithStatusCode(_0xfae053,_0x4c8dfb){_0x4c8dfb=_0x4c8dfb||0xcc;return function(_0x16cb7c){if(_0x16cb7c){return _0xfae053['sendStatus'](_0x4c8dfb);}return _0xfae053[_0x5a4f('0x17')](_0x4c8dfb)['end']();};}function respondWithResult(_0x1b6d1c,_0x15ac1c){_0x15ac1c=_0x15ac1c||0xc8;return function(_0x1d9551){if(_0x1d9551){return _0x1b6d1c['status'](_0x15ac1c)[_0x5a4f('0x18')](_0x1d9551);}};}function respondWithFilteredResult(_0x2dc49a,_0x2cc491){return function(_0x171153){if(_0x171153){var _0x21474e=typeof _0x2cc491[_0x5a4f('0x19')]===_0x5a4f('0x1a')&&typeof _0x2cc491['limit']==='undefined';var _0x261260=_0x171153['count'];var _0xba3818=_0x21474e?0x0:_0x2cc491[_0x5a4f('0x19')];var _0x4f13f8=_0x21474e?_0x171153[_0x5a4f('0x1b')]:_0x2cc491['offset']+_0x2cc491[_0x5a4f('0x1c')];var _0x3c1af8;if(_0x4f13f8>=_0x261260){_0x4f13f8=_0x261260;_0x3c1af8=0xc8;}else{_0x3c1af8=0xce;}_0x2dc49a[_0x5a4f('0x17')](_0x3c1af8);return _0x2dc49a[_0x5a4f('0x1d')](_0x5a4f('0x1e'),_0xba3818+'-'+_0x4f13f8+'/'+_0x261260)[_0x5a4f('0x18')](_0x171153);}return null;};}function patchUpdates(_0x36e100){return function(_0x2b4af0){try{jsonpatch[_0x5a4f('0x1f')](_0x2b4af0,_0x36e100,!![]);}catch(_0x32d0a8){return BPromise[_0x5a4f('0x20')](_0x32d0a8);}return _0x2b4af0[_0x5a4f('0x21')]();};}function saveUpdates(_0x5c1836,_0x2de8d5){return function(_0x2c8595){if(_0x2c8595){return _0x2c8595[_0x5a4f('0x22')](_0x5c1836)[_0x5a4f('0x23')](function(_0xb9e66e){return _0xb9e66e;});}return null;};}function removeEntity(_0x467bdd,_0xfb37ca){return function(_0x593d43){if(_0x593d43){return _0x593d43[_0x5a4f('0x24')]()[_0x5a4f('0x23')](function(){_0x467bdd['status'](0xcc)[_0x5a4f('0x25')]();});}};}function handleEntityNotFound(_0x1befb1,_0x2a7c33){return function(_0x5abb9d){if(!_0x5abb9d){_0x1befb1[_0x5a4f('0x26')](0x194);}return _0x5abb9d;};}function handleError(_0x141095,_0x5a0d10){_0x5a0d10=_0x5a0d10||0x1f4;return function(_0x584f04){logger['error'](_0x584f04[_0x5a4f('0x27')]);if(_0x584f04[_0x5a4f('0x28')]){delete _0x584f04[_0x5a4f('0x28')];}_0x141095[_0x5a4f('0x17')](_0x5a0d10)[_0x5a4f('0x29')](_0x584f04);};}exports[_0x5a4f('0x2a')]=function(_0x784a63,_0x4143f1){var _0x28bb62={},_0x32ed7e={},_0x92e9b2={'count':0x0,'rows':[]};var _0x19126c=_[_0x5a4f('0x2b')](db[_0x5a4f('0x2c')][_0x5a4f('0x2d')],function(_0x3081fc){return{'name':_0x3081fc[_0x5a4f('0x2e')],'type':_0x3081fc['type'][_0x5a4f('0x2f')]};});_0x32ed7e[_0x5a4f('0x30')]=_[_0x5a4f('0x2b')](_0x19126c,_0x5a4f('0x28'));_0x32ed7e[_0x5a4f('0x31')]=_[_0x5a4f('0x32')](_0x784a63[_0x5a4f('0x31')]);_0x32ed7e[_0x5a4f('0x33')]=_[_0x5a4f('0x34')](_0x32ed7e['model'],_0x32ed7e[_0x5a4f('0x31')]);_0x28bb62['attributes']=_[_0x5a4f('0x34')](_0x32ed7e[_0x5a4f('0x30')],qs[_0x5a4f('0x35')](_0x784a63[_0x5a4f('0x31')][_0x5a4f('0x35')]));_0x28bb62['attributes']=_0x28bb62['attributes'][_0x5a4f('0x36')]?_0x28bb62[_0x5a4f('0x37')]:_0x32ed7e['model'];if(!_0x784a63[_0x5a4f('0x31')]['hasOwnProperty'](_0x5a4f('0x38'))){_0x28bb62[_0x5a4f('0x1c')]=qs[_0x5a4f('0x1c')](_0x784a63[_0x5a4f('0x31')][_0x5a4f('0x1c')]);_0x28bb62[_0x5a4f('0x19')]=qs['offset'](_0x784a63[_0x5a4f('0x31')][_0x5a4f('0x19')]);}_0x28bb62['order']=qs['sort'](_0x784a63[_0x5a4f('0x31')][_0x5a4f('0x39')]);_0x28bb62[_0x5a4f('0x3a')]=qs['filters'](_[_0x5a4f('0x3b')](_0x784a63[_0x5a4f('0x31')],_0x32ed7e[_0x5a4f('0x33')]),_0x19126c);if(_0x784a63[_0x5a4f('0x31')][_0x5a4f('0x3c')]){_0x28bb62[_0x5a4f('0x3a')]=_[_0x5a4f('0x3d')](_0x28bb62[_0x5a4f('0x3a')],{'$or':_['map'](_0x19126c,function(_0x3488ca){if(_0x3488ca[_0x5a4f('0x3e')]!==_0x5a4f('0x3f')){var _0x551653={};_0x551653[_0x3488ca[_0x5a4f('0x28')]]={'$like':'%'+_0x784a63[_0x5a4f('0x31')]['filter']+'%'};return _0x551653;}})});}_0x28bb62=_['merge']({},_0x28bb62,_0x784a63[_0x5a4f('0x40')]);var _0x15be9d={'where':_0x28bb62[_0x5a4f('0x3a')]};return db[_0x5a4f('0x2c')][_0x5a4f('0x1b')](_0x15be9d)[_0x5a4f('0x23')](function(_0x5526ba){_0x92e9b2[_0x5a4f('0x1b')]=_0x5526ba;if(_0x784a63[_0x5a4f('0x31')][_0x5a4f('0x41')]){_0x28bb62['include']=[{'all':!![]}];}return db[_0x5a4f('0x2c')][_0x5a4f('0x42')](_0x28bb62);})[_0x5a4f('0x23')](function(_0x29522f){_0x92e9b2[_0x5a4f('0x43')]=_0x29522f;return _0x92e9b2;})[_0x5a4f('0x23')](respondWithFilteredResult(_0x4143f1,_0x28bb62))[_0x5a4f('0x44')](handleError(_0x4143f1,null));};exports['show']=function(_0x14c98a,_0x119f95){var _0x45264e={'raw':!![],'where':{'id':_0x14c98a[_0x5a4f('0x45')]['id']}},_0x404918={};_0x404918[_0x5a4f('0x30')]=_[_0x5a4f('0x32')](db[_0x5a4f('0x2c')]['rawAttributes']);_0x404918[_0x5a4f('0x31')]=_[_0x5a4f('0x32')](_0x14c98a[_0x5a4f('0x31')]);_0x404918[_0x5a4f('0x33')]=_['intersection'](_0x404918[_0x5a4f('0x30')],_0x404918[_0x5a4f('0x31')]);_0x45264e[_0x5a4f('0x37')]=_[_0x5a4f('0x34')](_0x404918[_0x5a4f('0x30')],qs[_0x5a4f('0x35')](_0x14c98a[_0x5a4f('0x31')][_0x5a4f('0x35')]));_0x45264e[_0x5a4f('0x37')]=_0x45264e['attributes'][_0x5a4f('0x36')]?_0x45264e['attributes']:_0x404918[_0x5a4f('0x30')];if(_0x14c98a[_0x5a4f('0x31')][_0x5a4f('0x41')]){_0x45264e['include']=[{'all':!![]}];}_0x45264e=_[_0x5a4f('0x3d')]({},_0x45264e,_0x14c98a[_0x5a4f('0x40')]);return db[_0x5a4f('0x2c')]['find'](_0x45264e)[_0x5a4f('0x23')](handleEntityNotFound(_0x119f95,null))['then'](respondWithResult(_0x119f95,null))[_0x5a4f('0x44')](handleError(_0x119f95,null));};exports[_0x5a4f('0x46')]=function(_0x10eee2,_0x380e2e){return db[_0x5a4f('0x2c')][_0x5a4f('0x46')](_0x10eee2['body'],{})[_0x5a4f('0x23')](respondWithResult(_0x380e2e,0xc9))[_0x5a4f('0x44')](handleError(_0x380e2e,null));};exports[_0x5a4f('0x22')]=function(_0xe5a29b,_0x46e4ed){if(_0xe5a29b[_0x5a4f('0x47')]['id']){delete _0xe5a29b[_0x5a4f('0x47')]['id'];}return db[_0x5a4f('0x2c')][_0x5a4f('0x48')]({'where':{'id':_0xe5a29b[_0x5a4f('0x45')]['id']}})[_0x5a4f('0x23')](handleEntityNotFound(_0x46e4ed,null))[_0x5a4f('0x23')](saveUpdates(_0xe5a29b[_0x5a4f('0x47')],null))[_0x5a4f('0x23')](respondWithResult(_0x46e4ed,null))[_0x5a4f('0x44')](handleError(_0x46e4ed,null));};exports[_0x5a4f('0x24')]=function(_0x2bf40,_0x36b424){return db['SquareDetailsReport'][_0x5a4f('0x48')]({'where':{'id':_0x2bf40[_0x5a4f('0x45')]['id']}})[_0x5a4f('0x23')](handleEntityNotFound(_0x36b424,null))[_0x5a4f('0x23')](removeEntity(_0x36b424,null))[_0x5a4f('0x44')](handleError(_0x36b424,null));};exports[_0x5a4f('0x49')]=function(_0x15da97,_0x415c6b){return db[_0x5a4f('0x2c')][_0x5a4f('0x49')]()[_0x5a4f('0x23')](respondWithResult(_0x415c6b,null))[_0x5a4f('0x44')](handleError(_0x415c6b,null));};
\ No newline at end of file
index c0437c9..2caddff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2264=['SquareDetailsReport','report_square_details','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x2264,0x7b));var _0x4226=function(_0x46a95e,_0x2dcf26){_0x46a95e=_0x46a95e-0x0;var _0x4e536e=_0x2264[_0x46a95e];return _0x4e536e;};'use strict';var _=require(_0x4226('0x0'));var util=require(_0x4226('0x1'));var logger=require('../../config/logger')(_0x4226('0x2'));var moment=require(_0x4226('0x3'));var BPromise=require(_0x4226('0x4'));var rp=require(_0x4226('0x5'));var fs=require('fs');var path=require(_0x4226('0x6'));var rimraf=require('rimraf');var config=require(_0x4226('0x7'));var attributes=require(_0x4226('0x8'));module['exports']=function(_0x19a323,_0x51cab0){return _0x19a323['define'](_0x4226('0x9'),attributes,{'tableName':_0x4226('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x14cf=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x14cf,0xba));var _0xf14c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x14cf[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xf14c('0x0'));var util=require('util');var logger=require(_0xf14c('0x1'))(_0xf14c('0x2'));var moment=require(_0xf14c('0x3'));var BPromise=require(_0xf14c('0x4'));var rp=require(_0xf14c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf14c('0x6'));var config=require(_0xf14c('0x7'));var attributes=require(_0xf14c('0x8'));module[_0xf14c('0x9')]=function(_0x472d2a,_0x23bea4){return _0x472d2a[_0xf14c('0xa')]('SquareDetailsReport',attributes,{'tableName':_0xf14c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7ae6b11..dc44f45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7be1=['SquareDetailsReport','create','body','options','raw','CreateSquareDetailsReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','stringify','error','message','SquareDetailsReport,\x20%s,\x20%s','result','catch'];(function(_0x4c2efa,_0x4c5b65){var _0x6f79bc=function(_0x5c461d){while(--_0x5c461d){_0x4c2efa['push'](_0x4c2efa['shift']());}};_0x6f79bc(++_0x4c5b65);}(_0x7be1,0x165));var _0x17be=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x7be1[_0x166d93];return _0xba708;};'use strict';var _=require(_0x17be('0x0'));var util=require(_0x17be('0x1'));var moment=require(_0x17be('0x2'));var BPromise=require('bluebird');var rs=require(_0x17be('0x3'));var fs=require('fs');var Redis=require(_0x17be('0x4'));var db=require(_0x17be('0x5'))['db'];var utils=require(_0x17be('0x6'));var logger=require(_0x17be('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x17be('0x8')][_0x17be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f5b0c,_0x326f4d,_0x23f19f){return new BPromise(function(_0x2c74b2,_0xfd9c5){return client[_0x17be('0xa')](_0x4f5b0c,_0x23f19f)[_0x17be('0xb')](function(_0x582848){logger[_0x17be('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x326f4d,_0x17be('0xd'));logger[_0x17be('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x326f4d,_0x17be('0xd'),JSON[_0x17be('0xf')](_0x582848));if(_0x582848[_0x17be('0x10')]){if(_0x582848[_0x17be('0x10')]['code']===0x1f4){logger[_0x17be('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x326f4d,_0x582848[_0x17be('0x10')]['message']);return _0xfd9c5(_0x582848[_0x17be('0x10')][_0x17be('0x11')]);}logger[_0x17be('0x10')](_0x17be('0x12'),_0x326f4d,_0x582848[_0x17be('0x10')]['message']);return _0x2c74b2(_0x582848[_0x17be('0x10')]['message']);}else{logger['info'](_0x17be('0x12'),_0x326f4d,'request\x20sent');_0x2c74b2(_0x582848[_0x17be('0x13')]['message']);}})[_0x17be('0x14')](function(_0x312b2e){logger['error'](_0x17be('0x12'),_0x326f4d,_0x312b2e);_0xfd9c5(_0x312b2e);});});}exports['CreateSquareDetailsReport']=function(_0x222009){var _0x4cff4b=this;return new Promise(function(_0x328e3,_0x165dfb){return db[_0x17be('0x15')][_0x17be('0x16')](_0x222009[_0x17be('0x17')],{'raw':_0x222009['options']?_0x222009[_0x17be('0x18')][_0x17be('0x19')]===undefined?!![]:![]:!![]})[_0x17be('0xb')](function(_0x19678b){logger['info'](_0x17be('0x1a'),_0x222009);logger['debug']('CreateSquareDetailsReport',_0x222009,JSON[_0x17be('0xf')](_0x19678b));_0x328e3(_0x19678b);})[_0x17be('0x14')](function(_0x19fbdb){logger[_0x17be('0x10')]('CreateSquareDetailsReport',_0x19fbdb[_0x17be('0x11')],_0x222009);_0x165dfb(_0x4cff4b[_0x17be('0x10')](0x1f4,_0x19fbdb['message']));});});};
\ No newline at end of file
+var _0x0647=['stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s'];(function(_0x56ae1f,_0x455aab){var _0x33e28d=function(_0x10cfbb){while(--_0x10cfbb){_0x56ae1f['push'](_0x56ae1f['shift']());}};_0x33e28d(++_0x455aab);}(_0x0647,0xd0));var _0x7064=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0x0647[_0x3e3bee];return _0x3ae14c;};'use strict';var _=require(_0x7064('0x0'));var util=require('util');var moment=require(_0x7064('0x1'));var BPromise=require(_0x7064('0x2'));var rs=require(_0x7064('0x3'));var fs=require('fs');var Redis=require(_0x7064('0x4'));var db=require(_0x7064('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7064('0x6'));var config=require(_0x7064('0x7'));var jayson=require(_0x7064('0x8'));var client=jayson[_0x7064('0x9')][_0x7064('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1101e4,_0x58186b,_0x536336){return new BPromise(function(_0x1c85b1,_0x39b7e3){return client[_0x7064('0xb')](_0x1101e4,_0x536336)['then'](function(_0x38c195){logger[_0x7064('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x58186b,_0x7064('0xd'));logger[_0x7064('0xe')](_0x7064('0xf'),_0x58186b,'request\x20sent',JSON[_0x7064('0x10')](_0x38c195));if(_0x38c195[_0x7064('0x11')]){if(_0x38c195[_0x7064('0x11')][_0x7064('0x12')]===0x1f4){logger['error'](_0x7064('0x13'),_0x58186b,_0x38c195[_0x7064('0x11')][_0x7064('0x14')]);return _0x39b7e3(_0x38c195[_0x7064('0x11')][_0x7064('0x14')]);}logger[_0x7064('0x11')](_0x7064('0x13'),_0x58186b,_0x38c195[_0x7064('0x11')]['message']);return _0x1c85b1(_0x38c195['error']['message']);}else{logger[_0x7064('0xc')](_0x7064('0x13'),_0x58186b,_0x7064('0xd'));_0x1c85b1(_0x38c195['result'][_0x7064('0x14')]);}})[_0x7064('0x15')](function(_0x5bb1cc){logger[_0x7064('0x11')](_0x7064('0x13'),_0x58186b,_0x5bb1cc);_0x39b7e3(_0x5bb1cc);});});}exports[_0x7064('0x16')]=function(_0x203633){var _0x181ca0=this;return new Promise(function(_0x17f306,_0x3f3695){return db[_0x7064('0x17')][_0x7064('0x18')](_0x203633[_0x7064('0x19')],{'raw':_0x203633[_0x7064('0x1a')]?_0x203633[_0x7064('0x1a')][_0x7064('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x431fac){logger[_0x7064('0xc')](_0x7064('0x16'),_0x203633);logger[_0x7064('0xe')]('CreateSquareDetailsReport',_0x203633,JSON[_0x7064('0x10')](_0x431fac));_0x17f306(_0x431fac);})['catch'](function(_0x446730){logger[_0x7064('0x11')]('CreateSquareDetailsReport',_0x446730[_0x7064('0x14')],_0x203633);_0x3f3695(_0x181ca0[_0x7064('0x11')](0x1f4,_0x446730[_0x7064('0x14')]));});});};
\ No newline at end of file
index 19a84a3..1d8175c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2ef=['Router','../../components/auth/service','get','isAuthenticated','/process/:pid/kill','killProcess'];(function(_0x580521,_0x1537ee){var _0x4ef71c=function(_0x3a75a0){while(--_0x3a75a0){_0x580521['push'](_0x580521['shift']());}};_0x4ef71c(++_0x1537ee);}(_0xa2ef,0x1f2));var _0xfa2e=function(_0x4697f2,_0x1de28e){_0x4697f2=_0x4697f2-0x0;var _0x147729=_0xa2ef[_0x4697f2];return _0x147729;};'use strict';var express=require('express');var router=express[_0xfa2e('0x0')]();var auth=require(_0xfa2e('0x1'));var controller=require('./system.controller');router[_0xfa2e('0x2')]('/',auth[_0xfa2e('0x3')](),controller['index']);router[_0xfa2e('0x2')](_0xfa2e('0x4'),auth['isAuthenticated'](),controller[_0xfa2e('0x5')]);module['exports']=router;
\ No newline at end of file
+var _0x4ec1=['exports','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess'];(function(_0xdac9f3,_0xd367be){var _0x341d66=function(_0x5bd6b7){while(--_0x5bd6b7){_0xdac9f3['push'](_0xdac9f3['shift']());}};_0x341d66(++_0xd367be);}(_0x4ec1,0x187));var _0x14ec=function(_0x2fe2c5,_0x26cd65){_0x2fe2c5=_0x2fe2c5-0x0;var _0x26e69b=_0x4ec1[_0x2fe2c5];return _0x26e69b;};'use strict';var express=require(_0x14ec('0x0'));var router=express[_0x14ec('0x1')]();var auth=require(_0x14ec('0x2'));var controller=require(_0x14ec('0x3'));router[_0x14ec('0x4')]('/',auth[_0x14ec('0x5')](),controller[_0x14ec('0x6')]);router['get'](_0x14ec('0x7'),auth[_0x14ec('0x5')](),controller[_0x14ec('0x8')]);module[_0x14ec('0x9')]=router;
\ No newline at end of file
index 882b566..dbe649c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe567=['index','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','then','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','bluebird','error','inspect','name','status','send'];(function(_0x386cef,_0x112e10){var _0x2f866f=function(_0xcc8a40){while(--_0xcc8a40){_0x386cef['push'](_0x386cef['shift']());}};_0x2f866f(++_0x112e10);}(_0xe567,0xa6));var _0x7e56=function(_0x21b744,_0x36e84c){_0x21b744=_0x21b744-0x0;var _0x6690=_0xe567[_0x21b744];return _0x6690;};'use strict';var info=require(_0x7e56('0x0'));var exec=require(_0x7e56('0x1'))[_0x7e56('0x2')];var logger=require('../../config/logger')('api');var util=require('util');var BPromise=require(_0x7e56('0x3'));var _=require('lodash');function handleError(_0x27ebcc,_0x5d0ca0,_0x1fb3e5){_0x5d0ca0=_0x5d0ca0||0x1f4;return function(_0x2ef49c){logger[_0x7e56('0x4')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x1fb3e5,_0x5d0ca0,util[_0x7e56('0x5')](_0x2ef49c,{'showHidden':![],'depth':null}));delete _0x2ef49c[_0x7e56('0x6')];_0x27ebcc[_0x7e56('0x7')](_0x5d0ca0)[_0x7e56('0x8')](_0x2ef49c);};}exports[_0x7e56('0x9')]=function(_0x22a615,_0x52c9a0){return info['getAllData']()['then'](function(_0x531175){return _0x52c9a0['status'](0xc8)[_0x7e56('0xa')](_0x531175);})[_0x7e56('0xb')](function(_0x1c817c){return _0x52c9a0['status'](0x1f4)[_0x7e56('0xa')](_0x1c817c);});};exports[_0x7e56('0xc')]=function(_0x47c6aa,_0x1be805){var _0x1e77b5=[_0x7e56('0xd')];return new BPromise(function(_0x3295c2,_0x1b227c){return exec(util[_0x7e56('0xe')](_0x7e56('0xf'),_0x47c6aa[_0x7e56('0x10')]['pid']),function(_0x3dfe3a,_0x3e82c2,_0x23c047){if(_0x3dfe3a){return _0x1b227c(_0x3dfe3a);}return _0x3295c2(_0x3e82c2);});})[_0x7e56('0x11')](function(_0x435217){var _0x135dae=![];var _0xcb286f=_0x435217[_0x7e56('0x12')](/\n/);for(var _0x3e8fc2=0x0,_0xf8db10=_0x1e77b5[_0x7e56('0x13')];_0x3e8fc2<_0xf8db10,_0x135dae===![];_0x3e8fc2+=0x1){if(_0x435217['indexOf'](_0x1e77b5[_0x3e8fc2])>=0x0){_0x135dae=!![];}}if(!_0x135dae){throw new Error(util['format'](_0x7e56('0x14'),_0x47c6aa[_0x7e56('0x10')][_0x7e56('0x15')]));}process[_0x7e56('0x16')](_0x47c6aa[_0x7e56('0x10')][_0x7e56('0x15')],_0x7e56('0x17'));return _0x1be805[_0x7e56('0x7')](0xc8)['json']({'message':util[_0x7e56('0xe')](_0x7e56('0x18'),_0x47c6aa[_0x7e56('0x10')][_0x7e56('0x15')])});})['catch'](handleError(_0x1be805,null,_0x7e56('0xc')));};
\ No newline at end of file
+var _0x7fdd=['format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','kill','params','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','then','json','killProcess','components/import/cm'];(function(_0x149ad5,_0x12b417){var _0x2566b7=function(_0x157f10){while(--_0x157f10){_0x149ad5['push'](_0x149ad5['shift']());}};_0x2566b7(++_0x12b417);}(_0x7fdd,0x1ed));var _0xd7fd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7fdd[_0x14add3];return _0x4a174f;};'use strict';var info=require(_0xd7fd('0x0'));var exec=require(_0xd7fd('0x1'))[_0xd7fd('0x2')];var logger=require('../../config/logger')('api');var util=require(_0xd7fd('0x3'));var BPromise=require('bluebird');var _=require(_0xd7fd('0x4'));function handleError(_0xfefc0,_0xf1ff68,_0x2417db){_0xf1ff68=_0xf1ff68||0x1f4;return function(_0x128581){logger['error'](_0xd7fd('0x5'),_0x2417db,_0xf1ff68,util[_0xd7fd('0x6')](_0x128581,{'showHidden':![],'depth':null}));delete _0x128581[_0xd7fd('0x7')];_0xfefc0[_0xd7fd('0x8')](_0xf1ff68)['send'](_0x128581);};}exports['index']=function(_0x531ce3,_0xeb497c){return info['getAllData']()[_0xd7fd('0x9')](function(_0x4422bd){return _0xeb497c['status'](0xc8)[_0xd7fd('0xa')](_0x4422bd);})['catch'](function(_0x4577a7){return _0xeb497c[_0xd7fd('0x8')](0x1f4)[_0xd7fd('0xa')](_0x4577a7);});};exports[_0xd7fd('0xb')]=function(_0x36f379,_0x4763fe){var _0x33d6da=[_0xd7fd('0xc')];return new BPromise(function(_0x3d8e3f,_0x45b21b){return exec(util[_0xd7fd('0xd')](_0xd7fd('0xe'),_0x36f379['params'][_0xd7fd('0xf')]),function(_0x288cc4,_0x2a27ba,_0x2db4ba){if(_0x288cc4){return _0x45b21b(_0x288cc4);}return _0x3d8e3f(_0x2a27ba);});})[_0xd7fd('0x9')](function(_0x5cc4a9){var _0x5a1f31=![];var _0x35d1dd=_0x5cc4a9[_0xd7fd('0x10')](/\n/);for(var _0x2bae2a=0x0,_0x54aa6a=_0x33d6da[_0xd7fd('0x11')];_0x2bae2a<_0x54aa6a,_0x5a1f31===![];_0x2bae2a+=0x1){if(_0x5cc4a9[_0xd7fd('0x12')](_0x33d6da[_0x2bae2a])>=0x0){_0x5a1f31=!![];}}if(!_0x5a1f31){throw new Error(util[_0xd7fd('0xd')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x36f379['params'][_0xd7fd('0xf')]));}process[_0xd7fd('0x13')](_0x36f379[_0xd7fd('0x14')][_0xd7fd('0xf')],'SIGINT');return _0x4763fe[_0xd7fd('0x8')](0xc8)['json']({'message':util['format'](_0xd7fd('0x15'),_0x36f379[_0xd7fd('0x14')]['pid'])});})[_0xd7fd('0x16')](handleError(_0x4763fe,null,_0xd7fd('0xb')));};
\ No newline at end of file
index 0102a0b..d5a517f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa134=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3f6c29,_0x370d86){var _0x4af959=function(_0x263612){while(--_0x263612){_0x3f6c29['push'](_0x3f6c29['shift']());}};_0x4af959(++_0x370d86);}(_0xa134,0xf0));var _0x4a13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa134[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4a13('0x0'));var util=require(_0x4a13('0x1'));var path=require(_0x4a13('0x2'));var timeout=require(_0x4a13('0x3'));var express=require(_0x4a13('0x4'));var router=express[_0x4a13('0x5')]();var fs_extra=require(_0x4a13('0x6'));var auth=require(_0x4a13('0x7'));var interaction=require(_0x4a13('0x8'));var config=require(_0x4a13('0x9'));var controller=require(_0x4a13('0xa'));router[_0x4a13('0xb')]('/',auth[_0x4a13('0xc')](),controller['index']);router['get'](_0x4a13('0xd'),auth[_0x4a13('0xc')](),controller[_0x4a13('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4a13('0xf')]);router[_0x4a13('0x10')](_0x4a13('0xd'),auth[_0x4a13('0xc')](),controller['update']);router[_0x4a13('0x11')](_0x4a13('0xd'),auth[_0x4a13('0xc')](),controller['destroy']);module[_0x4a13('0x12')]=router;
\ No newline at end of file
+var _0x3ef1=['util','express','fs-extra','../../components/auth/service','../../config/environment','index','/:id','show','isAuthenticated','put','update','delete','exports','multer'];(function(_0x54649d,_0x2c8fe7){var _0x19fb81=function(_0x7889cc){while(--_0x7889cc){_0x54649d['push'](_0x54649d['shift']());}};_0x19fb81(++_0x2c8fe7);}(_0x3ef1,0x187));var _0x13ef=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x3ef1[_0x334841];return _0x5beb4b;};'use strict';var multer=require(_0x13ef('0x0'));var util=require(_0x13ef('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x13ef('0x2'));var router=express['Router']();var fs_extra=require(_0x13ef('0x3'));var auth=require(_0x13ef('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x13ef('0x5'));var controller=require('./tag.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x13ef('0x6')]);router['get'](_0x13ef('0x7'),auth['isAuthenticated'](),controller[_0x13ef('0x8')]);router['post']('/',auth[_0x13ef('0x9')](),controller['create']);router[_0x13ef('0xa')](_0x13ef('0x7'),auth[_0x13ef('0x9')](),controller[_0x13ef('0xb')]);router[_0x13ef('0xc')](_0x13ef('0x7'),auth[_0x13ef('0x9')](),controller['destroy']);module[_0x13ef('0xd')]=router;
\ No newline at end of file
index a5592b5..ea8faf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8769=['#0091EA','STRING','sequelize','exports','name'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x8769,0x110));var _0x9876=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x8769[_0x17406a];return _0x1501ff;};'use strict';var Sequelize=require(_0x9876('0x0'));module[_0x9876('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9876('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x9876('0x3')},'description':{'type':Sequelize[_0x9876('0x4')]}};
\ No newline at end of file
+var _0x33d2=['exports','STRING','#0091EA','sequelize'];(function(_0x140b8c,_0x395c1b){var _0x13bfbe=function(_0x44b743){while(--_0x44b743){_0x140b8c['push'](_0x140b8c['shift']());}};_0x13bfbe(++_0x395c1b);}(_0x33d2,0x7f));var _0x233d=function(_0x12c4cd,_0xdebe29){_0x12c4cd=_0x12c4cd-0x0;var _0x18a029=_0x33d2[_0x12c4cd];return _0x18a029;};'use strict';var Sequelize=require(_0x233d('0x0'));module[_0x233d('0x1')]={'name':{'type':Sequelize[_0x233d('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x233d('0x2')],'defaultValue':_0x233d('0x3')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index b5af0e5..ef77a64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b1f=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','apply','reject','save','update','then','destroy','Tags','UserProfileResource','error','stack','name','send','Tag','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','findAll','catch','show','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x4b1f,0x195));var _0xf4b1=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x4b1f[_0x5c2e3e];return _0x53f64a;};'use strict';var emlformat=require(_0xf4b1('0x0'));var rimraf=require(_0xf4b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4b1('0x2'));var rp=require(_0xf4b1('0x3'));var moment=require(_0xf4b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf4b1('0x5'));var util=require(_0xf4b1('0x6'));var path=require(_0xf4b1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf4b1('0x8'));var fs=require('fs');var fs_extra=require(_0xf4b1('0x9'));var _=require(_0xf4b1('0xa'));var squel=require(_0xf4b1('0xb'));var crypto=require(_0xf4b1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf4b1('0xd'));var Papa=require('papaparse');var Redis=require(_0xf4b1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf4b1('0xf'));var hardwareService=require(_0xf4b1('0x10'));var logger=require(_0xf4b1('0x11'))(_0xf4b1('0x12'));var utils=require(_0xf4b1('0x13'));var config=require(_0xf4b1('0x14'));var licenseUtil=require(_0xf4b1('0x15'));var db=require(_0xf4b1('0x16'))['db'];function respondWithStatusCode(_0x38afbb,_0xf66b4c){_0xf66b4c=_0xf66b4c||0xcc;return function(_0x2c4eb9){if(_0x2c4eb9){return _0x38afbb[_0xf4b1('0x17')](_0xf66b4c);}return _0x38afbb[_0xf4b1('0x18')](_0xf66b4c)['end']();};}function respondWithResult(_0x591476,_0x3ea6f3){_0x3ea6f3=_0x3ea6f3||0xc8;return function(_0x5cbc25){if(_0x5cbc25){return _0x591476['status'](_0x3ea6f3)[_0xf4b1('0x19')](_0x5cbc25);}};}function respondWithFilteredResult(_0x51c39f,_0x5764b1){return function(_0x293f59){if(_0x293f59){var _0x4968f4=typeof _0x5764b1['offset']==='undefined'&&typeof _0x5764b1['limit']===_0xf4b1('0x1a');var _0x3ee70a=_0x293f59['count'];var _0x3b378e=_0x4968f4?0x0:_0x5764b1[_0xf4b1('0x1b')];var _0x322b38=_0x4968f4?_0x293f59[_0xf4b1('0x1c')]:_0x5764b1[_0xf4b1('0x1b')]+_0x5764b1[_0xf4b1('0x1d')];var _0x5b0214;if(_0x322b38>=_0x3ee70a){_0x322b38=_0x3ee70a;_0x5b0214=0xc8;}else{_0x5b0214=0xce;}_0x51c39f[_0xf4b1('0x18')](_0x5b0214);return _0x51c39f[_0xf4b1('0x1e')]('Content-Range',_0x3b378e+'-'+_0x322b38+'/'+_0x3ee70a)[_0xf4b1('0x19')](_0x293f59);}return null;};}function patchUpdates(_0x30c239){return function(_0x56ef48){try{jsonpatch[_0xf4b1('0x1f')](_0x56ef48,_0x30c239,!![]);}catch(_0x559a64){return BPromise[_0xf4b1('0x20')](_0x559a64);}return _0x56ef48[_0xf4b1('0x21')]();};}function saveUpdates(_0x5c50e8,_0x20013c){return function(_0x29b8c1){if(_0x29b8c1){return _0x29b8c1[_0xf4b1('0x22')](_0x5c50e8)[_0xf4b1('0x23')](function(_0x58376d){return _0x58376d;});}return null;};}function removeEntity(_0x92b390,_0x474212){return function(_0x4b6c08){if(_0x4b6c08){return _0x4b6c08[_0xf4b1('0x24')]()['then'](function(){var _0x15cfc4=_0x4b6c08['get']({'plain':!![]});var _0x238fbe=_0xf4b1('0x25');return db[_0xf4b1('0x26')]['destroy']({'where':{'type':_0x238fbe,'resourceId':_0x15cfc4['id']}})[_0xf4b1('0x23')](function(){return _0x4b6c08;});})['then'](function(){_0x92b390[_0xf4b1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29493b,_0x447ae7){return function(_0x5d28af){if(!_0x5d28af){_0x29493b[_0xf4b1('0x17')](0x194);}return _0x5d28af;};}function handleError(_0x23693b,_0x5bd8ee){_0x5bd8ee=_0x5bd8ee||0x1f4;return function(_0x125bf4){logger[_0xf4b1('0x27')](_0x125bf4[_0xf4b1('0x28')]);if(_0x125bf4[_0xf4b1('0x29')]){delete _0x125bf4[_0xf4b1('0x29')];}_0x23693b[_0xf4b1('0x18')](_0x5bd8ee)[_0xf4b1('0x2a')](_0x125bf4);};}exports['index']=function(_0x56ee5e,_0x31c13c){var _0xff9a65={},_0x1cbcff={},_0x29b9f9={'count':0x0,'rows':[]};var _0x35d81b=_['map'](db[_0xf4b1('0x2b')][_0xf4b1('0x2c')],function(_0xa6bdd7){return{'name':_0xa6bdd7[_0xf4b1('0x2d')],'type':_0xa6bdd7[_0xf4b1('0x2e')][_0xf4b1('0x2f')]};});_0x1cbcff[_0xf4b1('0x30')]=_[_0xf4b1('0x31')](_0x35d81b,'name');_0x1cbcff[_0xf4b1('0x32')]=_['keys'](_0x56ee5e['query']);_0x1cbcff['filters']=_[_0xf4b1('0x33')](_0x1cbcff[_0xf4b1('0x30')],_0x1cbcff[_0xf4b1('0x32')]);_0xff9a65[_0xf4b1('0x34')]=_[_0xf4b1('0x33')](_0x1cbcff[_0xf4b1('0x30')],qs[_0xf4b1('0x35')](_0x56ee5e[_0xf4b1('0x32')]['fields']));_0xff9a65[_0xf4b1('0x34')]=_0xff9a65['attributes'][_0xf4b1('0x36')]?_0xff9a65[_0xf4b1('0x34')]:_0x1cbcff['model'];if(!_0x56ee5e[_0xf4b1('0x32')][_0xf4b1('0x37')](_0xf4b1('0x38'))){_0xff9a65[_0xf4b1('0x1d')]=qs[_0xf4b1('0x1d')](_0x56ee5e['query'][_0xf4b1('0x1d')]);_0xff9a65['offset']=qs[_0xf4b1('0x1b')](_0x56ee5e['query'][_0xf4b1('0x1b')]);}_0xff9a65[_0xf4b1('0x39')]=qs[_0xf4b1('0x3a')](_0x56ee5e['query'][_0xf4b1('0x3a')]);_0xff9a65[_0xf4b1('0x3b')]=qs[_0xf4b1('0x3c')](_[_0xf4b1('0x3d')](_0x56ee5e[_0xf4b1('0x32')],_0x1cbcff[_0xf4b1('0x3c')]),_0x35d81b);if(_0x56ee5e[_0xf4b1('0x32')]['filter']){_0xff9a65[_0xf4b1('0x3b')]=_[_0xf4b1('0x3e')](_0xff9a65[_0xf4b1('0x3b')],{'$or':_[_0xf4b1('0x31')](_0x35d81b,function(_0x39de7f){if(_0x39de7f[_0xf4b1('0x2e')]!=='VIRTUAL'){var _0x33879b={};_0x33879b[_0x39de7f[_0xf4b1('0x29')]]={'$like':'%'+_0x56ee5e['query']['filter']+'%'};return _0x33879b;}})});}_0xff9a65=_[_0xf4b1('0x3e')]({},_0xff9a65,_0x56ee5e[_0xf4b1('0x3f')]);var _0x439c9d={'where':_0xff9a65[_0xf4b1('0x3b')]};return db[_0xf4b1('0x2b')][_0xf4b1('0x1c')](_0x439c9d)[_0xf4b1('0x23')](function(_0x1600b6){_0x29b9f9['count']=_0x1600b6;if(_0x56ee5e[_0xf4b1('0x32')]['includeAll']){_0xff9a65['include']=[{'all':!![]}];}return db['Tag'][_0xf4b1('0x40')](_0xff9a65);})[_0xf4b1('0x23')](function(_0x28b9f2){_0x29b9f9['rows']=_0x28b9f2;return _0x29b9f9;})[_0xf4b1('0x23')](respondWithFilteredResult(_0x31c13c,_0xff9a65))[_0xf4b1('0x41')](handleError(_0x31c13c,null));};exports[_0xf4b1('0x42')]=function(_0x5597d5,_0x13c130){var _0x15845a={'raw':!![],'where':{'id':_0x5597d5['params']['id']}},_0x1f856c={};_0x1f856c[_0xf4b1('0x30')]=_['keys'](db[_0xf4b1('0x2b')][_0xf4b1('0x2c')]);_0x1f856c[_0xf4b1('0x32')]=_['keys'](_0x5597d5[_0xf4b1('0x32')]);_0x1f856c[_0xf4b1('0x3c')]=_['intersection'](_0x1f856c[_0xf4b1('0x30')],_0x1f856c[_0xf4b1('0x32')]);_0x15845a[_0xf4b1('0x34')]=_[_0xf4b1('0x33')](_0x1f856c['model'],qs['fields'](_0x5597d5[_0xf4b1('0x32')][_0xf4b1('0x35')]));_0x15845a['attributes']=_0x15845a[_0xf4b1('0x34')]['length']?_0x15845a[_0xf4b1('0x34')]:_0x1f856c['model'];if(_0x5597d5[_0xf4b1('0x32')][_0xf4b1('0x43')]){_0x15845a['include']=[{'all':!![]}];}_0x15845a=_[_0xf4b1('0x3e')]({},_0x15845a,_0x5597d5[_0xf4b1('0x3f')]);return db[_0xf4b1('0x2b')][_0xf4b1('0x44')](_0x15845a)[_0xf4b1('0x23')](handleEntityNotFound(_0x13c130,null))[_0xf4b1('0x23')](respondWithResult(_0x13c130,null))[_0xf4b1('0x41')](handleError(_0x13c130,null));};exports[_0xf4b1('0x45')]=function(_0x4e6e04,_0x4a9761){return db[_0xf4b1('0x2b')][_0xf4b1('0x45')](_0x4e6e04['body'],{})[_0xf4b1('0x23')](function(_0x3476b3){var _0x21dc3b=_0x4e6e04[_0xf4b1('0x46')][_0xf4b1('0x47')]({'plain':!![]});if(!_0x21dc3b)throw new Error(_0xf4b1('0x48'));if(_0x21dc3b[_0xf4b1('0x49')]===_0xf4b1('0x46')){var _0x29c3c1=_0x3476b3[_0xf4b1('0x47')]({'plain':!![]});var _0x407ecf=_0xf4b1('0x25');return db[_0xf4b1('0x4a')][_0xf4b1('0x44')]({'where':{'name':_0x407ecf,'userProfileId':_0x21dc3b[_0xf4b1('0x4b')]},'raw':!![]})[_0xf4b1('0x23')](function(_0xacaa0e){if(_0xacaa0e&&_0xacaa0e[_0xf4b1('0x4c')]===0x0){return db[_0xf4b1('0x26')][_0xf4b1('0x45')]({'name':_0x29c3c1[_0xf4b1('0x29')],'resourceId':_0x29c3c1['id'],'type':_0xacaa0e[_0xf4b1('0x29')],'sectionId':_0xacaa0e['id']},{})[_0xf4b1('0x23')](function(){return _0x3476b3;});}else{return _0x3476b3;}})[_0xf4b1('0x41')](function(_0x389ad7){logger[_0xf4b1('0x27')](_0xf4b1('0x4d'),_0x389ad7);throw _0x389ad7;});}return _0x3476b3;})[_0xf4b1('0x23')](respondWithResult(_0x4a9761,0xc9))['catch'](handleError(_0x4a9761,null));};exports[_0xf4b1('0x22')]=function(_0x479e71,_0x5bdd65){if(_0x479e71[_0xf4b1('0x4e')]['id']){delete _0x479e71[_0xf4b1('0x4e')]['id'];}return db['Tag'][_0xf4b1('0x44')]({'where':{'id':_0x479e71[_0xf4b1('0x4f')]['id']}})[_0xf4b1('0x23')](handleEntityNotFound(_0x5bdd65,null))['then'](saveUpdates(_0x479e71['body'],null))[_0xf4b1('0x23')](respondWithResult(_0x5bdd65,null))[_0xf4b1('0x41')](handleError(_0x5bdd65,null));};exports[_0xf4b1('0x24')]=function(_0x38938f,_0x402e6c){return db[_0xf4b1('0x2b')][_0xf4b1('0x44')]({'where':{'id':_0x38938f[_0xf4b1('0x4f')]['id']}})[_0xf4b1('0x23')](handleEntityNotFound(_0x402e6c,null))[_0xf4b1('0x23')](removeEntity(_0x402e6c,null))[_0xf4b1('0x41')](handleError(_0x402e6c,null));};
\ No newline at end of file
+var _0x402f=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','map','Tag','rawAttributes','type','key','model','query'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x402f,0x6f));var _0xf402=function(_0x15f789,_0x4529e3){_0x15f789=_0x15f789-0x0;var _0x3fc171=_0x402f[_0x15f789];return _0x3fc171;};'use strict';var emlformat=require(_0xf402('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf402('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf402('0x2'));var BPromise=require(_0xf402('0x3'));var Mustache=require(_0xf402('0x4'));var util=require('util');var path=require(_0xf402('0x5'));var sox=require('sox');var csv=require(_0xf402('0x6'));var ejs=require(_0xf402('0x7'));var fs=require('fs');var fs_extra=require(_0xf402('0x8'));var _=require(_0xf402('0x9'));var squel=require(_0xf402('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf402('0xb'));var toCsv=require(_0xf402('0x6'));var querystring=require(_0xf402('0xc'));var Papa=require(_0xf402('0xd'));var Redis=require(_0xf402('0xe'));var authService=require(_0xf402('0xf'));var qs=require(_0xf402('0x10'));var as=require(_0xf402('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf402('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46758d,_0x4f8073){_0x4f8073=_0x4f8073||0xcc;return function(_0x5c127f){if(_0x5c127f){return _0x46758d['sendStatus'](_0x4f8073);}return _0x46758d[_0xf402('0x13')](_0x4f8073)['end']();};}function respondWithResult(_0x2ff50e,_0xb3deb6){_0xb3deb6=_0xb3deb6||0xc8;return function(_0x1ce72a){if(_0x1ce72a){return _0x2ff50e[_0xf402('0x13')](_0xb3deb6)['json'](_0x1ce72a);}};}function respondWithFilteredResult(_0x16767b,_0x4baaec){return function(_0x3af9e3){if(_0x3af9e3){var _0x5e38d8=typeof _0x4baaec['offset']==='undefined'&&typeof _0x4baaec[_0xf402('0x14')]===_0xf402('0x15');var _0xd406bf=_0x3af9e3[_0xf402('0x16')];var _0x2fbe36=_0x5e38d8?0x0:_0x4baaec[_0xf402('0x17')];var _0x3ed3eb=_0x5e38d8?_0x3af9e3[_0xf402('0x16')]:_0x4baaec[_0xf402('0x17')]+_0x4baaec[_0xf402('0x14')];var _0x5bb928;if(_0x3ed3eb>=_0xd406bf){_0x3ed3eb=_0xd406bf;_0x5bb928=0xc8;}else{_0x5bb928=0xce;}_0x16767b[_0xf402('0x13')](_0x5bb928);return _0x16767b[_0xf402('0x18')](_0xf402('0x19'),_0x2fbe36+'-'+_0x3ed3eb+'/'+_0xd406bf)[_0xf402('0x1a')](_0x3af9e3);}return null;};}function patchUpdates(_0x3d3ed4){return function(_0x30f661){try{jsonpatch[_0xf402('0x1b')](_0x30f661,_0x3d3ed4,!![]);}catch(_0xf52248){return BPromise[_0xf402('0x1c')](_0xf52248);}return _0x30f661['save']();};}function saveUpdates(_0x3cfe38,_0x4ffe46){return function(_0x297a68){if(_0x297a68){return _0x297a68[_0xf402('0x1d')](_0x3cfe38)[_0xf402('0x1e')](function(_0x477709){return _0x477709;});}return null;};}function removeEntity(_0x20dca1,_0x9cbd83){return function(_0x1b8064){if(_0x1b8064){return _0x1b8064[_0xf402('0x1f')]()[_0xf402('0x1e')](function(){var _0x427173=_0x1b8064[_0xf402('0x20')]({'plain':!![]});var _0xfad629='Tags';return db[_0xf402('0x21')][_0xf402('0x1f')]({'where':{'type':_0xfad629,'resourceId':_0x427173['id']}})[_0xf402('0x1e')](function(){return _0x1b8064;});})[_0xf402('0x1e')](function(){_0x20dca1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e26d3,_0x3f837e){return function(_0x3a6a8d){if(!_0x3a6a8d){_0x3e26d3[_0xf402('0x22')](0x194);}return _0x3a6a8d;};}function handleError(_0x32f1dc,_0x496d66){_0x496d66=_0x496d66||0x1f4;return function(_0x39a38a){logger['error'](_0x39a38a[_0xf402('0x23')]);if(_0x39a38a[_0xf402('0x24')]){delete _0x39a38a[_0xf402('0x24')];}_0x32f1dc[_0xf402('0x13')](_0x496d66)[_0xf402('0x25')](_0x39a38a);};}exports['index']=function(_0xaeda0f,_0x3720c6){var _0x10f130={},_0x5bb711={},_0x4d86bd={'count':0x0,'rows':[]};var _0x3ffab6=_[_0xf402('0x26')](db[_0xf402('0x27')][_0xf402('0x28')],function(_0x162cce){return{'name':_0x162cce['fieldName'],'type':_0x162cce[_0xf402('0x29')][_0xf402('0x2a')]};});_0x5bb711[_0xf402('0x2b')]=_[_0xf402('0x26')](_0x3ffab6,_0xf402('0x24'));_0x5bb711[_0xf402('0x2c')]=_['keys'](_0xaeda0f[_0xf402('0x2c')]);_0x5bb711[_0xf402('0x2d')]=_[_0xf402('0x2e')](_0x5bb711['model'],_0x5bb711['query']);_0x10f130[_0xf402('0x2f')]=_[_0xf402('0x2e')](_0x5bb711[_0xf402('0x2b')],qs['fields'](_0xaeda0f[_0xf402('0x2c')][_0xf402('0x30')]));_0x10f130[_0xf402('0x2f')]=_0x10f130[_0xf402('0x2f')][_0xf402('0x31')]?_0x10f130[_0xf402('0x2f')]:_0x5bb711['model'];if(!_0xaeda0f[_0xf402('0x2c')][_0xf402('0x32')](_0xf402('0x33'))){_0x10f130[_0xf402('0x14')]=qs[_0xf402('0x14')](_0xaeda0f['query'][_0xf402('0x14')]);_0x10f130[_0xf402('0x17')]=qs[_0xf402('0x17')](_0xaeda0f['query']['offset']);}_0x10f130[_0xf402('0x34')]=qs['sort'](_0xaeda0f[_0xf402('0x2c')][_0xf402('0x35')]);_0x10f130['where']=qs[_0xf402('0x2d')](_[_0xf402('0x36')](_0xaeda0f[_0xf402('0x2c')],_0x5bb711[_0xf402('0x2d')]),_0x3ffab6);if(_0xaeda0f[_0xf402('0x2c')][_0xf402('0x37')]){_0x10f130[_0xf402('0x38')]=_[_0xf402('0x39')](_0x10f130['where'],{'$or':_[_0xf402('0x26')](_0x3ffab6,function(_0x7301bf){if(_0x7301bf[_0xf402('0x29')]!==_0xf402('0x3a')){var _0x2fb923={};_0x2fb923[_0x7301bf['name']]={'$like':'%'+_0xaeda0f[_0xf402('0x2c')]['filter']+'%'};return _0x2fb923;}})});}_0x10f130=_[_0xf402('0x39')]({},_0x10f130,_0xaeda0f[_0xf402('0x3b')]);var _0x46b57f={'where':_0x10f130[_0xf402('0x38')]};return db[_0xf402('0x27')][_0xf402('0x16')](_0x46b57f)[_0xf402('0x1e')](function(_0x5d8a26){_0x4d86bd['count']=_0x5d8a26;if(_0xaeda0f[_0xf402('0x2c')][_0xf402('0x3c')]){_0x10f130[_0xf402('0x3d')]=[{'all':!![]}];}return db[_0xf402('0x27')][_0xf402('0x3e')](_0x10f130);})[_0xf402('0x1e')](function(_0x488587){_0x4d86bd[_0xf402('0x3f')]=_0x488587;return _0x4d86bd;})[_0xf402('0x1e')](respondWithFilteredResult(_0x3720c6,_0x10f130))[_0xf402('0x40')](handleError(_0x3720c6,null));};exports[_0xf402('0x41')]=function(_0x50c439,_0x16263b){var _0x1f0b26={'raw':!![],'where':{'id':_0x50c439[_0xf402('0x42')]['id']}},_0x299af2={};_0x299af2[_0xf402('0x2b')]=_[_0xf402('0x43')](db['Tag'][_0xf402('0x28')]);_0x299af2[_0xf402('0x2c')]=_['keys'](_0x50c439['query']);_0x299af2[_0xf402('0x2d')]=_[_0xf402('0x2e')](_0x299af2['model'],_0x299af2[_0xf402('0x2c')]);_0x1f0b26[_0xf402('0x2f')]=_[_0xf402('0x2e')](_0x299af2['model'],qs[_0xf402('0x30')](_0x50c439['query'][_0xf402('0x30')]));_0x1f0b26['attributes']=_0x1f0b26[_0xf402('0x2f')][_0xf402('0x31')]?_0x1f0b26['attributes']:_0x299af2['model'];if(_0x50c439[_0xf402('0x2c')][_0xf402('0x3c')]){_0x1f0b26['include']=[{'all':!![]}];}_0x1f0b26=_['merge']({},_0x1f0b26,_0x50c439[_0xf402('0x3b')]);return db[_0xf402('0x27')][_0xf402('0x44')](_0x1f0b26)[_0xf402('0x1e')](handleEntityNotFound(_0x16263b,null))[_0xf402('0x1e')](respondWithResult(_0x16263b,null))[_0xf402('0x40')](handleError(_0x16263b,null));};exports[_0xf402('0x45')]=function(_0xf91b26,_0x48dc6){return db['Tag'][_0xf402('0x45')](_0xf91b26[_0xf402('0x46')],{})[_0xf402('0x1e')](function(_0x5c2926){var _0x2e1b55=_0xf91b26[_0xf402('0x47')][_0xf402('0x20')]({'plain':!![]});if(!_0x2e1b55)throw new Error(_0xf402('0x48'));if(_0x2e1b55['role']===_0xf402('0x47')){var _0x411fa3=_0x5c2926[_0xf402('0x20')]({'plain':!![]});var _0x3e089e=_0xf402('0x49');return db[_0xf402('0x4a')][_0xf402('0x44')]({'where':{'name':_0x3e089e,'userProfileId':_0x2e1b55[_0xf402('0x4b')]},'raw':!![]})[_0xf402('0x1e')](function(_0x17ea91){if(_0x17ea91&&_0x17ea91[_0xf402('0x4c')]===0x0){return db[_0xf402('0x21')][_0xf402('0x45')]({'name':_0x411fa3['name'],'resourceId':_0x411fa3['id'],'type':_0x17ea91['name'],'sectionId':_0x17ea91['id']},{})[_0xf402('0x1e')](function(){return _0x5c2926;});}else{return _0x5c2926;}})['catch'](function(_0x5876da){logger['error'](_0xf402('0x4d'),_0x5876da);throw _0x5876da;});}return _0x5c2926;})[_0xf402('0x1e')](respondWithResult(_0x48dc6,0xc9))['catch'](handleError(_0x48dc6,null));};exports[_0xf402('0x1d')]=function(_0x30c78f,_0x12e61e){if(_0x30c78f[_0xf402('0x46')]['id']){delete _0x30c78f[_0xf402('0x46')]['id'];}return db[_0xf402('0x27')][_0xf402('0x44')]({'where':{'id':_0x30c78f[_0xf402('0x42')]['id']}})['then'](handleEntityNotFound(_0x12e61e,null))['then'](saveUpdates(_0x30c78f[_0xf402('0x46')],null))[_0xf402('0x1e')](respondWithResult(_0x12e61e,null))['catch'](handleError(_0x12e61e,null));};exports[_0xf402('0x1f')]=function(_0x2ee779,_0x49b1d6){return db['Tag'][_0xf402('0x44')]({'where':{'id':_0x2ee779['params']['id']}})[_0xf402('0x1e')](handleEntityNotFound(_0x49b1d6,null))['then'](removeEntity(_0x49b1d6,null))[_0xf402('0x40')](handleError(_0x49b1d6,null));};
\ No newline at end of file
index fc90126..10582a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9541=['Tag','tools_tags','lodash','util','api','bluebird','request-promise','path','../../config/environment','./tag.attributes','exports','define'];(function(_0x23bc0b,_0x5369a1){var _0x3b57a6=function(_0x4a14aa){while(--_0x4a14aa){_0x23bc0b['push'](_0x23bc0b['shift']());}};_0x3b57a6(++_0x5369a1);}(_0x9541,0xc2));var _0x1954=function(_0x374f8e,_0x1a5402){_0x374f8e=_0x374f8e-0x0;var _0x3bc591=_0x9541[_0x374f8e];return _0x3bc591;};'use strict';var _=require(_0x1954('0x0'));var util=require(_0x1954('0x1'));var logger=require('../../config/logger')(_0x1954('0x2'));var moment=require('moment');var BPromise=require(_0x1954('0x3'));var rp=require(_0x1954('0x4'));var fs=require('fs');var path=require(_0x1954('0x5'));var rimraf=require('rimraf');var config=require(_0x1954('0x6'));var attributes=require(_0x1954('0x7'));module[_0x1954('0x8')]=function(_0x8cfd61,_0x3b1dc3){return _0x8cfd61[_0x1954('0x9')](_0x1954('0xa'),attributes,{'tableName':_0x1954('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa216=['exports','tools_tags','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xef8e69,_0xbc78ff){var _0x463ee6=function(_0x2e0695){while(--_0x2e0695){_0xef8e69['push'](_0xef8e69['shift']());}};_0x463ee6(++_0xbc78ff);}(_0xa216,0xf4));var _0x6a21=function(_0x1fe260,_0xf6f3de){_0x1fe260=_0x1fe260-0x0;var _0xa08f3e=_0xa216[_0x1fe260];return _0xa08f3e;};'use strict';var _=require('lodash');var util=require(_0x6a21('0x0'));var logger=require(_0x6a21('0x1'))(_0x6a21('0x2'));var moment=require(_0x6a21('0x3'));var BPromise=require(_0x6a21('0x4'));var rp=require(_0x6a21('0x5'));var fs=require('fs');var path=require(_0x6a21('0x6'));var rimraf=require(_0x6a21('0x7'));var config=require(_0x6a21('0x8'));var attributes=require('./tag.attributes');module[_0x6a21('0x9')]=function(_0x1f7406,_0x5c728a){return _0x1f7406['define']('Tag',attributes,{'tableName':_0x6a21('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 350f660..ab48c0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5089=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x59a591,_0xc9132b){var _0x325ff9=function(_0x1e06f5){while(--_0x1e06f5){_0x59a591['push'](_0x59a591['shift']());}};_0x325ff9(++_0xc9132b);}(_0x5089,0x1bb));var _0x9508=function(_0x423097,_0x8a09f4){_0x423097=_0x423097-0x0;var _0x3a73f1=_0x5089[_0x423097];return _0x3a73f1;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var moment=require('moment');var BPromise=require(_0x9508('0x2'));var rs=require(_0x9508('0x3'));var fs=require('fs');var Redis=require(_0x9508('0x4'));var db=require(_0x9508('0x5'))['db'];var utils=require(_0x9508('0x6'));var logger=require('../../config/logger')(_0x9508('0x7'));var config=require('../../config/environment');var jayson=require(_0x9508('0x8'));var client=jayson[_0x9508('0x9')][_0x9508('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ab3c6,_0x1dc04c,_0x42d13a){return new BPromise(function(_0x55a5de,_0x14dae7){return client[_0x9508('0xb')](_0x4ab3c6,_0x42d13a)['then'](function(_0x342ddd){logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));logger[_0x9508('0xe')](_0x9508('0xf'),_0x1dc04c,_0x9508('0xd'),JSON[_0x9508('0x10')](_0x342ddd));if(_0x342ddd['error']){if(_0x342ddd[_0x9508('0x11')]['code']===0x1f4){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x342ddd['error'][_0x9508('0x12')]);return _0x14dae7(_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);}logger[_0x9508('0x11')]('Tag,\x20%s,\x20%s',_0x1dc04c,_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);return _0x55a5de(_0x342ddd['error'][_0x9508('0x12')]);}else{logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));_0x55a5de(_0x342ddd[_0x9508('0x13')][_0x9508('0x12')]);}})[_0x9508('0x14')](function(_0x343802){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x343802);_0x14dae7(_0x343802);});});}
\ No newline at end of file
+var _0xcea2=['Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info'];(function(_0xf73768,_0x299319){var _0x1a0731=function(_0x3f2ac4){while(--_0x3f2ac4){_0xf73768['push'](_0xf73768['shift']());}};_0x1a0731(++_0x299319);}(_0xcea2,0x15a));var _0x2cea=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xcea2[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x2cea('0x0'));var util=require('util');var moment=require(_0x2cea('0x1'));var BPromise=require('bluebird');var rs=require(_0x2cea('0x2'));var fs=require('fs');var Redis=require(_0x2cea('0x3'));var db=require(_0x2cea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cea('0x5'))(_0x2cea('0x6'));var config=require(_0x2cea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2cea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d69ff,_0xc04963,_0x805a1b){return new BPromise(function(_0x160cca,_0x11c5c0){return client[_0x2cea('0x9')](_0x2d69ff,_0x805a1b)['then'](function(_0x1f4d90){logger[_0x2cea('0xa')](_0x2cea('0xb'),_0xc04963,_0x2cea('0xc'));logger[_0x2cea('0xd')](_0x2cea('0xe'),_0xc04963,_0x2cea('0xc'),JSON[_0x2cea('0xf')](_0x1f4d90));if(_0x1f4d90['error']){if(_0x1f4d90['error'][_0x2cea('0x10')]===0x1f4){logger[_0x2cea('0x11')]('Tag,\x20%s,\x20%s',_0xc04963,_0x1f4d90['error'][_0x2cea('0x12')]);return _0x11c5c0(_0x1f4d90['error'][_0x2cea('0x12')]);}logger[_0x2cea('0x11')](_0x2cea('0xb'),_0xc04963,_0x1f4d90['error']['message']);return _0x160cca(_0x1f4d90['error'][_0x2cea('0x12')]);}else{logger['info'](_0x2cea('0xb'),_0xc04963,_0x2cea('0xc'));_0x160cca(_0x1f4d90[_0x2cea('0x13')][_0x2cea('0x12')]);}})[_0x2cea('0x14')](function(_0x1bbfdb){logger[_0x2cea('0x11')](_0x2cea('0xb'),_0xc04963,_0x1bbfdb);_0x11c5c0(_0x1bbfdb);});});}
\ No newline at end of file
index 7f0667c..b9896d6 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 d97914b..0ff0ad4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','sequelize','STRING'];(function(_0x22732f,_0x2dff55){var _0x8062a7=function(_0x3d04d1){while(--_0x3d04d1){_0x22732f['push'](_0x22732f['shift']());}};_0x8062a7(++_0x2dff55);}(_0xb10b,0x12a));var _0xbb10=function(_0x34f545,_0x2bd2ee){_0x34f545=_0x34f545-0x0;var _0x1ff6b8=_0xb10b[_0x34f545];return _0x1ff6b8;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x4a4717,_0x2445b8){var _0x39be4e=function(_0x4f7ce6){while(--_0x4f7ce6){_0x4a4717['push'](_0x4a4717['shift']());}};_0x39be4e(++_0x2445b8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6de8308..c8e2e32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['QueueId','online','interface','UserVoiceQueueRt','upsert','format','SIP/%s','voicePause','all','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','spread','removeAgents','Mail','transaction','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Teams','UserProfileResource','error','stack','name','send','map','Team','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','then','includeAll','rows','show','params','keys','length','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','addQueues','add','remove','Queues','ids','addAgents','isArray','Chat','Sms','Fax','Openchannel','sequelize','Voice','through','penalty','TeamVoiceQueue','User','findOrCreate','emit','Queue:save'];(function(_0x56d78c,_0x2b65d6){var _0x9a8155=function(_0x3cb3ad){while(--_0x3cb3ad){_0x56d78c['push'](_0x56d78c['shift']());}};_0x9a8155(++_0x2b65d6);}(_0x34e8,0x12c));var _0x834e=function(_0x172d7b,_0x222a05){_0x172d7b=_0x172d7b-0x0;var _0x30ee7e=_0x34e8[_0x172d7b];return _0x30ee7e;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];config[_0x834e('0x1c')]=_[_0x834e('0x1d')](config['redis'],{'host':_0x834e('0x1e'),'port':0x18eb});var socket=require(_0x834e('0x1f'))(new Redis(config[_0x834e('0x1c')]));require(_0x834e('0x20'))['register'](socket);function respondWithStatusCode(_0x43156c,_0x302cbd){_0x302cbd=_0x302cbd||0xcc;return function(_0x57274a){if(_0x57274a){return _0x43156c[_0x834e('0x21')](_0x302cbd);}return _0x43156c['status'](_0x302cbd)[_0x834e('0x22')]();};}function respondWithResult(_0x36d443,_0x478afe){_0x478afe=_0x478afe||0xc8;return function(_0x43ac41){if(_0x43ac41){return _0x36d443[_0x834e('0x23')](_0x478afe)[_0x834e('0x24')](_0x43ac41);}};}function respondWithFilteredResult(_0x50b3f6,_0x283e56){return function(_0x211e9a){if(_0x211e9a){var _0x34e41a=typeof _0x283e56[_0x834e('0x25')]===_0x834e('0x26')&&typeof _0x283e56[_0x834e('0x27')]===_0x834e('0x26');var _0x595515=_0x211e9a[_0x834e('0x28')];var _0x1fd2c6=_0x34e41a?0x0:_0x283e56[_0x834e('0x25')];var _0x325a99=_0x34e41a?_0x211e9a['count']:_0x283e56[_0x834e('0x25')]+_0x283e56[_0x834e('0x27')];var _0x5a05c0;if(_0x325a99>=_0x595515){_0x325a99=_0x595515;_0x5a05c0=0xc8;}else{_0x5a05c0=0xce;}_0x50b3f6[_0x834e('0x23')](_0x5a05c0);return _0x50b3f6[_0x834e('0x29')](_0x834e('0x2a'),_0x1fd2c6+'-'+_0x325a99+'/'+_0x595515)['json'](_0x211e9a);}return null;};}function patchUpdates(_0x4e3f48){return function(_0x231619){try{jsonpatch[_0x834e('0x2b')](_0x231619,_0x4e3f48,!![]);}catch(_0x589dde){return BPromise[_0x834e('0x2c')](_0x589dde);}return _0x231619[_0x834e('0x2d')]();};}function saveUpdates(_0x58f4fd,_0x3bc4f7){return function(_0x2e1983){if(_0x2e1983){return _0x2e1983[_0x834e('0x2e')](_0x58f4fd)['then'](function(_0x24fcf7){return _0x24fcf7;});}return null;};}function removeEntity(_0x3e310f,_0x5e1cc5){return function(_0x5bef62){if(_0x5bef62){return _0x5bef62[_0x834e('0x2f')]()['then'](function(){var _0x2826ec=_0x5bef62[_0x834e('0x30')]({'plain':!![]});var _0x3db026=_0x834e('0x31');return db[_0x834e('0x32')][_0x834e('0x2f')]({'where':{'type':_0x3db026,'resourceId':_0x2826ec['id']}})['then'](function(){return _0x5bef62;});})['then'](function(){_0x3e310f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7a8d,_0x567cea){return function(_0x106d6a){if(!_0x106d6a){_0x2c7a8d['sendStatus'](0x194);}return _0x106d6a;};}function handleError(_0xb5bc06,_0x11f1ce){_0x11f1ce=_0x11f1ce||0x1f4;return function(_0x1f3671){logger[_0x834e('0x33')](_0x1f3671[_0x834e('0x34')]);if(_0x1f3671[_0x834e('0x35')]){delete _0x1f3671[_0x834e('0x35')];}_0xb5bc06[_0x834e('0x23')](_0x11f1ce)[_0x834e('0x36')](_0x1f3671);};}exports['index']=function(_0xef9ec2,_0x5cad11){var _0x2c75c2={},_0x3787b0={},_0x9ab921={'count':0x0,'rows':[]};var _0x2b3418=_[_0x834e('0x37')](db[_0x834e('0x38')][_0x834e('0x39')],function(_0x38cd29){return{'name':_0x38cd29[_0x834e('0x3a')],'type':_0x38cd29[_0x834e('0x3b')]['key']};});_0x3787b0[_0x834e('0x3c')]=_[_0x834e('0x37')](_0x2b3418,_0x834e('0x35'));_0x3787b0[_0x834e('0x3d')]=_['keys'](_0xef9ec2[_0x834e('0x3d')]);_0x3787b0[_0x834e('0x3e')]=_['intersection'](_0x3787b0['model'],_0x3787b0['query']);_0x2c75c2[_0x834e('0x3f')]=_[_0x834e('0x40')](_0x3787b0[_0x834e('0x3c')],qs[_0x834e('0x41')](_0xef9ec2[_0x834e('0x3d')][_0x834e('0x41')]));_0x2c75c2['attributes']=_0x2c75c2[_0x834e('0x3f')]['length']?_0x2c75c2[_0x834e('0x3f')]:_0x3787b0[_0x834e('0x3c')];if(!_0xef9ec2['query'][_0x834e('0x42')](_0x834e('0x43'))){_0x2c75c2['limit']=qs['limit'](_0xef9ec2[_0x834e('0x3d')][_0x834e('0x27')]);_0x2c75c2[_0x834e('0x25')]=qs[_0x834e('0x25')](_0xef9ec2[_0x834e('0x3d')]['offset']);}_0x2c75c2[_0x834e('0x44')]=qs['sort'](_0xef9ec2['query'][_0x834e('0x45')]);_0x2c75c2['where']=qs[_0x834e('0x3e')](_[_0x834e('0x46')](_0xef9ec2[_0x834e('0x3d')],_0x3787b0[_0x834e('0x3e')]),_0x2b3418);if(_0xef9ec2[_0x834e('0x3d')]['filter']){_0x2c75c2[_0x834e('0x47')]=_[_0x834e('0x48')](_0x2c75c2[_0x834e('0x47')],{'$or':_['map'](_0x2b3418,function(_0x35380e){if(_0x35380e[_0x834e('0x3b')]!=='VIRTUAL'){var _0x1e3e71={};_0x1e3e71[_0x35380e['name']]={'$like':'%'+_0xef9ec2[_0x834e('0x3d')][_0x834e('0x49')]+'%'};return _0x1e3e71;}})});}_0x2c75c2=_['merge']({},_0x2c75c2,_0xef9ec2['options']);var _0x22ea21={'where':_0x2c75c2[_0x834e('0x47')]};return db[_0x834e('0x38')][_0x834e('0x28')](_0x22ea21)[_0x834e('0x4a')](function(_0x23feea){_0x9ab921[_0x834e('0x28')]=_0x23feea;if(_0xef9ec2['query'][_0x834e('0x4b')]){_0x2c75c2['include']=[{'all':!![]}];}return db[_0x834e('0x38')]['findAll'](_0x2c75c2);})[_0x834e('0x4a')](function(_0x5a5807){_0x9ab921[_0x834e('0x4c')]=_0x5a5807;return _0x9ab921;})[_0x834e('0x4a')](respondWithFilteredResult(_0x5cad11,_0x2c75c2))['catch'](handleError(_0x5cad11,null));};exports[_0x834e('0x4d')]=function(_0x3f2321,_0xa880cb){var _0xd55cc3={'raw':![],'where':{'id':_0x3f2321[_0x834e('0x4e')]['id']}},_0x252ea0={};_0x252ea0[_0x834e('0x3c')]=_[_0x834e('0x4f')](db[_0x834e('0x38')][_0x834e('0x39')]);_0x252ea0['query']=_[_0x834e('0x4f')](_0x3f2321[_0x834e('0x3d')]);_0x252ea0['filters']=_[_0x834e('0x40')](_0x252ea0[_0x834e('0x3c')],_0x252ea0[_0x834e('0x3d')]);_0xd55cc3[_0x834e('0x3f')]=_[_0x834e('0x40')](_0x252ea0[_0x834e('0x3c')],qs['fields'](_0x3f2321['query'][_0x834e('0x41')]));_0xd55cc3[_0x834e('0x3f')]=_0xd55cc3[_0x834e('0x3f')][_0x834e('0x50')]?_0xd55cc3[_0x834e('0x3f')]:_0x252ea0[_0x834e('0x3c')];if(_0x3f2321[_0x834e('0x3d')][_0x834e('0x4b')]){_0xd55cc3[_0x834e('0x51')]=[{'all':!![]}];}_0xd55cc3=_[_0x834e('0x48')]({},_0xd55cc3,_0x3f2321[_0x834e('0x52')]);return db[_0x834e('0x38')][_0x834e('0x53')](_0xd55cc3)[_0x834e('0x4a')](handleEntityNotFound(_0xa880cb,null))[_0x834e('0x4a')](respondWithResult(_0xa880cb,null))[_0x834e('0x54')](handleError(_0xa880cb,null));};exports[_0x834e('0x55')]=function(_0x32b8f7,_0x420841){return db[_0x834e('0x38')]['create'](_0x32b8f7[_0x834e('0x56')],{})[_0x834e('0x4a')](function(_0x4e73e0){var _0x3c00a3=_0x32b8f7[_0x834e('0x57')]['get']({'plain':!![]});if(!_0x3c00a3)throw new Error(_0x834e('0x58'));if(_0x3c00a3[_0x834e('0x59')]===_0x834e('0x57')){var _0x35636e=_0x4e73e0[_0x834e('0x30')]({'plain':!![]});var _0xb77aab=_0x834e('0x31');return db['UserProfileSection'][_0x834e('0x53')]({'where':{'name':_0xb77aab,'userProfileId':_0x3c00a3[_0x834e('0x5a')]},'raw':!![]})[_0x834e('0x4a')](function(_0x363675){if(_0x363675&&_0x363675[_0x834e('0x5b')]===0x0){return db[_0x834e('0x32')][_0x834e('0x55')]({'name':_0x35636e[_0x834e('0x35')],'resourceId':_0x35636e['id'],'type':_0x363675['name'],'sectionId':_0x363675['id']},{})[_0x834e('0x4a')](function(){return _0x4e73e0;});}else{return _0x4e73e0;}})['catch'](function(_0x2f4bde){logger['error'](_0x834e('0x5c'),_0x2f4bde);throw _0x2f4bde;});}return _0x4e73e0;})['then'](respondWithResult(_0x420841,0xc9))['catch'](handleError(_0x420841,null));};exports[_0x834e('0x2e')]=function(_0x3e1bee,_0x5291ae){if(_0x3e1bee['body']['id']){delete _0x3e1bee[_0x834e('0x56')]['id'];}return db[_0x834e('0x38')][_0x834e('0x53')]({'where':{'id':_0x3e1bee[_0x834e('0x4e')]['id']}})[_0x834e('0x4a')](handleEntityNotFound(_0x5291ae,null))[_0x834e('0x4a')](saveUpdates(_0x3e1bee[_0x834e('0x56')],null))[_0x834e('0x4a')](respondWithResult(_0x5291ae,null))['catch'](handleError(_0x5291ae,null));};exports[_0x834e('0x2f')]=function(_0x3c70bf,_0x5d5ac2){return db[_0x834e('0x38')]['find']({'where':{'id':_0x3c70bf[_0x834e('0x4e')]['id']}})[_0x834e('0x4a')](handleEntityNotFound(_0x5d5ac2,null))['then'](removeEntity(_0x5d5ac2,null))[_0x834e('0x54')](handleError(_0x5d5ac2,null));};exports[_0x834e('0x5d')]=function(_0x2de29a,_0x25f720,_0x5a2924){return db[_0x834e('0x38')][_0x834e('0x5e')]({'where':{'id':_0x2de29a[_0x834e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x25f720,null))[_0x834e('0x4a')](function(_0x1fcae9){if(!_0x2de29a[_0x834e('0x3d')][_0x834e('0x5f')]||!utils[_0x834e('0x60')](_0x2de29a[_0x834e('0x3d')][_0x834e('0x5f')])){throw new db[(_0x834e('0x61'))][(_0x834e('0x62'))](_0x834e('0x63'));}var _0x1e4310={};var _0x1dfa95={};_0x1dfa95[_0x834e('0x3c')]=_[_0x834e('0x4f')](db[_[_0x834e('0x64')](_0x2de29a[_0x834e('0x3d')][_0x834e('0x5f')][_0x834e('0x65')]())+_0x834e('0x66')][_0x834e('0x39')]);_0x1dfa95[_0x834e('0x3d')]=_[_0x834e('0x4f')](_0x2de29a['query']);_0x1dfa95[_0x834e('0x3e')]=_[_0x834e('0x40')](_0x1dfa95[_0x834e('0x3c')],_0x1dfa95[_0x834e('0x3d')]);_0x1e4310['attributes']=_[_0x834e('0x40')](_0x1dfa95['model'],qs['fields'](_0x2de29a[_0x834e('0x3d')][_0x834e('0x41')]));_0x1e4310[_0x834e('0x3f')]=_0x1e4310[_0x834e('0x3f')][_0x834e('0x50')]?_0x1e4310[_0x834e('0x3f')]:_0x1dfa95[_0x834e('0x3c')];_0x1e4310[_0x834e('0x27')]=qs['limit'](_0x2de29a[_0x834e('0x3d')]['limit']);_0x1e4310[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x2de29a['query']['offset']);_0x1e4310[_0x834e('0x44')]=qs[_0x834e('0x45')](_0x2de29a[_0x834e('0x3d')][_0x834e('0x45')]);_0x1e4310[_0x834e('0x47')]=qs['filters'](_[_0x834e('0x46')](_0x2de29a[_0x834e('0x3d')],_0x1dfa95[_0x834e('0x3e')]));_0x1e4310=_[_0x834e('0x48')]({},_0x1e4310,_0x2de29a[_0x834e('0x52')]);return _0x1fcae9[_0x834e('0x30')+_[_0x834e('0x64')](_0x2de29a[_0x834e('0x3d')][_0x834e('0x5f')][_0x834e('0x65')]())+'Queues'](_0x1e4310);})[_0x834e('0x4a')](respondWithResult(_0x25f720,null))[_0x834e('0x54')](handleError(_0x25f720,null));};exports[_0x834e('0x67')]=function(_0x5b5d6f,_0x51cfab,_0x46fa0d){return db['Team']['findOne']({'where':{'id':_0x5b5d6f['params']['id']}})[_0x834e('0x4a')](function(_0x332d8f){if(_0x332d8f){if(!_0x5b5d6f['body'][_0x834e('0x5f')]||!utils[_0x834e('0x60')](_0x5b5d6f['body'][_0x834e('0x5f')])){throw new db[(_0x834e('0x61'))]['ValidationError']('Unknown\x20channel');}return _0x332d8f[_0x834e('0x68')+_[_0x834e('0x64')](_0x5b5d6f[_0x834e('0x56')][_0x834e('0x5f')][_0x834e('0x65')]())+'Queues'](_0x5b5d6f[_0x834e('0x56')]['ids']);}return null;})[_0x834e('0x4a')](handleEntityNotFound(_0x51cfab,null))[_0x834e('0x4a')](respondWithStatusCode(_0x51cfab,null))[_0x834e('0x54')](handleError(_0x51cfab,null));};exports['removeQueues']=function(_0x33a3cd,_0x11f6f0,_0x48521f){return db[_0x834e('0x38')][_0x834e('0x5e')]({'where':{'id':_0x33a3cd[_0x834e('0x4e')]['id']}})['then'](function(_0x214014){if(_0x214014){if(!_0x33a3cd[_0x834e('0x3d')][_0x834e('0x5f')]||!utils[_0x834e('0x60')](_0x33a3cd[_0x834e('0x3d')][_0x834e('0x5f')])){throw new db[(_0x834e('0x61'))][(_0x834e('0x62'))](_0x834e('0x63'));}return _0x214014[_0x834e('0x69')+_['capitalize'](_0x33a3cd['query']['channel'][_0x834e('0x65')]())+_0x834e('0x6a')](_0x33a3cd[_0x834e('0x3d')][_0x834e('0x6b')]);}return null;})[_0x834e('0x4a')](handleEntityNotFound(_0x11f6f0,null))['then'](respondWithStatusCode(_0x11f6f0,null))['catch'](handleError(_0x11f6f0,null));};exports[_0x834e('0x6c')]=function(_0x1ad428,_0x23ad7c){var _0x18ddac=_[_0x834e('0x6d')](_0x1ad428['body'][_0x834e('0x6b')])?_0x1ad428[_0x834e('0x56')][_0x834e('0x6b')]:[_0x1ad428['body'][_0x834e('0x6b')]];var _0x18fde1=_0x1ad428[_0x834e('0x4e')]['id'];return db[_0x834e('0x38')][_0x834e('0x53')]({'where':{'id':_0x18fde1}})['then'](handleEntityNotFound(_0x23ad7c,null))['then'](function(_0x227797){if(_0x227797){var _0x40a872=['Voice',_0x834e('0x6e'),'Mail',_0x834e('0x6f'),_0x834e('0x70'),_0x834e('0x71'),'Whatsapp'];return db[_0x834e('0x72')]['transaction'](function(_0x5b2621){var _0x4d599d=_[_0x834e('0x37')](_0x40a872,function(_0x4627ac){var _0x1d7bab={'attributes':['id',_0x834e('0x35')]};if(_0x4627ac===_0x834e('0x73')){_0x1d7bab[_0x834e('0x74')]={'attributes':[_0x834e('0x75')]};}return _0x227797[_0x834e('0x30')+_0x4627ac+_0x834e('0x6a')](_0x1d7bab)['then'](function(_0x2f775a){var _0x54e70d=_[_0x834e('0x37')](_0x2f775a,function(_0x97c1a6){var _0x38bfa4=_[_0x834e('0x37')](_0x18ddac,function(_0x1d1877){var _0x116830={'where':{'UserId':_0x1d1877,[_0x4627ac+'QueueId']:_0x97c1a6['id']},'transaction':_0x5b2621};if(_0x4627ac==='Voice'){_0x116830[_0x834e('0x1d')]={'penalty':_0x97c1a6[_0x834e('0x76')]['penalty']};}return db[_0x834e('0x77')+_0x4627ac+_0x834e('0x66')][_0x834e('0x78')](_0x116830)[_0x834e('0x4a')](function(){socket[_0x834e('0x79')]('user'+_0x4627ac+_0x834e('0x7a'),{'UserId':_0x1d1877,[_0x4627ac+_0x834e('0x7b')]:_0x97c1a6['id']});if(_0x4627ac!=='Voice'){return;}return db['User']['findAll']({'where':{'id':_0x18ddac,'online':0x1},'attributes':['id',_0x834e('0x35'),_0x834e('0x7c'),'voicePause',_0x834e('0x7d')],'raw':!![]})[_0x834e('0x4a')](function(_0x49b480){var _0xfb93b1=_['map'](_0x49b480,function(_0x4813a8){return db[_0x834e('0x7e')][_0x834e('0x7f')]({'membername':_0x4813a8[_0x834e('0x35')],'UserId':_0x4813a8['id'],'queue_name':_0x97c1a6[_0x834e('0x35')],'VoiceQueueId':_0x97c1a6['id'],'interface':_['isNil'](_0x4813a8[_0x834e('0x7d')])?util[_0x834e('0x80')](_0x834e('0x81'),_0x4813a8[_0x834e('0x35')]):_0x4813a8[_0x834e('0x7d')],'paused':_0x4813a8[_0x834e('0x82')]||![],'penalty':_0x97c1a6[_0x834e('0x76')][_0x834e('0x75')]},{'transaction':_0x5b2621});});return Promise[_0x834e('0x83')](_0xfb93b1);});});});return Promise[_0x834e('0x83')](_0x38bfa4);});return Promise[_0x834e('0x83')](_0x54e70d);})[_0x834e('0x4a')](function(){return db[_0x834e('0x84')][_0x834e('0x5e')]({'where':{'teamId':_0x18fde1}})[_0x834e('0x4a')](function(_0x35bb19){if(_0x35bb19){var _0x3453c7=_[_0x834e('0x37')](_0x18ddac,function(_0x2db7b7){db[_0x834e('0x85')][_0x834e('0x7f')]({'UserId':_0x2db7b7,'VoicePrefixId':_0x35bb19[_0x834e('0x86')]});});return Promise['all'](_0x3453c7);}});});});return Promise[_0x834e('0x83')](_0x4d599d)[_0x834e('0x4a')](function(){return _0x227797[_0x834e('0x6c')](_0x18ddac,{'transaction':_0x5b2621})[_0x834e('0x87')](function(_0x14b603){return _0x14b603;});});});}})[_0x834e('0x4a')](respondWithResult(_0x23ad7c,null))[_0x834e('0x54')](handleError(_0x23ad7c,null));};exports[_0x834e('0x88')]=function(_0x11ca03,_0x4d226b){var _0x5ce790=_['isArray'](_0x11ca03[_0x834e('0x3d')]['ids'])?_0x11ca03[_0x834e('0x3d')][_0x834e('0x6b')]:[_0x11ca03[_0x834e('0x3d')]['ids']];var _0xae00f=_0x11ca03[_0x834e('0x4e')]['id'];return db[_0x834e('0x38')][_0x834e('0x53')]({'where':{'id':_0xae00f}})[_0x834e('0x4a')](handleEntityNotFound(_0x4d226b,null))[_0x834e('0x4a')](function(_0x528052){if(_0x528052){var _0x10dd7b=[_0x834e('0x73'),_0x834e('0x6e'),_0x834e('0x89'),_0x834e('0x6f'),'Fax','Openchannel','Whatsapp'];return db['sequelize'][_0x834e('0x8a')](function(_0x2ccdde){var _0x56fc05=_[_0x834e('0x37')](_0x10dd7b,function(_0xf9fec9){var _0x4fb709={'attributes':['id',_0x834e('0x35')]};return _0x528052[_0x834e('0x30')+_0xf9fec9+_0x834e('0x6a')](_0x4fb709)[_0x834e('0x4a')](function(_0x1d1075){var _0x404bab=_['map'](_0x1d1075,function(_0x5a49fc){return _0x5a49fc[_0x834e('0x88')](_0x5ce790,{'transaction':_0x2ccdde})[_0x834e('0x4a')](function(){var _0x1d2e12=_['map'](_0x5ce790,function(_0x34fb30){socket[_0x834e('0x79')]('user'+_0xf9fec9+_0x834e('0x8b'),{'UserId':Number(_0x34fb30),[_0xf9fec9+_0x834e('0x7b')]:_0x5a49fc['id']});if(_0xf9fec9!==_0x834e('0x73')){return;}return db[_0x834e('0x7e')]['destroy']({'where':{'VoiceQueueId':_0x5a49fc['id'],'UserId':_0x34fb30},'transaction':_0x2ccdde});});return Promise[_0x834e('0x83')](_0x1d2e12);});});return Promise['all'](_0x404bab);});});return Promise['all'](_0x56fc05)[_0x834e('0x4a')](function(){return _0x528052[_0x834e('0x88')](_0x5ce790,{'transaction':_0x2ccdde});})[_0x834e('0x4a')](function(){return db[_0x834e('0x84')][_0x834e('0x5e')]({'where':{'teamId':_0xae00f}})[_0x834e('0x4a')](function(_0x5bceba){if(_0x5bceba){var _0x591fab=_[_0x834e('0x37')](_0x5ce790,function(_0x2e040e){db[_0x834e('0x85')][_0x834e('0x2f')]({'where':{'UserId':_0x2e040e,'VoicePrefixId':_0x5bceba[_0x834e('0x86')]}});});return Promise[_0x834e('0x83')](_0x591fab);}});});});}})[_0x834e('0x4a')](respondWithStatusCode(_0x4d226b,null))['catch'](handleError(_0x4d226b,null));};exports[_0x834e('0x8c')]=function(_0xf25875,_0x56f28b,_0x4278ab){var _0x6a507a={};var _0xa0af07={};var _0x2a3ca4;var _0x284a75;return db[_0x834e('0x38')][_0x834e('0x5e')]({'where':{'id':_0xf25875[_0x834e('0x4e')]['id']}})[_0x834e('0x4a')](handleEntityNotFound(_0x56f28b,null))[_0x834e('0x4a')](function(_0x496709){if(_0x496709){_0x2a3ca4=_0x496709;_0xa0af07[_0x834e('0x3c')]=_[_0x834e('0x4f')](db[_0x834e('0x77')]['rawAttributes']);_0xa0af07[_0x834e('0x3d')]=_[_0x834e('0x4f')](_0xf25875['query']);_0xa0af07[_0x834e('0x3e')]=_['intersection'](_0xa0af07[_0x834e('0x3c')],_0xa0af07['query']);_0x6a507a[_0x834e('0x3f')]=_['intersection'](_0xa0af07[_0x834e('0x3c')],qs[_0x834e('0x41')](_0xf25875[_0x834e('0x3d')][_0x834e('0x41')]));_0x6a507a['attributes']=_0x6a507a[_0x834e('0x3f')][_0x834e('0x50')]?_0x6a507a[_0x834e('0x3f')]:_0xa0af07[_0x834e('0x3c')];_0x6a507a[_0x834e('0x44')]=qs[_0x834e('0x45')](_0xf25875[_0x834e('0x3d')][_0x834e('0x45')]);_0x6a507a[_0x834e('0x47')]=qs[_0x834e('0x3e')](_[_0x834e('0x46')](_0xf25875[_0x834e('0x3d')],_0xa0af07[_0x834e('0x3e')]));if(_0xf25875[_0x834e('0x3d')][_0x834e('0x49')]){_0x6a507a[_0x834e('0x47')]=_[_0x834e('0x48')](_0x6a507a['where'],{'$or':_['map'](_0x6a507a[_0x834e('0x3f')],function(_0x349685){var _0x3f52b9={};_0x3f52b9[_0x349685]={'$like':'%'+_0xf25875[_0x834e('0x3d')][_0x834e('0x49')]+'%'};return _0x3f52b9;})});}_0x6a507a=_[_0x834e('0x48')]({},_0x6a507a,_0xf25875[_0x834e('0x52')]);return _0x2a3ca4[_0x834e('0x8c')](_0x6a507a);}})[_0x834e('0x4a')](function(_0x58cd3b){if(_0x58cd3b){_0x284a75=_0x58cd3b[_0x834e('0x50')];if(!_0xf25875[_0x834e('0x3d')]['hasOwnProperty'](_0x834e('0x43'))){_0x6a507a['limit']=qs[_0x834e('0x27')](_0xf25875[_0x834e('0x3d')][_0x834e('0x27')]);_0x6a507a['offset']=qs[_0x834e('0x25')](_0xf25875[_0x834e('0x3d')]['offset']);}return _0x2a3ca4['getAgents'](_0x6a507a);}})[_0x834e('0x4a')](function(_0x3b7b1a){if(_0x3b7b1a){return _0x3b7b1a?{'count':_0x284a75,'rows':_0x3b7b1a}:null;}})['then'](respondWithResult(_0x56f28b,null))[_0x834e('0x54')](handleError(_0x56f28b,null));};
\ No newline at end of file
+var _0x9c44=['redis','socket.io-emitter','./team.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','reject','save','then','destroy','UserProfileResource','error','stack','name','index','map','Team','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','catch','show','params','includeAll','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','update','channel','isValidChannel','Sequelize','ValidationError','capitalize','length','toLowerCase','Queues','addQueues','findOne','add','ids','removeQueues','Unknown\x20channel','remove','addAgents','isArray','Voice','Mail','Fax','Openchannel','Whatsapp','sequelize','transaction','through','penalty','User','findOrCreate','Queue:save','QueueId','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','TeamVoiceQueue','all','TeamVoicePrefix','UserVoicePrefix','spread','removeAgents','Sms','emit','Queue:remove','VoicePrefixId','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','defaults'];(function(_0x2a1239,_0x5cd0f5){var _0x28884f=function(_0x3cd0b2){while(--_0x3cd0b2){_0x2a1239['push'](_0x2a1239['shift']());}};_0x28884f(++_0x5cd0f5);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];config['redis']=_[_0x49c4('0x16')](config[_0x49c4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x49c4('0x18'))(new Redis(config[_0x49c4('0x17')]));require(_0x49c4('0x19'))[_0x49c4('0x1a')](socket);function respondWithStatusCode(_0x12777c,_0x18211c){_0x18211c=_0x18211c||0xcc;return function(_0x75ea8){if(_0x75ea8){return _0x12777c[_0x49c4('0x1b')](_0x18211c);}return _0x12777c['status'](_0x18211c)[_0x49c4('0x1c')]();};}function respondWithResult(_0x141003,_0x13a2db){_0x13a2db=_0x13a2db||0xc8;return function(_0x81e831){if(_0x81e831){return _0x141003[_0x49c4('0x1d')](_0x13a2db)['json'](_0x81e831);}};}function respondWithFilteredResult(_0x44e607,_0x2891f4){return function(_0x4c3253){if(_0x4c3253){var _0x512650=typeof _0x2891f4[_0x49c4('0x1e')]===_0x49c4('0x1f')&&typeof _0x2891f4[_0x49c4('0x20')]==='undefined';var _0x24856d=_0x4c3253['count'];var _0x2cbd50=_0x512650?0x0:_0x2891f4[_0x49c4('0x1e')];var _0xe31fcc=_0x512650?_0x4c3253[_0x49c4('0x21')]:_0x2891f4[_0x49c4('0x1e')]+_0x2891f4[_0x49c4('0x20')];var _0x280893;if(_0xe31fcc>=_0x24856d){_0xe31fcc=_0x24856d;_0x280893=0xc8;}else{_0x280893=0xce;}_0x44e607[_0x49c4('0x1d')](_0x280893);return _0x44e607[_0x49c4('0x22')]('Content-Range',_0x2cbd50+'-'+_0xe31fcc+'/'+_0x24856d)['json'](_0x4c3253);}return null;};}function patchUpdates(_0x57f502){return function(_0x1c99b1){try{jsonpatch['apply'](_0x1c99b1,_0x57f502,!![]);}catch(_0x592bb8){return BPromise[_0x49c4('0x23')](_0x592bb8);}return _0x1c99b1[_0x49c4('0x24')]();};}function saveUpdates(_0x26c640,_0xd335e4){return function(_0x4811c4){if(_0x4811c4){return _0x4811c4['update'](_0x26c640)[_0x49c4('0x25')](function(_0x9cb797){return _0x9cb797;});}return null;};}function removeEntity(_0x565423,_0x207358){return function(_0x43e014){if(_0x43e014){return _0x43e014[_0x49c4('0x26')]()[_0x49c4('0x25')](function(){var _0x531d92=_0x43e014['get']({'plain':!![]});var _0x449960='Teams';return db[_0x49c4('0x27')][_0x49c4('0x26')]({'where':{'type':_0x449960,'resourceId':_0x531d92['id']}})[_0x49c4('0x25')](function(){return _0x43e014;});})[_0x49c4('0x25')](function(){_0x565423['status'](0xcc)[_0x49c4('0x1c')]();});}};}function handleEntityNotFound(_0x2b2793,_0x46e04d){return function(_0x4f28a2){if(!_0x4f28a2){_0x2b2793[_0x49c4('0x1b')](0x194);}return _0x4f28a2;};}function handleError(_0x29f835,_0x26ba17){_0x26ba17=_0x26ba17||0x1f4;return function(_0x427b26){logger[_0x49c4('0x28')](_0x427b26[_0x49c4('0x29')]);if(_0x427b26[_0x49c4('0x2a')]){delete _0x427b26['name'];}_0x29f835['status'](_0x26ba17)['send'](_0x427b26);};}exports[_0x49c4('0x2b')]=function(_0x7ee704,_0x1eb035){var _0x27e467={},_0x28eb47={},_0x574fd3={'count':0x0,'rows':[]};var _0x38ad77=_[_0x49c4('0x2c')](db[_0x49c4('0x2d')][_0x49c4('0x2e')],function(_0x58e252){return{'name':_0x58e252['fieldName'],'type':_0x58e252[_0x49c4('0x2f')][_0x49c4('0x30')]};});_0x28eb47[_0x49c4('0x31')]=_[_0x49c4('0x2c')](_0x38ad77,_0x49c4('0x2a'));_0x28eb47['query']=_[_0x49c4('0x32')](_0x7ee704[_0x49c4('0x33')]);_0x28eb47[_0x49c4('0x34')]=_['intersection'](_0x28eb47['model'],_0x28eb47[_0x49c4('0x33')]);_0x27e467[_0x49c4('0x35')]=_[_0x49c4('0x36')](_0x28eb47[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x7ee704[_0x49c4('0x33')][_0x49c4('0x37')]));_0x27e467[_0x49c4('0x35')]=_0x27e467[_0x49c4('0x35')]['length']?_0x27e467[_0x49c4('0x35')]:_0x28eb47['model'];if(!_0x7ee704[_0x49c4('0x33')][_0x49c4('0x38')](_0x49c4('0x39'))){_0x27e467[_0x49c4('0x20')]=qs['limit'](_0x7ee704[_0x49c4('0x33')][_0x49c4('0x20')]);_0x27e467[_0x49c4('0x1e')]=qs['offset'](_0x7ee704[_0x49c4('0x33')][_0x49c4('0x1e')]);}_0x27e467[_0x49c4('0x3a')]=qs[_0x49c4('0x3b')](_0x7ee704[_0x49c4('0x33')][_0x49c4('0x3b')]);_0x27e467[_0x49c4('0x3c')]=qs[_0x49c4('0x34')](_[_0x49c4('0x3d')](_0x7ee704[_0x49c4('0x33')],_0x28eb47[_0x49c4('0x34')]),_0x38ad77);if(_0x7ee704['query'][_0x49c4('0x3e')]){_0x27e467[_0x49c4('0x3c')]=_[_0x49c4('0x3f')](_0x27e467[_0x49c4('0x3c')],{'$or':_[_0x49c4('0x2c')](_0x38ad77,function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x2f')]!==_0x49c4('0x40')){var _0x248c0a={};_0x248c0a[_0x29dd5d[_0x49c4('0x2a')]]={'$like':'%'+_0x7ee704[_0x49c4('0x33')][_0x49c4('0x3e')]+'%'};return _0x248c0a;}})});}_0x27e467=_[_0x49c4('0x3f')]({},_0x27e467,_0x7ee704['options']);var _0x212366={'where':_0x27e467['where']};return db[_0x49c4('0x2d')][_0x49c4('0x21')](_0x212366)[_0x49c4('0x25')](function(_0x1480da){_0x574fd3[_0x49c4('0x21')]=_0x1480da;if(_0x7ee704[_0x49c4('0x33')]['includeAll']){_0x27e467['include']=[{'all':!![]}];}return db[_0x49c4('0x2d')][_0x49c4('0x41')](_0x27e467);})[_0x49c4('0x25')](function(_0x117151){_0x574fd3['rows']=_0x117151;return _0x574fd3;})[_0x49c4('0x25')](respondWithFilteredResult(_0x1eb035,_0x27e467))[_0x49c4('0x42')](handleError(_0x1eb035,null));};exports[_0x49c4('0x43')]=function(_0x444270,_0x81a674){var _0x3bde49={'raw':![],'where':{'id':_0x444270[_0x49c4('0x44')]['id']}},_0x1a9593={};_0x1a9593[_0x49c4('0x31')]=_['keys'](db[_0x49c4('0x2d')]['rawAttributes']);_0x1a9593[_0x49c4('0x33')]=_[_0x49c4('0x32')](_0x444270[_0x49c4('0x33')]);_0x1a9593[_0x49c4('0x34')]=_[_0x49c4('0x36')](_0x1a9593['model'],_0x1a9593[_0x49c4('0x33')]);_0x3bde49[_0x49c4('0x35')]=_[_0x49c4('0x36')](_0x1a9593[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x444270[_0x49c4('0x33')][_0x49c4('0x37')]));_0x3bde49['attributes']=_0x3bde49[_0x49c4('0x35')]['length']?_0x3bde49[_0x49c4('0x35')]:_0x1a9593[_0x49c4('0x31')];if(_0x444270[_0x49c4('0x33')][_0x49c4('0x45')]){_0x3bde49[_0x49c4('0x46')]=[{'all':!![]}];}_0x3bde49=_[_0x49c4('0x3f')]({},_0x3bde49,_0x444270[_0x49c4('0x47')]);return db['Team'][_0x49c4('0x48')](_0x3bde49)[_0x49c4('0x25')](handleEntityNotFound(_0x81a674,null))['then'](respondWithResult(_0x81a674,null))[_0x49c4('0x42')](handleError(_0x81a674,null));};exports[_0x49c4('0x49')]=function(_0xfbe179,_0x242afc){return db['Team']['create'](_0xfbe179[_0x49c4('0x4a')],{})['then'](function(_0x4597c3){var _0x1f941f=_0xfbe179[_0x49c4('0x4b')][_0x49c4('0x4c')]({'plain':!![]});if(!_0x1f941f)throw new Error(_0x49c4('0x4d'));if(_0x1f941f[_0x49c4('0x4e')]===_0x49c4('0x4b')){var _0x563f0b=_0x4597c3[_0x49c4('0x4c')]({'plain':!![]});var _0x1550ce=_0x49c4('0x4f');return db[_0x49c4('0x50')][_0x49c4('0x48')]({'where':{'name':_0x1550ce,'userProfileId':_0x1f941f[_0x49c4('0x51')]},'raw':!![]})[_0x49c4('0x25')](function(_0x25d174){if(_0x25d174&&_0x25d174[_0x49c4('0x52')]===0x0){return db[_0x49c4('0x27')]['create']({'name':_0x563f0b['name'],'resourceId':_0x563f0b['id'],'type':_0x25d174[_0x49c4('0x2a')],'sectionId':_0x25d174['id']},{})[_0x49c4('0x25')](function(){return _0x4597c3;});}else{return _0x4597c3;}})['catch'](function(_0x59a8bc){logger[_0x49c4('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59a8bc);throw _0x59a8bc;});}return _0x4597c3;})['then'](respondWithResult(_0x242afc,0xc9))[_0x49c4('0x42')](handleError(_0x242afc,null));};exports[_0x49c4('0x53')]=function(_0x4a0a93,_0x38c480){if(_0x4a0a93[_0x49c4('0x4a')]['id']){delete _0x4a0a93[_0x49c4('0x4a')]['id'];}return db[_0x49c4('0x2d')]['find']({'where':{'id':_0x4a0a93[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x38c480,null))[_0x49c4('0x25')](saveUpdates(_0x4a0a93[_0x49c4('0x4a')],null))[_0x49c4('0x25')](respondWithResult(_0x38c480,null))[_0x49c4('0x42')](handleError(_0x38c480,null));};exports['destroy']=function(_0x5c7ddd,_0x1ef0c1){return db[_0x49c4('0x2d')][_0x49c4('0x48')]({'where':{'id':_0x5c7ddd[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x1ef0c1,null))[_0x49c4('0x25')](removeEntity(_0x1ef0c1,null))[_0x49c4('0x42')](handleError(_0x1ef0c1,null));};exports['getQueues']=function(_0x45d715,_0x33c9a6,_0x4ba4eb){return db[_0x49c4('0x2d')]['findOne']({'where':{'id':_0x45d715[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x33c9a6,null))[_0x49c4('0x25')](function(_0x2fe89a){if(!_0x45d715[_0x49c4('0x33')][_0x49c4('0x54')]||!utils[_0x49c4('0x55')](_0x45d715[_0x49c4('0x33')]['channel'])){throw new db[(_0x49c4('0x56'))][(_0x49c4('0x57'))]('Unknown\x20channel');}var _0x10dec7={};var _0x299e74={};_0x299e74['model']=_[_0x49c4('0x32')](db[_[_0x49c4('0x58')](_0x45d715['query']['channel']['toLowerCase']())+'Queue'][_0x49c4('0x2e')]);_0x299e74['query']=_[_0x49c4('0x32')](_0x45d715[_0x49c4('0x33')]);_0x299e74['filters']=_[_0x49c4('0x36')](_0x299e74[_0x49c4('0x31')],_0x299e74['query']);_0x10dec7[_0x49c4('0x35')]=_[_0x49c4('0x36')](_0x299e74[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x45d715['query'][_0x49c4('0x37')]));_0x10dec7[_0x49c4('0x35')]=_0x10dec7[_0x49c4('0x35')][_0x49c4('0x59')]?_0x10dec7['attributes']:_0x299e74[_0x49c4('0x31')];_0x10dec7['limit']=qs['limit'](_0x45d715['query']['limit']);_0x10dec7[_0x49c4('0x1e')]=qs[_0x49c4('0x1e')](_0x45d715[_0x49c4('0x33')][_0x49c4('0x1e')]);_0x10dec7['order']=qs['sort'](_0x45d715[_0x49c4('0x33')][_0x49c4('0x3b')]);_0x10dec7[_0x49c4('0x3c')]=qs[_0x49c4('0x34')](_[_0x49c4('0x3d')](_0x45d715[_0x49c4('0x33')],_0x299e74[_0x49c4('0x34')]));_0x10dec7=_[_0x49c4('0x3f')]({},_0x10dec7,_0x45d715['options']);return _0x2fe89a[_0x49c4('0x4c')+_['capitalize'](_0x45d715[_0x49c4('0x33')][_0x49c4('0x54')][_0x49c4('0x5a')]())+_0x49c4('0x5b')](_0x10dec7);})[_0x49c4('0x25')](respondWithResult(_0x33c9a6,null))[_0x49c4('0x42')](handleError(_0x33c9a6,null));};exports[_0x49c4('0x5c')]=function(_0x3feb0b,_0x13d951,_0x1743d0){return db[_0x49c4('0x2d')][_0x49c4('0x5d')]({'where':{'id':_0x3feb0b[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](function(_0x2d5f63){if(_0x2d5f63){if(!_0x3feb0b[_0x49c4('0x4a')][_0x49c4('0x54')]||!utils[_0x49c4('0x55')](_0x3feb0b['body']['channel'])){throw new db[(_0x49c4('0x56'))][(_0x49c4('0x57'))]('Unknown\x20channel');}return _0x2d5f63[_0x49c4('0x5e')+_[_0x49c4('0x58')](_0x3feb0b[_0x49c4('0x4a')][_0x49c4('0x54')]['toLowerCase']())+'Queues'](_0x3feb0b['body'][_0x49c4('0x5f')]);}return null;})[_0x49c4('0x25')](handleEntityNotFound(_0x13d951,null))[_0x49c4('0x25')](respondWithStatusCode(_0x13d951,null))[_0x49c4('0x42')](handleError(_0x13d951,null));};exports[_0x49c4('0x60')]=function(_0x146706,_0x191afb,_0x3692a4){return db[_0x49c4('0x2d')]['findOne']({'where':{'id':_0x146706[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](function(_0x342f8f){if(_0x342f8f){if(!_0x146706['query'][_0x49c4('0x54')]||!utils[_0x49c4('0x55')](_0x146706[_0x49c4('0x33')][_0x49c4('0x54')])){throw new db[(_0x49c4('0x56'))][(_0x49c4('0x57'))](_0x49c4('0x61'));}return _0x342f8f[_0x49c4('0x62')+_['capitalize'](_0x146706[_0x49c4('0x33')][_0x49c4('0x54')][_0x49c4('0x5a')]())+_0x49c4('0x5b')](_0x146706[_0x49c4('0x33')]['ids']);}return null;})['then'](handleEntityNotFound(_0x191afb,null))[_0x49c4('0x25')](respondWithStatusCode(_0x191afb,null))['catch'](handleError(_0x191afb,null));};exports[_0x49c4('0x63')]=function(_0x558880,_0x23516e){var _0x27b77d=_[_0x49c4('0x64')](_0x558880[_0x49c4('0x4a')]['ids'])?_0x558880[_0x49c4('0x4a')][_0x49c4('0x5f')]:[_0x558880[_0x49c4('0x4a')][_0x49c4('0x5f')]];var _0x100bc4=_0x558880[_0x49c4('0x44')]['id'];return db[_0x49c4('0x2d')][_0x49c4('0x48')]({'where':{'id':_0x100bc4}})[_0x49c4('0x25')](handleEntityNotFound(_0x23516e,null))[_0x49c4('0x25')](function(_0x5e7f45){if(_0x5e7f45){var _0x228189=[_0x49c4('0x65'),'Chat',_0x49c4('0x66'),'Sms',_0x49c4('0x67'),_0x49c4('0x68'),_0x49c4('0x69')];return db[_0x49c4('0x6a')][_0x49c4('0x6b')](function(_0x58b90c){var _0x16f618=_[_0x49c4('0x2c')](_0x228189,function(_0x596a9e){var _0x2b5136={'attributes':['id',_0x49c4('0x2a')]};if(_0x596a9e==='Voice'){_0x2b5136[_0x49c4('0x6c')]={'attributes':[_0x49c4('0x6d')]};}return _0x5e7f45['get'+_0x596a9e+_0x49c4('0x5b')](_0x2b5136)[_0x49c4('0x25')](function(_0x25989a){var _0x33dc39=_['map'](_0x25989a,function(_0x999ae2){var _0x7212ce=_['map'](_0x27b77d,function(_0x45df7c){var _0x5f0188={'where':{'UserId':_0x45df7c,[_0x596a9e+'QueueId']:_0x999ae2['id']},'transaction':_0x58b90c};if(_0x596a9e===_0x49c4('0x65')){_0x5f0188['defaults']={'penalty':_0x999ae2['TeamVoiceQueue'][_0x49c4('0x6d')]};}return db[_0x49c4('0x6e')+_0x596a9e+'Queue'][_0x49c4('0x6f')](_0x5f0188)['then'](function(){socket['emit']('user'+_0x596a9e+_0x49c4('0x70'),{'UserId':_0x45df7c,[_0x596a9e+_0x49c4('0x71')]:_0x999ae2['id']});if(_0x596a9e!==_0x49c4('0x65')){return;}return db[_0x49c4('0x6e')]['findAll']({'where':{'id':_0x27b77d,'online':0x1},'attributes':['id','name',_0x49c4('0x72'),'voicePause',_0x49c4('0x73')],'raw':!![]})['then'](function(_0x4e381c){var _0x10a048=_[_0x49c4('0x2c')](_0x4e381c,function(_0x1076be){return db[_0x49c4('0x74')][_0x49c4('0x75')]({'membername':_0x1076be[_0x49c4('0x2a')],'UserId':_0x1076be['id'],'queue_name':_0x999ae2['name'],'VoiceQueueId':_0x999ae2['id'],'interface':_[_0x49c4('0x76')](_0x1076be[_0x49c4('0x73')])?util[_0x49c4('0x77')](_0x49c4('0x78'),_0x1076be[_0x49c4('0x2a')]):_0x1076be['interface'],'paused':_0x1076be[_0x49c4('0x79')]||![],'penalty':_0x999ae2[_0x49c4('0x7a')][_0x49c4('0x6d')]},{'transaction':_0x58b90c});});return Promise['all'](_0x10a048);});});});return Promise['all'](_0x7212ce);});return Promise[_0x49c4('0x7b')](_0x33dc39);})[_0x49c4('0x25')](function(){return db[_0x49c4('0x7c')][_0x49c4('0x5d')]({'where':{'teamId':_0x100bc4}})[_0x49c4('0x25')](function(_0x4e1c71){if(_0x4e1c71){var _0x83b5f2=_[_0x49c4('0x2c')](_0x27b77d,function(_0x191974){db[_0x49c4('0x7d')]['upsert']({'UserId':_0x191974,'VoicePrefixId':_0x4e1c71['VoicePrefixId']});});return Promise[_0x49c4('0x7b')](_0x83b5f2);}});});});return Promise[_0x49c4('0x7b')](_0x16f618)[_0x49c4('0x25')](function(){return _0x5e7f45[_0x49c4('0x63')](_0x27b77d,{'transaction':_0x58b90c})[_0x49c4('0x7e')](function(_0x5413d8){return _0x5413d8;});});});}})[_0x49c4('0x25')](respondWithResult(_0x23516e,null))[_0x49c4('0x42')](handleError(_0x23516e,null));};exports[_0x49c4('0x7f')]=function(_0x1b0111,_0x2cddc1){var _0x8f37e5=_['isArray'](_0x1b0111[_0x49c4('0x33')][_0x49c4('0x5f')])?_0x1b0111[_0x49c4('0x33')][_0x49c4('0x5f')]:[_0x1b0111['query']['ids']];var _0xa96f53=_0x1b0111['params']['id'];return db[_0x49c4('0x2d')]['find']({'where':{'id':_0xa96f53}})[_0x49c4('0x25')](handleEntityNotFound(_0x2cddc1,null))[_0x49c4('0x25')](function(_0x25afc3){if(_0x25afc3){var _0x20bec7=['Voice','Chat',_0x49c4('0x66'),_0x49c4('0x80'),_0x49c4('0x67'),'Openchannel','Whatsapp'];return db[_0x49c4('0x6a')]['transaction'](function(_0x5c4742){var _0x1b9473=_['map'](_0x20bec7,function(_0x22668b){var _0x3cfa95={'attributes':['id','name']};return _0x25afc3[_0x49c4('0x4c')+_0x22668b+_0x49c4('0x5b')](_0x3cfa95)['then'](function(_0x5428a9){var _0xdb9820=_['map'](_0x5428a9,function(_0x43fe1c){return _0x43fe1c[_0x49c4('0x7f')](_0x8f37e5,{'transaction':_0x5c4742})[_0x49c4('0x25')](function(){var _0x352733=_[_0x49c4('0x2c')](_0x8f37e5,function(_0x4483fc){socket[_0x49c4('0x81')]('user'+_0x22668b+_0x49c4('0x82'),{'UserId':Number(_0x4483fc),[_0x22668b+_0x49c4('0x71')]:_0x43fe1c['id']});if(_0x22668b!==_0x49c4('0x65')){return;}return db[_0x49c4('0x74')][_0x49c4('0x26')]({'where':{'VoiceQueueId':_0x43fe1c['id'],'UserId':_0x4483fc},'transaction':_0x5c4742});});return Promise['all'](_0x352733);});});return Promise[_0x49c4('0x7b')](_0xdb9820);});});return Promise['all'](_0x1b9473)[_0x49c4('0x25')](function(){return _0x25afc3[_0x49c4('0x7f')](_0x8f37e5,{'transaction':_0x5c4742});})[_0x49c4('0x25')](function(){return db[_0x49c4('0x7c')]['findOne']({'where':{'teamId':_0xa96f53}})[_0x49c4('0x25')](function(_0x139696){if(_0x139696){var _0x312b02=_[_0x49c4('0x2c')](_0x8f37e5,function(_0x332173){db[_0x49c4('0x7d')]['destroy']({'where':{'UserId':_0x332173,'VoicePrefixId':_0x139696[_0x49c4('0x83')]}});});return Promise['all'](_0x312b02);}});});});}})[_0x49c4('0x25')](respondWithStatusCode(_0x2cddc1,null))[_0x49c4('0x42')](handleError(_0x2cddc1,null));};exports[_0x49c4('0x84')]=function(_0x2722fe,_0x5d864b,_0x46eaa1){var _0x17e7c6={};var _0x5829bc={};var _0x1e0b7d;var _0x3c321f;return db['Team']['findOne']({'where':{'id':_0x2722fe[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x5d864b,null))[_0x49c4('0x25')](function(_0x1aa3a3){if(_0x1aa3a3){_0x1e0b7d=_0x1aa3a3;_0x5829bc[_0x49c4('0x31')]=_[_0x49c4('0x32')](db[_0x49c4('0x6e')][_0x49c4('0x2e')]);_0x5829bc[_0x49c4('0x33')]=_[_0x49c4('0x32')](_0x2722fe[_0x49c4('0x33')]);_0x5829bc['filters']=_['intersection'](_0x5829bc[_0x49c4('0x31')],_0x5829bc[_0x49c4('0x33')]);_0x17e7c6[_0x49c4('0x35')]=_['intersection'](_0x5829bc[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x2722fe['query'][_0x49c4('0x37')]));_0x17e7c6['attributes']=_0x17e7c6[_0x49c4('0x35')][_0x49c4('0x59')]?_0x17e7c6[_0x49c4('0x35')]:_0x5829bc[_0x49c4('0x31')];_0x17e7c6['order']=qs[_0x49c4('0x3b')](_0x2722fe[_0x49c4('0x33')][_0x49c4('0x3b')]);_0x17e7c6[_0x49c4('0x3c')]=qs[_0x49c4('0x34')](_['pick'](_0x2722fe['query'],_0x5829bc['filters']));if(_0x2722fe[_0x49c4('0x33')][_0x49c4('0x3e')]){_0x17e7c6[_0x49c4('0x3c')]=_[_0x49c4('0x3f')](_0x17e7c6[_0x49c4('0x3c')],{'$or':_['map'](_0x17e7c6[_0x49c4('0x35')],function(_0x41ef7c){var _0x265dc3={};_0x265dc3[_0x41ef7c]={'$like':'%'+_0x2722fe[_0x49c4('0x33')]['filter']+'%'};return _0x265dc3;})});}_0x17e7c6=_[_0x49c4('0x3f')]({},_0x17e7c6,_0x2722fe[_0x49c4('0x47')]);return _0x1e0b7d[_0x49c4('0x84')](_0x17e7c6);}})[_0x49c4('0x25')](function(_0x2fda4f){if(_0x2fda4f){_0x3c321f=_0x2fda4f['length'];if(!_0x2722fe[_0x49c4('0x33')][_0x49c4('0x38')](_0x49c4('0x39'))){_0x17e7c6['limit']=qs[_0x49c4('0x20')](_0x2722fe[_0x49c4('0x33')][_0x49c4('0x20')]);_0x17e7c6['offset']=qs[_0x49c4('0x1e')](_0x2722fe['query']['offset']);}return _0x1e0b7d[_0x49c4('0x84')](_0x17e7c6);}})[_0x49c4('0x25')](function(_0x4ef4aa){if(_0x4ef4aa){return _0x4ef4aa?{'count':_0x3c321f,'rows':_0x4ef4aa}:null;}})[_0x49c4('0x25')](respondWithResult(_0x5d864b,null))[_0x49c4('0x42')](handleError(_0x5d864b,null));};
\ No newline at end of file
index fd670d2..c855633 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87c4=['Team','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x2f15ff,_0x5df964){var _0x51f125=function(_0x40dc3c){while(--_0x40dc3c){_0x2f15ff['push'](_0x2f15ff['shift']());}};_0x51f125(++_0x5df964);}(_0x87c4,0x1e2));var _0x487c=function(_0x44ec34,_0xe74c8a){_0x44ec34=_0x44ec34-0x0;var _0x377873=_0x87c4[_0x44ec34];return _0x377873;};'use strict';var EventEmitter=require('events');var Team=require(_0x487c('0x0'))['db'][_0x487c('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x487c('0x2')};function emitEvent(_0x201d1e){return function(_0x5492ee,_0xea6fee,_0x13973a){TeamEvents[_0x487c('0x3')](_0x201d1e+':'+_0x5492ee['id'],_0x5492ee);TeamEvents[_0x487c('0x3')](_0x201d1e,_0x5492ee);_0x13973a(null);};}for(var e in events){if(events[_0x487c('0x4')](e)){var event=events[e];Team[_0x487c('0x5')](e,emitEvent(event));}}module[_0x487c('0x6')]=TeamEvents;
\ No newline at end of file
+var _0x523e=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Team','setMaxListeners'];(function(_0x4bb0ac,_0x3c275a){var _0xfe6deb=function(_0x4e0392){while(--_0x4e0392){_0x4bb0ac['push'](_0x4bb0ac['shift']());}};_0xfe6deb(++_0x3c275a);}(_0x523e,0xed));var _0xe523=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x523e[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require('events');var Team=require(_0xe523('0x0'))['db'][_0xe523('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xe523('0x2')](0x0);var events={'afterCreate':_0xe523('0x3'),'afterUpdate':_0xe523('0x4'),'afterDestroy':_0xe523('0x5')};function emitEvent(_0x46374a){return function(_0xf48771,_0x5d4f91,_0x593354){TeamEvents[_0xe523('0x6')](_0x46374a+':'+_0xf48771['id'],_0xf48771);TeamEvents[_0xe523('0x6')](_0x46374a,_0xf48771);_0x593354(null);};}for(var e in events){if(events[_0xe523('0x7')](e)){var event=events[e];Team[_0xe523('0x8')](e,emitEvent(event));}}module[_0xe523('0x9')]=TeamEvents;
\ No newline at end of file
index 45d2cc6..5829a6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91ef=['path','rimraf','../../config/environment','./team.attributes','exports','Team','teams','lodash','../../config/logger','api','moment','bluebird'];(function(_0xa7cc78,_0x55853d){var _0x405bd6=function(_0x42952d){while(--_0x42952d){_0xa7cc78['push'](_0xa7cc78['shift']());}};_0x405bd6(++_0x55853d);}(_0x91ef,0xa3));var _0xf91e=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x91ef[_0x2642cb];return _0xe6e41;};'use strict';var _=require(_0xf91e('0x0'));var util=require('util');var logger=require(_0xf91e('0x1'))(_0xf91e('0x2'));var moment=require(_0xf91e('0x3'));var BPromise=require(_0xf91e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf91e('0x5'));var rimraf=require(_0xf91e('0x6'));var config=require(_0xf91e('0x7'));var attributes=require(_0xf91e('0x8'));module[_0xf91e('0x9')]=function(_0x36daf9,_0x3bbbd6){return _0x36daf9['define'](_0xf91e('0xa'),attributes,{'tableName':_0xf91e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa6cf=['request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define','Team','teams','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3650e7,_0x282cf3){var _0x41be39=function(_0x48f7bd){while(--_0x48f7bd){_0x3650e7['push'](_0x3650e7['shift']());}};_0x41be39(++_0x282cf3);}(_0xa6cf,0x159));var _0xfa6c=function(_0x4d6f33,_0x549629){_0x4d6f33=_0x4d6f33-0x0;var _0x582e00=_0xa6cf[_0x4d6f33];return _0x582e00;};'use strict';var _=require(_0xfa6c('0x0'));var util=require(_0xfa6c('0x1'));var logger=require(_0xfa6c('0x2'))('api');var moment=require(_0xfa6c('0x3'));var BPromise=require(_0xfa6c('0x4'));var rp=require(_0xfa6c('0x5'));var fs=require('fs');var path=require(_0xfa6c('0x6'));var rimraf=require(_0xfa6c('0x7'));var config=require(_0xfa6c('0x8'));var attributes=require(_0xfa6c('0x9'));module[_0xfa6c('0xa')]=function(_0x33bc5f,_0x55d745){return _0x33bc5f[_0xfa6c('0xb')](_0xfa6c('0xc'),attributes,{'tableName':_0xfa6c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5169232..426ef57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a91=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','code','error','Team,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring'];(function(_0x185deb,_0x20e36f){var _0x37436e=function(_0x541270){while(--_0x541270){_0x185deb['push'](_0x185deb['shift']());}};_0x37436e(++_0x20e36f);}(_0x0a91,0x140));var _0x10a9=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x0a91[_0x45b034];return _0x509cb0;};'use strict';var _=require(_0x10a9('0x0'));var util=require(_0x10a9('0x1'));var moment=require('moment');var BPromise=require(_0x10a9('0x2'));var rs=require(_0x10a9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10a9('0x4'))['db'];var utils=require(_0x10a9('0x5'));var logger=require(_0x10a9('0x6'))('rpc');var config=require(_0x10a9('0x7'));var jayson=require(_0x10a9('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x10a9('0x9')]=_[_0x10a9('0xa')](config['redis'],{'host':_0x10a9('0xb'),'port':0x18eb});var socket=require(_0x10a9('0xc'))(new Redis(config['redis']));require(_0x10a9('0xd'))[_0x10a9('0xe')](socket);function respondWithRpcPromise(_0x1df8d9,_0x398acb,_0x515acc){return new BPromise(function(_0x42889a,_0x1e8aa1){return client[_0x10a9('0xf')](_0x1df8d9,_0x515acc)[_0x10a9('0x10')](function(_0x1a6a23){logger[_0x10a9('0x11')]('Team,\x20%s,\x20%s',_0x398acb,_0x10a9('0x12'));logger[_0x10a9('0x13')](_0x10a9('0x14'),_0x398acb,'request\x20sent',JSON[_0x10a9('0x15')](_0x1a6a23));if(_0x1a6a23['error']){if(_0x1a6a23['error'][_0x10a9('0x16')]===0x1f4){logger[_0x10a9('0x17')](_0x10a9('0x18'),_0x398acb,_0x1a6a23[_0x10a9('0x17')][_0x10a9('0x19')]);return _0x1e8aa1(_0x1a6a23['error'][_0x10a9('0x19')]);}logger[_0x10a9('0x17')]('Team,\x20%s,\x20%s',_0x398acb,_0x1a6a23['error'][_0x10a9('0x19')]);return _0x42889a(_0x1a6a23[_0x10a9('0x17')][_0x10a9('0x19')]);}else{logger[_0x10a9('0x11')](_0x10a9('0x18'),_0x398acb,_0x10a9('0x12'));_0x42889a(_0x1a6a23[_0x10a9('0x1a')][_0x10a9('0x19')]);}})['catch'](function(_0x246292){logger[_0x10a9('0x17')]('Team,\x20%s,\x20%s',_0x398acb,_0x246292);_0x1e8aa1(_0x246292);});});}
\ No newline at end of file
+var _0xcb43=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','redis','./team.socket','register','request','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','Team,\x20%s,\x20%s','message'];(function(_0x5c1449,_0x2af4b4){var _0x270473=function(_0x1461b6){while(--_0x1461b6){_0x5c1449['push'](_0x5c1449['shift']());}};_0x270473(++_0x2af4b4);}(_0xcb43,0x197));var _0x3cb4=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0xcb43[_0x2f0057];return _0x17f2c3;};'use strict';var _=require(_0x3cb4('0x0'));var util=require(_0x3cb4('0x1'));var moment=require('moment');var BPromise=require(_0x3cb4('0x2'));var rs=require(_0x3cb4('0x3'));var fs=require('fs');var Redis=require(_0x3cb4('0x4'));var db=require(_0x3cb4('0x5'))['db'];var utils=require(_0x3cb4('0x6'));var logger=require('../../config/logger')(_0x3cb4('0x7'));var config=require(_0x3cb4('0x8'));var jayson=require(_0x3cb4('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x3cb4('0xa')](config['redis'],{'host':_0x3cb4('0xb'),'port':0x18eb});var socket=require(_0x3cb4('0xc'))(new Redis(config[_0x3cb4('0xd')]));require(_0x3cb4('0xe'))[_0x3cb4('0xf')](socket);function respondWithRpcPromise(_0x48946c,_0x591291,_0x365ac8){return new BPromise(function(_0x2b823e,_0x178a58){return client[_0x3cb4('0x10')](_0x48946c,_0x365ac8)['then'](function(_0x5b7c46){logger[_0x3cb4('0x11')]('Team,\x20%s,\x20%s',_0x591291,_0x3cb4('0x12'));logger[_0x3cb4('0x13')](_0x3cb4('0x14'),_0x591291,'request\x20sent',JSON['stringify'](_0x5b7c46));if(_0x5b7c46[_0x3cb4('0x15')]){if(_0x5b7c46[_0x3cb4('0x15')][_0x3cb4('0x16')]===0x1f4){logger[_0x3cb4('0x15')](_0x3cb4('0x17'),_0x591291,_0x5b7c46[_0x3cb4('0x15')]['message']);return _0x178a58(_0x5b7c46[_0x3cb4('0x15')][_0x3cb4('0x18')]);}logger[_0x3cb4('0x15')](_0x3cb4('0x17'),_0x591291,_0x5b7c46['error'][_0x3cb4('0x18')]);return _0x2b823e(_0x5b7c46[_0x3cb4('0x15')][_0x3cb4('0x18')]);}else{logger['info'](_0x3cb4('0x17'),_0x591291,'request\x20sent');_0x2b823e(_0x5b7c46[_0x3cb4('0x19')][_0x3cb4('0x18')]);}})[_0x3cb4('0x1a')](function(_0x4e99d7){logger[_0x3cb4('0x15')]('Team,\x20%s,\x20%s',_0x591291,_0x4e99d7);_0x178a58(_0x4e99d7);});});}
\ No newline at end of file
index 21b6432..6e7ade3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7085=['team:','./team.events','save','remove','update'];(function(_0x17128d,_0x4e06ba){var _0xf83f4d=function(_0x443e72){while(--_0x443e72){_0x17128d['push'](_0x17128d['shift']());}};_0xf83f4d(++_0x4e06ba);}(_0x7085,0x7e));var _0x5708=function(_0x47899b,_0x3a9171){_0x47899b=_0x47899b-0x0;var _0x3cf890=_0x7085[_0x47899b];return _0x3cf890;};'use strict';var TeamEvents=require(_0x5708('0x0'));var events=[_0x5708('0x1'),_0x5708('0x2'),_0x5708('0x3')];function createListener(_0x2f2d2b,_0x1aec1e){return function(_0x351869){_0x1aec1e['emit'](_0x2f2d2b,_0x351869);};}function removeListener(_0x39a3c6,_0x3b41e9){return function(){TeamEvents['removeListener'](_0x39a3c6,_0x3b41e9);};}exports['register']=function(_0x7d7fbf){for(var _0x245a90=0x0,_0x552605=events['length'];_0x245a90<_0x552605;_0x245a90++){var _0x3858af=events[_0x245a90];var _0x435c22=createListener(_0x5708('0x4')+_0x3858af,_0x7d7fbf);TeamEvents['on'](_0x3858af,_0x435c22);}};
\ No newline at end of file
+var _0x9f4d=['./team.events','save','remove','update','emit','removeListener','length','team:'];(function(_0x21c0dc,_0x4d87b1){var _0x2204c3=function(_0x33a3a3){while(--_0x33a3a3){_0x21c0dc['push'](_0x21c0dc['shift']());}};_0x2204c3(++_0x4d87b1);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x51c846,_0x8d8df9){_0x51c846=_0x51c846-0x0;var _0x409189=_0x9f4d[_0x51c846];return _0x409189;};'use strict';var TeamEvents=require(_0xd9f4('0x0'));var events=[_0xd9f4('0x1'),_0xd9f4('0x2'),_0xd9f4('0x3')];function createListener(_0x2ac732,_0x81f443){return function(_0x36dc75){_0x81f443[_0xd9f4('0x4')](_0x2ac732,_0x36dc75);};}function removeListener(_0x7dccea,_0x5e0ab0){return function(){TeamEvents[_0xd9f4('0x5')](_0x7dccea,_0x5e0ab0);};}exports['register']=function(_0x3d521d){for(var _0x3ebf1b=0x0,_0x2cc036=events[_0xd9f4('0x6')];_0x3ebf1b<_0x2cc036;_0x3ebf1b++){var _0x5cf448=events[_0x3ebf1b];var _0x6b13b5=createListener(_0xd9f4('0x7')+_0x5cf448,_0x3d521d);TeamEvents['on'](_0x5cf448,_0x6b13b5);}};
\ No newline at end of file
index d842d6e..b472d63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99e8=['INTEGER','sequelize','exports'];(function(_0x488616,_0x516a25){var _0x217fb3=function(_0x43bd59){while(--_0x43bd59){_0x488616['push'](_0x488616['shift']());}};_0x217fb3(++_0x516a25);}(_0x99e8,0x11b));var _0x899e=function(_0x511d31,_0x42e4c7){_0x511d31=_0x511d31-0x0;var _0x588986=_0x99e8[_0x511d31];return _0x588986;};'use strict';var Sequelize=require(_0x899e('0x0'));module[_0x899e('0x1')]={'TeamId':{'type':Sequelize[_0x899e('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x899e('0x2')]}};
\ No newline at end of file
+var _0x5c4a=['INTEGER','exports'];(function(_0x459919,_0x427e1b){var _0x1953f4=function(_0x56bcce){while(--_0x56bcce){_0x459919['push'](_0x459919['shift']());}};_0x1953f4(++_0x427e1b);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x236482,_0x4dc665){_0x236482=_0x236482-0x0;var _0x1dca51=_0x5c4a[_0x236482];return _0x1dca51;};'use strict';var Sequelize=require('sequelize');module[_0xa5c4('0x0')]={'TeamId':{'type':Sequelize[_0xa5c4('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index b1a096d..7736de1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8caf=['request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','api','moment','bluebird'];(function(_0x16319f,_0x51a862){var _0x3bdfc3=function(_0x21632a){while(--_0x21632a){_0x16319f['push'](_0x16319f['shift']());}};_0x3bdfc3(++_0x51a862);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0x8caf[_0x4eb6ec];return _0x58881b;};'use strict';var _=require('lodash');var util=require(_0xf8ca('0x0'));var logger=require(_0xf8ca('0x1'))(_0xf8ca('0x2'));var moment=require(_0xf8ca('0x3'));var BPromise=require(_0xf8ca('0x4'));var rp=require(_0xf8ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8ca('0x6'));var config=require(_0xf8ca('0x7'));var attributes=require(_0xf8ca('0x8'));module[_0xf8ca('0x9')]=function(_0x1e2888,_0x20c10a){return _0x1e2888['define'](_0xf8ca('0xa'),attributes,{'tableName':_0xf8ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d5b=['exports','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./teamVoicePrefix.attributes'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x5e968c,_0x3d9d44){_0x5e968c=_0x5e968c-0x0;var _0x5a9fb3=_0x9d5b[_0x5e968c];return _0x5a9fb3;};'use strict';var _=require('lodash');var util=require(_0xb9d5('0x0'));var logger=require(_0xb9d5('0x1'))(_0xb9d5('0x2'));var moment=require(_0xb9d5('0x3'));var BPromise=require(_0xb9d5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9d5('0x5'));var rimraf=require('rimraf');var config=require(_0xb9d5('0x6'));var attributes=require(_0xb9d5('0x7'));module[_0xb9d5('0x8')]=function(_0x39d8fe,_0x422a92){return _0x39d8fe['define'](_0xb9d5('0x9'),attributes,{'tableName':_0xb9d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4c5279d..06918a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2c440e,_0x2a2052){var _0x4ce361=function(_0x2ece3a){while(--_0x2ece3a){_0x2c440e['push'](_0x2c440e['shift']());}};_0x4ce361(++_0x2a2052);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x31bf4a,_0x51eb5f){var _0x2265ec=function(_0x482a5a){while(--_0x482a5a){_0x31bf4a['push'](_0x31bf4a['shift']());}};_0x2265ec(++_0x51eb5f);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index b30ec14..d3c2609 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef9b=['INTEGER','sequelize','exports'];(function(_0x43fbe7,_0x36f1d4){var _0x4a6d00=function(_0x20419d){while(--_0x20419d){_0x43fbe7['push'](_0x43fbe7['shift']());}};_0x4a6d00(++_0x36f1d4);}(_0xef9b,0x1b7));var _0xbef9=function(_0x566e7a,_0x3ce19f){_0x566e7a=_0x566e7a-0x0;var _0x27629d=_0xef9b[_0x566e7a];return _0x27629d;};'use strict';var Sequelize=require(_0xbef9('0x0'));module[_0xbef9('0x1')]={'penalty':{'type':Sequelize[_0xbef9('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xda3a=['INTEGER','sequelize'];(function(_0x3268cf,_0x77f71c){var _0x307e0c=function(_0x1ebaf7){while(--_0x1ebaf7){_0x3268cf['push'](_0x3268cf['shift']());}};_0x307e0c(++_0x77f71c);}(_0xda3a,0xab));var _0xada3=function(_0xdfc1a6,_0x517854){_0xdfc1a6=_0xdfc1a6-0x0;var _0x34fc61=_0xda3a[_0xdfc1a6];return _0x34fc61;};'use strict';var Sequelize=require(_0xada3('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xada3('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 6762bf2..24d01a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x758e=['TeamVoiceQueue','lodash','api','moment','bluebird','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define'];(function(_0x3f7955,_0x316a4f){var _0x4e7d0a=function(_0x20c5c6){while(--_0x20c5c6){_0x3f7955['push'](_0x3f7955['shift']());}};_0x4e7d0a(++_0x316a4f);}(_0x758e,0x1af));var _0xe758=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x758e[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xe758('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe758('0x1'));var moment=require(_0xe758('0x2'));var BPromise=require(_0xe758('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe758('0x4'));var config=require(_0xe758('0x5'));var attributes=require(_0xe758('0x6'));module[_0xe758('0x7')]=function(_0x5a2226,_0x2cdf89){return _0x5a2226[_0xe758('0x8')](_0xe758('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2121=['request-promise','path','rimraf','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','moment','bluebird'];(function(_0x3f9f55,_0x30be29){var _0x123217=function(_0x36c6cb){while(--_0x36c6cb){_0x3f9f55['push'](_0x3f9f55['shift']());}};_0x123217(++_0x30be29);}(_0x2121,0x1b4));var _0x1212=function(_0x2f9422,_0x5a7775){_0x2f9422=_0x2f9422-0x0;var _0x248244=_0x2121[_0x2f9422];return _0x248244;};'use strict';var _=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1212('0x2'));var BPromise=require(_0x1212('0x3'));var rp=require(_0x1212('0x4'));var fs=require('fs');var path=require(_0x1212('0x5'));var rimraf=require(_0x1212('0x6'));var config=require('../../config/environment');var attributes=require(_0x1212('0x7'));module['exports']=function(_0x7b16ef,_0x452116){return _0x7b16ef[_0x1212('0x8')](_0x1212('0x9'),attributes,{'tableName':_0x1212('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d1ad316..7e9f27a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94b1=['rpc','../../config/environment','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1a2cdb,_0x125fb7){var _0x13223b=function(_0x45c90e){while(--_0x45c90e){_0x1a2cdb['push'](_0x1a2cdb['shift']());}};_0x13223b(++_0x125fb7);}(_0x94b1,0x102));var _0x194b=function(_0x4baccc,_0x2da866){_0x4baccc=_0x4baccc-0x0;var _0xdbb65b=_0x94b1[_0x4baccc];return _0xdbb65b;};'use strict';var _=require('lodash');var util=require(_0x194b('0x0'));var moment=require('moment');var BPromise=require(_0x194b('0x1'));var rs=require(_0x194b('0x2'));var fs=require('fs');var Redis=require(_0x194b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x194b('0x4'));var logger=require(_0x194b('0x5'))(_0x194b('0x6'));var config=require(_0x194b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x194b('0x8')][_0x194b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5213ad,_0x3ec8c2,_0x4e82ac){return new BPromise(function(_0x24b450,_0x4759c0){return client[_0x194b('0xa')](_0x5213ad,_0x4e82ac)[_0x194b('0xb')](function(_0x2f5bb3){logger[_0x194b('0xc')](_0x194b('0xd'),_0x3ec8c2,'request\x20sent');logger[_0x194b('0xe')](_0x194b('0xf'),_0x3ec8c2,_0x194b('0x10'),JSON['stringify'](_0x2f5bb3));if(_0x2f5bb3[_0x194b('0x11')]){if(_0x2f5bb3[_0x194b('0x11')][_0x194b('0x12')]===0x1f4){logger[_0x194b('0x11')](_0x194b('0xd'),_0x3ec8c2,_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);return _0x4759c0(_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);}logger[_0x194b('0x11')](_0x194b('0xd'),_0x3ec8c2,_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);return _0x24b450(_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);}else{logger[_0x194b('0xc')](_0x194b('0xd'),_0x3ec8c2,_0x194b('0x10'));_0x24b450(_0x2f5bb3[_0x194b('0x14')][_0x194b('0x13')]);}})[_0x194b('0x15')](function(_0x4a115a){logger['error'](_0x194b('0xd'),_0x3ec8c2,_0x4a115a);_0x4759c0(_0x4a115a);});});}
\ No newline at end of file
+var _0xf72f=['jayson/promise','request','then','info','request\x20sent','debug','error','code','message','TeamVoiceQueue,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0xf72f,0x171));var _0xff72=function(_0x3495e6,_0x3c4055){_0x3495e6=_0x3495e6-0x0;var _0x23d167=_0xf72f[_0x3495e6];return _0x23d167;};'use strict';var _=require('lodash');var util=require(_0xff72('0x0'));var moment=require(_0xff72('0x1'));var BPromise=require('bluebird');var rs=require(_0xff72('0x2'));var fs=require('fs');var Redis=require(_0xff72('0x3'));var db=require(_0xff72('0x4'))['db'];var utils=require(_0xff72('0x5'));var logger=require(_0xff72('0x6'))(_0xff72('0x7'));var config=require(_0xff72('0x8'));var jayson=require(_0xff72('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e3843,_0x5a6210,_0x43b6d2){return new BPromise(function(_0x359279,_0x39bc4a){return client[_0xff72('0xa')](_0x2e3843,_0x43b6d2)[_0xff72('0xb')](function(_0xab373e){logger[_0xff72('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5a6210,_0xff72('0xd'));logger[_0xff72('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5a6210,'request\x20sent',JSON['stringify'](_0xab373e));if(_0xab373e[_0xff72('0xf')]){if(_0xab373e['error'][_0xff72('0x10')]===0x1f4){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x5a6210,_0xab373e[_0xff72('0xf')][_0xff72('0x11')]);return _0x39bc4a(_0xab373e[_0xff72('0xf')][_0xff72('0x11')]);}logger['error'](_0xff72('0x12'),_0x5a6210,_0xab373e['error']['message']);return _0x359279(_0xab373e[_0xff72('0xf')][_0xff72('0x11')]);}else{logger[_0xff72('0xc')](_0xff72('0x12'),_0x5a6210,_0xff72('0xd'));_0x359279(_0xab373e[_0xff72('0x13')]['message']);}})[_0xff72('0x14')](function(_0x2cdcb7){logger[_0xff72('0xf')](_0xff72('0x12'),_0x5a6210,_0x2cdcb7);_0x39bc4a(_0x2cdcb7);});});}
\ No newline at end of file
index 9ca3a0a..5f7c310 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a43=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5a43,0xf1));var _0x35a4=function(_0x41cb7f,_0x1d2358){_0x41cb7f=_0x41cb7f-0x0;var _0x5b1484=_0x5a43[_0x41cb7f];return _0x5b1484;};'use strict';var multer=require(_0x35a4('0x0'));var util=require(_0x35a4('0x1'));var path=require(_0x35a4('0x2'));var timeout=require(_0x35a4('0x3'));var express=require(_0x35a4('0x4'));var router=express[_0x35a4('0x5')]();var fs_extra=require(_0x35a4('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./template.controller');router[_0x35a4('0x7')]('/',auth[_0x35a4('0x8')](),controller[_0x35a4('0x9')]);router[_0x35a4('0x7')](_0x35a4('0xa'),auth[_0x35a4('0x8')](),controller['show']);router[_0x35a4('0xb')]('/',auth[_0x35a4('0x8')](),controller[_0x35a4('0xc')]);router[_0x35a4('0xd')](_0x35a4('0xa'),auth[_0x35a4('0x8')](),controller['update']);router['delete']('/:id',auth[_0x35a4('0x8')](),controller['destroy']);module[_0x35a4('0xe')]=router;
\ No newline at end of file
+var _0x229c=['express','../../components/auth/service','../../config/environment','./template.controller','get','index','/:id','isAuthenticated','post','delete','destroy','exports','util'];(function(_0x1fc549,_0x4cf5b4){var _0x3c4621=function(_0x438a28){while(--_0x438a28){_0x1fc549['push'](_0x1fc549['shift']());}};_0x3c4621(++_0x4cf5b4);}(_0x229c,0xcf));var _0xc229=function(_0xe47cdd,_0x15a823){_0xe47cdd=_0xe47cdd-0x0;var _0x4edcea=_0x229c[_0xe47cdd];return _0x4edcea;};'use strict';var multer=require('multer');var util=require(_0xc229('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc229('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc229('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xc229('0x3'));var controller=require(_0xc229('0x4'));router[_0xc229('0x5')]('/',auth['isAuthenticated'](),controller[_0xc229('0x6')]);router['get'](_0xc229('0x7'),auth[_0xc229('0x8')](),controller['show']);router[_0xc229('0x9')]('/',auth[_0xc229('0x8')](),controller['create']);router['put'](_0xc229('0x7'),auth['isAuthenticated'](),controller['update']);router[_0xc229('0xa')](_0xc229('0x7'),auth[_0xc229('0x8')](),controller[_0xc229('0xb')]);module[_0xc229('0xc')]=router;
\ No newline at end of file
index 318459f..58f6c7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd18b=['STRING','sequelize','exports'];(function(_0x28a066,_0x5a2bae){var _0x1771ea=function(_0x242b4c){while(--_0x242b4c){_0x28a066['push'](_0x28a066['shift']());}};_0x1771ea(++_0x5a2bae);}(_0xd18b,0x124));var _0xbd18=function(_0x39c90,_0x3bbfae){_0x39c90=_0x39c90-0x0;var _0x169969=_0xd18b[_0x39c90];return _0x169969;};'use strict';var Sequelize=require(_0xbd18('0x0'));module[_0xbd18('0x1')]={'name':{'type':Sequelize[_0xbd18('0x2')]},'description':{'type':Sequelize[_0xbd18('0x2')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xbd33=['STRING','exports'];(function(_0x579171,_0x5aec8e){var _0x355b84=function(_0x45d0e7){while(--_0x45d0e7){_0x579171['push'](_0x579171['shift']());}};_0x355b84(++_0x5aec8e);}(_0xbd33,0x105));var _0x3bd3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbd33[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x3bd3('0x0')]={'name':{'type':Sequelize[_0x3bd3('0x1')]},'description':{'type':Sequelize[_0x3bd3('0x1')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 30a72c3..4f00773 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a4e=['body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','Template','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','params','user','role','find','userProfileId','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x51f357,_0x58d147){var _0x186473=function(_0x217b6b){while(--_0x217b6b){_0x51f357['push'](_0x51f357['shift']());}};_0x186473(++_0x58d147);}(_0x0a4e,0x1aa));var _0xe0a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a4e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe0a4('0x0'));var rimraf=require(_0xe0a4('0x1'));var zipdir=require(_0xe0a4('0x2'));var jsonpatch=require(_0xe0a4('0x3'));var rp=require('request-promise');var moment=require(_0xe0a4('0x4'));var BPromise=require(_0xe0a4('0x5'));var Mustache=require(_0xe0a4('0x6'));var util=require(_0xe0a4('0x7'));var path=require(_0xe0a4('0x8'));var sox=require(_0xe0a4('0x9'));var csv=require(_0xe0a4('0xa'));var ejs=require(_0xe0a4('0xb'));var fs=require('fs');var fs_extra=require(_0xe0a4('0xc'));var _=require(_0xe0a4('0xd'));var squel=require(_0xe0a4('0xe'));var crypto=require(_0xe0a4('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe0a4('0x10'));var toCsv=require(_0xe0a4('0xa'));var querystring=require(_0xe0a4('0x11'));var Papa=require(_0xe0a4('0x12'));var Redis=require(_0xe0a4('0x13'));var authService=require(_0xe0a4('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0a4('0x15'));var logger=require(_0xe0a4('0x16'))(_0xe0a4('0x17'));var utils=require(_0xe0a4('0x18'));var config=require(_0xe0a4('0x19'));var licenseUtil=require(_0xe0a4('0x1a'));var db=require(_0xe0a4('0x1b'))['db'];function respondWithStatusCode(_0x2374e9,_0x4ee9d6){_0x4ee9d6=_0x4ee9d6||0xcc;return function(_0x2550c8){if(_0x2550c8){return _0x2374e9[_0xe0a4('0x1c')](_0x4ee9d6);}return _0x2374e9[_0xe0a4('0x1d')](_0x4ee9d6)['end']();};}function respondWithResult(_0x18c8dc,_0x43fd7b){_0x43fd7b=_0x43fd7b||0xc8;return function(_0x292664){if(_0x292664){return _0x18c8dc[_0xe0a4('0x1d')](_0x43fd7b)[_0xe0a4('0x1e')](_0x292664);}};}function respondWithFilteredResult(_0x18cca0,_0x343fa9){return function(_0x141c1d){if(_0x141c1d){var _0x54f672=typeof _0x343fa9[_0xe0a4('0x1f')]==='undefined'&&typeof _0x343fa9[_0xe0a4('0x20')]===_0xe0a4('0x21');var _0x37475c=_0x141c1d[_0xe0a4('0x22')];var _0x31370e=_0x54f672?0x0:_0x343fa9['offset'];var _0x1e41f2=_0x54f672?_0x141c1d['count']:_0x343fa9['offset']+_0x343fa9[_0xe0a4('0x20')];var _0x4d1215;if(_0x1e41f2>=_0x37475c){_0x1e41f2=_0x37475c;_0x4d1215=0xc8;}else{_0x4d1215=0xce;}_0x18cca0[_0xe0a4('0x1d')](_0x4d1215);return _0x18cca0[_0xe0a4('0x23')]('Content-Range',_0x31370e+'-'+_0x1e41f2+'/'+_0x37475c)[_0xe0a4('0x1e')](_0x141c1d);}return null;};}function patchUpdates(_0x5e7ce6){return function(_0x5173a2){try{jsonpatch[_0xe0a4('0x24')](_0x5173a2,_0x5e7ce6,!![]);}catch(_0x5bf178){return BPromise[_0xe0a4('0x25')](_0x5bf178);}return _0x5173a2[_0xe0a4('0x26')]();};}function saveUpdates(_0x4edd21,_0x4a5cfe){return function(_0x1e5308){if(_0x1e5308){return _0x1e5308['update'](_0x4edd21)[_0xe0a4('0x27')](function(_0x168f28){return _0x168f28;});}return null;};}function removeEntity(_0x22e14a,_0x4d1faa){return function(_0x1b6d71){if(_0x1b6d71){return _0x1b6d71[_0xe0a4('0x28')]()[_0xe0a4('0x27')](function(){var _0x5e52bf=_0x1b6d71[_0xe0a4('0x29')]({'plain':!![]});var _0x40d8bf=_0xe0a4('0x2a');return db[_0xe0a4('0x2b')][_0xe0a4('0x28')]({'where':{'type':_0x40d8bf,'resourceId':_0x5e52bf['id']}})[_0xe0a4('0x27')](function(){return _0x1b6d71;});})[_0xe0a4('0x27')](function(){_0x22e14a[_0xe0a4('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f566,_0x212da9){return function(_0xd10693){if(!_0xd10693){_0x40f566[_0xe0a4('0x1c')](0x194);}return _0xd10693;};}function handleError(_0x3a5f8b,_0x320028){_0x320028=_0x320028||0x1f4;return function(_0x3903ad){logger[_0xe0a4('0x2c')](_0x3903ad[_0xe0a4('0x2d')]);if(_0x3903ad[_0xe0a4('0x2e')]){delete _0x3903ad[_0xe0a4('0x2e')];}_0x3a5f8b[_0xe0a4('0x1d')](_0x320028)[_0xe0a4('0x2f')](_0x3903ad);};}exports[_0xe0a4('0x30')]=function(_0x564c54,_0x17b921){var _0x34fa13={},_0xef0b64={},_0x160643={'count':0x0,'rows':[]};var _0x184912=_['map'](db[_0xe0a4('0x31')][_0xe0a4('0x32')],function(_0x3ee7ae){return{'name':_0x3ee7ae[_0xe0a4('0x33')],'type':_0x3ee7ae[_0xe0a4('0x34')][_0xe0a4('0x35')]};});_0xef0b64['model']=_[_0xe0a4('0x36')](_0x184912,_0xe0a4('0x2e'));_0xef0b64['query']=_[_0xe0a4('0x37')](_0x564c54[_0xe0a4('0x38')]);_0xef0b64[_0xe0a4('0x39')]=_[_0xe0a4('0x3a')](_0xef0b64[_0xe0a4('0x3b')],_0xef0b64[_0xe0a4('0x38')]);_0x34fa13[_0xe0a4('0x3c')]=_[_0xe0a4('0x3a')](_0xef0b64[_0xe0a4('0x3b')],qs[_0xe0a4('0x3d')](_0x564c54[_0xe0a4('0x38')]['fields']));_0x34fa13[_0xe0a4('0x3c')]=_0x34fa13['attributes'][_0xe0a4('0x3e')]?_0x34fa13[_0xe0a4('0x3c')]:_0xef0b64[_0xe0a4('0x3b')];if(!_0x564c54[_0xe0a4('0x38')][_0xe0a4('0x3f')]('nolimit')){_0x34fa13['limit']=qs['limit'](_0x564c54['query']['limit']);_0x34fa13['offset']=qs[_0xe0a4('0x1f')](_0x564c54['query'][_0xe0a4('0x1f')]);}_0x34fa13[_0xe0a4('0x40')]=qs[_0xe0a4('0x41')](_0x564c54[_0xe0a4('0x38')][_0xe0a4('0x41')]);_0x34fa13[_0xe0a4('0x42')]=qs[_0xe0a4('0x39')](_[_0xe0a4('0x43')](_0x564c54[_0xe0a4('0x38')],_0xef0b64['filters']),_0x184912);if(_0x564c54[_0xe0a4('0x38')][_0xe0a4('0x44')]){_0x34fa13[_0xe0a4('0x42')]=_[_0xe0a4('0x45')](_0x34fa13[_0xe0a4('0x42')],{'$or':_[_0xe0a4('0x36')](_0x184912,function(_0x51699d){if(_0x51699d[_0xe0a4('0x34')]!==_0xe0a4('0x46')){var _0x5ac090={};_0x5ac090[_0x51699d[_0xe0a4('0x2e')]]={'$like':'%'+_0x564c54[_0xe0a4('0x38')][_0xe0a4('0x44')]+'%'};return _0x5ac090;}})});}_0x34fa13=_['merge']({},_0x34fa13,_0x564c54[_0xe0a4('0x47')]);var _0x2bb0fb={'where':_0x34fa13['where']};return db[_0xe0a4('0x31')][_0xe0a4('0x22')](_0x2bb0fb)[_0xe0a4('0x27')](function(_0x578003){_0x160643['count']=_0x578003;if(_0x564c54[_0xe0a4('0x38')][_0xe0a4('0x48')]){_0x34fa13['include']=[{'all':!![]}];}return db['Template']['findAll'](_0x34fa13);})[_0xe0a4('0x27')](function(_0xcfe7e){_0x160643[_0xe0a4('0x49')]=_0xcfe7e;return _0x160643;})[_0xe0a4('0x27')](respondWithFilteredResult(_0x17b921,_0x34fa13))['catch'](handleError(_0x17b921,null));};exports['show']=function(_0x33c13b,_0x310b9f){var _0x46723e={'raw':!![],'where':{'id':_0x33c13b[_0xe0a4('0x4a')]['id']}},_0x25755a={};_0x25755a[_0xe0a4('0x3b')]=_[_0xe0a4('0x37')](db[_0xe0a4('0x31')]['rawAttributes']);_0x25755a[_0xe0a4('0x38')]=_[_0xe0a4('0x37')](_0x33c13b[_0xe0a4('0x38')]);_0x25755a['filters']=_[_0xe0a4('0x3a')](_0x25755a[_0xe0a4('0x3b')],_0x25755a['query']);_0x46723e[_0xe0a4('0x3c')]=_['intersection'](_0x25755a['model'],qs[_0xe0a4('0x3d')](_0x33c13b[_0xe0a4('0x38')][_0xe0a4('0x3d')]));_0x46723e[_0xe0a4('0x3c')]=_0x46723e[_0xe0a4('0x3c')]['length']?_0x46723e[_0xe0a4('0x3c')]:_0x25755a['model'];if(_0x33c13b[_0xe0a4('0x38')][_0xe0a4('0x48')]){_0x46723e['include']=[{'all':!![]}];}_0x46723e=_[_0xe0a4('0x45')]({},_0x46723e,_0x33c13b[_0xe0a4('0x47')]);return db[_0xe0a4('0x31')]['find'](_0x46723e)[_0xe0a4('0x27')](handleEntityNotFound(_0x310b9f,null))[_0xe0a4('0x27')](respondWithResult(_0x310b9f,null))['catch'](handleError(_0x310b9f,null));};exports['create']=function(_0x1c20b9,_0x26eda3){return db[_0xe0a4('0x31')]['create'](_0x1c20b9['body'],{})[_0xe0a4('0x27')](function(_0x4bbeff){var _0x4a54a0=_0x1c20b9[_0xe0a4('0x4b')][_0xe0a4('0x29')]({'plain':!![]});if(!_0x4a54a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a54a0[_0xe0a4('0x4c')]===_0xe0a4('0x4b')){var _0x3af188=_0x4bbeff[_0xe0a4('0x29')]({'plain':!![]});var _0x55d2db=_0xe0a4('0x2a');return db['UserProfileSection'][_0xe0a4('0x4d')]({'where':{'name':_0x55d2db,'userProfileId':_0x4a54a0[_0xe0a4('0x4e')]},'raw':!![]})[_0xe0a4('0x27')](function(_0x20d874){if(_0x20d874&&_0x20d874[_0xe0a4('0x4f')]===0x0){return db[_0xe0a4('0x2b')][_0xe0a4('0x50')]({'name':_0x3af188[_0xe0a4('0x2e')],'resourceId':_0x3af188['id'],'type':_0x20d874['name'],'sectionId':_0x20d874['id']},{})[_0xe0a4('0x27')](function(){return _0x4bbeff;});}else{return _0x4bbeff;}})[_0xe0a4('0x51')](function(_0x49353c){logger[_0xe0a4('0x2c')](_0xe0a4('0x52'),_0x49353c);throw _0x49353c;});}return _0x4bbeff;})[_0xe0a4('0x27')](respondWithResult(_0x26eda3,0xc9))[_0xe0a4('0x51')](handleError(_0x26eda3,null));};exports[_0xe0a4('0x53')]=function(_0x47744f,_0x47418c){if(_0x47744f[_0xe0a4('0x54')]['id']){delete _0x47744f[_0xe0a4('0x54')]['id'];}return db[_0xe0a4('0x31')]['find']({'where':{'id':_0x47744f[_0xe0a4('0x4a')]['id']}})[_0xe0a4('0x27')](handleEntityNotFound(_0x47418c,null))[_0xe0a4('0x27')](saveUpdates(_0x47744f[_0xe0a4('0x54')],null))['then'](respondWithResult(_0x47418c,null))[_0xe0a4('0x51')](handleError(_0x47418c,null));};exports[_0xe0a4('0x28')]=function(_0x255b1b,_0x2a0028){return db[_0xe0a4('0x31')][_0xe0a4('0x4d')]({'where':{'id':_0x255b1b[_0xe0a4('0x4a')]['id']}})[_0xe0a4('0x27')](handleEntityNotFound(_0x2a0028,null))[_0xe0a4('0x27')](removeEntity(_0x2a0028,null))[_0xe0a4('0x51')](handleError(_0x2a0028,null));};
\ No newline at end of file
+var _0x09a2=['sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','reject','save','update','then','destroy','Templates','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x244c1f,_0x553abf){var _0x22ec29=function(_0x78e17){while(--_0x78e17){_0x244c1f['push'](_0x244c1f['shift']());}};_0x22ec29(++_0x553abf);}(_0x09a2,0x198));var _0x209a=function(_0x7591cf,_0x31cd6c){_0x7591cf=_0x7591cf-0x0;var _0x34e7ea=_0x09a2[_0x7591cf];return _0x34e7ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x209a('0x0'));var zipdir=require(_0x209a('0x1'));var jsonpatch=require(_0x209a('0x2'));var rp=require('request-promise');var moment=require(_0x209a('0x3'));var BPromise=require(_0x209a('0x4'));var Mustache=require(_0x209a('0x5'));var util=require(_0x209a('0x6'));var path=require('path');var sox=require(_0x209a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x209a('0x8'));var _=require(_0x209a('0x9'));var squel=require(_0x209a('0xa'));var crypto=require(_0x209a('0xb'));var jsforce=require(_0x209a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x209a('0xd'));var Papa=require(_0x209a('0xe'));var Redis=require(_0x209a('0xf'));var authService=require(_0x209a('0x10'));var qs=require(_0x209a('0x11'));var as=require(_0x209a('0x12'));var hardwareService=require(_0x209a('0x13'));var logger=require(_0x209a('0x14'))('api');var utils=require(_0x209a('0x15'));var config=require(_0x209a('0x16'));var licenseUtil=require(_0x209a('0x17'));var db=require(_0x209a('0x18'))['db'];function respondWithStatusCode(_0x141fd1,_0x1970d3){_0x1970d3=_0x1970d3||0xcc;return function(_0x3189a5){if(_0x3189a5){return _0x141fd1[_0x209a('0x19')](_0x1970d3);}return _0x141fd1[_0x209a('0x1a')](_0x1970d3)[_0x209a('0x1b')]();};}function respondWithResult(_0x1586b7,_0x50defb){_0x50defb=_0x50defb||0xc8;return function(_0x284964){if(_0x284964){return _0x1586b7[_0x209a('0x1a')](_0x50defb)['json'](_0x284964);}};}function respondWithFilteredResult(_0x406c9d,_0x27ffda){return function(_0x27d93b){if(_0x27d93b){var _0xa1feaa=typeof _0x27ffda['offset']===_0x209a('0x1c')&&typeof _0x27ffda[_0x209a('0x1d')]===_0x209a('0x1c');var _0x3d124e=_0x27d93b[_0x209a('0x1e')];var _0x19c525=_0xa1feaa?0x0:_0x27ffda[_0x209a('0x1f')];var _0x412e72=_0xa1feaa?_0x27d93b[_0x209a('0x1e')]:_0x27ffda[_0x209a('0x1f')]+_0x27ffda[_0x209a('0x1d')];var _0x109a95;if(_0x412e72>=_0x3d124e){_0x412e72=_0x3d124e;_0x109a95=0xc8;}else{_0x109a95=0xce;}_0x406c9d[_0x209a('0x1a')](_0x109a95);return _0x406c9d[_0x209a('0x20')]('Content-Range',_0x19c525+'-'+_0x412e72+'/'+_0x3d124e)['json'](_0x27d93b);}return null;};}function patchUpdates(_0x22a2b1){return function(_0x4a659f){try{jsonpatch['apply'](_0x4a659f,_0x22a2b1,!![]);}catch(_0x57986c){return BPromise[_0x209a('0x21')](_0x57986c);}return _0x4a659f[_0x209a('0x22')]();};}function saveUpdates(_0x1e88db,_0x58c7c7){return function(_0x24c64c){if(_0x24c64c){return _0x24c64c[_0x209a('0x23')](_0x1e88db)[_0x209a('0x24')](function(_0x5c8201){return _0x5c8201;});}return null;};}function removeEntity(_0x212b5a,_0x503b39){return function(_0x5ec508){if(_0x5ec508){return _0x5ec508[_0x209a('0x25')]()[_0x209a('0x24')](function(){var _0x3dccc8=_0x5ec508['get']({'plain':!![]});var _0x551935=_0x209a('0x26');return db['UserProfileResource'][_0x209a('0x25')]({'where':{'type':_0x551935,'resourceId':_0x3dccc8['id']}})['then'](function(){return _0x5ec508;});})[_0x209a('0x24')](function(){_0x212b5a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2212f4,_0x211ff9){return function(_0x5a233e){if(!_0x5a233e){_0x2212f4[_0x209a('0x19')](0x194);}return _0x5a233e;};}function handleError(_0x1e7331,_0x5a038f){_0x5a038f=_0x5a038f||0x1f4;return function(_0x10992e){logger[_0x209a('0x27')](_0x10992e[_0x209a('0x28')]);if(_0x10992e[_0x209a('0x29')]){delete _0x10992e['name'];}_0x1e7331[_0x209a('0x1a')](_0x5a038f)[_0x209a('0x2a')](_0x10992e);};}exports[_0x209a('0x2b')]=function(_0x35f70e,_0x2a5348){var _0x4bcdac={},_0x3d06e7={},_0x4f84b8={'count':0x0,'rows':[]};var _0x110951=_[_0x209a('0x2c')](db[_0x209a('0x2d')][_0x209a('0x2e')],function(_0x284f53){return{'name':_0x284f53[_0x209a('0x2f')],'type':_0x284f53[_0x209a('0x30')][_0x209a('0x31')]};});_0x3d06e7['model']=_['map'](_0x110951,'name');_0x3d06e7[_0x209a('0x32')]=_[_0x209a('0x33')](_0x35f70e['query']);_0x3d06e7[_0x209a('0x34')]=_[_0x209a('0x35')](_0x3d06e7[_0x209a('0x36')],_0x3d06e7[_0x209a('0x32')]);_0x4bcdac['attributes']=_[_0x209a('0x35')](_0x3d06e7[_0x209a('0x36')],qs['fields'](_0x35f70e['query'][_0x209a('0x37')]));_0x4bcdac[_0x209a('0x38')]=_0x4bcdac[_0x209a('0x38')][_0x209a('0x39')]?_0x4bcdac['attributes']:_0x3d06e7[_0x209a('0x36')];if(!_0x35f70e[_0x209a('0x32')][_0x209a('0x3a')](_0x209a('0x3b'))){_0x4bcdac[_0x209a('0x1d')]=qs[_0x209a('0x1d')](_0x35f70e[_0x209a('0x32')]['limit']);_0x4bcdac[_0x209a('0x1f')]=qs[_0x209a('0x1f')](_0x35f70e[_0x209a('0x32')][_0x209a('0x1f')]);}_0x4bcdac[_0x209a('0x3c')]=qs[_0x209a('0x3d')](_0x35f70e['query'][_0x209a('0x3d')]);_0x4bcdac[_0x209a('0x3e')]=qs[_0x209a('0x34')](_[_0x209a('0x3f')](_0x35f70e[_0x209a('0x32')],_0x3d06e7[_0x209a('0x34')]),_0x110951);if(_0x35f70e['query']['filter']){_0x4bcdac[_0x209a('0x3e')]=_[_0x209a('0x40')](_0x4bcdac[_0x209a('0x3e')],{'$or':_[_0x209a('0x2c')](_0x110951,function(_0x281e88){if(_0x281e88[_0x209a('0x30')]!==_0x209a('0x41')){var _0x4d9632={};_0x4d9632[_0x281e88['name']]={'$like':'%'+_0x35f70e['query']['filter']+'%'};return _0x4d9632;}})});}_0x4bcdac=_[_0x209a('0x40')]({},_0x4bcdac,_0x35f70e['options']);var _0x13d926={'where':_0x4bcdac['where']};return db[_0x209a('0x2d')][_0x209a('0x1e')](_0x13d926)[_0x209a('0x24')](function(_0x422c93){_0x4f84b8[_0x209a('0x1e')]=_0x422c93;if(_0x35f70e[_0x209a('0x32')]['includeAll']){_0x4bcdac[_0x209a('0x42')]=[{'all':!![]}];}return db['Template'][_0x209a('0x43')](_0x4bcdac);})[_0x209a('0x24')](function(_0x9efbdc){_0x4f84b8[_0x209a('0x44')]=_0x9efbdc;return _0x4f84b8;})[_0x209a('0x24')](respondWithFilteredResult(_0x2a5348,_0x4bcdac))[_0x209a('0x45')](handleError(_0x2a5348,null));};exports[_0x209a('0x46')]=function(_0x22d45f,_0x14ce4d){var _0x544aed={'raw':!![],'where':{'id':_0x22d45f[_0x209a('0x47')]['id']}},_0x405754={};_0x405754['model']=_[_0x209a('0x33')](db[_0x209a('0x2d')]['rawAttributes']);_0x405754['query']=_[_0x209a('0x33')](_0x22d45f[_0x209a('0x32')]);_0x405754[_0x209a('0x34')]=_[_0x209a('0x35')](_0x405754[_0x209a('0x36')],_0x405754[_0x209a('0x32')]);_0x544aed[_0x209a('0x38')]=_[_0x209a('0x35')](_0x405754[_0x209a('0x36')],qs['fields'](_0x22d45f[_0x209a('0x32')][_0x209a('0x37')]));_0x544aed['attributes']=_0x544aed[_0x209a('0x38')][_0x209a('0x39')]?_0x544aed['attributes']:_0x405754[_0x209a('0x36')];if(_0x22d45f[_0x209a('0x32')][_0x209a('0x48')]){_0x544aed[_0x209a('0x42')]=[{'all':!![]}];}_0x544aed=_[_0x209a('0x40')]({},_0x544aed,_0x22d45f['options']);return db[_0x209a('0x2d')][_0x209a('0x49')](_0x544aed)[_0x209a('0x24')](handleEntityNotFound(_0x14ce4d,null))['then'](respondWithResult(_0x14ce4d,null))[_0x209a('0x45')](handleError(_0x14ce4d,null));};exports['create']=function(_0x39a786,_0x76e5d){return db['Template']['create'](_0x39a786[_0x209a('0x4a')],{})[_0x209a('0x24')](function(_0x277217){var _0x390fa0=_0x39a786['user'][_0x209a('0x4b')]({'plain':!![]});if(!_0x390fa0)throw new Error(_0x209a('0x4c'));if(_0x390fa0['role']===_0x209a('0x4d')){var _0x2f86a0=_0x277217[_0x209a('0x4b')]({'plain':!![]});var _0x4d82a9='Templates';return db[_0x209a('0x4e')][_0x209a('0x49')]({'where':{'name':_0x4d82a9,'userProfileId':_0x390fa0[_0x209a('0x4f')]},'raw':!![]})['then'](function(_0x13ffb8){if(_0x13ffb8&&_0x13ffb8[_0x209a('0x50')]===0x0){return db['UserProfileResource'][_0x209a('0x51')]({'name':_0x2f86a0[_0x209a('0x29')],'resourceId':_0x2f86a0['id'],'type':_0x13ffb8[_0x209a('0x29')],'sectionId':_0x13ffb8['id']},{})[_0x209a('0x24')](function(){return _0x277217;});}else{return _0x277217;}})[_0x209a('0x45')](function(_0x19e328){logger['error'](_0x209a('0x52'),_0x19e328);throw _0x19e328;});}return _0x277217;})['then'](respondWithResult(_0x76e5d,0xc9))[_0x209a('0x45')](handleError(_0x76e5d,null));};exports[_0x209a('0x23')]=function(_0xf9ebf2,_0x1fdd0a){if(_0xf9ebf2['body']['id']){delete _0xf9ebf2[_0x209a('0x4a')]['id'];}return db['Template']['find']({'where':{'id':_0xf9ebf2['params']['id']}})[_0x209a('0x24')](handleEntityNotFound(_0x1fdd0a,null))[_0x209a('0x24')](saveUpdates(_0xf9ebf2[_0x209a('0x4a')],null))[_0x209a('0x24')](respondWithResult(_0x1fdd0a,null))[_0x209a('0x45')](handleError(_0x1fdd0a,null));};exports[_0x209a('0x25')]=function(_0x4719ea,_0x111529){return db[_0x209a('0x2d')][_0x209a('0x49')]({'where':{'id':_0x4719ea[_0x209a('0x47')]['id']}})[_0x209a('0x24')](handleEntityNotFound(_0x111529,null))[_0x209a('0x24')](removeEntity(_0x111529,null))[_0x209a('0x45')](handleError(_0x111529,null));};
\ No newline at end of file
index 381ada8..e647f4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8437=['Template','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x18f538,_0x2d23fd){var _0x249882=function(_0x555e84){while(--_0x555e84){_0x18f538['push'](_0x18f538['shift']());}};_0x249882(++_0x2d23fd);}(_0x8437,0x172));var _0x7843=function(_0x3e5028,_0x22baf6){_0x3e5028=_0x3e5028-0x0;var _0x348b43=_0x8437[_0x3e5028];return _0x348b43;};'use strict';var _=require(_0x7843('0x0'));var util=require(_0x7843('0x1'));var logger=require(_0x7843('0x2'))(_0x7843('0x3'));var moment=require(_0x7843('0x4'));var BPromise=require('bluebird');var rp=require(_0x7843('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7843('0x6'));var config=require(_0x7843('0x7'));var attributes=require('./template.attributes');module['exports']=function(_0x1d18be,_0x1cbb6d){return _0x1d18be['define'](_0x7843('0x8'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ec0=['bluebird','request-promise','rimraf','./template.attributes','exports','define','Template','tools_templates','lodash','util','../../config/logger','api'];(function(_0x3ffa27,_0x2a6aad){var _0x2e4181=function(_0x3212d3){while(--_0x3212d3){_0x3ffa27['push'](_0x3ffa27['shift']());}};_0x2e4181(++_0x2a6aad);}(_0x9ec0,0x188));var _0x09ec=function(_0x34da86,_0x16cd32){_0x34da86=_0x34da86-0x0;var _0x396bc1=_0x9ec0[_0x34da86];return _0x396bc1;};'use strict';var _=require(_0x09ec('0x0'));var util=require(_0x09ec('0x1'));var logger=require(_0x09ec('0x2'))(_0x09ec('0x3'));var moment=require('moment');var BPromise=require(_0x09ec('0x4'));var rp=require(_0x09ec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09ec('0x6'));var config=require('../../config/environment');var attributes=require(_0x09ec('0x7'));module[_0x09ec('0x8')]=function(_0x32a3e7,_0x4ab34b){return _0x32a3e7[_0x09ec('0x9')](_0x09ec('0xa'),attributes,{'tableName':_0x09ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4be5051..4b8aff8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bf3=['info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then'];(function(_0x34e529,_0x49ded4){var _0x2c0195=function(_0x2d8405){while(--_0x2d8405){_0x34e529['push'](_0x34e529['shift']());}};_0x2c0195(++_0x49ded4);}(_0x3bf3,0x168));var _0x33bf=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0x3bf3[_0x3a8dc1];return _0x4b3595;};'use strict';var _=require('lodash');var util=require(_0x33bf('0x0'));var moment=require(_0x33bf('0x1'));var BPromise=require(_0x33bf('0x2'));var rs=require(_0x33bf('0x3'));var fs=require('fs');var Redis=require(_0x33bf('0x4'));var db=require(_0x33bf('0x5'))['db'];var utils=require(_0x33bf('0x6'));var logger=require(_0x33bf('0x7'))(_0x33bf('0x8'));var config=require('../../config/environment');var jayson=require(_0x33bf('0x9'));var client=jayson['client'][_0x33bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d4fc4,_0x49a9f2,_0x54d2e5){return new BPromise(function(_0x86a69f,_0x340c65){return client['request'](_0x1d4fc4,_0x54d2e5)[_0x33bf('0xb')](function(_0xa3db37){logger[_0x33bf('0xc')](_0x33bf('0xd'),_0x49a9f2,_0x33bf('0xe'));logger[_0x33bf('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x49a9f2,_0x33bf('0xe'),JSON[_0x33bf('0x10')](_0xa3db37));if(_0xa3db37[_0x33bf('0x11')]){if(_0xa3db37[_0x33bf('0x11')][_0x33bf('0x12')]===0x1f4){logger[_0x33bf('0x11')](_0x33bf('0xd'),_0x49a9f2,_0xa3db37['error'][_0x33bf('0x13')]);return _0x340c65(_0xa3db37['error']['message']);}logger[_0x33bf('0x11')]('Template,\x20%s,\x20%s',_0x49a9f2,_0xa3db37[_0x33bf('0x11')][_0x33bf('0x13')]);return _0x86a69f(_0xa3db37[_0x33bf('0x11')][_0x33bf('0x13')]);}else{logger['info'](_0x33bf('0xd'),_0x49a9f2,'request\x20sent');_0x86a69f(_0xa3db37['result']['message']);}})[_0x33bf('0x14')](function(_0x39ad7d){logger[_0x33bf('0x11')](_0x33bf('0xd'),_0x49a9f2,_0x39ad7d);_0x340c65(_0x39ad7d);});});}exports[_0x33bf('0x15')]=function(_0x1f3b89){var _0x2b8358=this;return new Promise(function(_0x1a0ea8,_0x4502a8){return db[_0x33bf('0x16')]['findAll']({'raw':_0x1f3b89['options']?_0x1f3b89[_0x33bf('0x17')][_0x33bf('0x18')]===undefined?!![]:![]:!![],'where':_0x1f3b89['options']?_0x1f3b89[_0x33bf('0x17')][_0x33bf('0x19')]||null:null,'attributes':_0x1f3b89['options']?_0x1f3b89['options'][_0x33bf('0x1a')]||null:null,'limit':_0x1f3b89['options']?_0x1f3b89[_0x33bf('0x17')][_0x33bf('0x1b')]||null:null,'include':_0x1f3b89[_0x33bf('0x17')]?_0x1f3b89['options'][_0x33bf('0x1c')]?_[_0x33bf('0x1d')](_0x1f3b89[_0x33bf('0x17')][_0x33bf('0x1c')],function(_0x39a190){return{'model':db[_0x39a190[_0x33bf('0x1e')]],'as':_0x39a190['as'],'attributes':_0x39a190[_0x33bf('0x1a')],'include':_0x39a190[_0x33bf('0x1c')]?_[_0x33bf('0x1d')](_0x39a190['include'],function(_0x355a19){return{'model':db[_0x355a19[_0x33bf('0x1e')]],'as':_0x355a19['as'],'attributes':_0x355a19['attributes'],'include':_0x355a19[_0x33bf('0x1c')]?_[_0x33bf('0x1d')](_0x355a19[_0x33bf('0x1c')],function(_0x4556e9){return{'model':db[_0x4556e9[_0x33bf('0x1e')]],'as':_0x4556e9['as'],'attributes':_0x4556e9['attributes']};}):[]};}):[]};}):[]:[]})[_0x33bf('0xb')](function(_0x34529a){logger[_0x33bf('0xc')](_0x33bf('0x15'),_0x1f3b89);logger[_0x33bf('0xf')](_0x33bf('0x15'),_0x1f3b89,JSON[_0x33bf('0x10')](_0x34529a));_0x1a0ea8(_0x34529a);})[_0x33bf('0x14')](function(_0x57cf82){logger[_0x33bf('0x11')]('GetTemplate',_0x57cf82[_0x33bf('0x13')],_0x1f3b89);_0x4502a8(_0x2b8358[_0x33bf('0x11')](0x1f4,_0x57cf82[_0x33bf('0x13')]));});});};
\ No newline at end of file
+var _0x0179=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','Template,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetTemplate','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1b1080,_0x5390d2){var _0x169282=function(_0x29cf5a){while(--_0x29cf5a){_0x1b1080['push'](_0x1b1080['shift']());}};_0x169282(++_0x5390d2);}(_0x0179,0x19a));var _0x9017=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x0179[_0x468b0f];return _0x3e74d9;};'use strict';var _=require(_0x9017('0x0'));var util=require(_0x9017('0x1'));var moment=require(_0x9017('0x2'));var BPromise=require(_0x9017('0x3'));var rs=require(_0x9017('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9017('0x5'))['db'];var utils=require(_0x9017('0x6'));var logger=require(_0x9017('0x7'))(_0x9017('0x8'));var config=require(_0x9017('0x9'));var jayson=require(_0x9017('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c42ab,_0x17391f,_0x4fc323){return new BPromise(function(_0x3d14f9,_0x3536f1){return client[_0x9017('0xb')](_0x4c42ab,_0x4fc323)['then'](function(_0x29650f){logger[_0x9017('0xc')](_0x9017('0xd'),_0x17391f,_0x9017('0xe'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x17391f,_0x9017('0xe'),JSON['stringify'](_0x29650f));if(_0x29650f[_0x9017('0xf')]){if(_0x29650f[_0x9017('0xf')][_0x9017('0x10')]===0x1f4){logger['error'](_0x9017('0xd'),_0x17391f,_0x29650f[_0x9017('0xf')]['message']);return _0x3536f1(_0x29650f['error'][_0x9017('0x11')]);}logger['error'](_0x9017('0xd'),_0x17391f,_0x29650f[_0x9017('0xf')][_0x9017('0x11')]);return _0x3d14f9(_0x29650f['error'][_0x9017('0x11')]);}else{logger['info'](_0x9017('0xd'),_0x17391f,_0x9017('0xe'));_0x3d14f9(_0x29650f[_0x9017('0x12')]['message']);}})[_0x9017('0x13')](function(_0x15074a){logger[_0x9017('0xf')](_0x9017('0xd'),_0x17391f,_0x15074a);_0x3536f1(_0x15074a);});});}exports[_0x9017('0x14')]=function(_0x27a0c0){var _0x2509de=this;return new Promise(function(_0x9352d,_0x475719){return db['Template'][_0x9017('0x15')]({'raw':_0x27a0c0[_0x9017('0x16')]?_0x27a0c0[_0x9017('0x16')][_0x9017('0x17')]===undefined?!![]:![]:!![],'where':_0x27a0c0[_0x9017('0x16')]?_0x27a0c0[_0x9017('0x16')][_0x9017('0x18')]||null:null,'attributes':_0x27a0c0[_0x9017('0x16')]?_0x27a0c0[_0x9017('0x16')][_0x9017('0x19')]||null:null,'limit':_0x27a0c0['options']?_0x27a0c0[_0x9017('0x16')][_0x9017('0x1a')]||null:null,'include':_0x27a0c0[_0x9017('0x16')]?_0x27a0c0[_0x9017('0x16')]['include']?_['map'](_0x27a0c0[_0x9017('0x16')][_0x9017('0x1b')],function(_0xa6c746){return{'model':db[_0xa6c746['model']],'as':_0xa6c746['as'],'attributes':_0xa6c746[_0x9017('0x19')],'include':_0xa6c746[_0x9017('0x1b')]?_[_0x9017('0x1c')](_0xa6c746[_0x9017('0x1b')],function(_0x2c90b6){return{'model':db[_0x2c90b6['model']],'as':_0x2c90b6['as'],'attributes':_0x2c90b6[_0x9017('0x19')],'include':_0x2c90b6[_0x9017('0x1b')]?_[_0x9017('0x1c')](_0x2c90b6[_0x9017('0x1b')],function(_0x2c0eec){return{'model':db[_0x2c0eec[_0x9017('0x1d')]],'as':_0x2c0eec['as'],'attributes':_0x2c0eec[_0x9017('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9017('0x1e')](function(_0xc35a6b){logger[_0x9017('0xc')](_0x9017('0x14'),_0x27a0c0);logger[_0x9017('0x1f')](_0x9017('0x14'),_0x27a0c0,JSON['stringify'](_0xc35a6b));_0x9352d(_0xc35a6b);})[_0x9017('0x13')](function(_0x26bd88){logger[_0x9017('0xf')](_0x9017('0x14'),_0x26bd88[_0x9017('0x11')],_0x27a0c0);_0x475719(_0x2509de['error'](0x1f4,_0x26bd88[_0x9017('0x11')]));});});};
\ No newline at end of file
index b5a7165..bdc2210 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1939=['/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index'];(function(_0x391a2b,_0x4943c7){var _0x5a9cc3=function(_0x4fc012){while(--_0x4fc012){_0x391a2b['push'](_0x391a2b['shift']());}};_0x5a9cc3(++_0x4943c7);}(_0x1939,0xbf));var _0x9193=function(_0x260478,_0x2040a1){_0x260478=_0x260478-0x0;var _0x4048fb=_0x1939[_0x260478];return _0x4048fb;};'use strict';var multer=require(_0x9193('0x0'));var util=require(_0x9193('0x1'));var path=require(_0x9193('0x2'));var timeout=require('connect-timeout');var express=require(_0x9193('0x3'));var router=express['Router']();var fs_extra=require(_0x9193('0x4'));var auth=require(_0x9193('0x5'));var interaction=require(_0x9193('0x6'));var config=require(_0x9193('0x7'));var controller=require(_0x9193('0x8'));router[_0x9193('0x9')]('/',auth[_0x9193('0xa')](),controller[_0x9193('0xb')]);router['get'](_0x9193('0xc'),auth[_0x9193('0xa')](),controller[_0x9193('0xd')]);router['get'](_0x9193('0xe'),auth[_0x9193('0xa')](),controller[_0x9193('0xf')]);router[_0x9193('0x9')](_0x9193('0x10'),auth['isAuthenticated'](),controller[_0x9193('0x11')]);router[_0x9193('0x9')](_0x9193('0x12'),auth[_0x9193('0xa')](),controller[_0x9193('0x13')]);router[_0x9193('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9193('0x14')](_0x9193('0xe'),auth[_0x9193('0xa')](),controller[_0x9193('0x15')]);router[_0x9193('0x14')](_0x9193('0x10'),auth[_0x9193('0xa')](),controller[_0x9193('0x16')]);router[_0x9193('0x14')](_0x9193('0x12'),auth[_0x9193('0xa')](),controller[_0x9193('0x17')]);router[_0x9193('0x18')](_0x9193('0xc'),auth[_0x9193('0xa')](),controller[_0x9193('0x19')]);router[_0x9193('0x1a')](_0x9193('0xc'),auth[_0x9193('0xa')](),controller[_0x9193('0x1b')]);module[_0x9193('0x1c')]=router;
\ No newline at end of file
+var _0xd676=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','post','create','addAnyCondition','/:id/actions','addAction','put','update','exports'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xd676,0x1e6));var _0x6d67=function(_0x1f356c,_0x313364){_0x1f356c=_0x1f356c-0x0;var _0x2674dc=_0xd676[_0x1f356c];return _0x2674dc;};'use strict';var multer=require(_0x6d67('0x0'));var util=require(_0x6d67('0x1'));var path=require('path');var timeout=require(_0x6d67('0x2'));var express=require(_0x6d67('0x3'));var router=express[_0x6d67('0x4')]();var fs_extra=require(_0x6d67('0x5'));var auth=require(_0x6d67('0x6'));var interaction=require(_0x6d67('0x7'));var config=require(_0x6d67('0x8'));var controller=require(_0x6d67('0x9'));router['get']('/',auth[_0x6d67('0xa')](),controller[_0x6d67('0xb')]);router[_0x6d67('0xc')](_0x6d67('0xd'),auth[_0x6d67('0xa')](),controller[_0x6d67('0xe')]);router[_0x6d67('0xc')](_0x6d67('0xf'),auth['isAuthenticated'](),controller[_0x6d67('0x10')]);router['get'](_0x6d67('0x11'),auth[_0x6d67('0xa')](),controller[_0x6d67('0x12')]);router[_0x6d67('0xc')]('/:id/actions',auth[_0x6d67('0xa')](),controller['getActions']);router[_0x6d67('0x13')]('/',auth['isAuthenticated'](),controller[_0x6d67('0x14')]);router['post'](_0x6d67('0xf'),auth[_0x6d67('0xa')](),controller['addAllCondition']);router[_0x6d67('0x13')](_0x6d67('0x11'),auth['isAuthenticated'](),controller[_0x6d67('0x15')]);router['post'](_0x6d67('0x16'),auth['isAuthenticated'](),controller[_0x6d67('0x17')]);router[_0x6d67('0x18')](_0x6d67('0xd'),auth[_0x6d67('0xa')](),controller[_0x6d67('0x19')]);router['delete'](_0x6d67('0xd'),auth[_0x6d67('0xa')](),controller['destroy']);module[_0x6d67('0x1a')]=router;
\ No newline at end of file
index cef4e7e..58a87d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x610f=['sequelize','STRING','BOOLEAN'];(function(_0x166bc4,_0xb45bc){var _0x96630f=function(_0x57ca6f){while(--_0x57ca6f){_0x166bc4['push'](_0x166bc4['shift']());}};_0x96630f(++_0xb45bc);}(_0x610f,0xe4));var _0xf610=function(_0x25e1a2,_0x8d3307){_0x25e1a2=_0x25e1a2-0x0;var _0x40a473=_0x610f[_0x25e1a2];return _0x40a473;};'use strict';var Sequelize=require(_0xf610('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf610('0x1')]},'description':{'type':Sequelize[_0xf610('0x1')]},'status':{'type':Sequelize[_0xf610('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2cea=['exports','STRING','BOOLEAN','sequelize'];(function(_0x12a110,_0x2f5f52){var _0x1110c5=function(_0x18680c){while(--_0x18680c){_0x12a110['push'](_0x12a110['shift']());}};_0x1110c5(++_0x2f5f52);}(_0x2cea,0xef));var _0xa2ce=function(_0x208dcd,_0x21b78a){_0x208dcd=_0x208dcd-0x0;var _0x471717=_0x2cea[_0x208dcd];return _0x471717;};'use strict';var Sequelize=require(_0xa2ce('0x0'));module[_0xa2ce('0x1')]={'name':{'type':Sequelize[_0xa2ce('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa2ce('0x2')]},'status':{'type':Sequelize[_0xa2ce('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 114aa90..bbc454c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e65=['TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','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','update','then','destroy','get','Triggers','UserProfileResource','error','stack','send','index','Trigger','type','key','model','map','name','query','keys','filters','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','params','rawAttributes','attributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','addAllCondition','Condition','TriggerAnyId','getAllConditions','findOne','order','length','getAnyConditions','addAction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e65,0x120));var _0x52e6=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x2e65[_0x3a2a3c];return _0x50ac9a;};'use strict';var emlformat=require(_0x52e6('0x0'));var rimraf=require(_0x52e6('0x1'));var zipdir=require(_0x52e6('0x2'));var jsonpatch=require(_0x52e6('0x3'));var rp=require(_0x52e6('0x4'));var moment=require('moment');var BPromise=require(_0x52e6('0x5'));var Mustache=require(_0x52e6('0x6'));var util=require('util');var path=require(_0x52e6('0x7'));var sox=require(_0x52e6('0x8'));var csv=require(_0x52e6('0x9'));var ejs=require(_0x52e6('0xa'));var fs=require('fs');var fs_extra=require(_0x52e6('0xb'));var _=require('lodash');var squel=require(_0x52e6('0xc'));var crypto=require(_0x52e6('0xd'));var jsforce=require(_0x52e6('0xe'));var deskjs=require(_0x52e6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x52e6('0x10'));var Papa=require(_0x52e6('0x11'));var Redis=require(_0x52e6('0x12'));var authService=require(_0x52e6('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52e6('0x14'));var logger=require(_0x52e6('0x15'))(_0x52e6('0x16'));var utils=require('../../config/utils');var config=require(_0x52e6('0x17'));var licenseUtil=require(_0x52e6('0x18'));var db=require(_0x52e6('0x19'))['db'];function respondWithStatusCode(_0x559847,_0x17908c){_0x17908c=_0x17908c||0xcc;return function(_0x29da87){if(_0x29da87){return _0x559847[_0x52e6('0x1a')](_0x17908c);}return _0x559847[_0x52e6('0x1b')](_0x17908c)[_0x52e6('0x1c')]();};}function respondWithResult(_0x516bd2,_0x19ee67){_0x19ee67=_0x19ee67||0xc8;return function(_0x126c26){if(_0x126c26){return _0x516bd2[_0x52e6('0x1b')](_0x19ee67)[_0x52e6('0x1d')](_0x126c26);}};}function respondWithFilteredResult(_0x1b955d,_0x1a6e6b){return function(_0x451c02){if(_0x451c02){var _0x27a329=typeof _0x1a6e6b[_0x52e6('0x1e')]===_0x52e6('0x1f')&&typeof _0x1a6e6b[_0x52e6('0x20')]===_0x52e6('0x1f');var _0x54431c=_0x451c02['count'];var _0x4026c4=_0x27a329?0x0:_0x1a6e6b['offset'];var _0x27af5b=_0x27a329?_0x451c02['count']:_0x1a6e6b[_0x52e6('0x1e')]+_0x1a6e6b['limit'];var _0x5693d0;if(_0x27af5b>=_0x54431c){_0x27af5b=_0x54431c;_0x5693d0=0xc8;}else{_0x5693d0=0xce;}_0x1b955d[_0x52e6('0x1b')](_0x5693d0);return _0x1b955d[_0x52e6('0x21')]('Content-Range',_0x4026c4+'-'+_0x27af5b+'/'+_0x54431c)[_0x52e6('0x1d')](_0x451c02);}return null;};}function patchUpdates(_0x116ef2){return function(_0xa19a38){try{jsonpatch[_0x52e6('0x22')](_0xa19a38,_0x116ef2,!![]);}catch(_0x278f7c){return BPromise[_0x52e6('0x23')](_0x278f7c);}return _0xa19a38['save']();};}function saveUpdates(_0x4f5a50,_0x114ef7){return function(_0x3e7480){if(_0x3e7480){return _0x3e7480[_0x52e6('0x24')](_0x4f5a50)[_0x52e6('0x25')](function(_0x207853){return _0x207853;});}return null;};}function removeEntity(_0x54c5a6,_0x178fda){return function(_0x133137){if(_0x133137){return _0x133137[_0x52e6('0x26')]()[_0x52e6('0x25')](function(){var _0x4778f8=_0x133137[_0x52e6('0x27')]({'plain':!![]});var _0x214b1d=_0x52e6('0x28');return db[_0x52e6('0x29')][_0x52e6('0x26')]({'where':{'type':_0x214b1d,'resourceId':_0x4778f8['id']}})['then'](function(){return _0x133137;});})[_0x52e6('0x25')](function(){_0x54c5a6[_0x52e6('0x1b')](0xcc)[_0x52e6('0x1c')]();});}};}function handleEntityNotFound(_0xfd2d3,_0x3180da){return function(_0x487022){if(!_0x487022){_0xfd2d3[_0x52e6('0x1a')](0x194);}return _0x487022;};}function handleError(_0x141767,_0x1fa97c){_0x1fa97c=_0x1fa97c||0x1f4;return function(_0x507950){logger[_0x52e6('0x2a')](_0x507950[_0x52e6('0x2b')]);if(_0x507950['name']){delete _0x507950['name'];}_0x141767[_0x52e6('0x1b')](_0x1fa97c)[_0x52e6('0x2c')](_0x507950);};}exports[_0x52e6('0x2d')]=function(_0x1113d2,_0x5b703a){var _0x290fa0={},_0xe23c41={},_0xdd12a1={'count':0x0,'rows':[]};var _0x254f32=_['map'](db[_0x52e6('0x2e')]['rawAttributes'],function(_0x120c52){return{'name':_0x120c52['fieldName'],'type':_0x120c52[_0x52e6('0x2f')][_0x52e6('0x30')]};});_0xe23c41[_0x52e6('0x31')]=_[_0x52e6('0x32')](_0x254f32,_0x52e6('0x33'));_0xe23c41[_0x52e6('0x34')]=_[_0x52e6('0x35')](_0x1113d2['query']);_0xe23c41[_0x52e6('0x36')]=_['intersection'](_0xe23c41[_0x52e6('0x31')],_0xe23c41['query']);_0x290fa0['attributes']=_[_0x52e6('0x37')](_0xe23c41['model'],qs['fields'](_0x1113d2[_0x52e6('0x34')][_0x52e6('0x38')]));_0x290fa0['attributes']=_0x290fa0['attributes']['length']?_0x290fa0['attributes']:_0xe23c41['model'];if(!_0x1113d2[_0x52e6('0x34')][_0x52e6('0x39')](_0x52e6('0x3a'))){_0x290fa0[_0x52e6('0x20')]=qs[_0x52e6('0x20')](_0x1113d2[_0x52e6('0x34')][_0x52e6('0x20')]);_0x290fa0[_0x52e6('0x1e')]=qs['offset'](_0x1113d2['query'][_0x52e6('0x1e')]);}_0x290fa0['order']=qs[_0x52e6('0x3b')](_0x1113d2['query'][_0x52e6('0x3b')]);_0x290fa0[_0x52e6('0x3c')]=qs[_0x52e6('0x36')](_[_0x52e6('0x3d')](_0x1113d2[_0x52e6('0x34')],_0xe23c41[_0x52e6('0x36')]),_0x254f32);if(_0x1113d2[_0x52e6('0x34')][_0x52e6('0x3e')]){_0x290fa0[_0x52e6('0x3c')]=_[_0x52e6('0x3f')](_0x290fa0[_0x52e6('0x3c')],{'$or':_[_0x52e6('0x32')](_0x254f32,function(_0x45c809){if(_0x45c809[_0x52e6('0x2f')]!==_0x52e6('0x40')){var _0x60ff88={};_0x60ff88[_0x45c809['name']]={'$like':'%'+_0x1113d2[_0x52e6('0x34')][_0x52e6('0x3e')]+'%'};return _0x60ff88;}})});}_0x290fa0=_[_0x52e6('0x3f')]({},_0x290fa0,_0x1113d2[_0x52e6('0x41')]);var _0x22e47a={'where':_0x290fa0['where']};return db[_0x52e6('0x2e')]['count'](_0x22e47a)['then'](function(_0xcfd42c){_0xdd12a1[_0x52e6('0x42')]=_0xcfd42c;if(_0x1113d2[_0x52e6('0x34')][_0x52e6('0x43')]){_0x290fa0['include']=[{'all':!![]}];}return db[_0x52e6('0x2e')]['findAll'](_0x290fa0);})[_0x52e6('0x25')](function(_0x841db7){_0xdd12a1[_0x52e6('0x44')]=_0x841db7;return _0xdd12a1;})[_0x52e6('0x25')](respondWithFilteredResult(_0x5b703a,_0x290fa0))[_0x52e6('0x45')](handleError(_0x5b703a,null));};exports['show']=function(_0x46ec4b,_0x30dc7e){var _0xb92690={'raw':![],'where':{'id':_0x46ec4b[_0x52e6('0x46')]['id']}},_0x5ce764={};_0x5ce764[_0x52e6('0x31')]=_['keys'](db[_0x52e6('0x2e')][_0x52e6('0x47')]);_0x5ce764[_0x52e6('0x34')]=_[_0x52e6('0x35')](_0x46ec4b[_0x52e6('0x34')]);_0x5ce764[_0x52e6('0x36')]=_[_0x52e6('0x37')](_0x5ce764[_0x52e6('0x31')],_0x5ce764['query']);_0xb92690['attributes']=_[_0x52e6('0x37')](_0x5ce764['model'],qs[_0x52e6('0x38')](_0x46ec4b[_0x52e6('0x34')][_0x52e6('0x38')]));_0xb92690[_0x52e6('0x48')]=_0xb92690[_0x52e6('0x48')]['length']?_0xb92690[_0x52e6('0x48')]:_0x5ce764[_0x52e6('0x31')];if(_0x46ec4b[_0x52e6('0x34')][_0x52e6('0x43')]){_0xb92690[_0x52e6('0x49')]=[{'all':!![]}];}_0xb92690=_[_0x52e6('0x3f')]({},_0xb92690,_0x46ec4b[_0x52e6('0x41')]);return db['Trigger'][_0x52e6('0x4a')](_0xb92690)['then'](handleEntityNotFound(_0x30dc7e,null))[_0x52e6('0x25')](respondWithResult(_0x30dc7e,null))['catch'](handleError(_0x30dc7e,null));};exports[_0x52e6('0x4b')]=function(_0xd517d9,_0x42ed45){return db[_0x52e6('0x2e')][_0x52e6('0x4b')](_0xd517d9['body'],{})[_0x52e6('0x25')](function(_0x419072){var _0x19ad9e=_0xd517d9[_0x52e6('0x4c')][_0x52e6('0x27')]({'plain':!![]});if(!_0x19ad9e)throw new Error(_0x52e6('0x4d'));if(_0x19ad9e[_0x52e6('0x4e')]===_0x52e6('0x4c')){var _0x2d6811=_0x419072[_0x52e6('0x27')]({'plain':!![]});var _0x2a1bbb=_0x52e6('0x28');return db[_0x52e6('0x4f')]['find']({'where':{'name':_0x2a1bbb,'userProfileId':_0x19ad9e[_0x52e6('0x50')]},'raw':!![]})[_0x52e6('0x25')](function(_0x4309b5){if(_0x4309b5&&_0x4309b5[_0x52e6('0x51')]===0x0){return db[_0x52e6('0x29')]['create']({'name':_0x2d6811[_0x52e6('0x33')],'resourceId':_0x2d6811['id'],'type':_0x4309b5[_0x52e6('0x33')],'sectionId':_0x4309b5['id']},{})[_0x52e6('0x25')](function(){return _0x419072;});}else{return _0x419072;}})['catch'](function(_0x19e9a9){logger[_0x52e6('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19e9a9);throw _0x19e9a9;});}return _0x419072;})['then'](respondWithResult(_0x42ed45,0xc9))[_0x52e6('0x45')](handleError(_0x42ed45,null));};exports[_0x52e6('0x24')]=function(_0x571633,_0x139f36){if(_0x571633[_0x52e6('0x52')]['id']){delete _0x571633[_0x52e6('0x52')]['id'];}return db[_0x52e6('0x2e')][_0x52e6('0x4a')]({'where':{'id':_0x571633[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0x139f36,null))[_0x52e6('0x25')](saveUpdates(_0x571633['body'],null))[_0x52e6('0x25')](respondWithResult(_0x139f36,null))[_0x52e6('0x45')](handleError(_0x139f36,null));};exports[_0x52e6('0x26')]=function(_0xd6466d,_0x4e3f44){return db['Trigger'][_0x52e6('0x4a')]({'where':{'id':_0xd6466d[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0x4e3f44,null))['then'](removeEntity(_0x4e3f44,null))[_0x52e6('0x45')](handleError(_0x4e3f44,null));};exports[_0x52e6('0x53')]=function(_0x4f9efd,_0xa9f1b8,_0x2a65bf){if(_0x4f9efd[_0x52e6('0x52')]['id']){delete _0x4f9efd[_0x52e6('0x52')]['id'];}return db[_0x52e6('0x2e')][_0x52e6('0x4a')]({'where':{'id':_0x4f9efd[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0xa9f1b8,null))[_0x52e6('0x25')](function(_0x16e7f1){if(_0x16e7f1){_0x4f9efd[_0x52e6('0x52')]['TriggerAllId']=_0x16e7f1['id'];return db[_0x52e6('0x54')][_0x52e6('0x4b')](_0x4f9efd[_0x52e6('0x52')]);}})[_0x52e6('0x25')](respondWithResult(_0xa9f1b8,null))[_0x52e6('0x45')](handleError(_0xa9f1b8,null));};exports['addAnyCondition']=function(_0x5c8cde,_0x106344,_0x43245b){if(_0x5c8cde[_0x52e6('0x52')]['id']){delete _0x5c8cde[_0x52e6('0x52')]['id'];}return db[_0x52e6('0x2e')][_0x52e6('0x4a')]({'where':{'id':_0x5c8cde[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0x106344,null))[_0x52e6('0x25')](function(_0x105eb7){if(_0x105eb7){_0x5c8cde[_0x52e6('0x52')][_0x52e6('0x55')]=_0x105eb7['id'];return db[_0x52e6('0x54')][_0x52e6('0x4b')](_0x5c8cde['body']);}})[_0x52e6('0x25')](respondWithResult(_0x106344,null))['catch'](handleError(_0x106344,null));};exports[_0x52e6('0x56')]=function(_0x3fd492,_0x69979a,_0x261d98){var _0x546c22={};var _0xf8b794={};var _0xe24ffc;var _0x2c4cfb;return db[_0x52e6('0x2e')][_0x52e6('0x57')]({'where':{'id':_0x3fd492[_0x52e6('0x46')]['id']}})['then'](handleEntityNotFound(_0x69979a,null))['then'](function(_0x77fe00){if(_0x77fe00){_0xe24ffc=_0x77fe00;_0xf8b794[_0x52e6('0x31')]=_[_0x52e6('0x35')](db[_0x52e6('0x54')][_0x52e6('0x47')]);_0xf8b794['query']=_[_0x52e6('0x35')](_0x3fd492['query']);_0xf8b794[_0x52e6('0x36')]=_['intersection'](_0xf8b794[_0x52e6('0x31')],_0xf8b794[_0x52e6('0x34')]);_0x546c22[_0x52e6('0x48')]=_['intersection'](_0xf8b794[_0x52e6('0x31')],qs[_0x52e6('0x38')](_0x3fd492[_0x52e6('0x34')][_0x52e6('0x38')]));_0x546c22[_0x52e6('0x48')]=_0x546c22[_0x52e6('0x48')]['length']?_0x546c22[_0x52e6('0x48')]:_0xf8b794[_0x52e6('0x31')];_0x546c22[_0x52e6('0x58')]=qs[_0x52e6('0x3b')](_0x3fd492['query'][_0x52e6('0x3b')]);_0x546c22[_0x52e6('0x3c')]=qs['filters'](_['pick'](_0x3fd492[_0x52e6('0x34')],_0xf8b794[_0x52e6('0x36')]));if(_0x3fd492[_0x52e6('0x34')][_0x52e6('0x3e')]){_0x546c22[_0x52e6('0x3c')]=_[_0x52e6('0x3f')](_0x546c22[_0x52e6('0x3c')],{'$or':_[_0x52e6('0x32')](_0x546c22[_0x52e6('0x48')],function(_0x41499b){var _0x43f31c={};_0x43f31c[_0x41499b]={'$like':'%'+_0x3fd492[_0x52e6('0x34')][_0x52e6('0x3e')]+'%'};return _0x43f31c;})});}_0x546c22=_[_0x52e6('0x3f')]({},_0x546c22,_0x3fd492['options']);return _0xe24ffc[_0x52e6('0x56')](_0x546c22);}})[_0x52e6('0x25')](function(_0x426711){if(_0x426711){_0x2c4cfb=_0x426711[_0x52e6('0x59')];if(!_0x3fd492[_0x52e6('0x34')]['hasOwnProperty']('nolimit')){_0x546c22['limit']=qs[_0x52e6('0x20')](_0x3fd492[_0x52e6('0x34')][_0x52e6('0x20')]);_0x546c22['offset']=qs[_0x52e6('0x1e')](_0x3fd492[_0x52e6('0x34')][_0x52e6('0x1e')]);}return _0xe24ffc[_0x52e6('0x56')](_0x546c22);}})[_0x52e6('0x25')](function(_0x1a185b){if(_0x1a185b){return _0x1a185b?{'count':_0x2c4cfb,'rows':_0x1a185b}:null;}})[_0x52e6('0x25')](respondWithResult(_0x69979a,null))[_0x52e6('0x45')](handleError(_0x69979a,null));};exports[_0x52e6('0x5a')]=function(_0x276cec,_0x234f23,_0x4a2da6){var _0x3cde38={};var _0x15a828={};var _0x2861af;var _0x4cf6c6;return db['Trigger'][_0x52e6('0x57')]({'where':{'id':_0x276cec[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0x234f23,null))['then'](function(_0x1cbc7d){if(_0x1cbc7d){_0x2861af=_0x1cbc7d;_0x15a828[_0x52e6('0x31')]=_[_0x52e6('0x35')](db[_0x52e6('0x54')][_0x52e6('0x47')]);_0x15a828[_0x52e6('0x34')]=_['keys'](_0x276cec['query']);_0x15a828['filters']=_['intersection'](_0x15a828['model'],_0x15a828[_0x52e6('0x34')]);_0x3cde38[_0x52e6('0x48')]=_[_0x52e6('0x37')](_0x15a828[_0x52e6('0x31')],qs[_0x52e6('0x38')](_0x276cec['query'][_0x52e6('0x38')]));_0x3cde38[_0x52e6('0x48')]=_0x3cde38[_0x52e6('0x48')][_0x52e6('0x59')]?_0x3cde38['attributes']:_0x15a828[_0x52e6('0x31')];_0x3cde38[_0x52e6('0x58')]=qs[_0x52e6('0x3b')](_0x276cec[_0x52e6('0x34')][_0x52e6('0x3b')]);_0x3cde38[_0x52e6('0x3c')]=qs[_0x52e6('0x36')](_['pick'](_0x276cec['query'],_0x15a828['filters']));if(_0x276cec[_0x52e6('0x34')][_0x52e6('0x3e')]){_0x3cde38[_0x52e6('0x3c')]=_[_0x52e6('0x3f')](_0x3cde38[_0x52e6('0x3c')],{'$or':_[_0x52e6('0x32')](_0x3cde38['attributes'],function(_0x579ee8){var _0x529500={};_0x529500[_0x579ee8]={'$like':'%'+_0x276cec[_0x52e6('0x34')]['filter']+'%'};return _0x529500;})});}_0x3cde38=_[_0x52e6('0x3f')]({},_0x3cde38,_0x276cec[_0x52e6('0x41')]);return _0x2861af[_0x52e6('0x5a')](_0x3cde38);}})[_0x52e6('0x25')](function(_0xeb569d){if(_0xeb569d){_0x4cf6c6=_0xeb569d[_0x52e6('0x59')];if(!_0x276cec[_0x52e6('0x34')][_0x52e6('0x39')]('nolimit')){_0x3cde38[_0x52e6('0x20')]=qs['limit'](_0x276cec['query'][_0x52e6('0x20')]);_0x3cde38[_0x52e6('0x1e')]=qs[_0x52e6('0x1e')](_0x276cec[_0x52e6('0x34')][_0x52e6('0x1e')]);}return _0x2861af[_0x52e6('0x5a')](_0x3cde38);}})[_0x52e6('0x25')](function(_0x2795c0){if(_0x2795c0){return _0x2795c0?{'count':_0x4cf6c6,'rows':_0x2795c0}:null;}})[_0x52e6('0x25')](respondWithResult(_0x234f23,null))['catch'](handleError(_0x234f23,null));};exports[_0x52e6('0x5b')]=function(_0x1660b9,_0x13f090,_0x970b07){if(_0x1660b9[_0x52e6('0x52')]['id']){delete _0x1660b9['body']['id'];}return db[_0x52e6('0x2e')][_0x52e6('0x4a')]({'where':{'id':_0x1660b9[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0x13f090,null))['then'](function(_0x40429b){if(_0x40429b){_0x1660b9['body'][_0x52e6('0x5c')]=_0x40429b['id'];return db[_0x52e6('0x5d')][_0x52e6('0x4b')](_0x1660b9[_0x52e6('0x52')]);}})[_0x52e6('0x25')](respondWithResult(_0x13f090,null))[_0x52e6('0x45')](handleError(_0x13f090,null));};exports[_0x52e6('0x5e')]=function(_0x2ab2a9,_0x350f68,_0x636254){var _0x581b1a={};var _0x18a0ba={};var _0x335669;var _0x3789bd;return db[_0x52e6('0x2e')]['findOne']({'where':{'id':_0x2ab2a9[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0x350f68,null))[_0x52e6('0x25')](function(_0x45a7d2){if(_0x45a7d2){_0x335669=_0x45a7d2;_0x18a0ba[_0x52e6('0x31')]=_['keys'](db['Action'][_0x52e6('0x47')]);_0x18a0ba['query']=_[_0x52e6('0x35')](_0x2ab2a9[_0x52e6('0x34')]);_0x18a0ba[_0x52e6('0x36')]=_[_0x52e6('0x37')](_0x18a0ba[_0x52e6('0x31')],_0x18a0ba[_0x52e6('0x34')]);_0x581b1a[_0x52e6('0x48')]=_[_0x52e6('0x37')](_0x18a0ba[_0x52e6('0x31')],qs['fields'](_0x2ab2a9['query'][_0x52e6('0x38')]));_0x581b1a['attributes']=_0x581b1a[_0x52e6('0x48')][_0x52e6('0x59')]?_0x581b1a[_0x52e6('0x48')]:_0x18a0ba[_0x52e6('0x31')];_0x581b1a[_0x52e6('0x58')]=qs['sort'](_0x2ab2a9['query'][_0x52e6('0x3b')]);_0x581b1a[_0x52e6('0x3c')]=qs[_0x52e6('0x36')](_[_0x52e6('0x3d')](_0x2ab2a9['query'],_0x18a0ba[_0x52e6('0x36')]));if(_0x2ab2a9['query'][_0x52e6('0x3e')]){_0x581b1a[_0x52e6('0x3c')]=_[_0x52e6('0x3f')](_0x581b1a[_0x52e6('0x3c')],{'$or':_[_0x52e6('0x32')](_0x581b1a[_0x52e6('0x48')],function(_0x5dedc3){var _0x4be619={};_0x4be619[_0x5dedc3]={'$like':'%'+_0x2ab2a9[_0x52e6('0x34')][_0x52e6('0x3e')]+'%'};return _0x4be619;})});}_0x581b1a=_['merge']({},_0x581b1a,_0x2ab2a9['options']);return _0x335669[_0x52e6('0x5e')](_0x581b1a);}})[_0x52e6('0x25')](function(_0x6b41e5){if(_0x6b41e5){_0x3789bd=_0x6b41e5[_0x52e6('0x59')];if(!_0x2ab2a9[_0x52e6('0x34')][_0x52e6('0x39')](_0x52e6('0x3a'))){_0x581b1a[_0x52e6('0x20')]=qs[_0x52e6('0x20')](_0x2ab2a9[_0x52e6('0x34')]['limit']);_0x581b1a[_0x52e6('0x1e')]=qs[_0x52e6('0x1e')](_0x2ab2a9['query'][_0x52e6('0x1e')]);}return _0x335669[_0x52e6('0x5e')](_0x581b1a);}})[_0x52e6('0x25')](function(_0x403af0){if(_0x403af0){return _0x403af0?{'count':_0x3789bd,'rows':_0x403af0}:null;}})[_0x52e6('0x25')](respondWithResult(_0x350f68,null))['catch'](handleError(_0x350f68,null));};
\ No newline at end of file
+var _0x47d4=['name','map','Trigger','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','rawAttributes','create','user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','Condition','TriggerAnyId','getAllConditions','findOne','order','nolimit','getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','Triggers','UserProfileResource','end','error','stack'];(function(_0x470c1b,_0x588a6c){var _0x4d57d5=function(_0x479e9d){while(--_0x479e9d){_0x470c1b['push'](_0x470c1b['shift']());}};_0x4d57d5(++_0x588a6c);}(_0x47d4,0x8e));var _0x447d=function(_0x13f585,_0x86d47){_0x13f585=_0x13f585-0x0;var _0x5e4b3c=_0x47d4[_0x13f585];return _0x5e4b3c;};'use strict';var emlformat=require(_0x447d('0x0'));var rimraf=require(_0x447d('0x1'));var zipdir=require(_0x447d('0x2'));var jsonpatch=require(_0x447d('0x3'));var rp=require(_0x447d('0x4'));var moment=require(_0x447d('0x5'));var BPromise=require(_0x447d('0x6'));var Mustache=require(_0x447d('0x7'));var util=require('util');var path=require('path');var sox=require(_0x447d('0x8'));var csv=require(_0x447d('0x9'));var ejs=require(_0x447d('0xa'));var fs=require('fs');var fs_extra=require(_0x447d('0xb'));var _=require(_0x447d('0xc'));var squel=require(_0x447d('0xd'));var crypto=require(_0x447d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x447d('0xf'));var Papa=require(_0x447d('0x10'));var Redis=require('ioredis');var authService=require(_0x447d('0x11'));var qs=require(_0x447d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x447d('0x13'));var logger=require(_0x447d('0x14'))(_0x447d('0x15'));var utils=require(_0x447d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x447d('0x17'));var db=require(_0x447d('0x18'))['db'];function respondWithStatusCode(_0x4d1800,_0x23cdab){_0x23cdab=_0x23cdab||0xcc;return function(_0x782e22){if(_0x782e22){return _0x4d1800[_0x447d('0x19')](_0x23cdab);}return _0x4d1800['status'](_0x23cdab)['end']();};}function respondWithResult(_0x87fe64,_0x3d6d17){_0x3d6d17=_0x3d6d17||0xc8;return function(_0x344275){if(_0x344275){return _0x87fe64[_0x447d('0x1a')](_0x3d6d17)[_0x447d('0x1b')](_0x344275);}};}function respondWithFilteredResult(_0x39183a,_0x306678){return function(_0x1e7ccb){if(_0x1e7ccb){var _0x4966b2=typeof _0x306678[_0x447d('0x1c')]===_0x447d('0x1d')&&typeof _0x306678[_0x447d('0x1e')]===_0x447d('0x1d');var _0x36f0df=_0x1e7ccb[_0x447d('0x1f')];var _0x7da058=_0x4966b2?0x0:_0x306678[_0x447d('0x1c')];var _0x1001bc=_0x4966b2?_0x1e7ccb['count']:_0x306678[_0x447d('0x1c')]+_0x306678['limit'];var _0x175d8d;if(_0x1001bc>=_0x36f0df){_0x1001bc=_0x36f0df;_0x175d8d=0xc8;}else{_0x175d8d=0xce;}_0x39183a[_0x447d('0x1a')](_0x175d8d);return _0x39183a[_0x447d('0x20')](_0x447d('0x21'),_0x7da058+'-'+_0x1001bc+'/'+_0x36f0df)[_0x447d('0x1b')](_0x1e7ccb);}return null;};}function patchUpdates(_0x12aa43){return function(_0x46be1e){try{jsonpatch[_0x447d('0x22')](_0x46be1e,_0x12aa43,!![]);}catch(_0x3b295b){return BPromise[_0x447d('0x23')](_0x3b295b);}return _0x46be1e['save']();};}function saveUpdates(_0x246a26,_0x512bfd){return function(_0x2dca87){if(_0x2dca87){return _0x2dca87['update'](_0x246a26)[_0x447d('0x24')](function(_0x4835e1){return _0x4835e1;});}return null;};}function removeEntity(_0x40e02c,_0x3a7f57){return function(_0x2ce4ed){if(_0x2ce4ed){return _0x2ce4ed[_0x447d('0x25')]()['then'](function(){var _0x343753=_0x2ce4ed[_0x447d('0x26')]({'plain':!![]});var _0x3da94a=_0x447d('0x27');return db[_0x447d('0x28')][_0x447d('0x25')]({'where':{'type':_0x3da94a,'resourceId':_0x343753['id']}})['then'](function(){return _0x2ce4ed;});})[_0x447d('0x24')](function(){_0x40e02c[_0x447d('0x1a')](0xcc)[_0x447d('0x29')]();});}};}function handleEntityNotFound(_0x46b5ef,_0x20cebb){return function(_0x3795ad){if(!_0x3795ad){_0x46b5ef[_0x447d('0x19')](0x194);}return _0x3795ad;};}function handleError(_0x4e4b6f,_0x456aec){_0x456aec=_0x456aec||0x1f4;return function(_0x238144){logger[_0x447d('0x2a')](_0x238144[_0x447d('0x2b')]);if(_0x238144[_0x447d('0x2c')]){delete _0x238144[_0x447d('0x2c')];}_0x4e4b6f[_0x447d('0x1a')](_0x456aec)['send'](_0x238144);};}exports['index']=function(_0x3bb275,_0x213019){var _0x499111={},_0x3d6aee={},_0x2f07b1={'count':0x0,'rows':[]};var _0x42708d=_[_0x447d('0x2d')](db[_0x447d('0x2e')]['rawAttributes'],function(_0x64802){return{'name':_0x64802[_0x447d('0x2f')],'type':_0x64802[_0x447d('0x30')][_0x447d('0x31')]};});_0x3d6aee[_0x447d('0x32')]=_[_0x447d('0x2d')](_0x42708d,_0x447d('0x2c'));_0x3d6aee['query']=_['keys'](_0x3bb275[_0x447d('0x33')]);_0x3d6aee[_0x447d('0x34')]=_[_0x447d('0x35')](_0x3d6aee['model'],_0x3d6aee['query']);_0x499111[_0x447d('0x36')]=_[_0x447d('0x35')](_0x3d6aee['model'],qs[_0x447d('0x37')](_0x3bb275[_0x447d('0x33')][_0x447d('0x37')]));_0x499111[_0x447d('0x36')]=_0x499111[_0x447d('0x36')][_0x447d('0x38')]?_0x499111['attributes']:_0x3d6aee[_0x447d('0x32')];if(!_0x3bb275[_0x447d('0x33')][_0x447d('0x39')]('nolimit')){_0x499111[_0x447d('0x1e')]=qs[_0x447d('0x1e')](_0x3bb275[_0x447d('0x33')]['limit']);_0x499111[_0x447d('0x1c')]=qs[_0x447d('0x1c')](_0x3bb275[_0x447d('0x33')][_0x447d('0x1c')]);}_0x499111['order']=qs[_0x447d('0x3a')](_0x3bb275[_0x447d('0x33')][_0x447d('0x3a')]);_0x499111[_0x447d('0x3b')]=qs[_0x447d('0x34')](_[_0x447d('0x3c')](_0x3bb275['query'],_0x3d6aee[_0x447d('0x34')]),_0x42708d);if(_0x3bb275[_0x447d('0x33')][_0x447d('0x3d')]){_0x499111[_0x447d('0x3b')]=_[_0x447d('0x3e')](_0x499111['where'],{'$or':_[_0x447d('0x2d')](_0x42708d,function(_0x4094dc){if(_0x4094dc[_0x447d('0x30')]!==_0x447d('0x3f')){var _0xce2b77={};_0xce2b77[_0x4094dc[_0x447d('0x2c')]]={'$like':'%'+_0x3bb275[_0x447d('0x33')][_0x447d('0x3d')]+'%'};return _0xce2b77;}})});}_0x499111=_['merge']({},_0x499111,_0x3bb275[_0x447d('0x40')]);var _0x22b99e={'where':_0x499111[_0x447d('0x3b')]};return db[_0x447d('0x2e')][_0x447d('0x1f')](_0x22b99e)[_0x447d('0x24')](function(_0x351d58){_0x2f07b1['count']=_0x351d58;if(_0x3bb275[_0x447d('0x33')][_0x447d('0x41')]){_0x499111[_0x447d('0x42')]=[{'all':!![]}];}return db[_0x447d('0x2e')]['findAll'](_0x499111);})[_0x447d('0x24')](function(_0xd3b1fa){_0x2f07b1[_0x447d('0x43')]=_0xd3b1fa;return _0x2f07b1;})[_0x447d('0x24')](respondWithFilteredResult(_0x213019,_0x499111))['catch'](handleError(_0x213019,null));};exports[_0x447d('0x44')]=function(_0x1f3c55,_0x343338){var _0x39b787={'raw':![],'where':{'id':_0x1f3c55[_0x447d('0x45')]['id']}},_0x2ebc94={};_0x2ebc94[_0x447d('0x32')]=_[_0x447d('0x46')](db['Trigger'][_0x447d('0x47')]);_0x2ebc94[_0x447d('0x33')]=_[_0x447d('0x46')](_0x1f3c55['query']);_0x2ebc94['filters']=_['intersection'](_0x2ebc94['model'],_0x2ebc94[_0x447d('0x33')]);_0x39b787[_0x447d('0x36')]=_[_0x447d('0x35')](_0x2ebc94['model'],qs[_0x447d('0x37')](_0x1f3c55[_0x447d('0x33')]['fields']));_0x39b787[_0x447d('0x36')]=_0x39b787['attributes'][_0x447d('0x38')]?_0x39b787[_0x447d('0x36')]:_0x2ebc94[_0x447d('0x32')];if(_0x1f3c55[_0x447d('0x33')][_0x447d('0x41')]){_0x39b787['include']=[{'all':!![]}];}_0x39b787=_[_0x447d('0x3e')]({},_0x39b787,_0x1f3c55[_0x447d('0x40')]);return db['Trigger']['find'](_0x39b787)[_0x447d('0x24')](handleEntityNotFound(_0x343338,null))[_0x447d('0x24')](respondWithResult(_0x343338,null))['catch'](handleError(_0x343338,null));};exports[_0x447d('0x48')]=function(_0x53fe5e,_0x529f45){return db[_0x447d('0x2e')]['create'](_0x53fe5e['body'],{})[_0x447d('0x24')](function(_0x276958){var _0x4e7b15=_0x53fe5e[_0x447d('0x49')][_0x447d('0x26')]({'plain':!![]});if(!_0x4e7b15)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e7b15[_0x447d('0x4a')]==='user'){var _0x1af4ba=_0x276958[_0x447d('0x26')]({'plain':!![]});var _0x5b2ecb='Triggers';return db[_0x447d('0x4b')]['find']({'where':{'name':_0x5b2ecb,'userProfileId':_0x4e7b15[_0x447d('0x4c')]},'raw':!![]})[_0x447d('0x24')](function(_0x3a0767){if(_0x3a0767&&_0x3a0767[_0x447d('0x4d')]===0x0){return db['UserProfileResource'][_0x447d('0x48')]({'name':_0x1af4ba[_0x447d('0x2c')],'resourceId':_0x1af4ba['id'],'type':_0x3a0767['name'],'sectionId':_0x3a0767['id']},{})[_0x447d('0x24')](function(){return _0x276958;});}else{return _0x276958;}})[_0x447d('0x4e')](function(_0x2ceea3){logger[_0x447d('0x2a')](_0x447d('0x4f'),_0x2ceea3);throw _0x2ceea3;});}return _0x276958;})['then'](respondWithResult(_0x529f45,0xc9))[_0x447d('0x4e')](handleError(_0x529f45,null));};exports[_0x447d('0x50')]=function(_0x3ef41a,_0x397872){if(_0x3ef41a[_0x447d('0x51')]['id']){delete _0x3ef41a['body']['id'];}return db[_0x447d('0x2e')][_0x447d('0x52')]({'where':{'id':_0x3ef41a[_0x447d('0x45')]['id']}})[_0x447d('0x24')](handleEntityNotFound(_0x397872,null))[_0x447d('0x24')](saveUpdates(_0x3ef41a[_0x447d('0x51')],null))[_0x447d('0x24')](respondWithResult(_0x397872,null))[_0x447d('0x4e')](handleError(_0x397872,null));};exports[_0x447d('0x25')]=function(_0x2905e3,_0xa20bf2){return db['Trigger'][_0x447d('0x52')]({'where':{'id':_0x2905e3[_0x447d('0x45')]['id']}})[_0x447d('0x24')](handleEntityNotFound(_0xa20bf2,null))[_0x447d('0x24')](removeEntity(_0xa20bf2,null))['catch'](handleError(_0xa20bf2,null));};exports['addAllCondition']=function(_0x3935d0,_0x2764f5,_0x59e881){if(_0x3935d0['body']['id']){delete _0x3935d0[_0x447d('0x51')]['id'];}return db[_0x447d('0x2e')]['find']({'where':{'id':_0x3935d0[_0x447d('0x45')]['id']}})[_0x447d('0x24')](handleEntityNotFound(_0x2764f5,null))[_0x447d('0x24')](function(_0x33a5fe){if(_0x33a5fe){_0x3935d0[_0x447d('0x51')]['TriggerAllId']=_0x33a5fe['id'];return db[_0x447d('0x53')][_0x447d('0x48')](_0x3935d0[_0x447d('0x51')]);}})['then'](respondWithResult(_0x2764f5,null))['catch'](handleError(_0x2764f5,null));};exports['addAnyCondition']=function(_0x2a9181,_0x153d7a,_0x1ffa91){if(_0x2a9181[_0x447d('0x51')]['id']){delete _0x2a9181[_0x447d('0x51')]['id'];}return db[_0x447d('0x2e')][_0x447d('0x52')]({'where':{'id':_0x2a9181[_0x447d('0x45')]['id']}})['then'](handleEntityNotFound(_0x153d7a,null))['then'](function(_0x3a45e9){if(_0x3a45e9){_0x2a9181[_0x447d('0x51')][_0x447d('0x54')]=_0x3a45e9['id'];return db[_0x447d('0x53')]['create'](_0x2a9181['body']);}})[_0x447d('0x24')](respondWithResult(_0x153d7a,null))[_0x447d('0x4e')](handleError(_0x153d7a,null));};exports[_0x447d('0x55')]=function(_0x2fc6bb,_0x9c952a,_0x120368){var _0x1f60b3={};var _0x7a1e77={};var _0xfa766a;var _0x15c8a1;return db[_0x447d('0x2e')][_0x447d('0x56')]({'where':{'id':_0x2fc6bb[_0x447d('0x45')]['id']}})[_0x447d('0x24')](handleEntityNotFound(_0x9c952a,null))[_0x447d('0x24')](function(_0x2e6482){if(_0x2e6482){_0xfa766a=_0x2e6482;_0x7a1e77[_0x447d('0x32')]=_[_0x447d('0x46')](db['Condition'][_0x447d('0x47')]);_0x7a1e77[_0x447d('0x33')]=_[_0x447d('0x46')](_0x2fc6bb['query']);_0x7a1e77[_0x447d('0x34')]=_['intersection'](_0x7a1e77[_0x447d('0x32')],_0x7a1e77[_0x447d('0x33')]);_0x1f60b3['attributes']=_[_0x447d('0x35')](_0x7a1e77[_0x447d('0x32')],qs['fields'](_0x2fc6bb[_0x447d('0x33')][_0x447d('0x37')]));_0x1f60b3[_0x447d('0x36')]=_0x1f60b3[_0x447d('0x36')][_0x447d('0x38')]?_0x1f60b3[_0x447d('0x36')]:_0x7a1e77[_0x447d('0x32')];_0x1f60b3[_0x447d('0x57')]=qs[_0x447d('0x3a')](_0x2fc6bb['query'][_0x447d('0x3a')]);_0x1f60b3[_0x447d('0x3b')]=qs[_0x447d('0x34')](_['pick'](_0x2fc6bb[_0x447d('0x33')],_0x7a1e77[_0x447d('0x34')]));if(_0x2fc6bb['query'][_0x447d('0x3d')]){_0x1f60b3['where']=_[_0x447d('0x3e')](_0x1f60b3[_0x447d('0x3b')],{'$or':_[_0x447d('0x2d')](_0x1f60b3['attributes'],function(_0x533bfa){var _0x3ac548={};_0x3ac548[_0x533bfa]={'$like':'%'+_0x2fc6bb[_0x447d('0x33')]['filter']+'%'};return _0x3ac548;})});}_0x1f60b3=_[_0x447d('0x3e')]({},_0x1f60b3,_0x2fc6bb['options']);return _0xfa766a['getAllConditions'](_0x1f60b3);}})['then'](function(_0x3b3517){if(_0x3b3517){_0x15c8a1=_0x3b3517['length'];if(!_0x2fc6bb[_0x447d('0x33')][_0x447d('0x39')](_0x447d('0x58'))){_0x1f60b3['limit']=qs[_0x447d('0x1e')](_0x2fc6bb[_0x447d('0x33')][_0x447d('0x1e')]);_0x1f60b3[_0x447d('0x1c')]=qs['offset'](_0x2fc6bb[_0x447d('0x33')][_0x447d('0x1c')]);}return _0xfa766a[_0x447d('0x55')](_0x1f60b3);}})[_0x447d('0x24')](function(_0x218d8a){if(_0x218d8a){return _0x218d8a?{'count':_0x15c8a1,'rows':_0x218d8a}:null;}})[_0x447d('0x24')](respondWithResult(_0x9c952a,null))[_0x447d('0x4e')](handleError(_0x9c952a,null));};exports[_0x447d('0x59')]=function(_0xcb38c2,_0xda3e67,_0x1bec7f){var _0x141c73={};var _0x493f31={};var _0x187ab5;var _0x536995;return db[_0x447d('0x2e')]['findOne']({'where':{'id':_0xcb38c2[_0x447d('0x45')]['id']}})[_0x447d('0x24')](handleEntityNotFound(_0xda3e67,null))[_0x447d('0x24')](function(_0x203277){if(_0x203277){_0x187ab5=_0x203277;_0x493f31['model']=_[_0x447d('0x46')](db[_0x447d('0x53')]['rawAttributes']);_0x493f31['query']=_[_0x447d('0x46')](_0xcb38c2[_0x447d('0x33')]);_0x493f31[_0x447d('0x34')]=_['intersection'](_0x493f31[_0x447d('0x32')],_0x493f31[_0x447d('0x33')]);_0x141c73['attributes']=_['intersection'](_0x493f31['model'],qs[_0x447d('0x37')](_0xcb38c2['query'][_0x447d('0x37')]));_0x141c73['attributes']=_0x141c73[_0x447d('0x36')][_0x447d('0x38')]?_0x141c73[_0x447d('0x36')]:_0x493f31['model'];_0x141c73[_0x447d('0x57')]=qs[_0x447d('0x3a')](_0xcb38c2['query'][_0x447d('0x3a')]);_0x141c73[_0x447d('0x3b')]=qs[_0x447d('0x34')](_['pick'](_0xcb38c2[_0x447d('0x33')],_0x493f31[_0x447d('0x34')]));if(_0xcb38c2[_0x447d('0x33')][_0x447d('0x3d')]){_0x141c73['where']=_[_0x447d('0x3e')](_0x141c73['where'],{'$or':_['map'](_0x141c73['attributes'],function(_0x34f087){var _0x311e54={};_0x311e54[_0x34f087]={'$like':'%'+_0xcb38c2[_0x447d('0x33')][_0x447d('0x3d')]+'%'};return _0x311e54;})});}_0x141c73=_[_0x447d('0x3e')]({},_0x141c73,_0xcb38c2[_0x447d('0x40')]);return _0x187ab5[_0x447d('0x59')](_0x141c73);}})['then'](function(_0x19fafb){if(_0x19fafb){_0x536995=_0x19fafb['length'];if(!_0xcb38c2[_0x447d('0x33')][_0x447d('0x39')](_0x447d('0x58'))){_0x141c73['limit']=qs[_0x447d('0x1e')](_0xcb38c2['query']['limit']);_0x141c73[_0x447d('0x1c')]=qs[_0x447d('0x1c')](_0xcb38c2[_0x447d('0x33')][_0x447d('0x1c')]);}return _0x187ab5[_0x447d('0x59')](_0x141c73);}})[_0x447d('0x24')](function(_0x45ccd8){if(_0x45ccd8){return _0x45ccd8?{'count':_0x536995,'rows':_0x45ccd8}:null;}})['then'](respondWithResult(_0xda3e67,null))[_0x447d('0x4e')](handleError(_0xda3e67,null));};exports['addAction']=function(_0x29ccaf,_0x5825f7,_0x3581ed){if(_0x29ccaf[_0x447d('0x51')]['id']){delete _0x29ccaf['body']['id'];}return db[_0x447d('0x2e')][_0x447d('0x52')]({'where':{'id':_0x29ccaf[_0x447d('0x45')]['id']}})[_0x447d('0x24')](handleEntityNotFound(_0x5825f7,null))['then'](function(_0x5063a2){if(_0x5063a2){_0x29ccaf[_0x447d('0x51')][_0x447d('0x5a')]=_0x5063a2['id'];return db[_0x447d('0x5b')][_0x447d('0x48')](_0x29ccaf[_0x447d('0x51')]);}})[_0x447d('0x24')](respondWithResult(_0x5825f7,null))[_0x447d('0x4e')](handleError(_0x5825f7,null));};exports[_0x447d('0x5c')]=function(_0x19af09,_0x55ea06,_0x476749){var _0x24b724={};var _0x4a5cab={};var _0x351ecd;var _0x3ea611;return db[_0x447d('0x2e')][_0x447d('0x56')]({'where':{'id':_0x19af09['params']['id']}})['then'](handleEntityNotFound(_0x55ea06,null))[_0x447d('0x24')](function(_0x3cdaaa){if(_0x3cdaaa){_0x351ecd=_0x3cdaaa;_0x4a5cab[_0x447d('0x32')]=_[_0x447d('0x46')](db['Action'][_0x447d('0x47')]);_0x4a5cab['query']=_[_0x447d('0x46')](_0x19af09[_0x447d('0x33')]);_0x4a5cab['filters']=_['intersection'](_0x4a5cab[_0x447d('0x32')],_0x4a5cab['query']);_0x24b724[_0x447d('0x36')]=_['intersection'](_0x4a5cab[_0x447d('0x32')],qs['fields'](_0x19af09[_0x447d('0x33')][_0x447d('0x37')]));_0x24b724[_0x447d('0x36')]=_0x24b724[_0x447d('0x36')][_0x447d('0x38')]?_0x24b724['attributes']:_0x4a5cab['model'];_0x24b724[_0x447d('0x57')]=qs[_0x447d('0x3a')](_0x19af09['query'][_0x447d('0x3a')]);_0x24b724[_0x447d('0x3b')]=qs['filters'](_['pick'](_0x19af09[_0x447d('0x33')],_0x4a5cab[_0x447d('0x34')]));if(_0x19af09[_0x447d('0x33')][_0x447d('0x3d')]){_0x24b724[_0x447d('0x3b')]=_[_0x447d('0x3e')](_0x24b724[_0x447d('0x3b')],{'$or':_[_0x447d('0x2d')](_0x24b724[_0x447d('0x36')],function(_0xee1c78){var _0x4fed32={};_0x4fed32[_0xee1c78]={'$like':'%'+_0x19af09[_0x447d('0x33')][_0x447d('0x3d')]+'%'};return _0x4fed32;})});}_0x24b724=_[_0x447d('0x3e')]({},_0x24b724,_0x19af09['options']);return _0x351ecd['getActions'](_0x24b724);}})[_0x447d('0x24')](function(_0x3217cf){if(_0x3217cf){_0x3ea611=_0x3217cf[_0x447d('0x38')];if(!_0x19af09[_0x447d('0x33')][_0x447d('0x39')](_0x447d('0x58'))){_0x24b724[_0x447d('0x1e')]=qs[_0x447d('0x1e')](_0x19af09['query'][_0x447d('0x1e')]);_0x24b724[_0x447d('0x1c')]=qs['offset'](_0x19af09[_0x447d('0x33')]['offset']);}return _0x351ecd['getActions'](_0x24b724);}})[_0x447d('0x24')](function(_0x41dd51){if(_0x41dd51){return _0x41dd51?{'count':_0x3ea611,'rows':_0x41dd51}:null;}})[_0x447d('0x24')](respondWithResult(_0x55ea06,null))[_0x447d('0x4e')](handleError(_0x55ea06,null));};
\ No newline at end of file
index 23190f6..21378ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaefc=['lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','Trigger'];(function(_0x4e531e,_0x3ade5a){var _0x504ff9=function(_0x4dcac9){while(--_0x4dcac9){_0x4e531e['push'](_0x4e531e['shift']());}};_0x504ff9(++_0x3ade5a);}(_0xaefc,0xc8));var _0xcaef=function(_0x240aaf,_0x2b8d86){_0x240aaf=_0x240aaf-0x0;var _0x280f83=_0xaefc[_0x240aaf];return _0x280f83;};'use strict';var _=require(_0xcaef('0x0'));var util=require(_0xcaef('0x1'));var logger=require(_0xcaef('0x2'))('api');var moment=require(_0xcaef('0x3'));var BPromise=require(_0xcaef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcaef('0x5'));var config=require(_0xcaef('0x6'));var attributes=require('./trigger.attributes');module['exports']=function(_0x47457d,_0x4471a1){return _0x47457d['define'](_0xcaef('0x7'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd6d6=['path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1b587c,_0x1f9efd){var _0xa52d64=function(_0x348b1e){while(--_0x348b1e){_0x1b587c['push'](_0x1b587c['shift']());}};_0xa52d64(++_0x1f9efd);}(_0xd6d6,0xbe));var _0x6d6d=function(_0xb363cc,_0x24b15b){_0xb363cc=_0xb363cc-0x0;var _0x287f78=_0xd6d6[_0xb363cc];return _0x287f78;};'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':!![]});};
\ No newline at end of file
index b22c809..b954722 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab22=['request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','findAll','options','raw','where','attributes','include','map','model','info','ShowTrigger','Trigger','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x55394d,_0x257093){var _0x436ebd=function(_0x34add6){while(--_0x34add6){_0x55394d['push'](_0x55394d['shift']());}};_0x436ebd(++_0x257093);}(_0xab22,0x1c9));var _0x2ab2=function(_0x43bdd5,_0x433cf9){_0x43bdd5=_0x43bdd5-0x0;var _0x17e811=_0xab22[_0x43bdd5];return _0x17e811;};'use strict';var _=require(_0x2ab2('0x0'));var util=require(_0x2ab2('0x1'));var moment=require('moment');var BPromise=require(_0x2ab2('0x2'));var rs=require(_0x2ab2('0x3'));var fs=require('fs');var Redis=require(_0x2ab2('0x4'));var db=require(_0x2ab2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2ab2('0x6'));var config=require(_0x2ab2('0x7'));var jayson=require(_0x2ab2('0x8'));var client=jayson[_0x2ab2('0x9')][_0x2ab2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15d5c9,_0x536467,_0x41e2e0){return new BPromise(function(_0x39f3c8,_0x43be9f){return client[_0x2ab2('0xb')](_0x15d5c9,_0x41e2e0)[_0x2ab2('0xc')](function(_0x1c322c){logger['info'](_0x2ab2('0xd'),_0x536467,_0x2ab2('0xe'));logger[_0x2ab2('0xf')](_0x2ab2('0x10'),_0x536467,_0x2ab2('0xe'),JSON[_0x2ab2('0x11')](_0x1c322c));if(_0x1c322c[_0x2ab2('0x12')]){if(_0x1c322c[_0x2ab2('0x12')][_0x2ab2('0x13')]===0x1f4){logger[_0x2ab2('0x12')]('Trigger,\x20%s,\x20%s',_0x536467,_0x1c322c['error'][_0x2ab2('0x14')]);return _0x43be9f(_0x1c322c[_0x2ab2('0x12')][_0x2ab2('0x14')]);}logger[_0x2ab2('0x12')](_0x2ab2('0xd'),_0x536467,_0x1c322c[_0x2ab2('0x12')]['message']);return _0x39f3c8(_0x1c322c['error']['message']);}else{logger['info'](_0x2ab2('0xd'),_0x536467,_0x2ab2('0xe'));_0x39f3c8(_0x1c322c[_0x2ab2('0x15')][_0x2ab2('0x14')]);}})[_0x2ab2('0x16')](function(_0x344e51){logger[_0x2ab2('0x12')](_0x2ab2('0xd'),_0x536467,_0x344e51);_0x43be9f(_0x344e51);});});}exports[_0x2ab2('0x17')]=function(_0x206916){var _0x439b47=this;return new Promise(function(_0x12af8f,_0x526149){return db['Trigger'][_0x2ab2('0x18')]({'raw':_0x206916[_0x2ab2('0x19')]?_0x206916[_0x2ab2('0x19')][_0x2ab2('0x1a')]===undefined?!![]:![]:!![],'where':_0x206916[_0x2ab2('0x19')]?_0x206916[_0x2ab2('0x19')][_0x2ab2('0x1b')]||null:null,'attributes':_0x206916[_0x2ab2('0x19')]?_0x206916['options'][_0x2ab2('0x1c')]||null:null,'limit':_0x206916[_0x2ab2('0x19')]?_0x206916[_0x2ab2('0x19')]['limit']||null:null,'include':_0x206916['options']?_0x206916[_0x2ab2('0x19')][_0x2ab2('0x1d')]?_[_0x2ab2('0x1e')](_0x206916[_0x2ab2('0x19')]['include'],function(_0x41e34f){return{'model':db[_0x41e34f[_0x2ab2('0x1f')]],'as':_0x41e34f['as'],'attributes':_0x41e34f['attributes'],'include':_0x41e34f[_0x2ab2('0x1d')]?_[_0x2ab2('0x1e')](_0x41e34f[_0x2ab2('0x1d')],function(_0x573a8d){return{'model':db[_0x573a8d[_0x2ab2('0x1f')]],'as':_0x573a8d['as'],'attributes':_0x573a8d['attributes'],'include':_0x573a8d[_0x2ab2('0x1d')]?_[_0x2ab2('0x1e')](_0x573a8d[_0x2ab2('0x1d')],function(_0x488227){return{'model':db[_0x488227[_0x2ab2('0x1f')]],'as':_0x488227['as'],'attributes':_0x488227[_0x2ab2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2ab2('0xc')](function(_0x384240){logger[_0x2ab2('0x20')](_0x2ab2('0x17'),_0x206916);logger[_0x2ab2('0xf')]('GetTrigger',_0x206916,JSON['stringify'](_0x384240));_0x12af8f(_0x384240);})[_0x2ab2('0x16')](function(_0x50fd9c){logger[_0x2ab2('0x12')](_0x2ab2('0x17'),_0x50fd9c[_0x2ab2('0x14')],_0x206916);_0x526149(_0x439b47['error'](0x1f4,_0x50fd9c[_0x2ab2('0x14')]));});});};exports[_0x2ab2('0x21')]=function(_0x2854ca){var _0x257dbf=this;return new Promise(function(_0xb86ab0,_0x14a899){return db[_0x2ab2('0x22')][_0x2ab2('0x23')]({'raw':_0x2854ca['options']?_0x2854ca['options'][_0x2ab2('0x1a')]===undefined?!![]:![]:!![],'where':_0x2854ca[_0x2ab2('0x19')]?_0x2854ca[_0x2ab2('0x19')]['where']||null:null,'attributes':_0x2854ca[_0x2ab2('0x19')]?_0x2854ca[_0x2ab2('0x19')]['attributes']||null:null,'include':_0x2854ca[_0x2ab2('0x19')]?_0x2854ca[_0x2ab2('0x19')][_0x2ab2('0x1d')]?_[_0x2ab2('0x1e')](_0x2854ca[_0x2ab2('0x19')][_0x2ab2('0x1d')],function(_0x411bc2){return{'model':db[_0x411bc2[_0x2ab2('0x1f')]],'as':_0x411bc2['as'],'attributes':_0x411bc2[_0x2ab2('0x1c')],'include':_0x411bc2[_0x2ab2('0x1d')]?_[_0x2ab2('0x1e')](_0x411bc2[_0x2ab2('0x1d')],function(_0x392cd1){return{'model':db[_0x392cd1[_0x2ab2('0x1f')]],'as':_0x392cd1['as'],'attributes':_0x392cd1[_0x2ab2('0x1c')],'include':_0x392cd1[_0x2ab2('0x1d')]?_[_0x2ab2('0x1e')](_0x392cd1[_0x2ab2('0x1d')],function(_0x1b10ce){return{'model':db[_0x1b10ce[_0x2ab2('0x1f')]],'as':_0x1b10ce['as'],'attributes':_0x1b10ce[_0x2ab2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2ab2('0xc')](function(_0x59f8aa){logger[_0x2ab2('0x20')](_0x2ab2('0x21'),_0x2854ca);logger['debug'](_0x2ab2('0x21'),_0x2854ca,JSON['stringify'](_0x59f8aa));_0xb86ab0(_0x59f8aa);})['catch'](function(_0x1bd690){logger[_0x2ab2('0x12')](_0x2ab2('0x21'),_0x1bd690[_0x2ab2('0x14')],_0x2854ca);_0x14a899(_0x257dbf[_0x2ab2('0x12')](0x1f4,_0x1bd690[_0x2ab2('0x14')]));});});};
\ No newline at end of file
+var _0x1607=['catch','ShowTrigger','Trigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','info','GetTrigger','findAll','options','raw','where','attributes','include','map','model'];(function(_0x5b2cf2,_0x367edc){var _0x4c2c0d=function(_0x355c2f){while(--_0x355c2f){_0x5b2cf2['push'](_0x5b2cf2['shift']());}};_0x4c2c0d(++_0x367edc);}(_0x1607,0x11c));var _0x7160=function(_0x15756f,_0x12828a){_0x15756f=_0x15756f-0x0;var _0x3595d1=_0x1607[_0x15756f];return _0x3595d1;};'use strict';var _=require(_0x7160('0x0'));var util=require(_0x7160('0x1'));var moment=require(_0x7160('0x2'));var BPromise=require(_0x7160('0x3'));var rs=require(_0x7160('0x4'));var fs=require('fs');var Redis=require(_0x7160('0x5'));var db=require(_0x7160('0x6'))['db'];var utils=require(_0x7160('0x7'));var logger=require(_0x7160('0x8'))(_0x7160('0x9'));var config=require(_0x7160('0xa'));var jayson=require(_0x7160('0xb'));var client=jayson[_0x7160('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x179baf,_0x82198e,_0x39b798){return new BPromise(function(_0x33726b,_0x12c111){return client['request'](_0x179baf,_0x39b798)[_0x7160('0xd')](function(_0x4e91f2){logger['info']('Trigger,\x20%s,\x20%s',_0x82198e,'request\x20sent');logger[_0x7160('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x82198e,_0x7160('0xf'),JSON[_0x7160('0x10')](_0x4e91f2));if(_0x4e91f2[_0x7160('0x11')]){if(_0x4e91f2['error'][_0x7160('0x12')]===0x1f4){logger[_0x7160('0x11')](_0x7160('0x13'),_0x82198e,_0x4e91f2[_0x7160('0x11')][_0x7160('0x14')]);return _0x12c111(_0x4e91f2['error'][_0x7160('0x14')]);}logger[_0x7160('0x11')](_0x7160('0x13'),_0x82198e,_0x4e91f2[_0x7160('0x11')]['message']);return _0x33726b(_0x4e91f2['error'][_0x7160('0x14')]);}else{logger[_0x7160('0x15')](_0x7160('0x13'),_0x82198e,_0x7160('0xf'));_0x33726b(_0x4e91f2['result'][_0x7160('0x14')]);}})['catch'](function(_0x2b2a41){logger['error'](_0x7160('0x13'),_0x82198e,_0x2b2a41);_0x12c111(_0x2b2a41);});});}exports[_0x7160('0x16')]=function(_0x3ea3fd){var _0x46f4b4=this;return new Promise(function(_0x5c95c2,_0x4368e3){return db['Trigger'][_0x7160('0x17')]({'raw':_0x3ea3fd[_0x7160('0x18')]?_0x3ea3fd[_0x7160('0x18')][_0x7160('0x19')]===undefined?!![]:![]:!![],'where':_0x3ea3fd['options']?_0x3ea3fd[_0x7160('0x18')][_0x7160('0x1a')]||null:null,'attributes':_0x3ea3fd['options']?_0x3ea3fd[_0x7160('0x18')][_0x7160('0x1b')]||null:null,'limit':_0x3ea3fd[_0x7160('0x18')]?_0x3ea3fd[_0x7160('0x18')]['limit']||null:null,'include':_0x3ea3fd[_0x7160('0x18')]?_0x3ea3fd['options'][_0x7160('0x1c')]?_[_0x7160('0x1d')](_0x3ea3fd[_0x7160('0x18')]['include'],function(_0x588202){return{'model':db[_0x588202[_0x7160('0x1e')]],'as':_0x588202['as'],'attributes':_0x588202['attributes'],'include':_0x588202['include']?_[_0x7160('0x1d')](_0x588202['include'],function(_0x27a5a9){return{'model':db[_0x27a5a9[_0x7160('0x1e')]],'as':_0x27a5a9['as'],'attributes':_0x27a5a9[_0x7160('0x1b')],'include':_0x27a5a9[_0x7160('0x1c')]?_['map'](_0x27a5a9[_0x7160('0x1c')],function(_0x75bce6){return{'model':db[_0x75bce6[_0x7160('0x1e')]],'as':_0x75bce6['as'],'attributes':_0x75bce6[_0x7160('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7160('0xd')](function(_0x4a48bd){logger['info']('GetTrigger',_0x3ea3fd);logger[_0x7160('0xe')](_0x7160('0x16'),_0x3ea3fd,JSON['stringify'](_0x4a48bd));_0x5c95c2(_0x4a48bd);})[_0x7160('0x1f')](function(_0x2afb3f){logger[_0x7160('0x11')](_0x7160('0x16'),_0x2afb3f['message'],_0x3ea3fd);_0x4368e3(_0x46f4b4['error'](0x1f4,_0x2afb3f['message']));});});};exports[_0x7160('0x20')]=function(_0x23c8ac){var _0x186a90=this;return new Promise(function(_0x324375,_0x3d9dd9){return db[_0x7160('0x21')][_0x7160('0x22')]({'raw':_0x23c8ac['options']?_0x23c8ac[_0x7160('0x18')][_0x7160('0x19')]===undefined?!![]:![]:!![],'where':_0x23c8ac[_0x7160('0x18')]?_0x23c8ac[_0x7160('0x18')][_0x7160('0x1a')]||null:null,'attributes':_0x23c8ac[_0x7160('0x18')]?_0x23c8ac[_0x7160('0x18')][_0x7160('0x1b')]||null:null,'include':_0x23c8ac[_0x7160('0x18')]?_0x23c8ac[_0x7160('0x18')]['include']?_[_0x7160('0x1d')](_0x23c8ac['options'][_0x7160('0x1c')],function(_0x1850fe){return{'model':db[_0x1850fe[_0x7160('0x1e')]],'as':_0x1850fe['as'],'attributes':_0x1850fe[_0x7160('0x1b')],'include':_0x1850fe[_0x7160('0x1c')]?_['map'](_0x1850fe[_0x7160('0x1c')],function(_0x419eaf){return{'model':db[_0x419eaf['model']],'as':_0x419eaf['as'],'attributes':_0x419eaf[_0x7160('0x1b')],'include':_0x419eaf['include']?_[_0x7160('0x1d')](_0x419eaf[_0x7160('0x1c')],function(_0x2d871a){return{'model':db[_0x2d871a[_0x7160('0x1e')]],'as':_0x2d871a['as'],'attributes':_0x2d871a[_0x7160('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7160('0xd')](function(_0x39df18){logger[_0x7160('0x15')](_0x7160('0x20'),_0x23c8ac);logger[_0x7160('0xe')](_0x7160('0x20'),_0x23c8ac,JSON[_0x7160('0x10')](_0x39df18));_0x324375(_0x39df18);})[_0x7160('0x1f')](function(_0x4f6817){logger[_0x7160('0x11')](_0x7160('0x20'),_0x4f6817[_0x7160('0x14')],_0x23c8ac);_0x3d9dd9(_0x186a90[_0x7160('0x11')](0x1f4,_0x4f6817['message']));});});};
\ No newline at end of file
index 45e0e78..dc2586b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76b5=['/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index'];(function(_0x2c6ff0,_0x2b1d1d){var _0x1d5d47=function(_0x1a153c){while(--_0x1a153c){_0x2c6ff0['push'](_0x2c6ff0['shift']());}};_0x1d5d47(++_0x2b1d1d);}(_0x76b5,0x1a8));var _0x576b=function(_0x5b3a35,_0x312e9b){_0x5b3a35=_0x5b3a35-0x0;var _0x4383df=_0x76b5[_0x5b3a35];return _0x4383df;};'use strict';var multer=require(_0x576b('0x0'));var util=require(_0x576b('0x1'));var path=require(_0x576b('0x2'));var timeout=require(_0x576b('0x3'));var express=require(_0x576b('0x4'));var router=express[_0x576b('0x5')]();var fs_extra=require(_0x576b('0x6'));var auth=require(_0x576b('0x7'));var interaction=require(_0x576b('0x8'));var config=require('../../config/environment');var controller=require(_0x576b('0x9'));router[_0x576b('0xa')]('/',auth[_0x576b('0xb')](),controller[_0x576b('0xc')]);router[_0x576b('0xa')](_0x576b('0xd'),auth['isAuthenticated'](),controller[_0x576b('0xe')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller['clone']);router['post']('/',auth[_0x576b('0xb')](),controller['create']);router['put']('/:id',auth[_0x576b('0xb')](),controller[_0x576b('0xf')]);router[_0x576b('0x10')](_0x576b('0xd'),auth[_0x576b('0xb')](),controller[_0x576b('0x11')]);module[_0x576b('0x12')]=router;
\ No newline at end of file
+var _0xfddd=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','/:id/clone','clone','post','create','put','update','destroy','exports','multer','util','path','express'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xfddd,0x1df));var _0xdfdd=function(_0x532294,_0x44c263){_0x532294=_0x532294-0x0;var _0x188e7a=_0xfddd[_0x532294];return _0x188e7a;};'use strict';var multer=require(_0xdfdd('0x0'));var util=require(_0xdfdd('0x1'));var path=require(_0xdfdd('0x2'));var timeout=require('connect-timeout');var express=require(_0xdfdd('0x3'));var router=express[_0xdfdd('0x4')]();var fs_extra=require(_0xdfdd('0x5'));var auth=require(_0xdfdd('0x6'));var interaction=require(_0xdfdd('0x7'));var config=require(_0xdfdd('0x8'));var controller=require(_0xdfdd('0x9'));router[_0xdfdd('0xa')]('/',auth[_0xdfdd('0xb')](),controller[_0xdfdd('0xc')]);router[_0xdfdd('0xa')](_0xdfdd('0xd'),auth['isAuthenticated'](),controller[_0xdfdd('0xe')]);router['post'](_0xdfdd('0xf'),auth[_0xdfdd('0xb')](),controller[_0xdfdd('0x10')]);router[_0xdfdd('0x11')]('/',auth[_0xdfdd('0xb')](),controller[_0xdfdd('0x12')]);router[_0xdfdd('0x13')]('/:id',auth[_0xdfdd('0xb')](),controller[_0xdfdd('0x14')]);router['delete'](_0xdfdd('0xd'),auth['isAuthenticated'](),controller[_0xdfdd('0x15')]);module[_0xdfdd('0x16')]=router;
\ No newline at end of file
index f39661d..9d3d2bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d64=['rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','accept','refuse','originate','uas','pai','certificate','active','passive','actpass','dynamic','BOOLEAN','sequelize','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','split','info','shortinfo','auto'];(function(_0x2cd1d4,_0x4b2755){var _0x1a480e=function(_0x53cb7e){while(--_0x53cb7e){_0x2cd1d4['push'](_0x2cd1d4['shift']());}};_0x1a480e(++_0x4b2755);}(_0x4d64,0x10b));var _0x44d6=function(_0x35fcc3,_0x4bfe42){_0x35fcc3=_0x35fcc3-0x0;var _0x4d9a31=_0x4d64[_0x35fcc3];return _0x4d9a31;};'use strict';var Sequelize=require(_0x44d6('0x0'));module['exports']={'name':{'type':Sequelize[_0x44d6('0x1')],'allowNull':![],'unique':_0x44d6('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x4'),'user',_0x44d6('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x44d6('0x1')],'allowNull':![],'defaultValue':_0x44d6('0x6')},'callingpres':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x7'),_0x44d6('0x8'),'ALLOWED_FAILED_SCREEN',_0x44d6('0x9'),_0x44d6('0xa'),'PROHIB_PASSED_SCREEN',_0x44d6('0xb'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x44d6('0x1')]},'remotesecret':{'type':Sequelize[_0x44d6('0x1')]},'transport':{'type':Sequelize[_0x44d6('0x1')],'defaultValue':_0x44d6('0xc'),'set':function(_0x3fd0df){this[_0x44d6('0xd')](_0x44d6('0xe'),_0x3fd0df?_0x3fd0df[_0x44d6('0xf')](','):null);},'get':function(){return this[_0x44d6('0x10')]('transport')?this[_0x44d6('0x10')](_0x44d6('0xe'))[_0x44d6('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x44d6('0x3')]('rfc2833',_0x44d6('0x12'),_0x44d6('0x13'),'inband',_0x44d6('0x14')),'defaultValue':_0x44d6('0x15')},'directmedia':{'type':Sequelize['ENUM'](_0x44d6('0x16'),'no',_0x44d6('0x17'),_0x44d6('0x18'),_0x44d6('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x44d6('0x1')]},'directmediadeny':{'type':Sequelize[_0x44d6('0x1')]},'nat':{'type':Sequelize[_0x44d6('0x1')],'defaultValue':_0x44d6('0x1a'),'set':function(_0x18a078){this['setDataValue']('nat',_0x18a078?_0x18a078[_0x44d6('0xf')](','):null);},'get':function(){return this[_0x44d6('0x10')](_0x44d6('0x1b'))?this[_0x44d6('0x10')]('nat')[_0x44d6('0x11')](','):null;},'comment':_0x44d6('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x44d6('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x44d6('0x1')]},'language':{'type':Sequelize[_0x44d6('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x44d6('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x44d6('0x1')],'defaultValue':_0x44d6('0x1d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1c6a9a){this[_0x44d6('0xd')](_0x44d6('0x1e'),_0x1c6a9a?_0x1c6a9a[_0x44d6('0xf')](';'):_0x44d6('0x1f'));},'get':function(){return this[_0x44d6('0x10')]('allow')?this['getDataValue'](_0x44d6('0x1e'))[_0x44d6('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x44d6('0x16'),'no')},'insecure':{'type':Sequelize[_0x44d6('0x1')],'defaultValue':_0x44d6('0x20'),'set':function(_0x3431fd){this['setDataValue'](_0x44d6('0x21'),_0x3431fd?_0x3431fd['join'](','):null);},'get':function(){return this[_0x44d6('0x10')](_0x44d6('0x21'))?this[_0x44d6('0x10')](_0x44d6('0x21'))[_0x44d6('0x11')](','):null;},'comment':_0x44d6('0x22')},'trustrpid':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x44d6('0x23'))},'promiscredir':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'accountcode':{'type':Sequelize[_0x44d6('0x24')](0xb)},'setvar':{'type':Sequelize[_0x44d6('0x1')]},'callerid':{'type':Sequelize[_0x44d6('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x44d6('0x3')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x44d6('0x16'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x44d6('0x1')]},'videosupport':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x44d6('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'mailbox':{'type':Sequelize[_0x44d6('0x1')]},'session_timers':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x25'),_0x44d6('0x26'),_0x44d6('0x27'))},'session_expires':{'type':Sequelize[_0x44d6('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x44d6('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x44d6('0x28')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x44d6('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x44d6('0x24')](0x5)},'qualify':{'type':Sequelize[_0x44d6('0x3')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x44d6('0x24')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x44d6('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x44d6('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x44d6('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no',_0x44d6('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x44d6('0x1')]},'callbackextension':{'type':Sequelize[_0x44d6('0x1')]},'timert1':{'type':Sequelize[_0x44d6('0x24')](0xb)},'timerb':{'type':Sequelize[_0x44d6('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x44d6('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x44d6('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x44d6('0x1')]},'use_q850_reason':{'type':Sequelize[_0x44d6('0x1')]},'maxforwards':{'type':Sequelize[_0x44d6('0x24')](0xb)},'encryption':{'type':Sequelize[_0x44d6('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'icesupport':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x44d6('0x2a'))},'dtlsrekey':{'type':Sequelize[_0x44d6('0x24')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x44d6('0x1')]},'dtlscipher':{'type':Sequelize[_0x44d6('0x1')]},'dtlscafile':{'type':Sequelize[_0x44d6('0x1')]},'dtlscapath':{'type':Sequelize[_0x44d6('0x1')]},'dtlssetup':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x2b'),_0x44d6('0x2c'),_0x44d6('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x44d6('0x1')]},'usereqphone':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x44d6('0x1')]},'recordofffeature':{'type':Sequelize[_0x44d6('0x1')]},'call_limit':{'type':Sequelize[_0x44d6('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x44d6('0x1')]},'mohinterpret':{'type':Sequelize[_0x44d6('0x1')]},'mohsuggest':{'type':Sequelize[_0x44d6('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x44d6('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x44d6('0x2e')},'canreinvite':{'type':Sequelize[_0x44d6('0x3')]('yes','no',_0x44d6('0x17'),_0x44d6('0x18'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x44d6('0x1')]},'otherFields':{'type':Sequelize[_0x44d6('0x1')]},'active':{'type':Sequelize[_0x44d6('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x44d6('0x1')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xc841=['ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','getDataValue','transport','split','info','shortinfo','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','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]','insecure','never','INTEGER','\x22\x22\x20<>','accept','originate','uas','pai','fingerprint','passive','actpass','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','friend','from-voip-provider','ALLOWED_PASSED_SCREEN'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0xc841,0x147));var _0x1c84=function(_0x428d78,_0x34e0ec){_0x428d78=_0x428d78-0x0;var _0x20fd43=_0xc841[_0x428d78];return _0x20fd43;};'use strict';var Sequelize=require(_0x1c84('0x0'));module[_0x1c84('0x1')]={'name':{'type':Sequelize[_0x1c84('0x2')],'allowNull':![],'unique':_0x1c84('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1c84('0x4')]('friend',_0x1c84('0x5'),'peer'),'allowNull':![],'defaultValue':_0x1c84('0x6')},'context':{'type':Sequelize[_0x1c84('0x2')],'allowNull':![],'defaultValue':_0x1c84('0x7')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x1c84('0x8'),'ALLOWED_FAILED_SCREEN',_0x1c84('0x9'),_0x1c84('0xa'),_0x1c84('0xb'),_0x1c84('0xc'),_0x1c84('0xd'))},'deny':{'type':Sequelize[_0x1c84('0x2')]},'permit':{'type':Sequelize[_0x1c84('0x2')]},'secret':{'type':Sequelize[_0x1c84('0x2')]},'md5secret':{'type':Sequelize[_0x1c84('0x2')]},'remotesecret':{'type':Sequelize[_0x1c84('0x2')]},'transport':{'type':Sequelize[_0x1c84('0x2')],'defaultValue':_0x1c84('0xe'),'set':function(_0x313b7b){this['setDataValue']('transport',_0x313b7b?_0x313b7b[_0x1c84('0xf')](','):null);},'get':function(){return this[_0x1c84('0x10')]('transport')?this['getDataValue'](_0x1c84('0x11'))[_0x1c84('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x1c84('0x13'),_0x1c84('0x14'),'inband',_0x1c84('0x15')),'defaultValue':_0x1c84('0x16')},'directmedia':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no',_0x1c84('0x18'),_0x1c84('0x19'),_0x1c84('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x1c84('0x2')],'defaultValue':_0x1c84('0x1b'),'set':function(_0x23b67c){this[_0x1c84('0x1c')](_0x1c84('0x1d'),_0x23b67c?_0x23b67c[_0x1c84('0xf')](','):null);},'get':function(){return this[_0x1c84('0x10')]('nat')?this['getDataValue'](_0x1c84('0x1d'))['split'](','):null;},'comment':_0x1c84('0x1e')},'callgroup':{'type':Sequelize[_0x1c84('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x1c84('0x2')]},'language':{'type':Sequelize[_0x1c84('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1c84('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x1c84('0x2')],'defaultValue':_0x1c84('0x1f')},'allow':{'type':Sequelize[_0x1c84('0x2')],'allowNull':![],'defaultValue':_0x1c84('0x20'),'set':function(_0x3fac0f){this[_0x1c84('0x1c')](_0x1c84('0x21'),_0x3fac0f?_0x3fac0f['join'](';'):_0x1c84('0x20'));},'get':function(){return this['getDataValue'](_0x1c84('0x21'))?this['getDataValue'](_0x1c84('0x21'))[_0x1c84('0x12')](';'):null;},'comment':_0x1c84('0x22')},'autoframing':{'type':Sequelize['ENUM'](_0x1c84('0x17'),'no')},'insecure':{'type':Sequelize[_0x1c84('0x2')],'defaultValue':'port,invite','set':function(_0x503e02){this['setDataValue'](_0x1c84('0x23'),_0x503e02?_0x503e02['join'](','):null);},'get':function(){return this[_0x1c84('0x10')](_0x1c84('0x23'))?this[_0x1c84('0x10')](_0x1c84('0x23'))[_0x1c84('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x1c84('0x17'),'no',_0x1c84('0x24'))},'promiscredir':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x1c84('0x17'),'no')},'accountcode':{'type':Sequelize[_0x1c84('0x25')](0xb)},'setvar':{'type':Sequelize[_0x1c84('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x1c84('0x26')},'amaflags':{'type':Sequelize[_0x1c84('0x2')]},'callcounter':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no'),'defaultValue':_0x1c84('0x17')},'busylevel':{'type':Sequelize[_0x1c84('0x25')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x1c84('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x1c84('0x2')]},'template':{'type':Sequelize[_0x1c84('0x2')]},'videosupport':{'type':Sequelize[_0x1c84('0x4')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1c84('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x27'),'refuse',_0x1c84('0x28'))},'session_expires':{'type':Sequelize[_0x1c84('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x1c84('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x1c84('0x4')]('uac',_0x1c84('0x29')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x1c84('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x1c84('0x2')]},'port':{'type':Sequelize[_0x1c84('0x25')](0x5)},'qualify':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x1c84('0x2')]},'defaultuser':{'type':Sequelize[_0x1c84('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x1c84('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x1c84('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no',_0x1c84('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1c84('0x2')]},'callbackextension':{'type':Sequelize[_0x1c84('0x2')]},'timert1':{'type':Sequelize[_0x1c84('0x25')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x1c84('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x1c84('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x1c84('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x1c84('0x25')](0xb)},'encryption':{'type':Sequelize[_0x1c84('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1c84('0x4')]('yes','no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x1c84('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1c84('0x2b'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x1c84('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x1c84('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x1c84('0x2')]},'dtlscafile':{'type':Sequelize[_0x1c84('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x1c84('0x4')]('active',_0x1c84('0x2c'),_0x1c84('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1c84('0x2')]},'usereqphone':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1c84('0x2')]},'recordofffeature':{'type':Sequelize[_0x1c84('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x1c84('0x4')](_0x1c84('0x17'),'no')},'vmexten':{'type':Sequelize[_0x1c84('0x2')]},'mohinterpret':{'type':Sequelize[_0x1c84('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x1c84('0x2')]},'description':{'type':Sequelize[_0x1c84('0x2')]},'host':{'type':Sequelize[_0x1c84('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x1c84('0x4')]('yes','no','nonat',_0x1c84('0x19'),_0x1c84('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x1c84('0x2')]},'active':{'type':Sequelize[_0x1c84('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x1c84('0x2')],'defaultValue':'no'}};
\ No newline at end of file
index b7ab371..7c3a36e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81bd=['/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','update','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','UserProfileResource','name','index','Trunk','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','clone','find','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/registry.ejs','utf8','writeFileSync'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x81bd,0x7c));var _0xd81b=function(_0x34967e,_0x11f483){_0x34967e=_0x34967e-0x0;var _0x406971=_0x81bd[_0x34967e];return _0x406971;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd81b('0x1b'));var client=jayson['client'][_0xd81b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xe75568,_0x5f0b6b,_0x35a053,_0x47dd04){return new BPromise(function(_0x13dd00,_0x41bf7a){var _0x6c6041=_0x47dd04||client;return _0x6c6041[_0xd81b('0x1d')](_0xe75568,_0x35a053)[_0xd81b('0x1e')](function(_0x552215){logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');logger[_0xd81b('0x21')](_0xd81b('0x22'),_0x5f0b6b,_0xd81b('0x23'),JSON[_0xd81b('0x24')](_0x552215));if(_0x552215[_0xd81b('0x25')]){if(_0x552215[_0xd81b('0x25')][_0xd81b('0x26')]===0x1f4){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);return _0x41bf7a(_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);}logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')]['message']);return _0x13dd00(_0x552215['error'][_0xd81b('0x27')]);}else{logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');_0x13dd00(_0x552215[_0xd81b('0x28')][_0xd81b('0x27')]);}})['catch'](function(_0xcd6474){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0xcd6474);_0x41bf7a(_0xcd6474);});});}function respondWithStatusCode(_0x1ad65c,_0x279176){_0x279176=_0x279176||0xcc;return function(_0xcb4f91){if(_0xcb4f91){return _0x1ad65c[_0xd81b('0x29')](_0x279176);}return _0x1ad65c[_0xd81b('0x2a')](_0x279176)[_0xd81b('0x2b')]();};}function respondWithResult(_0x212c4e,_0x2ccedf){_0x2ccedf=_0x2ccedf||0xc8;return function(_0x1bf351){if(_0x1bf351){return _0x212c4e['status'](_0x2ccedf)[_0xd81b('0x2c')](_0x1bf351);}};}function respondWithFilteredResult(_0x99dbc9,_0xe3637a){return function(_0x31b9fd){if(_0x31b9fd){var _0x3266c2=typeof _0xe3637a[_0xd81b('0x2d')]===_0xd81b('0x2e')&&typeof _0xe3637a[_0xd81b('0x2f')]===_0xd81b('0x2e');var _0x483a3d=_0x31b9fd[_0xd81b('0x30')];var _0x4e2eff=_0x3266c2?0x0:_0xe3637a['offset'];var _0xb9ff9f=_0x3266c2?_0x31b9fd[_0xd81b('0x30')]:_0xe3637a['offset']+_0xe3637a['limit'];var _0x4093c8;if(_0xb9ff9f>=_0x483a3d){_0xb9ff9f=_0x483a3d;_0x4093c8=0xc8;}else{_0x4093c8=0xce;}_0x99dbc9[_0xd81b('0x2a')](_0x4093c8);return _0x99dbc9[_0xd81b('0x31')](_0xd81b('0x32'),_0x4e2eff+'-'+_0xb9ff9f+'/'+_0x483a3d)[_0xd81b('0x2c')](_0x31b9fd);}return null;};}function patchUpdates(_0x4654ba){return function(_0x5527ed){try{jsonpatch[_0xd81b('0x33')](_0x5527ed,_0x4654ba,!![]);}catch(_0x26f629){return BPromise['reject'](_0x26f629);}return _0x5527ed['save']();};}function saveUpdates(_0x165892,_0x1966b1){return function(_0x50472a){if(_0x50472a){return _0x50472a['update'](_0x165892)['then'](function(_0x322991){return _0x322991;});}return null;};}function removeEntity(_0x3ead68,_0x1d2f46){return function(_0x1c4cf7){if(_0x1c4cf7){return _0x1c4cf7[_0xd81b('0x34')]()[_0xd81b('0x1e')](function(){var _0x29aabf=_0x1c4cf7['get']({'plain':!![]});var _0x28782f='Trunks';return db[_0xd81b('0x35')][_0xd81b('0x34')]({'where':{'type':_0x28782f,'resourceId':_0x29aabf['id']}})[_0xd81b('0x1e')](function(){return _0x1c4cf7;});})[_0xd81b('0x1e')](function(){_0x3ead68[_0xd81b('0x2a')](0xcc)[_0xd81b('0x2b')]();});}};}function handleEntityNotFound(_0x1c20d3,_0x2d23b9){return function(_0xf9d1a5){if(!_0xf9d1a5){_0x1c20d3[_0xd81b('0x29')](0x194);}return _0xf9d1a5;};}function handleError(_0x1be4e2,_0x3c8371){_0x3c8371=_0x3c8371||0x1f4;return function(_0x346038){logger['error'](_0x346038['stack']);if(_0x346038[_0xd81b('0x36')]){delete _0x346038[_0xd81b('0x36')];}_0x1be4e2[_0xd81b('0x2a')](_0x3c8371)['send'](_0x346038);};}exports[_0xd81b('0x37')]=function(_0x37ba34,_0x5a236a){var _0x46f058={},_0xaa9e97={},_0x512e39={'count':0x0,'rows':[]};var _0xed5272=_['map'](db[_0xd81b('0x38')][_0xd81b('0x39')],function(_0x203365){return{'name':_0x203365[_0xd81b('0x3a')],'type':_0x203365['type'][_0xd81b('0x3b')]};});_0xaa9e97[_0xd81b('0x3c')]=_[_0xd81b('0x3d')](_0xed5272,_0xd81b('0x36'));_0xaa9e97[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x37ba34[_0xd81b('0x3e')]);_0xaa9e97['filters']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],_0xaa9e97[_0xd81b('0x3e')]);_0x46f058['attributes']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],qs[_0xd81b('0x41')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x46f058['attributes']=_0x46f058[_0xd81b('0x42')][_0xd81b('0x43')]?_0x46f058[_0xd81b('0x42')]:_0xaa9e97[_0xd81b('0x3c')];if(!_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x44')](_0xd81b('0x45'))){_0x46f058[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2f')]);_0x46f058['offset']=qs[_0xd81b('0x2d')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2d')]);}_0x46f058[_0xd81b('0x46')]=qs[_0xd81b('0x47')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x47')]);_0x46f058[_0xd81b('0x48')]=qs['filters'](_['pick'](_0x37ba34[_0xd81b('0x3e')],_0xaa9e97[_0xd81b('0x49')]),_0xed5272);if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]){_0x46f058[_0xd81b('0x48')]=_[_0xd81b('0x4b')](_0x46f058[_0xd81b('0x48')],{'$or':_[_0xd81b('0x3d')](_0xed5272,function(_0x2fa588){if(_0x2fa588[_0xd81b('0x4c')]!==_0xd81b('0x4d')){var _0x38e436={};_0x38e436[_0x2fa588['name']]={'$like':'%'+_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]+'%'};return _0x38e436;}})});}_0x46f058=_[_0xd81b('0x4b')]({},_0x46f058,_0x37ba34[_0xd81b('0x4e')]);var _0x105a48={'where':_0x46f058[_0xd81b('0x48')]};return db[_0xd81b('0x38')][_0xd81b('0x30')](_0x105a48)[_0xd81b('0x1e')](function(_0x53ea36){_0x512e39[_0xd81b('0x30')]=_0x53ea36;if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x46f058[_0xd81b('0x50')]=[{'all':!![]}];}return db['Trunk'][_0xd81b('0x51')](_0x46f058);})[_0xd81b('0x1e')](function(_0x15030b){_0x512e39[_0xd81b('0x52')]=_0x15030b;return _0x512e39;})[_0xd81b('0x1e')](respondWithFilteredResult(_0x5a236a,_0x46f058))[_0xd81b('0x53')](handleError(_0x5a236a,null));};exports[_0xd81b('0x54')]=function(_0x43d7ce,_0x133a76){var _0x49cba6={'raw':![],'where':{'id':_0x43d7ce[_0xd81b('0x55')]['id']}},_0x534d10={};_0x534d10[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db[_0xd81b('0x38')][_0xd81b('0x39')]);_0x534d10[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x43d7ce[_0xd81b('0x3e')]);_0x534d10['filters']=_[_0xd81b('0x40')](_0x534d10[_0xd81b('0x3c')],_0x534d10[_0xd81b('0x3e')]);_0x49cba6[_0xd81b('0x42')]=_[_0xd81b('0x40')](_0x534d10['model'],qs[_0xd81b('0x41')](_0x43d7ce[_0xd81b('0x3e')]['fields']));_0x49cba6[_0xd81b('0x42')]=_0x49cba6[_0xd81b('0x42')][_0xd81b('0x43')]?_0x49cba6[_0xd81b('0x42')]:_0x534d10[_0xd81b('0x3c')];if(_0x43d7ce[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x49cba6[_0xd81b('0x50')]=[{'all':!![]}];}_0x49cba6=_[_0xd81b('0x4b')]({},_0x49cba6,_0x43d7ce[_0xd81b('0x4e')]);return db[_0xd81b('0x38')]['find'](_0x49cba6)[_0xd81b('0x1e')](handleEntityNotFound(_0x133a76,null))['then'](respondWithResult(_0x133a76,null))[_0xd81b('0x53')](handleError(_0x133a76,null));};exports[_0xd81b('0x56')]=function(_0x390db6,_0x3c2a9f){var _0x34d2a2={'where':{'id':_0x390db6['params']['id']}},_0x1e9f73={};_0x1e9f73[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db['Trunk']['rawAttributes']);_0x34d2a2[_0xd81b('0x42')]=_['intersection'](_0x1e9f73[_0xd81b('0x3c')],qs['fields'](_0x390db6[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x34d2a2[_0xd81b('0x42')]=_0x34d2a2['attributes'][_0xd81b('0x43')]?_0x34d2a2[_0xd81b('0x42')]:_0x1e9f73['model'];if(_0x390db6[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x34d2a2['include']=[{'all':!![]}];}_0x34d2a2=_[_0xd81b('0x4b')]({},_0x34d2a2,_0x390db6['options']);return db[_0xd81b('0x38')][_0xd81b('0x57')](_0x34d2a2)[_0xd81b('0x1e')](handleEntityNotFound(_0x3c2a9f,null))[_0xd81b('0x1e')](function(_0x4add79){if(_0x4add79){var _0x32eab4=_0x4add79[_0xd81b('0x58')]({'plain':!![]});_0x32eab4=qs[_0xd81b('0x59')](_0x32eab4,['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);_0x390db6['body']=_[_0xd81b('0x59')](_0x390db6[_0xd81b('0x5c')],['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);return db[_0xd81b('0x38')][_0xd81b('0x5d')](_[_0xd81b('0x4b')](_0x32eab4,_0x390db6['body']),{'include':_0x390db6['query']['includeAll']?[{'all':!![]}]:undefined})[_0xd81b('0x1e')](function(_0x12b0bf){var _0x37507e=_0x390db6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x37507e)throw new Error(_0xd81b('0x5f'));if(_0x37507e[_0xd81b('0x60')]==='user'){var _0x3fcd8c=_0x12b0bf[_0xd81b('0x58')]({'plain':!![]});var _0x35c9cf=_0xd81b('0x61');return db[_0xd81b('0x62')][_0xd81b('0x57')]({'where':{'name':_0x35c9cf,'userProfileId':_0x37507e[_0xd81b('0x63')]},'raw':!![]})['then'](function(_0x14b187){if(_0x14b187&&_0x14b187[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x3fcd8c[_0xd81b('0x36')],'resourceId':_0x3fcd8c['id'],'type':_0x14b187[_0xd81b('0x36')],'sectionId':_0x14b187['id']},{})[_0xd81b('0x1e')](function(){return _0x12b0bf;});}else{return _0x12b0bf;}})[_0xd81b('0x53')](function(_0x8fa8cd){logger[_0xd81b('0x25')](_0xd81b('0x65'),_0x8fa8cd);throw _0x8fa8cd;});}return _0x12b0bf;});}})[_0xd81b('0x1e')](respondWithResult(_0x3c2a9f,0xc9))['catch'](handleError(_0x3c2a9f,null));};exports[_0xd81b('0x5d')]=function(_0x5358a6,_0x2e7141,_0x6fa974){var _0x414f40;return db[_0xd81b('0x38')][_0xd81b('0x5d')](_0x5358a6[_0xd81b('0x5c')],{'raw':!![]})[_0xd81b('0x1e')](function(_0x18f2ac){_0x414f40=_0x18f2ac;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0xfa2a13){var _0x344c32=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),'utf8');var _0x3274d2=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),_0xd81b('0x6a'));var _0xaee7e3=ejs['render'](_0x344c32,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0xaee7e3);if(_0x414f40[_0xd81b('0x6d')]){var _0x1c6ec8=ejs[_0xd81b('0x6e')](_0x3274d2,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x1c6ec8);}})[_0xd81b('0x1e')](function(){return respondWithRpcPromise(_0xd81b('0x70'),'create',{'module':_0xd81b('0x71')});})[_0xd81b('0x1e')](function(){var _0x3858eb=_0x5358a6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x3858eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3858eb[_0xd81b('0x60')]===_0xd81b('0x5e')){var _0x4cc440=_0x414f40[_0xd81b('0x58')]({'plain':!![]});return db[_0xd81b('0x62')]['find']({'where':{'name':_0xd81b('0x61'),'userProfileId':_0x3858eb[_0xd81b('0x63')]},'raw':!![]})[_0xd81b('0x1e')](function(_0x483026){if(_0x483026&&_0x483026[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x4cc440['name'],'resourceId':_0x4cc440['id'],'type':_0x483026['name'],'sectionId':_0x483026['id']},{})[_0xd81b('0x1e')](function(){return _0x414f40;});}else{return _0x414f40;}})[_0xd81b('0x53')](function(_0x36c694){logger['error'](_0xd81b('0x65'),_0x36c694);throw _0x36c694;});}return _0x414f40;})[_0xd81b('0x1e')](respondWithResult(_0x2e7141,0xc9))[_0xd81b('0x53')](handleError(_0x2e7141,null));};exports[_0xd81b('0x72')]=function(_0x524196,_0x4f69a7,_0x42ae01){var _0x256696;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x524196['params']['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x4f69a7,null))[_0xd81b('0x1e')](saveUpdates(_0x524196['body'],null))[_0xd81b('0x1e')](function(_0x4e5bf4){if(_0x4e5bf4){_0x256696=_0x4e5bf4;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});}})['then'](function(_0x1be0e6){if(_0x1be0e6){var _0x9a9634=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),_0xd81b('0x6a'));var _0xc0e137=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),'utf8');var _0x5c8ea0=ejs[_0xd81b('0x6e')](_0x9a9634,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0x5c8ea0);var _0x15aed5=ejs['render'](_0xc0e137,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x15aed5);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x72'),{'module':_0xd81b('0x71')});}return null;})['then'](function(_0x3744bf){if(_0x3744bf){return _0x256696;}})[_0xd81b('0x1e')](respondWithResult(_0x4f69a7,null))[_0xd81b('0x53')](handleError(_0x4f69a7,null));};exports[_0xd81b('0x34')]=function(_0x1d596c,_0x288124,_0x402eb9){var _0x57179a;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x1d596c[_0xd81b('0x55')]['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x288124,null))[_0xd81b('0x1e')](removeEntity(_0x288124,null))[_0xd81b('0x1e')](function(){return db['Trunk'][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0x11e590){var _0x9e6e05=fs[_0xd81b('0x66')](path['join'](config[_0xd81b('0x68')],_0xd81b('0x73')),_0xd81b('0x6a'));var _0x5060dc=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config['root'],_0xd81b('0x69')),'utf8');var _0x5f5514=ejs[_0xd81b('0x6e')](_0x9e6e05,{'trunks':_0x11e590});var _0x428317=ejs[_0xd81b('0x6e')](_0x5060dc,{'trunks':_0x11e590});fs['writeFileSync'](_0xd81b('0x6c'),_0x5f5514);fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x428317);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x34'),{'module':_0xd81b('0x71')});})['catch'](handleError(_0x288124,null));};
\ No newline at end of file
+var _0x9a19=['query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','show','include','find','clone','params','omit','updatedAt','body','createdAt','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','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','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','autoAssociation','findAll','readFileSync','writeFileSync','Reload','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type'];(function(_0x2cdb1c,_0x2bb39c){var _0x4e5b7a=function(_0xe838b8){while(--_0xe838b8){_0x2cdb1c['push'](_0x2cdb1c['shift']());}};_0x4e5b7a(++_0x2bb39c);}(_0x9a19,0x114));var _0x99a1=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0x9a19[_0x119705];return _0x2affc2;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];var jayson=require(_0x99a1('0x19'));var client=jayson[_0x99a1('0x1a')][_0x99a1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xf713b9,_0x40c19c,_0x3a865c,_0x47815e){return new BPromise(function(_0xe1a1f,_0x3c9ef4){var _0x39ee55=_0x47815e||client;return _0x39ee55['request'](_0xf713b9,_0x3a865c)[_0x99a1('0x1c')](function(_0x3e45d4){logger[_0x99a1('0x1d')](_0x99a1('0x1e'),_0x40c19c,_0x99a1('0x1f'));logger[_0x99a1('0x20')](_0x99a1('0x21'),_0x40c19c,'request\x20sent',JSON['stringify'](_0x3e45d4));if(_0x3e45d4[_0x99a1('0x22')]){if(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x23')]===0x1f4){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);return _0x3c9ef4(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);}logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4['error'][_0x99a1('0x24')]);return _0xe1a1f(_0x3e45d4[_0x99a1('0x22')]['message']);}else{logger[_0x99a1('0x1d')]('Trunk,\x20%s,\x20%s',_0x40c19c,_0x99a1('0x1f'));_0xe1a1f(_0x3e45d4[_0x99a1('0x25')][_0x99a1('0x24')]);}})[_0x99a1('0x26')](function(_0x5a88c6){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x5a88c6);_0x3c9ef4(_0x5a88c6);});});}function respondWithStatusCode(_0x483c17,_0x44df2d){_0x44df2d=_0x44df2d||0xcc;return function(_0x5b5dfa){if(_0x5b5dfa){return _0x483c17[_0x99a1('0x27')](_0x44df2d);}return _0x483c17[_0x99a1('0x28')](_0x44df2d)[_0x99a1('0x29')]();};}function respondWithResult(_0xdaa27d,_0x3c813){_0x3c813=_0x3c813||0xc8;return function(_0x491341){if(_0x491341){return _0xdaa27d['status'](_0x3c813)[_0x99a1('0x2a')](_0x491341);}};}function respondWithFilteredResult(_0x5dabd9,_0x5dc733){return function(_0xafea84){if(_0xafea84){var _0x440879=typeof _0x5dc733[_0x99a1('0x2b')]===_0x99a1('0x2c')&&typeof _0x5dc733[_0x99a1('0x2d')]===_0x99a1('0x2c');var _0x183037=_0xafea84['count'];var _0xf41b0d=_0x440879?0x0:_0x5dc733['offset'];var _0x255197=_0x440879?_0xafea84[_0x99a1('0x2e')]:_0x5dc733[_0x99a1('0x2b')]+_0x5dc733['limit'];var _0x371edf;if(_0x255197>=_0x183037){_0x255197=_0x183037;_0x371edf=0xc8;}else{_0x371edf=0xce;}_0x5dabd9[_0x99a1('0x28')](_0x371edf);return _0x5dabd9['set'](_0x99a1('0x2f'),_0xf41b0d+'-'+_0x255197+'/'+_0x183037)[_0x99a1('0x2a')](_0xafea84);}return null;};}function patchUpdates(_0x36aa34){return function(_0x303d1e){try{jsonpatch[_0x99a1('0x30')](_0x303d1e,_0x36aa34,!![]);}catch(_0x969f6e){return BPromise[_0x99a1('0x31')](_0x969f6e);}return _0x303d1e[_0x99a1('0x32')]();};}function saveUpdates(_0x52da8d,_0x4960e4){return function(_0x3fa342){if(_0x3fa342){return _0x3fa342['update'](_0x52da8d)[_0x99a1('0x1c')](function(_0x400581){return _0x400581;});}return null;};}function removeEntity(_0x5b1a79,_0xa5972b){return function(_0x3503d5){if(_0x3503d5){return _0x3503d5[_0x99a1('0x33')]()[_0x99a1('0x1c')](function(){var _0x13f4db=_0x3503d5[_0x99a1('0x34')]({'plain':!![]});var _0x3081cd=_0x99a1('0x35');return db[_0x99a1('0x36')][_0x99a1('0x33')]({'where':{'type':_0x3081cd,'resourceId':_0x13f4db['id']}})[_0x99a1('0x1c')](function(){return _0x3503d5;});})[_0x99a1('0x1c')](function(){_0x5b1a79[_0x99a1('0x28')](0xcc)[_0x99a1('0x29')]();});}};}function handleEntityNotFound(_0x55005e,_0x53fed5){return function(_0x46e3f2){if(!_0x46e3f2){_0x55005e[_0x99a1('0x27')](0x194);}return _0x46e3f2;};}function handleError(_0x416a36,_0x4131e0){_0x4131e0=_0x4131e0||0x1f4;return function(_0x2690bd){logger[_0x99a1('0x22')](_0x2690bd[_0x99a1('0x37')]);if(_0x2690bd['name']){delete _0x2690bd[_0x99a1('0x38')];}_0x416a36[_0x99a1('0x28')](_0x4131e0)['send'](_0x2690bd);};}exports[_0x99a1('0x39')]=function(_0x2d328c,_0x391afa){var _0x3cd1a0={},_0x430cbc={},_0x399fd4={'count':0x0,'rows':[]};var _0x30e8a9=_[_0x99a1('0x3a')](db[_0x99a1('0x3b')][_0x99a1('0x3c')],function(_0x1da3e7){return{'name':_0x1da3e7[_0x99a1('0x3d')],'type':_0x1da3e7[_0x99a1('0x3e')]['key']};});_0x430cbc['model']=_['map'](_0x30e8a9,_0x99a1('0x38'));_0x430cbc[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x2d328c[_0x99a1('0x3f')]);_0x430cbc[_0x99a1('0x41')]=_['intersection'](_0x430cbc[_0x99a1('0x42')],_0x430cbc[_0x99a1('0x3f')]);_0x3cd1a0[_0x99a1('0x43')]=_['intersection'](_0x430cbc['model'],qs[_0x99a1('0x44')](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x3cd1a0['attributes']=_0x3cd1a0[_0x99a1('0x43')][_0x99a1('0x45')]?_0x3cd1a0[_0x99a1('0x43')]:_0x430cbc[_0x99a1('0x42')];if(!_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x46')](_0x99a1('0x47'))){_0x3cd1a0[_0x99a1('0x2d')]=qs[_0x99a1('0x2d')](_0x2d328c[_0x99a1('0x3f')]['limit']);_0x3cd1a0[_0x99a1('0x2b')]=qs[_0x99a1('0x2b')](_0x2d328c[_0x99a1('0x3f')]['offset']);}_0x3cd1a0[_0x99a1('0x48')]=qs['sort'](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x49')]);_0x3cd1a0[_0x99a1('0x4a')]=qs[_0x99a1('0x41')](_[_0x99a1('0x4b')](_0x2d328c[_0x99a1('0x3f')],_0x430cbc['filters']),_0x30e8a9);if(_0x2d328c[_0x99a1('0x3f')]['filter']){_0x3cd1a0[_0x99a1('0x4a')]=_[_0x99a1('0x4c')](_0x3cd1a0[_0x99a1('0x4a')],{'$or':_[_0x99a1('0x3a')](_0x30e8a9,function(_0x3a0b44){if(_0x3a0b44[_0x99a1('0x3e')]!==_0x99a1('0x4d')){var _0x3861b6={};_0x3861b6[_0x3a0b44[_0x99a1('0x38')]]={'$like':'%'+_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x4e')]+'%'};return _0x3861b6;}})});}_0x3cd1a0=_['merge']({},_0x3cd1a0,_0x2d328c[_0x99a1('0x4f')]);var _0x330e3b={'where':_0x3cd1a0['where']};return db[_0x99a1('0x3b')][_0x99a1('0x2e')](_0x330e3b)[_0x99a1('0x1c')](function(_0x2e377b){_0x399fd4[_0x99a1('0x2e')]=_0x2e377b;if(_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x50')]){_0x3cd1a0['include']=[{'all':!![]}];}return db[_0x99a1('0x3b')]['findAll'](_0x3cd1a0);})[_0x99a1('0x1c')](function(_0x269798){_0x399fd4['rows']=_0x269798;return _0x399fd4;})['then'](respondWithFilteredResult(_0x391afa,_0x3cd1a0))[_0x99a1('0x26')](handleError(_0x391afa,null));};exports[_0x99a1('0x51')]=function(_0x462c15,_0x4519fb){var _0xee2b1b={'raw':![],'where':{'id':_0x462c15['params']['id']}},_0x597836={};_0x597836['model']=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x597836[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x462c15[_0x99a1('0x3f')]);_0x597836[_0x99a1('0x41')]=_['intersection'](_0x597836[_0x99a1('0x42')],_0x597836[_0x99a1('0x3f')]);_0xee2b1b[_0x99a1('0x43')]=_['intersection'](_0x597836[_0x99a1('0x42')],qs['fields'](_0x462c15['query'][_0x99a1('0x44')]));_0xee2b1b[_0x99a1('0x43')]=_0xee2b1b[_0x99a1('0x43')][_0x99a1('0x45')]?_0xee2b1b[_0x99a1('0x43')]:_0x597836[_0x99a1('0x42')];if(_0x462c15[_0x99a1('0x3f')][_0x99a1('0x50')]){_0xee2b1b[_0x99a1('0x52')]=[{'all':!![]}];}_0xee2b1b=_['merge']({},_0xee2b1b,_0x462c15[_0x99a1('0x4f')]);return db['Trunk'][_0x99a1('0x53')](_0xee2b1b)[_0x99a1('0x1c')](handleEntityNotFound(_0x4519fb,null))['then'](respondWithResult(_0x4519fb,null))[_0x99a1('0x26')](handleError(_0x4519fb,null));};exports[_0x99a1('0x54')]=function(_0x469e10,_0x2b2d63){var _0x2800d5={'where':{'id':_0x469e10[_0x99a1('0x55')]['id']}},_0x1bff78={};_0x1bff78[_0x99a1('0x42')]=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x2800d5[_0x99a1('0x43')]=_['intersection'](_0x1bff78['model'],qs[_0x99a1('0x44')](_0x469e10[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x2800d5[_0x99a1('0x43')]=_0x2800d5[_0x99a1('0x43')]['length']?_0x2800d5[_0x99a1('0x43')]:_0x1bff78[_0x99a1('0x42')];if(_0x469e10['query'][_0x99a1('0x50')]){_0x2800d5[_0x99a1('0x52')]=[{'all':!![]}];}_0x2800d5=_[_0x99a1('0x4c')]({},_0x2800d5,_0x469e10[_0x99a1('0x4f')]);return db[_0x99a1('0x3b')]['find'](_0x2800d5)[_0x99a1('0x1c')](handleEntityNotFound(_0x2b2d63,null))[_0x99a1('0x1c')](function(_0x1bb1cb){if(_0x1bb1cb){var _0x22811f=_0x1bb1cb[_0x99a1('0x34')]({'plain':!![]});_0x22811f=qs[_0x99a1('0x56')](_0x22811f,['id','createdAt',_0x99a1('0x57')]);_0x469e10[_0x99a1('0x58')]=_['omit'](_0x469e10[_0x99a1('0x58')],['id',_0x99a1('0x59'),_0x99a1('0x57')]);return db[_0x99a1('0x3b')][_0x99a1('0x5a')](_['merge'](_0x22811f,_0x469e10[_0x99a1('0x58')]),{'include':_0x469e10['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x38ce3c){var _0x3f7c16=_0x469e10['user']['get']({'plain':!![]});if(!_0x3f7c16)throw new Error(_0x99a1('0x5b'));if(_0x3f7c16['role']===_0x99a1('0x5c')){var _0x263db3=_0x38ce3c[_0x99a1('0x34')]({'plain':!![]});var _0x180c1e='Trunks';return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x180c1e,'userProfileId':_0x3f7c16[_0x99a1('0x5e')]},'raw':!![]})['then'](function(_0x3a62c6){if(_0x3a62c6&&_0x3a62c6['autoAssociation']===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x263db3[_0x99a1('0x38')],'resourceId':_0x263db3['id'],'type':_0x3a62c6[_0x99a1('0x38')],'sectionId':_0x3a62c6['id']},{})[_0x99a1('0x1c')](function(){return _0x38ce3c;});}else{return _0x38ce3c;}})['catch'](function(_0x4d37f8){logger['error'](_0x99a1('0x5f'),_0x4d37f8);throw _0x4d37f8;});}return _0x38ce3c;});}})[_0x99a1('0x1c')](respondWithResult(_0x2b2d63,0xc9))['catch'](handleError(_0x2b2d63,null));};exports['create']=function(_0x1fe7af,_0x2f5587,_0x401c8f){var _0x509d4f;return db['Trunk'][_0x99a1('0x5a')](_0x1fe7af['body'],{'raw':!![]})[_0x99a1('0x1c')](function(_0x129690){_0x509d4f=_0x129690;return db[_0x99a1('0x3b')]['findAll']({'raw':!![]});})[_0x99a1('0x1c')](function(_0x28c7d8){var _0x4ac99e=fs['readFileSync'](path[_0x99a1('0x60')](config['root'],_0x99a1('0x61')),_0x99a1('0x62'));var _0x30a0a5=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x3d0ff6=ejs['render'](_0x4ac99e,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x65'),_0x3d0ff6);if(_0x509d4f[_0x99a1('0x66')]){var _0x1750d5=ejs[_0x99a1('0x67')](_0x30a0a5,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x68'),_0x1750d5);}})['then'](function(){return respondWithRpcPromise('Reload',_0x99a1('0x5a'),{'module':_0x99a1('0x69')});})[_0x99a1('0x1c')](function(){var _0x525969=_0x1fe7af[_0x99a1('0x5c')][_0x99a1('0x34')]({'plain':!![]});if(!_0x525969)throw new Error(_0x99a1('0x5b'));if(_0x525969[_0x99a1('0x6a')]===_0x99a1('0x5c')){var _0x4ae313=_0x509d4f[_0x99a1('0x34')]({'plain':!![]});return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x99a1('0x35'),'userProfileId':_0x525969[_0x99a1('0x5e')]},'raw':!![]})[_0x99a1('0x1c')](function(_0x5e42be){if(_0x5e42be&&_0x5e42be[_0x99a1('0x6b')]===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x4ae313[_0x99a1('0x38')],'resourceId':_0x4ae313['id'],'type':_0x5e42be[_0x99a1('0x38')],'sectionId':_0x5e42be['id']},{})['then'](function(){return _0x509d4f;});}else{return _0x509d4f;}})[_0x99a1('0x26')](function(_0x68c944){logger[_0x99a1('0x22')](_0x99a1('0x5f'),_0x68c944);throw _0x68c944;});}return _0x509d4f;})[_0x99a1('0x1c')](respondWithResult(_0x2f5587,0xc9))[_0x99a1('0x26')](handleError(_0x2f5587,null));};exports['update']=function(_0xaa953e,_0x33d96b,_0x4a5617){var _0x56716a;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0xaa953e['params']['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x33d96b,null))[_0x99a1('0x1c')](saveUpdates(_0xaa953e[_0x99a1('0x58')],null))[_0x99a1('0x1c')](function(_0x43156f){if(_0x43156f){_0x56716a=_0x43156f;return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});}})[_0x99a1('0x1c')](function(_0x4260d7){if(_0x4260d7){var _0x3e099c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],'server/files/templates/trunk.ejs'),_0x99a1('0x62'));var _0x5a9a7d=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0xbbbe26=ejs[_0x99a1('0x67')](_0x3e099c,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0xbbbe26);var _0x361ce6=ejs['render'](_0x5a9a7d,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x68'),_0x361ce6);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x70'),{'module':_0x99a1('0x69')});}return null;})[_0x99a1('0x1c')](function(_0x6dab29){if(_0x6dab29){return _0x56716a;}})[_0x99a1('0x1c')](respondWithResult(_0x33d96b,null))['catch'](handleError(_0x33d96b,null));};exports['destroy']=function(_0x51c289,_0x2dd29b,_0x353f25){var _0x53cdb3;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0x51c289[_0x99a1('0x55')]['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x2dd29b,null))['then'](removeEntity(_0x2dd29b,null))[_0x99a1('0x1c')](function(){return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});})[_0x99a1('0x1c')](function(_0x4e9fe9){var _0x24aa05=fs['readFileSync'](path['join'](config['root'],_0x99a1('0x61')),'utf8');var _0xb7744c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x444e43=ejs['render'](_0x24aa05,{'trunks':_0x4e9fe9});var _0x4fcd65=ejs[_0x99a1('0x67')](_0xb7744c,{'trunks':_0x4e9fe9});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0x444e43);fs['writeFileSync'](_0x99a1('0x68'),_0x4fcd65);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x33'),{'module':'chan_sip.so'});})[_0x99a1('0x26')](handleError(_0x2dd29b,null));};
\ No newline at end of file
index 7837425..7f67609 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7cc=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf7cc,0x1bf));var _0xcf7c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf7cc[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xcf7c('0x0'));var util=require(_0xcf7c('0x1'));var logger=require('../../config/logger')(_0xcf7c('0x2'));var moment=require(_0xcf7c('0x3'));var BPromise=require(_0xcf7c('0x4'));var rp=require(_0xcf7c('0x5'));var fs=require('fs');var path=require(_0xcf7c('0x6'));var rimraf=require(_0xcf7c('0x7'));var config=require(_0xcf7c('0x8'));var attributes=require(_0xcf7c('0x9'));module[_0xcf7c('0xa')]=function(_0x2e6fa3,_0x2cc7d5){return _0x2e6fa3[_0xcf7c('0xb')](_0xcf7c('0xc'),attributes,{'tableName':_0xcf7c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3933=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Trunk','tools_trunks'];(function(_0x54a06a,_0x23c40a){var _0x3bf767=function(_0x1bf4c8){while(--_0x1bf4c8){_0x54a06a['push'](_0x54a06a['shift']());}};_0x3bf767(++_0x23c40a);}(_0x3933,0x18c));var _0x3393=function(_0x34cefd,_0x562043){_0x34cefd=_0x34cefd-0x0;var _0x1dcb5d=_0x3933[_0x34cefd];return _0x1dcb5d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3393('0x0'))(_0x3393('0x1'));var moment=require(_0x3393('0x2'));var BPromise=require(_0x3393('0x3'));var rp=require(_0x3393('0x4'));var fs=require('fs');var path=require(_0x3393('0x5'));var rimraf=require(_0x3393('0x6'));var config=require(_0x3393('0x7'));var attributes=require('./trunk.attributes');module[_0x3393('0x8')]=function(_0x5372be,_0x517101){return _0x5372be[_0x3393('0x9')](_0x3393('0xa'),attributes,{'tableName':_0x3393('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d905d14..70f6102 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb77e=['Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','info'];(function(_0x4c2534,_0x77b28a){var _0x5e729f=function(_0x44d295){while(--_0x44d295){_0x4c2534['push'](_0x4c2534['shift']());}};_0x5e729f(++_0x77b28a);}(_0xb77e,0xef));var _0xeb77=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xb77e[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xeb77('0x0'));var util=require(_0xeb77('0x1'));var moment=require(_0xeb77('0x2'));var BPromise=require(_0xeb77('0x3'));var rs=require(_0xeb77('0x4'));var fs=require('fs');var Redis=require(_0xeb77('0x5'));var db=require(_0xeb77('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xeb77('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xeb77('0x8')][_0xeb77('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15d9ce,_0x59bfc4,_0x1ef8e8){return new BPromise(function(_0x2a949f,_0x36861f){return client[_0xeb77('0xa')](_0x15d9ce,_0x1ef8e8)[_0xeb77('0xb')](function(_0x52ef45){logger[_0xeb77('0xc')](_0xeb77('0xd'),_0x59bfc4,_0xeb77('0xe'));logger[_0xeb77('0xf')](_0xeb77('0x10'),_0x59bfc4,_0xeb77('0xe'),JSON[_0xeb77('0x11')](_0x52ef45));if(_0x52ef45[_0xeb77('0x12')]){if(_0x52ef45[_0xeb77('0x12')][_0xeb77('0x13')]===0x1f4){logger[_0xeb77('0x12')]('Trunk,\x20%s,\x20%s',_0x59bfc4,_0x52ef45['error'][_0xeb77('0x14')]);return _0x36861f(_0x52ef45['error']['message']);}logger['error'](_0xeb77('0xd'),_0x59bfc4,_0x52ef45[_0xeb77('0x12')][_0xeb77('0x14')]);return _0x2a949f(_0x52ef45[_0xeb77('0x12')][_0xeb77('0x14')]);}else{logger['info'](_0xeb77('0xd'),_0x59bfc4,_0xeb77('0xe'));_0x2a949f(_0x52ef45[_0xeb77('0x15')][_0xeb77('0x14')]);}})[_0xeb77('0x16')](function(_0x5e4c72){logger[_0xeb77('0x12')]('Trunk,\x20%s,\x20%s',_0x59bfc4,_0x5e4c72);_0x36861f(_0x5e4c72);});});}exports[_0xeb77('0x17')]=function(_0x493b0d){var _0x11c1f4=this;return new Promise(function(_0x1d6785,_0x5be825){return db[_0xeb77('0x18')][_0xeb77('0x19')]({'raw':_0x493b0d[_0xeb77('0x1a')]?_0x493b0d[_0xeb77('0x1a')][_0xeb77('0x1b')]===undefined?!![]:![]:!![],'where':_0x493b0d[_0xeb77('0x1a')]?_0x493b0d['options'][_0xeb77('0x1c')]||null:null,'attributes':_0x493b0d[_0xeb77('0x1a')]?_0x493b0d['options'][_0xeb77('0x1d')]||null:null,'limit':_0x493b0d[_0xeb77('0x1a')]?_0x493b0d['options'][_0xeb77('0x1e')]||null:null,'include':_0x493b0d[_0xeb77('0x1a')]?_0x493b0d[_0xeb77('0x1a')][_0xeb77('0x1f')]?_[_0xeb77('0x20')](_0x493b0d[_0xeb77('0x1a')][_0xeb77('0x1f')],function(_0x4f91a8){return{'model':db[_0x4f91a8['model']],'as':_0x4f91a8['as'],'attributes':_0x4f91a8[_0xeb77('0x1d')],'include':_0x4f91a8[_0xeb77('0x1f')]?_[_0xeb77('0x20')](_0x4f91a8[_0xeb77('0x1f')],function(_0x1fb951){return{'model':db[_0x1fb951[_0xeb77('0x21')]],'as':_0x1fb951['as'],'attributes':_0x1fb951['attributes'],'include':_0x1fb951[_0xeb77('0x1f')]?_[_0xeb77('0x20')](_0x1fb951[_0xeb77('0x1f')],function(_0x337a76){return{'model':db[_0x337a76[_0xeb77('0x21')]],'as':_0x337a76['as'],'attributes':_0x337a76[_0xeb77('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c6fa7){logger['info'](_0xeb77('0x17'),_0x493b0d);logger['debug'](_0xeb77('0x17'),_0x493b0d,JSON['stringify'](_0x2c6fa7));_0x1d6785(_0x2c6fa7);})[_0xeb77('0x16')](function(_0x28f982){logger['error'](_0xeb77('0x17'),_0x28f982[_0xeb77('0x14')],_0x493b0d);_0x5be825(_0x11c1f4[_0xeb77('0x12')](0x1f4,_0x28f982['message']));});});};exports[_0xeb77('0x22')]=function(_0x8a20ac){var _0x34dd8a=this;return new Promise(function(_0x130ccf,_0x2a4a3a){return db[_0xeb77('0x18')][_0xeb77('0x23')]({'raw':_0x8a20ac[_0xeb77('0x1a')]?_0x8a20ac[_0xeb77('0x1a')][_0xeb77('0x1b')]===undefined?!![]:![]:!![],'where':_0x8a20ac['options']?_0x8a20ac[_0xeb77('0x1a')][_0xeb77('0x1c')]||null:null,'attributes':_0x8a20ac[_0xeb77('0x1a')]?_0x8a20ac[_0xeb77('0x1a')][_0xeb77('0x1d')]||null:null,'include':_0x8a20ac[_0xeb77('0x1a')]?_0x8a20ac[_0xeb77('0x1a')][_0xeb77('0x1f')]?_[_0xeb77('0x20')](_0x8a20ac[_0xeb77('0x1a')]['include'],function(_0x1db050){return{'model':db[_0x1db050[_0xeb77('0x21')]],'as':_0x1db050['as'],'attributes':_0x1db050['attributes'],'include':_0x1db050[_0xeb77('0x1f')]?_[_0xeb77('0x20')](_0x1db050[_0xeb77('0x1f')],function(_0x40b062){return{'model':db[_0x40b062['model']],'as':_0x40b062['as'],'attributes':_0x40b062[_0xeb77('0x1d')],'include':_0x40b062[_0xeb77('0x1f')]?_[_0xeb77('0x20')](_0x40b062['include'],function(_0xded810){return{'model':db[_0xded810[_0xeb77('0x21')]],'as':_0xded810['as'],'attributes':_0xded810[_0xeb77('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xeb77('0xb')](function(_0x49edd8){logger[_0xeb77('0xc')](_0xeb77('0x22'),_0x8a20ac);logger[_0xeb77('0xf')]('ShowTrunk',_0x8a20ac,JSON[_0xeb77('0x11')](_0x49edd8));_0x130ccf(_0x49edd8);})[_0xeb77('0x16')](function(_0x563104){logger[_0xeb77('0x12')](_0xeb77('0x22'),_0x563104[_0xeb77('0x14')],_0x8a20ac);_0x2a4a3a(_0x34dd8a[_0xeb77('0x12')](0x1f4,_0x563104[_0xeb77('0x14')]));});});};
\ No newline at end of file
+var _0xaab4=['error','message','result','Trunk','raw','options','where','attributes','limit','include','map','GetTrunk','stringify','catch','ShowTrunk','find','model','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xaab4,0x74));var _0x4aab=function(_0xb771f2,_0x5c01df){_0xb771f2=_0xb771f2-0x0;var _0x1b3056=_0xaab4[_0xb771f2];return _0x1b3056;};'use strict';var _=require('lodash');var util=require(_0x4aab('0x0'));var moment=require('moment');var BPromise=require(_0x4aab('0x1'));var rs=require(_0x4aab('0x2'));var fs=require('fs');var Redis=require(_0x4aab('0x3'));var db=require(_0x4aab('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4aab('0x5'))('rpc');var config=require(_0x4aab('0x6'));var jayson=require(_0x4aab('0x7'));var client=jayson[_0x4aab('0x8')][_0x4aab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9b58f6,_0x9e01b8,_0x246a08){return new BPromise(function(_0xabd494,_0x480f24){return client[_0x4aab('0xa')](_0x9b58f6,_0x246a08)[_0x4aab('0xb')](function(_0x72f4f3){logger[_0x4aab('0xc')](_0x4aab('0xd'),_0x9e01b8,_0x4aab('0xe'));logger[_0x4aab('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x9e01b8,_0x4aab('0xe'),JSON['stringify'](_0x72f4f3));if(_0x72f4f3[_0x4aab('0x10')]){if(_0x72f4f3['error']['code']===0x1f4){logger[_0x4aab('0x10')]('Trunk,\x20%s,\x20%s',_0x9e01b8,_0x72f4f3[_0x4aab('0x10')][_0x4aab('0x11')]);return _0x480f24(_0x72f4f3['error'][_0x4aab('0x11')]);}logger['error'](_0x4aab('0xd'),_0x9e01b8,_0x72f4f3[_0x4aab('0x10')][_0x4aab('0x11')]);return _0xabd494(_0x72f4f3['error'][_0x4aab('0x11')]);}else{logger[_0x4aab('0xc')](_0x4aab('0xd'),_0x9e01b8,'request\x20sent');_0xabd494(_0x72f4f3[_0x4aab('0x12')][_0x4aab('0x11')]);}})['catch'](function(_0x4dd0d2){logger[_0x4aab('0x10')](_0x4aab('0xd'),_0x9e01b8,_0x4dd0d2);_0x480f24(_0x4dd0d2);});});}exports['GetTrunk']=function(_0x16736a){var _0x5504f4=this;return new Promise(function(_0x2925b0,_0x5a0405){return db[_0x4aab('0x13')]['findAll']({'raw':_0x16736a['options']?_0x16736a['options'][_0x4aab('0x14')]===undefined?!![]:![]:!![],'where':_0x16736a[_0x4aab('0x15')]?_0x16736a[_0x4aab('0x15')][_0x4aab('0x16')]||null:null,'attributes':_0x16736a['options']?_0x16736a['options'][_0x4aab('0x17')]||null:null,'limit':_0x16736a[_0x4aab('0x15')]?_0x16736a[_0x4aab('0x15')][_0x4aab('0x18')]||null:null,'include':_0x16736a[_0x4aab('0x15')]?_0x16736a[_0x4aab('0x15')][_0x4aab('0x19')]?_[_0x4aab('0x1a')](_0x16736a['options'][_0x4aab('0x19')],function(_0x4064c8){return{'model':db[_0x4064c8['model']],'as':_0x4064c8['as'],'attributes':_0x4064c8['attributes'],'include':_0x4064c8[_0x4aab('0x19')]?_['map'](_0x4064c8[_0x4aab('0x19')],function(_0x396a87){return{'model':db[_0x396a87['model']],'as':_0x396a87['as'],'attributes':_0x396a87['attributes'],'include':_0x396a87[_0x4aab('0x19')]?_[_0x4aab('0x1a')](_0x396a87[_0x4aab('0x19')],function(_0x1a6378){return{'model':db[_0x1a6378['model']],'as':_0x1a6378['as'],'attributes':_0x1a6378['attributes']};}):[]};}):[]};}):[]:[]})[_0x4aab('0xb')](function(_0x4541be){logger[_0x4aab('0xc')](_0x4aab('0x1b'),_0x16736a);logger[_0x4aab('0xf')](_0x4aab('0x1b'),_0x16736a,JSON[_0x4aab('0x1c')](_0x4541be));_0x2925b0(_0x4541be);})[_0x4aab('0x1d')](function(_0x1fd146){logger[_0x4aab('0x10')](_0x4aab('0x1b'),_0x1fd146[_0x4aab('0x11')],_0x16736a);_0x5a0405(_0x5504f4['error'](0x1f4,_0x1fd146['message']));});});};exports[_0x4aab('0x1e')]=function(_0x44a1c0){var _0x4a60f4=this;return new Promise(function(_0x223da8,_0x4422b0){return db[_0x4aab('0x13')][_0x4aab('0x1f')]({'raw':_0x44a1c0[_0x4aab('0x15')]?_0x44a1c0[_0x4aab('0x15')][_0x4aab('0x14')]===undefined?!![]:![]:!![],'where':_0x44a1c0[_0x4aab('0x15')]?_0x44a1c0[_0x4aab('0x15')][_0x4aab('0x16')]||null:null,'attributes':_0x44a1c0[_0x4aab('0x15')]?_0x44a1c0[_0x4aab('0x15')][_0x4aab('0x17')]||null:null,'include':_0x44a1c0[_0x4aab('0x15')]?_0x44a1c0[_0x4aab('0x15')][_0x4aab('0x19')]?_[_0x4aab('0x1a')](_0x44a1c0[_0x4aab('0x15')][_0x4aab('0x19')],function(_0x581420){return{'model':db[_0x581420[_0x4aab('0x20')]],'as':_0x581420['as'],'attributes':_0x581420['attributes'],'include':_0x581420[_0x4aab('0x19')]?_[_0x4aab('0x1a')](_0x581420['include'],function(_0x57eada){return{'model':db[_0x57eada[_0x4aab('0x20')]],'as':_0x57eada['as'],'attributes':_0x57eada[_0x4aab('0x17')],'include':_0x57eada[_0x4aab('0x19')]?_['map'](_0x57eada[_0x4aab('0x19')],function(_0x46431c){return{'model':db[_0x46431c['model']],'as':_0x46431c['as'],'attributes':_0x46431c[_0x4aab('0x17')]};}):[]};}):[]};}):[]:[]})[_0x4aab('0xb')](function(_0x1adc37){logger[_0x4aab('0xc')]('ShowTrunk',_0x44a1c0);logger[_0x4aab('0xf')](_0x4aab('0x1e'),_0x44a1c0,JSON[_0x4aab('0x1c')](_0x1adc37));_0x223da8(_0x1adc37);})['catch'](function(_0x23cdcf){logger[_0x4aab('0x10')](_0x4aab('0x1e'),_0x23cdcf[_0x4aab('0x11')],_0x44a1c0);_0x4422b0(_0x4a60f4[_0x4aab('0x10')](0x1f4,_0x23cdcf[_0x4aab('0x11')]));});});};
\ No newline at end of file
index 78f5363..9d92916 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed3a=['addFaxInteractions','/:id/sms_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','/:id','destroy','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','/:id/queues_rt','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','/create_many','bulkCreate','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions'];(function(_0x5ad7ab,_0x49de88){var _0x16b1cc=function(_0x415a01){while(--_0x415a01){_0x5ad7ab['push'](_0x5ad7ab['shift']());}};_0x16b1cc(++_0x49de88);}(_0xed3a,0x190));var _0xaed3=function(_0x52fe8e,_0x263e4f){_0x52fe8e=_0x52fe8e-0x0;var _0x24c7e4=_0xed3a[_0x52fe8e];return _0x24c7e4;};'use strict';var multer=require(_0xaed3('0x0'));var util=require('util');var path=require(_0xaed3('0x1'));var timeout=require(_0xaed3('0x2'));var express=require(_0xaed3('0x3'));var router=express[_0xaed3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaed3('0x5'));var interaction=require(_0xaed3('0x6'));var config=require(_0xaed3('0x7'));var controller=require(_0xaed3('0x8'));router[_0xaed3('0x9')]('/',auth[_0xaed3('0xa')](),controller[_0xaed3('0xb')]);router[_0xaed3('0x9')](_0xaed3('0xc'),auth[_0xaed3('0xa')](),controller[_0xaed3('0xd')]);router[_0xaed3('0x9')]('/whoami',auth[_0xaed3('0xa')](),controller[_0xaed3('0xe')]);router[_0xaed3('0x9')]('/presence',auth[_0xaed3('0xa')](),controller[_0xaed3('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xaed3('0x10')]);router[_0xaed3('0x9')](_0xaed3('0x11'),controller[_0xaed3('0x12')]);router['get'](_0xaed3('0x13'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x14')]);router[_0xaed3('0x9')]('/:id/contacts',auth[_0xaed3('0xa')](),controller[_0xaed3('0x15')]);router[_0xaed3('0x9')](_0xaed3('0x16'),auth[_0xaed3('0xa')](),controller['getQueues']);router[_0xaed3('0x9')](_0xaed3('0x17'),auth[_0xaed3('0xa')](),controller['getVoiceQueuesRt']);router[_0xaed3('0x9')]('/:id/groups',auth[_0xaed3('0xa')](),controller['getGroups']);router[_0xaed3('0x9')](_0xaed3('0x18'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x19')]);router[_0xaed3('0x9')](_0xaed3('0x1a'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x1b')]);router[_0xaed3('0x9')](_0xaed3('0x1c'),auth['isAuthenticated'](),controller['getChatInteractions']);router['get'](_0xaed3('0x1d'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x1e')]);router[_0xaed3('0x9')](_0xaed3('0x1f'),auth[_0xaed3('0xa')](),controller['getMailInteractions']);router[_0xaed3('0x9')](_0xaed3('0x20'),auth['isAuthenticated'](),controller[_0xaed3('0x21')]);router[_0xaed3('0x9')](_0xaed3('0x22'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x23')]);router['get']('/:id/whatsapp/interactions',auth[_0xaed3('0xa')](),controller[_0xaed3('0x24')]);router['get'](_0xaed3('0x25'),auth['isAuthenticated'](),controller[_0xaed3('0x26')]);router[_0xaed3('0x9')](_0xaed3('0x27'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x28')]);router[_0xaed3('0x9')](_0xaed3('0x29'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x2a')]);router[_0xaed3('0x9')](_0xaed3('0x2b'),auth['isAuthenticated'](),controller[_0xaed3('0x2c')]);router[_0xaed3('0x9')](_0xaed3('0x2d'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x2e')]);router[_0xaed3('0x9')](_0xaed3('0x2f'),auth['isAuthenticated'](),controller[_0xaed3('0x30')]);router[_0xaed3('0x9')](_0xaed3('0x31'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x32')]);router['get'](_0xaed3('0x33'),auth['isAuthenticated'](),controller[_0xaed3('0x34')]);router[_0xaed3('0x9')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xaed3('0x35')]);router[_0xaed3('0x9')]('/:id/whatsapp_accounts',auth[_0xaed3('0xa')](),controller[_0xaed3('0x36')]);router[_0xaed3('0x9')](_0xaed3('0x37'),auth['isAuthenticated'](),controller[_0xaed3('0x38')]);router['get'](_0xaed3('0x39'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x3a')]);router[_0xaed3('0x9')](_0xaed3('0x3b'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x3c')]);router[_0xaed3('0x3d')](_0xaed3('0x3e'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x3f')]);router[_0xaed3('0x3d')]('/',auth[_0xaed3('0xa')](),controller['create']);router[_0xaed3('0x3d')](_0xaed3('0x40'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x41')]);router['post'](_0xaed3('0x16'),auth[_0xaed3('0xa')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f6dee,_0x2b626e,_0x2f4f1d){_0x2f4f1d(null,path[_0xaed3('0x42')](config[_0xaed3('0x43')],_0xaed3('0x44')));},'filename':function(_0x16a8f1,_0x5a7a7f,_0x35248f){_0x35248f(null,util[_0xaed3('0x45')](_0xaed3('0x46'),Date[_0xaed3('0x47')](),_0x5a7a7f[_0xaed3('0x48')]));}})});router[_0xaed3('0x3d')]('/:id/avatar',upload[_0xaed3('0x49')](_0xaed3('0x4a')),controller[_0xaed3('0x4b')]);router['post'](_0xaed3('0x4c'),auth['isAuthenticated'](),controller[_0xaed3('0x4d')]);router[_0xaed3('0x3d')]('/:id/logout',auth[_0xaed3('0xa')](),controller[_0xaed3('0x4e')]);router[_0xaed3('0x3d')](_0xaed3('0x4f'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x50')]);router[_0xaed3('0x3d')](_0xaed3('0x51'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x52')]);router[_0xaed3('0x3d')](_0xaed3('0x25'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x53')]);router['post'](_0xaed3('0x54'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x55')]);router[_0xaed3('0x3d')](_0xaed3('0x56'),auth[_0xaed3('0xa')](),controller['addMailInteractions']);router[_0xaed3('0x3d')](_0xaed3('0x57'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x58')]);router[_0xaed3('0x3d')](_0xaed3('0x59'),auth[_0xaed3('0xa')](),controller['addSmsInteractions']);router[_0xaed3('0x3d')]('/:id/openchannel_interactions',auth[_0xaed3('0xa')](),controller[_0xaed3('0x5a')]);router['post'](_0xaed3('0x5b'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x5c')]);router[_0xaed3('0x3d')](_0xaed3('0x2d'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x5d')]);router[_0xaed3('0x3d')](_0xaed3('0x2f'),auth[_0xaed3('0xa')](),controller['addMailAccounts']);router['post'](_0xaed3('0x31'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0xaed3('0x3d')](_0xaed3('0x33'),auth[_0xaed3('0xa')](),controller['addSmsAccounts']);router[_0xaed3('0x3d')]('/:id/chat_websites',auth[_0xaed3('0xa')](),controller[_0xaed3('0x5e')]);router[_0xaed3('0x3d')](_0xaed3('0x5f'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x60')]);router[_0xaed3('0x3d')](_0xaed3('0x37'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x61')]);router[_0xaed3('0x3d')](_0xaed3('0x3b'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x62')]);router[_0xaed3('0x63')]('/:id',auth[_0xaed3('0xa')](),controller[_0xaed3('0x64')]);router[_0xaed3('0x63')](_0xaed3('0x65'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x66')]);router[_0xaed3('0x67')](_0xaed3('0x16'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x68')]);router[_0xaed3('0x67')]('/:id/teams',auth[_0xaed3('0xa')](),controller[_0xaed3('0x69')]);router[_0xaed3('0x67')](_0xaed3('0x6a'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x6b')]);router['delete'](_0xaed3('0x54'),auth[_0xaed3('0xa')](),controller['removeChatInteractions']);router[_0xaed3('0x67')](_0xaed3('0x56'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x6c')]);router[_0xaed3('0x67')](_0xaed3('0x57'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x6d')]);router[_0xaed3('0x67')](_0xaed3('0x59'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x6e')]);router['delete']('/:id/openchannel_interactions',auth[_0xaed3('0xa')](),controller[_0xaed3('0x6f')]);router['delete']('/:id/whatsapp_interactions',auth[_0xaed3('0xa')](),controller[_0xaed3('0x70')]);router[_0xaed3('0x67')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xaed3('0x71')]);router[_0xaed3('0x67')](_0xaed3('0x2f'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x72')]);router['delete'](_0xaed3('0x31'),auth[_0xaed3('0xa')](),controller['removeOpenchannelAccounts']);router[_0xaed3('0x67')]('/:id/sms_accounts',auth[_0xaed3('0xa')](),controller[_0xaed3('0x73')]);router[_0xaed3('0x67')](_0xaed3('0x74'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x75')]);router['delete'](_0xaed3('0x5f'),auth['isAuthenticated'](),controller[_0xaed3('0x76')]);router[_0xaed3('0x67')](_0xaed3('0x37'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x77')]);router[_0xaed3('0x67')]('/:id/api_key',auth[_0xaed3('0xa')](),controller[_0xaed3('0x78')]);module[_0xaed3('0x79')]=router;
\ No newline at end of file
+var _0x82dc=['whoami','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','addContacts','post','create','/create_many','bulkCreate','join','root','server/files/images/','format','%s-%s','single','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','update','put','changePassword','delete','removeQueues','destroy','/:id/chat_interactions','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','describe','/whoami'];(function(_0x2e6744,_0x495160){var _0x20ef10=function(_0x5540d6){while(--_0x5540d6){_0x2e6744['push'](_0x2e6744['shift']());}};_0x20ef10(++_0x495160);}(_0x82dc,0xe0));var _0xc82d=function(_0x8aeb9c,_0x4fd48d){_0x8aeb9c=_0x8aeb9c-0x0;var _0x35b2b1=_0x82dc[_0x8aeb9c];return _0x35b2b1;};'use strict';var multer=require(_0xc82d('0x0'));var util=require(_0xc82d('0x1'));var path=require(_0xc82d('0x2'));var timeout=require('connect-timeout');var express=require(_0xc82d('0x3'));var router=express[_0xc82d('0x4')]();var fs_extra=require(_0xc82d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc82d('0x6'));var controller=require('./user.controller');router[_0xc82d('0x7')]('/',auth[_0xc82d('0x8')](),controller[_0xc82d('0x9')]);router[_0xc82d('0x7')]('/describe',auth[_0xc82d('0x8')](),controller[_0xc82d('0xa')]);router['get'](_0xc82d('0xb'),auth[_0xc82d('0x8')](),controller[_0xc82d('0xc')]);router[_0xc82d('0x7')]('/presence',auth[_0xc82d('0x8')](),controller[_0xc82d('0xd')]);router['get'](_0xc82d('0xe'),auth[_0xc82d('0x8')](),controller[_0xc82d('0xf')]);router[_0xc82d('0x7')](_0xc82d('0x10'),controller[_0xc82d('0x11')]);router[_0xc82d('0x7')](_0xc82d('0x12'),auth['isAuthenticated'](),controller[_0xc82d('0x13')]);router[_0xc82d('0x7')](_0xc82d('0x14'),auth['isAuthenticated'](),controller[_0xc82d('0x15')]);router['get'](_0xc82d('0x16'),auth['isAuthenticated'](),controller[_0xc82d('0x17')]);router[_0xc82d('0x7')](_0xc82d('0x18'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x19')]);router[_0xc82d('0x7')](_0xc82d('0x1a'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x1b')]);router[_0xc82d('0x7')]('/:id/recordings',auth[_0xc82d('0x8')](),controller['getRecordings']);router[_0xc82d('0x7')](_0xc82d('0x1c'),auth['isAuthenticated'](),controller['getScreenRecordings']);router['get'](_0xc82d('0x1d'),auth['isAuthenticated'](),controller[_0xc82d('0x1e')]);router[_0xc82d('0x7')](_0xc82d('0x1f'),auth[_0xc82d('0x8')](),controller['getOpenchannelInteractions']);router[_0xc82d('0x7')](_0xc82d('0x20'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x21')]);router['get'](_0xc82d('0x22'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x23')]);router[_0xc82d('0x7')](_0xc82d('0x24'),auth[_0xc82d('0x8')](),controller['getFaxInteractions']);router[_0xc82d('0x7')]('/:id/whatsapp/interactions',auth[_0xc82d('0x8')](),controller[_0xc82d('0x25')]);router['get'](_0xc82d('0x26'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x27')]);router[_0xc82d('0x7')](_0xc82d('0x28'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x29')]);router['get']('/:id/agents',auth[_0xc82d('0x8')](),controller['getAgents']);router['get']('/:id/prefixes',auth[_0xc82d('0x8')](),controller[_0xc82d('0x2a')]);router[_0xc82d('0x7')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xc82d('0x2b')]);router[_0xc82d('0x7')](_0xc82d('0x2c'),auth['isAuthenticated'](),controller[_0xc82d('0x2d')]);router['get']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xc82d('0x2e')]);router[_0xc82d('0x7')](_0xc82d('0x2f'),auth['isAuthenticated'](),controller[_0xc82d('0x30')]);router[_0xc82d('0x7')](_0xc82d('0x31'),auth['isAuthenticated'](),controller['getChatWebsites']);router['get']('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0xc82d('0x32')]);router[_0xc82d('0x7')](_0xc82d('0x33'),auth['isAuthenticated'](),controller[_0xc82d('0x34')]);router[_0xc82d('0x7')](_0xc82d('0x35'),auth['isAuthenticated'](),controller[_0xc82d('0x36')]);router['get']('/:id/api_key',auth[_0xc82d('0x8')](),controller[_0xc82d('0x37')]);router['post'](_0xc82d('0x14'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x38')]);router[_0xc82d('0x39')]('/',auth[_0xc82d('0x8')](),controller[_0xc82d('0x3a')]);router[_0xc82d('0x39')](_0xc82d('0x3b'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x3c')]);router['post'](_0xc82d('0x16'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf599a8,_0x3fa838,_0x54bd66){_0x54bd66(null,path[_0xc82d('0x3d')](config[_0xc82d('0x3e')],_0xc82d('0x3f')));},'filename':function(_0x4b2970,_0x5d630c,_0x350365){_0x350365(null,util[_0xc82d('0x40')](_0xc82d('0x41'),Date['now'](),_0x5d630c['originalname']));}})});router[_0xc82d('0x39')](_0xc82d('0x10'),upload[_0xc82d('0x42')](_0xc82d('0x43')),controller[_0xc82d('0x44')]);router[_0xc82d('0x39')](_0xc82d('0x45'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x46')]);router['post'](_0xc82d('0x47'),auth[_0xc82d('0x8')](),controller['logout']);router[_0xc82d('0x39')](_0xc82d('0x48'),auth['isAuthenticated'](),controller[_0xc82d('0x49')]);router[_0xc82d('0x39')](_0xc82d('0x4a'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x4b')]);router[_0xc82d('0x39')](_0xc82d('0x26'),auth['isAuthenticated'](),controller[_0xc82d('0x4c')]);router[_0xc82d('0x39')]('/:id/chat_interactions',auth[_0xc82d('0x8')](),controller[_0xc82d('0x4d')]);router[_0xc82d('0x39')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xc82d('0x4e')]);router[_0xc82d('0x39')](_0xc82d('0x4f'),auth['isAuthenticated'](),controller[_0xc82d('0x50')]);router[_0xc82d('0x39')](_0xc82d('0x51'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x52')]);router[_0xc82d('0x39')](_0xc82d('0x53'),auth['isAuthenticated'](),controller[_0xc82d('0x54')]);router[_0xc82d('0x39')](_0xc82d('0x55'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x56')]);router[_0xc82d('0x39')](_0xc82d('0x57'),auth['isAuthenticated'](),controller[_0xc82d('0x58')]);router[_0xc82d('0x39')]('/:id/mail_accounts',auth[_0xc82d('0x8')](),controller['addMailAccounts']);router[_0xc82d('0x39')](_0xc82d('0x59'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x5a')]);router[_0xc82d('0x39')]('/:id/sms_accounts',auth[_0xc82d('0x8')](),controller['addSmsAccounts']);router[_0xc82d('0x39')]('/:id/chat_websites',auth[_0xc82d('0x8')](),controller[_0xc82d('0x5b')]);router[_0xc82d('0x39')](_0xc82d('0x5c'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x5d')]);router[_0xc82d('0x39')](_0xc82d('0x33'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x5e')]);router['post'](_0xc82d('0x5f'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x60')]);router['put'](_0xc82d('0xe'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x61')]);router[_0xc82d('0x62')]('/:id/password',auth[_0xc82d('0x8')](),controller[_0xc82d('0x63')]);router[_0xc82d('0x64')](_0xc82d('0x16'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x65')]);router['delete']('/:id/teams',auth[_0xc82d('0x8')](),controller['removeTeams']);router['delete'](_0xc82d('0xe'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x66')]);router[_0xc82d('0x64')](_0xc82d('0x67'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x68')]);router[_0xc82d('0x64')](_0xc82d('0x69'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x6a')]);router['delete'](_0xc82d('0x4f'),auth[_0xc82d('0x8')](),controller['removeFaxInteractions']);router[_0xc82d('0x64')]('/:id/sms_interactions',auth[_0xc82d('0x8')](),controller[_0xc82d('0x6b')]);router[_0xc82d('0x64')](_0xc82d('0x53'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x6c')]);router[_0xc82d('0x64')](_0xc82d('0x55'),auth['isAuthenticated'](),controller[_0xc82d('0x6d')]);router[_0xc82d('0x64')](_0xc82d('0x57'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x6e')]);router[_0xc82d('0x64')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xc82d('0x6f')]);router[_0xc82d('0x64')](_0xc82d('0x59'),auth['isAuthenticated'](),controller[_0xc82d('0x70')]);router[_0xc82d('0x64')](_0xc82d('0x2f'),auth[_0xc82d('0x8')](),controller['removeSmsAccounts']);router[_0xc82d('0x64')](_0xc82d('0x31'),auth['isAuthenticated'](),controller[_0xc82d('0x71')]);router[_0xc82d('0x64')]('/:id/whatsapp_accounts',auth[_0xc82d('0x8')](),controller[_0xc82d('0x72')]);router[_0xc82d('0x64')](_0xc82d('0x33'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x73')]);router['delete'](_0xc82d('0x5f'),auth[_0xc82d('0x8')](),controller[_0xc82d('0x74')]);module[_0xc82d('0x75')]=router;
\ No newline at end of file
index 63cbf34..4c605fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb61=['nonat','update','outgoing','force_rport,comedia','nat','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','encryption','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','agent','telephone','local','INTEGER','accountcode','DATE','BOOLEAN','dynamic','friend','from-sip','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','rfc2833','shortinfo','auto','yes'];(function(_0x4a3dc5,_0xa878cd){var _0x27ff50=function(_0x5a4bc8){while(--_0x5a4bc8){_0x4a3dc5['push'](_0x4a3dc5['shift']());}};_0x27ff50(++_0xa878cd);}(_0xbb61,0x131));var _0x1bb6=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xbb61[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require(_0x1bb6('0x0'));var moment=require('moment');var util=require(_0x1bb6('0x1'));var _=require(_0x1bb6('0x2'));module[_0x1bb6('0x3')]={'name':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':![],'unique':_0x1bb6('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xb6f0ac){this[_0x1bb6('0x6')]('name',_0xb6f0ac);this[_0x1bb6('0x6')](_0x1bb6('0x7'),_0xb6f0ac);},'comment':_0x1bb6('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x362383){this[_0x1bb6('0x6')](_0x1bb6('0x9'),_0x362383);this['setDataValue'](_0x1bb6('0xa'),util[_0x1bb6('0xb')](_0x1bb6('0xc'),_0x362383,this[_0x1bb6('0xd')](_0x1bb6('0xe'))));}},'alias':{'type':Sequelize[_0x1bb6('0x4')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1bb6('0xf'),'validate':{'isEmail':!![]},'set':function(_0x29ee41){if(_0x29ee41){this['setDataValue'](_0x1bb6('0xf'),_0x29ee41['toLowerCase']());}}},'role':{'type':Sequelize['ENUM']('admin','user',_0x1bb6('0x10'),_0x1bb6('0x11')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x1bb6('0x12')},'internal':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':![],'unique':_0x1bb6('0xe'),'set':function(_0x93768a){this[_0x1bb6('0x6')](_0x1bb6('0xe'),_0x93768a);this[_0x1bb6('0x6')](_0x1bb6('0x14'),_0x93768a);this['setDataValue'](_0x1bb6('0xa'),util[_0x1bb6('0xb')](_0x1bb6('0xc'),this[_0x1bb6('0xd')](_0x1bb6('0x9')),_0x93768a));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x1bb6('0x4')]},'mobile':{'type':Sequelize[_0x1bb6('0x4')]},'address':{'type':Sequelize[_0x1bb6('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x1bb6('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x1bb6('0x4')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1bb6('0x15')]},'voicePause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1bb6('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x1bb6('0x15')]},'chatCapacity':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![],'defaultValue':_0x1bb6('0x17')},'ipaddr':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x1bb6('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x1bb6('0x18'),'user','peer'),'allowNull':!![],'defaultValue':_0x1bb6('0x18')},'context':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![],'defaultValue':_0x1bb6('0x19')},'callingpres':{'type':Sequelize[_0x1bb6('0x1a')]('ALLOWED_NOT_SCREENED',_0x1bb6('0x1b'),_0x1bb6('0x1c'),'ALLOWED',_0x1bb6('0x1d'),_0x1bb6('0x1e'),_0x1bb6('0x1f'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![],'defaultValue':_0x1bb6('0x20'),'set':function(_0x4f8565){this[_0x1bb6('0x6')](_0x1bb6('0x21'),_0x4f8565?_0x4f8565[_0x1bb6('0x22')](','):null);},'get':function(){return this['getDataValue'](_0x1bb6('0x21'))?this[_0x1bb6('0xd')](_0x1bb6('0x21'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x23'),'info',_0x1bb6('0x24'),'inband',_0x1bb6('0x25')),'allowNull':!![],'defaultValue':_0x1bb6('0x23')},'directmedia':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no',_0x1bb6('0x27'),_0x1bb6('0x28'),_0x1bb6('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x1bb6('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![],'defaultValue':_0x1bb6('0x2a'),'set':function(_0x41363f){this[_0x1bb6('0x6')](_0x1bb6('0x2b'),_0x41363f?_0x41363f[_0x1bb6('0x22')](','):null);},'get':function(){return this[_0x1bb6('0xd')](_0x1bb6('0x2b'))?this['getDataValue'](_0x1bb6('0x2b'))[_0x1bb6('0x2c')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x1bb6('0x4')]},'namedcallgroup':{'type':Sequelize[_0x1bb6('0x4')]},'pickupgroup':{'type':Sequelize[_0x1bb6('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x1bb6('0x4')]},'language':{'type':Sequelize[_0x1bb6('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1bb6('0x4')]},'disallow':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':![],'defaultValue':_0x1bb6('0x2d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1bb6('0x2e'),'set':function(_0x4a2a62){this[_0x1bb6('0x6')](_0x1bb6('0x2f'),_0x4a2a62?_0x4a2a62[_0x1bb6('0x22')](';'):_0x1bb6('0x2e'));},'get':function(){return this[_0x1bb6('0xd')](_0x1bb6('0x2f'))?this[_0x1bb6('0xd')](_0x1bb6('0x2f'))['split'](';'):null;},'comment':_0x1bb6('0x30')},'autoframing':{'type':Sequelize['ENUM'](_0x1bb6('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![],'set':function(_0x720fa5){this[_0x1bb6('0x6')](_0x1bb6('0x31'),_0x720fa5?_0x720fa5[_0x1bb6('0x22')](','):null);},'get':function(){return this[_0x1bb6('0xd')]('insecure')?this['getDataValue'](_0x1bb6('0x31'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no',_0x1bb6('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x1bb6('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![],'defaultValue':_0x1bb6('0x33')},'amaflags':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x1bb6('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x1bb6('0x26'),'no',_0x1bb6('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1bb6('0x35'),'refuse',_0x1bb6('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x37'),'uas'),'allowNull':!![],'defaultValue':_0x1bb6('0x38')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![],'defaultValue':_0x1bb6('0x26')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x1bb6('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no',_0x1bb6('0x39'),_0x1bb6('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x1bb6('0x3b'),_0x1bb6('0x3c'),_0x1bb6('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x1bb6('0x27'),_0x1bb6('0x28'),_0x1bb6('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1bb6('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x1bb6('0x15')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x1bb6('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2e33aa){this['setDataValue'](_0x1bb6('0x40'),_0x2e33aa);var _0x3f358c=this[_0x1bb6('0x41')]({'plain':!![]});switch(_0x2e33aa){case 0x0:case 0x1:var _0x1a3a84=_0x3f358c[_0x1bb6('0x21')]?_[_0x1bb6('0x42')](_0x3f358c['transport'])?_0x3f358c[_0x1bb6('0x21')][_0x1bb6('0x22')]():_0x3f358c['transport']:_0x1bb6('0x20');if(_0x1a3a84==='wss'){_0x1a3a84=_0x1bb6('0x20');}this['setDataValue'](_0x1bb6('0x21'),_0x1a3a84);this[_0x1bb6('0x6')](_0x1bb6('0x43'),'no');this[_0x1bb6('0x6')]('avpf',null);this[_0x1bb6('0x6')](_0x1bb6('0x44'),null);this[_0x1bb6('0x6')](_0x1bb6('0x45'),null);this[_0x1bb6('0x6')]('dtlsenable',null);this['setDataValue'](_0x1bb6('0x46'),null);this[_0x1bb6('0x6')](_0x1bb6('0x47'),null);this[_0x1bb6('0x6')](_0x1bb6('0x48'),null);this[_0x1bb6('0x6')](_0x1bb6('0x49'),null);this[_0x1bb6('0x6')](_0x1bb6('0x4a'),'no');break;case 0x2:this[_0x1bb6('0x6')](_0x1bb6('0x21'),_0x1bb6('0x4b'));this[_0x1bb6('0x6')]('encryption',_0x1bb6('0x26'));this[_0x1bb6('0x6')](_0x1bb6('0x4c'),_0x1bb6('0x26'));this['setDataValue']('force_avp','yes');this[_0x1bb6('0x6')](_0x1bb6('0x45'),_0x1bb6('0x26'));this[_0x1bb6('0x6')]('dtlsenable',_0x1bb6('0x26'));this[_0x1bb6('0x6')](_0x1bb6('0x46'),'no');this[_0x1bb6('0x6')](_0x1bb6('0x47'),_0x1bb6('0x3d'));this[_0x1bb6('0x6')](_0x1bb6('0x48'),_0x3f358c[_0x1bb6('0x48')]||_0x1bb6('0x4d'));this[_0x1bb6('0x6')](_0x1bb6('0x49'),_0x3f358c[_0x1bb6('0x49')]||_0x1bb6('0x4e'));this[_0x1bb6('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x1bb6('0x3f')],'set':function(_0x163711){this['setDataValue'](_0x1bb6('0x4f'),_0x163711?_0x163711[_0x1bb6('0x22')](','):[]);},'get':function(){return this['getDataValue'](_0x1bb6('0x4f'))?_[_0x1bb6('0x50')](this[_0x1bb6('0xd')](_0x1bb6('0x4f'))[_0x1bb6('0x2c')](','),function(_0x1bae9e){return parseInt(_0x1bae9e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1bb6('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1bb6('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x1bb6('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1bb6('0xd')]('phoneBarEnableScreenRecordingByAgent')?this[_0x1bb6('0xd')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x1bb6('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4e3011){if(typeof _0x4e3011==='string'){var _0x30ef4c=_0x4e3011==='1'?!![]:_0x4e3011==='0'?![]:_0x4e3011===_0x1bb6('0x51')?!![]:_0x4e3011===_0x1bb6('0x52')?![]:![];this[_0x1bb6('0x6')](_0x1bb6('0x53'),_0x30ef4c);}else{this[_0x1bb6('0x6')]('screenrecording',_0x4e3011);}}},'blocked':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![],'set':function(_0x71a4d9){this[_0x1bb6('0x6')]('blocked',_0x71a4d9);if(_0x71a4d9===!![]){this['setDataValue'](_0x1bb6('0x54'),moment());this[_0x1bb6('0x6')]('loginAttempts',0x0);}else{this[_0x1bb6('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x1bb6('0x55')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x75dd=['defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','internal','email','ENUM','admin','agent','telephone','local','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT','showWebBar','get','isArray','wss','avpf','force_avp','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','/etc/pki/tls/certs/motion.crt','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','setDataValue','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x75dd,0x1c9));var _0xd75d=function(_0x358cda,_0x51d03f){_0x358cda=_0x358cda-0x0;var _0xb18840=_0x75dd[_0x358cda];return _0xb18840;};'use strict';var Sequelize=require(_0xd75d('0x0'));var moment=require(_0xd75d('0x1'));var util=require(_0xd75d('0x2'));var _=require(_0xd75d('0x3'));module[_0xd75d('0x4')]={'name':{'type':Sequelize[_0xd75d('0x5')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8515ac){this[_0xd75d('0x6')](_0xd75d('0x7'),_0x8515ac);this[_0xd75d('0x6')](_0xd75d('0x8'),_0x8515ac);},'comment':_0xd75d('0x9')},'fullname':{'type':Sequelize[_0xd75d('0x5')],'allowNull':![],'set':function(_0x3594fc){this['setDataValue'](_0xd75d('0xa'),_0x3594fc);this[_0xd75d('0x6')](_0xd75d('0xb'),util[_0xd75d('0xc')]('\x22%s\x22\x20<%s>',_0x3594fc,this[_0xd75d('0xd')](_0xd75d('0xe'))));}},'alias':{'type':Sequelize[_0xd75d('0x5')]},'email':{'type':Sequelize[_0xd75d('0x5')],'allowNull':![],'unique':_0xd75d('0xf'),'validate':{'isEmail':!![]},'set':function(_0x34db4e){if(_0x34db4e){this[_0xd75d('0x6')](_0xd75d('0xf'),_0x34db4e['toLowerCase']());}}},'role':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x11'),'user',_0xd75d('0x12'),_0xd75d('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xd75d('0x5')],'defaultValue':_0xd75d('0x14')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x1af9dd){this[_0xd75d('0x6')](_0xd75d('0xe'),_0x1af9dd);this['setDataValue'](_0xd75d('0x15'),_0x1af9dd);this['setDataValue']('callerid',util['format'](_0xd75d('0x16'),this[_0xd75d('0xd')](_0xd75d('0xa')),_0x1af9dd));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd75d('0x5')]},'mobile':{'type':Sequelize[_0xd75d('0x5')]},'address':{'type':Sequelize[_0xd75d('0x5')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xd75d('0x5')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xd75d('0x5')]},'online':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xd75d('0x18')]},'voicePause':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xd75d('0x5')],'defaultValue':_0xd75d('0x19')},'lastPauseAt':{'type':Sequelize[_0xd75d('0x18')]},'chatCapacity':{'type':Sequelize[_0xd75d('0x1a')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xd75d('0x1a')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xd75d('0x1a')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xd75d('0x1a')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xd75d('0x1a')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xd75d('0x1a')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xd75d('0x1a')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![],'defaultValue':_0xd75d('0x1b')},'ipaddr':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0xd75d('0x1a')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xd75d('0x10')]('friend','user',_0xd75d('0x1c')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd75d('0x1d')},'callingpres':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x1e'),'ALLOWED_PASSED_SCREEN',_0xd75d('0x1f'),_0xd75d('0x20'),_0xd75d('0x21'),_0xd75d('0x22'),'PROHIB_FAILED_SCREEN',_0xd75d('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![],'defaultValue':_0xd75d('0x24'),'set':function(_0x259495){this[_0xd75d('0x6')](_0xd75d('0x25'),_0x259495?_0x259495[_0xd75d('0x26')](','):null);},'get':function(){return this[_0xd75d('0xd')](_0xd75d('0x25'))?this['getDataValue'](_0xd75d('0x25'))[_0xd75d('0x27')](','):null;},'comment':_0xd75d('0x28')},'dtmfmode':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x29'),'info',_0xd75d('0x2a'),_0xd75d('0x2b'),_0xd75d('0x2c')),'allowNull':!![],'defaultValue':_0xd75d('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0xd75d('0x2d'),'no',_0xd75d('0x2e'),_0xd75d('0x2f'),_0xd75d('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xd75d('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd75d('0x31'),'set':function(_0x55d19a){this[_0xd75d('0x6')](_0xd75d('0x32'),_0x55d19a?_0x55d19a[_0xd75d('0x26')](','):null);},'get':function(){return this[_0xd75d('0xd')](_0xd75d('0x32'))?this[_0xd75d('0xd')](_0xd75d('0x32'))[_0xd75d('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xd75d('0x5')]},'namedcallgroup':{'type':Sequelize[_0xd75d('0x5')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xd75d('0x5')]},'language':{'type':Sequelize[_0xd75d('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd75d('0x5')]},'disallow':{'type':Sequelize[_0xd75d('0x5')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xd75d('0x5')],'allowNull':![],'defaultValue':_0xd75d('0x33'),'set':function(_0x13dcc3){this[_0xd75d('0x6')](_0xd75d('0x34'),_0x13dcc3?_0x13dcc3[_0xd75d('0x26')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this[_0xd75d('0xd')](_0xd75d('0x34'))['split'](';'):null;},'comment':_0xd75d('0x35')},'autoframing':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x10e5ea){this[_0xd75d('0x6')](_0xd75d('0x36'),_0x10e5ea?_0x10e5ea[_0xd75d('0x26')](','):null);},'get':function(){return this[_0xd75d('0xd')](_0xd75d('0x36'))?this['getDataValue'](_0xd75d('0x36'))[_0xd75d('0x27')](','):null;},'comment':_0xd75d('0x37')},'trustrpid':{'type':Sequelize['ENUM'](_0xd75d('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xd75d('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd75d('0x10')]('yes','no',_0xd75d('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xd75d('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0xd75d('0x2d')},'busylevel':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xd75d('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xd75d('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x2d'),'no',_0xd75d('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xd75d('0x10')]('accept',_0xd75d('0x3a'),_0xd75d('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x3c'),'uas'),'allowNull':!![],'defaultValue':_0xd75d('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x2d'),'no'),'allowNull':!![],'defaultValue':_0xd75d('0x2d')},'keepalive':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xd75d('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xd75d('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xd75d('0x10')]('yes','no',_0xd75d('0x3e'),_0xd75d('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x40'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xd75d('0x1a')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xd75d('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x2d'),'no',_0xd75d('0x2e'),_0xd75d('0x2f'),_0xd75d('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xd75d('0x18')]},'passwordResetAt':{'type':Sequelize[_0xd75d('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xd75d('0x42')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x22c291){this[_0xd75d('0x6')](_0xd75d('0x43'),_0x22c291);var _0x110a3d=this[_0xd75d('0x44')]({'plain':!![]});switch(_0x22c291){case 0x0:case 0x1:var _0x1c71c1=_0x110a3d[_0xd75d('0x25')]?_[_0xd75d('0x45')](_0x110a3d[_0xd75d('0x25')])?_0x110a3d[_0xd75d('0x25')][_0xd75d('0x26')]():_0x110a3d[_0xd75d('0x25')]:_0xd75d('0x24');if(_0x1c71c1===_0xd75d('0x46')){_0x1c71c1=_0xd75d('0x24');}this[_0xd75d('0x6')](_0xd75d('0x25'),_0x1c71c1);this[_0xd75d('0x6')]('encryption','no');this[_0xd75d('0x6')](_0xd75d('0x47'),null);this['setDataValue'](_0xd75d('0x48'),null);this[_0xd75d('0x6')]('icesupport',null);this[_0xd75d('0x6')]('dtlsenable',null);this['setDataValue'](_0xd75d('0x49'),null);this['setDataValue'](_0xd75d('0x4a'),null);this['setDataValue'](_0xd75d('0x4b'),null);this[_0xd75d('0x6')](_0xd75d('0x4c'),null);this[_0xd75d('0x6')](_0xd75d('0x4d'),'no');break;case 0x2:this[_0xd75d('0x6')]('transport',_0xd75d('0x46'));this[_0xd75d('0x6')](_0xd75d('0x4e'),'yes');this[_0xd75d('0x6')]('avpf',_0xd75d('0x2d'));this[_0xd75d('0x6')](_0xd75d('0x48'),'yes');this['setDataValue'](_0xd75d('0x4f'),_0xd75d('0x2d'));this[_0xd75d('0x6')]('dtlsenable',_0xd75d('0x2d'));this['setDataValue']('dtlsverify','no');this['setDataValue'](_0xd75d('0x4a'),_0xd75d('0x50'));this[_0xd75d('0x6')](_0xd75d('0x4b'),_0x110a3d[_0xd75d('0x4b')]||_0xd75d('0x51'));this[_0xd75d('0x6')](_0xd75d('0x4c'),_0x110a3d[_0xd75d('0x4c')]||'/etc/pki/tls/private/motion.key');this[_0xd75d('0x6')](_0xd75d('0x4d'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0xd75d('0x42')],'set':function(_0x7cd52c){this[_0xd75d('0x6')](_0xd75d('0x52'),_0x7cd52c?_0x7cd52c[_0xd75d('0x26')](','):[]);},'get':function(){return this['getDataValue'](_0xd75d('0x52'))?_[_0xd75d('0x53')](this['getDataValue'](_0xd75d('0x52'))[_0xd75d('0x27')](','),function(_0x1ac133){return parseInt(_0x1ac133,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xd75d('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0xd75d('0x5')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xd75d('0x10')](_0xd75d('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xd75d('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xd75d('0x54')],'get':function(){return this[_0xd75d('0xd')](_0xd75d('0x55'))?this[_0xd75d('0xd')](_0xd75d('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xd75d('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xd75d('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![],'set':function(_0x413910){if(typeof _0x413910===_0xd75d('0x56')){var _0x128995=_0x413910==='1'?!![]:_0x413910==='0'?![]:_0x413910==='true'?!![]:_0x413910===_0xd75d('0x57')?![]:![];this[_0xd75d('0x6')](_0xd75d('0x58'),_0x128995);}else{this[_0xd75d('0x6')]('screenrecording',_0x413910);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x1d43ab){this[_0xd75d('0x6')](_0xd75d('0x59'),_0x1d43ab);if(_0x1d43ab===!![]){this[_0xd75d('0x6')]('blockedAt',moment());this['setDataValue'](_0xd75d('0x5a'),0x0);}else{this[_0xd75d('0x6')](_0xd75d('0x5b'),null);}}},'blockedAt':{'type':Sequelize[_0xd75d('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xd75d('0x1a')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xd75d('0x1a')](0x5)[_0xd75d('0x5c')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd75d('0x17')],'defaultValue':!![]}};
\ No newline at end of file
index a32e51b..bce0082 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x110e=['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','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gte','$lt','$lte','$ne','$not','$between','$in','$iLike','$notILike','$like','$overlap','$contains','$any','firstName','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','flatten','lower','col','toString','asc','desc','substring','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unknown','ringing','voiceStatus','slice','charAt','toUpperCase','field','ui.','InteractionId','ui.createdAt','OpenTabs','moment','bluebird','path','lodash','squel','jayson/promise','ioredis','../../config/utils','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','client','http','then','debug','User,\x20%s,\x20%s,\x20%s','error','code','User,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','get','admin','Users','Agents','agent','Telephones','ignore','map','value','includes','role','find','name','send','index','rawAttributes','fieldName','type','key','filter','password','salt','where','User','include','attributes','push','findAll','rows','query','true','length','dataValues','sms','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','filters','fields','includeAll','merge','openTabs','fax','body','describe','addContacts','omit','ids','internal','Setting','securePassword','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','email','permissions','101','102','103','110','104','106','107','108','100','114','115','create','Unauthorized','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','telephone','isEmpty','autoAssociation','compact','changePassword','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','Sequelize','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','updatePasswordsHistory','addQueues','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','spread','QueueId','emit','Queue:save','voice','VoiceQueue','format','SIP/%s','penalty','UserVoiceQueueRt','upsert','removeQueues','channel','Queues','isArray','Queue:remove','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','userpic','download','existsSync','root','server/files/images/','getOpenTabs','chat','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','intersection','order','sort','options','CmList','List','Tag','color','tag','hasOwnProperty','nolimit','Queue','pick','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','user:%s','headers','connection','socket','remoteAddress','UserVoiceQueue.penalty','forEach','YYYY-MM-DD\x20HH:mm:ss','device','PAUSE','LOGININPAUSE','bulkCreate','concat','update','resolve','logout','pause','updateAttributes','getChannels','MemberReport','unpause','voicePause','mailPause','chatPause','faxPause','smsPause','pauseType','lastPauseAt','QueuePause','manual','Pause','Team','getTeams','addTeams','Voice','getChatQueues','getSmsQueues','setDataValue','Sms','getWhatsappQueues','getFaxQueues','Fax','getOpenchannelQueues','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getVoiceQueues','getMailQueues','Mail','Whatsapp','Openchannel','removeAgent','getLists','getAgents'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x110e,0x68));var _0xe110=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x110e[_0x1da527];return _0x40fc7c;};'use strict';var moment=require(_0xe110('0x0'));var BPromise=require(_0xe110('0x1'));var util=require('util');var path=require(_0xe110('0x2'));var fs=require('fs');var _=require(_0xe110('0x3'));var squel=require(_0xe110('0x4'));var jayson=require(_0xe110('0x5'));var Redis=require(_0xe110('0x6'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0xe110('0x7'));var config=require('../../config/environment');var licenseUtil=require(_0xe110('0x8'));var db=require(_0xe110('0x9'))['db'];var socket=require(_0xe110('0xa'))(new Redis(config[_0xe110('0xb')]));require(_0xe110('0xc'))[_0xe110('0xd')](socket);config[_0xe110('0xb')]=_[_0xe110('0xe')](config[_0xe110('0xb')],{'host':'localhost','port':0x18eb});var client=jayson[_0xe110('0xf')][_0xe110('0x10')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5ebe72,_0x7241b2,_0x10f246,_0x326a5a){return new BPromise(function(_0x2b8a5b,_0x5018cc){var _0x53ad4f=_0x326a5a||client;return _0x53ad4f['request'](_0x5ebe72,_0x10f246)[_0xe110('0x11')](function(_0xee07b5){logger['info']('User,\x20%s,\x20%s',_0x7241b2,'request\x20sent');logger[_0xe110('0x12')](_0xe110('0x13'),_0x7241b2,'request\x20sent',JSON['stringify'](_0xee07b5));if(_0xee07b5[_0xe110('0x14')]){if(_0xee07b5['error'][_0xe110('0x15')]===0x1f4){logger[_0xe110('0x14')](_0xe110('0x16'),_0x7241b2,_0xee07b5[_0xe110('0x14')]['message']);return _0x5018cc(_0xee07b5[_0xe110('0x14')][_0xe110('0x17')]);}logger['error']('User,\x20%s,\x20%s',_0x7241b2,_0xee07b5[_0xe110('0x14')]['message']);return _0x2b8a5b(_0xee07b5[_0xe110('0x14')][_0xe110('0x17')]);}else{logger['info'](_0xe110('0x16'),_0x7241b2,_0xe110('0x18'));_0x2b8a5b(_0xee07b5[_0xe110('0x19')][_0xe110('0x17')]);}})[_0xe110('0x1a')](function(_0x545278){logger[_0xe110('0x14')](_0xe110('0x16'),_0x7241b2,_0x545278);_0x5018cc(_0x545278);});});}function respondWithStatusCode(_0x4d182c,_0x250902){_0x250902=_0x250902||0xcc;return function(_0x152744){if(_0x152744){return _0x4d182c[_0xe110('0x1b')](_0x250902);}return _0x4d182c[_0xe110('0x1c')](_0x250902)[_0xe110('0x1d')]();};}function respondWithResult(_0x222798,_0xba7b71){_0xba7b71=_0xba7b71||0xc8;return function(_0x3de3df){if(_0x3de3df){return _0x222798[_0xe110('0x1c')](_0xba7b71)[_0xe110('0x1e')](_0x3de3df);}};}function respondWithFilteredResult(_0x2cef74,_0x4b08ff){return function(_0x17ba7c){if(_0x17ba7c){var _0x12b6df=typeof _0x4b08ff[_0xe110('0x1f')]===_0xe110('0x20')&&typeof _0x4b08ff[_0xe110('0x21')]==='undefined';var _0x5d37d1=_0x17ba7c[_0xe110('0x22')];var _0x5be7a7=_0x12b6df?0x0:_0x4b08ff[_0xe110('0x1f')];var _0x578464=_0x12b6df?_0x17ba7c['count']:_0x4b08ff['offset']+_0x4b08ff['limit'];var _0x3ec248;if(_0x578464>=_0x5d37d1){_0x578464=_0x5d37d1;_0x3ec248=0xc8;}else{_0x3ec248=0xce;}_0x2cef74['status'](_0x3ec248);return _0x2cef74[_0xe110('0x23')](_0xe110('0x24'),_0x5be7a7+'-'+_0x578464+'/'+_0x5d37d1)['json'](_0x17ba7c);}return null;};}function saveUpdates(_0x545380){return function(_0x58d08d){if(_0x58d08d){return _0x58d08d['update'](_0x545380)['then'](function(_0x3e5603){return _0x3e5603;});}return null;};}function removeEntity(_0x2de4cd){return function(_0x1a2d75){if(_0x1a2d75){return _0x1a2d75[_0xe110('0x25')]()[_0xe110('0x11')](function(){var _0x480eb6=_0x1a2d75[_0xe110('0x26')]({'plain':!![]});if(_0x480eb6['role']===_0xe110('0x27'))return;var _0x127b28=[{'name':_0xe110('0x28'),'value':'user','ignore':!![]},{'name':_0xe110('0x29'),'value':_0xe110('0x2a'),'ignore':![]},{'name':_0xe110('0x2b'),'value':'telephone','ignore':![]}];var _0x5368da=_(_0x127b28)['filter'](_0xe110('0x2c'))[_0xe110('0x2d')](_0xe110('0x2e'))[_0xe110('0x2e')]();if(_[_0xe110('0x2f')](_0x5368da,_0x480eb6[_0xe110('0x30')])){return;}var _0x27554a=_[_0xe110('0x31')](_0x127b28,[_0xe110('0x2e'),_0x480eb6['role']])[_0xe110('0x32')];return db['UserProfileResource'][_0xe110('0x25')]({'where':{'type':_0x27554a,'resourceId':_0x480eb6['id']}})['then'](function(){return _0x1a2d75;});})[_0xe110('0x11')](function(){_0x2de4cd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x370c38){return function(_0xc45e0d){if(!_0xc45e0d){_0x370c38[_0xe110('0x1b')](0x194);}return _0xc45e0d;};}function handleError(_0x57c8b3,_0x59dcd5){_0x59dcd5=_0x59dcd5||0x1f4;return function(_0x436212){logger[_0xe110('0x14')](_0x436212['stack']);if(_0x436212[_0xe110('0x32')]){delete _0x436212[_0xe110('0x32')];}_0x57c8b3[_0xe110('0x1c')](_0x59dcd5)[_0xe110('0x33')](_0x436212);};}exports[_0xe110('0x34')]=function(_0x1f90e2,_0x295ecf){var _0x2f9976={},_0x40fe9c={'count':0x0,'rows':[]};var _0x455634=_(db['User'][_0xe110('0x35')])[_0xe110('0x2d')](function(_0x44543b){return{'name':_0x44543b[_0xe110('0x36')],'type':_0x44543b[_0xe110('0x37')][_0xe110('0x38')]};})[_0xe110('0x39')](function(_0x2d2e53){return!_[_0xe110('0x2f')]([_0xe110('0x3a'),_0xe110('0x3b')],_0x2d2e53[_0xe110('0x32')]);})[_0xe110('0x2e')]();_0x2f9976=qs['getOptions'](_0x455634,_0x1f90e2);var _0x16e62e={'where':_0x2f9976[_0xe110('0x3c')]};return db[_0xe110('0x3d')][_0xe110('0x22')](_0x16e62e)['then'](function(_0xd737b0){_0x40fe9c[_0xe110('0x22')]=_0xd737b0;if(_0x1f90e2['query']['includeAll']){_0x2f9976[_0xe110('0x3e')]=[{'all':!![]}];}if(!_['includes'](_0x2f9976[_0xe110('0x3f')],'id')){_0x2f9976[_0xe110('0x3f')][_0xe110('0x40')]('id');}return db[_0xe110('0x3d')][_0xe110('0x41')](_0x2f9976);})['then'](function(_0xbd7471){_0x40fe9c[_0xe110('0x42')]=_0xbd7471;if(_0x1f90e2[_0xe110('0x43')]['openTabs']===_0xe110('0x44')){var _0x45aa54=[];for(var _0x4b24cb=0x0;_0x4b24cb<_0x40fe9c[_0xe110('0x42')][_0xe110('0x45')];_0x4b24cb++){_0x45aa54[_0xe110('0x40')](get_open_tabs('chat',_0x40fe9c[_0xe110('0x42')][_0x4b24cb][_0xe110('0x46')]));_0x45aa54['push'](get_open_tabs(_0xe110('0x47'),_0x40fe9c['rows'][_0x4b24cb]['dataValues']));_0x45aa54[_0xe110('0x40')](get_open_tabs('fax',_0x40fe9c[_0xe110('0x42')][_0x4b24cb]['dataValues']));_0x45aa54['push'](get_open_tabs(_0xe110('0x48'),_0x40fe9c['rows'][_0x4b24cb]['dataValues']));_0x45aa54['push'](get_open_tabs(_0xe110('0x49'),_0x40fe9c[_0xe110('0x42')][_0x4b24cb][_0xe110('0x46')]));_0x45aa54[_0xe110('0x40')](get_open_tabs(_0xe110('0x4a'),_0x40fe9c['rows'][_0x4b24cb][_0xe110('0x46')]));}return BPromise[_0xe110('0x4b')](_0x45aa54)['then'](function(_0xd9f3f7){return _0x40fe9c;});}else{return _0x40fe9c;}})['then'](respondWithFilteredResult(_0x295ecf,_0x2f9976))[_0xe110('0x1a')](handleError(_0x295ecf,null));};exports[_0xe110('0x4c')]=function(_0x4716ec,_0x34f0b2){var _0x13414a={'raw':![],'where':{'id':_0x4716ec[_0xe110('0x4d')]['id']}},_0x1f4658={};_0x1f4658[_0xe110('0x4e')]=_[_0xe110('0x4f')](_[_0xe110('0x50')](db['User']['rawAttributes']),['password',_0xe110('0x3b')]);_0x1f4658[_0xe110('0x43')]=_['keys'](_0x4716ec['query']);_0x1f4658[_0xe110('0x51')]=_['intersection'](_0x1f4658[_0xe110('0x4e')],_0x1f4658[_0xe110('0x43')]);_0x13414a[_0xe110('0x3f')]=_['intersection'](_0x1f4658[_0xe110('0x4e')],qs['fields'](_0x4716ec['query'][_0xe110('0x52')]));_0x13414a[_0xe110('0x3f')]=_0x13414a[_0xe110('0x3f')]['length']?_0x13414a[_0xe110('0x3f')]:_0x1f4658[_0xe110('0x4e')];if(_0x4716ec[_0xe110('0x43')][_0xe110('0x53')]){_0x13414a['include']=[{'all':!![]}];}_0x13414a=_[_0xe110('0x54')]({},_0x13414a,_0x4716ec['options']);if(!_[_0xe110('0x2f')](_0x13414a[_0xe110('0x3f')],'id')){_0x13414a[_0xe110('0x3f')][_0xe110('0x40')]('id');}return db[_0xe110('0x3d')][_0xe110('0x31')](_0x13414a)[_0xe110('0x11')](handleEntityNotFound(_0x34f0b2,null))['then'](function(_0x5288ce){var _0x4b7119=[];values=_0x5288ce;if(_0x4716ec['query'][_0xe110('0x55')]===_0xe110('0x44')){_0x4b7119['push'](get_open_tabs('chat',_0x5288ce[_0xe110('0x46')]));_0x4b7119[_0xe110('0x40')](get_open_tabs(_0xe110('0x47'),_0x5288ce[_0xe110('0x46')]));_0x4b7119[_0xe110('0x40')](get_open_tabs(_0xe110('0x49'),_0x5288ce[_0xe110('0x46')]));_0x4b7119[_0xe110('0x40')](get_open_tabs(_0xe110('0x4a'),_0x5288ce[_0xe110('0x46')]));_0x4b7119[_0xe110('0x40')](get_open_tabs(_0xe110('0x56'),_0x5288ce[_0xe110('0x46')]));_0x4b7119['push'](get_open_tabs(_0xe110('0x48'),_0x5288ce['dataValues']));return BPromise[_0xe110('0x4b')](_0x4b7119);}else{return values;}})[_0xe110('0x11')](function(_0x594772){return values;})['then'](respondWithResult(_0x34f0b2,null))[_0xe110('0x1a')](handleError(_0x34f0b2,null));};exports['update']=function(_0x17059a,_0x11347e){if(_0x17059a['body']['id']){delete _0x17059a['body']['id'];}delete _0x17059a[_0xe110('0x57')]['role'];return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x17059a[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x11347e,null))[_0xe110('0x11')](saveUpdates(_0x17059a[_0xe110('0x57')],null))[_0xe110('0x11')](respondWithResult(_0x11347e,null))[_0xe110('0x1a')](handleError(_0x11347e,null));};exports[_0xe110('0x58')]=function(_0x4dc308,_0x13bf0a){return db[_0xe110('0x3d')][_0xe110('0x58')]()[_0xe110('0x11')](respondWithResult(_0x13bf0a,null))['catch'](handleError(_0x13bf0a,null));};exports['addContacts']=function(_0x2b068,_0x182f17){return db[_0xe110('0x3d')]['find']({'where':{'id':_0x2b068[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x182f17,null))['then'](function(_0x3c8981){if(_0x3c8981){return _0x3c8981[_0xe110('0x59')](_0x2b068['body']['ids'],_[_0xe110('0x5a')](_0x2b068['body'],[_0xe110('0x5b'),'id'])||{});}})[_0xe110('0x11')](respondWithResult(_0x182f17,null))[_0xe110('0x1a')](handleError(_0x182f17,null));};function validateUser(_0x33d32c){return new BPromise(function(_0x434523,_0x47534a){if(_0x33d32c[_0xe110('0x5c')])return _0x434523(_0x33d32c);return db[_0xe110('0x5d')]['findById'](0x1)[_0xe110('0x11')](function(_0x4c7dc9){if(_0x4c7dc9[_0xe110('0x5e')])authService['validatePasswordPattern'](_0x33d32c[_0xe110('0x3a')]);db['User']['max'](_0xe110('0x5c'))[_0xe110('0x11')](function(_0x13ea84){if(_[_0xe110('0x5f')](_0x13ea84)){_0x33d32c[_0xe110('0x5c')]=_0x4c7dc9['min_internal']||0x1;return;}if(_[_0xe110('0x5f')](_0x4c7dc9[_0xe110('0x60')])||_0x4c7dc9[_0xe110('0x60')]===_0x13ea84){_0x33d32c['internal']=_0x13ea84+0x1;return;}if(_0x4c7dc9[_0xe110('0x60')]>_0x13ea84){_0x33d32c[_0xe110('0x5c')]=_0x4c7dc9[_0xe110('0x60')];return;}return db[_0xe110('0x61')][_0xe110('0x43')]('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[_0xe110('0x61')][_0xe110('0x62')][_0xe110('0x63')]})[_0xe110('0x11')](function(_0x2962eb){if(_0x2962eb&&_0x2962eb['length']){for(var _0x53d5e3=0x0,_0x166074=_0x2962eb[_0xe110('0x45')];_0x53d5e3<_0x166074&&_['isNil'](_0x33d32c['internal']);_0x53d5e3++){if(_0x4c7dc9['min_internal']<=_0x2962eb[_0x53d5e3][_0xe110('0x64')]){_0x33d32c[_0xe110('0x5c')]=_0x2962eb[_0x53d5e3][_0xe110('0x64')];}else if(_0x4c7dc9[_0xe110('0x60')]>_0x2962eb[_0x53d5e3][_0xe110('0x64')]&&_0x4c7dc9[_0xe110('0x60')]<=_0x2962eb[_0x53d5e3]['to']){_0x33d32c['internal']=_0x4c7dc9['min_internal'];}}}if(_[_0xe110('0x5f')](_0x33d32c[_0xe110('0x5c')])){_0x33d32c[_0xe110('0x5c')]=_0x13ea84+0x1;}return _0x434523(_0x33d32c);});});})[_0xe110('0x1a')](function(_0x2c339c){_0x47534a(_0x2c339c);});});}function updateUser(_0x1fdca4){return new BPromise(function(_0x581cca,_0x153f13){try{if(_0x1fdca4[_0xe110('0x65')]){_0x1fdca4['mailbox']=_0x1fdca4[_0xe110('0x5c')];_0x1fdca4['VoiceMail']={'mailbox':_0x1fdca4[_0xe110('0x5c')],'password':_0x1fdca4[_0xe110('0x3a')],'fullname':_0x1fdca4['fullname'],'email':_0x1fdca4[_0xe110('0x66')]};}if(_0x1fdca4['role']===_0xe110('0x2a')){if(!_0x1fdca4[_0xe110('0x67')])_0x1fdca4[_0xe110('0x67')]=[_0xe110('0x68'),_0xe110('0x69'),_0xe110('0x6a'),'113',_0xe110('0x6b'),_0xe110('0x6c'),'105',_0xe110('0x6d'),_0xe110('0x6e'),_0xe110('0x6f'),'109',_0xe110('0x70'),'111',_0xe110('0x71'),_0xe110('0x72')];}_0x581cca(_0x1fdca4);}catch(_0x37616d){_0x153f13(_0x37616d);}});}exports[_0xe110('0x73')]=function(_0x17fee0,_0x4e7762){if(_0x17fee0['user'][_0xe110('0x30')]===_0xe110('0x2a'))throw new Error(_0xe110('0x74'));if(_0x17fee0[_0xe110('0x57')][_0xe110('0x30')]==='user'&&_0x17fee0[_0xe110('0x75')]['role']!==_0xe110('0x27')){throw new Error(_0xe110('0x76'));}if(_0x17fee0[_0xe110('0x57')][_0xe110('0x30')]===_0xe110('0x27')&&_0x17fee0[_0xe110('0x75')][_0xe110('0x30')]!=='admin'){throw new Error(_0xe110('0x77'));}return licenseUtil[_0xe110('0x78')]([_0x17fee0[_0xe110('0x57')]])['then'](function(){return validateUser(_0x17fee0[_0xe110('0x57')]);})[_0xe110('0x11')](function(_0x440dfe){return updateUser(_0x440dfe)[_0xe110('0x11')](function(_0x3704ff){if(_0x3704ff[_0xe110('0x30')]===_0xe110('0x27')){_0x3704ff[_0xe110('0x79')]=_0x17fee0[_0xe110('0x75')]['settingsEnabled'];delete _0x3704ff[_0xe110('0x7a')];}return _0x3704ff;});})[_0xe110('0x11')](function(_0x1ba508){return db[_0xe110('0x3d')][_0xe110('0x73')](_0x1ba508,{'include':[{'model':db[_0xe110('0x7b')],'as':_0xe110('0x7b')}]});})[_0xe110('0x11')](function(_0x5d32d6){if(_0x17fee0['body'][_0xe110('0x30')]==='user')return _0x5d32d6;if(_0x17fee0[_0xe110('0x75')][_0xe110('0x30')]!=='user')return _0x5d32d6;return db[_0xe110('0x7c')][_0xe110('0x31')]({'where':{'name':_0x5d32d6['role']===_0xe110('0x2a')?_0xe110('0x29'):_0xe110('0x2b'),'userProfileId':_0x17fee0['user'][_0xe110('0x7a')]},'raw':!![]})[_0xe110('0x11')](function(_0x9c02d4){if(!_0x9c02d4||_0x9c02d4['autoAssociation']!=0x0)return _0x5d32d6;return db[_0xe110('0x7d')][_0xe110('0x73')]({'name':_0x5d32d6['name'],'resourceId':_0x5d32d6['id'],'type':_0x9c02d4[_0xe110('0x32')],'sectionId':_0x9c02d4['id']},{})[_0xe110('0x11')](function(){return _0x5d32d6;});})[_0xe110('0x1a')](function(_0x3270dd){logger['error'](_0xe110('0x7e'),_0x3270dd);throw _0x3270dd;});})['then'](respondWithResult(_0x4e7762,0xc9))['catch'](handleError(_0x4e7762,null));};exports['bulkCreate']=function(_0x1176f2,_0x393671){var _0xde155e=_0x1176f2['body'];var _0x49a429=[];if(_0x1176f2[_0xe110('0x75')][_0xe110('0x30')]===_0xe110('0x2a'))throw new Error('Unauthorized');if(_[_0xe110('0x7f')](_0xde155e,[_0xe110('0x30'),_0xe110('0x75')])&&_0x1176f2[_0xe110('0x75')]['role']!==_0xe110('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0xde155e,[_0xe110('0x30'),_0xe110('0x27')])&&_0x1176f2[_0xe110('0x75')][_0xe110('0x30')]!==_0xe110('0x27')){throw new Error(_0xe110('0x80'));}return licenseUtil[_0xe110('0x78')](_0xde155e)[_0xe110('0x11')](function(){return validateUser(_0xde155e[0x0]);})[_0xe110('0x11')](function(){for(var _0x2abf29=0x1;_0x2abf29<_0xde155e[_0xe110('0x45')];_0x2abf29++){var _0x46c475=_0xde155e[_0x2abf29-0x1][_0xe110('0x5c')];if(!_0xde155e[_0x2abf29]['internal'])_0xde155e[_0x2abf29][_0xe110('0x5c')]=_0x46c475+0x1;_0x49a429['push'](validateUser(_0xde155e[_0x2abf29]));}return BPromise[_0xe110('0x4b')](_0x49a429);})[_0xe110('0x11')](function(){_0x49a429=[];for(var _0x29f3f8=0x0;_0x29f3f8<_0xde155e['length'];_0x29f3f8++){_0x49a429['push'](updateUser(_0xde155e[_0x29f3f8]));}return BPromise['all'](_0x49a429);})[_0xe110('0x11')](function(){return BPromise[_0xe110('0x81')](_0xde155e,function(_0x5c31de){return db[_0xe110('0x3d')][_0xe110('0x73')](_0x5c31de,{'include':[{'model':db[_0xe110('0x7b')],'as':_0xe110('0x7b')}]})['then'](function(_0x553289){_0x5c31de['id']=_0x553289['id'];return _0x5c31de;});});})['then'](function(_0x85d383){if(_0x1176f2[_0xe110('0x57')][_0xe110('0x30')]==='user')return _0x85d383;if(_0x1176f2[_0xe110('0x75')][_0xe110('0x30')]!==_0xe110('0x75'))return _0x85d383;var _0x33892c=_[_0xe110('0x7f')](_0x85d383,function(_0x3c7917){return _0x3c7917[_0xe110('0x30')]==='agent'||_0x3c7917[_0xe110('0x30')]===_0xe110('0x82');});if(!_0x33892c)return _0x85d383;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0xe110('0x29'),_0xe110('0x2b')]},'userProfileId':_0x1176f2[_0xe110('0x75')][_0xe110('0x7a')]},'raw':!![]})[_0xe110('0x11')](function(_0x8e1add){if(_[_0xe110('0x83')](_0x8e1add)||!_[_0xe110('0x7f')](_0x8e1add,[_0xe110('0x84'),0x0]))return _0x85d383;_0x49a429=[];var _0x6bf794=_(_0x8e1add)[_0xe110('0x2d')](function(_0x5c3459){if(_0x5c3459[_0xe110('0x84')]===0x1)return;return _0x5c3459[_0xe110('0x32')]===_0xe110('0x29')?_0xe110('0x2a'):_0xe110('0x82');})[_0xe110('0x85')]()['value']();for(var _0x11f740=0x0;_0x11f740<_0x85d383[_0xe110('0x45')];_0x11f740++){if(!_[_0xe110('0x2f')](_0x6bf794,_0x85d383[_0x11f740]['role']))return;var _0x305d91=_0x85d383[_0x11f740][_0xe110('0x30')]===_0xe110('0x2a')?'Agents':'Telephones';_0x49a429['push'](db[_0xe110('0x7d')][_0xe110('0x73')]({'name':_0x85d383[_0x11f740][_0xe110('0x32')],'resourceId':_0x85d383[_0x11f740]['id'],'type':_0x305d91,'sectionId':_['find'](_0x8e1add,['name',_0x305d91])['id']},{}));}return BPromise['all'](_0x49a429);});})[_0xe110('0x11')](respondWithResult(_0x393671,0xc9))[_0xe110('0x1a')](handleError(_0x393671,null));};exports[_0xe110('0x86')]=function(_0x4bf9da,_0x5be5dd){if(_0x4bf9da[_0xe110('0x57')]['id']){delete _0x4bf9da[_0xe110('0x57')]['id'];}return db['User']['find']({'where':{'id':_0x4bf9da[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](function(_0x5262c6){if(!_0x5262c6)return null;if(_0x5262c6['id']===_0x4bf9da[_0xe110('0x75')]['id']){if(!_0x4bf9da[_0xe110('0x57')][_0xe110('0x87')]||!_0x4bf9da[_0xe110('0x57')][_0xe110('0x88')]){throw new db['Sequelize'][(_0xe110('0x89'))](_0xe110('0x8a'));}if(!_0x5262c6[_0xe110('0x8b')](_0x4bf9da[_0xe110('0x57')][_0xe110('0x87')])){throw new db['Sequelize']['ValidationError'](_0xe110('0x8c'));}if(_0x4bf9da[_0xe110('0x57')][_0xe110('0x87')]===_0x4bf9da[_0xe110('0x57')][_0xe110('0x88')]){throw new db[(_0xe110('0x8d'))][(_0xe110('0x89'))](_0xe110('0x8e'));}}else if(_0x4bf9da[_0xe110('0x75')][_0xe110('0x30')]===_0xe110('0x27')){if(!_0x4bf9da[_0xe110('0x57')][_0xe110('0x88')]){throw new db[(_0xe110('0x8d'))][(_0xe110('0x89'))](_0xe110('0x8f'));}}else if(_0x4bf9da[_0xe110('0x75')][_0xe110('0x30')]===_0xe110('0x75')){if(!_0x4bf9da['body'][_0xe110('0x88')]){throw new db[(_0xe110('0x8d'))]['ValidationError'](_0xe110('0x8f'));}if(_0x5262c6['role']!=='agent'){throw new db[(_0xe110('0x8d'))][(_0xe110('0x89'))](_0xe110('0x74'));}}else{throw new db[(_0xe110('0x8d'))][(_0xe110('0x89'))](_0xe110('0x74'));}return _0x5262c6;})[_0xe110('0x11')](handleEntityNotFound(_0x5be5dd,null))['then'](function(_0x50c40f){return db[_0xe110('0x5d')][_0xe110('0x90')]({'attributes':['id','securePassword',_0xe110('0x91'),_0xe110('0x92')]})[_0xe110('0x11')](function(_0x26d3d6){if(_0x26d3d6[_0xe110('0x5e')])authService[_0xe110('0x93')](_0x4bf9da['body']['newPassword']);if(!_0x26d3d6['enforcePasswordHistory']||!_0x50c40f[_0xe110('0x94')])return _0x50c40f;authService['validatePasswordHistory'](_0x4bf9da[_0xe110('0x57')]['newPassword'],_0x50c40f['previousPasswords'],_0x26d3d6[_0xe110('0x92')]);return _0x50c40f;})[_0xe110('0x11')](saveUpdates({'password':_0x4bf9da[_0xe110('0x57')]['newPassword'],'passwordResetAt':_0x4bf9da['user']['id']==_0x4bf9da[_0xe110('0x4d')]['id']?moment():null,'previousPasswords':authService[_0xe110('0x95')](_0x4bf9da['body'][_0xe110('0x88')],_0x50c40f[_0xe110('0x94')])},null));})[_0xe110('0x11')](respondWithResult(_0x5be5dd,null))[_0xe110('0x1a')](handleError(_0x5be5dd,null));};exports[_0xe110('0x96')]=function(_0x28d3a7,_0x14c0d2){var _0x2ac319=_0x28d3a7['body']['channel'];return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x28d3a7[_0xe110('0x4d')]['id']},'attributes':['id',_0xe110('0x32'),'role',_0xe110('0x97'),_0xe110('0x98'),'voicePause',_0xe110('0x99')]})[_0xe110('0x11')](handleEntityNotFound(_0x14c0d2,null))[_0xe110('0x11')](function(_0x33010b){if(_0x33010b){if(!utils[_0xe110('0x9a')](_0x2ac319)){throw new db[(_0xe110('0x8d'))][(_0xe110('0x89'))](_0xe110('0x9b'));}return _0x33010b[_0xe110('0x9c')+_[_0xe110('0x9d')](_0x2ac319[_0xe110('0x9e')]())+'Queues'](_0x28d3a7[_0xe110('0x57')][_0xe110('0x5b')],{'penalty':_0x28d3a7[_0xe110('0x57')]['penalty']||0x0})[_0xe110('0x9f')](function(_0x3f587e){for(var _0x33c4fa=0x0;_0x33c4fa<_0x28d3a7[_0xe110('0x57')][_0xe110('0x5b')][_0xe110('0x45')];_0x33c4fa+=0x1){var _0x3e23d8={'UserId':Number(_0x28d3a7[_0xe110('0x4d')]['id'])};_0x3e23d8[_['capitalize'](_0x2ac319[_0xe110('0x9e')]())+_0xe110('0xa0')]=Number(_0x28d3a7[_0xe110('0x57')]['ids'][_0x33c4fa]);socket[_0xe110('0xa1')](_0xe110('0x75')+_[_0xe110('0x9d')](_0x2ac319[_0xe110('0x9e')]())+_0xe110('0xa2'),_0x3e23d8);}return _0x3f587e;})[_0xe110('0x11')](function(){if(_0x2ac319===_0xe110('0xa3')){return db[_0xe110('0xa4')][_0xe110('0x41')]({'where':{'id':_0x28d3a7[_0xe110('0x57')][_0xe110('0x5b')]||[]},'raw':!![],'attributes':['id',_0xe110('0x32')]});}})[_0xe110('0x11')](function(_0x2da2e2){var _0x3cc323=_0x33010b[_0xe110('0x26')]({'plain':!![]});var _0x320575=[];if(_0x2ac319==='voice'&&_0x3cc323['role']===_0xe110('0x2a')&&_0x3cc323[_0xe110('0x97')]){for(var _0x133d4f=0x0;_0x133d4f<_0x2da2e2['length'];_0x133d4f+=0x1){_0x320575[_0xe110('0x40')]({'membername':_0x3cc323[_0xe110('0x32')],'UserId':_0x3cc323['id'],'queue_name':_0x2da2e2[_0x133d4f][_0xe110('0x32')],'VoiceQueueId':_0x2da2e2[_0x133d4f]['id'],'interface':_[_0xe110('0x5f')](_0x3cc323[_0xe110('0x99')])?util[_0xe110('0xa5')](_0xe110('0xa6'),_0x3cc323[_0xe110('0x32')]):_0x3cc323[_0xe110('0x99')],'paused':_0x3cc323['voicePause']||![],'penalty':_0x28d3a7[_0xe110('0x57')][_0xe110('0xa7')]||0x0});}return BPromise[_0xe110('0x81')](_0x320575,function(_0x44e8b4){return db[_0xe110('0xa8')][_0xe110('0xa9')](_0x44e8b4);});}return _0x33010b;});}})[_0xe110('0x11')](respondWithStatusCode(_0x14c0d2,null))[_0xe110('0x1a')](handleError(_0x14c0d2,null));};exports[_0xe110('0xaa')]=function(_0x313eb5,_0x3bb611){var _0x1aec7f;return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x313eb5[_0xe110('0x4d')]['id']},'attributes':['id',_0xe110('0x32'),_0xe110('0x30')]})[_0xe110('0x11')](handleEntityNotFound(_0x3bb611,null))['then'](function(_0x1285ed){if(_0x1285ed){_0x1aec7f=_0x1285ed;if(!_0x313eb5[_0xe110('0x43')][_0xe110('0xab')]||!utils[_0xe110('0x9a')](_0x313eb5[_0xe110('0x43')][_0xe110('0xab')])){throw new db[(_0xe110('0x8d'))]['ValidationError'](_0xe110('0x9b'));}return _0x1285ed['remove'+_[_0xe110('0x9d')](_0x313eb5['query'][_0xe110('0xab')][_0xe110('0x9e')]())+_0xe110('0xac')](_0x313eb5[_0xe110('0x43')][_0xe110('0x5b')]);}})['then'](function(_0x5c7d3f){if(_[_0xe110('0xad')](_0x313eb5[_0xe110('0x43')][_0xe110('0x5b')])){for(var _0x31b665=0x0;_0x31b665<_0x313eb5[_0xe110('0x43')]['ids']['length'];_0x31b665+=0x1){var _0x48dc4a={'UserId':Number(_0x313eb5[_0xe110('0x4d')]['id'])};_0x48dc4a[_[_0xe110('0x9d')](_0x313eb5[_0xe110('0x43')][_0xe110('0xab')][_0xe110('0x9e')]())+_0xe110('0xa0')]=Number(_0x313eb5[_0xe110('0x43')][_0xe110('0x5b')][_0x31b665]);socket[_0xe110('0xa1')](_0xe110('0x75')+_[_0xe110('0x9d')](_0x313eb5[_0xe110('0x43')]['channel'][_0xe110('0x9e')]())+_0xe110('0xae'),_0x48dc4a);}}else{var _0x48dc4a={'UserId':Number(_0x313eb5['params']['id'])};_0x48dc4a[_[_0xe110('0x9d')](_0x313eb5['query']['channel']['toLowerCase']())+'QueueId']=Number(_0x313eb5[_0xe110('0x43')][_0xe110('0x5b')]);socket[_0xe110('0xa1')](_0xe110('0x75')+_[_0xe110('0x9d')](_0x313eb5[_0xe110('0x43')][_0xe110('0xab')][_0xe110('0x9e')]())+_0xe110('0xae'),_0x48dc4a);}return _0x5c7d3f;})[_0xe110('0x11')](function(){if(_0x313eb5[_0xe110('0x43')]['channel']==='voice'){return db['UserVoiceQueueRt'][_0xe110('0x25')]({'where':{'UserId':_0x313eb5['params']['id'],'VoiceQueueId':_0x313eb5[_0xe110('0x43')][_0xe110('0x5b')]},'individualHooks':!![]})[_0xe110('0x11')](function(){return _0x1aec7f;});}return _0x1aec7f;})[_0xe110('0x11')](respondWithStatusCode(_0x3bb611,null))[_0xe110('0x1a')](handleError(_0x3bb611,null));};exports['addAvatar']=function(_0x22816c,_0x56bdd1){_0x22816c[_0xe110('0x57')]['userpic']=_0x22816c[_0xe110('0xaf')][_0xe110('0xb0')];return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x22816c[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x56bdd1,null))[_0xe110('0x11')](saveUpdates(_0x22816c[_0xe110('0x57')],null))[_0xe110('0x11')](respondWithResult(_0x56bdd1,null))[_0xe110('0x1a')](handleError(_0x56bdd1,null));};exports[_0xe110('0xb1')]=function(_0x131699,_0x5642b6){var _0x533bcf=path[_0xe110('0xb2')](config['root'],_0xe110('0xb3'));return db[_0xe110('0x3d')]['find']({'where':{'id':_0x131699['params']['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x5642b6,null))[_0xe110('0x11')](function(_0x2633a5){if(_0x2633a5){if(_[_0xe110('0x5f')](_0x2633a5[_0xe110('0xb4')])){return _0x5642b6[_0xe110('0xb5')](_0x533bcf);}else{if(!fs[_0xe110('0xb6')](path[_0xe110('0xb2')](config[_0xe110('0xb7')],_0xe110('0xb8'),_0x2633a5[_0xe110('0xb4')]))){return _0x5642b6['download'](_0x533bcf);}return _0x5642b6[_0xe110('0xb5')](path[_0xe110('0xb2')](config[_0xe110('0xb7')],'server/files/images/',_0x2633a5[_0xe110('0xb4')]));}}})[_0xe110('0x1a')](handleError(_0x5642b6,null));};exports[_0xe110('0xb9')]=function(_0x5a5aca,_0x459bcb){return db['User'][_0xe110('0x31')]({'where':{'id':_0x5a5aca['params']['id']},'attributes':['id']})[_0xe110('0x11')](handleEntityNotFound(_0x459bcb,null))[_0xe110('0x11')](function(_0x5786c4){var _0x4eaca1=[];values=_0x5786c4[_0xe110('0x46')];_0x4eaca1[_0xe110('0x40')](get_open_tabs(_0xe110('0xba'),_0x5786c4[_0xe110('0x46')]));_0x4eaca1[_0xe110('0x40')](get_open_tabs(_0xe110('0x47'),_0x5786c4[_0xe110('0x46')]));_0x4eaca1[_0xe110('0x40')](get_open_tabs(_0xe110('0x49'),_0x5786c4[_0xe110('0x46')]));_0x4eaca1[_0xe110('0x40')](get_open_tabs(_0xe110('0x4a'),_0x5786c4[_0xe110('0x46')]));_0x4eaca1['push'](get_open_tabs(_0xe110('0x56'),_0x5786c4[_0xe110('0x46')]));_0x4eaca1[_0xe110('0x40')](get_open_tabs('mail',_0x5786c4[_0xe110('0x46')]));return BPromise['all'](_0x4eaca1);})[_0xe110('0x11')](function(_0x3b83b1){var _0x2f044e=[];if(_0x3b83b1){for(var _0x1fc646=0x0;_0x1fc646<values[_0xe110('0xbb')][_0xe110('0x45')];_0x1fc646++){var _0x42a745=values[_0xe110('0xbb')][_0x1fc646];_0x2f044e[_0xe110('0x40')]({'channel':_0xe110('0xbc'),'id':_0x42a745['id'],'createdAt':_0x42a745[_0xe110('0xbd')]});}for(var _0x1fc646=0x0;_0x1fc646<values[_0xe110('0xbe')][_0xe110('0x45')];_0x1fc646++){var _0x42a745=values[_0xe110('0xbe')][_0x1fc646];_0x2f044e[_0xe110('0x40')]({'channel':_0xe110('0xbf'),'id':_0x42a745['id'],'createdAt':_0x42a745[_0xe110('0xbd')]});}for(var _0x1fc646=0x0;_0x1fc646<values[_0xe110('0xc0')]['length'];_0x1fc646++){var _0x42a745=values['OpenchannelOpenTabs'][_0x1fc646];_0x2f044e[_0xe110('0x40')]({'channel':_0xe110('0xc1'),'id':_0x42a745['id'],'createdAt':_0x42a745[_0xe110('0xbd')]});}for(var _0x1fc646=0x0;_0x1fc646<values['MailOpenTabs'][_0xe110('0x45')];_0x1fc646++){var _0x42a745=values[_0xe110('0xc2')][_0x1fc646];_0x2f044e[_0xe110('0x40')]({'channel':_0xe110('0xc3'),'id':_0x42a745['id'],'createdAt':_0x42a745['createdAt']});}for(var _0x1fc646=0x0;_0x1fc646<values['SmsOpenTabs'][_0xe110('0x45')];_0x1fc646++){var _0x42a745=values[_0xe110('0xc4')][_0x1fc646];_0x2f044e[_0xe110('0x40')]({'channel':_0xe110('0xc5'),'id':_0x42a745['id'],'createdAt':_0x42a745[_0xe110('0xbd')]});}for(var _0x1fc646=0x0;_0x1fc646<values[_0xe110('0xc6')][_0xe110('0x45')];_0x1fc646++){var _0x42a745=values['WhatsappOpenTabs'][_0x1fc646];_0x2f044e[_0xe110('0x40')]({'channel':_0xe110('0xc7'),'id':_0x42a745['id'],'createdAt':_0x42a745[_0xe110('0xbd')]});}var _0x58ecb4={'count':_0x2f044e['length'],'rows':_0x2f044e};return _0x58ecb4;}else return null;})[_0xe110('0x11')](respondWithResult(_0x459bcb,null))[_0xe110('0x1a')](handleError(_0x459bcb,null));};exports[_0xe110('0xc8')]=function(_0x56d5f,_0x302b90){var _0x5355a3={};var _0x4d940f={};var _0x328430;var _0x4c770c;return db[_0xe110('0x3d')][_0xe110('0x90')]({'where':{'id':_0x56d5f['params']['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x302b90,null))[_0xe110('0x11')](function(_0x39ea31){if(_0x39ea31){_0x328430=_0x39ea31;_0x4d940f['model']=_[_0xe110('0x50')](db[_0xe110('0xc9')]['rawAttributes']);_0x4d940f[_0xe110('0x43')]=_[_0xe110('0x50')](_0x56d5f['query']);_0x4d940f[_0xe110('0x51')]=_[_0xe110('0xca')](_0x4d940f[_0xe110('0x4e')],_0x4d940f[_0xe110('0x43')]);_0x5355a3[_0xe110('0x3f')]=_[_0xe110('0xca')](_0x4d940f['model'],qs[_0xe110('0x52')](_0x56d5f[_0xe110('0x43')][_0xe110('0x52')]));_0x5355a3[_0xe110('0x3f')]=_0x5355a3[_0xe110('0x3f')]['length']?_0x5355a3[_0xe110('0x3f')]:_0x4d940f[_0xe110('0x4e')];_0x5355a3[_0xe110('0xcb')]=qs[_0xe110('0xcc')](_0x56d5f['query'][_0xe110('0xcc')]);_0x5355a3[_0xe110('0x3c')]=qs[_0xe110('0x51')](_['pick'](_0x56d5f['query'],_0x4d940f[_0xe110('0x51')]));if(_0x56d5f['query']['filter']){_0x5355a3[_0xe110('0x3c')]=_['merge'](_0x5355a3['where'],{'$or':_[_0xe110('0x2d')](_0x5355a3[_0xe110('0x3f')],function(_0x59448c){var _0x244448={};_0x244448[_0x59448c]={'$like':'%'+_0x56d5f[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x244448;})});}_0x5355a3=_['merge']({},_0x5355a3,_0x56d5f[_0xe110('0xcd')]);return _0x328430['getContacts'](_0x5355a3);}})[_0xe110('0x11')](function(_0x5dff76){if(_0x5dff76){_0x4c770c=_0x5dff76[_0xe110('0x45')];if(_0x56d5f['query']['hasOwnProperty']('includeAll')){_0x5355a3[_0xe110('0x3e')]=[{'model':db[_0xe110('0xce')],'as':_0xe110('0xcf'),'required':![]},{'model':db[_0xe110('0xd0')],'as':'Tags','attributes':['id',_0xe110('0x32'),_0xe110('0xd1')],'where':_0x56d5f['query'][_0xe110('0xd2')]?{'id':_0x56d5f[_0xe110('0x43')][_0xe110('0xd2')]}:undefined,'required':_0x56d5f[_0xe110('0x43')]['tag']?!![]:![]}];}if(!_0x56d5f[_0xe110('0x43')][_0xe110('0xd3')](_0xe110('0xd4'))){_0x5355a3['limit']=qs[_0xe110('0x21')](_0x56d5f[_0xe110('0x43')][_0xe110('0x21')]);_0x5355a3['offset']=qs[_0xe110('0x1f')](_0x56d5f['query'][_0xe110('0x1f')]);}return _0x328430[_0xe110('0xc8')](_0x5355a3);}})[_0xe110('0x11')](function(_0x34df46){if(_0x34df46){return _0x34df46?{'count':_0x4c770c,'rows':_0x34df46}:null;}})[_0xe110('0x11')](respondWithResult(_0x302b90,null))[_0xe110('0x1a')](handleError(_0x302b90,null));};exports['getQueues']=function(_0x4e0b25,_0x5178a9){var _0x3d6758;var _0x54913f;var _0x2e18f8={};var _0x1e14f0;return db['User'][_0xe110('0x90')]({'where':{'id':_0x4e0b25[_0xe110('0x4d')]['id']},'attributes':['id',_0xe110('0x32'),'role']})[_0xe110('0x11')](handleEntityNotFound(_0x5178a9,null))[_0xe110('0x11')](function(_0x556764){if(!utils['isValidChannel'](_0x4e0b25[_0xe110('0x43')]['channel'])){throw new db['Sequelize']['ValidationError'](_0xe110('0x9b'));}_0x3d6758=_0x556764;var _0x3561fe={};_0x3561fe[_0xe110('0x4e')]=_[_0xe110('0x50')](db[_['capitalize'](_0x4e0b25['query'][_0xe110('0xab')])+_0xe110('0xd5')]['rawAttributes']);_0x3561fe[_0xe110('0x43')]=_[_0xe110('0x50')](_0x4e0b25[_0xe110('0x43')]);_0x3561fe['filters']=_[_0xe110('0xca')](_0x3561fe[_0xe110('0x4e')],_0x3561fe[_0xe110('0x43')]);_0x2e18f8[_0xe110('0x3f')]=_['intersection'](_0x3561fe[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x4e0b25[_0xe110('0x43')][_0xe110('0x52')]));_0x2e18f8[_0xe110('0x3f')]=_0x2e18f8[_0xe110('0x3f')][_0xe110('0x45')]?_0x2e18f8[_0xe110('0x3f')]:_0x3561fe[_0xe110('0x4e')];_0x2e18f8['order']=qs['sort'](_0x4e0b25[_0xe110('0x43')][_0xe110('0xcc')]);_0x2e18f8[_0xe110('0x3c')]=qs['filters'](_[_0xe110('0xd6')](_0x4e0b25['query'],_0x3561fe[_0xe110('0x51')]));if(_0x4e0b25[_0xe110('0x43')][_0xe110('0x39')]){_0x2e18f8[_0xe110('0x3c')]=_[_0xe110('0x54')](_0x2e18f8[_0xe110('0x3c')],{'$or':_['map'](_0x2e18f8[_0xe110('0x3f')],function(_0x3d79bd){var _0x44ba5f={};_0x44ba5f[_0x3d79bd]={'$like':'%'+_0x4e0b25[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x44ba5f;})});}_0x2e18f8=_[_0xe110('0x54')]({},_0x2e18f8,_0x4e0b25[_0xe110('0xcd')]);switch(_0x3d6758[_0xe110('0x30')]){case'admin':return db[_[_0xe110('0x9d')](_0x4e0b25['query'][_0xe110('0xab')])+'Queue'][_0xe110('0x41')](_0x2e18f8);case _0xe110('0x75'):case'agent':return _0x3d6758['get'+_[_0xe110('0x9d')](_0x4e0b25[_0xe110('0x43')]['channel'])+_0xe110('0xac')](_0x2e18f8);default:throw new db[(_0xe110('0x8d'))]['ValidationError'](_0xe110('0xd7'));}})['then'](function(_0x2246ae){_0x1e14f0=_0x2246ae[_0xe110('0x45')];if(!_0x4e0b25['query'][_0xe110('0xd3')](_0xe110('0xd4'))){_0x2e18f8['limit']=qs[_0xe110('0x21')](_0x4e0b25[_0xe110('0x43')][_0xe110('0x21')]);_0x2e18f8['offset']=qs['offset'](_0x4e0b25[_0xe110('0x43')][_0xe110('0x1f')]);}switch(_0x3d6758[_0xe110('0x30')]){case _0xe110('0x27'):return db[_[_0xe110('0x9d')](_0x4e0b25[_0xe110('0x43')][_0xe110('0xab')])+_0xe110('0xd5')][_0xe110('0x41')](_0x2e18f8);case _0xe110('0x75'):case'agent':return _0x3d6758[_0xe110('0x26')+_[_0xe110('0x9d')](_0x4e0b25[_0xe110('0x43')][_0xe110('0xab')])+'Queues'](_0x2e18f8);}})[_0xe110('0x11')](function(_0xdb75ee){return{'count':_0x1e14f0,'rows':_0xdb75ee};})[_0xe110('0x11')](respondWithResult(_0x5178a9,null))[_0xe110('0x1a')](handleError(_0x5178a9,null));};exports[_0xe110('0xd8')]=function(_0x18c09e,_0x50bbba){var _0xeb9a19={};var _0x380c47={};var _0x285690;var _0x1ecdad;return db['User']['findOne']({'where':{'id':_0x18c09e[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x50bbba,null))[_0xe110('0x11')](function(_0x3c13fb){if(_0x3c13fb){_0x285690=_0x3c13fb;_0x380c47[_0xe110('0x4e')]=_['keys'](db[_0xe110('0xa8')][_0xe110('0x35')]);_0x380c47[_0xe110('0x43')]=_['keys'](_0x18c09e[_0xe110('0x43')]);_0x380c47[_0xe110('0x51')]=_[_0xe110('0xca')](_0x380c47[_0xe110('0x4e')],_0x380c47['query']);_0xeb9a19['attributes']=_[_0xe110('0xca')](_0x380c47[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x18c09e[_0xe110('0x43')][_0xe110('0x52')]));_0xeb9a19[_0xe110('0x3f')]=_0xeb9a19['attributes'][_0xe110('0x45')]?_0xeb9a19['attributes']:_0x380c47[_0xe110('0x4e')];_0xeb9a19[_0xe110('0xcb')]=qs[_0xe110('0xcc')](_0x18c09e[_0xe110('0x43')]['sort']);_0xeb9a19[_0xe110('0x3c')]=qs[_0xe110('0x51')](_[_0xe110('0xd6')](_0x18c09e[_0xe110('0x43')],_0x380c47[_0xe110('0x51')]));if(_0x18c09e[_0xe110('0x43')]['filter']){_0xeb9a19['where']=_['merge'](_0xeb9a19[_0xe110('0x3c')],{'$or':_[_0xe110('0x2d')](_0xeb9a19[_0xe110('0x3f')],function(_0x40f1b6){var _0x5652be={};_0x5652be[_0x40f1b6]={'$like':'%'+_0x18c09e[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x5652be;})});}_0xeb9a19=_[_0xe110('0x54')]({},_0xeb9a19,_0x18c09e['options']);return _0x285690['getVoiceQueuesRt'](_0xeb9a19);}})[_0xe110('0x11')](function(_0x1b48ad){if(_0x1b48ad){_0x1ecdad=_0x1b48ad[_0xe110('0x45')];if(!_0x18c09e[_0xe110('0x43')][_0xe110('0xd3')](_0xe110('0xd4'))){_0xeb9a19[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x18c09e[_0xe110('0x43')][_0xe110('0x21')]);_0xeb9a19[_0xe110('0x1f')]=qs[_0xe110('0x1f')](_0x18c09e[_0xe110('0x43')][_0xe110('0x1f')]);}return _0x285690[_0xe110('0xd8')](_0xeb9a19);}})[_0xe110('0x11')](function(_0x5f4c07){if(_0x5f4c07){return _0x5f4c07?{'count':_0x1ecdad,'rows':_0x5f4c07}:null;}})[_0xe110('0x11')](respondWithResult(_0x50bbba,null))[_0xe110('0x1a')](handleError(_0x50bbba,null));};exports[_0xe110('0xd9')]=function(_0x1abc4e,_0x153a06){var _0xcbd838={};var _0x15f8ef={};var _0x57af2d;var _0x40f97f;return db[_0xe110('0x3d')][_0xe110('0x90')]({'where':{'id':_0x1abc4e[_0xe110('0x4d')]['id']}})['then'](handleEntityNotFound(_0x153a06,null))['then'](function(_0x2b1011){if(_0x2b1011){_0x57af2d=_0x2b1011;_0x15f8ef['model']=_[_0xe110('0x50')](db[_0xe110('0xda')][_0xe110('0x35')]);_0x15f8ef[_0xe110('0x43')]=_[_0xe110('0x50')](_0x1abc4e['query']);_0x15f8ef[_0xe110('0x51')]=_['intersection'](_0x15f8ef['model'],_0x15f8ef[_0xe110('0x43')]);_0xcbd838['attributes']=_[_0xe110('0xca')](_0x15f8ef[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x1abc4e['query'][_0xe110('0x52')]));_0xcbd838[_0xe110('0x3f')]=_0xcbd838[_0xe110('0x3f')][_0xe110('0x45')]?_0xcbd838['attributes']:_0x15f8ef[_0xe110('0x4e')];_0xcbd838['order']=qs[_0xe110('0xcc')](_0x1abc4e[_0xe110('0x43')][_0xe110('0xcc')]);_0xcbd838['where']=qs[_0xe110('0x51')](_[_0xe110('0xd6')](_0x1abc4e[_0xe110('0x43')],_0x15f8ef[_0xe110('0x51')]));if(_0x1abc4e[_0xe110('0x43')]['filter']){_0xcbd838[_0xe110('0x3c')]=_[_0xe110('0x54')](_0xcbd838['where'],{'$or':_[_0xe110('0x2d')](_0xcbd838[_0xe110('0x3f')],function(_0x31dfc6){var _0xea1e52={};_0xea1e52[_0x31dfc6]={'$like':'%'+_0x1abc4e[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0xea1e52;})});}_0xcbd838=_[_0xe110('0x54')]({},_0xcbd838,_0x1abc4e[_0xe110('0xcd')]);return _0x57af2d[_0xe110('0xd9')](_0xcbd838);}})[_0xe110('0x11')](function(_0x504b3b){if(_0x504b3b){_0x40f97f=_0x504b3b[_0xe110('0x45')];if(!_0x1abc4e[_0xe110('0x43')][_0xe110('0xd3')]('nolimit')){_0xcbd838[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x1abc4e[_0xe110('0x43')][_0xe110('0x21')]);_0xcbd838[_0xe110('0x1f')]=qs[_0xe110('0x1f')](_0x1abc4e['query'][_0xe110('0x1f')]);}return _0x57af2d[_0xe110('0xd9')](_0xcbd838);}})[_0xe110('0x11')](function(_0xc5d474){if(_0xc5d474){return _0xc5d474?{'count':_0x40f97f,'rows':_0xc5d474}:null;}})[_0xe110('0x11')](respondWithResult(_0x153a06,null))[_0xe110('0x1a')](handleError(_0x153a06,null));};exports[_0xe110('0xdb')]=function(_0x2d3fae,_0x514c96){var _0x1680d6={'raw':!![],'where':{}};var _0x2b8bec={};var _0x4afb82={'count':0x0,'rows':[]};return db[_0xe110('0x3d')][_0xe110('0x90')]({'where':{'id':_0x2d3fae[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x514c96,null))[_0xe110('0x11')](function(_0x1a3a5e){if(_0x1a3a5e){_0x2b8bec[_0xe110('0x4e')]=_[_0xe110('0x50')](db[_0xe110('0xdc')]['rawAttributes']);_0x2b8bec[_0xe110('0x43')]=_[_0xe110('0x50')](_0x2d3fae[_0xe110('0x43')]);_0x2b8bec[_0xe110('0x51')]=_['intersection'](_0x2b8bec[_0xe110('0x4e')],_0x2b8bec['query']);_0x1680d6['attributes']=_[_0xe110('0xca')](_0x2b8bec[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x2d3fae[_0xe110('0x43')][_0xe110('0x52')]));_0x1680d6['attributes']=_0x1680d6[_0xe110('0x3f')][_0xe110('0x45')]?_0x1680d6[_0xe110('0x3f')]:_0x2b8bec[_0xe110('0x4e')];if(!_0x2d3fae['query'][_0xe110('0xd3')]('nolimit')){_0x1680d6[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x2d3fae['query'][_0xe110('0x21')]);_0x1680d6[_0xe110('0x1f')]=qs[_0xe110('0x1f')](_0x2d3fae[_0xe110('0x43')][_0xe110('0x1f')]);}_0x1680d6[_0xe110('0xcb')]=qs[_0xe110('0xcc')](_0x2d3fae['query']['sort']);_0x1680d6['where']=qs[_0xe110('0x51')](_[_0xe110('0xd6')](_0x2d3fae[_0xe110('0x43')],_0x2b8bec[_0xe110('0x51')]));_0x1680d6['where'][_0xe110('0xdd')]=_0x1a3a5e['id'];if(_0x2d3fae['query']['filter']){_0x1680d6[_0xe110('0x3c')]=_['merge'](_0x1680d6['where'],{'$or':_['map'](_0x1680d6[_0xe110('0x3f')],function(_0x574c07){var _0x49c524={};_0x49c524[_0x574c07]={'$like':'%'+_0x2d3fae[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x49c524;})});}_0x1680d6=_[_0xe110('0x54')]({},_0x1680d6,_0x2d3fae[_0xe110('0xcd')]);return db[_0xe110('0xdc')][_0xe110('0x22')]({'where':_0x1680d6[_0xe110('0x3c')]})[_0xe110('0x11')](function(_0x15d60f){_0x4afb82[_0xe110('0x22')]=_0x15d60f;if(_0x2d3fae[_0xe110('0x43')]['includeAll']){_0x1680d6[_0xe110('0x3e')]=[{'all':!![]}];}return db[_0xe110('0xdc')][_0xe110('0x41')](_0x1680d6);})[_0xe110('0x11')](function(_0x4f0dca){_0x4afb82[_0xe110('0x42')]=_0x4f0dca;return _0x4afb82;});}})[_0xe110('0x11')](respondWithFilteredResult(_0x514c96,_0x1680d6))[_0xe110('0x1a')](handleError(_0x514c96,null));};exports[_0xe110('0xde')]=function(_0x45dc00,_0x135a54){var _0xaa0e04={'raw':!![],'where':{}};var _0x1d1224={};var _0x42350e={'count':0x0,'rows':[]};return db[_0xe110('0x3d')][_0xe110('0x90')]({'where':{'id':_0x45dc00[_0xe110('0x4d')]['id']}})['then'](handleEntityNotFound(_0x135a54,null))[_0xe110('0x11')](function(_0x33b04d){if(_0x33b04d){_0x1d1224['model']=_[_0xe110('0x50')](db[_0xe110('0xdf')]['rawAttributes']);_0x1d1224['query']=_[_0xe110('0x50')](_0x45dc00[_0xe110('0x43')]);_0x1d1224[_0xe110('0x51')]=_[_0xe110('0xca')](_0x1d1224['model'],_0x1d1224[_0xe110('0x43')]);_0xaa0e04['attributes']=_[_0xe110('0xca')](_0x1d1224['model'],qs['fields'](_0x45dc00[_0xe110('0x43')]['fields']));_0xaa0e04[_0xe110('0x3f')]=_0xaa0e04[_0xe110('0x3f')]['length']?_0xaa0e04['attributes']:_0x1d1224['model'];if(!_0x45dc00['query'][_0xe110('0xd3')](_0xe110('0xd4'))){_0xaa0e04[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x45dc00[_0xe110('0x43')][_0xe110('0x21')]);_0xaa0e04[_0xe110('0x1f')]=qs[_0xe110('0x1f')](_0x45dc00['query']['offset']);}_0xaa0e04['order']=qs[_0xe110('0xcc')](_0x45dc00[_0xe110('0x43')]['sort']);_0xaa0e04['where']=qs[_0xe110('0x51')](_['pick'](_0x45dc00['query'],_0x1d1224[_0xe110('0x51')]));_0xaa0e04[_0xe110('0x3c')][_0xe110('0xdd')]=_0x33b04d['id'];if(_0x45dc00['query']['filter']){_0xaa0e04[_0xe110('0x3c')]=_['merge'](_0xaa0e04[_0xe110('0x3c')],{'$or':_['map'](_0xaa0e04[_0xe110('0x3f')],function(_0x1a1513){var _0x3ed2b2={};_0x3ed2b2[_0x1a1513]={'$like':'%'+_0x45dc00['query'][_0xe110('0x39')]+'%'};return _0x3ed2b2;})});}_0xaa0e04=_['merge']({},_0xaa0e04,_0x45dc00[_0xe110('0xcd')]);return db[_0xe110('0xdf')]['count']({'where':_0xaa0e04[_0xe110('0x3c')]})[_0xe110('0x11')](function(_0x2a2741){_0x42350e[_0xe110('0x22')]=_0x2a2741;if(_0x45dc00[_0xe110('0x43')][_0xe110('0x53')]){_0xaa0e04[_0xe110('0x3e')]=[{'all':!![]}];}return db[_0xe110('0xdf')][_0xe110('0x41')](_0xaa0e04);})[_0xe110('0x11')](function(_0x23da50){_0x42350e[_0xe110('0x42')]=_0x23da50;return _0x42350e;});}})['then'](respondWithFilteredResult(_0x135a54,_0xaa0e04))[_0xe110('0x1a')](handleError(_0x135a54,null));};exports[_0xe110('0xe0')]=function(_0x49330f,_0x2f5dd6){var _0x41c4a1={};var _0x2485c2={};var _0x50a53c;var _0x466231;return db[_0xe110('0x3d')][_0xe110('0x90')]({'where':{'id':_0x49330f[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x2f5dd6,null))[_0xe110('0x11')](function(_0x3eefcc){if(_0x3eefcc){_0x50a53c=_0x3eefcc;_0x2485c2[_0xe110('0x4e')]=_[_0xe110('0x50')](db['ChatInteraction']['rawAttributes']);_0x2485c2[_0xe110('0x43')]=_[_0xe110('0x50')](_0x49330f[_0xe110('0x43')]);_0x2485c2[_0xe110('0x51')]=_[_0xe110('0xca')](_0x2485c2[_0xe110('0x4e')],_0x2485c2['query']);_0x41c4a1[_0xe110('0x3f')]=_['intersection'](_0x2485c2[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x49330f[_0xe110('0x43')][_0xe110('0x52')]));_0x41c4a1[_0xe110('0x3f')]=_0x41c4a1[_0xe110('0x3f')][_0xe110('0x45')]?_0x41c4a1[_0xe110('0x3f')]:_0x2485c2[_0xe110('0x4e')];_0x41c4a1[_0xe110('0xcb')]=qs[_0xe110('0xcc')](_0x49330f[_0xe110('0x43')][_0xe110('0xcc')]);_0x41c4a1['where']=qs[_0xe110('0x51')](_['pick'](_0x49330f['query'],_0x2485c2['filters']));if(_0x49330f[_0xe110('0x43')]['filter']){_0x41c4a1[_0xe110('0x3c')]=_[_0xe110('0x54')](_0x41c4a1[_0xe110('0x3c')],{'$or':_[_0xe110('0x2d')](_0x41c4a1[_0xe110('0x3f')],function(_0x569de2){var _0x589658={};_0x589658[_0x569de2]={'$like':'%'+_0x49330f['query']['filter']+'%'};return _0x589658;})});}_0x41c4a1=_['merge']({},_0x41c4a1,_0x49330f[_0xe110('0xcd')]);return _0x50a53c[_0xe110('0xe0')](_0x41c4a1);}})['then'](function(_0x34d00e){if(_0x34d00e){_0x466231=_0x34d00e[_0xe110('0x45')];if(!_0x49330f[_0xe110('0x43')]['hasOwnProperty'](_0xe110('0xd4'))){_0x41c4a1[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x49330f[_0xe110('0x43')][_0xe110('0x21')]);_0x41c4a1[_0xe110('0x1f')]=qs[_0xe110('0x1f')](_0x49330f[_0xe110('0x43')][_0xe110('0x1f')]);}return _0x50a53c[_0xe110('0xe0')](_0x41c4a1);}})['then'](function(_0x216545){if(_0x216545){return _0x216545?{'count':_0x466231,'rows':_0x216545}:null;}})[_0xe110('0x11')](respondWithResult(_0x2f5dd6,null))[_0xe110('0x1a')](handleError(_0x2f5dd6,null));};exports[_0xe110('0xe1')]=function(_0x4c8f93,_0x5abaf4){var _0x42faf7={};var _0x44d8df={};var _0x1d2154;var _0x454ca8;return db[_0xe110('0x3d')][_0xe110('0x90')]({'where':{'id':_0x4c8f93['params']['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x5abaf4,null))[_0xe110('0x11')](function(_0x52b250){if(_0x52b250){_0x1d2154=_0x52b250;_0x44d8df[_0xe110('0x4e')]=_[_0xe110('0x50')](db[_0xe110('0xe2')][_0xe110('0x35')]);_0x44d8df[_0xe110('0x43')]=_[_0xe110('0x50')](_0x4c8f93[_0xe110('0x43')]);_0x44d8df[_0xe110('0x51')]=_[_0xe110('0xca')](_0x44d8df[_0xe110('0x4e')],_0x44d8df[_0xe110('0x43')]);_0x42faf7[_0xe110('0x3f')]=_['intersection'](_0x44d8df[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x4c8f93['query'][_0xe110('0x52')]));_0x42faf7['attributes']=_0x42faf7[_0xe110('0x3f')]['length']?_0x42faf7[_0xe110('0x3f')]:_0x44d8df['model'];_0x42faf7[_0xe110('0xcb')]=qs['sort'](_0x4c8f93[_0xe110('0x43')][_0xe110('0xcc')]);_0x42faf7['where']=qs[_0xe110('0x51')](_[_0xe110('0xd6')](_0x4c8f93['query'],_0x44d8df[_0xe110('0x51')]));if(_0x4c8f93['query'][_0xe110('0x39')]){_0x42faf7[_0xe110('0x3c')]=_[_0xe110('0x54')](_0x42faf7[_0xe110('0x3c')],{'$or':_['map'](_0x42faf7[_0xe110('0x3f')],function(_0x94d24a){var _0x467bbc={};_0x467bbc[_0x94d24a]={'$like':'%'+_0x4c8f93['query'][_0xe110('0x39')]+'%'};return _0x467bbc;})});}_0x42faf7=_[_0xe110('0x54')]({},_0x42faf7,_0x4c8f93[_0xe110('0xcd')]);return _0x1d2154[_0xe110('0xe1')](_0x42faf7);}})[_0xe110('0x11')](function(_0x4b2ad4){if(_0x4b2ad4){_0x454ca8=_0x4b2ad4[_0xe110('0x45')];if(!_0x4c8f93[_0xe110('0x43')][_0xe110('0xd3')]('nolimit')){_0x42faf7['limit']=qs[_0xe110('0x21')](_0x4c8f93['query'][_0xe110('0x21')]);_0x42faf7[_0xe110('0x1f')]=qs['offset'](_0x4c8f93['query']['offset']);}return _0x1d2154[_0xe110('0xe1')](_0x42faf7);}})[_0xe110('0x11')](function(_0x493d9f){if(_0x493d9f){return _0x493d9f?{'count':_0x454ca8,'rows':_0x493d9f}:null;}})[_0xe110('0x11')](respondWithResult(_0x5abaf4,null))[_0xe110('0x1a')](handleError(_0x5abaf4,null));};exports[_0xe110('0xe3')]=function(_0x5e69d0,_0xa04858){var _0x439c97={'raw':!![],'where':{}};var _0x5815ed={};var _0x406646={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x5e69d0[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0xa04858,null))[_0xe110('0x11')](function(_0x2f3b38){if(_0x2f3b38){_0x5815ed[_0xe110('0x4e')]=_[_0xe110('0x50')](db['MailInteraction'][_0xe110('0x35')]);_0x5815ed[_0xe110('0x43')]=_[_0xe110('0x50')](_0x5e69d0[_0xe110('0x43')]);_0x5815ed[_0xe110('0x51')]=_[_0xe110('0xca')](_0x5815ed[_0xe110('0x4e')],_0x5815ed['query']);_0x439c97['attributes']=_[_0xe110('0xca')](_0x5815ed[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x5e69d0['query'][_0xe110('0x52')]));_0x439c97[_0xe110('0x3f')]=_0x439c97[_0xe110('0x3f')][_0xe110('0x45')]?_0x439c97[_0xe110('0x3f')]:_0x5815ed['model'];if(!_0x5e69d0[_0xe110('0x43')]['hasOwnProperty'](_0xe110('0xd4'))){_0x439c97[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x5e69d0['query'][_0xe110('0x21')]);_0x439c97[_0xe110('0x1f')]=qs[_0xe110('0x1f')](_0x5e69d0[_0xe110('0x43')][_0xe110('0x1f')]);}_0x439c97[_0xe110('0xcb')]=qs[_0xe110('0xcc')](_0x5e69d0[_0xe110('0x43')][_0xe110('0xcc')]);_0x439c97[_0xe110('0x3c')]=qs[_0xe110('0x51')](_[_0xe110('0xd6')](_0x5e69d0[_0xe110('0x43')],_0x5815ed[_0xe110('0x51')]));_0x439c97[_0xe110('0x3c')]['UserId']=_0x2f3b38['id'];if(_0x5e69d0[_0xe110('0x43')][_0xe110('0x39')]){_0x439c97[_0xe110('0x3c')]=_['merge'](_0x439c97[_0xe110('0x3c')],{'$or':_[_0xe110('0x2d')](_0x439c97['attributes'],function(_0x5a53e1){var _0x4843b9={};_0x4843b9[_0x5a53e1]={'$like':'%'+_0x5e69d0[_0xe110('0x43')]['filter']+'%'};return _0x4843b9;})});}_0x439c97=_['merge']({},_0x439c97,_0x5e69d0[_0xe110('0xcd')]);return db[_0xe110('0xe4')]['count']({'where':_0x439c97[_0xe110('0x3c')]})[_0xe110('0x11')](function(_0x854d4b){_0x406646[_0xe110('0x22')]=_0x854d4b;if(_0x5e69d0[_0xe110('0x43')]['includeAll']){_0x439c97[_0xe110('0x3e')]=[{'all':!![]}];}return db['MailInteraction'][_0xe110('0x41')](_0x439c97);})[_0xe110('0x11')](function(_0x5062ff){_0x406646[_0xe110('0x42')]=_0x5062ff;return _0x406646;});}})['then'](respondWithFilteredResult(_0xa04858,_0x439c97))[_0xe110('0x1a')](handleError(_0xa04858,null));};exports[_0xe110('0xe5')]=function(_0x9bd749,_0x34ef0a){var _0x7d552a={};var _0x418c42={};var _0x339225;var _0x26e1fe;return db['User']['findOne']({'where':{'id':_0x9bd749[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x34ef0a,null))['then'](function(_0xe5e313){if(_0xe5e313){_0x339225=_0xe5e313;_0x418c42[_0xe110('0x4e')]=_[_0xe110('0x50')](db[_0xe110('0xe6')][_0xe110('0x35')]);_0x418c42[_0xe110('0x43')]=_[_0xe110('0x50')](_0x9bd749['query']);_0x418c42[_0xe110('0x51')]=_[_0xe110('0xca')](_0x418c42['model'],_0x418c42[_0xe110('0x43')]);_0x7d552a[_0xe110('0x3f')]=_[_0xe110('0xca')](_0x418c42[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x9bd749[_0xe110('0x43')]['fields']));_0x7d552a[_0xe110('0x3f')]=_0x7d552a[_0xe110('0x3f')][_0xe110('0x45')]?_0x7d552a['attributes']:_0x418c42['model'];_0x7d552a[_0xe110('0xcb')]=qs[_0xe110('0xcc')](_0x9bd749[_0xe110('0x43')]['sort']);_0x7d552a[_0xe110('0x3c')]=qs[_0xe110('0x51')](_[_0xe110('0xd6')](_0x9bd749[_0xe110('0x43')],_0x418c42[_0xe110('0x51')]));if(_0x9bd749[_0xe110('0x43')][_0xe110('0x39')]){_0x7d552a[_0xe110('0x3c')]=_[_0xe110('0x54')](_0x7d552a[_0xe110('0x3c')],{'$or':_[_0xe110('0x2d')](_0x7d552a[_0xe110('0x3f')],function(_0x1c76d6){var _0x21f17c={};_0x21f17c[_0x1c76d6]={'$like':'%'+_0x9bd749[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x21f17c;})});}_0x7d552a=_[_0xe110('0x54')]({},_0x7d552a,_0x9bd749['options']);return _0x339225['getSmsInteractions'](_0x7d552a);}})[_0xe110('0x11')](function(_0x167e41){if(_0x167e41){_0x26e1fe=_0x167e41[_0xe110('0x45')];if(!_0x9bd749[_0xe110('0x43')]['hasOwnProperty'](_0xe110('0xd4'))){_0x7d552a[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x9bd749['query'][_0xe110('0x21')]);_0x7d552a[_0xe110('0x1f')]=qs['offset'](_0x9bd749[_0xe110('0x43')][_0xe110('0x1f')]);}return _0x339225[_0xe110('0xe5')](_0x7d552a);}})[_0xe110('0x11')](function(_0x273d0a){if(_0x273d0a){return _0x273d0a?{'count':_0x26e1fe,'rows':_0x273d0a}:null;}})[_0xe110('0x11')](respondWithResult(_0x34ef0a,null))['catch'](handleError(_0x34ef0a,null));};exports['getFaxInteractions']=function(_0x29d405,_0x4a00d2){var _0x282b4a={};var _0x42db9c={};var _0x6b368b;var _0x5a72fc;return db[_0xe110('0x3d')][_0xe110('0x90')]({'where':{'id':_0x29d405[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x4a00d2,null))[_0xe110('0x11')](function(_0x3f9aa4){if(_0x3f9aa4){_0x6b368b=_0x3f9aa4;_0x42db9c[_0xe110('0x4e')]=_[_0xe110('0x50')](db[_0xe110('0xe7')]['rawAttributes']);_0x42db9c[_0xe110('0x43')]=_[_0xe110('0x50')](_0x29d405[_0xe110('0x43')]);_0x42db9c[_0xe110('0x51')]=_[_0xe110('0xca')](_0x42db9c[_0xe110('0x4e')],_0x42db9c['query']);_0x282b4a['attributes']=_[_0xe110('0xca')](_0x42db9c[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x29d405[_0xe110('0x43')][_0xe110('0x52')]));_0x282b4a[_0xe110('0x3f')]=_0x282b4a['attributes']['length']?_0x282b4a[_0xe110('0x3f')]:_0x42db9c[_0xe110('0x4e')];_0x282b4a[_0xe110('0xcb')]=qs['sort'](_0x29d405['query'][_0xe110('0xcc')]);_0x282b4a[_0xe110('0x3c')]=qs['filters'](_[_0xe110('0xd6')](_0x29d405['query'],_0x42db9c[_0xe110('0x51')]));if(_0x29d405[_0xe110('0x43')][_0xe110('0x39')]){_0x282b4a[_0xe110('0x3c')]=_['merge'](_0x282b4a['where'],{'$or':_[_0xe110('0x2d')](_0x282b4a[_0xe110('0x3f')],function(_0x50601a){var _0x62768d={};_0x62768d[_0x50601a]={'$like':'%'+_0x29d405[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x62768d;})});}_0x282b4a=_[_0xe110('0x54')]({},_0x282b4a,_0x29d405['options']);return _0x6b368b[_0xe110('0xe8')](_0x282b4a);}})['then'](function(_0x497d6d){if(_0x497d6d){_0x5a72fc=_0x497d6d['length'];if(!_0x29d405['query'][_0xe110('0xd3')](_0xe110('0xd4'))){_0x282b4a[_0xe110('0x21')]=qs['limit'](_0x29d405[_0xe110('0x43')][_0xe110('0x21')]);_0x282b4a['offset']=qs[_0xe110('0x1f')](_0x29d405[_0xe110('0x43')][_0xe110('0x1f')]);}return _0x6b368b[_0xe110('0xe8')](_0x282b4a);}})['then'](function(_0x58d41a){if(_0x58d41a){return _0x58d41a?{'count':_0x5a72fc,'rows':_0x58d41a}:null;}})[_0xe110('0x11')](respondWithResult(_0x4a00d2,null))[_0xe110('0x1a')](handleError(_0x4a00d2,null));};exports['getWhatsappInteractions']=function(_0x4d9bd9,_0x304540){var _0x25c5b5={};var _0xc1a416={};var _0x2d03a9;var _0x1832a2;return db['User'][_0xe110('0x90')]({'where':{'id':_0x4d9bd9[_0xe110('0x4d')]['id']}})['then'](handleEntityNotFound(_0x304540,null))[_0xe110('0x11')](function(_0x5410bd){if(_0x5410bd){_0x2d03a9=_0x5410bd;_0xc1a416[_0xe110('0x4e')]=_[_0xe110('0x50')](db[_0xe110('0xe9')]['rawAttributes']);_0xc1a416[_0xe110('0x43')]=_[_0xe110('0x50')](_0x4d9bd9[_0xe110('0x43')]);_0xc1a416[_0xe110('0x51')]=_[_0xe110('0xca')](_0xc1a416[_0xe110('0x4e')],_0xc1a416[_0xe110('0x43')]);_0x25c5b5['attributes']=_[_0xe110('0xca')](_0xc1a416[_0xe110('0x4e')],qs['fields'](_0x4d9bd9['query'][_0xe110('0x52')]));_0x25c5b5['attributes']=_0x25c5b5[_0xe110('0x3f')][_0xe110('0x45')]?_0x25c5b5[_0xe110('0x3f')]:_0xc1a416[_0xe110('0x4e')];_0x25c5b5[_0xe110('0xcb')]=qs[_0xe110('0xcc')](_0x4d9bd9[_0xe110('0x43')][_0xe110('0xcc')]);_0x25c5b5[_0xe110('0x3c')]=qs[_0xe110('0x51')](_[_0xe110('0xd6')](_0x4d9bd9['query'],_0xc1a416[_0xe110('0x51')]));if(_0x4d9bd9['query'][_0xe110('0x39')]){_0x25c5b5[_0xe110('0x3c')]=_[_0xe110('0x54')](_0x25c5b5[_0xe110('0x3c')],{'$or':_[_0xe110('0x2d')](_0x25c5b5[_0xe110('0x3f')],function(_0x32c257){var _0x433231={};_0x433231[_0x32c257]={'$like':'%'+_0x4d9bd9[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x433231;})});}_0x25c5b5=_[_0xe110('0x54')]({},_0x25c5b5,_0x4d9bd9[_0xe110('0xcd')]);return _0x2d03a9[_0xe110('0xea')](_0x25c5b5);}})[_0xe110('0x11')](function(_0x42726b){if(_0x42726b){_0x1832a2=_0x42726b[_0xe110('0x45')];if(!_0x4d9bd9[_0xe110('0x43')][_0xe110('0xd3')](_0xe110('0xd4'))){_0x25c5b5[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x4d9bd9[_0xe110('0x43')]['limit']);_0x25c5b5[_0xe110('0x1f')]=qs[_0xe110('0x1f')](_0x4d9bd9[_0xe110('0x43')][_0xe110('0x1f')]);}return _0x2d03a9[_0xe110('0xea')](_0x25c5b5);}})[_0xe110('0x11')](function(_0x3ac853){if(_0x3ac853){return _0x3ac853?{'count':_0x1832a2,'rows':_0x3ac853}:null;}})[_0xe110('0x11')](respondWithResult(_0x304540,null))[_0xe110('0x1a')](handleError(_0x304540,null));};exports[_0xe110('0xeb')]=function(_0x531558,_0x4ad625,_0x395448){var _0x5d673a;var _0x52fc20;var _0x29eedc;var _0x435270=!_[_0xe110('0x5f')](_0x531558[_0xe110('0x4d')]['id'])?_0x531558[_0xe110('0x4d')]['id']:!_[_0xe110('0x5f')](_0x531558[_0xe110('0x75')]['id'])?_0x531558[_0xe110('0x75')]['id']:null;return db[_0xe110('0x3d')]['find']({'where':{'id':_0x435270,'role':{'$or':['admin',_0xe110('0x75'),_0xe110('0x2a')]}},'attributes':['id',_0xe110('0x32'),_0xe110('0xec'),_0xe110('0xed'),'role',_0xe110('0x5c'),_0xe110('0x98')]})[_0xe110('0x11')](function(_0x431b3b){if(_0x431b3b){if(_0x431b3b['role']===_0xe110('0x2a')){_0x5d673a=_0x431b3b;if(_0x531558[_0xe110('0x57')][_0xe110('0x99')]){_0x29eedc=util['format'](_0xe110('0xee'),_0x5d673a[_0x531558[_0xe110('0x57')]['interface']]);}else if(_0x531558[_0xe110('0x57')]['intrf']){_0x29eedc=util[_0xe110('0xa5')](_0xe110('0xa6'),_0x531558[_0xe110('0x57')]['intrf']);}else{_0x29eedc=util[_0xe110('0xa5')]('SIP/%s',_0x5d673a[_0xe110('0x32')]);}socket['to'](util[_0xe110('0xa5')](_0xe110('0xef'),_0x5d673a[_0xe110('0x32')]))[_0xe110('0xa1')]('user:forcelogout',{'user':{'id':_0x5d673a['id'],'name':_0x5d673a[_0xe110('0x32')]},'ip':_0x531558[_0xe110('0xf0')]['x-forwarded-for']||_0x531558[_0xe110('0xf1')]['remoteAddress']||_0x531558[_0xe110('0xf2')][_0xe110('0xf3')]||_0x531558[_0xe110('0xf1')][_0xe110('0xf2')]['remoteAddress']});return db['UserVoiceQueueRt'][_0xe110('0x25')]({'where':{'membername':_0x5d673a['name']},'individualHooks':!![]});}}else{throw new db[(_0xe110('0x8d'))][(_0xe110('0x89'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xe110('0x11')](function(){if(_0x5d673a){return _0x5d673a['getVoiceQueues']({'raw':!![]});}})[_0xe110('0x11')](function(_0xe4e269){if(_0x5d673a){var _0x9b688a=[];if(_0xe4e269){_0x52fc20=_0xe4e269;if(_0x52fc20[_0xe110('0x45')]){for(var _0x3a66d8=0x0;_0x3a66d8<_0x52fc20[_0xe110('0x45')];_0x3a66d8++){_0x9b688a['push']({'membername':_0x5d673a['name'],'UserId':_0x5d673a['id'],'queue_name':_0x52fc20[_0x3a66d8][_0xe110('0x32')],'VoiceQueueId':_0x52fc20[_0x3a66d8]['id'],'interface':_0x29eedc,'paused':_0x5d673a[_0xe110('0x98')]||![],'penalty':_0x52fc20[_0x3a66d8][_0xe110('0xf4')]||0x0});}return BPromise[_0xe110('0x81')](_0x9b688a,function(_0xeb3994){return db[_0xe110('0xa8')][_0xe110('0xa9')](_0xeb3994);});}}}})['then'](function(){if(_0x5d673a){return db['MemberReport'][_0xe110('0x41')]({'where':{'membername':_0x5d673a['name'],'exitAt':null}});}})[_0xe110('0x11')](function(_0x40cb29){if(_0x5d673a){var _0x5ae84c=[];_0x40cb29[_0xe110('0xf5')](function(_0x1c07e7){_0x5ae84c['push'](_0x1c07e7['update']({'exitAt':moment()['format'](_0xe110('0xf6'))}));});return BPromise[_0xe110('0x4b')](_0x5ae84c);}})[_0xe110('0x11')](function(){if(_0x5d673a){var _0x5bf944=[];var _0x3a9d4a=[];var _0x402478=utils['getChannels']();var _0x4d2086={'membername':_0x5d673a['name'],'interface':_0x29eedc,'enterAt':moment()[_0xe110('0xa5')](_0xe110('0xf6')),'role':_0x5d673a['role'],'internal':_0x5d673a[_0xe110('0x5c')]};_0x402478[_0xe110('0xf5')](function(_0x22fdbc){_0x5bf944[_0xe110('0x40')](_[_0xe110('0x54')]({'channel':_0x22fdbc,'type':'LOGIN','data1':_0x531558['body'][_0xe110('0xf7')],'data2':_0x29eedc},_0x4d2086));if(_0x5d673a[_0xe110('0x98')]){_0x3a9d4a[_0xe110('0x40')](_[_0xe110('0x54')]({'channel':_0x22fdbc,'type':_0xe110('0xf8'),'data1':_0xe110('0xf9')},_0x4d2086));}});return db['MemberReport'][_0xe110('0xfa')](_0x5bf944[_0xe110('0xfb')](_0x3a9d4a),{'individualHooks':!![]});}})[_0xe110('0x11')](function(){if(_0x5d673a){return _0x5d673a[_0xe110('0xfc')]({'online':!![],'lastLoginAt':moment()[_0xe110('0xa5')](_0xe110('0xf6')),'voicePause':_0x5d673a[_0xe110('0x98')]||![],'mailPause':_0x5d673a['loginInPause']||![],'chatPause':_0x5d673a[_0xe110('0x98')]||![],'faxPause':_0x5d673a[_0xe110('0x98')]||![],'smsPause':_0x5d673a[_0xe110('0x98')]||![],'openchannelPause':_0x5d673a[_0xe110('0x98')]||![],'whatsappPause':_0x5d673a[_0xe110('0x98')]||![],'pauseType':_0x5d673a[_0xe110('0x98')]?_0xe110('0xf9'):null,'interface':_0x29eedc,'lastPauseAt':moment()['format'](_0xe110('0xf6'))});}})[_0xe110('0x11')](function(_0x232a7f){if(_0x531558['isMiddleware']){return _0x395448();}else{return BPromise[_0xe110('0xfd')](_0x232a7f)['then'](respondWithResult(_0x4ad625,null));}})['catch'](handleError(_0x4ad625,null));};exports[_0xe110('0xfe')]=function(_0x14386e,_0x3ad7cd){var _0x61dce9;return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x14386e['params']['id'],'role':'agent'},'attributes':['id',_0xe110('0x32'),'role']})[_0xe110('0x11')](handleEntityNotFound(_0x3ad7cd,null))[_0xe110('0x11')](function(_0x2a88b3){if(_0x2a88b3){_0x61dce9=_0x2a88b3;return db[_0xe110('0xa8')]['destroy']({'where':{'membername':_0x61dce9[_0xe110('0x32')]},'individualHooks':!![]});}})[_0xe110('0x11')](function(){return db['MemberReport'][_0xe110('0x41')]({'where':{'membername':_0x61dce9[_0xe110('0x32')],'exitAt':null}});})[_0xe110('0x11')](function(_0x1aacb6){var _0x121208=[];_0x1aacb6[_0xe110('0xf5')](function(_0x34cb33){_0x121208['push'](_0x34cb33['update']({'exitAt':moment()[_0xe110('0xa5')](_0xe110('0xf6'))}));});return BPromise[_0xe110('0x4b')](_0x121208);})['then'](function(){return _0x61dce9['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xe110('0x11')](respondWithResult(_0x3ad7cd,null))[_0xe110('0x1a')](handleError(_0x3ad7cd,null));};exports[_0xe110('0xff')]=function(_0x3542db,_0x5089fb){var _0x24b30d;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x3542db[_0xe110('0x4d')]['id']},'individualHooks':!![]})['then'](function(){return db['User'][_0xe110('0x31')]({'where':{'id':_0x3542db[_0xe110('0x4d')]['id'],'role':_0xe110('0x2a')},'attributes':['id',_0xe110('0x32'),'role','internal','interface']});})['then'](handleEntityNotFound(_0x5089fb,null))[_0xe110('0x11')](function(_0x3ac951){if(_0x3ac951){_0x24b30d=_0x3ac951;return respondWithRpcPromise('QueuePause',_0xe110('0xff'),{'id':_0x24b30d['id'],'name':_0x24b30d[_0xe110('0x32')],'pause':!![]});}})['then'](function(){if(_0x24b30d){return db['MemberReport'][_0xe110('0x41')]({'where':{'membername':_0x24b30d[_0xe110('0x32')],'type':_0xe110('0xf8'),'exitAt':null}});}})[_0xe110('0x11')](function(_0x34689f){if(_0x34689f['length']){var _0x20cc54=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x42c7d8=0x0,_0x3020cb=_0x34689f[_0xe110('0x45')];_0x42c7d8<_0x3020cb;_0x42c7d8++){_0x34689f[_0x42c7d8][_0xe110('0x100')]({'exitAt':_0x20cc54});}}})[_0xe110('0x11')](function(){var _0x27b39b=[];var _0x317ccd=utils[_0xe110('0x101')]();_0x317ccd[_0xe110('0xf5')](function(_0x1a6848){_0x27b39b[_0xe110('0x40')]({'channel':_0x1a6848,'membername':_0x24b30d[_0xe110('0x32')],'interface':_[_0xe110('0x5f')](_0x24b30d['interface'])?util[_0xe110('0xa5')]('SIP/%s',_0x24b30d['name']):_0x24b30d[_0xe110('0x99')],'type':_0xe110('0xf8'),'enterAt':moment()[_0xe110('0xa5')](_0xe110('0xf6')),'data1':_0x3542db[_0xe110('0x57')][_0xe110('0x37')]||'DEFAULT\x20PAUSE','role':_0x24b30d[_0xe110('0x30')],'internal':_0x24b30d['internal']});});return db[_0xe110('0x102')][_0xe110('0xfa')](_0x27b39b,{'individualHooks':!![]});})[_0xe110('0x11')](function(){return _0x24b30d[_0xe110('0xfc')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3542db[_0xe110('0x57')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xe110('0xa5')](_0xe110('0xf6'))});})[_0xe110('0x11')](respondWithResult(_0x5089fb,null))[_0xe110('0x1a')](handleError(_0x5089fb,null));};exports[_0xe110('0x103')]=function(_0x1d2011,_0x4524f8){var _0x5f1976;return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x1d2011[_0xe110('0x4d')]['id']},'attributes':['id',_0xe110('0x32'),_0xe110('0x30'),_0xe110('0x104'),_0xe110('0x105'),_0xe110('0x106'),_0xe110('0x107'),'openchannelPause',_0xe110('0x108'),'whatsapppause',_0xe110('0x109'),_0xe110('0x10a')]})[_0xe110('0x11')](handleEntityNotFound(_0x4524f8,null))[_0xe110('0x11')](function(_0x4640f){if(_0x4640f){_0x5f1976=_0x4640f;if(_0x1d2011[_0xe110('0x57')][_0xe110('0xab')]&&!utils[_0xe110('0x9a')](_0x1d2011[_0xe110('0x57')][_0xe110('0xab')])){throw new db[(_0xe110('0x8d'))][(_0xe110('0x89'))](_0xe110('0x9b'));}switch(_0x1d2011[_0xe110('0x57')][_0xe110('0xab')]){case'voice':return respondWithRpcPromise(_0xe110('0x10b'),_0xe110('0x103'),{'id':_0x5f1976['id'],'name':_0x5f1976['name'],'pause':![]})[_0xe110('0x11')](function(){return db[_0xe110('0xa8')][_0xe110('0xfc')]({'paused':0x0},{'where':{'UserId':_0x5f1976['id']},'individualHooks':!![]});})[_0xe110('0x11')](function(){return db['MemberReport'][_0xe110('0x31')]({'where':{'channel':_0x1d2011[_0xe110('0x57')][_0xe110('0xab')],'membername':_0x5f1976['name'],'type':'PAUSE','exitAt':null}});})[_0xe110('0x11')](function(_0x56067b){if(_0x56067b){return _0x56067b['update']({'exitAt':moment()[_0xe110('0xa5')](_0xe110('0xf6')),'data2':_0xe110('0x10c')},{'individualHooks':!![]});}return null;})[_0xe110('0x11')](function(){return _0x5f1976['update']({'voicePause':![]});});case _0xe110('0x48'):case _0xe110('0xba'):case _0xe110('0x56'):case _0xe110('0x47'):case _0xe110('0x4a'):case _0xe110('0x49'):return db[_0xe110('0x102')][_0xe110('0x31')]({'where':{'channel':_0x1d2011[_0xe110('0x57')][_0xe110('0xab')],'membername':_0x5f1976[_0xe110('0x32')],'type':'PAUSE','exitAt':null}})[_0xe110('0x11')](function(_0x331bd1){if(_0x331bd1){return _0x331bd1['update']({'exitAt':moment()[_0xe110('0xa5')](_0xe110('0xf6')),'data2':_0xe110('0x10c')},{'individualHooks':!![]});}return null;})[_0xe110('0x11')](function(){var _0x184a62={};_[_0xe110('0x23')](_0x184a62,util['format']('%s%s',_0x1d2011['body'][_0xe110('0xab')],_0xe110('0x10d')),![]);return _0x5f1976[_0xe110('0xfc')](_0x184a62);});default:return respondWithRpcPromise(_0xe110('0x10b'),_0xe110('0x103'),{'id':_0x5f1976['id'],'name':_0x5f1976[_0xe110('0x32')],'pause':![]})[_0xe110('0x11')](function(){return db[_0xe110('0xa8')]['update']({'paused':0x0},{'where':{'UserId':_0x5f1976['id']}});})[_0xe110('0x11')](function(){return db[_0xe110('0x102')][_0xe110('0x41')]({'where':{'membername':_0x5f1976['name'],'type':_0xe110('0xf8'),'exitAt':null}});})['then'](function(_0x1c1a39){var _0x312041=[];_0x1c1a39[_0xe110('0xf5')](function(_0x5ccc93){_0x312041[_0xe110('0x40')](_0x5ccc93[_0xe110('0xfc')]({'exitAt':moment()[_0xe110('0xa5')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xe110('0x10c')}));});return BPromise['all'](_0x312041);})[_0xe110('0x11')](function(){return _0x5f1976[_0xe110('0xfc')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xe110('0x11')](respondWithResult(_0x4524f8,null))[_0xe110('0x1a')](handleError(_0x4524f8,null));};exports['getTeams']=function(_0x1263cc,_0x6d9ba1){var _0x3910f1={};var _0x4cccdc={};var _0xf4366d;var _0x3ff569;return db[_0xe110('0x3d')][_0xe110('0x90')]({'where':{'id':_0x1263cc[_0xe110('0x4d')]['id']}})['then'](handleEntityNotFound(_0x6d9ba1,null))[_0xe110('0x11')](function(_0x387838){if(_0x387838){_0xf4366d=_0x387838;_0x4cccdc[_0xe110('0x4e')]=_[_0xe110('0x50')](db[_0xe110('0x10e')]['rawAttributes']);_0x4cccdc[_0xe110('0x43')]=_[_0xe110('0x50')](_0x1263cc[_0xe110('0x43')]);_0x4cccdc['filters']=_[_0xe110('0xca')](_0x4cccdc[_0xe110('0x4e')],_0x4cccdc['query']);_0x3910f1[_0xe110('0x3f')]=_[_0xe110('0xca')](_0x4cccdc[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x1263cc['query'][_0xe110('0x52')]));_0x3910f1['attributes']=_0x3910f1[_0xe110('0x3f')][_0xe110('0x45')]?_0x3910f1[_0xe110('0x3f')]:_0x4cccdc['model'];_0x3910f1[_0xe110('0xcb')]=qs[_0xe110('0xcc')](_0x1263cc[_0xe110('0x43')][_0xe110('0xcc')]);_0x3910f1[_0xe110('0x3c')]=qs['filters'](_[_0xe110('0xd6')](_0x1263cc[_0xe110('0x43')],_0x4cccdc[_0xe110('0x51')]));if(_0x1263cc[_0xe110('0x43')][_0xe110('0x39')]){_0x3910f1['where']=_[_0xe110('0x54')](_0x3910f1[_0xe110('0x3c')],{'$or':_[_0xe110('0x2d')](_0x3910f1['attributes'],function(_0x5a89e1){var _0x135d89={};_0x135d89[_0x5a89e1]={'$like':'%'+_0x1263cc['query']['filter']+'%'};return _0x135d89;})});}_0x3910f1=_[_0xe110('0x54')]({},_0x3910f1,_0x1263cc[_0xe110('0xcd')]);return _0xf4366d[_0xe110('0x10f')](_0x3910f1);}})[_0xe110('0x11')](function(_0x4900cf){if(_0x4900cf){_0x3ff569=_0x4900cf[_0xe110('0x45')];if(!_0x1263cc['query'][_0xe110('0xd3')](_0xe110('0xd4'))){_0x3910f1[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x1263cc[_0xe110('0x43')][_0xe110('0x21')]);_0x3910f1['offset']=qs[_0xe110('0x1f')](_0x1263cc[_0xe110('0x43')][_0xe110('0x1f')]);}return _0xf4366d[_0xe110('0x10f')](_0x3910f1);}})['then'](function(_0x4702d6){if(_0x4702d6){return _0x4702d6?{'count':_0x3ff569,'rows':_0x4702d6}:null;}})[_0xe110('0x11')](respondWithResult(_0x6d9ba1,null))[_0xe110('0x1a')](handleError(_0x6d9ba1,null));};exports[_0xe110('0x110')]=function(_0x3add93,_0x59755a){return db['User'][_0xe110('0x31')]({'where':{'id':_0x3add93[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x59755a,null))['then'](function(_0x34e470){if(_0x34e470){var _0x169940=_0x34e470[_0xe110('0x26')]({'plain':!![]});return _0x34e470[_0xe110('0x110')](_0x3add93[_0xe110('0x57')][_0xe110('0x5b')],_[_0xe110('0x5a')](_0x3add93['body'],[_0xe110('0x5b'),'id'])||{})[_0xe110('0x11')](function(){for(var _0x1cc57b=0x0;_0x1cc57b<_0x3add93['body'][_0xe110('0x5b')][_0xe110('0x45')];_0x1cc57b++){var _0x313d4e=[];var _0x2c3948={};db[_0xe110('0x10e')]['findOne']({'where':{'id':_0x3add93[_0xe110('0x57')]['ids'][_0x1cc57b]}})['then'](function(_0x3c299f){_0x2c3948=_0x3c299f['dataValues'];_0x313d4e['push'](_0x3c299f['getVoiceQueues']()[_0xe110('0x11')](function(_0x4e9e4d){for(var _0x4cf7a0=0x0;_0x4cf7a0<_0x4e9e4d[_0xe110('0x45')];_0x4cf7a0++){_0x4e9e4d[_0x4cf7a0]['setDataValue']('channel',_0xe110('0x111'));}return _0x4e9e4d;}));_0x313d4e[_0xe110('0x40')](_0x3c299f[_0xe110('0x112')]()[_0xe110('0x11')](function(_0xc9bede){for(var _0x445433=0x0;_0x445433<_0xc9bede[_0xe110('0x45')];_0x445433++){_0xc9bede[_0x445433]['setDataValue'](_0xe110('0xab'),'Chat');}return _0xc9bede;}));_0x313d4e['push'](_0x3c299f['getMailQueues']()[_0xe110('0x11')](function(_0x40bcdd){for(var _0x5e28ef=0x0;_0x5e28ef<_0x40bcdd[_0xe110('0x45')];_0x5e28ef++){_0x40bcdd[_0x5e28ef]['setDataValue'](_0xe110('0xab'),'Mail');}return _0x40bcdd;}));_0x313d4e['push'](_0x3c299f[_0xe110('0x113')]()[_0xe110('0x11')](function(_0x2fc228){for(var _0x31fe8a=0x0;_0x31fe8a<_0x2fc228['length'];_0x31fe8a++){_0x2fc228[_0x31fe8a][_0xe110('0x114')](_0xe110('0xab'),_0xe110('0x115'));}return _0x2fc228;}));_0x313d4e[_0xe110('0x40')](_0x3c299f[_0xe110('0x116')]()['then'](function(_0x5a503b){for(var _0x20933c=0x0;_0x20933c<_0x5a503b['length'];_0x20933c++){_0x5a503b[_0x20933c][_0xe110('0x114')](_0xe110('0xab'),'Whatsapp');}return _0x5a503b;}));_0x313d4e[_0xe110('0x40')](_0x3c299f[_0xe110('0x117')]()['then'](function(_0x3d3c9d){for(var _0x481b89=0x0;_0x481b89<_0x3d3c9d[_0xe110('0x45')];_0x481b89++){_0x3d3c9d[_0x481b89][_0xe110('0x114')]('channel',_0xe110('0x118'));}return _0x3d3c9d;}));_0x313d4e[_0xe110('0x40')](_0x3c299f[_0xe110('0x119')]()[_0xe110('0x11')](function(_0x5073cc){for(var _0x522f0b=0x0;_0x522f0b<_0x5073cc[_0xe110('0x45')];_0x522f0b++){_0x5073cc[_0x522f0b][_0xe110('0x114')](_0xe110('0xab'),'Openchannel');}return _0x5073cc;}));return BPromise[_0xe110('0x4b')](_0x313d4e);})[_0xe110('0x11')](function(_0x2bc323){var _0x503d66=_['flatten'](_0x2bc323);_0x313d4e=[];return db['sequelize'][_0xe110('0x11a')](function(_0x1b3e9f){for(var _0xecb6ba=0x0;_0xecb6ba<_0x503d66[_0xe110('0x45')];_0xecb6ba++){_0x313d4e['push'](_0x503d66[_0xecb6ba][_0xe110('0x11b')](_0x169940['id']),{'transaction':_0x1b3e9f});}return BPromise['all'](_0x313d4e)['then'](function(){if(_0x169940[_0xe110('0x97')]){return BPromise['each'](_[_0xe110('0x39')](_0x503d66,function(_0x15f962){return _0x15f962[_0xe110('0x11c')](_0xe110('0xab'))==='Voice';}),function(_0x44a4c7){return db['UserVoiceQueueRt'][_0xe110('0xa9')]({'membername':_0x169940['name'],'UserId':_0x169940['id'],'queue_name':_0x44a4c7[_0xe110('0x32')],'VoiceQueueId':_0x44a4c7['id'],'interface':_[_0xe110('0x5f')](_0x169940[_0xe110('0x99')])?util[_0xe110('0xa5')](_0xe110('0xa6'),_0x169940[_0xe110('0x32')]):_0x169940[_0xe110('0x99')],'paused':_0x169940[_0xe110('0x104')]||![],'penalty':_0x169940['penalty']},{'transaction':_0x1b3e9f});});}else{return;}})['then'](function(){for(var _0x44f728=0x0;_0x44f728<_0x503d66[_0xe110('0x45')];_0x44f728++){var _0x5b8475=_0x503d66[_0x44f728][_0xe110('0x11c')](_0xe110('0xab'));var _0x35ad43=_0x5b8475+_0xe110('0xa0');socket['emit'](_0xe110('0x75')+_0x5b8475+_0xe110('0xa2'),{'UserId':_0x169940['id'],['queueField']:_0x503d66[_0x44f728]['id']});}});});})[_0xe110('0x11')](function(){db[_0xe110('0x11d')][_0xe110('0x90')]({'where':{'teamId':_0x2c3948['id']}})[_0xe110('0x11')](function(_0x41ed28){if(_0x41ed28){db[_0xe110('0x11e')][_0xe110('0x73')]({'UserId':_0x3add93['params']['id'],'VoicePrefixId':_0x41ed28[_0xe110('0x11f')]});}});});}});}})['then'](respondWithStatusCode(_0x59755a,null))['catch'](handleError(_0x59755a,null));};exports[_0xe110('0x120')]=function(_0xe1fc72,_0x35b1ee){return db[_0xe110('0x3d')]['findOne']({'where':{'id':_0xe1fc72[_0xe110('0x4d')]['id']}})['then'](handleEntityNotFound(_0x35b1ee,null))[_0xe110('0x11')](function(_0x24b67d){if(_0x24b67d){var _0x39beb3=_0x24b67d[_0xe110('0x26')]({'plain':!![]});var _0x341a64=_0xe1fc72[_0xe110('0x43')][_0xe110('0x5b')];return _0x24b67d['removeTeams'](_0x341a64)[_0xe110('0x11')](function(){for(var _0x53e1f7=0x0;_0x53e1f7<_0x341a64[_0xe110('0x45')];_0x53e1f7++){var _0x3f2dd6=[];var _0xc90377={};db['Team'][_0xe110('0x90')]({'where':{'id':_0x341a64[_0x53e1f7]}})['then'](function(_0x5304cd){_0xc90377=_0x5304cd[_0xe110('0x46')];_0x3f2dd6[_0xe110('0x40')](_0x5304cd[_0xe110('0x121')]()['then'](function(_0x541fbd){for(var _0x32e9f6=0x0;_0x32e9f6<_0x541fbd[_0xe110('0x45')];_0x32e9f6++){_0x541fbd[_0x32e9f6][_0xe110('0x114')]('channel',_0xe110('0x111'));}return _0x541fbd;}));_0x3f2dd6[_0xe110('0x40')](_0x5304cd['getChatQueues']()[_0xe110('0x11')](function(_0x290a8b){for(var _0x33074e=0x0;_0x33074e<_0x290a8b[_0xe110('0x45')];_0x33074e++){_0x290a8b[_0x33074e][_0xe110('0x114')](_0xe110('0xab'),'Chat');}return _0x290a8b;}));_0x3f2dd6['push'](_0x5304cd[_0xe110('0x122')]()['then'](function(_0x37200d){for(var _0x47d404=0x0;_0x47d404<_0x37200d[_0xe110('0x45')];_0x47d404++){_0x37200d[_0x47d404]['setDataValue']('channel',_0xe110('0x123'));}return _0x37200d;}));_0x3f2dd6[_0xe110('0x40')](_0x5304cd[_0xe110('0x113')]()[_0xe110('0x11')](function(_0xe36d2){for(var _0x543f37=0x0;_0x543f37<_0xe36d2[_0xe110('0x45')];_0x543f37++){_0xe36d2[_0x543f37][_0xe110('0x114')](_0xe110('0xab'),'Sms');}return _0xe36d2;}));_0x3f2dd6['push'](_0x5304cd[_0xe110('0x116')]()[_0xe110('0x11')](function(_0x1fc5f8){for(var _0x14e9ae=0x0;_0x14e9ae<_0x1fc5f8[_0xe110('0x45')];_0x14e9ae++){_0x1fc5f8[_0x14e9ae][_0xe110('0x114')](_0xe110('0xab'),_0xe110('0x124'));}return _0x1fc5f8;}));_0x3f2dd6[_0xe110('0x40')](_0x5304cd[_0xe110('0x117')]()['then'](function(_0x5a72f9){for(var _0x1f19c6=0x0;_0x1f19c6<_0x5a72f9[_0xe110('0x45')];_0x1f19c6++){_0x5a72f9[_0x1f19c6][_0xe110('0x114')](_0xe110('0xab'),_0xe110('0x118'));}return _0x5a72f9;}));_0x3f2dd6['push'](_0x5304cd[_0xe110('0x119')]()[_0xe110('0x11')](function(_0x2385f0){for(var _0x589428=0x0;_0x589428<_0x2385f0['length'];_0x589428++){_0x2385f0[_0x589428][_0xe110('0x114')]('channel',_0xe110('0x125'));}return _0x2385f0;}));return BPromise['all'](_0x3f2dd6);})[_0xe110('0x11')](function(_0x2e408f){var _0x3dcdc8=_['flatten'](_0x2e408f);_0x3f2dd6=[];return db['sequelize']['transaction'](function(_0x58d4f2){for(var _0x180fdd=0x0;_0x180fdd<_0x3dcdc8[_0xe110('0x45')];_0x180fdd++){_0x3f2dd6[_0xe110('0x40')](_0x3dcdc8[_0x180fdd][_0xe110('0x126')](_0x39beb3['id']),{'transaction':_0x58d4f2});}return BPromise[_0xe110('0x4b')](_0x3f2dd6)[_0xe110('0x11')](function(){if(_0x39beb3[_0xe110('0x97')]){return BPromise[_0xe110('0x81')](_[_0xe110('0x39')](_0x3dcdc8,function(_0x3b8e03){return _0x3b8e03[_0xe110('0x11c')](_0xe110('0xab'))===_0xe110('0x111');}),function(_0x3c8437){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3c8437['id'],'UserId':_0x39beb3['id']},'transaction':_0x58d4f2});});}else{return;}})[_0xe110('0x11')](function(){db[_0xe110('0x11d')][_0xe110('0x90')]({'where':{'teamId':_0xc90377['id']}})[_0xe110('0x11')](function(_0x3db25a){if(_0x3db25a){return db[_0xe110('0x11e')][_0xe110('0x25')]({'where':{'UserId':_0x39beb3['id'],'VoicePrefixId':_0x3db25a['dataValues'][_0xe110('0x11f')]}});}});})['then'](function(){for(var _0x29d9e2=0x0;_0x29d9e2<_0x3dcdc8[_0xe110('0x45')];_0x29d9e2++){var _0x433660=_0x3dcdc8[_0x29d9e2]['getDataValue']('channel');var _0x431de5=_0x433660+_0xe110('0xa0');socket[_0xe110('0xa1')](_0xe110('0x75')+_0x433660+'Queue:remove',{'UserId':_0x39beb3['id'],['queueField']:_0x3dcdc8[_0x29d9e2]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x35b1ee,null))['catch'](handleError(_0x35b1ee,null));};exports[_0xe110('0x127')]=function(_0x9c73c2,_0x622b3c){var _0x338af4={};var _0x2175f6={};var _0x212cd3;var _0xcb64ee;return db['User']['findOne']({'where':{'id':_0x9c73c2[_0xe110('0x4d')]['id']}})['then'](handleEntityNotFound(_0x622b3c,null))[_0xe110('0x11')](function(_0x3ce098){if(_0x3ce098){_0x212cd3=_0x3ce098;_0x2175f6[_0xe110('0x4e')]=_['keys'](db[_0xe110('0xce')][_0xe110('0x35')]);_0x2175f6[_0xe110('0x43')]=_[_0xe110('0x50')](_0x9c73c2[_0xe110('0x43')]);_0x2175f6[_0xe110('0x51')]=_[_0xe110('0xca')](_0x2175f6['model'],_0x2175f6['query']);_0x338af4['attributes']=_[_0xe110('0xca')](_0x2175f6[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x9c73c2[_0xe110('0x43')][_0xe110('0x52')]));_0x338af4[_0xe110('0x3f')]=_0x338af4[_0xe110('0x3f')]['length']?_0x338af4['attributes']:_0x2175f6['model'];_0x338af4['order']=qs[_0xe110('0xcc')](_0x9c73c2[_0xe110('0x43')][_0xe110('0xcc')]);_0x338af4[_0xe110('0x3c')]=qs[_0xe110('0x51')](_[_0xe110('0xd6')](_0x9c73c2[_0xe110('0x43')],_0x2175f6[_0xe110('0x51')]));if(_0x9c73c2[_0xe110('0x43')][_0xe110('0x39')]){_0x338af4[_0xe110('0x3c')]=_[_0xe110('0x54')](_0x338af4['where'],{'$or':_[_0xe110('0x2d')](_0x338af4['attributes'],function(_0xf9c527){var _0xfb985d={};_0xfb985d[_0xf9c527]={'$like':'%'+_0x9c73c2[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0xfb985d;})});}_0x338af4=_[_0xe110('0x54')]({},_0x338af4,_0x9c73c2['options']);return _0x212cd3[_0xe110('0x127')](_0x338af4);}})[_0xe110('0x11')](function(_0x5c8d66){if(_0x5c8d66){_0xcb64ee=_0x5c8d66[_0xe110('0x45')];if(!_0x9c73c2['query']['hasOwnProperty'](_0xe110('0xd4'))){_0x338af4[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x9c73c2['query'][_0xe110('0x21')]);_0x338af4['offset']=qs['offset'](_0x9c73c2[_0xe110('0x43')]['offset']);}return _0x212cd3[_0xe110('0x127')](_0x338af4);}})[_0xe110('0x11')](function(_0x3cb71d){if(_0x3cb71d){return _0x3cb71d?{'count':_0xcb64ee,'rows':_0x3cb71d}:null;}})[_0xe110('0x11')](respondWithResult(_0x622b3c,null))[_0xe110('0x1a')](handleError(_0x622b3c,null));};exports[_0xe110('0x128')]=function(_0x3b86b6,_0x5e861f){var _0xaa1f3e={};var _0x1e2d72={};var _0x57d7d6;var _0x597b02;return db[_0xe110('0x3d')]['findOne']({'where':{'id':_0x3b86b6[_0xe110('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5e861f,null))[_0xe110('0x11')](function(_0x22e383){if(_0x22e383){_0x57d7d6=_0x22e383;_0x1e2d72[_0xe110('0x4e')]=_[_0xe110('0x50')](db['User'][_0xe110('0x35')]);_0x1e2d72[_0xe110('0x43')]=_[_0xe110('0x50')](_0x3b86b6[_0xe110('0x43')]);_0x1e2d72[_0xe110('0x51')]=_['intersection'](_0x1e2d72[_0xe110('0x4e')],_0x1e2d72['query']);_0xaa1f3e[_0xe110('0x3f')]=_[_0xe110('0xca')](_0x1e2d72['model'],qs['fields'](_0x3b86b6[_0xe110('0x43')]['fields']));_0xaa1f3e[_0xe110('0x3f')]=_0xaa1f3e[_0xe110('0x3f')][_0xe110('0x45')]?_0xaa1f3e[_0xe110('0x3f')]:_0x1e2d72[_0xe110('0x4e')];_0xaa1f3e[_0xe110('0xcb')]=qs['sort'](_0x3b86b6['query'][_0xe110('0xcc')]);_0xaa1f3e[_0xe110('0x3c')]=qs[_0xe110('0x51')](_[_0xe110('0xd6')](_0x3b86b6[_0xe110('0x43')],_0x1e2d72['filters']));if(_0x3b86b6['query'][_0xe110('0x39')]){_0xaa1f3e[_0xe110('0x3c')]=_['merge'](_0xaa1f3e[_0xe110('0x3c')],{'$or':_[_0xe110('0x2d')](_0xaa1f3e[_0xe110('0x3f')],function(_0x55d267){var _0x20b891={};_0x20b891[_0x55d267]={'$like':'%'+_0x3b86b6[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x20b891;})});}_0xaa1f3e[_0xe110('0x4e')]=db['User'];_0xaa1f3e['as']=_0xe110('0x29');_0xaa1f3e=_['merge']({},_0xaa1f3e,_0x3b86b6[_0xe110('0xcd')]);return _0x57d7d6[_0xe110('0x121')]({'include':[_0xaa1f3e]});}})[_0xe110('0x11')](function(_0x580e9f){if(_0x580e9f){var _0x4696a8={},_0x3461d9=[],_0x54bd19=0x0;for(var _0x5734fe=0x0;_0x5734fe<_0x580e9f[_0xe110('0x45')];_0x5734fe+=0x1){for(var _0x4425a6=0x0,_0x3e6366;_0x4425a6<_0x580e9f[_0x5734fe][_0xe110('0x29')][_0xe110('0x45')];_0x4425a6+=0x1){_0x3e6366=_0x580e9f[_0x5734fe][_0xe110('0x29')][_0x4425a6]['get']({'plain':!![]});_0x4696a8[_0x3e6366['id']]=_0x3e6366;}}_0x4696a8=_['values'](_0x4696a8);for(var _0x1d85d3=qs['offset'](_0x3b86b6[_0xe110('0x43')]['offset']);_0x1d85d3<_0x4696a8[_0xe110('0x45')]&&_0x3461d9[_0xe110('0x45')]<qs[_0xe110('0x21')](_0x3b86b6['query'][_0xe110('0x21')]);_0x1d85d3+=0x1){if(_0x4696a8[_0x1d85d3]){_0x3461d9[_0xe110('0x40')](_0x4696a8[_0x1d85d3]);}}return{'count':_0x4696a8['length'],'rows':_0x3461d9};}})[_0xe110('0x11')](respondWithResult(_0x5e861f,null))['catch'](handleError(_0x5e861f,null));};exports[_0xe110('0x25')]=function(_0x4950b9,_0x528cd0){if(_0x4950b9[_0xe110('0x75')]['id']==_0x4950b9[_0xe110('0x4d')]['id']){return _0x528cd0[_0xe110('0x1c')](0x1f4)[_0xe110('0x33')]({'message':_0xe110('0x129')});}return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x4950b9[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x528cd0,null))[_0xe110('0x11')](removeEntity(_0x528cd0,null))['catch'](handleError(_0x528cd0,null));};exports[_0xe110('0x12a')]=function(_0x390640,_0x3849c4){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x390640[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x3849c4,null))[_0xe110('0x11')](function(_0x3d259e){if(_0x3d259e){return _0x3d259e[_0xe110('0x12a')](_0x390640[_0xe110('0x57')]['ids'],_[_0xe110('0x5a')](_0x390640[_0xe110('0x57')],[_0xe110('0x5b'),'id'])||{})[_0xe110('0x9f')](function(){for(var _0x175ffa=0x0;_0x175ffa<_0x390640[_0xe110('0x57')][_0xe110('0x5b')][_0xe110('0x45')];_0x175ffa+=0x1){socket[_0xe110('0xa1')](_0xe110('0x12b'),{'ChatInteractionId':Number(_0x390640['body'][_0xe110('0x5b')][_0x175ffa]),'UserId':Number(_0x390640[_0xe110('0x4d')]['id'])});}return _0x390640[_0xe110('0x57')][_0xe110('0x5b')];});}})[_0xe110('0x11')](respondWithResult(_0x3849c4,null))[_0xe110('0x1a')](handleError(_0x3849c4,null));};exports[_0xe110('0x12c')]=function(_0x5702da,_0x3d5cd9){return db[_0xe110('0x3d')]['find']({'where':{'id':_0x5702da[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x3d5cd9,null))[_0xe110('0x11')](function(_0x1bca29){if(_0x1bca29){return _0x1bca29['removeChatInteractions'](_0x5702da[_0xe110('0x43')][_0xe110('0x5b')])[_0xe110('0x11')](function(){if(_[_0xe110('0xad')](_0x5702da[_0xe110('0x43')][_0xe110('0x5b')])){for(var _0x298929=0x0;_0x298929<_0x5702da['query'][_0xe110('0x5b')]['length'];_0x298929+=0x1){socket[_0xe110('0xa1')](_0xe110('0x12d'),{'ChatInteractionId':Number(_0x5702da['query'][_0xe110('0x5b')][_0x298929]),'UserId':Number(_0x5702da['params']['id'])});}}else{socket[_0xe110('0xa1')](_0xe110('0x12d'),{'ChatInteractionId':Number(_0x5702da[_0xe110('0x43')][_0xe110('0x5b')]),'UserId':Number(_0x5702da[_0xe110('0x4d')]['id'])});}});}})[_0xe110('0x11')](respondWithStatusCode(_0x3d5cd9,null))[_0xe110('0x1a')](handleError(_0x3d5cd9,null));};exports['addMailInteractions']=function(_0x307a8a,_0x9cac5b){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x307a8a['params']['id']}})['then'](handleEntityNotFound(_0x9cac5b,null))[_0xe110('0x11')](function(_0x371cd8){if(_0x371cd8){return _0x371cd8[_0xe110('0x12e')](_0x307a8a[_0xe110('0x57')][_0xe110('0x5b')],_[_0xe110('0x5a')](_0x307a8a[_0xe110('0x57')],[_0xe110('0x5b'),'id'])||{})[_0xe110('0x9f')](function(){for(var _0x57d64f=0x0;_0x57d64f<_0x307a8a['body'][_0xe110('0x5b')][_0xe110('0x45')];_0x57d64f+=0x1){socket[_0xe110('0xa1')](_0xe110('0x12f'),{'MailInteractionId':Number(_0x307a8a[_0xe110('0x57')][_0xe110('0x5b')][_0x57d64f]),'UserId':Number(_0x307a8a[_0xe110('0x4d')]['id'])});}return _0x307a8a[_0xe110('0x57')]['ids'];});}})[_0xe110('0x11')](respondWithResult(_0x9cac5b,null))[_0xe110('0x1a')](handleError(_0x9cac5b,null));};exports[_0xe110('0x130')]=function(_0x210eaf,_0x5d5d5d){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x210eaf[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x5d5d5d,null))[_0xe110('0x11')](function(_0xf69f57){if(_0xf69f57){return _0xf69f57[_0xe110('0x130')](_0x210eaf[_0xe110('0x43')]['ids'])['then'](function(){if(_[_0xe110('0xad')](_0x210eaf[_0xe110('0x43')][_0xe110('0x5b')])){for(var _0x4214ae=0x0;_0x4214ae<_0x210eaf[_0xe110('0x43')][_0xe110('0x5b')][_0xe110('0x45')];_0x4214ae+=0x1){socket[_0xe110('0xa1')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x210eaf[_0xe110('0x43')][_0xe110('0x5b')][_0x4214ae]),'UserId':Number(_0x210eaf[_0xe110('0x4d')]['id'])});}}else{socket[_0xe110('0xa1')](_0xe110('0x131'),{'MailInteractionId':Number(_0x210eaf[_0xe110('0x43')][_0xe110('0x5b')]),'UserId':Number(_0x210eaf['params']['id'])});}});}})[_0xe110('0x11')](respondWithStatusCode(_0x5d5d5d,null))['catch'](handleError(_0x5d5d5d,null));};exports['addFaxInteractions']=function(_0x2a4977,_0x2d25f5){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x2a4977[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x2d25f5,null))[_0xe110('0x11')](function(_0x45dfea){if(_0x45dfea){return _0x45dfea[_0xe110('0x132')](_0x2a4977[_0xe110('0x57')]['ids'],_[_0xe110('0x5a')](_0x2a4977[_0xe110('0x57')],[_0xe110('0x5b'),'id'])||{})[_0xe110('0x9f')](function(){for(var _0x5256db=0x0;_0x5256db<_0x2a4977[_0xe110('0x57')][_0xe110('0x5b')][_0xe110('0x45')];_0x5256db+=0x1){socket['emit'](_0xe110('0x133'),{'FaxInteractionId':Number(_0x2a4977['body'][_0xe110('0x5b')][_0x5256db]),'UserId':Number(_0x2a4977['params']['id'])});}return _0x2a4977['body'][_0xe110('0x5b')];});}})[_0xe110('0x11')](respondWithResult(_0x2d25f5,null))[_0xe110('0x1a')](handleError(_0x2d25f5,null));};exports[_0xe110('0x134')]=function(_0x47d1c8,_0x47ab76){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x47d1c8[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x47ab76,null))['then'](function(_0x581dbb){if(_0x581dbb){return _0x581dbb[_0xe110('0x134')](_0x47d1c8[_0xe110('0x43')][_0xe110('0x5b')])[_0xe110('0x11')](function(){if(_[_0xe110('0xad')](_0x47d1c8[_0xe110('0x43')]['ids'])){for(var _0x36c591=0x0;_0x36c591<_0x47d1c8[_0xe110('0x43')][_0xe110('0x5b')][_0xe110('0x45')];_0x36c591+=0x1){socket[_0xe110('0xa1')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x47d1c8[_0xe110('0x43')][_0xe110('0x5b')][_0x36c591]),'UserId':Number(_0x47d1c8['params']['id'])});}}else{socket['emit'](_0xe110('0x135'),{'FaxInteractionId':Number(_0x47d1c8[_0xe110('0x43')][_0xe110('0x5b')]),'UserId':Number(_0x47d1c8[_0xe110('0x4d')]['id'])});}});}})[_0xe110('0x11')](respondWithStatusCode(_0x47ab76,null))[_0xe110('0x1a')](handleError(_0x47ab76,null));};exports[_0xe110('0x136')]=function(_0x175e46,_0x56aedf){return db[_0xe110('0x3d')]['find']({'where':{'id':_0x175e46[_0xe110('0x4d')]['id']}})['then'](handleEntityNotFound(_0x56aedf,null))[_0xe110('0x11')](function(_0x5d2dd7){if(_0x5d2dd7){return _0x5d2dd7[_0xe110('0x136')](_0x175e46[_0xe110('0x57')][_0xe110('0x5b')],_[_0xe110('0x5a')](_0x175e46['body'],['ids','id'])||{})[_0xe110('0x9f')](function(){for(var _0x3e6609=0x0;_0x3e6609<_0x175e46[_0xe110('0x57')][_0xe110('0x5b')]['length'];_0x3e6609+=0x1){socket[_0xe110('0xa1')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x175e46[_0xe110('0x57')]['ids'][_0x3e6609]),'UserId':Number(_0x175e46['params']['id'])});}return _0x175e46[_0xe110('0x57')][_0xe110('0x5b')];});}})['then'](respondWithResult(_0x56aedf,null))[_0xe110('0x1a')](handleError(_0x56aedf,null));};exports[_0xe110('0x137')]=function(_0x2504cb,_0x4ea8f2){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x2504cb['params']['id']}})['then'](handleEntityNotFound(_0x4ea8f2,null))['then'](function(_0x2edb5d){if(_0x2edb5d){return _0x2edb5d[_0xe110('0x137')](_0x2504cb[_0xe110('0x43')][_0xe110('0x5b')])[_0xe110('0x11')](function(){if(_[_0xe110('0xad')](_0x2504cb[_0xe110('0x43')][_0xe110('0x5b')])){for(var _0x3f1d6f=0x0;_0x3f1d6f<_0x2504cb['query'][_0xe110('0x5b')][_0xe110('0x45')];_0x3f1d6f+=0x1){socket['emit'](_0xe110('0x138'),{'SmsInteractionId':Number(_0x2504cb[_0xe110('0x43')]['ids'][_0x3f1d6f]),'UserId':Number(_0x2504cb['params']['id'])});}}else{socket[_0xe110('0xa1')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x2504cb[_0xe110('0x43')]['ids']),'UserId':Number(_0x2504cb['params']['id'])});}});}})[_0xe110('0x11')](respondWithStatusCode(_0x4ea8f2,null))[_0xe110('0x1a')](handleError(_0x4ea8f2,null));};exports['addOpenchannelInteractions']=function(_0xeb53cd,_0x389843){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0xeb53cd[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x389843,null))['then'](function(_0x7fea45){if(_0x7fea45){return _0x7fea45['addOpenchannelInteractions'](_0xeb53cd[_0xe110('0x57')][_0xe110('0x5b')],_[_0xe110('0x5a')](_0xeb53cd[_0xe110('0x57')],[_0xe110('0x5b'),'id'])||{})[_0xe110('0x9f')](function(){for(var _0x4631d7=0x0;_0x4631d7<_0xeb53cd[_0xe110('0x57')][_0xe110('0x5b')][_0xe110('0x45')];_0x4631d7+=0x1){socket['emit'](_0xe110('0x139'),{'OpenchannelInteractionId':Number(_0xeb53cd['body'][_0xe110('0x5b')][_0x4631d7]),'UserId':Number(_0xeb53cd[_0xe110('0x4d')]['id'])});}return _0xeb53cd['body'][_0xe110('0x5b')];});}})[_0xe110('0x11')](respondWithResult(_0x389843,null))[_0xe110('0x1a')](handleError(_0x389843,null));};exports[_0xe110('0x13a')]=function(_0x4b31c1,_0x169a3d){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x4b31c1['params']['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x169a3d,null))[_0xe110('0x11')](function(_0x5e758e){if(_0x5e758e){return _0x5e758e[_0xe110('0x13a')](_0x4b31c1[_0xe110('0x43')][_0xe110('0x5b')])[_0xe110('0x11')](function(){if(_[_0xe110('0xad')](_0x4b31c1['query']['ids'])){for(var _0x1b862f=0x0;_0x1b862f<_0x4b31c1[_0xe110('0x43')]['ids'][_0xe110('0x45')];_0x1b862f+=0x1){socket[_0xe110('0xa1')](_0xe110('0x13b'),{'OpenchannelInteractionId':Number(_0x4b31c1[_0xe110('0x43')][_0xe110('0x5b')][_0x1b862f]),'UserId':Number(_0x4b31c1['params']['id'])});}}else{socket[_0xe110('0xa1')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x4b31c1[_0xe110('0x43')][_0xe110('0x5b')]),'UserId':Number(_0x4b31c1['params']['id'])});}});}})[_0xe110('0x11')](respondWithStatusCode(_0x169a3d,null))[_0xe110('0x1a')](handleError(_0x169a3d,null));};exports[_0xe110('0x13c')]=function(_0x43e4ad,_0x31c640){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x43e4ad['params']['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x31c640,null))[_0xe110('0x11')](function(_0x558646){if(_0x558646){return _0x558646[_0xe110('0x13c')](_0x43e4ad[_0xe110('0x57')][_0xe110('0x5b')],_[_0xe110('0x5a')](_0x43e4ad[_0xe110('0x57')],[_0xe110('0x5b'),'id'])||{})['spread'](function(){for(var _0x1ba84c=0x0;_0x1ba84c<_0x43e4ad[_0xe110('0x57')][_0xe110('0x5b')][_0xe110('0x45')];_0x1ba84c+=0x1){socket[_0xe110('0xa1')]('user_has_whatsapp_interactions:save',{'WhatsappInteractionId':Number(_0x43e4ad[_0xe110('0x57')][_0xe110('0x5b')][_0x1ba84c]),'UserId':Number(_0x43e4ad[_0xe110('0x4d')]['id'])});}return _0x43e4ad[_0xe110('0x57')][_0xe110('0x5b')];});}})[_0xe110('0x11')](respondWithResult(_0x31c640,null))[_0xe110('0x1a')](handleError(_0x31c640,null));};exports['removeWhatsappInteractions']=function(_0x199d1f,_0x59db72){return db['User'][_0xe110('0x31')]({'where':{'id':_0x199d1f['params']['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x59db72,null))[_0xe110('0x11')](function(_0x415a32){if(_0x415a32){return _0x415a32[_0xe110('0x13d')](_0x199d1f[_0xe110('0x43')]['ids']);}})[_0xe110('0x11')](respondWithStatusCode(_0x59db72,null))[_0xe110('0x1a')](handleError(_0x59db72,null));};exports[_0xe110('0x13e')]=function(_0x4d5c51,_0x34931c){var _0x32fc8e={};var _0x44f189={};var _0x5ad25f;var _0x517965;return db[_0xe110('0x3d')][_0xe110('0x90')]({'where':{'id':_0x4d5c51[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x34931c,null))['then'](function(_0x46b1c7){if(_0x46b1c7){_0x5ad25f=_0x46b1c7;_0x44f189[_0xe110('0x4e')]=_[_0xe110('0x50')](db[_0xe110('0x13f')][_0xe110('0x35')]);_0x44f189[_0xe110('0x43')]=_[_0xe110('0x50')](_0x4d5c51[_0xe110('0x43')]);_0x44f189[_0xe110('0x51')]=_['intersection'](_0x44f189[_0xe110('0x4e')],_0x44f189[_0xe110('0x43')]);_0x32fc8e[_0xe110('0x3f')]=_[_0xe110('0xca')](_0x44f189[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x4d5c51[_0xe110('0x43')][_0xe110('0x52')]));_0x32fc8e['attributes']=_0x32fc8e[_0xe110('0x3f')][_0xe110('0x45')]?_0x32fc8e[_0xe110('0x3f')]:_0x44f189[_0xe110('0x4e')];_0x32fc8e[_0xe110('0xcb')]=qs['sort'](_0x4d5c51['query'][_0xe110('0xcc')]);_0x32fc8e[_0xe110('0x3c')]=qs['filters'](_[_0xe110('0xd6')](_0x4d5c51[_0xe110('0x43')],_0x44f189[_0xe110('0x51')]));if(_0x4d5c51[_0xe110('0x43')][_0xe110('0x39')]){_0x32fc8e[_0xe110('0x3c')]=_[_0xe110('0x54')](_0x32fc8e[_0xe110('0x3c')],{'$or':_[_0xe110('0x2d')](_0x32fc8e[_0xe110('0x3f')],function(_0x1dd804){var _0x4e102d={};_0x4e102d[_0x1dd804]={'$like':'%'+_0x4d5c51[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x4e102d;})});}_0x32fc8e=_[_0xe110('0x54')]({},_0x32fc8e,_0x4d5c51[_0xe110('0xcd')]);return _0x5ad25f[_0xe110('0x13e')](_0x32fc8e);}})[_0xe110('0x11')](function(_0x497309){if(_0x497309){_0x517965=_0x497309[_0xe110('0x45')];if(!_0x4d5c51[_0xe110('0x43')][_0xe110('0xd3')](_0xe110('0xd4'))){_0x32fc8e[_0xe110('0x21')]=qs['limit'](_0x4d5c51[_0xe110('0x43')]['limit']);_0x32fc8e[_0xe110('0x1f')]=qs['offset'](_0x4d5c51[_0xe110('0x43')][_0xe110('0x1f')]);}return _0x5ad25f[_0xe110('0x13e')](_0x32fc8e);}})[_0xe110('0x11')](function(_0x30fd30){if(_0x30fd30){return _0x30fd30?{'count':_0x517965,'rows':_0x30fd30}:null;}})[_0xe110('0x11')](respondWithResult(_0x34931c,null))['catch'](handleError(_0x34931c,null));};exports[_0xe110('0x140')]=function(_0xbd3cb5,_0x2908c3){var _0x27da8c={};var _0x537547={};var _0x2a2b87;var _0x4c1fc0;return db[_0xe110('0x3d')][_0xe110('0x90')]({'where':{'id':_0xbd3cb5[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x2908c3,null))[_0xe110('0x11')](function(_0x5b04e1){if(_0x5b04e1){_0x2a2b87=_0x5b04e1;_0x537547['model']=_['keys'](db['FaxAccount']['rawAttributes']);_0x537547[_0xe110('0x43')]=_[_0xe110('0x50')](_0xbd3cb5[_0xe110('0x43')]);_0x537547[_0xe110('0x51')]=_[_0xe110('0xca')](_0x537547[_0xe110('0x4e')],_0x537547[_0xe110('0x43')]);_0x27da8c[_0xe110('0x3f')]=_[_0xe110('0xca')](_0x537547['model'],qs['fields'](_0xbd3cb5[_0xe110('0x43')][_0xe110('0x52')]));_0x27da8c[_0xe110('0x3f')]=_0x27da8c[_0xe110('0x3f')]['length']?_0x27da8c[_0xe110('0x3f')]:_0x537547[_0xe110('0x4e')];_0x27da8c['order']=qs['sort'](_0xbd3cb5[_0xe110('0x43')][_0xe110('0xcc')]);_0x27da8c['where']=qs[_0xe110('0x51')](_['pick'](_0xbd3cb5[_0xe110('0x43')],_0x537547['filters']));if(_0xbd3cb5[_0xe110('0x43')][_0xe110('0x39')]){_0x27da8c[_0xe110('0x3c')]=_['merge'](_0x27da8c[_0xe110('0x3c')],{'$or':_['map'](_0x27da8c[_0xe110('0x3f')],function(_0xf5d8ff){var _0x15b32d={};_0x15b32d[_0xf5d8ff]={'$like':'%'+_0xbd3cb5[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x15b32d;})});}_0x27da8c=_[_0xe110('0x54')]({},_0x27da8c,_0xbd3cb5[_0xe110('0xcd')]);return _0x2a2b87['getFaxAccounts'](_0x27da8c);}})[_0xe110('0x11')](function(_0x4921c1){if(_0x4921c1){_0x4c1fc0=_0x4921c1[_0xe110('0x45')];if(!_0xbd3cb5[_0xe110('0x43')][_0xe110('0xd3')](_0xe110('0xd4'))){_0x27da8c[_0xe110('0x21')]=qs[_0xe110('0x21')](_0xbd3cb5[_0xe110('0x43')][_0xe110('0x21')]);_0x27da8c[_0xe110('0x1f')]=qs['offset'](_0xbd3cb5['query']['offset']);}return _0x2a2b87[_0xe110('0x140')](_0x27da8c);}})[_0xe110('0x11')](function(_0x4500fa){if(_0x4500fa){return _0x4500fa?{'count':_0x4c1fc0,'rows':_0x4500fa}:null;}})[_0xe110('0x11')](respondWithResult(_0x2908c3,null))[_0xe110('0x1a')](handleError(_0x2908c3,null));};exports[_0xe110('0x141')]=function(_0xe42c6c,_0x31948c){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0xe42c6c[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x31948c,null))['then'](function(_0x166156){if(_0x166156){return _0x166156[_0xe110('0x141')](_0xe42c6c[_0xe110('0x57')][_0xe110('0x5b')],_[_0xe110('0x5a')](_0xe42c6c[_0xe110('0x57')],['ids','id'])||{});}})[_0xe110('0x11')](respondWithResult(_0x31948c,null))[_0xe110('0x1a')](handleError(_0x31948c,null));};exports['removeFaxAccounts']=function(_0x3a81ed,_0x4a1bea){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x3a81ed[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x4a1bea,null))[_0xe110('0x11')](function(_0x47233c){if(_0x47233c){return _0x47233c[_0xe110('0x142')](_0x3a81ed[_0xe110('0x43')][_0xe110('0x5b')]);}})[_0xe110('0x11')](respondWithStatusCode(_0x4a1bea,null))[_0xe110('0x1a')](handleError(_0x4a1bea,null));};exports[_0xe110('0x143')]=function(_0x5a15ed,_0x507570){var _0x5a9e09={};var _0x1f50a6={};var _0x2b3ef3;var _0x590bcf;return db[_0xe110('0x3d')]['findOne']({'where':{'id':_0x5a15ed[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x507570,null))[_0xe110('0x11')](function(_0x34cce6){if(_0x34cce6){_0x2b3ef3=_0x34cce6;_0x1f50a6[_0xe110('0x4e')]=_[_0xe110('0x50')](db[_0xe110('0x144')][_0xe110('0x35')]);_0x1f50a6['query']=_[_0xe110('0x50')](_0x5a15ed[_0xe110('0x43')]);_0x1f50a6[_0xe110('0x51')]=_[_0xe110('0xca')](_0x1f50a6['model'],_0x1f50a6['query']);_0x5a9e09[_0xe110('0x3f')]=_['intersection'](_0x1f50a6['model'],qs[_0xe110('0x52')](_0x5a15ed['query'][_0xe110('0x52')]));_0x5a9e09[_0xe110('0x3f')]=_0x5a9e09[_0xe110('0x3f')][_0xe110('0x45')]?_0x5a9e09['attributes']:_0x1f50a6[_0xe110('0x4e')];_0x5a9e09[_0xe110('0xcb')]=qs[_0xe110('0xcc')](_0x5a15ed[_0xe110('0x43')][_0xe110('0xcc')]);_0x5a9e09[_0xe110('0x3c')]=qs[_0xe110('0x51')](_[_0xe110('0xd6')](_0x5a15ed[_0xe110('0x43')],_0x1f50a6['filters']));if(_0x5a15ed[_0xe110('0x43')]['filter']){_0x5a9e09[_0xe110('0x3c')]=_[_0xe110('0x54')](_0x5a9e09[_0xe110('0x3c')],{'$or':_[_0xe110('0x2d')](_0x5a9e09[_0xe110('0x3f')],function(_0x3811e9){var _0x56f6ab={};_0x56f6ab[_0x3811e9]={'$like':'%'+_0x5a15ed[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x56f6ab;})});}_0x5a9e09=_[_0xe110('0x54')]({},_0x5a9e09,_0x5a15ed[_0xe110('0xcd')]);return _0x2b3ef3[_0xe110('0x143')](_0x5a9e09);}})[_0xe110('0x11')](function(_0xe4d3e0){if(_0xe4d3e0){_0x590bcf=_0xe4d3e0[_0xe110('0x45')];if(!_0x5a15ed[_0xe110('0x43')][_0xe110('0xd3')]('nolimit')){_0x5a9e09[_0xe110('0x21')]=qs['limit'](_0x5a15ed[_0xe110('0x43')][_0xe110('0x21')]);_0x5a9e09[_0xe110('0x1f')]=qs[_0xe110('0x1f')](_0x5a15ed[_0xe110('0x43')][_0xe110('0x1f')]);}return _0x2b3ef3[_0xe110('0x143')](_0x5a9e09);}})['then'](function(_0x467f50){if(_0x467f50){return _0x467f50?{'count':_0x590bcf,'rows':_0x467f50}:null;}})[_0xe110('0x11')](respondWithResult(_0x507570,null))[_0xe110('0x1a')](handleError(_0x507570,null));};exports['addMailAccounts']=function(_0xf1dc50,_0x33d7d9){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0xf1dc50['params']['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x33d7d9,null))[_0xe110('0x11')](function(_0x959abf){if(_0x959abf){return _0x959abf[_0xe110('0x145')](_0xf1dc50[_0xe110('0x57')][_0xe110('0x5b')],_[_0xe110('0x5a')](_0xf1dc50[_0xe110('0x57')],[_0xe110('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x33d7d9,null))[_0xe110('0x1a')](handleError(_0x33d7d9,null));};exports[_0xe110('0x146')]=function(_0x4db755,_0x5a5b64){return db[_0xe110('0x3d')]['find']({'where':{'id':_0x4db755[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x5a5b64,null))[_0xe110('0x11')](function(_0xf236b3){if(_0xf236b3){return _0xf236b3[_0xe110('0x146')](_0x4db755[_0xe110('0x43')][_0xe110('0x5b')]);}})[_0xe110('0x11')](respondWithStatusCode(_0x5a5b64,null))['catch'](handleError(_0x5a5b64,null));};exports[_0xe110('0x147')]=function(_0x59e7fc,_0x32982c){var _0x4b2274={};var _0x2c7492={};var _0x23781d;var _0xdb1740;return db[_0xe110('0x3d')]['findOne']({'where':{'id':_0x59e7fc['params']['id']}})['then'](handleEntityNotFound(_0x32982c,null))[_0xe110('0x11')](function(_0x4a956f){if(_0x4a956f){_0x23781d=_0x4a956f;_0x2c7492['model']=_['keys'](db[_0xe110('0x148')][_0xe110('0x35')]);_0x2c7492[_0xe110('0x43')]=_[_0xe110('0x50')](_0x59e7fc[_0xe110('0x43')]);_0x2c7492['filters']=_['intersection'](_0x2c7492[_0xe110('0x4e')],_0x2c7492['query']);_0x4b2274[_0xe110('0x3f')]=_[_0xe110('0xca')](_0x2c7492[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x59e7fc['query']['fields']));_0x4b2274['attributes']=_0x4b2274[_0xe110('0x3f')][_0xe110('0x45')]?_0x4b2274['attributes']:_0x2c7492[_0xe110('0x4e')];_0x4b2274[_0xe110('0xcb')]=qs[_0xe110('0xcc')](_0x59e7fc[_0xe110('0x43')]['sort']);_0x4b2274[_0xe110('0x3c')]=qs['filters'](_['pick'](_0x59e7fc[_0xe110('0x43')],_0x2c7492[_0xe110('0x51')]));if(_0x59e7fc[_0xe110('0x43')]['filter']){_0x4b2274[_0xe110('0x3c')]=_[_0xe110('0x54')](_0x4b2274[_0xe110('0x3c')],{'$or':_[_0xe110('0x2d')](_0x4b2274[_0xe110('0x3f')],function(_0x3bef82){var _0x192222={};_0x192222[_0x3bef82]={'$like':'%'+_0x59e7fc[_0xe110('0x43')]['filter']+'%'};return _0x192222;})});}_0x4b2274=_[_0xe110('0x54')]({},_0x4b2274,_0x59e7fc[_0xe110('0xcd')]);return _0x23781d[_0xe110('0x147')](_0x4b2274);}})[_0xe110('0x11')](function(_0x24e012){if(_0x24e012){_0xdb1740=_0x24e012['length'];if(!_0x59e7fc[_0xe110('0x43')][_0xe110('0xd3')](_0xe110('0xd4'))){_0x4b2274[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x59e7fc[_0xe110('0x43')][_0xe110('0x21')]);_0x4b2274[_0xe110('0x1f')]=qs[_0xe110('0x1f')](_0x59e7fc['query'][_0xe110('0x1f')]);}return _0x23781d[_0xe110('0x147')](_0x4b2274);}})[_0xe110('0x11')](function(_0x3c308a){if(_0x3c308a){return _0x3c308a?{'count':_0xdb1740,'rows':_0x3c308a}:null;}})['then'](respondWithResult(_0x32982c,null))[_0xe110('0x1a')](handleError(_0x32982c,null));};exports['addOpenchannelAccounts']=function(_0x18eaa5,_0x120537){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x18eaa5[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x120537,null))[_0xe110('0x11')](function(_0x488259){if(_0x488259){return _0x488259[_0xe110('0x149')](_0x18eaa5[_0xe110('0x57')]['ids'],_[_0xe110('0x5a')](_0x18eaa5[_0xe110('0x57')],[_0xe110('0x5b'),'id'])||{});}})[_0xe110('0x11')](respondWithResult(_0x120537,null))[_0xe110('0x1a')](handleError(_0x120537,null));};exports[_0xe110('0x14a')]=function(_0x16e0d4,_0x270733){return db[_0xe110('0x3d')]['find']({'where':{'id':_0x16e0d4[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x270733,null))[_0xe110('0x11')](function(_0x226514){if(_0x226514){return _0x226514[_0xe110('0x14a')](_0x16e0d4[_0xe110('0x43')][_0xe110('0x5b')]);}})[_0xe110('0x11')](respondWithStatusCode(_0x270733,null))['catch'](handleError(_0x270733,null));};exports[_0xe110('0x14b')]=function(_0x51d419,_0x508faa){var _0x294568={};var _0x10754d={};var _0x4fe67a;var _0x24be4d;return db['User'][_0xe110('0x90')]({'where':{'id':_0x51d419[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x508faa,null))['then'](function(_0x376d9a){if(_0x376d9a){_0x4fe67a=_0x376d9a;_0x10754d[_0xe110('0x4e')]=_[_0xe110('0x50')](db['SmsAccount']['rawAttributes']);_0x10754d[_0xe110('0x43')]=_[_0xe110('0x50')](_0x51d419['query']);_0x10754d[_0xe110('0x51')]=_[_0xe110('0xca')](_0x10754d[_0xe110('0x4e')],_0x10754d['query']);_0x294568['attributes']=_[_0xe110('0xca')](_0x10754d[_0xe110('0x4e')],qs['fields'](_0x51d419[_0xe110('0x43')]['fields']));_0x294568['attributes']=_0x294568[_0xe110('0x3f')]['length']?_0x294568[_0xe110('0x3f')]:_0x10754d[_0xe110('0x4e')];_0x294568[_0xe110('0xcb')]=qs[_0xe110('0xcc')](_0x51d419[_0xe110('0x43')][_0xe110('0xcc')]);_0x294568[_0xe110('0x3c')]=qs[_0xe110('0x51')](_[_0xe110('0xd6')](_0x51d419[_0xe110('0x43')],_0x10754d[_0xe110('0x51')]));if(_0x51d419[_0xe110('0x43')][_0xe110('0x39')]){_0x294568[_0xe110('0x3c')]=_[_0xe110('0x54')](_0x294568['where'],{'$or':_[_0xe110('0x2d')](_0x294568[_0xe110('0x3f')],function(_0x5c71a6){var _0x49805f={};_0x49805f[_0x5c71a6]={'$like':'%'+_0x51d419[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x49805f;})});}_0x294568=_[_0xe110('0x54')]({},_0x294568,_0x51d419[_0xe110('0xcd')]);return _0x4fe67a[_0xe110('0x14b')](_0x294568);}})[_0xe110('0x11')](function(_0x410d64){if(_0x410d64){_0x24be4d=_0x410d64[_0xe110('0x45')];if(!_0x51d419[_0xe110('0x43')][_0xe110('0xd3')](_0xe110('0xd4'))){_0x294568[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x51d419[_0xe110('0x43')][_0xe110('0x21')]);_0x294568['offset']=qs[_0xe110('0x1f')](_0x51d419[_0xe110('0x43')][_0xe110('0x1f')]);}return _0x4fe67a[_0xe110('0x14b')](_0x294568);}})[_0xe110('0x11')](function(_0x1ab255){if(_0x1ab255){return _0x1ab255?{'count':_0x24be4d,'rows':_0x1ab255}:null;}})['then'](respondWithResult(_0x508faa,null))['catch'](handleError(_0x508faa,null));};exports[_0xe110('0x14c')]=function(_0x38b5ec,_0xd33bcc){return db['User']['find']({'where':{'id':_0x38b5ec[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0xd33bcc,null))['then'](function(_0x6cc50a){if(_0x6cc50a){return _0x6cc50a[_0xe110('0x14c')](_0x38b5ec[_0xe110('0x57')]['ids'],_[_0xe110('0x5a')](_0x38b5ec[_0xe110('0x57')],[_0xe110('0x5b'),'id'])||{});}})[_0xe110('0x11')](respondWithResult(_0xd33bcc,null))[_0xe110('0x1a')](handleError(_0xd33bcc,null));};exports['removeSmsAccounts']=function(_0x251173,_0x3623f8){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x251173[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x3623f8,null))[_0xe110('0x11')](function(_0x111d4c){if(_0x111d4c){return _0x111d4c['removeSmsAccounts'](_0x251173[_0xe110('0x43')]['ids']);}})[_0xe110('0x11')](respondWithStatusCode(_0x3623f8,null))[_0xe110('0x1a')](handleError(_0x3623f8,null));};exports['getChatWebsites']=function(_0x26be9d,_0x43dcac){var _0x3a2d87={};var _0x15bc6d={};var _0x28f0ee;var _0xea95df;return db[_0xe110('0x3d')][_0xe110('0x90')]({'where':{'id':_0x26be9d[_0xe110('0x4d')]['id']}})['then'](handleEntityNotFound(_0x43dcac,null))[_0xe110('0x11')](function(_0x309090){if(_0x309090){_0x28f0ee=_0x309090;_0x15bc6d[_0xe110('0x4e')]=_[_0xe110('0x50')](db[_0xe110('0x14d')]['rawAttributes']);_0x15bc6d['query']=_[_0xe110('0x50')](_0x26be9d[_0xe110('0x43')]);_0x15bc6d['filters']=_['intersection'](_0x15bc6d[_0xe110('0x4e')],_0x15bc6d[_0xe110('0x43')]);_0x3a2d87[_0xe110('0x3f')]=_['intersection'](_0x15bc6d[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x26be9d['query'][_0xe110('0x52')]));_0x3a2d87['attributes']=_0x3a2d87[_0xe110('0x3f')][_0xe110('0x45')]?_0x3a2d87[_0xe110('0x3f')]:_0x15bc6d[_0xe110('0x4e')];_0x3a2d87[_0xe110('0xcb')]=qs[_0xe110('0xcc')](_0x26be9d[_0xe110('0x43')][_0xe110('0xcc')]);_0x3a2d87[_0xe110('0x3c')]=qs['filters'](_[_0xe110('0xd6')](_0x26be9d[_0xe110('0x43')],_0x15bc6d[_0xe110('0x51')]));if(_0x26be9d['query'][_0xe110('0x39')]){_0x3a2d87[_0xe110('0x3c')]=_['merge'](_0x3a2d87['where'],{'$or':_['map'](_0x3a2d87[_0xe110('0x3f')],function(_0x2e2a93){var _0xb5b97e={};_0xb5b97e[_0x2e2a93]={'$like':'%'+_0x26be9d['query'][_0xe110('0x39')]+'%'};return _0xb5b97e;})});}_0x3a2d87=_['merge']({},_0x3a2d87,_0x26be9d[_0xe110('0xcd')]);return _0x28f0ee[_0xe110('0x14e')](_0x3a2d87);}})[_0xe110('0x11')](function(_0x2360fe){if(_0x2360fe){_0xea95df=_0x2360fe['length'];if(!_0x26be9d[_0xe110('0x43')]['hasOwnProperty']('nolimit')){_0x3a2d87[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x26be9d[_0xe110('0x43')][_0xe110('0x21')]);_0x3a2d87[_0xe110('0x1f')]=qs[_0xe110('0x1f')](_0x26be9d[_0xe110('0x43')][_0xe110('0x1f')]);}return _0x28f0ee[_0xe110('0x14e')](_0x3a2d87);}})[_0xe110('0x11')](function(_0x260df0){if(_0x260df0){return _0x260df0?{'count':_0xea95df,'rows':_0x260df0}:null;}})[_0xe110('0x11')](respondWithResult(_0x43dcac,null))[_0xe110('0x1a')](handleError(_0x43dcac,null));};exports[_0xe110('0x14f')]=function(_0x1fdcf0,_0xebfe22){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x1fdcf0['params']['id']}})[_0xe110('0x11')](handleEntityNotFound(_0xebfe22,null))['then'](function(_0x17c5d1){if(_0x17c5d1){return _0x17c5d1['addChatWebsites'](_0x1fdcf0[_0xe110('0x57')][_0xe110('0x5b')],_['omit'](_0x1fdcf0[_0xe110('0x57')],[_0xe110('0x5b'),'id'])||{});}})[_0xe110('0x11')](respondWithResult(_0xebfe22,null))[_0xe110('0x1a')](handleError(_0xebfe22,null));};exports['removeChatWebsites']=function(_0x255987,_0x1abeed){return db['User'][_0xe110('0x31')]({'where':{'id':_0x255987[_0xe110('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1abeed,null))[_0xe110('0x11')](function(_0x1d9d01){if(_0x1d9d01){return _0x1d9d01[_0xe110('0x150')](_0x255987[_0xe110('0x43')][_0xe110('0x5b')]);}})[_0xe110('0x11')](respondWithStatusCode(_0x1abeed,null))[_0xe110('0x1a')](handleError(_0x1abeed,null));};exports[_0xe110('0x151')]=function(_0x54bb0f,_0xc029de){var _0x5eae7f={};var _0x372717={};var _0x160817;var _0x595e2f;return db['User'][_0xe110('0x90')]({'where':{'id':_0x54bb0f['params']['id']}})[_0xe110('0x11')](handleEntityNotFound(_0xc029de,null))[_0xe110('0x11')](function(_0x2a9b13){if(_0x2a9b13){_0x160817=_0x2a9b13;_0x372717[_0xe110('0x4e')]=_[_0xe110('0x50')](db['WhatsappAccount']['rawAttributes']);_0x372717[_0xe110('0x43')]=_['keys'](_0x54bb0f['query']);_0x372717[_0xe110('0x51')]=_[_0xe110('0xca')](_0x372717[_0xe110('0x4e')],_0x372717[_0xe110('0x43')]);_0x5eae7f[_0xe110('0x3f')]=_[_0xe110('0xca')](_0x372717[_0xe110('0x4e')],qs['fields'](_0x54bb0f['query'][_0xe110('0x52')]));_0x5eae7f[_0xe110('0x3f')]=_0x5eae7f[_0xe110('0x3f')][_0xe110('0x45')]?_0x5eae7f[_0xe110('0x3f')]:_0x372717[_0xe110('0x4e')];_0x5eae7f[_0xe110('0xcb')]=qs['sort'](_0x54bb0f[_0xe110('0x43')][_0xe110('0xcc')]);_0x5eae7f[_0xe110('0x3c')]=qs[_0xe110('0x51')](_[_0xe110('0xd6')](_0x54bb0f[_0xe110('0x43')],_0x372717[_0xe110('0x51')]));if(_0x54bb0f[_0xe110('0x43')]['filter']){_0x5eae7f[_0xe110('0x3c')]=_[_0xe110('0x54')](_0x5eae7f[_0xe110('0x3c')],{'$or':_['map'](_0x5eae7f['attributes'],function(_0x5a1889){var _0x461354={};_0x461354[_0x5a1889]={'$like':'%'+_0x54bb0f[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x461354;})});}_0x5eae7f=_['merge']({},_0x5eae7f,_0x54bb0f[_0xe110('0xcd')]);return _0x160817[_0xe110('0x151')](_0x5eae7f);}})[_0xe110('0x11')](function(_0x1ca0e6){if(_0x1ca0e6){_0x595e2f=_0x1ca0e6[_0xe110('0x45')];if(!_0x54bb0f[_0xe110('0x43')][_0xe110('0xd3')](_0xe110('0xd4'))){_0x5eae7f[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x54bb0f[_0xe110('0x43')]['limit']);_0x5eae7f['offset']=qs['offset'](_0x54bb0f[_0xe110('0x43')]['offset']);}return _0x160817[_0xe110('0x151')](_0x5eae7f);}})[_0xe110('0x11')](function(_0x54d8bf){if(_0x54d8bf){return _0x54d8bf?{'count':_0x595e2f,'rows':_0x54d8bf}:null;}})['then'](respondWithResult(_0xc029de,null))['catch'](handleError(_0xc029de,null));};exports['addWhatsappAccounts']=function(_0x1e23a0,_0xde91df){return db[_0xe110('0x3d')]['find']({'where':{'id':_0x1e23a0[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0xde91df,null))[_0xe110('0x11')](function(_0x2cc884){if(_0x2cc884){return _0x2cc884[_0xe110('0x152')](_0x1e23a0[_0xe110('0x57')]['ids'],_['omit'](_0x1e23a0[_0xe110('0x57')],[_0xe110('0x5b'),'id'])||{});}})[_0xe110('0x11')](respondWithResult(_0xde91df,null))[_0xe110('0x1a')](handleError(_0xde91df,null));};exports[_0xe110('0x153')]=function(_0x23fe9e,_0x2be49b){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x23fe9e[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x2be49b,null))[_0xe110('0x11')](function(_0x48b575){if(_0x48b575){return _0x48b575['removeWhatsappAccounts'](_0x23fe9e[_0xe110('0x43')][_0xe110('0x5b')]);}})['then'](respondWithStatusCode(_0x2be49b,null))[_0xe110('0x1a')](handleError(_0x2be49b,null));};exports[_0xe110('0x154')]=function(_0xe8bc95,_0x35173b){var _0x3971d6={};var _0x425375={};var _0x559d6d;var _0xebd1d2;return db[_0xe110('0x3d')][_0xe110('0x90')]({'where':{'id':_0xe8bc95[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x35173b,null))['then'](function(_0x11d346){if(_0x11d346){_0x559d6d=_0x11d346;_0x425375['model']=_[_0xe110('0x50')](db[_0xe110('0x155')]['rawAttributes']);_0x425375[_0xe110('0x43')]=_[_0xe110('0x50')](_0xe8bc95[_0xe110('0x43')]);_0x425375['filters']=_[_0xe110('0xca')](_0x425375[_0xe110('0x4e')],_0x425375['query']);_0x3971d6[_0xe110('0x3f')]=_[_0xe110('0xca')](_0x425375[_0xe110('0x4e')],qs['fields'](_0xe8bc95[_0xe110('0x43')][_0xe110('0x52')]));_0x3971d6[_0xe110('0x3f')]=_0x3971d6[_0xe110('0x3f')]['length']?_0x3971d6[_0xe110('0x3f')]:_0x425375['model'];_0x3971d6[_0xe110('0xcb')]=qs[_0xe110('0xcc')](_0xe8bc95[_0xe110('0x43')][_0xe110('0xcc')]);_0x3971d6['where']=qs[_0xe110('0x51')](_[_0xe110('0xd6')](_0xe8bc95[_0xe110('0x43')],_0x425375[_0xe110('0x51')]));if(_0xe8bc95[_0xe110('0x43')]['filter']){_0x3971d6[_0xe110('0x3c')]=_[_0xe110('0x54')](_0x3971d6[_0xe110('0x3c')],{'$or':_[_0xe110('0x2d')](_0x3971d6[_0xe110('0x3f')],function(_0x24d9b6){var _0x10a057={};_0x10a057[_0x24d9b6]={'$like':'%'+_0xe8bc95['query'][_0xe110('0x39')]+'%'};return _0x10a057;})});}_0x3971d6=_[_0xe110('0x54')]({},_0x3971d6,_0xe8bc95[_0xe110('0xcd')]);return _0x559d6d[_0xe110('0x154')](_0x3971d6);}})[_0xe110('0x11')](function(_0x1ecab6){if(_0x1ecab6){_0xebd1d2=_0x1ecab6['length'];if(!_0xe8bc95['query']['hasOwnProperty']('nolimit')){_0x3971d6['limit']=qs[_0xe110('0x21')](_0xe8bc95[_0xe110('0x43')][_0xe110('0x21')]);_0x3971d6['offset']=qs[_0xe110('0x1f')](_0xe8bc95[_0xe110('0x43')][_0xe110('0x1f')]);}return _0x559d6d[_0xe110('0x154')](_0x3971d6);}})[_0xe110('0x11')](function(_0x55ddbc){if(_0x55ddbc){return _0x55ddbc?{'count':_0xebd1d2,'rows':_0x55ddbc}:null;}})['then'](respondWithResult(_0x35173b,null))[_0xe110('0x1a')](handleError(_0x35173b,null));};exports[_0xe110('0x156')]=function(_0x2c0377,_0x31704c){return db['User']['find']({'where':{'id':_0x2c0377[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x31704c,null))[_0xe110('0x11')](function(_0x20fe76){if(_0x20fe76){return _0x20fe76['addSquareProjects'](_0x2c0377['body'][_0xe110('0x5b')],_[_0xe110('0x5a')](_0x2c0377[_0xe110('0x57')],['ids','id'])||{});}})[_0xe110('0x11')](respondWithResult(_0x31704c,null))[_0xe110('0x1a')](handleError(_0x31704c,null));};exports[_0xe110('0x157')]=function(_0x1fd75e,_0x51181c){return db['User'][_0xe110('0x31')]({'where':{'id':_0x1fd75e[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x51181c,null))[_0xe110('0x11')](function(_0x1dfd64){if(_0x1dfd64){return _0x1dfd64[_0xe110('0x157')](_0x1fd75e[_0xe110('0x43')][_0xe110('0x5b')]);}})[_0xe110('0x11')](respondWithStatusCode(_0x51181c,null))['catch'](handleError(_0x51181c,null));};exports[_0xe110('0x158')]=function(_0x1916e4,_0x1df306){var _0x428ff2={},_0x1bfc9f={},_0x5b20ac={'count':0x0,'rows':[]};var _0x37e9b3=db[_0xe110('0x159')][_0xe110('0x35')];_0x1bfc9f[_0xe110('0x4e')]=_[_0xe110('0x50')](_0x37e9b3);_0x1bfc9f[_0xe110('0x43')]=_['keys'](_0x1916e4['query']);_0x1bfc9f[_0xe110('0x51')]=_['intersection'](_0x1bfc9f[_0xe110('0x4e')],_0x1bfc9f['query']);_0x1bfc9f['filters']=_[_0xe110('0xfb')](_0x1bfc9f['filters'],[_0xe110('0x15a'),_0xe110('0x15b'),'$gt',_0xe110('0x15c'),_0xe110('0x15d'),_0xe110('0x15e'),_0xe110('0x15f'),'$eq',_0xe110('0x160'),_0xe110('0x161'),'$notBetween',_0xe110('0x162'),'$notIn','$like','$notLike',_0xe110('0x163'),_0xe110('0x164'),_0xe110('0x165'),_0xe110('0x166'),_0xe110('0x167'),'$contained',_0xe110('0x168')]);_0x428ff2[_0xe110('0x3f')]=_[_0xe110('0xca')](_0x1bfc9f[_0xe110('0x4e')],qs[_0xe110('0x52')](_0x1916e4['query'][_0xe110('0x52')]));_0x428ff2[_0xe110('0x3f')]=_0x428ff2[_0xe110('0x3f')][_0xe110('0x45')]?_0x428ff2[_0xe110('0x3f')]:_0x1bfc9f[_0xe110('0x4e')];if(!_0x1916e4[_0xe110('0x43')]['hasOwnProperty'](_0xe110('0xd4'))){_0x428ff2[_0xe110('0x21')]=qs[_0xe110('0x21')](_0x1916e4[_0xe110('0x43')][_0xe110('0x21')]);_0x428ff2[_0xe110('0x1f')]=qs[_0xe110('0x1f')](_0x1916e4[_0xe110('0x43')][_0xe110('0x1f')]);}_0x428ff2[_0xe110('0xcb')]=qs['sort'](_0x1916e4[_0xe110('0x43')]['sort']);_0x428ff2['where']=qs[_0xe110('0x51')](_['pick'](_0x1916e4[_0xe110('0x43')],_0x1bfc9f[_0xe110('0x51')]));if(_0x1916e4[_0xe110('0x43')][_0xe110('0x39')]){_0x428ff2[_0xe110('0x3c')]=_['merge'](_0x428ff2['where'],{'$or':_[_0xe110('0x2d')](_0x428ff2[_0xe110('0x3f')],function(_0xda4d48){var _0x147c18={};_0x147c18[_0xda4d48]={'$like':'%'+_0x1916e4[_0xe110('0x43')][_0xe110('0x39')]+'%'};return _0x147c18;})});}_0x428ff2[_0xe110('0x3c')]={'$and':[_0x428ff2[_0xe110('0x3c')],{'$or':[{'UserId':_0x1916e4[_0xe110('0x4d')]['id']},{'OwnerId':_0x1916e4[_0xe110('0x4d')]['id']}]}]};_0x428ff2=_['merge']({},_0x428ff2,_0x1916e4[_0xe110('0xcd')]);var _0xfb4920={'where':_0x428ff2[_0xe110('0x3c')]};return db['CmHopper'][_0xe110('0x22')](_0xfb4920)[_0xe110('0x11')](function(_0x152ab7){_0x5b20ac['count']=_0x152ab7;if(_0x1916e4[_0xe110('0x43')]['includeAll']){_0x428ff2['include']=[{'attributes':['id',_0xe110('0x169'),'lastName',_0xe110('0xec')],'model':db[_0xe110('0xc9')],'as':'Contact'},{'attributes':['id',_0xe110('0x32'),'dialActive'],'model':db[_0xe110('0xa4')],'as':_0xe110('0xd5')}];}return db[_0xe110('0x159')][_0xe110('0x41')](_0x428ff2);})[_0xe110('0x11')](function(_0x1edea4){_0x5b20ac[_0xe110('0x42')]=_0x1edea4;return _0x5b20ac;})[_0xe110('0x11')](respondWithFilteredResult(_0x1df306,_0x428ff2))[_0xe110('0x1a')](handleError(_0x1df306,null));};exports[_0xe110('0x16a')]=function(_0x4820ee,_0x135f24){if(!_[_0xe110('0x5f')](_0x4820ee[_0xe110('0x75')]['id'])&&(_0x4820ee['user']['role']==_0xe110('0x27')||_0x4820ee[_0xe110('0x75')][_0xe110('0x30')]==_0xe110('0x75'))){return db[_0xe110('0x3d')][_0xe110('0x90')]({'where':{'id':_0x4820ee['params']['id']},'raw':!![]})[_0xe110('0x11')](function(_0x5ed43e){return authService[_0xe110('0x16b')](_0x5ed43e);})[_0xe110('0x11')](function(_0x4596b3){if(_0x4596b3){return _0x135f24[_0xe110('0x1c')](0xc8)['json']({'api_key':_0x4596b3[_0xe110('0x16c')]});}else{return _0x135f24['status'](0xcc)[_0xe110('0x1e')]({'message':_0xe110('0x16d')});}})['catch'](handleError(_0x135f24,0x193));}else{return _0x135f24[_0xe110('0x1c')](0x191)[_0xe110('0x1e')]({'message':_0xe110('0x16e')});}};exports[_0xe110('0x16f')]=function(_0x21d3e5,_0xfa2a48){if(!_[_0xe110('0x5f')](_0x21d3e5[_0xe110('0x75')]['id'])&&(_0x21d3e5[_0xe110('0x75')][_0xe110('0x30')]==_0xe110('0x27')||_0x21d3e5[_0xe110('0x75')][_0xe110('0x30')]=='user')){return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x21d3e5['params']['id']}})[_0xe110('0x11')](function(_0x43e4b1){return authService[_0xe110('0x170')](_0x43e4b1);})[_0xe110('0x11')](function(_0x226b68){return db['User']['update']({'apiKeyIat':_0x226b68[_0xe110('0x171')],'apiKeyNonce':_0x226b68['nonce']},{'where':{'id':_0x21d3e5[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](function(){return _0xfa2a48[_0xe110('0x1c')](0xc8)[_0xe110('0x1e')]({'api_key':_0x226b68['token']});});})['catch'](handleError(_0xfa2a48,0x193));}else{return _0xfa2a48[_0xe110('0x1c')](0x191)[_0xe110('0x1e')]({'message':_0xe110('0x16e')});}};exports[_0xe110('0x172')]=function(_0x5c3ee4,_0x3145ef){if(!_['isNil'](_0x5c3ee4[_0xe110('0x75')]['id'])&&(_0x5c3ee4[_0xe110('0x75')][_0xe110('0x30')]==_0xe110('0x27')||_0x5c3ee4[_0xe110('0x75')][_0xe110('0x30')]=='user')){return db[_0xe110('0x3d')]['find']({'where':{'id':_0x5c3ee4[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x3145ef,null))[_0xe110('0x11')](function(_0x1e1cdf){if(_0x1e1cdf&&_0x1e1cdf[_0xe110('0x173')]&&_0x1e1cdf[_0xe110('0x174')])return _0x1e1cdf;else throw{'message':_0xe110('0x175')};})[_0xe110('0x11')](function(_0x22668a){return db['User'][_0xe110('0xfc')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x5c3ee4[_0xe110('0x4d')]['id']}});})[_0xe110('0x11')](respondWithStatusCode(_0x3145ef,0xc8))[_0xe110('0x1a')](handleError(_0x3145ef,0x193));}else{return _0x3145ef['status'](0x191)['json']({'message':_0xe110('0x16e')});}};exports['whoami']=function(_0x4bf694,_0x5b7628){var _0x5866f3=_0x4bf694['user'][_0xe110('0x26')]({'plain':!![]});if(!_0x5866f3){return _0x5b7628[_0xe110('0x1c')](0x191)['send'](_0xe110('0x176'));}else{return _0x5b7628[_0xe110('0x1c')](0xc8)[_0xe110('0x1e')](_0x5866f3);}};exports[_0xe110('0x177')]=function(_0xc01f23,_0x26f14a){var _0x141812={'offset':0x0},_0x1a1f1d={'count':0x0,'rows':[]};Promise[_0xe110('0xfd')]()[_0xe110('0x11')](function(){if(!_0xc01f23[_0xe110('0x43')][_0xe110('0x39')]&&!_0xc01f23[_0xe110('0x43')][_0xe110('0x178')]&&!_0xc01f23[_0xe110('0x43')]['queues'])return[];return Promise[_0xe110('0xfd')]()[_0xe110('0x11')](function(){var _0x57f7ae=[];if(!_['isEmpty'](_0xc01f23[_0xe110('0x43')][_0xe110('0x178')])){_0x57f7ae[_0xe110('0x40')](db['Team'][_0xe110('0x41')]({'attributes':['id',_0xe110('0x32')],'where':{'id':_0xc01f23[_0xe110('0x43')][_0xe110('0x178')]}}));}if(!_[_0xe110('0x83')](_0xc01f23[_0xe110('0x43')][_0xe110('0x179')])){_0x57f7ae[_0xe110('0x40')](db['VoiceQueue'][_0xe110('0x41')]({'attributes':['id',_0xe110('0x32')],'type':_0xe110('0x17a'),'where':{'id':_0xc01f23[_0xe110('0x43')][_0xe110('0x179')]}}));}return Promise[_0xe110('0x4b')](_0x57f7ae);})['then'](function(_0x193421){var _0x371ab0=_['flatten'](_0x193421)[_0xe110('0x2d')](function(_0x397742){return _0x397742[_0xe110('0x128')]({'attributes':['id',_0xe110('0x32'),_0xe110('0x5c'),_0xe110('0x97')],'raw':!![]});});return Promise[_0xe110('0x4b')](_0x371ab0);})[_0xe110('0x11')](function(_0x32875f){var _0x1ae154=_[_0xe110('0x17b')](_0x32875f);if(!_0xc01f23[_0xe110('0x43')][_0xe110('0x39')])return _0x1ae154;if(_[_0xe110('0x83')](_0x1ae154)){return db['User']['findAll']({'attributes':['id',_0xe110('0x32'),_0xe110('0x5c'),'online'],'where':{'role':'agent','$or':[db[_0xe110('0x61')][_0xe110('0x3c')](db[_0xe110('0x61')]['fn'](_0xe110('0x17c'),db['sequelize'][_0xe110('0x17d')]('name')),{'$like':'%'+_0xc01f23[_0xe110('0x43')][_0xe110('0x39')][_0xe110('0x9e')]()+'%'}),{'internal':{'$like':'%'+_0xc01f23[_0xe110('0x43')]['filter']+'%'}}]},'raw':!![]});}else{return _(_0x1ae154)[_0xe110('0x17b')]()[_0xe110('0x39')](function(_0x5e5519){return _0x5e5519[_0xe110('0x32')]['toLowerCase']()[_0xe110('0x2f')](_0xc01f23['query'][_0xe110('0x39')][_0xe110('0x9e')]())||_0x5e5519['internal'][_0xe110('0x17e')]()['includes'](_0xc01f23[_0xe110('0x43')][_0xe110('0x39')]);})[_0xe110('0x2e')]();}})['then'](function(_0x16e526){var _0x4a1494=_0xe110('0x32');var _0x9ace86=_0xe110('0x17f');if(_0xc01f23['query']['sort']){var _0x9ace86=_0xc01f23[_0xe110('0x43')]['sort'][0x0]==='-'?_0xe110('0x180'):_0xe110('0x17f');var _0x4a1494=_0x9ace86==='asc'?_0xc01f23[_0xe110('0x43')][_0xe110('0xcc')]:_0xc01f23[_0xe110('0x43')][_0xe110('0xcc')][_0xe110('0x181')](0x1);}return _(_0x16e526)['uniqBy']('id')[_0xe110('0x182')]([function(_0x77449){return _0x4a1494===_0xe110('0x32')?_0x77449[_0x4a1494][_0xe110('0x9e')]():_0x77449[_0x4a1494];}],[_0x9ace86])['map'](function(_0x4a2ad2){return _[_0xe110('0xd6')](_0x4a2ad2,['id','name',_0xe110('0x5c'),_0xe110('0x97')]);})[_0xe110('0x2e')]();})[_0xe110('0x11')](function(_0x106011){return client[_0xe110('0x183')]('Agents',_0xc01f23)[_0xe110('0x11')](function(_0x1b83cf){if(_0x1b83cf['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x4aaadf=_0x1b83cf['result'];var _0x54476c=jayson[_0xe110('0xf')][_0xe110('0x10')]({'port':0x232c});return _0x54476c['request']('Agents',_0xc01f23)['then'](function(_0x4bd673){if(_0x4bd673['error'])throw new Error(_0xe110('0x184'));var _0x3b7e93=_0x4bd673[_0xe110('0x19')];return _['merge']({},_0x3b7e93,_0x4aaadf);});})[_0xe110('0x11')](function(_0x512b8e){return _['map'](_0x106011,function(_0x41ef09){var _0x30883c=_[_0xe110('0x31')](_0x512b8e[_0xe110('0x42')],['id',_0x41ef09['id']]);if(!_0x30883c||!_0x41ef09[_0xe110('0x97')]){_0x41ef09['status']=_0xe110('0x185');}else if(_0x30883c['voicePause']){_0x41ef09[_0xe110('0x1c')]='pause';}else{_0x41ef09[_0xe110('0x1c')]=_[_0xe110('0x2f')](['idle',_0xe110('0x186'),'unavailable',_0xe110('0x187'),null,undefined],_0x30883c[_0xe110('0x188')])?'online':'busy';}return _0x41ef09;});});});})[_0xe110('0x11')](function(_0x40d927){if(!_0xc01f23[_0xe110('0x43')]['hasOwnProperty'](_0xe110('0xd4'))){_0x141812[_0xe110('0x21')]=qs['limit'](_0xc01f23[_0xe110('0x43')][_0xe110('0x21')]||0xa);_0x141812[_0xe110('0x1f')]=qs[_0xe110('0x1f')](_0xc01f23[_0xe110('0x43')][_0xe110('0x1f')]);}_0x1a1f1d[_0xe110('0x22')]=_0x40d927[_0xe110('0x45')];_0x1a1f1d['rows']=_0x141812[_0xe110('0x21')]?_0x40d927[_0xe110('0x189')](_0x141812[_0xe110('0x1f')],_0x141812[_0xe110('0x1f')]+_0x141812[_0xe110('0x21')]):_0x40d927;return _0x1a1f1d;})[_0xe110('0x11')](respondWithFilteredResult(_0x26f14a,_0x141812))[_0xe110('0x1a')](handleError(_0x26f14a,null));};function get_open_tabs(_0x435182,_0x3c47ec){var _0x254e08=_0x435182[_0xe110('0x18a')](0x0)[_0xe110('0x18b')]()+_0x435182['slice'](0x1);var _0x1410cd={'type':db[_0xe110('0x8d')][_0xe110('0x62')]['SELECT'],'raw':!![]};return new BPromise(function(_0xe685ad,_0x5839d4){var _0x3d71cf=squel['select']()[_0xe110('0x18c')](_0xe110('0x18d')+_0x254e08+_0xe110('0x18e'),'id')[_0xe110('0x18c')](_0xe110('0x18f'))['from']('user_has_'+_0x435182+'_interactions','ui')[_0xe110('0x3c')]('ui.UserId\x20=\x20?',_0x3c47ec['id']);return db['sequelize'][_0xe110('0x43')](_0x3d71cf['toString'](),_0x1410cd)[_0xe110('0x11')](function(_0x35ce53){_0x3c47ec[_0x254e08+_0xe110('0x190')]=_0x35ce53;_0xe685ad(_0x35ce53);})[_0xe110('0x1a')](function(_0x4661b6){_0x5839d4(_0x4661b6);});});};
\ No newline at end of file
+var _0xdc15=['getMailQueues','transaction','removeAgent','UserVoicePrefix','getLists','getAgents','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','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','getVoicePrefixes','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$gt','$gte','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notILike','$overlap','$contains','$contained','firstName','lastName','phone','Contact','getApiKey','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','token','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','isEmpty','inbound','col','asc','desc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unavailable','ringing','slice','charAt','toUpperCase','select','field','ui.','InteractionId','user_has_','toString','OpenTabs','moment','util','path','lodash','squel','jayson/promise','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','request','then','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','get','role','admin','Users','agent','Telephones','telephone','filter','map','value','includes','name','UserProfileResource','destroy','stack','send','index','User','rawAttributes','fieldName','key','password','salt','where','query','includeAll','include','attributes','rows','length','push','chat','dataValues','fax','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','intersection','fields','merge','find','openTabs','true','sms','body','describe','addContacts','ids','internal','Setting','validatePasswordPattern','max','min_internal','isNil','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','fullname','email','permissions','101','102','103','104','105','106','107','109','100','111','114','115','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Agents','autoAssociation','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','VoiceMail','findAll','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordHistory','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','interface','Unknown\x20channel','add','capitalize','Queues','spread','toLowerCase','QueueId','emit','Queue:save','VoiceQueue','voice','SIP/%s','penalty','channel','isValidChannel','isArray','Queue:remove','UserVoiceQueueRt','addAvatar','file','getAvatar','join','server/files/images/logos/default_profile.png','userpic','download','existsSync','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','CmContact','filters','sort','pick','options','hasOwnProperty','CmList','Tags','tag','nolimit','getQueues','Queue','order','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','ScreenRecording','ChatInteraction','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','mobile','format','intrf','user:%s','x-forwarded-for','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','forEach','getChannels','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','MemberReport','YYYY-MM-DD\x20HH:mm:ss','pause','QueuePause','updateAttributes','type','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','openchannelPause','whatsapppause','unpause','manual','%s%s','Pause','getTeams','Team','addTeams','omit','Voice','Chat','Mail','getSmsQueues','setDataValue','Sms','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','flatten','addAgent','getDataValue','TeamVoicePrefix','VoicePrefixId','removeTeams','getChatQueues'];(function(_0x2c336c,_0x4eeb20){var _0x48e2e5=function(_0x201943){while(--_0x201943){_0x2c336c['push'](_0x2c336c['shift']());}};_0x48e2e5(++_0x4eeb20);}(_0xdc15,0x1f3));var _0x5dc1=function(_0x458363,_0x1675db){_0x458363=_0x458363-0x0;var _0x4d0290=_0xdc15[_0x458363];return _0x4d0290;};'use strict';var moment=require(_0x5dc1('0x0'));var BPromise=require('bluebird');var util=require(_0x5dc1('0x1'));var path=require(_0x5dc1('0x2'));var fs=require('fs');var _=require(_0x5dc1('0x3'));var squel=require(_0x5dc1('0x4'));var jayson=require(_0x5dc1('0x5'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var logger=require(_0x5dc1('0x6'))('api');var utils=require('../../config/utils');var config=require(_0x5dc1('0x7'));var licenseUtil=require(_0x5dc1('0x8'));var db=require(_0x5dc1('0x9'))['db'];var socket=require(_0x5dc1('0xa'))(new Redis(config[_0x5dc1('0xb')]));require(_0x5dc1('0xc'))[_0x5dc1('0xd')](socket);config[_0x5dc1('0xb')]=_[_0x5dc1('0xe')](config[_0x5dc1('0xb')],{'host':_0x5dc1('0xf'),'port':0x18eb});var client=jayson['client']['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x181c35,_0x55e426,_0x58dd3f,_0x2f1526){return new BPromise(function(_0xf78569,_0xd473b){var _0xc03a69=_0x2f1526||client;return _0xc03a69[_0x5dc1('0x10')](_0x181c35,_0x58dd3f)[_0x5dc1('0x11')](function(_0x284e2a){logger['info'](_0x5dc1('0x12'),_0x55e426,_0x5dc1('0x13'));logger['debug'](_0x5dc1('0x14'),_0x55e426,_0x5dc1('0x13'),JSON['stringify'](_0x284e2a));if(_0x284e2a[_0x5dc1('0x15')]){if(_0x284e2a[_0x5dc1('0x15')][_0x5dc1('0x16')]===0x1f4){logger['error'](_0x5dc1('0x12'),_0x55e426,_0x284e2a['error']['message']);return _0xd473b(_0x284e2a[_0x5dc1('0x15')][_0x5dc1('0x17')]);}logger[_0x5dc1('0x15')]('User,\x20%s,\x20%s',_0x55e426,_0x284e2a[_0x5dc1('0x15')][_0x5dc1('0x17')]);return _0xf78569(_0x284e2a[_0x5dc1('0x15')][_0x5dc1('0x17')]);}else{logger[_0x5dc1('0x18')](_0x5dc1('0x12'),_0x55e426,_0x5dc1('0x13'));_0xf78569(_0x284e2a[_0x5dc1('0x19')]['message']);}})[_0x5dc1('0x1a')](function(_0xdcd30f){logger[_0x5dc1('0x15')](_0x5dc1('0x12'),_0x55e426,_0xdcd30f);_0xd473b(_0xdcd30f);});});}function respondWithStatusCode(_0x263634,_0x6ecab3){_0x6ecab3=_0x6ecab3||0xcc;return function(_0x4d9355){if(_0x4d9355){return _0x263634[_0x5dc1('0x1b')](_0x6ecab3);}return _0x263634[_0x5dc1('0x1c')](_0x6ecab3)[_0x5dc1('0x1d')]();};}function respondWithResult(_0x3ae1f3,_0x4c2a54){_0x4c2a54=_0x4c2a54||0xc8;return function(_0x565f44){if(_0x565f44){return _0x3ae1f3[_0x5dc1('0x1c')](_0x4c2a54)[_0x5dc1('0x1e')](_0x565f44);}};}function respondWithFilteredResult(_0x9c16a1,_0x26ee71){return function(_0x4158fc){if(_0x4158fc){var _0x36a047=typeof _0x26ee71[_0x5dc1('0x1f')]==='undefined'&&typeof _0x26ee71[_0x5dc1('0x20')]===_0x5dc1('0x21');var _0x531c00=_0x4158fc[_0x5dc1('0x22')];var _0x435d99=_0x36a047?0x0:_0x26ee71[_0x5dc1('0x1f')];var _0x314ad3=_0x36a047?_0x4158fc[_0x5dc1('0x22')]:_0x26ee71[_0x5dc1('0x1f')]+_0x26ee71[_0x5dc1('0x20')];var _0x2a13f9;if(_0x314ad3>=_0x531c00){_0x314ad3=_0x531c00;_0x2a13f9=0xc8;}else{_0x2a13f9=0xce;}_0x9c16a1[_0x5dc1('0x1c')](_0x2a13f9);return _0x9c16a1[_0x5dc1('0x23')](_0x5dc1('0x24'),_0x435d99+'-'+_0x314ad3+'/'+_0x531c00)[_0x5dc1('0x1e')](_0x4158fc);}return null;};}function saveUpdates(_0x1d7677){return function(_0xe70dec){if(_0xe70dec){return _0xe70dec[_0x5dc1('0x25')](_0x1d7677)[_0x5dc1('0x11')](function(_0x2963f5){return _0x2963f5;});}return null;};}function removeEntity(_0x3295f2){return function(_0x34ced0){if(_0x34ced0){return _0x34ced0['destroy']()[_0x5dc1('0x11')](function(){var _0x3ab569=_0x34ced0[_0x5dc1('0x26')]({'plain':!![]});if(_0x3ab569[_0x5dc1('0x27')]===_0x5dc1('0x28'))return;var _0x5263bb=[{'name':_0x5dc1('0x29'),'value':'user','ignore':!![]},{'name':'Agents','value':_0x5dc1('0x2a'),'ignore':![]},{'name':_0x5dc1('0x2b'),'value':_0x5dc1('0x2c'),'ignore':![]}];var _0x2ec6fe=_(_0x5263bb)[_0x5dc1('0x2d')]('ignore')[_0x5dc1('0x2e')](_0x5dc1('0x2f'))[_0x5dc1('0x2f')]();if(_[_0x5dc1('0x30')](_0x2ec6fe,_0x3ab569[_0x5dc1('0x27')])){return;}var _0x9b166c=_['find'](_0x5263bb,[_0x5dc1('0x2f'),_0x3ab569[_0x5dc1('0x27')]])[_0x5dc1('0x31')];return db[_0x5dc1('0x32')][_0x5dc1('0x33')]({'where':{'type':_0x9b166c,'resourceId':_0x3ab569['id']}})[_0x5dc1('0x11')](function(){return _0x34ced0;});})[_0x5dc1('0x11')](function(){_0x3295f2[_0x5dc1('0x1c')](0xcc)[_0x5dc1('0x1d')]();});}};}function handleEntityNotFound(_0x3a4178){return function(_0x1f1119){if(!_0x1f1119){_0x3a4178[_0x5dc1('0x1b')](0x194);}return _0x1f1119;};}function handleError(_0x4ca6bb,_0x2e74d9){_0x2e74d9=_0x2e74d9||0x1f4;return function(_0x7d5bed){logger[_0x5dc1('0x15')](_0x7d5bed[_0x5dc1('0x34')]);if(_0x7d5bed['name']){delete _0x7d5bed[_0x5dc1('0x31')];}_0x4ca6bb[_0x5dc1('0x1c')](_0x2e74d9)[_0x5dc1('0x35')](_0x7d5bed);};}exports[_0x5dc1('0x36')]=function(_0x144dfc,_0x1a18d3){var _0x195926={},_0x822c2e={'count':0x0,'rows':[]};var _0x2049ce=_(db[_0x5dc1('0x37')][_0x5dc1('0x38')])[_0x5dc1('0x2e')](function(_0x18b886){return{'name':_0x18b886[_0x5dc1('0x39')],'type':_0x18b886['type'][_0x5dc1('0x3a')]};})[_0x5dc1('0x2d')](function(_0x3548bc){return!_[_0x5dc1('0x30')]([_0x5dc1('0x3b'),_0x5dc1('0x3c')],_0x3548bc[_0x5dc1('0x31')]);})[_0x5dc1('0x2f')]();_0x195926=qs['getOptions'](_0x2049ce,_0x144dfc);var _0x2f0c01={'where':_0x195926[_0x5dc1('0x3d')]};return db[_0x5dc1('0x37')][_0x5dc1('0x22')](_0x2f0c01)[_0x5dc1('0x11')](function(_0x51e5a5){_0x822c2e[_0x5dc1('0x22')]=_0x51e5a5;if(_0x144dfc[_0x5dc1('0x3e')][_0x5dc1('0x3f')]){_0x195926[_0x5dc1('0x40')]=[{'all':!![]}];}if(!_[_0x5dc1('0x30')](_0x195926[_0x5dc1('0x41')],'id')){_0x195926[_0x5dc1('0x41')]['push']('id');}return db[_0x5dc1('0x37')]['findAll'](_0x195926);})[_0x5dc1('0x11')](function(_0x2d446d){_0x822c2e[_0x5dc1('0x42')]=_0x2d446d;if(_0x144dfc[_0x5dc1('0x3e')]['openTabs']==='true'){var _0x22be79=[];for(var _0x105a3a=0x0;_0x105a3a<_0x822c2e[_0x5dc1('0x42')][_0x5dc1('0x43')];_0x105a3a++){_0x22be79[_0x5dc1('0x44')](get_open_tabs(_0x5dc1('0x45'),_0x822c2e['rows'][_0x105a3a][_0x5dc1('0x46')]));_0x22be79[_0x5dc1('0x44')](get_open_tabs('sms',_0x822c2e[_0x5dc1('0x42')][_0x105a3a][_0x5dc1('0x46')]));_0x22be79[_0x5dc1('0x44')](get_open_tabs(_0x5dc1('0x47'),_0x822c2e['rows'][_0x105a3a][_0x5dc1('0x46')]));_0x22be79[_0x5dc1('0x44')](get_open_tabs(_0x5dc1('0x48'),_0x822c2e[_0x5dc1('0x42')][_0x105a3a][_0x5dc1('0x46')]));_0x22be79[_0x5dc1('0x44')](get_open_tabs(_0x5dc1('0x49'),_0x822c2e[_0x5dc1('0x42')][_0x105a3a]['dataValues']));_0x22be79[_0x5dc1('0x44')](get_open_tabs(_0x5dc1('0x4a'),_0x822c2e['rows'][_0x105a3a]['dataValues']));}return BPromise[_0x5dc1('0x4b')](_0x22be79)[_0x5dc1('0x11')](function(_0x5f498d){return _0x822c2e;});}else{return _0x822c2e;}})[_0x5dc1('0x11')](respondWithFilteredResult(_0x1a18d3,_0x195926))['catch'](handleError(_0x1a18d3,null));};exports[_0x5dc1('0x4c')]=function(_0x56641a,_0x2c2a33){var _0x57df03={'raw':![],'where':{'id':_0x56641a[_0x5dc1('0x4d')]['id']}},_0x146cae={};_0x146cae[_0x5dc1('0x4e')]=_[_0x5dc1('0x4f')](_[_0x5dc1('0x50')](db[_0x5dc1('0x37')]['rawAttributes']),[_0x5dc1('0x3b'),_0x5dc1('0x3c')]);_0x146cae['query']=_[_0x5dc1('0x50')](_0x56641a[_0x5dc1('0x3e')]);_0x146cae['filters']=_['intersection'](_0x146cae[_0x5dc1('0x4e')],_0x146cae['query']);_0x57df03[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x146cae[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x56641a[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x57df03[_0x5dc1('0x41')]=_0x57df03[_0x5dc1('0x41')]['length']?_0x57df03['attributes']:_0x146cae[_0x5dc1('0x4e')];if(_0x56641a[_0x5dc1('0x3e')][_0x5dc1('0x3f')]){_0x57df03['include']=[{'all':!![]}];}_0x57df03=_[_0x5dc1('0x53')]({},_0x57df03,_0x56641a['options']);if(!_[_0x5dc1('0x30')](_0x57df03[_0x5dc1('0x41')],'id')){_0x57df03[_0x5dc1('0x41')][_0x5dc1('0x44')]('id');}return db['User'][_0x5dc1('0x54')](_0x57df03)['then'](handleEntityNotFound(_0x2c2a33,null))[_0x5dc1('0x11')](function(_0x180229){var _0x5b5cfa=[];values=_0x180229;if(_0x56641a[_0x5dc1('0x3e')][_0x5dc1('0x55')]===_0x5dc1('0x56')){_0x5b5cfa['push'](get_open_tabs('chat',_0x180229['dataValues']));_0x5b5cfa['push'](get_open_tabs(_0x5dc1('0x57'),_0x180229[_0x5dc1('0x46')]));_0x5b5cfa[_0x5dc1('0x44')](get_open_tabs('openchannel',_0x180229[_0x5dc1('0x46')]));_0x5b5cfa[_0x5dc1('0x44')](get_open_tabs('whatsapp',_0x180229[_0x5dc1('0x46')]));_0x5b5cfa[_0x5dc1('0x44')](get_open_tabs(_0x5dc1('0x47'),_0x180229[_0x5dc1('0x46')]));_0x5b5cfa['push'](get_open_tabs(_0x5dc1('0x48'),_0x180229[_0x5dc1('0x46')]));return BPromise[_0x5dc1('0x4b')](_0x5b5cfa);}else{return values;}})[_0x5dc1('0x11')](function(_0x5a710c){return values;})['then'](respondWithResult(_0x2c2a33,null))['catch'](handleError(_0x2c2a33,null));};exports['update']=function(_0x1a2669,_0x345e95){if(_0x1a2669['body']['id']){delete _0x1a2669['body']['id'];}delete _0x1a2669[_0x5dc1('0x58')]['role'];return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x1a2669['params']['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x345e95,null))[_0x5dc1('0x11')](saveUpdates(_0x1a2669[_0x5dc1('0x58')],null))[_0x5dc1('0x11')](respondWithResult(_0x345e95,null))[_0x5dc1('0x1a')](handleError(_0x345e95,null));};exports[_0x5dc1('0x59')]=function(_0x67b696,_0x151cb4){return db[_0x5dc1('0x37')]['describe']()[_0x5dc1('0x11')](respondWithResult(_0x151cb4,null))['catch'](handleError(_0x151cb4,null));};exports[_0x5dc1('0x5a')]=function(_0xa323b7,_0xd86c3e){return db['User'][_0x5dc1('0x54')]({'where':{'id':_0xa323b7[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0xd86c3e,null))[_0x5dc1('0x11')](function(_0x693b8a){if(_0x693b8a){return _0x693b8a[_0x5dc1('0x5a')](_0xa323b7[_0x5dc1('0x58')]['ids'],_['omit'](_0xa323b7[_0x5dc1('0x58')],[_0x5dc1('0x5b'),'id'])||{});}})['then'](respondWithResult(_0xd86c3e,null))[_0x5dc1('0x1a')](handleError(_0xd86c3e,null));};function validateUser(_0x34e4f1){return new BPromise(function(_0x150f35,_0x4ab945){if(_0x34e4f1[_0x5dc1('0x5c')])return _0x150f35(_0x34e4f1);return db[_0x5dc1('0x5d')]['findById'](0x1)['then'](function(_0x120049){if(_0x120049['securePassword'])authService[_0x5dc1('0x5e')](_0x34e4f1['password']);db[_0x5dc1('0x37')][_0x5dc1('0x5f')](_0x5dc1('0x5c'))[_0x5dc1('0x11')](function(_0x1252e9){if(_['isNil'](_0x1252e9)){_0x34e4f1[_0x5dc1('0x5c')]=_0x120049[_0x5dc1('0x60')]||0x1;return;}if(_[_0x5dc1('0x61')](_0x120049[_0x5dc1('0x60')])||_0x120049[_0x5dc1('0x60')]===_0x1252e9){_0x34e4f1[_0x5dc1('0x5c')]=_0x1252e9+0x1;return;}if(_0x120049['min_internal']>_0x1252e9){_0x34e4f1[_0x5dc1('0x5c')]=_0x120049[_0x5dc1('0x60')];return;}return db['sequelize']['query'](_0x5dc1('0x62'),{'type':db[_0x5dc1('0x63')][_0x5dc1('0x64')][_0x5dc1('0x65')]})[_0x5dc1('0x11')](function(_0x2ae685){if(_0x2ae685&&_0x2ae685[_0x5dc1('0x43')]){for(var _0x5e792a=0x0,_0x550a33=_0x2ae685[_0x5dc1('0x43')];_0x5e792a<_0x550a33&&_[_0x5dc1('0x61')](_0x34e4f1[_0x5dc1('0x5c')]);_0x5e792a++){if(_0x120049[_0x5dc1('0x60')]<=_0x2ae685[_0x5e792a][_0x5dc1('0x66')]){_0x34e4f1[_0x5dc1('0x5c')]=_0x2ae685[_0x5e792a]['from'];}else if(_0x120049[_0x5dc1('0x60')]>_0x2ae685[_0x5e792a][_0x5dc1('0x66')]&&_0x120049[_0x5dc1('0x60')]<=_0x2ae685[_0x5e792a]['to']){_0x34e4f1[_0x5dc1('0x5c')]=_0x120049['min_internal'];}}}if(_[_0x5dc1('0x61')](_0x34e4f1[_0x5dc1('0x5c')])){_0x34e4f1['internal']=_0x1252e9+0x1;}return _0x150f35(_0x34e4f1);});});})[_0x5dc1('0x1a')](function(_0x3c9dbc){_0x4ab945(_0x3c9dbc);});});}function updateUser(_0x51fec7){return new BPromise(function(_0x4397ed,_0x423084){try{if(_0x51fec7[_0x5dc1('0x67')]){_0x51fec7[_0x5dc1('0x68')]=_0x51fec7['internal'];_0x51fec7['VoiceMail']={'mailbox':_0x51fec7['internal'],'password':_0x51fec7[_0x5dc1('0x3b')],'fullname':_0x51fec7[_0x5dc1('0x69')],'email':_0x51fec7[_0x5dc1('0x6a')]};}if(_0x51fec7[_0x5dc1('0x27')]===_0x5dc1('0x2a')){if(!_0x51fec7[_0x5dc1('0x6b')])_0x51fec7[_0x5dc1('0x6b')]=[_0x5dc1('0x6c'),_0x5dc1('0x6d'),_0x5dc1('0x6e'),'113','110',_0x5dc1('0x6f'),_0x5dc1('0x70'),_0x5dc1('0x71'),_0x5dc1('0x72'),'108',_0x5dc1('0x73'),_0x5dc1('0x74'),_0x5dc1('0x75'),_0x5dc1('0x76'),_0x5dc1('0x77')];}_0x4397ed(_0x51fec7);}catch(_0x22e5a9){_0x423084(_0x22e5a9);}});}exports[_0x5dc1('0x78')]=function(_0x2a48e5,_0x153179){if(_0x2a48e5[_0x5dc1('0x79')][_0x5dc1('0x27')]===_0x5dc1('0x2a'))throw new Error(_0x5dc1('0x7a'));if(_0x2a48e5[_0x5dc1('0x58')][_0x5dc1('0x27')]==='user'&&_0x2a48e5[_0x5dc1('0x79')][_0x5dc1('0x27')]!=='admin'){throw new Error(_0x5dc1('0x7b'));}if(_0x2a48e5[_0x5dc1('0x58')][_0x5dc1('0x27')]==='admin'&&_0x2a48e5[_0x5dc1('0x79')]['role']!==_0x5dc1('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x5dc1('0x7c')]([_0x2a48e5[_0x5dc1('0x58')]])['then'](function(){return validateUser(_0x2a48e5[_0x5dc1('0x58')]);})[_0x5dc1('0x11')](function(_0x14d4b3){return updateUser(_0x14d4b3)[_0x5dc1('0x11')](function(_0x32f0ac){if(_0x32f0ac[_0x5dc1('0x27')]===_0x5dc1('0x28')){_0x32f0ac[_0x5dc1('0x7d')]=_0x2a48e5[_0x5dc1('0x79')]['settingsEnabled'];delete _0x32f0ac[_0x5dc1('0x7e')];}return _0x32f0ac;});})[_0x5dc1('0x11')](function(_0x5d0555){return db[_0x5dc1('0x37')][_0x5dc1('0x78')](_0x5d0555,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x5dc1('0x11')](function(_0x14974b){if(_0x2a48e5[_0x5dc1('0x58')][_0x5dc1('0x27')]==='user')return _0x14974b;if(_0x2a48e5[_0x5dc1('0x79')][_0x5dc1('0x27')]!==_0x5dc1('0x79'))return _0x14974b;return db[_0x5dc1('0x7f')][_0x5dc1('0x54')]({'where':{'name':_0x14974b['role']===_0x5dc1('0x2a')?_0x5dc1('0x80'):'Telephones','userProfileId':_0x2a48e5[_0x5dc1('0x79')][_0x5dc1('0x7e')]},'raw':!![]})[_0x5dc1('0x11')](function(_0x3333f9){if(!_0x3333f9||_0x3333f9[_0x5dc1('0x81')]!=0x0)return _0x14974b;return db[_0x5dc1('0x32')]['create']({'name':_0x14974b[_0x5dc1('0x31')],'resourceId':_0x14974b['id'],'type':_0x3333f9['name'],'sectionId':_0x3333f9['id']},{})[_0x5dc1('0x11')](function(){return _0x14974b;});})['catch'](function(_0x1b6687){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b6687);throw _0x1b6687;});})[_0x5dc1('0x11')](respondWithResult(_0x153179,0xc9))[_0x5dc1('0x1a')](handleError(_0x153179,null));};exports[_0x5dc1('0x82')]=function(_0x3ca064,_0x2582cf){var _0x30972c=_0x3ca064[_0x5dc1('0x58')];var _0x20cd8c=[];if(_0x3ca064[_0x5dc1('0x79')]['role']===_0x5dc1('0x2a'))throw new Error(_0x5dc1('0x7a'));if(_[_0x5dc1('0x83')](_0x30972c,[_0x5dc1('0x27'),'user'])&&_0x3ca064[_0x5dc1('0x79')][_0x5dc1('0x27')]!==_0x5dc1('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x5dc1('0x83')](_0x30972c,[_0x5dc1('0x27'),'admin'])&&_0x3ca064[_0x5dc1('0x79')][_0x5dc1('0x27')]!==_0x5dc1('0x28')){throw new Error(_0x5dc1('0x84'));}return licenseUtil['checkUserLimits'](_0x30972c)[_0x5dc1('0x11')](function(){return validateUser(_0x30972c[0x0]);})[_0x5dc1('0x11')](function(){for(var _0x332bb4=0x1;_0x332bb4<_0x30972c['length'];_0x332bb4++){var _0x5ce360=_0x30972c[_0x332bb4-0x1][_0x5dc1('0x5c')];if(!_0x30972c[_0x332bb4][_0x5dc1('0x5c')])_0x30972c[_0x332bb4][_0x5dc1('0x5c')]=_0x5ce360+0x1;_0x20cd8c['push'](validateUser(_0x30972c[_0x332bb4]));}return BPromise['all'](_0x20cd8c);})[_0x5dc1('0x11')](function(){_0x20cd8c=[];for(var _0x5a8d99=0x0;_0x5a8d99<_0x30972c['length'];_0x5a8d99++){_0x20cd8c['push'](updateUser(_0x30972c[_0x5a8d99]));}return BPromise['all'](_0x20cd8c);})[_0x5dc1('0x11')](function(){return BPromise[_0x5dc1('0x85')](_0x30972c,function(_0x209800){return db[_0x5dc1('0x37')][_0x5dc1('0x78')](_0x209800,{'include':[{'model':db[_0x5dc1('0x86')],'as':_0x5dc1('0x86')}]})[_0x5dc1('0x11')](function(_0x58fd34){_0x209800['id']=_0x58fd34['id'];return _0x209800;});});})[_0x5dc1('0x11')](function(_0x465c4e){if(_0x3ca064['body'][_0x5dc1('0x27')]===_0x5dc1('0x79'))return _0x465c4e;if(_0x3ca064['user'][_0x5dc1('0x27')]!=='user')return _0x465c4e;var _0x523ded=_[_0x5dc1('0x83')](_0x465c4e,function(_0x1208aa){return _0x1208aa[_0x5dc1('0x27')]===_0x5dc1('0x2a')||_0x1208aa[_0x5dc1('0x27')]===_0x5dc1('0x2c');});if(!_0x523ded)return _0x465c4e;return db[_0x5dc1('0x7f')][_0x5dc1('0x87')]({'where':{'name':{'$or':['Agents',_0x5dc1('0x2b')]},'userProfileId':_0x3ca064[_0x5dc1('0x79')]['userProfileId']},'raw':!![]})[_0x5dc1('0x11')](function(_0x23784a){if(_['isEmpty'](_0x23784a)||!_[_0x5dc1('0x83')](_0x23784a,['autoAssociation',0x0]))return _0x465c4e;_0x20cd8c=[];var _0x5a0f22=_(_0x23784a)[_0x5dc1('0x2e')](function(_0x34d83d){if(_0x34d83d['autoAssociation']===0x1)return;return _0x34d83d[_0x5dc1('0x31')]===_0x5dc1('0x80')?_0x5dc1('0x2a'):_0x5dc1('0x2c');})['compact']()['value']();for(var _0xdc6ac2=0x0;_0xdc6ac2<_0x465c4e[_0x5dc1('0x43')];_0xdc6ac2++){if(!_[_0x5dc1('0x30')](_0x5a0f22,_0x465c4e[_0xdc6ac2][_0x5dc1('0x27')]))return;var _0x2adf48=_0x465c4e[_0xdc6ac2][_0x5dc1('0x27')]===_0x5dc1('0x2a')?'Agents':_0x5dc1('0x2b');_0x20cd8c['push'](db[_0x5dc1('0x32')][_0x5dc1('0x78')]({'name':_0x465c4e[_0xdc6ac2][_0x5dc1('0x31')],'resourceId':_0x465c4e[_0xdc6ac2]['id'],'type':_0x2adf48,'sectionId':_['find'](_0x23784a,[_0x5dc1('0x31'),_0x2adf48])['id']},{}));}return BPromise['all'](_0x20cd8c);});})[_0x5dc1('0x11')](respondWithResult(_0x2582cf,0xc9))['catch'](handleError(_0x2582cf,null));};exports[_0x5dc1('0x88')]=function(_0x29ffa6,_0x1714f3){if(_0x29ffa6[_0x5dc1('0x58')]['id']){delete _0x29ffa6['body']['id'];}return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x29ffa6[_0x5dc1('0x4d')]['id']}})['then'](function(_0x295dbe){if(!_0x295dbe)return null;if(_0x295dbe['id']===_0x29ffa6[_0x5dc1('0x79')]['id']){if(!_0x29ffa6[_0x5dc1('0x58')][_0x5dc1('0x89')]||!_0x29ffa6[_0x5dc1('0x58')]['newPassword']){throw new db[(_0x5dc1('0x8a'))][(_0x5dc1('0x8b'))](_0x5dc1('0x8c'));}if(!_0x295dbe[_0x5dc1('0x8d')](_0x29ffa6[_0x5dc1('0x58')]['oldPassword'])){throw new db['Sequelize']['ValidationError'](_0x5dc1('0x8e'));}if(_0x29ffa6[_0x5dc1('0x58')][_0x5dc1('0x89')]===_0x29ffa6['body']['newPassword']){throw new db[(_0x5dc1('0x8a'))][(_0x5dc1('0x8b'))](_0x5dc1('0x8f'));}}else if(_0x29ffa6[_0x5dc1('0x79')][_0x5dc1('0x27')]===_0x5dc1('0x28')){if(!_0x29ffa6[_0x5dc1('0x58')][_0x5dc1('0x90')]){throw new db[(_0x5dc1('0x8a'))][(_0x5dc1('0x8b'))](_0x5dc1('0x91'));}}else if(_0x29ffa6['user'][_0x5dc1('0x27')]===_0x5dc1('0x79')){if(!_0x29ffa6[_0x5dc1('0x58')]['newPassword']){throw new db[(_0x5dc1('0x8a'))][(_0x5dc1('0x8b'))](_0x5dc1('0x91'));}if(_0x295dbe[_0x5dc1('0x27')]!==_0x5dc1('0x2a')){throw new db['Sequelize']['ValidationError'](_0x5dc1('0x7a'));}}else{throw new db[(_0x5dc1('0x8a'))][(_0x5dc1('0x8b'))](_0x5dc1('0x7a'));}return _0x295dbe;})[_0x5dc1('0x11')](handleEntityNotFound(_0x1714f3,null))['then'](function(_0x46ddf1){return db[_0x5dc1('0x5d')]['findOne']({'attributes':['id','securePassword',_0x5dc1('0x92'),_0x5dc1('0x93')]})['then'](function(_0x3145f9){if(_0x3145f9[_0x5dc1('0x94')])authService[_0x5dc1('0x5e')](_0x29ffa6[_0x5dc1('0x58')][_0x5dc1('0x90')]);if(!_0x3145f9[_0x5dc1('0x92')]||!_0x46ddf1['previousPasswords'])return _0x46ddf1;authService[_0x5dc1('0x95')](_0x29ffa6[_0x5dc1('0x58')]['newPassword'],_0x46ddf1['previousPasswords'],_0x3145f9['passwordHistoryLimit']);return _0x46ddf1;})['then'](saveUpdates({'password':_0x29ffa6['body'][_0x5dc1('0x90')],'passwordResetAt':_0x29ffa6[_0x5dc1('0x79')]['id']==_0x29ffa6[_0x5dc1('0x4d')]['id']?moment():null,'previousPasswords':authService[_0x5dc1('0x96')](_0x29ffa6['body']['newPassword'],_0x46ddf1['previousPasswords'])},null));})[_0x5dc1('0x11')](respondWithResult(_0x1714f3,null))['catch'](handleError(_0x1714f3,null));};exports[_0x5dc1('0x97')]=function(_0xdcdbbd,_0x8a06be){var _0x509984=_0xdcdbbd[_0x5dc1('0x58')]['channel'];return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0xdcdbbd[_0x5dc1('0x4d')]['id']},'attributes':['id',_0x5dc1('0x31'),'role',_0x5dc1('0x98'),_0x5dc1('0x99'),_0x5dc1('0x9a'),_0x5dc1('0x9b')]})[_0x5dc1('0x11')](handleEntityNotFound(_0x8a06be,null))[_0x5dc1('0x11')](function(_0x1e388b){if(_0x1e388b){if(!utils['isValidChannel'](_0x509984)){throw new db[(_0x5dc1('0x8a'))]['ValidationError'](_0x5dc1('0x9c'));}return _0x1e388b[_0x5dc1('0x9d')+_[_0x5dc1('0x9e')](_0x509984['toLowerCase']())+_0x5dc1('0x9f')](_0xdcdbbd['body'][_0x5dc1('0x5b')],{'penalty':_0xdcdbbd[_0x5dc1('0x58')]['penalty']||0x0})[_0x5dc1('0xa0')](function(_0x3ca67a){for(var _0x48f6d4=0x0;_0x48f6d4<_0xdcdbbd['body'][_0x5dc1('0x5b')][_0x5dc1('0x43')];_0x48f6d4+=0x1){var _0x2a1950={'UserId':Number(_0xdcdbbd[_0x5dc1('0x4d')]['id'])};_0x2a1950[_['capitalize'](_0x509984[_0x5dc1('0xa1')]())+_0x5dc1('0xa2')]=Number(_0xdcdbbd[_0x5dc1('0x58')]['ids'][_0x48f6d4]);socket[_0x5dc1('0xa3')](_0x5dc1('0x79')+_[_0x5dc1('0x9e')](_0x509984['toLowerCase']())+_0x5dc1('0xa4'),_0x2a1950);}return _0x3ca67a;})[_0x5dc1('0x11')](function(){if(_0x509984==='voice'){return db[_0x5dc1('0xa5')][_0x5dc1('0x87')]({'where':{'id':_0xdcdbbd[_0x5dc1('0x58')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0x5dc1('0x11')](function(_0x4030fb){var _0x390906=_0x1e388b[_0x5dc1('0x26')]({'plain':!![]});var _0x1888cd=[];if(_0x509984===_0x5dc1('0xa6')&&_0x390906[_0x5dc1('0x27')]===_0x5dc1('0x2a')&&_0x390906[_0x5dc1('0x98')]){for(var _0x5f058c=0x0;_0x5f058c<_0x4030fb[_0x5dc1('0x43')];_0x5f058c+=0x1){_0x1888cd[_0x5dc1('0x44')]({'membername':_0x390906['name'],'UserId':_0x390906['id'],'queue_name':_0x4030fb[_0x5f058c][_0x5dc1('0x31')],'VoiceQueueId':_0x4030fb[_0x5f058c]['id'],'interface':_[_0x5dc1('0x61')](_0x390906[_0x5dc1('0x9b')])?util['format'](_0x5dc1('0xa7'),_0x390906[_0x5dc1('0x31')]):_0x390906[_0x5dc1('0x9b')],'paused':_0x390906[_0x5dc1('0x9a')]||![],'penalty':_0xdcdbbd['body'][_0x5dc1('0xa8')]||0x0});}return BPromise[_0x5dc1('0x85')](_0x1888cd,function(_0x51e587){return db['UserVoiceQueueRt']['upsert'](_0x51e587);});}return _0x1e388b;});}})[_0x5dc1('0x11')](respondWithStatusCode(_0x8a06be,null))[_0x5dc1('0x1a')](handleError(_0x8a06be,null));};exports['removeQueues']=function(_0x38070a,_0x19e4da){var _0x4cf2fd;return db[_0x5dc1('0x37')]['find']({'where':{'id':_0x38070a[_0x5dc1('0x4d')]['id']},'attributes':['id',_0x5dc1('0x31'),'role']})['then'](handleEntityNotFound(_0x19e4da,null))[_0x5dc1('0x11')](function(_0x4f4b91){if(_0x4f4b91){_0x4cf2fd=_0x4f4b91;if(!_0x38070a[_0x5dc1('0x3e')][_0x5dc1('0xa9')]||!utils[_0x5dc1('0xaa')](_0x38070a[_0x5dc1('0x3e')]['channel'])){throw new db[(_0x5dc1('0x8a'))][(_0x5dc1('0x8b'))]('Unknown\x20channel');}return _0x4f4b91['remove'+_[_0x5dc1('0x9e')](_0x38070a['query'][_0x5dc1('0xa9')][_0x5dc1('0xa1')]())+'Queues'](_0x38070a[_0x5dc1('0x3e')]['ids']);}})[_0x5dc1('0x11')](function(_0x8b864b){if(_[_0x5dc1('0xab')](_0x38070a['query'][_0x5dc1('0x5b')])){for(var _0x211e39=0x0;_0x211e39<_0x38070a['query'][_0x5dc1('0x5b')]['length'];_0x211e39+=0x1){var _0x4a3a79={'UserId':Number(_0x38070a[_0x5dc1('0x4d')]['id'])};_0x4a3a79[_[_0x5dc1('0x9e')](_0x38070a[_0x5dc1('0x3e')][_0x5dc1('0xa9')][_0x5dc1('0xa1')]())+'QueueId']=Number(_0x38070a['query'][_0x5dc1('0x5b')][_0x211e39]);socket[_0x5dc1('0xa3')](_0x5dc1('0x79')+_[_0x5dc1('0x9e')](_0x38070a['query'][_0x5dc1('0xa9')]['toLowerCase']())+_0x5dc1('0xac'),_0x4a3a79);}}else{var _0x4a3a79={'UserId':Number(_0x38070a[_0x5dc1('0x4d')]['id'])};_0x4a3a79[_[_0x5dc1('0x9e')](_0x38070a['query'][_0x5dc1('0xa9')][_0x5dc1('0xa1')]())+_0x5dc1('0xa2')]=Number(_0x38070a[_0x5dc1('0x3e')][_0x5dc1('0x5b')]);socket[_0x5dc1('0xa3')]('user'+_[_0x5dc1('0x9e')](_0x38070a[_0x5dc1('0x3e')][_0x5dc1('0xa9')]['toLowerCase']())+'Queue:remove',_0x4a3a79);}return _0x8b864b;})[_0x5dc1('0x11')](function(){if(_0x38070a['query']['channel']==='voice'){return db[_0x5dc1('0xad')][_0x5dc1('0x33')]({'where':{'UserId':_0x38070a['params']['id'],'VoiceQueueId':_0x38070a[_0x5dc1('0x3e')][_0x5dc1('0x5b')]},'individualHooks':!![]})['then'](function(){return _0x4cf2fd;});}return _0x4cf2fd;})[_0x5dc1('0x11')](respondWithStatusCode(_0x19e4da,null))[_0x5dc1('0x1a')](handleError(_0x19e4da,null));};exports[_0x5dc1('0xae')]=function(_0x28b313,_0x309458){_0x28b313[_0x5dc1('0x58')]['userpic']=_0x28b313[_0x5dc1('0xaf')]['filename'];return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x28b313[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x309458,null))[_0x5dc1('0x11')](saveUpdates(_0x28b313[_0x5dc1('0x58')],null))[_0x5dc1('0x11')](respondWithResult(_0x309458,null))['catch'](handleError(_0x309458,null));};exports[_0x5dc1('0xb0')]=function(_0x4898fd,_0x2627da){var _0x34b45a=path[_0x5dc1('0xb1')](config['root'],_0x5dc1('0xb2'));return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x4898fd['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0x5dc1('0x11')](handleEntityNotFound(_0x2627da,null))[_0x5dc1('0x11')](function(_0x1e17f2){if(_0x1e17f2){if(_[_0x5dc1('0x61')](_0x1e17f2[_0x5dc1('0xb3')])){return _0x2627da[_0x5dc1('0xb4')](_0x34b45a);}else{if(!fs[_0x5dc1('0xb5')](path[_0x5dc1('0xb1')](config['root'],'server/files/images/',_0x1e17f2[_0x5dc1('0xb3')]))){return _0x2627da[_0x5dc1('0xb4')](_0x34b45a);}return _0x2627da[_0x5dc1('0xb4')](path['join'](config['root'],'server/files/images/',_0x1e17f2[_0x5dc1('0xb3')]));}}})[_0x5dc1('0x1a')](handleError(_0x2627da,null));};exports[_0x5dc1('0xb6')]=function(_0x5efecc,_0xe1f624){return db['User'][_0x5dc1('0x54')]({'where':{'id':_0x5efecc['params']['id']},'attributes':['id']})[_0x5dc1('0x11')](handleEntityNotFound(_0xe1f624,null))[_0x5dc1('0x11')](function(_0x31e6de){var _0x3b907c=[];values=_0x31e6de[_0x5dc1('0x46')];_0x3b907c[_0x5dc1('0x44')](get_open_tabs(_0x5dc1('0x45'),_0x31e6de[_0x5dc1('0x46')]));_0x3b907c[_0x5dc1('0x44')](get_open_tabs(_0x5dc1('0x57'),_0x31e6de[_0x5dc1('0x46')]));_0x3b907c[_0x5dc1('0x44')](get_open_tabs(_0x5dc1('0x49'),_0x31e6de[_0x5dc1('0x46')]));_0x3b907c['push'](get_open_tabs(_0x5dc1('0x4a'),_0x31e6de[_0x5dc1('0x46')]));_0x3b907c[_0x5dc1('0x44')](get_open_tabs(_0x5dc1('0x47'),_0x31e6de[_0x5dc1('0x46')]));_0x3b907c[_0x5dc1('0x44')](get_open_tabs('mail',_0x31e6de[_0x5dc1('0x46')]));return BPromise[_0x5dc1('0x4b')](_0x3b907c);})[_0x5dc1('0x11')](function(_0x486c98){var _0x11567a=[];if(_0x486c98){for(var _0x463462=0x0;_0x463462<values[_0x5dc1('0xb7')]['length'];_0x463462++){var _0x4a409a=values[_0x5dc1('0xb7')][_0x463462];_0x11567a['push']({'channel':_0x5dc1('0xb8'),'id':_0x4a409a['id'],'createdAt':_0x4a409a[_0x5dc1('0xb9')]});}for(var _0x463462=0x0;_0x463462<values['FaxOpenTabs'][_0x5dc1('0x43')];_0x463462++){var _0x4a409a=values[_0x5dc1('0xba')][_0x463462];_0x11567a[_0x5dc1('0x44')]({'channel':_0x5dc1('0xbb'),'id':_0x4a409a['id'],'createdAt':_0x4a409a[_0x5dc1('0xb9')]});}for(var _0x463462=0x0;_0x463462<values[_0x5dc1('0xbc')][_0x5dc1('0x43')];_0x463462++){var _0x4a409a=values['OpenchannelOpenTabs'][_0x463462];_0x11567a['push']({'channel':'OPENCHANNEL','id':_0x4a409a['id'],'createdAt':_0x4a409a[_0x5dc1('0xb9')]});}for(var _0x463462=0x0;_0x463462<values[_0x5dc1('0xbd')]['length'];_0x463462++){var _0x4a409a=values[_0x5dc1('0xbd')][_0x463462];_0x11567a[_0x5dc1('0x44')]({'channel':_0x5dc1('0xbe'),'id':_0x4a409a['id'],'createdAt':_0x4a409a['createdAt']});}for(var _0x463462=0x0;_0x463462<values[_0x5dc1('0xbf')][_0x5dc1('0x43')];_0x463462++){var _0x4a409a=values[_0x5dc1('0xbf')][_0x463462];_0x11567a[_0x5dc1('0x44')]({'channel':_0x5dc1('0xc0'),'id':_0x4a409a['id'],'createdAt':_0x4a409a[_0x5dc1('0xb9')]});}for(var _0x463462=0x0;_0x463462<values[_0x5dc1('0xc1')][_0x5dc1('0x43')];_0x463462++){var _0x4a409a=values[_0x5dc1('0xc1')][_0x463462];_0x11567a['push']({'channel':_0x5dc1('0xc2'),'id':_0x4a409a['id'],'createdAt':_0x4a409a[_0x5dc1('0xb9')]});}var _0x2f6bdf={'count':_0x11567a[_0x5dc1('0x43')],'rows':_0x11567a};return _0x2f6bdf;}else return null;})['then'](respondWithResult(_0xe1f624,null))[_0x5dc1('0x1a')](handleError(_0xe1f624,null));};exports[_0x5dc1('0xc3')]=function(_0x98231a,_0x1fe6df){var _0x334920={};var _0x2382c8={};var _0x1be402;var _0x10e421;return db[_0x5dc1('0x37')][_0x5dc1('0xc4')]({'where':{'id':_0x98231a[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x1fe6df,null))[_0x5dc1('0x11')](function(_0x1bb44d){if(_0x1bb44d){_0x1be402=_0x1bb44d;_0x2382c8['model']=_[_0x5dc1('0x50')](db[_0x5dc1('0xc5')][_0x5dc1('0x38')]);_0x2382c8['query']=_[_0x5dc1('0x50')](_0x98231a[_0x5dc1('0x3e')]);_0x2382c8[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x2382c8[_0x5dc1('0x4e')],_0x2382c8[_0x5dc1('0x3e')]);_0x334920[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x2382c8[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x98231a[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x334920[_0x5dc1('0x41')]=_0x334920[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0x334920['attributes']:_0x2382c8[_0x5dc1('0x4e')];_0x334920['order']=qs[_0x5dc1('0xc7')](_0x98231a['query'][_0x5dc1('0xc7')]);_0x334920[_0x5dc1('0x3d')]=qs['filters'](_[_0x5dc1('0xc8')](_0x98231a[_0x5dc1('0x3e')],_0x2382c8[_0x5dc1('0xc6')]));if(_0x98231a[_0x5dc1('0x3e')]['filter']){_0x334920['where']=_[_0x5dc1('0x53')](_0x334920[_0x5dc1('0x3d')],{'$or':_[_0x5dc1('0x2e')](_0x334920[_0x5dc1('0x41')],function(_0x36bdcf){var _0x4ec112={};_0x4ec112[_0x36bdcf]={'$like':'%'+_0x98231a[_0x5dc1('0x3e')][_0x5dc1('0x2d')]+'%'};return _0x4ec112;})});}_0x334920=_[_0x5dc1('0x53')]({},_0x334920,_0x98231a[_0x5dc1('0xc9')]);return _0x1be402[_0x5dc1('0xc3')](_0x334920);}})[_0x5dc1('0x11')](function(_0x250c91){if(_0x250c91){_0x10e421=_0x250c91[_0x5dc1('0x43')];if(_0x98231a['query'][_0x5dc1('0xca')]('includeAll')){_0x334920[_0x5dc1('0x40')]=[{'model':db[_0x5dc1('0xcb')],'as':'List','required':![]},{'model':db['Tag'],'as':_0x5dc1('0xcc'),'attributes':['id','name','color'],'where':_0x98231a[_0x5dc1('0x3e')][_0x5dc1('0xcd')]?{'id':_0x98231a[_0x5dc1('0x3e')]['tag']}:undefined,'required':_0x98231a[_0x5dc1('0x3e')]['tag']?!![]:![]}];}if(!_0x98231a['query'][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x334920[_0x5dc1('0x20')]=qs['limit'](_0x98231a[_0x5dc1('0x3e')][_0x5dc1('0x20')]);_0x334920['offset']=qs[_0x5dc1('0x1f')](_0x98231a[_0x5dc1('0x3e')]['offset']);}return _0x1be402[_0x5dc1('0xc3')](_0x334920);}})[_0x5dc1('0x11')](function(_0x4073af){if(_0x4073af){return _0x4073af?{'count':_0x10e421,'rows':_0x4073af}:null;}})[_0x5dc1('0x11')](respondWithResult(_0x1fe6df,null))['catch'](handleError(_0x1fe6df,null));};exports[_0x5dc1('0xcf')]=function(_0x5d29af,_0x28e1aa){var _0x28a934;var _0x2c3a7a;var _0xc68368={};var _0x3793a;return db[_0x5dc1('0x37')][_0x5dc1('0xc4')]({'where':{'id':_0x5d29af[_0x5dc1('0x4d')]['id']},'attributes':['id','name','role']})[_0x5dc1('0x11')](handleEntityNotFound(_0x28e1aa,null))['then'](function(_0x4df209){if(!utils[_0x5dc1('0xaa')](_0x5d29af[_0x5dc1('0x3e')][_0x5dc1('0xa9')])){throw new db[(_0x5dc1('0x8a'))]['ValidationError'](_0x5dc1('0x9c'));}_0x28a934=_0x4df209;var _0x3e56fe={};_0x3e56fe[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db[_[_0x5dc1('0x9e')](_0x5d29af[_0x5dc1('0x3e')][_0x5dc1('0xa9')])+_0x5dc1('0xd0')]['rawAttributes']);_0x3e56fe[_0x5dc1('0x3e')]=_[_0x5dc1('0x50')](_0x5d29af['query']);_0x3e56fe[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x3e56fe['model'],_0x3e56fe[_0x5dc1('0x3e')]);_0xc68368[_0x5dc1('0x41')]=_['intersection'](_0x3e56fe[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x5d29af['query'][_0x5dc1('0x52')]));_0xc68368[_0x5dc1('0x41')]=_0xc68368[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0xc68368[_0x5dc1('0x41')]:_0x3e56fe[_0x5dc1('0x4e')];_0xc68368[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x5d29af['query']['sort']);_0xc68368[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_[_0x5dc1('0xc8')](_0x5d29af[_0x5dc1('0x3e')],_0x3e56fe[_0x5dc1('0xc6')]));if(_0x5d29af[_0x5dc1('0x3e')][_0x5dc1('0x2d')]){_0xc68368[_0x5dc1('0x3d')]=_['merge'](_0xc68368['where'],{'$or':_[_0x5dc1('0x2e')](_0xc68368['attributes'],function(_0x461a30){var _0x407d4e={};_0x407d4e[_0x461a30]={'$like':'%'+_0x5d29af['query'][_0x5dc1('0x2d')]+'%'};return _0x407d4e;})});}_0xc68368=_[_0x5dc1('0x53')]({},_0xc68368,_0x5d29af[_0x5dc1('0xc9')]);switch(_0x28a934[_0x5dc1('0x27')]){case _0x5dc1('0x28'):return db[_[_0x5dc1('0x9e')](_0x5d29af[_0x5dc1('0x3e')][_0x5dc1('0xa9')])+_0x5dc1('0xd0')]['findAll'](_0xc68368);case _0x5dc1('0x79'):case _0x5dc1('0x2a'):return _0x28a934[_0x5dc1('0x26')+_[_0x5dc1('0x9e')](_0x5d29af[_0x5dc1('0x3e')][_0x5dc1('0xa9')])+_0x5dc1('0x9f')](_0xc68368);default:throw new db['Sequelize'][(_0x5dc1('0x8b'))](_0x5dc1('0xd2'));}})['then'](function(_0x1beca6){_0x3793a=_0x1beca6[_0x5dc1('0x43')];if(!_0x5d29af['query'][_0x5dc1('0xca')]('nolimit')){_0xc68368['limit']=qs[_0x5dc1('0x20')](_0x5d29af[_0x5dc1('0x3e')][_0x5dc1('0x20')]);_0xc68368[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x5d29af['query'][_0x5dc1('0x1f')]);}switch(_0x28a934[_0x5dc1('0x27')]){case'admin':return db[_[_0x5dc1('0x9e')](_0x5d29af['query'][_0x5dc1('0xa9')])+_0x5dc1('0xd0')]['findAll'](_0xc68368);case _0x5dc1('0x79'):case _0x5dc1('0x2a'):return _0x28a934[_0x5dc1('0x26')+_[_0x5dc1('0x9e')](_0x5d29af['query'][_0x5dc1('0xa9')])+_0x5dc1('0x9f')](_0xc68368);}})[_0x5dc1('0x11')](function(_0x24f1f7){return{'count':_0x3793a,'rows':_0x24f1f7};})[_0x5dc1('0x11')](respondWithResult(_0x28e1aa,null))[_0x5dc1('0x1a')](handleError(_0x28e1aa,null));};exports[_0x5dc1('0xd3')]=function(_0x327054,_0x29bd96){var _0x3a96f6={};var _0x3ad9db={};var _0x51fb57;var _0x34f408;return db[_0x5dc1('0x37')]['findOne']({'where':{'id':_0x327054[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x29bd96,null))[_0x5dc1('0x11')](function(_0xcb4c16){if(_0xcb4c16){_0x51fb57=_0xcb4c16;_0x3ad9db[_0x5dc1('0x4e')]=_['keys'](db['UserVoiceQueueRt'][_0x5dc1('0x38')]);_0x3ad9db[_0x5dc1('0x3e')]=_['keys'](_0x327054['query']);_0x3ad9db['filters']=_[_0x5dc1('0x51')](_0x3ad9db[_0x5dc1('0x4e')],_0x3ad9db['query']);_0x3a96f6[_0x5dc1('0x41')]=_['intersection'](_0x3ad9db[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x327054[_0x5dc1('0x3e')]['fields']));_0x3a96f6[_0x5dc1('0x41')]=_0x3a96f6[_0x5dc1('0x41')]['length']?_0x3a96f6[_0x5dc1('0x41')]:_0x3ad9db[_0x5dc1('0x4e')];_0x3a96f6[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x327054['query'][_0x5dc1('0xc7')]);_0x3a96f6['where']=qs[_0x5dc1('0xc6')](_['pick'](_0x327054[_0x5dc1('0x3e')],_0x3ad9db[_0x5dc1('0xc6')]));if(_0x327054[_0x5dc1('0x3e')]['filter']){_0x3a96f6[_0x5dc1('0x3d')]=_[_0x5dc1('0x53')](_0x3a96f6[_0x5dc1('0x3d')],{'$or':_[_0x5dc1('0x2e')](_0x3a96f6['attributes'],function(_0x74798e){var _0x128978={};_0x128978[_0x74798e]={'$like':'%'+_0x327054[_0x5dc1('0x3e')][_0x5dc1('0x2d')]+'%'};return _0x128978;})});}_0x3a96f6=_[_0x5dc1('0x53')]({},_0x3a96f6,_0x327054[_0x5dc1('0xc9')]);return _0x51fb57[_0x5dc1('0xd3')](_0x3a96f6);}})[_0x5dc1('0x11')](function(_0x2adb19){if(_0x2adb19){_0x34f408=_0x2adb19[_0x5dc1('0x43')];if(!_0x327054[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x3a96f6['limit']=qs[_0x5dc1('0x20')](_0x327054[_0x5dc1('0x3e')]['limit']);_0x3a96f6[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x327054[_0x5dc1('0x3e')][_0x5dc1('0x1f')]);}return _0x51fb57[_0x5dc1('0xd3')](_0x3a96f6);}})['then'](function(_0x445ebb){if(_0x445ebb){return _0x445ebb?{'count':_0x34f408,'rows':_0x445ebb}:null;}})['then'](respondWithResult(_0x29bd96,null))['catch'](handleError(_0x29bd96,null));};exports[_0x5dc1('0xd4')]=function(_0x48f212,_0x197bcb){var _0x13f123={};var _0x23f985={};var _0x219f6f;var _0x131d57;return db['User'][_0x5dc1('0xc4')]({'where':{'id':_0x48f212['params']['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x197bcb,null))['then'](function(_0x4bdb84){if(_0x4bdb84){_0x219f6f=_0x4bdb84;_0x23f985[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db[_0x5dc1('0xd5')][_0x5dc1('0x38')]);_0x23f985[_0x5dc1('0x3e')]=_[_0x5dc1('0x50')](_0x48f212[_0x5dc1('0x3e')]);_0x23f985[_0x5dc1('0xc6')]=_['intersection'](_0x23f985['model'],_0x23f985[_0x5dc1('0x3e')]);_0x13f123['attributes']=_[_0x5dc1('0x51')](_0x23f985[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x48f212[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x13f123['attributes']=_0x13f123[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0x13f123[_0x5dc1('0x41')]:_0x23f985[_0x5dc1('0x4e')];_0x13f123[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x48f212[_0x5dc1('0x3e')][_0x5dc1('0xc7')]);_0x13f123[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_['pick'](_0x48f212[_0x5dc1('0x3e')],_0x23f985[_0x5dc1('0xc6')]));if(_0x48f212['query'][_0x5dc1('0x2d')]){_0x13f123[_0x5dc1('0x3d')]=_[_0x5dc1('0x53')](_0x13f123['where'],{'$or':_[_0x5dc1('0x2e')](_0x13f123[_0x5dc1('0x41')],function(_0x33c623){var _0x28cfd5={};_0x28cfd5[_0x33c623]={'$like':'%'+_0x48f212['query'][_0x5dc1('0x2d')]+'%'};return _0x28cfd5;})});}_0x13f123=_[_0x5dc1('0x53')]({},_0x13f123,_0x48f212[_0x5dc1('0xc9')]);return _0x219f6f[_0x5dc1('0xd4')](_0x13f123);}})[_0x5dc1('0x11')](function(_0x44c5b4){if(_0x44c5b4){_0x131d57=_0x44c5b4[_0x5dc1('0x43')];if(!_0x48f212[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x13f123['limit']=qs[_0x5dc1('0x20')](_0x48f212[_0x5dc1('0x3e')]['limit']);_0x13f123[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x48f212[_0x5dc1('0x3e')][_0x5dc1('0x1f')]);}return _0x219f6f[_0x5dc1('0xd4')](_0x13f123);}})[_0x5dc1('0x11')](function(_0xbb4225){if(_0xbb4225){return _0xbb4225?{'count':_0x131d57,'rows':_0xbb4225}:null;}})[_0x5dc1('0x11')](respondWithResult(_0x197bcb,null))['catch'](handleError(_0x197bcb,null));};exports[_0x5dc1('0xd6')]=function(_0x54bd27,_0x35819f){var _0x202e98={'raw':!![],'where':{}};var _0x2777a6={};var _0x11f745={'count':0x0,'rows':[]};return db[_0x5dc1('0x37')]['findOne']({'where':{'id':_0x54bd27[_0x5dc1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x35819f,null))[_0x5dc1('0x11')](function(_0x1ed9d7){if(_0x1ed9d7){_0x2777a6['model']=_['keys'](db[_0x5dc1('0xd7')][_0x5dc1('0x38')]);_0x2777a6[_0x5dc1('0x3e')]=_[_0x5dc1('0x50')](_0x54bd27[_0x5dc1('0x3e')]);_0x2777a6[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x2777a6['model'],_0x2777a6['query']);_0x202e98[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x2777a6[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x54bd27[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x202e98[_0x5dc1('0x41')]=_0x202e98[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0x202e98[_0x5dc1('0x41')]:_0x2777a6['model'];if(!_0x54bd27[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x202e98[_0x5dc1('0x20')]=qs[_0x5dc1('0x20')](_0x54bd27[_0x5dc1('0x3e')][_0x5dc1('0x20')]);_0x202e98[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x54bd27[_0x5dc1('0x3e')]['offset']);}_0x202e98[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x54bd27[_0x5dc1('0x3e')]['sort']);_0x202e98['where']=qs[_0x5dc1('0xc6')](_['pick'](_0x54bd27[_0x5dc1('0x3e')],_0x2777a6['filters']));_0x202e98[_0x5dc1('0x3d')][_0x5dc1('0xd8')]=_0x1ed9d7['id'];if(_0x54bd27['query'][_0x5dc1('0x2d')]){_0x202e98[_0x5dc1('0x3d')]=_['merge'](_0x202e98[_0x5dc1('0x3d')],{'$or':_['map'](_0x202e98[_0x5dc1('0x41')],function(_0x3464ba){var _0x5b3864={};_0x5b3864[_0x3464ba]={'$like':'%'+_0x54bd27[_0x5dc1('0x3e')]['filter']+'%'};return _0x5b3864;})});}_0x202e98=_[_0x5dc1('0x53')]({},_0x202e98,_0x54bd27[_0x5dc1('0xc9')]);return db[_0x5dc1('0xd7')]['count']({'where':_0x202e98[_0x5dc1('0x3d')]})[_0x5dc1('0x11')](function(_0x100590){_0x11f745[_0x5dc1('0x22')]=_0x100590;if(_0x54bd27['query'][_0x5dc1('0x3f')]){_0x202e98[_0x5dc1('0x40')]=[{'all':!![]}];}return db[_0x5dc1('0xd7')][_0x5dc1('0x87')](_0x202e98);})[_0x5dc1('0x11')](function(_0x405969){_0x11f745[_0x5dc1('0x42')]=_0x405969;return _0x11f745;});}})['then'](respondWithFilteredResult(_0x35819f,_0x202e98))[_0x5dc1('0x1a')](handleError(_0x35819f,null));};exports['getScreenRecordings']=function(_0x302f12,_0x4d918b){var _0x4c9364={'raw':!![],'where':{}};var _0x582b62={};var _0x2b38ca={'count':0x0,'rows':[]};return db[_0x5dc1('0x37')]['findOne']({'where':{'id':_0x302f12[_0x5dc1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4d918b,null))[_0x5dc1('0x11')](function(_0x3d8936){if(_0x3d8936){_0x582b62[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db[_0x5dc1('0xd9')]['rawAttributes']);_0x582b62['query']=_[_0x5dc1('0x50')](_0x302f12[_0x5dc1('0x3e')]);_0x582b62[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x582b62[_0x5dc1('0x4e')],_0x582b62[_0x5dc1('0x3e')]);_0x4c9364[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x582b62[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x302f12[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x4c9364[_0x5dc1('0x41')]=_0x4c9364[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0x4c9364[_0x5dc1('0x41')]:_0x582b62[_0x5dc1('0x4e')];if(!_0x302f12[_0x5dc1('0x3e')][_0x5dc1('0xca')]('nolimit')){_0x4c9364[_0x5dc1('0x20')]=qs[_0x5dc1('0x20')](_0x302f12['query'][_0x5dc1('0x20')]);_0x4c9364[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x302f12[_0x5dc1('0x3e')][_0x5dc1('0x1f')]);}_0x4c9364[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x302f12[_0x5dc1('0x3e')]['sort']);_0x4c9364[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_[_0x5dc1('0xc8')](_0x302f12[_0x5dc1('0x3e')],_0x582b62['filters']));_0x4c9364['where']['UserId']=_0x3d8936['id'];if(_0x302f12['query']['filter']){_0x4c9364[_0x5dc1('0x3d')]=_[_0x5dc1('0x53')](_0x4c9364[_0x5dc1('0x3d')],{'$or':_[_0x5dc1('0x2e')](_0x4c9364[_0x5dc1('0x41')],function(_0x4fcb8b){var _0x437e2f={};_0x437e2f[_0x4fcb8b]={'$like':'%'+_0x302f12[_0x5dc1('0x3e')][_0x5dc1('0x2d')]+'%'};return _0x437e2f;})});}_0x4c9364=_[_0x5dc1('0x53')]({},_0x4c9364,_0x302f12[_0x5dc1('0xc9')]);return db[_0x5dc1('0xd9')][_0x5dc1('0x22')]({'where':_0x4c9364[_0x5dc1('0x3d')]})[_0x5dc1('0x11')](function(_0x1f3bf0){_0x2b38ca['count']=_0x1f3bf0;if(_0x302f12[_0x5dc1('0x3e')][_0x5dc1('0x3f')]){_0x4c9364['include']=[{'all':!![]}];}return db[_0x5dc1('0xd9')]['findAll'](_0x4c9364);})['then'](function(_0x3d52f4){_0x2b38ca[_0x5dc1('0x42')]=_0x3d52f4;return _0x2b38ca;});}})[_0x5dc1('0x11')](respondWithFilteredResult(_0x4d918b,_0x4c9364))[_0x5dc1('0x1a')](handleError(_0x4d918b,null));};exports['getChatInteractions']=function(_0x2f52ba,_0x39d0cc){var _0x3c1c2e={};var _0x550a19={};var _0x1308c5;var _0x342b8f;return db[_0x5dc1('0x37')]['findOne']({'where':{'id':_0x2f52ba['params']['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x39d0cc,null))[_0x5dc1('0x11')](function(_0x39fae6){if(_0x39fae6){_0x1308c5=_0x39fae6;_0x550a19[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db[_0x5dc1('0xda')][_0x5dc1('0x38')]);_0x550a19[_0x5dc1('0x3e')]=_[_0x5dc1('0x50')](_0x2f52ba['query']);_0x550a19['filters']=_[_0x5dc1('0x51')](_0x550a19['model'],_0x550a19[_0x5dc1('0x3e')]);_0x3c1c2e[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x550a19['model'],qs[_0x5dc1('0x52')](_0x2f52ba[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x3c1c2e[_0x5dc1('0x41')]=_0x3c1c2e[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0x3c1c2e[_0x5dc1('0x41')]:_0x550a19['model'];_0x3c1c2e[_0x5dc1('0xd1')]=qs['sort'](_0x2f52ba[_0x5dc1('0x3e')][_0x5dc1('0xc7')]);_0x3c1c2e[_0x5dc1('0x3d')]=qs['filters'](_[_0x5dc1('0xc8')](_0x2f52ba[_0x5dc1('0x3e')],_0x550a19['filters']));if(_0x2f52ba['query'][_0x5dc1('0x2d')]){_0x3c1c2e[_0x5dc1('0x3d')]=_['merge'](_0x3c1c2e[_0x5dc1('0x3d')],{'$or':_[_0x5dc1('0x2e')](_0x3c1c2e[_0x5dc1('0x41')],function(_0x3d3c87){var _0x44f490={};_0x44f490[_0x3d3c87]={'$like':'%'+_0x2f52ba['query'][_0x5dc1('0x2d')]+'%'};return _0x44f490;})});}_0x3c1c2e=_[_0x5dc1('0x53')]({},_0x3c1c2e,_0x2f52ba[_0x5dc1('0xc9')]);return _0x1308c5[_0x5dc1('0xdb')](_0x3c1c2e);}})[_0x5dc1('0x11')](function(_0x1787a0){if(_0x1787a0){_0x342b8f=_0x1787a0[_0x5dc1('0x43')];if(!_0x2f52ba[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x3c1c2e[_0x5dc1('0x20')]=qs['limit'](_0x2f52ba[_0x5dc1('0x3e')][_0x5dc1('0x20')]);_0x3c1c2e[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x2f52ba[_0x5dc1('0x3e')][_0x5dc1('0x1f')]);}return _0x1308c5['getChatInteractions'](_0x3c1c2e);}})[_0x5dc1('0x11')](function(_0x545eb6){if(_0x545eb6){return _0x545eb6?{'count':_0x342b8f,'rows':_0x545eb6}:null;}})[_0x5dc1('0x11')](respondWithResult(_0x39d0cc,null))[_0x5dc1('0x1a')](handleError(_0x39d0cc,null));};exports['getOpenchannelInteractions']=function(_0x2c173e,_0x5a9b9c){var _0x2d8562={};var _0x4877b3={};var _0xa3311c;var _0x26d3d6;return db['User']['findOne']({'where':{'id':_0x2c173e[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x5a9b9c,null))[_0x5dc1('0x11')](function(_0x482073){if(_0x482073){_0xa3311c=_0x482073;_0x4877b3[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db[_0x5dc1('0xdc')][_0x5dc1('0x38')]);_0x4877b3[_0x5dc1('0x3e')]=_[_0x5dc1('0x50')](_0x2c173e[_0x5dc1('0x3e')]);_0x4877b3['filters']=_[_0x5dc1('0x51')](_0x4877b3[_0x5dc1('0x4e')],_0x4877b3['query']);_0x2d8562[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x4877b3[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x2c173e['query'][_0x5dc1('0x52')]));_0x2d8562[_0x5dc1('0x41')]=_0x2d8562['attributes'][_0x5dc1('0x43')]?_0x2d8562[_0x5dc1('0x41')]:_0x4877b3[_0x5dc1('0x4e')];_0x2d8562[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x2c173e[_0x5dc1('0x3e')]['sort']);_0x2d8562[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_['pick'](_0x2c173e[_0x5dc1('0x3e')],_0x4877b3['filters']));if(_0x2c173e[_0x5dc1('0x3e')][_0x5dc1('0x2d')]){_0x2d8562[_0x5dc1('0x3d')]=_['merge'](_0x2d8562['where'],{'$or':_[_0x5dc1('0x2e')](_0x2d8562[_0x5dc1('0x41')],function(_0x3e0355){var _0x12ddcf={};_0x12ddcf[_0x3e0355]={'$like':'%'+_0x2c173e[_0x5dc1('0x3e')][_0x5dc1('0x2d')]+'%'};return _0x12ddcf;})});}_0x2d8562=_[_0x5dc1('0x53')]({},_0x2d8562,_0x2c173e[_0x5dc1('0xc9')]);return _0xa3311c['getOpenchannelInteractions'](_0x2d8562);}})['then'](function(_0x1dea67){if(_0x1dea67){_0x26d3d6=_0x1dea67[_0x5dc1('0x43')];if(!_0x2c173e[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x2d8562[_0x5dc1('0x20')]=qs[_0x5dc1('0x20')](_0x2c173e[_0x5dc1('0x3e')]['limit']);_0x2d8562['offset']=qs[_0x5dc1('0x1f')](_0x2c173e[_0x5dc1('0x3e')]['offset']);}return _0xa3311c[_0x5dc1('0xdd')](_0x2d8562);}})[_0x5dc1('0x11')](function(_0x5c23b2){if(_0x5c23b2){return _0x5c23b2?{'count':_0x26d3d6,'rows':_0x5c23b2}:null;}})[_0x5dc1('0x11')](respondWithResult(_0x5a9b9c,null))[_0x5dc1('0x1a')](handleError(_0x5a9b9c,null));};exports['getMailInteractions']=function(_0x5bb14e,_0x21d03b){var _0x29e1cc={'raw':!![],'where':{}};var _0x31fb43={};var _0x3c545c={'count':0x0,'rows':[]};return db[_0x5dc1('0x37')][_0x5dc1('0xc4')]({'where':{'id':_0x5bb14e[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x21d03b,null))[_0x5dc1('0x11')](function(_0x30bb9d){if(_0x30bb9d){_0x31fb43[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db[_0x5dc1('0xde')][_0x5dc1('0x38')]);_0x31fb43[_0x5dc1('0x3e')]=_[_0x5dc1('0x50')](_0x5bb14e[_0x5dc1('0x3e')]);_0x31fb43['filters']=_[_0x5dc1('0x51')](_0x31fb43[_0x5dc1('0x4e')],_0x31fb43[_0x5dc1('0x3e')]);_0x29e1cc[_0x5dc1('0x41')]=_['intersection'](_0x31fb43['model'],qs[_0x5dc1('0x52')](_0x5bb14e[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x29e1cc[_0x5dc1('0x41')]=_0x29e1cc[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0x29e1cc[_0x5dc1('0x41')]:_0x31fb43[_0x5dc1('0x4e')];if(!_0x5bb14e[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x29e1cc[_0x5dc1('0x20')]=qs['limit'](_0x5bb14e[_0x5dc1('0x3e')]['limit']);_0x29e1cc[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x5bb14e[_0x5dc1('0x3e')][_0x5dc1('0x1f')]);}_0x29e1cc[_0x5dc1('0xd1')]=qs['sort'](_0x5bb14e[_0x5dc1('0x3e')][_0x5dc1('0xc7')]);_0x29e1cc[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_[_0x5dc1('0xc8')](_0x5bb14e[_0x5dc1('0x3e')],_0x31fb43['filters']));_0x29e1cc[_0x5dc1('0x3d')][_0x5dc1('0xd8')]=_0x30bb9d['id'];if(_0x5bb14e[_0x5dc1('0x3e')][_0x5dc1('0x2d')]){_0x29e1cc[_0x5dc1('0x3d')]=_['merge'](_0x29e1cc[_0x5dc1('0x3d')],{'$or':_['map'](_0x29e1cc['attributes'],function(_0x26a249){var _0x4be3df={};_0x4be3df[_0x26a249]={'$like':'%'+_0x5bb14e['query'][_0x5dc1('0x2d')]+'%'};return _0x4be3df;})});}_0x29e1cc=_[_0x5dc1('0x53')]({},_0x29e1cc,_0x5bb14e[_0x5dc1('0xc9')]);return db['MailInteraction']['count']({'where':_0x29e1cc[_0x5dc1('0x3d')]})['then'](function(_0x40fa29){_0x3c545c['count']=_0x40fa29;if(_0x5bb14e['query'][_0x5dc1('0x3f')]){_0x29e1cc[_0x5dc1('0x40')]=[{'all':!![]}];}return db[_0x5dc1('0xde')][_0x5dc1('0x87')](_0x29e1cc);})[_0x5dc1('0x11')](function(_0x4a37d5){_0x3c545c[_0x5dc1('0x42')]=_0x4a37d5;return _0x3c545c;});}})[_0x5dc1('0x11')](respondWithFilteredResult(_0x21d03b,_0x29e1cc))[_0x5dc1('0x1a')](handleError(_0x21d03b,null));};exports['getSmsInteractions']=function(_0x4cef9d,_0x24ee6c){var _0x22cdf3={};var _0x4eed8b={};var _0x336d9d;var _0x1f67e7;return db[_0x5dc1('0x37')][_0x5dc1('0xc4')]({'where':{'id':_0x4cef9d[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x24ee6c,null))[_0x5dc1('0x11')](function(_0x447715){if(_0x447715){_0x336d9d=_0x447715;_0x4eed8b[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db[_0x5dc1('0xdf')]['rawAttributes']);_0x4eed8b[_0x5dc1('0x3e')]=_[_0x5dc1('0x50')](_0x4cef9d['query']);_0x4eed8b[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x4eed8b[_0x5dc1('0x4e')],_0x4eed8b[_0x5dc1('0x3e')]);_0x22cdf3[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x4eed8b[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x4cef9d[_0x5dc1('0x3e')]['fields']));_0x22cdf3[_0x5dc1('0x41')]=_0x22cdf3[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0x22cdf3[_0x5dc1('0x41')]:_0x4eed8b[_0x5dc1('0x4e')];_0x22cdf3['order']=qs[_0x5dc1('0xc7')](_0x4cef9d[_0x5dc1('0x3e')][_0x5dc1('0xc7')]);_0x22cdf3['where']=qs[_0x5dc1('0xc6')](_[_0x5dc1('0xc8')](_0x4cef9d['query'],_0x4eed8b[_0x5dc1('0xc6')]));if(_0x4cef9d[_0x5dc1('0x3e')][_0x5dc1('0x2d')]){_0x22cdf3[_0x5dc1('0x3d')]=_[_0x5dc1('0x53')](_0x22cdf3[_0x5dc1('0x3d')],{'$or':_['map'](_0x22cdf3[_0x5dc1('0x41')],function(_0xe771c5){var _0x3e479d={};_0x3e479d[_0xe771c5]={'$like':'%'+_0x4cef9d[_0x5dc1('0x3e')]['filter']+'%'};return _0x3e479d;})});}_0x22cdf3=_[_0x5dc1('0x53')]({},_0x22cdf3,_0x4cef9d[_0x5dc1('0xc9')]);return _0x336d9d['getSmsInteractions'](_0x22cdf3);}})[_0x5dc1('0x11')](function(_0x190ff2){if(_0x190ff2){_0x1f67e7=_0x190ff2[_0x5dc1('0x43')];if(!_0x4cef9d[_0x5dc1('0x3e')][_0x5dc1('0xca')]('nolimit')){_0x22cdf3['limit']=qs[_0x5dc1('0x20')](_0x4cef9d[_0x5dc1('0x3e')]['limit']);_0x22cdf3[_0x5dc1('0x1f')]=qs['offset'](_0x4cef9d[_0x5dc1('0x3e')][_0x5dc1('0x1f')]);}return _0x336d9d['getSmsInteractions'](_0x22cdf3);}})[_0x5dc1('0x11')](function(_0x20cb20){if(_0x20cb20){return _0x20cb20?{'count':_0x1f67e7,'rows':_0x20cb20}:null;}})[_0x5dc1('0x11')](respondWithResult(_0x24ee6c,null))[_0x5dc1('0x1a')](handleError(_0x24ee6c,null));};exports[_0x5dc1('0xe0')]=function(_0x5641db,_0x5030f8){var _0x44663f={};var _0x3aced0={};var _0x1028b8;var _0x5a6581;return db[_0x5dc1('0x37')]['findOne']({'where':{'id':_0x5641db[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x5030f8,null))['then'](function(_0x464cae){if(_0x464cae){_0x1028b8=_0x464cae;_0x3aced0[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db[_0x5dc1('0xe1')][_0x5dc1('0x38')]);_0x3aced0[_0x5dc1('0x3e')]=_[_0x5dc1('0x50')](_0x5641db['query']);_0x3aced0['filters']=_['intersection'](_0x3aced0[_0x5dc1('0x4e')],_0x3aced0[_0x5dc1('0x3e')]);_0x44663f[_0x5dc1('0x41')]=_['intersection'](_0x3aced0['model'],qs[_0x5dc1('0x52')](_0x5641db[_0x5dc1('0x3e')]['fields']));_0x44663f[_0x5dc1('0x41')]=_0x44663f[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0x44663f[_0x5dc1('0x41')]:_0x3aced0[_0x5dc1('0x4e')];_0x44663f[_0x5dc1('0xd1')]=qs['sort'](_0x5641db['query']['sort']);_0x44663f[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_[_0x5dc1('0xc8')](_0x5641db['query'],_0x3aced0[_0x5dc1('0xc6')]));if(_0x5641db[_0x5dc1('0x3e')][_0x5dc1('0x2d')]){_0x44663f[_0x5dc1('0x3d')]=_['merge'](_0x44663f['where'],{'$or':_[_0x5dc1('0x2e')](_0x44663f['attributes'],function(_0x44cd4c){var _0x3021b2={};_0x3021b2[_0x44cd4c]={'$like':'%'+_0x5641db[_0x5dc1('0x3e')][_0x5dc1('0x2d')]+'%'};return _0x3021b2;})});}_0x44663f=_[_0x5dc1('0x53')]({},_0x44663f,_0x5641db[_0x5dc1('0xc9')]);return _0x1028b8[_0x5dc1('0xe0')](_0x44663f);}})[_0x5dc1('0x11')](function(_0x35882f){if(_0x35882f){_0x5a6581=_0x35882f[_0x5dc1('0x43')];if(!_0x5641db['query'][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x44663f['limit']=qs[_0x5dc1('0x20')](_0x5641db[_0x5dc1('0x3e')][_0x5dc1('0x20')]);_0x44663f[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x5641db['query'][_0x5dc1('0x1f')]);}return _0x1028b8[_0x5dc1('0xe0')](_0x44663f);}})[_0x5dc1('0x11')](function(_0x3205f5){if(_0x3205f5){return _0x3205f5?{'count':_0x5a6581,'rows':_0x3205f5}:null;}})[_0x5dc1('0x11')](respondWithResult(_0x5030f8,null))['catch'](handleError(_0x5030f8,null));};exports[_0x5dc1('0xe2')]=function(_0x23d540,_0x578688){var _0x458380={};var _0x248e9e={};var _0x10467f;var _0x1ffe10;return db[_0x5dc1('0x37')]['findOne']({'where':{'id':_0x23d540[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x578688,null))[_0x5dc1('0x11')](function(_0x3bca25){if(_0x3bca25){_0x10467f=_0x3bca25;_0x248e9e[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db['WhatsappInteraction'][_0x5dc1('0x38')]);_0x248e9e[_0x5dc1('0x3e')]=_['keys'](_0x23d540['query']);_0x248e9e[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x248e9e['model'],_0x248e9e['query']);_0x458380[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x248e9e[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x23d540['query'][_0x5dc1('0x52')]));_0x458380[_0x5dc1('0x41')]=_0x458380[_0x5dc1('0x41')]['length']?_0x458380[_0x5dc1('0x41')]:_0x248e9e['model'];_0x458380[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x23d540['query']['sort']);_0x458380[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_[_0x5dc1('0xc8')](_0x23d540[_0x5dc1('0x3e')],_0x248e9e[_0x5dc1('0xc6')]));if(_0x23d540[_0x5dc1('0x3e')]['filter']){_0x458380[_0x5dc1('0x3d')]=_[_0x5dc1('0x53')](_0x458380['where'],{'$or':_[_0x5dc1('0x2e')](_0x458380[_0x5dc1('0x41')],function(_0x57cae0){var _0x1e39f0={};_0x1e39f0[_0x57cae0]={'$like':'%'+_0x23d540['query'][_0x5dc1('0x2d')]+'%'};return _0x1e39f0;})});}_0x458380=_['merge']({},_0x458380,_0x23d540[_0x5dc1('0xc9')]);return _0x10467f[_0x5dc1('0xe2')](_0x458380);}})[_0x5dc1('0x11')](function(_0x3ed884){if(_0x3ed884){_0x1ffe10=_0x3ed884[_0x5dc1('0x43')];if(!_0x23d540[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x458380[_0x5dc1('0x20')]=qs['limit'](_0x23d540[_0x5dc1('0x3e')][_0x5dc1('0x20')]);_0x458380[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x23d540['query']['offset']);}return _0x10467f[_0x5dc1('0xe2')](_0x458380);}})[_0x5dc1('0x11')](function(_0x25028a){if(_0x25028a){return _0x25028a?{'count':_0x1ffe10,'rows':_0x25028a}:null;}})[_0x5dc1('0x11')](respondWithResult(_0x578688,null))[_0x5dc1('0x1a')](handleError(_0x578688,null));};exports['login']=function(_0x15d540,_0x54318d,_0x4ea5d5){var _0x4b0fa2;var _0x435a81;var _0x31e041;var _0x302c3d=!_[_0x5dc1('0x61')](_0x15d540['params']['id'])?_0x15d540['params']['id']:!_[_0x5dc1('0x61')](_0x15d540['user']['id'])?_0x15d540[_0x5dc1('0x79')]['id']:null;return db[_0x5dc1('0x37')]['find']({'where':{'id':_0x302c3d,'role':{'$or':[_0x5dc1('0x28'),'user','agent']}},'attributes':['id','name','phone',_0x5dc1('0xe3'),_0x5dc1('0x27'),_0x5dc1('0x5c'),_0x5dc1('0x99')]})[_0x5dc1('0x11')](function(_0x3e49f6){if(_0x3e49f6){if(_0x3e49f6['role']===_0x5dc1('0x2a')){_0x4b0fa2=_0x3e49f6;if(_0x15d540[_0x5dc1('0x58')][_0x5dc1('0x9b')]){_0x31e041=util[_0x5dc1('0xe4')]('LOCAL/%s@from-sip/n',_0x4b0fa2[_0x15d540['body'][_0x5dc1('0x9b')]]);}else if(_0x15d540[_0x5dc1('0x58')][_0x5dc1('0xe5')]){_0x31e041=util[_0x5dc1('0xe4')](_0x5dc1('0xa7'),_0x15d540['body'][_0x5dc1('0xe5')]);}else{_0x31e041=util[_0x5dc1('0xe4')](_0x5dc1('0xa7'),_0x4b0fa2[_0x5dc1('0x31')]);}socket['to'](util['format'](_0x5dc1('0xe6'),_0x4b0fa2['name']))[_0x5dc1('0xa3')]('user:forcelogout',{'user':{'id':_0x4b0fa2['id'],'name':_0x4b0fa2['name']},'ip':_0x15d540['headers'][_0x5dc1('0xe7')]||_0x15d540[_0x5dc1('0xe8')]['remoteAddress']||_0x15d540[_0x5dc1('0xe9')][_0x5dc1('0xea')]||_0x15d540[_0x5dc1('0xe8')][_0x5dc1('0xe9')][_0x5dc1('0xea')]});return db[_0x5dc1('0xad')][_0x5dc1('0x33')]({'where':{'membername':_0x4b0fa2[_0x5dc1('0x31')]},'individualHooks':!![]});}}else{throw new db[(_0x5dc1('0x8a'))]['ValidationError'](_0x5dc1('0xeb'));}})[_0x5dc1('0x11')](function(){if(_0x4b0fa2){return _0x4b0fa2[_0x5dc1('0xec')]({'raw':!![]});}})['then'](function(_0x47bb8f){if(_0x4b0fa2){var _0x4dbd81=[];if(_0x47bb8f){_0x435a81=_0x47bb8f;if(_0x435a81['length']){for(var _0x197726=0x0;_0x197726<_0x435a81['length'];_0x197726++){_0x4dbd81[_0x5dc1('0x44')]({'membername':_0x4b0fa2['name'],'UserId':_0x4b0fa2['id'],'queue_name':_0x435a81[_0x197726][_0x5dc1('0x31')],'VoiceQueueId':_0x435a81[_0x197726]['id'],'interface':_0x31e041,'paused':_0x4b0fa2[_0x5dc1('0x99')]||![],'penalty':_0x435a81[_0x197726][_0x5dc1('0xed')]||0x0});}return BPromise['each'](_0x4dbd81,function(_0x2127e0){return db[_0x5dc1('0xad')][_0x5dc1('0xee')](_0x2127e0);});}}}})[_0x5dc1('0x11')](function(){if(_0x4b0fa2){return db['MemberReport'][_0x5dc1('0x87')]({'where':{'membername':_0x4b0fa2[_0x5dc1('0x31')],'exitAt':null}});}})[_0x5dc1('0x11')](function(_0x1a2c7c){if(_0x4b0fa2){var _0x1076b6=[];_0x1a2c7c[_0x5dc1('0xef')](function(_0x185e41){_0x1076b6[_0x5dc1('0x44')](_0x185e41[_0x5dc1('0x25')]({'exitAt':moment()[_0x5dc1('0xe4')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x5dc1('0x4b')](_0x1076b6);}})[_0x5dc1('0x11')](function(){if(_0x4b0fa2){var _0x3b85e9=[];var _0x2406b9=[];var _0x2ae902=utils[_0x5dc1('0xf0')]();var _0x4e95dd={'membername':_0x4b0fa2['name'],'interface':_0x31e041,'enterAt':moment()[_0x5dc1('0xe4')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4b0fa2[_0x5dc1('0x27')],'internal':_0x4b0fa2[_0x5dc1('0x5c')]};_0x2ae902[_0x5dc1('0xef')](function(_0x30b27c){_0x3b85e9[_0x5dc1('0x44')](_[_0x5dc1('0x53')]({'channel':_0x30b27c,'type':'LOGIN','data1':_0x15d540[_0x5dc1('0x58')][_0x5dc1('0xf1')],'data2':_0x31e041},_0x4e95dd));if(_0x4b0fa2['loginInPause']){_0x2406b9[_0x5dc1('0x44')](_[_0x5dc1('0x53')]({'channel':_0x30b27c,'type':_0x5dc1('0xf2'),'data1':_0x5dc1('0xf3')},_0x4e95dd));}});return db['MemberReport'][_0x5dc1('0x82')](_0x3b85e9[_0x5dc1('0xf4')](_0x2406b9),{'individualHooks':!![]});}})[_0x5dc1('0x11')](function(){if(_0x4b0fa2){return _0x4b0fa2[_0x5dc1('0x25')]({'online':!![],'lastLoginAt':moment()[_0x5dc1('0xe4')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4b0fa2[_0x5dc1('0x99')]||![],'mailPause':_0x4b0fa2[_0x5dc1('0x99')]||![],'chatPause':_0x4b0fa2[_0x5dc1('0x99')]||![],'faxPause':_0x4b0fa2[_0x5dc1('0x99')]||![],'smsPause':_0x4b0fa2['loginInPause']||![],'openchannelPause':_0x4b0fa2['loginInPause']||![],'whatsappPause':_0x4b0fa2[_0x5dc1('0x99')]||![],'pauseType':_0x4b0fa2[_0x5dc1('0x99')]?_0x5dc1('0xf3'):null,'interface':_0x31e041,'lastPauseAt':moment()[_0x5dc1('0xe4')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x5dc1('0x11')](function(_0x3bf697){if(_0x15d540[_0x5dc1('0xf5')]){return _0x4ea5d5();}else{return BPromise[_0x5dc1('0xf6')](_0x3bf697)[_0x5dc1('0x11')](respondWithResult(_0x54318d,null));}})[_0x5dc1('0x1a')](handleError(_0x54318d,null));};exports[_0x5dc1('0xf7')]=function(_0xa1e03d,_0x7220ed){var _0x516586;return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0xa1e03d[_0x5dc1('0x4d')]['id'],'role':_0x5dc1('0x2a')},'attributes':['id',_0x5dc1('0x31'),'role']})['then'](handleEntityNotFound(_0x7220ed,null))[_0x5dc1('0x11')](function(_0xadb408){if(_0xadb408){_0x516586=_0xadb408;return db[_0x5dc1('0xad')][_0x5dc1('0x33')]({'where':{'membername':_0x516586[_0x5dc1('0x31')]},'individualHooks':!![]});}})[_0x5dc1('0x11')](function(){return db[_0x5dc1('0xf8')][_0x5dc1('0x87')]({'where':{'membername':_0x516586[_0x5dc1('0x31')],'exitAt':null}});})[_0x5dc1('0x11')](function(_0x3a2444){var _0x30d0d8=[];_0x3a2444[_0x5dc1('0xef')](function(_0x335056){_0x30d0d8[_0x5dc1('0x44')](_0x335056['update']({'exitAt':moment()['format'](_0x5dc1('0xf9'))}));});return BPromise[_0x5dc1('0x4b')](_0x30d0d8);})[_0x5dc1('0x11')](function(){return _0x516586['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x5dc1('0x11')](respondWithResult(_0x7220ed,null))[_0x5dc1('0x1a')](handleError(_0x7220ed,null));};exports[_0x5dc1('0xfa')]=function(_0x26a854,_0x169e18){var _0x57e622;return db[_0x5dc1('0xad')][_0x5dc1('0x25')]({'paused':0x1},{'where':{'UserId':_0x26a854[_0x5dc1('0x4d')]['id']},'individualHooks':!![]})[_0x5dc1('0x11')](function(){return db['User'][_0x5dc1('0x54')]({'where':{'id':_0x26a854[_0x5dc1('0x4d')]['id'],'role':'agent'},'attributes':['id','name',_0x5dc1('0x27'),_0x5dc1('0x5c'),_0x5dc1('0x9b')]});})['then'](handleEntityNotFound(_0x169e18,null))['then'](function(_0x23685d){if(_0x23685d){_0x57e622=_0x23685d;return respondWithRpcPromise(_0x5dc1('0xfb'),_0x5dc1('0xfa'),{'id':_0x57e622['id'],'name':_0x57e622[_0x5dc1('0x31')],'pause':!![]});}})[_0x5dc1('0x11')](function(){if(_0x57e622){return db[_0x5dc1('0xf8')]['findAll']({'where':{'membername':_0x57e622[_0x5dc1('0x31')],'type':_0x5dc1('0xf2'),'exitAt':null}});}})[_0x5dc1('0x11')](function(_0x37f0bd){if(_0x37f0bd[_0x5dc1('0x43')]){var _0x2aa105=moment()[_0x5dc1('0xe4')](_0x5dc1('0xf9'));for(var _0x5b1b84=0x0,_0x35587c=_0x37f0bd[_0x5dc1('0x43')];_0x5b1b84<_0x35587c;_0x5b1b84++){_0x37f0bd[_0x5b1b84][_0x5dc1('0xfc')]({'exitAt':_0x2aa105});}}})[_0x5dc1('0x11')](function(){var _0x39ee43=[];var _0x348755=utils['getChannels']();_0x348755[_0x5dc1('0xef')](function(_0x1e8644){_0x39ee43[_0x5dc1('0x44')]({'channel':_0x1e8644,'membername':_0x57e622[_0x5dc1('0x31')],'interface':_[_0x5dc1('0x61')](_0x57e622[_0x5dc1('0x9b')])?util[_0x5dc1('0xe4')](_0x5dc1('0xa7'),_0x57e622[_0x5dc1('0x31')]):_0x57e622[_0x5dc1('0x9b')],'type':_0x5dc1('0xf2'),'enterAt':moment()[_0x5dc1('0xe4')](_0x5dc1('0xf9')),'data1':_0x26a854[_0x5dc1('0x58')][_0x5dc1('0xfd')]||'DEFAULT\x20PAUSE','role':_0x57e622['role'],'internal':_0x57e622[_0x5dc1('0x5c')]});});return db[_0x5dc1('0xf8')]['bulkCreate'](_0x39ee43,{'individualHooks':!![]});})[_0x5dc1('0x11')](function(){return _0x57e622[_0x5dc1('0x25')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x26a854[_0x5dc1('0x58')]['type']||_0x5dc1('0xfe'),'lastPauseAt':moment()[_0x5dc1('0xe4')](_0x5dc1('0xf9'))});})[_0x5dc1('0x11')](respondWithResult(_0x169e18,null))['catch'](handleError(_0x169e18,null));};exports['unpause']=function(_0x2a1e1b,_0x53b964){var _0xaa2e50;return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x2a1e1b['params']['id']},'attributes':['id',_0x5dc1('0x31'),_0x5dc1('0x27'),_0x5dc1('0x9a'),_0x5dc1('0xff'),_0x5dc1('0x100'),_0x5dc1('0x101'),_0x5dc1('0x102'),'smsPause',_0x5dc1('0x103'),'pauseType','lastPauseAt']})[_0x5dc1('0x11')](handleEntityNotFound(_0x53b964,null))[_0x5dc1('0x11')](function(_0x5d515a){if(_0x5d515a){_0xaa2e50=_0x5d515a;if(_0x2a1e1b[_0x5dc1('0x58')][_0x5dc1('0xa9')]&&!utils['isValidChannel'](_0x2a1e1b['body'][_0x5dc1('0xa9')])){throw new db[(_0x5dc1('0x8a'))][(_0x5dc1('0x8b'))](_0x5dc1('0x9c'));}switch(_0x2a1e1b['body'][_0x5dc1('0xa9')]){case'voice':return respondWithRpcPromise(_0x5dc1('0xfb'),_0x5dc1('0x104'),{'id':_0xaa2e50['id'],'name':_0xaa2e50[_0x5dc1('0x31')],'pause':![]})[_0x5dc1('0x11')](function(){return db['UserVoiceQueueRt'][_0x5dc1('0x25')]({'paused':0x0},{'where':{'UserId':_0xaa2e50['id']},'individualHooks':!![]});})[_0x5dc1('0x11')](function(){return db[_0x5dc1('0xf8')][_0x5dc1('0x54')]({'where':{'channel':_0x2a1e1b[_0x5dc1('0x58')][_0x5dc1('0xa9')],'membername':_0xaa2e50[_0x5dc1('0x31')],'type':_0x5dc1('0xf2'),'exitAt':null}});})[_0x5dc1('0x11')](function(_0xcfa880){if(_0xcfa880){return _0xcfa880['update']({'exitAt':moment()[_0x5dc1('0xe4')](_0x5dc1('0xf9')),'data2':_0x5dc1('0x105')},{'individualHooks':!![]});}return null;})[_0x5dc1('0x11')](function(){return _0xaa2e50[_0x5dc1('0x25')]({'voicePause':![]});});case _0x5dc1('0x48'):case _0x5dc1('0x45'):case'fax':case _0x5dc1('0x57'):case _0x5dc1('0x4a'):case'openchannel':return db['MemberReport']['find']({'where':{'channel':_0x2a1e1b['body'][_0x5dc1('0xa9')],'membername':_0xaa2e50[_0x5dc1('0x31')],'type':_0x5dc1('0xf2'),'exitAt':null}})[_0x5dc1('0x11')](function(_0x55fc2a){if(_0x55fc2a){return _0x55fc2a[_0x5dc1('0x25')]({'exitAt':moment()[_0x5dc1('0xe4')](_0x5dc1('0xf9')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x5dc1('0x11')](function(){var _0x454e4b={};_[_0x5dc1('0x23')](_0x454e4b,util[_0x5dc1('0xe4')](_0x5dc1('0x106'),_0x2a1e1b['body'][_0x5dc1('0xa9')],_0x5dc1('0x107')),![]);return _0xaa2e50[_0x5dc1('0x25')](_0x454e4b);});default:return respondWithRpcPromise(_0x5dc1('0xfb'),_0x5dc1('0x104'),{'id':_0xaa2e50['id'],'name':_0xaa2e50[_0x5dc1('0x31')],'pause':![]})['then'](function(){return db[_0x5dc1('0xad')][_0x5dc1('0x25')]({'paused':0x0},{'where':{'UserId':_0xaa2e50['id']}});})['then'](function(){return db[_0x5dc1('0xf8')][_0x5dc1('0x87')]({'where':{'membername':_0xaa2e50['name'],'type':'PAUSE','exitAt':null}});})[_0x5dc1('0x11')](function(_0x10e432){var _0x808cb4=[];_0x10e432['forEach'](function(_0x208624){_0x808cb4['push'](_0x208624[_0x5dc1('0x25')]({'exitAt':moment()[_0x5dc1('0xe4')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x5dc1('0x105')}));});return BPromise['all'](_0x808cb4);})[_0x5dc1('0x11')](function(){return _0xaa2e50[_0x5dc1('0x25')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x5dc1('0x11')](respondWithResult(_0x53b964,null))[_0x5dc1('0x1a')](handleError(_0x53b964,null));};exports[_0x5dc1('0x108')]=function(_0x2643a1,_0xd2dc39){var _0x86ea5f={};var _0x579890={};var _0x5b4f9f;var _0x2a7130;return db[_0x5dc1('0x37')]['findOne']({'where':{'id':_0x2643a1[_0x5dc1('0x4d')]['id']}})['then'](handleEntityNotFound(_0xd2dc39,null))[_0x5dc1('0x11')](function(_0x1482ee){if(_0x1482ee){_0x5b4f9f=_0x1482ee;_0x579890[_0x5dc1('0x4e')]=_['keys'](db[_0x5dc1('0x109')]['rawAttributes']);_0x579890[_0x5dc1('0x3e')]=_['keys'](_0x2643a1[_0x5dc1('0x3e')]);_0x579890[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x579890['model'],_0x579890[_0x5dc1('0x3e')]);_0x86ea5f[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x579890[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x2643a1[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x86ea5f[_0x5dc1('0x41')]=_0x86ea5f[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0x86ea5f[_0x5dc1('0x41')]:_0x579890[_0x5dc1('0x4e')];_0x86ea5f[_0x5dc1('0xd1')]=qs['sort'](_0x2643a1[_0x5dc1('0x3e')][_0x5dc1('0xc7')]);_0x86ea5f[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_[_0x5dc1('0xc8')](_0x2643a1[_0x5dc1('0x3e')],_0x579890[_0x5dc1('0xc6')]));if(_0x2643a1[_0x5dc1('0x3e')][_0x5dc1('0x2d')]){_0x86ea5f[_0x5dc1('0x3d')]=_[_0x5dc1('0x53')](_0x86ea5f[_0x5dc1('0x3d')],{'$or':_[_0x5dc1('0x2e')](_0x86ea5f[_0x5dc1('0x41')],function(_0x5e2cd1){var _0x527051={};_0x527051[_0x5e2cd1]={'$like':'%'+_0x2643a1[_0x5dc1('0x3e')][_0x5dc1('0x2d')]+'%'};return _0x527051;})});}_0x86ea5f=_[_0x5dc1('0x53')]({},_0x86ea5f,_0x2643a1[_0x5dc1('0xc9')]);return _0x5b4f9f['getTeams'](_0x86ea5f);}})[_0x5dc1('0x11')](function(_0x4535d2){if(_0x4535d2){_0x2a7130=_0x4535d2[_0x5dc1('0x43')];if(!_0x2643a1[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x86ea5f[_0x5dc1('0x20')]=qs[_0x5dc1('0x20')](_0x2643a1[_0x5dc1('0x3e')][_0x5dc1('0x20')]);_0x86ea5f[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x2643a1['query'][_0x5dc1('0x1f')]);}return _0x5b4f9f['getTeams'](_0x86ea5f);}})['then'](function(_0x18691b){if(_0x18691b){return _0x18691b?{'count':_0x2a7130,'rows':_0x18691b}:null;}})[_0x5dc1('0x11')](respondWithResult(_0xd2dc39,null))[_0x5dc1('0x1a')](handleError(_0xd2dc39,null));};exports[_0x5dc1('0x10a')]=function(_0x26043a,_0x226e4f){return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x26043a[_0x5dc1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x226e4f,null))[_0x5dc1('0x11')](function(_0x5aa8ec){if(_0x5aa8ec){var _0xa3a7bb=_0x5aa8ec[_0x5dc1('0x26')]({'plain':!![]});return _0x5aa8ec[_0x5dc1('0x10a')](_0x26043a[_0x5dc1('0x58')][_0x5dc1('0x5b')],_[_0x5dc1('0x10b')](_0x26043a[_0x5dc1('0x58')],[_0x5dc1('0x5b'),'id'])||{})['then'](function(){for(var _0x2cad89=0x0;_0x2cad89<_0x26043a['body'][_0x5dc1('0x5b')]['length'];_0x2cad89++){var _0x54a555=[];var _0x235c29={};db[_0x5dc1('0x109')][_0x5dc1('0xc4')]({'where':{'id':_0x26043a[_0x5dc1('0x58')][_0x5dc1('0x5b')][_0x2cad89]}})[_0x5dc1('0x11')](function(_0x2dd97a){_0x235c29=_0x2dd97a[_0x5dc1('0x46')];_0x54a555[_0x5dc1('0x44')](_0x2dd97a[_0x5dc1('0xec')]()[_0x5dc1('0x11')](function(_0x388c0c){for(var _0x24dac5=0x0;_0x24dac5<_0x388c0c[_0x5dc1('0x43')];_0x24dac5++){_0x388c0c[_0x24dac5]['setDataValue'](_0x5dc1('0xa9'),_0x5dc1('0x10c'));}return _0x388c0c;}));_0x54a555[_0x5dc1('0x44')](_0x2dd97a['getChatQueues']()[_0x5dc1('0x11')](function(_0x38ae9a){for(var _0x337aef=0x0;_0x337aef<_0x38ae9a['length'];_0x337aef++){_0x38ae9a[_0x337aef]['setDataValue'](_0x5dc1('0xa9'),_0x5dc1('0x10d'));}return _0x38ae9a;}));_0x54a555[_0x5dc1('0x44')](_0x2dd97a['getMailQueues']()[_0x5dc1('0x11')](function(_0x2951a3){for(var _0x50269a=0x0;_0x50269a<_0x2951a3['length'];_0x50269a++){_0x2951a3[_0x50269a]['setDataValue'](_0x5dc1('0xa9'),_0x5dc1('0x10e'));}return _0x2951a3;}));_0x54a555[_0x5dc1('0x44')](_0x2dd97a[_0x5dc1('0x10f')]()['then'](function(_0x14aeaf){for(var _0x46c4a1=0x0;_0x46c4a1<_0x14aeaf[_0x5dc1('0x43')];_0x46c4a1++){_0x14aeaf[_0x46c4a1][_0x5dc1('0x110')](_0x5dc1('0xa9'),_0x5dc1('0x111'));}return _0x14aeaf;}));_0x54a555[_0x5dc1('0x44')](_0x2dd97a['getWhatsappQueues']()[_0x5dc1('0x11')](function(_0x53488){for(var _0x310840=0x0;_0x310840<_0x53488['length'];_0x310840++){_0x53488[_0x310840]['setDataValue'](_0x5dc1('0xa9'),_0x5dc1('0x112'));}return _0x53488;}));_0x54a555[_0x5dc1('0x44')](_0x2dd97a[_0x5dc1('0x113')]()[_0x5dc1('0x11')](function(_0x4292a3){for(var _0x5cf677=0x0;_0x5cf677<_0x4292a3[_0x5dc1('0x43')];_0x5cf677++){_0x4292a3[_0x5cf677]['setDataValue'](_0x5dc1('0xa9'),_0x5dc1('0x114'));}return _0x4292a3;}));_0x54a555[_0x5dc1('0x44')](_0x2dd97a[_0x5dc1('0x115')]()[_0x5dc1('0x11')](function(_0x3a30b9){for(var _0xfe17db=0x0;_0xfe17db<_0x3a30b9[_0x5dc1('0x43')];_0xfe17db++){_0x3a30b9[_0xfe17db]['setDataValue'](_0x5dc1('0xa9'),'Openchannel');}return _0x3a30b9;}));return BPromise[_0x5dc1('0x4b')](_0x54a555);})[_0x5dc1('0x11')](function(_0x1151ed){var _0x83e69f=_[_0x5dc1('0x116')](_0x1151ed);_0x54a555=[];return db['sequelize']['transaction'](function(_0x16db3b){for(var _0x5c172e=0x0;_0x5c172e<_0x83e69f[_0x5dc1('0x43')];_0x5c172e++){_0x54a555[_0x5dc1('0x44')](_0x83e69f[_0x5c172e][_0x5dc1('0x117')](_0xa3a7bb['id']),{'transaction':_0x16db3b});}return BPromise[_0x5dc1('0x4b')](_0x54a555)[_0x5dc1('0x11')](function(){if(_0xa3a7bb[_0x5dc1('0x98')]){return BPromise[_0x5dc1('0x85')](_['filter'](_0x83e69f,function(_0x34a565){return _0x34a565[_0x5dc1('0x118')]('channel')==='Voice';}),function(_0x1bf3d1){return db[_0x5dc1('0xad')][_0x5dc1('0xee')]({'membername':_0xa3a7bb[_0x5dc1('0x31')],'UserId':_0xa3a7bb['id'],'queue_name':_0x1bf3d1[_0x5dc1('0x31')],'VoiceQueueId':_0x1bf3d1['id'],'interface':_['isNil'](_0xa3a7bb['interface'])?util[_0x5dc1('0xe4')](_0x5dc1('0xa7'),_0xa3a7bb[_0x5dc1('0x31')]):_0xa3a7bb[_0x5dc1('0x9b')],'paused':_0xa3a7bb[_0x5dc1('0x9a')]||![],'penalty':_0xa3a7bb[_0x5dc1('0xa8')]},{'transaction':_0x16db3b});});}else{return;}})['then'](function(){for(var _0x4d3cdc=0x0;_0x4d3cdc<_0x83e69f[_0x5dc1('0x43')];_0x4d3cdc++){var _0x221e7f=_0x83e69f[_0x4d3cdc][_0x5dc1('0x118')]('channel');var _0xd9922d=_0x221e7f+_0x5dc1('0xa2');socket[_0x5dc1('0xa3')](_0x5dc1('0x79')+_0x221e7f+_0x5dc1('0xa4'),{'UserId':_0xa3a7bb['id'],['queueField']:_0x83e69f[_0x4d3cdc]['id']});}});});})[_0x5dc1('0x11')](function(){db[_0x5dc1('0x119')][_0x5dc1('0xc4')]({'where':{'teamId':_0x235c29['id']}})[_0x5dc1('0x11')](function(_0x125463){if(_0x125463){db['UserVoicePrefix']['create']({'UserId':_0x26043a['params']['id'],'VoicePrefixId':_0x125463[_0x5dc1('0x11a')]});}});});}});}})['then'](respondWithStatusCode(_0x226e4f,null))[_0x5dc1('0x1a')](handleError(_0x226e4f,null));};exports[_0x5dc1('0x11b')]=function(_0x5a49a2,_0x537f3d){return db['User'][_0x5dc1('0xc4')]({'where':{'id':_0x5a49a2[_0x5dc1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x537f3d,null))[_0x5dc1('0x11')](function(_0x35a80a){if(_0x35a80a){var _0x496a2f=_0x35a80a[_0x5dc1('0x26')]({'plain':!![]});var _0x2ffdf2=_0x5a49a2[_0x5dc1('0x3e')][_0x5dc1('0x5b')];return _0x35a80a['removeTeams'](_0x2ffdf2)[_0x5dc1('0x11')](function(){for(var _0x3bfb6f=0x0;_0x3bfb6f<_0x2ffdf2[_0x5dc1('0x43')];_0x3bfb6f++){var _0x464f85=[];var _0x225f87={};db[_0x5dc1('0x109')][_0x5dc1('0xc4')]({'where':{'id':_0x2ffdf2[_0x3bfb6f]}})[_0x5dc1('0x11')](function(_0x8975d9){_0x225f87=_0x8975d9[_0x5dc1('0x46')];_0x464f85[_0x5dc1('0x44')](_0x8975d9[_0x5dc1('0xec')]()['then'](function(_0xe4d6a6){for(var _0x2f42c4=0x0;_0x2f42c4<_0xe4d6a6[_0x5dc1('0x43')];_0x2f42c4++){_0xe4d6a6[_0x2f42c4][_0x5dc1('0x110')](_0x5dc1('0xa9'),_0x5dc1('0x10c'));}return _0xe4d6a6;}));_0x464f85[_0x5dc1('0x44')](_0x8975d9[_0x5dc1('0x11c')]()[_0x5dc1('0x11')](function(_0x21db45){for(var _0x3157c8=0x0;_0x3157c8<_0x21db45[_0x5dc1('0x43')];_0x3157c8++){_0x21db45[_0x3157c8]['setDataValue'](_0x5dc1('0xa9'),'Chat');}return _0x21db45;}));_0x464f85[_0x5dc1('0x44')](_0x8975d9[_0x5dc1('0x11d')]()['then'](function(_0x5cfbb0){for(var _0x22de04=0x0;_0x22de04<_0x5cfbb0[_0x5dc1('0x43')];_0x22de04++){_0x5cfbb0[_0x22de04][_0x5dc1('0x110')](_0x5dc1('0xa9'),_0x5dc1('0x10e'));}return _0x5cfbb0;}));_0x464f85[_0x5dc1('0x44')](_0x8975d9[_0x5dc1('0x10f')]()['then'](function(_0x416ce4){for(var _0x1ac44a=0x0;_0x1ac44a<_0x416ce4[_0x5dc1('0x43')];_0x1ac44a++){_0x416ce4[_0x1ac44a]['setDataValue'](_0x5dc1('0xa9'),_0x5dc1('0x111'));}return _0x416ce4;}));_0x464f85[_0x5dc1('0x44')](_0x8975d9['getWhatsappQueues']()['then'](function(_0x191ece){for(var _0x39ea05=0x0;_0x39ea05<_0x191ece[_0x5dc1('0x43')];_0x39ea05++){_0x191ece[_0x39ea05][_0x5dc1('0x110')](_0x5dc1('0xa9'),_0x5dc1('0x112'));}return _0x191ece;}));_0x464f85['push'](_0x8975d9[_0x5dc1('0x113')]()[_0x5dc1('0x11')](function(_0x2c1dea){for(var _0xb7164b=0x0;_0xb7164b<_0x2c1dea[_0x5dc1('0x43')];_0xb7164b++){_0x2c1dea[_0xb7164b][_0x5dc1('0x110')](_0x5dc1('0xa9'),'Fax');}return _0x2c1dea;}));_0x464f85['push'](_0x8975d9[_0x5dc1('0x115')]()[_0x5dc1('0x11')](function(_0x32928a){for(var _0x31484b=0x0;_0x31484b<_0x32928a[_0x5dc1('0x43')];_0x31484b++){_0x32928a[_0x31484b][_0x5dc1('0x110')](_0x5dc1('0xa9'),'Openchannel');}return _0x32928a;}));return BPromise['all'](_0x464f85);})['then'](function(_0x220e75){var _0x4b582a=_[_0x5dc1('0x116')](_0x220e75);_0x464f85=[];return db[_0x5dc1('0x63')][_0x5dc1('0x11e')](function(_0x3acd60){for(var _0x3e0270=0x0;_0x3e0270<_0x4b582a['length'];_0x3e0270++){_0x464f85[_0x5dc1('0x44')](_0x4b582a[_0x3e0270][_0x5dc1('0x11f')](_0x496a2f['id']),{'transaction':_0x3acd60});}return BPromise['all'](_0x464f85)[_0x5dc1('0x11')](function(){if(_0x496a2f['online']){return BPromise[_0x5dc1('0x85')](_[_0x5dc1('0x2d')](_0x4b582a,function(_0x6d897a){return _0x6d897a[_0x5dc1('0x118')]('channel')==='Voice';}),function(_0x2aeb67){return db[_0x5dc1('0xad')]['destroy']({'where':{'VoiceQueueId':_0x2aeb67['id'],'UserId':_0x496a2f['id']},'transaction':_0x3acd60});});}else{return;}})[_0x5dc1('0x11')](function(){db[_0x5dc1('0x119')][_0x5dc1('0xc4')]({'where':{'teamId':_0x225f87['id']}})[_0x5dc1('0x11')](function(_0x5aff09){if(_0x5aff09){return db[_0x5dc1('0x120')]['destroy']({'where':{'UserId':_0x496a2f['id'],'VoicePrefixId':_0x5aff09['dataValues']['VoicePrefixId']}});}});})[_0x5dc1('0x11')](function(){for(var _0xa5f00=0x0;_0xa5f00<_0x4b582a[_0x5dc1('0x43')];_0xa5f00++){var _0x242eb4=_0x4b582a[_0xa5f00]['getDataValue'](_0x5dc1('0xa9'));var _0x179507=_0x242eb4+_0x5dc1('0xa2');socket[_0x5dc1('0xa3')]('user'+_0x242eb4+_0x5dc1('0xac'),{'UserId':_0x496a2f['id'],['queueField']:_0x4b582a[_0xa5f00]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x537f3d,null))[_0x5dc1('0x1a')](handleError(_0x537f3d,null));};exports['getLists']=function(_0x15d814,_0x2c2348){var _0x30b00b={};var _0x17420c={};var _0x4bfe57;var _0x569188;return db[_0x5dc1('0x37')][_0x5dc1('0xc4')]({'where':{'id':_0x15d814[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x2c2348,null))[_0x5dc1('0x11')](function(_0x888f3f){if(_0x888f3f){_0x4bfe57=_0x888f3f;_0x17420c[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db[_0x5dc1('0xcb')][_0x5dc1('0x38')]);_0x17420c[_0x5dc1('0x3e')]=_['keys'](_0x15d814[_0x5dc1('0x3e')]);_0x17420c['filters']=_['intersection'](_0x17420c[_0x5dc1('0x4e')],_0x17420c[_0x5dc1('0x3e')]);_0x30b00b[_0x5dc1('0x41')]=_['intersection'](_0x17420c['model'],qs['fields'](_0x15d814['query'][_0x5dc1('0x52')]));_0x30b00b[_0x5dc1('0x41')]=_0x30b00b[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0x30b00b['attributes']:_0x17420c[_0x5dc1('0x4e')];_0x30b00b[_0x5dc1('0xd1')]=qs['sort'](_0x15d814[_0x5dc1('0x3e')][_0x5dc1('0xc7')]);_0x30b00b[_0x5dc1('0x3d')]=qs['filters'](_['pick'](_0x15d814[_0x5dc1('0x3e')],_0x17420c['filters']));if(_0x15d814[_0x5dc1('0x3e')][_0x5dc1('0x2d')]){_0x30b00b[_0x5dc1('0x3d')]=_[_0x5dc1('0x53')](_0x30b00b[_0x5dc1('0x3d')],{'$or':_['map'](_0x30b00b[_0x5dc1('0x41')],function(_0x1b1e64){var _0x232676={};_0x232676[_0x1b1e64]={'$like':'%'+_0x15d814[_0x5dc1('0x3e')]['filter']+'%'};return _0x232676;})});}_0x30b00b=_[_0x5dc1('0x53')]({},_0x30b00b,_0x15d814[_0x5dc1('0xc9')]);return _0x4bfe57[_0x5dc1('0x121')](_0x30b00b);}})[_0x5dc1('0x11')](function(_0x3abc83){if(_0x3abc83){_0x569188=_0x3abc83['length'];if(!_0x15d814[_0x5dc1('0x3e')]['hasOwnProperty'](_0x5dc1('0xce'))){_0x30b00b[_0x5dc1('0x20')]=qs['limit'](_0x15d814['query'][_0x5dc1('0x20')]);_0x30b00b[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x15d814['query'][_0x5dc1('0x1f')]);}return _0x4bfe57['getLists'](_0x30b00b);}})[_0x5dc1('0x11')](function(_0x2604fd){if(_0x2604fd){return _0x2604fd?{'count':_0x569188,'rows':_0x2604fd}:null;}})[_0x5dc1('0x11')](respondWithResult(_0x2c2348,null))[_0x5dc1('0x1a')](handleError(_0x2c2348,null));};exports[_0x5dc1('0x122')]=function(_0x232a53,_0x1e538c){var _0x1139eb={};var _0x31e146={};var _0x3e00bb;var _0x2d416c;return db['User'][_0x5dc1('0xc4')]({'where':{'id':_0x232a53[_0x5dc1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1e538c,null))[_0x5dc1('0x11')](function(_0x132f03){if(_0x132f03){_0x3e00bb=_0x132f03;_0x31e146['model']=_[_0x5dc1('0x50')](db['User'][_0x5dc1('0x38')]);_0x31e146['query']=_['keys'](_0x232a53[_0x5dc1('0x3e')]);_0x31e146[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x31e146[_0x5dc1('0x4e')],_0x31e146[_0x5dc1('0x3e')]);_0x1139eb[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x31e146[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x232a53[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x1139eb[_0x5dc1('0x41')]=_0x1139eb[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0x1139eb[_0x5dc1('0x41')]:_0x31e146[_0x5dc1('0x4e')];_0x1139eb[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x232a53[_0x5dc1('0x3e')]['sort']);_0x1139eb['where']=qs[_0x5dc1('0xc6')](_[_0x5dc1('0xc8')](_0x232a53['query'],_0x31e146[_0x5dc1('0xc6')]));if(_0x232a53[_0x5dc1('0x3e')][_0x5dc1('0x2d')]){_0x1139eb[_0x5dc1('0x3d')]=_[_0x5dc1('0x53')](_0x1139eb[_0x5dc1('0x3d')],{'$or':_['map'](_0x1139eb[_0x5dc1('0x41')],function(_0x2062ab){var _0x1d8e36={};_0x1d8e36[_0x2062ab]={'$like':'%'+_0x232a53[_0x5dc1('0x3e')]['filter']+'%'};return _0x1d8e36;})});}_0x1139eb[_0x5dc1('0x4e')]=db[_0x5dc1('0x37')];_0x1139eb['as']='Agents';_0x1139eb=_[_0x5dc1('0x53')]({},_0x1139eb,_0x232a53['options']);return _0x3e00bb[_0x5dc1('0xec')]({'include':[_0x1139eb]});}})[_0x5dc1('0x11')](function(_0x418981){if(_0x418981){var _0x4eda3f={},_0x66387e=[],_0x3aa3a7=0x0;for(var _0x5f51bc=0x0;_0x5f51bc<_0x418981['length'];_0x5f51bc+=0x1){for(var _0xf2b3e5=0x0,_0x10c744;_0xf2b3e5<_0x418981[_0x5f51bc][_0x5dc1('0x80')][_0x5dc1('0x43')];_0xf2b3e5+=0x1){_0x10c744=_0x418981[_0x5f51bc][_0x5dc1('0x80')][_0xf2b3e5][_0x5dc1('0x26')]({'plain':!![]});_0x4eda3f[_0x10c744['id']]=_0x10c744;}}_0x4eda3f=_['values'](_0x4eda3f);for(var _0x11bdac=qs[_0x5dc1('0x1f')](_0x232a53['query']['offset']);_0x11bdac<_0x4eda3f[_0x5dc1('0x43')]&&_0x66387e[_0x5dc1('0x43')]<qs[_0x5dc1('0x20')](_0x232a53[_0x5dc1('0x3e')][_0x5dc1('0x20')]);_0x11bdac+=0x1){if(_0x4eda3f[_0x11bdac]){_0x66387e['push'](_0x4eda3f[_0x11bdac]);}}return{'count':_0x4eda3f[_0x5dc1('0x43')],'rows':_0x66387e};}})['then'](respondWithResult(_0x1e538c,null))[_0x5dc1('0x1a')](handleError(_0x1e538c,null));};exports[_0x5dc1('0x33')]=function(_0x15b509,_0x64e337){if(_0x15b509[_0x5dc1('0x79')]['id']==_0x15b509[_0x5dc1('0x4d')]['id']){return _0x64e337[_0x5dc1('0x1c')](0x1f4)[_0x5dc1('0x35')]({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db[_0x5dc1('0x37')]['find']({'where':{'id':_0x15b509[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x64e337,null))[_0x5dc1('0x11')](removeEntity(_0x64e337,null))['catch'](handleError(_0x64e337,null));};exports[_0x5dc1('0x123')]=function(_0x1ba280,_0x11c177){return db[_0x5dc1('0x37')]['find']({'where':{'id':_0x1ba280[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x11c177,null))['then'](function(_0x37bd1e){if(_0x37bd1e){return _0x37bd1e[_0x5dc1('0x123')](_0x1ba280[_0x5dc1('0x58')][_0x5dc1('0x5b')],_[_0x5dc1('0x10b')](_0x1ba280[_0x5dc1('0x58')],[_0x5dc1('0x5b'),'id'])||{})['spread'](function(){for(var _0x2bcce7=0x0;_0x2bcce7<_0x1ba280['body']['ids']['length'];_0x2bcce7+=0x1){socket['emit'](_0x5dc1('0x124'),{'ChatInteractionId':Number(_0x1ba280['body'][_0x5dc1('0x5b')][_0x2bcce7]),'UserId':Number(_0x1ba280[_0x5dc1('0x4d')]['id'])});}return _0x1ba280['body'][_0x5dc1('0x5b')];});}})['then'](respondWithResult(_0x11c177,null))[_0x5dc1('0x1a')](handleError(_0x11c177,null));};exports['removeChatInteractions']=function(_0x140c4d,_0x279831){return db['User'][_0x5dc1('0x54')]({'where':{'id':_0x140c4d[_0x5dc1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x279831,null))['then'](function(_0xf1fb22){if(_0xf1fb22){return _0xf1fb22[_0x5dc1('0x125')](_0x140c4d[_0x5dc1('0x3e')][_0x5dc1('0x5b')])['then'](function(){if(_[_0x5dc1('0xab')](_0x140c4d['query'][_0x5dc1('0x5b')])){for(var _0x131492=0x0;_0x131492<_0x140c4d[_0x5dc1('0x3e')]['ids'][_0x5dc1('0x43')];_0x131492+=0x1){socket[_0x5dc1('0xa3')](_0x5dc1('0x126'),{'ChatInteractionId':Number(_0x140c4d[_0x5dc1('0x3e')][_0x5dc1('0x5b')][_0x131492]),'UserId':Number(_0x140c4d[_0x5dc1('0x4d')]['id'])});}}else{socket['emit'](_0x5dc1('0x126'),{'ChatInteractionId':Number(_0x140c4d[_0x5dc1('0x3e')][_0x5dc1('0x5b')]),'UserId':Number(_0x140c4d['params']['id'])});}});}})['then'](respondWithStatusCode(_0x279831,null))['catch'](handleError(_0x279831,null));};exports[_0x5dc1('0x127')]=function(_0x5b5400,_0x4040cb){return db[_0x5dc1('0x37')]['find']({'where':{'id':_0x5b5400[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x4040cb,null))[_0x5dc1('0x11')](function(_0x5b81d5){if(_0x5b81d5){return _0x5b81d5[_0x5dc1('0x127')](_0x5b5400[_0x5dc1('0x58')]['ids'],_['omit'](_0x5b5400[_0x5dc1('0x58')],[_0x5dc1('0x5b'),'id'])||{})[_0x5dc1('0xa0')](function(){for(var _0x251b3d=0x0;_0x251b3d<_0x5b5400['body'][_0x5dc1('0x5b')][_0x5dc1('0x43')];_0x251b3d+=0x1){socket[_0x5dc1('0xa3')](_0x5dc1('0x128'),{'MailInteractionId':Number(_0x5b5400[_0x5dc1('0x58')][_0x5dc1('0x5b')][_0x251b3d]),'UserId':Number(_0x5b5400[_0x5dc1('0x4d')]['id'])});}return _0x5b5400[_0x5dc1('0x58')][_0x5dc1('0x5b')];});}})[_0x5dc1('0x11')](respondWithResult(_0x4040cb,null))[_0x5dc1('0x1a')](handleError(_0x4040cb,null));};exports[_0x5dc1('0x129')]=function(_0x4f4f5a,_0xc44c01){return db[_0x5dc1('0x37')]['find']({'where':{'id':_0x4f4f5a[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0xc44c01,null))[_0x5dc1('0x11')](function(_0x140d57){if(_0x140d57){return _0x140d57[_0x5dc1('0x129')](_0x4f4f5a[_0x5dc1('0x3e')][_0x5dc1('0x5b')])[_0x5dc1('0x11')](function(){if(_[_0x5dc1('0xab')](_0x4f4f5a[_0x5dc1('0x3e')]['ids'])){for(var _0x289910=0x0;_0x289910<_0x4f4f5a[_0x5dc1('0x3e')][_0x5dc1('0x5b')][_0x5dc1('0x43')];_0x289910+=0x1){socket['emit'](_0x5dc1('0x12a'),{'MailInteractionId':Number(_0x4f4f5a[_0x5dc1('0x3e')][_0x5dc1('0x5b')][_0x289910]),'UserId':Number(_0x4f4f5a[_0x5dc1('0x4d')]['id'])});}}else{socket[_0x5dc1('0xa3')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x4f4f5a[_0x5dc1('0x3e')][_0x5dc1('0x5b')]),'UserId':Number(_0x4f4f5a[_0x5dc1('0x4d')]['id'])});}});}})[_0x5dc1('0x11')](respondWithStatusCode(_0xc44c01,null))[_0x5dc1('0x1a')](handleError(_0xc44c01,null));};exports[_0x5dc1('0x12b')]=function(_0x2e8047,_0x12f5b7){return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x2e8047['params']['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x12f5b7,null))['then'](function(_0x42493d){if(_0x42493d){return _0x42493d[_0x5dc1('0x12b')](_0x2e8047['body'][_0x5dc1('0x5b')],_[_0x5dc1('0x10b')](_0x2e8047[_0x5dc1('0x58')],[_0x5dc1('0x5b'),'id'])||{})['spread'](function(){for(var _0x1626dc=0x0;_0x1626dc<_0x2e8047['body'][_0x5dc1('0x5b')][_0x5dc1('0x43')];_0x1626dc+=0x1){socket[_0x5dc1('0xa3')](_0x5dc1('0x12c'),{'FaxInteractionId':Number(_0x2e8047[_0x5dc1('0x58')][_0x5dc1('0x5b')][_0x1626dc]),'UserId':Number(_0x2e8047[_0x5dc1('0x4d')]['id'])});}return _0x2e8047[_0x5dc1('0x58')][_0x5dc1('0x5b')];});}})[_0x5dc1('0x11')](respondWithResult(_0x12f5b7,null))[_0x5dc1('0x1a')](handleError(_0x12f5b7,null));};exports[_0x5dc1('0x12d')]=function(_0x22fbfb,_0x4f5acb){return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x22fbfb[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x4f5acb,null))[_0x5dc1('0x11')](function(_0x4b8304){if(_0x4b8304){return _0x4b8304[_0x5dc1('0x12d')](_0x22fbfb[_0x5dc1('0x3e')]['ids'])[_0x5dc1('0x11')](function(){if(_['isArray'](_0x22fbfb[_0x5dc1('0x3e')][_0x5dc1('0x5b')])){for(var _0xd76579=0x0;_0xd76579<_0x22fbfb['query'][_0x5dc1('0x5b')][_0x5dc1('0x43')];_0xd76579+=0x1){socket[_0x5dc1('0xa3')](_0x5dc1('0x12e'),{'FaxInteractionId':Number(_0x22fbfb[_0x5dc1('0x3e')][_0x5dc1('0x5b')][_0xd76579]),'UserId':Number(_0x22fbfb[_0x5dc1('0x4d')]['id'])});}}else{socket[_0x5dc1('0xa3')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x22fbfb[_0x5dc1('0x3e')][_0x5dc1('0x5b')]),'UserId':Number(_0x22fbfb[_0x5dc1('0x4d')]['id'])});}});}})[_0x5dc1('0x11')](respondWithStatusCode(_0x4f5acb,null))[_0x5dc1('0x1a')](handleError(_0x4f5acb,null));};exports[_0x5dc1('0x12f')]=function(_0x30065b,_0x426c8b){return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x30065b['params']['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x426c8b,null))['then'](function(_0x243f63){if(_0x243f63){return _0x243f63[_0x5dc1('0x12f')](_0x30065b['body']['ids'],_[_0x5dc1('0x10b')](_0x30065b[_0x5dc1('0x58')],[_0x5dc1('0x5b'),'id'])||{})['spread'](function(){for(var _0x4e3389=0x0;_0x4e3389<_0x30065b['body'][_0x5dc1('0x5b')]['length'];_0x4e3389+=0x1){socket[_0x5dc1('0xa3')](_0x5dc1('0x130'),{'SmsInteractionId':Number(_0x30065b[_0x5dc1('0x58')][_0x5dc1('0x5b')][_0x4e3389]),'UserId':Number(_0x30065b[_0x5dc1('0x4d')]['id'])});}return _0x30065b[_0x5dc1('0x58')][_0x5dc1('0x5b')];});}})[_0x5dc1('0x11')](respondWithResult(_0x426c8b,null))[_0x5dc1('0x1a')](handleError(_0x426c8b,null));};exports['removeSmsInteractions']=function(_0x1d65ed,_0x169410){return db['User'][_0x5dc1('0x54')]({'where':{'id':_0x1d65ed[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x169410,null))[_0x5dc1('0x11')](function(_0x128e75){if(_0x128e75){return _0x128e75[_0x5dc1('0x131')](_0x1d65ed[_0x5dc1('0x3e')]['ids'])['then'](function(){if(_[_0x5dc1('0xab')](_0x1d65ed[_0x5dc1('0x3e')][_0x5dc1('0x5b')])){for(var _0x14fc62=0x0;_0x14fc62<_0x1d65ed[_0x5dc1('0x3e')][_0x5dc1('0x5b')][_0x5dc1('0x43')];_0x14fc62+=0x1){socket[_0x5dc1('0xa3')](_0x5dc1('0x132'),{'SmsInteractionId':Number(_0x1d65ed['query'][_0x5dc1('0x5b')][_0x14fc62]),'UserId':Number(_0x1d65ed['params']['id'])});}}else{socket[_0x5dc1('0xa3')](_0x5dc1('0x132'),{'SmsInteractionId':Number(_0x1d65ed[_0x5dc1('0x3e')][_0x5dc1('0x5b')]),'UserId':Number(_0x1d65ed[_0x5dc1('0x4d')]['id'])});}});}})[_0x5dc1('0x11')](respondWithStatusCode(_0x169410,null))[_0x5dc1('0x1a')](handleError(_0x169410,null));};exports['addOpenchannelInteractions']=function(_0x7191d4,_0x2e7e3e){return db['User'][_0x5dc1('0x54')]({'where':{'id':_0x7191d4[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x2e7e3e,null))[_0x5dc1('0x11')](function(_0xfb2f22){if(_0xfb2f22){return _0xfb2f22['addOpenchannelInteractions'](_0x7191d4['body'][_0x5dc1('0x5b')],_['omit'](_0x7191d4[_0x5dc1('0x58')],[_0x5dc1('0x5b'),'id'])||{})[_0x5dc1('0xa0')](function(){for(var _0x1d42d2=0x0;_0x1d42d2<_0x7191d4[_0x5dc1('0x58')][_0x5dc1('0x5b')]['length'];_0x1d42d2+=0x1){socket[_0x5dc1('0xa3')]('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x7191d4[_0x5dc1('0x58')][_0x5dc1('0x5b')][_0x1d42d2]),'UserId':Number(_0x7191d4[_0x5dc1('0x4d')]['id'])});}return _0x7191d4[_0x5dc1('0x58')][_0x5dc1('0x5b')];});}})[_0x5dc1('0x11')](respondWithResult(_0x2e7e3e,null))[_0x5dc1('0x1a')](handleError(_0x2e7e3e,null));};exports['removeOpenchannelInteractions']=function(_0x2615b3,_0x2e1b53){return db[_0x5dc1('0x37')]['find']({'where':{'id':_0x2615b3['params']['id']}})['then'](handleEntityNotFound(_0x2e1b53,null))[_0x5dc1('0x11')](function(_0x36c4c6){if(_0x36c4c6){return _0x36c4c6[_0x5dc1('0x133')](_0x2615b3[_0x5dc1('0x3e')]['ids'])['then'](function(){if(_[_0x5dc1('0xab')](_0x2615b3[_0x5dc1('0x3e')][_0x5dc1('0x5b')])){for(var _0x3da120=0x0;_0x3da120<_0x2615b3[_0x5dc1('0x3e')][_0x5dc1('0x5b')][_0x5dc1('0x43')];_0x3da120+=0x1){socket['emit'](_0x5dc1('0x134'),{'OpenchannelInteractionId':Number(_0x2615b3['query'][_0x5dc1('0x5b')][_0x3da120]),'UserId':Number(_0x2615b3[_0x5dc1('0x4d')]['id'])});}}else{socket[_0x5dc1('0xa3')](_0x5dc1('0x134'),{'OpenchannelInteractionId':Number(_0x2615b3[_0x5dc1('0x3e')][_0x5dc1('0x5b')]),'UserId':Number(_0x2615b3[_0x5dc1('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x2e1b53,null))['catch'](handleError(_0x2e1b53,null));};exports[_0x5dc1('0x135')]=function(_0x280233,_0x58dc50){return db['User'][_0x5dc1('0x54')]({'where':{'id':_0x280233[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x58dc50,null))[_0x5dc1('0x11')](function(_0x172de5){if(_0x172de5){return _0x172de5[_0x5dc1('0x135')](_0x280233[_0x5dc1('0x58')][_0x5dc1('0x5b')],_[_0x5dc1('0x10b')](_0x280233[_0x5dc1('0x58')],[_0x5dc1('0x5b'),'id'])||{})[_0x5dc1('0xa0')](function(){for(var _0x508b2c=0x0;_0x508b2c<_0x280233[_0x5dc1('0x58')][_0x5dc1('0x5b')][_0x5dc1('0x43')];_0x508b2c+=0x1){socket['emit'](_0x5dc1('0x136'),{'WhatsappInteractionId':Number(_0x280233[_0x5dc1('0x58')][_0x5dc1('0x5b')][_0x508b2c]),'UserId':Number(_0x280233['params']['id'])});}return _0x280233[_0x5dc1('0x58')][_0x5dc1('0x5b')];});}})[_0x5dc1('0x11')](respondWithResult(_0x58dc50,null))[_0x5dc1('0x1a')](handleError(_0x58dc50,null));};exports['removeWhatsappInteractions']=function(_0x196752,_0x9f612d){return db['User']['find']({'where':{'id':_0x196752[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x9f612d,null))[_0x5dc1('0x11')](function(_0x595fc3){if(_0x595fc3){return _0x595fc3['removeWhatsappInteractions'](_0x196752[_0x5dc1('0x3e')][_0x5dc1('0x5b')]);}})[_0x5dc1('0x11')](respondWithStatusCode(_0x9f612d,null))[_0x5dc1('0x1a')](handleError(_0x9f612d,null));};exports[_0x5dc1('0x137')]=function(_0x2da2b0,_0x17bb31){var _0x91bb60={};var _0x1e456d={};var _0x104356;var _0x47b3ae;return db[_0x5dc1('0x37')][_0x5dc1('0xc4')]({'where':{'id':_0x2da2b0[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x17bb31,null))[_0x5dc1('0x11')](function(_0xc6585a){if(_0xc6585a){_0x104356=_0xc6585a;_0x1e456d[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db['VoicePrefix'][_0x5dc1('0x38')]);_0x1e456d[_0x5dc1('0x3e')]=_['keys'](_0x2da2b0[_0x5dc1('0x3e')]);_0x1e456d[_0x5dc1('0xc6')]=_['intersection'](_0x1e456d[_0x5dc1('0x4e')],_0x1e456d['query']);_0x91bb60[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x1e456d[_0x5dc1('0x4e')],qs['fields'](_0x2da2b0[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x91bb60[_0x5dc1('0x41')]=_0x91bb60[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0x91bb60[_0x5dc1('0x41')]:_0x1e456d[_0x5dc1('0x4e')];_0x91bb60[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x2da2b0['query'][_0x5dc1('0xc7')]);_0x91bb60['where']=qs[_0x5dc1('0xc6')](_['pick'](_0x2da2b0['query'],_0x1e456d[_0x5dc1('0xc6')]));if(_0x2da2b0[_0x5dc1('0x3e')][_0x5dc1('0x2d')]){_0x91bb60[_0x5dc1('0x3d')]=_[_0x5dc1('0x53')](_0x91bb60['where'],{'$or':_['map'](_0x91bb60[_0x5dc1('0x41')],function(_0x4a8636){var _0xcf7599={};_0xcf7599[_0x4a8636]={'$like':'%'+_0x2da2b0[_0x5dc1('0x3e')][_0x5dc1('0x2d')]+'%'};return _0xcf7599;})});}_0x91bb60=_['merge']({},_0x91bb60,_0x2da2b0[_0x5dc1('0xc9')]);return _0x104356[_0x5dc1('0x137')](_0x91bb60);}})[_0x5dc1('0x11')](function(_0xb4ed15){if(_0xb4ed15){_0x47b3ae=_0xb4ed15[_0x5dc1('0x43')];if(!_0x2da2b0['query']['hasOwnProperty']('nolimit')){_0x91bb60[_0x5dc1('0x20')]=qs[_0x5dc1('0x20')](_0x2da2b0[_0x5dc1('0x3e')][_0x5dc1('0x20')]);_0x91bb60[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x2da2b0[_0x5dc1('0x3e')]['offset']);}return _0x104356['getVoicePrefixes'](_0x91bb60);}})['then'](function(_0x7af90f){if(_0x7af90f){return _0x7af90f?{'count':_0x47b3ae,'rows':_0x7af90f}:null;}})[_0x5dc1('0x11')](respondWithResult(_0x17bb31,null))['catch'](handleError(_0x17bb31,null));};exports['getFaxAccounts']=function(_0x30e506,_0x516b96){var _0x2f4732={};var _0x7b6875={};var _0x4e3a72;var _0x5a0134;return db['User']['findOne']({'where':{'id':_0x30e506['params']['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x516b96,null))[_0x5dc1('0x11')](function(_0x1fdfa5){if(_0x1fdfa5){_0x4e3a72=_0x1fdfa5;_0x7b6875[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db[_0x5dc1('0x138')][_0x5dc1('0x38')]);_0x7b6875[_0x5dc1('0x3e')]=_['keys'](_0x30e506[_0x5dc1('0x3e')]);_0x7b6875[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x7b6875[_0x5dc1('0x4e')],_0x7b6875['query']);_0x2f4732[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x7b6875[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x30e506[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x2f4732[_0x5dc1('0x41')]=_0x2f4732['attributes'][_0x5dc1('0x43')]?_0x2f4732[_0x5dc1('0x41')]:_0x7b6875[_0x5dc1('0x4e')];_0x2f4732[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x30e506[_0x5dc1('0x3e')][_0x5dc1('0xc7')]);_0x2f4732[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_[_0x5dc1('0xc8')](_0x30e506[_0x5dc1('0x3e')],_0x7b6875[_0x5dc1('0xc6')]));if(_0x30e506['query'][_0x5dc1('0x2d')]){_0x2f4732['where']=_[_0x5dc1('0x53')](_0x2f4732['where'],{'$or':_[_0x5dc1('0x2e')](_0x2f4732[_0x5dc1('0x41')],function(_0x500a0f){var _0x46a488={};_0x46a488[_0x500a0f]={'$like':'%'+_0x30e506['query'][_0x5dc1('0x2d')]+'%'};return _0x46a488;})});}_0x2f4732=_['merge']({},_0x2f4732,_0x30e506[_0x5dc1('0xc9')]);return _0x4e3a72[_0x5dc1('0x139')](_0x2f4732);}})['then'](function(_0xf30500){if(_0xf30500){_0x5a0134=_0xf30500[_0x5dc1('0x43')];if(!_0x30e506[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x2f4732[_0x5dc1('0x20')]=qs['limit'](_0x30e506[_0x5dc1('0x3e')][_0x5dc1('0x20')]);_0x2f4732[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x30e506[_0x5dc1('0x3e')][_0x5dc1('0x1f')]);}return _0x4e3a72[_0x5dc1('0x139')](_0x2f4732);}})['then'](function(_0x53f0d3){if(_0x53f0d3){return _0x53f0d3?{'count':_0x5a0134,'rows':_0x53f0d3}:null;}})['then'](respondWithResult(_0x516b96,null))[_0x5dc1('0x1a')](handleError(_0x516b96,null));};exports[_0x5dc1('0x13a')]=function(_0xec2991,_0x26c1d8){return db[_0x5dc1('0x37')]['find']({'where':{'id':_0xec2991[_0x5dc1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x26c1d8,null))[_0x5dc1('0x11')](function(_0x2647a1){if(_0x2647a1){return _0x2647a1[_0x5dc1('0x13a')](_0xec2991['body'][_0x5dc1('0x5b')],_[_0x5dc1('0x10b')](_0xec2991[_0x5dc1('0x58')],[_0x5dc1('0x5b'),'id'])||{});}})[_0x5dc1('0x11')](respondWithResult(_0x26c1d8,null))[_0x5dc1('0x1a')](handleError(_0x26c1d8,null));};exports[_0x5dc1('0x13b')]=function(_0x4e7e1c,_0x326dce){return db[_0x5dc1('0x37')]['find']({'where':{'id':_0x4e7e1c[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x326dce,null))[_0x5dc1('0x11')](function(_0x11971c){if(_0x11971c){return _0x11971c[_0x5dc1('0x13b')](_0x4e7e1c['query'][_0x5dc1('0x5b')]);}})[_0x5dc1('0x11')](respondWithStatusCode(_0x326dce,null))[_0x5dc1('0x1a')](handleError(_0x326dce,null));};exports[_0x5dc1('0x13c')]=function(_0x30594c,_0x5eab10){var _0x4296ae={};var _0x3f4f01={};var _0x582a2d;var _0xceff8c;return db[_0x5dc1('0x37')][_0x5dc1('0xc4')]({'where':{'id':_0x30594c[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x5eab10,null))[_0x5dc1('0x11')](function(_0x330552){if(_0x330552){_0x582a2d=_0x330552;_0x3f4f01['model']=_['keys'](db[_0x5dc1('0x13d')][_0x5dc1('0x38')]);_0x3f4f01['query']=_[_0x5dc1('0x50')](_0x30594c['query']);_0x3f4f01[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x3f4f01[_0x5dc1('0x4e')],_0x3f4f01[_0x5dc1('0x3e')]);_0x4296ae[_0x5dc1('0x41')]=_['intersection'](_0x3f4f01[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x30594c[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x4296ae['attributes']=_0x4296ae[_0x5dc1('0x41')][_0x5dc1('0x43')]?_0x4296ae[_0x5dc1('0x41')]:_0x3f4f01['model'];_0x4296ae[_0x5dc1('0xd1')]=qs['sort'](_0x30594c[_0x5dc1('0x3e')][_0x5dc1('0xc7')]);_0x4296ae[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_['pick'](_0x30594c[_0x5dc1('0x3e')],_0x3f4f01['filters']));if(_0x30594c[_0x5dc1('0x3e')][_0x5dc1('0x2d')]){_0x4296ae[_0x5dc1('0x3d')]=_[_0x5dc1('0x53')](_0x4296ae[_0x5dc1('0x3d')],{'$or':_['map'](_0x4296ae[_0x5dc1('0x41')],function(_0x1a7612){var _0x5b758f={};_0x5b758f[_0x1a7612]={'$like':'%'+_0x30594c['query']['filter']+'%'};return _0x5b758f;})});}_0x4296ae=_[_0x5dc1('0x53')]({},_0x4296ae,_0x30594c[_0x5dc1('0xc9')]);return _0x582a2d[_0x5dc1('0x13c')](_0x4296ae);}})[_0x5dc1('0x11')](function(_0x396695){if(_0x396695){_0xceff8c=_0x396695[_0x5dc1('0x43')];if(!_0x30594c[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x4296ae['limit']=qs[_0x5dc1('0x20')](_0x30594c[_0x5dc1('0x3e')]['limit']);_0x4296ae[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x30594c[_0x5dc1('0x3e')][_0x5dc1('0x1f')]);}return _0x582a2d[_0x5dc1('0x13c')](_0x4296ae);}})[_0x5dc1('0x11')](function(_0x44e009){if(_0x44e009){return _0x44e009?{'count':_0xceff8c,'rows':_0x44e009}:null;}})[_0x5dc1('0x11')](respondWithResult(_0x5eab10,null))[_0x5dc1('0x1a')](handleError(_0x5eab10,null));};exports[_0x5dc1('0x13e')]=function(_0x59702b,_0x35f856){return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x59702b['params']['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x35f856,null))[_0x5dc1('0x11')](function(_0x2c2341){if(_0x2c2341){return _0x2c2341['addMailAccounts'](_0x59702b[_0x5dc1('0x58')][_0x5dc1('0x5b')],_['omit'](_0x59702b[_0x5dc1('0x58')],['ids','id'])||{});}})['then'](respondWithResult(_0x35f856,null))[_0x5dc1('0x1a')](handleError(_0x35f856,null));};exports[_0x5dc1('0x13f')]=function(_0x3730f0,_0x4ca76b){return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x3730f0[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x4ca76b,null))[_0x5dc1('0x11')](function(_0x1e241b){if(_0x1e241b){return _0x1e241b[_0x5dc1('0x13f')](_0x3730f0[_0x5dc1('0x3e')][_0x5dc1('0x5b')]);}})['then'](respondWithStatusCode(_0x4ca76b,null))['catch'](handleError(_0x4ca76b,null));};exports[_0x5dc1('0x140')]=function(_0xc22ac,_0x4f61d5){var _0x5d93c4={};var _0x1be604={};var _0xc472d5;var _0x495c6e;return db['User'][_0x5dc1('0xc4')]({'where':{'id':_0xc22ac[_0x5dc1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4f61d5,null))[_0x5dc1('0x11')](function(_0x5b3ec8){if(_0x5b3ec8){_0xc472d5=_0x5b3ec8;_0x1be604['model']=_[_0x5dc1('0x50')](db['OpenchannelAccount'][_0x5dc1('0x38')]);_0x1be604[_0x5dc1('0x3e')]=_[_0x5dc1('0x50')](_0xc22ac['query']);_0x1be604[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x1be604[_0x5dc1('0x4e')],_0x1be604[_0x5dc1('0x3e')]);_0x5d93c4[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x1be604[_0x5dc1('0x4e')],qs['fields'](_0xc22ac[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x5d93c4[_0x5dc1('0x41')]=_0x5d93c4[_0x5dc1('0x41')]['length']?_0x5d93c4[_0x5dc1('0x41')]:_0x1be604[_0x5dc1('0x4e')];_0x5d93c4[_0x5dc1('0xd1')]=qs['sort'](_0xc22ac[_0x5dc1('0x3e')][_0x5dc1('0xc7')]);_0x5d93c4[_0x5dc1('0x3d')]=qs['filters'](_[_0x5dc1('0xc8')](_0xc22ac[_0x5dc1('0x3e')],_0x1be604[_0x5dc1('0xc6')]));if(_0xc22ac[_0x5dc1('0x3e')][_0x5dc1('0x2d')]){_0x5d93c4['where']=_['merge'](_0x5d93c4[_0x5dc1('0x3d')],{'$or':_[_0x5dc1('0x2e')](_0x5d93c4[_0x5dc1('0x41')],function(_0x1dc229){var _0x4acd82={};_0x4acd82[_0x1dc229]={'$like':'%'+_0xc22ac['query'][_0x5dc1('0x2d')]+'%'};return _0x4acd82;})});}_0x5d93c4=_[_0x5dc1('0x53')]({},_0x5d93c4,_0xc22ac[_0x5dc1('0xc9')]);return _0xc472d5['getOpenchannelAccounts'](_0x5d93c4);}})[_0x5dc1('0x11')](function(_0x44530c){if(_0x44530c){_0x495c6e=_0x44530c[_0x5dc1('0x43')];if(!_0xc22ac[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x5d93c4[_0x5dc1('0x20')]=qs[_0x5dc1('0x20')](_0xc22ac['query'][_0x5dc1('0x20')]);_0x5d93c4[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0xc22ac['query'][_0x5dc1('0x1f')]);}return _0xc472d5['getOpenchannelAccounts'](_0x5d93c4);}})['then'](function(_0x4eb16b){if(_0x4eb16b){return _0x4eb16b?{'count':_0x495c6e,'rows':_0x4eb16b}:null;}})[_0x5dc1('0x11')](respondWithResult(_0x4f61d5,null))[_0x5dc1('0x1a')](handleError(_0x4f61d5,null));};exports['addOpenchannelAccounts']=function(_0xee9a94,_0x1564d3){return db[_0x5dc1('0x37')]['find']({'where':{'id':_0xee9a94['params']['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x1564d3,null))['then'](function(_0x391df6){if(_0x391df6){return _0x391df6[_0x5dc1('0x141')](_0xee9a94[_0x5dc1('0x58')][_0x5dc1('0x5b')],_[_0x5dc1('0x10b')](_0xee9a94[_0x5dc1('0x58')],[_0x5dc1('0x5b'),'id'])||{});}})[_0x5dc1('0x11')](respondWithResult(_0x1564d3,null))[_0x5dc1('0x1a')](handleError(_0x1564d3,null));};exports['removeOpenchannelAccounts']=function(_0x1cf80b,_0x5963f3){return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x1cf80b[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x5963f3,null))[_0x5dc1('0x11')](function(_0x2341e5){if(_0x2341e5){return _0x2341e5[_0x5dc1('0x142')](_0x1cf80b['query'][_0x5dc1('0x5b')]);}})[_0x5dc1('0x11')](respondWithStatusCode(_0x5963f3,null))[_0x5dc1('0x1a')](handleError(_0x5963f3,null));};exports[_0x5dc1('0x143')]=function(_0x463044,_0xd2fee8){var _0x28662f={};var _0x520e8d={};var _0xae4bc2;var _0x40c6d6;return db[_0x5dc1('0x37')][_0x5dc1('0xc4')]({'where':{'id':_0x463044['params']['id']}})['then'](handleEntityNotFound(_0xd2fee8,null))['then'](function(_0x84dde){if(_0x84dde){_0xae4bc2=_0x84dde;_0x520e8d[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db[_0x5dc1('0x144')][_0x5dc1('0x38')]);_0x520e8d[_0x5dc1('0x3e')]=_[_0x5dc1('0x50')](_0x463044['query']);_0x520e8d[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x520e8d[_0x5dc1('0x4e')],_0x520e8d['query']);_0x28662f[_0x5dc1('0x41')]=_['intersection'](_0x520e8d['model'],qs[_0x5dc1('0x52')](_0x463044[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x28662f[_0x5dc1('0x41')]=_0x28662f[_0x5dc1('0x41')]['length']?_0x28662f[_0x5dc1('0x41')]:_0x520e8d[_0x5dc1('0x4e')];_0x28662f[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x463044[_0x5dc1('0x3e')]['sort']);_0x28662f[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_[_0x5dc1('0xc8')](_0x463044['query'],_0x520e8d[_0x5dc1('0xc6')]));if(_0x463044[_0x5dc1('0x3e')][_0x5dc1('0x2d')]){_0x28662f[_0x5dc1('0x3d')]=_[_0x5dc1('0x53')](_0x28662f[_0x5dc1('0x3d')],{'$or':_[_0x5dc1('0x2e')](_0x28662f[_0x5dc1('0x41')],function(_0x4f2b26){var _0x56c942={};_0x56c942[_0x4f2b26]={'$like':'%'+_0x463044['query']['filter']+'%'};return _0x56c942;})});}_0x28662f=_[_0x5dc1('0x53')]({},_0x28662f,_0x463044[_0x5dc1('0xc9')]);return _0xae4bc2['getSmsAccounts'](_0x28662f);}})[_0x5dc1('0x11')](function(_0x4ab143){if(_0x4ab143){_0x40c6d6=_0x4ab143[_0x5dc1('0x43')];if(!_0x463044['query'][_0x5dc1('0xca')]('nolimit')){_0x28662f[_0x5dc1('0x20')]=qs[_0x5dc1('0x20')](_0x463044[_0x5dc1('0x3e')][_0x5dc1('0x20')]);_0x28662f[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x463044[_0x5dc1('0x3e')]['offset']);}return _0xae4bc2[_0x5dc1('0x143')](_0x28662f);}})[_0x5dc1('0x11')](function(_0x4a8d49){if(_0x4a8d49){return _0x4a8d49?{'count':_0x40c6d6,'rows':_0x4a8d49}:null;}})[_0x5dc1('0x11')](respondWithResult(_0xd2fee8,null))[_0x5dc1('0x1a')](handleError(_0xd2fee8,null));};exports[_0x5dc1('0x145')]=function(_0x57bd23,_0x4c12e6){return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x57bd23[_0x5dc1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4c12e6,null))['then'](function(_0x4fdf2b){if(_0x4fdf2b){return _0x4fdf2b[_0x5dc1('0x145')](_0x57bd23[_0x5dc1('0x58')][_0x5dc1('0x5b')],_[_0x5dc1('0x10b')](_0x57bd23[_0x5dc1('0x58')],[_0x5dc1('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x4c12e6,null))[_0x5dc1('0x1a')](handleError(_0x4c12e6,null));};exports[_0x5dc1('0x146')]=function(_0x418371,_0x3f223e){return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x418371['params']['id']}})['then'](handleEntityNotFound(_0x3f223e,null))[_0x5dc1('0x11')](function(_0x3008d3){if(_0x3008d3){return _0x3008d3[_0x5dc1('0x146')](_0x418371[_0x5dc1('0x3e')][_0x5dc1('0x5b')]);}})[_0x5dc1('0x11')](respondWithStatusCode(_0x3f223e,null))[_0x5dc1('0x1a')](handleError(_0x3f223e,null));};exports['getChatWebsites']=function(_0x59fb68,_0x32339d){var _0x5378bd={};var _0x5dd92a={};var _0x18d9a2;var _0x1f12f8;return db[_0x5dc1('0x37')]['findOne']({'where':{'id':_0x59fb68[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x32339d,null))[_0x5dc1('0x11')](function(_0x27a6a0){if(_0x27a6a0){_0x18d9a2=_0x27a6a0;_0x5dd92a[_0x5dc1('0x4e')]=_['keys'](db[_0x5dc1('0x147')]['rawAttributes']);_0x5dd92a['query']=_['keys'](_0x59fb68[_0x5dc1('0x3e')]);_0x5dd92a[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x5dd92a[_0x5dc1('0x4e')],_0x5dd92a[_0x5dc1('0x3e')]);_0x5378bd['attributes']=_[_0x5dc1('0x51')](_0x5dd92a['model'],qs['fields'](_0x59fb68[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x5378bd[_0x5dc1('0x41')]=_0x5378bd[_0x5dc1('0x41')]['length']?_0x5378bd['attributes']:_0x5dd92a[_0x5dc1('0x4e')];_0x5378bd[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x59fb68[_0x5dc1('0x3e')][_0x5dc1('0xc7')]);_0x5378bd[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_[_0x5dc1('0xc8')](_0x59fb68[_0x5dc1('0x3e')],_0x5dd92a[_0x5dc1('0xc6')]));if(_0x59fb68['query'][_0x5dc1('0x2d')]){_0x5378bd['where']=_[_0x5dc1('0x53')](_0x5378bd[_0x5dc1('0x3d')],{'$or':_[_0x5dc1('0x2e')](_0x5378bd[_0x5dc1('0x41')],function(_0x6bb535){var _0x5d2a36={};_0x5d2a36[_0x6bb535]={'$like':'%'+_0x59fb68[_0x5dc1('0x3e')][_0x5dc1('0x2d')]+'%'};return _0x5d2a36;})});}_0x5378bd=_['merge']({},_0x5378bd,_0x59fb68[_0x5dc1('0xc9')]);return _0x18d9a2[_0x5dc1('0x148')](_0x5378bd);}})[_0x5dc1('0x11')](function(_0x1d116b){if(_0x1d116b){_0x1f12f8=_0x1d116b['length'];if(!_0x59fb68[_0x5dc1('0x3e')]['hasOwnProperty'](_0x5dc1('0xce'))){_0x5378bd[_0x5dc1('0x20')]=qs[_0x5dc1('0x20')](_0x59fb68[_0x5dc1('0x3e')][_0x5dc1('0x20')]);_0x5378bd[_0x5dc1('0x1f')]=qs['offset'](_0x59fb68[_0x5dc1('0x3e')][_0x5dc1('0x1f')]);}return _0x18d9a2[_0x5dc1('0x148')](_0x5378bd);}})[_0x5dc1('0x11')](function(_0x5ada6b){if(_0x5ada6b){return _0x5ada6b?{'count':_0x1f12f8,'rows':_0x5ada6b}:null;}})[_0x5dc1('0x11')](respondWithResult(_0x32339d,null))[_0x5dc1('0x1a')](handleError(_0x32339d,null));};exports[_0x5dc1('0x149')]=function(_0x418d78,_0x50ab6a){return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x418d78['params']['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x50ab6a,null))[_0x5dc1('0x11')](function(_0x229301){if(_0x229301){return _0x229301[_0x5dc1('0x149')](_0x418d78['body'][_0x5dc1('0x5b')],_[_0x5dc1('0x10b')](_0x418d78[_0x5dc1('0x58')],[_0x5dc1('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x50ab6a,null))[_0x5dc1('0x1a')](handleError(_0x50ab6a,null));};exports['removeChatWebsites']=function(_0x240fb1,_0x236797){return db['User']['find']({'where':{'id':_0x240fb1[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x236797,null))[_0x5dc1('0x11')](function(_0x533219){if(_0x533219){return _0x533219[_0x5dc1('0x14a')](_0x240fb1['query']['ids']);}})['then'](respondWithStatusCode(_0x236797,null))[_0x5dc1('0x1a')](handleError(_0x236797,null));};exports[_0x5dc1('0x14b')]=function(_0x3de831,_0x58dc30){var _0x59e12d={};var _0x37ab41={};var _0x3a621e;var _0x52245b;return db[_0x5dc1('0x37')][_0x5dc1('0xc4')]({'where':{'id':_0x3de831[_0x5dc1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x58dc30,null))[_0x5dc1('0x11')](function(_0x1f7467){if(_0x1f7467){_0x3a621e=_0x1f7467;_0x37ab41[_0x5dc1('0x4e')]=_['keys'](db['WhatsappAccount']['rawAttributes']);_0x37ab41['query']=_[_0x5dc1('0x50')](_0x3de831[_0x5dc1('0x3e')]);_0x37ab41[_0x5dc1('0xc6')]=_[_0x5dc1('0x51')](_0x37ab41[_0x5dc1('0x4e')],_0x37ab41[_0x5dc1('0x3e')]);_0x59e12d[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x37ab41[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x3de831['query']['fields']));_0x59e12d['attributes']=_0x59e12d[_0x5dc1('0x41')]['length']?_0x59e12d['attributes']:_0x37ab41[_0x5dc1('0x4e')];_0x59e12d[_0x5dc1('0xd1')]=qs['sort'](_0x3de831[_0x5dc1('0x3e')][_0x5dc1('0xc7')]);_0x59e12d[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_[_0x5dc1('0xc8')](_0x3de831[_0x5dc1('0x3e')],_0x37ab41[_0x5dc1('0xc6')]));if(_0x3de831['query'][_0x5dc1('0x2d')]){_0x59e12d['where']=_[_0x5dc1('0x53')](_0x59e12d['where'],{'$or':_[_0x5dc1('0x2e')](_0x59e12d[_0x5dc1('0x41')],function(_0x15a5af){var _0x4cc3dc={};_0x4cc3dc[_0x15a5af]={'$like':'%'+_0x3de831[_0x5dc1('0x3e')]['filter']+'%'};return _0x4cc3dc;})});}_0x59e12d=_[_0x5dc1('0x53')]({},_0x59e12d,_0x3de831['options']);return _0x3a621e[_0x5dc1('0x14b')](_0x59e12d);}})[_0x5dc1('0x11')](function(_0x19ef94){if(_0x19ef94){_0x52245b=_0x19ef94[_0x5dc1('0x43')];if(!_0x3de831[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x59e12d[_0x5dc1('0x20')]=qs['limit'](_0x3de831['query'][_0x5dc1('0x20')]);_0x59e12d[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x3de831['query'][_0x5dc1('0x1f')]);}return _0x3a621e['getWhatsappAccounts'](_0x59e12d);}})[_0x5dc1('0x11')](function(_0x2a0958){if(_0x2a0958){return _0x2a0958?{'count':_0x52245b,'rows':_0x2a0958}:null;}})['then'](respondWithResult(_0x58dc30,null))[_0x5dc1('0x1a')](handleError(_0x58dc30,null));};exports['addWhatsappAccounts']=function(_0x38fba3,_0x3c3d8e){return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0x38fba3['params']['id']}})['then'](handleEntityNotFound(_0x3c3d8e,null))[_0x5dc1('0x11')](function(_0x69fd82){if(_0x69fd82){return _0x69fd82['addWhatsappAccounts'](_0x38fba3[_0x5dc1('0x58')][_0x5dc1('0x5b')],_[_0x5dc1('0x10b')](_0x38fba3['body'],[_0x5dc1('0x5b'),'id'])||{});}})[_0x5dc1('0x11')](respondWithResult(_0x3c3d8e,null))[_0x5dc1('0x1a')](handleError(_0x3c3d8e,null));};exports[_0x5dc1('0x14c')]=function(_0x461935,_0x2e3984){return db['User']['find']({'where':{'id':_0x461935[_0x5dc1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2e3984,null))[_0x5dc1('0x11')](function(_0x4d678e){if(_0x4d678e){return _0x4d678e[_0x5dc1('0x14c')](_0x461935[_0x5dc1('0x3e')]['ids']);}})[_0x5dc1('0x11')](respondWithStatusCode(_0x2e3984,null))[_0x5dc1('0x1a')](handleError(_0x2e3984,null));};exports[_0x5dc1('0x14d')]=function(_0x29a61d,_0x12f0fa){var _0x22d003={};var _0x2176cc={};var _0x2d76c2;var _0x332325;return db['User']['findOne']({'where':{'id':_0x29a61d['params']['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x12f0fa,null))[_0x5dc1('0x11')](function(_0x213296){if(_0x213296){_0x2d76c2=_0x213296;_0x2176cc[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](db[_0x5dc1('0x14e')][_0x5dc1('0x38')]);_0x2176cc['query']=_[_0x5dc1('0x50')](_0x29a61d[_0x5dc1('0x3e')]);_0x2176cc['filters']=_['intersection'](_0x2176cc[_0x5dc1('0x4e')],_0x2176cc[_0x5dc1('0x3e')]);_0x22d003[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x2176cc[_0x5dc1('0x4e')],qs['fields'](_0x29a61d[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0x22d003[_0x5dc1('0x41')]=_0x22d003['attributes']['length']?_0x22d003[_0x5dc1('0x41')]:_0x2176cc[_0x5dc1('0x4e')];_0x22d003[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x29a61d['query']['sort']);_0x22d003[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_[_0x5dc1('0xc8')](_0x29a61d[_0x5dc1('0x3e')],_0x2176cc[_0x5dc1('0xc6')]));if(_0x29a61d['query'][_0x5dc1('0x2d')]){_0x22d003['where']=_[_0x5dc1('0x53')](_0x22d003['where'],{'$or':_[_0x5dc1('0x2e')](_0x22d003[_0x5dc1('0x41')],function(_0x52de5f){var _0xb47c9f={};_0xb47c9f[_0x52de5f]={'$like':'%'+_0x29a61d['query'][_0x5dc1('0x2d')]+'%'};return _0xb47c9f;})});}_0x22d003=_[_0x5dc1('0x53')]({},_0x22d003,_0x29a61d['options']);return _0x2d76c2[_0x5dc1('0x14d')](_0x22d003);}})[_0x5dc1('0x11')](function(_0xe54fe){if(_0xe54fe){_0x332325=_0xe54fe[_0x5dc1('0x43')];if(!_0x29a61d[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x22d003[_0x5dc1('0x20')]=qs['limit'](_0x29a61d['query'][_0x5dc1('0x20')]);_0x22d003['offset']=qs[_0x5dc1('0x1f')](_0x29a61d[_0x5dc1('0x3e')][_0x5dc1('0x1f')]);}return _0x2d76c2['getSquareProjects'](_0x22d003);}})[_0x5dc1('0x11')](function(_0x461dff){if(_0x461dff){return _0x461dff?{'count':_0x332325,'rows':_0x461dff}:null;}})[_0x5dc1('0x11')](respondWithResult(_0x12f0fa,null))['catch'](handleError(_0x12f0fa,null));};exports[_0x5dc1('0x14f')]=function(_0xff92a0,_0x19248d){return db[_0x5dc1('0x37')][_0x5dc1('0x54')]({'where':{'id':_0xff92a0[_0x5dc1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x19248d,null))['then'](function(_0x40d751){if(_0x40d751){return _0x40d751[_0x5dc1('0x14f')](_0xff92a0[_0x5dc1('0x58')][_0x5dc1('0x5b')],_[_0x5dc1('0x10b')](_0xff92a0['body'],[_0x5dc1('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x19248d,null))[_0x5dc1('0x1a')](handleError(_0x19248d,null));};exports[_0x5dc1('0x150')]=function(_0x56e68e,_0x2d5dae){return db[_0x5dc1('0x37')]['find']({'where':{'id':_0x56e68e[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x2d5dae,null))[_0x5dc1('0x11')](function(_0x3913d1){if(_0x3913d1){return _0x3913d1[_0x5dc1('0x150')](_0x56e68e['query'][_0x5dc1('0x5b')]);}})[_0x5dc1('0x11')](respondWithStatusCode(_0x2d5dae,null))[_0x5dc1('0x1a')](handleError(_0x2d5dae,null));};exports[_0x5dc1('0x151')]=function(_0x325ed4,_0x10a7ba){var _0xcd6509={},_0x4a7d4c={},_0x4a9ff5={'count':0x0,'rows':[]};var _0x30405e=db[_0x5dc1('0x152')]['rawAttributes'];_0x4a7d4c[_0x5dc1('0x4e')]=_[_0x5dc1('0x50')](_0x30405e);_0x4a7d4c['query']=_['keys'](_0x325ed4[_0x5dc1('0x3e')]);_0x4a7d4c[_0x5dc1('0xc6')]=_['intersection'](_0x4a7d4c[_0x5dc1('0x4e')],_0x4a7d4c[_0x5dc1('0x3e')]);_0x4a7d4c[_0x5dc1('0xc6')]=_[_0x5dc1('0xf4')](_0x4a7d4c[_0x5dc1('0xc6')],['$and','$or',_0x5dc1('0x153'),_0x5dc1('0x154'),'$lt',_0x5dc1('0x155'),_0x5dc1('0x156'),_0x5dc1('0x157'),_0x5dc1('0x158'),'$between',_0x5dc1('0x159'),_0x5dc1('0x15a'),_0x5dc1('0x15b'),_0x5dc1('0x15c'),'$notLike','$iLike',_0x5dc1('0x15d'),_0x5dc1('0x15c'),_0x5dc1('0x15e'),_0x5dc1('0x15f'),_0x5dc1('0x160'),'$any']);_0xcd6509[_0x5dc1('0x41')]=_[_0x5dc1('0x51')](_0x4a7d4c[_0x5dc1('0x4e')],qs[_0x5dc1('0x52')](_0x325ed4[_0x5dc1('0x3e')][_0x5dc1('0x52')]));_0xcd6509[_0x5dc1('0x41')]=_0xcd6509[_0x5dc1('0x41')]['length']?_0xcd6509[_0x5dc1('0x41')]:_0x4a7d4c[_0x5dc1('0x4e')];if(!_0x325ed4[_0x5dc1('0x3e')][_0x5dc1('0xca')]('nolimit')){_0xcd6509[_0x5dc1('0x20')]=qs[_0x5dc1('0x20')](_0x325ed4[_0x5dc1('0x3e')]['limit']);_0xcd6509['offset']=qs[_0x5dc1('0x1f')](_0x325ed4[_0x5dc1('0x3e')][_0x5dc1('0x1f')]);}_0xcd6509[_0x5dc1('0xd1')]=qs[_0x5dc1('0xc7')](_0x325ed4['query'][_0x5dc1('0xc7')]);_0xcd6509[_0x5dc1('0x3d')]=qs[_0x5dc1('0xc6')](_['pick'](_0x325ed4[_0x5dc1('0x3e')],_0x4a7d4c['filters']));if(_0x325ed4['query'][_0x5dc1('0x2d')]){_0xcd6509[_0x5dc1('0x3d')]=_[_0x5dc1('0x53')](_0xcd6509[_0x5dc1('0x3d')],{'$or':_[_0x5dc1('0x2e')](_0xcd6509[_0x5dc1('0x41')],function(_0x3cb37e){var _0x28c4f0={};_0x28c4f0[_0x3cb37e]={'$like':'%'+_0x325ed4[_0x5dc1('0x3e')][_0x5dc1('0x2d')]+'%'};return _0x28c4f0;})});}_0xcd6509['where']={'$and':[_0xcd6509[_0x5dc1('0x3d')],{'$or':[{'UserId':_0x325ed4[_0x5dc1('0x4d')]['id']},{'OwnerId':_0x325ed4[_0x5dc1('0x4d')]['id']}]}]};_0xcd6509=_[_0x5dc1('0x53')]({},_0xcd6509,_0x325ed4[_0x5dc1('0xc9')]);var _0x1b5e65={'where':_0xcd6509[_0x5dc1('0x3d')]};return db[_0x5dc1('0x152')]['count'](_0x1b5e65)[_0x5dc1('0x11')](function(_0x3879c9){_0x4a9ff5[_0x5dc1('0x22')]=_0x3879c9;if(_0x325ed4['query'][_0x5dc1('0x3f')]){_0xcd6509['include']=[{'attributes':['id',_0x5dc1('0x161'),_0x5dc1('0x162'),_0x5dc1('0x163')],'model':db[_0x5dc1('0xc5')],'as':_0x5dc1('0x164')},{'attributes':['id',_0x5dc1('0x31'),'dialActive'],'model':db[_0x5dc1('0xa5')],'as':_0x5dc1('0xd0')}];}return db[_0x5dc1('0x152')][_0x5dc1('0x87')](_0xcd6509);})[_0x5dc1('0x11')](function(_0x58a36b){_0x4a9ff5[_0x5dc1('0x42')]=_0x58a36b;return _0x4a9ff5;})[_0x5dc1('0x11')](respondWithFilteredResult(_0x10a7ba,_0xcd6509))['catch'](handleError(_0x10a7ba,null));};exports[_0x5dc1('0x165')]=function(_0x5dc3d8,_0x1d73eb){if(!_[_0x5dc1('0x61')](_0x5dc3d8[_0x5dc1('0x79')]['id'])&&(_0x5dc3d8[_0x5dc1('0x79')][_0x5dc1('0x27')]==_0x5dc1('0x28')||_0x5dc3d8[_0x5dc1('0x79')][_0x5dc1('0x27')]==_0x5dc1('0x79'))){return db[_0x5dc1('0x37')]['findOne']({'where':{'id':_0x5dc3d8[_0x5dc1('0x4d')]['id']},'raw':!![]})[_0x5dc1('0x11')](function(_0x8440f2){return authService['retrieveApiKey'](_0x8440f2);})[_0x5dc1('0x11')](function(_0x523ed4){if(_0x523ed4){return _0x1d73eb[_0x5dc1('0x1c')](0xc8)[_0x5dc1('0x1e')]({'api_key':_0x523ed4['token']});}else{return _0x1d73eb[_0x5dc1('0x1c')](0xcc)[_0x5dc1('0x1e')]({'message':'No\x20API\x20access\x20key\x20found!'});}})[_0x5dc1('0x1a')](handleError(_0x1d73eb,0x193));}else{return _0x1d73eb[_0x5dc1('0x1c')](0x191)[_0x5dc1('0x1e')]({'message':_0x5dc1('0x166')});}};exports['createApiKey']=function(_0x3155cf,_0x5a1c5c){if(!_[_0x5dc1('0x61')](_0x3155cf[_0x5dc1('0x79')]['id'])&&(_0x3155cf['user'][_0x5dc1('0x27')]==_0x5dc1('0x28')||_0x3155cf[_0x5dc1('0x79')][_0x5dc1('0x27')]=='user')){return db['User'][_0x5dc1('0x54')]({'where':{'id':_0x3155cf[_0x5dc1('0x4d')]['id']}})['then'](function(_0x381c70){return authService['generateApiKey'](_0x381c70);})[_0x5dc1('0x11')](function(_0x3178f0){return db[_0x5dc1('0x37')][_0x5dc1('0x25')]({'apiKeyIat':_0x3178f0['iat'],'apiKeyNonce':_0x3178f0['nonce']},{'where':{'id':_0x3155cf['params']['id']}})[_0x5dc1('0x11')](function(){return _0x5a1c5c[_0x5dc1('0x1c')](0xc8)[_0x5dc1('0x1e')]({'api_key':_0x3178f0[_0x5dc1('0x167')]});});})[_0x5dc1('0x1a')](handleError(_0x5a1c5c,0x193));}else{return _0x5a1c5c['status'](0x191)['json']({'message':_0x5dc1('0x166')});}};exports[_0x5dc1('0x168')]=function(_0x3475a5,_0x5af4bf){if(!_[_0x5dc1('0x61')](_0x3475a5[_0x5dc1('0x79')]['id'])&&(_0x3475a5[_0x5dc1('0x79')][_0x5dc1('0x27')]==_0x5dc1('0x28')||_0x3475a5['user'][_0x5dc1('0x27')]==_0x5dc1('0x79'))){return db[_0x5dc1('0x37')]['find']({'where':{'id':_0x3475a5[_0x5dc1('0x4d')]['id']}})[_0x5dc1('0x11')](handleEntityNotFound(_0x5af4bf,null))[_0x5dc1('0x11')](function(_0x1d8897){if(_0x1d8897&&_0x1d8897[_0x5dc1('0x169')]&&_0x1d8897[_0x5dc1('0x16a')])return _0x1d8897;else throw{'message':_0x5dc1('0x16b')};})['then'](function(_0x13b01d){return db[_0x5dc1('0x37')][_0x5dc1('0x25')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x3475a5[_0x5dc1('0x4d')]['id']}});})[_0x5dc1('0x11')](respondWithStatusCode(_0x5af4bf,0xc8))[_0x5dc1('0x1a')](handleError(_0x5af4bf,0x193));}else{return _0x5af4bf['status'](0x191)[_0x5dc1('0x1e')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x5dc1('0x16c')]=function(_0x37e58c,_0x11655c){var _0x184f84=_0x37e58c['user'][_0x5dc1('0x26')]({'plain':!![]});if(!_0x184f84){return _0x11655c[_0x5dc1('0x1c')](0x191)[_0x5dc1('0x35')](_0x5dc1('0x16d'));}else{return _0x11655c['status'](0xc8)[_0x5dc1('0x1e')](_0x184f84);}};exports[_0x5dc1('0x16e')]=function(_0x2236ce,_0x1f146f){var _0x485929={'offset':0x0},_0x5695b3={'count':0x0,'rows':[]};Promise[_0x5dc1('0xf6')]()[_0x5dc1('0x11')](function(){if(!_0x2236ce['query'][_0x5dc1('0x2d')]&&!_0x2236ce[_0x5dc1('0x3e')][_0x5dc1('0x16f')]&&!_0x2236ce[_0x5dc1('0x3e')][_0x5dc1('0x170')])return[];return Promise[_0x5dc1('0xf6')]()['then'](function(){var _0x16e4d4=[];if(!_[_0x5dc1('0x171')](_0x2236ce[_0x5dc1('0x3e')][_0x5dc1('0x16f')])){_0x16e4d4['push'](db[_0x5dc1('0x109')][_0x5dc1('0x87')]({'attributes':['id','name'],'where':{'id':_0x2236ce[_0x5dc1('0x3e')][_0x5dc1('0x16f')]}}));}if(!_[_0x5dc1('0x171')](_0x2236ce['query'][_0x5dc1('0x170')])){_0x16e4d4[_0x5dc1('0x44')](db['VoiceQueue']['findAll']({'attributes':['id','name'],'type':_0x5dc1('0x172'),'where':{'id':_0x2236ce[_0x5dc1('0x3e')][_0x5dc1('0x170')]}}));}return Promise[_0x5dc1('0x4b')](_0x16e4d4);})[_0x5dc1('0x11')](function(_0x5b5126){var _0x3075fd=_[_0x5dc1('0x116')](_0x5b5126)[_0x5dc1('0x2e')](function(_0x27e15e){return _0x27e15e[_0x5dc1('0x122')]({'attributes':['id','name',_0x5dc1('0x5c'),_0x5dc1('0x98')],'raw':!![]});});return Promise[_0x5dc1('0x4b')](_0x3075fd);})[_0x5dc1('0x11')](function(_0x47b75f){var _0x46d65c=_['flatten'](_0x47b75f);if(!_0x2236ce[_0x5dc1('0x3e')][_0x5dc1('0x2d')])return _0x46d65c;if(_[_0x5dc1('0x171')](_0x46d65c)){return db['User'][_0x5dc1('0x87')]({'attributes':['id','name',_0x5dc1('0x5c'),_0x5dc1('0x98')],'where':{'role':_0x5dc1('0x2a'),'$or':[db[_0x5dc1('0x63')][_0x5dc1('0x3d')](db[_0x5dc1('0x63')]['fn']('lower',db[_0x5dc1('0x63')][_0x5dc1('0x173')](_0x5dc1('0x31'))),{'$like':'%'+_0x2236ce[_0x5dc1('0x3e')][_0x5dc1('0x2d')][_0x5dc1('0xa1')]()+'%'}),{'internal':{'$like':'%'+_0x2236ce[_0x5dc1('0x3e')][_0x5dc1('0x2d')]+'%'}}]},'raw':!![]});}else{return _(_0x46d65c)[_0x5dc1('0x116')]()[_0x5dc1('0x2d')](function(_0x38515e){return _0x38515e['name'][_0x5dc1('0xa1')]()[_0x5dc1('0x30')](_0x2236ce[_0x5dc1('0x3e')]['filter'][_0x5dc1('0xa1')]())||_0x38515e[_0x5dc1('0x5c')]['toString']()[_0x5dc1('0x30')](_0x2236ce['query'][_0x5dc1('0x2d')]);})['value']();}})[_0x5dc1('0x11')](function(_0x338065){var _0x489082=_0x5dc1('0x31');var _0x42e244=_0x5dc1('0x174');if(_0x2236ce[_0x5dc1('0x3e')][_0x5dc1('0xc7')]){var _0x42e244=_0x2236ce[_0x5dc1('0x3e')][_0x5dc1('0xc7')][0x0]==='-'?_0x5dc1('0x175'):_0x5dc1('0x174');var _0x489082=_0x42e244===_0x5dc1('0x174')?_0x2236ce['query']['sort']:_0x2236ce[_0x5dc1('0x3e')][_0x5dc1('0xc7')]['substring'](0x1);}return _(_0x338065)[_0x5dc1('0x176')]('id')[_0x5dc1('0x177')]([function(_0x160318){return _0x489082===_0x5dc1('0x31')?_0x160318[_0x489082][_0x5dc1('0xa1')]():_0x160318[_0x489082];}],[_0x42e244])[_0x5dc1('0x2e')](function(_0x53eff7){return _[_0x5dc1('0xc8')](_0x53eff7,['id',_0x5dc1('0x31'),_0x5dc1('0x5c'),'online']);})[_0x5dc1('0x2f')]();})[_0x5dc1('0x11')](function(_0x2f7a89){return client[_0x5dc1('0x10')](_0x5dc1('0x80'),_0x2236ce)[_0x5dc1('0x11')](function(_0x22e68a){if(_0x22e68a['error'])throw new Error(_0x5dc1('0x178'));var _0x4a2d94=_0x22e68a[_0x5dc1('0x19')];var _0x30bd7c=jayson['client']['http']({'port':0x232c});return _0x30bd7c['request'](_0x5dc1('0x80'),_0x2236ce)[_0x5dc1('0x11')](function(_0x53ea18){if(_0x53ea18[_0x5dc1('0x15')])throw new Error(_0x5dc1('0x179'));var _0x152d9c=_0x53ea18[_0x5dc1('0x19')];return _[_0x5dc1('0x53')]({},_0x152d9c,_0x4a2d94);});})['then'](function(_0x3914b2){return _['map'](_0x2f7a89,function(_0x70623b){var _0x578284=_[_0x5dc1('0x54')](_0x3914b2[_0x5dc1('0x42')],['id',_0x70623b['id']]);if(!_0x578284||!_0x70623b[_0x5dc1('0x98')]){_0x70623b[_0x5dc1('0x1c')]=_0x5dc1('0x17a');}else if(_0x578284[_0x5dc1('0x9a')]){_0x70623b['status']='pause';}else{_0x70623b[_0x5dc1('0x1c')]=_[_0x5dc1('0x30')]([_0x5dc1('0x17b'),'unknown',_0x5dc1('0x17c'),_0x5dc1('0x17d'),null,undefined],_0x578284['voiceStatus'])?_0x5dc1('0x98'):'busy';}return _0x70623b;});});});})[_0x5dc1('0x11')](function(_0x2852a6){if(!_0x2236ce[_0x5dc1('0x3e')][_0x5dc1('0xca')](_0x5dc1('0xce'))){_0x485929[_0x5dc1('0x20')]=qs['limit'](_0x2236ce[_0x5dc1('0x3e')]['limit']||0xa);_0x485929[_0x5dc1('0x1f')]=qs[_0x5dc1('0x1f')](_0x2236ce[_0x5dc1('0x3e')]['offset']);}_0x5695b3['count']=_0x2852a6[_0x5dc1('0x43')];_0x5695b3['rows']=_0x485929[_0x5dc1('0x20')]?_0x2852a6[_0x5dc1('0x17e')](_0x485929['offset'],_0x485929[_0x5dc1('0x1f')]+_0x485929[_0x5dc1('0x20')]):_0x2852a6;return _0x5695b3;})[_0x5dc1('0x11')](respondWithFilteredResult(_0x1f146f,_0x485929))['catch'](handleError(_0x1f146f,null));};function get_open_tabs(_0x5b8da2,_0x7358f6){var _0x1a7f5f=_0x5b8da2[_0x5dc1('0x17f')](0x0)[_0x5dc1('0x180')]()+_0x5b8da2[_0x5dc1('0x17e')](0x1);var _0x3c9f91={'type':db[_0x5dc1('0x8a')][_0x5dc1('0x64')][_0x5dc1('0x65')],'raw':!![]};return new BPromise(function(_0x5b629f,_0x2e5492){var _0x54acaa=squel[_0x5dc1('0x181')]()[_0x5dc1('0x182')](_0x5dc1('0x183')+_0x1a7f5f+_0x5dc1('0x184'),'id')[_0x5dc1('0x182')]('ui.createdAt')['from'](_0x5dc1('0x185')+_0x5b8da2+'_interactions','ui')[_0x5dc1('0x3d')]('ui.UserId\x20=\x20?',_0x7358f6['id']);return db[_0x5dc1('0x63')][_0x5dc1('0x3e')](_0x54acaa[_0x5dc1('0x186')](),_0x3c9f91)[_0x5dc1('0x11')](function(_0x2ac834){_0x7358f6[_0x1a7f5f+_0x5dc1('0x187')]=_0x2ac834;_0x5b629f(_0x2ac834);})['catch'](function(_0x562b14){_0x2e5492(_0x562b14);});});};
\ No newline at end of file
index 1188456..9d99d06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcde1=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x541793,_0x4ac8b0){var _0x4035c9=function(_0x1c6319){while(--_0x1c6319){_0x541793['push'](_0x541793['shift']());}};_0x4035c9(++_0x4ac8b0);}(_0xcde1,0xe7));var _0x1cde=function(_0x4fbe83,_0x12fb70){_0x4fbe83=_0x4fbe83-0x0;var _0x378eaa=_0xcde1[_0x4fbe83];return _0x378eaa;};'use strict';var EventEmitter=require(_0x1cde('0x0'));var User=require('../../mysqldb')['db']['User'];var UserEvents=new EventEmitter();UserEvents[_0x1cde('0x1')](0x0);var events={'afterCreate':_0x1cde('0x2'),'afterUpdate':'update','afterDestroy':_0x1cde('0x3')};function emitEvent(_0x67a8c6){return function(_0x18231d,_0x3dea0f,_0x3a2f4d){UserEvents[_0x1cde('0x4')](_0x67a8c6+':'+_0x18231d['id'],_0x18231d);UserEvents['emit'](_0x67a8c6,_0x18231d);_0x3a2f4d(null);};}for(var e in events){if(events[_0x1cde('0x5')](e)){var event=events[e];User[_0x1cde('0x6')](e,emitEvent(event));}}module[_0x1cde('0x7')]=UserEvents;
\ No newline at end of file
+var _0x503f=['hook','exports','../../mysqldb','User','save','update','remove','emit','hasOwnProperty'];(function(_0x465aa9,_0x1bf1c8){var _0x4104e4=function(_0x388bb8){while(--_0x388bb8){_0x465aa9['push'](_0x465aa9['shift']());}};_0x4104e4(++_0x1bf1c8);}(_0x503f,0x6e));var _0xf503=function(_0x178e39,_0x3a2c81){_0x178e39=_0x178e39-0x0;var _0x1cbf10=_0x503f[_0x178e39];return _0x1cbf10;};'use strict';var EventEmitter=require('events');var User=require(_0xf503('0x0'))['db'][_0xf503('0x1')];var UserEvents=new EventEmitter();UserEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf503('0x2'),'afterUpdate':_0xf503('0x3'),'afterDestroy':_0xf503('0x4')};function emitEvent(_0x3d3976){return function(_0x5ecb84,_0x108ed8,_0x1ff922){UserEvents[_0xf503('0x5')](_0x3d3976+':'+_0x5ecb84['id'],_0x5ecb84);UserEvents[_0xf503('0x5')](_0x3d3976,_0x5ecb84);_0x1ff922(null);};}for(var e in events){if(events[_0xf503('0x6')](e)){var event=events[e];User[_0xf503('0x7')](e,emitEvent(event));}}module[_0xf503('0x8')]=UserEvents;
\ No newline at end of file
index 2ae3a06..b4c9da4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4311=['google','length','context','system','format','%s%s','prefix','push','merge','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','name','options','join','StopMixMonitor','wav','WAV','gsm','from-sip','Set','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','Hangup','priority','defaults','VoiceChanSpy','findAll','then','internal','concat','catch','exports','define','User','users','utf8','utf8_bin','userProfileId','undefined','resolve','UserProfile','find','privacyEnabled','updatePassword','changed','updateMd5Password','bulkCreate','VoiceExtension','destroy','encryptPassword','function','randomBytes','toString','base64','salt','sha1','pbkdf2','indexOf','Invalid\x20password','makeSalt','md5secret',':asterisk:','bluebird','crypto','util','md5','lodash'];(function(_0x58076e,_0x3f190e){var _0x2918d3=function(_0x554b87){while(--_0x554b87){_0x58076e['push'](_0x58076e['shift']());}};_0x2918d3(++_0x3f190e);}(_0x4311,0x133));var _0x1431=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4311[_0x19e35c];return _0x3e1fe8;};'use strict';var BPromise=require(_0x1431('0x0'));var crypto=require(_0x1431('0x1'));var util=require(_0x1431('0x2'));var md5=require(_0x1431('0x3'));var _=require(_0x1431('0x4'));var attributes=require('./user.attributes');var authTypes=[_0x1431('0x5')];var validatePresenceOf=function(_0x109017){return _0x109017&&_0x109017[_0x1431('0x6')];};var getChanSpyApplications=function(_0x49219d,_0x5b468a,_0x595203){var _0x1ee7eb={'context':_0x49219d[_0x1431('0x7')]||'from-sip','type':_0x1431('0x8'),'isApp':![],'UserId':_0x49219d['id']};var _0x5d80c2=[];for(var _0x26d3eb=0x0,_0x1f6eb1=0x1;_0x26d3eb<_0x595203['length'];_0x26d3eb++,_0x1f6eb1=0x1){var _0x41faff={'exten':util[_0x1431('0x9')](_0x1431('0xa'),_0x595203[_0x26d3eb][_0x1431('0xb')],_0x5b468a),'ChanSpyId':_0x595203[_0x26d3eb]['id']};_0x5d80c2[_0x1431('0xc')](_[_0x1431('0xd')]({'app':'Set','appdata':util[_0x1431('0x9')]('CDR(type)=%s',_0x1431('0xe')),'priority':_0x1f6eb1++},_0x1ee7eb,_0x41faff));if(_0x595203[_0x26d3eb][_0x1431('0xf')]){_0x5d80c2[_0x1431('0xc')](_[_0x1431('0xd')]({'app':_0x1431('0x10'),'appdata':util[_0x1431('0x9')](_0x1431('0x11'),_0x595203[_0x26d3eb][_0x1431('0x12')]),'priority':_0x1f6eb1++},_0x1ee7eb,_0x41faff));}if(_0x595203[_0x26d3eb]['auth']){_0x5d80c2[_0x1431('0xc')](_[_0x1431('0xd')]({'app':_0x1431('0x13'),'appdata':_0x595203[_0x26d3eb][_0x1431('0x14')],'priority':_0x1f6eb1++},_0x1ee7eb,_0x41faff));}_0x5d80c2[_0x1431('0xc')](_[_0x1431('0xd')]({'app':_0x1431('0x15'),'appdata':util[_0x1431('0x9')]('SIP/%s,%s',_0x49219d[_0x1431('0x16')],_0x595203[_0x26d3eb][_0x1431('0x17')]?_0x595203[_0x26d3eb][_0x1431('0x17')][_0x1431('0x18')](''):''),'priority':_0x1f6eb1++},_0x1ee7eb,_0x41faff));if(_0x595203[_0x26d3eb]['record']){_0x5d80c2['push'](_[_0x1431('0xd')]({'app':_0x1431('0x19'),'priority':_0x1f6eb1++},_0x1ee7eb,_0x41faff));}}return _0x5d80c2;};var getUserApplications=function(_0x51ce46,_0xce70ea){var _0x55b3ac=[_0x1431('0x1a'),_0x1431('0x1b'),_0x1431('0x1c')];var _0x15b79f={'context':_0x51ce46[_0x1431('0x7')]||_0x1431('0x1d'),'exten':_0xce70ea,'type':_0x1431('0x8'),'isApp':![],'UserId':_0x51ce46['id']};var _0x3ac738=[{'app':_0x1431('0x1e'),'appdata':_0x1431('0x1f')}];if(_0x51ce46[_0x1431('0x20')]&&_[_0x1431('0x21')](_0x55b3ac,_0x51ce46[_0x1431('0x20')])){_0x3ac738[_0x1431('0xc')]({'app':_0x1431('0x1e'),'appdata':_0x1431('0x22')});_0x3ac738['push']({'app':'Set','appdata':util[_0x1431('0x9')](_0x1431('0x23'),_0x51ce46[_0x1431('0x20')])});_0x3ac738[_0x1431('0xc')]({'app':_0x1431('0x24'),'appdata':util[_0x1431('0x9')](_0x1431('0x25'),_0x51ce46['name'])});}else{_0x3ac738[_0x1431('0xc')]({'app':_0x1431('0x24'),'appdata':util['format']('SIP/%s,,tTxX',_0x51ce46['name'])});}_0x3ac738[_0x1431('0xc')]({'app':_0x1431('0x26')});for(var _0x49f9ff=0x0;_0x49f9ff<_0x3ac738['length'];_0x49f9ff++){_0x3ac738[_0x49f9ff][_0x1431('0x27')]=_0x49f9ff+0x1;_0x3ac738[_0x49f9ff]=_[_0x1431('0x28')](_0x3ac738[_0x49f9ff],_0x15b79f);}return _0x3ac738;};var getChanSpyPromise=function(_0x39f103,_0x353dc5){return new BPromise(function(_0x1046d0,_0x2a7579){return _0x39f103[_0x1431('0x29')][_0x1431('0x2a')]()[_0x1431('0x2b')](function(_0x19e5bf){if(_0x19e5bf){var _0x27d1d7=getChanSpyApplications(_0x353dc5,_0x353dc5[_0x1431('0x2c')],_0x19e5bf);if(_0x353dc5[_0x1431('0x2c')]!=_0x353dc5[_0x1431('0x16')]){_0x27d1d7=_0x27d1d7[_0x1431('0x2d')](getChanSpyApplications(_0x353dc5,_0x353dc5[_0x1431('0x16')],_0x19e5bf));}return _0x1046d0(_0x27d1d7);}return _0x1046d0([]);})[_0x1431('0x2e')](function(_0x10c243){_0x2a7579(_0x10c243);});});};module[_0x1431('0x2f')]=function(_0x3629e0,_0x4db5dd){var _0x4cafc7=_0x3629e0['models'];return _0x3629e0[_0x1431('0x30')](_0x1431('0x31'),attributes,{'tableName':_0x1431('0x32'),'charset':_0x1431('0x33'),'collate':_0x1431('0x34'),'hooks':{'beforeCreate':function(_0x3f52bf,_0x5ab244,_0x39d177){var _0x5a526c=typeof _0x3f52bf[_0x1431('0x35')]===_0x1431('0x36')?BPromise[_0x1431('0x37')](null):_0x4cafc7[_0x1431('0x38')][_0x1431('0x39')]({'where':{'id':_0x3f52bf[_0x1431('0x35')]}});_0x5a526c['then'](function(_0x230d64){if(_0x230d64){_0x3f52bf[_0x1431('0x3a')]=_0x230d64[_0x1431('0x3a')];}})[_0x1431('0x2b')](function(){_0x3f52bf['updateMd5Password']();_0x3f52bf[_0x1431('0x3b')](_0x39d177);})[_0x1431('0x2e')](function(_0x14be8b){_0x39d177(_0x14be8b);});},'beforeUpdate':function(_0x3fb17a,_0x3575e4,_0x437b26){Promise[_0x1431('0x37')]()[_0x1431('0x2b')](function(){if(_0x3fb17a[_0x1431('0x3c')](_0x1431('0x35'))===![])return;return _0x4cafc7[_0x1431('0x38')][_0x1431('0x39')]({'where':{'id':_0x3fb17a['userProfileId']}})[_0x1431('0x2b')](function(_0x39c405){if(_0x39c405)_0x3fb17a['privacyEnabled']=_0x39c405['privacyEnabled'];return;});})[_0x1431('0x2b')](function(){if(_0x3fb17a[_0x1431('0x3c')]('password')){_0x3fb17a[_0x1431('0x3d')]();return _0x3fb17a[_0x1431('0x3b')](_0x437b26);}_0x437b26();})[_0x1431('0x2e')](function(_0xc73fd4){_0x437b26(_0xc73fd4);});},'afterCreate':function(_0x2758c1,_0x3235c6,_0x3957d8){var _0x1a303c=getUserApplications(_0x2758c1,_0x2758c1[_0x1431('0x2c')]);if(_0x2758c1[_0x1431('0x2c')]!=_0x2758c1[_0x1431('0x16')]){_0x1a303c=_0x1a303c[_0x1431('0x2d')](getUserApplications(_0x2758c1,_0x2758c1[_0x1431('0x16')]));}return _0x4cafc7['VoiceExtension'][_0x1431('0x3e')](_0x1a303c)['then'](function(){if(_0x2758c1[_0x1431('0xe')]){return getChanSpyPromise(_0x4cafc7,_0x2758c1);}})[_0x1431('0x2b')](function(_0xd7d31b){if(_0xd7d31b&&_0xd7d31b[_0x1431('0x6')]){return _0x4cafc7[_0x1431('0x3f')][_0x1431('0x3e')](_0xd7d31b);}})[_0x1431('0x2b')](function(){_0x3957d8();})[_0x1431('0x2e')](function(_0x4aa329){_0x3957d8(_0x4aa329);});},'afterUpdate':function(_0x1f4921,_0x204638,_0x273f4c){return BPromise[_0x1431('0x37')]()[_0x1431('0x2b')](function(){if(_0x1f4921[_0x1431('0x3c')](_0x1431('0xe'))||_0x1f4921[_0x1431('0x3c')](_0x1431('0x7'))){return _0x4cafc7[_0x1431('0x3f')]['destroy']({'where':{'UserId':_0x1f4921['id'],'type':_0x1431('0x8'),'ChanSpyId':{'$ne':null}}})[_0x1431('0x2b')](function(){if(_0x1f4921[_0x1431('0xe')]){return getChanSpyPromise(_0x4cafc7,_0x1f4921)['then'](function(_0x577283){if(_0x577283&&_0x577283[_0x1431('0x6')]){return _0x4cafc7['VoiceExtension'][_0x1431('0x3e')](_0x577283);}});}});}})['then'](function(){if(_0x1f4921[_0x1431('0x3c')](_0x1431('0x20'))||_0x1f4921['changed'](_0x1431('0x7'))){return _0x4cafc7[_0x1431('0x3f')]['destroy']({'where':{'UserId':_0x1f4921['id'],'type':_0x1431('0x8'),'ChanSpyId':null}})['then'](function(){var _0x3b2629=getUserApplications(_0x1f4921,_0x1f4921[_0x1431('0x2c')]);if(_0x1f4921['internal']!=_0x1f4921[_0x1431('0x16')]){_0x3b2629=_0x3b2629['concat'](getUserApplications(_0x1f4921,_0x1f4921[_0x1431('0x16')]));}return _0x4cafc7[_0x1431('0x3f')][_0x1431('0x3e')](_0x3b2629);});}})[_0x1431('0x2b')](function(){_0x273f4c();})[_0x1431('0x2e')](function(_0x413a93){_0x273f4c(_0x413a93);});},'afterDestroy':function(_0xcfa18e,_0x334823){return _0x4cafc7[_0x1431('0x3f')][_0x1431('0x40')]({'where':{'UserId':_0xcfa18e['id'],'type':_0x1431('0x8')}});}},'instanceMethods':{'authenticate':function(_0x4c06fd,_0xad5dd6){if(!_0xad5dd6){return this['password']===this[_0x1431('0x41')](_0x4c06fd);}var _0x5a12f6=this;this[_0x1431('0x41')](_0x4c06fd,function(_0x5a0221,_0x36c5b3){if(_0x5a0221){_0xad5dd6(_0x5a0221);}if(_0x5a12f6['password']===_0x36c5b3){_0xad5dd6(null,!![]);}else{_0xad5dd6(null,![]);}});},'makeSalt':function(_0x15017a,_0xb08718){var _0x102b49=0x10;if(typeof arguments[0x0]===_0x1431('0x42')){_0xb08718=arguments[0x0];_0x15017a=_0x102b49;}else if(typeof arguments[0x1]===_0x1431('0x42')){_0xb08718=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x15017a){_0x15017a=_0x102b49;}return crypto[_0x1431('0x43')](_0x15017a,function(_0x11380f,_0x375189){if(_0x11380f){_0xb08718(_0x11380f);}return _0xb08718(null,_0x375189[_0x1431('0x44')](_0x1431('0x45')));});},'encryptPassword':function(_0x21447b,_0xd865fd){if(!_0x21447b||!this[_0x1431('0x46')]){return _0xd865fd?_0xd865fd(null):null;}var _0x2f2994=0x2710;var _0x4ac7d2=0x40;var _0x43e397=new Buffer(this[_0x1431('0x46')],_0x1431('0x45'));if(!_0xd865fd){return crypto['pbkdf2Sync'](_0x21447b,_0x43e397,_0x2f2994,_0x4ac7d2,_0x1431('0x47'))[_0x1431('0x44')](_0x1431('0x45'));}return crypto[_0x1431('0x48')](_0x21447b,_0x43e397,_0x2f2994,_0x4ac7d2,_0x1431('0x47'),function(_0x5a1bec,_0x4753d9){if(_0x5a1bec){_0xd865fd(_0x5a1bec);}return _0xd865fd(null,_0x4753d9['toString']('base64'));});},'updatePassword':function(_0x21320d){if(!this[_0x1431('0x14')]){return _0x21320d(null);}if(!validatePresenceOf(this['password'])&&authTypes[_0x1431('0x49')](this['provider'])===-0x1){_0x21320d(new Error(_0x1431('0x4a')));}var _0x355901=this;this[_0x1431('0x4b')](function(_0x31a38e,_0xfa19df){if(_0x31a38e){return _0x21320d(_0x31a38e);}_0x355901[_0x1431('0x46')]=_0xfa19df;_0x355901['encryptPassword'](_0x355901[_0x1431('0x14')],function(_0x409740,_0x2f8ad3){if(_0x409740){_0x21320d(_0x409740);}_0x355901[_0x1431('0x14')]=_0x2f8ad3;_0x21320d(null);});});},'updateMd5Password':function(){this[_0x1431('0x4c')]=md5(this[_0x1431('0x16')]+_0x1431('0x4d')+this[_0x1431('0x14')]);return this[_0x1431('0x4c')];}}});};
\ No newline at end of file
+var _0xd864=['then','internal','concat','catch','models','define','User','utf8','userProfileId','resolve','find','privacyEnabled','updateMd5Password','updatePassword','changed','UserProfile','VoiceExtension','bulkCreate','context','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','indexOf','provider','Invalid\x20password','makeSalt','md5secret','util','google','length','system','prefix','push','merge','Set','format','chanspy','MixMonitor','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','wav','WAV','gsm','from-sip','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','Hangup','priority','defaults','VoiceChanSpy','findAll'];(function(_0x225d8e,_0x50d71a){var _0x8f1926=function(_0xd7ec30){while(--_0xd7ec30){_0x225d8e['push'](_0x225d8e['shift']());}};_0x8f1926(++_0x50d71a);}(_0xd864,0x1c7));var _0x4d86=function(_0x4c8962,_0x23ea34){_0x4c8962=_0x4c8962-0x0;var _0x5157dd=_0xd864[_0x4c8962];return _0x5157dd;};'use strict';var BPromise=require('bluebird');var crypto=require('crypto');var util=require(_0x4d86('0x0'));var md5=require('md5');var _=require('lodash');var attributes=require('./user.attributes');var authTypes=[_0x4d86('0x1')];var validatePresenceOf=function(_0x266a80){return _0x266a80&&_0x266a80[_0x4d86('0x2')];};var getChanSpyApplications=function(_0x5759f4,_0x41b13e,_0x49127e){var _0x1a162d={'context':_0x5759f4['context']||'from-sip','type':_0x4d86('0x3'),'isApp':![],'UserId':_0x5759f4['id']};var _0x204de2=[];for(var _0x46a2c4=0x0,_0xd718e0=0x1;_0x46a2c4<_0x49127e[_0x4d86('0x2')];_0x46a2c4++,_0xd718e0=0x1){var _0x47e4dc={'exten':util['format']('%s%s',_0x49127e[_0x46a2c4][_0x4d86('0x4')],_0x41b13e),'ChanSpyId':_0x49127e[_0x46a2c4]['id']};_0x204de2[_0x4d86('0x5')](_[_0x4d86('0x6')]({'app':_0x4d86('0x7'),'appdata':util[_0x4d86('0x8')]('CDR(type)=%s',_0x4d86('0x9')),'priority':_0xd718e0++},_0x1a162d,_0x47e4dc));if(_0x49127e[_0x46a2c4]['record']){_0x204de2[_0x4d86('0x5')](_[_0x4d86('0x6')]({'app':_0x4d86('0xa'),'appdata':util[_0x4d86('0x8')]('${UNIQUEID}.%s,a',_0x49127e[_0x46a2c4][_0x4d86('0xb')]),'priority':_0xd718e0++},_0x1a162d,_0x47e4dc));}if(_0x49127e[_0x46a2c4][_0x4d86('0xc')]){_0x204de2[_0x4d86('0x5')](_['merge']({'app':_0x4d86('0xd'),'appdata':_0x49127e[_0x46a2c4][_0x4d86('0xe')],'priority':_0xd718e0++},_0x1a162d,_0x47e4dc));}_0x204de2[_0x4d86('0x5')](_[_0x4d86('0x6')]({'app':_0x4d86('0xf'),'appdata':util[_0x4d86('0x8')](_0x4d86('0x10'),_0x5759f4[_0x4d86('0x11')],_0x49127e[_0x46a2c4][_0x4d86('0x12')]?_0x49127e[_0x46a2c4][_0x4d86('0x12')][_0x4d86('0x13')](''):''),'priority':_0xd718e0++},_0x1a162d,_0x47e4dc));if(_0x49127e[_0x46a2c4]['record']){_0x204de2['push'](_['merge']({'app':'StopMixMonitor','priority':_0xd718e0++},_0x1a162d,_0x47e4dc));}}return _0x204de2;};var getUserApplications=function(_0x249e32,_0x2e367f){var _0x5af4ac=[_0x4d86('0x14'),_0x4d86('0x15'),_0x4d86('0x16')];var _0x2cef07={'context':_0x249e32['context']||_0x4d86('0x17'),'exten':_0x2e367f,'type':'system','isApp':![],'UserId':_0x249e32['id']};var _0x547ade=[{'app':_0x4d86('0x7'),'appdata':_0x4d86('0x18')}];if(_0x249e32[_0x4d86('0x19')]&&_[_0x4d86('0x1a')](_0x5af4ac,_0x249e32['extensionMonitor'])){_0x547ade[_0x4d86('0x5')]({'app':_0x4d86('0x7'),'appdata':_0x4d86('0x1b')});_0x547ade[_0x4d86('0x5')]({'app':_0x4d86('0x7'),'appdata':util[_0x4d86('0x8')](_0x4d86('0x1c'),_0x249e32[_0x4d86('0x19')])});_0x547ade[_0x4d86('0x5')]({'app':'Dial','appdata':util[_0x4d86('0x8')]('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0x249e32[_0x4d86('0x11')])});}else{_0x547ade['push']({'app':_0x4d86('0x1d'),'appdata':util[_0x4d86('0x8')]('SIP/%s,,tTxX',_0x249e32[_0x4d86('0x11')])});}_0x547ade['push']({'app':_0x4d86('0x1e')});for(var _0x2ab10d=0x0;_0x2ab10d<_0x547ade[_0x4d86('0x2')];_0x2ab10d++){_0x547ade[_0x2ab10d][_0x4d86('0x1f')]=_0x2ab10d+0x1;_0x547ade[_0x2ab10d]=_[_0x4d86('0x20')](_0x547ade[_0x2ab10d],_0x2cef07);}return _0x547ade;};var getChanSpyPromise=function(_0x3b49bb,_0x3e3d9a){return new BPromise(function(_0x39fe7a,_0x548215){return _0x3b49bb[_0x4d86('0x21')][_0x4d86('0x22')]()[_0x4d86('0x23')](function(_0x46af94){if(_0x46af94){var _0x30e40c=getChanSpyApplications(_0x3e3d9a,_0x3e3d9a[_0x4d86('0x24')],_0x46af94);if(_0x3e3d9a[_0x4d86('0x24')]!=_0x3e3d9a[_0x4d86('0x11')]){_0x30e40c=_0x30e40c[_0x4d86('0x25')](getChanSpyApplications(_0x3e3d9a,_0x3e3d9a['name'],_0x46af94));}return _0x39fe7a(_0x30e40c);}return _0x39fe7a([]);})[_0x4d86('0x26')](function(_0x552f58){_0x548215(_0x552f58);});});};module['exports']=function(_0x29c875,_0x1cbcd8){var _0x9799c4=_0x29c875[_0x4d86('0x27')];return _0x29c875[_0x4d86('0x28')](_0x4d86('0x29'),attributes,{'tableName':'users','charset':_0x4d86('0x2a'),'collate':'utf8_bin','hooks':{'beforeCreate':function(_0x882807,_0x18ff69,_0x3b2bd0){var _0x55b52f=typeof _0x882807[_0x4d86('0x2b')]==='undefined'?BPromise[_0x4d86('0x2c')](null):_0x9799c4['UserProfile'][_0x4d86('0x2d')]({'where':{'id':_0x882807[_0x4d86('0x2b')]}});_0x55b52f[_0x4d86('0x23')](function(_0xe367bf){if(_0xe367bf){_0x882807[_0x4d86('0x2e')]=_0xe367bf[_0x4d86('0x2e')];}})[_0x4d86('0x23')](function(){_0x882807[_0x4d86('0x2f')]();_0x882807[_0x4d86('0x30')](_0x3b2bd0);})[_0x4d86('0x26')](function(_0x208b07){_0x3b2bd0(_0x208b07);});},'beforeUpdate':function(_0x3465d0,_0x4d0b61,_0x4cfc74){Promise[_0x4d86('0x2c')]()[_0x4d86('0x23')](function(){if(_0x3465d0[_0x4d86('0x31')](_0x4d86('0x2b'))===![])return;return _0x9799c4[_0x4d86('0x32')][_0x4d86('0x2d')]({'where':{'id':_0x3465d0['userProfileId']}})['then'](function(_0x107661){if(_0x107661)_0x3465d0['privacyEnabled']=_0x107661[_0x4d86('0x2e')];return;});})[_0x4d86('0x23')](function(){if(_0x3465d0[_0x4d86('0x31')](_0x4d86('0xe'))){_0x3465d0[_0x4d86('0x2f')]();return _0x3465d0[_0x4d86('0x30')](_0x4cfc74);}_0x4cfc74();})[_0x4d86('0x26')](function(_0x10f38d){_0x4cfc74(_0x10f38d);});},'afterCreate':function(_0x3a6345,_0x46e666,_0xc637bf){var _0x3812c7=getUserApplications(_0x3a6345,_0x3a6345[_0x4d86('0x24')]);if(_0x3a6345['internal']!=_0x3a6345[_0x4d86('0x11')]){_0x3812c7=_0x3812c7['concat'](getUserApplications(_0x3a6345,_0x3a6345['name']));}return _0x9799c4[_0x4d86('0x33')]['bulkCreate'](_0x3812c7)[_0x4d86('0x23')](function(){if(_0x3a6345[_0x4d86('0x9')]){return getChanSpyPromise(_0x9799c4,_0x3a6345);}})[_0x4d86('0x23')](function(_0x343d07){if(_0x343d07&&_0x343d07[_0x4d86('0x2')]){return _0x9799c4[_0x4d86('0x33')][_0x4d86('0x34')](_0x343d07);}})[_0x4d86('0x23')](function(){_0xc637bf();})[_0x4d86('0x26')](function(_0xae529d){_0xc637bf(_0xae529d);});},'afterUpdate':function(_0x12c159,_0x481063,_0x47c5bd){return BPromise[_0x4d86('0x2c')]()[_0x4d86('0x23')](function(){if(_0x12c159[_0x4d86('0x31')]('chanspy')||_0x12c159['changed'](_0x4d86('0x35'))){return _0x9799c4['VoiceExtension'][_0x4d86('0x36')]({'where':{'UserId':_0x12c159['id'],'type':_0x4d86('0x3'),'ChanSpyId':{'$ne':null}}})[_0x4d86('0x23')](function(){if(_0x12c159[_0x4d86('0x9')]){return getChanSpyPromise(_0x9799c4,_0x12c159)[_0x4d86('0x23')](function(_0x2f2216){if(_0x2f2216&&_0x2f2216[_0x4d86('0x2')]){return _0x9799c4[_0x4d86('0x33')][_0x4d86('0x34')](_0x2f2216);}});}});}})[_0x4d86('0x23')](function(){if(_0x12c159[_0x4d86('0x31')](_0x4d86('0x19'))||_0x12c159[_0x4d86('0x31')](_0x4d86('0x35'))){return _0x9799c4['VoiceExtension'][_0x4d86('0x36')]({'where':{'UserId':_0x12c159['id'],'type':_0x4d86('0x3'),'ChanSpyId':null}})[_0x4d86('0x23')](function(){var _0x4ff88a=getUserApplications(_0x12c159,_0x12c159[_0x4d86('0x24')]);if(_0x12c159['internal']!=_0x12c159[_0x4d86('0x11')]){_0x4ff88a=_0x4ff88a[_0x4d86('0x25')](getUserApplications(_0x12c159,_0x12c159[_0x4d86('0x11')]));}return _0x9799c4['VoiceExtension']['bulkCreate'](_0x4ff88a);});}})['then'](function(){_0x47c5bd();})[_0x4d86('0x26')](function(_0x257bc5){_0x47c5bd(_0x257bc5);});},'afterDestroy':function(_0x4ab699,_0x20c055){return _0x9799c4['VoiceExtension'][_0x4d86('0x36')]({'where':{'UserId':_0x4ab699['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x17e0b0,_0x26608e){if(!_0x26608e){return this[_0x4d86('0xe')]===this['encryptPassword'](_0x17e0b0);}var _0x79eca9=this;this[_0x4d86('0x37')](_0x17e0b0,function(_0x3f44b8,_0x36e78a){if(_0x3f44b8){_0x26608e(_0x3f44b8);}if(_0x79eca9[_0x4d86('0xe')]===_0x36e78a){_0x26608e(null,!![]);}else{_0x26608e(null,![]);}});},'makeSalt':function(_0x4c143e,_0xb59718){var _0x587105=0x10;if(typeof arguments[0x0]===_0x4d86('0x38')){_0xb59718=arguments[0x0];_0x4c143e=_0x587105;}else if(typeof arguments[0x1]===_0x4d86('0x38')){_0xb59718=arguments[0x1];}else{throw new Error(_0x4d86('0x39'));}if(!_0x4c143e){_0x4c143e=_0x587105;}return crypto[_0x4d86('0x3a')](_0x4c143e,function(_0x5677a8,_0x1524f2){if(_0x5677a8){_0xb59718(_0x5677a8);}return _0xb59718(null,_0x1524f2[_0x4d86('0x3b')](_0x4d86('0x3c')));});},'encryptPassword':function(_0x4a90a1,_0x27e4a2){if(!_0x4a90a1||!this[_0x4d86('0x3d')]){return _0x27e4a2?_0x27e4a2(null):null;}var _0x73b58f=0x2710;var _0x12217d=0x40;var _0x5631bd=new Buffer(this[_0x4d86('0x3d')],_0x4d86('0x3c'));if(!_0x27e4a2){return crypto[_0x4d86('0x3e')](_0x4a90a1,_0x5631bd,_0x73b58f,_0x12217d,_0x4d86('0x3f'))[_0x4d86('0x3b')](_0x4d86('0x3c'));}return crypto[_0x4d86('0x40')](_0x4a90a1,_0x5631bd,_0x73b58f,_0x12217d,'sha1',function(_0xb23ab6,_0x5b67cb){if(_0xb23ab6){_0x27e4a2(_0xb23ab6);}return _0x27e4a2(null,_0x5b67cb[_0x4d86('0x3b')](_0x4d86('0x3c')));});},'updatePassword':function(_0x2ce23d){if(!this['password']){return _0x2ce23d(null);}if(!validatePresenceOf(this[_0x4d86('0xe')])&&authTypes[_0x4d86('0x41')](this[_0x4d86('0x42')])===-0x1){_0x2ce23d(new Error(_0x4d86('0x43')));}var _0x9c168c=this;this[_0x4d86('0x44')](function(_0x16bbf0,_0xf21ea0){if(_0x16bbf0){return _0x2ce23d(_0x16bbf0);}_0x9c168c['salt']=_0xf21ea0;_0x9c168c['encryptPassword'](_0x9c168c[_0x4d86('0xe')],function(_0x1fe6c7,_0x2cd5aa){if(_0x1fe6c7){_0x2ce23d(_0x1fe6c7);}_0x9c168c[_0x4d86('0xe')]=_0x2cd5aa;_0x2ce23d(null);});});},'updateMd5Password':function(){this[_0x4d86('0x45')]=md5(this[_0x4d86('0x11')]+':asterisk:'+this['password']);return this[_0x4d86('0x45')];}}});};
\ No newline at end of file
index fb49f8e..c8e86ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44bd=['defaults','localhost','socket.io-emitter','register','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','ShowUser','find','stringify','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','type','DEFAULT\x20PAUSE','body','uniqueid','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','voice','system','mail','chat','fax','sms','openchannel','whatsapp','all','LogoutUser','LoginUser','mobile','phone','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','loginInPause','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44bd,0xb0));var _0xd44b=function(_0x316cfd,_0x1dfe9d){_0x316cfd=_0x316cfd-0x0;var _0x50d52d=_0x44bd[_0x316cfd];return _0x50d52d;};'use strict';var _=require(_0xd44b('0x0'));var util=require(_0xd44b('0x1'));var moment=require(_0xd44b('0x2'));var BPromise=require('bluebird');var rs=require(_0xd44b('0x3'));var fs=require('fs');var Redis=require(_0xd44b('0x4'));var db=require(_0xd44b('0x5'))['db'];var utils=require(_0xd44b('0x6'));var logger=require(_0xd44b('0x7'))(_0xd44b('0x8'));var config=require(_0xd44b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd44b('0xa')]['http']({'port':0x232a});config[_0xd44b('0xb')]=_[_0xd44b('0xc')](config[_0xd44b('0xb')],{'host':_0xd44b('0xd'),'port':0x18eb});var socket=require(_0xd44b('0xe'))(new Redis(config[_0xd44b('0xb')]));require('./user.socket')[_0xd44b('0xf')](socket);function respondWithRpcPromise(_0x41be86,_0x235164,_0x41cb14){return new BPromise(function(_0x2d21dc,_0x52f742){return client['request'](_0x41be86,_0x41cb14)[_0xd44b('0x10')](function(_0x9b9564){logger[_0xd44b('0x11')](_0xd44b('0x12'),_0x235164,_0xd44b('0x13'));logger[_0xd44b('0x14')](_0xd44b('0x15'),_0x235164,_0xd44b('0x13'),JSON['stringify'](_0x9b9564));if(_0x9b9564[_0xd44b('0x16')]){if(_0x9b9564[_0xd44b('0x16')][_0xd44b('0x17')]===0x1f4){logger['error'](_0xd44b('0x12'),_0x235164,_0x9b9564[_0xd44b('0x16')]['message']);return _0x52f742(_0x9b9564[_0xd44b('0x16')]['message']);}logger[_0xd44b('0x16')](_0xd44b('0x12'),_0x235164,_0x9b9564[_0xd44b('0x16')][_0xd44b('0x18')]);return _0x2d21dc(_0x9b9564[_0xd44b('0x16')][_0xd44b('0x18')]);}else{logger[_0xd44b('0x11')](_0xd44b('0x12'),_0x235164,'request\x20sent');_0x2d21dc(_0x9b9564[_0xd44b('0x19')][_0xd44b('0x18')]);}})[_0xd44b('0x1a')](function(_0x4521e7){logger[_0xd44b('0x16')](_0xd44b('0x12'),_0x235164,_0x4521e7);_0x52f742(_0x4521e7);});});}exports[_0xd44b('0x1b')]=function(_0x1d8571){var _0x119c03=this;return new Promise(function(_0x5c7699,_0x356030){return db[_0xd44b('0x1c')][_0xd44b('0x1d')]({'raw':_0x1d8571[_0xd44b('0x1e')]?_0x1d8571[_0xd44b('0x1e')][_0xd44b('0x1f')]===undefined?!![]:![]:!![],'where':_0x1d8571[_0xd44b('0x1e')]?_0x1d8571[_0xd44b('0x1e')][_0xd44b('0x20')]||null:null,'attributes':_0x1d8571[_0xd44b('0x1e')]?_0x1d8571[_0xd44b('0x1e')][_0xd44b('0x21')]||null:null,'limit':_0x1d8571['options']?_0x1d8571[_0xd44b('0x1e')][_0xd44b('0x22')]||null:null,'include':_0x1d8571['options']?_0x1d8571[_0xd44b('0x1e')][_0xd44b('0x23')]?_[_0xd44b('0x24')](_0x1d8571[_0xd44b('0x1e')][_0xd44b('0x23')],function(_0x21eca3){return{'model':db[_0x21eca3['model']],'as':_0x21eca3['as'],'attributes':_0x21eca3[_0xd44b('0x21')],'include':_0x21eca3['include']?_[_0xd44b('0x24')](_0x21eca3['include'],function(_0x575cf7){return{'model':db[_0x575cf7[_0xd44b('0x25')]],'as':_0x575cf7['as'],'attributes':_0x575cf7[_0xd44b('0x21')],'include':_0x575cf7['include']?_[_0xd44b('0x24')](_0x575cf7[_0xd44b('0x23')],function(_0x369edc){return{'model':db[_0x369edc[_0xd44b('0x25')]],'as':_0x369edc['as'],'attributes':_0x369edc[_0xd44b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd44b('0x10')](function(_0x4579e1){logger[_0xd44b('0x11')]('GetUser',_0x1d8571);logger['debug'](_0xd44b('0x1b'),_0x1d8571,JSON['stringify'](_0x4579e1));_0x5c7699(_0x4579e1);})[_0xd44b('0x1a')](function(_0x4e338f){logger[_0xd44b('0x16')](_0xd44b('0x1b'),_0x4e338f['message'],_0x1d8571);_0x356030(_0x119c03[_0xd44b('0x16')](0x1f4,_0x4e338f[_0xd44b('0x18')]));});});};exports[_0xd44b('0x26')]=function(_0x50ecef){var _0x704746=this;return new Promise(function(_0x20df0d,_0x466621){return db[_0xd44b('0x1c')][_0xd44b('0x27')]({'raw':_0x50ecef[_0xd44b('0x1e')]?_0x50ecef[_0xd44b('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x50ecef[_0xd44b('0x1e')]?_0x50ecef[_0xd44b('0x1e')]['where']||null:null,'attributes':_0x50ecef['options']?_0x50ecef['options'][_0xd44b('0x21')]||null:null,'include':_0x50ecef[_0xd44b('0x1e')]?_0x50ecef['options']['include']?_['map'](_0x50ecef[_0xd44b('0x1e')][_0xd44b('0x23')],function(_0x5c2e7b){return{'model':db[_0x5c2e7b['model']],'as':_0x5c2e7b['as'],'attributes':_0x5c2e7b[_0xd44b('0x21')],'include':_0x5c2e7b[_0xd44b('0x23')]?_[_0xd44b('0x24')](_0x5c2e7b[_0xd44b('0x23')],function(_0x2419e2){return{'model':db[_0x2419e2[_0xd44b('0x25')]],'as':_0x2419e2['as'],'attributes':_0x2419e2[_0xd44b('0x21')],'include':_0x2419e2[_0xd44b('0x23')]?_[_0xd44b('0x24')](_0x2419e2[_0xd44b('0x23')],function(_0x46270c){return{'model':db[_0x46270c[_0xd44b('0x25')]],'as':_0x46270c['as'],'attributes':_0x46270c[_0xd44b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd44b('0x10')](function(_0x1deba6){logger[_0xd44b('0x11')](_0xd44b('0x26'),_0x50ecef);logger[_0xd44b('0x14')](_0xd44b('0x26'),_0x50ecef,JSON[_0xd44b('0x28')](_0x1deba6));_0x20df0d(_0x1deba6);})[_0xd44b('0x1a')](function(_0x28edc2){logger[_0xd44b('0x16')]('ShowUser',_0x28edc2[_0xd44b('0x18')],_0x50ecef);_0x466621(_0x704746['error'](0x1f4,_0x28edc2[_0xd44b('0x18')]));});});};exports['PauseUser']=function(_0x2c8a08){var _0x44cb97=this;return new Promise(function(_0x1f30d6,_0x34ca71){var _0x9e9ddc;return db['User'][_0xd44b('0x27')]({'where':_0x2c8a08[_0xd44b('0x1e')][_0xd44b('0x20')]||{},'attributes':['id',_0xd44b('0x29'),_0xd44b('0x2a'),_0xd44b('0x2b'),_0xd44b('0x2c')]})[_0xd44b('0x10')](function(_0x38d317){if(_0x38d317){_0x9e9ddc=_0x38d317;return db[_0xd44b('0x2d')][_0xd44b('0x2e')]({'paused':0x1},{'where':{'UserId':_0x9e9ddc['id']},'individualHooks':!![]});}})[_0xd44b('0x10')](function(){if(_0x9e9ddc){return db[_0xd44b('0x2f')][_0xd44b('0x1d')]({'where':{'membername':_0x9e9ddc[_0xd44b('0x29')],'type':_0xd44b('0x30'),'exitAt':null}});}})[_0xd44b('0x10')](function(_0x4ed601){if(_0x9e9ddc){if(_0x4ed601&&_0x4ed601[_0xd44b('0x31')]){var _0x3ad66d=moment()[_0xd44b('0x32')](_0xd44b('0x33'));for(var _0x46e5cf=0x0,_0x5eaadd=_0x4ed601['length'];_0x46e5cf<_0x5eaadd;_0x46e5cf++){_0x4ed601[_0x46e5cf][_0xd44b('0x34')]({'exitAt':_0x3ad66d});}}}})['then'](function(){if(_0x9e9ddc){var _0x46a06e=[];var _0x3e0862=utils[_0xd44b('0x35')]();_0x3e0862[_0xd44b('0x36')](function(_0xf220b5){_0x46a06e[_0xd44b('0x37')]({'channel':_0xf220b5,'membername':_0x9e9ddc[_0xd44b('0x29')],'interface':_[_0xd44b('0x38')](_0x9e9ddc[_0xd44b('0x2c')])?util[_0xd44b('0x32')](_0xd44b('0x39'),_0x9e9ddc[_0xd44b('0x29')]):_0x9e9ddc[_0xd44b('0x2c')],'type':'PAUSE','enterAt':moment()['format'](_0xd44b('0x33')),'data1':_0x2c8a08['body'][_0xd44b('0x3a')]||_0xd44b('0x3b'),'role':_0x9e9ddc[_0xd44b('0x2a')],'internal':_0x9e9ddc['internal'],'uniqueid':_0x2c8a08[_0xd44b('0x3c')][_0xd44b('0x3d')]||null});});return db[_0xd44b('0x2f')][_0xd44b('0x3e')](_0x46a06e,{'individualHooks':!![]});}})[_0xd44b('0x10')](function(){if(_0x9e9ddc){return _0x9e9ddc[_0xd44b('0x2e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2c8a08['body'][_0xd44b('0x3a')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xd44b('0x33'))});}})['then'](function(_0x181b78){_0x1f30d6(_0x181b78);})[_0xd44b('0x1a')](function(_0x3ffaee){_0x34ca71(_0x44cb97[_0xd44b('0x16')](0x1f4,_0x3ffaee[_0xd44b('0x18')]));});});};exports[_0xd44b('0x3f')]=function(_0x5a67e5){var _0x5aa82b=this;return new Promise(function(_0x359363,_0x5730fe){var _0x4f707f;return db[_0xd44b('0x1c')][_0xd44b('0x40')]({'where':_0x5a67e5['options']['where']||{},'attributes':['id',_0xd44b('0x29')]})[_0xd44b('0x10')](function(_0x3201d6){if(_0x3201d6){_0x4f707f=_0x3201d6;if(_0x5a67e5[_0xd44b('0x3c')][_0xd44b('0x41')]&&!utils[_0xd44b('0x42')](_0x5a67e5[_0xd44b('0x3c')][_0xd44b('0x41')])){throw new Error('Unknown\x20channel');}switch(_0x5a67e5[_0xd44b('0x3c')]['channel']){case _0xd44b('0x43'):return db[_0xd44b('0x2d')][_0xd44b('0x2e')]({'paused':0x0},{'where':{'UserId':_0x4f707f['id']}})['then'](function(){return db[_0xd44b('0x2f')][_0xd44b('0x27')]({'where':{'channel':_0x5a67e5[_0xd44b('0x3c')][_0xd44b('0x41')],'membername':_0x4f707f[_0xd44b('0x29')],'type':'PAUSE','exitAt':null}});})[_0xd44b('0x10')](function(_0x14df8a){if(_0x14df8a){return _0x14df8a[_0xd44b('0x2e')]({'exitAt':moment()[_0xd44b('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xd44b('0x44')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x4f707f[_0xd44b('0x2e')]({'voicePause':![]});});case _0xd44b('0x45'):case _0xd44b('0x46'):case _0xd44b('0x47'):case _0xd44b('0x48'):case _0xd44b('0x49'):case _0xd44b('0x4a'):return db['MemberReport'][_0xd44b('0x27')]({'where':{'channel':_0x5a67e5[_0xd44b('0x3c')][_0xd44b('0x41')],'membername':_0x4f707f[_0xd44b('0x29')],'type':'PAUSE','exitAt':null}})[_0xd44b('0x10')](function(_0x57f184){return _0x57f184[_0xd44b('0x2e')]({'exitAt':moment()[_0xd44b('0x32')](_0xd44b('0x33')),'data2':_0xd44b('0x44')},{'individualHooks':!![]});})[_0xd44b('0x10')](function(){var _0x340e55={};_['set'](_0x340e55,util[_0xd44b('0x32')]('%s%s',_0x5a67e5[_0xd44b('0x3c')][_0xd44b('0x41')],'Pause'),![]);return _0x4f707f['update'](_0x340e55);});default:return db['UserVoiceQueueRt'][_0xd44b('0x2e')]({'paused':0x0},{'where':{'UserId':_0x4f707f['id']}})['then'](function(){return db['MemberReport'][_0xd44b('0x1d')]({'where':{'membername':_0x4f707f[_0xd44b('0x29')],'type':_0xd44b('0x30'),'exitAt':null}});})[_0xd44b('0x10')](function(_0x1aaa6c){var _0xfdbf5c=[];_0x1aaa6c[_0xd44b('0x36')](function(_0x2ca943){_0xfdbf5c[_0xd44b('0x37')](_0x2ca943[_0xd44b('0x2e')]({'exitAt':moment()[_0xd44b('0x32')](_0xd44b('0x33')),'data2':_0xd44b('0x44')}));});return BPromise[_0xd44b('0x4b')](_0xfdbf5c);})[_0xd44b('0x10')](function(){return _0x4f707f[_0xd44b('0x2e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xd44b('0x10')](function(_0x21c48d){_0x359363(_0x21c48d);})[_0xd44b('0x1a')](function(_0x2546d0){_0x5730fe(_0x5aa82b[_0xd44b('0x16')](0x1f4,_0x2546d0[_0xd44b('0x18')]));});});};exports[_0xd44b('0x4c')]=function(_0xa2362c){var _0x110f8f=this;return new Promise(function(_0x391290,_0x417260){var _0x1b874f;return db[_0xd44b('0x1c')][_0xd44b('0x40')]({'where':_0xa2362c[_0xd44b('0x1e')][_0xd44b('0x20')]||{},'attributes':['id',_0xd44b('0x29')]})[_0xd44b('0x10')](function(_0x2030cd){if(_0x2030cd){_0x1b874f=_0x2030cd;return db[_0xd44b('0x2d')]['destroy']({'where':{'membername':_0x1b874f[_0xd44b('0x29')]},'individualHooks':!![]});}})[_0xd44b('0x10')](function(){if(_0x1b874f){return db[_0xd44b('0x2f')]['findAll']({'where':{'membername':_0x1b874f['name'],'exitAt':null}});}})[_0xd44b('0x10')](function(_0x3fa647){if(_0x1b874f){if(_0x3fa647&&_0x3fa647[_0xd44b('0x31')]){var _0x463a1a=[];_0x3fa647[_0xd44b('0x36')](function(_0x45c971){_0x463a1a['push'](_0x45c971[_0xd44b('0x2e')]({'exitAt':moment()[_0xd44b('0x32')](_0xd44b('0x33'))}));});return BPromise[_0xd44b('0x4b')](_0x463a1a);}}})[_0xd44b('0x10')](function(){if(_0x1b874f){return _0x1b874f[_0xd44b('0x2e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd44b('0x10')](function(_0x23cb64){_0x391290(_0x23cb64);})[_0xd44b('0x1a')](function(_0x35d967){_0x417260(_0x110f8f['error'](0x1f4,_0x35d967[_0xd44b('0x18')]));});});};exports[_0xd44b('0x4d')]=function(_0x497d58){var _0x4e0aae=this;return new Promise(function(_0x495228,_0x3b7bc9){var _0xb6e880;var _0x49fbf9;var _0x3c422d;var _0x5eb40a;return db[_0xd44b('0x1c')]['findOne']({'where':_0x497d58[_0xd44b('0x1e')][_0xd44b('0x20')]||{},'attributes':['id',_0xd44b('0x29'),_0xd44b('0x2a'),_0xd44b('0x4e'),_0xd44b('0x4f'),_0xd44b('0x2b'),'loginInPause','interface']})[_0xd44b('0x10')](function(_0x585aad){if(_0x585aad){_0xb6e880=_0x585aad;_0x5eb40a=_0x497d58[_0xd44b('0x3c')][_0xd44b('0x2c')]?_0x497d58[_0xd44b('0x3c')][_0xd44b('0x2c')]:util[_0xd44b('0x32')]('SIP/%s',_0xb6e880[_0xd44b('0x29')]);return db[_0xd44b('0x1c')]['count']({'where':{'role':_0xd44b('0x50'),'online':!![],'id':{'$ne':_0xb6e880['id']}}});}})[_0xd44b('0x10')](function(_0xb3f5aa){if(_0xb3f5aa){_0x3c422d=_0xb3f5aa;return require(_0xd44b('0x51'))[_0xd44b('0x52')]();}})[_0xd44b('0x10')](function(_0x2b0417){if(_0x2b0417&&_0x2b0417[_0xd44b('0x53')]&&_0x3c422d>=_0x2b0417[_0xd44b('0x53')]){throw new Error(_0xd44b('0x54'));}})[_0xd44b('0x10')](function(){if(_0xb6e880){return db[_0xd44b('0x2d')]['destroy']({'where':{'membername':_0xb6e880[_0xd44b('0x29')]},'individualHooks':!![]});}})[_0xd44b('0x10')](function(){if(_0xb6e880){return _0xb6e880[_0xd44b('0x55')]({'raw':!![]});}})[_0xd44b('0x10')](function(_0x57dc30){if(_0xb6e880){if(_0x57dc30){var _0x51dac5=[];_0x49fbf9=_0x57dc30;if(_0x49fbf9[_0xd44b('0x31')]){for(var _0x50be73=0x0;_0x50be73<_0x49fbf9[_0xd44b('0x31')];_0x50be73++){_0x51dac5[_0xd44b('0x37')](db['UserVoiceQueueRt'][_0xd44b('0x56')]({'membername':_0xb6e880[_0xd44b('0x29')],'UserId':_0xb6e880['id'],'queue_name':_0x49fbf9[_0x50be73]['name'],'VoiceQueueId':_0x49fbf9[_0x50be73]['id'],'interface':_0x5eb40a,'paused':_0xb6e880[_0xd44b('0x57')]||![],'penalty':_0x49fbf9[_0x50be73][_0xd44b('0x58')]||0x0}));}return BPromise['all'](_0x51dac5);}}}})[_0xd44b('0x10')](function(){if(_0xb6e880){return db[_0xd44b('0x2f')][_0xd44b('0x1d')]({'where':{'membername':_0xb6e880[_0xd44b('0x29')],'exitAt':null}});}})[_0xd44b('0x10')](function(_0x3dea41){if(_0xb6e880){if(_0x3dea41&&_0x3dea41['length']){var _0x3b738e=[];_0x3dea41['forEach'](function(_0x5e6024){_0x3b738e[_0xd44b('0x37')](_0x5e6024[_0xd44b('0x2e')]({'exitAt':moment()[_0xd44b('0x32')](_0xd44b('0x33'))}));});return BPromise[_0xd44b('0x4b')](_0x3b738e);}}})[_0xd44b('0x10')](function(_0x397afa){if(_0xb6e880){var _0x3bc48a=[];var _0x2b0d39=[];var _0x514941=utils[_0xd44b('0x35')]();var _0x5ccd40={'membername':_0xb6e880[_0xd44b('0x29')],'interface':_0x5eb40a,'enterAt':moment()[_0xd44b('0x32')](_0xd44b('0x33')),'role':_0xb6e880[_0xd44b('0x2a')],'internal':_0xb6e880[_0xd44b('0x2b')]};_0x514941[_0xd44b('0x36')](function(_0x6d53d3){_0x3bc48a[_0xd44b('0x37')](_[_0xd44b('0x59')]({'channel':_0x6d53d3,'type':_0xd44b('0x5a'),'data1':_0xd44b('0x5b'),'data2':_0x5eb40a},_0x5ccd40));if(_0xb6e880[_0xd44b('0x57')]){_0x2b0d39[_0xd44b('0x37')](_['merge']({'channel':_0x6d53d3,'type':_0xd44b('0x30'),'data1':_0xd44b('0x5c')},_0x5ccd40));}});return db[_0xd44b('0x2f')][_0xd44b('0x3e')](_0x3bc48a[_0xd44b('0x5d')](_0x2b0d39),{'individualHooks':!![]});}})['then'](function(){if(_0xb6e880){return _0xb6e880[_0xd44b('0x2e')]({'online':!![],'lastLoginAt':moment()['format'](_0xd44b('0x33')),'voicePause':_0xb6e880[_0xd44b('0x57')]||![],'mailPause':_0xb6e880[_0xd44b('0x57')]||![],'chatPause':_0xb6e880[_0xd44b('0x57')]||![],'faxPause':_0xb6e880['loginInPause']||![],'smsPause':_0xb6e880[_0xd44b('0x57')]||![],'openchannelPause':_0xb6e880['loginInPause']||![],'pauseType':_0xb6e880[_0xd44b('0x57')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x5eb40a});}})['then'](function(_0x30792f){_0x495228(_0x30792f);})[_0xd44b('0x1a')](function(_0x5b2603){_0x3b7bc9(_0x4e0aae['error'](0x1f4,_0x5b2603[_0xd44b('0x18')]));});});};
\ No newline at end of file
+var _0xd029=['%s%s','forEach','all','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','count','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','callysquare','LOGININPAUSE','concat','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','./user.socket','request','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','include','map','model','then','stringify','ShowUser','find','name','role','internal','interface','UserVoiceQueueRt','MemberReport','length','getChannels','push','isNil','format','SIP/%s','PAUSE','body','type','uniqueid','bulkCreate','update','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','YYYY-MM-DD\x20HH:mm:ss','system','mail','chat','fax','sms','whatsapp','set'];(function(_0x5af956,_0x2f1b1f){var _0x20e4b8=function(_0x512c99){while(--_0x512c99){_0x5af956['push'](_0x5af956['shift']());}};_0x20e4b8(++_0x2f1b1f);}(_0xd029,0xc1));var _0x9d02=function(_0x54d581,_0x2b61f3){_0x54d581=_0x54d581-0x0;var _0x344aea=_0xd029[_0x54d581];return _0x344aea;};'use strict';var _=require(_0x9d02('0x0'));var util=require(_0x9d02('0x1'));var moment=require(_0x9d02('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d02('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d02('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9d02('0x5'));var config=require(_0x9d02('0x6'));var jayson=require(_0x9d02('0x7'));var client=jayson['client'][_0x9d02('0x8')]({'port':0x232a});config[_0x9d02('0x9')]=_[_0x9d02('0xa')](config[_0x9d02('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9d02('0xb'))['register'](socket);function respondWithRpcPromise(_0x3ff5b3,_0x1d1881,_0x9b2cc7){return new BPromise(function(_0x51938e,_0x390b69){return client[_0x9d02('0xc')](_0x3ff5b3,_0x9b2cc7)['then'](function(_0x3857e2){logger[_0x9d02('0xd')](_0x9d02('0xe'),_0x1d1881,'request\x20sent');logger[_0x9d02('0xf')](_0x9d02('0x10'),_0x1d1881,_0x9d02('0x11'),JSON['stringify'](_0x3857e2));if(_0x3857e2[_0x9d02('0x12')]){if(_0x3857e2[_0x9d02('0x12')]['code']===0x1f4){logger[_0x9d02('0x12')](_0x9d02('0xe'),_0x1d1881,_0x3857e2[_0x9d02('0x12')][_0x9d02('0x13')]);return _0x390b69(_0x3857e2[_0x9d02('0x12')][_0x9d02('0x13')]);}logger[_0x9d02('0x12')](_0x9d02('0xe'),_0x1d1881,_0x3857e2[_0x9d02('0x12')][_0x9d02('0x13')]);return _0x51938e(_0x3857e2['error'][_0x9d02('0x13')]);}else{logger[_0x9d02('0xd')](_0x9d02('0xe'),_0x1d1881,_0x9d02('0x11'));_0x51938e(_0x3857e2[_0x9d02('0x14')][_0x9d02('0x13')]);}})[_0x9d02('0x15')](function(_0x33befe){logger[_0x9d02('0x12')](_0x9d02('0xe'),_0x1d1881,_0x33befe);_0x390b69(_0x33befe);});});}exports[_0x9d02('0x16')]=function(_0x404b85){var _0x37c3ae=this;return new Promise(function(_0x1ad566,_0x4f6544){return db[_0x9d02('0x17')][_0x9d02('0x18')]({'raw':_0x404b85['options']?_0x404b85[_0x9d02('0x19')][_0x9d02('0x1a')]===undefined?!![]:![]:!![],'where':_0x404b85[_0x9d02('0x19')]?_0x404b85[_0x9d02('0x19')][_0x9d02('0x1b')]||null:null,'attributes':_0x404b85[_0x9d02('0x19')]?_0x404b85[_0x9d02('0x19')][_0x9d02('0x1c')]||null:null,'limit':_0x404b85[_0x9d02('0x19')]?_0x404b85['options']['limit']||null:null,'include':_0x404b85[_0x9d02('0x19')]?_0x404b85['options'][_0x9d02('0x1d')]?_[_0x9d02('0x1e')](_0x404b85[_0x9d02('0x19')][_0x9d02('0x1d')],function(_0x12af53){return{'model':db[_0x12af53['model']],'as':_0x12af53['as'],'attributes':_0x12af53['attributes'],'include':_0x12af53['include']?_['map'](_0x12af53[_0x9d02('0x1d')],function(_0x1c6604){return{'model':db[_0x1c6604[_0x9d02('0x1f')]],'as':_0x1c6604['as'],'attributes':_0x1c6604[_0x9d02('0x1c')],'include':_0x1c6604[_0x9d02('0x1d')]?_[_0x9d02('0x1e')](_0x1c6604[_0x9d02('0x1d')],function(_0x1426dd){return{'model':db[_0x1426dd[_0x9d02('0x1f')]],'as':_0x1426dd['as'],'attributes':_0x1426dd[_0x9d02('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9d02('0x20')](function(_0x3d89a5){logger[_0x9d02('0xd')](_0x9d02('0x16'),_0x404b85);logger[_0x9d02('0xf')](_0x9d02('0x16'),_0x404b85,JSON[_0x9d02('0x21')](_0x3d89a5));_0x1ad566(_0x3d89a5);})[_0x9d02('0x15')](function(_0x279749){logger[_0x9d02('0x12')](_0x9d02('0x16'),_0x279749[_0x9d02('0x13')],_0x404b85);_0x4f6544(_0x37c3ae[_0x9d02('0x12')](0x1f4,_0x279749[_0x9d02('0x13')]));});});};exports[_0x9d02('0x22')]=function(_0x58e9a1){var _0x1aa6e4=this;return new Promise(function(_0x129187,_0x2b9525){return db[_0x9d02('0x17')]['find']({'raw':_0x58e9a1['options']?_0x58e9a1[_0x9d02('0x19')][_0x9d02('0x1a')]===undefined?!![]:![]:!![],'where':_0x58e9a1[_0x9d02('0x19')]?_0x58e9a1[_0x9d02('0x19')][_0x9d02('0x1b')]||null:null,'attributes':_0x58e9a1[_0x9d02('0x19')]?_0x58e9a1[_0x9d02('0x19')][_0x9d02('0x1c')]||null:null,'include':_0x58e9a1[_0x9d02('0x19')]?_0x58e9a1[_0x9d02('0x19')]['include']?_[_0x9d02('0x1e')](_0x58e9a1[_0x9d02('0x19')][_0x9d02('0x1d')],function(_0x590059){return{'model':db[_0x590059[_0x9d02('0x1f')]],'as':_0x590059['as'],'attributes':_0x590059[_0x9d02('0x1c')],'include':_0x590059[_0x9d02('0x1d')]?_[_0x9d02('0x1e')](_0x590059[_0x9d02('0x1d')],function(_0x47771c){return{'model':db[_0x47771c['model']],'as':_0x47771c['as'],'attributes':_0x47771c[_0x9d02('0x1c')],'include':_0x47771c[_0x9d02('0x1d')]?_[_0x9d02('0x1e')](_0x47771c[_0x9d02('0x1d')],function(_0x3db18b){return{'model':db[_0x3db18b[_0x9d02('0x1f')]],'as':_0x3db18b['as'],'attributes':_0x3db18b['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d02('0x20')](function(_0x37238a){logger[_0x9d02('0xd')](_0x9d02('0x22'),_0x58e9a1);logger[_0x9d02('0xf')](_0x9d02('0x22'),_0x58e9a1,JSON[_0x9d02('0x21')](_0x37238a));_0x129187(_0x37238a);})[_0x9d02('0x15')](function(_0x1ec20d){logger[_0x9d02('0x12')](_0x9d02('0x22'),_0x1ec20d['message'],_0x58e9a1);_0x2b9525(_0x1aa6e4['error'](0x1f4,_0x1ec20d[_0x9d02('0x13')]));});});};exports['PauseUser']=function(_0x4e5cda){var _0x110139=this;return new Promise(function(_0x5342bf,_0x19694f){var _0x214e2c;return db[_0x9d02('0x17')][_0x9d02('0x23')]({'where':_0x4e5cda[_0x9d02('0x19')][_0x9d02('0x1b')]||{},'attributes':['id',_0x9d02('0x24'),_0x9d02('0x25'),_0x9d02('0x26'),_0x9d02('0x27')]})[_0x9d02('0x20')](function(_0x2fcc35){if(_0x2fcc35){_0x214e2c=_0x2fcc35;return db[_0x9d02('0x28')]['update']({'paused':0x1},{'where':{'UserId':_0x214e2c['id']},'individualHooks':!![]});}})[_0x9d02('0x20')](function(){if(_0x214e2c){return db[_0x9d02('0x29')][_0x9d02('0x18')]({'where':{'membername':_0x214e2c['name'],'type':'PAUSE','exitAt':null}});}})[_0x9d02('0x20')](function(_0x348473){if(_0x214e2c){if(_0x348473&&_0x348473['length']){var _0x223080=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3be43e=0x0,_0x503091=_0x348473[_0x9d02('0x2a')];_0x3be43e<_0x503091;_0x3be43e++){_0x348473[_0x3be43e]['updateAttributes']({'exitAt':_0x223080});}}}})[_0x9d02('0x20')](function(){if(_0x214e2c){var _0x5b7606=[];var _0x47b341=utils[_0x9d02('0x2b')]();_0x47b341['forEach'](function(_0x122c79){_0x5b7606[_0x9d02('0x2c')]({'channel':_0x122c79,'membername':_0x214e2c[_0x9d02('0x24')],'interface':_[_0x9d02('0x2d')](_0x214e2c[_0x9d02('0x27')])?util[_0x9d02('0x2e')](_0x9d02('0x2f'),_0x214e2c[_0x9d02('0x24')]):_0x214e2c['interface'],'type':_0x9d02('0x30'),'enterAt':moment()[_0x9d02('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4e5cda[_0x9d02('0x31')][_0x9d02('0x32')]||'DEFAULT\x20PAUSE','role':_0x214e2c[_0x9d02('0x25')],'internal':_0x214e2c[_0x9d02('0x26')],'uniqueid':_0x4e5cda['body'][_0x9d02('0x33')]||null});});return db['MemberReport'][_0x9d02('0x34')](_0x5b7606,{'individualHooks':!![]});}})['then'](function(){if(_0x214e2c){return _0x214e2c[_0x9d02('0x35')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4e5cda['body'][_0x9d02('0x32')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x9d02('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x9d02('0x20')](function(_0x104e74){_0x5342bf(_0x104e74);})[_0x9d02('0x15')](function(_0x4ebfc2){_0x19694f(_0x110139[_0x9d02('0x12')](0x1f4,_0x4ebfc2[_0x9d02('0x13')]));});});};exports[_0x9d02('0x36')]=function(_0x41acba){var _0x36f55c=this;return new Promise(function(_0x2b8a64,_0x139c5b){var _0x993436;return db[_0x9d02('0x17')][_0x9d02('0x37')]({'where':_0x41acba[_0x9d02('0x19')][_0x9d02('0x1b')]||{},'attributes':['id',_0x9d02('0x24')]})[_0x9d02('0x20')](function(_0x21eb8a){if(_0x21eb8a){_0x993436=_0x21eb8a;if(_0x41acba['body'][_0x9d02('0x38')]&&!utils[_0x9d02('0x39')](_0x41acba[_0x9d02('0x31')][_0x9d02('0x38')])){throw new Error(_0x9d02('0x3a'));}switch(_0x41acba[_0x9d02('0x31')]['channel']){case _0x9d02('0x3b'):return db[_0x9d02('0x28')][_0x9d02('0x35')]({'paused':0x0},{'where':{'UserId':_0x993436['id']}})[_0x9d02('0x20')](function(){return db[_0x9d02('0x29')][_0x9d02('0x23')]({'where':{'channel':_0x41acba[_0x9d02('0x31')][_0x9d02('0x38')],'membername':_0x993436['name'],'type':_0x9d02('0x30'),'exitAt':null}});})[_0x9d02('0x20')](function(_0x558290){if(_0x558290){return _0x558290[_0x9d02('0x35')]({'exitAt':moment()[_0x9d02('0x2e')](_0x9d02('0x3c')),'data2':_0x9d02('0x3d')},{'individualHooks':!![]});}return null;})[_0x9d02('0x20')](function(){return _0x993436[_0x9d02('0x35')]({'voicePause':![]});});case _0x9d02('0x3e'):case _0x9d02('0x3f'):case _0x9d02('0x40'):case _0x9d02('0x41'):case'openchannel':case _0x9d02('0x42'):return db[_0x9d02('0x29')][_0x9d02('0x23')]({'where':{'channel':_0x41acba[_0x9d02('0x31')][_0x9d02('0x38')],'membername':_0x993436['name'],'type':_0x9d02('0x30'),'exitAt':null}})['then'](function(_0x59eba8){return _0x59eba8[_0x9d02('0x35')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x9d02('0x3d')},{'individualHooks':!![]});})[_0x9d02('0x20')](function(){var _0x304d13={};_[_0x9d02('0x43')](_0x304d13,util[_0x9d02('0x2e')](_0x9d02('0x44'),_0x41acba[_0x9d02('0x31')][_0x9d02('0x38')],'Pause'),![]);return _0x993436[_0x9d02('0x35')](_0x304d13);});default:return db[_0x9d02('0x28')][_0x9d02('0x35')]({'paused':0x0},{'where':{'UserId':_0x993436['id']}})[_0x9d02('0x20')](function(){return db['MemberReport'][_0x9d02('0x18')]({'where':{'membername':_0x993436[_0x9d02('0x24')],'type':_0x9d02('0x30'),'exitAt':null}});})['then'](function(_0x498a5a){var _0x176c7=[];_0x498a5a[_0x9d02('0x45')](function(_0x2a3514){_0x176c7[_0x9d02('0x2c')](_0x2a3514['update']({'exitAt':moment()[_0x9d02('0x2e')](_0x9d02('0x3c')),'data2':_0x9d02('0x3d')}));});return BPromise[_0x9d02('0x46')](_0x176c7);})[_0x9d02('0x20')](function(){return _0x993436['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x9d02('0x20')](function(_0x1dc252){_0x2b8a64(_0x1dc252);})['catch'](function(_0x563892){_0x139c5b(_0x36f55c[_0x9d02('0x12')](0x1f4,_0x563892[_0x9d02('0x13')]));});});};exports[_0x9d02('0x47')]=function(_0x2e1279){var _0x17d6e3=this;return new Promise(function(_0x40700b,_0x2cf09c){var _0x25287c;return db[_0x9d02('0x17')][_0x9d02('0x37')]({'where':_0x2e1279['options'][_0x9d02('0x1b')]||{},'attributes':['id',_0x9d02('0x24')]})[_0x9d02('0x20')](function(_0x48ac27){if(_0x48ac27){_0x25287c=_0x48ac27;return db['UserVoiceQueueRt'][_0x9d02('0x48')]({'where':{'membername':_0x25287c[_0x9d02('0x24')]},'individualHooks':!![]});}})[_0x9d02('0x20')](function(){if(_0x25287c){return db[_0x9d02('0x29')][_0x9d02('0x18')]({'where':{'membername':_0x25287c[_0x9d02('0x24')],'exitAt':null}});}})['then'](function(_0x1ab130){if(_0x25287c){if(_0x1ab130&&_0x1ab130[_0x9d02('0x2a')]){var _0x159616=[];_0x1ab130['forEach'](function(_0x350301){_0x159616[_0x9d02('0x2c')](_0x350301[_0x9d02('0x35')]({'exitAt':moment()[_0x9d02('0x2e')](_0x9d02('0x3c'))}));});return BPromise[_0x9d02('0x46')](_0x159616);}}})[_0x9d02('0x20')](function(){if(_0x25287c){return _0x25287c[_0x9d02('0x35')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x9d02('0x20')](function(_0xd678a7){_0x40700b(_0xd678a7);})[_0x9d02('0x15')](function(_0x25a10a){_0x2cf09c(_0x17d6e3[_0x9d02('0x12')](0x1f4,_0x25a10a['message']));});});};exports[_0x9d02('0x49')]=function(_0x266885){var _0xf3f7d8=this;return new Promise(function(_0x5bf2ea,_0x15dd7a){var _0x95f58c;var _0x27371e;var _0x1d5616;var _0x6a477d;return db[_0x9d02('0x17')]['findOne']({'where':_0x266885[_0x9d02('0x19')][_0x9d02('0x1b')]||{},'attributes':['id',_0x9d02('0x24'),'role',_0x9d02('0x4a'),_0x9d02('0x4b'),_0x9d02('0x26'),_0x9d02('0x4c'),_0x9d02('0x27')]})['then'](function(_0x2cd197){if(_0x2cd197){_0x95f58c=_0x2cd197;_0x6a477d=_0x266885[_0x9d02('0x31')][_0x9d02('0x27')]?_0x266885['body'][_0x9d02('0x27')]:util[_0x9d02('0x2e')](_0x9d02('0x2f'),_0x95f58c['name']);return db[_0x9d02('0x17')][_0x9d02('0x4d')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x95f58c['id']}}});}})[_0x9d02('0x20')](function(_0x5c8310){if(_0x5c8310){_0x1d5616=_0x5c8310;return require('../../config/license/util')[_0x9d02('0x4e')]();}})[_0x9d02('0x20')](function(_0x259f60){if(_0x259f60&&_0x259f60[_0x9d02('0x4f')]&&_0x1d5616>=_0x259f60['agents']){throw new Error(_0x9d02('0x50'));}})[_0x9d02('0x20')](function(){if(_0x95f58c){return db[_0x9d02('0x28')][_0x9d02('0x48')]({'where':{'membername':_0x95f58c['name']},'individualHooks':!![]});}})[_0x9d02('0x20')](function(){if(_0x95f58c){return _0x95f58c[_0x9d02('0x51')]({'raw':!![]});}})[_0x9d02('0x20')](function(_0x2cab47){if(_0x95f58c){if(_0x2cab47){var _0x3c58c9=[];_0x27371e=_0x2cab47;if(_0x27371e['length']){for(var _0x145db9=0x0;_0x145db9<_0x27371e[_0x9d02('0x2a')];_0x145db9++){_0x3c58c9['push'](db['UserVoiceQueueRt'][_0x9d02('0x52')]({'membername':_0x95f58c[_0x9d02('0x24')],'UserId':_0x95f58c['id'],'queue_name':_0x27371e[_0x145db9][_0x9d02('0x24')],'VoiceQueueId':_0x27371e[_0x145db9]['id'],'interface':_0x6a477d,'paused':_0x95f58c[_0x9d02('0x4c')]||![],'penalty':_0x27371e[_0x145db9]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x9d02('0x46')](_0x3c58c9);}}}})[_0x9d02('0x20')](function(){if(_0x95f58c){return db[_0x9d02('0x29')][_0x9d02('0x18')]({'where':{'membername':_0x95f58c['name'],'exitAt':null}});}})[_0x9d02('0x20')](function(_0x16df3d){if(_0x95f58c){if(_0x16df3d&&_0x16df3d[_0x9d02('0x2a')]){var _0x355181=[];_0x16df3d[_0x9d02('0x45')](function(_0x3e2576){_0x355181[_0x9d02('0x2c')](_0x3e2576[_0x9d02('0x35')]({'exitAt':moment()[_0x9d02('0x2e')](_0x9d02('0x3c'))}));});return BPromise['all'](_0x355181);}}})[_0x9d02('0x20')](function(_0x4ae7c4){if(_0x95f58c){var _0xb5da56=[];var _0x155271=[];var _0x2b317f=utils['getChannels']();var _0x4fbc05={'membername':_0x95f58c[_0x9d02('0x24')],'interface':_0x6a477d,'enterAt':moment()[_0x9d02('0x2e')](_0x9d02('0x3c')),'role':_0x95f58c['role'],'internal':_0x95f58c[_0x9d02('0x26')]};_0x2b317f['forEach'](function(_0x53657c){_0xb5da56['push'](_[_0x9d02('0x53')]({'channel':_0x53657c,'type':'LOGIN','data1':_0x9d02('0x54'),'data2':_0x6a477d},_0x4fbc05));if(_0x95f58c[_0x9d02('0x4c')]){_0x155271[_0x9d02('0x2c')](_[_0x9d02('0x53')]({'channel':_0x53657c,'type':'PAUSE','data1':_0x9d02('0x55')},_0x4fbc05));}});return db[_0x9d02('0x29')][_0x9d02('0x34')](_0xb5da56[_0x9d02('0x56')](_0x155271),{'individualHooks':!![]});}})['then'](function(){if(_0x95f58c){return _0x95f58c[_0x9d02('0x35')]({'online':!![],'lastLoginAt':moment()[_0x9d02('0x2e')](_0x9d02('0x3c')),'voicePause':_0x95f58c[_0x9d02('0x4c')]||![],'mailPause':_0x95f58c[_0x9d02('0x4c')]||![],'chatPause':_0x95f58c[_0x9d02('0x4c')]||![],'faxPause':_0x95f58c['loginInPause']||![],'smsPause':_0x95f58c[_0x9d02('0x4c')]||![],'openchannelPause':_0x95f58c[_0x9d02('0x4c')]||![],'pauseType':_0x95f58c[_0x9d02('0x4c')]?_0x9d02('0x55'):null,'lastPauseAt':moment()['format'](_0x9d02('0x3c')),'interface':_0x6a477d});}})[_0x9d02('0x20')](function(_0x11d99c){_0x5bf2ea(_0x11d99c);})[_0x9d02('0x15')](function(_0x28faaa){_0x15dd7a(_0xf3f7d8[_0x9d02('0x12')](0x1f4,_0x28faaa[_0x9d02('0x13')]));});});};
\ No newline at end of file
index 00847bb..c6f6d65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fae=['register','length','./user.events','save','remove','update','emit','removeListener'];(function(_0x1ee5e6,_0x43a622){var _0x40af44=function(_0x47beeb){while(--_0x47beeb){_0x1ee5e6['push'](_0x1ee5e6['shift']());}};_0x40af44(++_0x43a622);}(_0x8fae,0x11a));var _0xe8fa=function(_0x229f4,_0x2ae27f){_0x229f4=_0x229f4-0x0;var _0x32f980=_0x8fae[_0x229f4];return _0x32f980;};'use strict';var UserEvents=require(_0xe8fa('0x0'));var events=[_0xe8fa('0x1'),_0xe8fa('0x2'),_0xe8fa('0x3')];function createListener(_0x5cd6f2,_0x86855a){return function(_0x331a6c){_0x86855a[_0xe8fa('0x4')](_0x5cd6f2,_0x331a6c);};}function removeListener(_0x310d25,_0x16e5bc){return function(){UserEvents[_0xe8fa('0x5')](_0x310d25,_0x16e5bc);};}exports[_0xe8fa('0x6')]=function(_0x286c09){for(var _0x54860d=0x0,_0x14e8c8=events[_0xe8fa('0x7')];_0x54860d<_0x14e8c8;_0x54860d++){var _0x490236=events[_0x54860d];var _0x4b1fbb=createListener('user:'+_0x490236,_0x286c09);UserEvents['on'](_0x490236,_0x4b1fbb);}};
\ No newline at end of file
+var _0x9070=['remove','update','emit','removeListener','register','length','user:','save'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x9070,0x15f));var _0x0907=function(_0x578275,_0xe7ae46){_0x578275=_0x578275-0x0;var _0xf78041=_0x9070[_0x578275];return _0xf78041;};'use strict';var UserEvents=require('./user.events');var events=[_0x0907('0x0'),_0x0907('0x1'),_0x0907('0x2')];function createListener(_0x58a5ab,_0x1a2804){return function(_0x1f849f){_0x1a2804[_0x0907('0x3')](_0x58a5ab,_0x1f849f);};}function removeListener(_0x2d78a2,_0x3de1fe){return function(){UserEvents[_0x0907('0x4')](_0x2d78a2,_0x3de1fe);};}exports[_0x0907('0x5')]=function(_0x1cbaf9){for(var _0x1a5046=0x0,_0x3c4223=events[_0x0907('0x6')];_0x1a5046<_0x3c4223;_0x1a5046++){var _0xdd9b6e=events[_0x1a5046];var _0x152c39=createListener(_0x0907('0x7')+_0xdd9b6e,_0x1cbaf9);UserEvents['on'](_0xdd9b6e,_0x152c39);}};
\ No newline at end of file
index 93f21da..9b23951 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x539610,_0xe3f8e3){var _0x1b1ca2=function(_0x1a664b){while(--_0x1a664b){_0x539610['push'](_0x539610['shift']());}};_0x1b1ca2(++_0xe3f8e3);}(_0xedd9,0xfc));var _0x9edd=function(_0x55c102,_0x4121d0){_0x55c102=_0x55c102-0x0;var _0x7665dd=_0xedd9[_0x55c102];return _0x7665dd;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x21d5f5,_0x427ba3){var _0x3a964a=function(_0x561536){while(--_0x561536){_0x21d5f5['push'](_0x21d5f5['shift']());}};_0x3a964a(++_0x427ba3);}(_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 a6f3091..86d52ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70d1=['INTEGER','exports'];(function(_0x20db6c,_0x4ff24a){var _0x30b5d3=function(_0x1ba9f0){while(--_0x1ba9f0){_0x20db6c['push'](_0x20db6c['shift']());}};_0x30b5d3(++_0x4ff24a);}(_0x70d1,0xbd));var _0x170d=function(_0x485cd4,_0x506e1b){_0x485cd4=_0x485cd4-0x0;var _0x528199=_0x70d1[_0x485cd4];return _0x528199;};'use strict';var Sequelize=require('sequelize');module[_0x170d('0x0')]={'penalty':{'type':Sequelize[_0x170d('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x8e69=['exports','INTEGER','sequelize'];(function(_0x40517b,_0x4127a9){var _0x4d88fd=function(_0x5b5385){while(--_0x5b5385){_0x40517b['push'](_0x40517b['shift']());}};_0x4d88fd(++_0x4127a9);}(_0x8e69,0x1d9));var _0x98e6=function(_0x3e79e4,_0x3c0d30){_0x3e79e4=_0x3e79e4-0x0;var _0x33cc6c=_0x8e69[_0x3e79e4];return _0x33cc6c;};'use strict';var Sequelize=require(_0x98e6('0x0'));module[_0x98e6('0x1')]={'penalty':{'type':Sequelize[_0x98e6('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index f90da5c..a91c172 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d7f=['UserChatQueue','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x4d7f,0x1e7));var _0xf4d7=function(_0x4f43d5,_0x3d777b){_0x4f43d5=_0x4f43d5-0x0;var _0x4af9cd=_0x4d7f[_0x4f43d5];return _0x4af9cd;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf4d7('0x0'));var moment=require(_0xf4d7('0x1'));var BPromise=require(_0xf4d7('0x2'));var rp=require(_0xf4d7('0x3'));var fs=require('fs');var path=require(_0xf4d7('0x4'));var rimraf=require(_0xf4d7('0x5'));var config=require(_0xf4d7('0x6'));var attributes=require('./userChatQueue.attributes');module[_0xf4d7('0x7')]=function(_0x50ea5c,_0x466765){return _0x50ea5c['define'](_0xf4d7('0x8'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfa0e=['path','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','bluebird','request-promise'];(function(_0x72abca,_0x32d5f9){var _0x2ed9c9=function(_0x30b01d){while(--_0x30b01d){_0x72abca['push'](_0x72abca['shift']());}};_0x2ed9c9(++_0x32d5f9);}(_0xfa0e,0x164));var _0xefa0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xfa0e[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xefa0('0x0'));var util=require(_0xefa0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xefa0('0x2'));var rp=require(_0xefa0('0x3'));var fs=require('fs');var path=require(_0xefa0('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0xefa0('0x5')]=function(_0x182cd,_0x47d1b3){return _0x182cd[_0xefa0('0x6')](_0xefa0('0x7'),attributes,{'tableName':_0xefa0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8cffedc..687ecae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x370e=['then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x493a51,_0x45128c){var _0xc85756=function(_0x2c39a8){while(--_0x2c39a8){_0x493a51['push'](_0x493a51['shift']());}};_0xc85756(++_0x45128c);}(_0x370e,0xbb));var _0xe370=function(_0x1bb613,_0x89b101){_0x1bb613=_0x1bb613-0x0;var _0x14de71=_0x370e[_0x1bb613];return _0x14de71;};'use strict';var _=require(_0xe370('0x0'));var util=require(_0xe370('0x1'));var moment=require('moment');var BPromise=require(_0xe370('0x2'));var rs=require(_0xe370('0x3'));var fs=require('fs');var Redis=require(_0xe370('0x4'));var db=require(_0xe370('0x5'))['db'];var utils=require(_0xe370('0x6'));var logger=require(_0xe370('0x7'))(_0xe370('0x8'));var config=require(_0xe370('0x9'));var jayson=require(_0xe370('0xa'));var client=jayson[_0xe370('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53e07b,_0x54bef9,_0x2a6022){return new BPromise(function(_0x21b58d,_0x248bbb){return client[_0xe370('0xc')](_0x53e07b,_0x2a6022)[_0xe370('0xd')](function(_0x820bbd){logger[_0xe370('0xe')](_0xe370('0xf'),_0x54bef9,_0xe370('0x10'));logger[_0xe370('0x11')](_0xe370('0x12'),_0x54bef9,_0xe370('0x10'),JSON[_0xe370('0x13')](_0x820bbd));if(_0x820bbd[_0xe370('0x14')]){if(_0x820bbd['error'][_0xe370('0x15')]===0x1f4){logger[_0xe370('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x54bef9,_0x820bbd[_0xe370('0x14')][_0xe370('0x16')]);return _0x248bbb(_0x820bbd['error'][_0xe370('0x16')]);}logger[_0xe370('0x14')](_0xe370('0xf'),_0x54bef9,_0x820bbd['error'][_0xe370('0x16')]);return _0x21b58d(_0x820bbd['error'][_0xe370('0x16')]);}else{logger[_0xe370('0xe')](_0xe370('0xf'),_0x54bef9,_0xe370('0x10'));_0x21b58d(_0x820bbd[_0xe370('0x17')][_0xe370('0x16')]);}})[_0xe370('0x18')](function(_0x56929f){logger[_0xe370('0x14')](_0xe370('0xf'),_0x54bef9,_0x56929f);_0x248bbb(_0x56929f);});});}
\ No newline at end of file
+var _0xc480=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','../../mysqldb'];(function(_0x3b09a2,_0x1f481b){var _0x78e313=function(_0x102a5d){while(--_0x102a5d){_0x3b09a2['push'](_0x3b09a2['shift']());}};_0x78e313(++_0x1f481b);}(_0xc480,0x176));var _0x0c48=function(_0x425f5f,_0x566e33){_0x425f5f=_0x425f5f-0x0;var _0x4ac89b=_0xc480[_0x425f5f];return _0x4ac89b;};'use strict';var _=require(_0x0c48('0x0'));var util=require('util');var moment=require(_0x0c48('0x1'));var BPromise=require(_0x0c48('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c48('0x3'))['db'];var utils=require(_0x0c48('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0c48('0x5'));var jayson=require(_0x0c48('0x6'));var client=jayson[_0x0c48('0x7')][_0x0c48('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xec9718,_0x539630,_0x36cab1){return new BPromise(function(_0x378c83,_0x174f86){return client[_0x0c48('0x9')](_0xec9718,_0x36cab1)[_0x0c48('0xa')](function(_0x4983ba){logger[_0x0c48('0xb')](_0x0c48('0xc'),_0x539630,_0x0c48('0xd'));logger[_0x0c48('0xe')](_0x0c48('0xf'),_0x539630,_0x0c48('0xd'),JSON[_0x0c48('0x10')](_0x4983ba));if(_0x4983ba['error']){if(_0x4983ba[_0x0c48('0x11')]['code']===0x1f4){logger[_0x0c48('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x539630,_0x4983ba[_0x0c48('0x11')][_0x0c48('0x12')]);return _0x174f86(_0x4983ba['error'][_0x0c48('0x12')]);}logger[_0x0c48('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x539630,_0x4983ba[_0x0c48('0x11')]['message']);return _0x378c83(_0x4983ba[_0x0c48('0x11')][_0x0c48('0x12')]);}else{logger[_0x0c48('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x539630,'request\x20sent');_0x378c83(_0x4983ba[_0x0c48('0x13')][_0x0c48('0x12')]);}})[_0x0c48('0x14')](function(_0x16f5e1){logger[_0x0c48('0x11')](_0x0c48('0xc'),_0x539630,_0x16f5e1);_0x174f86(_0x16f5e1);});});}
\ No newline at end of file
index 67ad8db..8a25db3 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(_0x4f7588,_0x399e6b){var _0x535c70=function(_0x5c2bbb){while(--_0x5c2bbb){_0x4f7588['push'](_0x4f7588['shift']());}};_0x535c70(++_0x399e6b);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'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(_0x427d81,_0x5f1602){var _0x50686a=function(_0x2213d3){while(--_0x2213d3){_0x427d81['push'](_0x427d81['shift']());}};_0x50686a(++_0x5f1602);}(_0xe706,0xa3));var _0x6e70=function(_0x362e87,_0x38d17c){_0x362e87=_0x362e87-0x0;var _0x334244=_0xe706[_0x362e87];return _0x334244;};'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 c2c831b..e11dfbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e43=['INTEGER','STRING','sequelize','exports'];(function(_0x3e2c1e,_0x1e8d40){var _0x1c6666=function(_0x190b73){while(--_0x190b73){_0x3e2c1e['push'](_0x3e2c1e['shift']());}};_0x1c6666(++_0x1e8d40);}(_0x5e43,0x102));var _0x35e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e43[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x35e4('0x0'));module[_0x35e4('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x35e4('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x35e4('0x3')]}};
\ No newline at end of file
+var _0x1a27=['sequelize'];(function(_0x5407d1,_0x1f56b4){var _0x50f916=function(_0x164a50){while(--_0x164a50){_0x5407d1['push'](_0x5407d1['shift']());}};_0x50f916(++_0x1f56b4);}(_0x1a27,0x7b));var _0x71a2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1a27[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x71a2('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 06891c7..dc9c201 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f98=['../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4f98,0x172));var _0x84f9=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x4f98[_0x330723];return _0x60c546;};'use strict';var _=require(_0x84f9('0x0'));var util=require(_0x84f9('0x1'));var logger=require(_0x84f9('0x2'))(_0x84f9('0x3'));var moment=require(_0x84f9('0x4'));var BPromise=require(_0x84f9('0x5'));var rp=require(_0x84f9('0x6'));var fs=require('fs');var path=require(_0x84f9('0x7'));var rimraf=require('rimraf');var config=require(_0x84f9('0x8'));var attributes=require(_0x84f9('0x9'));module[_0x84f9('0xa')]=function(_0x587d6e,_0xdefa57){return _0x587d6e[_0x84f9('0xb')](_0x84f9('0xc'),attributes,{'tableName':_0x84f9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa6a0=['./userFaxQueue.attributes','exports','define','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0xdf1852,_0x148353){var _0x363a81=function(_0x470688){while(--_0x470688){_0xdf1852['push'](_0xdf1852['shift']());}};_0x363a81(++_0x148353);}(_0xa6a0,0x71));var _0x0a6a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa6a0[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x0a6a('0x0'));var logger=require(_0x0a6a('0x1'))(_0x0a6a('0x2'));var moment=require(_0x0a6a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a6a('0x4'));var rimraf=require(_0x0a6a('0x5'));var config=require(_0x0a6a('0x6'));var attributes=require(_0x0a6a('0x7'));module[_0x0a6a('0x8')]=function(_0x1eb653,_0x56e084){return _0x1eb653[_0x0a6a('0x9')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2abf99e..2e0b68d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c50=['../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c50,0x142));var _0x07c5=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x7c50[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x07c5('0x0'));var util=require(_0x07c5('0x1'));var moment=require(_0x07c5('0x2'));var BPromise=require(_0x07c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x07c5('0x4'))['db'];var utils=require(_0x07c5('0x5'));var logger=require(_0x07c5('0x6'))(_0x07c5('0x7'));var config=require(_0x07c5('0x8'));var jayson=require(_0x07c5('0x9'));var client=jayson['client'][_0x07c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x365c19,_0x531e89,_0x156321){return new BPromise(function(_0x2f67d2,_0x28ff68){return client[_0x07c5('0xb')](_0x365c19,_0x156321)[_0x07c5('0xc')](function(_0x1d1ede){logger[_0x07c5('0xd')](_0x07c5('0xe'),_0x531e89,_0x07c5('0xf'));logger[_0x07c5('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x531e89,_0x07c5('0xf'),JSON[_0x07c5('0x11')](_0x1d1ede));if(_0x1d1ede['error']){if(_0x1d1ede[_0x07c5('0x12')][_0x07c5('0x13')]===0x1f4){logger[_0x07c5('0x12')](_0x07c5('0xe'),_0x531e89,_0x1d1ede[_0x07c5('0x12')]['message']);return _0x28ff68(_0x1d1ede['error'][_0x07c5('0x14')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x531e89,_0x1d1ede[_0x07c5('0x12')][_0x07c5('0x14')]);return _0x2f67d2(_0x1d1ede['error']['message']);}else{logger[_0x07c5('0xd')](_0x07c5('0xe'),_0x531e89,_0x07c5('0xf'));_0x2f67d2(_0x1d1ede['result'][_0x07c5('0x14')]);}})[_0x07c5('0x15')](function(_0x3896f4){logger[_0x07c5('0x12')](_0x07c5('0xe'),_0x531e89,_0x3896f4);_0x28ff68(_0x3896f4);});});}
\ No newline at end of file
+var _0x8434=['ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring'];(function(_0x2e6dbf,_0x57dd06){var _0x2680e5=function(_0x4018f4){while(--_0x4018f4){_0x2e6dbf['push'](_0x2e6dbf['shift']());}};_0x2680e5(++_0x57dd06);}(_0x8434,0xce));var _0x4843=function(_0x480685,_0x26fd58){_0x480685=_0x480685-0x0;var _0x498354=_0x8434[_0x480685];return _0x498354;};'use strict';var _=require(_0x4843('0x0'));var util=require(_0x4843('0x1'));var moment=require('moment');var BPromise=require(_0x4843('0x2'));var rs=require(_0x4843('0x3'));var fs=require('fs');var Redis=require(_0x4843('0x4'));var db=require(_0x4843('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4843('0x6'))('rpc');var config=require(_0x4843('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4843('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c9dc0,_0x1e3a49,_0xfc119){return new BPromise(function(_0x4108d1,_0x45684f){return client[_0x4843('0x9')](_0x2c9dc0,_0xfc119)[_0x4843('0xa')](function(_0x14e7da){logger['info'](_0x4843('0xb'),_0x1e3a49,_0x4843('0xc'));logger['debug'](_0x4843('0xd'),_0x1e3a49,_0x4843('0xc'),JSON[_0x4843('0xe')](_0x14e7da));if(_0x14e7da[_0x4843('0xf')]){if(_0x14e7da[_0x4843('0xf')][_0x4843('0x10')]===0x1f4){logger[_0x4843('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x1e3a49,_0x14e7da[_0x4843('0xf')][_0x4843('0x11')]);return _0x45684f(_0x14e7da[_0x4843('0xf')][_0x4843('0x11')]);}logger[_0x4843('0xf')](_0x4843('0xb'),_0x1e3a49,_0x14e7da[_0x4843('0xf')][_0x4843('0x11')]);return _0x4108d1(_0x14e7da[_0x4843('0xf')][_0x4843('0x11')]);}else{logger[_0x4843('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x1e3a49,_0x4843('0xc'));_0x4108d1(_0x14e7da[_0x4843('0x13')][_0x4843('0x11')]);}})[_0x4843('0x14')](function(_0x321944){logger[_0x4843('0xf')](_0x4843('0xb'),_0x1e3a49,_0x321944);_0x45684f(_0x321944);});});}
\ No newline at end of file
index b828b8f..8a9ebb6 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(_0x509f32,_0x1ddd4f){var _0x48be5c=function(_0x249e1c){while(--_0x249e1c){_0x509f32['push'](_0x509f32['shift']());}};_0x48be5c(++_0x1ddd4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x15a202,_0x5aac9a){var _0x54e88c=function(_0x59217a){while(--_0x59217a){_0x15a202['push'](_0x15a202['shift']());}};_0x54e88c(++_0x5aac9a);}(_0x70e0,0x17b));var _0x070e=function(_0x303369,_0x429255){_0x303369=_0x303369-0x0;var _0xe59c58=_0x70e0[_0x303369];return _0xe59c58;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index 829a81a..eab6446 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff00=['exports','sequelize'];(function(_0x27433f,_0x77c15f){var _0xf0668f=function(_0x3001c8){while(--_0x3001c8){_0x27433f['push'](_0x27433f['shift']());}};_0xf0668f(++_0x77c15f);}(_0xff00,0x1e9));var _0x0ff0=function(_0x375be8,_0x4ab8a7){_0x375be8=_0x375be8-0x0;var _0x87cf61=_0xff00[_0x375be8];return _0x87cf61;};'use strict';var Sequelize=require(_0x0ff0('0x0'));module[_0x0ff0('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xdb1a=['sequelize','exports','INTEGER'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xdb1a,0x1bf));var _0xadb1=function(_0x352a99,_0x204276){_0x352a99=_0x352a99-0x0;var _0x197e9f=_0xdb1a[_0x352a99];return _0x197e9f;};'use strict';var Sequelize=require(_0xadb1('0x0'));module[_0xadb1('0x1')]={'penalty':{'type':Sequelize[_0xadb1('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index bbe390b..144b553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb84c=['request-promise','path','../../config/environment','./userMailQueue.attributes','UserMailQueue','user_has_mail_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x21ae3a,_0x330ac6){var _0x20af7a=function(_0x14480b){while(--_0x14480b){_0x21ae3a['push'](_0x21ae3a['shift']());}};_0x20af7a(++_0x330ac6);}(_0xb84c,0x1df));var _0xcb84=function(_0x3c76e9,_0x40e3e3){_0x3c76e9=_0x3c76e9-0x0;var _0x3cec83=_0xb84c[_0x3c76e9];return _0x3cec83;};'use strict';var _=require('lodash');var util=require(_0xcb84('0x0'));var logger=require(_0xcb84('0x1'))(_0xcb84('0x2'));var moment=require(_0xcb84('0x3'));var BPromise=require(_0xcb84('0x4'));var rp=require(_0xcb84('0x5'));var fs=require('fs');var path=require(_0xcb84('0x6'));var rimraf=require('rimraf');var config=require(_0xcb84('0x7'));var attributes=require(_0xcb84('0x8'));module['exports']=function(_0x30c052,_0x1d3248){return _0x30c052['define'](_0xcb84('0x9'),attributes,{'tableName':_0xcb84('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3566=['bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','moment'];(function(_0x2936be,_0x996e44){var _0x453223=function(_0x52f80c){while(--_0x52f80c){_0x2936be['push'](_0x2936be['shift']());}};_0x453223(++_0x996e44);}(_0x3566,0x1aa));var _0x6356=function(_0xef1e2d,_0x53f19f){_0xef1e2d=_0xef1e2d-0x0;var _0xf61168=_0x3566[_0xef1e2d];return _0xf61168;};'use strict';var _=require(_0x6356('0x0'));var util=require('util');var logger=require(_0x6356('0x1'))('api');var moment=require(_0x6356('0x2'));var BPromise=require(_0x6356('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6356('0x4'));var rimraf=require(_0x6356('0x5'));var config=require(_0x6356('0x6'));var attributes=require(_0x6356('0x7'));module[_0x6356('0x8')]=function(_0x554152,_0x43fa3b){return _0x554152['define'](_0x6356('0x9'),attributes,{'tableName':_0x6356('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7c369c2..7285973 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1e25e9,_0x4ac131){var _0x4d659f=function(_0x1fc3bd){while(--_0x1fc3bd){_0x1e25e9['push'](_0x1e25e9['shift']());}};_0x4d659f(++_0x4ac131);}(_0xa41a,0x6b));var _0xaa41=function(_0x5e4e6a,_0x5801cf){_0x5e4e6a=_0x5e4e6a-0x0;var _0x15850f=_0xa41a[_0x5e4e6a];return _0x15850f;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}
\ No newline at end of file
+var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0xe076c2,_0x388dd1){var _0x1a1a38=function(_0x4f1467){while(--_0x4f1467){_0xe076c2['push'](_0xe076c2['shift']());}};_0x1a1a38(++_0x388dd1);}(_0x55ca,0x126));var _0xa55c=function(_0x256b67,_0x14e47b){_0x256b67=_0x256b67-0x0;var _0x3e2d99=_0x55ca[_0x256b67];return _0x3e2d99;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}
\ No newline at end of file
index 97468e2..daebb40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91fe=['../../components/auth/service','./userNotification.controller','post','sendUserNotification','multer','util','express','Router'];(function(_0x2aff6d,_0xde50ce){var _0x5b78f9=function(_0x105d55){while(--_0x105d55){_0x2aff6d['push'](_0x2aff6d['shift']());}};_0x5b78f9(++_0xde50ce);}(_0x91fe,0xa4));var _0xe91f=function(_0xe4cb09,_0x542e5a){_0xe4cb09=_0xe4cb09-0x0;var _0x17234a=_0x91fe[_0xe4cb09];return _0x17234a;};'use strict';var multer=require(_0xe91f('0x0'));var util=require(_0xe91f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe91f('0x2'));var router=express[_0xe91f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe91f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe91f('0x5'));router[_0xe91f('0x6')]('/',auth['isAuthenticated'](),controller[_0xe91f('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0x61da=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x28ffe6,_0x136277){var _0x42c83e=function(_0xa63f86){while(--_0xa63f86){_0x28ffe6['push'](_0x28ffe6['shift']());}};_0x42c83e(++_0x136277);}(_0x61da,0x179));var _0xa61d=function(_0x5c5555,_0x33bf5b){_0x5c5555=_0x5c5555-0x0;var _0x2510bf=_0x61da[_0x5c5555];return _0x2510bf;};'use strict';var multer=require(_0xa61d('0x0'));var util=require(_0xa61d('0x1'));var path=require('path');var timeout=require(_0xa61d('0x2'));var express=require(_0xa61d('0x3'));var router=express[_0xa61d('0x4')]();var fs_extra=require(_0xa61d('0x5'));var auth=require(_0xa61d('0x6'));var interaction=require(_0xa61d('0x7'));var config=require(_0xa61d('0x8'));var controller=require(_0xa61d('0x9'));router[_0xa61d('0xa')]('/',auth[_0xa61d('0xb')](),controller[_0xa61d('0xc')]);module[_0xa61d('0xd')]=router;
\ No newline at end of file
index 36eb110..9eff380 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eab=['exports','TEXT','STRING','BOOLEAN'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x6eab,0x164));var _0xb6ea=function(_0x1f7af5,_0x5902ba){_0x1f7af5=_0x1f7af5-0x0;var _0x576a87=_0x6eab[_0x1f7af5];return _0x576a87;};'use strict';var Sequelize=require('sequelize');module[_0xb6ea('0x0')]={'body':{'type':Sequelize[_0xb6ea('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xb6ea('0x2')]},'beep':{'type':Sequelize[_0xb6ea('0x3')]}};
\ No newline at end of file
+var _0xeead=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x3d3b05,_0x334c57){var _0x2c6ca3=function(_0x3fd1cc){while(--_0x3fd1cc){_0x3d3b05['push'](_0x3d3b05['shift']());}};_0x2c6ca3(++_0x334c57);}(_0xeead,0x10e));var _0xdeea=function(_0x5571ea,_0x350964){_0x5571ea=_0x5571ea-0x0;var _0x42efd5=_0xeead[_0x5571ea];return _0x42efd5;};'use strict';var Sequelize=require(_0xdeea('0x0'));module[_0xdeea('0x1')]={'body':{'type':Sequelize[_0xdeea('0x2')]},'senderName':{'type':Sequelize[_0xdeea('0x3')]},'recipientsId':{'type':Sequelize[_0xdeea('0x2')]},'recipientsDescription':{'type':Sequelize[_0xdeea('0x3')]},'beep':{'type':Sequelize[_0xdeea('0x4')]}};
\ No newline at end of file
index 6252f6c..4beb9db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814a=['redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','sendUserNotification','body','text','hasOwnProperty','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','recipients','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','team','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','transaction','UserNotification','create','recipient','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','startCase','User','union','ids','queue','replace','push','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','crypto','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'];(function(_0x41c0a9,_0x341a87){var _0x4ae82c=function(_0xd9eccf){while(--_0xd9eccf){_0x41c0a9['push'](_0x41c0a9['shift']());}};_0x4ae82c(++_0x341a87);}(_0x814a,0xad));var _0xa814=function(_0x41a7c2,_0x555b5a){_0x41a7c2=_0x41a7c2-0x0;var _0x4b693f=_0x814a[_0x41a7c2];return _0x4b693f;};'use strict';var emlformat=require(_0xa814('0x0'));var rimraf=require(_0xa814('0x1'));var zipdir=require(_0xa814('0x2'));var jsonpatch=require(_0xa814('0x3'));var rp=require(_0xa814('0x4'));var moment=require('moment');var BPromise=require(_0xa814('0x5'));var Mustache=require(_0xa814('0x6'));var util=require(_0xa814('0x7'));var path=require(_0xa814('0x8'));var sox=require(_0xa814('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa814('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa814('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa814('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa814('0xd'));var Papa=require(_0xa814('0xe'));var Redis=require(_0xa814('0xf'));var authService=require(_0xa814('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa814('0x11'));var hardwareService=require(_0xa814('0x12'));var logger=require(_0xa814('0x13'))(_0xa814('0x14'));var utils=require(_0xa814('0x15'));var config=require(_0xa814('0x16'));var licenseUtil=require(_0xa814('0x17'));var db=require(_0xa814('0x18'))['db'];config[_0xa814('0x19')]=_[_0xa814('0x1a')](config[_0xa814('0x19')],{'host':_0xa814('0x1b'),'port':0x18eb});var socket=require(_0xa814('0x1c'))(new Redis(config[_0xa814('0x19')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x4d1f72,_0x3ddf2c){_0x3ddf2c=_0x3ddf2c||0xcc;return function(_0x49fbda){if(_0x49fbda){return _0x4d1f72[_0xa814('0x1d')](_0x3ddf2c);}return _0x4d1f72[_0xa814('0x1e')](_0x3ddf2c)[_0xa814('0x1f')]();};}function respondWithResult(_0xebcbe1,_0xb96fb6){_0xb96fb6=_0xb96fb6||0xc8;return function(_0x84a993){if(_0x84a993){return _0xebcbe1[_0xa814('0x1e')](_0xb96fb6)[_0xa814('0x20')](_0x84a993);}};}function respondWithFilteredResult(_0x49a5cc,_0x3dbc45){return function(_0x1989f2){if(_0x1989f2){var _0xb7e428=typeof _0x3dbc45[_0xa814('0x21')]==='undefined'&&typeof _0x3dbc45[_0xa814('0x22')]==='undefined';var _0x11ab9a=_0x1989f2[_0xa814('0x23')];var _0x25a2da=_0xb7e428?0x0:_0x3dbc45[_0xa814('0x21')];var _0x4137c8=_0xb7e428?_0x1989f2[_0xa814('0x23')]:_0x3dbc45['offset']+_0x3dbc45[_0xa814('0x22')];var _0xd3cec3;if(_0x4137c8>=_0x11ab9a){_0x4137c8=_0x11ab9a;_0xd3cec3=0xc8;}else{_0xd3cec3=0xce;}_0x49a5cc[_0xa814('0x1e')](_0xd3cec3);return _0x49a5cc[_0xa814('0x24')](_0xa814('0x25'),_0x25a2da+'-'+_0x4137c8+'/'+_0x11ab9a)['json'](_0x1989f2);}return null;};}function patchUpdates(_0x5f6db6){return function(_0x52e480){try{jsonpatch[_0xa814('0x26')](_0x52e480,_0x5f6db6,!![]);}catch(_0x343550){return BPromise[_0xa814('0x27')](_0x343550);}return _0x52e480['save']();};}function saveUpdates(_0x268050,_0x2d2bd5){return function(_0x29e8e6){if(_0x29e8e6){return _0x29e8e6[_0xa814('0x28')](_0x268050)[_0xa814('0x29')](function(_0x4eae3e){return _0x4eae3e;});}return null;};}function removeEntity(_0x40d795,_0x24e282){return function(_0x541dd3){if(_0x541dd3){return _0x541dd3[_0xa814('0x2a')]()[_0xa814('0x29')](function(){_0x40d795[_0xa814('0x1e')](0xcc)[_0xa814('0x1f')]();});}};}function handleEntityNotFound(_0x43698c,_0x5a36f8){return function(_0x358968){if(!_0x358968){_0x43698c['sendStatus'](0x194);}return _0x358968;};}function handleError(_0x20cec1,_0x3d724d){_0x3d724d=_0x3d724d||0x1f4;return function(_0x1251df){logger['error'](_0x1251df[_0xa814('0x2b')]);if(_0x1251df[_0xa814('0x2c')]){delete _0x1251df[_0xa814('0x2c')];}_0x20cec1[_0xa814('0x1e')](_0x3d724d)['send'](_0x1251df);};}exports[_0xa814('0x2d')]=function(_0x531caf,_0x5e63c3,_0x1c383c){if(!_0x531caf[_0xa814('0x2e')]['hasOwnProperty'](_0xa814('0x2f'))&&!_0x531caf[_0xa814('0x2e')][_0xa814('0x30')]('TemplateId')){throw new db[(_0xa814('0x31'))][(_0xa814('0x32'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x531caf[_0xa814('0x2e')][_0xa814('0x30')]('TemplateId')&&!_0x531caf[_0xa814('0x2e')][_0xa814('0x30')](_0xa814('0x33'))){throw new db[(_0xa814('0x31'))][(_0xa814('0x32'))](_0xa814('0x34'));}if(!_0x531caf[_0xa814('0x2e')][_0xa814('0x30')]('recipients')){throw new db['Sequelize'][(_0xa814('0x32'))](_0xa814('0x35'));}else{try{var _0x239fc3=JSON['parse'](_0x531caf[_0xa814('0x2e')][_0xa814('0x36')]);}catch(_0x1a8e1c){logger[_0xa814('0x37')](_0x1a8e1c);throw new db['Sequelize']['ValidationError'](_0xa814('0x38'));}var _0x516f87=[_0xa814('0x39'),_0xa814('0x3a'),'mailqueue',_0xa814('0x3b'),_0xa814('0x3c'),_0xa814('0x3d'),'whatsappqueue',_0xa814('0x3e'),_0xa814('0x3f')];if(_['some'](_0x239fc3,function(_0x48bb8b){return!_[_0xa814('0x40')](_0x516f87,_0x48bb8b[_0xa814('0x41')][_0xa814('0x42')]());})){throw new db[(_0xa814('0x31'))][(_0xa814('0x32'))](_0xa814('0x43'));}}}var _0x14da0e={};_0x14da0e[_0xa814('0x44')]=_0x531caf[_0xa814('0x2e')][_0xa814('0x30')](_0xa814('0x44'))?_0x531caf[_0xa814('0x2e')][_0xa814('0x44')]:_0x531caf[_0xa814('0x3f')][_0xa814('0x45')];_0x14da0e[_0xa814('0x46')]=_[_0xa814('0x47')](_0x531caf[_0xa814('0x2e')][_0xa814('0x46')])?null:_0x531caf[_0xa814('0x2e')][_0xa814('0x46')];_0x14da0e[_0xa814('0x48')]=_0x531caf[_0xa814('0x2e')][_0xa814('0x48')]||![];_0x14da0e[_0xa814('0x49')]=_0x531caf[_0xa814('0x3f')]['id'];return getContent(_0x531caf['body'])[_0xa814('0x29')](function(_0x253af4){_0x14da0e[_0xa814('0x2e')]=_0x253af4;return getRecipients(_0x239fc3);})[_0xa814('0x29')](function(_0x169a3c){_0x14da0e[_0xa814('0x4a')]=_[_0xa814('0x4b')](_0x169a3c)[_0xa814('0x4c')](',');return db['sequelize'][_0xa814('0x4d')](function(_0x58f457){return db[_0xa814('0x4e')][_0xa814('0x4f')](_0x14da0e,{'raw':!![],'transaction':_0x58f457})[_0xa814('0x29')](function(_0x59fc0b){var _0x5b6f9a={'sender':_0x14da0e[_0xa814('0x44')],'description':_0x14da0e[_0xa814('0x46')],'content':_0x14da0e[_0xa814('0x2e')],'beep':_0x14da0e['beep']};_0x169a3c['forEach'](function(_0x1566a4){_0x5b6f9a[_0xa814('0x50')]=_0x1566a4;socket['emit'](_0xa814('0x51'),_0x5b6f9a);});return _0x59fc0b;});});})[_0xa814('0x29')](respondWithResult(_0x5e63c3,0xc9))[_0xa814('0x52')](handleError(_0x5e63c3,null));};function getContent(_0x125420){return new BPromise(function(_0x5ab583,_0x24761e){if(_0x125420[_0xa814('0x2f')]){_0x5ab583(_0x125420[_0xa814('0x2f')]);return;}return db[_0xa814('0x53')][_0xa814('0x54')]({'attributes':[_0xa814('0x55')],'where':{'id':_0x125420['TemplateId']},'raw':!![]})[_0xa814('0x29')](function(_0x52ba91){if(!_0x52ba91)throw new db['Sequelize']['ValidationError'](_0xa814('0x56'));var _0x35ee11=Mustache[_0xa814('0x57')](_0x52ba91['html'],_0x125420[_0xa814('0x33')]);_0x5ab583(_0x35ee11);})['catch'](function(_0x1e72f5){_0x24761e(_0x1e72f5);});});}function getRecipients(_0x12c020){return new BPromise(function(_0x16f80a,_0x1f215f){var _0x55c6bf=[];var _0x17faf8=[];_0x12c020[_0xa814('0x58')](function(_0x393434){var _0x39b4e0=_[_0xa814('0x59')](_0x393434['model'][_0xa814('0x42')]());if(_0x39b4e0===_0xa814('0x5a')){_0x55c6bf=_[_0xa814('0x5b')](_0x55c6bf,_0x393434[_0xa814('0x5c')]);}else{if(_['includes'](_0x39b4e0,_0xa814('0x5d')))_0x39b4e0=_0x39b4e0[_0xa814('0x5e')](_0xa814('0x5d'),'Queue');_0x393434[_0xa814('0x5c')][_0xa814('0x58')](function(_0x538e57){_0x17faf8[_0xa814('0x5f')](getAgents(_0x39b4e0,_0x538e57));});}});return BPromise['all'](_0x17faf8)[_0xa814('0x29')](function(_0xc2beaf){_0x55c6bf=_['union'](_0x55c6bf,_[_0xa814('0x60')](_0xc2beaf));_0x16f80a(_0x55c6bf);})[_0xa814('0x52')](function(_0x29212d){_0x1f215f(_0x29212d);});});}function getAgents(_0x328490,_0x58a17f){return new BPromise(function(_0x537e8d,_0x571699){return db[_0x328490][_0xa814('0x54')]({'where':{'id':_0x58a17f}})[_0xa814('0x29')](function(_0x22d9a3){return _0x22d9a3[_0xa814('0x61')]({'attributes':['id'],'raw':!![]})['then'](function(_0x28d103){var _0x208a78=_[_0xa814('0x62')](_0x28d103,'id');_0x537e8d(_0x208a78);});})[_0xa814('0x52')](function(_0x1d1591){_0x571699(_0x1d1591);});});}
\ No newline at end of file
+var _0xa236=['util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','error','stack','name','send','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','body','hasOwnProperty','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','smsqueue','team','user','includes','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','create','forEach','userNotification:send','catch','Template','findOne','html','render','model','toLowerCase','User','union','ids','queue','Queue','push','all','flatten','map','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa236,0x119));var _0x6a23=function(_0x35008d,_0x15f648){_0x35008d=_0x35008d-0x0;var _0x26f73f=_0xa236[_0x35008d];return _0x26f73f;};'use strict';var emlformat=require(_0x6a23('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a23('0x1'));var jsonpatch=require(_0x6a23('0x2'));var rp=require(_0x6a23('0x3'));var moment=require(_0x6a23('0x4'));var BPromise=require(_0x6a23('0x5'));var Mustache=require(_0x6a23('0x6'));var util=require(_0x6a23('0x7'));var path=require('path');var sox=require(_0x6a23('0x8'));var csv=require('to-csv');var ejs=require(_0x6a23('0x9'));var fs=require('fs');var fs_extra=require(_0x6a23('0xa'));var _=require(_0x6a23('0xb'));var squel=require(_0x6a23('0xc'));var crypto=require(_0x6a23('0xd'));var jsforce=require(_0x6a23('0xe'));var deskjs=require(_0x6a23('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6a23('0x10'));var Papa=require('papaparse');var Redis=require(_0x6a23('0x11'));var authService=require(_0x6a23('0x12'));var qs=require(_0x6a23('0x13'));var as=require(_0x6a23('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6a23('0x15'));var utils=require(_0x6a23('0x16'));var config=require(_0x6a23('0x17'));var licenseUtil=require(_0x6a23('0x18'));var db=require(_0x6a23('0x19'))['db'];config['redis']=_['defaults'](config[_0x6a23('0x1a')],{'host':_0x6a23('0x1b'),'port':0x18eb});var socket=require(_0x6a23('0x1c'))(new Redis(config['redis']));require(_0x6a23('0x1d'))[_0x6a23('0x1e')](socket);function respondWithStatusCode(_0x1514cf,_0x6fdc6d){_0x6fdc6d=_0x6fdc6d||0xcc;return function(_0xfade3e){if(_0xfade3e){return _0x1514cf[_0x6a23('0x1f')](_0x6fdc6d);}return _0x1514cf[_0x6a23('0x20')](_0x6fdc6d)[_0x6a23('0x21')]();};}function respondWithResult(_0x53017d,_0x1226e6){_0x1226e6=_0x1226e6||0xc8;return function(_0x525c9e){if(_0x525c9e){return _0x53017d['status'](_0x1226e6)[_0x6a23('0x22')](_0x525c9e);}};}function respondWithFilteredResult(_0xf23679,_0xdf0b31){return function(_0x1565c6){if(_0x1565c6){var _0x1d5ede=typeof _0xdf0b31[_0x6a23('0x23')]===_0x6a23('0x24')&&typeof _0xdf0b31[_0x6a23('0x25')]==='undefined';var _0xe73178=_0x1565c6[_0x6a23('0x26')];var _0x412cf9=_0x1d5ede?0x0:_0xdf0b31['offset'];var _0x38de59=_0x1d5ede?_0x1565c6['count']:_0xdf0b31[_0x6a23('0x23')]+_0xdf0b31[_0x6a23('0x25')];var _0x24708a;if(_0x38de59>=_0xe73178){_0x38de59=_0xe73178;_0x24708a=0xc8;}else{_0x24708a=0xce;}_0xf23679[_0x6a23('0x20')](_0x24708a);return _0xf23679['set'](_0x6a23('0x27'),_0x412cf9+'-'+_0x38de59+'/'+_0xe73178)[_0x6a23('0x22')](_0x1565c6);}return null;};}function patchUpdates(_0x55d199){return function(_0x3352d3){try{jsonpatch[_0x6a23('0x28')](_0x3352d3,_0x55d199,!![]);}catch(_0x34f54c){return BPromise['reject'](_0x34f54c);}return _0x3352d3['save']();};}function saveUpdates(_0x1d1256,_0x5bff28){return function(_0x57b596){if(_0x57b596){return _0x57b596[_0x6a23('0x29')](_0x1d1256)[_0x6a23('0x2a')](function(_0x39ef1a){return _0x39ef1a;});}return null;};}function removeEntity(_0xa0ee10,_0x279fc5){return function(_0x53d314){if(_0x53d314){return _0x53d314[_0x6a23('0x2b')]()[_0x6a23('0x2a')](function(){_0xa0ee10['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459799,_0x41a637){return function(_0x429088){if(!_0x429088){_0x459799[_0x6a23('0x1f')](0x194);}return _0x429088;};}function handleError(_0x36defb,_0x25e137){_0x25e137=_0x25e137||0x1f4;return function(_0x3be25d){logger[_0x6a23('0x2c')](_0x3be25d[_0x6a23('0x2d')]);if(_0x3be25d[_0x6a23('0x2e')]){delete _0x3be25d[_0x6a23('0x2e')];}_0x36defb[_0x6a23('0x20')](_0x25e137)[_0x6a23('0x2f')](_0x3be25d);};}exports['sendUserNotification']=function(_0x1f6c42,_0x3f702e,_0x1e004e){if(!_0x1f6c42['body']['hasOwnProperty'](_0x6a23('0x30'))&&!_0x1f6c42['body']['hasOwnProperty'](_0x6a23('0x31'))){throw new db['Sequelize'][(_0x6a23('0x32'))](_0x6a23('0x33'));}else{if(_0x1f6c42[_0x6a23('0x34')]['hasOwnProperty']('TemplateId')&&!_0x1f6c42[_0x6a23('0x34')][_0x6a23('0x35')](_0x6a23('0x36'))){throw new db[(_0x6a23('0x37'))][(_0x6a23('0x32'))](_0x6a23('0x38'));}if(!_0x1f6c42['body'][_0x6a23('0x35')](_0x6a23('0x39'))){throw new db[(_0x6a23('0x37'))][(_0x6a23('0x32'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x5a1940=JSON['parse'](_0x1f6c42[_0x6a23('0x34')][_0x6a23('0x39')]);}catch(_0x188598){logger[_0x6a23('0x2c')](_0x188598);throw new db['Sequelize'][(_0x6a23('0x32'))](_0x6a23('0x3a'));}var _0x8f8fd6=['chatqueue',_0x6a23('0x3b'),_0x6a23('0x3c'),'openchannelqueue',_0x6a23('0x3d'),'voicequeue','whatsappqueue',_0x6a23('0x3e'),_0x6a23('0x3f')];if(_['some'](_0x5a1940,function(_0x487b40){return!_[_0x6a23('0x40')](_0x8f8fd6,_0x487b40['model']['toLowerCase']());})){throw new db[(_0x6a23('0x37'))][(_0x6a23('0x32'))](_0x6a23('0x41'));}}}var _0x28849a={};_0x28849a[_0x6a23('0x42')]=_0x1f6c42['body']['hasOwnProperty'](_0x6a23('0x42'))?_0x1f6c42[_0x6a23('0x34')][_0x6a23('0x42')]:_0x1f6c42[_0x6a23('0x3f')][_0x6a23('0x43')];_0x28849a['recipientsDescription']=_[_0x6a23('0x44')](_0x1f6c42[_0x6a23('0x34')][_0x6a23('0x45')])?null:_0x1f6c42[_0x6a23('0x34')]['recipientsDescription'];_0x28849a[_0x6a23('0x46')]=_0x1f6c42[_0x6a23('0x34')][_0x6a23('0x46')]||![];_0x28849a[_0x6a23('0x47')]=_0x1f6c42[_0x6a23('0x3f')]['id'];return getContent(_0x1f6c42['body'])[_0x6a23('0x2a')](function(_0x548c3e){_0x28849a['body']=_0x548c3e;return getRecipients(_0x5a1940);})['then'](function(_0xf9e825){_0x28849a[_0x6a23('0x48')]=_[_0x6a23('0x49')](_0xf9e825)[_0x6a23('0x4a')](',');return db[_0x6a23('0x4b')][_0x6a23('0x4c')](function(_0x3915cf){return db['UserNotification'][_0x6a23('0x4d')](_0x28849a,{'raw':!![],'transaction':_0x3915cf})[_0x6a23('0x2a')](function(_0x2f7ca8){var _0x195f62={'sender':_0x28849a[_0x6a23('0x42')],'description':_0x28849a[_0x6a23('0x45')],'content':_0x28849a[_0x6a23('0x34')],'beep':_0x28849a[_0x6a23('0x46')]};_0xf9e825[_0x6a23('0x4e')](function(_0x5e4c49){_0x195f62['recipient']=_0x5e4c49;socket['emit'](_0x6a23('0x4f'),_0x195f62);});return _0x2f7ca8;});});})[_0x6a23('0x2a')](respondWithResult(_0x3f702e,0xc9))[_0x6a23('0x50')](handleError(_0x3f702e,null));};function getContent(_0x2a510c){return new BPromise(function(_0x3bdda1,_0x1dbee6){if(_0x2a510c['text']){_0x3bdda1(_0x2a510c[_0x6a23('0x30')]);return;}return db[_0x6a23('0x51')][_0x6a23('0x52')]({'attributes':[_0x6a23('0x53')],'where':{'id':_0x2a510c['TemplateId']},'raw':!![]})[_0x6a23('0x2a')](function(_0x3c7826){if(!_0x3c7826)throw new db['Sequelize']['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x7d9e11=Mustache[_0x6a23('0x54')](_0x3c7826[_0x6a23('0x53')],_0x2a510c[_0x6a23('0x36')]);_0x3bdda1(_0x7d9e11);})[_0x6a23('0x50')](function(_0x29c332){_0x1dbee6(_0x29c332);});});}function getRecipients(_0x523ecb){return new BPromise(function(_0x5aecf7,_0x524bd0){var _0x211e7c=[];var _0x3d7e68=[];_0x523ecb[_0x6a23('0x4e')](function(_0x198cf1){var _0x40051f=_['startCase'](_0x198cf1[_0x6a23('0x55')][_0x6a23('0x56')]());if(_0x40051f===_0x6a23('0x57')){_0x211e7c=_[_0x6a23('0x58')](_0x211e7c,_0x198cf1[_0x6a23('0x59')]);}else{if(_[_0x6a23('0x40')](_0x40051f,_0x6a23('0x5a')))_0x40051f=_0x40051f['replace'](_0x6a23('0x5a'),_0x6a23('0x5b'));_0x198cf1[_0x6a23('0x59')][_0x6a23('0x4e')](function(_0x46cc63){_0x3d7e68[_0x6a23('0x5c')](getAgents(_0x40051f,_0x46cc63));});}});return BPromise[_0x6a23('0x5d')](_0x3d7e68)[_0x6a23('0x2a')](function(_0x43d924){_0x211e7c=_[_0x6a23('0x58')](_0x211e7c,_[_0x6a23('0x5e')](_0x43d924));_0x5aecf7(_0x211e7c);})[_0x6a23('0x50')](function(_0x4ea730){_0x524bd0(_0x4ea730);});});}function getAgents(_0x4fb669,_0x54d59f){return new BPromise(function(_0xc1b182,_0x38e205){return db[_0x4fb669][_0x6a23('0x52')]({'where':{'id':_0x54d59f}})['then'](function(_0x349e92){return _0x349e92['getAgents']({'attributes':['id'],'raw':!![]})[_0x6a23('0x2a')](function(_0x2e6ea4){var _0x1a08d0=_[_0x6a23('0x5f')](_0x2e6ea4,'id');_0xc1b182(_0x1a08d0);});})[_0x6a23('0x50')](function(_0x4a9111){_0x38e205(_0x4a9111);});});}
\ No newline at end of file
index 1af2396..66cfd08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c50=['UserNotification','setMaxListeners','save','update','emit','hook','events','../../mysqldb'];(function(_0x10803a,_0x37fe04){var _0xc616b1=function(_0x59b824){while(--_0x59b824){_0x10803a['push'](_0x10803a['shift']());}};_0xc616b1(++_0x37fe04);}(_0x0c50,0x116));var _0x00c5=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x0c50[_0x376b45];return _0x2341b3;};'use strict';var EventEmitter=require(_0x00c5('0x0'));var UserNotification=require(_0x00c5('0x1'))['db'][_0x00c5('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x00c5('0x3')](0x0);var events={'afterCreate':_0x00c5('0x4'),'afterUpdate':_0x00c5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5cb8e0){return function(_0x1ad7c1,_0x3eb926,_0xc2c138){UserNotificationEvents[_0x00c5('0x6')](_0x5cb8e0+':'+_0x1ad7c1['id'],_0x1ad7c1);UserNotificationEvents[_0x00c5('0x6')](_0x5cb8e0,_0x1ad7c1);_0xc2c138(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x00c5('0x7')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
+var _0x85ad=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update'];(function(_0x15035b,_0x3eba0a){var _0x2cc7b1=function(_0x144b32){while(--_0x144b32){_0x15035b['push'](_0x15035b['shift']());}};_0x2cc7b1(++_0x3eba0a);}(_0x85ad,0xf4));var _0xd85a=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x85ad[_0x167cc1];return _0x10bc4b;};'use strict';var EventEmitter=require(_0xd85a('0x0'));var UserNotification=require(_0xd85a('0x1'))['db'][_0xd85a('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xd85a('0x3')](0x0);var events={'afterCreate':_0xd85a('0x4'),'afterUpdate':_0xd85a('0x5'),'afterDestroy':_0xd85a('0x6')};function emitEvent(_0xf2b7de){return function(_0x2e0452,_0x2109ae,_0x4589d9){UserNotificationEvents['emit'](_0xf2b7de+':'+_0x2e0452['id'],_0x2e0452);UserNotificationEvents[_0xd85a('0x7')](_0xf2b7de,_0x2e0452);_0x4589d9(null);};}for(var e in events){if(events[_0xd85a('0x8')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xd85a('0x9')]=UserNotificationEvents;
\ No newline at end of file
index bb2732d..37d8586 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4818=['moment','bluebird','request-promise','path','rimraf','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','../../config/logger','api'];(function(_0x389447,_0x51dfd1){var _0x278be8=function(_0x4942a7){while(--_0x4942a7){_0x389447['push'](_0x389447['shift']());}};_0x278be8(++_0x51dfd1);}(_0x4818,0x1b8));var _0x8481=function(_0x4efce3,_0x3d3e3a){_0x4efce3=_0x4efce3-0x0;var _0x11254b=_0x4818[_0x4efce3];return _0x11254b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8481('0x0'))(_0x8481('0x1'));var moment=require(_0x8481('0x2'));var BPromise=require(_0x8481('0x3'));var rp=require(_0x8481('0x4'));var fs=require('fs');var path=require(_0x8481('0x5'));var rimraf=require(_0x8481('0x6'));var config=require('../../config/environment');var attributes=require(_0x8481('0x7'));module[_0x8481('0x8')]=function(_0x51cf6c,_0x11d910){return _0x51cf6c[_0x8481('0x9')](_0x8481('0xa'),attributes,{'tableName':_0x8481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8481('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x4078=['rimraf','../../config/environment','exports','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x722103,_0x5732f3){var _0x3e2435=function(_0x44c44a){while(--_0x44c44a){_0x722103['push'](_0x722103['shift']());}};_0x3e2435(++_0x5732f3);}(_0x4078,0x8a));var _0x8407=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0x4078[_0x4f1da5];return _0xe972a8;};'use strict';var _=require(_0x8407('0x0'));var util=require(_0x8407('0x1'));var logger=require(_0x8407('0x2'))(_0x8407('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8407('0x4'));var fs=require('fs');var path=require(_0x8407('0x5'));var rimraf=require(_0x8407('0x6'));var config=require(_0x8407('0x7'));var attributes=require('./userNotification.attributes');module[_0x8407('0x8')]=function(_0x3bf84e,_0x1d48d1){return _0x3bf84e['define']('UserNotification',attributes,{'tableName':_0x8407('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8407('0xa'),'collate':_0x8407('0xb')});};
\ No newline at end of file
index d45a28b..1e33522 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x370f=['util','moment','bluebird','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','request','info','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserNotification,\x20%s,\x20%s','message','catch','lodash'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x370f,0x1cd));var _0xf370=function(_0x4f096e,_0x30d3c3){_0x4f096e=_0x4f096e-0x0;var _0x4a33ce=_0x370f[_0x4f096e];return _0x4a33ce;};'use strict';var _=require(_0xf370('0x0'));var util=require(_0xf370('0x1'));var moment=require(_0xf370('0x2'));var BPromise=require(_0xf370('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(_0xf370('0x4'))(_0xf370('0x5'));var config=require(_0xf370('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf370('0x7')][_0xf370('0x8')]({'port':0x232a});config[_0xf370('0x9')]=_[_0xf370('0xa')](config[_0xf370('0x9')],{'host':_0xf370('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf370('0x9')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x32dde8,_0x679e34,_0x49b7ee){return new BPromise(function(_0x10fd1b,_0x13d390){return client[_0xf370('0xc')](_0x32dde8,_0x49b7ee)['then'](function(_0x1f4365){logger[_0xf370('0xd')]('UserNotification,\x20%s,\x20%s',_0x679e34,'request\x20sent');logger['debug'](_0xf370('0xe'),_0x679e34,_0xf370('0xf'),JSON['stringify'](_0x1f4365));if(_0x1f4365[_0xf370('0x10')]){if(_0x1f4365['error'][_0xf370('0x11')]===0x1f4){logger[_0xf370('0x10')](_0xf370('0x12'),_0x679e34,_0x1f4365['error'][_0xf370('0x13')]);return _0x13d390(_0x1f4365['error']['message']);}logger[_0xf370('0x10')](_0xf370('0x12'),_0x679e34,_0x1f4365[_0xf370('0x10')][_0xf370('0x13')]);return _0x10fd1b(_0x1f4365[_0xf370('0x10')]['message']);}else{logger[_0xf370('0xd')]('UserNotification,\x20%s,\x20%s',_0x679e34,_0xf370('0xf'));_0x10fd1b(_0x1f4365['result'][_0xf370('0x13')]);}})[_0xf370('0x14')](function(_0x3f3a6f){logger['error'](_0xf370('0x12'),_0x679e34,_0x3f3a6f);_0x13d390(_0x3f3a6f);});});}
\ No newline at end of file
+var _0x4ac4=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch'];(function(_0x38fe33,_0x408614){var _0x4fb852=function(_0x2ce04f){while(--_0x2ce04f){_0x38fe33['push'](_0x38fe33['shift']());}};_0x4fb852(++_0x408614);}(_0x4ac4,0x1a0));var _0x44ac=function(_0x29f66b,_0x4e037c){_0x29f66b=_0x29f66b-0x0;var _0x543906=_0x4ac4[_0x29f66b];return _0x543906;};'use strict';var _=require(_0x44ac('0x0'));var util=require(_0x44ac('0x1'));var moment=require(_0x44ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x44ac('0x3'));var fs=require('fs');var Redis=require(_0x44ac('0x4'));var db=require(_0x44ac('0x5'))['db'];var utils=require(_0x44ac('0x6'));var logger=require(_0x44ac('0x7'))(_0x44ac('0x8'));var config=require(_0x44ac('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x44ac('0xa')]['http']({'port':0x232a});config[_0x44ac('0xb')]=_[_0x44ac('0xc')](config[_0x44ac('0xb')],{'host':_0x44ac('0xd'),'port':0x18eb});var socket=require(_0x44ac('0xe'))(new Redis(config['redis']));require(_0x44ac('0xf'))[_0x44ac('0x10')](socket);function respondWithRpcPromise(_0x4043d0,_0x48b021,_0x235426){return new BPromise(function(_0x1f69b1,_0x3de636){return client[_0x44ac('0x11')](_0x4043d0,_0x235426)['then'](function(_0x4c6bb5){logger[_0x44ac('0x12')](_0x44ac('0x13'),_0x48b021,'request\x20sent');logger['debug'](_0x44ac('0x14'),_0x48b021,'request\x20sent',JSON['stringify'](_0x4c6bb5));if(_0x4c6bb5[_0x44ac('0x15')]){if(_0x4c6bb5[_0x44ac('0x15')][_0x44ac('0x16')]===0x1f4){logger[_0x44ac('0x15')]('UserNotification,\x20%s,\x20%s',_0x48b021,_0x4c6bb5[_0x44ac('0x15')][_0x44ac('0x17')]);return _0x3de636(_0x4c6bb5[_0x44ac('0x15')][_0x44ac('0x17')]);}logger[_0x44ac('0x15')]('UserNotification,\x20%s,\x20%s',_0x48b021,_0x4c6bb5[_0x44ac('0x15')][_0x44ac('0x17')]);return _0x1f69b1(_0x4c6bb5[_0x44ac('0x15')][_0x44ac('0x17')]);}else{logger['info'](_0x44ac('0x13'),_0x48b021,_0x44ac('0x18'));_0x1f69b1(_0x4c6bb5['result'][_0x44ac('0x17')]);}})[_0x44ac('0x19')](function(_0x54f5bb){logger[_0x44ac('0x15')]('UserNotification,\x20%s,\x20%s',_0x48b021,_0x54f5bb);_0x3de636(_0x54f5bb);});});}
\ No newline at end of file
index c8ee6eb..b90a01e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbf3=['update','removeListener','register','userNotification:','remove'];(function(_0x4aebd2,_0x56146a){var _0xfb742=function(_0x3762e6){while(--_0x3762e6){_0x4aebd2['push'](_0x4aebd2['shift']());}};_0xfb742(++_0x56146a);}(_0xfbf3,0x199));var _0x3fbf=function(_0x41a175,_0x4a0b8c){_0x41a175=_0x41a175-0x0;var _0x376694=_0xfbf3[_0x41a175];return _0x376694;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0x3fbf('0x0'),_0x3fbf('0x1')];function createListener(_0x350beb,_0x590fef){return function(_0x45e2cb){_0x590fef['emit'](_0x350beb,_0x45e2cb);};}function removeListener(_0x28ae59,_0x5e0661){return function(){UserNotificationEvents[_0x3fbf('0x2')](_0x28ae59,_0x5e0661);};}exports[_0x3fbf('0x3')]=function(_0x4658e3){for(var _0x2cbaf3=0x0,_0x38e2fd=events['length'];_0x2cbaf3<_0x38e2fd;_0x2cbaf3++){var _0x1e79d7=events[_0x2cbaf3];var _0x24f53b=createListener(_0x3fbf('0x4')+_0x1e79d7,_0x4658e3);UserNotificationEvents['on'](_0x1e79d7,_0x24f53b);}};
\ No newline at end of file
+var _0x7ee5=['remove','update','emit','removeListener','register','length','userNotification:','./userNotification.events','save'];(function(_0x47e40d,_0x5d0721){var _0x2711fb=function(_0x23b462){while(--_0x23b462){_0x47e40d['push'](_0x47e40d['shift']());}};_0x2711fb(++_0x5d0721);}(_0x7ee5,0x1c9));var _0x57ee=function(_0xdb5036,_0x914c61){_0xdb5036=_0xdb5036-0x0;var _0x58fb12=_0x7ee5[_0xdb5036];return _0x58fb12;};'use strict';var UserNotificationEvents=require(_0x57ee('0x0'));var events=[_0x57ee('0x1'),_0x57ee('0x2'),_0x57ee('0x3')];function createListener(_0x2bac86,_0x166f80){return function(_0x4ef60a){_0x166f80[_0x57ee('0x4')](_0x2bac86,_0x4ef60a);};}function removeListener(_0x2669c9,_0x495006){return function(){UserNotificationEvents[_0x57ee('0x5')](_0x2669c9,_0x495006);};}exports[_0x57ee('0x6')]=function(_0x5361f7){for(var _0x4656da=0x0,_0x20c9bf=events[_0x57ee('0x7')];_0x4656da<_0x20c9bf;_0x4656da++){var _0x25c56b=events[_0x4656da];var _0x44a52a=createListener(_0x57ee('0x8')+_0x25c56b,_0x5361f7);UserNotificationEvents['on'](_0x25c56b,_0x44a52a);}};
\ No newline at end of file
index 46c32be..7706cac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x22dd85,_0x460250){var _0xb510b4=function(_0x414d8a){while(--_0x414d8a){_0x22dd85['push'](_0x22dd85['shift']());}};_0xb510b4(++_0x460250);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0xcb91[_0x5678b5];return _0x4c09a5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x493db0,_0x4ae95f){var _0x41f75a=function(_0x1ac878){while(--_0x1ac878){_0x493db0['push'](_0x493db0['shift']());}};_0x41f75a(++_0x4ae95f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0xcb91[_0x40b493];return _0x548365;};'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 28ece92..34e6b06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeef0=['exports','INTEGER','sequelize'];(function(_0x32bb06,_0x46b9c3){var _0x38fc21=function(_0x195f0d){while(--_0x195f0d){_0x32bb06['push'](_0x32bb06['shift']());}};_0x38fc21(++_0x46b9c3);}(_0xeef0,0x1c4));var _0x0eef=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xeef0[_0x22b68a];return _0x1ac67a;};'use strict';var Sequelize=require(_0x0eef('0x0'));module[_0x0eef('0x1')]={'penalty':{'type':Sequelize[_0x0eef('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7ccb=['INTEGER','sequelize','exports'];(function(_0x49be0f,_0x1505b1){var _0x56daaf=function(_0x1c5f15){while(--_0x1c5f15){_0x49be0f['push'](_0x49be0f['shift']());}};_0x56daaf(++_0x1505b1);}(_0x7ccb,0x17e));var _0xb7cc=function(_0x5814ca,_0x3b6713){_0x5814ca=_0x5814ca-0x0;var _0xeb1833=_0x7ccb[_0x5814ca];return _0xeb1833;};'use strict';var Sequelize=require(_0xb7cc('0x0'));module[_0xb7cc('0x1')]={'penalty':{'type':Sequelize[_0xb7cc('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index eb56b5e..26325db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7f2=['user_has_openchannel_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserOpenchannelQueue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf7f2,0xfd));var _0x2f7f=function(_0x331e28,_0x163e3c){_0x331e28=_0x331e28-0x0;var _0x42abb8=_0xf7f2[_0x331e28];return _0x42abb8;};'use strict';var _=require(_0x2f7f('0x0'));var util=require('util');var logger=require(_0x2f7f('0x1'))('api');var moment=require(_0x2f7f('0x2'));var BPromise=require(_0x2f7f('0x3'));var rp=require(_0x2f7f('0x4'));var fs=require('fs');var path=require(_0x2f7f('0x5'));var rimraf=require(_0x2f7f('0x6'));var config=require(_0x2f7f('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x2f7f('0x8')]=function(_0x2ff098,_0x1e1bb8){return _0x2ff098[_0x2f7f('0x9')](_0x2f7f('0xa'),attributes,{'tableName':_0x2f7f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc2b5=['util','../../config/logger','api','request-promise','../../config/environment','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xc2b5,0xb3));var _0x5c2b=function(_0x35d546,_0x3d9ba3){_0x35d546=_0x35d546-0x0;var _0x4349e5=_0xc2b5[_0x35d546];return _0x4349e5;};'use strict';var _=require(_0x5c2b('0x0'));var util=require(_0x5c2b('0x1'));var logger=require(_0x5c2b('0x2'))(_0x5c2b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5c2b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5c2b('0x5'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x5c2b('0x6')]=function(_0x529e76,_0x5df4f5){return _0x529e76[_0x5c2b('0x7')](_0x5c2b('0x8'),attributes,{'tableName':_0x5c2b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5e8c148..3a62265 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8160=['../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','ioredis'];(function(_0x342387,_0x2dee91){var _0x108f72=function(_0xe31d57){while(--_0xe31d57){_0x342387['push'](_0x342387['shift']());}};_0x108f72(++_0x2dee91);}(_0x8160,0x106));var _0x0816=function(_0x5d86bb,_0x1cc911){_0x5d86bb=_0x5d86bb-0x0;var _0x87abc6=_0x8160[_0x5d86bb];return _0x87abc6;};'use strict';var _=require('lodash');var util=require(_0x0816('0x0'));var moment=require(_0x0816('0x1'));var BPromise=require(_0x0816('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0816('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0816('0x4'));var logger=require('../../config/logger')(_0x0816('0x5'));var config=require(_0x0816('0x6'));var jayson=require(_0x0816('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x57ba13,_0x1c2291,_0x1cda84){return new BPromise(function(_0x25c4dc,_0x1cdd66){return client[_0x0816('0x8')](_0x57ba13,_0x1cda84)[_0x0816('0x9')](function(_0x34e815){logger[_0x0816('0xa')](_0x0816('0xb'),_0x1c2291,'request\x20sent');logger[_0x0816('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1c2291,_0x0816('0xd'),JSON[_0x0816('0xe')](_0x34e815));if(_0x34e815[_0x0816('0xf')]){if(_0x34e815['error'][_0x0816('0x10')]===0x1f4){logger[_0x0816('0xf')](_0x0816('0xb'),_0x1c2291,_0x34e815['error'][_0x0816('0x11')]);return _0x1cdd66(_0x34e815[_0x0816('0xf')][_0x0816('0x11')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1c2291,_0x34e815[_0x0816('0xf')][_0x0816('0x11')]);return _0x25c4dc(_0x34e815[_0x0816('0xf')][_0x0816('0x11')]);}else{logger['info'](_0x0816('0xb'),_0x1c2291,_0x0816('0xd'));_0x25c4dc(_0x34e815['result'][_0x0816('0x11')]);}})[_0x0816('0x12')](function(_0x3e9047){logger[_0x0816('0xf')](_0x0816('0xb'),_0x1c2291,_0x3e9047);_0x1cdd66(_0x3e9047);});});}
\ No newline at end of file
+var _0xdf6d=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x7d3ce3,_0x5d22cb){var _0x344b49=function(_0x4c825f){while(--_0x4c825f){_0x7d3ce3['push'](_0x7d3ce3['shift']());}};_0x344b49(++_0x5d22cb);}(_0xdf6d,0x19c));var _0xddf6=function(_0x1b214c,_0x50e594){_0x1b214c=_0x1b214c-0x0;var _0x383939=_0xdf6d[_0x1b214c];return _0x383939;};'use strict';var _=require(_0xddf6('0x0'));var util=require(_0xddf6('0x1'));var moment=require(_0xddf6('0x2'));var BPromise=require(_0xddf6('0x3'));var rs=require(_0xddf6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddf6('0x5'))['db'];var utils=require(_0xddf6('0x6'));var logger=require(_0xddf6('0x7'))(_0xddf6('0x8'));var config=require(_0xddf6('0x9'));var jayson=require(_0xddf6('0xa'));var client=jayson[_0xddf6('0xb')][_0xddf6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x104895,_0x380932,_0x51563b){return new BPromise(function(_0x5c79ad,_0x5cf557){return client['request'](_0x104895,_0x51563b)['then'](function(_0x5f1995){logger[_0xddf6('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x380932,_0xddf6('0xe'));logger[_0xddf6('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x380932,_0xddf6('0xe'),JSON[_0xddf6('0x10')](_0x5f1995));if(_0x5f1995['error']){if(_0x5f1995[_0xddf6('0x11')][_0xddf6('0x12')]===0x1f4){logger[_0xddf6('0x11')](_0xddf6('0x13'),_0x380932,_0x5f1995[_0xddf6('0x11')][_0xddf6('0x14')]);return _0x5cf557(_0x5f1995[_0xddf6('0x11')]['message']);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x380932,_0x5f1995[_0xddf6('0x11')][_0xddf6('0x14')]);return _0x5c79ad(_0x5f1995[_0xddf6('0x11')][_0xddf6('0x14')]);}else{logger[_0xddf6('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x380932,_0xddf6('0xe'));_0x5c79ad(_0x5f1995[_0xddf6('0x15')][_0xddf6('0x14')]);}})[_0xddf6('0x16')](function(_0x57ab70){logger[_0xddf6('0x11')](_0xddf6('0x13'),_0x380932,_0x57ab70);_0x5cf557(_0x57ab70);});});}
\ No newline at end of file
index 3fca601..43c774f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b1c=['/:id/resources','getResources','post','clone','addSections','addResources','put','update','delete','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/sections'];(function(_0xf4499c,_0x5f0b98){var _0x50eb5e=function(_0x122dd7){while(--_0x122dd7){_0xf4499c['push'](_0xf4499c['shift']());}};_0x50eb5e(++_0x5f0b98);}(_0x9b1c,0x1dc));var _0xc9b1=function(_0x4eb77c,_0x256d5a){_0x4eb77c=_0x4eb77c-0x0;var _0x73bc32=_0x9b1c[_0x4eb77c];return _0x73bc32;};'use strict';var multer=require(_0xc9b1('0x0'));var util=require(_0xc9b1('0x1'));var path=require(_0xc9b1('0x2'));var timeout=require(_0xc9b1('0x3'));var express=require(_0xc9b1('0x4'));var router=express[_0xc9b1('0x5')]();var fs_extra=require(_0xc9b1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc9b1('0x7'));var config=require(_0xc9b1('0x8'));var controller=require(_0xc9b1('0x9'));router[_0xc9b1('0xa')]('/',auth[_0xc9b1('0xb')](),controller['index']);router[_0xc9b1('0xa')](_0xc9b1('0xc'),auth[_0xc9b1('0xb')](),controller[_0xc9b1('0xd')]);router[_0xc9b1('0xa')](_0xc9b1('0xe'),auth['isAuthenticated'](),controller[_0xc9b1('0xf')]);router['get'](_0xc9b1('0x10'),auth[_0xc9b1('0xb')](),controller['getSections']);router[_0xc9b1('0xa')](_0xc9b1('0x11'),auth[_0xc9b1('0xb')](),controller[_0xc9b1('0x12')]);router[_0xc9b1('0x13')]('/',auth[_0xc9b1('0xb')](),controller['create']);router[_0xc9b1('0x13')]('/:id/clone',auth['isAuthenticated'](),controller[_0xc9b1('0x14')]);router['post']('/:id/sections',auth['isAuthenticated'](),controller[_0xc9b1('0x15')]);router[_0xc9b1('0x13')](_0xc9b1('0x11'),auth['isAuthenticated'](),controller[_0xc9b1('0x16')]);router[_0xc9b1('0x17')](_0xc9b1('0xe'),auth[_0xc9b1('0xb')](),controller[_0xc9b1('0x18')]);router[_0xc9b1('0x19')](_0xc9b1('0xe'),auth[_0xc9b1('0xb')](),controller['destroy']);router['delete']('/:id/sections',auth[_0xc9b1('0xb')](),controller[_0xc9b1('0x1a')]);router['delete'](_0xc9b1('0x11'),auth['isAuthenticated'](),controller[_0xc9b1('0x1b')]);module[_0xc9b1('0x1c')]=router;
\ No newline at end of file
+var _0x93a0=['index','describe','/:id','show','/:id/sections','getSections','getResources','post','/:id/clone','clone','addSections','/:id/resources','addResources','put','delete','destroy','removeSections','removeResources','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x3274a9,_0x54a7dd){var _0x4b2342=function(_0x357ed9){while(--_0x357ed9){_0x3274a9['push'](_0x3274a9['shift']());}};_0x4b2342(++_0x54a7dd);}(_0x93a0,0x12b));var _0x093a=function(_0x3f5c41,_0x38c1de){_0x3f5c41=_0x3f5c41-0x0;var _0x25b88a=_0x93a0[_0x3f5c41];return _0x25b88a;};'use strict';var multer=require(_0x093a('0x0'));var util=require('util');var path=require(_0x093a('0x1'));var timeout=require('connect-timeout');var express=require(_0x093a('0x2'));var router=express[_0x093a('0x3')]();var fs_extra=require(_0x093a('0x4'));var auth=require(_0x093a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x093a('0x6'));var controller=require('./userProfile.controller');router[_0x093a('0x7')]('/',auth[_0x093a('0x8')](),controller[_0x093a('0x9')]);router[_0x093a('0x7')]('/describe',auth[_0x093a('0x8')](),controller[_0x093a('0xa')]);router[_0x093a('0x7')](_0x093a('0xb'),auth[_0x093a('0x8')](),controller[_0x093a('0xc')]);router[_0x093a('0x7')](_0x093a('0xd'),auth[_0x093a('0x8')](),controller[_0x093a('0xe')]);router[_0x093a('0x7')]('/:id/resources',auth['isAuthenticated'](),controller[_0x093a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x093a('0x10')](_0x093a('0x11'),auth[_0x093a('0x8')](),controller[_0x093a('0x12')]);router['post']('/:id/sections',auth[_0x093a('0x8')](),controller[_0x093a('0x13')]);router[_0x093a('0x10')](_0x093a('0x14'),auth[_0x093a('0x8')](),controller[_0x093a('0x15')]);router[_0x093a('0x16')](_0x093a('0xb'),auth[_0x093a('0x8')](),controller['update']);router[_0x093a('0x17')](_0x093a('0xb'),auth[_0x093a('0x8')](),controller[_0x093a('0x18')]);router[_0x093a('0x17')](_0x093a('0xd'),auth[_0x093a('0x8')](),controller[_0x093a('0x19')]);router[_0x093a('0x17')](_0x093a('0x14'),auth[_0x093a('0x8')](),controller[_0x093a('0x1a')]);module[_0x093a('0x1b')]=router;
\ No newline at end of file
index fdff199..3c68b06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c18=['join','getDataValue','crudPermissions','STRING','BOOLEAN','sequelize','exports'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x1c18,0x7c));var _0x81c1=function(_0x5375fd,_0x50887f){_0x5375fd=_0x5375fd-0x0;var _0x142671=_0x1c18[_0x5375fd];return _0x142671;};'use strict';var Sequelize=require(_0x81c1('0x0'));module[_0x81c1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x114068){this['setDataValue']('crudPermissions',_0x114068?_0x114068[_0x81c1('0x2')](''):[]);},'get':function(){return this[_0x81c1('0x3')]('crudPermissions')?this[_0x81c1('0x3')](_0x81c1('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x81c1('0x5')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x81c1('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x81c1('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x81c1('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x81c1('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x81c1('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x81c1('0x6')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x59ab=['crudPermissions','join','getDataValue','BOOLEAN','exports','STRING','setDataValue'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x59ab,0x170));var _0xb59a=function(_0x24fd11,_0x57c976){_0x24fd11=_0x24fd11-0x0;var _0x5da68f=_0x59ab[_0x24fd11];return _0x5da68f;};'use strict';var Sequelize=require('sequelize');module[_0xb59a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xb59a('0x1')],'set':function(_0x169c6c){this[_0xb59a('0x2')](_0xb59a('0x3'),_0x169c6c?_0x169c6c[_0xb59a('0x4')](''):[]);},'get':function(){return this[_0xb59a('0x5')](_0xb59a('0x3'))?this[_0xb59a('0x5')](_0xb59a('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xb59a('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xb59a('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xb59a('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xb59a('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xb59a('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb59a('0x6')],'defaultValue':!![]}};
\ No newline at end of file
index 77686ed..6e0371f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc373=['getSections','includes','isEmpty','subsections','enabled','findOne','Dashboard','forEach','resourceId','userProfileId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','error','stack','name','index','UserProfile','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','Resources','update','destroy','describe','addSections','push','get','ids'];(function(_0x525e50,_0xdf83f2){var _0x2303a3=function(_0x122549){while(--_0x122549){_0x525e50['push'](_0x525e50['shift']());}};_0x2303a3(++_0xdf83f2);}(_0xc373,0x1c7));var _0x3c37=function(_0x561771,_0x554760){_0x561771=_0x561771-0x0;var _0x54d16e=_0xc373[_0x561771];return _0x54d16e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c37('0x0'));var zipdir=require(_0x3c37('0x1'));var jsonpatch=require(_0x3c37('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c37('0x3'));var Mustache=require(_0x3c37('0x4'));var util=require(_0x3c37('0x5'));var path=require(_0x3c37('0x6'));var sox=require(_0x3c37('0x7'));var csv=require(_0x3c37('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c37('0x9'));var squel=require(_0x3c37('0xa'));var crypto=require(_0x3c37('0xb'));var jsforce=require(_0x3c37('0xc'));var deskjs=require(_0x3c37('0xd'));var toCsv=require(_0x3c37('0x8'));var querystring=require(_0x3c37('0xe'));var Papa=require(_0x3c37('0xf'));var Redis=require(_0x3c37('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3c37('0x11'));var hardwareService=require(_0x3c37('0x12'));var logger=require(_0x3c37('0x13'))(_0x3c37('0x14'));var utils=require(_0x3c37('0x15'));var config=require(_0x3c37('0x16'));var licenseUtil=require(_0x3c37('0x17'));var db=require('../../mysqldb')['db'];config[_0x3c37('0x18')]=_[_0x3c37('0x19')](config[_0x3c37('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c37('0x18')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x37904b,_0x3be8b3){_0x3be8b3=_0x3be8b3||0xcc;return function(_0x2eca76){if(_0x2eca76){return _0x37904b[_0x3c37('0x1a')](_0x3be8b3);}return _0x37904b[_0x3c37('0x1b')](_0x3be8b3)[_0x3c37('0x1c')]();};}function respondWithResult(_0x25d36e,_0x40d3ee){_0x40d3ee=_0x40d3ee||0xc8;return function(_0x294ea3){if(_0x294ea3){return _0x25d36e['status'](_0x40d3ee)[_0x3c37('0x1d')](_0x294ea3);}};}function respondWithFilteredResult(_0x214a0b,_0x5201bb){return function(_0x55761e){if(_0x55761e){var _0x3ae991=typeof _0x5201bb[_0x3c37('0x1e')]===_0x3c37('0x1f')&&typeof _0x5201bb[_0x3c37('0x20')]===_0x3c37('0x1f');var _0x2b0f25=_0x55761e['count'];var _0x97c790=_0x3ae991?0x0:_0x5201bb['offset'];var _0x4c8932=_0x3ae991?_0x55761e[_0x3c37('0x21')]:_0x5201bb[_0x3c37('0x1e')]+_0x5201bb[_0x3c37('0x20')];var _0x7fe4f0;if(_0x4c8932>=_0x2b0f25){_0x4c8932=_0x2b0f25;_0x7fe4f0=0xc8;}else{_0x7fe4f0=0xce;}_0x214a0b[_0x3c37('0x1b')](_0x7fe4f0);return _0x214a0b['set'](_0x3c37('0x22'),_0x97c790+'-'+_0x4c8932+'/'+_0x2b0f25)['json'](_0x55761e);}return null;};}function patchUpdates(_0x3399a7){return function(_0x510baf){try{jsonpatch[_0x3c37('0x23')](_0x510baf,_0x3399a7,!![]);}catch(_0x2e4226){return BPromise[_0x3c37('0x24')](_0x2e4226);}return _0x510baf['save']();};}function saveUpdates(_0x51d25d,_0x5e004e){return function(_0x573e24){if(_0x573e24){return _0x573e24['update'](_0x51d25d)[_0x3c37('0x25')](function(_0xb334d0){return _0xb334d0;});}return null;};}function removeEntity(_0x1655c1,_0x3ab6bd){return function(_0x5dc9af){if(_0x5dc9af){return _0x5dc9af['destroy']()['then'](function(){_0x1655c1[_0x3c37('0x1b')](0xcc)[_0x3c37('0x1c')]();});}};}function handleEntityNotFound(_0x5e1df2,_0x4a9091){return function(_0x1ba7e0){if(!_0x1ba7e0){_0x5e1df2[_0x3c37('0x1a')](0x194);}return _0x1ba7e0;};}function handleError(_0x118269,_0xf98a18){_0xf98a18=_0xf98a18||0x1f4;return function(_0x64474f){logger[_0x3c37('0x26')](_0x64474f[_0x3c37('0x27')]);if(_0x64474f[_0x3c37('0x28')]){delete _0x64474f[_0x3c37('0x28')];}_0x118269[_0x3c37('0x1b')](_0xf98a18)['send'](_0x64474f);};}exports[_0x3c37('0x29')]=function(_0x2f7f87,_0x531931){var _0x579142={},_0x14936d={},_0x3bc99a={'count':0x0,'rows':[]};var _0x35590b=_['map'](db[_0x3c37('0x2a')]['rawAttributes'],function(_0x4548d3){return{'name':_0x4548d3[_0x3c37('0x2b')],'type':_0x4548d3[_0x3c37('0x2c')][_0x3c37('0x2d')]};});_0x14936d[_0x3c37('0x2e')]=_[_0x3c37('0x2f')](_0x35590b,_0x3c37('0x28'));_0x14936d[_0x3c37('0x30')]=_[_0x3c37('0x31')](_0x2f7f87[_0x3c37('0x30')]);_0x14936d['filters']=_['intersection'](_0x14936d['model'],_0x14936d[_0x3c37('0x30')]);_0x579142[_0x3c37('0x32')]=_[_0x3c37('0x33')](_0x14936d[_0x3c37('0x2e')],qs[_0x3c37('0x34')](_0x2f7f87[_0x3c37('0x30')][_0x3c37('0x34')]));_0x579142[_0x3c37('0x32')]=_0x579142[_0x3c37('0x32')][_0x3c37('0x35')]?_0x579142[_0x3c37('0x32')]:_0x14936d[_0x3c37('0x2e')];if(!_0x2f7f87['query'][_0x3c37('0x36')](_0x3c37('0x37'))){_0x579142['limit']=qs['limit'](_0x2f7f87[_0x3c37('0x30')][_0x3c37('0x20')]);_0x579142[_0x3c37('0x1e')]=qs[_0x3c37('0x1e')](_0x2f7f87[_0x3c37('0x30')][_0x3c37('0x1e')]);}_0x579142[_0x3c37('0x38')]=qs[_0x3c37('0x39')](_0x2f7f87[_0x3c37('0x30')]['sort']);_0x579142[_0x3c37('0x3a')]=qs[_0x3c37('0x3b')](_[_0x3c37('0x3c')](_0x2f7f87[_0x3c37('0x30')],_0x14936d[_0x3c37('0x3b')]),_0x35590b);if(_0x2f7f87[_0x3c37('0x30')][_0x3c37('0x3d')]){_0x579142[_0x3c37('0x3a')]=_[_0x3c37('0x3e')](_0x579142[_0x3c37('0x3a')],{'$or':_['map'](_0x35590b,function(_0x3b73be){if(_0x3b73be[_0x3c37('0x2c')]!==_0x3c37('0x3f')){var _0xab1900={};_0xab1900[_0x3b73be[_0x3c37('0x28')]]={'$like':'%'+_0x2f7f87['query'][_0x3c37('0x3d')]+'%'};return _0xab1900;}})});}_0x579142=_[_0x3c37('0x3e')]({},_0x579142,_0x2f7f87[_0x3c37('0x40')]);var _0x21576e={'where':_0x579142['where']};return db[_0x3c37('0x2a')]['count'](_0x21576e)[_0x3c37('0x25')](function(_0x51687d){_0x3bc99a[_0x3c37('0x21')]=_0x51687d;if(_0x2f7f87[_0x3c37('0x30')][_0x3c37('0x41')]){_0x579142['include']=[{'all':!![]}];}return db[_0x3c37('0x2a')][_0x3c37('0x42')](_0x579142);})[_0x3c37('0x25')](function(_0x2a4300){_0x3bc99a[_0x3c37('0x43')]=_0x2a4300;return _0x3bc99a;})['then'](respondWithFilteredResult(_0x531931,_0x579142))[_0x3c37('0x44')](handleError(_0x531931,null));};exports[_0x3c37('0x45')]=function(_0x2a2ad9,_0x420196){var _0x1f1632={'raw':![],'where':{'id':_0x2a2ad9[_0x3c37('0x46')]['id']}},_0x30ddbe={};_0x30ddbe['model']=_[_0x3c37('0x31')](db[_0x3c37('0x2a')][_0x3c37('0x47')]);_0x30ddbe['query']=_[_0x3c37('0x31')](_0x2a2ad9['query']);_0x30ddbe[_0x3c37('0x3b')]=_[_0x3c37('0x33')](_0x30ddbe[_0x3c37('0x2e')],_0x30ddbe[_0x3c37('0x30')]);_0x1f1632['attributes']=_['intersection'](_0x30ddbe['model'],qs[_0x3c37('0x34')](_0x2a2ad9[_0x3c37('0x30')]['fields']));_0x1f1632['attributes']=_0x1f1632[_0x3c37('0x32')]['length']?_0x1f1632[_0x3c37('0x32')]:_0x30ddbe[_0x3c37('0x2e')];if(_0x2a2ad9[_0x3c37('0x30')][_0x3c37('0x41')]){_0x1f1632[_0x3c37('0x48')]=[{'all':!![]}];}_0x1f1632=_[_0x3c37('0x3e')]({},_0x1f1632,_0x2a2ad9[_0x3c37('0x40')]);return db[_0x3c37('0x2a')][_0x3c37('0x49')](_0x1f1632)[_0x3c37('0x25')](handleEntityNotFound(_0x420196,null))[_0x3c37('0x25')](respondWithResult(_0x420196,null))['catch'](handleError(_0x420196,null));};exports[_0x3c37('0x4a')]=function(_0x1869ad,_0x4b8351){return db[_0x3c37('0x2a')][_0x3c37('0x4a')](_0x1869ad[_0x3c37('0x4b')],{})['then'](respondWithResult(_0x4b8351,0xc9))[_0x3c37('0x44')](handleError(_0x4b8351,null));};exports['clone']=function(_0x32f2f8,_0xaa6056){var _0x317851={'where':{'id':_0x32f2f8[_0x3c37('0x46')]['id']}},_0x5343e3={};_0x5343e3[_0x3c37('0x2e')]=_[_0x3c37('0x31')](db[_0x3c37('0x2a')][_0x3c37('0x47')]);_0x317851[_0x3c37('0x32')]=_[_0x3c37('0x33')](_0x5343e3[_0x3c37('0x2e')],qs[_0x3c37('0x34')](_0x32f2f8[_0x3c37('0x30')][_0x3c37('0x34')]));_0x317851[_0x3c37('0x32')]=_0x317851[_0x3c37('0x32')]['length']?_0x317851[_0x3c37('0x32')]:_0x5343e3[_0x3c37('0x2e')];if(_0x32f2f8[_0x3c37('0x30')]['includeAll']){_0x317851[_0x3c37('0x48')]=[{'all':!![]}];}_0x317851=_[_0x3c37('0x3e')]({},_0x317851,_0x32f2f8[_0x3c37('0x40')]);return db['UserProfile'][_0x3c37('0x49')](_0x317851)[_0x3c37('0x25')](handleEntityNotFound(_0xaa6056,null))[_0x3c37('0x25')](function(_0x183b19){if(_0x183b19){var _0x3a67e3=_0x183b19['get']({'plain':!![]});_0x3a67e3=qs[_0x3c37('0x4c')](_0x3a67e3,['id',_0x3c37('0x4d'),_0x3c37('0x4e'),_0x3c37('0x4f')]);_0x32f2f8['body']=_['omit'](_0x32f2f8[_0x3c37('0x4b')],['id','createdAt',_0x3c37('0x4e')]);return db[_0x3c37('0x50')][_0x3c37('0x51')](function(_0x5c8757){return db['UserProfile'][_0x3c37('0x4a')](_[_0x3c37('0x3e')](_0x3a67e3,_0x32f2f8[_0x3c37('0x4b')]),{'include':_0x32f2f8[_0x3c37('0x30')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x5c8757})[_0x3c37('0x25')](function(_0x1858bf){var _0x56d3d2=_0x1858bf['get']({'plain':!![]});return db[_0x3c37('0x52')]['findAll']({'where':{'userProfileId':_0x32f2f8[_0x3c37('0x46')]['id']},'raw':!![]})[_0x3c37('0x25')](function(_0xe0d4d){if(_0xe0d4d){return BPromise[_0x3c37('0x53')](_0xe0d4d,function(_0x4c589b){return new BPromise(function(_0xfb69a6,_0x5a0d96){if(_0x4c589b[_0x3c37('0x54')]===null||_0x4c589b[_0x3c37('0x54')]===0x1)_0xfb69a6(null);return db[_0x3c37('0x55')][_0x3c37('0x42')]({'where':{'sectionId':_0x4c589b['id']},'raw':!![]})['then'](function(_0x338098){var _0x57c209=_[_0x3c37('0x2f')](_0x338098,function(_0x6e6cfe){return qs[_0x3c37('0x4c')](_0x6e6cfe,['id','createdAt',_0x3c37('0x4e'),_0x3c37('0x56')]);});_0xfb69a6(_0x57c209);})['catch'](function(_0x415627){_0x5a0d96(_0x415627);});})[_0x3c37('0x25')](function(_0x1d5c6f){var _0x5964d4=qs[_0x3c37('0x4c')](_0x4c589b,['id',_0x3c37('0x4d'),'updatedAt']);_0x5964d4['userProfileId']=_0x56d3d2['id'];if(_0x1d5c6f)_0x5964d4['Resources']=_0x1d5c6f;return _0x5964d4;})[_0x3c37('0x25')](function(_0x1c02aa){return db[_0x3c37('0x52')][_0x3c37('0x4a')](_0x1c02aa,{'include':[{'model':db[_0x3c37('0x55')],'as':_0x3c37('0x57')}],'raw':!![],'transaction':_0x5c8757});});})[_0x3c37('0x25')](function(){return _0x56d3d2;});}});});});}})[_0x3c37('0x25')](respondWithResult(_0xaa6056,0xc9))[_0x3c37('0x44')](handleError(_0xaa6056,null));};exports[_0x3c37('0x58')]=function(_0x10a4de,_0x4511be){if(_0x10a4de[_0x3c37('0x4b')]['id']){delete _0x10a4de['body']['id'];}return db[_0x3c37('0x2a')][_0x3c37('0x49')]({'where':{'id':_0x10a4de[_0x3c37('0x46')]['id']}})[_0x3c37('0x25')](handleEntityNotFound(_0x4511be,null))[_0x3c37('0x25')](saveUpdates(_0x10a4de['body'],null))[_0x3c37('0x25')](respondWithResult(_0x4511be,null))[_0x3c37('0x44')](handleError(_0x4511be,null));};exports[_0x3c37('0x59')]=function(_0x3e6fa4,_0x309131){return db['UserProfile']['find']({'where':{'id':_0x3e6fa4['params']['id']}})[_0x3c37('0x25')](handleEntityNotFound(_0x309131,null))[_0x3c37('0x25')](removeEntity(_0x309131,null))[_0x3c37('0x44')](handleError(_0x309131,null));};exports['describe']=function(_0x471046,_0x497e52){return db[_0x3c37('0x2a')][_0x3c37('0x5a')]()[_0x3c37('0x25')](respondWithResult(_0x497e52,null))['catch'](handleError(_0x497e52,null));};exports[_0x3c37('0x5b')]=function(_0xc2f37e,_0x440271){var _0xc30769=_0xc2f37e[_0x3c37('0x4b')];return db['UserProfile'][_0x3c37('0x49')]({'where':{'id':_0xc2f37e[_0x3c37('0x46')]['id']}})[_0x3c37('0x25')](handleEntityNotFound(_0x440271,null))[_0x3c37('0x25')](function(_0x1cf913){if(_0x1cf913){return db[_0x3c37('0x50')][_0x3c37('0x51')](function(_0x4c2c60){return db[_0x3c37('0x52')]['destroy']({'where':{'userProfileId':_0xc2f37e[_0x3c37('0x46')]['id'],'sectionId':_[_0x3c37('0x2f')](_0xc30769,function(_0x207d15){return _0x207d15['sectionId'];})},'transaction':_0x4c2c60})[_0x3c37('0x25')](function(){var _0x3ef528=_[_0x3c37('0x2f')](_0xc30769,function(_0x4cc1bd){_0x4cc1bd['userProfileId']=_0xc2f37e[_0x3c37('0x46')]['id'];return _0x4cc1bd;});var _0x567d38=[];return BPromise[_0x3c37('0x53')](_0x3ef528,function(_0x5c0878){return db[_0x3c37('0x52')]['create'](_0x5c0878,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x4c2c60})['then'](function(_0x56c31b){_0x567d38[_0x3c37('0x5c')](_0x56c31b[_0x3c37('0x5d')]({'plain':!![]}));});})[_0x3c37('0x25')](function(){return _0x567d38;});});});}})[_0x3c37('0x25')](function(_0x2175db){return _0x2175db;})[_0x3c37('0x25')](respondWithResult(_0x440271,null))['catch'](handleError(_0x440271,null));};exports['removeSections']=function(_0x5c9b10,_0x8cb9d7){var _0x1dbfde;return db['UserProfile'][_0x3c37('0x49')]({'where':{'id':_0x5c9b10[_0x3c37('0x46')]['id']},'attributes':['id',_0x3c37('0x28')]})[_0x3c37('0x25')](handleEntityNotFound(_0x8cb9d7,null))[_0x3c37('0x25')](function(_0x1ac66c){if(_0x1ac66c){_0x1dbfde=_0x1ac66c;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x5c9b10['params']['id'],'sectionId':_0x5c9b10[_0x3c37('0x30')][_0x3c37('0x5e')]}});}})[_0x3c37('0x25')](function(){return _0x1dbfde;})[_0x3c37('0x25')](respondWithStatusCode(_0x8cb9d7,null))[_0x3c37('0x44')](handleError(_0x8cb9d7,null));};exports[_0x3c37('0x5f')]=function(_0x3e7003,_0x181133){var _0x1f1be3=[];var _0x23be20=[];return db[_0x3c37('0x52')][_0x3c37('0x42')]({'where':{'userProfileId':_0x3e7003[_0x3c37('0x46')]['id']},'raw':!![]})[_0x3c37('0x25')](function(_0x1efa11){_0x1f1be3=_['filter'](_0x1efa11,function(_0x599ccf){return _0x599ccf['enabled']===0x1||_[_0x3c37('0x60')]([0x3eb,0x709],_0x599ccf[_0x3c37('0x56')]);});if(!_[_0x3c37('0x61')](_0x1f1be3)){return _[_0x3c37('0x2f')](_0x1f1be3,function(_0x470019){return _0x470019['sectionId'];});}else{return;}})['then'](function(_0x18785e){if(_0x18785e)_0x23be20=_0x18785e;if(_['includes'](_0x23be20,0x64)){var _0x5617b2=_[_0x3c37('0x49')](_0x1f1be3,{'sectionId':0x64});return hasDefaultDashboard(_0x5617b2)[_0x3c37('0x25')](function(_0x699ac8){return _[_0x3c37('0x2f')](_0x1f1be3,function(_0xebe5df){if(_0xebe5df['sectionId']===0x64){_0xebe5df[_0x3c37('0x62')]=_0x699ac8;}return _0xebe5df;});});}else{return;}})['then'](function(_0x32cc9a){if(_0x32cc9a)_0x1f1be3=_0x32cc9a;if(_[_0x3c37('0x60')](_0x23be20,0x3eb)){var _0x28c743=_[_0x3c37('0x49')](_0x1f1be3,{'sectionId':0x3eb});return getCustomDashboards(_0x28c743)[_0x3c37('0x25')](function(_0x4e189d){return _[_0x3c37('0x2f')](_0x1f1be3,function(_0x36acc2){if(_0x28c743[_0x3c37('0x63')]){if(_0x36acc2['sectionId']===0x3eb){_0x36acc2[_0x3c37('0x62')]=_0x4e189d;}}else{if(_0x36acc2[_0x3c37('0x56')]===0x64){_0x36acc2[_0x3c37('0x62')]=_0x4e189d;}}return _0x36acc2;});});}else{return;}})[_0x3c37('0x25')](function(_0x482036){if(_0x482036)_0x1f1be3=_0x482036;if(_[_0x3c37('0x60')](_0x23be20,0x709)){var _0x2864ec=_[_0x3c37('0x49')](_0x1f1be3,{'sectionId':0x709});return getPlugins(_0x2864ec)[_0x3c37('0x25')](function(_0x3a0f7e){if(_0x2864ec[_0x3c37('0x63')]){return _[_0x3c37('0x2f')](_0x1f1be3,function(_0x1334a9){if(_0x1334a9['sectionId']===0x709){_0x1334a9[_0x3c37('0x62')]=_0x3a0f7e;}return _0x1334a9;});}else{var _0x3cda5c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3a0f7e};var _0x151c92=_[_0x3c37('0x2f')](_0x1f1be3);_0x151c92[_0x3c37('0x5c')](_0x3cda5c);return _0x151c92;}});}else{return;}})['then'](function(_0xf62d66){if(_0xf62d66)_0x1f1be3=_0xf62d66;return _[_0x3c37('0x3d')](_0x1f1be3,[_0x3c37('0x63'),0x1]);})['then'](respondWithResult(_0x181133,null))[_0x3c37('0x44')](handleError(_0x181133,null));};function hasDefaultDashboard(_0x447523){var _0x1bee7a=[0x65];return new BPromise(function(_0x4232d8,_0x2372b3){try{if(_0x447523[_0x3c37('0x54')]){_0x4232d8(_0x1bee7a);}else{return db['UserProfileResource'][_0x3c37('0x64')]({'where':{'sectionId':_0x447523['id']},'raw':!![]})[_0x3c37('0x25')](function(_0x2ed337){_0x2ed337?_0x4232d8(_0x1bee7a):_0x4232d8();});}}catch(_0x16bb10){_0x2372b3(_0x16bb10);}});}function getCustomDashboards(_0x44584f){var _0x4f09a3=[];return new BPromise(function(_0x3fdda9,_0xd296e3){try{if(_0x44584f[_0x3c37('0x54')]){return db[_0x3c37('0x65')]['findAll']({'raw':!![]})[_0x3c37('0x25')](function(_0x303d33){_0x303d33[_0x3c37('0x66')](function(_0x4cf765){_0x4f09a3[_0x3c37('0x5c')](_0x4cf765['id']+0x1869f);});_0x3fdda9(_0x4f09a3);});}else{return db[_0x3c37('0x55')][_0x3c37('0x42')]({'where':{'sectionId':_0x44584f['id']},'raw':!![]})[_0x3c37('0x25')](function(_0x20be64){_0x20be64[_0x3c37('0x66')](function(_0x51ec5a){_0x4f09a3['push'](_0x51ec5a[_0x3c37('0x67')]+0x1869f);});_0x3fdda9(_0x4f09a3);});}}catch(_0x47b705){_0xd296e3(_0x47b705);}});}function getPlugins(_0x4213eb){var _0x1f466b=[];return new BPromise(function(_0x2bb8f0,_0x784318){try{if(_0x4213eb['autoAssociation']){return db['Plugin'][_0x3c37('0x42')]({'raw':!![]})[_0x3c37('0x25')](function(_0x5e1c21){_0x5e1c21[_0x3c37('0x66')](function(_0x20846f){_0x1f466b['push'](_0x20846f['id']+0x15b38);});_0x2bb8f0(_0x1f466b);});}else{return db[_0x3c37('0x55')][_0x3c37('0x42')]({'where':{'sectionId':_0x4213eb['id']},'raw':!![]})[_0x3c37('0x25')](function(_0x1e312f){_0x1e312f[_0x3c37('0x66')](function(_0x2747e0){_0x1f466b['push'](_0x2747e0[_0x3c37('0x67')]+0x15b38);});_0x2bb8f0(_0x1f466b);});}}catch(_0x1b2057){_0x784318(_0x1b2057);}});}exports['addResources']=function(_0x28e4f6,_0x15b54f){return db[_0x3c37('0x2a')][_0x3c37('0x49')]({'where':{'id':_0x28e4f6['params']['id']}})[_0x3c37('0x25')](handleEntityNotFound(_0x15b54f,null))[_0x3c37('0x25')](function(_0x4483ec){if(_0x4483ec){return db[_0x3c37('0x50')]['transaction'](function(_0x1b71e8){return db['UserProfileSection'][_0x3c37('0x42')]({'where':{'userProfileId':_0x28e4f6[_0x3c37('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x3c37('0x25')](function(_0x32fba7){if(_0x32fba7){return db[_0x3c37('0x52')][_0x3c37('0x59')]({'where':{'userProfileId':_0x28e4f6['params']['id'],'id':_['map'](_0x32fba7,function(_0x2d650c){return _0x2d650c['id'];})},'transaction':_0x1b71e8});}})[_0x3c37('0x25')](function(_0x84429f){var _0x452bf4=_[_0x3c37('0x2f')](_0x28e4f6[_0x3c37('0x4b')],function(_0x16d7b6){_0x16d7b6[_0x3c37('0x68')]=_0x28e4f6['params']['id'];return _0x16d7b6;});return db['UserProfileSection'][_0x3c37('0x69')](_0x452bf4,{'raw':!![],'transaction':_0x1b71e8});})[_0x3c37('0x25')](function(_0x29b8f8){var _0x194d4f=_[_0x3c37('0x3d')](_[_0x3c37('0x2f')](_0x29b8f8,function(_0x4b5272){return _0x4b5272['get']({'plain':!![]});}),{'includeAll':![]});if(_0x194d4f){return db['UserProfileSection'][_0x3c37('0x42')]({'where':{'userProfileId':_0x28e4f6[_0x3c37('0x46')]['id'],'sectionId':_[_0x3c37('0x2f')](_0x194d4f,function(_0x3ae623){return _0x3ae623[_0x3c37('0x56')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x3c37('0x25')](function(_0x30d74f){var _0x3c9016=_[_0x3c37('0x2f')](_0x28e4f6['body'],function(_0x5589d2){_0x5589d2['userProfileId']=_0x28e4f6[_0x3c37('0x46')]['id'];return _0x5589d2;});return db['UserProfileResource']['bulkCreate'](_0x3c9016,{'raw':!![],'transaction':_0x1b71e8});});}})['catch'](handleError(_0x15b54f,null));});}})[_0x3c37('0x25')](function(_0x3c0712){var _0x10c679=_['map'](_0x3c0712,function(_0x4d8c95){return _0x4d8c95[_0x3c37('0x5d')]({'plain':!![]});});})[_0x3c37('0x25')](respondWithResult(_0x15b54f,null))[_0x3c37('0x44')](handleError(_0x15b54f,null));};exports[_0x3c37('0x6a')]=function(_0x341bfd,_0x461b3e,_0x2c97eb){return db[_0x3c37('0x2a')][_0x3c37('0x49')]({'where':{'id':_0x341bfd[_0x3c37('0x46')]['id']}})[_0x3c37('0x25')](handleEntityNotFound(_0x461b3e,null))[_0x3c37('0x25')](function(_0x27c1d4){if(_0x27c1d4){return _0x27c1d4[_0x3c37('0x6a')](_0x341bfd[_0x3c37('0x30')]['ids']);}})[_0x3c37('0x25')](respondWithStatusCode(_0x461b3e,null))[_0x3c37('0x44')](handleError(_0x461b3e,null));};exports[_0x3c37('0x6b')]=function(_0x2300aa,_0x5e7807){var _0x3f1280={};if(!_0x2300aa[_0x3c37('0x30')][_0x3c37('0x6c')])throw new Error(_0x3c37('0x6d'));if(!_0x2300aa[_0x3c37('0x30')][_0x3c37('0x36')]('nolimit')){_0x3f1280['limit']=qs[_0x3c37('0x20')](_0x2300aa[_0x3c37('0x30')][_0x3c37('0x20')]);_0x3f1280[_0x3c37('0x1e')]=qs[_0x3c37('0x1e')](_0x2300aa['query'][_0x3c37('0x1e')]);}return db[_0x3c37('0x2a')]['find']({'where':{'id':_0x2300aa[_0x3c37('0x46')]['id']}})['then'](function(_0x439ae5){if(!_0x439ae5)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x2300aa[_0x3c37('0x46')]['id']);return db['UserProfile'][_0x3c37('0x6b')](_0x2300aa);})[_0x3c37('0x25')](respondWithFilteredResult(_0x5e7807,_0x3f1280))[_0x3c37('0x44')](handleError(_0x5e7807,null));};
\ No newline at end of file
+var _0x5430=['includeAll','include','rows','catch','show','keys','create','clone','params','find','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','transaction','removeSections','ids','enabled','isEmpty','includes','subsections','findOne','Dashboard','forEach','push','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','error','name','index','map','UserProfile','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','type','VIRTUAL','options'];(function(_0x22e644,_0x411f77){var _0x517ddf=function(_0x178311){while(--_0x178311){_0x22e644['push'](_0x22e644['shift']());}};_0x517ddf(++_0x411f77);}(_0x5430,0x10c));var _0x0543=function(_0x4159ef,_0x56dd1b){_0x4159ef=_0x4159ef-0x0;var _0x3f5fac=_0x5430[_0x4159ef];return _0x3f5fac;};'use strict';var emlformat=require(_0x0543('0x0'));var rimraf=require(_0x0543('0x1'));var zipdir=require(_0x0543('0x2'));var jsonpatch=require(_0x0543('0x3'));var rp=require(_0x0543('0x4'));var moment=require(_0x0543('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0543('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0543('0x7'));var ejs=require(_0x0543('0x8'));var fs=require('fs');var fs_extra=require(_0x0543('0x9'));var _=require(_0x0543('0xa'));var squel=require(_0x0543('0xb'));var crypto=require('crypto');var jsforce=require(_0x0543('0xc'));var deskjs=require(_0x0543('0xd'));var toCsv=require(_0x0543('0x7'));var querystring=require(_0x0543('0xe'));var Papa=require(_0x0543('0xf'));var Redis=require(_0x0543('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0543('0x11'));var as=require(_0x0543('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0543('0x13'))(_0x0543('0x14'));var utils=require(_0x0543('0x15'));var config=require(_0x0543('0x16'));var licenseUtil=require(_0x0543('0x17'));var db=require(_0x0543('0x18'))['db'];config[_0x0543('0x19')]=_[_0x0543('0x1a')](config[_0x0543('0x19')],{'host':_0x0543('0x1b'),'port':0x18eb});var socket=require(_0x0543('0x1c'))(new Redis(config[_0x0543('0x19')]));require('./userProfile.socket')[_0x0543('0x1d')](socket);function respondWithStatusCode(_0x21e9ac,_0x4d2a27){_0x4d2a27=_0x4d2a27||0xcc;return function(_0x4c4763){if(_0x4c4763){return _0x21e9ac[_0x0543('0x1e')](_0x4d2a27);}return _0x21e9ac[_0x0543('0x1f')](_0x4d2a27)[_0x0543('0x20')]();};}function respondWithResult(_0x1cfadf,_0x38a32e){_0x38a32e=_0x38a32e||0xc8;return function(_0x50d504){if(_0x50d504){return _0x1cfadf[_0x0543('0x1f')](_0x38a32e)[_0x0543('0x21')](_0x50d504);}};}function respondWithFilteredResult(_0x2dd5cb,_0x25254e){return function(_0x20b396){if(_0x20b396){var _0x285080=typeof _0x25254e[_0x0543('0x22')]==='undefined'&&typeof _0x25254e[_0x0543('0x23')]==='undefined';var _0x50ea84=_0x20b396[_0x0543('0x24')];var _0x419913=_0x285080?0x0:_0x25254e[_0x0543('0x22')];var _0x52eb53=_0x285080?_0x20b396[_0x0543('0x24')]:_0x25254e['offset']+_0x25254e[_0x0543('0x23')];var _0x411ec2;if(_0x52eb53>=_0x50ea84){_0x52eb53=_0x50ea84;_0x411ec2=0xc8;}else{_0x411ec2=0xce;}_0x2dd5cb['status'](_0x411ec2);return _0x2dd5cb[_0x0543('0x25')](_0x0543('0x26'),_0x419913+'-'+_0x52eb53+'/'+_0x50ea84)[_0x0543('0x21')](_0x20b396);}return null;};}function patchUpdates(_0x110060){return function(_0x37347e){try{jsonpatch[_0x0543('0x27')](_0x37347e,_0x110060,!![]);}catch(_0x4adba7){return BPromise['reject'](_0x4adba7);}return _0x37347e['save']();};}function saveUpdates(_0xbfe5dc,_0x25b3a1){return function(_0x15ebeb){if(_0x15ebeb){return _0x15ebeb[_0x0543('0x28')](_0xbfe5dc)[_0x0543('0x29')](function(_0x26e500){return _0x26e500;});}return null;};}function removeEntity(_0x36d824,_0x17a3de){return function(_0x1fca8a){if(_0x1fca8a){return _0x1fca8a[_0x0543('0x2a')]()[_0x0543('0x29')](function(){_0x36d824[_0x0543('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e6f1,_0x153bda){return function(_0x30ad9e){if(!_0x30ad9e){_0x25e6f1['sendStatus'](0x194);}return _0x30ad9e;};}function handleError(_0x9c7e34,_0x27031f){_0x27031f=_0x27031f||0x1f4;return function(_0x41c4a7){logger[_0x0543('0x2b')](_0x41c4a7['stack']);if(_0x41c4a7[_0x0543('0x2c')]){delete _0x41c4a7[_0x0543('0x2c')];}_0x9c7e34['status'](_0x27031f)['send'](_0x41c4a7);};}exports[_0x0543('0x2d')]=function(_0x16165c,_0x51d49d){var _0x3b879b={},_0x2e03d1={},_0x931ccc={'count':0x0,'rows':[]};var _0x2bd6ce=_[_0x0543('0x2e')](db[_0x0543('0x2f')][_0x0543('0x30')],function(_0x4f9b63){return{'name':_0x4f9b63[_0x0543('0x31')],'type':_0x4f9b63['type'][_0x0543('0x32')]};});_0x2e03d1[_0x0543('0x33')]=_[_0x0543('0x2e')](_0x2bd6ce,_0x0543('0x2c'));_0x2e03d1[_0x0543('0x34')]=_['keys'](_0x16165c[_0x0543('0x34')]);_0x2e03d1['filters']=_[_0x0543('0x35')](_0x2e03d1[_0x0543('0x33')],_0x2e03d1[_0x0543('0x34')]);_0x3b879b[_0x0543('0x36')]=_['intersection'](_0x2e03d1[_0x0543('0x33')],qs['fields'](_0x16165c[_0x0543('0x34')][_0x0543('0x37')]));_0x3b879b[_0x0543('0x36')]=_0x3b879b[_0x0543('0x36')][_0x0543('0x38')]?_0x3b879b[_0x0543('0x36')]:_0x2e03d1[_0x0543('0x33')];if(!_0x16165c[_0x0543('0x34')][_0x0543('0x39')](_0x0543('0x3a'))){_0x3b879b['limit']=qs[_0x0543('0x23')](_0x16165c[_0x0543('0x34')]['limit']);_0x3b879b[_0x0543('0x22')]=qs['offset'](_0x16165c[_0x0543('0x34')][_0x0543('0x22')]);}_0x3b879b['order']=qs['sort'](_0x16165c[_0x0543('0x34')][_0x0543('0x3b')]);_0x3b879b['where']=qs[_0x0543('0x3c')](_[_0x0543('0x3d')](_0x16165c['query'],_0x2e03d1[_0x0543('0x3c')]),_0x2bd6ce);if(_0x16165c[_0x0543('0x34')][_0x0543('0x3e')]){_0x3b879b[_0x0543('0x3f')]=_[_0x0543('0x40')](_0x3b879b['where'],{'$or':_['map'](_0x2bd6ce,function(_0x4816ac){if(_0x4816ac[_0x0543('0x41')]!==_0x0543('0x42')){var _0x43128f={};_0x43128f[_0x4816ac[_0x0543('0x2c')]]={'$like':'%'+_0x16165c['query'][_0x0543('0x3e')]+'%'};return _0x43128f;}})});}_0x3b879b=_[_0x0543('0x40')]({},_0x3b879b,_0x16165c[_0x0543('0x43')]);var _0x222765={'where':_0x3b879b[_0x0543('0x3f')]};return db[_0x0543('0x2f')][_0x0543('0x24')](_0x222765)['then'](function(_0x24a891){_0x931ccc[_0x0543('0x24')]=_0x24a891;if(_0x16165c[_0x0543('0x34')][_0x0543('0x44')]){_0x3b879b[_0x0543('0x45')]=[{'all':!![]}];}return db[_0x0543('0x2f')]['findAll'](_0x3b879b);})['then'](function(_0x44116a){_0x931ccc[_0x0543('0x46')]=_0x44116a;return _0x931ccc;})[_0x0543('0x29')](respondWithFilteredResult(_0x51d49d,_0x3b879b))[_0x0543('0x47')](handleError(_0x51d49d,null));};exports[_0x0543('0x48')]=function(_0xff6a88,_0x247f44){var _0x3fe39a={'raw':![],'where':{'id':_0xff6a88['params']['id']}},_0x1df75e={};_0x1df75e['model']=_[_0x0543('0x49')](db[_0x0543('0x2f')]['rawAttributes']);_0x1df75e['query']=_[_0x0543('0x49')](_0xff6a88[_0x0543('0x34')]);_0x1df75e['filters']=_[_0x0543('0x35')](_0x1df75e['model'],_0x1df75e[_0x0543('0x34')]);_0x3fe39a[_0x0543('0x36')]=_['intersection'](_0x1df75e['model'],qs[_0x0543('0x37')](_0xff6a88['query'][_0x0543('0x37')]));_0x3fe39a[_0x0543('0x36')]=_0x3fe39a[_0x0543('0x36')][_0x0543('0x38')]?_0x3fe39a[_0x0543('0x36')]:_0x1df75e[_0x0543('0x33')];if(_0xff6a88['query'][_0x0543('0x44')]){_0x3fe39a[_0x0543('0x45')]=[{'all':!![]}];}_0x3fe39a=_[_0x0543('0x40')]({},_0x3fe39a,_0xff6a88[_0x0543('0x43')]);return db[_0x0543('0x2f')]['find'](_0x3fe39a)[_0x0543('0x29')](handleEntityNotFound(_0x247f44,null))['then'](respondWithResult(_0x247f44,null))[_0x0543('0x47')](handleError(_0x247f44,null));};exports[_0x0543('0x4a')]=function(_0x3f4c40,_0x46d398){return db[_0x0543('0x2f')][_0x0543('0x4a')](_0x3f4c40['body'],{})['then'](respondWithResult(_0x46d398,0xc9))['catch'](handleError(_0x46d398,null));};exports[_0x0543('0x4b')]=function(_0x2177b8,_0x4964ba){var _0x188bfd={'where':{'id':_0x2177b8[_0x0543('0x4c')]['id']}},_0x1d9432={};_0x1d9432[_0x0543('0x33')]=_[_0x0543('0x49')](db[_0x0543('0x2f')]['rawAttributes']);_0x188bfd[_0x0543('0x36')]=_[_0x0543('0x35')](_0x1d9432[_0x0543('0x33')],qs[_0x0543('0x37')](_0x2177b8[_0x0543('0x34')][_0x0543('0x37')]));_0x188bfd[_0x0543('0x36')]=_0x188bfd[_0x0543('0x36')][_0x0543('0x38')]?_0x188bfd[_0x0543('0x36')]:_0x1d9432[_0x0543('0x33')];if(_0x2177b8[_0x0543('0x34')][_0x0543('0x44')]){_0x188bfd[_0x0543('0x45')]=[{'all':!![]}];}_0x188bfd=_['merge']({},_0x188bfd,_0x2177b8[_0x0543('0x43')]);return db[_0x0543('0x2f')][_0x0543('0x4d')](_0x188bfd)[_0x0543('0x29')](handleEntityNotFound(_0x4964ba,null))[_0x0543('0x29')](function(_0x2980ad){if(_0x2980ad){var _0x3a6022=_0x2980ad[_0x0543('0x4e')]({'plain':!![]});_0x3a6022=qs[_0x0543('0x4f')](_0x3a6022,['id',_0x0543('0x50'),_0x0543('0x51'),_0x0543('0x52')]);_0x2177b8[_0x0543('0x53')]=_[_0x0543('0x4f')](_0x2177b8[_0x0543('0x53')],['id','createdAt',_0x0543('0x51')]);return db[_0x0543('0x54')]['transaction'](function(_0x59eea9){return db[_0x0543('0x2f')][_0x0543('0x4a')](_['merge'](_0x3a6022,_0x2177b8[_0x0543('0x53')]),{'include':_0x2177b8['query'][_0x0543('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x59eea9})['then'](function(_0x31aea7){var _0x588fca=_0x31aea7[_0x0543('0x4e')]({'plain':!![]});return db[_0x0543('0x55')][_0x0543('0x56')]({'where':{'userProfileId':_0x2177b8['params']['id']},'raw':!![]})[_0x0543('0x29')](function(_0x1a569b){if(_0x1a569b){return BPromise[_0x0543('0x57')](_0x1a569b,function(_0xf46956){return new BPromise(function(_0x313937,_0x42dbbf){if(_0xf46956[_0x0543('0x58')]===null||_0xf46956[_0x0543('0x58')]===0x1)_0x313937(null);return db[_0x0543('0x59')][_0x0543('0x56')]({'where':{'sectionId':_0xf46956['id']},'raw':!![]})[_0x0543('0x29')](function(_0x2ff23a){var _0x378566=_[_0x0543('0x2e')](_0x2ff23a,function(_0x2fc5f4){return qs['omit'](_0x2fc5f4,['id','createdAt',_0x0543('0x51'),_0x0543('0x5a')]);});_0x313937(_0x378566);})[_0x0543('0x47')](function(_0x28ad29){_0x42dbbf(_0x28ad29);});})[_0x0543('0x29')](function(_0x203cf7){var _0x4c4e49=qs[_0x0543('0x4f')](_0xf46956,['id',_0x0543('0x50'),'updatedAt']);_0x4c4e49[_0x0543('0x5b')]=_0x588fca['id'];if(_0x203cf7)_0x4c4e49[_0x0543('0x5c')]=_0x203cf7;return _0x4c4e49;})[_0x0543('0x29')](function(_0x46c33f){return db['UserProfileSection'][_0x0543('0x4a')](_0x46c33f,{'include':[{'model':db[_0x0543('0x59')],'as':_0x0543('0x5c')}],'raw':!![],'transaction':_0x59eea9});});})['then'](function(){return _0x588fca;});}});});});}})['then'](respondWithResult(_0x4964ba,0xc9))[_0x0543('0x47')](handleError(_0x4964ba,null));};exports[_0x0543('0x28')]=function(_0x1f44a3,_0x5311b7){if(_0x1f44a3[_0x0543('0x53')]['id']){delete _0x1f44a3[_0x0543('0x53')]['id'];}return db[_0x0543('0x2f')]['find']({'where':{'id':_0x1f44a3[_0x0543('0x4c')]['id']}})[_0x0543('0x29')](handleEntityNotFound(_0x5311b7,null))[_0x0543('0x29')](saveUpdates(_0x1f44a3[_0x0543('0x53')],null))[_0x0543('0x29')](respondWithResult(_0x5311b7,null))[_0x0543('0x47')](handleError(_0x5311b7,null));};exports[_0x0543('0x2a')]=function(_0x2fb930,_0x41cac7){return db[_0x0543('0x2f')][_0x0543('0x4d')]({'where':{'id':_0x2fb930[_0x0543('0x4c')]['id']}})[_0x0543('0x29')](handleEntityNotFound(_0x41cac7,null))[_0x0543('0x29')](removeEntity(_0x41cac7,null))['catch'](handleError(_0x41cac7,null));};exports['describe']=function(_0x41f0f2,_0x1f767c){return db[_0x0543('0x2f')][_0x0543('0x5d')]()['then'](respondWithResult(_0x1f767c,null))[_0x0543('0x47')](handleError(_0x1f767c,null));};exports['addSections']=function(_0x1e1fc0,_0x3fd0ad){var _0x2ab9f=_0x1e1fc0['body'];return db['UserProfile'][_0x0543('0x4d')]({'where':{'id':_0x1e1fc0['params']['id']}})['then'](handleEntityNotFound(_0x3fd0ad,null))[_0x0543('0x29')](function(_0x1f26dd){if(_0x1f26dd){return db[_0x0543('0x54')][_0x0543('0x5e')](function(_0x338c62){return db[_0x0543('0x55')][_0x0543('0x2a')]({'where':{'userProfileId':_0x1e1fc0[_0x0543('0x4c')]['id'],'sectionId':_[_0x0543('0x2e')](_0x2ab9f,function(_0x55bfa5){return _0x55bfa5[_0x0543('0x5a')];})},'transaction':_0x338c62})[_0x0543('0x29')](function(){var _0xe3fccd=_[_0x0543('0x2e')](_0x2ab9f,function(_0x3d918d){_0x3d918d['userProfileId']=_0x1e1fc0[_0x0543('0x4c')]['id'];return _0x3d918d;});var _0x5738de=[];return BPromise[_0x0543('0x57')](_0xe3fccd,function(_0x85a666){return db[_0x0543('0x55')][_0x0543('0x4a')](_0x85a666,{'include':[{'model':db['UserProfileResource'],'as':_0x0543('0x5c')}],'raw':!![],'transaction':_0x338c62})[_0x0543('0x29')](function(_0x439121){_0x5738de['push'](_0x439121[_0x0543('0x4e')]({'plain':!![]}));});})['then'](function(){return _0x5738de;});});});}})[_0x0543('0x29')](function(_0x3f8fb5){return _0x3f8fb5;})[_0x0543('0x29')](respondWithResult(_0x3fd0ad,null))[_0x0543('0x47')](handleError(_0x3fd0ad,null));};exports[_0x0543('0x5f')]=function(_0x21c920,_0x54f120){var _0x59f214;return db['UserProfile'][_0x0543('0x4d')]({'where':{'id':_0x21c920[_0x0543('0x4c')]['id']},'attributes':['id',_0x0543('0x2c')]})[_0x0543('0x29')](handleEntityNotFound(_0x54f120,null))[_0x0543('0x29')](function(_0x3e3bbe){if(_0x3e3bbe){_0x59f214=_0x3e3bbe;return db[_0x0543('0x55')][_0x0543('0x2a')]({'where':{'userProfileId':_0x21c920['params']['id'],'sectionId':_0x21c920['query'][_0x0543('0x60')]}});}})[_0x0543('0x29')](function(){return _0x59f214;})['then'](respondWithStatusCode(_0x54f120,null))[_0x0543('0x47')](handleError(_0x54f120,null));};exports['getSections']=function(_0x136760,_0x130901){var _0x1905d0=[];var _0x258015=[];return db[_0x0543('0x55')]['findAll']({'where':{'userProfileId':_0x136760[_0x0543('0x4c')]['id']},'raw':!![]})[_0x0543('0x29')](function(_0x494855){_0x1905d0=_[_0x0543('0x3e')](_0x494855,function(_0x3520e8){return _0x3520e8[_0x0543('0x61')]===0x1||_['includes']([0x3eb,0x709],_0x3520e8[_0x0543('0x5a')]);});if(!_[_0x0543('0x62')](_0x1905d0)){return _[_0x0543('0x2e')](_0x1905d0,function(_0x4abf55){return _0x4abf55[_0x0543('0x5a')];});}else{return;}})[_0x0543('0x29')](function(_0x339b0b){if(_0x339b0b)_0x258015=_0x339b0b;if(_[_0x0543('0x63')](_0x258015,0x64)){var _0x553023=_[_0x0543('0x4d')](_0x1905d0,{'sectionId':0x64});return hasDefaultDashboard(_0x553023)[_0x0543('0x29')](function(_0xdf249b){return _[_0x0543('0x2e')](_0x1905d0,function(_0x14393a){if(_0x14393a[_0x0543('0x5a')]===0x64){_0x14393a[_0x0543('0x64')]=_0xdf249b;}return _0x14393a;});});}else{return;}})[_0x0543('0x29')](function(_0x420b02){if(_0x420b02)_0x1905d0=_0x420b02;if(_[_0x0543('0x63')](_0x258015,0x3eb)){var _0x375b22=_[_0x0543('0x4d')](_0x1905d0,{'sectionId':0x3eb});return getCustomDashboards(_0x375b22)[_0x0543('0x29')](function(_0x20df70){return _[_0x0543('0x2e')](_0x1905d0,function(_0x3fe4ee){if(_0x375b22[_0x0543('0x61')]){if(_0x3fe4ee['sectionId']===0x3eb){_0x3fe4ee[_0x0543('0x64')]=_0x20df70;}}else{if(_0x3fe4ee[_0x0543('0x5a')]===0x64){_0x3fe4ee[_0x0543('0x64')]=_0x20df70;}}return _0x3fe4ee;});});}else{return;}})[_0x0543('0x29')](function(_0x185765){if(_0x185765)_0x1905d0=_0x185765;if(_[_0x0543('0x63')](_0x258015,0x709)){var _0x320617=_[_0x0543('0x4d')](_0x1905d0,{'sectionId':0x709});return getPlugins(_0x320617)[_0x0543('0x29')](function(_0x3c24fc){if(_0x320617[_0x0543('0x61')]){return _['map'](_0x1905d0,function(_0xee3ae3){if(_0xee3ae3[_0x0543('0x5a')]===0x709){_0xee3ae3[_0x0543('0x64')]=_0x3c24fc;}return _0xee3ae3;});}else{var _0x4d3416={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3c24fc};var _0x40b27f=_['map'](_0x1905d0);_0x40b27f['push'](_0x4d3416);return _0x40b27f;}});}else{return;}})[_0x0543('0x29')](function(_0x587f56){if(_0x587f56)_0x1905d0=_0x587f56;return _[_0x0543('0x3e')](_0x1905d0,[_0x0543('0x61'),0x1]);})[_0x0543('0x29')](respondWithResult(_0x130901,null))[_0x0543('0x47')](handleError(_0x130901,null));};function hasDefaultDashboard(_0x5ac9c4){var _0x4bc97b=[0x65];return new BPromise(function(_0x46dc8e,_0x1769d9){try{if(_0x5ac9c4[_0x0543('0x58')]){_0x46dc8e(_0x4bc97b);}else{return db['UserProfileResource'][_0x0543('0x65')]({'where':{'sectionId':_0x5ac9c4['id']},'raw':!![]})[_0x0543('0x29')](function(_0x4cf0ca){_0x4cf0ca?_0x46dc8e(_0x4bc97b):_0x46dc8e();});}}catch(_0x32a641){_0x1769d9(_0x32a641);}});}function getCustomDashboards(_0x146062){var _0x5979d4=[];return new BPromise(function(_0x5eab25,_0x22e8fa){try{if(_0x146062[_0x0543('0x58')]){return db[_0x0543('0x66')]['findAll']({'raw':!![]})[_0x0543('0x29')](function(_0x37f54b){_0x37f54b[_0x0543('0x67')](function(_0x55952a){_0x5979d4['push'](_0x55952a['id']+0x1869f);});_0x5eab25(_0x5979d4);});}else{return db[_0x0543('0x59')][_0x0543('0x56')]({'where':{'sectionId':_0x146062['id']},'raw':!![]})[_0x0543('0x29')](function(_0x51c8ee){_0x51c8ee[_0x0543('0x67')](function(_0x2403e1){_0x5979d4[_0x0543('0x68')](_0x2403e1[_0x0543('0x69')]+0x1869f);});_0x5eab25(_0x5979d4);});}}catch(_0x20fa35){_0x22e8fa(_0x20fa35);}});}function getPlugins(_0x2a024f){var _0x190b81=[];return new BPromise(function(_0x19eeb5,_0xefa0a1){try{if(_0x2a024f[_0x0543('0x58')]){return db[_0x0543('0x6a')][_0x0543('0x56')]({'raw':!![]})[_0x0543('0x29')](function(_0x3d9f3d){_0x3d9f3d[_0x0543('0x67')](function(_0x26b7e7){_0x190b81[_0x0543('0x68')](_0x26b7e7['id']+0x15b38);});_0x19eeb5(_0x190b81);});}else{return db['UserProfileResource'][_0x0543('0x56')]({'where':{'sectionId':_0x2a024f['id']},'raw':!![]})[_0x0543('0x29')](function(_0x37c82f){_0x37c82f[_0x0543('0x67')](function(_0x4f2319){_0x190b81[_0x0543('0x68')](_0x4f2319[_0x0543('0x69')]+0x15b38);});_0x19eeb5(_0x190b81);});}}catch(_0xdd4d2d){_0xefa0a1(_0xdd4d2d);}});}exports[_0x0543('0x6b')]=function(_0x5eb668,_0x120017){return db[_0x0543('0x2f')]['find']({'where':{'id':_0x5eb668[_0x0543('0x4c')]['id']}})[_0x0543('0x29')](handleEntityNotFound(_0x120017,null))[_0x0543('0x29')](function(_0x12fddf){if(_0x12fddf){return db['sequelize'][_0x0543('0x5e')](function(_0x35ed5f){return db[_0x0543('0x55')][_0x0543('0x56')]({'where':{'userProfileId':_0x5eb668[_0x0543('0x4c')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x25d634){if(_0x25d634){return db[_0x0543('0x55')]['destroy']({'where':{'userProfileId':_0x5eb668[_0x0543('0x4c')]['id'],'id':_['map'](_0x25d634,function(_0x1db117){return _0x1db117['id'];})},'transaction':_0x35ed5f});}})[_0x0543('0x29')](function(_0x128f67){var _0x15df91=_['map'](_0x5eb668[_0x0543('0x53')],function(_0x4c5a61){_0x4c5a61[_0x0543('0x5b')]=_0x5eb668[_0x0543('0x4c')]['id'];return _0x4c5a61;});return db[_0x0543('0x55')][_0x0543('0x6c')](_0x15df91,{'raw':!![],'transaction':_0x35ed5f});})[_0x0543('0x29')](function(_0x343786){var _0x175dc7=_[_0x0543('0x3e')](_[_0x0543('0x2e')](_0x343786,function(_0x45c547){return _0x45c547[_0x0543('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x175dc7){return db['UserProfileSection'][_0x0543('0x56')]({'where':{'userProfileId':_0x5eb668[_0x0543('0x4c')]['id'],'sectionId':_[_0x0543('0x2e')](_0x175dc7,function(_0x508a19){return _0x508a19[_0x0543('0x5a')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x736dad){var _0x485933=_['map'](_0x5eb668[_0x0543('0x53')],function(_0x3b6a72){_0x3b6a72[_0x0543('0x5b')]=_0x5eb668[_0x0543('0x4c')]['id'];return _0x3b6a72;});return db[_0x0543('0x59')][_0x0543('0x6c')](_0x485933,{'raw':!![],'transaction':_0x35ed5f});});}})['catch'](handleError(_0x120017,null));});}})['then'](function(_0x54dd54){var _0x4c02d8=_[_0x0543('0x2e')](_0x54dd54,function(_0x2835aa){return _0x2835aa[_0x0543('0x4e')]({'plain':!![]});});})[_0x0543('0x29')](respondWithResult(_0x120017,null))['catch'](handleError(_0x120017,null));};exports[_0x0543('0x6d')]=function(_0x1f0a31,_0x36f276,_0x3bd0af){return db[_0x0543('0x2f')][_0x0543('0x4d')]({'where':{'id':_0x1f0a31[_0x0543('0x4c')]['id']}})[_0x0543('0x29')](handleEntityNotFound(_0x36f276,null))[_0x0543('0x29')](function(_0xea2aa){if(_0xea2aa){return _0xea2aa['removeResources'](_0x1f0a31[_0x0543('0x34')][_0x0543('0x60')]);}})[_0x0543('0x29')](respondWithStatusCode(_0x36f276,null))[_0x0543('0x47')](handleError(_0x36f276,null));};exports[_0x0543('0x6e')]=function(_0x802ea6,_0x4beee9){var _0xda8501={};if(!_0x802ea6[_0x0543('0x34')]['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x802ea6[_0x0543('0x34')][_0x0543('0x39')](_0x0543('0x3a'))){_0xda8501['limit']=qs[_0x0543('0x23')](_0x802ea6['query']['limit']);_0xda8501[_0x0543('0x22')]=qs['offset'](_0x802ea6[_0x0543('0x34')][_0x0543('0x22')]);}return db['UserProfile'][_0x0543('0x4d')]({'where':{'id':_0x802ea6['params']['id']}})[_0x0543('0x29')](function(_0x3de1fe){if(!_0x3de1fe)throw new Error(_0x0543('0x6f')+_0x802ea6['params']['id']);return db[_0x0543('0x2f')][_0x0543('0x6e')](_0x802ea6);})[_0x0543('0x29')](respondWithFilteredResult(_0x4beee9,_0xda8501))[_0x0543('0x47')](handleError(_0x4beee9,null));};
\ No newline at end of file
index a442501..a42ab48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['exports','events','../../mysqldb','UserProfile','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x8e2a09,_0x30f53d){var _0x269f32=function(_0x3fe34d){while(--_0x3fe34d){_0x8e2a09['push'](_0x8e2a09['shift']());}};_0x269f32(++_0x30f53d);}(_0x2542,0x169));var _0x2254=function(_0x7bd534,_0x3b00ea){_0x7bd534=_0x7bd534-0x0;var _0x564630=_0x2542[_0x7bd534];return _0x564630;};'use strict';var EventEmitter=require(_0x2254('0x0'));var UserProfile=require(_0x2254('0x1'))['db'][_0x2254('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2254('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2254('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4059d1){return function(_0x3b3dcb,_0x27f5c9,_0x456612){UserProfileEvents[_0x2254('0x5')](_0x4059d1+':'+_0x3b3dcb['id'],_0x3b3dcb);UserProfileEvents['emit'](_0x4059d1,_0x3b3dcb);_0x456612(null);};}for(var e in events){if(events[_0x2254('0x6')](e)){var event=events[e];UserProfile[_0x2254('0x7')](e,emitEvent(event));}}module[_0x2254('0x8')]=UserProfileEvents;
\ No newline at end of file
+var _0x2eba=['UserProfile','setMaxListeners','save','emit','../../mysqldb'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0x2eba,0xc7));var _0xa2eb=function(_0x209cc2,_0x521c79){_0x209cc2=_0x209cc2-0x0;var _0x58f44a=_0x2eba[_0x209cc2];return _0x58f44a;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa2eb('0x0'))['db'][_0xa2eb('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa2eb('0x2')](0x0);var events={'afterCreate':_0xa2eb('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x45ff67){return function(_0x51ebed,_0x1544ff,_0x3174a0){UserProfileEvents[_0xa2eb('0x4')](_0x45ff67+':'+_0x51ebed['id'],_0x51ebed);UserProfileEvents[_0xa2eb('0x4')](_0x45ff67,_0x51ebed);_0x3174a0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents;
\ No newline at end of file
index 9e71b93..21e0c37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcf0=['VoiceQueues','inbound','QueueCampaigns','queue','VoiceQueue','outbound','musiconholds','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailAccount','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','telephones','admin','user','Agents','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','Template','Trigger','Trunk','variables','Variable','Plugin','reportId','metrics','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','toString','OpenTabs','define','user_profiles','section','query','mergeResources','isEmpty','length','push','UserProfileSection','find','all','union','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','autoAssociation','include','reportType','default','DefaultReports','custom','count','rows','includeAll','Tags','color','tag','openTabs','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','filter','value','findAll','associatedResources','map','model','then','catch','resolve','UserProfileResource','field','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','contacts','CmContact','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','membername','User','role','telephone'];(function(_0x38add1,_0x44b935){var _0x234c6f=function(_0x150c98){while(--_0x150c98){_0x38add1['push'](_0x38add1['shift']());}};_0x234c6f(++_0x44b935);}(_0xfcf0,0x138));var _0x0fcf=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0xfcf0[_0x4a6cf8];return _0x22205e;};'use strict';var _=require(_0x0fcf('0x0'));var attributes=require(_0x0fcf('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0x0fcf('0x2'));module[_0x0fcf('0x3')]=function(_0x366cfa){var _0xd744d1=_0x366cfa['models'];function _0x2fe6d8(_0x265968,_0x3bd34d){return new Promise(function(_0x3af316,_0x1bace8){if(!_0x3bd34d)return _0x3af316(null);var _0x1a7b03=_0x3bd34d[_0x0fcf('0x4')]?{[_0x3bd34d[_0x0fcf('0x4')]['field']]:_0x3bd34d[_0x0fcf('0x4')][_0x0fcf('0x5')]}:undefined;return _0xd744d1[_0x265968][_0x0fcf('0x6')]({'where':_0x1a7b03,'raw':!![]})['then'](function(_0x69a840){_0x3bd34d[_0x0fcf('0x7')]=_[_0x0fcf('0x8')](_0x69a840,'id');_0x3af316(_0x3bd34d);})['catch'](function(_0x369959){_0x1bace8(_0x369959);});});}function _0x5c29ed(_0x1be284,_0x2317cf){return new Promise(function(_0x201a58,_0x48619c){var _0x5f40fb=_0x1be284[_0x0fcf('0x4')]?{[_0x1be284[_0x0fcf('0x4')]['field']]:_0x1be284[_0x0fcf('0x4')][_0x0fcf('0x5')]}:undefined;return _0xd744d1[_0x1be284[_0x0fcf('0x9')]][_0x0fcf('0x6')]({'where':_0x5f40fb,'raw':!![]})[_0x0fcf('0xa')](function(_0x48bba6){_0x2317cf[_0x0fcf('0x7')]=_[_0x0fcf('0x8')](_0x48bba6,function(_0x1fcb47){return _0x1fcb47['name'];});_0x201a58(_0x2317cf);})[_0x0fcf('0xb')](function(_0x610106){_0x48619c(_0x610106);});});}function _0x445207(_0x177c8f,_0x48dd53,_0x3e78d0){if(!_0x48dd53)return Promise[_0x0fcf('0xc')](null);return new Promise(function(_0x1a8477,_0x8581bd){return _0xd744d1[_0x0fcf('0xd')]['findAll']({'where':{'sectionId':_0x48dd53['id']},'raw':!![]})[_0x0fcf('0xa')](function(_0x1a8f58){if(_0x177c8f['field']&&_0x177c8f[_0x0fcf('0xe')]!=='id'){_0x48dd53[_0x0fcf('0x7')]=_['map'](_0x1a8f58,function(_0x2022e1){return _0x2022e1[_0x177c8f['field']];});}else{if(_0x3e78d0===_0x0fcf('0xf')){_0x48dd53[_0x0fcf('0x7')]=_['map'](_0x1a8f58,function(_0x457880){return{'id':_0x457880[_0x0fcf('0x10')],'type':_0x457880[_0x0fcf('0x11')]};});}else{_0x48dd53['associatedResources']=_[_0x0fcf('0x8')](_0x1a8f58,function(_0x1dafc8){return _0x1dafc8[_0x0fcf('0x10')];});}}_0x1a8477(_0x48dd53);})[_0x0fcf('0xb')](function(_0x18af5c){_0x8581bd(_0x18af5c);});});}function _0x30e1b0(_0x5841a9,_0x2eef74){var _0x253641={'parentSections':[]};switch(_0x5841a9[_0x0fcf('0x12')]()){case _0x0fcf('0x13'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x15');break;case _0x0fcf('0x16'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x17');break;case'squarerecordings':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x18');_0x253641[_0x0fcf('0x19')]=[{'name':_0x0fcf('0x1a'),'field':_0x0fcf('0x1b'),'foreignKey':_0x0fcf('0x1c')}];break;case _0x0fcf('0x1d'):_0x253641['childModel']=_0x0fcf('0x1e');break;case _0x0fcf('0x1f'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x20');_0x253641['parentSections']=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x0fcf('0x21'):_0x253641['childModel']=_0x0fcf('0x22');break;case _0x0fcf('0x23'):_0x253641['childModel']=_0x0fcf('0x24');break;case _0x0fcf('0x25'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x26');break;case _0x0fcf('0x27'):_0x253641[_0x0fcf('0x14')]='ChatQueue';break;case _0x0fcf('0x28'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x29');break;case _0x0fcf('0x2a'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x2b');break;case'faxaccounts':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x2c');break;case _0x0fcf('0x2d'):case _0x0fcf('0x2e'):case _0x0fcf('0x2f'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x30');break;case _0x0fcf('0x31'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x32');break;case _0x0fcf('0x33'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x34');break;case _0x0fcf('0x35'):_0x253641['childModel']='VoiceRecording';_0x253641[_0x0fcf('0x19')]=[{'name':'Agents','field':'name','foreignKey':_0x0fcf('0x36'),'model':_0x0fcf('0x37'),'filter':{'field':_0x0fcf('0x38'),'value':['agent']}},{'name':'Telephones','field':_0x0fcf('0x1b'),'foreignKey':_0x0fcf('0x36'),'model':_0x0fcf('0x37'),'filter':{'field':'role','value':[_0x0fcf('0x39')]}},{'name':_0x0fcf('0x3a'),'field':_0x0fcf('0x1b'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':'type','value':[_0x0fcf('0x3b')]}},{'name':_0x0fcf('0x3c'),'field':_0x0fcf('0x1b'),'foreignKey':_0x0fcf('0x3d'),'model':_0x0fcf('0x3e'),'filter':{'field':'type','value':[_0x0fcf('0x3f')]}}];break;case _0x0fcf('0x40'):_0x253641[_0x0fcf('0x14')]='VoiceMusicOnHold';break;case'chanspies':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x41');break;case _0x0fcf('0x42'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x43');break;case'ivrcampaigns':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x44');break;case _0x0fcf('0x45'):_0x253641[_0x0fcf('0x14')]='MailQueue';break;case'mailaccounts':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x46');break;case'mailsubstatuses':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x47');break;case'openchannelqueues':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x48');break;case _0x0fcf('0x49'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x4a');break;case'smsqueues':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x4b');break;case'smsaccounts':_0x253641['childModel']=_0x0fcf('0x4c');break;case'whatsappqueues':_0x253641['childModel']=_0x0fcf('0x4d');break;case _0x0fcf('0x4e'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x4f');break;case _0x0fcf('0x50'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x51');break;case _0x0fcf('0x52'):case _0x0fcf('0x53'):_0x253641[_0x0fcf('0x14')]='VoiceQueue';if(_0x2eef74){_0x253641[_0x0fcf('0x19')]=[{'name':_0x0fcf('0x3a')},{'name':_0x0fcf('0x3c')}];}break;case'users':case'agents':case _0x0fcf('0x54'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x37');if(_0x2eef74){_0x253641[_0x0fcf('0x19')]=[{'name':'Users','filter':{'field':'role','value':[_0x0fcf('0x55'),_0x0fcf('0x56')]},'ignore':!![]},{'name':_0x0fcf('0x57')},{'name':_0x0fcf('0x58')}];}break;case _0x0fcf('0x59'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x5a');break;case _0x0fcf('0x5b'):_0x253641['childModel']='SalesforceAccount';break;case _0x0fcf('0x5c'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x5d');break;case _0x0fcf('0x5e'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x5f');break;case'deskaccounts':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x60');break;case'zohoaccounts':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x61');break;case _0x0fcf('0x62'):_0x253641[_0x0fcf('0x14')]='User';break;case _0x0fcf('0x63'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x64');break;case _0x0fcf('0x65'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x66');break;case _0x0fcf('0x67'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x68');break;case _0x0fcf('0x69'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x6a');break;case _0x0fcf('0x6b'):_0x253641[_0x0fcf('0x14')]='Pause';break;case _0x0fcf('0x6c'):_0x253641['childModel']=_0x0fcf('0x6d');break;case _0x0fcf('0x6e'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x6f');break;case _0x0fcf('0x70'):_0x253641['childModel']=_0x0fcf('0x71');break;case'templates':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x72');break;case'triggers':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x73');break;case'trunks':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x74');break;case _0x0fcf('0x75'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x76');break;case'plugins':_0x253641['childModel']=_0x0fcf('0x77');break;case'extractedreports':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0xf');_0x253641['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x0fcf('0x78')}];break;case _0x0fcf('0x79'):_0x253641[_0x0fcf('0x14')]='AnalyticMetric';break;}return _0x253641;}function _0xbb8286(_0x4a5da0,_0x2ed8d8){var _0x386101=_0x4a5da0[_0x0fcf('0x7a')](0x0)['toUpperCase']()+_0x4a5da0[_0x0fcf('0x7b')](0x1);var _0x29c0b8={'type':_0xd744d1[_0x0fcf('0x7c')][_0x0fcf('0x7d')][_0x0fcf('0x7e')],'raw':!![]};return new Promise(function(_0x381884,_0x4a20a1){var _0x1f04d1=squel[_0x0fcf('0x7f')]()[_0x0fcf('0xe')](_0x0fcf('0x80')+_0x386101+'InteractionId','id')[_0x0fcf('0xe')](_0x0fcf('0x81'))[_0x0fcf('0x82')](_0x0fcf('0x83')+_0x4a5da0+_0x0fcf('0x84'),'ui')[_0x0fcf('0x85')](_0x0fcf('0x86'),_0x2ed8d8['id']);return _0xd744d1['sequelize']['query'](_0x1f04d1[_0x0fcf('0x87')](),_0x29c0b8)[_0x0fcf('0xa')](function(_0x58607c){_0x2ed8d8[_0x386101+_0x0fcf('0x88')]=_0x58607c;_0x381884(_0x58607c);})[_0x0fcf('0xb')](function(_0x447c25){_0x4a20a1(_0x447c25);});});}return _0x366cfa[_0x0fcf('0x89')]('UserProfile',attributes,{'tableName':_0x0fcf('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x9c32ad){var _0x6eaf86={'raw':![],'where':{}};var _0x1e2dd7={};var _0x1f38b8={'count':0x0,'rows':[]};var _0x1abf75=_0x9c32ad['query'][_0x0fcf('0x8b')];var _0x255743=_0x9c32ad[_0x0fcf('0x8c')][_0x0fcf('0x8d')]||![];var _0x1974e2=_0x30e1b0(_0x1abf75,_0x255743);if(!_0x1974e2['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x1abf75+'\x27');var _0x3a8704=[{'name':_0x1abf75}];if(!_[_0x0fcf('0x8e')](_0x1974e2[_0x0fcf('0x19')]))_0x3a8704=_0x1974e2[_0x0fcf('0x19')];var _0x2066f6=[];for(var _0x2aa73a=0x0;_0x2aa73a<_0x3a8704[_0x0fcf('0x8f')];_0x2aa73a++){_0x2066f6[_0x0fcf('0x90')](_0xd744d1[_0x0fcf('0x91')][_0x0fcf('0x92')]({'where':{'userProfileId':_0x9c32ad['params']['id'],'name':_0x3a8704[_0x2aa73a][_0x0fcf('0x1b')]},'raw':!![]}));}return Promise[_0x0fcf('0x93')](_0x2066f6)[_0x0fcf('0xa')](function(_0x22b5f7){var _0x21b655=_[_0x0fcf('0x4')](_0x22b5f7,function(_0x21d767){return _0x21d767?_0x21d767:undefined;});var _0x2772dd=_[_0x0fcf('0x4')](_0x3a8704,['ignore',!![]]);var _0x4e76dd=_['isEmpty'](_0x21b655)&&_['isEmpty'](_0x2772dd)?null:_[_0x0fcf('0x94')](_0x2772dd,_0x21b655);if(!_0x4e76dd)return null;var _0x57c221=[];for(var _0x31e763=0x0;_0x31e763<_0x4e76dd[_0x0fcf('0x8f')];_0x31e763++){var _0x3da414=_['find'](_0x3a8704,function(_0x5ab5c6){return _0x4e76dd[_0x31e763]?_0x5ab5c6[_0x0fcf('0x1b')]===_0x4e76dd[_0x31e763][_0x0fcf('0x1b')]:null;});if(_0x3da414){if(_0x4e76dd[_0x31e763]['ignore']){_0x57c221[_0x0fcf('0x90')](_0x2fe6d8(_0x1974e2[_0x0fcf('0x14')],_0x4e76dd[_0x31e763]));}else{if(!_0x4e76dd[_0x31e763]['autoAssociation']){_0x57c221[_0x0fcf('0x90')](_0x445207(_0x3da414,_0x4e76dd[_0x31e763],_0x1974e2[_0x0fcf('0x14')]));}else{if(_0x3da414[_0x0fcf('0x9')]){_0x57c221[_0x0fcf('0x90')](_0x5c29ed(_0x3da414,_0x4e76dd[_0x31e763]));}}}}}return Promise[_0x0fcf('0x93')](_0x57c221);})[_0x0fcf('0xa')](function(_0x4704c9){var _0x4b1f10=_0x4704c9;var _0x3edb41=null;if(_0x4b1f10){_0x3edb41=_0x4b1f10[_0x0fcf('0x8f')]===0x1?_0x4b1f10[0x0]:null;}if(!_0x3edb41&&!_0x4b1f10)return _0x1f38b8;var _0xb8a206=_0xd744d1[_0x1974e2[_0x0fcf('0x14')]][_0x0fcf('0x95')];_0x1e2dd7[_0x0fcf('0x9')]=_['keys'](_0xb8a206);_0x1e2dd7['query']=_[_0x0fcf('0x96')](_0x9c32ad[_0x0fcf('0x8c')]);_0x1e2dd7[_0x0fcf('0x97')]=_[_0x0fcf('0x98')](_0x1e2dd7['model'],_0x1e2dd7[_0x0fcf('0x8c')]);_0x6eaf86[_0x0fcf('0x99')]=_[_0x0fcf('0x98')](_0x1e2dd7[_0x0fcf('0x9')],qs[_0x0fcf('0x9a')](_0x9c32ad['query']['fields']));_0x6eaf86[_0x0fcf('0x99')]=_0x6eaf86['attributes'][_0x0fcf('0x8f')]?_0x6eaf86['attributes']:_0x1e2dd7[_0x0fcf('0x9')];if(!_0x9c32ad[_0x0fcf('0x8c')][_0x0fcf('0x9b')](_0x0fcf('0x9c'))){_0x6eaf86[_0x0fcf('0x9d')]=qs['limit'](_0x9c32ad[_0x0fcf('0x8c')][_0x0fcf('0x9d')]);_0x6eaf86[_0x0fcf('0x9e')]=qs[_0x0fcf('0x9e')](_0x9c32ad['query'][_0x0fcf('0x9e')]);}_0x6eaf86['order']=qs[_0x0fcf('0x9f')](_0x9c32ad['query'][_0x0fcf('0x9f')]);_0x6eaf86[_0x0fcf('0x85')]=qs['filters'](_[_0x0fcf('0xa0')](_0x9c32ad[_0x0fcf('0x8c')],_0x1e2dd7[_0x0fcf('0x97')]));if(_0x9c32ad['query']['filter']){_0x6eaf86['where']=_[_0x0fcf('0xa1')](_0x6eaf86['where'],{'$or':_[_0x0fcf('0x8')](_0xb8a206,function(_0x21c27b){if(_0x21c27b[_0x0fcf('0x11')][_0x0fcf('0xa2')]!==_0x0fcf('0xa3')){var _0x17662e={};_0x17662e[_0x21c27b[_0x0fcf('0xe')]]={'$like':'%'+_0x9c32ad[_0x0fcf('0x8c')][_0x0fcf('0x4')]+'%'};return _0x17662e;}})});}var _0x59e61c=[];var _0x27d46a=null;var _0x231563={};if(_0x3edb41){_0x27d46a=_[_0x0fcf('0x92')](_0x3a8704,[_0x0fcf('0x1b'),_0x3edb41[_0x0fcf('0x1b')]]);if(_0x27d46a[_0x0fcf('0xe')]){_0x231563={};if(_0x1974e2[_0x0fcf('0x14')]===_0x0fcf('0xf')){_0x231563[_0x27d46a['foreignKey']]=_[_0x0fcf('0x8')](_0x3edb41[_0x0fcf('0x7')],'id');}else{_0x231563[_0x27d46a[_0x0fcf('0xa4')]]=_0x3edb41[_0x0fcf('0x7')];}_0x59e61c[_0x0fcf('0x90')](_0x231563);}else{_0x6eaf86[_0x0fcf('0x85')]['id']=_0x3edb41[_0x0fcf('0x7')];}}else{for(var _0x5d63f5=0x0;_0x5d63f5<_0x4b1f10[_0x0fcf('0x8f')];_0x5d63f5++){_0x27d46a=_['find'](_0x3a8704,[_0x0fcf('0x1b'),_0x4b1f10[_0x5d63f5][_0x0fcf('0x1b')]]);if(_0x27d46a[_0x0fcf('0xe')]){_0x231563={};_0x231563[_0x27d46a['foreignKey']]=_0x4b1f10[_0x5d63f5]['associatedResources'];_0x59e61c['push'](_0x231563);}else{if(!_0x6eaf86['where']['id'])_0x6eaf86[_0x0fcf('0x85')]['id']=[];_0x4b1f10[_0x5d63f5][_0x0fcf('0x7')][_0x0fcf('0xa5')](function(_0x3147f3){_0x6eaf86[_0x0fcf('0x85')]['id'][_0x0fcf('0x90')](_0x3147f3);});}}}if(!_[_0x0fcf('0x8e')](_0x59e61c)){_0x6eaf86[_0x0fcf('0x85')]=_[_0x0fcf('0xa1')](_0x6eaf86[_0x0fcf('0x85')],{'$and':{'$or':_0x59e61c}});}_0x6eaf86=_[_0x0fcf('0xa1')]({},_0x6eaf86,_0x9c32ad['options']);if(_0x3edb41&&!_0x3edb41[_0x0fcf('0xa6')]&&_0x1974e2[_0x0fcf('0x14')]==='AnalyticExtractedReport'){if(_0x9c32ad[_0x0fcf('0x8c')]['includeAll']){_0x6eaf86[_0x0fcf('0xa7')]=[{'all':!![]}];}return _0xd744d1[_0x1974e2[_0x0fcf('0x14')]]['findAll'](_0x6eaf86)['then'](function(_0x36d4e5){var _0x3785b4=[];_0x36d4e5['forEach'](function(_0x3085b1){var _0x3cf7b7;switch(_0x3085b1[_0x0fcf('0xa8')]){case _0x0fcf('0xa9'):_0x3cf7b7=_[_0x0fcf('0x92')](_0x3edb41[_0x0fcf('0x7')],function(_0x332407){return _0x332407['id']===_0x3085b1[_0x0fcf('0x78')]&&_0x332407['type']===_0x0fcf('0xaa');});break;case _0x0fcf('0xab'):_0x3cf7b7=_[_0x0fcf('0x92')](_0x3edb41[_0x0fcf('0x7')],function(_0x58ba03){return _0x58ba03['id']===_0x3085b1[_0x0fcf('0x78')]&&_0x58ba03['type']==='CustomReports';});break;}if(_0x3cf7b7)_0x3785b4['push'](_0x3085b1);});_0x1f38b8[_0x0fcf('0xac')]=_0x3785b4[_0x0fcf('0x8f')];_0x1f38b8[_0x0fcf('0xad')]=_0x3785b4;return _0x1f38b8;});}else{return _0xd744d1[_0x1974e2[_0x0fcf('0x14')]][_0x0fcf('0xac')]({'where':_0x6eaf86[_0x0fcf('0x85')]})[_0x0fcf('0xa')](function(_0x31b008){_0x1f38b8[_0x0fcf('0xac')]=_0x31b008;if(_0x9c32ad['query'][_0x0fcf('0xae')]){if(_0x1974e2[_0x0fcf('0x14')]===_0x0fcf('0x20')){_0x6eaf86[_0x0fcf('0xa7')]=[{'model':_0xd744d1[_0x0fcf('0x71')],'as':_0x0fcf('0xaf'),'attributes':['id',_0x0fcf('0x1b'),_0x0fcf('0xb0')],'required':_0x9c32ad[_0x0fcf('0x8c')]['tag']?!![]:![]},{'model':_0xd744d1['Tag'],'as':'ThroughTags','attributes':['id',_0x0fcf('0x1b'),_0x0fcf('0xb0')],'through':_0x9c32ad[_0x0fcf('0x8c')][_0x0fcf('0xb1')]?{'attributes':[],'where':{'TagId':_0x9c32ad['query']['tag']||undefined}}:{},'required':_0x9c32ad['query'][_0x0fcf('0xb1')]?!![]:![]}];}else{_0x6eaf86['include']=[{'all':!![]}];}}return _0xd744d1[_0x1974e2[_0x0fcf('0x14')]]['findAll'](_0x6eaf86);})[_0x0fcf('0xa')](function(_0x573123){_0x1f38b8[_0x0fcf('0xad')]=_0x573123;if(_0x1abf75==='Agents'&&_0x9c32ad['query'][_0x0fcf('0xb2')]==='true'){var _0x2905fa=[];for(var _0x276e9f=0x0;_0x276e9f<_0x1f38b8[_0x0fcf('0xad')][_0x0fcf('0x8f')];_0x276e9f++){_0x2905fa[_0x0fcf('0x90')](_0xbb8286(_0x0fcf('0xb3'),_0x1f38b8[_0x0fcf('0xad')][_0x276e9f][_0x0fcf('0xb4')]));_0x2905fa[_0x0fcf('0x90')](_0xbb8286(_0x0fcf('0xb5'),_0x1f38b8[_0x0fcf('0xad')][_0x276e9f][_0x0fcf('0xb4')]));_0x2905fa[_0x0fcf('0x90')](_0xbb8286('fax',_0x1f38b8[_0x0fcf('0xad')][_0x276e9f][_0x0fcf('0xb4')]));_0x2905fa[_0x0fcf('0x90')](_0xbb8286(_0x0fcf('0xb6'),_0x1f38b8[_0x0fcf('0xad')][_0x276e9f][_0x0fcf('0xb4')]));_0x2905fa[_0x0fcf('0x90')](_0xbb8286(_0x0fcf('0xb7'),_0x1f38b8[_0x0fcf('0xad')][_0x276e9f]['dataValues']));_0x2905fa[_0x0fcf('0x90')](_0xbb8286(_0x0fcf('0xb8'),_0x1f38b8[_0x0fcf('0xad')][_0x276e9f][_0x0fcf('0xb4')]));}return Promise[_0x0fcf('0x93')](_0x2905fa)[_0x0fcf('0xa')](function(){return _0x1f38b8;});}return _0x1f38b8;});}});}}});};
\ No newline at end of file
+var _0xf494=['SELECT','select','ui.','InteractionId','from','user_has_','_interactions','where','sequelize','query','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','all','ignore','union','autoAssociation','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','limit','offset','order','pick','filters','key','foreignKey','merge','options','includeAll','forEach','reportType','default','reportId','DefaultReports','custom','CustomReports','count','include','Tag','Tags','color','tag','ThroughTags','rows','true','chat','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','value','findAll','then','associatedResources','map','catch','model','name','UserProfileResource','field','AnalyticExtractedReport','resourceId','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','contacts','CmContact','Lists','ListId','lists','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','smsqueues','smsaccounts','SmsAccount','WhatsappQueue','teams','Team','queuecampaigns','users','agents','telephones','Users','admin','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','pauses','scheduler','sounds','Sound','tags','templates','triggers','trunks','Trunk','Variable','plugins','Plugin','extractedreports','Reports','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes'];(function(_0x5a3a97,_0x119345){var _0x733904=function(_0x534b0b){while(--_0x534b0b){_0x5a3a97['push'](_0x5a3a97['shift']());}};_0x733904(++_0x119345);}(_0xf494,0x1c6));var _0x4f49=function(_0x10868c,_0x570eb6){_0x10868c=_0x10868c-0x0;var _0x4a8968=_0xf494[_0x10868c];return _0x4a8968;};'use strict';var _=require(_0x4f49('0x0'));var attributes=require(_0x4f49('0x1'));var qs=require(_0x4f49('0x2'));var squel=require('squel');module[_0x4f49('0x3')]=function(_0x1d54cc){var _0x423b25=_0x1d54cc[_0x4f49('0x4')];function _0x20c0d7(_0x2a15fb,_0x3267c1){return new Promise(function(_0x790e8b,_0xc5e778){if(!_0x3267c1)return _0x790e8b(null);var _0x413530=_0x3267c1[_0x4f49('0x5')]?{[_0x3267c1['filter']['field']]:_0x3267c1[_0x4f49('0x5')][_0x4f49('0x6')]}:undefined;return _0x423b25[_0x2a15fb][_0x4f49('0x7')]({'where':_0x413530,'raw':!![]})[_0x4f49('0x8')](function(_0x185174){_0x3267c1[_0x4f49('0x9')]=_[_0x4f49('0xa')](_0x185174,'id');_0x790e8b(_0x3267c1);})[_0x4f49('0xb')](function(_0x53ee74){_0xc5e778(_0x53ee74);});});}function _0x3e464f(_0x411759,_0x5bcfe5){return new Promise(function(_0x15e7a1,_0x5bbc75){var _0x496293=_0x411759[_0x4f49('0x5')]?{[_0x411759[_0x4f49('0x5')]['field']]:_0x411759[_0x4f49('0x5')][_0x4f49('0x6')]}:undefined;return _0x423b25[_0x411759[_0x4f49('0xc')]][_0x4f49('0x7')]({'where':_0x496293,'raw':!![]})[_0x4f49('0x8')](function(_0x2f0131){_0x5bcfe5[_0x4f49('0x9')]=_['map'](_0x2f0131,function(_0x515ace){return _0x515ace[_0x4f49('0xd')];});_0x15e7a1(_0x5bcfe5);})[_0x4f49('0xb')](function(_0x5878f4){_0x5bbc75(_0x5878f4);});});}function _0x5bdfaf(_0x2f0a0d,_0x2ecaaa,_0x74886e){if(!_0x2ecaaa)return Promise['resolve'](null);return new Promise(function(_0x1dccfd,_0x399be7){return _0x423b25[_0x4f49('0xe')]['findAll']({'where':{'sectionId':_0x2ecaaa['id']},'raw':!![]})['then'](function(_0x560592){if(_0x2f0a0d['field']&&_0x2f0a0d[_0x4f49('0xf')]!=='id'){_0x2ecaaa[_0x4f49('0x9')]=_[_0x4f49('0xa')](_0x560592,function(_0x407042){return _0x407042[_0x2f0a0d['field']];});}else{if(_0x74886e===_0x4f49('0x10')){_0x2ecaaa[_0x4f49('0x9')]=_[_0x4f49('0xa')](_0x560592,function(_0xaab5e7){return{'id':_0xaab5e7[_0x4f49('0x11')],'type':_0xaab5e7['type']};});}else{_0x2ecaaa[_0x4f49('0x9')]=_[_0x4f49('0xa')](_0x560592,function(_0x3ae590){return _0x3ae590['resourceId'];});}}_0x1dccfd(_0x2ecaaa);})[_0x4f49('0xb')](function(_0x1d70a7){_0x399be7(_0x1d70a7);});});}function _0x32ca7b(_0x43c458,_0x9d30aa){var _0x36187b={'parentSections':[]};switch(_0x43c458['toLowerCase']()){case'squareprojects':_0x36187b[_0x4f49('0x12')]=_0x4f49('0x13');break;case'odbc':_0x36187b[_0x4f49('0x12')]=_0x4f49('0x14');break;case _0x4f49('0x15'):_0x36187b['childModel']=_0x4f49('0x16');_0x36187b[_0x4f49('0x17')]=[{'name':_0x4f49('0x18'),'field':_0x4f49('0xd'),'foreignKey':_0x4f49('0x19')}];break;case _0x4f49('0x1a'):_0x36187b['childModel']='JscriptyProject';break;case _0x4f49('0x1b'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x1c');_0x36187b['parentSections']=[{'name':_0x4f49('0x1d'),'field':'id','foreignKey':_0x4f49('0x1e')}];break;case _0x4f49('0x1f'):_0x36187b['childModel']='CmList';break;case _0x4f49('0x20'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x21');break;case'globalcustomfields':_0x36187b[_0x4f49('0x12')]=_0x4f49('0x22');break;case _0x4f49('0x23'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x24');break;case _0x4f49('0x25'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x26');break;case _0x4f49('0x27'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x28');break;case _0x4f49('0x29'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x2a');break;case _0x4f49('0x2b'):case _0x4f49('0x2c'):case _0x4f49('0x2d'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x2e');break;case'contexts':_0x36187b[_0x4f49('0x12')]=_0x4f49('0x2f');break;case _0x4f49('0x30'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x31');break;case _0x4f49('0x32'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x33');_0x36187b[_0x4f49('0x17')]=[{'name':_0x4f49('0x34'),'field':_0x4f49('0xd'),'foreignKey':_0x4f49('0x35'),'model':_0x4f49('0x36'),'filter':{'field':'role','value':[_0x4f49('0x37')]}},{'name':_0x4f49('0x38'),'field':_0x4f49('0xd'),'foreignKey':_0x4f49('0x35'),'model':_0x4f49('0x36'),'filter':{'field':_0x4f49('0x39'),'value':[_0x4f49('0x3a')]}},{'name':_0x4f49('0x3b'),'field':_0x4f49('0xd'),'foreignKey':_0x4f49('0x3c'),'model':_0x4f49('0x3d'),'filter':{'field':_0x4f49('0x3e'),'value':[_0x4f49('0x3f')]}},{'name':_0x4f49('0x40'),'field':'name','foreignKey':_0x4f49('0x3c'),'model':_0x4f49('0x3d'),'filter':{'field':'type','value':[_0x4f49('0x41')]}}];break;case _0x4f49('0x42'):_0x36187b['childModel']=_0x4f49('0x43');break;case _0x4f49('0x44'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x45');break;case _0x4f49('0x46'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x47');break;case'ivrcampaigns':_0x36187b['childModel']='Campaign';break;case _0x4f49('0x48'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x49');break;case _0x4f49('0x4a'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x4b');break;case _0x4f49('0x4c'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x4d');break;case'openchannelqueues':_0x36187b['childModel']=_0x4f49('0x4e');break;case _0x4f49('0x4f'):_0x36187b[_0x4f49('0x12')]='OpenchannelAccount';break;case _0x4f49('0x50'):_0x36187b['childModel']='SmsQueue';break;case _0x4f49('0x51'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x52');break;case'whatsappqueues':_0x36187b[_0x4f49('0x12')]=_0x4f49('0x53');break;case'whatsappaccounts':_0x36187b[_0x4f49('0x12')]='WhatsappAccount';break;case _0x4f49('0x54'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x55');break;case'voicequeues':case _0x4f49('0x56'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x3d');if(_0x9d30aa){_0x36187b[_0x4f49('0x17')]=[{'name':_0x4f49('0x3b')},{'name':_0x4f49('0x40')}];}break;case _0x4f49('0x57'):case _0x4f49('0x58'):case _0x4f49('0x59'):_0x36187b[_0x4f49('0x12')]='User';if(_0x9d30aa){_0x36187b[_0x4f49('0x17')]=[{'name':_0x4f49('0x5a'),'filter':{'field':'role','value':[_0x4f49('0x5b'),'user']},'ignore':!![]},{'name':_0x4f49('0x34')},{'name':_0x4f49('0x38')}];}break;case _0x4f49('0x5c'):_0x36187b[_0x4f49('0x12')]='ZendeskAccount';break;case _0x4f49('0x5d'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x5e');break;case _0x4f49('0x5f'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x60');break;case _0x4f49('0x61'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x62');break;case _0x4f49('0x63'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x64');break;case _0x4f49('0x65'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x66');break;case _0x4f49('0x67'):_0x36187b['childModel']='User';break;case _0x4f49('0x68'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x69');break;case _0x4f49('0x6a'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x6b');break;case _0x4f49('0x6c'):_0x36187b['childModel']=_0x4f49('0x6d');break;case'intervals':_0x36187b[_0x4f49('0x12')]=_0x4f49('0x6e');break;case _0x4f49('0x6f'):_0x36187b[_0x4f49('0x12')]='Pause';break;case _0x4f49('0x70'):_0x36187b['childModel']='Schedule';break;case _0x4f49('0x71'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x72');break;case _0x4f49('0x73'):_0x36187b['childModel']='Tag';break;case _0x4f49('0x74'):_0x36187b[_0x4f49('0x12')]='Template';break;case _0x4f49('0x75'):_0x36187b['childModel']='Trigger';break;case _0x4f49('0x76'):_0x36187b['childModel']=_0x4f49('0x77');break;case'variables':_0x36187b[_0x4f49('0x12')]=_0x4f49('0x78');break;case _0x4f49('0x79'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x7a');break;case _0x4f49('0x7b'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x10');_0x36187b['parentSections']=[{'name':_0x4f49('0x7c'),'field':'id','foreignKey':'reportId'}];break;case _0x4f49('0x7d'):_0x36187b[_0x4f49('0x12')]=_0x4f49('0x7e');break;}return _0x36187b;}function _0x467f12(_0x1981e0,_0xb7538c){var _0x553981=_0x1981e0[_0x4f49('0x7f')](0x0)[_0x4f49('0x80')]()+_0x1981e0['slice'](0x1);var _0x5d2b3c={'type':_0x423b25[_0x4f49('0x81')][_0x4f49('0x82')][_0x4f49('0x83')],'raw':!![]};return new Promise(function(_0x2409f1,_0x19a788){var _0x4af08d=squel[_0x4f49('0x84')]()['field'](_0x4f49('0x85')+_0x553981+_0x4f49('0x86'),'id')[_0x4f49('0xf')]('ui.createdAt')[_0x4f49('0x87')](_0x4f49('0x88')+_0x1981e0+_0x4f49('0x89'),'ui')[_0x4f49('0x8a')]('ui.UserId\x20=\x20?',_0xb7538c['id']);return _0x423b25[_0x4f49('0x8b')][_0x4f49('0x8c')](_0x4af08d['toString'](),_0x5d2b3c)[_0x4f49('0x8')](function(_0x17b15){_0xb7538c[_0x553981+_0x4f49('0x8d')]=_0x17b15;_0x2409f1(_0x17b15);})[_0x4f49('0xb')](function(_0x28ea73){_0x19a788(_0x28ea73);});});}return _0x1d54cc[_0x4f49('0x8e')](_0x4f49('0x8f'),attributes,{'tableName':_0x4f49('0x90'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x519721){var _0x468821={'raw':![],'where':{}};var _0x3566f2={};var _0x1e91a5={'count':0x0,'rows':[]};var _0x192b5a=_0x519721[_0x4f49('0x8c')][_0x4f49('0x91')];var _0x335875=_0x519721['query'][_0x4f49('0x92')]||![];var _0x50d1ad=_0x32ca7b(_0x192b5a,_0x335875);if(!_0x50d1ad[_0x4f49('0x12')])throw new Error(_0x4f49('0x93')+_0x192b5a+'\x27');var _0x4714c7=[{'name':_0x192b5a}];if(!_[_0x4f49('0x94')](_0x50d1ad[_0x4f49('0x17')]))_0x4714c7=_0x50d1ad[_0x4f49('0x17')];var _0x61a565=[];for(var _0x297698=0x0;_0x297698<_0x4714c7[_0x4f49('0x95')];_0x297698++){_0x61a565[_0x4f49('0x96')](_0x423b25['UserProfileSection'][_0x4f49('0x97')]({'where':{'userProfileId':_0x519721[_0x4f49('0x98')]['id'],'name':_0x4714c7[_0x297698][_0x4f49('0xd')]},'raw':!![]}));}return Promise[_0x4f49('0x99')](_0x61a565)['then'](function(_0x54c67b){var _0x28e8ae=_['filter'](_0x54c67b,function(_0x30defd){return _0x30defd?_0x30defd:undefined;});var _0x287705=_[_0x4f49('0x5')](_0x4714c7,[_0x4f49('0x9a'),!![]]);var _0x224c8d=_[_0x4f49('0x94')](_0x28e8ae)&&_[_0x4f49('0x94')](_0x287705)?null:_[_0x4f49('0x9b')](_0x287705,_0x28e8ae);if(!_0x224c8d)return null;var _0x3823f0=[];for(var _0x3e9b47=0x0;_0x3e9b47<_0x224c8d[_0x4f49('0x95')];_0x3e9b47++){var _0x1ba97e=_[_0x4f49('0x97')](_0x4714c7,function(_0xd53de8){return _0x224c8d[_0x3e9b47]?_0xd53de8[_0x4f49('0xd')]===_0x224c8d[_0x3e9b47][_0x4f49('0xd')]:null;});if(_0x1ba97e){if(_0x224c8d[_0x3e9b47][_0x4f49('0x9a')]){_0x3823f0[_0x4f49('0x96')](_0x20c0d7(_0x50d1ad[_0x4f49('0x12')],_0x224c8d[_0x3e9b47]));}else{if(!_0x224c8d[_0x3e9b47][_0x4f49('0x9c')]){_0x3823f0[_0x4f49('0x96')](_0x5bdfaf(_0x1ba97e,_0x224c8d[_0x3e9b47],_0x50d1ad[_0x4f49('0x12')]));}else{if(_0x1ba97e[_0x4f49('0xc')]){_0x3823f0[_0x4f49('0x96')](_0x3e464f(_0x1ba97e,_0x224c8d[_0x3e9b47]));}}}}}return Promise[_0x4f49('0x99')](_0x3823f0);})['then'](function(_0x3e9460){var _0x4ff0c1=_0x3e9460;var _0x31df7f=null;if(_0x4ff0c1){_0x31df7f=_0x4ff0c1[_0x4f49('0x95')]===0x1?_0x4ff0c1[0x0]:null;}if(!_0x31df7f&&!_0x4ff0c1)return _0x1e91a5;var _0x38fe50=_0x423b25[_0x50d1ad[_0x4f49('0x12')]][_0x4f49('0x9d')];_0x3566f2[_0x4f49('0xc')]=_[_0x4f49('0x9e')](_0x38fe50);_0x3566f2[_0x4f49('0x8c')]=_[_0x4f49('0x9e')](_0x519721['query']);_0x3566f2['filters']=_[_0x4f49('0x9f')](_0x3566f2['model'],_0x3566f2[_0x4f49('0x8c')]);_0x468821[_0x4f49('0xa0')]=_[_0x4f49('0x9f')](_0x3566f2[_0x4f49('0xc')],qs[_0x4f49('0xa1')](_0x519721['query']['fields']));_0x468821[_0x4f49('0xa0')]=_0x468821[_0x4f49('0xa0')]['length']?_0x468821[_0x4f49('0xa0')]:_0x3566f2[_0x4f49('0xc')];if(!_0x519721['query'][_0x4f49('0xa2')]('nolimit')){_0x468821[_0x4f49('0xa3')]=qs[_0x4f49('0xa3')](_0x519721['query'][_0x4f49('0xa3')]);_0x468821[_0x4f49('0xa4')]=qs[_0x4f49('0xa4')](_0x519721[_0x4f49('0x8c')][_0x4f49('0xa4')]);}_0x468821[_0x4f49('0xa5')]=qs['sort'](_0x519721[_0x4f49('0x8c')]['sort']);_0x468821[_0x4f49('0x8a')]=qs['filters'](_[_0x4f49('0xa6')](_0x519721['query'],_0x3566f2[_0x4f49('0xa7')]));if(_0x519721[_0x4f49('0x8c')][_0x4f49('0x5')]){_0x468821[_0x4f49('0x8a')]=_['merge'](_0x468821[_0x4f49('0x8a')],{'$or':_['map'](_0x38fe50,function(_0x5ddfe4){if(_0x5ddfe4['type'][_0x4f49('0xa8')]!=='VIRTUAL'){var _0x4938a6={};_0x4938a6[_0x5ddfe4[_0x4f49('0xf')]]={'$like':'%'+_0x519721[_0x4f49('0x8c')][_0x4f49('0x5')]+'%'};return _0x4938a6;}})});}var _0x4c0e7a=[];var _0x289810=null;var _0x431c15={};if(_0x31df7f){_0x289810=_['find'](_0x4714c7,['name',_0x31df7f['name']]);if(_0x289810[_0x4f49('0xf')]){_0x431c15={};if(_0x50d1ad[_0x4f49('0x12')]===_0x4f49('0x10')){_0x431c15[_0x289810[_0x4f49('0xa9')]]=_[_0x4f49('0xa')](_0x31df7f['associatedResources'],'id');}else{_0x431c15[_0x289810[_0x4f49('0xa9')]]=_0x31df7f[_0x4f49('0x9')];}_0x4c0e7a[_0x4f49('0x96')](_0x431c15);}else{_0x468821['where']['id']=_0x31df7f[_0x4f49('0x9')];}}else{for(var _0x34843a=0x0;_0x34843a<_0x4ff0c1[_0x4f49('0x95')];_0x34843a++){_0x289810=_[_0x4f49('0x97')](_0x4714c7,['name',_0x4ff0c1[_0x34843a][_0x4f49('0xd')]]);if(_0x289810[_0x4f49('0xf')]){_0x431c15={};_0x431c15[_0x289810[_0x4f49('0xa9')]]=_0x4ff0c1[_0x34843a][_0x4f49('0x9')];_0x4c0e7a[_0x4f49('0x96')](_0x431c15);}else{if(!_0x468821['where']['id'])_0x468821[_0x4f49('0x8a')]['id']=[];_0x4ff0c1[_0x34843a][_0x4f49('0x9')]['forEach'](function(_0x3eebc0){_0x468821['where']['id'][_0x4f49('0x96')](_0x3eebc0);});}}}if(!_['isEmpty'](_0x4c0e7a)){_0x468821[_0x4f49('0x8a')]=_[_0x4f49('0xaa')](_0x468821[_0x4f49('0x8a')],{'$and':{'$or':_0x4c0e7a}});}_0x468821=_[_0x4f49('0xaa')]({},_0x468821,_0x519721[_0x4f49('0xab')]);if(_0x31df7f&&!_0x31df7f['autoAssociation']&&_0x50d1ad[_0x4f49('0x12')]===_0x4f49('0x10')){if(_0x519721[_0x4f49('0x8c')][_0x4f49('0xac')]){_0x468821['include']=[{'all':!![]}];}return _0x423b25[_0x50d1ad[_0x4f49('0x12')]]['findAll'](_0x468821)[_0x4f49('0x8')](function(_0x59a5e9){var _0x3066ee=[];_0x59a5e9[_0x4f49('0xad')](function(_0x288f75){var _0x34fca3;switch(_0x288f75[_0x4f49('0xae')]){case _0x4f49('0xaf'):_0x34fca3=_[_0x4f49('0x97')](_0x31df7f[_0x4f49('0x9')],function(_0x3a26ff){return _0x3a26ff['id']===_0x288f75[_0x4f49('0xb0')]&&_0x3a26ff['type']===_0x4f49('0xb1');});break;case _0x4f49('0xb2'):_0x34fca3=_[_0x4f49('0x97')](_0x31df7f[_0x4f49('0x9')],function(_0x302861){return _0x302861['id']===_0x288f75[_0x4f49('0xb0')]&&_0x302861['type']===_0x4f49('0xb3');});break;}if(_0x34fca3)_0x3066ee[_0x4f49('0x96')](_0x288f75);});_0x1e91a5[_0x4f49('0xb4')]=_0x3066ee[_0x4f49('0x95')];_0x1e91a5['rows']=_0x3066ee;return _0x1e91a5;});}else{return _0x423b25[_0x50d1ad[_0x4f49('0x12')]]['count']({'where':_0x468821[_0x4f49('0x8a')]})[_0x4f49('0x8')](function(_0x5c5d2){_0x1e91a5[_0x4f49('0xb4')]=_0x5c5d2;if(_0x519721['query'][_0x4f49('0xac')]){if(_0x50d1ad[_0x4f49('0x12')]===_0x4f49('0x1c')){_0x468821[_0x4f49('0xb5')]=[{'model':_0x423b25[_0x4f49('0xb6')],'as':_0x4f49('0xb7'),'attributes':['id',_0x4f49('0xd'),_0x4f49('0xb8')],'required':_0x519721[_0x4f49('0x8c')][_0x4f49('0xb9')]?!![]:![]},{'model':_0x423b25[_0x4f49('0xb6')],'as':_0x4f49('0xba'),'attributes':['id',_0x4f49('0xd'),_0x4f49('0xb8')],'through':_0x519721[_0x4f49('0x8c')][_0x4f49('0xb9')]?{'attributes':[],'where':{'TagId':_0x519721[_0x4f49('0x8c')][_0x4f49('0xb9')]||undefined}}:{},'required':_0x519721['query'][_0x4f49('0xb9')]?!![]:![]}];}else{_0x468821[_0x4f49('0xb5')]=[{'all':!![]}];}}return _0x423b25[_0x50d1ad[_0x4f49('0x12')]][_0x4f49('0x7')](_0x468821);})['then'](function(_0x225e63){_0x1e91a5[_0x4f49('0xbb')]=_0x225e63;if(_0x192b5a==='Agents'&&_0x519721[_0x4f49('0x8c')]['openTabs']===_0x4f49('0xbc')){var _0x3bc245=[];for(var _0x1b6e82=0x0;_0x1b6e82<_0x1e91a5[_0x4f49('0xbb')][_0x4f49('0x95')];_0x1b6e82++){_0x3bc245[_0x4f49('0x96')](_0x467f12(_0x4f49('0xbd'),_0x1e91a5[_0x4f49('0xbb')][_0x1b6e82][_0x4f49('0xbe')]));_0x3bc245[_0x4f49('0x96')](_0x467f12('sms',_0x1e91a5['rows'][_0x1b6e82][_0x4f49('0xbe')]));_0x3bc245['push'](_0x467f12(_0x4f49('0xbf'),_0x1e91a5[_0x4f49('0xbb')][_0x1b6e82]['dataValues']));_0x3bc245['push'](_0x467f12(_0x4f49('0xc0'),_0x1e91a5['rows'][_0x1b6e82][_0x4f49('0xbe')]));_0x3bc245[_0x4f49('0x96')](_0x467f12(_0x4f49('0xc1'),_0x1e91a5['rows'][_0x1b6e82][_0x4f49('0xbe')]));_0x3bc245['push'](_0x467f12(_0x4f49('0xc2'),_0x1e91a5[_0x4f49('0xbb')][_0x1b6e82][_0x4f49('0xbe')]));}return Promise['all'](_0x3bc245)[_0x4f49('0x8')](function(){return _0x1e91a5;});}return _0x1e91a5;});}});}}});};
\ No newline at end of file
index e5b7548..2abdba6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd08d=['error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x44f707,_0x149c85){var _0x263497=function(_0x1ff275){while(--_0x1ff275){_0x44f707['push'](_0x44f707['shift']());}};_0x263497(++_0x149c85);}(_0xd08d,0x81));var _0xdd08=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xd08d[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var util=require(_0xdd08('0x0'));var moment=require(_0xdd08('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd08('0x2'));var fs=require('fs');var Redis=require(_0xdd08('0x3'));var db=require(_0xdd08('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd08('0x5'))(_0xdd08('0x6'));var config=require(_0xdd08('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd08('0x8')][_0xdd08('0x9')]({'port':0x232a});config[_0xdd08('0xa')]=_[_0xdd08('0xb')](config[_0xdd08('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd08('0xc'))(new Redis(config[_0xdd08('0xa')]));require(_0xdd08('0xd'))['register'](socket);function respondWithRpcPromise(_0x2d4433,_0x2e9c8d,_0x2ca1cc){return new BPromise(function(_0x19b253,_0xe0a892){return client[_0xdd08('0xe')](_0x2d4433,_0x2ca1cc)[_0xdd08('0xf')](function(_0x43a927){logger[_0xdd08('0x10')](_0xdd08('0x11'),_0x2e9c8d,_0xdd08('0x12'));logger[_0xdd08('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x2e9c8d,_0xdd08('0x12'),JSON[_0xdd08('0x14')](_0x43a927));if(_0x43a927[_0xdd08('0x15')]){if(_0x43a927[_0xdd08('0x15')][_0xdd08('0x16')]===0x1f4){logger[_0xdd08('0x15')](_0xdd08('0x11'),_0x2e9c8d,_0x43a927[_0xdd08('0x15')][_0xdd08('0x17')]);return _0xe0a892(_0x43a927[_0xdd08('0x15')][_0xdd08('0x17')]);}logger[_0xdd08('0x15')](_0xdd08('0x11'),_0x2e9c8d,_0x43a927[_0xdd08('0x15')][_0xdd08('0x17')]);return _0x19b253(_0x43a927[_0xdd08('0x15')][_0xdd08('0x17')]);}else{logger[_0xdd08('0x10')](_0xdd08('0x11'),_0x2e9c8d,_0xdd08('0x12'));_0x19b253(_0x43a927[_0xdd08('0x18')]['message']);}})['catch'](function(_0x435dc4){logger[_0xdd08('0x15')](_0xdd08('0x11'),_0x2e9c8d,_0x435dc4);_0xe0a892(_0x435dc4);});});}
\ No newline at end of file
+var _0xce22=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x26aae3,_0x305473){var _0x1a581e=function(_0x3f83be){while(--_0x3f83be){_0x26aae3['push'](_0x26aae3['shift']());}};_0x1a581e(++_0x305473);}(_0xce22,0xea));var _0x2ce2=function(_0xdf9cd5,_0x4969f9){_0xdf9cd5=_0xdf9cd5-0x0;var _0x383793=_0xce22[_0xdf9cd5];return _0x383793;};'use strict';var _=require(_0x2ce2('0x0'));var util=require(_0x2ce2('0x1'));var moment=require(_0x2ce2('0x2'));var BPromise=require(_0x2ce2('0x3'));var rs=require(_0x2ce2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ce2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ce2('0x6'))(_0x2ce2('0x7'));var config=require(_0x2ce2('0x8'));var jayson=require(_0x2ce2('0x9'));var client=jayson[_0x2ce2('0xa')][_0x2ce2('0xb')]({'port':0x232a});config[_0x2ce2('0xc')]=_['defaults'](config[_0x2ce2('0xc')],{'host':_0x2ce2('0xd'),'port':0x18eb});var socket=require(_0x2ce2('0xe'))(new Redis(config[_0x2ce2('0xc')]));require(_0x2ce2('0xf'))[_0x2ce2('0x10')](socket);function respondWithRpcPromise(_0x56b53e,_0x25d27e,_0x3c2e05){return new BPromise(function(_0x561dae,_0x26218a){return client[_0x2ce2('0x11')](_0x56b53e,_0x3c2e05)['then'](function(_0xaa959){logger[_0x2ce2('0x12')](_0x2ce2('0x13'),_0x25d27e,_0x2ce2('0x14'));logger['debug'](_0x2ce2('0x15'),_0x25d27e,_0x2ce2('0x14'),JSON[_0x2ce2('0x16')](_0xaa959));if(_0xaa959['error']){if(_0xaa959[_0x2ce2('0x17')]['code']===0x1f4){logger['error'](_0x2ce2('0x13'),_0x25d27e,_0xaa959[_0x2ce2('0x17')][_0x2ce2('0x18')]);return _0x26218a(_0xaa959[_0x2ce2('0x17')][_0x2ce2('0x18')]);}logger[_0x2ce2('0x17')](_0x2ce2('0x13'),_0x25d27e,_0xaa959['error']['message']);return _0x561dae(_0xaa959['error'][_0x2ce2('0x18')]);}else{logger[_0x2ce2('0x12')](_0x2ce2('0x13'),_0x25d27e,_0x2ce2('0x14'));_0x561dae(_0xaa959[_0x2ce2('0x19')]['message']);}})[_0x2ce2('0x1a')](function(_0x52d535){logger[_0x2ce2('0x17')](_0x2ce2('0x13'),_0x25d27e,_0x52d535);_0x26218a(_0x52d535);});});}
\ No newline at end of file
index 343c731..5d7d1f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcca5=['remove','emit','removeListener','register','length','./userProfile.events','save'];(function(_0x3cbcd7,_0x56faef){var _0x5af328=function(_0x2d694b){while(--_0x2d694b){_0x3cbcd7['push'](_0x3cbcd7['shift']());}};_0x5af328(++_0x56faef);}(_0xcca5,0xad));var _0x5cca=function(_0x32b30c,_0x2d5ec8){_0x32b30c=_0x32b30c-0x0;var _0xcfc212=_0xcca5[_0x32b30c];return _0xcfc212;};'use strict';var UserProfileEvents=require(_0x5cca('0x0'));var events=[_0x5cca('0x1'),_0x5cca('0x2'),'update'];function createListener(_0x8e68c3,_0xd41659){return function(_0x1afacb){_0xd41659[_0x5cca('0x3')](_0x8e68c3,_0x1afacb);};}function removeListener(_0x45fa02,_0x1e1ec4){return function(){UserProfileEvents[_0x5cca('0x4')](_0x45fa02,_0x1e1ec4);};}exports[_0x5cca('0x5')]=function(_0xb9012e){for(var _0x1ada68=0x0,_0x59a3e9=events[_0x5cca('0x6')];_0x1ada68<_0x59a3e9;_0x1ada68++){var _0x52a094=events[_0x1ada68];var _0x36cf50=createListener('userProfile:'+_0x52a094,_0xb9012e);UserProfileEvents['on'](_0x52a094,_0x36cf50);}};
\ No newline at end of file
+var _0xa76c=['userProfile:','save','remove','update','removeListener','register','length'];(function(_0xfd7cb3,_0x7f7744){var _0x4a7f70=function(_0x27bf82){while(--_0x27bf82){_0xfd7cb3['push'](_0xfd7cb3['shift']());}};_0x4a7f70(++_0x7f7744);}(_0xa76c,0x190));var _0xca76=function(_0x3db464,_0x53fd4e){_0x3db464=_0x3db464-0x0;var _0x81faa2=_0xa76c[_0x3db464];return _0x81faa2;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xca76('0x0'),_0xca76('0x1'),_0xca76('0x2')];function createListener(_0x3e0c0d,_0x5cf2d4){return function(_0x108bf2){_0x5cf2d4['emit'](_0x3e0c0d,_0x108bf2);};}function removeListener(_0x52c5fd,_0x2906f4){return function(){UserProfileEvents[_0xca76('0x3')](_0x52c5fd,_0x2906f4);};}exports[_0xca76('0x4')]=function(_0x4a6e6b){for(var _0x3b8aac=0x0,_0x32aab9=events[_0xca76('0x5')];_0x3b8aac<_0x32aab9;_0x3b8aac++){var _0x7472c2=events[_0x3b8aac];var _0x1fd209=createListener(_0xca76('0x6')+_0x7472c2,_0x4a6e6b);UserProfileEvents['on'](_0x7472c2,_0x1fd209);}};
\ No newline at end of file
index 2645129..878407a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c1e=['get','index','/describe','isAuthenticated','describe','/:id','show','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x44575e,_0x2ccff3){var _0x1a04c8=function(_0x27f632){while(--_0x27f632){_0x44575e['push'](_0x44575e['shift']());}};_0x1a04c8(++_0x2ccff3);}(_0x0c1e,0x88));var _0xe0c1=function(_0x7cbee3,_0xad9631){_0x7cbee3=_0x7cbee3-0x0;var _0x328b84=_0x0c1e[_0x7cbee3];return _0x328b84;};'use strict';var multer=require(_0xe0c1('0x0'));var util=require('util');var path=require(_0xe0c1('0x1'));var timeout=require(_0xe0c1('0x2'));var express=require('express');var router=express[_0xe0c1('0x3')]();var fs_extra=require(_0xe0c1('0x4'));var auth=require(_0xe0c1('0x5'));var interaction=require(_0xe0c1('0x6'));var config=require(_0xe0c1('0x7'));var controller=require('./userProfileResource.controller');router[_0xe0c1('0x8')]('/',auth['isAuthenticated'](),controller[_0xe0c1('0x9')]);router[_0xe0c1('0x8')](_0xe0c1('0xa'),auth[_0xe0c1('0xb')](),controller[_0xe0c1('0xc')]);router[_0xe0c1('0x8')](_0xe0c1('0xd'),auth[_0xe0c1('0xb')](),controller[_0xe0c1('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe0c1('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xe0c1('0xf')]('/:id',auth[_0xe0c1('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x764e=['create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','describe','/:id','show'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x764e,0x16d));var _0xe764=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x764e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe764('0x0'));var path=require(_0xe764('0x1'));var timeout=require(_0xe764('0x2'));var express=require(_0xe764('0x3'));var router=express[_0xe764('0x4')]();var fs_extra=require(_0xe764('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe764('0x6'));var config=require(_0xe764('0x7'));var controller=require(_0xe764('0x8'));router['get']('/',auth[_0xe764('0x9')](),controller[_0xe764('0xa')]);router[_0xe764('0xb')]('/describe',auth[_0xe764('0x9')](),controller[_0xe764('0xc')]);router[_0xe764('0xb')](_0xe764('0xd'),auth[_0xe764('0x9')](),controller[_0xe764('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe764('0xf')]);router[_0xe764('0x10')](_0xe764('0xd'),auth[_0xe764('0x9')](),controller[_0xe764('0x11')]);router[_0xe764('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe764('0x13')]=router;
\ No newline at end of file
index 74886d0..c67633d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97d9=['INTEGER','STRING'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0x97d9,0x1d3));var _0x997d=function(_0x4c0b3a,_0x41c310){_0x4c0b3a=_0x4c0b3a-0x0;var _0x12bbe8=_0x97d9[_0x4c0b3a];return _0x12bbe8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x997d('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x997d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x997d('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x5651=['STRING','INTEGER'];(function(_0x26ef7c,_0x467762){var _0x1de1e=function(_0x2776d9){while(--_0x2776d9){_0x26ef7c['push'](_0x26ef7c['shift']());}};_0x1de1e(++_0x467762);}(_0x5651,0xb3));var _0x1565=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0x5651[_0x1385dc];return _0x2f6469;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x1565('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x1565('0x1')],'allowNull':![]}};
\ No newline at end of file
index 96fd825..8bd4c6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x896e=['hasOwnProperty','nolimit','order','sort','where','merge','filter','UserProfileResource','includeAll','include','findAll','rows','catch','keys','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x896e,0x1e9));var _0xe896=function(_0x2a4ed5,_0x36f257){_0x2a4ed5=_0x2a4ed5-0x0;var _0xfcdd36=_0x896e[_0x2a4ed5];return _0xfcdd36;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];function respondWithStatusCode(_0x3e8ac9,_0x580aac){_0x580aac=_0x580aac||0xcc;return function(_0x2aa522){if(_0x2aa522){return _0x3e8ac9[_0xe896('0x1a')](_0x580aac);}return _0x3e8ac9[_0xe896('0x1b')](_0x580aac)['end']();};}function respondWithResult(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xc8;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['status'](_0x7dcf8a)['json'](_0x1e7ef8);}};}function respondWithFilteredResult(_0x446ce2,_0x25606b){return function(_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=typeof _0x25606b[_0xe896('0x1c')]===_0xe896('0x1d')&&typeof _0x25606b['limit']===_0xe896('0x1d');var _0x4e062a=_0x51e7b7[_0xe896('0x1e')];var _0x32f86d=_0x5e78d6?0x0:_0x25606b[_0xe896('0x1c')];var _0x5dc89d=_0x5e78d6?_0x51e7b7[_0xe896('0x1e')]:_0x25606b[_0xe896('0x1c')]+_0x25606b[_0xe896('0x1f')];var _0xbebbe1;if(_0x5dc89d>=_0x4e062a){_0x5dc89d=_0x4e062a;_0xbebbe1=0xc8;}else{_0xbebbe1=0xce;}_0x446ce2[_0xe896('0x1b')](_0xbebbe1);return _0x446ce2[_0xe896('0x20')](_0xe896('0x21'),_0x32f86d+'-'+_0x5dc89d+'/'+_0x4e062a)[_0xe896('0x22')](_0x51e7b7);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x23')](_0x5d2c8d);}return _0x180d46[_0xe896('0x24')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x25')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x26')]()[_0xe896('0x27')](function(){_0x45dd49[_0xe896('0x1b')](0xcc)[_0xe896('0x28')]();});}};}function handleEntityNotFound(_0x4b71cc,_0x390128){return function(_0x163a75){if(!_0x163a75){_0x4b71cc[_0xe896('0x1a')](0x194);}return _0x163a75;};}function handleError(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0x1f4;return function(_0xd50fe2){logger[_0xe896('0x29')](_0xd50fe2[_0xe896('0x2a')]);if(_0xd50fe2[_0xe896('0x2b')]){delete _0xd50fe2[_0xe896('0x2b')];}_0x569d5f['status'](_0x26635e)[_0xe896('0x2c')](_0xd50fe2);};}exports[_0xe896('0x2d')]=function(_0x201653,_0xbfb15b){var _0xace03f={},_0x5e0d9b={},_0x47c268={'count':0x0,'rows':[]};var _0x5c7dae=_['map'](db['UserProfileResource'][_0xe896('0x2e')],function(_0x29a18e){return{'name':_0x29a18e[_0xe896('0x2f')],'type':_0x29a18e[_0xe896('0x30')][_0xe896('0x31')]};});_0x5e0d9b[_0xe896('0x32')]=_[_0xe896('0x33')](_0x5c7dae,_0xe896('0x2b'));_0x5e0d9b['query']=_['keys'](_0x201653[_0xe896('0x34')]);_0x5e0d9b[_0xe896('0x35')]=_[_0xe896('0x36')](_0x5e0d9b[_0xe896('0x32')],_0x5e0d9b['query']);_0xace03f[_0xe896('0x37')]=_['intersection'](_0x5e0d9b['model'],qs[_0xe896('0x38')](_0x201653[_0xe896('0x34')][_0xe896('0x38')]));_0xace03f['attributes']=_0xace03f['attributes']['length']?_0xace03f[_0xe896('0x37')]:_0x5e0d9b[_0xe896('0x32')];if(!_0x201653[_0xe896('0x34')][_0xe896('0x39')](_0xe896('0x3a'))){_0xace03f['limit']=qs[_0xe896('0x1f')](_0x201653[_0xe896('0x34')][_0xe896('0x1f')]);_0xace03f[_0xe896('0x1c')]=qs[_0xe896('0x1c')](_0x201653[_0xe896('0x34')][_0xe896('0x1c')]);}_0xace03f[_0xe896('0x3b')]=qs['sort'](_0x201653[_0xe896('0x34')][_0xe896('0x3c')]);_0xace03f['where']=qs[_0xe896('0x35')](_['pick'](_0x201653[_0xe896('0x34')],_0x5e0d9b['filters']),_0x5c7dae);if(_0x201653[_0xe896('0x34')]['filter']){_0xace03f[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0xace03f[_0xe896('0x3d')],{'$or':_[_0xe896('0x33')](_0x5c7dae,function(_0xeb9bbf){if(_0xeb9bbf['type']!=='VIRTUAL'){var _0x203aea={};_0x203aea[_0xeb9bbf[_0xe896('0x2b')]]={'$like':'%'+_0x201653[_0xe896('0x34')][_0xe896('0x3f')]+'%'};return _0x203aea;}})});}_0xace03f=_[_0xe896('0x3e')]({},_0xace03f,_0x201653['options']);var _0x5b8131={'where':_0xace03f[_0xe896('0x3d')]};return db[_0xe896('0x40')]['count'](_0x5b8131)['then'](function(_0x19d2fd){_0x47c268[_0xe896('0x1e')]=_0x19d2fd;if(_0x201653[_0xe896('0x34')][_0xe896('0x41')]){_0xace03f[_0xe896('0x42')]=[{'all':!![]}];}return db[_0xe896('0x40')][_0xe896('0x43')](_0xace03f);})[_0xe896('0x27')](function(_0x372c71){_0x47c268[_0xe896('0x44')]=_0x372c71;return _0x47c268;})[_0xe896('0x27')](respondWithFilteredResult(_0xbfb15b,_0xace03f))[_0xe896('0x45')](handleError(_0xbfb15b,null));};exports['show']=function(_0x1e5434,_0x143ad4){var _0x59b97f={'raw':![],'where':{'id':_0x1e5434['params']['id']}},_0x57366b={};_0x57366b[_0xe896('0x32')]=_[_0xe896('0x46')](db[_0xe896('0x40')]['rawAttributes']);_0x57366b[_0xe896('0x34')]=_[_0xe896('0x46')](_0x1e5434['query']);_0x57366b['filters']=_['intersection'](_0x57366b[_0xe896('0x32')],_0x57366b[_0xe896('0x34')]);_0x59b97f[_0xe896('0x37')]=_[_0xe896('0x36')](_0x57366b[_0xe896('0x32')],qs[_0xe896('0x38')](_0x1e5434['query'][_0xe896('0x38')]));_0x59b97f[_0xe896('0x37')]=_0x59b97f['attributes'][_0xe896('0x47')]?_0x59b97f[_0xe896('0x37')]:_0x57366b[_0xe896('0x32')];if(_0x1e5434[_0xe896('0x34')]['includeAll']){_0x59b97f[_0xe896('0x42')]=[{'all':!![]}];}_0x59b97f=_[_0xe896('0x3e')]({},_0x59b97f,_0x1e5434[_0xe896('0x48')]);return db[_0xe896('0x40')][_0xe896('0x49')](_0x59b97f)[_0xe896('0x27')](handleEntityNotFound(_0x143ad4,null))['then'](respondWithResult(_0x143ad4,null))[_0xe896('0x45')](handleError(_0x143ad4,null));};exports['create']=function(_0x234a22,_0x1c6ae1){return db[_0xe896('0x40')][_0xe896('0x4a')](_0x234a22[_0xe896('0x4b')],{})[_0xe896('0x27')](respondWithResult(_0x1c6ae1,0xc9))['catch'](handleError(_0x1c6ae1,null));};exports[_0xe896('0x25')]=function(_0x206ad3,_0x4818cd){if(_0x206ad3[_0xe896('0x4b')]['id']){delete _0x206ad3[_0xe896('0x4b')]['id'];}return db['UserProfileResource'][_0xe896('0x49')]({'where':{'id':_0x206ad3['params']['id']}})[_0xe896('0x27')](handleEntityNotFound(_0x4818cd,null))[_0xe896('0x27')](saveUpdates(_0x206ad3[_0xe896('0x4b')],null))[_0xe896('0x27')](respondWithResult(_0x4818cd,null))[_0xe896('0x45')](handleError(_0x4818cd,null));};exports['destroy']=function(_0x1fa3fd,_0x819c8a){return db[_0xe896('0x40')]['find']({'where':{'id':_0x1fa3fd[_0xe896('0x4c')]['id']}})['then'](handleEntityNotFound(_0x819c8a,null))['then'](removeEntity(_0x819c8a,null))[_0xe896('0x45')](handleError(_0x819c8a,null));};exports[_0xe896('0x4d')]=function(_0x57aed3,_0x343adb){return db[_0xe896('0x40')]['describe']()['then'](respondWithResult(_0x343adb,null))[_0xe896('0x45')](handleError(_0x343adb,null));};
\ No newline at end of file
+var _0x47c5=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model'];(function(_0xc0d319,_0xba9f70){var _0x1d8e5d=function(_0x4690df){while(--_0x4690df){_0xc0d319['push'](_0xc0d319['shift']());}};_0x1d8e5d(++_0xba9f70);}(_0x47c5,0x165));var _0x547c=function(_0x3dcaea,_0x2e7222){_0x3dcaea=_0x3dcaea-0x0;var _0xb6f875=_0x47c5[_0x3dcaea];return _0xb6f875;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['UserProfileResource'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['UserProfileResource']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['UserProfileResource'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['UserProfileResource'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));};exports['describe']=function(_0x152982,_0x5258cf){return db[_0x547c('0x2f')][_0x547c('0x51')]()[_0x547c('0x2a')](respondWithResult(_0x5258cf,null))['catch'](handleError(_0x5258cf,null));};
\ No newline at end of file
index 3912573..93f01e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5624=['../../config/environment','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1110bb,_0x22e4c3){var _0x259864=function(_0x387305){while(--_0x387305){_0x1110bb['push'](_0x1110bb['shift']());}};_0x259864(++_0x22e4c3);}(_0x5624,0x106));var _0x4562=function(_0x121689,_0xfc6372){_0x121689=_0x121689-0x0;var _0x4ad7a5=_0x5624[_0x121689];return _0x4ad7a5;};'use strict';var _=require('lodash');var util=require(_0x4562('0x0'));var logger=require(_0x4562('0x1'))(_0x4562('0x2'));var moment=require(_0x4562('0x3'));var BPromise=require(_0x4562('0x4'));var rp=require(_0x4562('0x5'));var fs=require('fs');var path=require(_0x4562('0x6'));var rimraf=require(_0x4562('0x7'));var config=require(_0x4562('0x8'));var attributes=require(_0x4562('0x9'));module['exports']=function(_0x3de329,_0x1f3124){return _0x3de329[_0x4562('0xa')](_0x4562('0xb'),attributes,{'tableName':_0x4562('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x4562('0xd'),_0x4562('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc651=['request-promise','path','rimraf','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','moment','bluebird'];(function(_0x43b532,_0x2855d7){var _0xd329fd=function(_0x3dfc07){while(--_0x3dfc07){_0x43b532['push'](_0x43b532['shift']());}};_0xd329fd(++_0x2855d7);}(_0xc651,0x1ec));var _0x1c65=function(_0x32b150,_0x25dad3){_0x32b150=_0x32b150-0x0;var _0x342923=_0xc651[_0x32b150];return _0x342923;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1c65('0x0'));var BPromise=require(_0x1c65('0x1'));var rp=require(_0x1c65('0x2'));var fs=require('fs');var path=require(_0x1c65('0x3'));var rimraf=require(_0x1c65('0x4'));var config=require(_0x1c65('0x5'));var attributes=require('./userProfileResource.attributes');module[_0x1c65('0x6')]=function(_0x563e98,_0x57b9d1){return _0x563e98[_0x1c65('0x7')](_0x1c65('0x8'),attributes,{'tableName':_0x1c65('0x9'),'paranoid':![],'indexes':[{'name':_0x1c65('0xa'),'fields':[_0x1c65('0xb'),_0x1c65('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index f3f56bc..4b54529 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10c5=['then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x2d3ab3,_0x47d90b){var _0x321f9e=function(_0x50a53d){while(--_0x50a53d){_0x2d3ab3['push'](_0x2d3ab3['shift']());}};_0x321f9e(++_0x47d90b);}(_0x10c5,0xfd));var _0x510c=function(_0x5793c6,_0x56464a){_0x5793c6=_0x5793c6-0x0;var _0x37f876=_0x10c5[_0x5793c6];return _0x37f876;};'use strict';var _=require(_0x510c('0x0'));var util=require(_0x510c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x510c('0x2'));var fs=require('fs');var Redis=require(_0x510c('0x3'));var db=require(_0x510c('0x4'))['db'];var utils=require(_0x510c('0x5'));var logger=require('../../config/logger')(_0x510c('0x6'));var config=require(_0x510c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x510c('0x8')][_0x510c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5afe28,_0x2025bd,_0x261c10){return new BPromise(function(_0x1e3827,_0xc8a520){return client[_0x510c('0xa')](_0x5afe28,_0x261c10)[_0x510c('0xb')](function(_0x48e99a){logger[_0x510c('0xc')](_0x510c('0xd'),_0x2025bd,_0x510c('0xe'));logger[_0x510c('0xf')](_0x510c('0x10'),_0x2025bd,_0x510c('0xe'),JSON[_0x510c('0x11')](_0x48e99a));if(_0x48e99a[_0x510c('0x12')]){if(_0x48e99a[_0x510c('0x12')]['code']===0x1f4){logger[_0x510c('0x12')](_0x510c('0xd'),_0x2025bd,_0x48e99a['error'][_0x510c('0x13')]);return _0xc8a520(_0x48e99a[_0x510c('0x12')]['message']);}logger[_0x510c('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x2025bd,_0x48e99a[_0x510c('0x12')][_0x510c('0x13')]);return _0x1e3827(_0x48e99a[_0x510c('0x12')][_0x510c('0x13')]);}else{logger[_0x510c('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x2025bd,_0x510c('0xe'));_0x1e3827(_0x48e99a[_0x510c('0x14')][_0x510c('0x13')]);}})[_0x510c('0x15')](function(_0x5954bf){logger[_0x510c('0x12')](_0x510c('0xd'),_0x2025bd,_0x5954bf);_0xc8a520(_0x5954bf);});});}
\ No newline at end of file
+var _0x9001=['util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0xb1174e,_0x1e68a7){var _0x285bac=function(_0x32c505){while(--_0x32c505){_0xb1174e['push'](_0xb1174e['shift']());}};_0x285bac(++_0x1e68a7);}(_0x9001,0xc6));var _0x1900=function(_0x319b11,_0x213891){_0x319b11=_0x319b11-0x0;var _0x53fd1a=_0x9001[_0x319b11];return _0x53fd1a;};'use strict';var _=require('lodash');var util=require(_0x1900('0x0'));var moment=require(_0x1900('0x1'));var BPromise=require('bluebird');var rs=require(_0x1900('0x2'));var fs=require('fs');var Redis=require(_0x1900('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1900('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x1900('0x5'));var jayson=require(_0x1900('0x6'));var client=jayson[_0x1900('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3332a6,_0xdab7aa,_0x15633e){return new BPromise(function(_0x92536e,_0x17b8a9){return client[_0x1900('0x8')](_0x3332a6,_0x15633e)[_0x1900('0x9')](function(_0x4988b0){logger[_0x1900('0xa')](_0x1900('0xb'),_0xdab7aa,_0x1900('0xc'));logger['debug'](_0x1900('0xd'),_0xdab7aa,_0x1900('0xc'),JSON[_0x1900('0xe')](_0x4988b0));if(_0x4988b0[_0x1900('0xf')]){if(_0x4988b0[_0x1900('0xf')]['code']===0x1f4){logger[_0x1900('0xf')](_0x1900('0xb'),_0xdab7aa,_0x4988b0['error']['message']);return _0x17b8a9(_0x4988b0[_0x1900('0xf')][_0x1900('0x10')]);}logger[_0x1900('0xf')](_0x1900('0xb'),_0xdab7aa,_0x4988b0[_0x1900('0xf')][_0x1900('0x10')]);return _0x92536e(_0x4988b0[_0x1900('0xf')][_0x1900('0x10')]);}else{logger[_0x1900('0xa')](_0x1900('0xb'),_0xdab7aa,_0x1900('0xc'));_0x92536e(_0x4988b0['result'][_0x1900('0x10')]);}})[_0x1900('0x11')](function(_0x408767){logger[_0x1900('0xf')](_0x1900('0xb'),_0xdab7aa,_0x408767);_0x17b8a9(_0x408767);});});}
\ No newline at end of file
index e46ac6a..ec645a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe709=['/describe','isAuthenticated','show','create','put','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe709,0x1ca));var _0x9e70=function(_0x16b0e4,_0x3c1f0c){_0x16b0e4=_0x16b0e4-0x0;var _0x1949f3=_0xe709[_0x16b0e4];return _0x1949f3;};'use strict';var multer=require(_0x9e70('0x0'));var util=require('util');var path=require(_0x9e70('0x1'));var timeout=require(_0x9e70('0x2'));var express=require(_0x9e70('0x3'));var router=express[_0x9e70('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9e70('0x5'));var config=require(_0x9e70('0x6'));var controller=require(_0x9e70('0x7'));router[_0x9e70('0x8')]('/',auth['isAuthenticated'](),controller[_0x9e70('0x9')]);router[_0x9e70('0x8')](_0x9e70('0xa'),auth[_0x9e70('0xb')](),controller['describe']);router['get']('/:id',auth[_0x9e70('0xb')](),controller[_0x9e70('0xc')]);router['post']('/',auth[_0x9e70('0xb')](),controller[_0x9e70('0xd')]);router[_0x9e70('0xe')](_0x9e70('0xf'),auth[_0x9e70('0xb')](),controller['update']);router['delete'](_0x9e70('0xf'),auth[_0x9e70('0xb')](),controller[_0x9e70('0x10')]);module[_0x9e70('0x11')]=router;
\ No newline at end of file
+var _0x2fb9=['./userProfileSection.controller','isAuthenticated','index','get','describe','/:id','show','post','put','delete','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2fb9,0x92));var _0x92fb=function(_0xe388ca,_0x46e9a8){_0xe388ca=_0xe388ca-0x0;var _0x2f7f82=_0x2fb9[_0xe388ca];return _0x2f7f82;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x92fb('0x0'));var timeout=require(_0x92fb('0x1'));var express=require(_0x92fb('0x2'));var router=express[_0x92fb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x92fb('0x4'));var interaction=require(_0x92fb('0x5'));var config=require(_0x92fb('0x6'));var controller=require(_0x92fb('0x7'));router['get']('/',auth[_0x92fb('0x8')](),controller[_0x92fb('0x9')]);router[_0x92fb('0xa')]('/describe',auth[_0x92fb('0x8')](),controller[_0x92fb('0xb')]);router[_0x92fb('0xa')](_0x92fb('0xc'),auth['isAuthenticated'](),controller[_0x92fb('0xd')]);router[_0x92fb('0xe')]('/',auth[_0x92fb('0x8')](),controller['create']);router[_0x92fb('0xf')](_0x92fb('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x92fb('0x10')](_0x92fb('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index c6f3040..9536053 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x373d=['STRING','INTEGER','BOOLEAN','setDataValue','getDataValue','crudPermissions','sequelize'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x373d,0x1e2));var _0xd373=function(_0x55b3b5,_0x254983){_0x55b3b5=_0x55b3b5-0x0;var _0x5297a9=_0x373d[_0x55b3b5];return _0x5297a9;};'use strict';var Sequelize=require(_0xd373('0x0'));module['exports']={'name':{'type':Sequelize[_0xd373('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xd373('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd373('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xd373('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd373('0x1')],'set':function(_0x547fca){this[_0xd373('0x4')]('crudPermissions',_0x547fca?_0x547fca['join'](''):[]);},'get':function(){return this[_0xd373('0x5')](_0xd373('0x6'))?this[_0xd373('0x5')](_0xd373('0x6'))['split'](''):[];}}};
\ No newline at end of file
+var _0xd4f4=['setDataValue','crudPermissions','getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0xd4f4,0x8b));var _0x4d4f=function(_0xd85c6b,_0x32639c){_0xd85c6b=_0xd85c6b-0x0;var _0x3d2f93=_0xd4f4[_0xd85c6b];return _0x3d2f93;};'use strict';var Sequelize=require(_0x4d4f('0x0'));module[_0x4d4f('0x1')]={'name':{'type':Sequelize[_0x4d4f('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x4d4f('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4d4f('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4d4f('0x2')],'set':function(_0x25087a){this[_0x4d4f('0x5')](_0x4d4f('0x6'),_0x25087a?_0x25087a['join'](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x4d4f('0x7')](_0x4d4f('0x6'))[_0x4d4f('0x8')](''):[];}}};
\ No newline at end of file
index 07a1e0f..5c51d0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe85f=['name','index','UserProfileSection','fieldName','type','model','query','keys','filters','intersection','attributes','nolimit','sort','where','pick','map','VIRTUAL','filter','merge','options','includeAll','findAll','show','fields','include','catch','create','body','params','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','end','stack'];(function(_0x259b36,_0x444eeb){var _0x5ef06b=function(_0x1d7028){while(--_0x1d7028){_0x259b36['push'](_0x259b36['shift']());}};_0x5ef06b(++_0x444eeb);}(_0xe85f,0x138));var _0xfe85=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xe85f[_0x25e7cb];return _0x375d92;};'use strict';var emlformat=require(_0xfe85('0x0'));var rimraf=require(_0xfe85('0x1'));var zipdir=require(_0xfe85('0x2'));var jsonpatch=require(_0xfe85('0x3'));var rp=require(_0xfe85('0x4'));var moment=require(_0xfe85('0x5'));var BPromise=require(_0xfe85('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfe85('0x7'));var sox=require(_0xfe85('0x8'));var csv=require(_0xfe85('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe85('0xa'));var squel=require('squel');var crypto=require(_0xfe85('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfe85('0xc'));var toCsv=require(_0xfe85('0x9'));var querystring=require(_0xfe85('0xd'));var Papa=require(_0xfe85('0xe'));var Redis=require('ioredis');var authService=require(_0xfe85('0xf'));var qs=require(_0xfe85('0x10'));var as=require(_0xfe85('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe85('0x12'))(_0xfe85('0x13'));var utils=require(_0xfe85('0x14'));var config=require(_0xfe85('0x15'));var licenseUtil=require(_0xfe85('0x16'));var db=require(_0xfe85('0x17'))['db'];function respondWithStatusCode(_0x56e7f6,_0x5a1ab9){_0x5a1ab9=_0x5a1ab9||0xcc;return function(_0x76b55f){if(_0x76b55f){return _0x56e7f6['sendStatus'](_0x5a1ab9);}return _0x56e7f6[_0xfe85('0x18')](_0x5a1ab9)['end']();};}function respondWithResult(_0x55bff7,_0x191464){_0x191464=_0x191464||0xc8;return function(_0x4c5495){if(_0x4c5495){return _0x55bff7['status'](_0x191464)['json'](_0x4c5495);}};}function respondWithFilteredResult(_0x4950b5,_0x2e4743){return function(_0xaa576c){if(_0xaa576c){var _0x2147be=typeof _0x2e4743[_0xfe85('0x19')]==='undefined'&&typeof _0x2e4743[_0xfe85('0x1a')]===_0xfe85('0x1b');var _0x803381=_0xaa576c[_0xfe85('0x1c')];var _0x4c7d29=_0x2147be?0x0:_0x2e4743[_0xfe85('0x19')];var _0x406464=_0x2147be?_0xaa576c[_0xfe85('0x1c')]:_0x2e4743['offset']+_0x2e4743['limit'];var _0x219585;if(_0x406464>=_0x803381){_0x406464=_0x803381;_0x219585=0xc8;}else{_0x219585=0xce;}_0x4950b5[_0xfe85('0x18')](_0x219585);return _0x4950b5[_0xfe85('0x1d')](_0xfe85('0x1e'),_0x4c7d29+'-'+_0x406464+'/'+_0x803381)[_0xfe85('0x1f')](_0xaa576c);}return null;};}function patchUpdates(_0x272aba){return function(_0x5be03f){try{jsonpatch[_0xfe85('0x20')](_0x5be03f,_0x272aba,!![]);}catch(_0x299123){return BPromise[_0xfe85('0x21')](_0x299123);}return _0x5be03f['save']();};}function saveUpdates(_0x323785,_0x51a1a1){return function(_0x32e4ee){if(_0x32e4ee){return _0x32e4ee[_0xfe85('0x22')](_0x323785)['then'](function(_0x299212){return _0x299212;});}return null;};}function removeEntity(_0xd52e52,_0x4249c9){return function(_0x545da3){if(_0x545da3){return _0x545da3['destroy']()[_0xfe85('0x23')](function(){_0xd52e52[_0xfe85('0x18')](0xcc)[_0xfe85('0x24')]();});}};}function handleEntityNotFound(_0x26a880,_0x2a7eb8){return function(_0x49e462){if(!_0x49e462){_0x26a880['sendStatus'](0x194);}return _0x49e462;};}function handleError(_0x267880,_0x16af7d){_0x16af7d=_0x16af7d||0x1f4;return function(_0x167b8c){logger['error'](_0x167b8c[_0xfe85('0x25')]);if(_0x167b8c['name']){delete _0x167b8c[_0xfe85('0x26')];}_0x267880[_0xfe85('0x18')](_0x16af7d)['send'](_0x167b8c);};}exports[_0xfe85('0x27')]=function(_0x40b5b8,_0x4f570a){var _0x1adde7={},_0x3683f2={},_0x5e8ee3={'count':0x0,'rows':[]};var _0x3dae6d=_['map'](db[_0xfe85('0x28')]['rawAttributes'],function(_0x50add4){return{'name':_0x50add4[_0xfe85('0x29')],'type':_0x50add4[_0xfe85('0x2a')]['key']};});_0x3683f2[_0xfe85('0x2b')]=_['map'](_0x3dae6d,_0xfe85('0x26'));_0x3683f2[_0xfe85('0x2c')]=_[_0xfe85('0x2d')](_0x40b5b8[_0xfe85('0x2c')]);_0x3683f2[_0xfe85('0x2e')]=_[_0xfe85('0x2f')](_0x3683f2[_0xfe85('0x2b')],_0x3683f2[_0xfe85('0x2c')]);_0x1adde7[_0xfe85('0x30')]=_['intersection'](_0x3683f2[_0xfe85('0x2b')],qs['fields'](_0x40b5b8[_0xfe85('0x2c')]['fields']));_0x1adde7['attributes']=_0x1adde7['attributes']['length']?_0x1adde7[_0xfe85('0x30')]:_0x3683f2[_0xfe85('0x2b')];if(!_0x40b5b8[_0xfe85('0x2c')]['hasOwnProperty'](_0xfe85('0x31'))){_0x1adde7[_0xfe85('0x1a')]=qs[_0xfe85('0x1a')](_0x40b5b8[_0xfe85('0x2c')][_0xfe85('0x1a')]);_0x1adde7['offset']=qs[_0xfe85('0x19')](_0x40b5b8[_0xfe85('0x2c')][_0xfe85('0x19')]);}_0x1adde7['order']=qs[_0xfe85('0x32')](_0x40b5b8[_0xfe85('0x2c')][_0xfe85('0x32')]);_0x1adde7[_0xfe85('0x33')]=qs[_0xfe85('0x2e')](_[_0xfe85('0x34')](_0x40b5b8['query'],_0x3683f2[_0xfe85('0x2e')]),_0x3dae6d);if(_0x40b5b8[_0xfe85('0x2c')]['filter']){_0x1adde7['where']=_['merge'](_0x1adde7[_0xfe85('0x33')],{'$or':_[_0xfe85('0x35')](_0x3dae6d,function(_0x276942){if(_0x276942[_0xfe85('0x2a')]!==_0xfe85('0x36')){var _0x1852ef={};_0x1852ef[_0x276942[_0xfe85('0x26')]]={'$like':'%'+_0x40b5b8[_0xfe85('0x2c')][_0xfe85('0x37')]+'%'};return _0x1852ef;}})});}_0x1adde7=_[_0xfe85('0x38')]({},_0x1adde7,_0x40b5b8[_0xfe85('0x39')]);var _0x28b0e0={'where':_0x1adde7[_0xfe85('0x33')]};return db[_0xfe85('0x28')][_0xfe85('0x1c')](_0x28b0e0)[_0xfe85('0x23')](function(_0x3c224c){_0x5e8ee3[_0xfe85('0x1c')]=_0x3c224c;if(_0x40b5b8[_0xfe85('0x2c')][_0xfe85('0x3a')]){_0x1adde7['include']=[{'all':!![]}];}return db[_0xfe85('0x28')][_0xfe85('0x3b')](_0x1adde7);})[_0xfe85('0x23')](function(_0x19715f){_0x5e8ee3['rows']=_0x19715f;return _0x5e8ee3;})[_0xfe85('0x23')](respondWithFilteredResult(_0x4f570a,_0x1adde7))['catch'](handleError(_0x4f570a,null));};exports[_0xfe85('0x3c')]=function(_0x1bd356,_0x2707d1){var _0x15dfb4={'raw':![],'where':{'id':_0x1bd356['params']['id']}},_0x2d6721={};_0x2d6721['model']=_[_0xfe85('0x2d')](db[_0xfe85('0x28')]['rawAttributes']);_0x2d6721[_0xfe85('0x2c')]=_[_0xfe85('0x2d')](_0x1bd356[_0xfe85('0x2c')]);_0x2d6721['filters']=_[_0xfe85('0x2f')](_0x2d6721[_0xfe85('0x2b')],_0x2d6721[_0xfe85('0x2c')]);_0x15dfb4[_0xfe85('0x30')]=_[_0xfe85('0x2f')](_0x2d6721['model'],qs['fields'](_0x1bd356[_0xfe85('0x2c')][_0xfe85('0x3d')]));_0x15dfb4['attributes']=_0x15dfb4[_0xfe85('0x30')]['length']?_0x15dfb4[_0xfe85('0x30')]:_0x2d6721[_0xfe85('0x2b')];if(_0x1bd356[_0xfe85('0x2c')]['includeAll']){_0x15dfb4[_0xfe85('0x3e')]=[{'all':!![]}];}_0x15dfb4=_[_0xfe85('0x38')]({},_0x15dfb4,_0x1bd356[_0xfe85('0x39')]);return db[_0xfe85('0x28')]['find'](_0x15dfb4)[_0xfe85('0x23')](handleEntityNotFound(_0x2707d1,null))[_0xfe85('0x23')](respondWithResult(_0x2707d1,null))[_0xfe85('0x3f')](handleError(_0x2707d1,null));};exports[_0xfe85('0x40')]=function(_0x34754a,_0x4fe85a){return db[_0xfe85('0x28')][_0xfe85('0x40')](_0x34754a[_0xfe85('0x41')],{})['then'](respondWithResult(_0x4fe85a,0xc9))[_0xfe85('0x3f')](handleError(_0x4fe85a,null));};exports[_0xfe85('0x22')]=function(_0x22f4ce,_0x2b6b9b){if(_0x22f4ce[_0xfe85('0x41')]['id']){delete _0x22f4ce['body']['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x22f4ce[_0xfe85('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b6b9b,null))[_0xfe85('0x23')](saveUpdates(_0x22f4ce['body'],null))[_0xfe85('0x23')](respondWithResult(_0x2b6b9b,null))[_0xfe85('0x3f')](handleError(_0x2b6b9b,null));};exports[_0xfe85('0x43')]=function(_0x555608,_0x39b782){return db['UserProfileSection'][_0xfe85('0x44')]({'where':{'id':_0x555608[_0xfe85('0x42')]['id']}})[_0xfe85('0x23')](handleEntityNotFound(_0x39b782,null))[_0xfe85('0x23')](removeEntity(_0x39b782,null))[_0xfe85('0x3f')](handleError(_0x39b782,null));};exports[_0xfe85('0x45')]=function(_0x39cf18,_0x50c1c0){return db[_0xfe85('0x28')][_0xfe85('0x45')]()[_0xfe85('0x23')](respondWithResult(_0x50c1c0,null))[_0xfe85('0x3f')](handleError(_0x50c1c0,null));};
\ No newline at end of file
+var _0xe3e3=['send','map','UserProfileSection','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name'];(function(_0x19c986,_0x340f37){var _0x4acf36=function(_0x1704d1){while(--_0x1704d1){_0x19c986['push'](_0x19c986['shift']());}};_0x4acf36(++_0x340f37);}(_0xe3e3,0x19b));var _0x3e3e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xe3e3[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e3e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e3e('0x1'));var rp=require(_0x3e3e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3e3e('0x3'));var util=require(_0x3e3e('0x4'));var path=require(_0x3e3e('0x5'));var sox=require(_0x3e3e('0x6'));var csv=require('to-csv');var ejs=require(_0x3e3e('0x7'));var fs=require('fs');var fs_extra=require(_0x3e3e('0x8'));var _=require('lodash');var squel=require(_0x3e3e('0x9'));var crypto=require(_0x3e3e('0xa'));var jsforce=require(_0x3e3e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3e3e('0xc'));var querystring=require(_0x3e3e('0xd'));var Papa=require('papaparse');var Redis=require(_0x3e3e('0xe'));var authService=require(_0x3e3e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3e3e('0x10'));var hardwareService=require(_0x3e3e('0x11'));var logger=require('../../config/logger')(_0x3e3e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e3e('0x13'));var licenseUtil=require(_0x3e3e('0x14'));var db=require(_0x3e3e('0x15'))['db'];function respondWithStatusCode(_0x1b8f4d,_0x55118e){_0x55118e=_0x55118e||0xcc;return function(_0xff25d4){if(_0xff25d4){return _0x1b8f4d[_0x3e3e('0x16')](_0x55118e);}return _0x1b8f4d[_0x3e3e('0x17')](_0x55118e)[_0x3e3e('0x18')]();};}function respondWithResult(_0x271831,_0x432917){_0x432917=_0x432917||0xc8;return function(_0x57b25d){if(_0x57b25d){return _0x271831[_0x3e3e('0x17')](_0x432917)[_0x3e3e('0x19')](_0x57b25d);}};}function respondWithFilteredResult(_0xd17b06,_0x567f5a){return function(_0x4128a6){if(_0x4128a6){var _0x3413dd=typeof _0x567f5a[_0x3e3e('0x1a')]===_0x3e3e('0x1b')&&typeof _0x567f5a[_0x3e3e('0x1c')]===_0x3e3e('0x1b');var _0x1dfd83=_0x4128a6[_0x3e3e('0x1d')];var _0x1ea29e=_0x3413dd?0x0:_0x567f5a[_0x3e3e('0x1a')];var _0x46f756=_0x3413dd?_0x4128a6[_0x3e3e('0x1d')]:_0x567f5a[_0x3e3e('0x1a')]+_0x567f5a[_0x3e3e('0x1c')];var _0x4c59f8;if(_0x46f756>=_0x1dfd83){_0x46f756=_0x1dfd83;_0x4c59f8=0xc8;}else{_0x4c59f8=0xce;}_0xd17b06['status'](_0x4c59f8);return _0xd17b06['set'](_0x3e3e('0x1e'),_0x1ea29e+'-'+_0x46f756+'/'+_0x1dfd83)[_0x3e3e('0x19')](_0x4128a6);}return null;};}function patchUpdates(_0x4dafe0){return function(_0x348df3){try{jsonpatch[_0x3e3e('0x1f')](_0x348df3,_0x4dafe0,!![]);}catch(_0x1d0fe8){return BPromise[_0x3e3e('0x20')](_0x1d0fe8);}return _0x348df3[_0x3e3e('0x21')]();};}function saveUpdates(_0x4d4f43,_0x59f04b){return function(_0x350dec){if(_0x350dec){return _0x350dec[_0x3e3e('0x22')](_0x4d4f43)[_0x3e3e('0x23')](function(_0x175091){return _0x175091;});}return null;};}function removeEntity(_0x272011,_0x25f3ad){return function(_0x2ae140){if(_0x2ae140){return _0x2ae140[_0x3e3e('0x24')]()[_0x3e3e('0x23')](function(){_0x272011[_0x3e3e('0x17')](0xcc)[_0x3e3e('0x18')]();});}};}function handleEntityNotFound(_0x26976c,_0x19c04d){return function(_0x2fc263){if(!_0x2fc263){_0x26976c[_0x3e3e('0x16')](0x194);}return _0x2fc263;};}function handleError(_0x1d869b,_0x12acb5){_0x12acb5=_0x12acb5||0x1f4;return function(_0x4861c1){logger[_0x3e3e('0x25')](_0x4861c1['stack']);if(_0x4861c1[_0x3e3e('0x26')]){delete _0x4861c1[_0x3e3e('0x26')];}_0x1d869b[_0x3e3e('0x17')](_0x12acb5)[_0x3e3e('0x27')](_0x4861c1);};}exports['index']=function(_0x234867,_0x736fdb){var _0x4a4c28={},_0x532c40={},_0x109b1c={'count':0x0,'rows':[]};var _0x5b6251=_[_0x3e3e('0x28')](db[_0x3e3e('0x29')]['rawAttributes'],function(_0x506b27){return{'name':_0x506b27[_0x3e3e('0x2a')],'type':_0x506b27[_0x3e3e('0x2b')][_0x3e3e('0x2c')]};});_0x532c40[_0x3e3e('0x2d')]=_[_0x3e3e('0x28')](_0x5b6251,_0x3e3e('0x26'));_0x532c40[_0x3e3e('0x2e')]=_[_0x3e3e('0x2f')](_0x234867['query']);_0x532c40[_0x3e3e('0x30')]=_['intersection'](_0x532c40['model'],_0x532c40[_0x3e3e('0x2e')]);_0x4a4c28[_0x3e3e('0x31')]=_[_0x3e3e('0x32')](_0x532c40[_0x3e3e('0x2d')],qs[_0x3e3e('0x33')](_0x234867['query'][_0x3e3e('0x33')]));_0x4a4c28[_0x3e3e('0x31')]=_0x4a4c28[_0x3e3e('0x31')][_0x3e3e('0x34')]?_0x4a4c28[_0x3e3e('0x31')]:_0x532c40[_0x3e3e('0x2d')];if(!_0x234867[_0x3e3e('0x2e')][_0x3e3e('0x35')](_0x3e3e('0x36'))){_0x4a4c28[_0x3e3e('0x1c')]=qs[_0x3e3e('0x1c')](_0x234867[_0x3e3e('0x2e')]['limit']);_0x4a4c28[_0x3e3e('0x1a')]=qs[_0x3e3e('0x1a')](_0x234867[_0x3e3e('0x2e')][_0x3e3e('0x1a')]);}_0x4a4c28[_0x3e3e('0x37')]=qs[_0x3e3e('0x38')](_0x234867['query'][_0x3e3e('0x38')]);_0x4a4c28[_0x3e3e('0x39')]=qs[_0x3e3e('0x30')](_[_0x3e3e('0x3a')](_0x234867['query'],_0x532c40[_0x3e3e('0x30')]),_0x5b6251);if(_0x234867['query'][_0x3e3e('0x3b')]){_0x4a4c28['where']=_[_0x3e3e('0x3c')](_0x4a4c28[_0x3e3e('0x39')],{'$or':_[_0x3e3e('0x28')](_0x5b6251,function(_0x1d164e){if(_0x1d164e[_0x3e3e('0x2b')]!==_0x3e3e('0x3d')){var _0x468a9f={};_0x468a9f[_0x1d164e[_0x3e3e('0x26')]]={'$like':'%'+_0x234867[_0x3e3e('0x2e')]['filter']+'%'};return _0x468a9f;}})});}_0x4a4c28=_[_0x3e3e('0x3c')]({},_0x4a4c28,_0x234867[_0x3e3e('0x3e')]);var _0x637326={'where':_0x4a4c28[_0x3e3e('0x39')]};return db[_0x3e3e('0x29')][_0x3e3e('0x1d')](_0x637326)['then'](function(_0x12f9db){_0x109b1c[_0x3e3e('0x1d')]=_0x12f9db;if(_0x234867[_0x3e3e('0x2e')][_0x3e3e('0x3f')]){_0x4a4c28[_0x3e3e('0x40')]=[{'all':!![]}];}return db['UserProfileSection'][_0x3e3e('0x41')](_0x4a4c28);})[_0x3e3e('0x23')](function(_0x1baa07){_0x109b1c[_0x3e3e('0x42')]=_0x1baa07;return _0x109b1c;})[_0x3e3e('0x23')](respondWithFilteredResult(_0x736fdb,_0x4a4c28))[_0x3e3e('0x43')](handleError(_0x736fdb,null));};exports[_0x3e3e('0x44')]=function(_0x4424ff,_0x3d8e1b){var _0x191e59={'raw':![],'where':{'id':_0x4424ff[_0x3e3e('0x45')]['id']}},_0xbb680e={};_0xbb680e[_0x3e3e('0x2d')]=_[_0x3e3e('0x2f')](db[_0x3e3e('0x29')][_0x3e3e('0x46')]);_0xbb680e[_0x3e3e('0x2e')]=_[_0x3e3e('0x2f')](_0x4424ff[_0x3e3e('0x2e')]);_0xbb680e[_0x3e3e('0x30')]=_['intersection'](_0xbb680e['model'],_0xbb680e['query']);_0x191e59[_0x3e3e('0x31')]=_[_0x3e3e('0x32')](_0xbb680e['model'],qs[_0x3e3e('0x33')](_0x4424ff['query'][_0x3e3e('0x33')]));_0x191e59['attributes']=_0x191e59['attributes'][_0x3e3e('0x34')]?_0x191e59[_0x3e3e('0x31')]:_0xbb680e[_0x3e3e('0x2d')];if(_0x4424ff['query'][_0x3e3e('0x3f')]){_0x191e59[_0x3e3e('0x40')]=[{'all':!![]}];}_0x191e59=_[_0x3e3e('0x3c')]({},_0x191e59,_0x4424ff['options']);return db[_0x3e3e('0x29')][_0x3e3e('0x47')](_0x191e59)[_0x3e3e('0x23')](handleEntityNotFound(_0x3d8e1b,null))[_0x3e3e('0x23')](respondWithResult(_0x3d8e1b,null))[_0x3e3e('0x43')](handleError(_0x3d8e1b,null));};exports[_0x3e3e('0x48')]=function(_0x36c83a,_0x1454de){return db[_0x3e3e('0x29')][_0x3e3e('0x48')](_0x36c83a['body'],{})['then'](respondWithResult(_0x1454de,0xc9))[_0x3e3e('0x43')](handleError(_0x1454de,null));};exports[_0x3e3e('0x22')]=function(_0x8da8f8,_0x335eb2){if(_0x8da8f8['body']['id']){delete _0x8da8f8[_0x3e3e('0x49')]['id'];}return db[_0x3e3e('0x29')][_0x3e3e('0x47')]({'where':{'id':_0x8da8f8[_0x3e3e('0x45')]['id']}})[_0x3e3e('0x23')](handleEntityNotFound(_0x335eb2,null))[_0x3e3e('0x23')](saveUpdates(_0x8da8f8[_0x3e3e('0x49')],null))[_0x3e3e('0x23')](respondWithResult(_0x335eb2,null))[_0x3e3e('0x43')](handleError(_0x335eb2,null));};exports[_0x3e3e('0x24')]=function(_0x15aec0,_0x52046c){return db['UserProfileSection'][_0x3e3e('0x47')]({'where':{'id':_0x15aec0[_0x3e3e('0x45')]['id']}})[_0x3e3e('0x23')](handleEntityNotFound(_0x52046c,null))[_0x3e3e('0x23')](removeEntity(_0x52046c,null))[_0x3e3e('0x43')](handleError(_0x52046c,null));};exports[_0x3e3e('0x4a')]=function(_0x11ace1,_0x1df710){return db[_0x3e3e('0x29')]['describe']()[_0x3e3e('0x23')](respondWithResult(_0x1df710,null))[_0x3e3e('0x43')](handleError(_0x1df710,null));};
\ No newline at end of file
index a861cf6..22b732a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa2c=['compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0xaa2c,0x1d1));var _0xcaa2=function(_0x8c3a3d,_0x5b2d9b){_0x8c3a3d=_0x8c3a3d-0x0;var _0x5b50b9=_0xaa2c[_0x8c3a3d];return _0x5b50b9;};'use strict';var _=require(_0xcaa2('0x0'));var util=require(_0xcaa2('0x1'));var logger=require(_0xcaa2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcaa2('0x3'));var rp=require(_0xcaa2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaa2('0x5'));var config=require('../../config/environment');var attributes=require(_0xcaa2('0x6'));module[_0xcaa2('0x7')]=function(_0x37afcf,_0x5ab9ec){return _0x37afcf[_0xcaa2('0x8')](_0xcaa2('0x9'),attributes,{'tableName':_0xcaa2('0xa'),'paranoid':![],'indexes':[{'name':_0xcaa2('0xb'),'fields':[_0xcaa2('0xc'),_0xcaa2('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9700=['user_profile_has_sections','compositeIndex','userProfileId','util','api','moment','bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','UserProfileSection'];(function(_0x2ec3ef,_0x43e319){var _0x59d9e2=function(_0x287b4b){while(--_0x287b4b){_0x2ec3ef['push'](_0x2ec3ef['shift']());}};_0x59d9e2(++_0x43e319);}(_0x9700,0x12f));var _0x0970=function(_0x1366a3,_0x40be59){_0x1366a3=_0x1366a3-0x0;var _0x371712=_0x9700[_0x1366a3];return _0x371712;};'use strict';var _=require('lodash');var util=require(_0x0970('0x0'));var logger=require('../../config/logger')(_0x0970('0x1'));var moment=require(_0x0970('0x2'));var BPromise=require(_0x0970('0x3'));var rp=require(_0x0970('0x4'));var fs=require('fs');var path=require(_0x0970('0x5'));var rimraf=require('rimraf');var config=require(_0x0970('0x6'));var attributes=require(_0x0970('0x7'));module['exports']=function(_0x44a28f,_0x30a5b2){return _0x44a28f['define'](_0x0970('0x8'),attributes,{'tableName':_0x0970('0x9'),'paranoid':![],'indexes':[{'name':_0x0970('0xa'),'fields':['sectionId',_0x0970('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 74b2546..1211136 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd072=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xf43cb,_0x465374){var _0x14e869=function(_0x454719){while(--_0x454719){_0xf43cb['push'](_0xf43cb['shift']());}};_0x14e869(++_0x465374);}(_0xd072,0x132));var _0x2d07=function(_0x533f8e,_0x439bb3){_0x533f8e=_0x533f8e-0x0;var _0x3386ad=_0xd072[_0x533f8e];return _0x3386ad;};'use strict';var _=require(_0x2d07('0x0'));var util=require(_0x2d07('0x1'));var moment=require(_0x2d07('0x2'));var BPromise=require(_0x2d07('0x3'));var rs=require(_0x2d07('0x4'));var fs=require('fs');var Redis=require(_0x2d07('0x5'));var db=require(_0x2d07('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d07('0x7'))(_0x2d07('0x8'));var config=require(_0x2d07('0x9'));var jayson=require(_0x2d07('0xa'));var client=jayson[_0x2d07('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a992a,_0x429d2c,_0x367834){return new BPromise(function(_0x19d04c,_0x167c61){return client[_0x2d07('0xc')](_0x1a992a,_0x367834)[_0x2d07('0xd')](function(_0x4bcba8){logger[_0x2d07('0xe')](_0x2d07('0xf'),_0x429d2c,_0x2d07('0x10'));logger[_0x2d07('0x11')](_0x2d07('0x12'),_0x429d2c,_0x2d07('0x10'),JSON[_0x2d07('0x13')](_0x4bcba8));if(_0x4bcba8[_0x2d07('0x14')]){if(_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x15')]===0x1f4){logger[_0x2d07('0x14')](_0x2d07('0xf'),_0x429d2c,_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x16')]);return _0x167c61(_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x16')]);}logger[_0x2d07('0x14')](_0x2d07('0xf'),_0x429d2c,_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x16')]);return _0x19d04c(_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x16')]);}else{logger[_0x2d07('0xe')](_0x2d07('0xf'),_0x429d2c,_0x2d07('0x10'));_0x19d04c(_0x4bcba8['result'][_0x2d07('0x16')]);}})[_0x2d07('0x17')](function(_0x3d47e5){logger[_0x2d07('0x14')](_0x2d07('0xf'),_0x429d2c,_0x3d47e5);_0x167c61(_0x3d47e5);});});}
\ No newline at end of file
+var _0xaa65=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xaa65,0x90));var _0x5aa6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa65[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5aa6('0x0'));var util=require(_0x5aa6('0x1'));var moment=require(_0x5aa6('0x2'));var BPromise=require(_0x5aa6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5aa6('0x4'));var db=require(_0x5aa6('0x5'))['db'];var utils=require(_0x5aa6('0x6'));var logger=require(_0x5aa6('0x7'))(_0x5aa6('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5aa6('0x9')][_0x5aa6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc9e300,_0x286b0e,_0x5a2153){return new BPromise(function(_0x326ba3,_0x6d4ed9){return client[_0x5aa6('0xb')](_0xc9e300,_0x5a2153)[_0x5aa6('0xc')](function(_0x4430fe){logger[_0x5aa6('0xd')](_0x5aa6('0xe'),_0x286b0e,_0x5aa6('0xf'));logger[_0x5aa6('0x10')](_0x5aa6('0x11'),_0x286b0e,_0x5aa6('0xf'),JSON[_0x5aa6('0x12')](_0x4430fe));if(_0x4430fe['error']){if(_0x4430fe[_0x5aa6('0x13')][_0x5aa6('0x14')]===0x1f4){logger[_0x5aa6('0x13')](_0x5aa6('0xe'),_0x286b0e,_0x4430fe[_0x5aa6('0x13')]['message']);return _0x6d4ed9(_0x4430fe[_0x5aa6('0x13')]['message']);}logger[_0x5aa6('0x13')](_0x5aa6('0xe'),_0x286b0e,_0x4430fe[_0x5aa6('0x13')][_0x5aa6('0x15')]);return _0x326ba3(_0x4430fe['error']['message']);}else{logger['info'](_0x5aa6('0xe'),_0x286b0e,'request\x20sent');_0x326ba3(_0x4430fe[_0x5aa6('0x16')][_0x5aa6('0x15')]);}})[_0x5aa6('0x17')](function(_0x19cb3d){logger[_0x5aa6('0x13')](_0x5aa6('0xe'),_0x286b0e,_0x19cb3d);_0x6d4ed9(_0x19cb3d);});});}
\ No newline at end of file
index ac1f783..67b59ff 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(_0x13054a,_0x5560bb){var _0x4b80f6=function(_0x2c5131){while(--_0x2c5131){_0x13054a['push'](_0x13054a['shift']());}};_0x4b80f6(++_0x5560bb);}(_0xe706,0xa3));var _0x6e70=function(_0x3fc31d,_0x432bc9){_0x3fc31d=_0x3fc31d-0x0;var _0x31bb91=_0xe706[_0x3fc31d];return _0x31bb91;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x105f0c,_0x570005){var _0x582e26=function(_0x50d0bb){while(--_0x50d0bb){_0x105f0c['push'](_0x105f0c['shift']());}};_0x582e26(++_0x570005);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xcb91[_0x19950b];return _0x3c6b41;};'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 8146c9e..4386677 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ff6=['INTEGER','exports'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0x4ff6,0xd5));var _0x64ff=function(_0x229a47,_0x251b9e){_0x229a47=_0x229a47-0x0;var _0x366740=_0x4ff6[_0x229a47];return _0x366740;};'use strict';var Sequelize=require('sequelize');module[_0x64ff('0x0')]={'penalty':{'type':Sequelize[_0x64ff('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3ad8=['exports','sequelize'];(function(_0x3715ac,_0x24082f){var _0x571318=function(_0x726a42){while(--_0x726a42){_0x3715ac['push'](_0x3715ac['shift']());}};_0x571318(++_0x24082f);}(_0x3ad8,0x1cb));var _0x83ad=function(_0x4cd8d8,_0x598f6c){_0x4cd8d8=_0x4cd8d8-0x0;var _0x1c3b7a=_0x3ad8[_0x4cd8d8];return _0x1c3b7a;};'use strict';var Sequelize=require(_0x83ad('0x0'));module[_0x83ad('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 843a43d..ba783af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf562=['moment','bluebird','request-promise','path','rimraf','./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api'];(function(_0x1a25bc,_0x1a009e){var _0x57a898=function(_0x5a4ca7){while(--_0x5a4ca7){_0x1a25bc['push'](_0x1a25bc['shift']());}};_0x57a898(++_0x1a009e);}(_0xf562,0x100));var _0x2f56=function(_0x185277,_0x5be2f0){_0x185277=_0x185277-0x0;var _0x344b15=_0xf562[_0x185277];return _0x344b15;};'use strict';var _=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));var logger=require(_0x2f56('0x2'))(_0x2f56('0x3'));var moment=require(_0x2f56('0x4'));var BPromise=require(_0x2f56('0x5'));var rp=require(_0x2f56('0x6'));var fs=require('fs');var path=require(_0x2f56('0x7'));var rimraf=require(_0x2f56('0x8'));var config=require('../../config/environment');var attributes=require(_0x2f56('0x9'));module['exports']=function(_0x14436b,_0x5b3784){return _0x14436b[_0x2f56('0xa')](_0x2f56('0xb'),attributes,{'tableName':_0x2f56('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x326f=['user_has_sms_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue'];(function(_0x3926b0,_0x179756){var _0x241002=function(_0x10e714){while(--_0x10e714){_0x3926b0['push'](_0x3926b0['shift']());}};_0x241002(++_0x179756);}(_0x326f,0xd1));var _0xf326=function(_0x2d2bbc,_0x2e5f03){_0x2d2bbc=_0x2d2bbc-0x0;var _0x4ec2e2=_0x326f[_0x2d2bbc];return _0x4ec2e2;};'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':[],'timestamps':!![]});};
\ No newline at end of file
index 440e3c7..7b525a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbdf=['catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x530060,_0x695958){var _0x3f33f4=function(_0x221600){while(--_0x221600){_0x530060['push'](_0x530060['shift']());}};_0x3f33f4(++_0x695958);}(_0xcbdf,0xb5));var _0xfcbd=function(_0x20151f,_0x49cd18){_0x20151f=_0x20151f-0x0;var _0x139ccd=_0xcbdf[_0x20151f];return _0x139ccd;};'use strict';var _=require('lodash');var util=require(_0xfcbd('0x0'));var moment=require(_0xfcbd('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcbd('0x2'));var db=require(_0xfcbd('0x3'))['db'];var utils=require(_0xfcbd('0x4'));var logger=require(_0xfcbd('0x5'))(_0xfcbd('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfcbd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d2106,_0x4278f4,_0x3fcf41){return new BPromise(function(_0x351260,_0x368499){return client[_0xfcbd('0x8')](_0x3d2106,_0x3fcf41)[_0xfcbd('0x9')](function(_0x2056ea){logger[_0xfcbd('0xa')](_0xfcbd('0xb'),_0x4278f4,_0xfcbd('0xc'));logger['debug'](_0xfcbd('0xd'),_0x4278f4,_0xfcbd('0xc'),JSON[_0xfcbd('0xe')](_0x2056ea));if(_0x2056ea['error']){if(_0x2056ea['error']['code']===0x1f4){logger[_0xfcbd('0xf')](_0xfcbd('0xb'),_0x4278f4,_0x2056ea[_0xfcbd('0xf')][_0xfcbd('0x10')]);return _0x368499(_0x2056ea[_0xfcbd('0xf')][_0xfcbd('0x10')]);}logger[_0xfcbd('0xf')](_0xfcbd('0xb'),_0x4278f4,_0x2056ea[_0xfcbd('0xf')][_0xfcbd('0x10')]);return _0x351260(_0x2056ea[_0xfcbd('0xf')][_0xfcbd('0x10')]);}else{logger[_0xfcbd('0xa')](_0xfcbd('0xb'),_0x4278f4,_0xfcbd('0xc'));_0x351260(_0x2056ea['result']['message']);}})[_0xfcbd('0x11')](function(_0x227716){logger[_0xfcbd('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x4278f4,_0x227716);_0x368499(_0x227716);});});}
\ No newline at end of file
+var _0x546b=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird'];(function(_0xa92bf1,_0x222947){var _0x4b173c=function(_0x51596d){while(--_0x51596d){_0xa92bf1['push'](_0xa92bf1['shift']());}};_0x4b173c(++_0x222947);}(_0x546b,0x188));var _0xb546=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x546b[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0xb546('0x0'));var util=require(_0xb546('0x1'));var moment=require(_0xb546('0x2'));var BPromise=require(_0xb546('0x3'));var rs=require(_0xb546('0x4'));var fs=require('fs');var Redis=require(_0xb546('0x5'));var db=require(_0xb546('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb546('0x7'))(_0xb546('0x8'));var config=require('../../config/environment');var jayson=require(_0xb546('0x9'));var client=jayson[_0xb546('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35d190,_0x572502,_0x20a792){return new BPromise(function(_0x5848cd,_0x534a0d){return client[_0xb546('0xb')](_0x35d190,_0x20a792)[_0xb546('0xc')](function(_0xd7a36e){logger[_0xb546('0xd')](_0xb546('0xe'),_0x572502,'request\x20sent');logger[_0xb546('0xf')](_0xb546('0x10'),_0x572502,_0xb546('0x11'),JSON[_0xb546('0x12')](_0xd7a36e));if(_0xd7a36e[_0xb546('0x13')]){if(_0xd7a36e['error']['code']===0x1f4){logger['error'](_0xb546('0xe'),_0x572502,_0xd7a36e['error'][_0xb546('0x14')]);return _0x534a0d(_0xd7a36e[_0xb546('0x13')]['message']);}logger['error'](_0xb546('0xe'),_0x572502,_0xd7a36e[_0xb546('0x13')]['message']);return _0x5848cd(_0xd7a36e['error'][_0xb546('0x14')]);}else{logger[_0xb546('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x572502,_0xb546('0x11'));_0x5848cd(_0xd7a36e['result'][_0xb546('0x14')]);}})[_0xb546('0x15')](function(_0x4f801c){logger['error'](_0xb546('0xe'),_0x572502,_0x4f801c);_0x534a0d(_0x4f801c);});});}
\ No newline at end of file
index 40a8ed5..e30f9ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a88=['exports','INTEGER','sequelize'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x0a88,0x7a));var _0x80a8=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0x0a88[_0x86b219];return _0x1f320c;};'use strict';var Sequelize=require(_0x80a8('0x0'));module[_0x80a8('0x1')]={'UserId':{'type':Sequelize[_0x80a8('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x96cb=['exports','INTEGER','sequelize'];(function(_0x396dc6,_0x529342){var _0x285078=function(_0x198a28){while(--_0x198a28){_0x396dc6['push'](_0x396dc6['shift']());}};_0x285078(++_0x529342);}(_0x96cb,0x176));var _0xb96c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x96cb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb96c('0x0'));module[_0xb96c('0x1')]={'UserId':{'type':Sequelize[_0xb96c('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xb96c('0x2')]}};
\ No newline at end of file
index 32aabd3..57cd2a2 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(_0x447a2b,_0x34b9b4){var _0x37fbe3=function(_0x5e3733){while(--_0x5e3733){_0x447a2b['push'](_0x447a2b['shift']());}};_0x37fbe3(++_0x34b9b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x4aa053,_0x4b1684){var _0x1652ac=function(_0x5a1389){while(--_0x5a1389){_0x4aa053['push'](_0x4aa053['shift']());}};_0x1652ac(++_0x4b1684);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 1d21913..8fcabcc 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(_0x2a1f5c,_0x49b13f){var _0x43ce3d=function(_0x66f0bd){while(--_0x66f0bd){_0x2a1f5c['push'](_0x2a1f5c['shift']());}};_0x43ce3d(++_0x49b13f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x37b407,_0x2150f0){var _0x37c90d=function(_0x2b9a53){while(--_0x2b9a53){_0x37b407['push'](_0x37b407['shift']());}};_0x37c90d(++_0x2150f0);}(_0x70e0,0x17b));var _0x070e=function(_0x5a1f08,_0x194552){_0x5a1f08=_0x5a1f08-0x0;var _0xe575d9=_0x70e0[_0x5a1f08];return _0xe575d9;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index b2dba2e..d12a5e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ec7=['INTEGER','sequelize'];(function(_0x2442aa,_0x42f8a4){var _0x5a6e7d=function(_0x4a54c7){while(--_0x4a54c7){_0x2442aa['push'](_0x2442aa['shift']());}};_0x5a6e7d(++_0x42f8a4);}(_0x6ec7,0x159));var _0x76ec=function(_0x29fc1f,_0x19b693){_0x29fc1f=_0x29fc1f-0x0;var _0x53b39e=_0x6ec7[_0x29fc1f];return _0x53b39e;};'use strict';var Sequelize=require(_0x76ec('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x76ec('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x67e4=['exports','INTEGER','sequelize'];(function(_0xefb4a4,_0x28f67a){var _0x15c9cc=function(_0x6e140){while(--_0x6e140){_0xefb4a4['push'](_0xefb4a4['shift']());}};_0x15c9cc(++_0x28f67a);}(_0x67e4,0x161));var _0x467e=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x67e4[_0xc8a931];return _0x28bd27;};'use strict';var Sequelize=require(_0x467e('0x0'));module[_0x467e('0x1')]={'penalty':{'type':Sequelize[_0x467e('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 165fcca..604e344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5274=['../../config/logger','api','moment','bluebird','path','rimraf','exports','define','user_has_voice_queues','lodash','util'];(function(_0x21e49c,_0xa4d646){var _0x56a630=function(_0x2d81ba){while(--_0x2d81ba){_0x21e49c['push'](_0x21e49c['shift']());}};_0x56a630(++_0xa4d646);}(_0x5274,0xae));var _0x4527=function(_0x4ad364,_0x34d600){_0x4ad364=_0x4ad364-0x0;var _0x1ace8f=_0x5274[_0x4ad364];return _0x1ace8f;};'use strict';var _=require(_0x4527('0x0'));var util=require(_0x4527('0x1'));var logger=require(_0x4527('0x2'))(_0x4527('0x3'));var moment=require(_0x4527('0x4'));var BPromise=require(_0x4527('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4527('0x6'));var rimraf=require(_0x4527('0x7'));var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module[_0x4527('0x8')]=function(_0x4117c7,_0x935a81){return _0x4117c7[_0x4527('0x9')]('UserVoiceQueue',attributes,{'tableName':_0x4527('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6fc0=['request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xd82ee7,_0x250624){var _0x13a7c4=function(_0x51969f){while(--_0x51969f){_0xd82ee7['push'](_0xd82ee7['shift']());}};_0x13a7c4(++_0x250624);}(_0x6fc0,0x180));var _0x06fc=function(_0x3e116c,_0x1cb87a){_0x3e116c=_0x3e116c-0x0;var _0x276a52=_0x6fc0[_0x3e116c];return _0x276a52;};'use strict';var _=require(_0x06fc('0x0'));var util=require(_0x06fc('0x1'));var logger=require(_0x06fc('0x2'))(_0x06fc('0x3'));var moment=require(_0x06fc('0x4'));var BPromise=require(_0x06fc('0x5'));var rp=require(_0x06fc('0x6'));var fs=require('fs');var path=require(_0x06fc('0x7'));var rimraf=require(_0x06fc('0x8'));var config=require(_0x06fc('0x9'));var attributes=require(_0x06fc('0xa'));module[_0x06fc('0xb')]=function(_0x2e3c53,_0x1c8109){return _0x2e3c53[_0x06fc('0xc')](_0x06fc('0xd'),attributes,{'tableName':_0x06fc('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 55092da..098b285 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f62=['client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x322010,_0x23087b){var _0x34a3a9=function(_0x528b60){while(--_0x528b60){_0x322010['push'](_0x322010['shift']());}};_0x34a3a9(++_0x23087b);}(_0x8f62,0x194));var _0x28f6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8f62[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x28f6('0x0'));var util=require(_0x28f6('0x1'));var moment=require(_0x28f6('0x2'));var BPromise=require(_0x28f6('0x3'));var rs=require(_0x28f6('0x4'));var fs=require('fs');var Redis=require(_0x28f6('0x5'));var db=require(_0x28f6('0x6'))['db'];var utils=require(_0x28f6('0x7'));var logger=require(_0x28f6('0x8'))(_0x28f6('0x9'));var config=require(_0x28f6('0xa'));var jayson=require(_0x28f6('0xb'));var client=jayson[_0x28f6('0xc')][_0x28f6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x51c44f,_0x151cd9,_0x28eac1){return new BPromise(function(_0x179eee,_0x278374){return client[_0x28f6('0xe')](_0x51c44f,_0x28eac1)[_0x28f6('0xf')](function(_0x37a3dc){logger[_0x28f6('0x10')](_0x28f6('0x11'),_0x151cd9,_0x28f6('0x12'));logger[_0x28f6('0x13')](_0x28f6('0x14'),_0x151cd9,_0x28f6('0x12'),JSON[_0x28f6('0x15')](_0x37a3dc));if(_0x37a3dc[_0x28f6('0x16')]){if(_0x37a3dc['error'][_0x28f6('0x17')]===0x1f4){logger[_0x28f6('0x16')](_0x28f6('0x11'),_0x151cd9,_0x37a3dc[_0x28f6('0x16')][_0x28f6('0x18')]);return _0x278374(_0x37a3dc[_0x28f6('0x16')][_0x28f6('0x18')]);}logger[_0x28f6('0x16')](_0x28f6('0x11'),_0x151cd9,_0x37a3dc[_0x28f6('0x16')][_0x28f6('0x18')]);return _0x179eee(_0x37a3dc[_0x28f6('0x16')][_0x28f6('0x18')]);}else{logger[_0x28f6('0x10')](_0x28f6('0x11'),_0x151cd9,_0x28f6('0x12'));_0x179eee(_0x37a3dc[_0x28f6('0x19')][_0x28f6('0x18')]);}})['catch'](function(_0x13e948){logger[_0x28f6('0x16')](_0x28f6('0x11'),_0x151cd9,_0x13e948);_0x278374(_0x13e948);});});}
\ No newline at end of file
+var _0xdbb3=['info','UserVoiceQueue,\x20%s,\x20%s','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x30aab5,_0x311765){var _0x18423d=function(_0x141514){while(--_0x141514){_0x30aab5['push'](_0x30aab5['shift']());}};_0x18423d(++_0x311765);}(_0xdbb3,0xd9));var _0x3dbb=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xdbb3[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x3dbb('0x0'));var util=require(_0x3dbb('0x1'));var moment=require(_0x3dbb('0x2'));var BPromise=require('bluebird');var rs=require(_0x3dbb('0x3'));var fs=require('fs');var Redis=require(_0x3dbb('0x4'));var db=require(_0x3dbb('0x5'))['db'];var utils=require(_0x3dbb('0x6'));var logger=require(_0x3dbb('0x7'))('rpc');var config=require(_0x3dbb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3dbb('0x9')][_0x3dbb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55fba2,_0x55cf38,_0xc61133){return new BPromise(function(_0x5252a8,_0x4ae8ec){return client[_0x3dbb('0xb')](_0x55fba2,_0xc61133)[_0x3dbb('0xc')](function(_0x4b9e8d){logger[_0x3dbb('0xd')](_0x3dbb('0xe'),_0x55cf38,'request\x20sent');logger['debug'](_0x3dbb('0xf'),_0x55cf38,_0x3dbb('0x10'),JSON[_0x3dbb('0x11')](_0x4b9e8d));if(_0x4b9e8d[_0x3dbb('0x12')]){if(_0x4b9e8d[_0x3dbb('0x12')][_0x3dbb('0x13')]===0x1f4){logger[_0x3dbb('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x55cf38,_0x4b9e8d[_0x3dbb('0x12')][_0x3dbb('0x14')]);return _0x4ae8ec(_0x4b9e8d[_0x3dbb('0x12')][_0x3dbb('0x14')]);}logger[_0x3dbb('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x55cf38,_0x4b9e8d[_0x3dbb('0x12')]['message']);return _0x5252a8(_0x4b9e8d[_0x3dbb('0x12')][_0x3dbb('0x14')]);}else{logger[_0x3dbb('0xd')](_0x3dbb('0xe'),_0x55cf38,_0x3dbb('0x10'));_0x5252a8(_0x4b9e8d[_0x3dbb('0x15')][_0x3dbb('0x14')]);}})[_0x3dbb('0x16')](function(_0x545e2b){logger['error'](_0x3dbb('0xe'),_0x55cf38,_0x545e2b);_0x4ae8ec(_0x545e2b);});});}
\ No newline at end of file
index 79d5aed..358dbe7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x338e58,_0x383afd){var _0x347ecf=function(_0x21a0f6){while(--_0x21a0f6){_0x338e58['push'](_0x338e58['shift']());}};_0x347ecf(++_0x383afd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3f4245,_0x5250f0){var _0x32a0e8=function(_0x4394b5){while(--_0x4394b5){_0x3f4245['push'](_0x3f4245['shift']());}};_0x32a0e8(++_0x5250f0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x34c553,_0x3e7dfc){_0x34c553=_0x34c553-0x0;var _0x1357d2=_0xcb91[_0x34c553];return _0x1357d2;};'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 b70b4f8..2050457 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0ea=['queue_interface','sequelize','exports','INTEGER','STRING','Required\x20by\x20Asterisk'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0xb0ea,0x1ab));var _0xab0e=function(_0x414cbe,_0x16a463){_0x414cbe=_0x414cbe-0x0;var _0x2793fe=_0xb0ea[_0x414cbe];return _0x2793fe;};'use strict';var Sequelize=require(_0xab0e('0x0'));module[_0xab0e('0x1')]={'uniqueid':{'type':Sequelize[_0xab0e('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xab0e('0x3')],'allowNull':![],'comment':_0xab0e('0x4')},'UserId':{'type':Sequelize[_0xab0e('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xab0e('0x3')],'allowNull':![],'unique':_0xab0e('0x5'),'comment':_0xab0e('0x4')},'VoiceQueueId':{'type':Sequelize[_0xab0e('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xab0e('0x3')],'allowNull':![],'unique':_0xab0e('0x5'),'comment':_0xab0e('0x4')},'penalty':{'type':Sequelize[_0xab0e('0x2')](0xb),'defaultValue':0x0,'comment':_0xab0e('0x4')},'paused':{'type':Sequelize[_0xab0e('0x2')](0xb),'defaultValue':0x0,'comment':_0xab0e('0x4')}};
\ No newline at end of file
+var _0xf1e9=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x39443c,_0x25bf1f){var _0x39a016=function(_0x352fc3){while(--_0x352fc3){_0x39443c['push'](_0x39443c['shift']());}};_0x39a016(++_0x25bf1f);}(_0xf1e9,0xc3));var _0x9f1e=function(_0x5aa5b1,_0x5a9170){_0x5aa5b1=_0x5aa5b1-0x0;var _0x4d4b51=_0xf1e9[_0x5aa5b1];return _0x4d4b51;};'use strict';var Sequelize=require(_0x9f1e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9f1e('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9f1e('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x9f1e('0x2')},'UserId':{'type':Sequelize[_0x9f1e('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9f1e('0x3')],'allowNull':![],'unique':_0x9f1e('0x4'),'comment':_0x9f1e('0x2')},'VoiceQueueId':{'type':Sequelize[_0x9f1e('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x9f1e('0x3')],'allowNull':![],'unique':_0x9f1e('0x4'),'comment':_0x9f1e('0x2')},'penalty':{'type':Sequelize[_0x9f1e('0x1')](0xb),'defaultValue':0x0,'comment':_0x9f1e('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x9f1e('0x2')}};
\ No newline at end of file
index 21a6f82..ba4731d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd019=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x157334,_0x45d57e){var _0x363277=function(_0x257be7){while(--_0x257be7){_0x157334['push'](_0x157334['shift']());}};_0x363277(++_0x45d57e);}(_0xd019,0x146));var _0x9d01=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xd019[_0x565c49];return _0x20ca34;};'use strict';var EventEmitter=require(_0x9d01('0x0'));var UserVoiceQueueRt=require(_0x9d01('0x1'))['db'][_0x9d01('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9d01('0x3')](0x0);var events={'afterCreate':_0x9d01('0x4'),'afterUpdate':_0x9d01('0x5'),'afterDestroy':_0x9d01('0x6')};function emitEvent(_0x19fb28){return function(_0x1ea8b6,_0x548305,_0x6ad782){UserVoiceQueueRtEvents[_0x9d01('0x7')](_0x19fb28+':'+_0x1ea8b6['id'],_0x1ea8b6);UserVoiceQueueRtEvents[_0x9d01('0x7')](_0x19fb28,_0x1ea8b6);_0x6ad782(null);};}for(var e in events){if(events[_0x9d01('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x9d01('0x9')](e,emitEvent(event));}}module[_0x9d01('0xa')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xf8c4=['hook','exports','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x28f7b3,_0xeb3ad7){var _0x53d308=function(_0x3050db){while(--_0x3050db){_0x28f7b3['push'](_0x28f7b3['shift']());}};_0x53d308(++_0xeb3ad7);}(_0xf8c4,0x1e5));var _0x4f8c=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0xf8c4[_0x446208];return _0xe49563;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x4f8c('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4f8c('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4f8c('0x2'),'afterDestroy':'remove'};function emitEvent(_0x31d3ee){return function(_0x39db71,_0x2b39df,_0x130bb3){UserVoiceQueueRtEvents[_0x4f8c('0x3')](_0x31d3ee+':'+_0x39db71['id'],_0x39db71);UserVoiceQueueRtEvents[_0x4f8c('0x3')](_0x31d3ee,_0x39db71);_0x130bb3(null);};}for(var e in events){if(events[_0x4f8c('0x4')](e)){var event=events[e];UserVoiceQueueRt[_0x4f8c('0x5')](e,emitEvent(event));}}module[_0x4f8c('0x6')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 3d3a157..2a9ff6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d10=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4026b9,_0x4a1429){var _0x5b1ff2=function(_0x4c158b){while(--_0x4c158b){_0x4026b9['push'](_0x4026b9['shift']());}};_0x5b1ff2(++_0x4a1429);}(_0x7d10,0x17f));var _0x07d1=function(_0x5584e0,_0x55943e){_0x5584e0=_0x5584e0-0x0;var _0x1c8cdb=_0x7d10[_0x5584e0];return _0x1c8cdb;};'use strict';var _=require(_0x07d1('0x0'));var util=require(_0x07d1('0x1'));var logger=require(_0x07d1('0x2'))(_0x07d1('0x3'));var moment=require(_0x07d1('0x4'));var BPromise=require(_0x07d1('0x5'));var rp=require(_0x07d1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07d1('0x7'));var config=require(_0x07d1('0x8'));var attributes=require(_0x07d1('0x9'));module[_0x07d1('0xa')]=function(_0x1319e7,_0x5f513d){return _0x1319e7[_0x07d1('0xb')](_0x07d1('0xc'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c3a=['../../config/environment','exports','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x46390e,_0x39d20f){var _0x4db91c=function(_0x2bd91e){while(--_0x2bd91e){_0x46390e['push'](_0x46390e['shift']());}};_0x4db91c(++_0x39d20f);}(_0x8c3a,0x1b1));var _0xa8c3=function(_0x5cb226,_0x5b2c0a){_0x5cb226=_0x5cb226-0x0;var _0x591d60=_0x8c3a[_0x5cb226];return _0x591d60;};'use strict';var _=require('lodash');var util=require(_0xa8c3('0x0'));var logger=require(_0xa8c3('0x1'))('api');var moment=require(_0xa8c3('0x2'));var BPromise=require(_0xa8c3('0x3'));var rp=require(_0xa8c3('0x4'));var fs=require('fs');var path=require(_0xa8c3('0x5'));var rimraf=require(_0xa8c3('0x6'));var config=require(_0xa8c3('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xa8c3('0x8')]=function(_0x1ec931,_0x2760da){return _0x1ec931['define'](_0xa8c3('0x9'),attributes,{'tableName':_0xa8c3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8c3a048..bbc8caf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf819=['socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost'];(function(_0x56d0b2,_0x2f7c9e){var _0x37e421=function(_0x23b3a9){while(--_0x23b3a9){_0x56d0b2['push'](_0x56d0b2['shift']());}};_0x37e421(++_0x2f7c9e);}(_0xf819,0x82));var _0x9f81=function(_0xfe328a,_0x40602a){_0xfe328a=_0xfe328a-0x0;var _0x54d9a4=_0xf819[_0xfe328a];return _0x54d9a4;};'use strict';var _=require(_0x9f81('0x0'));var util=require(_0x9f81('0x1'));var moment=require(_0x9f81('0x2'));var BPromise=require(_0x9f81('0x3'));var rs=require(_0x9f81('0x4'));var fs=require('fs');var Redis=require(_0x9f81('0x5'));var db=require(_0x9f81('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f81('0x7'))('rpc');var config=require(_0x9f81('0x8'));var jayson=require(_0x9f81('0x9'));var client=jayson[_0x9f81('0xa')]['http']({'port':0x232a});config['redis']=_[_0x9f81('0xb')](config[_0x9f81('0xc')],{'host':_0x9f81('0xd'),'port':0x18eb});var socket=require(_0x9f81('0xe'))(new Redis(config[_0x9f81('0xc')]));require('./userVoiceQueueRt.socket')[_0x9f81('0xf')](socket);function respondWithRpcPromise(_0x1ccaff,_0x51fd35,_0x267fee){return new BPromise(function(_0x289541,_0xe794b9){return client[_0x9f81('0x10')](_0x1ccaff,_0x267fee)[_0x9f81('0x11')](function(_0x1a60c6){logger[_0x9f81('0x12')](_0x9f81('0x13'),_0x51fd35,_0x9f81('0x14'));logger['debug'](_0x9f81('0x15'),_0x51fd35,_0x9f81('0x14'),JSON['stringify'](_0x1a60c6));if(_0x1a60c6['error']){if(_0x1a60c6[_0x9f81('0x16')][_0x9f81('0x17')]===0x1f4){logger[_0x9f81('0x16')](_0x9f81('0x13'),_0x51fd35,_0x1a60c6[_0x9f81('0x16')][_0x9f81('0x18')]);return _0xe794b9(_0x1a60c6['error'][_0x9f81('0x18')]);}logger[_0x9f81('0x16')](_0x9f81('0x13'),_0x51fd35,_0x1a60c6[_0x9f81('0x16')][_0x9f81('0x18')]);return _0x289541(_0x1a60c6['error'][_0x9f81('0x18')]);}else{logger[_0x9f81('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x51fd35,_0x9f81('0x14'));_0x289541(_0x1a60c6[_0x9f81('0x19')][_0x9f81('0x18')]);}})[_0x9f81('0x1a')](function(_0x210f07){logger[_0x9f81('0x16')](_0x9f81('0x13'),_0x51fd35,_0x210f07);_0xe794b9(_0x210f07);});});}exports[_0x9f81('0x1b')]=function(_0x1cb30c){var _0x3ab38a=this;return new Promise(function(_0x603c8,_0x3da206){return db[_0x9f81('0x1c')]['findAll']({'raw':_0x1cb30c['options']?_0x1cb30c[_0x9f81('0x1d')][_0x9f81('0x1e')]===undefined?!![]:![]:!![],'where':_0x1cb30c[_0x9f81('0x1d')]?_0x1cb30c[_0x9f81('0x1d')][_0x9f81('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x9f81('0x20'),db[_0x9f81('0x21')]['fn']('IF',db[_0x9f81('0x21')][_0x9f81('0x22')](_0x9f81('0x23')))),'outboundQueuePauses']]})[_0x9f81('0x11')](function(_0x548508){logger[_0x9f81('0x12')]('GetVoiceQueueRtPauses',_0x1cb30c);logger['debug'](_0x9f81('0x1b'),_0x1cb30c,JSON['stringify'](_0x548508));_0x603c8(_0x548508);})[_0x9f81('0x1a')](function(_0x2e4312){logger[_0x9f81('0x16')]('GetVoiceQueueRtPauses',_0x2e4312[_0x9f81('0x18')],_0x1cb30c);_0x3da206(_0x3ab38a[_0x9f81('0x16')](0x1f4,_0x2e4312[_0x9f81('0x18')]));});});};
\ No newline at end of file
+var _0x1cb9=['register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','debug','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./userVoiceQueueRt.socket'];(function(_0x37df6c,_0x2a9666){var _0x41f7aa=function(_0x2c9605){while(--_0x2c9605){_0x37df6c['push'](_0x37df6c['shift']());}};_0x41f7aa(++_0x2a9666);}(_0x1cb9,0x82));var _0x91cb=function(_0x13147f,_0x224521){_0x13147f=_0x13147f-0x0;var _0x3884e8=_0x1cb9[_0x13147f];return _0x3884e8;};'use strict';var _=require('lodash');var util=require(_0x91cb('0x0'));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('../../config/utils');var logger=require(_0x91cb('0x5'))(_0x91cb('0x6'));var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});config[_0x91cb('0xb')]=_['defaults'](config[_0x91cb('0xb')],{'host':_0x91cb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x91cb('0xd'))[_0x91cb('0xe')](socket);function respondWithRpcPromise(_0x35c57e,_0x414c7c,_0x11a083){return new BPromise(function(_0x43931e,_0x2f0b2c){return client[_0x91cb('0xf')](_0x35c57e,_0x11a083)[_0x91cb('0x10')](function(_0x2f884e){logger[_0x91cb('0x11')](_0x91cb('0x12'),_0x414c7c,_0x91cb('0x13'));logger['debug'](_0x91cb('0x14'),_0x414c7c,_0x91cb('0x13'),JSON[_0x91cb('0x15')](_0x2f884e));if(_0x2f884e[_0x91cb('0x16')]){if(_0x2f884e[_0x91cb('0x16')][_0x91cb('0x17')]===0x1f4){logger[_0x91cb('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x414c7c,_0x2f884e['error'][_0x91cb('0x18')]);return _0x2f0b2c(_0x2f884e[_0x91cb('0x16')][_0x91cb('0x18')]);}logger[_0x91cb('0x16')](_0x91cb('0x12'),_0x414c7c,_0x2f884e['error']['message']);return _0x43931e(_0x2f884e[_0x91cb('0x16')][_0x91cb('0x18')]);}else{logger[_0x91cb('0x11')](_0x91cb('0x12'),_0x414c7c,_0x91cb('0x13'));_0x43931e(_0x2f884e[_0x91cb('0x19')][_0x91cb('0x18')]);}})['catch'](function(_0x1e5e91){logger[_0x91cb('0x16')](_0x91cb('0x12'),_0x414c7c,_0x1e5e91);_0x2f0b2c(_0x1e5e91);});});}exports[_0x91cb('0x1a')]=function(_0x1b7823){var _0x3e11dc=this;return new Promise(function(_0x2b3ea1,_0x3116ff){return db[_0x91cb('0x1b')][_0x91cb('0x1c')]({'raw':_0x1b7823[_0x91cb('0x1d')]?_0x1b7823[_0x91cb('0x1d')][_0x91cb('0x1e')]===undefined?!![]:![]:!![],'where':_0x1b7823['options']?_0x1b7823[_0x91cb('0x1d')]['where']||null:null,'attributes':[[db[_0x91cb('0x1f')]['fn'](_0x91cb('0x20'),db['sequelize']['fn']('IF',db[_0x91cb('0x1f')]['literal'](_0x91cb('0x21')))),'outboundQueuePauses']]})['then'](function(_0x5cd205){logger[_0x91cb('0x11')]('GetVoiceQueueRtPauses',_0x1b7823);logger[_0x91cb('0x22')](_0x91cb('0x1a'),_0x1b7823,JSON[_0x91cb('0x15')](_0x5cd205));_0x2b3ea1(_0x5cd205);})[_0x91cb('0x23')](function(_0x42e43f){logger['error']('GetVoiceQueueRtPauses',_0x42e43f[_0x91cb('0x18')],_0x1b7823);_0x3116ff(_0x3e11dc[_0x91cb('0x16')](0x1f4,_0x42e43f[_0x91cb('0x18')]));});});};
\ No newline at end of file
index d5940f9..5653898 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9829=['remove','update','emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x43cdc5,_0x2f19ba){var _0x2da6c5=function(_0x1bf4f7){while(--_0x1bf4f7){_0x43cdc5['push'](_0x43cdc5['shift']());}};_0x2da6c5(++_0x2f19ba);}(_0x9829,0xc4));var _0x9982=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x9829[_0x231e16];return _0x570a7c;};'use strict';var UserVoiceQueueRtEvents=require(_0x9982('0x0'));var events=[_0x9982('0x1'),_0x9982('0x2'),_0x9982('0x3')];function createListener(_0x338564,_0x4c01a9){return function(_0x399b6c){_0x4c01a9[_0x9982('0x4')](_0x338564,_0x399b6c);};}function removeListener(_0x2f782a,_0x4bee19){return function(){UserVoiceQueueRtEvents[_0x9982('0x5')](_0x2f782a,_0x4bee19);};}exports[_0x9982('0x6')]=function(_0x58f8fe){for(var _0x500dfd=0x0,_0x340d62=events[_0x9982('0x7')];_0x500dfd<_0x340d62;_0x500dfd++){var _0x5d0824=events[_0x500dfd];var _0x25f30a=createListener(_0x9982('0x8')+_0x5d0824,_0x58f8fe);UserVoiceQueueRtEvents['on'](_0x5d0824,_0x25f30a);}};
\ No newline at end of file
+var _0x3837=['save','update','emit','length','userVoiceQueueRt:'];(function(_0x11d22d,_0x10629a){var _0x2f976f=function(_0x5c1e12){while(--_0x5c1e12){_0x11d22d['push'](_0x11d22d['shift']());}};_0x2f976f(++_0x10629a);}(_0x3837,0x1d1));var _0x7383=function(_0x24a1ba,_0x20750b){_0x24a1ba=_0x24a1ba-0x0;var _0x1edc95=_0x3837[_0x24a1ba];return _0x1edc95;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x7383('0x0'),'remove',_0x7383('0x1')];function createListener(_0x59d6d8,_0x17297e){return function(_0x35439d){_0x17297e[_0x7383('0x2')](_0x59d6d8,_0x35439d);};}function removeListener(_0x227ab2,_0xf57468){return function(){UserVoiceQueueRtEvents['removeListener'](_0x227ab2,_0xf57468);};}exports['register']=function(_0x10de5f){for(var _0x408b8d=0x0,_0x24f21f=events[_0x7383('0x3')];_0x408b8d<_0x24f21f;_0x408b8d++){var _0x193cbf=events[_0x408b8d];var _0x2ad510=createListener(_0x7383('0x4')+_0x193cbf,_0x10de5f);UserVoiceQueueRtEvents['on'](_0x193cbf,_0x2ad510);}};
\ No newline at end of file
index d7e0366..8ad3ee2 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(_0x19cd03,_0x33168c){var _0x3b0e48=function(_0x5e989d){while(--_0x5e989d){_0x19cd03['push'](_0x19cd03['shift']());}};_0x3b0e48(++_0x33168c);}(_0xe706,0xa3));var _0x6e70=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0xe706[_0x4e6eb2];return _0x4e0c1c;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1140a7,_0x3c96e1){var _0x3862af=function(_0x2b9134){while(--_0x2b9134){_0x1140a7['push'](_0x1140a7['shift']());}};_0x3862af(++_0x3c96e1);}(_0xedd9,0xfc));var _0x9edd=function(_0x54c82e,_0x4bd4a5){_0x54c82e=_0x54c82e-0x0;var _0x6db2eb=_0xedd9[_0x54c82e];return _0x6db2eb;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
index 402288a..6c081c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x840f=['sequelize','exports'];(function(_0x4b418f,_0x3b6a96){var _0x2ed208=function(_0x5bb29b){while(--_0x5bb29b){_0x4b418f['push'](_0x4b418f['shift']());}};_0x2ed208(++_0x3b6a96);}(_0x840f,0x8a));var _0xf840=function(_0x480c13,_0xe67fac){_0x480c13=_0x480c13-0x0;var _0x53ee47=_0x840f[_0x480c13];return _0x53ee47;};'use strict';var Sequelize=require(_0xf840('0x0'));module[_0xf840('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd910=['exports','INTEGER','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd910,0xf2));var _0x0d91=function(_0x241608,_0x541e15){_0x241608=_0x241608-0x0;var _0x28e5dc=_0xd910[_0x241608];return _0x28e5dc;};'use strict';var Sequelize=require(_0x0d91('0x0'));module[_0x0d91('0x1')]={'penalty':{'type':Sequelize[_0x0d91('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 7cf355c..8c054bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4955=['user_has_whatsapp_queues','lodash','util','api','bluebird','path','../../config/environment','exports','define','UserWhatsappQueue'];(function(_0x130719,_0x2a7018){var _0x159865=function(_0x3a4d06){while(--_0x3a4d06){_0x130719['push'](_0x130719['shift']());}};_0x159865(++_0x2a7018);}(_0x4955,0x65));var _0x5495=function(_0x1f7a6e,_0x7fd4e8){_0x1f7a6e=_0x1f7a6e-0x0;var _0x4eb751=_0x4955[_0x1f7a6e];return _0x4eb751;};'use strict';var _=require(_0x5495('0x0'));var util=require(_0x5495('0x1'));var logger=require('../../config/logger')(_0x5495('0x2'));var moment=require('moment');var BPromise=require(_0x5495('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5495('0x4'));var rimraf=require('rimraf');var config=require(_0x5495('0x5'));var attributes=require('./userWhatsappQueue.attributes');module[_0x5495('0x6')]=function(_0x32f8ec,_0x4c7fea){return _0x32f8ec[_0x5495('0x7')](_0x5495('0x8'),attributes,{'tableName':_0x5495('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb64e=['UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0x4d411f,_0x49ea58){var _0x3ab691=function(_0x260334){while(--_0x260334){_0x4d411f['push'](_0x4d411f['shift']());}};_0x3ab691(++_0x49ea58);}(_0xb64e,0x17e));var _0xeb64=function(_0x2989ef,_0x353d45){_0x2989ef=_0x2989ef-0x0;var _0x25c7dd=_0xb64e[_0x2989ef];return _0x25c7dd;};'use strict';var _=require('lodash');var util=require(_0xeb64('0x0'));var logger=require(_0xeb64('0x1'))('api');var moment=require(_0xeb64('0x2'));var BPromise=require('bluebird');var rp=require(_0xeb64('0x3'));var fs=require('fs');var path=require(_0xeb64('0x4'));var rimraf=require(_0xeb64('0x5'));var config=require(_0xeb64('0x6'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x2e705d,_0x4829af){return _0x2e705d[_0xeb64('0x7')](_0xeb64('0x8'),attributes,{'tableName':_0xeb64('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f98c9a0..4c1c444 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x229f=['request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x29f0df,_0x4d1c63){var _0x56bb8e=function(_0x3fefb4){while(--_0x3fefb4){_0x29f0df['push'](_0x29f0df['shift']());}};_0x56bb8e(++_0x4d1c63);}(_0x229f,0x144));var _0xf229=function(_0x1edba7,_0x53799f){_0x1edba7=_0x1edba7-0x0;var _0x4de9b7=_0x229f[_0x1edba7];return _0x4de9b7;};'use strict';var _=require(_0xf229('0x0'));var util=require(_0xf229('0x1'));var moment=require(_0xf229('0x2'));var BPromise=require('bluebird');var rs=require(_0xf229('0x3'));var fs=require('fs');var Redis=require(_0xf229('0x4'));var db=require(_0xf229('0x5'))['db'];var utils=require(_0xf229('0x6'));var logger=require(_0xf229('0x7'))(_0xf229('0x8'));var config=require(_0xf229('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf229('0xa')][_0xf229('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c5d5c,_0x3e6b96,_0x3b769f){return new BPromise(function(_0x39c180,_0xdd576b){return client[_0xf229('0xc')](_0x3c5d5c,_0x3b769f)[_0xf229('0xd')](function(_0x1989ef){logger[_0xf229('0xe')](_0xf229('0xf'),_0x3e6b96,'request\x20sent');logger[_0xf229('0x10')](_0xf229('0x11'),_0x3e6b96,'request\x20sent',JSON['stringify'](_0x1989ef));if(_0x1989ef[_0xf229('0x12')]){if(_0x1989ef[_0xf229('0x12')][_0xf229('0x13')]===0x1f4){logger[_0xf229('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3e6b96,_0x1989ef[_0xf229('0x12')][_0xf229('0x14')]);return _0xdd576b(_0x1989ef[_0xf229('0x12')][_0xf229('0x14')]);}logger[_0xf229('0x12')](_0xf229('0xf'),_0x3e6b96,_0x1989ef[_0xf229('0x12')]['message']);return _0x39c180(_0x1989ef[_0xf229('0x12')]['message']);}else{logger['info'](_0xf229('0xf'),_0x3e6b96,_0xf229('0x15'));_0x39c180(_0x1989ef[_0xf229('0x16')][_0xf229('0x14')]);}})[_0xf229('0x17')](function(_0x34563a){logger[_0xf229('0x12')](_0xf229('0xf'),_0x3e6b96,_0x34563a);_0xdd576b(_0x34563a);});});}
\ No newline at end of file
+var _0xc524=['message','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x145b39,_0x3561dd){var _0x15c617=function(_0xebf28e){while(--_0xebf28e){_0x145b39['push'](_0x145b39['shift']());}};_0x15c617(++_0x3561dd);}(_0xc524,0x1bb));var _0x4c52=function(_0x5ac35c,_0x2a1cc9){_0x5ac35c=_0x5ac35c-0x0;var _0x4bf6bf=_0xc524[_0x5ac35c];return _0x4bf6bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4c52('0x0'));var BPromise=require(_0x4c52('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c52('0x2'));var db=require(_0x4c52('0x3'))['db'];var utils=require(_0x4c52('0x4'));var logger=require(_0x4c52('0x5'))(_0x4c52('0x6'));var config=require(_0x4c52('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4c52('0x8')][_0x4c52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49f202,_0x2e3718,_0xf0b2c6){return new BPromise(function(_0x278c0a,_0x4c8eb0){return client[_0x4c52('0xa')](_0x49f202,_0xf0b2c6)['then'](function(_0x13058b){logger[_0x4c52('0xb')](_0x4c52('0xc'),_0x2e3718,_0x4c52('0xd'));logger[_0x4c52('0xe')](_0x4c52('0xf'),_0x2e3718,_0x4c52('0xd'),JSON[_0x4c52('0x10')](_0x13058b));if(_0x13058b[_0x4c52('0x11')]){if(_0x13058b['error'][_0x4c52('0x12')]===0x1f4){logger[_0x4c52('0x11')](_0x4c52('0xc'),_0x2e3718,_0x13058b['error']['message']);return _0x4c8eb0(_0x13058b[_0x4c52('0x11')]['message']);}logger[_0x4c52('0x11')](_0x4c52('0xc'),_0x2e3718,_0x13058b['error'][_0x4c52('0x13')]);return _0x278c0a(_0x13058b[_0x4c52('0x11')][_0x4c52('0x13')]);}else{logger['info'](_0x4c52('0xc'),_0x2e3718,_0x4c52('0xd'));_0x278c0a(_0x13058b['result']['message']);}})[_0x4c52('0x14')](function(_0x27cbb0){logger[_0x4c52('0x11')](_0x4c52('0xc'),_0x2e3718,_0x27cbb0);_0x4c8eb0(_0x27cbb0);});});}
\ No newline at end of file
index b7ec1ca..558788d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2ce=['get','index','/:id','show','isAuthenticated','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x347d57,_0x5caad5){var _0x32b958=function(_0x13c6db){while(--_0x13c6db){_0x347d57['push'](_0x347d57['shift']());}};_0x32b958(++_0x5caad5);}(_0xd2ce,0x13c));var _0xed2c=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xd2ce[_0x1e7b16];return _0x37fadc;};'use strict';var multer=require('multer');var util=require(_0xed2c('0x0'));var path=require('path');var timeout=require(_0xed2c('0x1'));var express=require(_0xed2c('0x2'));var router=express[_0xed2c('0x3')]();var fs_extra=require(_0xed2c('0x4'));var auth=require(_0xed2c('0x5'));var interaction=require(_0xed2c('0x6'));var config=require(_0xed2c('0x7'));var controller=require('./variable.controller');router[_0xed2c('0x8')]('/',auth['isAuthenticated'](),controller[_0xed2c('0x9')]);router[_0xed2c('0x8')](_0xed2c('0xa'),auth['isAuthenticated'](),controller[_0xed2c('0xb')]);router['post']('/',auth[_0xed2c('0xc')](),controller[_0xed2c('0xd')]);router['put']('/:id',auth[_0xed2c('0xc')](),controller[_0xed2c('0xe')]);router[_0xed2c('0xf')](_0xed2c('0xa'),auth['isAuthenticated'](),controller[_0xed2c('0x10')]);module[_0xed2c('0x11')]=router;
\ No newline at end of file
+var _0xd04b=['put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x2b1205,_0x59a6d2){var _0x4c1d88=function(_0x1b32b1){while(--_0x1b32b1){_0x2b1205['push'](_0x2b1205['shift']());}};_0x4c1d88(++_0x59a6d2);}(_0xd04b,0x145));var _0xbd04=function(_0x2f931e,_0x584f14){_0x2f931e=_0x2f931e-0x0;var _0x40ca88=_0xd04b[_0x2f931e];return _0x40ca88;};'use strict';var multer=require(_0xbd04('0x0'));var util=require(_0xbd04('0x1'));var path=require(_0xbd04('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd04('0x3'));var router=express['Router']();var fs_extra=require(_0xbd04('0x4'));var auth=require(_0xbd04('0x5'));var interaction=require(_0xbd04('0x6'));var config=require(_0xbd04('0x7'));var controller=require(_0xbd04('0x8'));router[_0xbd04('0x9')]('/',auth[_0xbd04('0xa')](),controller[_0xbd04('0xb')]);router[_0xbd04('0x9')](_0xbd04('0xc'),auth[_0xbd04('0xa')](),controller['show']);router[_0xbd04('0xd')]('/',auth[_0xbd04('0xa')](),controller[_0xbd04('0xe')]);router[_0xbd04('0xf')](_0xbd04('0xc'),auth[_0xbd04('0xa')](),controller[_0xbd04('0x10')]);router[_0xbd04('0x11')]('/:id',auth[_0xbd04('0xa')](),controller[_0xbd04('0x12')]);module[_0xbd04('0x13')]=router;
\ No newline at end of file
index 356b165..fa8fa8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e6=['sequelize','exports','STRING','name'];(function(_0x1e4f2f,_0x35edfa){var _0xccea89=function(_0x164386){while(--_0x164386){_0x1e4f2f['push'](_0x1e4f2f['shift']());}};_0xccea89(++_0x35edfa);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0xb4e6[_0x5948dd];return _0xb1f8be;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module[_0x6b4e('0x1')]={'name':{'type':Sequelize[_0x6b4e('0x2')],'unique':_0x6b4e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6b4e('0x2')]}};
\ No newline at end of file
+'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 079aeb3..e9cddd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacee=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','Variables','UserProfileResource','error','stack','name','index','map','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','Variable','includeAll','rows','show','keys','include','options','find','catch','create','body','user','get','role','userProfileId','autoAssociation','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x21d0e6,_0x5a7aa6){var _0x1cc2d1=function(_0x25ded8){while(--_0x25ded8){_0x21d0e6['push'](_0x21d0e6['shift']());}};_0x1cc2d1(++_0x5a7aa6);}(_0xacee,0x141));var _0xeace=function(_0x41d8e4,_0x1090cd){_0x41d8e4=_0x41d8e4-0x0;var _0x5d91c6=_0xacee[_0x41d8e4];return _0x5d91c6;};'use strict';var emlformat=require(_0xeace('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeace('0x1'));var jsonpatch=require(_0xeace('0x2'));var rp=require(_0xeace('0x3'));var moment=require(_0xeace('0x4'));var BPromise=require(_0xeace('0x5'));var Mustache=require(_0xeace('0x6'));var util=require(_0xeace('0x7'));var path=require(_0xeace('0x8'));var sox=require(_0xeace('0x9'));var csv=require(_0xeace('0xa'));var ejs=require(_0xeace('0xb'));var fs=require('fs');var fs_extra=require(_0xeace('0xc'));var _=require(_0xeace('0xd'));var squel=require(_0xeace('0xe'));var crypto=require(_0xeace('0xf'));var jsforce=require(_0xeace('0x10'));var deskjs=require(_0xeace('0x11'));var toCsv=require(_0xeace('0xa'));var querystring=require(_0xeace('0x12'));var Papa=require(_0xeace('0x13'));var Redis=require(_0xeace('0x14'));var authService=require(_0xeace('0x15'));var qs=require(_0xeace('0x16'));var as=require(_0xeace('0x17'));var hardwareService=require(_0xeace('0x18'));var logger=require(_0xeace('0x19'))('api');var utils=require(_0xeace('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xeace('0x1b'));var db=require(_0xeace('0x1c'))['db'];function respondWithStatusCode(_0x2d814b,_0x406d18){_0x406d18=_0x406d18||0xcc;return function(_0xe05a21){if(_0xe05a21){return _0x2d814b[_0xeace('0x1d')](_0x406d18);}return _0x2d814b[_0xeace('0x1e')](_0x406d18)[_0xeace('0x1f')]();};}function respondWithResult(_0x75e134,_0x461e81){_0x461e81=_0x461e81||0xc8;return function(_0x214652){if(_0x214652){return _0x75e134['status'](_0x461e81)[_0xeace('0x20')](_0x214652);}};}function respondWithFilteredResult(_0x21e6b1,_0x318f7e){return function(_0x45aabd){if(_0x45aabd){var _0x4c9fc8=typeof _0x318f7e['offset']==='undefined'&&typeof _0x318f7e['limit']===_0xeace('0x21');var _0x3c141f=_0x45aabd[_0xeace('0x22')];var _0x40cf11=_0x4c9fc8?0x0:_0x318f7e[_0xeace('0x23')];var _0x289e1f=_0x4c9fc8?_0x45aabd['count']:_0x318f7e[_0xeace('0x23')]+_0x318f7e[_0xeace('0x24')];var _0x74989e;if(_0x289e1f>=_0x3c141f){_0x289e1f=_0x3c141f;_0x74989e=0xc8;}else{_0x74989e=0xce;}_0x21e6b1['status'](_0x74989e);return _0x21e6b1[_0xeace('0x25')](_0xeace('0x26'),_0x40cf11+'-'+_0x289e1f+'/'+_0x3c141f)['json'](_0x45aabd);}return null;};}function patchUpdates(_0x331ee2){return function(_0x443a39){try{jsonpatch[_0xeace('0x27')](_0x443a39,_0x331ee2,!![]);}catch(_0x1581fc){return BPromise[_0xeace('0x28')](_0x1581fc);}return _0x443a39[_0xeace('0x29')]();};}function saveUpdates(_0xe32ea2,_0x1c8757){return function(_0x5adc20){if(_0x5adc20){return _0x5adc20[_0xeace('0x2a')](_0xe32ea2)['then'](function(_0x4bb6ac){return _0x4bb6ac;});}return null;};}function removeEntity(_0x57a813,_0x2630f5){return function(_0x706f7d){if(_0x706f7d){return _0x706f7d[_0xeace('0x2b')]()[_0xeace('0x2c')](function(){var _0x1488fa=_0x706f7d['get']({'plain':!![]});var _0x541b0d=_0xeace('0x2d');return db[_0xeace('0x2e')][_0xeace('0x2b')]({'where':{'type':_0x541b0d,'resourceId':_0x1488fa['id']}})[_0xeace('0x2c')](function(){return _0x706f7d;});})[_0xeace('0x2c')](function(){_0x57a813[_0xeace('0x1e')](0xcc)[_0xeace('0x1f')]();});}};}function handleEntityNotFound(_0x2df3bb,_0x4a9437){return function(_0x508086){if(!_0x508086){_0x2df3bb[_0xeace('0x1d')](0x194);}return _0x508086;};}function handleError(_0x59a31d,_0xf258b2){_0xf258b2=_0xf258b2||0x1f4;return function(_0x1a0735){logger[_0xeace('0x2f')](_0x1a0735[_0xeace('0x30')]);if(_0x1a0735[_0xeace('0x31')]){delete _0x1a0735['name'];}_0x59a31d['status'](_0xf258b2)['send'](_0x1a0735);};}exports[_0xeace('0x32')]=function(_0x17a5b0,_0x5199d0){var _0x430a88={},_0x52c713={},_0x4d2306={'count':0x0,'rows':[]};var _0x5e73dd=_[_0xeace('0x33')](db['Variable'][_0xeace('0x34')],function(_0x52a4aa){return{'name':_0x52a4aa['fieldName'],'type':_0x52a4aa['type'][_0xeace('0x35')]};});_0x52c713[_0xeace('0x36')]=_['map'](_0x5e73dd,_0xeace('0x31'));_0x52c713[_0xeace('0x37')]=_['keys'](_0x17a5b0[_0xeace('0x37')]);_0x52c713['filters']=_[_0xeace('0x38')](_0x52c713[_0xeace('0x36')],_0x52c713['query']);_0x430a88[_0xeace('0x39')]=_[_0xeace('0x38')](_0x52c713[_0xeace('0x36')],qs['fields'](_0x17a5b0[_0xeace('0x37')][_0xeace('0x3a')]));_0x430a88[_0xeace('0x39')]=_0x430a88[_0xeace('0x39')][_0xeace('0x3b')]?_0x430a88[_0xeace('0x39')]:_0x52c713[_0xeace('0x36')];if(!_0x17a5b0[_0xeace('0x37')][_0xeace('0x3c')](_0xeace('0x3d'))){_0x430a88[_0xeace('0x24')]=qs[_0xeace('0x24')](_0x17a5b0[_0xeace('0x37')]['limit']);_0x430a88[_0xeace('0x23')]=qs[_0xeace('0x23')](_0x17a5b0[_0xeace('0x37')]['offset']);}_0x430a88[_0xeace('0x3e')]=qs[_0xeace('0x3f')](_0x17a5b0[_0xeace('0x37')][_0xeace('0x3f')]);_0x430a88[_0xeace('0x40')]=qs['filters'](_[_0xeace('0x41')](_0x17a5b0[_0xeace('0x37')],_0x52c713['filters']),_0x5e73dd);if(_0x17a5b0[_0xeace('0x37')][_0xeace('0x42')]){_0x430a88[_0xeace('0x40')]=_[_0xeace('0x43')](_0x430a88[_0xeace('0x40')],{'$or':_[_0xeace('0x33')](_0x5e73dd,function(_0x90bb08){if(_0x90bb08[_0xeace('0x44')]!=='VIRTUAL'){var _0xf3dd3d={};_0xf3dd3d[_0x90bb08['name']]={'$like':'%'+_0x17a5b0[_0xeace('0x37')][_0xeace('0x42')]+'%'};return _0xf3dd3d;}})});}_0x430a88=_[_0xeace('0x43')]({},_0x430a88,_0x17a5b0['options']);var _0x2d368d={'where':_0x430a88[_0xeace('0x40')]};return db[_0xeace('0x45')]['count'](_0x2d368d)[_0xeace('0x2c')](function(_0x23072c){_0x4d2306[_0xeace('0x22')]=_0x23072c;if(_0x17a5b0['query'][_0xeace('0x46')]){_0x430a88['include']=[{'all':!![]}];}return db[_0xeace('0x45')]['findAll'](_0x430a88);})[_0xeace('0x2c')](function(_0x3092d1){_0x4d2306[_0xeace('0x47')]=_0x3092d1;return _0x4d2306;})[_0xeace('0x2c')](respondWithFilteredResult(_0x5199d0,_0x430a88))['catch'](handleError(_0x5199d0,null));};exports[_0xeace('0x48')]=function(_0x1568a3,_0x3915f0){var _0x15f1d8={'raw':!![],'where':{'id':_0x1568a3['params']['id']}},_0x372a47={};_0x372a47[_0xeace('0x36')]=_[_0xeace('0x49')](db[_0xeace('0x45')][_0xeace('0x34')]);_0x372a47[_0xeace('0x37')]=_[_0xeace('0x49')](_0x1568a3[_0xeace('0x37')]);_0x372a47['filters']=_[_0xeace('0x38')](_0x372a47['model'],_0x372a47[_0xeace('0x37')]);_0x15f1d8[_0xeace('0x39')]=_[_0xeace('0x38')](_0x372a47['model'],qs[_0xeace('0x3a')](_0x1568a3[_0xeace('0x37')][_0xeace('0x3a')]));_0x15f1d8['attributes']=_0x15f1d8[_0xeace('0x39')]['length']?_0x15f1d8[_0xeace('0x39')]:_0x372a47[_0xeace('0x36')];if(_0x1568a3[_0xeace('0x37')]['includeAll']){_0x15f1d8[_0xeace('0x4a')]=[{'all':!![]}];}_0x15f1d8=_[_0xeace('0x43')]({},_0x15f1d8,_0x1568a3[_0xeace('0x4b')]);return db[_0xeace('0x45')][_0xeace('0x4c')](_0x15f1d8)[_0xeace('0x2c')](handleEntityNotFound(_0x3915f0,null))[_0xeace('0x2c')](respondWithResult(_0x3915f0,null))[_0xeace('0x4d')](handleError(_0x3915f0,null));};exports[_0xeace('0x4e')]=function(_0x13ea79,_0x2d61d9){return db['Variable']['create'](_0x13ea79[_0xeace('0x4f')],{})['then'](function(_0x5505f2){var _0x15a362=_0x13ea79[_0xeace('0x50')][_0xeace('0x51')]({'plain':!![]});if(!_0x15a362)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15a362[_0xeace('0x52')]===_0xeace('0x50')){var _0x519308=_0x5505f2[_0xeace('0x51')]({'plain':!![]});var _0x5f261d=_0xeace('0x2d');return db['UserProfileSection'][_0xeace('0x4c')]({'where':{'name':_0x5f261d,'userProfileId':_0x15a362[_0xeace('0x53')]},'raw':!![]})[_0xeace('0x2c')](function(_0x277dd9){if(_0x277dd9&&_0x277dd9[_0xeace('0x54')]===0x0){return db[_0xeace('0x2e')][_0xeace('0x4e')]({'name':_0x519308[_0xeace('0x31')],'resourceId':_0x519308['id'],'type':_0x277dd9['name'],'sectionId':_0x277dd9['id']},{})[_0xeace('0x2c')](function(){return _0x5505f2;});}else{return _0x5505f2;}})[_0xeace('0x4d')](function(_0x3862d5){logger[_0xeace('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3862d5);throw _0x3862d5;});}return _0x5505f2;})[_0xeace('0x2c')](respondWithResult(_0x2d61d9,0xc9))[_0xeace('0x4d')](handleError(_0x2d61d9,null));};exports[_0xeace('0x2a')]=function(_0x570176,_0x472be8){if(_0x570176[_0xeace('0x4f')]['id']){delete _0x570176[_0xeace('0x4f')]['id'];}return db[_0xeace('0x45')][_0xeace('0x4c')]({'where':{'id':_0x570176[_0xeace('0x55')]['id']}})['then'](handleEntityNotFound(_0x472be8,null))['then'](saveUpdates(_0x570176[_0xeace('0x4f')],null))[_0xeace('0x2c')](respondWithResult(_0x472be8,null))[_0xeace('0x4d')](handleError(_0x472be8,null));};exports[_0xeace('0x2b')]=function(_0x488ba4,_0x986fdf){return db[_0xeace('0x45')][_0xeace('0x4c')]({'where':{'id':_0x488ba4[_0xeace('0x55')]['id']}})[_0xeace('0x2c')](handleEntityNotFound(_0x986fdf,null))[_0xeace('0x2c')](removeEntity(_0x986fdf,null))['catch'](handleError(_0x986fdf,null));};
\ No newline at end of file
+var _0x2fca=['Variable','includeAll','findAll','catch','show','params','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options'];(function(_0x54aaac,_0x162860){var _0x37a771=function(_0x1ca4f0){while(--_0x1ca4f0){_0x54aaac['push'](_0x54aaac['shift']());}};_0x37a771(++_0x162860);}(_0x2fca,0x172));var _0xa2fc=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2fca[_0xfae23b];return _0x200640;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2fc('0x0'));var zipdir=require(_0xa2fc('0x1'));var jsonpatch=require(_0xa2fc('0x2'));var rp=require(_0xa2fc('0x3'));var moment=require(_0xa2fc('0x4'));var BPromise=require(_0xa2fc('0x5'));var Mustache=require(_0xa2fc('0x6'));var util=require(_0xa2fc('0x7'));var path=require('path');var sox=require(_0xa2fc('0x8'));var csv=require(_0xa2fc('0x9'));var ejs=require(_0xa2fc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa2fc('0xb'));var squel=require(_0xa2fc('0xc'));var crypto=require('crypto');var jsforce=require(_0xa2fc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa2fc('0x9'));var querystring=require(_0xa2fc('0xe'));var Papa=require(_0xa2fc('0xf'));var Redis=require(_0xa2fc('0x10'));var authService=require(_0xa2fc('0x11'));var qs=require(_0xa2fc('0x12'));var as=require(_0xa2fc('0x13'));var hardwareService=require(_0xa2fc('0x14'));var logger=require('../../config/logger')(_0xa2fc('0x15'));var utils=require(_0xa2fc('0x16'));var config=require(_0xa2fc('0x17'));var licenseUtil=require(_0xa2fc('0x18'));var db=require(_0xa2fc('0x19'))['db'];function respondWithStatusCode(_0x54b816,_0x55574c){_0x55574c=_0x55574c||0xcc;return function(_0x948707){if(_0x948707){return _0x54b816[_0xa2fc('0x1a')](_0x55574c);}return _0x54b816['status'](_0x55574c)[_0xa2fc('0x1b')]();};}function respondWithResult(_0x2b1d31,_0x160c4b){_0x160c4b=_0x160c4b||0xc8;return function(_0x260b4e){if(_0x260b4e){return _0x2b1d31[_0xa2fc('0x1c')](_0x160c4b)[_0xa2fc('0x1d')](_0x260b4e);}};}function respondWithFilteredResult(_0x5d745a,_0xf25d80){return function(_0x2c89d5){if(_0x2c89d5){var _0x18dbb2=typeof _0xf25d80[_0xa2fc('0x1e')]===_0xa2fc('0x1f')&&typeof _0xf25d80[_0xa2fc('0x20')]===_0xa2fc('0x1f');var _0xd02cde=_0x2c89d5[_0xa2fc('0x21')];var _0x3ab324=_0x18dbb2?0x0:_0xf25d80['offset'];var _0x2bc966=_0x18dbb2?_0x2c89d5[_0xa2fc('0x21')]:_0xf25d80['offset']+_0xf25d80[_0xa2fc('0x20')];var _0x17113e;if(_0x2bc966>=_0xd02cde){_0x2bc966=_0xd02cde;_0x17113e=0xc8;}else{_0x17113e=0xce;}_0x5d745a[_0xa2fc('0x1c')](_0x17113e);return _0x5d745a[_0xa2fc('0x22')](_0xa2fc('0x23'),_0x3ab324+'-'+_0x2bc966+'/'+_0xd02cde)['json'](_0x2c89d5);}return null;};}function patchUpdates(_0x40cdfe){return function(_0x67ed63){try{jsonpatch[_0xa2fc('0x24')](_0x67ed63,_0x40cdfe,!![]);}catch(_0x2ddc72){return BPromise[_0xa2fc('0x25')](_0x2ddc72);}return _0x67ed63[_0xa2fc('0x26')]();};}function saveUpdates(_0xf55932,_0x4c1df1){return function(_0x37dfc7){if(_0x37dfc7){return _0x37dfc7[_0xa2fc('0x27')](_0xf55932)[_0xa2fc('0x28')](function(_0x4223c0){return _0x4223c0;});}return null;};}function removeEntity(_0x736f69,_0x575e48){return function(_0x56ef1a){if(_0x56ef1a){return _0x56ef1a[_0xa2fc('0x29')]()[_0xa2fc('0x28')](function(){var _0x25402c=_0x56ef1a[_0xa2fc('0x2a')]({'plain':!![]});var _0x5cf771=_0xa2fc('0x2b');return db['UserProfileResource'][_0xa2fc('0x29')]({'where':{'type':_0x5cf771,'resourceId':_0x25402c['id']}})[_0xa2fc('0x28')](function(){return _0x56ef1a;});})[_0xa2fc('0x28')](function(){_0x736f69[_0xa2fc('0x1c')](0xcc)[_0xa2fc('0x1b')]();});}};}function handleEntityNotFound(_0x53c24b,_0x4303cd){return function(_0x15c8d8){if(!_0x15c8d8){_0x53c24b[_0xa2fc('0x1a')](0x194);}return _0x15c8d8;};}function handleError(_0x3f5c22,_0x31cb8c){_0x31cb8c=_0x31cb8c||0x1f4;return function(_0x231c8e){logger[_0xa2fc('0x2c')](_0x231c8e['stack']);if(_0x231c8e[_0xa2fc('0x2d')]){delete _0x231c8e[_0xa2fc('0x2d')];}_0x3f5c22['status'](_0x31cb8c)[_0xa2fc('0x2e')](_0x231c8e);};}exports[_0xa2fc('0x2f')]=function(_0x343194,_0x3031f7){var _0x1d3b77={},_0x34c060={},_0x16c3f4={'count':0x0,'rows':[]};var _0xaf2bed=_[_0xa2fc('0x30')](db['Variable'][_0xa2fc('0x31')],function(_0x44d8ff){return{'name':_0x44d8ff[_0xa2fc('0x32')],'type':_0x44d8ff[_0xa2fc('0x33')][_0xa2fc('0x34')]};});_0x34c060[_0xa2fc('0x35')]=_['map'](_0xaf2bed,_0xa2fc('0x2d'));_0x34c060[_0xa2fc('0x36')]=_[_0xa2fc('0x37')](_0x343194[_0xa2fc('0x36')]);_0x34c060[_0xa2fc('0x38')]=_[_0xa2fc('0x39')](_0x34c060[_0xa2fc('0x35')],_0x34c060[_0xa2fc('0x36')]);_0x1d3b77['attributes']=_[_0xa2fc('0x39')](_0x34c060[_0xa2fc('0x35')],qs[_0xa2fc('0x3a')](_0x343194[_0xa2fc('0x36')][_0xa2fc('0x3a')]));_0x1d3b77['attributes']=_0x1d3b77[_0xa2fc('0x3b')][_0xa2fc('0x3c')]?_0x1d3b77[_0xa2fc('0x3b')]:_0x34c060['model'];if(!_0x343194[_0xa2fc('0x36')][_0xa2fc('0x3d')](_0xa2fc('0x3e'))){_0x1d3b77['limit']=qs[_0xa2fc('0x20')](_0x343194['query'][_0xa2fc('0x20')]);_0x1d3b77[_0xa2fc('0x1e')]=qs[_0xa2fc('0x1e')](_0x343194[_0xa2fc('0x36')][_0xa2fc('0x1e')]);}_0x1d3b77[_0xa2fc('0x3f')]=qs[_0xa2fc('0x40')](_0x343194[_0xa2fc('0x36')]['sort']);_0x1d3b77[_0xa2fc('0x41')]=qs[_0xa2fc('0x38')](_[_0xa2fc('0x42')](_0x343194['query'],_0x34c060['filters']),_0xaf2bed);if(_0x343194[_0xa2fc('0x36')][_0xa2fc('0x43')]){_0x1d3b77[_0xa2fc('0x41')]=_[_0xa2fc('0x44')](_0x1d3b77[_0xa2fc('0x41')],{'$or':_[_0xa2fc('0x30')](_0xaf2bed,function(_0x2c8150){if(_0x2c8150[_0xa2fc('0x33')]!=='VIRTUAL'){var _0x192e8d={};_0x192e8d[_0x2c8150[_0xa2fc('0x2d')]]={'$like':'%'+_0x343194[_0xa2fc('0x36')][_0xa2fc('0x43')]+'%'};return _0x192e8d;}})});}_0x1d3b77=_[_0xa2fc('0x44')]({},_0x1d3b77,_0x343194[_0xa2fc('0x45')]);var _0x444497={'where':_0x1d3b77[_0xa2fc('0x41')]};return db[_0xa2fc('0x46')][_0xa2fc('0x21')](_0x444497)[_0xa2fc('0x28')](function(_0x175891){_0x16c3f4['count']=_0x175891;if(_0x343194[_0xa2fc('0x36')][_0xa2fc('0x47')]){_0x1d3b77['include']=[{'all':!![]}];}return db[_0xa2fc('0x46')][_0xa2fc('0x48')](_0x1d3b77);})[_0xa2fc('0x28')](function(_0x14172e){_0x16c3f4['rows']=_0x14172e;return _0x16c3f4;})[_0xa2fc('0x28')](respondWithFilteredResult(_0x3031f7,_0x1d3b77))[_0xa2fc('0x49')](handleError(_0x3031f7,null));};exports[_0xa2fc('0x4a')]=function(_0x2e0b7b,_0x1677e9){var _0x1ab19a={'raw':!![],'where':{'id':_0x2e0b7b[_0xa2fc('0x4b')]['id']}},_0x2e2d62={};_0x2e2d62['model']=_[_0xa2fc('0x37')](db['Variable'][_0xa2fc('0x31')]);_0x2e2d62[_0xa2fc('0x36')]=_[_0xa2fc('0x37')](_0x2e0b7b[_0xa2fc('0x36')]);_0x2e2d62[_0xa2fc('0x38')]=_[_0xa2fc('0x39')](_0x2e2d62['model'],_0x2e2d62[_0xa2fc('0x36')]);_0x1ab19a['attributes']=_[_0xa2fc('0x39')](_0x2e2d62[_0xa2fc('0x35')],qs['fields'](_0x2e0b7b['query']['fields']));_0x1ab19a['attributes']=_0x1ab19a[_0xa2fc('0x3b')]['length']?_0x1ab19a[_0xa2fc('0x3b')]:_0x2e2d62[_0xa2fc('0x35')];if(_0x2e0b7b[_0xa2fc('0x36')][_0xa2fc('0x47')]){_0x1ab19a[_0xa2fc('0x4c')]=[{'all':!![]}];}_0x1ab19a=_[_0xa2fc('0x44')]({},_0x1ab19a,_0x2e0b7b['options']);return db[_0xa2fc('0x46')][_0xa2fc('0x4d')](_0x1ab19a)['then'](handleEntityNotFound(_0x1677e9,null))[_0xa2fc('0x28')](respondWithResult(_0x1677e9,null))[_0xa2fc('0x49')](handleError(_0x1677e9,null));};exports[_0xa2fc('0x4e')]=function(_0x19a18c,_0x39f458){return db['Variable']['create'](_0x19a18c['body'],{})[_0xa2fc('0x28')](function(_0x23dd7c){var _0x18bb5=_0x19a18c['user'][_0xa2fc('0x2a')]({'plain':!![]});if(!_0x18bb5)throw new Error(_0xa2fc('0x4f'));if(_0x18bb5[_0xa2fc('0x50')]===_0xa2fc('0x51')){var _0x119ff6=_0x23dd7c[_0xa2fc('0x2a')]({'plain':!![]});var _0x3f8f33=_0xa2fc('0x2b');return db[_0xa2fc('0x52')][_0xa2fc('0x4d')]({'where':{'name':_0x3f8f33,'userProfileId':_0x18bb5[_0xa2fc('0x53')]},'raw':!![]})[_0xa2fc('0x28')](function(_0x555d2f){if(_0x555d2f&&_0x555d2f[_0xa2fc('0x54')]===0x0){return db[_0xa2fc('0x55')][_0xa2fc('0x4e')]({'name':_0x119ff6[_0xa2fc('0x2d')],'resourceId':_0x119ff6['id'],'type':_0x555d2f['name'],'sectionId':_0x555d2f['id']},{})[_0xa2fc('0x28')](function(){return _0x23dd7c;});}else{return _0x23dd7c;}})[_0xa2fc('0x49')](function(_0x8c22df){logger[_0xa2fc('0x2c')](_0xa2fc('0x56'),_0x8c22df);throw _0x8c22df;});}return _0x23dd7c;})[_0xa2fc('0x28')](respondWithResult(_0x39f458,0xc9))['catch'](handleError(_0x39f458,null));};exports['update']=function(_0x420295,_0xc6fb45){if(_0x420295[_0xa2fc('0x57')]['id']){delete _0x420295[_0xa2fc('0x57')]['id'];}return db[_0xa2fc('0x46')][_0xa2fc('0x4d')]({'where':{'id':_0x420295[_0xa2fc('0x4b')]['id']}})['then'](handleEntityNotFound(_0xc6fb45,null))[_0xa2fc('0x28')](saveUpdates(_0x420295[_0xa2fc('0x57')],null))[_0xa2fc('0x28')](respondWithResult(_0xc6fb45,null))['catch'](handleError(_0xc6fb45,null));};exports['destroy']=function(_0xc37abe,_0x3ce62e){return db[_0xa2fc('0x46')]['find']({'where':{'id':_0xc37abe[_0xa2fc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3ce62e,null))[_0xa2fc('0x28')](removeEntity(_0x3ce62e,null))[_0xa2fc('0x49')](handleError(_0x3ce62e,null));};
\ No newline at end of file
index f36c6ad..8e78e27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x005f=['moment','request-promise','path','../../config/environment','./variable.attributes','exports','Variable','tools_variables','lodash','util','../../config/logger','api'];(function(_0x5cbae8,_0x1d935a){var _0xab26fd=function(_0x43b046){while(--_0x43b046){_0x5cbae8['push'](_0x5cbae8['shift']());}};_0xab26fd(++_0x1d935a);}(_0x005f,0xe0));var _0xf005=function(_0x323406,_0x3561d7){_0x323406=_0x323406-0x0;var _0x2cf53c=_0x005f[_0x323406];return _0x2cf53c;};'use strict';var _=require(_0xf005('0x0'));var util=require(_0xf005('0x1'));var logger=require(_0xf005('0x2'))(_0xf005('0x3'));var moment=require(_0xf005('0x4'));var BPromise=require('bluebird');var rp=require(_0xf005('0x5'));var fs=require('fs');var path=require(_0xf005('0x6'));var rimraf=require('rimraf');var config=require(_0xf005('0x7'));var attributes=require(_0xf005('0x8'));module[_0xf005('0x9')]=function(_0x3ddb76,_0xe6db33){return _0x3ddb76['define'](_0xf005('0xa'),attributes,{'tableName':_0xf005('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xafc7=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./variable.attributes','exports','Variable','tools_variables'];(function(_0x28fc76,_0x942c5b){var _0x2fea09=function(_0x48e91d){while(--_0x48e91d){_0x28fc76['push'](_0x28fc76['shift']());}};_0x2fea09(++_0x942c5b);}(_0xafc7,0x1c2));var _0x7afc=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xafc7[_0x15bc81];return _0x59440e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7afc('0x0'))(_0x7afc('0x1'));var moment=require(_0x7afc('0x2'));var BPromise=require(_0x7afc('0x3'));var rp=require(_0x7afc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7afc('0x5'));var attributes=require(_0x7afc('0x6'));module[_0x7afc('0x7')]=function(_0x5a28d3,_0x48081b){return _0x5a28d3['define'](_0x7afc('0x8'),attributes,{'tableName':_0x7afc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ec00e55..0afd4ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x1d99d9,_0x17ba33){var _0x5afbe7=function(_0x26dcf8){while(--_0x26dcf8){_0x1d99d9['push'](_0x1d99d9['shift']());}};_0x5afbe7(++_0x17ba33);}(_0x7217,0x19e));var _0x7721=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x7217[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});};
\ No newline at end of file
+var _0x4b84=['catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','Variable,\x20%s,\x20%s','message','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model'];(function(_0x52fb3c,_0x2cf66e){var _0x5c9223=function(_0x56511c){while(--_0x56511c){_0x52fb3c['push'](_0x52fb3c['shift']());}};_0x5c9223(++_0x2cf66e);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x4b84[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('Variable,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('Variable,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});}exports[_0x44b8('0x10')]=function(_0x55e258){var _0x36743e=this;return new Promise(function(_0xe3de8f,_0x5103f5){return db[_0x44b8('0x11')][_0x44b8('0x12')]({'raw':_0x55e258['options']?_0x55e258[_0x44b8('0x13')][_0x44b8('0x14')]===undefined?!![]:![]:!![],'where':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x15')]||null:null,'attributes':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x16')]||null:null,'include':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x55e258['options'][_0x44b8('0x17')],function(_0x3a8aa4){return{'model':db[_0x3a8aa4[_0x44b8('0x19')]],'as':_0x3a8aa4['as'],'attributes':_0x3a8aa4[_0x44b8('0x16')],'include':_0x3a8aa4[_0x44b8('0x17')]?_['map'](_0x3a8aa4[_0x44b8('0x17')],function(_0x54677c){return{'model':db[_0x54677c[_0x44b8('0x19')]],'as':_0x54677c['as'],'attributes':_0x54677c[_0x44b8('0x16')],'include':_0x54677c[_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x54677c[_0x44b8('0x17')],function(_0x59acbc){return{'model':db[_0x59acbc[_0x44b8('0x19')]],'as':_0x59acbc['as'],'attributes':_0x59acbc['attributes']};}):[]};}):[]};}):[]:[]})[_0x44b8('0x7')](function(_0x350482){logger['info'](_0x44b8('0x10'),_0x55e258);logger[_0x44b8('0xa')](_0x44b8('0x10'),_0x55e258,JSON['stringify'](_0x350482));_0xe3de8f(_0x350482);})[_0x44b8('0x1a')](function(_0x242342){logger['error'](_0x44b8('0x10'),_0x242342['message'],_0x55e258);_0x5103f5(_0x36743e[_0x44b8('0xd')](0x1f4,_0x242342['message']));});});};
\ No newline at end of file
index d41abb6..d305e6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacae=['exports','express','get','isAuthenticated','canUpdate','fetch','reset','pull','/restart','restart'];(function(_0x3ed86b,_0x1c8052){var _0x45c942=function(_0x3f4569){while(--_0x3f4569){_0x3ed86b['push'](_0x3ed86b['shift']());}};_0x45c942(++_0x1c8052);}(_0xacae,0x191));var _0xeaca=function(_0x2637a9,_0xcd459c){_0x2637a9=_0x2637a9-0x0;var _0x300c35=_0xacae[_0x2637a9];return _0x300c35;};'use strict';var express=require(_0xeaca('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0xeaca('0x1')]('/',controller['index']);router[_0xeaca('0x1')]('/fetch',auth[_0xeaca('0x2')](),auth[_0xeaca('0x3')](),controller[_0xeaca('0x4')]);router[_0xeaca('0x1')]('/reset',auth[_0xeaca('0x2')](),auth[_0xeaca('0x3')](),controller[_0xeaca('0x5')]);router[_0xeaca('0x1')]('/pull',auth[_0xeaca('0x2')](),auth[_0xeaca('0x3')](),controller[_0xeaca('0x6')]);router['get'](_0xeaca('0x7'),auth['isAuthenticated'](),controller[_0xeaca('0x8')]);router['get']('/migrations',controller['migrations']);module[_0xeaca('0x9')]=router;
\ No newline at end of file
+var _0xe86a=['restart','/migrations','migrations','exports','express','Router','./version.controller','index','/fetch','canUpdate','fetch','get','/pull','isAuthenticated','pull','/restart'];(function(_0xa2c2e2,_0x535d90){var _0x3d7867=function(_0x48be46){while(--_0x48be46){_0xa2c2e2['push'](_0xa2c2e2['shift']());}};_0x3d7867(++_0x535d90);}(_0xe86a,0xf4));var _0xae86=function(_0x3c32f5,_0x543cbf){_0x3c32f5=_0x3c32f5-0x0;var _0x2c75d2=_0xe86a[_0x3c32f5];return _0x2c75d2;};'use strict';var express=require(_0xae86('0x0'));var router=express[_0xae86('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xae86('0x2'));router['get']('/',controller[_0xae86('0x3')]);router['get'](_0xae86('0x4'),auth['isAuthenticated'](),auth[_0xae86('0x5')](),controller[_0xae86('0x6')]);router[_0xae86('0x7')]('/reset',auth['isAuthenticated'](),auth[_0xae86('0x5')](),controller['reset']);router[_0xae86('0x7')](_0xae86('0x8'),auth[_0xae86('0x9')](),auth['canUpdate'](),controller[_0xae86('0xa')]);router[_0xae86('0x7')](_0xae86('0xb'),auth['isAuthenticated'](),controller[_0xae86('0xc')]);router[_0xae86('0x7')](_0xae86('0xd'),controller[_0xae86('0xe')]);module[_0xae86('0xf')]=router;
\ No newline at end of file
index b63f16d..beb11c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacb9=['length','replace','.js','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/logger','update','index','query','latest','tags','exports','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server'];(function(_0x255640,_0x212ebc){var _0x23e3b4=function(_0x31cc65){while(--_0x31cc65){_0x255640['push'](_0x255640['shift']());}};_0x23e3b4(++_0x212ebc);}(_0xacb9,0x79));var _0x9acb=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xacb9[_0x20a558];return _0x53d3f7;};'use strict';var Umzug=require(_0x9acb('0x0'));var path=require(_0x9acb('0x1'));var fs=require('fs');var _=require(_0x9acb('0x2'));var pkginfo=require(_0x9acb('0x3'))(module,_0x9acb('0x4'));var compareVersions=require(_0x9acb('0x5'));var exec=require(_0x9acb('0x6'))[_0x9acb('0x7')];var db=require('../../mysqldb')['db'];var config=require(_0x9acb('0x8'));var pm2=require('../../config/pm2');var logger=require(_0x9acb('0x9'))(_0x9acb('0xa'));var git=require('simple-git')(config['root']);exports[_0x9acb('0xb')]=function(_0x1f99cb,_0x2feccf){var _0x4cff76={'current':module['exports'][_0x9acb('0x4')],'phonebar':0x2};if(_0x1f99cb[_0x9acb('0xc')]&&_0x1f99cb[_0x9acb('0xc')][_0x9acb('0xd')]){return git['fetch']()[_0x9acb('0xe')](function(_0x2bdc9d,_0xdc8903){_0x4cff76[_0x9acb('0xd')]=(_0x2bdc9d?module[_0x9acb('0xf')]['version']:_0xdc8903[_0x9acb('0xd')])||_0x9acb('0x10');return _0x2feccf[_0x9acb('0x11')](0xc8)[_0x9acb('0x12')](_0x4cff76);});}else{return _0x2feccf['status'](0xc8)[_0x9acb('0x12')](_0x4cff76);}};exports['fetch']=function(_0x31e020,_0x2b8fda){return git['fetch']([_0x9acb('0x13'),_0x9acb('0x14')],function(_0x46cdec){if(_0x46cdec){logger[_0x9acb('0x15')](_0x46cdec);return _0x2b8fda[_0x9acb('0x11')](0x1f4)[_0x9acb('0x12')](_0x46cdec);}logger[_0x9acb('0x16')](_0x9acb('0x17'));return _0x2b8fda['status'](0xc8)[_0x9acb('0x12')]({'output':_0x9acb('0x18')});});};exports[_0x9acb('0x19')]=function(_0x59b620,_0xec0e14){return git[_0x9acb('0x19')]([_0x9acb('0x1a'),'FETCH_HEAD'],function(_0x269e5a){if(_0x269e5a){logger['error'](_0x269e5a);return _0xec0e14[_0x9acb('0x11')](0x1f4)[_0x9acb('0x12')](_0x269e5a);}logger['info'](_0x9acb('0x1b'));return _0xec0e14['status'](0xc8)[_0x9acb('0x12')]({'output':_0x9acb('0x1c')});});};exports[_0x9acb('0x1d')]=function(_0x4c69ad,_0x1f3e39){exec(_0x9acb('0x1e'),function(_0x2e82d5,_0x290c46,_0x3e2768){logger['info'](_0x290c46);logger['info'](_0x3e2768);if(_0x2e82d5){logger[_0x9acb('0x15')](_0x2e82d5);return _0x1f3e39['status'](0x1f4)[_0x9acb('0x12')](_0x2e82d5);}return _0x1f3e39[_0x9acb('0x11')](0xc8)[_0x9acb('0x12')]({'output':_0x290c46});});};exports[_0x9acb('0x1f')]=function(_0x2682e7,_0x36578a){return pm2['restart']('motion2')[_0x9acb('0x20')](function(_0x10292b){logger[_0x9acb('0x16')](_0x9acb('0x21'),_0x10292b);return _0x36578a[_0x9acb('0x11')](0xc8)['json']({'output':_0x9acb('0x22')});})[_0x9acb('0x23')](function(_0x2cfb40){logger['error'](_0x2cfb40);return _0x36578a[_0x9acb('0x11')](0x1f4)[_0x9acb('0x12')](_0x2cfb40);});};exports[_0x9acb('0x24')]=function(_0x40fc85,_0x399c6d){var _0x3453e4=fs[_0x9acb('0x25')](path[_0x9acb('0x26')](config[_0x9acb('0x27')],_0x9acb('0x28'),_0x9acb('0x24')));var _0x253e32=[];for(var _0xa435c5=0x0;_0xa435c5<_0x3453e4[_0x9acb('0x29')];_0xa435c5++){var _0x51d421=_0x3453e4[_0xa435c5][_0x9acb('0x2a')](_0x9acb('0x2b'),'');if(compareVersions(module['exports'][_0x9acb('0x4')],_0x51d421)===-0x1){_0x253e32[_0x9acb('0x2c')](_0x51d421);}}if(_0x253e32[_0x9acb('0x29')]){var _0x33839a=_0x253e32['sort'](compareVersions);var _0x363acd=new Umzug({'storage':_0x9acb('0x2d'),'storageOptions':{'model':db[_0x9acb('0x2e')],'modelName':_0x9acb('0x2e'),'columnName':_0x9acb('0x4')},'migrations':{'params':[db['sequelize'][_0x9acb('0x2f')](),db['sequelize'][_0x9acb('0x30')],function(){throw new Error(_0x9acb('0x31'));}],'path':path[_0x9acb('0x26')](config[_0x9acb('0x27')],_0x9acb('0x28'),_0x9acb('0x24')),'pattern':/\.js$/}});_0x363acd['up']({'migrations':_[_0x9acb('0x32')](_0x33839a,function(_0x1a672d){return _0x1a672d+'.js';})})[_0x9acb('0x20')](function(){return _0x399c6d[_0x9acb('0x11')](0xc8)[_0x9acb('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x9acb('0xf')][_0x9acb('0x4')]+_0x9acb('0x33')+_['last'](_0x33839a),'migrations':_[_0x9acb('0x26')](_0x33839a)});})['catch'](function(_0x2c2ee2){if(_0x2c2ee2 instanceof db[_0x9acb('0x2d')][_0x9acb('0x34')]){return _0x399c6d['status'](0xc8)[_0x9acb('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x399c6d[_0x9acb('0x11')](0x1f4)[_0x9acb('0x12')](_0x2c2ee2);}});}else{return _0x399c6d[_0x9acb('0x11')](0xc8)[_0x9acb('0x12')]({'output':_0x9acb('0x35')});}};
\ No newline at end of file
+var _0x283f=['--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','error','restart','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','join','server','replace','.js','push','length','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','path','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','fetch','tags','version','latest','status','json','origin','master','git\x20fetch','reset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x283f,0xf0));var _0xf283=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x283f[_0x3dd15e];return _0x231fd0;};'use strict';var Umzug=require('umzug');var path=require(_0xf283('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xf283('0x1'))(module,'version');var compareVersions=require(_0xf283('0x2'));var exec=require(_0xf283('0x3'))[_0xf283('0x4')];var db=require(_0xf283('0x5'))['db'];var config=require(_0xf283('0x6'));var pm2=require(_0xf283('0x7'));var logger=require(_0xf283('0x8'))(_0xf283('0x9'));var git=require(_0xf283('0xa'))(config[_0xf283('0xb')]);exports[_0xf283('0xc')]=function(_0x1060f8,_0x10302e){var _0x203a25={'current':module[_0xf283('0xd')]['version'],'phonebar':0x2};if(_0x1060f8['query']&&_0x1060f8[_0xf283('0xe')]['latest']){return git[_0xf283('0xf')]()[_0xf283('0x10')](function(_0x2380e4,_0x217e0b){_0x203a25['latest']=(_0x2380e4?module['exports'][_0xf283('0x11')]:_0x217e0b[_0xf283('0x12')])||'2.0.0';return _0x10302e[_0xf283('0x13')](0xc8)['json'](_0x203a25);});}else{return _0x10302e[_0xf283('0x13')](0xc8)[_0xf283('0x14')](_0x203a25);}};exports[_0xf283('0xf')]=function(_0x443f6e,_0x6726b1){return git['fetch']([_0xf283('0x15'),_0xf283('0x16')],function(_0x320980){if(_0x320980){logger['error'](_0x320980);return _0x6726b1[_0xf283('0x13')](0x1f4)[_0xf283('0x14')](_0x320980);}logger['info'](_0xf283('0x17'));return _0x6726b1[_0xf283('0x13')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xf283('0x18')]=function(_0x15ff0c,_0x598c92){return git['reset']([_0xf283('0x19'),_0xf283('0x1a')],function(_0x1c09f2){if(_0x1c09f2){logger['error'](_0x1c09f2);return _0x598c92[_0xf283('0x13')](0x1f4)[_0xf283('0x14')](_0x1c09f2);}logger[_0xf283('0x1b')](_0xf283('0x1c'));return _0x598c92['status'](0xc8)[_0xf283('0x14')]({'output':_0xf283('0x1d')});});};exports[_0xf283('0x1e')]=function(_0x329fab,_0x5d29a0){exec(_0xf283('0x1f'),function(_0x4abd49,_0x178eec,_0x30ed20){logger[_0xf283('0x1b')](_0x178eec);logger[_0xf283('0x1b')](_0x30ed20);if(_0x4abd49){logger[_0xf283('0x20')](_0x4abd49);return _0x5d29a0[_0xf283('0x13')](0x1f4)[_0xf283('0x14')](_0x4abd49);}return _0x5d29a0[_0xf283('0x13')](0xc8)['json']({'output':_0x178eec});});};exports['restart']=function(_0x53b255,_0xe30139){return pm2[_0xf283('0x21')]('motion2')['then'](function(_0x53eb1c){logger[_0xf283('0x1b')]('pm2\x20restart\x20motion\x20%s',_0x53eb1c);return _0xe30139[_0xf283('0x13')](0xc8)[_0xf283('0x14')]({'output':_0xf283('0x22')});})['catch'](function(_0xb26eb8){logger[_0xf283('0x20')](_0xb26eb8);return _0xe30139['status'](0x1f4)[_0xf283('0x14')](_0xb26eb8);});};exports[_0xf283('0x23')]=function(_0x24e4c9,_0x4d369a){var _0x534acc=fs['readdirSync'](path[_0xf283('0x24')](config['root'],_0xf283('0x25'),_0xf283('0x23')));var _0x57699b=[];for(var _0x20dcac=0x0;_0x20dcac<_0x534acc['length'];_0x20dcac++){var _0x2dfa95=_0x534acc[_0x20dcac][_0xf283('0x26')](_0xf283('0x27'),'');if(compareVersions(module[_0xf283('0xd')]['version'],_0x2dfa95)===-0x1){_0x57699b[_0xf283('0x28')](_0x2dfa95);}}if(_0x57699b[_0xf283('0x29')]){var _0x1be2da=_0x57699b[_0xf283('0x2a')](compareVersions);var _0x57669a=new Umzug({'storage':_0xf283('0x2b'),'storageOptions':{'model':db[_0xf283('0x2c')],'modelName':_0xf283('0x2c'),'columnName':_0xf283('0x11')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0xf283('0x2b')][_0xf283('0x2d')],function(){throw new Error(_0xf283('0x2e'));}],'path':path[_0xf283('0x24')](config['root'],_0xf283('0x25'),_0xf283('0x23')),'pattern':/\.js$/}});_0x57669a['up']({'migrations':_[_0xf283('0x2f')](_0x1be2da,function(_0x4be2f4){return _0x4be2f4+'.js';})})[_0xf283('0x30')](function(){return _0x4d369a['status'](0xc8)[_0xf283('0x14')]({'output':_0xf283('0x31')+module[_0xf283('0xd')][_0xf283('0x11')]+_0xf283('0x32')+_[_0xf283('0x33')](_0x1be2da),'migrations':_['join'](_0x1be2da)});})['catch'](function(_0x4e8506){if(_0x4e8506 instanceof db[_0xf283('0x2b')]['UniqueConstraintError']){return _0x4d369a['status'](0xc8)['json']({'output':_0xf283('0x34')});}else{return _0x4d369a['status'](0x1f4)['json'](_0x4e8506);}});}else{return _0x4d369a[_0xf283('0x13')](0xc8)[_0xf283('0x14')]({'output':'Database\x20already\x20up-to-date'});}};
\ No newline at end of file
index fb69d7d..c22e128 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe429=['get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x43841f,_0x4df0c4){var _0x417f61=function(_0x4a354e){while(--_0x4a354e){_0x43841f['push'](_0x43841f['shift']());}};_0x417f61(++_0x4df0c4);}(_0xe429,0x13f));var _0x9e42=function(_0x53f174,_0x52d33c){_0x53f174=_0x53f174-0x0;var _0x18dd8c=_0xe429[_0x53f174];return _0x18dd8c;};'use strict';var multer=require(_0x9e42('0x0'));var util=require(_0x9e42('0x1'));var path=require(_0x9e42('0x2'));var timeout=require(_0x9e42('0x3'));var express=require(_0x9e42('0x4'));var router=express[_0x9e42('0x5')]();var fs_extra=require(_0x9e42('0x6'));var auth=require(_0x9e42('0x7'));var interaction=require(_0x9e42('0x8'));var config=require(_0x9e42('0x9'));var controller=require(_0x9e42('0xa'));router[_0x9e42('0xb')]('/',auth[_0x9e42('0xc')](),controller[_0x9e42('0xd')]);router[_0x9e42('0xb')]('/describe',auth[_0x9e42('0xc')](),controller['describe']);router[_0x9e42('0xb')]('/:id',auth[_0x9e42('0xc')](),controller[_0x9e42('0xe')]);router[_0x9e42('0xf')]('/',auth['isAuthenticated'](),controller[_0x9e42('0x10')]);router[_0x9e42('0x11')](_0x9e42('0x12'),auth['isAuthenticated'](),controller[_0x9e42('0x13')]);router['delete'](_0x9e42('0x12'),auth[_0x9e42('0xc')](),controller[_0x9e42('0x14')]);module[_0x9e42('0x15')]=router;
\ No newline at end of file
+var _0x89ab=['post','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/:id'];(function(_0x34a6d1,_0x5db353){var _0x42d4d9=function(_0xf3b6ac){while(--_0xf3b6ac){_0x34a6d1['push'](_0x34a6d1['shift']());}};_0x42d4d9(++_0x5db353);}(_0x89ab,0x17e));var _0xb89a=function(_0x3319b0,_0x554dab){_0x3319b0=_0x3319b0-0x0;var _0x130457=_0x89ab[_0x3319b0];return _0x130457;};'use strict';var multer=require(_0xb89a('0x0'));var util=require(_0xb89a('0x1'));var path=require(_0xb89a('0x2'));var timeout=require(_0xb89a('0x3'));var express=require(_0xb89a('0x4'));var router=express[_0xb89a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb89a('0x6'));var interaction=require(_0xb89a('0x7'));var config=require(_0xb89a('0x8'));var controller=require(_0xb89a('0x9'));router[_0xb89a('0xa')]('/',auth[_0xb89a('0xb')](),controller[_0xb89a('0xc')]);router[_0xb89a('0xa')]('/describe',auth[_0xb89a('0xb')](),controller['describe']);router[_0xb89a('0xa')](_0xb89a('0xd'),auth[_0xb89a('0xb')](),controller['show']);router[_0xb89a('0xe')]('/',auth[_0xb89a('0xb')](),controller['create']);router[_0xb89a('0xf')]('/:id',auth[_0xb89a('0xb')](),controller['update']);router[_0xb89a('0x10')](_0xb89a('0xd'),auth[_0xb89a('0xb')](),controller['destroy']);module[_0xb89a('0x11')]=router;
\ No newline at end of file
index 1c9038c..1dd4e87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2cf=['INTEGER','BOOLEAN','exports','STRING','DATE'];(function(_0x18dbeb,_0x6868a6){var _0x7151b0=function(_0x583965){while(--_0x583965){_0x18dbeb['push'](_0x18dbeb['shift']());}};_0x7151b0(++_0x6868a6);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x32e2f3,_0x5c9fe7){_0x32e2f3=_0x32e2f3-0x0;var _0xcc7735=_0xe2cf[_0x32e2f3];return _0xcc7735;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfe2c('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfe2c('0x1')]},'queue':{'type':Sequelize[_0xfe2c('0x1')]},'interface':{'type':Sequelize[_0xfe2c('0x1')]},'membername':{'type':Sequelize[_0xfe2c('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xfe2c('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xfe2c('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xfe2c('0x3')]},'agentcomplete':{'type':Sequelize[_0xfe2c('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xfe2c('0x3')]},'agentacw':{'type':Sequelize[_0xfe2c('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xfe2c('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfe2c('0x1')]},'channelstate':{'type':Sequelize[_0xfe2c('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xfe2c('0x1')]},'connectedlinename':{'type':Sequelize[_0xfe2c('0x1')]},'language':{'type':Sequelize[_0xfe2c('0x1')]},'accountcode':{'type':Sequelize[_0xfe2c('0x1')]},'context':{'type':Sequelize[_0xfe2c('0x1')]},'exten':{'type':Sequelize[_0xfe2c('0x1')]},'priority':{'type':Sequelize[_0xfe2c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xfe2c('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xfe2c('0x1')]},'destaccountcode':{'type':Sequelize[_0xfe2c('0x1')]},'destcontext':{'type':Sequelize[_0xfe2c('0x1')]},'destexten':{'type':Sequelize[_0xfe2c('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xfe2c('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xfe2c('0x1')]},'transfer':{'type':Sequelize[_0xfe2c('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfe2c('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xfe2c('0x1')]},'transferuniqueid':{'type':Sequelize[_0xfe2c('0x1')]},'agententerreason':{'type':Sequelize[_0xfe2c('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x36ee=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE','INTEGER'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xe36e('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe36e('0x0')]},'calleridname':{'type':Sequelize[_0xe36e('0x0')]},'queue':{'type':Sequelize[_0xe36e('0x0')]},'interface':{'type':Sequelize[_0xe36e('0x0')]},'membername':{'type':Sequelize[_0xe36e('0x0')]},'agentcalledAt':{'type':Sequelize[_0xe36e('0x1')]},'agentconnectAt':{'type':Sequelize[_0xe36e('0x1')]},'agentcompleteAt':{'type':Sequelize[_0xe36e('0x1')]},'agentringnoanswerAt':{'type':Sequelize[_0xe36e('0x1')]},'agentdumpAt':{'type':Sequelize[_0xe36e('0x1')]},'holdtime':{'type':Sequelize[_0xe36e('0x2')]},'agentcomplete':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe36e('0x2')]},'reason':{'type':Sequelize[_0xe36e('0x0')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe36e('0x0')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe36e('0x0')]},'connectedlinenum':{'type':Sequelize[_0xe36e('0x0')]},'connectedlinename':{'type':Sequelize[_0xe36e('0x0')]},'language':{'type':Sequelize[_0xe36e('0x0')]},'accountcode':{'type':Sequelize[_0xe36e('0x0')]},'context':{'type':Sequelize[_0xe36e('0x0')]},'exten':{'type':Sequelize[_0xe36e('0x0')]},'priority':{'type':Sequelize[_0xe36e('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe36e('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe36e('0x0')]},'destcalleridnum':{'type':Sequelize[_0xe36e('0x0')]},'destcalleridname':{'type':Sequelize[_0xe36e('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xe36e('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xe36e('0x0')]},'destexten':{'type':Sequelize[_0xe36e('0x0')]},'destpriority':{'type':Sequelize[_0xe36e('0x0')]},'destuniqueid':{'type':Sequelize[_0xe36e('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe36e('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0xe36e('0x0')]},'transfer':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe36e('0x0')],'comment':_0xe36e('0x4')},'transferexten':{'type':Sequelize[_0xe36e('0x0')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xe36e('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 63a85ff..580a815 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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 7af1285..9730ec9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a93=['exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','api','moment','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a93,0xf6));var _0x35a9=function(_0x2f448f,_0x392ab7){_0x2f448f=_0x2f448f-0x0;var _0x5205f2=_0x5a93[_0x2f448f];return _0x5205f2;};'use strict';var _=require('lodash');var util=require(_0x35a9('0x0'));var logger=require('../../config/logger')(_0x35a9('0x1'));var moment=require(_0x35a9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x35a9('0x3'));var rimraf=require(_0x35a9('0x4'));var config=require(_0x35a9('0x5'));var attributes=require('./voiceAgentReport.attributes');module[_0x35a9('0x6')]=function(_0x27ed9f,_0x2e8a14){return _0x27ed9f[_0x35a9('0x7')](_0x35a9('0x8'),attributes,{'tableName':_0x35a9('0x9'),'paranoid':![],'indexes':[{'fields':[_0x35a9('0xa'),_0x35a9('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d19=['../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x6d19,0x160));var _0x96d1=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0x6d19[_0x2c7dc6];return _0x10002b;};'use strict';var _=require(_0x96d1('0x0'));var util=require(_0x96d1('0x1'));var logger=require(_0x96d1('0x2'))(_0x96d1('0x3'));var moment=require(_0x96d1('0x4'));var BPromise=require(_0x96d1('0x5'));var rp=require(_0x96d1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x96d1('0x7'));var config=require(_0x96d1('0x8'));var attributes=require(_0x96d1('0x9'));module[_0x96d1('0xa')]=function(_0x58854b,_0x32b7d9){return _0x58854b[_0x96d1('0xb')](_0x96d1('0xc'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x96d1('0xd'),_0x96d1('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 3261fe4..c78efb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3171=['../../config/environment','jayson/promise','client','http','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','VoiceAgentReport','create','options','raw','then','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','util','moment','randomstring','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3171,0x70));var _0x1317=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x3171[_0x390733];return _0x33beb9;};'use strict';var _=require('lodash');var util=require(_0x1317('0x0'));var moment=require(_0x1317('0x1'));var BPromise=require('bluebird');var rs=require(_0x1317('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1317('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1317('0x4'));var jayson=require(_0x1317('0x5'));var client=jayson[_0x1317('0x6')][_0x1317('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6c75ef,_0x2d6c8e,_0x2c9b54){return new BPromise(function(_0x23c24d,_0x2fdbca){return client['request'](_0x6c75ef,_0x2c9b54)['then'](function(_0x41777b){logger['info'](_0x1317('0x8'),_0x2d6c8e,_0x1317('0x9'));logger[_0x1317('0xa')](_0x1317('0xb'),_0x2d6c8e,_0x1317('0x9'),JSON[_0x1317('0xc')](_0x41777b));if(_0x41777b[_0x1317('0xd')]){if(_0x41777b[_0x1317('0xd')][_0x1317('0xe')]===0x1f4){logger[_0x1317('0xd')](_0x1317('0x8'),_0x2d6c8e,_0x41777b['error'][_0x1317('0xf')]);return _0x2fdbca(_0x41777b[_0x1317('0xd')][_0x1317('0xf')]);}logger['error'](_0x1317('0x8'),_0x2d6c8e,_0x41777b[_0x1317('0xd')]['message']);return _0x23c24d(_0x41777b['error'][_0x1317('0xf')]);}else{logger[_0x1317('0x10')](_0x1317('0x8'),_0x2d6c8e,_0x1317('0x9'));_0x23c24d(_0x41777b['result'][_0x1317('0xf')]);}})[_0x1317('0x11')](function(_0x32fa75){logger['error'](_0x1317('0x8'),_0x2d6c8e,_0x32fa75);_0x2fdbca(_0x32fa75);});});}exports['CreateVoiceAgentReport']=function(_0x282d83){var _0x24607c=this;return new Promise(function(_0x654a41,_0x2c711a){return db[_0x1317('0x12')][_0x1317('0x13')](_0x282d83['body'],{'raw':_0x282d83[_0x1317('0x14')]?_0x282d83[_0x1317('0x14')][_0x1317('0x15')]===undefined?!![]:![]:!![]})[_0x1317('0x16')](function(_0x556276){logger[_0x1317('0x10')](_0x1317('0x17'),_0x282d83);logger['debug'](_0x1317('0x17'),_0x282d83,JSON['stringify'](_0x556276));_0x654a41(_0x556276);})[_0x1317('0x11')](function(_0x141e35){logger['error'](_0x1317('0x17'),_0x141e35[_0x1317('0xf')],_0x282d83);_0x2c711a(_0x24607c[_0x1317('0xd')](0x1f4,_0x141e35[_0x1317('0xf')]));});});};exports[_0x1317('0x18')]=function(_0x420561){var _0x1b7ba5=this;return new Promise(function(_0x591486,_0x469a8a){return db['VoiceAgentReport'][_0x1317('0x19')](_0x420561['body'],{'raw':_0x420561[_0x1317('0x14')]?_0x420561['options'][_0x1317('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x420561[_0x1317('0x14')]?_0x420561['options'][_0x1317('0x1a')]||null:null,'attributes':_0x420561[_0x1317('0x14')]?_0x420561[_0x1317('0x14')][_0x1317('0x1b')]||null:null,'limit':_0x420561[_0x1317('0x14')]?_0x420561[_0x1317('0x14')][_0x1317('0x1c')]||null:null})[_0x1317('0x16')](function(_0x25569a){logger[_0x1317('0x10')](_0x1317('0x18'),_0x420561);logger[_0x1317('0xa')](_0x1317('0x18'),_0x420561,JSON['stringify'](_0x25569a));_0x591486(_0x25569a);})[_0x1317('0x11')](function(_0x581fae){logger[_0x1317('0xd')](_0x1317('0x18'),_0x581fae[_0x1317('0xf')],_0x420561);_0x469a8a(_0x1b7ba5['error'](0x1f4,_0x581fae[_0x1317('0xf')]));});});};
\ No newline at end of file
+var _0xefe5=['request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','attributes','limit','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','http','then','VoiceAgentReport,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xefe5,0x12b));var _0x5efe=function(_0x5c23de,_0x3d8157){_0x5c23de=_0x5c23de-0x0;var _0x32cbc7=_0xefe5[_0x5c23de];return _0x32cbc7;};'use strict';var _=require(_0x5efe('0x0'));var util=require(_0x5efe('0x1'));var moment=require('moment');var BPromise=require(_0x5efe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5efe('0x3'))['db'];var utils=require(_0x5efe('0x4'));var logger=require('../../config/logger')(_0x5efe('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5efe('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x569594,_0x14528b,_0x5e1179){return new BPromise(function(_0x56a76c,_0x5a462a){return client['request'](_0x569594,_0x5e1179)[_0x5efe('0x7')](function(_0x20b6af){logger['info'](_0x5efe('0x8'),_0x14528b,_0x5efe('0x9'));logger[_0x5efe('0xa')](_0x5efe('0xb'),_0x14528b,_0x5efe('0x9'),JSON[_0x5efe('0xc')](_0x20b6af));if(_0x20b6af[_0x5efe('0xd')]){if(_0x20b6af[_0x5efe('0xd')][_0x5efe('0xe')]===0x1f4){logger['error'](_0x5efe('0x8'),_0x14528b,_0x20b6af['error']['message']);return _0x5a462a(_0x20b6af['error'][_0x5efe('0xf')]);}logger[_0x5efe('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x14528b,_0x20b6af[_0x5efe('0xd')][_0x5efe('0xf')]);return _0x56a76c(_0x20b6af[_0x5efe('0xd')][_0x5efe('0xf')]);}else{logger[_0x5efe('0x10')](_0x5efe('0x8'),_0x14528b,_0x5efe('0x9'));_0x56a76c(_0x20b6af[_0x5efe('0x11')]['message']);}})[_0x5efe('0x12')](function(_0x3f7f76){logger[_0x5efe('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x14528b,_0x3f7f76);_0x5a462a(_0x3f7f76);});});}exports[_0x5efe('0x13')]=function(_0x2014ce){var _0x250834=this;return new Promise(function(_0x3d53bf,_0x558c1f){return db[_0x5efe('0x14')][_0x5efe('0x15')](_0x2014ce[_0x5efe('0x16')],{'raw':_0x2014ce[_0x5efe('0x17')]?_0x2014ce['options'][_0x5efe('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x261728){logger[_0x5efe('0x10')](_0x5efe('0x13'),_0x2014ce);logger['debug'](_0x5efe('0x13'),_0x2014ce,JSON['stringify'](_0x261728));_0x3d53bf(_0x261728);})[_0x5efe('0x12')](function(_0x528cb6){logger[_0x5efe('0xd')]('CreateVoiceAgentReport',_0x528cb6[_0x5efe('0xf')],_0x2014ce);_0x558c1f(_0x250834[_0x5efe('0xd')](0x1f4,_0x528cb6['message']));});});};exports[_0x5efe('0x19')]=function(_0x596ffa){var _0x5d9863=this;return new Promise(function(_0x460860,_0x16d51a){return db[_0x5efe('0x14')]['update'](_0x596ffa[_0x5efe('0x16')],{'raw':_0x596ffa[_0x5efe('0x17')]?_0x596ffa[_0x5efe('0x17')][_0x5efe('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x596ffa[_0x5efe('0x17')]?_0x596ffa[_0x5efe('0x17')]['where']||null:null,'attributes':_0x596ffa[_0x5efe('0x17')]?_0x596ffa[_0x5efe('0x17')][_0x5efe('0x1a')]||null:null,'limit':_0x596ffa[_0x5efe('0x17')]?_0x596ffa[_0x5efe('0x17')][_0x5efe('0x1b')]||null:null})['then'](function(_0x40166e){logger[_0x5efe('0x10')](_0x5efe('0x19'),_0x596ffa);logger['debug'](_0x5efe('0x19'),_0x596ffa,JSON[_0x5efe('0xc')](_0x40166e));_0x460860(_0x40166e);})[_0x5efe('0x12')](function(_0x504740){logger[_0x5efe('0xd')](_0x5efe('0x19'),_0x504740[_0x5efe('0xf')],_0x596ffa);_0x16d51a(_0x5d9863['error'](0x1f4,_0x504740['message']));});});};
\ No newline at end of file
index 2321eb2..72a4a63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b67=['../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x59e9e0,_0x34128f){var _0x32446c=function(_0x17f492){while(--_0x17f492){_0x59e9e0['push'](_0x59e9e0['shift']());}};_0x32446c(++_0x34128f);}(_0x9b67,0xf6));var _0x79b6=function(_0x243e2e,_0xdfc79e){_0x243e2e=_0x243e2e-0x0;var _0x4f0650=_0x9b67[_0x243e2e];return _0x4f0650;};'use strict';var multer=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var path=require(_0x79b6('0x2'));var timeout=require(_0x79b6('0x3'));var express=require(_0x79b6('0x4'));var router=express['Router']();var fs_extra=require(_0x79b6('0x5'));var auth=require(_0x79b6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x79b6('0x7'));router[_0x79b6('0x8')]('/',auth[_0x79b6('0x9')](),controller[_0x79b6('0xa')]);router[_0x79b6('0x8')](_0x79b6('0xb'),auth[_0x79b6('0x9')](),controller['describe']);router[_0x79b6('0x8')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0xd')]);router[_0x79b6('0xe')]('/',auth['isAuthenticated'](),controller[_0x79b6('0xf')]);router[_0x79b6('0x10')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller['update']);router['delete'](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xe015=['../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','index','describe','get','/:id','show','put','update','multer','util','path','Router','../../components/auth/service'];(function(_0x2acc8e,_0x443563){var _0x23db84=function(_0x379a8d){while(--_0x379a8d){_0x2acc8e['push'](_0x2acc8e['shift']());}};_0x23db84(++_0x443563);}(_0xe015,0x13b));var _0x5e01=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe015[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var path=require(_0x5e01('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e01('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5e01('0x4'));var interaction=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var controller=require(_0x5e01('0x7'));router['get']('/',auth[_0x5e01('0x8')](),controller[_0x5e01('0x9')]);router['get']('/describe',auth[_0x5e01('0x8')](),controller[_0x5e01('0xa')]);router[_0x5e01('0xb')](_0x5e01('0xc'),auth[_0x5e01('0x8')](),controller[_0x5e01('0xd')]);router['post']('/',auth[_0x5e01('0x8')](),controller['create']);router[_0x5e01('0xe')]('/:id',auth[_0x5e01('0x8')](),controller[_0x5e01('0xf')]);router['delete'](_0x5e01('0xc'),auth[_0x5e01('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 82c5fcb..2fad944 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25e7=['DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x25e7,0x1d6));var _0x725e=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0x25e7[_0x445101];return _0x3c3d04;};'use strict';var Sequelize=require(_0x725e('0x0'));module[_0x725e('0x1')]={'uniqueid':{'type':Sequelize[_0x725e('0x2')]},'type':{'type':Sequelize[_0x725e('0x3')](_0x725e('0x4'),_0x725e('0x5'),_0x725e('0x6'),_0x725e('0x7'),_0x725e('0x8'),_0x725e('0x9'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x725e('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x725e('0x2')]},'channel':{'type':Sequelize[_0x725e('0x2')]},'destinationchannel':{'type':Sequelize[_0x725e('0x2')]},'lastapplication':{'type':Sequelize[_0x725e('0x2')]},'lastdata':{'type':Sequelize[_0x725e('0xa')]},'starttime':{'type':Sequelize[_0x725e('0xb')]},'systemanswertime':{'type':Sequelize[_0x725e('0xb')]},'answertime':{'type':Sequelize[_0x725e('0xb')]},'endtime':{'type':Sequelize[_0x725e('0xb')]},'duration':{'type':Sequelize[_0x725e('0xc')]},'billableseconds':{'type':Sequelize[_0x725e('0xc')]},'mohtime':{'type':Sequelize[_0x725e('0xc')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x725e('0x2')]},'userDisposition':{'type':Sequelize[_0x725e('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x725e('0x2')]},'prefix':{'type':Sequelize[_0x725e('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x725e('0x2')]}};
\ No newline at end of file
+var _0x81cb=['DATE','INTEGER','sequelize','exports','ENUM','inbound','outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT'];(function(_0x49e6db,_0x1a4546){var _0x5a6137=function(_0xcf3ed9){while(--_0xcf3ed9){_0x49e6db['push'](_0x49e6db['shift']());}};_0x5a6137(++_0x1a4546);}(_0x81cb,0xaa));var _0xb81c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81cb[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xb81c('0x0'));module[_0xb81c('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb81c('0x2')](_0xb81c('0x3'),'internal',_0xb81c('0x4'),_0xb81c('0x5'),_0xb81c('0x6'),_0xb81c('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb81c('0x8')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xb81c('0x8')]},'callerid':{'type':Sequelize[_0xb81c('0x8')]},'channel':{'type':Sequelize[_0xb81c('0x8')]},'destinationchannel':{'type':Sequelize[_0xb81c('0x8')]},'lastapplication':{'type':Sequelize[_0xb81c('0x8')]},'lastdata':{'type':Sequelize[_0xb81c('0x9')]},'starttime':{'type':Sequelize[_0xb81c('0xa')]},'systemanswertime':{'type':Sequelize[_0xb81c('0xa')]},'answertime':{'type':Sequelize[_0xb81c('0xa')]},'endtime':{'type':Sequelize[_0xb81c('0xa')]},'duration':{'type':Sequelize[_0xb81c('0xb')]},'billableseconds':{'type':Sequelize[_0xb81c('0xb')]},'mohtime':{'type':Sequelize[_0xb81c('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb81c('0x8')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xb81c('0x8')]},'userDisposition':{'type':Sequelize[_0xb81c('0x8')]},'userSecondDisposition':{'type':Sequelize[_0xb81c('0x8')]},'userThirdDisposition':{'type':Sequelize[_0xb81c('0x8')]},'note':{'type':Sequelize[_0xb81c('0x8')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xb81c('0xb')]},'sipcallid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index bdfb498..57c70ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x2ef3,0xba));var _0x32ef=function(_0x5431bd,_0x19d955){_0x5431bd=_0x5431bd-0x0;var _0x54c402=_0x2ef3[_0x5431bd];return _0x54c402;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));};
\ No newline at end of file
+var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x2ef3,0xba));var _0x32ef=function(_0x41202b,_0x405164){_0x41202b=_0x41202b-0x0;var _0x4323c7=_0x2ef3[_0x41202b];return _0x4323c7;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));};
\ No newline at end of file
index f932685..04e29ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c32=['define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x33fa54,_0x749f02){var _0x4f517a=function(_0xc622ec){while(--_0xc622ec){_0x33fa54['push'](_0x33fa54['shift']());}};_0x4f517a(++_0x749f02);}(_0x1c32,0xb8));var _0x21c3=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0x1c32[_0x280ae7];return _0x418b9e;};'use strict';var _=require(_0x21c3('0x0'));var util=require(_0x21c3('0x1'));var logger=require(_0x21c3('0x2'))('api');var moment=require(_0x21c3('0x3'));var BPromise=require(_0x21c3('0x4'));var rp=require(_0x21c3('0x5'));var fs=require('fs');var path=require(_0x21c3('0x6'));var rimraf=require(_0x21c3('0x7'));var config=require(_0x21c3('0x8'));var attributes=require(_0x21c3('0x9'));module[_0x21c3('0xa')]=function(_0x1d3732,_0xcb9b35){return _0x1d3732[_0x21c3('0xb')](_0x21c3('0xc'),attributes,{'tableName':_0x21c3('0xd'),'paranoid':![],'indexes':[{'fields':[_0x21c3('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f85=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','VoiceCallReport','report_call'];(function(_0x329387,_0x53a4a1){var _0x314640=function(_0xd7e138){while(--_0xd7e138){_0x329387['push'](_0x329387['shift']());}};_0x314640(++_0x53a4a1);}(_0x3f85,0xde));var _0x53f8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f85[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x53f8('0x0'));var util=require(_0x53f8('0x1'));var logger=require(_0x53f8('0x2'))('api');var moment=require(_0x53f8('0x3'));var BPromise=require(_0x53f8('0x4'));var rp=require(_0x53f8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53f8('0x6'));var config=require(_0x53f8('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0x53f8('0x8')]=function(_0x14bee4,_0x24ed46){return _0x14bee4[_0x53f8('0x9')](_0x53f8('0xa'),attributes,{'tableName':_0x53f8('0xb'),'paranoid':![],'indexes':[{'fields':[_0x53f8('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 89a7cf6..0e79f16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd342=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','include','map','attributes','model','stringify','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','lodash','util','moment','ioredis'];(function(_0x6cd6e6,_0x4cc4e4){var _0x3cac7f=function(_0x48b5c6){while(--_0x48b5c6){_0x6cd6e6['push'](_0x6cd6e6['shift']());}};_0x3cac7f(++_0x4cc4e4);}(_0xd342,0x188));var _0x2d34=function(_0x449fac,_0x4a6578){_0x449fac=_0x449fac-0x0;var _0x5c1fbb=_0xd342[_0x449fac];return _0x5c1fbb;};'use strict';var _=require(_0x2d34('0x0'));var util=require(_0x2d34('0x1'));var moment=require(_0x2d34('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d34('0x3'));var db=require(_0x2d34('0x4'))['db'];var utils=require(_0x2d34('0x5'));var logger=require(_0x2d34('0x6'))(_0x2d34('0x7'));var config=require(_0x2d34('0x8'));var jayson=require(_0x2d34('0x9'));var client=jayson[_0x2d34('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22fce5,_0x431742,_0x40b244){return new BPromise(function(_0x53cd0c,_0x4a014e){return client[_0x2d34('0xb')](_0x22fce5,_0x40b244)[_0x2d34('0xc')](function(_0x11b0fb){logger[_0x2d34('0xd')](_0x2d34('0xe'),_0x431742,_0x2d34('0xf'));logger[_0x2d34('0x10')](_0x2d34('0x11'),_0x431742,_0x2d34('0xf'),JSON['stringify'](_0x11b0fb));if(_0x11b0fb['error']){if(_0x11b0fb['error']['code']===0x1f4){logger[_0x2d34('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x431742,_0x11b0fb[_0x2d34('0x12')]['message']);return _0x4a014e(_0x11b0fb[_0x2d34('0x12')]['message']);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x431742,_0x11b0fb['error'][_0x2d34('0x13')]);return _0x53cd0c(_0x11b0fb['error'][_0x2d34('0x13')]);}else{logger[_0x2d34('0xd')](_0x2d34('0xe'),_0x431742,_0x2d34('0xf'));_0x53cd0c(_0x11b0fb[_0x2d34('0x14')][_0x2d34('0x13')]);}})[_0x2d34('0x15')](function(_0x168214){logger[_0x2d34('0x12')](_0x2d34('0xe'),_0x431742,_0x168214);_0x4a014e(_0x168214);});});}exports[_0x2d34('0x16')]=function(_0x3c98e0){var _0x516f6c=this;return new Promise(function(_0xdaea,_0x97c253){return db[_0x2d34('0x17')]['findAll']({'raw':_0x3c98e0[_0x2d34('0x18')]?_0x3c98e0[_0x2d34('0x18')][_0x2d34('0x19')]===undefined?!![]:![]:!![],'where':_0x3c98e0[_0x2d34('0x18')]?_0x3c98e0['options'][_0x2d34('0x1a')]||null:null,'attributes':_0x3c98e0['options']?_0x3c98e0['options']['attributes']||null:null,'limit':_0x3c98e0[_0x2d34('0x18')]?_0x3c98e0[_0x2d34('0x18')]['limit']||null:null,'include':_0x3c98e0[_0x2d34('0x18')]?_0x3c98e0[_0x2d34('0x18')][_0x2d34('0x1b')]?_[_0x2d34('0x1c')](_0x3c98e0[_0x2d34('0x18')][_0x2d34('0x1b')],function(_0x5d970d){return{'model':db[_0x5d970d['model']],'as':_0x5d970d['as'],'attributes':_0x5d970d[_0x2d34('0x1d')],'include':_0x5d970d[_0x2d34('0x1b')]?_[_0x2d34('0x1c')](_0x5d970d[_0x2d34('0x1b')],function(_0x5cb962){return{'model':db[_0x5cb962[_0x2d34('0x1e')]],'as':_0x5cb962['as'],'attributes':_0x5cb962[_0x2d34('0x1d')],'include':_0x5cb962[_0x2d34('0x1b')]?_['map'](_0x5cb962[_0x2d34('0x1b')],function(_0x347fbd){return{'model':db[_0x347fbd[_0x2d34('0x1e')]],'as':_0x347fbd['as'],'attributes':_0x347fbd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x13d2e2){logger[_0x2d34('0xd')](_0x2d34('0x16'),_0x3c98e0);logger['debug'](_0x2d34('0x16'),_0x3c98e0,JSON[_0x2d34('0x1f')](_0x13d2e2));_0xdaea(_0x13d2e2);})[_0x2d34('0x15')](function(_0x442667){logger['error'](_0x2d34('0x16'),_0x442667[_0x2d34('0x13')],_0x3c98e0);_0x97c253(_0x516f6c[_0x2d34('0x12')](0x1f4,_0x442667[_0x2d34('0x13')]));});});};exports[_0x2d34('0x20')]=function(_0x5067dd){var _0x5adf12=this;return new Promise(function(_0x2aa581,_0x5d8095){return db['VoiceCallReport'][_0x2d34('0x21')](_0x5067dd[_0x2d34('0x22')],{'raw':_0x5067dd[_0x2d34('0x18')]?_0x5067dd['options'][_0x2d34('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x297af3){logger['info'](_0x2d34('0x20'),_0x5067dd);logger[_0x2d34('0x10')](_0x2d34('0x20'),_0x5067dd,JSON[_0x2d34('0x1f')](_0x297af3));_0x2aa581(_0x297af3);})[_0x2d34('0x15')](function(_0x1d4f03){logger[_0x2d34('0x12')](_0x2d34('0x20'),_0x1d4f03[_0x2d34('0x13')],_0x5067dd);_0x5d8095(_0x5adf12[_0x2d34('0x12')](0x1f4,_0x1d4f03['message']));});});};exports[_0x2d34('0x23')]=function(_0x435057){var _0x56dca6=this;return new Promise(function(_0x57e1b3,_0x1278fa){return db[_0x2d34('0x17')]['update'](_0x435057[_0x2d34('0x22')],{'raw':_0x435057['options']?_0x435057[_0x2d34('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x435057[_0x2d34('0x18')]?_0x435057[_0x2d34('0x18')][_0x2d34('0x1a')]||null:null,'attributes':_0x435057['options']?_0x435057[_0x2d34('0x18')][_0x2d34('0x1d')]||null:null,'limit':_0x435057[_0x2d34('0x18')]?_0x435057[_0x2d34('0x18')]['limit']||null:null})[_0x2d34('0xc')](function(_0x1af51c){logger['info'](_0x2d34('0x23'),_0x435057);logger[_0x2d34('0x10')](_0x2d34('0x23'),_0x435057,JSON[_0x2d34('0x1f')](_0x1af51c));_0x57e1b3(_0x1af51c);})[_0x2d34('0x15')](function(_0x3f044f){logger['error'](_0x2d34('0x23'),_0x3f044f[_0x2d34('0x13')],_0x435057);_0x1278fa(_0x56dca6[_0x2d34('0x12')](0x1f4,_0x3f044f[_0x2d34('0x13')]));});});};
\ No newline at end of file
+var _0x07f8=['VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','include','model','map','debug','create','body','raw','CreateVoiceCallReport','UpdateVoiceCallReport','update','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info'];(function(_0x474a02,_0x323a33){var _0x595f2a=function(_0x2e1b0e){while(--_0x2e1b0e){_0x474a02['push'](_0x474a02['shift']());}};_0x595f2a(++_0x323a33);}(_0x07f8,0x194));var _0x807f=function(_0xb3f66a,_0x211103){_0xb3f66a=_0xb3f66a-0x0;var _0x1db82a=_0x07f8[_0xb3f66a];return _0x1db82a;};'use strict';var _=require(_0x807f('0x0'));var util=require(_0x807f('0x1'));var moment=require(_0x807f('0x2'));var BPromise=require(_0x807f('0x3'));var rs=require(_0x807f('0x4'));var fs=require('fs');var Redis=require(_0x807f('0x5'));var db=require(_0x807f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x807f('0x7'));var config=require(_0x807f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x807f('0x9')][_0x807f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x494776,_0x112b1c,_0x347c80){return new BPromise(function(_0x3a09a2,_0x2f3678){return client[_0x807f('0xb')](_0x494776,_0x347c80)[_0x807f('0xc')](function(_0x26560f){logger[_0x807f('0xd')](_0x807f('0xe'),_0x112b1c,_0x807f('0xf'));logger['debug'](_0x807f('0x10'),_0x112b1c,_0x807f('0xf'),JSON['stringify'](_0x26560f));if(_0x26560f[_0x807f('0x11')]){if(_0x26560f[_0x807f('0x11')]['code']===0x1f4){logger[_0x807f('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x112b1c,_0x26560f[_0x807f('0x11')][_0x807f('0x12')]);return _0x2f3678(_0x26560f[_0x807f('0x11')]['message']);}logger[_0x807f('0x11')](_0x807f('0xe'),_0x112b1c,_0x26560f[_0x807f('0x11')][_0x807f('0x12')]);return _0x3a09a2(_0x26560f['error']['message']);}else{logger[_0x807f('0xd')](_0x807f('0xe'),_0x112b1c,_0x807f('0xf'));_0x3a09a2(_0x26560f['result'][_0x807f('0x12')]);}})[_0x807f('0x13')](function(_0x457c28){logger[_0x807f('0x11')](_0x807f('0xe'),_0x112b1c,_0x457c28);_0x2f3678(_0x457c28);});});}exports[_0x807f('0x14')]=function(_0x58965){var _0x589e04=this;return new Promise(function(_0x2c6d81,_0x369ce5){return db[_0x807f('0x15')][_0x807f('0x16')]({'raw':_0x58965[_0x807f('0x17')]?_0x58965['options']['raw']===undefined?!![]:![]:!![],'where':_0x58965[_0x807f('0x17')]?_0x58965[_0x807f('0x17')][_0x807f('0x18')]||null:null,'attributes':_0x58965['options']?_0x58965[_0x807f('0x17')][_0x807f('0x19')]||null:null,'limit':_0x58965[_0x807f('0x17')]?_0x58965[_0x807f('0x17')]['limit']||null:null,'include':_0x58965[_0x807f('0x17')]?_0x58965[_0x807f('0x17')][_0x807f('0x1a')]?_['map'](_0x58965[_0x807f('0x17')][_0x807f('0x1a')],function(_0x1fa485){return{'model':db[_0x1fa485[_0x807f('0x1b')]],'as':_0x1fa485['as'],'attributes':_0x1fa485[_0x807f('0x19')],'include':_0x1fa485['include']?_[_0x807f('0x1c')](_0x1fa485[_0x807f('0x1a')],function(_0x1d6f8a){return{'model':db[_0x1d6f8a[_0x807f('0x1b')]],'as':_0x1d6f8a['as'],'attributes':_0x1d6f8a['attributes'],'include':_0x1d6f8a['include']?_[_0x807f('0x1c')](_0x1d6f8a[_0x807f('0x1a')],function(_0x5add9a){return{'model':db[_0x5add9a[_0x807f('0x1b')]],'as':_0x5add9a['as'],'attributes':_0x5add9a[_0x807f('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20e352){logger[_0x807f('0xd')](_0x807f('0x14'),_0x58965);logger[_0x807f('0x1d')]('GetVoiceCallReport',_0x58965,JSON['stringify'](_0x20e352));_0x2c6d81(_0x20e352);})['catch'](function(_0x236cdb){logger['error']('GetVoiceCallReport',_0x236cdb['message'],_0x58965);_0x369ce5(_0x589e04[_0x807f('0x11')](0x1f4,_0x236cdb['message']));});});};exports['CreateVoiceCallReport']=function(_0x6d55ee){var _0xf9807b=this;return new Promise(function(_0x2f8d88,_0x4e1573){return db[_0x807f('0x15')][_0x807f('0x1e')](_0x6d55ee[_0x807f('0x1f')],{'raw':_0x6d55ee['options']?_0x6d55ee[_0x807f('0x17')][_0x807f('0x20')]===undefined?!![]:![]:!![]})[_0x807f('0xc')](function(_0x38330e){logger[_0x807f('0xd')](_0x807f('0x21'),_0x6d55ee);logger[_0x807f('0x1d')](_0x807f('0x21'),_0x6d55ee,JSON['stringify'](_0x38330e));_0x2f8d88(_0x38330e);})[_0x807f('0x13')](function(_0x3aad11){logger[_0x807f('0x11')](_0x807f('0x21'),_0x3aad11[_0x807f('0x12')],_0x6d55ee);_0x4e1573(_0xf9807b[_0x807f('0x11')](0x1f4,_0x3aad11[_0x807f('0x12')]));});});};exports[_0x807f('0x22')]=function(_0x52ab8d){var _0x538999=this;return new Promise(function(_0xb0029a,_0x57d2ea){return db['VoiceCallReport'][_0x807f('0x23')](_0x52ab8d[_0x807f('0x1f')],{'raw':_0x52ab8d['options']?_0x52ab8d['options'][_0x807f('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52ab8d[_0x807f('0x17')]?_0x52ab8d[_0x807f('0x17')]['where']||null:null,'attributes':_0x52ab8d[_0x807f('0x17')]?_0x52ab8d[_0x807f('0x17')][_0x807f('0x19')]||null:null,'limit':_0x52ab8d['options']?_0x52ab8d[_0x807f('0x17')][_0x807f('0x24')]||null:null})['then'](function(_0x1b2af8){logger['info'](_0x807f('0x22'),_0x52ab8d);logger[_0x807f('0x1d')](_0x807f('0x22'),_0x52ab8d,JSON[_0x807f('0x25')](_0x1b2af8));_0xb0029a(_0x1b2af8);})[_0x807f('0x13')](function(_0x1a8359){logger[_0x807f('0x11')](_0x807f('0x22'),_0x1a8359['message'],_0x52ab8d);_0x57d2ea(_0x538999[_0x807f('0x11')](0x1f4,_0x1a8359[_0x807f('0x12')]));});});};
\ No newline at end of file
index ad619c4..60b02a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fac=['delete','exports','multer','util','path','express','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','post','create','put','update'];(function(_0x52b9ee,_0x5706b5){var _0x562516=function(_0x4c9b94){while(--_0x4c9b94){_0x52b9ee['push'](_0x52b9ee['shift']());}};_0x562516(++_0x5706b5);}(_0x1fac,0xb2));var _0xc1fa=function(_0x36cf3f,_0x2e5cb2){_0x36cf3f=_0x36cf3f-0x0;var _0x53d738=_0x1fac[_0x36cf3f];return _0x53d738;};'use strict';var multer=require(_0xc1fa('0x0'));var util=require(_0xc1fa('0x1'));var path=require(_0xc1fa('0x2'));var timeout=require('connect-timeout');var express=require(_0xc1fa('0x3'));var router=express['Router']();var fs_extra=require(_0xc1fa('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc1fa('0x5'));var controller=require('./voiceChanSpy.controller');router[_0xc1fa('0x6')]('/',auth['isAuthenticated'](),controller[_0xc1fa('0x7')]);router[_0xc1fa('0x6')](_0xc1fa('0x8'),auth[_0xc1fa('0x9')](),controller['show']);router[_0xc1fa('0xa')]('/',auth[_0xc1fa('0x9')](),controller[_0xc1fa('0xb')]);router[_0xc1fa('0xc')](_0xc1fa('0x8'),auth[_0xc1fa('0x9')](),controller[_0xc1fa('0xd')]);router[_0xc1fa('0xe')](_0xc1fa('0x8'),auth[_0xc1fa('0x9')](),controller['destroy']);module[_0xc1fa('0xf')]=router;
\ No newline at end of file
+var _0x0542=['get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./voiceChanSpy.controller'];(function(_0x5688bc,_0x2264ee){var _0x1676b9=function(_0x20f450){while(--_0x20f450){_0x5688bc['push'](_0x5688bc['shift']());}};_0x1676b9(++_0x2264ee);}(_0x0542,0x116));var _0x2054=function(_0x45a106,_0x326636){_0x45a106=_0x45a106-0x0;var _0x1e437b=_0x0542[_0x45a106];return _0x1e437b;};'use strict';var multer=require(_0x2054('0x0'));var util=require(_0x2054('0x1'));var path=require(_0x2054('0x2'));var timeout=require(_0x2054('0x3'));var express=require(_0x2054('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2054('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2054('0x6'));router[_0x2054('0x7')]('/',auth[_0x2054('0x8')](),controller[_0x2054('0x9')]);router[_0x2054('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x2054('0xa')]);router[_0x2054('0xb')]('/',auth[_0x2054('0x8')](),controller[_0x2054('0xc')]);router[_0x2054('0xd')](_0x2054('0xe'),auth[_0x2054('0x8')](),controller[_0x2054('0xf')]);router[_0x2054('0x10')](_0x2054('0xe'),auth['isAuthenticated'](),controller[_0x2054('0x11')]);module[_0x2054('0x12')]=router;
\ No newline at end of file
index 3ef8289..3e0ecc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26b9=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options'];(function(_0x49524b,_0xb01084){var _0x5ca08d=function(_0xfcced6){while(--_0xfcced6){_0x49524b['push'](_0x49524b['shift']());}};_0x5ca08d(++_0xb01084);}(_0x26b9,0x162));var _0x926b=function(_0x5509a8,_0x1a8b93){_0x5509a8=_0x5509a8-0x0;var _0x5383b1=_0x26b9[_0x5509a8];return _0x5383b1;};'use strict';var Sequelize=require(_0x926b('0x0'));module[_0x926b('0x1')]={'name':{'type':Sequelize[_0x926b('0x2')]},'prefix':{'type':Sequelize[_0x926b('0x2')],'unique':_0x926b('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x926b('0x2')],'set':function(_0x20961d){this[_0x926b('0x4')](_0x926b('0x5'),_0x20961d?_0x20961d['join'](''):[]);},'get':function(){return this[_0x926b('0x6')]('options')?this['getDataValue'](_0x926b('0x5'))[_0x926b('0x7')](''):[];}},'auth':{'type':Sequelize[_0x926b('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x926b('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x926b('0x2')]}};
\ No newline at end of file
+var _0x23e5=['sequelize','exports','STRING','setDataValue','options','getDataValue','split','BOOLEAN'];(function(_0x32bf57,_0x5b9afe){var _0x5b3549=function(_0x45852a){while(--_0x45852a){_0x32bf57['push'](_0x32bf57['shift']());}};_0x5b3549(++_0x5b9afe);}(_0x23e5,0x160));var _0x523e=function(_0x217cfd,_0x1e3094){_0x217cfd=_0x217cfd-0x0;var _0x1e887f=_0x23e5[_0x217cfd];return _0x1e887f;};'use strict';var Sequelize=require(_0x523e('0x0'));module[_0x523e('0x1')]={'name':{'type':Sequelize[_0x523e('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x523e('0x2')],'set':function(_0x29212b){this[_0x523e('0x3')](_0x523e('0x4'),_0x29212b?_0x29212b['join'](''):[]);},'get':function(){return this[_0x523e('0x5')](_0x523e('0x4'))?this['getDataValue']('options')[_0x523e('0x6')](''):[];}},'auth':{'type':Sequelize[_0x523e('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x523e('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x523e('0x2')]}};
\ No newline at end of file
index 020e15d..19c287c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1542=['pick','filter','merge','includeAll','include','VoiceChanSpy','findAll','rows','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','then','get','UserProfileResource','destroy','error','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x1542,0x116));var _0x2154=function(_0x1ff820,_0x54e982){_0x1ff820=_0x1ff820-0x0;var _0xcddfff=_0x1542[_0x1ff820];return _0xcddfff;};'use strict';var emlformat=require(_0x2154('0x0'));var rimraf=require(_0x2154('0x1'));var zipdir=require(_0x2154('0x2'));var jsonpatch=require(_0x2154('0x3'));var rp=require(_0x2154('0x4'));var moment=require('moment');var BPromise=require(_0x2154('0x5'));var Mustache=require(_0x2154('0x6'));var util=require(_0x2154('0x7'));var path=require('path');var sox=require(_0x2154('0x8'));var csv=require(_0x2154('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2154('0xa'));var _=require(_0x2154('0xb'));var squel=require(_0x2154('0xc'));var crypto=require(_0x2154('0xd'));var jsforce=require(_0x2154('0xe'));var deskjs=require(_0x2154('0xf'));var toCsv=require(_0x2154('0x9'));var querystring=require(_0x2154('0x10'));var Papa=require(_0x2154('0x11'));var Redis=require(_0x2154('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2154('0x13'));var as=require(_0x2154('0x14'));var hardwareService=require(_0x2154('0x15'));var logger=require(_0x2154('0x16'))('api');var utils=require(_0x2154('0x17'));var config=require(_0x2154('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2154('0x19'))['db'];function respondWithStatusCode(_0x44c713,_0x3daa7d){_0x3daa7d=_0x3daa7d||0xcc;return function(_0x2a79eb){if(_0x2a79eb){return _0x44c713[_0x2154('0x1a')](_0x3daa7d);}return _0x44c713[_0x2154('0x1b')](_0x3daa7d)[_0x2154('0x1c')]();};}function respondWithResult(_0x587627,_0x5363f6){_0x5363f6=_0x5363f6||0xc8;return function(_0x160517){if(_0x160517){return _0x587627['status'](_0x5363f6)[_0x2154('0x1d')](_0x160517);}};}function respondWithFilteredResult(_0x59a389,_0x48f188){return function(_0x5b34b9){if(_0x5b34b9){var _0x46c995=typeof _0x48f188['offset']===_0x2154('0x1e')&&typeof _0x48f188['limit']===_0x2154('0x1e');var _0x369ab6=_0x5b34b9[_0x2154('0x1f')];var _0x35b468=_0x46c995?0x0:_0x48f188[_0x2154('0x20')];var _0x46b72c=_0x46c995?_0x5b34b9[_0x2154('0x1f')]:_0x48f188[_0x2154('0x20')]+_0x48f188[_0x2154('0x21')];var _0x286dc8;if(_0x46b72c>=_0x369ab6){_0x46b72c=_0x369ab6;_0x286dc8=0xc8;}else{_0x286dc8=0xce;}_0x59a389['status'](_0x286dc8);return _0x59a389[_0x2154('0x22')](_0x2154('0x23'),_0x35b468+'-'+_0x46b72c+'/'+_0x369ab6)[_0x2154('0x1d')](_0x5b34b9);}return null;};}function patchUpdates(_0x57bc6a){return function(_0x2af3dd){try{jsonpatch[_0x2154('0x24')](_0x2af3dd,_0x57bc6a,!![]);}catch(_0x3b71){return BPromise[_0x2154('0x25')](_0x3b71);}return _0x2af3dd['save']();};}function saveUpdates(_0x338185,_0xb10044){return function(_0x3f4387){if(_0x3f4387){return _0x3f4387['update'](_0x338185)['then'](function(_0x3e85c0){return _0x3e85c0;});}return null;};}function removeEntity(_0xa40b17,_0x166b0d){return function(_0x4ef4f7){if(_0x4ef4f7){return _0x4ef4f7['destroy']()[_0x2154('0x26')](function(){var _0x33f1a0=_0x4ef4f7[_0x2154('0x27')]({'plain':!![]});var _0x3b4fa8='ChanSpies';return db[_0x2154('0x28')][_0x2154('0x29')]({'where':{'type':_0x3b4fa8,'resourceId':_0x33f1a0['id']}})[_0x2154('0x26')](function(){return _0x4ef4f7;});})['then'](function(){_0xa40b17['status'](0xcc)[_0x2154('0x1c')]();});}};}function handleEntityNotFound(_0x27d28a,_0x2466eb){return function(_0x5317b5){if(!_0x5317b5){_0x27d28a[_0x2154('0x1a')](0x194);}return _0x5317b5;};}function handleError(_0xd780d,_0x45da10){_0x45da10=_0x45da10||0x1f4;return function(_0x83263d){logger[_0x2154('0x2a')](_0x83263d['stack']);if(_0x83263d[_0x2154('0x2b')]){delete _0x83263d[_0x2154('0x2b')];}_0xd780d[_0x2154('0x1b')](_0x45da10)[_0x2154('0x2c')](_0x83263d);};}exports[_0x2154('0x2d')]=function(_0x2dee3e,_0xe5c717){var _0x5661d9={},_0x327d1f={},_0x100f64={'count':0x0,'rows':[]};var _0x4cb415=_[_0x2154('0x2e')](db['VoiceChanSpy']['rawAttributes'],function(_0x883503){return{'name':_0x883503[_0x2154('0x2f')],'type':_0x883503[_0x2154('0x30')]['key']};});_0x327d1f[_0x2154('0x31')]=_[_0x2154('0x2e')](_0x4cb415,_0x2154('0x2b'));_0x327d1f[_0x2154('0x32')]=_[_0x2154('0x33')](_0x2dee3e[_0x2154('0x32')]);_0x327d1f[_0x2154('0x34')]=_[_0x2154('0x35')](_0x327d1f['model'],_0x327d1f[_0x2154('0x32')]);_0x5661d9['attributes']=_[_0x2154('0x35')](_0x327d1f[_0x2154('0x31')],qs[_0x2154('0x36')](_0x2dee3e[_0x2154('0x32')][_0x2154('0x36')]));_0x5661d9['attributes']=_0x5661d9['attributes'][_0x2154('0x37')]?_0x5661d9[_0x2154('0x38')]:_0x327d1f[_0x2154('0x31')];if(!_0x2dee3e[_0x2154('0x32')][_0x2154('0x39')](_0x2154('0x3a'))){_0x5661d9[_0x2154('0x21')]=qs[_0x2154('0x21')](_0x2dee3e[_0x2154('0x32')][_0x2154('0x21')]);_0x5661d9['offset']=qs[_0x2154('0x20')](_0x2dee3e['query'][_0x2154('0x20')]);}_0x5661d9[_0x2154('0x3b')]=qs[_0x2154('0x3c')](_0x2dee3e[_0x2154('0x32')][_0x2154('0x3c')]);_0x5661d9[_0x2154('0x3d')]=qs['filters'](_[_0x2154('0x3e')](_0x2dee3e[_0x2154('0x32')],_0x327d1f[_0x2154('0x34')]),_0x4cb415);if(_0x2dee3e[_0x2154('0x32')][_0x2154('0x3f')]){_0x5661d9[_0x2154('0x3d')]=_[_0x2154('0x40')](_0x5661d9[_0x2154('0x3d')],{'$or':_[_0x2154('0x2e')](_0x4cb415,function(_0x3887f1){if(_0x3887f1['type']!=='VIRTUAL'){var _0x472194={};_0x472194[_0x3887f1[_0x2154('0x2b')]]={'$like':'%'+_0x2dee3e['query'][_0x2154('0x3f')]+'%'};return _0x472194;}})});}_0x5661d9=_[_0x2154('0x40')]({},_0x5661d9,_0x2dee3e['options']);var _0x105903={'where':_0x5661d9[_0x2154('0x3d')]};return db['VoiceChanSpy']['count'](_0x105903)[_0x2154('0x26')](function(_0x3f0098){_0x100f64[_0x2154('0x1f')]=_0x3f0098;if(_0x2dee3e[_0x2154('0x32')][_0x2154('0x41')]){_0x5661d9[_0x2154('0x42')]=[{'all':!![]}];}return db[_0x2154('0x43')][_0x2154('0x44')](_0x5661d9);})[_0x2154('0x26')](function(_0x417663){_0x100f64[_0x2154('0x45')]=_0x417663;return _0x100f64;})['then'](respondWithFilteredResult(_0xe5c717,_0x5661d9))['catch'](handleError(_0xe5c717,null));};exports[_0x2154('0x46')]=function(_0x55caa3,_0x23f407){var _0x370143={'raw':![],'where':{'id':_0x55caa3[_0x2154('0x47')]['id']}},_0xff86df={};_0xff86df['model']=_[_0x2154('0x33')](db[_0x2154('0x43')][_0x2154('0x48')]);_0xff86df[_0x2154('0x32')]=_[_0x2154('0x33')](_0x55caa3[_0x2154('0x32')]);_0xff86df['filters']=_['intersection'](_0xff86df['model'],_0xff86df[_0x2154('0x32')]);_0x370143['attributes']=_['intersection'](_0xff86df[_0x2154('0x31')],qs[_0x2154('0x36')](_0x55caa3[_0x2154('0x32')][_0x2154('0x36')]));_0x370143[_0x2154('0x38')]=_0x370143[_0x2154('0x38')][_0x2154('0x37')]?_0x370143[_0x2154('0x38')]:_0xff86df['model'];if(_0x55caa3[_0x2154('0x32')][_0x2154('0x41')]){_0x370143[_0x2154('0x42')]=[{'all':!![]}];}_0x370143=_['merge']({},_0x370143,_0x55caa3['options']);return db[_0x2154('0x43')][_0x2154('0x49')](_0x370143)[_0x2154('0x26')](handleEntityNotFound(_0x23f407,null))['then'](respondWithResult(_0x23f407,null))[_0x2154('0x4a')](handleError(_0x23f407,null));};exports[_0x2154('0x4b')]=function(_0x24f13b,_0x7027c1){return db[_0x2154('0x43')][_0x2154('0x4b')](_0x24f13b[_0x2154('0x4c')],{})[_0x2154('0x26')](function(_0x4b3128){var _0x10f05a=_0x24f13b[_0x2154('0x4d')][_0x2154('0x27')]({'plain':!![]});if(!_0x10f05a)throw new Error(_0x2154('0x4e'));if(_0x10f05a['role']===_0x2154('0x4d')){var _0x557f56=_0x4b3128['get']({'plain':!![]});var _0xd745bf=_0x2154('0x4f');return db[_0x2154('0x50')][_0x2154('0x49')]({'where':{'name':_0xd745bf,'userProfileId':_0x10f05a[_0x2154('0x51')]},'raw':!![]})[_0x2154('0x26')](function(_0x1026d9){if(_0x1026d9&&_0x1026d9[_0x2154('0x52')]===0x0){return db[_0x2154('0x28')][_0x2154('0x4b')]({'name':_0x557f56['name'],'resourceId':_0x557f56['id'],'type':_0x1026d9['name'],'sectionId':_0x1026d9['id']},{})[_0x2154('0x26')](function(){return _0x4b3128;});}else{return _0x4b3128;}})['catch'](function(_0x336f8b){logger['error'](_0x2154('0x53'),_0x336f8b);throw _0x336f8b;});}return _0x4b3128;})[_0x2154('0x26')](respondWithResult(_0x7027c1,0xc9))[_0x2154('0x4a')](handleError(_0x7027c1,null));};exports[_0x2154('0x54')]=function(_0xfa774b,_0x3829bd){if(_0xfa774b[_0x2154('0x4c')]['id']){delete _0xfa774b[_0x2154('0x4c')]['id'];}return db[_0x2154('0x43')][_0x2154('0x49')]({'where':{'id':_0xfa774b[_0x2154('0x47')]['id']}})[_0x2154('0x26')](handleEntityNotFound(_0x3829bd,null))[_0x2154('0x26')](saveUpdates(_0xfa774b[_0x2154('0x4c')],null))['then'](respondWithResult(_0x3829bd,null))['catch'](handleError(_0x3829bd,null));};exports[_0x2154('0x29')]=function(_0x2d607a,_0x2afcca){return db[_0x2154('0x43')][_0x2154('0x49')]({'where':{'id':_0x2d607a['params']['id']}})['then'](handleEntityNotFound(_0x2afcca,null))[_0x2154('0x26')](removeEntity(_0x2afcca,null))[_0x2154('0x4a')](handleError(_0x2afcca,null));};
\ No newline at end of file
+var _0xab3a=['offset','limit','Content-Range','json','apply','update','then','destroy','get','ChanSpies','error','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','keys','intersection','fields','attributes','query','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','length','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','count'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xab3a,0x1d3));var _0xaab3=function(_0x19cf72,_0x37be00){_0x19cf72=_0x19cf72-0x0;var _0x2e5b3b=_0xab3a[_0x19cf72];return _0x2e5b3b;};'use strict';var emlformat=require(_0xaab3('0x0'));var rimraf=require(_0xaab3('0x1'));var zipdir=require(_0xaab3('0x2'));var jsonpatch=require(_0xaab3('0x3'));var rp=require(_0xaab3('0x4'));var moment=require(_0xaab3('0x5'));var BPromise=require(_0xaab3('0x6'));var Mustache=require(_0xaab3('0x7'));var util=require(_0xaab3('0x8'));var path=require(_0xaab3('0x9'));var sox=require(_0xaab3('0xa'));var csv=require(_0xaab3('0xb'));var ejs=require(_0xaab3('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaab3('0xd'));var crypto=require(_0xaab3('0xe'));var jsforce=require(_0xaab3('0xf'));var deskjs=require(_0xaab3('0x10'));var toCsv=require(_0xaab3('0xb'));var querystring=require(_0xaab3('0x11'));var Papa=require(_0xaab3('0x12'));var Redis=require(_0xaab3('0x13'));var authService=require(_0xaab3('0x14'));var qs=require(_0xaab3('0x15'));var as=require(_0xaab3('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaab3('0x17'));var utils=require(_0xaab3('0x18'));var config=require(_0xaab3('0x19'));var licenseUtil=require(_0xaab3('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9bab,_0x536fd2){_0x536fd2=_0x536fd2||0xcc;return function(_0x1be7b2){if(_0x1be7b2){return _0x2c9bab['sendStatus'](_0x536fd2);}return _0x2c9bab[_0xaab3('0x1b')](_0x536fd2)[_0xaab3('0x1c')]();};}function respondWithResult(_0x4ccbf5,_0x553449){_0x553449=_0x553449||0xc8;return function(_0x43ca09){if(_0x43ca09){return _0x4ccbf5[_0xaab3('0x1b')](_0x553449)['json'](_0x43ca09);}};}function respondWithFilteredResult(_0x2d215e,_0xcc28ed){return function(_0x2aea7a){if(_0x2aea7a){var _0x5dbe3e=typeof _0xcc28ed['offset']==='undefined'&&typeof _0xcc28ed['limit']===_0xaab3('0x1d');var _0x3c5d63=_0x2aea7a[_0xaab3('0x1e')];var _0x5a3ecc=_0x5dbe3e?0x0:_0xcc28ed[_0xaab3('0x1f')];var _0x46aefc=_0x5dbe3e?_0x2aea7a[_0xaab3('0x1e')]:_0xcc28ed[_0xaab3('0x1f')]+_0xcc28ed[_0xaab3('0x20')];var _0x4c0d11;if(_0x46aefc>=_0x3c5d63){_0x46aefc=_0x3c5d63;_0x4c0d11=0xc8;}else{_0x4c0d11=0xce;}_0x2d215e[_0xaab3('0x1b')](_0x4c0d11);return _0x2d215e['set'](_0xaab3('0x21'),_0x5a3ecc+'-'+_0x46aefc+'/'+_0x3c5d63)[_0xaab3('0x22')](_0x2aea7a);}return null;};}function patchUpdates(_0x43a8d4){return function(_0x3588a9){try{jsonpatch[_0xaab3('0x23')](_0x3588a9,_0x43a8d4,!![]);}catch(_0x537701){return BPromise['reject'](_0x537701);}return _0x3588a9['save']();};}function saveUpdates(_0x5c5d8b,_0x5d7bf6){return function(_0x1fa934){if(_0x1fa934){return _0x1fa934[_0xaab3('0x24')](_0x5c5d8b)[_0xaab3('0x25')](function(_0x3a3000){return _0x3a3000;});}return null;};}function removeEntity(_0xaebe3e,_0x1816ab){return function(_0x3c552f){if(_0x3c552f){return _0x3c552f[_0xaab3('0x26')]()[_0xaab3('0x25')](function(){var _0x46e004=_0x3c552f[_0xaab3('0x27')]({'plain':!![]});var _0x3097ec=_0xaab3('0x28');return db['UserProfileResource'][_0xaab3('0x26')]({'where':{'type':_0x3097ec,'resourceId':_0x46e004['id']}})['then'](function(){return _0x3c552f;});})[_0xaab3('0x25')](function(){_0xaebe3e[_0xaab3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a3d5f,_0x1f3c07){return function(_0x263362){if(!_0x263362){_0x4a3d5f['sendStatus'](0x194);}return _0x263362;};}function handleError(_0x4f5eec,_0x2f9833){_0x2f9833=_0x2f9833||0x1f4;return function(_0x205996){logger[_0xaab3('0x29')](_0x205996['stack']);if(_0x205996[_0xaab3('0x2a')]){delete _0x205996[_0xaab3('0x2a')];}_0x4f5eec[_0xaab3('0x1b')](_0x2f9833)[_0xaab3('0x2b')](_0x205996);};}exports[_0xaab3('0x2c')]=function(_0x3c5b75,_0x127fef){var _0x42d22c={},_0x43d300={},_0x2f59ce={'count':0x0,'rows':[]};var _0x3ad2c8=_[_0xaab3('0x2d')](db[_0xaab3('0x2e')][_0xaab3('0x2f')],function(_0x4f71c9){return{'name':_0x4f71c9[_0xaab3('0x30')],'type':_0x4f71c9[_0xaab3('0x31')][_0xaab3('0x32')]};});_0x43d300[_0xaab3('0x33')]=_[_0xaab3('0x2d')](_0x3ad2c8,_0xaab3('0x2a'));_0x43d300['query']=_[_0xaab3('0x34')](_0x3c5b75['query']);_0x43d300['filters']=_[_0xaab3('0x35')](_0x43d300[_0xaab3('0x33')],_0x43d300['query']);_0x42d22c['attributes']=_[_0xaab3('0x35')](_0x43d300[_0xaab3('0x33')],qs[_0xaab3('0x36')](_0x3c5b75['query'][_0xaab3('0x36')]));_0x42d22c[_0xaab3('0x37')]=_0x42d22c[_0xaab3('0x37')]['length']?_0x42d22c['attributes']:_0x43d300[_0xaab3('0x33')];if(!_0x3c5b75[_0xaab3('0x38')][_0xaab3('0x39')](_0xaab3('0x3a'))){_0x42d22c[_0xaab3('0x20')]=qs[_0xaab3('0x20')](_0x3c5b75['query'][_0xaab3('0x20')]);_0x42d22c[_0xaab3('0x1f')]=qs[_0xaab3('0x1f')](_0x3c5b75['query'][_0xaab3('0x1f')]);}_0x42d22c[_0xaab3('0x3b')]=qs[_0xaab3('0x3c')](_0x3c5b75[_0xaab3('0x38')][_0xaab3('0x3c')]);_0x42d22c[_0xaab3('0x3d')]=qs['filters'](_['pick'](_0x3c5b75[_0xaab3('0x38')],_0x43d300[_0xaab3('0x3e')]),_0x3ad2c8);if(_0x3c5b75['query']['filter']){_0x42d22c[_0xaab3('0x3d')]=_[_0xaab3('0x3f')](_0x42d22c['where'],{'$or':_[_0xaab3('0x2d')](_0x3ad2c8,function(_0x36987c){if(_0x36987c[_0xaab3('0x31')]!==_0xaab3('0x40')){var _0x4a1ded={};_0x4a1ded[_0x36987c[_0xaab3('0x2a')]]={'$like':'%'+_0x3c5b75[_0xaab3('0x38')]['filter']+'%'};return _0x4a1ded;}})});}_0x42d22c=_[_0xaab3('0x3f')]({},_0x42d22c,_0x3c5b75['options']);var _0x3531d6={'where':_0x42d22c[_0xaab3('0x3d')]};return db[_0xaab3('0x2e')]['count'](_0x3531d6)[_0xaab3('0x25')](function(_0x201625){_0x2f59ce[_0xaab3('0x1e')]=_0x201625;if(_0x3c5b75['query'][_0xaab3('0x41')]){_0x42d22c[_0xaab3('0x42')]=[{'all':!![]}];}return db[_0xaab3('0x2e')][_0xaab3('0x43')](_0x42d22c);})[_0xaab3('0x25')](function(_0x2e57cf){_0x2f59ce['rows']=_0x2e57cf;return _0x2f59ce;})[_0xaab3('0x25')](respondWithFilteredResult(_0x127fef,_0x42d22c))[_0xaab3('0x44')](handleError(_0x127fef,null));};exports[_0xaab3('0x45')]=function(_0x3a69b3,_0x2dcb6f){var _0x38446b={'raw':![],'where':{'id':_0x3a69b3[_0xaab3('0x46')]['id']}},_0x4f8ed9={};_0x4f8ed9[_0xaab3('0x33')]=_[_0xaab3('0x34')](db[_0xaab3('0x2e')][_0xaab3('0x2f')]);_0x4f8ed9['query']=_[_0xaab3('0x34')](_0x3a69b3[_0xaab3('0x38')]);_0x4f8ed9[_0xaab3('0x3e')]=_[_0xaab3('0x35')](_0x4f8ed9['model'],_0x4f8ed9[_0xaab3('0x38')]);_0x38446b[_0xaab3('0x37')]=_[_0xaab3('0x35')](_0x4f8ed9['model'],qs['fields'](_0x3a69b3['query'][_0xaab3('0x36')]));_0x38446b[_0xaab3('0x37')]=_0x38446b['attributes'][_0xaab3('0x47')]?_0x38446b[_0xaab3('0x37')]:_0x4f8ed9[_0xaab3('0x33')];if(_0x3a69b3[_0xaab3('0x38')][_0xaab3('0x41')]){_0x38446b[_0xaab3('0x42')]=[{'all':!![]}];}_0x38446b=_[_0xaab3('0x3f')]({},_0x38446b,_0x3a69b3[_0xaab3('0x48')]);return db['VoiceChanSpy'][_0xaab3('0x49')](_0x38446b)[_0xaab3('0x25')](handleEntityNotFound(_0x2dcb6f,null))[_0xaab3('0x25')](respondWithResult(_0x2dcb6f,null))[_0xaab3('0x44')](handleError(_0x2dcb6f,null));};exports[_0xaab3('0x4a')]=function(_0x521820,_0x2a774e){return db['VoiceChanSpy']['create'](_0x521820['body'],{})['then'](function(_0x315bef){var _0x27b3ec=_0x521820['user'][_0xaab3('0x27')]({'plain':!![]});if(!_0x27b3ec)throw new Error(_0xaab3('0x4b'));if(_0x27b3ec[_0xaab3('0x4c')]===_0xaab3('0x4d')){var _0x50419c=_0x315bef[_0xaab3('0x27')]({'plain':!![]});var _0x3454cc=_0xaab3('0x28');return db[_0xaab3('0x4e')]['find']({'where':{'name':_0x3454cc,'userProfileId':_0x27b3ec[_0xaab3('0x4f')]},'raw':!![]})[_0xaab3('0x25')](function(_0x50622c){if(_0x50622c&&_0x50622c[_0xaab3('0x50')]===0x0){return db[_0xaab3('0x51')][_0xaab3('0x4a')]({'name':_0x50419c[_0xaab3('0x2a')],'resourceId':_0x50419c['id'],'type':_0x50622c[_0xaab3('0x2a')],'sectionId':_0x50622c['id']},{})[_0xaab3('0x25')](function(){return _0x315bef;});}else{return _0x315bef;}})[_0xaab3('0x44')](function(_0x58e304){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58e304);throw _0x58e304;});}return _0x315bef;})[_0xaab3('0x25')](respondWithResult(_0x2a774e,0xc9))['catch'](handleError(_0x2a774e,null));};exports[_0xaab3('0x24')]=function(_0x3cf171,_0x3907da){if(_0x3cf171[_0xaab3('0x52')]['id']){delete _0x3cf171[_0xaab3('0x52')]['id'];}return db[_0xaab3('0x2e')][_0xaab3('0x49')]({'where':{'id':_0x3cf171[_0xaab3('0x46')]['id']}})['then'](handleEntityNotFound(_0x3907da,null))['then'](saveUpdates(_0x3cf171[_0xaab3('0x52')],null))[_0xaab3('0x25')](respondWithResult(_0x3907da,null))[_0xaab3('0x44')](handleError(_0x3907da,null));};exports[_0xaab3('0x26')]=function(_0x4d86ca,_0x438ebb){return db[_0xaab3('0x2e')][_0xaab3('0x49')]({'where':{'id':_0x4d86ca[_0xaab3('0x46')]['id']}})[_0xaab3('0x25')](handleEntityNotFound(_0x438ebb,null))[_0xaab3('0x25')](removeEntity(_0x438ebb,null))['catch'](handleError(_0x438ebb,null));};
\ No newline at end of file
index 08383ef..230073e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd509=['util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','merge','CDR(type)=%s','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','User','agent','then','catch','exports','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','lodash'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xd509,0x97));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9d50('0x0'));var util=require(_0x9d50('0x1'));var BPromise=require(_0x9d50('0x2'));var attributes=require(_0x9d50('0x3'));var getUserApplications=function(_0x52c494,_0x3bc65e,_0xc07dee){var _0xc093c5=0x1;var _0x510c8b=[];var _0x44bab4={'context':_0x3bc65e[_0x9d50('0x4')]||_0x9d50('0x5'),'exten':util[_0x9d50('0x6')](_0x9d50('0x7'),_0x52c494[_0x9d50('0x8')],_0xc07dee),'type':_0x9d50('0x9'),'isApp':![],'ChanSpyId':_0x52c494['id'],'UserId':_0x3bc65e['id']};_0x510c8b['push'](_[_0x9d50('0xa')]({'app':'Set','appdata':util[_0x9d50('0x6')](_0x9d50('0xb'),'chanspy'),'priority':_0xc093c5++},_0x44bab4));if(_0x52c494[_0x9d50('0xc')]){_0x510c8b[_0x9d50('0xd')](_['merge']({'app':_0x9d50('0xe'),'appdata':util['format'](_0x9d50('0xf'),_0x52c494[_0x9d50('0x10')]),'priority':_0xc093c5++},_0x44bab4));}if(_0x52c494['auth']){_0x510c8b[_0x9d50('0xd')](_['merge']({'app':'Authenticate','appdata':_0x52c494[_0x9d50('0x11')],'priority':_0xc093c5++},_0x44bab4));}_0x510c8b[_0x9d50('0xd')](_[_0x9d50('0xa')]({'app':_0x9d50('0x12'),'appdata':util[_0x9d50('0x6')](_0x9d50('0x13'),_0x3bc65e[_0x9d50('0x14')],_0x52c494[_0x9d50('0x15')]?_0x52c494['options'][_0x9d50('0x16')](''):''),'priority':_0xc093c5++},_0x44bab4));if(_0x52c494[_0x9d50('0xc')]){_0x510c8b['push'](_[_0x9d50('0xa')]({'app':_0x9d50('0x17'),'priority':_0xc093c5++},_0x44bab4));}return _0x510c8b;};var getChanSpyApplications=function(_0x4b9044,_0x87262a){var _0x42f25d=[];for(var _0x3388d8=0x0,_0x2b375d=0x1;_0x3388d8<_0x87262a['length'];_0x3388d8++,_0x2b375d=0x1){_0x42f25d=_0x42f25d[_0x9d50('0x18')](getUserApplications(_0x4b9044,_0x87262a[_0x3388d8],_0x87262a[_0x3388d8]['internal']));if(_0x87262a[_0x3388d8][_0x9d50('0x19')]!=_0x87262a[_0x3388d8][_0x9d50('0x14')]){_0x42f25d=_0x42f25d[_0x9d50('0x18')](getUserApplications(_0x4b9044,_0x87262a[_0x3388d8],_0x87262a[_0x3388d8][_0x9d50('0x14')]));}}return _0x42f25d;};var getChanSpyPromise=function(_0x362a2d,_0x598848){return new BPromise(function(_0x386372,_0x3c4105){return _0x362a2d[_0x9d50('0x1a')]['findAll']({'attributes':['id',_0x9d50('0x14'),_0x9d50('0x19')],'where':{'role':_0x9d50('0x1b'),'chanspy':!![]},'raw':!![]})[_0x9d50('0x1c')](function(_0x394fbe){if(_0x394fbe){return _0x386372(getChanSpyApplications(_0x598848,_0x394fbe));}return _0x386372([]);})[_0x9d50('0x1d')](function(_0xfe6530){_0x3c4105(_0xfe6530);});});};module[_0x9d50('0x1e')]=function(_0x2be64b,_0x5cff0d){var _0x5524d5=_0x2be64b['models'];return _0x2be64b[_0x9d50('0x1f')](_0x9d50('0x20'),attributes,{'tableName':_0x9d50('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3add6d,_0x29a92e,_0x553e38){return getChanSpyPromise(_0x5524d5,_0x3add6d)['then'](function(_0x1e382f){if(_0x1e382f&&_0x1e382f[_0x9d50('0x22')]){return _0x5524d5[_0x9d50('0x23')][_0x9d50('0x24')](_0x1e382f);}})['then'](function(){_0x553e38();})[_0x9d50('0x1d')](function(_0x4c9bca){_0x553e38(_0x4c9bca);});},'afterUpdate':function(_0x4e0d98,_0x398872,_0x11bb92){return _0x5524d5[_0x9d50('0x23')][_0x9d50('0x25')]({'where':{'ChanSpyId':_0x4e0d98['id']}})[_0x9d50('0x1c')](function(){return getChanSpyPromise(_0x5524d5,_0x4e0d98);})[_0x9d50('0x1c')](function(_0x469b5e){if(_0x469b5e&&_0x469b5e[_0x9d50('0x22')]){return _0x5524d5['VoiceExtension'][_0x9d50('0x24')](_0x469b5e);}})[_0x9d50('0x1c')](function(){_0x11bb92();})[_0x9d50('0x1d')](function(_0x23ee33){_0x11bb92(_0x23ee33);});},'afterDestroy':function(_0x486a12,_0x10a063,_0x1ee701){return _0x5524d5['VoiceExtension'][_0x9d50('0x25')]({'where':{'ChanSpyId':_0x486a12['id']}})['then'](function(){_0x1ee701();})[_0x9d50('0x1d')](function(_0x3fbaa3){_0x1ee701(_0x3fbaa3);});}}});};
\ No newline at end of file
+var _0x7311=['system','push','Set','CDR(type)=%s','chanspy','record','merge','MixMonitor','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','concat','internal','User','findAll','catch','models','VoiceChanSpy','then','length','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix'];(function(_0x16a4a0,_0xd7697c){var _0x3f4c2d=function(_0x259f0f){while(--_0x259f0f){_0x16a4a0['push'](_0x16a4a0['shift']());}};_0x3f4c2d(++_0xd7697c);}(_0x7311,0x8b));var _0x1731=function(_0x519233,_0xd7014c){_0x519233=_0x519233-0x0;var _0x3f4054=_0x7311[_0x519233];return _0x3f4054;};'use strict';var _=require(_0x1731('0x0'));var util=require(_0x1731('0x1'));var BPromise=require(_0x1731('0x2'));var attributes=require(_0x1731('0x3'));var getUserApplications=function(_0x32bfee,_0x48dff5,_0x2c3dfe){var _0x2fd734=0x1;var _0x4edfdb=[];var _0x4b82cb={'context':_0x48dff5[_0x1731('0x4')]||_0x1731('0x5'),'exten':util[_0x1731('0x6')](_0x1731('0x7'),_0x32bfee[_0x1731('0x8')],_0x2c3dfe),'type':_0x1731('0x9'),'isApp':![],'ChanSpyId':_0x32bfee['id'],'UserId':_0x48dff5['id']};_0x4edfdb[_0x1731('0xa')](_['merge']({'app':_0x1731('0xb'),'appdata':util[_0x1731('0x6')](_0x1731('0xc'),_0x1731('0xd')),'priority':_0x2fd734++},_0x4b82cb));if(_0x32bfee[_0x1731('0xe')]){_0x4edfdb[_0x1731('0xa')](_[_0x1731('0xf')]({'app':_0x1731('0x10'),'appdata':util[_0x1731('0x6')]('${UNIQUEID}.%s,a',_0x32bfee['recordingFormat']),'priority':_0x2fd734++},_0x4b82cb));}if(_0x32bfee[_0x1731('0x11')]){_0x4edfdb['push'](_[_0x1731('0xf')]({'app':_0x1731('0x12'),'appdata':_0x32bfee[_0x1731('0x13')],'priority':_0x2fd734++},_0x4b82cb));}_0x4edfdb[_0x1731('0xa')](_['merge']({'app':_0x1731('0x14'),'appdata':util[_0x1731('0x6')](_0x1731('0x15'),_0x48dff5[_0x1731('0x16')],_0x32bfee[_0x1731('0x17')]?_0x32bfee[_0x1731('0x17')][_0x1731('0x18')](''):''),'priority':_0x2fd734++},_0x4b82cb));if(_0x32bfee[_0x1731('0xe')]){_0x4edfdb[_0x1731('0xa')](_['merge']({'app':'StopMixMonitor','priority':_0x2fd734++},_0x4b82cb));}return _0x4edfdb;};var getChanSpyApplications=function(_0x5b9c03,_0x593f2f){var _0x1986b3=[];for(var _0x256092=0x0,_0x250171=0x1;_0x256092<_0x593f2f['length'];_0x256092++,_0x250171=0x1){_0x1986b3=_0x1986b3[_0x1731('0x19')](getUserApplications(_0x5b9c03,_0x593f2f[_0x256092],_0x593f2f[_0x256092][_0x1731('0x1a')]));if(_0x593f2f[_0x256092][_0x1731('0x1a')]!=_0x593f2f[_0x256092][_0x1731('0x16')]){_0x1986b3=_0x1986b3[_0x1731('0x19')](getUserApplications(_0x5b9c03,_0x593f2f[_0x256092],_0x593f2f[_0x256092]['name']));}}return _0x1986b3;};var getChanSpyPromise=function(_0x421f84,_0x2244d2){return new BPromise(function(_0x2b901b,_0x202f03){return _0x421f84[_0x1731('0x1b')][_0x1731('0x1c')]({'attributes':['id',_0x1731('0x16'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x2e3512){if(_0x2e3512){return _0x2b901b(getChanSpyApplications(_0x2244d2,_0x2e3512));}return _0x2b901b([]);})[_0x1731('0x1d')](function(_0x3c56ca){_0x202f03(_0x3c56ca);});});};module['exports']=function(_0x28c611,_0xfed60a){var _0x16fa01=_0x28c611[_0x1731('0x1e')];return _0x28c611['define'](_0x1731('0x1f'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x10c663,_0x295588,_0x140c68){return getChanSpyPromise(_0x16fa01,_0x10c663)[_0x1731('0x20')](function(_0x48cf12){if(_0x48cf12&&_0x48cf12[_0x1731('0x21')]){return _0x16fa01[_0x1731('0x22')][_0x1731('0x23')](_0x48cf12);}})[_0x1731('0x20')](function(){_0x140c68();})['catch'](function(_0x49d3d6){_0x140c68(_0x49d3d6);});},'afterUpdate':function(_0x11a4b9,_0x42571a,_0x1f9288){return _0x16fa01[_0x1731('0x22')][_0x1731('0x24')]({'where':{'ChanSpyId':_0x11a4b9['id']}})[_0x1731('0x20')](function(){return getChanSpyPromise(_0x16fa01,_0x11a4b9);})[_0x1731('0x20')](function(_0x52fe1a){if(_0x52fe1a&&_0x52fe1a[_0x1731('0x21')]){return _0x16fa01['VoiceExtension'][_0x1731('0x23')](_0x52fe1a);}})[_0x1731('0x20')](function(){_0x1f9288();})[_0x1731('0x1d')](function(_0x1e5b12){_0x1f9288(_0x1e5b12);});},'afterDestroy':function(_0x46ccbb,_0x3d72aa,_0x4f0a0e){return _0x16fa01[_0x1731('0x22')]['destroy']({'where':{'ChanSpyId':_0x46ccbb['id']}})[_0x1731('0x20')](function(){_0x4f0a0e();})[_0x1731('0x1d')](function(_0x4b70d3){_0x4f0a0e(_0x4b70d3);});}}});};
\ No newline at end of file
index a90a062..f6ed1bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda65=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4f8381,_0x3d93ef){var _0x26d6f6=function(_0x4d5303){while(--_0x4d5303){_0x4f8381['push'](_0x4f8381['shift']());}};_0x26d6f6(++_0x3d93ef);}(_0xda65,0x1d0));var _0x5da6=function(_0x418789,_0x273130){_0x418789=_0x418789-0x0;var _0x516365=_0xda65[_0x418789];return _0x516365;};'use strict';var _=require(_0x5da6('0x0'));var util=require(_0x5da6('0x1'));var moment=require(_0x5da6('0x2'));var BPromise=require('bluebird');var rs=require(_0x5da6('0x3'));var fs=require('fs');var Redis=require(_0x5da6('0x4'));var db=require(_0x5da6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5da6('0x6'));var config=require(_0x5da6('0x7'));var jayson=require(_0x5da6('0x8'));var client=jayson[_0x5da6('0x9')][_0x5da6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51924c,_0x35aff9,_0x4a7040){return new BPromise(function(_0x55108e,_0x40722c){return client['request'](_0x51924c,_0x4a7040)[_0x5da6('0xb')](function(_0x20cb14){logger[_0x5da6('0xc')](_0x5da6('0xd'),_0x35aff9,_0x5da6('0xe'));logger[_0x5da6('0xf')](_0x5da6('0x10'),_0x35aff9,_0x5da6('0xe'),JSON['stringify'](_0x20cb14));if(_0x20cb14[_0x5da6('0x11')]){if(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x12')]===0x1f4){logger[_0x5da6('0x11')](_0x5da6('0xd'),_0x35aff9,_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);return _0x40722c(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);}logger['error'](_0x5da6('0xd'),_0x35aff9,_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);return _0x55108e(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);}else{logger[_0x5da6('0xc')](_0x5da6('0xd'),_0x35aff9,_0x5da6('0xe'));_0x55108e(_0x20cb14[_0x5da6('0x14')][_0x5da6('0x13')]);}})['catch'](function(_0x5207e5){logger[_0x5da6('0x11')](_0x5da6('0xd'),_0x35aff9,_0x5207e5);_0x40722c(_0x5207e5);});});}
\ No newline at end of file
+var _0xa74f=['result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x5ae93d,_0x48a929){var _0x3bc344=function(_0x37d1e8){while(--_0x37d1e8){_0x5ae93d['push'](_0x5ae93d['shift']());}};_0x3bc344(++_0x48a929);}(_0xa74f,0x9a));var _0xfa74=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0xa74f[_0x1809c5];return _0x5254a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9ddbd2,_0x3ac32e,_0x2d9fa9){return new BPromise(function(_0x287921,_0x344e04){return client['request'](_0x9ddbd2,_0x2d9fa9)[_0xfa74('0x7')](function(_0x37d4d8){logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,'request\x20sent');logger[_0xfa74('0xa')](_0xfa74('0xb'),_0x3ac32e,'request\x20sent',JSON[_0xfa74('0xc')](_0x37d4d8));if(_0x37d4d8[_0xfa74('0xd')]){if(_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xe')]===0x1f4){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x344e04(_0x37d4d8[_0xfa74('0xd')]['message']);}logger[_0xfa74('0xd')](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x287921(_0x37d4d8[_0xfa74('0xd')]['message']);}else{logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,_0xfa74('0x10'));_0x287921(_0x37d4d8[_0xfa74('0x11')][_0xfa74('0xf')]);}})[_0xfa74('0x12')](function(_0x3b9e32){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x3b9e32);_0x344e04(_0x3b9e32);});});}
\ No newline at end of file
index 83c8ae1..443bef5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd513=['../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','show','post','put','/:id','delete','destroy','multer','path','Router','fs-extra'];(function(_0x2fac1c,_0x3adafc){var _0x3f05b0=function(_0x2b87e0){while(--_0x2b87e0){_0x2fac1c['push'](_0x2fac1c['shift']());}};_0x3f05b0(++_0x3adafc);}(_0xd513,0x1a0));var _0x3d51=function(_0x143b72,_0x596187){_0x143b72=_0x143b72-0x0;var _0x1a2077=_0xd513[_0x143b72];return _0x1a2077;};'use strict';var multer=require(_0x3d51('0x0'));var util=require('util');var path=require(_0x3d51('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3d51('0x2')]();var fs_extra=require(_0x3d51('0x3'));var auth=require(_0x3d51('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3d51('0x5'));var controller=require(_0x3d51('0x6'));router[_0x3d51('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3d51('0x7')]('/:id',auth[_0x3d51('0x8')](),controller[_0x3d51('0x9')]);router[_0x3d51('0xa')]('/',auth[_0x3d51('0x8')](),controller['create']);router[_0x3d51('0xb')](_0x3d51('0xc'),auth[_0x3d51('0x8')](),controller['update']);router[_0x3d51('0xd')](_0x3d51('0xc'),auth[_0x3d51('0x8')](),controller[_0x3d51('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xadf2=['post','put','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show'];(function(_0x533676,_0x2be01c){var _0x32f7bd=function(_0x5b28fd){while(--_0x5b28fd){_0x533676['push'](_0x533676['shift']());}};_0x32f7bd(++_0x2be01c);}(_0xadf2,0x8c));var _0x2adf=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xadf2[_0x29d94e];return _0x106237;};'use strict';var multer=require(_0x2adf('0x0'));var util=require(_0x2adf('0x1'));var path=require('path');var timeout=require(_0x2adf('0x2'));var express=require(_0x2adf('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2adf('0x4'));var interaction=require(_0x2adf('0x5'));var config=require(_0x2adf('0x6'));var controller=require(_0x2adf('0x7'));router[_0x2adf('0x8')]('/',auth[_0x2adf('0x9')](),controller[_0x2adf('0xa')]);router[_0x2adf('0x8')](_0x2adf('0xb'),auth[_0x2adf('0x9')](),controller[_0x2adf('0xc')]);router[_0x2adf('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2adf('0xe')](_0x2adf('0xb'),auth[_0x2adf('0x9')](),controller['update']);router[_0x2adf('0xf')](_0x2adf('0xb'),auth[_0x2adf('0x9')](),controller['destroy']);module[_0x2adf('0x10')]=router;
\ No newline at end of file
index 3cbd155..707c765 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5527=['BOOLEAN','exports','STRING'];(function(_0x3ea389,_0x13353e){var _0x3229c5=function(_0x486f7c){while(--_0x486f7c){_0x3ea389['push'](_0x3ea389['shift']());}};_0x3229c5(++_0x13353e);}(_0x5527,0x1c6));var _0x7552=function(_0x161cc5,_0x82e7b5){_0x161cc5=_0x161cc5-0x0;var _0x307366=_0x5527[_0x161cc5];return _0x307366;};'use strict';var Sequelize=require('sequelize');module[_0x7552('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x7552('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7552('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x099f=['sequelize','STRING','BOOLEAN'];(function(_0x593fcb,_0x574700){var _0x51b042=function(_0x576e59){while(--_0x576e59){_0x593fcb['push'](_0x593fcb['shift']());}};_0x51b042(++_0x574700);}(_0x099f,0x1d7));var _0xf099=function(_0x1c1d32,_0x3aa8d4){_0x1c1d32=_0x1c1d32-0x0;var _0x1c0737=_0x099f[_0x1c1d32];return _0x1c0737;};'use strict';var Sequelize=require(_0xf099('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xf099('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf099('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 49e470c..78ce159 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12cc=['nolimit','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','params','keys','include','options','find','catch','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','render','Reload','chan_sip.so','root','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Contexts','UserProfileResource','destroy','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x294a2c,_0x4b6f00){var _0x2705a8=function(_0x47f91b){while(--_0x47f91b){_0x294a2c['push'](_0x294a2c['shift']());}};_0x2705a8(++_0x4b6f00);}(_0x12cc,0xf2));var _0xc12c=function(_0x3c66d2,_0x411cb1){_0x3c66d2=_0x3c66d2-0x0;var _0x4400fb=_0x12cc[_0x3c66d2];return _0x4400fb;};'use strict';var emlformat=require(_0xc12c('0x0'));var rimraf=require(_0xc12c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc12c('0x2'));var rp=require(_0xc12c('0x3'));var moment=require(_0xc12c('0x4'));var BPromise=require(_0xc12c('0x5'));var Mustache=require(_0xc12c('0x6'));var util=require(_0xc12c('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc12c('0x8'));var fs=require('fs');var fs_extra=require(_0xc12c('0x9'));var _=require(_0xc12c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc12c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc12c('0xc'));var querystring=require(_0xc12c('0xd'));var Papa=require(_0xc12c('0xe'));var Redis=require(_0xc12c('0xf'));var authService=require(_0xc12c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc12c('0x11'));var logger=require(_0xc12c('0x12'))(_0xc12c('0x13'));var utils=require(_0xc12c('0x14'));var config=require(_0xc12c('0x15'));var licenseUtil=require(_0xc12c('0x16'));var db=require(_0xc12c('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc12c('0x18')][_0xc12c('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x304914,_0x46ed96,_0x3a7c96,_0x2d0a28){return new BPromise(function(_0xe37271,_0x4bdadb){var _0x1e98a6=_0x2d0a28||client;return _0x1e98a6[_0xc12c('0x1a')](_0x304914,_0x3a7c96)[_0xc12c('0x1b')](function(_0x2854a8){logger[_0xc12c('0x1c')](_0xc12c('0x1d'),_0x46ed96,_0xc12c('0x1e'));logger[_0xc12c('0x1f')](_0xc12c('0x20'),_0x46ed96,_0xc12c('0x1e'),JSON['stringify'](_0x2854a8));if(_0x2854a8[_0xc12c('0x21')]){if(_0x2854a8[_0xc12c('0x21')][_0xc12c('0x22')]===0x1f4){logger[_0xc12c('0x21')]('VoiceContext,\x20%s,\x20%s',_0x46ed96,_0x2854a8['error'][_0xc12c('0x23')]);return _0x4bdadb(_0x2854a8[_0xc12c('0x21')]['message']);}logger[_0xc12c('0x21')]('VoiceContext,\x20%s,\x20%s',_0x46ed96,_0x2854a8[_0xc12c('0x21')]['message']);return _0xe37271(_0x2854a8['error']['message']);}else{logger[_0xc12c('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x46ed96,_0xc12c('0x1e'));_0xe37271(_0x2854a8[_0xc12c('0x24')][_0xc12c('0x23')]);}})['catch'](function(_0x1f887c){logger[_0xc12c('0x21')](_0xc12c('0x1d'),_0x46ed96,_0x1f887c);_0x4bdadb(_0x1f887c);});});}function respondWithStatusCode(_0x57c7c8,_0x52ac51){_0x52ac51=_0x52ac51||0xcc;return function(_0x4fa3f7){if(_0x4fa3f7){return _0x57c7c8[_0xc12c('0x25')](_0x52ac51);}return _0x57c7c8[_0xc12c('0x26')](_0x52ac51)[_0xc12c('0x27')]();};}function respondWithResult(_0x333142,_0x29c709){_0x29c709=_0x29c709||0xc8;return function(_0x149eac){if(_0x149eac){return _0x333142['status'](_0x29c709)[_0xc12c('0x28')](_0x149eac);}};}function respondWithFilteredResult(_0x10f73,_0x157ecb){return function(_0x138337){if(_0x138337){var _0x12597d=typeof _0x157ecb[_0xc12c('0x29')]===_0xc12c('0x2a')&&typeof _0x157ecb[_0xc12c('0x2b')]===_0xc12c('0x2a');var _0x2e63e3=_0x138337[_0xc12c('0x2c')];var _0x396478=_0x12597d?0x0:_0x157ecb[_0xc12c('0x29')];var _0x4f6aeb=_0x12597d?_0x138337['count']:_0x157ecb[_0xc12c('0x29')]+_0x157ecb['limit'];var _0x2eb46f;if(_0x4f6aeb>=_0x2e63e3){_0x4f6aeb=_0x2e63e3;_0x2eb46f=0xc8;}else{_0x2eb46f=0xce;}_0x10f73['status'](_0x2eb46f);return _0x10f73[_0xc12c('0x2d')](_0xc12c('0x2e'),_0x396478+'-'+_0x4f6aeb+'/'+_0x2e63e3)['json'](_0x138337);}return null;};}function patchUpdates(_0x11a4e4){return function(_0x299589){try{jsonpatch[_0xc12c('0x2f')](_0x299589,_0x11a4e4,!![]);}catch(_0x24f0b8){return BPromise[_0xc12c('0x30')](_0x24f0b8);}return _0x299589[_0xc12c('0x31')]();};}function saveUpdates(_0x19d62b,_0x56058e){return function(_0x4b9caf){if(_0x4b9caf){return _0x4b9caf[_0xc12c('0x32')](_0x19d62b)[_0xc12c('0x1b')](function(_0x4ca0ca){return _0x4ca0ca;});}return null;};}function removeEntity(_0x272b2f,_0x333448){return function(_0x14c8a9){if(_0x14c8a9){return _0x14c8a9['destroy']()[_0xc12c('0x1b')](function(){var _0x1aede5=_0x14c8a9[_0xc12c('0x33')]({'plain':!![]});var _0x2081d8=_0xc12c('0x34');return db[_0xc12c('0x35')][_0xc12c('0x36')]({'where':{'type':_0x2081d8,'resourceId':_0x1aede5['id']}})[_0xc12c('0x1b')](function(){return _0x14c8a9;});})[_0xc12c('0x1b')](function(){_0x272b2f[_0xc12c('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3adf55,_0x307e88){return function(_0x5e9e6d){if(!_0x5e9e6d){_0x3adf55['sendStatus'](0x194);}return _0x5e9e6d;};}function handleError(_0x3c549d,_0x4f7c2a){_0x4f7c2a=_0x4f7c2a||0x1f4;return function(_0x387e40){logger['error'](_0x387e40[_0xc12c('0x37')]);if(_0x387e40[_0xc12c('0x38')]){delete _0x387e40['name'];}_0x3c549d[_0xc12c('0x26')](_0x4f7c2a)[_0xc12c('0x39')](_0x387e40);};}exports[_0xc12c('0x3a')]=function(_0x3cac94,_0x4d2e0c){var _0x2ea4a1={},_0x1a841e={},_0x17f0c6={'count':0x0,'rows':[]};var _0x37e61a=_[_0xc12c('0x3b')](db[_0xc12c('0x3c')][_0xc12c('0x3d')],function(_0x489c36){return{'name':_0x489c36[_0xc12c('0x3e')],'type':_0x489c36[_0xc12c('0x3f')][_0xc12c('0x40')]};});_0x1a841e[_0xc12c('0x41')]=_['map'](_0x37e61a,_0xc12c('0x38'));_0x1a841e[_0xc12c('0x42')]=_['keys'](_0x3cac94[_0xc12c('0x42')]);_0x1a841e[_0xc12c('0x43')]=_[_0xc12c('0x44')](_0x1a841e[_0xc12c('0x41')],_0x1a841e[_0xc12c('0x42')]);_0x2ea4a1[_0xc12c('0x45')]=_['intersection'](_0x1a841e[_0xc12c('0x41')],qs[_0xc12c('0x46')](_0x3cac94[_0xc12c('0x42')][_0xc12c('0x46')]));_0x2ea4a1[_0xc12c('0x45')]=_0x2ea4a1['attributes'][_0xc12c('0x47')]?_0x2ea4a1['attributes']:_0x1a841e[_0xc12c('0x41')];if(!_0x3cac94[_0xc12c('0x42')][_0xc12c('0x48')](_0xc12c('0x49'))){_0x2ea4a1[_0xc12c('0x2b')]=qs[_0xc12c('0x2b')](_0x3cac94[_0xc12c('0x42')][_0xc12c('0x2b')]);_0x2ea4a1[_0xc12c('0x29')]=qs[_0xc12c('0x29')](_0x3cac94[_0xc12c('0x42')][_0xc12c('0x29')]);}_0x2ea4a1['order']=qs[_0xc12c('0x4a')](_0x3cac94['query'][_0xc12c('0x4a')]);_0x2ea4a1[_0xc12c('0x4b')]=qs[_0xc12c('0x43')](_['pick'](_0x3cac94[_0xc12c('0x42')],_0x1a841e['filters']),_0x37e61a);if(_0x3cac94[_0xc12c('0x42')][_0xc12c('0x4c')]){_0x2ea4a1[_0xc12c('0x4b')]=_['merge'](_0x2ea4a1['where'],{'$or':_[_0xc12c('0x3b')](_0x37e61a,function(_0x3ecf09){if(_0x3ecf09[_0xc12c('0x3f')]!==_0xc12c('0x4d')){var _0x5de382={};_0x5de382[_0x3ecf09[_0xc12c('0x38')]]={'$like':'%'+_0x3cac94[_0xc12c('0x42')][_0xc12c('0x4c')]+'%'};return _0x5de382;}})});}_0x2ea4a1=_[_0xc12c('0x4e')]({},_0x2ea4a1,_0x3cac94['options']);var _0x2fa7c2={'where':_0x2ea4a1[_0xc12c('0x4b')]};return db[_0xc12c('0x3c')]['count'](_0x2fa7c2)['then'](function(_0x19b219){_0x17f0c6[_0xc12c('0x2c')]=_0x19b219;if(_0x3cac94[_0xc12c('0x42')][_0xc12c('0x4f')]){_0x2ea4a1['include']=[{'all':!![]}];}return db[_0xc12c('0x3c')][_0xc12c('0x50')](_0x2ea4a1);})[_0xc12c('0x1b')](function(_0xa8149e){_0x17f0c6[_0xc12c('0x51')]=_0xa8149e;return _0x17f0c6;})[_0xc12c('0x1b')](respondWithFilteredResult(_0x4d2e0c,_0x2ea4a1))['catch'](handleError(_0x4d2e0c,null));};exports['show']=function(_0x8e58aa,_0x7927ac){var _0x28af3d={'raw':![],'where':{'id':_0x8e58aa[_0xc12c('0x52')]['id']}},_0x2aa5f1={};_0x2aa5f1['model']=_[_0xc12c('0x53')](db[_0xc12c('0x3c')][_0xc12c('0x3d')]);_0x2aa5f1[_0xc12c('0x42')]=_['keys'](_0x8e58aa[_0xc12c('0x42')]);_0x2aa5f1[_0xc12c('0x43')]=_['intersection'](_0x2aa5f1[_0xc12c('0x41')],_0x2aa5f1[_0xc12c('0x42')]);_0x28af3d[_0xc12c('0x45')]=_[_0xc12c('0x44')](_0x2aa5f1[_0xc12c('0x41')],qs[_0xc12c('0x46')](_0x8e58aa['query'][_0xc12c('0x46')]));_0x28af3d['attributes']=_0x28af3d[_0xc12c('0x45')]['length']?_0x28af3d[_0xc12c('0x45')]:_0x2aa5f1[_0xc12c('0x41')];if(_0x8e58aa[_0xc12c('0x42')][_0xc12c('0x4f')]){_0x28af3d[_0xc12c('0x54')]=[{'all':!![]}];}_0x28af3d=_[_0xc12c('0x4e')]({},_0x28af3d,_0x8e58aa[_0xc12c('0x55')]);return db[_0xc12c('0x3c')][_0xc12c('0x56')](_0x28af3d)['then'](handleEntityNotFound(_0x7927ac,null))[_0xc12c('0x1b')](respondWithResult(_0x7927ac,null))[_0xc12c('0x57')](handleError(_0x7927ac,null));};exports[_0xc12c('0x58')]=function(_0x4cbfe4,_0x55c1ae,_0x368a5e){var _0x56bbe5;return db['VoiceContext'][_0xc12c('0x58')](_0x4cbfe4[_0xc12c('0x59')],{'raw':!![]})['then'](function(_0x2576e2){_0x56bbe5=_0x2576e2;return db[_0xc12c('0x3c')][_0xc12c('0x50')]({'raw':!![]});})[_0xc12c('0x1b')](function(_0x480dbb){var _0x11c31e=fs[_0xc12c('0x5a')](path[_0xc12c('0x5b')](config['root'],_0xc12c('0x5c')),_0xc12c('0x5d'));var _0xf6f99f=ejs['render'](_0x11c31e,{'contexts':_0x480dbb||[]});fs[_0xc12c('0x5e')](_0xc12c('0x5f'),_0xf6f99f);})[_0xc12c('0x1b')](function(){return respondWithRpcPromise('Reload',_0xc12c('0x58'),{'module':'chan_sip.so'});})[_0xc12c('0x1b')](function(){var _0xefdcf8=_0x4cbfe4[_0xc12c('0x60')][_0xc12c('0x33')]({'plain':!![]});if(!_0xefdcf8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xefdcf8[_0xc12c('0x61')]===_0xc12c('0x60')){var _0x57322c=_0x56bbe5[_0xc12c('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xc12c('0x56')]({'where':{'name':'Contexts','userProfileId':_0xefdcf8[_0xc12c('0x62')]},'raw':!![]})[_0xc12c('0x1b')](function(_0x133cfe){if(_0x133cfe&&_0x133cfe[_0xc12c('0x63')]===0x0){return db[_0xc12c('0x35')]['create']({'name':_0x57322c[_0xc12c('0x38')],'resourceId':_0x57322c['id'],'type':_0x133cfe['name'],'sectionId':_0x133cfe['id']},{})['then'](function(){return _0x56bbe5;});}else{return _0x56bbe5;}})[_0xc12c('0x57')](function(_0x48bc3c){logger[_0xc12c('0x21')](_0xc12c('0x64'),_0x48bc3c);throw _0x48bc3c;});}return _0x56bbe5;})[_0xc12c('0x1b')](respondWithResult(_0x55c1ae,0xc9))[_0xc12c('0x57')](handleError(_0x55c1ae,null));};exports[_0xc12c('0x32')]=function(_0x5bbec5,_0x22e580,_0x369b41){var _0x29b4c4;return db['VoiceContext'][_0xc12c('0x56')]({'where':{'id':_0x5bbec5[_0xc12c('0x52')]['id']}})['then'](handleEntityNotFound(_0x22e580,null))[_0xc12c('0x1b')](saveUpdates(_0x5bbec5[_0xc12c('0x59')],null))['then'](function(_0x3e4df3){if(_0x3e4df3){_0x29b4c4=_0x3e4df3;return db[_0xc12c('0x3c')][_0xc12c('0x50')]({'raw':!![]});}})[_0xc12c('0x1b')](function(_0x59348b){var _0x528e72=fs[_0xc12c('0x5a')](path[_0xc12c('0x5b')](config['root'],_0xc12c('0x5c')),'utf8');var _0x5490d1=ejs[_0xc12c('0x65')](_0x528e72,{'contexts':_0x59348b||[]});fs['writeFileSync'](_0xc12c('0x5f'),_0x5490d1);})[_0xc12c('0x1b')](function(){return respondWithRpcPromise(_0xc12c('0x66'),_0xc12c('0x32'),{'module':_0xc12c('0x67')});})['then'](function(){return _0x29b4c4;})['then'](respondWithResult(_0x22e580,null))[_0xc12c('0x57')](handleError(_0x22e580,null));};exports['destroy']=function(_0x5aa878,_0x371e38,_0xb562ee){var _0x28366e;return db[_0xc12c('0x3c')][_0xc12c('0x56')]({'where':{'id':_0x5aa878['params']['id']}})[_0xc12c('0x1b')](handleEntityNotFound(_0x371e38,null))['then'](removeEntity(_0x371e38,null))[_0xc12c('0x1b')](function(){return db[_0xc12c('0x3c')][_0xc12c('0x50')]({'raw':!![]});})['then'](function(_0x31f00a){var _0x598fce=fs[_0xc12c('0x5a')](path[_0xc12c('0x5b')](config[_0xc12c('0x68')],_0xc12c('0x5c')),'utf8');var _0x5d561c=ejs['render'](_0x598fce,{'contexts':_0x31f00a});fs['writeFileSync'](_0xc12c('0x5f'),_0x5d561c);return respondWithRpcPromise(_0xc12c('0x66'),'destroy',{'module':_0xc12c('0x67')});})['catch'](handleError(_0x371e38,null));};
\ No newline at end of file
+var _0x5a17=['UserProfileSection','params','readFileSync','root','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','map','VoiceContext','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','merge','find','create','body','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x5a17,0x140));var _0x75a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a17[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x75a1('0x0'));var rimraf=require(_0x75a1('0x1'));var zipdir=require(_0x75a1('0x2'));var jsonpatch=require(_0x75a1('0x3'));var rp=require(_0x75a1('0x4'));var moment=require(_0x75a1('0x5'));var BPromise=require(_0x75a1('0x6'));var Mustache=require(_0x75a1('0x7'));var util=require(_0x75a1('0x8'));var path=require(_0x75a1('0x9'));var sox=require(_0x75a1('0xa'));var csv=require('to-csv');var ejs=require(_0x75a1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x75a1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x75a1('0xd'));var toCsv=require(_0x75a1('0xe'));var querystring=require(_0x75a1('0xf'));var Papa=require(_0x75a1('0x10'));var Redis=require(_0x75a1('0x11'));var authService=require(_0x75a1('0x12'));var qs=require(_0x75a1('0x13'));var as=require(_0x75a1('0x14'));var hardwareService=require(_0x75a1('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x75a1('0x16'));var licenseUtil=require(_0x75a1('0x17'));var db=require(_0x75a1('0x18'))['db'];var jayson=require(_0x75a1('0x19'));var client=jayson[_0x75a1('0x1a')][_0x75a1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x206e25,_0x479bf6,_0x46aa3d,_0xe116ca){return new BPromise(function(_0x4ff227,_0x509c68){var _0x4035aa=_0xe116ca||client;return _0x4035aa[_0x75a1('0x1c')](_0x206e25,_0x46aa3d)[_0x75a1('0x1d')](function(_0x1a65e8){logger[_0x75a1('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x479bf6,_0x75a1('0x1f'));logger[_0x75a1('0x20')](_0x75a1('0x21'),_0x479bf6,'request\x20sent',JSON[_0x75a1('0x22')](_0x1a65e8));if(_0x1a65e8[_0x75a1('0x23')]){if(_0x1a65e8[_0x75a1('0x23')]['code']===0x1f4){logger[_0x75a1('0x23')](_0x75a1('0x24'),_0x479bf6,_0x1a65e8[_0x75a1('0x23')][_0x75a1('0x25')]);return _0x509c68(_0x1a65e8[_0x75a1('0x23')][_0x75a1('0x25')]);}logger[_0x75a1('0x23')](_0x75a1('0x24'),_0x479bf6,_0x1a65e8[_0x75a1('0x23')]['message']);return _0x4ff227(_0x1a65e8[_0x75a1('0x23')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x479bf6,_0x75a1('0x1f'));_0x4ff227(_0x1a65e8[_0x75a1('0x26')][_0x75a1('0x25')]);}})['catch'](function(_0x53f374){logger[_0x75a1('0x23')](_0x75a1('0x24'),_0x479bf6,_0x53f374);_0x509c68(_0x53f374);});});}function respondWithStatusCode(_0x3d10b3,_0x3ffb6c){_0x3ffb6c=_0x3ffb6c||0xcc;return function(_0x2aa5f6){if(_0x2aa5f6){return _0x3d10b3[_0x75a1('0x27')](_0x3ffb6c);}return _0x3d10b3[_0x75a1('0x28')](_0x3ffb6c)[_0x75a1('0x29')]();};}function respondWithResult(_0x177459,_0x16a891){_0x16a891=_0x16a891||0xc8;return function(_0x4aaf29){if(_0x4aaf29){return _0x177459['status'](_0x16a891)['json'](_0x4aaf29);}};}function respondWithFilteredResult(_0x129c84,_0x2593d5){return function(_0x5cf505){if(_0x5cf505){var _0x100baf=typeof _0x2593d5[_0x75a1('0x2a')]===_0x75a1('0x2b')&&typeof _0x2593d5[_0x75a1('0x2c')]===_0x75a1('0x2b');var _0x1c5cde=_0x5cf505[_0x75a1('0x2d')];var _0x3d3102=_0x100baf?0x0:_0x2593d5[_0x75a1('0x2a')];var _0xa0b7ea=_0x100baf?_0x5cf505['count']:_0x2593d5[_0x75a1('0x2a')]+_0x2593d5[_0x75a1('0x2c')];var _0x20d393;if(_0xa0b7ea>=_0x1c5cde){_0xa0b7ea=_0x1c5cde;_0x20d393=0xc8;}else{_0x20d393=0xce;}_0x129c84[_0x75a1('0x28')](_0x20d393);return _0x129c84[_0x75a1('0x2e')](_0x75a1('0x2f'),_0x3d3102+'-'+_0xa0b7ea+'/'+_0x1c5cde)[_0x75a1('0x30')](_0x5cf505);}return null;};}function patchUpdates(_0x302a17){return function(_0x42145f){try{jsonpatch['apply'](_0x42145f,_0x302a17,!![]);}catch(_0xdaa228){return BPromise['reject'](_0xdaa228);}return _0x42145f[_0x75a1('0x31')]();};}function saveUpdates(_0x5a4c01,_0x350e3f){return function(_0x563979){if(_0x563979){return _0x563979[_0x75a1('0x32')](_0x5a4c01)[_0x75a1('0x1d')](function(_0x587928){return _0x587928;});}return null;};}function removeEntity(_0x35820b,_0x1d023e){return function(_0x400d65){if(_0x400d65){return _0x400d65[_0x75a1('0x33')]()['then'](function(){var _0x2f2cf0=_0x400d65[_0x75a1('0x34')]({'plain':!![]});var _0x219436=_0x75a1('0x35');return db[_0x75a1('0x36')]['destroy']({'where':{'type':_0x219436,'resourceId':_0x2f2cf0['id']}})[_0x75a1('0x1d')](function(){return _0x400d65;});})[_0x75a1('0x1d')](function(){_0x35820b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x195317,_0x20d27f){return function(_0x1566a0){if(!_0x1566a0){_0x195317[_0x75a1('0x27')](0x194);}return _0x1566a0;};}function handleError(_0x12277f,_0x55170f){_0x55170f=_0x55170f||0x1f4;return function(_0x1a413f){logger['error'](_0x1a413f[_0x75a1('0x37')]);if(_0x1a413f[_0x75a1('0x38')]){delete _0x1a413f[_0x75a1('0x38')];}_0x12277f[_0x75a1('0x28')](_0x55170f)[_0x75a1('0x39')](_0x1a413f);};}exports['index']=function(_0x37a531,_0x5ce9b3){var _0x5dcf98={},_0x33486b={},_0xf451c={'count':0x0,'rows':[]};var _0x157cb4=_[_0x75a1('0x3a')](db[_0x75a1('0x3b')]['rawAttributes'],function(_0x46c2de){return{'name':_0x46c2de[_0x75a1('0x3c')],'type':_0x46c2de[_0x75a1('0x3d')][_0x75a1('0x3e')]};});_0x33486b[_0x75a1('0x3f')]=_[_0x75a1('0x3a')](_0x157cb4,'name');_0x33486b[_0x75a1('0x40')]=_[_0x75a1('0x41')](_0x37a531[_0x75a1('0x40')]);_0x33486b[_0x75a1('0x42')]=_[_0x75a1('0x43')](_0x33486b[_0x75a1('0x3f')],_0x33486b[_0x75a1('0x40')]);_0x5dcf98[_0x75a1('0x44')]=_[_0x75a1('0x43')](_0x33486b[_0x75a1('0x3f')],qs[_0x75a1('0x45')](_0x37a531[_0x75a1('0x40')][_0x75a1('0x45')]));_0x5dcf98[_0x75a1('0x44')]=_0x5dcf98[_0x75a1('0x44')]['length']?_0x5dcf98['attributes']:_0x33486b[_0x75a1('0x3f')];if(!_0x37a531[_0x75a1('0x40')][_0x75a1('0x46')](_0x75a1('0x47'))){_0x5dcf98[_0x75a1('0x2c')]=qs[_0x75a1('0x2c')](_0x37a531[_0x75a1('0x40')][_0x75a1('0x2c')]);_0x5dcf98[_0x75a1('0x2a')]=qs[_0x75a1('0x2a')](_0x37a531[_0x75a1('0x40')][_0x75a1('0x2a')]);}_0x5dcf98[_0x75a1('0x48')]=qs[_0x75a1('0x49')](_0x37a531[_0x75a1('0x40')][_0x75a1('0x49')]);_0x5dcf98[_0x75a1('0x4a')]=qs[_0x75a1('0x42')](_[_0x75a1('0x4b')](_0x37a531['query'],_0x33486b[_0x75a1('0x42')]),_0x157cb4);if(_0x37a531[_0x75a1('0x40')][_0x75a1('0x4c')]){_0x5dcf98[_0x75a1('0x4a')]=_['merge'](_0x5dcf98['where'],{'$or':_[_0x75a1('0x3a')](_0x157cb4,function(_0x41654a){if(_0x41654a[_0x75a1('0x3d')]!==_0x75a1('0x4d')){var _0x456d6b={};_0x456d6b[_0x41654a['name']]={'$like':'%'+_0x37a531[_0x75a1('0x40')][_0x75a1('0x4c')]+'%'};return _0x456d6b;}})});}_0x5dcf98=_['merge']({},_0x5dcf98,_0x37a531[_0x75a1('0x4e')]);var _0x3834be={'where':_0x5dcf98['where']};return db[_0x75a1('0x3b')][_0x75a1('0x2d')](_0x3834be)[_0x75a1('0x1d')](function(_0x7f6a00){_0xf451c[_0x75a1('0x2d')]=_0x7f6a00;if(_0x37a531[_0x75a1('0x40')][_0x75a1('0x4f')]){_0x5dcf98[_0x75a1('0x50')]=[{'all':!![]}];}return db[_0x75a1('0x3b')][_0x75a1('0x51')](_0x5dcf98);})[_0x75a1('0x1d')](function(_0x1168c6){_0xf451c[_0x75a1('0x52')]=_0x1168c6;return _0xf451c;})[_0x75a1('0x1d')](respondWithFilteredResult(_0x5ce9b3,_0x5dcf98))[_0x75a1('0x53')](handleError(_0x5ce9b3,null));};exports[_0x75a1('0x54')]=function(_0x5f5921,_0x354565){var _0x49b080={'raw':![],'where':{'id':_0x5f5921['params']['id']}},_0x25c1c4={};_0x25c1c4['model']=_['keys'](db[_0x75a1('0x3b')]['rawAttributes']);_0x25c1c4[_0x75a1('0x40')]=_['keys'](_0x5f5921['query']);_0x25c1c4['filters']=_[_0x75a1('0x43')](_0x25c1c4[_0x75a1('0x3f')],_0x25c1c4[_0x75a1('0x40')]);_0x49b080['attributes']=_[_0x75a1('0x43')](_0x25c1c4['model'],qs[_0x75a1('0x45')](_0x5f5921[_0x75a1('0x40')][_0x75a1('0x45')]));_0x49b080[_0x75a1('0x44')]=_0x49b080[_0x75a1('0x44')][_0x75a1('0x55')]?_0x49b080[_0x75a1('0x44')]:_0x25c1c4[_0x75a1('0x3f')];if(_0x5f5921[_0x75a1('0x40')][_0x75a1('0x4f')]){_0x49b080[_0x75a1('0x50')]=[{'all':!![]}];}_0x49b080=_[_0x75a1('0x56')]({},_0x49b080,_0x5f5921[_0x75a1('0x4e')]);return db['VoiceContext'][_0x75a1('0x57')](_0x49b080)[_0x75a1('0x1d')](handleEntityNotFound(_0x354565,null))[_0x75a1('0x1d')](respondWithResult(_0x354565,null))['catch'](handleError(_0x354565,null));};exports[_0x75a1('0x58')]=function(_0xa1a544,_0x5148f1,_0x27e694){var _0x5421f0;return db[_0x75a1('0x3b')]['create'](_0xa1a544[_0x75a1('0x59')],{'raw':!![]})[_0x75a1('0x1d')](function(_0x362dcb){_0x5421f0=_0x362dcb;return db[_0x75a1('0x3b')][_0x75a1('0x51')]({'raw':!![]});})['then'](function(_0x5324f9){var _0xca2777=fs['readFileSync'](path[_0x75a1('0x5a')](config['root'],_0x75a1('0x5b')),_0x75a1('0x5c'));var _0xb187e0=ejs[_0x75a1('0x5d')](_0xca2777,{'contexts':_0x5324f9||[]});fs[_0x75a1('0x5e')](_0x75a1('0x5f'),_0xb187e0);})[_0x75a1('0x1d')](function(){return respondWithRpcPromise(_0x75a1('0x60'),_0x75a1('0x58'),{'module':'chan_sip.so'});})[_0x75a1('0x1d')](function(){var _0x5bd0e7=_0xa1a544[_0x75a1('0x61')][_0x75a1('0x34')]({'plain':!![]});if(!_0x5bd0e7)throw new Error(_0x75a1('0x62'));if(_0x5bd0e7[_0x75a1('0x63')]===_0x75a1('0x61')){var _0x4857a3=_0x5421f0[_0x75a1('0x34')]({'plain':!![]});return db[_0x75a1('0x64')][_0x75a1('0x57')]({'where':{'name':_0x75a1('0x35'),'userProfileId':_0x5bd0e7['userProfileId']},'raw':!![]})['then'](function(_0x1e1017){if(_0x1e1017&&_0x1e1017['autoAssociation']===0x0){return db[_0x75a1('0x36')][_0x75a1('0x58')]({'name':_0x4857a3[_0x75a1('0x38')],'resourceId':_0x4857a3['id'],'type':_0x1e1017[_0x75a1('0x38')],'sectionId':_0x1e1017['id']},{})[_0x75a1('0x1d')](function(){return _0x5421f0;});}else{return _0x5421f0;}})[_0x75a1('0x53')](function(_0x13b76c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13b76c);throw _0x13b76c;});}return _0x5421f0;})[_0x75a1('0x1d')](respondWithResult(_0x5148f1,0xc9))[_0x75a1('0x53')](handleError(_0x5148f1,null));};exports['update']=function(_0x572307,_0x257fb3,_0x183c94){var _0x250b8a;return db[_0x75a1('0x3b')][_0x75a1('0x57')]({'where':{'id':_0x572307[_0x75a1('0x65')]['id']}})[_0x75a1('0x1d')](handleEntityNotFound(_0x257fb3,null))[_0x75a1('0x1d')](saveUpdates(_0x572307[_0x75a1('0x59')],null))[_0x75a1('0x1d')](function(_0x58ef6b){if(_0x58ef6b){_0x250b8a=_0x58ef6b;return db[_0x75a1('0x3b')]['findAll']({'raw':!![]});}})['then'](function(_0x51ab75){var _0x186836=fs[_0x75a1('0x66')](path[_0x75a1('0x5a')](config[_0x75a1('0x67')],_0x75a1('0x5b')),_0x75a1('0x5c'));var _0x1f244b=ejs[_0x75a1('0x5d')](_0x186836,{'contexts':_0x51ab75||[]});fs[_0x75a1('0x5e')](_0x75a1('0x5f'),_0x1f244b);})['then'](function(){return respondWithRpcPromise(_0x75a1('0x60'),_0x75a1('0x32'),{'module':_0x75a1('0x68')});})[_0x75a1('0x1d')](function(){return _0x250b8a;})[_0x75a1('0x1d')](respondWithResult(_0x257fb3,null))[_0x75a1('0x53')](handleError(_0x257fb3,null));};exports[_0x75a1('0x33')]=function(_0x18366a,_0x16e177,_0x3272db){var _0x857553;return db[_0x75a1('0x3b')][_0x75a1('0x57')]({'where':{'id':_0x18366a[_0x75a1('0x65')]['id']}})[_0x75a1('0x1d')](handleEntityNotFound(_0x16e177,null))[_0x75a1('0x1d')](removeEntity(_0x16e177,null))[_0x75a1('0x1d')](function(){return db[_0x75a1('0x3b')]['findAll']({'raw':!![]});})[_0x75a1('0x1d')](function(_0x4bf192){var _0x2cb5c2=fs[_0x75a1('0x66')](path[_0x75a1('0x5a')](config['root'],'server/files/templates/context.ejs'),_0x75a1('0x5c'));var _0x1bc03a=ejs[_0x75a1('0x5d')](_0x2cb5c2,{'contexts':_0x4bf192});fs['writeFileSync'](_0x75a1('0x5f'),_0x1bc03a);return respondWithRpcPromise('Reload',_0x75a1('0x33'),{'module':_0x75a1('0x68')});})[_0x75a1('0x53')](handleError(_0x16e177,null));};
\ No newline at end of file
index 80156c8..738bb5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa840=['bluebird','path','rimraf','../../config/environment','define','VoiceContext','voice_contexts','util'];(function(_0x7d8211,_0xa0cf7d){var _0x1fcde6=function(_0x4ed435){while(--_0x4ed435){_0x7d8211['push'](_0x7d8211['shift']());}};_0x1fcde6(++_0xa0cf7d);}(_0xa840,0x17f));var _0x0a84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa840[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x0a84('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0a84('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a84('0x2'));var rimraf=require(_0x0a84('0x3'));var config=require(_0x0a84('0x4'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x63187b,_0x2b386b){return _0x63187b[_0x0a84('0x5')](_0x0a84('0x6'),attributes,{'tableName':_0x0a84('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaefd=['request-promise','./voiceContext.attributes','exports','define','voice_contexts','util','api','moment','bluebird'];(function(_0x5286e0,_0x146772){var _0x1bfe73=function(_0x205a08){while(--_0x205a08){_0x5286e0['push'](_0x5286e0['shift']());}};_0x1bfe73(++_0x146772);}(_0xaefd,0xa7));var _0xdaef=function(_0x32a2cf,_0x20b153){_0x32a2cf=_0x32a2cf-0x0;var _0x250e9d=_0xaefd[_0x32a2cf];return _0x250e9d;};'use strict';var _=require('lodash');var util=require(_0xdaef('0x0'));var logger=require('../../config/logger')(_0xdaef('0x1'));var moment=require(_0xdaef('0x2'));var BPromise=require(_0xdaef('0x3'));var rp=require(_0xdaef('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdaef('0x5'));module[_0xdaef('0x6')]=function(_0x1aee9a,_0x15a4b1){return _0x1aee9a[_0xdaef('0x7')]('VoiceContext',attributes,{'tableName':_0xdaef('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bb82a43..9d7f801 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8164=['debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','client','request','then','info','VoiceContext,\x20%s,\x20%s'];(function(_0x3852f3,_0x454a50){var _0x213c77=function(_0xcea39c){while(--_0xcea39c){_0x3852f3['push'](_0x3852f3['shift']());}};_0x213c77(++_0x454a50);}(_0x8164,0x170));var _0x4816=function(_0x2f1ab5,_0x2966be){_0x2f1ab5=_0x2f1ab5-0x0;var _0x5c7e72=_0x8164[_0x2f1ab5];return _0x5c7e72;};'use strict';var _=require(_0x4816('0x0'));var util=require(_0x4816('0x1'));var moment=require(_0x4816('0x2'));var BPromise=require('bluebird');var rs=require(_0x4816('0x3'));var fs=require('fs');var Redis=require(_0x4816('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4816('0x5'));var logger=require('../../config/logger')(_0x4816('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4816('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51ab08,_0x2ddb3b,_0x437b8b){return new BPromise(function(_0x170e7a,_0x383974){return client[_0x4816('0x8')](_0x51ab08,_0x437b8b)[_0x4816('0x9')](function(_0x285cab){logger[_0x4816('0xa')](_0x4816('0xb'),_0x2ddb3b,'request\x20sent');logger[_0x4816('0xc')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x2ddb3b,_0x4816('0xd'),JSON[_0x4816('0xe')](_0x285cab));if(_0x285cab['error']){if(_0x285cab[_0x4816('0xf')]['code']===0x1f4){logger['error'](_0x4816('0xb'),_0x2ddb3b,_0x285cab['error']['message']);return _0x383974(_0x285cab[_0x4816('0xf')]['message']);}logger[_0x4816('0xf')](_0x4816('0xb'),_0x2ddb3b,_0x285cab[_0x4816('0xf')][_0x4816('0x10')]);return _0x170e7a(_0x285cab[_0x4816('0xf')][_0x4816('0x10')]);}else{logger[_0x4816('0xa')](_0x4816('0xb'),_0x2ddb3b,_0x4816('0xd'));_0x170e7a(_0x285cab[_0x4816('0x11')][_0x4816('0x10')]);}})[_0x4816('0x12')](function(_0x6119f){logger[_0x4816('0xf')](_0x4816('0xb'),_0x2ddb3b,_0x6119f);_0x383974(_0x6119f);});});}
\ No newline at end of file
+var _0x0457=['message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x0457,0x11f));var _0x7045=function(_0x5a8bca,_0x675137){_0x5a8bca=_0x5a8bca-0x0;var _0x5a2703=_0x0457[_0x5a8bca];return _0x5a2703;};'use strict';var _=require('lodash');var util=require(_0x7045('0x0'));var moment=require(_0x7045('0x1'));var BPromise=require('bluebird');var rs=require(_0x7045('0x2'));var fs=require('fs');var Redis=require(_0x7045('0x3'));var db=require(_0x7045('0x4'))['db'];var utils=require(_0x7045('0x5'));var logger=require(_0x7045('0x6'))(_0x7045('0x7'));var config=require('../../config/environment');var jayson=require(_0x7045('0x8'));var client=jayson['client'][_0x7045('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x269c32,_0x19fb28,_0xa04551){return new BPromise(function(_0x2f5df8,_0x4042ef){return client['request'](_0x269c32,_0xa04551)['then'](function(_0x251312){logger[_0x7045('0xa')](_0x7045('0xb'),_0x19fb28,_0x7045('0xc'));logger[_0x7045('0xd')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x19fb28,_0x7045('0xc'),JSON[_0x7045('0xe')](_0x251312));if(_0x251312[_0x7045('0xf')]){if(_0x251312[_0x7045('0xf')][_0x7045('0x10')]===0x1f4){logger[_0x7045('0xf')](_0x7045('0xb'),_0x19fb28,_0x251312['error'][_0x7045('0x11')]);return _0x4042ef(_0x251312[_0x7045('0xf')]['message']);}logger['error'](_0x7045('0xb'),_0x19fb28,_0x251312[_0x7045('0xf')]['message']);return _0x2f5df8(_0x251312[_0x7045('0xf')][_0x7045('0x11')]);}else{logger[_0x7045('0xa')](_0x7045('0xb'),_0x19fb28,_0x7045('0xc'));_0x2f5df8(_0x251312['result'][_0x7045('0x11')]);}})[_0x7045('0x12')](function(_0xeb6cfd){logger[_0x7045('0xf')](_0x7045('0xb'),_0x19fb28,_0xeb6cfd);_0x4042ef(_0xeb6cfd);});});}
\ No newline at end of file
index 43f439a..fc01b74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c63=['put','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x53bbe7,_0x3fce94){var _0x11ff14=function(_0x18ed89){while(--_0x18ed89){_0x53bbe7['push'](_0x53bbe7['shift']());}};_0x11ff14(++_0x3fce94);}(_0x4c63,0xf2));var _0x34c6=function(_0x57f764,_0x572608){_0x57f764=_0x57f764-0x0;var _0x36a227=_0x4c63[_0x57f764];return _0x36a227;};'use strict';var multer=require(_0x34c6('0x0'));var util=require('util');var path=require(_0x34c6('0x1'));var timeout=require(_0x34c6('0x2'));var express=require(_0x34c6('0x3'));var router=express[_0x34c6('0x4')]();var fs_extra=require(_0x34c6('0x5'));var auth=require(_0x34c6('0x6'));var interaction=require(_0x34c6('0x7'));var config=require(_0x34c6('0x8'));var controller=require(_0x34c6('0x9'));router[_0x34c6('0xa')]('/',auth[_0x34c6('0xb')](),controller[_0x34c6('0xc')]);router[_0x34c6('0xa')](_0x34c6('0xd'),auth['isAuthenticated'](),controller[_0x34c6('0xe')]);router['get'](_0x34c6('0xf'),auth['isAuthenticated'](),controller[_0x34c6('0x10')]);router['post']('/',auth[_0x34c6('0xb')](),controller[_0x34c6('0x11')]);router[_0x34c6('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x34c6('0xf'),auth[_0x34c6('0xb')](),controller['destroy']);module[_0x34c6('0x13')]=router;
\ No newline at end of file
+var _0x8ba3=['show','post','create','put','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x1c002d,_0x3c00ef){var _0x36d250=function(_0x40bf2f){while(--_0x40bf2f){_0x1c002d['push'](_0x1c002d['shift']());}};_0x36d250(++_0x3c00ef);}(_0x8ba3,0x1bf));var _0x38ba=function(_0x3e7033,_0x79469f){_0x3e7033=_0x3e7033-0x0;var _0x4dff0a=_0x8ba3[_0x3e7033];return _0x4dff0a;};'use strict';var multer=require('multer');var util=require(_0x38ba('0x0'));var path=require('path');var timeout=require(_0x38ba('0x1'));var express=require('express');var router=express[_0x38ba('0x2')]();var fs_extra=require(_0x38ba('0x3'));var auth=require(_0x38ba('0x4'));var interaction=require(_0x38ba('0x5'));var config=require(_0x38ba('0x6'));var controller=require(_0x38ba('0x7'));router['get']('/',auth[_0x38ba('0x8')](),controller[_0x38ba('0x9')]);router[_0x38ba('0xa')]('/describe',auth[_0x38ba('0x8')](),controller[_0x38ba('0xb')]);router[_0x38ba('0xa')](_0x38ba('0xc'),auth[_0x38ba('0x8')](),controller[_0x38ba('0xd')]);router[_0x38ba('0xe')]('/',auth[_0x38ba('0x8')](),controller[_0x38ba('0xf')]);router[_0x38ba('0x10')](_0x38ba('0xc'),auth[_0x38ba('0x8')](),controller[_0x38ba('0x11')]);router[_0x38ba('0x12')](_0x38ba('0xc'),auth[_0x38ba('0x8')](),controller[_0x38ba('0x13')]);module['exports']=router;
\ No newline at end of file
index 02a6de0..0feb9f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x69d4dc,_0x541beb){var _0xd89223=function(_0x4b1d6b){while(--_0x4b1d6b){_0x69d4dc['push'](_0x69d4dc['shift']());}};_0xd89223(++_0x541beb);}(_0x9bde,0xe1));var _0xe9bd=function(_0x17f4e4,_0x5b3b6f){_0x17f4e4=_0x17f4e4-0x0;var _0x368524=_0x9bde[_0x17f4e4];return _0x368524;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe9bd('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'calleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'calleridname':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinename':{'type':Sequelize[_0xe9bd('0x1')]},'language':{'type':Sequelize[_0xe9bd('0x1')]},'accountcode':{'type':Sequelize[_0xe9bd('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe9bd('0x1')]},'priority':{'type':Sequelize[_0xe9bd('0x2')]},'uniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'linkedid':{'type':Sequelize[_0xe9bd('0x1')]},'destchannel':{'type':Sequelize[_0xe9bd('0x1')]},'destchannelstate':{'type':Sequelize[_0xe9bd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridname':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe9bd('0x1')]},'destcontext':{'type':Sequelize[_0xe9bd('0x1')]},'destexten':{'type':Sequelize[_0xe9bd('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'destlinkedid':{'type':Sequelize[_0xe9bd('0x1')]},'dialstring':{'type':Sequelize[_0xe9bd('0x1')]},'dialstatus':{'type':Sequelize[_0xe9bd('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe9bd('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xe9bd('0x1')],'comment':_0xe9bd('0x4')},'routeId':{'type':Sequelize[_0xe9bd('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xe9bd('0x2')]}};
\ No newline at end of file
+var _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x2fa46a,_0x28c267){var _0x29812c=function(_0x2bb6a2){while(--_0x2bb6a2){_0x2fa46a['push'](_0x2fa46a['shift']());}};_0x29812c(++_0x28c267);}(_0x008c,0x188));var _0xc008=function(_0x2673bb,_0x292576){_0x2673bb=_0x2673bb-0x0;var _0x3edc1c=_0x008c[_0x2673bb];return _0x3edc1c;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}};
\ No newline at end of file
index 8b54434..933fd7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38e5=['limit','count','set','Content-Range','apply','update','destroy','sendStatus','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','sort','filter','merge','VIRTUAL','options','where','then','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined'];(function(_0xe9f40f,_0x336b47){var _0xeaff12=function(_0x2c6527){while(--_0x2c6527){_0xe9f40f['push'](_0xe9f40f['shift']());}};_0xeaff12(++_0x336b47);}(_0x38e5,0x110));var _0x538e=function(_0x252960,_0xccc97){_0x252960=_0x252960-0x0;var _0x20cdad=_0x38e5[_0x252960];return _0x20cdad;};'use strict';var emlformat=require(_0x538e('0x0'));var rimraf=require(_0x538e('0x1'));var zipdir=require(_0x538e('0x2'));var jsonpatch=require(_0x538e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x538e('0x4'));var Mustache=require(_0x538e('0x5'));var util=require(_0x538e('0x6'));var path=require(_0x538e('0x7'));var sox=require(_0x538e('0x8'));var csv=require(_0x538e('0x9'));var ejs=require(_0x538e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x538e('0xb'));var squel=require('squel');var crypto=require(_0x538e('0xc'));var jsforce=require(_0x538e('0xd'));var deskjs=require(_0x538e('0xe'));var toCsv=require(_0x538e('0x9'));var querystring=require(_0x538e('0xf'));var Papa=require(_0x538e('0x10'));var Redis=require(_0x538e('0x11'));var authService=require(_0x538e('0x12'));var qs=require(_0x538e('0x13'));var as=require(_0x538e('0x14'));var hardwareService=require(_0x538e('0x15'));var logger=require(_0x538e('0x16'))(_0x538e('0x17'));var utils=require(_0x538e('0x18'));var config=require(_0x538e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x538e('0x1a'))['db'];function respondWithStatusCode(_0x56a0b2,_0x2fb56c){_0x2fb56c=_0x2fb56c||0xcc;return function(_0x41ee42){if(_0x41ee42){return _0x56a0b2['sendStatus'](_0x2fb56c);}return _0x56a0b2[_0x538e('0x1b')](_0x2fb56c)[_0x538e('0x1c')]();};}function respondWithResult(_0x33a44c,_0x56097c){_0x56097c=_0x56097c||0xc8;return function(_0xa41a0d){if(_0xa41a0d){return _0x33a44c[_0x538e('0x1b')](_0x56097c)[_0x538e('0x1d')](_0xa41a0d);}};}function respondWithFilteredResult(_0x1c204d,_0x1cd45b){return function(_0x5865da){if(_0x5865da){var _0x437073=typeof _0x1cd45b[_0x538e('0x1e')]===_0x538e('0x1f')&&typeof _0x1cd45b[_0x538e('0x20')]==='undefined';var _0x2bd6e6=_0x5865da[_0x538e('0x21')];var _0x38d66d=_0x437073?0x0:_0x1cd45b[_0x538e('0x1e')];var _0xb99b2c=_0x437073?_0x5865da[_0x538e('0x21')]:_0x1cd45b[_0x538e('0x1e')]+_0x1cd45b[_0x538e('0x20')];var _0x5299c8;if(_0xb99b2c>=_0x2bd6e6){_0xb99b2c=_0x2bd6e6;_0x5299c8=0xc8;}else{_0x5299c8=0xce;}_0x1c204d['status'](_0x5299c8);return _0x1c204d[_0x538e('0x22')](_0x538e('0x23'),_0x38d66d+'-'+_0xb99b2c+'/'+_0x2bd6e6)[_0x538e('0x1d')](_0x5865da);}return null;};}function patchUpdates(_0x1c42fc){return function(_0x22ba27){try{jsonpatch[_0x538e('0x24')](_0x22ba27,_0x1c42fc,!![]);}catch(_0x550992){return BPromise['reject'](_0x550992);}return _0x22ba27['save']();};}function saveUpdates(_0xaf928a,_0x5692b2){return function(_0x43741e){if(_0x43741e){return _0x43741e[_0x538e('0x25')](_0xaf928a)['then'](function(_0x48fe29){return _0x48fe29;});}return null;};}function removeEntity(_0x3f76dc,_0x5cbe3a){return function(_0x32e23d){if(_0x32e23d){return _0x32e23d[_0x538e('0x26')]()['then'](function(){_0x3f76dc[_0x538e('0x1b')](0xcc)[_0x538e('0x1c')]();});}};}function handleEntityNotFound(_0x1620a7,_0xa39868){return function(_0x37a52c){if(!_0x37a52c){_0x1620a7[_0x538e('0x27')](0x194);}return _0x37a52c;};}function handleError(_0x2304a1,_0xb3ee9d){_0xb3ee9d=_0xb3ee9d||0x1f4;return function(_0x35db17){logger[_0x538e('0x28')](_0x35db17[_0x538e('0x29')]);if(_0x35db17[_0x538e('0x2a')]){delete _0x35db17[_0x538e('0x2a')];}_0x2304a1[_0x538e('0x1b')](_0xb3ee9d)[_0x538e('0x2b')](_0x35db17);};}exports[_0x538e('0x2c')]=function(_0x39df22,_0xd769f1){var _0x79d949={},_0x37a443={},_0x3682d1={'count':0x0,'rows':[]};var _0x6fce32=_[_0x538e('0x2d')](db[_0x538e('0x2e')][_0x538e('0x2f')],function(_0x1763f4){return{'name':_0x1763f4[_0x538e('0x30')],'type':_0x1763f4[_0x538e('0x31')]['key']};});_0x37a443[_0x538e('0x32')]=_['map'](_0x6fce32,'name');_0x37a443[_0x538e('0x33')]=_[_0x538e('0x34')](_0x39df22[_0x538e('0x33')]);_0x37a443[_0x538e('0x35')]=_[_0x538e('0x36')](_0x37a443['model'],_0x37a443[_0x538e('0x33')]);_0x79d949[_0x538e('0x37')]=_[_0x538e('0x36')](_0x37a443[_0x538e('0x32')],qs[_0x538e('0x38')](_0x39df22['query']['fields']));_0x79d949[_0x538e('0x37')]=_0x79d949[_0x538e('0x37')][_0x538e('0x39')]?_0x79d949['attributes']:_0x37a443[_0x538e('0x32')];if(!_0x39df22[_0x538e('0x33')]['hasOwnProperty']('nolimit')){_0x79d949[_0x538e('0x20')]=qs[_0x538e('0x20')](_0x39df22[_0x538e('0x33')]['limit']);_0x79d949[_0x538e('0x1e')]=qs[_0x538e('0x1e')](_0x39df22[_0x538e('0x33')][_0x538e('0x1e')]);}_0x79d949['order']=qs[_0x538e('0x3a')](_0x39df22['query'][_0x538e('0x3a')]);_0x79d949['where']=qs[_0x538e('0x35')](_['pick'](_0x39df22[_0x538e('0x33')],_0x37a443[_0x538e('0x35')]),_0x6fce32);if(_0x39df22[_0x538e('0x33')][_0x538e('0x3b')]){_0x79d949['where']=_[_0x538e('0x3c')](_0x79d949['where'],{'$or':_[_0x538e('0x2d')](_0x6fce32,function(_0x234225){if(_0x234225[_0x538e('0x31')]!==_0x538e('0x3d')){var _0x31a0f6={};_0x31a0f6[_0x234225[_0x538e('0x2a')]]={'$like':'%'+_0x39df22['query'][_0x538e('0x3b')]+'%'};return _0x31a0f6;}})});}_0x79d949=_[_0x538e('0x3c')]({},_0x79d949,_0x39df22[_0x538e('0x3e')]);var _0x1367e3={'where':_0x79d949[_0x538e('0x3f')]};return db['VoiceDialReport'][_0x538e('0x21')](_0x1367e3)[_0x538e('0x40')](function(_0x14fd71){_0x3682d1['count']=_0x14fd71;if(_0x39df22[_0x538e('0x33')]['includeAll']){_0x79d949[_0x538e('0x41')]=[{'all':!![]}];}return db[_0x538e('0x2e')][_0x538e('0x42')](_0x79d949);})['then'](function(_0x4eaf36){_0x3682d1[_0x538e('0x43')]=_0x4eaf36;return _0x3682d1;})[_0x538e('0x40')](respondWithFilteredResult(_0xd769f1,_0x79d949))[_0x538e('0x44')](handleError(_0xd769f1,null));};exports[_0x538e('0x45')]=function(_0x3c2e0a,_0x2f2c6e){var _0x6ed80c={'raw':!![],'where':{'id':_0x3c2e0a[_0x538e('0x46')]['id']}},_0x580d98={};_0x580d98['model']=_[_0x538e('0x34')](db[_0x538e('0x2e')][_0x538e('0x2f')]);_0x580d98['query']=_[_0x538e('0x34')](_0x3c2e0a[_0x538e('0x33')]);_0x580d98[_0x538e('0x35')]=_['intersection'](_0x580d98[_0x538e('0x32')],_0x580d98[_0x538e('0x33')]);_0x6ed80c['attributes']=_[_0x538e('0x36')](_0x580d98[_0x538e('0x32')],qs[_0x538e('0x38')](_0x3c2e0a[_0x538e('0x33')]['fields']));_0x6ed80c[_0x538e('0x37')]=_0x6ed80c[_0x538e('0x37')][_0x538e('0x39')]?_0x6ed80c[_0x538e('0x37')]:_0x580d98['model'];if(_0x3c2e0a[_0x538e('0x33')][_0x538e('0x47')]){_0x6ed80c['include']=[{'all':!![]}];}_0x6ed80c=_[_0x538e('0x3c')]({},_0x6ed80c,_0x3c2e0a[_0x538e('0x3e')]);return db[_0x538e('0x2e')][_0x538e('0x48')](_0x6ed80c)['then'](handleEntityNotFound(_0x2f2c6e,null))[_0x538e('0x40')](respondWithResult(_0x2f2c6e,null))[_0x538e('0x44')](handleError(_0x2f2c6e,null));};exports[_0x538e('0x49')]=function(_0x518734,_0x45ef0d){return db['VoiceDialReport'][_0x538e('0x49')](_0x518734['body'],{})[_0x538e('0x40')](respondWithResult(_0x45ef0d,0xc9))[_0x538e('0x44')](handleError(_0x45ef0d,null));};exports[_0x538e('0x25')]=function(_0x4e2192,_0x291e3f){if(_0x4e2192[_0x538e('0x4a')]['id']){delete _0x4e2192[_0x538e('0x4a')]['id'];}return db[_0x538e('0x2e')]['find']({'where':{'id':_0x4e2192[_0x538e('0x46')]['id']}})['then'](handleEntityNotFound(_0x291e3f,null))[_0x538e('0x40')](saveUpdates(_0x4e2192[_0x538e('0x4a')],null))['then'](respondWithResult(_0x291e3f,null))['catch'](handleError(_0x291e3f,null));};exports[_0x538e('0x26')]=function(_0x1271f5,_0x1cf1f6){return db['VoiceDialReport'][_0x538e('0x48')]({'where':{'id':_0x1271f5[_0x538e('0x46')]['id']}})['then'](handleEntityNotFound(_0x1cf1f6,null))[_0x538e('0x40')](removeEntity(_0x1cf1f6,null))[_0x538e('0x44')](handleError(_0x1cf1f6,null));};exports[_0x538e('0x4b')]=function(_0x1d54b9,_0x25d8f6){return db[_0x538e('0x2e')][_0x538e('0x4b')]()[_0x538e('0x40')](respondWithResult(_0x25d8f6,null))[_0x538e('0x44')](handleError(_0x25d8f6,null));};
\ No newline at end of file
+var _0xf5d7=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','update','body','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','error','stack','name','map','VoiceDialReport','rawAttributes'];(function(_0x33d1f2,_0x424a27){var _0x233671=function(_0x27ef15){while(--_0x27ef15){_0x33d1f2['push'](_0x33d1f2['shift']());}};_0x233671(++_0x424a27);}(_0xf5d7,0x14c));var _0x7f5d=function(_0x244706,_0x225097){_0x244706=_0x244706-0x0;var _0x286e3e=_0xf5d7[_0x244706];return _0x286e3e;};'use strict';var emlformat=require(_0x7f5d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7f5d('0x1'));var jsonpatch=require(_0x7f5d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7f5d('0x3'));var Mustache=require(_0x7f5d('0x4'));var util=require('util');var path=require(_0x7f5d('0x5'));var sox=require(_0x7f5d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f5d('0x7'));var _=require(_0x7f5d('0x8'));var squel=require(_0x7f5d('0x9'));var crypto=require(_0x7f5d('0xa'));var jsforce=require(_0x7f5d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7f5d('0xc'));var querystring=require(_0x7f5d('0xd'));var Papa=require(_0x7f5d('0xe'));var Redis=require(_0x7f5d('0xf'));var authService=require(_0x7f5d('0x10'));var qs=require(_0x7f5d('0x11'));var as=require(_0x7f5d('0x12'));var hardwareService=require(_0x7f5d('0x13'));var logger=require(_0x7f5d('0x14'))(_0x7f5d('0x15'));var utils=require('../../config/utils');var config=require(_0x7f5d('0x16'));var licenseUtil=require(_0x7f5d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e7544,_0x159972){_0x159972=_0x159972||0xcc;return function(_0x3a5d4a){if(_0x3a5d4a){return _0x4e7544[_0x7f5d('0x18')](_0x159972);}return _0x4e7544['status'](_0x159972)[_0x7f5d('0x19')]();};}function respondWithResult(_0xdca7b3,_0x43e8e0){_0x43e8e0=_0x43e8e0||0xc8;return function(_0x54bce6){if(_0x54bce6){return _0xdca7b3[_0x7f5d('0x1a')](_0x43e8e0)['json'](_0x54bce6);}};}function respondWithFilteredResult(_0x504b46,_0xd3a869){return function(_0xcd25f5){if(_0xcd25f5){var _0x9cdf3b=typeof _0xd3a869[_0x7f5d('0x1b')]===_0x7f5d('0x1c')&&typeof _0xd3a869[_0x7f5d('0x1d')]===_0x7f5d('0x1c');var _0x393391=_0xcd25f5[_0x7f5d('0x1e')];var _0x47e466=_0x9cdf3b?0x0:_0xd3a869['offset'];var _0x3bf9f1=_0x9cdf3b?_0xcd25f5[_0x7f5d('0x1e')]:_0xd3a869[_0x7f5d('0x1b')]+_0xd3a869['limit'];var _0x10aaff;if(_0x3bf9f1>=_0x393391){_0x3bf9f1=_0x393391;_0x10aaff=0xc8;}else{_0x10aaff=0xce;}_0x504b46['status'](_0x10aaff);return _0x504b46[_0x7f5d('0x1f')](_0x7f5d('0x20'),_0x47e466+'-'+_0x3bf9f1+'/'+_0x393391)[_0x7f5d('0x21')](_0xcd25f5);}return null;};}function patchUpdates(_0x1afbe0){return function(_0x185f4f){try{jsonpatch[_0x7f5d('0x22')](_0x185f4f,_0x1afbe0,!![]);}catch(_0x886c7e){return BPromise['reject'](_0x886c7e);}return _0x185f4f[_0x7f5d('0x23')]();};}function saveUpdates(_0x28ea99,_0x3f9697){return function(_0x28c6dc){if(_0x28c6dc){return _0x28c6dc['update'](_0x28ea99)['then'](function(_0x4ea348){return _0x4ea348;});}return null;};}function removeEntity(_0x40b707,_0x59c74b){return function(_0x273796){if(_0x273796){return _0x273796['destroy']()[_0x7f5d('0x24')](function(){_0x40b707[_0x7f5d('0x1a')](0xcc)[_0x7f5d('0x19')]();});}};}function handleEntityNotFound(_0x120e84,_0x5994c4){return function(_0x100a04){if(!_0x100a04){_0x120e84['sendStatus'](0x194);}return _0x100a04;};}function handleError(_0x48a2d4,_0x88ca01){_0x88ca01=_0x88ca01||0x1f4;return function(_0x5678f4){logger[_0x7f5d('0x25')](_0x5678f4[_0x7f5d('0x26')]);if(_0x5678f4[_0x7f5d('0x27')]){delete _0x5678f4[_0x7f5d('0x27')];}_0x48a2d4[_0x7f5d('0x1a')](_0x88ca01)['send'](_0x5678f4);};}exports['index']=function(_0x43e057,_0x3f80f1){var _0x22f4ea={},_0x18dc9c={},_0x1fa114={'count':0x0,'rows':[]};var _0x2d80ff=_[_0x7f5d('0x28')](db[_0x7f5d('0x29')][_0x7f5d('0x2a')],function(_0x469d1f){return{'name':_0x469d1f[_0x7f5d('0x2b')],'type':_0x469d1f[_0x7f5d('0x2c')][_0x7f5d('0x2d')]};});_0x18dc9c[_0x7f5d('0x2e')]=_[_0x7f5d('0x28')](_0x2d80ff,_0x7f5d('0x27'));_0x18dc9c[_0x7f5d('0x2f')]=_[_0x7f5d('0x30')](_0x43e057[_0x7f5d('0x2f')]);_0x18dc9c[_0x7f5d('0x31')]=_[_0x7f5d('0x32')](_0x18dc9c[_0x7f5d('0x2e')],_0x18dc9c[_0x7f5d('0x2f')]);_0x22f4ea[_0x7f5d('0x33')]=_['intersection'](_0x18dc9c[_0x7f5d('0x2e')],qs[_0x7f5d('0x34')](_0x43e057[_0x7f5d('0x2f')][_0x7f5d('0x34')]));_0x22f4ea[_0x7f5d('0x33')]=_0x22f4ea[_0x7f5d('0x33')][_0x7f5d('0x35')]?_0x22f4ea[_0x7f5d('0x33')]:_0x18dc9c[_0x7f5d('0x2e')];if(!_0x43e057[_0x7f5d('0x2f')][_0x7f5d('0x36')](_0x7f5d('0x37'))){_0x22f4ea[_0x7f5d('0x1d')]=qs[_0x7f5d('0x1d')](_0x43e057[_0x7f5d('0x2f')]['limit']);_0x22f4ea[_0x7f5d('0x1b')]=qs[_0x7f5d('0x1b')](_0x43e057[_0x7f5d('0x2f')]['offset']);}_0x22f4ea[_0x7f5d('0x38')]=qs[_0x7f5d('0x39')](_0x43e057['query'][_0x7f5d('0x39')]);_0x22f4ea[_0x7f5d('0x3a')]=qs[_0x7f5d('0x31')](_[_0x7f5d('0x3b')](_0x43e057[_0x7f5d('0x2f')],_0x18dc9c[_0x7f5d('0x31')]),_0x2d80ff);if(_0x43e057[_0x7f5d('0x2f')]['filter']){_0x22f4ea['where']=_[_0x7f5d('0x3c')](_0x22f4ea[_0x7f5d('0x3a')],{'$or':_['map'](_0x2d80ff,function(_0x2bce80){if(_0x2bce80[_0x7f5d('0x2c')]!==_0x7f5d('0x3d')){var _0x3c03e3={};_0x3c03e3[_0x2bce80[_0x7f5d('0x27')]]={'$like':'%'+_0x43e057[_0x7f5d('0x2f')]['filter']+'%'};return _0x3c03e3;}})});}_0x22f4ea=_[_0x7f5d('0x3c')]({},_0x22f4ea,_0x43e057[_0x7f5d('0x3e')]);var _0x16e86a={'where':_0x22f4ea['where']};return db[_0x7f5d('0x29')][_0x7f5d('0x1e')](_0x16e86a)[_0x7f5d('0x24')](function(_0x16adb1){_0x1fa114[_0x7f5d('0x1e')]=_0x16adb1;if(_0x43e057['query'][_0x7f5d('0x3f')]){_0x22f4ea[_0x7f5d('0x40')]=[{'all':!![]}];}return db[_0x7f5d('0x29')][_0x7f5d('0x41')](_0x22f4ea);})[_0x7f5d('0x24')](function(_0x4b45d1){_0x1fa114['rows']=_0x4b45d1;return _0x1fa114;})[_0x7f5d('0x24')](respondWithFilteredResult(_0x3f80f1,_0x22f4ea))[_0x7f5d('0x42')](handleError(_0x3f80f1,null));};exports[_0x7f5d('0x43')]=function(_0x18c7f5,_0x5aedfe){var _0x3462ca={'raw':!![],'where':{'id':_0x18c7f5[_0x7f5d('0x44')]['id']}},_0xddd865={};_0xddd865['model']=_[_0x7f5d('0x30')](db[_0x7f5d('0x29')][_0x7f5d('0x2a')]);_0xddd865[_0x7f5d('0x2f')]=_[_0x7f5d('0x30')](_0x18c7f5['query']);_0xddd865['filters']=_[_0x7f5d('0x32')](_0xddd865[_0x7f5d('0x2e')],_0xddd865[_0x7f5d('0x2f')]);_0x3462ca[_0x7f5d('0x33')]=_[_0x7f5d('0x32')](_0xddd865['model'],qs[_0x7f5d('0x34')](_0x18c7f5[_0x7f5d('0x2f')][_0x7f5d('0x34')]));_0x3462ca[_0x7f5d('0x33')]=_0x3462ca[_0x7f5d('0x33')][_0x7f5d('0x35')]?_0x3462ca[_0x7f5d('0x33')]:_0xddd865[_0x7f5d('0x2e')];if(_0x18c7f5[_0x7f5d('0x2f')][_0x7f5d('0x3f')]){_0x3462ca[_0x7f5d('0x40')]=[{'all':!![]}];}_0x3462ca=_[_0x7f5d('0x3c')]({},_0x3462ca,_0x18c7f5[_0x7f5d('0x3e')]);return db[_0x7f5d('0x29')][_0x7f5d('0x45')](_0x3462ca)['then'](handleEntityNotFound(_0x5aedfe,null))['then'](respondWithResult(_0x5aedfe,null))[_0x7f5d('0x42')](handleError(_0x5aedfe,null));};exports[_0x7f5d('0x46')]=function(_0x11483f,_0xb35a53){return db[_0x7f5d('0x29')][_0x7f5d('0x46')](_0x11483f['body'],{})[_0x7f5d('0x24')](respondWithResult(_0xb35a53,0xc9))[_0x7f5d('0x42')](handleError(_0xb35a53,null));};exports[_0x7f5d('0x47')]=function(_0x1db9de,_0x597695){if(_0x1db9de[_0x7f5d('0x48')]['id']){delete _0x1db9de['body']['id'];}return db[_0x7f5d('0x29')][_0x7f5d('0x45')]({'where':{'id':_0x1db9de[_0x7f5d('0x44')]['id']}})[_0x7f5d('0x24')](handleEntityNotFound(_0x597695,null))[_0x7f5d('0x24')](saveUpdates(_0x1db9de[_0x7f5d('0x48')],null))['then'](respondWithResult(_0x597695,null))[_0x7f5d('0x42')](handleError(_0x597695,null));};exports[_0x7f5d('0x49')]=function(_0x31aa56,_0x534b6b){return db[_0x7f5d('0x29')][_0x7f5d('0x45')]({'where':{'id':_0x31aa56['params']['id']}})[_0x7f5d('0x24')](handleEntityNotFound(_0x534b6b,null))[_0x7f5d('0x24')](removeEntity(_0x534b6b,null))['catch'](handleError(_0x534b6b,null));};exports[_0x7f5d('0x4a')]=function(_0x38da74,_0x33c4bf){return db[_0x7f5d('0x29')][_0x7f5d('0x4a')]()[_0x7f5d('0x24')](respondWithResult(_0x33c4bf,null))[_0x7f5d('0x42')](handleError(_0x33c4bf,null));};
\ No newline at end of file
index 5514602..6b42e2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad47=['path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xad47,0xad));var _0x7ad4=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xad47[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x7ad4('0x0'));var util=require(_0x7ad4('0x1'));var logger=require(_0x7ad4('0x2'))(_0x7ad4('0x3'));var moment=require(_0x7ad4('0x4'));var BPromise=require(_0x7ad4('0x5'));var rp=require(_0x7ad4('0x6'));var fs=require('fs');var path=require(_0x7ad4('0x7'));var rimraf=require(_0x7ad4('0x8'));var config=require(_0x7ad4('0x9'));var attributes=require(_0x7ad4('0xa'));module[_0x7ad4('0xb')]=function(_0x1eb29b,_0x1f969d){return _0x1eb29b['define'](_0x7ad4('0xc'),attributes,{'tableName':_0x7ad4('0xd'),'paranoid':![],'indexes':[{'fields':[_0x7ad4('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x271d=['report_dial','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport'];(function(_0x1610db,_0x4fd6ac){var _0x27e2ac=function(_0x517da6){while(--_0x517da6){_0x1610db['push'](_0x1610db['shift']());}};_0x27e2ac(++_0x4fd6ac);}(_0x271d,0xc4));var _0xd271=function(_0x554594,_0x28f17e){_0x554594=_0x554594-0x0;var _0x2f7fda=_0x271d[_0x554594];return _0x2f7fda;};'use strict';var _=require(_0xd271('0x0'));var util=require(_0xd271('0x1'));var logger=require('../../config/logger')(_0xd271('0x2'));var moment=require('moment');var BPromise=require(_0xd271('0x3'));var rp=require(_0xd271('0x4'));var fs=require('fs');var path=require(_0xd271('0x5'));var rimraf=require(_0xd271('0x6'));var config=require(_0xd271('0x7'));var attributes=require(_0xd271('0x8'));module[_0xd271('0x9')]=function(_0x3a1c19,_0xdcd18c){return _0x3a1c19[_0xd271('0xa')](_0xd271('0xb'),attributes,{'tableName':_0xd271('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 0256d39..38be2b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53c5=['VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','info','stringify','catch','UpdateVoiceDialReport','update','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x36f5b7,_0x1514ca){var _0x495dfb=function(_0xace77){while(--_0xace77){_0x36f5b7['push'](_0x36f5b7['shift']());}};_0x495dfb(++_0x1514ca);}(_0x53c5,0xfc));var _0x553c=function(_0x35c22f,_0x31d91a){_0x35c22f=_0x35c22f-0x0;var _0x1c9b81=_0x53c5[_0x35c22f];return _0x1c9b81;};'use strict';var _=require(_0x553c('0x0'));var util=require(_0x553c('0x1'));var moment=require(_0x553c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x553c('0x3'));var db=require(_0x553c('0x4'))['db'];var utils=require(_0x553c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x553c('0x6'));var jayson=require(_0x553c('0x7'));var client=jayson[_0x553c('0x8')][_0x553c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x88d317,_0x48cdc1,_0x4481ac){return new BPromise(function(_0x2e0636,_0x10b0d9){return client[_0x553c('0xa')](_0x88d317,_0x4481ac)[_0x553c('0xb')](function(_0xb7f6f5){logger['info'](_0x553c('0xc'),_0x48cdc1,_0x553c('0xd'));logger[_0x553c('0xe')](_0x553c('0xf'),_0x48cdc1,_0x553c('0xd'),JSON['stringify'](_0xb7f6f5));if(_0xb7f6f5[_0x553c('0x10')]){if(_0xb7f6f5[_0x553c('0x10')][_0x553c('0x11')]===0x1f4){logger[_0x553c('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x48cdc1,_0xb7f6f5['error'][_0x553c('0x12')]);return _0x10b0d9(_0xb7f6f5[_0x553c('0x10')][_0x553c('0x12')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x48cdc1,_0xb7f6f5[_0x553c('0x10')][_0x553c('0x12')]);return _0x2e0636(_0xb7f6f5['error'][_0x553c('0x12')]);}else{logger['info'](_0x553c('0xc'),_0x48cdc1,_0x553c('0xd'));_0x2e0636(_0xb7f6f5['result'][_0x553c('0x12')]);}})['catch'](function(_0x467ade){logger[_0x553c('0x10')](_0x553c('0xc'),_0x48cdc1,_0x467ade);_0x10b0d9(_0x467ade);});});}exports[_0x553c('0x13')]=function(_0x62c689){var _0x382c4c=this;return new Promise(function(_0x671c7c,_0x587a01){return db[_0x553c('0x14')][_0x553c('0x15')](_0x62c689[_0x553c('0x16')],{'raw':_0x62c689[_0x553c('0x17')]?_0x62c689['options'][_0x553c('0x18')]===undefined?!![]:![]:!![]})[_0x553c('0xb')](function(_0x37e7d8){logger[_0x553c('0x19')](_0x553c('0x13'),_0x62c689);logger[_0x553c('0xe')](_0x553c('0x13'),_0x62c689,JSON[_0x553c('0x1a')](_0x37e7d8));_0x671c7c(_0x37e7d8);})[_0x553c('0x1b')](function(_0x155897){logger['error'](_0x553c('0x13'),_0x155897[_0x553c('0x12')],_0x62c689);_0x587a01(_0x382c4c['error'](0x1f4,_0x155897[_0x553c('0x12')]));});});};exports[_0x553c('0x1c')]=function(_0x1f3727){var _0x3963a7=this;return new Promise(function(_0x3109f1,_0x5d6568){return db[_0x553c('0x14')][_0x553c('0x1d')](_0x1f3727[_0x553c('0x16')],{'raw':_0x1f3727[_0x553c('0x17')]?_0x1f3727[_0x553c('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f3727['options']?_0x1f3727['options'][_0x553c('0x1e')]||null:null,'attributes':_0x1f3727[_0x553c('0x17')]?_0x1f3727[_0x553c('0x17')][_0x553c('0x1f')]||null:null,'limit':_0x1f3727[_0x553c('0x17')]?_0x1f3727['options'][_0x553c('0x20')]||null:null})[_0x553c('0xb')](function(_0x559072){logger[_0x553c('0x19')](_0x553c('0x1c'),_0x1f3727);logger[_0x553c('0xe')](_0x553c('0x1c'),_0x1f3727,JSON[_0x553c('0x1a')](_0x559072));_0x3109f1(_0x559072);})[_0x553c('0x1b')](function(_0x3a37b7){logger[_0x553c('0x10')](_0x553c('0x1c'),_0x3a37b7[_0x553c('0x12')],_0x1f3727);_0x5d6568(_0x3963a7[_0x553c('0x10')](0x1f4,_0x3a37b7[_0x553c('0x12')]));});});};
\ No newline at end of file
+var _0x8687=['info','UpdateVoiceDialReport','VoiceDialReport','raw','where','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','body','options','then'];(function(_0x473ee7,_0x4dd754){var _0x30f0d4=function(_0x4d961d){while(--_0x4d961d){_0x473ee7['push'](_0x473ee7['shift']());}};_0x30f0d4(++_0x4dd754);}(_0x8687,0x15a));var _0x7868=function(_0x360b20,_0x15ce27){_0x360b20=_0x360b20-0x0;var _0x3e7486=_0x8687[_0x360b20];return _0x3e7486;};'use strict';var _=require('lodash');var util=require(_0x7868('0x0'));var moment=require(_0x7868('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7868('0x2'));var db=require(_0x7868('0x3'))['db'];var utils=require(_0x7868('0x4'));var logger=require(_0x7868('0x5'))(_0x7868('0x6'));var config=require(_0x7868('0x7'));var jayson=require(_0x7868('0x8'));var client=jayson[_0x7868('0x9')][_0x7868('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41bcf5,_0x71db39,_0x18ee84){return new BPromise(function(_0x23a0c3,_0x5a6417){return client[_0x7868('0xb')](_0x41bcf5,_0x18ee84)['then'](function(_0x5cf92d){logger['info'](_0x7868('0xc'),_0x71db39,'request\x20sent');logger[_0x7868('0xd')](_0x7868('0xe'),_0x71db39,_0x7868('0xf'),JSON[_0x7868('0x10')](_0x5cf92d));if(_0x5cf92d[_0x7868('0x11')]){if(_0x5cf92d['error'][_0x7868('0x12')]===0x1f4){logger[_0x7868('0x11')](_0x7868('0xc'),_0x71db39,_0x5cf92d[_0x7868('0x11')][_0x7868('0x13')]);return _0x5a6417(_0x5cf92d[_0x7868('0x11')][_0x7868('0x13')]);}logger[_0x7868('0x11')](_0x7868('0xc'),_0x71db39,_0x5cf92d[_0x7868('0x11')]['message']);return _0x23a0c3(_0x5cf92d[_0x7868('0x11')]['message']);}else{logger['info'](_0x7868('0xc'),_0x71db39,_0x7868('0xf'));_0x23a0c3(_0x5cf92d[_0x7868('0x14')][_0x7868('0x13')]);}})[_0x7868('0x15')](function(_0x281676){logger[_0x7868('0x11')](_0x7868('0xc'),_0x71db39,_0x281676);_0x5a6417(_0x281676);});});}exports[_0x7868('0x16')]=function(_0x459bf5){var _0x2954c9=this;return new Promise(function(_0x527f2a,_0x90dc7f){return db['VoiceDialReport']['create'](_0x459bf5[_0x7868('0x17')],{'raw':_0x459bf5['options']?_0x459bf5[_0x7868('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x7868('0x19')](function(_0x147b07){logger[_0x7868('0x1a')](_0x7868('0x16'),_0x459bf5);logger['debug'](_0x7868('0x16'),_0x459bf5,JSON[_0x7868('0x10')](_0x147b07));_0x527f2a(_0x147b07);})[_0x7868('0x15')](function(_0x429be0){logger[_0x7868('0x11')](_0x7868('0x16'),_0x429be0[_0x7868('0x13')],_0x459bf5);_0x90dc7f(_0x2954c9[_0x7868('0x11')](0x1f4,_0x429be0[_0x7868('0x13')]));});});};exports[_0x7868('0x1b')]=function(_0x34be48){var _0x1ceb95=this;return new Promise(function(_0x4425f6,_0x13db40){return db[_0x7868('0x1c')]['update'](_0x34be48['body'],{'raw':_0x34be48[_0x7868('0x18')]?_0x34be48['options'][_0x7868('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34be48[_0x7868('0x18')]?_0x34be48[_0x7868('0x18')][_0x7868('0x1e')]||null:null,'attributes':_0x34be48[_0x7868('0x18')]?_0x34be48[_0x7868('0x18')]['attributes']||null:null,'limit':_0x34be48[_0x7868('0x18')]?_0x34be48[_0x7868('0x18')]['limit']||null:null})[_0x7868('0x19')](function(_0x8be553){logger[_0x7868('0x1a')]('UpdateVoiceDialReport',_0x34be48);logger['debug']('UpdateVoiceDialReport',_0x34be48,JSON[_0x7868('0x10')](_0x8be553));_0x4425f6(_0x8be553);})[_0x7868('0x15')](function(_0x80f2be){logger[_0x7868('0x11')](_0x7868('0x1b'),_0x80f2be[_0x7868('0x13')],_0x34be48);_0x13db40(_0x1ceb95['error'](0x1f4,_0x80f2be[_0x7868('0x13')]));});});};
\ No newline at end of file
index 520ea4f..c37db65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43a9=['post','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4eb8ac,_0x29d9a3){var _0x19eeb0=function(_0xf17b9c){while(--_0xf17b9c){_0x4eb8ac['push'](_0x4eb8ac['shift']());}};_0x19eeb0(++_0x29d9a3);}(_0x43a9,0x94));var _0x943a=function(_0x226576,_0x14fa3a){_0x226576=_0x226576-0x0;var _0x4c15d4=_0x43a9[_0x226576];return _0x4c15d4;};'use strict';var multer=require(_0x943a('0x0'));var util=require('util');var path=require(_0x943a('0x1'));var timeout=require(_0x943a('0x2'));var express=require('express');var router=express[_0x943a('0x3')]();var fs_extra=require(_0x943a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x943a('0x5'));var controller=require(_0x943a('0x6'));router[_0x943a('0x7')]('/',auth[_0x943a('0x8')](),controller[_0x943a('0x9')]);router['get'](_0x943a('0xa'),auth['isAuthenticated'](),controller[_0x943a('0xb')]);router[_0x943a('0xc')]('/',auth[_0x943a('0x8')](),controller['create']);router['post'](_0x943a('0xd'),auth[_0x943a('0x8')](),controller[_0x943a('0xe')]);router[_0x943a('0xf')](_0x943a('0xa'),auth[_0x943a('0x8')](),controller[_0x943a('0x10')]);router[_0x943a('0x11')](_0x943a('0xa'),auth[_0x943a('0x8')](),controller[_0x943a('0x12')]);module[_0x943a('0x13')]=router;
\ No newline at end of file
+var _0xe290=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xe290,0xdd));var _0x0e29=function(_0x19cf7a,_0x1dd21e){_0x19cf7a=_0x19cf7a-0x0;var _0x1a75bb=_0xe290[_0x19cf7a];return _0x1a75bb;};'use strict';var multer=require(_0x0e29('0x0'));var util=require(_0x0e29('0x1'));var path=require(_0x0e29('0x2'));var timeout=require(_0x0e29('0x3'));var express=require(_0x0e29('0x4'));var router=express[_0x0e29('0x5')]();var fs_extra=require(_0x0e29('0x6'));var auth=require(_0x0e29('0x7'));var interaction=require(_0x0e29('0x8'));var config=require(_0x0e29('0x9'));var controller=require(_0x0e29('0xa'));router[_0x0e29('0xb')]('/',auth[_0x0e29('0xc')](),controller[_0x0e29('0xd')]);router['get'](_0x0e29('0xe'),auth[_0x0e29('0xc')](),controller[_0x0e29('0xf')]);router[_0x0e29('0x10')]('/',auth['isAuthenticated'](),controller[_0x0e29('0x11')]);router[_0x0e29('0x10')](_0x0e29('0x12'),auth[_0x0e29('0xc')](),controller['addApplications']);router[_0x0e29('0x13')](_0x0e29('0xe'),auth[_0x0e29('0xc')](),controller[_0x0e29('0x14')]);router[_0x0e29('0x15')](_0x0e29('0xe'),auth['isAuthenticated'](),controller[_0x0e29('0x16')]);module[_0x0e29('0x17')]=router;
\ No newline at end of file
index b5eccdf..1f8ec4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d2e=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','outbound','inbound-fax'];(function(_0x2610db,_0x454344){var _0x5d4d96=function(_0x3794de){while(--_0x3794de){_0x2610db['push'](_0x2610db['shift']());}};_0x5d4d96(++_0x454344);}(_0x7d2e,0xf7));var _0xe7d2=function(_0x214d8c,_0x242dc3){_0x214d8c=_0x214d8c-0x0;var _0x5a5060=_0x7d2e[_0x214d8c];return _0x5a5060;};'use strict';var Sequelize=require(_0xe7d2('0x0'));module[_0xe7d2('0x1')]={'context':{'type':Sequelize[_0xe7d2('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe7d2('0x3')},'priority':{'type':Sequelize[_0xe7d2('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xe7d2('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xe7d2('0x2')],'allowNull':![],'defaultValue':_0xe7d2('0x4')},'appdata':{'type':Sequelize[_0xe7d2('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xe7d2('0x5')]('inbound',_0xe7d2('0x6'),'internal',_0xe7d2('0x7'),'outbound-fax','system','any'),'allowNull':![]},'description':{'type':Sequelize[_0xe7d2('0x2')]},'interval':{'type':Sequelize[_0xe7d2('0x2')],'allowNull':![],'defaultValue':_0xe7d2('0x8')},'IntervalId':{'type':Sequelize[_0xe7d2('0x9')]},'isApp':{'type':Sequelize[_0xe7d2('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xe7d2('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xe7d2('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xe7d2('0x9')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xe7d2('0xb')},'answer':{'type':Sequelize[_0xe7d2('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0xe7d2('0xc')],'get':function(_0x548684){return this[_0xe7d2('0xd')](_0xe7d2('0xe'));}},'alias':{'type':Sequelize[_0xe7d2('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0xdec0=['inbound','outbound','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xdec0,0x119));var _0x0dec=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xdec0[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x0dec('0x0'));module[_0x0dec('0x1')]={'context':{'type':Sequelize[_0x0dec('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x0dec('0x2')],'allowNull':![],'unique':_0x0dec('0x3')},'priority':{'type':Sequelize[_0x0dec('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x0dec('0x3')},'tag':{'type':Sequelize[_0x0dec('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0dec('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x0dec('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0dec('0x4'),_0x0dec('0x5'),'internal','inbound-fax',_0x0dec('0x6'),_0x0dec('0x7'),_0x0dec('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x0dec('0x2')]},'interval':{'type':Sequelize[_0x0dec('0x2')],'allowNull':![],'defaultValue':_0x0dec('0x9')},'IntervalId':{'type':Sequelize[_0x0dec('0xa')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x0dec('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x0dec('0xa')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0dec('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0dec('0xc')],'get':function(_0x50c1e4){return this[_0x0dec('0xd')](_0x0dec('0xe'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 4e1bd99..3615a0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35c1=['../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','map','value','includes','type','name','UserProfileResource','error','stack','send','index','VoiceExtension','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','filter','merge','where','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','cutdigits','mandatoryDisposition','context','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','zip-dir','request-promise','moment','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0xbc2037,_0x6483ab){var _0x36f877=function(_0x25e88d){while(--_0x25e88d){_0xbc2037['push'](_0xbc2037['shift']());}};_0x36f877(++_0x6483ab);}(_0x35c1,0xcc));var _0x135c=function(_0x46496c,_0x289e70){_0x46496c=_0x46496c-0x0;var _0x4f77c8=_0x35c1[_0x46496c];return _0x4f77c8;};'use strict';var emlformat=require(_0x135c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x135c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x135c('0x2'));var moment=require(_0x135c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x135c('0x4'));var sox=require(_0x135c('0x5'));var csv=require('to-csv');var ejs=require(_0x135c('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x135c('0x7'));var squel=require(_0x135c('0x8'));var crypto=require(_0x135c('0x9'));var jsforce=require(_0x135c('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x135c('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x135c('0xc'));var qs=require(_0x135c('0xd'));var as=require(_0x135c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x135c('0xf'))(_0x135c('0x10'));var utils=require(_0x135c('0x11'));var config=require(_0x135c('0x12'));var licenseUtil=require(_0x135c('0x13'));var db=require(_0x135c('0x14'))['db'];config[_0x135c('0x15')]=_['defaults'](config[_0x135c('0x15')],{'host':_0x135c('0x16'),'port':0x18eb});var socket=require(_0x135c('0x17'))(new Redis(config[_0x135c('0x15')]));require('./voiceExtension.socket')[_0x135c('0x18')](socket);function respondWithStatusCode(_0x4c2765,_0x574c6a){_0x574c6a=_0x574c6a||0xcc;return function(_0x1037ef){if(_0x1037ef){return _0x4c2765[_0x135c('0x19')](_0x574c6a);}return _0x4c2765[_0x135c('0x1a')](_0x574c6a)[_0x135c('0x1b')]();};}function respondWithResult(_0x446224,_0x5c504c){_0x5c504c=_0x5c504c||0xc8;return function(_0x30d6c3){if(_0x30d6c3){return _0x446224[_0x135c('0x1a')](_0x5c504c)[_0x135c('0x1c')](_0x30d6c3);}};}function respondWithFilteredResult(_0x5ff385,_0x439933){return function(_0xb4eb32){if(_0xb4eb32){var _0x5e6369=typeof _0x439933[_0x135c('0x1d')]===_0x135c('0x1e')&&typeof _0x439933['limit']==='undefined';var _0xaa1b40=_0xb4eb32[_0x135c('0x1f')];var _0x1d1b75=_0x5e6369?0x0:_0x439933[_0x135c('0x1d')];var _0x3b37aa=_0x5e6369?_0xb4eb32[_0x135c('0x1f')]:_0x439933[_0x135c('0x1d')]+_0x439933['limit'];var _0x4dafce;if(_0x3b37aa>=_0xaa1b40){_0x3b37aa=_0xaa1b40;_0x4dafce=0xc8;}else{_0x4dafce=0xce;}_0x5ff385[_0x135c('0x1a')](_0x4dafce);return _0x5ff385[_0x135c('0x20')](_0x135c('0x21'),_0x1d1b75+'-'+_0x3b37aa+'/'+_0xaa1b40)['json'](_0xb4eb32);}return null;};}function patchUpdates(_0x207281){return function(_0x38258f){try{jsonpatch[_0x135c('0x22')](_0x38258f,_0x207281,!![]);}catch(_0x2b9ef6){return BPromise[_0x135c('0x23')](_0x2b9ef6);}return _0x38258f[_0x135c('0x24')]();};}function saveUpdates(_0x2f5e2c,_0x1b45ab){return function(_0x200329){if(_0x200329){return _0x200329[_0x135c('0x25')](_0x2f5e2c)[_0x135c('0x26')](function(_0x55d8f0){return _0x55d8f0;});}return null;};}function removeEntity(_0x3ff3be,_0x46979c){return function(_0x252b21){if(_0x252b21){return _0x252b21[_0x135c('0x27')]()[_0x135c('0x26')](function(){var _0x1eb808=_0x252b21[_0x135c('0x28')]({'plain':!![]});var _0x143dfe=[{'name':'InboundRoutes','value':_0x135c('0x29'),'ignore':![]},{'name':_0x135c('0x2a'),'value':_0x135c('0x2b'),'ignore':![]},{'name':_0x135c('0x2c'),'value':_0x135c('0x2d'),'ignore':![]}];var _0x97ab6a=_(_0x143dfe)['filter']('ignore')[_0x135c('0x2e')](_0x135c('0x2f'))['value']();if(_[_0x135c('0x30')](_0x97ab6a,_0x1eb808['type'])){return;}var _0x31ddaa=_['find'](_0x143dfe,[_0x135c('0x2f'),_0x1eb808[_0x135c('0x31')]])[_0x135c('0x32')];return db[_0x135c('0x33')][_0x135c('0x27')]({'where':{'type':_0x31ddaa,'resourceId':_0x1eb808['id']}})[_0x135c('0x26')](function(){return _0x252b21;});})[_0x135c('0x26')](function(){_0x3ff3be[_0x135c('0x1a')](0xcc)[_0x135c('0x1b')]();});}};}function handleEntityNotFound(_0x280ff3,_0x3b77b7){return function(_0x5db384){if(!_0x5db384){_0x280ff3[_0x135c('0x19')](0x194);}return _0x5db384;};}function handleError(_0x35ff47,_0x13fc65){_0x13fc65=_0x13fc65||0x1f4;return function(_0x5c43ac){logger[_0x135c('0x34')](_0x5c43ac[_0x135c('0x35')]);if(_0x5c43ac[_0x135c('0x32')]){delete _0x5c43ac[_0x135c('0x32')];}_0x35ff47['status'](_0x13fc65)[_0x135c('0x36')](_0x5c43ac);};}exports[_0x135c('0x37')]=function(_0x47aeff,_0x4d1480){var _0x4a0ca4={},_0x2754d8={},_0x52f80a={'count':0x0,'rows':[]};var _0x42618f=_[_0x135c('0x2e')](db[_0x135c('0x38')][_0x135c('0x39')],function(_0x1f2a06){return{'name':_0x1f2a06['fieldName'],'type':_0x1f2a06[_0x135c('0x31')]['key']};});_0x2754d8[_0x135c('0x3a')]=_[_0x135c('0x2e')](_0x42618f,_0x135c('0x32'));_0x2754d8[_0x135c('0x3b')]=_[_0x135c('0x3c')](_0x47aeff[_0x135c('0x3b')]);_0x2754d8['filters']=_[_0x135c('0x3d')](_0x2754d8[_0x135c('0x3a')],_0x2754d8['query']);_0x4a0ca4[_0x135c('0x3e')]=_[_0x135c('0x3d')](_0x2754d8[_0x135c('0x3a')],qs[_0x135c('0x3f')](_0x47aeff[_0x135c('0x3b')]['fields']));_0x4a0ca4[_0x135c('0x3e')]=_0x4a0ca4[_0x135c('0x3e')][_0x135c('0x40')]?_0x4a0ca4['attributes']:_0x2754d8[_0x135c('0x3a')];if(!_0x47aeff[_0x135c('0x3b')][_0x135c('0x41')](_0x135c('0x42'))){_0x4a0ca4[_0x135c('0x43')]=qs[_0x135c('0x43')](_0x47aeff[_0x135c('0x3b')][_0x135c('0x43')]);_0x4a0ca4[_0x135c('0x1d')]=qs['offset'](_0x47aeff[_0x135c('0x3b')][_0x135c('0x1d')]);}_0x4a0ca4['order']=qs[_0x135c('0x44')](_0x47aeff[_0x135c('0x3b')][_0x135c('0x44')]);_0x4a0ca4['where']=qs[_0x135c('0x45')](_['pick'](_0x47aeff[_0x135c('0x3b')],_0x2754d8['filters']),_0x42618f);if(_0x47aeff[_0x135c('0x3b')][_0x135c('0x46')]){_0x4a0ca4['where']=_[_0x135c('0x47')](_0x4a0ca4[_0x135c('0x48')],{'$or':_[_0x135c('0x2e')](_0x42618f,function(_0x47f15b){if(_0x47f15b[_0x135c('0x31')]!=='VIRTUAL'){var _0xd49a8c={};_0xd49a8c[_0x47f15b['name']]={'$like':'%'+_0x47aeff[_0x135c('0x3b')][_0x135c('0x46')]+'%'};return _0xd49a8c;}})});}_0x4a0ca4=_[_0x135c('0x47')]({},_0x4a0ca4,_0x47aeff['options']);var _0x409d2c={'where':_0x4a0ca4[_0x135c('0x48')]};return db[_0x135c('0x38')][_0x135c('0x1f')](_0x409d2c)[_0x135c('0x26')](function(_0x5273ac){_0x52f80a[_0x135c('0x1f')]=_0x5273ac;if(_0x47aeff[_0x135c('0x3b')]['includeAll']){_0x4a0ca4['include']=[{'all':!![]}];}return db[_0x135c('0x38')][_0x135c('0x49')](_0x4a0ca4);})[_0x135c('0x26')](function(_0xe79a0b){_0x52f80a[_0x135c('0x4a')]=_0xe79a0b;return _0x52f80a;})['then'](respondWithFilteredResult(_0x4d1480,_0x4a0ca4))[_0x135c('0x4b')](handleError(_0x4d1480,null));};exports[_0x135c('0x4c')]=function(_0x4f96c1,_0x19bea8){var _0x58ceba={'raw':![],'where':{'id':_0x4f96c1[_0x135c('0x4d')]['id']}},_0x5c0fed={};_0x5c0fed[_0x135c('0x3a')]=_[_0x135c('0x3c')](db[_0x135c('0x38')][_0x135c('0x39')]);_0x5c0fed['query']=_[_0x135c('0x3c')](_0x4f96c1[_0x135c('0x3b')]);_0x5c0fed['filters']=_[_0x135c('0x3d')](_0x5c0fed[_0x135c('0x3a')],_0x5c0fed['query']);_0x58ceba[_0x135c('0x3e')]=_['intersection'](_0x5c0fed[_0x135c('0x3a')],qs[_0x135c('0x3f')](_0x4f96c1['query'][_0x135c('0x3f')]));_0x58ceba['attributes']=_0x58ceba['attributes'][_0x135c('0x40')]?_0x58ceba[_0x135c('0x3e')]:_0x5c0fed[_0x135c('0x3a')];if(_0x4f96c1[_0x135c('0x3b')][_0x135c('0x4e')]){_0x58ceba[_0x135c('0x4f')]=[{'all':!![]}];}_0x58ceba=_[_0x135c('0x47')]({},_0x58ceba,_0x4f96c1[_0x135c('0x50')]);return db['VoiceExtension'][_0x135c('0x51')](_0x58ceba)[_0x135c('0x26')](handleEntityNotFound(_0x19bea8,null))[_0x135c('0x26')](respondWithResult(_0x19bea8,null))[_0x135c('0x4b')](handleError(_0x19bea8,null));};exports[_0x135c('0x27')]=function(_0x1c3e16,_0x2ae353){return db['VoiceExtension'][_0x135c('0x51')]({'where':{'id':_0x1c3e16[_0x135c('0x4d')]['id']}})[_0x135c('0x26')](handleEntityNotFound(_0x2ae353,null))[_0x135c('0x26')](removeEntity(_0x2ae353,null))['catch'](handleError(_0x2ae353,null));};exports[_0x135c('0x52')]=function(_0xcb9027,_0x314c0c){if(_0xcb9027[_0x135c('0x53')][_0x135c('0x31')]==='outbound'&&!_[_0x135c('0x54')](_0xcb9027[_0x135c('0x53')][_0x135c('0x55')],'_')){_0xcb9027['body'][_0x135c('0x55')]='_'[_0x135c('0x56')](_0xcb9027['body'][_0x135c('0x55')]);}return db[_0x135c('0x38')]['create'](_0xcb9027['body'],{'raw':![]})[_0x135c('0x26')](function(_0x26489e){var _0x567e2f=_0xcb9027['user']['get']({'plain':!![]});if(!_0x567e2f)throw new Error(_0x135c('0x57'));if(_0x567e2f[_0x135c('0x58')]===_0x135c('0x59')){var _0x482661=_0x26489e[_0x135c('0x28')]({'plain':!![]});var _0x17079f=[{'name':_0x135c('0x5a'),'value':_0x135c('0x29')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x135c('0x2c'),'value':_0x135c('0x2d')}];var _0x1559e0=_[_0x135c('0x51')](_0x17079f,[_0x135c('0x2f'),_0x482661[_0x135c('0x31')]])[_0x135c('0x32')];return db[_0x135c('0x5b')]['find']({'where':{'name':_0x1559e0,'userProfileId':_0x567e2f[_0x135c('0x5c')]},'raw':!![]})[_0x135c('0x26')](function(_0x410dd2){if(_0x410dd2&&_0x410dd2[_0x135c('0x5d')]===0x0){return db[_0x135c('0x33')][_0x135c('0x52')]({'name':_0x482661[_0x135c('0x32')],'resourceId':_0x482661['id'],'type':_0x410dd2[_0x135c('0x32')],'sectionId':_0x410dd2['id']},{})[_0x135c('0x26')](function(){return _0x26489e;});}else{return _0x26489e;}})['catch'](function(_0x17dbd0){logger[_0x135c('0x34')](_0x135c('0x5e'),_0x17dbd0);throw _0x17dbd0;});}return _0x26489e;})[_0x135c('0x26')](respondWithResult(_0x314c0c,0xc9))[_0x135c('0x4b')](handleError(_0x314c0c,null));};exports[_0x135c('0x25')]=function(_0x13048e,_0x359b20){if(_0x13048e[_0x135c('0x53')]['id']){delete _0x13048e[_0x135c('0x53')]['id'];}return db[_0x135c('0x38')]['find']({'where':{'id':_0x13048e[_0x135c('0x4d')]['id']}})[_0x135c('0x26')](handleEntityNotFound(_0x359b20,null))[_0x135c('0x26')](function(_0x51fdb5){if(_0x51fdb5){return db[_0x135c('0x38')]['update'](_['pick'](_0x13048e[_0x135c('0x53')],[_0x135c('0x55'),'context',_0x135c('0x5f'),_0x135c('0x60'),_0x135c('0x61'),_0x135c('0x62'),'alias']),{'where':{'context':_0x51fdb5[_0x135c('0x63')],'exten':_0x51fdb5[_0x135c('0x55')]},'individualHooks':!![]})[_0x135c('0x26')](function(_0x2c1414){return _0x2c1414;});}return null;})[_0x135c('0x26')](respondWithStatusCode(_0x359b20,null))['catch'](handleError(_0x359b20,null));};exports[_0x135c('0x64')]=function(_0x2717e8,_0x5b0cab){return db[_0x135c('0x38')][_0x135c('0x65')]({'where':{'id':_0x2717e8['params']['id']}})[_0x135c('0x26')](function(_0x3911cb){if(_0x3911cb){return db[_0x135c('0x66')][_0x135c('0x67')](function(_0x56d94f){return db['VoiceExtension'][_0x135c('0x27')]({'where':{'VoiceExtensionId':_0x2717e8[_0x135c('0x4d')]['id']},'transaction':_0x56d94f})['then'](function(){var _0x1745d5=_[_0x135c('0x2e')](_0x2717e8['body'],function(_0x2fc344){_0x2fc344[_0x135c('0x68')]=_0x2717e8[_0x135c('0x4d')]['id'];_0x2fc344[_0x135c('0x69')]=!![];return _0x2fc344;});var _0x58d9f7=_0x2717e8[_0x135c('0x3b')][_0x135c('0x6a')]&&_0x2717e8[_0x135c('0x3b')][_0x135c('0x6a')][_0x135c('0x6b')]()===_0x135c('0x6c')?!![]:![];return _0x3911cb['createRouting'](_0x1745d5,_0x58d9f7);})[_0x135c('0x26')](function(_0x2137b1){return db[_0x135c('0x38')]['bulkCreate'](_0x2137b1,{'transaction':_0x56d94f});});})[_0x135c('0x26')](function(){return db[_0x135c('0x38')][_0x135c('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2717e8['params']['id']},'order':_0x135c('0x6e')});});}})['then'](respondWithResult(_0x5b0cab,null))[_0x135c('0x4b')](handleError(_0x5b0cab,null));};
\ No newline at end of file
+var _0x2777=['sendStatus','end','json','offset','undefined','count','status','apply','reject','save','update','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','filter','map','value','includes','find','type','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','include','rows','show','params','intersection','catch','create','body','startsWith','concat','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InternalRoutes','internal','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','true','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x2777,0x1ae));var _0x7277=function(_0x87d1fa,_0x22426c){_0x87d1fa=_0x87d1fa-0x0;var _0x5bd2cc=_0x2777[_0x87d1fa];return _0x5bd2cc;};'use strict';var emlformat=require(_0x7277('0x0'));var rimraf=require(_0x7277('0x1'));var zipdir=require(_0x7277('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7277('0x3'));var moment=require(_0x7277('0x4'));var BPromise=require(_0x7277('0x5'));var Mustache=require(_0x7277('0x6'));var util=require(_0x7277('0x7'));var path=require(_0x7277('0x8'));var sox=require('sox');var csv=require(_0x7277('0x9'));var ejs=require(_0x7277('0xa'));var fs=require('fs');var fs_extra=require(_0x7277('0xb'));var _=require(_0x7277('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7277('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7277('0xe'));var Papa=require(_0x7277('0xf'));var Redis=require('ioredis');var authService=require(_0x7277('0x10'));var qs=require(_0x7277('0x11'));var as=require(_0x7277('0x12'));var hardwareService=require(_0x7277('0x13'));var logger=require(_0x7277('0x14'))(_0x7277('0x15'));var utils=require('../../config/utils');var config=require(_0x7277('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7277('0x17'))['db'];config[_0x7277('0x18')]=_[_0x7277('0x19')](config[_0x7277('0x18')],{'host':_0x7277('0x1a'),'port':0x18eb});var socket=require(_0x7277('0x1b'))(new Redis(config[_0x7277('0x18')]));require(_0x7277('0x1c'))[_0x7277('0x1d')](socket);function respondWithStatusCode(_0x26caa6,_0x5e12a0){_0x5e12a0=_0x5e12a0||0xcc;return function(_0x55093e){if(_0x55093e){return _0x26caa6[_0x7277('0x1e')](_0x5e12a0);}return _0x26caa6['status'](_0x5e12a0)[_0x7277('0x1f')]();};}function respondWithResult(_0x3126bd,_0x4e3291){_0x4e3291=_0x4e3291||0xc8;return function(_0x116484){if(_0x116484){return _0x3126bd['status'](_0x4e3291)[_0x7277('0x20')](_0x116484);}};}function respondWithFilteredResult(_0x136804,_0x3b2877){return function(_0xb069){if(_0xb069){var _0x40bb3f=typeof _0x3b2877[_0x7277('0x21')]===_0x7277('0x22')&&typeof _0x3b2877['limit']==='undefined';var _0x63d841=_0xb069['count'];var _0x47db57=_0x40bb3f?0x0:_0x3b2877['offset'];var _0x2edf69=_0x40bb3f?_0xb069[_0x7277('0x23')]:_0x3b2877[_0x7277('0x21')]+_0x3b2877['limit'];var _0x322964;if(_0x2edf69>=_0x63d841){_0x2edf69=_0x63d841;_0x322964=0xc8;}else{_0x322964=0xce;}_0x136804[_0x7277('0x24')](_0x322964);return _0x136804['set']('Content-Range',_0x47db57+'-'+_0x2edf69+'/'+_0x63d841)[_0x7277('0x20')](_0xb069);}return null;};}function patchUpdates(_0x48982d){return function(_0x37e6d0){try{jsonpatch[_0x7277('0x25')](_0x37e6d0,_0x48982d,!![]);}catch(_0x15abed){return BPromise[_0x7277('0x26')](_0x15abed);}return _0x37e6d0[_0x7277('0x27')]();};}function saveUpdates(_0x3f91c9,_0x7dc62){return function(_0x576e09){if(_0x576e09){return _0x576e09[_0x7277('0x28')](_0x3f91c9)['then'](function(_0x3b7512){return _0x3b7512;});}return null;};}function removeEntity(_0x274aec,_0x5e9344){return function(_0x3f0e1d){if(_0x3f0e1d){return _0x3f0e1d[_0x7277('0x29')]()[_0x7277('0x2a')](function(){var _0xa3d9e4=_0x3f0e1d[_0x7277('0x2b')]({'plain':!![]});var _0x2d7dc4=[{'name':_0x7277('0x2c'),'value':_0x7277('0x2d'),'ignore':![]},{'name':_0x7277('0x2e'),'value':_0x7277('0x2f'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x506fc3=_(_0x2d7dc4)[_0x7277('0x30')]('ignore')[_0x7277('0x31')](_0x7277('0x32'))[_0x7277('0x32')]();if(_[_0x7277('0x33')](_0x506fc3,_0xa3d9e4['type'])){return;}var _0x17bf42=_[_0x7277('0x34')](_0x2d7dc4,['value',_0xa3d9e4[_0x7277('0x35')]])['name'];return db[_0x7277('0x36')][_0x7277('0x29')]({'where':{'type':_0x17bf42,'resourceId':_0xa3d9e4['id']}})[_0x7277('0x2a')](function(){return _0x3f0e1d;});})[_0x7277('0x2a')](function(){_0x274aec['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x283ba3,_0x2871e3){return function(_0x11844b){if(!_0x11844b){_0x283ba3[_0x7277('0x1e')](0x194);}return _0x11844b;};}function handleError(_0x1297bc,_0x3cf75e){_0x3cf75e=_0x3cf75e||0x1f4;return function(_0xd1571f){logger[_0x7277('0x37')](_0xd1571f[_0x7277('0x38')]);if(_0xd1571f[_0x7277('0x39')]){delete _0xd1571f[_0x7277('0x39')];}_0x1297bc[_0x7277('0x24')](_0x3cf75e)[_0x7277('0x3a')](_0xd1571f);};}exports['index']=function(_0x18cdfa,_0x386453){var _0x2dd55d={},_0x3cea83={},_0x19c8b4={'count':0x0,'rows':[]};var _0x41942a=_[_0x7277('0x31')](db['VoiceExtension'][_0x7277('0x3b')],function(_0x433bed){return{'name':_0x433bed[_0x7277('0x3c')],'type':_0x433bed[_0x7277('0x35')][_0x7277('0x3d')]};});_0x3cea83[_0x7277('0x3e')]=_[_0x7277('0x31')](_0x41942a,_0x7277('0x39'));_0x3cea83[_0x7277('0x3f')]=_[_0x7277('0x40')](_0x18cdfa['query']);_0x3cea83[_0x7277('0x41')]=_['intersection'](_0x3cea83['model'],_0x3cea83['query']);_0x2dd55d['attributes']=_['intersection'](_0x3cea83[_0x7277('0x3e')],qs[_0x7277('0x42')](_0x18cdfa['query'][_0x7277('0x42')]));_0x2dd55d[_0x7277('0x43')]=_0x2dd55d[_0x7277('0x43')][_0x7277('0x44')]?_0x2dd55d['attributes']:_0x3cea83[_0x7277('0x3e')];if(!_0x18cdfa[_0x7277('0x3f')][_0x7277('0x45')]('nolimit')){_0x2dd55d[_0x7277('0x46')]=qs[_0x7277('0x46')](_0x18cdfa[_0x7277('0x3f')][_0x7277('0x46')]);_0x2dd55d[_0x7277('0x21')]=qs[_0x7277('0x21')](_0x18cdfa[_0x7277('0x3f')][_0x7277('0x21')]);}_0x2dd55d[_0x7277('0x47')]=qs[_0x7277('0x48')](_0x18cdfa[_0x7277('0x3f')][_0x7277('0x48')]);_0x2dd55d[_0x7277('0x49')]=qs[_0x7277('0x41')](_[_0x7277('0x4a')](_0x18cdfa[_0x7277('0x3f')],_0x3cea83[_0x7277('0x41')]),_0x41942a);if(_0x18cdfa[_0x7277('0x3f')][_0x7277('0x30')]){_0x2dd55d[_0x7277('0x49')]=_[_0x7277('0x4b')](_0x2dd55d['where'],{'$or':_['map'](_0x41942a,function(_0x152fdd){if(_0x152fdd[_0x7277('0x35')]!==_0x7277('0x4c')){var _0x1d624e={};_0x1d624e[_0x152fdd[_0x7277('0x39')]]={'$like':'%'+_0x18cdfa[_0x7277('0x3f')][_0x7277('0x30')]+'%'};return _0x1d624e;}})});}_0x2dd55d=_['merge']({},_0x2dd55d,_0x18cdfa[_0x7277('0x4d')]);var _0xf9ce84={'where':_0x2dd55d[_0x7277('0x49')]};return db[_0x7277('0x4e')][_0x7277('0x23')](_0xf9ce84)[_0x7277('0x2a')](function(_0x5429cb){_0x19c8b4[_0x7277('0x23')]=_0x5429cb;if(_0x18cdfa[_0x7277('0x3f')][_0x7277('0x4f')]){_0x2dd55d[_0x7277('0x50')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x2dd55d);})['then'](function(_0x45d2ce){_0x19c8b4[_0x7277('0x51')]=_0x45d2ce;return _0x19c8b4;})[_0x7277('0x2a')](respondWithFilteredResult(_0x386453,_0x2dd55d))['catch'](handleError(_0x386453,null));};exports[_0x7277('0x52')]=function(_0xda5e95,_0x3c6122){var _0x80a6cb={'raw':![],'where':{'id':_0xda5e95[_0x7277('0x53')]['id']}},_0x3d1dea={};_0x3d1dea['model']=_[_0x7277('0x40')](db['VoiceExtension'][_0x7277('0x3b')]);_0x3d1dea['query']=_[_0x7277('0x40')](_0xda5e95['query']);_0x3d1dea[_0x7277('0x41')]=_[_0x7277('0x54')](_0x3d1dea[_0x7277('0x3e')],_0x3d1dea['query']);_0x80a6cb[_0x7277('0x43')]=_[_0x7277('0x54')](_0x3d1dea[_0x7277('0x3e')],qs[_0x7277('0x42')](_0xda5e95[_0x7277('0x3f')][_0x7277('0x42')]));_0x80a6cb['attributes']=_0x80a6cb[_0x7277('0x43')][_0x7277('0x44')]?_0x80a6cb['attributes']:_0x3d1dea[_0x7277('0x3e')];if(_0xda5e95[_0x7277('0x3f')][_0x7277('0x4f')]){_0x80a6cb[_0x7277('0x50')]=[{'all':!![]}];}_0x80a6cb=_[_0x7277('0x4b')]({},_0x80a6cb,_0xda5e95['options']);return db[_0x7277('0x4e')]['find'](_0x80a6cb)[_0x7277('0x2a')](handleEntityNotFound(_0x3c6122,null))[_0x7277('0x2a')](respondWithResult(_0x3c6122,null))[_0x7277('0x55')](handleError(_0x3c6122,null));};exports[_0x7277('0x29')]=function(_0x1b15dd,_0x368233){return db['VoiceExtension'][_0x7277('0x34')]({'where':{'id':_0x1b15dd[_0x7277('0x53')]['id']}})[_0x7277('0x2a')](handleEntityNotFound(_0x368233,null))[_0x7277('0x2a')](removeEntity(_0x368233,null))[_0x7277('0x55')](handleError(_0x368233,null));};exports[_0x7277('0x56')]=function(_0x57ab5f,_0x5e7957){if(_0x57ab5f[_0x7277('0x57')][_0x7277('0x35')]===_0x7277('0x2f')&&!_[_0x7277('0x58')](_0x57ab5f[_0x7277('0x57')]['exten'],'_')){_0x57ab5f[_0x7277('0x57')]['exten']='_'[_0x7277('0x59')](_0x57ab5f[_0x7277('0x57')][_0x7277('0x5a')]);}return db[_0x7277('0x4e')][_0x7277('0x56')](_0x57ab5f['body'],{'raw':![]})[_0x7277('0x2a')](function(_0x1deebe){var _0x347108=_0x57ab5f[_0x7277('0x5b')][_0x7277('0x2b')]({'plain':!![]});if(!_0x347108)throw new Error(_0x7277('0x5c'));if(_0x347108[_0x7277('0x5d')]===_0x7277('0x5b')){var _0xe836bf=_0x1deebe[_0x7277('0x2b')]({'plain':!![]});var _0x429d3d=[{'name':_0x7277('0x2c'),'value':_0x7277('0x2d')},{'name':'OutboundRoutes','value':_0x7277('0x2f')},{'name':_0x7277('0x5e'),'value':_0x7277('0x5f')}];var _0xfeba6d=_[_0x7277('0x34')](_0x429d3d,['value',_0xe836bf[_0x7277('0x35')]])[_0x7277('0x39')];return db[_0x7277('0x60')][_0x7277('0x34')]({'where':{'name':_0xfeba6d,'userProfileId':_0x347108[_0x7277('0x61')]},'raw':!![]})[_0x7277('0x2a')](function(_0x4850e4){if(_0x4850e4&&_0x4850e4['autoAssociation']===0x0){return db[_0x7277('0x36')][_0x7277('0x56')]({'name':_0xe836bf[_0x7277('0x39')],'resourceId':_0xe836bf['id'],'type':_0x4850e4[_0x7277('0x39')],'sectionId':_0x4850e4['id']},{})[_0x7277('0x2a')](function(){return _0x1deebe;});}else{return _0x1deebe;}})[_0x7277('0x55')](function(_0x59c09d){logger[_0x7277('0x37')](_0x7277('0x62'),_0x59c09d);throw _0x59c09d;});}return _0x1deebe;})[_0x7277('0x2a')](respondWithResult(_0x5e7957,0xc9))[_0x7277('0x55')](handleError(_0x5e7957,null));};exports['update']=function(_0x30e928,_0x4d0cff){if(_0x30e928[_0x7277('0x57')]['id']){delete _0x30e928['body']['id'];}return db[_0x7277('0x4e')][_0x7277('0x34')]({'where':{'id':_0x30e928[_0x7277('0x53')]['id']}})[_0x7277('0x2a')](handleEntityNotFound(_0x4d0cff,null))[_0x7277('0x2a')](function(_0x2cb517){if(_0x2cb517){return db[_0x7277('0x4e')][_0x7277('0x28')](_[_0x7277('0x4a')](_0x30e928[_0x7277('0x57')],[_0x7277('0x5a'),_0x7277('0x63'),_0x7277('0x64'),_0x7277('0x65'),_0x7277('0x66'),_0x7277('0x67'),'alias']),{'where':{'context':_0x2cb517[_0x7277('0x63')],'exten':_0x2cb517[_0x7277('0x5a')]},'individualHooks':!![]})['then'](function(_0x2024be){return _0x2024be;});}return null;})['then'](respondWithStatusCode(_0x4d0cff,null))[_0x7277('0x55')](handleError(_0x4d0cff,null));};exports[_0x7277('0x68')]=function(_0x2687c6,_0x463022){return db[_0x7277('0x4e')][_0x7277('0x69')]({'where':{'id':_0x2687c6[_0x7277('0x53')]['id']}})[_0x7277('0x2a')](function(_0x8d3bbc){if(_0x8d3bbc){return db[_0x7277('0x6a')][_0x7277('0x6b')](function(_0x3efd9c){return db['VoiceExtension'][_0x7277('0x29')]({'where':{'VoiceExtensionId':_0x2687c6[_0x7277('0x53')]['id']},'transaction':_0x3efd9c})[_0x7277('0x2a')](function(){var _0x25fdcc=_[_0x7277('0x31')](_0x2687c6['body'],function(_0x59d2b4){_0x59d2b4[_0x7277('0x6c')]=_0x2687c6['params']['id'];_0x59d2b4[_0x7277('0x6d')]=!![];return _0x59d2b4;});var _0x332c4c=_0x2687c6['query'][_0x7277('0x6e')]&&_0x2687c6[_0x7277('0x3f')][_0x7277('0x6e')]['toLowerCase']()===_0x7277('0x6f')?!![]:![];return _0x8d3bbc[_0x7277('0x70')](_0x25fdcc,_0x332c4c);})[_0x7277('0x2a')](function(_0x2a424c){return db['VoiceExtension'][_0x7277('0x71')](_0x2a424c,{'transaction':_0x3efd9c});});})[_0x7277('0x2a')](function(){return db[_0x7277('0x4e')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x2687c6[_0x7277('0x53')]['id']},'order':_0x7277('0x72')});});}})[_0x7277('0x2a')](respondWithResult(_0x463022,null))[_0x7277('0x55')](handleError(_0x463022,null));};
\ No newline at end of file
index 7695304..44f1d60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e27=['../../mysqldb','VoiceExtension','setMaxListeners','update','emit','hasOwnProperty','hook','events'];(function(_0x2de620,_0x52dadb){var _0x5b076d=function(_0x4a9e75){while(--_0x4a9e75){_0x2de620['push'](_0x2de620['shift']());}};_0x5b076d(++_0x52dadb);}(_0x4e27,0x8f));var _0x74e2=function(_0x3f35c3,_0x6c0782){_0x3f35c3=_0x3f35c3-0x0;var _0x4f7752=_0x4e27[_0x3f35c3];return _0x4f7752;};'use strict';var EventEmitter=require(_0x74e2('0x0'));var VoiceExtension=require(_0x74e2('0x1'))['db'][_0x74e2('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x74e2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x74e2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x534a52){return function(_0x33b9e6,_0x1c1401,_0x230bb7){VoiceExtensionEvents[_0x74e2('0x5')](_0x534a52+':'+_0x33b9e6['id'],_0x33b9e6);VoiceExtensionEvents[_0x74e2('0x5')](_0x534a52,_0x33b9e6);_0x230bb7(null);};}for(var e in events){if(events[_0x74e2('0x6')](e)){var event=events[e];VoiceExtension[_0x74e2('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
+var _0x9549=['remove','emit','hook','exports','VoiceExtension','setMaxListeners','save'];(function(_0x45940b,_0x59cb47){var _0x114f45=function(_0x20e77d){while(--_0x20e77d){_0x45940b['push'](_0x45940b['shift']());}};_0x114f45(++_0x59cb47);}(_0x9549,0x90));var _0x9954=function(_0x394e9f,_0x10b779){_0x394e9f=_0x394e9f-0x0;var _0x33ad31=_0x9549[_0x394e9f];return _0x33ad31;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x9954('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9954('0x1')](0x0);var events={'afterCreate':_0x9954('0x2'),'afterUpdate':'update','afterDestroy':_0x9954('0x3')};function emitEvent(_0x3a8712){return function(_0x1347e1,_0x2972a5,_0x29a925){VoiceExtensionEvents['emit'](_0x3a8712+':'+_0x1347e1['id'],_0x1347e1);VoiceExtensionEvents[_0x9954('0x4')](_0x3a8712,_0x1347e1);_0x29a925(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x9954('0x5')](e,emitEvent(event));}}module[_0x9954('0x6')]=VoiceExtensionEvents;
\ No newline at end of file
index 7919d51..5c71395 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf95=['length','name','param','split','phone','prefix','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','Hangup','util','lodash','exports','models','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','url'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0xaf95,0x17c));var _0x5af9=function(_0xb433ae,_0x1dbc0f){_0xb433ae=_0xb433ae-0x0;var _0x3e11f9=_0xaf95[_0xb433ae];return _0x3e11f9;};'use strict';var util=require(_0x5af9('0x0'));var _=require(_0x5af9('0x1'));var attributes=require('./voiceExtension.attributes');module[_0x5af9('0x2')]=function(_0x3582b1){var _0x28ff98=_0x3582b1[_0x5af9('0x3')];function _0x1d57da(_0x1a2712){var _0x189c75=0x2;var _0x388d5b=[{'type':_0x1a2712[_0x5af9('0x4')],'app':_0x5af9('0x5'),'appdata':'CDR(type)='+_0x1a2712[_0x5af9('0x4')],'context':_0x1a2712[_0x5af9('0x6')],'exten':_0x1a2712[_0x5af9('0x7')],'priority':_0x189c75++,'VoiceExtensionId':_0x1a2712['id']},{'type':_0x1a2712[_0x5af9('0x4')],'app':_0x1a2712[_0x5af9('0x8')]?_0x5af9('0x5'):_0x5af9('0x9'),'appdata':_0x1a2712[_0x5af9('0x8')]?_0x5af9('0xa')+_0x1a2712[_0x5af9('0x8')]:_0x5af9('0xb'),'context':_0x1a2712[_0x5af9('0x6')],'exten':_0x1a2712[_0x5af9('0x7')],'priority':_0x189c75++,'VoiceExtensionId':_0x1a2712['id']}];if(_0x1a2712['type']===_0x5af9('0xc')){_0x388d5b[_0x5af9('0xd')]({'type':_0x5af9('0xc'),'app':_0x5af9('0x5'),'appdata':'CDR(routeid)='+_0x1a2712['id'],'context':_0x1a2712[_0x5af9('0x6')],'exten':_0x1a2712[_0x5af9('0x7')],'priority':_0x189c75++,'VoiceExtensionId':_0x1a2712['id']});}_0x388d5b[_0x5af9('0xd')]({'type':_0x1a2712[_0x5af9('0x4')],'app':_0x5af9('0x5'),'appdata':_0x5af9('0xe'),'context':_0x1a2712['context'],'exten':_0x1a2712[_0x5af9('0x7')],'priority':_0x189c75++,'VoiceExtensionId':_0x1a2712['id']},{'type':_0x1a2712['type'],'app':_0x5af9('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1a2712[_0x5af9('0x6')],'exten':_0x1a2712[_0x5af9('0x7')],'priority':_0x189c75++,'VoiceExtensionId':_0x1a2712['id']},{'type':_0x1a2712[_0x5af9('0x4')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x1a2712[_0x5af9('0x6')],'exten':_0x1a2712['exten'],'priority':_0x189c75++,'VoiceExtensionId':_0x1a2712['id']});return _0x388d5b;}function _0x2e53ff(_0x2cdb86){var _0x2ae4b3=0x2;var _0x330ce0=[{'type':_0x5af9('0xf'),'app':_0x5af9('0x5'),'appdata':'CDR(type)=outbound','context':_0x2cdb86['context'],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':'outbound','app':_0x2cdb86[_0x5af9('0x8')]?_0x5af9('0x5'):_0x5af9('0x9'),'appdata':_0x2cdb86[_0x5af9('0x8')]?_0x5af9('0xa')+_0x2cdb86['alias']:_0x5af9('0xb'),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':'Set','appdata':_0x5af9('0x10')+(_0x2cdb86[_0x5af9('0x11')]?_0x5af9('0x12')+_0x2cdb86['cutdigits']+'}':_0x5af9('0x13')),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86['exten'],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':_0x5af9('0x5'),'appdata':'CDR(routeid)='+_0x2cdb86['id'],'context':_0x2cdb86['context'],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':_0x5af9('0x14'),'appdata':_0x5af9('0x15')+(_0x2ae4b3+0x2)+'):Goto('+(_0x2ae4b3+0x1)+')','context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':_0x5af9('0x5'),'appdata':_0x2cdb86['cutdigits']?_0x5af9('0x16')+_0x2cdb86['cutdigits']+'}':_0x5af9('0x17'),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':'Set','appdata':_0x5af9('0xe'),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86['exten'],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':_0x5af9('0x5'),'appdata':_0x5af9('0x18'),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86['exten'],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':'outbound','app':_0x5af9('0x5'),'appdata':_0x5af9('0x19'),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86['exten'],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':_0x5af9('0x5'),'appdata':_0x5af9('0x1a')+_0x2cdb86['id'],'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86['exten'],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']}];if(_0x2cdb86[_0x5af9('0x1b')](_0x5af9('0x1c'))&&_0x2cdb86[_0x5af9('0x1c')]!==_0x5af9('0x1d')){_0x330ce0[_0x5af9('0xd')]({'type':_0x5af9('0xf'),'app':_0x5af9('0x5'),'appdata':_0x5af9('0x1e'),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':'outbound','app':_0x5af9('0x5'),'appdata':_0x5af9('0x1f')+_0x2cdb86[_0x5af9('0x1c')]||'wav','context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']});}return _0x330ce0;}function _0x5b7b97(_0x2f28f8){var _0x4ce2ac=[{'name':_0x5af9('0x20'),'param':0x0},{'name':_0x5af9('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':_0x5af9('0x22'),'param':0x3}];var _0xec0e8c={};var _0x14f196=_0x2f28f8['split'](',');var _0x36b49b=[];for(var _0x37f01d=0x0;_0x37f01d<_0x4ce2ac[_0x5af9('0x23')];_0x37f01d++){switch(_0x4ce2ac[_0x37f01d][_0x5af9('0x24')]){case'trunk':_0xec0e8c[_0x5af9('0x20')]=_0x14f196[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]][_0x5af9('0x26')]('/')[0x1];_0xec0e8c[_0x5af9('0x27')]=_0x14f196[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]][_0x5af9('0x26')]('/')[0x2];_0xec0e8c[_0x5af9('0x28')]=_0xec0e8c[_0x5af9('0x27')]?_0xec0e8c[_0x5af9('0x27')]['split']('$')[0x0]:undefined;_0xec0e8c[_0x5af9('0x27')]=route[_0x5af9('0x11')]?(_0xec0e8c[_0x5af9('0x28')]||'')+_0x5af9('0x12')+route['cutdigits']+'}':(_0xec0e8c[_0x5af9('0x28')]||'')+_0x5af9('0x13');_0x36b49b[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]]=[_0x5af9('0x29'),_0xec0e8c[_0x5af9('0x20')],_0xec0e8c[_0x5af9('0x27')]][_0x5af9('0x2a')]('/');break;case _0x5af9('0x2b'):_0xec0e8c[_0x5af9('0x2b')]=_0x14f196[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]];if(route[_0x5af9('0x1c')]!==_0x5af9('0x1d')){if(_0xec0e8c['options'][_0x5af9('0x2c')]('U(xcally-mixmonitor-context)')<0x0){_0xec0e8c[_0x5af9('0x2b')]+=_0x5af9('0x2d');}}else{_0xec0e8c[_0x5af9('0x2b')]=_0xec0e8c[_0x5af9('0x2b')]['replace']('U(xcally-mixmonitor-context)','');}_0x36b49b[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]]=_0xec0e8c[_0x5af9('0x2b')];break;default:_0x36b49b[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]]=_0x14f196[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]];}}return _0x36b49b[_0x5af9('0x2a')](',');}function _0x10717d(_0x120a6c,_0x321ef8,_0x24812c,_0x2e1296){return new Promise(function(_0x58f275,_0x33a9ce){var _0x62af83=[];if(_[_0x5af9('0x2e')](_0x321ef8))return _0x58f275(_0x62af83);_0x28ff98[_0x5af9('0x2f')][_0x5af9('0x30')]({'attributes':['id',_0x5af9('0x31'),_0x5af9('0x32')],'raw':!![]})[_0x5af9('0x33')](function(_0x5ac855){for(var _0x1b157e=0x0,_0x1c6aba=0x0;_0x1b157e<_0x321ef8['length'];_0x1b157e++,_0x1c6aba=0x0){var _0x4c87d7=_0x321ef8[_0x1b157e];var _0x353f99=[];var _0x497e5f=[];if(_0x4c87d7[_0x5af9('0x31')]!==_0x5af9('0x34')){_0x4c87d7[_0x5af9('0x35')]=[_0x4c87d7[_0x5af9('0x31')]];}else{_0x4c87d7[_0x5af9('0x35')]=_0x4c87d7[_0x5af9('0x32')]?_[_0x5af9('0x36')](_[_0x5af9('0x37')](_0x5ac855,{'IntervalId':_0x4c87d7[_0x5af9('0x32')]}),_0x5af9('0x31')):[];}_0x4c87d7[_0x5af9('0x6')]=_0x120a6c['context'];_0x4c87d7[_0x5af9('0x7')]=_0x120a6c[_0x5af9('0x7')];if(_0x4c87d7['type'])_0x4c87d7['type']=_0x4c87d7[_0x5af9('0x4')][_0x5af9('0x38')]();if(_0x120a6c[_0x5af9('0x4')]===_0x5af9('0xf')){if(_0x4c87d7['hasOwnProperty'](_0x5af9('0x39'))&&_0x4c87d7[_0x5af9('0x39')]&&_0x4c87d7[_0x5af9('0x39')]!=='--'){_0x353f99[_0x5af9('0xd')]({'type':_0x4c87d7[_0x5af9('0x4')][_0x5af9('0x38')](),'app':_0x5af9('0x5'),'appdata':_0x5af9('0x3a')+_0x4c87d7[_0x5af9('0x39')],'context':_0x120a6c[_0x5af9('0x6')],'exten':_0x120a6c['exten'],'priority':_0x4c87d7['intervals']['length']+_0x24812c+_0x1c6aba++,'VoiceExtensionId':_0x120a6c['id']});}_0x353f99[_0x5af9('0xd')]({'type':_0x4c87d7[_0x5af9('0x4')][_0x5af9('0x38')](),'app':_0x5af9('0x14'),'appdata':_0x5af9('0x3b')+(_0x4c87d7['callerID']?_0x5af9('0x3c')+_0x4c87d7['callerID']+')':_0x5af9('0x3d')),'context':_0x120a6c[_0x5af9('0x6')],'exten':_0x120a6c[_0x5af9('0x7')],'priority':_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')]+_0x24812c+_0x1c6aba++,'VoiceExtensionId':_0x120a6c['id']});}else{if(_0x4c87d7[_0x5af9('0x1b')](_0x5af9('0x3e'))){if([_0x5af9('0x3f'),_0x5af9('0x40')][_0x5af9('0x41')](_0x4c87d7[_0x5af9('0x42')][_0x5af9('0x38')]())&&_0x4c87d7[_0x5af9('0x43')]!==_0x5af9('0x44')){if(_0x4c87d7[_0x5af9('0x3e')]){_0x353f99['push']({'type':_0x4c87d7[_0x5af9('0x4')][_0x5af9('0x38')](),'app':_0x5af9('0x14'),'appdata':_0x5af9('0x45'),'context':_0x120a6c[_0x5af9('0x6')],'exten':_0x120a6c['exten'],'priority':_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')]+_0x24812c+_0x1c6aba++,'VoiceExtensionId':_0x120a6c['id']});_0x353f99['push']({'type':_0x4c87d7[_0x5af9('0x4')][_0x5af9('0x38')](),'app':_0x5af9('0x5'),'appdata':_0x5af9('0x46'),'context':_0x120a6c[_0x5af9('0x6')],'exten':_0x120a6c['exten'],'priority':_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')]+_0x24812c+_0x1c6aba++,'VoiceExtensionId':_0x120a6c['id']});}else{_0x353f99[_0x5af9('0xd')]({'type':_0x4c87d7[_0x5af9('0x4')][_0x5af9('0x38')](),'app':'ExecIf','appdata':_0x5af9('0x47'),'context':_0x120a6c[_0x5af9('0x6')],'exten':_0x120a6c[_0x5af9('0x7')],'priority':_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')]+_0x24812c+_0x1c6aba++,'VoiceExtensionId':_0x120a6c['id']});_0x353f99[_0x5af9('0xd')]({'type':_0x4c87d7[_0x5af9('0x4')]['toLowerCase'](),'app':_0x5af9('0x5'),'appdata':_0x5af9('0x48'),'context':_0x120a6c[_0x5af9('0x6')],'exten':_0x120a6c['exten'],'priority':_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')]+_0x24812c+_0x1c6aba++,'VoiceExtensionId':_0x120a6c['id']});}}}}for(var _0x244148=0x0;_0x244148<_0x4c87d7[_0x5af9('0x35')]['length'];_0x244148++){var _0x30f440=_0x24812c+_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')];var _0x4134f0=_0x244148===_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')]-0x1?_0x24812c+_0x353f99['length']+_0x497e5f[_0x5af9('0x23')]+0x2:_0x24812c+_0x244148+0x1;_0x353f99[_0x5af9('0x49')](_0x244148,0x0,{'type':_0x120a6c[_0x5af9('0x4')],'app':'GotoIfTime','appdata':_0x4c87d7['intervals'][_0x244148]+'?'+_0x120a6c[_0x5af9('0x6')]+_0x5af9('0x4a')+_0x30f440+':'+_0x120a6c[_0x5af9('0x6')]+_0x5af9('0x4a')+_0x4134f0,'exten':_0x120a6c[_0x5af9('0x7')],'context':_0x120a6c[_0x5af9('0x6')],'priority':_0x24812c+_0x244148,'VoiceExtensionId':_0x120a6c['id']});}if(_0x2e1296&&_0x4c87d7['appType']===_0x5af9('0x4b'))_0x4c87d7[_0x5af9('0x4c')]=_0x5b7b97(_0x4c87d7[_0x5af9('0x4c')]);_0x4c87d7[_0x5af9('0x4d')]=_0x353f99['length']?_[_0x5af9('0x4e')](_0x353f99)[_0x5af9('0x4d')]+0x1:_0x24812c;_0x62af83=_[_0x5af9('0x4f')](_0x62af83,_0x353f99,[_0x4c87d7],_0x497e5f);_0x24812c=_[_0x5af9('0x4e')](_0x62af83)[_0x5af9('0x4d')]+0x1;}return _0x58f275(_0x62af83);})[_0x5af9('0x50')](function(_0x3d895d){_0x33a9ce(_0x3d895d);});});}return _0x3582b1[_0x5af9('0x51')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x205d75,_0x25ab48){var _0x135a6f=this;var _0x22917e=_0x135a6f['type']===_0x5af9('0xf')?_0x2e53ff(_0x135a6f):_0x1d57da(_0x135a6f);return _0x10717d(_0x135a6f,_0x205d75,_[_0x5af9('0x4e')](_0x22917e)['priority']+0x1,_0x25ab48)[_0x5af9('0x33')](function(_0x1b13ba){var _0x4de6f6=_[_0x5af9('0x4f')](_0x22917e,_0x1b13ba);_0x4de6f6[_0x5af9('0xd')]({'type':_0x135a6f['type'],'app':_0x5af9('0x52'),'exten':_0x135a6f[_0x5af9('0x7')],'context':_0x135a6f[_0x5af9('0x6')],'priority':_['last'](_0x4de6f6)[_0x5af9('0x4d')]+0x1,'VoiceExtensionId':_0x135a6f['id']});return _0x4de6f6;});}}});};
\ No newline at end of file
+var _0xeaae=['custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','priority','concat','last','catch','voice_extensions','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','exten','alias','NoOp','No\x20alias\x20set','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','none','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','trunk','timeout','options','url','split','length','param','phone','prefix','SIP','U(xcally-mixmonitor-context)','replace','join','isEmpty','findAll','interval','IntervalId','*,*,*,*','intervals','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','callerID','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType'];(function(_0xce442d,_0x1ec906){var _0xb33e8c=function(_0x32ebfb){while(--_0x32ebfb){_0xce442d['push'](_0xce442d['shift']());}};_0xb33e8c(++_0x1ec906);}(_0xeaae,0x147));var _0xeeaa=function(_0xe4d478,_0x5816f3){_0xe4d478=_0xe4d478-0x0;var _0x406d06=_0xeaae[_0xe4d478];return _0x406d06;};'use strict';var util=require('util');var _=require(_0xeeaa('0x0'));var attributes=require(_0xeeaa('0x1'));module[_0xeeaa('0x2')]=function(_0x30e012){var _0x4031e8=_0x30e012[_0xeeaa('0x3')];function _0x189f35(_0x1c04b6){var _0x2fc622=0x2;var _0xf2886e=[{'type':_0x1c04b6[_0xeeaa('0x4')],'app':_0xeeaa('0x5'),'appdata':_0xeeaa('0x6')+_0x1c04b6[_0xeeaa('0x4')],'context':_0x1c04b6['context'],'exten':_0x1c04b6[_0xeeaa('0x7')],'priority':_0x2fc622++,'VoiceExtensionId':_0x1c04b6['id']},{'type':_0x1c04b6[_0xeeaa('0x4')],'app':_0x1c04b6[_0xeeaa('0x8')]?_0xeeaa('0x5'):_0xeeaa('0x9'),'appdata':_0x1c04b6[_0xeeaa('0x8')]?'CDR(routeAlias)='+_0x1c04b6[_0xeeaa('0x8')]:_0xeeaa('0xa'),'context':_0x1c04b6[_0xeeaa('0xb')],'exten':_0x1c04b6[_0xeeaa('0x7')],'priority':_0x2fc622++,'VoiceExtensionId':_0x1c04b6['id']}];if(_0x1c04b6[_0xeeaa('0x4')]===_0xeeaa('0xc')){_0xf2886e[_0xeeaa('0xd')]({'type':_0xeeaa('0xc'),'app':'Set','appdata':_0xeeaa('0xe')+_0x1c04b6['id'],'context':_0x1c04b6['context'],'exten':_0x1c04b6[_0xeeaa('0x7')],'priority':_0x2fc622++,'VoiceExtensionId':_0x1c04b6['id']});}_0xf2886e[_0xeeaa('0xd')]({'type':_0x1c04b6[_0xeeaa('0x4')],'app':_0xeeaa('0x5'),'appdata':_0xeeaa('0xf'),'context':_0x1c04b6['context'],'exten':_0x1c04b6['exten'],'priority':_0x2fc622++,'VoiceExtensionId':_0x1c04b6['id']},{'type':_0x1c04b6[_0xeeaa('0x4')],'app':'Set','appdata':_0xeeaa('0x10'),'context':_0x1c04b6[_0xeeaa('0xb')],'exten':_0x1c04b6['exten'],'priority':_0x2fc622++,'VoiceExtensionId':_0x1c04b6['id']},{'type':_0x1c04b6[_0xeeaa('0x4')],'app':_0xeeaa('0x5'),'appdata':_0xeeaa('0x11'),'context':_0x1c04b6['context'],'exten':_0x1c04b6[_0xeeaa('0x7')],'priority':_0x2fc622++,'VoiceExtensionId':_0x1c04b6['id']});return _0xf2886e;}function _0x4a65e5(_0x5fc33f){var _0x30f74c=0x2;var _0x281d51=[{'type':'outbound','app':_0xeeaa('0x5'),'appdata':_0xeeaa('0x12'),'context':_0x5fc33f['context'],'exten':_0x5fc33f[_0xeeaa('0x7')],'priority':_0x30f74c++,'VoiceExtensionId':_0x5fc33f['id']},{'type':_0xeeaa('0x13'),'app':_0x5fc33f[_0xeeaa('0x8')]?'Set':_0xeeaa('0x9'),'appdata':_0x5fc33f['alias']?_0xeeaa('0x14')+_0x5fc33f[_0xeeaa('0x8')]:_0xeeaa('0xa'),'context':_0x5fc33f[_0xeeaa('0xb')],'exten':_0x5fc33f[_0xeeaa('0x7')],'priority':_0x30f74c++,'VoiceExtensionId':_0x5fc33f['id']},{'type':'outbound','app':_0xeeaa('0x5'),'appdata':_0xeeaa('0x15')+(_0x5fc33f[_0xeeaa('0x16')]?'${EXTEN:'+_0x5fc33f['cutdigits']+'}':_0xeeaa('0x17')),'context':_0x5fc33f[_0xeeaa('0xb')],'exten':_0x5fc33f[_0xeeaa('0x7')],'priority':_0x30f74c++,'VoiceExtensionId':_0x5fc33f['id']},{'type':_0xeeaa('0x13'),'app':_0xeeaa('0x5'),'appdata':_0xeeaa('0xe')+_0x5fc33f['id'],'context':_0x5fc33f[_0xeeaa('0xb')],'exten':_0x5fc33f[_0xeeaa('0x7')],'priority':_0x30f74c++,'VoiceExtensionId':_0x5fc33f['id']},{'type':_0xeeaa('0x13'),'app':_0xeeaa('0x18'),'appdata':_0xeeaa('0x19')+(_0x30f74c+0x2)+'):Goto('+(_0x30f74c+0x1)+')','context':_0x5fc33f[_0xeeaa('0xb')],'exten':_0x5fc33f[_0xeeaa('0x7')],'priority':_0x30f74c++,'VoiceExtensionId':_0x5fc33f['id']},{'type':_0xeeaa('0x13'),'app':_0xeeaa('0x5'),'appdata':_0x5fc33f[_0xeeaa('0x16')]?'CDR(prefix)=${EXTEN:0:'+_0x5fc33f['cutdigits']+'}':_0xeeaa('0x1a'),'context':_0x5fc33f['context'],'exten':_0x5fc33f['exten'],'priority':_0x30f74c++,'VoiceExtensionId':_0x5fc33f['id']},{'type':'outbound','app':_0xeeaa('0x5'),'appdata':_0xeeaa('0xf'),'context':_0x5fc33f['context'],'exten':_0x5fc33f['exten'],'priority':_0x30f74c++,'VoiceExtensionId':_0x5fc33f['id']},{'type':_0xeeaa('0x13'),'app':_0xeeaa('0x5'),'appdata':_0xeeaa('0x10'),'context':_0x5fc33f[_0xeeaa('0xb')],'exten':_0x5fc33f['exten'],'priority':_0x30f74c++,'VoiceExtensionId':_0x5fc33f['id']},{'type':_0xeeaa('0x13'),'app':_0xeeaa('0x5'),'appdata':_0xeeaa('0x11'),'context':_0x5fc33f[_0xeeaa('0xb')],'exten':_0x5fc33f[_0xeeaa('0x7')],'priority':_0x30f74c++,'VoiceExtensionId':_0x5fc33f['id']},{'type':_0xeeaa('0x13'),'app':_0xeeaa('0x5'),'appdata':_0xeeaa('0x1b')+_0x5fc33f['id'],'context':_0x5fc33f[_0xeeaa('0xb')],'exten':_0x5fc33f['exten'],'priority':_0x30f74c++,'VoiceExtensionId':_0x5fc33f['id']}];if(_0x5fc33f['hasOwnProperty']('recordingFormat')&&_0x5fc33f['recordingFormat']!==_0xeeaa('0x1c')){_0x281d51[_0xeeaa('0xd')]({'type':_0xeeaa('0x13'),'app':_0xeeaa('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5fc33f['context'],'exten':_0x5fc33f[_0xeeaa('0x7')],'priority':_0x30f74c++,'VoiceExtensionId':_0x5fc33f['id']},{'type':'outbound','app':'Set','appdata':_0xeeaa('0x1d')+_0x5fc33f[_0xeeaa('0x1e')]||_0xeeaa('0x1f'),'context':_0x5fc33f['context'],'exten':_0x5fc33f['exten'],'priority':_0x30f74c++,'VoiceExtensionId':_0x5fc33f['id']});}return _0x281d51;}function _0x29f55b(_0x346e43){var _0x313942=[{'name':_0xeeaa('0x20'),'param':0x0},{'name':_0xeeaa('0x21'),'param':0x1},{'name':_0xeeaa('0x22'),'param':0x2},{'name':_0xeeaa('0x23'),'param':0x3}];var _0x1e3b59={};var _0x123832=_0x346e43[_0xeeaa('0x24')](',');var _0x4ce585=[];for(var _0x3845c0=0x0;_0x3845c0<_0x313942[_0xeeaa('0x25')];_0x3845c0++){switch(_0x313942[_0x3845c0]['name']){case _0xeeaa('0x20'):_0x1e3b59[_0xeeaa('0x20')]=_0x123832[_0x313942[_0x3845c0][_0xeeaa('0x26')]]['split']('/')[0x1];_0x1e3b59[_0xeeaa('0x27')]=_0x123832[_0x313942[_0x3845c0][_0xeeaa('0x26')]][_0xeeaa('0x24')]('/')[0x2];_0x1e3b59[_0xeeaa('0x28')]=_0x1e3b59['phone']?_0x1e3b59[_0xeeaa('0x27')][_0xeeaa('0x24')]('$')[0x0]:undefined;_0x1e3b59[_0xeeaa('0x27')]=route[_0xeeaa('0x16')]?(_0x1e3b59['prefix']||'')+'${EXTEN:'+route[_0xeeaa('0x16')]+'}':(_0x1e3b59[_0xeeaa('0x28')]||'')+_0xeeaa('0x17');_0x4ce585[_0x313942[_0x3845c0]['param']]=[_0xeeaa('0x29'),_0x1e3b59[_0xeeaa('0x20')],_0x1e3b59[_0xeeaa('0x27')]]['join']('/');break;case _0xeeaa('0x22'):_0x1e3b59[_0xeeaa('0x22')]=_0x123832[_0x313942[_0x3845c0]['param']];if(route[_0xeeaa('0x1e')]!=='none'){if(_0x1e3b59[_0xeeaa('0x22')]['indexOf'](_0xeeaa('0x2a'))<0x0){_0x1e3b59['options']+=_0xeeaa('0x2a');}}else{_0x1e3b59[_0xeeaa('0x22')]=_0x1e3b59[_0xeeaa('0x22')][_0xeeaa('0x2b')](_0xeeaa('0x2a'),'');}_0x4ce585[_0x313942[_0x3845c0]['param']]=_0x1e3b59['options'];break;default:_0x4ce585[_0x313942[_0x3845c0][_0xeeaa('0x26')]]=_0x123832[_0x313942[_0x3845c0]['param']];}}return _0x4ce585[_0xeeaa('0x2c')](',');}function _0x58d238(_0x1b50ee,_0x1d968c,_0x389bb3,_0x7de462){return new Promise(function(_0x3bdb38,_0x27866f){var _0x10ac13=[];if(_[_0xeeaa('0x2d')](_0x1d968c))return _0x3bdb38(_0x10ac13);_0x4031e8['Interval'][_0xeeaa('0x2e')]({'attributes':['id',_0xeeaa('0x2f'),_0xeeaa('0x30')],'raw':!![]})['then'](function(_0x3fed25){for(var _0x1661ee=0x0,_0x39918b=0x0;_0x1661ee<_0x1d968c[_0xeeaa('0x25')];_0x1661ee++,_0x39918b=0x0){var _0xe8be15=_0x1d968c[_0x1661ee];var _0x1330d7=[];var _0x4e3693=[];if(_0xe8be15['interval']!==_0xeeaa('0x31')){_0xe8be15[_0xeeaa('0x32')]=[_0xe8be15[_0xeeaa('0x2f')]];}else{_0xe8be15[_0xeeaa('0x32')]=_0xe8be15[_0xeeaa('0x30')]?_['map'](_[_0xeeaa('0x33')](_0x3fed25,{'IntervalId':_0xe8be15[_0xeeaa('0x30')]}),_0xeeaa('0x2f')):[];}_0xe8be15['context']=_0x1b50ee['context'];_0xe8be15[_0xeeaa('0x7')]=_0x1b50ee['exten'];if(_0xe8be15[_0xeeaa('0x4')])_0xe8be15['type']=_0xe8be15[_0xeeaa('0x4')][_0xeeaa('0x34')]();if(_0x1b50ee[_0xeeaa('0x4')]==='outbound'){if(_0xe8be15[_0xeeaa('0x35')]('tag')&&_0xe8be15[_0xeeaa('0x36')]&&_0xe8be15[_0xeeaa('0x36')]!=='--'){_0x1330d7['push']({'type':_0xe8be15[_0xeeaa('0x4')]['toLowerCase'](),'app':_0xeeaa('0x5'),'appdata':_0xeeaa('0x37')+_0xe8be15[_0xeeaa('0x36')],'context':_0x1b50ee[_0xeeaa('0xb')],'exten':_0x1b50ee[_0xeeaa('0x7')],'priority':_0xe8be15[_0xeeaa('0x32')][_0xeeaa('0x25')]+_0x389bb3+_0x39918b++,'VoiceExtensionId':_0x1b50ee['id']});}_0x1330d7[_0xeeaa('0xd')]({'type':_0xe8be15[_0xeeaa('0x4')]['toLowerCase'](),'app':_0xeeaa('0x18'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0xe8be15[_0xeeaa('0x38')]?'Set(CALLERID(all)='+_0xe8be15['callerID']+')':_0xeeaa('0x39')),'context':_0x1b50ee[_0xeeaa('0xb')],'exten':_0x1b50ee[_0xeeaa('0x7')],'priority':_0xe8be15[_0xeeaa('0x32')][_0xeeaa('0x25')]+_0x389bb3+_0x39918b++,'VoiceExtensionId':_0x1b50ee['id']});}else{if(_0xe8be15['hasOwnProperty'](_0xeeaa('0x3a'))){if(['queue',_0xeeaa('0x3b')][_0xeeaa('0x3c')](_0xe8be15[_0xeeaa('0x3d')][_0xeeaa('0x34')]())&&_0xe8be15[_0xeeaa('0x3e')]!==_0xeeaa('0x3f')){if(_0xe8be15['answer']){_0x1330d7['push']({'type':_0xe8be15[_0xeeaa('0x4')][_0xeeaa('0x34')](),'app':'ExecIf','appdata':_0xeeaa('0x40'),'context':_0x1b50ee[_0xeeaa('0xb')],'exten':_0x1b50ee[_0xeeaa('0x7')],'priority':_0xe8be15[_0xeeaa('0x32')]['length']+_0x389bb3+_0x39918b++,'VoiceExtensionId':_0x1b50ee['id']});_0x1330d7[_0xeeaa('0xd')]({'type':_0xe8be15[_0xeeaa('0x4')][_0xeeaa('0x34')](),'app':_0xeeaa('0x5'),'appdata':_0xeeaa('0x41'),'context':_0x1b50ee[_0xeeaa('0xb')],'exten':_0x1b50ee['exten'],'priority':_0xe8be15['intervals'][_0xeeaa('0x25')]+_0x389bb3+_0x39918b++,'VoiceExtensionId':_0x1b50ee['id']});}else{_0x1330d7[_0xeeaa('0xd')]({'type':_0xe8be15['type'][_0xeeaa('0x34')](),'app':_0xeeaa('0x18'),'appdata':_0xeeaa('0x42'),'context':_0x1b50ee[_0xeeaa('0xb')],'exten':_0x1b50ee[_0xeeaa('0x7')],'priority':_0xe8be15[_0xeeaa('0x32')]['length']+_0x389bb3+_0x39918b++,'VoiceExtensionId':_0x1b50ee['id']});_0x1330d7[_0xeeaa('0xd')]({'type':_0xe8be15[_0xeeaa('0x4')][_0xeeaa('0x34')](),'app':'Set','appdata':_0xeeaa('0x43'),'context':_0x1b50ee[_0xeeaa('0xb')],'exten':_0x1b50ee[_0xeeaa('0x7')],'priority':_0xe8be15[_0xeeaa('0x32')][_0xeeaa('0x25')]+_0x389bb3+_0x39918b++,'VoiceExtensionId':_0x1b50ee['id']});}}}}for(var _0x1a2ab8=0x0;_0x1a2ab8<_0xe8be15[_0xeeaa('0x32')][_0xeeaa('0x25')];_0x1a2ab8++){var _0x4d0a03=_0x389bb3+_0xe8be15[_0xeeaa('0x32')][_0xeeaa('0x25')];var _0x4d0d65=_0x1a2ab8===_0xe8be15['intervals'][_0xeeaa('0x25')]-0x1?_0x389bb3+_0x1330d7[_0xeeaa('0x25')]+_0x4e3693[_0xeeaa('0x25')]+0x2:_0x389bb3+_0x1a2ab8+0x1;_0x1330d7[_0xeeaa('0x44')](_0x1a2ab8,0x0,{'type':_0x1b50ee[_0xeeaa('0x4')],'app':'GotoIfTime','appdata':_0xe8be15[_0xeeaa('0x32')][_0x1a2ab8]+'?'+_0x1b50ee[_0xeeaa('0xb')]+_0xeeaa('0x45')+_0x4d0a03+':'+_0x1b50ee[_0xeeaa('0xb')]+',${EXTEN},'+_0x4d0d65,'exten':_0x1b50ee[_0xeeaa('0x7')],'context':_0x1b50ee[_0xeeaa('0xb')],'priority':_0x389bb3+_0x1a2ab8,'VoiceExtensionId':_0x1b50ee['id']});}if(_0x7de462&&_0xe8be15[_0xeeaa('0x3e')]===_0xeeaa('0x46'))_0xe8be15[_0xeeaa('0x47')]=_0x29f55b(_0xe8be15[_0xeeaa('0x47')]);_0xe8be15[_0xeeaa('0x48')]=_0x1330d7['length']?_['last'](_0x1330d7)[_0xeeaa('0x48')]+0x1:_0x389bb3;_0x10ac13=_[_0xeeaa('0x49')](_0x10ac13,_0x1330d7,[_0xe8be15],_0x4e3693);_0x389bb3=_[_0xeeaa('0x4a')](_0x10ac13)['priority']+0x1;}return _0x3bdb38(_0x10ac13);})[_0xeeaa('0x4b')](function(_0x275435){_0x27866f(_0x275435);});});}return _0x30e012['define']('VoiceExtension',attributes,{'tableName':_0xeeaa('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x29cb04,_0x4f7937){var _0x35b3d6=this;var _0x40e8c0=_0x35b3d6[_0xeeaa('0x4')]===_0xeeaa('0x13')?_0x4a65e5(_0x35b3d6):_0x189f35(_0x35b3d6);return _0x58d238(_0x35b3d6,_0x29cb04,_[_0xeeaa('0x4a')](_0x40e8c0)[_0xeeaa('0x48')]+0x1,_0x4f7937)['then'](function(_0x5c2269){var _0x43503d=_[_0xeeaa('0x49')](_0x40e8c0,_0x5c2269);_0x43503d[_0xeeaa('0xd')]({'type':_0x35b3d6[_0xeeaa('0x4')],'app':_0xeeaa('0x4d'),'exten':_0x35b3d6[_0xeeaa('0x7')],'context':_0x35b3d6['context'],'priority':_[_0xeeaa('0x4a')](_0x43503d)['priority']+0x1,'VoiceExtensionId':_0x35b3d6['id']});return _0x43503d;});}}});};
\ No newline at end of file
index 1b0fdd2..42f83b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x770d=['error','code','message','result','catch','VoiceExtension','findAll','options','raw','where','attributes','limit','map','model','include','GetVoiceExtension','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x770d,0x122));var _0xd770=function(_0x262cc2,_0x1d1c6c){_0x262cc2=_0x262cc2-0x0;var _0x395c55=_0x770d[_0x262cc2];return _0x395c55;};'use strict';var _=require(_0xd770('0x0'));var util=require(_0xd770('0x1'));var moment=require(_0xd770('0x2'));var BPromise=require(_0xd770('0x3'));var rs=require(_0xd770('0x4'));var fs=require('fs');var Redis=require(_0xd770('0x5'));var db=require(_0xd770('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd770('0x7'))(_0xd770('0x8'));var config=require(_0xd770('0x9'));var jayson=require(_0xd770('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xd770('0xb')]=_[_0xd770('0xc')](config[_0xd770('0xb')],{'host':_0xd770('0xd'),'port':0x18eb});var socket=require(_0xd770('0xe'))(new Redis(config[_0xd770('0xb')]));require(_0xd770('0xf'))['register'](socket);function respondWithRpcPromise(_0x3ab81f,_0x36f62b,_0x38da18){return new BPromise(function(_0x46775b,_0x32a6cf){return client['request'](_0x3ab81f,_0x38da18)[_0xd770('0x10')](function(_0x1a1c5b){logger[_0xd770('0x11')](_0xd770('0x12'),_0x36f62b,_0xd770('0x13'));logger[_0xd770('0x14')](_0xd770('0x15'),_0x36f62b,_0xd770('0x13'),JSON['stringify'](_0x1a1c5b));if(_0x1a1c5b['error']){if(_0x1a1c5b[_0xd770('0x16')][_0xd770('0x17')]===0x1f4){logger[_0xd770('0x16')](_0xd770('0x12'),_0x36f62b,_0x1a1c5b['error'][_0xd770('0x18')]);return _0x32a6cf(_0x1a1c5b[_0xd770('0x16')][_0xd770('0x18')]);}logger[_0xd770('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x36f62b,_0x1a1c5b[_0xd770('0x16')]['message']);return _0x46775b(_0x1a1c5b[_0xd770('0x16')][_0xd770('0x18')]);}else{logger[_0xd770('0x11')](_0xd770('0x12'),_0x36f62b,_0xd770('0x13'));_0x46775b(_0x1a1c5b[_0xd770('0x19')][_0xd770('0x18')]);}})[_0xd770('0x1a')](function(_0x42964b){logger['error'](_0xd770('0x12'),_0x36f62b,_0x42964b);_0x32a6cf(_0x42964b);});});}exports['GetVoiceExtension']=function(_0x143ee1){var _0x5d802e=this;return new Promise(function(_0x28ac07,_0x25e076){return db[_0xd770('0x1b')][_0xd770('0x1c')]({'raw':_0x143ee1[_0xd770('0x1d')]?_0x143ee1['options'][_0xd770('0x1e')]===undefined?!![]:![]:!![],'where':_0x143ee1[_0xd770('0x1d')]?_0x143ee1['options'][_0xd770('0x1f')]||null:null,'attributes':_0x143ee1[_0xd770('0x1d')]?_0x143ee1[_0xd770('0x1d')][_0xd770('0x20')]||null:null,'limit':_0x143ee1['options']?_0x143ee1[_0xd770('0x1d')][_0xd770('0x21')]||null:null,'include':_0x143ee1[_0xd770('0x1d')]?_0x143ee1[_0xd770('0x1d')]['include']?_[_0xd770('0x22')](_0x143ee1[_0xd770('0x1d')]['include'],function(_0x4cc1e3){return{'model':db[_0x4cc1e3[_0xd770('0x23')]],'as':_0x4cc1e3['as'],'attributes':_0x4cc1e3[_0xd770('0x20')],'include':_0x4cc1e3[_0xd770('0x24')]?_[_0xd770('0x22')](_0x4cc1e3[_0xd770('0x24')],function(_0x112aaf){return{'model':db[_0x112aaf[_0xd770('0x23')]],'as':_0x112aaf['as'],'attributes':_0x112aaf['attributes'],'include':_0x112aaf[_0xd770('0x24')]?_[_0xd770('0x22')](_0x112aaf['include'],function(_0x56f299){return{'model':db[_0x56f299[_0xd770('0x23')]],'as':_0x56f299['as'],'attributes':_0x56f299[_0xd770('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d9b42){logger[_0xd770('0x11')](_0xd770('0x25'),_0x143ee1);logger[_0xd770('0x14')]('GetVoiceExtension',_0x143ee1,JSON[_0xd770('0x26')](_0x3d9b42));_0x28ac07(_0x3d9b42);})['catch'](function(_0x4c6c2d){logger[_0xd770('0x16')](_0xd770('0x25'),_0x4c6c2d['message'],_0x143ee1);_0x25e076(_0x5d802e['error'](0x1f4,_0x4c6c2d[_0xd770('0x18')]));});});};
\ No newline at end of file
+var _0xf95f=['debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','VoiceExtension,\x20%s,\x20%s','message','result','catch','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','GetVoiceExtension','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xf95f,0x142));var _0xff95=function(_0x51e395,_0x5bfe2c){_0x51e395=_0x51e395-0x0;var _0x12ccef=_0xf95f[_0x51e395];return _0x12ccef;};'use strict';var _=require(_0xff95('0x0'));var util=require(_0xff95('0x1'));var moment=require(_0xff95('0x2'));var BPromise=require(_0xff95('0x3'));var rs=require(_0xff95('0x4'));var fs=require('fs');var Redis=require(_0xff95('0x5'));var db=require(_0xff95('0x6'))['db'];var utils=require(_0xff95('0x7'));var logger=require(_0xff95('0x8'))('rpc');var config=require(_0xff95('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff95('0xa')]['http']({'port':0x232a});config[_0xff95('0xb')]=_[_0xff95('0xc')](config[_0xff95('0xb')],{'host':_0xff95('0xd'),'port':0x18eb});var socket=require(_0xff95('0xe'))(new Redis(config[_0xff95('0xb')]));require(_0xff95('0xf'))[_0xff95('0x10')](socket);function respondWithRpcPromise(_0x522870,_0x50293a,_0x405908){return new BPromise(function(_0x4547b5,_0x3e5d26){return client[_0xff95('0x11')](_0x522870,_0x405908)[_0xff95('0x12')](function(_0x4245a4){logger[_0xff95('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x50293a,'request\x20sent');logger[_0xff95('0x14')](_0xff95('0x15'),_0x50293a,'request\x20sent',JSON[_0xff95('0x16')](_0x4245a4));if(_0x4245a4['error']){if(_0x4245a4['error']['code']===0x1f4){logger[_0xff95('0x17')](_0xff95('0x18'),_0x50293a,_0x4245a4[_0xff95('0x17')][_0xff95('0x19')]);return _0x3e5d26(_0x4245a4[_0xff95('0x17')][_0xff95('0x19')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x50293a,_0x4245a4[_0xff95('0x17')][_0xff95('0x19')]);return _0x4547b5(_0x4245a4[_0xff95('0x17')][_0xff95('0x19')]);}else{logger[_0xff95('0x13')](_0xff95('0x18'),_0x50293a,'request\x20sent');_0x4547b5(_0x4245a4[_0xff95('0x1a')][_0xff95('0x19')]);}})[_0xff95('0x1b')](function(_0x49f1fb){logger['error'](_0xff95('0x18'),_0x50293a,_0x49f1fb);_0x3e5d26(_0x49f1fb);});});}exports['GetVoiceExtension']=function(_0x379bba){var _0x1661b9=this;return new Promise(function(_0x3a3f10,_0x40ebfd){return db[_0xff95('0x1c')][_0xff95('0x1d')]({'raw':_0x379bba[_0xff95('0x1e')]?_0x379bba[_0xff95('0x1e')][_0xff95('0x1f')]===undefined?!![]:![]:!![],'where':_0x379bba[_0xff95('0x1e')]?_0x379bba[_0xff95('0x1e')]['where']||null:null,'attributes':_0x379bba[_0xff95('0x1e')]?_0x379bba[_0xff95('0x1e')][_0xff95('0x20')]||null:null,'limit':_0x379bba[_0xff95('0x1e')]?_0x379bba[_0xff95('0x1e')][_0xff95('0x21')]||null:null,'include':_0x379bba[_0xff95('0x1e')]?_0x379bba[_0xff95('0x1e')][_0xff95('0x22')]?_[_0xff95('0x23')](_0x379bba['options']['include'],function(_0x50a5c2){return{'model':db[_0x50a5c2['model']],'as':_0x50a5c2['as'],'attributes':_0x50a5c2[_0xff95('0x20')],'include':_0x50a5c2[_0xff95('0x22')]?_[_0xff95('0x23')](_0x50a5c2[_0xff95('0x22')],function(_0x2b98e0){return{'model':db[_0x2b98e0['model']],'as':_0x2b98e0['as'],'attributes':_0x2b98e0[_0xff95('0x20')],'include':_0x2b98e0[_0xff95('0x22')]?_[_0xff95('0x23')](_0x2b98e0[_0xff95('0x22')],function(_0x2528a4){return{'model':db[_0x2528a4[_0xff95('0x24')]],'as':_0x2528a4['as'],'attributes':_0x2528a4[_0xff95('0x20')]};}):[]};}):[]};}):[]:[]})[_0xff95('0x12')](function(_0x2c0f2c){logger['info'](_0xff95('0x25'),_0x379bba);logger[_0xff95('0x14')]('GetVoiceExtension',_0x379bba,JSON[_0xff95('0x16')](_0x2c0f2c));_0x3a3f10(_0x2c0f2c);})['catch'](function(_0x369036){logger['error']('GetVoiceExtension',_0x369036[_0xff95('0x19')],_0x379bba);_0x40ebfd(_0x1661b9[_0xff95('0x17')](0x1f4,_0x369036[_0xff95('0x19')]));});});};
\ No newline at end of file
index 4d5904c..cb2b1b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x42aa9c,_0x3b9d6e){var _0x5872dd=function(_0x30af7a){while(--_0x30af7a){_0x42aa9c['push'](_0x42aa9c['shift']());}};_0x5872dd(++_0x3b9d6e);}(_0xf494,0x1c6));var _0x4f49=function(_0x3bf31f,_0x189039){_0x3bf31f=_0x3bf31f-0x0;var _0x4eeca6=_0xf494[_0x3bf31f];return _0x4eeca6;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}};
\ No newline at end of file
+var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x288878,_0xd6527d){var _0x32c841=function(_0x42459b){while(--_0x42459b){_0x288878['push'](_0x288878['shift']());}};_0x32c841(++_0xd6527d);}(_0xabce,0x103));var _0xeabc=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xabce[_0x1d9aa0];return _0x226868;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}};
\ No newline at end of file
index b3d5d35..f765089 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77d4=['index','show','getMessages','post','create','/:id','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../config/environment','./voiceMail.controller','get','isAuthenticated'];(function(_0x3c3eda,_0x3e788f){var _0x28aca3=function(_0x265b06){while(--_0x265b06){_0x3c3eda['push'](_0x3c3eda['shift']());}};_0x28aca3(++_0x3e788f);}(_0x77d4,0x108));var _0x477d=function(_0x521884,_0x430df3){_0x521884=_0x521884-0x0;var _0x5ceb0e=_0x77d4[_0x521884];return _0x5ceb0e;};'use strict';var multer=require('multer');var util=require(_0x477d('0x0'));var path=require('path');var timeout=require(_0x477d('0x1'));var express=require('express');var router=express[_0x477d('0x2')]();var fs_extra=require(_0x477d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x477d('0x4'));var controller=require(_0x477d('0x5'));router[_0x477d('0x6')]('/',auth[_0x477d('0x7')](),controller[_0x477d('0x8')]);router[_0x477d('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x477d('0x9')]);router['get']('/:id/messages',auth[_0x477d('0x7')](),controller[_0x477d('0xa')]);router[_0x477d('0xb')]('/',auth[_0x477d('0x7')](),controller[_0x477d('0xc')]);router['put'](_0x477d('0xd'),auth['isAuthenticated'](),controller[_0x477d('0xe')]);router[_0x477d('0xf')]('/:id',auth[_0x477d('0x7')](),controller[_0x477d('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x6050=['/:id/messages','isAuthenticated','getMessages','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','show','get'];(function(_0xb991d3,_0x2b99ef){var _0x135185=function(_0x140869){while(--_0x140869){_0xb991d3['push'](_0xb991d3['shift']());}};_0x135185(++_0x2b99ef);}(_0x6050,0x196));var _0x0605=function(_0x422be0,_0xbc6de6){_0x422be0=_0x422be0-0x0;var _0x29bf5d=_0x6050[_0x422be0];return _0x29bf5d;};'use strict';var multer=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var path=require(_0x0605('0x2'));var timeout=require(_0x0605('0x3'));var express=require(_0x0605('0x4'));var router=express[_0x0605('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0605('0x6'));var interaction=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var controller=require('./voiceMail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0605('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0605('0xa')]);router[_0x0605('0xb')](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0xe')]);router['post']('/',auth[_0x0605('0xd')](),controller[_0x0605('0xf')]);router[_0x0605('0x10')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x12')]);router[_0x0605('0x13')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x14')]);module[_0x0605('0x15')]=router;
\ No newline at end of file
index 53669f7..49fe43c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e5e=['VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x524ce0,_0x3670b2){var _0x38299f=function(_0x513ef4){while(--_0x513ef4){_0x524ce0['push'](_0x524ce0['shift']());}};_0x38299f(++_0x3670b2);}(_0x1e5e,0x181));var _0xe1e5=function(_0x43a14f,_0x1c7d05){_0x43a14f=_0x43a14f-0x0;var _0x1f96ef=_0x1e5e[_0x43a14f];return _0x1f96ef;};'use strict';var Sequelize=require(_0xe1e5('0x0'));module[_0xe1e5('0x1')]={'customer_id':{'type':Sequelize[_0xe1e5('0x2')]},'context':{'type':Sequelize[_0xe1e5('0x2')],'defaultValue':_0xe1e5('0x3'),'unique':_0xe1e5('0x4')},'mailbox':{'type':Sequelize[_0xe1e5('0x2')],'defaultValue':'','allowNull':![],'unique':_0xe1e5('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xe1e5('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x485eab){this[_0xe1e5('0x5')](_0xe1e5('0x6'),typeof _0x485eab===_0xe1e5('0x7')&&_0x485eab[_0xe1e5('0x8')]()?_0x485eab[_0xe1e5('0x8')]():null);}},'pager':{'type':Sequelize[_0xe1e5('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xe1e5('0x9')},'attach':{'type':Sequelize[_0xe1e5('0xa')](_0xe1e5('0xb'),'no'),'defaultValue':_0xe1e5('0xb'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xe1e5('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0xe1e5('0x2')]},'callback':{'type':Sequelize[_0xe1e5('0x2')]},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xe1e5('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xe1e5('0xa')](_0xe1e5('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xe1e5('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xe1e5('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xe1e5('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xe1e5('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe1e5('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xe1e5('0xa')](_0xe1e5('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe1e5('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xe1e5('0xb'),'no'),'defaultValue':_0xe1e5('0xb'),'allowNull':![]},'stamp':{'type':_0xe1e5('0xd')},'emailsubject':{'type':Sequelize[_0xe1e5('0x2')]},'emailbody':{'type':Sequelize[_0xe1e5('0x2')]},'maxsecs':{'type':Sequelize[_0xe1e5('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe1e5('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe1e5('0xf')],'get':function(){return this[_0xe1e5('0x10')](_0xe1e5('0x11'))+_0xe1e5('0x12')+this[_0xe1e5('0x10')](_0xe1e5('0x13'));}}};
\ No newline at end of file
+var _0x14b7=['TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)'];(function(_0x28beaf,_0x122959){var _0x2df201=function(_0x583fd1){while(--_0x583fd1){_0x28beaf['push'](_0x28beaf['shift']());}};_0x2df201(++_0x122959);}(_0x14b7,0x183));var _0x714b=function(_0x256ffb,_0x19f08f){_0x256ffb=_0x256ffb-0x0;var _0x3c9a19=_0x14b7[_0x256ffb];return _0x3c9a19;};'use strict';var Sequelize=require(_0x714b('0x0'));module[_0x714b('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x714b('0x2')],'defaultValue':_0x714b('0x3'),'unique':_0x714b('0x4')},'mailbox':{'type':Sequelize[_0x714b('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x714b('0x2')]},'fullname':{'type':Sequelize[_0x714b('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x1586aa){this[_0x714b('0x5')](_0x714b('0x6'),typeof _0x1586aa===_0x714b('0x7')&&_0x1586aa[_0x714b('0x8')]()?_0x1586aa[_0x714b('0x8')]():null);}},'pager':{'type':Sequelize[_0x714b('0x2')]},'tz':{'type':Sequelize[_0x714b('0x2')],'defaultValue':_0x714b('0x9')},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x714b('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x714b('0xb')]('yes','no'),'defaultValue':_0x714b('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x714b('0x2')]},'review':{'type':Sequelize[_0x714b('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x714b('0xb')](_0x714b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x714b('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x714b('0xb')](_0x714b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x714b('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x714b('0xb')](_0x714b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x714b('0xa'),'no'),'defaultValue':_0x714b('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x714b('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x714b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x714b('0xb')](_0x714b('0xa'),'no'),'defaultValue':_0x714b('0xa'),'allowNull':![]},'stamp':{'type':_0x714b('0xd')},'emailsubject':{'type':Sequelize[_0x714b('0x2')]},'emailbody':{'type':Sequelize[_0x714b('0x2')]},'maxsecs':{'type':Sequelize[_0x714b('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x714b('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x714b('0xf')],'get':function(){return this[_0x714b('0x10')](_0x714b('0x11'))+_0x714b('0x12')+this[_0x714b('0x10')](_0x714b('0x13'));}}};
\ No newline at end of file
index 2156c66..87dcd31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb58b=['destroy','then','get','Voicemails','error','stack','name','send','index','VoiceMail','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0xb58b,0x1f1));var _0xbb58=function(_0x895219,_0x654a80){_0x895219=_0x895219-0x0;var _0x1bb732=_0xb58b[_0x895219];return _0x1bb732;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe88799,_0x18810f){_0x18810f=_0x18810f||0xcc;return function(_0x4cda21){if(_0x4cda21){return _0xe88799[_0xbb58('0x18')](_0x18810f);}return _0xe88799[_0xbb58('0x19')](_0x18810f)[_0xbb58('0x1a')]();};}function respondWithResult(_0x3b9406,_0x19ceda){_0x19ceda=_0x19ceda||0xc8;return function(_0x58245f){if(_0x58245f){return _0x3b9406[_0xbb58('0x19')](_0x19ceda)[_0xbb58('0x1b')](_0x58245f);}};}function respondWithFilteredResult(_0x5f4751,_0x4ba30e){return function(_0x33c20f){if(_0x33c20f){var _0x445b1f=typeof _0x4ba30e[_0xbb58('0x1c')]==='undefined'&&typeof _0x4ba30e['limit']==='undefined';var _0x55156e=_0x33c20f[_0xbb58('0x1d')];var _0x3134ea=_0x445b1f?0x0:_0x4ba30e['offset'];var _0xbee66=_0x445b1f?_0x33c20f['count']:_0x4ba30e[_0xbb58('0x1c')]+_0x4ba30e[_0xbb58('0x1e')];var _0x3c33d9;if(_0xbee66>=_0x55156e){_0xbee66=_0x55156e;_0x3c33d9=0xc8;}else{_0x3c33d9=0xce;}_0x5f4751[_0xbb58('0x19')](_0x3c33d9);return _0x5f4751[_0xbb58('0x1f')](_0xbb58('0x20'),_0x3134ea+'-'+_0xbee66+'/'+_0x55156e)[_0xbb58('0x1b')](_0x33c20f);}return null;};}function patchUpdates(_0x497fd0){return function(_0x84f34){try{jsonpatch[_0xbb58('0x21')](_0x84f34,_0x497fd0,!![]);}catch(_0x3e64fe){return BPromise[_0xbb58('0x22')](_0x3e64fe);}return _0x84f34[_0xbb58('0x23')]();};}function saveUpdates(_0x5d4a91,_0x49453a){return function(_0x350be7){if(_0x350be7){return _0x350be7[_0xbb58('0x24')](_0x5d4a91)['then'](function(_0x27806d){return _0x27806d;});}return null;};}function removeEntity(_0x53b693,_0x21964d){return function(_0x287822){if(_0x287822){return _0x287822[_0xbb58('0x25')]()[_0xbb58('0x26')](function(){var _0x2d111c=_0x287822[_0xbb58('0x27')]({'plain':!![]});var _0x2d556a=_0xbb58('0x28');return db['UserProfileResource'][_0xbb58('0x25')]({'where':{'type':_0x2d556a,'resourceId':_0x2d111c['id']}})[_0xbb58('0x26')](function(){return _0x287822;});})[_0xbb58('0x26')](function(){_0x53b693[_0xbb58('0x19')](0xcc)[_0xbb58('0x1a')]();});}};}function handleEntityNotFound(_0x521d0c,_0x3608dc){return function(_0x2ce7c3){if(!_0x2ce7c3){_0x521d0c[_0xbb58('0x18')](0x194);}return _0x2ce7c3;};}function handleError(_0x2d5b39,_0xf6687e){_0xf6687e=_0xf6687e||0x1f4;return function(_0x28b3a3){logger[_0xbb58('0x29')](_0x28b3a3[_0xbb58('0x2a')]);if(_0x28b3a3[_0xbb58('0x2b')]){delete _0x28b3a3['name'];}_0x2d5b39[_0xbb58('0x19')](_0xf6687e)[_0xbb58('0x2c')](_0x28b3a3);};}exports[_0xbb58('0x2d')]=function(_0x3c9cee,_0x3304b9){var _0x9d379f={},_0x1ba526={},_0x643e0e={'count':0x0,'rows':[]};var _0x3f8db3=_['map'](db[_0xbb58('0x2e')][_0xbb58('0x2f')],function(_0x3edc34){return{'name':_0x3edc34[_0xbb58('0x30')],'type':_0x3edc34[_0xbb58('0x31')][_0xbb58('0x32')]};});_0x1ba526[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x3f8db3,_0xbb58('0x2b'));_0x1ba526[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3c9cee[_0xbb58('0x35')]);_0x1ba526[_0xbb58('0x37')]=_['intersection'](_0x1ba526['model'],_0x1ba526['query']);_0x9d379f[_0xbb58('0x38')]=_[_0xbb58('0x39')](_0x1ba526[_0xbb58('0x33')],qs[_0xbb58('0x3a')](_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x3a')]));_0x9d379f[_0xbb58('0x38')]=_0x9d379f[_0xbb58('0x38')]['length']?_0x9d379f[_0xbb58('0x38')]:_0x1ba526[_0xbb58('0x33')];if(!_0x3c9cee['query'][_0xbb58('0x3b')]('nolimit')){_0x9d379f[_0xbb58('0x1e')]=qs['limit'](_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x1e')]);_0x9d379f['offset']=qs[_0xbb58('0x1c')](_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x1c')]);}_0x9d379f[_0xbb58('0x3c')]=qs[_0xbb58('0x3d')](_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x3d')]);_0x9d379f[_0xbb58('0x3e')]=qs['filters'](_[_0xbb58('0x3f')](_0x3c9cee[_0xbb58('0x35')],_0x1ba526[_0xbb58('0x37')]),_0x3f8db3);if(_0x3c9cee['query']['filter']){_0x9d379f[_0xbb58('0x3e')]=_['merge'](_0x9d379f[_0xbb58('0x3e')],{'$or':_[_0xbb58('0x34')](_0x3f8db3,function(_0x2ab2d8){if(_0x2ab2d8['type']!=='VIRTUAL'){var _0xc29171={};_0xc29171[_0x2ab2d8[_0xbb58('0x2b')]]={'$like':'%'+_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x40')]+'%'};return _0xc29171;}})});}_0x9d379f=_[_0xbb58('0x41')]({},_0x9d379f,_0x3c9cee[_0xbb58('0x42')]);var _0x5797e7={'where':_0x9d379f[_0xbb58('0x3e')]};return db[_0xbb58('0x2e')][_0xbb58('0x1d')](_0x5797e7)[_0xbb58('0x26')](function(_0x1185b3){_0x643e0e[_0xbb58('0x1d')]=_0x1185b3;if(_0x3c9cee['query'][_0xbb58('0x43')]){_0x9d379f['include']=[{'all':!![]}];}return db[_0xbb58('0x2e')][_0xbb58('0x44')](_0x9d379f);})[_0xbb58('0x26')](function(_0x45817f){_0x643e0e['rows']=_0x45817f;return _0x643e0e;})[_0xbb58('0x26')](respondWithFilteredResult(_0x3304b9,_0x9d379f))[_0xbb58('0x45')](handleError(_0x3304b9,null));};exports[_0xbb58('0x46')]=function(_0x3a732c,_0x5b95f7){var _0x2ecc1b={'raw':!![],'where':{'id':_0x3a732c[_0xbb58('0x47')]['id']}},_0x5250e0={};_0x5250e0[_0xbb58('0x33')]=_[_0xbb58('0x36')](db[_0xbb58('0x2e')][_0xbb58('0x2f')]);_0x5250e0[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3a732c[_0xbb58('0x35')]);_0x5250e0[_0xbb58('0x37')]=_[_0xbb58('0x39')](_0x5250e0[_0xbb58('0x33')],_0x5250e0[_0xbb58('0x35')]);_0x2ecc1b[_0xbb58('0x38')]=_['intersection'](_0x5250e0[_0xbb58('0x33')],qs['fields'](_0x3a732c['query'][_0xbb58('0x3a')]));_0x2ecc1b[_0xbb58('0x38')]=_0x2ecc1b[_0xbb58('0x38')][_0xbb58('0x48')]?_0x2ecc1b[_0xbb58('0x38')]:_0x5250e0[_0xbb58('0x33')];if(_0x3a732c[_0xbb58('0x35')][_0xbb58('0x43')]){_0x2ecc1b[_0xbb58('0x49')]=[{'all':!![]}];}_0x2ecc1b=_[_0xbb58('0x41')]({},_0x2ecc1b,_0x3a732c[_0xbb58('0x42')]);return db['VoiceMail'][_0xbb58('0x4a')](_0x2ecc1b)[_0xbb58('0x26')](handleEntityNotFound(_0x5b95f7,null))['then'](respondWithResult(_0x5b95f7,null))[_0xbb58('0x45')](handleError(_0x5b95f7,null));};exports[_0xbb58('0x4b')]=function(_0xf94897,_0xdb0ff7){return db['VoiceMail'][_0xbb58('0x4b')](_0xf94897['body'],{})[_0xbb58('0x26')](function(_0x336598){var _0x471917=_0xf94897['user'][_0xbb58('0x27')]({'plain':!![]});if(!_0x471917)throw new Error(_0xbb58('0x4c'));if(_0x471917['role']===_0xbb58('0x4d')){var _0x4ca201=_0x336598[_0xbb58('0x27')]({'plain':!![]});var _0x2d81e0=_0xbb58('0x28');return db[_0xbb58('0x4e')][_0xbb58('0x4a')]({'where':{'name':_0x2d81e0,'userProfileId':_0x471917[_0xbb58('0x4f')]},'raw':!![]})[_0xbb58('0x26')](function(_0x4cb975){if(_0x4cb975&&_0x4cb975[_0xbb58('0x50')]===0x0){return db[_0xbb58('0x51')]['create']({'name':_0x4ca201[_0xbb58('0x2b')],'resourceId':_0x4ca201['id'],'type':_0x4cb975[_0xbb58('0x2b')],'sectionId':_0x4cb975['id']},{})['then'](function(){return _0x336598;});}else{return _0x336598;}})[_0xbb58('0x45')](function(_0x44636b){logger[_0xbb58('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44636b);throw _0x44636b;});}return _0x336598;})[_0xbb58('0x26')](respondWithResult(_0xdb0ff7,0xc9))[_0xbb58('0x45')](handleError(_0xdb0ff7,null));};exports[_0xbb58('0x24')]=function(_0x592879,_0x537ed5){if(_0x592879['body']['id']){delete _0x592879[_0xbb58('0x52')]['id'];}return db[_0xbb58('0x2e')][_0xbb58('0x4a')]({'where':{'id':_0x592879['params']['id']}})['then'](handleEntityNotFound(_0x537ed5,null))[_0xbb58('0x26')](saveUpdates(_0x592879[_0xbb58('0x52')],null))[_0xbb58('0x26')](respondWithResult(_0x537ed5,null))[_0xbb58('0x45')](handleError(_0x537ed5,null));};exports[_0xbb58('0x25')]=function(_0x5290be,_0x362b91){return db[_0xbb58('0x2e')][_0xbb58('0x4a')]({'where':{'id':_0x5290be['params']['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0x362b91,null))[_0xbb58('0x26')](removeEntity(_0x362b91,null))[_0xbb58('0x45')](handleError(_0x362b91,null));};exports[_0xbb58('0x53')]=function(_0x3f5add,_0x5e7ae0,_0x1174b1){return db[_0xbb58('0x2e')][_0xbb58('0x54')]({'where':{'id':_0x3f5add[_0xbb58('0x47')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0x5e7ae0,null))[_0xbb58('0x26')](function(_0x85278c){var _0x58ced2;var _0x55d5be={},_0x344b0d={};_0x344b0d['model']=_[_0xbb58('0x36')](db[_0xbb58('0x55')][_0xbb58('0x2f')]);_0x344b0d[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3f5add[_0xbb58('0x35')]);_0x344b0d[_0xbb58('0x37')]=_[_0xbb58('0x39')](_0x344b0d[_0xbb58('0x33')],_0x344b0d[_0xbb58('0x35')]);_0x55d5be[_0xbb58('0x38')]=_['intersection'](_0x344b0d[_0xbb58('0x33')],qs[_0xbb58('0x3a')](_0x3f5add[_0xbb58('0x35')]['fields']));_0x55d5be[_0xbb58('0x38')]=_0x55d5be['attributes'][_0xbb58('0x48')]?_0x55d5be[_0xbb58('0x38')]:_0x344b0d['model'];if(!_0x3f5add[_0xbb58('0x35')][_0xbb58('0x3b')](_0xbb58('0x56'))){_0x55d5be[_0xbb58('0x1e')]=qs[_0xbb58('0x1e')](_0x3f5add['query']['limit']);_0x55d5be[_0xbb58('0x1c')]=qs[_0xbb58('0x1c')](_0x3f5add[_0xbb58('0x35')]['offset']);}_0x55d5be[_0xbb58('0x3c')]=qs[_0xbb58('0x3d')](_0x3f5add['query'][_0xbb58('0x3d')]);_0x55d5be[_0xbb58('0x3e')]=qs['filters'](_[_0xbb58('0x3f')](_0x3f5add[_0xbb58('0x35')],_0x344b0d[_0xbb58('0x37')]));if(_0x3f5add[_0xbb58('0x35')][_0xbb58('0x40')]){_0x55d5be['where']=_[_0xbb58('0x41')](_0x55d5be[_0xbb58('0x3e')],{'$or':_[_0xbb58('0x34')](_0x55d5be[_0xbb58('0x38')],function(_0x2c9093){var _0x5e17fc={};_0x5e17fc[_0x2c9093]={'$like':'%'+_0x3f5add['query'][_0xbb58('0x40')]+'%'};return _0x5e17fc;})});}_0x55d5be['where']=_[_0xbb58('0x41')](_0x55d5be[_0xbb58('0x3e')],{'mailboxuser':_0x85278c[_0xbb58('0x57')]});_0x55d5be=_[_0xbb58('0x41')]({},_0x55d5be,_0x3f5add[_0xbb58('0x42')]);return db[_0xbb58('0x55')][_0xbb58('0x58')](_0x55d5be)[_0xbb58('0x26')](respondWithFilteredResult(_0x5e7ae0,_0x55d5be));})[_0xbb58('0x45')](handleError(_0x5e7ae0,null));};
\ No newline at end of file
+var _0x1d2d=['sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','fields','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','catch','update','find','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3f553b,_0x49a9c2){var _0x183c4e=function(_0x873b22){while(--_0x873b22){_0x3f553b['push'](_0x3f553b['shift']());}};_0x183c4e(++_0x49a9c2);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x42fede,_0x2f04c0){_0x42fede=_0x42fede-0x0;var _0x4bc642=_0x1d2d[_0x42fede];return _0x4bc642;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];function respondWithStatusCode(_0x33f088,_0x129d8f){_0x129d8f=_0x129d8f||0xcc;return function(_0xc3ee82){if(_0xc3ee82){return _0x33f088[_0xd1d2('0x1b')](_0x129d8f);}return _0x33f088[_0xd1d2('0x1c')](_0x129d8f)[_0xd1d2('0x1d')]();};}function respondWithResult(_0x3f670f,_0x4cf702){_0x4cf702=_0x4cf702||0xc8;return function(_0x2e7fec){if(_0x2e7fec){return _0x3f670f[_0xd1d2('0x1c')](_0x4cf702)[_0xd1d2('0x1e')](_0x2e7fec);}};}function respondWithFilteredResult(_0x56de25,_0x35381b){return function(_0xc36ce){if(_0xc36ce){var _0x208425=typeof _0x35381b[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0x35381b[_0xd1d2('0x21')]===_0xd1d2('0x20');var _0x57f2f9=_0xc36ce['count'];var _0x3be186=_0x208425?0x0:_0x35381b['offset'];var _0x247b3a=_0x208425?_0xc36ce[_0xd1d2('0x22')]:_0x35381b[_0xd1d2('0x1f')]+_0x35381b[_0xd1d2('0x21')];var _0x4ab386;if(_0x247b3a>=_0x57f2f9){_0x247b3a=_0x57f2f9;_0x4ab386=0xc8;}else{_0x4ab386=0xce;}_0x56de25['status'](_0x4ab386);return _0x56de25[_0xd1d2('0x23')]('Content-Range',_0x3be186+'-'+_0x247b3a+'/'+_0x57f2f9)['json'](_0xc36ce);}return null;};}function patchUpdates(_0x1ab67c){return function(_0x27e26b){try{jsonpatch[_0xd1d2('0x24')](_0x27e26b,_0x1ab67c,!![]);}catch(_0x40170b){return BPromise['reject'](_0x40170b);}return _0x27e26b[_0xd1d2('0x25')]();};}function saveUpdates(_0xbb4d27,_0x24b8db){return function(_0x4eb082){if(_0x4eb082){return _0x4eb082['update'](_0xbb4d27)[_0xd1d2('0x26')](function(_0x3a1078){return _0x3a1078;});}return null;};}function removeEntity(_0x19d535,_0x2f92ee){return function(_0x3f229c){if(_0x3f229c){return _0x3f229c[_0xd1d2('0x27')]()[_0xd1d2('0x26')](function(){var _0x5df4af=_0x3f229c[_0xd1d2('0x28')]({'plain':!![]});var _0x42da6d=_0xd1d2('0x29');return db[_0xd1d2('0x2a')][_0xd1d2('0x27')]({'where':{'type':_0x42da6d,'resourceId':_0x5df4af['id']}})[_0xd1d2('0x26')](function(){return _0x3f229c;});})[_0xd1d2('0x26')](function(){_0x19d535[_0xd1d2('0x1c')](0xcc)[_0xd1d2('0x1d')]();});}};}function handleEntityNotFound(_0x384460,_0x3645e9){return function(_0x4e1bc2){if(!_0x4e1bc2){_0x384460['sendStatus'](0x194);}return _0x4e1bc2;};}function handleError(_0x133c6c,_0x442375){_0x442375=_0x442375||0x1f4;return function(_0x1e6072){logger[_0xd1d2('0x2b')](_0x1e6072[_0xd1d2('0x2c')]);if(_0x1e6072['name']){delete _0x1e6072[_0xd1d2('0x2d')];}_0x133c6c[_0xd1d2('0x1c')](_0x442375)[_0xd1d2('0x2e')](_0x1e6072);};}exports['index']=function(_0x19db00,_0x1db17f){var _0xbd855a={},_0x56557d={},_0x419db7={'count':0x0,'rows':[]};var _0x18528f=_[_0xd1d2('0x2f')](db[_0xd1d2('0x30')][_0xd1d2('0x31')],function(_0x14d661){return{'name':_0x14d661[_0xd1d2('0x32')],'type':_0x14d661[_0xd1d2('0x33')][_0xd1d2('0x34')]};});_0x56557d[_0xd1d2('0x35')]=_[_0xd1d2('0x2f')](_0x18528f,_0xd1d2('0x2d'));_0x56557d[_0xd1d2('0x36')]=_[_0xd1d2('0x37')](_0x19db00[_0xd1d2('0x36')]);_0x56557d[_0xd1d2('0x38')]=_[_0xd1d2('0x39')](_0x56557d[_0xd1d2('0x35')],_0x56557d['query']);_0xbd855a[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0x56557d[_0xd1d2('0x35')],qs['fields'](_0x19db00[_0xd1d2('0x36')]['fields']));_0xbd855a['attributes']=_0xbd855a[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0xbd855a[_0xd1d2('0x3a')]:_0x56557d[_0xd1d2('0x35')];if(!_0x19db00[_0xd1d2('0x36')][_0xd1d2('0x3c')]('nolimit')){_0xbd855a[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x19db00['query'][_0xd1d2('0x21')]);_0xbd855a[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x19db00[_0xd1d2('0x36')]['offset']);}_0xbd855a['order']=qs[_0xd1d2('0x3d')](_0x19db00['query']['sort']);_0xbd855a['where']=qs[_0xd1d2('0x38')](_['pick'](_0x19db00[_0xd1d2('0x36')],_0x56557d['filters']),_0x18528f);if(_0x19db00['query']['filter']){_0xbd855a[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0xbd855a[_0xd1d2('0x3e')],{'$or':_[_0xd1d2('0x2f')](_0x18528f,function(_0x33ba30){if(_0x33ba30[_0xd1d2('0x33')]!==_0xd1d2('0x40')){var _0x38bf16={};_0x38bf16[_0x33ba30[_0xd1d2('0x2d')]]={'$like':'%'+_0x19db00[_0xd1d2('0x36')][_0xd1d2('0x41')]+'%'};return _0x38bf16;}})});}_0xbd855a=_[_0xd1d2('0x3f')]({},_0xbd855a,_0x19db00[_0xd1d2('0x42')]);var _0x18ff05={'where':_0xbd855a['where']};return db['VoiceMail'][_0xd1d2('0x22')](_0x18ff05)[_0xd1d2('0x26')](function(_0x24fc93){_0x419db7['count']=_0x24fc93;if(_0x19db00['query'][_0xd1d2('0x43')]){_0xbd855a[_0xd1d2('0x44')]=[{'all':!![]}];}return db['VoiceMail'][_0xd1d2('0x45')](_0xbd855a);})['then'](function(_0x5a3790){_0x419db7[_0xd1d2('0x46')]=_0x5a3790;return _0x419db7;})['then'](respondWithFilteredResult(_0x1db17f,_0xbd855a))['catch'](handleError(_0x1db17f,null));};exports[_0xd1d2('0x47')]=function(_0x320fa4,_0x2a8961){var _0x49dad2={'raw':!![],'where':{'id':_0x320fa4[_0xd1d2('0x48')]['id']}},_0x2ba87b={};_0x2ba87b[_0xd1d2('0x35')]=_[_0xd1d2('0x37')](db['VoiceMail'][_0xd1d2('0x31')]);_0x2ba87b[_0xd1d2('0x36')]=_['keys'](_0x320fa4[_0xd1d2('0x36')]);_0x2ba87b['filters']=_[_0xd1d2('0x39')](_0x2ba87b[_0xd1d2('0x35')],_0x2ba87b[_0xd1d2('0x36')]);_0x49dad2[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0x2ba87b['model'],qs['fields'](_0x320fa4[_0xd1d2('0x36')][_0xd1d2('0x49')]));_0x49dad2['attributes']=_0x49dad2[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0x49dad2[_0xd1d2('0x3a')]:_0x2ba87b[_0xd1d2('0x35')];if(_0x320fa4[_0xd1d2('0x36')][_0xd1d2('0x43')]){_0x49dad2[_0xd1d2('0x44')]=[{'all':!![]}];}_0x49dad2=_['merge']({},_0x49dad2,_0x320fa4[_0xd1d2('0x42')]);return db[_0xd1d2('0x30')]['find'](_0x49dad2)[_0xd1d2('0x26')](handleEntityNotFound(_0x2a8961,null))[_0xd1d2('0x26')](respondWithResult(_0x2a8961,null))['catch'](handleError(_0x2a8961,null));};exports['create']=function(_0x3d4fe3,_0x182ea8){return db['VoiceMail'][_0xd1d2('0x4a')](_0x3d4fe3[_0xd1d2('0x4b')],{})[_0xd1d2('0x26')](function(_0x23ab46){var _0x404ad2=_0x3d4fe3['user']['get']({'plain':!![]});if(!_0x404ad2)throw new Error(_0xd1d2('0x4c'));if(_0x404ad2['role']===_0xd1d2('0x4d')){var _0xcd4b70=_0x23ab46['get']({'plain':!![]});var _0x389fcb=_0xd1d2('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x389fcb,'userProfileId':_0x404ad2[_0xd1d2('0x4e')]},'raw':!![]})[_0xd1d2('0x26')](function(_0x187de4){if(_0x187de4&&_0x187de4[_0xd1d2('0x4f')]===0x0){return db[_0xd1d2('0x2a')][_0xd1d2('0x4a')]({'name':_0xcd4b70[_0xd1d2('0x2d')],'resourceId':_0xcd4b70['id'],'type':_0x187de4[_0xd1d2('0x2d')],'sectionId':_0x187de4['id']},{})[_0xd1d2('0x26')](function(){return _0x23ab46;});}else{return _0x23ab46;}})['catch'](function(_0x1958f3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1958f3);throw _0x1958f3;});}return _0x23ab46;})[_0xd1d2('0x26')](respondWithResult(_0x182ea8,0xc9))[_0xd1d2('0x50')](handleError(_0x182ea8,null));};exports[_0xd1d2('0x51')]=function(_0x47417f,_0x215dea){if(_0x47417f[_0xd1d2('0x4b')]['id']){delete _0x47417f[_0xd1d2('0x4b')]['id'];}return db[_0xd1d2('0x30')][_0xd1d2('0x52')]({'where':{'id':_0x47417f[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x215dea,null))[_0xd1d2('0x26')](saveUpdates(_0x47417f[_0xd1d2('0x4b')],null))['then'](respondWithResult(_0x215dea,null))['catch'](handleError(_0x215dea,null));};exports[_0xd1d2('0x27')]=function(_0xd5323d,_0x1562ad){return db[_0xd1d2('0x30')][_0xd1d2('0x52')]({'where':{'id':_0xd5323d[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x1562ad,null))[_0xd1d2('0x26')](removeEntity(_0x1562ad,null))[_0xd1d2('0x50')](handleError(_0x1562ad,null));};exports[_0xd1d2('0x53')]=function(_0x1788cd,_0x54406e,_0x479471){return db[_0xd1d2('0x30')][_0xd1d2('0x54')]({'where':{'id':_0x1788cd[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x54406e,null))['then'](function(_0x17e149){var _0x27c629;var _0x42961d={},_0xaf2acf={};_0xaf2acf[_0xd1d2('0x35')]=_[_0xd1d2('0x37')](db[_0xd1d2('0x55')]['rawAttributes']);_0xaf2acf[_0xd1d2('0x36')]=_[_0xd1d2('0x37')](_0x1788cd[_0xd1d2('0x36')]);_0xaf2acf['filters']=_['intersection'](_0xaf2acf[_0xd1d2('0x35')],_0xaf2acf[_0xd1d2('0x36')]);_0x42961d[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0xaf2acf['model'],qs[_0xd1d2('0x49')](_0x1788cd[_0xd1d2('0x36')][_0xd1d2('0x49')]));_0x42961d['attributes']=_0x42961d[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0x42961d['attributes']:_0xaf2acf[_0xd1d2('0x35')];if(!_0x1788cd[_0xd1d2('0x36')][_0xd1d2('0x3c')](_0xd1d2('0x56'))){_0x42961d['limit']=qs[_0xd1d2('0x21')](_0x1788cd[_0xd1d2('0x36')][_0xd1d2('0x21')]);_0x42961d[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x1788cd['query']['offset']);}_0x42961d['order']=qs['sort'](_0x1788cd['query'][_0xd1d2('0x3d')]);_0x42961d[_0xd1d2('0x3e')]=qs[_0xd1d2('0x38')](_['pick'](_0x1788cd[_0xd1d2('0x36')],_0xaf2acf[_0xd1d2('0x38')]));if(_0x1788cd[_0xd1d2('0x36')]['filter']){_0x42961d[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x42961d[_0xd1d2('0x3e')],{'$or':_[_0xd1d2('0x2f')](_0x42961d[_0xd1d2('0x3a')],function(_0x1101a3){var _0x4a83f8={};_0x4a83f8[_0x1101a3]={'$like':'%'+_0x1788cd[_0xd1d2('0x36')][_0xd1d2('0x41')]+'%'};return _0x4a83f8;})});}_0x42961d['where']=_['merge'](_0x42961d[_0xd1d2('0x3e')],{'mailboxuser':_0x17e149[_0xd1d2('0x57')]});_0x42961d=_[_0xd1d2('0x3f')]({},_0x42961d,_0x1788cd[_0xd1d2('0x42')]);return db['VoiceMailMessage'][_0xd1d2('0x58')](_0x42961d)[_0xd1d2('0x26')](respondWithFilteredResult(_0x54406e,_0x42961d));})[_0xd1d2('0x50')](handleError(_0x54406e,null));};
\ No newline at end of file
index b5b8968..828a106 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x304d=['util','api','moment','rimraf','../../config/environment','define','VoiceMail','mailbox_context','mailbox','context'];(function(_0x38998b,_0x3405e5){var _0x4bc71b=function(_0x354fb2){while(--_0x354fb2){_0x38998b['push'](_0x38998b['shift']());}};_0x4bc71b(++_0x3405e5);}(_0x304d,0xaa));var _0xd304=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x304d[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xd304('0x0'));var logger=require('../../config/logger')(_0xd304('0x1'));var moment=require(_0xd304('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd304('0x3'));var config=require(_0xd304('0x4'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0xf0d4d0,_0x3ae682){return _0xf0d4d0[_0xd304('0x5')](_0xd304('0x6'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xd304('0x7'),'fields':[_0xd304('0x8'),_0xd304('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0651=['exports','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x329e15,_0x71dcac){var _0xa401a4=function(_0x330932){while(--_0x330932){_0x329e15['push'](_0x329e15['shift']());}};_0xa401a4(++_0x71dcac);}(_0x0651,0x1e6));var _0x1065=function(_0x467f6d,_0xe868e6){_0x467f6d=_0x467f6d-0x0;var _0x22d955=_0x0651[_0x467f6d];return _0x22d955;};'use strict';var _=require(_0x1065('0x0'));var util=require(_0x1065('0x1'));var logger=require(_0x1065('0x2'))('api');var moment=require(_0x1065('0x3'));var BPromise=require(_0x1065('0x4'));var rp=require(_0x1065('0x5'));var fs=require('fs');var path=require(_0x1065('0x6'));var rimraf=require(_0x1065('0x7'));var config=require(_0x1065('0x8'));var attributes=require(_0x1065('0x9'));module[_0x1065('0xa')]=function(_0x3da640,_0x403beb){return _0x3da640[_0x1065('0xb')](_0x1065('0xc'),attributes,{'tableName':_0x1065('0xd'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x1065('0xe'),_0x1065('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 0d7a0f0..81f5949 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9c8=['../../config/logger','rpc','../../config/environment','jayson/promise','http','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','VoiceMail,\x20%s,\x20%s','error','message','info','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9c8,0x78));var _0x8a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8a9c('0x0'));var util=require(_0x8a9c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8a9c('0x2'));var fs=require('fs');var Redis=require(_0x8a9c('0x3'));var db=require(_0x8a9c('0x4'))['db'];var utils=require(_0x8a9c('0x5'));var logger=require(_0x8a9c('0x6'))(_0x8a9c('0x7'));var config=require(_0x8a9c('0x8'));var jayson=require(_0x8a9c('0x9'));var client=jayson['client'][_0x8a9c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38df7a,_0x56900f,_0x4b43e6){return new BPromise(function(_0x5bf7c9,_0x218811){return client['request'](_0x38df7a,_0x4b43e6)['then'](function(_0xcc55fd){logger['info']('VoiceMail,\x20%s,\x20%s',_0x56900f,'request\x20sent');logger[_0x8a9c('0xb')](_0x8a9c('0xc'),_0x56900f,_0x8a9c('0xd'),JSON[_0x8a9c('0xe')](_0xcc55fd));if(_0xcc55fd['error']){if(_0xcc55fd['error'][_0x8a9c('0xf')]===0x1f4){logger['error'](_0x8a9c('0x10'),_0x56900f,_0xcc55fd[_0x8a9c('0x11')]['message']);return _0x218811(_0xcc55fd[_0x8a9c('0x11')]['message']);}logger[_0x8a9c('0x11')]('VoiceMail,\x20%s,\x20%s',_0x56900f,_0xcc55fd[_0x8a9c('0x11')]['message']);return _0x5bf7c9(_0xcc55fd[_0x8a9c('0x11')][_0x8a9c('0x12')]);}else{logger[_0x8a9c('0x13')]('VoiceMail,\x20%s,\x20%s',_0x56900f,_0x8a9c('0xd'));_0x5bf7c9(_0xcc55fd[_0x8a9c('0x14')]['message']);}})['catch'](function(_0x21da4f){logger[_0x8a9c('0x11')](_0x8a9c('0x10'),_0x56900f,_0x21da4f);_0x218811(_0x21da4f);});});}
\ No newline at end of file
+var _0x0a1c=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a1c,0x156));var _0xc0a1=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x0a1c[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0xc0a1('0x0'));var util=require(_0xc0a1('0x1'));var moment=require(_0xc0a1('0x2'));var BPromise=require(_0xc0a1('0x3'));var rs=require(_0xc0a1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0a1('0x5'))['db'];var utils=require(_0xc0a1('0x6'));var logger=require(_0xc0a1('0x7'))(_0xc0a1('0x8'));var config=require(_0xc0a1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc0a1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfec70c,_0x100fb9,_0x32686f){return new BPromise(function(_0x5a3b8c,_0x2444ea){return client[_0xc0a1('0xb')](_0xfec70c,_0x32686f)[_0xc0a1('0xc')](function(_0x5c0d65){logger[_0xc0a1('0xd')](_0xc0a1('0xe'),_0x100fb9,'request\x20sent');logger[_0xc0a1('0xf')](_0xc0a1('0x10'),_0x100fb9,'request\x20sent',JSON[_0xc0a1('0x11')](_0x5c0d65));if(_0x5c0d65[_0xc0a1('0x12')]){if(_0x5c0d65[_0xc0a1('0x12')][_0xc0a1('0x13')]===0x1f4){logger[_0xc0a1('0x12')](_0xc0a1('0xe'),_0x100fb9,_0x5c0d65['error']['message']);return _0x2444ea(_0x5c0d65['error'][_0xc0a1('0x14')]);}logger['error'](_0xc0a1('0xe'),_0x100fb9,_0x5c0d65[_0xc0a1('0x12')]['message']);return _0x5a3b8c(_0x5c0d65[_0xc0a1('0x12')][_0xc0a1('0x14')]);}else{logger[_0xc0a1('0xd')]('VoiceMail,\x20%s,\x20%s',_0x100fb9,_0xc0a1('0x15'));_0x5a3b8c(_0x5c0d65['result'][_0xc0a1('0x14')]);}})[_0xc0a1('0x16')](function(_0x588b0b){logger['error'](_0xc0a1('0xe'),_0x100fb9,_0x588b0b);_0x2444ea(_0x588b0b);});});}
\ No newline at end of file
index db5ac73..a8b63f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bd2=['get','/:id','show','/:id/download','download','post','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index'];(function(_0x79ec09,_0x460e17){var _0xf424=function(_0x5b0127){while(--_0x5b0127){_0x79ec09['push'](_0x79ec09['shift']());}};_0xf424(++_0x460e17);}(_0x9bd2,0x10e));var _0x29bd=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9bd2[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x29bd('0x0'));var util=require(_0x29bd('0x1'));var path=require(_0x29bd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x29bd('0x3')]();var fs_extra=require(_0x29bd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x29bd('0x5'));var config=require(_0x29bd('0x6'));var controller=require(_0x29bd('0x7'));router['get']('/',auth[_0x29bd('0x8')](),controller[_0x29bd('0x9')]);router[_0x29bd('0xa')](_0x29bd('0xb'),auth[_0x29bd('0x8')](),controller[_0x29bd('0xc')]);router['get'](_0x29bd('0xd'),auth[_0x29bd('0x8')](),controller[_0x29bd('0xe')]);router[_0x29bd('0xf')]('/',auth[_0x29bd('0x8')](),controller['create']);router['put'](_0x29bd('0xb'),auth['isAuthenticated'](),controller[_0x29bd('0x10')]);router[_0x29bd('0x11')](_0x29bd('0xb'),auth['isAuthenticated'](),controller[_0x29bd('0x12')]);module[_0x29bd('0x13')]=router;
\ No newline at end of file
+var _0x1f6b=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','destroy','multer'];(function(_0x368094,_0x27054f){var _0x3b7f48=function(_0x443d14){while(--_0x443d14){_0x368094['push'](_0x368094['shift']());}};_0x3b7f48(++_0x27054f);}(_0x1f6b,0x97));var _0xb1f6=function(_0x12ef3b,_0x15f884){_0x12ef3b=_0x12ef3b-0x0;var _0x1d1fb4=_0x1f6b[_0x12ef3b];return _0x1d1fb4;};'use strict';var multer=require(_0xb1f6('0x0'));var util=require('util');var path=require(_0xb1f6('0x1'));var timeout=require(_0xb1f6('0x2'));var express=require(_0xb1f6('0x3'));var router=express[_0xb1f6('0x4')]();var fs_extra=require(_0xb1f6('0x5'));var auth=require(_0xb1f6('0x6'));var interaction=require(_0xb1f6('0x7'));var config=require(_0xb1f6('0x8'));var controller=require(_0xb1f6('0x9'));router[_0xb1f6('0xa')]('/',auth[_0xb1f6('0xb')](),controller[_0xb1f6('0xc')]);router['get'](_0xb1f6('0xd'),auth[_0xb1f6('0xb')](),controller['show']);router[_0xb1f6('0xa')](_0xb1f6('0xe'),auth['isAuthenticated'](),controller[_0xb1f6('0xf')]);router[_0xb1f6('0x10')]('/',auth[_0xb1f6('0xb')](),controller[_0xb1f6('0x11')]);router['put'](_0xb1f6('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb1f6('0xd'),auth['isAuthenticated'](),controller[_0xb1f6('0x12')]);module['exports']=router;
\ No newline at end of file
index be5f720..f81c23e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe146=['STRING','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xe146,0x1cb));var _0x6e14=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xe146[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require(_0x6e14('0x0'));module['exports']={'name':{'type':Sequelize[_0x6e14('0x1')],'get':function(_0x592773){return this[_0x6e14('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x6e14('0x4')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x6e14('0x5')](_0x6e14('0x6'))}};
\ No newline at end of file
+var _0x3ee9=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue','INTEGER','STRING','long','literal'];(function(_0x450253,_0x14caa1){var _0x404757=function(_0x50ecbc){while(--_0x50ecbc){_0x450253['push'](_0x450253['shift']());}};_0x404757(++_0x14caa1);}(_0x3ee9,0x151));var _0x93ee=function(_0x58c7ab,_0x38a623){_0x58c7ab=_0x58c7ab-0x0;var _0x5623f8=_0x3ee9[_0x58c7ab];return _0x5623f8;};'use strict';var Sequelize=require(_0x93ee('0x0'));module[_0x93ee('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x52d149){return this[_0x93ee('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x93ee('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x93ee('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x93ee('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x93ee('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x93ee('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x93ee('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x93ee('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x93ee('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x93ee('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x93ee('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x93ee('0x6')](_0x93ee('0x7'))}};
\ No newline at end of file
index 8040023..6de0f4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62eb=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','key','model','differenceBy','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceMailMessage','includeAll','include','findAll','rows','params','keys','fields','find','catch','create','update','body','download','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','set','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x27657c,_0x36813e){var _0x12324a=function(_0x3f6eea){while(--_0x3f6eea){_0x27657c['push'](_0x27657c['shift']());}};_0x12324a(++_0x36813e);}(_0x62eb,0x144));var _0xb62e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x62eb[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0xb62e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb62e('0x1'));var jsonpatch=require(_0xb62e('0x2'));var rp=require('request-promise');var moment=require(_0xb62e('0x3'));var BPromise=require(_0xb62e('0x4'));var Mustache=require('mustache');var util=require(_0xb62e('0x5'));var path=require(_0xb62e('0x6'));var sox=require(_0xb62e('0x7'));var csv=require(_0xb62e('0x8'));var ejs=require(_0xb62e('0x9'));var fs=require('fs');var fs_extra=require(_0xb62e('0xa'));var _=require(_0xb62e('0xb'));var squel=require(_0xb62e('0xc'));var crypto=require(_0xb62e('0xd'));var jsforce=require(_0xb62e('0xe'));var deskjs=require(_0xb62e('0xf'));var toCsv=require(_0xb62e('0x8'));var querystring=require('querystring');var Papa=require(_0xb62e('0x10'));var Redis=require('ioredis');var authService=require(_0xb62e('0x11'));var qs=require(_0xb62e('0x12'));var as=require(_0xb62e('0x13'));var hardwareService=require(_0xb62e('0x14'));var logger=require('../../config/logger')(_0xb62e('0x15'));var utils=require(_0xb62e('0x16'));var config=require(_0xb62e('0x17'));var licenseUtil=require(_0xb62e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x438587,_0x477800){_0x477800=_0x477800||0xcc;return function(_0x5362af){if(_0x5362af){return _0x438587['sendStatus'](_0x477800);}return _0x438587[_0xb62e('0x19')](_0x477800)['end']();};}function respondWithResult(_0xd8cc34,_0x532d5f){_0x532d5f=_0x532d5f||0xc8;return function(_0x3bcbb7){if(_0x3bcbb7){return _0xd8cc34[_0xb62e('0x19')](_0x532d5f)['json'](_0x3bcbb7);}};}function respondWithFilteredResult(_0x46199f,_0x5d7c31){return function(_0x3add01){if(_0x3add01){var _0x1f916a=typeof _0x5d7c31[_0xb62e('0x1a')]===_0xb62e('0x1b')&&typeof _0x5d7c31[_0xb62e('0x1c')]===_0xb62e('0x1b');var _0x516395=_0x3add01[_0xb62e('0x1d')];var _0x2a047b=_0x1f916a?0x0:_0x5d7c31['offset'];var _0x5f3101=_0x1f916a?_0x3add01[_0xb62e('0x1d')]:_0x5d7c31['offset']+_0x5d7c31['limit'];var _0x241e71;if(_0x5f3101>=_0x516395){_0x5f3101=_0x516395;_0x241e71=0xc8;}else{_0x241e71=0xce;}_0x46199f[_0xb62e('0x19')](_0x241e71);return _0x46199f['set'](_0xb62e('0x1e'),_0x2a047b+'-'+_0x5f3101+'/'+_0x516395)[_0xb62e('0x1f')](_0x3add01);}return null;};}function patchUpdates(_0x59c120){return function(_0x4fa87b){try{jsonpatch[_0xb62e('0x20')](_0x4fa87b,_0x59c120,!![]);}catch(_0x475bd6){return BPromise[_0xb62e('0x21')](_0x475bd6);}return _0x4fa87b[_0xb62e('0x22')]();};}function saveUpdates(_0x4faf6c,_0xa7db51){return function(_0x44b374){if(_0x44b374){return _0x44b374['update'](_0x4faf6c)[_0xb62e('0x23')](function(_0x1a0c34){return _0x1a0c34;});}return null;};}function removeEntity(_0x2e7a67,_0x1da9b5){return function(_0xb78729){if(_0xb78729){return _0xb78729[_0xb62e('0x24')]()[_0xb62e('0x23')](function(){_0x2e7a67[_0xb62e('0x19')](0xcc)[_0xb62e('0x25')]();});}};}function handleEntityNotFound(_0x332ba4,_0x55fb53){return function(_0x2dfbed){if(!_0x2dfbed){_0x332ba4['sendStatus'](0x194);}return _0x2dfbed;};}function handleError(_0x2c92cc,_0x5502c2){_0x5502c2=_0x5502c2||0x1f4;return function(_0x43ab9b){logger['error'](_0x43ab9b[_0xb62e('0x26')]);if(_0x43ab9b[_0xb62e('0x27')]){delete _0x43ab9b[_0xb62e('0x27')];}_0x2c92cc[_0xb62e('0x19')](_0x5502c2)[_0xb62e('0x28')](_0x43ab9b);};}exports[_0xb62e('0x29')]=function(_0x4b92f5,_0x346924){var _0x9029ec={},_0x2299fd={},_0x451a11={'count':0x0,'rows':[]};var _0x430f48=_[_0xb62e('0x2a')](db['VoiceMailMessage'][_0xb62e('0x2b')],function(_0x679470){return{'name':_0x679470[_0xb62e('0x2c')],'type':_0x679470['type'][_0xb62e('0x2d')]};});_0x2299fd[_0xb62e('0x2e')]=_[_0xb62e('0x2f')](_[_0xb62e('0x2a')](_0x430f48,'name'),[_0xb62e('0x27')]);_0x2299fd[_0xb62e('0x30')]=_['keys'](_0x4b92f5[_0xb62e('0x30')]);_0x2299fd[_0xb62e('0x31')]=_[_0xb62e('0x32')](_0x2299fd[_0xb62e('0x2e')],_0x2299fd[_0xb62e('0x30')]);_0x9029ec[_0xb62e('0x33')]=_[_0xb62e('0x32')](_0x2299fd['model'],qs['fields'](_0x4b92f5[_0xb62e('0x30')]['fields']));_0x9029ec[_0xb62e('0x33')]=_0x9029ec[_0xb62e('0x33')][_0xb62e('0x34')]?_0x9029ec[_0xb62e('0x33')]:_0x2299fd[_0xb62e('0x2e')];if(!_0x4b92f5[_0xb62e('0x30')][_0xb62e('0x35')](_0xb62e('0x36'))){_0x9029ec[_0xb62e('0x1c')]=qs['limit'](_0x4b92f5[_0xb62e('0x30')][_0xb62e('0x1c')]);_0x9029ec[_0xb62e('0x1a')]=qs[_0xb62e('0x1a')](_0x4b92f5['query'][_0xb62e('0x1a')]);}_0x9029ec['order']=qs[_0xb62e('0x37')](_0x4b92f5[_0xb62e('0x30')][_0xb62e('0x37')]);_0x9029ec[_0xb62e('0x38')]=qs[_0xb62e('0x31')](_[_0xb62e('0x39')](_0x4b92f5[_0xb62e('0x30')],_0x2299fd[_0xb62e('0x31')]),_0x430f48);if(_0x4b92f5[_0xb62e('0x30')][_0xb62e('0x3a')]){_0x9029ec[_0xb62e('0x38')]=_[_0xb62e('0x3b')](_0x9029ec[_0xb62e('0x38')],{'$or':_[_0xb62e('0x2a')](_0x430f48,function(_0x1e757c){if(_0x1e757c[_0xb62e('0x3c')]!==_0xb62e('0x3d')){var _0x301233={};_0x301233[_0x1e757c[_0xb62e('0x27')]]={'$like':'%'+_0x4b92f5[_0xb62e('0x30')]['filter']+'%'};return _0x301233;}})});}_0x9029ec=_[_0xb62e('0x3b')]({},_0x9029ec,_0x4b92f5[_0xb62e('0x3e')]);var _0x27e68b={'where':_0x9029ec[_0xb62e('0x38')]};return db[_0xb62e('0x3f')][_0xb62e('0x1d')](_0x27e68b)[_0xb62e('0x23')](function(_0x348d00){_0x451a11[_0xb62e('0x1d')]=_0x348d00;if(_0x4b92f5[_0xb62e('0x30')][_0xb62e('0x40')]){_0x9029ec[_0xb62e('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xb62e('0x42')](_0x9029ec);})[_0xb62e('0x23')](function(_0x39061c){_0x451a11[_0xb62e('0x43')]=_0x39061c;return _0x451a11;})[_0xb62e('0x23')](respondWithFilteredResult(_0x346924,_0x9029ec))['catch'](handleError(_0x346924,null));};exports['show']=function(_0x591cfb,_0x5b47c6){var _0xe463e7={'raw':!![],'where':{'id':_0x591cfb[_0xb62e('0x44')]['id']}},_0x3e8fb5={};_0x3e8fb5[_0xb62e('0x2e')]=_[_0xb62e('0x45')](db[_0xb62e('0x3f')][_0xb62e('0x2b')]);_0x3e8fb5[_0xb62e('0x30')]=_[_0xb62e('0x45')](_0x591cfb[_0xb62e('0x30')]);_0x3e8fb5[_0xb62e('0x31')]=_[_0xb62e('0x32')](_0x3e8fb5['model'],_0x3e8fb5[_0xb62e('0x30')]);_0xe463e7['attributes']=_[_0xb62e('0x32')](_0x3e8fb5[_0xb62e('0x2e')],qs['fields'](_0x591cfb[_0xb62e('0x30')][_0xb62e('0x46')]));_0xe463e7['attributes']=_0xe463e7['attributes'][_0xb62e('0x34')]?_0xe463e7['attributes']:_0x3e8fb5[_0xb62e('0x2e')];if(_0x591cfb[_0xb62e('0x30')]['includeAll']){_0xe463e7[_0xb62e('0x41')]=[{'all':!![]}];}_0xe463e7=_['merge']({},_0xe463e7,_0x591cfb[_0xb62e('0x3e')]);return db['VoiceMailMessage'][_0xb62e('0x47')](_0xe463e7)[_0xb62e('0x23')](handleEntityNotFound(_0x5b47c6,null))[_0xb62e('0x23')](respondWithResult(_0x5b47c6,null))[_0xb62e('0x48')](handleError(_0x5b47c6,null));};exports[_0xb62e('0x49')]=function(_0x1a2d5d,_0x4df894){return db[_0xb62e('0x3f')][_0xb62e('0x49')](_0x1a2d5d['body'],{})['then'](respondWithResult(_0x4df894,0xc9))['catch'](handleError(_0x4df894,null));};exports[_0xb62e('0x4a')]=function(_0x459c62,_0x2800dd){if(_0x459c62[_0xb62e('0x4b')]['id']){delete _0x459c62['body']['id'];}return db[_0xb62e('0x3f')][_0xb62e('0x47')]({'where':{'id':_0x459c62[_0xb62e('0x44')]['id']}})[_0xb62e('0x23')](handleEntityNotFound(_0x2800dd,null))[_0xb62e('0x23')](saveUpdates(_0x459c62['body'],null))[_0xb62e('0x23')](respondWithResult(_0x2800dd,null))[_0xb62e('0x48')](handleError(_0x2800dd,null));};exports[_0xb62e('0x24')]=function(_0x1cb17b,_0x187ca4){return db['VoiceMailMessage']['find']({'where':{'id':_0x1cb17b['params']['id']}})[_0xb62e('0x23')](handleEntityNotFound(_0x187ca4,null))['then'](removeEntity(_0x187ca4,null))[_0xb62e('0x48')](handleError(_0x187ca4,null));};exports[_0xb62e('0x4c')]=function(_0x1c8aab,_0x3971ea,_0x2f013a){return db[_0xb62e('0x3f')]['find']({'where':{'id':_0x1c8aab[_0xb62e('0x44')]['id']},'attributes':['id',_0xb62e('0x4d'),'msg_id']})['then'](handleEntityNotFound(_0x3971ea,null))[_0xb62e('0x23')](function(_0xd0d9c9){if(_0xd0d9c9){if(!_0xd0d9c9['recording']){throw new db[(_0xb62e('0x4e'))]['ValidationError'](_0xb62e('0x4f'));}var _0x3477d9={'Content-Type':_0xb62e('0x50'),'Content-Disposition':_0xb62e('0x51')};if(_0xd0d9c9[_0xb62e('0x52')]){_0x3477d9['Content-Disposition']=_0xb62e('0x53')+_0xd0d9c9['msg_id']+'.wav\x22';}_0x3971ea[_0xb62e('0x54')](_0x3477d9);return _0x3971ea['send'](new Buffer(_0xd0d9c9[_0xb62e('0x4d')]));}})['catch'](handleError(_0x3971ea,null));};
\ No newline at end of file
+var _0x6b08=['error','stack','name','send','index','VoiceMailMessage','type','model','differenceBy','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','zip-dir','fast-json-patch','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy'];(function(_0x3e6016,_0x46f40f){var _0x2f2190=function(_0x288f26){while(--_0x288f26){_0x3e6016['push'](_0x3e6016['shift']());}};_0x2f2190(++_0x46f40f);}(_0x6b08,0x120));var _0x86b0=function(_0x402501,_0x1e7dd7){_0x402501=_0x402501-0x0;var _0x680ce4=_0x6b08[_0x402501];return _0x680ce4;};'use strict';var emlformat=require(_0x86b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x86b0('0x1'));var jsonpatch=require(_0x86b0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x86b0('0x3'));var path=require('path');var sox=require(_0x86b0('0x4'));var csv=require(_0x86b0('0x5'));var ejs=require(_0x86b0('0x6'));var fs=require('fs');var fs_extra=require(_0x86b0('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x86b0('0x8'));var jsforce=require(_0x86b0('0x9'));var deskjs=require(_0x86b0('0xa'));var toCsv=require(_0x86b0('0x5'));var querystring=require(_0x86b0('0xb'));var Papa=require(_0x86b0('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x86b0('0xd'));var as=require(_0x86b0('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x86b0('0xf'))(_0x86b0('0x10'));var utils=require(_0x86b0('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x496e1c,_0x3a6e54){_0x3a6e54=_0x3a6e54||0xcc;return function(_0x2c259c){if(_0x2c259c){return _0x496e1c[_0x86b0('0x12')](_0x3a6e54);}return _0x496e1c[_0x86b0('0x13')](_0x3a6e54)[_0x86b0('0x14')]();};}function respondWithResult(_0x53ff5a,_0x51a18e){_0x51a18e=_0x51a18e||0xc8;return function(_0x1b5855){if(_0x1b5855){return _0x53ff5a[_0x86b0('0x13')](_0x51a18e)[_0x86b0('0x15')](_0x1b5855);}};}function respondWithFilteredResult(_0x4a854b,_0xb5985b){return function(_0x9f32c2){if(_0x9f32c2){var _0x85d071=typeof _0xb5985b['offset']===_0x86b0('0x16')&&typeof _0xb5985b['limit']==='undefined';var _0x12edf4=_0x9f32c2[_0x86b0('0x17')];var _0x3881f0=_0x85d071?0x0:_0xb5985b['offset'];var _0x4f4c0d=_0x85d071?_0x9f32c2[_0x86b0('0x17')]:_0xb5985b[_0x86b0('0x18')]+_0xb5985b[_0x86b0('0x19')];var _0x255371;if(_0x4f4c0d>=_0x12edf4){_0x4f4c0d=_0x12edf4;_0x255371=0xc8;}else{_0x255371=0xce;}_0x4a854b['status'](_0x255371);return _0x4a854b[_0x86b0('0x1a')](_0x86b0('0x1b'),_0x3881f0+'-'+_0x4f4c0d+'/'+_0x12edf4)[_0x86b0('0x15')](_0x9f32c2);}return null;};}function patchUpdates(_0x2db8a7){return function(_0x3fe84c){try{jsonpatch['apply'](_0x3fe84c,_0x2db8a7,!![]);}catch(_0x42775d){return BPromise[_0x86b0('0x1c')](_0x42775d);}return _0x3fe84c[_0x86b0('0x1d')]();};}function saveUpdates(_0x23908b,_0x176de2){return function(_0x39bb83){if(_0x39bb83){return _0x39bb83[_0x86b0('0x1e')](_0x23908b)['then'](function(_0x43f6fb){return _0x43f6fb;});}return null;};}function removeEntity(_0x437f01,_0x507816){return function(_0x554385){if(_0x554385){return _0x554385[_0x86b0('0x1f')]()['then'](function(){_0x437f01[_0x86b0('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fb0a9,_0x18e090){return function(_0x1fec81){if(!_0x1fec81){_0x1fb0a9[_0x86b0('0x12')](0x194);}return _0x1fec81;};}function handleError(_0x352e22,_0x34c978){_0x34c978=_0x34c978||0x1f4;return function(_0x212f19){logger[_0x86b0('0x20')](_0x212f19[_0x86b0('0x21')]);if(_0x212f19[_0x86b0('0x22')]){delete _0x212f19['name'];}_0x352e22[_0x86b0('0x13')](_0x34c978)[_0x86b0('0x23')](_0x212f19);};}exports[_0x86b0('0x24')]=function(_0x4ac0dd,_0x4555e3){var _0x1bf95c={},_0x37eace={},_0x175da1={'count':0x0,'rows':[]};var _0x2433ce=_['map'](db[_0x86b0('0x25')]['rawAttributes'],function(_0x2feb6a){return{'name':_0x2feb6a['fieldName'],'type':_0x2feb6a[_0x86b0('0x26')]['key']};});_0x37eace[_0x86b0('0x27')]=_[_0x86b0('0x28')](_[_0x86b0('0x29')](_0x2433ce,_0x86b0('0x22')),['name']);_0x37eace['query']=_[_0x86b0('0x2a')](_0x4ac0dd[_0x86b0('0x2b')]);_0x37eace[_0x86b0('0x2c')]=_[_0x86b0('0x2d')](_0x37eace[_0x86b0('0x27')],_0x37eace[_0x86b0('0x2b')]);_0x1bf95c['attributes']=_[_0x86b0('0x2d')](_0x37eace[_0x86b0('0x27')],qs[_0x86b0('0x2e')](_0x4ac0dd['query']['fields']));_0x1bf95c[_0x86b0('0x2f')]=_0x1bf95c[_0x86b0('0x2f')][_0x86b0('0x30')]?_0x1bf95c[_0x86b0('0x2f')]:_0x37eace[_0x86b0('0x27')];if(!_0x4ac0dd[_0x86b0('0x2b')][_0x86b0('0x31')](_0x86b0('0x32'))){_0x1bf95c[_0x86b0('0x19')]=qs[_0x86b0('0x19')](_0x4ac0dd['query'][_0x86b0('0x19')]);_0x1bf95c['offset']=qs['offset'](_0x4ac0dd[_0x86b0('0x2b')][_0x86b0('0x18')]);}_0x1bf95c[_0x86b0('0x33')]=qs[_0x86b0('0x34')](_0x4ac0dd['query'][_0x86b0('0x34')]);_0x1bf95c[_0x86b0('0x35')]=qs[_0x86b0('0x2c')](_['pick'](_0x4ac0dd[_0x86b0('0x2b')],_0x37eace[_0x86b0('0x2c')]),_0x2433ce);if(_0x4ac0dd[_0x86b0('0x2b')][_0x86b0('0x36')]){_0x1bf95c[_0x86b0('0x35')]=_[_0x86b0('0x37')](_0x1bf95c[_0x86b0('0x35')],{'$or':_[_0x86b0('0x29')](_0x2433ce,function(_0xbfe27f){if(_0xbfe27f[_0x86b0('0x26')]!==_0x86b0('0x38')){var _0x282a84={};_0x282a84[_0xbfe27f['name']]={'$like':'%'+_0x4ac0dd[_0x86b0('0x2b')]['filter']+'%'};return _0x282a84;}})});}_0x1bf95c=_[_0x86b0('0x37')]({},_0x1bf95c,_0x4ac0dd['options']);var _0x519b52={'where':_0x1bf95c[_0x86b0('0x35')]};return db[_0x86b0('0x25')][_0x86b0('0x17')](_0x519b52)[_0x86b0('0x39')](function(_0x58a4bf){_0x175da1[_0x86b0('0x17')]=_0x58a4bf;if(_0x4ac0dd['query'][_0x86b0('0x3a')]){_0x1bf95c[_0x86b0('0x3b')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x86b0('0x3c')](_0x1bf95c);})[_0x86b0('0x39')](function(_0x413229){_0x175da1[_0x86b0('0x3d')]=_0x413229;return _0x175da1;})[_0x86b0('0x39')](respondWithFilteredResult(_0x4555e3,_0x1bf95c))[_0x86b0('0x3e')](handleError(_0x4555e3,null));};exports[_0x86b0('0x3f')]=function(_0x43a876,_0x490d80){var _0x5dea57={'raw':!![],'where':{'id':_0x43a876['params']['id']}},_0xc7c6b={};_0xc7c6b[_0x86b0('0x27')]=_[_0x86b0('0x2a')](db[_0x86b0('0x25')][_0x86b0('0x40')]);_0xc7c6b['query']=_[_0x86b0('0x2a')](_0x43a876['query']);_0xc7c6b[_0x86b0('0x2c')]=_[_0x86b0('0x2d')](_0xc7c6b[_0x86b0('0x27')],_0xc7c6b['query']);_0x5dea57['attributes']=_[_0x86b0('0x2d')](_0xc7c6b[_0x86b0('0x27')],qs[_0x86b0('0x2e')](_0x43a876[_0x86b0('0x2b')][_0x86b0('0x2e')]));_0x5dea57[_0x86b0('0x2f')]=_0x5dea57[_0x86b0('0x2f')][_0x86b0('0x30')]?_0x5dea57[_0x86b0('0x2f')]:_0xc7c6b[_0x86b0('0x27')];if(_0x43a876[_0x86b0('0x2b')][_0x86b0('0x3a')]){_0x5dea57[_0x86b0('0x3b')]=[{'all':!![]}];}_0x5dea57=_[_0x86b0('0x37')]({},_0x5dea57,_0x43a876[_0x86b0('0x41')]);return db['VoiceMailMessage'][_0x86b0('0x42')](_0x5dea57)[_0x86b0('0x39')](handleEntityNotFound(_0x490d80,null))['then'](respondWithResult(_0x490d80,null))['catch'](handleError(_0x490d80,null));};exports[_0x86b0('0x43')]=function(_0x11523a,_0x37c44f){return db[_0x86b0('0x25')][_0x86b0('0x43')](_0x11523a[_0x86b0('0x44')],{})['then'](respondWithResult(_0x37c44f,0xc9))[_0x86b0('0x3e')](handleError(_0x37c44f,null));};exports['update']=function(_0x5020a4,_0x7f5252){if(_0x5020a4[_0x86b0('0x44')]['id']){delete _0x5020a4[_0x86b0('0x44')]['id'];}return db['VoiceMailMessage'][_0x86b0('0x42')]({'where':{'id':_0x5020a4[_0x86b0('0x45')]['id']}})[_0x86b0('0x39')](handleEntityNotFound(_0x7f5252,null))['then'](saveUpdates(_0x5020a4[_0x86b0('0x44')],null))['then'](respondWithResult(_0x7f5252,null))[_0x86b0('0x3e')](handleError(_0x7f5252,null));};exports[_0x86b0('0x1f')]=function(_0x62ab15,_0x407ed4){return db[_0x86b0('0x25')][_0x86b0('0x42')]({'where':{'id':_0x62ab15[_0x86b0('0x45')]['id']}})[_0x86b0('0x39')](handleEntityNotFound(_0x407ed4,null))[_0x86b0('0x39')](removeEntity(_0x407ed4,null))['catch'](handleError(_0x407ed4,null));};exports[_0x86b0('0x46')]=function(_0x44655e,_0x1ccb22,_0x262a4c){return db[_0x86b0('0x25')][_0x86b0('0x42')]({'where':{'id':_0x44655e[_0x86b0('0x45')]['id']},'attributes':['id',_0x86b0('0x47'),'msg_id']})[_0x86b0('0x39')](handleEntityNotFound(_0x1ccb22,null))[_0x86b0('0x39')](function(_0x36b4a1){if(_0x36b4a1){if(!_0x36b4a1[_0x86b0('0x47')]){throw new db[(_0x86b0('0x48'))][(_0x86b0('0x49'))](_0x86b0('0x4a'));}var _0x347bdd={'Content-Type':_0x86b0('0x4b'),'Content-Disposition':'attachment'};if(_0x36b4a1[_0x86b0('0x4c')]){_0x347bdd[_0x86b0('0x4d')]=_0x86b0('0x4e')+_0x36b4a1[_0x86b0('0x4c')]+_0x86b0('0x4f');}_0x1ccb22[_0x86b0('0x1a')](_0x347bdd);return _0x1ccb22['send'](new Buffer(_0x36b4a1['recording']));}})['catch'](handleError(_0x1ccb22,null));};
\ No newline at end of file
index 3bcf29e..6ffe2b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc00c=['VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xc00c,0x1b5));var _0xcc00=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xc00c[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xcc00('0x0'));var util=require(_0xcc00('0x1'));var logger=require(_0xcc00('0x2'))(_0xcc00('0x3'));var moment=require(_0xcc00('0x4'));var BPromise=require(_0xcc00('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc00('0x6'));var rimraf=require(_0xcc00('0x7'));var config=require(_0xcc00('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0xcc00('0x9')]=function(_0x3e3456,_0x13684d){return _0x3e3456[_0xcc00('0xa')](_0xcc00('0xb'),attributes,{'tableName':_0xcc00('0xc'),'paranoid':![],'indexes':[{'name':_0xcc00('0xd'),'fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
+var _0xdc61=['VoiceMailMessage','voice_voicemail_messages','dir','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xdc61,0x1d1));var _0x1dc6=function(_0x486130,_0x53b7b7){_0x486130=_0x486130-0x0;var _0x4d7e81=_0xdc61[_0x486130];return _0x4d7e81;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1dc6('0x0'))(_0x1dc6('0x1'));var moment=require(_0x1dc6('0x2'));var BPromise=require(_0x1dc6('0x3'));var rp=require(_0x1dc6('0x4'));var fs=require('fs');var path=require(_0x1dc6('0x5'));var rimraf=require(_0x1dc6('0x6'));var config=require(_0x1dc6('0x7'));var attributes=require(_0x1dc6('0x8'));module[_0x1dc6('0x9')]=function(_0x2df56f,_0x1e12b9){return _0x2df56f[_0x1dc6('0xa')](_0x1dc6('0xb'),attributes,{'tableName':_0x1dc6('0xc'),'paranoid':![],'indexes':[{'name':_0x1dc6('0xd'),'fields':[_0x1dc6('0xd')]}],'timestamps':![]});};
\ No newline at end of file
index 695bea5..a5b6307 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2ac=['../../config/logger','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x155376,_0x157794){var _0x30d5ff=function(_0x3d4837){while(--_0x3d4837){_0x155376['push'](_0x155376['shift']());}};_0x30d5ff(++_0x157794);}(_0xf2ac,0xa3));var _0xcf2a=function(_0x47b56b,_0x5450be){_0x47b56b=_0x47b56b-0x0;var _0x45501f=_0xf2ac[_0x47b56b];return _0x45501f;};'use strict';var _=require('lodash');var util=require(_0xcf2a('0x0'));var moment=require('moment');var BPromise=require(_0xcf2a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf2a('0x2'));var db=require(_0xcf2a('0x3'))['db'];var utils=require(_0xcf2a('0x4'));var logger=require(_0xcf2a('0x5'))('rpc');var config=require(_0xcf2a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcf2a('0x7')][_0xcf2a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x233999,_0x30a4c7,_0xea018){return new BPromise(function(_0x143fbc,_0x5087b2){return client[_0xcf2a('0x9')](_0x233999,_0xea018)[_0xcf2a('0xa')](function(_0x210ebc){logger[_0xcf2a('0xb')](_0xcf2a('0xc'),_0x30a4c7,'request\x20sent');logger[_0xcf2a('0xd')](_0xcf2a('0xe'),_0x30a4c7,_0xcf2a('0xf'),JSON[_0xcf2a('0x10')](_0x210ebc));if(_0x210ebc['error']){if(_0x210ebc[_0xcf2a('0x11')]['code']===0x1f4){logger[_0xcf2a('0x11')](_0xcf2a('0xc'),_0x30a4c7,_0x210ebc['error'][_0xcf2a('0x12')]);return _0x5087b2(_0x210ebc[_0xcf2a('0x11')][_0xcf2a('0x12')]);}logger['error'](_0xcf2a('0xc'),_0x30a4c7,_0x210ebc[_0xcf2a('0x11')][_0xcf2a('0x12')]);return _0x143fbc(_0x210ebc[_0xcf2a('0x11')][_0xcf2a('0x12')]);}else{logger['info'](_0xcf2a('0xc'),_0x30a4c7,_0xcf2a('0xf'));_0x143fbc(_0x210ebc[_0xcf2a('0x13')][_0xcf2a('0x12')]);}})[_0xcf2a('0x14')](function(_0x48057a){logger['error'](_0xcf2a('0xc'),_0x30a4c7,_0x48057a);_0x5087b2(_0x48057a);});});}
\ No newline at end of file
+var _0x42ad=['client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x51b8e0,_0x3a2475){var _0x2689c5=function(_0x39905f){while(--_0x39905f){_0x51b8e0['push'](_0x51b8e0['shift']());}};_0x2689c5(++_0x3a2475);}(_0x42ad,0x109));var _0xd42a=function(_0x24b4c8,_0x1848df){_0x24b4c8=_0x24b4c8-0x0;var _0x300fbc=_0x42ad[_0x24b4c8];return _0x300fbc;};'use strict';var _=require(_0xd42a('0x0'));var util=require('util');var moment=require(_0xd42a('0x1'));var BPromise=require(_0xd42a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd42a('0x3'));var db=require(_0xd42a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd42a('0x5'))(_0xd42a('0x6'));var config=require(_0xd42a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd42a('0x8')][_0xd42a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cee9a,_0x3ff44e,_0x746462){return new BPromise(function(_0x46d064,_0x12fda6){return client[_0xd42a('0xa')](_0x2cee9a,_0x746462)[_0xd42a('0xb')](function(_0x5825ae){logger[_0xd42a('0xc')](_0xd42a('0xd'),_0x3ff44e,_0xd42a('0xe'));logger[_0xd42a('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x3ff44e,_0xd42a('0xe'),JSON[_0xd42a('0x10')](_0x5825ae));if(_0x5825ae[_0xd42a('0x11')]){if(_0x5825ae[_0xd42a('0x11')]['code']===0x1f4){logger['error'](_0xd42a('0xd'),_0x3ff44e,_0x5825ae[_0xd42a('0x11')][_0xd42a('0x12')]);return _0x12fda6(_0x5825ae[_0xd42a('0x11')][_0xd42a('0x12')]);}logger[_0xd42a('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x3ff44e,_0x5825ae[_0xd42a('0x11')][_0xd42a('0x12')]);return _0x46d064(_0x5825ae[_0xd42a('0x11')]['message']);}else{logger['info'](_0xd42a('0xd'),_0x3ff44e,_0xd42a('0xe'));_0x46d064(_0x5825ae[_0xd42a('0x13')][_0xd42a('0x12')]);}})[_0xd42a('0x14')](function(_0x16a2c1){logger[_0xd42a('0x11')](_0xd42a('0xd'),_0x3ff44e,_0x16a2c1);_0x12fda6(_0x16a2c1);});});}
\ No newline at end of file
index c310e27..3471325 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cae=['index','/:id','show','/:id/sounds','getSounds','post','create','addSound','update','destroy','/:id/sounds/:id2','removeSound','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x23516c,_0x16ea34){var _0x591310=function(_0x428292){while(--_0x428292){_0x23516c['push'](_0x23516c['shift']());}};_0x591310(++_0x16ea34);}(_0x6cae,0x145));var _0xe6ca=function(_0x1e1a5d,_0x5a63ee){_0x1e1a5d=_0x1e1a5d-0x0;var _0x5d5306=_0x6cae[_0x1e1a5d];return _0x5d5306;};'use strict';var multer=require('multer');var util=require(_0xe6ca('0x0'));var path=require(_0xe6ca('0x1'));var timeout=require(_0xe6ca('0x2'));var express=require(_0xe6ca('0x3'));var router=express[_0xe6ca('0x4')]();var fs_extra=require(_0xe6ca('0x5'));var auth=require(_0xe6ca('0x6'));var interaction=require(_0xe6ca('0x7'));var config=require(_0xe6ca('0x8'));var controller=require('./voiceMusicOnHold.controller');router[_0xe6ca('0x9')]('/',auth[_0xe6ca('0xa')](),controller[_0xe6ca('0xb')]);router[_0xe6ca('0x9')](_0xe6ca('0xc'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0xd')]);router[_0xe6ca('0x9')](_0xe6ca('0xe'),auth['isAuthenticated'](),controller[_0xe6ca('0xf')]);router[_0xe6ca('0x10')]('/',auth['isAuthenticated'](),controller[_0xe6ca('0x11')]);router['post'](_0xe6ca('0xe'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0x12')]);router['put'](_0xe6ca('0xc'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0x13')]);router['delete'](_0xe6ca('0xc'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0x14')]);router['delete'](_0xe6ca('0x15'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0x16')]);module[_0xe6ca('0x17')]=router;
\ No newline at end of file
+var _0xff13=['index','/:id','show','/:id/sounds','getSounds','post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1aab89,_0x40e92d){var _0x192afe=function(_0x34ff86){while(--_0x34ff86){_0x1aab89['push'](_0x1aab89['shift']());}};_0x192afe(++_0x40e92d);}(_0xff13,0x1d7));var _0x3ff1=function(_0x430067,_0x255035){_0x430067=_0x430067-0x0;var _0x485e6d=_0xff13[_0x430067];return _0x485e6d;};'use strict';var multer=require(_0x3ff1('0x0'));var util=require(_0x3ff1('0x1'));var path=require(_0x3ff1('0x2'));var timeout=require('connect-timeout');var express=require(_0x3ff1('0x3'));var router=express['Router']();var fs_extra=require(_0x3ff1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3ff1('0x5'));var config=require(_0x3ff1('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x3ff1('0x7')]('/',auth[_0x3ff1('0x8')](),controller[_0x3ff1('0x9')]);router[_0x3ff1('0x7')](_0x3ff1('0xa'),auth['isAuthenticated'](),controller[_0x3ff1('0xb')]);router[_0x3ff1('0x7')](_0x3ff1('0xc'),auth[_0x3ff1('0x8')](),controller[_0x3ff1('0xd')]);router[_0x3ff1('0xe')]('/',auth[_0x3ff1('0x8')](),controller[_0x3ff1('0xf')]);router['post'](_0x3ff1('0xc'),auth[_0x3ff1('0x8')](),controller[_0x3ff1('0x10')]);router[_0x3ff1('0x11')](_0x3ff1('0xa'),auth[_0x3ff1('0x8')](),controller[_0x3ff1('0x12')]);router[_0x3ff1('0x13')](_0x3ff1('0xa'),auth[_0x3ff1('0x8')](),controller[_0x3ff1('0x14')]);router['delete'](_0x3ff1('0x15'),auth[_0x3ff1('0x8')](),controller[_0x3ff1('0x16')]);module[_0x3ff1('0x17')]=router;
\ No newline at end of file
index e8c1d26..260442e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3d3=['STRING','custom','files','mp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','exports'];(function(_0x56e3cc,_0x17d133){var _0xa46652=function(_0x10d0d9){while(--_0x10d0d9){_0x56e3cc['push'](_0x56e3cc['shift']());}};_0xa46652(++_0x17d133);}(_0xa3d3,0x1dc));var _0x3a3d=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xa3d3[_0x101e7b];return _0x4995c0;};'use strict';var Sequelize=require('sequelize');module[_0x3a3d('0x0')]={'name':{'type':Sequelize[_0x3a3d('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x3a3d('0x2'),_0x3a3d('0x3'),_0x3a3d('0x4'),'quietmp3nb','quietmp3',_0x3a3d('0x5')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x3a3d('0x6')},'format':{'type':Sequelize[_0x3a3d('0x1')],'allowNull':!![]},'stamp':{'type':_0x3a3d('0x7')},'defaultEntry':{'type':Sequelize[_0x3a3d('0x8')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc572=['sequelize','STRING','name','ENUM','files','quietmp3nb','quietmp3','mp3','TIMESTAMP','BOOLEAN'];(function(_0x28f32c,_0x4cc342){var _0x355402=function(_0xdb5032){while(--_0xdb5032){_0x28f32c['push'](_0x28f32c['shift']());}};_0x355402(++_0x4cc342);}(_0xc572,0x1d6));var _0x2c57=function(_0x49988d,_0x15dae4){_0x49988d=_0x49988d-0x0;var _0x2259f7=_0xc572[_0x49988d];return _0x2259f7;};'use strict';var Sequelize=require(_0x2c57('0x0'));module['exports']={'name':{'type':Sequelize[_0x2c57('0x1')],'allowNull':![],'unique':_0x2c57('0x2')},'mode':{'type':Sequelize[_0x2c57('0x3')]('custom',_0x2c57('0x4'),'mp3nb',_0x2c57('0x5'),_0x2c57('0x6'),_0x2c57('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x2c57('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x2c57('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2c57('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x2c57('0x1')],'allowNull':!![]},'stamp':{'type':_0x2c57('0x8')},'defaultEntry':{'type':Sequelize[_0x2c57('0x9')],'defaultValue':0x0}};
\ No newline at end of file
index 7abcb34..9f46978 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56e1=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','json','apply','save','update','then','get','MusicOnHolds','destroy','stack','name','send','index','map','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','VoiceMusicOnHold','findAll','rows','catch','params','includeAll','options','find','body','sequelize','transaction','mode','files','join','root','server/files/moh','create','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','Sequelize','message','addSound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','ValidationError','removeSound','Sound','getSounds','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4c0355,_0x1431ab){var _0x5150a1=function(_0x2292e8){while(--_0x2292e8){_0x4c0355['push'](_0x4c0355['shift']());}};_0x5150a1(++_0x1431ab);}(_0x56e1,0x1a8));var _0x156e=function(_0x112d2e,_0x34d10d){_0x112d2e=_0x112d2e-0x0;var _0xe21b9e=_0x56e1[_0x112d2e];return _0xe21b9e;};'use strict';var emlformat=require(_0x156e('0x0'));var rimraf=require(_0x156e('0x1'));var zipdir=require(_0x156e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x156e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x156e('0x4'));var util=require(_0x156e('0x5'));var path=require(_0x156e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x156e('0x7'));var fs=require('fs');var fs_extra=require(_0x156e('0x8'));var _=require(_0x156e('0x9'));var squel=require(_0x156e('0xa'));var crypto=require(_0x156e('0xb'));var jsforce=require(_0x156e('0xc'));var deskjs=require(_0x156e('0xd'));var toCsv=require(_0x156e('0xe'));var querystring=require(_0x156e('0xf'));var Papa=require(_0x156e('0x10'));var Redis=require(_0x156e('0x11'));var authService=require(_0x156e('0x12'));var qs=require(_0x156e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x156e('0x14'));var logger=require(_0x156e('0x15'))(_0x156e('0x16'));var utils=require(_0x156e('0x17'));var config=require(_0x156e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x156e('0x19'))['db'];function respondWithStatusCode(_0x208e78,_0x302c32){_0x302c32=_0x302c32||0xcc;return function(_0x2142a8){if(_0x2142a8){return _0x208e78['sendStatus'](_0x302c32);}return _0x208e78[_0x156e('0x1a')](_0x302c32)[_0x156e('0x1b')]();};}function respondWithResult(_0x1d6ab2,_0x48fe62){_0x48fe62=_0x48fe62||0xc8;return function(_0x1fb1de){if(_0x1fb1de){return _0x1d6ab2[_0x156e('0x1a')](_0x48fe62)['json'](_0x1fb1de);}};}function respondWithFilteredResult(_0x4bac31,_0x28e500){return function(_0x156662){if(_0x156662){var _0x3acffe=typeof _0x28e500[_0x156e('0x1c')]===_0x156e('0x1d')&&typeof _0x28e500[_0x156e('0x1e')]==='undefined';var _0x402929=_0x156662['count'];var _0x2edf5d=_0x3acffe?0x0:_0x28e500[_0x156e('0x1c')];var _0xd740fa=_0x3acffe?_0x156662[_0x156e('0x1f')]:_0x28e500['offset']+_0x28e500[_0x156e('0x1e')];var _0x3da65f;if(_0xd740fa>=_0x402929){_0xd740fa=_0x402929;_0x3da65f=0xc8;}else{_0x3da65f=0xce;}_0x4bac31[_0x156e('0x1a')](_0x3da65f);return _0x4bac31['set']('Content-Range',_0x2edf5d+'-'+_0xd740fa+'/'+_0x402929)[_0x156e('0x20')](_0x156662);}return null;};}function patchUpdates(_0x56b5a7){return function(_0x2c9d58){try{jsonpatch[_0x156e('0x21')](_0x2c9d58,_0x56b5a7,!![]);}catch(_0x1d7ec0){return BPromise['reject'](_0x1d7ec0);}return _0x2c9d58[_0x156e('0x22')]();};}function saveUpdates(_0x48053e,_0x5809dc){return function(_0x1234c8){if(_0x1234c8){return _0x1234c8[_0x156e('0x23')](_0x48053e)[_0x156e('0x24')](function(_0x59022b){return _0x59022b;});}return null;};}function removeEntity(_0x57c185,_0x5fe0d9){return function(_0x2dd517){if(_0x2dd517){return _0x2dd517['destroy']()['then'](function(){var _0x311c50=_0x2dd517[_0x156e('0x25')]({'plain':!![]});var _0x5858ef=_0x156e('0x26');return db['UserProfileResource'][_0x156e('0x27')]({'where':{'type':_0x5858ef,'resourceId':_0x311c50['id']}})[_0x156e('0x24')](function(){return _0x2dd517;});})[_0x156e('0x24')](function(){_0x57c185[_0x156e('0x1a')](0xcc)[_0x156e('0x1b')]();});}};}function handleEntityNotFound(_0x43f843,_0x41bc37){return function(_0x4b9269){if(!_0x4b9269){_0x43f843['sendStatus'](0x194);}return _0x4b9269;};}function handleError(_0x3eb0b3,_0x41a081){_0x41a081=_0x41a081||0x1f4;return function(_0x40c5cb){logger['error'](_0x40c5cb[_0x156e('0x28')]);if(_0x40c5cb[_0x156e('0x29')]){delete _0x40c5cb[_0x156e('0x29')];}_0x3eb0b3[_0x156e('0x1a')](_0x41a081)[_0x156e('0x2a')](_0x40c5cb);};}exports[_0x156e('0x2b')]=function(_0xe9ebf7,_0x364f37){var _0x405feb={},_0x510661={},_0x4b53e1={'count':0x0,'rows':[]};var _0x33f49c=_[_0x156e('0x2c')](db['VoiceMusicOnHold'][_0x156e('0x2d')],function(_0x14ce70){return{'name':_0x14ce70['fieldName'],'type':_0x14ce70['type']['key']};});_0x510661[_0x156e('0x2e')]=_[_0x156e('0x2c')](_0x33f49c,_0x156e('0x29'));_0x510661['query']=_[_0x156e('0x2f')](_0xe9ebf7[_0x156e('0x30')]);_0x510661[_0x156e('0x31')]=_['intersection'](_0x510661[_0x156e('0x2e')],_0x510661[_0x156e('0x30')]);_0x405feb[_0x156e('0x32')]=_[_0x156e('0x33')](_0x510661[_0x156e('0x2e')],qs[_0x156e('0x34')](_0xe9ebf7[_0x156e('0x30')][_0x156e('0x34')]));_0x405feb['attributes']=_0x405feb['attributes'][_0x156e('0x35')]?_0x405feb[_0x156e('0x32')]:_0x510661[_0x156e('0x2e')];if(!_0xe9ebf7[_0x156e('0x30')][_0x156e('0x36')](_0x156e('0x37'))){_0x405feb[_0x156e('0x1e')]=qs[_0x156e('0x1e')](_0xe9ebf7[_0x156e('0x30')][_0x156e('0x1e')]);_0x405feb[_0x156e('0x1c')]=qs[_0x156e('0x1c')](_0xe9ebf7[_0x156e('0x30')][_0x156e('0x1c')]);}_0x405feb[_0x156e('0x38')]=qs['sort'](_0xe9ebf7[_0x156e('0x30')][_0x156e('0x39')]);delete _0xe9ebf7[_0x156e('0x30')][_0x156e('0x39')];_0x405feb[_0x156e('0x3a')]=qs[_0x156e('0x31')](_[_0x156e('0x3b')](_0xe9ebf7['query'],_0x510661[_0x156e('0x31')]),_0x33f49c);if(_0xe9ebf7[_0x156e('0x30')][_0x156e('0x3c')]){_0x405feb[_0x156e('0x3a')]=_[_0x156e('0x3d')](_0x405feb['where'],{'$or':_[_0x156e('0x2c')](_0x33f49c,function(_0xec963){if(_0xec963['type']!==_0x156e('0x3e')){var _0x313544={};_0x313544[_0xec963['name']]={'$like':'%'+_0xe9ebf7[_0x156e('0x30')][_0x156e('0x3c')]+'%'};return _0x313544;}})});}_0x405feb=_[_0x156e('0x3d')]({},_0x405feb,_0xe9ebf7['options']);var _0x13075a={'where':_0x405feb[_0x156e('0x3a')]};return db['VoiceMusicOnHold'][_0x156e('0x1f')](_0x13075a)['then'](function(_0x57e7d3){_0x4b53e1[_0x156e('0x1f')]=_0x57e7d3;if(_0xe9ebf7['query']['includeAll']){_0x405feb[_0x156e('0x3f')]=[{'all':!![]}];}return db[_0x156e('0x40')][_0x156e('0x41')](_0x405feb);})['then'](function(_0x56c693){_0x4b53e1[_0x156e('0x42')]=_0x56c693;return _0x4b53e1;})[_0x156e('0x24')](respondWithFilteredResult(_0x364f37,_0x405feb))[_0x156e('0x43')](handleError(_0x364f37,null));};exports['show']=function(_0x30430f,_0xd057af){var _0x234c41={'raw':![],'where':{'id':_0x30430f[_0x156e('0x44')]['id']}},_0x1f0189={};_0x1f0189['model']=_[_0x156e('0x2f')](db[_0x156e('0x40')][_0x156e('0x2d')]);_0x1f0189['query']=_[_0x156e('0x2f')](_0x30430f[_0x156e('0x30')]);_0x1f0189[_0x156e('0x31')]=_[_0x156e('0x33')](_0x1f0189[_0x156e('0x2e')],_0x1f0189[_0x156e('0x30')]);_0x234c41['attributes']=_['intersection'](_0x1f0189[_0x156e('0x2e')],qs[_0x156e('0x34')](_0x30430f[_0x156e('0x30')]['fields']));_0x234c41[_0x156e('0x32')]=_0x234c41[_0x156e('0x32')][_0x156e('0x35')]?_0x234c41[_0x156e('0x32')]:_0x1f0189[_0x156e('0x2e')];if(_0x30430f[_0x156e('0x30')][_0x156e('0x45')]){_0x234c41[_0x156e('0x3f')]=[{'all':!![]}];}_0x234c41=_['merge']({},_0x234c41,_0x30430f[_0x156e('0x46')]);return db[_0x156e('0x40')][_0x156e('0x47')](_0x234c41)[_0x156e('0x24')](handleEntityNotFound(_0xd057af,null))[_0x156e('0x24')](respondWithResult(_0xd057af,null))[_0x156e('0x43')](handleError(_0xd057af,null));};exports[_0x156e('0x23')]=function(_0x5a7af2,_0x44eb19){if(_0x5a7af2[_0x156e('0x48')]['id']){delete _0x5a7af2[_0x156e('0x48')]['id'];}return db[_0x156e('0x40')][_0x156e('0x47')]({'where':{'id':_0x5a7af2[_0x156e('0x44')]['id']}})[_0x156e('0x24')](handleEntityNotFound(_0x44eb19,null))['then'](saveUpdates(_0x5a7af2[_0x156e('0x48')],null))[_0x156e('0x24')](respondWithResult(_0x44eb19,null))[_0x156e('0x43')](handleError(_0x44eb19,null));};exports['create']=function(_0x5ce5cc,_0x18f764,_0x27d0cd){return db[_0x156e('0x49')][_0x156e('0x4a')](function(_0x3e6654){if(_0x5ce5cc[_0x156e('0x48')][_0x156e('0x4b')]===_0x156e('0x4c')){_0x5ce5cc[_0x156e('0x48')]['directory']=path[_0x156e('0x4d')](config[_0x156e('0x4e')],_0x156e('0x4f'),_0x5ce5cc[_0x156e('0x48')][_0x156e('0x29')]);}return db[_0x156e('0x40')][_0x156e('0x50')](_0x5ce5cc[_0x156e('0x48')],{'transaction':_0x3e6654})[_0x156e('0x24')](function(_0x25058b){if(_0x5ce5cc[_0x156e('0x48')][_0x156e('0x4b')]===_0x156e('0x4c')){fs[_0x156e('0x51')](_0x25058b[_0x156e('0x52')],parseInt(_0x156e('0x53'),0x8));}var _0x4cc247=_0x5ce5cc[_0x156e('0x54')][_0x156e('0x25')]({'plain':!![]});if(!_0x4cc247)throw new Error(_0x156e('0x55'));if(_0x4cc247['role']===_0x156e('0x54')){var _0x9fc43d=_0x25058b[_0x156e('0x25')]({'plain':!![]});return db['UserProfileSection'][_0x156e('0x47')]({'where':{'name':'MusicOnHolds','userProfileId':_0x4cc247[_0x156e('0x56')]},'raw':!![]})['then'](function(_0x399944){if(_0x399944&&_0x399944['autoAssociation']===0x0){return db['UserProfileResource'][_0x156e('0x50')]({'name':_0x9fc43d[_0x156e('0x29')],'resourceId':_0x9fc43d['id'],'type':_0x399944[_0x156e('0x29')],'sectionId':_0x399944['id']},{})[_0x156e('0x24')](function(){return _0x25058b;});}else{return _0x25058b;}})[_0x156e('0x43')](function(_0x23ebab){logger[_0x156e('0x57')](_0x156e('0x58'),_0x23ebab);});}return _0x25058b;});})[_0x156e('0x24')](respondWithResult(_0x18f764,0xc9))['catch'](handleError(_0x18f764,null));};exports[_0x156e('0x27')]=function(_0x328f97,_0x24fe62,_0x58b801){var _0x4c5c8f;return db[_0x156e('0x40')][_0x156e('0x47')]({'where':{'id':_0x328f97[_0x156e('0x44')]['id']}})['then'](function(_0xf15b14){if(_0xf15b14){return db[_0x156e('0x49')]['transaction'](function(_0x3f5f8f){return _0xf15b14['destroy']({'transaction':_0x3f5f8f,'raw':!![]})[_0x156e('0x24')](function(_0x15968f){if(_0x15968f['directory']){fs['readdirSync'](_0x15968f[_0x156e('0x52')])[_0x156e('0x59')](function(_0x59a9b7){fs[_0x156e('0x5a')](path[_0x156e('0x4d')](_0x15968f[_0x156e('0x52')],_0x59a9b7));});fs[_0x156e('0x5b')](_0x15968f[_0x156e('0x52')]);}return _0x15968f;});})[_0x156e('0x43')](function(_0x1fc2c2){throw new db[(_0x156e('0x5c'))]['ValidationError'](_0x1fc2c2[_0x156e('0x5d')]);});}})[_0x156e('0x24')](handleEntityNotFound(_0x24fe62,null))[_0x156e('0x24')](removeEntity(_0x24fe62,null))[_0x156e('0x43')](handleError(_0x24fe62,null));};exports[_0x156e('0x5e')]=function(_0x728c6f,_0x52b705,_0x4a6ce9){return db['sequelize'][_0x156e('0x4a')](function(_0x194e3f){var _0x26926d;return db[_0x156e('0x40')]['find']({'where':{'id':_0x728c6f[_0x156e('0x44')]['id']}})['then'](function(_0x1e6053){if(_0x1e6053){_0x26926d=_0x1e6053;return _0x1e6053[_0x156e('0x5e')](_0x728c6f[_0x156e('0x48')]['id'],{'transaction':_0x194e3f});}})['then'](function(_0x33f77b){if(_0x33f77b){return db['Sound'][_0x156e('0x5f')]({'where':{'id':_0x728c6f[_0x156e('0x48')]['id']},'attributes':['id',_0x156e('0x29'),_0x156e('0x60'),_0x156e('0x61'),_0x156e('0x62')],'raw':!![]});}})['then'](function(_0x1b655d){if(_0x1b655d){var _0x331832=path[_0x156e('0x4d')](config[_0x156e('0x4e')],_0x156e('0x63'),util[_0x156e('0x64')](_0x156e('0x65'),path[_0x156e('0x66')](_0x1b655d[_0x156e('0x60')],path[_0x156e('0x67')](_0x1b655d[_0x156e('0x60')])),_0x1b655d['converted_format']));var _0x3603a8=path[_0x156e('0x4d')](config['root'],'server/files/moh',_0x26926d[_0x156e('0x29')],util['format'](_0x156e('0x65'),_0x1b655d[_0x156e('0x29')],_0x1b655d['converted_format']));fs[_0x156e('0x68')](_0x331832,_0x3603a8);return _0x1b655d;}})[_0x156e('0x43')](function(_0x27417e){throw new db[(_0x156e('0x5c'))][(_0x156e('0x69'))](_0x27417e['message']);});})[_0x156e('0x24')](handleEntityNotFound(_0x52b705,null))[_0x156e('0x24')](respondWithResult(_0x52b705,0xc9))[_0x156e('0x43')](handleError(_0x52b705,null));};exports[_0x156e('0x6a')]=function(_0x1a47c1,_0x41810c,_0x1c83b9){return db[_0x156e('0x49')][_0x156e('0x4a')](function(_0x5b20ab){var _0x387860;return db[_0x156e('0x40')][_0x156e('0x5f')]({'where':{'id':_0x1a47c1['params']['id']}})[_0x156e('0x24')](handleEntityNotFound(_0x41810c,null))[_0x156e('0x24')](function(_0x3feec1){if(_0x3feec1){_0x387860=_0x3feec1;return _0x3feec1[_0x156e('0x6a')](_0x1a47c1[_0x156e('0x44')]['id2']);}})[_0x156e('0x24')](function(_0x4093ee){if(_0x4093ee){return db[_0x156e('0x6b')]['findOne']({'where':{'id':_0x1a47c1[_0x156e('0x44')]['id2']},'attributes':['id',_0x156e('0x29'),_0x156e('0x60'),_0x156e('0x61'),_0x156e('0x62')],'raw':!![]});}})[_0x156e('0x24')](function(_0x988b76){if(_0x988b76){fs[_0x156e('0x5a')](path[_0x156e('0x4d')](_0x387860[_0x156e('0x52')],util[_0x156e('0x64')](_0x156e('0x65'),_0x988b76[_0x156e('0x29')],_0x988b76[_0x156e('0x61')])));return _0x988b76;}})[_0x156e('0x43')](function(_0x51d5cd){throw new db[(_0x156e('0x5c'))][(_0x156e('0x69'))](_0x51d5cd[_0x156e('0x5d')]);});})[_0x156e('0x24')](handleEntityNotFound(_0x41810c,null))['then'](respondWithStatusCode(_0x41810c,0xcc))[_0x156e('0x43')](handleError(_0x41810c,null));};exports[_0x156e('0x6c')]=function(_0x2ea9cd,_0x3bcd2e,_0x573718){var _0x16502f={};var _0x237b1e={};var _0x1be545;var _0x39464f;return db[_0x156e('0x40')][_0x156e('0x5f')]({'where':{'id':_0x2ea9cd['params']['id']}})['then'](handleEntityNotFound(_0x3bcd2e,null))[_0x156e('0x24')](function(_0x7efad8){if(_0x7efad8){_0x1be545=_0x7efad8;_0x237b1e[_0x156e('0x2e')]=_[_0x156e('0x2f')](db[_0x156e('0x6b')][_0x156e('0x2d')]);_0x237b1e[_0x156e('0x30')]=_['keys'](_0x2ea9cd[_0x156e('0x30')]);_0x237b1e['filters']=_[_0x156e('0x33')](_0x237b1e[_0x156e('0x2e')],_0x237b1e[_0x156e('0x30')]);_0x16502f[_0x156e('0x32')]=_[_0x156e('0x33')](_0x237b1e[_0x156e('0x2e')],qs[_0x156e('0x34')](_0x2ea9cd['query'][_0x156e('0x34')]));_0x16502f[_0x156e('0x32')]=_0x16502f[_0x156e('0x32')][_0x156e('0x35')]?_0x16502f[_0x156e('0x32')]:_0x237b1e['model'];_0x16502f['order']=qs[_0x156e('0x39')](_0x2ea9cd['query'][_0x156e('0x39')]);_0x16502f[_0x156e('0x3a')]=qs[_0x156e('0x31')](_[_0x156e('0x3b')](_0x2ea9cd[_0x156e('0x30')],_0x237b1e[_0x156e('0x31')]));if(_0x2ea9cd[_0x156e('0x30')][_0x156e('0x3c')]){_0x16502f[_0x156e('0x3a')]=_[_0x156e('0x3d')](_0x16502f[_0x156e('0x3a')],{'$or':_['map'](_0x16502f[_0x156e('0x32')],function(_0xfad9c4){var _0x3e3978={};_0x3e3978[_0xfad9c4]={'$like':'%'+_0x2ea9cd[_0x156e('0x30')][_0x156e('0x3c')]+'%'};return _0x3e3978;})});}_0x16502f=_[_0x156e('0x3d')]({},_0x16502f,_0x2ea9cd[_0x156e('0x46')]);return _0x1be545['getSounds'](_0x16502f);}})[_0x156e('0x24')](function(_0x3f007a){if(_0x3f007a){_0x39464f=_0x3f007a[_0x156e('0x35')];if(!_0x2ea9cd[_0x156e('0x30')][_0x156e('0x36')]('nolimit')){_0x16502f[_0x156e('0x1e')]=qs[_0x156e('0x1e')](_0x2ea9cd[_0x156e('0x30')][_0x156e('0x1e')]);_0x16502f[_0x156e('0x1c')]=qs[_0x156e('0x1c')](_0x2ea9cd[_0x156e('0x30')][_0x156e('0x1c')]);}return _0x1be545[_0x156e('0x6c')](_0x16502f);}})['then'](function(_0x35563e){if(_0x35563e){return _0x35563e?{'count':_0x39464f,'rows':_0x35563e}:null;}})[_0x156e('0x24')](respondWithResult(_0x3bcd2e,null))[_0x156e('0x43')](handleError(_0x3bcd2e,null));};
\ No newline at end of file
+var _0x411e=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','keys','find','catch','update','body','create','sequelize','transaction','directory','join','server/files/moh','mode','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','forEach','unlinkSync','rmdirSync','addSound','findOne','converted_format','createdAt','root','server/files/sounds/converted','%s.%s','basename','save_name','format','symlinkSync','ValidationError','message','removeSound','Sound','Sequelize','getSounds','order','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','save','destroy','then','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x3de010,_0x506309){var _0x3e1baa=function(_0x2a13ac){while(--_0x2a13ac){_0x3de010['push'](_0x3de010['shift']());}};_0x3e1baa(++_0x506309);}(_0x411e,0x1e6));var _0xe411=function(_0x2e5f9c,_0x134a52){_0x2e5f9c=_0x2e5f9c-0x0;var _0x538b44=_0x411e[_0x2e5f9c];return _0x538b44;};'use strict';var emlformat=require(_0xe411('0x0'));var rimraf=require(_0xe411('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe411('0x2'));var rp=require('request-promise');var moment=require(_0xe411('0x3'));var BPromise=require(_0xe411('0x4'));var Mustache=require('mustache');var util=require(_0xe411('0x5'));var path=require(_0xe411('0x6'));var sox=require(_0xe411('0x7'));var csv=require(_0xe411('0x8'));var ejs=require(_0xe411('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe411('0xa'));var squel=require(_0xe411('0xb'));var crypto=require(_0xe411('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe411('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe411('0xe'));var qs=require(_0xe411('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe411('0x10'));var logger=require(_0xe411('0x11'))(_0xe411('0x12'));var utils=require(_0xe411('0x13'));var config=require(_0xe411('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe411('0x15'))['db'];function respondWithStatusCode(_0x147eb5,_0x3eab03){_0x3eab03=_0x3eab03||0xcc;return function(_0x1c4d2b){if(_0x1c4d2b){return _0x147eb5[_0xe411('0x16')](_0x3eab03);}return _0x147eb5[_0xe411('0x17')](_0x3eab03)[_0xe411('0x18')]();};}function respondWithResult(_0x484e4d,_0x3af0c3){_0x3af0c3=_0x3af0c3||0xc8;return function(_0x95a8ec){if(_0x95a8ec){return _0x484e4d[_0xe411('0x17')](_0x3af0c3)['json'](_0x95a8ec);}};}function respondWithFilteredResult(_0x1e2ff2,_0x4fdaa9){return function(_0x35a363){if(_0x35a363){var _0x41c7c0=typeof _0x4fdaa9['offset']===_0xe411('0x19')&&typeof _0x4fdaa9[_0xe411('0x1a')]===_0xe411('0x19');var _0x5342b7=_0x35a363[_0xe411('0x1b')];var _0x4b9152=_0x41c7c0?0x0:_0x4fdaa9['offset'];var _0x2f6398=_0x41c7c0?_0x35a363['count']:_0x4fdaa9[_0xe411('0x1c')]+_0x4fdaa9[_0xe411('0x1a')];var _0x30c406;if(_0x2f6398>=_0x5342b7){_0x2f6398=_0x5342b7;_0x30c406=0xc8;}else{_0x30c406=0xce;}_0x1e2ff2['status'](_0x30c406);return _0x1e2ff2[_0xe411('0x1d')](_0xe411('0x1e'),_0x4b9152+'-'+_0x2f6398+'/'+_0x5342b7)['json'](_0x35a363);}return null;};}function patchUpdates(_0x5406bd){return function(_0x386dab){try{jsonpatch['apply'](_0x386dab,_0x5406bd,!![]);}catch(_0x1cfca4){return BPromise[_0xe411('0x1f')](_0x1cfca4);}return _0x386dab[_0xe411('0x20')]();};}function saveUpdates(_0x32cb14,_0x2dd578){return function(_0x688a67){if(_0x688a67){return _0x688a67['update'](_0x32cb14)['then'](function(_0x188fc0){return _0x188fc0;});}return null;};}function removeEntity(_0x3913a6,_0x2e2bbd){return function(_0x1a47e4){if(_0x1a47e4){return _0x1a47e4[_0xe411('0x21')]()[_0xe411('0x22')](function(){var _0x406b2c=_0x1a47e4[_0xe411('0x23')]({'plain':!![]});var _0x4fe284=_0xe411('0x24');return db[_0xe411('0x25')][_0xe411('0x21')]({'where':{'type':_0x4fe284,'resourceId':_0x406b2c['id']}})['then'](function(){return _0x1a47e4;});})[_0xe411('0x22')](function(){_0x3913a6['status'](0xcc)[_0xe411('0x18')]();});}};}function handleEntityNotFound(_0x5365d9,_0x2c1e4b){return function(_0x1bc7a9){if(!_0x1bc7a9){_0x5365d9[_0xe411('0x16')](0x194);}return _0x1bc7a9;};}function handleError(_0x461284,_0x4930a7){_0x4930a7=_0x4930a7||0x1f4;return function(_0x581da0){logger[_0xe411('0x26')](_0x581da0[_0xe411('0x27')]);if(_0x581da0[_0xe411('0x28')]){delete _0x581da0[_0xe411('0x28')];}_0x461284[_0xe411('0x17')](_0x4930a7)[_0xe411('0x29')](_0x581da0);};}exports[_0xe411('0x2a')]=function(_0x42b0fe,_0x536452){var _0x93ed83={},_0x10e236={},_0x5b782b={'count':0x0,'rows':[]};var _0x58836d=_[_0xe411('0x2b')](db[_0xe411('0x2c')][_0xe411('0x2d')],function(_0x4b1d8d){return{'name':_0x4b1d8d[_0xe411('0x2e')],'type':_0x4b1d8d[_0xe411('0x2f')][_0xe411('0x30')]};});_0x10e236[_0xe411('0x31')]=_['map'](_0x58836d,_0xe411('0x28'));_0x10e236[_0xe411('0x32')]=_['keys'](_0x42b0fe[_0xe411('0x32')]);_0x10e236[_0xe411('0x33')]=_[_0xe411('0x34')](_0x10e236['model'],_0x10e236[_0xe411('0x32')]);_0x93ed83['attributes']=_[_0xe411('0x34')](_0x10e236['model'],qs[_0xe411('0x35')](_0x42b0fe[_0xe411('0x32')][_0xe411('0x35')]));_0x93ed83['attributes']=_0x93ed83[_0xe411('0x36')][_0xe411('0x37')]?_0x93ed83['attributes']:_0x10e236['model'];if(!_0x42b0fe[_0xe411('0x32')][_0xe411('0x38')](_0xe411('0x39'))){_0x93ed83['limit']=qs[_0xe411('0x1a')](_0x42b0fe[_0xe411('0x32')][_0xe411('0x1a')]);_0x93ed83['offset']=qs[_0xe411('0x1c')](_0x42b0fe[_0xe411('0x32')][_0xe411('0x1c')]);}_0x93ed83['order']=qs['sort'](_0x42b0fe[_0xe411('0x32')][_0xe411('0x3a')]);delete _0x42b0fe[_0xe411('0x32')][_0xe411('0x3a')];_0x93ed83[_0xe411('0x3b')]=qs[_0xe411('0x33')](_[_0xe411('0x3c')](_0x42b0fe[_0xe411('0x32')],_0x10e236[_0xe411('0x33')]),_0x58836d);if(_0x42b0fe[_0xe411('0x32')][_0xe411('0x3d')]){_0x93ed83['where']=_[_0xe411('0x3e')](_0x93ed83['where'],{'$or':_[_0xe411('0x2b')](_0x58836d,function(_0x53f4a1){if(_0x53f4a1[_0xe411('0x2f')]!==_0xe411('0x3f')){var _0x492e4f={};_0x492e4f[_0x53f4a1[_0xe411('0x28')]]={'$like':'%'+_0x42b0fe[_0xe411('0x32')][_0xe411('0x3d')]+'%'};return _0x492e4f;}})});}_0x93ed83=_[_0xe411('0x3e')]({},_0x93ed83,_0x42b0fe[_0xe411('0x40')]);var _0x2d165b={'where':_0x93ed83['where']};return db[_0xe411('0x2c')][_0xe411('0x1b')](_0x2d165b)['then'](function(_0x433baa){_0x5b782b[_0xe411('0x1b')]=_0x433baa;if(_0x42b0fe[_0xe411('0x32')][_0xe411('0x41')]){_0x93ed83[_0xe411('0x42')]=[{'all':!![]}];}return db[_0xe411('0x2c')]['findAll'](_0x93ed83);})[_0xe411('0x22')](function(_0x28c84c){_0x5b782b[_0xe411('0x43')]=_0x28c84c;return _0x5b782b;})[_0xe411('0x22')](respondWithFilteredResult(_0x536452,_0x93ed83))['catch'](handleError(_0x536452,null));};exports['show']=function(_0x651bd5,_0x45678c){var _0x5b0d1a={'raw':![],'where':{'id':_0x651bd5[_0xe411('0x44')]['id']}},_0x749891={};_0x749891[_0xe411('0x31')]=_[_0xe411('0x45')](db[_0xe411('0x2c')][_0xe411('0x2d')]);_0x749891[_0xe411('0x32')]=_['keys'](_0x651bd5['query']);_0x749891[_0xe411('0x33')]=_[_0xe411('0x34')](_0x749891[_0xe411('0x31')],_0x749891[_0xe411('0x32')]);_0x5b0d1a['attributes']=_[_0xe411('0x34')](_0x749891[_0xe411('0x31')],qs[_0xe411('0x35')](_0x651bd5[_0xe411('0x32')][_0xe411('0x35')]));_0x5b0d1a['attributes']=_0x5b0d1a['attributes'][_0xe411('0x37')]?_0x5b0d1a[_0xe411('0x36')]:_0x749891[_0xe411('0x31')];if(_0x651bd5[_0xe411('0x32')]['includeAll']){_0x5b0d1a[_0xe411('0x42')]=[{'all':!![]}];}_0x5b0d1a=_[_0xe411('0x3e')]({},_0x5b0d1a,_0x651bd5['options']);return db[_0xe411('0x2c')][_0xe411('0x46')](_0x5b0d1a)[_0xe411('0x22')](handleEntityNotFound(_0x45678c,null))[_0xe411('0x22')](respondWithResult(_0x45678c,null))[_0xe411('0x47')](handleError(_0x45678c,null));};exports[_0xe411('0x48')]=function(_0x19ef4f,_0x336ede){if(_0x19ef4f[_0xe411('0x49')]['id']){delete _0x19ef4f['body']['id'];}return db[_0xe411('0x2c')][_0xe411('0x46')]({'where':{'id':_0x19ef4f['params']['id']}})[_0xe411('0x22')](handleEntityNotFound(_0x336ede,null))[_0xe411('0x22')](saveUpdates(_0x19ef4f['body'],null))[_0xe411('0x22')](respondWithResult(_0x336ede,null))[_0xe411('0x47')](handleError(_0x336ede,null));};exports[_0xe411('0x4a')]=function(_0x36fb63,_0x3cbdb7,_0x21d76f){return db[_0xe411('0x4b')][_0xe411('0x4c')](function(_0x505b88){if(_0x36fb63[_0xe411('0x49')]['mode']==='files'){_0x36fb63['body'][_0xe411('0x4d')]=path[_0xe411('0x4e')](config['root'],_0xe411('0x4f'),_0x36fb63['body']['name']);}return db[_0xe411('0x2c')][_0xe411('0x4a')](_0x36fb63['body'],{'transaction':_0x505b88})[_0xe411('0x22')](function(_0x1d2b5b){if(_0x36fb63['body'][_0xe411('0x50')]==='files'){fs[_0xe411('0x51')](_0x1d2b5b[_0xe411('0x4d')],parseInt(_0xe411('0x52'),0x8));}var _0x2d39f8=_0x36fb63[_0xe411('0x53')][_0xe411('0x23')]({'plain':!![]});if(!_0x2d39f8)throw new Error(_0xe411('0x54'));if(_0x2d39f8['role']===_0xe411('0x53')){var _0x10be35=_0x1d2b5b[_0xe411('0x23')]({'plain':!![]});return db[_0xe411('0x55')][_0xe411('0x46')]({'where':{'name':_0xe411('0x24'),'userProfileId':_0x2d39f8[_0xe411('0x56')]},'raw':!![]})[_0xe411('0x22')](function(_0x3a049a){if(_0x3a049a&&_0x3a049a[_0xe411('0x57')]===0x0){return db[_0xe411('0x25')][_0xe411('0x4a')]({'name':_0x10be35[_0xe411('0x28')],'resourceId':_0x10be35['id'],'type':_0x3a049a[_0xe411('0x28')],'sectionId':_0x3a049a['id']},{})[_0xe411('0x22')](function(){return _0x1d2b5b;});}else{return _0x1d2b5b;}})[_0xe411('0x47')](function(_0x42f1dc){logger[_0xe411('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42f1dc);});}return _0x1d2b5b;});})[_0xe411('0x22')](respondWithResult(_0x3cbdb7,0xc9))[_0xe411('0x47')](handleError(_0x3cbdb7,null));};exports[_0xe411('0x21')]=function(_0x4c1dc1,_0x52e56f,_0x33c8dd){var _0x131fd6;return db['VoiceMusicOnHold'][_0xe411('0x46')]({'where':{'id':_0x4c1dc1[_0xe411('0x44')]['id']}})['then'](function(_0x492b70){if(_0x492b70){return db[_0xe411('0x4b')][_0xe411('0x4c')](function(_0x4fbc8a){return _0x492b70['destroy']({'transaction':_0x4fbc8a,'raw':!![]})[_0xe411('0x22')](function(_0x180aaf){if(_0x180aaf[_0xe411('0x4d')]){fs['readdirSync'](_0x180aaf[_0xe411('0x4d')])[_0xe411('0x58')](function(_0x35908e){fs[_0xe411('0x59')](path['join'](_0x180aaf[_0xe411('0x4d')],_0x35908e));});fs[_0xe411('0x5a')](_0x180aaf['directory']);}return _0x180aaf;});})[_0xe411('0x47')](function(_0x3e0566){throw new db['Sequelize']['ValidationError'](_0x3e0566['message']);});}})[_0xe411('0x22')](handleEntityNotFound(_0x52e56f,null))[_0xe411('0x22')](removeEntity(_0x52e56f,null))[_0xe411('0x47')](handleError(_0x52e56f,null));};exports[_0xe411('0x5b')]=function(_0x5cf14e,_0x50fa00,_0x1a28da){return db[_0xe411('0x4b')]['transaction'](function(_0x25ba58){var _0x104e2a;return db['VoiceMusicOnHold'][_0xe411('0x46')]({'where':{'id':_0x5cf14e[_0xe411('0x44')]['id']}})[_0xe411('0x22')](function(_0x51e4fa){if(_0x51e4fa){_0x104e2a=_0x51e4fa;return _0x51e4fa['addSound'](_0x5cf14e[_0xe411('0x49')]['id'],{'transaction':_0x25ba58});}})[_0xe411('0x22')](function(_0x865046){if(_0x865046){return db['Sound'][_0xe411('0x5c')]({'where':{'id':_0x5cf14e[_0xe411('0x49')]['id']},'attributes':['id',_0xe411('0x28'),'save_name',_0xe411('0x5d'),_0xe411('0x5e')],'raw':!![]});}})[_0xe411('0x22')](function(_0x5d45d3){if(_0x5d45d3){var _0x48f634=path[_0xe411('0x4e')](config[_0xe411('0x5f')],_0xe411('0x60'),util['format'](_0xe411('0x61'),path[_0xe411('0x62')](_0x5d45d3['save_name'],path['extname'](_0x5d45d3[_0xe411('0x63')])),_0x5d45d3[_0xe411('0x5d')]));var _0x172153=path[_0xe411('0x4e')](config[_0xe411('0x5f')],_0xe411('0x4f'),_0x104e2a[_0xe411('0x28')],util[_0xe411('0x64')](_0xe411('0x61'),_0x5d45d3[_0xe411('0x28')],_0x5d45d3[_0xe411('0x5d')]));fs[_0xe411('0x65')](_0x48f634,_0x172153);return _0x5d45d3;}})[_0xe411('0x47')](function(_0xefd45d){throw new db['Sequelize'][(_0xe411('0x66'))](_0xefd45d[_0xe411('0x67')]);});})[_0xe411('0x22')](handleEntityNotFound(_0x50fa00,null))[_0xe411('0x22')](respondWithResult(_0x50fa00,0xc9))[_0xe411('0x47')](handleError(_0x50fa00,null));};exports[_0xe411('0x68')]=function(_0x2dbc17,_0x55bc09,_0x4e03ba){return db['sequelize'][_0xe411('0x4c')](function(_0x52b787){var _0x203d85;return db[_0xe411('0x2c')][_0xe411('0x5c')]({'where':{'id':_0x2dbc17[_0xe411('0x44')]['id']}})['then'](handleEntityNotFound(_0x55bc09,null))[_0xe411('0x22')](function(_0x2264b1){if(_0x2264b1){_0x203d85=_0x2264b1;return _0x2264b1['removeSound'](_0x2dbc17[_0xe411('0x44')]['id2']);}})[_0xe411('0x22')](function(_0x24659d){if(_0x24659d){return db[_0xe411('0x69')][_0xe411('0x5c')]({'where':{'id':_0x2dbc17[_0xe411('0x44')]['id2']},'attributes':['id',_0xe411('0x28'),_0xe411('0x63'),_0xe411('0x5d'),'createdAt'],'raw':!![]});}})[_0xe411('0x22')](function(_0x35880b){if(_0x35880b){fs[_0xe411('0x59')](path['join'](_0x203d85[_0xe411('0x4d')],util[_0xe411('0x64')](_0xe411('0x61'),_0x35880b[_0xe411('0x28')],_0x35880b[_0xe411('0x5d')])));return _0x35880b;}})[_0xe411('0x47')](function(_0x4fe132){throw new db[(_0xe411('0x6a'))][(_0xe411('0x66'))](_0x4fe132[_0xe411('0x67')]);});})['then'](handleEntityNotFound(_0x55bc09,null))[_0xe411('0x22')](respondWithStatusCode(_0x55bc09,0xcc))['catch'](handleError(_0x55bc09,null));};exports[_0xe411('0x6b')]=function(_0x370bf7,_0x2b3ca7,_0x325bd9){var _0x584880={};var _0x30efed={};var _0x2c0936;var _0x3b24bc;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x370bf7['params']['id']}})['then'](handleEntityNotFound(_0x2b3ca7,null))[_0xe411('0x22')](function(_0x5ed9ec){if(_0x5ed9ec){_0x2c0936=_0x5ed9ec;_0x30efed[_0xe411('0x31')]=_[_0xe411('0x45')](db[_0xe411('0x69')][_0xe411('0x2d')]);_0x30efed['query']=_[_0xe411('0x45')](_0x370bf7[_0xe411('0x32')]);_0x30efed[_0xe411('0x33')]=_[_0xe411('0x34')](_0x30efed[_0xe411('0x31')],_0x30efed[_0xe411('0x32')]);_0x584880['attributes']=_['intersection'](_0x30efed[_0xe411('0x31')],qs[_0xe411('0x35')](_0x370bf7[_0xe411('0x32')][_0xe411('0x35')]));_0x584880['attributes']=_0x584880[_0xe411('0x36')][_0xe411('0x37')]?_0x584880['attributes']:_0x30efed[_0xe411('0x31')];_0x584880[_0xe411('0x6c')]=qs['sort'](_0x370bf7[_0xe411('0x32')][_0xe411('0x3a')]);_0x584880[_0xe411('0x3b')]=qs['filters'](_[_0xe411('0x3c')](_0x370bf7['query'],_0x30efed['filters']));if(_0x370bf7[_0xe411('0x32')]['filter']){_0x584880[_0xe411('0x3b')]=_[_0xe411('0x3e')](_0x584880[_0xe411('0x3b')],{'$or':_[_0xe411('0x2b')](_0x584880[_0xe411('0x36')],function(_0xbeb32f){var _0x395081={};_0x395081[_0xbeb32f]={'$like':'%'+_0x370bf7[_0xe411('0x32')][_0xe411('0x3d')]+'%'};return _0x395081;})});}_0x584880=_[_0xe411('0x3e')]({},_0x584880,_0x370bf7[_0xe411('0x40')]);return _0x2c0936['getSounds'](_0x584880);}})[_0xe411('0x22')](function(_0x2b1bab){if(_0x2b1bab){_0x3b24bc=_0x2b1bab[_0xe411('0x37')];if(!_0x370bf7[_0xe411('0x32')][_0xe411('0x38')](_0xe411('0x39'))){_0x584880[_0xe411('0x1a')]=qs[_0xe411('0x1a')](_0x370bf7['query'][_0xe411('0x1a')]);_0x584880[_0xe411('0x1c')]=qs['offset'](_0x370bf7[_0xe411('0x32')]['offset']);}return _0x2c0936[_0xe411('0x6b')](_0x584880);}})[_0xe411('0x22')](function(_0x45e8fd){if(_0x45e8fd){return _0x45e8fd?{'count':_0x3b24bc,'rows':_0x45e8fd}:null;}})[_0xe411('0x22')](respondWithResult(_0x2b3ca7,null))[_0xe411('0x47')](handleError(_0x2b3ca7,null));};
\ No newline at end of file
index 15e0386..a3f9c5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa209=['path','rimraf','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','api','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa209,0xba));var _0x9a20=function(_0x116a86,_0x4c463a){_0x116a86=_0x116a86-0x0;var _0x382536=_0xa209[_0x116a86];return _0x382536;};'use strict';var _=require(_0x9a20('0x0'));var util=require(_0x9a20('0x1'));var logger=require('../../config/logger')(_0x9a20('0x2'));var moment=require(_0x9a20('0x3'));var BPromise=require(_0x9a20('0x4'));var rp=require(_0x9a20('0x5'));var fs=require('fs');var path=require(_0x9a20('0x6'));var rimraf=require(_0x9a20('0x7'));var config=require('../../config/environment');var attributes=require(_0x9a20('0x8'));module[_0x9a20('0x9')]=function(_0xb4a3f4,_0x3f6b50){return _0xb4a3f4[_0x9a20('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0x9a20('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xefb5=['util','../../config/logger','api','request-promise','path','rimraf','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xefb5,0x1cd));var _0x5efb=function(_0x522ae8,_0x3b637e){_0x522ae8=_0x522ae8-0x0;var _0x3189b9=_0xefb5[_0x522ae8];return _0x3189b9;};'use strict';var _=require(_0x5efb('0x0'));var util=require(_0x5efb('0x1'));var logger=require(_0x5efb('0x2'))(_0x5efb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5efb('0x4'));var fs=require('fs');var path=require(_0x5efb('0x5'));var rimraf=require(_0x5efb('0x6'));var config=require('../../config/environment');var attributes=require(_0x5efb('0x7'));module['exports']=function(_0x4e3bd9,_0xf46cf4){return _0x4e3bd9[_0x5efb('0x8')](_0x5efb('0x9'),attributes,{'tableName':_0x5efb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c0d916e..a95edbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x30a34b,_0x45d8f3){var _0x3cbeb0=function(_0x28c732){while(--_0x28c732){_0x30a34b['push'](_0x30a34b['shift']());}};_0x3cbeb0(++_0x45d8f3);}(_0xedd9,0xfc));var _0x9edd=function(_0x53dd89,_0x5212bb){_0x53dd89=_0x53dd89-0x0;var _0x2d2968=_0xedd9[_0x53dd89];return _0x2d2968;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});}
\ No newline at end of file
+var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xe0e275,_0x21de49){var _0x47bf08=function(_0x1769b6){while(--_0x1769b6){_0xe0e275['push'](_0xe0e275['shift']());}};_0x47bf08(++_0x21de49);}(_0x70e0,0x17b));var _0x070e=function(_0x4ac4d9,_0x2f75fd){_0x4ac4d9=_0x4ac4d9-0x0;var _0x32d1a2=_0x70e0[_0x4ac4d9];return _0x32d1a2;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}
\ No newline at end of file
index 81183bb..35dd749 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1f0=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','get','/describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','delete','removeAgents','exports'];(function(_0x318dda,_0x1aa800){var _0x3f97ca=function(_0x1dc61a){while(--_0x1dc61a){_0x318dda['push'](_0x318dda['shift']());}};_0x3f97ca(++_0x1aa800);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x484fe1,_0x580c36){_0x484fe1=_0x484fe1-0x0;var _0x4dd4b8=_0xe1f0[_0x484fe1];return _0x4dd4b8;};'use strict';var multer=require('multer');var util=require(_0x0e1f('0x0'));var path=require(_0x0e1f('0x1'));var timeout=require('connect-timeout');var express=require(_0x0e1f('0x2'));var router=express[_0x0e1f('0x3')]();var fs_extra=require(_0x0e1f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0e1f('0x5'));var config=require(_0x0e1f('0x6'));var controller=require(_0x0e1f('0x7'));router['get']('/',auth[_0x0e1f('0x8')](),controller['index']);router[_0x0e1f('0x9')](_0x0e1f('0xa'),auth[_0x0e1f('0x8')](),controller['describe']);router['get'](_0x0e1f('0xb'),auth[_0x0e1f('0x8')](),controller['show']);router[_0x0e1f('0x9')](_0x0e1f('0xc'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0xd')]);router[_0x0e1f('0x9')](_0x0e1f('0xe'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0xf')]);router[_0x0e1f('0x10')]('/',auth[_0x0e1f('0x8')](),controller[_0x0e1f('0x11')]);router[_0x0e1f('0x10')]('/:id/users',auth[_0x0e1f('0x8')](),controller[_0x0e1f('0x12')]);router[_0x0e1f('0x10')](_0x0e1f('0xe'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0x13')]);router[_0x0e1f('0x14')](_0x0e1f('0xb'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0x15')]);router['delete'](_0x0e1f('0xb'),auth[_0x0e1f('0x8')](),controller['destroy']);router[_0x0e1f('0x16')](_0x0e1f('0xc'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0x17')]);router[_0x0e1f('0x16')](_0x0e1f('0xe'),auth[_0x0e1f('0x8')](),controller['removeTeams']);module[_0x0e1f('0x18')]=router;
\ No newline at end of file
+var _0x6dfa=['path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','getTeams','post','addAgents','/:id/teams','addTeams','put','delete','destroy','removeAgents','removeTeams','exports','multer','util'];(function(_0x4c9de8,_0x2535cb){var _0x463e68=function(_0x21d99d){while(--_0x21d99d){_0x4c9de8['push'](_0x4c9de8['shift']());}};_0x463e68(++_0x2535cb);}(_0x6dfa,0x7b));var _0xa6df=function(_0x5dd54e,_0x3b9e80){_0x5dd54e=_0x5dd54e-0x0;var _0x34eebd=_0x6dfa[_0x5dd54e];return _0x34eebd;};'use strict';var multer=require(_0xa6df('0x0'));var util=require(_0xa6df('0x1'));var path=require(_0xa6df('0x2'));var timeout=require(_0xa6df('0x3'));var express=require(_0xa6df('0x4'));var router=express['Router']();var fs_extra=require(_0xa6df('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa6df('0x6'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0xa6df('0x7')]('/',auth[_0xa6df('0x8')](),controller[_0xa6df('0x9')]);router[_0xa6df('0x7')](_0xa6df('0xa'),auth[_0xa6df('0x8')](),controller[_0xa6df('0xb')]);router[_0xa6df('0x7')](_0xa6df('0xc'),auth[_0xa6df('0x8')](),controller['show']);router[_0xa6df('0x7')](_0xa6df('0xd'),auth[_0xa6df('0x8')](),controller['getAgents']);router[_0xa6df('0x7')]('/:id/teams',auth[_0xa6df('0x8')](),controller[_0xa6df('0xe')]);router[_0xa6df('0xf')]('/',auth[_0xa6df('0x8')](),controller['create']);router[_0xa6df('0xf')](_0xa6df('0xd'),auth[_0xa6df('0x8')](),controller[_0xa6df('0x10')]);router[_0xa6df('0xf')](_0xa6df('0x11'),auth['isAuthenticated'](),controller[_0xa6df('0x12')]);router[_0xa6df('0x13')](_0xa6df('0xc'),auth[_0xa6df('0x8')](),controller['update']);router[_0xa6df('0x14')](_0xa6df('0xc'),auth[_0xa6df('0x8')](),controller[_0xa6df('0x15')]);router[_0xa6df('0x14')]('/:id/users',auth[_0xa6df('0x8')](),controller[_0xa6df('0x16')]);router[_0xa6df('0x14')](_0xa6df('0x11'),auth['isAuthenticated'](),controller[_0xa6df('0x17')]);module[_0xa6df('0x18')]=router;
\ No newline at end of file
index 1ee0fc4..4105482 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4f7=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue','INTEGER'];(function(_0x48bc03,_0x1377c2){var _0x57da1e=function(_0x4bf9b3){while(--_0x4bf9b3){_0x48bc03['push'](_0x48bc03['shift']());}};_0x57da1e(++_0x1377c2);}(_0xb4f7,0xc8));var _0x7b4f=function(_0x36bf05,_0x12f1aa){_0x36bf05=_0x36bf05-0x0;var _0x355c4d=_0xb4f7[_0x36bf05];return _0x355c4d;};'use strict';var Sequelize=require(_0x7b4f('0x0'));module[_0x7b4f('0x1')]={'name':{'type':Sequelize[_0x7b4f('0x2')],'allowNull':![],'unique':_0x7b4f('0x3')},'prefix':{'type':Sequelize[_0x7b4f('0x4')],'get':function(_0x2f0b68){return _0x7b4f('0x5')+this[_0x7b4f('0x6')](_0x7b4f('0x3'))+'-';}},'description':{'type':Sequelize[_0x7b4f('0x2')]},'callerIdAll':{'type':Sequelize[_0x7b4f('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x7b4f('0x7')]}};
\ No newline at end of file
+var _0x4aea=['name','VIRTUAL','getDataValue','INTEGER','sequelize','exports','STRING'];(function(_0x483102,_0x54e93d){var _0x5cc885=function(_0x54931c){while(--_0x54931c){_0x483102['push'](_0x483102['shift']());}};_0x5cc885(++_0x54e93d);}(_0x4aea,0x11c));var _0xa4ae=function(_0x1b4bd7,_0x4a7ff3){_0x1b4bd7=_0x1b4bd7-0x0;var _0x2964ef=_0x4aea[_0x1b4bd7];return _0x2964ef;};'use strict';var Sequelize=require(_0xa4ae('0x0'));module[_0xa4ae('0x1')]={'name':{'type':Sequelize[_0xa4ae('0x2')],'allowNull':![],'unique':_0xa4ae('0x3')},'prefix':{'type':Sequelize[_0xa4ae('0x4')],'get':function(_0x311e5b){return'system-'+this[_0xa4ae('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0xa4ae('0x2')]},'callerIdAll':{'type':Sequelize[_0xa4ae('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xa4ae('0x6')]}};
\ No newline at end of file
index 4f6d087..52c7ec8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd4f=['lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','send','map','VoicePrefix','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','describe','create','transaction','body','VoiceExtension','find','VoiceExtensionId','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','charAt','update','system-','sequelize','findById','addAgents','spread','ids','emit','userVoicePrefix:save','removeAgents','isArray','getAgents','findOne','rawAttributes','order','getTeams','Team','nolimit','findAll','User','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','removeTeams','userVoicePrefix:remove','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x3a3ee3,_0x216274){var _0x543f31=function(_0x35814e){while(--_0x35814e){_0x3a3ee3['push'](_0x3a3ee3['shift']());}};_0x543f31(++_0x216274);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x5005fa,_0x56fd91){_0x5005fa=_0x5005fa-0x0;var _0x2cb900=_0xdd4f[_0x5005fa];return _0x2cb900;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var hardwareService=require(_0xfdd4('0x10'));var logger=require(_0xfdd4('0x11'))(_0xfdd4('0x12'));var utils=require(_0xfdd4('0x13'));var config=require(_0xfdd4('0x14'));var licenseUtil=require(_0xfdd4('0x15'));var db=require(_0xfdd4('0x16'))['db'];config[_0xfdd4('0x17')]=_[_0xfdd4('0x18')](config[_0xfdd4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xfdd4('0x19'))(new Redis(config[_0xfdd4('0x17')]));require(_0xfdd4('0x1a'))['register'](socket);function respondWithStatusCode(_0x1b7da1,_0x4aaeee){_0x4aaeee=_0x4aaeee||0xcc;return function(_0x467824){if(_0x467824){return _0x1b7da1[_0xfdd4('0x1b')](_0x4aaeee);}return _0x1b7da1[_0xfdd4('0x1c')](_0x4aaeee)[_0xfdd4('0x1d')]();};}function respondWithResult(_0x37b05f,_0x52cf2c){_0x52cf2c=_0x52cf2c||0xc8;return function(_0x47ed1d){if(_0x47ed1d){return _0x37b05f['status'](_0x52cf2c)[_0xfdd4('0x1e')](_0x47ed1d);}};}function respondWithFilteredResult(_0x216c7e,_0x2eb174){return function(_0x2ccc88){if(_0x2ccc88){var _0x32b5f7=typeof _0x2eb174[_0xfdd4('0x1f')]===_0xfdd4('0x20')&&typeof _0x2eb174[_0xfdd4('0x21')]===_0xfdd4('0x20');var _0x52ce34=_0x2ccc88[_0xfdd4('0x22')];var _0x3e8eac=_0x32b5f7?0x0:_0x2eb174[_0xfdd4('0x1f')];var _0x36e611=_0x32b5f7?_0x2ccc88[_0xfdd4('0x22')]:_0x2eb174[_0xfdd4('0x1f')]+_0x2eb174[_0xfdd4('0x21')];var _0x34dfa8;if(_0x36e611>=_0x52ce34){_0x36e611=_0x52ce34;_0x34dfa8=0xc8;}else{_0x34dfa8=0xce;}_0x216c7e['status'](_0x34dfa8);return _0x216c7e[_0xfdd4('0x23')](_0xfdd4('0x24'),_0x3e8eac+'-'+_0x36e611+'/'+_0x52ce34)[_0xfdd4('0x1e')](_0x2ccc88);}return null;};}function patchUpdates(_0x16e81b){return function(_0xb7856d){try{jsonpatch[_0xfdd4('0x25')](_0xb7856d,_0x16e81b,!![]);}catch(_0x451767){return BPromise[_0xfdd4('0x26')](_0x451767);}return _0xb7856d['save']();};}function saveUpdates(_0x1e14da,_0x1112e8){return function(_0x4397a3){if(_0x4397a3){return _0x4397a3['update'](_0x1e14da)[_0xfdd4('0x27')](function(_0x39b712){return _0x39b712;});}return null;};}function removeEntity(_0xf9c346,_0x2f8268){return function(_0x1ade42){if(_0x1ade42){return _0x1ade42['destroy']()[_0xfdd4('0x27')](function(){var _0x2c88ad=_0x1ade42[_0xfdd4('0x28')]({'plain':!![]});var _0x31e053=_0xfdd4('0x29');return db[_0xfdd4('0x2a')][_0xfdd4('0x2b')]({'where':{'type':_0x31e053,'resourceId':_0x2c88ad['id']}})[_0xfdd4('0x27')](function(){return _0x1ade42;});})['then'](function(){_0xf9c346[_0xfdd4('0x1c')](0xcc)[_0xfdd4('0x1d')]();});}};}function handleEntityNotFound(_0x385a68,_0xef012e){return function(_0x2207ae){if(!_0x2207ae){_0x385a68['sendStatus'](0x194);}return _0x2207ae;};}function handleError(_0xd127b1,_0x3372d2){_0x3372d2=_0x3372d2||0x1f4;return function(_0xbf38b4){logger[_0xfdd4('0x2c')](_0xbf38b4[_0xfdd4('0x2d')]);if(_0xbf38b4['name']){delete _0xbf38b4[_0xfdd4('0x2e')];}_0xd127b1[_0xfdd4('0x1c')](_0x3372d2)[_0xfdd4('0x2f')](_0xbf38b4);};}exports['index']=function(_0x3fd07a,_0x502776){var _0x2a65c8={},_0x2b22f9={},_0x4aa4f2={'count':0x0,'rows':[]};var _0x50b748=_[_0xfdd4('0x30')](db[_0xfdd4('0x31')]['rawAttributes'],function(_0x557d7b){return{'name':_0x557d7b[_0xfdd4('0x32')],'type':_0x557d7b[_0xfdd4('0x33')][_0xfdd4('0x34')]};});_0x2b22f9[_0xfdd4('0x35')]=_[_0xfdd4('0x30')](_0x50b748,_0xfdd4('0x2e'));_0x2b22f9[_0xfdd4('0x36')]=_[_0xfdd4('0x37')](_0x3fd07a[_0xfdd4('0x36')]);_0x2b22f9[_0xfdd4('0x38')]=_[_0xfdd4('0x39')](_0x2b22f9[_0xfdd4('0x35')],_0x2b22f9[_0xfdd4('0x36')]);_0x2a65c8[_0xfdd4('0x3a')]=_[_0xfdd4('0x39')](_0x2b22f9[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x2a65c8[_0xfdd4('0x3a')]=_0x2a65c8[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x2a65c8[_0xfdd4('0x3a')]:_0x2b22f9[_0xfdd4('0x35')];if(!_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3d')]('nolimit')){_0x2a65c8[_0xfdd4('0x21')]=qs[_0xfdd4('0x21')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x2a65c8[_0xfdd4('0x1f')]=qs[_0xfdd4('0x1f')](_0x3fd07a['query'][_0xfdd4('0x1f')]);}_0x2a65c8['order']=qs[_0xfdd4('0x3e')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3e')]);_0x2a65c8[_0xfdd4('0x3f')]=qs['filters'](_[_0xfdd4('0x40')](_0x3fd07a[_0xfdd4('0x36')],_0x2b22f9[_0xfdd4('0x38')]),_0x50b748);if(_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x41')]){_0x2a65c8[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x2a65c8[_0xfdd4('0x3f')],{'$or':_[_0xfdd4('0x30')](_0x50b748,function(_0x83673d){if(_0x83673d['type']!==_0xfdd4('0x43')){var _0x2196f={};_0x2196f[_0x83673d[_0xfdd4('0x2e')]]={'$like':'%'+_0x3fd07a[_0xfdd4('0x36')]['filter']+'%'};return _0x2196f;}})});}_0x2a65c8=_[_0xfdd4('0x42')]({},_0x2a65c8,_0x3fd07a[_0xfdd4('0x44')]);var _0x30524f={'where':_0x2a65c8[_0xfdd4('0x3f')]};return db[_0xfdd4('0x31')]['count'](_0x30524f)[_0xfdd4('0x27')](function(_0x23af2a){_0x4aa4f2[_0xfdd4('0x22')]=_0x23af2a;if(_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x45')]){_0x2a65c8[_0xfdd4('0x46')]=[{'all':!![]}];}return db[_0xfdd4('0x31')]['findAll'](_0x2a65c8);})[_0xfdd4('0x27')](function(_0x586713){_0x4aa4f2[_0xfdd4('0x47')]=_0x586713;return _0x4aa4f2;})[_0xfdd4('0x27')](respondWithFilteredResult(_0x502776,_0x2a65c8))[_0xfdd4('0x48')](handleError(_0x502776,null));};exports[_0xfdd4('0x49')]=function(_0x5367aa,_0x419578){var _0x11e90a={'raw':![],'where':{'id':_0x5367aa[_0xfdd4('0x4a')]['id']}},_0x4d1dfe={};_0x4d1dfe[_0xfdd4('0x35')]=_['keys'](db[_0xfdd4('0x31')]['rawAttributes']);_0x4d1dfe['query']=_['keys'](_0x5367aa[_0xfdd4('0x36')]);_0x4d1dfe[_0xfdd4('0x38')]=_[_0xfdd4('0x39')](_0x4d1dfe['model'],_0x4d1dfe[_0xfdd4('0x36')]);_0x11e90a[_0xfdd4('0x3a')]=_['intersection'](_0x4d1dfe[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x5367aa[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x11e90a[_0xfdd4('0x3a')]=_0x11e90a[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x11e90a[_0xfdd4('0x3a')]:_0x4d1dfe[_0xfdd4('0x35')];if(_0x5367aa[_0xfdd4('0x36')][_0xfdd4('0x45')]){_0x11e90a[_0xfdd4('0x46')]=[{'all':!![]}];}_0x11e90a=_[_0xfdd4('0x42')]({},_0x11e90a,_0x5367aa[_0xfdd4('0x44')]);return db['VoicePrefix']['find'](_0x11e90a)[_0xfdd4('0x27')](handleEntityNotFound(_0x419578,null))[_0xfdd4('0x27')](respondWithResult(_0x419578,null))[_0xfdd4('0x48')](handleError(_0x419578,null));};exports[_0xfdd4('0x2b')]=function(_0x507bf5,_0x3c6828){return db[_0xfdd4('0x31')]['find']({'where':{'id':_0x507bf5['params']['id']}})['then'](handleEntityNotFound(_0x3c6828,null))['then'](removeEntity(_0x3c6828,null))['catch'](handleError(_0x3c6828,null));};exports[_0xfdd4('0x4b')]=function(_0x88e9ef,_0x3a4202){return db[_0xfdd4('0x31')][_0xfdd4('0x4b')]()[_0xfdd4('0x27')](respondWithResult(_0x3a4202,null))['catch'](handleError(_0x3a4202,null));};exports[_0xfdd4('0x4c')]=function(_0x1f521a,_0x1dd417){var _0x2355b5;return db['sequelize'][_0xfdd4('0x4d')](function(_0x8aa0ea){return db['VoicePrefix'][_0xfdd4('0x4c')](_0x1f521a[_0xfdd4('0x4e')],{'transaction':_0x8aa0ea})['then'](function(_0x5467d1){_0x2355b5=_0x5467d1[_0xfdd4('0x28')]({'plain':!![]});return db[_0xfdd4('0x4f')][_0xfdd4('0x50')]({'where':{'id':_0x2355b5[_0xfdd4('0x51')]},'raw':!![]})[_0xfdd4('0x27')](function(_0x1b9979){return createVoicePrefixExtensions(_0x2355b5,_0x1b9979,_0x8aa0ea);});});})[_0xfdd4('0x27')](function(){var _0x3de4fd=_0x1f521a['user'][_0xfdd4('0x28')]({'plain':!![]});if(!_0x3de4fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3de4fd['role']===_0xfdd4('0x52')){var _0x1d9a8d=_0x2355b5;return db['UserProfileSection']['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x3de4fd[_0xfdd4('0x53')]},'raw':!![]})[_0xfdd4('0x27')](function(_0x4dc113){if(_0x4dc113&&_0x4dc113[_0xfdd4('0x54')]===0x0){return db[_0xfdd4('0x2a')][_0xfdd4('0x4c')]({'name':_0x1d9a8d[_0xfdd4('0x2e')],'resourceId':_0x1d9a8d['id'],'type':_0x4dc113[_0xfdd4('0x2e')],'sectionId':_0x4dc113['id']},{})['then'](function(){return _0x2355b5;});}else{return _0x2355b5;}})['catch'](function(_0x483942){logger['error'](_0xfdd4('0x55'),_0x483942);throw _0x483942;});}return _0x2355b5;})[_0xfdd4('0x27')](respondWithResult(_0x1dd417,null))['catch'](handleError(_0x1dd417,null));};function Extension(_0x1eee3d,_0x2abe50,_0x4d4304,_0x45dcc8){this[_0xfdd4('0x56')]='from-sip';this[_0xfdd4('0x57')]=_0x1eee3d;this[_0xfdd4('0x58')]=_0x4d4304;this[_0xfdd4('0x33')]='system';this[_0xfdd4('0x59')]=_0xfdd4('0x5a');this[_0xfdd4('0x5b')]=_0x2abe50;this[_0xfdd4('0x5c')]=_0x45dcc8;}function createVoicePrefixExtensions(_0x5c7be,_0x562417,_0x2cc3e2){return new BPromise(function(_0x2ee4b6,_0x3be4d5){var _0x202124=new Extension(formatPrefixName(_0x5c7be[_0xfdd4('0x5d')]),0x1,_0xfdd4('0x5e'),_0xfdd4('0x5f'));_0x202124[_0xfdd4('0x60')]=_0x5c7be['id'];return db[_0xfdd4('0x4f')]['create'](_0x202124,{'transaction':_0x2cc3e2})[_0xfdd4('0x27')](function(_0x2799b2){var _0x4483e1=_0x2799b2[_0xfdd4('0x28')]({'plain':!![]});var _0x3096fa=_['map'](addVoicePrefixExtensions(_0x5c7be,_0x562417),function(_0x46e7eb){_0x46e7eb[_0xfdd4('0x51')]=_0x4483e1['id'];_0x46e7eb[_0xfdd4('0x60')]=_0x5c7be['id'];return _0x46e7eb;});return db[_0xfdd4('0x4f')][_0xfdd4('0x61')](_0x3096fa,{'transaction':_0x2cc3e2})[_0xfdd4('0x27')](function(_0x180ad9){if(!_0x180ad9){return _0x3be4d5(_0xfdd4('0x62'));}else{return _0x2ee4b6(_0x180ad9);}})[_0xfdd4('0x48')](function(_0x2a0dd8){return _0x3be4d5(_0x2a0dd8);});});;});};function addVoicePrefixExtensions(_0x2fff30,_0x2792c4){var _0x1205b8=[];var _0x527068=formatPrefixName(_0x2fff30[_0xfdd4('0x5d')]);_0x1205b8['push'](new Extension(_0x527068,0x2,_0xfdd4('0x63'),_0xfdd4('0x64')+_0x2fff30[_0xfdd4('0x2e')]));if(_0x2fff30[_0xfdd4('0x65')]){_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x3,_0xfdd4('0x63'),_0xfdd4('0x67')+_0x2fff30[_0xfdd4('0x65')]));}else{_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x3,_0xfdd4('0x5e'),_0xfdd4('0x68')));}_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x4,'goto',_0x2792c4['context']+','+'${EXTEN:'+(0x8+_0x2fff30[_0xfdd4('0x2e')][_0xfdd4('0x3c')])+'}'+','+0x1));return _0x1205b8;}function formatPrefixName(_0x4bb18b){var _0x3a367c='_';for(var _0x3f027b=0x0;_0x3f027b<_0x4bb18b[_0xfdd4('0x3c')];_0x3f027b++){if(_0x4bb18b[_0xfdd4('0x69')](_0x3f027b)=='-'){_0x3a367c+=_0x4bb18b[_0xfdd4('0x69')](_0x3f027b);}else{_0x3a367c+='['+_0x4bb18b['charAt'](_0x3f027b)+']';}}_0x3a367c+='.';return _0x3a367c;}exports[_0xfdd4('0x6a')]=function(_0x297432,_0x3958cd,_0x523085){var _0x366f1c=_0x297432['body'];_0x366f1c[_0xfdd4('0x5d')]=_0xfdd4('0x6b')+_0x366f1c[_0xfdd4('0x2e')]+'-';return db[_0xfdd4('0x6c')]['transaction'](function(_0x2351b6){return db[_0xfdd4('0x31')]['update'](_0x366f1c,{'where':{'id':_0x366f1c['id']},'transaction':_0x2351b6})[_0xfdd4('0x27')](function(){return db[_0xfdd4('0x4f')][_0xfdd4('0x2b')]({'where':{'VoicePrefixId':_0x366f1c['id']},'transaction':_0x2351b6})['then'](function(){return db[_0xfdd4('0x4f')][_0xfdd4('0x50')]({'where':{'id':_0x366f1c[_0xfdd4('0x51')]},'raw':!![]})['then'](function(_0x3f4337){return createVoicePrefixExtensions(_0x366f1c,_0x3f4337,_0x2351b6);});});});})[_0xfdd4('0x27')](function(){return db[_0xfdd4('0x31')][_0xfdd4('0x6d')](_0x366f1c['id']);})[_0xfdd4('0x27')](respondWithResult(_0x3958cd,null))[_0xfdd4('0x48')](handleError(_0x3958cd,null));};exports[_0xfdd4('0x6e')]=function(_0x539d3b,_0x147d54,_0x36b615){return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x539d3b[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x147d54,null))[_0xfdd4('0x27')](function(_0x4987d6){if(_0x4987d6){return _0x4987d6['addAgents'](_0x539d3b[_0xfdd4('0x4e')]['ids'],_['omit'](_0x539d3b[_0xfdd4('0x4e')],['ids','id'])||{})[_0xfdd4('0x6f')](function(_0x51711a){for(var _0x4576ce=0x0;_0x4576ce<_0x539d3b[_0xfdd4('0x4e')][_0xfdd4('0x70')][_0xfdd4('0x3c')];_0x4576ce+=0x1){socket[_0xfdd4('0x71')](_0xfdd4('0x72'),{'UserId':Number(_0x539d3b[_0xfdd4('0x4e')]['ids'][_0x4576ce]),'VoicePrefixId':Number(_0x539d3b['params']['id'])});}return _0x51711a;});}})[_0xfdd4('0x27')](respondWithResult(_0x147d54,null))['catch'](handleError(_0x147d54,null));};exports[_0xfdd4('0x73')]=function(_0x1a82ee,_0x3b205f,_0x1d57f8){return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x1a82ee[_0xfdd4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b205f,null))['then'](function(_0x37a342){if(_0x37a342){return _0x37a342[_0xfdd4('0x73')](_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')])[_0xfdd4('0x27')](function(){if(_[_0xfdd4('0x74')](_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')])){for(var _0xf78c69=0x0;_0xf78c69<_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')][_0xfdd4('0x3c')];_0xf78c69+=0x1){socket[_0xfdd4('0x71')]('userVoicePrefix:remove',{'UserId':Number(_0x1a82ee['query'][_0xfdd4('0x70')][_0xf78c69]),'VoicePrefixId':Number(_0x1a82ee[_0xfdd4('0x4a')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')]),'VoicePrefixId':Number(_0x1a82ee['params']['id'])});}});}})[_0xfdd4('0x27')](respondWithStatusCode(_0x3b205f,null))[_0xfdd4('0x48')](handleError(_0x3b205f,null));};exports[_0xfdd4('0x75')]=function(_0x11db43,_0x5ec62b,_0x25c078){var _0x5d356c={};var _0x3924c7={};var _0x2f65d7;var _0x4783b9;return db[_0xfdd4('0x31')][_0xfdd4('0x76')]({'where':{'id':_0x11db43[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x5ec62b,null))[_0xfdd4('0x27')](function(_0x575bc2){if(_0x575bc2){_0x2f65d7=_0x575bc2;_0x3924c7['model']=_[_0xfdd4('0x37')](db['User'][_0xfdd4('0x77')]);_0x3924c7[_0xfdd4('0x36')]=_[_0xfdd4('0x37')](_0x11db43[_0xfdd4('0x36')]);_0x3924c7[_0xfdd4('0x38')]=_['intersection'](_0x3924c7['model'],_0x3924c7[_0xfdd4('0x36')]);_0x5d356c['attributes']=_[_0xfdd4('0x39')](_0x3924c7['model'],qs[_0xfdd4('0x3b')](_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x5d356c[_0xfdd4('0x3a')]=_0x5d356c[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x5d356c[_0xfdd4('0x3a')]:_0x3924c7[_0xfdd4('0x35')];_0x5d356c[_0xfdd4('0x78')]=qs[_0xfdd4('0x3e')](_0x11db43[_0xfdd4('0x36')]['sort']);_0x5d356c[_0xfdd4('0x3f')]=qs[_0xfdd4('0x38')](_[_0xfdd4('0x40')](_0x11db43[_0xfdd4('0x36')],_0x3924c7[_0xfdd4('0x38')]));if(_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x41')]){_0x5d356c[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x5d356c['where'],{'$or':_['map'](_0x5d356c[_0xfdd4('0x3a')],function(_0x244d6d){var _0x30bd32={};_0x30bd32[_0x244d6d]={'$like':'%'+_0x11db43['query'][_0xfdd4('0x41')]+'%'};return _0x30bd32;})});}_0x5d356c=_[_0xfdd4('0x42')]({},_0x5d356c,_0x11db43[_0xfdd4('0x44')]);return _0x2f65d7[_0xfdd4('0x75')](_0x5d356c);}})['then'](function(_0x5868e6){if(_0x5868e6){_0x4783b9=_0x5868e6[_0xfdd4('0x3c')];if(!_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x3d')]('nolimit')){_0x5d356c[_0xfdd4('0x21')]=qs[_0xfdd4('0x21')](_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x5d356c[_0xfdd4('0x1f')]=qs[_0xfdd4('0x1f')](_0x11db43['query']['offset']);}return _0x2f65d7[_0xfdd4('0x75')](_0x5d356c);}})[_0xfdd4('0x27')](function(_0x6a1410){if(_0x6a1410){return _0x6a1410?{'count':_0x4783b9,'rows':_0x6a1410}:null;}})[_0xfdd4('0x27')](respondWithResult(_0x5ec62b,null))[_0xfdd4('0x48')](handleError(_0x5ec62b,null));};exports[_0xfdd4('0x79')]=function(_0x46edc9,_0x2a4366,_0x5d1a3f){var _0x218d83={};var _0x547c4c={};var _0x464eb0;var _0x1871d6;return db['VoicePrefix'][_0xfdd4('0x76')]({'where':{'id':_0x46edc9[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x2a4366,null))[_0xfdd4('0x27')](function(_0x3cd7ae){if(_0x3cd7ae){_0x464eb0=_0x3cd7ae;_0x547c4c[_0xfdd4('0x35')]=_[_0xfdd4('0x37')](db[_0xfdd4('0x7a')][_0xfdd4('0x77')]);_0x547c4c['query']=_[_0xfdd4('0x37')](_0x46edc9['query']);_0x547c4c[_0xfdd4('0x38')]=_['intersection'](_0x547c4c['model'],_0x547c4c[_0xfdd4('0x36')]);_0x218d83[_0xfdd4('0x3a')]=_[_0xfdd4('0x39')](_0x547c4c[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x46edc9['query'][_0xfdd4('0x3b')]));_0x218d83[_0xfdd4('0x3a')]=_0x218d83[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x218d83[_0xfdd4('0x3a')]:_0x547c4c[_0xfdd4('0x35')];_0x218d83['order']=qs[_0xfdd4('0x3e')](_0x46edc9[_0xfdd4('0x36')]['sort']);_0x218d83['where']=qs[_0xfdd4('0x38')](_[_0xfdd4('0x40')](_0x46edc9[_0xfdd4('0x36')],_0x547c4c['filters']));if(_0x46edc9['query'][_0xfdd4('0x41')]){_0x218d83[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x218d83['where'],{'$or':_['map'](_0x218d83[_0xfdd4('0x3a')],function(_0xd6eb47){var _0x1927ed={};_0x1927ed[_0xd6eb47]={'$like':'%'+_0x46edc9['query'][_0xfdd4('0x41')]+'%'};return _0x1927ed;})});}_0x218d83=_['merge']({},_0x218d83,_0x46edc9[_0xfdd4('0x44')]);return _0x464eb0[_0xfdd4('0x79')](_0x218d83);}})[_0xfdd4('0x27')](function(_0x4e1dbc){if(_0x4e1dbc){_0x1871d6=_0x4e1dbc[_0xfdd4('0x3c')];if(!_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x3d')](_0xfdd4('0x7b'))){_0x218d83[_0xfdd4('0x21')]=qs['limit'](_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x218d83[_0xfdd4('0x1f')]=qs['offset'](_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x1f')]);}return _0x464eb0[_0xfdd4('0x79')](_0x218d83);}})[_0xfdd4('0x27')](function(_0x56e5d3){if(_0x56e5d3){return _0x56e5d3?{'count':_0x1871d6,'rows':_0x56e5d3}:null;}})[_0xfdd4('0x27')](respondWithResult(_0x2a4366,null))['catch'](handleError(_0x2a4366,null));};exports['addTeams']=function(_0x528004,_0x206a59,_0x545475){var _0x5e5362=_0x528004['body'][_0xfdd4('0x70')];var _0x728e25;return db[_0xfdd4('0x7a')][_0xfdd4('0x7c')]({'where':{'id':_0x5e5362},'attributes':['id'],'include':[{'model':db[_0xfdd4('0x7d')],'as':_0xfdd4('0x7e'),'attributes':['id',_0xfdd4('0x2e'),_0xfdd4('0x7f'),_0xfdd4('0x80'),_0xfdd4('0x81')],'raw':!![]}]})[_0xfdd4('0x27')](function(_0x2911ca){if(_0x2911ca){_0x728e25=_0x2911ca;var _0x31303f=_[_0xfdd4('0x82')](_0x2911ca,function(_0x46b927){var _0x450c67=_0x46b927[_0xfdd4('0x28')]({'plain':!![]});return _0x450c67[_0xfdd4('0x7e')];});return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x528004[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](function(_0x189baf){return db[_0xfdd4('0x6c')][_0xfdd4('0x4d')](function(_0x22f93b){return _0x189baf['addTeams'](_0x5e5362,{'transaction':_0x22f93b})[_0xfdd4('0x27')](function(){return BPromise[_0xfdd4('0x83')](_0x728e25,function(_0xaef5e2){return db[_0xfdd4('0x84')][_0xfdd4('0x85')]({'TeamId':_0xaef5e2['id'],'VoicePrefixId':_0x528004['params']['id']},{'transaction':_0x22f93b});});})[_0xfdd4('0x27')](function(){return BPromise[_0xfdd4('0x83')](_0x31303f,function(_0x19b679){return db[_0xfdd4('0x86')][_0xfdd4('0x87')]({'where':{'UserId':_0x19b679['id'],'VoicePrefixId':_0x528004[_0xfdd4('0x4a')]['id']},'transaction':_0x22f93b});});})['then'](function(){_0x31303f[_0xfdd4('0x88')](function(_0x1a9e62){socket[_0xfdd4('0x71')](_0xfdd4('0x72'),{'UserId':_0x1a9e62['id'],'VoicePrefixId':_0x189baf['id']});});});});});}})[_0xfdd4('0x27')](respondWithStatusCode(_0x206a59,null))[_0xfdd4('0x48')](handleError(_0x206a59,null));};exports['removeTeams']=function(_0x2a6a0d,_0x3d82d1,_0x17d272){return db['Team'][_0xfdd4('0x7c')]({'where':{'id':_0x2a6a0d[_0xfdd4('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfdd4('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xfdd4('0x27')](handleEntityNotFound(_0x3d82d1,null))[_0xfdd4('0x27')](function(_0xd07645){var _0x5a3249=_[_0xfdd4('0x30')](_0xd07645,'id');var _0x5b22b1=[];var _0xc9955e=[];var _0x42204a=squel[_0xfdd4('0x89')]();_0x42204a[_0xfdd4('0x8a')](_0xfdd4('0x8b'))[_0xfdd4('0x8c')](_0xfdd4('0x8d'),'tq')[_0xfdd4('0x8e')](_0xfdd4('0x8f'),'ut',_0xfdd4('0x90'))[_0xfdd4('0x3f')]('VoicePrefixId\x20=\x20?',_0x2a6a0d[_0xfdd4('0x4a')]['id']);for(var _0x42a3dc=0x0;_0x42a3dc<_0xd07645[_0xfdd4('0x3c')];_0x42a3dc+=0x1){let _0x26316c=_0xd07645[_0x42a3dc];for(var _0x1e7bbb=0x0;_0x1e7bbb<_0x26316c[_0xfdd4('0x7e')]['length'];_0x1e7bbb+=0x1){let _0xfd0c1=_0x26316c[_0xfdd4('0x7e')][_0x1e7bbb];var _0x2ae92=_0x42204a[_0xfdd4('0x91')]();_0x2ae92['where'](_0xfdd4('0x92'),_0xfd0c1['id']);_0xc9955e[_0xfdd4('0x66')](db['sequelize'][_0xfdd4('0x36')](_0x2ae92[_0xfdd4('0x93')](),{'type':db[_0xfdd4('0x6c')][_0xfdd4('0x94')][_0xfdd4('0x95')]})[_0xfdd4('0x27')](function(_0x191ab6){if(_0x191ab6[_0xfdd4('0x3c')]===0x1){return _0xfd0c1['id'];}else{var _0x1d460f=_[_0xfdd4('0x96')](_[_0xfdd4('0x30')](_0x191ab6,_0xfdd4('0x97')),function(_0x25c508){return _[_0xfdd4('0x98')](_0x5a3249,_0x25c508);});if(_0x1d460f){return _0xfd0c1['id'];}}}));}}return BPromise['all'](_0xc9955e)[_0xfdd4('0x27')](function(_0x349fc6){_0x5b22b1=_(_0x5b22b1)[_0xfdd4('0x99')](_0x349fc6)[_0xfdd4('0x9a')]()['value']();return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x2a6a0d['params']['id']}})[_0xfdd4('0x27')](function(_0x401681){return db[_0xfdd4('0x6c')][_0xfdd4('0x4d')](function(_0x5a7c85){return _0x401681[_0xfdd4('0x9b')](_0x2a6a0d['query'][_0xfdd4('0x70')],{'transaction':_0x5a7c85})[_0xfdd4('0x27')](function(){if(!_['isEmpty'](_0x5b22b1)){return _0x401681[_0xfdd4('0x73')](_0x5b22b1,{'transaction':_0x5a7c85});}})['then'](function(){_0x5b22b1['forEach'](function(_0x10a396){socket[_0xfdd4('0x71')](_0xfdd4('0x9c'),{'UserId':_0x10a396,'VoicePrefixId':_0x401681['id']});});});});});});})[_0xfdd4('0x27')](respondWithStatusCode(_0x3d82d1,null))['catch'](handleError(_0x3d82d1,null));};
\ No newline at end of file
+var _0x02ce=['apply','reject','save','update','destroy','then','get','VoicePrefixes','UserProfileResource','sendStatus','error','name','send','index','map','VoicePrefix','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','sequelize','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','create','context','from-sip','exten','app','type','description','Voice\x20Prefix\x20Extension','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','callerIdAll','Set','PREFIX-CALLERIDALL=','${EXTEN:','charAt','system-','transaction','VoiceExtension','findById','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','getAgents','User','pick','findOne','Team','getTeams','addTeams','online','voicePause','flatMap','Agents','each','TeamVoicePrefix','upsert','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','union','compact','value','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','status','end','json','undefined','limit','count','offset','set'];(function(_0x1bda65,_0x894e40){var _0x12b6dc=function(_0x37e885){while(--_0x37e885){_0x1bda65['push'](_0x1bda65['shift']());}};_0x12b6dc(++_0x894e40);}(_0x02ce,0x1ac));var _0xe02c=function(_0x4828a3,_0x4e1987){_0x4828a3=_0x4828a3-0x0;var _0x2f4540=_0x02ce[_0x4828a3];return _0x2f4540;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];config[_0xe02c('0x1c')]=_[_0xe02c('0x1d')](config['redis'],{'host':_0xe02c('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe02c('0x1f'))['register'](socket);function respondWithStatusCode(_0x221910,_0x59614c){_0x59614c=_0x59614c||0xcc;return function(_0x3a5a2c){if(_0x3a5a2c){return _0x221910['sendStatus'](_0x59614c);}return _0x221910[_0xe02c('0x20')](_0x59614c)[_0xe02c('0x21')]();};}function respondWithResult(_0x59f2f6,_0x10a2a6){_0x10a2a6=_0x10a2a6||0xc8;return function(_0x226a80){if(_0x226a80){return _0x59f2f6['status'](_0x10a2a6)[_0xe02c('0x22')](_0x226a80);}};}function respondWithFilteredResult(_0x20f492,_0x5a4583){return function(_0x52917f){if(_0x52917f){var _0x3e37bf=typeof _0x5a4583['offset']===_0xe02c('0x23')&&typeof _0x5a4583[_0xe02c('0x24')]===_0xe02c('0x23');var _0x36fed0=_0x52917f[_0xe02c('0x25')];var _0x54c5b0=_0x3e37bf?0x0:_0x5a4583[_0xe02c('0x26')];var _0x59026f=_0x3e37bf?_0x52917f['count']:_0x5a4583[_0xe02c('0x26')]+_0x5a4583[_0xe02c('0x24')];var _0x480b9a;if(_0x59026f>=_0x36fed0){_0x59026f=_0x36fed0;_0x480b9a=0xc8;}else{_0x480b9a=0xce;}_0x20f492[_0xe02c('0x20')](_0x480b9a);return _0x20f492[_0xe02c('0x27')]('Content-Range',_0x54c5b0+'-'+_0x59026f+'/'+_0x36fed0)[_0xe02c('0x22')](_0x52917f);}return null;};}function patchUpdates(_0x45fd82){return function(_0x39b00c){try{jsonpatch[_0xe02c('0x28')](_0x39b00c,_0x45fd82,!![]);}catch(_0x2d44c8){return BPromise[_0xe02c('0x29')](_0x2d44c8);}return _0x39b00c[_0xe02c('0x2a')]();};}function saveUpdates(_0xf41d4c,_0xeae877){return function(_0x18b538){if(_0x18b538){return _0x18b538[_0xe02c('0x2b')](_0xf41d4c)['then'](function(_0xefd882){return _0xefd882;});}return null;};}function removeEntity(_0x4411d8,_0x3592ca){return function(_0x14ffba){if(_0x14ffba){return _0x14ffba[_0xe02c('0x2c')]()[_0xe02c('0x2d')](function(){var _0x43dc78=_0x14ffba[_0xe02c('0x2e')]({'plain':!![]});var _0x55ef2a=_0xe02c('0x2f');return db[_0xe02c('0x30')][_0xe02c('0x2c')]({'where':{'type':_0x55ef2a,'resourceId':_0x43dc78['id']}})['then'](function(){return _0x14ffba;});})[_0xe02c('0x2d')](function(){_0x4411d8[_0xe02c('0x20')](0xcc)[_0xe02c('0x21')]();});}};}function handleEntityNotFound(_0x287f7e,_0x1e7eab){return function(_0x35a309){if(!_0x35a309){_0x287f7e[_0xe02c('0x31')](0x194);}return _0x35a309;};}function handleError(_0x1b8f21,_0x9ee479){_0x9ee479=_0x9ee479||0x1f4;return function(_0x288004){logger[_0xe02c('0x32')](_0x288004['stack']);if(_0x288004[_0xe02c('0x33')]){delete _0x288004[_0xe02c('0x33')];}_0x1b8f21[_0xe02c('0x20')](_0x9ee479)[_0xe02c('0x34')](_0x288004);};}exports[_0xe02c('0x35')]=function(_0x14d27a,_0x58bf16){var _0x436bcc={},_0x1e605c={},_0x4fc4fd={'count':0x0,'rows':[]};var _0x1ce34c=_[_0xe02c('0x36')](db[_0xe02c('0x37')][_0xe02c('0x38')],function(_0x2b5ebe){return{'name':_0x2b5ebe['fieldName'],'type':_0x2b5ebe['type'][_0xe02c('0x39')]};});_0x1e605c[_0xe02c('0x3a')]=_['map'](_0x1ce34c,_0xe02c('0x33'));_0x1e605c['query']=_[_0xe02c('0x3b')](_0x14d27a[_0xe02c('0x3c')]);_0x1e605c[_0xe02c('0x3d')]=_[_0xe02c('0x3e')](_0x1e605c[_0xe02c('0x3a')],_0x1e605c['query']);_0x436bcc[_0xe02c('0x3f')]=_['intersection'](_0x1e605c[_0xe02c('0x3a')],qs[_0xe02c('0x40')](_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x40')]));_0x436bcc[_0xe02c('0x3f')]=_0x436bcc[_0xe02c('0x3f')]['length']?_0x436bcc[_0xe02c('0x3f')]:_0x1e605c[_0xe02c('0x3a')];if(!_0x14d27a['query'][_0xe02c('0x41')](_0xe02c('0x42'))){_0x436bcc['limit']=qs[_0xe02c('0x24')](_0x14d27a['query'][_0xe02c('0x24')]);_0x436bcc[_0xe02c('0x26')]=qs['offset'](_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x26')]);}_0x436bcc[_0xe02c('0x43')]=qs[_0xe02c('0x44')](_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x44')]);_0x436bcc['where']=qs[_0xe02c('0x3d')](_['pick'](_0x14d27a['query'],_0x1e605c[_0xe02c('0x3d')]),_0x1ce34c);if(_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x45')]){_0x436bcc[_0xe02c('0x46')]=_['merge'](_0x436bcc[_0xe02c('0x46')],{'$or':_[_0xe02c('0x36')](_0x1ce34c,function(_0x163573){if(_0x163573['type']!=='VIRTUAL'){var _0x33c6da={};_0x33c6da[_0x163573[_0xe02c('0x33')]]={'$like':'%'+_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x45')]+'%'};return _0x33c6da;}})});}_0x436bcc=_[_0xe02c('0x47')]({},_0x436bcc,_0x14d27a[_0xe02c('0x48')]);var _0x25f8ae={'where':_0x436bcc[_0xe02c('0x46')]};return db[_0xe02c('0x37')]['count'](_0x25f8ae)[_0xe02c('0x2d')](function(_0x5ef4a1){_0x4fc4fd['count']=_0x5ef4a1;if(_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x49')]){_0x436bcc[_0xe02c('0x4a')]=[{'all':!![]}];}return db[_0xe02c('0x37')][_0xe02c('0x4b')](_0x436bcc);})[_0xe02c('0x2d')](function(_0x165f4a){_0x4fc4fd[_0xe02c('0x4c')]=_0x165f4a;return _0x4fc4fd;})['then'](respondWithFilteredResult(_0x58bf16,_0x436bcc))['catch'](handleError(_0x58bf16,null));};exports[_0xe02c('0x4d')]=function(_0xf89a57,_0x304ece){var _0x52f239={'raw':![],'where':{'id':_0xf89a57[_0xe02c('0x4e')]['id']}},_0x1cf443={};_0x1cf443[_0xe02c('0x3a')]=_[_0xe02c('0x3b')](db[_0xe02c('0x37')][_0xe02c('0x38')]);_0x1cf443[_0xe02c('0x3c')]=_[_0xe02c('0x3b')](_0xf89a57[_0xe02c('0x3c')]);_0x1cf443[_0xe02c('0x3d')]=_['intersection'](_0x1cf443[_0xe02c('0x3a')],_0x1cf443[_0xe02c('0x3c')]);_0x52f239[_0xe02c('0x3f')]=_[_0xe02c('0x3e')](_0x1cf443[_0xe02c('0x3a')],qs[_0xe02c('0x40')](_0xf89a57[_0xe02c('0x3c')][_0xe02c('0x40')]));_0x52f239[_0xe02c('0x3f')]=_0x52f239[_0xe02c('0x3f')][_0xe02c('0x4f')]?_0x52f239[_0xe02c('0x3f')]:_0x1cf443[_0xe02c('0x3a')];if(_0xf89a57['query'][_0xe02c('0x49')]){_0x52f239['include']=[{'all':!![]}];}_0x52f239=_[_0xe02c('0x47')]({},_0x52f239,_0xf89a57[_0xe02c('0x48')]);return db[_0xe02c('0x37')][_0xe02c('0x50')](_0x52f239)[_0xe02c('0x2d')](handleEntityNotFound(_0x304ece,null))[_0xe02c('0x2d')](respondWithResult(_0x304ece,null))[_0xe02c('0x51')](handleError(_0x304ece,null));};exports[_0xe02c('0x2c')]=function(_0xc6ea7b,_0x385497){return db['VoicePrefix'][_0xe02c('0x50')]({'where':{'id':_0xc6ea7b[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x385497,null))['then'](removeEntity(_0x385497,null))[_0xe02c('0x51')](handleError(_0x385497,null));};exports['describe']=function(_0x21a126,_0x56b9e2){return db['VoicePrefix']['describe']()['then'](respondWithResult(_0x56b9e2,null))['catch'](handleError(_0x56b9e2,null));};exports['create']=function(_0x107f3f,_0x3ac0a5){var _0x1510aa;return db[_0xe02c('0x52')]['transaction'](function(_0x274beb){return db[_0xe02c('0x37')]['create'](_0x107f3f[_0xe02c('0x53')],{'transaction':_0x274beb})[_0xe02c('0x2d')](function(_0x221e5e){_0x1510aa=_0x221e5e['get']({'plain':!![]});return db['VoiceExtension'][_0xe02c('0x50')]({'where':{'id':_0x1510aa[_0xe02c('0x54')]},'raw':!![]})[_0xe02c('0x2d')](function(_0x5b2d2b){return createVoicePrefixExtensions(_0x1510aa,_0x5b2d2b,_0x274beb);});});})[_0xe02c('0x2d')](function(){var _0x53765c=_0x107f3f['user'][_0xe02c('0x2e')]({'plain':!![]});if(!_0x53765c)throw new Error(_0xe02c('0x55'));if(_0x53765c['role']===_0xe02c('0x56')){var _0x849eea=_0x1510aa;return db[_0xe02c('0x57')]['find']({'where':{'name':_0xe02c('0x2f'),'userProfileId':_0x53765c[_0xe02c('0x58')]},'raw':!![]})['then'](function(_0x3788e8){if(_0x3788e8&&_0x3788e8[_0xe02c('0x59')]===0x0){return db[_0xe02c('0x30')][_0xe02c('0x5a')]({'name':_0x849eea[_0xe02c('0x33')],'resourceId':_0x849eea['id'],'type':_0x3788e8[_0xe02c('0x33')],'sectionId':_0x3788e8['id']},{})[_0xe02c('0x2d')](function(){return _0x1510aa;});}else{return _0x1510aa;}})[_0xe02c('0x51')](function(_0xf7e836){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf7e836);throw _0xf7e836;});}return _0x1510aa;})['then'](respondWithResult(_0x3ac0a5,null))[_0xe02c('0x51')](handleError(_0x3ac0a5,null));};function Extension(_0x299770,_0x42f2fd,_0x496eb1,_0x4eb35d){this[_0xe02c('0x5b')]=_0xe02c('0x5c');this[_0xe02c('0x5d')]=_0x299770;this[_0xe02c('0x5e')]=_0x496eb1;this[_0xe02c('0x5f')]='system';this[_0xe02c('0x60')]=_0xe02c('0x61');this['priority']=_0x42f2fd;this['appdata']=_0x4eb35d;}function createVoicePrefixExtensions(_0x879d99,_0x566204,_0x4da197){return new BPromise(function(_0x480d49,_0x3b19c9){var _0x28d7a2=new Extension(formatPrefixName(_0x879d99[_0xe02c('0x62')]),0x1,_0xe02c('0x63'),_0xe02c('0x64'));_0x28d7a2[_0xe02c('0x65')]=_0x879d99['id'];return db['VoiceExtension'][_0xe02c('0x5a')](_0x28d7a2,{'transaction':_0x4da197})['then'](function(_0x4f3c9a){var _0x185dc2=_0x4f3c9a[_0xe02c('0x2e')]({'plain':!![]});var _0x44ba68=_[_0xe02c('0x36')](addVoicePrefixExtensions(_0x879d99,_0x566204),function(_0x5b6979){_0x5b6979[_0xe02c('0x54')]=_0x185dc2['id'];_0x5b6979[_0xe02c('0x65')]=_0x879d99['id'];return _0x5b6979;});return db['VoiceExtension'][_0xe02c('0x66')](_0x44ba68,{'transaction':_0x4da197})[_0xe02c('0x2d')](function(_0x4cc74d){if(!_0x4cc74d){return _0x3b19c9(_0xe02c('0x67'));}else{return _0x480d49(_0x4cc74d);}})[_0xe02c('0x51')](function(_0x44f28f){return _0x3b19c9(_0x44f28f);});});;});};function addVoicePrefixExtensions(_0x4053e6,_0x323f3b){var _0x3a62a2=[];var _0x31b281=formatPrefixName(_0x4053e6['prefix']);_0x3a62a2[_0xe02c('0x68')](new Extension(_0x31b281,0x2,'Set','CDR(prefix)='+_0x4053e6['name']));if(_0x4053e6[_0xe02c('0x69')]){_0x3a62a2[_0xe02c('0x68')](new Extension(_0x31b281,0x3,_0xe02c('0x6a'),_0xe02c('0x6b')+_0x4053e6['callerIdAll']));}else{_0x3a62a2[_0xe02c('0x68')](new Extension(_0x31b281,0x3,_0xe02c('0x63'),'No\x20callerid\x20available'));}_0x3a62a2['push'](new Extension(_0x31b281,0x4,'goto',_0x323f3b[_0xe02c('0x5b')]+','+_0xe02c('0x6c')+(0x8+_0x4053e6['name']['length'])+'}'+','+0x1));return _0x3a62a2;}function formatPrefixName(_0x38789c){var _0x30ad9f='_';for(var _0x120ef1=0x0;_0x120ef1<_0x38789c[_0xe02c('0x4f')];_0x120ef1++){if(_0x38789c[_0xe02c('0x6d')](_0x120ef1)=='-'){_0x30ad9f+=_0x38789c['charAt'](_0x120ef1);}else{_0x30ad9f+='['+_0x38789c[_0xe02c('0x6d')](_0x120ef1)+']';}}_0x30ad9f+='.';return _0x30ad9f;}exports[_0xe02c('0x2b')]=function(_0x3f277b,_0x2776c0,_0x11c506){var _0x119119=_0x3f277b['body'];_0x119119[_0xe02c('0x62')]=_0xe02c('0x6e')+_0x119119['name']+'-';return db[_0xe02c('0x52')][_0xe02c('0x6f')](function(_0x123ca9){return db[_0xe02c('0x37')]['update'](_0x119119,{'where':{'id':_0x119119['id']},'transaction':_0x123ca9})[_0xe02c('0x2d')](function(){return db[_0xe02c('0x70')]['destroy']({'where':{'VoicePrefixId':_0x119119['id']},'transaction':_0x123ca9})['then'](function(){return db['VoiceExtension'][_0xe02c('0x50')]({'where':{'id':_0x119119[_0xe02c('0x54')]},'raw':!![]})[_0xe02c('0x2d')](function(_0x34e692){return createVoicePrefixExtensions(_0x119119,_0x34e692,_0x123ca9);});});});})[_0xe02c('0x2d')](function(){return db['VoicePrefix'][_0xe02c('0x71')](_0x119119['id']);})[_0xe02c('0x2d')](respondWithResult(_0x2776c0,null))[_0xe02c('0x51')](handleError(_0x2776c0,null));};exports['addAgents']=function(_0x4a7783,_0x4c3c91,_0x3cd802){return db[_0xe02c('0x37')][_0xe02c('0x50')]({'where':{'id':_0x4a7783[_0xe02c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4c3c91,null))[_0xe02c('0x2d')](function(_0x48f524){if(_0x48f524){return _0x48f524['addAgents'](_0x4a7783[_0xe02c('0x53')][_0xe02c('0x72')],_[_0xe02c('0x73')](_0x4a7783[_0xe02c('0x53')],[_0xe02c('0x72'),'id'])||{})[_0xe02c('0x74')](function(_0x748217){for(var _0x12aaea=0x0;_0x12aaea<_0x4a7783['body'][_0xe02c('0x72')][_0xe02c('0x4f')];_0x12aaea+=0x1){socket[_0xe02c('0x75')](_0xe02c('0x76'),{'UserId':Number(_0x4a7783[_0xe02c('0x53')][_0xe02c('0x72')][_0x12aaea]),'VoicePrefixId':Number(_0x4a7783[_0xe02c('0x4e')]['id'])});}return _0x748217;});}})[_0xe02c('0x2d')](respondWithResult(_0x4c3c91,null))[_0xe02c('0x51')](handleError(_0x4c3c91,null));};exports[_0xe02c('0x77')]=function(_0x5e6df5,_0x58acfd,_0x120dd7){return db[_0xe02c('0x37')][_0xe02c('0x50')]({'where':{'id':_0x5e6df5[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x58acfd,null))['then'](function(_0x405b16){if(_0x405b16){return _0x405b16[_0xe02c('0x77')](_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')])[_0xe02c('0x2d')](function(){if(_[_0xe02c('0x78')](_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')])){for(var _0x1d594c=0x0;_0x1d594c<_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')][_0xe02c('0x4f')];_0x1d594c+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')][_0x1d594c]),'VoicePrefixId':Number(_0x5e6df5['params']['id'])});}}else{socket[_0xe02c('0x75')]('userVoicePrefix:remove',{'UserId':Number(_0x5e6df5[_0xe02c('0x3c')]['ids']),'VoicePrefixId':Number(_0x5e6df5[_0xe02c('0x4e')]['id'])});}});}})[_0xe02c('0x2d')](respondWithStatusCode(_0x58acfd,null))[_0xe02c('0x51')](handleError(_0x58acfd,null));};exports[_0xe02c('0x79')]=function(_0x28755a,_0x3c44d3,_0x119439){var _0x10d067={};var _0x3d3954={};var _0xd0d895;var _0x567478;return db['VoicePrefix']['findOne']({'where':{'id':_0x28755a[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x3c44d3,null))[_0xe02c('0x2d')](function(_0x1133ce){if(_0x1133ce){_0xd0d895=_0x1133ce;_0x3d3954[_0xe02c('0x3a')]=_[_0xe02c('0x3b')](db[_0xe02c('0x7a')][_0xe02c('0x38')]);_0x3d3954[_0xe02c('0x3c')]=_[_0xe02c('0x3b')](_0x28755a[_0xe02c('0x3c')]);_0x3d3954[_0xe02c('0x3d')]=_[_0xe02c('0x3e')](_0x3d3954['model'],_0x3d3954['query']);_0x10d067[_0xe02c('0x3f')]=_[_0xe02c('0x3e')](_0x3d3954[_0xe02c('0x3a')],qs['fields'](_0x28755a[_0xe02c('0x3c')][_0xe02c('0x40')]));_0x10d067[_0xe02c('0x3f')]=_0x10d067[_0xe02c('0x3f')][_0xe02c('0x4f')]?_0x10d067['attributes']:_0x3d3954[_0xe02c('0x3a')];_0x10d067[_0xe02c('0x43')]=qs[_0xe02c('0x44')](_0x28755a['query'][_0xe02c('0x44')]);_0x10d067[_0xe02c('0x46')]=qs[_0xe02c('0x3d')](_[_0xe02c('0x7b')](_0x28755a[_0xe02c('0x3c')],_0x3d3954['filters']));if(_0x28755a[_0xe02c('0x3c')][_0xe02c('0x45')]){_0x10d067[_0xe02c('0x46')]=_['merge'](_0x10d067[_0xe02c('0x46')],{'$or':_[_0xe02c('0x36')](_0x10d067[_0xe02c('0x3f')],function(_0x3a5ec8){var _0x45e463={};_0x45e463[_0x3a5ec8]={'$like':'%'+_0x28755a['query'][_0xe02c('0x45')]+'%'};return _0x45e463;})});}_0x10d067=_[_0xe02c('0x47')]({},_0x10d067,_0x28755a['options']);return _0xd0d895[_0xe02c('0x79')](_0x10d067);}})['then'](function(_0x52fcd6){if(_0x52fcd6){_0x567478=_0x52fcd6['length'];if(!_0x28755a[_0xe02c('0x3c')][_0xe02c('0x41')](_0xe02c('0x42'))){_0x10d067[_0xe02c('0x24')]=qs[_0xe02c('0x24')](_0x28755a[_0xe02c('0x3c')][_0xe02c('0x24')]);_0x10d067[_0xe02c('0x26')]=qs[_0xe02c('0x26')](_0x28755a[_0xe02c('0x3c')][_0xe02c('0x26')]);}return _0xd0d895[_0xe02c('0x79')](_0x10d067);}})[_0xe02c('0x2d')](function(_0xfe0b1c){if(_0xfe0b1c){return _0xfe0b1c?{'count':_0x567478,'rows':_0xfe0b1c}:null;}})[_0xe02c('0x2d')](respondWithResult(_0x3c44d3,null))[_0xe02c('0x51')](handleError(_0x3c44d3,null));};exports['getTeams']=function(_0x283de9,_0x4cfbc0,_0x3650cb){var _0xdc8df0={};var _0x4564f1={};var _0x2c6d29;var _0x5b75ed;return db[_0xe02c('0x37')][_0xe02c('0x7c')]({'where':{'id':_0x283de9[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x4cfbc0,null))[_0xe02c('0x2d')](function(_0xced62f){if(_0xced62f){_0x2c6d29=_0xced62f;_0x4564f1[_0xe02c('0x3a')]=_['keys'](db[_0xe02c('0x7d')][_0xe02c('0x38')]);_0x4564f1['query']=_[_0xe02c('0x3b')](_0x283de9['query']);_0x4564f1['filters']=_[_0xe02c('0x3e')](_0x4564f1[_0xe02c('0x3a')],_0x4564f1[_0xe02c('0x3c')]);_0xdc8df0[_0xe02c('0x3f')]=_['intersection'](_0x4564f1['model'],qs[_0xe02c('0x40')](_0x283de9[_0xe02c('0x3c')]['fields']));_0xdc8df0[_0xe02c('0x3f')]=_0xdc8df0[_0xe02c('0x3f')][_0xe02c('0x4f')]?_0xdc8df0[_0xe02c('0x3f')]:_0x4564f1[_0xe02c('0x3a')];_0xdc8df0[_0xe02c('0x43')]=qs['sort'](_0x283de9[_0xe02c('0x3c')][_0xe02c('0x44')]);_0xdc8df0[_0xe02c('0x46')]=qs[_0xe02c('0x3d')](_[_0xe02c('0x7b')](_0x283de9[_0xe02c('0x3c')],_0x4564f1[_0xe02c('0x3d')]));if(_0x283de9[_0xe02c('0x3c')][_0xe02c('0x45')]){_0xdc8df0[_0xe02c('0x46')]=_[_0xe02c('0x47')](_0xdc8df0[_0xe02c('0x46')],{'$or':_[_0xe02c('0x36')](_0xdc8df0[_0xe02c('0x3f')],function(_0x5c4ed7){var _0x1abb2d={};_0x1abb2d[_0x5c4ed7]={'$like':'%'+_0x283de9[_0xe02c('0x3c')][_0xe02c('0x45')]+'%'};return _0x1abb2d;})});}_0xdc8df0=_['merge']({},_0xdc8df0,_0x283de9[_0xe02c('0x48')]);return _0x2c6d29[_0xe02c('0x7e')](_0xdc8df0);}})[_0xe02c('0x2d')](function(_0x2127e7){if(_0x2127e7){_0x5b75ed=_0x2127e7[_0xe02c('0x4f')];if(!_0x283de9[_0xe02c('0x3c')][_0xe02c('0x41')]('nolimit')){_0xdc8df0[_0xe02c('0x24')]=qs[_0xe02c('0x24')](_0x283de9[_0xe02c('0x3c')][_0xe02c('0x24')]);_0xdc8df0[_0xe02c('0x26')]=qs[_0xe02c('0x26')](_0x283de9[_0xe02c('0x3c')][_0xe02c('0x26')]);}return _0x2c6d29[_0xe02c('0x7e')](_0xdc8df0);}})['then'](function(_0x4297b2){if(_0x4297b2){return _0x4297b2?{'count':_0x5b75ed,'rows':_0x4297b2}:null;}})[_0xe02c('0x2d')](respondWithResult(_0x4cfbc0,null))['catch'](handleError(_0x4cfbc0,null));};exports[_0xe02c('0x7f')]=function(_0x4081f5,_0x1d23ed,_0x46fd38){var _0x7cd9df=_0x4081f5[_0xe02c('0x53')]['ids'];var _0xc21958;return db[_0xe02c('0x7d')][_0xe02c('0x4b')]({'where':{'id':_0x7cd9df},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe02c('0x33'),_0xe02c('0x80'),_0xe02c('0x81'),'interface'],'raw':!![]}]})[_0xe02c('0x2d')](function(_0x35b30c){if(_0x35b30c){_0xc21958=_0x35b30c;var _0x469eac=_[_0xe02c('0x82')](_0x35b30c,function(_0x7441e6){var _0x56e35d=_0x7441e6[_0xe02c('0x2e')]({'plain':!![]});return _0x56e35d[_0xe02c('0x83')];});return db[_0xe02c('0x37')][_0xe02c('0x50')]({'where':{'id':_0x4081f5[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](function(_0x327507){return db[_0xe02c('0x52')][_0xe02c('0x6f')](function(_0x2ee007){return _0x327507[_0xe02c('0x7f')](_0x7cd9df,{'transaction':_0x2ee007})[_0xe02c('0x2d')](function(){return BPromise[_0xe02c('0x84')](_0xc21958,function(_0x1de725){return db[_0xe02c('0x85')][_0xe02c('0x86')]({'TeamId':_0x1de725['id'],'VoicePrefixId':_0x4081f5[_0xe02c('0x4e')]['id']},{'transaction':_0x2ee007});});})['then'](function(){return BPromise['each'](_0x469eac,function(_0x4400b2){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0x4400b2['id'],'VoicePrefixId':_0x4081f5['params']['id']},'transaction':_0x2ee007});});})[_0xe02c('0x2d')](function(){_0x469eac[_0xe02c('0x87')](function(_0x889cef){socket['emit'](_0xe02c('0x76'),{'UserId':_0x889cef['id'],'VoicePrefixId':_0x327507['id']});});});});});}})['then'](respondWithStatusCode(_0x1d23ed,null))['catch'](handleError(_0x1d23ed,null));};exports[_0xe02c('0x88')]=function(_0x3ca665,_0x4eb163,_0x1433bd){return db['Team']['findAll']({'where':{'id':_0x3ca665[_0xe02c('0x3c')][_0xe02c('0x72')]},'attributes':['id'],'include':[{'model':db[_0xe02c('0x7a')],'as':_0xe02c('0x83'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4eb163,null))[_0xe02c('0x2d')](function(_0x25933f){var _0x323d81=_[_0xe02c('0x36')](_0x25933f,'id');var _0x3b6e15=[];var _0x1c96cc=[];var _0x322b4a=squel[_0xe02c('0x89')]();_0x322b4a[_0xe02c('0x8a')](_0xe02c('0x8b'))[_0xe02c('0x8c')](_0xe02c('0x8d'),'tq')[_0xe02c('0x8e')](_0xe02c('0x8f'),'ut',_0xe02c('0x90'))[_0xe02c('0x46')](_0xe02c('0x91'),_0x3ca665['params']['id']);for(var _0x252f5f=0x0;_0x252f5f<_0x25933f[_0xe02c('0x4f')];_0x252f5f+=0x1){let _0x4d112d=_0x25933f[_0x252f5f];for(var _0x3e0961=0x0;_0x3e0961<_0x4d112d[_0xe02c('0x83')][_0xe02c('0x4f')];_0x3e0961+=0x1){let _0x4b7886=_0x4d112d[_0xe02c('0x83')][_0x3e0961];var _0x505074=_0x322b4a[_0xe02c('0x92')]();_0x505074['where'](_0xe02c('0x93'),_0x4b7886['id']);_0x1c96cc[_0xe02c('0x68')](db[_0xe02c('0x52')][_0xe02c('0x3c')](_0x505074[_0xe02c('0x94')](),{'type':db['sequelize'][_0xe02c('0x95')]['SELECT']})[_0xe02c('0x2d')](function(_0x47d3fa){if(_0x47d3fa[_0xe02c('0x4f')]===0x1){return _0x4b7886['id'];}else{var _0x534002=_[_0xe02c('0x96')](_[_0xe02c('0x36')](_0x47d3fa,_0xe02c('0x97')),function(_0x45c425){return _[_0xe02c('0x98')](_0x323d81,_0x45c425);});if(_0x534002){return _0x4b7886['id'];}}}));}}return BPromise['all'](_0x1c96cc)['then'](function(_0x27ea6e){_0x3b6e15=_(_0x3b6e15)[_0xe02c('0x99')](_0x27ea6e)[_0xe02c('0x9a')]()[_0xe02c('0x9b')]();return db[_0xe02c('0x37')]['find']({'where':{'id':_0x3ca665[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](function(_0x34b426){return db['sequelize'][_0xe02c('0x6f')](function(_0x2a8e1d){return _0x34b426[_0xe02c('0x88')](_0x3ca665[_0xe02c('0x3c')][_0xe02c('0x72')],{'transaction':_0x2a8e1d})[_0xe02c('0x2d')](function(){if(!_['isEmpty'](_0x3b6e15)){return _0x34b426['removeAgents'](_0x3b6e15,{'transaction':_0x2a8e1d});}})[_0xe02c('0x2d')](function(){_0x3b6e15[_0xe02c('0x87')](function(_0x4b9fb7){socket['emit']('userVoicePrefix:remove',{'UserId':_0x4b9fb7,'VoicePrefixId':_0x34b426['id']});});});});});});})['then'](respondWithStatusCode(_0x4eb163,null))[_0xe02c('0x51')](handleError(_0x4eb163,null));};
\ No newline at end of file
index ab877f9..adc0767 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9af8=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0xcdcf3b,_0x3fc1dc){var _0xaa0e09=function(_0x3d8f53){while(--_0x3d8f53){_0xcdcf3b['push'](_0xcdcf3b['shift']());}};_0xaa0e09(++_0x3fc1dc);}(_0x9af8,0xdd));var _0x89af=function(_0x2d455a,_0x51c15b){_0x2d455a=_0x2d455a-0x0;var _0x269254=_0x9af8[_0x2d455a];return _0x269254;};'use strict';var EventEmitter=require(_0x89af('0x0'));var VoicePrefix=require(_0x89af('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x89af('0x2')](0x0);var events={'afterCreate':_0x89af('0x3'),'afterUpdate':_0x89af('0x4'),'afterDestroy':'remove'};function emitEvent(_0x59f634){return function(_0x468a0e,_0x277957,_0x46fecc){VoicePrefixEvents[_0x89af('0x5')](_0x59f634+':'+_0x468a0e['id'],_0x468a0e);VoicePrefixEvents[_0x89af('0x5')](_0x59f634,_0x468a0e);_0x46fecc(null);};}for(var e in events){if(events[_0x89af('0x6')](e)){var event=events[e];VoicePrefix[_0x89af('0x7')](e,emitEvent(event));}}module[_0x89af('0x8')]=VoicePrefixEvents;
\ No newline at end of file
+var _0xb51a=['remove','emit','hasOwnProperty','exports','events','VoicePrefix','setMaxListeners','save','update'];(function(_0x76b00b,_0x26e939){var _0xc8e4a=function(_0xb16025){while(--_0xb16025){_0x76b00b['push'](_0x76b00b['shift']());}};_0xc8e4a(++_0x26e939);}(_0xb51a,0x190));var _0xab51=function(_0x5d7f9c,_0x206694){_0x5d7f9c=_0x5d7f9c-0x0;var _0xb1e412=_0xb51a[_0x5d7f9c];return _0xb1e412;};'use strict';var EventEmitter=require(_0xab51('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xab51('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xab51('0x2')](0x0);var events={'afterCreate':_0xab51('0x3'),'afterUpdate':_0xab51('0x4'),'afterDestroy':_0xab51('0x5')};function emitEvent(_0x2878f4){return function(_0x5e5b4a,_0x34ad5d,_0x2ed183){VoicePrefixEvents['emit'](_0x2878f4+':'+_0x5e5b4a['id'],_0x5e5b4a);VoicePrefixEvents[_0xab51('0x6')](_0x2878f4,_0x5e5b4a);_0x2ed183(null);};}for(var e in events){if(events[_0xab51('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xab51('0x8')]=VoicePrefixEvents;
\ No newline at end of file
index 68acede..2c56355 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6fd=['exports','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','path','rimraf','./voicePrefix.attributes'];(function(_0x275010,_0x4739b2){var _0x57c423=function(_0x38109d){while(--_0x38109d){_0x275010['push'](_0x275010['shift']());}};_0x57c423(++_0x4739b2);}(_0xc6fd,0x10b));var _0xdc6f=function(_0xf668ff,_0x3e81d0){_0xf668ff=_0xf668ff-0x0;var _0x323c18=_0xc6fd[_0xf668ff];return _0x323c18;};'use strict';var _=require(_0xdc6f('0x0'));var util=require(_0xdc6f('0x1'));var logger=require(_0xdc6f('0x2'))(_0xdc6f('0x3'));var moment=require(_0xdc6f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc6f('0x5'));var rimraf=require(_0xdc6f('0x6'));var config=require('../../config/environment');var attributes=require(_0xdc6f('0x7'));module[_0xdc6f('0x8')]=function(_0xa3022e,_0x23f6a6){return _0xa3022e['define'](_0xdc6f('0x9'),attributes,{'tableName':_0xdc6f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8876=['moment','request-promise','path','rimraf','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x47f719,_0x2e559d){var _0x407f4e=function(_0x2be03a){while(--_0x2be03a){_0x47f719['push'](_0x47f719['shift']());}};_0x407f4e(++_0x2e559d);}(_0x8876,0xe6));var _0x6887=function(_0x30cf27,_0x50069a){_0x30cf27=_0x30cf27-0x0;var _0x42168e=_0x8876[_0x30cf27];return _0x42168e;};'use strict';var _=require(_0x6887('0x0'));var util=require(_0x6887('0x1'));var logger=require(_0x6887('0x2'))(_0x6887('0x3'));var moment=require(_0x6887('0x4'));var BPromise=require('bluebird');var rp=require(_0x6887('0x5'));var fs=require('fs');var path=require(_0x6887('0x6'));var rimraf=require(_0x6887('0x7'));var config=require('../../config/environment');var attributes=require(_0x6887('0x8'));module[_0x6887('0x9')]=function(_0x455428,_0x5614b3){return _0x455428[_0x6887('0xa')](_0x6887('0xb'),attributes,{'tableName':_0x6887('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 48e161c..8a13860 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./voicePrefix.socket','then','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','info','lodash','bluebird','ioredis','../../mysqldb'];(function(_0x276517,_0x4d19e6){var _0x75ec0c=function(_0x4049bf){while(--_0x4049bf){_0x276517['push'](_0x276517['shift']());}};_0x75ec0c(++_0x4d19e6);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'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});config[_0xee2f('0x9')]=_[_0xee2f('0xa')](config['redis'],{'host':_0xee2f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee2f('0x9')]));require(_0xee2f('0xc'))['register'](socket);function respondWithRpcPromise(_0x3a49bb,_0x43f451,_0x4bf3c3){return new BPromise(function(_0x5597ea,_0x4818df){return client['request'](_0x3a49bb,_0x4bf3c3)[_0xee2f('0xd')](function(_0x4cb4bf){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x43f451,_0xee2f('0xe'));logger[_0xee2f('0xf')](_0xee2f('0x10'),_0x43f451,_0xee2f('0xe'),JSON[_0xee2f('0x11')](_0x4cb4bf));if(_0x4cb4bf[_0xee2f('0x12')]){if(_0x4cb4bf['error'][_0xee2f('0x13')]===0x1f4){logger['error'](_0xee2f('0x14'),_0x43f451,_0x4cb4bf[_0xee2f('0x12')]['message']);return _0x4818df(_0x4cb4bf[_0xee2f('0x12')][_0xee2f('0x15')]);}logger[_0xee2f('0x12')](_0xee2f('0x14'),_0x43f451,_0x4cb4bf[_0xee2f('0x12')]['message']);return _0x5597ea(_0x4cb4bf[_0xee2f('0x12')]['message']);}else{logger[_0xee2f('0x16')](_0xee2f('0x14'),_0x43f451,'request\x20sent');_0x5597ea(_0x4cb4bf['result'][_0xee2f('0x15')]);}})['catch'](function(_0x69db88){logger[_0xee2f('0x12')](_0xee2f('0x14'),_0x43f451,_0x69db88);_0x4818df(_0x69db88);});});}
\ No newline at end of file
+var _0x1122=['randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird'];(function(_0x7d67d4,_0x3d068c){var _0xd64e5a=function(_0x508ac5){while(--_0x508ac5){_0x7d67d4['push'](_0x7d67d4['shift']());}};_0xd64e5a(++_0x3d068c);}(_0x1122,0xac));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2112('0x0'));var util=require('util');var moment=require(_0x2112('0x1'));var BPromise=require(_0x2112('0x2'));var rs=require(_0x2112('0x3'));var fs=require('fs');var Redis=require(_0x2112('0x4'));var db=require(_0x2112('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2112('0x6'));var config=require('../../config/environment');var jayson=require(_0x2112('0x7'));var client=jayson[_0x2112('0x8')]['http']({'port':0x232a});config[_0x2112('0x9')]=_[_0x2112('0xa')](config[_0x2112('0x9')],{'host':_0x2112('0xb'),'port':0x18eb});var socket=require(_0x2112('0xc'))(new Redis(config[_0x2112('0x9')]));require(_0x2112('0xd'))[_0x2112('0xe')](socket);function respondWithRpcPromise(_0x18a596,_0x485a3d,_0x4690e6){return new BPromise(function(_0x46fc8b,_0x42eddd){return client[_0x2112('0xf')](_0x18a596,_0x4690e6)['then'](function(_0xa0a089){logger[_0x2112('0x10')](_0x2112('0x11'),_0x485a3d,_0x2112('0x12'));logger[_0x2112('0x13')](_0x2112('0x14'),_0x485a3d,_0x2112('0x12'),JSON['stringify'](_0xa0a089));if(_0xa0a089[_0x2112('0x15')]){if(_0xa0a089['error'][_0x2112('0x16')]===0x1f4){logger[_0x2112('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x485a3d,_0xa0a089[_0x2112('0x15')]['message']);return _0x42eddd(_0xa0a089[_0x2112('0x15')]['message']);}logger[_0x2112('0x15')](_0x2112('0x11'),_0x485a3d,_0xa0a089['error'][_0x2112('0x17')]);return _0x46fc8b(_0xa0a089['error'][_0x2112('0x17')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x485a3d,_0x2112('0x12'));_0x46fc8b(_0xa0a089['result']['message']);}})[_0x2112('0x18')](function(_0x28d498){logger[_0x2112('0x15')](_0x2112('0x11'),_0x485a3d,_0x28d498);_0x42eddd(_0x28d498);});});}
\ No newline at end of file
index 7ce0905..be7db0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd403=['voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener','register','length'];(function(_0x5d9be4,_0x5df4b6){var _0x44650b=function(_0x105191){while(--_0x105191){_0x5d9be4['push'](_0x5d9be4['shift']());}};_0x44650b(++_0x5df4b6);}(_0xd403,0x1d5));var _0x3d40=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xd403[_0x4b7895];return _0x264180;};'use strict';var VoicePrefixEvents=require(_0x3d40('0x0'));var events=[_0x3d40('0x1'),_0x3d40('0x2'),_0x3d40('0x3')];function createListener(_0x53d711,_0x381c5a){return function(_0x572b70){_0x381c5a[_0x3d40('0x4')](_0x53d711,_0x572b70);};}function removeListener(_0x6ee99,_0x1d860a){return function(){VoicePrefixEvents[_0x3d40('0x5')](_0x6ee99,_0x1d860a);};}exports[_0x3d40('0x6')]=function(_0xcb5864){for(var _0x113817=0x0,_0xfd5569=events[_0x3d40('0x7')];_0x113817<_0xfd5569;_0x113817++){var _0x1f488d=events[_0x113817];var _0x210104=createListener(_0x3d40('0x8')+_0x1f488d,_0xcb5864);VoicePrefixEvents['on'](_0x1f488d,_0x210104);}};
\ No newline at end of file
+var _0xbc4a=['voicePrefix:','./voicePrefix.events','save','remove','removeListener','register','length'];(function(_0x4af01e,_0x543f5c){var _0x178c11=function(_0x2c2f76){while(--_0x2c2f76){_0x4af01e['push'](_0x4af01e['shift']());}};_0x178c11(++_0x543f5c);}(_0xbc4a,0x1dd));var _0xabc4=function(_0x2f0a13,_0x25d800){_0x2f0a13=_0x2f0a13-0x0;var _0x119d59=_0xbc4a[_0x2f0a13];return _0x119d59;};'use strict';var VoicePrefixEvents=require(_0xabc4('0x0'));var events=[_0xabc4('0x1'),_0xabc4('0x2'),'update'];function createListener(_0x497e18,_0x4d2996){return function(_0x4fc0f9){_0x4d2996['emit'](_0x497e18,_0x4fc0f9);};}function removeListener(_0x145a9d,_0x4e84f9){return function(){VoicePrefixEvents[_0xabc4('0x3')](_0x145a9d,_0x4e84f9);};}exports[_0xabc4('0x4')]=function(_0x282a1e){for(var _0x422903=0x0,_0x244d3a=events[_0xabc4('0x5')];_0x422903<_0x244d3a;_0x422903++){var _0x244a46=events[_0x422903];var _0x28ea0b=createListener(_0xabc4('0x6')+_0x244a46,_0x282a1e);VoicePrefixEvents['on'](_0x244a46,_0x28ea0b);}};
\ No newline at end of file
index 5e5b899..2c93ec0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8784=['getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','put','delete','destroy','removeTeams','removeAgents','removeLists','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','index','/:id','isAuthenticated','/:id/hoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x37ced3,_0x58d45a){var _0x34d7bc=function(_0x7e48f2){while(--_0x7e48f2){_0x37ced3['push'](_0x37ced3['shift']());}};_0x34d7bc(++_0x58d45a);}(_0x8784,0x81));var _0x4878=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x8784[_0x1e3c16];return _0x47a0c9;};'use strict';var multer=require('multer');var util=require(_0x4878('0x0'));var path=require(_0x4878('0x1'));var timeout=require(_0x4878('0x2'));var express=require(_0x4878('0x3'));var router=express['Router']();var fs_extra=require(_0x4878('0x4'));var auth=require(_0x4878('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4878('0x6'));var controller=require(_0x4878('0x7'));router[_0x4878('0x8')]('/',auth['isAuthenticated'](),controller[_0x4878('0x9')]);router['get'](_0x4878('0xa'),auth[_0x4878('0xb')](),controller['show']);router[_0x4878('0x8')](_0x4878('0xc'),auth['isAuthenticated'](),controller['getHoppers']);router['get'](_0x4878('0xd'),auth['isAuthenticated'](),controller[_0x4878('0xe')]);router[_0x4878('0x8')]('/:id/hopper_finals',auth[_0x4878('0xb')](),controller[_0x4878('0xf')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x4878('0x10')]);router[_0x4878('0x8')](_0x4878('0x11'),auth['isAuthenticated'](),controller[_0x4878('0x12')]);router[_0x4878('0x8')](_0x4878('0x13'),auth[_0x4878('0xb')](),controller['getAgents']);router[_0x4878('0x8')]('/:id/members',auth[_0x4878('0xb')](),controller['getMembers']);router['get'](_0x4878('0x14'),auth['isAuthenticated'](),controller[_0x4878('0x15')]);router[_0x4878('0x8')](_0x4878('0x16'),auth[_0x4878('0xb')](),controller[_0x4878('0x17')]);router[_0x4878('0x18')]('/',auth[_0x4878('0xb')](),controller[_0x4878('0x19')]);router['post'](_0x4878('0x1a'),auth[_0x4878('0xb')](),controller[_0x4878('0x1b')]);router[_0x4878('0x18')]('/:id/teams',auth[_0x4878('0xb')](),controller[_0x4878('0x1c')]);router[_0x4878('0x18')](_0x4878('0x13'),auth[_0x4878('0xb')](),controller['addAgents']);router[_0x4878('0x18')]('/:id/lists',auth[_0x4878('0xb')](),controller['addLists']);router[_0x4878('0x18')](_0x4878('0x16'),auth[_0x4878('0xb')](),controller['addBlackLists']);router[_0x4878('0x1d')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4878('0x1e')](_0x4878('0xa'),auth[_0x4878('0xb')](),controller[_0x4878('0x1f')]);router['delete'](_0x4878('0x11'),auth[_0x4878('0xb')](),controller[_0x4878('0x20')]);router[_0x4878('0x1e')](_0x4878('0x13'),auth[_0x4878('0xb')](),controller[_0x4878('0x21')]);router[_0x4878('0x1e')]('/:id/lists',auth[_0x4878('0xb')](),controller[_0x4878('0x22')]);router['delete'](_0x4878('0x16'),auth[_0x4878('0xb')](),controller['removeBlackLists']);module[_0x4878('0x23')]=router;
\ No newline at end of file
+var _0xbf78=['/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','addLists','addBlackLists','put','update','destroy','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbf78,0x7c));var _0x8bf7=function(_0x69582b,_0x44e3ae){_0x69582b=_0x69582b-0x0;var _0xcdaf1=_0xbf78[_0x69582b];return _0xcdaf1;};'use strict';var multer=require(_0x8bf7('0x0'));var util=require(_0x8bf7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8bf7('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8bf7('0x3'));var interaction=require(_0x8bf7('0x4'));var config=require(_0x8bf7('0x5'));var controller=require(_0x8bf7('0x6'));router['get']('/',auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x8')]);router['get'](_0x8bf7('0x9'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0xa')]);router['get'](_0x8bf7('0xb'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0xc')]);router[_0x8bf7('0xd')](_0x8bf7('0xe'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0xf')]);router[_0x8bf7('0xd')](_0x8bf7('0x10'),auth['isAuthenticated'](),controller[_0x8bf7('0x11')]);router[_0x8bf7('0xd')](_0x8bf7('0x12'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x13')]);router[_0x8bf7('0xd')](_0x8bf7('0x14'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x15')]);router[_0x8bf7('0xd')](_0x8bf7('0x16'),auth[_0x8bf7('0x7')](),controller['getAgents']);router[_0x8bf7('0xd')](_0x8bf7('0x17'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x18')]);router[_0x8bf7('0xd')](_0x8bf7('0x19'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x1a')]);router[_0x8bf7('0xd')](_0x8bf7('0x1b'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x1c')]);router[_0x8bf7('0x1d')]('/',auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x1e')]);router[_0x8bf7('0x1d')](_0x8bf7('0x1f'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x20')]);router[_0x8bf7('0x1d')](_0x8bf7('0x14'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x21')]);router[_0x8bf7('0x1d')](_0x8bf7('0x16'),auth['isAuthenticated'](),controller[_0x8bf7('0x22')]);router['post'](_0x8bf7('0x19'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x23')]);router[_0x8bf7('0x1d')](_0x8bf7('0x1b'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x24')]);router[_0x8bf7('0x25')](_0x8bf7('0x9'),auth['isAuthenticated'](),controller[_0x8bf7('0x26')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8bf7('0x27')]);router[_0x8bf7('0x28')](_0x8bf7('0x14'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x29')]);router[_0x8bf7('0x28')](_0x8bf7('0x16'),auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x2a')]);router['delete']('/:id/lists',auth['isAuthenticated'](),controller[_0x8bf7('0x2b')]);router[_0x8bf7('0x28')]('/:id/blacklists',auth[_0x8bf7('0x7')](),controller[_0x8bf7('0x2c')]);module[_0x8bf7('0x2d')]=router;
\ No newline at end of file
index 29e92f2..4989738 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8802=['wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','strategy','getDataValue','type','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x8802,0x7e));var _0x2880=function(_0x50cc54,_0x54c15f){_0x50cc54=_0x50cc54-0x0;var _0x28ecca=_0x8802[_0x50cc54];return _0x28ecca;};'use strict';var Sequelize=require(_0x2880('0x0'));module['exports']={'name':{'type':Sequelize[_0x2880('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x3'),_0x2880('0x4')),'allowNull':![],'defaultValue':_0x2880('0x3')},'musiconhold':{'type':Sequelize[_0x2880('0x1')],'defaultValue':_0x2880('0x5')},'announce':{'type':Sequelize[_0x2880('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x2880('0x2')]('rr',_0x2880('0x6'),_0x2880('0x7'),_0x2880('0x8'),_0x2880('0x9'),_0x2880('0xa'),_0x2880('0xb'),'wrandom',_0x2880('0xc')),'allowNull':![],'defaultValue':_0x2880('0x6'),'set':function(_0x4982be){this['setDataValue'](_0x2880('0xd'),_0x4982be?_0x4982be:'rrmemory');},'get':function(){var _0x459068=this[_0x2880('0xe')](_0x2880('0xf'));var _0x4368a1=this[_0x2880('0xe')]('dialMethod');var _0x28b720=this[_0x2880('0xe')](_0x2880('0xd'));if(_0x459068==='inbound'){return _0x28b720;}if(_0x4368a1===_0x2880('0x10')&&_0x28b720==='rrmemory'||_0x4368a1===_0x2880('0x10')&&_0x28b720===_0x2880('0x11')){return _0x28b720;}if(_0x4368a1===_0x2880('0x12')||_0x4368a1===_0x2880('0x13')||_0x4368a1===_0x2880('0x14')){return _0x28b720;}return null;}},'servicelevel':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x2880('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x2880('0x2')]('yes','no'),'defaultValue':_0x2880('0x16')},'autopause':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no',_0x2880('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2880('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x2880('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no'),'defaultValue':_0x2880('0x16')},'announce_holdtime':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no',_0x2880('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x2880('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x2880('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x2880('0x1')]},'queue_youarenext':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x2880('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x2880('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x2880('0x1')]},'queue_less_than':{'type':Sequelize[_0x2880('0x1')]},'periodic_announce':{'type':Sequelize[_0x2880('0x19')],'set':function(_0x454427){this[_0x2880('0x1a')]('periodic_announce',_0x454427?_0x454427[_0x2880('0x1b')](','):[]);},'get':function(){return this[_0x2880('0xe')]('periodic_announce')?this[_0x2880('0xe')](_0x2880('0x1c'))[_0x2880('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x2880('0x1')],'defaultValue':'yes','set':function(_0x3c9a3c){this['setDataValue'](_0x2880('0x1e'),_0x3c9a3c?_0x3c9a3c[_0x2880('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x2880('0x1e'))?this[_0x2880('0xe')](_0x2880('0x1e'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x2880('0x1')],'defaultValue':'no','set':function(_0x342916){this[_0x2880('0x1a')](_0x2880('0x1f'),_0x342916?_0x342916[_0x2880('0x1b')](','):undefined);},'get':function(){return this[_0x2880('0xe')](_0x2880('0x1f'))?this[_0x2880('0xe')](_0x2880('0x1f'))[_0x2880('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x2880('0x1')]},'description':{'type':Sequelize[_0x2880('0x1')]},'acw':{'type':Sequelize[_0x2880('0x20')],'defaultValue':0x0,'set':function(_0x353c42){this['setDataValue'](_0x2880('0x21'),_0x353c42);if(_0x353c42){if(this[_0x2880('0xe')](_0x2880('0x22'))<0x2){this[_0x2880('0x1a')](_0x2880('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2880('0x23')},'dialMethod':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x24'),_0x2880('0x12'),_0x2880('0x14'),_0x2880('0x13'),'booked'),'defaultValue':'progressive','comment':_0x2880('0x25')},'dialLimitChannel':{'type':Sequelize[_0x2880('0x15')](0x4)[_0x2880('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2880('0x27')},'dialLimitQueue':{'type':Sequelize[_0x2880('0x15')](0x4)[_0x2880('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x2880('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x2880('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x29'),_0x2880('0x2a')),'defaultValue':_0x2880('0x2a'),'comment':_0x2880('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x2880('0x2c')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2880('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2880('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2880('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x2880('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x2880('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x2880('0x1')],'comment':_0x2880('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2880('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2880('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2880('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2880('0x15')](0x5)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2880('0x34')},'dialTimezone':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x2880('0x35')},'dialPrefix':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x36'),'never',_0x2880('0x37')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x2880('0x20')],'defaultValue':0x0,'comment':_0x2880('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x2880('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2880('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x2880('0x15')](0x9)[_0x2880('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2880('0x15')](0x9)[_0x2880('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2880('0x15')](0x9)[_0x2880('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2880('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0x2880('0x15')](0x9)[_0x2880('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2880('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2880('0x15')](0x9)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2880('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2880('0x15')](0x5)[_0x2880('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2880('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2880('0x15')](0x9)[_0x2880('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2880('0x3e')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x2880('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x2880('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x2880('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x40'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x2880('0x1')],'comment':_0x2880('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x2880('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x2880('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2880('0x41')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x2880('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2880('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2880('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2880('0x15')](0x5)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2880('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x2880('0x15')](0x5)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2880('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2880('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2880('0x49')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2880('0x15')],'allowNull':!![],'comment':_0x2880('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x2880('0x20')],'defaultValue':![],'comment':_0x2880('0x4d'),'set':function(_0x154c73){if(!_0x154c73)this[_0x2880('0x1a')](_0x2880('0x4e'),null);this['setDataValue'](_0x2880('0x4f'),_0x154c73);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0x6135=['joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','outbound','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','rrordered','strategy','getDataValue','type','booked','roundrobin','progressive','predictive','power','INTEGER','yes','once','TEXT','setDataValue','periodic_announce','split'];(function(_0x582ea4,_0x4a4c9e){var _0x12d22d=function(_0x218dca){while(--_0x218dca){_0x582ea4['push'](_0x582ea4['shift']());}};_0x12d22d(++_0x4a4c9e);}(_0x6135,0x18b));var _0x5613=function(_0x2ff4bd,_0x4780a6){_0x2ff4bd=_0x2ff4bd-0x0;var _0x28edc6=_0x6135[_0x2ff4bd];return _0x28edc6;};'use strict';var Sequelize=require(_0x5613('0x0'));module[_0x5613('0x1')]={'name':{'type':Sequelize[_0x5613('0x2')],'allowNull':![],'unique':_0x5613('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5613('0x4')]('inbound',_0x5613('0x5')),'allowNull':![],'defaultValue':_0x5613('0x6')},'musiconhold':{'type':Sequelize[_0x5613('0x2')],'defaultValue':_0x5613('0x7')},'announce':{'type':Sequelize[_0x5613('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x5613('0x8'),_0x5613('0x9'),_0x5613('0xa'),_0x5613('0xb'),_0x5613('0xc'),'linear',_0x5613('0xd'),_0x5613('0xe')),'allowNull':![],'defaultValue':_0x5613('0x8'),'set':function(_0x5c404d){this['setDataValue'](_0x5613('0xf'),_0x5c404d?_0x5c404d:'rrmemory');},'get':function(){var _0x149b5b=this[_0x5613('0x10')](_0x5613('0x11'));var _0x21580f=this[_0x5613('0x10')]('dialMethod');var _0x32319d=this[_0x5613('0x10')](_0x5613('0xf'));if(_0x149b5b==='inbound'){return _0x32319d;}if(_0x21580f===_0x5613('0x12')&&_0x32319d===_0x5613('0xc')||_0x21580f===_0x5613('0x12')&&_0x32319d===_0x5613('0x13')){return _0x32319d;}if(_0x21580f===_0x5613('0x14')||_0x21580f===_0x5613('0x15')||_0x21580f===_0x5613('0x16')){return _0x32319d;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5613('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x5613('0x17')](0xb)},'timeout':{'type':Sequelize[_0x5613('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x5613('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x5613('0x2')]},'weight':{'type':Sequelize[_0x5613('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x5613('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x5613('0x4')]('yes','no'),'defaultValue':_0x5613('0x18')},'autopause':{'type':Sequelize[_0x5613('0x4')](_0x5613('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5613('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x5613('0x4')](_0x5613('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x5613('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x5613('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x5613('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x5613('0x4')](_0x5613('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x5613('0x4')](_0x5613('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x5613('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x5613('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x5613('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5613('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x5613('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x5613('0x4')]('yes','no'),'defaultValue':_0x5613('0x18')},'announce_holdtime':{'type':Sequelize[_0x5613('0x4')]('yes','no',_0x5613('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x5613('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0x5613('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x5613('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x5613('0x2')]},'queue_youarenext':{'type':Sequelize[_0x5613('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x5613('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x5613('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x5613('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x5613('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x5613('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x5613('0x2')]},'queue_quantity2':{'type':Sequelize[_0x5613('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x5613('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x5613('0x1a')],'set':function(_0x3f46c7){this[_0x5613('0x1b')](_0x5613('0x1c'),_0x3f46c7?_0x3f46c7['join'](','):[]);},'get':function(){return this[_0x5613('0x10')]('periodic_announce')?this[_0x5613('0x10')](_0x5613('0x1c'))[_0x5613('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x5613('0x2')],'defaultValue':_0x5613('0x18'),'set':function(_0x57f4f9){this[_0x5613('0x1b')](_0x5613('0x1e'),_0x57f4f9?_0x57f4f9[_0x5613('0x1f')](','):undefined);},'get':function(){return this[_0x5613('0x10')](_0x5613('0x1e'))?this[_0x5613('0x10')](_0x5613('0x1e'))[_0x5613('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x32f388){this['setDataValue'](_0x5613('0x20'),_0x32f388?_0x32f388[_0x5613('0x1f')](','):undefined);},'get':function(){return this[_0x5613('0x10')](_0x5613('0x20'))?this[_0x5613('0x10')](_0x5613('0x20'))[_0x5613('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x5613('0x4')](_0x5613('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x5613('0x4')](_0x5613('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x5613('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5613('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x5613('0x2')]},'description':{'type':Sequelize[_0x5613('0x2')]},'acw':{'type':Sequelize[_0x5613('0x21')],'defaultValue':0x0,'set':function(_0x185477){this[_0x5613('0x1b')](_0x5613('0x22'),_0x185477);if(_0x185477){if(this[_0x5613('0x10')](_0x5613('0x23'))<0x2){this['setDataValue'](_0x5613('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5613('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x5613('0x21')],'defaultValue':0x0,'comment':_0x5613('0x24')},'dialMethod':{'type':Sequelize[_0x5613('0x4')](_0x5613('0x25'),'progressive',_0x5613('0x16'),_0x5613('0x15'),'booked'),'defaultValue':_0x5613('0x14'),'comment':_0x5613('0x26')},'dialLimitChannel':{'type':Sequelize[_0x5613('0x17')](0x4)[_0x5613('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5613('0x28')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x5613('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5613('0x29')},'dialPowerLevel':{'type':Sequelize[_0x5613('0x2a')](0x2)[_0x5613('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x5613('0x2b'),_0x5613('0x2c')),'defaultValue':_0x5613('0x2c'),'comment':_0x5613('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x5613('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x5613('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x5613('0x17')](0x3)[_0x5613('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x5613('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5613('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5613('0x17')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x5613('0x30'),'comment':_0x5613('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x5613('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x5613('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x5613('0x17')](0x3)[_0x5613('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5613('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5613('0x17')](0x5)[_0x5613('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5613('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x5613('0x17')](0x3)[_0x5613('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x5613('0x17')](0x5)[_0x5613('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5613('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5613('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x5613('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5613('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5613('0x36')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5613('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x5613('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5613('0x2')],'defaultValue':_0x5613('0x37')},'dialPrefix':{'type':Sequelize[_0x5613('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x5613('0x4')](_0x5613('0x38'),_0x5613('0x39'),_0x5613('0x3a')),'defaultValue':_0x5613('0x38')},'dialAMDActive':{'type':Sequelize[_0x5613('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x5613('0x17')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5613('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x5613('0x17')](0x9)[_0x5613('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5613('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5613('0x17')](0x9)[_0x5613('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5613('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5613('0x17')](0x9)[_0x5613('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5613('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x5613('0x17')](0x9)[_0x5613('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5613('0x17')](0x9)[_0x5613('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5613('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5613('0x17')](0x9)[_0x5613('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5613('0x17')](0x5)[_0x5613('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5613('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5613('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5613('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x5613('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x5613('0x42')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5613('0x43')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x5613('0x44'),_0x5613('0x45')),'defaultValue':_0x5613('0x44')},'dialQueueProject2':{'type':Sequelize[_0x5613('0x2')],'comment':_0x5613('0x46')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5613('0x17')](0x3)[_0x5613('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5613('0x47')},'dialCutDigit':{'type':Sequelize[_0x5613('0x17')](0x3)[_0x5613('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5613('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5613('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5613('0x49')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5613('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5613('0x4a')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5613('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5613('0x4b')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5613('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5613('0x4c')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5613('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5613('0x4d')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5613('0x4e')},'dialMachineMaxRetry':{'type':Sequelize[_0x5613('0x17')](0x3)[_0x5613('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x5613('0x17')](0x5)[_0x5613('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5613('0x4f')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5613('0x50')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5613('0x17')](0x5)[_0x5613('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5613('0x51')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5613('0x17')],'allowNull':!![],'comment':_0x5613('0x52')},'mandatoryDisposition':{'type':Sequelize[_0x5613('0x21')],'defaultValue':![],'comment':_0x5613('0x53'),'set':function(_0x26101c){if(!_0x26101c)this[_0x5613('0x1b')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x5613('0x54'),_0x26101c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x5613('0x17')](0x3)[_0x5613('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5613('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
index 1aedf41..1dfcbc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5653=['hasOwnProperty','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','pick','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','each','UserVoiceQueue','UserVoiceQueueRt','format','SIP/%s','emit','userVoiceQueue:save','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','compact','transaction','removeTeams','isEmpty','removeAgents','addAgents','ids','upsert','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','ListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','Content-Range','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','includes','find','type','name','UserProfileResource','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','role','outbound','UserProfileSection','autoAssociation','error','clone','createdAt','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','getHoppers','findOne'];(function(_0x5caedb,_0x42fb48){var _0x38d90f=function(_0x1a7eae){while(--_0x1a7eae){_0x5caedb['push'](_0x5caedb['shift']());}};_0x38d90f(++_0x42fb48);}(_0x5653,0x110));var _0x3565=function(_0x535dee,_0x2d90f9){_0x535dee=_0x535dee-0x0;var _0x5e6f24=_0x5653[_0x535dee];return _0x5e6f24;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3565('0x0'));var zipdir=require(_0x3565('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3565('0x2'));var moment=require(_0x3565('0x3'));var BPromise=require(_0x3565('0x4'));var Mustache=require(_0x3565('0x5'));var util=require(_0x3565('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3565('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3565('0x8'));var squel=require(_0x3565('0x9'));var crypto=require(_0x3565('0xa'));var jsforce=require(_0x3565('0xb'));var deskjs=require(_0x3565('0xc'));var toCsv=require(_0x3565('0xd'));var querystring=require(_0x3565('0xe'));var Papa=require(_0x3565('0xf'));var Redis=require('ioredis');var authService=require(_0x3565('0x10'));var qs=require(_0x3565('0x11'));var as=require(_0x3565('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3565('0x13'))('api');var utils=require(_0x3565('0x14'));var config=require(_0x3565('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3565('0x16'))['db'];config[_0x3565('0x17')]=_['defaults'](config[_0x3565('0x17')],{'host':_0x3565('0x18'),'port':0x18eb});var socket=require(_0x3565('0x19'))(new Redis(config['redis']));require(_0x3565('0x1a'))[_0x3565('0x1b')](socket);function respondWithStatusCode(_0x18071c,_0x313469){_0x313469=_0x313469||0xcc;return function(_0x57e9df){if(_0x57e9df){return _0x18071c[_0x3565('0x1c')](_0x313469);}return _0x18071c[_0x3565('0x1d')](_0x313469)[_0x3565('0x1e')]();};}function respondWithResult(_0x2defdf,_0x13525){_0x13525=_0x13525||0xc8;return function(_0x15b918){if(_0x15b918){return _0x2defdf[_0x3565('0x1d')](_0x13525)[_0x3565('0x1f')](_0x15b918);}};}function respondWithFilteredResult(_0x391691,_0x3e7e61){return function(_0x58833d){if(_0x58833d){var _0x243c76=typeof _0x3e7e61['offset']==='undefined'&&typeof _0x3e7e61['limit']===_0x3565('0x20');var _0x52b6c5=_0x58833d[_0x3565('0x21')];var _0x4d646a=_0x243c76?0x0:_0x3e7e61[_0x3565('0x22')];var _0x3e916b=_0x243c76?_0x58833d[_0x3565('0x21')]:_0x3e7e61[_0x3565('0x22')]+_0x3e7e61['limit'];var _0x40e83b;if(_0x3e916b>=_0x52b6c5){_0x3e916b=_0x52b6c5;_0x40e83b=0xc8;}else{_0x40e83b=0xce;}_0x391691['status'](_0x40e83b);return _0x391691['set'](_0x3565('0x23'),_0x4d646a+'-'+_0x3e916b+'/'+_0x52b6c5)[_0x3565('0x1f')](_0x58833d);}return null;};}function patchUpdates(_0x560acd){return function(_0xaa90b2){try{jsonpatch['apply'](_0xaa90b2,_0x560acd,!![]);}catch(_0x4eb915){return BPromise[_0x3565('0x24')](_0x4eb915);}return _0xaa90b2[_0x3565('0x25')]();};}function saveUpdates(_0x24f995,_0x524512){return function(_0x232f8f){if(_0x232f8f){return _0x232f8f[_0x3565('0x26')](_0x24f995)[_0x3565('0x27')](function(_0x7d0df7){return _0x7d0df7;});}return null;};}function removeEntity(_0x4f859c,_0xf2e1c7){return function(_0x417898){if(_0x417898){return _0x417898[_0x3565('0x28')]()['then'](function(){var _0x54b076=_0x417898[_0x3565('0x29')]({'plain':!![]});var _0x5efc74=[{'name':_0x3565('0x2a'),'value':_0x3565('0x2b'),'ignore':![]},{'name':_0x3565('0x2c'),'value':'outbound','ignore':![]}];var _0x5e36e6=_(_0x5efc74)[_0x3565('0x2d')](_0x3565('0x2e'))[_0x3565('0x2f')](_0x3565('0x30'))['value']();if(_[_0x3565('0x31')](_0x5e36e6,_0x54b076['type'])){return;}var _0x26115d=_[_0x3565('0x32')](_0x5efc74,[_0x3565('0x30'),_0x54b076[_0x3565('0x33')]])[_0x3565('0x34')];return db[_0x3565('0x35')][_0x3565('0x28')]({'where':{'type':_0x26115d,'resourceId':_0x54b076['id']}})[_0x3565('0x27')](function(){return _0x417898;});})[_0x3565('0x27')](function(){_0x4f859c[_0x3565('0x1d')](0xcc)[_0x3565('0x1e')]();});}};}function handleEntityNotFound(_0x5a6d59,_0x458fff){return function(_0x4be281){if(!_0x4be281){_0x5a6d59['sendStatus'](0x194);}return _0x4be281;};}function handleError(_0x47fb2c,_0x1b3aa5){_0x1b3aa5=_0x1b3aa5||0x1f4;return function(_0x5be014){logger['error'](_0x5be014[_0x3565('0x36')]);if(_0x5be014[_0x3565('0x34')]){delete _0x5be014[_0x3565('0x34')];}_0x47fb2c[_0x3565('0x1d')](_0x1b3aa5)[_0x3565('0x37')](_0x5be014);};}exports[_0x3565('0x38')]=function(_0x19e32c,_0x30a3c1){var _0x51d66b={},_0x5a7d93={},_0x162966={'count':0x0,'rows':[]};var _0x1c1767=_[_0x3565('0x2f')](db[_0x3565('0x39')][_0x3565('0x3a')],function(_0xa4cda){return{'name':_0xa4cda[_0x3565('0x3b')],'type':_0xa4cda[_0x3565('0x33')][_0x3565('0x3c')]};});_0x5a7d93['model']=_[_0x3565('0x2f')](_0x1c1767,_0x3565('0x34'));_0x5a7d93[_0x3565('0x3d')]=_[_0x3565('0x3e')](_0x19e32c['query']);_0x5a7d93[_0x3565('0x3f')]=_[_0x3565('0x40')](_0x5a7d93[_0x3565('0x41')],_0x5a7d93[_0x3565('0x3d')]);_0x51d66b[_0x3565('0x42')]=_[_0x3565('0x40')](_0x5a7d93[_0x3565('0x41')],qs[_0x3565('0x43')](_0x19e32c[_0x3565('0x3d')][_0x3565('0x43')]));_0x51d66b[_0x3565('0x42')]=_0x51d66b['attributes'][_0x3565('0x44')]?_0x51d66b[_0x3565('0x42')]:_0x5a7d93[_0x3565('0x41')];if(!_0x19e32c[_0x3565('0x3d')]['hasOwnProperty'](_0x3565('0x45'))){_0x51d66b[_0x3565('0x46')]=qs[_0x3565('0x46')](_0x19e32c['query'][_0x3565('0x46')]);_0x51d66b[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x19e32c['query'][_0x3565('0x22')]);}_0x51d66b[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x19e32c['query'][_0x3565('0x48')]);_0x51d66b['where']=qs['filters'](_['pick'](_0x19e32c[_0x3565('0x3d')],_0x5a7d93[_0x3565('0x3f')]),_0x1c1767);if(_0x19e32c[_0x3565('0x3d')][_0x3565('0x2d')]){_0x51d66b[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x51d66b[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x1c1767,function(_0x2141c2){if(_0x2141c2['type']!==_0x3565('0x4b')){var _0x237225={};_0x237225[_0x2141c2[_0x3565('0x34')]]={'$like':'%'+_0x19e32c['query']['filter']+'%'};return _0x237225;}})});}_0x51d66b=_[_0x3565('0x4a')]({},_0x51d66b,_0x19e32c[_0x3565('0x4c')]);var _0x150917={'where':_0x51d66b[_0x3565('0x49')]};return db['VoiceQueue'][_0x3565('0x21')](_0x150917)[_0x3565('0x27')](function(_0x360017){_0x162966[_0x3565('0x21')]=_0x360017;if(_0x19e32c['query'][_0x3565('0x4d')]){_0x51d66b[_0x3565('0x4e')]=[{'all':!![]}];}return db[_0x3565('0x39')][_0x3565('0x4f')](_0x51d66b);})[_0x3565('0x27')](function(_0x56e93a){_0x162966[_0x3565('0x50')]=_0x56e93a;return _0x162966;})['then'](respondWithFilteredResult(_0x30a3c1,_0x51d66b))[_0x3565('0x51')](handleError(_0x30a3c1,null));};exports[_0x3565('0x52')]=function(_0x36c7b9,_0xf79b99){var _0x27286c={'raw':![],'where':{'id':_0x36c7b9[_0x3565('0x53')]['id']}},_0x1d5616={};_0x1d5616[_0x3565('0x41')]=_['keys'](db[_0x3565('0x39')][_0x3565('0x3a')]);_0x1d5616['query']=_[_0x3565('0x3e')](_0x36c7b9[_0x3565('0x3d')]);_0x1d5616[_0x3565('0x3f')]=_[_0x3565('0x40')](_0x1d5616[_0x3565('0x41')],_0x1d5616[_0x3565('0x3d')]);_0x27286c['attributes']=_[_0x3565('0x40')](_0x1d5616[_0x3565('0x41')],qs[_0x3565('0x43')](_0x36c7b9[_0x3565('0x3d')][_0x3565('0x43')]));_0x27286c[_0x3565('0x42')]=_0x27286c[_0x3565('0x42')][_0x3565('0x44')]?_0x27286c[_0x3565('0x42')]:_0x1d5616[_0x3565('0x41')];if(_0x36c7b9[_0x3565('0x3d')]['includeAll']){_0x27286c[_0x3565('0x4e')]=[{'all':!![]}];}_0x27286c=_[_0x3565('0x4a')]({},_0x27286c,_0x36c7b9[_0x3565('0x4c')]);return db[_0x3565('0x39')][_0x3565('0x32')](_0x27286c)[_0x3565('0x27')](handleEntityNotFound(_0xf79b99,null))[_0x3565('0x27')](respondWithResult(_0xf79b99,null))[_0x3565('0x51')](handleError(_0xf79b99,null));};exports[_0x3565('0x54')]=function(_0x2f8349,_0x3a25b6){return db['VoiceQueue'][_0x3565('0x54')](_0x2f8349[_0x3565('0x55')],{})[_0x3565('0x27')](function(_0x159921){var _0x1d6584=_0x2f8349[_0x3565('0x56')][_0x3565('0x29')]({'plain':!![]});if(!_0x1d6584)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d6584[_0x3565('0x57')]===_0x3565('0x56')){var _0x3f9ac0=_0x159921[_0x3565('0x29')]({'plain':!![]});var _0x29944b=[{'name':_0x3565('0x2a'),'value':_0x3565('0x2b')},{'name':'QueueCampaigns','value':_0x3565('0x58')}];var _0x5c9876=_[_0x3565('0x32')](_0x29944b,[_0x3565('0x30'),_0x3f9ac0[_0x3565('0x33')]])[_0x3565('0x34')];return db[_0x3565('0x59')]['find']({'where':{'name':_0x5c9876,'userProfileId':_0x1d6584['userProfileId']},'raw':!![]})[_0x3565('0x27')](function(_0x368f73){if(_0x368f73&&_0x368f73[_0x3565('0x5a')]===0x0){return db[_0x3565('0x35')][_0x3565('0x54')]({'name':_0x3f9ac0['name'],'resourceId':_0x3f9ac0['id'],'type':_0x368f73[_0x3565('0x34')],'sectionId':_0x368f73['id']},{})[_0x3565('0x27')](function(){return _0x159921;});}else{return _0x159921;}})[_0x3565('0x51')](function(_0x1f45f3){logger[_0x3565('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f45f3);throw _0x1f45f3;});}return _0x159921;})[_0x3565('0x27')](respondWithResult(_0x3a25b6,0xc9))[_0x3565('0x51')](handleError(_0x3a25b6,null));};exports[_0x3565('0x5c')]=function(_0x4e13f5,_0x258b5b){var _0x8ba989={'where':{'id':_0x4e13f5[_0x3565('0x53')]['id']}},_0x27bf83={};_0x27bf83[_0x3565('0x41')]=_[_0x3565('0x3e')](db[_0x3565('0x39')]['rawAttributes']);_0x8ba989['attributes']=_[_0x3565('0x40')](_0x27bf83[_0x3565('0x41')],qs[_0x3565('0x43')](_0x4e13f5['query'][_0x3565('0x43')]));_0x8ba989[_0x3565('0x42')]=_0x8ba989[_0x3565('0x42')][_0x3565('0x44')]?_0x8ba989['attributes']:_0x27bf83[_0x3565('0x41')];if(_0x4e13f5[_0x3565('0x3d')][_0x3565('0x4d')]){_0x8ba989[_0x3565('0x4e')]=[{'all':!![]}];}_0x8ba989=_[_0x3565('0x4a')]({},_0x8ba989,_0x4e13f5['options']);return db[_0x3565('0x39')][_0x3565('0x32')](_0x8ba989)['then'](handleEntityNotFound(_0x258b5b,null))[_0x3565('0x27')](function(_0x3b4327){if(_0x3b4327){var _0x402f02=_0x3b4327[_0x3565('0x29')]({'plain':!![]});_0x402f02=qs['omit'](_0x402f02,['id',_0x3565('0x5d'),'updatedAt']);_0x4e13f5[_0x3565('0x55')]=_[_0x3565('0x5e')](_0x4e13f5[_0x3565('0x55')],['id',_0x3565('0x5d'),_0x3565('0x5f')]);return db[_0x3565('0x39')][_0x3565('0x54')](_['merge'](_0x402f02,_0x4e13f5[_0x3565('0x55')]),{'include':_0x4e13f5[_0x3565('0x3d')][_0x3565('0x4d')]?[{'all':!![]}]:undefined})[_0x3565('0x27')](function(_0x1f1f22){var _0x1065a3=_0x4e13f5[_0x3565('0x56')][_0x3565('0x29')]({'plain':!![]});if(!_0x1065a3)throw new Error(_0x3565('0x60'));if(_0x1065a3['role']===_0x3565('0x56')){var _0x5f55bd=_0x1f1f22[_0x3565('0x29')]({'plain':!![]});var _0x3d55c8=[{'name':_0x3565('0x2a'),'value':'inbound'},{'name':_0x3565('0x2c'),'value':_0x3565('0x58')}];var _0x20bc28=_[_0x3565('0x32')](_0x3d55c8,[_0x3565('0x30'),_0x5f55bd[_0x3565('0x33')]])['name'];return db[_0x3565('0x59')][_0x3565('0x32')]({'where':{'name':_0x20bc28,'userProfileId':_0x1065a3[_0x3565('0x61')]},'raw':!![]})[_0x3565('0x27')](function(_0x515948){if(_0x515948&&_0x515948['autoAssociation']===0x0){return db[_0x3565('0x35')][_0x3565('0x54')]({'name':_0x5f55bd[_0x3565('0x34')],'resourceId':_0x5f55bd['id'],'type':_0x515948[_0x3565('0x34')],'sectionId':_0x515948['id']},{})[_0x3565('0x27')](function(){return _0x1f1f22;});}else{return _0x1f1f22;}})[_0x3565('0x51')](function(_0x1571ae){logger[_0x3565('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1571ae);throw _0x1571ae;});}return _0x1f1f22;});}})['then'](respondWithResult(_0x258b5b,0xc9))[_0x3565('0x51')](handleError(_0x258b5b,null));};exports[_0x3565('0x26')]=function(_0x4f53ac,_0x1bdcdb){if(_0x4f53ac['body']['id']){delete _0x4f53ac['body']['id'];}return db['VoiceQueue'][_0x3565('0x32')]({'where':{'id':_0x4f53ac[_0x3565('0x53')]['id']}})['then'](handleEntityNotFound(_0x1bdcdb,null))['then'](saveUpdates(_0x4f53ac[_0x3565('0x55')],null))[_0x3565('0x27')](respondWithResult(_0x1bdcdb,null))[_0x3565('0x51')](handleError(_0x1bdcdb,null));};exports['destroy']=function(_0x3b267a,_0x5692ab){return db[_0x3565('0x39')]['find']({'where':{'id':_0x3b267a['params']['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x5692ab,null))[_0x3565('0x27')](removeEntity(_0x5692ab,null))['catch'](handleError(_0x5692ab,null));};exports[_0x3565('0x62')]=function(_0x3a5529,_0x362ad3,_0x28d569){var _0x343e56={'raw':![],'where':{}};var _0x3fa001={};var _0x4da183={'count':0x0,'rows':[]};return db[_0x3565('0x39')][_0x3565('0x63')]({'where':{'id':_0x3a5529[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x362ad3,null))[_0x3565('0x27')](function(_0x21b2ad){if(_0x21b2ad){_0x3fa001[_0x3565('0x41')]=_['keys'](db['CmHopper']['rawAttributes']);_0x3fa001['query']=_[_0x3565('0x3e')](_0x3a5529['query']);_0x3fa001[_0x3565('0x3f')]=_[_0x3565('0x40')](_0x3fa001[_0x3565('0x41')],_0x3fa001[_0x3565('0x3d')]);_0x343e56[_0x3565('0x42')]=_[_0x3565('0x40')](_0x3fa001['model'],qs[_0x3565('0x43')](_0x3a5529[_0x3565('0x3d')]['fields']));_0x343e56['attributes']=_0x343e56[_0x3565('0x42')][_0x3565('0x44')]?_0x343e56[_0x3565('0x42')]:_0x3fa001[_0x3565('0x41')];if(!_0x3a5529['query'][_0x3565('0x64')](_0x3565('0x45'))){_0x343e56[_0x3565('0x46')]=qs['limit'](_0x3a5529[_0x3565('0x3d')]['limit']);_0x343e56[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x3a5529['query'][_0x3565('0x22')]);}_0x343e56[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x3a5529[_0x3565('0x3d')][_0x3565('0x48')]);_0x343e56[_0x3565('0x49')]=qs[_0x3565('0x3f')](_['pick'](_0x3a5529[_0x3565('0x3d')],_0x3fa001[_0x3565('0x3f')]));_0x343e56['where'][_0x3565('0x65')]=_0x21b2ad['id'];if(_0x3a5529[_0x3565('0x3d')]['filter']){_0x343e56['where']=_[_0x3565('0x4a')](_0x343e56[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x343e56[_0x3565('0x42')],function(_0x3ca822){var _0x1c0434={};_0x1c0434[_0x3ca822]={'$like':'%'+_0x3a5529['query'][_0x3565('0x2d')]+'%'};return _0x1c0434;})});}_0x343e56=_['merge']({},_0x343e56,_0x3a5529[_0x3565('0x4c')]);return db[_0x3565('0x66')]['count']({'where':_0x343e56[_0x3565('0x49')]})[_0x3565('0x27')](function(_0x15013d){_0x4da183[_0x3565('0x21')]=_0x15013d;if(_0x3a5529[_0x3565('0x3d')]['includeAll']){_0x343e56[_0x3565('0x4e')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x343e56);})[_0x3565('0x27')](function(_0x4d9ca3){_0x4da183[_0x3565('0x50')]=_0x4d9ca3;return _0x4da183;});}})[_0x3565('0x27')](respondWithFilteredResult(_0x362ad3,_0x343e56))['catch'](handleError(_0x362ad3,null));};exports[_0x3565('0x67')]=function(_0x5a4706,_0x3287e0,_0x30a2c6){var _0x3915ad={'raw':!![],'where':{}};var _0x50a86d={};var _0x234c7a={'count':0x0,'rows':[]};return db[_0x3565('0x39')][_0x3565('0x63')]({'where':{'id':_0x5a4706[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x3287e0,null))[_0x3565('0x27')](function(_0x3857e0){if(_0x3857e0){_0x50a86d[_0x3565('0x41')]=_[_0x3565('0x3e')](db['CmHopperHistory']['rawAttributes']);_0x50a86d['query']=_[_0x3565('0x3e')](_0x5a4706[_0x3565('0x3d')]);_0x50a86d['filters']=_[_0x3565('0x40')](_0x50a86d[_0x3565('0x41')],_0x50a86d['query']);_0x3915ad[_0x3565('0x42')]=_[_0x3565('0x40')](_0x50a86d[_0x3565('0x41')],qs['fields'](_0x5a4706[_0x3565('0x3d')][_0x3565('0x43')]));_0x3915ad[_0x3565('0x42')]=_0x3915ad[_0x3565('0x42')][_0x3565('0x44')]?_0x3915ad['attributes']:_0x50a86d[_0x3565('0x41')];if(!_0x5a4706[_0x3565('0x3d')]['hasOwnProperty'](_0x3565('0x45'))){_0x3915ad[_0x3565('0x46')]=qs[_0x3565('0x46')](_0x5a4706[_0x3565('0x3d')]['limit']);_0x3915ad[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x5a4706[_0x3565('0x3d')][_0x3565('0x22')]);}_0x3915ad[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x5a4706[_0x3565('0x3d')][_0x3565('0x48')]);_0x3915ad['where']=qs[_0x3565('0x3f')](_['pick'](_0x5a4706[_0x3565('0x3d')],_0x50a86d[_0x3565('0x3f')]));_0x3915ad[_0x3565('0x49')][_0x3565('0x65')]=_0x3857e0['id'];if(_0x5a4706['query'][_0x3565('0x2d')]){_0x3915ad[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x3915ad[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x3915ad['attributes'],function(_0x382d76){var _0x2c2b9f={};_0x2c2b9f[_0x382d76]={'$like':'%'+_0x5a4706[_0x3565('0x3d')][_0x3565('0x2d')]+'%'};return _0x2c2b9f;})});}_0x3915ad=_[_0x3565('0x4a')]({},_0x3915ad,_0x5a4706[_0x3565('0x4c')]);return db['CmHopperHistory']['count']({'where':_0x3915ad[_0x3565('0x49')]})[_0x3565('0x27')](function(_0x4eb65f){_0x234c7a[_0x3565('0x21')]=_0x4eb65f;if(_0x5a4706[_0x3565('0x3d')][_0x3565('0x4d')]){_0x3915ad[_0x3565('0x4e')]=[{'all':!![]}];}return db[_0x3565('0x68')][_0x3565('0x4f')](_0x3915ad);})['then'](function(_0x57501f){_0x234c7a[_0x3565('0x50')]=_0x57501f;return _0x234c7a;});}})['then'](respondWithFilteredResult(_0x3287e0,_0x3915ad))[_0x3565('0x51')](handleError(_0x3287e0,null));};exports['getHopperFinals']=function(_0x37f10c,_0x2186ce,_0x4ae00c){var _0x3f71a2={'raw':!![],'where':{}};var _0x5a312e={};var _0x20b79b={'count':0x0,'rows':[]};return db[_0x3565('0x39')][_0x3565('0x63')]({'where':{'id':_0x37f10c[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x2186ce,null))['then'](function(_0x492d6d){if(_0x492d6d){_0x5a312e[_0x3565('0x41')]=_[_0x3565('0x3e')](db[_0x3565('0x69')][_0x3565('0x3a')]);_0x5a312e[_0x3565('0x3d')]=_['keys'](_0x37f10c['query']);_0x5a312e['filters']=_[_0x3565('0x40')](_0x5a312e[_0x3565('0x41')],_0x5a312e[_0x3565('0x3d')]);_0x3f71a2['attributes']=_[_0x3565('0x40')](_0x5a312e[_0x3565('0x41')],qs[_0x3565('0x43')](_0x37f10c[_0x3565('0x3d')][_0x3565('0x43')]));_0x3f71a2[_0x3565('0x42')]=_0x3f71a2['attributes']['length']?_0x3f71a2[_0x3565('0x42')]:_0x5a312e[_0x3565('0x41')];if(!_0x37f10c[_0x3565('0x3d')][_0x3565('0x64')]('nolimit')){_0x3f71a2[_0x3565('0x46')]=qs[_0x3565('0x46')](_0x37f10c[_0x3565('0x3d')][_0x3565('0x46')]);_0x3f71a2[_0x3565('0x22')]=qs['offset'](_0x37f10c[_0x3565('0x3d')][_0x3565('0x22')]);}_0x3f71a2[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x37f10c['query'][_0x3565('0x48')]);_0x3f71a2[_0x3565('0x49')]=qs[_0x3565('0x3f')](_[_0x3565('0x6a')](_0x37f10c[_0x3565('0x3d')],_0x5a312e[_0x3565('0x3f')]));_0x3f71a2['where'][_0x3565('0x65')]=_0x492d6d['id'];if(_0x37f10c[_0x3565('0x3d')][_0x3565('0x2d')]){_0x3f71a2['where']=_['merge'](_0x3f71a2[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x3f71a2[_0x3565('0x42')],function(_0x30899b){var _0x4e7597={};_0x4e7597[_0x30899b]={'$like':'%'+_0x37f10c[_0x3565('0x3d')]['filter']+'%'};return _0x4e7597;})});}_0x3f71a2=_[_0x3565('0x4a')]({},_0x3f71a2,_0x37f10c[_0x3565('0x4c')]);return db[_0x3565('0x69')][_0x3565('0x21')]({'where':_0x3f71a2[_0x3565('0x49')]})[_0x3565('0x27')](function(_0x323272){_0x20b79b[_0x3565('0x21')]=_0x323272;if(_0x37f10c[_0x3565('0x3d')][_0x3565('0x4d')]){_0x3f71a2[_0x3565('0x4e')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x3f71a2);})[_0x3565('0x27')](function(_0x4b26dd){_0x20b79b[_0x3565('0x50')]=_0x4b26dd;return _0x20b79b;});}})['then'](respondWithFilteredResult(_0x2186ce,_0x3f71a2))[_0x3565('0x51')](handleError(_0x2186ce,null));};exports[_0x3565('0x6b')]=function(_0x48a0e0,_0x4fcc4c,_0x16c61e){var _0x3998e5={'raw':!![],'where':{}};var _0x21587b={};var _0x2623f3={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3565('0x63')]({'where':{'id':_0x48a0e0['params']['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x4fcc4c,null))['then'](function(_0xff3262){if(_0xff3262){_0x21587b[_0x3565('0x41')]=_[_0x3565('0x3e')](db[_0x3565('0x6c')][_0x3565('0x3a')]);_0x21587b['query']=_['keys'](_0x48a0e0['query']);_0x21587b['filters']=_[_0x3565('0x40')](_0x21587b[_0x3565('0x41')],_0x21587b[_0x3565('0x3d')]);_0x3998e5[_0x3565('0x42')]=_['intersection'](_0x21587b[_0x3565('0x41')],qs['fields'](_0x48a0e0[_0x3565('0x3d')][_0x3565('0x43')]));_0x3998e5[_0x3565('0x42')]=_0x3998e5[_0x3565('0x42')][_0x3565('0x44')]?_0x3998e5[_0x3565('0x42')]:_0x21587b[_0x3565('0x41')];if(!_0x48a0e0[_0x3565('0x3d')]['hasOwnProperty'](_0x3565('0x45'))){_0x3998e5[_0x3565('0x46')]=qs[_0x3565('0x46')](_0x48a0e0['query'][_0x3565('0x46')]);_0x3998e5[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x48a0e0[_0x3565('0x3d')][_0x3565('0x22')]);}_0x3998e5['order']=qs['sort'](_0x48a0e0[_0x3565('0x3d')][_0x3565('0x48')]);_0x3998e5[_0x3565('0x49')]=qs[_0x3565('0x3f')](_['pick'](_0x48a0e0[_0x3565('0x3d')],_0x21587b['filters']));_0x3998e5[_0x3565('0x49')][_0x3565('0x65')]=_0xff3262['id'];if(_0x48a0e0['query']['filter']){_0x3998e5[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x3998e5[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x3998e5[_0x3565('0x42')],function(_0xac38cb){var _0x5c330f={};_0x5c330f[_0xac38cb]={'$like':'%'+_0x48a0e0[_0x3565('0x3d')][_0x3565('0x2d')]+'%'};return _0x5c330f;})});}_0x3998e5=_[_0x3565('0x4a')]({},_0x3998e5,_0x48a0e0[_0x3565('0x4c')]);return db[_0x3565('0x6c')]['count']({'where':_0x3998e5[_0x3565('0x49')]})['then'](function(_0x22e450){_0x2623f3[_0x3565('0x21')]=_0x22e450;if(_0x48a0e0[_0x3565('0x3d')][_0x3565('0x4d')]){_0x3998e5[_0x3565('0x4e')]=[{'all':!![]}];}return db[_0x3565('0x6c')][_0x3565('0x4f')](_0x3998e5);})['then'](function(_0x4d5639){_0x2623f3[_0x3565('0x50')]=_0x4d5639;return _0x2623f3;});}})[_0x3565('0x27')](respondWithFilteredResult(_0x4fcc4c,_0x3998e5))[_0x3565('0x51')](handleError(_0x4fcc4c,null));};exports[_0x3565('0x6d')]=function(_0x3d79d1,_0x29ed71,_0x26013a){var _0x1c561d={};var _0x392661={};var _0x15448a;var _0x4d4493;return db[_0x3565('0x39')][_0x3565('0x63')]({'where':{'id':_0x3d79d1['params']['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x29ed71,null))[_0x3565('0x27')](function(_0x2319ed){if(_0x2319ed){_0x15448a=_0x2319ed;_0x392661[_0x3565('0x41')]=_['keys'](db[_0x3565('0x6e')]['rawAttributes']);_0x392661[_0x3565('0x3d')]=_['keys'](_0x3d79d1[_0x3565('0x3d')]);_0x392661[_0x3565('0x3f')]=_['intersection'](_0x392661[_0x3565('0x41')],_0x392661[_0x3565('0x3d')]);_0x1c561d['attributes']=_[_0x3565('0x40')](_0x392661[_0x3565('0x41')],qs[_0x3565('0x43')](_0x3d79d1[_0x3565('0x3d')][_0x3565('0x43')]));_0x1c561d['attributes']=_0x1c561d[_0x3565('0x42')][_0x3565('0x44')]?_0x1c561d[_0x3565('0x42')]:_0x392661[_0x3565('0x41')];_0x1c561d[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x3d79d1[_0x3565('0x3d')][_0x3565('0x48')]);_0x1c561d['where']=qs[_0x3565('0x3f')](_[_0x3565('0x6a')](_0x3d79d1[_0x3565('0x3d')],_0x392661[_0x3565('0x3f')]));if(_0x3d79d1[_0x3565('0x3d')][_0x3565('0x2d')]){_0x1c561d[_0x3565('0x49')]=_['merge'](_0x1c561d[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x1c561d[_0x3565('0x42')],function(_0x10dd51){var _0x598604={};_0x598604[_0x10dd51]={'$like':'%'+_0x3d79d1[_0x3565('0x3d')][_0x3565('0x2d')]+'%'};return _0x598604;})});}_0x1c561d=_[_0x3565('0x4a')]({},_0x1c561d,_0x3d79d1['options']);return _0x15448a[_0x3565('0x6d')](_0x1c561d);}})['then'](function(_0x427279){if(_0x427279){_0x4d4493=_0x427279[_0x3565('0x44')];if(!_0x3d79d1[_0x3565('0x3d')][_0x3565('0x64')](_0x3565('0x45'))){_0x1c561d['limit']=qs[_0x3565('0x46')](_0x3d79d1['query'][_0x3565('0x46')]);_0x1c561d[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x3d79d1[_0x3565('0x3d')][_0x3565('0x22')]);}return _0x15448a[_0x3565('0x6d')](_0x1c561d);}})[_0x3565('0x27')](function(_0x3059e8){if(_0x3059e8){return _0x3059e8?{'count':_0x4d4493,'rows':_0x3059e8}:null;}})[_0x3565('0x27')](respondWithResult(_0x29ed71,null))[_0x3565('0x51')](handleError(_0x29ed71,null));};exports[_0x3565('0x6f')]=function(_0x369c6d,_0x3d6060,_0x3bbc55){var _0x4d40af=_0x369c6d[_0x3565('0x55')]['teams'];var _0x146356=_[_0x3565('0x2f')](_0x4d40af,'id');return db['Team'][_0x3565('0x4f')]({'where':{'id':_0x146356},'attributes':['id'],'include':[{'model':db[_0x3565('0x70')],'as':_0x3565('0x71'),'attributes':['id',_0x3565('0x34'),_0x3565('0x72'),_0x3565('0x73'),_0x3565('0x74')],'raw':!![]}]})['then'](function(_0x20406b){if(_0x20406b){var _0x45fb0e=_[_0x3565('0x75')](_0x20406b,function(_0x3a5af0){var _0x7d822a=_0x3a5af0[_0x3565('0x29')]({'plain':!![]});_0x7d822a[_0x3565('0x71')][_0x3565('0x76')](function(_0x460318){_0x460318['penalty']=_[_0x3565('0x32')](_0x4d40af,{'id':_0x7d822a['id']})[_0x3565('0x77')];});return _0x7d822a[_0x3565('0x71')];});return db[_0x3565('0x39')][_0x3565('0x32')]({'where':{'id':_0x369c6d[_0x3565('0x53')]['id']}})[_0x3565('0x27')](function(_0x3b7ed8){return db[_0x3565('0x78')]['transaction'](function(_0x2fc2a9){return _0x3b7ed8['addTeams'](_0x146356,{'transaction':_0x2fc2a9})[_0x3565('0x27')](function(){return BPromise[_0x3565('0x79')](_0x4d40af,function(_0xd506cd){return db['TeamVoiceQueue']['upsert']({'TeamId':_0xd506cd['id'],'VoiceQueueId':_0x369c6d[_0x3565('0x53')]['id'],'penalty':_0xd506cd[_0x3565('0x77')]},{'transaction':_0x2fc2a9});});})[_0x3565('0x27')](function(){return BPromise[_0x3565('0x79')](_0x45fb0e,function(_0xc80023){return db[_0x3565('0x7a')]['findOrCreate']({'where':{'UserId':_0xc80023['id'],'VoiceQueueId':_0x369c6d[_0x3565('0x53')]['id']},'defaults':{'penalty':_0xc80023[_0x3565('0x77')]},'transaction':_0x2fc2a9});});})[_0x3565('0x27')](function(){return BPromise['each'](_[_0x3565('0x2d')](_0x45fb0e,{'online':!![]}),function(_0x8f39ea){return db[_0x3565('0x7b')]['upsert']({'membername':_0x8f39ea['name'],'UserId':_0x8f39ea['id'],'queue_name':_0x3b7ed8[_0x3565('0x34')],'VoiceQueueId':_0x3b7ed8['id'],'interface':_['isNil'](_0x8f39ea[_0x3565('0x74')])?util[_0x3565('0x7c')](_0x3565('0x7d'),_0x8f39ea['name']):_0x8f39ea['interface'],'paused':_0x8f39ea[_0x3565('0x73')]||![],'penalty':_0x8f39ea[_0x3565('0x77')]},{'transaction':_0x2fc2a9});});})[_0x3565('0x27')](function(){_0x45fb0e['forEach'](function(_0xaef0d5){socket[_0x3565('0x7e')](_0x3565('0x7f'),{'UserId':_0xaef0d5['id'],'VoiceQueueId':_0x3b7ed8['id']});});});});});}})['then'](respondWithStatusCode(_0x3d6060,null))[_0x3565('0x51')](handleError(_0x3d6060,null));};exports['removeTeams']=function(_0x34e7cb,_0x4da9a6,_0x5a8ac0){return db[_0x3565('0x6e')]['findAll']({'where':{'id':_0x34e7cb[_0x3565('0x3d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3565('0x70')],'as':_0x3565('0x71'),'attributes':['id'],'raw':!![]}]})[_0x3565('0x27')](handleEntityNotFound(_0x4da9a6,null))[_0x3565('0x27')](function(_0x4dda61){var _0x4100af=_[_0x3565('0x2f')](_0x4dda61,'id');var _0x51b316=[];var _0x43b11f=[];var _0x4769bb=squel['select']();_0x4769bb['field'](_0x3565('0x80'))[_0x3565('0x81')](_0x3565('0x82'),'tq')[_0x3565('0x83')](_0x3565('0x84'),'ut',_0x3565('0x85'))['where'](_0x3565('0x86'),_0x34e7cb['params']['id']);for(var _0x253df1=0x0;_0x253df1<_0x4dda61[_0x3565('0x44')];_0x253df1+=0x1){let _0x14fa8f=_0x4dda61[_0x253df1];for(var _0x43f9d6=0x0;_0x43f9d6<_0x14fa8f[_0x3565('0x71')][_0x3565('0x44')];_0x43f9d6+=0x1){let _0x12b10f=_0x14fa8f[_0x3565('0x71')][_0x43f9d6];var _0x3da783=_0x4769bb[_0x3565('0x5c')]();_0x3da783['where'](_0x3565('0x87'),_0x12b10f['id']);_0x43b11f[_0x3565('0x88')](db[_0x3565('0x78')][_0x3565('0x3d')](_0x3da783['toString'](),{'type':db[_0x3565('0x78')][_0x3565('0x89')][_0x3565('0x8a')]})[_0x3565('0x27')](function(_0x14e9ff){if(_0x14e9ff[_0x3565('0x44')]===0x1){return _0x12b10f['id'];}else{var _0xf1ce20=_[_0x3565('0x8b')](_[_0x3565('0x2f')](_0x14e9ff,_0x3565('0x8c')),function(_0x810b14){return _['includes'](_0x4100af,_0x810b14);});if(_0xf1ce20){return _0x12b10f['id'];}}}));}}return BPromise[_0x3565('0x8d')](_0x43b11f)[_0x3565('0x27')](function(_0x451190){_0x51b316=_(_0x51b316)['union'](_0x451190)[_0x3565('0x8e')]()['value']();return db['VoiceQueue'][_0x3565('0x32')]({'where':{'id':_0x34e7cb[_0x3565('0x53')]['id']}})[_0x3565('0x27')](function(_0x1ca727){return db[_0x3565('0x78')][_0x3565('0x8f')](function(_0x53c554){return _0x1ca727[_0x3565('0x90')](_0x34e7cb[_0x3565('0x3d')]['ids'],{'transaction':_0x53c554})['then'](function(){if(!_[_0x3565('0x91')](_0x51b316)){return _0x1ca727[_0x3565('0x92')](_0x51b316,{'transaction':_0x53c554})[_0x3565('0x27')](function(){return db[_0x3565('0x7b')][_0x3565('0x28')]({'where':{'VoiceQueueId':_0x34e7cb[_0x3565('0x53')]['id'],'UserId':_0x51b316},'transaction':_0x53c554});});}})[_0x3565('0x27')](function(){_0x51b316[_0x3565('0x76')](function(_0x254a09){socket[_0x3565('0x7e')]('userVoiceQueue:remove',{'UserId':_0x254a09,'VoiceQueueId':_0x1ca727['id']});});});});});});})[_0x3565('0x27')](respondWithStatusCode(_0x4da9a6,null))[_0x3565('0x51')](handleError(_0x4da9a6,null));};exports[_0x3565('0x93')]=function(_0x112121,_0x36da0f,_0x54bcd2){var _0x1cf473,_0x5b2f86;return db[_0x3565('0x39')][_0x3565('0x32')]({'where':{'id':_0x112121['params']['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x36da0f,null))[_0x3565('0x27')](function(_0xb9b96){if(_0xb9b96){_0x5b2f86=_0xb9b96;return _0xb9b96['addAgents'](_0x112121[_0x3565('0x55')][_0x3565('0x94')],_['omit'](_0x112121['body'],[_0x3565('0x94'),'id'])||{})['spread'](function(_0x566363){for(var _0x3ccd71=0x0;_0x3ccd71<_0x112121['body'][_0x3565('0x94')][_0x3565('0x44')];_0x3ccd71+=0x1){socket['emit'](_0x3565('0x7f'),{'UserId':Number(_0x112121[_0x3565('0x55')][_0x3565('0x94')][_0x3ccd71]),'VoiceQueueId':Number(_0x112121[_0x3565('0x53')]['id'])});}return _0x566363;});}})[_0x3565('0x27')](function(_0x337124){_0x1cf473=_0x337124||[];if(_0x5b2f86){return db[_0x3565('0x70')][_0x3565('0x4f')]({'where':{'id':_0x112121[_0x3565('0x55')][_0x3565('0x94')]},'attributes':['id',_0x3565('0x34'),'online',_0x3565('0x73'),'interface'],'raw':!![]});}})[_0x3565('0x27')](function(_0x494217){if(!_[_0x3565('0x91')](_0x494217)){var _0x10e62a=[];for(var _0x33f1de=0x0;_0x33f1de<_0x494217['length'];_0x33f1de++){if(_0x494217[_0x33f1de]['online']){_0x10e62a['push'](db[_0x3565('0x7b')][_0x3565('0x95')]({'membername':_0x494217[_0x33f1de][_0x3565('0x34')],'UserId':_0x494217[_0x33f1de]['id'],'queue_name':_0x5b2f86['name'],'VoiceQueueId':_0x5b2f86['id'],'interface':_['isNil'](_0x494217[_0x33f1de]['interface'])?util[_0x3565('0x7c')](_0x3565('0x7d'),_0x494217[_0x33f1de]['name']):_0x494217[_0x33f1de][_0x3565('0x74')],'paused':_0x494217[_0x33f1de]['voicePause']||![],'penalty':_0x112121[_0x3565('0x55')]['penalty']||0x0}));}}return BPromise[_0x3565('0x8d')](_0x10e62a);}})[_0x3565('0x27')](function(){return _0x1cf473;})[_0x3565('0x27')](respondWithResult(_0x36da0f,null))['catch'](handleError(_0x36da0f,null));};exports[_0x3565('0x92')]=function(_0x44fde2,_0x41df43,_0xfc38e0){return db[_0x3565('0x39')]['find']({'where':{'id':_0x44fde2[_0x3565('0x53')]['id']}})['then'](handleEntityNotFound(_0x41df43,null))[_0x3565('0x27')](function(_0x5372e5){if(_0x5372e5){return _0x5372e5[_0x3565('0x92')](_0x44fde2['query'][_0x3565('0x94')])[_0x3565('0x27')](function(){if(_[_0x3565('0x96')](_0x44fde2['query']['ids'])){for(var _0x1e3f82=0x0;_0x1e3f82<_0x44fde2[_0x3565('0x3d')]['ids']['length'];_0x1e3f82+=0x1){socket[_0x3565('0x7e')](_0x3565('0x97'),{'UserId':Number(_0x44fde2[_0x3565('0x3d')]['ids'][_0x1e3f82]),'VoiceQueueId':Number(_0x44fde2[_0x3565('0x53')]['id'])});}}else{socket['emit'](_0x3565('0x97'),{'UserId':Number(_0x44fde2[_0x3565('0x3d')][_0x3565('0x94')]),'VoiceQueueId':Number(_0x44fde2['params']['id'])});}});}})[_0x3565('0x27')](function(_0x1d22b3){return db[_0x3565('0x7b')][_0x3565('0x28')]({'where':{'VoiceQueueId':_0x44fde2[_0x3565('0x53')]['id'],'UserId':_0x44fde2[_0x3565('0x3d')][_0x3565('0x94')]}})['then'](function(){return _0x1d22b3;});})['then'](respondWithStatusCode(_0x41df43,null))['catch'](handleError(_0x41df43,null));};exports['getAgents']=function(_0x2d3de2,_0x1f6faf,_0x2cff18){var _0x2b4f36={};var _0x97e9dd={};var _0xb893de;var _0xf352b1;return db[_0x3565('0x39')][_0x3565('0x63')]({'where':{'id':_0x2d3de2[_0x3565('0x53')]['id']}})['then'](handleEntityNotFound(_0x1f6faf,null))['then'](function(_0x318e28){if(_0x318e28){_0xb893de=_0x318e28;_0x97e9dd[_0x3565('0x41')]=_[_0x3565('0x3e')](db[_0x3565('0x70')][_0x3565('0x3a')]);_0x97e9dd['query']=_['keys'](_0x2d3de2[_0x3565('0x3d')]);_0x97e9dd['filters']=_[_0x3565('0x40')](_0x97e9dd[_0x3565('0x41')],_0x97e9dd[_0x3565('0x3d')]);_0x2b4f36[_0x3565('0x42')]=_['intersection'](_0x97e9dd['model'],qs['fields'](_0x2d3de2[_0x3565('0x3d')][_0x3565('0x43')]));_0x2b4f36[_0x3565('0x42')]=_0x2b4f36['attributes'][_0x3565('0x44')]?_0x2b4f36[_0x3565('0x42')]:_0x97e9dd['model'];_0x2b4f36['order']=qs[_0x3565('0x48')](_0x2d3de2[_0x3565('0x3d')][_0x3565('0x48')]);_0x2b4f36[_0x3565('0x49')]=qs[_0x3565('0x3f')](_['pick'](_0x2d3de2['query'],_0x97e9dd[_0x3565('0x3f')]));if(_0x2d3de2[_0x3565('0x3d')]['filter']){_0x2b4f36[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x2b4f36[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x2b4f36['attributes'],function(_0x399676){var _0x472115={};_0x472115[_0x399676]={'$like':'%'+_0x2d3de2[_0x3565('0x3d')][_0x3565('0x2d')]+'%'};return _0x472115;})});}_0x2b4f36=_[_0x3565('0x4a')]({},_0x2b4f36,_0x2d3de2['options']);return _0xb893de[_0x3565('0x98')](_0x2b4f36);}})[_0x3565('0x27')](function(_0x40c292){if(_0x40c292){_0xf352b1=_0x40c292[_0x3565('0x44')];if(!_0x2d3de2[_0x3565('0x3d')][_0x3565('0x64')](_0x3565('0x45'))){_0x2b4f36['limit']=qs[_0x3565('0x46')](_0x2d3de2['query'][_0x3565('0x46')]);_0x2b4f36[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x2d3de2[_0x3565('0x3d')][_0x3565('0x22')]);}return _0xb893de[_0x3565('0x98')](_0x2b4f36);}})['then'](function(_0x25f79a){if(_0x25f79a){return _0x25f79a?{'count':_0xf352b1,'rows':_0x25f79a}:null;}})['then'](respondWithResult(_0x1f6faf,null))[_0x3565('0x51')](handleError(_0x1f6faf,null));};exports[_0x3565('0x99')]=function(_0x1b3b65,_0xd29aa3,_0x569bd2){var _0x354a79={};var _0x14abf1={};var _0x4ab1c6;var _0x5b1c19;return db[_0x3565('0x39')][_0x3565('0x63')]({'where':{'id':_0x1b3b65['params']['id']}})[_0x3565('0x27')](handleEntityNotFound(_0xd29aa3,null))[_0x3565('0x27')](function(_0x1b62ca){if(_0x1b62ca){_0x4ab1c6=_0x1b62ca;_0x14abf1[_0x3565('0x41')]=_[_0x3565('0x3e')](db[_0x3565('0x7b')][_0x3565('0x3a')]);_0x14abf1[_0x3565('0x3d')]=_[_0x3565('0x3e')](_0x1b3b65['query']);_0x14abf1[_0x3565('0x3f')]=_[_0x3565('0x40')](_0x14abf1['model'],_0x14abf1['query']);_0x354a79[_0x3565('0x42')]=_[_0x3565('0x40')](_0x14abf1[_0x3565('0x41')],qs[_0x3565('0x43')](_0x1b3b65[_0x3565('0x3d')][_0x3565('0x43')]));_0x354a79['attributes']=_0x354a79['attributes'][_0x3565('0x44')]?_0x354a79['attributes']:_0x14abf1[_0x3565('0x41')];_0x354a79[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x1b3b65[_0x3565('0x3d')][_0x3565('0x48')]);_0x354a79['where']=qs[_0x3565('0x3f')](_[_0x3565('0x6a')](_0x1b3b65['query'],_0x14abf1['filters']));if(_0x1b3b65['query'][_0x3565('0x2d')]){_0x354a79[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x354a79[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x354a79['attributes'],function(_0x4fe422){var _0x296a8b={};_0x296a8b[_0x4fe422]={'$like':'%'+_0x1b3b65[_0x3565('0x3d')]['filter']+'%'};return _0x296a8b;})});}_0x354a79=_[_0x3565('0x4a')]({},_0x354a79,_0x1b3b65[_0x3565('0x4c')]);return _0x4ab1c6[_0x3565('0x99')](_0x354a79);}})[_0x3565('0x27')](function(_0x5678d6){if(_0x5678d6){_0x5b1c19=_0x5678d6['length'];if(!_0x1b3b65[_0x3565('0x3d')][_0x3565('0x64')](_0x3565('0x45'))){_0x354a79['limit']=qs[_0x3565('0x46')](_0x1b3b65['query'][_0x3565('0x46')]);_0x354a79[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x1b3b65['query']['offset']);}return _0x4ab1c6[_0x3565('0x99')](_0x354a79);}})['then'](function(_0x37b75d){return _0x37b75d?{'count':_0x5b1c19,'rows':_0x37b75d}:null;})[_0x3565('0x27')](respondWithResult(_0xd29aa3,null))[_0x3565('0x51')](handleError(_0xd29aa3,null));};exports[_0x3565('0x9a')]=function(_0x24aed5,_0x36d4ee,_0x4de3f8){var _0x306096={};var _0x5c6b7b={};var _0x2caa81;var _0x4f8270;return db[_0x3565('0x39')]['findOne']({'where':{'id':_0x24aed5[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x36d4ee,null))[_0x3565('0x27')](function(_0x298541){if(_0x298541){_0x2caa81=_0x298541;_0x5c6b7b[_0x3565('0x41')]=_['keys'](db[_0x3565('0x9b')][_0x3565('0x3a')]);_0x5c6b7b['query']=_[_0x3565('0x3e')](_0x24aed5[_0x3565('0x3d')]);_0x5c6b7b[_0x3565('0x3f')]=_[_0x3565('0x40')](_0x5c6b7b[_0x3565('0x41')],_0x5c6b7b[_0x3565('0x3d')]);_0x306096['attributes']=_['intersection'](_0x5c6b7b[_0x3565('0x41')],qs[_0x3565('0x43')](_0x24aed5[_0x3565('0x3d')][_0x3565('0x43')]));_0x306096[_0x3565('0x42')]=_0x306096['attributes'][_0x3565('0x44')]?_0x306096[_0x3565('0x42')]:_0x5c6b7b[_0x3565('0x41')];_0x306096[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x24aed5[_0x3565('0x3d')]['sort']);_0x306096['where']=qs['filters'](_['pick'](_0x24aed5[_0x3565('0x3d')],_0x5c6b7b[_0x3565('0x3f')]));if(_0x24aed5[_0x3565('0x3d')][_0x3565('0x2d')]){_0x306096[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x306096['where'],{'$or':_[_0x3565('0x2f')](_0x306096[_0x3565('0x42')],function(_0xdb2c96){var _0x40ec67={};_0x40ec67[_0xdb2c96]={'$like':'%'+_0x24aed5[_0x3565('0x3d')][_0x3565('0x2d')]+'%'};return _0x40ec67;})});}_0x306096=_[_0x3565('0x4a')]({},_0x306096,_0x24aed5[_0x3565('0x4c')]);return _0x2caa81[_0x3565('0x9a')](_0x306096);}})[_0x3565('0x27')](function(_0x491256){if(_0x491256){_0x4f8270=_0x491256[_0x3565('0x44')];if(!_0x24aed5[_0x3565('0x3d')][_0x3565('0x64')](_0x3565('0x45'))){_0x306096[_0x3565('0x46')]=qs['limit'](_0x24aed5['query']['limit']);_0x306096[_0x3565('0x22')]=qs['offset'](_0x24aed5['query'][_0x3565('0x22')]);}return _0x2caa81['getLists'](_0x306096);}})[_0x3565('0x27')](function(_0x4f2d75){if(_0x4f2d75){return _0x4f2d75?{'count':_0x4f8270,'rows':_0x4f2d75}:null;}})[_0x3565('0x27')](respondWithResult(_0x36d4ee,null))[_0x3565('0x51')](handleError(_0x36d4ee,null));};exports[_0x3565('0x9c')]=function(_0x3c525d,_0x24506c,_0x14981c){var _0x513e4d,_0x6c53ac;return db['VoiceQueue'][_0x3565('0x32')]({'where':{'id':_0x3c525d['params']['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x24506c,null))[_0x3565('0x27')](function(_0x2f134b){if(_0x2f134b){_0x6c53ac=_0x2f134b;return _0x2f134b[_0x3565('0x9c')](_0x3c525d[_0x3565('0x55')]['ids'],_[_0x3565('0x5e')](_0x3c525d[_0x3565('0x55')],[_0x3565('0x94'),'id'])||{});}return null;})['spread'](function(_0x3b759f){var _0x8ddcc5;_0x513e4d=_0x3b759f||[];var _0x4504f0=[];if(_0x3b759f){for(var _0x4da92d=0x0;_0x4da92d<_0x3b759f[_0x3565('0x44')];_0x4da92d+=0x1){var _0x4fd561=_0x3b759f[_0x4da92d]['get']({'plain':!![]});_0x6c53ac[_0x3565('0x9d')]=_0x3c525d['body']['dialCheckDuplicateType']?_0x3c525d[_0x3565('0x55')][_0x3565('0x9d')]:_0x6c53ac['dialCheckDuplicateType'];switch(_0x6c53ac[_0x3565('0x9d')]){case _0x3565('0x9e'):_0x8ddcc5=squel['insert']()[_0x3565('0x9f')]('cm_hopper')[_0x3565('0xa0')]([_0x3565('0xa1'),_0x3565('0xa2'),_0x3565('0xa3'),'ListId',_0x3565('0x65'),_0x3565('0x5d'),_0x3565('0x5f')],squel[_0x3565('0xa4')]()[_0x3565('0xa5')](_0x3565('0xa1'),_0x3565('0xa1'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0xa2'))[_0x3565('0xa5')]('id',_0x3565('0xa3'))[_0x3565('0xa5')](_0x4fd561[_0x3565('0xa7')][_0x3565('0xa8')](),_0x3565('0xa9'))[_0x3565('0xa5')](_0x3c525d[_0x3565('0x53')]['id'][_0x3565('0xa8')](),_0x3565('0x65'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0x5d'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0x5f'))[_0x3565('0x81')](_0x3565('0xaa'))[_0x3565('0x49')]('deletedAt\x20IS\x20NULL')['where'](_0x3565('0xab'),_0x4fd561[_0x3565('0xa7')][_0x3565('0xa8')]())[_0x3565('0x49')](_0x3565('0xac'))['where'](_0x3565('0xad'),squel['select']()[_0x3565('0xa5')]('COALESCE(calleridnum,\x27\x27)')[_0x3565('0x81')](_0x3565('0xae'))[_0x3565('0x49')](_0x3565('0x86'),_0x3c525d[_0x3565('0x53')]['id'][_0x3565('0xa8')]()))['where'](_0x3565('0xad'),squel['select']()[_0x3565('0xa5')](_0x3565('0xaf'))[_0x3565('0x81')](_0x3565('0xb0'))[_0x3565('0x49')]('VoiceQueueId\x20=\x20?',_0x3c525d[_0x3565('0x53')]['id'][_0x3565('0xa8')]())))['toString']();break;case _0x3565('0xb1'):_0x8ddcc5=squel[_0x3565('0xb2')]()[_0x3565('0x9f')](_0x3565('0xb0'))['fromQuery']([_0x3565('0xa1'),_0x3565('0xa2'),_0x3565('0xa3'),_0x3565('0xa9'),_0x3565('0x65'),'createdAt','updatedAt'],squel[_0x3565('0xa4')]()[_0x3565('0xa5')](_0x3565('0xa1'),_0x3565('0xa1'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0xa2'))['field']('id',_0x3565('0xa3'))[_0x3565('0xa5')](_0x4fd561[_0x3565('0xa7')][_0x3565('0xa8')](),_0x3565('0xa9'))[_0x3565('0xa5')](_0x3c525d['params']['id'][_0x3565('0xa8')](),_0x3565('0x65'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0x5d'))['field'](_0x3565('0xa6'),_0x3565('0x5f'))[_0x3565('0x81')](_0x3565('0xaa'))[_0x3565('0x49')](_0x3565('0xb3'))[_0x3565('0x49')](_0x3565('0xab'),_0x4fd561[_0x3565('0xa7')][_0x3565('0xa8')]())[_0x3565('0x49')](_0x3565('0xac'))[_0x3565('0x49')](_0x3565('0xad'),squel[_0x3565('0xa4')]()['field'](_0x3565('0xaf'))['from']('cm_hopper')[_0x3565('0x49')](_0x3565('0x86'),_0x3c525d[_0x3565('0x53')]['id'][_0x3565('0xa8')]())))[_0x3565('0xa8')]();break;default:_0x8ddcc5=squel['insert']()['into'](_0x3565('0xb0'))[_0x3565('0xa0')]([_0x3565('0xa1'),'scheduledAt','ContactId',_0x3565('0xa9'),'VoiceQueueId',_0x3565('0x5d'),'updatedAt'],squel['select']()[_0x3565('0xa5')](_0x3565('0xa1'),_0x3565('0xa1'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0xa2'))[_0x3565('0xa5')]('id',_0x3565('0xa3'))[_0x3565('0xa5')](_0x4fd561['CmListId'][_0x3565('0xa8')](),_0x3565('0xa9'))['field'](_0x3c525d[_0x3565('0x53')]['id']['toString'](),_0x3565('0x65'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0x5d'))['field'](_0x3565('0xa6'),_0x3565('0x5f'))[_0x3565('0x81')](_0x3565('0xaa'))['where'](_0x3565('0xb3'))[_0x3565('0x49')](_0x3565('0xab'),_0x4fd561[_0x3565('0xa7')][_0x3565('0xa8')]())[_0x3565('0x49')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x4504f0[_0x3565('0x88')](db[_0x3565('0x78')][_0x3565('0x3d')](_0x8ddcc5));}return BPromise['all'](_0x4504f0);}})[_0x3565('0x27')](function(){return _0x513e4d;})[_0x3565('0x27')](respondWithResult(_0x24506c,null))[_0x3565('0x51')](handleError(_0x24506c,null));};exports[_0x3565('0xb4')]=function(_0x1326e6,_0x17c735,_0x4fcd51){return db[_0x3565('0x39')]['find']({'where':{'id':_0x1326e6[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x17c735,null))['then'](function(_0x1fc8ac){if(_0x1fc8ac){return _0x1fc8ac[_0x3565('0xb4')](_0x1326e6[_0x3565('0x3d')]['ids']);}})['then'](function(_0x16e38e){if(_0x16e38e){return db[_0x3565('0x66')][_0x3565('0x28')]({'where':{'ListId':_0x1326e6[_0x3565('0x3d')][_0x3565('0x94')],'VoiceQueueId':_0x1326e6[_0x3565('0x53')]['id']}})[_0x3565('0x27')](function(){return _0x16e38e;});}})[_0x3565('0x27')](respondWithStatusCode(_0x17c735,null))['catch'](handleError(_0x17c735,null));};exports[_0x3565('0xb5')]=function(_0x4c50d4,_0x2f16ce,_0x2e1114){var _0x5e713a={};var _0x5e8f26={};var _0x1edf34;var _0x333132;return db['VoiceQueue'][_0x3565('0x63')]({'where':{'id':_0x4c50d4[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x2f16ce,null))[_0x3565('0x27')](function(_0x5f0c34){if(_0x5f0c34){_0x1edf34=_0x5f0c34;_0x5e8f26[_0x3565('0x41')]=_[_0x3565('0x3e')](db[_0x3565('0x9b')][_0x3565('0x3a')]);_0x5e8f26[_0x3565('0x3d')]=_['keys'](_0x4c50d4[_0x3565('0x3d')]);_0x5e8f26[_0x3565('0x3f')]=_[_0x3565('0x40')](_0x5e8f26['model'],_0x5e8f26[_0x3565('0x3d')]);_0x5e713a[_0x3565('0x42')]=_[_0x3565('0x40')](_0x5e8f26[_0x3565('0x41')],qs[_0x3565('0x43')](_0x4c50d4[_0x3565('0x3d')][_0x3565('0x43')]));_0x5e713a[_0x3565('0x42')]=_0x5e713a[_0x3565('0x42')]['length']?_0x5e713a[_0x3565('0x42')]:_0x5e8f26[_0x3565('0x41')];_0x5e713a[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x4c50d4[_0x3565('0x3d')][_0x3565('0x48')]);_0x5e713a['where']=qs['filters'](_[_0x3565('0x6a')](_0x4c50d4[_0x3565('0x3d')],_0x5e8f26['filters']));if(_0x4c50d4[_0x3565('0x3d')][_0x3565('0x2d')]){_0x5e713a[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x5e713a[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x5e713a[_0x3565('0x42')],function(_0x3705b9){var _0x250b97={};_0x250b97[_0x3705b9]={'$like':'%'+_0x4c50d4[_0x3565('0x3d')][_0x3565('0x2d')]+'%'};return _0x250b97;})});}_0x5e713a=_[_0x3565('0x4a')]({},_0x5e713a,_0x4c50d4[_0x3565('0x4c')]);return _0x1edf34[_0x3565('0xb5')](_0x5e713a);}})[_0x3565('0x27')](function(_0x550aab){if(_0x550aab){_0x333132=_0x550aab[_0x3565('0x44')];if(!_0x4c50d4[_0x3565('0x3d')][_0x3565('0x64')](_0x3565('0x45'))){_0x5e713a[_0x3565('0x46')]=qs[_0x3565('0x46')](_0x4c50d4[_0x3565('0x3d')]['limit']);_0x5e713a['offset']=qs['offset'](_0x4c50d4['query'][_0x3565('0x22')]);}return _0x1edf34[_0x3565('0xb5')](_0x5e713a);}})[_0x3565('0x27')](function(_0x20618c){if(_0x20618c){return _0x20618c?{'count':_0x333132,'rows':_0x20618c}:null;}})[_0x3565('0x27')](respondWithResult(_0x2f16ce,null))[_0x3565('0x51')](handleError(_0x2f16ce,null));};exports[_0x3565('0xb6')]=function(_0x2218e8,_0x23bd5f,_0x17dcbf){var _0x30b080,_0xdbb9b7;return db[_0x3565('0x39')][_0x3565('0x32')]({'where':{'id':_0x2218e8[_0x3565('0x53')]['id']}})['then'](handleEntityNotFound(_0x23bd5f,null))[_0x3565('0x27')](function(_0x229efb){if(_0x229efb){_0xdbb9b7=_0x229efb;return _0x229efb[_0x3565('0xb6')](_0x2218e8[_0x3565('0x55')][_0x3565('0x94')],_[_0x3565('0x5e')](_0x2218e8[_0x3565('0x55')],[_0x3565('0x94'),'id'])||{});}return null;})[_0x3565('0xb7')](function(_0x4a8a03){var _0xd4e74d;_0x30b080=_0x4a8a03||[];var _0x2022fc=[];if(_0x4a8a03){for(var _0x17a1cd=0x0;_0x17a1cd<_0x4a8a03['length'];_0x17a1cd+=0x1){var _0x34805d=_0x4a8a03[_0x17a1cd]['get']({'plain':!![]});_0xd4e74d=squel[_0x3565('0xb2')]()[_0x3565('0x9f')](_0x3565('0xb8'))['fromQuery']([_0x3565('0xa1'),_0x3565('0xa3'),_0x3565('0xa9'),_0x3565('0x65'),_0x3565('0x5d'),_0x3565('0x5f')],squel['select']()[_0x3565('0xa5')](_0x3565('0xa1'),_0x3565('0xa1'))['field']('id',_0x3565('0xa3'))[_0x3565('0xa5')](_0x34805d[_0x3565('0xa7')][_0x3565('0xa8')](),'ListId')['field'](_0x2218e8[_0x3565('0x53')]['id'][_0x3565('0xa8')](),_0x3565('0x65'))[_0x3565('0xa5')]('NOW()','createdAt')[_0x3565('0xa5')]('NOW()',_0x3565('0x5f'))[_0x3565('0x81')]('cm_contacts')[_0x3565('0x49')](_0x3565('0xb3'))[_0x3565('0x49')](_0x3565('0xab'),_0x34805d['CmListId']['toString']())[_0x3565('0x49')](_0x3565('0xac')))[_0x3565('0xa8')]();_0x2022fc[_0x3565('0x88')](db[_0x3565('0x78')]['query'](_0xd4e74d));}return BPromise[_0x3565('0x8d')](_0x2022fc);}})[_0x3565('0x27')](function(){return _0x30b080;})[_0x3565('0x27')](respondWithResult(_0x23bd5f,null))[_0x3565('0x51')](handleError(_0x23bd5f,null));};exports[_0x3565('0xb9')]=function(_0x2a5d89,_0x1f2b0a,_0x110dad){return db[_0x3565('0x39')]['find']({'where':{'id':_0x2a5d89[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x1f2b0a,null))[_0x3565('0x27')](function(_0x470b0d){if(_0x470b0d){return _0x470b0d['removeBlackLists'](_0x2a5d89['query'][_0x3565('0x94')]);}})[_0x3565('0x27')](function(_0x507333){if(_0x507333){return db[_0x3565('0x6c')][_0x3565('0x28')]({'where':{'ListId':_0x2a5d89[_0x3565('0x3d')][_0x3565('0x94')],'VoiceQueueId':_0x2a5d89['params']['id']}})['then'](function(){return _0x507333;});}})[_0x3565('0x27')](respondWithStatusCode(_0x1f2b0a,null))[_0x3565('0x51')](handleError(_0x1f2b0a,null));};
\ No newline at end of file
+var _0x5d41=['NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','CmListId','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','inbound','QueueCampaigns','outbound','filter','value','includes','type','find','name','UserProfileResource','stack','send','index','map','VoiceQueue','fieldName','key','model','query','filters','attributes','intersection','fields','length','nolimit','sort','pick','where','merge','options','include','findAll','rows','catch','show','rawAttributes','keys','includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','createdAt','updatedAt','params','destroy','getHoppers','findOne','CmHopper','order','VoiceQueueId','getHopperHistories','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','forEach','penalty','Agents','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','isEmpty','userVoiceQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId'];(function(_0x4bd071,_0x4c0dc5){var _0x480b6c=function(_0x404bfd){while(--_0x404bfd){_0x4bd071['push'](_0x4bd071['shift']());}};_0x480b6c(++_0x4c0dc5);}(_0x5d41,0xd1));var _0x15d4=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x5d41[_0x46f1a6];return _0x38429a;};'use strict';var emlformat=require(_0x15d4('0x0'));var rimraf=require(_0x15d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15d4('0x2'));var rp=require('request-promise');var moment=require(_0x15d4('0x3'));var BPromise=require(_0x15d4('0x4'));var Mustache=require(_0x15d4('0x5'));var util=require(_0x15d4('0x6'));var path=require(_0x15d4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x15d4('0x8'));var fs=require('fs');var fs_extra=require(_0x15d4('0x9'));var _=require(_0x15d4('0xa'));var squel=require(_0x15d4('0xb'));var crypto=require(_0x15d4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x15d4('0xd'));var toCsv=require(_0x15d4('0xe'));var querystring=require(_0x15d4('0xf'));var Papa=require(_0x15d4('0x10'));var Redis=require('ioredis');var authService=require(_0x15d4('0x11'));var qs=require(_0x15d4('0x12'));var as=require(_0x15d4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15d4('0x14'))(_0x15d4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x15d4('0x16'));var db=require(_0x15d4('0x17'))['db'];config[_0x15d4('0x18')]=_[_0x15d4('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x15d4('0x1a'))(new Redis(config[_0x15d4('0x18')]));require(_0x15d4('0x1b'))[_0x15d4('0x1c')](socket);function respondWithStatusCode(_0x383a0e,_0x31b071){_0x31b071=_0x31b071||0xcc;return function(_0x67d094){if(_0x67d094){return _0x383a0e[_0x15d4('0x1d')](_0x31b071);}return _0x383a0e[_0x15d4('0x1e')](_0x31b071)[_0x15d4('0x1f')]();};}function respondWithResult(_0x3cc664,_0x261b3f){_0x261b3f=_0x261b3f||0xc8;return function(_0x49b75a){if(_0x49b75a){return _0x3cc664[_0x15d4('0x1e')](_0x261b3f)[_0x15d4('0x20')](_0x49b75a);}};}function respondWithFilteredResult(_0x413ea5,_0x3b519b){return function(_0x1cc9c9){if(_0x1cc9c9){var _0x2417f9=typeof _0x3b519b[_0x15d4('0x21')]===_0x15d4('0x22')&&typeof _0x3b519b[_0x15d4('0x23')]==='undefined';var _0x15a103=_0x1cc9c9['count'];var _0x3e6b46=_0x2417f9?0x0:_0x3b519b[_0x15d4('0x21')];var _0x403443=_0x2417f9?_0x1cc9c9[_0x15d4('0x24')]:_0x3b519b['offset']+_0x3b519b['limit'];var _0x3e787f;if(_0x403443>=_0x15a103){_0x403443=_0x15a103;_0x3e787f=0xc8;}else{_0x3e787f=0xce;}_0x413ea5[_0x15d4('0x1e')](_0x3e787f);return _0x413ea5[_0x15d4('0x25')](_0x15d4('0x26'),_0x3e6b46+'-'+_0x403443+'/'+_0x15a103)[_0x15d4('0x20')](_0x1cc9c9);}return null;};}function patchUpdates(_0x30dcf0){return function(_0x2d603e){try{jsonpatch[_0x15d4('0x27')](_0x2d603e,_0x30dcf0,!![]);}catch(_0x3b5140){return BPromise[_0x15d4('0x28')](_0x3b5140);}return _0x2d603e[_0x15d4('0x29')]();};}function saveUpdates(_0x176de6,_0x106cca){return function(_0x107324){if(_0x107324){return _0x107324[_0x15d4('0x2a')](_0x176de6)[_0x15d4('0x2b')](function(_0x27e9c5){return _0x27e9c5;});}return null;};}function removeEntity(_0x324480,_0x517e70){return function(_0x4351a7){if(_0x4351a7){return _0x4351a7['destroy']()[_0x15d4('0x2b')](function(){var _0x12eb30=_0x4351a7['get']({'plain':!![]});var _0x40f2c0=[{'name':'VoiceQueues','value':_0x15d4('0x2c'),'ignore':![]},{'name':_0x15d4('0x2d'),'value':_0x15d4('0x2e'),'ignore':![]}];var _0x450c14=_(_0x40f2c0)[_0x15d4('0x2f')]('ignore')['map']('value')[_0x15d4('0x30')]();if(_[_0x15d4('0x31')](_0x450c14,_0x12eb30[_0x15d4('0x32')])){return;}var _0x526ee0=_[_0x15d4('0x33')](_0x40f2c0,[_0x15d4('0x30'),_0x12eb30[_0x15d4('0x32')]])[_0x15d4('0x34')];return db[_0x15d4('0x35')]['destroy']({'where':{'type':_0x526ee0,'resourceId':_0x12eb30['id']}})[_0x15d4('0x2b')](function(){return _0x4351a7;});})['then'](function(){_0x324480[_0x15d4('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43fe15,_0x1e168d){return function(_0x5c968b){if(!_0x5c968b){_0x43fe15['sendStatus'](0x194);}return _0x5c968b;};}function handleError(_0x5d3338,_0x56da13){_0x56da13=_0x56da13||0x1f4;return function(_0x41a1e4){logger['error'](_0x41a1e4[_0x15d4('0x36')]);if(_0x41a1e4[_0x15d4('0x34')]){delete _0x41a1e4[_0x15d4('0x34')];}_0x5d3338[_0x15d4('0x1e')](_0x56da13)[_0x15d4('0x37')](_0x41a1e4);};}exports[_0x15d4('0x38')]=function(_0x45f65f,_0x2429aa){var _0x4bc8b0={},_0x576f88={},_0xedd787={'count':0x0,'rows':[]};var _0x541f96=_[_0x15d4('0x39')](db[_0x15d4('0x3a')]['rawAttributes'],function(_0x56cf63){return{'name':_0x56cf63[_0x15d4('0x3b')],'type':_0x56cf63[_0x15d4('0x32')][_0x15d4('0x3c')]};});_0x576f88[_0x15d4('0x3d')]=_['map'](_0x541f96,_0x15d4('0x34'));_0x576f88[_0x15d4('0x3e')]=_['keys'](_0x45f65f['query']);_0x576f88[_0x15d4('0x3f')]=_['intersection'](_0x576f88[_0x15d4('0x3d')],_0x576f88[_0x15d4('0x3e')]);_0x4bc8b0[_0x15d4('0x40')]=_[_0x15d4('0x41')](_0x576f88[_0x15d4('0x3d')],qs[_0x15d4('0x42')](_0x45f65f[_0x15d4('0x3e')][_0x15d4('0x42')]));_0x4bc8b0['attributes']=_0x4bc8b0[_0x15d4('0x40')][_0x15d4('0x43')]?_0x4bc8b0[_0x15d4('0x40')]:_0x576f88[_0x15d4('0x3d')];if(!_0x45f65f[_0x15d4('0x3e')]['hasOwnProperty'](_0x15d4('0x44'))){_0x4bc8b0['limit']=qs['limit'](_0x45f65f[_0x15d4('0x3e')][_0x15d4('0x23')]);_0x4bc8b0[_0x15d4('0x21')]=qs[_0x15d4('0x21')](_0x45f65f[_0x15d4('0x3e')][_0x15d4('0x21')]);}_0x4bc8b0['order']=qs[_0x15d4('0x45')](_0x45f65f[_0x15d4('0x3e')]['sort']);_0x4bc8b0['where']=qs[_0x15d4('0x3f')](_[_0x15d4('0x46')](_0x45f65f['query'],_0x576f88[_0x15d4('0x3f')]),_0x541f96);if(_0x45f65f[_0x15d4('0x3e')]['filter']){_0x4bc8b0[_0x15d4('0x47')]=_[_0x15d4('0x48')](_0x4bc8b0[_0x15d4('0x47')],{'$or':_[_0x15d4('0x39')](_0x541f96,function(_0x4b1bc7){if(_0x4b1bc7[_0x15d4('0x32')]!=='VIRTUAL'){var _0x24176a={};_0x24176a[_0x4b1bc7[_0x15d4('0x34')]]={'$like':'%'+_0x45f65f['query']['filter']+'%'};return _0x24176a;}})});}_0x4bc8b0=_[_0x15d4('0x48')]({},_0x4bc8b0,_0x45f65f[_0x15d4('0x49')]);var _0x117fa8={'where':_0x4bc8b0[_0x15d4('0x47')]};return db[_0x15d4('0x3a')][_0x15d4('0x24')](_0x117fa8)[_0x15d4('0x2b')](function(_0x24f152){_0xedd787[_0x15d4('0x24')]=_0x24f152;if(_0x45f65f['query']['includeAll']){_0x4bc8b0[_0x15d4('0x4a')]=[{'all':!![]}];}return db[_0x15d4('0x3a')][_0x15d4('0x4b')](_0x4bc8b0);})[_0x15d4('0x2b')](function(_0x2210b4){_0xedd787[_0x15d4('0x4c')]=_0x2210b4;return _0xedd787;})[_0x15d4('0x2b')](respondWithFilteredResult(_0x2429aa,_0x4bc8b0))[_0x15d4('0x4d')](handleError(_0x2429aa,null));};exports[_0x15d4('0x4e')]=function(_0x3c8ada,_0x2da82d){var _0x43bbc0={'raw':![],'where':{'id':_0x3c8ada['params']['id']}},_0x74b068={};_0x74b068[_0x15d4('0x3d')]=_['keys'](db[_0x15d4('0x3a')][_0x15d4('0x4f')]);_0x74b068[_0x15d4('0x3e')]=_[_0x15d4('0x50')](_0x3c8ada[_0x15d4('0x3e')]);_0x74b068['filters']=_['intersection'](_0x74b068[_0x15d4('0x3d')],_0x74b068[_0x15d4('0x3e')]);_0x43bbc0[_0x15d4('0x40')]=_['intersection'](_0x74b068['model'],qs[_0x15d4('0x42')](_0x3c8ada[_0x15d4('0x3e')][_0x15d4('0x42')]));_0x43bbc0[_0x15d4('0x40')]=_0x43bbc0[_0x15d4('0x40')][_0x15d4('0x43')]?_0x43bbc0[_0x15d4('0x40')]:_0x74b068[_0x15d4('0x3d')];if(_0x3c8ada[_0x15d4('0x3e')][_0x15d4('0x51')]){_0x43bbc0[_0x15d4('0x4a')]=[{'all':!![]}];}_0x43bbc0=_[_0x15d4('0x48')]({},_0x43bbc0,_0x3c8ada[_0x15d4('0x49')]);return db[_0x15d4('0x3a')][_0x15d4('0x33')](_0x43bbc0)['then'](handleEntityNotFound(_0x2da82d,null))[_0x15d4('0x2b')](respondWithResult(_0x2da82d,null))[_0x15d4('0x4d')](handleError(_0x2da82d,null));};exports[_0x15d4('0x52')]=function(_0x352d0f,_0xfb14ef){return db[_0x15d4('0x3a')][_0x15d4('0x52')](_0x352d0f['body'],{})[_0x15d4('0x2b')](function(_0x588229){var _0x150a00=_0x352d0f[_0x15d4('0x53')][_0x15d4('0x54')]({'plain':!![]});if(!_0x150a00)throw new Error(_0x15d4('0x55'));if(_0x150a00[_0x15d4('0x56')]===_0x15d4('0x53')){var _0x6ed60c=_0x588229['get']({'plain':!![]});var _0x34270d=[{'name':_0x15d4('0x57'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x15d4('0x2e')}];var _0x31b79a=_['find'](_0x34270d,[_0x15d4('0x30'),_0x6ed60c[_0x15d4('0x32')]])[_0x15d4('0x34')];return db[_0x15d4('0x58')][_0x15d4('0x33')]({'where':{'name':_0x31b79a,'userProfileId':_0x150a00[_0x15d4('0x59')]},'raw':!![]})['then'](function(_0x53718e){if(_0x53718e&&_0x53718e[_0x15d4('0x5a')]===0x0){return db[_0x15d4('0x35')]['create']({'name':_0x6ed60c['name'],'resourceId':_0x6ed60c['id'],'type':_0x53718e[_0x15d4('0x34')],'sectionId':_0x53718e['id']},{})['then'](function(){return _0x588229;});}else{return _0x588229;}})['catch'](function(_0x5ef1d8){logger[_0x15d4('0x5b')](_0x15d4('0x5c'),_0x5ef1d8);throw _0x5ef1d8;});}return _0x588229;})[_0x15d4('0x2b')](respondWithResult(_0xfb14ef,0xc9))[_0x15d4('0x4d')](handleError(_0xfb14ef,null));};exports['clone']=function(_0x42f349,_0x41a099){var _0x5a35be={'where':{'id':_0x42f349['params']['id']}},_0x2270a9={};_0x2270a9[_0x15d4('0x3d')]=_['keys'](db[_0x15d4('0x3a')][_0x15d4('0x4f')]);_0x5a35be[_0x15d4('0x40')]=_[_0x15d4('0x41')](_0x2270a9[_0x15d4('0x3d')],qs['fields'](_0x42f349[_0x15d4('0x3e')][_0x15d4('0x42')]));_0x5a35be[_0x15d4('0x40')]=_0x5a35be[_0x15d4('0x40')][_0x15d4('0x43')]?_0x5a35be[_0x15d4('0x40')]:_0x2270a9[_0x15d4('0x3d')];if(_0x42f349[_0x15d4('0x3e')][_0x15d4('0x51')]){_0x5a35be[_0x15d4('0x4a')]=[{'all':!![]}];}_0x5a35be=_[_0x15d4('0x48')]({},_0x5a35be,_0x42f349[_0x15d4('0x49')]);return db[_0x15d4('0x3a')]['find'](_0x5a35be)[_0x15d4('0x2b')](handleEntityNotFound(_0x41a099,null))[_0x15d4('0x2b')](function(_0x2c7aad){if(_0x2c7aad){var _0x1e9d36=_0x2c7aad[_0x15d4('0x54')]({'plain':!![]});_0x1e9d36=qs['omit'](_0x1e9d36,['id','createdAt','updatedAt']);_0x42f349[_0x15d4('0x5d')]=_['omit'](_0x42f349[_0x15d4('0x5d')],['id',_0x15d4('0x5e'),_0x15d4('0x5f')]);return db[_0x15d4('0x3a')][_0x15d4('0x52')](_[_0x15d4('0x48')](_0x1e9d36,_0x42f349[_0x15d4('0x5d')]),{'include':_0x42f349['query'][_0x15d4('0x51')]?[{'all':!![]}]:undefined})['then'](function(_0x433cb7){var _0x4959e0=_0x42f349[_0x15d4('0x53')][_0x15d4('0x54')]({'plain':!![]});if(!_0x4959e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4959e0[_0x15d4('0x56')]===_0x15d4('0x53')){var _0x5bd94c=_0x433cb7[_0x15d4('0x54')]({'plain':!![]});var _0x4aff96=[{'name':_0x15d4('0x57'),'value':_0x15d4('0x2c')},{'name':_0x15d4('0x2d'),'value':'outbound'}];var _0x333f67=_[_0x15d4('0x33')](_0x4aff96,['value',_0x5bd94c['type']])[_0x15d4('0x34')];return db[_0x15d4('0x58')][_0x15d4('0x33')]({'where':{'name':_0x333f67,'userProfileId':_0x4959e0[_0x15d4('0x59')]},'raw':!![]})[_0x15d4('0x2b')](function(_0x1fbc0e){if(_0x1fbc0e&&_0x1fbc0e[_0x15d4('0x5a')]===0x0){return db['UserProfileResource'][_0x15d4('0x52')]({'name':_0x5bd94c[_0x15d4('0x34')],'resourceId':_0x5bd94c['id'],'type':_0x1fbc0e['name'],'sectionId':_0x1fbc0e['id']},{})['then'](function(){return _0x433cb7;});}else{return _0x433cb7;}})['catch'](function(_0x32d93b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32d93b);throw _0x32d93b;});}return _0x433cb7;});}})[_0x15d4('0x2b')](respondWithResult(_0x41a099,0xc9))[_0x15d4('0x4d')](handleError(_0x41a099,null));};exports[_0x15d4('0x2a')]=function(_0x1f9242,_0x126bdd){if(_0x1f9242['body']['id']){delete _0x1f9242['body']['id'];}return db[_0x15d4('0x3a')][_0x15d4('0x33')]({'where':{'id':_0x1f9242[_0x15d4('0x60')]['id']}})[_0x15d4('0x2b')](handleEntityNotFound(_0x126bdd,null))[_0x15d4('0x2b')](saveUpdates(_0x1f9242[_0x15d4('0x5d')],null))[_0x15d4('0x2b')](respondWithResult(_0x126bdd,null))[_0x15d4('0x4d')](handleError(_0x126bdd,null));};exports[_0x15d4('0x61')]=function(_0x3d6097,_0x3ceecd){return db['VoiceQueue']['find']({'where':{'id':_0x3d6097[_0x15d4('0x60')]['id']}})['then'](handleEntityNotFound(_0x3ceecd,null))['then'](removeEntity(_0x3ceecd,null))['catch'](handleError(_0x3ceecd,null));};exports[_0x15d4('0x62')]=function(_0x20cfe9,_0x56d27d,_0x5ba6b1){var _0x3b558d={'raw':![],'where':{}};var _0x856fa2={};var _0x5e122f={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x15d4('0x63')]({'where':{'id':_0x20cfe9['params']['id']}})[_0x15d4('0x2b')](handleEntityNotFound(_0x56d27d,null))[_0x15d4('0x2b')](function(_0x1f6b21){if(_0x1f6b21){_0x856fa2[_0x15d4('0x3d')]=_[_0x15d4('0x50')](db[_0x15d4('0x64')][_0x15d4('0x4f')]);_0x856fa2[_0x15d4('0x3e')]=_[_0x15d4('0x50')](_0x20cfe9['query']);_0x856fa2[_0x15d4('0x3f')]=_[_0x15d4('0x41')](_0x856fa2[_0x15d4('0x3d')],_0x856fa2[_0x15d4('0x3e')]);_0x3b558d[_0x15d4('0x40')]=_[_0x15d4('0x41')](_0x856fa2[_0x15d4('0x3d')],qs[_0x15d4('0x42')](_0x20cfe9['query'][_0x15d4('0x42')]));_0x3b558d[_0x15d4('0x40')]=_0x3b558d['attributes'][_0x15d4('0x43')]?_0x3b558d[_0x15d4('0x40')]:_0x856fa2[_0x15d4('0x3d')];if(!_0x20cfe9[_0x15d4('0x3e')]['hasOwnProperty']('nolimit')){_0x3b558d[_0x15d4('0x23')]=qs['limit'](_0x20cfe9[_0x15d4('0x3e')][_0x15d4('0x23')]);_0x3b558d[_0x15d4('0x21')]=qs['offset'](_0x20cfe9[_0x15d4('0x3e')][_0x15d4('0x21')]);}_0x3b558d[_0x15d4('0x65')]=qs[_0x15d4('0x45')](_0x20cfe9['query'][_0x15d4('0x45')]);_0x3b558d[_0x15d4('0x47')]=qs[_0x15d4('0x3f')](_[_0x15d4('0x46')](_0x20cfe9[_0x15d4('0x3e')],_0x856fa2['filters']));_0x3b558d[_0x15d4('0x47')][_0x15d4('0x66')]=_0x1f6b21['id'];if(_0x20cfe9['query'][_0x15d4('0x2f')]){_0x3b558d[_0x15d4('0x47')]=_[_0x15d4('0x48')](_0x3b558d[_0x15d4('0x47')],{'$or':_['map'](_0x3b558d[_0x15d4('0x40')],function(_0x1e017){var _0x5ef421={};_0x5ef421[_0x1e017]={'$like':'%'+_0x20cfe9['query'][_0x15d4('0x2f')]+'%'};return _0x5ef421;})});}_0x3b558d=_[_0x15d4('0x48')]({},_0x3b558d,_0x20cfe9['options']);return db[_0x15d4('0x64')][_0x15d4('0x24')]({'where':_0x3b558d['where']})[_0x15d4('0x2b')](function(_0x2e369f){_0x5e122f['count']=_0x2e369f;if(_0x20cfe9[_0x15d4('0x3e')][_0x15d4('0x51')]){_0x3b558d['include']=[{'all':!![]}];}return db[_0x15d4('0x64')][_0x15d4('0x4b')](_0x3b558d);})['then'](function(_0x12ae35){_0x5e122f['rows']=_0x12ae35;return _0x5e122f;});}})['then'](respondWithFilteredResult(_0x56d27d,_0x3b558d))['catch'](handleError(_0x56d27d,null));};exports[_0x15d4('0x67')]=function(_0x5bd2e0,_0x4c8610,_0x5235e2){var _0x5bac78={'raw':!![],'where':{}};var _0xf73e14={};var _0x26e171={'count':0x0,'rows':[]};return db[_0x15d4('0x3a')][_0x15d4('0x63')]({'where':{'id':_0x5bd2e0[_0x15d4('0x60')]['id']}})['then'](handleEntityNotFound(_0x4c8610,null))[_0x15d4('0x2b')](function(_0xe7694){if(_0xe7694){_0xf73e14[_0x15d4('0x3d')]=_[_0x15d4('0x50')](db[_0x15d4('0x68')]['rawAttributes']);_0xf73e14['query']=_[_0x15d4('0x50')](_0x5bd2e0['query']);_0xf73e14[_0x15d4('0x3f')]=_['intersection'](_0xf73e14[_0x15d4('0x3d')],_0xf73e14[_0x15d4('0x3e')]);_0x5bac78['attributes']=_[_0x15d4('0x41')](_0xf73e14[_0x15d4('0x3d')],qs['fields'](_0x5bd2e0['query'][_0x15d4('0x42')]));_0x5bac78[_0x15d4('0x40')]=_0x5bac78[_0x15d4('0x40')][_0x15d4('0x43')]?_0x5bac78['attributes']:_0xf73e14[_0x15d4('0x3d')];if(!_0x5bd2e0['query'][_0x15d4('0x69')](_0x15d4('0x44'))){_0x5bac78['limit']=qs['limit'](_0x5bd2e0[_0x15d4('0x3e')][_0x15d4('0x23')]);_0x5bac78[_0x15d4('0x21')]=qs['offset'](_0x5bd2e0['query']['offset']);}_0x5bac78[_0x15d4('0x65')]=qs['sort'](_0x5bd2e0['query'][_0x15d4('0x45')]);_0x5bac78[_0x15d4('0x47')]=qs[_0x15d4('0x3f')](_[_0x15d4('0x46')](_0x5bd2e0[_0x15d4('0x3e')],_0xf73e14[_0x15d4('0x3f')]));_0x5bac78[_0x15d4('0x47')][_0x15d4('0x66')]=_0xe7694['id'];if(_0x5bd2e0['query'][_0x15d4('0x2f')]){_0x5bac78[_0x15d4('0x47')]=_[_0x15d4('0x48')](_0x5bac78[_0x15d4('0x47')],{'$or':_['map'](_0x5bac78[_0x15d4('0x40')],function(_0x1eb0a3){var _0x40b30b={};_0x40b30b[_0x1eb0a3]={'$like':'%'+_0x5bd2e0[_0x15d4('0x3e')][_0x15d4('0x2f')]+'%'};return _0x40b30b;})});}_0x5bac78=_[_0x15d4('0x48')]({},_0x5bac78,_0x5bd2e0[_0x15d4('0x49')]);return db[_0x15d4('0x68')][_0x15d4('0x24')]({'where':_0x5bac78[_0x15d4('0x47')]})['then'](function(_0x340314){_0x26e171[_0x15d4('0x24')]=_0x340314;if(_0x5bd2e0[_0x15d4('0x3e')]['includeAll']){_0x5bac78['include']=[{'all':!![]}];}return db[_0x15d4('0x68')][_0x15d4('0x4b')](_0x5bac78);})[_0x15d4('0x2b')](function(_0x3e9d3e){_0x26e171[_0x15d4('0x4c')]=_0x3e9d3e;return _0x26e171;});}})[_0x15d4('0x2b')](respondWithFilteredResult(_0x4c8610,_0x5bac78))[_0x15d4('0x4d')](handleError(_0x4c8610,null));};exports[_0x15d4('0x6a')]=function(_0x2b7b94,_0xd08e47,_0x72ab77){var _0x80ffa5={'raw':!![],'where':{}};var _0x57255d={};var _0x14ceb5={'count':0x0,'rows':[]};return db[_0x15d4('0x3a')]['findOne']({'where':{'id':_0x2b7b94['params']['id']}})[_0x15d4('0x2b')](handleEntityNotFound(_0xd08e47,null))[_0x15d4('0x2b')](function(_0x25f1b9){if(_0x25f1b9){_0x57255d[_0x15d4('0x3d')]=_['keys'](db[_0x15d4('0x6b')][_0x15d4('0x4f')]);_0x57255d[_0x15d4('0x3e')]=_[_0x15d4('0x50')](_0x2b7b94['query']);_0x57255d[_0x15d4('0x3f')]=_['intersection'](_0x57255d[_0x15d4('0x3d')],_0x57255d[_0x15d4('0x3e')]);_0x80ffa5[_0x15d4('0x40')]=_[_0x15d4('0x41')](_0x57255d['model'],qs[_0x15d4('0x42')](_0x2b7b94[_0x15d4('0x3e')][_0x15d4('0x42')]));_0x80ffa5['attributes']=_0x80ffa5[_0x15d4('0x40')]['length']?_0x80ffa5[_0x15d4('0x40')]:_0x57255d['model'];if(!_0x2b7b94[_0x15d4('0x3e')][_0x15d4('0x69')](_0x15d4('0x44'))){_0x80ffa5[_0x15d4('0x23')]=qs[_0x15d4('0x23')](_0x2b7b94[_0x15d4('0x3e')][_0x15d4('0x23')]);_0x80ffa5['offset']=qs[_0x15d4('0x21')](_0x2b7b94['query'][_0x15d4('0x21')]);}_0x80ffa5['order']=qs[_0x15d4('0x45')](_0x2b7b94[_0x15d4('0x3e')]['sort']);_0x80ffa5['where']=qs[_0x15d4('0x3f')](_['pick'](_0x2b7b94['query'],_0x57255d[_0x15d4('0x3f')]));_0x80ffa5[_0x15d4('0x47')][_0x15d4('0x66')]=_0x25f1b9['id'];if(_0x2b7b94['query'][_0x15d4('0x2f')]){_0x80ffa5['where']=_[_0x15d4('0x48')](_0x80ffa5[_0x15d4('0x47')],{'$or':_['map'](_0x80ffa5['attributes'],function(_0x4ad8c3){var _0x4d1c19={};_0x4d1c19[_0x4ad8c3]={'$like':'%'+_0x2b7b94['query'][_0x15d4('0x2f')]+'%'};return _0x4d1c19;})});}_0x80ffa5=_[_0x15d4('0x48')]({},_0x80ffa5,_0x2b7b94[_0x15d4('0x49')]);return db[_0x15d4('0x6b')][_0x15d4('0x24')]({'where':_0x80ffa5[_0x15d4('0x47')]})[_0x15d4('0x2b')](function(_0x54dcb8){_0x14ceb5[_0x15d4('0x24')]=_0x54dcb8;if(_0x2b7b94[_0x15d4('0x3e')][_0x15d4('0x51')]){_0x80ffa5[_0x15d4('0x4a')]=[{'all':!![]}];}return db[_0x15d4('0x6b')][_0x15d4('0x4b')](_0x80ffa5);})[_0x15d4('0x2b')](function(_0xa88081){_0x14ceb5[_0x15d4('0x4c')]=_0xa88081;return _0x14ceb5;});}})[_0x15d4('0x2b')](respondWithFilteredResult(_0xd08e47,_0x80ffa5))[_0x15d4('0x4d')](handleError(_0xd08e47,null));};exports[_0x15d4('0x6c')]=function(_0x3915f1,_0x35ca30,_0x161c60){var _0x28cdc5={'raw':!![],'where':{}};var _0x5d2e23={};var _0x40cb3f={'count':0x0,'rows':[]};return db[_0x15d4('0x3a')][_0x15d4('0x63')]({'where':{'id':_0x3915f1[_0x15d4('0x60')]['id']}})[_0x15d4('0x2b')](handleEntityNotFound(_0x35ca30,null))[_0x15d4('0x2b')](function(_0x566740){if(_0x566740){_0x5d2e23['model']=_[_0x15d4('0x50')](db[_0x15d4('0x6d')]['rawAttributes']);_0x5d2e23[_0x15d4('0x3e')]=_[_0x15d4('0x50')](_0x3915f1[_0x15d4('0x3e')]);_0x5d2e23['filters']=_['intersection'](_0x5d2e23[_0x15d4('0x3d')],_0x5d2e23[_0x15d4('0x3e')]);_0x28cdc5[_0x15d4('0x40')]=_['intersection'](_0x5d2e23[_0x15d4('0x3d')],qs[_0x15d4('0x42')](_0x3915f1[_0x15d4('0x3e')][_0x15d4('0x42')]));_0x28cdc5[_0x15d4('0x40')]=_0x28cdc5[_0x15d4('0x40')][_0x15d4('0x43')]?_0x28cdc5['attributes']:_0x5d2e23[_0x15d4('0x3d')];if(!_0x3915f1[_0x15d4('0x3e')][_0x15d4('0x69')]('nolimit')){_0x28cdc5[_0x15d4('0x23')]=qs[_0x15d4('0x23')](_0x3915f1['query'][_0x15d4('0x23')]);_0x28cdc5[_0x15d4('0x21')]=qs['offset'](_0x3915f1[_0x15d4('0x3e')][_0x15d4('0x21')]);}_0x28cdc5['order']=qs[_0x15d4('0x45')](_0x3915f1[_0x15d4('0x3e')][_0x15d4('0x45')]);_0x28cdc5[_0x15d4('0x47')]=qs[_0x15d4('0x3f')](_['pick'](_0x3915f1['query'],_0x5d2e23['filters']));_0x28cdc5[_0x15d4('0x47')]['VoiceQueueId']=_0x566740['id'];if(_0x3915f1[_0x15d4('0x3e')][_0x15d4('0x2f')]){_0x28cdc5[_0x15d4('0x47')]=_[_0x15d4('0x48')](_0x28cdc5[_0x15d4('0x47')],{'$or':_['map'](_0x28cdc5[_0x15d4('0x40')],function(_0x5b1f91){var _0x515620={};_0x515620[_0x5b1f91]={'$like':'%'+_0x3915f1[_0x15d4('0x3e')][_0x15d4('0x2f')]+'%'};return _0x515620;})});}_0x28cdc5=_[_0x15d4('0x48')]({},_0x28cdc5,_0x3915f1[_0x15d4('0x49')]);return db[_0x15d4('0x6d')][_0x15d4('0x24')]({'where':_0x28cdc5[_0x15d4('0x47')]})[_0x15d4('0x2b')](function(_0x257c94){_0x40cb3f[_0x15d4('0x24')]=_0x257c94;if(_0x3915f1['query']['includeAll']){_0x28cdc5['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x15d4('0x4b')](_0x28cdc5);})[_0x15d4('0x2b')](function(_0x458066){_0x40cb3f['rows']=_0x458066;return _0x40cb3f;});}})[_0x15d4('0x2b')](respondWithFilteredResult(_0x35ca30,_0x28cdc5))[_0x15d4('0x4d')](handleError(_0x35ca30,null));};exports[_0x15d4('0x6e')]=function(_0x4a99d1,_0x1851dc,_0x342d90){var _0x33b920={};var _0x181989={};var _0x15b732;var _0x1af226;return db['VoiceQueue'][_0x15d4('0x63')]({'where':{'id':_0x4a99d1[_0x15d4('0x60')]['id']}})['then'](handleEntityNotFound(_0x1851dc,null))['then'](function(_0xd3d77c){if(_0xd3d77c){_0x15b732=_0xd3d77c;_0x181989[_0x15d4('0x3d')]=_['keys'](db[_0x15d4('0x6f')][_0x15d4('0x4f')]);_0x181989[_0x15d4('0x3e')]=_[_0x15d4('0x50')](_0x4a99d1[_0x15d4('0x3e')]);_0x181989[_0x15d4('0x3f')]=_['intersection'](_0x181989[_0x15d4('0x3d')],_0x181989[_0x15d4('0x3e')]);_0x33b920[_0x15d4('0x40')]=_['intersection'](_0x181989[_0x15d4('0x3d')],qs['fields'](_0x4a99d1[_0x15d4('0x3e')]['fields']));_0x33b920[_0x15d4('0x40')]=_0x33b920[_0x15d4('0x40')][_0x15d4('0x43')]?_0x33b920[_0x15d4('0x40')]:_0x181989[_0x15d4('0x3d')];_0x33b920['order']=qs[_0x15d4('0x45')](_0x4a99d1[_0x15d4('0x3e')][_0x15d4('0x45')]);_0x33b920['where']=qs[_0x15d4('0x3f')](_[_0x15d4('0x46')](_0x4a99d1[_0x15d4('0x3e')],_0x181989['filters']));if(_0x4a99d1['query']['filter']){_0x33b920[_0x15d4('0x47')]=_[_0x15d4('0x48')](_0x33b920[_0x15d4('0x47')],{'$or':_[_0x15d4('0x39')](_0x33b920['attributes'],function(_0x383758){var _0x45a9ee={};_0x45a9ee[_0x383758]={'$like':'%'+_0x4a99d1[_0x15d4('0x3e')][_0x15d4('0x2f')]+'%'};return _0x45a9ee;})});}_0x33b920=_['merge']({},_0x33b920,_0x4a99d1['options']);return _0x15b732[_0x15d4('0x6e')](_0x33b920);}})[_0x15d4('0x2b')](function(_0x235ccc){if(_0x235ccc){_0x1af226=_0x235ccc[_0x15d4('0x43')];if(!_0x4a99d1[_0x15d4('0x3e')][_0x15d4('0x69')]('nolimit')){_0x33b920[_0x15d4('0x23')]=qs[_0x15d4('0x23')](_0x4a99d1['query'][_0x15d4('0x23')]);_0x33b920[_0x15d4('0x21')]=qs[_0x15d4('0x21')](_0x4a99d1[_0x15d4('0x3e')][_0x15d4('0x21')]);}return _0x15b732[_0x15d4('0x6e')](_0x33b920);}})[_0x15d4('0x2b')](function(_0x7f18e3){if(_0x7f18e3){return _0x7f18e3?{'count':_0x1af226,'rows':_0x7f18e3}:null;}})['then'](respondWithResult(_0x1851dc,null))[_0x15d4('0x4d')](handleError(_0x1851dc,null));};exports[_0x15d4('0x70')]=function(_0x2ecd26,_0x38d149,_0x5cd63b){var _0xa6e938=_0x2ecd26[_0x15d4('0x5d')][_0x15d4('0x71')];var _0x1ef632=_[_0x15d4('0x39')](_0xa6e938,'id');return db[_0x15d4('0x6f')]['findAll']({'where':{'id':_0x1ef632},'attributes':['id'],'include':[{'model':db[_0x15d4('0x72')],'as':'Agents','attributes':['id',_0x15d4('0x34'),_0x15d4('0x73'),_0x15d4('0x74'),_0x15d4('0x75')],'raw':!![]}]})['then'](function(_0x3a034e){if(_0x3a034e){var _0x479db1=_[_0x15d4('0x76')](_0x3a034e,function(_0x236ef8){var _0x121962=_0x236ef8['get']({'plain':!![]});_0x121962['Agents'][_0x15d4('0x77')](function(_0x3010f6){_0x3010f6[_0x15d4('0x78')]=_[_0x15d4('0x33')](_0xa6e938,{'id':_0x121962['id']})[_0x15d4('0x78')];});return _0x121962[_0x15d4('0x79')];});return db[_0x15d4('0x3a')][_0x15d4('0x33')]({'where':{'id':_0x2ecd26[_0x15d4('0x60')]['id']}})['then'](function(_0x12ca8e){return db[_0x15d4('0x7a')]['transaction'](function(_0x34c11b){return _0x12ca8e[_0x15d4('0x70')](_0x1ef632,{'transaction':_0x34c11b})[_0x15d4('0x2b')](function(){return BPromise[_0x15d4('0x7b')](_0xa6e938,function(_0x50c9d5){return db[_0x15d4('0x7c')][_0x15d4('0x7d')]({'TeamId':_0x50c9d5['id'],'VoiceQueueId':_0x2ecd26[_0x15d4('0x60')]['id'],'penalty':_0x50c9d5[_0x15d4('0x78')]},{'transaction':_0x34c11b});});})['then'](function(){return BPromise[_0x15d4('0x7b')](_0x479db1,function(_0x58ab88){return db[_0x15d4('0x7e')][_0x15d4('0x7f')]({'where':{'UserId':_0x58ab88['id'],'VoiceQueueId':_0x2ecd26['params']['id']},'defaults':{'penalty':_0x58ab88[_0x15d4('0x78')]},'transaction':_0x34c11b});});})[_0x15d4('0x2b')](function(){return BPromise[_0x15d4('0x7b')](_['filter'](_0x479db1,{'online':!![]}),function(_0x2f2aae){return db[_0x15d4('0x80')][_0x15d4('0x7d')]({'membername':_0x2f2aae[_0x15d4('0x34')],'UserId':_0x2f2aae['id'],'queue_name':_0x12ca8e['name'],'VoiceQueueId':_0x12ca8e['id'],'interface':_[_0x15d4('0x81')](_0x2f2aae[_0x15d4('0x75')])?util[_0x15d4('0x82')](_0x15d4('0x83'),_0x2f2aae[_0x15d4('0x34')]):_0x2f2aae['interface'],'paused':_0x2f2aae[_0x15d4('0x74')]||![],'penalty':_0x2f2aae[_0x15d4('0x78')]},{'transaction':_0x34c11b});});})[_0x15d4('0x2b')](function(){_0x479db1[_0x15d4('0x77')](function(_0x3e377e){socket[_0x15d4('0x84')](_0x15d4('0x85'),{'UserId':_0x3e377e['id'],'VoiceQueueId':_0x12ca8e['id']});});});});});}})[_0x15d4('0x2b')](respondWithStatusCode(_0x38d149,null))['catch'](handleError(_0x38d149,null));};exports['removeTeams']=function(_0x2a0b56,_0x59526e,_0x365e76){return db[_0x15d4('0x6f')][_0x15d4('0x4b')]({'where':{'id':_0x2a0b56[_0x15d4('0x3e')][_0x15d4('0x86')]},'attributes':['id'],'include':[{'model':db[_0x15d4('0x72')],'as':_0x15d4('0x79'),'attributes':['id'],'raw':!![]}]})[_0x15d4('0x2b')](handleEntityNotFound(_0x59526e,null))[_0x15d4('0x2b')](function(_0x3e3e08){var _0x34a568=_[_0x15d4('0x39')](_0x3e3e08,'id');var _0x2496a4=[];var _0x2ccf8c=[];var _0x4c0c83=squel[_0x15d4('0x87')]();_0x4c0c83[_0x15d4('0x88')](_0x15d4('0x89'))['from'](_0x15d4('0x8a'),'tq')[_0x15d4('0x8b')](_0x15d4('0x8c'),'ut',_0x15d4('0x8d'))[_0x15d4('0x47')](_0x15d4('0x8e'),_0x2a0b56[_0x15d4('0x60')]['id']);for(var _0x48cdc9=0x0;_0x48cdc9<_0x3e3e08[_0x15d4('0x43')];_0x48cdc9+=0x1){let _0xe994cc=_0x3e3e08[_0x48cdc9];for(var _0x4b3cce=0x0;_0x4b3cce<_0xe994cc[_0x15d4('0x79')]['length'];_0x4b3cce+=0x1){let _0x5edaff=_0xe994cc[_0x15d4('0x79')][_0x4b3cce];var _0x443af1=_0x4c0c83[_0x15d4('0x8f')]();_0x443af1[_0x15d4('0x47')](_0x15d4('0x90'),_0x5edaff['id']);_0x2ccf8c[_0x15d4('0x91')](db[_0x15d4('0x7a')][_0x15d4('0x3e')](_0x443af1[_0x15d4('0x92')](),{'type':db[_0x15d4('0x7a')][_0x15d4('0x93')][_0x15d4('0x94')]})[_0x15d4('0x2b')](function(_0x430a86){if(_0x430a86[_0x15d4('0x43')]===0x1){return _0x5edaff['id'];}else{var _0xa19576=_[_0x15d4('0x95')](_['map'](_0x430a86,_0x15d4('0x96')),function(_0x4fa980){return _[_0x15d4('0x31')](_0x34a568,_0x4fa980);});if(_0xa19576){return _0x5edaff['id'];}}}));}}return BPromise[_0x15d4('0x97')](_0x2ccf8c)[_0x15d4('0x2b')](function(_0x569777){_0x2496a4=_(_0x2496a4)['union'](_0x569777)['compact']()[_0x15d4('0x30')]();return db[_0x15d4('0x3a')][_0x15d4('0x33')]({'where':{'id':_0x2a0b56[_0x15d4('0x60')]['id']}})['then'](function(_0x41b1ce){return db['sequelize']['transaction'](function(_0x35e3df){return _0x41b1ce['removeTeams'](_0x2a0b56[_0x15d4('0x3e')]['ids'],{'transaction':_0x35e3df})[_0x15d4('0x2b')](function(){if(!_[_0x15d4('0x98')](_0x2496a4)){return _0x41b1ce['removeAgents'](_0x2496a4,{'transaction':_0x35e3df})[_0x15d4('0x2b')](function(){return db[_0x15d4('0x80')][_0x15d4('0x61')]({'where':{'VoiceQueueId':_0x2a0b56['params']['id'],'UserId':_0x2496a4},'transaction':_0x35e3df});});}})[_0x15d4('0x2b')](function(){_0x2496a4['forEach'](function(_0x1cc018){socket[_0x15d4('0x84')](_0x15d4('0x99'),{'UserId':_0x1cc018,'VoiceQueueId':_0x41b1ce['id']});});});});});});})[_0x15d4('0x2b')](respondWithStatusCode(_0x59526e,null))['catch'](handleError(_0x59526e,null));};exports[_0x15d4('0x9a')]=function(_0x409bb6,_0x351a43,_0x15d22e){var _0x297a9b,_0x1076cc;return db[_0x15d4('0x3a')]['find']({'where':{'id':_0x409bb6[_0x15d4('0x60')]['id']}})['then'](handleEntityNotFound(_0x351a43,null))['then'](function(_0xd2e8da){if(_0xd2e8da){_0x1076cc=_0xd2e8da;return _0xd2e8da[_0x15d4('0x9a')](_0x409bb6[_0x15d4('0x5d')][_0x15d4('0x86')],_[_0x15d4('0x9b')](_0x409bb6[_0x15d4('0x5d')],[_0x15d4('0x86'),'id'])||{})['spread'](function(_0x550018){for(var _0x23a408=0x0;_0x23a408<_0x409bb6['body'][_0x15d4('0x86')]['length'];_0x23a408+=0x1){socket[_0x15d4('0x84')]('userVoiceQueue:save',{'UserId':Number(_0x409bb6[_0x15d4('0x5d')][_0x15d4('0x86')][_0x23a408]),'VoiceQueueId':Number(_0x409bb6[_0x15d4('0x60')]['id'])});}return _0x550018;});}})['then'](function(_0x3d644d){_0x297a9b=_0x3d644d||[];if(_0x1076cc){return db[_0x15d4('0x72')][_0x15d4('0x4b')]({'where':{'id':_0x409bb6[_0x15d4('0x5d')][_0x15d4('0x86')]},'attributes':['id','name',_0x15d4('0x73'),'voicePause','interface'],'raw':!![]});}})['then'](function(_0x35d981){if(!_[_0x15d4('0x98')](_0x35d981)){var _0x586b25=[];for(var _0x4c784c=0x0;_0x4c784c<_0x35d981[_0x15d4('0x43')];_0x4c784c++){if(_0x35d981[_0x4c784c][_0x15d4('0x73')]){_0x586b25[_0x15d4('0x91')](db['UserVoiceQueueRt'][_0x15d4('0x7d')]({'membername':_0x35d981[_0x4c784c]['name'],'UserId':_0x35d981[_0x4c784c]['id'],'queue_name':_0x1076cc['name'],'VoiceQueueId':_0x1076cc['id'],'interface':_[_0x15d4('0x81')](_0x35d981[_0x4c784c][_0x15d4('0x75')])?util[_0x15d4('0x82')](_0x15d4('0x83'),_0x35d981[_0x4c784c][_0x15d4('0x34')]):_0x35d981[_0x4c784c]['interface'],'paused':_0x35d981[_0x4c784c][_0x15d4('0x74')]||![],'penalty':_0x409bb6[_0x15d4('0x5d')][_0x15d4('0x78')]||0x0}));}}return BPromise['all'](_0x586b25);}})[_0x15d4('0x2b')](function(){return _0x297a9b;})[_0x15d4('0x2b')](respondWithResult(_0x351a43,null))['catch'](handleError(_0x351a43,null));};exports[_0x15d4('0x9c')]=function(_0x50e610,_0xbb6a15,_0x5f19ec){return db['VoiceQueue']['find']({'where':{'id':_0x50e610[_0x15d4('0x60')]['id']}})['then'](handleEntityNotFound(_0xbb6a15,null))[_0x15d4('0x2b')](function(_0x549054){if(_0x549054){return _0x549054[_0x15d4('0x9c')](_0x50e610[_0x15d4('0x3e')][_0x15d4('0x86')])['then'](function(){if(_[_0x15d4('0x9d')](_0x50e610['query'][_0x15d4('0x86')])){for(var _0x44215b=0x0;_0x44215b<_0x50e610[_0x15d4('0x3e')][_0x15d4('0x86')]['length'];_0x44215b+=0x1){socket[_0x15d4('0x84')](_0x15d4('0x99'),{'UserId':Number(_0x50e610[_0x15d4('0x3e')][_0x15d4('0x86')][_0x44215b]),'VoiceQueueId':Number(_0x50e610['params']['id'])});}}else{socket['emit'](_0x15d4('0x99'),{'UserId':Number(_0x50e610['query']['ids']),'VoiceQueueId':Number(_0x50e610['params']['id'])});}});}})[_0x15d4('0x2b')](function(_0x4b81fe){return db[_0x15d4('0x80')]['destroy']({'where':{'VoiceQueueId':_0x50e610[_0x15d4('0x60')]['id'],'UserId':_0x50e610[_0x15d4('0x3e')][_0x15d4('0x86')]}})[_0x15d4('0x2b')](function(){return _0x4b81fe;});})[_0x15d4('0x2b')](respondWithStatusCode(_0xbb6a15,null))['catch'](handleError(_0xbb6a15,null));};exports[_0x15d4('0x9e')]=function(_0x224c94,_0x26abfd,_0x135f4b){var _0x5244fe={};var _0x1ff983={};var _0x27d99d;var _0x2d7377;return db[_0x15d4('0x3a')]['findOne']({'where':{'id':_0x224c94[_0x15d4('0x60')]['id']}})['then'](handleEntityNotFound(_0x26abfd,null))[_0x15d4('0x2b')](function(_0x344c8f){if(_0x344c8f){_0x27d99d=_0x344c8f;_0x1ff983[_0x15d4('0x3d')]=_[_0x15d4('0x50')](db[_0x15d4('0x72')]['rawAttributes']);_0x1ff983[_0x15d4('0x3e')]=_['keys'](_0x224c94['query']);_0x1ff983[_0x15d4('0x3f')]=_[_0x15d4('0x41')](_0x1ff983[_0x15d4('0x3d')],_0x1ff983[_0x15d4('0x3e')]);_0x5244fe[_0x15d4('0x40')]=_[_0x15d4('0x41')](_0x1ff983[_0x15d4('0x3d')],qs[_0x15d4('0x42')](_0x224c94[_0x15d4('0x3e')][_0x15d4('0x42')]));_0x5244fe[_0x15d4('0x40')]=_0x5244fe['attributes']['length']?_0x5244fe[_0x15d4('0x40')]:_0x1ff983['model'];_0x5244fe[_0x15d4('0x65')]=qs[_0x15d4('0x45')](_0x224c94[_0x15d4('0x3e')][_0x15d4('0x45')]);_0x5244fe['where']=qs[_0x15d4('0x3f')](_[_0x15d4('0x46')](_0x224c94[_0x15d4('0x3e')],_0x1ff983[_0x15d4('0x3f')]));if(_0x224c94[_0x15d4('0x3e')][_0x15d4('0x2f')]){_0x5244fe[_0x15d4('0x47')]=_[_0x15d4('0x48')](_0x5244fe[_0x15d4('0x47')],{'$or':_['map'](_0x5244fe[_0x15d4('0x40')],function(_0xcdb55b){var _0x54fb32={};_0x54fb32[_0xcdb55b]={'$like':'%'+_0x224c94[_0x15d4('0x3e')]['filter']+'%'};return _0x54fb32;})});}_0x5244fe=_[_0x15d4('0x48')]({},_0x5244fe,_0x224c94[_0x15d4('0x49')]);return _0x27d99d[_0x15d4('0x9e')](_0x5244fe);}})['then'](function(_0x3088b0){if(_0x3088b0){_0x2d7377=_0x3088b0[_0x15d4('0x43')];if(!_0x224c94['query'][_0x15d4('0x69')](_0x15d4('0x44'))){_0x5244fe[_0x15d4('0x23')]=qs[_0x15d4('0x23')](_0x224c94[_0x15d4('0x3e')][_0x15d4('0x23')]);_0x5244fe['offset']=qs[_0x15d4('0x21')](_0x224c94['query']['offset']);}return _0x27d99d[_0x15d4('0x9e')](_0x5244fe);}})[_0x15d4('0x2b')](function(_0x4d2ec4){if(_0x4d2ec4){return _0x4d2ec4?{'count':_0x2d7377,'rows':_0x4d2ec4}:null;}})['then'](respondWithResult(_0x26abfd,null))[_0x15d4('0x4d')](handleError(_0x26abfd,null));};exports['getMembers']=function(_0x596d62,_0x3b2fdd,_0x519f81){var _0xf7b271={};var _0x46272a={};var _0x39de47;var _0x349368;return db[_0x15d4('0x3a')]['findOne']({'where':{'id':_0x596d62['params']['id']}})[_0x15d4('0x2b')](handleEntityNotFound(_0x3b2fdd,null))[_0x15d4('0x2b')](function(_0x542af4){if(_0x542af4){_0x39de47=_0x542af4;_0x46272a[_0x15d4('0x3d')]=_[_0x15d4('0x50')](db[_0x15d4('0x80')][_0x15d4('0x4f')]);_0x46272a[_0x15d4('0x3e')]=_['keys'](_0x596d62[_0x15d4('0x3e')]);_0x46272a[_0x15d4('0x3f')]=_['intersection'](_0x46272a[_0x15d4('0x3d')],_0x46272a[_0x15d4('0x3e')]);_0xf7b271[_0x15d4('0x40')]=_[_0x15d4('0x41')](_0x46272a['model'],qs[_0x15d4('0x42')](_0x596d62['query'][_0x15d4('0x42')]));_0xf7b271['attributes']=_0xf7b271[_0x15d4('0x40')]['length']?_0xf7b271[_0x15d4('0x40')]:_0x46272a[_0x15d4('0x3d')];_0xf7b271['order']=qs['sort'](_0x596d62['query'][_0x15d4('0x45')]);_0xf7b271['where']=qs[_0x15d4('0x3f')](_[_0x15d4('0x46')](_0x596d62[_0x15d4('0x3e')],_0x46272a[_0x15d4('0x3f')]));if(_0x596d62[_0x15d4('0x3e')][_0x15d4('0x2f')]){_0xf7b271[_0x15d4('0x47')]=_[_0x15d4('0x48')](_0xf7b271[_0x15d4('0x47')],{'$or':_['map'](_0xf7b271[_0x15d4('0x40')],function(_0x18c995){var _0x34d0f2={};_0x34d0f2[_0x18c995]={'$like':'%'+_0x596d62['query']['filter']+'%'};return _0x34d0f2;})});}_0xf7b271=_[_0x15d4('0x48')]({},_0xf7b271,_0x596d62[_0x15d4('0x49')]);return _0x39de47[_0x15d4('0x9f')](_0xf7b271);}})['then'](function(_0x1c5ec2){if(_0x1c5ec2){_0x349368=_0x1c5ec2[_0x15d4('0x43')];if(!_0x596d62[_0x15d4('0x3e')][_0x15d4('0x69')](_0x15d4('0x44'))){_0xf7b271[_0x15d4('0x23')]=qs[_0x15d4('0x23')](_0x596d62[_0x15d4('0x3e')][_0x15d4('0x23')]);_0xf7b271[_0x15d4('0x21')]=qs[_0x15d4('0x21')](_0x596d62[_0x15d4('0x3e')][_0x15d4('0x21')]);}return _0x39de47[_0x15d4('0x9f')](_0xf7b271);}})['then'](function(_0x52d486){return _0x52d486?{'count':_0x349368,'rows':_0x52d486}:null;})['then'](respondWithResult(_0x3b2fdd,null))[_0x15d4('0x4d')](handleError(_0x3b2fdd,null));};exports[_0x15d4('0xa0')]=function(_0x49c812,_0x207e68,_0x1f835d){var _0x430831={};var _0x24231c={};var _0x469a8c;var _0xcc6bdc;return db['VoiceQueue'][_0x15d4('0x63')]({'where':{'id':_0x49c812[_0x15d4('0x60')]['id']}})[_0x15d4('0x2b')](handleEntityNotFound(_0x207e68,null))[_0x15d4('0x2b')](function(_0x124737){if(_0x124737){_0x469a8c=_0x124737;_0x24231c[_0x15d4('0x3d')]=_['keys'](db[_0x15d4('0xa1')]['rawAttributes']);_0x24231c['query']=_[_0x15d4('0x50')](_0x49c812[_0x15d4('0x3e')]);_0x24231c[_0x15d4('0x3f')]=_[_0x15d4('0x41')](_0x24231c[_0x15d4('0x3d')],_0x24231c[_0x15d4('0x3e')]);_0x430831[_0x15d4('0x40')]=_[_0x15d4('0x41')](_0x24231c[_0x15d4('0x3d')],qs[_0x15d4('0x42')](_0x49c812[_0x15d4('0x3e')][_0x15d4('0x42')]));_0x430831[_0x15d4('0x40')]=_0x430831[_0x15d4('0x40')]['length']?_0x430831[_0x15d4('0x40')]:_0x24231c['model'];_0x430831[_0x15d4('0x65')]=qs[_0x15d4('0x45')](_0x49c812[_0x15d4('0x3e')][_0x15d4('0x45')]);_0x430831[_0x15d4('0x47')]=qs[_0x15d4('0x3f')](_[_0x15d4('0x46')](_0x49c812[_0x15d4('0x3e')],_0x24231c['filters']));if(_0x49c812['query'][_0x15d4('0x2f')]){_0x430831['where']=_[_0x15d4('0x48')](_0x430831[_0x15d4('0x47')],{'$or':_['map'](_0x430831[_0x15d4('0x40')],function(_0x183822){var _0x30877f={};_0x30877f[_0x183822]={'$like':'%'+_0x49c812[_0x15d4('0x3e')][_0x15d4('0x2f')]+'%'};return _0x30877f;})});}_0x430831=_[_0x15d4('0x48')]({},_0x430831,_0x49c812[_0x15d4('0x49')]);return _0x469a8c['getLists'](_0x430831);}})[_0x15d4('0x2b')](function(_0x465bbe){if(_0x465bbe){_0xcc6bdc=_0x465bbe['length'];if(!_0x49c812[_0x15d4('0x3e')]['hasOwnProperty']('nolimit')){_0x430831[_0x15d4('0x23')]=qs[_0x15d4('0x23')](_0x49c812['query'][_0x15d4('0x23')]);_0x430831[_0x15d4('0x21')]=qs['offset'](_0x49c812['query'][_0x15d4('0x21')]);}return _0x469a8c[_0x15d4('0xa0')](_0x430831);}})[_0x15d4('0x2b')](function(_0x3f8413){if(_0x3f8413){return _0x3f8413?{'count':_0xcc6bdc,'rows':_0x3f8413}:null;}})[_0x15d4('0x2b')](respondWithResult(_0x207e68,null))[_0x15d4('0x4d')](handleError(_0x207e68,null));};exports['addLists']=function(_0x3b96e2,_0x4675b9,_0x2825be){var _0x310153,_0x3ebca5;return db['VoiceQueue'][_0x15d4('0x33')]({'where':{'id':_0x3b96e2['params']['id']}})[_0x15d4('0x2b')](handleEntityNotFound(_0x4675b9,null))[_0x15d4('0x2b')](function(_0x330178){if(_0x330178){_0x3ebca5=_0x330178;return _0x330178[_0x15d4('0xa2')](_0x3b96e2[_0x15d4('0x5d')]['ids'],_['omit'](_0x3b96e2['body'],[_0x15d4('0x86'),'id'])||{});}return null;})[_0x15d4('0xa3')](function(_0x42abab){var _0x3dd91f;_0x310153=_0x42abab||[];var _0x3859c3=[];if(_0x42abab){for(var _0x2492b3=0x0;_0x2492b3<_0x42abab[_0x15d4('0x43')];_0x2492b3+=0x1){var _0x2e2e4f=_0x42abab[_0x2492b3][_0x15d4('0x54')]({'plain':!![]});_0x3ebca5[_0x15d4('0xa4')]=_0x3b96e2[_0x15d4('0x5d')][_0x15d4('0xa4')]?_0x3b96e2[_0x15d4('0x5d')][_0x15d4('0xa4')]:_0x3ebca5['dialCheckDuplicateType'];switch(_0x3ebca5[_0x15d4('0xa4')]){case _0x15d4('0xa5'):_0x3dd91f=squel[_0x15d4('0xa6')]()[_0x15d4('0xa7')](_0x15d4('0xa8'))['fromQuery']([_0x15d4('0xa9'),_0x15d4('0xaa'),_0x15d4('0xab'),_0x15d4('0xac'),'VoiceQueueId',_0x15d4('0x5e'),'updatedAt'],squel[_0x15d4('0x87')]()[_0x15d4('0x88')](_0x15d4('0xa9'),_0x15d4('0xa9'))[_0x15d4('0x88')](_0x15d4('0xad'),_0x15d4('0xaa'))['field']('id','ContactId')[_0x15d4('0x88')](_0x2e2e4f['CmListId'][_0x15d4('0x92')](),'ListId')['field'](_0x3b96e2[_0x15d4('0x60')]['id'][_0x15d4('0x92')](),_0x15d4('0x66'))[_0x15d4('0x88')](_0x15d4('0xad'),_0x15d4('0x5e'))[_0x15d4('0x88')](_0x15d4('0xad'),'updatedAt')[_0x15d4('0xae')](_0x15d4('0xaf'))[_0x15d4('0x47')](_0x15d4('0xb0'))[_0x15d4('0x47')]('ListId\x20=\x20?',_0x2e2e4f['CmListId'][_0x15d4('0x92')]())[_0x15d4('0x47')](_0x15d4('0xb1'))['where'](_0x15d4('0xb2'),squel[_0x15d4('0x87')]()[_0x15d4('0x88')](_0x15d4('0xb3'))[_0x15d4('0xae')](_0x15d4('0xb4'))[_0x15d4('0x47')](_0x15d4('0x8e'),_0x3b96e2[_0x15d4('0x60')]['id'][_0x15d4('0x92')]()))[_0x15d4('0x47')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x15d4('0x88')](_0x15d4('0xb5'))[_0x15d4('0xae')]('cm_hopper')[_0x15d4('0x47')](_0x15d4('0x8e'),_0x3b96e2[_0x15d4('0x60')]['id'][_0x15d4('0x92')]())))[_0x15d4('0x92')]();break;case _0x15d4('0xb6'):_0x3dd91f=squel['insert']()[_0x15d4('0xa7')](_0x15d4('0xa8'))[_0x15d4('0xb7')](['phone','scheduledAt',_0x15d4('0xab'),_0x15d4('0xac'),_0x15d4('0x66'),_0x15d4('0x5e'),_0x15d4('0x5f')],squel['select']()[_0x15d4('0x88')](_0x15d4('0xa9'),_0x15d4('0xa9'))['field'](_0x15d4('0xad'),_0x15d4('0xaa'))[_0x15d4('0x88')]('id','ContactId')[_0x15d4('0x88')](_0x2e2e4f[_0x15d4('0xb8')]['toString'](),_0x15d4('0xac'))[_0x15d4('0x88')](_0x3b96e2[_0x15d4('0x60')]['id'][_0x15d4('0x92')](),_0x15d4('0x66'))['field'](_0x15d4('0xad'),'createdAt')[_0x15d4('0x88')](_0x15d4('0xad'),_0x15d4('0x5f'))[_0x15d4('0xae')]('cm_contacts')[_0x15d4('0x47')](_0x15d4('0xb0'))[_0x15d4('0x47')](_0x15d4('0xb9'),_0x2e2e4f[_0x15d4('0xb8')][_0x15d4('0x92')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x15d4('0x47')](_0x15d4('0xb2'),squel[_0x15d4('0x87')]()[_0x15d4('0x88')](_0x15d4('0xb5'))[_0x15d4('0xae')](_0x15d4('0xa8'))[_0x15d4('0x47')](_0x15d4('0x8e'),_0x3b96e2[_0x15d4('0x60')]['id']['toString']())))[_0x15d4('0x92')]();break;default:_0x3dd91f=squel[_0x15d4('0xa6')]()['into']('cm_hopper')['fromQuery']([_0x15d4('0xa9'),_0x15d4('0xaa'),_0x15d4('0xab'),_0x15d4('0xac'),_0x15d4('0x66'),_0x15d4('0x5e'),_0x15d4('0x5f')],squel['select']()[_0x15d4('0x88')](_0x15d4('0xa9'),_0x15d4('0xa9'))['field'](_0x15d4('0xad'),_0x15d4('0xaa'))[_0x15d4('0x88')]('id',_0x15d4('0xab'))[_0x15d4('0x88')](_0x2e2e4f['CmListId'][_0x15d4('0x92')](),_0x15d4('0xac'))['field'](_0x3b96e2[_0x15d4('0x60')]['id'][_0x15d4('0x92')](),'VoiceQueueId')[_0x15d4('0x88')](_0x15d4('0xad'),_0x15d4('0x5e'))[_0x15d4('0x88')]('NOW()',_0x15d4('0x5f'))['from']('cm_contacts')[_0x15d4('0x47')](_0x15d4('0xb0'))[_0x15d4('0x47')](_0x15d4('0xb9'),_0x2e2e4f[_0x15d4('0xb8')][_0x15d4('0x92')]())['where'](_0x15d4('0xb1')))[_0x15d4('0x92')]();}_0x3859c3['push'](db['sequelize'][_0x15d4('0x3e')](_0x3dd91f));}return BPromise[_0x15d4('0x97')](_0x3859c3);}})['then'](function(){return _0x310153;})[_0x15d4('0x2b')](respondWithResult(_0x4675b9,null))[_0x15d4('0x4d')](handleError(_0x4675b9,null));};exports[_0x15d4('0xba')]=function(_0x36bb13,_0x235ef3,_0x12e736){return db['VoiceQueue']['find']({'where':{'id':_0x36bb13[_0x15d4('0x60')]['id']}})[_0x15d4('0x2b')](handleEntityNotFound(_0x235ef3,null))[_0x15d4('0x2b')](function(_0x42b569){if(_0x42b569){return _0x42b569[_0x15d4('0xba')](_0x36bb13[_0x15d4('0x3e')]['ids']);}})[_0x15d4('0x2b')](function(_0x37738b){if(_0x37738b){return db[_0x15d4('0x64')][_0x15d4('0x61')]({'where':{'ListId':_0x36bb13['query'][_0x15d4('0x86')],'VoiceQueueId':_0x36bb13[_0x15d4('0x60')]['id']}})[_0x15d4('0x2b')](function(){return _0x37738b;});}})[_0x15d4('0x2b')](respondWithStatusCode(_0x235ef3,null))[_0x15d4('0x4d')](handleError(_0x235ef3,null));};exports[_0x15d4('0xbb')]=function(_0x4032eb,_0x3db4de,_0x569769){var _0x29ec4e={};var _0x11597e={};var _0x118980;var _0x1cb592;return db['VoiceQueue'][_0x15d4('0x63')]({'where':{'id':_0x4032eb[_0x15d4('0x60')]['id']}})[_0x15d4('0x2b')](handleEntityNotFound(_0x3db4de,null))[_0x15d4('0x2b')](function(_0x5c0179){if(_0x5c0179){_0x118980=_0x5c0179;_0x11597e['model']=_[_0x15d4('0x50')](db[_0x15d4('0xa1')][_0x15d4('0x4f')]);_0x11597e['query']=_[_0x15d4('0x50')](_0x4032eb[_0x15d4('0x3e')]);_0x11597e[_0x15d4('0x3f')]=_[_0x15d4('0x41')](_0x11597e['model'],_0x11597e['query']);_0x29ec4e['attributes']=_[_0x15d4('0x41')](_0x11597e[_0x15d4('0x3d')],qs[_0x15d4('0x42')](_0x4032eb[_0x15d4('0x3e')][_0x15d4('0x42')]));_0x29ec4e['attributes']=_0x29ec4e[_0x15d4('0x40')][_0x15d4('0x43')]?_0x29ec4e['attributes']:_0x11597e[_0x15d4('0x3d')];_0x29ec4e['order']=qs[_0x15d4('0x45')](_0x4032eb['query'][_0x15d4('0x45')]);_0x29ec4e[_0x15d4('0x47')]=qs[_0x15d4('0x3f')](_['pick'](_0x4032eb[_0x15d4('0x3e')],_0x11597e[_0x15d4('0x3f')]));if(_0x4032eb[_0x15d4('0x3e')]['filter']){_0x29ec4e[_0x15d4('0x47')]=_['merge'](_0x29ec4e[_0x15d4('0x47')],{'$or':_['map'](_0x29ec4e[_0x15d4('0x40')],function(_0x2f156f){var _0x187207={};_0x187207[_0x2f156f]={'$like':'%'+_0x4032eb[_0x15d4('0x3e')][_0x15d4('0x2f')]+'%'};return _0x187207;})});}_0x29ec4e=_['merge']({},_0x29ec4e,_0x4032eb[_0x15d4('0x49')]);return _0x118980[_0x15d4('0xbb')](_0x29ec4e);}})[_0x15d4('0x2b')](function(_0x389a54){if(_0x389a54){_0x1cb592=_0x389a54[_0x15d4('0x43')];if(!_0x4032eb[_0x15d4('0x3e')]['hasOwnProperty'](_0x15d4('0x44'))){_0x29ec4e[_0x15d4('0x23')]=qs[_0x15d4('0x23')](_0x4032eb[_0x15d4('0x3e')][_0x15d4('0x23')]);_0x29ec4e['offset']=qs[_0x15d4('0x21')](_0x4032eb[_0x15d4('0x3e')][_0x15d4('0x21')]);}return _0x118980[_0x15d4('0xbb')](_0x29ec4e);}})['then'](function(_0x291f65){if(_0x291f65){return _0x291f65?{'count':_0x1cb592,'rows':_0x291f65}:null;}})['then'](respondWithResult(_0x3db4de,null))[_0x15d4('0x4d')](handleError(_0x3db4de,null));};exports[_0x15d4('0xbc')]=function(_0x22669f,_0x6e1983,_0x597c17){var _0x508846,_0x52993a;return db[_0x15d4('0x3a')][_0x15d4('0x33')]({'where':{'id':_0x22669f['params']['id']}})[_0x15d4('0x2b')](handleEntityNotFound(_0x6e1983,null))['then'](function(_0x1f8739){if(_0x1f8739){_0x52993a=_0x1f8739;return _0x1f8739[_0x15d4('0xbc')](_0x22669f['body'][_0x15d4('0x86')],_[_0x15d4('0x9b')](_0x22669f[_0x15d4('0x5d')],[_0x15d4('0x86'),'id'])||{});}return null;})[_0x15d4('0xa3')](function(_0x34a31d){var _0x1ade74;_0x508846=_0x34a31d||[];var _0x1ca3c6=[];if(_0x34a31d){for(var _0x354f1e=0x0;_0x354f1e<_0x34a31d['length'];_0x354f1e+=0x1){var _0x2c7319=_0x34a31d[_0x354f1e]['get']({'plain':!![]});_0x1ade74=squel[_0x15d4('0xa6')]()['into'](_0x15d4('0xbd'))['fromQuery'](['phone',_0x15d4('0xab'),'ListId',_0x15d4('0x66'),_0x15d4('0x5e'),_0x15d4('0x5f')],squel[_0x15d4('0x87')]()[_0x15d4('0x88')](_0x15d4('0xa9'),_0x15d4('0xa9'))[_0x15d4('0x88')]('id','ContactId')[_0x15d4('0x88')](_0x2c7319['CmListId'][_0x15d4('0x92')](),_0x15d4('0xac'))['field'](_0x22669f[_0x15d4('0x60')]['id'][_0x15d4('0x92')](),'VoiceQueueId')[_0x15d4('0x88')]('NOW()',_0x15d4('0x5e'))['field'](_0x15d4('0xad'),_0x15d4('0x5f'))[_0x15d4('0xae')](_0x15d4('0xaf'))[_0x15d4('0x47')]('deletedAt\x20IS\x20NULL')['where'](_0x15d4('0xb9'),_0x2c7319[_0x15d4('0xb8')][_0x15d4('0x92')]())[_0x15d4('0x47')](_0x15d4('0xb1')))[_0x15d4('0x92')]();_0x1ca3c6['push'](db[_0x15d4('0x7a')][_0x15d4('0x3e')](_0x1ade74));}return BPromise['all'](_0x1ca3c6);}})[_0x15d4('0x2b')](function(){return _0x508846;})['then'](respondWithResult(_0x6e1983,null))[_0x15d4('0x4d')](handleError(_0x6e1983,null));};exports[_0x15d4('0xbe')]=function(_0x5011ba,_0x1ee212,_0x3f6a39){return db['VoiceQueue'][_0x15d4('0x33')]({'where':{'id':_0x5011ba['params']['id']}})['then'](handleEntityNotFound(_0x1ee212,null))[_0x15d4('0x2b')](function(_0x2adf32){if(_0x2adf32){return _0x2adf32['removeBlackLists'](_0x5011ba[_0x15d4('0x3e')][_0x15d4('0x86')]);}})[_0x15d4('0x2b')](function(_0x3fed08){if(_0x3fed08){return db[_0x15d4('0x6d')]['destroy']({'where':{'ListId':_0x5011ba[_0x15d4('0x3e')][_0x15d4('0x86')],'VoiceQueueId':_0x5011ba[_0x15d4('0x60')]['id']}})[_0x15d4('0x2b')](function(){return _0x3fed08;});}})['then'](respondWithStatusCode(_0x1ee212,null))[_0x15d4('0x4d')](handleError(_0x1ee212,null));};
\ No newline at end of file
index 9b4b3f0..2ac9a39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1382=['hook','exports','VoiceQueue','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x80c3ab,_0x3eaf75){var _0x112dfa=function(_0x69ef7c){while(--_0x69ef7c){_0x80c3ab['push'](_0x80c3ab['shift']());}};_0x112dfa(++_0x3eaf75);}(_0x1382,0x191));var _0x2138=function(_0x204c27,_0x4f1779){_0x204c27=_0x204c27-0x0;var _0x466cb1=_0x1382[_0x204c27];return _0x466cb1;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0x2138('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2138('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2138('0x2')};function emitEvent(_0x465b17){return function(_0x243961,_0x7f898,_0x167f63){VoiceQueueEvents[_0x2138('0x3')](_0x465b17+':'+_0x243961['id'],_0x243961);VoiceQueueEvents['emit'](_0x465b17,_0x243961);_0x167f63(null);};}for(var e in events){if(events[_0x2138('0x4')](e)){var event=events[e];VoiceQueue[_0x2138('0x5')](e,emitEvent(event));}}module[_0x2138('0x6')]=VoiceQueueEvents;
\ No newline at end of file
+var _0x5ecf=['events','../../mysqldb','VoiceQueue','update','remove','emit','hasOwnProperty','exports'];(function(_0xeacec0,_0x1456cf){var _0x1c81be=function(_0x5e56e8){while(--_0x5e56e8){_0xeacec0['push'](_0xeacec0['shift']());}};_0x1c81be(++_0x1456cf);}(_0x5ecf,0xd0));var _0xf5ec=function(_0x5b6e65,_0x2e82b3){_0x5b6e65=_0x5b6e65-0x0;var _0x117f50=_0x5ecf[_0x5b6e65];return _0x117f50;};'use strict';var EventEmitter=require(_0xf5ec('0x0'));var VoiceQueue=require(_0xf5ec('0x1'))['db'][_0xf5ec('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf5ec('0x3'),'afterDestroy':_0xf5ec('0x4')};function emitEvent(_0x13bb44){return function(_0x170e5c,_0x4cea5c,_0x55e369){VoiceQueueEvents[_0xf5ec('0x5')](_0x13bb44+':'+_0x170e5c['id'],_0x170e5c);VoiceQueueEvents[_0xf5ec('0x5')](_0x13bb44,_0x170e5c);_0x55e369(null);};}for(var e in events){if(events[_0xf5ec('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xf5ec('0x7')]=VoiceQueueEvents;
\ No newline at end of file
index 5a104e8..638e2f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x10bfd7,_0x38dd2d){var _0x4a1015=function(_0x513232){while(--_0x513232){_0x10bfd7['push'](_0x10bfd7['shift']());}};_0x4a1015(++_0x38dd2d);}(_0x70e0,0x17b));var _0x070e=function(_0x2c9b01,_0x1f3393){_0x2c9b01=_0x2c9b01-0x0;var _0xe87e5d=_0x70e0[_0x2c9b01];return _0xe87e5d;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x5a5ffb,_0x3aaf44){var _0x12d821=function(_0x56d1ac){while(--_0x56d1ac){_0x5a5ffb['push'](_0x5a5ffb['shift']());}};_0x12d821(++_0x3aaf44);}(_0x3e74,0x175));var _0x43e7=function(_0x2d9e5f,_0x2b529d){_0x2d9e5f=_0x2d9e5f-0x0;var _0x388525=_0x3e74[_0x2d9e5f];return _0x388525;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 878664a..26f06e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03db=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./voiceQueue.socket','request','then','info','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','VoiceQueue,\x20%s,\x20%s','message','catch','VoiceQueue','findAll','options','where','attributes','limit','include','model','GetVoiceQueue','stringify','find','raw','map','ShowVoiceQueue','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1e5e67,_0x408793){var _0x51685c=function(_0x2d98e0){while(--_0x2d98e0){_0x1e5e67['push'](_0x1e5e67['shift']());}};_0x51685c(++_0x408793);}(_0x03db,0x1e9));var _0xb03d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03db[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb03d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb03d('0x1'));var rs=require(_0xb03d('0x2'));var fs=require('fs');var Redis=require(_0xb03d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb03d('0x4'));var logger=require(_0xb03d('0x5'))(_0xb03d('0x6'));var config=require(_0xb03d('0x7'));var jayson=require(_0xb03d('0x8'));var client=jayson[_0xb03d('0x9')][_0xb03d('0xa')]({'port':0x232a});config[_0xb03d('0xb')]=_[_0xb03d('0xc')](config[_0xb03d('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb03d('0xb')]));require(_0xb03d('0xd'))['register'](socket);function respondWithRpcPromise(_0xeae552,_0x215fe0,_0x3446e8){return new BPromise(function(_0x755c25,_0x5c12af){return client[_0xb03d('0xe')](_0xeae552,_0x3446e8)[_0xb03d('0xf')](function(_0x36b9be){logger[_0xb03d('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x215fe0,'request\x20sent');logger[_0xb03d('0x11')](_0xb03d('0x12'),_0x215fe0,_0xb03d('0x13'),JSON['stringify'](_0x36b9be));if(_0x36b9be[_0xb03d('0x14')]){if(_0x36b9be[_0xb03d('0x14')]['code']===0x1f4){logger[_0xb03d('0x14')](_0xb03d('0x15'),_0x215fe0,_0x36b9be[_0xb03d('0x14')][_0xb03d('0x16')]);return _0x5c12af(_0x36b9be[_0xb03d('0x14')]['message']);}logger[_0xb03d('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x215fe0,_0x36b9be[_0xb03d('0x14')][_0xb03d('0x16')]);return _0x755c25(_0x36b9be[_0xb03d('0x14')]['message']);}else{logger[_0xb03d('0x10')](_0xb03d('0x15'),_0x215fe0,'request\x20sent');_0x755c25(_0x36b9be['result']['message']);}})[_0xb03d('0x17')](function(_0x5c5ce3){logger[_0xb03d('0x14')](_0xb03d('0x15'),_0x215fe0,_0x5c5ce3);_0x5c12af(_0x5c5ce3);});});}exports['GetVoiceQueue']=function(_0xe90699){var _0x1178a5=this;return new Promise(function(_0x44714f,_0x2f6333){return db[_0xb03d('0x18')][_0xb03d('0x19')]({'raw':_0xe90699[_0xb03d('0x1a')]?_0xe90699[_0xb03d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xe90699[_0xb03d('0x1a')]?_0xe90699[_0xb03d('0x1a')][_0xb03d('0x1b')]||null:null,'attributes':_0xe90699[_0xb03d('0x1a')]?_0xe90699[_0xb03d('0x1a')][_0xb03d('0x1c')]||null:null,'limit':_0xe90699[_0xb03d('0x1a')]?_0xe90699[_0xb03d('0x1a')][_0xb03d('0x1d')]||null:null,'include':_0xe90699[_0xb03d('0x1a')]?_0xe90699[_0xb03d('0x1a')][_0xb03d('0x1e')]?_['map'](_0xe90699['options']['include'],function(_0x4efe5f){return{'model':db[_0x4efe5f[_0xb03d('0x1f')]],'as':_0x4efe5f['as'],'attributes':_0x4efe5f[_0xb03d('0x1c')],'include':_0x4efe5f[_0xb03d('0x1e')]?_['map'](_0x4efe5f[_0xb03d('0x1e')],function(_0x41c726){return{'model':db[_0x41c726[_0xb03d('0x1f')]],'as':_0x41c726['as'],'attributes':_0x41c726['attributes'],'include':_0x41c726[_0xb03d('0x1e')]?_['map'](_0x41c726[_0xb03d('0x1e')],function(_0x2c7912){return{'model':db[_0x2c7912[_0xb03d('0x1f')]],'as':_0x2c7912['as'],'attributes':_0x2c7912[_0xb03d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb03d('0xf')](function(_0x43c3fa){logger['info'](_0xb03d('0x20'),_0xe90699);logger[_0xb03d('0x11')]('GetVoiceQueue',_0xe90699,JSON[_0xb03d('0x21')](_0x43c3fa));_0x44714f(_0x43c3fa);})[_0xb03d('0x17')](function(_0x11baf4){logger[_0xb03d('0x14')](_0xb03d('0x20'),_0x11baf4[_0xb03d('0x16')],_0xe90699);_0x2f6333(_0x1178a5['error'](0x1f4,_0x11baf4[_0xb03d('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x2900df){var _0x19f22b=this;return new Promise(function(_0x4efa6d,_0xb1426){return db[_0xb03d('0x18')][_0xb03d('0x22')]({'raw':_0x2900df[_0xb03d('0x1a')]?_0x2900df['options'][_0xb03d('0x23')]===undefined?!![]:![]:!![],'where':_0x2900df[_0xb03d('0x1a')]?_0x2900df['options']['where']||null:null,'attributes':_0x2900df['options']?_0x2900df[_0xb03d('0x1a')][_0xb03d('0x1c')]||null:null,'include':_0x2900df[_0xb03d('0x1a')]?_0x2900df['options']['include']?_[_0xb03d('0x24')](_0x2900df[_0xb03d('0x1a')][_0xb03d('0x1e')],function(_0xe4353d){return{'model':db[_0xe4353d[_0xb03d('0x1f')]],'as':_0xe4353d['as'],'attributes':_0xe4353d[_0xb03d('0x1c')],'include':_0xe4353d[_0xb03d('0x1e')]?_[_0xb03d('0x24')](_0xe4353d[_0xb03d('0x1e')],function(_0x3f32a3){return{'model':db[_0x3f32a3[_0xb03d('0x1f')]],'as':_0x3f32a3['as'],'attributes':_0x3f32a3[_0xb03d('0x1c')],'include':_0x3f32a3[_0xb03d('0x1e')]?_[_0xb03d('0x24')](_0x3f32a3['include'],function(_0x59d864){return{'model':db[_0x59d864[_0xb03d('0x1f')]],'as':_0x59d864['as'],'attributes':_0x59d864['attributes']};}):[]};}):[]};}):[]:[]})[_0xb03d('0xf')](function(_0x1d0b7d){logger['info'](_0xb03d('0x25'),_0x2900df);logger[_0xb03d('0x11')](_0xb03d('0x25'),_0x2900df,JSON['stringify'](_0x1d0b7d));_0x4efa6d(_0x1d0b7d);})['catch'](function(_0x2f8e87){logger[_0xb03d('0x14')]('ShowVoiceQueue',_0x2f8e87[_0xb03d('0x16')],_0x2900df);_0xb1426(_0x19f22b['error'](0x1f4,_0x2f8e87[_0xb03d('0x16')]));});});};
\ No newline at end of file
+var _0x6c2a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','raw','options','where','limit','map','include','model','attributes','ShowVoiceQueue','find','lodash'];(function(_0x3f2853,_0x3165a9){var _0x240767=function(_0x23d0f3){while(--_0x23d0f3){_0x3f2853['push'](_0x3f2853['shift']());}};_0x240767(++_0x3165a9);}(_0x6c2a,0xd6));var _0xa6c2=function(_0x2dc73c,_0x5092ee){_0x2dc73c=_0x2dc73c-0x0;var _0x140215=_0x6c2a[_0x2dc73c];return _0x140215;};'use strict';var _=require(_0xa6c2('0x0'));var util=require(_0xa6c2('0x1'));var moment=require(_0xa6c2('0x2'));var BPromise=require(_0xa6c2('0x3'));var rs=require(_0xa6c2('0x4'));var fs=require('fs');var Redis=require(_0xa6c2('0x5'));var db=require(_0xa6c2('0x6'))['db'];var utils=require(_0xa6c2('0x7'));var logger=require(_0xa6c2('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa6c2('0x9'));var client=jayson[_0xa6c2('0xa')][_0xa6c2('0xb')]({'port':0x232a});config[_0xa6c2('0xc')]=_[_0xa6c2('0xd')](config['redis'],{'host':_0xa6c2('0xe'),'port':0x18eb});var socket=require(_0xa6c2('0xf'))(new Redis(config[_0xa6c2('0xc')]));require(_0xa6c2('0x10'))[_0xa6c2('0x11')](socket);function respondWithRpcPromise(_0x32bc66,_0x19ccda,_0x2abf18){return new BPromise(function(_0x463219,_0x89fda4){return client[_0xa6c2('0x12')](_0x32bc66,_0x2abf18)[_0xa6c2('0x13')](function(_0x3882d9){logger[_0xa6c2('0x14')](_0xa6c2('0x15'),_0x19ccda,_0xa6c2('0x16'));logger[_0xa6c2('0x17')](_0xa6c2('0x18'),_0x19ccda,_0xa6c2('0x16'),JSON[_0xa6c2('0x19')](_0x3882d9));if(_0x3882d9[_0xa6c2('0x1a')]){if(_0x3882d9[_0xa6c2('0x1a')][_0xa6c2('0x1b')]===0x1f4){logger[_0xa6c2('0x1a')](_0xa6c2('0x15'),_0x19ccda,_0x3882d9[_0xa6c2('0x1a')][_0xa6c2('0x1c')]);return _0x89fda4(_0x3882d9[_0xa6c2('0x1a')][_0xa6c2('0x1c')]);}logger[_0xa6c2('0x1a')]('VoiceQueue,\x20%s,\x20%s',_0x19ccda,_0x3882d9['error'][_0xa6c2('0x1c')]);return _0x463219(_0x3882d9[_0xa6c2('0x1a')]['message']);}else{logger[_0xa6c2('0x14')](_0xa6c2('0x15'),_0x19ccda,_0xa6c2('0x16'));_0x463219(_0x3882d9['result']['message']);}})[_0xa6c2('0x1d')](function(_0x1bc217){logger[_0xa6c2('0x1a')](_0xa6c2('0x15'),_0x19ccda,_0x1bc217);_0x89fda4(_0x1bc217);});});}exports[_0xa6c2('0x1e')]=function(_0x3c2ee8){var _0x45b773=this;return new Promise(function(_0x20608a,_0x293cd9){return db[_0xa6c2('0x1f')][_0xa6c2('0x20')]({'raw':_0x3c2ee8['options']?_0x3c2ee8['options'][_0xa6c2('0x21')]===undefined?!![]:![]:!![],'where':_0x3c2ee8[_0xa6c2('0x22')]?_0x3c2ee8[_0xa6c2('0x22')][_0xa6c2('0x23')]||null:null,'attributes':_0x3c2ee8[_0xa6c2('0x22')]?_0x3c2ee8['options']['attributes']||null:null,'limit':_0x3c2ee8[_0xa6c2('0x22')]?_0x3c2ee8[_0xa6c2('0x22')][_0xa6c2('0x24')]||null:null,'include':_0x3c2ee8[_0xa6c2('0x22')]?_0x3c2ee8[_0xa6c2('0x22')]['include']?_[_0xa6c2('0x25')](_0x3c2ee8[_0xa6c2('0x22')][_0xa6c2('0x26')],function(_0x3e8f4c){return{'model':db[_0x3e8f4c[_0xa6c2('0x27')]],'as':_0x3e8f4c['as'],'attributes':_0x3e8f4c[_0xa6c2('0x28')],'include':_0x3e8f4c[_0xa6c2('0x26')]?_[_0xa6c2('0x25')](_0x3e8f4c['include'],function(_0x4789a9){return{'model':db[_0x4789a9[_0xa6c2('0x27')]],'as':_0x4789a9['as'],'attributes':_0x4789a9[_0xa6c2('0x28')],'include':_0x4789a9['include']?_[_0xa6c2('0x25')](_0x4789a9[_0xa6c2('0x26')],function(_0x27f1e6){return{'model':db[_0x27f1e6['model']],'as':_0x27f1e6['as'],'attributes':_0x27f1e6[_0xa6c2('0x28')]};}):[]};}):[]};}):[]:[]})[_0xa6c2('0x13')](function(_0x43a32b){logger[_0xa6c2('0x14')](_0xa6c2('0x1e'),_0x3c2ee8);logger[_0xa6c2('0x17')](_0xa6c2('0x1e'),_0x3c2ee8,JSON[_0xa6c2('0x19')](_0x43a32b));_0x20608a(_0x43a32b);})['catch'](function(_0x91d0d9){logger[_0xa6c2('0x1a')](_0xa6c2('0x1e'),_0x91d0d9[_0xa6c2('0x1c')],_0x3c2ee8);_0x293cd9(_0x45b773[_0xa6c2('0x1a')](0x1f4,_0x91d0d9[_0xa6c2('0x1c')]));});});};exports[_0xa6c2('0x29')]=function(_0x424b66){var _0x4bbde7=this;return new Promise(function(_0x2051ef,_0x25d87c){return db[_0xa6c2('0x1f')][_0xa6c2('0x2a')]({'raw':_0x424b66[_0xa6c2('0x22')]?_0x424b66[_0xa6c2('0x22')][_0xa6c2('0x21')]===undefined?!![]:![]:!![],'where':_0x424b66[_0xa6c2('0x22')]?_0x424b66[_0xa6c2('0x22')]['where']||null:null,'attributes':_0x424b66['options']?_0x424b66['options'][_0xa6c2('0x28')]||null:null,'include':_0x424b66[_0xa6c2('0x22')]?_0x424b66[_0xa6c2('0x22')][_0xa6c2('0x26')]?_[_0xa6c2('0x25')](_0x424b66[_0xa6c2('0x22')]['include'],function(_0x1806bc){return{'model':db[_0x1806bc['model']],'as':_0x1806bc['as'],'attributes':_0x1806bc[_0xa6c2('0x28')],'include':_0x1806bc[_0xa6c2('0x26')]?_['map'](_0x1806bc[_0xa6c2('0x26')],function(_0xfe14e){return{'model':db[_0xfe14e[_0xa6c2('0x27')]],'as':_0xfe14e['as'],'attributes':_0xfe14e['attributes'],'include':_0xfe14e['include']?_[_0xa6c2('0x25')](_0xfe14e[_0xa6c2('0x26')],function(_0x29d5b8){return{'model':db[_0x29d5b8[_0xa6c2('0x27')]],'as':_0x29d5b8['as'],'attributes':_0x29d5b8[_0xa6c2('0x28')]};}):[]};}):[]};}):[]:[]})[_0xa6c2('0x13')](function(_0x1e6b14){logger[_0xa6c2('0x14')]('ShowVoiceQueue',_0x424b66);logger[_0xa6c2('0x17')]('ShowVoiceQueue',_0x424b66,JSON[_0xa6c2('0x19')](_0x1e6b14));_0x2051ef(_0x1e6b14);})['catch'](function(_0x28d776){logger[_0xa6c2('0x1a')](_0xa6c2('0x29'),_0x28d776['message'],_0x424b66);_0x25d87c(_0x4bbde7[_0xa6c2('0x1a')](0x1f4,_0x28d776[_0xa6c2('0x1c')]));});});};
\ No newline at end of file
index 2b35ab3..018ac3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7a=['save','remove','update','emit','removeListener','register','voiceQueue:','./voiceQueue.events'];(function(_0x9f5c9a,_0x8974ad){var _0x3ca309=function(_0x152c4a){while(--_0x152c4a){_0x9f5c9a['push'](_0x9f5c9a['shift']());}};_0x3ca309(++_0x8974ad);}(_0x6f7a,0x77));var _0xa6f7=function(_0x3abb9c,_0x569e95){_0x3abb9c=_0x3abb9c-0x0;var _0x46e554=_0x6f7a[_0x3abb9c];return _0x46e554;};'use strict';var VoiceQueueEvents=require(_0xa6f7('0x0'));var events=[_0xa6f7('0x1'),_0xa6f7('0x2'),_0xa6f7('0x3')];function createListener(_0x513327,_0x3c6520){return function(_0x507cc7){_0x3c6520[_0xa6f7('0x4')](_0x513327,_0x507cc7);};}function removeListener(_0x2cb3be,_0x235197){return function(){VoiceQueueEvents[_0xa6f7('0x5')](_0x2cb3be,_0x235197);};}exports[_0xa6f7('0x6')]=function(_0x3ef7e8){for(var _0x533f50=0x0,_0x2f8a28=events['length'];_0x533f50<_0x2f8a28;_0x533f50++){var _0x1c00c4=events[_0x533f50];var _0x421385=createListener(_0xa6f7('0x7')+_0x1c00c4,_0x3ef7e8);VoiceQueueEvents['on'](_0x1c00c4,_0x421385);}};
\ No newline at end of file
+var _0x61b2=['emit','register','./voiceQueue.events','update'];(function(_0x185f1f,_0x3945d0){var _0x5989af=function(_0x5b74f){while(--_0x5b74f){_0x185f1f['push'](_0x185f1f['shift']());}};_0x5989af(++_0x3945d0);}(_0x61b2,0xe6));var _0x261b=function(_0x3f740a,_0x5810c8){_0x3f740a=_0x3f740a-0x0;var _0x4083b8=_0x61b2[_0x3f740a];return _0x4083b8;};'use strict';var VoiceQueueEvents=require(_0x261b('0x0'));var events=['save','remove',_0x261b('0x1')];function createListener(_0x5136b1,_0x49f160){return function(_0x10428f){_0x49f160[_0x261b('0x2')](_0x5136b1,_0x10428f);};}function removeListener(_0xfe8aae,_0x59cec3){return function(){VoiceQueueEvents['removeListener'](_0xfe8aae,_0x59cec3);};}exports[_0x261b('0x3')]=function(_0x553f6c){for(var _0x2f55c8=0x0,_0x39ba2c=events['length'];_0x2f55c8<_0x39ba2c;_0x2f55c8++){var _0x5521e5=events[_0x2f55c8];var _0x4a6392=createListener('voiceQueue:'+_0x5521e5,_0x553f6c);VoiceQueueEvents['on'](_0x5521e5,_0x4a6392);}};
\ No newline at end of file
index 138262b..eb3ebbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb36e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1e3cb9,_0x3c697d){var _0xc3c95d=function(_0x32a9c3){while(--_0x32a9c3){_0x1e3cb9['push'](_0x1e3cb9['shift']());}};_0xc3c95d(++_0x3c697d);}(_0xb36e,0x1f4));var _0xeb36=function(_0x1360b5,_0x1d849e){_0x1360b5=_0x1360b5-0x0;var _0xb98af1=_0xb36e[_0x1360b5];return _0xb98af1;};'use strict';var multer=require(_0xeb36('0x0'));var util=require(_0xeb36('0x1'));var path=require('path');var timeout=require(_0xeb36('0x2'));var express=require(_0xeb36('0x3'));var router=express[_0xeb36('0x4')]();var fs_extra=require(_0xeb36('0x5'));var auth=require(_0xeb36('0x6'));var interaction=require(_0xeb36('0x7'));var config=require(_0xeb36('0x8'));var controller=require('./voiceQueueReport.controller');router[_0xeb36('0x9')]('/',auth[_0xeb36('0xa')](),controller['index']);router[_0xeb36('0x9')](_0xeb36('0xb'),auth[_0xeb36('0xa')](),controller[_0xeb36('0xc')]);router['get'](_0xeb36('0xd'),auth['isAuthenticated'](),controller[_0xeb36('0xe')]);router['get'](_0xeb36('0xf'),auth['isAuthenticated'](),controller[_0xeb36('0x10')]);router[_0xeb36('0x11')]('/',auth[_0xeb36('0xa')](),controller[_0xeb36('0x12')]);router['put'](_0xeb36('0xf'),auth[_0xeb36('0xa')](),controller[_0xeb36('0x13')]);router['delete']('/:id',auth[_0xeb36('0xa')](),controller[_0xeb36('0x14')]);module[_0xeb36('0x15')]=router;
\ No newline at end of file
+var _0x823f=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceQueueReport.controller','get','isAuthenticated','/describe','/index','getVoiceQueuesReport','show','/:id','exports','multer'];(function(_0x32735e,_0x63ead9){var _0x887a4c=function(_0x4b5dcd){while(--_0x4b5dcd){_0x32735e['push'](_0x32735e['shift']());}};_0x887a4c(++_0x63ead9);}(_0x823f,0x87));var _0xf823=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0x823f[_0x14a862];return _0x245eb5;};'use strict';var multer=require(_0xf823('0x0'));var util=require(_0xf823('0x1'));var path=require(_0xf823('0x2'));var timeout=require(_0xf823('0x3'));var express=require(_0xf823('0x4'));var router=express[_0xf823('0x5')]();var fs_extra=require(_0xf823('0x6'));var auth=require(_0xf823('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf823('0x8'));router[_0xf823('0x9')]('/',auth[_0xf823('0xa')](),controller['index']);router[_0xf823('0x9')](_0xf823('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xf823('0x9')](_0xf823('0xc'),auth[_0xf823('0xa')](),controller[_0xf823('0xd')]);router[_0xf823('0x9')]('/:id',auth[_0xf823('0xa')](),controller[_0xf823('0xe')]);router['post']('/',auth[_0xf823('0xa')](),controller['create']);router['put'](_0xf823('0xf'),auth[_0xf823('0xa')](),controller['update']);router['delete'](_0xf823('0xf'),auth[_0xf823('0xa')](),controller['destroy']);module[_0xf823('0x10')]=router;
\ No newline at end of file
index bd3768f..68c2506 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb010=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','seconds','queuecallerleaveAt','setDataValue','holdtime'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb010,0xf4));var _0x0b01=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb010[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x0b01('0x0'));var moment=require(_0x0b01('0x1'));module['exports']={'type':{'type':Sequelize[_0x0b01('0x2')]},'uniqueid':{'type':Sequelize[_0x0b01('0x2')]},'calleridnum':{'type':Sequelize[_0x0b01('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x0b01('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x0b01('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x0b01('0x3')],'set':function(_0x1c2691){var _0x2c3041=moment(_0x1c2691);var _0x4adeea=moment(this[_0x0b01('0x4')]('queuecallerjoinAt'))[_0x0b01('0x5')](_0x0b01('0x6'));var _0x162bb1=_0x2c3041['diff'](_0x4adeea,_0x0b01('0x7'));this['setDataValue'](_0x0b01('0x8'),_0x1c2691);this[_0x0b01('0x9')](_0x0b01('0xa'),_0x162bb1||null);}},'position':{'type':Sequelize[_0x0b01('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x0b01('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x0b01('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x0b01('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x0b01('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x0b01('0x2')],'comment':_0x0b01('0xd')},'originalposition':{'type':Sequelize[_0x0b01('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0b01('0x2')]},'connectedlinename':{'type':Sequelize[_0x0b01('0x2')]},'accountcode':{'type':Sequelize[_0x0b01('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x0b01('0xb')]},'mohtime':{'type':Sequelize[_0x0b01('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0b01('0x2')],'comment':_0x0b01('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x0b01('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x0b01('0xb')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x49c1=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime'];(function(_0x142b0c,_0x1c6f59){var _0x3a14c9=function(_0x174258){while(--_0x174258){_0x142b0c['push'](_0x142b0c['shift']());}};_0x3a14c9(++_0x1c6f59);}(_0x49c1,0x184));var _0x149c=function(_0x2a2e5c,_0x2a7448){_0x2a2e5c=_0x2a2e5c-0x0;var _0x1f4512=_0x49c1[_0x2a2e5c];return _0x1f4512;};'use strict';var Sequelize=require(_0x149c('0x0'));var moment=require(_0x149c('0x1'));module[_0x149c('0x2')]={'type':{'type':Sequelize[_0x149c('0x3')]},'uniqueid':{'type':Sequelize[_0x149c('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x149c('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x149c('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x149c('0x4')],'set':function(_0x136a8e){var _0x2ba059=moment(_0x136a8e);var _0x7dc45d=moment(this[_0x149c('0x5')](_0x149c('0x6')))['format'](_0x149c('0x7'));var _0x1d2c63=_0x2ba059['diff'](_0x7dc45d,_0x149c('0x8'));this[_0x149c('0x9')](_0x149c('0xa'),_0x136a8e);this['setDataValue'](_0x149c('0xb'),_0x1d2c63||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x149c('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x149c('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x149c('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x149c('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x149c('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x149c('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x149c('0x3')],'comment':_0x149c('0xe')},'originalposition':{'type':Sequelize[_0x149c('0xc')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x149c('0x3')]},'connectedlinename':{'type':Sequelize[_0x149c('0x3')]},'accountcode':{'type':Sequelize[_0x149c('0x3')]},'context':{'type':Sequelize[_0x149c('0x3')]},'exten':{'type':Sequelize[_0x149c('0x3')]},'priority':{'type':Sequelize[_0x149c('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x149c('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x149c('0x3')]},'transfer':{'type':Sequelize[_0x149c('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x149c('0x3')],'comment':_0x149c('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x149c('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x149c('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x149c('0xc')],'defaultValue':0x0}};
\ No newline at end of file
index 66f44cd..4927c12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd852=['count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','VoiceQueueReport','include','findAll','catch','show','params','includeAll','find','create','body','describe','getVoiceQueuesReport','pick','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd852,0x113));var _0x2d85=function(_0x1f8420,_0x47c03f){_0x1f8420=_0x1f8420-0x0;var _0x4d8b52=_0xd852[_0x1f8420];return _0x4d8b52;};'use strict';var emlformat=require(_0x2d85('0x0'));var rimraf=require(_0x2d85('0x1'));var zipdir=require(_0x2d85('0x2'));var jsonpatch=require(_0x2d85('0x3'));var rp=require('request-promise');var moment=require(_0x2d85('0x4'));var BPromise=require(_0x2d85('0x5'));var Mustache=require(_0x2d85('0x6'));var util=require(_0x2d85('0x7'));var path=require(_0x2d85('0x8'));var sox=require('sox');var csv=require(_0x2d85('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2d85('0xa'));var crypto=require('crypto');var jsforce=require(_0x2d85('0xb'));var deskjs=require(_0x2d85('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2d85('0xd'));var Redis=require(_0x2d85('0xe'));var authService=require(_0x2d85('0xf'));var qs=require(_0x2d85('0x10'));var as=require(_0x2d85('0x11'));var hardwareService=require(_0x2d85('0x12'));var logger=require('../../config/logger')(_0x2d85('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2d85('0x14'))['db'];config[_0x2d85('0x15')]=_['defaults'](config[_0x2d85('0x15')],{'host':_0x2d85('0x16'),'port':0x18eb});var socket=require(_0x2d85('0x17'))(new Redis(config['redis']));require(_0x2d85('0x18'))[_0x2d85('0x19')](socket);function respondWithStatusCode(_0x278a3a,_0x4448d5){_0x4448d5=_0x4448d5||0xcc;return function(_0x230d1e){if(_0x230d1e){return _0x278a3a[_0x2d85('0x1a')](_0x4448d5);}return _0x278a3a[_0x2d85('0x1b')](_0x4448d5)[_0x2d85('0x1c')]();};}function respondWithResult(_0x52e5ed,_0x2a5b5d){_0x2a5b5d=_0x2a5b5d||0xc8;return function(_0x51e7ee){if(_0x51e7ee){return _0x52e5ed[_0x2d85('0x1b')](_0x2a5b5d)[_0x2d85('0x1d')](_0x51e7ee);}};}function respondWithFilteredResult(_0x2e7b6e,_0xdef5f0){return function(_0xf38692){if(_0xf38692){var _0xddfcef=typeof _0xdef5f0[_0x2d85('0x1e')]===_0x2d85('0x1f')&&typeof _0xdef5f0[_0x2d85('0x20')]===_0x2d85('0x1f');var _0x5cc2ff=_0xf38692['count'];var _0x3d837d=_0xddfcef?0x0:_0xdef5f0['offset'];var _0x1fac15=_0xddfcef?_0xf38692[_0x2d85('0x21')]:_0xdef5f0[_0x2d85('0x1e')]+_0xdef5f0[_0x2d85('0x20')];var _0x4bf94c;if(_0x1fac15>=_0x5cc2ff){_0x1fac15=_0x5cc2ff;_0x4bf94c=0xc8;}else{_0x4bf94c=0xce;}_0x2e7b6e[_0x2d85('0x1b')](_0x4bf94c);return _0x2e7b6e[_0x2d85('0x22')](_0x2d85('0x23'),_0x3d837d+'-'+_0x1fac15+'/'+_0x5cc2ff)[_0x2d85('0x1d')](_0xf38692);}return null;};}function patchUpdates(_0x4c26f1){return function(_0x408f95){try{jsonpatch[_0x2d85('0x24')](_0x408f95,_0x4c26f1,!![]);}catch(_0x2aabb9){return BPromise['reject'](_0x2aabb9);}return _0x408f95[_0x2d85('0x25')]();};}function saveUpdates(_0x17203c,_0x46104c){return function(_0x5a245c){if(_0x5a245c){return _0x5a245c[_0x2d85('0x26')](_0x17203c)['then'](function(_0x4e62cd){return _0x4e62cd;});}return null;};}function removeEntity(_0x30346f,_0x5a4592){return function(_0x328c6a){if(_0x328c6a){return _0x328c6a[_0x2d85('0x27')]()[_0x2d85('0x28')](function(){_0x30346f['status'](0xcc)[_0x2d85('0x1c')]();});}};}function handleEntityNotFound(_0x23d682,_0x10ea88){return function(_0x189e64){if(!_0x189e64){_0x23d682[_0x2d85('0x1a')](0x194);}return _0x189e64;};}function handleError(_0x1932be,_0x4264a3){_0x4264a3=_0x4264a3||0x1f4;return function(_0x4253bd){logger[_0x2d85('0x29')](_0x4253bd[_0x2d85('0x2a')]);if(_0x4253bd[_0x2d85('0x2b')]){delete _0x4253bd[_0x2d85('0x2b')];}_0x1932be[_0x2d85('0x1b')](_0x4264a3)[_0x2d85('0x2c')](_0x4253bd);};}exports['index']=function(_0x3d9689,_0x1c240d){var _0x5527b5={},_0x7cabbd={},_0x1f418d={'count':0x0,'rows':[]};var _0x2bf079=_[_0x2d85('0x2d')](db['VoiceQueueReport'][_0x2d85('0x2e')],function(_0xd34b27){return{'name':_0xd34b27[_0x2d85('0x2f')],'type':_0xd34b27[_0x2d85('0x30')]['key']};});_0x7cabbd[_0x2d85('0x31')]=_[_0x2d85('0x2d')](_0x2bf079,_0x2d85('0x2b'));_0x7cabbd[_0x2d85('0x32')]=_[_0x2d85('0x33')](_0x3d9689[_0x2d85('0x32')]);_0x7cabbd[_0x2d85('0x34')]=_[_0x2d85('0x35')](_0x7cabbd['model'],_0x7cabbd['query']);_0x5527b5[_0x2d85('0x36')]=_[_0x2d85('0x35')](_0x7cabbd[_0x2d85('0x31')],qs['fields'](_0x3d9689[_0x2d85('0x32')][_0x2d85('0x37')]));_0x5527b5[_0x2d85('0x36')]=_0x5527b5[_0x2d85('0x36')][_0x2d85('0x38')]?_0x5527b5[_0x2d85('0x36')]:_0x7cabbd[_0x2d85('0x31')];if(!_0x3d9689[_0x2d85('0x32')][_0x2d85('0x39')](_0x2d85('0x3a'))){_0x5527b5['limit']=qs['limit'](_0x3d9689[_0x2d85('0x32')][_0x2d85('0x20')]);_0x5527b5[_0x2d85('0x1e')]=qs[_0x2d85('0x1e')](_0x3d9689['query'][_0x2d85('0x1e')]);}_0x5527b5['order']=qs[_0x2d85('0x3b')](_0x3d9689[_0x2d85('0x32')][_0x2d85('0x3b')]);_0x5527b5['where']=qs[_0x2d85('0x34')](_['pick'](_0x3d9689['query'],_0x7cabbd[_0x2d85('0x34')]),_0x2bf079);if(_0x3d9689[_0x2d85('0x32')][_0x2d85('0x3c')]){_0x5527b5['where']=_[_0x2d85('0x3d')](_0x5527b5[_0x2d85('0x3e')],{'$or':_[_0x2d85('0x2d')](_0x2bf079,function(_0x2e8536){if(_0x2e8536['type']!=='VIRTUAL'){var _0x3d2456={};_0x3d2456[_0x2e8536['name']]={'$like':'%'+_0x3d9689[_0x2d85('0x32')][_0x2d85('0x3c')]+'%'};return _0x3d2456;}})});}_0x5527b5=_[_0x2d85('0x3d')]({},_0x5527b5,_0x3d9689[_0x2d85('0x3f')]);var _0x4f9ed3={'where':_0x5527b5['where']};return db[_0x2d85('0x40')][_0x2d85('0x21')](_0x4f9ed3)[_0x2d85('0x28')](function(_0x124d47){_0x1f418d['count']=_0x124d47;if(_0x3d9689['query']['includeAll']){_0x5527b5[_0x2d85('0x41')]=[{'all':!![]}];}return db[_0x2d85('0x40')][_0x2d85('0x42')](_0x5527b5);})['then'](function(_0x4b68ae){_0x1f418d['rows']=_0x4b68ae;return _0x1f418d;})[_0x2d85('0x28')](respondWithFilteredResult(_0x1c240d,_0x5527b5))[_0x2d85('0x43')](handleError(_0x1c240d,null));};exports[_0x2d85('0x44')]=function(_0x51bd49,_0x409146){var _0x1cad05={'raw':![],'where':{'id':_0x51bd49[_0x2d85('0x45')]['id']}},_0x3c9ac1={};_0x3c9ac1['model']=_[_0x2d85('0x33')](db[_0x2d85('0x40')][_0x2d85('0x2e')]);_0x3c9ac1[_0x2d85('0x32')]=_[_0x2d85('0x33')](_0x51bd49[_0x2d85('0x32')]);_0x3c9ac1[_0x2d85('0x34')]=_[_0x2d85('0x35')](_0x3c9ac1['model'],_0x3c9ac1[_0x2d85('0x32')]);_0x1cad05[_0x2d85('0x36')]=_[_0x2d85('0x35')](_0x3c9ac1[_0x2d85('0x31')],qs[_0x2d85('0x37')](_0x51bd49[_0x2d85('0x32')]['fields']));_0x1cad05[_0x2d85('0x36')]=_0x1cad05['attributes'][_0x2d85('0x38')]?_0x1cad05[_0x2d85('0x36')]:_0x3c9ac1[_0x2d85('0x31')];if(_0x51bd49['query'][_0x2d85('0x46')]){_0x1cad05[_0x2d85('0x41')]=[{'all':!![]}];}_0x1cad05=_[_0x2d85('0x3d')]({},_0x1cad05,_0x51bd49['options']);return db[_0x2d85('0x40')][_0x2d85('0x47')](_0x1cad05)[_0x2d85('0x28')](handleEntityNotFound(_0x409146,null))[_0x2d85('0x28')](respondWithResult(_0x409146,null))[_0x2d85('0x43')](handleError(_0x409146,null));};exports[_0x2d85('0x48')]=function(_0x488647,_0x20bc2e){return db['VoiceQueueReport'][_0x2d85('0x48')](_0x488647[_0x2d85('0x49')],{})[_0x2d85('0x28')](respondWithResult(_0x20bc2e,0xc9))[_0x2d85('0x43')](handleError(_0x20bc2e,null));};exports['update']=function(_0x1c10dc,_0x1857ac){if(_0x1c10dc[_0x2d85('0x49')]['id']){delete _0x1c10dc[_0x2d85('0x49')]['id'];}return db[_0x2d85('0x40')][_0x2d85('0x47')]({'where':{'id':_0x1c10dc[_0x2d85('0x45')]['id']}})[_0x2d85('0x28')](handleEntityNotFound(_0x1857ac,null))[_0x2d85('0x28')](saveUpdates(_0x1c10dc[_0x2d85('0x49')],null))[_0x2d85('0x28')](respondWithResult(_0x1857ac,null))[_0x2d85('0x43')](handleError(_0x1857ac,null));};exports['destroy']=function(_0x51e85d,_0x3d02c2){return db[_0x2d85('0x40')]['find']({'where':{'id':_0x51e85d[_0x2d85('0x45')]['id']}})[_0x2d85('0x28')](handleEntityNotFound(_0x3d02c2,null))[_0x2d85('0x28')](removeEntity(_0x3d02c2,null))[_0x2d85('0x43')](handleError(_0x3d02c2,null));};exports[_0x2d85('0x4a')]=function(_0x4e1ca9,_0x10125e){return db['VoiceQueueReport'][_0x2d85('0x4a')]()['then'](respondWithResult(_0x10125e,null))[_0x2d85('0x43')](handleError(_0x10125e,null));};exports[_0x2d85('0x4b')]=function(_0x504076,_0x595808){var _0x3cf337={},_0x5c3885={},_0x46bc95={'count':0x0,'rows':[]};_0x5c3885[_0x2d85('0x31')]=_[_0x2d85('0x33')](db[_0x2d85('0x40')][_0x2d85('0x2e')]);_0x5c3885[_0x2d85('0x32')]=_[_0x2d85('0x33')](_0x504076[_0x2d85('0x32')]);_0x5c3885[_0x2d85('0x34')]=_['intersection'](_0x5c3885[_0x2d85('0x31')],_0x5c3885[_0x2d85('0x32')]);_0x3cf337['attributes']=_[_0x2d85('0x35')](_0x5c3885[_0x2d85('0x31')],qs[_0x2d85('0x37')](_0x504076[_0x2d85('0x32')][_0x2d85('0x37')]));_0x3cf337[_0x2d85('0x36')]=_0x3cf337[_0x2d85('0x36')]['length']?_0x3cf337[_0x2d85('0x36')]:_0x5c3885['model'];if(!_0x504076['query'][_0x2d85('0x39')]('nolimit')){_0x3cf337['limit']=qs['limit'](_0x504076[_0x2d85('0x32')][_0x2d85('0x20')]);_0x3cf337[_0x2d85('0x1e')]=qs['offset'](_0x504076['query']['offset']);}_0x3cf337['order']=qs['sort'](_0x504076['query'][_0x2d85('0x3b')]);_0x3cf337[_0x2d85('0x3e')]=qs['filters'](_[_0x2d85('0x4c')](_0x504076['query'],_0x5c3885['filters']));if(_0x504076[_0x2d85('0x32')]['filter']){_0x3cf337[_0x2d85('0x3e')]=_[_0x2d85('0x3d')](_0x3cf337[_0x2d85('0x3e')],{'$or':_['map'](_0x3cf337[_0x2d85('0x36')],function(_0x25d871){var _0x2d4f73={};_0x2d4f73[_0x25d871]={'$like':'%'+_0x504076[_0x2d85('0x32')][_0x2d85('0x3c')]+'%'};return _0x2d4f73;})});}_0x3cf337=_['merge']({},_0x3cf337,_0x504076[_0x2d85('0x3f')]);var _0x5a8a5b={'where':_0x3cf337[_0x2d85('0x3e')]};return db['VoiceQueueReport'][_0x2d85('0x21')](_0x5a8a5b)['then'](function(_0x3b59fb){_0x46bc95[_0x2d85('0x21')]=_0x3b59fb;if(_0x504076['query'][_0x2d85('0x46')]){_0x3cf337['include']=[{'all':!![]}];}return db[_0x2d85('0x40')][_0x2d85('0x42')](_0x3cf337);})[_0x2d85('0x28')](function(_0x419b46){_0x46bc95['rows']=_0x419b46;return _0x46bc95;})[_0x2d85('0x28')](respondWithFilteredResult(_0x595808,_0x3cf337,_0x2d85('0x4b')))[_0x2d85('0x43')](handleError(_0x595808,null,_0x2d85('0x4b')));};
\ No newline at end of file
+var _0x104f=['redis','defaults','./voiceQueueReport.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','includeAll','include','findAll','catch','show','params','merge','find','create','body','describe','getVoiceQueuesReport','rows','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','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'];(function(_0x309d93,_0x157662){var _0x2dd61d=function(_0x25ff34){while(--_0x25ff34){_0x309d93['push'](_0x309d93['shift']());}};_0x2dd61d(++_0x157662);}(_0x104f,0x8e));var _0xf104=function(_0x2b1ef1,_0x364900){_0x2b1ef1=_0x2b1ef1-0x0;var _0x3123a6=_0x104f[_0x2b1ef1];return _0x3123a6;};'use strict';var emlformat=require(_0xf104('0x0'));var rimraf=require(_0xf104('0x1'));var zipdir=require(_0xf104('0x2'));var jsonpatch=require(_0xf104('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf104('0x4'));var Mustache=require(_0xf104('0x5'));var util=require(_0xf104('0x6'));var path=require(_0xf104('0x7'));var sox=require(_0xf104('0x8'));var csv=require(_0xf104('0x9'));var ejs=require(_0xf104('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf104('0xb'));var squel=require(_0xf104('0xc'));var crypto=require(_0xf104('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf104('0x9'));var querystring=require(_0xf104('0xe'));var Papa=require(_0xf104('0xf'));var Redis=require('ioredis');var authService=require(_0xf104('0x10'));var qs=require(_0xf104('0x11'));var as=require(_0xf104('0x12'));var hardwareService=require(_0xf104('0x13'));var logger=require(_0xf104('0x14'))(_0xf104('0x15'));var utils=require(_0xf104('0x16'));var config=require(_0xf104('0x17'));var licenseUtil=require(_0xf104('0x18'));var db=require(_0xf104('0x19'))['db'];config[_0xf104('0x1a')]=_[_0xf104('0x1b')](config[_0xf104('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf104('0x1a')]));require(_0xf104('0x1c'))[_0xf104('0x1d')](socket);function respondWithStatusCode(_0x4f6133,_0x35c4cf){_0x35c4cf=_0x35c4cf||0xcc;return function(_0x52fce4){if(_0x52fce4){return _0x4f6133[_0xf104('0x1e')](_0x35c4cf);}return _0x4f6133[_0xf104('0x1f')](_0x35c4cf)[_0xf104('0x20')]();};}function respondWithResult(_0xecabd,_0x2ba414){_0x2ba414=_0x2ba414||0xc8;return function(_0x393dae){if(_0x393dae){return _0xecabd[_0xf104('0x1f')](_0x2ba414)['json'](_0x393dae);}};}function respondWithFilteredResult(_0x5c6490,_0x2a0c76){return function(_0x213d08){if(_0x213d08){var _0x1ae84b=typeof _0x2a0c76[_0xf104('0x21')]==='undefined'&&typeof _0x2a0c76[_0xf104('0x22')]===_0xf104('0x23');var _0x58bf9a=_0x213d08['count'];var _0x21342d=_0x1ae84b?0x0:_0x2a0c76[_0xf104('0x21')];var _0x182101=_0x1ae84b?_0x213d08[_0xf104('0x24')]:_0x2a0c76[_0xf104('0x21')]+_0x2a0c76[_0xf104('0x22')];var _0x9b8cbf;if(_0x182101>=_0x58bf9a){_0x182101=_0x58bf9a;_0x9b8cbf=0xc8;}else{_0x9b8cbf=0xce;}_0x5c6490[_0xf104('0x1f')](_0x9b8cbf);return _0x5c6490[_0xf104('0x25')](_0xf104('0x26'),_0x21342d+'-'+_0x182101+'/'+_0x58bf9a)[_0xf104('0x27')](_0x213d08);}return null;};}function patchUpdates(_0x1c786e){return function(_0xf0fa1d){try{jsonpatch[_0xf104('0x28')](_0xf0fa1d,_0x1c786e,!![]);}catch(_0x29e324){return BPromise[_0xf104('0x29')](_0x29e324);}return _0xf0fa1d[_0xf104('0x2a')]();};}function saveUpdates(_0x3035cf,_0xe05c65){return function(_0x57ff8c){if(_0x57ff8c){return _0x57ff8c[_0xf104('0x2b')](_0x3035cf)[_0xf104('0x2c')](function(_0x2d1136){return _0x2d1136;});}return null;};}function removeEntity(_0x3eabeb,_0x596e1e){return function(_0x1b5f29){if(_0x1b5f29){return _0x1b5f29[_0xf104('0x2d')]()['then'](function(){_0x3eabeb[_0xf104('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x74b806,_0x3e67e4){return function(_0x10e87e){if(!_0x10e87e){_0x74b806['sendStatus'](0x194);}return _0x10e87e;};}function handleError(_0x3ecb66,_0x26d668){_0x26d668=_0x26d668||0x1f4;return function(_0x4342b){logger[_0xf104('0x2e')](_0x4342b[_0xf104('0x2f')]);if(_0x4342b[_0xf104('0x30')]){delete _0x4342b[_0xf104('0x30')];}_0x3ecb66[_0xf104('0x1f')](_0x26d668)['send'](_0x4342b);};}exports[_0xf104('0x31')]=function(_0x5b2634,_0x49963b){var _0x3264f9={},_0x25716e={},_0x4ff2b2={'count':0x0,'rows':[]};var _0x53ae35=_[_0xf104('0x32')](db[_0xf104('0x33')][_0xf104('0x34')],function(_0x126c59){return{'name':_0x126c59[_0xf104('0x35')],'type':_0x126c59[_0xf104('0x36')]['key']};});_0x25716e[_0xf104('0x37')]=_[_0xf104('0x32')](_0x53ae35,'name');_0x25716e[_0xf104('0x38')]=_[_0xf104('0x39')](_0x5b2634[_0xf104('0x38')]);_0x25716e['filters']=_[_0xf104('0x3a')](_0x25716e[_0xf104('0x37')],_0x25716e[_0xf104('0x38')]);_0x3264f9[_0xf104('0x3b')]=_[_0xf104('0x3a')](_0x25716e[_0xf104('0x37')],qs['fields'](_0x5b2634[_0xf104('0x38')][_0xf104('0x3c')]));_0x3264f9[_0xf104('0x3b')]=_0x3264f9['attributes'][_0xf104('0x3d')]?_0x3264f9[_0xf104('0x3b')]:_0x25716e[_0xf104('0x37')];if(!_0x5b2634[_0xf104('0x38')][_0xf104('0x3e')](_0xf104('0x3f'))){_0x3264f9[_0xf104('0x22')]=qs[_0xf104('0x22')](_0x5b2634[_0xf104('0x38')][_0xf104('0x22')]);_0x3264f9['offset']=qs['offset'](_0x5b2634['query'][_0xf104('0x21')]);}_0x3264f9[_0xf104('0x40')]=qs[_0xf104('0x41')](_0x5b2634[_0xf104('0x38')]['sort']);_0x3264f9[_0xf104('0x42')]=qs[_0xf104('0x43')](_[_0xf104('0x44')](_0x5b2634[_0xf104('0x38')],_0x25716e[_0xf104('0x43')]),_0x53ae35);if(_0x5b2634[_0xf104('0x38')][_0xf104('0x45')]){_0x3264f9[_0xf104('0x42')]=_['merge'](_0x3264f9[_0xf104('0x42')],{'$or':_['map'](_0x53ae35,function(_0x56ed83){if(_0x56ed83['type']!=='VIRTUAL'){var _0x5adc8a={};_0x5adc8a[_0x56ed83['name']]={'$like':'%'+_0x5b2634[_0xf104('0x38')][_0xf104('0x45')]+'%'};return _0x5adc8a;}})});}_0x3264f9=_['merge']({},_0x3264f9,_0x5b2634[_0xf104('0x46')]);var _0x5bb99f={'where':_0x3264f9[_0xf104('0x42')]};return db[_0xf104('0x33')]['count'](_0x5bb99f)[_0xf104('0x2c')](function(_0x588c61){_0x4ff2b2[_0xf104('0x24')]=_0x588c61;if(_0x5b2634[_0xf104('0x38')][_0xf104('0x47')]){_0x3264f9[_0xf104('0x48')]=[{'all':!![]}];}return db[_0xf104('0x33')][_0xf104('0x49')](_0x3264f9);})[_0xf104('0x2c')](function(_0x25a1f9){_0x4ff2b2['rows']=_0x25a1f9;return _0x4ff2b2;})[_0xf104('0x2c')](respondWithFilteredResult(_0x49963b,_0x3264f9))[_0xf104('0x4a')](handleError(_0x49963b,null));};exports[_0xf104('0x4b')]=function(_0xc45afd,_0x58e106){var _0x5e281a={'raw':![],'where':{'id':_0xc45afd[_0xf104('0x4c')]['id']}},_0x24f01b={};_0x24f01b['model']=_['keys'](db['VoiceQueueReport'][_0xf104('0x34')]);_0x24f01b[_0xf104('0x38')]=_['keys'](_0xc45afd[_0xf104('0x38')]);_0x24f01b[_0xf104('0x43')]=_[_0xf104('0x3a')](_0x24f01b[_0xf104('0x37')],_0x24f01b[_0xf104('0x38')]);_0x5e281a['attributes']=_[_0xf104('0x3a')](_0x24f01b[_0xf104('0x37')],qs['fields'](_0xc45afd['query'][_0xf104('0x3c')]));_0x5e281a[_0xf104('0x3b')]=_0x5e281a[_0xf104('0x3b')][_0xf104('0x3d')]?_0x5e281a[_0xf104('0x3b')]:_0x24f01b[_0xf104('0x37')];if(_0xc45afd['query'][_0xf104('0x47')]){_0x5e281a['include']=[{'all':!![]}];}_0x5e281a=_[_0xf104('0x4d')]({},_0x5e281a,_0xc45afd[_0xf104('0x46')]);return db[_0xf104('0x33')][_0xf104('0x4e')](_0x5e281a)[_0xf104('0x2c')](handleEntityNotFound(_0x58e106,null))[_0xf104('0x2c')](respondWithResult(_0x58e106,null))['catch'](handleError(_0x58e106,null));};exports[_0xf104('0x4f')]=function(_0x197a1d,_0x5ba5e4){return db[_0xf104('0x33')]['create'](_0x197a1d['body'],{})[_0xf104('0x2c')](respondWithResult(_0x5ba5e4,0xc9))[_0xf104('0x4a')](handleError(_0x5ba5e4,null));};exports[_0xf104('0x2b')]=function(_0x4fa7a5,_0x20568b){if(_0x4fa7a5['body']['id']){delete _0x4fa7a5[_0xf104('0x50')]['id'];}return db[_0xf104('0x33')][_0xf104('0x4e')]({'where':{'id':_0x4fa7a5[_0xf104('0x4c')]['id']}})[_0xf104('0x2c')](handleEntityNotFound(_0x20568b,null))[_0xf104('0x2c')](saveUpdates(_0x4fa7a5['body'],null))[_0xf104('0x2c')](respondWithResult(_0x20568b,null))[_0xf104('0x4a')](handleError(_0x20568b,null));};exports[_0xf104('0x2d')]=function(_0x23c376,_0x25794d){return db[_0xf104('0x33')]['find']({'where':{'id':_0x23c376['params']['id']}})[_0xf104('0x2c')](handleEntityNotFound(_0x25794d,null))[_0xf104('0x2c')](removeEntity(_0x25794d,null))[_0xf104('0x4a')](handleError(_0x25794d,null));};exports['describe']=function(_0x5afdaf,_0x121e71){return db[_0xf104('0x33')][_0xf104('0x51')]()['then'](respondWithResult(_0x121e71,null))[_0xf104('0x4a')](handleError(_0x121e71,null));};exports[_0xf104('0x52')]=function(_0x4e8900,_0x5a9c0f){var _0x5bbbd6={},_0x3f699c={},_0x190299={'count':0x0,'rows':[]};_0x3f699c['model']=_[_0xf104('0x39')](db[_0xf104('0x33')][_0xf104('0x34')]);_0x3f699c['query']=_[_0xf104('0x39')](_0x4e8900['query']);_0x3f699c[_0xf104('0x43')]=_[_0xf104('0x3a')](_0x3f699c[_0xf104('0x37')],_0x3f699c[_0xf104('0x38')]);_0x5bbbd6[_0xf104('0x3b')]=_['intersection'](_0x3f699c[_0xf104('0x37')],qs[_0xf104('0x3c')](_0x4e8900[_0xf104('0x38')]['fields']));_0x5bbbd6[_0xf104('0x3b')]=_0x5bbbd6[_0xf104('0x3b')][_0xf104('0x3d')]?_0x5bbbd6['attributes']:_0x3f699c[_0xf104('0x37')];if(!_0x4e8900['query']['hasOwnProperty']('nolimit')){_0x5bbbd6[_0xf104('0x22')]=qs[_0xf104('0x22')](_0x4e8900[_0xf104('0x38')][_0xf104('0x22')]);_0x5bbbd6[_0xf104('0x21')]=qs[_0xf104('0x21')](_0x4e8900[_0xf104('0x38')][_0xf104('0x21')]);}_0x5bbbd6[_0xf104('0x40')]=qs[_0xf104('0x41')](_0x4e8900['query'][_0xf104('0x41')]);_0x5bbbd6[_0xf104('0x42')]=qs[_0xf104('0x43')](_[_0xf104('0x44')](_0x4e8900[_0xf104('0x38')],_0x3f699c[_0xf104('0x43')]));if(_0x4e8900[_0xf104('0x38')][_0xf104('0x45')]){_0x5bbbd6[_0xf104('0x42')]=_['merge'](_0x5bbbd6[_0xf104('0x42')],{'$or':_['map'](_0x5bbbd6[_0xf104('0x3b')],function(_0x3f7fff){var _0x54e880={};_0x54e880[_0x3f7fff]={'$like':'%'+_0x4e8900[_0xf104('0x38')]['filter']+'%'};return _0x54e880;})});}_0x5bbbd6=_['merge']({},_0x5bbbd6,_0x4e8900[_0xf104('0x46')]);var _0x355b20={'where':_0x5bbbd6[_0xf104('0x42')]};return db[_0xf104('0x33')][_0xf104('0x24')](_0x355b20)[_0xf104('0x2c')](function(_0x164740){_0x190299[_0xf104('0x24')]=_0x164740;if(_0x4e8900[_0xf104('0x38')]['includeAll']){_0x5bbbd6['include']=[{'all':!![]}];}return db[_0xf104('0x33')][_0xf104('0x49')](_0x5bbbd6);})[_0xf104('0x2c')](function(_0x7915be){_0x190299[_0xf104('0x53')]=_0x7915be;return _0x190299;})['then'](respondWithFilteredResult(_0x5a9c0f,_0x5bbbd6,'getVoiceQueuesReport'))[_0xf104('0x4a')](handleError(_0x5a9c0f,null,_0xf104('0x52')));};
\ No newline at end of file
index 31ce0a4..a61eb66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4ff=['remove','emit','hasOwnProperty','hook','events','setMaxListeners','save','update'];(function(_0x41476c,_0x91403){var _0x367e81=function(_0x5b1d38){while(--_0x5b1d38){_0x41476c['push'](_0x41476c['shift']());}};_0x367e81(++_0x91403);}(_0xf4ff,0xc4));var _0xff4f=function(_0x4efc99,_0x2c5cca){_0x4efc99=_0x4efc99-0x0;var _0x1b53ad=_0xf4ff[_0x4efc99];return _0x1b53ad;};'use strict';var EventEmitter=require(_0xff4f('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xff4f('0x1')](0x0);var events={'afterCreate':_0xff4f('0x2'),'afterUpdate':_0xff4f('0x3'),'afterDestroy':_0xff4f('0x4')};function emitEvent(_0x4b7bdd){return function(_0x1e0b14,_0x8e223d,_0x1a7f25){VoiceQueueReportEvents[_0xff4f('0x5')](_0x4b7bdd+':'+_0x1e0b14['id'],_0x1e0b14);VoiceQueueReportEvents[_0xff4f('0x5')](_0x4b7bdd,_0x1e0b14);_0x1a7f25(null);};}for(var e in events){if(events[_0xff4f('0x6')](e)){var event=events[e];VoiceQueueReport[_0xff4f('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xbae4=['exports','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x46c0db,_0x1963b2){var _0x193fce=function(_0x12da7f){while(--_0x12da7f){_0x46c0db['push'](_0x46c0db['shift']());}};_0x193fce(++_0x1963b2);}(_0xbae4,0x123));var _0x4bae=function(_0x33f1da,_0x4a1f3e){_0x33f1da=_0x33f1da-0x0;var _0x24b3ce=_0xbae4[_0x33f1da];return _0x24b3ce;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x4bae('0x0'))['db'][_0x4bae('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x4bae('0x2')](0x0);var events={'afterCreate':_0x4bae('0x3'),'afterUpdate':_0x4bae('0x4'),'afterDestroy':_0x4bae('0x5')};function emitEvent(_0x18bdf7){return function(_0x6586af,_0xe2ccd7,_0x201d9f){VoiceQueueReportEvents[_0x4bae('0x6')](_0x18bdf7+':'+_0x6586af['id'],_0x6586af);VoiceQueueReportEvents['emit'](_0x18bdf7,_0x6586af);_0x201d9f(null);};}for(var e in events){if(events[_0x4bae('0x7')](e)){var event=events[e];VoiceQueueReport[_0x4bae('0x8')](e,emitEvent(event));}}module[_0x4bae('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
index 92ff06c..f7a4b0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb0f=['uniqueid','calleridnum','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xeb0f,0x101));var _0xfeb0=function(_0x398094,_0x54dd2d){_0x398094=_0x398094-0x0;var _0x55353c=_0xeb0f[_0x398094];return _0x55353c;};'use strict';var _=require('lodash');var util=require(_0xfeb0('0x0'));var logger=require(_0xfeb0('0x1'))(_0xfeb0('0x2'));var moment=require(_0xfeb0('0x3'));var BPromise=require(_0xfeb0('0x4'));var rp=require(_0xfeb0('0x5'));var fs=require('fs');var path=require(_0xfeb0('0x6'));var rimraf=require('rimraf');var config=require(_0xfeb0('0x7'));var attributes=require(_0xfeb0('0x8'));module[_0xfeb0('0x9')]=function(_0x1cbc6d,_0x3ec4b4){return _0x1cbc6d[_0xfeb0('0xa')](_0xfeb0('0xb'),attributes,{'tableName':_0xfeb0('0xc'),'paranoid':![],'indexes':[{'fields':[_0xfeb0('0xd')]},{'fields':[_0xfeb0('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x64b6=['../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x391c34,_0x19d09e){var _0x15b20d=function(_0xa46ab2){while(--_0xa46ab2){_0x391c34['push'](_0x391c34['shift']());}};_0x15b20d(++_0x19d09e);}(_0x64b6,0x68));var _0x664b=function(_0x7b842c,_0x393863){_0x7b842c=_0x7b842c-0x0;var _0x5c3f59=_0x64b6[_0x7b842c];return _0x5c3f59;};'use strict';var _=require(_0x664b('0x0'));var util=require(_0x664b('0x1'));var logger=require(_0x664b('0x2'))(_0x664b('0x3'));var moment=require(_0x664b('0x4'));var BPromise=require(_0x664b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x664b('0x6'));var rimraf=require(_0x664b('0x7'));var config=require(_0x664b('0x8'));var attributes=require(_0x664b('0x9'));module['exports']=function(_0x492b13,_0x73c82){return _0x492b13[_0x664b('0xa')](_0x664b('0xb'),attributes,{'tableName':_0x664b('0xc'),'paranoid':![],'indexes':[{'fields':[_0x664b('0xd')]},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
index ab11ead..82952da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd042=['UpdateVoiceQueueReport','where','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','VoiceQueueReport','findAll','options','raw','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','debug'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xd042,0x1ba));var _0x2d04=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd042[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x2d04('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2d04('0x1'));var fs=require('fs');var Redis=require(_0x2d04('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d04('0x3'));var logger=require('../../config/logger')(_0x2d04('0x4'));var config=require(_0x2d04('0x5'));var jayson=require(_0x2d04('0x6'));var client=jayson[_0x2d04('0x7')][_0x2d04('0x8')]({'port':0x232a});config[_0x2d04('0x9')]=_[_0x2d04('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2d04('0xb'))(new Redis(config['redis']));require(_0x2d04('0xc'))[_0x2d04('0xd')](socket);function respondWithRpcPromise(_0xb6c766,_0x4c1347,_0x3fb353){return new BPromise(function(_0x3b430d,_0x40adc8){return client[_0x2d04('0xe')](_0xb6c766,_0x3fb353)[_0x2d04('0xf')](function(_0x17e08b){logger[_0x2d04('0x10')](_0x2d04('0x11'),_0x4c1347,_0x2d04('0x12'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x4c1347,_0x2d04('0x12'),JSON[_0x2d04('0x13')](_0x17e08b));if(_0x17e08b[_0x2d04('0x14')]){if(_0x17e08b[_0x2d04('0x14')][_0x2d04('0x15')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x4c1347,_0x17e08b[_0x2d04('0x14')]['message']);return _0x40adc8(_0x17e08b['error']['message']);}logger[_0x2d04('0x14')](_0x2d04('0x11'),_0x4c1347,_0x17e08b['error'][_0x2d04('0x16')]);return _0x3b430d(_0x17e08b[_0x2d04('0x14')][_0x2d04('0x16')]);}else{logger[_0x2d04('0x10')](_0x2d04('0x11'),_0x4c1347,'request\x20sent');_0x3b430d(_0x17e08b[_0x2d04('0x17')][_0x2d04('0x16')]);}})['catch'](function(_0x2f4c34){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x4c1347,_0x2f4c34);_0x40adc8(_0x2f4c34);});});}exports['GetVoiceQueueReport']=function(_0x48c55a){var _0x4a955e=this;return new Promise(function(_0x22eb01,_0x519b2a){return db[_0x2d04('0x18')][_0x2d04('0x19')]({'raw':_0x48c55a[_0x2d04('0x1a')]?_0x48c55a[_0x2d04('0x1a')][_0x2d04('0x1b')]===undefined?!![]:![]:!![],'where':_0x48c55a[_0x2d04('0x1a')]?_0x48c55a[_0x2d04('0x1a')]['where']||null:null,'attributes':_0x48c55a[_0x2d04('0x1a')]?_0x48c55a['options'][_0x2d04('0x1c')]||null:null,'limit':_0x48c55a[_0x2d04('0x1a')]?_0x48c55a['options'][_0x2d04('0x1d')]||null:null,'include':_0x48c55a[_0x2d04('0x1a')]?_0x48c55a[_0x2d04('0x1a')][_0x2d04('0x1e')]?_[_0x2d04('0x1f')](_0x48c55a[_0x2d04('0x1a')][_0x2d04('0x1e')],function(_0x4c20ea){return{'model':db[_0x4c20ea['model']],'as':_0x4c20ea['as'],'attributes':_0x4c20ea['attributes'],'include':_0x4c20ea[_0x2d04('0x1e')]?_[_0x2d04('0x1f')](_0x4c20ea[_0x2d04('0x1e')],function(_0x100cec){return{'model':db[_0x100cec['model']],'as':_0x100cec['as'],'attributes':_0x100cec[_0x2d04('0x1c')],'include':_0x100cec[_0x2d04('0x1e')]?_[_0x2d04('0x1f')](_0x100cec[_0x2d04('0x1e')],function(_0x110bfe){return{'model':db[_0x110bfe[_0x2d04('0x20')]],'as':_0x110bfe['as'],'attributes':_0x110bfe[_0x2d04('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2d04('0xf')](function(_0x5600eb){logger['info'](_0x2d04('0x21'),_0x48c55a);logger['debug'](_0x2d04('0x21'),_0x48c55a,JSON[_0x2d04('0x13')](_0x5600eb));_0x22eb01(_0x5600eb);})['catch'](function(_0x5eedc4){logger['error']('GetVoiceQueueReport',_0x5eedc4['message'],_0x48c55a);_0x519b2a(_0x4a955e[_0x2d04('0x14')](0x1f4,_0x5eedc4[_0x2d04('0x16')]));});});};exports[_0x2d04('0x22')]=function(_0x2803df){var _0x586489=this;return new Promise(function(_0x424502,_0x813f15){return db[_0x2d04('0x18')][_0x2d04('0x23')](_0x2803df[_0x2d04('0x24')],{'raw':_0x2803df[_0x2d04('0x1a')]?_0x2803df[_0x2d04('0x1a')][_0x2d04('0x1b')]===undefined?!![]:![]:!![]})[_0x2d04('0xf')](function(_0x526498){logger['info'](_0x2d04('0x22'),_0x2803df);logger[_0x2d04('0x25')]('CreateVoiceQueueReport',_0x2803df,JSON['stringify'](_0x526498));_0x424502(_0x526498);})['catch'](function(_0x481e0f){logger[_0x2d04('0x14')](_0x2d04('0x22'),_0x481e0f[_0x2d04('0x16')],_0x2803df);_0x813f15(_0x586489[_0x2d04('0x14')](0x1f4,_0x481e0f[_0x2d04('0x16')]));});});};exports[_0x2d04('0x26')]=function(_0x350152){var _0x26930f=this;return new Promise(function(_0x2c7aaa,_0x5b3506){return db[_0x2d04('0x18')]['update'](_0x350152['body'],{'raw':_0x350152[_0x2d04('0x1a')]?_0x350152[_0x2d04('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x350152[_0x2d04('0x1a')]?_0x350152[_0x2d04('0x1a')][_0x2d04('0x27')]||null:null,'attributes':_0x350152[_0x2d04('0x1a')]?_0x350152[_0x2d04('0x1a')][_0x2d04('0x1c')]||null:null,'limit':_0x350152[_0x2d04('0x1a')]?_0x350152['options']['limit']||null:null})[_0x2d04('0xf')](function(_0x233df0){logger['info'](_0x2d04('0x26'),_0x350152);logger['debug'](_0x2d04('0x26'),_0x350152,JSON['stringify'](_0x233df0));_0x2c7aaa(_0x233df0);})['catch'](function(_0x24e332){logger[_0x2d04('0x14')]('UpdateVoiceQueueReport',_0x24e332['message'],_0x350152);_0x5b3506(_0x26930f['error'](0x1f4,_0x24e332['message']));});});};
\ No newline at end of file
+var _0x0923=['model','then','catch','CreateVoiceQueueReport','VoiceQueueReport','UpdateVoiceQueueReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','GetVoiceQueueReport','findAll','options','raw','attributes','include','map'];(function(_0x2bc97a,_0x269874){var _0x347b46=function(_0x3ef9b9){while(--_0x3ef9b9){_0x2bc97a['push'](_0x2bc97a['shift']());}};_0x347b46(++_0x269874);}(_0x0923,0x64));var _0x3092=function(_0xde4036,_0x117c19){_0xde4036=_0xde4036-0x0;var _0x343997=_0x0923[_0xde4036];return _0x343997;};'use strict';var _=require(_0x3092('0x0'));var util=require(_0x3092('0x1'));var moment=require(_0x3092('0x2'));var BPromise=require(_0x3092('0x3'));var rs=require(_0x3092('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3092('0x5'))['db'];var utils=require(_0x3092('0x6'));var logger=require(_0x3092('0x7'))('rpc');var config=require(_0x3092('0x8'));var jayson=require(_0x3092('0x9'));var client=jayson[_0x3092('0xa')][_0x3092('0xb')]({'port':0x232a});config[_0x3092('0xc')]=_['defaults'](config[_0x3092('0xc')],{'host':_0x3092('0xd'),'port':0x18eb});var socket=require(_0x3092('0xe'))(new Redis(config[_0x3092('0xc')]));require(_0x3092('0xf'))[_0x3092('0x10')](socket);function respondWithRpcPromise(_0x4b4a4c,_0xeaf8e9,_0x1ea638){return new BPromise(function(_0x4b6688,_0x27f30e){return client[_0x3092('0x11')](_0x4b4a4c,_0x1ea638)['then'](function(_0x5f3cbb){logger[_0x3092('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0xeaf8e9,_0x3092('0x13'));logger[_0x3092('0x14')](_0x3092('0x15'),_0xeaf8e9,_0x3092('0x13'),JSON[_0x3092('0x16')](_0x5f3cbb));if(_0x5f3cbb[_0x3092('0x17')]){if(_0x5f3cbb['error'][_0x3092('0x18')]===0x1f4){logger['error'](_0x3092('0x19'),_0xeaf8e9,_0x5f3cbb[_0x3092('0x17')]['message']);return _0x27f30e(_0x5f3cbb[_0x3092('0x17')][_0x3092('0x1a')]);}logger[_0x3092('0x17')](_0x3092('0x19'),_0xeaf8e9,_0x5f3cbb[_0x3092('0x17')][_0x3092('0x1a')]);return _0x4b6688(_0x5f3cbb[_0x3092('0x17')][_0x3092('0x1a')]);}else{logger[_0x3092('0x12')](_0x3092('0x19'),_0xeaf8e9,_0x3092('0x13'));_0x4b6688(_0x5f3cbb[_0x3092('0x1b')]['message']);}})['catch'](function(_0x536b5d){logger[_0x3092('0x17')](_0x3092('0x19'),_0xeaf8e9,_0x536b5d);_0x27f30e(_0x536b5d);});});}exports[_0x3092('0x1c')]=function(_0x31979d){var _0x563868=this;return new Promise(function(_0x22e39b,_0x4e9480){return db['VoiceQueueReport'][_0x3092('0x1d')]({'raw':_0x31979d[_0x3092('0x1e')]?_0x31979d['options'][_0x3092('0x1f')]===undefined?!![]:![]:!![],'where':_0x31979d['options']?_0x31979d[_0x3092('0x1e')]['where']||null:null,'attributes':_0x31979d[_0x3092('0x1e')]?_0x31979d[_0x3092('0x1e')][_0x3092('0x20')]||null:null,'limit':_0x31979d[_0x3092('0x1e')]?_0x31979d[_0x3092('0x1e')]['limit']||null:null,'include':_0x31979d[_0x3092('0x1e')]?_0x31979d['options'][_0x3092('0x21')]?_[_0x3092('0x22')](_0x31979d[_0x3092('0x1e')][_0x3092('0x21')],function(_0x25a6cb){return{'model':db[_0x25a6cb[_0x3092('0x23')]],'as':_0x25a6cb['as'],'attributes':_0x25a6cb[_0x3092('0x20')],'include':_0x25a6cb['include']?_[_0x3092('0x22')](_0x25a6cb[_0x3092('0x21')],function(_0x4a482e){return{'model':db[_0x4a482e[_0x3092('0x23')]],'as':_0x4a482e['as'],'attributes':_0x4a482e[_0x3092('0x20')],'include':_0x4a482e['include']?_[_0x3092('0x22')](_0x4a482e[_0x3092('0x21')],function(_0x149b57){return{'model':db[_0x149b57[_0x3092('0x23')]],'as':_0x149b57['as'],'attributes':_0x149b57['attributes']};}):[]};}):[]};}):[]:[]})[_0x3092('0x24')](function(_0x20eff6){logger['info'](_0x3092('0x1c'),_0x31979d);logger[_0x3092('0x14')](_0x3092('0x1c'),_0x31979d,JSON['stringify'](_0x20eff6));_0x22e39b(_0x20eff6);})[_0x3092('0x25')](function(_0x234502){logger['error'](_0x3092('0x1c'),_0x234502[_0x3092('0x1a')],_0x31979d);_0x4e9480(_0x563868[_0x3092('0x17')](0x1f4,_0x234502['message']));});});};exports[_0x3092('0x26')]=function(_0x4c75c5){var _0x2bd255=this;return new Promise(function(_0x4d584c,_0x552ced){return db[_0x3092('0x27')]['create'](_0x4c75c5['body'],{'raw':_0x4c75c5['options']?_0x4c75c5[_0x3092('0x1e')][_0x3092('0x1f')]===undefined?!![]:![]:!![]})[_0x3092('0x24')](function(_0x4e9078){logger['info'](_0x3092('0x26'),_0x4c75c5);logger['debug'](_0x3092('0x26'),_0x4c75c5,JSON[_0x3092('0x16')](_0x4e9078));_0x4d584c(_0x4e9078);})[_0x3092('0x25')](function(_0x3bb038){logger['error']('CreateVoiceQueueReport',_0x3bb038['message'],_0x4c75c5);_0x552ced(_0x2bd255[_0x3092('0x17')](0x1f4,_0x3bb038[_0x3092('0x1a')]));});});};exports[_0x3092('0x28')]=function(_0x50f541){var _0x2d5a86=this;return new Promise(function(_0x42faa8,_0x4476bb){return db[_0x3092('0x27')][_0x3092('0x29')](_0x50f541[_0x3092('0x2a')],{'raw':_0x50f541['options']?_0x50f541[_0x3092('0x1e')][_0x3092('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50f541['options']?_0x50f541[_0x3092('0x1e')][_0x3092('0x2b')]||null:null,'attributes':_0x50f541['options']?_0x50f541['options'][_0x3092('0x20')]||null:null,'limit':_0x50f541['options']?_0x50f541[_0x3092('0x1e')][_0x3092('0x2c')]||null:null})[_0x3092('0x24')](function(_0x2da414){logger[_0x3092('0x12')](_0x3092('0x28'),_0x50f541);logger[_0x3092('0x14')](_0x3092('0x28'),_0x50f541,JSON[_0x3092('0x16')](_0x2da414));_0x42faa8(_0x2da414);})['catch'](function(_0x1498a5){logger[_0x3092('0x17')](_0x3092('0x28'),_0x1498a5[_0x3092('0x1a')],_0x50f541);_0x4476bb(_0x2d5a86[_0x3092('0x17')](0x1f4,_0x1498a5[_0x3092('0x1a')]));});});};
\ No newline at end of file
index e467bbc..d000567 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd765=['save','remove','update','emit','removeListener','length','./voiceQueueReport.events'];(function(_0x285e97,_0x3f7f63){var _0x383f43=function(_0x1795e8){while(--_0x1795e8){_0x285e97['push'](_0x285e97['shift']());}};_0x383f43(++_0x3f7f63);}(_0xd765,0xdf));var _0x5d76=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xd765[_0x1cc8fe];return _0x230054;};'use strict';var VoiceQueueReportEvents=require(_0x5d76('0x0'));var events=[_0x5d76('0x1'),_0x5d76('0x2'),_0x5d76('0x3')];function createListener(_0x245264,_0x44fed4){return function(_0x4ce5da){_0x44fed4[_0x5d76('0x4')](_0x245264,_0x4ce5da);};}function removeListener(_0x5f18e0,_0x1a7983){return function(){VoiceQueueReportEvents[_0x5d76('0x5')](_0x5f18e0,_0x1a7983);};}exports['register']=function(_0x280536){for(var _0x175058=0x0,_0x444693=events[_0x5d76('0x6')];_0x175058<_0x444693;_0x175058++){var _0x333db6=events[_0x175058];var _0x116d32=createListener('voiceQueueReport:'+_0x333db6,_0x280536);VoiceQueueReportEvents['on'](_0x333db6,_0x116d32);}};
\ No newline at end of file
+var _0x2090=['save','remove','emit','removeListener','length','voiceQueueReport:'];(function(_0x545783,_0x4319c3){var _0xa5884d=function(_0x240266){while(--_0x240266){_0x545783['push'](_0x545783['shift']());}};_0xa5884d(++_0x4319c3);}(_0x2090,0xae));var _0x0209=function(_0x23b83f,_0x41e6de){_0x23b83f=_0x23b83f-0x0;var _0x359331=_0x2090[_0x23b83f];return _0x359331;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x0209('0x0'),_0x0209('0x1'),'update'];function createListener(_0x1df0dc,_0x732eaa){return function(_0x1bf9c0){_0x732eaa[_0x0209('0x2')](_0x1df0dc,_0x1bf9c0);};}function removeListener(_0x1b12f3,_0x50f65d){return function(){VoiceQueueReportEvents[_0x0209('0x3')](_0x1b12f3,_0x50f65d);};}exports['register']=function(_0x2aaa17){for(var _0x8c2e0b=0x0,_0x48e0f2=events[_0x0209('0x4')];_0x8c2e0b<_0x48e0f2;_0x8c2e0b++){var _0x5706e9=events[_0x8c2e0b];var _0x3d0c98=createListener(_0x0209('0x5')+_0x5706e9,_0x2aaa17);VoiceQueueReportEvents['on'](_0x5706e9,_0x3d0c98);}};
\ No newline at end of file
index 950edc4..3987534 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0c9=['show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x2a6d45,_0x3c9321){var _0x295253=function(_0x51d622){while(--_0x51d622){_0x2a6d45['push'](_0x2a6d45['shift']());}};_0x295253(++_0x3c9321);}(_0xb0c9,0xd8));var _0x9b0c=function(_0x56ed51,_0x5acddc){_0x56ed51=_0x56ed51-0x0;var _0x521784=_0xb0c9[_0x56ed51];return _0x521784;};'use strict';var multer=require(_0x9b0c('0x0'));var util=require(_0x9b0c('0x1'));var path=require(_0x9b0c('0x2'));var timeout=require(_0x9b0c('0x3'));var express=require(_0x9b0c('0x4'));var router=express['Router']();var fs_extra=require(_0x9b0c('0x5'));var auth=require(_0x9b0c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9b0c('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x9b0c('0x8')]('/',auth['isAuthenticated'](),controller[_0x9b0c('0x9')]);router['get'](_0x9b0c('0xa'),auth[_0x9b0c('0xb')](),controller[_0x9b0c('0xc')]);router[_0x9b0c('0xd')]('/',auth['isAuthenticated'](),controller[_0x9b0c('0xe')]);router[_0x9b0c('0xf')](_0x9b0c('0xa'),auth[_0x9b0c('0xb')](),controller['update']);router[_0x9b0c('0x10')](_0x9b0c('0xa'),auth[_0x9b0c('0xb')](),controller[_0x9b0c('0x11')]);module[_0x9b0c('0x12')]=router;
\ No newline at end of file
+var _0xba5b=['isAuthenticated','index','/:id','create','put','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get'];(function(_0x1ce847,_0x18757a){var _0x42433a=function(_0x36a6bf){while(--_0x36a6bf){_0x1ce847['push'](_0x1ce847['shift']());}};_0x42433a(++_0x18757a);}(_0xba5b,0xa1));var _0xbba5=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xba5b[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0xbba5('0x0'));var util=require(_0xbba5('0x1'));var path=require('path');var timeout=require(_0xbba5('0x2'));var express=require('express');var router=express[_0xbba5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbba5('0x4'));var interaction=require(_0xbba5('0x5'));var config=require(_0xbba5('0x6'));var controller=require(_0xbba5('0x7'));router[_0xbba5('0x8')]('/',auth[_0xbba5('0x9')](),controller[_0xbba5('0xa')]);router['get'](_0xbba5('0xb'),auth[_0xbba5('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbba5('0xc')]);router[_0xbba5('0xd')]('/:id',auth[_0xbba5('0x9')](),controller[_0xbba5('0xe')]);router[_0xbba5('0xf')](_0xbba5('0xb'),auth['isAuthenticated'](),controller[_0xbba5('0x10')]);module['exports']=router;
\ No newline at end of file
index d40fd55..4efdf90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9199=['moment','STRING','DATE','format','sequelize'];(function(_0x308f27,_0x53d24e){var _0x562ef0=function(_0x339c22){while(--_0x339c22){_0x308f27['push'](_0x308f27['shift']());}};_0x562ef0(++_0x53d24e);}(_0x9199,0x1e9));var _0x9919=function(_0x1db72a,_0x22f6bc){_0x1db72a=_0x1db72a-0x0;var _0x1c7ee7=_0x9199[_0x1db72a];return _0x1c7ee7;};'use strict';var Sequelize=require(_0x9919('0x0'));var moment=require(_0x9919('0x1'));module['exports']={'time':{'type':Sequelize[_0x9919('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x9919('0x3')],'allowNull':![],'defaultValue':moment()[_0x9919('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
+var _0x8838=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports'];(function(_0x2df8ea,_0x3a7d10){var _0x2ec556=function(_0x42bb39){while(--_0x42bb39){_0x2df8ea['push'](_0x2df8ea['shift']());}};_0x2ec556(++_0x3a7d10);}(_0x8838,0xcb));var _0x8883=function(_0x5e5ade,_0x2ae52f){_0x5e5ade=_0x5e5ade-0x0;var _0x22f1ee=_0x8838[_0x5e5ade];return _0x22f1ee;};'use strict';var Sequelize=require(_0x8883('0x0'));var moment=require('moment');module[_0x8883('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x8883('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x8883('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x8883('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x8883('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x8883('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x8883('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x8883('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x8883('0x4'))}};
\ No newline at end of file
index 833f409..3978f22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf510=['model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','params','keys','includeAll','options','catch','create','body','update','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','error','name','send','index','VoiceQueuesLog','rawAttributes','type','key'];(function(_0x5e4d43,_0x135265){var _0x506d2a=function(_0x4bf239){while(--_0x4bf239){_0x5e4d43['push'](_0x5e4d43['shift']());}};_0x506d2a(++_0x135265);}(_0xf510,0xb0));var _0x0f51=function(_0x7a65c9,_0x310caf){_0x7a65c9=_0x7a65c9-0x0;var _0x35bc4b=_0xf510[_0x7a65c9];return _0x35bc4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f51('0x0'));var zipdir=require(_0x0f51('0x1'));var jsonpatch=require(_0x0f51('0x2'));var rp=require(_0x0f51('0x3'));var moment=require(_0x0f51('0x4'));var BPromise=require(_0x0f51('0x5'));var Mustache=require(_0x0f51('0x6'));var util=require(_0x0f51('0x7'));var path=require(_0x0f51('0x8'));var sox=require(_0x0f51('0x9'));var csv=require('to-csv');var ejs=require(_0x0f51('0xa'));var fs=require('fs');var fs_extra=require(_0x0f51('0xb'));var _=require('lodash');var squel=require(_0x0f51('0xc'));var crypto=require(_0x0f51('0xd'));var jsforce=require(_0x0f51('0xe'));var deskjs=require(_0x0f51('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0f51('0x10'));var Papa=require(_0x0f51('0x11'));var Redis=require(_0x0f51('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0f51('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f51('0x14'));var logger=require(_0x0f51('0x15'))(_0x0f51('0x16'));var utils=require('../../config/utils');var config=require(_0x0f51('0x17'));var licenseUtil=require(_0x0f51('0x18'));var db=require(_0x0f51('0x19'))['db'];function respondWithStatusCode(_0x2cf616,_0x2c83ef){_0x2c83ef=_0x2c83ef||0xcc;return function(_0x2210ff){if(_0x2210ff){return _0x2cf616[_0x0f51('0x1a')](_0x2c83ef);}return _0x2cf616[_0x0f51('0x1b')](_0x2c83ef)[_0x0f51('0x1c')]();};}function respondWithResult(_0x12accc,_0x23e055){_0x23e055=_0x23e055||0xc8;return function(_0x1bec53){if(_0x1bec53){return _0x12accc[_0x0f51('0x1b')](_0x23e055)[_0x0f51('0x1d')](_0x1bec53);}};}function respondWithFilteredResult(_0x5b111,_0x1e568e){return function(_0x41de7f){if(_0x41de7f){var _0x27d693=typeof _0x1e568e[_0x0f51('0x1e')]===_0x0f51('0x1f')&&typeof _0x1e568e[_0x0f51('0x20')]===_0x0f51('0x1f');var _0x415c1f=_0x41de7f['count'];var _0x439191=_0x27d693?0x0:_0x1e568e[_0x0f51('0x1e')];var _0x44f1aa=_0x27d693?_0x41de7f[_0x0f51('0x21')]:_0x1e568e['offset']+_0x1e568e[_0x0f51('0x20')];var _0x51f060;if(_0x44f1aa>=_0x415c1f){_0x44f1aa=_0x415c1f;_0x51f060=0xc8;}else{_0x51f060=0xce;}_0x5b111['status'](_0x51f060);return _0x5b111['set'](_0x0f51('0x22'),_0x439191+'-'+_0x44f1aa+'/'+_0x415c1f)[_0x0f51('0x1d')](_0x41de7f);}return null;};}function patchUpdates(_0x41ee52){return function(_0x21ab34){try{jsonpatch['apply'](_0x21ab34,_0x41ee52,!![]);}catch(_0x1f855c){return BPromise[_0x0f51('0x23')](_0x1f855c);}return _0x21ab34['save']();};}function saveUpdates(_0xa5dc52,_0x3321df){return function(_0x3eb364){if(_0x3eb364){return _0x3eb364['update'](_0xa5dc52)[_0x0f51('0x24')](function(_0x241e8b){return _0x241e8b;});}return null;};}function removeEntity(_0x4d6fdc,_0x291a7f){return function(_0x411988){if(_0x411988){return _0x411988[_0x0f51('0x25')]()['then'](function(){_0x4d6fdc[_0x0f51('0x1b')](0xcc)[_0x0f51('0x1c')]();});}};}function handleEntityNotFound(_0x3ff614,_0x1ac4a4){return function(_0x2b5068){if(!_0x2b5068){_0x3ff614[_0x0f51('0x1a')](0x194);}return _0x2b5068;};}function handleError(_0x54d2bc,_0x15334f){_0x15334f=_0x15334f||0x1f4;return function(_0x23edbd){logger[_0x0f51('0x26')](_0x23edbd['stack']);if(_0x23edbd[_0x0f51('0x27')]){delete _0x23edbd['name'];}_0x54d2bc[_0x0f51('0x1b')](_0x15334f)[_0x0f51('0x28')](_0x23edbd);};}exports[_0x0f51('0x29')]=function(_0x476a5f,_0xf513d6){var _0x3cbf48={},_0x5e187a={},_0x1b817d={'count':0x0,'rows':[]};var _0x45e624=_['map'](db[_0x0f51('0x2a')][_0x0f51('0x2b')],function(_0x459e5e){return{'name':_0x459e5e['fieldName'],'type':_0x459e5e[_0x0f51('0x2c')][_0x0f51('0x2d')]};});_0x5e187a[_0x0f51('0x2e')]=_[_0x0f51('0x2f')](_0x45e624,_0x0f51('0x27'));_0x5e187a[_0x0f51('0x30')]=_['keys'](_0x476a5f[_0x0f51('0x30')]);_0x5e187a[_0x0f51('0x31')]=_[_0x0f51('0x32')](_0x5e187a[_0x0f51('0x2e')],_0x5e187a['query']);_0x3cbf48[_0x0f51('0x33')]=_[_0x0f51('0x32')](_0x5e187a[_0x0f51('0x2e')],qs[_0x0f51('0x34')](_0x476a5f[_0x0f51('0x30')]['fields']));_0x3cbf48[_0x0f51('0x33')]=_0x3cbf48[_0x0f51('0x33')][_0x0f51('0x35')]?_0x3cbf48[_0x0f51('0x33')]:_0x5e187a[_0x0f51('0x2e')];if(!_0x476a5f['query'][_0x0f51('0x36')](_0x0f51('0x37'))){_0x3cbf48[_0x0f51('0x20')]=qs['limit'](_0x476a5f[_0x0f51('0x30')]['limit']);_0x3cbf48[_0x0f51('0x1e')]=qs[_0x0f51('0x1e')](_0x476a5f[_0x0f51('0x30')][_0x0f51('0x1e')]);}_0x3cbf48[_0x0f51('0x38')]=qs[_0x0f51('0x39')](_0x476a5f[_0x0f51('0x30')][_0x0f51('0x39')]);_0x3cbf48[_0x0f51('0x3a')]=qs[_0x0f51('0x31')](_[_0x0f51('0x3b')](_0x476a5f['query'],_0x5e187a[_0x0f51('0x31')]),_0x45e624);if(_0x476a5f['query'][_0x0f51('0x3c')]){_0x3cbf48['where']=_[_0x0f51('0x3d')](_0x3cbf48[_0x0f51('0x3a')],{'$or':_['map'](_0x45e624,function(_0x1bb795){if(_0x1bb795['type']!==_0x0f51('0x3e')){var _0x3a6f32={};_0x3a6f32[_0x1bb795[_0x0f51('0x27')]]={'$like':'%'+_0x476a5f[_0x0f51('0x30')][_0x0f51('0x3c')]+'%'};return _0x3a6f32;}})});}_0x3cbf48=_[_0x0f51('0x3d')]({},_0x3cbf48,_0x476a5f['options']);var _0x431778={'where':_0x3cbf48['where']};return db[_0x0f51('0x2a')][_0x0f51('0x21')](_0x431778)[_0x0f51('0x24')](function(_0x25ee91){_0x1b817d[_0x0f51('0x21')]=_0x25ee91;if(_0x476a5f[_0x0f51('0x30')]['includeAll']){_0x3cbf48[_0x0f51('0x3f')]=[{'all':!![]}];}return db[_0x0f51('0x2a')][_0x0f51('0x40')](_0x3cbf48);})[_0x0f51('0x24')](function(_0x261c30){_0x1b817d['rows']=_0x261c30;return _0x1b817d;})[_0x0f51('0x24')](respondWithFilteredResult(_0xf513d6,_0x3cbf48))['catch'](handleError(_0xf513d6,null));};exports['show']=function(_0xd6e31a,_0x1cb2d3){var _0x3fb338={'raw':!![],'where':{'id':_0xd6e31a[_0x0f51('0x41')]['id']}},_0x21f9f3={};_0x21f9f3[_0x0f51('0x2e')]=_[_0x0f51('0x42')](db[_0x0f51('0x2a')][_0x0f51('0x2b')]);_0x21f9f3[_0x0f51('0x30')]=_[_0x0f51('0x42')](_0xd6e31a['query']);_0x21f9f3[_0x0f51('0x31')]=_[_0x0f51('0x32')](_0x21f9f3[_0x0f51('0x2e')],_0x21f9f3[_0x0f51('0x30')]);_0x3fb338[_0x0f51('0x33')]=_[_0x0f51('0x32')](_0x21f9f3[_0x0f51('0x2e')],qs[_0x0f51('0x34')](_0xd6e31a[_0x0f51('0x30')][_0x0f51('0x34')]));_0x3fb338[_0x0f51('0x33')]=_0x3fb338['attributes']['length']?_0x3fb338['attributes']:_0x21f9f3[_0x0f51('0x2e')];if(_0xd6e31a[_0x0f51('0x30')][_0x0f51('0x43')]){_0x3fb338['include']=[{'all':!![]}];}_0x3fb338=_[_0x0f51('0x3d')]({},_0x3fb338,_0xd6e31a[_0x0f51('0x44')]);return db[_0x0f51('0x2a')]['find'](_0x3fb338)[_0x0f51('0x24')](handleEntityNotFound(_0x1cb2d3,null))[_0x0f51('0x24')](respondWithResult(_0x1cb2d3,null))[_0x0f51('0x45')](handleError(_0x1cb2d3,null));};exports['create']=function(_0x662e8b,_0x3ab641){return db[_0x0f51('0x2a')][_0x0f51('0x46')](_0x662e8b[_0x0f51('0x47')],{})[_0x0f51('0x24')](respondWithResult(_0x3ab641,0xc9))[_0x0f51('0x45')](handleError(_0x3ab641,null));};exports[_0x0f51('0x48')]=function(_0x55ea09,_0x1a320e){if(_0x55ea09[_0x0f51('0x47')]['id']){delete _0x55ea09[_0x0f51('0x47')]['id'];}return db[_0x0f51('0x2a')][_0x0f51('0x49')]({'where':{'id':_0x55ea09[_0x0f51('0x41')]['id']}})[_0x0f51('0x24')](handleEntityNotFound(_0x1a320e,null))[_0x0f51('0x24')](saveUpdates(_0x55ea09[_0x0f51('0x47')],null))[_0x0f51('0x24')](respondWithResult(_0x1a320e,null))[_0x0f51('0x45')](handleError(_0x1a320e,null));};exports[_0x0f51('0x25')]=function(_0x295ca3,_0x1e44dd){return db[_0x0f51('0x2a')]['find']({'where':{'id':_0x295ca3['params']['id']}})['then'](handleEntityNotFound(_0x1e44dd,null))[_0x0f51('0x24')](removeEntity(_0x1e44dd,null))[_0x0f51('0x45')](handleError(_0x1e44dd,null));};
\ No newline at end of file
+var _0x33fd=['merge','VIRTUAL','options','includeAll','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','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','VoiceQueuesLog','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter'];(function(_0x445edf,_0x255f50){var _0x31aa0f=function(_0x4876a1){while(--_0x4876a1){_0x445edf['push'](_0x445edf['shift']());}};_0x31aa0f(++_0x255f50);}(_0x33fd,0xa7));var _0xd33f=function(_0x58cb95,_0x5bea4c){_0x58cb95=_0x58cb95-0x0;var _0x1b568d=_0x33fd[_0x58cb95];return _0x1b568d;};'use strict';var emlformat=require(_0xd33f('0x0'));var rimraf=require(_0xd33f('0x1'));var zipdir=require(_0xd33f('0x2'));var jsonpatch=require(_0xd33f('0x3'));var rp=require(_0xd33f('0x4'));var moment=require(_0xd33f('0x5'));var BPromise=require(_0xd33f('0x6'));var Mustache=require(_0xd33f('0x7'));var util=require(_0xd33f('0x8'));var path=require(_0xd33f('0x9'));var sox=require(_0xd33f('0xa'));var csv=require('to-csv');var ejs=require(_0xd33f('0xb'));var fs=require('fs');var fs_extra=require(_0xd33f('0xc'));var _=require('lodash');var squel=require(_0xd33f('0xd'));var crypto=require(_0xd33f('0xe'));var jsforce=require(_0xd33f('0xf'));var deskjs=require(_0xd33f('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd33f('0x11'));var Papa=require(_0xd33f('0x12'));var Redis=require(_0xd33f('0x13'));var authService=require(_0xd33f('0x14'));var qs=require(_0xd33f('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd33f('0x16'));var logger=require(_0xd33f('0x17'))('api');var utils=require(_0xd33f('0x18'));var config=require(_0xd33f('0x19'));var licenseUtil=require(_0xd33f('0x1a'));var db=require(_0xd33f('0x1b'))['db'];function respondWithStatusCode(_0x30eae2,_0x39160a){_0x39160a=_0x39160a||0xcc;return function(_0x552528){if(_0x552528){return _0x30eae2[_0xd33f('0x1c')](_0x39160a);}return _0x30eae2[_0xd33f('0x1d')](_0x39160a)[_0xd33f('0x1e')]();};}function respondWithResult(_0x4384be,_0x38a3ee){_0x38a3ee=_0x38a3ee||0xc8;return function(_0x17a297){if(_0x17a297){return _0x4384be[_0xd33f('0x1d')](_0x38a3ee)[_0xd33f('0x1f')](_0x17a297);}};}function respondWithFilteredResult(_0x49fc50,_0x439773){return function(_0x36efb8){if(_0x36efb8){var _0x475ba0=typeof _0x439773[_0xd33f('0x20')]===_0xd33f('0x21')&&typeof _0x439773['limit']===_0xd33f('0x21');var _0xbd1f1=_0x36efb8[_0xd33f('0x22')];var _0x595ef4=_0x475ba0?0x0:_0x439773[_0xd33f('0x20')];var _0x120f83=_0x475ba0?_0x36efb8[_0xd33f('0x22')]:_0x439773['offset']+_0x439773[_0xd33f('0x23')];var _0x3f359a;if(_0x120f83>=_0xbd1f1){_0x120f83=_0xbd1f1;_0x3f359a=0xc8;}else{_0x3f359a=0xce;}_0x49fc50[_0xd33f('0x1d')](_0x3f359a);return _0x49fc50[_0xd33f('0x24')](_0xd33f('0x25'),_0x595ef4+'-'+_0x120f83+'/'+_0xbd1f1)[_0xd33f('0x1f')](_0x36efb8);}return null;};}function patchUpdates(_0x4ec40f){return function(_0x4a0f6e){try{jsonpatch[_0xd33f('0x26')](_0x4a0f6e,_0x4ec40f,!![]);}catch(_0x1216cd){return BPromise[_0xd33f('0x27')](_0x1216cd);}return _0x4a0f6e[_0xd33f('0x28')]();};}function saveUpdates(_0xc573be,_0x327184){return function(_0x4419a8){if(_0x4419a8){return _0x4419a8[_0xd33f('0x29')](_0xc573be)[_0xd33f('0x2a')](function(_0x232a23){return _0x232a23;});}return null;};}function removeEntity(_0x41f0cd,_0x51f39f){return function(_0x113f03){if(_0x113f03){return _0x113f03[_0xd33f('0x2b')]()['then'](function(){_0x41f0cd[_0xd33f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11e2e7,_0x3b6adc){return function(_0x4688eb){if(!_0x4688eb){_0x11e2e7[_0xd33f('0x1c')](0x194);}return _0x4688eb;};}function handleError(_0x12dcf7,_0x2586ef){_0x2586ef=_0x2586ef||0x1f4;return function(_0x596639){logger[_0xd33f('0x2c')](_0x596639['stack']);if(_0x596639[_0xd33f('0x2d')]){delete _0x596639[_0xd33f('0x2d')];}_0x12dcf7[_0xd33f('0x1d')](_0x2586ef)[_0xd33f('0x2e')](_0x596639);};}exports['index']=function(_0x1dea2a,_0x4d0f46){var _0x363f9b={},_0x146ba5={},_0x5400b1={'count':0x0,'rows':[]};var _0x30be1e=_[_0xd33f('0x2f')](db[_0xd33f('0x30')][_0xd33f('0x31')],function(_0x577cc7){return{'name':_0x577cc7['fieldName'],'type':_0x577cc7[_0xd33f('0x32')][_0xd33f('0x33')]};});_0x146ba5[_0xd33f('0x34')]=_[_0xd33f('0x2f')](_0x30be1e,_0xd33f('0x2d'));_0x146ba5[_0xd33f('0x35')]=_[_0xd33f('0x36')](_0x1dea2a[_0xd33f('0x35')]);_0x146ba5[_0xd33f('0x37')]=_['intersection'](_0x146ba5['model'],_0x146ba5[_0xd33f('0x35')]);_0x363f9b[_0xd33f('0x38')]=_[_0xd33f('0x39')](_0x146ba5[_0xd33f('0x34')],qs['fields'](_0x1dea2a[_0xd33f('0x35')][_0xd33f('0x3a')]));_0x363f9b[_0xd33f('0x38')]=_0x363f9b[_0xd33f('0x38')]['length']?_0x363f9b[_0xd33f('0x38')]:_0x146ba5[_0xd33f('0x34')];if(!_0x1dea2a[_0xd33f('0x35')]['hasOwnProperty'](_0xd33f('0x3b'))){_0x363f9b[_0xd33f('0x23')]=qs['limit'](_0x1dea2a['query']['limit']);_0x363f9b['offset']=qs[_0xd33f('0x20')](_0x1dea2a[_0xd33f('0x35')][_0xd33f('0x20')]);}_0x363f9b['order']=qs[_0xd33f('0x3c')](_0x1dea2a[_0xd33f('0x35')]['sort']);_0x363f9b[_0xd33f('0x3d')]=qs[_0xd33f('0x37')](_[_0xd33f('0x3e')](_0x1dea2a[_0xd33f('0x35')],_0x146ba5[_0xd33f('0x37')]),_0x30be1e);if(_0x1dea2a['query'][_0xd33f('0x3f')]){_0x363f9b[_0xd33f('0x3d')]=_[_0xd33f('0x40')](_0x363f9b[_0xd33f('0x3d')],{'$or':_['map'](_0x30be1e,function(_0x5f564c){if(_0x5f564c[_0xd33f('0x32')]!==_0xd33f('0x41')){var _0x5c0522={};_0x5c0522[_0x5f564c[_0xd33f('0x2d')]]={'$like':'%'+_0x1dea2a[_0xd33f('0x35')][_0xd33f('0x3f')]+'%'};return _0x5c0522;}})});}_0x363f9b=_[_0xd33f('0x40')]({},_0x363f9b,_0x1dea2a[_0xd33f('0x42')]);var _0x13e9f3={'where':_0x363f9b[_0xd33f('0x3d')]};return db['VoiceQueuesLog'][_0xd33f('0x22')](_0x13e9f3)[_0xd33f('0x2a')](function(_0x112a11){_0x5400b1[_0xd33f('0x22')]=_0x112a11;if(_0x1dea2a[_0xd33f('0x35')][_0xd33f('0x43')]){_0x363f9b['include']=[{'all':!![]}];}return db[_0xd33f('0x30')][_0xd33f('0x44')](_0x363f9b);})[_0xd33f('0x2a')](function(_0x58481b){_0x5400b1[_0xd33f('0x45')]=_0x58481b;return _0x5400b1;})[_0xd33f('0x2a')](respondWithFilteredResult(_0x4d0f46,_0x363f9b))[_0xd33f('0x46')](handleError(_0x4d0f46,null));};exports[_0xd33f('0x47')]=function(_0x42d4b7,_0x306c87){var _0x530185={'raw':!![],'where':{'id':_0x42d4b7[_0xd33f('0x48')]['id']}},_0x36ab95={};_0x36ab95[_0xd33f('0x34')]=_[_0xd33f('0x36')](db[_0xd33f('0x30')][_0xd33f('0x31')]);_0x36ab95[_0xd33f('0x35')]=_[_0xd33f('0x36')](_0x42d4b7[_0xd33f('0x35')]);_0x36ab95['filters']=_[_0xd33f('0x39')](_0x36ab95[_0xd33f('0x34')],_0x36ab95[_0xd33f('0x35')]);_0x530185[_0xd33f('0x38')]=_['intersection'](_0x36ab95[_0xd33f('0x34')],qs[_0xd33f('0x3a')](_0x42d4b7[_0xd33f('0x35')][_0xd33f('0x3a')]));_0x530185['attributes']=_0x530185[_0xd33f('0x38')][_0xd33f('0x49')]?_0x530185[_0xd33f('0x38')]:_0x36ab95[_0xd33f('0x34')];if(_0x42d4b7[_0xd33f('0x35')]['includeAll']){_0x530185['include']=[{'all':!![]}];}_0x530185=_[_0xd33f('0x40')]({},_0x530185,_0x42d4b7[_0xd33f('0x42')]);return db['VoiceQueuesLog'][_0xd33f('0x4a')](_0x530185)[_0xd33f('0x2a')](handleEntityNotFound(_0x306c87,null))[_0xd33f('0x2a')](respondWithResult(_0x306c87,null))[_0xd33f('0x46')](handleError(_0x306c87,null));};exports['create']=function(_0x176992,_0x44962f){return db['VoiceQueuesLog'][_0xd33f('0x4b')](_0x176992[_0xd33f('0x4c')],{})[_0xd33f('0x2a')](respondWithResult(_0x44962f,0xc9))[_0xd33f('0x46')](handleError(_0x44962f,null));};exports[_0xd33f('0x29')]=function(_0x14a335,_0x5e39eb){if(_0x14a335['body']['id']){delete _0x14a335[_0xd33f('0x4c')]['id'];}return db[_0xd33f('0x30')][_0xd33f('0x4a')]({'where':{'id':_0x14a335['params']['id']}})['then'](handleEntityNotFound(_0x5e39eb,null))[_0xd33f('0x2a')](saveUpdates(_0x14a335[_0xd33f('0x4c')],null))[_0xd33f('0x2a')](respondWithResult(_0x5e39eb,null))[_0xd33f('0x46')](handleError(_0x5e39eb,null));};exports[_0xd33f('0x2b')]=function(_0x4833df,_0x2f50c8){return db[_0xd33f('0x30')]['find']({'where':{'id':_0x4833df[_0xd33f('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f50c8,null))[_0xd33f('0x2a')](removeEntity(_0x2f50c8,null))['catch'](handleError(_0x2f50c8,null));};
\ No newline at end of file
index 9fc201c..fa450fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67c9=['voice_queues_log','dtm','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog'];(function(_0x106e40,_0x3cc0fd){var _0x307b83=function(_0x1cf6a7){while(--_0x1cf6a7){_0x106e40['push'](_0x106e40['shift']());}};_0x307b83(++_0x3cc0fd);}(_0x67c9,0x1a6));var _0x967c=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x67c9[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0x967c('0x0'));var util=require(_0x967c('0x1'));var logger=require(_0x967c('0x2'))(_0x967c('0x3'));var moment=require(_0x967c('0x4'));var BPromise=require(_0x967c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x967c('0x6'));var rimraf=require(_0x967c('0x7'));var config=require(_0x967c('0x8'));var attributes=require(_0x967c('0x9'));module[_0x967c('0xa')]=function(_0x306620,_0x5d344b){return _0x306620[_0x967c('0xb')](_0x967c('0xc'),attributes,{'tableName':_0x967c('0xd'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0x967c('0xe')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xf180=['moment','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger'];(function(_0x17c090,_0x67da1e){var _0xfac7a7=function(_0x1e3532){while(--_0x1e3532){_0x17c090['push'](_0x17c090['shift']());}};_0xfac7a7(++_0x67da1e);}(_0xf180,0xc0));var _0x0f18=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf180[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x0f18('0x0'));var util=require(_0x0f18('0x1'));var logger=require(_0x0f18('0x2'))('api');var moment=require(_0x0f18('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f18('0x4'));var rimraf=require(_0x0f18('0x5'));var config=require(_0x0f18('0x6'));var attributes=require(_0x0f18('0x7'));module['exports']=function(_0xc3989b,_0x29de66){return _0xc3989b['define'](_0x0f18('0x8'),attributes,{'tableName':_0x0f18('0x9'),'paranoid':![],'indexes':[{'name':_0x0f18('0xa'),'fields':[_0x0f18('0xb'),_0x0f18('0xc')]}],'timestamps':![]});};
\ No newline at end of file
index 0653aa9..792731c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8029=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring'];(function(_0x559da0,_0x371559){var _0x284239=function(_0xee9b8c){while(--_0xee9b8c){_0x559da0['push'](_0x559da0['shift']());}};_0x284239(++_0x371559);}(_0x8029,0xf8));var _0x9802=function(_0x36702a,_0x31c6e6){_0x36702a=_0x36702a-0x0;var _0xc8ca6d=_0x8029[_0x36702a];return _0xc8ca6d;};'use strict';var _=require(_0x9802('0x0'));var util=require(_0x9802('0x1'));var moment=require('moment');var BPromise=require(_0x9802('0x2'));var rs=require(_0x9802('0x3'));var fs=require('fs');var Redis=require(_0x9802('0x4'));var db=require(_0x9802('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9802('0x6'));var config=require(_0x9802('0x7'));var jayson=require(_0x9802('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52f9a0,_0x39f748,_0xa50d40){return new BPromise(function(_0x1d1405,_0x331bb1){return client['request'](_0x52f9a0,_0xa50d40)[_0x9802('0x9')](function(_0x2930eb){logger['info'](_0x9802('0xa'),_0x39f748,_0x9802('0xb'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x39f748,'request\x20sent',JSON[_0x9802('0xc')](_0x2930eb));if(_0x2930eb[_0x9802('0xd')]){if(_0x2930eb[_0x9802('0xd')][_0x9802('0xe')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x39f748,_0x2930eb[_0x9802('0xd')][_0x9802('0xf')]);return _0x331bb1(_0x2930eb[_0x9802('0xd')][_0x9802('0xf')]);}logger[_0x9802('0xd')](_0x9802('0xa'),_0x39f748,_0x2930eb[_0x9802('0xd')][_0x9802('0xf')]);return _0x1d1405(_0x2930eb[_0x9802('0xd')][_0x9802('0xf')]);}else{logger[_0x9802('0x10')](_0x9802('0xa'),_0x39f748,_0x9802('0xb'));_0x1d1405(_0x2930eb['result']['message']);}})[_0x9802('0x11')](function(_0x440c8d){logger[_0x9802('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x39f748,_0x440c8d);_0x331bb1(_0x440c8d);});});}
\ No newline at end of file
+var _0x8d79=['../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','ioredis'];(function(_0x3a05ca,_0x4b6f7c){var _0x194ead=function(_0x2ff4e4){while(--_0x2ff4e4){_0x3a05ca['push'](_0x3a05ca['shift']());}};_0x194ead(++_0x4b6f7c);}(_0x8d79,0x10a));var _0x98d7=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x8d79[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x98d7('0x0'));var util=require(_0x98d7('0x1'));var moment=require(_0x98d7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98d7('0x3'));var db=require(_0x98d7('0x4'))['db'];var utils=require(_0x98d7('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x98d7('0x6'));var client=jayson[_0x98d7('0x7')][_0x98d7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d4344,_0x5e041d,_0x448a6d){return new BPromise(function(_0x53faf2,_0x38b639){return client[_0x98d7('0x9')](_0x2d4344,_0x448a6d)[_0x98d7('0xa')](function(_0x37f0de){logger[_0x98d7('0xb')](_0x98d7('0xc'),_0x5e041d,_0x98d7('0xd'));logger[_0x98d7('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x5e041d,'request\x20sent',JSON['stringify'](_0x37f0de));if(_0x37f0de[_0x98d7('0xf')]){if(_0x37f0de[_0x98d7('0xf')]['code']===0x1f4){logger['error'](_0x98d7('0xc'),_0x5e041d,_0x37f0de[_0x98d7('0xf')][_0x98d7('0x10')]);return _0x38b639(_0x37f0de[_0x98d7('0xf')][_0x98d7('0x10')]);}logger['error'](_0x98d7('0xc'),_0x5e041d,_0x37f0de['error'][_0x98d7('0x10')]);return _0x53faf2(_0x37f0de['error'][_0x98d7('0x10')]);}else{logger[_0x98d7('0xb')](_0x98d7('0xc'),_0x5e041d,'request\x20sent');_0x53faf2(_0x37f0de['result']['message']);}})[_0x98d7('0x11')](function(_0x26cbae){logger[_0x98d7('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5e041d,_0x26cbae);_0x38b639(_0x26cbae);});});}
\ No newline at end of file
index 18fcf9a..c7ebb84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9c1=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','/:id/downloads','/:id/transcribe','post','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3bbdae,_0x4bb9b5){var _0x1db911=function(_0x24e0dd){while(--_0x24e0dd){_0x3bbdae['push'](_0x3bbdae['shift']());}};_0x1db911(++_0x4bb9b5);}(_0xd9c1,0x1c8));var _0x1d9c=function(_0x13d3d5,_0x5d13d3){_0x13d3d5=_0x13d3d5-0x0;var _0x10a39d=_0xd9c1[_0x13d3d5];return _0x10a39d;};'use strict';var multer=require('multer');var util=require(_0x1d9c('0x0'));var path=require(_0x1d9c('0x1'));var timeout=require(_0x1d9c('0x2'));var express=require(_0x1d9c('0x3'));var router=express[_0x1d9c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1d9c('0x5'));var interaction=require(_0x1d9c('0x6'));var config=require(_0x1d9c('0x7'));var controller=require('./voiceRecording.controller');router[_0x1d9c('0x8')]('/',auth[_0x1d9c('0x9')](),controller['index']);router[_0x1d9c('0x8')](_0x1d9c('0xa'),auth[_0x1d9c('0x9')](),controller[_0x1d9c('0xb')]);router[_0x1d9c('0x8')](_0x1d9c('0xc'),auth[_0x1d9c('0x9')](),controller[_0x1d9c('0xd')]);router[_0x1d9c('0x8')](_0x1d9c('0xe'),auth[_0x1d9c('0x9')](),controller['download']);router[_0x1d9c('0x8')](_0x1d9c('0xf'),controller['downloads']);router['get'](_0x1d9c('0x10'),auth[_0x1d9c('0x9')](),controller['downloadTranscribe']);router[_0x1d9c('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/transcribe',auth[_0x1d9c('0x9')](),controller['runTranscribe']);router['put'](_0x1d9c('0xc'),auth[_0x1d9c('0x9')](),controller[_0x1d9c('0x12')]);router[_0x1d9c('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1d9c('0x14')]=router;
\ No newline at end of file
+var _0xafb9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/download','downloads','/:id/transcribe','downloadTranscribe','post','create','delete','destroy','exports','util','path','express'];(function(_0x2b21bc,_0x4dc635){var _0x18e72d=function(_0x5a31e6){while(--_0x5a31e6){_0x2b21bc['push'](_0x2b21bc['shift']());}};_0x18e72d(++_0x4dc635);}(_0xafb9,0xe3));var _0x9afb=function(_0x3b98a4,_0xe4c0ea){_0x3b98a4=_0x3b98a4-0x0;var _0x3fff8b=_0xafb9[_0x3b98a4];return _0x3fff8b;};'use strict';var multer=require('multer');var util=require(_0x9afb('0x0'));var path=require(_0x9afb('0x1'));var timeout=require('connect-timeout');var express=require(_0x9afb('0x2'));var router=express[_0x9afb('0x3')]();var fs_extra=require(_0x9afb('0x4'));var auth=require(_0x9afb('0x5'));var interaction=require(_0x9afb('0x6'));var config=require(_0x9afb('0x7'));var controller=require('./voiceRecording.controller');router[_0x9afb('0x8')]('/',auth[_0x9afb('0x9')](),controller[_0x9afb('0xa')]);router[_0x9afb('0x8')](_0x9afb('0xb'),auth[_0x9afb('0x9')](),controller['describe']);router['get'](_0x9afb('0xc'),auth[_0x9afb('0x9')](),controller[_0x9afb('0xd')]);router[_0x9afb('0x8')](_0x9afb('0xe'),auth[_0x9afb('0x9')](),controller['download']);router[_0x9afb('0x8')]('/:id/downloads',controller[_0x9afb('0xf')]);router[_0x9afb('0x8')](_0x9afb('0x10'),auth[_0x9afb('0x9')](),controller[_0x9afb('0x11')]);router[_0x9afb('0x12')]('/',auth[_0x9afb('0x9')](),controller[_0x9afb('0x13')]);router[_0x9afb('0x12')](_0x9afb('0x10'),auth['isAuthenticated'](),controller['runTranscribe']);router['put']('/:id',auth[_0x9afb('0x9')](),controller['update']);router[_0x9afb('0x14')](_0x9afb('0xc'),auth[_0x9afb('0x9')](),controller[_0x9afb('0x15')]);module[_0x9afb('0x16')]=router;
\ No newline at end of file
index ed8b370..3477269 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(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 25f0691..6c92400 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4278=['createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','Bucket','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','writeFile','downloadTranscribe','fileText','root','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','aws-sdk','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','end','json','undefined','limit','count','offset','status','set','Content-Range','save','update','then','sendStatus','name','index','map','VoiceRecording','rawAttributes','type','key','differenceBy','format','query','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','intersection','length','find','create','body','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','send','Not\x20found','downloads','sequelize','col','token','$and','push','%s.cypher','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets'];(function(_0x37eeb3,_0x383d1c){var _0x53556c=function(_0x12c808){while(--_0x12c808){_0x37eeb3['push'](_0x37eeb3['shift']());}};_0x53556c(++_0x383d1c);}(_0x4278,0x148));var _0x8427=function(_0x28e602,_0x2a8e93){_0x28e602=_0x28e602-0x0;var _0x2e589d=_0x4278[_0x28e602];return _0x2e589d;};'use strict';var emlformat=require(_0x8427('0x0'));var rimraf=require(_0x8427('0x1'));var zipdir=require(_0x8427('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8427('0x3'));var BPromise=require(_0x8427('0x4'));var Mustache=require(_0x8427('0x5'));var util=require('util');var path=require(_0x8427('0x6'));var sox=require(_0x8427('0x7'));var csv=require(_0x8427('0x8'));var ejs=require(_0x8427('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8427('0xa'));var crypto=require(_0x8427('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8427('0x8'));var querystring=require(_0x8427('0xc'));var Papa=require(_0x8427('0xd'));var AWS=require(_0x8427('0xe'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0x8427('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8427('0x10'));var hardwareService=require(_0x8427('0x11'));var logger=require('../../config/logger')(_0x8427('0x12'));var utils=require('../../config/utils');var config=require(_0x8427('0x13'));var licenseUtil=require(_0x8427('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48a70e,_0x3f201c){_0x3f201c=_0x3f201c||0xcc;return function(_0xa41afb){if(_0xa41afb){return _0x48a70e['sendStatus'](_0x3f201c);}return _0x48a70e['status'](_0x3f201c)[_0x8427('0x15')]();};}function respondWithResult(_0x3b9f12,_0x2787ad){_0x2787ad=_0x2787ad||0xc8;return function(_0x41d479){if(_0x41d479){return _0x3b9f12['status'](_0x2787ad)[_0x8427('0x16')](_0x41d479);}};}function respondWithFilteredResult(_0x31ca5e,_0x1cdda7){return function(_0x78dc18){if(_0x78dc18){var _0x5f3ce6=typeof _0x1cdda7['offset']===_0x8427('0x17')&&typeof _0x1cdda7[_0x8427('0x18')]===_0x8427('0x17');var _0x1d081f=_0x78dc18[_0x8427('0x19')];var _0x53eadc=_0x5f3ce6?0x0:_0x1cdda7[_0x8427('0x1a')];var _0x338699=_0x5f3ce6?_0x78dc18['count']:_0x1cdda7['offset']+_0x1cdda7[_0x8427('0x18')];var _0x29062a;if(_0x338699>=_0x1d081f){_0x338699=_0x1d081f;_0x29062a=0xc8;}else{_0x29062a=0xce;}_0x31ca5e[_0x8427('0x1b')](_0x29062a);return _0x31ca5e[_0x8427('0x1c')](_0x8427('0x1d'),_0x53eadc+'-'+_0x338699+'/'+_0x1d081f)[_0x8427('0x16')](_0x78dc18);}return null;};}function patchUpdates(_0x230c15){return function(_0x164b72){try{jsonpatch['apply'](_0x164b72,_0x230c15,!![]);}catch(_0x46ffde){return BPromise['reject'](_0x46ffde);}return _0x164b72[_0x8427('0x1e')]();};}function saveUpdates(_0x108f34,_0x438ccc){return function(_0x52ce36){if(_0x52ce36){return _0x52ce36[_0x8427('0x1f')](_0x108f34)[_0x8427('0x20')](function(_0x360f5){return _0x360f5;});}return null;};}function removeEntity(_0x56d987,_0x3ffc48){return function(_0x5986bf){if(_0x5986bf){return _0x5986bf['destroy']()[_0x8427('0x20')](function(){_0x56d987[_0x8427('0x1b')](0xcc)[_0x8427('0x15')]();});}};}function handleEntityNotFound(_0x7aeda1,_0x430efe){return function(_0x4cefd2){if(!_0x4cefd2){_0x7aeda1[_0x8427('0x21')](0x194);}return _0x4cefd2;};}function handleError(_0x4b00ee,_0x5ce344){_0x5ce344=_0x5ce344||0x1f4;return function(_0xa35cec){logger['error'](_0xa35cec['stack']);if(_0xa35cec[_0x8427('0x22')]){delete _0xa35cec['name'];}_0x4b00ee[_0x8427('0x1b')](_0x5ce344)['send'](_0xa35cec);};}exports[_0x8427('0x23')]=function(_0x4a6a44,_0x11f18a){var _0x5e79a1={},_0x11ea82={},_0x4578c7={'count':0x0,'rows':[]};var _0x58cc53=_[_0x8427('0x24')](db[_0x8427('0x25')][_0x8427('0x26')],function(_0x3bea2c){return{'name':_0x3bea2c['fieldName'],'type':_0x3bea2c[_0x8427('0x27')][_0x8427('0x28')]};});_0x11ea82['model']=_[_0x8427('0x29')](_[_0x8427('0x24')](_0x58cc53,_0x8427('0x22')),[_0x8427('0x2a')]);_0x11ea82[_0x8427('0x2b')]=_['keys'](_0x4a6a44[_0x8427('0x2b')]);_0x11ea82[_0x8427('0x2c')]=_['intersection'](_0x11ea82[_0x8427('0x2d')],_0x11ea82[_0x8427('0x2b')]);_0x5e79a1[_0x8427('0x2e')]=_['intersection'](_0x11ea82['model'],qs[_0x8427('0x2f')](_0x4a6a44[_0x8427('0x2b')][_0x8427('0x2f')]));_0x5e79a1[_0x8427('0x2e')]=_0x5e79a1[_0x8427('0x2e')]['length']?_0x5e79a1[_0x8427('0x2e')]:_0x11ea82[_0x8427('0x2d')];if(!_0x4a6a44[_0x8427('0x2b')][_0x8427('0x30')](_0x8427('0x31'))){_0x5e79a1['limit']=qs[_0x8427('0x18')](_0x4a6a44['query']['limit']);_0x5e79a1[_0x8427('0x1a')]=qs[_0x8427('0x1a')](_0x4a6a44['query']['offset']);}_0x5e79a1[_0x8427('0x32')]=qs[_0x8427('0x33')](_0x4a6a44[_0x8427('0x2b')][_0x8427('0x33')]);_0x5e79a1['where']=qs[_0x8427('0x2c')](_['pick'](_0x4a6a44[_0x8427('0x2b')],_0x11ea82[_0x8427('0x2c')]),_0x58cc53);if(_0x4a6a44[_0x8427('0x2b')]['filter']){_0x5e79a1[_0x8427('0x34')]=_['merge'](_0x5e79a1[_0x8427('0x34')],{'$or':_[_0x8427('0x24')](_0x58cc53,function(_0x3b204b){if(_0x3b204b[_0x8427('0x27')]!==_0x8427('0x35')){var _0x4abcc7={};_0x4abcc7[_0x3b204b[_0x8427('0x22')]]={'$like':'%'+_0x4a6a44['query']['filter']+'%'};return _0x4abcc7;}})});}_0x5e79a1=_[_0x8427('0x36')]({},_0x5e79a1,_0x4a6a44['options']);var _0x5d4a29={'where':_0x5e79a1[_0x8427('0x34')]};return db[_0x8427('0x25')]['count'](_0x5d4a29)[_0x8427('0x20')](function(_0x56d9b4){_0x4578c7['count']=_0x56d9b4;if(_0x4a6a44[_0x8427('0x2b')][_0x8427('0x37')]){_0x5e79a1[_0x8427('0x38')]=[{'all':!![]}];}return db[_0x8427('0x25')][_0x8427('0x39')](_0x5e79a1);})[_0x8427('0x20')](function(_0x96b431){_0x4578c7[_0x8427('0x3a')]=_0x96b431;return _0x4578c7;})[_0x8427('0x20')](respondWithFilteredResult(_0x11f18a,_0x5e79a1))[_0x8427('0x3b')](handleError(_0x11f18a,null));};exports[_0x8427('0x3c')]=function(_0x4f26c9,_0x1308ed){var _0x388fe4={'raw':![],'where':{'id':_0x4f26c9[_0x8427('0x3d')]['id']}},_0x2bff9b={};_0x2bff9b[_0x8427('0x2d')]=_[_0x8427('0x3e')](db[_0x8427('0x25')][_0x8427('0x26')]);_0x2bff9b['query']=_[_0x8427('0x3e')](_0x4f26c9['query']);_0x2bff9b[_0x8427('0x2c')]=_[_0x8427('0x3f')](_0x2bff9b[_0x8427('0x2d')],_0x2bff9b[_0x8427('0x2b')]);_0x388fe4['attributes']=_['intersection'](_0x2bff9b[_0x8427('0x2d')],qs[_0x8427('0x2f')](_0x4f26c9[_0x8427('0x2b')][_0x8427('0x2f')]));_0x388fe4['attributes']=_0x388fe4[_0x8427('0x2e')][_0x8427('0x40')]?_0x388fe4[_0x8427('0x2e')]:_0x2bff9b['model'];if(_0x4f26c9[_0x8427('0x2b')][_0x8427('0x37')]){_0x388fe4['include']=[{'all':!![]}];}_0x388fe4=_[_0x8427('0x36')]({},_0x388fe4,_0x4f26c9['options']);return db[_0x8427('0x25')][_0x8427('0x41')](_0x388fe4)[_0x8427('0x20')](handleEntityNotFound(_0x1308ed,null))[_0x8427('0x20')](respondWithResult(_0x1308ed,null))[_0x8427('0x3b')](handleError(_0x1308ed,null));};exports[_0x8427('0x42')]=function(_0x41df2f,_0x33b6d7){return db[_0x8427('0x25')][_0x8427('0x42')](_0x41df2f['body'],{})['then'](respondWithResult(_0x33b6d7,0xc9))[_0x8427('0x3b')](handleError(_0x33b6d7,null));};exports['update']=function(_0x29a825,_0x328d5a){if(_0x29a825[_0x8427('0x43')]['id']){delete _0x29a825['body']['id'];}return db[_0x8427('0x25')]['find']({'where':{'id':_0x29a825[_0x8427('0x3d')]['id']}})[_0x8427('0x20')](handleEntityNotFound(_0x328d5a,null))[_0x8427('0x20')](saveUpdates(_0x29a825[_0x8427('0x43')],null))['then'](respondWithResult(_0x328d5a,null))[_0x8427('0x3b')](handleError(_0x328d5a,null));};exports['describe']=function(_0x1109dc,_0x1f3720){return db[_0x8427('0x25')][_0x8427('0x44')]()[_0x8427('0x20')](respondWithResult(_0x1f3720,null))[_0x8427('0x3b')](handleError(_0x1f3720,null));};exports[_0x8427('0x45')]=function(_0x3d7ecc,_0x156f68,_0x2ef27d){var _0x10d6da=require(_0x8427('0x46'));var _0x33e707=![];var _0x5d4d31={};if(_0x3d7ecc[_0x8427('0x2b')][_0x8427('0x27')]&&_0x3d7ecc[_0x8427('0x2b')][_0x8427('0x27')]===_0x8427('0x47')){_0x5d4d31[_0x8427('0x47')]=_0x3d7ecc[_0x8427('0x3d')]['id'];}else{_0x5d4d31['id']=_0x3d7ecc[_0x8427('0x3d')]['id'];}return db[_0x8427('0x25')][_0x8427('0x41')]({'where':_0x5d4d31,'attributes':['id',_0x8427('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x156f68,null))[_0x8427('0x20')](function(_0x153196){if(_0x153196){var _0x3a039c=_0x153196[_0x8427('0x48')];var _0x3e5918=util[_0x8427('0x2a')]('%s.cypher',_0x3a039c);if(fs[_0x8427('0x49')](_0x3e5918)){_0x33e707=!![];return _0x10d6da[_0x8427('0x4a')](_0x3e5918,_0x3a039c,config[_0x8427('0x4b')][_0x8427('0x4c')])['then'](function(){return _0x153196;});}return _0x153196;}})[_0x8427('0x20')](function(_0x9c43c6){if(_0x9c43c6){var _0x35a8d3=_0x9c43c6[_0x8427('0x48')];if(!fs['existsSync'](_0x35a8d3)){throw new db[(_0x8427('0x4d'))][(_0x8427('0x4e'))](_0x8427('0x4f'));}if(_0x9c43c6[_0x8427('0x50')]){return _0x156f68['download'](_0x35a8d3,_0x9c43c6['filename']+path['extname'](_0x35a8d3),function(){if(_0x33e707){fs[_0x8427('0x51')](_0x35a8d3);}});}else{return _0x156f68[_0x8427('0x45')](_0x35a8d3,function(_0x209ecb){if(_0x33e707){fs[_0x8427('0x51')](_0x35a8d3);}});}}})[_0x8427('0x3b')](function(_0x5bf20e){if(_0x5bf20e[_0x8427('0x52')]===_0x8427('0x4f')){_0x156f68[_0x8427('0x1b')](0x194)[_0x8427('0x53')](_0x8427('0x54'));}else{return handleError(_0x156f68,null);}});};exports[_0x8427('0x55')]=function(_0xfe46dc,_0xdb6316,_0x3ac873){var _0x2477c9=require(_0x8427('0x46'));var _0x5df28d=![];var _0x4d5467={'$and':[db[_0x8427('0x56')]['where'](db[_0x8427('0x56')]['fn']('MD5',db[_0x8427('0x56')][_0x8427('0x57')](_0x8427('0x47'))),_0xfe46dc[_0x8427('0x2b')][_0x8427('0x58')])]};if(_0xfe46dc[_0x8427('0x2b')][_0x8427('0x27')]&&_0xfe46dc['query']['type']==='uniqueid'){_0x4d5467[_0x8427('0x59')][_0x8427('0x5a')]({'uniqueid':_0xfe46dc[_0x8427('0x3d')]['id']});}else{_0x4d5467['$and'][_0x8427('0x5a')]({'id':_0xfe46dc['params']['id']});}return db[_0x8427('0x25')][_0x8427('0x41')]({'where':_0x4d5467,'attributes':['id',_0x8427('0x48')],'raw':!![]})[_0x8427('0x20')](handleEntityNotFound(_0xdb6316,null))[_0x8427('0x20')](function(_0x520973){if(_0x520973){var _0x3e0787=util[_0x8427('0x2a')](_0x8427('0x5b'),_0x520973['value']);if(fs[_0x8427('0x49')](_0x3e0787)){_0x5df28d=!![];return _0x2477c9[_0x8427('0x4a')](_0x3e0787,_0x520973[_0x8427('0x48')],config[_0x8427('0x4b')][_0x8427('0x4c')])['then'](function(){return _0x520973;});}return _0x520973;}})[_0x8427('0x20')](function(_0x28d866){if(_0x28d866){if(!fs[_0x8427('0x49')](_0x28d866[_0x8427('0x48')])){throw new db[(_0x8427('0x4d'))]['ValidationError'](_0x8427('0x4f'));}if(_0x28d866['filename']){return _0xdb6316[_0x8427('0x45')](_0x28d866[_0x8427('0x48')],_0x28d866['filename']+path['extname'](_0x28d866[_0x8427('0x48')]),function(){if(_0x5df28d){fs[_0x8427('0x51')](_0x28d866['value']);}});}else{return _0xdb6316[_0x8427('0x45')](_0x28d866[_0x8427('0x48')],function(_0x5a7643){if(_0x5df28d){fs[_0x8427('0x51')](_0x28d866[_0x8427('0x48')]);}});}}})['catch'](handleError(_0xdb6316,null));};exports[_0x8427('0x5c')]=function(_0x3b74d8,_0x2a9b53){return db[_0x8427('0x25')][_0x8427('0x41')]({'where':{'id':_0x3b74d8['params']['id']}})['then'](function(_0x46be28){if(_['isNil'](_0x46be28)){throw new ReferenceError(_0x8427('0x5d'));}return _0x46be28;})[_0x8427('0x20')](function(_0x4d0796){var _0x5277c6=_0x4d0796['value'];logger[_0x8427('0x5e')](_0x8427('0x5f'),_0x5277c6);if(!_[_0x8427('0x60')](_0x4d0796['value'])&&fs[_0x8427('0x49')](_0x5277c6)){logger[_0x8427('0x5e')](_0x8427('0x61')+_0x5277c6+_0x8427('0x62'));fs[_0x8427('0x63')](_0x5277c6);}_0x5277c6=_0x5277c6+'.cypher';if(!_[_0x8427('0x60')](_0x4d0796[_0x8427('0x48')])&&fs[_0x8427('0x49')](_0x5277c6)){logger[_0x8427('0x5e')](_0x8427('0x61')+_0x5277c6+_0x8427('0x62'));fs[_0x8427('0x63')](_0x5277c6);}return _0x4d0796;})[_0x8427('0x20')](function(_0x932b18){if(!_0x932b18)throw new InternalError();return _0x932b18[_0x8427('0x5c')]();})[_0x8427('0x20')](function(){_0x2a9b53[_0x8427('0x1b')](0xcc)[_0x8427('0x15')]();})['catch'](handleError(_0x2a9b53,null));};function getBucketslist(_0x4b7a1d,_0x11f77e,_0x4fc827){return new Promise(function(_0x2b82d2,_0x1c447e){var _0x11aa39=new AWS['S3']({'accessKeyId':_0x11f77e,'secretAccessKey':_0x4b7a1d,'region':_0x4fc827});_0x11aa39[_0x8427('0x64')]({},function(_0x5d354b,_0x1a7933){if(_0x5d354b){return _0x1c447e(_0x5d354b);}else{return _0x2b82d2(_0x1a7933);}});});}function createBucket(_0x58c926,_0xaf4e8b,_0x34295b,_0x5d8208){return new Promise(function(_0xf265be,_0x329463){var _0x2c9b30=new AWS['S3']({'accessKeyId':_0xaf4e8b,'secretAccessKey':_0x58c926,'region':_0x34295b});_0x2c9b30[_0x8427('0x65')]({'Bucket':_0x5d8208},function(_0x5efa94,_0x3cf42b){if(_0x5efa94){return _0x329463(_0x5efa94);}else{return _0xf265be(_0x3cf42b);}});});}function uploadFile(_0x10d427,_0xee2dd9,_0x3c1aad,_0x5f3917,_0x86d934,_0x2fa7f6){return new Promise(function(_0x4c9c72,_0x21f34e){var _0x241b45=new AWS['S3']({'accessKeyId':_0xee2dd9,'secretAccessKey':_0x10d427,'region':_0x3c1aad});_0x241b45[_0x8427('0x66')]({'Bucket':_0x5f3917,'Key':_0x86d934,'Body':_0x2fa7f6},function(_0x4529ac,_0x2c32a8){if(_0x4529ac){return _0x21f34e(_0x4529ac);}else{return _0x4c9c72(_0x2c32a8);}});});}function startTranscribe(_0x103e60,_0x11f2e6,_0x15953c,_0x555a99,_0x7b54e0,_0x10fb00){return new Promise(function(_0x3c7190,_0x57a625){var _0x1e2801=new AWS[(_0x8427('0x67'))]({'accessKeyId':_0x11f2e6,'secretAccessKey':_0x103e60,'region':_0x15953c});_0x1e2801[_0x8427('0x68')]({'TranscriptionJobName':_0x555a99,'LanguageCode':_0x7b54e0,'Media':{'MediaFileUri':_0x10fb00}},function(_0xa06063,_0x109b62){if(_0xa06063){return _0x57a625(_0xa06063);}else{return _0x3c7190(_0x109b62);}});});}function transcribe(_0x49e5fc,_0x5adb6b,_0xcbd2ce,_0x1d7a1f,_0xd7154b,_0x385fea,_0x6f1eb1){return new Promise(function(_0x5598fe,_0x593237){var _0x3792d1={};logger[_0x8427('0x5e')](util[_0x8427('0x2a')](_0x8427('0x69'),_0x49e5fc,_0xd7154b));return uploadFile(_0x5adb6b,_0xcbd2ce,_0x1d7a1f,_0xd7154b,path[_0x8427('0x6a')](_0x385fea),fs[_0x8427('0x6b')](_0x385fea))[_0x8427('0x20')](function(_0x42f38c){logger['info'](util[_0x8427('0x2a')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x49e5fc,_0xd7154b,_0x42f38c[_0x8427('0x6c')]));_0x3792d1[_0x8427('0x6d')]=_0x42f38c[_0x8427('0x6e')];_0x3792d1['location']=_0x42f38c[_0x8427('0x6c')];logger[_0x8427('0x5e')](util['format']('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x49e5fc));return startTranscribe(_0x5adb6b,_0xcbd2ce,_0x1d7a1f,uuidv4(),_0x6f1eb1,_0x42f38c[_0x8427('0x6c')]);})[_0x8427('0x20')](function(_0x1a8deb){logger[_0x8427('0x5e')](util[_0x8427('0x2a')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x49e5fc,_0x1a8deb[_0x8427('0x6f')][_0x8427('0x70')]));_0x3792d1[_0x8427('0x71')]=_0x1a8deb['TranscriptionJob'][_0x8427('0x70')];_0x3792d1[_0x8427('0x72')]=_0x1a8deb[_0x8427('0x6f')][_0x8427('0x73')];return _0x5598fe(_0x3792d1);})[_0x8427('0x3b')](function(_0x3e770a){return _0x593237(_0x3e770a);});});}exports[_0x8427('0x74')]=function(_0xfb62f2,_0x47a392,_0x226b85){var _0x2ea590;var _0x138c9a;var _0x4bbeef;var _0x5c4d82=require(_0x8427('0x46'));return db[_0x8427('0x25')][_0x8427('0x75')]({'where':{'id':_0xfb62f2[_0x8427('0x3d')]['id']}})['then'](function(_0x31c56c){if(_0x31c56c){var _0xec0d28=util['format'](_0x8427('0x5b'),_0x31c56c[_0x8427('0x48')]);if(fs[_0x8427('0x49')](_0xec0d28)){cypher=!![];return _0x5c4d82[_0x8427('0x4a')](_0xec0d28,_0x31c56c['value'],config[_0x8427('0x4b')][_0x8427('0x4c')])[_0x8427('0x20')](function(){return _0x31c56c;});}return _0x31c56c;}})['then'](function(_0x5d9a3a){if(!_0x5d9a3a){throw new db[(_0x8427('0x4d'))]['ValidationError'](_0x8427('0x76'));}_0x138c9a=_0x5d9a3a;return db[_0x8427('0x77')]['findOne']({'where':{'id':0x1}});})[_0x8427('0x20')](handleEntityNotFound(_0x47a392,null))[_0x8427('0x20')](function(_0x35990c){if(_0x35990c){_0x2ea590=_0x35990c;if(!_0x2ea590[_0x8427('0x78')]||!_0x2ea590[_0x8427('0x79')]||!_0x2ea590[_0x8427('0x7a')]||!_0x2ea590[_0x8427('0x7b')]||!_0x2ea590[_0x8427('0x6d')]){throw new db['Sequelize'][(_0x8427('0x4e'))]('Transcribe\x20not\x20configured');}if(_0xfb62f2[_0x8427('0x43')]['runSentiment']&&(!_0x2ea590[_0x8427('0x7c')]||!_0x2ea590['sentimentAccountId']||!_0x2ea590[_0x8427('0x7d')]||!_0x2ea590[_0x8427('0x7b')]||!_0x2ea590[_0x8427('0x6d')])){throw new db[(_0x8427('0x4d'))][(_0x8427('0x4e'))](_0x8427('0x7e'));}return db[_0x8427('0x7f')][_0x8427('0x75')]({'where':{'id':_0x2ea590[_0x8427('0x79')]}});}})[_0x8427('0x20')](function(_0x5e1aa6){if(!_0x5e1aa6){throw new db[(_0x8427('0x4d'))][(_0x8427('0x4e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5e1aa6[_0x8427('0x80')]||!_0x5e1aa6[_0x8427('0x81')]){throw new db[(_0x8427('0x4d'))][(_0x8427('0x4e'))]('Cloud\x20Provider\x20not\x20configured');}_0x4bbeef=_0x5e1aa6;return getBucketslist(_0x4bbeef['data1'],_0x4bbeef['data2'],_0x2ea590[_0x8427('0x7a')]);})[_0x8427('0x20')](function(_0x5f593d){if(_0x5f593d&&_0x5f593d['Buckets']){var _0x3b47c6=_[_0x8427('0x41')](_0x5f593d['Buckets'],function(_0x22300e){return _0x22300e[_0x8427('0x82')]===_0x2ea590[_0x8427('0x6d')];});if(!_0x3b47c6){logger[_0x8427('0x5e')](util[_0x8427('0x2a')](_0x8427('0x83'),_0xfb62f2['params']['id'],_0x2ea590[_0x8427('0x6d')]));return createBucket(_0x4bbeef['data1'],_0x4bbeef['data2'],_0x2ea590[_0x8427('0x7a')],_0x2ea590[_0x8427('0x6d')]);}logger[_0x8427('0x5e')](util[_0x8427('0x2a')](_0x8427('0x84'),_0xfb62f2[_0x8427('0x3d')]['id'],_0x2ea590[_0x8427('0x6d')]));return;}})['then'](function(_0x31d103){if(_0x138c9a['transcribeStatus']===_0x8427('0x85')){return transcribe(_0xfb62f2[_0x8427('0x3d')]['id'],_0x4bbeef['data1'],_0x4bbeef[_0x8427('0x81')],_0x2ea590[_0x8427('0x7a')],_0x2ea590['bucket'],_0x138c9a[_0x8427('0x48')],_0x2ea590[_0x8427('0x7b')]);}else{logger['info'](util[_0x8427('0x2a')](_0x8427('0x86'),_0xfb62f2['params']['id']));return{'transcribeStatus':_0x8427('0x87')};}})[_0x8427('0x20')](function(_0x1a789b){if(_0x1a789b){_0x1a789b[_0x8427('0x88')]=_0xfb62f2[_0x8427('0x43')][_0x8427('0x89')];return _0x138c9a['updateAttributes'](_0x1a789b);}})[_0x8427('0x20')](respondWithResult(_0x47a392,null))[_0x8427('0x3b')](handleError(_0x47a392,null));};function writeFile(_0x1b4bda,_0x2be926){return new Promise(function(_0x1b2d49,_0x217c4c){fs[_0x8427('0x8a')](_0x2be926,_0x1b4bda,function(_0x32835f,_0x336761){if(_0x32835f){return _0x217c4c(_0x32835f);}else{return _0x1b2d49(_0x336761);}});});}exports[_0x8427('0x8b')]=function(_0x3bc6c4,_0x8520f6,_0x363005){return db['VoiceRecording'][_0x8427('0x75')]({'where':{'id':_0x3bc6c4[_0x8427('0x3d')]['id']}})[_0x8427('0x20')](handleEntityNotFound(_0x8520f6))[_0x8427('0x20')](function(_0x187a8){if(_0x187a8&&_0x187a8[_0x8427('0x8c')]){var _0x112692=_0x187a8[_0x8427('0x8c')];var _0x43fbd4=config[_0x8427('0x8d')]+'/server/files/transcribes/transcribe_'+_0x187a8['id']+'.txt';if(fs['existsSync'](_0x43fbd4)){return _0x43fbd4;}return writeFile(_0x112692,_0x43fbd4)[_0x8427('0x20')](function(){return _0x43fbd4;});}else{throw new db['Sequelize'][(_0x8427('0x4e'))](_0x8427('0x8e'));}})[_0x8427('0x20')](function(_0x3bc61c){return _0x8520f6[_0x8427('0x45')](_0x3bc61c);})['catch'](handleError(_0x8520f6));};
\ No newline at end of file
+var _0xe9e3=['offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key','model','format','query','filters','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','includeAll','include','show','params','keys','intersection','fields','options','catch','create','body','find','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','Not\x20found','downloads','sequelize','where','MD5','col','token','$and','push','decryptFile','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','createBucket','TranscribeService','startTranscriptionJob','basename','readFileSync','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Setting','transcribeAccountId','transcribeRegion','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json'];(function(_0x25158c,_0x379b54){var _0x287b69=function(_0x5e743e){while(--_0x5e743e){_0x25158c['push'](_0x25158c['shift']());}};_0x287b69(++_0x379b54);}(_0xe9e3,0x77));var _0x3e9e=function(_0x5d6814,_0x1dfdc5){_0x5d6814=_0x5d6814-0x0;var _0x271a00=_0xe9e3[_0x5d6814];return _0x271a00;};'use strict';var emlformat=require(_0x3e9e('0x0'));var rimraf=require(_0x3e9e('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(_0x3e9e('0x2'));var util=require(_0x3e9e('0x3'));var path=require(_0x3e9e('0x4'));var sox=require('sox');var csv=require(_0x3e9e('0x5'));var ejs=require(_0x3e9e('0x6'));var fs=require('fs');var fs_extra=require(_0x3e9e('0x7'));var _=require('lodash');var squel=require(_0x3e9e('0x8'));var crypto=require('crypto');var jsforce=require(_0x3e9e('0x9'));var deskjs=require(_0x3e9e('0xa'));var toCsv=require(_0x3e9e('0x5'));var querystring=require(_0x3e9e('0xb'));var Papa=require(_0x3e9e('0xc'));var AWS=require(_0x3e9e('0xd'));var uuidv4=require(_0x3e9e('0xe'));var Redis=require(_0x3e9e('0xf'));var authService=require(_0x3e9e('0x10'));var qs=require(_0x3e9e('0x11'));var as=require(_0x3e9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3e9e('0x13'));var utils=require(_0x3e9e('0x14'));var config=require(_0x3e9e('0x15'));var licenseUtil=require(_0x3e9e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48020c,_0x498e0c){_0x498e0c=_0x498e0c||0xcc;return function(_0x135c43){if(_0x135c43){return _0x48020c[_0x3e9e('0x17')](_0x498e0c);}return _0x48020c[_0x3e9e('0x18')](_0x498e0c)[_0x3e9e('0x19')]();};}function respondWithResult(_0x2e263f,_0x52bb85){_0x52bb85=_0x52bb85||0xc8;return function(_0x429019){if(_0x429019){return _0x2e263f[_0x3e9e('0x18')](_0x52bb85)[_0x3e9e('0x1a')](_0x429019);}};}function respondWithFilteredResult(_0x3f4eff,_0x3aa57a){return function(_0x3e3d92){if(_0x3e3d92){var _0xad0d62=typeof _0x3aa57a[_0x3e9e('0x1b')]===_0x3e9e('0x1c')&&typeof _0x3aa57a[_0x3e9e('0x1d')]===_0x3e9e('0x1c');var _0x112b55=_0x3e3d92[_0x3e9e('0x1e')];var _0x2b57a6=_0xad0d62?0x0:_0x3aa57a['offset'];var _0x319789=_0xad0d62?_0x3e3d92[_0x3e9e('0x1e')]:_0x3aa57a[_0x3e9e('0x1b')]+_0x3aa57a[_0x3e9e('0x1d')];var _0x2816b4;if(_0x319789>=_0x112b55){_0x319789=_0x112b55;_0x2816b4=0xc8;}else{_0x2816b4=0xce;}_0x3f4eff[_0x3e9e('0x18')](_0x2816b4);return _0x3f4eff['set'](_0x3e9e('0x1f'),_0x2b57a6+'-'+_0x319789+'/'+_0x112b55)[_0x3e9e('0x1a')](_0x3e3d92);}return null;};}function patchUpdates(_0x31abfa){return function(_0x1cd86b){try{jsonpatch[_0x3e9e('0x20')](_0x1cd86b,_0x31abfa,!![]);}catch(_0x36340b){return BPromise[_0x3e9e('0x21')](_0x36340b);}return _0x1cd86b[_0x3e9e('0x22')]();};}function saveUpdates(_0x2f8292,_0x56e27e){return function(_0x2ab2f1){if(_0x2ab2f1){return _0x2ab2f1[_0x3e9e('0x23')](_0x2f8292)['then'](function(_0x2ade86){return _0x2ade86;});}return null;};}function removeEntity(_0x2ca0e7,_0x1f2810){return function(_0x321840){if(_0x321840){return _0x321840['destroy']()[_0x3e9e('0x24')](function(){_0x2ca0e7[_0x3e9e('0x18')](0xcc)[_0x3e9e('0x19')]();});}};}function handleEntityNotFound(_0x3910e0,_0x513b1d){return function(_0xf896ca){if(!_0xf896ca){_0x3910e0[_0x3e9e('0x17')](0x194);}return _0xf896ca;};}function handleError(_0x39b6b1,_0x299219){_0x299219=_0x299219||0x1f4;return function(_0x18e239){logger[_0x3e9e('0x25')](_0x18e239[_0x3e9e('0x26')]);if(_0x18e239[_0x3e9e('0x27')]){delete _0x18e239['name'];}_0x39b6b1['status'](_0x299219)[_0x3e9e('0x28')](_0x18e239);};}exports[_0x3e9e('0x29')]=function(_0x158510,_0x9ff67b){var _0x52add2={},_0x39ce3d={},_0x164db0={'count':0x0,'rows':[]};var _0x51e24d=_[_0x3e9e('0x2a')](db[_0x3e9e('0x2b')][_0x3e9e('0x2c')],function(_0x442cd4){return{'name':_0x442cd4[_0x3e9e('0x2d')],'type':_0x442cd4['type'][_0x3e9e('0x2e')]};});_0x39ce3d[_0x3e9e('0x2f')]=_['differenceBy'](_[_0x3e9e('0x2a')](_0x51e24d,_0x3e9e('0x27')),[_0x3e9e('0x30')]);_0x39ce3d[_0x3e9e('0x31')]=_['keys'](_0x158510[_0x3e9e('0x31')]);_0x39ce3d[_0x3e9e('0x32')]=_['intersection'](_0x39ce3d['model'],_0x39ce3d['query']);_0x52add2['attributes']=_['intersection'](_0x39ce3d['model'],qs['fields'](_0x158510['query']['fields']));_0x52add2[_0x3e9e('0x33')]=_0x52add2['attributes'][_0x3e9e('0x34')]?_0x52add2['attributes']:_0x39ce3d[_0x3e9e('0x2f')];if(!_0x158510[_0x3e9e('0x31')][_0x3e9e('0x35')](_0x3e9e('0x36'))){_0x52add2['limit']=qs[_0x3e9e('0x1d')](_0x158510[_0x3e9e('0x31')][_0x3e9e('0x1d')]);_0x52add2[_0x3e9e('0x1b')]=qs[_0x3e9e('0x1b')](_0x158510['query'][_0x3e9e('0x1b')]);}_0x52add2[_0x3e9e('0x37')]=qs[_0x3e9e('0x38')](_0x158510[_0x3e9e('0x31')][_0x3e9e('0x38')]);_0x52add2['where']=qs[_0x3e9e('0x32')](_['pick'](_0x158510[_0x3e9e('0x31')],_0x39ce3d[_0x3e9e('0x32')]),_0x51e24d);if(_0x158510[_0x3e9e('0x31')][_0x3e9e('0x39')]){_0x52add2['where']=_[_0x3e9e('0x3a')](_0x52add2['where'],{'$or':_[_0x3e9e('0x2a')](_0x51e24d,function(_0xc4e83f){if(_0xc4e83f[_0x3e9e('0x3b')]!=='VIRTUAL'){var _0x9500c6={};_0x9500c6[_0xc4e83f['name']]={'$like':'%'+_0x158510[_0x3e9e('0x31')][_0x3e9e('0x39')]+'%'};return _0x9500c6;}})});}_0x52add2=_['merge']({},_0x52add2,_0x158510['options']);var _0x1fa91e={'where':_0x52add2['where']};return db[_0x3e9e('0x2b')][_0x3e9e('0x1e')](_0x1fa91e)['then'](function(_0x148bb2){_0x164db0[_0x3e9e('0x1e')]=_0x148bb2;if(_0x158510[_0x3e9e('0x31')][_0x3e9e('0x3c')]){_0x52add2[_0x3e9e('0x3d')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x52add2);})[_0x3e9e('0x24')](function(_0xaee9df){_0x164db0['rows']=_0xaee9df;return _0x164db0;})[_0x3e9e('0x24')](respondWithFilteredResult(_0x9ff67b,_0x52add2))['catch'](handleError(_0x9ff67b,null));};exports[_0x3e9e('0x3e')]=function(_0x3974fe,_0x138123){var _0x38e787={'raw':![],'where':{'id':_0x3974fe[_0x3e9e('0x3f')]['id']}},_0x34ec3e={};_0x34ec3e[_0x3e9e('0x2f')]=_[_0x3e9e('0x40')](db[_0x3e9e('0x2b')][_0x3e9e('0x2c')]);_0x34ec3e[_0x3e9e('0x31')]=_[_0x3e9e('0x40')](_0x3974fe['query']);_0x34ec3e['filters']=_[_0x3e9e('0x41')](_0x34ec3e[_0x3e9e('0x2f')],_0x34ec3e[_0x3e9e('0x31')]);_0x38e787[_0x3e9e('0x33')]=_[_0x3e9e('0x41')](_0x34ec3e[_0x3e9e('0x2f')],qs['fields'](_0x3974fe[_0x3e9e('0x31')][_0x3e9e('0x42')]));_0x38e787[_0x3e9e('0x33')]=_0x38e787[_0x3e9e('0x33')]['length']?_0x38e787['attributes']:_0x34ec3e[_0x3e9e('0x2f')];if(_0x3974fe[_0x3e9e('0x31')][_0x3e9e('0x3c')]){_0x38e787['include']=[{'all':!![]}];}_0x38e787=_[_0x3e9e('0x3a')]({},_0x38e787,_0x3974fe[_0x3e9e('0x43')]);return db['VoiceRecording']['find'](_0x38e787)[_0x3e9e('0x24')](handleEntityNotFound(_0x138123,null))['then'](respondWithResult(_0x138123,null))[_0x3e9e('0x44')](handleError(_0x138123,null));};exports[_0x3e9e('0x45')]=function(_0x4f32bf,_0x11222b){return db[_0x3e9e('0x2b')][_0x3e9e('0x45')](_0x4f32bf['body'],{})[_0x3e9e('0x24')](respondWithResult(_0x11222b,0xc9))[_0x3e9e('0x44')](handleError(_0x11222b,null));};exports[_0x3e9e('0x23')]=function(_0x3abaf9,_0x4b5b5a){if(_0x3abaf9['body']['id']){delete _0x3abaf9[_0x3e9e('0x46')]['id'];}return db[_0x3e9e('0x2b')][_0x3e9e('0x47')]({'where':{'id':_0x3abaf9[_0x3e9e('0x3f')]['id']}})[_0x3e9e('0x24')](handleEntityNotFound(_0x4b5b5a,null))[_0x3e9e('0x24')](saveUpdates(_0x3abaf9[_0x3e9e('0x46')],null))['then'](respondWithResult(_0x4b5b5a,null))['catch'](handleError(_0x4b5b5a,null));};exports[_0x3e9e('0x48')]=function(_0x19d354,_0x459caf){return db[_0x3e9e('0x2b')][_0x3e9e('0x48')]()[_0x3e9e('0x24')](respondWithResult(_0x459caf,null))[_0x3e9e('0x44')](handleError(_0x459caf,null));};exports['download']=function(_0x4f864a,_0x2c549b,_0x588a73){var _0x759f2b=require(_0x3e9e('0x49'));var _0x5cb858=![];var _0x57af2={};if(_0x4f864a['query'][_0x3e9e('0x3b')]&&_0x4f864a[_0x3e9e('0x31')][_0x3e9e('0x3b')]===_0x3e9e('0x4a')){_0x57af2[_0x3e9e('0x4a')]=_0x4f864a[_0x3e9e('0x3f')]['id'];}else{_0x57af2['id']=_0x4f864a[_0x3e9e('0x3f')]['id'];}return db[_0x3e9e('0x2b')][_0x3e9e('0x47')]({'where':_0x57af2,'attributes':['id','value'],'raw':!![]})[_0x3e9e('0x24')](handleEntityNotFound(_0x2c549b,null))[_0x3e9e('0x24')](function(_0x39910d){if(_0x39910d){var _0x277ee9=_0x39910d[_0x3e9e('0x4b')];var _0x462ff6=util[_0x3e9e('0x30')](_0x3e9e('0x4c'),_0x277ee9);if(fs[_0x3e9e('0x4d')](_0x462ff6)){_0x5cb858=!![];return _0x759f2b['decryptFile'](_0x462ff6,_0x277ee9,config[_0x3e9e('0x4e')][_0x3e9e('0x4f')])[_0x3e9e('0x24')](function(){return _0x39910d;});}return _0x39910d;}})[_0x3e9e('0x24')](function(_0x27b39c){if(_0x27b39c){var _0x5c1f52=_0x27b39c[_0x3e9e('0x4b')];if(!fs[_0x3e9e('0x4d')](_0x5c1f52)){throw new db[(_0x3e9e('0x50'))][(_0x3e9e('0x51'))](_0x3e9e('0x52'));}if(_0x27b39c[_0x3e9e('0x53')]){return _0x2c549b[_0x3e9e('0x54')](_0x5c1f52,_0x27b39c[_0x3e9e('0x53')]+path[_0x3e9e('0x55')](_0x5c1f52),function(){if(_0x5cb858){fs['unlink'](_0x5c1f52);}});}else{return _0x2c549b[_0x3e9e('0x54')](_0x5c1f52,function(_0x4195b8){if(_0x5cb858){fs[_0x3e9e('0x56')](_0x5c1f52);}});}}})[_0x3e9e('0x44')](function(_0x308d97){if(_0x308d97['message']===_0x3e9e('0x52')){_0x2c549b['status'](0x194)[_0x3e9e('0x28')](_0x3e9e('0x57'));}else{return handleError(_0x2c549b,null);}});};exports[_0x3e9e('0x58')]=function(_0x5f4e90,_0x3ed284,_0x18eefb){var _0x44b054=require(_0x3e9e('0x49'));var _0x29ba71=![];var _0x3cbf37={'$and':[db[_0x3e9e('0x59')][_0x3e9e('0x5a')](db[_0x3e9e('0x59')]['fn'](_0x3e9e('0x5b'),db[_0x3e9e('0x59')][_0x3e9e('0x5c')](_0x3e9e('0x4a'))),_0x5f4e90[_0x3e9e('0x31')][_0x3e9e('0x5d')])]};if(_0x5f4e90['query'][_0x3e9e('0x3b')]&&_0x5f4e90[_0x3e9e('0x31')][_0x3e9e('0x3b')]===_0x3e9e('0x4a')){_0x3cbf37[_0x3e9e('0x5e')][_0x3e9e('0x5f')]({'uniqueid':_0x5f4e90[_0x3e9e('0x3f')]['id']});}else{_0x3cbf37[_0x3e9e('0x5e')][_0x3e9e('0x5f')]({'id':_0x5f4e90[_0x3e9e('0x3f')]['id']});}return db[_0x3e9e('0x2b')][_0x3e9e('0x47')]({'where':_0x3cbf37,'attributes':['id',_0x3e9e('0x4b')],'raw':!![]})[_0x3e9e('0x24')](handleEntityNotFound(_0x3ed284,null))[_0x3e9e('0x24')](function(_0x391131){if(_0x391131){var _0x125d2f=util[_0x3e9e('0x30')](_0x3e9e('0x4c'),_0x391131[_0x3e9e('0x4b')]);if(fs[_0x3e9e('0x4d')](_0x125d2f)){_0x29ba71=!![];return _0x44b054[_0x3e9e('0x60')](_0x125d2f,_0x391131[_0x3e9e('0x4b')],config[_0x3e9e('0x4e')]['recording'])[_0x3e9e('0x24')](function(){return _0x391131;});}return _0x391131;}})['then'](function(_0x4c7a52){if(_0x4c7a52){if(!fs[_0x3e9e('0x4d')](_0x4c7a52[_0x3e9e('0x4b')])){throw new db[(_0x3e9e('0x50'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x4c7a52['filename']){return _0x3ed284['download'](_0x4c7a52[_0x3e9e('0x4b')],_0x4c7a52[_0x3e9e('0x53')]+path[_0x3e9e('0x55')](_0x4c7a52[_0x3e9e('0x4b')]),function(){if(_0x29ba71){fs[_0x3e9e('0x56')](_0x4c7a52[_0x3e9e('0x4b')]);}});}else{return _0x3ed284[_0x3e9e('0x54')](_0x4c7a52[_0x3e9e('0x4b')],function(_0x3f0133){if(_0x29ba71){fs[_0x3e9e('0x56')](_0x4c7a52['value']);}});}}})[_0x3e9e('0x44')](handleError(_0x3ed284,null));};exports[_0x3e9e('0x61')]=function(_0x44ba1d,_0x1219d6){return db[_0x3e9e('0x2b')]['find']({'where':{'id':_0x44ba1d[_0x3e9e('0x3f')]['id']}})[_0x3e9e('0x24')](function(_0x8f6a5b){if(_['isNil'](_0x8f6a5b)){throw new ReferenceError(_0x3e9e('0x62'));}return _0x8f6a5b;})['then'](function(_0x24c101){var _0x50e04b=_0x24c101['value'];logger[_0x3e9e('0x63')](_0x3e9e('0x64'),_0x50e04b);if(!_[_0x3e9e('0x65')](_0x24c101[_0x3e9e('0x4b')])&&fs[_0x3e9e('0x4d')](_0x50e04b)){logger[_0x3e9e('0x63')](_0x3e9e('0x66')+_0x50e04b+_0x3e9e('0x67'));fs['unlinkSync'](_0x50e04b);}_0x50e04b=_0x50e04b+_0x3e9e('0x68');if(!_['isNil'](_0x24c101['value'])&&fs[_0x3e9e('0x4d')](_0x50e04b)){logger['info'](_0x3e9e('0x66')+_0x50e04b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x50e04b);}return _0x24c101;})['then'](function(_0x3b2c20){if(!_0x3b2c20)throw new InternalError();return _0x3b2c20[_0x3e9e('0x61')]();})['then'](function(){_0x1219d6[_0x3e9e('0x18')](0xcc)[_0x3e9e('0x19')]();})['catch'](handleError(_0x1219d6,null));};function getBucketslist(_0x35b475,_0x17d33c,_0x3ec50b){return new Promise(function(_0xe082fd,_0x372b44){var _0x3cbe9b=new AWS['S3']({'accessKeyId':_0x17d33c,'secretAccessKey':_0x35b475,'region':_0x3ec50b});_0x3cbe9b['listBuckets']({},function(_0x777713,_0x591e1a){if(_0x777713){return _0x372b44(_0x777713);}else{return _0xe082fd(_0x591e1a);}});});}function createBucket(_0xd98b79,_0x537853,_0x467527,_0x3bc305){return new Promise(function(_0x1e0113,_0x114c7e){var _0x186961=new AWS['S3']({'accessKeyId':_0x537853,'secretAccessKey':_0xd98b79,'region':_0x467527});_0x186961[_0x3e9e('0x69')]({'Bucket':_0x3bc305},function(_0x450701,_0x4b7681){if(_0x450701){return _0x114c7e(_0x450701);}else{return _0x1e0113(_0x4b7681);}});});}function uploadFile(_0xf6d7d8,_0xf454d5,_0x2f19f0,_0x26f89d,_0x416b7c,_0x55aafd){return new Promise(function(_0x3d826a,_0xe080b4){var _0x1c3ef8=new AWS['S3']({'accessKeyId':_0xf454d5,'secretAccessKey':_0xf6d7d8,'region':_0x2f19f0});_0x1c3ef8['upload']({'Bucket':_0x26f89d,'Key':_0x416b7c,'Body':_0x55aafd},function(_0x1ab11b,_0x2b8b9a){if(_0x1ab11b){return _0xe080b4(_0x1ab11b);}else{return _0x3d826a(_0x2b8b9a);}});});}function startTranscribe(_0x30b051,_0x2098b6,_0x5d96ee,_0x32f0de,_0xc72583,_0x4e3018){return new Promise(function(_0x30f046,_0xc9a34){var _0x3a8117=new AWS[(_0x3e9e('0x6a'))]({'accessKeyId':_0x2098b6,'secretAccessKey':_0x30b051,'region':_0x5d96ee});_0x3a8117[_0x3e9e('0x6b')]({'TranscriptionJobName':_0x32f0de,'LanguageCode':_0xc72583,'Media':{'MediaFileUri':_0x4e3018}},function(_0x5144ce,_0x12b72c){if(_0x5144ce){return _0xc9a34(_0x5144ce);}else{return _0x30f046(_0x12b72c);}});});}function transcribe(_0x30ed80,_0xe239cd,_0x29f7a7,_0x459438,_0x4c32cf,_0x30cdd8,_0x3a5e23){return new Promise(function(_0x4ea408,_0x9cac0a){var _0x4047ed={};logger['info'](util[_0x3e9e('0x30')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x30ed80,_0x4c32cf));return uploadFile(_0xe239cd,_0x29f7a7,_0x459438,_0x4c32cf,path[_0x3e9e('0x6c')](_0x30cdd8),fs[_0x3e9e('0x6d')](_0x30cdd8))['then'](function(_0xb53d3d){logger[_0x3e9e('0x63')](util[_0x3e9e('0x30')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x30ed80,_0x4c32cf,_0xb53d3d[_0x3e9e('0x6e')]));_0x4047ed['bucket']=_0xb53d3d[_0x3e9e('0x6f')];_0x4047ed[_0x3e9e('0x70')]=_0xb53d3d[_0x3e9e('0x6e')];logger[_0x3e9e('0x63')](util[_0x3e9e('0x30')](_0x3e9e('0x71'),_0x30ed80));return startTranscribe(_0xe239cd,_0x29f7a7,_0x459438,uuidv4(),_0x3a5e23,_0xb53d3d['Location']);})[_0x3e9e('0x24')](function(_0x329fae){logger[_0x3e9e('0x63')](util[_0x3e9e('0x30')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x30ed80,_0x329fae[_0x3e9e('0x72')]['TranscriptionJobName']));_0x4047ed[_0x3e9e('0x73')]=_0x329fae['TranscriptionJob']['TranscriptionJobName'];_0x4047ed[_0x3e9e('0x74')]=_0x329fae[_0x3e9e('0x72')][_0x3e9e('0x75')];return _0x4ea408(_0x4047ed);})[_0x3e9e('0x44')](function(_0x54e47a){return _0x9cac0a(_0x54e47a);});});}exports['runTranscribe']=function(_0xdd3ecb,_0x1afd0e,_0x22b7c8){var _0xd2af5;var _0x5a1296;var _0x4a4e92;var _0x156710=require(_0x3e9e('0x49'));return db[_0x3e9e('0x2b')][_0x3e9e('0x76')]({'where':{'id':_0xdd3ecb['params']['id']}})[_0x3e9e('0x24')](function(_0x82229f){if(_0x82229f){var _0xee1659=util['format'](_0x3e9e('0x4c'),_0x82229f[_0x3e9e('0x4b')]);if(fs[_0x3e9e('0x4d')](_0xee1659)){cypher=!![];return _0x156710[_0x3e9e('0x60')](_0xee1659,_0x82229f[_0x3e9e('0x4b')],config['secrets'][_0x3e9e('0x4f')])['then'](function(){return _0x82229f;});}return _0x82229f;}})['then'](function(_0x52ba86){if(!_0x52ba86){throw new db['Sequelize'][(_0x3e9e('0x51'))]('Voice\x20Recording\x20not\x20found');}_0x5a1296=_0x52ba86;return db[_0x3e9e('0x77')][_0x3e9e('0x76')]({'where':{'id':0x1}});})[_0x3e9e('0x24')](handleEntityNotFound(_0x1afd0e,null))[_0x3e9e('0x24')](function(_0x1cfe73){if(_0x1cfe73){_0xd2af5=_0x1cfe73;if(!_0xd2af5['transcribe']||!_0xd2af5[_0x3e9e('0x78')]||!_0xd2af5[_0x3e9e('0x79')]||!_0xd2af5['language']||!_0xd2af5[_0x3e9e('0x7a')]){throw new db['Sequelize']['ValidationError'](_0x3e9e('0x7b'));}if(_0xdd3ecb[_0x3e9e('0x46')][_0x3e9e('0x7c')]&&(!_0xd2af5[_0x3e9e('0x7d')]||!_0xd2af5['sentimentAccountId']||!_0xd2af5[_0x3e9e('0x7e')]||!_0xd2af5['language']||!_0xd2af5[_0x3e9e('0x7a')])){throw new db['Sequelize'][(_0x3e9e('0x51'))](_0x3e9e('0x7f'));}return db[_0x3e9e('0x80')][_0x3e9e('0x76')]({'where':{'id':_0xd2af5['transcribeAccountId']}});}})['then'](function(_0x2a39ff){if(!_0x2a39ff){throw new db[(_0x3e9e('0x50'))][(_0x3e9e('0x51'))](_0x3e9e('0x81'));}if(!_0x2a39ff[_0x3e9e('0x82')]||!_0x2a39ff['data2']){throw new db[(_0x3e9e('0x50'))][(_0x3e9e('0x51'))]('Cloud\x20Provider\x20not\x20configured');}_0x4a4e92=_0x2a39ff;return getBucketslist(_0x4a4e92[_0x3e9e('0x82')],_0x4a4e92[_0x3e9e('0x83')],_0xd2af5[_0x3e9e('0x79')]);})['then'](function(_0x116914){if(_0x116914&&_0x116914[_0x3e9e('0x84')]){var _0x396602=_['find'](_0x116914['Buckets'],function(_0x1ac81a){return _0x1ac81a['Name']===_0xd2af5[_0x3e9e('0x7a')];});if(!_0x396602){logger[_0x3e9e('0x63')](util[_0x3e9e('0x30')](_0x3e9e('0x85'),_0xdd3ecb['params']['id'],_0xd2af5[_0x3e9e('0x7a')]));return createBucket(_0x4a4e92['data1'],_0x4a4e92[_0x3e9e('0x83')],_0xd2af5[_0x3e9e('0x79')],_0xd2af5['bucket']);}logger[_0x3e9e('0x63')](util['format'](_0x3e9e('0x86'),_0xdd3ecb[_0x3e9e('0x3f')]['id'],_0xd2af5[_0x3e9e('0x7a')]));return;}})[_0x3e9e('0x24')](function(_0xb33d71){if(_0x5a1296['transcribeStatus']===_0x3e9e('0x87')){return transcribe(_0xdd3ecb[_0x3e9e('0x3f')]['id'],_0x4a4e92[_0x3e9e('0x82')],_0x4a4e92[_0x3e9e('0x83')],_0xd2af5['transcribeRegion'],_0xd2af5[_0x3e9e('0x7a')],_0x5a1296['value'],_0xd2af5['language']);}else{logger[_0x3e9e('0x63')](util[_0x3e9e('0x30')](_0x3e9e('0x88'),_0xdd3ecb[_0x3e9e('0x3f')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x3e9e('0x24')](function(_0x30149f){if(_0x30149f){_0x30149f[_0x3e9e('0x89')]=_0xdd3ecb[_0x3e9e('0x46')][_0x3e9e('0x7c')];return _0x5a1296[_0x3e9e('0x8a')](_0x30149f);}})[_0x3e9e('0x24')](respondWithResult(_0x1afd0e,null))[_0x3e9e('0x44')](handleError(_0x1afd0e,null));};function writeFile(_0x1bab4d,_0x216e4d){return new Promise(function(_0x39751a,_0x4f29b2){fs[_0x3e9e('0x8b')](_0x216e4d,_0x1bab4d,function(_0x45fc9a,_0x4d22e8){if(_0x45fc9a){return _0x4f29b2(_0x45fc9a);}else{return _0x39751a(_0x4d22e8);}});});}exports[_0x3e9e('0x8c')]=function(_0x48bd2d,_0x1af320,_0x4b5706){return db[_0x3e9e('0x2b')][_0x3e9e('0x76')]({'where':{'id':_0x48bd2d[_0x3e9e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1af320))[_0x3e9e('0x24')](function(_0x261a82){if(_0x261a82&&_0x261a82['fileText']){var _0x25f1b6=_0x261a82[_0x3e9e('0x8d')];var _0x5542c8=config[_0x3e9e('0x8e')]+_0x3e9e('0x8f')+_0x261a82['id']+_0x3e9e('0x90');if(fs[_0x3e9e('0x4d')](_0x5542c8)){return _0x5542c8;}return writeFile(_0x25f1b6,_0x5542c8)[_0x3e9e('0x24')](function(){return _0x5542c8;});}else{throw new db['Sequelize'][(_0x3e9e('0x51'))](_0x3e9e('0x91'));}})[_0x3e9e('0x24')](function(_0x391d96){return _0x1af320[_0x3e9e('0x54')](_0x391d96);})[_0x3e9e('0x44')](handleError(_0x1af320));};
\ No newline at end of file
index d516782..784ddb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4599=['./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4599,0x155));var _0x9459=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4599[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9459('0x0'));var util=require('util');var logger=require(_0x9459('0x1'))(_0x9459('0x2'));var moment=require(_0x9459('0x3'));var BPromise=require(_0x9459('0x4'));var rp=require(_0x9459('0x5'));var fs=require('fs');var path=require(_0x9459('0x6'));var rimraf=require(_0x9459('0x7'));var config=require(_0x9459('0x8'));var attributes=require(_0x9459('0x9'));module[_0x9459('0xa')]=function(_0x41b4fb,_0x2c9abb){return _0x41b4fb['define'](_0x9459('0xb'),attributes,{'tableName':_0x9459('0xc'),'paranoid':![],'indexes':[{'name':_0x9459('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x63d4=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x63d4,0x117));var _0x463d=function(_0x1d2156,_0x1b11aa){_0x1d2156=_0x1d2156-0x0;var _0x5e7256=_0x63d4[_0x1d2156];return _0x5e7256;};'use strict';var _=require(_0x463d('0x0'));var util=require(_0x463d('0x1'));var logger=require(_0x463d('0x2'))('api');var moment=require(_0x463d('0x3'));var BPromise=require(_0x463d('0x4'));var rp=require(_0x463d('0x5'));var fs=require('fs');var path=require(_0x463d('0x6'));var rimraf=require(_0x463d('0x7'));var config=require('../../config/environment');var attributes=require(_0x463d('0x8'));module[_0x463d('0x9')]=function(_0x5ed957,_0x2a8098){return _0x5ed957[_0x463d('0xa')](_0x463d('0xb'),attributes,{'tableName':_0x463d('0xc'),'paranoid':![],'indexes':[{'name':_0x463d('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 7aa92d9..ab02a81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81c6=['unlink','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','limit','../../components/encryptor','Setting','findOne','create','body','existsSync','value','%s.cypher','encryptFile','secrets'];(function(_0xd54059,_0x4361b3){var _0x28194c=function(_0xf01fb6){while(--_0xf01fb6){_0xd54059['push'](_0xd54059['shift']());}};_0x28194c(++_0x4361b3);}(_0x81c6,0x1d5));var _0x681c=function(_0x3f83dc,_0x5c8047){_0x3f83dc=_0x3f83dc-0x0;var _0x3876b8=_0x81c6[_0x3f83dc];return _0x3876b8;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45331,_0xdc57a5,_0x5624d7){return new BPromise(function(_0x5b5f22,_0x1750e2){return client[_0x681c('0x8')](_0x45331,_0x5624d7)[_0x681c('0x9')](function(_0x5de78e){logger['info'](_0x681c('0xa'),_0xdc57a5,'request\x20sent');logger[_0x681c('0xb')](_0x681c('0xc'),_0xdc57a5,_0x681c('0xd'),JSON[_0x681c('0xe')](_0x5de78e));if(_0x5de78e['error']){if(_0x5de78e['error'][_0x681c('0xf')]===0x1f4){logger[_0x681c('0x10')](_0x681c('0xa'),_0xdc57a5,_0x5de78e['error'][_0x681c('0x11')]);return _0x1750e2(_0x5de78e['error'][_0x681c('0x11')]);}logger['error'](_0x681c('0xa'),_0xdc57a5,_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);return _0x5b5f22(_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);}else{logger[_0x681c('0x12')]('VoiceRecording,\x20%s,\x20%s',_0xdc57a5,_0x681c('0xd'));_0x5b5f22(_0x5de78e[_0x681c('0x13')][_0x681c('0x11')]);}})[_0x681c('0x14')](function(_0x2fce11){logger[_0x681c('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xdc57a5,_0x2fce11);_0x1750e2(_0x2fce11);});});}exports[_0x681c('0x15')]=function(_0x42f506){var _0x4a9192=this;return new Promise(function(_0x42304f,_0x5b03fd){return db[_0x681c('0x16')][_0x681c('0x17')](_0x42f506['body'],{'raw':_0x42f506[_0x681c('0x18')]?_0x42f506['options'][_0x681c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x1a')]||null:null,'attributes':_0x42f506[_0x681c('0x18')]?_0x42f506['options']['attributes']||null:null,'limit':_0x42f506['options']?_0x42f506[_0x681c('0x18')][_0x681c('0x1b')]||null:null})[_0x681c('0x9')](function(_0x27b8a0){logger[_0x681c('0x12')](_0x681c('0x15'),_0x42f506);logger[_0x681c('0xb')](_0x681c('0x15'),_0x42f506,JSON[_0x681c('0xe')](_0x27b8a0));_0x42304f(_0x27b8a0);})[_0x681c('0x14')](function(_0x2be552){logger[_0x681c('0x10')](_0x681c('0x15'),_0x2be552[_0x681c('0x11')],_0x42f506);_0x5b03fd(_0x4a9192[_0x681c('0x10')](0x1f4,_0x2be552[_0x681c('0x11')]));});});};exports['CreateVoiceRecording']=function(_0x11063b){var _0x5705a7=this;return new Promise(function(_0x5f8d64,_0x4bf08e){var _0x583499=require(_0x681c('0x1c'));var _0x17ea7c;return db[_0x681c('0x1d')][_0x681c('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x681c('0x9')](function(_0x39fca3){_0x17ea7c=_0x39fca3;return db[_0x681c('0x16')][_0x681c('0x1f')](_0x11063b[_0x681c('0x20')]);})[_0x681c('0x9')](function(_0x2c619f){if(_0x17ea7c['callRecordingEncryption']&&fs[_0x681c('0x21')](_0x2c619f[_0x681c('0x22')])){var _0x2e783d=util['format'](_0x681c('0x23'),_0x2c619f[_0x681c('0x22')]);return _0x583499[_0x681c('0x24')](_0x2c619f['value'],_0x2e783d,config[_0x681c('0x25')]['recording'])['then'](function(){fs[_0x681c('0x26')](_0x2c619f[_0x681c('0x22')]);logger[_0x681c('0x12')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2c619f;});}return _0x2c619f;})[_0x681c('0x9')](function(_0x508fb9){logger[_0x681c('0x12')]('CreateVoiceRecording',_0x11063b);logger['debug']('CreateVoiceRecording',_0x11063b,JSON[_0x681c('0xe')](_0x508fb9));_0x5f8d64(_0x508fb9);})[_0x681c('0x14')](function(_0x5a349a){logger[_0x681c('0x10')]('CreateVoiceRecording',_0x5a349a['message'],_0x11063b);_0x4bf08e(_0x5705a7[_0x681c('0x10')](0x1f4,_0x5a349a['message']));});});};
\ No newline at end of file
+var _0xacf4=['limit','debug','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes'];(function(_0x59a516,_0x2bd476){var _0x5b66bc=function(_0x3f96cd){while(--_0x3f96cd){_0x59a516['push'](_0x59a516['shift']());}};_0x5b66bc(++_0x2bd476);}(_0xacf4,0xe7));var _0x4acf=function(_0x3a0153,_0x45e831){_0x3a0153=_0x3a0153-0x0;var _0x345724=_0xacf4[_0x3a0153];return _0x345724;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});}exports[_0x4acf('0x13')]=function(_0x240c00){var _0x4b1d93=this;return new Promise(function(_0x2a678b,_0x137302){return db[_0x4acf('0x14')][_0x4acf('0x15')](_0x240c00[_0x4acf('0x16')],{'raw':_0x240c00[_0x4acf('0x17')]?_0x240c00[_0x4acf('0x17')][_0x4acf('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x240c00[_0x4acf('0x17')]?_0x240c00[_0x4acf('0x17')][_0x4acf('0x19')]||null:null,'attributes':_0x240c00['options']?_0x240c00[_0x4acf('0x17')][_0x4acf('0x1a')]||null:null,'limit':_0x240c00['options']?_0x240c00[_0x4acf('0x17')][_0x4acf('0x1b')]||null:null})['then'](function(_0x3b26ac){logger[_0x4acf('0xb')](_0x4acf('0x13'),_0x240c00);logger[_0x4acf('0x1c')]('UpdateVoiceRecording',_0x240c00,JSON[_0x4acf('0x1d')](_0x3b26ac));_0x2a678b(_0x3b26ac);})[_0x4acf('0x12')](function(_0x57e595){logger[_0x4acf('0xf')](_0x4acf('0x13'),_0x57e595['message'],_0x240c00);_0x137302(_0x4b1d93[_0x4acf('0xf')](0x1f4,_0x57e595[_0x4acf('0x10')]));});});};exports[_0x4acf('0x1e')]=function(_0x16458f){var _0x571a30=this;return new Promise(function(_0x50236d,_0x17a756){var _0x3f548a=require(_0x4acf('0x1f'));var _0x42c90c;return db[_0x4acf('0x20')][_0x4acf('0x21')]({'attributes':['id',_0x4acf('0x22')],'where':{'id':0x1},'raw':!![]})[_0x4acf('0xa')](function(_0x382c41){_0x42c90c=_0x382c41;return db[_0x4acf('0x14')]['create'](_0x16458f[_0x4acf('0x16')]);})[_0x4acf('0xa')](function(_0xd027c7){if(_0x42c90c[_0x4acf('0x22')]&&fs[_0x4acf('0x23')](_0xd027c7[_0x4acf('0x24')])){var _0x27384c=util['format'](_0x4acf('0x25'),_0xd027c7[_0x4acf('0x24')]);return _0x3f548a[_0x4acf('0x26')](_0xd027c7['value'],_0x27384c,config[_0x4acf('0x27')][_0x4acf('0x28')])[_0x4acf('0xa')](function(){fs[_0x4acf('0x29')](_0xd027c7['value']);logger[_0x4acf('0xb')](_0x4acf('0x2a'));return _0xd027c7;});}return _0xd027c7;})[_0x4acf('0xa')](function(_0x5e2332){logger[_0x4acf('0xb')](_0x4acf('0x1e'),_0x16458f);logger[_0x4acf('0x1c')](_0x4acf('0x1e'),_0x16458f,JSON[_0x4acf('0x1d')](_0x5e2332));_0x50236d(_0x5e2332);})[_0x4acf('0x12')](function(_0x490880){logger[_0x4acf('0xf')](_0x4acf('0x1e'),_0x490880['message'],_0x16458f);_0x17a756(_0x571a30[_0x4acf('0xf')](0x1f4,_0x490880['message']));});});};
\ No newline at end of file
index 3e05ec0..32f82fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d7d=['index','/describe','isAuthenticated','describe','post','put','/:id','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1f88b6,_0x11b64c){var _0x31bc6b=function(_0x50b368){while(--_0x50b368){_0x1f88b6['push'](_0x1f88b6['shift']());}};_0x31bc6b(++_0x11b64c);}(_0x4d7d,0x13a));var _0xd4d7=function(_0x5b3950,_0x4e5556){_0x5b3950=_0x5b3950-0x0;var _0x41e436=_0x4d7d[_0x5b3950];return _0x41e436;};'use strict';var multer=require(_0xd4d7('0x0'));var util=require(_0xd4d7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd4d7('0x2'));var router=express[_0xd4d7('0x3')]();var fs_extra=require(_0xd4d7('0x4'));var auth=require(_0xd4d7('0x5'));var interaction=require(_0xd4d7('0x6'));var config=require(_0xd4d7('0x7'));var controller=require('./voiceTransferReport.controller');router[_0xd4d7('0x8')]('/',auth['isAuthenticated'](),controller[_0xd4d7('0x9')]);router[_0xd4d7('0x8')](_0xd4d7('0xa'),auth[_0xd4d7('0xb')](),controller[_0xd4d7('0xc')]);router[_0xd4d7('0x8')]('/:id',auth[_0xd4d7('0xb')](),controller['show']);router[_0xd4d7('0xd')]('/',auth[_0xd4d7('0xb')](),controller['create']);router[_0xd4d7('0xe')](_0xd4d7('0xf'),auth[_0xd4d7('0xb')](),controller[_0xd4d7('0x10')]);router[_0xd4d7('0x11')]('/:id',auth[_0xd4d7('0xb')](),controller[_0xd4d7('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xa88d=['post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','isAuthenticated','describe','/:id','show'];(function(_0x19c5dd,_0x2a35f5){var _0x40218d=function(_0x1a07ad){while(--_0x1a07ad){_0x19c5dd['push'](_0x19c5dd['shift']());}};_0x40218d(++_0x2a35f5);}(_0xa88d,0xe2));var _0xda88=function(_0x35eebb,_0x449737){_0x35eebb=_0x35eebb-0x0;var _0x52a4f9=_0xa88d[_0x35eebb];return _0x52a4f9;};'use strict';var multer=require(_0xda88('0x0'));var util=require(_0xda88('0x1'));var path=require('path');var timeout=require(_0xda88('0x2'));var express=require(_0xda88('0x3'));var router=express[_0xda88('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xda88('0x5'));var config=require(_0xda88('0x6'));var controller=require(_0xda88('0x7'));router[_0xda88('0x8')]('/',auth['isAuthenticated'](),controller[_0xda88('0x9')]);router['get']('/describe',auth[_0xda88('0xa')](),controller[_0xda88('0xb')]);router['get'](_0xda88('0xc'),auth[_0xda88('0xa')](),controller[_0xda88('0xd')]);router[_0xda88('0xe')]('/',auth[_0xda88('0xa')](),controller[_0xda88('0xf')]);router[_0xda88('0x10')](_0xda88('0xc'),auth[_0xda88('0xa')](),controller['update']);router[_0xda88('0x11')](_0xda88('0xc'),auth[_0xda88('0xa')](),controller[_0xda88('0x12')]);module[_0xda88('0x13')]=router;
\ No newline at end of file
index 013edab..5c3b25e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4345=['ENUM','attended','STRING','exports'];(function(_0x521204,_0x141bd9){var _0x28f5c5=function(_0x36f94c){while(--_0x36f94c){_0x521204['push'](_0x521204['shift']());}};_0x28f5c5(++_0x141bd9);}(_0x4345,0x1af));var _0x5434=function(_0x4ff800,_0x3699d4){_0x4ff800=_0x4ff800-0x0;var _0x5c93a2=_0x4345[_0x4ff800];return _0x5c93a2;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x5434('0x0')]={'type':{'type':Sequelize[_0x5434('0x1')]('blind',_0x5434('0x2'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x5434('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x5434('0x3')]},'transferercalleridname':{'type':Sequelize[_0x5434('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x5434('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x5434('0x3')]},'transferercontext':{'type':Sequelize[_0x5434('0x3')]},'transfererexten':{'type':Sequelize[_0x5434('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x5434('0x3')]},'transfereechannel':{'type':Sequelize[_0x5434('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x5434('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x5434('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x5434('0x3')]},'transfereecontext':{'type':Sequelize[_0x5434('0x3')]},'transfereeexten':{'type':Sequelize[_0x5434('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x5434('0x3')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0x5434('0x3')]},'extension':{'type':Sequelize[_0x5434('0x3')]}};
\ No newline at end of file
+var _0x2ea4=['Yes','sequelize','moment','ENUM','blind','STRING'];(function(_0x62de50,_0x3b7861){var _0x18250e=function(_0x564359){while(--_0x564359){_0x62de50['push'](_0x62de50['shift']());}};_0x18250e(++_0x3b7861);}(_0x2ea4,0x17b));var _0x42ea=function(_0xa6c2e5,_0x1634ea){_0xa6c2e5=_0xa6c2e5-0x0;var _0x27af0d=_0x2ea4[_0xa6c2e5];return _0x27af0d;};'use strict';var Sequelize=require(_0x42ea('0x0'));var moment=require(_0x42ea('0x1'));module['exports']={'type':{'type':Sequelize[_0x42ea('0x2')](_0x42ea('0x3'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x42ea('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x42ea('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x42ea('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x42ea('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x42ea('0x4')]},'transfereechannel':{'type':Sequelize[_0x42ea('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x42ea('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x42ea('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x42ea('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x42ea('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x42ea('0x4')]},'isexternal':{'type':Sequelize[_0x42ea('0x2')](_0x42ea('0x5'),'No')},'context':{'type':Sequelize[_0x42ea('0x4')]},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 1bceeea..31b5349 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf40=['apply','save','update','then','destroy','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0xcf40,0x109));var _0x0cf4=function(_0x32480b,_0x7fd345){_0x32480b=_0x32480b-0x0;var _0x38f21e=_0xcf40[_0x32480b];return _0x38f21e;};'use strict';var emlformat=require(_0x0cf4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0cf4('0x1'));var jsonpatch=require(_0x0cf4('0x2'));var rp=require('request-promise');var moment=require(_0x0cf4('0x3'));var BPromise=require(_0x0cf4('0x4'));var Mustache=require(_0x0cf4('0x5'));var util=require(_0x0cf4('0x6'));var path=require(_0x0cf4('0x7'));var sox=require(_0x0cf4('0x8'));var csv=require(_0x0cf4('0x9'));var ejs=require(_0x0cf4('0xa'));var fs=require('fs');var fs_extra=require(_0x0cf4('0xb'));var _=require('lodash');var squel=require(_0x0cf4('0xc'));var crypto=require(_0x0cf4('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0cf4('0x9'));var querystring=require(_0x0cf4('0xe'));var Papa=require(_0x0cf4('0xf'));var Redis=require(_0x0cf4('0x10'));var authService=require(_0x0cf4('0x11'));var qs=require(_0x0cf4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0cf4('0x13'));var logger=require(_0x0cf4('0x14'))(_0x0cf4('0x15'));var utils=require(_0x0cf4('0x16'));var config=require(_0x0cf4('0x17'));var licenseUtil=require(_0x0cf4('0x18'));var db=require(_0x0cf4('0x19'))['db'];function respondWithStatusCode(_0x23ddc8,_0x3efb14){_0x3efb14=_0x3efb14||0xcc;return function(_0xbe3e96){if(_0xbe3e96){return _0x23ddc8[_0x0cf4('0x1a')](_0x3efb14);}return _0x23ddc8[_0x0cf4('0x1b')](_0x3efb14)[_0x0cf4('0x1c')]();};}function respondWithResult(_0x560757,_0x41e09a){_0x41e09a=_0x41e09a||0xc8;return function(_0x3fc418){if(_0x3fc418){return _0x560757[_0x0cf4('0x1b')](_0x41e09a)[_0x0cf4('0x1d')](_0x3fc418);}};}function respondWithFilteredResult(_0x5c3b98,_0x5ca494){return function(_0x3e8bb7){if(_0x3e8bb7){var _0x32a447=typeof _0x5ca494[_0x0cf4('0x1e')]===_0x0cf4('0x1f')&&typeof _0x5ca494[_0x0cf4('0x20')]==='undefined';var _0x48a094=_0x3e8bb7['count'];var _0x40bea4=_0x32a447?0x0:_0x5ca494[_0x0cf4('0x1e')];var _0x45d5ba=_0x32a447?_0x3e8bb7[_0x0cf4('0x21')]:_0x5ca494[_0x0cf4('0x1e')]+_0x5ca494['limit'];var _0x5380c8;if(_0x45d5ba>=_0x48a094){_0x45d5ba=_0x48a094;_0x5380c8=0xc8;}else{_0x5380c8=0xce;}_0x5c3b98[_0x0cf4('0x1b')](_0x5380c8);return _0x5c3b98['set'](_0x0cf4('0x22'),_0x40bea4+'-'+_0x45d5ba+'/'+_0x48a094)['json'](_0x3e8bb7);}return null;};}function patchUpdates(_0xe48bda){return function(_0x158998){try{jsonpatch[_0x0cf4('0x23')](_0x158998,_0xe48bda,!![]);}catch(_0xf16ecf){return BPromise['reject'](_0xf16ecf);}return _0x158998[_0x0cf4('0x24')]();};}function saveUpdates(_0x32a2a4,_0x5a8697){return function(_0x15260a){if(_0x15260a){return _0x15260a[_0x0cf4('0x25')](_0x32a2a4)[_0x0cf4('0x26')](function(_0x59aed9){return _0x59aed9;});}return null;};}function removeEntity(_0x546eaf,_0x46e4c1){return function(_0x4b684f){if(_0x4b684f){return _0x4b684f[_0x0cf4('0x27')]()[_0x0cf4('0x26')](function(){_0x546eaf[_0x0cf4('0x1b')](0xcc)[_0x0cf4('0x1c')]();});}};}function handleEntityNotFound(_0x173ebe,_0x5cac98){return function(_0x1a90d9){if(!_0x1a90d9){_0x173ebe[_0x0cf4('0x1a')](0x194);}return _0x1a90d9;};}function handleError(_0x2c9660,_0x506dd9){_0x506dd9=_0x506dd9||0x1f4;return function(_0x5a2773){logger['error'](_0x5a2773[_0x0cf4('0x28')]);if(_0x5a2773['name']){delete _0x5a2773[_0x0cf4('0x29')];}_0x2c9660[_0x0cf4('0x1b')](_0x506dd9)['send'](_0x5a2773);};}exports[_0x0cf4('0x2a')]=function(_0x2a7219,_0x7dd496){var _0x30511c={},_0x52ede5={},_0x1fd99e={'count':0x0,'rows':[]};var _0x46fa1d=_[_0x0cf4('0x2b')](db[_0x0cf4('0x2c')][_0x0cf4('0x2d')],function(_0x13b66c){return{'name':_0x13b66c[_0x0cf4('0x2e')],'type':_0x13b66c[_0x0cf4('0x2f')][_0x0cf4('0x30')]};});_0x52ede5[_0x0cf4('0x31')]=_['map'](_0x46fa1d,_0x0cf4('0x29'));_0x52ede5[_0x0cf4('0x32')]=_[_0x0cf4('0x33')](_0x2a7219[_0x0cf4('0x32')]);_0x52ede5['filters']=_[_0x0cf4('0x34')](_0x52ede5[_0x0cf4('0x31')],_0x52ede5[_0x0cf4('0x32')]);_0x30511c[_0x0cf4('0x35')]=_['intersection'](_0x52ede5['model'],qs[_0x0cf4('0x36')](_0x2a7219['query'][_0x0cf4('0x36')]));_0x30511c['attributes']=_0x30511c['attributes'][_0x0cf4('0x37')]?_0x30511c['attributes']:_0x52ede5[_0x0cf4('0x31')];if(!_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x38')](_0x0cf4('0x39'))){_0x30511c[_0x0cf4('0x20')]=qs['limit'](_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x20')]);_0x30511c[_0x0cf4('0x1e')]=qs[_0x0cf4('0x1e')](_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x1e')]);}_0x30511c[_0x0cf4('0x3a')]=qs[_0x0cf4('0x3b')](_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x3b')]);_0x30511c[_0x0cf4('0x3c')]=qs[_0x0cf4('0x3d')](_[_0x0cf4('0x3e')](_0x2a7219[_0x0cf4('0x32')],_0x52ede5['filters']),_0x46fa1d);if(_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x3f')]){_0x30511c['where']=_[_0x0cf4('0x40')](_0x30511c[_0x0cf4('0x3c')],{'$or':_[_0x0cf4('0x2b')](_0x46fa1d,function(_0x5e1844){if(_0x5e1844['type']!=='VIRTUAL'){var _0x4650f9={};_0x4650f9[_0x5e1844[_0x0cf4('0x29')]]={'$like':'%'+_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x3f')]+'%'};return _0x4650f9;}})});}_0x30511c=_[_0x0cf4('0x40')]({},_0x30511c,_0x2a7219[_0x0cf4('0x41')]);var _0x2aa960={'where':_0x30511c[_0x0cf4('0x3c')]};return db[_0x0cf4('0x2c')][_0x0cf4('0x21')](_0x2aa960)[_0x0cf4('0x26')](function(_0x58b3b7){_0x1fd99e[_0x0cf4('0x21')]=_0x58b3b7;if(_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x42')]){_0x30511c[_0x0cf4('0x43')]=[{'all':!![]}];}return db[_0x0cf4('0x2c')][_0x0cf4('0x44')](_0x30511c);})['then'](function(_0x129f6e){_0x1fd99e[_0x0cf4('0x45')]=_0x129f6e;return _0x1fd99e;})['then'](respondWithFilteredResult(_0x7dd496,_0x30511c))[_0x0cf4('0x46')](handleError(_0x7dd496,null));};exports[_0x0cf4('0x47')]=function(_0x3f230e,_0xed63e1){var _0x570273={'raw':!![],'where':{'id':_0x3f230e[_0x0cf4('0x48')]['id']}},_0x15bc19={};_0x15bc19[_0x0cf4('0x31')]=_['keys'](db[_0x0cf4('0x2c')]['rawAttributes']);_0x15bc19[_0x0cf4('0x32')]=_[_0x0cf4('0x33')](_0x3f230e[_0x0cf4('0x32')]);_0x15bc19[_0x0cf4('0x3d')]=_['intersection'](_0x15bc19['model'],_0x15bc19[_0x0cf4('0x32')]);_0x570273[_0x0cf4('0x35')]=_[_0x0cf4('0x34')](_0x15bc19[_0x0cf4('0x31')],qs[_0x0cf4('0x36')](_0x3f230e[_0x0cf4('0x32')][_0x0cf4('0x36')]));_0x570273['attributes']=_0x570273[_0x0cf4('0x35')]['length']?_0x570273[_0x0cf4('0x35')]:_0x15bc19[_0x0cf4('0x31')];if(_0x3f230e['query']['includeAll']){_0x570273[_0x0cf4('0x43')]=[{'all':!![]}];}_0x570273=_[_0x0cf4('0x40')]({},_0x570273,_0x3f230e[_0x0cf4('0x41')]);return db['VoiceTransferReport']['find'](_0x570273)['then'](handleEntityNotFound(_0xed63e1,null))[_0x0cf4('0x26')](respondWithResult(_0xed63e1,null))[_0x0cf4('0x46')](handleError(_0xed63e1,null));};exports['create']=function(_0x20cb8,_0x53462c){return db[_0x0cf4('0x2c')]['create'](_0x20cb8['body'],{})[_0x0cf4('0x26')](respondWithResult(_0x53462c,0xc9))[_0x0cf4('0x46')](handleError(_0x53462c,null));};exports[_0x0cf4('0x25')]=function(_0xccd7e2,_0x2f45d2){if(_0xccd7e2[_0x0cf4('0x49')]['id']){delete _0xccd7e2[_0x0cf4('0x49')]['id'];}return db[_0x0cf4('0x2c')]['find']({'where':{'id':_0xccd7e2[_0x0cf4('0x48')]['id']}})[_0x0cf4('0x26')](handleEntityNotFound(_0x2f45d2,null))[_0x0cf4('0x26')](saveUpdates(_0xccd7e2['body'],null))[_0x0cf4('0x26')](respondWithResult(_0x2f45d2,null))['catch'](handleError(_0x2f45d2,null));};exports['destroy']=function(_0x67e516,_0x181d09){return db[_0x0cf4('0x2c')]['find']({'where':{'id':_0x67e516[_0x0cf4('0x48')]['id']}})[_0x0cf4('0x26')](handleEntityNotFound(_0x181d09,null))[_0x0cf4('0x26')](removeEntity(_0x181d09,null))[_0x0cf4('0x46')](handleError(_0x181d09,null));};exports[_0x0cf4('0x4a')]=function(_0x1e5507,_0x8102b6){return db['VoiceTransferReport']['describe']()[_0x0cf4('0x26')](respondWithResult(_0x8102b6,null))[_0x0cf4('0x46')](handleError(_0x8102b6,null));};
\ No newline at end of file
+var _0xd867=['filters','attributes','model','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','keys','VoiceTransferReport','rawAttributes','fields','length','includeAll','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','key','query'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xd867,0xb1));var _0x7d86=function(_0x1335ea,_0x6a9d29){_0x1335ea=_0x1335ea-0x0;var _0x297915=_0xd867[_0x1335ea];return _0x297915;};'use strict';var emlformat=require(_0x7d86('0x0'));var rimraf=require(_0x7d86('0x1'));var zipdir=require(_0x7d86('0x2'));var jsonpatch=require(_0x7d86('0x3'));var rp=require(_0x7d86('0x4'));var moment=require(_0x7d86('0x5'));var BPromise=require(_0x7d86('0x6'));var Mustache=require(_0x7d86('0x7'));var util=require(_0x7d86('0x8'));var path=require(_0x7d86('0x9'));var sox=require(_0x7d86('0xa'));var csv=require('to-csv');var ejs=require(_0x7d86('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d86('0xc'));var squel=require(_0x7d86('0xd'));var crypto=require('crypto');var jsforce=require(_0x7d86('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7d86('0xf'));var Papa=require(_0x7d86('0x10'));var Redis=require(_0x7d86('0x11'));var authService=require(_0x7d86('0x12'));var qs=require(_0x7d86('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d86('0x14'));var logger=require(_0x7d86('0x15'))(_0x7d86('0x16'));var utils=require('../../config/utils');var config=require(_0x7d86('0x17'));var licenseUtil=require(_0x7d86('0x18'));var db=require(_0x7d86('0x19'))['db'];function respondWithStatusCode(_0x2a8248,_0x5b4cf6){_0x5b4cf6=_0x5b4cf6||0xcc;return function(_0x184480){if(_0x184480){return _0x2a8248['sendStatus'](_0x5b4cf6);}return _0x2a8248[_0x7d86('0x1a')](_0x5b4cf6)[_0x7d86('0x1b')]();};}function respondWithResult(_0x18ef27,_0x59062c){_0x59062c=_0x59062c||0xc8;return function(_0x4252b9){if(_0x4252b9){return _0x18ef27['status'](_0x59062c)[_0x7d86('0x1c')](_0x4252b9);}};}function respondWithFilteredResult(_0x462d6a,_0x3f9ae4){return function(_0x1896b6){if(_0x1896b6){var _0x56eba4=typeof _0x3f9ae4[_0x7d86('0x1d')]===_0x7d86('0x1e')&&typeof _0x3f9ae4[_0x7d86('0x1f')]===_0x7d86('0x1e');var _0x576659=_0x1896b6[_0x7d86('0x20')];var _0x50b98=_0x56eba4?0x0:_0x3f9ae4[_0x7d86('0x1d')];var _0x4530e9=_0x56eba4?_0x1896b6[_0x7d86('0x20')]:_0x3f9ae4['offset']+_0x3f9ae4[_0x7d86('0x1f')];var _0x26519a;if(_0x4530e9>=_0x576659){_0x4530e9=_0x576659;_0x26519a=0xc8;}else{_0x26519a=0xce;}_0x462d6a[_0x7d86('0x1a')](_0x26519a);return _0x462d6a['set']('Content-Range',_0x50b98+'-'+_0x4530e9+'/'+_0x576659)[_0x7d86('0x1c')](_0x1896b6);}return null;};}function patchUpdates(_0x928ee6){return function(_0x38c97c){try{jsonpatch[_0x7d86('0x21')](_0x38c97c,_0x928ee6,!![]);}catch(_0x4cba99){return BPromise['reject'](_0x4cba99);}return _0x38c97c['save']();};}function saveUpdates(_0x246fa7,_0x46e60a){return function(_0x514e48){if(_0x514e48){return _0x514e48[_0x7d86('0x22')](_0x246fa7)[_0x7d86('0x23')](function(_0x3f9b8d){return _0x3f9b8d;});}return null;};}function removeEntity(_0x3a0890,_0x1a73cd){return function(_0x15a92a){if(_0x15a92a){return _0x15a92a[_0x7d86('0x24')]()[_0x7d86('0x23')](function(){_0x3a0890[_0x7d86('0x1a')](0xcc)[_0x7d86('0x1b')]();});}};}function handleEntityNotFound(_0x217630,_0x25bf48){return function(_0x3999b2){if(!_0x3999b2){_0x217630[_0x7d86('0x25')](0x194);}return _0x3999b2;};}function handleError(_0x65b23,_0x10dc48){_0x10dc48=_0x10dc48||0x1f4;return function(_0x31814d){logger[_0x7d86('0x26')](_0x31814d[_0x7d86('0x27')]);if(_0x31814d[_0x7d86('0x28')]){delete _0x31814d['name'];}_0x65b23['status'](_0x10dc48)[_0x7d86('0x29')](_0x31814d);};}exports[_0x7d86('0x2a')]=function(_0x2dbd36,_0x5c6039){var _0x29ef4c={},_0x147b95={},_0x1fae52={'count':0x0,'rows':[]};var _0x4b79cc=_[_0x7d86('0x2b')](db['VoiceTransferReport']['rawAttributes'],function(_0x151b91){return{'name':_0x151b91[_0x7d86('0x2c')],'type':_0x151b91[_0x7d86('0x2d')][_0x7d86('0x2e')]};});_0x147b95['model']=_['map'](_0x4b79cc,_0x7d86('0x28'));_0x147b95[_0x7d86('0x2f')]=_['keys'](_0x2dbd36[_0x7d86('0x2f')]);_0x147b95[_0x7d86('0x30')]=_['intersection'](_0x147b95['model'],_0x147b95[_0x7d86('0x2f')]);_0x29ef4c[_0x7d86('0x31')]=_['intersection'](_0x147b95[_0x7d86('0x32')],qs['fields'](_0x2dbd36[_0x7d86('0x2f')]['fields']));_0x29ef4c[_0x7d86('0x31')]=_0x29ef4c['attributes']['length']?_0x29ef4c[_0x7d86('0x31')]:_0x147b95[_0x7d86('0x32')];if(!_0x2dbd36[_0x7d86('0x2f')][_0x7d86('0x33')](_0x7d86('0x34'))){_0x29ef4c[_0x7d86('0x1f')]=qs[_0x7d86('0x1f')](_0x2dbd36['query']['limit']);_0x29ef4c['offset']=qs[_0x7d86('0x1d')](_0x2dbd36['query']['offset']);}_0x29ef4c[_0x7d86('0x35')]=qs['sort'](_0x2dbd36[_0x7d86('0x2f')][_0x7d86('0x36')]);_0x29ef4c[_0x7d86('0x37')]=qs[_0x7d86('0x30')](_['pick'](_0x2dbd36['query'],_0x147b95[_0x7d86('0x30')]),_0x4b79cc);if(_0x2dbd36['query']['filter']){_0x29ef4c[_0x7d86('0x37')]=_[_0x7d86('0x38')](_0x29ef4c[_0x7d86('0x37')],{'$or':_[_0x7d86('0x2b')](_0x4b79cc,function(_0x1256ab){if(_0x1256ab['type']!==_0x7d86('0x39')){var _0x434246={};_0x434246[_0x1256ab[_0x7d86('0x28')]]={'$like':'%'+_0x2dbd36[_0x7d86('0x2f')][_0x7d86('0x3a')]+'%'};return _0x434246;}})});}_0x29ef4c=_[_0x7d86('0x38')]({},_0x29ef4c,_0x2dbd36['options']);var _0x4de22a={'where':_0x29ef4c[_0x7d86('0x37')]};return db['VoiceTransferReport']['count'](_0x4de22a)[_0x7d86('0x23')](function(_0x3fa977){_0x1fae52['count']=_0x3fa977;if(_0x2dbd36[_0x7d86('0x2f')]['includeAll']){_0x29ef4c[_0x7d86('0x3b')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x7d86('0x3c')](_0x29ef4c);})[_0x7d86('0x23')](function(_0x680c03){_0x1fae52[_0x7d86('0x3d')]=_0x680c03;return _0x1fae52;})[_0x7d86('0x23')](respondWithFilteredResult(_0x5c6039,_0x29ef4c))[_0x7d86('0x3e')](handleError(_0x5c6039,null));};exports[_0x7d86('0x3f')]=function(_0x56adee,_0x16938b){var _0xc42df3={'raw':!![],'where':{'id':_0x56adee[_0x7d86('0x40')]['id']}},_0x54c32c={};_0x54c32c[_0x7d86('0x32')]=_[_0x7d86('0x41')](db[_0x7d86('0x42')][_0x7d86('0x43')]);_0x54c32c[_0x7d86('0x2f')]=_['keys'](_0x56adee[_0x7d86('0x2f')]);_0x54c32c[_0x7d86('0x30')]=_['intersection'](_0x54c32c['model'],_0x54c32c['query']);_0xc42df3[_0x7d86('0x31')]=_['intersection'](_0x54c32c[_0x7d86('0x32')],qs[_0x7d86('0x44')](_0x56adee['query'][_0x7d86('0x44')]));_0xc42df3[_0x7d86('0x31')]=_0xc42df3['attributes'][_0x7d86('0x45')]?_0xc42df3[_0x7d86('0x31')]:_0x54c32c[_0x7d86('0x32')];if(_0x56adee[_0x7d86('0x2f')][_0x7d86('0x46')]){_0xc42df3[_0x7d86('0x3b')]=[{'all':!![]}];}_0xc42df3=_[_0x7d86('0x38')]({},_0xc42df3,_0x56adee[_0x7d86('0x47')]);return db[_0x7d86('0x42')][_0x7d86('0x48')](_0xc42df3)[_0x7d86('0x23')](handleEntityNotFound(_0x16938b,null))['then'](respondWithResult(_0x16938b,null))[_0x7d86('0x3e')](handleError(_0x16938b,null));};exports[_0x7d86('0x49')]=function(_0x508575,_0x1f4085){return db[_0x7d86('0x42')][_0x7d86('0x49')](_0x508575['body'],{})['then'](respondWithResult(_0x1f4085,0xc9))[_0x7d86('0x3e')](handleError(_0x1f4085,null));};exports['update']=function(_0x962c00,_0xcb6952){if(_0x962c00[_0x7d86('0x4a')]['id']){delete _0x962c00[_0x7d86('0x4a')]['id'];}return db[_0x7d86('0x42')][_0x7d86('0x48')]({'where':{'id':_0x962c00[_0x7d86('0x40')]['id']}})['then'](handleEntityNotFound(_0xcb6952,null))['then'](saveUpdates(_0x962c00[_0x7d86('0x4a')],null))[_0x7d86('0x23')](respondWithResult(_0xcb6952,null))[_0x7d86('0x3e')](handleError(_0xcb6952,null));};exports[_0x7d86('0x24')]=function(_0x945a5a,_0x5b3fff){return db[_0x7d86('0x42')][_0x7d86('0x48')]({'where':{'id':_0x945a5a['params']['id']}})['then'](handleEntityNotFound(_0x5b3fff,null))['then'](removeEntity(_0x5b3fff,null))[_0x7d86('0x3e')](handleError(_0x5b3fff,null));};exports['describe']=function(_0x3945e8,_0x337758){return db[_0x7d86('0x42')]['describe']()['then'](respondWithResult(_0x337758,null))[_0x7d86('0x3e')](handleError(_0x337758,null));};
\ No newline at end of file
index 955eb4b..3e9abe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3432=['define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','moment','bluebird','path','./voiceTransferReport.attributes','exports'];(function(_0x518b48,_0x18997e){var _0x326810=function(_0x5cdeb6){while(--_0x5cdeb6){_0x518b48['push'](_0x518b48['shift']());}};_0x326810(++_0x18997e);}(_0x3432,0x1e7));var _0x2343=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3432[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2343('0x0'));var util=require(_0x2343('0x1'));var logger=require(_0x2343('0x2'))('api');var moment=require(_0x2343('0x3'));var BPromise=require(_0x2343('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2343('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2343('0x6'));module[_0x2343('0x7')]=function(_0x252f65,_0x350456){return _0x252f65[_0x2343('0x8')](_0x2343('0x9'),attributes,{'tableName':_0x2343('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5310=['rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','api','moment','request-promise'];(function(_0xe74a82,_0x478b52){var _0x249129=function(_0x4d3d13){while(--_0x4d3d13){_0xe74a82['push'](_0xe74a82['shift']());}};_0x249129(++_0x478b52);}(_0x5310,0x119));var _0x0531=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x5310[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x0531('0x0'));var util=require(_0x0531('0x1'));var logger=require('../../config/logger')(_0x0531('0x2'));var moment=require(_0x0531('0x3'));var BPromise=require('bluebird');var rp=require(_0x0531('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0531('0x5'));var config=require(_0x0531('0x6'));var attributes=require(_0x0531('0x7'));module[_0x0531('0x8')]=function(_0xda0069,_0x159e06){return _0xda0069[_0x0531('0x9')]('VoiceTransferReport',attributes,{'tableName':_0x0531('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3b707dd..b491022 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0f1=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','VoiceTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','stringify','lodash','moment','bluebird'];(function(_0x2a21f1,_0x5b6d1a){var _0x19b89a=function(_0x3c7a42){while(--_0x3c7a42){_0x2a21f1['push'](_0x2a21f1['shift']());}};_0x19b89a(++_0x5b6d1a);}(_0xa0f1,0x9f));var _0x1a0f=function(_0x265ad4,_0x523fbe){_0x265ad4=_0x265ad4-0x0;var _0x3bf700=_0xa0f1[_0x265ad4];return _0x3bf700;};'use strict';var _=require(_0x1a0f('0x0'));var util=require('util');var moment=require(_0x1a0f('0x1'));var BPromise=require(_0x1a0f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a0f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a0f('0x4'));var logger=require('../../config/logger')(_0x1a0f('0x5'));var config=require(_0x1a0f('0x6'));var jayson=require(_0x1a0f('0x7'));var client=jayson[_0x1a0f('0x8')][_0x1a0f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x187f88,_0x4a9168,_0x5b6d39){return new BPromise(function(_0x8e5a1a,_0x48a419){return client['request'](_0x187f88,_0x5b6d39)['then'](function(_0x51ebc6){logger[_0x1a0f('0xa')](_0x1a0f('0xb'),_0x4a9168,'request\x20sent');logger[_0x1a0f('0xc')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x4a9168,_0x1a0f('0xd'),JSON['stringify'](_0x51ebc6));if(_0x51ebc6[_0x1a0f('0xe')]){if(_0x51ebc6['error'][_0x1a0f('0xf')]===0x1f4){logger[_0x1a0f('0xe')](_0x1a0f('0xb'),_0x4a9168,_0x51ebc6[_0x1a0f('0xe')][_0x1a0f('0x10')]);return _0x48a419(_0x51ebc6[_0x1a0f('0xe')][_0x1a0f('0x10')]);}logger[_0x1a0f('0xe')](_0x1a0f('0xb'),_0x4a9168,_0x51ebc6[_0x1a0f('0xe')][_0x1a0f('0x10')]);return _0x8e5a1a(_0x51ebc6['error'][_0x1a0f('0x10')]);}else{logger[_0x1a0f('0xa')](_0x1a0f('0xb'),_0x4a9168,_0x1a0f('0xd'));_0x8e5a1a(_0x51ebc6[_0x1a0f('0x11')][_0x1a0f('0x10')]);}})[_0x1a0f('0x12')](function(_0x4b148d){logger[_0x1a0f('0xe')](_0x1a0f('0xb'),_0x4a9168,_0x4b148d);_0x48a419(_0x4b148d);});});}exports[_0x1a0f('0x13')]=function(_0x3c0df){var _0x4bd502=this;return new Promise(function(_0x945431,_0x4e4a9a){return db[_0x1a0f('0x14')][_0x1a0f('0x15')](_0x3c0df[_0x1a0f('0x16')],{'raw':_0x3c0df[_0x1a0f('0x17')]?_0x3c0df['options'][_0x1a0f('0x18')]===undefined?!![]:![]:!![]})[_0x1a0f('0x19')](function(_0x41e11b){logger[_0x1a0f('0xa')](_0x1a0f('0x13'),_0x3c0df);logger[_0x1a0f('0xc')]('CreateVoiceTransferReport',_0x3c0df,JSON[_0x1a0f('0x1a')](_0x41e11b));_0x945431(_0x41e11b);})[_0x1a0f('0x12')](function(_0x13623c){logger[_0x1a0f('0xe')](_0x1a0f('0x13'),_0x13623c['message'],_0x3c0df);_0x4e4a9a(_0x4bd502[_0x1a0f('0xe')](0x1f4,_0x13623c['message']));});});};
\ No newline at end of file
+var _0x5b52=['jayson/promise','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','then','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b52,0x1b2));var _0x25b5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5b52[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x25b5('0x0'));var util=require(_0x25b5('0x1'));var moment=require(_0x25b5('0x2'));var BPromise=require(_0x25b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x25b5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x25b5('0x5'));var logger=require(_0x25b5('0x6'))(_0x25b5('0x7'));var config=require('../../config/environment');var jayson=require(_0x25b5('0x8'));var client=jayson[_0x25b5('0x9')][_0x25b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56b6ba,_0x469b09,_0x3819a0){return new BPromise(function(_0x2cb2ca,_0x4a63eb){return client[_0x25b5('0xb')](_0x56b6ba,_0x3819a0)['then'](function(_0x1c882c){logger[_0x25b5('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x469b09,'request\x20sent');logger['debug'](_0x25b5('0xd'),_0x469b09,_0x25b5('0xe'),JSON['stringify'](_0x1c882c));if(_0x1c882c[_0x25b5('0xf')]){if(_0x1c882c[_0x25b5('0xf')]['code']===0x1f4){logger[_0x25b5('0xf')](_0x25b5('0x10'),_0x469b09,_0x1c882c[_0x25b5('0xf')][_0x25b5('0x11')]);return _0x4a63eb(_0x1c882c['error']['message']);}logger[_0x25b5('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x469b09,_0x1c882c[_0x25b5('0xf')]['message']);return _0x2cb2ca(_0x1c882c[_0x25b5('0xf')][_0x25b5('0x11')]);}else{logger['info'](_0x25b5('0x10'),_0x469b09,_0x25b5('0xe'));_0x2cb2ca(_0x1c882c[_0x25b5('0x12')][_0x25b5('0x11')]);}})[_0x25b5('0x13')](function(_0x46b6e3){logger[_0x25b5('0xf')](_0x25b5('0x10'),_0x469b09,_0x46b6e3);_0x4a63eb(_0x46b6e3);});});}exports[_0x25b5('0x14')]=function(_0x328c89){var _0x10149c=this;return new Promise(function(_0x59c7f6,_0x2c03a8){return db[_0x25b5('0x15')]['create'](_0x328c89[_0x25b5('0x16')],{'raw':_0x328c89[_0x25b5('0x17')]?_0x328c89['options'][_0x25b5('0x18')]===undefined?!![]:![]:!![]})[_0x25b5('0x19')](function(_0x43e981){logger[_0x25b5('0xc')]('CreateVoiceTransferReport',_0x328c89);logger['debug'](_0x25b5('0x14'),_0x328c89,JSON['stringify'](_0x43e981));_0x59c7f6(_0x43e981);})[_0x25b5('0x13')](function(_0x54fd57){logger[_0x25b5('0xf')]('CreateVoiceTransferReport',_0x54fd57[_0x25b5('0x11')],_0x328c89);_0x2c03a8(_0x10149c[_0x25b5('0xf')](0x1f4,_0x54fd57[_0x25b5('0x11')]));});});};
\ No newline at end of file
index 596ac9d..553603d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2852=['post','/originate','isAuthenticated','originate','canUpdate','hangup','/answer','answer','/hold','hold','/unhold','calls','/transfer','transfer','express','Router','../../components/auth/service','./webbar.controller'];(function(_0x5897ad,_0x27e5bf){var _0x8a5ffa=function(_0x13c25a){while(--_0x13c25a){_0x5897ad['push'](_0x5897ad['shift']());}};_0x8a5ffa(++_0x27e5bf);}(_0x2852,0xf8));var _0x2285=function(_0x4b30ca,_0x5d81a7){_0x4b30ca=_0x4b30ca-0x0;var _0x21cf1f=_0x2852[_0x4b30ca];return _0x21cf1f;};'use strict';var express=require(_0x2285('0x0'));var router=express[_0x2285('0x1')]();var auth=require(_0x2285('0x2'));var controller=require(_0x2285('0x3'));router[_0x2285('0x4')](_0x2285('0x5'),auth[_0x2285('0x6')](),auth['canUpdate'](),controller[_0x2285('0x7')]);router[_0x2285('0x4')]('/hangup',auth[_0x2285('0x6')](),auth[_0x2285('0x8')](),controller[_0x2285('0x9')]);router[_0x2285('0x4')](_0x2285('0xa'),auth['isAuthenticated'](),auth[_0x2285('0x8')](),controller[_0x2285('0xb')]);router[_0x2285('0x4')](_0x2285('0xc'),auth['isAuthenticated'](),auth[_0x2285('0x8')](),controller[_0x2285('0xd')]);router['post'](_0x2285('0xe'),auth[_0x2285('0x6')](),auth[_0x2285('0x8')](),controller['unhold']);router['post']('/calls',auth[_0x2285('0x6')](),auth[_0x2285('0x8')](),controller[_0x2285('0xf')]);router[_0x2285('0x4')](_0x2285('0x10'),auth[_0x2285('0x6')](),auth[_0x2285('0x8')](),controller[_0x2285('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x6541=['./webbar.controller','post','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','answer','/hold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6541,0x18c));var _0x1654=function(_0x1da8df,_0x3d96a1){_0x1da8df=_0x1da8df-0x0;var _0x338f60=_0x6541[_0x1da8df];return _0x338f60;};'use strict';var express=require(_0x1654('0x0'));var router=express[_0x1654('0x1')]();var auth=require(_0x1654('0x2'));var controller=require(_0x1654('0x3'));router[_0x1654('0x4')]('/originate',auth[_0x1654('0x5')](),auth[_0x1654('0x6')](),controller[_0x1654('0x7')]);router['post'](_0x1654('0x8'),auth[_0x1654('0x5')](),auth[_0x1654('0x6')](),controller[_0x1654('0x9')]);router[_0x1654('0x4')](_0x1654('0xa'),auth[_0x1654('0x5')](),auth[_0x1654('0x6')](),controller[_0x1654('0xb')]);router[_0x1654('0x4')](_0x1654('0xc'),auth[_0x1654('0x5')](),auth['canUpdate'](),controller['hold']);router[_0x1654('0x4')]('/unhold',auth['isAuthenticated'](),auth[_0x1654('0x6')](),controller[_0x1654('0xd')]);router[_0x1654('0x4')](_0x1654('0xe'),auth[_0x1654('0x5')](),auth['canUpdate'](),controller[_0x1654('0xf')]);router[_0x1654('0x4')](_0x1654('0x10'),auth[_0x1654('0x5')](),auth[_0x1654('0x6')](),controller[_0x1654('0x11')]);module[_0x1654('0x12')]=router;
\ No newline at end of file
index df550ff..df3975c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf80=['../../mysqldb','../../config/environment','client','http','../../config/logger','webbarapi','ioredis','redis','localhost','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','log','handleError:','error','status','send','name','NotFound','request','then','code','message','result','catch','agent','all','filter','rows','UserId','length','\x20not\x20found!','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','info','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','calls','VoiceChannels','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','webbar:transfer','path','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf80,0x1ef));var _0x0af8=function(_0x52bd7b,_0x4d01ca){_0x52bd7b=_0x52bd7b-0x0;var _0x1d7738=_0xaf80[_0x52bd7b];return _0x1d7738;};'use strict';var path=require(_0x0af8('0x0'));var fs=require('fs');var _=require(_0x0af8('0x1'));var db=require(_0x0af8('0x2'))['db'];var config=require(_0x0af8('0x3'));var util=require('util');var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0x0af8('0x4')][_0x0af8('0x5')]({'port':0x232a});var logger=require(_0x0af8('0x6'))(_0x0af8('0x7'));var Redis=require(_0x0af8('0x8'));config[_0x0af8('0x9')]=_['defaults'](config['redis'],{'host':_0x0af8('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0af8('0x9')]));var Schema=require(_0x0af8('0xb'));var originateValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x0af8('0xd'),'required':[!![],_0x0af8('0xe')]},'callerId':{'type':_0x0af8('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':[!![],_0x0af8('0x10')]},'transferNumber':{'type':_0x0af8('0xd'),'required':[!![],_0x0af8('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]}});function emit(_0x4755cb,_0x325b4c,_0x50d5ba){logger['info'](_0x4755cb,_0x325b4c,JSON['stringify'](_0x50d5ba));io['to'](_0x4755cb)[_0x0af8('0x12')](_0x325b4c,_0x50d5ba);}function handleError(_0x465161){return function(_0x54e946){console[_0x0af8('0x13')](_0x0af8('0x14'),_0x54e946,_0x54e946 instanceof RangeError);logger[_0x0af8('0x15')](_0x54e946['stack']);if(_0x54e946 instanceof RangeError){if(_0x54e946['name']){delete _0x54e946['name'];}_0x465161[_0x0af8('0x16')](0x194)[_0x0af8('0x17')](_0x54e946);}else{if(_0x54e946['name']){delete _0x54e946[_0x0af8('0x18')];}_0x465161['status'](0x1f4)['send'](_0x54e946);}};}function checkError(){return function(_0x40384f){if(!_0x40384f){throw new RangeError(_0x0af8('0x19'));}return _0x40384f;};}function respondWithRpcPromise(_0x29cd4a,_0x5c0dd1){return new BPromise(function(_0x162e95,_0x52778f){var _0x592523=amiClient;return _0x592523[_0x0af8('0x1a')](_0x29cd4a,_0x5c0dd1)[_0x0af8('0x1b')](function(_0x4b0492){if(_0x4b0492[_0x0af8('0x15')]){if(_0x4b0492[_0x0af8('0x15')][_0x0af8('0x1c')]===0x1f4){return _0x52778f(_0x4b0492[_0x0af8('0x15')][_0x0af8('0x1d')]);}return _0x162e95(_0x4b0492['error']['message']);}else{_0x162e95(_0x4b0492[_0x0af8('0x1e')]);}})[_0x0af8('0x1f')](function(_0x359583){_0x52778f(_0x359583);});});}function getAgent(_0xb43164){return db['User']['findOne']({'where':{'id':_0xb43164,'role':_0x0af8('0x20')}})[_0x0af8('0x1b')](checkError());}function getAgentCheckSession(_0x23a102,_0x140104){return new BPromise(function(_0x2e8853,_0x410216){var _0x318476=respondWithRpcPromise('VoiceChannels');var _0x34aa8b=getAgent(_0x23a102);Promise[_0x0af8('0x21')]([_0x318476,_0x34aa8b])[_0x0af8('0x1b')](function(_0x20eab4){var _0x1b94cf=_0x20eab4[0x0];var _0x231230=_0x20eab4[0x1];var _0x4575b0=_[_0x0af8('0x22')](_0x1b94cf[_0x0af8('0x23')],function(_0x270b49){return _0x270b49[_0x0af8('0x24')]==_0x231230['id']&&_0x270b49['sessionId']==_0x140104;});if(_0x4575b0[_0x0af8('0x25')]==0x1){_0x2e8853(_0x231230);}else{_0x410216(new RangeError('sessionId\x20'+_0x140104+_0x0af8('0x26')));}});});}exports['originate']=function(_0x318ca7,_0x1d2d4f){logger['info'](_0x0af8('0x27'),_0x318ca7[_0x0af8('0x28')]);var _0x34b3e5=originateValidation['validate'](_0x318ca7[_0x0af8('0x28')]);if(_0x34b3e5[_0x0af8('0x25')]>0x0){return _0x1d2d4f[_0x0af8('0x16')](0x190)['json'](_0x34b3e5);}var _0x3c4657=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x29')];var _0x1aded0=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x2a')];var _0x4dcdbc=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x2b')];var _0x73d193=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x2c')];return getAgent(_0x3c4657)[_0x0af8('0x1b')](function(_0x13991a){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x13991a[_0x0af8('0x18')]);emit(util[_0x0af8('0x2f')](_0x0af8('0x30'),_0x13991a['name']),_0x0af8('0x31'),{'callNumber':_0x1aded0,'callerId':_0x4dcdbc,'callbackUrl':_0x73d193});return _0x1d2d4f[_0x0af8('0x16')](0xc8)[_0x0af8('0x32')]({'error':![],'message':_0x0af8('0x33')});})[_0x0af8('0x1f')](handleError(_0x1d2d4f));};exports[_0x0af8('0x34')]=function(_0x114ef3,_0x5e971f){logger[_0x0af8('0x2d')](_0x0af8('0x35'),_0x114ef3[_0x0af8('0x28')]);var _0x4d7e1f=hangupValidation[_0x0af8('0xb')](_0x114ef3[_0x0af8('0x28')]);if(_0x4d7e1f[_0x0af8('0x25')]>0x0){return _0x5e971f['status'](0x190)[_0x0af8('0x32')](_0x4d7e1f);}var _0x122382=_0x114ef3[_0x0af8('0x28')][_0x0af8('0x29')];var _0x44c198=_0x114ef3[_0x0af8('0x28')][_0x0af8('0x36')];return getAgent(_0x122382)['then'](function(_0x586924){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x586924['name']);emit(util[_0x0af8('0x2f')](_0x0af8('0x30'),_0x586924['name']),_0x0af8('0x37'),{'sessionId':_0x44c198});return _0x5e971f['status'](0xc8)[_0x0af8('0x32')]({'error':![],'message':_0x0af8('0x38')});})['catch'](handleError(_0x5e971f));};exports[_0x0af8('0x39')]=function(_0x3fefbc,_0x497695){logger[_0x0af8('0x2d')]('answer\x20fired:',_0x3fefbc[_0x0af8('0x28')]);var _0x423eee=answerValidation[_0x0af8('0xb')](_0x3fefbc['body']);if(_0x423eee['length']>0x0){return _0x497695[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x423eee);}var _0x37e54e=_0x3fefbc[_0x0af8('0x28')]['userId'];var _0x1293d8=_0x3fefbc[_0x0af8('0x28')][_0x0af8('0x36')];return getAgent(_0x37e54e)['then'](function(_0x15aa0c){logger[_0x0af8('0x2d')]('entityFound:',_0x15aa0c[_0x0af8('0x18')]);emit(util['format'](_0x0af8('0x30'),_0x15aa0c['name']),'webbar:answer',{'sessionId':_0x1293d8});return _0x497695['status'](0xc8)[_0x0af8('0x32')]({'error':![],'message':'answer\x20executed!'});})[_0x0af8('0x1f')](handleError(_0x497695));};exports['hold']=function(_0x226292,_0x38515e){logger[_0x0af8('0x2d')](_0x0af8('0x3a'),_0x226292[_0x0af8('0x28')]);var _0x562f09=holdValidation['validate'](_0x226292[_0x0af8('0x28')]);if(_0x562f09[_0x0af8('0x25')]>0x0){return _0x38515e[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x562f09);}var _0x3d86e2=_0x226292[_0x0af8('0x28')][_0x0af8('0x29')];var _0x578e52=_0x226292['body'][_0x0af8('0x36')];return getAgent(_0x3d86e2)[_0x0af8('0x1b')](function(_0x394525){logger[_0x0af8('0x2d')]('entityFound:',_0x394525[_0x0af8('0x18')]);emit(util[_0x0af8('0x2f')](_0x0af8('0x30'),_0x394525[_0x0af8('0x18')]),_0x0af8('0x3b'),{'sessionId':_0x578e52});return _0x38515e[_0x0af8('0x16')](0xc8)['json']({'error':![],'message':_0x0af8('0x3c')});})['catch'](handleError(_0x38515e));};exports[_0x0af8('0x3d')]=function(_0x4a43e3,_0xeddce9){logger[_0x0af8('0x2d')](_0x0af8('0x3e'),_0x4a43e3['body']);var _0x1400eb=unholdValidation[_0x0af8('0xb')](_0x4a43e3['body']);if(_0x1400eb[_0x0af8('0x25')]>0x0){return _0xeddce9[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x1400eb);}var _0x2a3db=_0x4a43e3[_0x0af8('0x28')][_0x0af8('0x29')];var _0x26bdc7=_0x4a43e3['body'][_0x0af8('0x36')];return getAgent(_0x2a3db)[_0x0af8('0x1b')](function(_0x49bd57){logger['info'](_0x0af8('0x2e'),_0x49bd57[_0x0af8('0x18')]);emit(util['format'](_0x0af8('0x30'),_0x49bd57[_0x0af8('0x18')]),'webbar:unhold',{'sessionId':_0x26bdc7});return _0xeddce9[_0x0af8('0x16')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x0af8('0x1f')](handleError(_0xeddce9));};exports[_0x0af8('0x3f')]=function(_0x553625,_0x1cbc96){logger[_0x0af8('0x2d')]('calls\x20fired:',_0x1cbc96[_0x0af8('0x28')]);var _0x47d16c=callsValidation[_0x0af8('0xb')](_0x553625[_0x0af8('0x28')]);if(_0x47d16c['length']>0x0){return _0x1cbc96['status'](0x190)[_0x0af8('0x32')](_0x47d16c);}var _0x18da9c=_0x553625[_0x0af8('0x28')][_0x0af8('0x29')];var _0x524f79=respondWithRpcPromise(_0x0af8('0x40'));var _0x3910fb=getAgent(_0x18da9c);return Promise[_0x0af8('0x21')]([_0x524f79,_0x3910fb])['then'](function(_0x292f6c){var _0xff0eed=_0x292f6c[0x0];var _0x48879c=_0x292f6c[0x1];var _0x521e35=_[_0x0af8('0x22')](_0xff0eed[_0x0af8('0x23')],function(_0x2c2b10){return _0x2c2b10['UserId']==_0x48879c['id'];});return _0x1cbc96[_0x0af8('0x16')](0xc8)[_0x0af8('0x32')]({'count':_0x521e35[_0x0af8('0x25')],'rows':_0x521e35});})[_0x0af8('0x1f')](handleError(_0x1cbc96));};exports[_0x0af8('0x41')]=function(_0x5c3ab9,_0x143cf){logger['info'](_0x0af8('0x42'),_0x5c3ab9['body']);var _0x2d434a=conferenceValidation[_0x0af8('0xb')](_0x5c3ab9[_0x0af8('0x28')]);if(_0x2d434a[_0x0af8('0x25')]>0x0){return _0x143cf[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x2d434a);}var _0x7c1b83=_0x5c3ab9[_0x0af8('0x28')][_0x0af8('0x29')];return getAgent(_0x7c1b83)['then'](function(_0x3ff94a){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x3ff94a['name']);emit(util['format'](_0x0af8('0x30'),_0x3ff94a[_0x0af8('0x18')]),_0x0af8('0x43'));return _0x143cf[_0x0af8('0x16')](0xc8)[_0x0af8('0x32')]({'error':![],'message':_0x0af8('0x44')});})['catch'](handleError(_0x143cf));};exports[_0x0af8('0x45')]=function(_0x5b1c3a,_0x1d496d){logger[_0x0af8('0x2d')]('transfer\x20fired:',_0x5b1c3a['body']);var _0x563d0d=transferValidation[_0x0af8('0xb')](_0x5b1c3a[_0x0af8('0x28')]);if(_0x563d0d[_0x0af8('0x25')]>0x0){return _0x1d496d[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x563d0d);}var _0x2ee73e=_0x5b1c3a['body'][_0x0af8('0x29')];var _0x4ba986=_0x5b1c3a[_0x0af8('0x28')]['sessionId'];var _0x27cd1c=_0x5b1c3a[_0x0af8('0x28')]['transferNumber'];return getAgent(_0x2ee73e)[_0x0af8('0x1b')](function(_0x1b06fa){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x1b06fa[_0x0af8('0x18')]);emit(util['format'](_0x0af8('0x30'),_0x1b06fa[_0x0af8('0x18')]),_0x0af8('0x46'),{'sessionId':_0x4ba986,'transferNumber':_0x27cd1c});return _0x1d496d[_0x0af8('0x16')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x1d496d));};
\ No newline at end of file
+var _0x0ba7=['client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','error','stack','name','status','send','NotFound','request','code','message','result','findOne','agent','then','VoiceChannels','filter','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','sessionId','hangup\x20executed!','catch','answer','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','unhold','calls','calls\x20fired:','conference','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','../../mysqldb','../../config/environment','util','bluebird'];(function(_0x526294,_0x42d4f9){var _0x1e8497=function(_0x3bb0c3){while(--_0x3bb0c3){_0x526294['push'](_0x526294['shift']());}};_0x1e8497(++_0x42d4f9);}(_0x0ba7,0x16d));var _0x70ba=function(_0x57bb32,_0x7c8dfd){_0x57bb32=_0x57bb32-0x0;var _0x235e42=_0x0ba7[_0x57bb32];return _0x235e42;};'use strict';var path=require(_0x70ba('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x70ba('0x1'))['db'];var config=require(_0x70ba('0x2'));var util=require(_0x70ba('0x3'));var BPromise=require(_0x70ba('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x70ba('0x5')][_0x70ba('0x6')]({'port':0x232a});var logger=require(_0x70ba('0x7'))(_0x70ba('0x8'));var Redis=require(_0x70ba('0x9'));config[_0x70ba('0xa')]=_[_0x70ba('0xb')](config[_0x70ba('0xa')],{'host':_0x70ba('0xc'),'port':0x18eb});var io=require(_0x70ba('0xd'))(new Redis(config[_0x70ba('0xa')]));var Schema=require(_0x70ba('0xe'));var originateValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]},'callNumber':{'type':_0x70ba('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x70ba('0x11')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]},'sessionId':{'type':_0x70ba('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x70ba('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x70ba('0x11'),'required':[!![],_0x70ba('0x12')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x70ba('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]},'sessionId':{'type':_0x70ba('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]}});function emit(_0x164521,_0x18334a,_0x3e27e8){logger[_0x70ba('0x13')](_0x164521,_0x18334a,JSON[_0x70ba('0x14')](_0x3e27e8));io['to'](_0x164521)[_0x70ba('0x15')](_0x18334a,_0x3e27e8);}function handleError(_0xb6d69a){return function(_0x5ed907){console['log']('handleError:',_0x5ed907,_0x5ed907 instanceof RangeError);logger[_0x70ba('0x16')](_0x5ed907[_0x70ba('0x17')]);if(_0x5ed907 instanceof RangeError){if(_0x5ed907[_0x70ba('0x18')]){delete _0x5ed907[_0x70ba('0x18')];}_0xb6d69a[_0x70ba('0x19')](0x194)[_0x70ba('0x1a')](_0x5ed907);}else{if(_0x5ed907[_0x70ba('0x18')]){delete _0x5ed907[_0x70ba('0x18')];}_0xb6d69a[_0x70ba('0x19')](0x1f4)[_0x70ba('0x1a')](_0x5ed907);}};}function checkError(){return function(_0x26c039){if(!_0x26c039){throw new RangeError(_0x70ba('0x1b'));}return _0x26c039;};}function respondWithRpcPromise(_0x2a1328,_0x4570b0){return new BPromise(function(_0x273ce4,_0x5ebe9d){var _0x3b31ef=amiClient;return _0x3b31ef[_0x70ba('0x1c')](_0x2a1328,_0x4570b0)['then'](function(_0x123b0c){if(_0x123b0c['error']){if(_0x123b0c['error'][_0x70ba('0x1d')]===0x1f4){return _0x5ebe9d(_0x123b0c['error'][_0x70ba('0x1e')]);}return _0x273ce4(_0x123b0c[_0x70ba('0x16')]['message']);}else{_0x273ce4(_0x123b0c[_0x70ba('0x1f')]);}})['catch'](function(_0x5ad828){_0x5ebe9d(_0x5ad828);});});}function getAgent(_0x39482c){return db['User'][_0x70ba('0x20')]({'where':{'id':_0x39482c,'role':_0x70ba('0x21')}})[_0x70ba('0x22')](checkError());}function getAgentCheckSession(_0x33e218,_0x2c6d18){return new BPromise(function(_0x265423,_0x5a8558){var _0x2d840e=respondWithRpcPromise(_0x70ba('0x23'));var _0x797467=getAgent(_0x33e218);Promise['all']([_0x2d840e,_0x797467])[_0x70ba('0x22')](function(_0x51b5cb){var _0x5955dc=_0x51b5cb[0x0];var _0x505f98=_0x51b5cb[0x1];var _0x77e564=_[_0x70ba('0x24')](_0x5955dc['rows'],function(_0x51b3e3){return _0x51b3e3[_0x70ba('0x25')]==_0x505f98['id']&&_0x51b3e3['sessionId']==_0x2c6d18;});if(_0x77e564[_0x70ba('0x26')]==0x1){_0x265423(_0x505f98);}else{_0x5a8558(new RangeError(_0x70ba('0x27')+_0x2c6d18+_0x70ba('0x28')));}});});}exports[_0x70ba('0x29')]=function(_0x1db0c4,_0x269943){logger[_0x70ba('0x13')](_0x70ba('0x2a'),_0x1db0c4[_0x70ba('0x2b')]);var _0x6055d3=originateValidation[_0x70ba('0xe')](_0x1db0c4['body']);if(_0x6055d3['length']>0x0){return _0x269943[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x6055d3);}var _0x943e49=_0x1db0c4['body']['userId'];var _0x507f00=_0x1db0c4[_0x70ba('0x2b')][_0x70ba('0x2d')];var _0x2200d3=_0x1db0c4['body'][_0x70ba('0x2e')];var _0x5bc56f=_0x1db0c4['body'][_0x70ba('0x2f')];return getAgent(_0x943e49)['then'](function(_0x15774e){logger[_0x70ba('0x13')]('entityFound:',_0x15774e[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x15774e['name']),_0x70ba('0x32'),{'callNumber':_0x507f00,'callerId':_0x2200d3,'callbackUrl':_0x5bc56f});return _0x269943[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':_0x70ba('0x33')});})['catch'](handleError(_0x269943));};exports[_0x70ba('0x34')]=function(_0x569ae3,_0x17707a){logger[_0x70ba('0x13')](_0x70ba('0x35'),_0x569ae3[_0x70ba('0x2b')]);var _0x16ce39=hangupValidation[_0x70ba('0xe')](_0x569ae3[_0x70ba('0x2b')]);if(_0x16ce39['length']>0x0){return _0x17707a[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x16ce39);}var _0x31e713=_0x569ae3[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x473489=_0x569ae3['body'][_0x70ba('0x37')];return getAgent(_0x31e713)[_0x70ba('0x22')](function(_0x1861ed){logger['info']('entityFound:',_0x1861ed['name']);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x1861ed[_0x70ba('0x18')]),'webbar:hangup',{'sessionId':_0x473489});return _0x17707a[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':_0x70ba('0x38')});})[_0x70ba('0x39')](handleError(_0x17707a));};exports[_0x70ba('0x3a')]=function(_0x54e732,_0x5ee74c){logger[_0x70ba('0x13')](_0x70ba('0x3b'),_0x54e732[_0x70ba('0x2b')]);var _0x5a1edb=answerValidation['validate'](_0x54e732[_0x70ba('0x2b')]);if(_0x5a1edb['length']>0x0){return _0x5ee74c[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x5a1edb);}var _0x705ca4=_0x54e732[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x51f4df=_0x54e732[_0x70ba('0x2b')][_0x70ba('0x37')];return getAgent(_0x705ca4)[_0x70ba('0x22')](function(_0x3dc2f7){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x3dc2f7[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x3dc2f7[_0x70ba('0x18')]),_0x70ba('0x3d'),{'sessionId':_0x51f4df});return _0x5ee74c[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':_0x70ba('0x3e')});})[_0x70ba('0x39')](handleError(_0x5ee74c));};exports['hold']=function(_0xd7638f,_0x3121f6){logger['info'](_0x70ba('0x3f'),_0xd7638f[_0x70ba('0x2b')]);var _0x3de825=holdValidation[_0x70ba('0xe')](_0xd7638f[_0x70ba('0x2b')]);if(_0x3de825[_0x70ba('0x26')]>0x0){return _0x3121f6[_0x70ba('0x19')](0x190)['json'](_0x3de825);}var _0x2e2613=_0xd7638f[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x3d1f89=_0xd7638f[_0x70ba('0x2b')][_0x70ba('0x37')];return getAgent(_0x2e2613)[_0x70ba('0x22')](function(_0x400c37){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x400c37[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x400c37[_0x70ba('0x18')]),_0x70ba('0x40'),{'sessionId':_0x3d1f89});return _0x3121f6[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':'hold\x20executed!'});})[_0x70ba('0x39')](handleError(_0x3121f6));};exports[_0x70ba('0x41')]=function(_0x2dc3c5,_0x19c99c){logger['info']('unhold\x20fired:',_0x2dc3c5['body']);var _0x471d19=unholdValidation[_0x70ba('0xe')](_0x2dc3c5['body']);if(_0x471d19['length']>0x0){return _0x19c99c[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x471d19);}var _0x3e3779=_0x2dc3c5[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x4e2397=_0x2dc3c5[_0x70ba('0x2b')]['sessionId'];return getAgent(_0x3e3779)['then'](function(_0x361699){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x361699[_0x70ba('0x18')]);emit(util['format'](_0x70ba('0x31'),_0x361699[_0x70ba('0x18')]),'webbar:unhold',{'sessionId':_0x4e2397});return _0x19c99c['status'](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x70ba('0x39')](handleError(_0x19c99c));};exports[_0x70ba('0x42')]=function(_0x1cb9c7,_0x4cc5b1){logger[_0x70ba('0x13')](_0x70ba('0x43'),_0x4cc5b1[_0x70ba('0x2b')]);var _0x5214eb=callsValidation[_0x70ba('0xe')](_0x1cb9c7[_0x70ba('0x2b')]);if(_0x5214eb['length']>0x0){return _0x4cc5b1['status'](0x190)[_0x70ba('0x2c')](_0x5214eb);}var _0x15b3ab=_0x1cb9c7[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x10e824=respondWithRpcPromise(_0x70ba('0x23'));var _0x44cb31=getAgent(_0x15b3ab);return Promise['all']([_0x10e824,_0x44cb31])[_0x70ba('0x22')](function(_0x27d101){var _0x4de412=_0x27d101[0x0];var _0x508da6=_0x27d101[0x1];var _0x137b7d=_[_0x70ba('0x24')](_0x4de412['rows'],function(_0x4ea26b){return _0x4ea26b[_0x70ba('0x25')]==_0x508da6['id'];});return _0x4cc5b1['status'](0xc8)['json']({'count':_0x137b7d[_0x70ba('0x26')],'rows':_0x137b7d});})[_0x70ba('0x39')](handleError(_0x4cc5b1));};exports[_0x70ba('0x44')]=function(_0xb03649,_0x10bb90){logger[_0x70ba('0x13')](_0x70ba('0x45'),_0xb03649['body']);var _0x46a8a6=conferenceValidation[_0x70ba('0xe')](_0xb03649[_0x70ba('0x2b')]);if(_0x46a8a6[_0x70ba('0x26')]>0x0){return _0x10bb90[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x46a8a6);}var _0x5d58a1=_0xb03649[_0x70ba('0x2b')]['userId'];return getAgent(_0x5d58a1)[_0x70ba('0x22')](function(_0x4b385b){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x4b385b[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x4b385b[_0x70ba('0x18')]),'webbar:conference');return _0x10bb90[_0x70ba('0x19')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0x70ba('0x39')](handleError(_0x10bb90));};exports[_0x70ba('0x46')]=function(_0x5b1824,_0x208333){logger['info'](_0x70ba('0x47'),_0x5b1824[_0x70ba('0x2b')]);var _0x378893=transferValidation['validate'](_0x5b1824[_0x70ba('0x2b')]);if(_0x378893['length']>0x0){return _0x208333[_0x70ba('0x19')](0x190)['json'](_0x378893);}var _0x2ee3d0=_0x5b1824[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x4ebc09=_0x5b1824['body'][_0x70ba('0x37')];var _0x530324=_0x5b1824[_0x70ba('0x2b')][_0x70ba('0x48')];return getAgent(_0x2ee3d0)[_0x70ba('0x22')](function(_0x32a246){logger['info'](_0x70ba('0x3c'),_0x32a246[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x32a246[_0x70ba('0x18')]),_0x70ba('0x49'),{'sessionId':_0x4ebc09,'transferNumber':_0x530324});return _0x208333[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0x70ba('0x39')](handleError(_0x208333));};
\ No newline at end of file
index 71fc05d..5be038f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33af=['getAnswers','/:id/users','/:id/applications','post','create','addDisposition','addAgents','addApplications','/:id/notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions'];(function(_0x5a8407,_0x4e3846){var _0x118d6f=function(_0x1b7802){while(--_0x1b7802){_0x5a8407['push'](_0x5a8407['shift']());}};_0x118d6f(++_0x4e3846);}(_0x33af,0xec));var _0xf33a=function(_0x50408f,_0x92ffac){_0x50408f=_0x50408f-0x0;var _0xb02957=_0x33af[_0x50408f];return _0xb02957;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0x8')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xf')]);router['get']('/:id/canned_answers',auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router[_0xf33a('0x8')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller['getAgents']);router[_0xf33a('0x8')](_0xf33a('0x12'),auth['isAuthenticated'](),controller['getApplications']);router[_0xf33a('0x13')]('/',auth[_0xf33a('0xb')](),controller[_0xf33a('0x14')]);router[_0xf33a('0x13')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x15')]);router[_0xf33a('0x13')]('/:id/canned_answers',auth[_0xf33a('0xb')](),controller['addAnswer']);router[_0xf33a('0x13')](_0xf33a('0x11'),auth['isAuthenticated'](),controller[_0xf33a('0x16')]);router[_0xf33a('0x13')]('/:id/applications',auth[_0xf33a('0xb')](),controller[_0xf33a('0x17')]);router[_0xf33a('0x13')](_0xf33a('0x18'),controller['notify']);router[_0xf33a('0x13')](_0xf33a('0x19'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1a')]);router[_0xf33a('0x1b')](_0xf33a('0x1c'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1d')]);router[_0xf33a('0x1e')](_0xf33a('0x1c'),auth['isAuthenticated'](),controller[_0xf33a('0x1f')]);router[_0xf33a('0x1e')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x20')]);router['delete'](_0xf33a('0x21'),auth['isAuthenticated'](),controller[_0xf33a('0x22')]);router[_0xf33a('0x1e')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x23')]);module['exports']=router;
\ No newline at end of file
+var _0xda2d=['/:id','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','util','path','connect-timeout','express','Router','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','delete'];(function(_0x44c918,_0x5954db){var _0x282e00=function(_0xdcc29c){while(--_0xdcc29c){_0x44c918['push'](_0x44c918['shift']());}};_0x282e00(++_0x5954db);}(_0xda2d,0x102));var _0xdda2=function(_0x55dc3f,_0x216e92){_0x55dc3f=_0x55dc3f-0x0;var _0x4a1fc1=_0xda2d[_0x55dc3f];return _0x4a1fc1;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdda2('0x7')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x13')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x14')]);router['post'](_0xdda2('0xd'),auth['isAuthenticated'](),controller[_0xdda2('0x15')]);router[_0xdda2('0x13')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x16')]);router['post']('/:id/users',auth[_0xdda2('0x8')](),controller['addAgents']);router[_0xdda2('0x13')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x17')]);router[_0xdda2('0x13')](_0xdda2('0x18'),controller[_0xdda2('0x19')]);router[_0xdda2('0x13')](_0xdda2('0x1a'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1b')]);router[_0xdda2('0x1c')]('/:id',auth[_0xdda2('0x8')](),controller['update']);router[_0xdda2('0x1d')](_0xdda2('0x1e'),auth[_0xdda2('0x8')](),controller['destroy']);router[_0xdda2('0x1d')]('/:id/dispositions',auth[_0xdda2('0x8')](),controller[_0xdda2('0x1f')]);router['delete'](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x20')]);router[_0xdda2('0x1d')](_0xdda2('0x21'),auth['isAuthenticated'](),controller[_0xdda2('0x22')]);module[_0xdda2('0x23')]=router;
\ No newline at end of file
index ebfbc8c..85757a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x562b=['generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','randomstring','exports','STRING','name'];(function(_0x5d23be,_0x3b4f3c){var _0x4d60a9=function(_0x57dce7){while(--_0x57dce7){_0x5d23be['push'](_0x5d23be['shift']());}};_0x4d60a9(++_0x3b4f3c);}(_0x562b,0x74));var _0xb562=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x562b[_0x4ae625];return _0x31accf;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xb562('0x0'));module[_0xb562('0x1')]={'name':{'type':Sequelize[_0xb562('0x2')],'unique':_0xb562('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xb562('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xb562('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xb562('0x2')],'defaultValue':function(){return rs[_0xb562('0x4')]();}},'phone':{'type':Sequelize[_0xb562('0x2')]},'type':{'type':Sequelize[_0xb562('0x5')](_0xb562('0x6'))},'accountSid':{'type':Sequelize[_0xb562('0x2')]},'authToken':{'type':Sequelize[_0xb562('0x2')]},'notificationTemplate':{'type':Sequelize[_0xb562('0x7')],'defaultValue':function(){return _0xb562('0x8');}},'notificationSound':{'type':Sequelize[_0xb562('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb562('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb562('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb562('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb562('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb562('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb562('0xa')],'comment':_0xb562('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xb562('0x9')],'defaultValue':![],'comment':_0xb562('0xc'),'set':function(_0x5e18ad){if(!_0x5e18ad){this[_0xb562('0xd')](_0xb562('0xe'),null);}this[_0xb562('0xd')]('mandatoryDisposition',_0x5e18ad);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5680=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','TEXT','BOOLEAN','INTEGER'];(function(_0x19877a,_0x532b12){var _0x40fc68=function(_0xcd4dc2){while(--_0xcd4dc2){_0x19877a['push'](_0x19877a['shift']());}};_0x40fc68(++_0x532b12);}(_0x5680,0x1d2));var _0x0568=function(_0x316589,_0x57e1ec){_0x316589=_0x316589-0x0;var _0x28c79c=_0x5680[_0x316589];return _0x28c79c;};'use strict';var Sequelize=require(_0x0568('0x0'));var rs=require(_0x0568('0x1'));module[_0x0568('0x2')]={'name':{'type':Sequelize[_0x0568('0x3')],'unique':_0x0568('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x0568('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x0568('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x0568('0x3')],'defaultValue':function(){return rs[_0x0568('0x5')]();}},'phone':{'type':Sequelize[_0x0568('0x3')]},'type':{'type':Sequelize[_0x0568('0x6')]('twilio')},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x0568('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0568('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x0568('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0568('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0568('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0568('0x9')],'comment':_0x0568('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x0568('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1a0055){if(!_0x1a0055){this['setDataValue'](_0x0568('0xb'),null);}this[_0x0568('0xc')](_0x0568('0xd'),_0x1a0055);}},'description':{'type':Sequelize[_0x0568('0x3')]}};
\ No newline at end of file
index 46150cc..72ab561 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x481f=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','get','destroy','stack','name','send','index','Pause','fieldName','key','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','options','WhatsappAccount','includeAll','include','findAll','show','params','mandatoryDispositionPause','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','WhatsappAccountId','Disposition','findOne','rawAttributes','hasOwnProperty','filter','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','addAgents','ids','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','WhatsappApplication','findAndCountAll','priority','getApplications','notify','Applications','account','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','Body','messageId','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','DESC','list','Contacts','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','WhatsappMessage','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','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>','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0xb5caa9,_0x56cab2){var _0x580ecf=function(_0x5c5654){while(--_0x5c5654){_0xb5caa9['push'](_0xb5caa9['shift']());}};_0x580ecf(++_0x56cab2);}(_0x481f,0x177));var _0xf481=function(_0x34e8f5,_0x889315){_0x34e8f5=_0x34e8f5-0x0;var _0x9d2ac0=_0x481f[_0x34e8f5];return _0x9d2ac0;};'use strict';var emlformat=require(_0xf481('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf481('0x1'));var jsonpatch=require(_0xf481('0x2'));var rp=require(_0xf481('0x3'));var moment=require(_0xf481('0x4'));var BPromise=require(_0xf481('0x5'));var Mustache=require('mustache');var util=require(_0xf481('0x6'));var path=require(_0xf481('0x7'));var sox=require('sox');var csv=require(_0xf481('0x8'));var ejs=require(_0xf481('0x9'));var fs=require('fs');var fs_extra=require(_0xf481('0xa'));var _=require(_0xf481('0xb'));var squel=require(_0xf481('0xc'));var crypto=require(_0xf481('0xd'));var jsforce=require(_0xf481('0xe'));var deskjs=require(_0xf481('0xf'));var toCsv=require(_0xf481('0x8'));var querystring=require('querystring');var Papa=require(_0xf481('0x10'));var Redis=require(_0xf481('0x11'));var authService=require(_0xf481('0x12'));var qs=require(_0xf481('0x13'));var as=require(_0xf481('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf481('0x15'))(_0xf481('0x16'));var utils=require(_0xf481('0x17'));var config=require(_0xf481('0x18'));var licenseUtil=require(_0xf481('0x19'));var db=require(_0xf481('0x1a'))['db'];config[_0xf481('0x1b')]=_[_0xf481('0x1c')](config['redis'],{'host':_0xf481('0x1d'),'port':0x18eb});var socket=require(_0xf481('0x1e'))(new Redis(config[_0xf481('0x1b')]));require(_0xf481('0x1f'))[_0xf481('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf481('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3b639a,_0x30f44e,_0x203f82,_0x109c92){return new BPromise(function(_0x20dcba,_0x3c6afe){var _0x55f8b5=_0x109c92||client;return _0x55f8b5[_0xf481('0x22')](_0x3b639a,_0x203f82)[_0xf481('0x23')](function(_0x304adc){logger['info'](_0xf481('0x24'),_0x30f44e,_0xf481('0x25'));logger['debug'](_0xf481('0x26'),_0x30f44e,_0xf481('0x25'),JSON[_0xf481('0x27')](_0x304adc));if(_0x304adc[_0xf481('0x28')]){if(_0x304adc[_0xf481('0x28')]['code']===0x1f4){logger[_0xf481('0x28')](_0xf481('0x24'),_0x30f44e,_0x304adc[_0xf481('0x28')][_0xf481('0x29')]);return _0x3c6afe(_0x304adc['error'][_0xf481('0x29')]);}logger[_0xf481('0x28')](_0xf481('0x24'),_0x30f44e,_0x304adc[_0xf481('0x28')][_0xf481('0x29')]);return _0x20dcba(_0x304adc[_0xf481('0x28')]['message']);}else{logger[_0xf481('0x2a')](_0xf481('0x24'),_0x30f44e,_0xf481('0x25'));_0x20dcba(_0x304adc[_0xf481('0x2b')][_0xf481('0x29')]);}})[_0xf481('0x2c')](function(_0x4242f1){logger[_0xf481('0x28')](_0xf481('0x24'),_0x30f44e,_0x4242f1);_0x3c6afe(_0x4242f1);});});}function respondWithStatusCode(_0x5b2b87,_0x183249){_0x183249=_0x183249||0xcc;return function(_0x2d1edc){if(_0x2d1edc){return _0x5b2b87[_0xf481('0x2d')](_0x183249);}return _0x5b2b87[_0xf481('0x2e')](_0x183249)[_0xf481('0x2f')]();};}function respondWithResult(_0x310eca,_0xa8241a){_0xa8241a=_0xa8241a||0xc8;return function(_0x3462a0){if(_0x3462a0){return _0x310eca[_0xf481('0x2e')](_0xa8241a)[_0xf481('0x30')](_0x3462a0);}};}function respondWithFilteredResult(_0x104bfd,_0x449e7d){return function(_0x38ef11){if(_0x38ef11){var _0x5d2433=typeof _0x449e7d[_0xf481('0x31')]===_0xf481('0x32')&&typeof _0x449e7d[_0xf481('0x33')]==='undefined';var _0x3f2f70=_0x38ef11['count'];var _0x55af68=_0x5d2433?0x0:_0x449e7d[_0xf481('0x31')];var _0x240f76=_0x5d2433?_0x38ef11[_0xf481('0x34')]:_0x449e7d[_0xf481('0x31')]+_0x449e7d[_0xf481('0x33')];var _0xfa22f3;if(_0x240f76>=_0x3f2f70){_0x240f76=_0x3f2f70;_0xfa22f3=0xc8;}else{_0xfa22f3=0xce;}_0x104bfd[_0xf481('0x2e')](_0xfa22f3);return _0x104bfd[_0xf481('0x35')](_0xf481('0x36'),_0x55af68+'-'+_0x240f76+'/'+_0x3f2f70)[_0xf481('0x30')](_0x38ef11);}return null;};}function patchUpdates(_0x125765){return function(_0x3ac447){try{jsonpatch['apply'](_0x3ac447,_0x125765,!![]);}catch(_0x31e0dc){return BPromise['reject'](_0x31e0dc);}return _0x3ac447[_0xf481('0x37')]();};}function saveUpdates(_0x3dfe12,_0x2f5863){return function(_0x32287a){if(_0x32287a){return _0x32287a['update'](_0x3dfe12)[_0xf481('0x23')](function(_0x5d4f0b){return _0x5d4f0b;});}return null;};}function removeEntity(_0xf24487,_0x574a29){return function(_0x44b542){if(_0x44b542){return _0x44b542['destroy']()[_0xf481('0x23')](function(){var _0x36da60=_0x44b542[_0xf481('0x38')]({'plain':!![]});var _0x2e5981='WhatsappAccounts';return db['UserProfileResource'][_0xf481('0x39')]({'where':{'type':_0x2e5981,'resourceId':_0x36da60['id']}})[_0xf481('0x23')](function(){return _0x44b542;});})[_0xf481('0x23')](function(){_0xf24487['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36b161,_0x1e26e2){return function(_0x2349f7){if(!_0x2349f7){_0x36b161[_0xf481('0x2d')](0x194);}return _0x2349f7;};}function handleError(_0x3a376f,_0xa3c559){_0xa3c559=_0xa3c559||0x1f4;return function(_0x5a98d4){logger[_0xf481('0x28')](_0x5a98d4[_0xf481('0x3a')]);if(_0x5a98d4['name']){delete _0x5a98d4[_0xf481('0x3b')];}_0x3a376f[_0xf481('0x2e')](_0xa3c559)[_0xf481('0x3c')](_0x5a98d4);};}exports[_0xf481('0x3d')]=function(_0x1c53cc,_0x2d1308){var _0x1e641f={'include':[{'model':db[_0xf481('0x3e')],'as':'mandatoryDispositionPause'}]},_0x8eb28f={},_0x341639={'count':0x0,'rows':[]};var _0x4180fc=_['map'](db['WhatsappAccount']['rawAttributes'],function(_0xbca960){return{'name':_0xbca960[_0xf481('0x3f')],'type':_0xbca960['type'][_0xf481('0x40')]};});_0x8eb28f['model']=_['map'](_0x4180fc,'name');_0x8eb28f['query']=_[_0xf481('0x41')](_0x1c53cc[_0xf481('0x42')]);_0x8eb28f[_0xf481('0x43')]=_[_0xf481('0x44')](_0x8eb28f[_0xf481('0x45')],_0x8eb28f[_0xf481('0x42')]);_0x1e641f[_0xf481('0x46')]=_['intersection'](_0x8eb28f['model'],qs[_0xf481('0x47')](_0x1c53cc[_0xf481('0x42')][_0xf481('0x47')]));_0x1e641f[_0xf481('0x46')]=_0x1e641f[_0xf481('0x46')]['length']?_0x1e641f[_0xf481('0x46')]:_0x8eb28f[_0xf481('0x45')];if(!_0x1c53cc[_0xf481('0x42')]['hasOwnProperty'](_0xf481('0x48'))){_0x1e641f[_0xf481('0x33')]=qs[_0xf481('0x33')](_0x1c53cc['query'][_0xf481('0x33')]);_0x1e641f['offset']=qs[_0xf481('0x31')](_0x1c53cc['query'][_0xf481('0x31')]);}_0x1e641f[_0xf481('0x49')]=qs['sort'](_0x1c53cc[_0xf481('0x42')][_0xf481('0x4a')]);_0x1e641f[_0xf481('0x4b')]=qs[_0xf481('0x43')](_[_0xf481('0x4c')](_0x1c53cc['query'],_0x8eb28f['filters']),_0x4180fc);if(_0x1c53cc['query']['filter']){_0x1e641f[_0xf481('0x4b')]=_[_0xf481('0x4d')](_0x1e641f['where'],{'$or':_[_0xf481('0x4e')](_0x4180fc,function(_0x8ad104){if(_0x8ad104[_0xf481('0x4f')]!==_0xf481('0x50')){var _0x358b93={};_0x358b93[_0x8ad104[_0xf481('0x3b')]]={'$like':'%'+_0x1c53cc[_0xf481('0x42')]['filter']+'%'};return _0x358b93;}})});}_0x1e641f=_[_0xf481('0x4d')]({},_0x1e641f,_0x1c53cc[_0xf481('0x51')]);var _0x49a8a3={'where':_0x1e641f[_0xf481('0x4b')]};return db[_0xf481('0x52')][_0xf481('0x34')](_0x49a8a3)[_0xf481('0x23')](function(_0x3756f6){_0x341639[_0xf481('0x34')]=_0x3756f6;if(_0x1c53cc[_0xf481('0x42')][_0xf481('0x53')]){_0x1e641f[_0xf481('0x54')]=[{'all':!![]}];}return db[_0xf481('0x52')][_0xf481('0x55')](_0x1e641f);})['then'](function(_0x383e2d){_0x341639['rows']=_0x383e2d;return _0x341639;})[_0xf481('0x23')](respondWithFilteredResult(_0x2d1308,_0x1e641f))[_0xf481('0x2c')](handleError(_0x2d1308,null));};exports[_0xf481('0x56')]=function(_0x35aa8c,_0x439fbd){var _0x3b5817={'raw':![],'where':{'id':_0x35aa8c[_0xf481('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xf481('0x58')}]},_0x222262={};_0x222262[_0xf481('0x45')]=_['keys'](db[_0xf481('0x52')]['rawAttributes']);_0x222262[_0xf481('0x42')]=_[_0xf481('0x41')](_0x35aa8c[_0xf481('0x42')]);_0x222262['filters']=_[_0xf481('0x44')](_0x222262['model'],_0x222262[_0xf481('0x42')]);_0x3b5817['attributes']=_[_0xf481('0x44')](_0x222262[_0xf481('0x45')],qs['fields'](_0x35aa8c['query'][_0xf481('0x47')]));_0x3b5817[_0xf481('0x46')]=_0x3b5817[_0xf481('0x46')][_0xf481('0x59')]?_0x3b5817['attributes']:_0x222262[_0xf481('0x45')];if(_0x35aa8c[_0xf481('0x42')][_0xf481('0x53')]){_0x3b5817[_0xf481('0x54')]=[{'all':!![]}];}_0x3b5817=_[_0xf481('0x4d')]({},_0x3b5817,_0x35aa8c[_0xf481('0x51')]);return db[_0xf481('0x52')][_0xf481('0x5a')](_0x3b5817)[_0xf481('0x23')](handleEntityNotFound(_0x439fbd,null))[_0xf481('0x23')](respondWithResult(_0x439fbd,null))[_0xf481('0x2c')](handleError(_0x439fbd,null));};exports[_0xf481('0x5b')]=function(_0x4c77fe,_0x37f9dd){return db[_0xf481('0x52')]['create'](_0x4c77fe[_0xf481('0x5c')],{})['then'](function(_0x4d4462){var _0x2ad7e9=_0x4c77fe[_0xf481('0x5d')]['get']({'plain':!![]});if(!_0x2ad7e9)throw new Error(_0xf481('0x5e'));if(_0x2ad7e9[_0xf481('0x5f')]===_0xf481('0x5d')){var _0x4a62d1=_0x4d4462[_0xf481('0x38')]({'plain':!![]});var _0x27ffe7=_0xf481('0x60');return db[_0xf481('0x61')][_0xf481('0x5a')]({'where':{'name':_0x27ffe7,'userProfileId':_0x2ad7e9[_0xf481('0x62')]},'raw':!![]})[_0xf481('0x23')](function(_0x4e5293){if(_0x4e5293&&_0x4e5293[_0xf481('0x63')]===0x0){return db[_0xf481('0x64')][_0xf481('0x5b')]({'name':_0x4a62d1['name'],'resourceId':_0x4a62d1['id'],'type':_0x4e5293[_0xf481('0x3b')],'sectionId':_0x4e5293['id']},{})[_0xf481('0x23')](function(){return _0x4d4462;});}else{return _0x4d4462;}})[_0xf481('0x2c')](function(_0x89f1a6){logger['error'](_0xf481('0x65'),_0x89f1a6);throw _0x89f1a6;});}return _0x4d4462;})[_0xf481('0x23')](respondWithResult(_0x37f9dd,0xc9))['catch'](handleError(_0x37f9dd,null));};exports[_0xf481('0x66')]=function(_0x2573c4,_0x229817){if(_0x2573c4[_0xf481('0x5c')]['id']){delete _0x2573c4[_0xf481('0x5c')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x2573c4[_0xf481('0x57')]['id']},'include':[{'model':db[_0xf481('0x3e')],'as':'mandatoryDispositionPause'}]})[_0xf481('0x23')](handleEntityNotFound(_0x229817,null))[_0xf481('0x23')](saveUpdates(_0x2573c4[_0xf481('0x5c')],null))[_0xf481('0x23')](respondWithResult(_0x229817,null))['catch'](handleError(_0x229817,null));};exports['destroy']=function(_0x21416f,_0x33cb9e){return db[_0xf481('0x52')]['find']({'where':{'id':_0x21416f[_0xf481('0x57')]['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x33cb9e,null))['then'](removeEntity(_0x33cb9e,null))[_0xf481('0x2c')](handleError(_0x33cb9e,null));};exports[_0xf481('0x67')]=function(_0x35dd79,_0x12b02f){return db[_0xf481('0x52')][_0xf481('0x67')]()[_0xf481('0x23')](respondWithResult(_0x12b02f,null))[_0xf481('0x2c')](handleError(_0x12b02f,null));};exports[_0xf481('0x68')]=function(_0x18b595,_0x43f749,_0x5daa3c){if(_0x18b595['body']['id']){delete _0x18b595[_0xf481('0x5c')]['id'];}return db[_0xf481('0x52')][_0xf481('0x5a')]({'where':{'id':_0x18b595[_0xf481('0x57')]['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x43f749,null))[_0xf481('0x23')](function(_0x432de1){if(_0x432de1){_0x18b595['body'][_0xf481('0x69')]=_0x432de1['id'];return db[_0xf481('0x6a')][_0xf481('0x5b')](_0x18b595[_0xf481('0x5c')]);}})['then'](respondWithResult(_0x43f749,null))[_0xf481('0x2c')](handleError(_0x43f749,null));};exports['getDispositions']=function(_0x227b37,_0x5ac0bc,_0x33a2bf){var _0x4f79d3={'raw':![],'where':{}};var _0x165c71={};var _0x499650={'count':0x0,'rows':[]};return db[_0xf481('0x52')][_0xf481('0x6b')]({'where':{'id':_0x227b37[_0xf481('0x57')]['id']}})['then'](handleEntityNotFound(_0x5ac0bc,null))['then'](function(_0x4a21d8){if(_0x4a21d8){_0x165c71[_0xf481('0x45')]=_[_0xf481('0x41')](db['Disposition'][_0xf481('0x6c')]);_0x165c71['query']=_['keys'](_0x227b37[_0xf481('0x42')]);_0x165c71[_0xf481('0x43')]=_[_0xf481('0x44')](_0x165c71[_0xf481('0x45')],_0x165c71['query']);_0x4f79d3['attributes']=_['intersection'](_0x165c71['model'],qs['fields'](_0x227b37['query'][_0xf481('0x47')]));_0x4f79d3[_0xf481('0x46')]=_0x4f79d3[_0xf481('0x46')]['length']?_0x4f79d3[_0xf481('0x46')]:_0x165c71[_0xf481('0x45')];if(!_0x227b37[_0xf481('0x42')][_0xf481('0x6d')](_0xf481('0x48'))){_0x4f79d3[_0xf481('0x33')]=qs[_0xf481('0x33')](_0x227b37[_0xf481('0x42')]['limit']);_0x4f79d3[_0xf481('0x31')]=qs[_0xf481('0x31')](_0x227b37['query'][_0xf481('0x31')]);}_0x4f79d3[_0xf481('0x49')]=qs[_0xf481('0x4a')](_0x227b37['query'][_0xf481('0x4a')]);_0x4f79d3['where']=qs[_0xf481('0x43')](_[_0xf481('0x4c')](_0x227b37[_0xf481('0x42')],_0x165c71[_0xf481('0x43')]));_0x4f79d3[_0xf481('0x4b')][_0xf481('0x69')]=_0x4a21d8['id'];if(_0x227b37[_0xf481('0x42')]['filter']){_0x4f79d3[_0xf481('0x4b')]=_[_0xf481('0x4d')](_0x4f79d3['where'],{'$or':_[_0xf481('0x4e')](_0x4f79d3['attributes'],function(_0x49d9f2){var _0x39ecd9={};_0x39ecd9[_0x49d9f2]={'$like':'%'+_0x227b37[_0xf481('0x42')][_0xf481('0x6e')]+'%'};return _0x39ecd9;})});}_0x4f79d3=_[_0xf481('0x4d')]({},_0x4f79d3,_0x227b37['options']);return db[_0xf481('0x6a')][_0xf481('0x34')]({'where':_0x4f79d3[_0xf481('0x4b')]})[_0xf481('0x23')](function(_0x47be8b){_0x499650[_0xf481('0x34')]=_0x47be8b;if(_0x227b37[_0xf481('0x42')][_0xf481('0x53')]){_0x4f79d3[_0xf481('0x54')]=[{'all':!![]}];}return db[_0xf481('0x6a')][_0xf481('0x55')](_0x4f79d3);})[_0xf481('0x23')](function(_0x426a63){_0x499650[_0xf481('0x6f')]=_0x426a63;return _0x499650;});}})[_0xf481('0x23')](respondWithFilteredResult(_0x5ac0bc,_0x4f79d3))[_0xf481('0x2c')](handleError(_0x5ac0bc,null));};exports[_0xf481('0x70')]=function(_0x8474d,_0x205677,_0x2d3626){return db['WhatsappAccount'][_0xf481('0x5a')]({'where':{'id':_0x8474d[_0xf481('0x57')]['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x205677,null))[_0xf481('0x23')](function(_0x5995f0){if(_0x5995f0){return _0x5995f0[_0xf481('0x70')](_0x8474d[_0xf481('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x205677,null))[_0xf481('0x2c')](handleError(_0x205677,null));};exports[_0xf481('0x71')]=function(_0x28ac38,_0x45be0f,_0x534b06){if(_0x28ac38['body']['id']){delete _0x28ac38[_0xf481('0x5c')]['id'];}return db['WhatsappAccount'][_0xf481('0x5a')]({'where':{'id':_0x28ac38[_0xf481('0x57')]['id']}})['then'](handleEntityNotFound(_0x45be0f,null))[_0xf481('0x23')](function(_0x3a7d59){if(_0x3a7d59){_0x28ac38['body']['WhatsappAccountId']=_0x3a7d59['id'];return db[_0xf481('0x72')][_0xf481('0x5b')](_0x28ac38[_0xf481('0x5c')]);}})[_0xf481('0x23')](respondWithResult(_0x45be0f,null))[_0xf481('0x2c')](handleError(_0x45be0f,null));};exports[_0xf481('0x73')]=function(_0x474366,_0x34b0a9,_0x858d6d){var _0x517ca6={'raw':![],'where':{}};var _0x42b117={};var _0x23d737={'count':0x0,'rows':[]};return db[_0xf481('0x52')][_0xf481('0x6b')]({'where':{'id':_0x474366[_0xf481('0x57')]['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x34b0a9,null))[_0xf481('0x23')](function(_0x2d9d7d){if(_0x2d9d7d){_0x42b117[_0xf481('0x45')]=_[_0xf481('0x41')](db[_0xf481('0x72')][_0xf481('0x6c')]);_0x42b117[_0xf481('0x42')]=_[_0xf481('0x41')](_0x474366[_0xf481('0x42')]);_0x42b117['filters']=_[_0xf481('0x44')](_0x42b117[_0xf481('0x45')],_0x42b117[_0xf481('0x42')]);_0x517ca6[_0xf481('0x46')]=_['intersection'](_0x42b117[_0xf481('0x45')],qs[_0xf481('0x47')](_0x474366[_0xf481('0x42')][_0xf481('0x47')]));_0x517ca6['attributes']=_0x517ca6[_0xf481('0x46')][_0xf481('0x59')]?_0x517ca6['attributes']:_0x42b117[_0xf481('0x45')];if(!_0x474366['query'][_0xf481('0x6d')](_0xf481('0x48'))){_0x517ca6['limit']=qs[_0xf481('0x33')](_0x474366[_0xf481('0x42')][_0xf481('0x33')]);_0x517ca6[_0xf481('0x31')]=qs[_0xf481('0x31')](_0x474366[_0xf481('0x42')][_0xf481('0x31')]);}_0x517ca6['order']=qs[_0xf481('0x4a')](_0x474366[_0xf481('0x42')][_0xf481('0x4a')]);_0x517ca6[_0xf481('0x4b')]=qs[_0xf481('0x43')](_[_0xf481('0x4c')](_0x474366[_0xf481('0x42')],_0x42b117[_0xf481('0x43')]));_0x517ca6[_0xf481('0x4b')][_0xf481('0x69')]=_0x2d9d7d['id'];if(_0x474366['query'][_0xf481('0x6e')]){_0x517ca6[_0xf481('0x4b')]=_[_0xf481('0x4d')](_0x517ca6['where'],{'$or':_['map'](_0x517ca6[_0xf481('0x46')],function(_0x51ba1d){var _0x2e950a={};_0x2e950a[_0x51ba1d]={'$like':'%'+_0x474366['query'][_0xf481('0x6e')]+'%'};return _0x2e950a;})});}_0x517ca6=_['merge']({},_0x517ca6,_0x474366[_0xf481('0x51')]);return db[_0xf481('0x72')]['count']({'where':_0x517ca6[_0xf481('0x4b')]})[_0xf481('0x23')](function(_0x5a583d){_0x23d737[_0xf481('0x34')]=_0x5a583d;if(_0x474366['query'][_0xf481('0x53')]){_0x517ca6[_0xf481('0x54')]=[{'all':!![]}];}return db[_0xf481('0x72')]['findAll'](_0x517ca6);})[_0xf481('0x23')](function(_0x186c6a){_0x23d737[_0xf481('0x6f')]=_0x186c6a;return _0x23d737;});}})[_0xf481('0x23')](respondWithFilteredResult(_0x34b0a9,_0x517ca6))[_0xf481('0x2c')](handleError(_0x34b0a9,null));};exports['removeAnswers']=function(_0x31c01c,_0x442264,_0x3bc707){return db['WhatsappAccount'][_0xf481('0x5a')]({'where':{'id':_0x31c01c[_0xf481('0x57')]['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x442264,null))[_0xf481('0x23')](function(_0x3af512){if(_0x3af512){return _0x3af512['removeAnswers'](_0x31c01c[_0xf481('0x42')]['ids']);}})[_0xf481('0x23')](respondWithStatusCode(_0x442264,null))[_0xf481('0x2c')](handleError(_0x442264,null));};exports[_0xf481('0x74')]=function(_0x85445b,_0x5ac6c4,_0x4c78f5){return db[_0xf481('0x52')][_0xf481('0x5a')]({'where':{'id':_0x85445b['params']['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x5ac6c4,null))[_0xf481('0x23')](function(_0x58628c){if(_0x58628c){return _0x58628c['addAgents'](_0x85445b[_0xf481('0x5c')][_0xf481('0x75')],_[_0xf481('0x76')](_0x85445b[_0xf481('0x5c')],[_0xf481('0x75'),'id'])||{})['spread'](function(_0x4008b9){for(var _0x19aecf=0x0;_0x19aecf<_0x85445b[_0xf481('0x5c')][_0xf481('0x75')]['length'];_0x19aecf+=0x1){socket[_0xf481('0x77')](_0xf481('0x78'),{'UserId':Number(_0x85445b[_0xf481('0x5c')]['ids'][_0x19aecf]),'WhatsappAccountId':Number(_0x85445b['params']['id'])});}return _0x4008b9;});}})[_0xf481('0x23')](respondWithResult(_0x5ac6c4,null))[_0xf481('0x2c')](handleError(_0x5ac6c4,null));};exports[_0xf481('0x79')]=function(_0x5e239d,_0x4ce81d,_0x440a71){return db[_0xf481('0x52')][_0xf481('0x5a')]({'where':{'id':_0x5e239d['params']['id']}})['then'](handleEntityNotFound(_0x4ce81d,null))[_0xf481('0x23')](function(_0x24c1c5){if(_0x24c1c5){return _0x24c1c5[_0xf481('0x79')](_0x5e239d[_0xf481('0x42')][_0xf481('0x75')])[_0xf481('0x23')](function(){if(_[_0xf481('0x7a')](_0x5e239d[_0xf481('0x42')][_0xf481('0x75')])){for(var _0x4e5b14=0x0;_0x4e5b14<_0x5e239d[_0xf481('0x42')][_0xf481('0x75')][_0xf481('0x59')];_0x4e5b14+=0x1){socket['emit'](_0xf481('0x7b'),{'UserId':Number(_0x5e239d[_0xf481('0x42')]['ids'][_0x4e5b14]),'WhatsappAccountId':Number(_0x5e239d['params']['id'])});}}else{socket[_0xf481('0x77')](_0xf481('0x7b'),{'UserId':Number(_0x5e239d[_0xf481('0x42')][_0xf481('0x75')]),'WhatsappAccountId':Number(_0x5e239d[_0xf481('0x57')]['id'])});}});}})[_0xf481('0x23')](respondWithStatusCode(_0x4ce81d,null))[_0xf481('0x2c')](handleError(_0x4ce81d,null));};exports[_0xf481('0x7c')]=function(_0x397033,_0x47780c,_0x36c169){var _0x218fca={};var _0x1e6b46={};var _0x5adce5;var _0x1501ca;return db[_0xf481('0x52')][_0xf481('0x6b')]({'where':{'id':_0x397033['params']['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x47780c,null))[_0xf481('0x23')](function(_0x3d2feb){if(_0x3d2feb){_0x5adce5=_0x3d2feb;_0x1e6b46[_0xf481('0x45')]=_['keys'](db[_0xf481('0x7d')]['rawAttributes']);_0x1e6b46['query']=_[_0xf481('0x41')](_0x397033[_0xf481('0x42')]);_0x1e6b46[_0xf481('0x43')]=_[_0xf481('0x44')](_0x1e6b46[_0xf481('0x45')],_0x1e6b46['query']);_0x218fca['attributes']=_[_0xf481('0x44')](_0x1e6b46[_0xf481('0x45')],qs[_0xf481('0x47')](_0x397033[_0xf481('0x42')][_0xf481('0x47')]));_0x218fca[_0xf481('0x46')]=_0x218fca[_0xf481('0x46')][_0xf481('0x59')]?_0x218fca[_0xf481('0x46')]:_0x1e6b46[_0xf481('0x45')];_0x218fca[_0xf481('0x49')]=qs[_0xf481('0x4a')](_0x397033[_0xf481('0x42')][_0xf481('0x4a')]);_0x218fca['where']=qs[_0xf481('0x43')](_['pick'](_0x397033[_0xf481('0x42')],_0x1e6b46['filters']));if(_0x397033['query'][_0xf481('0x6e')]){_0x218fca[_0xf481('0x4b')]=_[_0xf481('0x4d')](_0x218fca['where'],{'$or':_[_0xf481('0x4e')](_0x218fca['attributes'],function(_0x1bce73){var _0x4045f6={};_0x4045f6[_0x1bce73]={'$like':'%'+_0x397033[_0xf481('0x42')][_0xf481('0x6e')]+'%'};return _0x4045f6;})});}_0x218fca=_['merge']({},_0x218fca,_0x397033['options']);return _0x5adce5[_0xf481('0x7c')](_0x218fca);}})[_0xf481('0x23')](function(_0x4729dc){if(_0x4729dc){_0x1501ca=_0x4729dc['length'];if(!_0x397033[_0xf481('0x42')][_0xf481('0x6d')](_0xf481('0x48'))){_0x218fca[_0xf481('0x33')]=qs[_0xf481('0x33')](_0x397033[_0xf481('0x42')][_0xf481('0x33')]);_0x218fca[_0xf481('0x31')]=qs[_0xf481('0x31')](_0x397033['query'][_0xf481('0x31')]);}return _0x5adce5[_0xf481('0x7c')](_0x218fca);}})['then'](function(_0x190477){if(_0x190477){return _0x190477?{'count':_0x1501ca,'rows':_0x190477}:null;}})[_0xf481('0x23')](respondWithResult(_0x47780c,null))[_0xf481('0x2c')](handleError(_0x47780c,null));};exports['addApplications']=function(_0x1e8288,_0x486e15,_0x1da49f){return db[_0xf481('0x52')][_0xf481('0x6b')]({'where':{'id':_0x1e8288[_0xf481('0x57')]['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x486e15,null))[_0xf481('0x23')](function(_0xb261fa){if(_0xb261fa){return db[_0xf481('0x7e')]['transaction'](function(_0x81eea9){return db['WhatsappApplication'][_0xf481('0x39')]({'where':{'WhatsappAccountId':_0x1e8288[_0xf481('0x57')]['id']},'transaction':_0x81eea9})['then'](function(_0x397b8f){var _0x2ef4f3=_['map'](_0x1e8288[_0xf481('0x5c')],function(_0x5b5816){_0x5b5816['WhatsappAccountId']=_0x1e8288[_0xf481('0x57')]['id'];return _0x5b5816;});return db[_0xf481('0x7f')]['bulkCreate'](_0x2ef4f3,{'transaction':_0x81eea9});});})[_0xf481('0x23')](function(){return db[_0xf481('0x7f')][_0xf481('0x80')]({'where':{'WhatsappAccountId':_0x1e8288[_0xf481('0x57')]['id']},'order':_0xf481('0x81')});});}})[_0xf481('0x23')](respondWithResult(_0x486e15,null))['catch'](handleError(_0x486e15,null));};exports['getApplications']=function(_0x505320,_0x4be115,_0xf2c06){var _0x40266d={};var _0x52cb5e={};var _0xb5bcca;var _0x488a90;return db[_0xf481('0x52')]['findOne']({'where':{'id':_0x505320['params']['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x4be115,null))[_0xf481('0x23')](function(_0xf99d0a){if(_0xf99d0a){_0xb5bcca=_0xf99d0a;_0x52cb5e['model']=_[_0xf481('0x41')](db[_0xf481('0x7f')][_0xf481('0x6c')]);_0x52cb5e['query']=_[_0xf481('0x41')](_0x505320['query']);_0x52cb5e['filters']=_['intersection'](_0x52cb5e['model'],_0x52cb5e['query']);_0x40266d[_0xf481('0x46')]=_['intersection'](_0x52cb5e[_0xf481('0x45')],qs[_0xf481('0x47')](_0x505320[_0xf481('0x42')][_0xf481('0x47')]));_0x40266d[_0xf481('0x46')]=_0x40266d[_0xf481('0x46')][_0xf481('0x59')]?_0x40266d[_0xf481('0x46')]:_0x52cb5e[_0xf481('0x45')];_0x40266d[_0xf481('0x49')]=qs[_0xf481('0x4a')](_0x505320[_0xf481('0x42')]['sort']);_0x40266d['where']=qs[_0xf481('0x43')](_[_0xf481('0x4c')](_0x505320['query'],_0x52cb5e['filters']));if(_0x505320[_0xf481('0x42')]['filter']){_0x40266d[_0xf481('0x4b')]=_[_0xf481('0x4d')](_0x40266d[_0xf481('0x4b')],{'$or':_[_0xf481('0x4e')](_0x40266d[_0xf481('0x46')],function(_0x24a2ff){var _0x1b7d95={};_0x1b7d95[_0x24a2ff]={'$like':'%'+_0x505320[_0xf481('0x42')][_0xf481('0x6e')]+'%'};return _0x1b7d95;})});}_0x40266d=_['merge']({},_0x40266d,_0x505320['options']);return _0xb5bcca[_0xf481('0x82')](_0x40266d);}})[_0xf481('0x23')](function(_0x2f37e2){if(_0x2f37e2){_0x488a90=_0x2f37e2[_0xf481('0x59')];if(!_0x505320[_0xf481('0x42')][_0xf481('0x6d')](_0xf481('0x48'))){_0x40266d[_0xf481('0x33')]=qs[_0xf481('0x33')](_0x505320['query'][_0xf481('0x33')]);_0x40266d[_0xf481('0x31')]=qs[_0xf481('0x31')](_0x505320[_0xf481('0x42')][_0xf481('0x31')]);}return _0xb5bcca[_0xf481('0x82')](_0x40266d);}})[_0xf481('0x23')](function(_0x41285e){if(_0x41285e){return _0x41285e?{'count':_0x488a90,'rows':_0x41285e}:null;}})['then'](respondWithResult(_0x4be115,null))[_0xf481('0x2c')](handleError(_0x4be115,null));};exports[_0xf481('0x83')]=function(_0x435895,_0x3769ea,_0x46d458){var _0xb91366={'channel':'whatsapp'};var _0x479b90=[];var _0x38057e=[];var _0x20b253={};return db[_0xf481('0x52')][_0xf481('0x5a')]({'where':{'id':_0x435895['params']['id']},'include':[{'model':db[_0xf481('0x7f')],'as':_0xf481('0x84')}]})[_0xf481('0x23')](handleEntityNotFound(_0x3769ea,null))[_0xf481('0x23')](function(_0x49c63c){_0xb91366[_0xf481('0x85')]=_0x49c63c;_0xb91366[_0xf481('0x86')]=_[_0xf481('0x87')](_0x49c63c[_0xf481('0x84')],[_0xf481('0x81')],[_0xf481('0x88')]);if(_0xb91366[_0xf481('0x85')][_0xf481('0x84')]){delete _0xb91366['account']['Applications'];}return db[_0xf481('0x89')][_0xf481('0x67')]();})[_0xf481('0x23')](function(_0x50ed80){if(!_0x50ed80){throw new db[(_0xf481('0x8a'))][(_0xf481('0x8b'))](_0xf481('0x8c'));}_0x479b90=_[_0xf481('0x8d')](_[_0xf481('0x41')](_0x50ed80),[_0xf481('0x8e'),_0xf481('0x8f')]);_0x38057e=_[_0xf481('0x8d')](_[_0xf481('0x41')](_0x50ed80),[_0xf481('0x8e'),_0xf481('0x8f'),_0xf481('0x90'),_0xf481('0x91')]);_0xb91366[_0xf481('0x5c')]={'mapKey':_0xf481('0x92')};if(_0xb91366[_0xf481('0x85')][_0xf481('0x4f')]&&_0xb91366['account'][_0xf481('0x4f')]===_0xf481('0x93')){_0xb91366['body']['from']=_0x435895[_0xf481('0x5c')][_0xf481('0x94')][_0xf481('0x95')](_0xf481('0x96'),'');_0xb91366['body'][_0xf481('0x5c')]=_0x435895[_0xf481('0x5c')][_0xf481('0x97')];_0xb91366[_0xf481('0x5c')][_0xf481('0x98')]=_0x435895[_0xf481('0x5c')]['MessageSid'];}if(_0xb91366[_0xf481('0x5c')]['id']){delete _0xb91366[_0xf481('0x5c')]['id'];}if(_[_0xf481('0x99')](_0xb91366[_0xf481('0x5c')][_0xf481('0x9a')])){throw new db[(_0xf481('0x8a'))][(_0xf481('0x8b'))](_0xf481('0x9b'));}if(_[_0xf481('0x99')](_0xb91366[_0xf481('0x5c')][_0xf481('0x5c')])||_0xb91366[_0xf481('0x5c')][_0xf481('0x5c')]===''){throw new db[(_0xf481('0x8a'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf481('0x99')](_0xb91366[_0xf481('0x5c')]['mapKey'])){throw new db[(_0xf481('0x8a'))][(_0xf481('0x8b'))](_0xf481('0x9c')+_0x38057e);}if(!_[_0xf481('0x9d')](_0x38057e,_0xb91366[_0xf481('0x5c')]['mapKey'])){throw new db[(_0xf481('0x8a'))]['ValidationError'](_0xf481('0x9e')+_0x38057e);}_0x20b253[_0xb91366[_0xf481('0x5c')][_0xf481('0x9f')]]=_0xb91366[_0xf481('0x5c')][_0xf481('0x9a')];return db['CmList']['find']({'where':{'id':_0xb91366[_0xf481('0x85')][_0xf481('0x91')]},'include':[{'model':db[_0xf481('0x89')],'as':'Contacts','where':_0x20b253,'limit':0x1,'order':[['updatedAt',_0xf481('0xa0')]]}]});})[_0xf481('0x23')](handleEntityNotFound(_0x3769ea,null))['then'](function(_0x3a1c16){if(_0x3a1c16){_0xb91366[_0xf481('0xa1')]=_['omit'](_0x3a1c16,['Contacts']);if(_0x3a1c16[_0xf481('0xa2')][_0xf481('0x59')]){return _0x3a1c16[_0xf481('0xa2')][0x0];}var _0x533af2=_[_0xf481('0x1c')](_0xb91366[_0xf481('0x5c')],{'firstName':_0xb91366[_0xf481('0x5c')]['from'],'ListId':_0x3a1c16['id']});_0x533af2[_0xb91366[_0xf481('0x5c')]['mapKey']]=_0xb91366[_0xf481('0x5c')]['from'];return db[_0xf481('0x89')][_0xf481('0x5b')](_0x533af2,{'fields':_0x479b90,'raw':!![]});}})['then'](handleEntityNotFound(_0x3769ea,null))['then'](function(_0x3a784c){if(_0x3a784c){_0xb91366[_0xf481('0xa3')]=_0x3a784c;var _0x5de7d9={'ContactId':_0x3a784c['id'],'phone':_0xb91366['body'][_0xf481('0x9a')],'WhatsappAccountId':_0x435895[_0xf481('0x57')]['id']};var _0x2a6145={'ContactId':_0x3a784c['id'],'WhatsappAccountId':_0x435895[_0xf481('0x57')]['id'],'closed':![]};return db[_0xf481('0xa4')][_0xf481('0x5a')]({'where':_0x2a6145})[_0xf481('0x23')](function(_0x41608e){if(_0x41608e){return[_0x41608e,![]];}return db['WhatsappInteraction'][_0xf481('0x5b')](_0x5de7d9)[_0xf481('0x23')](function(_0x515659){return[_0x515659,!![]];});});}})[_0xf481('0xa5')](function(_0x318fae,_0x1596d9){_0xb91366[_0xf481('0xa6')]=_0x318fae[_0xf481('0x38')]({'plain':!![]});_0xb91366[_0xf481('0xa6')][_0xf481('0xa7')]=![];if(_0x1596d9){if(_0xb91366[_0xf481('0x85')][_0xf481('0xa8')]){_0xb91366[_0xf481('0x86')][_0xf481('0xa9')]({'id':0x0,'priority':_0xb91366[_0xf481('0x86')]['length']+0x1,'app':_0xf481('0xaa'),'appdata':'unmanaged','interval':_0xf481('0xab')});}_0xb91366[_0xf481('0xa6')][_0xf481('0xa7')]=!![];}return db[_0xf481('0xac')][_0xf481('0x5b')]({'phone':_0xb91366[_0xf481('0x5c')]['from'],'messageId':_0xb91366[_0xf481('0x5c')][_0xf481('0x98')],'body':_0xb91366[_0xf481('0x5c')][_0xf481('0x5c')],'WhatsappAccountId':_0x435895['params']['id'],'WhatsappInteractionId':_0x318fae['id'],'direction':'in','ContactId':_0x318fae[_0xf481('0xad')],'AttachmentId':_0xb91366[_0xf481('0x5c')]['AttachmentId']});})[_0xf481('0x23')](function(_0x3b28e1){_0xb91366[_0xf481('0x29')]=_0x3b28e1;if(_0xb91366['interaction'][_0xf481('0xae')]){return db['User'][_0xf481('0x5a')]({'attributes':['id',_0xf481('0x3b')],'where':{'id':_0xb91366[_0xf481('0xa6')][_0xf481('0xae')]}})[_0xf481('0x23')](function(_0x3f9f86){if(_0x3f9f86){_0xb91366['applications'][_0xf481('0xaf')]({'id':0x0,'priority':0x0,'app':_0xf481('0xb0'),'appdata':_0x3f9f86['name']+','+(_0xb91366[_0xf481('0x85')][_0xf481('0xb1')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xf481('0xb2'),'startRouting',_0xb91366);});}return respondWithRpcPromise(_0xf481('0xb2'),_0xf481('0xb3'),_0xb91366);})[_0xf481('0x23')](function(_0x185c7a){if(_0x185c7a){var _0x45da05=0xc8;var _0x4fb6d7=_0xf481('0xb4');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4fb6d7,_0x45da05,_0xf481('0xb5'));logger[_0xf481('0xb6')](_0xf481('0xb7'),_0x4fb6d7,_0x45da05,'entity\x20found',JSON[_0xf481('0x27')](_0x185c7a));if(_0xb91366[_0xf481('0x85')]['type']===_0xf481('0x93')){return _0x3769ea['status'](_0x45da05)[_0xf481('0x35')](_0xf481('0xb8'),_0xf481('0xb9'))[_0xf481('0x3c')](_0xf481('0xba'));}else{return _0x3769ea[_0xf481('0x2e')](_0x45da05)[_0xf481('0x30')](_0x185c7a);}}})['catch'](handleError(_0x3769ea,null));};exports[_0xf481('0x3c')]=function(_0x115a9b,_0x5cb8a7,_0x12bfcb){var _0x5ed5bb,_0x34edbc,_0x2db2d3;if(_[_0xf481('0x99')](_0x115a9b['body'][_0xf481('0x5c')])||_0x115a9b[_0xf481('0x5c')][_0xf481('0x5c')]===''){throw new db[(_0xf481('0x8a'))][(_0xf481('0x8b'))](_0xf481('0xbb'));}if(_['isNil'](_0x115a9b[_0xf481('0x5c')]['to'])){throw new db[(_0xf481('0x8a'))][(_0xf481('0x8b'))](_0xf481('0xbc'));}_0x5ed5bb=_0x115a9b[_0xf481('0x5c')]['to'];return db['WhatsappAccount'][_0xf481('0x5a')]({'where':{'id':_0x115a9b[_0xf481('0x57')]['id']},'include':[{'model':db[_0xf481('0xbd')],'as':_0xf481('0xbe'),'include':[{'model':db[_0xf481('0x89')],'as':'Contacts','where':{'mobile':_0x5ed5bb},'limit':0x1,'order':[[_0xf481('0x8f'),_0xf481('0xa0')]]}]}]})[_0xf481('0x23')](handleEntityNotFound(_0x5cb8a7,null))[_0xf481('0x23')](function(_0x45cfae){if(_0x45cfae&&_0x45cfae[_0xf481('0xbe')]){_0x34edbc=_0x45cfae['get']({'plain':!![]});if(_0x34edbc['List']&&_0x34edbc[_0xf481('0xbe')]['Contacts'][_0xf481('0x59')]){return _0x34edbc[_0xf481('0xbe')][_0xf481('0xa2')][0x0];}return db[_0xf481('0x89')][_0xf481('0x5b')](_[_0xf481('0x1c')](_0x115a9b[_0xf481('0x5c')],{'firstName':_0x5ed5bb,'mobile':_0x5ed5bb,'phone':_0x5ed5bb,'ListId':_0x34edbc[_0xf481('0x91')]}));}})[_0xf481('0x23')](handleEntityNotFound(_0x5cb8a7,null))[_0xf481('0x23')](function(_0x193298){if(_0x193298){_0x2db2d3=_0x193298;return db[_0xf481('0xa4')][_0xf481('0x5a')]({'where':{'ContactId':_0x2db2d3['id'],'closed':![],'WhatsappAccountId':_0x34edbc['id']}})[_0xf481('0x23')](function(_0x32ee68){if(_0x32ee68){return[_0x32ee68,![]];}return db[_0xf481('0xa4')][_0xf481('0x5b')]({'UserId':_0x115a9b[_0xf481('0x5d')]['id'],'ContactId':_0x2db2d3['id'],'WhatsappAccountId':_0x34edbc['id'],'phone':_0x5ed5bb,'firstMsgDirection':_0xf481('0xbf'),'Messages':[_[_0xf481('0x4d')](_0x115a9b[_0xf481('0x5c')],{'read':![],'body':_0x115a9b[_0xf481('0x5c')][_0xf481('0x5c')],'phone':_0x5ed5bb,'WhatsappAccountId':_0x34edbc['id'],'UserId':_0x115a9b['user']['id'],'ContactId':_0x2db2d3['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xf481('0xc0')}]})[_0xf481('0x23')](function(_0xd9c977){return[_0xd9c977,!![]];});});}})[_0xf481('0xa5')](function(_0x5df073,_0x2d9026){if(_0x2d9026){return _0x5df073;}return db[_0xf481('0xac')][_0xf481('0x5b')](_[_0xf481('0x4d')](_0x115a9b[_0xf481('0x5c')],{'read':![],'body':_0x115a9b[_0xf481('0x5c')][_0xf481('0x5c')],'phone':_0x5ed5bb,'WhatsappAccountId':_0x34edbc['id'],'WhatsappInteractionId':_0x5df073['id'],'UserId':_0x115a9b[_0xf481('0x5d')]['id'],'ContactId':_0x2db2d3['id']}))['then'](function(_0xafc6b9){_0x5df073['dataValues'][_0xf481('0xc0')]=[];_0x5df073[_0xf481('0xc1')][_0xf481('0xc0')][_0xf481('0xa9')](_0xafc6b9['dataValues']);return _0x5df073;});})[_0xf481('0x23')](respondWithResult(_0x5cb8a7,null))[_0xf481('0x2c')](handleError(_0x5cb8a7,null));};
\ No newline at end of file
+var _0xbe4e=['moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','update','then','WhatsappAccounts','destroy','stack','name','send','index','Pause','map','WhatsappAccount','fieldName','type','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','count','include','rows','params','mandatoryDispositionPause','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','WhatsappAccountId','Disposition','getDispositions','hasOwnProperty','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','rawAttributes','findAll','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','isArray','userWhatsappAccount:remove','getAgents','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','applications','Applications','asc','account','Sequelize','no\x20available\x20attributes','difference','updatedAt','ListId','mobile','twilio','whatsapp:','messageId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','DESC','list','Contacts','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','List','WhatsappMessage','Messages','dataValues','zip-dir','fast-json-patch'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xbe4e,0x170));var _0xebe4=function(_0x368b19,_0xcf4ad7){_0x368b19=_0x368b19-0x0;var _0x8ec657=_0xbe4e[_0x368b19];return _0x8ec657;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xebe4('0x0'));var jsonpatch=require(_0xebe4('0x1'));var rp=require('request-promise');var moment=require(_0xebe4('0x2'));var BPromise=require(_0xebe4('0x3'));var Mustache=require(_0xebe4('0x4'));var util=require(_0xebe4('0x5'));var path=require(_0xebe4('0x6'));var sox=require(_0xebe4('0x7'));var csv=require('to-csv');var ejs=require(_0xebe4('0x8'));var fs=require('fs');var fs_extra=require(_0xebe4('0x9'));var _=require(_0xebe4('0xa'));var squel=require(_0xebe4('0xb'));var crypto=require(_0xebe4('0xc'));var jsforce=require(_0xebe4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xebe4('0xe'));var querystring=require(_0xebe4('0xf'));var Papa=require(_0xebe4('0x10'));var Redis=require('ioredis');var authService=require(_0xebe4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xebe4('0x12'));var hardwareService=require(_0xebe4('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xebe4('0x14'));var db=require(_0xebe4('0x15'))['db'];config[_0xebe4('0x16')]=_[_0xebe4('0x17')](config[_0xebe4('0x16')],{'host':_0xebe4('0x18'),'port':0x18eb});var socket=require(_0xebe4('0x19'))(new Redis(config['redis']));require(_0xebe4('0x1a'))[_0xebe4('0x1b')](socket);var jayson=require(_0xebe4('0x1c'));var client=jayson[_0xebe4('0x1d')][_0xebe4('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x4a9a95,_0x25b491,_0x1d7d35,_0x1af543){return new BPromise(function(_0x12ec93,_0xc7f475){var _0x5cf32f=_0x1af543||client;return _0x5cf32f[_0xebe4('0x1f')](_0x4a9a95,_0x1d7d35)['then'](function(_0x34233a){logger[_0xebe4('0x20')](_0xebe4('0x21'),_0x25b491,_0xebe4('0x22'));logger['debug'](_0xebe4('0x23'),_0x25b491,'request\x20sent',JSON[_0xebe4('0x24')](_0x34233a));if(_0x34233a[_0xebe4('0x25')]){if(_0x34233a['error'][_0xebe4('0x26')]===0x1f4){logger[_0xebe4('0x25')](_0xebe4('0x21'),_0x25b491,_0x34233a[_0xebe4('0x25')][_0xebe4('0x27')]);return _0xc7f475(_0x34233a[_0xebe4('0x25')][_0xebe4('0x27')]);}logger[_0xebe4('0x25')](_0xebe4('0x21'),_0x25b491,_0x34233a[_0xebe4('0x25')][_0xebe4('0x27')]);return _0x12ec93(_0x34233a[_0xebe4('0x25')]['message']);}else{logger[_0xebe4('0x20')](_0xebe4('0x21'),_0x25b491,_0xebe4('0x22'));_0x12ec93(_0x34233a[_0xebe4('0x28')][_0xebe4('0x27')]);}})[_0xebe4('0x29')](function(_0x3a9376){logger[_0xebe4('0x25')](_0xebe4('0x21'),_0x25b491,_0x3a9376);_0xc7f475(_0x3a9376);});});}function respondWithStatusCode(_0x3c08b5,_0x57cf66){_0x57cf66=_0x57cf66||0xcc;return function(_0x2f862e){if(_0x2f862e){return _0x3c08b5[_0xebe4('0x2a')](_0x57cf66);}return _0x3c08b5[_0xebe4('0x2b')](_0x57cf66)[_0xebe4('0x2c')]();};}function respondWithResult(_0x5a9042,_0x214874){_0x214874=_0x214874||0xc8;return function(_0xe3bdbe){if(_0xe3bdbe){return _0x5a9042['status'](_0x214874)[_0xebe4('0x2d')](_0xe3bdbe);}};}function respondWithFilteredResult(_0x43e401,_0x25481a){return function(_0x28d9d1){if(_0x28d9d1){var _0x32bcba=typeof _0x25481a[_0xebe4('0x2e')]===_0xebe4('0x2f')&&typeof _0x25481a[_0xebe4('0x30')]===_0xebe4('0x2f');var _0x2d4fac=_0x28d9d1['count'];var _0x3fae15=_0x32bcba?0x0:_0x25481a[_0xebe4('0x2e')];var _0x1f0f0a=_0x32bcba?_0x28d9d1['count']:_0x25481a['offset']+_0x25481a[_0xebe4('0x30')];var _0x4ace95;if(_0x1f0f0a>=_0x2d4fac){_0x1f0f0a=_0x2d4fac;_0x4ace95=0xc8;}else{_0x4ace95=0xce;}_0x43e401[_0xebe4('0x2b')](_0x4ace95);return _0x43e401['set']('Content-Range',_0x3fae15+'-'+_0x1f0f0a+'/'+_0x2d4fac)[_0xebe4('0x2d')](_0x28d9d1);}return null;};}function patchUpdates(_0x1f0d61){return function(_0x4bc40a){try{jsonpatch[_0xebe4('0x31')](_0x4bc40a,_0x1f0d61,!![]);}catch(_0x452460){return BPromise[_0xebe4('0x32')](_0x452460);}return _0x4bc40a[_0xebe4('0x33')]();};}function saveUpdates(_0x410763,_0x20142c){return function(_0x247ba8){if(_0x247ba8){return _0x247ba8[_0xebe4('0x34')](_0x410763)[_0xebe4('0x35')](function(_0x1c9b7b){return _0x1c9b7b;});}return null;};}function removeEntity(_0x1b3b42,_0xf5c7de){return function(_0x51ed7e){if(_0x51ed7e){return _0x51ed7e['destroy']()[_0xebe4('0x35')](function(){var _0x341ba4=_0x51ed7e['get']({'plain':!![]});var _0x18da55=_0xebe4('0x36');return db['UserProfileResource'][_0xebe4('0x37')]({'where':{'type':_0x18da55,'resourceId':_0x341ba4['id']}})['then'](function(){return _0x51ed7e;});})[_0xebe4('0x35')](function(){_0x1b3b42['status'](0xcc)[_0xebe4('0x2c')]();});}};}function handleEntityNotFound(_0x1726c5,_0x2afd70){return function(_0x16d910){if(!_0x16d910){_0x1726c5['sendStatus'](0x194);}return _0x16d910;};}function handleError(_0x1d6af4,_0x1f764d){_0x1f764d=_0x1f764d||0x1f4;return function(_0xcef49d){logger['error'](_0xcef49d[_0xebe4('0x38')]);if(_0xcef49d[_0xebe4('0x39')]){delete _0xcef49d['name'];}_0x1d6af4['status'](_0x1f764d)[_0xebe4('0x3a')](_0xcef49d);};}exports[_0xebe4('0x3b')]=function(_0xfd9fbd,_0x35ab48){var _0x22a47e={'include':[{'model':db[_0xebe4('0x3c')],'as':'mandatoryDispositionPause'}]},_0x3683c6={},_0xd867f9={'count':0x0,'rows':[]};var _0x4c04fa=_[_0xebe4('0x3d')](db[_0xebe4('0x3e')]['rawAttributes'],function(_0x1e3648){return{'name':_0x1e3648[_0xebe4('0x3f')],'type':_0x1e3648[_0xebe4('0x40')]['key']};});_0x3683c6[_0xebe4('0x41')]=_['map'](_0x4c04fa,'name');_0x3683c6['query']=_[_0xebe4('0x42')](_0xfd9fbd[_0xebe4('0x43')]);_0x3683c6['filters']=_[_0xebe4('0x44')](_0x3683c6[_0xebe4('0x41')],_0x3683c6[_0xebe4('0x43')]);_0x22a47e['attributes']=_[_0xebe4('0x44')](_0x3683c6[_0xebe4('0x41')],qs[_0xebe4('0x45')](_0xfd9fbd[_0xebe4('0x43')][_0xebe4('0x45')]));_0x22a47e[_0xebe4('0x46')]=_0x22a47e[_0xebe4('0x46')][_0xebe4('0x47')]?_0x22a47e[_0xebe4('0x46')]:_0x3683c6[_0xebe4('0x41')];if(!_0xfd9fbd['query']['hasOwnProperty'](_0xebe4('0x48'))){_0x22a47e[_0xebe4('0x30')]=qs[_0xebe4('0x30')](_0xfd9fbd['query'][_0xebe4('0x30')]);_0x22a47e[_0xebe4('0x2e')]=qs[_0xebe4('0x2e')](_0xfd9fbd[_0xebe4('0x43')][_0xebe4('0x2e')]);}_0x22a47e[_0xebe4('0x49')]=qs[_0xebe4('0x4a')](_0xfd9fbd[_0xebe4('0x43')]['sort']);_0x22a47e[_0xebe4('0x4b')]=qs[_0xebe4('0x4c')](_['pick'](_0xfd9fbd['query'],_0x3683c6['filters']),_0x4c04fa);if(_0xfd9fbd['query'][_0xebe4('0x4d')]){_0x22a47e[_0xebe4('0x4b')]=_['merge'](_0x22a47e[_0xebe4('0x4b')],{'$or':_[_0xebe4('0x3d')](_0x4c04fa,function(_0x29ca61){if(_0x29ca61[_0xebe4('0x40')]!==_0xebe4('0x4e')){var _0x7fe146={};_0x7fe146[_0x29ca61['name']]={'$like':'%'+_0xfd9fbd['query'][_0xebe4('0x4d')]+'%'};return _0x7fe146;}})});}_0x22a47e=_[_0xebe4('0x4f')]({},_0x22a47e,_0xfd9fbd[_0xebe4('0x50')]);var _0x574852={'where':_0x22a47e[_0xebe4('0x4b')]};return db[_0xebe4('0x3e')][_0xebe4('0x51')](_0x574852)[_0xebe4('0x35')](function(_0x33893c){_0xd867f9[_0xebe4('0x51')]=_0x33893c;if(_0xfd9fbd['query']['includeAll']){_0x22a47e[_0xebe4('0x52')]=[{'all':!![]}];}return db[_0xebe4('0x3e')]['findAll'](_0x22a47e);})[_0xebe4('0x35')](function(_0xd2a90d){_0xd867f9[_0xebe4('0x53')]=_0xd2a90d;return _0xd867f9;})[_0xebe4('0x35')](respondWithFilteredResult(_0x35ab48,_0x22a47e))['catch'](handleError(_0x35ab48,null));};exports['show']=function(_0x15b93a,_0x45f495){var _0x5b4835={'raw':![],'where':{'id':_0x15b93a[_0xebe4('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0xebe4('0x55')}]},_0x1e2689={};_0x1e2689[_0xebe4('0x41')]=_[_0xebe4('0x42')](db[_0xebe4('0x3e')]['rawAttributes']);_0x1e2689[_0xebe4('0x43')]=_['keys'](_0x15b93a[_0xebe4('0x43')]);_0x1e2689[_0xebe4('0x4c')]=_['intersection'](_0x1e2689[_0xebe4('0x41')],_0x1e2689['query']);_0x5b4835[_0xebe4('0x46')]=_[_0xebe4('0x44')](_0x1e2689[_0xebe4('0x41')],qs[_0xebe4('0x45')](_0x15b93a[_0xebe4('0x43')]['fields']));_0x5b4835[_0xebe4('0x46')]=_0x5b4835['attributes'][_0xebe4('0x47')]?_0x5b4835[_0xebe4('0x46')]:_0x1e2689[_0xebe4('0x41')];if(_0x15b93a['query'][_0xebe4('0x56')]){_0x5b4835[_0xebe4('0x52')]=[{'all':!![]}];}_0x5b4835=_[_0xebe4('0x4f')]({},_0x5b4835,_0x15b93a[_0xebe4('0x50')]);return db['WhatsappAccount'][_0xebe4('0x57')](_0x5b4835)[_0xebe4('0x35')](handleEntityNotFound(_0x45f495,null))[_0xebe4('0x35')](respondWithResult(_0x45f495,null))['catch'](handleError(_0x45f495,null));};exports[_0xebe4('0x58')]=function(_0x2e38a8,_0x23c966){return db[_0xebe4('0x3e')]['create'](_0x2e38a8[_0xebe4('0x59')],{})['then'](function(_0x3d7169){var _0xba001=_0x2e38a8[_0xebe4('0x5a')][_0xebe4('0x5b')]({'plain':!![]});if(!_0xba001)throw new Error(_0xebe4('0x5c'));if(_0xba001[_0xebe4('0x5d')]==='user'){var _0xdbede7=_0x3d7169[_0xebe4('0x5b')]({'plain':!![]});var _0x1acb0a='WhatsappAccounts';return db[_0xebe4('0x5e')][_0xebe4('0x57')]({'where':{'name':_0x1acb0a,'userProfileId':_0xba001['userProfileId']},'raw':!![]})[_0xebe4('0x35')](function(_0x3b6738){if(_0x3b6738&&_0x3b6738[_0xebe4('0x5f')]===0x0){return db[_0xebe4('0x60')]['create']({'name':_0xdbede7['name'],'resourceId':_0xdbede7['id'],'type':_0x3b6738['name'],'sectionId':_0x3b6738['id']},{})[_0xebe4('0x35')](function(){return _0x3d7169;});}else{return _0x3d7169;}})[_0xebe4('0x29')](function(_0x11eff8){logger[_0xebe4('0x25')](_0xebe4('0x61'),_0x11eff8);throw _0x11eff8;});}return _0x3d7169;})[_0xebe4('0x35')](respondWithResult(_0x23c966,0xc9))[_0xebe4('0x29')](handleError(_0x23c966,null));};exports[_0xebe4('0x34')]=function(_0xc73745,_0x3226fd){if(_0xc73745['body']['id']){delete _0xc73745['body']['id'];}return db[_0xebe4('0x3e')][_0xebe4('0x57')]({'where':{'id':_0xc73745[_0xebe4('0x54')]['id']},'include':[{'model':db[_0xebe4('0x3c')],'as':_0xebe4('0x55')}]})['then'](handleEntityNotFound(_0x3226fd,null))[_0xebe4('0x35')](saveUpdates(_0xc73745[_0xebe4('0x59')],null))[_0xebe4('0x35')](respondWithResult(_0x3226fd,null))[_0xebe4('0x29')](handleError(_0x3226fd,null));};exports[_0xebe4('0x37')]=function(_0x2363fd,_0x14dd74){return db['WhatsappAccount']['find']({'where':{'id':_0x2363fd['params']['id']}})[_0xebe4('0x35')](handleEntityNotFound(_0x14dd74,null))[_0xebe4('0x35')](removeEntity(_0x14dd74,null))[_0xebe4('0x29')](handleError(_0x14dd74,null));};exports[_0xebe4('0x62')]=function(_0x45aa9f,_0x1bf52f){return db[_0xebe4('0x3e')][_0xebe4('0x62')]()[_0xebe4('0x35')](respondWithResult(_0x1bf52f,null))[_0xebe4('0x29')](handleError(_0x1bf52f,null));};exports['addDisposition']=function(_0x16f129,_0x1ea91e,_0x5c93dd){if(_0x16f129[_0xebe4('0x59')]['id']){delete _0x16f129['body']['id'];}return db['WhatsappAccount'][_0xebe4('0x57')]({'where':{'id':_0x16f129[_0xebe4('0x54')]['id']}})[_0xebe4('0x35')](handleEntityNotFound(_0x1ea91e,null))[_0xebe4('0x35')](function(_0x40acb6){if(_0x40acb6){_0x16f129['body'][_0xebe4('0x63')]=_0x40acb6['id'];return db[_0xebe4('0x64')][_0xebe4('0x58')](_0x16f129['body']);}})['then'](respondWithResult(_0x1ea91e,null))['catch'](handleError(_0x1ea91e,null));};exports[_0xebe4('0x65')]=function(_0x21bc53,_0x4d8980,_0x8ae4e1){var _0x59abca={'raw':![],'where':{}};var _0x842efb={};var _0x29d18b={'count':0x0,'rows':[]};return db[_0xebe4('0x3e')]['findOne']({'where':{'id':_0x21bc53[_0xebe4('0x54')]['id']}})['then'](handleEntityNotFound(_0x4d8980,null))[_0xebe4('0x35')](function(_0x2dae06){if(_0x2dae06){_0x842efb['model']=_[_0xebe4('0x42')](db[_0xebe4('0x64')]['rawAttributes']);_0x842efb['query']=_[_0xebe4('0x42')](_0x21bc53[_0xebe4('0x43')]);_0x842efb['filters']=_['intersection'](_0x842efb[_0xebe4('0x41')],_0x842efb['query']);_0x59abca[_0xebe4('0x46')]=_[_0xebe4('0x44')](_0x842efb[_0xebe4('0x41')],qs['fields'](_0x21bc53[_0xebe4('0x43')][_0xebe4('0x45')]));_0x59abca['attributes']=_0x59abca[_0xebe4('0x46')][_0xebe4('0x47')]?_0x59abca[_0xebe4('0x46')]:_0x842efb['model'];if(!_0x21bc53[_0xebe4('0x43')][_0xebe4('0x66')]('nolimit')){_0x59abca['limit']=qs[_0xebe4('0x30')](_0x21bc53['query']['limit']);_0x59abca['offset']=qs[_0xebe4('0x2e')](_0x21bc53['query'][_0xebe4('0x2e')]);}_0x59abca[_0xebe4('0x49')]=qs['sort'](_0x21bc53[_0xebe4('0x43')][_0xebe4('0x4a')]);_0x59abca[_0xebe4('0x4b')]=qs[_0xebe4('0x4c')](_[_0xebe4('0x67')](_0x21bc53[_0xebe4('0x43')],_0x842efb['filters']));_0x59abca[_0xebe4('0x4b')][_0xebe4('0x63')]=_0x2dae06['id'];if(_0x21bc53[_0xebe4('0x43')]['filter']){_0x59abca[_0xebe4('0x4b')]=_[_0xebe4('0x4f')](_0x59abca[_0xebe4('0x4b')],{'$or':_[_0xebe4('0x3d')](_0x59abca[_0xebe4('0x46')],function(_0x1c57d9){var _0x164df2={};_0x164df2[_0x1c57d9]={'$like':'%'+_0x21bc53[_0xebe4('0x43')]['filter']+'%'};return _0x164df2;})});}_0x59abca=_[_0xebe4('0x4f')]({},_0x59abca,_0x21bc53[_0xebe4('0x50')]);return db[_0xebe4('0x64')][_0xebe4('0x51')]({'where':_0x59abca['where']})['then'](function(_0x45ff56){_0x29d18b[_0xebe4('0x51')]=_0x45ff56;if(_0x21bc53[_0xebe4('0x43')]['includeAll']){_0x59abca[_0xebe4('0x52')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x59abca);})[_0xebe4('0x35')](function(_0x245db1){_0x29d18b[_0xebe4('0x53')]=_0x245db1;return _0x29d18b;});}})[_0xebe4('0x35')](respondWithFilteredResult(_0x4d8980,_0x59abca))[_0xebe4('0x29')](handleError(_0x4d8980,null));};exports[_0xebe4('0x68')]=function(_0x3a841e,_0x3d7a7,_0x1c225e){return db[_0xebe4('0x3e')][_0xebe4('0x57')]({'where':{'id':_0x3a841e[_0xebe4('0x54')]['id']}})['then'](handleEntityNotFound(_0x3d7a7,null))['then'](function(_0x575981){if(_0x575981){return _0x575981[_0xebe4('0x68')](_0x3a841e[_0xebe4('0x43')][_0xebe4('0x69')]);}})[_0xebe4('0x35')](respondWithStatusCode(_0x3d7a7,null))[_0xebe4('0x29')](handleError(_0x3d7a7,null));};exports[_0xebe4('0x6a')]=function(_0x3b527b,_0x246eab,_0x5c2961){if(_0x3b527b[_0xebe4('0x59')]['id']){delete _0x3b527b[_0xebe4('0x59')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x3b527b['params']['id']}})[_0xebe4('0x35')](handleEntityNotFound(_0x246eab,null))['then'](function(_0x502653){if(_0x502653){_0x3b527b[_0xebe4('0x59')]['WhatsappAccountId']=_0x502653['id'];return db[_0xebe4('0x6b')][_0xebe4('0x58')](_0x3b527b[_0xebe4('0x59')]);}})['then'](respondWithResult(_0x246eab,null))[_0xebe4('0x29')](handleError(_0x246eab,null));};exports[_0xebe4('0x6c')]=function(_0x215e4c,_0x15450b,_0x1d9d95){var _0x57bffe={'raw':![],'where':{}};var _0x19c9dd={};var _0x42e6f2={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xebe4('0x6d')]({'where':{'id':_0x215e4c['params']['id']}})[_0xebe4('0x35')](handleEntityNotFound(_0x15450b,null))[_0xebe4('0x35')](function(_0x598f61){if(_0x598f61){_0x19c9dd['model']=_[_0xebe4('0x42')](db[_0xebe4('0x6b')][_0xebe4('0x6e')]);_0x19c9dd[_0xebe4('0x43')]=_[_0xebe4('0x42')](_0x215e4c[_0xebe4('0x43')]);_0x19c9dd['filters']=_['intersection'](_0x19c9dd[_0xebe4('0x41')],_0x19c9dd[_0xebe4('0x43')]);_0x57bffe[_0xebe4('0x46')]=_[_0xebe4('0x44')](_0x19c9dd['model'],qs[_0xebe4('0x45')](_0x215e4c[_0xebe4('0x43')][_0xebe4('0x45')]));_0x57bffe[_0xebe4('0x46')]=_0x57bffe['attributes']['length']?_0x57bffe[_0xebe4('0x46')]:_0x19c9dd[_0xebe4('0x41')];if(!_0x215e4c[_0xebe4('0x43')]['hasOwnProperty'](_0xebe4('0x48'))){_0x57bffe[_0xebe4('0x30')]=qs[_0xebe4('0x30')](_0x215e4c[_0xebe4('0x43')]['limit']);_0x57bffe[_0xebe4('0x2e')]=qs[_0xebe4('0x2e')](_0x215e4c['query'][_0xebe4('0x2e')]);}_0x57bffe[_0xebe4('0x49')]=qs['sort'](_0x215e4c[_0xebe4('0x43')][_0xebe4('0x4a')]);_0x57bffe[_0xebe4('0x4b')]=qs[_0xebe4('0x4c')](_[_0xebe4('0x67')](_0x215e4c[_0xebe4('0x43')],_0x19c9dd['filters']));_0x57bffe[_0xebe4('0x4b')][_0xebe4('0x63')]=_0x598f61['id'];if(_0x215e4c[_0xebe4('0x43')][_0xebe4('0x4d')]){_0x57bffe[_0xebe4('0x4b')]=_[_0xebe4('0x4f')](_0x57bffe['where'],{'$or':_[_0xebe4('0x3d')](_0x57bffe[_0xebe4('0x46')],function(_0x49cbc1){var _0x42826e={};_0x42826e[_0x49cbc1]={'$like':'%'+_0x215e4c[_0xebe4('0x43')]['filter']+'%'};return _0x42826e;})});}_0x57bffe=_[_0xebe4('0x4f')]({},_0x57bffe,_0x215e4c[_0xebe4('0x50')]);return db[_0xebe4('0x6b')][_0xebe4('0x51')]({'where':_0x57bffe[_0xebe4('0x4b')]})[_0xebe4('0x35')](function(_0x551b4c){_0x42e6f2[_0xebe4('0x51')]=_0x551b4c;if(_0x215e4c[_0xebe4('0x43')][_0xebe4('0x56')]){_0x57bffe[_0xebe4('0x52')]=[{'all':!![]}];}return db[_0xebe4('0x6b')][_0xebe4('0x6f')](_0x57bffe);})[_0xebe4('0x35')](function(_0x347b11){_0x42e6f2[_0xebe4('0x53')]=_0x347b11;return _0x42e6f2;});}})[_0xebe4('0x35')](respondWithFilteredResult(_0x15450b,_0x57bffe))[_0xebe4('0x29')](handleError(_0x15450b,null));};exports['removeAnswers']=function(_0x5e0bbe,_0x41ee07,_0x39a69b){return db[_0xebe4('0x3e')]['find']({'where':{'id':_0x5e0bbe[_0xebe4('0x54')]['id']}})['then'](handleEntityNotFound(_0x41ee07,null))[_0xebe4('0x35')](function(_0x2a2154){if(_0x2a2154){return _0x2a2154[_0xebe4('0x70')](_0x5e0bbe[_0xebe4('0x43')]['ids']);}})[_0xebe4('0x35')](respondWithStatusCode(_0x41ee07,null))['catch'](handleError(_0x41ee07,null));};exports['addAgents']=function(_0x24a0c9,_0x4732aa,_0x5351a4){return db[_0xebe4('0x3e')][_0xebe4('0x57')]({'where':{'id':_0x24a0c9[_0xebe4('0x54')]['id']}})[_0xebe4('0x35')](handleEntityNotFound(_0x4732aa,null))['then'](function(_0x316788){if(_0x316788){return _0x316788[_0xebe4('0x71')](_0x24a0c9['body'][_0xebe4('0x69')],_[_0xebe4('0x72')](_0x24a0c9[_0xebe4('0x59')],['ids','id'])||{})[_0xebe4('0x73')](function(_0x26aea0){for(var _0x2d6c40=0x0;_0x2d6c40<_0x24a0c9[_0xebe4('0x59')][_0xebe4('0x69')][_0xebe4('0x47')];_0x2d6c40+=0x1){socket[_0xebe4('0x74')](_0xebe4('0x75'),{'UserId':Number(_0x24a0c9[_0xebe4('0x59')][_0xebe4('0x69')][_0x2d6c40]),'WhatsappAccountId':Number(_0x24a0c9['params']['id'])});}return _0x26aea0;});}})[_0xebe4('0x35')](respondWithResult(_0x4732aa,null))['catch'](handleError(_0x4732aa,null));};exports['removeAgents']=function(_0x2fa456,_0x4994cf,_0x29e3db){return db[_0xebe4('0x3e')][_0xebe4('0x57')]({'where':{'id':_0x2fa456[_0xebe4('0x54')]['id']}})[_0xebe4('0x35')](handleEntityNotFound(_0x4994cf,null))[_0xebe4('0x35')](function(_0x5947d3){if(_0x5947d3){return _0x5947d3['removeAgents'](_0x2fa456['query'][_0xebe4('0x69')])[_0xebe4('0x35')](function(){if(_[_0xebe4('0x76')](_0x2fa456[_0xebe4('0x43')]['ids'])){for(var _0x4653f2=0x0;_0x4653f2<_0x2fa456[_0xebe4('0x43')][_0xebe4('0x69')][_0xebe4('0x47')];_0x4653f2+=0x1){socket[_0xebe4('0x74')](_0xebe4('0x77'),{'UserId':Number(_0x2fa456[_0xebe4('0x43')][_0xebe4('0x69')][_0x4653f2]),'WhatsappAccountId':Number(_0x2fa456[_0xebe4('0x54')]['id'])});}}else{socket[_0xebe4('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x2fa456[_0xebe4('0x43')][_0xebe4('0x69')]),'WhatsappAccountId':Number(_0x2fa456[_0xebe4('0x54')]['id'])});}});}})[_0xebe4('0x35')](respondWithStatusCode(_0x4994cf,null))[_0xebe4('0x29')](handleError(_0x4994cf,null));};exports['getAgents']=function(_0x56024d,_0xb50de3,_0x3307a8){var _0x5d14e2={};var _0x54d1e7={};var _0x3cb858;var _0x3aed61;return db[_0xebe4('0x3e')]['findOne']({'where':{'id':_0x56024d[_0xebe4('0x54')]['id']}})[_0xebe4('0x35')](handleEntityNotFound(_0xb50de3,null))[_0xebe4('0x35')](function(_0x329f89){if(_0x329f89){_0x3cb858=_0x329f89;_0x54d1e7['model']=_['keys'](db['User'][_0xebe4('0x6e')]);_0x54d1e7[_0xebe4('0x43')]=_['keys'](_0x56024d[_0xebe4('0x43')]);_0x54d1e7[_0xebe4('0x4c')]=_[_0xebe4('0x44')](_0x54d1e7[_0xebe4('0x41')],_0x54d1e7['query']);_0x5d14e2[_0xebe4('0x46')]=_[_0xebe4('0x44')](_0x54d1e7['model'],qs[_0xebe4('0x45')](_0x56024d[_0xebe4('0x43')][_0xebe4('0x45')]));_0x5d14e2[_0xebe4('0x46')]=_0x5d14e2[_0xebe4('0x46')][_0xebe4('0x47')]?_0x5d14e2[_0xebe4('0x46')]:_0x54d1e7[_0xebe4('0x41')];_0x5d14e2[_0xebe4('0x49')]=qs[_0xebe4('0x4a')](_0x56024d[_0xebe4('0x43')][_0xebe4('0x4a')]);_0x5d14e2['where']=qs[_0xebe4('0x4c')](_[_0xebe4('0x67')](_0x56024d[_0xebe4('0x43')],_0x54d1e7['filters']));if(_0x56024d[_0xebe4('0x43')][_0xebe4('0x4d')]){_0x5d14e2[_0xebe4('0x4b')]=_[_0xebe4('0x4f')](_0x5d14e2['where'],{'$or':_[_0xebe4('0x3d')](_0x5d14e2[_0xebe4('0x46')],function(_0x122992){var _0x3bcbd9={};_0x3bcbd9[_0x122992]={'$like':'%'+_0x56024d[_0xebe4('0x43')][_0xebe4('0x4d')]+'%'};return _0x3bcbd9;})});}_0x5d14e2=_[_0xebe4('0x4f')]({},_0x5d14e2,_0x56024d[_0xebe4('0x50')]);return _0x3cb858['getAgents'](_0x5d14e2);}})[_0xebe4('0x35')](function(_0xf016fc){if(_0xf016fc){_0x3aed61=_0xf016fc[_0xebe4('0x47')];if(!_0x56024d['query'][_0xebe4('0x66')]('nolimit')){_0x5d14e2[_0xebe4('0x30')]=qs[_0xebe4('0x30')](_0x56024d['query'][_0xebe4('0x30')]);_0x5d14e2[_0xebe4('0x2e')]=qs['offset'](_0x56024d['query'][_0xebe4('0x2e')]);}return _0x3cb858[_0xebe4('0x78')](_0x5d14e2);}})['then'](function(_0x2a60b6){if(_0x2a60b6){return _0x2a60b6?{'count':_0x3aed61,'rows':_0x2a60b6}:null;}})['then'](respondWithResult(_0xb50de3,null))[_0xebe4('0x29')](handleError(_0xb50de3,null));};exports['addApplications']=function(_0x309f73,_0x51fb7b,_0x1755c8){return db['WhatsappAccount']['findOne']({'where':{'id':_0x309f73[_0xebe4('0x54')]['id']}})[_0xebe4('0x35')](handleEntityNotFound(_0x51fb7b,null))['then'](function(_0x502f00){if(_0x502f00){return db[_0xebe4('0x79')][_0xebe4('0x7a')](function(_0x3d9ed9){return db[_0xebe4('0x7b')][_0xebe4('0x37')]({'where':{'WhatsappAccountId':_0x309f73[_0xebe4('0x54')]['id']},'transaction':_0x3d9ed9})[_0xebe4('0x35')](function(_0x34df86){var _0x5bf7e9=_['map'](_0x309f73[_0xebe4('0x59')],function(_0xfd1252){_0xfd1252['WhatsappAccountId']=_0x309f73[_0xebe4('0x54')]['id'];return _0xfd1252;});return db['WhatsappApplication'][_0xebe4('0x7c')](_0x5bf7e9,{'transaction':_0x3d9ed9});});})[_0xebe4('0x35')](function(){return db[_0xebe4('0x7b')][_0xebe4('0x7d')]({'where':{'WhatsappAccountId':_0x309f73['params']['id']},'order':_0xebe4('0x7e')});});}})['then'](respondWithResult(_0x51fb7b,null))['catch'](handleError(_0x51fb7b,null));};exports[_0xebe4('0x7f')]=function(_0x4e741f,_0x1b17ca,_0x3c1ffa){var _0x39200d={};var _0x1f8d12={};var _0x5aad83;var _0x99118;return db[_0xebe4('0x3e')][_0xebe4('0x6d')]({'where':{'id':_0x4e741f[_0xebe4('0x54')]['id']}})[_0xebe4('0x35')](handleEntityNotFound(_0x1b17ca,null))[_0xebe4('0x35')](function(_0x311963){if(_0x311963){_0x5aad83=_0x311963;_0x1f8d12[_0xebe4('0x41')]=_[_0xebe4('0x42')](db[_0xebe4('0x7b')]['rawAttributes']);_0x1f8d12[_0xebe4('0x43')]=_[_0xebe4('0x42')](_0x4e741f[_0xebe4('0x43')]);_0x1f8d12[_0xebe4('0x4c')]=_[_0xebe4('0x44')](_0x1f8d12[_0xebe4('0x41')],_0x1f8d12['query']);_0x39200d[_0xebe4('0x46')]=_['intersection'](_0x1f8d12['model'],qs[_0xebe4('0x45')](_0x4e741f['query']['fields']));_0x39200d[_0xebe4('0x46')]=_0x39200d[_0xebe4('0x46')][_0xebe4('0x47')]?_0x39200d[_0xebe4('0x46')]:_0x1f8d12[_0xebe4('0x41')];_0x39200d['order']=qs[_0xebe4('0x4a')](_0x4e741f[_0xebe4('0x43')]['sort']);_0x39200d[_0xebe4('0x4b')]=qs['filters'](_['pick'](_0x4e741f['query'],_0x1f8d12[_0xebe4('0x4c')]));if(_0x4e741f['query'][_0xebe4('0x4d')]){_0x39200d['where']=_[_0xebe4('0x4f')](_0x39200d[_0xebe4('0x4b')],{'$or':_[_0xebe4('0x3d')](_0x39200d[_0xebe4('0x46')],function(_0x790c4b){var _0x2f40ed={};_0x2f40ed[_0x790c4b]={'$like':'%'+_0x4e741f['query'][_0xebe4('0x4d')]+'%'};return _0x2f40ed;})});}_0x39200d=_[_0xebe4('0x4f')]({},_0x39200d,_0x4e741f[_0xebe4('0x50')]);return _0x5aad83[_0xebe4('0x7f')](_0x39200d);}})[_0xebe4('0x35')](function(_0x193561){if(_0x193561){_0x99118=_0x193561[_0xebe4('0x47')];if(!_0x4e741f[_0xebe4('0x43')][_0xebe4('0x66')](_0xebe4('0x48'))){_0x39200d[_0xebe4('0x30')]=qs[_0xebe4('0x30')](_0x4e741f[_0xebe4('0x43')]['limit']);_0x39200d[_0xebe4('0x2e')]=qs[_0xebe4('0x2e')](_0x4e741f[_0xebe4('0x43')][_0xebe4('0x2e')]);}return _0x5aad83[_0xebe4('0x7f')](_0x39200d);}})[_0xebe4('0x35')](function(_0x34df9d){if(_0x34df9d){return _0x34df9d?{'count':_0x99118,'rows':_0x34df9d}:null;}})[_0xebe4('0x35')](respondWithResult(_0x1b17ca,null))[_0xebe4('0x29')](handleError(_0x1b17ca,null));};exports[_0xebe4('0x80')]=function(_0x4f1fc6,_0x254086,_0x5bc240){var _0x30f364={'channel':_0xebe4('0x81')};var _0x483eb1=[];var _0x1425ed=[];var _0x624083={};return db[_0xebe4('0x3e')]['find']({'where':{'id':_0x4f1fc6[_0xebe4('0x54')]['id']},'include':[{'model':db[_0xebe4('0x7b')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x254086,null))['then'](function(_0x5ce361){_0x30f364['account']=_0x5ce361;_0x30f364[_0xebe4('0x82')]=_['orderBy'](_0x5ce361[_0xebe4('0x83')],[_0xebe4('0x7e')],[_0xebe4('0x84')]);if(_0x30f364[_0xebe4('0x85')][_0xebe4('0x83')]){delete _0x30f364[_0xebe4('0x85')][_0xebe4('0x83')];}return db['CmContact'][_0xebe4('0x62')]();})[_0xebe4('0x35')](function(_0x2aa214){if(!_0x2aa214){throw new db[(_0xebe4('0x86'))]['ValidationError'](_0xebe4('0x87'));}_0x483eb1=_[_0xebe4('0x88')](_[_0xebe4('0x42')](_0x2aa214),['createdAt','updatedAt']);_0x1425ed=_['difference'](_['keys'](_0x2aa214),['createdAt',_0xebe4('0x89'),'CompanyId',_0xebe4('0x8a')]);_0x30f364[_0xebe4('0x59')]={'mapKey':_0xebe4('0x8b')};if(_0x30f364[_0xebe4('0x85')][_0xebe4('0x40')]&&_0x30f364[_0xebe4('0x85')]['type']===_0xebe4('0x8c')){_0x30f364[_0xebe4('0x59')]['from']=_0x4f1fc6[_0xebe4('0x59')]['From']['replace'](_0xebe4('0x8d'),'');_0x30f364['body'][_0xebe4('0x59')]=_0x4f1fc6[_0xebe4('0x59')]['Body'];_0x30f364[_0xebe4('0x59')][_0xebe4('0x8e')]=_0x4f1fc6['body']['MessageSid'];}if(_0x30f364['body']['id']){delete _0x30f364[_0xebe4('0x59')]['id'];}if(_[_0xebe4('0x8f')](_0x30f364['body'][_0xebe4('0x90')])){throw new db[(_0xebe4('0x86'))][(_0xebe4('0x91'))](_0xebe4('0x92'));}if(_[_0xebe4('0x8f')](_0x30f364[_0xebe4('0x59')]['body'])||_0x30f364[_0xebe4('0x59')][_0xebe4('0x59')]===''){throw new db[(_0xebe4('0x86'))][(_0xebe4('0x91'))](_0xebe4('0x93'));}if(_['isNil'](_0x30f364[_0xebe4('0x59')][_0xebe4('0x94')])){throw new db[(_0xebe4('0x86'))][(_0xebe4('0x91'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1425ed);}if(!_[_0xebe4('0x95')](_0x1425ed,_0x30f364[_0xebe4('0x59')]['mapKey'])){throw new db[(_0xebe4('0x86'))][(_0xebe4('0x91'))](_0xebe4('0x96')+_0x1425ed);}_0x624083[_0x30f364['body'][_0xebe4('0x94')]]=_0x30f364[_0xebe4('0x59')]['from'];return db[_0xebe4('0x97')][_0xebe4('0x57')]({'where':{'id':_0x30f364[_0xebe4('0x85')][_0xebe4('0x8a')]},'include':[{'model':db[_0xebe4('0x98')],'as':'Contacts','where':_0x624083,'limit':0x1,'order':[[_0xebe4('0x89'),_0xebe4('0x99')]]}]});})['then'](handleEntityNotFound(_0x254086,null))[_0xebe4('0x35')](function(_0x2f57b7){if(_0x2f57b7){_0x30f364[_0xebe4('0x9a')]=_[_0xebe4('0x72')](_0x2f57b7,[_0xebe4('0x9b')]);if(_0x2f57b7['Contacts']['length']){return _0x2f57b7[_0xebe4('0x9b')][0x0];}var _0x68433=_[_0xebe4('0x17')](_0x30f364[_0xebe4('0x59')],{'firstName':_0x30f364[_0xebe4('0x59')][_0xebe4('0x90')],'ListId':_0x2f57b7['id']});_0x68433[_0x30f364[_0xebe4('0x59')][_0xebe4('0x94')]]=_0x30f364[_0xebe4('0x59')][_0xebe4('0x90')];return db[_0xebe4('0x98')]['create'](_0x68433,{'fields':_0x483eb1,'raw':!![]});}})[_0xebe4('0x35')](handleEntityNotFound(_0x254086,null))[_0xebe4('0x35')](function(_0x4d07c8){if(_0x4d07c8){_0x30f364['contact']=_0x4d07c8;var _0x530232={'ContactId':_0x4d07c8['id'],'phone':_0x30f364['body'][_0xebe4('0x90')],'WhatsappAccountId':_0x4f1fc6[_0xebe4('0x54')]['id']};var _0x57f983={'ContactId':_0x4d07c8['id'],'WhatsappAccountId':_0x4f1fc6[_0xebe4('0x54')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xebe4('0x57')]({'where':_0x57f983})['then'](function(_0x5f2b52){if(_0x5f2b52){return[_0x5f2b52,![]];}return db['WhatsappInteraction'][_0xebe4('0x58')](_0x530232)[_0xebe4('0x35')](function(_0x54f852){return[_0x54f852,!![]];});});}})[_0xebe4('0x73')](function(_0x3f7333,_0x3b1bd1){_0x30f364[_0xebe4('0x9c')]=_0x3f7333[_0xebe4('0x5b')]({'plain':!![]});_0x30f364[_0xebe4('0x9c')][_0xebe4('0x9d')]=![];if(_0x3b1bd1){if(_0x30f364[_0xebe4('0x85')][_0xebe4('0x9e')]){_0x30f364[_0xebe4('0x82')][_0xebe4('0x9f')]({'id':0x0,'priority':_0x30f364[_0xebe4('0x82')]['length']+0x1,'app':_0xebe4('0xa0'),'appdata':_0xebe4('0xa1'),'interval':_0xebe4('0xa2')});}_0x30f364[_0xebe4('0x9c')][_0xebe4('0x9d')]=!![];}return db['WhatsappMessage'][_0xebe4('0x58')]({'phone':_0x30f364[_0xebe4('0x59')][_0xebe4('0x90')],'messageId':_0x30f364[_0xebe4('0x59')]['messageId'],'body':_0x30f364[_0xebe4('0x59')][_0xebe4('0x59')],'WhatsappAccountId':_0x4f1fc6[_0xebe4('0x54')]['id'],'WhatsappInteractionId':_0x3f7333['id'],'direction':'in','ContactId':_0x3f7333[_0xebe4('0xa3')],'AttachmentId':_0x30f364['body'][_0xebe4('0xa4')]});})[_0xebe4('0x35')](function(_0x226d9f){_0x30f364[_0xebe4('0x27')]=_0x226d9f;if(_0x30f364[_0xebe4('0x9c')][_0xebe4('0xa5')]){return db[_0xebe4('0xa6')][_0xebe4('0x57')]({'attributes':['id','name'],'where':{'id':_0x30f364[_0xebe4('0x9c')][_0xebe4('0xa5')]}})['then'](function(_0x3d6a39){if(_0x3d6a39){_0x30f364[_0xebe4('0x82')][_0xebe4('0xa7')]({'id':0x0,'priority':0x0,'app':_0xebe4('0xa8'),'appdata':_0x3d6a39[_0xebe4('0x39')]+','+(_0x30f364[_0xebe4('0x85')][_0xebe4('0xa9')]||0xa),'interval':_0xebe4('0xa2')});}return respondWithRpcPromise('Start',_0xebe4('0xaa'),_0x30f364);});}return respondWithRpcPromise(_0xebe4('0xab'),_0xebe4('0xaa'),_0x30f364);})[_0xebe4('0x35')](function(_0x48ec2f){if(_0x48ec2f){var _0x9f9295=0xc8;var _0x401cf8=_0xebe4('0xac');logger[_0xebe4('0x20')](_0xebe4('0x23'),_0x401cf8,_0x9f9295,_0xebe4('0xad'));logger[_0xebe4('0xae')](_0xebe4('0xaf'),_0x401cf8,_0x9f9295,_0xebe4('0xad'),JSON[_0xebe4('0x24')](_0x48ec2f));if(_0x30f364['account'][_0xebe4('0x40')]===_0xebe4('0x8c')){return _0x254086[_0xebe4('0x2b')](_0x9f9295)[_0xebe4('0xb0')](_0xebe4('0xb1'),_0xebe4('0xb2'))['send'](_0xebe4('0xb3'));}else{return _0x254086['status'](_0x9f9295)[_0xebe4('0x2d')](_0x48ec2f);}}})['catch'](handleError(_0x254086,null));};exports[_0xebe4('0x3a')]=function(_0x3be6d4,_0x1a8a67,_0x387ff3){var _0x13884f,_0x306b38,_0x27f378;if(_[_0xebe4('0x8f')](_0x3be6d4[_0xebe4('0x59')][_0xebe4('0x59')])||_0x3be6d4[_0xebe4('0x59')]['body']===''){throw new db['Sequelize'][(_0xebe4('0x91'))](_0xebe4('0x93'));}if(_[_0xebe4('0x8f')](_0x3be6d4[_0xebe4('0x59')]['to'])){throw new db[(_0xebe4('0x86'))]['ValidationError'](_0xebe4('0xb4'));}_0x13884f=_0x3be6d4['body']['to'];return db[_0xebe4('0x3e')][_0xebe4('0x57')]({'where':{'id':_0x3be6d4[_0xebe4('0x54')]['id']},'include':[{'model':db[_0xebe4('0x97')],'as':_0xebe4('0xb5'),'include':[{'model':db[_0xebe4('0x98')],'as':'Contacts','where':{'mobile':_0x13884f},'limit':0x1,'order':[[_0xebe4('0x89'),'DESC']]}]}]})[_0xebe4('0x35')](handleEntityNotFound(_0x1a8a67,null))['then'](function(_0x17df14){if(_0x17df14&&_0x17df14[_0xebe4('0xb5')]){_0x306b38=_0x17df14[_0xebe4('0x5b')]({'plain':!![]});if(_0x306b38[_0xebe4('0xb5')]&&_0x306b38['List'][_0xebe4('0x9b')][_0xebe4('0x47')]){return _0x306b38[_0xebe4('0xb5')][_0xebe4('0x9b')][0x0];}return db[_0xebe4('0x98')][_0xebe4('0x58')](_[_0xebe4('0x17')](_0x3be6d4[_0xebe4('0x59')],{'firstName':_0x13884f,'mobile':_0x13884f,'phone':_0x13884f,'ListId':_0x306b38[_0xebe4('0x8a')]}));}})[_0xebe4('0x35')](handleEntityNotFound(_0x1a8a67,null))['then'](function(_0x4acfca){if(_0x4acfca){_0x27f378=_0x4acfca;return db['WhatsappInteraction']['find']({'where':{'ContactId':_0x27f378['id'],'closed':![],'WhatsappAccountId':_0x306b38['id']}})[_0xebe4('0x35')](function(_0x341e29){if(_0x341e29){return[_0x341e29,![]];}return db['WhatsappInteraction'][_0xebe4('0x58')]({'UserId':_0x3be6d4[_0xebe4('0x5a')]['id'],'ContactId':_0x27f378['id'],'WhatsappAccountId':_0x306b38['id'],'phone':_0x13884f,'firstMsgDirection':'out','Messages':[_[_0xebe4('0x4f')](_0x3be6d4[_0xebe4('0x59')],{'read':![],'body':_0x3be6d4['body'][_0xebe4('0x59')],'phone':_0x13884f,'WhatsappAccountId':_0x306b38['id'],'UserId':_0x3be6d4['user']['id'],'ContactId':_0x27f378['id']})]},{'include':[{'model':db[_0xebe4('0xb6')],'as':_0xebe4('0xb7')}]})[_0xebe4('0x35')](function(_0x877592){return[_0x877592,!![]];});});}})[_0xebe4('0x73')](function(_0x227e26,_0x2c6604){if(_0x2c6604){return _0x227e26;}return db['WhatsappMessage'][_0xebe4('0x58')](_[_0xebe4('0x4f')](_0x3be6d4[_0xebe4('0x59')],{'read':![],'body':_0x3be6d4[_0xebe4('0x59')]['body'],'phone':_0x13884f,'WhatsappAccountId':_0x306b38['id'],'WhatsappInteractionId':_0x227e26['id'],'UserId':_0x3be6d4[_0xebe4('0x5a')]['id'],'ContactId':_0x27f378['id']}))[_0xebe4('0x35')](function(_0x3b9705){_0x227e26['dataValues'][_0xebe4('0xb7')]=[];_0x227e26[_0xebe4('0xb8')][_0xebe4('0xb7')][_0xebe4('0x9f')](_0x3b9705[_0xebe4('0xb8')]);return _0x227e26;});})[_0xebe4('0x35')](respondWithResult(_0x1a8a67,null))[_0xebe4('0x29')](handleError(_0x1a8a67,null));};
\ No newline at end of file
index a6c1911..8a19c6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3ec=['save','remove','emit','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x5c12ac,_0x264499){var _0x33f13e=function(_0x19804c){while(--_0x19804c){_0x5c12ac['push'](_0x5c12ac['shift']());}};_0x33f13e(++_0x264499);}(_0xc3ec,0xb9));var _0xcc3e=function(_0x393198,_0x3b75ba){_0x393198=_0x393198-0x0;var _0x474589=_0xc3ec[_0x393198];return _0x474589;};'use strict';var EventEmitter=require(_0xcc3e('0x0'));var WhatsappAccount=require(_0xcc3e('0x1'))['db'][_0xcc3e('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xcc3e('0x3')](0x0);var events={'afterCreate':_0xcc3e('0x4'),'afterUpdate':'update','afterDestroy':_0xcc3e('0x5')};function emitEvent(_0x24514f){return function(_0x3e6f6b,_0x430e56,_0x1647e6){WhatsappAccountEvents[_0xcc3e('0x6')](_0x24514f+':'+_0x3e6f6b['id'],_0x3e6f6b);WhatsappAccountEvents[_0xcc3e('0x6')](_0x24514f,_0x3e6f6b);_0x1647e6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xcc3e('0x7')](e,emitEvent(event));}}module[_0xcc3e('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x5890=['events','WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5890,0x75));var _0x0589=function(_0x5e2a3a,_0x3f4bcf){_0x5e2a3a=_0x5e2a3a-0x0;var _0x2761c4=_0x5890[_0x5e2a3a];return _0x2761c4;};'use strict';var EventEmitter=require(_0x0589('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x0589('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0589('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0589('0x3'),'afterDestroy':_0x0589('0x4')};function emitEvent(_0x170562){return function(_0x5b7edc,_0x384d41,_0x36e7e5){WhatsappAccountEvents[_0x0589('0x5')](_0x170562+':'+_0x5b7edc['id'],_0x5b7edc);WhatsappAccountEvents['emit'](_0x170562,_0x5b7edc);_0x36e7e5(null);};}for(var e in events){if(events[_0x0589('0x6')](e)){var event=events[e];WhatsappAccount[_0x0589('0x7')](e,emitEvent(event));}}module[_0x0589('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
index c65e8bd..edf0543 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97db=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','whatsapp_accounts','lodash','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x97db,0x76));var _0xb97d=function(_0x2572f0,_0x5daa5d){_0x2572f0=_0x2572f0-0x0;var _0x527172=_0x97db[_0x2572f0];return _0x527172;};'use strict';var _=require(_0xb97d('0x0'));var util=require('util');var logger=require(_0xb97d('0x1'))(_0xb97d('0x2'));var moment=require(_0xb97d('0x3'));var BPromise=require(_0xb97d('0x4'));var rp=require(_0xb97d('0x5'));var fs=require('fs');var path=require(_0xb97d('0x6'));var rimraf=require(_0xb97d('0x7'));var config=require(_0xb97d('0x8'));var attributes=require(_0xb97d('0x9'));module[_0xb97d('0xa')]=function(_0x2e7563,_0x50126c){return _0x2e7563['define']('WhatsappAccount',attributes,{'tableName':_0xb97d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1650=['moment','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api'];(function(_0x2d0007,_0x33c735){var _0x4417f8=function(_0x2bb0ce){while(--_0x2bb0ce){_0x2d0007['push'](_0x2d0007['shift']());}};_0x4417f8(++_0x33c735);}(_0x1650,0x167));var _0x0165=function(_0x2f6233,_0x90172){_0x2f6233=_0x2f6233-0x0;var _0x1c9c36=_0x1650[_0x2f6233];return _0x1c9c36;};'use strict';var _=require(_0x0165('0x0'));var util=require(_0x0165('0x1'));var logger=require(_0x0165('0x2'))(_0x0165('0x3'));var moment=require(_0x0165('0x4'));var BPromise=require('bluebird');var rp=require(_0x0165('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0165('0x6'));var config=require(_0x0165('0x7'));var attributes=require(_0x0165('0x8'));module['exports']=function(_0x4d0ddb,_0x41a3c2){return _0x4d0ddb['define'](_0x0165('0x9'),attributes,{'tableName':_0x0165('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e985ed0..cc385c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x974f=['find','options','raw','where','attributes','include','map','model','debug','util','moment','bluebird','randomstring','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','info','request\x20sent','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x974f,0x85));var _0xf974=function(_0x14cfb8,_0x4db5ea){_0x14cfb8=_0x14cfb8-0x0;var _0x342994=_0x974f[_0x14cfb8];return _0x342994;};'use strict';var _=require('lodash');var util=require(_0xf974('0x0'));var moment=require(_0xf974('0x1'));var BPromise=require(_0xf974('0x2'));var rs=require(_0xf974('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf974('0x4'));var client=jayson[_0xf974('0x5')][_0xf974('0x6')]({'port':0x232a});config[_0xf974('0x7')]=_[_0xf974('0x8')](config[_0xf974('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xf974('0x9'))(new Redis(config[_0xf974('0x7')]));require(_0xf974('0xa'))[_0xf974('0xb')](socket);function respondWithRpcPromise(_0x3a7bbe,_0x1ee421,_0x4d82cb){return new BPromise(function(_0x933f8f,_0x4c7b0a){return client['request'](_0x3a7bbe,_0x4d82cb)['then'](function(_0x3dfdb2){logger[_0xf974('0xc')]('WhatsappAccount,\x20%s,\x20%s',_0x1ee421,'request\x20sent');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1ee421,_0xf974('0xd'),JSON[_0xf974('0xe')](_0x3dfdb2));if(_0x3dfdb2['error']){if(_0x3dfdb2[_0xf974('0xf')]['code']===0x1f4){logger[_0xf974('0xf')](_0xf974('0x10'),_0x1ee421,_0x3dfdb2[_0xf974('0xf')][_0xf974('0x11')]);return _0x4c7b0a(_0x3dfdb2[_0xf974('0xf')]['message']);}logger[_0xf974('0xf')](_0xf974('0x10'),_0x1ee421,_0x3dfdb2[_0xf974('0xf')]['message']);return _0x933f8f(_0x3dfdb2[_0xf974('0xf')]['message']);}else{logger[_0xf974('0xc')](_0xf974('0x10'),_0x1ee421,_0xf974('0xd'));_0x933f8f(_0x3dfdb2[_0xf974('0x12')][_0xf974('0x11')]);}})[_0xf974('0x13')](function(_0x1a7e51){logger[_0xf974('0xf')](_0xf974('0x10'),_0x1ee421,_0x1a7e51);_0x4c7b0a(_0x1a7e51);});});}exports[_0xf974('0x14')]=function(_0x1badf5){var _0xabcda1=this;return new Promise(function(_0x5e78f3,_0x4c5cd1){return db[_0xf974('0x15')][_0xf974('0x16')]({'raw':_0x1badf5[_0xf974('0x17')]?_0x1badf5['options'][_0xf974('0x18')]===undefined?!![]:![]:!![],'where':_0x1badf5[_0xf974('0x17')]?_0x1badf5[_0xf974('0x17')][_0xf974('0x19')]||null:null,'attributes':_0x1badf5[_0xf974('0x17')]?_0x1badf5[_0xf974('0x17')][_0xf974('0x1a')]||null:null,'include':_0x1badf5['options']?_0x1badf5['options'][_0xf974('0x1b')]?_[_0xf974('0x1c')](_0x1badf5[_0xf974('0x17')][_0xf974('0x1b')],function(_0x939e9){return{'model':db[_0x939e9[_0xf974('0x1d')]],'as':_0x939e9['as'],'attributes':_0x939e9[_0xf974('0x1a')],'include':_0x939e9[_0xf974('0x1b')]?_[_0xf974('0x1c')](_0x939e9[_0xf974('0x1b')],function(_0x123761){return{'model':db[_0x123761['model']],'as':_0x123761['as'],'attributes':_0x123761['attributes'],'include':_0x123761[_0xf974('0x1b')]?_[_0xf974('0x1c')](_0x123761[_0xf974('0x1b')],function(_0x2baa78){return{'model':db[_0x2baa78['model']],'as':_0x2baa78['as'],'attributes':_0x2baa78[_0xf974('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31b7b7){logger['info']('ShowWhatsappAccount',_0x1badf5);logger[_0xf974('0x1e')](_0xf974('0x14'),_0x1badf5,JSON['stringify'](_0x31b7b7));_0x5e78f3(_0x31b7b7);})[_0xf974('0x13')](function(_0x42ceca){logger[_0xf974('0xf')](_0xf974('0x14'),_0x42ceca[_0xf974('0x11')],_0x1badf5);_0x4c5cd1(_0xabcda1[_0xf974('0xf')](0x1f4,_0x42ceca[_0xf974('0x11')]));});});};
\ No newline at end of file
+var _0xccde=['../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','include','map','model','attributes','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xccde,0x113));var _0xeccd=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0xccde[_0x4c8a8f];return _0x404500;};'use strict';var _=require('lodash');var util=require(_0xeccd('0x0'));var moment=require('moment');var BPromise=require(_0xeccd('0x1'));var rs=require(_0xeccd('0x2'));var fs=require('fs');var Redis=require(_0xeccd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xeccd('0x4'));var logger=require(_0xeccd('0x5'))('rpc');var config=require(_0xeccd('0x6'));var jayson=require(_0xeccd('0x7'));var client=jayson[_0xeccd('0x8')]['http']({'port':0x232a});config[_0xeccd('0x9')]=_['defaults'](config[_0xeccd('0x9')],{'host':_0xeccd('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeccd('0x9')]));require(_0xeccd('0xb'))[_0xeccd('0xc')](socket);function respondWithRpcPromise(_0x4e13ce,_0x29f6e8,_0x4e382f){return new BPromise(function(_0x20a31b,_0x341e01){return client[_0xeccd('0xd')](_0x4e13ce,_0x4e382f)[_0xeccd('0xe')](function(_0x5d0da4){logger['info'](_0xeccd('0xf'),_0x29f6e8,'request\x20sent');logger[_0xeccd('0x10')](_0xeccd('0x11'),_0x29f6e8,_0xeccd('0x12'),JSON[_0xeccd('0x13')](_0x5d0da4));if(_0x5d0da4[_0xeccd('0x14')]){if(_0x5d0da4[_0xeccd('0x14')][_0xeccd('0x15')]===0x1f4){logger[_0xeccd('0x14')](_0xeccd('0xf'),_0x29f6e8,_0x5d0da4[_0xeccd('0x14')][_0xeccd('0x16')]);return _0x341e01(_0x5d0da4['error'][_0xeccd('0x16')]);}logger['error'](_0xeccd('0xf'),_0x29f6e8,_0x5d0da4[_0xeccd('0x14')]['message']);return _0x20a31b(_0x5d0da4[_0xeccd('0x14')][_0xeccd('0x16')]);}else{logger[_0xeccd('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x29f6e8,'request\x20sent');_0x20a31b(_0x5d0da4['result'][_0xeccd('0x16')]);}})[_0xeccd('0x18')](function(_0xe6346){logger[_0xeccd('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x29f6e8,_0xe6346);_0x341e01(_0xe6346);});});}exports[_0xeccd('0x19')]=function(_0x228435){var _0x23d39d=this;return new Promise(function(_0x43d46c,_0x4d2d06){return db[_0xeccd('0x1a')][_0xeccd('0x1b')]({'raw':_0x228435[_0xeccd('0x1c')]?_0x228435[_0xeccd('0x1c')][_0xeccd('0x1d')]===undefined?!![]:![]:!![],'where':_0x228435[_0xeccd('0x1c')]?_0x228435[_0xeccd('0x1c')][_0xeccd('0x1e')]||null:null,'attributes':_0x228435[_0xeccd('0x1c')]?_0x228435[_0xeccd('0x1c')]['attributes']||null:null,'include':_0x228435[_0xeccd('0x1c')]?_0x228435[_0xeccd('0x1c')][_0xeccd('0x1f')]?_[_0xeccd('0x20')](_0x228435['options'][_0xeccd('0x1f')],function(_0x20ac22){return{'model':db[_0x20ac22[_0xeccd('0x21')]],'as':_0x20ac22['as'],'attributes':_0x20ac22[_0xeccd('0x22')],'include':_0x20ac22[_0xeccd('0x1f')]?_[_0xeccd('0x20')](_0x20ac22[_0xeccd('0x1f')],function(_0x4c5adc){return{'model':db[_0x4c5adc[_0xeccd('0x21')]],'as':_0x4c5adc['as'],'attributes':_0x4c5adc[_0xeccd('0x22')],'include':_0x4c5adc[_0xeccd('0x1f')]?_[_0xeccd('0x20')](_0x4c5adc['include'],function(_0x263979){return{'model':db[_0x263979[_0xeccd('0x21')]],'as':_0x263979['as'],'attributes':_0x263979[_0xeccd('0x22')]};}):[]};}):[]};}):[]:[]})[_0xeccd('0xe')](function(_0x266096){logger[_0xeccd('0x17')]('ShowWhatsappAccount',_0x228435);logger[_0xeccd('0x10')](_0xeccd('0x19'),_0x228435,JSON['stringify'](_0x266096));_0x43d46c(_0x266096);})[_0xeccd('0x18')](function(_0x39424b){logger['error'](_0xeccd('0x19'),_0x39424b[_0xeccd('0x16')],_0x228435);_0x4d2d06(_0x23d39d[_0xeccd('0x14')](0x1f4,_0x39424b[_0xeccd('0x16')]));});});};
\ No newline at end of file
index c1465ee..468f46d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d09=['length','whatsappAccount:','./whatsappAccount.events','save','remove','register'];(function(_0x502c06,_0x3d5be6){var _0x4ae249=function(_0x3a724e){while(--_0x3a724e){_0x502c06['push'](_0x502c06['shift']());}};_0x4ae249(++_0x3d5be6);}(_0x1d09,0x140));var _0x91d0=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0x1d09[_0x56fe98];return _0x212f4f;};'use strict';var WhatsappAccountEvents=require(_0x91d0('0x0'));var events=[_0x91d0('0x1'),_0x91d0('0x2'),'update'];function createListener(_0x46ee36,_0xc2ea4e){return function(_0x4c6904){_0xc2ea4e['emit'](_0x46ee36,_0x4c6904);};}function removeListener(_0x47f2d6,_0x21bc73){return function(){WhatsappAccountEvents['removeListener'](_0x47f2d6,_0x21bc73);};}exports[_0x91d0('0x3')]=function(_0x4ea283){for(var _0x3639eb=0x0,_0x3e69aa=events[_0x91d0('0x4')];_0x3639eb<_0x3e69aa;_0x3639eb++){var _0x4011df=events[_0x3639eb];var _0x390cb3=createListener(_0x91d0('0x5')+_0x4011df,_0x4ea283);WhatsappAccountEvents['on'](_0x4011df,_0x390cb3);}};
\ No newline at end of file
+var _0xb328=['remove','emit','removeListener','length','./whatsappAccount.events'];(function(_0x2a27de,_0x4aaa18){var _0x4335d=function(_0xc8eb38){while(--_0xc8eb38){_0x2a27de['push'](_0x2a27de['shift']());}};_0x4335d(++_0x4aaa18);}(_0xb328,0x19e));var _0x8b32=function(_0x390818,_0x550e33){_0x390818=_0x390818-0x0;var _0x79e722=_0xb328[_0x390818];return _0x79e722;};'use strict';var WhatsappAccountEvents=require(_0x8b32('0x0'));var events=['save',_0x8b32('0x1'),'update'];function createListener(_0x3ce0ab,_0x2247aa){return function(_0x37e681){_0x2247aa[_0x8b32('0x2')](_0x3ce0ab,_0x37e681);};}function removeListener(_0x31526e,_0x4d8389){return function(){WhatsappAccountEvents[_0x8b32('0x3')](_0x31526e,_0x4d8389);};}exports['register']=function(_0x202698){for(var _0x8c90c=0x0,_0x3ee471=events[_0x8b32('0x4')];_0x8c90c<_0x3ee471;_0x8c90c++){var _0xdd55ea=events[_0x8c90c];var _0x57894c=createListener('whatsappAccount:'+_0xdd55ea,_0x202698);WhatsappAccountEvents['on'](_0xdd55ea,_0x57894c);}};
\ No newline at end of file
index 16791ce..24ec70f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf043=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0xf043,0xe8));var _0x3f04=function(_0x51b0dd,_0x1cb161){_0x51b0dd=_0x51b0dd-0x0;var _0x49a423=_0xf043[_0x51b0dd];return _0x49a423;};'use strict';var multer=require(_0x3f04('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3f04('0x1'));var express=require('express');var router=express[_0x3f04('0x2')]();var fs_extra=require(_0x3f04('0x3'));var auth=require(_0x3f04('0x4'));var interaction=require(_0x3f04('0x5'));var config=require(_0x3f04('0x6'));var controller=require(_0x3f04('0x7'));router[_0x3f04('0x8')]('/',auth[_0x3f04('0x9')](),controller[_0x3f04('0xa')]);router[_0x3f04('0x8')](_0x3f04('0xb'),auth['isAuthenticated'](),controller[_0x3f04('0xc')]);router[_0x3f04('0xd')]('/',auth[_0x3f04('0x9')](),controller[_0x3f04('0xe')]);router[_0x3f04('0xf')](_0x3f04('0xb'),auth[_0x3f04('0x9')](),controller[_0x3f04('0x10')]);router[_0x3f04('0x11')](_0x3f04('0xb'),auth[_0x3f04('0x9')](),controller[_0x3f04('0x12')]);module[_0x3f04('0x13')]=router;
\ No newline at end of file
+var _0x7737=['destroy','exports','multer','util','connect-timeout','Router','./whatsappApplication.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete'];(function(_0xf73dde,_0x11f79b){var _0x2413b1=function(_0x253d28){while(--_0x253d28){_0xf73dde['push'](_0xf73dde['shift']());}};_0x2413b1(++_0x11f79b);}(_0x7737,0x112));var _0x7773=function(_0x50e351,_0x35608c){_0x50e351=_0x50e351-0x0;var _0x418d06=_0x7737[_0x50e351];return _0x418d06;};'use strict';var multer=require(_0x7773('0x0'));var util=require(_0x7773('0x1'));var path=require('path');var timeout=require(_0x7773('0x2'));var express=require('express');var router=express[_0x7773('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(_0x7773('0x4'));router[_0x7773('0x5')]('/',auth[_0x7773('0x6')](),controller[_0x7773('0x7')]);router[_0x7773('0x5')](_0x7773('0x8'),auth[_0x7773('0x6')](),controller['show']);router[_0x7773('0x9')]('/',auth[_0x7773('0x6')](),controller[_0x7773('0xa')]);router[_0x7773('0xb')](_0x7773('0x8'),auth[_0x7773('0x6')](),controller[_0x7773('0xc')]);router[_0x7773('0xd')](_0x7773('0x8'),auth['isAuthenticated'](),controller[_0x7773('0xe')]);module[_0x7773('0xf')]=router;
\ No newline at end of file
index 1a65771..a0a059a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d1=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x13cd99,_0x50bd8d){var _0x1d42c7=function(_0x1fa433){while(--_0x1fa433){_0x13cd99['push'](_0x13cd99['shift']());}};_0x1d42c7(++_0x50bd8d);}(_0x01d1,0x189));var _0x101d=function(_0x4576fe,_0xdeb418){_0x4576fe=_0x4576fe-0x0;var _0x501123=_0x01d1[_0x4576fe];return _0x501123;};'use strict';var Sequelize=require(_0x101d('0x0'));module[_0x101d('0x1')]={'priority':{'type':Sequelize[_0x101d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x101d('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x101d('0x4')]()},'description':{'type':Sequelize[_0x101d('0x3')]},'interval':{'type':Sequelize[_0x101d('0x3')],'defaultValue':_0x101d('0x5')}};
\ No newline at end of file
+var _0xdb47=['exports','STRING','noop','sequelize'];(function(_0x3acd2d,_0x388d83){var _0x12cc72=function(_0x106d5a){while(--_0x106d5a){_0x3acd2d['push'](_0x3acd2d['shift']());}};_0x12cc72(++_0x388d83);}(_0xdb47,0x16f));var _0x7db4=function(_0x4f3e4a,_0x6d741d){_0x4f3e4a=_0x4f3e4a-0x0;var _0x2e9202=_0xdb47[_0x4f3e4a];return _0x2e9202;};'use strict';var Sequelize=require(_0x7db4('0x0'));module[_0x7db4('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7db4('0x2')],'allowNull':![],'defaultValue':_0x7db4('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7db4('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index af37c90..13c767f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa467=['hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','show','params','rawAttributes','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','then','destroy','error','stack','name','send','index','WhatsappApplication','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length'];(function(_0x4a9cfa,_0x40c434){var _0x95872f=function(_0x2b1cb2){while(--_0x2b1cb2){_0x4a9cfa['push'](_0x4a9cfa['shift']());}};_0x95872f(++_0x40c434);}(_0xa467,0x143));var _0x7a46=function(_0x402506,_0x34ab7c){_0x402506=_0x402506-0x0;var _0x4699c7=_0xa467[_0x402506];return _0x4699c7;};'use strict';var emlformat=require(_0x7a46('0x0'));var rimraf=require(_0x7a46('0x1'));var zipdir=require(_0x7a46('0x2'));var jsonpatch=require(_0x7a46('0x3'));var rp=require(_0x7a46('0x4'));var moment=require(_0x7a46('0x5'));var BPromise=require(_0x7a46('0x6'));var Mustache=require(_0x7a46('0x7'));var util=require(_0x7a46('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x7a46('0x9'));var ejs=require(_0x7a46('0xa'));var fs=require('fs');var fs_extra=require(_0x7a46('0xb'));var _=require(_0x7a46('0xc'));var squel=require(_0x7a46('0xd'));var crypto=require('crypto');var jsforce=require(_0x7a46('0xe'));var deskjs=require(_0x7a46('0xf'));var toCsv=require(_0x7a46('0x9'));var querystring=require(_0x7a46('0x10'));var Papa=require(_0x7a46('0x11'));var Redis=require(_0x7a46('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7a46('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a46('0x14'));var logger=require('../../config/logger')(_0x7a46('0x15'));var utils=require(_0x7a46('0x16'));var config=require(_0x7a46('0x17'));var licenseUtil=require(_0x7a46('0x18'));var db=require(_0x7a46('0x19'))['db'];function respondWithStatusCode(_0x5da2d3,_0x3ab309){_0x3ab309=_0x3ab309||0xcc;return function(_0x5fa58a){if(_0x5fa58a){return _0x5da2d3[_0x7a46('0x1a')](_0x3ab309);}return _0x5da2d3[_0x7a46('0x1b')](_0x3ab309)[_0x7a46('0x1c')]();};}function respondWithResult(_0x571a46,_0x78220){_0x78220=_0x78220||0xc8;return function(_0x53fd6a){if(_0x53fd6a){return _0x571a46['status'](_0x78220)[_0x7a46('0x1d')](_0x53fd6a);}};}function respondWithFilteredResult(_0x30acd7,_0x5e4f9d){return function(_0x32d58d){if(_0x32d58d){var _0x50704f=typeof _0x5e4f9d[_0x7a46('0x1e')]===_0x7a46('0x1f')&&typeof _0x5e4f9d['limit']===_0x7a46('0x1f');var _0x548cab=_0x32d58d[_0x7a46('0x20')];var _0x3aa0ad=_0x50704f?0x0:_0x5e4f9d[_0x7a46('0x1e')];var _0x279fc8=_0x50704f?_0x32d58d['count']:_0x5e4f9d[_0x7a46('0x1e')]+_0x5e4f9d[_0x7a46('0x21')];var _0x4b96d2;if(_0x279fc8>=_0x548cab){_0x279fc8=_0x548cab;_0x4b96d2=0xc8;}else{_0x4b96d2=0xce;}_0x30acd7[_0x7a46('0x1b')](_0x4b96d2);return _0x30acd7[_0x7a46('0x22')]('Content-Range',_0x3aa0ad+'-'+_0x279fc8+'/'+_0x548cab)['json'](_0x32d58d);}return null;};}function patchUpdates(_0x2cb5b3){return function(_0x1d5766){try{jsonpatch[_0x7a46('0x23')](_0x1d5766,_0x2cb5b3,!![]);}catch(_0x23d54e){return BPromise['reject'](_0x23d54e);}return _0x1d5766[_0x7a46('0x24')]();};}function saveUpdates(_0x2dc8cc,_0x5e9cb5){return function(_0x536e54){if(_0x536e54){return _0x536e54['update'](_0x2dc8cc)[_0x7a46('0x25')](function(_0x99c7ab){return _0x99c7ab;});}return null;};}function removeEntity(_0x57b669,_0x46512d){return function(_0x4b104b){if(_0x4b104b){return _0x4b104b[_0x7a46('0x26')]()[_0x7a46('0x25')](function(){_0x57b669['status'](0xcc)[_0x7a46('0x1c')]();});}};}function handleEntityNotFound(_0x1222ae,_0x107fff){return function(_0x3d9ae4){if(!_0x3d9ae4){_0x1222ae[_0x7a46('0x1a')](0x194);}return _0x3d9ae4;};}function handleError(_0x42f852,_0x27f001){_0x27f001=_0x27f001||0x1f4;return function(_0x595c66){logger[_0x7a46('0x27')](_0x595c66[_0x7a46('0x28')]);if(_0x595c66[_0x7a46('0x29')]){delete _0x595c66[_0x7a46('0x29')];}_0x42f852[_0x7a46('0x1b')](_0x27f001)[_0x7a46('0x2a')](_0x595c66);};}exports[_0x7a46('0x2b')]=function(_0x4d2b68,_0x1c276b){var _0x27b243={},_0x3b35dd={},_0xca2b9b={'count':0x0,'rows':[]};var _0x2b9500=_['map'](db[_0x7a46('0x2c')]['rawAttributes'],function(_0x5b423f){return{'name':_0x5b423f[_0x7a46('0x2d')],'type':_0x5b423f[_0x7a46('0x2e')][_0x7a46('0x2f')]};});_0x3b35dd[_0x7a46('0x30')]=_[_0x7a46('0x31')](_0x2b9500,'name');_0x3b35dd['query']=_[_0x7a46('0x32')](_0x4d2b68[_0x7a46('0x33')]);_0x3b35dd[_0x7a46('0x34')]=_['intersection'](_0x3b35dd[_0x7a46('0x30')],_0x3b35dd[_0x7a46('0x33')]);_0x27b243[_0x7a46('0x35')]=_[_0x7a46('0x36')](_0x3b35dd[_0x7a46('0x30')],qs[_0x7a46('0x37')](_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x37')]));_0x27b243[_0x7a46('0x35')]=_0x27b243[_0x7a46('0x35')][_0x7a46('0x38')]?_0x27b243[_0x7a46('0x35')]:_0x3b35dd[_0x7a46('0x30')];if(!_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x39')](_0x7a46('0x3a'))){_0x27b243['limit']=qs['limit'](_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x21')]);_0x27b243[_0x7a46('0x1e')]=qs[_0x7a46('0x1e')](_0x4d2b68['query'][_0x7a46('0x1e')]);}_0x27b243[_0x7a46('0x3b')]=qs['sort'](_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x3c')]);_0x27b243[_0x7a46('0x3d')]=qs['filters'](_['pick'](_0x4d2b68[_0x7a46('0x33')],_0x3b35dd[_0x7a46('0x34')]),_0x2b9500);if(_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x3e')]){_0x27b243[_0x7a46('0x3d')]=_[_0x7a46('0x3f')](_0x27b243[_0x7a46('0x3d')],{'$or':_['map'](_0x2b9500,function(_0x517054){if(_0x517054[_0x7a46('0x2e')]!==_0x7a46('0x40')){var _0x50233e={};_0x50233e[_0x517054[_0x7a46('0x29')]]={'$like':'%'+_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x3e')]+'%'};return _0x50233e;}})});}_0x27b243=_[_0x7a46('0x3f')]({},_0x27b243,_0x4d2b68[_0x7a46('0x41')]);var _0x3630a2={'where':_0x27b243[_0x7a46('0x3d')]};return db[_0x7a46('0x2c')][_0x7a46('0x20')](_0x3630a2)['then'](function(_0x332ba0){_0xca2b9b[_0x7a46('0x20')]=_0x332ba0;if(_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x42')]){_0x27b243[_0x7a46('0x43')]=[{'all':!![]}];}return db[_0x7a46('0x2c')]['findAll'](_0x27b243);})[_0x7a46('0x25')](function(_0x328d25){_0xca2b9b['rows']=_0x328d25;return _0xca2b9b;})[_0x7a46('0x25')](respondWithFilteredResult(_0x1c276b,_0x27b243))['catch'](handleError(_0x1c276b,null));};exports[_0x7a46('0x44')]=function(_0x3776a3,_0xf75969){var _0x3df66b={'raw':!![],'where':{'id':_0x3776a3[_0x7a46('0x45')]['id']}},_0x221c29={};_0x221c29[_0x7a46('0x30')]=_['keys'](db[_0x7a46('0x2c')][_0x7a46('0x46')]);_0x221c29[_0x7a46('0x33')]=_['keys'](_0x3776a3[_0x7a46('0x33')]);_0x221c29[_0x7a46('0x34')]=_[_0x7a46('0x36')](_0x221c29['model'],_0x221c29[_0x7a46('0x33')]);_0x3df66b[_0x7a46('0x35')]=_[_0x7a46('0x36')](_0x221c29[_0x7a46('0x30')],qs['fields'](_0x3776a3['query'][_0x7a46('0x37')]));_0x3df66b[_0x7a46('0x35')]=_0x3df66b[_0x7a46('0x35')][_0x7a46('0x38')]?_0x3df66b['attributes']:_0x221c29[_0x7a46('0x30')];if(_0x3776a3[_0x7a46('0x33')][_0x7a46('0x42')]){_0x3df66b[_0x7a46('0x43')]=[{'all':!![]}];}_0x3df66b=_[_0x7a46('0x3f')]({},_0x3df66b,_0x3776a3['options']);return db[_0x7a46('0x2c')][_0x7a46('0x47')](_0x3df66b)['then'](handleEntityNotFound(_0xf75969,null))[_0x7a46('0x25')](respondWithResult(_0xf75969,null))['catch'](handleError(_0xf75969,null));};exports['create']=function(_0xb60717,_0x54f129){return db['WhatsappApplication'][_0x7a46('0x48')](_0xb60717[_0x7a46('0x49')],{})[_0x7a46('0x25')](respondWithResult(_0x54f129,0xc9))[_0x7a46('0x4a')](handleError(_0x54f129,null));};exports[_0x7a46('0x4b')]=function(_0x1bb3cb,_0xafef25){if(_0x1bb3cb[_0x7a46('0x49')]['id']){delete _0x1bb3cb[_0x7a46('0x49')]['id'];}return db[_0x7a46('0x2c')][_0x7a46('0x47')]({'where':{'id':_0x1bb3cb[_0x7a46('0x45')]['id']}})[_0x7a46('0x25')](handleEntityNotFound(_0xafef25,null))[_0x7a46('0x25')](saveUpdates(_0x1bb3cb[_0x7a46('0x49')],null))['then'](respondWithResult(_0xafef25,null))[_0x7a46('0x4a')](handleError(_0xafef25,null));};exports[_0x7a46('0x26')]=function(_0x4f7e87,_0x498275){return db[_0x7a46('0x2c')][_0x7a46('0x47')]({'where':{'id':_0x4f7e87['params']['id']}})[_0x7a46('0x25')](handleEntityNotFound(_0x498275,null))[_0x7a46('0x25')](removeEntity(_0x498275,null))[_0x7a46('0x4a')](handleError(_0x498275,null));};
\ No newline at end of file
+var _0x25a9=['model','attributes','fields','hasOwnProperty','order','sort','filters','where','merge','filter','options','includeAll','include','findAll','catch','show','params','length','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','query','keys','intersection'];(function(_0x4dcd53,_0x54a77f){var _0x485091=function(_0x590091){while(--_0x590091){_0x4dcd53['push'](_0x4dcd53['shift']());}};_0x485091(++_0x54a77f);}(_0x25a9,0xf1));var _0x925a=function(_0x223a7c,_0x11ebdc){_0x223a7c=_0x223a7c-0x0;var _0x22e78a=_0x25a9[_0x223a7c];return _0x22e78a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x925a('0x0'));var zipdir=require(_0x925a('0x1'));var jsonpatch=require(_0x925a('0x2'));var rp=require(_0x925a('0x3'));var moment=require(_0x925a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x925a('0x5'));var util=require(_0x925a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x925a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x925a('0x8'));var _=require(_0x925a('0x9'));var squel=require(_0x925a('0xa'));var crypto=require(_0x925a('0xb'));var jsforce=require(_0x925a('0xc'));var deskjs=require(_0x925a('0xd'));var toCsv=require(_0x925a('0x7'));var querystring=require('querystring');var Papa=require(_0x925a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x925a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x925a('0x10'))(_0x925a('0x11'));var utils=require(_0x925a('0x12'));var config=require(_0x925a('0x13'));var licenseUtil=require(_0x925a('0x14'));var db=require(_0x925a('0x15'))['db'];function respondWithStatusCode(_0x55552e,_0x22c673){_0x22c673=_0x22c673||0xcc;return function(_0x39df47){if(_0x39df47){return _0x55552e[_0x925a('0x16')](_0x22c673);}return _0x55552e[_0x925a('0x17')](_0x22c673)[_0x925a('0x18')]();};}function respondWithResult(_0x4bd135,_0x26e2c0){_0x26e2c0=_0x26e2c0||0xc8;return function(_0x530360){if(_0x530360){return _0x4bd135[_0x925a('0x17')](_0x26e2c0)[_0x925a('0x19')](_0x530360);}};}function respondWithFilteredResult(_0xf0efa7,_0x4639b1){return function(_0x494bc5){if(_0x494bc5){var _0xa915f0=typeof _0x4639b1[_0x925a('0x1a')]==='undefined'&&typeof _0x4639b1[_0x925a('0x1b')]===_0x925a('0x1c');var _0x3a08f0=_0x494bc5[_0x925a('0x1d')];var _0x54fa22=_0xa915f0?0x0:_0x4639b1[_0x925a('0x1a')];var _0x2643ad=_0xa915f0?_0x494bc5[_0x925a('0x1d')]:_0x4639b1[_0x925a('0x1a')]+_0x4639b1[_0x925a('0x1b')];var _0x517cef;if(_0x2643ad>=_0x3a08f0){_0x2643ad=_0x3a08f0;_0x517cef=0xc8;}else{_0x517cef=0xce;}_0xf0efa7['status'](_0x517cef);return _0xf0efa7[_0x925a('0x1e')](_0x925a('0x1f'),_0x54fa22+'-'+_0x2643ad+'/'+_0x3a08f0)['json'](_0x494bc5);}return null;};}function patchUpdates(_0x2abbdc){return function(_0x374dd0){try{jsonpatch[_0x925a('0x20')](_0x374dd0,_0x2abbdc,!![]);}catch(_0x34fec0){return BPromise[_0x925a('0x21')](_0x34fec0);}return _0x374dd0[_0x925a('0x22')]();};}function saveUpdates(_0x2a0f28,_0x3458d5){return function(_0x5a0683){if(_0x5a0683){return _0x5a0683[_0x925a('0x23')](_0x2a0f28)[_0x925a('0x24')](function(_0x2c3949){return _0x2c3949;});}return null;};}function removeEntity(_0x5be491,_0x3e8be6){return function(_0x6079b9){if(_0x6079b9){return _0x6079b9['destroy']()[_0x925a('0x24')](function(){_0x5be491['status'](0xcc)[_0x925a('0x18')]();});}};}function handleEntityNotFound(_0x30fb0e,_0x22c2dc){return function(_0x2d4e16){if(!_0x2d4e16){_0x30fb0e[_0x925a('0x16')](0x194);}return _0x2d4e16;};}function handleError(_0x126aa5,_0x12c76e){_0x12c76e=_0x12c76e||0x1f4;return function(_0x1741b2){logger[_0x925a('0x25')](_0x1741b2[_0x925a('0x26')]);if(_0x1741b2['name']){delete _0x1741b2[_0x925a('0x27')];}_0x126aa5[_0x925a('0x17')](_0x12c76e)[_0x925a('0x28')](_0x1741b2);};}exports[_0x925a('0x29')]=function(_0x5cb909,_0x296337){var _0x495bff={},_0x2e3ad9={},_0x5d704a={'count':0x0,'rows':[]};var _0x1a9791=_[_0x925a('0x2a')](db[_0x925a('0x2b')][_0x925a('0x2c')],function(_0x28e81b){return{'name':_0x28e81b[_0x925a('0x2d')],'type':_0x28e81b[_0x925a('0x2e')][_0x925a('0x2f')]};});_0x2e3ad9['model']=_[_0x925a('0x2a')](_0x1a9791,'name');_0x2e3ad9[_0x925a('0x30')]=_[_0x925a('0x31')](_0x5cb909[_0x925a('0x30')]);_0x2e3ad9['filters']=_[_0x925a('0x32')](_0x2e3ad9[_0x925a('0x33')],_0x2e3ad9[_0x925a('0x30')]);_0x495bff[_0x925a('0x34')]=_[_0x925a('0x32')](_0x2e3ad9[_0x925a('0x33')],qs['fields'](_0x5cb909[_0x925a('0x30')][_0x925a('0x35')]));_0x495bff[_0x925a('0x34')]=_0x495bff[_0x925a('0x34')]['length']?_0x495bff['attributes']:_0x2e3ad9[_0x925a('0x33')];if(!_0x5cb909[_0x925a('0x30')][_0x925a('0x36')]('nolimit')){_0x495bff[_0x925a('0x1b')]=qs[_0x925a('0x1b')](_0x5cb909[_0x925a('0x30')][_0x925a('0x1b')]);_0x495bff['offset']=qs['offset'](_0x5cb909[_0x925a('0x30')][_0x925a('0x1a')]);}_0x495bff[_0x925a('0x37')]=qs[_0x925a('0x38')](_0x5cb909[_0x925a('0x30')][_0x925a('0x38')]);_0x495bff['where']=qs[_0x925a('0x39')](_['pick'](_0x5cb909['query'],_0x2e3ad9[_0x925a('0x39')]),_0x1a9791);if(_0x5cb909[_0x925a('0x30')]['filter']){_0x495bff[_0x925a('0x3a')]=_[_0x925a('0x3b')](_0x495bff['where'],{'$or':_[_0x925a('0x2a')](_0x1a9791,function(_0x5da482){if(_0x5da482['type']!=='VIRTUAL'){var _0x2717dd={};_0x2717dd[_0x5da482[_0x925a('0x27')]]={'$like':'%'+_0x5cb909[_0x925a('0x30')][_0x925a('0x3c')]+'%'};return _0x2717dd;}})});}_0x495bff=_[_0x925a('0x3b')]({},_0x495bff,_0x5cb909[_0x925a('0x3d')]);var _0x599c1b={'where':_0x495bff[_0x925a('0x3a')]};return db[_0x925a('0x2b')][_0x925a('0x1d')](_0x599c1b)[_0x925a('0x24')](function(_0x212384){_0x5d704a[_0x925a('0x1d')]=_0x212384;if(_0x5cb909[_0x925a('0x30')][_0x925a('0x3e')]){_0x495bff[_0x925a('0x3f')]=[{'all':!![]}];}return db[_0x925a('0x2b')][_0x925a('0x40')](_0x495bff);})[_0x925a('0x24')](function(_0x4e4d0c){_0x5d704a['rows']=_0x4e4d0c;return _0x5d704a;})[_0x925a('0x24')](respondWithFilteredResult(_0x296337,_0x495bff))[_0x925a('0x41')](handleError(_0x296337,null));};exports[_0x925a('0x42')]=function(_0x4a7114,_0x3c25f7){var _0x73606c={'raw':!![],'where':{'id':_0x4a7114[_0x925a('0x43')]['id']}},_0x3d5365={};_0x3d5365['model']=_[_0x925a('0x31')](db['WhatsappApplication']['rawAttributes']);_0x3d5365[_0x925a('0x30')]=_[_0x925a('0x31')](_0x4a7114['query']);_0x3d5365['filters']=_[_0x925a('0x32')](_0x3d5365['model'],_0x3d5365['query']);_0x73606c[_0x925a('0x34')]=_[_0x925a('0x32')](_0x3d5365[_0x925a('0x33')],qs['fields'](_0x4a7114[_0x925a('0x30')][_0x925a('0x35')]));_0x73606c[_0x925a('0x34')]=_0x73606c[_0x925a('0x34')][_0x925a('0x44')]?_0x73606c[_0x925a('0x34')]:_0x3d5365[_0x925a('0x33')];if(_0x4a7114[_0x925a('0x30')]['includeAll']){_0x73606c[_0x925a('0x3f')]=[{'all':!![]}];}_0x73606c=_[_0x925a('0x3b')]({},_0x73606c,_0x4a7114[_0x925a('0x3d')]);return db[_0x925a('0x2b')][_0x925a('0x45')](_0x73606c)['then'](handleEntityNotFound(_0x3c25f7,null))[_0x925a('0x24')](respondWithResult(_0x3c25f7,null))[_0x925a('0x41')](handleError(_0x3c25f7,null));};exports[_0x925a('0x46')]=function(_0x2fdf99,_0x2bf5bf){return db[_0x925a('0x2b')]['create'](_0x2fdf99[_0x925a('0x47')],{})[_0x925a('0x24')](respondWithResult(_0x2bf5bf,0xc9))[_0x925a('0x41')](handleError(_0x2bf5bf,null));};exports['update']=function(_0x1d1975,_0x22db0b){if(_0x1d1975[_0x925a('0x47')]['id']){delete _0x1d1975['body']['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x1d1975[_0x925a('0x43')]['id']}})[_0x925a('0x24')](handleEntityNotFound(_0x22db0b,null))[_0x925a('0x24')](saveUpdates(_0x1d1975[_0x925a('0x47')],null))[_0x925a('0x24')](respondWithResult(_0x22db0b,null))['catch'](handleError(_0x22db0b,null));};exports[_0x925a('0x48')]=function(_0xe15d43,_0x3c7543){return db[_0x925a('0x2b')]['find']({'where':{'id':_0xe15d43[_0x925a('0x43')]['id']}})[_0x925a('0x24')](handleEntityNotFound(_0x3c7543,null))[_0x925a('0x24')](removeEntity(_0x3c7543,null))[_0x925a('0x41')](handleError(_0x3c7543,null));};
\ No newline at end of file
index 18f11c5..e7377e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46fc=['WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x3f8333,_0x5bfdc1){var _0x5b2cf8=function(_0x100250){while(--_0x100250){_0x3f8333['push'](_0x3f8333['shift']());}};_0x5b2cf8(++_0x5bfdc1);}(_0x46fc,0x103));var _0xc46f=function(_0x470d21,_0x990b34){_0x470d21=_0x470d21-0x0;var _0x34d960=_0x46fc[_0x470d21];return _0x34d960;};'use strict';var _=require(_0xc46f('0x0'));var util=require(_0xc46f('0x1'));var logger=require(_0xc46f('0x2'))(_0xc46f('0x3'));var moment=require(_0xc46f('0x4'));var BPromise=require(_0xc46f('0x5'));var rp=require(_0xc46f('0x6'));var fs=require('fs');var path=require(_0xc46f('0x7'));var rimraf=require(_0xc46f('0x8'));var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module[_0xc46f('0x9')]=function(_0x176c6f,_0x30ca8d){return _0x176c6f[_0xc46f('0xa')](_0xc46f('0xb'),attributes,{'tableName':_0xc46f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc46f('0xd'),'collate':_0xc46f('0xe')});};
\ No newline at end of file
+var _0xea89=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications'];(function(_0x1a08cc,_0x1ff763){var _0x2ce2ec=function(_0x4c28a9){while(--_0x4c28a9){_0x1a08cc['push'](_0x1a08cc['shift']());}};_0x2ce2ec(++_0x1ff763);}(_0xea89,0x1e2));var _0x9ea8=function(_0x34e276,_0x3d999d){_0x34e276=_0x34e276-0x0;var _0x3a4293=_0xea89[_0x34e276];return _0x3a4293;};'use strict';var _=require(_0x9ea8('0x0'));var util=require(_0x9ea8('0x1'));var logger=require(_0x9ea8('0x2'))(_0x9ea8('0x3'));var moment=require(_0x9ea8('0x4'));var BPromise=require('bluebird');var rp=require(_0x9ea8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ea8('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ea8('0x7'));module[_0x9ea8('0x8')]=function(_0x2c6e50,_0x184f38){return _0x2c6e50[_0x9ea8('0x9')](_0x9ea8('0xa'),attributes,{'tableName':_0x9ea8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9ea8('0xc')});};
\ No newline at end of file
index 4ee0053..eb4dccc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x512679,_0x13a4d5){var _0x3ea076=function(_0x2e260f){while(--_0x2e260f){_0x512679['push'](_0x512679['shift']());}};_0x3ea076(++_0x13a4d5);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x24ca[_0x5948dd];return _0xb1f8be;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){return client[_0xa24c('0xc')](_0x2dd348,_0x9a5013)[_0xa24c('0xd')](function(_0x5eac78){logger[_0xa24c('0xe')](_0xa24c('0xf'),_0x257264,_0xa24c('0x10'));logger[_0xa24c('0x11')](_0xa24c('0x12'),_0x257264,_0xa24c('0x10'),JSON[_0xa24c('0x13')](_0x5eac78));if(_0x5eac78[_0xa24c('0x14')]){if(_0x5eac78[_0xa24c('0x14')]['code']===0x1f4){logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x42d89c(_0x5eac78['error'][_0xa24c('0x15')]);}logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x481196(_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0xa24c('0x10'));_0x481196(_0x5eac78[_0xa24c('0x16')]['message']);}})['catch'](function(_0x221d21){logger[_0xa24c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0x221d21);_0x42d89c(_0x221d21);});});}
\ No newline at end of file
+var _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x51516f,_0x4a8eef){var _0x2e6df6=function(_0x1a9290){while(--_0x1a9290){_0x51516f['push'](_0x51516f['shift']());}};_0x2e6df6(++_0x4a8eef);}(_0xac9d,0x14d));var _0xdac9=function(_0x4f11cb,_0x14e174){_0x4f11cb=_0x4f11cb-0x0;var _0x491488=_0xac9d[_0x4f11cb];return _0x491488;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});}
\ No newline at end of file
index 49150b3..9ed5b64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d58=['create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download','download','post'];(function(_0x3cd8be,_0x6f80d7){var _0x4ff4c9=function(_0x1c218e){while(--_0x1c218e){_0x3cd8be['push'](_0x3cd8be['shift']());}};_0x4ff4c9(++_0x6f80d7);}(_0x5d58,0x187));var _0x85d5=function(_0x490355,_0x48e7f3){_0x490355=_0x490355-0x0;var _0x42618d=_0x5d58[_0x490355];return _0x42618d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./whatsappInteraction.controller');router[_0x85d5('0x4')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0x6')]);router[_0x85d5('0x4')]('/describe',auth[_0x85d5('0x5')](),controller[_0x85d5('0x7')]);router['get'](_0x85d5('0x8'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0x4')](_0x85d5('0xa'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x85d5('0xb'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xc')]);router[_0x85d5('0xd')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0xe')]);router[_0x85d5('0xd')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x85d5('0xd')](_0x85d5('0xf'),auth[_0x85d5('0x5')](),interaction[_0x85d5('0x10')](_0x85d5('0x11'),_0x85d5('0x12')),controller[_0x85d5('0x13')]);router['put'](_0x85d5('0x8'),auth[_0x85d5('0x5')](),interaction[_0x85d5('0x10')](_0x85d5('0x11'),_0x85d5('0x14')),controller[_0x85d5('0x15')]);router[_0x85d5('0x16')](_0x85d5('0x8'),auth[_0x85d5('0x5')](),interaction[_0x85d5('0x10')](_0x85d5('0x11'),_0x85d5('0x17')),controller[_0x85d5('0x18')]);router[_0x85d5('0x16')](_0x85d5('0xf'),auth[_0x85d5('0x5')](),controller[_0x85d5('0x19')]);module[_0x85d5('0x1a')]=router;
\ No newline at end of file
+var _0x7bd0=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','destroy','removeTags'];(function(_0x34d4a9,_0x363d9b){var _0x5c859d=function(_0xbe70dc){while(--_0xbe70dc){_0x34d4a9['push'](_0x34d4a9['shift']());}};_0x5c859d(++_0x363d9b);}(_0x7bd0,0x111));var _0x07bd=function(_0x337a10,_0x5191c7){_0x337a10=_0x337a10-0x0;var _0x575f98=_0x7bd0[_0x337a10];return _0x575f98;};'use strict';var multer=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var path=require(_0x07bd('0x2'));var timeout=require(_0x07bd('0x3'));var express=require(_0x07bd('0x4'));var router=express[_0x07bd('0x5')]();var fs_extra=require(_0x07bd('0x6'));var auth=require(_0x07bd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x07bd('0x8'));var controller=require(_0x07bd('0x9'));router[_0x07bd('0xa')]('/',auth[_0x07bd('0xb')](),controller[_0x07bd('0xc')]);router[_0x07bd('0xa')](_0x07bd('0xd'),auth['isAuthenticated'](),controller[_0x07bd('0xe')]);router['get'](_0x07bd('0xf'),auth[_0x07bd('0xb')](),controller[_0x07bd('0x10')]);router['get'](_0x07bd('0x11'),auth[_0x07bd('0xb')](),controller[_0x07bd('0x12')]);router[_0x07bd('0xa')]('/:id/download',auth[_0x07bd('0xb')](),controller[_0x07bd('0x13')]);router[_0x07bd('0x14')]('/',auth[_0x07bd('0xb')](),controller[_0x07bd('0x15')]);router[_0x07bd('0x14')](_0x07bd('0x11'),auth[_0x07bd('0xb')](),controller['addMessage']);router['post'](_0x07bd('0x16'),auth[_0x07bd('0xb')](),interaction[_0x07bd('0x17')](_0x07bd('0x18'),_0x07bd('0x19')),controller[_0x07bd('0x1a')]);router[_0x07bd('0x1b')]('/:id',auth[_0x07bd('0xb')](),interaction['tracked'](_0x07bd('0x18'),_0x07bd('0x1c')),controller[_0x07bd('0x1d')]);router[_0x07bd('0x1e')](_0x07bd('0xf'),auth['isAuthenticated'](),interaction[_0x07bd('0x17')](_0x07bd('0x18'),'whatsappinteraction:destroy'),controller[_0x07bd('0x1f')]);router[_0x07bd('0x1e')](_0x07bd('0x16'),auth[_0x07bd('0xb')](),controller[_0x07bd('0x20')]);module[_0x07bd('0x21')]=router;
\ No newline at end of file
index 0a7959e..ca92705 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeea=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x2b39b0,_0x53f62c){var _0x2f0e50=function(_0x2832a3){while(--_0x2832a3){_0x2b39b0['push'](_0x2b39b0['shift']());}};_0x2f0e50(++_0x53f62c);}(_0xbeea,0xb1));var _0xabee=function(_0x775449,_0x4d8174){_0x775449=_0x775449-0x0;var _0x1e980f=_0xbeea[_0x775449];return _0x1e980f;};'use strict';var Sequelize=require(_0xabee('0x0'));var moment=require('moment');module[_0xabee('0x1')]={'closed':{'type':Sequelize[_0xabee('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xabee('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xabee('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xabee('0x4')]},'phone':{'type':Sequelize[_0xabee('0x4')]},'read1stAt':{'type':Sequelize[_0xabee('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xabee('0x5')]('in',_0xabee('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xabee('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xabee('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4819=['out','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x1ae3f2,_0x521d4d){var _0x1f19d1=function(_0x589c72){while(--_0x589c72){_0x1ae3f2['push'](_0x1ae3f2['shift']());}};_0x1f19d1(++_0x521d4d);}(_0x4819,0xcd));var _0x9481=function(_0xc3555a,_0x599225){_0xc3555a=_0xc3555a-0x0;var _0x5b6b8a=_0x4819[_0xc3555a];return _0x5b6b8a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9481('0x0'));module[_0x9481('0x1')]={'closed':{'type':Sequelize[_0x9481('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9481('0x3')]},'disposition':{'type':Sequelize[_0x9481('0x4')]},'secondDisposition':{'type':Sequelize[_0x9481('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9481('0x4')]},'note':{'type':Sequelize[_0x9481('0x4')]},'phone':{'type':Sequelize[_0x9481('0x4')]},'read1stAt':{'type':Sequelize[_0x9481('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x9481('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9481('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9481('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 1a133cb..603065f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf12f=['u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','u.id\x20=\x20ui.UserId','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','Contact','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','union','User','UserId','text','body','some','compact','isEmpty','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','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','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','toString','sequelize','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.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','all','rows','show','includeAll','include','merge','options','create','params','describe','WhatsappMessage','addMessage','getMessages','findOne','nolimit','sort','pick','findAll','ids','omit','spread','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','tmp','server','files','attachments','format','transcript-%d-%s.zip','join','firstName','lastName','Attachment','Messages','direction','secret','Account','Owner','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','createReadStream','createWriteStream','basename','out','System','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','WhatsappInteraction','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','order','where','filters','select','field','color','from'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xf12f,0x9c));var _0xff12=function(_0x3151a5,_0x556591){_0x3151a5=_0x3151a5-0x0;var _0x10a216=_0xf12f[_0x3151a5];return _0x10a216;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff12('0x0'));var zipdir=require(_0xff12('0x1'));var jsonpatch=require(_0xff12('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xff12('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xff12('0x4'));var sox=require(_0xff12('0x5'));var csv=require(_0xff12('0x6'));var ejs=require(_0xff12('0x7'));var fs=require('fs');var fs_extra=require(_0xff12('0x8'));var _=require(_0xff12('0x9'));var squel=require(_0xff12('0xa'));var crypto=require(_0xff12('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xff12('0x6'));var querystring=require('querystring');var Papa=require(_0xff12('0xc'));var Redis=require(_0xff12('0xd'));var authService=require(_0xff12('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xff12('0xf'));var pdf=require(_0xff12('0x10'));var hardwareService=require(_0xff12('0x11'));var logger=require(_0xff12('0x12'))('api');var utils=require(_0xff12('0x13'));var config=require(_0xff12('0x14'));var licenseUtil=require(_0xff12('0x15'));var db=require('../../mysqldb')['db'];config[_0xff12('0x16')]=_['defaults'](config[_0xff12('0x16')],{'host':_0xff12('0x17'),'port':0x18eb});var socket=require(_0xff12('0x18'))(new Redis(config[_0xff12('0x16')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x26afae,_0x3bab41){_0x3bab41=_0x3bab41||0xcc;return function(_0x46990b){if(_0x46990b){return _0x26afae[_0xff12('0x19')](_0x3bab41);}return _0x26afae[_0xff12('0x1a')](_0x3bab41)[_0xff12('0x1b')]();};}function respondWithResult(_0x42610f,_0x59e703){_0x59e703=_0x59e703||0xc8;return function(_0x54dc0a){if(_0x54dc0a){return _0x42610f[_0xff12('0x1a')](_0x59e703)[_0xff12('0x1c')](_0x54dc0a);}};}function respondWithFilteredResult(_0x21edfa,_0x37bb28){return function(_0x5a5d4a){if(_0x5a5d4a){var _0x464462=typeof _0x37bb28[_0xff12('0x1d')]===_0xff12('0x1e')&&typeof _0x37bb28[_0xff12('0x1f')]===_0xff12('0x1e');var _0xd0bd83=_0x5a5d4a[_0xff12('0x20')];var _0x5c01cb=_0x464462?0x0:_0x37bb28[_0xff12('0x1d')];var _0x20a01d=_0x464462?_0x5a5d4a[_0xff12('0x20')]:_0x37bb28[_0xff12('0x1d')]+_0x37bb28[_0xff12('0x1f')];var _0x2b7b91;if(_0x20a01d>=_0xd0bd83){_0x20a01d=_0xd0bd83;_0x2b7b91=0xc8;}else{_0x2b7b91=0xce;}_0x21edfa[_0xff12('0x1a')](_0x2b7b91);return _0x21edfa[_0xff12('0x21')](_0xff12('0x22'),_0x5c01cb+'-'+_0x20a01d+'/'+_0xd0bd83)[_0xff12('0x1c')](_0x5a5d4a);}return null;};}function patchUpdates(_0x2dc113){return function(_0x1e0e00){try{jsonpatch[_0xff12('0x23')](_0x1e0e00,_0x2dc113,!![]);}catch(_0x23f707){return BPromise['reject'](_0x23f707);}return _0x1e0e00[_0xff12('0x24')]();};}function saveUpdates(_0xe8a838,_0x119b64){return function(_0x41fa20){if(_0x41fa20){return _0x41fa20[_0xff12('0x25')](_0xe8a838)[_0xff12('0x26')](function(_0x286c1f){return _0x286c1f;});}return null;};}function removeEntity(_0x34dbc6,_0x29b1b5){return function(_0x33e584){if(_0x33e584){return _0x33e584[_0xff12('0x27')]()[_0xff12('0x26')](function(){_0x34dbc6[_0xff12('0x1a')](0xcc)[_0xff12('0x1b')]();});}};}function handleEntityNotFound(_0x57f4d4,_0x20f089){return function(_0x5330de){if(!_0x5330de){_0x57f4d4[_0xff12('0x19')](0x194);}return _0x5330de;};}function handleError(_0x2a947f,_0x2f76cc){_0x2f76cc=_0x2f76cc||0x1f4;return function(_0x108803){logger[_0xff12('0x28')](_0x108803[_0xff12('0x29')]);if(_0x108803[_0xff12('0x2a')]){delete _0x108803['name'];}_0x2a947f[_0xff12('0x1a')](_0x2f76cc)['send'](_0x108803);};}function getInteractionUsers(_0x240284,_0x503bd5){return new BPromise(function(_0x2c2820,_0x2f01cf){try{if(_0x503bd5[_0x240284['id']]){_0x240284[_0xff12('0x2b')]=_[_0xff12('0x2c')](_0x503bd5[_0x240284['id']],function(_0x4e74fc){return{'id':_0x4e74fc['id'],'fullname':_0x4e74fc[_0xff12('0x2d')]};});}}catch(_0x4de54d){_0x2f01cf(_0x4de54d);}_0x2c2820(_0x240284);});}function getInteractionTags(_0x5b124e,_0x40f7f1){return new BPromise(function(_0x369907,_0x182b6e){try{if(_0x5b124e[_0xff12('0x2e')]){_0x5b124e[_0xff12('0x2f')]=[];_0x5b124e['TagIds'][_0xff12('0x30')](',')[_0xff12('0x31')](function(_0x1f6e61){_0x5b124e['Tags'][_0xff12('0x32')](_0x40f7f1[_0x1f6e61]);});}delete _0x5b124e[_0xff12('0x2e')];}catch(_0xfbd479){_0x182b6e(_0xfbd479);}_0x369907(_0x5b124e);});}function updateWhatsappInteraction(_0x24cbe0,_0xb4aa66,_0xd5b78f){return new BPromise(function(_0x464652,_0x2fb2c2){return getInteractionUsers(_0x24cbe0,_0xd5b78f)[_0xff12('0x26')](function(_0x28ece7){return getInteractionTags(_0x28ece7,_0xb4aa66);})['then'](function(_0x4fe59f){_0x464652(_0x4fe59f);})[_0xff12('0x33')](function(_0x49bf6e){_0x2fb2c2(_0x49bf6e);});});}exports[_0xff12('0x34')]=function(_0x4589a3,_0x57997f){var _0x4ba267={},_0x5ae576={},_0x5c250d={'count':0x0,'rows':[]};var _0x47e718=_[_0xff12('0x2c')](db[_0xff12('0x35')][_0xff12('0x36')],function(_0x2491af){return{'name':_0x2491af[_0xff12('0x37')],'type':_0x2491af[_0xff12('0x38')][_0xff12('0x39')]};});_0x5ae576['model']=_[_0xff12('0x2c')](_0x47e718,_0xff12('0x2a'));_0x5ae576[_0xff12('0x3a')]=_[_0xff12('0x3b')](_0x4589a3[_0xff12('0x3a')]);_0x5ae576['filters']=_[_0xff12('0x3c')](_0x5ae576[_0xff12('0x3d')],_0x5ae576[_0xff12('0x3a')]);_0x4ba267[_0xff12('0x3e')]=_[_0xff12('0x3c')](_0x5ae576['model'],qs[_0xff12('0x3f')](_0x4589a3[_0xff12('0x3a')]['fields']));_0x4ba267[_0xff12('0x3e')]=_0x4ba267[_0xff12('0x3e')][_0xff12('0x40')]?_0x4ba267[_0xff12('0x3e')]:_0x5ae576[_0xff12('0x3d')];if(!_0x4589a3['query']['hasOwnProperty']('nolimit')){_0x4ba267[_0xff12('0x1f')]=qs[_0xff12('0x1f')](_0x4589a3[_0xff12('0x3a')][_0xff12('0x1f')]);_0x4ba267[_0xff12('0x1d')]=qs['offset'](_0x4589a3[_0xff12('0x3a')][_0xff12('0x1d')]);}_0x4ba267[_0xff12('0x41')]=qs['sort'](_0x4589a3[_0xff12('0x3a')]['sort']);_0x4ba267[_0xff12('0x42')]=qs[_0xff12('0x43')](_['pick'](_0x4589a3['query'],_0x5ae576[_0xff12('0x43')]),_0x47e718);var _0x465111=[];var _0x541e0e=squel[_0xff12('0x44')]()[_0xff12('0x45')]('id')[_0xff12('0x45')](_0xff12('0x2a'))[_0xff12('0x45')](_0xff12('0x46'))[_0xff12('0x47')]('tools_tags');var _0x1b8f89=squel[_0xff12('0x44')]()[_0xff12('0x45')](_0xff12('0x48'))[_0xff12('0x45')](_0xff12('0x49'))['field'](_0xff12('0x4a'))['from'](_0xff12('0x4b'),'ui')['left_join']('users','u',_0xff12('0x4c'));var _0x54e925=squel['select']()[_0xff12('0x47')]('whatsapp_interactions','i')[_0xff12('0x4d')]('cm_contacts','c',_0xff12('0x4e'))[_0xff12('0x4d')](_0xff12('0x4f'),'o',_0xff12('0x50'))[_0xff12('0x4d')](_0xff12('0x51'),'a',_0xff12('0x52'))[_0xff12('0x4d')](_0xff12('0x53'),'me',_0xff12('0x54'))[_0xff12('0x4d')]('whatsapp_interaction_has_tags','it',_0xff12('0x55'))[_0xff12('0x4d')](_0xff12('0x56'),'t',_0xff12('0x57'));var _0x234756=squel[_0xff12('0x58')]();var _0x1b1a97=[];var _0x3a0a62=squel[_0xff12('0x58')]();var _0xa472b6;if(_0x4589a3[_0xff12('0x3a')][_0xff12('0x59')]){_0xa472b6=as[_0xff12('0x5a')](_0x4589a3[_0xff12('0x3a')][_0xff12('0x59')]);var _0x546193=_0xa472b6[_0xff12('0x5b')];for(var _0x13c57a=0x0;_0x13c57a<_0xa472b6[_0xff12('0x5c')][_0xff12('0x40')];_0x13c57a++){var _0x10d784=_0xa472b6['conditions'][_0x13c57a];var _0x21e3ca='i';var _0x1389a2=_[_0xff12('0x5d')](_0x47e718,[_0xff12('0x2a'),_0x10d784[_0xff12('0x45')]]);if(!_0x1389a2){switch(_0x10d784[_0xff12('0x45')]){case _0xff12('0x5e'):if(_0x10d784['value']==0x1){_0x54e925[_0xff12('0x5f')]('`'+_0x10d784['field']+'`\x20=\x200');}else{_0x54e925['having']('`'+_0x10d784[_0xff12('0x45')]+'`\x20>\x200');}break;case _0xff12('0x60'):if(_0x10d784['operator']==='$substring'){if(_0x10d784[_0xff12('0x61')][_0xff12('0x30')]('\x20')[_0xff12('0x40')]>0x1){_0x234756[_0x546193](_0xff12('0x62'),qs[_0xff12('0x63')](_0x10d784[_0xff12('0x61')]),null);}else{var _0x4a7c8a='%'+_0x10d784[_0xff12('0x61')]+'%';_0x234756[_0x546193](_0xff12('0x64'),_0x4a7c8a,_0x4a7c8a,_0x4a7c8a);}}else{_0x1389a2=_[_0xff12('0x5d')](_0x47e718,[_0xff12('0x2a'),_0xff12('0x65')]);_0x10d784[_0xff12('0x45')]=_0xff12('0x65');_0x2eca6c=as[_0xff12('0x66')](_0x21e3ca,_0x1389a2['type'],_0x10d784);_0x234756[_0x546193](_0x2eca6c['text'],_0x2eca6c['value'][_0xff12('0x67')],_0x2eca6c[_0xff12('0x61')][_0xff12('0x1b')]);}break;case'Tag':var _0x17229f=_0x10d784['value']['split'](',')[_0xff12('0x2c')](function(_0x1fcbab){return Number(_0x1fcbab);});_0x17229f[_0xff12('0x31')](function(_0x36cd3f){_0x3a0a62['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x36cd3f+',%');});_0x1b1a97=_[_0xff12('0x68')](_0x1b1a97,_0x17229f);break;case _0xff12('0x69'):if(_0x10d784['operator']==='$substring'){_0x234756[_0x546193]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x10d784[_0xff12('0x61')]+'%',null);}else{_0x1389a2=_['find'](_0x47e718,[_0xff12('0x2a'),_0xff12('0x6a')]);_0x10d784[_0xff12('0x45')]=_0xff12('0x6a');_0x2eca6c=as[_0xff12('0x66')](_0x21e3ca,_0x1389a2[_0xff12('0x38')],_0x10d784);_0x234756[_0x546193](_0x2eca6c[_0xff12('0x6b')],_0x2eca6c[_0xff12('0x61')]['start'],_0x2eca6c['value']['end']);}break;case _0xff12('0x6c'):_0x2eca6c=as[_0xff12('0x66')]('me',null,_0x10d784);_0x234756[_0x546193](_0x2eca6c['text'],_0x2eca6c[_0xff12('0x61')][_0xff12('0x67')],_0x2eca6c[_0xff12('0x61')][_0xff12('0x1b')]);break;}}else{var _0x2eca6c=as[_0xff12('0x66')](_0x21e3ca,_0x1389a2[_0xff12('0x38')],_0x10d784);_0x234756[_0x546193](_0x2eca6c[_0xff12('0x6b')],_0x2eca6c[_0xff12('0x61')][_0xff12('0x67')],_0x2eca6c[_0xff12('0x61')][_0xff12('0x1b')]);}}}else{var _0x5ad82b=_(_0x4589a3['query'])[_0xff12('0x3b')]()[_0xff12('0x2c')](function(_0x44d116){return _[_0xff12('0x6d')](_0x47e718,[_0xff12('0x2a'),_0x44d116])?_0x44d116:undefined;})[_0xff12('0x6e')]()[_0xff12('0x61')]();if(!_[_0xff12('0x6f')](_0x5ad82b)){_0x5ad82b[_0xff12('0x31')](function(_0xb8d935){if(_0xb8d935==='WhatsappAccountId'){_0x54e925[_0xff12('0x42')](_0xff12('0x70'),[][_0xff12('0x71')](_0x4589a3['query'][_0xb8d935]));}else if(_0xb8d935===_0xff12('0x72')){var _0xa2c3ca=JSON[_0xff12('0x73')](_0x4589a3[_0xff12('0x3a')][_0xb8d935])[_0xff12('0x74')];var _0x18052e=JSON[_0xff12('0x73')](_0x4589a3[_0xff12('0x3a')][_0xb8d935])[_0xff12('0x75')];_0x54e925[_0xff12('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xa2c3ca,_0x18052e);}else{if(_0x4589a3[_0xff12('0x3a')][_0xb8d935]===_0xff12('0x76')){_0x54e925['where']('i.'+_0xb8d935+_0xff12('0x77'));}else{_0x54e925[_0xff12('0x42')]('i.'+_0xb8d935+_0xff12('0x78'),_0x4589a3[_0xff12('0x3a')][_0xb8d935]);}}});}if(_0x4589a3['query'][_0xff12('0x79')]){if(_0x4589a3['query'][_0xff12('0x79')]==0x1){_0x54e925[_0xff12('0x5f')](_0xff12('0x7a'));}else{_0x54e925[_0xff12('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x4589a3[_0xff12('0x3a')][_0xff12('0x7b')]){_0x1b1a97=_[_0xff12('0x7c')](_0x4589a3[_0xff12('0x3a')][_0xff12('0x7b')])?_0x4589a3[_0xff12('0x3a')][_0xff12('0x7b')]:new Array(_0x4589a3['query']['tag']);_0x1b1a97['forEach'](function(_0x232fb6){_0x3a0a62['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x232fb6+',%');});}if(_0x4589a3[_0xff12('0x3a')][_0xff12('0x7d')]){var _0x30f9a5=_0x4589a3[_0xff12('0x3a')][_0xff12('0x7d')]['replace']('\x5c','\x5c\x5c')[_0xff12('0x7e')](/'/g,'\x27\x27');if(qs[_0xff12('0x7f')](_0x30f9a5)){_0x234756['or']('i.id\x20LIKE\x20?',_0x30f9a5+'%')['or'](_0xff12('0x80'),_0x30f9a5+'%');}else{_0x234756['or'](_0xff12('0x81'),qs[_0xff12('0x63')](_0x30f9a5))['or'](_0xff12('0x82'),_0x30f9a5+'%');}}}_0x54e925['where'](_0x234756);_0x54e925[_0xff12('0x83')](_0xff12('0x84'));var _0x33011d={'type':db[_0xff12('0x85')][_0xff12('0x86')][_0xff12('0x87')],'raw':!![]};var _0x5b1f87=_0x54e925['clone']();_0x5b1f87['field'](_0xff12('0x84'));_0x5b1f87['field'](_0xff12('0x88'),_0xff12('0x5e'));if(_0x4ba267['order']){_0x4ba267[_0xff12('0x41')][_0xff12('0x31')](function(_0x569e58){var _0x581de2=_0x569e58[0x0]==='contactName'?_0x569e58[0x0]:'i.'+_0x569e58[0x0];_0x54e925[_0xff12('0x41')](_0x581de2,_0x569e58[0x1]===_0xff12('0x89')?![]:!![]);});}if(!_['isEmpty'](_0x1b1a97)){_0x54e925[_0xff12('0x5f')](_0x3a0a62);_0x5b1f87[_0xff12('0x42')](_0xff12('0x8a'),_0x1b1a97);}BPromise['resolve']()[_0xff12('0x26')](function(){if(!_0xa472b6){if(_0x4589a3['query'][_0xff12('0x8b')])return;_0x5b1f87[_0xff12('0x42')](_0xff12('0x8c'));_0x54e925[_0xff12('0x42')](_0xff12('0x8c'));return;}if(_0x4589a3[_0xff12('0x8d')][_0xff12('0x8e')]!==_0xff12('0x8f'))return;return _0x4589a3['user'][_0xff12('0x90')]({'attributes':['id'],'raw':!![]})[_0xff12('0x26')](function(_0x5d8c4d){if(_[_0xff12('0x6f')](_0x5d8c4d)){_0x5b1f87[_0xff12('0x42')](_0xff12('0x91'));_0x54e925[_0xff12('0x42')](_0xff12('0x91'));}else{_0x5b1f87[_0xff12('0x42')](_0xff12('0x70'),_[_0xff12('0x2c')](_0x5d8c4d,'id'));_0x54e925[_0xff12('0x42')](_0xff12('0x70'),_['map'](_0x5d8c4d,'id'));}});})[_0xff12('0x26')](function(){if(_0x4589a3[_0xff12('0x8d')][_0xff12('0x8e')]===_0xff12('0x8f')&&!_0xa472b6&&!_0x4589a3[_0xff12('0x3a')][_0xff12('0x8b')])return[];return db['sequelize'][_0xff12('0x3a')](_0x5b1f87[_0xff12('0x92')](),_0x33011d);})[_0xff12('0x26')](function(_0x1d9dee){_0x5c250d[_0xff12('0x20')]=_0x1d9dee[_0xff12('0x40')];if(_0x5c250d[_0xff12('0x20')]===0x0)return[];return db[_0xff12('0x93')][_0xff12('0x3a')](_0x541e0e[_0xff12('0x92')](),_0x33011d)['then'](function(_0x34ca4f){_0x465111=_[_0xff12('0x94')](_0x34ca4f,'id');_0x33011d=_['merge'](_0x33011d,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4589a3[_0xff12('0x3a')][_0xff12('0x3f')]){_0x4ba267['attributes'][_0xff12('0x31')](function(_0x14349d){_0x54e925[_0xff12('0x45')]('i.'+_0x14349d);});}else{_0x54e925[_0xff12('0x45')](_0xff12('0x88'),_0xff12('0x5e'));_0x54e925[_0xff12('0x45')]('a.key',_0xff12('0x95'));_0x54e925[_0xff12('0x45')](_0xff12('0x96'),_0xff12('0x97'));_0x54e925[_0xff12('0x45')](_0xff12('0x98'),'contactName');_0x54e925[_0xff12('0x45')](_0xff12('0x99'));_0x54e925['field'](_0xff12('0x9a'),'Contact.firstName');_0x54e925[_0xff12('0x45')]('c.lastName',_0xff12('0x9b'));_0x54e925[_0xff12('0x45')](_0xff12('0x9c'),_0xff12('0x9d'));_0x54e925[_0xff12('0x45')]('c.phone',_0xff12('0x9e'));_0x54e925[_0xff12('0x45')](_0xff12('0x9f'),'Contact.mobile');_0x54e925[_0xff12('0x45')](_0xff12('0xa0'),_0xff12('0xa1'));_0x54e925['field']('o.fullname',_0xff12('0xa2'));_0x54e925[_0xff12('0x45')](_0xff12('0xa3'),_0xff12('0xa4'));_0x54e925['field'](_0xff12('0xa5'),_0xff12('0x2e'));}if(_0x4ba267[_0xff12('0x1f')])_0x54e925['limit'](_0x4ba267[_0xff12('0x1f')]);if(_0x4ba267['offset'])_0x54e925[_0xff12('0x1d')](_0x4ba267[_0xff12('0x1d')]);return db['sequelize'][_0xff12('0x3a')](_0x54e925['toString'](),_0x33011d);})['then'](function(_0x5f1a64){if(_0x5f1a64['length']>0x0)_0x1b8f89[_0xff12('0x42')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0xff12('0x2c')](_0x5f1a64,'id'));return db[_0xff12('0x93')][_0xff12('0x3a')](_0x1b8f89[_0xff12('0x92')](),_0x33011d)[_0xff12('0x26')](function(_0x5ceff1){var _0x34e84c=_[_0xff12('0xa6')](_0x5ceff1,_0xff12('0xa7'));var _0x175f2c=[];_0x5f1a64[_0xff12('0x31')](function(_0x4d9d1f){_0x175f2c[_0xff12('0x32')](updateWhatsappInteraction(_0x4d9d1f,_0x465111,_0x34e84c));});return BPromise[_0xff12('0xa8')](_0x175f2c);});});})[_0xff12('0x26')](function(_0x15efb5){_0x5c250d[_0xff12('0xa9')]=_0x15efb5;return _0x5c250d;})[_0xff12('0x26')](respondWithFilteredResult(_0x57997f,_0x4ba267))[_0xff12('0x33')](handleError(_0x57997f,null));};exports[_0xff12('0xaa')]=function(_0x317885,_0x3407f1){var _0x595d31={'raw':![],'where':{'id':_0x317885['params']['id']}},_0x4b4528={};_0x4b4528[_0xff12('0x3d')]=_['keys'](db[_0xff12('0x35')]['rawAttributes']);_0x4b4528[_0xff12('0x3a')]=_[_0xff12('0x3b')](_0x317885[_0xff12('0x3a')]);_0x4b4528['filters']=_['intersection'](_0x4b4528[_0xff12('0x3d')],_0x4b4528[_0xff12('0x3a')]);_0x595d31[_0xff12('0x3e')]=_[_0xff12('0x3c')](_0x4b4528[_0xff12('0x3d')],qs[_0xff12('0x3f')](_0x317885[_0xff12('0x3a')]['fields']));_0x595d31[_0xff12('0x3e')]=_0x595d31[_0xff12('0x3e')]['length']?_0x595d31[_0xff12('0x3e')]:_0x4b4528[_0xff12('0x3d')];if(_0x317885[_0xff12('0x3a')][_0xff12('0xab')]){_0x595d31[_0xff12('0xac')]=[{'all':!![]}];}_0x595d31=_[_0xff12('0xad')]({},_0x595d31,_0x317885[_0xff12('0xae')]);return db[_0xff12('0x35')]['find'](_0x595d31)[_0xff12('0x26')](handleEntityNotFound(_0x3407f1,null))[_0xff12('0x26')](respondWithResult(_0x3407f1,null))[_0xff12('0x33')](handleError(_0x3407f1,null));};exports['create']=function(_0x5ac807,_0x457acc){return db[_0xff12('0x35')][_0xff12('0xaf')](_0x5ac807[_0xff12('0x6c')],{})[_0xff12('0x26')](respondWithResult(_0x457acc,0xc9))[_0xff12('0x33')](handleError(_0x457acc,null));};exports[_0xff12('0x25')]=function(_0x3b05fe,_0x53772d){if(_0x3b05fe[_0xff12('0x6c')]['id']){delete _0x3b05fe[_0xff12('0x6c')]['id'];}return db[_0xff12('0x35')]['find']({'where':{'id':_0x3b05fe[_0xff12('0xb0')]['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x53772d,null))[_0xff12('0x26')](saveUpdates(_0x3b05fe[_0xff12('0x6c')],null))[_0xff12('0x26')](respondWithResult(_0x53772d,null))[_0xff12('0x33')](handleError(_0x53772d,null));};exports['destroy']=function(_0x5dc411,_0x5dced9){return db[_0xff12('0x35')][_0xff12('0x5d')]({'where':{'id':_0x5dc411[_0xff12('0xb0')]['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x5dced9,null))[_0xff12('0x26')](removeEntity(_0x5dced9,null))[_0xff12('0x33')](handleError(_0x5dced9,null));};exports[_0xff12('0xb1')]=function(_0x1e63de,_0x37d89c){return db[_0xff12('0x35')][_0xff12('0xb1')]()[_0xff12('0x26')](respondWithResult(_0x37d89c,null))[_0xff12('0x33')](handleError(_0x37d89c,null));};exports['addMessage']=function(_0x3d9eb8,_0x4a61f3,_0x1ead4d){return db[_0xff12('0xb2')]['find']({'where':{'id':_0x3d9eb8['params']['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x4a61f3,null))[_0xff12('0x26')](function(_0x27f82e){if(_0x27f82e){return _0x27f82e[_0xff12('0xb3')](_0x3d9eb8['body']['ids'],_['omit'](_0x3d9eb8[_0xff12('0x6c')],['ids','id'])||{});}})['then'](respondWithResult(_0x4a61f3,null))[_0xff12('0x33')](handleError(_0x4a61f3,null));};exports[_0xff12('0xb4')]=function(_0x5266b6,_0x4e5651,_0x4cd73d){var _0x1dce7f={'raw':![],'where':{}};var _0x4426e6={};var _0x2000ac={'count':0x0,'rows':[]};return db[_0xff12('0x35')][_0xff12('0xb5')]({'where':{'id':_0x5266b6['params']['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x4e5651,null))['then'](function(_0x2b63d3){if(_0x2b63d3){_0x4426e6[_0xff12('0x3d')]=_['keys'](db[_0xff12('0xb2')]['rawAttributes']);_0x4426e6[_0xff12('0x3a')]=_['keys'](_0x5266b6[_0xff12('0x3a')]);_0x4426e6[_0xff12('0x43')]=_[_0xff12('0x3c')](_0x4426e6[_0xff12('0x3d')],_0x4426e6['query']);_0x1dce7f[_0xff12('0x3e')]=_[_0xff12('0x3c')](_0x4426e6['model'],qs[_0xff12('0x3f')](_0x5266b6[_0xff12('0x3a')]['fields']));_0x1dce7f['attributes']=_0x1dce7f['attributes'][_0xff12('0x40')]?_0x1dce7f[_0xff12('0x3e')]:_0x4426e6[_0xff12('0x3d')];if(!_0x5266b6[_0xff12('0x3a')]['hasOwnProperty'](_0xff12('0xb6'))){_0x1dce7f[_0xff12('0x1f')]=qs[_0xff12('0x1f')](_0x5266b6[_0xff12('0x3a')][_0xff12('0x1f')]);_0x1dce7f[_0xff12('0x1d')]=qs[_0xff12('0x1d')](_0x5266b6['query'][_0xff12('0x1d')]);}_0x1dce7f[_0xff12('0x41')]=qs['sort'](_0x5266b6[_0xff12('0x3a')][_0xff12('0xb7')]);_0x1dce7f[_0xff12('0x42')]=qs[_0xff12('0x43')](_[_0xff12('0xb8')](_0x5266b6[_0xff12('0x3a')],_0x4426e6[_0xff12('0x43')]));_0x1dce7f[_0xff12('0x42')][_0xff12('0xa7')]=_0x2b63d3['id'];if(_0x5266b6['query'][_0xff12('0x7d')]){_0x1dce7f[_0xff12('0x42')]=_[_0xff12('0xad')](_0x1dce7f[_0xff12('0x42')],{'$or':_[_0xff12('0x2c')](_0x1dce7f[_0xff12('0x3e')],function(_0x3036e2){var _0x1a562d={};_0x1a562d[_0x3036e2]={'$like':'%'+_0x5266b6[_0xff12('0x3a')]['filter']+'%'};return _0x1a562d;})});}if(_0x5266b6[_0xff12('0x3a')][_0xff12('0x74')]){var _0x183a38=_0x5266b6['query'][_0xff12('0x74')][_0xff12('0x30')](',');var _0x406ceb={};_0x406ceb[_0x183a38[0x0]]={'$gte':moment(_0x183a38[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1dce7f[_0xff12('0x42')]=_[_0xff12('0xad')](_0x1dce7f[_0xff12('0x42')],_0x406ceb);}_0x1dce7f=_[_0xff12('0xad')]({},_0x1dce7f,_0x5266b6[_0xff12('0xae')]);return db['WhatsappMessage']['count']({'where':_0x1dce7f[_0xff12('0x42')]})[_0xff12('0x26')](function(_0x421414){_0x2000ac['count']=_0x421414;if(_0x5266b6[_0xff12('0x3a')][_0xff12('0xab')]){_0x1dce7f[_0xff12('0xac')]=[{'all':!![]}];}return db[_0xff12('0xb2')][_0xff12('0xb9')](_0x1dce7f);})['then'](function(_0x2f0a48){_0x2000ac[_0xff12('0xa9')]=_0x2f0a48;return _0x2000ac;});}})[_0xff12('0x26')](respondWithFilteredResult(_0x4e5651,_0x1dce7f))['catch'](handleError(_0x4e5651,null));};exports['addTags']=function(_0x561f23,_0x5c8802,_0x5b0a6a){return db[_0xff12('0x35')][_0xff12('0x5d')]({'where':{'id':_0x561f23[_0xff12('0xb0')]['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x5c8802,null))[_0xff12('0x26')](function(_0x37dbd8){if(_0x37dbd8){return _0x37dbd8['setTags'](_0x561f23[_0xff12('0x6c')][_0xff12('0xba')],_[_0xff12('0xbb')](_0x561f23['body'],[_0xff12('0xba'),'id'])||{})[_0xff12('0xbc')](function(){return db[_0xff12('0xbd')][_0xff12('0xb9')]({'attributes':['id','name',_0xff12('0x46')],'where':{'id':_0x561f23[_0xff12('0x6c')][_0xff12('0xba')]}});})[_0xff12('0x26')](function(_0x495aca){socket[_0xff12('0xbe')](_0xff12('0xbf'),{'id':Number(_0x561f23[_0xff12('0xb0')]['id']),'tags':_0x495aca||[]});return{'id':Number(_0x561f23[_0xff12('0xb0')]['id']),'tags':_0x495aca||[]};});}})[_0xff12('0x26')](respondWithResult(_0x5c8802,null))[_0xff12('0x33')](handleError(_0x5c8802,null));};exports[_0xff12('0xc0')]=function(_0x5c09bd,_0x4afa20,_0x347758){return db[_0xff12('0x35')]['find']({'where':{'id':_0x5c09bd[_0xff12('0xb0')]['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x4afa20,null))[_0xff12('0x26')](function(_0x591b79){if(_0x591b79){return _0x591b79[_0xff12('0xc0')](_0x5c09bd[_0xff12('0x3a')][_0xff12('0xba')]);}})['then'](respondWithStatusCode(_0x4afa20,null))[_0xff12('0x33')](handleError(_0x4afa20,null));};exports[_0xff12('0xc1')]=function(_0xf2f1d,_0x11089f){var _0x52a4a7=moment()[_0xff12('0xc2')]()[_0xff12('0x92')]();var _0x1db250=path['join'](config['root'],'server','files',_0xff12('0xc3'));var _0x300ee7=path['join'](config['root'],_0xff12('0xc4'),_0xff12('0xc5'),_0xff12('0xc6'));var _0x34f683=path['join'](_0x1db250,_0x52a4a7);var _0x1189e0=util[_0xff12('0xc7')](_0xff12('0xc8'),_0xf2f1d[_0xff12('0xb0')]['id'],_0x52a4a7);var _0x5d7e97=path[_0xff12('0xc9')](_0x1db250,_0x1189e0);var _0x32d2b0=[];_0x32d2b0[_0xff12('0x32')]({'model':db[_0xff12('0x69')],'as':_0xff12('0x69'),'attributes':['id',_0xff12('0x2d')],'raw':!![]});_0x32d2b0[_0xff12('0x32')]({'model':db['CmContact'],'as':_0xff12('0x60'),'attributes':['id',_0xff12('0xca'),_0xff12('0xcb')],'raw':!![]});if(_0xf2f1d['query']['attachments']){_0x32d2b0[_0xff12('0x32')]({'model':db['Attachment'],'as':_0xff12('0xcc'),'raw':!![]});}var _0x4ed84b=[{'model':db[_0xff12('0xb2')],'as':_0xff12('0xcd'),'attributes':['id',_0xff12('0x6c'),_0xff12('0x72'),_0xff12('0xce'),_0xff12('0xcf'),_0xff12('0x79')],'include':_0x32d2b0}];_0x4ed84b[_0xff12('0x32')]({'model':db['WhatsappAccount'],'as':_0xff12('0xd0'),'attributes':['id',_0xff12('0x2a')]});_0x4ed84b[_0xff12('0x32')]({'model':db[_0xff12('0x69')],'as':_0xff12('0xd1'),'attributes':['id','fullname']});return db['WhatsappInteraction']['find']({'where':{'id':_0xf2f1d[_0xff12('0xb0')]['id']},'include':_0x4ed84b})[_0xff12('0x26')](handleEntityNotFound(_0x11089f,null))[_0xff12('0x26')](function(_0x5cc705){if(_0x5cc705){var _0x20990e=_0x5cc705['get']({'plain':!![]});fs[_0xff12('0xd2')](_0x34f683);var _0x271404={'channel':_0xff12('0xd3'),'account':_0x20990e['Account']['name'],'agent':_0x20990e[_0xff12('0xd1')]?_0x20990e[_0xff12('0xd1')][_0xff12('0x2d')]:_0xff12('0xd4'),'createdAt':moment(_0x20990e[_0xff12('0x72')])['format'](_0xff12('0xd5'))[_0xff12('0x92')](),'closedAt':_0x20990e['closed']?moment(_0x20990e[_0xff12('0xd6')])['format'](_0xff12('0xd5'))[_0xff12('0x92')]():'','disposition':_0x20990e['disposition'],'messages':_(_0x20990e[_0xff12('0xcd')])[_0xff12('0x7d')]({'secret':![]})[_0xff12('0x2c')](function(_0x180218){if(_0x180218[_0xff12('0xcc')]){var _0x458704=path[_0xff12('0xc9')](_0x300ee7,_0x180218[_0xff12('0xcc')]['basename']);if(fs['existsSync'](_0x458704)){fs[_0xff12('0xd7')](_0x458704)['pipe'](fs[_0xff12('0xd8')](path[_0xff12('0xc9')](_0x34f683,_0x180218['Attachment'][_0xff12('0xd9')])));}}return{'date':moment(_0x180218['createdAt'])[_0xff12('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x180218[_0xff12('0xce')]===_0xff12('0xda')?_0x180218[_0xff12('0x69')]?_0x180218['User'][_0xff12('0x2d')]:_0xff12('0xdb'):_0x180218[_0xff12('0x60')][_0xff12('0xca')]+(_0x180218[_0xff12('0x60')]['lastName']?'\x20'+_0x180218[_0xff12('0x60')][_0xff12('0xcb')]:''),'body':_0x180218[_0xff12('0xcc')]?_0x180218[_0xff12('0xcc')][_0xff12('0xd9')]:_0x180218[_0xff12('0x6c')],'direction':_0x180218[_0xff12('0xce')]===_0xff12('0xda')?'A':'C','secret':_0x180218['secret'],'read':_0x180218[_0xff12('0x79')],'attachment':_0x180218[_0xff12('0xcc')]};})['value']()};return ejs[_0xff12('0xdc')](path['join'](config['root'],'server',_0xff12('0xdd'),_0xff12('0xde')),{'interaction':_0x271404})['then'](function(_0x1fbd96){var _0x4c98b2=path[_0xff12('0xc9')](_0x34f683,'transcript-'+_0x20990e['id']+'-'+_0x52a4a7+_0xff12('0xdf'));var _0xb92739={'path':_0x4c98b2,'channel':_0xff12('0xd3'),'interactionId':_0x20990e['id']};return pdf[_0xff12('0xe0')](_0x1fbd96,_0xb92739);})[_0xff12('0x26')](function(){return new BPromise(function(_0x12ee97,_0x2c828a){zipdir(_0x34f683,{'saveTo':_0x5d7e97},function(_0x9b7d57,_0xa1e875){if(_0x9b7d57)return _0x2c828a(_0x9b7d57);return _0x12ee97(_0xa1e875);});})['then'](function(){return new BPromise(function(_0x13b351,_0x2d3806){rimraf(_0x34f683,function(_0x52fd73){if(_0x52fd73)_0x2d3806(_0x52fd73);return _0x13b351();});});})[_0xff12('0x26')](function(){return _0x11089f[_0xff12('0xc1')](_0x5d7e97,_0x1189e0,function(_0x4dffdc){if(_0x4dffdc){console[_0xff12('0xe1')](_0xff12('0xe2'),_0x4dffdc);}else{fs[_0xff12('0xe3')](_0x5d7e97);}});});});}else{return _0x11089f[_0xff12('0x19')](0xc8);}})['catch'](handleError(_0x11089f,null));};
\ No newline at end of file
+var _0x3f49=['destroy','describe','ids','omit','findOne','WhatsappMessage','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','Messages','direction','secret','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','closed','disposition','Attachment','basename','existsSync','createReadStream','pipe','out','System','lastName','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./whatsappInteraction.socket','register','sendStatus','status','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','Users','TagIds','Tags','split','forEach','push','catch','index','map','WhatsappInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','length','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','i.WhatsappAccountId\x20IS\x20NULL','toString','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','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','includeAll','options','create'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3f49,0x11f));var _0x93f4=function(_0x3da216,_0x278791){_0x3da216=_0x3da216-0x0;var _0x3b9a6b=_0x3f49[_0x3da216];return _0x3b9a6b;};'use strict';var emlformat=require(_0x93f4('0x0'));var rimraf=require(_0x93f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93f4('0x2'));var rp=require(_0x93f4('0x3'));var moment=require(_0x93f4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x93f4('0x5'));var util=require(_0x93f4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x93f4('0x7'));var ejs=require(_0x93f4('0x8'));var fs=require('fs');var fs_extra=require(_0x93f4('0x9'));var _=require('lodash');var squel=require(_0x93f4('0xa'));var crypto=require('crypto');var jsforce=require(_0x93f4('0xb'));var deskjs=require(_0x93f4('0xc'));var toCsv=require(_0x93f4('0x7'));var querystring=require(_0x93f4('0xd'));var Papa=require(_0x93f4('0xe'));var Redis=require(_0x93f4('0xf'));var authService=require(_0x93f4('0x10'));var qs=require(_0x93f4('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x93f4('0x12'));var logger=require(_0x93f4('0x13'))(_0x93f4('0x14'));var utils=require(_0x93f4('0x15'));var config=require(_0x93f4('0x16'));var licenseUtil=require(_0x93f4('0x17'));var db=require(_0x93f4('0x18'))['db'];config[_0x93f4('0x19')]=_['defaults'](config[_0x93f4('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x93f4('0x19')]));require(_0x93f4('0x1a'))[_0x93f4('0x1b')](socket);function respondWithStatusCode(_0x52298b,_0x486a8b){_0x486a8b=_0x486a8b||0xcc;return function(_0x356da0){if(_0x356da0){return _0x52298b[_0x93f4('0x1c')](_0x486a8b);}return _0x52298b[_0x93f4('0x1d')](_0x486a8b)['end']();};}function respondWithResult(_0x33dfb3,_0x7e36d5){_0x7e36d5=_0x7e36d5||0xc8;return function(_0x53151e){if(_0x53151e){return _0x33dfb3[_0x93f4('0x1d')](_0x7e36d5)['json'](_0x53151e);}};}function respondWithFilteredResult(_0x5edf31,_0x1d4773){return function(_0x5b6488){if(_0x5b6488){var _0x38d8b6=typeof _0x1d4773['offset']==='undefined'&&typeof _0x1d4773['limit']===_0x93f4('0x1e');var _0x2cd6a6=_0x5b6488['count'];var _0x1ef4b3=_0x38d8b6?0x0:_0x1d4773['offset'];var _0x3ead08=_0x38d8b6?_0x5b6488[_0x93f4('0x1f')]:_0x1d4773[_0x93f4('0x20')]+_0x1d4773[_0x93f4('0x21')];var _0x5f396d;if(_0x3ead08>=_0x2cd6a6){_0x3ead08=_0x2cd6a6;_0x5f396d=0xc8;}else{_0x5f396d=0xce;}_0x5edf31['status'](_0x5f396d);return _0x5edf31[_0x93f4('0x22')](_0x93f4('0x23'),_0x1ef4b3+'-'+_0x3ead08+'/'+_0x2cd6a6)['json'](_0x5b6488);}return null;};}function patchUpdates(_0x58f8fd){return function(_0x584f01){try{jsonpatch[_0x93f4('0x24')](_0x584f01,_0x58f8fd,!![]);}catch(_0x3301b5){return BPromise[_0x93f4('0x25')](_0x3301b5);}return _0x584f01['save']();};}function saveUpdates(_0x31e249,_0x560797){return function(_0x20e337){if(_0x20e337){return _0x20e337[_0x93f4('0x26')](_0x31e249)['then'](function(_0x1bebc1){return _0x1bebc1;});}return null;};}function removeEntity(_0x1decfc,_0x186b3f){return function(_0x2cbaaf){if(_0x2cbaaf){return _0x2cbaaf['destroy']()[_0x93f4('0x27')](function(){_0x1decfc[_0x93f4('0x1d')](0xcc)[_0x93f4('0x28')]();});}};}function handleEntityNotFound(_0x353ab7,_0x590d52){return function(_0x2dfef0){if(!_0x2dfef0){_0x353ab7[_0x93f4('0x1c')](0x194);}return _0x2dfef0;};}function handleError(_0x30606b,_0x7f57d6){_0x7f57d6=_0x7f57d6||0x1f4;return function(_0x3d57c1){logger[_0x93f4('0x29')](_0x3d57c1[_0x93f4('0x2a')]);if(_0x3d57c1[_0x93f4('0x2b')]){delete _0x3d57c1['name'];}_0x30606b[_0x93f4('0x1d')](_0x7f57d6)[_0x93f4('0x2c')](_0x3d57c1);};}function getInteractionUsers(_0x5268ba,_0x52fe96){return new BPromise(function(_0xd27b64,_0x551bf9){try{if(_0x52fe96[_0x5268ba['id']]){_0x5268ba[_0x93f4('0x2d')]=_['map'](_0x52fe96[_0x5268ba['id']],function(_0x3ad08d){return{'id':_0x3ad08d['id'],'fullname':_0x3ad08d['fullname']};});}}catch(_0x4963c1){_0x551bf9(_0x4963c1);}_0xd27b64(_0x5268ba);});}function getInteractionTags(_0x277267,_0x35c095){return new BPromise(function(_0x181abf,_0x5c4a00){try{if(_0x277267[_0x93f4('0x2e')]){_0x277267[_0x93f4('0x2f')]=[];_0x277267[_0x93f4('0x2e')][_0x93f4('0x30')](',')[_0x93f4('0x31')](function(_0x3788f7){_0x277267[_0x93f4('0x2f')][_0x93f4('0x32')](_0x35c095[_0x3788f7]);});}delete _0x277267['TagIds'];}catch(_0x2fe781){_0x5c4a00(_0x2fe781);}_0x181abf(_0x277267);});}function updateWhatsappInteraction(_0x311875,_0x5abf30,_0x3e436a){return new BPromise(function(_0x43a1b2,_0x5441df){return getInteractionUsers(_0x311875,_0x3e436a)['then'](function(_0x218f8d){return getInteractionTags(_0x218f8d,_0x5abf30);})[_0x93f4('0x27')](function(_0x26fb01){_0x43a1b2(_0x26fb01);})[_0x93f4('0x33')](function(_0x938c31){_0x5441df(_0x938c31);});});}exports[_0x93f4('0x34')]=function(_0x4a1bdb,_0x3a3d74){var _0x25a197={},_0x134180={},_0x16358e={'count':0x0,'rows':[]};var _0x7c50ed=_[_0x93f4('0x35')](db[_0x93f4('0x36')][_0x93f4('0x37')],function(_0x3c133b){return{'name':_0x3c133b[_0x93f4('0x38')],'type':_0x3c133b[_0x93f4('0x39')]['key']};});_0x134180[_0x93f4('0x3a')]=_['map'](_0x7c50ed,_0x93f4('0x2b'));_0x134180[_0x93f4('0x3b')]=_[_0x93f4('0x3c')](_0x4a1bdb[_0x93f4('0x3b')]);_0x134180[_0x93f4('0x3d')]=_[_0x93f4('0x3e')](_0x134180[_0x93f4('0x3a')],_0x134180[_0x93f4('0x3b')]);_0x25a197[_0x93f4('0x3f')]=_[_0x93f4('0x3e')](_0x134180[_0x93f4('0x3a')],qs[_0x93f4('0x40')](_0x4a1bdb[_0x93f4('0x3b')][_0x93f4('0x40')]));_0x25a197[_0x93f4('0x3f')]=_0x25a197['attributes']['length']?_0x25a197['attributes']:_0x134180[_0x93f4('0x3a')];if(!_0x4a1bdb[_0x93f4('0x3b')][_0x93f4('0x41')](_0x93f4('0x42'))){_0x25a197['limit']=qs[_0x93f4('0x21')](_0x4a1bdb[_0x93f4('0x3b')][_0x93f4('0x21')]);_0x25a197[_0x93f4('0x20')]=qs[_0x93f4('0x20')](_0x4a1bdb[_0x93f4('0x3b')][_0x93f4('0x20')]);}_0x25a197[_0x93f4('0x43')]=qs[_0x93f4('0x44')](_0x4a1bdb[_0x93f4('0x3b')]['sort']);_0x25a197[_0x93f4('0x45')]=qs['filters'](_[_0x93f4('0x46')](_0x4a1bdb[_0x93f4('0x3b')],_0x134180[_0x93f4('0x3d')]),_0x7c50ed);var _0x5555b4=[];var _0x2c05ee=squel[_0x93f4('0x47')]()[_0x93f4('0x48')]('id')[_0x93f4('0x48')]('name')[_0x93f4('0x48')](_0x93f4('0x49'))[_0x93f4('0x4a')]('tools_tags');var _0x44410d=squel[_0x93f4('0x47')]()[_0x93f4('0x48')](_0x93f4('0x4b'))[_0x93f4('0x48')](_0x93f4('0x4c'))[_0x93f4('0x48')](_0x93f4('0x4d'))[_0x93f4('0x4a')](_0x93f4('0x4e'),'ui')[_0x93f4('0x4f')](_0x93f4('0x50'),'u',_0x93f4('0x51'));var _0x2964ca=squel[_0x93f4('0x47')]()['from'](_0x93f4('0x52'),'i')[_0x93f4('0x4f')](_0x93f4('0x53'),'c',_0x93f4('0x54'))[_0x93f4('0x4f')](_0x93f4('0x50'),'o','o.id\x20=\x20i.UserId')[_0x93f4('0x4f')](_0x93f4('0x55'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x93f4('0x4f')](_0x93f4('0x56'),'me',_0x93f4('0x57'))[_0x93f4('0x4f')]('whatsapp_interaction_has_tags','it',_0x93f4('0x58'))[_0x93f4('0x4f')](_0x93f4('0x59'),'t','t.id\x20=\x20it.TagId');var _0x2d4270=squel[_0x93f4('0x5a')]();var _0x16459f=[];var _0x41c882=squel['expr']();var _0x52db1f;if(_0x4a1bdb[_0x93f4('0x3b')][_0x93f4('0x5b')]){_0x52db1f=as[_0x93f4('0x5c')](_0x4a1bdb[_0x93f4('0x3b')][_0x93f4('0x5b')]);var _0x15b5fd=_0x52db1f[_0x93f4('0x5d')];for(var _0x58535f=0x0;_0x58535f<_0x52db1f[_0x93f4('0x5e')][_0x93f4('0x5f')];_0x58535f++){var _0x917aa3=_0x52db1f[_0x93f4('0x5e')][_0x58535f];var _0x247f0b='i';var _0x340d52=_[_0x93f4('0x60')](_0x7c50ed,[_0x93f4('0x2b'),_0x917aa3['field']]);if(!_0x340d52){switch(_0x917aa3['field']){case'unreadMessages':if(_0x917aa3[_0x93f4('0x61')]==0x1){_0x2964ca[_0x93f4('0x62')]('`'+_0x917aa3[_0x93f4('0x48')]+_0x93f4('0x63'));}else{_0x2964ca['having']('`'+_0x917aa3[_0x93f4('0x48')]+_0x93f4('0x64'));}break;case _0x93f4('0x65'):if(_0x917aa3[_0x93f4('0x66')]===_0x93f4('0x67')){if(_0x917aa3['value'][_0x93f4('0x30')]('\x20')[_0x93f4('0x5f')]>0x1){_0x2d4270[_0x15b5fd](_0x93f4('0x68'),qs['getFullTextValue'](_0x917aa3['value']),null);}else{var _0x8d827e='%'+_0x917aa3['value']+'%';_0x2d4270[_0x15b5fd](_0x93f4('0x69'),_0x8d827e,_0x8d827e,_0x8d827e);}}else{_0x340d52=_[_0x93f4('0x60')](_0x7c50ed,[_0x93f4('0x2b'),_0x93f4('0x6a')]);_0x917aa3[_0x93f4('0x48')]=_0x93f4('0x6a');_0x3a6b82=as[_0x93f4('0x6b')](_0x247f0b,_0x340d52[_0x93f4('0x39')],_0x917aa3);_0x2d4270[_0x15b5fd](_0x3a6b82[_0x93f4('0x6c')],_0x3a6b82[_0x93f4('0x61')][_0x93f4('0x6d')],_0x3a6b82[_0x93f4('0x61')][_0x93f4('0x28')]);}break;case _0x93f4('0x6e'):var _0x98835a=_0x917aa3['value'][_0x93f4('0x30')](',')[_0x93f4('0x35')](function(_0x4661d4){return Number(_0x4661d4);});_0x98835a[_0x93f4('0x31')](function(_0xd8f5c0){_0x41c882['or'](_0x93f4('0x6f'),'%,'+_0xd8f5c0+',%');});_0x16459f=_[_0x93f4('0x70')](_0x16459f,_0x98835a);break;case _0x93f4('0x71'):if(_0x917aa3[_0x93f4('0x66')]==='$substring'){_0x2d4270[_0x15b5fd](_0x93f4('0x72'),'%'+_0x917aa3[_0x93f4('0x61')]+'%',null);}else{_0x340d52=_[_0x93f4('0x60')](_0x7c50ed,[_0x93f4('0x2b'),_0x93f4('0x73')]);_0x917aa3[_0x93f4('0x48')]=_0x93f4('0x73');_0x3a6b82=as[_0x93f4('0x6b')](_0x247f0b,_0x340d52[_0x93f4('0x39')],_0x917aa3);_0x2d4270[_0x15b5fd](_0x3a6b82[_0x93f4('0x6c')],_0x3a6b82[_0x93f4('0x61')][_0x93f4('0x6d')],_0x3a6b82[_0x93f4('0x61')][_0x93f4('0x28')]);}break;case _0x93f4('0x74'):_0x3a6b82=as[_0x93f4('0x6b')]('me',null,_0x917aa3);_0x2d4270[_0x15b5fd](_0x3a6b82[_0x93f4('0x6c')],_0x3a6b82[_0x93f4('0x61')][_0x93f4('0x6d')],_0x3a6b82['value'][_0x93f4('0x28')]);break;}}else{var _0x3a6b82=as[_0x93f4('0x6b')](_0x247f0b,_0x340d52[_0x93f4('0x39')],_0x917aa3);_0x2d4270[_0x15b5fd](_0x3a6b82['text'],_0x3a6b82[_0x93f4('0x61')][_0x93f4('0x6d')],_0x3a6b82[_0x93f4('0x61')][_0x93f4('0x28')]);}}}else{var _0x157264=_(_0x4a1bdb[_0x93f4('0x3b')])[_0x93f4('0x3c')]()[_0x93f4('0x35')](function(_0x14242a){return _[_0x93f4('0x75')](_0x7c50ed,[_0x93f4('0x2b'),_0x14242a])?_0x14242a:undefined;})[_0x93f4('0x76')]()[_0x93f4('0x61')]();if(!_[_0x93f4('0x77')](_0x157264)){_0x157264[_0x93f4('0x31')](function(_0x4360ab){if(_0x4360ab===_0x93f4('0x78')){_0x2964ca['where'](_0x93f4('0x79'),[][_0x93f4('0x7a')](_0x4a1bdb['query'][_0x4360ab]));}else if(_0x4360ab===_0x93f4('0x7b')){var _0x2e92b8=JSON[_0x93f4('0x7c')](_0x4a1bdb[_0x93f4('0x3b')][_0x4360ab])['$gte'];var _0x53a249=JSON[_0x93f4('0x7c')](_0x4a1bdb[_0x93f4('0x3b')][_0x4360ab])[_0x93f4('0x7d')];_0x2964ca['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e92b8,_0x53a249);}else{if(_0x4a1bdb['query'][_0x4360ab]===_0x93f4('0x7e')){_0x2964ca[_0x93f4('0x45')]('i.'+_0x4360ab+_0x93f4('0x7f'));}else{_0x2964ca[_0x93f4('0x45')]('i.'+_0x4360ab+_0x93f4('0x80'),_0x4a1bdb[_0x93f4('0x3b')][_0x4360ab]);}}});}if(_0x4a1bdb[_0x93f4('0x3b')][_0x93f4('0x81')]){if(_0x4a1bdb['query'][_0x93f4('0x81')]==0x1){_0x2964ca['having'](_0x93f4('0x82'));}else{_0x2964ca[_0x93f4('0x62')](_0x93f4('0x83'));}}if(_0x4a1bdb[_0x93f4('0x3b')][_0x93f4('0x84')]){_0x16459f=_[_0x93f4('0x85')](_0x4a1bdb[_0x93f4('0x3b')][_0x93f4('0x84')])?_0x4a1bdb[_0x93f4('0x3b')][_0x93f4('0x84')]:new Array(_0x4a1bdb[_0x93f4('0x3b')][_0x93f4('0x84')]);_0x16459f[_0x93f4('0x31')](function(_0x2de9d1){_0x41c882['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2de9d1+',%');});}if(_0x4a1bdb[_0x93f4('0x3b')]['filter']){var _0xcfed34=_0x4a1bdb[_0x93f4('0x3b')][_0x93f4('0x86')][_0x93f4('0x87')]('\x5c','\x5c\x5c')[_0x93f4('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xcfed34)){_0x2d4270['or']('i.id\x20LIKE\x20?',_0xcfed34+'%')['or'](_0x93f4('0x88'),_0xcfed34+'%');}else{_0x2d4270['or'](_0x93f4('0x89'),qs[_0x93f4('0x8a')](_0xcfed34))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xcfed34+'%');}}}_0x2964ca[_0x93f4('0x45')](_0x2d4270);_0x2964ca[_0x93f4('0x8b')]('i.id');var _0x1fab14={'type':db[_0x93f4('0x8c')]['QueryTypes'][_0x93f4('0x8d')],'raw':!![]};var _0x5b946f=_0x2964ca[_0x93f4('0x8e')]();_0x5b946f[_0x93f4('0x48')]('i.id');_0x5b946f[_0x93f4('0x48')](_0x93f4('0x8f'),'unreadMessages');if(_0x25a197[_0x93f4('0x43')]){_0x25a197[_0x93f4('0x43')]['forEach'](function(_0x3d10b8){var _0x46c18a=_0x3d10b8[0x0]===_0x93f4('0x90')?_0x3d10b8[0x0]:'i.'+_0x3d10b8[0x0];_0x2964ca['order'](_0x46c18a,_0x3d10b8[0x1]===_0x93f4('0x91')?![]:!![]);});}if(!_[_0x93f4('0x77')](_0x16459f)){_0x2964ca[_0x93f4('0x62')](_0x41c882);_0x5b946f['where'](_0x93f4('0x92'),_0x16459f);}BPromise[_0x93f4('0x93')]()[_0x93f4('0x27')](function(){if(!_0x52db1f){if(_0x4a1bdb['query']['WhatsappAccountId'])return;_0x5b946f[_0x93f4('0x45')](_0x93f4('0x94'));_0x2964ca[_0x93f4('0x45')](_0x93f4('0x94'));return;}if(_0x4a1bdb[_0x93f4('0x95')][_0x93f4('0x96')]!=='agent')return;return _0x4a1bdb[_0x93f4('0x95')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x93f4('0x27')](function(_0x77539){if(_[_0x93f4('0x77')](_0x77539)){_0x5b946f['where'](_0x93f4('0x97'));_0x2964ca[_0x93f4('0x45')](_0x93f4('0x97'));}else{_0x5b946f[_0x93f4('0x45')](_0x93f4('0x79'),_[_0x93f4('0x35')](_0x77539,'id'));_0x2964ca[_0x93f4('0x45')](_0x93f4('0x79'),_[_0x93f4('0x35')](_0x77539,'id'));}});})[_0x93f4('0x27')](function(){if(_0x4a1bdb[_0x93f4('0x95')][_0x93f4('0x96')]==='agent'&&!_0x52db1f&&!_0x4a1bdb[_0x93f4('0x3b')]['WhatsappAccountId'])return[];return db['sequelize'][_0x93f4('0x3b')](_0x5b946f[_0x93f4('0x98')](),_0x1fab14);})[_0x93f4('0x27')](function(_0x49dfa3){_0x16358e[_0x93f4('0x1f')]=_0x49dfa3[_0x93f4('0x5f')];if(_0x16358e['count']===0x0)return[];return db[_0x93f4('0x99')][_0x93f4('0x3b')](_0x2c05ee[_0x93f4('0x98')](),_0x1fab14)[_0x93f4('0x27')](function(_0x2ca4c5){_0x5555b4=_[_0x93f4('0x9a')](_0x2ca4c5,'id');_0x1fab14=_['merge'](_0x1fab14,{'model':db[_0x93f4('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4a1bdb[_0x93f4('0x3b')][_0x93f4('0x40')]){_0x25a197[_0x93f4('0x3f')]['forEach'](function(_0x38ef38){_0x2964ca[_0x93f4('0x48')]('i.'+_0x38ef38);});}else{_0x2964ca[_0x93f4('0x48')](_0x93f4('0x8f'),'unreadMessages');_0x2964ca[_0x93f4('0x48')](_0x93f4('0x9b'),_0x93f4('0x9c'));_0x2964ca['field']('a.mandatoryDisposition',_0x93f4('0x9d'));_0x2964ca['field'](_0x93f4('0x9e'),_0x93f4('0x90'));_0x2964ca[_0x93f4('0x48')](_0x93f4('0x9f'));_0x2964ca['field'](_0x93f4('0xa0'),_0x93f4('0xa1'));_0x2964ca[_0x93f4('0x48')](_0x93f4('0xa2'),'Contact.lastName');_0x2964ca['field'](_0x93f4('0xa3'),'Contact.email');_0x2964ca['field'](_0x93f4('0xa4'),_0x93f4('0xa5'));_0x2964ca[_0x93f4('0x48')](_0x93f4('0xa6'),_0x93f4('0xa7'));_0x2964ca[_0x93f4('0x48')](_0x93f4('0xa8'),_0x93f4('0xa9'));_0x2964ca['field'](_0x93f4('0xaa'),_0x93f4('0xab'));_0x2964ca[_0x93f4('0x48')](_0x93f4('0xac'),_0x93f4('0xad'));_0x2964ca['field'](_0x93f4('0xae'),_0x93f4('0x2e'));}if(_0x25a197['limit'])_0x2964ca['limit'](_0x25a197[_0x93f4('0x21')]);if(_0x25a197[_0x93f4('0x20')])_0x2964ca[_0x93f4('0x20')](_0x25a197[_0x93f4('0x20')]);return db[_0x93f4('0x99')][_0x93f4('0x3b')](_0x2964ca[_0x93f4('0x98')](),_0x1fab14);})[_0x93f4('0x27')](function(_0x2326d2){if(_0x2326d2[_0x93f4('0x5f')]>0x0)_0x44410d['where'](_0x93f4('0xaf'),_[_0x93f4('0x35')](_0x2326d2,'id'));return db[_0x93f4('0x99')][_0x93f4('0x3b')](_0x44410d['toString'](),_0x1fab14)['then'](function(_0x3d3771){var _0x4dbb17=_[_0x93f4('0xb0')](_0x3d3771,_0x93f4('0xb1'));var _0x91634d=[];_0x2326d2[_0x93f4('0x31')](function(_0x309677){_0x91634d[_0x93f4('0x32')](updateWhatsappInteraction(_0x309677,_0x5555b4,_0x4dbb17));});return BPromise[_0x93f4('0xb2')](_0x91634d);});});})['then'](function(_0x36d49e){_0x16358e[_0x93f4('0xb3')]=_0x36d49e;return _0x16358e;})[_0x93f4('0x27')](respondWithFilteredResult(_0x3a3d74,_0x25a197))[_0x93f4('0x33')](handleError(_0x3a3d74,null));};exports[_0x93f4('0xb4')]=function(_0x82ebeb,_0x5e98c5){var _0x2cacda={'raw':![],'where':{'id':_0x82ebeb[_0x93f4('0xb5')]['id']}},_0x34cad9={};_0x34cad9[_0x93f4('0x3a')]=_[_0x93f4('0x3c')](db[_0x93f4('0x36')][_0x93f4('0x37')]);_0x34cad9['query']=_[_0x93f4('0x3c')](_0x82ebeb[_0x93f4('0x3b')]);_0x34cad9[_0x93f4('0x3d')]=_[_0x93f4('0x3e')](_0x34cad9[_0x93f4('0x3a')],_0x34cad9[_0x93f4('0x3b')]);_0x2cacda[_0x93f4('0x3f')]=_['intersection'](_0x34cad9[_0x93f4('0x3a')],qs['fields'](_0x82ebeb[_0x93f4('0x3b')]['fields']));_0x2cacda[_0x93f4('0x3f')]=_0x2cacda['attributes']['length']?_0x2cacda[_0x93f4('0x3f')]:_0x34cad9[_0x93f4('0x3a')];if(_0x82ebeb['query'][_0x93f4('0xb6')]){_0x2cacda['include']=[{'all':!![]}];}_0x2cacda=_['merge']({},_0x2cacda,_0x82ebeb[_0x93f4('0xb7')]);return db[_0x93f4('0x36')]['find'](_0x2cacda)[_0x93f4('0x27')](handleEntityNotFound(_0x5e98c5,null))['then'](respondWithResult(_0x5e98c5,null))[_0x93f4('0x33')](handleError(_0x5e98c5,null));};exports[_0x93f4('0xb8')]=function(_0x5ea89f,_0x5623c8){return db[_0x93f4('0x36')]['create'](_0x5ea89f[_0x93f4('0x74')],{})[_0x93f4('0x27')](respondWithResult(_0x5623c8,0xc9))[_0x93f4('0x33')](handleError(_0x5623c8,null));};exports[_0x93f4('0x26')]=function(_0x1aab82,_0x2173a5){if(_0x1aab82['body']['id']){delete _0x1aab82[_0x93f4('0x74')]['id'];}return db['WhatsappInteraction'][_0x93f4('0x60')]({'where':{'id':_0x1aab82[_0x93f4('0xb5')]['id']}})[_0x93f4('0x27')](handleEntityNotFound(_0x2173a5,null))[_0x93f4('0x27')](saveUpdates(_0x1aab82['body'],null))[_0x93f4('0x27')](respondWithResult(_0x2173a5,null))[_0x93f4('0x33')](handleError(_0x2173a5,null));};exports[_0x93f4('0xb9')]=function(_0x53a0d9,_0x199156){return db[_0x93f4('0x36')][_0x93f4('0x60')]({'where':{'id':_0x53a0d9[_0x93f4('0xb5')]['id']}})[_0x93f4('0x27')](handleEntityNotFound(_0x199156,null))[_0x93f4('0x27')](removeEntity(_0x199156,null))[_0x93f4('0x33')](handleError(_0x199156,null));};exports[_0x93f4('0xba')]=function(_0x19cb00,_0x4321bf){return db['WhatsappInteraction']['describe']()[_0x93f4('0x27')](respondWithResult(_0x4321bf,null))['catch'](handleError(_0x4321bf,null));};exports['addMessage']=function(_0x2e60c6,_0x181809,_0x585f14){return db['WhatsappMessage'][_0x93f4('0x60')]({'where':{'id':_0x2e60c6[_0x93f4('0xb5')]['id']}})[_0x93f4('0x27')](handleEntityNotFound(_0x181809,null))['then'](function(_0x4f715e){if(_0x4f715e){return _0x4f715e['addMessage'](_0x2e60c6[_0x93f4('0x74')][_0x93f4('0xbb')],_[_0x93f4('0xbc')](_0x2e60c6[_0x93f4('0x74')],[_0x93f4('0xbb'),'id'])||{});}})[_0x93f4('0x27')](respondWithResult(_0x181809,null))[_0x93f4('0x33')](handleError(_0x181809,null));};exports['getMessages']=function(_0x195e51,_0xcbd848,_0x394f89){var _0x35071a={'raw':![],'where':{}};var _0xd82e25={};var _0x2ecb4a={'count':0x0,'rows':[]};return db[_0x93f4('0x36')][_0x93f4('0xbd')]({'where':{'id':_0x195e51[_0x93f4('0xb5')]['id']}})[_0x93f4('0x27')](handleEntityNotFound(_0xcbd848,null))[_0x93f4('0x27')](function(_0x348b85){if(_0x348b85){_0xd82e25[_0x93f4('0x3a')]=_[_0x93f4('0x3c')](db[_0x93f4('0xbe')][_0x93f4('0x37')]);_0xd82e25[_0x93f4('0x3b')]=_[_0x93f4('0x3c')](_0x195e51[_0x93f4('0x3b')]);_0xd82e25[_0x93f4('0x3d')]=_[_0x93f4('0x3e')](_0xd82e25[_0x93f4('0x3a')],_0xd82e25[_0x93f4('0x3b')]);_0x35071a[_0x93f4('0x3f')]=_[_0x93f4('0x3e')](_0xd82e25['model'],qs[_0x93f4('0x40')](_0x195e51[_0x93f4('0x3b')][_0x93f4('0x40')]));_0x35071a[_0x93f4('0x3f')]=_0x35071a[_0x93f4('0x3f')][_0x93f4('0x5f')]?_0x35071a[_0x93f4('0x3f')]:_0xd82e25['model'];if(!_0x195e51[_0x93f4('0x3b')][_0x93f4('0x41')](_0x93f4('0x42'))){_0x35071a['limit']=qs['limit'](_0x195e51[_0x93f4('0x3b')]['limit']);_0x35071a[_0x93f4('0x20')]=qs[_0x93f4('0x20')](_0x195e51[_0x93f4('0x3b')][_0x93f4('0x20')]);}_0x35071a['order']=qs['sort'](_0x195e51['query'][_0x93f4('0x44')]);_0x35071a[_0x93f4('0x45')]=qs[_0x93f4('0x3d')](_[_0x93f4('0x46')](_0x195e51[_0x93f4('0x3b')],_0xd82e25[_0x93f4('0x3d')]));_0x35071a[_0x93f4('0x45')][_0x93f4('0xb1')]=_0x348b85['id'];if(_0x195e51[_0x93f4('0x3b')]['filter']){_0x35071a['where']=_[_0x93f4('0xbf')](_0x35071a[_0x93f4('0x45')],{'$or':_[_0x93f4('0x35')](_0x35071a[_0x93f4('0x3f')],function(_0x438d12){var _0x502301={};_0x502301[_0x438d12]={'$like':'%'+_0x195e51['query'][_0x93f4('0x86')]+'%'};return _0x502301;})});}if(_0x195e51[_0x93f4('0x3b')]['$gte']){var _0x371e4f=_0x195e51['query'][_0x93f4('0xc0')][_0x93f4('0x30')](',');var _0x341de8={};_0x341de8[_0x371e4f[0x0]]={'$gte':moment(_0x371e4f[0x1])[_0x93f4('0xc1')](_0x93f4('0xc2'))};_0x35071a[_0x93f4('0x45')]=_[_0x93f4('0xbf')](_0x35071a['where'],_0x341de8);}_0x35071a=_[_0x93f4('0xbf')]({},_0x35071a,_0x195e51[_0x93f4('0xb7')]);return db[_0x93f4('0xbe')][_0x93f4('0x1f')]({'where':_0x35071a[_0x93f4('0x45')]})[_0x93f4('0x27')](function(_0x22386b){_0x2ecb4a[_0x93f4('0x1f')]=_0x22386b;if(_0x195e51[_0x93f4('0x3b')][_0x93f4('0xb6')]){_0x35071a['include']=[{'all':!![]}];}return db[_0x93f4('0xbe')]['findAll'](_0x35071a);})['then'](function(_0x22bc2d){_0x2ecb4a[_0x93f4('0xb3')]=_0x22bc2d;return _0x2ecb4a;});}})['then'](respondWithFilteredResult(_0xcbd848,_0x35071a))['catch'](handleError(_0xcbd848,null));};exports[_0x93f4('0xc3')]=function(_0x530b2d,_0x2eb13c,_0x5e7ac1){return db['WhatsappInteraction'][_0x93f4('0x60')]({'where':{'id':_0x530b2d[_0x93f4('0xb5')]['id']}})[_0x93f4('0x27')](handleEntityNotFound(_0x2eb13c,null))[_0x93f4('0x27')](function(_0x115267){if(_0x115267){return _0x115267[_0x93f4('0xc4')](_0x530b2d[_0x93f4('0x74')]['ids'],_['omit'](_0x530b2d[_0x93f4('0x74')],['ids','id'])||{})[_0x93f4('0xc5')](function(){return db[_0x93f4('0x6e')][_0x93f4('0xc6')]({'attributes':['id','name',_0x93f4('0x49')],'where':{'id':_0x530b2d[_0x93f4('0x74')]['ids']}});})[_0x93f4('0x27')](function(_0x153177){socket[_0x93f4('0xc7')](_0x93f4('0xc8'),{'id':Number(_0x530b2d['params']['id']),'tags':_0x153177||[]});return{'id':Number(_0x530b2d[_0x93f4('0xb5')]['id']),'tags':_0x153177||[]};});}})[_0x93f4('0x27')](respondWithResult(_0x2eb13c,null))['catch'](handleError(_0x2eb13c,null));};exports[_0x93f4('0xc9')]=function(_0x5f1ba0,_0x41e4b3,_0x5208e1){return db[_0x93f4('0x36')]['find']({'where':{'id':_0x5f1ba0[_0x93f4('0xb5')]['id']}})[_0x93f4('0x27')](handleEntityNotFound(_0x41e4b3,null))['then'](function(_0x1e77c7){if(_0x1e77c7){return _0x1e77c7[_0x93f4('0xc9')](_0x5f1ba0[_0x93f4('0x3b')][_0x93f4('0xbb')]);}})['then'](respondWithStatusCode(_0x41e4b3,null))['catch'](handleError(_0x41e4b3,null));};exports[_0x93f4('0xca')]=function(_0x55df92,_0x38e5b0){var _0x53d62f=moment()[_0x93f4('0xcb')]()[_0x93f4('0x98')]();var _0x259a1b=path[_0x93f4('0xcc')](config[_0x93f4('0xcd')],_0x93f4('0xce'),_0x93f4('0xcf'),_0x93f4('0xd0'));var _0x4da164=path[_0x93f4('0xcc')](config[_0x93f4('0xcd')],_0x93f4('0xce'),_0x93f4('0xcf'),_0x93f4('0xd1'));var _0x2ba50b=path[_0x93f4('0xcc')](_0x259a1b,_0x53d62f);var _0x180e64=util['format'](_0x93f4('0xd2'),_0x55df92[_0x93f4('0xb5')]['id'],_0x53d62f);var _0x4ceba8=path[_0x93f4('0xcc')](_0x259a1b,_0x180e64);var _0x52d61e=[];_0x52d61e[_0x93f4('0x32')]({'model':db[_0x93f4('0x71')],'as':_0x93f4('0x71'),'attributes':['id',_0x93f4('0xd3')],'raw':!![]});_0x52d61e[_0x93f4('0x32')]({'model':db[_0x93f4('0xd4')],'as':'Contact','attributes':['id',_0x93f4('0xd5'),'lastName'],'raw':!![]});if(_0x55df92['query'][_0x93f4('0xd1')]){_0x52d61e['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x2ce1dc=[{'model':db['WhatsappMessage'],'as':_0x93f4('0xd6'),'attributes':['id',_0x93f4('0x74'),_0x93f4('0x7b'),_0x93f4('0xd7'),_0x93f4('0xd8'),_0x93f4('0x81')],'include':_0x52d61e}];_0x2ce1dc[_0x93f4('0x32')]({'model':db[_0x93f4('0xd9')],'as':_0x93f4('0xda'),'attributes':['id',_0x93f4('0x2b')]});_0x2ce1dc[_0x93f4('0x32')]({'model':db['User'],'as':_0x93f4('0xdb'),'attributes':['id',_0x93f4('0xd3')]});return db[_0x93f4('0x36')]['find']({'where':{'id':_0x55df92[_0x93f4('0xb5')]['id']},'include':_0x2ce1dc})[_0x93f4('0x27')](handleEntityNotFound(_0x38e5b0,null))[_0x93f4('0x27')](function(_0x31873e){if(_0x31873e){var _0x5ae64c=_0x31873e['get']({'plain':!![]});fs[_0x93f4('0xdc')](_0x2ba50b);var _0x433cd9={'channel':_0x93f4('0xdd'),'account':_0x5ae64c['Account'][_0x93f4('0x2b')],'agent':_0x5ae64c[_0x93f4('0xdb')]?_0x5ae64c[_0x93f4('0xdb')][_0x93f4('0xd3')]:_0x93f4('0xde'),'createdAt':moment(_0x5ae64c[_0x93f4('0x7b')])[_0x93f4('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x5ae64c[_0x93f4('0xdf')]?moment(_0x5ae64c['closedAt'])[_0x93f4('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x93f4('0x98')]():'','disposition':_0x5ae64c[_0x93f4('0xe0')],'messages':_(_0x5ae64c[_0x93f4('0xd6')])[_0x93f4('0x86')]({'secret':![]})['map'](function(_0x37647f){if(_0x37647f[_0x93f4('0xe1')]){var _0x103b24=path[_0x93f4('0xcc')](_0x4da164,_0x37647f[_0x93f4('0xe1')][_0x93f4('0xe2')]);if(fs[_0x93f4('0xe3')](_0x103b24)){fs[_0x93f4('0xe4')](_0x103b24)[_0x93f4('0xe5')](fs['createWriteStream'](path[_0x93f4('0xcc')](_0x2ba50b,_0x37647f[_0x93f4('0xe1')][_0x93f4('0xe2')])));}}return{'date':moment(_0x37647f[_0x93f4('0x7b')])[_0x93f4('0xc1')](_0x93f4('0xc2'))[_0x93f4('0x98')](),'sender':_0x37647f[_0x93f4('0xd7')]===_0x93f4('0xe6')?_0x37647f[_0x93f4('0x71')]?_0x37647f['User'][_0x93f4('0xd3')]:_0x93f4('0xe7'):_0x37647f[_0x93f4('0x65')][_0x93f4('0xd5')]+(_0x37647f[_0x93f4('0x65')][_0x93f4('0xe8')]?'\x20'+_0x37647f[_0x93f4('0x65')][_0x93f4('0xe8')]:''),'body':_0x37647f[_0x93f4('0xe1')]?_0x37647f[_0x93f4('0xe1')][_0x93f4('0xe2')]:_0x37647f[_0x93f4('0x74')],'direction':_0x37647f[_0x93f4('0xd7')]===_0x93f4('0xe6')?'A':'C','secret':_0x37647f[_0x93f4('0xd8')],'read':_0x37647f[_0x93f4('0x81')],'attachment':_0x37647f[_0x93f4('0xe1')]};})['value']()};return ejs['renderFile'](path[_0x93f4('0xcc')](config[_0x93f4('0xcd')],'server','views','downloadInteraction.ejs'),{'interaction':_0x433cd9})[_0x93f4('0x27')](function(_0x1d00d1){var _0x3d26b9=path[_0x93f4('0xcc')](_0x2ba50b,'transcript-'+_0x5ae64c['id']+'-'+_0x53d62f+'.pdf');var _0xf74d5d={'path':_0x3d26b9,'channel':_0x93f4('0xdd'),'interactionId':_0x5ae64c['id']};return pdf['createPdfFromHTML'](_0x1d00d1,_0xf74d5d);})[_0x93f4('0x27')](function(){return new BPromise(function(_0x152783,_0x152bb3){zipdir(_0x2ba50b,{'saveTo':_0x4ceba8},function(_0x549e8d,_0x58fd46){if(_0x549e8d)return _0x152bb3(_0x549e8d);return _0x152783(_0x58fd46);});})[_0x93f4('0x27')](function(){return new BPromise(function(_0x2d7941,_0x2221c8){rimraf(_0x2ba50b,function(_0x363d59){if(_0x363d59)_0x2221c8(_0x363d59);return _0x2d7941();});});})['then'](function(){return _0x38e5b0[_0x93f4('0xca')](_0x4ceba8,_0x180e64,function(_0x4171f4){if(_0x4171f4){console[_0x93f4('0xe9')](_0x93f4('0xea'),_0x4171f4);}else{fs[_0x93f4('0xeb')](_0x4ceba8);}});});});}else{return _0x38e5b0[_0x93f4('0x1c')](0xc8);}})[_0x93f4('0x33')](handleError(_0x38e5b0,null));};
\ No newline at end of file
index 8671529..083eeb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e65=['../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hook'];(function(_0x52609b,_0x157389){var _0x2a2088=function(_0x411071){while(--_0x411071){_0x52609b['push'](_0x52609b['shift']());}};_0x2a2088(++_0x157389);}(_0x4e65,0xc4));var _0x54e6=function(_0x5051d5,_0x5b547a){_0x5051d5=_0x5051d5-0x0;var _0x110fed=_0x4e65[_0x5051d5];return _0x110fed;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x54e6('0x0'))['db'][_0x54e6('0x1')];var WhatsappMessage=require(_0x54e6('0x0'))['db'][_0x54e6('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x54e6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x54e6('0x4')};function emitEvent(_0x337956){return function(_0x1fee1d,_0x1eb261,_0x23b09a){_0x1fee1d['getUsers']({'attributes':['id'],'raw':!![]})[_0x54e6('0x5')](function(_0x5d437f){_0x1fee1d[_0x54e6('0x6')](_0x54e6('0x7'),_0x5d437f[_0x54e6('0x8')](function(_0x18a402){return{'id':_0x18a402['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x1fee1d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x54e6('0x5')](function(_0x2050eb){_0x1fee1d[_0x54e6('0x6')](_0x54e6('0x9'),_0x2050eb[_0x54e6('0xa')]);WhatsappInteractionEvents[_0x54e6('0xb')](_0x337956+':'+_0x1fee1d['id'],_0x1fee1d);WhatsappInteractionEvents['emit'](_0x337956,_0x1fee1d);_0x23b09a(null);})[_0x54e6('0xc')](_0x23b09a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x54e6('0xd')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xe9f9=['../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','getUsers','setDataValue','Users','findAll','then','unreadMessages','emit','catch','hook','exports','events','WhatsappInteraction'];(function(_0x2d5eb1,_0x445e86){var _0x1acfc2=function(_0x9a6688){while(--_0x9a6688){_0x2d5eb1['push'](_0x2d5eb1['shift']());}};_0x1acfc2(++_0x445e86);}(_0xe9f9,0x174));var _0x9e9f=function(_0xc18974,_0xd3727c){_0xc18974=_0xc18974-0x0;var _0x13f7c6=_0xe9f9[_0xc18974];return _0x13f7c6;};'use strict';var EventEmitter=require(_0x9e9f('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x9e9f('0x1')];var WhatsappMessage=require(_0x9e9f('0x2'))['db'][_0x9e9f('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x9e9f('0x4')](0x0);var events={'afterCreate':_0x9e9f('0x5'),'afterUpdate':'update','afterDestroy':_0x9e9f('0x6')};function emitEvent(_0x47f4c7){return function(_0x372526,_0xde96fc,_0x549ea5){_0x372526[_0x9e9f('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x310be8){_0x372526[_0x9e9f('0x8')](_0x9e9f('0x9'),_0x310be8['map'](function(_0x1170bb){return{'id':_0x1170bb['id']};}));return WhatsappMessage[_0x9e9f('0xa')]({'where':{'WhatsappInteractionId':_0x372526['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9e9f('0xb')](function(_0x29aebc){_0x372526[_0x9e9f('0x8')](_0x9e9f('0xc'),_0x29aebc['length']);WhatsappInteractionEvents[_0x9e9f('0xd')](_0x47f4c7+':'+_0x372526['id'],_0x372526);WhatsappInteractionEvents[_0x9e9f('0xd')](_0x47f4c7,_0x372526);_0x549ea5(null);})[_0x9e9f('0xe')](_0x549ea5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x9e9f('0xf')](e,emitEvent(event));}}module[_0x9e9f('0x10')]=WhatsappInteractionEvents;
\ No newline at end of file
index db740b7..1871b27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc386=['moment','bluebird','request-promise','path','../../config/environment','define','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x292aeb,_0x3990e9){var _0x8e6a3=function(_0x3dcb01){while(--_0x3dcb01){_0x292aeb['push'](_0x292aeb['shift']());}};_0x8e6a3(++_0x3990e9);}(_0xc386,0xfc));var _0x6c38=function(_0x286a88,_0x1fff26){_0x286a88=_0x286a88-0x0;var _0x35591e=_0xc386[_0x286a88];return _0x35591e;};'use strict';var _=require(_0x6c38('0x0'));var util=require(_0x6c38('0x1'));var logger=require(_0x6c38('0x2'))(_0x6c38('0x3'));var moment=require(_0x6c38('0x4'));var BPromise=require(_0x6c38('0x5'));var rp=require(_0x6c38('0x6'));var fs=require('fs');var path=require(_0x6c38('0x7'));var rimraf=require('rimraf');var config=require(_0x6c38('0x8'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x56262e,_0x1b67fb){return _0x56262e[_0x6c38('0x9')]('WhatsappInteraction',attributes,{'tableName':_0x6c38('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c6c78,_0x6915ac,_0x4dfe80){if(_0x2c6c78[_0x6c38('0xb')](_0x6c38('0xc'))){_0x2c6c78[_0x6c38('0xd')]=moment()[_0x6c38('0xe')](_0x6c38('0xf'));}_0x4dfe80(null,_0x2c6c78);}}});};
\ No newline at end of file
+var _0x445a=['request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment'];(function(_0x47e440,_0x14c058){var _0x43f0a9=function(_0x157526){while(--_0x157526){_0x47e440['push'](_0x47e440['shift']());}};_0x43f0a9(++_0x14c058);}(_0x445a,0x1de));var _0xa445=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x445a[_0x432682];return _0x463d05;};'use strict';var _=require(_0xa445('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa445('0x1'));var moment=require(_0xa445('0x2'));var BPromise=require('bluebird');var rp=require(_0xa445('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa445('0x4'));var config=require(_0xa445('0x5'));var attributes=require(_0xa445('0x6'));module['exports']=function(_0x360e0b,_0x31c75e){return _0x360e0b[_0xa445('0x7')](_0xa445('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34bf65,_0x39cefe,_0x28bd29){if(_0x34bf65[_0xa445('0x9')](_0xa445('0xa'))){_0x34bf65['closedAt']=moment()[_0xa445('0xb')](_0xa445('0xc'));}_0x28bd29(null,_0x34bf65);}}});};
\ No newline at end of file
index 5c8bb6a..4c1ef17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca19=['stringify','error','code','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','limit','then','AddTagsToWhatsappInteraction','find','addTags','ids','body','spread','AddTags','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','register','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x3a3463,_0x223d11){var _0x3a075c=function(_0x5f4c2b){while(--_0x5f4c2b){_0x3a3463['push'](_0x3a3463['shift']());}};_0x3a075c(++_0x223d11);}(_0xca19,0x87));var _0x9ca1=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xca19[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x9ca1('0x0'));var util=require(_0x9ca1('0x1'));var moment=require(_0x9ca1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ca1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9ca1('0x4'))(_0x9ca1('0x5'));var config=require(_0x9ca1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9ca1('0x7')]['http']({'port':0x232a});config['redis']=_[_0x9ca1('0x8')](config[_0x9ca1('0x9')],{'host':_0x9ca1('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ca1('0x9')]));require('./whatsappInteraction.socket')[_0x9ca1('0xb')](socket);function respondWithRpcPromise(_0x15e526,_0x497732,_0x3f7bbe){return new BPromise(function(_0x5b151d,_0x3bf273){return client['request'](_0x15e526,_0x3f7bbe)['then'](function(_0x469ffa){logger[_0x9ca1('0xc')](_0x9ca1('0xd'),_0x497732,_0x9ca1('0xe'));logger[_0x9ca1('0xf')](_0x9ca1('0x10'),_0x497732,'request\x20sent',JSON[_0x9ca1('0x11')](_0x469ffa));if(_0x469ffa[_0x9ca1('0x12')]){if(_0x469ffa['error'][_0x9ca1('0x13')]===0x1f4){logger[_0x9ca1('0x12')](_0x9ca1('0xd'),_0x497732,_0x469ffa['error'][_0x9ca1('0x14')]);return _0x3bf273(_0x469ffa[_0x9ca1('0x12')][_0x9ca1('0x14')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x497732,_0x469ffa[_0x9ca1('0x12')][_0x9ca1('0x14')]);return _0x5b151d(_0x469ffa['error']['message']);}else{logger[_0x9ca1('0xc')](_0x9ca1('0xd'),_0x497732,_0x9ca1('0xe'));_0x5b151d(_0x469ffa['result'][_0x9ca1('0x14')]);}})[_0x9ca1('0x15')](function(_0x38e0db){logger[_0x9ca1('0x12')](_0x9ca1('0xd'),_0x497732,_0x38e0db);_0x3bf273(_0x38e0db);});});}exports[_0x9ca1('0x16')]=function(_0x28a208){var _0x4a75a9=this;return new Promise(function(_0x1bda1b,_0x30d3d4){return db[_0x9ca1('0x17')][_0x9ca1('0x18')](_0x28a208['body'],{'raw':_0x28a208[_0x9ca1('0x19')]?_0x28a208[_0x9ca1('0x19')][_0x9ca1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28a208[_0x9ca1('0x19')]?_0x28a208[_0x9ca1('0x19')][_0x9ca1('0x1b')]||null:null,'attributes':_0x28a208[_0x9ca1('0x19')]?_0x28a208[_0x9ca1('0x19')][_0x9ca1('0x1c')]||null:null,'limit':_0x28a208['options']?_0x28a208['options'][_0x9ca1('0x1d')]||null:null})[_0x9ca1('0x1e')](function(_0x82d8e3){logger['info']('UpdateWhatsappInteraction',_0x28a208);logger['debug']('UpdateWhatsappInteraction',_0x28a208,JSON[_0x9ca1('0x11')](_0x82d8e3));_0x1bda1b(_0x82d8e3);})['catch'](function(_0x331459){logger[_0x9ca1('0x12')](_0x9ca1('0x16'),_0x331459[_0x9ca1('0x14')],_0x28a208);_0x30d3d4(_0x4a75a9[_0x9ca1('0x12')](0x1f4,_0x331459[_0x9ca1('0x14')]));});});};exports[_0x9ca1('0x1f')]=function(_0x4b5ad5){return new Promise(function(_0x3fcd41,_0x520d2c){return db['WhatsappInteraction'][_0x9ca1('0x20')]({'where':_0x4b5ad5['options']?_0x4b5ad5[_0x9ca1('0x19')]['where']||null:null})[_0x9ca1('0x1e')](function(_0x593932){if(_0x593932){return _0x593932[_0x9ca1('0x21')](_0x4b5ad5['body'][_0x9ca1('0x22')],_['omit'](_0x4b5ad5[_0x9ca1('0x23')],[_0x9ca1('0x22'),'id'])||{});}})[_0x9ca1('0x24')](function(_0x3090c5){logger[_0x9ca1('0xc')]('AddTags',_0x4b5ad5);logger[_0x9ca1('0xf')](_0x9ca1('0x25'),_0x4b5ad5,JSON[_0x9ca1('0x11')](_0x3090c5));_0x3fcd41(_0x3090c5);})[_0x9ca1('0x15')](function(_0x75f21d){logger['error'](_0x9ca1('0x25'),_0x75f21d[_0x9ca1('0x14')],_0x4b5ad5);_0x520d2c(_this['error'](0x1f4,_0x75f21d[_0x9ca1('0x14')]));});});};
\ No newline at end of file
+var _0xb316=['limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','stringify','lodash','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','info','catch','WhatsappInteraction','update','body','options','raw','where'];(function(_0x25677a,_0x17898e){var _0x1adbf8=function(_0x226513){while(--_0x226513){_0x25677a['push'](_0x25677a['shift']());}};_0x1adbf8(++_0x17898e);}(_0xb316,0xf4));var _0x6b31=function(_0x4c0e82,_0x5cdadb){_0x4c0e82=_0x4c0e82-0x0;var _0x9bf6ad=_0xb316[_0x4c0e82];return _0x9bf6ad;};'use strict';var _=require(_0x6b31('0x0'));var util=require('util');var moment=require(_0x6b31('0x1'));var BPromise=require(_0x6b31('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b31('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6b31('0x4'));var config=require(_0x6b31('0x5'));var jayson=require(_0x6b31('0x6'));var client=jayson['client'][_0x6b31('0x7')]({'port':0x232a});config[_0x6b31('0x8')]=_[_0x6b31('0x9')](config[_0x6b31('0x8')],{'host':_0x6b31('0xa'),'port':0x18eb});var socket=require(_0x6b31('0xb'))(new Redis(config['redis']));require(_0x6b31('0xc'))[_0x6b31('0xd')](socket);function respondWithRpcPromise(_0x2b6ab9,_0xc207a0,_0x12ba5b){return new BPromise(function(_0xe4384f,_0x40d7df){return client[_0x6b31('0xe')](_0x2b6ab9,_0x12ba5b)[_0x6b31('0xf')](function(_0x368537){logger['info'](_0x6b31('0x10'),_0xc207a0,_0x6b31('0x11'));logger[_0x6b31('0x12')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0xc207a0,_0x6b31('0x11'),JSON['stringify'](_0x368537));if(_0x368537[_0x6b31('0x13')]){if(_0x368537[_0x6b31('0x13')]['code']===0x1f4){logger[_0x6b31('0x13')](_0x6b31('0x10'),_0xc207a0,_0x368537[_0x6b31('0x13')]['message']);return _0x40d7df(_0x368537[_0x6b31('0x13')][_0x6b31('0x14')]);}logger[_0x6b31('0x13')](_0x6b31('0x10'),_0xc207a0,_0x368537[_0x6b31('0x13')]['message']);return _0xe4384f(_0x368537[_0x6b31('0x13')][_0x6b31('0x14')]);}else{logger[_0x6b31('0x15')](_0x6b31('0x10'),_0xc207a0,_0x6b31('0x11'));_0xe4384f(_0x368537['result'][_0x6b31('0x14')]);}})[_0x6b31('0x16')](function(_0x147d21){logger['error'](_0x6b31('0x10'),_0xc207a0,_0x147d21);_0x40d7df(_0x147d21);});});}exports['UpdateWhatsappInteraction']=function(_0xca7b7c){var _0x50a863=this;return new Promise(function(_0x532d4d,_0x3d0a2f){return db[_0x6b31('0x17')][_0x6b31('0x18')](_0xca7b7c[_0x6b31('0x19')],{'raw':_0xca7b7c[_0x6b31('0x1a')]?_0xca7b7c['options'][_0x6b31('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xca7b7c[_0x6b31('0x1a')]?_0xca7b7c[_0x6b31('0x1a')][_0x6b31('0x1c')]||null:null,'attributes':_0xca7b7c[_0x6b31('0x1a')]?_0xca7b7c[_0x6b31('0x1a')]['attributes']||null:null,'limit':_0xca7b7c['options']?_0xca7b7c[_0x6b31('0x1a')][_0x6b31('0x1d')]||null:null})[_0x6b31('0xf')](function(_0x15f500){logger[_0x6b31('0x15')](_0x6b31('0x1e'),_0xca7b7c);logger[_0x6b31('0x12')](_0x6b31('0x1e'),_0xca7b7c,JSON['stringify'](_0x15f500));_0x532d4d(_0x15f500);})[_0x6b31('0x16')](function(_0x11fdbe){logger[_0x6b31('0x13')](_0x6b31('0x1e'),_0x11fdbe['message'],_0xca7b7c);_0x3d0a2f(_0x50a863[_0x6b31('0x13')](0x1f4,_0x11fdbe['message']));});});};exports[_0x6b31('0x1f')]=function(_0x43323b){return new Promise(function(_0x5dcd90,_0x14bcf0){return db[_0x6b31('0x17')][_0x6b31('0x20')]({'where':_0x43323b[_0x6b31('0x1a')]?_0x43323b[_0x6b31('0x1a')][_0x6b31('0x1c')]||null:null})[_0x6b31('0xf')](function(_0xc0e670){if(_0xc0e670){return _0xc0e670[_0x6b31('0x21')](_0x43323b[_0x6b31('0x19')][_0x6b31('0x22')],_[_0x6b31('0x23')](_0x43323b[_0x6b31('0x19')],[_0x6b31('0x22'),'id'])||{});}})[_0x6b31('0x24')](function(_0x4be420){logger['info'](_0x6b31('0x25'),_0x43323b);logger['debug'](_0x6b31('0x25'),_0x43323b,JSON[_0x6b31('0x26')](_0x4be420));_0x5dcd90(_0x4be420);})[_0x6b31('0x16')](function(_0x145128){logger['error']('AddTags',_0x145128['message'],_0x43323b);_0x14bcf0(_this[_0x6b31('0x13')](0x1f4,_0x145128['message']));});});};
\ No newline at end of file
index ce9a24d..6a4b0b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1353=['whatsappInteraction:','./whatsappInteraction.events','save','remove','emit','removeListener','register','length'];(function(_0x146f59,_0x16e733){var _0x59d0cc=function(_0x8b7fb9){while(--_0x8b7fb9){_0x146f59['push'](_0x146f59['shift']());}};_0x59d0cc(++_0x16e733);}(_0x1353,0x81));var _0x3135=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x1353[_0xbd08b4];return _0x314f1e;};'use strict';var WhatsappInteractionEvents=require(_0x3135('0x0'));var events=[_0x3135('0x1'),_0x3135('0x2'),'update'];function createListener(_0x1d806d,_0x114f58){return function(_0x4f0845){_0x114f58[_0x3135('0x3')](_0x1d806d,_0x4f0845);};}function removeListener(_0x1e07a1,_0x3860f2){return function(){WhatsappInteractionEvents[_0x3135('0x4')](_0x1e07a1,_0x3860f2);};}exports[_0x3135('0x5')]=function(_0x1bca1f){for(var _0x1e0a39=0x0,_0x25e8be=events[_0x3135('0x6')];_0x1e0a39<_0x25e8be;_0x1e0a39++){var _0x3224c8=events[_0x1e0a39];var _0x398a19=createListener(_0x3135('0x7')+_0x3224c8,_0x1bca1f);WhatsappInteractionEvents['on'](_0x3224c8,_0x398a19);}};
\ No newline at end of file
+var _0xc1c3=['./whatsappInteraction.events','save','remove','update','emit','register','length','whatsappInteraction:'];(function(_0x24306d,_0x17542d){var _0x8e197d=function(_0x448876){while(--_0x448876){_0x24306d['push'](_0x24306d['shift']());}};_0x8e197d(++_0x17542d);}(_0xc1c3,0x130));var _0x3c1c=function(_0x1940cc,_0x36159d){_0x1940cc=_0x1940cc-0x0;var _0x4522cb=_0xc1c3[_0x1940cc];return _0x4522cb;};'use strict';var WhatsappInteractionEvents=require(_0x3c1c('0x0'));var events=[_0x3c1c('0x1'),_0x3c1c('0x2'),_0x3c1c('0x3')];function createListener(_0x1f5351,_0x49d97a){return function(_0x2ab8e7){_0x49d97a[_0x3c1c('0x4')](_0x1f5351,_0x2ab8e7);};}function removeListener(_0x1df6da,_0xd28156){return function(){WhatsappInteractionEvents['removeListener'](_0x1df6da,_0xd28156);};}exports[_0x3c1c('0x5')]=function(_0x39c002){for(var _0x5a2376=0x0,_0x1ed05d=events[_0x3c1c('0x6')];_0x5a2376<_0x1ed05d;_0x5a2376++){var _0x20c3e6=events[_0x5a2376];var _0x4e1234=createListener(_0x3c1c('0x7')+_0x20c3e6,_0x39c002);WhatsappInteractionEvents['on'](_0x20c3e6,_0x4e1234);}};
\ No newline at end of file
index 5f4277b..8e9b529 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea39=['/describe','describe','/:id','show','create','post','status','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated'];(function(_0x5e4ad7,_0x3ad346){var _0x5639a8=function(_0x10eb62){while(--_0x10eb62){_0x5e4ad7['push'](_0x5e4ad7['shift']());}};_0x5639a8(++_0x3ad346);}(_0xea39,0x1f2));var _0x9ea3=function(_0x3dcec7,_0x58d97c){_0x3dcec7=_0x3dcec7-0x0;var _0x1f1623=_0xea39[_0x3dcec7];return _0x1f1623;};'use strict';var multer=require('multer');var util=require(_0x9ea3('0x0'));var path=require(_0x9ea3('0x1'));var timeout=require(_0x9ea3('0x2'));var express=require('express');var router=express[_0x9ea3('0x3')]();var fs_extra=require(_0x9ea3('0x4'));var auth=require(_0x9ea3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0x9ea3('0x6')]('/',auth[_0x9ea3('0x7')](),controller['index']);router[_0x9ea3('0x6')](_0x9ea3('0x8'),auth[_0x9ea3('0x7')](),controller[_0x9ea3('0x9')]);router[_0x9ea3('0x6')](_0x9ea3('0xa'),auth[_0x9ea3('0x7')](),controller[_0x9ea3('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked']('whatsapp','whatsappmessage:create'),controller[_0x9ea3('0xc')]);router[_0x9ea3('0xd')]('/:id/status',controller[_0x9ea3('0xe')]);router['put']('/:id',auth[_0x9ea3('0x7')](),controller['update']);router['put'](_0x9ea3('0xf'),auth[_0x9ea3('0x7')](),controller[_0x9ea3('0x10')]);router[_0x9ea3('0x11')](_0x9ea3('0x12'),auth[_0x9ea3('0x7')](),controller[_0x9ea3('0x13')]);router[_0x9ea3('0x14')](_0x9ea3('0xa'),auth[_0x9ea3('0x7')](),controller[_0x9ea3('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x68cf=['get','isAuthenticated','index','/describe','/:id','post','whatsappmessage:create','create','/:id/status','put','/:id/accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller'];(function(_0x537b76,_0x689b76){var _0xaea90b=function(_0x4b367f){while(--_0x4b367f){_0x537b76['push'](_0x537b76['shift']());}};_0xaea90b(++_0x689b76);}(_0x68cf,0xc7));var _0xf68c=function(_0x160541,_0x50462e){_0x160541=_0x160541-0x0;var _0x39915c=_0x68cf[_0x160541];return _0x39915c;};'use strict';var multer=require(_0xf68c('0x0'));var util=require(_0xf68c('0x1'));var path=require(_0xf68c('0x2'));var timeout=require(_0xf68c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf68c('0x4'));var auth=require(_0xf68c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf68c('0x6'));var controller=require(_0xf68c('0x7'));router[_0xf68c('0x8')]('/',auth[_0xf68c('0x9')](),controller[_0xf68c('0xa')]);router['get'](_0xf68c('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xf68c('0x8')](_0xf68c('0xc'),auth[_0xf68c('0x9')](),controller['show']);router[_0xf68c('0xd')]('/',auth[_0xf68c('0x9')](),interaction['tracked']('whatsapp',_0xf68c('0xe')),controller[_0xf68c('0xf')]);router[_0xf68c('0xd')](_0xf68c('0x10'),controller['status']);router[_0xf68c('0x11')]('/:id',auth[_0xf68c('0x9')](),controller['update']);router[_0xf68c('0x11')](_0xf68c('0x12'),auth[_0xf68c('0x9')](),controller['accept']);router[_0xf68c('0x11')](_0xf68c('0x13'),auth[_0xf68c('0x9')](),controller[_0xf68c('0x14')]);router[_0xf68c('0x15')](_0xf68c('0xc'),auth[_0xf68c('0x9')](),controller[_0xf68c('0x16')]);module['exports']=router;
\ No newline at end of file
index 7410d60..1351c42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c9c=['medium','BOOLEAN','ENUM','out','STRING','DATE','TEXT'];(function(_0xb7f071,_0x34134a){var _0xdc2c6d=function(_0x58cdff){while(--_0x58cdff){_0xb7f071['push'](_0xb7f071['shift']());}};_0xdc2c6d(++_0x34134a);}(_0x4c9c,0x180));var _0xc4c9=function(_0x1c80bd,_0x356976){_0x1c80bd=_0x1c80bd-0x0;var _0x15b7fc=_0x4c9c[_0x1c80bd];return _0x15b7fc;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xc4c9('0x0')](_0xc4c9('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xc4c9('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc4c9('0x3')]('in',_0xc4c9('0x4')),'defaultValue':_0xc4c9('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xc4c9('0x5')]},'readAt':{'type':Sequelize[_0xc4c9('0x6')]},'secret':{'type':Sequelize[_0xc4c9('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc4c9('0x5')]},'providerResponse':{'type':Sequelize[_0xc4c9('0x0')]}};
\ No newline at end of file
+var _0x6361=['exports','TEXT','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x22664f,_0x5500d0){var _0xe96d8e=function(_0x1a4c99){while(--_0x1a4c99){_0x22664f['push'](_0x22664f['shift']());}};_0xe96d8e(++_0x5500d0);}(_0x6361,0x76));var _0x1636=function(_0x51785c,_0x5d6acd){_0x51785c=_0x51785c-0x0;var _0x14c40c=_0x6361[_0x51785c];return _0x14c40c;};'use strict';var Sequelize=require(_0x1636('0x0'));module[_0x1636('0x1')]={'body':{'type':Sequelize[_0x1636('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1636('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1636('0x4')]('in',_0x1636('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x1636('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1636('0x6')]},'providerResponse':{'type':Sequelize[_0x1636('0x2')]}};
\ No newline at end of file
index 744c4f9..b4cc190 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd421=['mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','undefined','count','offset','set','apply','save','update','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filters','pick','where','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','include','find','create','body','describe','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','User','motionChannel','rejectmessage','WhatsappAccount','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x10824e,_0x453512){var _0x37d872=function(_0x4d7c5d){while(--_0x4d7c5d){_0x10824e['push'](_0x10824e['shift']());}};_0x37d872(++_0x453512);}(_0xd421,0x195));var _0x1d42=function(_0x66c159,_0x2e5ecd){_0x66c159=_0x66c159-0x0;var _0x1d5ccd=_0xd421[_0x66c159];return _0x1d5ccd;};'use strict';var emlformat=require(_0x1d42('0x0'));var rimraf=require(_0x1d42('0x1'));var zipdir=require(_0x1d42('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d42('0x3'));var moment=require(_0x1d42('0x4'));var BPromise=require(_0x1d42('0x5'));var Mustache=require(_0x1d42('0x6'));var util=require(_0x1d42('0x7'));var path=require(_0x1d42('0x8'));var sox=require('sox');var csv=require(_0x1d42('0x9'));var ejs=require(_0x1d42('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1d42('0xb'));var jsforce=require(_0x1d42('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1d42('0x9'));var querystring=require(_0x1d42('0xd'));var Papa=require(_0x1d42('0xe'));var Redis=require(_0x1d42('0xf'));var authService=require(_0x1d42('0x10'));var qs=require(_0x1d42('0x11'));var as=require(_0x1d42('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d42('0x13'))(_0x1d42('0x14'));var utils=require('../../config/utils');var config=require(_0x1d42('0x15'));var licenseUtil=require(_0x1d42('0x16'));var db=require(_0x1d42('0x17'))['db'];config[_0x1d42('0x18')]=_[_0x1d42('0x19')](config['redis'],{'host':_0x1d42('0x1a'),'port':0x18eb});var socket=require(_0x1d42('0x1b'))(new Redis(config['redis']));require(_0x1d42('0x1c'))[_0x1d42('0x1d')](socket);var jayson=require(_0x1d42('0x1e'));var client=jayson[_0x1d42('0x1f')][_0x1d42('0x20')]({'port':0x232c});var client9002=jayson[_0x1d42('0x1f')][_0x1d42('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x225253,_0x596222,_0x3cdf9c,_0x2eeacf){return new BPromise(function(_0x3b768a,_0x2a7668){var _0xd77cf6=_0x2eeacf||client;return _0xd77cf6['request'](_0x225253,_0x3cdf9c)[_0x1d42('0x21')](function(_0xbd89dd){logger[_0x1d42('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x596222,'request\x20sent');logger['debug'](_0x1d42('0x23'),_0x596222,_0x1d42('0x24'),JSON[_0x1d42('0x25')](_0xbd89dd));if(_0xbd89dd['error']){if(_0xbd89dd[_0x1d42('0x26')]['code']===0x1f4){logger[_0x1d42('0x26')](_0x1d42('0x27'),_0x596222,_0xbd89dd[_0x1d42('0x26')][_0x1d42('0x28')]);return _0x2a7668(_0xbd89dd[_0x1d42('0x26')]['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x596222,_0xbd89dd[_0x1d42('0x26')][_0x1d42('0x28')]);return _0x3b768a(_0xbd89dd[_0x1d42('0x26')][_0x1d42('0x28')]);}else{logger[_0x1d42('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x596222,_0x1d42('0x24'));_0x3b768a(_0xbd89dd['result'][_0x1d42('0x28')]);}})[_0x1d42('0x29')](function(_0x4b74bf){logger[_0x1d42('0x26')](_0x1d42('0x27'),_0x596222,_0x4b74bf);_0x2a7668(_0x4b74bf);});});}function respondWithStatusCode(_0x569425,_0x23b5cf){_0x23b5cf=_0x23b5cf||0xcc;return function(_0x23c84c){if(_0x23c84c){return _0x569425[_0x1d42('0x2a')](_0x23b5cf);}return _0x569425[_0x1d42('0x2b')](_0x23b5cf)[_0x1d42('0x2c')]();};}function respondWithResult(_0x880b6e,_0x528e24){_0x528e24=_0x528e24||0xc8;return function(_0x128269){if(_0x128269){return _0x880b6e[_0x1d42('0x2b')](_0x528e24)[_0x1d42('0x2d')](_0x128269);}};}function respondWithFilteredResult(_0x4889a7,_0x44ed7a){return function(_0x256327){if(_0x256327){var _0x5987f7=typeof _0x44ed7a['offset']==='undefined'&&typeof _0x44ed7a['limit']===_0x1d42('0x2e');var _0x30cb3e=_0x256327[_0x1d42('0x2f')];var _0x37e4d3=_0x5987f7?0x0:_0x44ed7a[_0x1d42('0x30')];var _0x428bcc=_0x5987f7?_0x256327['count']:_0x44ed7a[_0x1d42('0x30')]+_0x44ed7a['limit'];var _0x31d528;if(_0x428bcc>=_0x30cb3e){_0x428bcc=_0x30cb3e;_0x31d528=0xc8;}else{_0x31d528=0xce;}_0x4889a7[_0x1d42('0x2b')](_0x31d528);return _0x4889a7[_0x1d42('0x31')]('Content-Range',_0x37e4d3+'-'+_0x428bcc+'/'+_0x30cb3e)['json'](_0x256327);}return null;};}function patchUpdates(_0x392b12){return function(_0x483067){try{jsonpatch[_0x1d42('0x32')](_0x483067,_0x392b12,!![]);}catch(_0x51936f){return BPromise['reject'](_0x51936f);}return _0x483067[_0x1d42('0x33')]();};}function saveUpdates(_0x2bb1d8,_0x357976){return function(_0x4ef1eb){if(_0x4ef1eb){return _0x4ef1eb[_0x1d42('0x34')](_0x2bb1d8)['then'](function(_0x3e83b8){return _0x3e83b8;});}return null;};}function removeEntity(_0x1cb7e5,_0x4fd583){return function(_0x3b86f9){if(_0x3b86f9){return _0x3b86f9[_0x1d42('0x35')]()[_0x1d42('0x21')](function(){_0x1cb7e5[_0x1d42('0x2b')](0xcc)[_0x1d42('0x2c')]();});}};}function handleEntityNotFound(_0x2dd711,_0x4c3be8){return function(_0x15bb86){if(!_0x15bb86){_0x2dd711[_0x1d42('0x2a')](0x194);}return _0x15bb86;};}function handleError(_0x3a6098,_0x5b4945){_0x5b4945=_0x5b4945||0x1f4;return function(_0x131cd1){logger['error'](_0x131cd1[_0x1d42('0x36')]);if(_0x131cd1[_0x1d42('0x37')]){delete _0x131cd1[_0x1d42('0x37')];}_0x3a6098['status'](_0x5b4945)[_0x1d42('0x38')](_0x131cd1);};}exports[_0x1d42('0x39')]=function(_0x688a65,_0xac3f64){var _0x510629={},_0x78dd19={},_0x57e497={'count':0x0,'rows':[]};var _0x21d131=_[_0x1d42('0x3a')](db[_0x1d42('0x3b')][_0x1d42('0x3c')],function(_0x15aa3d){return{'name':_0x15aa3d['fieldName'],'type':_0x15aa3d[_0x1d42('0x3d')]['key']};});_0x78dd19[_0x1d42('0x3e')]=_[_0x1d42('0x3a')](_0x21d131,_0x1d42('0x37'));_0x78dd19[_0x1d42('0x3f')]=_['keys'](_0x688a65['query']);_0x78dd19['filters']=_[_0x1d42('0x40')](_0x78dd19['model'],_0x78dd19[_0x1d42('0x3f')]);_0x510629[_0x1d42('0x41')]=_['intersection'](_0x78dd19[_0x1d42('0x3e')],qs[_0x1d42('0x42')](_0x688a65['query']['fields']));_0x510629[_0x1d42('0x41')]=_0x510629[_0x1d42('0x41')][_0x1d42('0x43')]?_0x510629[_0x1d42('0x41')]:_0x78dd19[_0x1d42('0x3e')];if(!_0x688a65['query'][_0x1d42('0x44')]('nolimit')){_0x510629['limit']=qs[_0x1d42('0x45')](_0x688a65[_0x1d42('0x3f')]['limit']);_0x510629[_0x1d42('0x30')]=qs[_0x1d42('0x30')](_0x688a65[_0x1d42('0x3f')][_0x1d42('0x30')]);}_0x510629[_0x1d42('0x46')]=qs[_0x1d42('0x47')](_0x688a65[_0x1d42('0x3f')][_0x1d42('0x47')]);_0x510629['where']=qs[_0x1d42('0x48')](_[_0x1d42('0x49')](_0x688a65[_0x1d42('0x3f')],_0x78dd19[_0x1d42('0x48')]),_0x21d131);if(_0x688a65[_0x1d42('0x3f')]['filter']){_0x510629[_0x1d42('0x4a')]=_[_0x1d42('0x4b')](_0x510629[_0x1d42('0x4a')],{'$or':_[_0x1d42('0x3a')](_0x21d131,function(_0x2e1fcc){if(_0x2e1fcc[_0x1d42('0x3d')]!==_0x1d42('0x4c')){var _0x42dabc={};_0x42dabc[_0x2e1fcc[_0x1d42('0x37')]]={'$like':'%'+_0x688a65[_0x1d42('0x3f')]['filter']+'%'};return _0x42dabc;}})});}_0x510629=_[_0x1d42('0x4b')]({},_0x510629,_0x688a65[_0x1d42('0x4d')]);var _0x29d41f={'where':_0x510629[_0x1d42('0x4a')]};return db['WhatsappMessage'][_0x1d42('0x2f')](_0x29d41f)[_0x1d42('0x21')](function(_0x4eb49e){_0x57e497[_0x1d42('0x2f')]=_0x4eb49e;if(_0x688a65['query'][_0x1d42('0x4e')]){_0x510629['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x1d42('0x4f')](_0x510629);})['then'](function(_0x341cff){_0x57e497['rows']=_0x341cff;return _0x57e497;})[_0x1d42('0x21')](respondWithFilteredResult(_0xac3f64,_0x510629))[_0x1d42('0x29')](handleError(_0xac3f64,null));};exports[_0x1d42('0x50')]=function(_0x40e826,_0x59003e){var _0x5af1d3={'raw':!![],'where':{'id':_0x40e826[_0x1d42('0x51')]['id']}},_0x142120={};_0x142120[_0x1d42('0x3e')]=_['keys'](db[_0x1d42('0x3b')][_0x1d42('0x3c')]);_0x142120[_0x1d42('0x3f')]=_[_0x1d42('0x52')](_0x40e826['query']);_0x142120['filters']=_[_0x1d42('0x40')](_0x142120[_0x1d42('0x3e')],_0x142120[_0x1d42('0x3f')]);_0x5af1d3[_0x1d42('0x41')]=_[_0x1d42('0x40')](_0x142120[_0x1d42('0x3e')],qs[_0x1d42('0x42')](_0x40e826['query'][_0x1d42('0x42')]));_0x5af1d3[_0x1d42('0x41')]=_0x5af1d3['attributes'][_0x1d42('0x43')]?_0x5af1d3['attributes']:_0x142120['model'];if(_0x40e826[_0x1d42('0x3f')]['includeAll']){_0x5af1d3[_0x1d42('0x53')]=[{'all':!![]}];}_0x5af1d3=_[_0x1d42('0x4b')]({},_0x5af1d3,_0x40e826['options']);return db[_0x1d42('0x3b')][_0x1d42('0x54')](_0x5af1d3)[_0x1d42('0x21')](handleEntityNotFound(_0x59003e,null))[_0x1d42('0x21')](respondWithResult(_0x59003e,null))['catch'](handleError(_0x59003e,null));};exports[_0x1d42('0x55')]=function(_0x12e5ca,_0x993fd6){return db[_0x1d42('0x3b')]['create'](_0x12e5ca[_0x1d42('0x56')],{})[_0x1d42('0x21')](respondWithResult(_0x993fd6,0xc9))[_0x1d42('0x29')](handleError(_0x993fd6,null));};exports['update']=function(_0x1dba93,_0x209a28){if(_0x1dba93['body']['id']){delete _0x1dba93[_0x1d42('0x56')]['id'];}return db[_0x1d42('0x3b')][_0x1d42('0x54')]({'where':{'id':_0x1dba93[_0x1d42('0x51')]['id']}})[_0x1d42('0x21')](handleEntityNotFound(_0x209a28,null))[_0x1d42('0x21')](saveUpdates(_0x1dba93[_0x1d42('0x56')],null))[_0x1d42('0x21')](respondWithResult(_0x209a28,null))[_0x1d42('0x29')](handleError(_0x209a28,null));};exports[_0x1d42('0x35')]=function(_0x1e9d31,_0x12251b){return db['WhatsappMessage'][_0x1d42('0x54')]({'where':{'id':_0x1e9d31['params']['id']}})[_0x1d42('0x21')](handleEntityNotFound(_0x12251b,null))[_0x1d42('0x21')](removeEntity(_0x12251b,null))[_0x1d42('0x29')](handleError(_0x12251b,null));};exports['describe']=function(_0x1f325f,_0x13345b){return db[_0x1d42('0x3b')][_0x1d42('0x57')]()[_0x1d42('0x21')](respondWithResult(_0x13345b,null))[_0x1d42('0x29')](handleError(_0x13345b,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports['accept']=function(_0x1df505,_0x50bdd5,_0x3e5946){var _0x529905={'agent':{},'channel':'whatsapp'};if(_0x1df505[_0x1d42('0x56')]['id']){delete _0x1df505[_0x1d42('0x56')]['id'];}_0x1df505[_0x1d42('0x56')][_0x1d42('0x58')]=!![];_0x1df505[_0x1d42('0x56')][_0x1d42('0x59')]=moment()[_0x1d42('0x5a')](_0x1d42('0x5b'));_0x1df505[_0x1d42('0x56')][_0x1d42('0x5c')]=_0x1df505['body'][_0x1d42('0x5c')]||_0x1df505[_0x1d42('0x5d')]['id'];_0x529905['agent']['id']=_0x1df505[_0x1d42('0x56')][_0x1d42('0x5c')];return db[_0x1d42('0x3b')]['find']({'where':{'id':_0x1df505['params']['id'],'UserId':null}})[_0x1d42('0x21')](handleEntityNotFound(_0x50bdd5,null))[_0x1d42('0x21')](saveUpdates(_0x1df505['body'],null))[_0x1d42('0x21')](function(_0x3e8bf){if(_0x3e8bf){_0x529905[_0x1d42('0x28')]=_0x3e8bf[_0x1d42('0x5e')]({'plain':!![]});return db[_0x1d42('0x5f')][_0x1d42('0x54')]({'where':{'id':_0x3e8bf[_0x1d42('0x60')]}});}return null;})[_0x1d42('0x21')](handleEntityNotFound(_0x50bdd5,null))[_0x1d42('0x21')](function(_0x4dc6c7){if(_0x4dc6c7){return _0x4dc6c7[_0x1d42('0x34')]({'UserId':_0x1df505[_0x1d42('0x56')]['UserId'],'read1stAt':_['isNil'](_0x4dc6c7[_0x1d42('0x61')])?moment()[_0x1d42('0x5a')](_0x1d42('0x5b')):undefined});}return null;})[_0x1d42('0x21')](function(_0x32fb82){if(_0x32fb82){_0x529905[_0x1d42('0x62')]=_0x32fb82[_0x1d42('0x5e')]({'plain':!![]});interaction_log['info'](_0x1d42('0x63'),_0x1df505[_0x1d42('0x5d')]['id'],_0x1df505['user']['name'],_0x1df505[_0x1d42('0x5d')][_0x1d42('0x64')],_0x529905[_0x1d42('0x62')]['id'],_0x1df505[_0x1d42('0x56')]?JSON['stringify'](_0x1df505[_0x1d42('0x56')]):_0x1d42('0x65'));return respondWithRpcPromise(_0x1d42('0x66'),_0x1d42('0x67'),_0x529905);}return null;})[_0x1d42('0x21')](function(_0x586b7a){var _0x45f924='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x586b7a[_0x1d42('0x28')]['ContactId'];return db[_0x1d42('0x68')]['query'](_0x45f924,{'type':db[_0x1d42('0x69')][_0x1d42('0x6a')][_0x1d42('0x6b')],'raw':!![]})[_0x1d42('0x21')](function(_0x5a72cb){return _0x5a72cb;});})[_0x1d42('0x21')](function(_0x6f2bf8){if(_0x6f2bf8){_0x529905[_0x1d42('0x28')][_0x1d42('0x6c')]=_0x6f2bf8[0x0];if(!_0x1df505[_0x1d42('0x56')]['UserId'])return;return db['User'][_0x1d42('0x54')]({'where':{'id':_0x1df505['body'][_0x1d42('0x5c')],'role':_0x1d42('0x6d')},'attributes':['id',_0x1d42('0x37'),_0x1d42('0x6e'),_0x1d42('0x6f'),_0x1d42('0x70')],'raw':!![]});}return null;})[_0x1d42('0x21')](function(_0x475486){if(!_0x475486)return null;_0x529905[_0x1d42('0x28')]['agent']=_0x475486;return _0x529905;})['then'](function(_0x515601){if(_0x515601){if(_0x1df505[_0x1d42('0x56')][_0x1d42('0x71')]){_0x529905[_0x1d42('0x28')][_0x1d42('0x72')]=util['format'](_0x1d42('0x73'),_0x1df505['user'][_0x1d42('0x37')]);_0x529905[_0x1d42('0x28')][_0x1d42('0x74')]=_0x529905[_0x1d42('0x74')];_0x529905['message']['motionChannel']=_0x529905['channel'];_0x529905[_0x1d42('0x28')][_0x1d42('0x75')]=_0x1d42('0x76');return respondWithRpcPromise(_0x1d42('0x77'),'EventManager',{'event':_0x1d42('0x78'),'message':_0x529905[_0x1d42('0x28')]},client9002)[_0x1d42('0x21')](function(){return _0x529905;});}return _0x529905;}return null;})[_0x1d42('0x21')](respondWithResult(_0x50bdd5,null))[_0x1d42('0x29')](handleError(_0x50bdd5,null));};var interaction_log=require(_0x1d42('0x13'))('whatsapp-interactions');exports['reject']=function(_0x3b1ec6,_0x1e9eff,_0x155b78){var _0x480bfb={'agent':{},'channel':_0x1d42('0x79')};if(_0x3b1ec6[_0x1d42('0x56')]['id']){delete _0x3b1ec6[_0x1d42('0x56')]['id'];}_0x3b1ec6['body'][_0x1d42('0x5c')]=_0x3b1ec6['body'][_0x1d42('0x5c')]||_0x3b1ec6['user']['id'];_0x480bfb[_0x1d42('0x6d')]['id']=_0x3b1ec6[_0x1d42('0x56')]['UserId'];return db[_0x1d42('0x3b')][_0x1d42('0x54')]({'where':{'id':_0x3b1ec6[_0x1d42('0x51')]['id'],'UserId':null}})[_0x1d42('0x21')](handleEntityNotFound(_0x1e9eff,null))[_0x1d42('0x21')](function(_0x583e43){if(_0x583e43){_0x480bfb[_0x1d42('0x28')]=_0x583e43[_0x1d42('0x5e')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x583e43[_0x1d42('0x60')]}});}return null;})[_0x1d42('0x21')](handleEntityNotFound(_0x1e9eff,null))[_0x1d42('0x21')](function(_0x5eeb6a){if(_0x5eeb6a){_0x480bfb[_0x1d42('0x62')]=_0x5eeb6a[_0x1d42('0x5e')]({'plain':!![]});interaction_log[_0x1d42('0x22')](_0x1d42('0x7a'),_0x3b1ec6[_0x1d42('0x5d')]['id'],_0x3b1ec6[_0x1d42('0x5d')][_0x1d42('0x37')],_0x3b1ec6['user'][_0x1d42('0x64')],_0x480bfb[_0x1d42('0x62')]['id'],_0x3b1ec6['body']?JSON['stringify'](_0x3b1ec6[_0x1d42('0x56')]):_0x1d42('0x65'));return respondWithRpcPromise('RejectMessage',_0x1d42('0x7b'),_0x480bfb);}return null;})[_0x1d42('0x21')](function(_0x254520){var _0x52c0ea='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x254520[_0x1d42('0x28')][_0x1d42('0x7c')];return db[_0x1d42('0x68')][_0x1d42('0x3f')](_0x52c0ea,{'type':db[_0x1d42('0x69')]['QueryTypes'][_0x1d42('0x6b')],'raw':!![]})[_0x1d42('0x21')](function(_0x232df6){return _0x232df6;});})[_0x1d42('0x21')](function(_0x45ea05){if(_0x45ea05){_0x480bfb[_0x1d42('0x28')][_0x1d42('0x6c')]=_0x45ea05[0x0];if(!_0x3b1ec6[_0x1d42('0x56')][_0x1d42('0x5c')])return;return db[_0x1d42('0x7d')][_0x1d42('0x54')]({'where':{'id':_0x3b1ec6[_0x1d42('0x56')][_0x1d42('0x5c')],'role':'agent'},'attributes':['id','name',_0x1d42('0x6e'),'email',_0x1d42('0x70')],'raw':!![]});}return null;})['then'](function(_0x3f53f1){if(!_0x3f53f1)return null;_0x480bfb[_0x1d42('0x28')][_0x1d42('0x6d')]=_0x3f53f1;return _0x480bfb;})[_0x1d42('0x21')](function(_0x5d9b03){if(_0x5d9b03){_0x5d9b03[_0x1d42('0x28')][_0x1d42('0x72')]=util['format']('SIP/%s',_0x3b1ec6[_0x1d42('0x5d')][_0x1d42('0x37')]);_0x5d9b03[_0x1d42('0x28')]['channel']=_0x480bfb[_0x1d42('0x74')];_0x5d9b03[_0x1d42('0x28')][_0x1d42('0x7e')]=_0x480bfb[_0x1d42('0x74')];_0x5d9b03[_0x1d42('0x28')]['event']='reject';respondWithRpcPromise(_0x1d42('0x77'),'EventManager',{'event':_0x1d42('0x7f'),'message':_0x5d9b03['message']},client9002);return _0x480bfb;}return null;})[_0x1d42('0x21')](respondWithResult(_0x1e9eff,null))['catch'](handleError(_0x1e9eff,null));};exports[_0x1d42('0x2b')]=function(_0x3e1f56,_0x3e1aa0,_0x2d9304){if(_0x3e1f56[_0x1d42('0x56')]['id']){delete _0x3e1f56[_0x1d42('0x56')]['id'];}var _0x5ec6e4;return db[_0x1d42('0x3b')]['find']({'where':{'id':_0x3e1f56['params']['id']}})[_0x1d42('0x21')](handleEntityNotFound(_0x3e1aa0,null))[_0x1d42('0x21')](function(_0x32fc3f){if(_0x32fc3f){_0x5ec6e4=_0x32fc3f;return db[_0x1d42('0x80')]['find']({'where':{'id':_0x32fc3f['WhatsappAccountId']}});}})[_0x1d42('0x21')](handleEntityNotFound(_0x3e1aa0,null))['then'](function(_0x506173){if(_0x506173){logger[_0x1d42('0x81')](_0x1d42('0x82'),_0x1d42('0x2b'),'received\x20delivery\x20report\x20from',_0x506173[_0x1d42('0x3d')],util[_0x1d42('0x83')](_0x3e1f56[_0x1d42('0x56')],{'showHidden':![],'depth':null}));switch(_0x506173[_0x1d42('0x3d')]){case _0x1d42('0x84'):if(_0x3e1f56[_0x1d42('0x56')][_0x1d42('0x85')]&&_0x3e1f56['body'][_0x1d42('0x85')]===_0x5ec6e4[_0x1d42('0x86')]&&_0x3e1f56[_0x1d42('0x56')][_0x1d42('0x87')]&&_0x3e1f56['body']['MessageStatus']===_0x1d42('0x58')){return _0x5ec6e4[_0x1d42('0x34')]({'read':!![]});}else{logger[_0x1d42('0x26')](_0x1d42('0x88'),'status',_0x1d42('0x84'),util['inspect'](_0x3e1f56[_0x1d42('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x5ec6e4;}})[_0x1d42('0x21')](respondWithResult(_0x3e1aa0,null))[_0x1d42('0x29')](handleError(_0x3e1aa0,null));};
\ No newline at end of file
+var _0x2f16=['order','sort','pick','filter','where','VIRTUAL','merge','options','then','includeAll','include','rows','show','params','keys','create','body','find','describe','whatsapp-interactions','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','event','accept','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','fast-json-patch','request-promise','moment','bluebird','mustache','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','json','undefined','count','offset','set','apply','reject','save','update','destroy','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','limit'];(function(_0x132995,_0x487969){var _0x4dfb3f=function(_0x5b20a2){while(--_0x5b20a2){_0x132995['push'](_0x132995['shift']());}};_0x4dfb3f(++_0x487969);}(_0x2f16,0x164));var _0x62f1=function(_0x59d415,_0x3313f5){_0x59d415=_0x59d415-0x0;var _0x256cc1=_0x2f16[_0x59d415];return _0x256cc1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x62f1('0x0'));var rp=require(_0x62f1('0x1'));var moment=require(_0x62f1('0x2'));var BPromise=require(_0x62f1('0x3'));var Mustache=require(_0x62f1('0x4'));var util=require('util');var path=require(_0x62f1('0x5'));var sox=require(_0x62f1('0x6'));var csv=require('to-csv');var ejs=require(_0x62f1('0x7'));var fs=require('fs');var fs_extra=require(_0x62f1('0x8'));var _=require(_0x62f1('0x9'));var squel=require(_0x62f1('0xa'));var crypto=require(_0x62f1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x62f1('0xc'));var toCsv=require(_0x62f1('0xd'));var querystring=require(_0x62f1('0xe'));var Papa=require(_0x62f1('0xf'));var Redis=require(_0x62f1('0x10'));var authService=require(_0x62f1('0x11'));var qs=require(_0x62f1('0x12'));var as=require(_0x62f1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x62f1('0x14'))(_0x62f1('0x15'));var utils=require(_0x62f1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x62f1('0x17'));var db=require(_0x62f1('0x18'))['db'];config[_0x62f1('0x19')]=_[_0x62f1('0x1a')](config[_0x62f1('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x62f1('0x1b'))(new Redis(config[_0x62f1('0x19')]));require(_0x62f1('0x1c'))[_0x62f1('0x1d')](socket);var jayson=require(_0x62f1('0x1e'));var client=jayson[_0x62f1('0x1f')][_0x62f1('0x20')]({'port':0x232c});var client9002=jayson[_0x62f1('0x1f')][_0x62f1('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1a21e1,_0x33cee0,_0x42af3f,_0x41713e){return new BPromise(function(_0x3b630f,_0x5469b2){var _0x2bfacb=_0x41713e||client;return _0x2bfacb[_0x62f1('0x21')](_0x1a21e1,_0x42af3f)['then'](function(_0x4cebf9){logger[_0x62f1('0x22')](_0x62f1('0x23'),_0x33cee0,'request\x20sent');logger[_0x62f1('0x24')](_0x62f1('0x25'),_0x33cee0,_0x62f1('0x26'),JSON[_0x62f1('0x27')](_0x4cebf9));if(_0x4cebf9['error']){if(_0x4cebf9[_0x62f1('0x28')]['code']===0x1f4){logger[_0x62f1('0x28')](_0x62f1('0x23'),_0x33cee0,_0x4cebf9[_0x62f1('0x28')]['message']);return _0x5469b2(_0x4cebf9['error'][_0x62f1('0x29')]);}logger[_0x62f1('0x28')](_0x62f1('0x23'),_0x33cee0,_0x4cebf9[_0x62f1('0x28')][_0x62f1('0x29')]);return _0x3b630f(_0x4cebf9['error'][_0x62f1('0x29')]);}else{logger[_0x62f1('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x33cee0,_0x62f1('0x26'));_0x3b630f(_0x4cebf9['result'][_0x62f1('0x29')]);}})[_0x62f1('0x2a')](function(_0x5e386a){logger[_0x62f1('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x33cee0,_0x5e386a);_0x5469b2(_0x5e386a);});});}function respondWithStatusCode(_0x1c7cf5,_0x57f95a){_0x57f95a=_0x57f95a||0xcc;return function(_0x29e60b){if(_0x29e60b){return _0x1c7cf5[_0x62f1('0x2b')](_0x57f95a);}return _0x1c7cf5[_0x62f1('0x2c')](_0x57f95a)['end']();};}function respondWithResult(_0x42bd82,_0x52f80f){_0x52f80f=_0x52f80f||0xc8;return function(_0x20868d){if(_0x20868d){return _0x42bd82[_0x62f1('0x2c')](_0x52f80f)[_0x62f1('0x2d')](_0x20868d);}};}function respondWithFilteredResult(_0x2c4eec,_0x45c557){return function(_0x2ba930){if(_0x2ba930){var _0x4865ca=typeof _0x45c557['offset']===_0x62f1('0x2e')&&typeof _0x45c557['limit']===_0x62f1('0x2e');var _0x461d19=_0x2ba930[_0x62f1('0x2f')];var _0x6ada9a=_0x4865ca?0x0:_0x45c557[_0x62f1('0x30')];var _0x20bc25=_0x4865ca?_0x2ba930[_0x62f1('0x2f')]:_0x45c557[_0x62f1('0x30')]+_0x45c557['limit'];var _0x110741;if(_0x20bc25>=_0x461d19){_0x20bc25=_0x461d19;_0x110741=0xc8;}else{_0x110741=0xce;}_0x2c4eec['status'](_0x110741);return _0x2c4eec[_0x62f1('0x31')]('Content-Range',_0x6ada9a+'-'+_0x20bc25+'/'+_0x461d19)[_0x62f1('0x2d')](_0x2ba930);}return null;};}function patchUpdates(_0x99887){return function(_0x55b0f5){try{jsonpatch[_0x62f1('0x32')](_0x55b0f5,_0x99887,!![]);}catch(_0x28a099){return BPromise[_0x62f1('0x33')](_0x28a099);}return _0x55b0f5[_0x62f1('0x34')]();};}function saveUpdates(_0x5f4529,_0x4d91c8){return function(_0x443e5b){if(_0x443e5b){return _0x443e5b[_0x62f1('0x35')](_0x5f4529)['then'](function(_0x55a20c){return _0x55a20c;});}return null;};}function removeEntity(_0x2a50ff,_0x333c79){return function(_0x5cd6ee){if(_0x5cd6ee){return _0x5cd6ee[_0x62f1('0x36')]()['then'](function(){_0x2a50ff[_0x62f1('0x2c')](0xcc)[_0x62f1('0x37')]();});}};}function handleEntityNotFound(_0x57db8d,_0xdce04){return function(_0x22097b){if(!_0x22097b){_0x57db8d[_0x62f1('0x2b')](0x194);}return _0x22097b;};}function handleError(_0x4ee500,_0x4e8c65){_0x4e8c65=_0x4e8c65||0x1f4;return function(_0x5aa788){logger[_0x62f1('0x28')](_0x5aa788[_0x62f1('0x38')]);if(_0x5aa788[_0x62f1('0x39')]){delete _0x5aa788[_0x62f1('0x39')];}_0x4ee500[_0x62f1('0x2c')](_0x4e8c65)[_0x62f1('0x3a')](_0x5aa788);};}exports[_0x62f1('0x3b')]=function(_0x52f75c,_0x5c373d){var _0x1e8bc7={},_0x170968={},_0x4db1cb={'count':0x0,'rows':[]};var _0x4bbe2a=_[_0x62f1('0x3c')](db[_0x62f1('0x3d')][_0x62f1('0x3e')],function(_0x5e9d53){return{'name':_0x5e9d53['fieldName'],'type':_0x5e9d53[_0x62f1('0x3f')][_0x62f1('0x40')]};});_0x170968[_0x62f1('0x41')]=_[_0x62f1('0x3c')](_0x4bbe2a,_0x62f1('0x39'));_0x170968[_0x62f1('0x42')]=_['keys'](_0x52f75c['query']);_0x170968[_0x62f1('0x43')]=_[_0x62f1('0x44')](_0x170968[_0x62f1('0x41')],_0x170968[_0x62f1('0x42')]);_0x1e8bc7['attributes']=_[_0x62f1('0x44')](_0x170968[_0x62f1('0x41')],qs[_0x62f1('0x45')](_0x52f75c[_0x62f1('0x42')]['fields']));_0x1e8bc7[_0x62f1('0x46')]=_0x1e8bc7[_0x62f1('0x46')]['length']?_0x1e8bc7[_0x62f1('0x46')]:_0x170968[_0x62f1('0x41')];if(!_0x52f75c[_0x62f1('0x42')][_0x62f1('0x47')]('nolimit')){_0x1e8bc7[_0x62f1('0x48')]=qs[_0x62f1('0x48')](_0x52f75c[_0x62f1('0x42')][_0x62f1('0x48')]);_0x1e8bc7[_0x62f1('0x30')]=qs[_0x62f1('0x30')](_0x52f75c[_0x62f1('0x42')][_0x62f1('0x30')]);}_0x1e8bc7[_0x62f1('0x49')]=qs[_0x62f1('0x4a')](_0x52f75c[_0x62f1('0x42')][_0x62f1('0x4a')]);_0x1e8bc7['where']=qs[_0x62f1('0x43')](_[_0x62f1('0x4b')](_0x52f75c[_0x62f1('0x42')],_0x170968[_0x62f1('0x43')]),_0x4bbe2a);if(_0x52f75c[_0x62f1('0x42')][_0x62f1('0x4c')]){_0x1e8bc7[_0x62f1('0x4d')]=_['merge'](_0x1e8bc7[_0x62f1('0x4d')],{'$or':_[_0x62f1('0x3c')](_0x4bbe2a,function(_0x1af6f1){if(_0x1af6f1[_0x62f1('0x3f')]!==_0x62f1('0x4e')){var _0x3dcd7b={};_0x3dcd7b[_0x1af6f1['name']]={'$like':'%'+_0x52f75c[_0x62f1('0x42')][_0x62f1('0x4c')]+'%'};return _0x3dcd7b;}})});}_0x1e8bc7=_[_0x62f1('0x4f')]({},_0x1e8bc7,_0x52f75c[_0x62f1('0x50')]);var _0x299191={'where':_0x1e8bc7[_0x62f1('0x4d')]};return db[_0x62f1('0x3d')][_0x62f1('0x2f')](_0x299191)[_0x62f1('0x51')](function(_0x268d09){_0x4db1cb[_0x62f1('0x2f')]=_0x268d09;if(_0x52f75c[_0x62f1('0x42')][_0x62f1('0x52')]){_0x1e8bc7[_0x62f1('0x53')]=[{'all':!![]}];}return db[_0x62f1('0x3d')]['findAll'](_0x1e8bc7);})['then'](function(_0x147973){_0x4db1cb[_0x62f1('0x54')]=_0x147973;return _0x4db1cb;})['then'](respondWithFilteredResult(_0x5c373d,_0x1e8bc7))[_0x62f1('0x2a')](handleError(_0x5c373d,null));};exports[_0x62f1('0x55')]=function(_0x2e4e27,_0x3e982c){var _0x52b4dd={'raw':!![],'where':{'id':_0x2e4e27[_0x62f1('0x56')]['id']}},_0x12f4d4={};_0x12f4d4[_0x62f1('0x41')]=_['keys'](db[_0x62f1('0x3d')][_0x62f1('0x3e')]);_0x12f4d4[_0x62f1('0x42')]=_[_0x62f1('0x57')](_0x2e4e27[_0x62f1('0x42')]);_0x12f4d4[_0x62f1('0x43')]=_['intersection'](_0x12f4d4[_0x62f1('0x41')],_0x12f4d4[_0x62f1('0x42')]);_0x52b4dd[_0x62f1('0x46')]=_[_0x62f1('0x44')](_0x12f4d4[_0x62f1('0x41')],qs[_0x62f1('0x45')](_0x2e4e27[_0x62f1('0x42')][_0x62f1('0x45')]));_0x52b4dd[_0x62f1('0x46')]=_0x52b4dd[_0x62f1('0x46')]['length']?_0x52b4dd[_0x62f1('0x46')]:_0x12f4d4[_0x62f1('0x41')];if(_0x2e4e27[_0x62f1('0x42')][_0x62f1('0x52')]){_0x52b4dd[_0x62f1('0x53')]=[{'all':!![]}];}_0x52b4dd=_[_0x62f1('0x4f')]({},_0x52b4dd,_0x2e4e27[_0x62f1('0x50')]);return db[_0x62f1('0x3d')]['find'](_0x52b4dd)[_0x62f1('0x51')](handleEntityNotFound(_0x3e982c,null))[_0x62f1('0x51')](respondWithResult(_0x3e982c,null))[_0x62f1('0x2a')](handleError(_0x3e982c,null));};exports[_0x62f1('0x58')]=function(_0xafc9ec,_0x452519){return db[_0x62f1('0x3d')][_0x62f1('0x58')](_0xafc9ec[_0x62f1('0x59')],{})['then'](respondWithResult(_0x452519,0xc9))[_0x62f1('0x2a')](handleError(_0x452519,null));};exports[_0x62f1('0x35')]=function(_0x550e89,_0x1247a8){if(_0x550e89[_0x62f1('0x59')]['id']){delete _0x550e89[_0x62f1('0x59')]['id'];}return db[_0x62f1('0x3d')][_0x62f1('0x5a')]({'where':{'id':_0x550e89[_0x62f1('0x56')]['id']}})[_0x62f1('0x51')](handleEntityNotFound(_0x1247a8,null))['then'](saveUpdates(_0x550e89[_0x62f1('0x59')],null))[_0x62f1('0x51')](respondWithResult(_0x1247a8,null))[_0x62f1('0x2a')](handleError(_0x1247a8,null));};exports['destroy']=function(_0x36ac2d,_0x21c7ee){return db[_0x62f1('0x3d')]['find']({'where':{'id':_0x36ac2d[_0x62f1('0x56')]['id']}})[_0x62f1('0x51')](handleEntityNotFound(_0x21c7ee,null))[_0x62f1('0x51')](removeEntity(_0x21c7ee,null))[_0x62f1('0x2a')](handleError(_0x21c7ee,null));};exports[_0x62f1('0x5b')]=function(_0x4cdbab,_0x18aa34){return db[_0x62f1('0x3d')]['describe']()['then'](respondWithResult(_0x18aa34,null))[_0x62f1('0x2a')](handleError(_0x18aa34,null));};var interaction_log=require(_0x62f1('0x14'))(_0x62f1('0x5c'));exports['accept']=function(_0x3e5f16,_0x396ded,_0xc94adc){var _0x1124ce={'agent':{},'channel':_0x62f1('0x5d')};if(_0x3e5f16['body']['id']){delete _0x3e5f16[_0x62f1('0x59')]['id'];}_0x3e5f16[_0x62f1('0x59')]['read']=!![];_0x3e5f16[_0x62f1('0x59')][_0x62f1('0x5e')]=moment()[_0x62f1('0x5f')](_0x62f1('0x60'));_0x3e5f16[_0x62f1('0x59')][_0x62f1('0x61')]=_0x3e5f16[_0x62f1('0x59')]['UserId']||_0x3e5f16[_0x62f1('0x62')]['id'];_0x1124ce[_0x62f1('0x63')]['id']=_0x3e5f16['body'][_0x62f1('0x61')];return db[_0x62f1('0x3d')][_0x62f1('0x5a')]({'where':{'id':_0x3e5f16[_0x62f1('0x56')]['id'],'UserId':null}})[_0x62f1('0x51')](handleEntityNotFound(_0x396ded,null))['then'](saveUpdates(_0x3e5f16['body'],null))[_0x62f1('0x51')](function(_0x5a039e){if(_0x5a039e){_0x1124ce[_0x62f1('0x29')]=_0x5a039e[_0x62f1('0x64')]({'plain':!![]});return db[_0x62f1('0x65')][_0x62f1('0x5a')]({'where':{'id':_0x5a039e[_0x62f1('0x66')]}});}return null;})[_0x62f1('0x51')](handleEntityNotFound(_0x396ded,null))[_0x62f1('0x51')](function(_0x466d21){if(_0x466d21){return _0x466d21[_0x62f1('0x35')]({'UserId':_0x3e5f16[_0x62f1('0x59')]['UserId'],'read1stAt':_[_0x62f1('0x67')](_0x466d21[_0x62f1('0x68')])?moment()[_0x62f1('0x5f')](_0x62f1('0x60')):undefined});}return null;})[_0x62f1('0x51')](function(_0x46350a){if(_0x46350a){_0x1124ce[_0x62f1('0x69')]=_0x46350a[_0x62f1('0x64')]({'plain':!![]});interaction_log['info'](_0x62f1('0x6a'),_0x3e5f16['user']['id'],_0x3e5f16[_0x62f1('0x62')]['name'],_0x3e5f16[_0x62f1('0x62')]['role'],_0x1124ce[_0x62f1('0x69')]['id'],_0x3e5f16[_0x62f1('0x59')]?JSON[_0x62f1('0x27')](_0x3e5f16['body']):_0x62f1('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x62f1('0x6c'),_0x1124ce);}return null;})[_0x62f1('0x51')](function(_0x196198){var _0x28387e=_0x62f1('0x6d')+_0x196198[_0x62f1('0x29')][_0x62f1('0x6e')];return db[_0x62f1('0x6f')][_0x62f1('0x42')](_0x28387e,{'type':db[_0x62f1('0x70')][_0x62f1('0x71')][_0x62f1('0x72')],'raw':!![]})[_0x62f1('0x51')](function(_0x243ef9){return _0x243ef9;});})[_0x62f1('0x51')](function(_0x16cdd6){if(_0x16cdd6){_0x1124ce[_0x62f1('0x29')][_0x62f1('0x73')]=_0x16cdd6[0x0];if(!_0x3e5f16[_0x62f1('0x59')][_0x62f1('0x61')])return;return db[_0x62f1('0x74')][_0x62f1('0x5a')]({'where':{'id':_0x3e5f16[_0x62f1('0x59')][_0x62f1('0x61')],'role':_0x62f1('0x63')},'attributes':['id','name',_0x62f1('0x75'),_0x62f1('0x76'),_0x62f1('0x77')],'raw':!![]});}return null;})[_0x62f1('0x51')](function(_0xc1a4cb){if(!_0xc1a4cb)return null;_0x1124ce[_0x62f1('0x29')][_0x62f1('0x63')]=_0xc1a4cb;return _0x1124ce;})[_0x62f1('0x51')](function(_0x2c5215){if(_0x2c5215){if(_0x3e5f16[_0x62f1('0x59')][_0x62f1('0x78')]){_0x1124ce['message']['interface']=util[_0x62f1('0x5f')](_0x62f1('0x79'),_0x3e5f16[_0x62f1('0x62')][_0x62f1('0x39')]);_0x1124ce[_0x62f1('0x29')][_0x62f1('0x7a')]=_0x1124ce[_0x62f1('0x7a')];_0x1124ce[_0x62f1('0x29')]['motionChannel']=_0x1124ce[_0x62f1('0x7a')];_0x1124ce[_0x62f1('0x29')][_0x62f1('0x7b')]=_0x62f1('0x7c');return respondWithRpcPromise(_0x62f1('0x7d'),_0x62f1('0x7d'),{'event':_0x62f1('0x7e'),'message':_0x1124ce[_0x62f1('0x29')]},client9002)['then'](function(){return _0x1124ce;});}return _0x1124ce;}return null;})[_0x62f1('0x51')](respondWithResult(_0x396ded,null))[_0x62f1('0x2a')](handleError(_0x396ded,null));};var interaction_log=require(_0x62f1('0x14'))(_0x62f1('0x5c'));exports['reject']=function(_0x188221,_0x4e1dea,_0x32f9a7){var _0x2e5b69={'agent':{},'channel':'whatsapp'};if(_0x188221['body']['id']){delete _0x188221[_0x62f1('0x59')]['id'];}_0x188221[_0x62f1('0x59')][_0x62f1('0x61')]=_0x188221[_0x62f1('0x59')][_0x62f1('0x61')]||_0x188221['user']['id'];_0x2e5b69[_0x62f1('0x63')]['id']=_0x188221['body'][_0x62f1('0x61')];return db[_0x62f1('0x3d')]['find']({'where':{'id':_0x188221[_0x62f1('0x56')]['id'],'UserId':null}})[_0x62f1('0x51')](handleEntityNotFound(_0x4e1dea,null))[_0x62f1('0x51')](function(_0x21132f){if(_0x21132f){_0x2e5b69[_0x62f1('0x29')]=_0x21132f[_0x62f1('0x64')]({'plain':!![]});return db[_0x62f1('0x65')][_0x62f1('0x5a')]({'where':{'id':_0x21132f[_0x62f1('0x66')]}});}return null;})[_0x62f1('0x51')](handleEntityNotFound(_0x4e1dea,null))[_0x62f1('0x51')](function(_0x3a19da){if(_0x3a19da){_0x2e5b69[_0x62f1('0x69')]=_0x3a19da[_0x62f1('0x64')]({'plain':!![]});interaction_log[_0x62f1('0x22')](_0x62f1('0x7f'),_0x188221['user']['id'],_0x188221[_0x62f1('0x62')][_0x62f1('0x39')],_0x188221[_0x62f1('0x62')]['role'],_0x2e5b69['interaction']['id'],_0x188221['body']?JSON[_0x62f1('0x27')](_0x188221['body']):_0x62f1('0x6b'));return respondWithRpcPromise(_0x62f1('0x80'),_0x62f1('0x81'),_0x2e5b69);}return null;})['then'](function(_0x21e34d){var _0xbda8c7=_0x62f1('0x6d')+_0x21e34d[_0x62f1('0x29')][_0x62f1('0x6e')];return db['sequelize']['query'](_0xbda8c7,{'type':db[_0x62f1('0x70')][_0x62f1('0x71')][_0x62f1('0x72')],'raw':!![]})['then'](function(_0x57515f){return _0x57515f;});})[_0x62f1('0x51')](function(_0xbec6c0){if(_0xbec6c0){_0x2e5b69[_0x62f1('0x29')]['contact']=_0xbec6c0[0x0];if(!_0x188221[_0x62f1('0x59')]['UserId'])return;return db[_0x62f1('0x74')][_0x62f1('0x5a')]({'where':{'id':_0x188221[_0x62f1('0x59')][_0x62f1('0x61')],'role':'agent'},'attributes':['id',_0x62f1('0x39'),_0x62f1('0x75'),_0x62f1('0x76'),_0x62f1('0x77')],'raw':!![]});}return null;})[_0x62f1('0x51')](function(_0x204eff){if(!_0x204eff)return null;_0x2e5b69[_0x62f1('0x29')][_0x62f1('0x63')]=_0x204eff;return _0x2e5b69;})[_0x62f1('0x51')](function(_0x3fba72){if(_0x3fba72){_0x3fba72[_0x62f1('0x29')]['interface']=util[_0x62f1('0x5f')](_0x62f1('0x79'),_0x188221['user']['name']);_0x3fba72['message'][_0x62f1('0x7a')]=_0x2e5b69[_0x62f1('0x7a')];_0x3fba72[_0x62f1('0x29')][_0x62f1('0x82')]=_0x2e5b69[_0x62f1('0x7a')];_0x3fba72[_0x62f1('0x29')][_0x62f1('0x7b')]='reject';respondWithRpcPromise('EventManager',_0x62f1('0x7d'),{'event':_0x62f1('0x83'),'message':_0x3fba72[_0x62f1('0x29')]},client9002);return _0x2e5b69;}return null;})[_0x62f1('0x51')](respondWithResult(_0x4e1dea,null))[_0x62f1('0x2a')](handleError(_0x4e1dea,null));};exports['status']=function(_0x57f7e1,_0x32d39a,_0x400607){if(_0x57f7e1[_0x62f1('0x59')]['id']){delete _0x57f7e1[_0x62f1('0x59')]['id'];}var _0x227111;return db['WhatsappMessage'][_0x62f1('0x5a')]({'where':{'id':_0x57f7e1['params']['id']}})['then'](handleEntityNotFound(_0x32d39a,null))['then'](function(_0x707ba3){if(_0x707ba3){_0x227111=_0x707ba3;return db[_0x62f1('0x84')]['find']({'where':{'id':_0x707ba3[_0x62f1('0x85')]}});}})[_0x62f1('0x51')](handleEntityNotFound(_0x32d39a,null))[_0x62f1('0x51')](function(_0x4b0856){if(_0x4b0856){logger[_0x62f1('0x24')](_0x62f1('0x86'),'status',_0x62f1('0x87'),_0x4b0856[_0x62f1('0x3f')],util[_0x62f1('0x88')](_0x57f7e1[_0x62f1('0x59')],{'showHidden':![],'depth':null}));switch(_0x4b0856['type']){case _0x62f1('0x89'):if(_0x57f7e1[_0x62f1('0x59')][_0x62f1('0x8a')]&&_0x57f7e1[_0x62f1('0x59')][_0x62f1('0x8a')]===_0x227111[_0x62f1('0x8b')]&&_0x57f7e1['body'][_0x62f1('0x8c')]&&_0x57f7e1[_0x62f1('0x59')][_0x62f1('0x8c')]===_0x62f1('0x8d')){return _0x227111[_0x62f1('0x35')]({'read':!![]});}else{logger[_0x62f1('0x28')](_0x62f1('0x8e'),_0x62f1('0x2c'),_0x62f1('0x89'),util[_0x62f1('0x88')](_0x57f7e1[_0x62f1('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x227111;}})[_0x62f1('0x51')](respondWithResult(_0x32d39a,null))[_0x62f1('0x2a')](handleError(_0x32d39a,null));};
\ No newline at end of file
index 4937a41..ce25a07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d25=['emit','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove'];(function(_0x1fb932,_0xfa56d4){var _0x25ce50=function(_0x438690){while(--_0x438690){_0x1fb932['push'](_0x1fb932['shift']());}};_0x25ce50(++_0xfa56d4);}(_0x7d25,0x8a));var _0x57d2=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x7d25[_0x576170];return _0x397c70;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x57d2('0x0'))['db'][_0x57d2('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x57d2('0x2')](0x0);var events={'afterCreate':_0x57d2('0x3'),'afterUpdate':_0x57d2('0x4'),'afterDestroy':_0x57d2('0x5')};function emitEvent(_0x308bbd){return function(_0x5c1baa,_0x5337ca,_0x52a4f4){WhatsappMessageEvents['emit'](_0x308bbd+':'+_0x5c1baa['id'],_0x5c1baa);WhatsappMessageEvents[_0x57d2('0x6')](_0x308bbd,_0x5c1baa);_0x52a4f4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x57d2('0x7')](e,emitEvent(event));}}module[_0x57d2('0x8')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x4fad=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage','save'];(function(_0x59924b,_0x4c784f){var _0x1d85d6=function(_0x5d520d){while(--_0x5d520d){_0x59924b['push'](_0x59924b['shift']());}};_0x1d85d6(++_0x4c784f);}(_0x4fad,0xcb));var _0xd4fa=function(_0x53458c,_0x32e0dd){_0x53458c=_0x53458c-0x0;var _0x5aa08c=_0x4fad[_0x53458c];return _0x5aa08c;};'use strict';var EventEmitter=require(_0xd4fa('0x0'));var WhatsappMessage=require(_0xd4fa('0x1'))['db'][_0xd4fa('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd4fa('0x3'),'afterUpdate':_0xd4fa('0x4'),'afterDestroy':_0xd4fa('0x5')};function emitEvent(_0x3fc857){return function(_0x419a9c,_0x3903a1,_0x138bcb){WhatsappMessageEvents[_0xd4fa('0x6')](_0x3fc857+':'+_0x419a9c['id'],_0x419a9c);WhatsappMessageEvents['emit'](_0x3fc857,_0x419a9c);_0x138bcb(null);};}for(var e in events){if(events[_0xd4fa('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xd4fa('0x8')]=WhatsappMessageEvents;
\ No newline at end of file
index a97f1dd..bd33f6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b42=['WhatsappInteractionId','then','createdAt','toLowerCase','catch','error','find','WhatsappAccountId','type','twilio','accountSid','authToken','messages','body','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','models','get','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2b42,0xe7));var _0x22b4=function(_0x357be4,_0x3bc32f){_0x357be4=_0x357be4-0x0;var _0xa8b73d=_0x2b42[_0x357be4];return _0xa8b73d;};'use strict';var _=require('lodash');var util=require(_0x22b4('0x0'));var logger=require('../../config/logger')(_0x22b4('0x1'));var moment=require(_0x22b4('0x2'));var BPromise=require(_0x22b4('0x3'));var rp=require(_0x22b4('0x4'));var fs=require('fs');var path=require(_0x22b4('0x5'));var rimraf=require(_0x22b4('0x6'));var config=require(_0x22b4('0x7'));var attributes=require(_0x22b4('0x8'));module[_0x22b4('0x9')]=function(_0x4a6328,_0x44f3a2){return _0x4a6328[_0x22b4('0xa')](_0x22b4('0xb'),attributes,{'tableName':_0x22b4('0xc'),'paranoid':![],'indexes':[{'name':_0x22b4('0xd'),'fields':[_0x22b4('0xd')]},{'name':_0x22b4('0xe'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47d45c,_0x137957,_0x5f0338){var _0x3e4cf3=_0x4a6328[_0x22b4('0xf')];var _0x3e3692=_0x47d45c[_0x22b4('0x10')]({'plain':!![]});if(_0x3e3692['direction']['toLowerCase']()==='in'||_0x3e3692[_0x22b4('0x11')]['toLowerCase']()===_0x22b4('0x12')&&!_0x3e3692[_0x22b4('0x13')]&&!_[_0x22b4('0x14')](_0x3e3692[_0x22b4('0x15')])){_0x3e4cf3[_0x22b4('0x16')][_0x22b4('0x17')]({'where':{'id':_0x3e3692[_0x22b4('0x18')]}})[_0x22b4('0x19')](function(_0x538740){if(_0x538740){_0x538740['update']({'lastMsgAt':_0x3e3692[_0x22b4('0x1a')],'lastMsgDirection':_0x3e3692[_0x22b4('0x11')][_0x22b4('0x1b')]()});}})[_0x22b4('0x1c')](function(_0x3b9934){console[_0x22b4('0x1d')](_0x3b9934);});}if(_0x3e3692[_0x22b4('0x11')]===_0x22b4('0x12')&&!_0x3e3692[_0x22b4('0x13')]){var _0x25493b;_0x3e4cf3['WhatsappAccount'][_0x22b4('0x1e')]({'where':{'id':_0x3e3692[_0x22b4('0x1f')]},'raw':!![]})[_0x22b4('0x19')](function(_0x57d4b6){_0x25493b=_0x57d4b6;if(_0x25493b&&_0x25493b[_0x22b4('0x20')]){switch(_0x25493b['type']){case _0x22b4('0x21'):var _0x436afe=require(_0x22b4('0x21'));if(_0x25493b[_0x22b4('0x22')]&&_0x25493b[_0x22b4('0x23')]&&_0x25493b['phone']){var _0x590cbd=new _0x436afe(_0x25493b['accountSid'],_0x25493b[_0x22b4('0x23')]);_0x590cbd[_0x22b4('0x24')]['create']({'body':_0x3e3692[_0x22b4('0x25')],'to':_0x22b4('0x26')+_0x3e3692[_0x22b4('0x27')],'from':'whatsapp:'+_0x25493b[_0x22b4('0x27')],'statusCallback':_0x25493b[_0x22b4('0x28')]+_0x22b4('0x29')+_0x3e3692['id']+_0x22b4('0x2a')+_0x25493b[_0x22b4('0x2b')]})[_0x22b4('0x19')](function(_0x4cb97c){if(_0x4cb97c['sid']){return _0x47d45c[_0x22b4('0x2c')]({'messageId':_0x4cb97c['sid']});}})[_0x22b4('0x1c')](function(_0x48bd4d){logger[_0x22b4('0x1d')](_0x22b4('0x2d'),_0x22b4('0x2e'),_0x22b4('0x21'),util[_0x22b4('0x2f')](_0x48bd4d,{'showHidden':![],'depth':null}));});}else{logger[_0x22b4('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x22b4('0x2e'),_0x22b4('0x21'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0x22b4('0x30')](function(){_0x5f0338();});}else{_0x5f0338();}}},'charset':_0x22b4('0x31'),'collate':_0x22b4('0x32')});};
\ No newline at end of file
+var _0x5801=['then','update','createdAt','error','out','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','accountSid','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','catch','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','lodash','util','api','bluebird','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId'];(function(_0xd68695,_0x4f3e41){var _0x5842aa=function(_0x346a91){while(--_0x346a91){_0xd68695['push'](_0xd68695['shift']());}};_0x5842aa(++_0x4f3e41);}(_0x5801,0x115));var _0x1580=function(_0x2cb3f9,_0x7c450f){_0x2cb3f9=_0x2cb3f9-0x0;var _0x1a8221=_0x5801[_0x2cb3f9];return _0x1a8221;};'use strict';var _=require(_0x1580('0x0'));var util=require(_0x1580('0x1'));var logger=require('../../config/logger')(_0x1580('0x2'));var moment=require('moment');var BPromise=require(_0x1580('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1580('0x4'));var attributes=require('./whatsappMessage.attributes');module[_0x1580('0x5')]=function(_0x340cd2,_0x509811){return _0x340cd2[_0x1580('0x6')](_0x1580('0x7'),attributes,{'tableName':_0x1580('0x8'),'paranoid':![],'indexes':[{'name':_0x1580('0x9'),'fields':['messageId']},{'name':_0x1580('0xa'),'fields':[_0x1580('0xb')],'type':_0x1580('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x33a959,_0x325b75,_0xd0049e){var _0x446004=_0x340cd2[_0x1580('0xd')];var _0x346e2a=_0x33a959[_0x1580('0xe')]({'plain':!![]});if(_0x346e2a[_0x1580('0xf')]['toLowerCase']()==='in'||_0x346e2a['direction'][_0x1580('0x10')]()==='out'&&!_0x346e2a[_0x1580('0x11')]&&!_[_0x1580('0x12')](_0x346e2a[_0x1580('0x13')])){_0x446004[_0x1580('0x14')][_0x1580('0x15')]({'where':{'id':_0x346e2a[_0x1580('0x16')]}})[_0x1580('0x17')](function(_0x397f84){if(_0x397f84){_0x397f84[_0x1580('0x18')]({'lastMsgAt':_0x346e2a[_0x1580('0x19')],'lastMsgDirection':_0x346e2a[_0x1580('0xf')]['toLowerCase']()});}})['catch'](function(_0x4931a5){console[_0x1580('0x1a')](_0x4931a5);});}if(_0x346e2a[_0x1580('0xf')]===_0x1580('0x1b')&&!_0x346e2a[_0x1580('0x11')]){var _0x47f101;_0x446004[_0x1580('0x1c')][_0x1580('0x1d')]({'where':{'id':_0x346e2a[_0x1580('0x1e')]},'raw':!![]})[_0x1580('0x17')](function(_0x5d5551){_0x47f101=_0x5d5551;if(_0x47f101&&_0x47f101[_0x1580('0x1f')]){switch(_0x47f101[_0x1580('0x1f')]){case _0x1580('0x20'):var _0x36027c=require(_0x1580('0x20'));if(_0x47f101['accountSid']&&_0x47f101[_0x1580('0x21')]&&_0x47f101[_0x1580('0x22')]){var _0x16c936=new _0x36027c(_0x47f101[_0x1580('0x23')],_0x47f101[_0x1580('0x21')]);_0x16c936[_0x1580('0x24')][_0x1580('0x25')]({'body':_0x346e2a['body'],'to':_0x1580('0x26')+_0x346e2a[_0x1580('0x22')],'from':'whatsapp:'+_0x47f101[_0x1580('0x22')],'statusCallback':_0x47f101[_0x1580('0x27')]+_0x1580('0x28')+_0x346e2a['id']+'/status?token='+_0x47f101[_0x1580('0x29')]})['then'](function(_0x8b8df3){if(_0x8b8df3[_0x1580('0x2a')]){return _0x33a959['update']({'messageId':_0x8b8df3[_0x1580('0x2a')]});}})[_0x1580('0x2b')](function(_0x220140){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1580('0x2c'),_0x1580('0x20'),util[_0x1580('0x2d')](_0x220140,{'showHidden':![],'depth':null}));});}else{logger[_0x1580('0x1a')](_0x1580('0x2e'),_0x1580('0x2c'),_0x1580('0x20'),_0x1580('0x2f'));}break;}}})[_0x1580('0x30')](function(){_0xd0049e();});}else{_0xd0049e();}}},'charset':_0x1580('0x31'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 595d2ba..fd0ddcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7077=['body','options','raw','then','CreateWhatsappMessage','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','WhatsappMessage','create'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x7077,0x150));var _0x7707=function(_0x526ae9,_0x56b82c){_0x526ae9=_0x526ae9-0x0;var _0xc0f3a9=_0x7077[_0x526ae9];return _0xc0f3a9;};'use strict';var _=require(_0x7707('0x0'));var util=require(_0x7707('0x1'));var moment=require(_0x7707('0x2'));var BPromise=require(_0x7707('0x3'));var rs=require(_0x7707('0x4'));var fs=require('fs');var Redis=require(_0x7707('0x5'));var db=require(_0x7707('0x6'))['db'];var utils=require(_0x7707('0x7'));var logger=require(_0x7707('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7707('0x9'));var client=jayson['client'][_0x7707('0xa')]({'port':0x232a});config[_0x7707('0xb')]=_[_0x7707('0xc')](config[_0x7707('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7707('0xd'))[_0x7707('0xe')](socket);function respondWithRpcPromise(_0x1c6ee6,_0x56047c,_0x5d0386){return new BPromise(function(_0x85b1ec,_0x188eea){return client[_0x7707('0xf')](_0x1c6ee6,_0x5d0386)['then'](function(_0x102eb3){logger[_0x7707('0x10')](_0x7707('0x11'),_0x56047c,_0x7707('0x12'));logger[_0x7707('0x13')](_0x7707('0x14'),_0x56047c,_0x7707('0x12'),JSON[_0x7707('0x15')](_0x102eb3));if(_0x102eb3[_0x7707('0x16')]){if(_0x102eb3[_0x7707('0x16')]['code']===0x1f4){logger[_0x7707('0x16')](_0x7707('0x11'),_0x56047c,_0x102eb3[_0x7707('0x16')][_0x7707('0x17')]);return _0x188eea(_0x102eb3['error']['message']);}logger[_0x7707('0x16')](_0x7707('0x11'),_0x56047c,_0x102eb3[_0x7707('0x16')][_0x7707('0x17')]);return _0x85b1ec(_0x102eb3[_0x7707('0x16')][_0x7707('0x17')]);}else{logger['info'](_0x7707('0x11'),_0x56047c,_0x7707('0x12'));_0x85b1ec(_0x102eb3[_0x7707('0x18')][_0x7707('0x17')]);}})['catch'](function(_0x458033){logger[_0x7707('0x16')](_0x7707('0x11'),_0x56047c,_0x458033);_0x188eea(_0x458033);});});}exports['CreateWhatsappMessage']=function(_0x1735c5){var _0x5aa183=this;return new Promise(function(_0xdf47e6,_0x1bf5f9){return db[_0x7707('0x19')][_0x7707('0x1a')](_0x1735c5[_0x7707('0x1b')],{'raw':_0x1735c5[_0x7707('0x1c')]?_0x1735c5['options'][_0x7707('0x1d')]===undefined?!![]:![]:!![]})[_0x7707('0x1e')](function(_0xfa2aab){logger[_0x7707('0x10')](_0x7707('0x1f'),_0x1735c5);logger[_0x7707('0x13')](_0x7707('0x1f'),_0x1735c5,JSON['stringify'](_0xfa2aab));_0xdf47e6(_0xfa2aab);})[_0x7707('0x20')](function(_0x409417){logger[_0x7707('0x16')]('CreateWhatsappMessage',_0x409417[_0x7707('0x17')],_0x1735c5);_0x1bf5f9(_0x5aa183[_0x7707('0x16')](0x1f4,_0x409417[_0x7707('0x17')]));});});};
\ No newline at end of file
+var _0x0210=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','WhatsappMessage','options','raw','moment','bluebird'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0x0210,0x178));var _0x0021=function(_0x454bfb,_0x36243d){_0x454bfb=_0x454bfb-0x0;var _0x4c8104=_0x0210[_0x454bfb];return _0x4c8104;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0021('0x0'));var BPromise=require(_0x0021('0x1'));var rs=require(_0x0021('0x2'));var fs=require('fs');var Redis=require(_0x0021('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0021('0x4'));var logger=require('../../config/logger')(_0x0021('0x5'));var config=require(_0x0021('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0021('0x7')]['http']({'port':0x232a});config[_0x0021('0x8')]=_[_0x0021('0x9')](config[_0x0021('0x8')],{'host':_0x0021('0xa'),'port':0x18eb});var socket=require(_0x0021('0xb'))(new Redis(config[_0x0021('0x8')]));require(_0x0021('0xc'))['register'](socket);function respondWithRpcPromise(_0x478b3b,_0x49b11e,_0xbb5a6d){return new BPromise(function(_0x1dfa55,_0x22ad94){return client[_0x0021('0xd')](_0x478b3b,_0xbb5a6d)[_0x0021('0xe')](function(_0x837b6b){logger[_0x0021('0xf')](_0x0021('0x10'),_0x49b11e,'request\x20sent');logger[_0x0021('0x11')](_0x0021('0x12'),_0x49b11e,_0x0021('0x13'),JSON[_0x0021('0x14')](_0x837b6b));if(_0x837b6b[_0x0021('0x15')]){if(_0x837b6b[_0x0021('0x15')]['code']===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x49b11e,_0x837b6b[_0x0021('0x15')][_0x0021('0x16')]);return _0x22ad94(_0x837b6b[_0x0021('0x15')][_0x0021('0x16')]);}logger[_0x0021('0x15')](_0x0021('0x10'),_0x49b11e,_0x837b6b['error'][_0x0021('0x16')]);return _0x1dfa55(_0x837b6b[_0x0021('0x15')][_0x0021('0x16')]);}else{logger[_0x0021('0xf')](_0x0021('0x10'),_0x49b11e,_0x0021('0x13'));_0x1dfa55(_0x837b6b['result'][_0x0021('0x16')]);}})[_0x0021('0x17')](function(_0x5cbf57){logger['error'](_0x0021('0x10'),_0x49b11e,_0x5cbf57);_0x22ad94(_0x5cbf57);});});}exports['CreateWhatsappMessage']=function(_0x2e43b6){var _0x2b6b9f=this;return new Promise(function(_0x4a1b71,_0x295163){return db[_0x0021('0x18')]['create'](_0x2e43b6['body'],{'raw':_0x2e43b6[_0x0021('0x19')]?_0x2e43b6[_0x0021('0x19')][_0x0021('0x1a')]===undefined?!![]:![]:!![]})[_0x0021('0xe')](function(_0x1b7087){logger[_0x0021('0xf')]('CreateWhatsappMessage',_0x2e43b6);logger[_0x0021('0x11')]('CreateWhatsappMessage',_0x2e43b6,JSON['stringify'](_0x1b7087));_0x4a1b71(_0x1b7087);})[_0x0021('0x17')](function(_0x105406){logger[_0x0021('0x15')]('CreateWhatsappMessage',_0x105406['message'],_0x2e43b6);_0x295163(_0x2b6b9f[_0x0021('0x15')](0x1f4,_0x105406[_0x0021('0x16')]));});});};
\ No newline at end of file
index 02c6020..666e5a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7787=['save','update','emit','removeListener','register','length','whatsappMessage:'];(function(_0xadca93,_0x14a8ea){var _0x14c33c=function(_0xb2e2d1){while(--_0xb2e2d1){_0xadca93['push'](_0xadca93['shift']());}};_0x14c33c(++_0x14a8ea);}(_0x7787,0x103));var _0x7778=function(_0x504cbb,_0x40ff83){_0x504cbb=_0x504cbb-0x0;var _0x2b08af=_0x7787[_0x504cbb];return _0x2b08af;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x7778('0x0'),'remove',_0x7778('0x1')];function createListener(_0x573108,_0x2397d9){return function(_0x38b6e1){_0x2397d9[_0x7778('0x2')](_0x573108,_0x38b6e1);};}function removeListener(_0x249ec7,_0x51db46){return function(){WhatsappMessageEvents[_0x7778('0x3')](_0x249ec7,_0x51db46);};}exports[_0x7778('0x4')]=function(_0x1864ce){for(var _0x390e4d=0x0,_0x305fee=events[_0x7778('0x5')];_0x390e4d<_0x305fee;_0x390e4d++){var _0x58bab1=events[_0x390e4d];var _0x468538=createListener(_0x7778('0x6')+_0x58bab1,_0x1864ce);WhatsappMessageEvents['on'](_0x58bab1,_0x468538);}};
\ No newline at end of file
+var _0x7127=['emit','removeListener','register','whatsappMessage:','./whatsappMessage.events','save','update'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7127,0x1e0));var _0x7712=function(_0x548cad,_0xf00413){_0x548cad=_0x548cad-0x0;var _0xcd71dc=_0x7127[_0x548cad];return _0xcd71dc;};'use strict';var WhatsappMessageEvents=require(_0x7712('0x0'));var events=[_0x7712('0x1'),'remove',_0x7712('0x2')];function createListener(_0x5e1a8a,_0x554fcc){return function(_0x2d3343){_0x554fcc[_0x7712('0x3')](_0x5e1a8a,_0x2d3343);};}function removeListener(_0x345132,_0x2162cf){return function(){WhatsappMessageEvents[_0x7712('0x4')](_0x345132,_0x2162cf);};}exports[_0x7712('0x5')]=function(_0x3519b9){for(var _0x3a1e92=0x0,_0x518e4f=events['length'];_0x3a1e92<_0x518e4f;_0x3a1e92++){var _0x1f6512=events[_0x3a1e92];var _0x117204=createListener(_0x7712('0x6')+_0x1f6512,_0x3519b9);WhatsappMessageEvents['on'](_0x1f6512,_0x117204);}};
\ No newline at end of file
index 0675ac7..8c39b6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c21=['removeAgents','exports','multer','util','path','Router','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','delete','destroy','removeTeams'];(function(_0x5315eb,_0x4b04d3){var _0xd2d81=function(_0xe667ca){while(--_0xe667ca){_0x5315eb['push'](_0x5315eb['shift']());}};_0xd2d81(++_0x4b04d3);}(_0x3c21,0x17c));var _0x13c2=function(_0x22a7f0,_0x5690f2){_0x22a7f0=_0x22a7f0-0x0;var _0x1a1170=_0x3c21[_0x22a7f0];return _0x1a1170;};'use strict';var multer=require(_0x13c2('0x0'));var util=require(_0x13c2('0x1'));var path=require(_0x13c2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x13c2('0x3')]();var fs_extra=require(_0x13c2('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c2('0x5'));var controller=require(_0x13c2('0x6'));router[_0x13c2('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x13c2('0x7')]('/describe',auth[_0x13c2('0x8')](),controller[_0x13c2('0x9')]);router[_0x13c2('0x7')](_0x13c2('0xa'),auth[_0x13c2('0x8')](),controller[_0x13c2('0xb')]);router[_0x13c2('0x7')](_0x13c2('0xc'),auth[_0x13c2('0x8')](),controller[_0x13c2('0xd')]);router[_0x13c2('0x7')](_0x13c2('0xe'),auth[_0x13c2('0x8')](),controller[_0x13c2('0xf')]);router[_0x13c2('0x7')](_0x13c2('0x10'),auth[_0x13c2('0x8')](),controller[_0x13c2('0x11')]);router[_0x13c2('0x12')]('/',auth[_0x13c2('0x8')](),controller['create']);router[_0x13c2('0x12')]('/:id/teams',auth['isAuthenticated'](),controller[_0x13c2('0x13')]);router[_0x13c2('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x13c2('0x14')]);router[_0x13c2('0x15')]('/:id',auth[_0x13c2('0x8')](),controller['update']);router[_0x13c2('0x16')](_0x13c2('0xa'),auth['isAuthenticated'](),controller[_0x13c2('0x17')]);router[_0x13c2('0x16')](_0x13c2('0xe'),auth[_0x13c2('0x8')](),controller[_0x13c2('0x18')]);router[_0x13c2('0x16')]('/:id/users',auth[_0x13c2('0x8')](),controller[_0x13c2('0x19')]);module[_0x13c2('0x1a')]=router;
\ No newline at end of file
+var _0xd15f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','/describe','describe','get','/:id/members','/:id/teams','getTeams','getAgents','post','/:id/users','put','/:id','update','destroy','removeTeams','delete','removeAgents','exports','util','connect-timeout','express'];(function(_0x76201f,_0x377d73){var _0x3d5f34=function(_0x52e220){while(--_0x52e220){_0x76201f['push'](_0x76201f['shift']());}};_0x3d5f34(++_0x377d73);}(_0xd15f,0x1a1));var _0xfd15=function(_0x314a8c,_0x1c2e8d){_0x314a8c=_0x314a8c-0x0;var _0x1d4607=_0xd15f[_0x314a8c];return _0x1d4607;};'use strict';var multer=require('multer');var util=require(_0xfd15('0x0'));var path=require('path');var timeout=require(_0xfd15('0x1'));var express=require(_0xfd15('0x2'));var router=express[_0xfd15('0x3')]();var fs_extra=require(_0xfd15('0x4'));var auth=require(_0xfd15('0x5'));var interaction=require(_0xfd15('0x6'));var config=require(_0xfd15('0x7'));var controller=require(_0xfd15('0x8'));router['get']('/',auth[_0xfd15('0x9')](),controller[_0xfd15('0xa')]);router['get'](_0xfd15('0xb'),auth[_0xfd15('0x9')](),controller[_0xfd15('0xc')]);router['get']('/:id',auth[_0xfd15('0x9')](),controller['show']);router[_0xfd15('0xd')](_0xfd15('0xe'),auth[_0xfd15('0x9')](),controller['getMembers']);router['get'](_0xfd15('0xf'),auth[_0xfd15('0x9')](),controller[_0xfd15('0x10')]);router[_0xfd15('0xd')]('/:id/users',auth[_0xfd15('0x9')](),controller[_0xfd15('0x11')]);router['post']('/',auth[_0xfd15('0x9')](),controller['create']);router[_0xfd15('0x12')](_0xfd15('0xf'),auth[_0xfd15('0x9')](),controller['addTeams']);router['post'](_0xfd15('0x13'),auth[_0xfd15('0x9')](),controller['addAgents']);router[_0xfd15('0x14')](_0xfd15('0x15'),auth[_0xfd15('0x9')](),controller[_0xfd15('0x16')]);router['delete']('/:id',auth[_0xfd15('0x9')](),controller[_0xfd15('0x17')]);router['delete'](_0xfd15('0xf'),auth[_0xfd15('0x9')](),controller[_0xfd15('0x18')]);router[_0xfd15('0x19')](_0xfd15('0x13'),auth[_0xfd15('0x9')](),controller[_0xfd15('0x1a')]);module[_0xfd15('0x1b')]=router;
\ No newline at end of file
index 3c0a5a9..28aa2c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fcf=['sequelize','exports','STRING','INTEGER','roundrobin'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8fcf,0x1db));var _0xf8fc=function(_0xde2158,_0x32d048){_0xde2158=_0xde2158-0x0;var _0x2a95e3=_0x8fcf[_0xde2158];return _0x2a95e3;};'use strict';var Sequelize=require(_0xf8fc('0x0'));module[_0xf8fc('0x1')]={'name':{'type':Sequelize[_0xf8fc('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xf8fc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xf8fc('0x4'))},'description':{'type':Sequelize[_0xf8fc('0x2')]}};
\ No newline at end of file
+var _0x0f69=['roundrobin','STRING','INTEGER','ENUM','beepall'];(function(_0x43639b,_0x2c4d8b){var _0x5bf8c1=function(_0x524e20){while(--_0x524e20){_0x43639b['push'](_0x43639b['shift']());}};_0x5bf8c1(++_0x2c4d8b);}(_0x0f69,0x173));var _0x90f6=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x0f69[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x90f6('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x90f6('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x90f6('0x2')]('rrmemory',_0x90f6('0x3'),_0x90f6('0x4'))},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 79bd74c..e9a01bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2d2=['userProfileId','autoAssociation','update','describe','getMembers','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','each','emit','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','union','compact','transaction','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','WhatsappQueue','include','findAll','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x824118,_0x488af2){var _0x55e59c=function(_0xb0992b){while(--_0xb0992b){_0x824118['push'](_0x824118['shift']());}};_0x55e59c(++_0x488af2);}(_0xd2d2,0x14a));var _0x2d2d=function(_0x55c3ec,_0x25267f){_0x55c3ec=_0x55c3ec-0x0;var _0xe43bb8=_0xd2d2[_0x55c3ec];return _0xe43bb8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2d2d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2d2d('0x1'));var BPromise=require(_0x2d2d('0x2'));var Mustache=require(_0x2d2d('0x3'));var util=require(_0x2d2d('0x4'));var path=require('path');var sox=require(_0x2d2d('0x5'));var csv=require(_0x2d2d('0x6'));var ejs=require(_0x2d2d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d2d('0x8'));var squel=require(_0x2d2d('0x9'));var crypto=require(_0x2d2d('0xa'));var jsforce=require(_0x2d2d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2d2d('0x6'));var querystring=require('querystring');var Papa=require(_0x2d2d('0xc'));var Redis=require(_0x2d2d('0xd'));var authService=require(_0x2d2d('0xe'));var qs=require(_0x2d2d('0xf'));var as=require(_0x2d2d('0x10'));var hardwareService=require(_0x2d2d('0x11'));var logger=require(_0x2d2d('0x12'))(_0x2d2d('0x13'));var utils=require(_0x2d2d('0x14'));var config=require(_0x2d2d('0x15'));var licenseUtil=require(_0x2d2d('0x16'));var db=require(_0x2d2d('0x17'))['db'];config[_0x2d2d('0x18')]=_[_0x2d2d('0x19')](config[_0x2d2d('0x18')],{'host':_0x2d2d('0x1a'),'port':0x18eb});var socket=require(_0x2d2d('0x1b'))(new Redis(config['redis']));require(_0x2d2d('0x1c'))[_0x2d2d('0x1d')](socket);function respondWithStatusCode(_0x26706a,_0x1de6ee){_0x1de6ee=_0x1de6ee||0xcc;return function(_0x54dcdf){if(_0x54dcdf){return _0x26706a[_0x2d2d('0x1e')](_0x1de6ee);}return _0x26706a[_0x2d2d('0x1f')](_0x1de6ee)[_0x2d2d('0x20')]();};}function respondWithResult(_0x305a3c,_0x36ee7d){_0x36ee7d=_0x36ee7d||0xc8;return function(_0x460606){if(_0x460606){return _0x305a3c['status'](_0x36ee7d)[_0x2d2d('0x21')](_0x460606);}};}function respondWithFilteredResult(_0x1f5ec2,_0x2a436e){return function(_0x5c3f80){if(_0x5c3f80){var _0x2df982=typeof _0x2a436e[_0x2d2d('0x22')]===_0x2d2d('0x23')&&typeof _0x2a436e['limit']===_0x2d2d('0x23');var _0x6ff03e=_0x5c3f80[_0x2d2d('0x24')];var _0xa8f63d=_0x2df982?0x0:_0x2a436e[_0x2d2d('0x22')];var _0x5b6d71=_0x2df982?_0x5c3f80[_0x2d2d('0x24')]:_0x2a436e['offset']+_0x2a436e[_0x2d2d('0x25')];var _0x26d994;if(_0x5b6d71>=_0x6ff03e){_0x5b6d71=_0x6ff03e;_0x26d994=0xc8;}else{_0x26d994=0xce;}_0x1f5ec2[_0x2d2d('0x1f')](_0x26d994);return _0x1f5ec2['set'](_0x2d2d('0x26'),_0xa8f63d+'-'+_0x5b6d71+'/'+_0x6ff03e)['json'](_0x5c3f80);}return null;};}function patchUpdates(_0x11baf0){return function(_0x5e1fa0){try{jsonpatch[_0x2d2d('0x27')](_0x5e1fa0,_0x11baf0,!![]);}catch(_0x502d2b){return BPromise[_0x2d2d('0x28')](_0x502d2b);}return _0x5e1fa0[_0x2d2d('0x29')]();};}function saveUpdates(_0x50416f,_0x99a9a){return function(_0xf85605){if(_0xf85605){return _0xf85605['update'](_0x50416f)[_0x2d2d('0x2a')](function(_0x367475){return _0x367475;});}return null;};}function removeEntity(_0x39e5d3,_0x16e32d){return function(_0x37b6a7){if(_0x37b6a7){return _0x37b6a7[_0x2d2d('0x2b')]()[_0x2d2d('0x2a')](function(){var _0x1c5b16=_0x37b6a7[_0x2d2d('0x2c')]({'plain':!![]});var _0x3e4a03=_0x2d2d('0x2d');return db[_0x2d2d('0x2e')][_0x2d2d('0x2b')]({'where':{'type':_0x3e4a03,'resourceId':_0x1c5b16['id']}})['then'](function(){return _0x37b6a7;});})[_0x2d2d('0x2a')](function(){_0x39e5d3[_0x2d2d('0x1f')](0xcc)[_0x2d2d('0x20')]();});}};}function handleEntityNotFound(_0x2dcb59,_0x594194){return function(_0x55310b){if(!_0x55310b){_0x2dcb59[_0x2d2d('0x1e')](0x194);}return _0x55310b;};}function handleError(_0x3c9f74,_0x332f20){_0x332f20=_0x332f20||0x1f4;return function(_0x4d1f2c){logger[_0x2d2d('0x2f')](_0x4d1f2c[_0x2d2d('0x30')]);if(_0x4d1f2c[_0x2d2d('0x31')]){delete _0x4d1f2c[_0x2d2d('0x31')];}_0x3c9f74[_0x2d2d('0x1f')](_0x332f20)[_0x2d2d('0x32')](_0x4d1f2c);};}exports[_0x2d2d('0x33')]=function(_0x2b87e7,_0x19161a){var _0x4fbe6e={},_0x1d56dc={},_0x2d6ae4={'count':0x0,'rows':[]};var _0x35026e=_['map'](db['WhatsappQueue'][_0x2d2d('0x34')],function(_0x4af176){return{'name':_0x4af176[_0x2d2d('0x35')],'type':_0x4af176[_0x2d2d('0x36')][_0x2d2d('0x37')]};});_0x1d56dc['model']=_[_0x2d2d('0x38')](_0x35026e,_0x2d2d('0x31'));_0x1d56dc[_0x2d2d('0x39')]=_[_0x2d2d('0x3a')](_0x2b87e7[_0x2d2d('0x39')]);_0x1d56dc[_0x2d2d('0x3b')]=_[_0x2d2d('0x3c')](_0x1d56dc[_0x2d2d('0x3d')],_0x1d56dc[_0x2d2d('0x39')]);_0x4fbe6e[_0x2d2d('0x3e')]=_['intersection'](_0x1d56dc[_0x2d2d('0x3d')],qs[_0x2d2d('0x3f')](_0x2b87e7[_0x2d2d('0x39')]['fields']));_0x4fbe6e[_0x2d2d('0x3e')]=_0x4fbe6e['attributes'][_0x2d2d('0x40')]?_0x4fbe6e['attributes']:_0x1d56dc[_0x2d2d('0x3d')];if(!_0x2b87e7['query'][_0x2d2d('0x41')](_0x2d2d('0x42'))){_0x4fbe6e[_0x2d2d('0x25')]=qs['limit'](_0x2b87e7[_0x2d2d('0x39')][_0x2d2d('0x25')]);_0x4fbe6e[_0x2d2d('0x22')]=qs[_0x2d2d('0x22')](_0x2b87e7[_0x2d2d('0x39')][_0x2d2d('0x22')]);}_0x4fbe6e[_0x2d2d('0x43')]=qs[_0x2d2d('0x44')](_0x2b87e7[_0x2d2d('0x39')][_0x2d2d('0x44')]);_0x4fbe6e[_0x2d2d('0x45')]=qs[_0x2d2d('0x3b')](_[_0x2d2d('0x46')](_0x2b87e7[_0x2d2d('0x39')],_0x1d56dc[_0x2d2d('0x3b')]),_0x35026e);if(_0x2b87e7[_0x2d2d('0x39')][_0x2d2d('0x47')]){_0x4fbe6e[_0x2d2d('0x45')]=_['merge'](_0x4fbe6e[_0x2d2d('0x45')],{'$or':_[_0x2d2d('0x38')](_0x35026e,function(_0xab5d6d){if(_0xab5d6d[_0x2d2d('0x36')]!==_0x2d2d('0x48')){var _0x31606b={};_0x31606b[_0xab5d6d['name']]={'$like':'%'+_0x2b87e7['query'][_0x2d2d('0x47')]+'%'};return _0x31606b;}})});}_0x4fbe6e=_[_0x2d2d('0x49')]({},_0x4fbe6e,_0x2b87e7[_0x2d2d('0x4a')]);var _0x558159={'where':_0x4fbe6e[_0x2d2d('0x45')]};return db[_0x2d2d('0x4b')][_0x2d2d('0x24')](_0x558159)[_0x2d2d('0x2a')](function(_0x2b4f89){_0x2d6ae4[_0x2d2d('0x24')]=_0x2b4f89;if(_0x2b87e7[_0x2d2d('0x39')]['includeAll']){_0x4fbe6e[_0x2d2d('0x4c')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x2d2d('0x4d')](_0x4fbe6e);})[_0x2d2d('0x2a')](function(_0x390ed3){_0x2d6ae4['rows']=_0x390ed3;return _0x2d6ae4;})[_0x2d2d('0x2a')](respondWithFilteredResult(_0x19161a,_0x4fbe6e))[_0x2d2d('0x4e')](handleError(_0x19161a,null));};exports[_0x2d2d('0x4f')]=function(_0x47e1ea,_0x110ffb){var _0x3e256b={'raw':!![],'where':{'id':_0x47e1ea[_0x2d2d('0x50')]['id']}},_0x396fbc={};_0x396fbc['model']=_[_0x2d2d('0x3a')](db[_0x2d2d('0x4b')]['rawAttributes']);_0x396fbc[_0x2d2d('0x39')]=_[_0x2d2d('0x3a')](_0x47e1ea[_0x2d2d('0x39')]);_0x396fbc[_0x2d2d('0x3b')]=_[_0x2d2d('0x3c')](_0x396fbc[_0x2d2d('0x3d')],_0x396fbc[_0x2d2d('0x39')]);_0x3e256b['attributes']=_[_0x2d2d('0x3c')](_0x396fbc[_0x2d2d('0x3d')],qs[_0x2d2d('0x3f')](_0x47e1ea[_0x2d2d('0x39')][_0x2d2d('0x3f')]));_0x3e256b[_0x2d2d('0x3e')]=_0x3e256b[_0x2d2d('0x3e')]['length']?_0x3e256b[_0x2d2d('0x3e')]:_0x396fbc[_0x2d2d('0x3d')];if(_0x47e1ea[_0x2d2d('0x39')][_0x2d2d('0x51')]){_0x3e256b[_0x2d2d('0x4c')]=[{'all':!![]}];}_0x3e256b=_[_0x2d2d('0x49')]({},_0x3e256b,_0x47e1ea[_0x2d2d('0x4a')]);return db[_0x2d2d('0x4b')][_0x2d2d('0x52')](_0x3e256b)[_0x2d2d('0x2a')](handleEntityNotFound(_0x110ffb,null))[_0x2d2d('0x2a')](respondWithResult(_0x110ffb,null))[_0x2d2d('0x4e')](handleError(_0x110ffb,null));};exports['create']=function(_0x251461,_0x344d96){return db[_0x2d2d('0x4b')][_0x2d2d('0x53')](_0x251461[_0x2d2d('0x54')],{})[_0x2d2d('0x2a')](function(_0x54e0a4){var _0x5d49b2=_0x251461['user']['get']({'plain':!![]});if(!_0x5d49b2)throw new Error(_0x2d2d('0x55'));if(_0x5d49b2['role']===_0x2d2d('0x56')){var _0x9b40a9=_0x54e0a4[_0x2d2d('0x2c')]({'plain':!![]});var _0x5a6eb5='WhatsappQueues';return db['UserProfileSection'][_0x2d2d('0x52')]({'where':{'name':_0x5a6eb5,'userProfileId':_0x5d49b2[_0x2d2d('0x57')]},'raw':!![]})[_0x2d2d('0x2a')](function(_0x288fbd){if(_0x288fbd&&_0x288fbd[_0x2d2d('0x58')]===0x0){return db[_0x2d2d('0x2e')][_0x2d2d('0x53')]({'name':_0x9b40a9[_0x2d2d('0x31')],'resourceId':_0x9b40a9['id'],'type':_0x288fbd[_0x2d2d('0x31')],'sectionId':_0x288fbd['id']},{})[_0x2d2d('0x2a')](function(){return _0x54e0a4;});}else{return _0x54e0a4;}})[_0x2d2d('0x4e')](function(_0x39c7eb){logger[_0x2d2d('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39c7eb);throw _0x39c7eb;});}return _0x54e0a4;})[_0x2d2d('0x2a')](respondWithResult(_0x344d96,0xc9))[_0x2d2d('0x4e')](handleError(_0x344d96,null));};exports[_0x2d2d('0x59')]=function(_0x508af3,_0x5edca7){if(_0x508af3['body']['id']){delete _0x508af3[_0x2d2d('0x54')]['id'];}return db[_0x2d2d('0x4b')]['find']({'where':{'id':_0x508af3[_0x2d2d('0x50')]['id']}})[_0x2d2d('0x2a')](handleEntityNotFound(_0x5edca7,null))[_0x2d2d('0x2a')](saveUpdates(_0x508af3[_0x2d2d('0x54')],null))[_0x2d2d('0x2a')](respondWithResult(_0x5edca7,null))[_0x2d2d('0x4e')](handleError(_0x5edca7,null));};exports[_0x2d2d('0x2b')]=function(_0x56542b,_0x167adf){return db[_0x2d2d('0x4b')][_0x2d2d('0x52')]({'where':{'id':_0x56542b[_0x2d2d('0x50')]['id']}})[_0x2d2d('0x2a')](handleEntityNotFound(_0x167adf,null))['then'](removeEntity(_0x167adf,null))[_0x2d2d('0x4e')](handleError(_0x167adf,null));};exports[_0x2d2d('0x5a')]=function(_0x52557e,_0x299e57){return db[_0x2d2d('0x4b')][_0x2d2d('0x5a')]()[_0x2d2d('0x2a')](respondWithResult(_0x299e57,null))[_0x2d2d('0x4e')](handleError(_0x299e57,null));};exports[_0x2d2d('0x5b')]=function(_0x2e4dca,_0x4cd1de,_0x1dafb1){var _0x1a513f={'raw':!![],'where':{}},_0x4a7ff4={},_0x1ca735;return db['WhatsappQueue']['findOne']({'where':{'id':_0x2e4dca[_0x2d2d('0x50')]['id']}})[_0x2d2d('0x2a')](handleEntityNotFound(_0x4cd1de,null))[_0x2d2d('0x2a')](function(_0x284853){if(_0x284853){_0x1ca735=_0x284853[_0x2d2d('0x2c')]({'plain':!![]});_0x4a7ff4[_0x2d2d('0x3d')]=_[_0x2d2d('0x3a')](db[_0x2d2d('0x5c')][_0x2d2d('0x34')]);_0x4a7ff4[_0x2d2d('0x39')]=_[_0x2d2d('0x3a')](_0x2e4dca[_0x2d2d('0x39')]);_0x4a7ff4[_0x2d2d('0x3b')]=_[_0x2d2d('0x3c')](_0x4a7ff4[_0x2d2d('0x3d')],_0x4a7ff4['query']);_0x1a513f['attributes']=_[_0x2d2d('0x3c')](_0x4a7ff4[_0x2d2d('0x3d')],qs[_0x2d2d('0x3f')](_0x2e4dca['query'][_0x2d2d('0x3f')]));_0x1a513f[_0x2d2d('0x3e')]=_0x1a513f[_0x2d2d('0x3e')][_0x2d2d('0x40')]?_0x1a513f[_0x2d2d('0x3e')]:_0x4a7ff4[_0x2d2d('0x3d')];if(!_0x2e4dca['query'][_0x2d2d('0x41')](_0x2d2d('0x42'))){_0x1a513f[_0x2d2d('0x25')]=qs[_0x2d2d('0x25')](_0x2e4dca[_0x2d2d('0x39')][_0x2d2d('0x25')]);_0x1a513f[_0x2d2d('0x22')]=qs[_0x2d2d('0x22')](_0x2e4dca[_0x2d2d('0x39')][_0x2d2d('0x22')]);}_0x1a513f['order']=qs[_0x2d2d('0x44')](_0x2e4dca['query'][_0x2d2d('0x44')]);_0x1a513f[_0x2d2d('0x45')]=qs[_0x2d2d('0x3b')](_[_0x2d2d('0x46')](_0x2e4dca[_0x2d2d('0x39')],_0x4a7ff4[_0x2d2d('0x3b')]));_0x1a513f[_0x2d2d('0x45')]['WhatsappQueueId']=_0x284853['id'];if(_0x2e4dca['query']['filter']){_0x1a513f[_0x2d2d('0x45')]=_[_0x2d2d('0x49')](_0x1a513f[_0x2d2d('0x45')],{'$or':_[_0x2d2d('0x38')](_0x1a513f[_0x2d2d('0x3e')],function(_0x36db67){var _0x44efca={};_0x44efca[_0x36db67]={'$like':'%'+_0x2e4dca[_0x2d2d('0x39')][_0x2d2d('0x47')]+'%'};return _0x44efca;})});}_0x1a513f=_['merge']({},_0x1a513f,_0x2e4dca[_0x2d2d('0x4a')]);return db[_0x2d2d('0x5c')][_0x2d2d('0x4d')](_0x1a513f);}})[_0x2d2d('0x2a')](function(_0x56e361){if(_0x56e361){return db[_0x2d2d('0x5d')][_0x2d2d('0x5e')]({'where':{'id':_[_0x2d2d('0x38')](_0x56e361,_0x2d2d('0x5f')),'role':_0x2d2d('0x60')},'attributes':['id','name',_0x2d2d('0x61'),_0x2d2d('0x62'),_0x2d2d('0x63')]});}})[_0x2d2d('0x2a')](function(_0x13629e){if(_0x13629e){return{'count':_0x13629e['count'],'rows':_[_0x2d2d('0x38')](_0x13629e['rows'],function(_0x12021c){return{'membername':_0x12021c[_0x2d2d('0x31')],'UserId':_0x12021c['id'],'queue_name':_0x1ca735[_0x2d2d('0x31')],'WhatsappQueueId':_0x1ca735['id'],'interface':util[_0x2d2d('0x64')](_0x2d2d('0x65'),_0x2d2d('0x66'),_0x12021c[_0x2d2d('0x31')]),'penalty':0x0,'paused':_0x12021c[_0x2d2d('0x61')],'createdAt':_0x12021c[_0x2d2d('0x63')],'updatedAt':_0x12021c[_0x2d2d('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2d2d('0x2a')](respondWithFilteredResult(_0x4cd1de,_0x1a513f))[_0x2d2d('0x4e')](handleError(_0x4cd1de,null));};exports[_0x2d2d('0x67')]=function(_0x16931a,_0x2fe27e,_0x557307){var _0x228f01={};var _0x18e58d={};var _0x4851d4;var _0x49ddd0;return db[_0x2d2d('0x4b')][_0x2d2d('0x68')]({'where':{'id':_0x16931a[_0x2d2d('0x50')]['id']}})['then'](handleEntityNotFound(_0x2fe27e,null))['then'](function(_0x303a38){if(_0x303a38){_0x4851d4=_0x303a38;_0x18e58d[_0x2d2d('0x3d')]=_[_0x2d2d('0x3a')](db[_0x2d2d('0x69')][_0x2d2d('0x34')]);_0x18e58d[_0x2d2d('0x39')]=_[_0x2d2d('0x3a')](_0x16931a[_0x2d2d('0x39')]);_0x18e58d['filters']=_[_0x2d2d('0x3c')](_0x18e58d[_0x2d2d('0x3d')],_0x18e58d[_0x2d2d('0x39')]);_0x228f01[_0x2d2d('0x3e')]=_['intersection'](_0x18e58d[_0x2d2d('0x3d')],qs[_0x2d2d('0x3f')](_0x16931a[_0x2d2d('0x39')][_0x2d2d('0x3f')]));_0x228f01[_0x2d2d('0x3e')]=_0x228f01[_0x2d2d('0x3e')]['length']?_0x228f01[_0x2d2d('0x3e')]:_0x18e58d[_0x2d2d('0x3d')];_0x228f01[_0x2d2d('0x43')]=qs[_0x2d2d('0x44')](_0x16931a[_0x2d2d('0x39')][_0x2d2d('0x44')]);_0x228f01[_0x2d2d('0x45')]=qs['filters'](_['pick'](_0x16931a[_0x2d2d('0x39')],_0x18e58d[_0x2d2d('0x3b')]));if(_0x16931a[_0x2d2d('0x39')]['filter']){_0x228f01[_0x2d2d('0x45')]=_['merge'](_0x228f01[_0x2d2d('0x45')],{'$or':_[_0x2d2d('0x38')](_0x228f01[_0x2d2d('0x3e')],function(_0x4315cc){var _0x3af516={};_0x3af516[_0x4315cc]={'$like':'%'+_0x16931a[_0x2d2d('0x39')][_0x2d2d('0x47')]+'%'};return _0x3af516;})});}_0x228f01=_[_0x2d2d('0x49')]({},_0x228f01,_0x16931a[_0x2d2d('0x4a')]);return _0x4851d4['getTeams'](_0x228f01);}})[_0x2d2d('0x2a')](function(_0x272ad7){if(_0x272ad7){_0x49ddd0=_0x272ad7[_0x2d2d('0x40')];if(!_0x16931a[_0x2d2d('0x39')][_0x2d2d('0x41')](_0x2d2d('0x42'))){_0x228f01[_0x2d2d('0x25')]=qs[_0x2d2d('0x25')](_0x16931a[_0x2d2d('0x39')][_0x2d2d('0x25')]);_0x228f01['offset']=qs[_0x2d2d('0x22')](_0x16931a[_0x2d2d('0x39')][_0x2d2d('0x22')]);}return _0x4851d4['getTeams'](_0x228f01);}})[_0x2d2d('0x2a')](function(_0x353531){if(_0x353531){return _0x353531?{'count':_0x49ddd0,'rows':_0x353531}:null;}})['then'](respondWithResult(_0x2fe27e,null))[_0x2d2d('0x4e')](handleError(_0x2fe27e,null));};exports[_0x2d2d('0x6a')]=function(_0x10adeb,_0xc3983,_0x3920f6){var _0x3cb84c=_0x10adeb['body'][_0x2d2d('0x6b')];return db[_0x2d2d('0x69')][_0x2d2d('0x4d')]({'where':{'id':_0x3cb84c},'attributes':['id'],'include':[{'model':db[_0x2d2d('0x5d')],'as':_0x2d2d('0x6c'),'attributes':['id','name',_0x2d2d('0x6d'),_0x2d2d('0x6e'),'interface'],'raw':!![]}]})[_0x2d2d('0x2a')](function(_0xbe31f5){if(_0xbe31f5){var _0x5ed174=_[_0x2d2d('0x6f')](_0xbe31f5,function(_0x185119){var _0x28e613=_0x185119[_0x2d2d('0x2c')]({'plain':!![]});return _0x28e613[_0x2d2d('0x6c')];});return db[_0x2d2d('0x4b')][_0x2d2d('0x52')]({'where':{'id':_0x10adeb[_0x2d2d('0x50')]['id']}})[_0x2d2d('0x2a')](function(_0xfb3517){return db[_0x2d2d('0x70')]['transaction'](function(_0x36effe){return _0xfb3517[_0x2d2d('0x6a')](_0x3cb84c,{'transaction':_0x36effe})[_0x2d2d('0x2a')](function(){return BPromise[_0x2d2d('0x71')](_0x5ed174,function(_0x20126d){return db[_0x2d2d('0x5c')]['findOrCreate']({'where':{'UserId':_0x20126d['id'],'WhatsappQueueId':_0x10adeb[_0x2d2d('0x50')]['id']},'transaction':_0x36effe});});})[_0x2d2d('0x2a')](function(){_0x5ed174['forEach'](function(_0x2feba9){socket[_0x2d2d('0x72')](_0x2d2d('0x73'),{'UserId':_0x2feba9['id'],'WhatsappQueueId':_0xfb3517['id']});});});});});}})[_0x2d2d('0x2a')](respondWithStatusCode(_0xc3983,null))[_0x2d2d('0x4e')](handleError(_0xc3983,null));};exports[_0x2d2d('0x74')]=function(_0x51cc97,_0x1e4a0e,_0x49d508){return db['Team'][_0x2d2d('0x4d')]({'where':{'id':_0x51cc97['query'][_0x2d2d('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x2d2d('0x5d')],'as':_0x2d2d('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x2d2d('0x2a')](handleEntityNotFound(_0x1e4a0e,null))[_0x2d2d('0x2a')](function(_0x376c35){var _0x458bcc=_['map'](_0x376c35,'id');var _0x260dd4=[];var _0x1ec5e9=[];var _0x3b04d9=squel[_0x2d2d('0x75')]();_0x3b04d9['field'](_0x2d2d('0x76'))[_0x2d2d('0x77')](_0x2d2d('0x78'),'tq')[_0x2d2d('0x79')]('user_has_teams','ut',_0x2d2d('0x7a'))[_0x2d2d('0x45')](_0x2d2d('0x7b'),_0x51cc97[_0x2d2d('0x50')]['id']);for(var _0x1c832a=0x0;_0x1c832a<_0x376c35[_0x2d2d('0x40')];_0x1c832a+=0x1){let _0x360bf2=_0x376c35[_0x1c832a];for(var _0x31a7e5=0x0;_0x31a7e5<_0x360bf2['Agents'][_0x2d2d('0x40')];_0x31a7e5+=0x1){let _0x50605f=_0x360bf2[_0x2d2d('0x6c')][_0x31a7e5];var _0x14cb5c=_0x3b04d9[_0x2d2d('0x7c')]();_0x14cb5c[_0x2d2d('0x45')](_0x2d2d('0x7d'),_0x50605f['id']);_0x1ec5e9['push'](db[_0x2d2d('0x70')][_0x2d2d('0x39')](_0x14cb5c[_0x2d2d('0x7e')](),{'type':db[_0x2d2d('0x70')]['QueryTypes'][_0x2d2d('0x7f')]})[_0x2d2d('0x2a')](function(_0x107c9a){if(_0x107c9a['length']===0x1){return _0x50605f['id'];}else{var _0x58b8cd=_[_0x2d2d('0x80')](_['map'](_0x107c9a,_0x2d2d('0x81')),function(_0x46cf55){return _['includes'](_0x458bcc,_0x46cf55);});if(_0x58b8cd){return _0x50605f['id'];}}}));}}return BPromise['all'](_0x1ec5e9)[_0x2d2d('0x2a')](function(_0x1f2e25){_0x260dd4=_(_0x260dd4)[_0x2d2d('0x82')](_0x1f2e25)[_0x2d2d('0x83')]()['value']();return db[_0x2d2d('0x4b')][_0x2d2d('0x52')]({'where':{'id':_0x51cc97[_0x2d2d('0x50')]['id']}})['then'](function(_0x4ff0d6){return db[_0x2d2d('0x70')][_0x2d2d('0x84')](function(_0x32485f){return _0x4ff0d6['removeTeams'](_0x51cc97['query']['ids'],{'transaction':_0x32485f})['then'](function(){if(!_['isEmpty'](_0x260dd4)){return _0x4ff0d6[_0x2d2d('0x85')](_0x260dd4,{'transaction':_0x32485f});}})['then'](function(){_0x260dd4['forEach'](function(_0x5353a8){socket[_0x2d2d('0x72')](_0x2d2d('0x86'),{'UserId':_0x5353a8,'WhatsappQueueId':_0x4ff0d6['id']});});});});});});})[_0x2d2d('0x2a')](respondWithStatusCode(_0x1e4a0e,null))[_0x2d2d('0x4e')](handleError(_0x1e4a0e,null));};exports['addAgents']=function(_0x13b52f,_0x199db3,_0xf84ee6){return db[_0x2d2d('0x4b')]['find']({'where':{'id':_0x13b52f[_0x2d2d('0x50')]['id']}})[_0x2d2d('0x2a')](handleEntityNotFound(_0x199db3,null))[_0x2d2d('0x2a')](function(_0x4287ff){if(_0x4287ff){return _0x4287ff[_0x2d2d('0x87')](_0x13b52f[_0x2d2d('0x54')][_0x2d2d('0x6b')],_['omit'](_0x13b52f[_0x2d2d('0x54')],['ids','id'])||{})[_0x2d2d('0x88')](function(_0x1a3e55){for(var _0x42808c=0x0;_0x42808c<_0x13b52f[_0x2d2d('0x54')][_0x2d2d('0x6b')]['length'];_0x42808c+=0x1){socket[_0x2d2d('0x72')](_0x2d2d('0x73'),{'UserId':Number(_0x13b52f[_0x2d2d('0x54')]['ids'][_0x42808c]),'WhatsappQueueId':Number(_0x13b52f['params']['id'])});}return _0x1a3e55;});}})[_0x2d2d('0x2a')](respondWithResult(_0x199db3,null))[_0x2d2d('0x4e')](handleError(_0x199db3,null));};exports[_0x2d2d('0x85')]=function(_0x4cc1c3,_0xd35766,_0x192f33){return db[_0x2d2d('0x4b')][_0x2d2d('0x52')]({'where':{'id':_0x4cc1c3['params']['id']}})[_0x2d2d('0x2a')](handleEntityNotFound(_0xd35766,null))[_0x2d2d('0x2a')](function(_0x42d37e){if(_0x42d37e){return _0x42d37e['removeAgents'](_0x4cc1c3[_0x2d2d('0x39')]['ids'])[_0x2d2d('0x2a')](function(){if(_[_0x2d2d('0x89')](_0x4cc1c3[_0x2d2d('0x39')][_0x2d2d('0x6b')])){for(var _0x37dc9e=0x0;_0x37dc9e<_0x4cc1c3['query'][_0x2d2d('0x6b')][_0x2d2d('0x40')];_0x37dc9e+=0x1){socket['emit'](_0x2d2d('0x86'),{'UserId':Number(_0x4cc1c3[_0x2d2d('0x39')][_0x2d2d('0x6b')][_0x37dc9e]),'WhatsappQueueId':Number(_0x4cc1c3[_0x2d2d('0x50')]['id'])});}}else{socket[_0x2d2d('0x72')](_0x2d2d('0x86'),{'UserId':Number(_0x4cc1c3[_0x2d2d('0x39')][_0x2d2d('0x6b')]),'WhatsappQueueId':Number(_0x4cc1c3['params']['id'])});}});}})[_0x2d2d('0x2a')](respondWithStatusCode(_0xd35766,null))['catch'](handleError(_0xd35766,null));};exports['getAgents']=function(_0x5f3639,_0x3ef295,_0x5310fe){var _0x53b696={};var _0x2292ae={};var _0x1fa559;var _0x517e4a;return db[_0x2d2d('0x4b')][_0x2d2d('0x68')]({'where':{'id':_0x5f3639[_0x2d2d('0x50')]['id']}})[_0x2d2d('0x2a')](handleEntityNotFound(_0x3ef295,null))[_0x2d2d('0x2a')](function(_0x78eca3){if(_0x78eca3){_0x1fa559=_0x78eca3;_0x2292ae[_0x2d2d('0x3d')]=_[_0x2d2d('0x3a')](db[_0x2d2d('0x5d')]['rawAttributes']);_0x2292ae[_0x2d2d('0x39')]=_[_0x2d2d('0x3a')](_0x5f3639['query']);_0x2292ae['filters']=_['intersection'](_0x2292ae[_0x2d2d('0x3d')],_0x2292ae['query']);_0x53b696[_0x2d2d('0x3e')]=_[_0x2d2d('0x3c')](_0x2292ae[_0x2d2d('0x3d')],qs[_0x2d2d('0x3f')](_0x5f3639[_0x2d2d('0x39')]['fields']));_0x53b696[_0x2d2d('0x3e')]=_0x53b696[_0x2d2d('0x3e')][_0x2d2d('0x40')]?_0x53b696['attributes']:_0x2292ae[_0x2d2d('0x3d')];_0x53b696[_0x2d2d('0x43')]=qs['sort'](_0x5f3639['query'][_0x2d2d('0x44')]);_0x53b696['where']=qs['filters'](_[_0x2d2d('0x46')](_0x5f3639[_0x2d2d('0x39')],_0x2292ae[_0x2d2d('0x3b')]));if(_0x5f3639[_0x2d2d('0x39')][_0x2d2d('0x47')]){_0x53b696[_0x2d2d('0x45')]=_[_0x2d2d('0x49')](_0x53b696[_0x2d2d('0x45')],{'$or':_[_0x2d2d('0x38')](_0x53b696[_0x2d2d('0x3e')],function(_0x46b68b){var _0x14fc20={};_0x14fc20[_0x46b68b]={'$like':'%'+_0x5f3639[_0x2d2d('0x39')][_0x2d2d('0x47')]+'%'};return _0x14fc20;})});}_0x53b696=_[_0x2d2d('0x49')]({},_0x53b696,_0x5f3639[_0x2d2d('0x4a')]);return _0x1fa559[_0x2d2d('0x8a')](_0x53b696);}})[_0x2d2d('0x2a')](function(_0x3b95b1){if(_0x3b95b1){_0x517e4a=_0x3b95b1['length'];if(!_0x5f3639['query']['hasOwnProperty'](_0x2d2d('0x42'))){_0x53b696[_0x2d2d('0x25')]=qs['limit'](_0x5f3639['query']['limit']);_0x53b696[_0x2d2d('0x22')]=qs[_0x2d2d('0x22')](_0x5f3639[_0x2d2d('0x39')][_0x2d2d('0x22')]);}return _0x1fa559[_0x2d2d('0x8a')](_0x53b696);}})[_0x2d2d('0x2a')](function(_0x5f4794){if(_0x5f4794){return _0x5f4794?{'count':_0x517e4a,'rows':_0x5f4794}:null;}})[_0x2d2d('0x2a')](respondWithResult(_0x3ef295,null))[_0x2d2d('0x4e')](handleError(_0x3ef295,null));};
\ No newline at end of file
+var _0xbee0=['offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','map','WhatsappQueue','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserWhatsappQueue','order','WhatsappQueueId','User','UserId','agent','whatsappPause','updatedAt','createdAt','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','all','union','compact','isEmpty','emit','addAgents','spread','removeAgents','isArray','userWhatsappQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json'];(function(_0x1421d5,_0x43f1e3){var _0x497751=function(_0x4c51b3){while(--_0x4c51b3){_0x1421d5['push'](_0x1421d5['shift']());}};_0x497751(++_0x43f1e3);}(_0xbee0,0xef));var _0x0bee=function(_0x5a26bc,_0x57e701){_0x5a26bc=_0x5a26bc-0x0;var _0x326250=_0xbee0[_0x5a26bc];return _0x326250;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0bee('0x0'));var zipdir=require(_0x0bee('0x1'));var jsonpatch=require(_0x0bee('0x2'));var rp=require(_0x0bee('0x3'));var moment=require(_0x0bee('0x4'));var BPromise=require(_0x0bee('0x5'));var Mustache=require(_0x0bee('0x6'));var util=require(_0x0bee('0x7'));var path=require('path');var sox=require(_0x0bee('0x8'));var csv=require(_0x0bee('0x9'));var ejs=require(_0x0bee('0xa'));var fs=require('fs');var fs_extra=require(_0x0bee('0xb'));var _=require(_0x0bee('0xc'));var squel=require('squel');var crypto=require(_0x0bee('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0bee('0xe'));var Papa=require(_0x0bee('0xf'));var Redis=require(_0x0bee('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0bee('0x11'));var as=require(_0x0bee('0x12'));var hardwareService=require(_0x0bee('0x13'));var logger=require('../../config/logger')(_0x0bee('0x14'));var utils=require(_0x0bee('0x15'));var config=require(_0x0bee('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0bee('0x17'))['db'];config[_0x0bee('0x18')]=_['defaults'](config[_0x0bee('0x18')],{'host':_0x0bee('0x19'),'port':0x18eb});var socket=require(_0x0bee('0x1a'))(new Redis(config['redis']));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0xcec8b5,_0x3872f9){_0x3872f9=_0x3872f9||0xcc;return function(_0x4ea1a1){if(_0x4ea1a1){return _0xcec8b5[_0x0bee('0x1b')](_0x3872f9);}return _0xcec8b5[_0x0bee('0x1c')](_0x3872f9)[_0x0bee('0x1d')]();};}function respondWithResult(_0x15d0ab,_0x5494f0){_0x5494f0=_0x5494f0||0xc8;return function(_0x4ee3f5){if(_0x4ee3f5){return _0x15d0ab[_0x0bee('0x1c')](_0x5494f0)[_0x0bee('0x1e')](_0x4ee3f5);}};}function respondWithFilteredResult(_0x4c88be,_0x1136ba){return function(_0x3d14d8){if(_0x3d14d8){var _0x59bc28=typeof _0x1136ba[_0x0bee('0x1f')]===_0x0bee('0x20')&&typeof _0x1136ba['limit']==='undefined';var _0x4129a8=_0x3d14d8['count'];var _0xe30acd=_0x59bc28?0x0:_0x1136ba[_0x0bee('0x1f')];var _0x6f2175=_0x59bc28?_0x3d14d8['count']:_0x1136ba[_0x0bee('0x1f')]+_0x1136ba[_0x0bee('0x21')];var _0x109cf5;if(_0x6f2175>=_0x4129a8){_0x6f2175=_0x4129a8;_0x109cf5=0xc8;}else{_0x109cf5=0xce;}_0x4c88be[_0x0bee('0x1c')](_0x109cf5);return _0x4c88be[_0x0bee('0x22')](_0x0bee('0x23'),_0xe30acd+'-'+_0x6f2175+'/'+_0x4129a8)['json'](_0x3d14d8);}return null;};}function patchUpdates(_0x10e7da){return function(_0x18defa){try{jsonpatch[_0x0bee('0x24')](_0x18defa,_0x10e7da,!![]);}catch(_0x2072f2){return BPromise[_0x0bee('0x25')](_0x2072f2);}return _0x18defa[_0x0bee('0x26')]();};}function saveUpdates(_0x2ef9ca,_0x22cee6){return function(_0x30c8d2){if(_0x30c8d2){return _0x30c8d2['update'](_0x2ef9ca)[_0x0bee('0x27')](function(_0x3e2955){return _0x3e2955;});}return null;};}function removeEntity(_0x238492,_0x267f6f){return function(_0x41b5e2){if(_0x41b5e2){return _0x41b5e2[_0x0bee('0x28')]()['then'](function(){var _0x4c8d13=_0x41b5e2[_0x0bee('0x29')]({'plain':!![]});var _0x1d2739=_0x0bee('0x2a');return db[_0x0bee('0x2b')][_0x0bee('0x28')]({'where':{'type':_0x1d2739,'resourceId':_0x4c8d13['id']}})[_0x0bee('0x27')](function(){return _0x41b5e2;});})[_0x0bee('0x27')](function(){_0x238492[_0x0bee('0x1c')](0xcc)[_0x0bee('0x1d')]();});}};}function handleEntityNotFound(_0x11baa0,_0x4d2736){return function(_0x16a0c7){if(!_0x16a0c7){_0x11baa0[_0x0bee('0x1b')](0x194);}return _0x16a0c7;};}function handleError(_0x3d54b8,_0x1355cc){_0x1355cc=_0x1355cc||0x1f4;return function(_0x39a369){logger[_0x0bee('0x2c')](_0x39a369[_0x0bee('0x2d')]);if(_0x39a369['name']){delete _0x39a369[_0x0bee('0x2e')];}_0x3d54b8['status'](_0x1355cc)[_0x0bee('0x2f')](_0x39a369);};}exports['index']=function(_0x311286,_0x4be105){var _0x37a0a4={},_0x2eab33={},_0x11b3f2={'count':0x0,'rows':[]};var _0x11043c=_[_0x0bee('0x30')](db[_0x0bee('0x31')][_0x0bee('0x32')],function(_0x119521){return{'name':_0x119521['fieldName'],'type':_0x119521[_0x0bee('0x33')]['key']};});_0x2eab33[_0x0bee('0x34')]=_[_0x0bee('0x30')](_0x11043c,_0x0bee('0x2e'));_0x2eab33['query']=_[_0x0bee('0x35')](_0x311286[_0x0bee('0x36')]);_0x2eab33[_0x0bee('0x37')]=_[_0x0bee('0x38')](_0x2eab33[_0x0bee('0x34')],_0x2eab33[_0x0bee('0x36')]);_0x37a0a4[_0x0bee('0x39')]=_[_0x0bee('0x38')](_0x2eab33[_0x0bee('0x34')],qs[_0x0bee('0x3a')](_0x311286[_0x0bee('0x36')][_0x0bee('0x3a')]));_0x37a0a4['attributes']=_0x37a0a4['attributes'][_0x0bee('0x3b')]?_0x37a0a4[_0x0bee('0x39')]:_0x2eab33['model'];if(!_0x311286[_0x0bee('0x36')][_0x0bee('0x3c')](_0x0bee('0x3d'))){_0x37a0a4[_0x0bee('0x21')]=qs['limit'](_0x311286[_0x0bee('0x36')][_0x0bee('0x21')]);_0x37a0a4[_0x0bee('0x1f')]=qs[_0x0bee('0x1f')](_0x311286['query'][_0x0bee('0x1f')]);}_0x37a0a4['order']=qs[_0x0bee('0x3e')](_0x311286[_0x0bee('0x36')]['sort']);_0x37a0a4[_0x0bee('0x3f')]=qs['filters'](_[_0x0bee('0x40')](_0x311286[_0x0bee('0x36')],_0x2eab33[_0x0bee('0x37')]),_0x11043c);if(_0x311286['query'][_0x0bee('0x41')]){_0x37a0a4[_0x0bee('0x3f')]=_[_0x0bee('0x42')](_0x37a0a4['where'],{'$or':_[_0x0bee('0x30')](_0x11043c,function(_0x338455){if(_0x338455[_0x0bee('0x33')]!=='VIRTUAL'){var _0x4645f7={};_0x4645f7[_0x338455[_0x0bee('0x2e')]]={'$like':'%'+_0x311286[_0x0bee('0x36')][_0x0bee('0x41')]+'%'};return _0x4645f7;}})});}_0x37a0a4=_['merge']({},_0x37a0a4,_0x311286[_0x0bee('0x43')]);var _0x16509f={'where':_0x37a0a4[_0x0bee('0x3f')]};return db[_0x0bee('0x31')][_0x0bee('0x44')](_0x16509f)[_0x0bee('0x27')](function(_0x56d751){_0x11b3f2['count']=_0x56d751;if(_0x311286[_0x0bee('0x36')][_0x0bee('0x45')]){_0x37a0a4['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0x0bee('0x46')](_0x37a0a4);})[_0x0bee('0x27')](function(_0xcc5c44){_0x11b3f2[_0x0bee('0x47')]=_0xcc5c44;return _0x11b3f2;})[_0x0bee('0x27')](respondWithFilteredResult(_0x4be105,_0x37a0a4))[_0x0bee('0x48')](handleError(_0x4be105,null));};exports[_0x0bee('0x49')]=function(_0x38c1df,_0x5dcd5a){var _0x27dc64={'raw':!![],'where':{'id':_0x38c1df[_0x0bee('0x4a')]['id']}},_0x39f3af={};_0x39f3af[_0x0bee('0x34')]=_['keys'](db['WhatsappQueue'][_0x0bee('0x32')]);_0x39f3af['query']=_['keys'](_0x38c1df['query']);_0x39f3af[_0x0bee('0x37')]=_[_0x0bee('0x38')](_0x39f3af[_0x0bee('0x34')],_0x39f3af[_0x0bee('0x36')]);_0x27dc64[_0x0bee('0x39')]=_[_0x0bee('0x38')](_0x39f3af['model'],qs['fields'](_0x38c1df[_0x0bee('0x36')][_0x0bee('0x3a')]));_0x27dc64[_0x0bee('0x39')]=_0x27dc64[_0x0bee('0x39')][_0x0bee('0x3b')]?_0x27dc64[_0x0bee('0x39')]:_0x39f3af[_0x0bee('0x34')];if(_0x38c1df['query']['includeAll']){_0x27dc64['include']=[{'all':!![]}];}_0x27dc64=_['merge']({},_0x27dc64,_0x38c1df[_0x0bee('0x43')]);return db[_0x0bee('0x31')][_0x0bee('0x4b')](_0x27dc64)[_0x0bee('0x27')](handleEntityNotFound(_0x5dcd5a,null))[_0x0bee('0x27')](respondWithResult(_0x5dcd5a,null))[_0x0bee('0x48')](handleError(_0x5dcd5a,null));};exports[_0x0bee('0x4c')]=function(_0x30aa37,_0x52d1f6){return db[_0x0bee('0x31')][_0x0bee('0x4c')](_0x30aa37[_0x0bee('0x4d')],{})[_0x0bee('0x27')](function(_0x1291b2){var _0x498be1=_0x30aa37[_0x0bee('0x4e')][_0x0bee('0x29')]({'plain':!![]});if(!_0x498be1)throw new Error(_0x0bee('0x4f'));if(_0x498be1['role']===_0x0bee('0x4e')){var _0x4c1bc7=_0x1291b2[_0x0bee('0x29')]({'plain':!![]});var _0x37869f=_0x0bee('0x2a');return db[_0x0bee('0x50')][_0x0bee('0x4b')]({'where':{'name':_0x37869f,'userProfileId':_0x498be1[_0x0bee('0x51')]},'raw':!![]})[_0x0bee('0x27')](function(_0x223f70){if(_0x223f70&&_0x223f70['autoAssociation']===0x0){return db[_0x0bee('0x2b')][_0x0bee('0x4c')]({'name':_0x4c1bc7[_0x0bee('0x2e')],'resourceId':_0x4c1bc7['id'],'type':_0x223f70[_0x0bee('0x2e')],'sectionId':_0x223f70['id']},{})[_0x0bee('0x27')](function(){return _0x1291b2;});}else{return _0x1291b2;}})[_0x0bee('0x48')](function(_0x483087){logger[_0x0bee('0x2c')](_0x0bee('0x52'),_0x483087);throw _0x483087;});}return _0x1291b2;})[_0x0bee('0x27')](respondWithResult(_0x52d1f6,0xc9))[_0x0bee('0x48')](handleError(_0x52d1f6,null));};exports[_0x0bee('0x53')]=function(_0x2bb870,_0x418616){if(_0x2bb870[_0x0bee('0x4d')]['id']){delete _0x2bb870['body']['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x2bb870[_0x0bee('0x4a')]['id']}})[_0x0bee('0x27')](handleEntityNotFound(_0x418616,null))[_0x0bee('0x27')](saveUpdates(_0x2bb870['body'],null))[_0x0bee('0x27')](respondWithResult(_0x418616,null))['catch'](handleError(_0x418616,null));};exports[_0x0bee('0x28')]=function(_0x3e177a,_0x106b28){return db[_0x0bee('0x31')][_0x0bee('0x4b')]({'where':{'id':_0x3e177a[_0x0bee('0x4a')]['id']}})['then'](handleEntityNotFound(_0x106b28,null))['then'](removeEntity(_0x106b28,null))['catch'](handleError(_0x106b28,null));};exports[_0x0bee('0x54')]=function(_0x51da97,_0xb4acf9){return db[_0x0bee('0x31')][_0x0bee('0x54')]()['then'](respondWithResult(_0xb4acf9,null))['catch'](handleError(_0xb4acf9,null));};exports[_0x0bee('0x55')]=function(_0x469f52,_0x52498b,_0x1c84a4){var _0x51ddf8={'raw':!![],'where':{}},_0x12a01a={},_0x3f43a2;return db['WhatsappQueue'][_0x0bee('0x56')]({'where':{'id':_0x469f52[_0x0bee('0x4a')]['id']}})[_0x0bee('0x27')](handleEntityNotFound(_0x52498b,null))['then'](function(_0x3ed1e7){if(_0x3ed1e7){_0x3f43a2=_0x3ed1e7[_0x0bee('0x29')]({'plain':!![]});_0x12a01a[_0x0bee('0x34')]=_[_0x0bee('0x35')](db[_0x0bee('0x57')][_0x0bee('0x32')]);_0x12a01a[_0x0bee('0x36')]=_[_0x0bee('0x35')](_0x469f52[_0x0bee('0x36')]);_0x12a01a[_0x0bee('0x37')]=_['intersection'](_0x12a01a[_0x0bee('0x34')],_0x12a01a[_0x0bee('0x36')]);_0x51ddf8[_0x0bee('0x39')]=_[_0x0bee('0x38')](_0x12a01a[_0x0bee('0x34')],qs[_0x0bee('0x3a')](_0x469f52[_0x0bee('0x36')][_0x0bee('0x3a')]));_0x51ddf8['attributes']=_0x51ddf8[_0x0bee('0x39')]['length']?_0x51ddf8[_0x0bee('0x39')]:_0x12a01a[_0x0bee('0x34')];if(!_0x469f52['query'][_0x0bee('0x3c')](_0x0bee('0x3d'))){_0x51ddf8[_0x0bee('0x21')]=qs[_0x0bee('0x21')](_0x469f52['query'][_0x0bee('0x21')]);_0x51ddf8['offset']=qs[_0x0bee('0x1f')](_0x469f52[_0x0bee('0x36')][_0x0bee('0x1f')]);}_0x51ddf8[_0x0bee('0x58')]=qs[_0x0bee('0x3e')](_0x469f52[_0x0bee('0x36')][_0x0bee('0x3e')]);_0x51ddf8['where']=qs[_0x0bee('0x37')](_['pick'](_0x469f52['query'],_0x12a01a[_0x0bee('0x37')]));_0x51ddf8[_0x0bee('0x3f')][_0x0bee('0x59')]=_0x3ed1e7['id'];if(_0x469f52[_0x0bee('0x36')]['filter']){_0x51ddf8[_0x0bee('0x3f')]=_[_0x0bee('0x42')](_0x51ddf8['where'],{'$or':_[_0x0bee('0x30')](_0x51ddf8[_0x0bee('0x39')],function(_0x383e35){var _0x21ee14={};_0x21ee14[_0x383e35]={'$like':'%'+_0x469f52[_0x0bee('0x36')][_0x0bee('0x41')]+'%'};return _0x21ee14;})});}_0x51ddf8=_['merge']({},_0x51ddf8,_0x469f52[_0x0bee('0x43')]);return db[_0x0bee('0x57')][_0x0bee('0x46')](_0x51ddf8);}})[_0x0bee('0x27')](function(_0x113833){if(_0x113833){return db[_0x0bee('0x5a')]['findAndCountAll']({'where':{'id':_[_0x0bee('0x30')](_0x113833,_0x0bee('0x5b')),'role':_0x0bee('0x5c')},'attributes':['id',_0x0bee('0x2e'),_0x0bee('0x5d'),_0x0bee('0x5e'),_0x0bee('0x5f')]});}})['then'](function(_0x5a8c35){if(_0x5a8c35){return{'count':_0x5a8c35[_0x0bee('0x44')],'rows':_[_0x0bee('0x30')](_0x5a8c35[_0x0bee('0x47')],function(_0x526947){return{'membername':_0x526947[_0x0bee('0x2e')],'UserId':_0x526947['id'],'queue_name':_0x3f43a2[_0x0bee('0x2e')],'WhatsappQueueId':_0x3f43a2['id'],'interface':util['format'](_0x0bee('0x60'),_0x0bee('0x61'),_0x526947['name']),'penalty':0x0,'paused':_0x526947['whatsappPause'],'createdAt':_0x526947[_0x0bee('0x5f')],'updatedAt':_0x526947['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x52498b,_0x51ddf8))['catch'](handleError(_0x52498b,null));};exports[_0x0bee('0x62')]=function(_0x470765,_0x220126,_0x2544df){var _0x4a3aa0={};var _0x3bfe98={};var _0x3ba842;var _0x2f4cb8;return db[_0x0bee('0x31')]['findOne']({'where':{'id':_0x470765[_0x0bee('0x4a')]['id']}})['then'](handleEntityNotFound(_0x220126,null))[_0x0bee('0x27')](function(_0x27967f){if(_0x27967f){_0x3ba842=_0x27967f;_0x3bfe98[_0x0bee('0x34')]=_[_0x0bee('0x35')](db['Team']['rawAttributes']);_0x3bfe98[_0x0bee('0x36')]=_[_0x0bee('0x35')](_0x470765[_0x0bee('0x36')]);_0x3bfe98['filters']=_[_0x0bee('0x38')](_0x3bfe98[_0x0bee('0x34')],_0x3bfe98[_0x0bee('0x36')]);_0x4a3aa0[_0x0bee('0x39')]=_['intersection'](_0x3bfe98[_0x0bee('0x34')],qs[_0x0bee('0x3a')](_0x470765[_0x0bee('0x36')][_0x0bee('0x3a')]));_0x4a3aa0[_0x0bee('0x39')]=_0x4a3aa0[_0x0bee('0x39')][_0x0bee('0x3b')]?_0x4a3aa0[_0x0bee('0x39')]:_0x3bfe98[_0x0bee('0x34')];_0x4a3aa0['order']=qs[_0x0bee('0x3e')](_0x470765[_0x0bee('0x36')][_0x0bee('0x3e')]);_0x4a3aa0[_0x0bee('0x3f')]=qs[_0x0bee('0x37')](_[_0x0bee('0x40')](_0x470765[_0x0bee('0x36')],_0x3bfe98['filters']));if(_0x470765[_0x0bee('0x36')][_0x0bee('0x41')]){_0x4a3aa0[_0x0bee('0x3f')]=_[_0x0bee('0x42')](_0x4a3aa0[_0x0bee('0x3f')],{'$or':_[_0x0bee('0x30')](_0x4a3aa0[_0x0bee('0x39')],function(_0x496ea0){var _0x20d15b={};_0x20d15b[_0x496ea0]={'$like':'%'+_0x470765['query'][_0x0bee('0x41')]+'%'};return _0x20d15b;})});}_0x4a3aa0=_[_0x0bee('0x42')]({},_0x4a3aa0,_0x470765[_0x0bee('0x43')]);return _0x3ba842[_0x0bee('0x62')](_0x4a3aa0);}})[_0x0bee('0x27')](function(_0xdd0b46){if(_0xdd0b46){_0x2f4cb8=_0xdd0b46[_0x0bee('0x3b')];if(!_0x470765[_0x0bee('0x36')]['hasOwnProperty'](_0x0bee('0x3d'))){_0x4a3aa0[_0x0bee('0x21')]=qs[_0x0bee('0x21')](_0x470765[_0x0bee('0x36')][_0x0bee('0x21')]);_0x4a3aa0[_0x0bee('0x1f')]=qs[_0x0bee('0x1f')](_0x470765['query']['offset']);}return _0x3ba842[_0x0bee('0x62')](_0x4a3aa0);}})[_0x0bee('0x27')](function(_0x255d5f){if(_0x255d5f){return _0x255d5f?{'count':_0x2f4cb8,'rows':_0x255d5f}:null;}})[_0x0bee('0x27')](respondWithResult(_0x220126,null))['catch'](handleError(_0x220126,null));};exports[_0x0bee('0x63')]=function(_0x2cb7fe,_0x5f357c,_0x1de2d1){var _0x295308=_0x2cb7fe[_0x0bee('0x4d')][_0x0bee('0x64')];return db[_0x0bee('0x65')]['findAll']({'where':{'id':_0x295308},'attributes':['id'],'include':[{'model':db[_0x0bee('0x5a')],'as':_0x0bee('0x66'),'attributes':['id',_0x0bee('0x2e'),_0x0bee('0x67'),_0x0bee('0x68'),_0x0bee('0x69')],'raw':!![]}]})['then'](function(_0x5ba1c6){if(_0x5ba1c6){var _0x281dd1=_[_0x0bee('0x6a')](_0x5ba1c6,function(_0x4d46cc){var _0x2ee79f=_0x4d46cc[_0x0bee('0x29')]({'plain':!![]});return _0x2ee79f[_0x0bee('0x66')];});return db[_0x0bee('0x31')]['find']({'where':{'id':_0x2cb7fe[_0x0bee('0x4a')]['id']}})['then'](function(_0x23cfa4){return db[_0x0bee('0x6b')][_0x0bee('0x6c')](function(_0x2c2f0b){return _0x23cfa4[_0x0bee('0x63')](_0x295308,{'transaction':_0x2c2f0b})[_0x0bee('0x27')](function(){return BPromise['each'](_0x281dd1,function(_0x591c02){return db[_0x0bee('0x57')][_0x0bee('0x6d')]({'where':{'UserId':_0x591c02['id'],'WhatsappQueueId':_0x2cb7fe[_0x0bee('0x4a')]['id']},'transaction':_0x2c2f0b});});})[_0x0bee('0x27')](function(){_0x281dd1[_0x0bee('0x6e')](function(_0x53cd33){socket['emit'](_0x0bee('0x6f'),{'UserId':_0x53cd33['id'],'WhatsappQueueId':_0x23cfa4['id']});});});});});}})[_0x0bee('0x27')](respondWithStatusCode(_0x5f357c,null))[_0x0bee('0x48')](handleError(_0x5f357c,null));};exports[_0x0bee('0x70')]=function(_0x4c82ce,_0x456f92,_0xcb3a09){return db['Team']['findAll']({'where':{'id':_0x4c82ce[_0x0bee('0x36')][_0x0bee('0x64')]},'attributes':['id'],'include':[{'model':db[_0x0bee('0x5a')],'as':_0x0bee('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x456f92,null))[_0x0bee('0x27')](function(_0x13b52a){var _0x2857ec=_['map'](_0x13b52a,'id');var _0x167a75=[];var _0x3f14a5=[];var _0x1c3f11=squel['select']();_0x1c3f11[_0x0bee('0x71')]('tq.TeamId')[_0x0bee('0x72')]('team_has_whatsapp_queues','tq')[_0x0bee('0x73')](_0x0bee('0x74'),'ut',_0x0bee('0x75'))['where'](_0x0bee('0x76'),_0x4c82ce[_0x0bee('0x4a')]['id']);for(var _0x288ee1=0x0;_0x288ee1<_0x13b52a[_0x0bee('0x3b')];_0x288ee1+=0x1){let _0x57b286=_0x13b52a[_0x288ee1];for(var _0x51e96b=0x0;_0x51e96b<_0x57b286['Agents'][_0x0bee('0x3b')];_0x51e96b+=0x1){let _0x1d9614=_0x57b286[_0x0bee('0x66')][_0x51e96b];var _0x534ec7=_0x1c3f11[_0x0bee('0x77')]();_0x534ec7[_0x0bee('0x3f')](_0x0bee('0x78'),_0x1d9614['id']);_0x3f14a5['push'](db[_0x0bee('0x6b')][_0x0bee('0x36')](_0x534ec7['toString'](),{'type':db[_0x0bee('0x6b')][_0x0bee('0x79')]['SELECT']})[_0x0bee('0x27')](function(_0x107aa6){if(_0x107aa6[_0x0bee('0x3b')]===0x1){return _0x1d9614['id'];}else{var _0x338ddf=_[_0x0bee('0x7a')](_['map'](_0x107aa6,_0x0bee('0x7b')),function(_0x20b799){return _['includes'](_0x2857ec,_0x20b799);});if(_0x338ddf){return _0x1d9614['id'];}}}));}}return BPromise[_0x0bee('0x7c')](_0x3f14a5)[_0x0bee('0x27')](function(_0x54168a){_0x167a75=_(_0x167a75)[_0x0bee('0x7d')](_0x54168a)[_0x0bee('0x7e')]()['value']();return db[_0x0bee('0x31')]['find']({'where':{'id':_0x4c82ce[_0x0bee('0x4a')]['id']}})[_0x0bee('0x27')](function(_0x2453d6){return db['sequelize']['transaction'](function(_0x2bd57a){return _0x2453d6[_0x0bee('0x70')](_0x4c82ce['query'][_0x0bee('0x64')],{'transaction':_0x2bd57a})['then'](function(){if(!_[_0x0bee('0x7f')](_0x167a75)){return _0x2453d6['removeAgents'](_0x167a75,{'transaction':_0x2bd57a});}})['then'](function(){_0x167a75[_0x0bee('0x6e')](function(_0x2c5f40){socket[_0x0bee('0x80')]('userWhatsappQueue:remove',{'UserId':_0x2c5f40,'WhatsappQueueId':_0x2453d6['id']});});});});});});})[_0x0bee('0x27')](respondWithStatusCode(_0x456f92,null))['catch'](handleError(_0x456f92,null));};exports[_0x0bee('0x81')]=function(_0x107601,_0x43984e,_0x138900){return db[_0x0bee('0x31')][_0x0bee('0x4b')]({'where':{'id':_0x107601[_0x0bee('0x4a')]['id']}})[_0x0bee('0x27')](handleEntityNotFound(_0x43984e,null))[_0x0bee('0x27')](function(_0x5a0cce){if(_0x5a0cce){return _0x5a0cce[_0x0bee('0x81')](_0x107601[_0x0bee('0x4d')][_0x0bee('0x64')],_['omit'](_0x107601[_0x0bee('0x4d')],[_0x0bee('0x64'),'id'])||{})[_0x0bee('0x82')](function(_0x1aa9c5){for(var _0x4c8154=0x0;_0x4c8154<_0x107601['body'][_0x0bee('0x64')][_0x0bee('0x3b')];_0x4c8154+=0x1){socket[_0x0bee('0x80')](_0x0bee('0x6f'),{'UserId':Number(_0x107601[_0x0bee('0x4d')]['ids'][_0x4c8154]),'WhatsappQueueId':Number(_0x107601[_0x0bee('0x4a')]['id'])});}return _0x1aa9c5;});}})[_0x0bee('0x27')](respondWithResult(_0x43984e,null))['catch'](handleError(_0x43984e,null));};exports[_0x0bee('0x83')]=function(_0x2e05ab,_0x48b854,_0x1980fd){return db[_0x0bee('0x31')][_0x0bee('0x4b')]({'where':{'id':_0x2e05ab[_0x0bee('0x4a')]['id']}})['then'](handleEntityNotFound(_0x48b854,null))[_0x0bee('0x27')](function(_0x54da33){if(_0x54da33){return _0x54da33[_0x0bee('0x83')](_0x2e05ab[_0x0bee('0x36')]['ids'])['then'](function(){if(_[_0x0bee('0x84')](_0x2e05ab[_0x0bee('0x36')]['ids'])){for(var _0x3ee868=0x0;_0x3ee868<_0x2e05ab[_0x0bee('0x36')]['ids']['length'];_0x3ee868+=0x1){socket[_0x0bee('0x80')](_0x0bee('0x85'),{'UserId':Number(_0x2e05ab[_0x0bee('0x36')][_0x0bee('0x64')][_0x3ee868]),'WhatsappQueueId':Number(_0x2e05ab[_0x0bee('0x4a')]['id'])});}}else{socket['emit'](_0x0bee('0x85'),{'UserId':Number(_0x2e05ab[_0x0bee('0x36')]['ids']),'WhatsappQueueId':Number(_0x2e05ab[_0x0bee('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x48b854,null))['catch'](handleError(_0x48b854,null));};exports[_0x0bee('0x86')]=function(_0x377557,_0x1e6fa2,_0x4a6975){var _0x286b7b={};var _0x1af5f9={};var _0x3e2593;var _0x427286;return db[_0x0bee('0x31')][_0x0bee('0x56')]({'where':{'id':_0x377557[_0x0bee('0x4a')]['id']}})[_0x0bee('0x27')](handleEntityNotFound(_0x1e6fa2,null))[_0x0bee('0x27')](function(_0x5ad26a){if(_0x5ad26a){_0x3e2593=_0x5ad26a;_0x1af5f9[_0x0bee('0x34')]=_[_0x0bee('0x35')](db[_0x0bee('0x5a')][_0x0bee('0x32')]);_0x1af5f9[_0x0bee('0x36')]=_['keys'](_0x377557[_0x0bee('0x36')]);_0x1af5f9['filters']=_[_0x0bee('0x38')](_0x1af5f9[_0x0bee('0x34')],_0x1af5f9[_0x0bee('0x36')]);_0x286b7b[_0x0bee('0x39')]=_[_0x0bee('0x38')](_0x1af5f9[_0x0bee('0x34')],qs['fields'](_0x377557[_0x0bee('0x36')][_0x0bee('0x3a')]));_0x286b7b[_0x0bee('0x39')]=_0x286b7b['attributes'][_0x0bee('0x3b')]?_0x286b7b[_0x0bee('0x39')]:_0x1af5f9[_0x0bee('0x34')];_0x286b7b[_0x0bee('0x58')]=qs['sort'](_0x377557[_0x0bee('0x36')][_0x0bee('0x3e')]);_0x286b7b[_0x0bee('0x3f')]=qs[_0x0bee('0x37')](_['pick'](_0x377557[_0x0bee('0x36')],_0x1af5f9[_0x0bee('0x37')]));if(_0x377557[_0x0bee('0x36')][_0x0bee('0x41')]){_0x286b7b[_0x0bee('0x3f')]=_[_0x0bee('0x42')](_0x286b7b['where'],{'$or':_[_0x0bee('0x30')](_0x286b7b[_0x0bee('0x39')],function(_0xd556f){var _0x298a15={};_0x298a15[_0xd556f]={'$like':'%'+_0x377557[_0x0bee('0x36')][_0x0bee('0x41')]+'%'};return _0x298a15;})});}_0x286b7b=_[_0x0bee('0x42')]({},_0x286b7b,_0x377557['options']);return _0x3e2593['getAgents'](_0x286b7b);}})[_0x0bee('0x27')](function(_0x4dca52){if(_0x4dca52){_0x427286=_0x4dca52[_0x0bee('0x3b')];if(!_0x377557['query'][_0x0bee('0x3c')]('nolimit')){_0x286b7b['limit']=qs[_0x0bee('0x21')](_0x377557[_0x0bee('0x36')]['limit']);_0x286b7b[_0x0bee('0x1f')]=qs[_0x0bee('0x1f')](_0x377557['query'][_0x0bee('0x1f')]);}return _0x3e2593[_0x0bee('0x86')](_0x286b7b);}})[_0x0bee('0x27')](function(_0x22d268){if(_0x22d268){return _0x22d268?{'count':_0x427286,'rows':_0x22d268}:null;}})[_0x0bee('0x27')](respondWithResult(_0x1e6fa2,null))[_0x0bee('0x48')](handleError(_0x1e6fa2,null));};
\ No newline at end of file
index 1be844d..abc9540 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x201c=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x201c,0x7e));var _0xc201=function(_0x4590ba,_0x212065){_0x4590ba=_0x4590ba-0x0;var _0x2b2d41=_0x201c[_0x4590ba];return _0x2b2d41;};'use strict';var EventEmitter=require(_0xc201('0x0'));var WhatsappQueue=require(_0xc201('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc201('0x2')](0x0);var events={'afterCreate':_0xc201('0x3'),'afterUpdate':_0xc201('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2259ea){return function(_0x5780a7,_0x25e4dc,_0x290b86){WhatsappQueueEvents['emit'](_0x2259ea+':'+_0x5780a7['id'],_0x5780a7);WhatsappQueueEvents[_0xc201('0x5')](_0x2259ea,_0x5780a7);_0x290b86(null);};}for(var e in events){if(events[_0xc201('0x6')](e)){var event=events[e];WhatsappQueue[_0xc201('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
+var _0x9f1f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0xe9ecc0,_0x5a3c3b){var _0x539f32=function(_0x59556c){while(--_0x59556c){_0xe9ecc0['push'](_0xe9ecc0['shift']());}};_0x539f32(++_0x5a3c3b);}(_0x9f1f,0x19e));var _0xf9f1=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x9f1f[_0x39e283];return _0x7de89f;};'use strict';var EventEmitter=require(_0xf9f1('0x0'));var WhatsappQueue=require(_0xf9f1('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf9f1('0x2')](0x0);var events={'afterCreate':_0xf9f1('0x3'),'afterUpdate':_0xf9f1('0x4'),'afterDestroy':_0xf9f1('0x5')};function emitEvent(_0x552be1){return function(_0x568c6c,_0x4f3c21,_0x1630e1){WhatsappQueueEvents[_0xf9f1('0x6')](_0x552be1+':'+_0x568c6c['id'],_0x568c6c);WhatsappQueueEvents[_0xf9f1('0x6')](_0x552be1,_0x568c6c);_0x1630e1(null);};}for(var e in events){if(events[_0xf9f1('0x7')](e)){var event=events[e];WhatsappQueue[_0xf9f1('0x8')](e,emitEvent(event));}}module[_0xf9f1('0x9')]=WhatsappQueueEvents;
\ No newline at end of file
index a3ca601..2a36bed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb889=['whatsapp_queues','lodash','util','bluebird','request-promise','../../config/environment','exports','WhatsappQueue'];(function(_0x37b643,_0x2b3368){var _0xeda57e=function(_0x1e3d22){while(--_0x1e3d22){_0x37b643['push'](_0x37b643['shift']());}};_0xeda57e(++_0x2b3368);}(_0xb889,0x159));var _0x9b88=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xb889[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0x9b88('0x0'));var util=require(_0x9b88('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9b88('0x2'));var rp=require(_0x9b88('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9b88('0x4'));var attributes=require('./whatsappQueue.attributes');module[_0x9b88('0x5')]=function(_0x26315b,_0x1aecf5){return _0x26315b['define'](_0x9b88('0x6'),attributes,{'tableName':_0x9b88('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd775=['define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes'];(function(_0x3f6e81,_0x5cb3ba){var _0x9a98d6=function(_0x3795f3){while(--_0x3795f3){_0x3f6e81['push'](_0x3f6e81['shift']());}};_0x9a98d6(++_0x5cb3ba);}(_0xd775,0x1e3));var _0x5d77=function(_0x364694,_0x3f791a){_0x364694=_0x364694-0x0;var _0x24ecb5=_0xd775[_0x364694];return _0x24ecb5;};'use strict';var _=require(_0x5d77('0x0'));var util=require(_0x5d77('0x1'));var logger=require(_0x5d77('0x2'))(_0x5d77('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5d77('0x4'));var fs=require('fs');var path=require(_0x5d77('0x5'));var rimraf=require(_0x5d77('0x6'));var config=require(_0x5d77('0x7'));var attributes=require(_0x5d77('0x8'));module['exports']=function(_0x360bb4,_0x516690){return _0x360bb4[_0x5d77('0x9')](_0x5d77('0xa'),attributes,{'tableName':_0x5d77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0215290..3b91cf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf74=['./whatsappQueue.socket','register','request','then','info','debug','request\x20sent','code','error','message','WhatsappQueue,\x20%s,\x20%s','result','catch','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetWhatsappQueue','stringify','ShowWhatsappQueue','find','util','moment','bluebird','ioredis','../../config/utils','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0xaf74,0x18d));var _0x4af7=function(_0x1cc71b,_0x2ccf55){_0x1cc71b=_0x1cc71b-0x0;var _0x5ca07c=_0xaf74[_0x1cc71b];return _0x5ca07c;};'use strict';var _=require('lodash');var util=require(_0x4af7('0x0'));var moment=require(_0x4af7('0x1'));var BPromise=require(_0x4af7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4af7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4af7('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4af7('0x5')]['http']({'port':0x232a});config[_0x4af7('0x6')]=_[_0x4af7('0x7')](config[_0x4af7('0x6')],{'host':_0x4af7('0x8'),'port':0x18eb});var socket=require(_0x4af7('0x9'))(new Redis(config['redis']));require(_0x4af7('0xa'))[_0x4af7('0xb')](socket);function respondWithRpcPromise(_0x6c8255,_0x38c050,_0x22decb){return new BPromise(function(_0x208f5a,_0xd0f85c){return client[_0x4af7('0xc')](_0x6c8255,_0x22decb)[_0x4af7('0xd')](function(_0x56e3a2){logger[_0x4af7('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0x38c050,'request\x20sent');logger[_0x4af7('0xf')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x38c050,_0x4af7('0x10'),JSON['stringify'](_0x56e3a2));if(_0x56e3a2['error']){if(_0x56e3a2['error'][_0x4af7('0x11')]===0x1f4){logger[_0x4af7('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x38c050,_0x56e3a2['error'][_0x4af7('0x13')]);return _0xd0f85c(_0x56e3a2[_0x4af7('0x12')][_0x4af7('0x13')]);}logger[_0x4af7('0x12')](_0x4af7('0x14'),_0x38c050,_0x56e3a2[_0x4af7('0x12')][_0x4af7('0x13')]);return _0x208f5a(_0x56e3a2[_0x4af7('0x12')][_0x4af7('0x13')]);}else{logger[_0x4af7('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0x38c050,_0x4af7('0x10'));_0x208f5a(_0x56e3a2[_0x4af7('0x15')]['message']);}})[_0x4af7('0x16')](function(_0x19b4ae){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x38c050,_0x19b4ae);_0xd0f85c(_0x19b4ae);});});}exports['GetWhatsappQueue']=function(_0x3a860e){var _0x2e3e6e=this;return new Promise(function(_0x53aedb,_0xe4e4d7){return db[_0x4af7('0x17')][_0x4af7('0x18')]({'raw':_0x3a860e[_0x4af7('0x19')]?_0x3a860e[_0x4af7('0x19')][_0x4af7('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a860e[_0x4af7('0x19')]?_0x3a860e[_0x4af7('0x19')][_0x4af7('0x1b')]||null:null,'attributes':_0x3a860e[_0x4af7('0x19')]?_0x3a860e[_0x4af7('0x19')][_0x4af7('0x1c')]||null:null,'limit':_0x3a860e['options']?_0x3a860e[_0x4af7('0x19')][_0x4af7('0x1d')]||null:null,'include':_0x3a860e[_0x4af7('0x19')]?_0x3a860e[_0x4af7('0x19')][_0x4af7('0x1e')]?_['map'](_0x3a860e[_0x4af7('0x19')][_0x4af7('0x1e')],function(_0x276c4c){return{'model':db[_0x276c4c[_0x4af7('0x1f')]],'as':_0x276c4c['as'],'attributes':_0x276c4c[_0x4af7('0x1c')],'include':_0x276c4c[_0x4af7('0x1e')]?_[_0x4af7('0x20')](_0x276c4c[_0x4af7('0x1e')],function(_0x53ef8f){return{'model':db[_0x53ef8f[_0x4af7('0x1f')]],'as':_0x53ef8f['as'],'attributes':_0x53ef8f[_0x4af7('0x1c')],'include':_0x53ef8f[_0x4af7('0x1e')]?_[_0x4af7('0x20')](_0x53ef8f[_0x4af7('0x1e')],function(_0x33be48){return{'model':db[_0x33be48[_0x4af7('0x1f')]],'as':_0x33be48['as'],'attributes':_0x33be48[_0x4af7('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d1cdd){logger[_0x4af7('0xe')](_0x4af7('0x21'),_0x3a860e);logger[_0x4af7('0xf')]('GetWhatsappQueue',_0x3a860e,JSON[_0x4af7('0x22')](_0x2d1cdd));_0x53aedb(_0x2d1cdd);})[_0x4af7('0x16')](function(_0x48d547){logger[_0x4af7('0x12')](_0x4af7('0x21'),_0x48d547[_0x4af7('0x13')],_0x3a860e);_0xe4e4d7(_0x2e3e6e['error'](0x1f4,_0x48d547['message']));});});};exports[_0x4af7('0x23')]=function(_0xf8a60a){var _0x158a44=this;return new Promise(function(_0x596588,_0x3474b7){return db[_0x4af7('0x17')][_0x4af7('0x24')]({'raw':_0xf8a60a[_0x4af7('0x19')]?_0xf8a60a['options']['raw']===undefined?!![]:![]:!![],'where':_0xf8a60a['options']?_0xf8a60a[_0x4af7('0x19')][_0x4af7('0x1b')]||null:null,'attributes':_0xf8a60a[_0x4af7('0x19')]?_0xf8a60a[_0x4af7('0x19')]['attributes']||null:null,'include':_0xf8a60a[_0x4af7('0x19')]?_0xf8a60a['options']['include']?_[_0x4af7('0x20')](_0xf8a60a[_0x4af7('0x19')][_0x4af7('0x1e')],function(_0x5098db){return{'model':db[_0x5098db[_0x4af7('0x1f')]],'as':_0x5098db['as'],'attributes':_0x5098db[_0x4af7('0x1c')],'include':_0x5098db[_0x4af7('0x1e')]?_[_0x4af7('0x20')](_0x5098db[_0x4af7('0x1e')],function(_0x5b64d3){return{'model':db[_0x5b64d3[_0x4af7('0x1f')]],'as':_0x5b64d3['as'],'attributes':_0x5b64d3[_0x4af7('0x1c')],'include':_0x5b64d3['include']?_[_0x4af7('0x20')](_0x5b64d3[_0x4af7('0x1e')],function(_0x3fd04b){return{'model':db[_0x3fd04b[_0x4af7('0x1f')]],'as':_0x3fd04b['as'],'attributes':_0x3fd04b[_0x4af7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4af7('0xd')](function(_0x331030){logger[_0x4af7('0xe')]('ShowWhatsappQueue',_0xf8a60a);logger['debug'](_0x4af7('0x23'),_0xf8a60a,JSON[_0x4af7('0x22')](_0x331030));_0x596588(_0x331030);})[_0x4af7('0x16')](function(_0x4a4632){logger['error'](_0x4af7('0x23'),_0x4a4632[_0x4af7('0x13')],_0xf8a60a);_0x3474b7(_0x158a44['error'](0x1f4,_0x4a4632['message']));});});};
\ No newline at end of file
+var _0xfcb9=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','map','model','include','ShowWhatsappQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3db58d,_0x3f0c01){var _0x17158d=function(_0x1b03f5){while(--_0x1b03f5){_0x3db58d['push'](_0x3db58d['shift']());}};_0x17158d(++_0x3f0c01);}(_0xfcb9,0x141));var _0x9fcb=function(_0x22ec21,_0x513eea){_0x22ec21=_0x22ec21-0x0;var _0x170091=_0xfcb9[_0x22ec21];return _0x170091;};'use strict';var _=require('lodash');var util=require(_0x9fcb('0x0'));var moment=require(_0x9fcb('0x1'));var BPromise=require(_0x9fcb('0x2'));var rs=require(_0x9fcb('0x3'));var fs=require('fs');var Redis=require(_0x9fcb('0x4'));var db=require(_0x9fcb('0x5'))['db'];var utils=require(_0x9fcb('0x6'));var logger=require(_0x9fcb('0x7'))(_0x9fcb('0x8'));var config=require(_0x9fcb('0x9'));var jayson=require(_0x9fcb('0xa'));var client=jayson['client'][_0x9fcb('0xb')]({'port':0x232a});config[_0x9fcb('0xc')]=_[_0x9fcb('0xd')](config['redis'],{'host':_0x9fcb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9fcb('0xc')]));require(_0x9fcb('0xf'))[_0x9fcb('0x10')](socket);function respondWithRpcPromise(_0x4a1314,_0x18902a,_0x2a4fa8){return new BPromise(function(_0x59c473,_0x1aae50){return client[_0x9fcb('0x11')](_0x4a1314,_0x2a4fa8)[_0x9fcb('0x12')](function(_0x2f51b6){logger['info'](_0x9fcb('0x13'),_0x18902a,_0x9fcb('0x14'));logger[_0x9fcb('0x15')](_0x9fcb('0x16'),_0x18902a,_0x9fcb('0x14'),JSON[_0x9fcb('0x17')](_0x2f51b6));if(_0x2f51b6[_0x9fcb('0x18')]){if(_0x2f51b6[_0x9fcb('0x18')][_0x9fcb('0x19')]===0x1f4){logger['error'](_0x9fcb('0x13'),_0x18902a,_0x2f51b6[_0x9fcb('0x18')]['message']);return _0x1aae50(_0x2f51b6[_0x9fcb('0x18')][_0x9fcb('0x1a')]);}logger[_0x9fcb('0x18')](_0x9fcb('0x13'),_0x18902a,_0x2f51b6[_0x9fcb('0x18')][_0x9fcb('0x1a')]);return _0x59c473(_0x2f51b6[_0x9fcb('0x18')]['message']);}else{logger[_0x9fcb('0x1b')]('WhatsappQueue,\x20%s,\x20%s',_0x18902a,_0x9fcb('0x14'));_0x59c473(_0x2f51b6[_0x9fcb('0x1c')][_0x9fcb('0x1a')]);}})[_0x9fcb('0x1d')](function(_0x335b56){logger['error'](_0x9fcb('0x13'),_0x18902a,_0x335b56);_0x1aae50(_0x335b56);});});}exports[_0x9fcb('0x1e')]=function(_0x33bad9){var _0x372b56=this;return new Promise(function(_0x3916b7,_0x7ec7de){return db[_0x9fcb('0x1f')]['findAll']({'raw':_0x33bad9[_0x9fcb('0x20')]?_0x33bad9['options'][_0x9fcb('0x21')]===undefined?!![]:![]:!![],'where':_0x33bad9['options']?_0x33bad9[_0x9fcb('0x20')][_0x9fcb('0x22')]||null:null,'attributes':_0x33bad9['options']?_0x33bad9['options'][_0x9fcb('0x23')]||null:null,'limit':_0x33bad9[_0x9fcb('0x20')]?_0x33bad9[_0x9fcb('0x20')][_0x9fcb('0x24')]||null:null,'include':_0x33bad9[_0x9fcb('0x20')]?_0x33bad9['options']['include']?_[_0x9fcb('0x25')](_0x33bad9[_0x9fcb('0x20')]['include'],function(_0x370468){return{'model':db[_0x370468[_0x9fcb('0x26')]],'as':_0x370468['as'],'attributes':_0x370468[_0x9fcb('0x23')],'include':_0x370468[_0x9fcb('0x27')]?_['map'](_0x370468[_0x9fcb('0x27')],function(_0x594336){return{'model':db[_0x594336['model']],'as':_0x594336['as'],'attributes':_0x594336[_0x9fcb('0x23')],'include':_0x594336['include']?_[_0x9fcb('0x25')](_0x594336[_0x9fcb('0x27')],function(_0x4c3141){return{'model':db[_0x4c3141[_0x9fcb('0x26')]],'as':_0x4c3141['as'],'attributes':_0x4c3141[_0x9fcb('0x23')]};}):[]};}):[]};}):[]:[]})[_0x9fcb('0x12')](function(_0x3279e1){logger[_0x9fcb('0x1b')](_0x9fcb('0x1e'),_0x33bad9);logger[_0x9fcb('0x15')](_0x9fcb('0x1e'),_0x33bad9,JSON['stringify'](_0x3279e1));_0x3916b7(_0x3279e1);})[_0x9fcb('0x1d')](function(_0x130b84){logger[_0x9fcb('0x18')]('GetWhatsappQueue',_0x130b84['message'],_0x33bad9);_0x7ec7de(_0x372b56[_0x9fcb('0x18')](0x1f4,_0x130b84['message']));});});};exports[_0x9fcb('0x28')]=function(_0xfd9573){var _0x4cbad7=this;return new Promise(function(_0xd328b0,_0x56096a){return db['WhatsappQueue']['find']({'raw':_0xfd9573['options']?_0xfd9573[_0x9fcb('0x20')][_0x9fcb('0x21')]===undefined?!![]:![]:!![],'where':_0xfd9573[_0x9fcb('0x20')]?_0xfd9573['options']['where']||null:null,'attributes':_0xfd9573[_0x9fcb('0x20')]?_0xfd9573[_0x9fcb('0x20')][_0x9fcb('0x23')]||null:null,'include':_0xfd9573[_0x9fcb('0x20')]?_0xfd9573['options'][_0x9fcb('0x27')]?_[_0x9fcb('0x25')](_0xfd9573['options'][_0x9fcb('0x27')],function(_0x3309e5){return{'model':db[_0x3309e5['model']],'as':_0x3309e5['as'],'attributes':_0x3309e5[_0x9fcb('0x23')],'include':_0x3309e5['include']?_[_0x9fcb('0x25')](_0x3309e5[_0x9fcb('0x27')],function(_0x444a5a){return{'model':db[_0x444a5a[_0x9fcb('0x26')]],'as':_0x444a5a['as'],'attributes':_0x444a5a[_0x9fcb('0x23')],'include':_0x444a5a[_0x9fcb('0x27')]?_['map'](_0x444a5a[_0x9fcb('0x27')],function(_0x5ddfc6){return{'model':db[_0x5ddfc6[_0x9fcb('0x26')]],'as':_0x5ddfc6['as'],'attributes':_0x5ddfc6[_0x9fcb('0x23')]};}):[]};}):[]};}):[]:[]})[_0x9fcb('0x12')](function(_0xf9ec6){logger[_0x9fcb('0x1b')](_0x9fcb('0x28'),_0xfd9573);logger[_0x9fcb('0x15')](_0x9fcb('0x28'),_0xfd9573,JSON[_0x9fcb('0x17')](_0xf9ec6));_0xd328b0(_0xf9ec6);})[_0x9fcb('0x1d')](function(_0x7291f0){logger[_0x9fcb('0x18')](_0x9fcb('0x28'),_0x7291f0[_0x9fcb('0x1a')],_0xfd9573);_0x56096a(_0x4cbad7[_0x9fcb('0x18')](0x1f4,_0x7291f0[_0x9fcb('0x1a')]));});});};
\ No newline at end of file
index f95a070..b93b831 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3771=['./whatsappQueue.events','remove','update','emit','removeListener','register','length','whatsappQueue:'];(function(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0x3771,0x1a0));var _0x1377=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3771[_0x432682];return _0x463d05;};'use strict';var WhatsappQueueEvents=require(_0x1377('0x0'));var events=['save',_0x1377('0x1'),_0x1377('0x2')];function createListener(_0x5d458a,_0x2d7acc){return function(_0x5d86b3){_0x2d7acc[_0x1377('0x3')](_0x5d458a,_0x5d86b3);};}function removeListener(_0x1364d3,_0xf91395){return function(){WhatsappQueueEvents[_0x1377('0x4')](_0x1364d3,_0xf91395);};}exports[_0x1377('0x5')]=function(_0x7e8a32){for(var _0xd3c77a=0x0,_0x4519e9=events[_0x1377('0x6')];_0xd3c77a<_0x4519e9;_0xd3c77a++){var _0x117738=events[_0xd3c77a];var _0x458969=createListener(_0x1377('0x7')+_0x117738,_0x7e8a32);WhatsappQueueEvents['on'](_0x117738,_0x458969);}};
\ No newline at end of file
+var _0xe29f=['register','whatsappQueue:','save','remove','update','emit','removeListener'];(function(_0x1a7c8b,_0x4efd10){var _0x4e6c78=function(_0x4bc05c){while(--_0x4bc05c){_0x1a7c8b['push'](_0x1a7c8b['shift']());}};_0x4e6c78(++_0x4efd10);}(_0xe29f,0xb1));var _0xfe29=function(_0x57fa02,_0xcbefb4){_0x57fa02=_0x57fa02-0x0;var _0x4aa0c0=_0xe29f[_0x57fa02];return _0x4aa0c0;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xfe29('0x0'),_0xfe29('0x1'),_0xfe29('0x2')];function createListener(_0x5a5a88,_0x24dad8){return function(_0x3fd97f){_0x24dad8[_0xfe29('0x3')](_0x5a5a88,_0x3fd97f);};}function removeListener(_0x5e3ab4,_0xaef453){return function(){WhatsappQueueEvents[_0xfe29('0x4')](_0x5e3ab4,_0xaef453);};}exports[_0xfe29('0x5')]=function(_0x11a50f){for(var _0x38696a=0x0,_0x1d5bc6=events['length'];_0x38696a<_0x1d5bc6;_0x38696a++){var _0x5081d1=events[_0x38696a];var _0x17a874=createListener(_0xfe29('0x6')+_0x5081d1,_0x11a50f);WhatsappQueueEvents['on'](_0x5081d1,_0x17a874);}};
\ No newline at end of file
index d11d4f1..1d3c0a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93d3=['util','path','connect-timeout','express','Router','../../components/auth/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','put','delete','exports','multer'];(function(_0x98b0b9,_0x31f9a9){var _0x2300de=function(_0x1d4fb8){while(--_0x1d4fb8){_0x98b0b9['push'](_0x98b0b9['shift']());}};_0x2300de(++_0x31f9a9);}(_0x93d3,0x1ec));var _0x393d=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x93d3[_0xa148b7];return _0x51efd3;};'use strict';var multer=require(_0x393d('0x0'));var util=require(_0x393d('0x1'));var path=require(_0x393d('0x2'));var timeout=require(_0x393d('0x3'));var express=require(_0x393d('0x4'));var router=express[_0x393d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x393d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x393d('0x7'));router[_0x393d('0x8')]('/',auth[_0x393d('0x9')](),controller[_0x393d('0xa')]);router['get'](_0x393d('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x393d('0x8')](_0x393d('0xc'),auth[_0x393d('0x9')](),controller['show']);router[_0x393d('0xd')]('/',auth[_0x393d('0x9')](),controller['create']);router[_0x393d('0xe')](_0x393d('0xc'),auth[_0x393d('0x9')](),controller['update']);router[_0x393d('0xf')](_0x393d('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x393d('0x10')]=router;
\ No newline at end of file
+var _0xf816=['put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','create'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xf816,0x11d));var _0x6f81=function(_0x12d70a,_0x39474a){_0x12d70a=_0x12d70a-0x0;var _0x43fce0=_0xf816[_0x12d70a];return _0x43fce0;};'use strict';var multer=require(_0x6f81('0x0'));var util=require(_0x6f81('0x1'));var path=require(_0x6f81('0x2'));var timeout=require(_0x6f81('0x3'));var express=require('express');var router=express[_0x6f81('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6f81('0x5'));var interaction=require(_0x6f81('0x6'));var config=require(_0x6f81('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0x6f81('0x8')]('/',auth[_0x6f81('0x9')](),controller[_0x6f81('0xa')]);router['get'](_0x6f81('0xb'),auth[_0x6f81('0x9')](),controller[_0x6f81('0xc')]);router[_0x6f81('0x8')]('/:id',auth[_0x6f81('0x9')](),controller[_0x6f81('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6f81('0xe')]);router[_0x6f81('0xf')](_0x6f81('0x10'),auth[_0x6f81('0x9')](),controller[_0x6f81('0x11')]);router[_0x6f81('0x12')](_0x6f81('0x10'),auth[_0x6f81('0x9')](),controller['destroy']);module[_0x6f81('0x13')]=router;
\ No newline at end of file
index e14203d..4815629 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x27bcbb,_0x9974a7){var _0x502094=function(_0x2dab94){while(--_0x2dab94){_0x27bcbb['push'](_0x27bcbb['shift']());}};_0x502094(++_0x9974a7);}(_0x7a54,0x106));var _0x47a5=function(_0xb8be6b,_0x159f74){_0xb8be6b=_0xb8be6b-0x0;var _0x71a712=_0x7a54[_0xb8be6b];return _0x71a712;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
+var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x287605,_0x51015f){var _0x4ce75d=function(_0x623025){while(--_0x623025){_0x287605['push'](_0x287605['shift']());}};_0x4ce75d(++_0x51015f);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 85d4f59..a7b596a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f4=['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','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','length','find','create','body','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x51b6dc,_0x5a079b){var _0x70be33=function(_0x37584c){while(--_0x37584c){_0x51b6dc['push'](_0x51b6dc['shift']());}};_0x70be33(++_0x5a079b);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x211158,_0x5edf3c){_0x211158=_0x211158-0x0;var _0x197bef=_0xf4f4[_0x211158];return _0x197bef;};'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'];function respondWithStatusCode(_0x1b54b0,_0x282031){_0x282031=_0x282031||0xcc;return function(_0x1d7575){if(_0x1d7575){return _0x1b54b0['sendStatus'](_0x282031);}return _0x1b54b0[_0x4f4f('0x1b')](_0x282031)['end']();};}function respondWithResult(_0x216ba8,_0xe7c2d5){_0xe7c2d5=_0xe7c2d5||0xc8;return function(_0x3e16e9){if(_0x3e16e9){return _0x216ba8[_0x4f4f('0x1b')](_0xe7c2d5)['json'](_0x3e16e9);}};}function respondWithFilteredResult(_0x19f2fd,_0x4c68f4){return function(_0x47ab66){if(_0x47ab66){var _0x58de77=typeof _0x4c68f4[_0x4f4f('0x1c')]===_0x4f4f('0x1d')&&typeof _0x4c68f4[_0x4f4f('0x1e')]===_0x4f4f('0x1d');var _0x2d5e5d=_0x47ab66[_0x4f4f('0x1f')];var _0x1245c4=_0x58de77?0x0:_0x4c68f4[_0x4f4f('0x1c')];var _0x929a0b=_0x58de77?_0x47ab66[_0x4f4f('0x1f')]:_0x4c68f4[_0x4f4f('0x1c')]+_0x4c68f4[_0x4f4f('0x1e')];var _0x499277;if(_0x929a0b>=_0x2d5e5d){_0x929a0b=_0x2d5e5d;_0x499277=0xc8;}else{_0x499277=0xce;}_0x19f2fd[_0x4f4f('0x1b')](_0x499277);return _0x19f2fd[_0x4f4f('0x20')](_0x4f4f('0x21'),_0x1245c4+'-'+_0x929a0b+'/'+_0x2d5e5d)[_0x4f4f('0x22')](_0x47ab66);}return null;};}function patchUpdates(_0x302a79){return function(_0x460b4d){try{jsonpatch[_0x4f4f('0x23')](_0x460b4d,_0x302a79,!![]);}catch(_0x3e33d5){return BPromise[_0x4f4f('0x24')](_0x3e33d5);}return _0x460b4d[_0x4f4f('0x25')]();};}function saveUpdates(_0x469a1d,_0x17832f){return function(_0x17984d){if(_0x17984d){return _0x17984d[_0x4f4f('0x26')](_0x469a1d)['then'](function(_0x4f7261){return _0x4f7261;});}return null;};}function removeEntity(_0x525529,_0x272125){return function(_0x43e661){if(_0x43e661){return _0x43e661['destroy']()[_0x4f4f('0x27')](function(){_0x525529[_0x4f4f('0x1b')](0xcc)[_0x4f4f('0x28')]();});}};}function handleEntityNotFound(_0x2ec92a,_0x113ff7){return function(_0x31b30e){if(!_0x31b30e){_0x2ec92a[_0x4f4f('0x29')](0x194);}return _0x31b30e;};}function handleError(_0x50a8ce,_0x39fb9f){_0x39fb9f=_0x39fb9f||0x1f4;return function(_0x237cf9){logger[_0x4f4f('0x2a')](_0x237cf9[_0x4f4f('0x2b')]);if(_0x237cf9[_0x4f4f('0x2c')]){delete _0x237cf9['name'];}_0x50a8ce[_0x4f4f('0x1b')](_0x39fb9f)[_0x4f4f('0x2d')](_0x237cf9);};}exports[_0x4f4f('0x2e')]=function(_0x5deda9,_0x534075){var _0x4c2490={},_0x73b8bb={},_0x5b4f6a={'count':0x0,'rows':[]};var _0x354266=_[_0x4f4f('0x2f')](db[_0x4f4f('0x30')]['rawAttributes'],function(_0x460546){return{'name':_0x460546[_0x4f4f('0x31')],'type':_0x460546['type'][_0x4f4f('0x32')]};});_0x73b8bb[_0x4f4f('0x33')]=_[_0x4f4f('0x2f')](_0x354266,'name');_0x73b8bb[_0x4f4f('0x34')]=_[_0x4f4f('0x35')](_0x5deda9['query']);_0x73b8bb['filters']=_[_0x4f4f('0x36')](_0x73b8bb[_0x4f4f('0x33')],_0x73b8bb[_0x4f4f('0x34')]);_0x4c2490[_0x4f4f('0x37')]=_[_0x4f4f('0x36')](_0x73b8bb[_0x4f4f('0x33')],qs[_0x4f4f('0x38')](_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x38')]));_0x4c2490[_0x4f4f('0x37')]=_0x4c2490['attributes']['length']?_0x4c2490[_0x4f4f('0x37')]:_0x73b8bb['model'];if(!_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x39')](_0x4f4f('0x3a'))){_0x4c2490[_0x4f4f('0x1e')]=qs[_0x4f4f('0x1e')](_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x1e')]);_0x4c2490[_0x4f4f('0x1c')]=qs[_0x4f4f('0x1c')](_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x1c')]);}_0x4c2490[_0x4f4f('0x3b')]=qs['sort'](_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x3c')]);_0x4c2490[_0x4f4f('0x3d')]=qs[_0x4f4f('0x3e')](_[_0x4f4f('0x3f')](_0x5deda9[_0x4f4f('0x34')],_0x73b8bb[_0x4f4f('0x3e')]),_0x354266);if(_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x40')]){_0x4c2490['where']=_[_0x4f4f('0x41')](_0x4c2490[_0x4f4f('0x3d')],{'$or':_[_0x4f4f('0x2f')](_0x354266,function(_0x5eb174){if(_0x5eb174['type']!==_0x4f4f('0x42')){var _0x95a296={};_0x95a296[_0x5eb174[_0x4f4f('0x2c')]]={'$like':'%'+_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x40')]+'%'};return _0x95a296;}})});}_0x4c2490=_[_0x4f4f('0x41')]({},_0x4c2490,_0x5deda9[_0x4f4f('0x43')]);var _0x1ff7f3={'where':_0x4c2490[_0x4f4f('0x3d')]};return db[_0x4f4f('0x30')][_0x4f4f('0x1f')](_0x1ff7f3)[_0x4f4f('0x27')](function(_0x4e352e){_0x5b4f6a[_0x4f4f('0x1f')]=_0x4e352e;if(_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x44')]){_0x4c2490[_0x4f4f('0x45')]=[{'all':!![]}];}return db[_0x4f4f('0x30')]['findAll'](_0x4c2490);})['then'](function(_0x134710){_0x5b4f6a[_0x4f4f('0x46')]=_0x134710;return _0x5b4f6a;})[_0x4f4f('0x27')](respondWithFilteredResult(_0x534075,_0x4c2490))[_0x4f4f('0x47')](handleError(_0x534075,null));};exports['show']=function(_0x1aaf2c,_0x480919){var _0x10de24={'raw':!![],'where':{'id':_0x1aaf2c['params']['id']}},_0x5a7c94={};_0x5a7c94[_0x4f4f('0x33')]=_['keys'](db[_0x4f4f('0x30')][_0x4f4f('0x48')]);_0x5a7c94['query']=_[_0x4f4f('0x35')](_0x1aaf2c[_0x4f4f('0x34')]);_0x5a7c94['filters']=_[_0x4f4f('0x36')](_0x5a7c94[_0x4f4f('0x33')],_0x5a7c94[_0x4f4f('0x34')]);_0x10de24[_0x4f4f('0x37')]=_[_0x4f4f('0x36')](_0x5a7c94[_0x4f4f('0x33')],qs[_0x4f4f('0x38')](_0x1aaf2c[_0x4f4f('0x34')][_0x4f4f('0x38')]));_0x10de24[_0x4f4f('0x37')]=_0x10de24[_0x4f4f('0x37')][_0x4f4f('0x49')]?_0x10de24[_0x4f4f('0x37')]:_0x5a7c94[_0x4f4f('0x33')];if(_0x1aaf2c[_0x4f4f('0x34')]['includeAll']){_0x10de24[_0x4f4f('0x45')]=[{'all':!![]}];}_0x10de24=_['merge']({},_0x10de24,_0x1aaf2c['options']);return db[_0x4f4f('0x30')][_0x4f4f('0x4a')](_0x10de24)['then'](handleEntityNotFound(_0x480919,null))[_0x4f4f('0x27')](respondWithResult(_0x480919,null))[_0x4f4f('0x47')](handleError(_0x480919,null));};exports[_0x4f4f('0x4b')]=function(_0x2721b5,_0x222511){return db['WhatsappQueueReport'][_0x4f4f('0x4b')](_0x2721b5[_0x4f4f('0x4c')],{})[_0x4f4f('0x27')](respondWithResult(_0x222511,0xc9))[_0x4f4f('0x47')](handleError(_0x222511,null));};exports[_0x4f4f('0x26')]=function(_0x433787,_0x29314b){if(_0x433787[_0x4f4f('0x4c')]['id']){delete _0x433787[_0x4f4f('0x4c')]['id'];}return db['WhatsappQueueReport'][_0x4f4f('0x4a')]({'where':{'id':_0x433787[_0x4f4f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29314b,null))['then'](saveUpdates(_0x433787['body'],null))[_0x4f4f('0x27')](respondWithResult(_0x29314b,null))[_0x4f4f('0x47')](handleError(_0x29314b,null));};exports[_0x4f4f('0x4e')]=function(_0x5c5077,_0x389ec6){return db['WhatsappQueueReport'][_0x4f4f('0x4a')]({'where':{'id':_0x5c5077[_0x4f4f('0x4d')]['id']}})[_0x4f4f('0x27')](handleEntityNotFound(_0x389ec6,null))[_0x4f4f('0x27')](removeEntity(_0x389ec6,null))[_0x4f4f('0x47')](handleError(_0x389ec6,null));};exports[_0x4f4f('0x4f')]=function(_0x21408b,_0x88054a){return db[_0x4f4f('0x30')]['describe']()['then'](respondWithResult(_0x88054a,null))[_0x4f4f('0x47')](handleError(_0x88054a,null));};
\ No newline at end of file
+var _0xb7e7=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','map','WhatsappQueueReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','create','body','find','params','destroy','describe','eml-format','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce'];(function(_0x1ea712,_0xb61b63){var _0x19cc84=function(_0x49cb1b){while(--_0x49cb1b){_0x1ea712['push'](_0x1ea712['shift']());}};_0x19cc84(++_0xb61b63);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xb7e7[_0x2555d0];return _0x3bb486;};'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'];function respondWithStatusCode(_0xaadda,_0x54d8ce){_0x54d8ce=_0x54d8ce||0xcc;return function(_0x267446){if(_0x267446){return _0xaadda[_0x7b7e('0x19')](_0x54d8ce);}return _0xaadda['status'](_0x54d8ce)[_0x7b7e('0x1a')]();};}function respondWithResult(_0x5976ac,_0x4c6011){_0x4c6011=_0x4c6011||0xc8;return function(_0x2889ed){if(_0x2889ed){return _0x5976ac[_0x7b7e('0x1b')](_0x4c6011)[_0x7b7e('0x1c')](_0x2889ed);}};}function respondWithFilteredResult(_0x457ec5,_0x3d2fb2){return function(_0x5703fd){if(_0x5703fd){var _0x51baf6=typeof _0x3d2fb2[_0x7b7e('0x1d')]===_0x7b7e('0x1e')&&typeof _0x3d2fb2[_0x7b7e('0x1f')]===_0x7b7e('0x1e');var _0x2cc400=_0x5703fd[_0x7b7e('0x20')];var _0x242368=_0x51baf6?0x0:_0x3d2fb2[_0x7b7e('0x1d')];var _0x2acb8c=_0x51baf6?_0x5703fd[_0x7b7e('0x20')]:_0x3d2fb2[_0x7b7e('0x1d')]+_0x3d2fb2[_0x7b7e('0x1f')];var _0x448980;if(_0x2acb8c>=_0x2cc400){_0x2acb8c=_0x2cc400;_0x448980=0xc8;}else{_0x448980=0xce;}_0x457ec5[_0x7b7e('0x1b')](_0x448980);return _0x457ec5[_0x7b7e('0x21')](_0x7b7e('0x22'),_0x242368+'-'+_0x2acb8c+'/'+_0x2cc400)[_0x7b7e('0x1c')](_0x5703fd);}return null;};}function patchUpdates(_0x49eddb){return function(_0x69262b){try{jsonpatch[_0x7b7e('0x23')](_0x69262b,_0x49eddb,!![]);}catch(_0x24718c){return BPromise['reject'](_0x24718c);}return _0x69262b[_0x7b7e('0x24')]();};}function saveUpdates(_0xbf0cb3,_0x14243b){return function(_0x200156){if(_0x200156){return _0x200156[_0x7b7e('0x25')](_0xbf0cb3)[_0x7b7e('0x26')](function(_0x28bf43){return _0x28bf43;});}return null;};}function removeEntity(_0x10a66a,_0x53bbb3){return function(_0x5d6215){if(_0x5d6215){return _0x5d6215['destroy']()[_0x7b7e('0x26')](function(){_0x10a66a[_0x7b7e('0x1b')](0xcc)[_0x7b7e('0x1a')]();});}};}function handleEntityNotFound(_0x483c6f,_0x51d3b1){return function(_0x5dadbb){if(!_0x5dadbb){_0x483c6f[_0x7b7e('0x19')](0x194);}return _0x5dadbb;};}function handleError(_0x3c8192,_0x16a3c7){_0x16a3c7=_0x16a3c7||0x1f4;return function(_0x7aa71){logger[_0x7b7e('0x27')](_0x7aa71['stack']);if(_0x7aa71[_0x7b7e('0x28')]){delete _0x7aa71[_0x7b7e('0x28')];}_0x3c8192['status'](_0x16a3c7)['send'](_0x7aa71);};}exports['index']=function(_0x12ef0b,_0x423832){var _0x503625={},_0x3db8c4={},_0x51d4b5={'count':0x0,'rows':[]};var _0x1b4341=_[_0x7b7e('0x29')](db[_0x7b7e('0x2a')]['rawAttributes'],function(_0x3960b8){return{'name':_0x3960b8[_0x7b7e('0x2b')],'type':_0x3960b8[_0x7b7e('0x2c')][_0x7b7e('0x2d')]};});_0x3db8c4[_0x7b7e('0x2e')]=_['map'](_0x1b4341,_0x7b7e('0x28'));_0x3db8c4['query']=_[_0x7b7e('0x2f')](_0x12ef0b[_0x7b7e('0x30')]);_0x3db8c4[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x3db8c4[_0x7b7e('0x2e')],_0x3db8c4[_0x7b7e('0x30')]);_0x503625[_0x7b7e('0x33')]=_['intersection'](_0x3db8c4['model'],qs[_0x7b7e('0x34')](_0x12ef0b[_0x7b7e('0x30')]['fields']));_0x503625[_0x7b7e('0x33')]=_0x503625[_0x7b7e('0x33')][_0x7b7e('0x35')]?_0x503625['attributes']:_0x3db8c4[_0x7b7e('0x2e')];if(!_0x12ef0b[_0x7b7e('0x30')][_0x7b7e('0x36')](_0x7b7e('0x37'))){_0x503625[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0x12ef0b[_0x7b7e('0x30')][_0x7b7e('0x1f')]);_0x503625[_0x7b7e('0x1d')]=qs[_0x7b7e('0x1d')](_0x12ef0b[_0x7b7e('0x30')][_0x7b7e('0x1d')]);}_0x503625[_0x7b7e('0x38')]=qs[_0x7b7e('0x39')](_0x12ef0b[_0x7b7e('0x30')][_0x7b7e('0x39')]);_0x503625['where']=qs[_0x7b7e('0x31')](_[_0x7b7e('0x3a')](_0x12ef0b[_0x7b7e('0x30')],_0x3db8c4[_0x7b7e('0x31')]),_0x1b4341);if(_0x12ef0b[_0x7b7e('0x30')][_0x7b7e('0x3b')]){_0x503625[_0x7b7e('0x3c')]=_[_0x7b7e('0x3d')](_0x503625[_0x7b7e('0x3c')],{'$or':_[_0x7b7e('0x29')](_0x1b4341,function(_0x5f3de5){if(_0x5f3de5[_0x7b7e('0x2c')]!==_0x7b7e('0x3e')){var _0x213a8c={};_0x213a8c[_0x5f3de5[_0x7b7e('0x28')]]={'$like':'%'+_0x12ef0b['query'][_0x7b7e('0x3b')]+'%'};return _0x213a8c;}})});}_0x503625=_[_0x7b7e('0x3d')]({},_0x503625,_0x12ef0b[_0x7b7e('0x3f')]);var _0x5c58c0={'where':_0x503625['where']};return db[_0x7b7e('0x2a')]['count'](_0x5c58c0)[_0x7b7e('0x26')](function(_0x3b16d7){_0x51d4b5['count']=_0x3b16d7;if(_0x12ef0b[_0x7b7e('0x30')][_0x7b7e('0x40')]){_0x503625[_0x7b7e('0x41')]=[{'all':!![]}];}return db[_0x7b7e('0x2a')][_0x7b7e('0x42')](_0x503625);})[_0x7b7e('0x26')](function(_0xc888e4){_0x51d4b5[_0x7b7e('0x43')]=_0xc888e4;return _0x51d4b5;})[_0x7b7e('0x26')](respondWithFilteredResult(_0x423832,_0x503625))['catch'](handleError(_0x423832,null));};exports['show']=function(_0x25b41e,_0x550ea6){var _0x41c8a6={'raw':!![],'where':{'id':_0x25b41e['params']['id']}},_0x5e8b5d={};_0x5e8b5d[_0x7b7e('0x2e')]=_['keys'](db[_0x7b7e('0x2a')]['rawAttributes']);_0x5e8b5d[_0x7b7e('0x30')]=_[_0x7b7e('0x2f')](_0x25b41e[_0x7b7e('0x30')]);_0x5e8b5d[_0x7b7e('0x31')]=_['intersection'](_0x5e8b5d[_0x7b7e('0x2e')],_0x5e8b5d[_0x7b7e('0x30')]);_0x41c8a6[_0x7b7e('0x33')]=_[_0x7b7e('0x32')](_0x5e8b5d[_0x7b7e('0x2e')],qs[_0x7b7e('0x34')](_0x25b41e['query']['fields']));_0x41c8a6['attributes']=_0x41c8a6[_0x7b7e('0x33')][_0x7b7e('0x35')]?_0x41c8a6[_0x7b7e('0x33')]:_0x5e8b5d[_0x7b7e('0x2e')];if(_0x25b41e[_0x7b7e('0x30')][_0x7b7e('0x40')]){_0x41c8a6['include']=[{'all':!![]}];}_0x41c8a6=_[_0x7b7e('0x3d')]({},_0x41c8a6,_0x25b41e[_0x7b7e('0x3f')]);return db['WhatsappQueueReport']['find'](_0x41c8a6)[_0x7b7e('0x26')](handleEntityNotFound(_0x550ea6,null))[_0x7b7e('0x26')](respondWithResult(_0x550ea6,null))[_0x7b7e('0x44')](handleError(_0x550ea6,null));};exports[_0x7b7e('0x45')]=function(_0x38b4d0,_0xb46776){return db['WhatsappQueueReport'][_0x7b7e('0x45')](_0x38b4d0['body'],{})[_0x7b7e('0x26')](respondWithResult(_0xb46776,0xc9))[_0x7b7e('0x44')](handleError(_0xb46776,null));};exports[_0x7b7e('0x25')]=function(_0x5874e2,_0x58e4e6){if(_0x5874e2[_0x7b7e('0x46')]['id']){delete _0x5874e2[_0x7b7e('0x46')]['id'];}return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0x5874e2[_0x7b7e('0x48')]['id']}})['then'](handleEntityNotFound(_0x58e4e6,null))[_0x7b7e('0x26')](saveUpdates(_0x5874e2[_0x7b7e('0x46')],null))[_0x7b7e('0x26')](respondWithResult(_0x58e4e6,null))[_0x7b7e('0x44')](handleError(_0x58e4e6,null));};exports[_0x7b7e('0x49')]=function(_0x5a9697,_0x1d6d18){return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0x5a9697[_0x7b7e('0x48')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x1d6d18,null))[_0x7b7e('0x26')](removeEntity(_0x1d6d18,null))[_0x7b7e('0x44')](handleError(_0x1d6d18,null));};exports['describe']=function(_0x433ec7,_0x5d7c89){return db[_0x7b7e('0x2a')][_0x7b7e('0x4a')]()['then'](respondWithResult(_0x5d7c89,null))[_0x7b7e('0x44')](handleError(_0x5d7c89,null));};
\ No newline at end of file
index 18b42e0..2027de8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x737f=['bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x25fb80,_0x921eeb){var _0x2becf0=function(_0x5d9d40){while(--_0x5d9d40){_0x25fb80['push'](_0x25fb80['shift']());}};_0x2becf0(++_0x921eeb);}(_0x737f,0x19f));var _0xf737=function(_0x126751,_0x3b37d9){_0x126751=_0x126751-0x0;var _0x444b55=_0x737f[_0x126751];return _0x444b55;};'use strict';var _=require(_0xf737('0x0'));var util=require(_0xf737('0x1'));var logger=require(_0xf737('0x2'))(_0xf737('0x3'));var moment=require(_0xf737('0x4'));var BPromise=require(_0xf737('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf737('0x6'));var rimraf=require(_0xf737('0x7'));var config=require(_0xf737('0x8'));var attributes=require(_0xf737('0x9'));module[_0xf737('0xa')]=function(_0x2519a1,_0xc07962){return _0x2519a1[_0xf737('0xb')](_0xf737('0xc'),attributes,{'tableName':_0xf737('0xd'),'paranoid':![],'indexes':[{'name':_0xf737('0xe'),'fields':[_0xf737('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b7d=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define'];(function(_0x2797c6,_0x37421b){var _0x54809f=function(_0x2d100c){while(--_0x2d100c){_0x2797c6['push'](_0x2797c6['shift']());}};_0x54809f(++_0x37421b);}(_0x5b7d,0x93));var _0xd5b7=function(_0x4adfde,_0x2d76d5){_0x4adfde=_0x4adfde-0x0;var _0x94c830=_0x5b7d[_0x4adfde];return _0x94c830;};'use strict';var _=require(_0xd5b7('0x0'));var util=require(_0xd5b7('0x1'));var logger=require(_0xd5b7('0x2'))(_0xd5b7('0x3'));var moment=require(_0xd5b7('0x4'));var BPromise=require(_0xd5b7('0x5'));var rp=require(_0xd5b7('0x6'));var fs=require('fs');var path=require(_0xd5b7('0x7'));var rimraf=require(_0xd5b7('0x8'));var config=require(_0xd5b7('0x9'));var attributes=require(_0xd5b7('0xa'));module[_0xd5b7('0xb')]=function(_0x3aa6e7,_0x355f95){return _0x3aa6e7[_0xd5b7('0xc')](_0xd5b7('0xd'),attributes,{'tableName':_0xd5b7('0xe'),'paranoid':![],'indexes':[{'name':_0xd5b7('0xf'),'fields':[_0xd5b7('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 5159276..f6de3ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d15=['result','catch','CreateWhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info'];(function(_0x2a3b62,_0x41667c){var _0x2fd3f2=function(_0x57ccd7){while(--_0x57ccd7){_0x2a3b62['push'](_0x2a3b62['shift']());}};_0x2fd3f2(++_0x41667c);}(_0x3d15,0x94));var _0x53d1=function(_0xe480f0,_0x4c0dc1){_0xe480f0=_0xe480f0-0x0;var _0x57b198=_0x3d15[_0xe480f0];return _0x57b198;};'use strict';var _=require(_0x53d1('0x0'));var util=require(_0x53d1('0x1'));var moment=require(_0x53d1('0x2'));var BPromise=require(_0x53d1('0x3'));var rs=require(_0x53d1('0x4'));var fs=require('fs');var Redis=require(_0x53d1('0x5'));var db=require(_0x53d1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x53d1('0x7'))('rpc');var config=require(_0x53d1('0x8'));var jayson=require(_0x53d1('0x9'));var client=jayson[_0x53d1('0xa')][_0x53d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e8bc9,_0x1bf5b9,_0x38d14a){return new BPromise(function(_0x398ff8,_0xc8d43b){return client[_0x53d1('0xc')](_0x4e8bc9,_0x38d14a)[_0x53d1('0xd')](function(_0xd26227){logger['info'](_0x53d1('0xe'),_0x1bf5b9,'request\x20sent');logger[_0x53d1('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x1bf5b9,_0x53d1('0x10'),JSON[_0x53d1('0x11')](_0xd26227));if(_0xd26227[_0x53d1('0x12')]){if(_0xd26227[_0x53d1('0x12')][_0x53d1('0x13')]===0x1f4){logger[_0x53d1('0x12')](_0x53d1('0xe'),_0x1bf5b9,_0xd26227[_0x53d1('0x12')][_0x53d1('0x14')]);return _0xc8d43b(_0xd26227[_0x53d1('0x12')][_0x53d1('0x14')]);}logger[_0x53d1('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1bf5b9,_0xd26227[_0x53d1('0x12')][_0x53d1('0x14')]);return _0x398ff8(_0xd26227[_0x53d1('0x12')][_0x53d1('0x14')]);}else{logger[_0x53d1('0x15')](_0x53d1('0xe'),_0x1bf5b9,_0x53d1('0x10'));_0x398ff8(_0xd26227[_0x53d1('0x16')]['message']);}})[_0x53d1('0x17')](function(_0x4ae0d0){logger[_0x53d1('0x12')](_0x53d1('0xe'),_0x1bf5b9,_0x4ae0d0);_0xc8d43b(_0x4ae0d0);});});}exports[_0x53d1('0x18')]=function(_0x519e75){var _0x3099cd=this;return new Promise(function(_0x34606a,_0x18de3e){return db['WhatsappQueueReport'][_0x53d1('0x19')](_0x519e75[_0x53d1('0x1a')],{'raw':_0x519e75[_0x53d1('0x1b')]?_0x519e75[_0x53d1('0x1b')][_0x53d1('0x1c')]===undefined?!![]:![]:!![]})[_0x53d1('0xd')](function(_0x302aac){logger['info'](_0x53d1('0x18'),_0x519e75);logger[_0x53d1('0xf')](_0x53d1('0x18'),_0x519e75,JSON[_0x53d1('0x11')](_0x302aac));_0x34606a(_0x302aac);})[_0x53d1('0x17')](function(_0x265c93){logger[_0x53d1('0x12')](_0x53d1('0x18'),_0x265c93[_0x53d1('0x14')],_0x519e75);_0x18de3e(_0x3099cd[_0x53d1('0x12')](0x1f4,_0x265c93[_0x53d1('0x14')]));});});};exports[_0x53d1('0x1d')]=function(_0xf6bcb6){var _0x7949b8=this;return new Promise(function(_0x5335fc,_0x4ebd40){return db['WhatsappQueueReport'][_0x53d1('0x1e')](_0xf6bcb6['body'],{'raw':_0xf6bcb6[_0x53d1('0x1b')]?_0xf6bcb6[_0x53d1('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf6bcb6['options']?_0xf6bcb6['options'][_0x53d1('0x1f')]||null:null,'attributes':_0xf6bcb6[_0x53d1('0x1b')]?_0xf6bcb6[_0x53d1('0x1b')][_0x53d1('0x20')]||null:null,'limit':_0xf6bcb6[_0x53d1('0x1b')]?_0xf6bcb6[_0x53d1('0x1b')][_0x53d1('0x21')]||null:null})[_0x53d1('0xd')](function(_0x2f1521){logger[_0x53d1('0x15')](_0x53d1('0x1d'),_0xf6bcb6);logger['debug'](_0x53d1('0x1d'),_0xf6bcb6,JSON[_0x53d1('0x11')](_0x2f1521));_0x5335fc(_0x2f1521);})[_0x53d1('0x17')](function(_0x19a5c3){logger['error'](_0x53d1('0x1d'),_0x19a5c3[_0x53d1('0x14')],_0xf6bcb6);_0x4ebd40(_0x7949b8['error'](0x1f4,_0x19a5c3[_0x53d1('0x14')]));});});};
\ No newline at end of file
+var _0xce41=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update','where','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xce41,0x15b));var _0x1ce4=function(_0x548200,_0x3241b8){_0x548200=_0x548200-0x0;var _0x1a6d74=_0xce41[_0x548200];return _0x1a6d74;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1ce4('0x0'));var BPromise=require(_0x1ce4('0x1'));var rs=require(_0x1ce4('0x2'));var fs=require('fs');var Redis=require(_0x1ce4('0x3'));var db=require(_0x1ce4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ce4('0x5'))('rpc');var config=require(_0x1ce4('0x6'));var jayson=require(_0x1ce4('0x7'));var client=jayson[_0x1ce4('0x8')][_0x1ce4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x477ac7,_0x5d6cd8,_0x1ec357){return new BPromise(function(_0x573400,_0x3ae25f){return client[_0x1ce4('0xa')](_0x477ac7,_0x1ec357)[_0x1ce4('0xb')](function(_0x56cf3e){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x5d6cd8,_0x1ce4('0xc'));logger[_0x1ce4('0xd')](_0x1ce4('0xe'),_0x5d6cd8,_0x1ce4('0xc'),JSON[_0x1ce4('0xf')](_0x56cf3e));if(_0x56cf3e['error']){if(_0x56cf3e[_0x1ce4('0x10')][_0x1ce4('0x11')]===0x1f4){logger['error'](_0x1ce4('0x12'),_0x5d6cd8,_0x56cf3e[_0x1ce4('0x10')][_0x1ce4('0x13')]);return _0x3ae25f(_0x56cf3e['error'][_0x1ce4('0x13')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x5d6cd8,_0x56cf3e['error'][_0x1ce4('0x13')]);return _0x573400(_0x56cf3e['error']['message']);}else{logger[_0x1ce4('0x14')](_0x1ce4('0x12'),_0x5d6cd8,_0x1ce4('0xc'));_0x573400(_0x56cf3e[_0x1ce4('0x15')][_0x1ce4('0x13')]);}})['catch'](function(_0x4b01e1){logger[_0x1ce4('0x10')](_0x1ce4('0x12'),_0x5d6cd8,_0x4b01e1);_0x3ae25f(_0x4b01e1);});});}exports[_0x1ce4('0x16')]=function(_0x496b1d){var _0xc70123=this;return new Promise(function(_0x16caa5,_0x25166b){return db[_0x1ce4('0x17')][_0x1ce4('0x18')](_0x496b1d[_0x1ce4('0x19')],{'raw':_0x496b1d[_0x1ce4('0x1a')]?_0x496b1d[_0x1ce4('0x1a')][_0x1ce4('0x1b')]===undefined?!![]:![]:!![]})[_0x1ce4('0xb')](function(_0x5f2fba){logger[_0x1ce4('0x14')](_0x1ce4('0x16'),_0x496b1d);logger['debug'](_0x1ce4('0x16'),_0x496b1d,JSON['stringify'](_0x5f2fba));_0x16caa5(_0x5f2fba);})['catch'](function(_0x313475){logger[_0x1ce4('0x10')](_0x1ce4('0x16'),_0x313475[_0x1ce4('0x13')],_0x496b1d);_0x25166b(_0xc70123[_0x1ce4('0x10')](0x1f4,_0x313475[_0x1ce4('0x13')]));});});};exports[_0x1ce4('0x1c')]=function(_0xd4d4f0){var _0x12c085=this;return new Promise(function(_0x30aa0a,_0x13b5b0){return db['WhatsappQueueReport'][_0x1ce4('0x1d')](_0xd4d4f0[_0x1ce4('0x19')],{'raw':_0xd4d4f0[_0x1ce4('0x1a')]?_0xd4d4f0[_0x1ce4('0x1a')][_0x1ce4('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd4d4f0[_0x1ce4('0x1a')]?_0xd4d4f0[_0x1ce4('0x1a')][_0x1ce4('0x1e')]||null:null,'attributes':_0xd4d4f0['options']?_0xd4d4f0['options']['attributes']||null:null,'limit':_0xd4d4f0[_0x1ce4('0x1a')]?_0xd4d4f0['options']['limit']||null:null})[_0x1ce4('0xb')](function(_0x34947e){logger[_0x1ce4('0x14')](_0x1ce4('0x1c'),_0xd4d4f0);logger[_0x1ce4('0xd')]('UpdateWhatsappQueueReport',_0xd4d4f0,JSON[_0x1ce4('0xf')](_0x34947e));_0x30aa0a(_0x34947e);})[_0x1ce4('0x1f')](function(_0x52bb16){logger[_0x1ce4('0x10')](_0x1ce4('0x1c'),_0x52bb16[_0x1ce4('0x13')],_0xd4d4f0);_0x13b5b0(_0x12c085['error'](0x1f4,_0x52bb16[_0x1ce4('0x13')]));});});};
\ No newline at end of file
index bae58ae..d25cbfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfda3=['describe','/:id','show','post','create','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','index','/describe','isAuthenticated'];(function(_0x4a7252,_0x40fb92){var _0x2240de=function(_0x23e2d6){while(--_0x23e2d6){_0x4a7252['push'](_0x4a7252['shift']());}};_0x2240de(++_0x40fb92);}(_0xfda3,0x12f));var _0x3fda=function(_0x4db5dc,_0x522901){_0x4db5dc=_0x4db5dc-0x0;var _0x62ee23=_0xfda3[_0x4db5dc];return _0x62ee23;};'use strict';var multer=require(_0x3fda('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3fda('0x1'));var express=require(_0x3fda('0x2'));var router=express[_0x3fda('0x3')]();var fs_extra=require(_0x3fda('0x4'));var auth=require(_0x3fda('0x5'));var interaction=require(_0x3fda('0x6'));var config=require('../../config/environment');var controller=require(_0x3fda('0x7'));router[_0x3fda('0x8')]('/',auth['isAuthenticated'](),controller[_0x3fda('0x9')]);router['get'](_0x3fda('0xa'),auth[_0x3fda('0xb')](),controller[_0x3fda('0xc')]);router[_0x3fda('0x8')](_0x3fda('0xd'),auth[_0x3fda('0xb')](),controller[_0x3fda('0xe')]);router[_0x3fda('0xf')]('/',auth[_0x3fda('0xb')](),controller[_0x3fda('0x10')]);router[_0x3fda('0x11')](_0x3fda('0xd'),auth[_0x3fda('0xb')](),controller['update']);router[_0x3fda('0x12')](_0x3fda('0xd'),auth[_0x3fda('0xb')](),controller[_0x3fda('0x13')]);module[_0x3fda('0x14')]=router;
\ No newline at end of file
+var _0x8ea6=['put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8ea6,0x6d));var _0x68ea=function(_0x3db6ce,_0x55e096){_0x3db6ce=_0x3db6ce-0x0;var _0x39c992=_0x8ea6[_0x3db6ce];return _0x39c992;};'use strict';var multer=require(_0x68ea('0x0'));var util=require(_0x68ea('0x1'));var path=require(_0x68ea('0x2'));var timeout=require(_0x68ea('0x3'));var express=require('express');var router=express[_0x68ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x68ea('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x68ea('0x6'));var controller=require(_0x68ea('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x68ea('0x8')]);router[_0x68ea('0x9')](_0x68ea('0xa'),auth[_0x68ea('0xb')](),controller[_0x68ea('0xc')]);router['get'](_0x68ea('0xd'),auth[_0x68ea('0xb')](),controller[_0x68ea('0xe')]);router[_0x68ea('0xf')]('/',auth[_0x68ea('0xb')](),controller[_0x68ea('0x10')]);router[_0x68ea('0x11')](_0x68ea('0xd'),auth['isAuthenticated'](),controller[_0x68ea('0x12')]);router[_0x68ea('0x13')](_0x68ea('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x68ea('0x14')]=router;
\ No newline at end of file
index e59252d..49b07ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7292=['ENUM','account','agent','DATE','sequelize','exports','STRING'];(function(_0x26439d,_0x2e737d){var _0x590fe0=function(_0x26f97c){while(--_0x26f97c){_0x26439d['push'](_0x26439d['shift']());}};_0x590fe0(++_0x2e737d);}(_0x7292,0x6d));var _0x2729=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7292[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x2729('0x0'));module[_0x2729('0x1')]={'uniqueid':{'type':Sequelize[_0x2729('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2729('0x3')](_0x2729('0x4'),_0x2729('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2729('0x6')]}};
\ No newline at end of file
+var _0x50a8=['account','agent','queue','exports','ENUM'];(function(_0x979a32,_0x16d355){var _0x197596=function(_0x499b5b){while(--_0x499b5b){_0x979a32['push'](_0x979a32['shift']());}};_0x197596(++_0x16d355);}(_0x50a8,0x193));var _0x850a=function(_0xcedf57,_0x335b10){_0xcedf57=_0xcedf57-0x0;var _0x35eccf=_0x50a8[_0xcedf57];return _0x35eccf;};'use strict';var Sequelize=require('sequelize');module[_0x850a('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x850a('0x1')](_0x850a('0x2'),_0x850a('0x3'),_0x850a('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index 42f9957..4715d0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdc2=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','destroy','then','name','send','index','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','order','sort','filter','where','merge','map','options','WhatsappTransferReport','includeAll','include','findAll','rows','catch','params','create','body','update','find','describe','eml-format'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xcdc2,0x19d));var _0x2cdc=function(_0x1338d2,_0x226222){_0x1338d2=_0x1338d2-0x0;var _0x2df1c8=_0xcdc2[_0x1338d2];return _0x2df1c8;};'use strict';var emlformat=require(_0x2cdc('0x0'));var rimraf=require(_0x2cdc('0x1'));var zipdir=require(_0x2cdc('0x2'));var jsonpatch=require(_0x2cdc('0x3'));var rp=require(_0x2cdc('0x4'));var moment=require(_0x2cdc('0x5'));var BPromise=require(_0x2cdc('0x6'));var Mustache=require(_0x2cdc('0x7'));var util=require(_0x2cdc('0x8'));var path=require(_0x2cdc('0x9'));var sox=require(_0x2cdc('0xa'));var csv=require(_0x2cdc('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cdc('0xc'));var squel=require('squel');var crypto=require(_0x2cdc('0xd'));var jsforce=require(_0x2cdc('0xe'));var deskjs=require(_0x2cdc('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2cdc('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2cdc('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2cdc('0x12'));var logger=require('../../config/logger')(_0x2cdc('0x13'));var utils=require(_0x2cdc('0x14'));var config=require(_0x2cdc('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dd7d0,_0x53f515){_0x53f515=_0x53f515||0xcc;return function(_0x5951ca){if(_0x5951ca){return _0x4dd7d0[_0x2cdc('0x16')](_0x53f515);}return _0x4dd7d0[_0x2cdc('0x17')](_0x53f515)[_0x2cdc('0x18')]();};}function respondWithResult(_0x19c3d0,_0x4bf2f6){_0x4bf2f6=_0x4bf2f6||0xc8;return function(_0x4fb78b){if(_0x4fb78b){return _0x19c3d0[_0x2cdc('0x17')](_0x4bf2f6)[_0x2cdc('0x19')](_0x4fb78b);}};}function respondWithFilteredResult(_0x3cd5e0,_0x3715be){return function(_0x590fb4){if(_0x590fb4){var _0x570500=typeof _0x3715be[_0x2cdc('0x1a')]===_0x2cdc('0x1b')&&typeof _0x3715be[_0x2cdc('0x1c')]===_0x2cdc('0x1b');var _0x1d0633=_0x590fb4['count'];var _0x3a27bd=_0x570500?0x0:_0x3715be[_0x2cdc('0x1a')];var _0x4e3b93=_0x570500?_0x590fb4[_0x2cdc('0x1d')]:_0x3715be[_0x2cdc('0x1a')]+_0x3715be[_0x2cdc('0x1c')];var _0xa33fe6;if(_0x4e3b93>=_0x1d0633){_0x4e3b93=_0x1d0633;_0xa33fe6=0xc8;}else{_0xa33fe6=0xce;}_0x3cd5e0[_0x2cdc('0x17')](_0xa33fe6);return _0x3cd5e0[_0x2cdc('0x1e')]('Content-Range',_0x3a27bd+'-'+_0x4e3b93+'/'+_0x1d0633)['json'](_0x590fb4);}return null;};}function patchUpdates(_0x27bb5d){return function(_0x4f103c){try{jsonpatch['apply'](_0x4f103c,_0x27bb5d,!![]);}catch(_0x3ff658){return BPromise[_0x2cdc('0x1f')](_0x3ff658);}return _0x4f103c[_0x2cdc('0x20')]();};}function saveUpdates(_0x211eab,_0x3ce18a){return function(_0x22169c){if(_0x22169c){return _0x22169c['update'](_0x211eab)['then'](function(_0x19f1d6){return _0x19f1d6;});}return null;};}function removeEntity(_0x2ea200,_0x4bdb4d){return function(_0x202580){if(_0x202580){return _0x202580[_0x2cdc('0x21')]()[_0x2cdc('0x22')](function(){_0x2ea200[_0x2cdc('0x17')](0xcc)[_0x2cdc('0x18')]();});}};}function handleEntityNotFound(_0x480e57,_0x476c36){return function(_0x119936){if(!_0x119936){_0x480e57[_0x2cdc('0x16')](0x194);}return _0x119936;};}function handleError(_0x1afec9,_0x39203e){_0x39203e=_0x39203e||0x1f4;return function(_0x5468da){logger['error'](_0x5468da['stack']);if(_0x5468da[_0x2cdc('0x23')]){delete _0x5468da[_0x2cdc('0x23')];}_0x1afec9[_0x2cdc('0x17')](_0x39203e)[_0x2cdc('0x24')](_0x5468da);};}exports[_0x2cdc('0x25')]=function(_0x2433f5,_0x17316d){var _0x48224c={},_0x154761={},_0x564194={'count':0x0,'rows':[]};var _0x2acdd2=_['map'](db['WhatsappTransferReport'][_0x2cdc('0x26')],function(_0x2a58b0){return{'name':_0x2a58b0[_0x2cdc('0x27')],'type':_0x2a58b0[_0x2cdc('0x28')][_0x2cdc('0x29')]};});_0x154761[_0x2cdc('0x2a')]=_['map'](_0x2acdd2,_0x2cdc('0x23'));_0x154761['query']=_[_0x2cdc('0x2b')](_0x2433f5['query']);_0x154761[_0x2cdc('0x2c')]=_[_0x2cdc('0x2d')](_0x154761[_0x2cdc('0x2a')],_0x154761['query']);_0x48224c[_0x2cdc('0x2e')]=_[_0x2cdc('0x2d')](_0x154761['model'],qs['fields'](_0x2433f5['query'][_0x2cdc('0x2f')]));_0x48224c[_0x2cdc('0x2e')]=_0x48224c[_0x2cdc('0x2e')]['length']?_0x48224c[_0x2cdc('0x2e')]:_0x154761['model'];if(!_0x2433f5[_0x2cdc('0x30')][_0x2cdc('0x31')]('nolimit')){_0x48224c[_0x2cdc('0x1c')]=qs[_0x2cdc('0x1c')](_0x2433f5[_0x2cdc('0x30')]['limit']);_0x48224c[_0x2cdc('0x1a')]=qs['offset'](_0x2433f5[_0x2cdc('0x30')][_0x2cdc('0x1a')]);}_0x48224c[_0x2cdc('0x32')]=qs[_0x2cdc('0x33')](_0x2433f5['query'][_0x2cdc('0x33')]);_0x48224c['where']=qs[_0x2cdc('0x2c')](_['pick'](_0x2433f5['query'],_0x154761[_0x2cdc('0x2c')]),_0x2acdd2);if(_0x2433f5[_0x2cdc('0x30')][_0x2cdc('0x34')]){_0x48224c[_0x2cdc('0x35')]=_[_0x2cdc('0x36')](_0x48224c[_0x2cdc('0x35')],{'$or':_[_0x2cdc('0x37')](_0x2acdd2,function(_0x48e31e){if(_0x48e31e[_0x2cdc('0x28')]!=='VIRTUAL'){var _0x206c7e={};_0x206c7e[_0x48e31e[_0x2cdc('0x23')]]={'$like':'%'+_0x2433f5['query'][_0x2cdc('0x34')]+'%'};return _0x206c7e;}})});}_0x48224c=_[_0x2cdc('0x36')]({},_0x48224c,_0x2433f5[_0x2cdc('0x38')]);var _0x3356f7={'where':_0x48224c[_0x2cdc('0x35')]};return db[_0x2cdc('0x39')]['count'](_0x3356f7)['then'](function(_0x1d1f61){_0x564194['count']=_0x1d1f61;if(_0x2433f5[_0x2cdc('0x30')][_0x2cdc('0x3a')]){_0x48224c[_0x2cdc('0x3b')]=[{'all':!![]}];}return db[_0x2cdc('0x39')][_0x2cdc('0x3c')](_0x48224c);})[_0x2cdc('0x22')](function(_0x2b91a1){_0x564194[_0x2cdc('0x3d')]=_0x2b91a1;return _0x564194;})['then'](respondWithFilteredResult(_0x17316d,_0x48224c))[_0x2cdc('0x3e')](handleError(_0x17316d,null));};exports['show']=function(_0x3ab43b,_0x412217){var _0x4fdfe6={'raw':!![],'where':{'id':_0x3ab43b[_0x2cdc('0x3f')]['id']}},_0x50dc1b={};_0x50dc1b['model']=_[_0x2cdc('0x2b')](db['WhatsappTransferReport'][_0x2cdc('0x26')]);_0x50dc1b[_0x2cdc('0x30')]=_[_0x2cdc('0x2b')](_0x3ab43b['query']);_0x50dc1b[_0x2cdc('0x2c')]=_['intersection'](_0x50dc1b[_0x2cdc('0x2a')],_0x50dc1b['query']);_0x4fdfe6[_0x2cdc('0x2e')]=_[_0x2cdc('0x2d')](_0x50dc1b[_0x2cdc('0x2a')],qs[_0x2cdc('0x2f')](_0x3ab43b['query'][_0x2cdc('0x2f')]));_0x4fdfe6['attributes']=_0x4fdfe6[_0x2cdc('0x2e')]['length']?_0x4fdfe6[_0x2cdc('0x2e')]:_0x50dc1b[_0x2cdc('0x2a')];if(_0x3ab43b[_0x2cdc('0x30')][_0x2cdc('0x3a')]){_0x4fdfe6[_0x2cdc('0x3b')]=[{'all':!![]}];}_0x4fdfe6=_['merge']({},_0x4fdfe6,_0x3ab43b[_0x2cdc('0x38')]);return db[_0x2cdc('0x39')]['find'](_0x4fdfe6)[_0x2cdc('0x22')](handleEntityNotFound(_0x412217,null))['then'](respondWithResult(_0x412217,null))[_0x2cdc('0x3e')](handleError(_0x412217,null));};exports[_0x2cdc('0x40')]=function(_0x2136bc,_0x5ea543){return db[_0x2cdc('0x39')][_0x2cdc('0x40')](_0x2136bc[_0x2cdc('0x41')],{})[_0x2cdc('0x22')](respondWithResult(_0x5ea543,0xc9))[_0x2cdc('0x3e')](handleError(_0x5ea543,null));};exports[_0x2cdc('0x42')]=function(_0x37e1ea,_0x89bf5f){if(_0x37e1ea[_0x2cdc('0x41')]['id']){delete _0x37e1ea[_0x2cdc('0x41')]['id'];}return db['WhatsappTransferReport'][_0x2cdc('0x43')]({'where':{'id':_0x37e1ea[_0x2cdc('0x3f')]['id']}})[_0x2cdc('0x22')](handleEntityNotFound(_0x89bf5f,null))[_0x2cdc('0x22')](saveUpdates(_0x37e1ea[_0x2cdc('0x41')],null))['then'](respondWithResult(_0x89bf5f,null))[_0x2cdc('0x3e')](handleError(_0x89bf5f,null));};exports[_0x2cdc('0x21')]=function(_0x582487,_0x50174f){return db['WhatsappTransferReport'][_0x2cdc('0x43')]({'where':{'id':_0x582487[_0x2cdc('0x3f')]['id']}})[_0x2cdc('0x22')](handleEntityNotFound(_0x50174f,null))['then'](removeEntity(_0x50174f,null))[_0x2cdc('0x3e')](handleError(_0x50174f,null));};exports[_0x2cdc('0x44')]=function(_0x3bce10,_0x432e00){return db[_0x2cdc('0x39')][_0x2cdc('0x44')]()[_0x2cdc('0x22')](respondWithResult(_0x432e00,null))[_0x2cdc('0x3e')](handleError(_0x432e00,null));};
\ No newline at end of file
+var _0xb995=['WhatsappTransferReport','rawAttributes','fieldName','key','model','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','include','findAll','rows','catch','show','params','keys','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','stack','name','send','index','map'];(function(_0x244d6c,_0x3eed15){var _0x5d4f59=function(_0xa50d6c){while(--_0xa50d6c){_0x244d6c['push'](_0x244d6c['shift']());}};_0x5d4f59(++_0x3eed15);}(_0xb995,0xe4));var _0x5b99=function(_0x1f111b,_0x2689fb){_0x1f111b=_0x1f111b-0x0;var _0x181fec=_0xb995[_0x1f111b];return _0x181fec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b99('0x0'));var zipdir=require(_0x5b99('0x1'));var jsonpatch=require(_0x5b99('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5b99('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5b99('0x4'));var sox=require(_0x5b99('0x5'));var csv=require(_0x5b99('0x6'));var ejs=require(_0x5b99('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b99('0x8'));var crypto=require(_0x5b99('0x9'));var jsforce=require(_0x5b99('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5b99('0xb'));var Papa=require('papaparse');var Redis=require(_0x5b99('0xc'));var authService=require(_0x5b99('0xd'));var qs=require(_0x5b99('0xe'));var as=require(_0x5b99('0xf'));var hardwareService=require(_0x5b99('0x10'));var logger=require(_0x5b99('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x5b99('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a3ebc,_0x45cb1c){_0x45cb1c=_0x45cb1c||0xcc;return function(_0x38589e){if(_0x38589e){return _0x3a3ebc[_0x5b99('0x13')](_0x45cb1c);}return _0x3a3ebc[_0x5b99('0x14')](_0x45cb1c)[_0x5b99('0x15')]();};}function respondWithResult(_0x1a4142,_0x98bf0d){_0x98bf0d=_0x98bf0d||0xc8;return function(_0x286989){if(_0x286989){return _0x1a4142[_0x5b99('0x14')](_0x98bf0d)['json'](_0x286989);}};}function respondWithFilteredResult(_0x351f4e,_0x47c0cd){return function(_0x1804d8){if(_0x1804d8){var _0x5642fe=typeof _0x47c0cd[_0x5b99('0x16')]===_0x5b99('0x17')&&typeof _0x47c0cd[_0x5b99('0x18')]==='undefined';var _0x17627e=_0x1804d8[_0x5b99('0x19')];var _0x4b29c9=_0x5642fe?0x0:_0x47c0cd['offset'];var _0x5c0c22=_0x5642fe?_0x1804d8[_0x5b99('0x19')]:_0x47c0cd['offset']+_0x47c0cd[_0x5b99('0x18')];var _0x38500d;if(_0x5c0c22>=_0x17627e){_0x5c0c22=_0x17627e;_0x38500d=0xc8;}else{_0x38500d=0xce;}_0x351f4e[_0x5b99('0x14')](_0x38500d);return _0x351f4e['set'](_0x5b99('0x1a'),_0x4b29c9+'-'+_0x5c0c22+'/'+_0x17627e)['json'](_0x1804d8);}return null;};}function patchUpdates(_0x4cd28c){return function(_0xb9460f){try{jsonpatch['apply'](_0xb9460f,_0x4cd28c,!![]);}catch(_0x2abdf8){return BPromise[_0x5b99('0x1b')](_0x2abdf8);}return _0xb9460f['save']();};}function saveUpdates(_0x1708d2,_0x1f26b1){return function(_0x5ce8ca){if(_0x5ce8ca){return _0x5ce8ca[_0x5b99('0x1c')](_0x1708d2)[_0x5b99('0x1d')](function(_0x279b2d){return _0x279b2d;});}return null;};}function removeEntity(_0x5990fa,_0x514a05){return function(_0x552fcf){if(_0x552fcf){return _0x552fcf[_0x5b99('0x1e')]()[_0x5b99('0x1d')](function(){_0x5990fa[_0x5b99('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb5ce76,_0x12cfb1){return function(_0x5af67c){if(!_0x5af67c){_0xb5ce76[_0x5b99('0x13')](0x194);}return _0x5af67c;};}function handleError(_0x497bd6,_0x4424ce){_0x4424ce=_0x4424ce||0x1f4;return function(_0x1d783b){logger['error'](_0x1d783b[_0x5b99('0x1f')]);if(_0x1d783b[_0x5b99('0x20')]){delete _0x1d783b[_0x5b99('0x20')];}_0x497bd6[_0x5b99('0x14')](_0x4424ce)[_0x5b99('0x21')](_0x1d783b);};}exports[_0x5b99('0x22')]=function(_0x4db3be,_0x8a2d90){var _0xd798ba={},_0x1c198b={},_0x5a0e37={'count':0x0,'rows':[]};var _0x1c602f=_[_0x5b99('0x23')](db[_0x5b99('0x24')][_0x5b99('0x25')],function(_0xa1b2ad){return{'name':_0xa1b2ad[_0x5b99('0x26')],'type':_0xa1b2ad['type'][_0x5b99('0x27')]};});_0x1c198b[_0x5b99('0x28')]=_[_0x5b99('0x23')](_0x1c602f,_0x5b99('0x20'));_0x1c198b['query']=_['keys'](_0x4db3be['query']);_0x1c198b[_0x5b99('0x29')]=_[_0x5b99('0x2a')](_0x1c198b[_0x5b99('0x28')],_0x1c198b['query']);_0xd798ba[_0x5b99('0x2b')]=_[_0x5b99('0x2a')](_0x1c198b['model'],qs['fields'](_0x4db3be[_0x5b99('0x2c')][_0x5b99('0x2d')]));_0xd798ba['attributes']=_0xd798ba[_0x5b99('0x2b')][_0x5b99('0x2e')]?_0xd798ba[_0x5b99('0x2b')]:_0x1c198b[_0x5b99('0x28')];if(!_0x4db3be[_0x5b99('0x2c')][_0x5b99('0x2f')](_0x5b99('0x30'))){_0xd798ba[_0x5b99('0x18')]=qs['limit'](_0x4db3be[_0x5b99('0x2c')]['limit']);_0xd798ba[_0x5b99('0x16')]=qs[_0x5b99('0x16')](_0x4db3be['query'][_0x5b99('0x16')]);}_0xd798ba['order']=qs[_0x5b99('0x31')](_0x4db3be[_0x5b99('0x2c')][_0x5b99('0x31')]);_0xd798ba['where']=qs['filters'](_['pick'](_0x4db3be['query'],_0x1c198b[_0x5b99('0x29')]),_0x1c602f);if(_0x4db3be[_0x5b99('0x2c')][_0x5b99('0x32')]){_0xd798ba[_0x5b99('0x33')]=_[_0x5b99('0x34')](_0xd798ba[_0x5b99('0x33')],{'$or':_['map'](_0x1c602f,function(_0x511a6f){if(_0x511a6f[_0x5b99('0x35')]!=='VIRTUAL'){var _0x3e1d29={};_0x3e1d29[_0x511a6f[_0x5b99('0x20')]]={'$like':'%'+_0x4db3be[_0x5b99('0x2c')][_0x5b99('0x32')]+'%'};return _0x3e1d29;}})});}_0xd798ba=_[_0x5b99('0x34')]({},_0xd798ba,_0x4db3be['options']);var _0x3d6386={'where':_0xd798ba[_0x5b99('0x33')]};return db['WhatsappTransferReport'][_0x5b99('0x19')](_0x3d6386)[_0x5b99('0x1d')](function(_0x58dc9a){_0x5a0e37[_0x5b99('0x19')]=_0x58dc9a;if(_0x4db3be[_0x5b99('0x2c')]['includeAll']){_0xd798ba[_0x5b99('0x36')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x5b99('0x37')](_0xd798ba);})[_0x5b99('0x1d')](function(_0x4d6c21){_0x5a0e37[_0x5b99('0x38')]=_0x4d6c21;return _0x5a0e37;})[_0x5b99('0x1d')](respondWithFilteredResult(_0x8a2d90,_0xd798ba))[_0x5b99('0x39')](handleError(_0x8a2d90,null));};exports[_0x5b99('0x3a')]=function(_0xb43d,_0x596fd2){var _0x329440={'raw':!![],'where':{'id':_0xb43d[_0x5b99('0x3b')]['id']}},_0x4b6046={};_0x4b6046[_0x5b99('0x28')]=_['keys'](db['WhatsappTransferReport'][_0x5b99('0x25')]);_0x4b6046[_0x5b99('0x2c')]=_[_0x5b99('0x3c')](_0xb43d['query']);_0x4b6046[_0x5b99('0x29')]=_[_0x5b99('0x2a')](_0x4b6046[_0x5b99('0x28')],_0x4b6046['query']);_0x329440[_0x5b99('0x2b')]=_[_0x5b99('0x2a')](_0x4b6046['model'],qs[_0x5b99('0x2d')](_0xb43d[_0x5b99('0x2c')]['fields']));_0x329440[_0x5b99('0x2b')]=_0x329440['attributes'][_0x5b99('0x2e')]?_0x329440['attributes']:_0x4b6046[_0x5b99('0x28')];if(_0xb43d[_0x5b99('0x2c')]['includeAll']){_0x329440['include']=[{'all':!![]}];}_0x329440=_[_0x5b99('0x34')]({},_0x329440,_0xb43d[_0x5b99('0x3d')]);return db[_0x5b99('0x24')]['find'](_0x329440)[_0x5b99('0x1d')](handleEntityNotFound(_0x596fd2,null))[_0x5b99('0x1d')](respondWithResult(_0x596fd2,null))[_0x5b99('0x39')](handleError(_0x596fd2,null));};exports['create']=function(_0x4c6a3b,_0x924a26){return db[_0x5b99('0x24')][_0x5b99('0x3e')](_0x4c6a3b[_0x5b99('0x3f')],{})[_0x5b99('0x1d')](respondWithResult(_0x924a26,0xc9))[_0x5b99('0x39')](handleError(_0x924a26,null));};exports['update']=function(_0x33ab6a,_0x4e8042){if(_0x33ab6a['body']['id']){delete _0x33ab6a[_0x5b99('0x3f')]['id'];}return db[_0x5b99('0x24')][_0x5b99('0x40')]({'where':{'id':_0x33ab6a[_0x5b99('0x3b')]['id']}})[_0x5b99('0x1d')](handleEntityNotFound(_0x4e8042,null))[_0x5b99('0x1d')](saveUpdates(_0x33ab6a['body'],null))[_0x5b99('0x1d')](respondWithResult(_0x4e8042,null))[_0x5b99('0x39')](handleError(_0x4e8042,null));};exports[_0x5b99('0x1e')]=function(_0x206d6d,_0x49ffe4){return db[_0x5b99('0x24')][_0x5b99('0x40')]({'where':{'id':_0x206d6d[_0x5b99('0x3b')]['id']}})['then'](handleEntityNotFound(_0x49ffe4,null))[_0x5b99('0x1d')](removeEntity(_0x49ffe4,null))['catch'](handleError(_0x49ffe4,null));};exports[_0x5b99('0x41')]=function(_0x5b0347,_0x47d0ff){return db[_0x5b99('0x24')][_0x5b99('0x41')]()['then'](respondWithResult(_0x47d0ff,null))['catch'](handleError(_0x47d0ff,null));};
\ No newline at end of file
index da9ba01..fb2ba8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1074=['exports','define','WhatsappTransferReport','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1074,0x16e));var _0x4107=function(_0x20038e,_0x4b6981){_0x20038e=_0x20038e-0x0;var _0x425e2e=_0x1074[_0x20038e];return _0x425e2e;};'use strict';var _=require(_0x4107('0x0'));var util=require('util');var logger=require(_0x4107('0x1'))(_0x4107('0x2'));var moment=require(_0x4107('0x3'));var BPromise=require(_0x4107('0x4'));var rp=require(_0x4107('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4107('0x6'));var attributes=require(_0x4107('0x7'));module[_0x4107('0x8')]=function(_0xe7ab2b,_0x5a937e){return _0xe7ab2b[_0x4107('0x9')](_0x4107('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd627=['./whatsappTransferReport.attributes','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4c4bc8,_0x1151b8){var _0x5e07f8=function(_0x17d1d9){while(--_0x17d1d9){_0x4c4bc8['push'](_0x4c4bc8['shift']());}};_0x5e07f8(++_0x1151b8);}(_0xd627,0x112));var _0x7d62=function(_0x1529a3,_0x529f63){_0x1529a3=_0x1529a3-0x0;var _0x1a0d4b=_0xd627[_0x1529a3];return _0x1a0d4b;};'use strict';var _=require(_0x7d62('0x0'));var util=require(_0x7d62('0x1'));var logger=require(_0x7d62('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7d62('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d62('0x4'));var rimraf=require(_0x7d62('0x5'));var config=require('../../config/environment');var attributes=require(_0x7d62('0x6'));module['exports']=function(_0x16fd7d,_0x4905fe){return _0x16fd7d['define'](_0x7d62('0x7'),attributes,{'tableName':_0x7d62('0x8'),'paranoid':![],'indexes':[{'name':_0x7d62('0x9'),'fields':[_0x7d62('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 76b47bb..a92cab5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39ef=['jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x217a3d,_0x49a7b9){var _0x39cf2a=function(_0x46865b){while(--_0x46865b){_0x217a3d['push'](_0x217a3d['shift']());}};_0x39cf2a(++_0x49a7b9);}(_0x39ef,0x1dc));var _0xf39e=function(_0x1ee477,_0xe2f0a2){_0x1ee477=_0x1ee477-0x0;var _0x33ce18=_0x39ef[_0x1ee477];return _0x33ce18;};'use strict';var _=require(_0xf39e('0x0'));var util=require('util');var moment=require(_0xf39e('0x1'));var BPromise=require('bluebird');var rs=require(_0xf39e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf39e('0x3'))['db'];var utils=require(_0xf39e('0x4'));var logger=require(_0xf39e('0x5'))(_0xf39e('0x6'));var config=require('../../config/environment');var jayson=require(_0xf39e('0x7'));var client=jayson[_0xf39e('0x8')][_0xf39e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2eda56,_0x3a4f60,_0x13afa7){return new BPromise(function(_0x32b0f3,_0x2efd97){return client[_0xf39e('0xa')](_0x2eda56,_0x13afa7)['then'](function(_0x120397){logger[_0xf39e('0xb')](_0xf39e('0xc'),_0x3a4f60,_0xf39e('0xd'));logger[_0xf39e('0xe')](_0xf39e('0xf'),_0x3a4f60,_0xf39e('0xd'),JSON[_0xf39e('0x10')](_0x120397));if(_0x120397[_0xf39e('0x11')]){if(_0x120397[_0xf39e('0x11')][_0xf39e('0x12')]===0x1f4){logger[_0xf39e('0x11')](_0xf39e('0xc'),_0x3a4f60,_0x120397[_0xf39e('0x11')]['message']);return _0x2efd97(_0x120397[_0xf39e('0x11')][_0xf39e('0x13')]);}logger['error'](_0xf39e('0xc'),_0x3a4f60,_0x120397[_0xf39e('0x11')][_0xf39e('0x13')]);return _0x32b0f3(_0x120397[_0xf39e('0x11')][_0xf39e('0x13')]);}else{logger[_0xf39e('0xb')](_0xf39e('0xc'),_0x3a4f60,'request\x20sent');_0x32b0f3(_0x120397[_0xf39e('0x14')][_0xf39e('0x13')]);}})['catch'](function(_0x4d72fa){logger['error'](_0xf39e('0xc'),_0x3a4f60,_0x4d72fa);_0x2efd97(_0x4d72fa);});});}
\ No newline at end of file
+var _0x291d=['error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3c10ec,_0xc9b9fd){var _0x48a8f2=function(_0x39be7d){while(--_0x39be7d){_0x3c10ec['push'](_0x3c10ec['shift']());}};_0x48a8f2(++_0xc9b9fd);}(_0x291d,0x144));var _0xd291=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x291d[_0x33032e];return _0x13316b;};'use strict';var _=require(_0xd291('0x0'));var util=require(_0xd291('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd291('0x2'));var fs=require('fs');var Redis=require(_0xd291('0x3'));var db=require(_0xd291('0x4'))['db'];var utils=require(_0xd291('0x5'));var logger=require(_0xd291('0x6'))(_0xd291('0x7'));var config=require(_0xd291('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd291('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2126b,_0x59b7d8,_0x230898){return new BPromise(function(_0x591c32,_0x1a982b){return client['request'](_0x2126b,_0x230898)[_0xd291('0xa')](function(_0x2540a3){logger[_0xd291('0xb')](_0xd291('0xc'),_0x59b7d8,_0xd291('0xd'));logger[_0xd291('0xe')](_0xd291('0xf'),_0x59b7d8,_0xd291('0xd'),JSON['stringify'](_0x2540a3));if(_0x2540a3[_0xd291('0x10')]){if(_0x2540a3[_0xd291('0x10')]['code']===0x1f4){logger[_0xd291('0x10')](_0xd291('0xc'),_0x59b7d8,_0x2540a3[_0xd291('0x10')][_0xd291('0x11')]);return _0x1a982b(_0x2540a3[_0xd291('0x10')]['message']);}logger[_0xd291('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x59b7d8,_0x2540a3[_0xd291('0x10')]['message']);return _0x591c32(_0x2540a3[_0xd291('0x10')][_0xd291('0x11')]);}else{logger[_0xd291('0xb')](_0xd291('0xc'),_0x59b7d8,_0xd291('0xd'));_0x591c32(_0x2540a3[_0xd291('0x12')][_0xd291('0x11')]);}})[_0xd291('0x13')](function(_0xd38fd4){logger[_0xd291('0x10')](_0xd291('0xc'),_0x59b7d8,_0xd38fd4);_0x1a982b(_0xd38fd4);});});}
\ No newline at end of file
index 3c27eca..34879fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1457=['start','Online\x20apps:','filter','online','name','join','Offline\x20apps:','map','status','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','info'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x1457,0x1b1));var _0x7145=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x1457[_0x3da832];return _0xe602f2;};'use strict';var _=require(_0x7145('0x0'));var mysqldb=require(_0x7145('0x1'));var rpc=require(_0x7145('0x2'));var config=require(_0x7145('0x3'));var logger=require(_0x7145('0x4'))(_0x7145('0x5'));var pm2=require(_0x7145('0x6'));var pm2Config=require(_0x7145('0x7'));var schedule=require('./config/schedule');var chat=require(_0x7145('0x8'));var whatsapp=require(_0x7145('0x9'));var transcribe=require(_0x7145('0xa'));function main(){return mysqldb['db'][_0x7145('0xb')][_0x7145('0xc')]()[_0x7145('0xd')](function(){return rpc['listen']();})[_0x7145('0xd')](function(_0x4f1cef){logger[_0x7145('0xe')](_0x4f1cef);return chat['start']();})[_0x7145('0xd')](function(){return whatsapp[_0x7145('0xf')]();})['then'](function(){return schedule[_0x7145('0xf')]();})[_0x7145('0xd')](function(){return transcribe['start']();})['then'](function(_0x74c76f){logger[_0x7145('0xe')](_0x74c76f);return pm2[_0x7145('0xf')](pm2Config);})[_0x7145('0xd')](function(_0x5a0d02){logger[_0x7145('0xe')](_0x7145('0x10'),_['map'](_[_0x7145('0x11')](_0x5a0d02,{'status':_0x7145('0x12')}),_0x7145('0x13'))[_0x7145('0x14')]());logger[_0x7145('0xe')](_0x7145('0x15'),_[_0x7145('0x16')](_[_0x7145('0x11')](_0x5a0d02,function(_0x30e586){return _0x30e586[_0x7145('0x17')]!==_0x7145('0x12');}),_0x7145('0x13'))[_0x7145('0x14')]()||'None');config[_0x7145('0x18')]&&require(_0x7145('0x19'))[_0x7145('0x1a')]();require(_0x7145('0x1b'))[_0x7145('0x1a')]();})[_0x7145('0x1c')](function(_0x3bfed0){logger[_0x7145('0x1d')](_0x7145('0x1e'),_0x3bfed0);process[_0x7145('0x1f')](0x1);});}main();
\ No newline at end of file
+var _0xdcc7=['then','start','info','Online\x20apps:','map','filter','online','name','Offline\x20apps:','join','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','./config/pm2','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','listen'];(function(_0x4ec636,_0x5a6a4d){var _0x5b6ef4=function(_0x1e5dbf){while(--_0x1e5dbf){_0x4ec636['push'](_0x4ec636['shift']());}};_0x5b6ef4(++_0x5a6a4d);}(_0xdcc7,0x129));var _0x7dcc=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xdcc7[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x7dcc('0x0'));var mysqldb=require(_0x7dcc('0x1'));var rpc=require(_0x7dcc('0x2'));var config=require(_0x7dcc('0x3'));var logger=require('./config/logger')('app');var pm2=require(_0x7dcc('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x7dcc('0x5'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x7dcc('0x6'));var transcribe=require(_0x7dcc('0x7'));function main(){return mysqldb['db'][_0x7dcc('0x8')][_0x7dcc('0x9')]()['then'](function(){return rpc[_0x7dcc('0xa')]();})[_0x7dcc('0xb')](function(_0x4c770e){logger['info'](_0x4c770e);return chat[_0x7dcc('0xc')]();})['then'](function(){return whatsapp['start']();})['then'](function(){return schedule['start']();})[_0x7dcc('0xb')](function(){return transcribe['start']();})[_0x7dcc('0xb')](function(_0x2153b2){logger[_0x7dcc('0xd')](_0x2153b2);return pm2[_0x7dcc('0xc')](pm2Config);})[_0x7dcc('0xb')](function(_0x5998e5){logger[_0x7dcc('0xd')](_0x7dcc('0xe'),_[_0x7dcc('0xf')](_[_0x7dcc('0x10')](_0x5998e5,{'status':_0x7dcc('0x11')}),_0x7dcc('0x12'))['join']());logger[_0x7dcc('0xd')](_0x7dcc('0x13'),_[_0x7dcc('0xf')](_[_0x7dcc('0x10')](_0x5998e5,function(_0x2dcade){return _0x2dcade['status']!=='online';}),_0x7dcc('0x12'))[_0x7dcc('0x14')]()||'None');config[_0x7dcc('0x15')]&&require(_0x7dcc('0x16'))[_0x7dcc('0x17')]();require(_0x7dcc('0x18'))[_0x7dcc('0x17')]();})[_0x7dcc('0x19')](function(_0x519778){logger[_0x7dcc('0x1a')](_0x7dcc('0x1b'),_0x519778);process['exit'](0x1);});}main();
\ No newline at end of file
index 4e075e2..f02245f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c9b=['Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','find','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','split','length','splice','unshift','encryptString','join','promisify','sign','secret','payload','verify','randomBytes','toString','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','express-jwt','crypto','bluebird','util','moment','secrets','session','role','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','unmanaged','json','Forbidden.','catch','headers','authorization','User','name','then','authenticate','pass','status','Wrong\x20credentials.','startsWith','Bearer','query','getUuid','apikey','sub','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','disabled','blocked','blockedAt'];(function(_0x2a9f4,_0x25c14a){var _0x3c39e0=function(_0x3b8deb){while(--_0x3b8deb){_0x2a9f4['push'](_0x2a9f4['shift']());}};_0x3c39e0(++_0x25c14a);}(_0x6c9b,0x123));var _0xb6c9=function(_0x4fed0e,_0x3e91f9){_0x4fed0e=_0x4fed0e-0x0;var _0x1302bc=_0x6c9b[_0x4fed0e];return _0x1302bc;};'use strict';var db=require(_0xb6c9('0x0'))['db'];var config=require(_0xb6c9('0x1'));var hardwareConf=require(_0xb6c9('0x2'));var licenseUtil=require(_0xb6c9('0x3'));var encryptor=require(_0xb6c9('0x4'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0xb6c9('0x5'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0xb6c9('0x6'));var BPromise=require(_0xb6c9('0x7'));var util=require(_0xb6c9('0x8'));var moment=require(_0xb6c9('0x9'));var validateJwt=expressJwt({'secret':config[_0xb6c9('0xa')][_0xb6c9('0xb')]});var userAttributes=['id',_0xb6c9('0xc'),'fullname','name',_0xb6c9('0xd'),_0xb6c9('0xe'),'userpic',_0xb6c9('0xf'),_0xb6c9('0x10'),_0xb6c9('0x11'),_0xb6c9('0x12'),_0xb6c9('0x13'),_0xb6c9('0x14'),_0xb6c9('0x15'),_0xb6c9('0x16'),_0xb6c9('0x17'),_0xb6c9('0x18'),_0xb6c9('0x19'),_0xb6c9('0x1a'),'crudPermissions',_0xb6c9('0x1b'),_0xb6c9('0x1c'),'alias',_0xb6c9('0x1d'),_0xb6c9('0x1e'),_0xb6c9('0x1f'),_0xb6c9('0x20'),'phoneBarEnableDtmfTone',_0xb6c9('0x21'),_0xb6c9('0x22'),'phoneBarPrefixRequired',_0xb6c9('0x23'),_0xb6c9('0x24'),'hotdesk',_0xb6c9('0x25'),'userProfileId',_0xb6c9('0x26'),_0xb6c9('0x27'),_0xb6c9('0x28'),_0xb6c9('0x29'),_0xb6c9('0x2a'),'downloadAttachments'];exports[_0xb6c9('0x2b')]=function(){return this[_0xb6c9('0x2c')](!![])[_0xb6c9('0x2d')](function(_0x41ec60,_0x3118b7,_0xead417){if(_0x41ec60[_0xb6c9('0x2e')]){_0xead417();}else{return db[_0xb6c9('0x2f')][_0xb6c9('0x30')]({'where':{'id':_0x41ec60[_0xb6c9('0x31')]['id']},'attributes':['id',_0xb6c9('0x32'),_0xb6c9('0x33')],'raw':!![]})['then'](function(_0x3d7aa2){if(_0x3d7aa2&&_0x3d7aa2[_0xb6c9('0x32')]){return _0x3118b7['status'](_0x3d7aa2[_0xb6c9('0x33')]===_0xb6c9('0x34')?0x195:0x193)[_0xb6c9('0x35')]({'message':_0x3d7aa2[_0xb6c9('0x33')]===_0xb6c9('0x34')?'Unmanaged.':_0xb6c9('0x36')});}else{_0xead417();}})[_0xb6c9('0x37')](function(_0x4a83de){_0xead417(_0x4a83de);});}});};exports[_0xb6c9('0x2c')]=function isAuthenticated(_0x1ea226){return compose()[_0xb6c9('0x2d')](function(_0x984150,_0x35a954,_0x2ba4dc){var _0x4dd43e;if(_0x984150['headers']['authorization']){if(_['startsWith'](_0x984150[_0xb6c9('0x38')][_0xb6c9('0x39')],'Basic')){var _0x2a21b8=basicAuth(_0x984150);db[_0xb6c9('0x3a')]['find']({'where':{'name':_0x2a21b8[_0xb6c9('0x3b')]}})[_0xb6c9('0x3c')](function(_0x177617){if(!_0x177617||!_0x177617[_0xb6c9('0x3d')](_0x2a21b8[_0xb6c9('0x3e')])){return _0x35a954[_0xb6c9('0x3f')](0x191)[_0xb6c9('0x35')]({'message':_0xb6c9('0x40')});}_0x984150[_0xb6c9('0x2e')]={'id':_0x177617['id']};_0x2ba4dc();})[_0xb6c9('0x37')](function(_0x5883b8){_0x2ba4dc(_0x5883b8);});}else if(_[_0xb6c9('0x41')](_0x984150['headers']['authorization'],_0xb6c9('0x42'))){validateJwt(_0x984150,_0x35a954,_0x2ba4dc);}else{if(_0x1ea226){_0x2ba4dc();}else{return _0x35a954[_0xb6c9('0x3f')](0x193)[_0xb6c9('0x35')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x984150[_0xb6c9('0x43')]['apikey']){try{var _0x3292df={'audience':hardwareConf[_0xb6c9('0x44')](),'issuer':hardwareConf[_0xb6c9('0x44')]()};verifyJwt(_0x984150[_0xb6c9('0x43')][_0xb6c9('0x45')],_0x3292df)[_0xb6c9('0x3c')](function(_0x5a6bc4){return db['User']['find']({'where':{'id':_0x5a6bc4[_0xb6c9('0x46')]}})['then'](function(_0x53c8c4){_0x4dd43e=_0x53c8c4;return db['Setting'][_0xb6c9('0x30')]({'where':{'id':0x1},'attributes':[_0xb6c9('0x47'),_0xb6c9('0x48')],'raw':!![]});})[_0xb6c9('0x3c')](function(_0x1f686e){if(!_0x4dd43e||!_[_0xb6c9('0x49')](_0x4dd43e[_0xb6c9('0x4a')],_0x5a6bc4['nonce'])){return _0x35a954[_0xb6c9('0x3f')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x4dd43e[_0xb6c9('0x4b')]){return _0x35a954[_0xb6c9('0x3f')](0x191)[_0xb6c9('0x35')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x4dd43e[_0xb6c9('0x4c')]){if(_0x1f686e[_0xb6c9('0x48')]>0x0){if(moment(_0x4dd43e[_0xb6c9('0x4d')])['add'](_0x1f686e[_0xb6c9('0x48')],'minutes')>moment()){return _0x35a954['status'](0x191)['json']({'message':_0xb6c9('0x4e')});}}else{return _0x35a954[_0xb6c9('0x3f')](0x191)[_0xb6c9('0x35')]({'message':_0xb6c9('0x4e')});}}_0x984150[_0xb6c9('0x2e')]={'id':_0x4dd43e['id']};_0x2ba4dc();});})[_0xb6c9('0x37')](function(){return _0x35a954[_0xb6c9('0x3f')](0x191)[_0xb6c9('0x35')]({'message':_0xb6c9('0x4e')});});}catch(_0x44293f){_0x2ba4dc(_0x44293f);}}else if(_0x1ea226){_0x2ba4dc();}else{return _0x35a954[_0xb6c9('0x3f')](0x193)[_0xb6c9('0x35')]({'message':_0xb6c9('0x4f')});}})[_0xb6c9('0x2d')](function(_0xba11f3,_0x5f2a24,_0x488a34){if(_0xba11f3[_0xb6c9('0x2e')]){db[_0xb6c9('0x3a')][_0xb6c9('0x50')]({'where':{'id':_0xba11f3[_0xb6c9('0x2e')]['id']},'attributes':userAttributes})['then'](function(_0xa3d4f6){if(!_0xa3d4f6){return _0x5f2a24[_0xb6c9('0x3f')](0x194)[_0xb6c9('0x35')]({'message':_0xb6c9('0x51')});}_0xba11f3[_0xb6c9('0x2e')]=_0xa3d4f6;_0x488a34();})[_0xb6c9('0x37')](function(_0xb22189){_0x488a34(_0xb22189);});}else if(_0x1ea226){_0x488a34();}else{return _0x5f2a24['status'](0x194)[_0xb6c9('0x35')]({'message':_0xb6c9('0x52')});}});};exports[_0xb6c9('0x53')]=function canUpdate(){return compose()[_0xb6c9('0x2d')](function(_0x479bf7,_0x2f6259,_0x567094){return licenseUtil[_0xb6c9('0x54')]()[_0xb6c9('0x3c')](function(_0x50410c){if(_0x50410c[_0xb6c9('0x55')]){_0x567094();}else{return _0x2f6259[_0xb6c9('0x3f')](0x193)['json']({'message':_0xb6c9('0x56')});}})[_0xb6c9('0x37')](function(_0x5c0e48){_0x567094(_0x5c0e48);});});};exports[_0xb6c9('0x57')]=function(_0x12e170,_0x354329,_0x3abee2){_0x12e170[_0xb6c9('0x57')]=!![];return _0x3abee2();};exports[_0xb6c9('0x58')]=function signToken(_0x1dabfb){return signJwt(_0x1dabfb);};exports[_0xb6c9('0x59')]=function(_0x4178b5,_0x2679d3){if(!_0x4178b5['user']){return _0x2679d3[_0xb6c9('0x3f')](0x194)[_0xb6c9('0x35')]({'message':_0xb6c9('0x5a')});}var _0x4094e6={'payload':{'id':_0x4178b5[_0xb6c9('0x2e')]['id'],'role':_0x4178b5[_0xb6c9('0x2e')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x4094e6)[_0xb6c9('0x3c')](function(_0x35513e){_0x2679d3[_0xb6c9('0x5b')](_0xb6c9('0x5c'),_0x35513e);_0x2679d3['redirect'](_0xb6c9('0x5d'));})['catch'](function(_0x957096){return _0x2679d3[_0xb6c9('0x3f')](0x1f4)[_0xb6c9('0x5e')](_0x957096);});};exports['retrieveApiKey']=function(_0x31920a){if(_[_0xb6c9('0x5f')](_0x31920a[_0xb6c9('0x4a')])||_[_0xb6c9('0x5f')](_0x31920a[_0xb6c9('0x60')])){return null;}else{return createJwt(_0x31920a);}};exports['generateApiKey']=function(_0x5b8c5e){_0x5b8c5e[_0xb6c9('0x4a')]=generateNonce();_0x5b8c5e[_0xb6c9('0x60')]=generateIssuedAt();return createJwt(_0x5b8c5e);};exports[_0xb6c9('0x61')]=function(_0x11cc7f,_0x3b4353){var _0x166c02=_0x11cc7f[_0xb6c9('0x43')][_0xb6c9('0x45')];if(_0x166c02){var _0x1b85c6={'nonce':_0x3b4353[_0xb6c9('0x4a')],'iat':_0x3b4353['apiKeyIat'],'audience':hardwareConf[_0xb6c9('0x44')](),'issuer':hardwareConf[_0xb6c9('0x44')]()};return verifyJwt(_0x166c02,_0x1b85c6)[_0xb6c9('0x3c')](function(){return generateApiKey(_0x3b4353);});}else{throw{'message':_0xb6c9('0x62')};}};exports[_0xb6c9('0x63')]=function(_0x398238){var _0x476fd7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x476fd7[_0xb6c9('0x64')](_0x398238))throw new db[(_0xb6c9('0x65'))]['ValidationError'](_0xb6c9('0x66'));return;};exports['validatePasswordHistory']=function(_0x464efb,_0x1f9e9b,_0xd8828b){var _0x373903=encryptor[_0xb6c9('0x67')](_0x1f9e9b)['split'](',');for(var _0xb029db=0x0;_0xb029db<_0xd8828b;_0xb029db++){if(!_0x373903[_0xb029db])break;if(_0x464efb[_0xb6c9('0x68')]()===_0x373903[_0xb029db][_0xb6c9('0x68')]()){var _0x169b13=util[_0xb6c9('0x69')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0xd8828b);if(_0xd8828b===0x1){_0x169b13=_0xb6c9('0x6a');}throw new db[(_0xb6c9('0x65'))][(_0xb6c9('0x6b'))](_0x169b13);}}return;};exports['updatePasswordsHistory']=function(_0x36b9af,_0x591cce){var _0x35a47d=_0x591cce?encryptor[_0xb6c9('0x67')](_0x591cce)[_0xb6c9('0x6c')](','):[];if(_0x35a47d[_0xb6c9('0x6d')]===0x5){_0x35a47d[_0xb6c9('0x6e')](-0x1,0x1);}_0x35a47d[_0xb6c9('0x6f')](_0x36b9af);return encryptor[_0xb6c9('0x70')](_0x35a47d[_0xb6c9('0x71')](','));};function signJwt(_0x42bee6){var _0xb8d3fd=BPromise[_0xb6c9('0x72')](jwt[_0xb6c9('0x73')],{'context':jwt});var _0x212be3=_0x42bee6[_0xb6c9('0x74')]||config[_0xb6c9('0xa')][_0xb6c9('0xb')];return new BPromise(function(_0x73853f,_0x754ad){_0xb8d3fd(_0x42bee6[_0xb6c9('0x75')],_0x212be3,_0x42bee6['options'])['then'](function(_0x317127){_0x73853f(_0x317127);})[_0xb6c9('0x37')](function(_0x261e28){_0x754ad(_0x261e28);});});}function verifyJwt(_0xf14146,_0x3d2dca,_0x4842f){var _0x1dc4d6=BPromise['promisify'](jwt[_0xb6c9('0x76')],{'context':jwt});var _0x52e502=_0x4842f||config[_0xb6c9('0xa')]['session'];return new BPromise(function(_0x2f7827,_0x526557){_0x1dc4d6(_0xf14146,_0x52e502,_0x3d2dca)['then'](function(_0x32ac42){_0x2f7827(_0x32ac42);})[_0xb6c9('0x37')](function(_0x3464cb){_0x526557(_0x3464cb);});});}function generateNonce(){return crypto[_0xb6c9('0x77')](0x10)[_0xb6c9('0x78')]('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xb6c9('0x79')]()/0x3e8)[_0xb6c9('0x78')]();}function createJwt(_0x32f8b5){var _0x5561ed={'payload':{'iat':_0x32f8b5[_0xb6c9('0x60')],'nonce':_0x32f8b5[_0xb6c9('0x4a')]},'options':{'algorithm':_0xb6c9('0x7a'),'subject':_0x32f8b5['id'][_0xb6c9('0x78')](),'issuer':hardwareConf[_0xb6c9('0x44')](),'audience':hardwareConf[_0xb6c9('0x44')]()}};return signJwt(_0x5561ed)[_0xb6c9('0x3c')](function(_0x1020a5){return{'iat':_0x32f8b5[_0xb6c9('0x60')],'nonce':_0x32f8b5['apiKeyNonce'],'token':_0x1020a5};});}
\ No newline at end of file
+var _0x3695=['blockedAt','add','minutes','Invalid\x20API\x20access\x20key','user','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','isMiddleware','signToken','setTokenCookie','role','motion.token','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','join','promisify','sign','secret','secrets','payload','options','verify','randomBytes','toString','hex','floor','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','composable-middleware','bluebird','util','moment','session','internal','email','userpic','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','ChatInteraction','findOne','closed','disposition','then','unmanaged','Unmanaged.','Forbidden.','catch','use','headers','authorization','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','startsWith','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','isEqual','apiKeyNonce','nonce','json','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockDuration'];(function(_0x59fa35,_0x4bfa26){var _0x4ad2f6=function(_0x55b01b){while(--_0x55b01b){_0x59fa35['push'](_0x59fa35['shift']());}};_0x4ad2f6(++_0x4bfa26);}(_0x3695,0x128));var _0x5369=function(_0x232ee9,_0x1e842a){_0x232ee9=_0x232ee9-0x0;var _0x328135=_0x3695[_0x232ee9];return _0x328135;};'use strict';var db=require(_0x5369('0x0'))['db'];var config=require(_0x5369('0x1'));var hardwareConf=require(_0x5369('0x2'));var licenseUtil=require(_0x5369('0x3'));var encryptor=require(_0x5369('0x4'));var _=require('lodash');var jwt=require(_0x5369('0x5'));var expressJwt=require('express-jwt');var compose=require(_0x5369('0x6'));var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require(_0x5369('0x7'));var util=require(_0x5369('0x8'));var moment=require(_0x5369('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0x5369('0xa')]});var userAttributes=['id','role','fullname','name',_0x5369('0xb'),_0x5369('0xc'),_0x5369('0xd'),'permissions','md5secret',_0x5369('0xe'),_0x5369('0xf'),_0x5369('0x10'),'faxPause',_0x5369('0x11'),_0x5369('0x12'),_0x5369('0x13'),_0x5369('0x14'),_0x5369('0x15'),_0x5369('0x16'),_0x5369('0x17'),_0x5369('0x18'),'passwordResetAt',_0x5369('0x19'),_0x5369('0x1a'),'phoneBarAutoAnswerDelay',_0x5369('0x1b'),_0x5369('0x1c'),_0x5369('0x1d'),_0x5369('0x1e'),_0x5369('0x1f'),_0x5369('0x20'),_0x5369('0x21'),_0x5369('0x22'),_0x5369('0x23'),_0x5369('0x24'),_0x5369('0x25'),'privacyEnabled',_0x5369('0x26'),_0x5369('0x27'),'downloadVoiceRecordings',_0x5369('0x28'),_0x5369('0x29')];exports[_0x5369('0x2a')]=function(){return this['isAuthenticated'](!![])['use'](function(_0x1ba34c,_0x4d2715,_0x126d2a){if(_0x1ba34c['user']){_0x126d2a();}else{return db[_0x5369('0x2b')][_0x5369('0x2c')]({'where':{'id':_0x1ba34c['params']['id']},'attributes':['id',_0x5369('0x2d'),_0x5369('0x2e')],'raw':!![]})[_0x5369('0x2f')](function(_0x2dbb59){if(_0x2dbb59&&_0x2dbb59[_0x5369('0x2d')]){return _0x4d2715['status'](_0x2dbb59[_0x5369('0x2e')]===_0x5369('0x30')?0x195:0x193)['json']({'message':_0x2dbb59[_0x5369('0x2e')]===_0x5369('0x30')?_0x5369('0x31'):_0x5369('0x32')});}else{_0x126d2a();}})[_0x5369('0x33')](function(_0x462f55){_0x126d2a(_0x462f55);});}});};exports['isAuthenticated']=function isAuthenticated(_0x5572c1){return compose()[_0x5369('0x34')](function(_0x59e848,_0x3284cf,_0x3ec283){var _0x5634b5;if(_0x59e848[_0x5369('0x35')][_0x5369('0x36')]){if(_['startsWith'](_0x59e848[_0x5369('0x35')]['authorization'],_0x5369('0x37'))){var _0x4a5dbd=basicAuth(_0x59e848);db[_0x5369('0x38')][_0x5369('0x39')]({'where':{'name':_0x4a5dbd['name']}})['then'](function(_0x53663a){if(!_0x53663a||!_0x53663a[_0x5369('0x3a')](_0x4a5dbd[_0x5369('0x3b')])){return _0x3284cf[_0x5369('0x3c')](0x191)['json']({'message':_0x5369('0x3d')});}_0x59e848['user']={'id':_0x53663a['id']};_0x3ec283();})['catch'](function(_0xfaf6a1){_0x3ec283(_0xfaf6a1);});}else if(_[_0x5369('0x3e')](_0x59e848[_0x5369('0x35')]['authorization'],'Bearer')){validateJwt(_0x59e848,_0x3284cf,_0x3ec283);}else{if(_0x5572c1){_0x3ec283();}else{return _0x3284cf[_0x5369('0x3c')](0x193)['json']({'message':_0x5369('0x3f')});}}}else if(_0x59e848[_0x5369('0x40')][_0x5369('0x41')]){try{var _0x3d21b5={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x5369('0x42')]()};verifyJwt(_0x59e848[_0x5369('0x40')][_0x5369('0x41')],_0x3d21b5)[_0x5369('0x2f')](function(_0x181981){return db[_0x5369('0x38')][_0x5369('0x39')]({'where':{'id':_0x181981[_0x5369('0x43')]}})[_0x5369('0x2f')](function(_0x6ccb0c){_0x5634b5=_0x6ccb0c;return db['Setting'][_0x5369('0x2c')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})[_0x5369('0x2f')](function(_0x8984ab){if(!_0x5634b5||!_[_0x5369('0x44')](_0x5634b5[_0x5369('0x45')],_0x181981[_0x5369('0x46')])){return _0x3284cf[_0x5369('0x3c')](0x191)[_0x5369('0x47')]({'message':_0x5369('0x48')});}if(_0x5634b5[_0x5369('0x49')]){return _0x3284cf[_0x5369('0x3c')](0x191)[_0x5369('0x47')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x5634b5[_0x5369('0x4a')]){if(_0x8984ab[_0x5369('0x4b')]>0x0){if(moment(_0x5634b5[_0x5369('0x4c')])[_0x5369('0x4d')](_0x8984ab[_0x5369('0x4b')],_0x5369('0x4e'))>moment()){return _0x3284cf['status'](0x191)[_0x5369('0x47')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x3284cf[_0x5369('0x3c')](0x191)['json']({'message':_0x5369('0x4f')});}}_0x59e848[_0x5369('0x50')]={'id':_0x5634b5['id']};_0x3ec283();});})['catch'](function(){return _0x3284cf[_0x5369('0x3c')](0x191)['json']({'message':_0x5369('0x4f')});});}catch(_0x167f51){_0x3ec283(_0x167f51);}}else if(_0x5572c1){_0x3ec283();}else{return _0x3284cf[_0x5369('0x3c')](0x193)[_0x5369('0x47')]({'message':_0x5369('0x3f')});}})[_0x5369('0x34')](function(_0x188b13,_0x14e5a5,_0x101399){if(_0x188b13['user']){db[_0x5369('0x38')][_0x5369('0x39')]({'where':{'id':_0x188b13[_0x5369('0x50')]['id']},'attributes':userAttributes})[_0x5369('0x2f')](function(_0x6842ae){if(!_0x6842ae){return _0x14e5a5[_0x5369('0x3c')](0x194)[_0x5369('0x47')]({'message':_0x5369('0x51')});}_0x188b13['user']=_0x6842ae;_0x101399();})['catch'](function(_0x4d5661){_0x101399(_0x4d5661);});}else if(_0x5572c1){_0x101399();}else{return _0x14e5a5[_0x5369('0x3c')](0x194)[_0x5369('0x47')]({'message':_0x5369('0x52')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x5369('0x34')](function(_0x23a126,_0x3f5303,_0x530035){return licenseUtil[_0x5369('0x53')]()[_0x5369('0x2f')](function(_0x4fe90d){if(_0x4fe90d[_0x5369('0x54')]){_0x530035();}else{return _0x3f5303[_0x5369('0x3c')](0x193)[_0x5369('0x47')]({'message':'Forbidden'});}})[_0x5369('0x33')](function(_0x46f6be){_0x530035(_0x46f6be);});});};exports[_0x5369('0x55')]=function(_0x39efcf,_0x2cc4f4,_0x2ec114){_0x39efcf['isMiddleware']=!![];return _0x2ec114();};exports[_0x5369('0x56')]=function signToken(_0x18e2b2){return signJwt(_0x18e2b2);};exports[_0x5369('0x57')]=function(_0x39bfd5,_0x3921f9){if(!_0x39bfd5['user']){return _0x3921f9[_0x5369('0x3c')](0x194)[_0x5369('0x47')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x25a055={'payload':{'id':_0x39bfd5[_0x5369('0x50')]['id'],'role':_0x39bfd5['user'][_0x5369('0x58')]},'options':{'expiresIn':0x15180}};return signJwt(_0x25a055)[_0x5369('0x2f')](function(_0x542134){_0x3921f9['cookie'](_0x5369('0x59'),_0x542134);_0x3921f9['redirect'](_0x5369('0x5a'));})[_0x5369('0x33')](function(_0x50c838){return _0x3921f9[_0x5369('0x3c')](0x1f4)['send'](_0x50c838);});};exports[_0x5369('0x5b')]=function(_0x44ac45){if(_[_0x5369('0x5c')](_0x44ac45[_0x5369('0x45')])||_['isNil'](_0x44ac45[_0x5369('0x5d')])){return null;}else{return createJwt(_0x44ac45);}};exports[_0x5369('0x5e')]=function(_0x3e3814){_0x3e3814[_0x5369('0x45')]=generateNonce();_0x3e3814[_0x5369('0x5d')]=generateIssuedAt();return createJwt(_0x3e3814);};exports['regenerateApiKey']=function(_0x1cbaee,_0x49ba92){var _0x131a77=_0x1cbaee['query'][_0x5369('0x41')];if(_0x131a77){var _0x5f2965={'nonce':_0x49ba92[_0x5369('0x45')],'iat':_0x49ba92[_0x5369('0x5d')],'audience':hardwareConf[_0x5369('0x42')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x131a77,_0x5f2965)[_0x5369('0x2f')](function(){return generateApiKey(_0x49ba92);});}else{throw{'message':_0x5369('0x5f')};}};exports[_0x5369('0x60')]=function(_0x4bef58){var _0x11c6c6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x11c6c6[_0x5369('0x61')](_0x4bef58))throw new db[(_0x5369('0x62'))][(_0x5369('0x63'))](_0x5369('0x64'));return;};exports[_0x5369('0x65')]=function(_0x3d5a3f,_0x584211,_0x2b1a85){var _0x505b18=encryptor[_0x5369('0x66')](_0x584211)[_0x5369('0x67')](',');for(var _0x24e002=0x0;_0x24e002<_0x2b1a85;_0x24e002++){if(!_0x505b18[_0x24e002])break;if(_0x3d5a3f[_0x5369('0x68')]()===_0x505b18[_0x24e002]['toLowerCase']()){var _0x5eb5af=util[_0x5369('0x69')](_0x5369('0x6a'),_0x2b1a85);if(_0x2b1a85===0x1){_0x5eb5af='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x5369('0x62'))]['ValidationError'](_0x5eb5af);}}return;};exports[_0x5369('0x6b')]=function(_0x2b89dd,_0x499844){var _0x36fea3=_0x499844?encryptor[_0x5369('0x66')](_0x499844)[_0x5369('0x67')](','):[];if(_0x36fea3[_0x5369('0x6c')]===0x5){_0x36fea3[_0x5369('0x6d')](-0x1,0x1);}_0x36fea3[_0x5369('0x6e')](_0x2b89dd);return encryptor['encryptString'](_0x36fea3[_0x5369('0x6f')](','));};function signJwt(_0x158216){var _0x224e9f=BPromise[_0x5369('0x70')](jwt[_0x5369('0x71')],{'context':jwt});var _0x33faa4=_0x158216[_0x5369('0x72')]||config[_0x5369('0x73')]['session'];return new BPromise(function(_0x56f395,_0x53ca6f){_0x224e9f(_0x158216[_0x5369('0x74')],_0x33faa4,_0x158216[_0x5369('0x75')])['then'](function(_0x536076){_0x56f395(_0x536076);})[_0x5369('0x33')](function(_0x3b62f8){_0x53ca6f(_0x3b62f8);});});}function verifyJwt(_0x448f2e,_0x1cde60,_0x4ab564){var _0x28ac74=BPromise[_0x5369('0x70')](jwt[_0x5369('0x76')],{'context':jwt});var _0x3efcf3=_0x4ab564||config['secrets'][_0x5369('0xa')];return new BPromise(function(_0x2ccf7c,_0x312a55){_0x28ac74(_0x448f2e,_0x3efcf3,_0x1cde60)[_0x5369('0x2f')](function(_0x375362){_0x2ccf7c(_0x375362);})[_0x5369('0x33')](function(_0x1fd043){_0x312a55(_0x1fd043);});});}function generateNonce(){return crypto[_0x5369('0x77')](0x10)[_0x5369('0x78')](_0x5369('0x79'));}function generateIssuedAt(){return Math[_0x5369('0x7a')](Date['now']()/0x3e8)[_0x5369('0x78')]();}function createJwt(_0x42a1b9){var _0x51b232={'payload':{'iat':_0x42a1b9[_0x5369('0x5d')],'nonce':_0x42a1b9[_0x5369('0x45')]},'options':{'algorithm':_0x5369('0x7b'),'subject':_0x42a1b9['id'][_0x5369('0x78')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x5369('0x42')]()}};return signJwt(_0x51b232)[_0x5369('0x2f')](function(_0x10c940){return{'iat':_0x42a1b9[_0x5369('0x5d')],'nonce':_0x42a1b9['apiKeyNonce'],'token':_0x10c940};});}
\ No newline at end of file
index b70c4a3..37a31fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfc4=['base64','decryptString','bluebird','lodash','../../config/environment','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createReadStream','createDecipher','encryptString','secret','utf8'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcfc4,0x1bc));var _0x4cfc=function(_0x35cbab,_0x3d430d){_0x35cbab=_0x35cbab-0x0;var _0x1d838d=_0xcfc4[_0x35cbab];return _0x1d838d;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x4cfc('0x0'));var _=require(_0x4cfc('0x1'));var config=require(_0x4cfc('0x2'));var logger=require('../../config/logger')(_0x4cfc('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4cfc('0x4')][_0x4cfc('0x5')],'algorithm':_0x4cfc('0x6')};const fileOptions={'algorithm':_0x4cfc('0x7')};if(config[_0x4cfc('0x8')]&&config[_0x4cfc('0x8')][_0x4cfc('0x9')]){var isSupported=isAlgorithmSupported(config[_0x4cfc('0x8')][_0x4cfc('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0x4cfc('0x8')][_0x4cfc('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x4cfc('0xa')](',\x20');logger['error'](config['encrypt'][_0x4cfc('0x9')],_0x4cfc('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x30f0d6){return AES_SUPPORTED_RX[_0x4cfc('0xc')](_0x30f0d6);}function getSupportedCiphers(){return crypto[_0x4cfc('0xd')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x3189a8){return getSupportedCiphers()['indexOf'](_0x3189a8)>-0x1;}function combineOptions(_0x5bf7b9){var _0x4ee9e6={};for(var _0x343c33 in fileOptions){if(fileOptions[_0x4cfc('0xe')](_0x343c33)){_0x4ee9e6[_0x343c33]=fileOptions[_0x343c33];}}if(_0x5bf7b9){for(var _0x2f8b9d in _0x5bf7b9){if(_0x5bf7b9['hasOwnProperty'](_0x2f8b9d)){_0x4ee9e6[_0x2f8b9d]=_0x5bf7b9[_0x2f8b9d];}}}return _0x4ee9e6;}exports[_0x4cfc('0xf')]=function(_0x514394,_0x4ad147,_0x14cece,_0x4bdf58){return new BPromise(function(_0x13876e,_0x36b987){_0x4bdf58=combineOptions(_0x4bdf58);var _0x46c30c=new Buffer(_0x14cece);var _0x1409d0=fs['createReadStream'](_0x514394);var _0x4c7039=fs[_0x4cfc('0x10')](_0x4ad147);var _0x4ac501=crypto[_0x4cfc('0x11')](_0x4bdf58[_0x4cfc('0x9')],_0x46c30c);_0x1409d0['on'](_0x4cfc('0x12'),function(_0x177233){var _0x2eaaa7=new Buffer(_0x4ac501[_0x4cfc('0x13')](_0x177233),_0x4cfc('0x14'));_0x4c7039[_0x4cfc('0x15')](_0x2eaaa7);});_0x1409d0['on'](_0x4cfc('0x16'),function(){try{var _0x565c20=new Buffer(_0x4ac501[_0x4cfc('0x17')](_0x4cfc('0x14')),_0x4cfc('0x14'));_0x4c7039[_0x4cfc('0x15')](_0x565c20);_0x4c7039['end']();_0x4c7039['on'](_0x4cfc('0x18'),function(){return _0x13876e(_0x4ad147);});}catch(_0x5d0b14){fs[_0x4cfc('0x19')](_0x4ad147);return _0x36b987(_0x5d0b14);}});});};exports[_0x4cfc('0x1a')]=function(_0x5a4478,_0x29ab66,_0x2f506f,_0x7ac681){return new BPromise(function(_0x2967fb,_0x67a722){_0x7ac681=combineOptions(_0x7ac681);var _0x177554=new Buffer(_0x2f506f);var _0x1caede=fs[_0x4cfc('0x1b')](_0x5a4478);var _0x3fbf34=fs[_0x4cfc('0x10')](_0x29ab66);var _0x412ded=crypto[_0x4cfc('0x1c')](_0x7ac681['algorithm'],_0x177554);_0x1caede['on'](_0x4cfc('0x12'),function(_0x45602b){var _0x13ea19=new Buffer(_0x412ded['update'](_0x45602b),_0x4cfc('0x14'));_0x3fbf34[_0x4cfc('0x15')](_0x13ea19);});_0x1caede['on'](_0x4cfc('0x16'),function(){try{var _0x5097b0=new Buffer(_0x412ded[_0x4cfc('0x17')](_0x4cfc('0x14')),_0x4cfc('0x14'));_0x3fbf34[_0x4cfc('0x15')](_0x5097b0);_0x3fbf34['end']();_0x3fbf34['on'](_0x4cfc('0x18'),function(){return _0x2967fb(_0x29ab66);});}catch(_0x3d6483){fs[_0x4cfc('0x19')](_0x29ab66);return _0x67a722(_0x3d6483);}});});};exports[_0x4cfc('0x1d')]=function(_0x3de042,_0x40e160,_0x4a6d2f){var _0x251267=_0x4a6d2f||stringOptions['algorithm'];var _0x421920=_0x40e160||stringOptions[_0x4cfc('0x1e')];var _0x1baddc=crypto[_0x4cfc('0x11')](_0x251267,_0x421920);var _0x58887c=_0x1baddc[_0x4cfc('0x13')](_0x3de042,_0x4cfc('0x1f'),_0x4cfc('0x20'));_0x58887c+=_0x1baddc['final'](_0x4cfc('0x20'));return _0x58887c;};exports[_0x4cfc('0x21')]=function(_0x4f9524,_0x4ba0c3,_0x1fa30c){var _0x370913=_0x1fa30c||stringOptions['algorithm'];var _0x40f7fa=_0x4ba0c3||stringOptions['secret'];var _0x143f1d=crypto[_0x4cfc('0x1c')](_0x370913,_0x40f7fa);var _0x12e918=_0x143f1d[_0x4cfc('0x13')](_0x4f9524,_0x4cfc('0x20'),'utf8');_0x12e918+=_0x143f1d[_0x4cfc('0x17')](_0x4cfc('0x1f'));return _0x12e918;};
\ No newline at end of file
+var _0xef54=['data','update','binary','write','end','close','unlink','decryptFile','createDecipher','final','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','../../config/environment','../../config/logger','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher'];(function(_0x3333a6,_0x2c1150){var _0x36f253=function(_0x277ca6){while(--_0x277ca6){_0x3333a6['push'](_0x3333a6['shift']());}};_0x36f253(++_0x2c1150);}(_0xef54,0x1dd));var _0x4ef5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xef54[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0x4ef5('0x0'));var fs=require('fs');var BPromise=require(_0x4ef5('0x1'));var _=require('lodash');var config=require(_0x4ef5('0x2'));var logger=require(_0x4ef5('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4ef5('0x4')]['session'],'algorithm':_0x4ef5('0x5')};const fileOptions={'algorithm':_0x4ef5('0x6')};if(config[_0x4ef5('0x7')]&&config['encrypt'][_0x4ef5('0x8')]){var isSupported=isAlgorithmSupported(config[_0x4ef5('0x7')]['algorithm']);if(isSupported){fileOptions[_0x4ef5('0x8')]=config['encrypt'][_0x4ef5('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x4ef5('0x9')](',\x20');logger['error'](config[_0x4ef5('0x7')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x25bda0){return AES_SUPPORTED_RX[_0x4ef5('0xa')](_0x25bda0);}function getSupportedCiphers(){return crypto[_0x4ef5('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x13e3ee){return getSupportedCiphers()[_0x4ef5('0xc')](_0x13e3ee)>-0x1;}function combineOptions(_0x190914){var _0x477c41={};for(var _0x554552 in fileOptions){if(fileOptions[_0x4ef5('0xd')](_0x554552)){_0x477c41[_0x554552]=fileOptions[_0x554552];}}if(_0x190914){for(var _0x460657 in _0x190914){if(_0x190914[_0x4ef5('0xd')](_0x460657)){_0x477c41[_0x460657]=_0x190914[_0x460657];}}}return _0x477c41;}exports[_0x4ef5('0xe')]=function(_0x24c782,_0x1883d0,_0x2e66c0,_0x167796){return new BPromise(function(_0x2cd801,_0x3eea16){_0x167796=combineOptions(_0x167796);var _0x59d4f1=new Buffer(_0x2e66c0);var _0x3a8121=fs[_0x4ef5('0xf')](_0x24c782);var _0x304374=fs[_0x4ef5('0x10')](_0x1883d0);var _0x252829=crypto[_0x4ef5('0x11')](_0x167796[_0x4ef5('0x8')],_0x59d4f1);_0x3a8121['on'](_0x4ef5('0x12'),function(_0x53c858){var _0x4cf183=new Buffer(_0x252829[_0x4ef5('0x13')](_0x53c858),_0x4ef5('0x14'));_0x304374[_0x4ef5('0x15')](_0x4cf183);});_0x3a8121['on'](_0x4ef5('0x16'),function(){try{var _0x5adf2d=new Buffer(_0x252829['final'](_0x4ef5('0x14')),_0x4ef5('0x14'));_0x304374[_0x4ef5('0x15')](_0x5adf2d);_0x304374[_0x4ef5('0x16')]();_0x304374['on'](_0x4ef5('0x17'),function(){return _0x2cd801(_0x1883d0);});}catch(_0x5fd7bb){fs[_0x4ef5('0x18')](_0x1883d0);return _0x3eea16(_0x5fd7bb);}});});};exports[_0x4ef5('0x19')]=function(_0x11d86a,_0x2cc9d8,_0x59581a,_0x94f157){return new BPromise(function(_0x1bca93,_0x562b5e){_0x94f157=combineOptions(_0x94f157);var _0x58ada9=new Buffer(_0x59581a);var _0x4e8de0=fs['createReadStream'](_0x11d86a);var _0x4bf304=fs['createWriteStream'](_0x2cc9d8);var _0x48a06a=crypto[_0x4ef5('0x1a')](_0x94f157[_0x4ef5('0x8')],_0x58ada9);_0x4e8de0['on']('data',function(_0x141d16){var _0x1541bf=new Buffer(_0x48a06a[_0x4ef5('0x13')](_0x141d16),_0x4ef5('0x14'));_0x4bf304['write'](_0x1541bf);});_0x4e8de0['on'](_0x4ef5('0x16'),function(){try{var _0x330c4d=new Buffer(_0x48a06a[_0x4ef5('0x1b')](_0x4ef5('0x14')),_0x4ef5('0x14'));_0x4bf304['write'](_0x330c4d);_0x4bf304['end']();_0x4bf304['on']('close',function(){return _0x1bca93(_0x2cc9d8);});}catch(_0xda1f84){fs['unlink'](_0x2cc9d8);return _0x562b5e(_0xda1f84);}});});};exports[_0x4ef5('0x1c')]=function(_0x4dcb63,_0x22f01e,_0x302f2a){var _0x1e9e3c=_0x302f2a||stringOptions[_0x4ef5('0x8')];var _0x2c906b=_0x22f01e||stringOptions[_0x4ef5('0x1d')];var _0x224f0b=crypto[_0x4ef5('0x11')](_0x1e9e3c,_0x2c906b);var _0x47c2da=_0x224f0b[_0x4ef5('0x13')](_0x4dcb63,_0x4ef5('0x1e'),_0x4ef5('0x1f'));_0x47c2da+=_0x224f0b['final'](_0x4ef5('0x1f'));return _0x47c2da;};exports[_0x4ef5('0x20')]=function(_0x188aad,_0x44abcd,_0x109fc8){var _0x53cf17=_0x109fc8||stringOptions[_0x4ef5('0x8')];var _0x47505e=_0x44abcd||stringOptions['secret'];var _0x268982=crypto[_0x4ef5('0x1a')](_0x53cf17,_0x47505e);var _0x1051a4=_0x268982[_0x4ef5('0x13')](_0x188aad,_0x4ef5('0x1f'),'utf8');_0x1051a4+=_0x268982[_0x4ef5('0x1b')](_0x4ef5('0x1e'));return _0x1051a4;};
\ No newline at end of file
index d7c2509..92231bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06d9=['CSV','find','splitSizeCsv','then','query','sequelize','QueryTypes','SELECT','num','Empty','split','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','length','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','zip\x20finished','info','Completed','inspect','Failed','finally','exit','util','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x76ab37,_0x11a4e4){var _0xbe65a8=function(_0xd340c0){while(--_0xd340c0){_0x76ab37['push'](_0x76ab37['shift']());}};_0xbe65a8(++_0x11a4e4);}(_0x06d9,0xd8));var _0x906d=function(_0x3071c5,_0x18fafe){_0x3071c5=_0x3071c5-0x0;var _0x4a403e=_0x06d9[_0x3071c5];return _0x4a403e;};'use strict';var util=require(_0x906d('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0x906d('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x906d('0x2'));var rimraf=require(_0x906d('0x3'));var db=require(_0x906d('0x4'))['db'];var dbH=require(_0x906d('0x4'))[_0x906d('0x5')];var logger=require(_0x906d('0x6'))(_0x906d('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x906d('0x8')][0x3];var PATH=process[_0x906d('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x14be06,_0x17791f){var _0x4af3ff={'status':_0x14be06};var _0x11c1b7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17791f){_0x4af3ff[_0x906d('0x9')]=_0x17791f;}return db[_0x906d('0xa')][_0x906d('0xb')](_0x4af3ff,_0x11c1b7);}function main(){var _0x429d31=0x1388;var _0x5a9dd5;logger['info'](util[_0x906d('0xc')](_0x906d('0xd'),EXTRACTED_REPORT_ID,_0x906d('0xe')));return db['Setting'][_0x906d('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x906d('0x10')]})[_0x906d('0x11')](function(_0x470c73){if(_0x470c73){_0x5a9dd5=_0x470c73;_0x429d31=_0x5a9dd5['splitSizeCsv']||0x1388;}})[_0x906d('0x11')](function(){return dbH['sequelize'][_0x906d('0x12')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x906d('0x13')][_0x906d('0x14')][_0x906d('0x15')]});})[_0x906d('0x11')](function(_0xedb752){if(!_0xedb752[0x0][_0x906d('0x16')]){return analyticExtractedReport(_0x906d('0x17'));}var _0x300347=[];var _0xd8ffdc=0x0;if(_0x5a9dd5[_0x906d('0x18')]){if(_0xedb752&&_0xedb752['length']){var _0x317652=_['range'](_0xedb752[0x0][_0x906d('0x16')]/_0x429d31);var _0x8c99b6=Number[_0x906d('0x19')](_0xedb752[0x0][_0x906d('0x16')]/_0x429d31)?_0xedb752[0x0][_0x906d('0x16')]%_0x429d31:0x0;_0x317652[_0x906d('0x1a')](function(_0x44fc43){if(_0x44fc43>0x0){_0xd8ffdc+=_0x429d31;}_0x300347[_0x906d('0x1b')](dbH[_0x906d('0x13')][_0x906d('0x12')](util[_0x906d('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x429d31,_0xd8ffdc),{'type':dbH['sequelize'][_0x906d('0x14')][_0x906d('0x15')]}));});if(_0x8c99b6>0x0){_0xd8ffdc+=_0x429d31;_0x300347[_0x906d('0x1b')](dbH[_0x906d('0x13')][_0x906d('0x12')](util[_0x906d('0xc')](_0x906d('0x1c'),QUERY,_0x8c99b6,_0xd8ffdc),{'type':dbH['sequelize'][_0x906d('0x14')][_0x906d('0x15')]}));}}}else{_0x300347['push'](dbH[_0x906d('0x13')]['query'](QUERY,{'type':dbH['sequelize'][_0x906d('0x14')][_0x906d('0x15')]}));}var _0x1ede4d=path['dirname'](PATH);var _0x493e25=path[_0x906d('0x1d')](PATH,'.csv');var _0x4cb987=_0x5a9dd5[_0x906d('0x18')]&&_0x300347[_0x906d('0x1e')]>0x1;var _0x29aaee=[];if(!fs[_0x906d('0x1f')](path[_0x906d('0x20')](_0x1ede4d,_0x493e25))&&_0x4cb987){fs[_0x906d('0x21')](path[_0x906d('0x20')](_0x1ede4d,_0x493e25));}return BPromise[_0x906d('0x22')](_0x300347,function(_0x47067d){_0x29aaee[_0x906d('0x1b')](_0x47067d);})[_0x906d('0x11')](function(){for(var _0x5b7cf0=0x0;_0x5b7cf0<_0x29aaee[_0x906d('0x1e')];_0x5b7cf0+=0x1){var _0x408226;var _0x2e43b9=_0x29aaee[_0x5b7cf0];if(_0x4cb987){_0x408226=path[_0x906d('0x20')](_0x1ede4d,_0x493e25,util[_0x906d('0xc')](_0x906d('0x23'),_0x493e25,_0x5b7cf0,_0x906d('0x24')));}else{_0x408226=path[_0x906d('0x20')](_0x1ede4d,util[_0x906d('0xc')]('%s.%s',_0x493e25,_0x906d('0x24')));}fs['writeFileSync'](_0x408226,csv(_0x2e43b9));}})[_0x906d('0x11')](function(){if(_0x4cb987){return new Promise(function(_0x26c254){zipdir(path[_0x906d('0x20')](_0x1ede4d,_0x493e25),{'saveTo':path[_0x906d('0x20')](_0x1ede4d,util['format'](_0x906d('0x25'),_0x493e25,_0x906d('0x26')))},function(_0x3ee437,_0x4b7f38){rimraf(path[_0x906d('0x20')](_0x1ede4d,_0x493e25),function(){});_0x26c254(_0x906d('0x27'));});});}})[_0x906d('0x11')](function(){logger[_0x906d('0x28')](util[_0x906d('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x906d('0xe')));return analyticExtractedReport(_0x906d('0x29'),_0x4cb987?util[_0x906d('0xc')](_0x906d('0x25'),_0x493e25,_0x4cb987?'zip':_0x906d('0x24')):null);});})['catch'](function(_0x1f9d34){logger[_0x906d('0x28')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x906d('0xe')),util[_0x906d('0x2a')](_0x1f9d34,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x906d('0x2b'));})[_0x906d('0x2c')](function(){process[_0x906d('0x2d')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xa808=['basename','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','finally','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','then','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname'];(function(_0x25171a,_0x17dbba){var _0x149349=function(_0x1eca89){while(--_0x1eca89){_0x25171a['push'](_0x25171a['shift']());}};_0x149349(++_0x17dbba);}(_0xa808,0xd6));var _0x8a80=function(_0x2acea1,_0x4b83ac){_0x2acea1=_0x2acea1-0x0;var _0x2c8df=_0xa808[_0x2acea1];return _0x2c8df;};'use strict';var util=require(_0x8a80('0x0'));var path=require(_0x8a80('0x1'));var _=require(_0x8a80('0x2'));var csv=require(_0x8a80('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x8a80('0x4'));var rimraf=require(_0x8a80('0x5'));var db=require(_0x8a80('0x6'))['db'];var dbH=require(_0x8a80('0x6'))[_0x8a80('0x7')];var logger=require(_0x8a80('0x8'))(_0x8a80('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x8a80('0xa')][0x2]);var QUERY=process[_0x8a80('0xa')][0x3];var PATH=process[_0x8a80('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2b223e,_0x182420){var _0x5e9d50={'status':_0x2b223e};var _0x5b07c4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x182420){_0x5e9d50['savename']=_0x182420;}return db[_0x8a80('0xb')][_0x8a80('0xc')](_0x5e9d50,_0x5b07c4);}function main(){var _0x2c51bb=0x1388;var _0x54c546;logger[_0x8a80('0xd')](util[_0x8a80('0xe')](_0x8a80('0xf'),EXTRACTED_REPORT_ID,_0x8a80('0x10')));return db[_0x8a80('0x11')][_0x8a80('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8a80('0x13'),_0x8a80('0x14')]})['then'](function(_0x551261){if(_0x551261){_0x54c546=_0x551261;_0x2c51bb=_0x54c546[_0x8a80('0x14')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x8a80('0x15')](util['format'](_0x8a80('0x16'),QUERY),{'type':dbH[_0x8a80('0x17')][_0x8a80('0x18')][_0x8a80('0x19')]});})[_0x8a80('0x1a')](function(_0xbf6db0){if(!_0xbf6db0[0x0][_0x8a80('0x1b')]){return analyticExtractedReport(_0x8a80('0x1c'));}var _0x60dafd=[];var _0x4532c5=0x0;if(_0x54c546[_0x8a80('0x13')]){if(_0xbf6db0&&_0xbf6db0[_0x8a80('0x1d')]){var _0x5ae5f2=_[_0x8a80('0x1e')](_0xbf6db0[0x0][_0x8a80('0x1b')]/_0x2c51bb);var _0x3a9726=Number[_0x8a80('0x1f')](_0xbf6db0[0x0][_0x8a80('0x1b')]/_0x2c51bb)?_0xbf6db0[0x0][_0x8a80('0x1b')]%_0x2c51bb:0x0;_0x5ae5f2[_0x8a80('0x20')](function(_0x5de8f3){if(_0x5de8f3>0x0){_0x4532c5+=_0x2c51bb;}_0x60dafd[_0x8a80('0x21')](dbH[_0x8a80('0x17')]['query'](util[_0x8a80('0xe')](_0x8a80('0x22'),QUERY,_0x2c51bb,_0x4532c5),{'type':dbH['sequelize'][_0x8a80('0x18')][_0x8a80('0x19')]}));});if(_0x3a9726>0x0){_0x4532c5+=_0x2c51bb;_0x60dafd[_0x8a80('0x21')](dbH[_0x8a80('0x17')][_0x8a80('0x15')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3a9726,_0x4532c5),{'type':dbH[_0x8a80('0x17')][_0x8a80('0x18')][_0x8a80('0x19')]}));}}}else{_0x60dafd[_0x8a80('0x21')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x8a80('0x17')]['QueryTypes']['SELECT']}));}var _0x2c684a=path[_0x8a80('0x23')](PATH);var _0x21396c=path[_0x8a80('0x24')](PATH,'.csv');var _0x7ce325=_0x54c546[_0x8a80('0x13')]&&_0x60dafd[_0x8a80('0x1d')]>0x1;var _0x3d3934=[];if(!fs['existsSync'](path[_0x8a80('0x25')](_0x2c684a,_0x21396c))&&_0x7ce325){fs[_0x8a80('0x26')](path[_0x8a80('0x25')](_0x2c684a,_0x21396c));}return BPromise[_0x8a80('0x27')](_0x60dafd,function(_0x5d68dd){_0x3d3934['push'](_0x5d68dd);})[_0x8a80('0x1a')](function(){for(var _0x2815cf=0x0;_0x2815cf<_0x3d3934[_0x8a80('0x1d')];_0x2815cf+=0x1){var _0x9e67c8;var _0x3a1176=_0x3d3934[_0x2815cf];if(_0x7ce325){_0x9e67c8=path[_0x8a80('0x25')](_0x2c684a,_0x21396c,util[_0x8a80('0xe')](_0x8a80('0x28'),_0x21396c,_0x2815cf,_0x8a80('0x29')));}else{_0x9e67c8=path[_0x8a80('0x25')](_0x2c684a,util['format'](_0x8a80('0x2a'),_0x21396c,_0x8a80('0x29')));}fs[_0x8a80('0x2b')](_0x9e67c8,csv(_0x3a1176));}})['then'](function(){if(_0x7ce325){return new Promise(function(_0x31c45c){zipdir(path[_0x8a80('0x25')](_0x2c684a,_0x21396c),{'saveTo':path[_0x8a80('0x25')](_0x2c684a,util[_0x8a80('0xe')](_0x8a80('0x2a'),_0x21396c,_0x8a80('0x2c')))},function(_0x6e7eb3,_0x681d3c){rimraf(path['join'](_0x2c684a,_0x21396c),function(){});_0x31c45c('zip\x20finished');});});}})['then'](function(){logger['info'](util['format'](_0x8a80('0x2d'),EXTRACTED_REPORT_ID,_0x8a80('0x10')));return analyticExtractedReport(_0x8a80('0x2e'),_0x7ce325?util[_0x8a80('0xe')]('%s.%s',_0x21396c,_0x7ce325?'zip':'csv'):null);});})[_0x8a80('0x2f')](function(_0x4a7970){logger[_0x8a80('0xd')](util[_0x8a80('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0x8a80('0x30')](_0x4a7970,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x8a80('0x31')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index 871254f..e0c40ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7ea=['MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','value','fill','length','body','push','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','margin','footer','Arial','black','right','num','Empty','Setting','find','splitSizePdf','then','split','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.pdf','mkdirSync','join','each','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','zip\x20finished','info','PDF','Completed','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','toString','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','createPdfFromHTML','catch','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv'];(function(_0x258e74,_0x459529){var _0x21f2fc=function(_0x1df3dd){while(--_0x1df3dd){_0x258e74['push'](_0x258e74['shift']());}};_0x21f2fc(++_0x459529);}(_0xc7ea,0xa3));var _0xac7e=function(_0x14742b,_0x85a9fc){_0x14742b=_0x14742b-0x0;var _0x1fe053=_0xc7ea[_0x14742b];return _0x1fe053;};'use strict';var _=require(_0xac7e('0x0'));var fs=require('fs');var util=require(_0xac7e('0x1'));var path=require(_0xac7e('0x2'));var moment=require(_0xac7e('0x3'));var htmlToPdfmake=require(_0xac7e('0x4'));var PdfPrinter=require(_0xac7e('0x5'));var zipdir=require(_0xac7e('0x6'));var rimraf=require(_0xac7e('0x7'));var JSDOM=require('jsdom')[_0xac7e('0x8')];var window=new JSDOM('')[_0xac7e('0x9')];var BPromise=require(_0xac7e('0xa'));var db=require('../../mysqldb')['db'];var dbH=require(_0xac7e('0xb'))['dbH'];var logger=require(_0xac7e('0xc'))(_0xac7e('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xac7e('0xe')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xac7e('0xe')][0x4];var NAME=process[_0xac7e('0xe')][0x5];var FORMAT=_0xac7e('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xe74b40,_0x2100c6){var _0x499ab2={'status':_0xe74b40};var _0x557e26={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2100c6){_0x499ab2[_0xac7e('0x10')]=_0x2100c6;}return db[_0xac7e('0x11')][_0xac7e('0x12')](_0x499ab2,_0x557e26);}function getHeaders(_0x460c50){return _[_0xac7e('0x13')](_0x460c50,function(_0xcf4519){return{'text':_0xcf4519,'style':_0xac7e('0x14')};});}function getRows(_0x150d1d,_0x12353a){return _['map'](_0x12353a,function(_0x378069){return _(_0x378069)[_0xac7e('0x15')](_0x150d1d)[_0xac7e('0x13')](function(_0x398b80){return _0x398b80?_['toString'](_0x398b80):'';})[_0xac7e('0x16')]();});}function createTable(_0x84c18b,_0x4a164b){var _0x4067f5={'widths':_[_0xac7e('0x17')](Array(_0x84c18b[_0xac7e('0x18')]),0x91),'heights':function(_0x781407){return _0x781407===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x367f87=getHeaders(_0x84c18b);_0x4067f5[_0xac7e('0x19')][_0xac7e('0x1a')](_0x367f87);var _0xdf2c73=getRows(_0x84c18b,_0x4a164b);_0x4067f5[_0xac7e('0x19')]=_0x4067f5[_0xac7e('0x19')][_0xac7e('0x1b')](_0xdf2c73);return _0x4067f5;}function createTables(_0x1cf8c8){var _0x5f0bdc=[];var _0x1d255c=_[_0xac7e('0x1c')](Object['keys'](_0x1cf8c8[0x0]),0x5);_0x1d255c[_0xac7e('0x1d')](function(_0x21e8d6){_0x5f0bdc[_0xac7e('0x1a')](createTable(_0x21e8d6,_0x1cf8c8));});return _0x5f0bdc;}function getPDFDocDefinition(_0x111abe){var _0x5c2af3=util[_0xac7e('0x1e')](_0xac7e('0x1f'),NAME,EXTRACTED_REPORT[_0xac7e('0x20')],moment(EXTRACTED_REPORT[_0xac7e('0x21')])[_0xac7e('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0xac7e('0x22')])[_0xac7e('0x1e')](FORMAT));var _0x4bf15a=[];for(var _0x214d0a=0x0;_0x214d0a<_0x111abe[_0xac7e('0x18')];_0x214d0a++){var _0x3d1f0c=[];if(_0x214d0a===0x0){_0x3d1f0c[_0xac7e('0x1a')]({'text':_0x5c2af3,'style':_0xac7e('0x23')});}var _0x284236={'table':_0x111abe[_0x214d0a]};if(_0x214d0a>0x0){_0x284236[_0xac7e('0x24')]='before';_0x284236[_0xac7e('0x25')]=[0x0,0x46,0x0,0x0];}_0x3d1f0c[_0xac7e('0x1a')](_0x284236);_0x4bf15a[_0xac7e('0x1a')](_0x3d1f0c);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x4bf15a,'footer':function(_0x5bbae6,_0x2bfb67){return{'text':_0x5bbae6['toString']()+'\x20/\x20'+_0x2bfb67,'style':_0xac7e('0x26')};},'defaultStyle':{'font':_0xac7e('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xac7e('0x28')},'footer':{'alignment':_0xac7e('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3c0049){var _0x3c0718=0x1388;var _0xf16e68;if(!_0x3c0049[0x0][_0xac7e('0x2a')]){return analyticExtractedReport(_0xac7e('0x2b'));}return db[_0xac7e('0x2c')][_0xac7e('0x2d')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xac7e('0x2e')]})[_0xac7e('0x2f')](function(_0x27f36d){if(_0x27f36d){_0xf16e68=_0x27f36d;_0x3c0718=_0xf16e68[_0xac7e('0x2e')]||0x3e8;}})[_0xac7e('0x2f')](function(){var _0x274811=[];var _0x16e078=0x0;if(_0xf16e68[_0xac7e('0x30')]){if(_0x3c0049&&_0x3c0049[_0xac7e('0x18')]){var _0x1e290d=_['range'](_0x3c0049[0x0][_0xac7e('0x2a')]/_0x3c0718);var _0x5c6305=Number['isInteger'](_0x3c0049[0x0]['num']/_0x3c0718)?_0x3c0049[0x0]['num']%_0x3c0718:0x0;_0x1e290d['forEach'](function(_0xc10df9){if(_0xc10df9>0x0){_0x16e078+=_0x3c0718;}_0x274811[_0xac7e('0x1a')](dbH[_0xac7e('0x31')][_0xac7e('0x32')](util[_0xac7e('0x1e')](_0xac7e('0x33'),QUERY,_0x3c0718,_0x16e078),{'type':dbH[_0xac7e('0x31')][_0xac7e('0x34')]['SELECT']}));});if(_0x5c6305>0x0){_0x16e078+=_0x3c0718;_0x274811['push'](dbH[_0xac7e('0x31')][_0xac7e('0x32')](util[_0xac7e('0x1e')](_0xac7e('0x33'),QUERY,_0x5c6305,_0x16e078),{'type':dbH[_0xac7e('0x31')][_0xac7e('0x34')][_0xac7e('0x35')]}));}}}else{_0x274811[_0xac7e('0x1a')](dbH['sequelize'][_0xac7e('0x32')](QUERY,{'type':dbH[_0xac7e('0x31')][_0xac7e('0x34')]['SELECT']}));}var _0x1c043d=path[_0xac7e('0x36')](PATH);var _0x1eb43c=path['basename'](PATH,_0xac7e('0x37'));var _0x2f987e=_0xf16e68[_0xac7e('0x30')]&&_0x274811[_0xac7e('0x18')]>0x1;var _0xcd02c5=[];if(!fs['existsSync'](path['join'](_0x1c043d,_0x1eb43c))&&_0x2f987e){fs[_0xac7e('0x38')](path[_0xac7e('0x39')](_0x1c043d,_0x1eb43c));}return BPromise[_0xac7e('0x3a')](_0x274811,function(_0x4e3fc3){_0xcd02c5[_0xac7e('0x1a')](_0x4e3fc3);})[_0xac7e('0x2f')](function(){var _0x5d0f33=[];for(var _0xaf7543=0x0;_0xaf7543<_0xcd02c5[_0xac7e('0x18')];_0xaf7543+=0x1){var _0x4fae5a=_0xcd02c5[_0xaf7543];var _0x140f01=createTables(_['flatten'](_0x4fae5a));var _0x44b778;var _0x232e0d=getPDFDocDefinition(_0x140f01);var _0xe38b2e=getPDFPrinter();var _0x246b1d=_0xe38b2e[_0xac7e('0x3b')](_0x232e0d);if(_0x2f987e){_0x44b778=path['join'](_0x1c043d,_0x1eb43c,util[_0xac7e('0x1e')](_0xac7e('0x3c'),_0x1eb43c,_0xaf7543,'pdf'));}else{_0x44b778=path['join'](_0x1c043d,util[_0xac7e('0x1e')](_0xac7e('0x3d'),_0x1eb43c,_0xac7e('0x3e')));}_0x5d0f33[_0xac7e('0x1a')](writePDFDocument(_0x246b1d,_0x44b778));}return Promise[_0xac7e('0x3f')](_0x5d0f33);})['then'](function(){if(_0x2f987e){return new Promise(function(_0xbb5d5e){zipdir(path[_0xac7e('0x39')](_0x1c043d,_0x1eb43c),{'saveTo':path[_0xac7e('0x39')](_0x1c043d,util[_0xac7e('0x1e')](_0xac7e('0x3d'),_0x1eb43c,_0xac7e('0x40')))},function(){rimraf(path[_0xac7e('0x39')](_0x1c043d,_0x1eb43c),function(){});_0xbb5d5e(_0xac7e('0x41'));});});}})['then'](function(){if(!_0x2f987e)return;rimraf(path[_0xac7e('0x39')](_0x1c043d,_0x1eb43c),function(){});})[_0xac7e('0x2f')](function(){logger[_0xac7e('0x42')](util[_0xac7e('0x1e')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xac7e('0x43')));return analyticExtractedReport(_0xac7e('0x44'),_0x2f987e?util['format'](_0xac7e('0x3d'),_0x1eb43c,_0x2f987e?_0xac7e('0x40'):_0xac7e('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xac7e('0x1e')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xac7e('0x43')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xac7e('0x2f')](function(_0x4b4dbc){EXTRACTED_REPORT=_0x4b4dbc;return dbH['sequelize'][_0xac7e('0x32')](util[_0xac7e('0x1e')](_0xac7e('0x45'),QUERY),{'type':dbH[_0xac7e('0x31')]['QueryTypes'][_0xac7e('0x35')]});})[_0xac7e('0x2f')](extractReport)['catch'](function(_0x1aad5c){logger[_0xac7e('0x42')](util[_0xac7e('0x1e')](_0xac7e('0x46'),EXTRACTED_REPORT_ID,_0xac7e('0x43')),util[_0xac7e('0x47')](_0x1aad5c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xac7e('0x48'));})[_0xac7e('0x49')](function(){process[_0xac7e('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x207c64=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xac7e('0x4b'),'italics':__dirname+_0xac7e('0x4c'),'bolditalics':__dirname+_0xac7e('0x4d')}});return _0x207c64;}function getPDFDocDefinitionFromHTML(_0x3fc7e1,_0x5583fa){var _0x3d3038=util[_0xac7e('0x1e')](_0xac7e('0x4e'),_0x5583fa['channel'],_0x5583fa[_0xac7e('0x4f')]);var _0xb90e19=moment()[_0xac7e('0x1e')](_0xac7e('0x50'))[_0xac7e('0x51')]();var _0x2a567d=htmlToPdfmake(_0x3fc7e1,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2a567d],'defaultStyle':{'font':_0xac7e('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xac7e('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xac7e('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xac7e('0x52')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xac7e('0x23')}];},'footer':function(_0x5e1825,_0x4ec993){return[{'text':util[_0xac7e('0x1e')](_0xac7e('0x53'),_0x3d3038,_0x5e1825,_0x4ec993,_0xb90e19),'style':_0xac7e('0x26')}];}};}function writePDFDocument(_0x16555c,_0x397918){return new Promise(function(_0x1b76b3,_0x24f7ef){var _0x4615c1=_0x16555c['pipe'](fs[_0xac7e('0x54')](_0x397918));_0x4615c1['on'](_0xac7e('0x55'),function(){_0x1b76b3('finish');});_0x4615c1['on'](_0xac7e('0x56'),function(_0x5ec4ee){_0x24f7ef(_0x5ec4ee);});_0x16555c['end']();});}exports[_0xac7e('0x57')]=function(_0x2dbad9,_0x3be8ec){var _0x544a41=getPDFPrinter();var _0x56b06a=getPDFDocDefinitionFromHTML(_0x2dbad9,_0x3be8ec);var _0x40a03a=_0x544a41['createPdfKitDocument'](_0x56b06a);return writePDFDocument(_0x40a03a,_0x3be8ec[_0xac7e('0x2')])[_0xac7e('0x58')](function(_0x4c13db){throw _0x4c13db;});};
\ No newline at end of file
+var _0xcba7=['dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','pick','map','toString','value','fill','auto','body','push','chunk','keys','forEach','format','name','startDate','endDate','length','before','margin','footer','Arial','black','right','num','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','QueryTypes','SELECT','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','join','mkdirSync','each','flatten','%s%d.%s','pdf','all','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','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','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb'];(function(_0xce4c29,_0x4029e5){var _0x3e7922=function(_0x17c742){while(--_0x17c742){_0xce4c29['push'](_0xce4c29['shift']());}};_0x3e7922(++_0x4029e5);}(_0xcba7,0x1cf));var _0x7cba=function(_0x8cb2f9,_0x2b8706){_0x8cb2f9=_0x8cb2f9-0x0;var _0x164887=_0xcba7[_0x8cb2f9];return _0x164887;};'use strict';var _=require(_0x7cba('0x0'));var fs=require('fs');var util=require(_0x7cba('0x1'));var path=require(_0x7cba('0x2'));var moment=require(_0x7cba('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x7cba('0x4'));var zipdir=require(_0x7cba('0x5'));var rimraf=require(_0x7cba('0x6'));var JSDOM=require(_0x7cba('0x7'))[_0x7cba('0x8')];var window=new JSDOM('')[_0x7cba('0x9')];var BPromise=require(_0x7cba('0xa'));var db=require(_0x7cba('0xb'))['db'];var dbH=require('../../mysqldb')[_0x7cba('0xc')];var logger=require(_0x7cba('0xd'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x7cba('0xe')][0x4];var NAME=process[_0x7cba('0xe')][0x5];var FORMAT=_0x7cba('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5e3155,_0x17d3f5){var _0x1f8d68={'status':_0x5e3155};var _0x528d0e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17d3f5){_0x1f8d68[_0x7cba('0x10')]=_0x17d3f5;}return db[_0x7cba('0x11')][_0x7cba('0x12')](_0x1f8d68,_0x528d0e);}function getHeaders(_0x63f12d){return _['map'](_0x63f12d,function(_0xaf03f8){return{'text':_0xaf03f8,'style':_0x7cba('0x13')};});}function getRows(_0x1e1235,_0x908ae){return _['map'](_0x908ae,function(_0x20d924){return _(_0x20d924)[_0x7cba('0x14')](_0x1e1235)[_0x7cba('0x15')](function(_0x297a0e){return _0x297a0e?_[_0x7cba('0x16')](_0x297a0e):'';})[_0x7cba('0x17')]();});}function createTable(_0x5cb067,_0x43ae84){var _0x139c47={'widths':_[_0x7cba('0x18')](Array(_0x5cb067['length']),0x91),'heights':function(_0x253420){return _0x253420===0x0?_0x7cba('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x26fb69=getHeaders(_0x5cb067);_0x139c47[_0x7cba('0x1a')][_0x7cba('0x1b')](_0x26fb69);var _0x338afd=getRows(_0x5cb067,_0x43ae84);_0x139c47[_0x7cba('0x1a')]=_0x139c47[_0x7cba('0x1a')]['concat'](_0x338afd);return _0x139c47;}function createTables(_0x355174){var _0x5e7455=[];var _0x22519f=_[_0x7cba('0x1c')](Object[_0x7cba('0x1d')](_0x355174[0x0]),0x5);_0x22519f[_0x7cba('0x1e')](function(_0x395a66){_0x5e7455[_0x7cba('0x1b')](createTable(_0x395a66,_0x355174));});return _0x5e7455;}function getPDFDocDefinition(_0x7c7b3e){var _0x7551b3=util[_0x7cba('0x1f')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x7cba('0x20')],moment(EXTRACTED_REPORT[_0x7cba('0x21')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x7cba('0x22')])[_0x7cba('0x1f')](FORMAT));var _0x3bf28b=[];for(var _0x2c52bd=0x0;_0x2c52bd<_0x7c7b3e[_0x7cba('0x23')];_0x2c52bd++){var _0x261977=[];if(_0x2c52bd===0x0){_0x261977[_0x7cba('0x1b')]({'text':_0x7551b3,'style':'header'});}var _0x30eb5e={'table':_0x7c7b3e[_0x2c52bd]};if(_0x2c52bd>0x0){_0x30eb5e['pageBreak']=_0x7cba('0x24');_0x30eb5e[_0x7cba('0x25')]=[0x0,0x46,0x0,0x0];}_0x261977[_0x7cba('0x1b')](_0x30eb5e);_0x3bf28b['push'](_0x261977);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x3bf28b,'footer':function(_0x55a907,_0x15d61c){return{'text':_0x55a907[_0x7cba('0x16')]()+'\x20/\x20'+_0x15d61c,'style':_0x7cba('0x26')};},'defaultStyle':{'font':_0x7cba('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x7cba('0x28')},'footer':{'alignment':_0x7cba('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x59bd58){var _0x3b35ff=0x1388;var _0x1e7fb9;if(!_0x59bd58[0x0][_0x7cba('0x2a')]){return analyticExtractedReport('Empty');}return db[_0x7cba('0x2b')][_0x7cba('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7cba('0x2d'),_0x7cba('0x2e')]})['then'](function(_0x545a1e){if(_0x545a1e){_0x1e7fb9=_0x545a1e;_0x3b35ff=_0x1e7fb9[_0x7cba('0x2e')]||0x3e8;}})[_0x7cba('0x2f')](function(){var _0x17f3c4=[];var _0x4dfcce=0x0;if(_0x1e7fb9[_0x7cba('0x2d')]){if(_0x59bd58&&_0x59bd58[_0x7cba('0x23')]){var _0x47ddf7=_[_0x7cba('0x30')](_0x59bd58[0x0][_0x7cba('0x2a')]/_0x3b35ff);var _0x6d4ded=Number[_0x7cba('0x31')](_0x59bd58[0x0][_0x7cba('0x2a')]/_0x3b35ff)?_0x59bd58[0x0][_0x7cba('0x2a')]%_0x3b35ff:0x0;_0x47ddf7[_0x7cba('0x1e')](function(_0x4b05fd){if(_0x4b05fd>0x0){_0x4dfcce+=_0x3b35ff;}_0x17f3c4[_0x7cba('0x1b')](dbH[_0x7cba('0x32')]['query'](util[_0x7cba('0x1f')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3b35ff,_0x4dfcce),{'type':dbH[_0x7cba('0x32')][_0x7cba('0x33')][_0x7cba('0x34')]}));});if(_0x6d4ded>0x0){_0x4dfcce+=_0x3b35ff;_0x17f3c4[_0x7cba('0x1b')](dbH[_0x7cba('0x32')][_0x7cba('0x35')](util[_0x7cba('0x1f')](_0x7cba('0x36'),QUERY,_0x6d4ded,_0x4dfcce),{'type':dbH[_0x7cba('0x32')][_0x7cba('0x33')][_0x7cba('0x34')]}));}}}else{_0x17f3c4[_0x7cba('0x1b')](dbH[_0x7cba('0x32')][_0x7cba('0x35')](QUERY,{'type':dbH[_0x7cba('0x32')][_0x7cba('0x33')]['SELECT']}));}var _0x805c3=path[_0x7cba('0x37')](PATH);var _0x330550=path[_0x7cba('0x38')](PATH,_0x7cba('0x39'));var _0x5d2dd5=_0x1e7fb9[_0x7cba('0x2d')]&&_0x17f3c4[_0x7cba('0x23')]>0x1;var _0x59efc3=[];if(!fs['existsSync'](path[_0x7cba('0x3a')](_0x805c3,_0x330550))&&_0x5d2dd5){fs[_0x7cba('0x3b')](path[_0x7cba('0x3a')](_0x805c3,_0x330550));}return BPromise[_0x7cba('0x3c')](_0x17f3c4,function(_0x224663){_0x59efc3['push'](_0x224663);})[_0x7cba('0x2f')](function(){var _0x3e6836=[];for(var _0x7cde92=0x0;_0x7cde92<_0x59efc3[_0x7cba('0x23')];_0x7cde92+=0x1){var _0x223338=_0x59efc3[_0x7cde92];var _0x471018=createTables(_[_0x7cba('0x3d')](_0x223338));var _0x101d8e;var _0x17ed53=getPDFDocDefinition(_0x471018);var _0x5cc9fe=getPDFPrinter();var _0x26c467=_0x5cc9fe['createPdfKitDocument'](_0x17ed53);if(_0x5d2dd5){_0x101d8e=path[_0x7cba('0x3a')](_0x805c3,_0x330550,util[_0x7cba('0x1f')](_0x7cba('0x3e'),_0x330550,_0x7cde92,'pdf'));}else{_0x101d8e=path['join'](_0x805c3,util[_0x7cba('0x1f')]('%s.%s',_0x330550,_0x7cba('0x3f')));}_0x3e6836[_0x7cba('0x1b')](writePDFDocument(_0x26c467,_0x101d8e));}return Promise[_0x7cba('0x40')](_0x3e6836);})[_0x7cba('0x2f')](function(){if(_0x5d2dd5){return new Promise(function(_0x5abc48){zipdir(path[_0x7cba('0x3a')](_0x805c3,_0x330550),{'saveTo':path[_0x7cba('0x3a')](_0x805c3,util[_0x7cba('0x1f')](_0x7cba('0x41'),_0x330550,_0x7cba('0x42')))},function(){rimraf(path[_0x7cba('0x3a')](_0x805c3,_0x330550),function(){});_0x5abc48('zip\x20finished');});});}})[_0x7cba('0x2f')](function(){if(!_0x5d2dd5)return;rimraf(path[_0x7cba('0x3a')](_0x805c3,_0x330550),function(){});})[_0x7cba('0x2f')](function(){logger[_0x7cba('0x43')](util[_0x7cba('0x1f')](_0x7cba('0x44'),EXTRACTED_REPORT_ID,_0x7cba('0x45')));return analyticExtractedReport(_0x7cba('0x46'),_0x5d2dd5?util['format'](_0x7cba('0x41'),_0x330550,_0x5d2dd5?_0x7cba('0x42'):_0x7cba('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x7cba('0x1f')](_0x7cba('0x47'),EXTRACTED_REPORT_ID,_0x7cba('0x45')));return db[_0x7cba('0x11')][_0x7cba('0x48')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x7cba('0x2f')](function(_0x32f6a3){EXTRACTED_REPORT=_0x32f6a3;return dbH[_0x7cba('0x32')]['query'](util[_0x7cba('0x1f')](_0x7cba('0x49'),QUERY),{'type':dbH[_0x7cba('0x32')][_0x7cba('0x33')]['SELECT']});})['then'](extractReport)[_0x7cba('0x4a')](function(_0x25de0a){logger[_0x7cba('0x43')](util[_0x7cba('0x1f')](_0x7cba('0x4b'),EXTRACTED_REPORT_ID,_0x7cba('0x45')),util['inspect'](_0x25de0a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7cba('0x4c'));})['finally'](function(){process[_0x7cba('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5a6bf2=new PdfPrinter({'Arial':{'normal':__dirname+_0x7cba('0x4e'),'bold':__dirname+_0x7cba('0x4f'),'italics':__dirname+_0x7cba('0x50'),'bolditalics':__dirname+_0x7cba('0x51')}});return _0x5a6bf2;}function getPDFDocDefinitionFromHTML(_0x54a124,_0x237938){var _0x4ff061=util[_0x7cba('0x1f')](_0x7cba('0x52'),_0x237938['channel'],_0x237938[_0x7cba('0x53')]);var _0x13c42f=moment()[_0x7cba('0x1f')](_0x7cba('0x54'))[_0x7cba('0x16')]();var _0x1d0133=htmlToPdfmake(_0x54a124,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1d0133],'defaultStyle':{'font':_0x7cba('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x7cba('0x55'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x7cba('0x55'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x7cba('0x55')}},'header':function(){return[{'text':_0x7cba('0x56'),'style':_0x7cba('0x57')}];},'footer':function(_0x1081e4,_0x8045b1){return[{'text':util[_0x7cba('0x1f')](_0x7cba('0x58'),_0x4ff061,_0x1081e4,_0x8045b1,_0x13c42f),'style':'footer'}];}};}function writePDFDocument(_0xc851bc,_0x2bda4c){return new Promise(function(_0x1822d8,_0x4f9ff9){var _0x3016d7=_0xc851bc[_0x7cba('0x59')](fs['createWriteStream'](_0x2bda4c));_0x3016d7['on'](_0x7cba('0x5a'),function(){_0x1822d8(_0x7cba('0x5a'));});_0x3016d7['on'](_0x7cba('0x5b'),function(_0x20aed4){_0x4f9ff9(_0x20aed4);});_0xc851bc[_0x7cba('0x5c')]();});}exports[_0x7cba('0x5d')]=function(_0x488d4e,_0x2664c1){var _0x5af11c=getPDFPrinter();var _0x170049=getPDFDocDefinitionFromHTML(_0x488d4e,_0x2664c1);var _0xbafd2=_0x5af11c[_0x7cba('0x5e')](_0x170049);return writePDFDocument(_0xbafd2,_0x2664c1['path'])[_0x7cba('0x4a')](function(_0x67f113){throw _0x67f113;});};
\ No newline at end of file
index 6f2e8db..05acd54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69c4=['existsSync','join','mkdirSync','each','%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','inspect','Failed','finally','exit','util','path','lodash','bluebird','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x69c4,0x1d4));var _0x469c=function(_0x3ef1bb,_0x5ba940){_0x3ef1bb=_0x3ef1bb-0x0;var _0x4d2d27=_0x69c4[_0x3ef1bb];return _0x4d2d27;};'use strict';var util=require(_0x469c('0x0'));var path=require(_0x469c('0x1'));var _=require(_0x469c('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x469c('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x469c('0x4'))(_0x469c('0x5'));var EXTRACTED_REPORT_ID=Number(process[_0x469c('0x6')][0x2]);var QUERY=process[_0x469c('0x6')][0x3];var PATH=process[_0x469c('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xa52bb9,_0x5a87df){var _0x288ce5={'status':_0xa52bb9};var _0x2ac568={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5a87df){_0x288ce5[_0x469c('0x7')]=_0x5a87df;}return db[_0x469c('0x8')][_0x469c('0x9')](_0x288ce5,_0x2ac568);}function main(){var _0x1ba954=0x1388;var _0x406808;logger[_0x469c('0xa')](util[_0x469c('0xb')](_0x469c('0xc'),EXTRACTED_REPORT_ID,_0x469c('0xd')));return db['Setting'][_0x469c('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x469c('0xf'),_0x469c('0x10')]})[_0x469c('0x11')](function(_0x1076b6){if(_0x1076b6){_0x406808=_0x1076b6;_0x1ba954=_0x406808[_0x469c('0x10')]||0x1388;}})[_0x469c('0x11')](function(){return dbH['sequelize'][_0x469c('0x12')](util[_0x469c('0xb')](_0x469c('0x13'),QUERY),{'type':dbH[_0x469c('0x14')][_0x469c('0x15')][_0x469c('0x16')]});})[_0x469c('0x11')](function(_0x2fb7b4){if(!_0x2fb7b4[0x0][_0x469c('0x17')]){return analyticExtractedReport(_0x469c('0x18'));}var _0x424589=[];var _0x17ebc4=0x0;if(_0x406808[_0x469c('0xf')]){if(_0x2fb7b4&&_0x2fb7b4[_0x469c('0x19')]){var _0x351042=_[_0x469c('0x1a')](_0x2fb7b4[0x0]['num']/_0x1ba954);var _0x214023=Number[_0x469c('0x1b')](_0x2fb7b4[0x0][_0x469c('0x17')]/_0x1ba954)?_0x2fb7b4[0x0]['num']%_0x1ba954:0x0;_0x351042['forEach'](function(_0x3cd593){if(_0x3cd593>0x0){_0x17ebc4+=_0x1ba954;}_0x424589[_0x469c('0x1c')](dbH['sequelize']['query'](util[_0x469c('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1ba954,_0x17ebc4),{'type':dbH['sequelize'][_0x469c('0x15')][_0x469c('0x16')]}));});if(_0x214023>0x0){_0x17ebc4+=_0x1ba954;_0x424589[_0x469c('0x1c')](dbH[_0x469c('0x14')][_0x469c('0x12')](util[_0x469c('0xb')](_0x469c('0x1d'),QUERY,_0x214023,_0x17ebc4),{'type':dbH[_0x469c('0x14')][_0x469c('0x15')][_0x469c('0x16')]}));}}}else{_0x424589[_0x469c('0x1c')](dbH[_0x469c('0x14')][_0x469c('0x12')](QUERY,{'type':dbH['sequelize'][_0x469c('0x15')]['SELECT']}));}var _0x3145a7=path['dirname'](PATH);var _0x26d766=path[_0x469c('0x1e')](PATH,_0x469c('0x1f'));var _0x5177c8=_0x406808[_0x469c('0xf')]&&_0x424589[_0x469c('0x19')]>0x1;var _0x2e3ab6=[];if(!fs[_0x469c('0x20')](path[_0x469c('0x21')](_0x3145a7,_0x26d766))&&_0x5177c8){fs[_0x469c('0x22')](path[_0x469c('0x21')](_0x3145a7,_0x26d766));}return BPromise[_0x469c('0x23')](_0x424589,function(_0x2ca6ed){_0x2e3ab6[_0x469c('0x1c')](_0x2ca6ed);})[_0x469c('0x11')](function(){for(var _0xd3f419=0x0;_0xd3f419<_0x2e3ab6['length'];_0xd3f419+=0x1){var _0x543976;var _0x378769=_0x2e3ab6[_0xd3f419];if(_0x5177c8){_0x543976=path[_0x469c('0x21')](_0x3145a7,_0x26d766,util[_0x469c('0xb')](_0x469c('0x24'),_0x26d766,_0xd3f419,_0x469c('0x25')));}else{_0x543976=path[_0x469c('0x21')](_0x3145a7,util[_0x469c('0xb')](_0x469c('0x26'),_0x26d766,_0x469c('0x25')));}fs['writeFileSync'](_0x543976,json2xls(_0x378769),_0x469c('0x27'));}})[_0x469c('0x11')](function(){if(_0x5177c8){return new Promise(function(_0x37e4ae){zipdir(path['join'](_0x3145a7,_0x26d766),{'saveTo':path[_0x469c('0x21')](_0x3145a7,util[_0x469c('0xb')](_0x469c('0x26'),_0x26d766,_0x469c('0x28')))},function(_0x451f1b,_0xc6c537){rimraf(path[_0x469c('0x21')](_0x3145a7,_0x26d766),function(){});_0x37e4ae(_0x469c('0x29'));});});}})[_0x469c('0x11')](function(){logger['info'](util['format'](_0x469c('0x2a'),EXTRACTED_REPORT_ID,_0x469c('0xd')));return analyticExtractedReport(_0x469c('0x2b'),_0x5177c8?util[_0x469c('0xb')]('%s.%s',_0x26d766,_0x5177c8?_0x469c('0x28'):'xlsx'):null);});})[_0x469c('0x2c')](function(_0x4cfbdb){logger['info'](util[_0x469c('0xb')](_0x469c('0x2d'),EXTRACTED_REPORT_ID,_0x469c('0xd')),util[_0x469c('0x2e')](_0x4cfbdb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x469c('0x2f'));})[_0x469c('0x30')](function(){process[_0x469c('0x31')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xfa4b=['zip','zip\x20finished','XLSX','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeXlsx','then','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','range','num','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','join','xlsx','writeFileSync','binary','%s.%s'];(function(_0x9b2db5,_0x8a2e30){var _0x3a2c98=function(_0x591b50){while(--_0x591b50){_0x9b2db5['push'](_0x9b2db5['shift']());}};_0x3a2c98(++_0x8a2e30);}(_0xfa4b,0xf9));var _0xbfa4=function(_0x173dbb,_0x43ccba){_0x173dbb=_0x173dbb-0x0;var _0x2cc702=_0xfa4b[_0x173dbb];return _0x2cc702;};'use strict';var util=require(_0xbfa4('0x0'));var path=require(_0xbfa4('0x1'));var _=require(_0xbfa4('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xbfa4('0x3'));var zipdir=require(_0xbfa4('0x4'));var rimraf=require('rimraf');var db=require(_0xbfa4('0x5'))['db'];var dbH=require('../../mysqldb')[_0xbfa4('0x6')];var logger=require(_0xbfa4('0x7'))(_0xbfa4('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xbfa4('0x9')][0x3];var PATH=process[_0xbfa4('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1ae64f,_0x341383){var _0x23a30e={'status':_0x1ae64f};var _0x5c4fd3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x341383){_0x23a30e[_0xbfa4('0xa')]=_0x341383;}return db[_0xbfa4('0xb')][_0xbfa4('0xc')](_0x23a30e,_0x5c4fd3);}function main(){var _0x508ed1=0x1388;var _0x1f2c0f;logger[_0xbfa4('0xd')](util['format'](_0xbfa4('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xbfa4('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbfa4('0x10'),_0xbfa4('0x11')]})[_0xbfa4('0x12')](function(_0x346b08){if(_0x346b08){_0x1f2c0f=_0x346b08;_0x508ed1=_0x1f2c0f[_0xbfa4('0x11')]||0x1388;}})['then'](function(){return dbH[_0xbfa4('0x13')]['query'](util[_0xbfa4('0x14')](_0xbfa4('0x15'),QUERY),{'type':dbH[_0xbfa4('0x13')][_0xbfa4('0x16')][_0xbfa4('0x17')]});})[_0xbfa4('0x12')](function(_0x1cf643){if(!_0x1cf643[0x0]['num']){return analyticExtractedReport(_0xbfa4('0x18'));}var _0x5e9bc6=[];var _0x1ec79a=0x0;if(_0x1f2c0f[_0xbfa4('0x10')]){if(_0x1cf643&&_0x1cf643[_0xbfa4('0x19')]){var _0x3f3d3c=_[_0xbfa4('0x1a')](_0x1cf643[0x0]['num']/_0x508ed1);var _0x287358=Number['isInteger'](_0x1cf643[0x0][_0xbfa4('0x1b')]/_0x508ed1)?_0x1cf643[0x0][_0xbfa4('0x1b')]%_0x508ed1:0x0;_0x3f3d3c[_0xbfa4('0x1c')](function(_0x56b56b){if(_0x56b56b>0x0){_0x1ec79a+=_0x508ed1;}_0x5e9bc6[_0xbfa4('0x1d')](dbH['sequelize'][_0xbfa4('0x1e')](util[_0xbfa4('0x14')](_0xbfa4('0x1f'),QUERY,_0x508ed1,_0x1ec79a),{'type':dbH[_0xbfa4('0x13')][_0xbfa4('0x16')][_0xbfa4('0x17')]}));});if(_0x287358>0x0){_0x1ec79a+=_0x508ed1;_0x5e9bc6[_0xbfa4('0x1d')](dbH['sequelize']['query'](util[_0xbfa4('0x14')](_0xbfa4('0x1f'),QUERY,_0x287358,_0x1ec79a),{'type':dbH['sequelize'][_0xbfa4('0x16')][_0xbfa4('0x17')]}));}}}else{_0x5e9bc6[_0xbfa4('0x1d')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xbfa4('0x13')]['QueryTypes'][_0xbfa4('0x17')]}));}var _0x1774e9=path['dirname'](PATH);var _0x5cce50=path[_0xbfa4('0x20')](PATH,_0xbfa4('0x21'));var _0x77c4e5=_0x1f2c0f[_0xbfa4('0x10')]&&_0x5e9bc6['length']>0x1;var _0xf50f06=[];if(!fs['existsSync'](path[_0xbfa4('0x22')](_0x1774e9,_0x5cce50))&&_0x77c4e5){fs['mkdirSync'](path[_0xbfa4('0x22')](_0x1774e9,_0x5cce50));}return BPromise['each'](_0x5e9bc6,function(_0x2f2689){_0xf50f06[_0xbfa4('0x1d')](_0x2f2689);})[_0xbfa4('0x12')](function(){for(var _0x5c0660=0x0;_0x5c0660<_0xf50f06[_0xbfa4('0x19')];_0x5c0660+=0x1){var _0x516f8e;var _0x2ad359=_0xf50f06[_0x5c0660];if(_0x77c4e5){_0x516f8e=path[_0xbfa4('0x22')](_0x1774e9,_0x5cce50,util[_0xbfa4('0x14')]('%s%d.%s',_0x5cce50,_0x5c0660,_0xbfa4('0x23')));}else{_0x516f8e=path[_0xbfa4('0x22')](_0x1774e9,util[_0xbfa4('0x14')]('%s.%s',_0x5cce50,_0xbfa4('0x23')));}fs[_0xbfa4('0x24')](_0x516f8e,json2xls(_0x2ad359),_0xbfa4('0x25'));}})[_0xbfa4('0x12')](function(){if(_0x77c4e5){return new Promise(function(_0x1d39c2){zipdir(path[_0xbfa4('0x22')](_0x1774e9,_0x5cce50),{'saveTo':path[_0xbfa4('0x22')](_0x1774e9,util[_0xbfa4('0x14')](_0xbfa4('0x26'),_0x5cce50,_0xbfa4('0x27')))},function(_0x2e402a,_0x3d4abc){rimraf(path['join'](_0x1774e9,_0x5cce50),function(){});_0x1d39c2(_0xbfa4('0x28'));});});}})[_0xbfa4('0x12')](function(){logger[_0xbfa4('0xd')](util[_0xbfa4('0x14')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xbfa4('0x29')));return analyticExtractedReport('Completed',_0x77c4e5?util['format'](_0xbfa4('0x26'),_0x5cce50,_0x77c4e5?'zip':'xlsx'):null);});})[_0xbfa4('0x2a')](function(_0xf4e44f){logger[_0xbfa4('0xd')](util[_0xbfa4('0x14')](_0xbfa4('0x2b'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xbfa4('0x2c')](_0xf4e44f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbfa4('0x2d'));})[_0xbfa4('0x2e')](function(){process[_0xbfa4('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
index e18a72e..c6b1e86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7372=['indexOf','appType','XCALLY-MOTION-ANSWER=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','rewrite','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','outbound','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','IntervalId','map','filter','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'];(function(_0x1a1d9b,_0x5ea65a){var _0x1d7a59=function(_0xa1dea2){while(--_0xa1dea2){_0x1a1d9b['push'](_0x1a1d9b['shift']());}};_0x1d7a59(++_0x5ea65a);}(_0x7372,0x115));var _0x2737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7372[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2737('0x0'));function rewrite(_0x45e7e3,_0x5588d7){var _0x15fbf1=this;return _0x45e7e3[_0x2737('0x1')][_0x2737('0x2')][_0x2737('0x3')]({'raw':!![]})[_0x2737('0x4')](function(_0x5b0eaf){_0x15fbf1[_0x2737('0x5')]=_0x5b0eaf;return _0x45e7e3[_0x2737('0x1')][_0x2737('0x6')]['findAll']({'where':{'IntervalId':_0x5588d7['IntervalId']},'raw':!![]});})['then'](function(_0x21b1ae){return _0x45e7e3[_0x2737('0x1')][_0x2737('0x6')][_0x2737('0x3')]({'where':{'exten':{'$in':_[_0x2737('0x7')](_['map'](_0x21b1ae,_0x2737('0x8')))}},'order':[{'raw':_0x2737('0x9')}],'raw':!![]});})[_0x2737('0x4')](function(_0x3bc980){var _0x5f294f=_['filter'](_0x3bc980,{'priority':'1'});var _0x569387=_['filter'](_0x3bc980,{'isApp':0x1});var _0x440bfa=_['groupBy'](_0x569387,_0x2737('0x8'));var _0xdcf528=['queue','playback'];var _0x117a5e=[];var _0x2d85f0=[];for(var _0x5a9ed1 in _0x440bfa){if(_0x440bfa[_0x2737('0xa')](_0x5a9ed1)){_0x15fbf1[_0x2737('0xb')]=0x2;_0x15fbf1[_0x2737('0xc')]=[];_0x15fbf1[_0x2737('0xd')]=_[_0x2737('0xe')](_0x5f294f,{'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')]});_0x15fbf1['extensions'][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':util[_0x2737('0x12')](_0x2737('0x13'),_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')]),'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});if(_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')]===_0x2737('0x16')){_0x15fbf1['extensions'][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':'CDR(routeid)='+_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')],'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x15fbf1['priority']++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});}else if(_0x440bfa[_0x5a9ed1][0x0]['type']===_0x2737('0x17')){if(_0x15fbf1[_0x2737('0xd')]){_0x15fbf1[_0x2737('0xc')][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':'CDR(destination)='+(_0x15fbf1['extension']['cutdigits']?_0x2737('0x18')+_0x15fbf1[_0x2737('0xd')][_0x2737('0x19')]+'}':_0x2737('0x1a')),'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0]['exten'],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0]['VoiceExtensionId']});}_0x15fbf1[_0x2737('0xc')]['push']({'type':_0x440bfa[_0x5a9ed1][0x0]['type'],'app':_0x2737('0x11'),'appdata':_0x2737('0x1b')+_0x440bfa[_0x5a9ed1][0x0]['VoiceExtensionId'],'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0]['exten'],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0]['VoiceExtensionId']});var _0x374ccc=_0x15fbf1[_0x2737('0xb')]++;_0x15fbf1['extensions'][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x1c'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x374ccc+0x2)+'):Goto('+(_0x374ccc+0x1)+')','context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x374ccc,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});if(_0x15fbf1[_0x2737('0xd')]){_0x15fbf1[_0x2737('0xc')][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':_0x15fbf1[_0x2737('0xd')][_0x2737('0x19')]?_0x2737('0x1d')+_0x15fbf1[_0x2737('0xd')][_0x2737('0x19')]+'}':_0x2737('0x1e'),'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0]['exten'],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0]['VoiceExtensionId']});}_0x15fbf1[_0x2737('0xc')][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':_0x2737('0x1f')+_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')],'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0]['exten'],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});if(_0x15fbf1[_0x2737('0xd')]&&_0x15fbf1[_0x2737('0xd')][_0x2737('0xa')](_0x2737('0x20'))&&_0x15fbf1[_0x2737('0xd')][_0x2737('0x20')]!==_0x2737('0x21')){_0x15fbf1[_0x2737('0xc')]['push']({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':'Set','appdata':_0x2737('0x22'),'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x15fbf1['priority']++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});_0x15fbf1[_0x2737('0xc')]['push']({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':_0x2737('0x23')+_0x15fbf1[_0x2737('0xd')][_0x2737('0x20')]||_0x2737('0x24'),'context':_0x440bfa[_0x5a9ed1][0x0]['context'],'exten':_0x440bfa[_0x5a9ed1][0x0]['exten'],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});}}_0x15fbf1[_0x2737('0xc')][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':_0x2737('0x25'),'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x15fbf1['priority']++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});_0x15fbf1[_0x2737('0xc')][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});_0x15fbf1['extensions'][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':_0x2737('0x26'),'context':_0x440bfa[_0x5a9ed1][0x0]['context'],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});for(var _0x48f895=0x0,_0x122e47=0x0;_0x48f895<_0x440bfa[_0x5a9ed1][_0x2737('0x27')];_0x48f895+=0x1,_0x122e47=0x0){var _0x364e0a=_0x440bfa[_0x5a9ed1][_0x48f895];if(_0x364e0a[_0x2737('0x10')]){_0x364e0a[_0x2737('0x10')]=_0x364e0a['type'][_0x2737('0x28')]();}var _0x2d9ec0=[];var _0x5e2a6c=[];delete _0x364e0a['id'];delete _0x364e0a['createdAt'];delete _0x364e0a[_0x2737('0x29')];var _0x502364=_0x364e0a[_0x2737('0x2a')]!==_0x2737('0x2b')?[_0x364e0a['interval']]:_0x364e0a[_0x2737('0x2c')]?_[_0x2737('0x2d')](_[_0x2737('0x2e')](_0x15fbf1['intervals'],{'IntervalId':_0x364e0a[_0x2737('0x2c')]}),_0x2737('0x2a')):[];if(_0x364e0a['hasOwnProperty'](_0x2737('0x2f'))){if(_0x364e0a[_0x2737('0x2f')]&&_0x364e0a[_0x2737('0x2f')]!=='--'){_0x2d9ec0[_0x2737('0xf')]({'type':_0x364e0a['type'],'app':_0x2737('0x11'),'appdata':_0x2737('0x30')+_0x364e0a[_0x2737('0x2f')],'context':_0x364e0a['context'],'exten':_0x364e0a[_0x2737('0x8')],'priority':_0x502364['length']+_0x15fbf1[_0x2737('0xb')]+_0x122e47++,'VoiceExtensionId':_0x364e0a[_0x2737('0x15')]});}}if(_0x364e0a['type']==='outbound'&&_0x364e0a['hasOwnProperty'](_0x2737('0x31'))){if(_0x364e0a['callerID']){_0x2d9ec0[_0x2737('0xf')]({'type':_0x364e0a[_0x2737('0x10')],'app':_0x2737('0x1c'),'appdata':_0x2737('0x32')+_0x364e0a[_0x2737('0x31')]+')','context':_0x364e0a[_0x2737('0x14')],'exten':_0x364e0a[_0x2737('0x8')],'priority':_0x502364[_0x2737('0x27')]+_0x15fbf1['priority']+_0x122e47++,'VoiceExtensionId':_0x364e0a['VoiceExtensionId']});}else{_0x2d9ec0[_0x2737('0xf')]({'type':_0x364e0a[_0x2737('0x10')],'app':_0x2737('0x1c'),'appdata':_0x2737('0x33'),'context':_0x364e0a[_0x2737('0x14')],'exten':_0x364e0a[_0x2737('0x8')],'priority':_0x502364[_0x2737('0x27')]+_0x15fbf1[_0x2737('0xb')]+_0x122e47++,'VoiceExtensionId':_0x364e0a[_0x2737('0x15')]});}}if(_0x364e0a[_0x2737('0xa')](_0x2737('0x34'))){if(_0xdcf528[_0x2737('0x35')](_0x364e0a['app'][_0x2737('0x28')]())>=0x0&&_0x364e0a[_0x2737('0x36')]!=='custom'){if(_0x364e0a[_0x2737('0x34')]){_0x2d9ec0['push']({'type':_0x364e0a[_0x2737('0x10')],'app':_0x2737('0x1c'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x364e0a[_0x2737('0x14')],'exten':_0x364e0a['exten'],'priority':_0x502364[_0x2737('0x27')]+_0x15fbf1[_0x2737('0xb')]+_0x122e47++,'VoiceExtensionId':_0x364e0a[_0x2737('0x15')]});_0x2d9ec0[_0x2737('0xf')]({'type':_0x364e0a[_0x2737('0x10')],'app':'Set','appdata':_0x2737('0x37'),'context':_0x364e0a[_0x2737('0x14')],'exten':_0x364e0a[_0x2737('0x8')],'priority':_0x502364[_0x2737('0x27')]+_0x15fbf1[_0x2737('0xb')]+_0x122e47++,'VoiceExtensionId':_0x364e0a[_0x2737('0x15')]});}else{_0x2d9ec0[_0x2737('0xf')]({'type':_0x364e0a[_0x2737('0x10')],'app':_0x2737('0x1c'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x364e0a[_0x2737('0x14')],'exten':_0x364e0a[_0x2737('0x8')],'priority':_0x502364[_0x2737('0x27')]+_0x15fbf1['priority']+_0x122e47++,'VoiceExtensionId':_0x364e0a[_0x2737('0x15')]});_0x2d9ec0[_0x2737('0xf')]({'type':_0x364e0a[_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x364e0a[_0x2737('0x14')],'exten':_0x364e0a[_0x2737('0x8')],'priority':_0x502364[_0x2737('0x27')]+_0x15fbf1['priority']+_0x122e47++,'VoiceExtensionId':_0x364e0a[_0x2737('0x15')]});}}}for(var _0x1ff1fd=0x0;_0x1ff1fd<_0x502364[_0x2737('0x27')];_0x1ff1fd+=0x1){var _0x5c0b21=_0x15fbf1[_0x2737('0xb')]+_0x502364[_0x2737('0x27')];var _0x73bbf1=_0x1ff1fd===_0x502364[_0x2737('0x27')]-0x1?_0x15fbf1[_0x2737('0xb')]+_0x2d9ec0['length']+_0x5e2a6c[_0x2737('0x27')]+0x2:_0x15fbf1['priority']+_0x1ff1fd+0x1;_0x2d9ec0[_0x2737('0x38')](_0x1ff1fd,0x0,{'type':_0x364e0a[_0x2737('0x10')],'app':'GotoIfTime','appdata':_0x502364[_0x1ff1fd]+'?'+_0x364e0a[_0x2737('0x14')]+_0x2737('0x39')+_0x5c0b21+':'+_0x364e0a['context']+_0x2737('0x39')+_0x73bbf1,'exten':_0x364e0a[_0x2737('0x8')],'context':_0x364e0a[_0x2737('0x14')],'priority':_0x15fbf1[_0x2737('0xb')]+_0x1ff1fd,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});}_0x364e0a[_0x2737('0xb')]=_0x2d9ec0[_0x2737('0x27')]?_[_0x2737('0x3a')](_0x2d9ec0)[_0x2737('0xb')]+0x1:_0x15fbf1[_0x2737('0xb')];_0x15fbf1[_0x2737('0xb')]=(_0x5e2a6c[_0x2737('0x27')]?_[_0x2737('0x3a')](_0x5e2a6c)[_0x2737('0xb')]:_0x364e0a[_0x2737('0xb')])+0x1;_0x15fbf1[_0x2737('0xc')]=_[_0x2737('0x3b')](_0x15fbf1[_0x2737('0xc')],_0x2d9ec0,[_0x364e0a],_0x5e2a6c);}_0x15fbf1['extensions']['push']({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x3c'),'exten':_0x440bfa[_0x5a9ed1][0x0]['exten'],'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'priority':_0x15fbf1['priority'],'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0]['VoiceExtensionId']});_0x117a5e[_0x2737('0xf')](_0x440bfa[_0x5a9ed1][0x0]['VoiceExtensionId']);_0x2d85f0=_[_0x2737('0x3b')](_0x2d85f0,_0x15fbf1[_0x2737('0xc')]);}}return _0x45e7e3[_0x2737('0x3d')](function(_0x4bfd73){return _0x45e7e3['models']['VoiceExtension'][_0x2737('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x117a5e}},'transaction':_0x4bfd73})[_0x2737('0x4')](function(_0x36afc0){return _0x45e7e3[_0x2737('0x1')][_0x2737('0x6')]['bulkCreate'](_[_0x2737('0x3f')](_0x2d85f0,_0x2737('0xb')),{'transaction':_0x4bfd73});});});})[_0x2737('0x40')](function(_0x44c205){console['error'](_0x44c205);});}exports[_0x2737('0x41')]=rewrite;
\ No newline at end of file
+var _0x7594=['format','CDR(type)=%s','context','VoiceExtensionId','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','tag','CDR(tag)=','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','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0x7594,0x7a));var _0x4759=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x7594[_0x725a4c];return _0x37b2cc;};'use strict';var _=require('lodash');var util=require(_0x4759('0x0'));function rewrite(_0x260c8e,_0x17bc5d){var _0x2b15be=this;return _0x260c8e[_0x4759('0x1')][_0x4759('0x2')][_0x4759('0x3')]({'raw':!![]})[_0x4759('0x4')](function(_0x5612dd){_0x2b15be[_0x4759('0x5')]=_0x5612dd;return _0x260c8e[_0x4759('0x1')][_0x4759('0x6')][_0x4759('0x3')]({'where':{'IntervalId':_0x17bc5d[_0x4759('0x7')]},'raw':!![]});})[_0x4759('0x4')](function(_0x3952d2){return _0x260c8e['models'][_0x4759('0x6')][_0x4759('0x3')]({'where':{'exten':{'$in':_[_0x4759('0x8')](_[_0x4759('0x9')](_0x3952d2,_0x4759('0xa')))}},'order':[{'raw':_0x4759('0xb')}],'raw':!![]});})['then'](function(_0x9f9b2){var _0x5702b7=_[_0x4759('0xc')](_0x9f9b2,{'priority':'1'});var _0x2efddf=_[_0x4759('0xc')](_0x9f9b2,{'isApp':0x1});var _0x322b54=_[_0x4759('0xd')](_0x2efddf,_0x4759('0xa'));var _0x364f41=[_0x4759('0xe'),_0x4759('0xf')];var _0x5e9ace=[];var _0x50b058=[];for(var _0x36506c in _0x322b54){if(_0x322b54[_0x4759('0x10')](_0x36506c)){_0x2b15be[_0x4759('0x11')]=0x2;_0x2b15be[_0x4759('0x12')]=[];_0x2b15be[_0x4759('0x13')]=_[_0x4759('0x14')](_0x5702b7,{'exten':_0x322b54[_0x36506c][0x0]['exten']});_0x2b15be[_0x4759('0x12')][_0x4759('0x15')]({'type':_0x322b54[_0x36506c][0x0][_0x4759('0x16')],'app':_0x4759('0x17'),'appdata':util[_0x4759('0x18')](_0x4759('0x19'),_0x322b54[_0x36506c][0x0][_0x4759('0x16')]),'context':_0x322b54[_0x36506c][0x0][_0x4759('0x1a')],'exten':_0x322b54[_0x36506c][0x0][_0x4759('0xa')],'priority':_0x2b15be[_0x4759('0x11')]++,'VoiceExtensionId':_0x322b54[_0x36506c][0x0][_0x4759('0x1b')]});if(_0x322b54[_0x36506c][0x0][_0x4759('0x16')]==='inbound'){_0x2b15be['extensions'][_0x4759('0x15')]({'type':_0x322b54[_0x36506c][0x0][_0x4759('0x16')],'app':_0x4759('0x17'),'appdata':_0x4759('0x1c')+_0x322b54[_0x36506c][0x0][_0x4759('0x1b')],'context':_0x322b54[_0x36506c][0x0][_0x4759('0x1a')],'exten':_0x322b54[_0x36506c][0x0][_0x4759('0xa')],'priority':_0x2b15be[_0x4759('0x11')]++,'VoiceExtensionId':_0x322b54[_0x36506c][0x0][_0x4759('0x1b')]});}else if(_0x322b54[_0x36506c][0x0][_0x4759('0x16')]===_0x4759('0x1d')){if(_0x2b15be[_0x4759('0x13')]){_0x2b15be[_0x4759('0x12')][_0x4759('0x15')]({'type':_0x322b54[_0x36506c][0x0]['type'],'app':_0x4759('0x17'),'appdata':_0x4759('0x1e')+(_0x2b15be['extension'][_0x4759('0x1f')]?_0x4759('0x20')+_0x2b15be[_0x4759('0x13')][_0x4759('0x1f')]+'}':_0x4759('0x21')),'context':_0x322b54[_0x36506c][0x0][_0x4759('0x1a')],'exten':_0x322b54[_0x36506c][0x0]['exten'],'priority':_0x2b15be[_0x4759('0x11')]++,'VoiceExtensionId':_0x322b54[_0x36506c][0x0][_0x4759('0x1b')]});}_0x2b15be['extensions']['push']({'type':_0x322b54[_0x36506c][0x0][_0x4759('0x16')],'app':_0x4759('0x17'),'appdata':_0x4759('0x1c')+_0x322b54[_0x36506c][0x0][_0x4759('0x1b')],'context':_0x322b54[_0x36506c][0x0][_0x4759('0x1a')],'exten':_0x322b54[_0x36506c][0x0][_0x4759('0xa')],'priority':_0x2b15be[_0x4759('0x11')]++,'VoiceExtensionId':_0x322b54[_0x36506c][0x0]['VoiceExtensionId']});var _0x20e391=_0x2b15be[_0x4759('0x11')]++;_0x2b15be[_0x4759('0x12')][_0x4759('0x15')]({'type':_0x322b54[_0x36506c][0x0][_0x4759('0x16')],'app':_0x4759('0x22'),'appdata':_0x4759('0x23')+(_0x20e391+0x2)+_0x4759('0x24')+(_0x20e391+0x1)+')','context':_0x322b54[_0x36506c][0x0][_0x4759('0x1a')],'exten':_0x322b54[_0x36506c][0x0][_0x4759('0xa')],'priority':_0x20e391,'VoiceExtensionId':_0x322b54[_0x36506c][0x0][_0x4759('0x1b')]});if(_0x2b15be[_0x4759('0x13')]){_0x2b15be[_0x4759('0x12')][_0x4759('0x15')]({'type':_0x322b54[_0x36506c][0x0][_0x4759('0x16')],'app':_0x4759('0x17'),'appdata':_0x2b15be['extension'][_0x4759('0x1f')]?_0x4759('0x25')+_0x2b15be[_0x4759('0x13')][_0x4759('0x1f')]+'}':'CDR(prefix)=noprefix','context':_0x322b54[_0x36506c][0x0][_0x4759('0x1a')],'exten':_0x322b54[_0x36506c][0x0]['exten'],'priority':_0x2b15be['priority']++,'VoiceExtensionId':_0x322b54[_0x36506c][0x0][_0x4759('0x1b')]});}_0x2b15be['extensions'][_0x4759('0x15')]({'type':_0x322b54[_0x36506c][0x0][_0x4759('0x16')],'app':_0x4759('0x17'),'appdata':_0x4759('0x26')+_0x322b54[_0x36506c][0x0][_0x4759('0x1b')],'context':_0x322b54[_0x36506c][0x0][_0x4759('0x1a')],'exten':_0x322b54[_0x36506c][0x0][_0x4759('0xa')],'priority':_0x2b15be[_0x4759('0x11')]++,'VoiceExtensionId':_0x322b54[_0x36506c][0x0]['VoiceExtensionId']});if(_0x2b15be['extension']&&_0x2b15be['extension'][_0x4759('0x10')]('recordingFormat')&&_0x2b15be[_0x4759('0x13')][_0x4759('0x27')]!==_0x4759('0x28')){_0x2b15be[_0x4759('0x12')][_0x4759('0x15')]({'type':_0x322b54[_0x36506c][0x0][_0x4759('0x16')],'app':_0x4759('0x17'),'appdata':_0x4759('0x29'),'context':_0x322b54[_0x36506c][0x0][_0x4759('0x1a')],'exten':_0x322b54[_0x36506c][0x0]['exten'],'priority':_0x2b15be[_0x4759('0x11')]++,'VoiceExtensionId':_0x322b54[_0x36506c][0x0][_0x4759('0x1b')]});_0x2b15be['extensions'][_0x4759('0x15')]({'type':_0x322b54[_0x36506c][0x0][_0x4759('0x16')],'app':_0x4759('0x17'),'appdata':_0x4759('0x2a')+_0x2b15be[_0x4759('0x13')][_0x4759('0x27')]||_0x4759('0x2b'),'context':_0x322b54[_0x36506c][0x0]['context'],'exten':_0x322b54[_0x36506c][0x0]['exten'],'priority':_0x2b15be[_0x4759('0x11')]++,'VoiceExtensionId':_0x322b54[_0x36506c][0x0][_0x4759('0x1b')]});}}_0x2b15be[_0x4759('0x12')][_0x4759('0x15')]({'type':_0x322b54[_0x36506c][0x0]['type'],'app':_0x4759('0x17'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x322b54[_0x36506c][0x0][_0x4759('0x1a')],'exten':_0x322b54[_0x36506c][0x0][_0x4759('0xa')],'priority':_0x2b15be[_0x4759('0x11')]++,'VoiceExtensionId':_0x322b54[_0x36506c][0x0][_0x4759('0x1b')]});_0x2b15be[_0x4759('0x12')]['push']({'type':_0x322b54[_0x36506c][0x0][_0x4759('0x16')],'app':'Set','appdata':_0x4759('0x2c'),'context':_0x322b54[_0x36506c][0x0][_0x4759('0x1a')],'exten':_0x322b54[_0x36506c][0x0][_0x4759('0xa')],'priority':_0x2b15be[_0x4759('0x11')]++,'VoiceExtensionId':_0x322b54[_0x36506c][0x0]['VoiceExtensionId']});_0x2b15be[_0x4759('0x12')][_0x4759('0x15')]({'type':_0x322b54[_0x36506c][0x0][_0x4759('0x16')],'app':'Set','appdata':_0x4759('0x2d'),'context':_0x322b54[_0x36506c][0x0][_0x4759('0x1a')],'exten':_0x322b54[_0x36506c][0x0][_0x4759('0xa')],'priority':_0x2b15be[_0x4759('0x11')]++,'VoiceExtensionId':_0x322b54[_0x36506c][0x0][_0x4759('0x1b')]});for(var _0x2f3229=0x0,_0x43e2b3=0x0;_0x2f3229<_0x322b54[_0x36506c][_0x4759('0x2e')];_0x2f3229+=0x1,_0x43e2b3=0x0){var _0x35b56f=_0x322b54[_0x36506c][_0x2f3229];if(_0x35b56f[_0x4759('0x16')]){_0x35b56f[_0x4759('0x16')]=_0x35b56f[_0x4759('0x16')][_0x4759('0x2f')]();}var _0x26532f=[];var _0x4ef439=[];delete _0x35b56f['id'];delete _0x35b56f[_0x4759('0x30')];delete _0x35b56f['updatedAt'];var _0x59a972=_0x35b56f[_0x4759('0x31')]!==_0x4759('0x32')?[_0x35b56f[_0x4759('0x31')]]:_0x35b56f[_0x4759('0x7')]?_[_0x4759('0x9')](_['filter'](_0x2b15be['intervals'],{'IntervalId':_0x35b56f['IntervalId']}),_0x4759('0x31')):[];if(_0x35b56f['hasOwnProperty'](_0x4759('0x33'))){if(_0x35b56f[_0x4759('0x33')]&&_0x35b56f[_0x4759('0x33')]!=='--'){_0x26532f[_0x4759('0x15')]({'type':_0x35b56f[_0x4759('0x16')],'app':_0x4759('0x17'),'appdata':_0x4759('0x34')+_0x35b56f[_0x4759('0x33')],'context':_0x35b56f[_0x4759('0x1a')],'exten':_0x35b56f[_0x4759('0xa')],'priority':_0x59a972['length']+_0x2b15be[_0x4759('0x11')]+_0x43e2b3++,'VoiceExtensionId':_0x35b56f['VoiceExtensionId']});}}if(_0x35b56f['type']===_0x4759('0x1d')&&_0x35b56f[_0x4759('0x10')](_0x4759('0x35'))){if(_0x35b56f[_0x4759('0x35')]){_0x26532f['push']({'type':_0x35b56f[_0x4759('0x16')],'app':_0x4759('0x22'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x35b56f[_0x4759('0x35')]+')','context':_0x35b56f['context'],'exten':_0x35b56f['exten'],'priority':_0x59a972[_0x4759('0x2e')]+_0x2b15be[_0x4759('0x11')]+_0x43e2b3++,'VoiceExtensionId':_0x35b56f[_0x4759('0x1b')]});}else{_0x26532f['push']({'type':_0x35b56f[_0x4759('0x16')],'app':_0x4759('0x22'),'appdata':_0x4759('0x36'),'context':_0x35b56f[_0x4759('0x1a')],'exten':_0x35b56f[_0x4759('0xa')],'priority':_0x59a972[_0x4759('0x2e')]+_0x2b15be[_0x4759('0x11')]+_0x43e2b3++,'VoiceExtensionId':_0x35b56f[_0x4759('0x1b')]});}}if(_0x35b56f['hasOwnProperty'](_0x4759('0x37'))){if(_0x364f41[_0x4759('0x38')](_0x35b56f['app'][_0x4759('0x2f')]())>=0x0&&_0x35b56f[_0x4759('0x39')]!==_0x4759('0x3a')){if(_0x35b56f['answer']){_0x26532f[_0x4759('0x15')]({'type':_0x35b56f[_0x4759('0x16')],'app':_0x4759('0x22'),'appdata':_0x4759('0x3b'),'context':_0x35b56f[_0x4759('0x1a')],'exten':_0x35b56f['exten'],'priority':_0x59a972['length']+_0x2b15be[_0x4759('0x11')]+_0x43e2b3++,'VoiceExtensionId':_0x35b56f[_0x4759('0x1b')]});_0x26532f[_0x4759('0x15')]({'type':_0x35b56f[_0x4759('0x16')],'app':'Set','appdata':_0x4759('0x3c'),'context':_0x35b56f['context'],'exten':_0x35b56f[_0x4759('0xa')],'priority':_0x59a972[_0x4759('0x2e')]+_0x2b15be[_0x4759('0x11')]+_0x43e2b3++,'VoiceExtensionId':_0x35b56f[_0x4759('0x1b')]});}else{_0x26532f['push']({'type':_0x35b56f[_0x4759('0x16')],'app':_0x4759('0x22'),'appdata':_0x4759('0x3d'),'context':_0x35b56f[_0x4759('0x1a')],'exten':_0x35b56f[_0x4759('0xa')],'priority':_0x59a972[_0x4759('0x2e')]+_0x2b15be['priority']+_0x43e2b3++,'VoiceExtensionId':_0x35b56f[_0x4759('0x1b')]});_0x26532f[_0x4759('0x15')]({'type':_0x35b56f[_0x4759('0x16')],'app':'Set','appdata':_0x4759('0x3e'),'context':_0x35b56f['context'],'exten':_0x35b56f[_0x4759('0xa')],'priority':_0x59a972[_0x4759('0x2e')]+_0x2b15be[_0x4759('0x11')]+_0x43e2b3++,'VoiceExtensionId':_0x35b56f[_0x4759('0x1b')]});}}}for(var _0x2294d9=0x0;_0x2294d9<_0x59a972[_0x4759('0x2e')];_0x2294d9+=0x1){var _0x15e6ca=_0x2b15be[_0x4759('0x11')]+_0x59a972[_0x4759('0x2e')];var _0x10bf29=_0x2294d9===_0x59a972[_0x4759('0x2e')]-0x1?_0x2b15be[_0x4759('0x11')]+_0x26532f['length']+_0x4ef439['length']+0x2:_0x2b15be[_0x4759('0x11')]+_0x2294d9+0x1;_0x26532f['splice'](_0x2294d9,0x0,{'type':_0x35b56f[_0x4759('0x16')],'app':_0x4759('0x3f'),'appdata':_0x59a972[_0x2294d9]+'?'+_0x35b56f[_0x4759('0x1a')]+',${EXTEN},'+_0x15e6ca+':'+_0x35b56f[_0x4759('0x1a')]+_0x4759('0x40')+_0x10bf29,'exten':_0x35b56f[_0x4759('0xa')],'context':_0x35b56f[_0x4759('0x1a')],'priority':_0x2b15be['priority']+_0x2294d9,'VoiceExtensionId':_0x322b54[_0x36506c][0x0][_0x4759('0x1b')]});}_0x35b56f['priority']=_0x26532f[_0x4759('0x2e')]?_[_0x4759('0x41')](_0x26532f)[_0x4759('0x11')]+0x1:_0x2b15be['priority'];_0x2b15be[_0x4759('0x11')]=(_0x4ef439[_0x4759('0x2e')]?_[_0x4759('0x41')](_0x4ef439)[_0x4759('0x11')]:_0x35b56f[_0x4759('0x11')])+0x1;_0x2b15be[_0x4759('0x12')]=_[_0x4759('0x42')](_0x2b15be[_0x4759('0x12')],_0x26532f,[_0x35b56f],_0x4ef439);}_0x2b15be['extensions']['push']({'type':_0x322b54[_0x36506c][0x0][_0x4759('0x16')],'app':_0x4759('0x43'),'exten':_0x322b54[_0x36506c][0x0][_0x4759('0xa')],'context':_0x322b54[_0x36506c][0x0]['context'],'priority':_0x2b15be[_0x4759('0x11')],'VoiceExtensionId':_0x322b54[_0x36506c][0x0][_0x4759('0x1b')]});_0x5e9ace[_0x4759('0x15')](_0x322b54[_0x36506c][0x0]['VoiceExtensionId']);_0x50b058=_[_0x4759('0x42')](_0x50b058,_0x2b15be['extensions']);}}return _0x260c8e[_0x4759('0x44')](function(_0xd71896){return _0x260c8e['models'][_0x4759('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x5e9ace}},'transaction':_0xd71896})[_0x4759('0x4')](function(_0x206aec){return _0x260c8e[_0x4759('0x1')][_0x4759('0x6')][_0x4759('0x45')](_[_0x4759('0x46')](_0x50b058,_0x4759('0x11')),{'transaction':_0xd71896});});});})[_0x4759('0x47')](function(_0x4ffcd5){console[_0x4759('0x48')](_0x4ffcd5);});}exports['rewrite']=rewrite;
\ No newline at end of file
index 34235a3..1445758 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5da=['VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','then','get','query','VoiceQueueId','onlyIfOpen','sequelize','all','CmList','Campaign','always','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','hasOwnProperty','data','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','CmContact','create','keys','push','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','checkHopper','inspect','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','insert','ListId\x20=\x20?','id\x20IN\x20?','cm_hopper_black'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xd5da,0x172));var _0xad5d=function(_0x5c8092,_0x25120e){_0x5c8092=_0x5c8092-0x0;var _0x1dffd3=_0xd5da[_0x5c8092];return _0x1dffd3;};'use strict';var BPromise=require(_0xad5d('0x0'));var util=require('util');var _=require(_0xad5d('0x1'));var fs=require('fs');var squel=require(_0xad5d('0x2'));var Papa=require(_0xad5d('0x3'));var Redis=require(_0xad5d('0x4'));var db=require(_0xad5d('0x5'))['db'];var config=require(_0xad5d('0x6'));var logger=require('../../../config/logger')('api');config[_0xad5d('0x7')]=_[_0xad5d('0x8')](config['redis'],{'host':_0xad5d('0x9'),'port':0x18eb});var socket=require(_0xad5d('0xa'))(new Redis(config[_0xad5d('0x7')]));require(_0xad5d('0xb'))[_0xad5d('0xc')](socket);try{if(!process[_0xad5d('0xd')][0x2]||process[_0xad5d('0xd')][0x2]===_0xad5d('0xe')||process[_0xad5d('0xd')][0x2]===_0xad5d('0xf')){throw new Error(_0xad5d('0x10'));}var FILEPATH=process[_0xad5d('0xd')][0x2];if(!process[_0xad5d('0xd')][0x3]||process['argv'][0x3]===_0xad5d('0xe')||process[_0xad5d('0xd')][0x3]===_0xad5d('0xf')||!process[_0xad5d('0xd')][0x4]||process[_0xad5d('0xd')][0x4]===_0xad5d('0xe')||process[_0xad5d('0xd')][0x4]===_0xad5d('0xf')){throw new Error(_0xad5d('0x11'));}var FIELDS=_[_0xad5d('0x12')](process[_0xad5d('0xd')][0x3][_0xad5d('0x13')](','),process[_0xad5d('0xd')][0x4]['split'](','));if(!process[_0xad5d('0xd')][0x5]||process['argv'][0x5]===_0xad5d('0xe')||process[_0xad5d('0xd')][0x5]===_0xad5d('0xf')){throw new Error(_0xad5d('0x14'));}var LISTID=process[_0xad5d('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xad5d('0xd')][0x6]!=='undefined'&&process[_0xad5d('0xd')][0x6]!==_0xad5d('0xf')?process[_0xad5d('0xd')][0x6]:null;var DUPLICATES=process[_0xad5d('0xd')][0x7]&&process[_0xad5d('0xd')][0x7]!==_0xad5d('0xe')&&process[_0xad5d('0xd')][0x7]!==_0xad5d('0xf')?process[_0xad5d('0xd')][0x7]:null;if(!process[_0xad5d('0xd')][0x8]||process[_0xad5d('0xd')][0x8]===_0xad5d('0xe')||process[_0xad5d('0xd')][0x8]==='null'){throw new Error(_0xad5d('0x15'));}var SOCKET_TIMESTAMP=process[_0xad5d('0xd')][0x8];}catch(_0x1188fa){logger['error'](_0x1188fa);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(_0x155d4e,_0x388f53,_0x2eb09a,_0x4678d9){var _0x5a3dc0={'message':_0x388f53};_0x5a3dc0[_0x155d4e]=!![];if(_0x2eb09a){_0x5a3dc0[_0xad5d('0x16')]=_0x2eb09a;}if(_0x4678d9){_0x5a3dc0[_0xad5d('0x17')]=_0x4678d9;}return _0x5a3dc0;}function isEmail(_0x429629){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))*$/[_0xad5d('0x18')](_0x429629);}function checkRow(_0x215fa4,_0x425f0d,_0x5c90b9){return new BPromise(function(_0x5a7dc7,_0xc4054c){if(_[_0xad5d('0x19')](_0x215fa4)){return _0xc4054c(handleCheckRowError(_0xad5d('0x1a'),_0xad5d('0x1b'),null,_0x5c90b9));}if(_0x215fa4[_0xad5d('0x1c')]&&_0x215fa4['errors'][_0xad5d('0x1d')]){var _0x206266=_[_0xad5d('0x1e')](_0x215fa4['errors'],'message')['join'](';');return _0xc4054c(handleCheckRowError(_0xad5d('0x1a'),_0x206266,null,_0x5c90b9));}var _0x201526={};for(var _0x17279e in FIELDS){if(FIELDS[_0xad5d('0x1f')](_0x17279e)&&FIELDS[_0x17279e]){_0x201526[_0x17279e]=_0x215fa4[_0xad5d('0x20')][0x0][FIELDS[_0x17279e]]||_0x215fa4['data'][0x0]['\ufeff'+FIELDS[_0x17279e]];}}if(!_0x201526['firstName']){return _0xc4054c(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x5c90b9));}if(!_0x201526[_0xad5d('0x21')]){return _0xc4054c(handleCheckRowError(_0xad5d('0x1a'),_0xad5d('0x22'),null,_0x5c90b9));}if(_0x201526[_0xad5d('0x23')]){var _0x5d2b01=moment(_0x201526[_0xad5d('0x23')],_0xad5d('0x24'));if(!_0x5d2b01[_0xad5d('0x25')]()){return _0xc4054c(handleCheckRowError(_0xad5d('0x1a'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x5c90b9));}}if(_0x201526[_0xad5d('0x26')]){if(!isEmail(_0x201526[_0xad5d('0x26')])){return _0xc4054c(handleCheckRowError(_0xad5d('0x1a'),_0xad5d('0x27'),null,_0x5c90b9));}}_0x201526[_0xad5d('0x28')]=LISTID;_0x201526['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xad5d('0x1d')]&&_0x425f0d){var _0xf11e65={};for(var _0x28179c=0x0,_0x4874e5=DUPLICATES[_0xad5d('0x1d')];_0x28179c<_0x4874e5;_0x28179c+=0x1){_0xf11e65[DUPLICATES[_0x28179c]]=_0x201526[DUPLICATES[_0x28179c]];}var _0x20960a=_[_0xad5d('0x29')](_0x425f0d,_0xf11e65);if(_0x20960a){return _0xc4054c(handleCheckRowError(_0xad5d('0x2a'),'Duplicate\x20Contact',_0x20960a,_0x5c90b9));}}return db[_0xad5d('0x2b')][_0xad5d('0x2c')](_0x201526,{'raw':!![],'hooks':![],'fields':_[_0xad5d('0x2d')](_0x201526)})['then'](function(_0x56674b){if(DUPLICATES&&DUPLICATES['length']&&_0x425f0d){_0x425f0d[_0xad5d('0x2e')](_['pick'](_0x201526,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x56674b['id'];return _0x5a7dc7();})[_0xad5d('0x2f')](function(_0x21f305){return _0xc4054c(handleCheckRowError('error',_0xad5d('0x30')+(_0x21f305[_0xad5d('0x31')]||JSON[_0xad5d('0x32')](_0x21f305)),null,_0x5c90b9));});});}function checkHopper(){function _0x4eb600(){return function(_0x5c88a2){logger[_0xad5d('0x1a')]('cmContact',_0xad5d('0x33'),util[_0xad5d('0x34')](_0x5c88a2,{'showHidden':![],'depth':null}));};}var _0x259bba=function(_0x1b7f50,_0x183b9b){var _0x45acf0=squel['insert']()['into'](_0xad5d('0x35'))[_0xad5d('0x36')](['phone',_0xad5d('0x37'),_0xad5d('0x38'),_0xad5d('0x28'),_0x183b9b,_0xad5d('0x39'),'updatedAt'],squel[_0xad5d('0x3a')]()[_0xad5d('0x3b')](_0xad5d('0x21'),'phone')[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x37'))[_0xad5d('0x3b')]('id',_0xad5d('0x38'))['field'](LISTID[_0xad5d('0x3d')](),_0xad5d('0x28'))[_0xad5d('0x3b')](_0x1b7f50['id'][_0xad5d('0x3d')](),_0x183b9b)[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x39'))[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x3e'))[_0xad5d('0x3f')](_0xad5d('0x40'))[_0xad5d('0x41')](_0xad5d('0x42'))[_0xad5d('0x41')]('ListId\x20=\x20?',LISTID[_0xad5d('0x3d')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xad5d('0x43'),squel[_0xad5d('0x3a')]()[_0xad5d('0x3b')]('phone')[_0xad5d('0x3f')](_0xad5d('0x35'))[_0xad5d('0x41')](_0x183b9b+_0xad5d('0x44'),_0x1b7f50['id'][_0xad5d('0x3d')]())))[_0xad5d('0x3d')]();return _0x45acf0;};var _0x2fbb88=function(_0x2fa0ba,_0x5d2c98){var _0x2b871d=squel['insert']()[_0xad5d('0x45')](_0xad5d('0x35'))['fromQuery']([_0xad5d('0x21'),'scheduledAt','ContactId',_0xad5d('0x28'),_0x5d2c98,_0xad5d('0x39'),'updatedAt'],squel['select']()[_0xad5d('0x3b')](_0xad5d('0x21'),_0xad5d('0x21'))[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x37'))[_0xad5d('0x3b')]('id',_0xad5d('0x38'))['field'](LISTID[_0xad5d('0x3d')](),_0xad5d('0x28'))[_0xad5d('0x3b')](_0x2fa0ba['id'][_0xad5d('0x3d')](),_0x5d2c98)[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x39'))['field'](_0xad5d('0x3c'),_0xad5d('0x3e'))[_0xad5d('0x3f')]('cm_contacts')['where'](_0xad5d('0x42'))['where']('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0xad5d('0x46')](hopperContacts))[_0xad5d('0x41')](_0xad5d('0x47'))[_0xad5d('0x41')](_0xad5d('0x43'),squel[_0xad5d('0x3a')]()[_0xad5d('0x3b')](_0xad5d('0x48'))[_0xad5d('0x3f')](_0xad5d('0x49'))[_0xad5d('0x41')](_0x5d2c98+_0xad5d('0x44'),_0x2fa0ba['id'][_0xad5d('0x3d')]()))[_0xad5d('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xad5d('0x3b')](_0xad5d('0x21'))['from'](_0xad5d('0x35'))[_0xad5d('0x41')](_0x5d2c98+_0xad5d('0x44'),_0x2fa0ba['id']['toString']())))[_0xad5d('0x3d')]();return _0x2b871d;};function _0x5f1985(_0x5a2263,_0x57e0e3){var _0x547f9f=squel[_0xad5d('0x4a')]()[_0xad5d('0x45')](_0xad5d('0x35'))[_0xad5d('0x36')]([_0xad5d('0x21'),_0xad5d('0x37'),'ContactId','ListId',_0x57e0e3,_0xad5d('0x39'),'updatedAt'],squel[_0xad5d('0x3a')]()['field']('phone',_0xad5d('0x21'))[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x37'))[_0xad5d('0x3b')]('id',_0xad5d('0x38'))['field'](LISTID[_0xad5d('0x3d')](),_0xad5d('0x28'))[_0xad5d('0x3b')](_0x5a2263['id'][_0xad5d('0x3d')](),_0x57e0e3)['field'](_0xad5d('0x3c'),_0xad5d('0x39'))[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x3e'))[_0xad5d('0x3f')](_0xad5d('0x40'))['where'](_0xad5d('0x42'))[_0xad5d('0x41')](_0xad5d('0x4b'),LISTID['toString']())[_0xad5d('0x41')](_0xad5d('0x4c'),squel[_0xad5d('0x46')](hopperContacts))['where'](_0xad5d('0x47')))['toString']();return _0x547f9f;}function _0x472ed7(_0x4a5c63,_0xdb5ffa){var _0x37bde7=squel[_0xad5d('0x4a')]()[_0xad5d('0x45')](_0xad5d('0x4d'))[_0xad5d('0x36')](['phone',_0xad5d('0x38'),_0xad5d('0x28'),_0xdb5ffa,_0xad5d('0x39'),_0xad5d('0x3e')],squel[_0xad5d('0x3a')]()[_0xad5d('0x3b')](_0xad5d('0x21'),'phone')[_0xad5d('0x3b')]('id',_0xad5d('0x38'))[_0xad5d('0x3b')](LISTID[_0xad5d('0x3d')](),_0xad5d('0x28'))[_0xad5d('0x3b')](_0x4a5c63['id'][_0xad5d('0x3d')](),_0xdb5ffa)[_0xad5d('0x3b')](_0xad5d('0x3c'),'createdAt')[_0xad5d('0x3b')]('NOW()',_0xad5d('0x3e'))['from'](_0xad5d('0x40'))['where'](_0xad5d('0x42'))[_0xad5d('0x41')](_0xad5d('0x4b'),LISTID[_0xad5d('0x3d')]())[_0xad5d('0x41')](_0xad5d('0x4c'),squel[_0xad5d('0x46')](hopperContacts))['where'](_0xad5d('0x47')))['toString']();return _0x37bde7;}return db[_0xad5d('0x4e')][_0xad5d('0x4f')]({'where':{'type':_0xad5d('0x50')},'attributes':['id',_0xad5d('0x51')],'include':[{'model':db['CmList'],'as':_0xad5d('0x52'),'where':{'id':LISTID}}]})[_0xad5d('0x53')](function(_0x5aa3a6){var _0x4f2012=[];if(_0x5aa3a6){var _0x37264a;for(var _0x5ca7a7=0x0,_0x23dc29;_0x5ca7a7<_0x5aa3a6[_0xad5d('0x1d')];_0x5ca7a7+=0x1){_0x23dc29=_0x5aa3a6[_0x5ca7a7][_0xad5d('0x54')]({'plain':!![]});switch(_0x23dc29[_0xad5d('0x51')]){case'always':_0x4f2012['push'](db['sequelize'][_0xad5d('0x55')](_0x2fbb88(_0x23dc29,_0xad5d('0x56')))[_0xad5d('0x53')](function(){})[_0xad5d('0x2f')](_0x4eb600()));break;case _0xad5d('0x57'):_0x4f2012[_0xad5d('0x2e')](db[_0xad5d('0x58')]['query'](_0x259bba(_0x23dc29,_0xad5d('0x56')))[_0xad5d('0x53')](function(){})[_0xad5d('0x2f')](_0x4eb600()));break;default:_0x4f2012[_0xad5d('0x2e')](db[_0xad5d('0x58')][_0xad5d('0x55')](_0x5f1985(_0x23dc29,_0xad5d('0x56')))[_0xad5d('0x53')](function(){})[_0xad5d('0x2f')](_0x4eb600()));}}}return _0x4f2012;})[_0xad5d('0x59')]()[_0xad5d('0x53')](function(){return db[_0xad5d('0x4e')][_0xad5d('0x4f')]({'where':{'type':_0xad5d('0x50')},'attributes':['id'],'include':[{'model':db[_0xad5d('0x5a')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x36934b){var _0x57f8b2=[];if(_0x36934b){var _0x48951a;for(var _0xe0775a=0x0,_0x562302;_0xe0775a<_0x36934b[_0xad5d('0x1d')];_0xe0775a+=0x1){_0x562302=_0x36934b[_0xe0775a][_0xad5d('0x54')]({'plain':!![]});_0x57f8b2[_0xad5d('0x2e')](db[_0xad5d('0x58')][_0xad5d('0x55')](_0x472ed7(_0x562302,_0xad5d('0x56')))['then'](function(){})[_0xad5d('0x2f')](_0x4eb600()));}}return _0x57f8b2;})[_0xad5d('0x59')]();})['then'](function(){return db[_0xad5d('0x5b')]['findAll']({'attributes':['id',_0xad5d('0x51')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xad5d('0x53')](function(_0x310ca2){var _0x3e5d57=[];if(_0x310ca2){for(var _0x4379d6=0x0,_0x4c8102;_0x4379d6<_0x310ca2[_0xad5d('0x1d')];_0x4379d6+=0x1){_0x4c8102=_0x310ca2[_0x4379d6][_0xad5d('0x54')]({'plain':!![]});switch(_0x4c8102[_0xad5d('0x51')]){case _0xad5d('0x5c'):_0x3e5d57['push'](db[_0xad5d('0x58')][_0xad5d('0x55')](_0x2fbb88(_0x4c8102,_0xad5d('0x5d')))[_0xad5d('0x53')](function(){})['catch'](_0x4eb600()));break;case _0xad5d('0x57'):_0x3e5d57[_0xad5d('0x2e')](db[_0xad5d('0x58')][_0xad5d('0x55')](_0x259bba(_0x4c8102,'CampaignId'))['then'](function(){})['catch'](_0x4eb600()));break;default:_0x3e5d57[_0xad5d('0x2e')](db['sequelize'][_0xad5d('0x55')](_0x5f1985(_0x4c8102,_0xad5d('0x5d')))[_0xad5d('0x53')](function(){})[_0xad5d('0x2f')](_0x4eb600()));}}}return _0x3e5d57;})[_0xad5d('0x59')]();})['then'](function(){return db['Campaign'][_0xad5d('0x4f')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xad5d('0x5e'),'where':{'id':LISTID}}]})[_0xad5d('0x53')](function(_0x48ff83){var _0x1f2e97=[];if(_0x48ff83){for(var _0x168382=0x0,_0x3c900d;_0x168382<_0x48ff83[_0xad5d('0x1d')];_0x168382+=0x1){_0x3c900d=_0x48ff83[_0x168382][_0xad5d('0x54')]({'plain':!![]});_0x1f2e97['push'](db['sequelize'][_0xad5d('0x55')](_0x472ed7(_0x3c900d,'CampaignId'))['then'](function(){})['catch'](_0x4eb600()));}}return _0x1f2e97;})[_0xad5d('0x59')]();})[_0xad5d('0x2f')](function(_0x50d7e1){logger[_0xad5d('0x1a')](_0xad5d('0x5f'),'generalCheckHopper',_0x50d7e1[_0xad5d('0x31')]);});}var processPromises=function(_0xb132ca){return BPromise['all'](promises)[_0xad5d('0x53')](function(_0x2932e5){})['catch'](function(_0x16c8b1){logger['error'](_0xad5d('0x60'),JSON[_0xad5d('0x32')](_0x16c8b1));})[_0xad5d('0x61')](function(){socket[_0xad5d('0x62')](_0xad5d('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xb132ca){return _0xb132ca[_0xad5d('0x64')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xad5d('0x53')](function(){if(hopperContacts){return checkHopper();}})[_0xad5d('0x53')](function(){socket[_0xad5d('0x62')](_0xad5d('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x1d62c9){logger[_0xad5d('0x1a')](_0xad5d('0x65'),JSON[_0xad5d('0x32')](_0x1d62c9));}finally{process[_0xad5d('0x66')](0x0);}});};process['on'](_0xad5d('0x67'),function(){logger[_0xad5d('0x68')](_0xad5d('0x69'));endCsv();});function main(){return BPromise[_0xad5d('0x6a')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xad5d('0x13')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xad5d('0x53')](function(_0x578347){var _0x4e5b6b=fs[_0xad5d('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xad5d('0x6c')](_0x4e5b6b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x255b79,_0x1cd79d){total+=0x1;var _0x5cc859=total;promises[_0xad5d('0x2e')](checkRow(_0x255b79,_0x578347,_0x5cc859)[_0xad5d('0x53')](function(){success+=0x1;})['catch'](function(_0x30ac44){if(_0x30ac44[_0xad5d('0x1a')]){errors+=0x1;delete _0x30ac44['error'];}else if(_0x30ac44[_0xad5d('0x2a')]){duplicates+=0x1;delete _0x30ac44[_0xad5d('0x2a')];}rows[_0xad5d('0x2e')](_0x30ac44);}));if(total%0xc8===0x0){_0x1cd79d['pause']();return processPromises(_0x1cd79d);}},'complete':function(){return processPromises()[_0xad5d('0x53')](function(){logger[_0xad5d('0x68')](_0xad5d('0x6d'));endCsv();});},'error':function(_0x251f8b,_0x56560){logger['info'](_0xad5d('0x6e'),JSON[_0xad5d('0x32')](_0x251f8b));endCsv();}});})[_0xad5d('0x2f')](function(_0x233070){logger[_0xad5d('0x1a')](_0xad5d('0x6f'),JSON['stringify'](_0x233070));});}main();
\ No newline at end of file
+var _0x18eb=['phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','duplicate','Duplicate\x20Contact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','field','toString','NOW()','createdAt','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','select','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','outbound','BlackLists','get','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','parse','pause','CSV\x20parsed\x20correctly!','stringify','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','undefined','argv','Missing\x20filepath\x20parameter!','null','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','firstName','firstName\x20not\x20specified!','phone'];(function(_0x1291c8,_0x124df8){var _0x26bb22=function(_0x367a15){while(--_0x367a15){_0x1291c8['push'](_0x1291c8['shift']());}};_0x26bb22(++_0x124df8);}(_0x18eb,0x1a2));var _0xb18e=function(_0x20ce38,_0x76e555){_0x20ce38=_0x20ce38-0x0;var _0xa67743=_0x18eb[_0x20ce38];return _0xa67743;};'use strict';var BPromise=require(_0xb18e('0x0'));var util=require(_0xb18e('0x1'));var _=require(_0xb18e('0x2'));var fs=require('fs');var squel=require(_0xb18e('0x3'));var Papa=require('papaparse');var Redis=require(_0xb18e('0x4'));var db=require(_0xb18e('0x5'))['db'];var config=require(_0xb18e('0x6'));var logger=require(_0xb18e('0x7'))(_0xb18e('0x8'));config[_0xb18e('0x9')]=_[_0xb18e('0xa')](config[_0xb18e('0x9')],{'host':_0xb18e('0xb'),'port':0x18eb});var socket=require(_0xb18e('0xc'))(new Redis(config[_0xb18e('0x9')]));require(_0xb18e('0xd'))[_0xb18e('0xe')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0xb18e('0xf')||process[_0xb18e('0x10')][0x2]==='null'){throw new Error(_0xb18e('0x11'));}var FILEPATH=process[_0xb18e('0x10')][0x2];if(!process[_0xb18e('0x10')][0x3]||process[_0xb18e('0x10')][0x3]===_0xb18e('0xf')||process[_0xb18e('0x10')][0x3]==='null'||!process[_0xb18e('0x10')][0x4]||process['argv'][0x4]==='undefined'||process['argv'][0x4]===_0xb18e('0x12')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xb18e('0x13')](process['argv'][0x3][_0xb18e('0x14')](','),process[_0xb18e('0x10')][0x4][_0xb18e('0x14')](','));if(!process[_0xb18e('0x10')][0x5]||process['argv'][0x5]===_0xb18e('0xf')||process[_0xb18e('0x10')][0x5]===_0xb18e('0x12')){throw new Error(_0xb18e('0x15'));}var LISTID=process[_0xb18e('0x10')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xb18e('0x10')][0x6]!==_0xb18e('0xf')&&process['argv'][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0xb18e('0x10')][0x7]&&process[_0xb18e('0x10')][0x7]!==_0xb18e('0xf')&&process['argv'][0x7]!==_0xb18e('0x12')?process['argv'][0x7]:null;if(!process[_0xb18e('0x10')][0x8]||process[_0xb18e('0x10')][0x8]==='undefined'||process[_0xb18e('0x10')][0x8]===_0xb18e('0x12')){throw new Error(_0xb18e('0x16'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4572ef){logger['error'](_0x4572ef);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(_0x48f42e,_0x4085dd,_0x28fb20,_0x3afd8d){var _0x1900eb={'message':_0x4085dd};_0x1900eb[_0x48f42e]=!![];if(_0x28fb20){_0x1900eb[_0xb18e('0x17')]=_0x28fb20;}if(_0x3afd8d){_0x1900eb[_0xb18e('0x18')]=_0x3afd8d;}return _0x1900eb;}function isEmail(_0x23f8db){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))*$/[_0xb18e('0x19')](_0x23f8db);}function checkRow(_0x4e5f96,_0x3dd838,_0x41de38){return new BPromise(function(_0x286176,_0x4d6238){if(_[_0xb18e('0x1a')](_0x4e5f96)){return _0x4d6238(handleCheckRowError(_0xb18e('0x1b'),_0xb18e('0x1c'),null,_0x41de38));}if(_0x4e5f96[_0xb18e('0x1d')]&&_0x4e5f96[_0xb18e('0x1d')][_0xb18e('0x1e')]){var _0x5bdd3f=_[_0xb18e('0x1f')](_0x4e5f96[_0xb18e('0x1d')],_0xb18e('0x20'))[_0xb18e('0x21')](';');return _0x4d6238(handleCheckRowError(_0xb18e('0x1b'),_0x5bdd3f,null,_0x41de38));}var _0x414b5f={};for(var _0x20ad04 in FIELDS){if(FIELDS[_0xb18e('0x22')](_0x20ad04)&&FIELDS[_0x20ad04]){_0x414b5f[_0x20ad04]=_0x4e5f96['data'][0x0][FIELDS[_0x20ad04]]||_0x4e5f96['data'][0x0]['\ufeff'+FIELDS[_0x20ad04]];}}if(!_0x414b5f[_0xb18e('0x23')]){return _0x4d6238(handleCheckRowError(_0xb18e('0x1b'),_0xb18e('0x24'),null,_0x41de38));}if(!_0x414b5f[_0xb18e('0x25')]){return _0x4d6238(handleCheckRowError(_0xb18e('0x1b'),_0xb18e('0x26'),null,_0x41de38));}if(_0x414b5f[_0xb18e('0x27')]){var _0x48c95d=moment(_0x414b5f[_0xb18e('0x27')],_0xb18e('0x28'));if(!_0x48c95d[_0xb18e('0x29')]()){return _0x4d6238(handleCheckRowError(_0xb18e('0x1b'),_0xb18e('0x2a'),null,_0x41de38));}}if(_0x414b5f[_0xb18e('0x2b')]){if(!isEmail(_0x414b5f[_0xb18e('0x2b')])){return _0x4d6238(handleCheckRowError(_0xb18e('0x1b'),_0xb18e('0x2c'),null,_0x41de38));}}_0x414b5f[_0xb18e('0x2d')]=LISTID;_0x414b5f['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb18e('0x1e')]&&_0x3dd838){var _0x50221e={};for(var _0x228088=0x0,_0x32b98d=DUPLICATES['length'];_0x228088<_0x32b98d;_0x228088+=0x1){_0x50221e[DUPLICATES[_0x228088]]=_0x414b5f[DUPLICATES[_0x228088]];}var _0x50a939=_['find'](_0x3dd838,_0x50221e);if(_0x50a939){return _0x4d6238(handleCheckRowError(_0xb18e('0x2e'),_0xb18e('0x2f'),_0x50a939,_0x41de38));}}return db['CmContact'][_0xb18e('0x30')](_0x414b5f,{'raw':!![],'hooks':![],'fields':_[_0xb18e('0x31')](_0x414b5f)})[_0xb18e('0x32')](function(_0x5cd2f1){if(DUPLICATES&&DUPLICATES[_0xb18e('0x1e')]&&_0x3dd838){_0x3dd838[_0xb18e('0x33')](_[_0xb18e('0x34')](_0x414b5f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5cd2f1['id'];return _0x286176();})[_0xb18e('0x35')](function(_0x5f499c){return _0x4d6238(handleCheckRowError('error',_0xb18e('0x36')+(_0x5f499c[_0xb18e('0x20')]||JSON['stringify'](_0x5f499c)),null,_0x41de38));});});}function checkHopper(){function _0xc83aff(){return function(_0x235637){logger['error']('cmContact',_0xb18e('0x37'),util[_0xb18e('0x38')](_0x235637,{'showHidden':![],'depth':null}));};}var _0x48ed2c=function(_0x15dc97,_0x24426c){var _0x42277a=squel[_0xb18e('0x39')]()[_0xb18e('0x3a')](_0xb18e('0x3b'))[_0xb18e('0x3c')](['phone',_0xb18e('0x3d'),_0xb18e('0x3e'),_0xb18e('0x2d'),_0x24426c,'createdAt',_0xb18e('0x3f')],squel['select']()[_0xb18e('0x40')]('phone',_0xb18e('0x25'))[_0xb18e('0x40')]('NOW()',_0xb18e('0x3d'))[_0xb18e('0x40')]('id',_0xb18e('0x3e'))[_0xb18e('0x40')](LISTID[_0xb18e('0x41')](),_0xb18e('0x2d'))[_0xb18e('0x40')](_0x15dc97['id']['toString'](),_0x24426c)[_0xb18e('0x40')](_0xb18e('0x42'),_0xb18e('0x43'))['field'](_0xb18e('0x42'),_0xb18e('0x3f'))['from'](_0xb18e('0x44'))[_0xb18e('0x45')]('deletedAt\x20IS\x20NULL')[_0xb18e('0x45')](_0xb18e('0x46'),LISTID['toString']())['where'](_0xb18e('0x47'))[_0xb18e('0x45')](_0xb18e('0x48'),squel['select']()[_0xb18e('0x40')]('phone')[_0xb18e('0x49')](_0xb18e('0x3b'))[_0xb18e('0x45')](_0x24426c+_0xb18e('0x4a'),_0x15dc97['id'][_0xb18e('0x41')]())))['toString']();return _0x42277a;};var _0xb2bfcc=function(_0x55fc83,_0x537258){var _0x37b752=squel[_0xb18e('0x39')]()[_0xb18e('0x3a')](_0xb18e('0x3b'))[_0xb18e('0x3c')]([_0xb18e('0x25'),'scheduledAt',_0xb18e('0x3e'),'ListId',_0x537258,'createdAt',_0xb18e('0x3f')],squel['select']()[_0xb18e('0x40')](_0xb18e('0x25'),_0xb18e('0x25'))[_0xb18e('0x40')](_0xb18e('0x42'),_0xb18e('0x3d'))[_0xb18e('0x40')]('id',_0xb18e('0x3e'))[_0xb18e('0x40')](LISTID[_0xb18e('0x41')](),_0xb18e('0x2d'))['field'](_0x55fc83['id'][_0xb18e('0x41')](),_0x537258)[_0xb18e('0x40')]('NOW()',_0xb18e('0x43'))['field']('NOW()',_0xb18e('0x3f'))['from'](_0xb18e('0x44'))[_0xb18e('0x45')](_0xb18e('0x4b'))['where'](_0xb18e('0x46'),LISTID[_0xb18e('0x41')]())[_0xb18e('0x45')](_0xb18e('0x4c'),squel[_0xb18e('0x4d')](hopperContacts))[_0xb18e('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0xb18e('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb18e('0x4e')]()['field'](_0xb18e('0x4f'))['from'](_0xb18e('0x50'))['where'](_0x537258+_0xb18e('0x4a'),_0x55fc83['id'][_0xb18e('0x41')]()))[_0xb18e('0x45')](_0xb18e('0x48'),squel[_0xb18e('0x4e')]()['field'](_0xb18e('0x25'))[_0xb18e('0x49')](_0xb18e('0x3b'))[_0xb18e('0x45')](_0x537258+_0xb18e('0x4a'),_0x55fc83['id'][_0xb18e('0x41')]())))[_0xb18e('0x41')]();return _0x37b752;};function _0x445793(_0x555649,_0x1b8033){var _0x1e34a1=squel['insert']()['into'](_0xb18e('0x3b'))['fromQuery']([_0xb18e('0x25'),_0xb18e('0x3d'),_0xb18e('0x3e'),_0xb18e('0x2d'),_0x1b8033,_0xb18e('0x43'),_0xb18e('0x3f')],squel[_0xb18e('0x4e')]()[_0xb18e('0x40')](_0xb18e('0x25'),_0xb18e('0x25'))[_0xb18e('0x40')]('NOW()',_0xb18e('0x3d'))[_0xb18e('0x40')]('id',_0xb18e('0x3e'))['field'](LISTID[_0xb18e('0x41')](),'ListId')[_0xb18e('0x40')](_0x555649['id'][_0xb18e('0x41')](),_0x1b8033)[_0xb18e('0x40')](_0xb18e('0x42'),_0xb18e('0x43'))[_0xb18e('0x40')](_0xb18e('0x42'),_0xb18e('0x3f'))[_0xb18e('0x49')](_0xb18e('0x44'))[_0xb18e('0x45')](_0xb18e('0x4b'))[_0xb18e('0x45')](_0xb18e('0x46'),LISTID[_0xb18e('0x41')]())[_0xb18e('0x45')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0xb18e('0x45')](_0xb18e('0x47')))[_0xb18e('0x41')]();return _0x1e34a1;}function _0x437d0f(_0x4831f0,_0x1aaeef){var _0x6bc144=squel[_0xb18e('0x39')]()['into'](_0xb18e('0x51'))['fromQuery']([_0xb18e('0x25'),'ContactId','ListId',_0x1aaeef,_0xb18e('0x43'),'updatedAt'],squel[_0xb18e('0x4e')]()[_0xb18e('0x40')](_0xb18e('0x25'),'phone')[_0xb18e('0x40')]('id',_0xb18e('0x3e'))[_0xb18e('0x40')](LISTID[_0xb18e('0x41')](),_0xb18e('0x2d'))[_0xb18e('0x40')](_0x4831f0['id'][_0xb18e('0x41')](),_0x1aaeef)[_0xb18e('0x40')](_0xb18e('0x42'),_0xb18e('0x43'))[_0xb18e('0x40')](_0xb18e('0x42'),_0xb18e('0x3f'))[_0xb18e('0x49')](_0xb18e('0x44'))['where']('deletedAt\x20IS\x20NULL')[_0xb18e('0x45')](_0xb18e('0x46'),LISTID[_0xb18e('0x41')]())[_0xb18e('0x45')](_0xb18e('0x4c'),squel[_0xb18e('0x4d')](hopperContacts))[_0xb18e('0x45')](_0xb18e('0x47')))[_0xb18e('0x41')]();return _0x6bc144;}return db[_0xb18e('0x52')][_0xb18e('0x53')]({'where':{'type':'outbound'},'attributes':['id',_0xb18e('0x54')],'include':[{'model':db[_0xb18e('0x55')],'as':_0xb18e('0x56'),'where':{'id':LISTID}}]})[_0xb18e('0x32')](function(_0x215f00){var _0x17f96=[];if(_0x215f00){var _0x238361;for(var _0x491639=0x0,_0xaa9408;_0x491639<_0x215f00[_0xb18e('0x1e')];_0x491639+=0x1){_0xaa9408=_0x215f00[_0x491639]['get']({'plain':!![]});switch(_0xaa9408[_0xb18e('0x54')]){case _0xb18e('0x57'):_0x17f96['push'](db[_0xb18e('0x58')][_0xb18e('0x59')](_0xb2bfcc(_0xaa9408,_0xb18e('0x5a')))[_0xb18e('0x32')](function(){})[_0xb18e('0x35')](_0xc83aff()));break;case _0xb18e('0x5b'):_0x17f96[_0xb18e('0x33')](db['sequelize']['query'](_0x48ed2c(_0xaa9408,_0xb18e('0x5a')))[_0xb18e('0x32')](function(){})[_0xb18e('0x35')](_0xc83aff()));break;default:_0x17f96[_0xb18e('0x33')](db[_0xb18e('0x58')][_0xb18e('0x59')](_0x445793(_0xaa9408,'VoiceQueueId'))[_0xb18e('0x32')](function(){})['catch'](_0xc83aff()));}}}return _0x17f96;})[_0xb18e('0x5c')]()[_0xb18e('0x32')](function(){return db['VoiceQueue'][_0xb18e('0x53')]({'where':{'type':_0xb18e('0x5d')},'attributes':['id'],'include':[{'model':db[_0xb18e('0x55')],'as':_0xb18e('0x5e'),'where':{'id':LISTID}}]})[_0xb18e('0x32')](function(_0x371703){var _0xa20389=[];if(_0x371703){var _0x483d11;for(var _0x4d109d=0x0,_0x152735;_0x4d109d<_0x371703['length'];_0x4d109d+=0x1){_0x152735=_0x371703[_0x4d109d]['get']({'plain':!![]});_0xa20389[_0xb18e('0x33')](db[_0xb18e('0x58')][_0xb18e('0x59')](_0x437d0f(_0x152735,_0xb18e('0x5a')))[_0xb18e('0x32')](function(){})['catch'](_0xc83aff()));}}return _0xa20389;})[_0xb18e('0x5c')]();})[_0xb18e('0x32')](function(){return db['Campaign'][_0xb18e('0x53')]({'attributes':['id',_0xb18e('0x54')],'include':[{'model':db[_0xb18e('0x55')],'as':_0xb18e('0x56'),'where':{'id':LISTID}}]})[_0xb18e('0x32')](function(_0x14003f){var _0xf76a51=[];if(_0x14003f){for(var _0x4a8654=0x0,_0x10b082;_0x4a8654<_0x14003f[_0xb18e('0x1e')];_0x4a8654+=0x1){_0x10b082=_0x14003f[_0x4a8654][_0xb18e('0x5f')]({'plain':!![]});switch(_0x10b082[_0xb18e('0x54')]){case'always':_0xf76a51[_0xb18e('0x33')](db[_0xb18e('0x58')]['query'](_0xb2bfcc(_0x10b082,_0xb18e('0x60')))[_0xb18e('0x32')](function(){})['catch'](_0xc83aff()));break;case _0xb18e('0x5b'):_0xf76a51[_0xb18e('0x33')](db['sequelize'][_0xb18e('0x59')](_0x48ed2c(_0x10b082,'CampaignId'))[_0xb18e('0x32')](function(){})['catch'](_0xc83aff()));break;default:_0xf76a51[_0xb18e('0x33')](db[_0xb18e('0x58')][_0xb18e('0x59')](_0x445793(_0x10b082,_0xb18e('0x60')))[_0xb18e('0x32')](function(){})[_0xb18e('0x35')](_0xc83aff()));}}}return _0xf76a51;})[_0xb18e('0x5c')]();})[_0xb18e('0x32')](function(){return db['Campaign'][_0xb18e('0x53')]({'attributes':['id'],'include':[{'model':db[_0xb18e('0x55')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xb18e('0x32')](function(_0x11eb27){var _0x229184=[];if(_0x11eb27){for(var _0x1bf832=0x0,_0x528795;_0x1bf832<_0x11eb27[_0xb18e('0x1e')];_0x1bf832+=0x1){_0x528795=_0x11eb27[_0x1bf832][_0xb18e('0x5f')]({'plain':!![]});_0x229184['push'](db['sequelize'][_0xb18e('0x59')](_0x437d0f(_0x528795,_0xb18e('0x60')))['then'](function(){})['catch'](_0xc83aff()));}}return _0x229184;})[_0xb18e('0x5c')]();})[_0xb18e('0x35')](function(_0x3b3f4a){logger[_0xb18e('0x1b')](_0xb18e('0x61'),_0xb18e('0x62'),_0x3b3f4a[_0xb18e('0x20')]);});}var processPromises=function(_0x5f25e2){return BPromise[_0xb18e('0x5c')](promises)[_0xb18e('0x32')](function(_0x18c62f){})[_0xb18e('0x35')](function(_0x32aa0f){logger[_0xb18e('0x1b')](_0xb18e('0x63'),JSON['stringify'](_0x32aa0f));})[_0xb18e('0x64')](function(){socket[_0xb18e('0x65')](_0xb18e('0x66')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5f25e2){return _0x5f25e2[_0xb18e('0x67')]();}});};var endCsv=function(){return BPromise[_0xb18e('0x68')]()[_0xb18e('0x32')](function(){if(hopperContacts){return checkHopper();}})[_0xb18e('0x32')](function(){socket[_0xb18e('0x65')](_0xb18e('0x66')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x71882e){logger['error'](_0xb18e('0x69'),JSON['stringify'](_0x71882e));}finally{process[_0xb18e('0x6a')](0x0);}});};process['on'](_0xb18e('0x6b'),function(){logger[_0xb18e('0x6c')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xb18e('0x68')]()[_0xb18e('0x32')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0xb18e('0x53')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xb18e('0x32')](function(_0x4aae7a){var _0x1be706=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb18e('0x6d')](_0x1be706,{'header':!![],'skipEmptyLines':!![],'step':function(_0x103995,_0x5f09d5){total+=0x1;var _0x48160e=total;promises['push'](checkRow(_0x103995,_0x4aae7a,_0x48160e)[_0xb18e('0x32')](function(){success+=0x1;})['catch'](function(_0x337d52){if(_0x337d52[_0xb18e('0x1b')]){errors+=0x1;delete _0x337d52[_0xb18e('0x1b')];}else if(_0x337d52[_0xb18e('0x2e')]){duplicates+=0x1;delete _0x337d52[_0xb18e('0x2e')];}rows[_0xb18e('0x33')](_0x337d52);}));if(total%0xc8===0x0){_0x5f09d5[_0xb18e('0x6e')]();return processPromises(_0x5f09d5);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0xb18e('0x6f'));endCsv();});},'error':function(_0x13d40e,_0x205a5d){logger[_0xb18e('0x6c')]('CSV\x20parse\x20error',JSON[_0xb18e('0x70')](_0x13d40e));endCsv();}});})[_0xb18e('0x35')](function(_0x30f4ca){logger[_0xb18e('0x1b')](_0xb18e('0x71'),JSON['stringify'](_0x30f4ca));});}main();
\ No newline at end of file
index 6eb3d37..75681e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe863=['replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','length','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','exit','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','util','moment','squel','ioredis','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','join','.id\x20=\x20','\x20=\x20','where','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','recallme','fields','from','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.id','into','cm_hopper_black','cm_contacts','toString','concat','keys','CompanyId','updatedAt',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','error','message','errors','push','code','info','sequelize','query','catch','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','rows','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe863,0x1cb));var _0x3e86=function(_0x47eaff,_0x502553){_0x47eaff=_0x47eaff-0x0;var _0x53103e=_0xe863[_0x47eaff];return _0x53103e;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require('papaparse');var util=require(_0x3e86('0x0'));var BPromise=require('bluebird');var moment=require(_0x3e86('0x1'));var squel=require(_0x3e86('0x2'));var Redis=require(_0x3e86('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x3e86('0x4'));var logger=require(_0x3e86('0x5'))(_0x3e86('0x6'));config[_0x3e86('0x7')]=_[_0x3e86('0x8')](config[_0x3e86('0x7')],{'host':_0x3e86('0x9'),'port':0x18eb});var socket=require(_0x3e86('0xa'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x3e86('0xb')](_0x3e86('0xc'));function isEmail(_0x596416){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))*$/[_0x3e86('0xd')](_0x596416);}function selectNotIn(_0x483834,_0x2aa515,_0x49fac2,_0x62e4de,_0x49bdf1){return squel[_0x3e86('0xe')]()[_0x3e86('0xf')](_0x3e86('0x10'))['from'](_0x62e4de)[_0x3e86('0x11')](_0x2aa515,null,_0x2aa515+_0x3e86('0x12')+_0x62e4de+'.'+_0x49fac2)['where'](_0x62e4de+'.'+_0x49fac2+_0x3e86('0x13')+_0x483834+'.'+_0x49fac2)[_0x3e86('0x14')](_0x2aa515+'.dialCheckDuplicateType\x20IN\x20('+_0x49bdf1['join']()+')');}function insertCmHopper(_0x968377,_0x3b7df6,_0x4d1931,_0x237cb8,_0x3a9787){var _0x1341c7=[_0x3e86('0x15'),_0x3e86('0x16'),'cm_contacts.id',_0x3e86('0x17'),_0x3b7df6+'.'+_0x237cb8,_0x3e86('0x18'),_0x3e86('0x19'),_0x3e86('0x1a'),'cm_contacts.UserId','\x22'+_0x3a9787+'\x22'];return squel[_0x3e86('0x1b')]()['into'](_0x3e86('0x1c'))[_0x3e86('0x1d')]([_0x3e86('0x10'),_0x3e86('0x1e'),_0x3e86('0x1f'),_0x3e86('0x20'),_0x237cb8,_0x3e86('0x21'),'updatedAt',_0x3e86('0x22'),_0x3e86('0x23'),_0x3e86('0x24')],squel[_0x3e86('0xe')]()[_0x3e86('0x25')](_0x1341c7)[_0x3e86('0x26')](_0x3b7df6)['join']('cm_contacts',null,_0x3e86('0x27')+_0x3b7df6+_0x3e86('0x28'))[_0x3e86('0x11')](_0x4d1931,null,_0x4d1931+'.id\x20=\x20'+_0x3b7df6+'.'+_0x237cb8)[_0x3e86('0x14')](_0x3b7df6+_0x3e86('0x29'),_0x968377)[_0x3e86('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x3e86('0x2a'),selectNotIn(_0x3b7df6,_0x4d1931,_0x237cb8,_0x3e86('0x1c'),[_0x3e86('0x2b'),_0x3e86('0x2c')]))[_0x3e86('0x14')](_0x3e86('0x2a'),selectNotIn(_0x3b7df6,_0x4d1931,_0x237cb8,_0x3e86('0x1c'),[_0x3e86('0x2b')])))['toString']();}function insertCmHopperBlack(_0x4b7d49,_0x53ff63,_0x5d7028,_0x3604d0){var _0xca0cb9=['cm_contacts.phone',_0x3e86('0x2d'),_0x3e86('0x17'),_0x53ff63+'.'+_0x3604d0,_0x3e86('0x18'),_0x3e86('0x19')];return squel[_0x3e86('0x1b')]()[_0x3e86('0x2e')](_0x3e86('0x2f'))[_0x3e86('0x1d')]([_0x3e86('0x10'),_0x3e86('0x1f'),_0x3e86('0x20'),_0x3604d0,_0x3e86('0x21'),'updatedAt'],squel[_0x3e86('0xe')]()[_0x3e86('0x25')](_0xca0cb9)[_0x3e86('0x26')](_0x53ff63)[_0x3e86('0x11')](_0x3e86('0x30'),null,_0x3e86('0x27')+_0x53ff63+_0x3e86('0x28'))['join'](_0x5d7028,null,_0x5d7028+_0x3e86('0x12')+_0x53ff63+'.'+_0x3604d0)[_0x3e86('0x14')](_0x53ff63+_0x3e86('0x29'),_0x4b7d49)[_0x3e86('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x3e86('0x14')](_0x3e86('0x2a'),squel[_0x3e86('0xe')]()[_0x3e86('0xf')](_0x3e86('0x10'))[_0x3e86('0x26')](_0x3e86('0x2f'))[_0x3e86('0x14')]('ListId\x20=\x20?',_0x4b7d49)[_0x3e86('0x14')](_0x3604d0+'\x20=\x20?',_0x53ff63+'.'+_0x3604d0)))[_0x3e86('0x31')]();}function insertCmContact(_0x59ab19,_0x13dc36,_0x26880d,_0x2efb3a){var _0x5b8dde=_[_0x3e86('0x32')](_[_0x3e86('0x33')](_0x2efb3a),[_0x3e86('0x20'),_0x3e86('0x34'),_0x3e86('0x21'),_0x3e86('0x35')]);return squel[_0x3e86('0x1b')]()[_0x3e86('0x2e')](_0x3e86('0x30'))[_0x3e86('0x1d')](_0x5b8dde,squel[_0x3e86('0xe')]()[_0x3e86('0x25')](_0x5b8dde)['from'](_0x13dc36)['where']('('+_0x26880d['join'](',')+_0x3e86('0x36'),squel[_0x3e86('0xe')]()[_0x3e86('0x25')](_0x26880d)[_0x3e86('0x26')](_0x3e86('0x30'))[_0x3e86('0x14')](_0x3e86('0x37'),_0x59ab19)['where'](_0x3e86('0x38')))[_0x3e86('0x14')](_0x3e86('0x39'),squel[_0x3e86('0xe')]()['field'](_0x3e86('0x3a'),_0x3e86('0x3b'))['from'](_0x13dc36)[_0x3e86('0x3c')](_0x26880d['join'](','))))['toString']();}function handleStop(){logger['info'](_0x3e86('0x3d'));stopped=!![];}function handleUncaughtException(_0x3edc0f){logger[_0x3e86('0x3e')](_0x3edc0f[_0x3e86('0x3f')]);process['exit'](0x1);}function handleError(_0x161bb3,_0x6cd1d6){stats[_0x3e86('0x40')][_0x3e86('0x41')]({'name':_0x6cd1d6[_0x3e86('0x42')],'message':_0x6cd1d6[_0x3e86('0x3f')],'row':_0x161bb3});}function handleQuery(_0x5f0312){logger[_0x3e86('0x43')](_0x5f0312);return db[_0x3e86('0x44')][_0x3e86('0x45')](_0x5f0312)['spread'](function(_0x458947){results['push'](_0x458947);})[_0x3e86('0x46')](function(_0x4f7ff2){logger[_0x3e86('0x3e')](_0x4f7ff2[_0x3e86('0x3f')]);});}function main(_0xbab6af,_0x3aec6c,_0x262d94,_0x48a961){logger['info']('main',_0xbab6af,JSON['stringify'](_0x3aec6c));process[_0x3e86('0x47')](_0x3e86('0x48'));var _0x2fa38c=_0x3aec6c[_0x3e86('0x49')];var _0x297889=_0x3aec6c[_0x3e86('0x4a')];var _0x149fa0=path[_0x3e86('0x11')](config[_0x3e86('0x4b')],_0x3e86('0x4c'),_0x297889+_0x3e86('0x4d'));var _0x58d28d=_[_0x3e86('0x33')](_0x2fa38c)[_0x3e86('0x11')]();logger['info'](_0x3e86('0x4e'),_0x58d28d);fs[_0x3e86('0x4f')](_0x149fa0,_0x58d28d+'\x0a');Papa[_0x3e86('0x50')](fs[_0x3e86('0x51')](_0xbab6af),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d2d15,_0x182781){try{for(var _0x3bbd7a=0x0,_0x48f070=[];_0x3bbd7a<_0x5d2d15[_0x3e86('0x52')]['length'];_0x3bbd7a++){stats[_0x3e86('0x53')]+=0x1;if(_0x5d2d15[_0x3e86('0x40')][_0x3bbd7a]){handleError(_0x5d2d15[_0x3e86('0x52')][_0x3bbd7a],_0x5d2d15[_0x3e86('0x40')][_0x3bbd7a]);}else{var _0x43a28e=[];for(var _0x4c01c7 in _0x2fa38c){if(_0x2fa38c[_0x3e86('0x54')](_0x4c01c7)){if(_0x5d2d15[_0x3e86('0x52')][_0x3bbd7a][_0x2fa38c[_0x4c01c7]]){var _0x541f4f=_['trim'](_0x5d2d15[_0x3e86('0x52')][_0x3bbd7a][_0x2fa38c[_0x4c01c7]][_0x3e86('0x55')](/"/g,'\x27'));switch(_0x4c01c7){case _0x3e86('0x1e'):var _0x5a1955=moment(_0x541f4f,_0x3e86('0xc'),!![]);if(_0x5a1955[_0x3e86('0x56')]()){_0x48f070['push']('\x22'+_0x541f4f+'\x22');}else{_0x43a28e[_0x3e86('0x41')](_0x3e86('0x57'));}break;case _0x3e86('0x22'):var _0x424db5=parseInt(_0x541f4f);_0x541f4f=_['isNaN'](_0x424db5)||_0x424db5<0x0||_0x424db5>0x4?_0x48a961?0x3:0x2:_0x424db5;_0x48f070[_0x3e86('0x41')]('\x22'+_0x541f4f+'\x22');break;case _0x3e86('0x23'):var _0x345abf=parseInt(_0x541f4f);if(_[_0x3e86('0x58')](_0x345abf)&&_[_0x3e86('0x59')](_0x262d94,_0x345abf)){_0x48f070[_0x3e86('0x41')]('\x22'+_0x345abf+'\x22');}else{_0x43a28e[_0x3e86('0x41')](_0x3e86('0x5a'));}break;case'email':if(isEmail(_0x541f4f)){_0x48f070[_0x3e86('0x41')]('\x22'+_0x541f4f+'\x22');}else{_0x43a28e['push'](_0x3e86('0x5b'));}break;case _0x3e86('0x5c'):var _0x17ccb6=moment(_0x541f4f,_0x3e86('0x5d'),!![]);if(_0x17ccb6[_0x3e86('0x56')]()){_0x48f070[_0x3e86('0x41')]('\x22'+_0x541f4f+'\x22');}else{_0x43a28e[_0x3e86('0x41')](_0x3e86('0x5e'));}break;default:_0x48f070[_0x3e86('0x41')]('\x22'+_0x541f4f+'\x22');}}else{switch(_0x4c01c7){case'firstName':case _0x3e86('0x10'):_0x43a28e[_0x3e86('0x41')](_0x4c01c7+_0x3e86('0x5f'));break;default:_0x48f070[_0x3e86('0x41')]('\x22\x22');}}}}if(_0x43a28e['length']){handleError(_0x5d2d15[_0x3e86('0x52')][_0x3bbd7a],{'code':_0x3e86('0x60'),'message':_0x43a28e['join']()});}else{fs[_0x3e86('0x61')](_0x149fa0,_0x48f070['join']()+'\x0a');}_0x48f070=[];}if(!(stats['rows']%0xc8)){socket[_0x3e86('0x62')](_0x3e86('0x63')+_0x297889,stats);stats['errors']=[];}}if(stopped){logger[_0x3e86('0x43')](_0x3e86('0x64'));_0x182781[_0x3e86('0x65')]();}}catch(_0x6bdb42){handleError(_0x5d2d15[_0x3e86('0x52')][_0x3bbd7a],{'code':'SystemError','message':_0x6bdb42[_0x3e86('0x3f')]});logger[_0x3e86('0x3e')](_0x3e86('0x66'),_0x6bdb42[_0x3e86('0x3f')]);}},'complete':function(){try{var _0x29857b=[];var _0x54536a='cm_contacts';if(_0x3aec6c[_0x3e86('0x67')]&&_0x3aec6c[_0x3e86('0x67')]['length']){_0x54536a=_0x3e86('0x68')+_0x297889;_0x29857b[_0x3e86('0x41')](_0x3e86('0x69')+_0x54536a+_0x3e86('0x6a'));}var _0x24784b=util[_0x3e86('0xb')](_0x3e86('0x6b'),_0x149fa0,_0x54536a,_0x58d28d,_0x3aec6c[_0x3e86('0x20')],_0x3aec6c['CompanyId']||null,NOW,NOW);if(_[_0x3e86('0x6c')](_0x2fa38c[_0x3e86('0x1e')])){_0x24784b+=_0x3e86('0x6d');}_0x29857b[_0x3e86('0x41')](_0x24784b);if(_0x3aec6c[_0x3e86('0x67')]&&_0x3aec6c[_0x3e86('0x67')][_0x3e86('0x6e')]){_0x29857b[_0x3e86('0x41')](insertCmContact(_0x3aec6c[_0x3e86('0x20')],_0x54536a,_0x3aec6c[_0x3e86('0x67')],_0x2fa38c));_0x29857b['push'](_0x3e86('0x6f')+_0x54536a+';');}_0x29857b[_0x3e86('0x41')](insertCmHopper(_0x3aec6c[_0x3e86('0x20')],_0x3e86('0x70'),_0x3e86('0x71'),_0x3e86('0x72'),_0x48a961));_0x29857b['push'](insertCmHopperBlack(_0x3aec6c[_0x3e86('0x20')],_0x3e86('0x73'),_0x3e86('0x71'),_0x3e86('0x72')));_0x29857b[_0x3e86('0x41')](insertCmHopper(_0x3aec6c['ListId'],_0x3e86('0x74'),_0x3e86('0x75'),_0x3e86('0x76'),_0x48a961));_0x29857b['push'](insertCmHopperBlack(_0x3aec6c[_0x3e86('0x20')],_0x3e86('0x77'),_0x3e86('0x75'),_0x3e86('0x76')));BPromise[_0x3e86('0x78')](_0x29857b,handleQuery)[_0x3e86('0x79')](function(_0x3bdd86){stats[_0x3e86('0x7a')]=!![];stats[_0x3e86('0x7b')]=_0x3aec6c[_0x3e86('0x67')]&&_0x3aec6c[_0x3e86('0x67')][_0x3e86('0x6e')]?results[0x2][_0x3e86('0x7b')]:results[0x0]['affectedRows'];socket[_0x3e86('0x62')](_0x3e86('0x63')+_0x297889,stats);fs['unlink'](_0xbab6af);fs['unlink'](_0x149fa0);process[_0x3e86('0x7c')](0x0);})[_0x3e86('0x46')](function(_0x36eecf){logger[_0x3e86('0x3e')](_0x36eecf[_0x3e86('0x3f')]);process[_0x3e86('0x7c')](0x1);});}catch(_0x51b2f8){logger[_0x3e86('0x3e')](_0x3e86('0x7d'),_0x51b2f8[_0x3e86('0x3f')]);process['exit'](0x1);}},'error':function(_0x231af9,_0x575e1f,_0x37fca0,_0x1a17a1){throw new Error(_0x1a17a1);}});}function validate(){if(process[_0x3e86('0x7e')]&&process[_0x3e86('0x7e')][_0x3e86('0x6e')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x42b611=path[_0x3e86('0x11')](config[_0x3e86('0x4b')],_0x3e86('0x4c'),process[_0x3e86('0x7e')][0x2]);if(!fs[_0x3e86('0x7f')](_0x42b611)){throw new Error(_0x3e86('0x80'));}var _0x59aa36={};try{_0x59aa36=JSON['parse'](process[_0x3e86('0x7e')][0x3]);if(!_0x59aa36[_0x3e86('0x49')]){throw new Error(_0x3e86('0x81'));}if(!_0x59aa36['binding']['phone']){throw new Error(_0x3e86('0x82'));}if(!_0x59aa36['binding'][_0x3e86('0x83')]){throw new Error(_0x3e86('0x84'));}var _0x24fcb4=0x0;if(_0x59aa36[_0x3e86('0x49')][_0x3e86('0x23')]){_0x24fcb4=0x1;}if(!_0x59aa36[_0x3e86('0x20')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x45ea94){throw new Error(_0x3e86('0x85'));}var _0x484fbe=[];try{_0x484fbe=_[_0x3e86('0x86')](JSON[_0x3e86('0x50')](process[_0x3e86('0x7e')][0x4]),'id');}catch(_0xc4b35){logger[_0x3e86('0x43')](_0x3e86('0x87'));}main(_0x42b611,_0x59aa36,_0x484fbe,_0x24fcb4);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0xe432=['\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','each','finish','affectedRows','unlink','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','createdAt','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','cm_contacts.phone','cm_contacts.createdAt','insert','ContactId','ListId','select','.CmListId\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','toString','concat','keys','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','message','exit','errors','push','code','sequelize','query','spread','catch','main','binding','socket_timestamp','server/files/tmp','writeFileSync','createReadStream','data','length','rows','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','agent\x20not\x20exists','email','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','emit','contact:import:','abort','SystemError','error','step','duplicates','cm_contacts_'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe432,0x9a));var _0x2e43=function(_0x21eb73,_0x2816ef){_0x21eb73=_0x21eb73-0x0;var _0x15817a=_0xe432[_0x21eb73];return _0x15817a;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x2e43('0x0'));var Papa=require(_0x2e43('0x1'));var util=require(_0x2e43('0x2'));var BPromise=require('bluebird');var moment=require(_0x2e43('0x3'));var squel=require(_0x2e43('0x4'));var Redis=require(_0x2e43('0x5'));var db=require(_0x2e43('0x6'))['db'];var config=require(_0x2e43('0x7'));var logger=require(_0x2e43('0x8'))(_0x2e43('0x9'));config[_0x2e43('0xa')]=_[_0x2e43('0xb')](config[_0x2e43('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x2e43('0xc')](_0x2e43('0xd'));function isEmail(_0x1237e0){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))*$/[_0x2e43('0xe')](_0x1237e0);}function selectNotIn(_0x146dc9,_0x3c763a,_0x919b0,_0x4787c4,_0x9c9448){return squel['select']()[_0x2e43('0xf')](_0x2e43('0x10'))[_0x2e43('0x11')](_0x4787c4)['join'](_0x3c763a,null,_0x3c763a+_0x2e43('0x12')+_0x4787c4+'.'+_0x919b0)[_0x2e43('0x13')](_0x4787c4+'.'+_0x919b0+_0x2e43('0x14')+_0x146dc9+'.'+_0x919b0)[_0x2e43('0x13')](_0x3c763a+_0x2e43('0x15')+_0x9c9448[_0x2e43('0x16')]()+')');}function insertCmHopper(_0x4e13d6,_0x180c66,_0x2b5318,_0x4089d8,_0x349e59){var _0x51c6fe=['cm_contacts.phone',_0x2e43('0x17'),_0x2e43('0x18'),_0x2e43('0x19'),_0x180c66+'.'+_0x4089d8,'cm_contacts.createdAt',_0x2e43('0x1a'),_0x2e43('0x1b'),_0x2e43('0x1c'),'\x22'+_0x349e59+'\x22'];return squel['insert']()[_0x2e43('0x1d')](_0x2e43('0x1e'))[_0x2e43('0x1f')]([_0x2e43('0x10'),_0x2e43('0x20'),'ContactId','ListId',_0x4089d8,_0x2e43('0x21'),_0x2e43('0x22'),_0x2e43('0x23'),_0x2e43('0x24'),'recallme'],squel['select']()[_0x2e43('0x25')](_0x51c6fe)[_0x2e43('0x11')](_0x180c66)['join'](_0x2e43('0x26'),null,_0x2e43('0x27')+_0x180c66+_0x2e43('0x28'))[_0x2e43('0x16')](_0x2b5318,null,_0x2b5318+_0x2e43('0x12')+_0x180c66+'.'+_0x4089d8)[_0x2e43('0x13')](_0x180c66+'.CmListId\x20=\x20?',_0x4e13d6)[_0x2e43('0x13')](_0x2e43('0x29'),NOW)[_0x2e43('0x13')](_0x2e43('0x2a'),selectNotIn(_0x180c66,_0x2b5318,_0x4089d8,_0x2e43('0x1e'),['\x22always\x22',_0x2e43('0x2b')]))[_0x2e43('0x13')](_0x2e43('0x2a'),selectNotIn(_0x180c66,_0x2b5318,_0x4089d8,_0x2e43('0x1e'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x5ccfa5,_0x2766b9,_0x4b33cf,_0x457fa4){var _0x2f6120=[_0x2e43('0x2c'),_0x2e43('0x18'),'cm_contacts.ListId',_0x2766b9+'.'+_0x457fa4,_0x2e43('0x2d'),_0x2e43('0x1a')];return squel[_0x2e43('0x2e')]()[_0x2e43('0x1d')]('cm_hopper_black')[_0x2e43('0x1f')](['phone',_0x2e43('0x2f'),_0x2e43('0x30'),_0x457fa4,'createdAt',_0x2e43('0x22')],squel[_0x2e43('0x31')]()['fields'](_0x2f6120)[_0x2e43('0x11')](_0x2766b9)[_0x2e43('0x16')](_0x2e43('0x26'),null,_0x2e43('0x27')+_0x2766b9+_0x2e43('0x28'))['join'](_0x4b33cf,null,_0x4b33cf+_0x2e43('0x12')+_0x2766b9+'.'+_0x457fa4)[_0x2e43('0x13')](_0x2766b9+_0x2e43('0x32'),_0x5ccfa5)['where'](_0x2e43('0x29'),NOW)[_0x2e43('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x2e43('0x31')]()[_0x2e43('0xf')](_0x2e43('0x10'))[_0x2e43('0x11')](_0x2e43('0x33'))[_0x2e43('0x13')](_0x2e43('0x34'),_0x5ccfa5)[_0x2e43('0x13')](_0x457fa4+_0x2e43('0x35'),_0x2766b9+'.'+_0x457fa4)))[_0x2e43('0x36')]();}function insertCmContact(_0x2d6ee7,_0x14511e,_0x2d5298,_0x56c45c){var _0x1a69e9=_[_0x2e43('0x37')](_[_0x2e43('0x38')](_0x56c45c),[_0x2e43('0x30'),_0x2e43('0x39'),'createdAt','updatedAt']);return squel[_0x2e43('0x2e')]()[_0x2e43('0x1d')](_0x2e43('0x26'))[_0x2e43('0x1f')](_0x1a69e9,squel[_0x2e43('0x31')]()[_0x2e43('0x25')](_0x1a69e9)[_0x2e43('0x11')](_0x14511e)['where']('('+_0x2d5298[_0x2e43('0x16')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x2e43('0x25')](_0x2d5298)[_0x2e43('0x11')]('cm_contacts')['where']('ListId\x20=\x20?',_0x2d6ee7)[_0x2e43('0x13')](_0x2e43('0x3a')))[_0x2e43('0x13')](_0x2e43('0x3b'),squel[_0x2e43('0x31')]()['field']('MIN(id)',_0x2e43('0x3c'))['from'](_0x14511e)[_0x2e43('0x3d')](_0x2d5298[_0x2e43('0x16')](','))))[_0x2e43('0x36')]();}function handleStop(){logger[_0x2e43('0x3e')](_0x2e43('0x3f'));stopped=!![];}function handleUncaughtException(_0x3a5f9e){logger['error'](_0x3a5f9e[_0x2e43('0x40')]);process[_0x2e43('0x41')](0x1);}function handleError(_0x1f4a0e,_0x3f2fd5){stats[_0x2e43('0x42')][_0x2e43('0x43')]({'name':_0x3f2fd5[_0x2e43('0x44')],'message':_0x3f2fd5['message'],'row':_0x1f4a0e});}function handleQuery(_0x269fbd){logger[_0x2e43('0x3e')](_0x269fbd);return db[_0x2e43('0x45')][_0x2e43('0x46')](_0x269fbd)[_0x2e43('0x47')](function(_0x584542){results[_0x2e43('0x43')](_0x584542);})[_0x2e43('0x48')](function(_0x525496){logger['error'](_0x525496[_0x2e43('0x40')]);});}function main(_0x419725,_0x32a5cc,_0x1bc06d,_0x5d6254){logger[_0x2e43('0x3e')](_0x2e43('0x49'),_0x419725,JSON['stringify'](_0x32a5cc));process['send']('start');var _0xd37c64=_0x32a5cc[_0x2e43('0x4a')];var _0x424136=_0x32a5cc[_0x2e43('0x4b')];var _0x49a448=path[_0x2e43('0x16')](config['root'],_0x2e43('0x4c'),_0x424136+'.csv');var _0x3a2cc3=_[_0x2e43('0x38')](_0xd37c64)[_0x2e43('0x16')]();logger[_0x2e43('0x3e')]('header',_0x3a2cc3);fs[_0x2e43('0x4d')](_0x49a448,_0x3a2cc3+'\x0a');Papa['parse'](fs[_0x2e43('0x4e')](_0x419725),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2f92a1,_0x37fd63){try{for(var _0x48aa5=0x0,_0x374702=[];_0x48aa5<_0x2f92a1[_0x2e43('0x4f')][_0x2e43('0x50')];_0x48aa5++){stats[_0x2e43('0x51')]+=0x1;if(_0x2f92a1[_0x2e43('0x42')][_0x48aa5]){handleError(_0x2f92a1[_0x2e43('0x4f')][_0x48aa5],_0x2f92a1['errors'][_0x48aa5]);}else{var _0x4e12a6=[];for(var _0x58f0da in _0xd37c64){if(_0xd37c64[_0x2e43('0x52')](_0x58f0da)){if(_0x2f92a1[_0x2e43('0x4f')][_0x48aa5][_0xd37c64[_0x58f0da]]){var _0x5f3942=_['trim'](_0x2f92a1[_0x2e43('0x4f')][_0x48aa5][_0xd37c64[_0x58f0da]][_0x2e43('0x53')](/"/g,'\x27'));switch(_0x58f0da){case'scheduledat':var _0x37c27b=moment(_0x5f3942,_0x2e43('0xd'),!![]);if(_0x37c27b[_0x2e43('0x54')]()){_0x374702['push']('\x22'+_0x5f3942+'\x22');}else{_0x4e12a6[_0x2e43('0x43')](_0x2e43('0x55'));}break;case _0x2e43('0x23'):var _0x180ed0=parseInt(_0x5f3942);_0x5f3942=_[_0x2e43('0x56')](_0x180ed0)||_0x180ed0<0x0||_0x180ed0>0x4?_0x5d6254?0x3:0x2:_0x180ed0;_0x374702[_0x2e43('0x43')]('\x22'+_0x5f3942+'\x22');break;case _0x2e43('0x24'):var _0xaad04c=parseInt(_0x5f3942);if(_['isNumber'](_0xaad04c)&&_[_0x2e43('0x57')](_0x1bc06d,_0xaad04c)){_0x374702['push']('\x22'+_0xaad04c+'\x22');}else{_0x4e12a6[_0x2e43('0x43')](_0x2e43('0x58'));}break;case _0x2e43('0x59'):if(isEmail(_0x5f3942)){_0x374702[_0x2e43('0x43')]('\x22'+_0x5f3942+'\x22');}else{_0x4e12a6['push']('email\x20wrong\x20format');}break;case _0x2e43('0x5a'):var _0x2dcde4=moment(_0x5f3942,'YYYY-MM-DD',!![]);if(_0x2dcde4[_0x2e43('0x54')]()){_0x374702[_0x2e43('0x43')]('\x22'+_0x5f3942+'\x22');}else{_0x4e12a6[_0x2e43('0x43')](_0x2e43('0x5b'));}break;default:_0x374702['push']('\x22'+_0x5f3942+'\x22');}}else{switch(_0x58f0da){case'firstName':case'phone':_0x4e12a6[_0x2e43('0x43')](_0x58f0da+_0x2e43('0x5c'));break;default:_0x374702[_0x2e43('0x43')]('\x22\x22');}}}}if(_0x4e12a6[_0x2e43('0x50')]){handleError(_0x2f92a1[_0x2e43('0x4f')][_0x48aa5],{'code':_0x2e43('0x5d'),'message':_0x4e12a6[_0x2e43('0x16')]()});}else{fs['appendFileSync'](_0x49a448,_0x374702[_0x2e43('0x16')]()+'\x0a');}_0x374702=[];}if(!(stats[_0x2e43('0x51')]%0xc8)){socket[_0x2e43('0x5e')](_0x2e43('0x5f')+_0x424136,stats);stats[_0x2e43('0x42')]=[];}}if(stopped){logger[_0x2e43('0x3e')]('Abort\x20parser');_0x37fd63[_0x2e43('0x60')]();}}catch(_0x1aa26b){handleError(_0x2f92a1['data'][_0x48aa5],{'code':_0x2e43('0x61'),'message':_0x1aa26b[_0x2e43('0x40')]});logger[_0x2e43('0x62')](_0x2e43('0x63'),_0x1aa26b[_0x2e43('0x40')]);}},'complete':function(){try{var _0x234b02=[];var _0x2ec13e='cm_contacts';if(_0x32a5cc['duplicates']&&_0x32a5cc[_0x2e43('0x64')][_0x2e43('0x50')]){_0x2ec13e=_0x2e43('0x65')+_0x424136;_0x234b02[_0x2e43('0x43')]('CREATE\x20TABLE\x20'+_0x2ec13e+_0x2e43('0x66'));}var _0x2bd8e7=util[_0x2e43('0xc')](_0x2e43('0x67'),_0x49a448,_0x2ec13e,_0x3a2cc3,_0x32a5cc[_0x2e43('0x30')],_0x32a5cc['CompanyId']||null,NOW,NOW);if(_['isNil'](_0xd37c64[_0x2e43('0x20')])){_0x2bd8e7+=',\x20scheduledAt\x20=\x20NOW()';}_0x234b02[_0x2e43('0x43')](_0x2bd8e7);if(_0x32a5cc[_0x2e43('0x64')]&&_0x32a5cc[_0x2e43('0x64')][_0x2e43('0x50')]){_0x234b02['push'](insertCmContact(_0x32a5cc[_0x2e43('0x30')],_0x2ec13e,_0x32a5cc['duplicates'],_0xd37c64));_0x234b02['push'](_0x2e43('0x68')+_0x2ec13e+';');}_0x234b02[_0x2e43('0x43')](insertCmHopper(_0x32a5cc[_0x2e43('0x30')],_0x2e43('0x69'),_0x2e43('0x6a'),'VoiceQueueId',_0x5d6254));_0x234b02['push'](insertCmHopperBlack(_0x32a5cc['ListId'],_0x2e43('0x6b'),'voice_queues',_0x2e43('0x6c')));_0x234b02[_0x2e43('0x43')](insertCmHopper(_0x32a5cc[_0x2e43('0x30')],_0x2e43('0x6d'),_0x2e43('0x6e'),'CampaignId',_0x5d6254));_0x234b02['push'](insertCmHopperBlack(_0x32a5cc['ListId'],_0x2e43('0x6f'),_0x2e43('0x6e'),'CampaignId'));BPromise[_0x2e43('0x70')](_0x234b02,handleQuery)['then'](function(_0x47e621){stats[_0x2e43('0x71')]=!![];stats[_0x2e43('0x72')]=_0x32a5cc['duplicates']&&_0x32a5cc[_0x2e43('0x64')][_0x2e43('0x50')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket[_0x2e43('0x5e')](_0x2e43('0x5f')+_0x424136,stats);fs[_0x2e43('0x73')](_0x419725);fs['unlink'](_0x49a448);process[_0x2e43('0x41')](0x0);})[_0x2e43('0x48')](function(_0xe1bb0e){logger['error'](_0xe1bb0e['message']);process['exit'](0x1);});}catch(_0x13e61b){logger['error']('complete',_0x13e61b[_0x2e43('0x40')]);process[_0x2e43('0x41')](0x1);}},'error':function(_0x155c5f,_0x5a4490,_0x419313,_0x1b3fb4){throw new Error(_0x1b3fb4);}});}function validate(){if(process['argv']&&process[_0x2e43('0x74')][_0x2e43('0x50')]<0x4){throw new Error(_0x2e43('0x75'));}var _0x388852=path[_0x2e43('0x16')](config[_0x2e43('0x76')],_0x2e43('0x4c'),process[_0x2e43('0x74')][0x2]);if(!fs[_0x2e43('0x77')](_0x388852)){throw new Error(_0x2e43('0x78'));}var _0x242f71={};try{_0x242f71=JSON[_0x2e43('0x79')](process[_0x2e43('0x74')][0x3]);if(!_0x242f71[_0x2e43('0x4a')]){throw new Error(_0x2e43('0x7a'));}if(!_0x242f71[_0x2e43('0x4a')][_0x2e43('0x10')]){throw new Error(_0x2e43('0x7b'));}if(!_0x242f71['binding']['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x1a5075=0x0;if(_0x242f71[_0x2e43('0x4a')][_0x2e43('0x24')]){_0x1a5075=0x1;}if(!_0x242f71['ListId']){throw new Error(_0x2e43('0x7c'));}}catch(_0x599de3){throw new Error('body\x20id\x20mandatory');}var _0x1eb69f=[];try{_0x1eb69f=_[_0x2e43('0x7d')](JSON[_0x2e43('0x79')](process[_0x2e43('0x74')][0x4]),'id');}catch(_0xe9d12){logger['info'](_0x2e43('0x7e'));}main(_0x388852,_0x242f71,_0x1eb69f,_0x1a5075);}validate();process['on'](_0x2e43('0x7f'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
index 354b862..da7c640 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96ca=['variable','calleridnum','outbound','Outbound\x20Call','getDescriptions','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','destcalleridnum','Member\x20Name','membername','starttime','answertime','Complete\x20Time','endtime','Duration','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','queue'];(function(_0x25fc1e,_0x424913){var _0x5e3746=function(_0x1010cc){while(--_0x1010cc){_0x25fc1e['push'](_0x25fc1e['shift']());}};_0x5e3746(++_0x424913);}(_0x96ca,0x161));var _0xa96c=function(_0x25bd0c,_0x10a934){_0x25bd0c=_0x25bd0c-0x0;var _0x1c8e6e=_0x96ca[_0x25bd0c];return _0x1c8e6e;};'use strict';exports['getSubjects']=function(_0x37582a,_0x116fec){var _0x4c6acd=[{'type':_0xa96c('0x0'),'content':_0xa96c('0x1'),'variableName':null}];switch(_0x37582a[_0xa96c('0x2')]()){case _0xa96c('0x3'):switch(_0x116fec[_0xa96c('0x2')]()){case _0xa96c('0x4'):_0x4c6acd[_0xa96c('0x5')]({'type':'variable','content':'','variableName':_0xa96c('0x6')});_0x4c6acd['push']({'type':_0xa96c('0x7'),'content':'','variableName':_0xa96c('0x8')});break;case _0xa96c('0x9'):_0x4c6acd['push']({'type':_0xa96c('0x0'),'content':_0xa96c('0xa'),'variableName':null});_0x4c6acd['push']({'type':_0xa96c('0x7'),'content':'','variableName':'destcalleridnum'});break;}}return _0x4c6acd;};exports[_0xa96c('0xb')]=function(_0x2a4c1e,_0x39cec8){var _0x16b84f=[];switch(_0x2a4c1e[_0xa96c('0x2')]()){case _0xa96c('0x3'):switch(_0x39cec8[_0xa96c('0x2')]()){case _0xa96c('0x4'):_0x16b84f=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0xd'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x8')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0xe'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0xf')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x10'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x11')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x12'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x6')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x13'),'keyType':'variable','variableName':_0xa96c('0x14')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x15'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x16')},{'type':_0xa96c('0x0'),'content':_0xa96c('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x18'),'keyType':_0xa96c('0x7'),'variableName':'destcalleridname'},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x19'),'keyType':_0xa96c('0x7'),'variableName':'destcalleridnum'},{'type':_0xa96c('0x0'),'content':_0xa96c('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x1b'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x1c'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x1d')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x1e'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x1f')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x20'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x21')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x22'),'keyType':_0xa96c('0x7'),'variableName':'talktime'}];break;case _0xa96c('0x9'):_0x16b84f=[{'type':_0xa96c('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':_0xa96c('0x23'),'keyType':'variable','keyContent':'','variableName':_0xa96c('0x24')},{'type':'keyValue','content':'','key':_0xa96c('0x25'),'keyType':_0xa96c('0x7'),'keyContent':'','variableName':_0xa96c('0x26')},{'type':_0xa96c('0xc'),'content':'','key':'UniqueId','keyType':'variable','keyContent':'','variableName':'uniqueid'},{'type':_0xa96c('0xc'),'content':'','key':'Date','keyType':'variable','keyContent':'','variableName':_0xa96c('0x27')},{'type':_0xa96c('0x0'),'content':_0xa96c('0x1a')},{'type':_0xa96c('0xc'),'content':'','key':'Answer\x20Time','keyType':_0xa96c('0x7'),'keyContent':'','variableName':_0xa96c('0x28')},{'type':'keyValue','content':'','key':_0xa96c('0x29'),'keyType':_0xa96c('0x7'),'keyContent':'','variableName':_0xa96c('0x2a')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x2b'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0xa96c('0xc'),'content':'','key':'Billable\x20Time','keyType':_0xa96c('0x7'),'keyContent':'','variableName':_0xa96c('0x2c')}];break;}}return _0x16b84f;};
\ No newline at end of file
+var _0xe690=['destcalleridnum','getDescriptions','voice','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','queue','Date','agentcalledAt','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','Member\x20Name','membername','uniqueid','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','push','variable','calleridnum','outbound'];(function(_0x24c1d0,_0x4dec43){var _0x388583=function(_0x213304){while(--_0x213304){_0x24c1d0['push'](_0x24c1d0['shift']());}};_0x388583(++_0x4dec43);}(_0xe690,0xe8));var _0x0e69=function(_0x51d35a,_0x236f68){_0x51d35a=_0x51d35a-0x0;var _0x3168de=_0xe690[_0x51d35a];return _0x3168de;};'use strict';exports[_0x0e69('0x0')]=function(_0x36b09c,_0x56807e){var _0x341575=[{'type':_0x0e69('0x1'),'content':_0x0e69('0x2'),'variableName':null}];switch(_0x36b09c[_0x0e69('0x3')]()){case'voice':switch(_0x56807e[_0x0e69('0x3')]()){case'inbound':_0x341575[_0x0e69('0x4')]({'type':_0x0e69('0x5'),'content':'','variableName':'queue'});_0x341575[_0x0e69('0x4')]({'type':_0x0e69('0x5'),'content':'','variableName':_0x0e69('0x6')});break;case _0x0e69('0x7'):_0x341575[_0x0e69('0x4')]({'type':_0x0e69('0x1'),'content':'Outbound\x20Call','variableName':null});_0x341575[_0x0e69('0x4')]({'type':'variable','content':'','variableName':_0x0e69('0x8')});break;}}return _0x341575;};exports[_0x0e69('0x9')]=function(_0x4d7bed,_0x5f288a){var _0x4c722c=[];switch(_0x4d7bed[_0x0e69('0x3')]()){case _0x0e69('0xa'):switch(_0x5f288a['toLowerCase']()){case _0x0e69('0xb'):_0x4c722c=[{'type':_0x0e69('0x1'),'content':_0x0e69('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x0e69('0xd'),'content':'','key':_0x0e69('0xe'),'keyType':_0x0e69('0x5'),'variableName':'calleridnum'},{'type':_0x0e69('0xd'),'content':'','key':_0x0e69('0xf'),'keyType':_0x0e69('0x5'),'variableName':_0x0e69('0x10')},{'type':'keyValue','content':'','key':_0x0e69('0x11'),'keyType':'variable','variableName':_0x0e69('0x12')},{'type':_0x0e69('0xd'),'content':'','key':_0x0e69('0x13'),'keyType':_0x0e69('0x5'),'variableName':_0x0e69('0x14')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x0e69('0x5'),'variableName':'uniqueid'},{'type':_0x0e69('0xd'),'content':'','key':_0x0e69('0x15'),'keyType':_0x0e69('0x5'),'variableName':_0x0e69('0x16')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x0e69('0xd'),'content':'','key':'Agent\x20Name','keyType':_0x0e69('0x5'),'variableName':_0x0e69('0x17')},{'type':_0x0e69('0xd'),'content':'','key':_0x0e69('0x18'),'keyType':_0x0e69('0x5'),'variableName':'destcalleridnum'},{'type':_0x0e69('0x1'),'content':_0x0e69('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x0e69('0xd'),'content':'','key':_0x0e69('0x1a'),'keyType':_0x0e69('0x5'),'variableName':_0x0e69('0x16')},{'type':_0x0e69('0xd'),'content':'','key':'Agent\x20Connect','keyType':_0x0e69('0x5'),'variableName':_0x0e69('0x1b')},{'type':_0x0e69('0xd'),'content':'','key':_0x0e69('0x1c'),'keyType':_0x0e69('0x5'),'variableName':_0x0e69('0x1d')},{'type':_0x0e69('0xd'),'content':'','key':'Hold\x20Time','keyType':_0x0e69('0x5'),'variableName':_0x0e69('0x1e')},{'type':_0x0e69('0xd'),'content':'','key':'Talk\x20Time','keyType':_0x0e69('0x5'),'variableName':'talktime'}];break;case _0x0e69('0x7'):_0x4c722c=[{'type':_0x0e69('0x1'),'content':_0x0e69('0xc'),'variableName':null},{'type':_0x0e69('0xd'),'content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':_0x0e69('0x8')},{'type':'keyValue','content':'','key':_0x0e69('0x1f'),'keyType':'variable','keyContent':'','variableName':_0x0e69('0x20')},{'type':_0x0e69('0xd'),'content':'','key':'UniqueId','keyType':_0x0e69('0x5'),'keyContent':'','variableName':_0x0e69('0x21')},{'type':_0x0e69('0xd'),'content':'','key':_0x0e69('0x15'),'keyType':_0x0e69('0x5'),'keyContent':'','variableName':'starttime'},{'type':'string','content':_0x0e69('0x19')},{'type':'keyValue','content':'','key':_0x0e69('0x22'),'keyType':_0x0e69('0x5'),'keyContent':'','variableName':_0x0e69('0x23')},{'type':_0x0e69('0xd'),'content':'','key':_0x0e69('0x24'),'keyType':_0x0e69('0x5'),'keyContent':'','variableName':_0x0e69('0x25')},{'type':'keyValue','content':'','key':_0x0e69('0x26'),'keyType':_0x0e69('0x5'),'keyContent':'','variableName':_0x0e69('0x27')},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':_0x0e69('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x4c722c;};
\ No newline at end of file
index 641af5e..4b04481 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa606=['mail-interactions','fax-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','name','stringify','null','Interaction','then','info','tracked','user','query','clone','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa606,0x79));var _0x6a60=function(_0x31f347,_0x441ce3){_0x31f347=_0x31f347-0x0;var _0x599142=_0xa606[_0x31f347];return _0x599142;};'use strict';var _=require(_0x6a60('0x0'));var db=require(_0x6a60('0x1'))['db'];var loggers={'openchannel':require(_0x6a60('0x2'))(_0x6a60('0x3')),'mail':require(_0x6a60('0x2'))(_0x6a60('0x4')),'fax':require(_0x6a60('0x2'))(_0x6a60('0x5')),'sms':require(_0x6a60('0x2'))('sms-interactions'),'chat':require(_0x6a60('0x2'))('chat-interactions'),'whatsapp':require(_0x6a60('0x2'))(_0x6a60('0x6'))};function getInteractionId(_0x5676d3,_0x4efbf3,_0xf8fb31){if(_0x5676d3&&_0x5676d3[_[_0x6a60('0x7')](_0xf8fb31)+'InteractionId']){return _0x5676d3[_[_0x6a60('0x7')](_0xf8fb31)+_0x6a60('0x8')];}else if(_0x5676d3&&_0x5676d3['id']){return _0x5676d3['id'];}else if(_0x4efbf3&&_0x4efbf3['id']){return _0x4efbf3['id'];}else{return _0x6a60('0x9');}}function log(_0x2d2546,_0x4a2612,_0x3873bc,_0x3d5f94,_0xca774,_0x4e8a47){loggers[_0xca774[_0x6a60('0xa')]()][_0x2d2546]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e8a47[_0x6a60('0xb')](),_0x4a2612?_0x4a2612['id']:null,_0x4a2612?_0x4a2612[_0x6a60('0xc')]:null,_0x4a2612?_0x4a2612['role']:null,getInteractionId(_0x3873bc,_0x3d5f94,_0xca774),_0x3873bc?JSON[_0x6a60('0xd')](_0x3873bc):_0x6a60('0xe'));}function updateUser(_0x28f8dd,_0x51c440,_0x336175,_0x598102,_0x2e0181){db[_[_0x6a60('0x7')](_0x598102)+_0x6a60('0xf')]['findOne']({'where':{'id':getInteractionId(_0x51c440,_0x336175,_0x598102)}})['then'](function(_0x2eb3cf){if(_0x2eb3cf){return _0x2eb3cf['update']({'UserId':_0x28f8dd?_0x28f8dd['id']:null});}})[_0x6a60('0x10')](function(_0x44de6c){if(_0x44de6c){log(_0x6a60('0x11'),_0x28f8dd,_0x51c440,_0x336175,_0x598102,_0x2e0181);}})['catch'](function(){log('error',_0x28f8dd,_0x51c440,_0x336175,_0x598102,_0x2e0181);});}exports[_0x6a60('0x12')]=function(_0x28df0a,_0x2f431b){return function(_0x568d4b,_0x3828ef,_0x41e34c){var _0xf6e11b=_0x568d4b[_0x6a60('0x13')];var _0x1d685e={};var _0x18472c=_0x568d4b[_0x6a60('0x14')];if(_0x1d685e){_0x1d685e=_[_0x6a60('0x15')](_0x568d4b['body']);_0x1d685e=_['omit'](_0x1d685e,['body','html',_0x6a60('0x16'),_0x6a60('0x17'),_0x6a60('0x18')]);}updateUser(_0xf6e11b,_0x1d685e,_0x18472c,_0x28df0a,_0x2f431b);_0x41e34c(null);};};
\ No newline at end of file
+var _0xc16b=['../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','null','Interaction','findOne','update','then','info','catch','tracked','user','query','body','omit','html','fax','mobile'];(function(_0x45f74e,_0x3d682c){var _0x2f9628=function(_0x45c809){while(--_0x45c809){_0x45f74e['push'](_0x45f74e['shift']());}};_0x2f9628(++_0x3d682c);}(_0xc16b,0x17a));var _0xbc16=function(_0x4785d6,_0x5e9836){_0x4785d6=_0x4785d6-0x0;var _0x1789a2=_0xc16b[_0x4785d6];return _0x1789a2;};'use strict';var _=require('lodash');var db=require(_0xbc16('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0xbc16('0x1'))(_0xbc16('0x2')),'fax':require(_0xbc16('0x1'))(_0xbc16('0x3')),'sms':require(_0xbc16('0x1'))(_0xbc16('0x4')),'chat':require(_0xbc16('0x1'))(_0xbc16('0x5')),'whatsapp':require(_0xbc16('0x1'))('whatsapp-interactions')};function getInteractionId(_0xf1f8a8,_0x5b4371,_0x27e649){if(_0xf1f8a8&&_0xf1f8a8[_[_0xbc16('0x6')](_0x27e649)+_0xbc16('0x7')]){return _0xf1f8a8[_['upperFirst'](_0x27e649)+_0xbc16('0x7')];}else if(_0xf1f8a8&&_0xf1f8a8['id']){return _0xf1f8a8['id'];}else if(_0x5b4371&&_0x5b4371['id']){return _0x5b4371['id'];}else{return'unknown';}}function log(_0x494332,_0x42adb7,_0x200df7,_0x3060ed,_0x2b4ea9,_0x5ae2b7){loggers[_0x2b4ea9[_0xbc16('0x8')]()][_0x494332](_0xbc16('0x9'),_0x5ae2b7[_0xbc16('0xa')](),_0x42adb7?_0x42adb7['id']:null,_0x42adb7?_0x42adb7['name']:null,_0x42adb7?_0x42adb7[_0xbc16('0xb')]:null,getInteractionId(_0x200df7,_0x3060ed,_0x2b4ea9),_0x200df7?JSON['stringify'](_0x200df7):_0xbc16('0xc'));}function updateUser(_0x1be607,_0x29e811,_0x34e0c7,_0x3d5577,_0x3be359){db[_[_0xbc16('0x6')](_0x3d5577)+_0xbc16('0xd')][_0xbc16('0xe')]({'where':{'id':getInteractionId(_0x29e811,_0x34e0c7,_0x3d5577)}})['then'](function(_0x3f7faf){if(_0x3f7faf){return _0x3f7faf[_0xbc16('0xf')]({'UserId':_0x1be607?_0x1be607['id']:null});}})[_0xbc16('0x10')](function(_0x59f157){if(_0x59f157){log(_0xbc16('0x11'),_0x1be607,_0x29e811,_0x34e0c7,_0x3d5577,_0x3be359);}})[_0xbc16('0x12')](function(){log('error',_0x1be607,_0x29e811,_0x34e0c7,_0x3d5577,_0x3be359);});}exports[_0xbc16('0x13')]=function(_0x29c4a0,_0x57d3ad){return function(_0x5db36d,_0x5ee7ae,_0x526715){var _0x216e5a=_0x5db36d[_0xbc16('0x14')];var _0x4ee9b7={};var _0x1b765d=_0x5db36d[_0xbc16('0x15')];if(_0x4ee9b7){_0x4ee9b7=_['clone'](_0x5db36d[_0xbc16('0x16')]);_0x4ee9b7=_[_0xbc16('0x17')](_0x4ee9b7,[_0xbc16('0x16'),_0xbc16('0x18'),'phone',_0xbc16('0x19'),_0xbc16('0x1a')]);}updateUser(_0x216e5a,_0x4ee9b7,_0x1b765d,_0x29c4a0,_0x57d3ad);_0x526715(null);};};
\ No newline at end of file
index 0be5a0e..39f0c1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x827c=['isUserLimit','../../mysqldb','../../config/environment','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin'];(function(_0x2ef16c,_0xd211ba){var _0x128a71=function(_0x4c12f4){while(--_0x4c12f4){_0x2ef16c['push'](_0x2ef16c['shift']());}};_0x128a71(++_0xd211ba);}(_0x827c,0x8b));var _0xc827=function(_0x49894c,_0x4f01f5){_0x49894c=_0x49894c-0x0;var _0x2aa221=_0x827c[_0x49894c];return _0x2aa221;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require('composable-middleware');var db=require(_0xc827('0x0'))['db'];var config=require(_0xc827('0x1'));function getValueFromLicense(_0x221716,_0x36280c){if(_0x221716&&_0x36280c){if(_0x36280c['data1']&&_0x36280c[_0xc827('0x2')]){var _0x2aefc5=_0x36280c['data1'];var _0x29cf81=_0x36280c[_0xc827('0x2')];var _0x32383b=_0x2aefc5[_0xc827('0x3')]('-')[0x4];var _0x33f695=_0x2aefc5[_0xc827('0x3')]('-')[0x0];var _0x40f7d5=crypto['createDecipher'](_0xc827('0x4'),util[_0xc827('0x5')](_0xc827('0x6'),_0x32383b,_0x2aefc5,_0x33f695));var _0x31f9e5=_0x40f7d5[_0xc827('0x7')](_0x29cf81,_0xc827('0x8'),_0xc827('0x9'));_0x31f9e5+=_0x40f7d5[_0xc827('0xa')]('utf8');var _0x3f0095=JSON['parse'](_0x31f9e5);return _0x3f0095['hasOwnProperty'](_0x221716)?_0x3f0095[_0x221716]:null;}}return null;}function isLimit(_0x1073f8,_0x313eaa,_0x321567,_0x377485){var _0x38f8df=_0x313eaa;return compose()[_0xc827('0xb')](function(_0x4a784d,_0x2a207a,_0x332b5e){return db[_0xc827('0xc')][_0xc827('0xd')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x2d9dc3){var _0x1575ad=getValueFromLicense(_0x1073f8,_0x2d9dc3);return _0x1575ad?_0x1575ad:_0x38f8df;})[_0xc827('0xe')](function(_0x2abe0b){_0x38f8df=_0x2abe0b;return _0x321567[_0xc827('0xf')](_0x377485);})['then'](function(_0x2cb271){if(_0x2cb271>=_0x38f8df){return _0x2a207a[_0xc827('0x10')](0x193)[_0xc827('0x11')]({'message':util[_0xc827('0x5')](_0xc827('0x12'),_0x1073f8)});}_0x332b5e();})[_0xc827('0x13')](function(_0x2eb76c){_0x332b5e(_0x2eb76c);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xc827('0x14')],{'where':{'$or':[{'role':_0xc827('0x15')},{'role':'user'}]}});}exports[_0xc827('0x16')]=isUserLimit;
\ No newline at end of file
+var _0x8d5e=['../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','update','base64','final','utf8','parse','use','then','count','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware'];(function(_0x550833,_0xc7eda0){var _0x2f86b6=function(_0x4c84a2){while(--_0x4c84a2){_0x550833['push'](_0x550833['shift']());}};_0x2f86b6(++_0xc7eda0);}(_0x8d5e,0x69));var _0xe8d5=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x8d5e[_0x580576];return _0x3f55a0;};'use strict';var crypto=require(_0xe8d5('0x0'));var util=require(_0xe8d5('0x1'));var compose=require(_0xe8d5('0x2'));var db=require(_0xe8d5('0x3'))['db'];var config=require(_0xe8d5('0x4'));function getValueFromLicense(_0x48d0fa,_0x2e3788){if(_0x48d0fa&&_0x2e3788){if(_0x2e3788[_0xe8d5('0x5')]&&_0x2e3788[_0xe8d5('0x6')]){var _0x3784e6=_0x2e3788[_0xe8d5('0x5')];var _0x28353e=_0x2e3788[_0xe8d5('0x6')];var _0x8e59a3=_0x3784e6['split']('-')[0x4];var _0xcc5d2a=_0x3784e6[_0xe8d5('0x7')]('-')[0x0];var _0x4d91b9=crypto[_0xe8d5('0x8')](_0xe8d5('0x9'),util['format']('%s:%s:%s',_0x8e59a3,_0x3784e6,_0xcc5d2a));var _0x1d030e=_0x4d91b9[_0xe8d5('0xa')](_0x28353e,_0xe8d5('0xb'),'utf8');_0x1d030e+=_0x4d91b9[_0xe8d5('0xc')](_0xe8d5('0xd'));var _0x17dcd2=JSON[_0xe8d5('0xe')](_0x1d030e);return _0x17dcd2['hasOwnProperty'](_0x48d0fa)?_0x17dcd2[_0x48d0fa]:null;}}return null;}function isLimit(_0x53b984,_0xc8e757,_0x2c49d5,_0x26e78a){var _0x4554f3=_0xc8e757;return compose()[_0xe8d5('0xf')](function(_0x5b2be4,_0x221692,_0x3abf77){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0xe8d5('0x10')](function(_0x591031){var _0x51d8e7=getValueFromLicense(_0x53b984,_0x591031);return _0x51d8e7?_0x51d8e7:_0x4554f3;})[_0xe8d5('0x10')](function(_0x53de5e){_0x4554f3=_0x53de5e;return _0x2c49d5[_0xe8d5('0x11')](_0x26e78a);})[_0xe8d5('0x10')](function(_0x4d8cfc){if(_0x4d8cfc>=_0x4554f3){return _0x221692['status'](0x193)[_0xe8d5('0x12')]({'message':util[_0xe8d5('0x13')](_0xe8d5('0x14'),_0x53b984)});}_0x3abf77();})[_0xe8d5('0x15')](function(_0xa97007){_0x3abf77(_0xa97007);});});}function isUserLimit(){return isLimit(_0xe8d5('0x16'),0x1,db[_0xe8d5('0x17')],{'where':{'$or':[{'role':_0xe8d5('0x18')},{'role':_0xe8d5('0x19')}]}});}exports[_0xe8d5('0x1a')]=isUserLimit;
\ No newline at end of file
index c63bfdb..9317883 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa507=['field','\x20AS\x20','$ne','$notIn','text','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$endsWith','pop','utcOffset','add','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','split','slice','forEach','shift','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','days','format','YYYY-MM-DD','castTo','CAST('];(function(_0x35ccde,_0xbe027){var _0xbd6110=function(_0xba7aea){while(--_0xba7aea){_0x35ccde['push'](_0x35ccde['shift']());}};_0xbd6110(++_0xbe027);}(_0xa507,0xce));var _0x7a50=function(_0x33ac75,_0x4953e3){_0x33ac75=_0x33ac75-0x0;var _0x34d5f2=_0xa507[_0x33ac75];return _0x34d5f2;};'use strict';var _=require(_0x7a50('0x0'));var moment=require(_0x7a50('0x1'));exports[_0x7a50('0x2')]=function(_0x31fb81){var _0x1f92d0={'conditions':[]};_0x1f92d0[_0x7a50('0x3')]=_[_0x7a50('0x4')](_0x31fb81,_0x7a50('0x5'))?'or':'and';var _0x27d548=_0x31fb81[_0x7a50('0x6')](_0x7a50('0x7'),'')[_0x7a50('0x6')](_0x7a50('0x5'),'')[_0x7a50('0x8')]('||');for(var _0x37cc3b=0x0;_0x37cc3b<_0x27d548['length'];_0x37cc3b++){var _0x14a282=_0x27d548[_0x37cc3b][_0x7a50('0x8')](':=');var _0x5da685=_0x14a282[0x0];var _0x27da6f=_0x14a282[_0x7a50('0x9')](0x1);_0x27da6f[_0x7a50('0xa')](function(_0x1bcf62){var _0x14378c=_0x1bcf62[_0x7a50('0x8')]('[')[_0x7a50('0xb')]();var _0x29690d=_0x1bcf62['match'](/\[(.*?)\]/g);_0x29690d[_0x7a50('0xa')](function(_0x560a62){var _0x54e1a6=_0x560a62['split']('[')[_0x7a50('0xc')](function(_0x51a746){return _0x51a746[_0x7a50('0xd')](']')>-0x1;})[_0x7a50('0xe')](function(_0x20c9bc){return _0x20c9bc[_0x7a50('0x8')](']')[0x0];})[0x0];_0x1f92d0[_0x7a50('0xf')][_0x7a50('0x10')]({'field':_0x5da685,'operator':_0x14378c,'value':_0x54e1a6});});});}return _0x1f92d0;};exports[_0x7a50('0x11')]=function(_0x2c1379,_0x1307b3,_0x39b645){var _0x4ea9bd={};if(_0x1307b3===_0x7a50('0x12')){if(_0x39b645[_0x7a50('0x13')]===_0x7a50('0x14')){_0x39b645[_0x7a50('0x13')]=_0x7a50('0x15');_0x39b645[_0x7a50('0x16')]+=','+_0x39b645[_0x7a50('0x16')];}else if(_[_0x7a50('0x17')]([_0x7a50('0x18'),'$lte'],_0x39b645[_0x7a50('0x13')])){_0x39b645[_0x7a50('0x16')]=moment(_0x39b645[_0x7a50('0x16')])['add'](0x1,_0x7a50('0x19'))[_0x7a50('0x1a')](_0x7a50('0x1b'));}}if(_0x39b645['castTo']){_0x1307b3=_0x39b645[_0x7a50('0x1c')];_0x4ea9bd['text']=_0x7a50('0x1d')+_0x2c1379+'.'+_0x39b645[_0x7a50('0x1e')]+_0x7a50('0x1f')+_0x39b645['castTo']+')\x20'+parseOperator(_0x39b645[_0x7a50('0x13')]);}else{_0x4ea9bd['text']=_0x2c1379+'.'+_0x39b645[_0x7a50('0x1e')]+'\x20'+parseOperator(_0x39b645['operator']);}if(_['includes']([_0x7a50('0x20'),_0x7a50('0x21')],_0x39b645['operator']))_0x4ea9bd[_0x7a50('0x22')]='('+_0x4ea9bd[_0x7a50('0x22')]+_0x7a50('0x23')+_0x2c1379+'.'+_0x39b645[_0x7a50('0x1e')]+_0x7a50('0x24');_0x4ea9bd[_0x7a50('0x16')]=parseValue(_0x1307b3,_0x39b645[_0x7a50('0x13')],_0x39b645[_0x7a50('0x16')]);return _0x4ea9bd;};function parseOperator(_0x282d16){var _0x5d3af6;switch(_0x282d16){case _0x7a50('0x25'):_0x5d3af6=_0x7a50('0x26');break;case _0x7a50('0x21'):_0x5d3af6=_0x7a50('0x27');break;case _0x7a50('0x14'):_0x5d3af6=_0x7a50('0x28');break;case _0x7a50('0x20'):_0x5d3af6=_0x7a50('0x29');break;case _0x7a50('0x2a'):case _0x7a50('0x2b'):case'$endsWith':_0x5d3af6='LIKE\x20?';break;case _0x7a50('0x2c'):_0x5d3af6=_0x7a50('0x2d');break;case'$gt':_0x5d3af6=_0x7a50('0x2e');break;case _0x7a50('0x2f'):_0x5d3af6=_0x7a50('0x30');break;case _0x7a50('0x31'):_0x5d3af6=_0x7a50('0x32');break;case _0x7a50('0x15'):_0x5d3af6=_0x7a50('0x33');break;}return _0x5d3af6;}function parseValue(_0x21e1e4,_0x3b6505,_0x5c792a){var _0x316f24={'start':undefined,'end':undefined};switch(_0x3b6505){case _0x7a50('0x25'):case _0x7a50('0x21'):_0x316f24[_0x7a50('0x34')]=_0x5c792a[_0x7a50('0x8')](',');break;case'$substring':_0x316f24[_0x7a50('0x34')]='%'+_0x5c792a+'%';break;case _0x7a50('0x2b'):_0x316f24[_0x7a50('0x34')]=_0x5c792a+'%';break;case _0x7a50('0x35'):_0x316f24['start']='%'+_0x5c792a;break;case _0x7a50('0x15'):var _0x4de204=_0x5c792a[_0x7a50('0x8')](',');var _0x5c792a=_0x4de204['shift']();var _0x22317b=_0x4de204[_0x7a50('0x36')]();if(_0x21e1e4===_0x7a50('0x12')){_0x5c792a=moment(_0x5c792a)['utcOffset'](0x0,!![])['format']();_0x22317b=moment(_0x22317b)[_0x7a50('0x37')](0x0,!![])[_0x7a50('0x38')](0x17,'hours')[_0x7a50('0x38')](0x3b,_0x7a50('0x39'))[_0x7a50('0x38')](0x3b,_0x7a50('0x3a'))[_0x7a50('0x1a')]();}_0x316f24={'start':_0x5c792a,'end':_0x22317b};break;default:_0x316f24[_0x7a50('0x34')]=_0x5c792a;break;}return _0x316f24;}
\ No newline at end of file
+var _0x5bad=['<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','shift','format','utcOffset','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','replace','[$and]','[$or]','split','length','slice','match','filter','indexOf','map','conditions','push','DATE','operator','$between','value','includes','$lte','add','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?'];(function(_0x273955,_0x1d6cfa){var _0x1d2629=function(_0x37ab44){while(--_0x37ab44){_0x273955['push'](_0x273955['shift']());}};_0x1d2629(++_0x1d6cfa);}(_0x5bad,0x14d));var _0xd5ba=function(_0x784ffe,_0x31b40b){_0x784ffe=_0x784ffe-0x0;var _0x2acda2=_0x5bad[_0x784ffe];return _0x2acda2;};'use strict';var _=require(_0xd5ba('0x0'));var moment=require(_0xd5ba('0x1'));exports[_0xd5ba('0x2')]=function(_0x4bd06e){var _0x1a6ba2={'conditions':[]};_0x1a6ba2[_0xd5ba('0x3')]=_[_0xd5ba('0x4')](_0x4bd06e,'[$or]')?'or':'and';var _0x200dc7=_0x4bd06e[_0xd5ba('0x5')](_0xd5ba('0x6'),'')['replace'](_0xd5ba('0x7'),'')[_0xd5ba('0x8')]('||');for(var _0x36544b=0x0;_0x36544b<_0x200dc7[_0xd5ba('0x9')];_0x36544b++){var _0x410d0d=_0x200dc7[_0x36544b][_0xd5ba('0x8')](':=');var _0x8a405a=_0x410d0d[0x0];var _0x381621=_0x410d0d[_0xd5ba('0xa')](0x1);_0x381621['forEach'](function(_0x5f4452){var _0x11975d=_0x5f4452['split']('[')['shift']();var _0x138c73=_0x5f4452[_0xd5ba('0xb')](/\[(.*?)\]/g);_0x138c73['forEach'](function(_0x431f7a){var _0x2fe485=_0x431f7a[_0xd5ba('0x8')]('[')[_0xd5ba('0xc')](function(_0x23da55){return _0x23da55[_0xd5ba('0xd')](']')>-0x1;})[_0xd5ba('0xe')](function(_0xcce6df){return _0xcce6df[_0xd5ba('0x8')](']')[0x0];})[0x0];_0x1a6ba2[_0xd5ba('0xf')][_0xd5ba('0x10')]({'field':_0x8a405a,'operator':_0x11975d,'value':_0x2fe485});});});}return _0x1a6ba2;};exports['buildExpression']=function(_0x4490f9,_0x1568db,_0xe0f9c7){var _0x1fbd63={};if(_0x1568db===_0xd5ba('0x11')){if(_0xe0f9c7['operator']==='$eq'){_0xe0f9c7[_0xd5ba('0x12')]=_0xd5ba('0x13');_0xe0f9c7['value']+=','+_0xe0f9c7[_0xd5ba('0x14')];}else if(_[_0xd5ba('0x15')](['$gt',_0xd5ba('0x16')],_0xe0f9c7['operator'])){_0xe0f9c7[_0xd5ba('0x14')]=moment(_0xe0f9c7[_0xd5ba('0x14')])[_0xd5ba('0x17')](0x1,'days')['format'](_0xd5ba('0x18'));}}if(_0xe0f9c7[_0xd5ba('0x19')]){_0x1568db=_0xe0f9c7[_0xd5ba('0x19')];_0x1fbd63[_0xd5ba('0x1a')]=_0xd5ba('0x1b')+_0x4490f9+'.'+_0xe0f9c7[_0xd5ba('0x1c')]+_0xd5ba('0x1d')+_0xe0f9c7[_0xd5ba('0x19')]+')\x20'+parseOperator(_0xe0f9c7['operator']);}else{_0x1fbd63[_0xd5ba('0x1a')]=_0x4490f9+'.'+_0xe0f9c7[_0xd5ba('0x1c')]+'\x20'+parseOperator(_0xe0f9c7[_0xd5ba('0x12')]);}if(_[_0xd5ba('0x15')]([_0xd5ba('0x1e'),_0xd5ba('0x1f')],_0xe0f9c7[_0xd5ba('0x12')]))_0x1fbd63[_0xd5ba('0x1a')]='('+_0x1fbd63['text']+_0xd5ba('0x20')+_0x4490f9+'.'+_0xe0f9c7[_0xd5ba('0x1c')]+'\x20IS\x20NULL)';_0x1fbd63[_0xd5ba('0x14')]=parseValue(_0x1568db,_0xe0f9c7[_0xd5ba('0x12')],_0xe0f9c7[_0xd5ba('0x14')]);return _0x1fbd63;};function parseOperator(_0x252e92){var _0x2d7c13;switch(_0x252e92){case _0xd5ba('0x21'):_0x2d7c13=_0xd5ba('0x22');break;case _0xd5ba('0x1f'):_0x2d7c13=_0xd5ba('0x23');break;case'$eq':_0x2d7c13=_0xd5ba('0x24');break;case _0xd5ba('0x1e'):_0x2d7c13='<>\x20?';break;case _0xd5ba('0x25'):case _0xd5ba('0x26'):case _0xd5ba('0x27'):_0x2d7c13=_0xd5ba('0x28');break;case _0xd5ba('0x29'):_0x2d7c13=_0xd5ba('0x2a');break;case _0xd5ba('0x2b'):_0x2d7c13=_0xd5ba('0x2c');break;case _0xd5ba('0x16'):_0x2d7c13=_0xd5ba('0x2d');break;case _0xd5ba('0x2e'):_0x2d7c13=_0xd5ba('0x2f');break;case _0xd5ba('0x13'):_0x2d7c13=_0xd5ba('0x30');break;}return _0x2d7c13;}function parseValue(_0x5574eb,_0x56bbb8,_0xb3d00a){var _0x24c800={'start':undefined,'end':undefined};switch(_0x56bbb8){case'$in':case _0xd5ba('0x1f'):_0x24c800[_0xd5ba('0x31')]=_0xb3d00a[_0xd5ba('0x8')](',');break;case _0xd5ba('0x25'):_0x24c800['start']='%'+_0xb3d00a+'%';break;case'$startsWith':_0x24c800[_0xd5ba('0x31')]=_0xb3d00a+'%';break;case _0xd5ba('0x27'):_0x24c800[_0xd5ba('0x31')]='%'+_0xb3d00a;break;case _0xd5ba('0x13'):var _0xf621e=_0xb3d00a[_0xd5ba('0x8')](',');var _0xb3d00a=_0xf621e[_0xd5ba('0x32')]();var _0x3d1357=_0xf621e['pop']();if(_0x5574eb===_0xd5ba('0x11')){_0xb3d00a=moment(_0xb3d00a)['utcOffset'](0x0,!![])[_0xd5ba('0x33')]();_0x3d1357=moment(_0x3d1357)[_0xd5ba('0x34')](0x0,!![])[_0xd5ba('0x17')](0x17,'hours')[_0xd5ba('0x17')](0x3b,'minutes')[_0xd5ba('0x17')](0x3b,_0xd5ba('0x35'))[_0xd5ba('0x33')]();}_0x24c800={'start':_0xb3d00a,'end':_0x3d1357};break;default:_0x24c800[_0xd5ba('0x31')]=_0xb3d00a;break;}return _0x24c800;}
\ No newline at end of file
index 1c16d6b..b1e945a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cfa=['parse','includes','keys','split','isEmpty','forOwn','find','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','length','isObject','unset','match','^[+]?[0-9]*$','isEmail','forEach','replace','join','getOptions','query','$id','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','lower','filter','lodash','moment'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x7cfa,0xa9));var _0xa7cf=function(_0x2e0454,_0x5ca866){_0x2e0454=_0x2e0454-0x0;var _0x3e00f5=_0x7cfa[_0x2e0454];return _0x3e00f5;};'use strict';var _=require(_0xa7cf('0x0'));var sequelize=require('sequelize');var moment=require(_0xa7cf('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x23104c){var _0x2b6131=['ne'];try{var _0x52e95f=JSON[_0xa7cf('0x2')](_0x23104c);var _0x314bb1=Object['keys'](_0x52e95f)[0x0];return _0x2b6131[_0xa7cf('0x3')](_0x314bb1);}catch(_0x417ebd){return![];}}function getOperatorValue(_0x2fa803){var _0x3944e6=JSON[_0xa7cf('0x2')](_0x2fa803);var _0x546bb5=Object[_0xa7cf('0x4')](_0x3944e6)[0x0];var _0x170014=_0x3944e6[_0x546bb5];return{['$'+_0x546bb5]:_0x170014};}exports['fields']=function(_0x7679e5){var _0x53f9cd=null;if(_0x7679e5){_0x53f9cd=_0x7679e5[_0xa7cf('0x5')](',');}return _0x53f9cd;};exports['filters']=function(_0x1c71fd,_0xa7b6e6){var _0x397f41={};if(!_[_0xa7cf('0x6')](_0x1c71fd)){_[_0xa7cf('0x7')](_0x1c71fd,function(_0x5a5ce8,_0x9c30f7){try{if(_0xa7b6e6){var _0x965dc0=_[_0xa7cf('0x8')](_0xa7b6e6,{'name':_0x9c30f7})||{};if(hasSequelizeOperator(_0x5a5ce8)){_0x397f41[_0x9c30f7]=getOperatorValue(_0x5a5ce8);}else if(_0x965dc0[_0xa7cf('0x9')]==='DATE'&&_[_0xa7cf('0xa')](_0x5a5ce8)){var _0x19c40f=JSON[_0xa7cf('0x2')](_0x5a5ce8);var _0x3303c8={'$gte':moment(moment(_0x19c40f[_0xa7cf('0xb')])[_0xa7cf('0xc')](_0xa7cf('0xd')))[_0xa7cf('0xe')]()['format'](),'$lte':moment(moment(_0x19c40f[_0xa7cf('0xf')])[_0xa7cf('0xc')](_0xa7cf('0xd')))[_0xa7cf('0xe')]()[_0xa7cf('0x10')](0x1,'s')[_0xa7cf('0xc')]()};_0x397f41[_0x9c30f7]=_0x3303c8;}else if(_0x965dc0[_0xa7cf('0x11')]===_0xa7cf('0x12')){_0x397f41[_0x9c30f7]=_0x5a5ce8;}else{_0x397f41[_0x9c30f7]=_[_0xa7cf('0x13')](_0x5a5ce8)?_0x5a5ce8:JSON[_0xa7cf('0x2')](_0x5a5ce8);}}else{_0x397f41[_0x9c30f7]=_[_0xa7cf('0x13')](_0x5a5ce8)?_0x5a5ce8:JSON['parse'](_0x5a5ce8);}}catch(_0x54bbe6){_0x397f41[_0x9c30f7]=_0x5a5ce8[_0xa7cf('0x5')](',');}});}return _0x397f41;};exports[_0xa7cf('0x14')]=function(_0x2ab5aa){_0x2ab5aa=parseInt(_0x2ab5aa,0xa);if(!_0x2ab5aa||_0x2ab5aa<0x0){_0x2ab5aa=LIMIT_VALUE;}return _0x2ab5aa;};exports[_0xa7cf('0x15')]=function(_0x533cb4){_0x533cb4=parseInt(_0x533cb4,0xa);if(!_0x533cb4||_0x533cb4<0x0){_0x533cb4=0x0;}return _0x533cb4;};exports[_0xa7cf('0x16')]=function(_0x566de9){var _0xf6528f,_0x46c5e9=null;if(_0x566de9){_0xf6528f=_0x566de9[_0xa7cf('0x5')](',');_0x46c5e9=_[_0xa7cf('0x17')](_0xf6528f,function(_0x24e4ad){if(_0x24e4ad[_0xa7cf('0x18')]('-')===0x0){return[_0x24e4ad===_0xa7cf('0x19')?sequelize[_0xa7cf('0x1a')](sequelize[_0xa7cf('0x1b')](_0xa7cf('0x19')),_0xa7cf('0x1c')):_0x24e4ad[_0xa7cf('0x1d')](0x1),_0xa7cf('0x1e')];}else{return[_0x24e4ad==='priority'?sequelize[_0xa7cf('0x1a')](sequelize['col']('priority'),_0xa7cf('0x1c')):_0x24e4ad,_0xa7cf('0x1f')];}});}return _0x46c5e9;};exports[_0xa7cf('0x20')]=function(_0x3be63f,_0x293705){if(_[_0xa7cf('0x6')](_0x3be63f)){return _0x3be63f;}if(_[_0xa7cf('0x13')](_0x3be63f)){for(var _0x359f14=0x0;_0x359f14<_0x3be63f[_0xa7cf('0x21')];_0x359f14+=0x1){_0x3be63f[_0x359f14]=this[_0xa7cf('0x20')](_0x3be63f[_0x359f14],_0x293705);}return _0x3be63f;}if(!_[_0xa7cf('0x22')](_0x3be63f)){return _0x3be63f;}if(_['isString'](_0x293705)){_0x293705=[_0x293705];}if(!_[_0xa7cf('0x13')](_0x293705)){return _0x3be63f;}for(var _0x59ff38=0x0;_0x59ff38<_0x293705['length'];_0x59ff38+=0x1){_[_0xa7cf('0x23')](_0x3be63f,_0x293705[_0x59ff38]);}for(var _0x4cec32 in _0x3be63f){if(_0x3be63f['hasOwnProperty'](_0x4cec32)){_0x3be63f[_0x4cec32]=this[_0xa7cf('0x20')](_0x3be63f[_0x4cec32],_0x293705);}}return _0x3be63f;};exports['isNumeric']=function(_0x4a680c){return _0x4a680c[_0xa7cf('0x24')](RegExp(_0xa7cf('0x25')))?!![]:![];};exports[_0xa7cf('0x26')]=function(_0x1cb678){return _0x1cb678[_0xa7cf('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x4f9492){var _0x174d6a=[];_0x4f9492[_0xa7cf('0x5')](/[ ,]+/)[_0xa7cf('0x27')](function(_0x298654){_0x298654=_0x298654[_0xa7cf('0x28')](/([^:]")"+/g,'$1');_0x298654='+'+_0x298654+'*';if(_0x298654[_0xa7cf('0x3')]('@'))_0x298654='\x22'+_0x298654+'\x22';_0x174d6a['push'](_0x298654);});return _0x174d6a[_0xa7cf('0x29')]('\x20');};exports[_0xa7cf('0x2a')]=function(_0x5aa73a,_0x1da406,_0x38b265){var _0x2e7a69={},_0x547f6a={};if(_0x1da406[_0xa7cf('0x2b')]['$id']){_0x1da406[_0xa7cf('0x2b')]['id']=_0x1da406[_0xa7cf('0x2b')][_0xa7cf('0x2c')];delete _0x1da406[_0xa7cf('0x2b')][_0xa7cf('0x2c')];}_0x2e7a69['model']=_[_0xa7cf('0x17')](_0x5aa73a,_0xa7cf('0x11'));_0x2e7a69[_0xa7cf('0x2b')]=_['keys'](_0x1da406[_0xa7cf('0x2b')]);_0x2e7a69['filters']=_[_0xa7cf('0x2d')](_0x2e7a69[_0xa7cf('0x2e')],_0x2e7a69[_0xa7cf('0x2b')]);_0x547f6a[_0xa7cf('0x2f')]=_[_0xa7cf('0x2d')](_0x2e7a69['model'],this[_0xa7cf('0x30')](_0x1da406['query']['fields']));_0x547f6a['attributes']=_0x547f6a[_0xa7cf('0x2f')]['length']?_0x547f6a[_0xa7cf('0x2f')]:_0x2e7a69[_0xa7cf('0x2e')];if(!_0x1da406['query'][_0xa7cf('0x31')](_0xa7cf('0x32'))){_0x547f6a[_0xa7cf('0x14')]=this[_0xa7cf('0x14')](_0x1da406[_0xa7cf('0x2b')][_0xa7cf('0x14')]);_0x547f6a['offset']=this['offset'](_0x1da406[_0xa7cf('0x2b')][_0xa7cf('0x15')]);}_0x547f6a[_0xa7cf('0x33')]=this[_0xa7cf('0x16')](_0x1da406[_0xa7cf('0x2b')][_0xa7cf('0x16')]);_0x547f6a[_0xa7cf('0x34')]=this[_0xa7cf('0x35')](_[_0xa7cf('0x36')](_0x1da406[_0xa7cf('0x2b')],_0x2e7a69[_0xa7cf('0x35')]),_0x5aa73a);if(_0x1da406[_0xa7cf('0x2b')]['filter']){_0x547f6a[_0xa7cf('0x34')]=_['merge'](_0x547f6a[_0xa7cf('0x34')],{'$or':_['map'](_0x5aa73a,function(_0x1273e5){if(_0x1273e5['type']!=='VIRTUAL'){if(_0x38b265){return sequelize[_0xa7cf('0x34')](sequelize['fn'](_0xa7cf('0x37'),sequelize[_0xa7cf('0x1b')](_0x1273e5[_0xa7cf('0x11')])),{'$like':sequelize['fn'](_0xa7cf('0x37'),'%'+_0x1da406['query'][_0xa7cf('0x38')]+'%')});}else{var _0x32cd3b={};_0x32cd3b[_0x1273e5[_0xa7cf('0x11')]]={'$like':'%'+_0x1da406[_0xa7cf('0x2b')][_0xa7cf('0x38')]+'%'};return _0x32cd3b;}}})});}_0x547f6a=_['merge']({},_0x547f6a,_0x1da406['options']);return _0x547f6a;};
\ No newline at end of file
+var _0xcf4d=['YYYY-MM-DD','format','$lte','utc','subtract','name','isArray','limit','offset','indexOf','cast','priority','unsigned','substr','DESC','col','omit','length','isObject','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','push','join','$id','query','model','map','intersection','attributes','fields','sort','where','merge','VIRTUAL','lower','filter','options','lodash','sequelize','moment','parse','keys','includes','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte'];(function(_0x4e6e2d,_0x57fc76){var _0x4665dd=function(_0x3f04f4){while(--_0x3f04f4){_0x4e6e2d['push'](_0x4e6e2d['shift']());}};_0x4665dd(++_0x57fc76);}(_0xcf4d,0x113));var _0xdcf4=function(_0x18e62e,_0x146ca0){_0x18e62e=_0x18e62e-0x0;var _0x4bc84c=_0xcf4d[_0x18e62e];return _0x4bc84c;};'use strict';var _=require(_0xdcf4('0x0'));var sequelize=require(_0xdcf4('0x1'));var moment=require(_0xdcf4('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3927ce){var _0x5f8ffe=['ne'];try{var _0x3e051a=JSON[_0xdcf4('0x3')](_0x3927ce);var _0xc6043b=Object[_0xdcf4('0x4')](_0x3e051a)[0x0];return _0x5f8ffe[_0xdcf4('0x5')](_0xc6043b);}catch(_0x25760e){return![];}}function getOperatorValue(_0xf0cd96){var _0x325872=JSON[_0xdcf4('0x3')](_0xf0cd96);var _0x2f2fbb=Object['keys'](_0x325872)[0x0];var _0x39dbde=_0x325872[_0x2f2fbb];return{['$'+_0x2f2fbb]:_0x39dbde};}exports['fields']=function(_0x4ae990){var _0x33afb6=null;if(_0x4ae990){_0x33afb6=_0x4ae990[_0xdcf4('0x6')](',');}return _0x33afb6;};exports[_0xdcf4('0x7')]=function(_0x54af0b,_0x44899b){var _0x410d03={};if(!_[_0xdcf4('0x8')](_0x54af0b)){_[_0xdcf4('0x9')](_0x54af0b,function(_0x21caa1,_0x46da74){try{if(_0x44899b){var _0x27ce45=_[_0xdcf4('0xa')](_0x44899b,{'name':_0x46da74})||{};if(hasSequelizeOperator(_0x21caa1)){_0x410d03[_0x46da74]=getOperatorValue(_0x21caa1);}else if(_0x27ce45[_0xdcf4('0xb')]===_0xdcf4('0xc')&&_[_0xdcf4('0xd')](_0x21caa1)){var _0x282b53=JSON['parse'](_0x21caa1);var _0x3e8185={'$gte':moment(moment(_0x282b53[_0xdcf4('0xe')])['format'](_0xdcf4('0xf')))['utc']()[_0xdcf4('0x10')](),'$lte':moment(moment(_0x282b53[_0xdcf4('0x11')])[_0xdcf4('0x10')](_0xdcf4('0xf')))[_0xdcf4('0x12')]()[_0xdcf4('0x13')](0x1,'s')[_0xdcf4('0x10')]()};_0x410d03[_0x46da74]=_0x3e8185;}else if(_0x27ce45[_0xdcf4('0x14')]==='uniqueid'){_0x410d03[_0x46da74]=_0x21caa1;}else{_0x410d03[_0x46da74]=_[_0xdcf4('0x15')](_0x21caa1)?_0x21caa1:JSON[_0xdcf4('0x3')](_0x21caa1);}}else{_0x410d03[_0x46da74]=_[_0xdcf4('0x15')](_0x21caa1)?_0x21caa1:JSON[_0xdcf4('0x3')](_0x21caa1);}}catch(_0xcc5a0b){_0x410d03[_0x46da74]=_0x21caa1[_0xdcf4('0x6')](',');}});}return _0x410d03;};exports[_0xdcf4('0x16')]=function(_0x438eb9){_0x438eb9=parseInt(_0x438eb9,0xa);if(!_0x438eb9||_0x438eb9<0x0){_0x438eb9=LIMIT_VALUE;}return _0x438eb9;};exports[_0xdcf4('0x17')]=function(_0x22ad59){_0x22ad59=parseInt(_0x22ad59,0xa);if(!_0x22ad59||_0x22ad59<0x0){_0x22ad59=0x0;}return _0x22ad59;};exports['sort']=function(_0x2af587){var _0x155b64,_0x272779=null;if(_0x2af587){_0x155b64=_0x2af587[_0xdcf4('0x6')](',');_0x272779=_['map'](_0x155b64,function(_0x36e28d){if(_0x36e28d[_0xdcf4('0x18')]('-')===0x0){return[_0x36e28d==='priority'?sequelize[_0xdcf4('0x19')](sequelize['col'](_0xdcf4('0x1a')),_0xdcf4('0x1b')):_0x36e28d[_0xdcf4('0x1c')](0x1),_0xdcf4('0x1d')];}else{return[_0x36e28d===_0xdcf4('0x1a')?sequelize['cast'](sequelize[_0xdcf4('0x1e')]('priority'),_0xdcf4('0x1b')):_0x36e28d,'ASC'];}});}return _0x272779;};exports[_0xdcf4('0x1f')]=function(_0xdbff69,_0x26c4c8){if(_[_0xdcf4('0x8')](_0xdbff69)){return _0xdbff69;}if(_[_0xdcf4('0x15')](_0xdbff69)){for(var _0xa7bfb=0x0;_0xa7bfb<_0xdbff69[_0xdcf4('0x20')];_0xa7bfb+=0x1){_0xdbff69[_0xa7bfb]=this[_0xdcf4('0x1f')](_0xdbff69[_0xa7bfb],_0x26c4c8);}return _0xdbff69;}if(!_[_0xdcf4('0x21')](_0xdbff69)){return _0xdbff69;}if(_[_0xdcf4('0x22')](_0x26c4c8)){_0x26c4c8=[_0x26c4c8];}if(!_['isArray'](_0x26c4c8)){return _0xdbff69;}for(var _0x2552bc=0x0;_0x2552bc<_0x26c4c8[_0xdcf4('0x20')];_0x2552bc+=0x1){_[_0xdcf4('0x23')](_0xdbff69,_0x26c4c8[_0x2552bc]);}for(var _0x1635c8 in _0xdbff69){if(_0xdbff69['hasOwnProperty'](_0x1635c8)){_0xdbff69[_0x1635c8]=this['omit'](_0xdbff69[_0x1635c8],_0x26c4c8);}}return _0xdbff69;};exports[_0xdcf4('0x24')]=function(_0x142212){return _0x142212[_0xdcf4('0x25')](RegExp(_0xdcf4('0x26')))?!![]:![];};exports[_0xdcf4('0x27')]=function(_0x1b2b9f){return _0x1b2b9f[_0xdcf4('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xdcf4('0x28')]=function(_0x59d9fb){var _0x1d8691=[];_0x59d9fb[_0xdcf4('0x6')](/[ ,]+/)[_0xdcf4('0x29')](function(_0x11d422){_0x11d422=_0x11d422['replace'](/([^:]")"+/g,'$1');_0x11d422='+'+_0x11d422+'*';if(_0x11d422[_0xdcf4('0x5')]('@'))_0x11d422='\x22'+_0x11d422+'\x22';_0x1d8691[_0xdcf4('0x2a')](_0x11d422);});return _0x1d8691[_0xdcf4('0x2b')]('\x20');};exports['getOptions']=function(_0x2b4d36,_0x10bee2,_0xc132d7){var _0x3f8f60={},_0x547b0f={};if(_0x10bee2['query'][_0xdcf4('0x2c')]){_0x10bee2[_0xdcf4('0x2d')]['id']=_0x10bee2[_0xdcf4('0x2d')]['$id'];delete _0x10bee2['query']['$id'];}_0x3f8f60[_0xdcf4('0x2e')]=_[_0xdcf4('0x2f')](_0x2b4d36,_0xdcf4('0x14'));_0x3f8f60[_0xdcf4('0x2d')]=_[_0xdcf4('0x4')](_0x10bee2[_0xdcf4('0x2d')]);_0x3f8f60['filters']=_[_0xdcf4('0x30')](_0x3f8f60['model'],_0x3f8f60['query']);_0x547b0f[_0xdcf4('0x31')]=_['intersection'](_0x3f8f60[_0xdcf4('0x2e')],this[_0xdcf4('0x32')](_0x10bee2[_0xdcf4('0x2d')][_0xdcf4('0x32')]));_0x547b0f['attributes']=_0x547b0f[_0xdcf4('0x31')][_0xdcf4('0x20')]?_0x547b0f[_0xdcf4('0x31')]:_0x3f8f60[_0xdcf4('0x2e')];if(!_0x10bee2['query']['hasOwnProperty']('nolimit')){_0x547b0f[_0xdcf4('0x16')]=this['limit'](_0x10bee2[_0xdcf4('0x2d')][_0xdcf4('0x16')]);_0x547b0f[_0xdcf4('0x17')]=this['offset'](_0x10bee2[_0xdcf4('0x2d')][_0xdcf4('0x17')]);}_0x547b0f['order']=this[_0xdcf4('0x33')](_0x10bee2[_0xdcf4('0x2d')][_0xdcf4('0x33')]);_0x547b0f[_0xdcf4('0x34')]=this[_0xdcf4('0x7')](_['pick'](_0x10bee2[_0xdcf4('0x2d')],_0x3f8f60[_0xdcf4('0x7')]),_0x2b4d36);if(_0x10bee2[_0xdcf4('0x2d')]['filter']){_0x547b0f[_0xdcf4('0x34')]=_[_0xdcf4('0x35')](_0x547b0f['where'],{'$or':_[_0xdcf4('0x2f')](_0x2b4d36,function(_0x9c5d5e){if(_0x9c5d5e[_0xdcf4('0xb')]!==_0xdcf4('0x36')){if(_0xc132d7){return sequelize[_0xdcf4('0x34')](sequelize['fn'](_0xdcf4('0x37'),sequelize[_0xdcf4('0x1e')](_0x9c5d5e[_0xdcf4('0x14')])),{'$like':sequelize['fn'](_0xdcf4('0x37'),'%'+_0x10bee2[_0xdcf4('0x2d')][_0xdcf4('0x38')]+'%')});}else{var _0x238f0d={};_0x238f0d[_0x9c5d5e[_0xdcf4('0x14')]]={'$like':'%'+_0x10bee2[_0xdcf4('0x2d')][_0xdcf4('0x38')]+'%'};return _0x238f0d;}}})});}_0x547b0f=_[_0xdcf4('0x35')]({},_0x547b0f,_0x10bee2[_0xdcf4('0x39')]);return _0x547b0f;};
\ No newline at end of file
index bed7f45..40ede8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69d7=['passport','cors','moment','./environment','production','set','root','public','development','test','join','use','toISOString','split','static','get','appPath','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','method-override','cookie-parser','errorhandler','path'];(function(_0x219ff6,_0x3e45e1){var _0x5e8912=function(_0x3e6d4e){while(--_0x3e6d4e){_0x219ff6['push'](_0x219ff6['shift']());}};_0x5e8912(++_0x3e45e1);}(_0x69d7,0xd5));var _0x769d=function(_0x42b648,_0x47702b){_0x42b648=_0x42b648-0x0;var _0x44ab47=_0x69d7[_0x42b648];return _0x44ab47;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require('body-parser');var methodOverride=require(_0x769d('0x0'));var cookieParser=require(_0x769d('0x1'));var errorHandler=require(_0x769d('0x2'));var path=require(_0x769d('0x3'));var passport=require(_0x769d('0x4'));var cors=require(_0x769d('0x5'));var moment=require(_0x769d('0x6'));var config=require(_0x769d('0x7'));var db=require('../mysqldb')['db'];exports['default']=function(_0x3a56da){var _0x158c5f=_0x3a56da['get']('env');if(_0x158c5f===_0x769d('0x8')){_0x3a56da[_0x769d('0x9')]('appPath',path['join'](config[_0x769d('0xa')],_0x769d('0xb')));}if(_0x158c5f===_0x769d('0xc')||_0x158c5f===_0x769d('0xd')){_0x3a56da['set']('appPath',path[_0x769d('0xe')](config['root'],'client'));_0x3a56da[_0x769d('0xf')](errorHandler());}_0x3a56da['set']('json\x20replacer',function(_0x446b64,_0x5e1af3){if(this[_0x446b64]instanceof Date){_0x5e1af3=this[_0x446b64][_0x769d('0x10')]()[_0x769d('0x11')]('.')[0x0]+'Z';}return _0x5e1af3;});_0x3a56da[_0x769d('0xf')](express[_0x769d('0x12')](_0x3a56da[_0x769d('0x13')](_0x769d('0x14'))));_0x3a56da['set']('views',config[_0x769d('0xa')]+_0x769d('0x15'));_0x3a56da[_0x769d('0x16')](_0x769d('0x17'),require(_0x769d('0x18'))[_0x769d('0x19')]);_0x3a56da[_0x769d('0x9')](_0x769d('0x1a'),_0x769d('0x17'));_0x3a56da[_0x769d('0xf')](bodyParser[_0x769d('0x1b')]({'limit':_0x769d('0x1c'),'extended':!![]}));_0x3a56da[_0x769d('0xf')](bodyParser[_0x769d('0x1d')]({'limit':'50mb'}));_0x3a56da['use'](cors());_0x3a56da['use'](methodOverride());_0x3a56da[_0x769d('0xf')](cookieParser());_0x3a56da[_0x769d('0xf')](passport[_0x769d('0x1e')]());};
\ No newline at end of file
+var _0x77b1=['path','cors','moment','./environment','../mysqldb','default','env','set','appPath','join','root','development','test','client','toISOString','split','use','static','/server/views','engine','html','ejs','renderFile','view\x20engine','50mb','initialize','express','body-parser','method-override'];(function(_0x280c8d,_0x4b87a7){var _0x11f95b=function(_0x56d54d){while(--_0x56d54d){_0x280c8d['push'](_0x280c8d['shift']());}};_0x11f95b(++_0x4b87a7);}(_0x77b1,0x102));var _0x177b=function(_0x5daced,_0x423b95){_0x5daced=_0x5daced-0x0;var _0x2d6a97=_0x77b1[_0x5daced];return _0x2d6a97;};'use strict';var express=require(_0x177b('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x177b('0x1'));var methodOverride=require(_0x177b('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require('errorhandler');var path=require(_0x177b('0x3'));var passport=require('passport');var cors=require(_0x177b('0x4'));var moment=require(_0x177b('0x5'));var config=require(_0x177b('0x6'));var db=require(_0x177b('0x7'))['db'];exports[_0x177b('0x8')]=function(_0x5b45ba){var _0x246bdf=_0x5b45ba['get'](_0x177b('0x9'));if(_0x246bdf==='production'){_0x5b45ba[_0x177b('0xa')](_0x177b('0xb'),path[_0x177b('0xc')](config[_0x177b('0xd')],'public'));}if(_0x246bdf===_0x177b('0xe')||_0x246bdf===_0x177b('0xf')){_0x5b45ba[_0x177b('0xa')](_0x177b('0xb'),path[_0x177b('0xc')](config[_0x177b('0xd')],_0x177b('0x10')));_0x5b45ba['use'](errorHandler());}_0x5b45ba['set']('json\x20replacer',function(_0x1407e8,_0x4b0671){if(this[_0x1407e8]instanceof Date){_0x4b0671=this[_0x1407e8][_0x177b('0x11')]()[_0x177b('0x12')]('.')[0x0]+'Z';}return _0x4b0671;});_0x5b45ba[_0x177b('0x13')](express[_0x177b('0x14')](_0x5b45ba['get'](_0x177b('0xb'))));_0x5b45ba[_0x177b('0xa')]('views',config[_0x177b('0xd')]+_0x177b('0x15'));_0x5b45ba[_0x177b('0x16')](_0x177b('0x17'),require(_0x177b('0x18'))[_0x177b('0x19')]);_0x5b45ba[_0x177b('0xa')](_0x177b('0x1a'),_0x177b('0x17'));_0x5b45ba['use'](bodyParser['urlencoded']({'limit':_0x177b('0x1b'),'extended':!![]}));_0x5b45ba[_0x177b('0x13')](bodyParser['json']({'limit':'50mb'}));_0x5b45ba[_0x177b('0x13')](cors());_0x5b45ba[_0x177b('0x13')](methodOverride());_0x5b45ba[_0x177b('0x13')](cookieParser());_0x5b45ba[_0x177b('0x13')](passport[_0x177b('0x1c')]());};
\ No newline at end of file
index 997cd32..b06ca5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd156=['join','createHash','md5','update','digest','hex','platform','test','licenseToken','replace','macAddress','ipAddress','substring','bimedia-machine-uuid','child_process','execSync','orderBy','filter','IPv4','internal','concat','head','mac','address','127.0.0.1','getFirstInterface'];(function(_0x5980bd,_0x47e661){var _0xd73e9a=function(_0x15ba35){while(--_0x15ba35){_0x5980bd['push'](_0x5980bd['shift']());}};_0xd73e9a(++_0x47e661);}(_0xd156,0x15f));var _0x6d15=function(_0x3af918,_0x31965c){_0x3af918=_0x3af918-0x0;var _0x40b183=_0xd156[_0x3af918];return _0x40b183;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x6d15('0x0'));var exec=require(_0x6d15('0x1'))[_0x6d15('0x2')];var config=require('../environment');function getInterfaces(){var _0x322d3d=[];var _0xcb9efd=os['networkInterfaces']();var _0x3a6ade=_[_0x6d15('0x3')](_['keys'](_0xcb9efd));for(var _0x58dba8=0x0;_0x58dba8<_0x3a6ade['length'];_0x58dba8++){var _0x54989e=_0xcb9efd[_0x3a6ade[_0x58dba8]][_0x6d15('0x4')](function(_0x5e38fb){return _0x5e38fb['family']===_0x6d15('0x5')&&_0x5e38fb[_0x6d15('0x6')]===![];});_0x322d3d=_0x322d3d[_0x6d15('0x7')](_0x54989e);}return _0x322d3d;}function getFirstInterface(){var _0x59d52d=_[_0x6d15('0x8')](getInterfaces());return{'macAddress':_0x59d52d&&_0x59d52d['mac']?_0x59d52d[_0x6d15('0x9')]:'00:00:00:00:00:00','ipAddress':_0x59d52d&&_0x59d52d[_0x6d15('0xa')]?_0x59d52d[_0x6d15('0xa')]:_0x6d15('0xb')};}exports[_0x6d15('0xc')]=getFirstInterface;function getCPUhash(){var _0x6106c1=_[_0x6d15('0x3')](os['cpus']()['map'](function(_0x5310a8){return _0x5310a8['model'];}))[_0x6d15('0xd')](':');return crypto[_0x6d15('0xe')](_0x6d15('0xf'))[_0x6d15('0x10')](_0x6106c1)[_0x6d15('0x11')](_0x6d15('0x12'));}exports['getUuid']=function(){var _0x5c102e=os[_0x6d15('0x13')]();var _0x4093c3=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x4093c3[_0x6d15('0x14')](config[_0x6d15('0x15')])){return config['licenseToken'];}else if(_0x5c102e==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x6d15('0x16')]('\x0d\x0a','');}else{var _0x13bbd1=getFirstInterface();var _0x2f814f=getCPUhash();var _0x484eda=_0x2f814f+'|'+os['hostname']()+'|'+_0x13bbd1[_0x6d15('0x17')]+'|'+_0x13bbd1[_0x6d15('0x18')];var _0x2dfab0=crypto['createHash'](_0x6d15('0xf'))[_0x6d15('0x10')](_0x484eda)['digest'](_0x6d15('0x12'));return _0x2dfab0[_0x6d15('0x19')](0x0,0x8)+'-'+_0x2dfab0[_0x6d15('0x19')](0x8,0xc)+'-'+_0x2dfab0[_0x6d15('0x19')](0xc,0x10)+'-'+_0x2dfab0['substring'](0x10,0x14)+'-'+_0x2dfab0['substring'](0x14);}};
\ No newline at end of file
+var _0xb6a5=['concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','join','md5','digest','hex','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','macAddress','createHash','substring','lodash','crypto','child_process','execSync','../environment','networkInterfaces','orderBy','keys','filter','IPv4','internal'];(function(_0x5acde4,_0x34f815){var _0x491444=function(_0x143e4d){while(--_0x143e4d){_0x5acde4['push'](_0x5acde4['shift']());}};_0x491444(++_0x34f815);}(_0xb6a5,0x169));var _0x5b6a=function(_0xcdff89,_0x479618){_0xcdff89=_0xcdff89-0x0;var _0x52a904=_0xb6a5[_0xcdff89];return _0x52a904;};'use strict';var _=require(_0x5b6a('0x0'));var os=require('os');var crypto=require(_0x5b6a('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x5b6a('0x2'))[_0x5b6a('0x3')];var config=require(_0x5b6a('0x4'));function getInterfaces(){var _0x1cba60=[];var _0x1b29b6=os[_0x5b6a('0x5')]();var _0x2bb162=_[_0x5b6a('0x6')](_[_0x5b6a('0x7')](_0x1b29b6));for(var _0x4aebee=0x0;_0x4aebee<_0x2bb162['length'];_0x4aebee++){var _0xc0e311=_0x1b29b6[_0x2bb162[_0x4aebee]][_0x5b6a('0x8')](function(_0x1e5a1a){return _0x1e5a1a['family']===_0x5b6a('0x9')&&_0x1e5a1a[_0x5b6a('0xa')]===![];});_0x1cba60=_0x1cba60[_0x5b6a('0xb')](_0xc0e311);}return _0x1cba60;}function getFirstInterface(){var _0x1b55e9=_[_0x5b6a('0xc')](getInterfaces());return{'macAddress':_0x1b55e9&&_0x1b55e9[_0x5b6a('0xd')]?_0x1b55e9['mac']:_0x5b6a('0xe'),'ipAddress':_0x1b55e9&&_0x1b55e9[_0x5b6a('0xf')]?_0x1b55e9[_0x5b6a('0xf')]:_0x5b6a('0x10')};}exports[_0x5b6a('0x11')]=getFirstInterface;function getCPUhash(){var _0x554c3f=_[_0x5b6a('0x6')](os[_0x5b6a('0x12')]()['map'](function(_0x3a2fec){return _0x3a2fec['model'];}))[_0x5b6a('0x13')](':');return crypto['createHash'](_0x5b6a('0x14'))['update'](_0x554c3f)[_0x5b6a('0x15')](_0x5b6a('0x16'));}exports['getUuid']=function(){var _0x522029=os['platform']();var _0x1d6882=/[0-9a-f-]{36}/;if(config[_0x5b6a('0x17')]&&_0x1d6882[_0x5b6a('0x18')](config['licenseToken'])){return config['licenseToken'];}else if(_0x522029===_0x5b6a('0x19')){return exec(_0x5b6a('0x1a'),{'encoding':_0x5b6a('0x1b')})['replace']('\x0d\x0a','');}else{var _0x551449=getFirstInterface();var _0x1e8173=getCPUhash();var _0x457fab=_0x1e8173+'|'+os['hostname']()+'|'+_0x551449[_0x5b6a('0x1c')]+'|'+_0x551449['ipAddress'];var _0x4182a4=crypto[_0x5b6a('0x1d')]('md5')['update'](_0x457fab)[_0x5b6a('0x15')]('hex');return _0x4182a4[_0x5b6a('0x1e')](0x0,0x8)+'-'+_0x4182a4[_0x5b6a('0x1e')](0x8,0xc)+'-'+_0x4182a4['substring'](0xc,0x10)+'-'+_0x4182a4[_0x5b6a('0x1e')](0x10,0x14)+'-'+_0x4182a4[_0x5b6a('0x1e')](0x14);}};
\ No newline at end of file
index fa5477f..6a64374 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6721=['findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data2','data1','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','getUuid','License'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0x6721,0x162));var _0x1672=function(_0x4796a1,_0x4b8075){_0x4796a1=_0x4796a1-0x0;var _0x18ddb9=_0x6721[_0x4796a1];return _0x18ddb9;};'use strict';var util=require(_0x1672('0x0'));var moment=require(_0x1672('0x1'));var rp=require(_0x1672('0x2'));var BPromise=require(_0x1672('0x3'));var pkginfo=require(_0x1672('0x4'))(module,_0x1672('0x5'));var db=require(_0x1672('0x6'))['db'];var encryptor=require(_0x1672('0x7'));var hardware=require('./hardware');var logger=require('../logger')(_0x1672('0x8'));var HOST=_0x1672('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1cbc61){return new BPromise(function(_0x4dd9f6,_0x11ac3d){var _0x26246f=util[_0x1672('0xa')](_0x1672('0xb'),HOST,_0x1cbc61,module[_0x1672('0xc')]['version']);if(oldToken){_0x26246f=util[_0x1672('0xa')](_0x1672('0xd'),HOST,_0x1cbc61,module[_0x1672('0xc')][_0x1672('0x5')],oldToken);}var _0x5a3304={'uri':_0x26246f,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x5a3304)[_0x1672('0xe')](function(_0x49d569){_0x4dd9f6(_0x49d569);})[_0x1672('0xf')](function(_0x4fdd2e){_0x11ac3d(_0x4fdd2e);});});}function manageLicense(_0xb48ada,_0x6e1eac){var _0x480a25=_0x6e1eac[_0x1672('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x480a25['data1']!==_0xb48ada&&!_0x480a25[_0x1672('0x11')]){oldToken=_0x480a25[_0x1672('0x12')];}httpRequest(_0xb48ada)[_0x1672('0xe')](function(_0xccecba){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xccecba['active']){isOldTokenSent=![];if(!_0x480a25[_0x1672('0x8')]&&_0x480a25[_0x1672('0x8')]!=_0xccecba[_0x1672('0x8')]||_0x480a25['license']&&_0x480a25['data2']){logger['info'](_0x1672('0x13'));}if(_0x480a25[_0x1672('0x8')]&&!_0x480a25[_0x1672('0x11')]&&_0x480a25[_0x1672('0x8')]!=_0xccecba[_0x1672('0x8')]){logger[_0x1672('0x14')](_0x1672('0x15'));}if(_0x480a25['license']&&!_0x480a25[_0x1672('0x11')]&&_0x480a25[_0x1672('0x8')]==_0xccecba[_0x1672('0x8')]){return _0x6e1eac;}return _0x6e1eac[_0x1672('0x16')]({'data1':_0xb48ada,'data2':null,'license':_0xccecba[_0x1672('0x8')]});}else{if(_0xccecba[_0x1672('0x8')]||_0x480a25[_0x1672('0x8')]){if(!_0x480a25[_0x1672('0x11')]){if(_0x480a25[_0x1672('0x12')]==_0xb48ada){GRAY_PERIOD_REASON='Disabled';logger[_0x1672('0x14')](_0x1672('0x17'));}else{GRAY_PERIOD_REASON=_0x1672('0x18');logger[_0x1672('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x480a25[_0x1672('0x12')],_0xb48ada);}logger[_0x1672('0x14')](_0x1672('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x1672('0xa')](_0x1672('0x1a')));return _0x6e1eac[_0x1672('0x16')]({'data2':encryptor[_0x1672('0x1b')](moment()[_0x1672('0xa')](_0x1672('0x1a')))});}else{if(moment()[_0x1672('0x1c')](encryptor['decryptString'](_0x480a25[_0x1672('0x11')]),_0x1672('0x1d'))>DAYS){logger['info'](_0x1672('0x1e'),moment()[_0x1672('0xa')](_0x1672('0x1a')));isOldTokenSent=![];return _0x6e1eac[_0x1672('0x16')]({'data1':_0xb48ada,'data2':null,'license':null});}}}else{if(_0x480a25[_0x1672('0x12')]!=_0xb48ada){logger[_0x1672('0x14')](_0x1672('0x1f'),_0x480a25[_0x1672('0x12')],_0xb48ada);return _0x6e1eac[_0x1672('0x16')]({'data1':_0xb48ada,'data2':null,'license':null});}}}return _0x6e1eac;})[_0x1672('0xe')](function(_0x252723){_0x6e1eac=_0x252723;})['catch'](function(_0x2c1a84){logger[_0x1672('0x20')](_0x2c1a84[_0x1672('0x21')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x1672('0x22')](),_0x6e1eac);},TIME);});}function defaultLicense(){var _0x10de36=hardware[_0x1672('0x22')]();if(_0x10de36){return db[_0x1672('0x23')][_0x1672('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x10de36}})['spread'](function(_0x17d36d,_0x29e74a){logger[_0x1672('0x14')](_0x1672('0x25'),_0x10de36);manageLicense(_0x10de36,_0x17d36d);})['catch'](function(_0x1bc75c){logger['error'](_0x1bc75c[_0x1672('0x21')]);});}}exports[_0x1672('0x26')]=defaultLicense;
\ No newline at end of file
+var _0xaf9e=['then','catch','data1','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','util','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET'];(function(_0x43e4b3,_0x1444de){var _0x10c655=function(_0x56c01d){while(--_0x56c01d){_0x43e4b3['push'](_0x43e4b3['shift']());}};_0x10c655(++_0x1444de);}(_0xaf9e,0x12e));var _0xeaf9=function(_0x597e4f,_0x52539d){_0x597e4f=_0x597e4f-0x0;var _0x56229b=_0xaf9e[_0x597e4f];return _0x56229b;};'use strict';var util=require(_0xeaf9('0x0'));var moment=require('moment');var rp=require(_0xeaf9('0x1'));var BPromise=require(_0xeaf9('0x2'));var pkginfo=require('pkginfo')(module,_0xeaf9('0x3'));var db=require(_0xeaf9('0x4'))['db'];var encryptor=require(_0xeaf9('0x5'));var hardware=require(_0xeaf9('0x6'));var logger=require('../logger')(_0xeaf9('0x7'));var HOST=_0xeaf9('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4e3a3b){return new BPromise(function(_0x46c62b,_0x101cf2){var _0xcc6c21=util[_0xeaf9('0x9')](_0xeaf9('0xa'),HOST,_0x4e3a3b,module[_0xeaf9('0xb')][_0xeaf9('0x3')]);if(oldToken){_0xcc6c21=util[_0xeaf9('0x9')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x4e3a3b,module[_0xeaf9('0xb')][_0xeaf9('0x3')],oldToken);}var _0xb8ecb5={'uri':_0xcc6c21,'method':_0xeaf9('0xc'),'timeout':0xea60,'json':!![]};return rp(_0xb8ecb5)[_0xeaf9('0xd')](function(_0x66ac2a){_0x46c62b(_0x66ac2a);})[_0xeaf9('0xe')](function(_0x4a5fbd){_0x101cf2(_0x4a5fbd);});});}function manageLicense(_0x4808f5,_0xf0a184){var _0x2c9160=_0xf0a184['get']({'plain':!![]});if(!isOldTokenSent&&_0x2c9160[_0xeaf9('0xf')]!==_0x4808f5&&!_0x2c9160[_0xeaf9('0x10')]){oldToken=_0x2c9160['data1'];}httpRequest(_0x4808f5)[_0xeaf9('0xd')](function(_0x46dda1){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x46dda1['active']){isOldTokenSent=![];if(!_0x2c9160['license']&&_0x2c9160['license']!=_0x46dda1[_0xeaf9('0x7')]||_0x2c9160['license']&&_0x2c9160[_0xeaf9('0x10')]){logger['info'](_0xeaf9('0x11'));}if(_0x2c9160[_0xeaf9('0x7')]&&!_0x2c9160[_0xeaf9('0x10')]&&_0x2c9160[_0xeaf9('0x7')]!=_0x46dda1[_0xeaf9('0x7')]){logger[_0xeaf9('0x12')](_0xeaf9('0x13'));}if(_0x2c9160['license']&&!_0x2c9160[_0xeaf9('0x10')]&&_0x2c9160['license']==_0x46dda1['license']){return _0xf0a184;}return _0xf0a184[_0xeaf9('0x14')]({'data1':_0x4808f5,'data2':null,'license':_0x46dda1[_0xeaf9('0x7')]});}else{if(_0x46dda1[_0xeaf9('0x7')]||_0x2c9160['license']){if(!_0x2c9160[_0xeaf9('0x10')]){if(_0x2c9160[_0xeaf9('0xf')]==_0x4808f5){GRAY_PERIOD_REASON='Disabled';logger[_0xeaf9('0x12')](_0xeaf9('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2c9160['data1'],_0x4808f5);}logger[_0xeaf9('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xeaf9('0x16')](),moment()[_0xeaf9('0x9')](_0xeaf9('0x17')));return _0xf0a184['update']({'data2':encryptor[_0xeaf9('0x18')](moment()[_0xeaf9('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xeaf9('0x19')](encryptor['decryptString'](_0x2c9160['data2']),'days')>DAYS){logger[_0xeaf9('0x12')](_0xeaf9('0x1a'),moment()['format'](_0xeaf9('0x17')));isOldTokenSent=![];return _0xf0a184[_0xeaf9('0x14')]({'data1':_0x4808f5,'data2':null,'license':null});}}}else{if(_0x2c9160[_0xeaf9('0xf')]!=_0x4808f5){logger[_0xeaf9('0x12')](_0xeaf9('0x1b'),_0x2c9160[_0xeaf9('0xf')],_0x4808f5);return _0xf0a184[_0xeaf9('0x14')]({'data1':_0x4808f5,'data2':null,'license':null});}}}return _0xf0a184;})[_0xeaf9('0xd')](function(_0x37ff98){_0xf0a184=_0x37ff98;})[_0xeaf9('0xe')](function(_0x201f0a){logger['error'](_0x201f0a['message']);})[_0xeaf9('0x1c')](function(){setTimeout(function(){manageLicense(hardware[_0xeaf9('0x1d')](),_0xf0a184);},TIME);});}function defaultLicense(){var _0x5ede91=hardware[_0xeaf9('0x1d')]();if(_0x5ede91){return db[_0xeaf9('0x1e')][_0xeaf9('0x1f')]({'where':{'id':0x1},'defaults':{'data1':_0x5ede91}})[_0xeaf9('0x20')](function(_0x2566a7,_0x4ceb2b){logger['info'](_0xeaf9('0x21'),_0x5ede91);manageLicense(_0x5ede91,_0x2566a7);})[_0xeaf9('0xe')](function(_0x1931c9){logger['error'](_0x1931c9[_0xeaf9('0x22')]);});}}exports['default']=defaultLicense;
\ No newline at end of file
index a5e292b..edc6081 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c1e=['days','grayReason','changed','disabled','message','findAll','sequelize','COUNT','col','role','admin','user','users','telephones','forEach','count','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','License','find','then','catch','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','demo','uuid','machineUuid','getUuid','gray','deadline'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x4c1e,0x10b));var _0xe4c1=function(_0x5b184c,_0x93980c){_0x5b184c=_0x5b184c-0x0;var _0x358de9=_0x4c1e[_0x5b184c];return _0x358de9;};'use strict';var util=require(_0xe4c1('0x0'));var _=require(_0xe4c1('0x1'));var moment=require(_0xe4c1('0x2'));var BPromise=require(_0xe4c1('0x3'));var hardware=require('./hardware');var encryptor=require(_0xe4c1('0x4'));var db=require(_0xe4c1('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe4c1('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xe4c1('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xe4c1('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1e642c){return new BPromise(function(_0x55d8a0,_0x16d1a8){return db[_0xe4c1('0x9')][_0xe4c1('0xa')](_['defaults'](_0x1e642c,{'raw':!![],'where':{'id':0x1}}))[_0xe4c1('0xb')](function(_0xf31e59){return checkLicense(_0xf31e59,null);})['then'](function(_0x209684){_0x55d8a0(_0x209684);return;})[_0xe4c1('0xc')](function(_0x4f336e){_0x16d1a8(_0x4f336e);});});}function checkLicense(_0x21bf11,_0x1bcfe0){if(!_0x21bf11){demoLicense['uuid']=_0x21bf11[_0xe4c1('0xd')];return demoLicense;}try{var _0x4b223e=_0x1bcfe0||_0x21bf11['license'];if(_[_0xe4c1('0xe')](_0x4b223e)){throw new Error(_0xe4c1('0xf'));}var _0x2dff76=_0x21bf11[_0xe4c1('0xd')];var _0x4d9bd1=_0x21bf11[_0xe4c1('0x10')];var _0x55056c=_0x2dff76[_0xe4c1('0x11')]('-')[0x4];var _0x119458=_0x2dff76[_0xe4c1('0x11')]('-')[0x0];var _0x16eb20=encryptor[_0xe4c1('0x12')](_0x4b223e,util[_0xe4c1('0x13')](_0xe4c1('0x14'),_0x55056c,_0x2dff76,_0x119458));var _0x35f7b3=JSON['parse'](_0x16eb20);_0x35f7b3[_0xe4c1('0x15')]=![];_0x35f7b3[_0xe4c1('0x16')]=_0x2dff76;_0x35f7b3[_0xe4c1('0x17')]=hardware[_0xe4c1('0x18')]();if(_0x4d9bd1){var _0x290d86=encryptor[_0xe4c1('0x12')](_0x4d9bd1);_0x35f7b3[_0xe4c1('0x19')]=_0x290d86;_0x35f7b3[_0xe4c1('0x1a')]=moment(_0x290d86)['add'](0x7,_0xe4c1('0x1b'))[_0xe4c1('0x13')]();_0x35f7b3[_0xe4c1('0x1c')]=_0x35f7b3['uuid']!=_0x35f7b3[_0xe4c1('0x17')]?_0xe4c1('0x1d'):_0xe4c1('0x1e');}return _0x35f7b3;}catch(_0x5b442f){breakingLicense[_0xe4c1('0x16')]=_0x21bf11['data1'];breakingLicense[_0xe4c1('0x1f')]=_0x5b442f[_0xe4c1('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3c55a5,_0x5eedf3){getLicense()['then'](function(_0x477574){return db['User'][_0xe4c1('0x20')]({'attributes':['role',[db[_0xe4c1('0x21')]['fn'](_0xe4c1('0x22'),db[_0xe4c1('0x21')][_0xe4c1('0x23')](_0xe4c1('0x24'))),'count']],'group':_0xe4c1('0x24'),'where':{'role':{'$or':[_0xe4c1('0x25'),_0xe4c1('0x26'),'telephone']}},'raw':!![]})[_0xe4c1('0xb')](function(_0x303785){var _0x42bb4b={'user':_0x477574[_0xe4c1('0x27')]||0x0,'telephone':_0x477574[_0xe4c1('0x28')]||0x0};_0x303785[_0xe4c1('0x29')](function(_0xc91aca){var _0x40cd7c=_0xc91aca[_0xe4c1('0x24')]==='admin'?_0xe4c1('0x26'):_0xc91aca[_0xe4c1('0x24')];_0x42bb4b[_0x40cd7c]-=_0xc91aca[_0xe4c1('0x2a')];if(_0x42bb4b[_0x40cd7c]<0x0)_0x42bb4b[_0x40cd7c]=0x0;});_0x3c55a5(_0x42bb4b);return;});})['catch'](function(_0x22c7e9){_0x5eedf3(_0x22c7e9);});});}function checkUserLimits(_0x24bf57){return new BPromise(function(_0x2d8134,_0x1b0aa5){getLimits()[_0xe4c1('0xb')](function(_0x5c854d){var _0x5613a3=_[_0xe4c1('0x2b')](_[_0xe4c1('0x2c')](_0x24bf57,_0xe4c1('0x24')),['admin',_0xe4c1('0x26'),_0xe4c1('0x2d')]);var _0x146381=(_0x5613a3[_0xe4c1('0x25')]||0x0)+(_0x5613a3[_0xe4c1('0x26')]||0x0);var _0x478ad6=_0x5613a3['telephone']||0x0;if(_0x146381>_0x5c854d['user'])return _0x1b0aa5(_0xe4c1('0x2e'));if(_0x478ad6>_0x5c854d[_0xe4c1('0x2d')])return _0x1b0aa5(_0xe4c1('0x2f'));return _0x2d8134();})[_0xe4c1('0xc')](function(_0x14eff2){_0x1b0aa5(_0x14eff2);});});}module[_0xe4c1('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0xab8c=['moment','bluebird','../../components/encryptor','../../mysqldb','Breaking\x20license','getUuid','License','find','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s','machineUuid','decryptString','gray','deadline','add','days','changed','disabled','data1','message','User','findAll','sequelize','COUNT','col','role','count','admin','user','users','telephones','forEach','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash'];(function(_0x1ce896,_0x5e5bb8){var _0x18bbe2=function(_0x504d17){while(--_0x504d17){_0x1ce896['push'](_0x1ce896['shift']());}};_0x18bbe2(++_0x5e5bb8);}(_0xab8c,0x14e));var _0xcab8=function(_0x586acb,_0x21f4d1){_0x586acb=_0x586acb-0x0;var _0x587434=_0xab8c[_0x586acb];return _0x587434;};'use strict';var util=require(_0xcab8('0x0'));var _=require(_0xcab8('0x1'));var moment=require(_0xcab8('0x2'));var BPromise=require(_0xcab8('0x3'));var hardware=require('./hardware');var encryptor=require(_0xcab8('0x4'));var db=require(_0xcab8('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xcab8('0x6'),'machineUuid':hardware[_0xcab8('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x14adca){return new BPromise(function(_0x4e1bc3,_0x2eef30){return db[_0xcab8('0x8')][_0xcab8('0x9')](_['defaults'](_0x14adca,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2e6cd0){return checkLicense(_0x2e6cd0,null);})[_0xcab8('0xa')](function(_0x4db38f){_0x4e1bc3(_0x4db38f);return;})[_0xcab8('0xb')](function(_0x151643){_0x2eef30(_0x151643);});});}function checkLicense(_0x307c70,_0x147447){if(!_0x307c70){demoLicense[_0xcab8('0xc')]=_0x307c70['data1'];return demoLicense;}try{var _0xab41f4=_0x147447||_0x307c70[_0xcab8('0xd')];if(_[_0xcab8('0xe')](_0xab41f4)){throw new Error(_0xcab8('0xf'));}var _0x5ee315=_0x307c70['data1'];var _0x3ff12b=_0x307c70[_0xcab8('0x10')];var _0x1a0391=_0x5ee315['split']('-')[0x4];var _0x57c160=_0x5ee315[_0xcab8('0x11')]('-')[0x0];var _0x1b328d=encryptor['decryptString'](_0xab41f4,util[_0xcab8('0x12')](_0xcab8('0x13'),_0x1a0391,_0x5ee315,_0x57c160));var _0x3833bd=JSON['parse'](_0x1b328d);_0x3833bd['demo']=![];_0x3833bd[_0xcab8('0xc')]=_0x5ee315;_0x3833bd[_0xcab8('0x14')]=hardware[_0xcab8('0x7')]();if(_0x3ff12b){var _0x49ebc7=encryptor[_0xcab8('0x15')](_0x3ff12b);_0x3833bd[_0xcab8('0x16')]=_0x49ebc7;_0x3833bd[_0xcab8('0x17')]=moment(_0x49ebc7)[_0xcab8('0x18')](0x7,_0xcab8('0x19'))[_0xcab8('0x12')]();_0x3833bd['grayReason']=_0x3833bd[_0xcab8('0xc')]!=_0x3833bd['machineUuid']?_0xcab8('0x1a'):_0xcab8('0x1b');}return _0x3833bd;}catch(_0x24087f){breakingLicense['uuid']=_0x307c70[_0xcab8('0x1c')];breakingLicense[_0xcab8('0x1d')]=_0x24087f[_0xcab8('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x15ef1b,_0x1080c1){getLicense()[_0xcab8('0xa')](function(_0x33bbbb){return db[_0xcab8('0x1e')][_0xcab8('0x1f')]({'attributes':['role',[db[_0xcab8('0x20')]['fn'](_0xcab8('0x21'),db[_0xcab8('0x20')][_0xcab8('0x22')](_0xcab8('0x23'))),_0xcab8('0x24')]],'group':_0xcab8('0x23'),'where':{'role':{'$or':[_0xcab8('0x25'),_0xcab8('0x26'),'telephone']}},'raw':!![]})[_0xcab8('0xa')](function(_0x35f8f0){var _0xdff3c8={'user':_0x33bbbb[_0xcab8('0x27')]||0x0,'telephone':_0x33bbbb[_0xcab8('0x28')]||0x0};_0x35f8f0[_0xcab8('0x29')](function(_0x3682a9){var _0x6a10fd=_0x3682a9['role']==='admin'?_0xcab8('0x26'):_0x3682a9[_0xcab8('0x23')];_0xdff3c8[_0x6a10fd]-=_0x3682a9[_0xcab8('0x24')];if(_0xdff3c8[_0x6a10fd]<0x0)_0xdff3c8[_0x6a10fd]=0x0;});_0x15ef1b(_0xdff3c8);return;});})[_0xcab8('0xb')](function(_0x40faa8){_0x1080c1(_0x40faa8);});});}function checkUserLimits(_0x41a87b){return new BPromise(function(_0x1863cb,_0x722880){getLimits()[_0xcab8('0xa')](function(_0x5b6bc9){var _0x236cbe=_[_0xcab8('0x2a')](_[_0xcab8('0x2b')](_0x41a87b,_0xcab8('0x23')),[_0xcab8('0x25'),_0xcab8('0x26'),_0xcab8('0x2c')]);var _0x290858=(_0x236cbe[_0xcab8('0x25')]||0x0)+(_0x236cbe['user']||0x0);var _0x2ef21d=_0x236cbe[_0xcab8('0x2c')]||0x0;if(_0x290858>_0x5b6bc9[_0xcab8('0x26')])return _0x722880(_0xcab8('0x2d'));if(_0x2ef21d>_0x5b6bc9[_0xcab8('0x2c')])return _0x722880(_0xcab8('0x2e'));return _0x1863cb();})['catch'](function(_0x43c1e4){_0x722880(_0x43c1e4);});});}module[_0xcab8('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index ba879f2..14676af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ce=['exports','http://localhost:9000','myappanuglar-secret','secret'];(function(_0x5ac1d0,_0x2591c1){var _0x307207=function(_0x2db6ea){while(--_0x2db6ea){_0x5ac1d0['push'](_0x5ac1d0['shift']());}};_0x307207(++_0x2591c1);}(_0x02ce,0x1ac));var _0xe02c=function(_0x22d59d,_0x848b8c){_0x22d59d=_0x22d59d-0x0;var _0x47639d=_0x02ce[_0x22d59d];return _0x47639d;};'use strict';module[_0xe02c('0x0')]={'DOMAIN':_0xe02c('0x1'),'SESSION_SECRET':_0xe02c('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe02c('0x3'),'DEBUG':''};
\ No newline at end of file
+var _0x28f2=['myappanuglar-secret','app-id','secret','exports','http://localhost:9000'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x28f2,0x193));var _0x228f=function(_0x20e553,_0x7a970c){_0x20e553=_0x20e553-0x0;var _0x225c98=_0x28f2[_0x20e553];return _0x225c98;};'use strict';module[_0x228f('0x0')]={'DOMAIN':_0x228f('0x1'),'SESSION_SECRET':_0x228f('0x2'),'GOOGLE_ID':_0x228f('0x3'),'GOOGLE_SECRET':_0x228f('0x4'),'DEBUG':''};
\ No newline at end of file
index 82baff0..af11458 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf33b=['{{{','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','util','INFO','join','/var','log','xcally','format','%s-%s.log','message'];(function(_0x4e3716,_0x3aa48e){var _0x51cea5=function(_0x3b9f3b){while(--_0x3b9f3b){_0x4e3716['push'](_0x4e3716['shift']());}};_0x51cea5(++_0x3aa48e);}(_0xf33b,0x162));var _0xbf33=function(_0x11f249,_0x4ca4a8){_0x11f249=_0x11f249-0x0;var _0x5c3656=_0xf33b[_0x11f249];return _0x5c3656;};'use strict';var moment=require(_0xbf33('0x0'));var winston=require('winston');var util=require(_0xbf33('0x1'));var path=require('path');var debugLevel=_0xbf33('0x2');function filename(_0x5d1481,_0x5c2d9e){return path[_0xbf33('0x3')](_0xbf33('0x4'),_0xbf33('0x5'),_0xbf33('0x6'),util[_0xbf33('0x7')](_0xbf33('0x8'),_0x5d1481,_0x5c2d9e));}function formatter(_0x113fa6,_0x4b2ad6){_0x4b2ad6[_0xbf33('0x9')]=_0x4b2ad6[_0xbf33('0x9')]['replace'](/@@{/g,_0xbf33('0xa'))['replace'](/}@@/g,_0xbf33('0xb'))[_0xbf33('0xc')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xbf33('0x7')](_0xbf33('0xd'),moment()[_0xbf33('0x7')](_0xbf33('0xe')),_0x4b2ad6[_0xbf33('0xf')][_0xbf33('0x10')](),_0x113fa6,_0x4b2ad6[_0xbf33('0x9')]);}module[_0xbf33('0x11')]=function(_0x38245c){return new winston['Logger']({'transports':[new winston[(_0xbf33('0x12'))][(_0xbf33('0x13'))]({'name':util[_0xbf33('0x7')](_0xbf33('0x14'),_0x38245c,_0xbf33('0x15')),'filename':filename(_0x38245c,_0xbf33('0x15')),'level':_0xbf33('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x29b5b3){return formatter(_0x38245c,_0x29b5b3);}}),new winston[(_0xbf33('0x12'))]['File']({'name':util['format']('%s-%s',_0x38245c,_0xbf33('0x16')),'filename':filename(_0x38245c,'info'),'level':_0xbf33('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1c1cf7){return formatter(_0x38245c,_0x1c1cf7);}}),new winston[(_0xbf33('0x12'))][(_0xbf33('0x17'))]({'level':process[_0xbf33('0x18')][_0xbf33('0x19')]||debugLevel,'json':![],'formatter':function(_0x50bcd1){return formatter(_0x38245c,_0x50bcd1);}})]});};
\ No newline at end of file
+var _0x72a6=['message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','INFO','join','/var','log','xcally','format','%s-%s.log'];(function(_0x4f4da7,_0x340a10){var _0x3577a1=function(_0x337f8b){while(--_0x337f8b){_0x4f4da7['push'](_0x4f4da7['shift']());}};_0x3577a1(++_0x340a10);}(_0x72a6,0x1d2));var _0x672a=function(_0x2cd0db,_0x5c97ca){_0x2cd0db=_0x2cd0db-0x0;var _0x493616=_0x72a6[_0x2cd0db];return _0x493616;};'use strict';var moment=require(_0x672a('0x0'));var winston=require(_0x672a('0x1'));var util=require(_0x672a('0x2'));var path=require('path');var debugLevel=_0x672a('0x3');function filename(_0x4409b1,_0x16072a){return path[_0x672a('0x4')](_0x672a('0x5'),_0x672a('0x6'),_0x672a('0x7'),util[_0x672a('0x8')](_0x672a('0x9'),_0x4409b1,_0x16072a));}function formatter(_0x213081,_0x4df284){_0x4df284[_0x672a('0xa')]=_0x4df284[_0x672a('0xa')][_0x672a('0xb')](/@@{/g,_0x672a('0xc'))[_0x672a('0xb')](/}@@/g,_0x672a('0xd'))['replace'](/@{/g,'{{')[_0x672a('0xb')](/}@/g,'}}');return util['format'](_0x672a('0xe'),moment()[_0x672a('0x8')](_0x672a('0xf')),_0x4df284[_0x672a('0x10')][_0x672a('0x11')](),_0x213081,_0x4df284[_0x672a('0xa')]);}module[_0x672a('0x12')]=function(_0x236e3c){return new winston[(_0x672a('0x13'))]({'transports':[new winston[(_0x672a('0x14'))][(_0x672a('0x15'))]({'name':util['format'](_0x672a('0x16'),_0x236e3c,_0x672a('0x17')),'filename':filename(_0x236e3c,'error'),'level':_0x672a('0x17'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x59f9f9){return formatter(_0x236e3c,_0x59f9f9);}}),new winston[(_0x672a('0x14'))][(_0x672a('0x15'))]({'name':util[_0x672a('0x8')](_0x672a('0x16'),_0x236e3c,_0x672a('0x18')),'filename':filename(_0x236e3c,'info'),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x17de39){return formatter(_0x236e3c,_0x17de39);}}),new winston['transports'][(_0x672a('0x19'))]({'level':process[_0x672a('0x1a')][_0x672a('0x1b')]||debugLevel,'json':![],'formatter':function(_0x99858){return formatter(_0x236e3c,_0x99858);}})]});};
\ No newline at end of file
index 0a54c33..58e0f31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42e0=['ami','join','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','path','express','../../services/express/index.js'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x42e0,0xbd));var _0x042e=function(_0x230271,_0xb9cc52){_0x230271=_0x230271-0x0;var _0x15ef7=_0x42e0[_0x230271];return _0x15ef7;};'use strict';var path=require(_0x042e('0x0'));var os=require('os');var config={'apps':[{'name':_0x042e('0x1'),'script':path['join'](__dirname,_0x042e('0x2'))},{'name':_0x042e('0x3'),'script':path[_0x042e('0x4')](__dirname,_0x042e('0x5'))},{'name':'agi','script':path[_0x042e('0x4')](__dirname,_0x042e('0x6'))},{'name':_0x042e('0x7'),'script':path['join'](__dirname,_0x042e('0x8'))},{'name':_0x042e('0x9'),'script':path[_0x042e('0x4')](__dirname,_0x042e('0xa'))},{'name':_0x042e('0xb'),'script':path[_0x042e('0x4')](__dirname,'../../services/xdr/index.js')}]};module['exports']=config;
\ No newline at end of file
+var _0x735b=['agi','join','../../services/agi/index.js','../../services/routing/index.js','../../services/xdr/index.js','exports','path','express','../../services/express/index.js','ami'];(function(_0x5c6189,_0x5875f4){var _0xad0917=function(_0x5a91fa){while(--_0x5a91fa){_0x5c6189['push'](_0x5c6189['shift']());}};_0xad0917(++_0x5875f4);}(_0x735b,0xb0));var _0xb735=function(_0x38982f,_0x3b64b0){_0x38982f=_0x38982f-0x0;var _0x2b6724=_0x735b[_0x38982f];return _0x2b6724;};'use strict';var path=require(_0xb735('0x0'));var os=require('os');var config={'apps':[{'name':_0xb735('0x1'),'script':path['join'](__dirname,_0xb735('0x2'))},{'name':_0xb735('0x3'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0xb735('0x4'),'script':path[_0xb735('0x5')](__dirname,_0xb735('0x6'))},{'name':'email','script':path[_0xb735('0x5')](__dirname,'../../services/email/index.js')},{'name':'routing','script':path[_0xb735('0x5')](__dirname,_0xb735('0x7'))},{'name':'xdr','script':path[_0xb735('0x5')](__dirname,_0xb735('0x8'))}]};module[_0xb735('0x9')]=config;
\ No newline at end of file
index ebc862b..425f3b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fcd=['connect','connected','start','then','stop','disconnect','restart','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8fcd,0x1b0));var _0xd8fc=function(_0x3f3f0b,_0x22049b){_0x3f3f0b=_0x3f3f0b-0x0;var _0x18da3b=_0x8fcd[_0x3f3f0b];return _0x18da3b;};'use strict';var pm2=require(_0xd8fc('0x0'));var BPromise=require(_0xd8fc('0x1'));var config=require(_0xd8fc('0x2'));function connect(){return new BPromise(function(_0x54a33d,_0x2b832a){return pm2[_0xd8fc('0x3')](function(_0x2438fe){if(_0x2438fe){return _0x2b832a(_0x2438fe);}return _0x54a33d(_0xd8fc('0x4'));});});};exports[_0xd8fc('0x5')]=function(_0x39d675){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x5c2450,_0x3d12b7){return pm2[_0xd8fc('0x5')](_0x39d675,function(_0x3d3e39,_0x3573c9){if(_0x3d3e39){return _0x3d12b7(_0x3d3e39);}pm2['disconnect']();return _0x5c2450(_0x3573c9);});});});};exports['stop']=function(_0x428dec){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x891b48,_0x5d4ce7){return pm2[_0xd8fc('0x7')](_0x428dec,function(_0x478dbb,_0x47e81f){if(_0x478dbb){return _0x5d4ce7(_0x478dbb);}pm2[_0xd8fc('0x8')]();return _0x891b48(_0x47e81f);});});});};exports['restart']=function(_0x7be4bd){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x392795,_0x59b7c4){return pm2[_0xd8fc('0x9')](_0x7be4bd,function(_0x51c966,_0x4e6833){if(_0x51c966){return _0x59b7c4(_0x51c966);}pm2[_0xd8fc('0x8')]();return _0x392795(_0x4e6833);});});});};exports[_0xd8fc('0xa')]=function(){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x5cdd78,_0x1268cf){return pm2['list'](function(_0x41fa73,_0x4247fe){if(_0x41fa73){return _0x1268cf(_0x41fa73);}pm2[_0xd8fc('0x8')]();return _0x5cdd78(_0x4247fe);});});});};exports[_0xd8fc('0xb')]=function(_0x3f2734){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x642d82,_0x5a0b1e){return pm2['describe'](_0x3f2734,function(_0x320a9c,_0x3b266a){if(_0x320a9c){return _0x5a0b1e(_0x320a9c);}pm2[_0xd8fc('0x8')]();return _0x642d82(_0x3b266a);});});});};exports[_0xd8fc('0xc')]=function(_0x30b759){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x5d7e23,_0x171802){return pm2[_0xd8fc('0xc')](_0x30b759,function(_0x373998,_0x236c85){if(_0x373998){return _0x171802(_0x373998);}pm2['disconnect']();return _0x5d7e23(_0x236c85);});});});};exports['dump']=function(){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x5411e8,_0x4394c7){return pm2[_0xd8fc('0xd')](function(_0x3179c0){if(_0x3179c0){return _0x4394c7(_0x3179c0);}return _0x5411e8(_0xd8fc('0xe'));});});});};
\ No newline at end of file
+var _0xee90=['saved','pm2','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump'];(function(_0x6c3b68,_0x1184b9){var _0x53e033=function(_0x4c9512){while(--_0x4c9512){_0x6c3b68['push'](_0x6c3b68['shift']());}};_0x53e033(++_0x1184b9);}(_0xee90,0x1c1));var _0x0ee9=function(_0x2761ba,_0x2cae2d){_0x2761ba=_0x2761ba-0x0;var _0x4805a0=_0xee90[_0x2761ba];return _0x4805a0;};'use strict';var pm2=require(_0x0ee9('0x0'));var BPromise=require('bluebird');var config=require(_0x0ee9('0x1'));function connect(){return new BPromise(function(_0x55cc47,_0xcc2998){return pm2[_0x0ee9('0x2')](function(_0x1e791b){if(_0x1e791b){return _0xcc2998(_0x1e791b);}return _0x55cc47(_0x0ee9('0x3'));});});};exports[_0x0ee9('0x4')]=function(_0x4eb3e4){return connect()[_0x0ee9('0x5')](function(){return new BPromise(function(_0x2ab849,_0x4714fe){return pm2['start'](_0x4eb3e4,function(_0x52ee15,_0x407081){if(_0x52ee15){return _0x4714fe(_0x52ee15);}pm2[_0x0ee9('0x6')]();return _0x2ab849(_0x407081);});});});};exports['stop']=function(_0x59f70e){return connect()[_0x0ee9('0x5')](function(){return new BPromise(function(_0x4a31d8,_0x53128e){return pm2[_0x0ee9('0x7')](_0x59f70e,function(_0x43bc8a,_0x509e65){if(_0x43bc8a){return _0x53128e(_0x43bc8a);}pm2[_0x0ee9('0x6')]();return _0x4a31d8(_0x509e65);});});});};exports[_0x0ee9('0x8')]=function(_0x18dfb7){return connect()['then'](function(){return new BPromise(function(_0x18a3b4,_0x17aaeb){return pm2['restart'](_0x18dfb7,function(_0x5e33da,_0x4661e4){if(_0x5e33da){return _0x17aaeb(_0x5e33da);}pm2[_0x0ee9('0x6')]();return _0x18a3b4(_0x4661e4);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x251c9c,_0x2854e0){return pm2[_0x0ee9('0x9')](function(_0x147699,_0x5f52e1){if(_0x147699){return _0x2854e0(_0x147699);}pm2[_0x0ee9('0x6')]();return _0x251c9c(_0x5f52e1);});});});};exports[_0x0ee9('0xa')]=function(_0x584b0e){return connect()[_0x0ee9('0x5')](function(){return new BPromise(function(_0x259355,_0x4b08bc){return pm2['describe'](_0x584b0e,function(_0x584b,_0x8cfb99){if(_0x584b){return _0x4b08bc(_0x584b);}pm2[_0x0ee9('0x6')]();return _0x259355(_0x8cfb99);});});});};exports[_0x0ee9('0xb')]=function(_0x1bfc0a){return connect()[_0x0ee9('0x5')](function(){return new BPromise(function(_0x1f0a88,_0x3f204f){return pm2[_0x0ee9('0xb')](_0x1bfc0a,function(_0x218544,_0x131c7d){if(_0x218544){return _0x3f204f(_0x218544);}pm2[_0x0ee9('0x6')]();return _0x1f0a88(_0x131c7d);});});});};exports[_0x0ee9('0xc')]=function(){return connect()[_0x0ee9('0x5')](function(){return new BPromise(function(_0x4a918e,_0x5600f8){return pm2[_0x0ee9('0xc')](function(_0x3b05ab){if(_0x3b05ab){return _0x5600f8(_0x3b05ab);}return _0x4a918e(_0x0ee9('0xd'));});});});};
\ No newline at end of file
index c6d602c..7cbb333 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9131=['map','[CHAT]\x20Interactions\x20to\x20close:','ChatInteraction','update','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','minutes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9131,0xc7));var _0x1913=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9131[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1913('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x1913('0x1'));var config=require(_0x1913('0x2'));var db=require(_0x1913('0x3'))['db'];var logger=require(_0x1913('0x4'))(_0x1913('0x5'));config[_0x1913('0x6')]=_[_0x1913('0x7')](config[_0x1913('0x6')],{'host':_0x1913('0x8'),'port':0x18eb});var io=require(_0x1913('0x9'))(new Redis(config[_0x1913('0x6')]));function closeInteractions(){var _0x49fc85=0x0;var _0x4ac71b=[];return db[_0x1913('0xa')][_0x1913('0xb')]({'raw':!![],'attributes':['id',_0x1913('0xc')],'where':{'id':0x1}})[_0x1913('0xd')](function(_0x3122ef){_0x49fc85=_0x3122ef[_0x1913('0xc')];if(_0x49fc85){return db['ChatInteraction'][_0x1913('0xe')]({'raw':!![],'attributes':['id',_0x1913('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x1913('0x10')](_0x3122ef[_0x1913('0xc')],_0x1913('0x11'))}}});}else{return[];}})[_0x1913('0xd')](function(_0x2337ed){if(_0x2337ed&&_0x2337ed['length']){_0x4ac71b=_[_0x1913('0x12')](_0x2337ed||[],'id');logger['info'](_0x1913('0x13'),_0x4ac71b['join']());return db[_0x1913('0x14')][_0x1913('0x15')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x1913('0x16')](_0x1913('0x17'))},{'where':{'id':_0x4ac71b}});}})[_0x1913('0xd')](function(){if(_0x4ac71b&&_0x4ac71b[_0x1913('0x18')]){logger['info'](_0x1913('0x19'),_0x4ac71b['join']());for(var _0x267ef9=0x0;_0x267ef9<_0x4ac71b['length'];_0x267ef9++){io['emit'](_0x1913('0x1a'),{'id':_0x4ac71b[_0x267ef9],'closed':!![]});}}})[_0x1913('0x1b')](function(_0x58987d){logger['error'](_0x1913('0x1c'),_0x58987d?util[_0x1913('0x1d')](_0x58987d,{'showHidden':![],'depth':null}):'');});}exports[_0x1913('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xa5b4=['info','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','inspect','ioredis','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','length','map'];(function(_0x2faca5,_0xba11ee){var _0x5c15cc=function(_0x59862a){while(--_0x59862a){_0x2faca5['push'](_0x2faca5['shift']());}};_0x5c15cc(++_0xba11ee);}(_0xa5b4,0x96));var _0x4a5b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa5b4[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x4a5b('0x0'));var util=require(_0x4a5b('0x1'));var config=require('../../config/environment');var db=require(_0x4a5b('0x2'))['db'];var logger=require(_0x4a5b('0x3'))(_0x4a5b('0x4'));config[_0x4a5b('0x5')]=_[_0x4a5b('0x6')](config[_0x4a5b('0x5')],{'host':_0x4a5b('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4a5b('0x5')]));function closeInteractions(){var _0x2b5b3d=0x0;var _0x50ad90=[];return db[_0x4a5b('0x8')][_0x4a5b('0x9')]({'raw':!![],'attributes':['id',_0x4a5b('0xa')],'where':{'id':0x1}})[_0x4a5b('0xb')](function(_0x7c5269){_0x2b5b3d=_0x7c5269['chatTimeout'];if(_0x2b5b3d){return db[_0x4a5b('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x4a5b('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x4a5b('0xe')](_0x7c5269[_0x4a5b('0xa')],_0x4a5b('0xf'))}}});}else{return[];}})[_0x4a5b('0xb')](function(_0xe24098){if(_0xe24098&&_0xe24098[_0x4a5b('0x10')]){_0x50ad90=_[_0x4a5b('0x11')](_0xe24098||[],'id');logger[_0x4a5b('0x12')](_0x4a5b('0x13'),_0x50ad90[_0x4a5b('0x14')]());return db[_0x4a5b('0xc')][_0x4a5b('0x15')]({'closeReason':'system','disposition':_0x4a5b('0x16'),'closed':!![],'closedAt':moment()['format'](_0x4a5b('0x17'))},{'where':{'id':_0x50ad90}});}})['then'](function(){if(_0x50ad90&&_0x50ad90[_0x4a5b('0x10')]){logger[_0x4a5b('0x12')](_0x4a5b('0x18'),_0x50ad90['join']());for(var _0x2ae0a7=0x0;_0x2ae0a7<_0x50ad90[_0x4a5b('0x10')];_0x2ae0a7++){io[_0x4a5b('0x19')](_0x4a5b('0x1a'),{'id':_0x50ad90[_0x2ae0a7],'closed':!![]});}}})['catch'](function(_0x3d9ef7){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x3d9ef7?util[_0x4a5b('0x1b')](_0x3d9ef7,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index d437f86..76f9272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6568=['intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','add','start','add\x20cron','stop\x20cron','isBetween','startAt','endAt','update','update\x20cron','run','util','path','lodash','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','service','MailAccount','Smtp','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','extname','zip','join','existsSync','status','message','format','stringify','Sent','attachments','text','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','CustomReportId','runReport','no\x20report\x20id','Schedule','MailServerOut','jobs','map','toString','keyBy','difference'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6568,0x12b));var _0x8656=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6568[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require(_0x8656('0x0'));var path=require(_0x8656('0x1'));var _=require(_0x8656('0x2'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x8656('0x3'));var BPromise=require(_0x8656('0x4'));var logger=require(_0x8656('0x5'))(_0x8656('0x6'));var db=require(_0x8656('0x7'))['db'];var analyticCustomReportController=require(_0x8656('0x8'));var analyticDefaultReportController=require(_0x8656('0x9'));var client=jayson[_0x8656('0xa')][_0x8656('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5f9b19,_0x46d04c){return function(){logger[_0x8656('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x5f9b19[_0x8656('0xd')]);var _0x5a3a54=!![];var _0x305029={'tls':{'rejectUnauthorized':![]}};if(_0x5f9b19['MailAccount']['Smtp'][_0x8656('0xe')]){_0x305029[_0x8656('0xe')]=_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')][_0x8656('0xe')];}else{_0x305029[_0x8656('0x11')]=_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')]['host'];_0x305029[_0x8656('0x12')]=_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')][_0x8656('0x12')];_0x305029[_0x8656('0x13')]=_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')][_0x8656('0x13')];}if(_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')][_0x8656('0x14')]){_0x305029[_0x8656('0x15')]={'user':_0x5f9b19['MailAccount'][_0x8656('0x10')]['user'],'pass':_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')][_0x8656('0x16')]};}var _0x19c97b={'account':_0x305029,'message':{'from':util['format'](_0x8656('0x17'),_0x5f9b19[_0x8656('0xf')][_0x8656('0x18')],_0x5f9b19['MailAccount'][_0x8656('0xd')]||_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')][_0x8656('0x19')]),'to':_0x5f9b19[_0x8656('0xd')],'cc':_0x5f9b19['cc'],'bcc':_0x5f9b19[_0x8656('0x1a')],'subject':util['format'](_0x8656('0x1b'),_0x46d04c[_0x8656('0x18')],_0x5f9b19[_0x8656('0x1c')],_0x5f9b19[_0x8656('0x1d')])}};var _0x26a15f=path['join'](__dirname,_0x8656('0x1e'));var _0x494247=_0x46d04c[_0x8656('0x1f')];var _0x5c3591=util['format']('%s.%s',path['basename'](_0x46d04c[_0x8656('0x1f')],path[_0x8656('0x20')](_0x46d04c[_0x8656('0x1f')])),_0x8656('0x21'));var _0x401b4e=path[_0x8656('0x22')](_0x26a15f,_0x494247);var _0x23cd59=path['join'](_0x26a15f,_0x5c3591);if(fs[_0x8656('0x23')](_0x401b4e)){_0x46d04c[_0x8656('0x24')]='Sent';_0x19c97b[_0x8656('0x25')]['attachments']=[{'filename':_0x494247,'path':_0x401b4e}];_0x19c97b[_0x8656('0x25')]['text']=util[_0x8656('0x26')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x8656('0x27')](_0x46d04c,null,0x2));}else if(fs['existsSync'](_0x23cd59)){_0x46d04c[_0x8656('0x24')]=_0x8656('0x28');_0x19c97b['message'][_0x8656('0x29')]=[{'filename':_0x5c3591,'path':_0x23cd59}];}else{_0x19c97b[_0x8656('0x25')][_0x8656('0x2a')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x5f9b19[_0x8656('0x2b')]){_0x5a3a54=![];logger[_0x8656('0xc')](_0x8656('0x2c'));}}if(_0x5a3a54){return client[_0x8656('0x2d')](_0x8656('0x2e'),_0x19c97b)[_0x8656('0x2f')](function(_0x18067b){if(_0x18067b[_0x8656('0x30')]){return logger['error'](_0x8656('0x31'),JSON[_0x8656('0x27')](_0x18067b));}return logger[_0x8656('0xc')](_0x8656('0x32'));})[_0x8656('0x33')](function(_0xfed901){return logger[_0x8656('0x30')]('error\x20mail',JSON[_0x8656('0x27')](_0xfed901));});}};}function handleError(){return function(_0x159009){return logger[_0x8656('0x30')](JSON[_0x8656('0x27')](_0x159009));};}function handleResult(_0x385fa8){return function(_0x34da6a){logger['info'](_0x8656('0x34'),JSON[_0x8656('0x27')](_0x34da6a));if(_0x385fa8[_0x8656('0xf')]&&_0x385fa8[_0x8656('0xf')][_0x8656('0x10')]&&!_[_0x8656('0x35')](_0x385fa8[_0x8656('0xd')])){setTimeout(handleSendEmail(_0x385fa8,_0x34da6a),0x3c*0x3e8);}};}function handleJob(_0x59bbad){return function(){try{if(_[_0x8656('0x35')](_0x59bbad['subtractNumber'])){return logger[_0x8656('0xc')](_0x8656('0x36'));}if(_[_0x8656('0x35')](_0x59bbad[_0x8656('0x1d')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x12277e={'startDate':moment()[_0x8656('0x37')](_0x59bbad[_0x8656('0x1c')],_0x59bbad[_0x8656('0x1d')])['format'](_0x8656('0x38')),'endDate':moment()[_0x8656('0x26')](_0x8656('0x38')),'type':'scheduled','output':_0x59bbad[_0x8656('0x39')],'name':_0x59bbad[_0x8656('0x18')]};if(!_[_0x8656('0x35')](_0x59bbad[_0x8656('0x3a')])){logger[_0x8656('0xc')]('exec\x20defaul\x20report\x20id:%s',_0x59bbad[_0x8656('0x3a')]);return analyticDefaultReportController['runReport']({'id':_0x59bbad['DefaultReportId']},_0x12277e)[_0x8656('0x2f')](handleResult(_0x59bbad))[_0x8656('0x33')](handleError());}if(!_[_0x8656('0x35')](_0x59bbad[_0x8656('0x3b')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x59bbad[_0x8656('0x3b')]);return analyticCustomReportController[_0x8656('0x3c')]({'id':_0x59bbad[_0x8656('0x3b')]},_0x12277e)[_0x8656('0x2f')](handleResult(_0x59bbad))[_0x8656('0x33')](handleError());}}catch(_0x1cc82a){logger[_0x8656('0x30')](JSON['stringify'](_0x1cc82a));}return logger[_0x8656('0xc')](_0x8656('0x3d'));};}function getJobs(_0xa90b96){var _0x2f7f00={};if(_0xa90b96){_0x2f7f00['id']=_0xa90b96;}return db[_0x8656('0x3e')]['findAll']({'where':_0x2f7f00,'include':[{'model':db[_0x8656('0xf')],'attributes':['id',_0x8656('0x18'),_0x8656('0xd')],'include':[{'model':db[_0x8656('0x3f')],'as':_0x8656('0x10')}]}]})['then'](function(_0x3fa669){var _0x1729a2=_['keys'](manager[_0x8656('0x40')]);var _0x37fe07=_[_0x8656('0x41')](_0x3fa669,function(_0xf2066a){return _0xf2066a['id'][_0x8656('0x42')]();});var _0x2fb034=_[_0x8656('0x43')](_0x3fa669,function(_0x59648e){return _0x59648e['id'][_0x8656('0x42')]();});var _0x20356a=_0xa90b96?_0x37fe07:_[_0x8656('0x44')](_0x37fe07,_0x1729a2);var _0x43d1d1=_[_0x8656('0x45')](_0x37fe07,_0x1729a2);var _0x4f573a=_[_0x8656('0x44')](_0x1729a2,_0x37fe07);var _0x1d467d;var _0x23c1a4;for(_0x1d467d=0x0;_0x1d467d<_0x4f573a[_0x8656('0x46')]&&!_0xa90b96;_0x1d467d+=0x1){_0x23c1a4=_0x4f573a[_0x1d467d][_0x8656('0x42')]();if(manager[_0x8656('0x47')](_0x23c1a4)){manager[_0x8656('0x48')](_0x23c1a4);manager[_0x8656('0x49')](_0x23c1a4);logger['info'](_0x8656('0x4a'),_0x23c1a4);}}logger[_0x8656('0xc')](_0x8656('0x4b'),JSON[_0x8656('0x27')](_0x20356a));for(_0x1d467d=0x0;_0x1d467d<_0x20356a[_0x8656('0x46')];_0x1d467d+=0x1){_0x23c1a4=_0x20356a[_0x1d467d][_0x8656('0x42')]();logger[_0x8656('0xc')](_0x8656('0x4c'),_0x23c1a4);if(_0xa90b96){logger[_0x8656('0xc')](_0x8656('0x4d'),_0xa90b96);logger[_0x8656('0xc')](JSON[_0x8656('0x27')](_0x2fb034[_0x23c1a4]));BPromise[_0x8656('0x4e')]()[_0x8656('0x2f')](handleJob(_0x2fb034[_0x23c1a4]));logger[_0x8656('0xc')](_0x8656('0x4f'),_0x2fb034[_0x23c1a4]['name'],_0x2fb034[_0x23c1a4][_0x8656('0x50')]);}else if(_0x2fb034[_0x23c1a4][_0x8656('0x50')]&&_0x2fb034[_0x23c1a4][_0x8656('0x51')]&&moment()['isBetween'](_0x2fb034[_0x23c1a4]['startAt'],_0x2fb034[_0x23c1a4]['endAt'])){manager[_0x8656('0x52')](_0x23c1a4,_0x2fb034[_0x23c1a4][_0x8656('0x50')],handleJob(_0x2fb034[_0x23c1a4]));manager[_0x8656('0x53')](_0x23c1a4);logger[_0x8656('0xc')](_0x8656('0x54'),_0x2fb034[_0x23c1a4]['name'],_0x2fb034[_0x23c1a4][_0x8656('0x50')]);}else if(manager[_0x8656('0x47')](_0x23c1a4)){manager['stop'](_0x23c1a4);manager[_0x8656('0x49')](_0x23c1a4);logger[_0x8656('0xc')](_0x8656('0x55'),_0x2fb034[_0x23c1a4][_0x8656('0x18')],_0x2fb034[_0x23c1a4][_0x8656('0x50')]);}}for(_0x1d467d=0x0,_0x23c1a4;_0x1d467d<_0x43d1d1[_0x8656('0x46')]&&!_0xa90b96;_0x1d467d+=0x1){_0x23c1a4=_0x43d1d1[_0x1d467d][_0x8656('0x42')]();if(manager['exists'](_0x23c1a4)){if(_0x2fb034[_0x23c1a4][_0x8656('0x50')]&&_0x2fb034[_0x23c1a4]['active']&&moment()[_0x8656('0x56')](_0x2fb034[_0x23c1a4][_0x8656('0x57')],_0x2fb034[_0x23c1a4][_0x8656('0x58')])){manager[_0x8656('0x59')](_0x23c1a4,_0x2fb034[_0x23c1a4]['cron'],handleJob(_0x2fb034[_0x23c1a4]));logger['info'](_0x8656('0x5a'),_0x2fb034[_0x23c1a4][_0x8656('0x18')],_0x2fb034[_0x23c1a4][_0x8656('0x50')]);}else{manager[_0x8656('0x48')](_0x23c1a4);manager[_0x8656('0x49')](_0x23c1a4);logger['info'](_0x8656('0x55'),_0x2fb034[_0x23c1a4][_0x8656('0x18')],_0x2fb034[_0x23c1a4][_0x8656('0x50')]);}}}})['catch'](function(_0x583c68){logger['error'](JSON[_0x8656('0x27')](_0x583c68));});}exports[_0x8656('0x5b')]=function(_0x5d155e){return getJobs(_0x5d155e);};exports[_0x8656('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x8e0b=['YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','runReport','no\x20report\x20id','Schedule','MailServerOut','jobs','map','toString','keyBy','intersection','difference','length','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','exists','endAt','update','update\x20cron','stop\x20cron','util','path','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','email','MailAccount','service','Smtp','host','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','name','user','bcc','subtractNumber','subtractUnit','join','../../files/reports','basename','savename','extname','existsSync','status','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','text','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','then','error','email\x20sent','catch','error\x20mail','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract'];(function(_0x5394a3,_0x2d8957){var _0x265f76=function(_0x10a61c){while(--_0x10a61c){_0x5394a3['push'](_0x5394a3['shift']());}};_0x265f76(++_0x2d8957);}(_0x8e0b,0x7f));var _0xb8e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e0b[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require(_0xb8e0('0x0'));var path=require(_0xb8e0('0x1'));var _=require('lodash');var moment=require(_0xb8e0('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xb8e0('0x3'));var BPromise=require(_0xb8e0('0x4'));var logger=require(_0xb8e0('0x5'))(_0xb8e0('0x6'));var db=require(_0xb8e0('0x7'))['db'];var analyticCustomReportController=require(_0xb8e0('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xb8e0('0x9')][_0xb8e0('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x50d871,_0x538f2b){return function(){logger[_0xb8e0('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x50d871[_0xb8e0('0xc')]);var _0x3fb1c2=!![];var _0xc7ffec={'tls':{'rejectUnauthorized':![]}};if(_0x50d871[_0xb8e0('0xd')]['Smtp'][_0xb8e0('0xe')]){_0xc7ffec[_0xb8e0('0xe')]=_0x50d871['MailAccount'][_0xb8e0('0xf')]['service'];}else{_0xc7ffec['host']=_0x50d871[_0xb8e0('0xd')][_0xb8e0('0xf')][_0xb8e0('0x10')];_0xc7ffec['port']=_0x50d871[_0xb8e0('0xd')][_0xb8e0('0xf')]['port'];_0xc7ffec[_0xb8e0('0x11')]=_0x50d871[_0xb8e0('0xd')][_0xb8e0('0xf')][_0xb8e0('0x11')];}if(_0x50d871[_0xb8e0('0xd')][_0xb8e0('0xf')][_0xb8e0('0x12')]){_0xc7ffec[_0xb8e0('0x13')]={'user':_0x50d871[_0xb8e0('0xd')][_0xb8e0('0xf')]['user'],'pass':_0x50d871['MailAccount'][_0xb8e0('0xf')][_0xb8e0('0x14')]};}var _0x22365e={'account':_0xc7ffec,'message':{'from':util[_0xb8e0('0x15')](_0xb8e0('0x16'),_0x50d871[_0xb8e0('0xd')][_0xb8e0('0x17')],_0x50d871[_0xb8e0('0xd')]['email']||_0x50d871['MailAccount'][_0xb8e0('0xf')][_0xb8e0('0x18')]),'to':_0x50d871['email'],'cc':_0x50d871['cc'],'bcc':_0x50d871[_0xb8e0('0x19')],'subject':util[_0xb8e0('0x15')]('Report\x20%s\x20last\x20%s\x20%s',_0x538f2b['name'],_0x50d871[_0xb8e0('0x1a')],_0x50d871[_0xb8e0('0x1b')])}};var _0x96a3c7=path[_0xb8e0('0x1c')](__dirname,_0xb8e0('0x1d'));var _0x40dc4a=_0x538f2b['savename'];var _0x265f14=util[_0xb8e0('0x15')]('%s.%s',path[_0xb8e0('0x1e')](_0x538f2b[_0xb8e0('0x1f')],path[_0xb8e0('0x20')](_0x538f2b[_0xb8e0('0x1f')])),'zip');var _0x146cfc=path[_0xb8e0('0x1c')](_0x96a3c7,_0x40dc4a);var _0x5f1613=path[_0xb8e0('0x1c')](_0x96a3c7,_0x265f14);if(fs[_0xb8e0('0x21')](_0x146cfc)){_0x538f2b[_0xb8e0('0x22')]='Sent';_0x22365e[_0xb8e0('0x23')][_0xb8e0('0x24')]=[{'filename':_0x40dc4a,'path':_0x146cfc}];_0x22365e[_0xb8e0('0x23')]['text']=util[_0xb8e0('0x15')](_0xb8e0('0x25'),JSON[_0xb8e0('0x26')](_0x538f2b,null,0x2));}else if(fs[_0xb8e0('0x21')](_0x5f1613)){_0x538f2b[_0xb8e0('0x22')]='Sent';_0x22365e[_0xb8e0('0x23')]['attachments']=[{'filename':_0x265f14,'path':_0x5f1613}];}else{_0x22365e[_0xb8e0('0x23')][_0xb8e0('0x27')]=_0xb8e0('0x28');if(!_0x50d871[_0xb8e0('0x29')]){_0x3fb1c2=![];logger[_0xb8e0('0xb')](_0xb8e0('0x2a'));}}if(_0x3fb1c2){return client[_0xb8e0('0x2b')]('SendMail',_0x22365e)[_0xb8e0('0x2c')](function(_0x154f14){if(_0x154f14[_0xb8e0('0x2d')]){return logger[_0xb8e0('0x2d')]('error\x20mail',JSON[_0xb8e0('0x26')](_0x154f14));}return logger[_0xb8e0('0xb')](_0xb8e0('0x2e'));})[_0xb8e0('0x2f')](function(_0x1dc54e){return logger['error'](_0xb8e0('0x30'),JSON[_0xb8e0('0x26')](_0x1dc54e));});}};}function handleError(){return function(_0x1d53b5){return logger['error'](JSON[_0xb8e0('0x26')](_0x1d53b5));};}function handleResult(_0x333271){return function(_0x1b1262){logger['info'](_0xb8e0('0x31'),JSON[_0xb8e0('0x26')](_0x1b1262));if(_0x333271[_0xb8e0('0xd')]&&_0x333271[_0xb8e0('0xd')][_0xb8e0('0xf')]&&!_[_0xb8e0('0x32')](_0x333271['email'])){setTimeout(handleSendEmail(_0x333271,_0x1b1262),0x3c*0x3e8);}};}function handleJob(_0x4f1ed1){return function(){try{if(_[_0xb8e0('0x32')](_0x4f1ed1[_0xb8e0('0x1a')])){return logger[_0xb8e0('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xb8e0('0x32')](_0x4f1ed1[_0xb8e0('0x1b')])){return logger[_0xb8e0('0xb')](_0xb8e0('0x33'));}var _0x34e12c={'startDate':moment()[_0xb8e0('0x34')](_0x4f1ed1[_0xb8e0('0x1a')],_0x4f1ed1[_0xb8e0('0x1b')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xb8e0('0x15')](_0xb8e0('0x35')),'type':_0xb8e0('0x36'),'output':_0x4f1ed1[_0xb8e0('0x37')],'name':_0x4f1ed1['name']};if(!_['isNil'](_0x4f1ed1[_0xb8e0('0x38')])){logger['info'](_0xb8e0('0x39'),_0x4f1ed1[_0xb8e0('0x38')]);return analyticDefaultReportController['runReport']({'id':_0x4f1ed1['DefaultReportId']},_0x34e12c)[_0xb8e0('0x2c')](handleResult(_0x4f1ed1))['catch'](handleError());}if(!_[_0xb8e0('0x32')](_0x4f1ed1[_0xb8e0('0x3a')])){logger[_0xb8e0('0xb')]('exec\x20custom\x20report\x20id:%s',_0x4f1ed1['CustomReportId']);return analyticCustomReportController[_0xb8e0('0x3b')]({'id':_0x4f1ed1[_0xb8e0('0x3a')]},_0x34e12c)[_0xb8e0('0x2c')](handleResult(_0x4f1ed1))[_0xb8e0('0x2f')](handleError());}}catch(_0x10196e){logger[_0xb8e0('0x2d')](JSON[_0xb8e0('0x26')](_0x10196e));}return logger[_0xb8e0('0xb')](_0xb8e0('0x3c'));};}function getJobs(_0x5bd4e1){var _0x413726={};if(_0x5bd4e1){_0x413726['id']=_0x5bd4e1;}return db[_0xb8e0('0x3d')]['findAll']({'where':_0x413726,'include':[{'model':db[_0xb8e0('0xd')],'attributes':['id','name','email'],'include':[{'model':db[_0xb8e0('0x3e')],'as':_0xb8e0('0xf')}]}]})['then'](function(_0x370408){var _0x1fbdfd=_['keys'](manager[_0xb8e0('0x3f')]);var _0xb47100=_[_0xb8e0('0x40')](_0x370408,function(_0x280eed){return _0x280eed['id'][_0xb8e0('0x41')]();});var _0xf7ce9f=_[_0xb8e0('0x42')](_0x370408,function(_0xe8b9cd){return _0xe8b9cd['id'][_0xb8e0('0x41')]();});var _0x380e25=_0x5bd4e1?_0xb47100:_['difference'](_0xb47100,_0x1fbdfd);var _0x5eaf4b=_[_0xb8e0('0x43')](_0xb47100,_0x1fbdfd);var _0x574f2b=_[_0xb8e0('0x44')](_0x1fbdfd,_0xb47100);var _0x370083;var _0x18ca56;for(_0x370083=0x0;_0x370083<_0x574f2b[_0xb8e0('0x45')]&&!_0x5bd4e1;_0x370083+=0x1){_0x18ca56=_0x574f2b[_0x370083][_0xb8e0('0x41')]();if(manager['exists'](_0x18ca56)){manager[_0xb8e0('0x46')](_0x18ca56);manager[_0xb8e0('0x47')](_0x18ca56);logger['info'](_0xb8e0('0x48'),_0x18ca56);}}logger[_0xb8e0('0xb')](_0xb8e0('0x49'),JSON[_0xb8e0('0x26')](_0x380e25));for(_0x370083=0x0;_0x370083<_0x380e25[_0xb8e0('0x45')];_0x370083+=0x1){_0x18ca56=_0x380e25[_0x370083]['toString']();logger[_0xb8e0('0xb')](_0xb8e0('0x4a'),_0x18ca56);if(_0x5bd4e1){logger[_0xb8e0('0xb')](_0xb8e0('0x4b'),_0x5bd4e1);logger['info'](JSON[_0xb8e0('0x26')](_0xf7ce9f[_0x18ca56]));BPromise[_0xb8e0('0x4c')]()[_0xb8e0('0x2c')](handleJob(_0xf7ce9f[_0x18ca56]));logger[_0xb8e0('0xb')](_0xb8e0('0x4d'),_0xf7ce9f[_0x18ca56][_0xb8e0('0x17')],_0xf7ce9f[_0x18ca56][_0xb8e0('0x4e')]);}else if(_0xf7ce9f[_0x18ca56][_0xb8e0('0x4e')]&&_0xf7ce9f[_0x18ca56][_0xb8e0('0x4f')]&&moment()[_0xb8e0('0x50')](_0xf7ce9f[_0x18ca56][_0xb8e0('0x51')],_0xf7ce9f[_0x18ca56]['endAt'])){manager[_0xb8e0('0x52')](_0x18ca56,_0xf7ce9f[_0x18ca56][_0xb8e0('0x4e')],handleJob(_0xf7ce9f[_0x18ca56]));manager[_0xb8e0('0x53')](_0x18ca56);logger[_0xb8e0('0xb')](_0xb8e0('0x54'),_0xf7ce9f[_0x18ca56]['name'],_0xf7ce9f[_0x18ca56][_0xb8e0('0x4e')]);}else if(manager[_0xb8e0('0x55')](_0x18ca56)){manager[_0xb8e0('0x46')](_0x18ca56);manager[_0xb8e0('0x47')](_0x18ca56);logger[_0xb8e0('0xb')]('stop\x20cron',_0xf7ce9f[_0x18ca56]['name'],_0xf7ce9f[_0x18ca56][_0xb8e0('0x4e')]);}}for(_0x370083=0x0,_0x18ca56;_0x370083<_0x5eaf4b[_0xb8e0('0x45')]&&!_0x5bd4e1;_0x370083+=0x1){_0x18ca56=_0x5eaf4b[_0x370083][_0xb8e0('0x41')]();if(manager[_0xb8e0('0x55')](_0x18ca56)){if(_0xf7ce9f[_0x18ca56][_0xb8e0('0x4e')]&&_0xf7ce9f[_0x18ca56]['active']&&moment()[_0xb8e0('0x50')](_0xf7ce9f[_0x18ca56][_0xb8e0('0x51')],_0xf7ce9f[_0x18ca56][_0xb8e0('0x56')])){manager[_0xb8e0('0x57')](_0x18ca56,_0xf7ce9f[_0x18ca56][_0xb8e0('0x4e')],handleJob(_0xf7ce9f[_0x18ca56]));logger[_0xb8e0('0xb')](_0xb8e0('0x58'),_0xf7ce9f[_0x18ca56][_0xb8e0('0x17')],_0xf7ce9f[_0x18ca56][_0xb8e0('0x4e')]);}else{manager[_0xb8e0('0x46')](_0x18ca56);manager[_0xb8e0('0x47')](_0x18ca56);logger[_0xb8e0('0xb')](_0xb8e0('0x59'),_0xf7ce9f[_0x18ca56][_0xb8e0('0x17')],_0xf7ce9f[_0x18ca56][_0xb8e0('0x4e')]);}}}})[_0xb8e0('0x2f')](function(_0x3a339d){logger[_0xb8e0('0x2d')](JSON[_0xb8e0('0x26')](_0x3a339d));});}exports['run']=function(_0x567ded){return getJobs(_0x567ded);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 2fd34f5..15102c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x345e=['Settings\x20not\x20available','transcribeAccountId','forEach','all','name','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Negative','Neutral','catch','SequelizeValidationError','error','inspect','VoiceRecording','No\x20transcribe\x20job\x20to\x20check','Setting'];(function(_0x1ec8f9,_0x22f5e7){var _0x17cd3d=function(_0x156ad2){while(--_0x156ad2){_0x1ec8f9['push'](_0x1ec8f9['shift']());}};_0x17cd3d(++_0x22f5e7);}(_0x345e,0x168));var _0xe345=function(_0x216240,_0xb67e29){_0x216240=_0x216240-0x0;var _0x488ab8=_0x345e[_0x216240];return _0x488ab8;};var _=require(_0xe345('0x0'));var AWS=require(_0xe345('0x1'));var rp=require('request-promise');var util=require(_0xe345('0x2'));var BPromise=require(_0xe345('0x3'));var db=require(_0xe345('0x4'))['db'];var logger=require(_0xe345('0x5'))(_0xe345('0x6'));function getTranscriptionJob(_0x43d6fd,_0x469d06,_0x304b67,_0x414110){return new Promise(function(_0x575c38,_0x4491a9){var _0x38cc87=new AWS[(_0xe345('0x7'))]({'accessKeyId':_0x469d06,'secretAccessKey':_0x43d6fd,'region':_0x304b67});_0x38cc87[_0xe345('0x8')]({'TranscriptionJobName':_0x414110},function(_0x24f14f,_0x18f9a3){if(_0x24f14f){return _0x4491a9(_0x24f14f);}else{return _0x575c38(_0x18f9a3);}});});}function sentiment(_0x517809,_0x5912b2,_0x41bd55,_0x47382b,_0x322dc6){return new Promise(function(_0x15aa5a,_0x3d2b81){var _0x30d4d2=new AWS[(_0xe345('0x9'))]({'accessKeyId':_0x5912b2,'secretAccessKey':_0x517809,'region':_0x41bd55});_0x30d4d2[_0xe345('0xa')]({'Text':_0x47382b,'LanguageCode':_0x322dc6[_0xe345('0xb')](0x0,0x2)},function(_0x2efe39,_0x5ed9f0){if(_0x2efe39){return _0x3d2b81(_0x2efe39);}else{return _0x15aa5a(_0x5ed9f0);}});});}function checkTranscribeJob(_0xf95224,_0x1a8ced,_0x5a5df4){var _0x5d9379;return new BPromise(function(_0x2be002,_0x5bd8d6){logger[_0xe345('0xc')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0xf95224['id'],_0xf95224[_0xe345('0xd')]));return getTranscriptionJob(_0x5a5df4[_0xe345('0xe')],_0x5a5df4[_0xe345('0xf')],_0x1a8ced[_0xe345('0x10')],_0xf95224[_0xe345('0xd')])[_0xe345('0x11')](function(_0x1d3717){logger[_0xe345('0xc')](util[_0xe345('0x12')](_0xe345('0x13'),_0xf95224['id'],_0xf95224['transcribeName'],_0x1d3717['TranscriptionJob'][_0xe345('0x14')]));if(!_0xf95224[_0xe345('0x15')]){switch(_0x1d3717[_0xe345('0x16')][_0xe345('0x14')]){case _0xe345('0x17'):var _0x4bed9f={'transcribeStatus':_0x1d3717[_0xe345('0x16')][_0xe345('0x14')],'fileUri':_0x1d3717['TranscriptionJob'][_0xe345('0x18')][_0xe345('0x19')]};logger[_0xe345('0xc')](util[_0xe345('0x12')](_0xe345('0x1a'),_0xf95224['id']));return rp({'uri':_0x1d3717[_0xe345('0x16')]['Transcript'][_0xe345('0x19')],'json':!![]})['then'](function(_0x176e04){logger['info'](util[_0xe345('0x12')](_0xe345('0x1b'),_0xf95224['id']));if(_0x176e04&&_0x176e04[_0xe345('0x1c')]&&_0x176e04[_0xe345('0x1c')]['transcripts']&&_0x176e04['results'][_0xe345('0x1d')][_0xe345('0x1e')]){_0x4bed9f['fileText']='';for(var _0x575c9a=0x0;_0x575c9a<_0x176e04['results'][_0xe345('0x1d')][_0xe345('0x1e')];_0x575c9a++){_0x4bed9f[_0xe345('0x15')]+=_0x176e04['results']['transcripts'][_0x575c9a][_0xe345('0x1f')]+'';}}return _0xf95224['update'](_0x4bed9f);})[_0xe345('0x11')](function(){logger[_0xe345('0xc')](util[_0xe345('0x12')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xf95224['id']));if(!_0xf95224[_0xe345('0x20')]){throw new db['Sequelize'][(_0xe345('0x21'))](_0xe345('0x22'));}if(!_0x1a8ced[_0xe345('0x23')]||!_0x1a8ced['sentimentAccountId']||!_0x1a8ced['sentimentRegion']||!_0x1a8ced[_0xe345('0x24')]||!_0x1a8ced[_0xe345('0x25')]){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))](_0xe345('0x27'));}if(!_0x4bed9f['fileText']){throw new Error(_0xe345('0x28'));}if(_0x1a8ced[_0xe345('0x29')]===_0x5a5df4['id']){return _0x5a5df4;}else{return db[_0xe345('0x2a')][_0xe345('0x2b')]({'where':{'id':_settings[_0xe345('0x29')]}});}})['then'](function(_0x163abd){if(!_0x163abd){throw new db[(_0xe345('0x26'))]['ValidationError'](_0xe345('0x2c'));}if(!_0x163abd[_0xe345('0xe')]||!_0x163abd[_0xe345('0xf')]){throw new db['Sequelize']['ValidationError'](_0xe345('0x2d'));}_0x5d9379=_0x163abd;logger[_0xe345('0xc')](util['format'](_0xe345('0x2e'),_0xf95224['id']));return sentiment(_0x5d9379[_0xe345('0xe')],_0x5d9379[_0xe345('0xf')],_0x1a8ced[_0xe345('0x2f')],_0x4bed9f[_0xe345('0x15')],_0x1a8ced[_0xe345('0x24')]);})[_0xe345('0x11')](function(_0x3ae902){logger[_0xe345('0xc')](util['format'](_0xe345('0x30'),_0xf95224['id']));return _0xf95224[_0xe345('0x31')]({'sentiment':_0x3ae902[_0xe345('0x32')],'sPositive':_0x3ae902[_0xe345('0x33')][_0xe345('0x34')],'sNegative':_0x3ae902[_0xe345('0x33')]['Negative'],'sMixed':_0x3ae902['SentimentScore']['Mixed'],'sNeutral':_0x3ae902[_0xe345('0x33')]['Neutral']});})[_0xe345('0x11')](function(){logger[_0xe345('0xc')](util[_0xe345('0x12')](_0xe345('0x35'),_0xf95224['id']));_0x2be002();});case'FAILED':return _0xf95224[_0xe345('0x31')]({'transcribeStatus':_0xe345('0x36'),'failureReason':_0x1d3717[_0xe345('0x16')]['FailureReason']})[_0xe345('0x11')](function(){logger[_0xe345('0xc')](util[_0xe345('0x12')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xf95224['id']));_0x2be002();});default:logger['info'](util[_0xe345('0x12')](_0xe345('0x37'),_0xf95224['id']));break;}}else{return BPromise[_0xe345('0x38')]()['then'](function(){if(!_0xf95224['tempSentiment']){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))](_0xe345('0x22'));}if(!_0x1a8ced[_0xe345('0x23')]||!_0x1a8ced[_0xe345('0x29')]||!_0x1a8ced[_0xe345('0x2f')]||!_0x1a8ced[_0xe345('0x24')]||!_0x1a8ced[_0xe345('0x25')]){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0xf95224[_0xe345('0x15')]){throw new Error(_0xe345('0x28'));}if(_0x1a8ced[_0xe345('0x29')]===_0x5a5df4['id']){return _0x5a5df4;}else{return db[_0xe345('0x2a')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x3d019c){if(!_0x3d019c){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))](_0xe345('0x2c'));}if(!_0x3d019c[_0xe345('0xe')]||!_0x3d019c[_0xe345('0xf')]){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x5d9379=_0x3d019c;logger[_0xe345('0xc')](util[_0xe345('0x12')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xf95224['id']));return sentiment(_0x5d9379['data1'],_0x5d9379[_0xe345('0xf')],_0x1a8ced[_0xe345('0x2f')],_0xf95224[_0xe345('0x15')],_0x1a8ced['language']);})[_0xe345('0x11')](function(_0x3ed152){logger['info'](util['format'](_0xe345('0x30'),_0xf95224['id']));return _0xf95224[_0xe345('0x31')]({'sentiment':_0x3ed152['Sentiment'],'sPositive':_0x3ed152['SentimentScore'][_0xe345('0x34')],'sNegative':_0x3ed152['SentimentScore'][_0xe345('0x39')],'sMixed':_0x3ed152['SentimentScore']['Mixed'],'sNeutral':_0x3ed152[_0xe345('0x33')][_0xe345('0x3a')],'transcribeStatus':_0xe345('0x17')});})[_0xe345('0x11')](function(){logger[_0xe345('0xc')](util[_0xe345('0x12')](_0xe345('0x35'),_0xf95224['id']));_0x2be002();});}})[_0xe345('0x3b')](function(_0x336cbd){if(_0x336cbd){if(!_0x336cbd['name']||_0x336cbd['name']!==_0xe345('0x3c')){logger[_0xe345('0x3d')](util[_0xe345('0x12')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0xf95224['id']),util[_0xe345('0x3e')](_0x336cbd,{'showHidden':![],'depth':null}));}}_0x2be002();});});}function checkTranscribe(){var _0x4ef10;var _0x1c9821;var _0x22d1fe;return db[_0xe345('0x3f')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x132988){if(!_0x132988||!_0x132988[_0xe345('0x1e')]){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))](_0xe345('0x40'));}_0x4ef10=_0x132988;return db[_0xe345('0x41')]['findOne']({'where':{'id':0x1}});})[_0xe345('0x11')](function(_0x4a9b7f){if(!_0x4a9b7f){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))](_0xe345('0x42'));}_0x1c9821=_0x4a9b7f;if(!_0x1c9821['transcribe']||!_0x1c9821[_0xe345('0x43')]||!_0x1c9821[_0xe345('0x10')]||!_0x1c9821['language']||!_0x1c9821[_0xe345('0x25')]){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))]('Transcribe\x20not\x20configured');}return db[_0xe345('0x2a')]['findOne']({'where':{'id':_0x1c9821[_0xe345('0x43')]}});})[_0xe345('0x11')](function(_0x4e9b9f){if(!_0x4e9b9f){throw new db[(_0xe345('0x26'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x4e9b9f[_0xe345('0xe')]||!_0x4e9b9f[_0xe345('0xf')]){throw new db[(_0xe345('0x26'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x22d1fe=_0x4e9b9f;var _0x50e159=[];_0x4ef10[_0xe345('0x44')](function(_0x7c7e60){_0x50e159['push'](checkTranscribeJob(_0x7c7e60,_0x1c9821,_0x22d1fe));});return BPromise[_0xe345('0x45')](_0x50e159);})[_0xe345('0x3b')](function(_0xc8f27){if(_0xc8f27){if(!_0xc8f27[_0xe345('0x46')]||_0xc8f27['name']!==_0xe345('0x3c')){logger[_0xe345('0x3d')](util[_0xe345('0x3e')](_0xc8f27,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x58a7=['[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Mixed','Neutral','FAILED','FailureReason','resolve','Cloud\x20Provider\x20not\x20configured','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','push','all','catch','name','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','info','transcribeName','data1','data2','format','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update'];(function(_0x36bab3,_0x19ce33){var _0x2d3989=function(_0x2a4f60){while(--_0x2a4f60){_0x36bab3['push'](_0x36bab3['shift']());}};_0x2d3989(++_0x19ce33);}(_0x58a7,0xf7));var _0x758a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x58a7[_0x59ee6f];return _0x4c0979;};var _=require(_0x758a('0x0'));var AWS=require(_0x758a('0x1'));var rp=require(_0x758a('0x2'));var util=require(_0x758a('0x3'));var BPromise=require(_0x758a('0x4'));var db=require(_0x758a('0x5'))['db'];var logger=require(_0x758a('0x6'))(_0x758a('0x7'));function getTranscriptionJob(_0x4cebf6,_0x2f36b2,_0x2c9e10,_0x34482d){return new Promise(function(_0x294cf3,_0x5a34af){var _0x52bc94=new AWS[(_0x758a('0x8'))]({'accessKeyId':_0x2f36b2,'secretAccessKey':_0x4cebf6,'region':_0x2c9e10});_0x52bc94['getTranscriptionJob']({'TranscriptionJobName':_0x34482d},function(_0x227bdb,_0x31311b){if(_0x227bdb){return _0x5a34af(_0x227bdb);}else{return _0x294cf3(_0x31311b);}});});}function sentiment(_0x189085,_0x12a46b,_0x1e5665,_0x3620b9,_0x3e5a12){return new Promise(function(_0x46b659,_0x318adf){var _0x51fb97=new AWS[(_0x758a('0x9'))]({'accessKeyId':_0x12a46b,'secretAccessKey':_0x189085,'region':_0x1e5665});_0x51fb97['detectSentiment']({'Text':_0x3620b9,'LanguageCode':_0x3e5a12['substring'](0x0,0x2)},function(_0x206220,_0x3aac40){if(_0x206220){return _0x318adf(_0x206220);}else{return _0x46b659(_0x3aac40);}});});}function checkTranscribeJob(_0x1785d1,_0x4c2dfc,_0x3e1ee0){var _0x2cc841;return new BPromise(function(_0x3a496f,_0x253c58){logger[_0x758a('0xa')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x1785d1['id'],_0x1785d1[_0x758a('0xb')]));return getTranscriptionJob(_0x3e1ee0[_0x758a('0xc')],_0x3e1ee0[_0x758a('0xd')],_0x4c2dfc['transcribeRegion'],_0x1785d1['transcribeName'])['then'](function(_0x5bdbfb){logger[_0x758a('0xa')](util[_0x758a('0xe')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x1785d1['id'],_0x1785d1[_0x758a('0xb')],_0x5bdbfb[_0x758a('0xf')][_0x758a('0x10')]));if(!_0x1785d1[_0x758a('0x11')]){switch(_0x5bdbfb[_0x758a('0xf')][_0x758a('0x10')]){case _0x758a('0x12'):var _0x44b344={'transcribeStatus':_0x5bdbfb[_0x758a('0xf')][_0x758a('0x10')],'fileUri':_0x5bdbfb[_0x758a('0xf')][_0x758a('0x13')][_0x758a('0x14')]};logger[_0x758a('0xa')](util[_0x758a('0xe')](_0x758a('0x15'),_0x1785d1['id']));return rp({'uri':_0x5bdbfb['TranscriptionJob'][_0x758a('0x13')][_0x758a('0x14')],'json':!![]})[_0x758a('0x16')](function(_0x3ba95e){logger[_0x758a('0xa')](util[_0x758a('0xe')](_0x758a('0x17'),_0x1785d1['id']));if(_0x3ba95e&&_0x3ba95e['results']&&_0x3ba95e[_0x758a('0x18')][_0x758a('0x19')]&&_0x3ba95e['results']['transcripts'][_0x758a('0x1a')]){_0x44b344[_0x758a('0x11')]='';for(var _0x1a73d5=0x0;_0x1a73d5<_0x3ba95e[_0x758a('0x18')][_0x758a('0x19')]['length'];_0x1a73d5++){_0x44b344[_0x758a('0x11')]+=_0x3ba95e['results']['transcripts'][_0x1a73d5][_0x758a('0x1b')]+'';}}return _0x1785d1[_0x758a('0x1c')](_0x44b344);})[_0x758a('0x16')](function(){logger['info'](util[_0x758a('0xe')](_0x758a('0x1d'),_0x1785d1['id']));if(!_0x1785d1[_0x758a('0x1e')]){throw new db[(_0x758a('0x1f'))][(_0x758a('0x20'))](_0x758a('0x21'));}if(!_0x4c2dfc[_0x758a('0x22')]||!_0x4c2dfc[_0x758a('0x23')]||!_0x4c2dfc[_0x758a('0x24')]||!_0x4c2dfc[_0x758a('0x25')]||!_0x4c2dfc[_0x758a('0x26')]){throw new db['Sequelize']['ValidationError'](_0x758a('0x27'));}if(!_0x44b344[_0x758a('0x11')]){throw new Error(_0x758a('0x28'));}if(_0x4c2dfc[_0x758a('0x23')]===_0x3e1ee0['id']){return _0x3e1ee0;}else{return db[_0x758a('0x29')][_0x758a('0x2a')]({'where':{'id':_settings[_0x758a('0x23')]}});}})[_0x758a('0x16')](function(_0x1e7155){if(!_0x1e7155){throw new db[(_0x758a('0x1f'))][(_0x758a('0x20'))](_0x758a('0x2b'));}if(!_0x1e7155[_0x758a('0xc')]||!_0x1e7155['data2']){throw new db[(_0x758a('0x1f'))][(_0x758a('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x2cc841=_0x1e7155;logger[_0x758a('0xa')](util[_0x758a('0xe')](_0x758a('0x2c'),_0x1785d1['id']));return sentiment(_0x2cc841[_0x758a('0xc')],_0x2cc841['data2'],_0x4c2dfc['sentimentRegion'],_0x44b344[_0x758a('0x11')],_0x4c2dfc[_0x758a('0x25')]);})['then'](function(_0x52f46a){logger[_0x758a('0xa')](util[_0x758a('0xe')](_0x758a('0x2d'),_0x1785d1['id']));return _0x1785d1[_0x758a('0x1c')]({'sentiment':_0x52f46a[_0x758a('0x2e')],'sPositive':_0x52f46a['SentimentScore'][_0x758a('0x2f')],'sNegative':_0x52f46a['SentimentScore']['Negative'],'sMixed':_0x52f46a[_0x758a('0x30')][_0x758a('0x31')],'sNeutral':_0x52f46a[_0x758a('0x30')][_0x758a('0x32')]});})[_0x758a('0x16')](function(){logger['info'](util[_0x758a('0xe')](_0x758a('0x1d'),_0x1785d1['id']));_0x3a496f();});case _0x758a('0x33'):return _0x1785d1[_0x758a('0x1c')]({'transcribeStatus':_0x758a('0x33'),'failureReason':_0x5bdbfb[_0x758a('0xf')][_0x758a('0x34')]})['then'](function(){logger[_0x758a('0xa')](util[_0x758a('0xe')](_0x758a('0x1d'),_0x1785d1['id']));_0x3a496f();});default:logger[_0x758a('0xa')](util[_0x758a('0xe')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1785d1['id']));break;}}else{return BPromise[_0x758a('0x35')]()[_0x758a('0x16')](function(){if(!_0x1785d1[_0x758a('0x1e')]){throw new db['Sequelize'][(_0x758a('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4c2dfc[_0x758a('0x22')]||!_0x4c2dfc[_0x758a('0x23')]||!_0x4c2dfc['sentimentRegion']||!_0x4c2dfc[_0x758a('0x25')]||!_0x4c2dfc[_0x758a('0x26')]){throw new db[(_0x758a('0x1f'))][(_0x758a('0x20'))](_0x758a('0x27'));}if(!_0x1785d1[_0x758a('0x11')]){throw new Error(_0x758a('0x28'));}if(_0x4c2dfc[_0x758a('0x23')]===_0x3e1ee0['id']){return _0x3e1ee0;}else{return db[_0x758a('0x29')][_0x758a('0x2a')]({'where':{'id':_settings[_0x758a('0x23')]}});}})[_0x758a('0x16')](function(_0x3dbc2f){if(!_0x3dbc2f){throw new db[(_0x758a('0x1f'))][(_0x758a('0x20'))](_0x758a('0x2b'));}if(!_0x3dbc2f[_0x758a('0xc')]||!_0x3dbc2f[_0x758a('0xd')]){throw new db[(_0x758a('0x1f'))]['ValidationError'](_0x758a('0x36'));}_0x2cc841=_0x3dbc2f;logger[_0x758a('0xa')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1785d1['id']));return sentiment(_0x2cc841[_0x758a('0xc')],_0x2cc841['data2'],_0x4c2dfc['sentimentRegion'],_0x1785d1[_0x758a('0x11')],_0x4c2dfc[_0x758a('0x25')]);})['then'](function(_0x1ab478){logger[_0x758a('0xa')](util[_0x758a('0xe')](_0x758a('0x2d'),_0x1785d1['id']));return _0x1785d1[_0x758a('0x1c')]({'sentiment':_0x1ab478[_0x758a('0x2e')],'sPositive':_0x1ab478[_0x758a('0x30')][_0x758a('0x2f')],'sNegative':_0x1ab478['SentimentScore']['Negative'],'sMixed':_0x1ab478[_0x758a('0x30')][_0x758a('0x31')],'sNeutral':_0x1ab478[_0x758a('0x30')][_0x758a('0x32')],'transcribeStatus':_0x758a('0x12')});})[_0x758a('0x16')](function(){logger[_0x758a('0xa')](util[_0x758a('0xe')](_0x758a('0x1d'),_0x1785d1['id']));_0x3a496f();});}})['catch'](function(_0xe2ce07){if(_0xe2ce07){if(!_0xe2ce07['name']||_0xe2ce07['name']!==_0x758a('0x37')){logger[_0x758a('0x38')](util['format'](_0x758a('0x39'),_0x1785d1['id']),util[_0x758a('0x3a')](_0xe2ce07,{'showHidden':![],'depth':null}));}}_0x3a496f();});});}function checkTranscribe(){var _0x1fa929;var _0x274325;var _0xad36ac;return db['VoiceRecording'][_0x758a('0x3b')]({'where':{'transcribeStatus':_0x758a('0x3c')}})[_0x758a('0x16')](function(_0x30913e){if(!_0x30913e||!_0x30913e[_0x758a('0x1a')]){throw new db['Sequelize'][(_0x758a('0x20'))]('No\x20transcribe\x20job\x20to\x20check');}_0x1fa929=_0x30913e;return db[_0x758a('0x3d')][_0x758a('0x2a')]({'where':{'id':0x1}});})[_0x758a('0x16')](function(_0x2537d5){if(!_0x2537d5){throw new db[(_0x758a('0x1f'))][(_0x758a('0x20'))](_0x758a('0x3e'));}_0x274325=_0x2537d5;if(!_0x274325[_0x758a('0x7')]||!_0x274325[_0x758a('0x3f')]||!_0x274325['transcribeRegion']||!_0x274325[_0x758a('0x25')]||!_0x274325[_0x758a('0x26')]){throw new db[(_0x758a('0x1f'))][(_0x758a('0x20'))]('Transcribe\x20not\x20configured');}return db[_0x758a('0x29')][_0x758a('0x2a')]({'where':{'id':_0x274325[_0x758a('0x3f')]}});})[_0x758a('0x16')](function(_0x33c70a){if(!_0x33c70a){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x33c70a[_0x758a('0xc')]||!_0x33c70a[_0x758a('0xd')]){throw new db[(_0x758a('0x1f'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0xad36ac=_0x33c70a;var _0x53f3b0=[];_0x1fa929['forEach'](function(_0x229ccd){_0x53f3b0[_0x758a('0x40')](checkTranscribeJob(_0x229ccd,_0x274325,_0xad36ac));});return BPromise[_0x758a('0x41')](_0x53f3b0);})[_0x758a('0x42')](function(_0x2062c4){if(_0x2062c4){if(!_0x2062c4[_0x758a('0x43')]||_0x2062c4[_0x758a('0x43')]!==_0x758a('0x37')){logger[_0x758a('0x38')](util[_0x758a('0x3a')](_0x2062c4,{'showHidden':![],'depth':null}));}}});}exports[_0x758a('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 127a00d..9b7db2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1505=['defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','util','../../mysqldb','../logger','redis'];(function(_0x21776b,_0x4817f7){var _0x254c78=function(_0x274cfc){while(--_0x274cfc){_0x21776b['push'](_0x21776b['shift']());}};_0x254c78(++_0x4817f7);}(_0x1505,0x1cb));var _0x5150=function(_0x412d5d,_0x36e117){_0x412d5d=_0x412d5d-0x0;var _0x27a43a=_0x1505[_0x412d5d];return _0x27a43a;};'use strict';var _=require(_0x5150('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x5150('0x1'));var config=require('../../config/environment');var db=require(_0x5150('0x2'))['db'];var logger=require(_0x5150('0x3'))('schedule');config[_0x5150('0x4')]=_[_0x5150('0x5')](config['redis'],{'host':_0x5150('0x6'),'port':0x18eb});var io=require(_0x5150('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x3052fd=[];return db[_0x5150('0x8')][_0x5150('0x9')]({'raw':!![],'attributes':['id',_0x5150('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x5150('0xb'))}}})[_0x5150('0xc')](function(_0x191871){if(_0x191871&&_0x191871[_0x5150('0xd')]){_0x3052fd=_[_0x5150('0xe')](_0x191871||[],'id');logger[_0x5150('0xf')](_0x5150('0x10'),_0x3052fd[_0x5150('0x11')]());return db[_0x5150('0x8')][_0x5150('0x12')]({'closeReason':_0x5150('0x13'),'disposition':_0x5150('0x14'),'closed':!![],'closedAt':moment()[_0x5150('0x15')](_0x5150('0x16'))},{'where':{'id':_0x3052fd}});}})['then'](function(){if(_0x3052fd&&_0x3052fd[_0x5150('0xd')]){logger[_0x5150('0xf')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x3052fd[_0x5150('0x11')]());for(var _0x5b76c7=0x0;_0x5b76c7<_0x3052fd[_0x5150('0xd')];_0x5b76c7++){io[_0x5150('0x17')](_0x5150('0x18'),{'id':_0x3052fd[_0x5b76c7],'closed':!![]});}}})[_0x5150('0x19')](function(_0x38b15d){logger[_0x5150('0x1a')](_0x5150('0x1b'),_0x38b15d?util['inspect'](_0x38b15d,{'showHidden':![],'depth':null}):'');});}exports[_0x5150('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xaa6f=['findAll','lastMsgAt','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','system','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter'];(function(_0x18fb40,_0x102505){var _0x599922=function(_0xf09b08){while(--_0xf09b08){_0x18fb40['push'](_0x18fb40['shift']());}};_0x599922(++_0x102505);}(_0xaa6f,0x6a));var _0xfaa6=function(_0x4f0aa1,_0x2651d3){_0x4f0aa1=_0x4f0aa1-0x0;var _0x8a47fd=_0xaa6f[_0x4f0aa1];return _0x8a47fd;};'use strict';var _=require(_0xfaa6('0x0'));var moment=require(_0xfaa6('0x1'));var Redis=require('ioredis');var util=require(_0xfaa6('0x2'));var config=require(_0xfaa6('0x3'));var db=require(_0xfaa6('0x4'))['db'];var logger=require(_0xfaa6('0x5'))(_0xfaa6('0x6'));config[_0xfaa6('0x7')]=_[_0xfaa6('0x8')](config[_0xfaa6('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xfaa6('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x5b558c=[];return db['WhatsappInteraction'][_0xfaa6('0xa')]({'raw':!![],'attributes':['id',_0xfaa6('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xfaa6('0xc'))}}})[_0xfaa6('0xd')](function(_0x297f65){if(_0x297f65&&_0x297f65[_0xfaa6('0xe')]){_0x5b558c=_[_0xfaa6('0xf')](_0x297f65||[],'id');logger[_0xfaa6('0x10')](_0xfaa6('0x11'),_0x5b558c[_0xfaa6('0x12')]());return db[_0xfaa6('0x13')]['update']({'closeReason':_0xfaa6('0x14'),'disposition':_0xfaa6('0x15'),'closed':!![],'closedAt':moment()[_0xfaa6('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x5b558c}});}})['then'](function(){if(_0x5b558c&&_0x5b558c[_0xfaa6('0xe')]){logger[_0xfaa6('0x10')](_0xfaa6('0x17'),_0x5b558c['join']());for(var _0x2c0248=0x0;_0x2c0248<_0x5b558c[_0xfaa6('0xe')];_0x2c0248++){io[_0xfaa6('0x18')](_0xfaa6('0x19'),{'id':_0x5b558c[_0x2c0248],'closed':!![]});}}})['catch'](function(_0x2a492c){logger['error'](_0xfaa6('0x1a'),_0x2a492c?util[_0xfaa6('0x1b')](_0x2a492c,{'showHidden':![],'depth':null}):'');});}exports[_0xfaa6('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 336c603..44f3cd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc488=['../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','then','bulkCreate','log','finished\x20populating','destroy','hopper1','CmContact','contacts2','CmHopper','hopper2','util'];(function(_0xd0c48c,_0xd55dbb){var _0x359b1e=function(_0x18b061){while(--_0x18b061){_0xd0c48c['push'](_0xd0c48c['shift']());}};_0x359b1e(++_0xd55dbb);}(_0xc488,0x7d));var _0x8c48=function(_0x29df1f,_0x13c1b8){_0x29df1f=_0x29df1f-0x0;var _0x429c6f=_0xc488[_0x29df1f];return _0x429c6f;};'use strict';var util=require(_0x8c48('0x0'));var db=require(_0x8c48('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x8c48('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x8c48('0x3')+i,'phone':0xf879fb460+i,'email':_0x8c48('0x4')+i+_0x8c48('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x8c48('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x8c48('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8c48('0x6')](),'updatedAt':Date[_0x8c48('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x8c48('0x2')]({'id':i,'firstName':_0x8c48('0x7')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x8c48('0x4')+i+_0x8c48('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x8c48('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x8c48('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8c48('0x6')](),'updatedAt':Date[_0x8c48('0x6')]()});}db['CmContact']['destroy']({'where':{}})[_0x8c48('0x8')](function(){return db['CmContact'][_0x8c48('0x9')](contacts);})[_0x8c48('0x8')](function(){console[_0x8c48('0xa')](_0x8c48('0xb'),'contacts1');return db['CmHopper'][_0x8c48('0xc')]({'where':{}});})[_0x8c48('0x8')](function(){return db['CmHopper'][_0x8c48('0x9')](hopper);})['then'](function(){console['log']('finished\x20populating',_0x8c48('0xd'));return db[_0x8c48('0xe')]['bulkCreate'](contacts2);})[_0x8c48('0x8')](function(){console[_0x8c48('0xa')](_0x8c48('0xb'),_0x8c48('0xf'));return db[_0x8c48('0x10')][_0x8c48('0x9')](hopper2);})[_0x8c48('0x8')](function(){console[_0x8c48('0xa')](_0x8c48('0xb'),_0x8c48('0x11'));})['catch'](function(_0x37e1e1){console[_0x8c48('0xa')](_0x37e1e1);});
\ No newline at end of file
+var _0x7de4=['contacts1','CmHopper','log','contacts2','hopper2','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','push','CmContact','destroy','then','bulkCreate','finished\x20populating'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7de4,0x71));var _0x47de=function(_0x347e0a,_0xc6484e){_0x347e0a=_0x347e0a-0x0;var _0x8d7580=_0x7de4[_0x347e0a];return _0x8d7580;};'use strict';var util=require(_0x47de('0x0'));var db=require(_0x47de('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x47de('0x2')+i,'lastName':_0x47de('0x3')+i,'phone':0xf879fb460+i,'email':_0x47de('0x4')+i+_0x47de('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x47de('0x6')](),'updatedAt':Date[_0x47de('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x47de('0x7')]({'id':i,'firstName':_0x47de('0x2')+i,'lastName':_0x47de('0x3')+i,'phone':0xf879fb460+i,'email':_0x47de('0x4')+i+_0x47de('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x47de('0x7')]({'id':i,'active':![],'scheduledat':Date[_0x47de('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x47de('0x6')](),'updatedAt':Date[_0x47de('0x6')]()});}db[_0x47de('0x8')][_0x47de('0x9')]({'where':{}})[_0x47de('0xa')](function(){return db[_0x47de('0x8')][_0x47de('0xb')](contacts);})[_0x47de('0xa')](function(){console['log'](_0x47de('0xc'),_0x47de('0xd'));return db[_0x47de('0xe')][_0x47de('0x9')]({'where':{}});})[_0x47de('0xa')](function(){return db[_0x47de('0xe')][_0x47de('0xb')](hopper);})['then'](function(){console[_0x47de('0xf')](_0x47de('0xc'),'hopper1');return db[_0x47de('0x8')]['bulkCreate'](contacts2);})[_0x47de('0xa')](function(){console[_0x47de('0xf')](_0x47de('0xc'),_0x47de('0x10'));return db['CmHopper'][_0x47de('0xb')](hopper2);})[_0x47de('0xa')](function(){console[_0x47de('0xf')](_0x47de('0xc'),_0x47de('0x11'));})['catch'](function(_0xb718a1){console[_0x47de('0xf')](_0xb718a1);});
\ No newline at end of file
index cbc3e35..8e10c5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc53f=['yes','actpass','\x22%s\x22\x20<%s>','then','log','catch','util','../mysqldb','format','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','%s%s'];(function(_0x5c9f56,_0x42c9ad){var _0x2a726b=function(_0x4a13cd){while(--_0x4a13cd){_0x5c9f56['push'](_0x5c9f56['shift']());}};_0x2a726b(++_0x42c9ad);}(_0xc53f,0x15c));var _0xfc53=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xc53f[_0x484e36];return _0xafc85d;};'use strict';var util=require(_0xfc53('0x0'));var db=require(_0xfc53('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xfc53('0x2')]('%s%s',_0xfc53('0x3'),i),'fullname':util[_0xfc53('0x2')]('%s%s','agent',i),'email':util['format'](_0xfc53('0x4'),'agent',i),'role':_0xfc53('0x3'),'password':_0xfc53('0x5'),'internal':0xfa0+i,'type':_0xfc53('0x6'),'transport':[_0xfc53('0x7'),'ws',_0xfc53('0x8')],'disallow':[_0xfc53('0x9')],'allow':[_0xfc53('0xa')],'defaultuser':util['format'](_0xfc53('0xb'),_0xfc53('0x3'),i),'encryption':_0xfc53('0xc'),'avpf':_0xfc53('0xc'),'force_avp':_0xfc53('0xc'),'icesupport':_0xfc53('0xc'),'dtlsenable':_0xfc53('0xc'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xfc53('0xd'),'callerid':util['format'](_0xfc53('0xe'),util[_0xfc53('0x2')](_0xfc53('0xb'),_0xfc53('0x3'),i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0xfc53('0xf')](function(){console[_0xfc53('0x10')]('add\x20user');})[_0xfc53('0x11')](function(_0x20b99a){console['log'](_0x20b99a);});
\ No newline at end of file
+var _0x00be=['yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','User','bulkCreate','then','log','catch','../mysqldb','push','%s%s','format','%s%s@xcally.com','agent','password','friend','udp','all'];(function(_0x57b432,_0x1589a0){var _0x2edf2a=function(_0x20edfc){while(--_0x20edfc){_0x57b432['push'](_0x57b432['shift']());}};_0x2edf2a(++_0x1589a0);}(_0x00be,0xe0));var _0xe00b=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x00be[_0x46698a];return _0x356db0;};'use strict';var util=require('util');var db=require(_0xe00b('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe00b('0x1')]({'name':util['format'](_0xe00b('0x2'),'agent',i),'fullname':util[_0xe00b('0x3')](_0xe00b('0x2'),'agent',i),'email':util[_0xe00b('0x3')](_0xe00b('0x4'),'agent',i),'role':_0xe00b('0x5'),'password':_0xe00b('0x6'),'internal':0xfa0+i,'type':_0xe00b('0x7'),'transport':[_0xe00b('0x8'),'ws','wss'],'disallow':[_0xe00b('0x9')],'allow':['ulaw'],'defaultuser':util['format']('%s%s',_0xe00b('0x5'),i),'encryption':'yes','avpf':'yes','force_avp':_0xe00b('0xa'),'icesupport':'yes','dtlsenable':_0xe00b('0xa'),'dtlsverify':'no','dtlscertfile':_0xe00b('0xb'),'dtlsprivatekey':_0xe00b('0xc'),'dtlssetup':'actpass','callerid':util[_0xe00b('0x3')]('\x22%s\x22\x20<%s>',util[_0xe00b('0x3')](_0xe00b('0x2'),_0xe00b('0x5'),i),0xfa0+i)});}db[_0xe00b('0xd')][_0xe00b('0xe')](users)[_0xe00b('0xf')](function(){console[_0xe00b('0x10')]('add\x20user');})[_0xe00b('0x11')](function(_0xa32c5a){console[_0xe00b('0x10')](_0xa32c5a);});
\ No newline at end of file
index 4aa7443..236f136 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e2a=['OpenchannelQueues','findAll','Telephones','Trunks','resourceId','then','map','role','Campaign','where','type','format','%s:queue:%s','length','user:%s','handshake','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','FaxQueues','OpenchannelQueue','IvrCampaigns','getVoiceQueues','getChatQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','openchannel','whatsapp','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address','remoteAddress','request','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','ivr','UserProfileSection','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3e2a,0x10c));var _0xa3e2=function(_0x4ce19b,_0xbba834){_0x4ce19b=_0x4ce19b-0x0;var _0x617495=_0x3e2a[_0x4ce19b];return _0x617495;};'use strict';var _=require(_0xa3e2('0x0'));var util=require(_0xa3e2('0x1'));var BPromise=require(_0xa3e2('0x2'));var db=require(_0xa3e2('0x3'))['db'];var config=require(_0xa3e2('0x4'));var queryQueues={'attributes':['id',_0xa3e2('0x5')],'include':[{'as':_0xa3e2('0x6'),'model':db[_0xa3e2('0x7')],'attributes':['id',_0xa3e2('0x5'),'role'],'raw':!![],'where':{'role':_0xa3e2('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xa3e2('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xa3e2('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xa3e2('0x5')],'where':{'role':_0xa3e2('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xa3e2('0x5'),'type'],'where':{'type':_0xa3e2('0xa')}};function getAssociatedResources(_0x16ffa6,_0x4b00fa,_0x3b5326){return db[_0xa3e2('0xb')]['findOne']({'where':{'name':_0x16ffa6,'userProfileId':_0x4b00fa},'raw':!![]})['then'](function(_0x4cb0f0){if(_0x4cb0f0){if(_0x4cb0f0[_0xa3e2('0xc')]){switch(_0x16ffa6){case _0xa3e2('0xd'):case _0xa3e2('0xe'):case'FaxQueues':case _0xa3e2('0xf'):case _0xa3e2('0x10'):case _0xa3e2('0x11'):case'WhatsappQueues':return db[_0x3b5326][_0xa3e2('0x12')](queryQueues);case _0xa3e2('0x13'):return db[_0x3b5326]['findAll'](queryTelephones);case _0xa3e2('0x14'):return db[_0x3b5326][_0xa3e2('0x12')](queryTrunks);case'IvrCampaigns':return db[_0x3b5326][_0xa3e2('0x12')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0xa3e2('0x15')],'where':{'sectionId':_0x4cb0f0['id']},'raw':!![]})[_0xa3e2('0x16')](function(_0x3f2319){if(_0x3f2319){var _0x4d1c19={'where':{'id':_[_0xa3e2('0x17')](_0x3f2319,'resourceId')},'raw':!![]};switch(_0x3b5326){case _0xa3e2('0x7'):_0x4d1c19['where'][_0xa3e2('0x18')]=_0xa3e2('0x9');break;case _0xa3e2('0x19'):_0x4d1c19[_0xa3e2('0x1a')][_0xa3e2('0x1b')]=_0xa3e2('0xa');break;}return db[_0x3b5326]['findAll'](_0x4d1c19);}else{return[];}});}}else{return[];}})[_0xa3e2('0x16')](function(_0xd6151a){return _0xd6151a;});}function joinOrLeaveQueues(_0x7471c1,_0x41373c,_0x478582,_0x288757){_0x7471c1[_0x41373c](util[_0xa3e2('0x1c')](_0xa3e2('0x1d'),_0x478582,_0x288757[_0xa3e2('0x5')]));if(_0x288757['Agents']){for(var _0x3d8540=0x0;_0x3d8540<_0x288757['Agents'][_0xa3e2('0x1e')];_0x3d8540+=0x1){_0x7471c1[_0x41373c](util[_0xa3e2('0x1c')](_0xa3e2('0x1f'),_0x288757['Agents'][_0x3d8540][_0xa3e2('0x5')]));}}}function joinOrLeave(_0x21dcef,_0x5d63c4,_0x29559c){var _0x416730;if(_0x21dcef[_0xa3e2('0x20')]['query']['id']){db['User']['find']({'attributes':['id',_0xa3e2('0x5'),_0xa3e2('0x18'),_0xa3e2('0x21')],'where':{'id':_0x21dcef['handshake']['query']['id']},'include':[{'model':db[_0xa3e2('0x22')],'as':_0xa3e2('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xa3e2('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa3e2('0x25')],'as':_0xa3e2('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xa3e2('0x27')],'as':_0xa3e2('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xa3e2('0x29')],'as':_0xa3e2('0x2a'),'attributes':['id'],'raw':!![]}]})[_0xa3e2('0x16')](function(_0x2d6d88){if(_0x2d6d88){_0x416730=_0x2d6d88;_0x21dcef[_0x5d63c4](util[_0xa3e2('0x1c')](_0xa3e2('0x1f'),_0x2d6d88[_0xa3e2('0x5')]));var _0x5b63a9=[];switch(_0x2d6d88[_0xa3e2('0x18')]){case'admin':_0x21dcef[_0x5d63c4](_0xa3e2('0x2b'));_0x21dcef[_0x5d63c4](_0xa3e2('0x2c'));if(queryQueues['hasOwnProperty'](_0xa3e2('0x2d'))){delete queryQueues[_0xa3e2('0x2d')];}_0x5b63a9['push'](db[_0xa3e2('0x2e')][_0xa3e2('0x12')](queryQueues));_0x5b63a9[_0xa3e2('0x2f')](db[_0xa3e2('0x30')][_0xa3e2('0x12')](queryQueues));_0x5b63a9[_0xa3e2('0x2f')](db[_0xa3e2('0x31')][_0xa3e2('0x12')](queryQueues));_0x5b63a9['push'](db[_0xa3e2('0x32')][_0xa3e2('0x12')](queryQueues));_0x5b63a9[_0xa3e2('0x2f')](db[_0xa3e2('0x33')][_0xa3e2('0x12')](queryQueues));_0x5b63a9['push'](db['OpenchannelQueue'][_0xa3e2('0x12')](queryQueues));_0x5b63a9[_0xa3e2('0x2f')](db[_0xa3e2('0x34')]['findAll'](queryQueues));_0x5b63a9[_0xa3e2('0x2f')](db[_0xa3e2('0x7')][_0xa3e2('0x12')](queryTelephones));_0x5b63a9['push'](db[_0xa3e2('0x35')]['findAll'](queryTrunks));_0x5b63a9['push'](db[_0xa3e2('0x19')]['findAll'](queryCampaigns));_0x5b63a9['push'](db[_0xa3e2('0x7')][_0xa3e2('0x12')](queryAgents));break;case'user':_0x21dcef[_0x5d63c4](_0xa3e2('0x2b'));_0x21dcef[_0x5d63c4]('voice:outbound');_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0xd'),_0x2d6d88[_0xa3e2('0x21')],_0xa3e2('0x2e')));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0xe'),_0x2d6d88[_0xa3e2('0x21')],_0xa3e2('0x30')));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0x36'),_0x2d6d88['userProfileId'],'FaxQueue'));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0xf'),_0x2d6d88['userProfileId'],'SmsQueue'));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0x10'),_0x2d6d88[_0xa3e2('0x21')],_0xa3e2('0x33')));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0x11'),_0x2d6d88['userProfileId'],_0xa3e2('0x37')));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources('WhatsappQueues',_0x2d6d88[_0xa3e2('0x21')],'WhatsappQueue'));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0x13'),_0x2d6d88[_0xa3e2('0x21')],_0xa3e2('0x7')));_0x5b63a9['push'](getAssociatedResources(_0xa3e2('0x14'),_0x2d6d88[_0xa3e2('0x21')],_0xa3e2('0x35')));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0x38'),_0x2d6d88['userProfileId'],_0xa3e2('0x19')));_0x5b63a9[_0xa3e2('0x2f')](db[_0xa3e2('0x7')]['findAll'](queryAgents));break;case _0xa3e2('0x8'):_0x21dcef[_0x5d63c4](_0xa3e2('0x2b'));_0x21dcef[_0x5d63c4](_0xa3e2('0x2c'));_0x5b63a9[_0xa3e2('0x2f')](_0x2d6d88[_0xa3e2('0x39')]({'attributes':['id','name']}));_0x5b63a9[_0xa3e2('0x2f')](_0x2d6d88[_0xa3e2('0x3a')]({'attributes':['id',_0xa3e2('0x5')]}));_0x5b63a9['push'](_0x2d6d88['getFaxQueues']({'attributes':['id',_0xa3e2('0x5')]}));_0x5b63a9[_0xa3e2('0x2f')](_0x2d6d88['getSmsQueues']({'attributes':['id',_0xa3e2('0x5')]}));_0x5b63a9[_0xa3e2('0x2f')](_0x2d6d88[_0xa3e2('0x3b')]({'attributes':['id',_0xa3e2('0x5')]}));_0x5b63a9[_0xa3e2('0x2f')](_0x2d6d88[_0xa3e2('0x3c')]({'attributes':['id',_0xa3e2('0x5')]}));_0x5b63a9[_0xa3e2('0x2f')](_0x2d6d88[_0xa3e2('0x3d')]({'attributes':['id',_0xa3e2('0x5')]}));break;}return BPromise[_0xa3e2('0x3e')](_0x5b63a9);}})[_0xa3e2('0x16')](function(_0x1c98c0){if(_0x1c98c0&&_0x1c98c0[_0xa3e2('0x1e')]){for(var _0x19e40b=0x0;_0x19e40b<_0x1c98c0[_0xa3e2('0x1e')];_0x19e40b+=0x1){for(var _0x5277ac=0x0;_0x5277ac<_0x1c98c0[_0x19e40b]['length'];_0x5277ac+=0x1){switch(_0x19e40b){case 0x0:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,_0xa3e2('0x3f'),_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x1:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,'chat',_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x2:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,_0xa3e2('0x40'),_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x3:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,_0xa3e2('0x41'),_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x4:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,'mail',_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x5:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,_0xa3e2('0x42'),_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x6:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,_0xa3e2('0x43'),_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x7:if(_0x416730[_0xa3e2('0x18')]!=='agent')_0x21dcef[_0x5d63c4](util[_0xa3e2('0x1c')]('telephone:%s',_0x1c98c0[_0x19e40b][_0x5277ac][_0xa3e2('0x5')]));break;case 0x8:if(_0x416730[_0xa3e2('0x18')]!==_0xa3e2('0x8'))_0x21dcef[_0x5d63c4](util['format'](_0xa3e2('0x44'),_0x1c98c0[_0x19e40b][_0x5277ac][_0xa3e2('0x5')]));break;case 0x9:if(_0x416730['role']!=='agent')_0x21dcef[_0x5d63c4](util[_0xa3e2('0x1c')](_0xa3e2('0x45'),_0x1c98c0[_0x19e40b][_0x5277ac][_0xa3e2('0x1b')],_0x1c98c0[_0x19e40b][_0x5277ac][_0xa3e2('0x5')]));break;case 0xa:_0x21dcef[_0x5d63c4](util[_0xa3e2('0x1c')](_0xa3e2('0x1f'),_0x1c98c0[_0x19e40b][_0x5277ac]['name']));break;}}}}})[_0xa3e2('0x16')](function(){if(_0x5d63c4==='leave'){var _0x48aff7=_['map'](_0x416730[_0xa3e2('0x23')],'id');return _0x416730[_0xa3e2('0x46')](_0x48aff7)[_0xa3e2('0x16')](function(){for(var _0x5bf3bb=0x0;_0x5bf3bb<_0x48aff7[_0xa3e2('0x1e')];_0x5bf3bb+=0x1){_0x29559c[_0xa3e2('0x47')](_0xa3e2('0x48'),{'ChatInteractionId':Number(_0x48aff7[_0x5bf3bb]),'UserId':Number(_0x416730['id'])});}});}})[_0xa3e2('0x16')](function(){if(_0x5d63c4===_0xa3e2('0x49')){var _0xc31bdd=_[_0xa3e2('0x17')](_0x416730[_0xa3e2('0x4a')],'id');return _0x416730[_0xa3e2('0x4b')](_0xc31bdd)[_0xa3e2('0x16')](function(){for(var _0x1a61d0=0x0;_0x1a61d0<_0xc31bdd[_0xa3e2('0x1e')];_0x1a61d0+=0x1){_0x29559c['emit'](_0xa3e2('0x4c'),{'MailInteractionId':Number(_0xc31bdd[_0x1a61d0]),'UserId':Number(_0x416730['id'])});}});}})[_0xa3e2('0x16')](function(){if(_0x5d63c4===_0xa3e2('0x49')){var _0x3060b5=_['map'](_0x416730[_0xa3e2('0x4d')],'id');return _0x416730['removeFaxInteractions'](_0x3060b5)['then'](function(){for(var _0x1b08b9=0x0;_0x1b08b9<_0x3060b5[_0xa3e2('0x1e')];_0x1b08b9+=0x1){_0x29559c[_0xa3e2('0x47')](_0xa3e2('0x4e'),{'FaxInteractionId':Number(_0x3060b5[_0x1b08b9]),'UserId':Number(_0x416730['id'])});}});}})[_0xa3e2('0x16')](function(){if(_0x5d63c4==='leave'){var _0x341adb=_[_0xa3e2('0x17')](_0x416730[_0xa3e2('0x26')],'id');return _0x416730[_0xa3e2('0x4f')](_0x341adb)[_0xa3e2('0x16')](function(){for(var _0x4d076f=0x0;_0x4d076f<_0x341adb[_0xa3e2('0x1e')];_0x4d076f+=0x1){_0x29559c[_0xa3e2('0x47')](_0xa3e2('0x50'),{'SmsInteractionId':Number(_0x341adb[_0x4d076f]),'UserId':Number(_0x416730['id'])});}});}})[_0xa3e2('0x16')](function(){if(_0x5d63c4===_0xa3e2('0x49')){var _0x16781f=_[_0xa3e2('0x17')](_0x416730['OpenchannelInteractions'],'id');return _0x416730[_0xa3e2('0x51')](_0x16781f)[_0xa3e2('0x16')](function(){for(var _0x46dafd=0x0;_0x46dafd<_0x16781f['length'];_0x46dafd+=0x1){_0x29559c[_0xa3e2('0x47')](_0xa3e2('0x52'),{'OpenchannelInteractionId':Number(_0x16781f[_0x46dafd]),'UserId':Number(_0x416730['id'])});}});}})['then'](function(){if(_0x5d63c4===_0xa3e2('0x49')){var _0x11a225=_[_0xa3e2('0x17')](_0x416730[_0xa3e2('0x2a')],'id');return _0x416730[_0xa3e2('0x53')](_0x11a225)['then'](function(){for(var _0x28136b=0x0;_0x28136b<_0x11a225[_0xa3e2('0x1e')];_0x28136b+=0x1){_0x29559c[_0xa3e2('0x47')](_0xa3e2('0x54'),{'WhatsappInteractionId':Number(_0x11a225[_0x28136b]),'UserId':Number(_0x416730['id'])});}});}})['catch'](function(_0x2b239a){_0x21dcef[_0xa3e2('0x55')](_0x2b239a);});}}function onDisconnect(_0x243b68,_0x47d540){joinOrLeave(_0x243b68,_0xa3e2('0x49'),_0x47d540);}function onConnect(_0x3dfb06){joinOrLeave(_0x3dfb06,_0xa3e2('0x56'));}exports[_0xa3e2('0x57')]=function(_0x19a65c){_0x19a65c['on'](_0xa3e2('0x58'),function(_0x3ffe7d){_0x3ffe7d[_0xa3e2('0x59')](0x0);_0x3ffe7d[_0xa3e2('0x5a')]=_0x3ffe7d['request'][_0xa3e2('0x58')][_0xa3e2('0x5b')]+':'+_0x3ffe7d[_0xa3e2('0x5c')][_0xa3e2('0x58')]['remotePort'];_0x3ffe7d['connectedAt']=new Date();_0x3ffe7d[_0xa3e2('0x55')]=function(_0xb5938b){console[_0xa3e2('0x55')]('SocketIO\x20'+_0x3ffe7d['nsp']['name']+'['+_0x3ffe7d[_0xa3e2('0x5a')]+']',_0xb5938b);};_0x3ffe7d['on'](_0xa3e2('0x5d'),function(){onDisconnect(_0x3ffe7d,_0x19a65c);_0x3ffe7d['log'](_0xa3e2('0x5e'));});onConnect(_0x3ffe7d);_0x3ffe7d[_0xa3e2('0x55')]('CONNECTED');});};
\ No newline at end of file
+var _0xe75a=['MailQueues','OpenchannelQueues','WhatsappQueues','findAll','IvrCampaigns','UserProfileResource','map','where','role','format','%s:queue:%s','length','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','Campaign','user','FaxQueues','FaxQueue','SmsQueues','WhatsappQueue','Trunks','getChatQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','user:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','request','remoteAddress','remotePort','SocketIO\x20','nsp','address','disconnect','CONNECTED','util','bluebird','../mysqldb','./environment','Agents','User','name','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xe75a,0x115));var _0xae75=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0xe75a[_0x888385];return _0x22d5c2;};'use strict';var _=require('lodash');var util=require(_0xae75('0x0'));var BPromise=require(_0xae75('0x1'));var db=require(_0xae75('0x2'))['db'];var config=require(_0xae75('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xae75('0x4'),'model':db[_0xae75('0x5')],'attributes':['id',_0xae75('0x6'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xae75('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0xae75('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0xae75('0x6')],'where':{'role':_0xae75('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xae75('0x9')],'where':{'type':_0xae75('0xa')}};function getAssociatedResources(_0x14712a,_0x2e526c,_0x5ef66c){return db[_0xae75('0xb')][_0xae75('0xc')]({'where':{'name':_0x14712a,'userProfileId':_0x2e526c},'raw':!![]})[_0xae75('0xd')](function(_0xf924a6){if(_0xf924a6){if(_0xf924a6[_0xae75('0xe')]){switch(_0x14712a){case _0xae75('0xf'):case _0xae75('0x10'):case'FaxQueues':case'SmsQueues':case _0xae75('0x11'):case _0xae75('0x12'):case _0xae75('0x13'):return db[_0x5ef66c][_0xae75('0x14')](queryQueues);case'Telephones':return db[_0x5ef66c][_0xae75('0x14')](queryTelephones);case'Trunks':return db[_0x5ef66c][_0xae75('0x14')](queryTrunks);case _0xae75('0x15'):return db[_0x5ef66c][_0xae75('0x14')](queryCampaigns);}}else{return db[_0xae75('0x16')][_0xae75('0x14')]({'attributes':['resourceId'],'where':{'sectionId':_0xf924a6['id']},'raw':!![]})[_0xae75('0xd')](function(_0xf27788){if(_0xf27788){var _0x24275c={'where':{'id':_[_0xae75('0x17')](_0xf27788,'resourceId')},'raw':!![]};switch(_0x5ef66c){case _0xae75('0x5'):_0x24275c[_0xae75('0x18')][_0xae75('0x19')]=_0xae75('0x7');break;case'Campaign':_0x24275c['where'][_0xae75('0x9')]='ivr';break;}return db[_0x5ef66c]['findAll'](_0x24275c);}else{return[];}});}}else{return[];}})['then'](function(_0x51c622){return _0x51c622;});}function joinOrLeaveQueues(_0x3d85c0,_0x537759,_0x155454,_0x2bdb10){_0x3d85c0[_0x537759](util[_0xae75('0x1a')](_0xae75('0x1b'),_0x155454,_0x2bdb10[_0xae75('0x6')]));if(_0x2bdb10[_0xae75('0x4')]){for(var _0x20ab8c=0x0;_0x20ab8c<_0x2bdb10['Agents'][_0xae75('0x1c')];_0x20ab8c+=0x1){_0x3d85c0[_0x537759](util[_0xae75('0x1a')]('user:%s',_0x2bdb10['Agents'][_0x20ab8c][_0xae75('0x6')]));}}}function joinOrLeave(_0x584b41,_0x2303ad,_0x155189){var _0x350ff9;if(_0x584b41[_0xae75('0x1d')][_0xae75('0x1e')]['id']){db[_0xae75('0x5')][_0xae75('0x1f')]({'attributes':['id',_0xae75('0x6'),_0xae75('0x19'),_0xae75('0x20')],'where':{'id':_0x584b41[_0xae75('0x1d')][_0xae75('0x1e')]['id']},'include':[{'model':db[_0xae75('0x21')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xae75('0x22')],'as':_0xae75('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xae75('0x24')],'as':_0xae75('0x25'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xae75('0x26'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xae75('0x27'),'attributes':['id'],'raw':!![]}]})[_0xae75('0xd')](function(_0x3b5437){if(_0x3b5437){_0x350ff9=_0x3b5437;_0x584b41[_0x2303ad](util[_0xae75('0x1a')]('user:%s',_0x3b5437['name']));var _0x3d5838=[];switch(_0x3b5437[_0xae75('0x19')]){case _0xae75('0x28'):_0x584b41[_0x2303ad](_0xae75('0x29'));_0x584b41[_0x2303ad](_0xae75('0x2a'));if(queryQueues[_0xae75('0x2b')]('include')){delete queryQueues[_0xae75('0x2c')];}_0x3d5838[_0xae75('0x2d')](db[_0xae75('0x2e')]['findAll'](queryQueues));_0x3d5838[_0xae75('0x2d')](db[_0xae75('0x2f')][_0xae75('0x14')](queryQueues));_0x3d5838[_0xae75('0x2d')](db['FaxQueue'][_0xae75('0x14')](queryQueues));_0x3d5838[_0xae75('0x2d')](db[_0xae75('0x30')][_0xae75('0x14')](queryQueues));_0x3d5838[_0xae75('0x2d')](db[_0xae75('0x31')]['findAll'](queryQueues));_0x3d5838[_0xae75('0x2d')](db[_0xae75('0x32')][_0xae75('0x14')](queryQueues));_0x3d5838[_0xae75('0x2d')](db['WhatsappQueue'][_0xae75('0x14')](queryQueues));_0x3d5838['push'](db[_0xae75('0x5')]['findAll'](queryTelephones));_0x3d5838[_0xae75('0x2d')](db[_0xae75('0x33')][_0xae75('0x14')](queryTrunks));_0x3d5838[_0xae75('0x2d')](db[_0xae75('0x34')][_0xae75('0x14')](queryCampaigns));_0x3d5838[_0xae75('0x2d')](db[_0xae75('0x5')][_0xae75('0x14')](queryAgents));break;case _0xae75('0x35'):_0x584b41[_0x2303ad](_0xae75('0x29'));_0x584b41[_0x2303ad](_0xae75('0x2a'));_0x3d5838['push'](getAssociatedResources(_0xae75('0xf'),_0x3b5437[_0xae75('0x20')],_0xae75('0x2e')));_0x3d5838['push'](getAssociatedResources(_0xae75('0x10'),_0x3b5437[_0xae75('0x20')],_0xae75('0x2f')));_0x3d5838['push'](getAssociatedResources(_0xae75('0x36'),_0x3b5437[_0xae75('0x20')],_0xae75('0x37')));_0x3d5838[_0xae75('0x2d')](getAssociatedResources(_0xae75('0x38'),_0x3b5437['userProfileId'],_0xae75('0x30')));_0x3d5838[_0xae75('0x2d')](getAssociatedResources(_0xae75('0x11'),_0x3b5437['userProfileId'],_0xae75('0x31')));_0x3d5838['push'](getAssociatedResources(_0xae75('0x12'),_0x3b5437[_0xae75('0x20')],'OpenchannelQueue'));_0x3d5838[_0xae75('0x2d')](getAssociatedResources(_0xae75('0x13'),_0x3b5437[_0xae75('0x20')],_0xae75('0x39')));_0x3d5838[_0xae75('0x2d')](getAssociatedResources('Telephones',_0x3b5437[_0xae75('0x20')],_0xae75('0x5')));_0x3d5838[_0xae75('0x2d')](getAssociatedResources(_0xae75('0x3a'),_0x3b5437[_0xae75('0x20')],_0xae75('0x33')));_0x3d5838[_0xae75('0x2d')](getAssociatedResources(_0xae75('0x15'),_0x3b5437[_0xae75('0x20')],_0xae75('0x34')));_0x3d5838[_0xae75('0x2d')](db[_0xae75('0x5')][_0xae75('0x14')](queryAgents));break;case _0xae75('0x8'):_0x584b41[_0x2303ad]('voice:inbound');_0x584b41[_0x2303ad](_0xae75('0x2a'));_0x3d5838['push'](_0x3b5437['getVoiceQueues']({'attributes':['id',_0xae75('0x6')]}));_0x3d5838[_0xae75('0x2d')](_0x3b5437[_0xae75('0x3b')]({'attributes':['id',_0xae75('0x6')]}));_0x3d5838[_0xae75('0x2d')](_0x3b5437['getFaxQueues']({'attributes':['id',_0xae75('0x6')]}));_0x3d5838[_0xae75('0x2d')](_0x3b5437[_0xae75('0x3c')]({'attributes':['id',_0xae75('0x6')]}));_0x3d5838['push'](_0x3b5437['getMailQueues']({'attributes':['id',_0xae75('0x6')]}));_0x3d5838[_0xae75('0x2d')](_0x3b5437[_0xae75('0x3d')]({'attributes':['id',_0xae75('0x6')]}));_0x3d5838['push'](_0x3b5437[_0xae75('0x3e')]({'attributes':['id',_0xae75('0x6')]}));break;}return BPromise[_0xae75('0x3f')](_0x3d5838);}})[_0xae75('0xd')](function(_0xb7ded7){if(_0xb7ded7&&_0xb7ded7['length']){for(var _0x14bab3=0x0;_0x14bab3<_0xb7ded7['length'];_0x14bab3+=0x1){for(var _0x352b27=0x0;_0x352b27<_0xb7ded7[_0x14bab3]['length'];_0x352b27+=0x1){switch(_0x14bab3){case 0x0:joinOrLeaveQueues(_0x584b41,_0x2303ad,_0xae75('0x40'),_0xb7ded7[_0x14bab3][_0x352b27]);break;case 0x1:joinOrLeaveQueues(_0x584b41,_0x2303ad,_0xae75('0x41'),_0xb7ded7[_0x14bab3][_0x352b27]);break;case 0x2:joinOrLeaveQueues(_0x584b41,_0x2303ad,_0xae75('0x42'),_0xb7ded7[_0x14bab3][_0x352b27]);break;case 0x3:joinOrLeaveQueues(_0x584b41,_0x2303ad,_0xae75('0x43'),_0xb7ded7[_0x14bab3][_0x352b27]);break;case 0x4:joinOrLeaveQueues(_0x584b41,_0x2303ad,'mail',_0xb7ded7[_0x14bab3][_0x352b27]);break;case 0x5:joinOrLeaveQueues(_0x584b41,_0x2303ad,_0xae75('0x44'),_0xb7ded7[_0x14bab3][_0x352b27]);break;case 0x6:joinOrLeaveQueues(_0x584b41,_0x2303ad,_0xae75('0x45'),_0xb7ded7[_0x14bab3][_0x352b27]);break;case 0x7:if(_0x350ff9[_0xae75('0x19')]!==_0xae75('0x8'))_0x584b41[_0x2303ad](util['format'](_0xae75('0x46'),_0xb7ded7[_0x14bab3][_0x352b27][_0xae75('0x6')]));break;case 0x8:if(_0x350ff9['role']!=='agent')_0x584b41[_0x2303ad](util[_0xae75('0x1a')](_0xae75('0x47'),_0xb7ded7[_0x14bab3][_0x352b27][_0xae75('0x6')]));break;case 0x9:if(_0x350ff9[_0xae75('0x19')]!==_0xae75('0x8'))_0x584b41[_0x2303ad](util[_0xae75('0x1a')](_0xae75('0x48'),_0xb7ded7[_0x14bab3][_0x352b27]['type'],_0xb7ded7[_0x14bab3][_0x352b27][_0xae75('0x6')]));break;case 0xa:_0x584b41[_0x2303ad](util[_0xae75('0x1a')](_0xae75('0x49'),_0xb7ded7[_0x14bab3][_0x352b27]['name']));break;}}}}})[_0xae75('0xd')](function(){if(_0x2303ad===_0xae75('0x4a')){var _0x20fc3c=_[_0xae75('0x17')](_0x350ff9['ChatInteractions'],'id');return _0x350ff9[_0xae75('0x4b')](_0x20fc3c)[_0xae75('0xd')](function(){for(var _0x4f79ec=0x0;_0x4f79ec<_0x20fc3c['length'];_0x4f79ec+=0x1){_0x155189['emit'](_0xae75('0x4c'),{'ChatInteractionId':Number(_0x20fc3c[_0x4f79ec]),'UserId':Number(_0x350ff9['id'])});}});}})[_0xae75('0xd')](function(){if(_0x2303ad===_0xae75('0x4a')){var _0x370762=_[_0xae75('0x17')](_0x350ff9[_0xae75('0x23')],'id');return _0x350ff9[_0xae75('0x4d')](_0x370762)[_0xae75('0xd')](function(){for(var _0x209882=0x0;_0x209882<_0x370762['length'];_0x209882+=0x1){_0x155189[_0xae75('0x4e')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x370762[_0x209882]),'UserId':Number(_0x350ff9['id'])});}});}})['then'](function(){if(_0x2303ad===_0xae75('0x4a')){var _0x54d652=_[_0xae75('0x17')](_0x350ff9[_0xae75('0x25')],'id');return _0x350ff9[_0xae75('0x4f')](_0x54d652)[_0xae75('0xd')](function(){for(var _0x11fe8c=0x0;_0x11fe8c<_0x54d652[_0xae75('0x1c')];_0x11fe8c+=0x1){_0x155189['emit'](_0xae75('0x50'),{'FaxInteractionId':Number(_0x54d652[_0x11fe8c]),'UserId':Number(_0x350ff9['id'])});}});}})[_0xae75('0xd')](function(){if(_0x2303ad===_0xae75('0x4a')){var _0x5424d7=_['map'](_0x350ff9[_0xae75('0x51')],'id');return _0x350ff9[_0xae75('0x52')](_0x5424d7)[_0xae75('0xd')](function(){for(var _0x2201a6=0x0;_0x2201a6<_0x5424d7[_0xae75('0x1c')];_0x2201a6+=0x1){_0x155189[_0xae75('0x4e')](_0xae75('0x53'),{'SmsInteractionId':Number(_0x5424d7[_0x2201a6]),'UserId':Number(_0x350ff9['id'])});}});}})[_0xae75('0xd')](function(){if(_0x2303ad===_0xae75('0x4a')){var _0x476f71=_[_0xae75('0x17')](_0x350ff9[_0xae75('0x26')],'id');return _0x350ff9['removeOpenchannelInteractions'](_0x476f71)[_0xae75('0xd')](function(){for(var _0x310ee4=0x0;_0x310ee4<_0x476f71['length'];_0x310ee4+=0x1){_0x155189[_0xae75('0x4e')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x476f71[_0x310ee4]),'UserId':Number(_0x350ff9['id'])});}});}})[_0xae75('0xd')](function(){if(_0x2303ad===_0xae75('0x4a')){var _0x29e966=_['map'](_0x350ff9[_0xae75('0x27')],'id');return _0x350ff9['removeWhatsappInteractions'](_0x29e966)[_0xae75('0xd')](function(){for(var _0x4b53ac=0x0;_0x4b53ac<_0x29e966[_0xae75('0x1c')];_0x4b53ac+=0x1){_0x155189[_0xae75('0x4e')](_0xae75('0x54'),{'WhatsappInteractionId':Number(_0x29e966[_0x4b53ac]),'UserId':Number(_0x350ff9['id'])});}});}})[_0xae75('0x55')](function(_0x2f67ef){_0x584b41[_0xae75('0x56')](_0x2f67ef);});}}function onDisconnect(_0x4c4288,_0x5863f7){joinOrLeave(_0x4c4288,'leave',_0x5863f7);}function onConnect(_0x54b54a){joinOrLeave(_0x54b54a,_0xae75('0x57'));}exports[_0xae75('0x58')]=function(_0x5a086f){_0x5a086f['on'](_0xae75('0x59'),function(_0x4c8e03){_0x4c8e03['setMaxListeners'](0x0);_0x4c8e03['address']=_0x4c8e03[_0xae75('0x5a')][_0xae75('0x59')][_0xae75('0x5b')]+':'+_0x4c8e03['request'][_0xae75('0x59')][_0xae75('0x5c')];_0x4c8e03['connectedAt']=new Date();_0x4c8e03['log']=function(_0x74b0dc){console['log'](_0xae75('0x5d')+_0x4c8e03[_0xae75('0x5e')][_0xae75('0x6')]+'['+_0x4c8e03[_0xae75('0x5f')]+']',_0x74b0dc);};_0x4c8e03['on'](_0xae75('0x60'),function(){onDisconnect(_0x4c8e03,_0x5a086f);_0x4c8e03[_0xae75('0x56')]('DISCONNECTED');});onConnect(_0x4c8e03);_0x4c8e03[_0xae75('0x56')](_0xae75('0x61'));});};
\ No newline at end of file
index f84ec5b..3da8c47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fc2=['FaxMessage','Mail','MailInteraction','substatus','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','info','error','catch','channel','motionChannel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','then','contact','User','UserId','name','email','format','SIP/%s','agent','incomingmessage','outgoingmessage','get','opened','ContactId','changed','closed','SELECT','find','fullname','internal','query','interface','default','model','hook','condition','util','../../mysqldb','jayson/promise','../logger','lodash','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0fc2,0x6e));var _0x20fc=function(_0x50774f,_0x452c78){_0x50774f=_0x50774f-0x0;var _0x4f1e92=_0x0fc2[_0x50774f];return _0x4f1e92;};'use strict';var util=require(_0x20fc('0x0'));var db=require(_0x20fc('0x1'))['db'];var jayson=require(_0x20fc('0x2'));var logger=require(_0x20fc('0x3'))('triggers');var _=require(_0x20fc('0x4'));var client=jayson[_0x20fc('0x5')][_0x20fc('0x6')]({'port':0x232a});var triggers=[{'channel':_0x20fc('0x7'),'model':_0x20fc('0x8'),'event':_0x20fc('0x9'),'condition':_0x20fc('0xa'),'callback':afterCreate},{'channel':_0x20fc('0x7'),'model':_0x20fc('0x8'),'event':_0x20fc('0xb'),'condition':_0x20fc('0xc'),'callback':afterUpdate},{'channel':_0x20fc('0x7'),'model':_0x20fc('0xd'),'event':_0x20fc('0x9'),'condition':_0x20fc('0xe'),'callback':afterCreateMessage},{'channel':_0x20fc('0xf'),'model':'SmsInteraction','event':_0x20fc('0x9'),'condition':_0x20fc('0xa'),'callback':afterCreate},{'channel':_0x20fc('0xf'),'model':'SmsInteraction','event':_0x20fc('0xb'),'condition':_0x20fc('0xc'),'callback':afterUpdate},{'channel':_0x20fc('0xf'),'model':_0x20fc('0x10'),'event':_0x20fc('0x9'),'condition':_0x20fc('0xe'),'callback':afterCreateMessage},{'channel':_0x20fc('0x11'),'model':_0x20fc('0x12'),'event':'afterCreate','condition':_0x20fc('0xa'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x20fc('0x12'),'event':'afterUpdate','condition':_0x20fc('0xc'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x20fc('0x13'),'event':_0x20fc('0x9'),'condition':_0x20fc('0xe'),'callback':afterCreateMessage},{'channel':_0x20fc('0x14'),'model':_0x20fc('0x15'),'event':_0x20fc('0x9'),'condition':_0x20fc('0xa'),'callback':afterCreate},{'channel':_0x20fc('0x14'),'model':'FaxInteraction','event':'afterUpdate','condition':_0x20fc('0xc'),'callback':afterUpdate},{'channel':_0x20fc('0x14'),'model':_0x20fc('0x16'),'event':_0x20fc('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x20fc('0x17'),'model':_0x20fc('0x18'),'event':_0x20fc('0x9'),'condition':_0x20fc('0xa'),'callback':afterCreate},{'channel':_0x20fc('0x17'),'model':_0x20fc('0x18'),'event':_0x20fc('0xb'),'condition':_0x20fc('0xc'),'callback':afterUpdate},{'channel':_0x20fc('0x17'),'model':_0x20fc('0x18'),'event':'substatus','condition':_0x20fc('0x19'),'callback':afterUpdate},{'channel':_0x20fc('0x17'),'model':'MailMessage','event':_0x20fc('0x9'),'condition':_0x20fc('0xe'),'callback':afterCreateMessage},{'channel':_0x20fc('0x1a'),'model':_0x20fc('0x1b'),'event':_0x20fc('0x9'),'condition':_0x20fc('0xa'),'callback':afterCreate},{'channel':_0x20fc('0x1a'),'model':'OpenchannelInteraction','event':_0x20fc('0xb'),'condition':_0x20fc('0xc'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x20fc('0x1c'),'event':_0x20fc('0x9'),'condition':_0x20fc('0xe'),'callback':afterCreateMessage}];function request(_0x2ed63f){return client['request'](_0x20fc('0x1d'),_0x2ed63f)['then'](function(_0x4f9b49){logger[_0x20fc('0x1e')]('Trigger,\x20%s',_0x20fc('0x1d'),_0x4f9b49);if(_0x4f9b49[_0x20fc('0x1f')]){if(_0x4f9b49[_0x20fc('0x1f')]['code']===0x1f4){logger['error']('Trigger,\x20%s',_0x20fc('0x1d'),_0x4f9b49[_0x20fc('0x1f')]);}}})[_0x20fc('0x20')](function(_0x2c6408){logger['error']('Trigger,\x20%s',_0x20fc('0x1d'),_0x2c6408);});}function afterCreateMessage(_0x18aa2c,_0x4f26d8){return function(_0x5923b1,_0x37fb71){_0x5923b1=_0x5923b1['get']({'plain':!![]});_0x5923b1[_0x20fc('0x21')]=_0x18aa2c;_0x5923b1[_0x20fc('0x22')]=_0x18aa2c;_0x5923b1[_0x20fc('0x23')]=_0x5923b1[_0x20fc('0x24')];var _0x27477a=_0x20fc('0x25')+_0x5923b1['ContactId'];return db[_0x20fc('0x26')]['query'](_0x27477a,{'type':db['Sequelize'][_0x20fc('0x27')]['SELECT'],'raw':!![]})[_0x20fc('0x28')](function(_0x2e2bbd){return _0x2e2bbd;})[_0x20fc('0x28')](function(_0x46aafc){if(_0x46aafc){_0x5923b1[_0x20fc('0x29')]=_0x46aafc[0x0];}if(_0x5923b1['UserId']){return db[_0x20fc('0x2a')]['find']({'where':{'id':_0x5923b1[_0x20fc('0x2b')]},'attributes':['id',_0x20fc('0x2c'),'fullname',_0x20fc('0x2d'),'internal'],'raw':!![]})[_0x20fc('0x28')](function(_0x516641){_0x5923b1['interface']=util[_0x20fc('0x2e')](_0x20fc('0x2f'),_0x516641[_0x20fc('0x2c')]);_0x5923b1[_0x20fc('0x21')]=_0x18aa2c;_0x5923b1[_0x20fc('0x30')]=_0x516641;return request({'event':_0x20fc('0x31'),'message':_0x5923b1});})['catch'](function(_0x437fa7){console[_0x20fc('0x1f')](_0x437fa7);});}else{return request({'event':_0x20fc('0x32'),'message':_0x5923b1});}});};}function afterCreate(_0x1ca486,_0x1ceee3){return function(_0x3ec290,_0x24ea0e){_0x3ec290=_0x3ec290[_0x20fc('0x33')]({'plain':!![]});_0x3ec290['channel']=_0x1ca486;_0x3ec290[_0x20fc('0x22')]=_0x1ca486;_0x3ec290[_0x20fc('0x23')]=_0x20fc('0x34');var _0x147610=_0x20fc('0x25')+_0x3ec290[_0x20fc('0x35')];return db['sequelize']['query'](_0x147610,{'type':db['Sequelize'][_0x20fc('0x27')]['SELECT'],'raw':!![]})[_0x20fc('0x28')](function(_0x245b9c){return _0x245b9c;})[_0x20fc('0x28')](function(_0x49ed2c){if(_0x49ed2c){_0x3ec290[_0x20fc('0x29')]=_0x49ed2c[0x0];}return request({'event':_0x1ceee3,'message':_0x3ec290});});};}function afterUpdate(_0x20cb18,_0x1a91cc){return function(_0xecf581,_0x82c61){if(_0xecf581[_0x20fc('0x36')](_0x20fc('0x37'))&&_0xecf581[_0x20fc('0x37')]){_0xecf581=_0xecf581[_0x20fc('0x33')]({'plain':!![]});_0xecf581[_0x20fc('0x21')]=_0x20cb18;_0xecf581[_0x20fc('0x22')]=_0x20cb18;_0xecf581[_0x20fc('0x23')]='closed';var _0x51a9d0=_0x20fc('0x25')+_0xecf581[_0x20fc('0x35')];return db[_0x20fc('0x26')]['query'](_0x51a9d0,{'type':db['Sequelize'][_0x20fc('0x27')][_0x20fc('0x38')],'raw':!![]})[_0x20fc('0x28')](function(_0x980987){return _0x980987;})['then'](function(_0x4ac1aa){if(_0x4ac1aa){_0xecf581[_0x20fc('0x29')]=_0x4ac1aa[0x0];}if(_0xecf581[_0x20fc('0x2b')]){return db[_0x20fc('0x2a')][_0x20fc('0x39')]({'where':{'id':_0xecf581['UserId']},'attributes':['id','name',_0x20fc('0x3a'),_0x20fc('0x2d'),_0x20fc('0x3b')],'raw':!![]})[_0x20fc('0x28')](function(_0x222b2d){_0xecf581['interface']=util[_0x20fc('0x2e')]('SIP/%s',_0x222b2d[_0x20fc('0x2c')]);_0xecf581[_0x20fc('0x30')]=_0x222b2d;return request({'event':_0x1a91cc,'message':_0xecf581});})[_0x20fc('0x20')](function(_0x42be0a){console[_0x20fc('0x1f')](_0x42be0a);});}else{return request({'event':_0x1a91cc,'message':_0xecf581});}});}else if(_0xecf581[_0x20fc('0x36')](_0x20fc('0x19'))){_0xecf581=_0xecf581[_0x20fc('0x33')]({'plain':!![]});_0xecf581[_0x20fc('0x21')]=_0x20cb18;_0xecf581[_0x20fc('0x23')]=_0x20fc('0x19');var _0x51a9d0=_0x20fc('0x25')+_0xecf581[_0x20fc('0x35')];return db[_0x20fc('0x26')][_0x20fc('0x3c')](_0x51a9d0,{'type':db['Sequelize'][_0x20fc('0x27')][_0x20fc('0x38')],'raw':!![]})[_0x20fc('0x28')](function(_0x282661){return _0x282661;})[_0x20fc('0x28')](function(_0x423c69){if(_0x423c69){_0xecf581[_0x20fc('0x29')]=_0x423c69[0x0];}if(_0xecf581[_0x20fc('0x2b')]){return db[_0x20fc('0x2a')][_0x20fc('0x39')]({'where':{'id':_0xecf581[_0x20fc('0x2b')]},'attributes':['id','name',_0x20fc('0x3a'),_0x20fc('0x2d'),_0x20fc('0x3b')],'raw':!![]})[_0x20fc('0x28')](function(_0x22a11f){_0xecf581[_0x20fc('0x3d')]=util['format'](_0x20fc('0x2f'),_0x22a11f[_0x20fc('0x2c')]);_0xecf581[_0x20fc('0x30')]=_0x22a11f;return request({'event':_0x1a91cc,'message':_0xecf581});})[_0x20fc('0x20')](function(_0x249afe){console[_0x20fc('0x1f')](_0x249afe);});}else{return request({'event':_0x1a91cc,'message':_0xecf581});}});}};}exports[_0x20fc('0x3e')]=function(){for(var _0x1c2977=0x0;_0x1c2977<triggers['length'];_0x1c2977+=0x1){if(db['hasOwnProperty'](triggers[_0x1c2977][_0x20fc('0x3f')])){db[triggers[_0x1c2977][_0x20fc('0x3f')]][_0x20fc('0x40')](triggers[_0x1c2977][_0x20fc('0x23')],triggers[_0x1c2977]['callback'](triggers[_0x1c2977]['channel']['toLowerCase'](),triggers[_0x1c2977][_0x20fc('0x41')]));}}};
\ No newline at end of file
+var _0x47c0=['event','direction','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','UserId','User','find','fullname','email','internal','interface','SIP/%s','name','agent','incomingmessage','outgoingmessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','closed','format','changed','default','length','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','triggers','lodash','client','http','Chat','ChatInteraction','newinteraction','afterUpdate','ChatMessage','afterCreate','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','closedinteraction','FaxMessage','Mail','MailInteraction','substatus','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x47c0,0x1dc));var _0x047c=function(_0x548fa4,_0x3ddebe){_0x548fa4=_0x548fa4-0x0;var _0x1bf717=_0x47c0[_0x548fa4];return _0x1bf717;};'use strict';var util=require(_0x047c('0x0'));var db=require(_0x047c('0x1'))['db'];var jayson=require(_0x047c('0x2'));var logger=require('../logger')(_0x047c('0x3'));var _=require(_0x047c('0x4'));var client=jayson[_0x047c('0x5')][_0x047c('0x6')]({'port':0x232a});var triggers=[{'channel':_0x047c('0x7'),'model':_0x047c('0x8'),'event':'afterCreate','condition':_0x047c('0x9'),'callback':afterCreate},{'channel':'Chat','model':_0x047c('0x8'),'event':_0x047c('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x047c('0x7'),'model':_0x047c('0xb'),'event':_0x047c('0xc'),'condition':_0x047c('0xd'),'callback':afterCreateMessage},{'channel':_0x047c('0xe'),'model':'SmsInteraction','event':_0x047c('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x047c('0xe'),'model':_0x047c('0xf'),'event':_0x047c('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x047c('0xe'),'model':_0x047c('0x10'),'event':_0x047c('0xc'),'condition':_0x047c('0xd'),'callback':afterCreateMessage},{'channel':_0x047c('0x11'),'model':_0x047c('0x12'),'event':_0x047c('0xc'),'condition':_0x047c('0x9'),'callback':afterCreate},{'channel':_0x047c('0x11'),'model':_0x047c('0x12'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Whatsapp','model':_0x047c('0x13'),'event':_0x047c('0xc'),'condition':_0x047c('0xd'),'callback':afterCreateMessage},{'channel':_0x047c('0x14'),'model':'FaxInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':_0x047c('0x15'),'event':_0x047c('0xa'),'condition':_0x047c('0x16'),'callback':afterUpdate},{'channel':'Fax','model':_0x047c('0x17'),'event':_0x047c('0xc'),'condition':_0x047c('0xd'),'callback':afterCreateMessage},{'channel':_0x047c('0x18'),'model':_0x047c('0x19'),'event':_0x047c('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x047c('0x18'),'model':_0x047c('0x19'),'event':_0x047c('0xa'),'condition':_0x047c('0x16'),'callback':afterUpdate},{'channel':_0x047c('0x18'),'model':_0x047c('0x19'),'event':_0x047c('0x1a'),'condition':_0x047c('0x1a'),'callback':afterUpdate},{'channel':_0x047c('0x18'),'model':_0x047c('0x1b'),'event':_0x047c('0xc'),'condition':_0x047c('0xd'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x047c('0x1c'),'event':_0x047c('0xc'),'condition':_0x047c('0x9'),'callback':afterCreate},{'channel':_0x047c('0x1d'),'model':_0x047c('0x1c'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0x047c('0x1e'),'event':_0x047c('0xc'),'condition':_0x047c('0xd'),'callback':afterCreateMessage}];function request(_0x36903f){return client[_0x047c('0x1f')](_0x047c('0x20'),_0x36903f)[_0x047c('0x21')](function(_0x44067a){logger[_0x047c('0x22')](_0x047c('0x23'),_0x047c('0x20'),_0x44067a);if(_0x44067a['error']){if(_0x44067a[_0x047c('0x24')][_0x047c('0x25')]===0x1f4){logger[_0x047c('0x24')](_0x047c('0x23'),'EventManager',_0x44067a[_0x047c('0x24')]);}}})[_0x047c('0x26')](function(_0x147db9){logger[_0x047c('0x24')](_0x047c('0x23'),_0x047c('0x20'),_0x147db9);});}function afterCreateMessage(_0x105ca0,_0x12bf6f){return function(_0x585a62,_0x6a3795){_0x585a62=_0x585a62[_0x047c('0x27')]({'plain':!![]});_0x585a62[_0x047c('0x28')]=_0x105ca0;_0x585a62[_0x047c('0x29')]=_0x105ca0;_0x585a62[_0x047c('0x2a')]=_0x585a62[_0x047c('0x2b')];var _0x48301a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x585a62[_0x047c('0x2c')];return db[_0x047c('0x2d')]['query'](_0x48301a,{'type':db[_0x047c('0x2e')][_0x047c('0x2f')][_0x047c('0x30')],'raw':!![]})[_0x047c('0x21')](function(_0x2ead22){return _0x2ead22;})['then'](function(_0x128f2c){if(_0x128f2c){_0x585a62[_0x047c('0x31')]=_0x128f2c[0x0];}if(_0x585a62[_0x047c('0x32')]){return db[_0x047c('0x33')][_0x047c('0x34')]({'where':{'id':_0x585a62[_0x047c('0x32')]},'attributes':['id','name',_0x047c('0x35'),_0x047c('0x36'),_0x047c('0x37')],'raw':!![]})[_0x047c('0x21')](function(_0x4c6a45){_0x585a62[_0x047c('0x38')]=util['format'](_0x047c('0x39'),_0x4c6a45[_0x047c('0x3a')]);_0x585a62[_0x047c('0x28')]=_0x105ca0;_0x585a62[_0x047c('0x3b')]=_0x4c6a45;return request({'event':_0x047c('0x3c'),'message':_0x585a62});})[_0x047c('0x26')](function(_0x215e26){console[_0x047c('0x24')](_0x215e26);});}else{return request({'event':_0x047c('0x3d'),'message':_0x585a62});}});};}function afterCreate(_0x256c9f,_0x36659e){return function(_0x28c963,_0x22bb2a){_0x28c963=_0x28c963[_0x047c('0x27')]({'plain':!![]});_0x28c963[_0x047c('0x28')]=_0x256c9f;_0x28c963[_0x047c('0x29')]=_0x256c9f;_0x28c963[_0x047c('0x2a')]='opened';var _0x3cb93a=_0x047c('0x3e')+_0x28c963[_0x047c('0x2c')];return db[_0x047c('0x2d')][_0x047c('0x3f')](_0x3cb93a,{'type':db[_0x047c('0x2e')][_0x047c('0x2f')][_0x047c('0x30')],'raw':!![]})[_0x047c('0x21')](function(_0x48f1d7){return _0x48f1d7;})[_0x047c('0x21')](function(_0x351576){if(_0x351576){_0x28c963[_0x047c('0x31')]=_0x351576[0x0];}return request({'event':_0x36659e,'message':_0x28c963});});};}function afterUpdate(_0xd41eb9,_0xbf353b){return function(_0x7efad4,_0x39a2bd){if(_0x7efad4['changed']('closed')&&_0x7efad4[_0x047c('0x40')]){_0x7efad4=_0x7efad4[_0x047c('0x27')]({'plain':!![]});_0x7efad4[_0x047c('0x28')]=_0xd41eb9;_0x7efad4['motionChannel']=_0xd41eb9;_0x7efad4[_0x047c('0x2a')]='closed';var _0x2f43a1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x7efad4[_0x047c('0x2c')];return db['sequelize'][_0x047c('0x3f')](_0x2f43a1,{'type':db[_0x047c('0x2e')][_0x047c('0x2f')][_0x047c('0x30')],'raw':!![]})[_0x047c('0x21')](function(_0xf7e4b0){return _0xf7e4b0;})[_0x047c('0x21')](function(_0x5a2dbc){if(_0x5a2dbc){_0x7efad4[_0x047c('0x31')]=_0x5a2dbc[0x0];}if(_0x7efad4[_0x047c('0x32')]){return db[_0x047c('0x33')]['find']({'where':{'id':_0x7efad4[_0x047c('0x32')]},'attributes':['id','name','fullname',_0x047c('0x36'),_0x047c('0x37')],'raw':!![]})[_0x047c('0x21')](function(_0x78e675){_0x7efad4[_0x047c('0x38')]=util[_0x047c('0x41')](_0x047c('0x39'),_0x78e675[_0x047c('0x3a')]);_0x7efad4['agent']=_0x78e675;return request({'event':_0xbf353b,'message':_0x7efad4});})[_0x047c('0x26')](function(_0x12174e){console['error'](_0x12174e);});}else{return request({'event':_0xbf353b,'message':_0x7efad4});}});}else if(_0x7efad4[_0x047c('0x42')](_0x047c('0x1a'))){_0x7efad4=_0x7efad4[_0x047c('0x27')]({'plain':!![]});_0x7efad4[_0x047c('0x28')]=_0xd41eb9;_0x7efad4['event']=_0x047c('0x1a');var _0x2f43a1=_0x047c('0x3e')+_0x7efad4[_0x047c('0x2c')];return db[_0x047c('0x2d')][_0x047c('0x3f')](_0x2f43a1,{'type':db[_0x047c('0x2e')][_0x047c('0x2f')][_0x047c('0x30')],'raw':!![]})['then'](function(_0x3fb5ae){return _0x3fb5ae;})[_0x047c('0x21')](function(_0x4680cd){if(_0x4680cd){_0x7efad4[_0x047c('0x31')]=_0x4680cd[0x0];}if(_0x7efad4[_0x047c('0x32')]){return db[_0x047c('0x33')][_0x047c('0x34')]({'where':{'id':_0x7efad4[_0x047c('0x32')]},'attributes':['id',_0x047c('0x3a'),'fullname',_0x047c('0x36'),'internal'],'raw':!![]})[_0x047c('0x21')](function(_0x5612f0){_0x7efad4[_0x047c('0x38')]=util[_0x047c('0x41')](_0x047c('0x39'),_0x5612f0[_0x047c('0x3a')]);_0x7efad4['agent']=_0x5612f0;return request({'event':_0xbf353b,'message':_0x7efad4});})[_0x047c('0x26')](function(_0x34553c){console[_0x047c('0x24')](_0x34553c);});}else{return request({'event':_0xbf353b,'message':_0x7efad4});}});}};}exports[_0x047c('0x43')]=function(){for(var _0x394ae4=0x0;_0x394ae4<triggers[_0x047c('0x44')];_0x394ae4+=0x1){if(db['hasOwnProperty'](triggers[_0x394ae4][_0x047c('0x45')])){db[triggers[_0x394ae4][_0x047c('0x45')]][_0x047c('0x46')](triggers[_0x394ae4]['event'],triggers[_0x394ae4][_0x047c('0x47')](triggers[_0x394ae4]['channel'][_0x047c('0x48')](),triggers[_0x394ae4][_0x047c('0x49')]));}}};
\ No newline at end of file
index 583fefd..d73809e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80a7=['Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','blockedAt','updateAttributes','role','agent','User','then','getLicense','agents'];(function(_0x10a96c,_0xd8e7f2){var _0x53e738=function(_0x17009d){while(--_0x17009d){_0x10a96c['push'](_0x10a96c['shift']());}};_0x53e738(++_0xd8e7f2);}(_0x80a7,0x12e));var _0x780a=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0x80a7[_0x218994];return _0x3f350b;};'use strict';var _=require(_0x780a('0x0'));var BPromise=require(_0x780a('0x1'));var db=require(_0x780a('0x2'))['db'];var util=require(_0x780a('0x3'));var channels=[_0x780a('0x4'),'mail',_0x780a('0x5'),_0x780a('0x6'),_0x780a('0x7'),_0x780a('0x8'),_0x780a('0x9')];exports[_0x780a('0xa')]=function(){return channels;};exports[_0x780a('0xb')]=function(_0x5a4acc){_0x5a4acc=_0x5a4acc[_0x780a('0xc')]();return _[_0x780a('0xd')](channels,_0x5a4acc);};exports[_0x780a('0xe')]=function(_0x26b4f9,_0x1d8921,_0x191d6c,_0x44d38d){var _0x3bc935={'loginAttempts':_0x1d8921,'blocked':_0x191d6c};if(!_['isUndefined'](_0x44d38d)){_0x3bc935[_0x780a('0xf')]=_0x44d38d;}return _0x26b4f9[_0x780a('0x10')](_0x3bc935);};exports['getLicense']=function(_0x412ba6){return new BPromise(function(_0x462db4,_0x1add74){var _0x53bce9=0x0;if(_0x412ba6[_0x780a('0x11')]!==_0x780a('0x12')){_0x462db4(_0x412ba6);}db[_0x780a('0x13')]['count']({'where':{'role':_0x780a('0x12'),'online':!![],'id':{'$ne':_0x412ba6['id']}}})[_0x780a('0x14')](function(_0x119739){_0x53bce9=_0x119739;return util[_0x780a('0x15')]();})[_0x780a('0x14')](function(_0x2b3dce){if(_0x2b3dce&&_0x2b3dce[_0x780a('0x16')]&&_0x53bce9>=_0x2b3dce['agents']){throw Error(_0x780a('0x17'));}_0x462db4(_0x412ba6);})[_0x780a('0x18')](function(_0x294683){_0x1add74(_0x294683);});});};
\ No newline at end of file
+var _0x2ef7=['clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','sms','whatsapp','getChannels','toLowerCase','includes'];(function(_0x349270,_0x17a863){var _0x2d7190=function(_0x30922c){while(--_0x30922c){_0x349270['push'](_0x349270['shift']());}};_0x2d7190(++_0x17a863);}(_0x2ef7,0xd0));var _0x72ef=function(_0x4274a4,_0x14b79f){_0x4274a4=_0x4274a4-0x0;var _0x52da6b=_0x2ef7[_0x4274a4];return _0x52da6b;};'use strict';var _=require(_0x72ef('0x0'));var BPromise=require(_0x72ef('0x1'));var db=require(_0x72ef('0x2'))['db'];var util=require(_0x72ef('0x3'));var channels=[_0x72ef('0x4'),_0x72ef('0x5'),_0x72ef('0x6'),'fax',_0x72ef('0x7'),_0x72ef('0x8'),'openchannel'];exports[_0x72ef('0x9')]=function(){return channels;};exports['isValidChannel']=function(_0x318224){_0x318224=_0x318224[_0x72ef('0xa')]();return _[_0x72ef('0xb')](channels,_0x318224);};exports[_0x72ef('0xc')]=function(_0x36dc90,_0x185b53,_0x20adb5,_0x7ff2d5){var _0x56ff80={'loginAttempts':_0x185b53,'blocked':_0x20adb5};if(!_[_0x72ef('0xd')](_0x7ff2d5)){_0x56ff80[_0x72ef('0xe')]=_0x7ff2d5;}return _0x36dc90[_0x72ef('0xf')](_0x56ff80);};exports[_0x72ef('0x10')]=function(_0x596e5b){return new BPromise(function(_0x27d232,_0x5c3be6){var _0x34851d=0x0;if(_0x596e5b[_0x72ef('0x11')]!==_0x72ef('0x12')){_0x27d232(_0x596e5b);}db[_0x72ef('0x13')][_0x72ef('0x14')]({'where':{'role':_0x72ef('0x12'),'online':!![],'id':{'$ne':_0x596e5b['id']}}})[_0x72ef('0x15')](function(_0x44e715){_0x34851d=_0x44e715;return util['getLicense']();})['then'](function(_0x128179){if(_0x128179&&_0x128179['agents']&&_0x34851d>=_0x128179['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x27d232(_0x596e5b);})['catch'](function(_0xd0cc8b){_0x5c3be6(_0xd0cc8b);});});};
\ No newline at end of file
index 4e8cfc1..3d323e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9140=['send','exports','404','status'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x9140,0x185));var _0x0914=function(_0x4b6e7f,_0x5ae553){_0x4b6e7f=_0x4b6e7f-0x0;var _0x289367=_0x9140[_0x4b6e7f];return _0x289367;};'use strict';module[_0x0914('0x0')][0x194]=function pageNotFound(_0x260718,_0xc01fdd){var _0x409f51=_0x0914('0x1');var _0x5df384=0x194;var _0x8b3299={'status':_0x5df384};_0xc01fdd[_0x0914('0x2')](_0x8b3299[_0x0914('0x2')]);_0xc01fdd['render'](_0x409f51,{},function(_0x342dde,_0x282aa7){if(_0x342dde){return _0xc01fdd[_0x0914('0x2')](_0x8b3299[_0x0914('0x2')])['json'](_0x8b3299);}_0xc01fdd[_0x0914('0x3')](_0x282aa7);});};
\ No newline at end of file
+var _0x3a6d=['status','render','json','send','exports','404'];(function(_0xb15182,_0x48d8fb){var _0x4a8749=function(_0x28684d){while(--_0x28684d){_0xb15182['push'](_0xb15182['shift']());}};_0x4a8749(++_0x48d8fb);}(_0x3a6d,0x196));var _0xd3a6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3a6d[_0x321bb2];return _0x9c12ed;};'use strict';module[_0xd3a6('0x0')][0x194]=function pageNotFound(_0x94c96a,_0x371046){var _0x43b216=_0xd3a6('0x1');var _0x4e3858=0x194;var _0x3ed980={'status':_0x4e3858};_0x371046[_0xd3a6('0x2')](_0x3ed980[_0xd3a6('0x2')]);_0x371046[_0xd3a6('0x3')](_0x43b216,{},function(_0x26c088,_0x9abfad){if(_0x26c088){return _0x371046[_0xd3a6('0x2')](_0x3ed980['status'])[_0xd3a6('0x4')](_0x3ed980);}_0x371046[_0xd3a6('0x5')](_0x9abfad);});};
\ No newline at end of file
index b71956c..bf21a87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6c8=['../api/userProfile/userProfile.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','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','Recordings','Extensions','HopperFinals','OpenchannelInteraction','ChatInteraction','ChatInteractions','FaxInteractions','WhatsappInteractions','belongsTo','userProfileId','belongsToMany','Groups','Contacts','cm_user_has_contacts','Lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoicePrefix','MailQueues','UserMailQueue','ChatQueues','FaxQueues','UserSmsQueue','OpenchannelQueue','UserWhatsappQueue','cm_user_has_lists','FaxAccount','FaxAccounts','MailAccounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','ChanSpyId','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','ContactId','MailAccountId','Imap','Answers','Interactions','List','ListId','TemplateId','Agents','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Contact','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','IntervalId','TagId','MailQueueReport','Items','FaxAccountId','Applications','Exntensions','user_has_fax_accounts','FaxInteractionId','Owner','fax_interaction_has_tags','AttachmentId','Dispositions','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatMessage','user_has_chat_websites','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','chat_group_has_users','CompanyId','Hoppers','OpenchannelInteractions','MailInteractions','Company','cm_contact_has_tags','Agent','CampaignId','OwnerId','All','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','SubjectId','FieldId','Subject','Description','DescriptionId','Field','VariableId','Subjects','SugarcrmAccount','DeskAccount','Descriptions','int_desk_configuration_has_tags','ZohoField','int_zendesk_configuration_has_tags','ServicenowConfiguration','FromId','ToId','SessionId','SmsQueueReport','JscriptyQuestionReport','ProjectId','team_has_fax_queues','SmsQueues','team_has_whatsapp_queues','WhatsappQueues','VoicePrefixes','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ToUserId','ToAgent','ToChatQueueId','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','voice_queues_has_cm_lists','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xC@LL1234','mysql','utf8mb4','utf8_general_ci','sequelizeHistory','127.0.0.1','name','utf8','password','options','database','username','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile'];(function(_0x584b82,_0x31580f){var _0x32e41d=function(_0x3d5b4d){while(--_0x3d5b4d){_0x584b82['push'](_0x584b82['shift']());}};_0x32e41d(++_0x31580f);}(_0xf6c8,0xf6));var _0x8f6c=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xf6c8[_0x2cf2e9];return _0xd3670d;};'use strict';var config=require(_0x8f6c('0x0'));var Sequelize=require(_0x8f6c('0x1'));var _=require(_0x8f6c('0x2'));var jstz=require(_0x8f6c('0x3'));var timezone=jstz['determine']();config[_0x8f6c('0x1')]=_[_0x8f6c('0x4')](config[_0x8f6c('0x1')],{'database':_0x8f6c('0x5'),'username':'xcall','password':_0x8f6c('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x8f6c('0x7'),'dialectOptions':{'charset':_0x8f6c('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x8f6c('0x9')}}});config[_0x8f6c('0xa')]=_[_0x8f6c('0x4')](config['sequelizeHistory'],{'database':_0x8f6c('0x5'),'username':'xcall','password':_0x8f6c('0x6'),'options':{'host':_0x8f6c('0xb'),'port':0xcea,'dialect':_0x8f6c('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x8f6c('0xc')](),'define':{'charset':_0x8f6c('0xd'),'collate':_0x8f6c('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8f6c('0x1')]['database'],config[_0x8f6c('0x1')]['username'],config['sequelize'][_0x8f6c('0xe')],config[_0x8f6c('0x1')][_0x8f6c('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8f6c('0xa')][_0x8f6c('0x10')],config[_0x8f6c('0xa')][_0x8f6c('0x11')],config['sequelizeHistory'][_0x8f6c('0xe')],config[_0x8f6c('0xa')][_0x8f6c('0xf')])};db[_0x8f6c('0x12')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x14'));db['VoiceChanSpy']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x15'));db[_0x8f6c('0x16')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x17'));db[_0x8f6c('0x18')]=db['sequelize'][_0x8f6c('0x13')]('../api/voiceExtension/voiceExtension.model');db[_0x8f6c('0x19')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x1a'));db[_0x8f6c('0x1b')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x1c'));db[_0x8f6c('0x1d')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x1e'));db[_0x8f6c('0x1f')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x20'));db[_0x8f6c('0x21')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x22'));db[_0x8f6c('0x23')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x24'));db[_0x8f6c('0x25')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x26'));db[_0x8f6c('0x27')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x8f6c('0x28')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x8f6c('0x29')]=db['sequelize']['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0x8f6c('0x2a')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x2b'));db[_0x8f6c('0x2c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x2d'));db[_0x8f6c('0x2e')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x8f6c('0x2f')]=db['sequelize'][_0x8f6c('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x8f6c('0x30')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x31'));db[_0x8f6c('0x32')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x33'));db['UserMailQueue']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x34'));db[_0x8f6c('0x35')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x36'));db['UserSmsQueue']=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0x8f6c('0x37')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x38'));db['UserWhatsappQueue']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x39'));db[_0x8f6c('0x3a')]=db['sequelize']['import'](_0x8f6c('0x3b'));db[_0x8f6c('0x3c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x3d'));db[_0x8f6c('0x3e')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x3f'));db[_0x8f6c('0x40')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x41'));db['MailSubstatus']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x42'));db[_0x8f6c('0x43')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x44'));db[_0x8f6c('0x45')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x46'));db[_0x8f6c('0x47')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x48'));db['MailQueueReport']=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x49'));db[_0x8f6c('0x4a')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x4b'));db[_0x8f6c('0x4c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x4d'));db['FaxAccount']=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x4e'));db[_0x8f6c('0x4f')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x50'));db[_0x8f6c('0x51')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x8f6c('0x52')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x53'));db[_0x8f6c('0x54')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x55'));db[_0x8f6c('0x56')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x57'));db['SmsAccount']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x58'));db[_0x8f6c('0x59')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x5a'));db[_0x8f6c('0x5b')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x5c'));db[_0x8f6c('0x5d')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x5e'));db[_0x8f6c('0x5f')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x60'));db['OpenchannelAccount']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x61'));db[_0x8f6c('0x62')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x63'));db['OpenchannelInteraction']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x64'));db[_0x8f6c('0x65')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x66'));db['OpenchannelQueue']=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x8f6c('0x67')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x68'));db[_0x8f6c('0x69')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x6a'));db[_0x8f6c('0x6b')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x6c'));db['ChatInteraction']=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x6d'));db['ChatMessage']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x6e'));db['ChatOfflineMessage']=db['sequelize']['import'](_0x8f6c('0x6f'));db[_0x8f6c('0x70')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x71'));db[_0x8f6c('0x72')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x73'));db[_0x8f6c('0x74')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x75'));db[_0x8f6c('0x76')]=db['sequelize'][_0x8f6c('0x13')]('../api/cmCompany/cmCompany.model');db[_0x8f6c('0x77')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x78'));db[_0x8f6c('0x79')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/cmHopper/cmHopper.model');db[_0x8f6c('0x7a')]=db[_0x8f6c('0x1')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0x8f6c('0x7b')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x7c'));db[_0x8f6c('0x7d')]=db[_0x8f6c('0x1')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0x8f6c('0x7e')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x7f'));db[_0x8f6c('0x80')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x81'));db[_0x8f6c('0x82')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x83'));db[_0x8f6c('0x84')]=db[_0x8f6c('0x1')]['import']('../api/automation/automation.model');db[_0x8f6c('0x85')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x86'));db[_0x8f6c('0x87')]=db['sequelize'][_0x8f6c('0x13')]('../api/disposition/disposition.model');db[_0x8f6c('0x88')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x89'));db[_0x8f6c('0x8a')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x8b'));db['Pause']=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/pause/pause.model');db[_0x8f6c('0x8c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x8d'));db[_0x8f6c('0x8e')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x8f'));db[_0x8f6c('0x90')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x91'));db[_0x8f6c('0x92')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x93'));db[_0x8f6c('0x94')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x95'));db[_0x8f6c('0x96')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x97'));db[_0x8f6c('0x98')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x99'));db['Integration']=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/integration/integration.model');db[_0x8f6c('0x9a')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x9b'));db[_0x8f6c('0x9c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x9d'));db[_0x8f6c('0x9e')]=db['sequelize'][_0x8f6c('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x8f6c('0x9f')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xa0'));db[_0x8f6c('0xa1')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xa2'));db[_0x8f6c('0xa3')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xa4'));db[_0x8f6c('0xa5')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xa6'));db[_0x8f6c('0xa7')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xa8'));db[_0x8f6c('0xa9')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xaa'));db[_0x8f6c('0xab')]=db['sequelize']['import'](_0x8f6c('0xac'));db[_0x8f6c('0xad')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xae'));db['DeskAccount']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xaf'));db[_0x8f6c('0xb0')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xb1'));db[_0x8f6c('0xb2')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xb3'));db[_0x8f6c('0xb4')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xb5'));db[_0x8f6c('0xb6')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xb7'));db['ZohoField']=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/intZohoField/intZohoField.model');db[_0x8f6c('0xb8')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x8f6c('0xb9')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xba'));db[_0x8f6c('0xbb')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xbc'));db[_0x8f6c('0xbd')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xbe'));db[_0x8f6c('0xbf')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xc0'));db[_0x8f6c('0xc1')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xc2'));db[_0x8f6c('0xc3')]=db['sequelize']['import'](_0x8f6c('0xc4'));db[_0x8f6c('0xc5')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xc6'));db[_0x8f6c('0xc7')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xc8'));db[_0x8f6c('0xc9')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xca'));db['ServicenowConfiguration']=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xcb'));db[_0x8f6c('0xcc')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xcd'));db[_0x8f6c('0xce')]=db['sequelize'][_0x8f6c('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x8f6c('0xcf')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xd0'));db[_0x8f6c('0xd1')]=db[_0x8f6c('0x1')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x8f6c('0xd2')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xd3'));db[_0x8f6c('0xd4')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xd5'));db[_0x8f6c('0xd6')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x8f6c('0xd7')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/integration/integration.model');db[_0x8f6c('0xd8')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xd9'));db[_0x8f6c('0xda')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xdb'));db[_0x8f6c('0xdc')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xdd'));db[_0x8f6c('0xde')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xdf'));db['JscriptyQuestionReport']=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xe0'));db[_0x8f6c('0xe1')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xe2'));db['SmsQueueReport']=db[_0x8f6c('0x1')]['import']('../api/smsQueueReport/smsQueueReport.model');db[_0x8f6c('0xe3')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xe4'));db['SquareDetailsReport']=db[_0x8f6c('0x1')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0x8f6c('0xe5')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xe6'));db[_0x8f6c('0xe7')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xe8'));db['SquareOdbc']=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xe9'));db[_0x8f6c('0xea')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xeb'));db[_0x8f6c('0xec')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xed'));db[_0x8f6c('0xee')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xef'));db['Team']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xf0'));db[_0x8f6c('0xf1')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xf2'));db[_0x8f6c('0xf3')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/campaign/campaign.model');db[_0x8f6c('0xf4')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xf5'));db[_0x8f6c('0xf6')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/attachment/attachment.model');db[_0x8f6c('0xf7')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xf8'));db[_0x8f6c('0xf9')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xfa'));db[_0x8f6c('0xfb')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xfc'));db[_0x8f6c('0xfd')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xfe'));db[_0x8f6c('0xff')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x100'));db[_0x8f6c('0x101')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x102'));db[_0x8f6c('0x103')]=db['sequelize'][_0x8f6c('0x13')]('../api/cmList/cmList.model');db[_0x8f6c('0x104')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x105'));db[_0x8f6c('0x106')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x107'));db['UserProfileSection']=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/userProfileSection/userProfileSection.model');db[_0x8f6c('0x108')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x109'));db[_0x8f6c('0x10a')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x10b'));db[_0x8f6c('0x10c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x10d'));db[_0x8f6c('0x10e')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x10f'));db[_0x8f6c('0x110')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x111'));db[_0x8f6c('0x112')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x113'));db[_0x8f6c('0x114')]=db[_0x8f6c('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x8f6c('0x115')]=db[_0x8f6c('0x1')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x8f6c('0x116')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x117'));db[_0x8f6c('0x118')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x119'));db[_0x8f6c('0x11a')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x11b'));db[_0x8f6c('0x11c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x11d'));db['UserVoicePrefix']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x11e'));db[_0x8f6c('0x12')][_0x8f6c('0x11f')](db[_0x8f6c('0x21')],{'as':_0x8f6c('0x21'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x121')});db['User'][_0x8f6c('0x122')](db['VoiceRecording'],{'as':_0x8f6c('0x123'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x12')][_0x8f6c('0x122')](db[_0x8f6c('0x2f')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0x8f6c('0x12')]['hasMany'](db[_0x8f6c('0x18')],{'as':_0x8f6c('0x124'),'onDelete':_0x8f6c('0x120'),'hooks':!![]});db[_0x8f6c('0x12')][_0x8f6c('0x122')](db[_0x8f6c('0x7b')],{'as':_0x8f6c('0x125'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x12')][_0x8f6c('0x122')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x12')][_0x8f6c('0x122')](db[_0x8f6c('0x7e')],{'as':_0x8f6c('0x7e'),'foreignKey':'UserId'});db[_0x8f6c('0x12')][_0x8f6c('0x122')](db[_0x8f6c('0x126')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0x8f6c('0x12')]['hasMany'](db[_0x8f6c('0x127')],{'as':_0x8f6c('0x128'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x12')][_0x8f6c('0x122')](db[_0x8f6c('0x5b')],{'as':'SmsInteractions','foreignKey':_0x8f6c('0x121')});db['User'][_0x8f6c('0x122')](db[_0x8f6c('0x51')],{'as':_0x8f6c('0x129'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x12')]['hasMany'](db[_0x8f6c('0x43')],{'as':'MailInteractions','foreignKey':_0x8f6c('0x121')});db['User']['hasMany'](db[_0x8f6c('0x110')],{'as':_0x8f6c('0x12a'),'foreignKey':_0x8f6c('0x121')});db['User']['hasMany'](db[_0x8f6c('0x10a')],{'as':'UserNotifications','foreignKey':'SenderId'});db['User'][_0x8f6c('0x12b')](db[_0x8f6c('0x106')],{'as':_0x8f6c('0x106'),'foreignKey':_0x8f6c('0x12c')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db['ChatGroup'],{'as':_0x8f6c('0x12e'),'through':'chat_group_has_users'});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x12f'),'through':_0x8f6c('0x130')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x131'),'through':'cm_user_has_lists'});db['User'][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'through':_0x8f6c('0x133')});db['User'][_0x8f6c('0x12d')](db[_0x8f6c('0x43')],{'as':'MailInteractions','through':_0x8f6c('0x134')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x127')],{'as':'ChatInteractions','through':_0x8f6c('0x135')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x51')],{'as':_0x8f6c('0x129'),'through':_0x8f6c('0x136')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db['SmsInteraction'],{'as':_0x8f6c('0x137'),'through':'user_has_sms_interactions'});db[_0x8f6c('0x12')]['belongsToMany'](db[_0x8f6c('0x126')],{'as':'OpenchannelInteractions','through':_0x8f6c('0x138')});db['User'][_0x8f6c('0x12d')](db[_0x8f6c('0x110')],{'as':_0x8f6c('0x12a'),'through':_0x8f6c('0x139')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x1b')],{'as':_0x8f6c('0x13a'),'through':'UserVoiceQueue','required':![]});db['User'][_0x8f6c('0x12d')](db[_0x8f6c('0x104')],{'as':'VoicePrefixes','through':_0x8f6c('0x13b'),'required':![]});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x40')],{'as':_0x8f6c('0x13c'),'through':_0x8f6c('0x13d'),'required':![]});db[_0x8f6c('0x12')]['belongsToMany'](db[_0x8f6c('0x70')],{'as':_0x8f6c('0x13e'),'through':_0x8f6c('0x32'),'required':![],'hooks':!![]});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x54')],{'as':_0x8f6c('0x13f'),'through':'UserFaxQueue','required':![]});db[_0x8f6c('0x12')]['belongsToMany'](db[_0x8f6c('0x5f')],{'as':'SmsQueues','through':_0x8f6c('0x140'),'required':![]});db['User'][_0x8f6c('0x12d')](db[_0x8f6c('0x141')],{'as':'OpenchannelQueues','through':_0x8f6c('0x37'),'required':![]});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0x8f6c('0x142'),'required':![]});db['User'][_0x8f6c('0x12d')](db[_0x8f6c('0x103')],{'through':_0x8f6c('0x143')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x67')],{'as':'ChatWebsites','through':'user_has_chat_websites'});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x144')],{'as':_0x8f6c('0x145'),'through':'user_has_fax_accounts'});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x3e')],{'as':_0x8f6c('0x146'),'through':'user_has_mail_accounts'});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x147')],{'as':_0x8f6c('0x148'),'through':_0x8f6c('0x149')});db[_0x8f6c('0x12')]['belongsToMany'](db[_0x8f6c('0x14a')],{'as':_0x8f6c('0x14b'),'through':_0x8f6c('0x14c')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x10c')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db['User'][_0x8f6c('0x12d')](db['SquareProject'],{'as':_0x8f6c('0x14d'),'through':_0x8f6c('0x14e')});db[_0x8f6c('0x14f')][_0x8f6c('0x122')](db[_0x8f6c('0x18')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0x8f6c('0x150')});db[_0x8f6c('0x16')][_0x8f6c('0x122')](db[_0x8f6c('0x18')],{'onDelete':'cascade'});db[_0x8f6c('0x18')][_0x8f6c('0x122')](db[_0x8f6c('0x18')],{'as':'Applications','onDelete':'cascade'});db[_0x8f6c('0x19')][_0x8f6c('0x12d')](db['Sound'],{'as':_0x8f6c('0x151'),'through':_0x8f6c('0x152')});db['VoiceQueue'][_0x8f6c('0x122')](db[_0x8f6c('0x2f')],{'as':_0x8f6c('0x153'),'foreignKey':'VoiceQueueId'});db[_0x8f6c('0x1b')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x8f6c('0x154')});db[_0x8f6c('0x1b')]['hasMany'](db[_0x8f6c('0x7b')],{'as':'HopperFinals','foreignKey':_0x8f6c('0x154')});db[_0x8f6c('0x1b')][_0x8f6c('0x122')](db[_0x8f6c('0x7d')],{'as':_0x8f6c('0x155'),'foreignKey':_0x8f6c('0x154')});db['VoiceQueue'][_0x8f6c('0x122')](db[_0x8f6c('0x7e')],{'as':_0x8f6c('0x7e'),'foreignKey':_0x8f6c('0x154')});db[_0x8f6c('0x1b')][_0x8f6c('0x122')](db[_0x8f6c('0x7a')],{'as':_0x8f6c('0x156'),'foreignKey':_0x8f6c('0x154')});db[_0x8f6c('0x1b')]['hasMany'](db[_0x8f6c('0xe1')],{'as':_0x8f6c('0x157'),'foreignKey':_0x8f6c('0x154')});db['VoiceQueue']['belongsTo'](db[_0x8f6c('0x2c')],{'as':_0x8f6c('0x2c'),'foreignKey':_0x8f6c('0x158')});db[_0x8f6c('0x1b')]['belongsTo'](db[_0x8f6c('0x2c')],{'as':_0x8f6c('0x159'),'foreignKey':_0x8f6c('0x15a')});db[_0x8f6c('0x1b')][_0x8f6c('0x12b')](db[_0x8f6c('0x8a')],{'as':_0x8f6c('0x8a'),'foreignKey':'IntervalId'});db[_0x8f6c('0x1b')]['belongsTo'](db[_0x8f6c('0x15b')],{'as':_0x8f6c('0x15c'),'foreignKey':_0x8f6c('0x15d')});db[_0x8f6c('0x1b')][_0x8f6c('0x12d')](db['CmList'],{'as':_0x8f6c('0x131'),'through':'voice_queues_has_cm_lists'});db[_0x8f6c('0x1b')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':'Agents','through':'UserVoiceQueue'});db['VoiceQueue'][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'as':_0x8f6c('0x15e'),'through':'TeamVoiceQueue'});db[_0x8f6c('0x1b')][_0x8f6c('0x12d')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x15f'),'through':_0x8f6c('0x160')});db['VoiceRecording'][_0x8f6c('0x12b')](db['User'],{'as':_0x8f6c('0x12'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x1f')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x12'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x21')][_0x8f6c('0x122')](db[_0x8f6c('0x23')],{'as':_0x8f6c('0x161'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x162'),'sourceKey':_0x8f6c('0x163')});db[_0x8f6c('0x23')]['belongsTo'](db[_0x8f6c('0x21')],{'foreignKey':_0x8f6c('0x162'),'targetKey':'mailbox'});db['VoiceCallReport']['hasMany'](db['VoiceQueueReport'],{'as':_0x8f6c('0x164'),'foreignKey':'uniqueid','constraints':![]});db[_0x8f6c('0x25')][_0x8f6c('0x122')](db[_0x8f6c('0x28')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':'User','foreignKey':_0x8f6c('0x121')});db['VoiceCallReport']['belongsTo'](db[_0x8f6c('0x77')],{'as':'Contact','foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x3a')][_0x8f6c('0x12b')](db[_0x8f6c('0x3e')],{'as':'MailAccount','foreignKey':_0x8f6c('0x166')});db[_0x8f6c('0x3c')][_0x8f6c('0x12b')](db[_0x8f6c('0x3e')],{'as':'MailAccount','foreignKey':_0x8f6c('0x166')});db[_0x8f6c('0x3e')][_0x8f6c('0x11f')](db[_0x8f6c('0x3a')],{'as':_0x8f6c('0x167'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x3e')][_0x8f6c('0x11f')](db[_0x8f6c('0x3c')],{'as':'Smtp','onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x3e')][_0x8f6c('0x122')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x8f6c('0x166'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x3e')]['hasMany'](db[_0x8f6c('0x85')],{'as':_0x8f6c('0x168'),'foreignKey':_0x8f6c('0x166')});db[_0x8f6c('0x3e')][_0x8f6c('0x122')](db['MailMessage'],{'as':'Messages','foreignKey':'MailAccountId'});db['MailAccount'][_0x8f6c('0x122')](db[_0x8f6c('0x43')],{'as':_0x8f6c('0x169')});db['MailAccount'][_0x8f6c('0x122')](db[_0x8f6c('0x47')],{'as':'Applications'});db[_0x8f6c('0x3e')][_0x8f6c('0x12b')](db['CmList'],{'as':_0x8f6c('0x16a'),'foreignKey':_0x8f6c('0x16b')});db['MailAccount'][_0x8f6c('0x12b')](db[_0x8f6c('0x94')],{'as':_0x8f6c('0x94'),'foreignKey':_0x8f6c('0x16c')});db[_0x8f6c('0x3e')][_0x8f6c('0x12b')](db['Pause'],{'as':_0x8f6c('0x15c'),'foreignKey':_0x8f6c('0x15d')});db[_0x8f6c('0x3e')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x16e')});db[_0x8f6c('0x40')][_0x8f6c('0x12d')](db['User'],{'as':'Agents','through':_0x8f6c('0x13d')});db['MailQueue'][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'through':_0x8f6c('0x16f'),'as':_0x8f6c('0x15e')});db['MailInteraction'][_0x8f6c('0x122')](db[_0x8f6c('0x45')],{'as':'Messages','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x170')});db[_0x8f6c('0x43')][_0x8f6c('0x12b')](db[_0x8f6c('0x3e')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x166')});db['MailInteraction'][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x43')][_0x8f6c('0x12b')](db['User'],{'as':'Owner','foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x43')]['belongsToMany'](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x173'),'as':_0x8f6c('0x174')});db[_0x8f6c('0x43')][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':'mail_interaction_has_tags','as':_0x8f6c('0x175')});db[_0x8f6c('0x43')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x176'),'through':_0x8f6c('0x134'),'foreignKey':_0x8f6c('0x170')});db[_0x8f6c('0x45')][_0x8f6c('0x122')](db[_0x8f6c('0xf6')],{'as':_0x8f6c('0x177'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x45')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x12')});db[_0x8f6c('0x45')]['belongsTo'](db[_0x8f6c('0x77')],{'onDelete':_0x8f6c('0x120'),'as':'Contact'});db['MailMessage']['belongsTo'](db['MailInteraction'],{'as':_0x8f6c('0x178'),'foreignKey':_0x8f6c('0x170')});db[_0x8f6c('0x45')][_0x8f6c('0x12b')](db['MailAccount'],{'as':'Account','foreignKey':_0x8f6c('0x166')});db[_0x8f6c('0x45')]['belongsTo'](db[_0x8f6c('0x67')],{'as':'ChatWebsite','foreignKey':_0x8f6c('0x179')});db[_0x8f6c('0x45')][_0x8f6c('0x12b')](db[_0x8f6c('0x17a')],{'as':_0x8f6c('0x17a'),'foreignKey':_0x8f6c('0x17b')});db[_0x8f6c('0x47')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x47')][_0x8f6c('0x12b')](db['MailQueue'],{'onDelete':_0x8f6c('0x17c')});db['MailApplication'][_0x8f6c('0x12b')](db[_0x8f6c('0x3e')],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x47')][_0x8f6c('0x12b')](db[_0x8f6c('0x8a')],{'onDelete':_0x8f6c('0x17c'),'foreignKey':_0x8f6c('0x17d')});db[_0x8f6c('0x47')][_0x8f6c('0x12b')](db[_0x8f6c('0x92')],{'onDelete':_0x8f6c('0x17c'),'foreignKey':_0x8f6c('0x17e')});db['MailQueueReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x3e')],{});db['MailQueueReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x17f')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db['MailQueueReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x43')],{});db[_0x8f6c('0x17f')][_0x8f6c('0x12b')](db[_0x8f6c('0x45')],{});db[_0x8f6c('0x17f')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{});db['MailQueueReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x40')],{});db[_0x8f6c('0x4a')]['hasMany'](db[_0x8f6c('0x4c')],{'as':_0x8f6c('0x180'),'onDelete':'cascade'});db[_0x8f6c('0x144')][_0x8f6c('0x122')](db[_0x8f6c('0x87')],{'as':'Dispositions','foreignKey':_0x8f6c('0x181'),'onDelete':_0x8f6c('0x120')});db['FaxAccount'][_0x8f6c('0x122')](db[_0x8f6c('0x85')],{'as':_0x8f6c('0x168'),'foreignKey':_0x8f6c('0x181')});db[_0x8f6c('0x144')]['hasMany'](db['FaxInteraction'],{'as':_0x8f6c('0x169')});db['FaxAccount']['hasMany'](db[_0x8f6c('0x4f')],{'as':_0x8f6c('0x182')});db['FaxAccount'][_0x8f6c('0x122')](db['VoiceExtension'],{'as':_0x8f6c('0x183'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x144')][_0x8f6c('0x122')](db['FaxMessage'],{'as':_0x8f6c('0x161')});db[_0x8f6c('0x144')][_0x8f6c('0x12b')](db[_0x8f6c('0x2c')],{'as':_0x8f6c('0x2c')});db['FaxAccount'][_0x8f6c('0x12b')](db[_0x8f6c('0x103')],{'as':'List','foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x144')][_0x8f6c('0x12b')](db[_0x8f6c('0x15b')],{'as':'mandatoryDispositionPause','foreignKey':_0x8f6c('0x15d')});db['FaxAccount'][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x184')});db[_0x8f6c('0x4f')]['belongsTo'](db[_0x8f6c('0x12')],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x4f')][_0x8f6c('0x12b')](db['FaxQueue'],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x4f')][_0x8f6c('0x12b')](db[_0x8f6c('0x144')],{'onDelete':'restrict'});db[_0x8f6c('0x4f')][_0x8f6c('0x12b')](db[_0x8f6c('0x92')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x8f6c('0x51')][_0x8f6c('0x122')](db[_0x8f6c('0x52')],{'as':_0x8f6c('0x161'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x185')});db['FaxInteraction']['belongsTo'](db[_0x8f6c('0x144')],{'as':'Account','foreignKey':_0x8f6c('0x181')});db[_0x8f6c('0x51')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x51')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x186'),'foreignKey':'UserId'});db['FaxInteraction'][_0x8f6c('0x12d')](db['Tag'],{'through':_0x8f6c('0x187'),'as':_0x8f6c('0x174')});db[_0x8f6c('0x51')][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':'fax_interaction_has_tags','as':_0x8f6c('0x175')});db[_0x8f6c('0x51')][_0x8f6c('0x12d')](db['User'],{'as':_0x8f6c('0x176'),'through':_0x8f6c('0x136'),'foreignKey':_0x8f6c('0x185')});db['FaxMessage']['belongsTo'](db['User'],{'onDelete':_0x8f6c('0x120'),'as':_0x8f6c('0x12')});db[_0x8f6c('0x52')][_0x8f6c('0x12b')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0x8f6c('0x185')});db[_0x8f6c('0x52')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'onDelete':_0x8f6c('0x120'),'as':_0x8f6c('0x172')});db[_0x8f6c('0x52')][_0x8f6c('0x12b')](db[_0x8f6c('0xf6')],{'as':'Attachment','foreignKey':_0x8f6c('0x188')});db['FaxMessage'][_0x8f6c('0x12b')](db['FaxAccount'],{'as':'Account','foreignKey':_0x8f6c('0x181')});db[_0x8f6c('0x54')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x35')});db[_0x8f6c('0x54')]['belongsToMany'](db[_0x8f6c('0x132')],{'through':'team_has_fax_queues','as':_0x8f6c('0x15e')});db['FaxQueueReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x144')],{});db[_0x8f6c('0x56')]['belongsTo'](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x56')]['belongsTo'](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x56')][_0x8f6c('0x12b')](db['FaxInteraction'],{});db[_0x8f6c('0x56')][_0x8f6c('0x12b')](db[_0x8f6c('0x52')],{});db[_0x8f6c('0x56')]['belongsTo'](db[_0x8f6c('0x12')],{});db[_0x8f6c('0x56')][_0x8f6c('0x12b')](db[_0x8f6c('0x54')],{});db['SmsAccount']['hasMany'](db[_0x8f6c('0x87')],{'as':_0x8f6c('0x189'),'foreignKey':'SmsAccountId','onDelete':_0x8f6c('0x120')});db['SmsAccount']['hasMany'](db[_0x8f6c('0x85')],{'as':'Answers','foreignKey':_0x8f6c('0x18a')});db[_0x8f6c('0x14a')][_0x8f6c('0x122')](db['SmsMessage'],{'as':_0x8f6c('0x161'),'foreignKey':_0x8f6c('0x18a')});db['SmsAccount']['hasMany'](db['SmsInteraction'],{'as':_0x8f6c('0x169')});db[_0x8f6c('0x14a')]['hasMany'](db['SmsApplication'],{'as':_0x8f6c('0x182')});db[_0x8f6c('0x14a')][_0x8f6c('0x12b')](db[_0x8f6c('0x103')],{'as':'List','foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x14a')][_0x8f6c('0x12b')](db[_0x8f6c('0x15b')],{'as':'mandatoryDispositionPause','foreignKey':_0x8f6c('0x15d')});db[_0x8f6c('0x14a')]['belongsToMany'](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x14c')});db[_0x8f6c('0x59')]['belongsTo'](db[_0x8f6c('0x12')],{'onDelete':'restrict'});db[_0x8f6c('0x59')][_0x8f6c('0x12b')](db['SmsQueue'],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x59')][_0x8f6c('0x12b')](db[_0x8f6c('0x14a')],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x59')][_0x8f6c('0x12b')](db[_0x8f6c('0x8a')],{'onDelete':_0x8f6c('0x17c'),'foreignKey':'IntervalId'});db[_0x8f6c('0x59')]['belongsTo'](db['Tag'],{'onDelete':_0x8f6c('0x17c'),'foreignKey':_0x8f6c('0x17e')});db['SmsInteraction'][_0x8f6c('0x122')](db[_0x8f6c('0x5d')],{'as':'Messages','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x18b')});db[_0x8f6c('0x5b')][_0x8f6c('0x12b')](db['SmsAccount'],{'as':_0x8f6c('0x171'),'foreignKey':'SmsAccountId'});db[_0x8f6c('0x5b')]['belongsTo'](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x5b')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x186'),'foreignKey':_0x8f6c('0x121')});db['SmsInteraction'][_0x8f6c('0x12d')](db['Tag'],{'through':_0x8f6c('0x18c'),'as':_0x8f6c('0x174')});db[_0x8f6c('0x5b')][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x18c'),'as':_0x8f6c('0x175')});db['SmsInteraction'][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x176'),'through':'user_has_sms_interactions','foreignKey':_0x8f6c('0x18b')});db[_0x8f6c('0x5d')][_0x8f6c('0x12b')](db['User'],{'as':'User'});db[_0x8f6c('0x5d')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'onDelete':'cascade','as':'Contact'});db[_0x8f6c('0x5d')][_0x8f6c('0x12b')](db[_0x8f6c('0x5b')],{'onDelete':_0x8f6c('0x120'),'as':_0x8f6c('0x178'),'foreignKey':_0x8f6c('0x18b')});db[_0x8f6c('0x5d')][_0x8f6c('0x12b')](db['SmsAccount'],{'as':'Account','foreignKey':_0x8f6c('0x18a')});db[_0x8f6c('0x5f')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0x8f6c('0x18d')});db[_0x8f6c('0x5f')][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'through':_0x8f6c('0x18e'),'as':_0x8f6c('0x15e')});db[_0x8f6c('0x147')]['hasMany'](db[_0x8f6c('0x87')],{'as':_0x8f6c('0x189'),'foreignKey':'OpenchannelAccountId','onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x147')][_0x8f6c('0x122')](db[_0x8f6c('0x85')],{'as':_0x8f6c('0x168'),'foreignKey':_0x8f6c('0x18f')});db[_0x8f6c('0x147')]['hasMany'](db[_0x8f6c('0x126')],{'as':_0x8f6c('0x169'),'foreignKey':_0x8f6c('0x18f')});db[_0x8f6c('0x147')][_0x8f6c('0x122')](db[_0x8f6c('0x65')],{'as':_0x8f6c('0x161'),'foreignKey':_0x8f6c('0x18f')});db[_0x8f6c('0x147')][_0x8f6c('0x122')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['belongsTo'](db[_0x8f6c('0x103')],{'as':'List','foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x147')][_0x8f6c('0x12b')](db[_0x8f6c('0x15b')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8f6c('0x147')][_0x8f6c('0x12d')](db['User'],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x149')});db[_0x8f6c('0x62')]['belongsTo'](db[_0x8f6c('0x12')],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x62')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x8f6c('0x17c'),'foreignKey':_0x8f6c('0x190')});db[_0x8f6c('0x62')][_0x8f6c('0x12b')](db[_0x8f6c('0x147')],{'onDelete':_0x8f6c('0x17c'),'foreignKey':_0x8f6c('0x18f')});db[_0x8f6c('0x62')][_0x8f6c('0x12b')](db[_0x8f6c('0x8a')],{'onDelete':'restrict','foreignKey':_0x8f6c('0x17d')});db[_0x8f6c('0x62')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x8f6c('0x126')][_0x8f6c('0x122')](db[_0x8f6c('0x65')],{'as':_0x8f6c('0x161'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x191')});db['OpenchannelInteraction'][_0x8f6c('0x12b')](db[_0x8f6c('0x147')],{'as':'Account','foreignKey':_0x8f6c('0x18f')});db[_0x8f6c('0x126')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':'ContactId'});db[_0x8f6c('0x126')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x186'),'foreignKey':_0x8f6c('0x121')});db['OpenchannelInteraction']['belongsToMany'](db[_0x8f6c('0x92')],{'through':'openchannel_interaction_has_tags','as':_0x8f6c('0x174')});db[_0x8f6c('0x126')]['belongsToMany'](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x8f6c('0x175')});db['OpenchannelInteraction']['belongsToMany'](db['User'],{'as':_0x8f6c('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x8f6c('0x191')});db[_0x8f6c('0x65')][_0x8f6c('0x12b')](db['User'],{'onDelete':'cascade','as':_0x8f6c('0x12')});db[_0x8f6c('0x65')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'onDelete':'cascade','as':_0x8f6c('0x172')});db[_0x8f6c('0x65')][_0x8f6c('0x12b')](db[_0x8f6c('0x126')],{'onDelete':_0x8f6c('0x120'),'as':_0x8f6c('0x178'),'foreignKey':_0x8f6c('0x191')});db[_0x8f6c('0x65')][_0x8f6c('0x12b')](db[_0x8f6c('0xf6')],{'as':_0x8f6c('0xf6'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0x8f6c('0x12b')](db[_0x8f6c('0x147')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x18f')});db[_0x8f6c('0x141')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':'Agents','through':_0x8f6c('0x37'),'foreignKey':_0x8f6c('0x190')});db[_0x8f6c('0x141')]['belongsToMany'](db[_0x8f6c('0x132')],{'through':_0x8f6c('0x192'),'as':_0x8f6c('0x15e')});db[_0x8f6c('0x67')][_0x8f6c('0x122')](db[_0x8f6c('0x87')],{'as':_0x8f6c('0x189'),'foreignKey':_0x8f6c('0x179'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x67')][_0x8f6c('0x122')](db[_0x8f6c('0x85')],{'as':_0x8f6c('0x168'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0x8f6c('0x122')](db[_0x8f6c('0x74')],{'as':'ProactiveActions'});db[_0x8f6c('0x67')]['hasMany'](db[_0x8f6c('0x127')],{'as':'Interactions'});db[_0x8f6c('0x67')][_0x8f6c('0x122')](db[_0x8f6c('0x6b')],{'as':_0x8f6c('0x182')});db[_0x8f6c('0x67')][_0x8f6c('0x122')](db[_0x8f6c('0x193')],{'as':_0x8f6c('0x161')});db['ChatWebsite']['belongsTo'](db[_0x8f6c('0x103')],{'as':'List','foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x67')]['belongsTo'](db[_0x8f6c('0x8a')],{'as':_0x8f6c('0x8a'),'foreignKey':'IntervalId'});db['ChatWebsite']['belongsTo'](db[_0x8f6c('0x3e')],{'as':_0x8f6c('0x3e'),'foreignKey':_0x8f6c('0x166')});db[_0x8f6c('0x67')][_0x8f6c('0x12b')](db[_0x8f6c('0x15b')],{'as':'mandatoryDispositionPause','foreignKey':_0x8f6c('0x15d')});db[_0x8f6c('0x67')]['belongsToMany'](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x194')});db[_0x8f6c('0x69')][_0x8f6c('0x12b')](db[_0x8f6c('0x147')],{});db[_0x8f6c('0x69')][_0x8f6c('0x12b')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':'ListId'});db[_0x8f6c('0x69')][_0x8f6c('0x12b')](db['CmContact'],{'as':_0x8f6c('0x172'),'foreignKey':'ContactId'});db[_0x8f6c('0x69')][_0x8f6c('0x12b')](db['OpenchannelInteraction'],{});db[_0x8f6c('0x69')][_0x8f6c('0x12b')](db[_0x8f6c('0x65')],{});db[_0x8f6c('0x69')]['belongsTo'](db[_0x8f6c('0x12')],{});db[_0x8f6c('0x69')][_0x8f6c('0x12b')](db[_0x8f6c('0x141')],{});db[_0x8f6c('0x6b')][_0x8f6c('0x12b')](db['User'],{'as':'Agent','foreignKey':_0x8f6c('0x121'),'onDelete':'restrict'});db[_0x8f6c('0x6b')][_0x8f6c('0x12b')](db[_0x8f6c('0x70')],{'as':_0x8f6c('0x195'),'foreignKey':_0x8f6c('0x196'),'onDelete':'restrict'});db[_0x8f6c('0x6b')][_0x8f6c('0x12b')](db[_0x8f6c('0x67')],{'as':_0x8f6c('0x197'),'foreignKey':_0x8f6c('0x179'),'onDelete':'restrict'});db[_0x8f6c('0x6b')][_0x8f6c('0x12b')](db[_0x8f6c('0x92')],{'onDelete':_0x8f6c('0x17c'),'foreignKey':'TagId'});db[_0x8f6c('0x127')][_0x8f6c('0x122')](db[_0x8f6c('0x193')],{'as':'Messages','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x198')});db[_0x8f6c('0x127')][_0x8f6c('0x12b')](db[_0x8f6c('0x67')],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':'Contact','foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x127')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x186'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x127')]['belongsToMany'](db['Tag'],{'through':_0x8f6c('0x199'),'as':'Tags'});db['ChatInteraction']['belongsToMany'](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x199'),'as':_0x8f6c('0x175')});db[_0x8f6c('0x127')][_0x8f6c('0x12d')](db['User'],{'as':_0x8f6c('0x176'),'through':_0x8f6c('0x135'),'foreignKey':'ChatInteractionId'});db[_0x8f6c('0x193')][_0x8f6c('0x12b')](db['User'],{'onDelete':_0x8f6c('0x120'),'as':'User'});db['ChatMessage']['belongsTo'](db[_0x8f6c('0x77')],{'onDelete':'cascade','as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db['ChatMessage'][_0x8f6c('0x12b')](db[_0x8f6c('0x127')],{'onDelete':_0x8f6c('0x120'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0x8f6c('0x193')][_0x8f6c('0x12b')](db[_0x8f6c('0xf6')],{'as':_0x8f6c('0xf6'),'foreignKey':'AttachmentId'});db[_0x8f6c('0x193')][_0x8f6c('0x12b')](db['ChatWebsite'],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x179')});db[_0x8f6c('0x17a')][_0x8f6c('0x122')](db[_0x8f6c('0xf6')],{'as':_0x8f6c('0x177'),'foreignKey':_0x8f6c('0x17b'),'onDelete':_0x8f6c('0x120'),'hooks':!![]});db[_0x8f6c('0x17a')][_0x8f6c('0x12b')](db['CmContact'],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db['ChatOfflineMessage'][_0x8f6c('0x12b')](db[_0x8f6c('0x67')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x179')});db[_0x8f6c('0x70')][_0x8f6c('0x12d')](db['User'],{'as':'Agents','through':_0x8f6c('0x32'),'hooks':!![]});db[_0x8f6c('0x70')][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'through':_0x8f6c('0x19a'),'as':_0x8f6c('0x15e')});db[_0x8f6c('0x72')][_0x8f6c('0x122')](db[_0x8f6c('0xdc')],{'as':_0x8f6c('0x161'),'foreignKey':_0x8f6c('0x19b'),'onDelete':_0x8f6c('0x120')});db['ChatGroup'][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x153'),'through':_0x8f6c('0x19c')});db[_0x8f6c('0x74')][_0x8f6c('0x12b')](db[_0x8f6c('0x67')],{'as':_0x8f6c('0x197'),'foreignKey':_0x8f6c('0x179')});db[_0x8f6c('0x76')][_0x8f6c('0x122')](db['CmContact'],{'as':_0x8f6c('0x12f'),'foreignKey':_0x8f6c('0x19d')});db[_0x8f6c('0x77')][_0x8f6c('0x122')](db[_0x8f6c('0x79')],{'as':_0x8f6c('0x19e'),'foreignKey':_0x8f6c('0x165')});db['CmContact']['hasMany'](db[_0x8f6c('0x7b')],{'as':_0x8f6c('0x125'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x77')]['hasMany'](db['CmHopperHistory'],{'as':_0x8f6c('0x155'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x77')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x77')][_0x8f6c('0x122')](db[_0x8f6c('0xe1')],{'as':_0x8f6c('0x157'),'foreignKey':'ContactId'});db['CmContact'][_0x8f6c('0x122')](db[_0x8f6c('0x126')],{'as':_0x8f6c('0x19f'),'foreignKey':_0x8f6c('0x165'),'onDelete':'restrict'});db[_0x8f6c('0x77')][_0x8f6c('0x122')](db['ChatInteraction'],{'as':_0x8f6c('0x128'),'foreignKey':_0x8f6c('0x165'),'onDelete':_0x8f6c('0x17c')});db['CmContact']['hasMany'](db['SmsInteraction'],{'as':_0x8f6c('0x137'),'foreignKey':'ContactId','onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x77')]['hasMany'](db[_0x8f6c('0x51')],{'as':_0x8f6c('0x129'),'foreignKey':_0x8f6c('0x165'),'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x77')][_0x8f6c('0x122')](db[_0x8f6c('0x43')],{'as':_0x8f6c('0x1a0'),'foreignKey':_0x8f6c('0x165'),'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x77')]['belongsTo'](db[_0x8f6c('0x76')],{'as':_0x8f6c('0x1a1'),'foreignKey':'CompanyId'});db[_0x8f6c('0x77')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x8f6c('0x16b'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x77')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':'Users','through':'cm_user_has_contacts'});db['CmContact'][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'as':'Tags','through':_0x8f6c('0x1a2')});db[_0x8f6c('0x77')][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x1a2'),'as':_0x8f6c('0x175')});db[_0x8f6c('0x79')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x79')][_0x8f6c('0x12b')](db['CmList'],{'as':'List','foreignKey':_0x8f6c('0x16b'),'onDelete':'cascade'});db[_0x8f6c('0x79')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x1a3'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x79')][_0x8f6c('0x12b')](db[_0x8f6c('0x1b')],{'as':_0x8f6c('0x195'),'foreignKey':_0x8f6c('0x154'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x79')]['belongsTo'](db[_0x8f6c('0xf3')],{'as':_0x8f6c('0xf3'),'foreignKey':_0x8f6c('0x1a4'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x79')]['belongsTo'](db[_0x8f6c('0x12')],{'as':'Owner','foreignKey':_0x8f6c('0x1a5')});db['CmHopperBlack'][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':'Contact','foreignKey':_0x8f6c('0x165'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x7a')][_0x8f6c('0x12b')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':'ListId','onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x7a')][_0x8f6c('0x12b')](db['VoiceQueue'],{'as':_0x8f6c('0x195'),'foreignKey':_0x8f6c('0x154'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x7a')][_0x8f6c('0x12b')](db['Campaign'],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0x8f6c('0x84')][_0x8f6c('0x122')](db[_0x8f6c('0x88')],{'as':{'plural':_0x8f6c('0x1a6'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x8f6c('0x84')]['hasMany'](db[_0x8f6c('0x88')],{'as':{'plural':_0x8f6c('0x1a7'),'singular':_0x8f6c('0x1a8')},'foreignKey':_0x8f6c('0x1a9'),'onDelete':_0x8f6c('0x120'),'hooks':!![]});db[_0x8f6c('0x84')][_0x8f6c('0x122')](db['Action'],{'as':_0x8f6c('0x1aa'),'foreignKey':_0x8f6c('0x1ab'),'onDelete':_0x8f6c('0x120'),'hooks':!![]});db[_0x8f6c('0x87')][_0x8f6c('0x122')](db[_0x8f6c('0x87')],{'as':_0x8f6c('0x189'),'foreignKey':_0x8f6c('0x1ac'),'onDelete':'cascade'});db[_0x8f6c('0x8a')][_0x8f6c('0x122')](db['Interval'],{'as':_0x8f6c('0x1ad'),'foreignKey':_0x8f6c('0x17d'),'onDelete':_0x8f6c('0x120'),'hooks':!![],'required':![]});db[_0x8f6c('0x8a')][_0x8f6c('0x122')](db[_0x8f6c('0x18')],{'as':_0x8f6c('0x124'),'foreignKey':_0x8f6c('0x17d'),'onDelete':_0x8f6c('0x17c')});db['Interval'][_0x8f6c('0x122')](db[_0x8f6c('0x47')],{'as':_0x8f6c('0x1ae'),'foreignKey':'IntervalId'});db[_0x8f6c('0x8a')]['hasMany'](db[_0x8f6c('0x6b')],{'as':_0x8f6c('0x1af'),'foreignKey':_0x8f6c('0x17d')});db[_0x8f6c('0x8a')][_0x8f6c('0x122')](db[_0x8f6c('0x4f')],{'as':_0x8f6c('0x1b0'),'foreignKey':_0x8f6c('0x17d')});db[_0x8f6c('0x8a')][_0x8f6c('0x122')](db[_0x8f6c('0x59')],{'as':_0x8f6c('0x1b1'),'foreignKey':_0x8f6c('0x17d')});db[_0x8f6c('0x1b2')]['belongsTo'](db[_0x8f6c('0x3e')],{});db[_0x8f6c('0x1b2')]['belongsTo'](db[_0x8f6c('0x9e')],{'foreignKey':_0x8f6c('0x1b3')});db[_0x8f6c('0x1b2')]['belongsTo'](db[_0x8f6c('0x9c')],{'foreignKey':'CustomReportId'});db[_0x8f6c('0x90')]['belongsToMany'](db[_0x8f6c('0x19')],{'as':_0x8f6c('0x1b4'),'through':'moh_has_sounds','onDelete':_0x8f6c('0x17c')});db['Tag'][_0x8f6c('0x12d')](db['CmContact'],{'through':_0x8f6c('0x1a2')});db[_0x8f6c('0x92')][_0x8f6c('0x12d')](db[_0x8f6c('0x127')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x8f6c('0x12d')](db['MailInteraction'],{'through':_0x8f6c('0x173')});db[_0x8f6c('0x92')]['belongsToMany'](db['SmsInteraction'],{'through':_0x8f6c('0x18c')});db['Tag']['belongsToMany'](db[_0x8f6c('0x51')],{'through':_0x8f6c('0x187')});db[_0x8f6c('0x92')]['belongsToMany'](db[_0x8f6c('0x126')],{'through':'openchannel_interaction_has_tags'});db[_0x8f6c('0x92')][_0x8f6c('0x12d')](db['WhatsappInteraction'],{'through':_0x8f6c('0x1b5')});db[_0x8f6c('0x96')]['hasMany'](db['Condition'],{'as':{'plural':_0x8f6c('0x1b6'),'singular':_0x8f6c('0x1b7')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0x8f6c('0x96')]['hasMany'](db['Condition'],{'as':{'plural':_0x8f6c('0x1b8'),'singular':_0x8f6c('0x1b9')},'foreignKey':_0x8f6c('0x1ba'),'onDelete':'cascade','hooks':!![]});db[_0x8f6c('0x96')][_0x8f6c('0x122')](db['Action'],{'as':'Actions','foreignKey':_0x8f6c('0x1bb'),'onDelete':_0x8f6c('0x120'),'hooks':!![]});db[_0x8f6c('0x9c')][_0x8f6c('0x122')](db[_0x8f6c('0xa3')],{'as':_0x8f6c('0x1bc'),'onDelete':_0x8f6c('0x120'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x8f6c('0x9e')][_0x8f6c('0x122')](db[_0x8f6c('0xa3')],{'as':_0x8f6c('0x1bc'),'onDelete':'cascade','foreignKey':_0x8f6c('0x1b3')});db[_0x8f6c('0xa1')][_0x8f6c('0x122')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x8f6c('0x1bd')});db['AnalyticFieldReport'][_0x8f6c('0x12b')](db[_0x8f6c('0xa1')],{'foreignKey':_0x8f6c('0x1bd')});db['SalesforceAccount'][_0x8f6c('0x122')](db[_0x8f6c('0xa7')],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xa7')][_0x8f6c('0x122')](db[_0x8f6c('0xa9')],{'as':'Subjects','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xa7')][_0x8f6c('0x122')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x8f6c('0x120'),'foreignKey':'DescriptionId'});db[_0x8f6c('0xa7')][_0x8f6c('0x122')](db[_0x8f6c('0xa9')],{'as':_0x8f6c('0x1bc'),'onDelete':'cascade','foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xa7')][_0x8f6c('0x12b')](db['SalesforceAccount'],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xa9')][_0x8f6c('0x122')](db[_0x8f6c('0xa9')],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':_0x8f6c('0x1c3'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xa9')]['hasMany'](db[_0x8f6c('0xa9')],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xa9')][_0x8f6c('0x12b')](db['Variable'],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db['SugarcrmAccount'][_0x8f6c('0x122')](db['SugarcrmConfiguration'],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db['SugarcrmConfiguration'][_0x8f6c('0x122')](db['SugarcrmField'],{'as':_0x8f6c('0x1c7'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xab')][_0x8f6c('0x122')](db[_0x8f6c('0xad')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xab')]['hasMany'](db[_0x8f6c('0xad')],{'as':_0x8f6c('0x1bc'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xab')][_0x8f6c('0x12b')](db[_0x8f6c('0x1c8')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xad')][_0x8f6c('0x122')](db[_0x8f6c('0xad')],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db['SugarcrmField'][_0x8f6c('0x122')](db[_0x8f6c('0xad')],{'as':_0x8f6c('0x1c3'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xad')]['hasMany'](db[_0x8f6c('0xad')],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db['SugarcrmField'][_0x8f6c('0x12b')](db['Variable'],{'as':_0x8f6c('0x98'),'foreignKey':'VariableId'});db[_0x8f6c('0x1c9')][_0x8f6c('0x122')](db['DeskConfiguration'],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xb0')]['hasMany'](db[_0x8f6c('0xb2')],{'as':'Subjects','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c0')});db['DeskConfiguration'][_0x8f6c('0x122')](db[_0x8f6c('0xb2')],{'as':_0x8f6c('0x1ca'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xb0')][_0x8f6c('0x122')](db[_0x8f6c('0xb2')],{'as':_0x8f6c('0x1bc'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xb0')][_0x8f6c('0x12b')](db[_0x8f6c('0x1c9')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xb0')][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x1cb')});db['DeskField'][_0x8f6c('0x122')](db[_0x8f6c('0xb2')],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db['DeskField']['hasMany'](db[_0x8f6c('0xb2')],{'as':_0x8f6c('0x1c3'),'foreignKey':_0x8f6c('0x1c4')});db['DeskField']['hasMany'](db[_0x8f6c('0xb2')],{'as':'Field','foreignKey':'FieldId'});db[_0x8f6c('0xb2')][_0x8f6c('0x12b')](db[_0x8f6c('0x98')],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db[_0x8f6c('0xb4')][_0x8f6c('0x122')](db['ZohoConfiguration'],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xb6')][_0x8f6c('0x122')](db[_0x8f6c('0x1cc')],{'as':'Subjects','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xb6')][_0x8f6c('0x122')](db[_0x8f6c('0x1cc')],{'as':_0x8f6c('0x1ca'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c4')});db['ZohoConfiguration'][_0x8f6c('0x122')](db[_0x8f6c('0x1cc')],{'as':_0x8f6c('0x1bc'),'onDelete':'cascade','foreignKey':_0x8f6c('0x1c1')});db['ZohoConfiguration'][_0x8f6c('0x12b')](db[_0x8f6c('0xb4')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0x1cc')][_0x8f6c('0x122')](db[_0x8f6c('0x1cc')],{'as':'Subject','foreignKey':_0x8f6c('0x1c0')});db['ZohoField']['hasMany'](db[_0x8f6c('0x1cc')],{'as':_0x8f6c('0x1c3'),'foreignKey':_0x8f6c('0x1c4')});db['ZohoField'][_0x8f6c('0x122')](db['ZohoField'],{'as':_0x8f6c('0x1c5'),'foreignKey':'FieldId'});db[_0x8f6c('0x1cc')][_0x8f6c('0x12b')](db[_0x8f6c('0x98')],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db['ZendeskAccount'][_0x8f6c('0x122')](db['ZendeskConfiguration'],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xb9')][_0x8f6c('0x122')](db[_0x8f6c('0xbb')],{'as':_0x8f6c('0x1c7'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xb9')]['hasMany'](db[_0x8f6c('0xbb')],{'as':_0x8f6c('0x1ca'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xb9')][_0x8f6c('0x122')](db['ZendeskField'],{'as':_0x8f6c('0x1bc'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xb9')][_0x8f6c('0x12b')](db['ZendeskAccount'],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xb9')][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x1cd')});db['ZendeskField'][_0x8f6c('0x122')](db[_0x8f6c('0xbb')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8f6c('0xbb')][_0x8f6c('0x122')](db['ZendeskField'],{'as':_0x8f6c('0x1c3'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xbb')][_0x8f6c('0x122')](db[_0x8f6c('0xbb')],{'as':_0x8f6c('0x1c5'),'foreignKey':'FieldId'});db[_0x8f6c('0xbb')][_0x8f6c('0x12b')](db[_0x8f6c('0x98')],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db['FreshdeskAccount'][_0x8f6c('0x122')](db[_0x8f6c('0xbf')],{'as':'Configurations','onDelete':_0x8f6c('0x120'),'foreignKey':'AccountId'});db[_0x8f6c('0xbf')][_0x8f6c('0x122')](db[_0x8f6c('0xc1')],{'as':_0x8f6c('0x1c7'),'onDelete':_0x8f6c('0x120'),'foreignKey':'SubjectId'});db[_0x8f6c('0xbf')][_0x8f6c('0x122')](db[_0x8f6c('0xc1')],{'as':'Descriptions','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c4')});db['FreshdeskConfiguration'][_0x8f6c('0x122')](db[_0x8f6c('0xc1')],{'as':_0x8f6c('0x1bc'),'onDelete':_0x8f6c('0x120'),'foreignKey':'FieldId'});db[_0x8f6c('0xbf')]['belongsTo'](db[_0x8f6c('0xbd')],{'as':_0x8f6c('0x171'),'foreignKey':'AccountId'});db[_0x8f6c('0xbf')]['belongsToMany'](db[_0x8f6c('0x92')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x8f6c('0x122')](db[_0x8f6c('0xc1')],{'as':_0x8f6c('0x1c2'),'foreignKey':'SubjectId'});db[_0x8f6c('0xc1')][_0x8f6c('0x122')](db[_0x8f6c('0xc1')],{'as':_0x8f6c('0x1c3'),'foreignKey':'DescriptionId'});db['FreshdeskField']['hasMany'](db[_0x8f6c('0xc1')],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xc1')][_0x8f6c('0x12b')](db['Variable'],{'as':'Variable','foreignKey':_0x8f6c('0x1c6')});db[_0x8f6c('0xc3')]['hasMany'](db[_0x8f6c('0xc5')],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db['VtigerConfiguration'][_0x8f6c('0x122')](db[_0x8f6c('0xc7')],{'as':_0x8f6c('0x1c7'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xc5')]['hasMany'](db[_0x8f6c('0xc7')],{'as':_0x8f6c('0x1ca'),'foreignKey':'DescriptionId'});db[_0x8f6c('0xc5')][_0x8f6c('0x122')](db['VtigerField'],{'as':_0x8f6c('0x1bc'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xc5')]['belongsTo'](db['VtigerAccount'],{'as':_0x8f6c('0x171'),'foreignKey':'AccountId'});db[_0x8f6c('0xc7')]['hasMany'](db['VtigerField'],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db['VtigerField'][_0x8f6c('0x122')](db[_0x8f6c('0xc7')],{'as':'Description','foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xc7')][_0x8f6c('0x122')](db['VtigerField'],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xc7')][_0x8f6c('0x12b')](db[_0x8f6c('0x98')],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db[_0x8f6c('0xc9')]['hasMany'](db['ServicenowConfiguration'],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':'AccountId'});db['ServicenowConfiguration']['hasMany'](db[_0x8f6c('0xcc')],{'as':_0x8f6c('0x1c7'),'foreignKey':_0x8f6c('0x1c0')});db['ServicenowConfiguration'][_0x8f6c('0x122')](db['ServicenowField'],{'as':_0x8f6c('0x1ca'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0x1ce')][_0x8f6c('0x122')](db[_0x8f6c('0xcc')],{'as':_0x8f6c('0x1bc'),'foreignKey':'FieldId'});db['ServicenowConfiguration'][_0x8f6c('0x12b')](db[_0x8f6c('0xc9')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xcc')][_0x8f6c('0x122')](db['ServicenowField'],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xcc')][_0x8f6c('0x122')](db[_0x8f6c('0xcc')],{'as':_0x8f6c('0x1c3'),'foreignKey':'DescriptionId'});db['ServicenowField']['hasMany'](db[_0x8f6c('0xcc')],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db['ServicenowField'][_0x8f6c('0x12b')](db['Variable'],{'as':'Variable','foreignKey':_0x8f6c('0x1c6')});db['Dynamics365Account'][_0x8f6c('0x122')](db[_0x8f6c('0xcf')],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db['Dynamics365Configuration'][_0x8f6c('0x122')](db['Dynamics365Field'],{'as':_0x8f6c('0x1c7'),'onDelete':_0x8f6c('0x120'),'foreignKey':'SubjectId'});db[_0x8f6c('0xcf')][_0x8f6c('0x122')](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xcf')][_0x8f6c('0x122')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x8f6c('0x120'),'foreignKey':'FieldId'});db[_0x8f6c('0xcf')]['belongsTo'](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xd1')][_0x8f6c('0x122')](db[_0x8f6c('0xd1')],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xd1')]['hasMany'](db['Dynamics365Field'],{'as':_0x8f6c('0x1c3'),'foreignKey':'DescriptionId'});db[_0x8f6c('0xd1')][_0x8f6c('0x122')](db[_0x8f6c('0xd1')],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xd1')][_0x8f6c('0x12b')](db[_0x8f6c('0x98')],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db[_0x8f6c('0xd2')]['hasMany'](db[_0x8f6c('0xd4')],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':'AccountId'});db['FreshsalesConfiguration'][_0x8f6c('0x122')](db[_0x8f6c('0xd6')],{'as':_0x8f6c('0x1c7'),'foreignKey':'SubjectId'});db[_0x8f6c('0xd4')][_0x8f6c('0x122')](db[_0x8f6c('0xd6')],{'as':'Descriptions','foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xd4')][_0x8f6c('0x122')](db[_0x8f6c('0xd6')],{'as':_0x8f6c('0x1bc'),'foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0x8f6c('0x12b')](db[_0x8f6c('0xd2')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xd6')][_0x8f6c('0x122')](db[_0x8f6c('0xd6')],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xd6')][_0x8f6c('0x122')](db[_0x8f6c('0xd6')],{'as':_0x8f6c('0x1c3'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xd6')]['hasMany'](db[_0x8f6c('0xd6')],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xd6')][_0x8f6c('0x12b')](db['Variable'],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db[_0x8f6c('0xda')][_0x8f6c('0x12b')](db[_0x8f6c('0x67')],{});db['ChatQueueReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':'ListId'});db[_0x8f6c('0xda')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0xda')][_0x8f6c('0x12b')](db[_0x8f6c('0x127')],{});db[_0x8f6c('0xda')][_0x8f6c('0x12b')](db['ChatMessage'],{});db[_0x8f6c('0xda')]['belongsTo'](db[_0x8f6c('0x12')],{});db[_0x8f6c('0xda')][_0x8f6c('0x12b')](db['ChatQueue'],{});db[_0x8f6c('0xdc')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1cf')});db[_0x8f6c('0xdc')]['belongsTo'](db[_0x8f6c('0x12')],{'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1d0')});db[_0x8f6c('0xe1')][_0x8f6c('0x122')](db['JscriptyQuestionReport'],{'foreignKey':_0x8f6c('0x1d1'),'onDelete':_0x8f6c('0x120')});db['JscriptySessionReport'][_0x8f6c('0x122')](db[_0x8f6c('0xde')],{'foreignKey':'SessionId','onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x1d2')][_0x8f6c('0x12b')](db['SmsAccount'],{});db[_0x8f6c('0x1d2')]['belongsTo'](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x1d2')][_0x8f6c('0x12b')](db['CmContact'],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x1d2')][_0x8f6c('0x12b')](db['SmsInteraction'],{});db[_0x8f6c('0x1d2')][_0x8f6c('0x12b')](db['SmsMessage'],{});db[_0x8f6c('0x1d2')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{});db['SmsQueueReport'][_0x8f6c('0x12b')](db['SmsQueue'],{});db[_0x8f6c('0xe5')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db[_0x8f6c('0xe5')][_0x8f6c('0x122')](db[_0x8f6c('0x1d3')],{'foreignKey':_0x8f6c('0x1d4')});db['JscriptyProject'][_0x8f6c('0x122')](db['JscriptyAnswerReport'],{'foreignKey':_0x8f6c('0x1d4')});db['SquareProject'][_0x8f6c('0x12d')](db['User'],{'as':_0x8f6c('0x176'),'through':'user_has_square_projects'});db['Team']['belongsToMany'](db['User'],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x133')});db[_0x8f6c('0x132')][_0x8f6c('0x12d')](db[_0x8f6c('0x1b')],{'through':'TeamVoiceQueue','as':_0x8f6c('0x13a')});db['Team'][_0x8f6c('0x12d')](db[_0x8f6c('0x40')],{'through':_0x8f6c('0x16f'),'as':_0x8f6c('0x13c')});db['Team']['belongsToMany'](db[_0x8f6c('0x70')],{'through':_0x8f6c('0x19a'),'as':'ChatQueues'});db[_0x8f6c('0x132')][_0x8f6c('0x12d')](db['FaxQueue'],{'through':_0x8f6c('0x1d5'),'as':'FaxQueues'});db[_0x8f6c('0x132')][_0x8f6c('0x12d')](db[_0x8f6c('0x5f')],{'through':_0x8f6c('0x18e'),'as':_0x8f6c('0x1d6')});db[_0x8f6c('0x132')][_0x8f6c('0x12d')](db['OpenchannelQueue'],{'through':_0x8f6c('0x192'),'as':'OpenchannelQueues'});db[_0x8f6c('0x132')][_0x8f6c('0x12d')](db['WhatsappQueue'],{'through':_0x8f6c('0x1d7'),'as':_0x8f6c('0x1d8')});db[_0x8f6c('0x132')]['belongsToMany'](db[_0x8f6c('0x104')],{'through':_0x8f6c('0x11c'),'as':_0x8f6c('0x1d9')});db[_0x8f6c('0xf3')][_0x8f6c('0x122')](db[_0x8f6c('0x79')],{'as':_0x8f6c('0x19e'),'foreignKey':'CampaignId'});db['Campaign'][_0x8f6c('0x122')](db[_0x8f6c('0x7b')],{'as':_0x8f6c('0x125'),'foreignKey':_0x8f6c('0x1a4')});db['Campaign'][_0x8f6c('0x122')](db['CmHopperHistory'],{'as':_0x8f6c('0x155'),'foreignKey':_0x8f6c('0x1a4')});db[_0x8f6c('0xf3')][_0x8f6c('0x122')](db[_0x8f6c('0x7a')],{'as':_0x8f6c('0x156'),'foreignKey':_0x8f6c('0x1a4')});db['Campaign'][_0x8f6c('0x12b')](db['Trunk'],{'as':'Trunk','foreignKey':_0x8f6c('0x158')});db[_0x8f6c('0xf3')][_0x8f6c('0x12b')](db['Trunk'],{'as':_0x8f6c('0x159'),'foreignKey':'TrunkBackupId'});db[_0x8f6c('0xf3')][_0x8f6c('0x12b')](db['Interval'],{'as':_0x8f6c('0x8a'),'foreignKey':_0x8f6c('0x17d')});db['Campaign'][_0x8f6c('0x12b')](db['SquareProject'],{'as':_0x8f6c('0xea'),'foreignKey':'SquareProjectId'});db[_0x8f6c('0xf3')][_0x8f6c('0x12d')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x131'),'through':_0x8f6c('0x1da')});db[_0x8f6c('0xf3')]['belongsToMany'](db['CmList'],{'as':_0x8f6c('0x15f'),'through':_0x8f6c('0x1db')});db['Attachment'][_0x8f6c('0x12b')](db[_0x8f6c('0x17a')],{'as':'ChatOfflineMessage','foreignKey':_0x8f6c('0x17b')});db['MailTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x45')],{});db[_0x8f6c('0xf9')][_0x8f6c('0x12b')](db['MailInteraction'],{});db[_0x8f6c('0xf9')][_0x8f6c('0x12b')](db[_0x8f6c('0x3e')],{'foreignKey':_0x8f6c('0x1dc'),'as':_0x8f6c('0x1dd')});db['MailTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':_0x8f6c('0x1de'),'as':_0x8f6c('0x1df')});db[_0x8f6c('0xf9')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db['MailTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x40')],{'foreignKey':_0x8f6c('0x1e0'),'as':_0x8f6c('0x1e1')});db[_0x8f6c('0xf9')][_0x8f6c('0x12b')](db['MailAccount'],{'foreignKey':_0x8f6c('0x1e2'),'as':_0x8f6c('0x1e3')});db[_0x8f6c('0xfb')][_0x8f6c('0x12b')](db[_0x8f6c('0x193')],{});db[_0x8f6c('0xfb')]['belongsTo'](db[_0x8f6c('0x127')],{});db[_0x8f6c('0xfb')][_0x8f6c('0x12b')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x8f6c('0x1dd')});db[_0x8f6c('0xfb')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':_0x8f6c('0x1de'),'as':_0x8f6c('0x1df')});db['ChatTransferReport'][_0x8f6c('0x12b')](db['User'],{'foreignKey':_0x8f6c('0x1e4'),'as':_0x8f6c('0x1e5')});db['ChatTransferReport'][_0x8f6c('0x12b')](db['ChatQueue'],{'foreignKey':_0x8f6c('0x1e6'),'as':_0x8f6c('0x1e1')});db[_0x8f6c('0xfb')]['belongsTo'](db[_0x8f6c('0x67')],{'foreignKey':'ToChatWebsiteId','as':_0x8f6c('0x1e3')});db['FaxTransferReport']['belongsTo'](db[_0x8f6c('0x52')],{});db[_0x8f6c('0xfd')][_0x8f6c('0x12b')](db[_0x8f6c('0x51')],{});db['FaxTransferReport']['belongsTo'](db[_0x8f6c('0x144')],{'foreignKey':_0x8f6c('0x1e7'),'as':'FromAccount'});db[_0x8f6c('0xfd')][_0x8f6c('0x12b')](db['User'],{'foreignKey':_0x8f6c('0x1de'),'as':_0x8f6c('0x1df')});db['FaxTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x8f6c('0x1e4'),'as':_0x8f6c('0x1e5')});db['FaxTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x54')],{'foreignKey':'ToFaxQueueId','as':_0x8f6c('0x1e1')});db['FaxTransferReport'][_0x8f6c('0x12b')](db['FaxAccount'],{'foreignKey':_0x8f6c('0x1e8'),'as':_0x8f6c('0x1e3')});db[_0x8f6c('0xff')][_0x8f6c('0x12b')](db[_0x8f6c('0x65')],{});db[_0x8f6c('0xff')][_0x8f6c('0x12b')](db[_0x8f6c('0x126')],{});db[_0x8f6c('0xff')][_0x8f6c('0x12b')](db['OpenchannelAccount'],{'foreignKey':_0x8f6c('0x1e9'),'as':_0x8f6c('0x1dd')});db[_0x8f6c('0xff')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':'FromUserId','as':_0x8f6c('0x1df')});db[_0x8f6c('0xff')]['belongsTo'](db['User'],{'foreignKey':_0x8f6c('0x1e4'),'as':_0x8f6c('0x1e5')});db['OpenchannelTransferReport'][_0x8f6c('0x12b')](db['OpenchannelQueue'],{'foreignKey':'ToOpenchannelQueueId','as':_0x8f6c('0x1e1')});db[_0x8f6c('0xff')]['belongsTo'](db[_0x8f6c('0x147')],{'foreignKey':_0x8f6c('0x1ea'),'as':'ToAccount'});db[_0x8f6c('0x101')][_0x8f6c('0x12b')](db['SmsMessage'],{});db[_0x8f6c('0x101')]['belongsTo'](db[_0x8f6c('0x5b')],{});db[_0x8f6c('0x101')][_0x8f6c('0x12b')](db[_0x8f6c('0x14a')],{'foreignKey':_0x8f6c('0x1eb'),'as':_0x8f6c('0x1dd')});db[_0x8f6c('0x101')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db['SmsTransferReport']['belongsTo'](db[_0x8f6c('0x12')],{'foreignKey':_0x8f6c('0x1e4'),'as':_0x8f6c('0x1e5')});db[_0x8f6c('0x101')][_0x8f6c('0x12b')](db['SmsQueue'],{'foreignKey':_0x8f6c('0x1ec'),'as':_0x8f6c('0x1e1')});db[_0x8f6c('0x101')][_0x8f6c('0x12b')](db[_0x8f6c('0x14a')],{'foreignKey':_0x8f6c('0x1ed'),'as':_0x8f6c('0x1e3')});db[_0x8f6c('0x103')][_0x8f6c('0x122')](db[_0x8f6c('0x87')],{'as':_0x8f6c('0x189'),'foreignKey':'ListId','onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x103')]['hasMany'](db[_0x8f6c('0x80')],{'as':_0x8f6c('0x1ee'),'foreignKey':_0x8f6c('0x16b')});db['CmList'][_0x8f6c('0x122')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x12f'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x103')][_0x8f6c('0x122')](db[_0x8f6c('0x7b')],{'as':_0x8f6c('0x125'),'foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x103')]['hasMany'](db[_0x8f6c('0x7d')],{'as':_0x8f6c('0x1ef'),'foreignKey':_0x8f6c('0x16b')});db['CmList'][_0x8f6c('0x122')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x103')]['belongsToMany'](db[_0x8f6c('0x1b')],{'as':_0x8f6c('0x1f0'),'through':_0x8f6c('0x1f1')});db[_0x8f6c('0x103')][_0x8f6c('0x12d')](db['User'],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x143')});db[_0x8f6c('0x104')][_0x8f6c('0x122')](db[_0x8f6c('0x18')],{'as':_0x8f6c('0x124'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x104')]['belongsToMany'](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x13b')});db[_0x8f6c('0x104')][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'through':'TeamVoicePrefix','as':_0x8f6c('0x15e')});db[_0x8f6c('0x106')][_0x8f6c('0x122')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x176'),'foreignKey':'userProfileId'});db[_0x8f6c('0x106')][_0x8f6c('0x122')](db[_0x8f6c('0x1f2')],{'as':_0x8f6c('0x1f3'),'foreignKey':'userProfileId','onDelete':_0x8f6c('0x120')});db['UserProfileSection'][_0x8f6c('0x122')](db[_0x8f6c('0x108')],{'as':_0x8f6c('0x1f4'),'foreignKey':_0x8f6c('0x1f5'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x10c')][_0x8f6c('0x122')](db[_0x8f6c('0x87')],{'as':_0x8f6c('0x189'),'foreignKey':_0x8f6c('0x1f6'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x10c')][_0x8f6c('0x122')](db[_0x8f6c('0x85')],{'as':_0x8f6c('0x168'),'foreignKey':_0x8f6c('0x1f6')});db[_0x8f6c('0x10c')]['hasMany'](db[_0x8f6c('0x112')],{'as':'Messages','foreignKey':_0x8f6c('0x1f6')});db['WhatsappAccount'][_0x8f6c('0x122')](db['WhatsappInteraction'],{'as':_0x8f6c('0x169')});db[_0x8f6c('0x10c')]['hasMany'](db[_0x8f6c('0x10e')],{'as':_0x8f6c('0x182')});db[_0x8f6c('0x10c')]['belongsTo'](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x10c')][_0x8f6c('0x12b')](db[_0x8f6c('0x15b')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8f6c('0x10c')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':'Agents','through':_0x8f6c('0x1f7')});db[_0x8f6c('0x10e')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'onDelete':'restrict'});db[_0x8f6c('0x10e')][_0x8f6c('0x12b')](db[_0x8f6c('0x116')],{'onDelete':'restrict'});db[_0x8f6c('0x10e')][_0x8f6c('0x12b')](db[_0x8f6c('0x10c')],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x10e')][_0x8f6c('0x12b')](db[_0x8f6c('0x8a')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x8f6c('0x10e')][_0x8f6c('0x12b')](db[_0x8f6c('0x92')],{'onDelete':_0x8f6c('0x17c'),'foreignKey':_0x8f6c('0x17e')});db['WhatsappInteraction'][_0x8f6c('0x122')](db['WhatsappMessage'],{'as':_0x8f6c('0x161'),'onDelete':_0x8f6c('0x120'),'foreignKey':'WhatsappInteractionId'});db[_0x8f6c('0x110')][_0x8f6c('0x12b')](db['WhatsappAccount'],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1f6')});db['WhatsappInteraction'][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x186'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x1b5'),'as':'Tags'});db[_0x8f6c('0x110')]['belongsToMany'](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x1b5'),'as':_0x8f6c('0x175')});db[_0x8f6c('0x110')][_0x8f6c('0x12d')](db['User'],{'as':_0x8f6c('0x176'),'through':_0x8f6c('0x139'),'foreignKey':_0x8f6c('0x1f8')});db[_0x8f6c('0x112')]['belongsTo'](db[_0x8f6c('0x12')],{'as':'User'});db[_0x8f6c('0x112')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'onDelete':_0x8f6c('0x120'),'as':_0x8f6c('0x172')});db[_0x8f6c('0x112')][_0x8f6c('0x12b')](db[_0x8f6c('0x110')],{'onDelete':'cascade','as':_0x8f6c('0x178'),'foreignKey':'WhatsappInteractionId'});db[_0x8f6c('0x112')][_0x8f6c('0x12b')](db[_0x8f6c('0x10c')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x8f6c('0x114')]['belongsTo'](db[_0x8f6c('0x10c')],{});db[_0x8f6c('0x114')]['belongsTo'](db['CmList'],{'as':_0x8f6c('0x16a'),'foreignKey':_0x8f6c('0x16b')});db['WhatsappQueueReport'][_0x8f6c('0x12b')](db['CmContact'],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x114')][_0x8f6c('0x12b')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x8f6c('0x116')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x8f6c('0x112')],{});db[_0x8f6c('0x114')]['belongsTo'](db[_0x8f6c('0x12')],{});db[_0x8f6c('0x115')][_0x8f6c('0x12b')](db[_0x8f6c('0x112')],{});db['WhatsappTransferReport'][_0x8f6c('0x12b')](db['WhatsappInteraction'],{});db['WhatsappTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x10c')],{'foreignKey':_0x8f6c('0x1f9'),'as':_0x8f6c('0x1dd')});db[_0x8f6c('0x115')][_0x8f6c('0x12b')](db[_0x8f6c('0x10c')],{'foreignKey':_0x8f6c('0x1fa'),'as':_0x8f6c('0x1e3')});db['WhatsappTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x116')],{'foreignKey':_0x8f6c('0x1fb'),'as':_0x8f6c('0x1e1')});db[_0x8f6c('0x115')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':_0x8f6c('0x1de'),'as':_0x8f6c('0x1df')});db['WhatsappTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':_0x8f6c('0x1e4'),'as':_0x8f6c('0x1e5')});db[_0x8f6c('0x116')][_0x8f6c('0x12d')](db['User'],{'as':'Agents','through':_0x8f6c('0x142'),'foreignKey':'WhatsappQueueId'});db[_0x8f6c('0x116')][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'through':_0x8f6c('0x1d7'),'as':_0x8f6c('0x15e')});module[_0x8f6c('0x1fc')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x946a=['../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../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','../api/squareReport/squareReport.model','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','MailInteractions','WhatsappInteractions','SenderId','belongsTo','UserProfile','belongsToMany','Groups','CmContact','Contacts','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteractions','user_has_openchannel_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','FaxQueue','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueue','WhatsappQueues','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccount','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','mailboxuser','VoiceQueueReport','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','hasOne','Imap','Dispositions','Interactions','MailApplication','Applications','List','ListId','TemplateId','Pause','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Users','Attachments','Interaction','restrict','MailQueue','TagId','FaxAccountId','Answers','Exntensions','Messages','FaxInteractionId','fax_interaction_has_tags','Tags','ThroughTags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','UserSmsQueue','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','ChatApplication','Agent','ChatQueue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CompanyId','Hoppers','cm_contact_has_tags','Campaign','CmHopperBlack','Queue','Condition','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','Configurations','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','Dynamics365Field','FreshsalesAccount','FromId','ToId','JscriptyProject','ProjectId','CampaignId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CmCustomField','CustomFields','Queues','userProfileId','Resources','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','exports','sequelize','lodash','jstz','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xcall','username','options','database','password','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model'];(function(_0x13ecbb,_0x28edda){var _0x35e0d7=function(_0x212fde){while(--_0x212fde){_0x13ecbb['push'](_0x13ecbb['shift']());}};_0x35e0d7(++_0x28edda);}(_0x946a,0x1a5));var _0xa946=function(_0x5e56a1,_0x4cafcc){_0x5e56a1=_0x5e56a1-0x0;var _0xc43831=_0x946a[_0x5e56a1];return _0xc43831;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xa946('0x0'));var _=require(_0xa946('0x1'));var jstz=require(_0xa946('0x2'));var timezone=jstz['determine']();config['sequelize']=_[_0xa946('0x3')](config[_0xa946('0x0')],{'database':_0xa946('0x4'),'username':'xcall','password':_0xa946('0x5'),'options':{'host':_0xa946('0x6'),'port':0xcea,'dialect':_0xa946('0x7'),'dialectOptions':{'charset':_0xa946('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xa946('0x9'),'collate':_0xa946('0xa')}}});config[_0xa946('0xb')]=_[_0xa946('0x3')](config[_0xa946('0xb')],{'database':_0xa946('0x4'),'username':_0xa946('0xc'),'password':_0xa946('0x5'),'options':{'host':_0xa946('0x6'),'port':0xcea,'dialect':_0xa946('0x7'),'dialectOptions':{'charset':_0xa946('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xa946('0x9'),'collate':_0xa946('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa946('0x0')]['database'],config[_0xa946('0x0')][_0xa946('0xd')],config[_0xa946('0x0')]['password'],config[_0xa946('0x0')][_0xa946('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa946('0xb')][_0xa946('0xf')],config[_0xa946('0xb')][_0xa946('0xd')],config['sequelizeHistory'][_0xa946('0x10')],config[_0xa946('0xb')][_0xa946('0xe')])};db[_0xa946('0x11')]=db[_0xa946('0x0')]['import'](_0xa946('0x12'));db[_0xa946('0x13')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x15'));db['VoiceContext']=db['sequelize'][_0xa946('0x14')](_0xa946('0x16'));db[_0xa946('0x17')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x18'));db[_0xa946('0x19')]=db[_0xa946('0x0')][_0xa946('0x14')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xa946('0x1a')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x1b'));db[_0xa946('0x1c')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x1d'));db[_0xa946('0x1e')]=db[_0xa946('0x0')][_0xa946('0x14')]('../api/screenRecording/screenRecording.model');db[_0xa946('0x1f')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x20'));db[_0xa946('0x21')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x22'));db[_0xa946('0x23')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x24'));db[_0xa946('0x25')]=db['sequelize'][_0xa946('0x14')]('../api/voiceDialReport/voiceDialReport.model');db[_0xa946('0x26')]=db[_0xa946('0x0')]['import'](_0xa946('0x27'));db['VoiceQueueReport']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x28'));db[_0xa946('0x29')]=db[_0xa946('0x0')]['import'](_0xa946('0x2a'));db[_0xa946('0x2b')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x2c'));db[_0xa946('0x2d')]=db[_0xa946('0x0')][_0xa946('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xa946('0x2e')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x2f'));db[_0xa946('0x30')]=db['sequelize']['import'](_0xa946('0x31'));db[_0xa946('0x32')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x33'));db['UserMailQueue']=db[_0xa946('0x0')][_0xa946('0x14')]('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x34'));db['UserSmsQueue']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x35'));db['UserOpenchannelQueue']=db[_0xa946('0x0')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xa946('0x36')]=db[_0xa946('0x0')][_0xa946('0x14')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xa946('0x37')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x38'));db[_0xa946('0x39')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x3a'));db[_0xa946('0x3b')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x3c'));db['MailQueue']=db['sequelize'][_0xa946('0x14')](_0xa946('0x3d'));db[_0xa946('0x3e')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x3f'));db[_0xa946('0x40')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x41'));db[_0xa946('0x42')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x43'));db['MailApplication']=db[_0xa946('0x0')][_0xa946('0x14')]('../api/mailApplication/mailApplication.model');db[_0xa946('0x44')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x45'));db[_0xa946('0x46')]=db[_0xa946('0x0')][_0xa946('0x14')]('../api/dashboard/dashboard.model');db[_0xa946('0x47')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x48'));db[_0xa946('0x49')]=db['sequelize']['import']('../api/faxAccount/faxAccount.model');db[_0xa946('0x4a')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x4b'));db[_0xa946('0x4c')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x4d'));db[_0xa946('0x4e')]=db[_0xa946('0x0')]['import'](_0xa946('0x4f'));db['FaxQueue']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x50'));db[_0xa946('0x51')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x52'));db[_0xa946('0x53')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x54'));db[_0xa946('0x55')]=db[_0xa946('0x0')]['import'](_0xa946('0x56'));db[_0xa946('0x57')]=db[_0xa946('0x0')]['import'](_0xa946('0x58'));db[_0xa946('0x59')]=db[_0xa946('0x0')][_0xa946('0x14')]('../api/smsMessage/smsMessage.model');db[_0xa946('0x5a')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x5b'));db[_0xa946('0x5c')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x5d'));db[_0xa946('0x5e')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x5f'));db[_0xa946('0x60')]=db[_0xa946('0x0')][_0xa946('0x14')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0xa946('0x61')]=db['sequelize'][_0xa946('0x14')]('../api/openchannelMessage/openchannelMessage.model');db[_0xa946('0x62')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x63'));db[_0xa946('0x64')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x65'));db[_0xa946('0x66')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x67'));db['ChatApplication']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x68'));db[_0xa946('0x69')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x6a'));db[_0xa946('0x6b')]=db[_0xa946('0x0')]['import']('../api/chatMessage/chatMessage.model');db[_0xa946('0x6c')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x6d'));db['ChatQueue']=db['sequelize'][_0xa946('0x14')]('../api/chatQueue/chatQueue.model');db[_0xa946('0x6e')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x6f'));db[_0xa946('0x70')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x71'));db[_0xa946('0x72')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x73'));db['CmContact']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x74'));db[_0xa946('0x75')]=db['sequelize']['import'](_0xa946('0x76'));db['CmHopperBlack']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x77'));db[_0xa946('0x78')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x79'));db['CmHopperHistory']=db['sequelize'][_0xa946('0x14')](_0xa946('0x7a'));db[_0xa946('0x7b')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x7c'));db['CmCustomField']=db[_0xa946('0x0')][_0xa946('0x14')]('../api/cmCustomField/cmCustomField.model');db[_0xa946('0x7d')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x7e'));db[_0xa946('0x7f')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x80'));db[_0xa946('0x81')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x82'));db[_0xa946('0x83')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x84'));db['Condition']=db[_0xa946('0x0')][_0xa946('0x14')]('../api/condition/condition.model');db[_0xa946('0x85')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x86'));db['Pause']=db['sequelize']['import'](_0xa946('0x87'));db['Cdr']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x88'));db[_0xa946('0x89')]=db[_0xa946('0x0')][_0xa946('0x14')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db['sequelize']['import'](_0xa946('0x8a'));db[_0xa946('0x8b')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x8c'));db[_0xa946('0x8d')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x8e'));db[_0xa946('0x8f')]=db[_0xa946('0x0')]['import'](_0xa946('0x90'));db[_0xa946('0x91')]=db['sequelize']['import'](_0xa946('0x92'));db[_0xa946('0x93')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x94'));db[_0xa946('0x95')]=db[_0xa946('0x0')]['import'](_0xa946('0x96'));db[_0xa946('0x97')]=db[_0xa946('0x0')]['import'](_0xa946('0x98'));db[_0xa946('0x99')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x9a'));db[_0xa946('0x9b')]=db[_0xa946('0x0')][_0xa946('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x9c'));db[_0xa946('0x9d')]=db[_0xa946('0x0')]['import'](_0xa946('0x9e'));db[_0xa946('0x9f')]=db['sequelize'][_0xa946('0x14')](_0xa946('0xa0'));db[_0xa946('0xa1')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xa2'));db[_0xa946('0xa3')]=db['sequelize']['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xa946('0xa4')]=db['sequelize']['import'](_0xa946('0xa5'));db['SalesforceField']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xa6'));db['SugarcrmAccount']=db['sequelize'][_0xa946('0x14')](_0xa946('0xa7'));db[_0xa946('0xa8')]=db[_0xa946('0x0')]['import'](_0xa946('0xa9'));db[_0xa946('0xaa')]=db[_0xa946('0x0')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0xa946('0xab')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xac'));db[_0xa946('0xad')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xae'));db[_0xa946('0xaf')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xb0'));db[_0xa946('0xb1')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xb2'));db[_0xa946('0xb3')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xb4'));db[_0xa946('0xb5')]=db[_0xa946('0x0')][_0xa946('0x14')]('../api/intZohoField/intZohoField.model');db[_0xa946('0xb6')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xb7'));db[_0xa946('0xb8')]=db[_0xa946('0x0')]['import'](_0xa946('0xb9'));db[_0xa946('0xba')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xbb'));db[_0xa946('0xbc')]=db[_0xa946('0x0')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize']['import'](_0xa946('0xbd'));db[_0xa946('0xbe')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xbf'));db[_0xa946('0xc0')]=db[_0xa946('0x0')]['import'](_0xa946('0xc1'));db[_0xa946('0xc2')]=db['sequelize'][_0xa946('0x14')](_0xa946('0xc3'));db[_0xa946('0xc4')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xc5'));db[_0xa946('0xc6')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xc7'));db[_0xa946('0xc8')]=db['sequelize'][_0xa946('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xa946('0xc9')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xca'));db[_0xa946('0xcb')]=db[_0xa946('0x0')]['import'](_0xa946('0xcc'));db[_0xa946('0xcd')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xce'));db['Dynamics365Field']=db[_0xa946('0x0')][_0xa946('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xcf'));db[_0xa946('0xd0')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xd1'));db[_0xa946('0xd2')]=db[_0xa946('0x0')]['import'](_0xa946('0xd3'));db[_0xa946('0x95')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x96'));db['Network']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xd4'));db[_0xa946('0xd5')]=db['sequelize'][_0xa946('0x14')](_0xa946('0xd6'));db[_0xa946('0xd7')]=db['sequelize'][_0xa946('0x14')](_0xa946('0xd8'));db[_0xa946('0xd9')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xda'));db[_0xa946('0xdb')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xdc'));db[_0xa946('0xdd')]=db['sequelize'][_0xa946('0x14')](_0xa946('0xde'));db[_0xa946('0xdf')]=db['sequelize'][_0xa946('0x14')](_0xa946('0xe0'));db['SquareReport']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xe1'));db[_0xa946('0xe2')]=db[_0xa946('0x0')]['import']('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0xa946('0x0')]['import'](_0xa946('0xe3'));db[_0xa946('0xe4')]=db['sequelize'][_0xa946('0x14')](_0xa946('0xe5'));db[_0xa946('0xe6')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xe7'));db['SquareProject']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xe8'));db[_0xa946('0xe9')]=db['sequelize']['import']('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xea'));db['Team']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xeb'));db[_0xa946('0xec')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xed'));db['Campaign']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xee'));db[_0xa946('0xef')]=db[_0xa946('0x0')][_0xa946('0x14')]('../api/migration/migration.model');db[_0xa946('0xf0')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xf1'));db[_0xa946('0xf2')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xf3'));db[_0xa946('0xf4')]=db[_0xa946('0x0')][_0xa946('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0xa946('0xf5')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0xf6'));db[_0xa946('0xf7')]=db['sequelize'][_0xa946('0x14')](_0xa946('0xf8'));db[_0xa946('0xf9')]=db['sequelize'][_0xa946('0x14')](_0xa946('0xfa'));db[_0xa946('0xfb')]=db['sequelize'][_0xa946('0x14')](_0xa946('0xfc'));db[_0xa946('0xfd')]=db[_0xa946('0x0')]['import'](_0xa946('0xfe'));db['VoicePrefix']=db[_0xa946('0x0')]['import']('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0xa946('0x0')]['import'](_0xa946('0xff'));db[_0xa946('0x100')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x101'));db[_0xa946('0x102')]=db['sequelize']['import'](_0xa946('0x103'));db[_0xa946('0x104')]=db[_0xa946('0x0')]['import'](_0xa946('0x105'));db['WhatsappAccount']=db[_0xa946('0x0')][_0xa946('0x14')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x106'));db[_0xa946('0x107')]=db[_0xa946('0x0')]['import'](_0xa946('0x108'));db[_0xa946('0x109')]=db[_0xa946('0x0')]['import'](_0xa946('0x10a'));db[_0xa946('0x10b')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x10c'));db[_0xa946('0x10d')]=db['sequelize'][_0xa946('0x14')](_0xa946('0x10e'));db['WhatsappQueue']=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x10f'));db[_0xa946('0x110')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x111'));db[_0xa946('0x112')]=db['sequelize'][_0xa946('0x14')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xa946('0x113')]=db[_0xa946('0x0')]['import'](_0xa946('0x114'));db[_0xa946('0x115')]=db[_0xa946('0x0')][_0xa946('0x14')](_0xa946('0x116'));db[_0xa946('0x11')]['hasOne'](db[_0xa946('0x1f')],{'as':'VoiceMail','onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x118')});db[_0xa946('0x11')][_0xa946('0x119')](db['VoiceRecording'],{'as':_0xa946('0x11a'),'foreignKey':_0xa946('0x118')});db['User'][_0xa946('0x119')](db['UserVoiceQueueRt'],{'as':_0xa946('0x11b'),'foreignKey':_0xa946('0x118')});db[_0xa946('0x11')][_0xa946('0x119')](db[_0xa946('0x17')],{'as':'Extensions','onDelete':_0xa946('0x117'),'hooks':!![]});db['User']['hasMany'](db[_0xa946('0x78')],{'as':_0xa946('0x11c'),'foreignKey':'UserId'});db['User'][_0xa946('0x119')](db[_0xa946('0x11d')],{'as':_0xa946('0x11e'),'foreignKey':_0xa946('0x118')});db[_0xa946('0x11')][_0xa946('0x119')](db[_0xa946('0x7b')],{'as':'ReportAgentPreview','foreignKey':_0xa946('0x118')});db[_0xa946('0x11')]['hasMany'](db[_0xa946('0x60')],{'as':_0xa946('0x11f'),'foreignKey':_0xa946('0x118')});db[_0xa946('0x11')][_0xa946('0x119')](db[_0xa946('0x69')],{'as':_0xa946('0x120'),'foreignKey':_0xa946('0x118')});db[_0xa946('0x11')][_0xa946('0x119')](db[_0xa946('0x57')],{'as':'SmsInteractions','foreignKey':'UserId'});db['User']['hasMany'](db[_0xa946('0x4c')],{'as':'FaxInteractions','foreignKey':_0xa946('0x118')});db[_0xa946('0x11')][_0xa946('0x119')](db[_0xa946('0x40')],{'as':_0xa946('0x121'),'foreignKey':_0xa946('0x118')});db[_0xa946('0x11')][_0xa946('0x119')](db[_0xa946('0x107')],{'as':_0xa946('0x122'),'foreignKey':_0xa946('0x118')});db[_0xa946('0x11')]['hasMany'](db[_0xa946('0x104')],{'as':'UserNotifications','foreignKey':_0xa946('0x123')});db[_0xa946('0x11')][_0xa946('0x124')](db['UserProfile'],{'as':_0xa946('0x125'),'foreignKey':'userProfileId'});db[_0xa946('0x11')][_0xa946('0x126')](db[_0xa946('0x6e')],{'as':_0xa946('0x127'),'through':'chat_group_has_users'});db[_0xa946('0x11')]['belongsToMany'](db[_0xa946('0x128')],{'as':_0xa946('0x129'),'through':'cm_user_has_contacts'});db[_0xa946('0x11')]['belongsToMany'](db[_0xa946('0xfd')],{'as':'Lists','through':_0xa946('0x12a')});db[_0xa946('0x11')]['belongsToMany'](db[_0xa946('0x12b')],{'through':_0xa946('0x12c')});db[_0xa946('0x11')][_0xa946('0x126')](db[_0xa946('0x40')],{'as':'MailInteractions','through':_0xa946('0x12d')});db['User'][_0xa946('0x126')](db[_0xa946('0x69')],{'as':_0xa946('0x120'),'through':_0xa946('0x12e')});db[_0xa946('0x11')][_0xa946('0x126')](db[_0xa946('0x4c')],{'as':_0xa946('0x12f'),'through':_0xa946('0x130')});db[_0xa946('0x11')][_0xa946('0x126')](db[_0xa946('0x57')],{'as':_0xa946('0x131'),'through':'user_has_sms_interactions'});db[_0xa946('0x11')][_0xa946('0x126')](db[_0xa946('0x60')],{'as':_0xa946('0x11f'),'through':_0xa946('0x132')});db[_0xa946('0x11')]['belongsToMany'](db[_0xa946('0x107')],{'as':_0xa946('0x122'),'through':'user_has_whatsapp_interactions'});db[_0xa946('0x11')][_0xa946('0x126')](db['VoiceQueue'],{'as':_0xa946('0x133'),'through':_0xa946('0x30'),'required':![]});db[_0xa946('0x11')][_0xa946('0x126')](db[_0xa946('0x134')],{'as':_0xa946('0x135'),'through':'UserVoicePrefix','required':![]});db[_0xa946('0x11')]['belongsToMany'](db['MailQueue'],{'as':_0xa946('0x136'),'through':_0xa946('0x137'),'required':![]});db[_0xa946('0x11')][_0xa946('0x126')](db['ChatQueue'],{'as':_0xa946('0x138'),'through':_0xa946('0x32'),'required':![],'hooks':!![]});db[_0xa946('0x11')][_0xa946('0x126')](db[_0xa946('0x139')],{'as':_0xa946('0x13a'),'through':_0xa946('0x13b'),'required':![]});db['User'][_0xa946('0x126')](db[_0xa946('0x5a')],{'as':_0xa946('0x13c'),'through':'UserSmsQueue','required':![]});db[_0xa946('0x11')]['belongsToMany'](db['OpenchannelQueue'],{'as':_0xa946('0x13d'),'through':_0xa946('0x13e'),'required':![]});db[_0xa946('0x11')][_0xa946('0x126')](db[_0xa946('0x13f')],{'as':_0xa946('0x140'),'through':_0xa946('0x36'),'required':![]});db['User']['belongsToMany'](db['CmList'],{'through':_0xa946('0x12a')});db['User'][_0xa946('0x126')](db[_0xa946('0x64')],{'as':'ChatWebsites','through':_0xa946('0x141')});db[_0xa946('0x11')][_0xa946('0x126')](db[_0xa946('0x49')],{'as':_0xa946('0x142'),'through':_0xa946('0x143')});db[_0xa946('0x11')]['belongsToMany'](db[_0xa946('0x3b')],{'as':_0xa946('0x144'),'through':_0xa946('0x145')});db[_0xa946('0x11')][_0xa946('0x126')](db['OpenchannelAccount'],{'as':_0xa946('0x146'),'through':_0xa946('0x147')});db[_0xa946('0x11')][_0xa946('0x126')](db[_0xa946('0x53')],{'as':'SmsAccounts','through':_0xa946('0x148')});db['User'][_0xa946('0x126')](db[_0xa946('0x149')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0xa946('0x11')][_0xa946('0x126')](db[_0xa946('0x14a')],{'as':_0xa946('0x14b'),'through':_0xa946('0x14c')});db[_0xa946('0x13')][_0xa946('0x119')](db[_0xa946('0x17')],{'as':_0xa946('0x14d'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x14e')});db[_0xa946('0x14f')][_0xa946('0x119')](db[_0xa946('0x17')],{'onDelete':_0xa946('0x117')});db[_0xa946('0x17')]['hasMany'](db[_0xa946('0x17')],{'as':'Applications','onDelete':_0xa946('0x117')});db[_0xa946('0x19')][_0xa946('0x126')](db[_0xa946('0x8b')],{'as':_0xa946('0x150'),'through':_0xa946('0x151')});db['VoiceQueue'][_0xa946('0x119')](db['UserVoiceQueueRt'],{'as':_0xa946('0x152'),'foreignKey':'VoiceQueueId'});db[_0xa946('0x1a')]['hasMany'](db[_0xa946('0x75')],{'as':'Hoppers','foreignKey':_0xa946('0x153')});db[_0xa946('0x1a')][_0xa946('0x119')](db[_0xa946('0x78')],{'as':_0xa946('0x11c'),'foreignKey':'VoiceQueueId'});db[_0xa946('0x1a')][_0xa946('0x119')](db[_0xa946('0x11d')],{'as':_0xa946('0x154'),'foreignKey':_0xa946('0x153')});db['VoiceQueue'][_0xa946('0x119')](db[_0xa946('0x7b')],{'as':_0xa946('0x7b'),'foreignKey':_0xa946('0x153')});db[_0xa946('0x1a')][_0xa946('0x119')](db['CmHopperBlack'],{'as':_0xa946('0x155'),'foreignKey':'VoiceQueueId'});db[_0xa946('0x1a')][_0xa946('0x119')](db['JscriptySessionReport'],{'as':_0xa946('0x156'),'foreignKey':_0xa946('0x153')});db[_0xa946('0x1a')]['belongsTo'](db['Trunk'],{'as':_0xa946('0x2b'),'foreignKey':_0xa946('0x157')});db[_0xa946('0x1a')][_0xa946('0x124')](db[_0xa946('0x2b')],{'as':_0xa946('0x158'),'foreignKey':_0xa946('0x159')});db[_0xa946('0x1a')][_0xa946('0x124')](db[_0xa946('0x85')],{'as':'Interval','foreignKey':_0xa946('0x15a')});db[_0xa946('0x1a')][_0xa946('0x124')](db['Pause'],{'as':_0xa946('0x15b'),'foreignKey':_0xa946('0x15c')});db[_0xa946('0x1a')][_0xa946('0x126')](db[_0xa946('0xfd')],{'as':_0xa946('0x15d'),'through':_0xa946('0x15e')});db[_0xa946('0x1a')]['belongsToMany'](db[_0xa946('0x11')],{'as':_0xa946('0x15f'),'through':_0xa946('0x30')});db[_0xa946('0x1a')][_0xa946('0x126')](db[_0xa946('0x12b')],{'as':_0xa946('0x160'),'through':_0xa946('0x112')});db[_0xa946('0x1a')]['belongsToMany'](db[_0xa946('0xfd')],{'as':_0xa946('0x161'),'through':'voice_queues_has_cm_blacklists'});db[_0xa946('0x1c')][_0xa946('0x124')](db['User'],{'as':'User','foreignKey':_0xa946('0x118')});db[_0xa946('0x1e')][_0xa946('0x124')](db[_0xa946('0x11')],{'as':_0xa946('0x11'),'foreignKey':'UserId'});db[_0xa946('0x1f')][_0xa946('0x119')](db[_0xa946('0x21')],{'as':'Messages','onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x162'),'sourceKey':'mailbox'});db['VoiceMailMessage'][_0xa946('0x124')](db[_0xa946('0x1f')],{'foreignKey':_0xa946('0x162'),'targetKey':'mailbox'});db[_0xa946('0x23')]['hasMany'](db[_0xa946('0x163')],{'as':_0xa946('0x164'),'foreignKey':_0xa946('0x165'),'constraints':![]});db[_0xa946('0x23')]['hasMany'](db[_0xa946('0x26')],{'as':'AgentReports','foreignKey':_0xa946('0x165'),'constraints':![]});db[_0xa946('0x23')][_0xa946('0x124')](db['User'],{'as':_0xa946('0x11'),'foreignKey':_0xa946('0x118')});db['VoiceCallReport'][_0xa946('0x124')](db[_0xa946('0x128')],{'as':_0xa946('0x166'),'foreignKey':_0xa946('0x167')});db['MailServerIn'][_0xa946('0x124')](db[_0xa946('0x3b')],{'as':_0xa946('0x3b'),'foreignKey':_0xa946('0x168')});db[_0xa946('0x39')]['belongsTo'](db[_0xa946('0x3b')],{'as':_0xa946('0x3b'),'foreignKey':_0xa946('0x168')});db[_0xa946('0x3b')][_0xa946('0x169')](db[_0xa946('0x37')],{'as':_0xa946('0x16a'),'onDelete':_0xa946('0x117')});db[_0xa946('0x3b')][_0xa946('0x169')](db[_0xa946('0x39')],{'as':'Smtp','onDelete':_0xa946('0x117')});db[_0xa946('0x3b')]['hasMany'](db[_0xa946('0x83')],{'as':_0xa946('0x16b'),'foreignKey':_0xa946('0x168'),'onDelete':_0xa946('0x117')});db[_0xa946('0x3b')][_0xa946('0x119')](db[_0xa946('0x81')],{'as':'Answers','foreignKey':_0xa946('0x168')});db[_0xa946('0x3b')][_0xa946('0x119')](db[_0xa946('0x42')],{'as':'Messages','foreignKey':'MailAccountId'});db[_0xa946('0x3b')]['hasMany'](db[_0xa946('0x40')],{'as':_0xa946('0x16c')});db['MailAccount'][_0xa946('0x119')](db[_0xa946('0x16d')],{'as':_0xa946('0x16e')});db[_0xa946('0x3b')][_0xa946('0x124')](db[_0xa946('0xfd')],{'as':_0xa946('0x16f'),'foreignKey':_0xa946('0x170')});db[_0xa946('0x3b')][_0xa946('0x124')](db[_0xa946('0x8f')],{'as':_0xa946('0x8f'),'foreignKey':_0xa946('0x171')});db[_0xa946('0x3b')]['belongsTo'](db[_0xa946('0x172')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xa946('0x3b')][_0xa946('0x126')](db[_0xa946('0x11')],{'as':_0xa946('0x15f'),'through':_0xa946('0x145')});db['MailQueue'][_0xa946('0x126')](db['User'],{'as':_0xa946('0x15f'),'through':_0xa946('0x137')});db['MailQueue'][_0xa946('0x126')](db[_0xa946('0x12b')],{'through':_0xa946('0x173'),'as':'Teams'});db['MailInteraction']['hasMany'](db[_0xa946('0x42')],{'as':'Messages','onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x174')});db['MailInteraction'][_0xa946('0x124')](db[_0xa946('0x3b')],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x168')});db[_0xa946('0x40')][_0xa946('0x124')](db[_0xa946('0x128')],{'as':_0xa946('0x166'),'foreignKey':_0xa946('0x167')});db['MailInteraction'][_0xa946('0x124')](db[_0xa946('0x11')],{'as':_0xa946('0x176'),'foreignKey':_0xa946('0x118')});db['MailInteraction'][_0xa946('0x126')](db[_0xa946('0x8d')],{'through':_0xa946('0x177'),'as':'Tags'});db[_0xa946('0x40')]['belongsToMany'](db['Tag'],{'through':_0xa946('0x177'),'as':'ThroughTags'});db[_0xa946('0x40')]['belongsToMany'](db[_0xa946('0x11')],{'as':_0xa946('0x178'),'through':_0xa946('0x12d'),'foreignKey':'MailInteractionId'});db[_0xa946('0x42')]['hasMany'](db[_0xa946('0xf0')],{'as':_0xa946('0x179'),'onDelete':_0xa946('0x117')});db[_0xa946('0x42')][_0xa946('0x124')](db[_0xa946('0x11')],{'as':_0xa946('0x11')});db[_0xa946('0x42')][_0xa946('0x124')](db[_0xa946('0x128')],{'onDelete':_0xa946('0x117'),'as':_0xa946('0x166')});db[_0xa946('0x42')][_0xa946('0x124')](db['MailInteraction'],{'as':_0xa946('0x17a'),'foreignKey':'MailInteractionId'});db[_0xa946('0x42')][_0xa946('0x124')](db[_0xa946('0x3b')],{'as':_0xa946('0x175'),'foreignKey':'MailAccountId'});db[_0xa946('0x42')][_0xa946('0x124')](db[_0xa946('0x64')],{'as':_0xa946('0x64'),'foreignKey':'ChatWebsiteId'});db[_0xa946('0x42')][_0xa946('0x124')](db[_0xa946('0x6c')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0xa946('0x16d')]['belongsTo'](db['User'],{'onDelete':_0xa946('0x17b')});db[_0xa946('0x16d')][_0xa946('0x124')](db[_0xa946('0x17c')],{'onDelete':'restrict'});db[_0xa946('0x16d')][_0xa946('0x124')](db[_0xa946('0x3b')],{'onDelete':_0xa946('0x17b')});db[_0xa946('0x16d')][_0xa946('0x124')](db[_0xa946('0x85')],{'onDelete':_0xa946('0x17b'),'foreignKey':_0xa946('0x15a')});db[_0xa946('0x16d')][_0xa946('0x124')](db[_0xa946('0x8d')],{'onDelete':'restrict','foreignKey':_0xa946('0x17d')});db[_0xa946('0x44')]['belongsTo'](db[_0xa946('0x3b')],{});db[_0xa946('0x44')][_0xa946('0x124')](db[_0xa946('0xfd')],{'as':_0xa946('0x16f'),'foreignKey':'ListId'});db['MailQueueReport'][_0xa946('0x124')](db[_0xa946('0x128')],{'as':_0xa946('0x166'),'foreignKey':_0xa946('0x167')});db[_0xa946('0x44')][_0xa946('0x124')](db[_0xa946('0x40')],{});db[_0xa946('0x44')][_0xa946('0x124')](db[_0xa946('0x42')],{});db[_0xa946('0x44')]['belongsTo'](db[_0xa946('0x11')],{});db[_0xa946('0x44')]['belongsTo'](db[_0xa946('0x17c')],{});db[_0xa946('0x46')][_0xa946('0x119')](db[_0xa946('0x47')],{'as':'Items','onDelete':_0xa946('0x117')});db[_0xa946('0x49')][_0xa946('0x119')](db[_0xa946('0x83')],{'as':'Dispositions','foreignKey':_0xa946('0x17e'),'onDelete':_0xa946('0x117')});db[_0xa946('0x49')][_0xa946('0x119')](db['CannedAnswer'],{'as':_0xa946('0x17f'),'foreignKey':_0xa946('0x17e')});db['FaxAccount']['hasMany'](db['FaxInteraction'],{'as':_0xa946('0x16c')});db[_0xa946('0x49')]['hasMany'](db['FaxApplication'],{'as':'Applications'});db[_0xa946('0x49')][_0xa946('0x119')](db['VoiceExtension'],{'as':_0xa946('0x180'),'onDelete':_0xa946('0x117')});db[_0xa946('0x49')]['hasMany'](db[_0xa946('0x4e')],{'as':_0xa946('0x181')});db['FaxAccount']['belongsTo'](db[_0xa946('0x2b')],{'as':_0xa946('0x2b')});db['FaxAccount'][_0xa946('0x124')](db[_0xa946('0xfd')],{'as':_0xa946('0x16f'),'foreignKey':_0xa946('0x170')});db[_0xa946('0x49')]['belongsTo'](db[_0xa946('0x172')],{'as':_0xa946('0x15b'),'foreignKey':_0xa946('0x15c')});db['FaxAccount']['belongsToMany'](db['User'],{'as':_0xa946('0x15f'),'through':_0xa946('0x143')});db['FaxApplication'][_0xa946('0x124')](db[_0xa946('0x11')],{'onDelete':'restrict'});db[_0xa946('0x4a')][_0xa946('0x124')](db[_0xa946('0x139')],{'onDelete':'restrict'});db[_0xa946('0x4a')]['belongsTo'](db[_0xa946('0x49')],{'onDelete':_0xa946('0x17b')});db['FaxApplication']['belongsTo'](db[_0xa946('0x8d')],{'onDelete':'restrict','foreignKey':'TagId'});db['FaxInteraction'][_0xa946('0x119')](db[_0xa946('0x4e')],{'as':_0xa946('0x181'),'onDelete':'cascade','foreignKey':_0xa946('0x182')});db[_0xa946('0x4c')]['belongsTo'](db[_0xa946('0x49')],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x17e')});db[_0xa946('0x4c')][_0xa946('0x124')](db[_0xa946('0x128')],{'as':'Contact','foreignKey':_0xa946('0x167')});db[_0xa946('0x4c')][_0xa946('0x124')](db[_0xa946('0x11')],{'as':_0xa946('0x176'),'foreignKey':'UserId'});db[_0xa946('0x4c')][_0xa946('0x126')](db[_0xa946('0x8d')],{'through':_0xa946('0x183'),'as':_0xa946('0x184')});db[_0xa946('0x4c')]['belongsToMany'](db[_0xa946('0x8d')],{'through':_0xa946('0x183'),'as':_0xa946('0x185')});db['FaxInteraction'][_0xa946('0x126')](db[_0xa946('0x11')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db['FaxMessage']['belongsTo'](db[_0xa946('0x11')],{'onDelete':_0xa946('0x117'),'as':_0xa946('0x11')});db[_0xa946('0x4e')][_0xa946('0x124')](db[_0xa946('0x4c')],{'as':_0xa946('0x17a'),'foreignKey':'FaxInteractionId'});db['FaxMessage']['belongsTo'](db[_0xa946('0x128')],{'onDelete':_0xa946('0x117'),'as':_0xa946('0x166')});db['FaxMessage']['belongsTo'](db[_0xa946('0xf0')],{'as':_0xa946('0xf0'),'foreignKey':_0xa946('0x186')});db[_0xa946('0x4e')]['belongsTo'](db[_0xa946('0x49')],{'as':_0xa946('0x175'),'foreignKey':'FaxAccountId'});db['FaxQueue']['belongsToMany'](db[_0xa946('0x11')],{'as':_0xa946('0x15f'),'through':'UserFaxQueue'});db['FaxQueue'][_0xa946('0x126')](db[_0xa946('0x12b')],{'through':_0xa946('0x187'),'as':_0xa946('0x160')});db[_0xa946('0x51')][_0xa946('0x124')](db[_0xa946('0x49')],{});db[_0xa946('0x51')][_0xa946('0x124')](db['CmList'],{'as':_0xa946('0x16f'),'foreignKey':_0xa946('0x170')});db[_0xa946('0x51')]['belongsTo'](db[_0xa946('0x128')],{'as':'Contact','foreignKey':_0xa946('0x167')});db['FaxQueueReport']['belongsTo'](db[_0xa946('0x4c')],{});db['FaxQueueReport'][_0xa946('0x124')](db[_0xa946('0x4e')],{});db[_0xa946('0x51')][_0xa946('0x124')](db['User'],{});db[_0xa946('0x51')][_0xa946('0x124')](db['FaxQueue'],{});db[_0xa946('0x53')][_0xa946('0x119')](db[_0xa946('0x83')],{'as':'Dispositions','foreignKey':_0xa946('0x188'),'onDelete':_0xa946('0x117')});db[_0xa946('0x53')][_0xa946('0x119')](db[_0xa946('0x81')],{'as':_0xa946('0x17f'),'foreignKey':'SmsAccountId'});db[_0xa946('0x53')][_0xa946('0x119')](db[_0xa946('0x59')],{'as':'Messages','foreignKey':_0xa946('0x188')});db['SmsAccount'][_0xa946('0x119')](db[_0xa946('0x57')],{'as':_0xa946('0x16c')});db[_0xa946('0x53')][_0xa946('0x119')](db[_0xa946('0x55')],{'as':'Applications'});db['SmsAccount'][_0xa946('0x124')](db[_0xa946('0xfd')],{'as':_0xa946('0x16f'),'foreignKey':_0xa946('0x170')});db[_0xa946('0x53')][_0xa946('0x124')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xa946('0x15c')});db[_0xa946('0x53')][_0xa946('0x126')](db['User'],{'as':_0xa946('0x15f'),'through':_0xa946('0x148')});db[_0xa946('0x55')][_0xa946('0x124')](db[_0xa946('0x11')],{'onDelete':_0xa946('0x17b')});db[_0xa946('0x55')][_0xa946('0x124')](db['SmsQueue'],{'onDelete':_0xa946('0x17b')});db[_0xa946('0x55')][_0xa946('0x124')](db[_0xa946('0x53')],{'onDelete':_0xa946('0x17b')});db[_0xa946('0x55')][_0xa946('0x124')](db[_0xa946('0x85')],{'onDelete':'restrict','foreignKey':_0xa946('0x15a')});db[_0xa946('0x55')]['belongsTo'](db[_0xa946('0x8d')],{'onDelete':_0xa946('0x17b'),'foreignKey':_0xa946('0x17d')});db[_0xa946('0x57')][_0xa946('0x119')](db[_0xa946('0x59')],{'as':_0xa946('0x181'),'onDelete':'cascade','foreignKey':_0xa946('0x189')});db[_0xa946('0x57')][_0xa946('0x124')](db['SmsAccount'],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x188')});db['SmsInteraction'][_0xa946('0x124')](db[_0xa946('0x128')],{'as':_0xa946('0x166'),'foreignKey':_0xa946('0x167')});db[_0xa946('0x57')][_0xa946('0x124')](db[_0xa946('0x11')],{'as':_0xa946('0x176'),'foreignKey':'UserId'});db[_0xa946('0x57')]['belongsToMany'](db[_0xa946('0x8d')],{'through':_0xa946('0x18a'),'as':_0xa946('0x184')});db[_0xa946('0x57')][_0xa946('0x126')](db[_0xa946('0x8d')],{'through':_0xa946('0x18a'),'as':_0xa946('0x185')});db['SmsInteraction'][_0xa946('0x126')](db['User'],{'as':_0xa946('0x178'),'through':_0xa946('0x18b'),'foreignKey':_0xa946('0x189')});db[_0xa946('0x59')][_0xa946('0x124')](db[_0xa946('0x11')],{'as':_0xa946('0x11')});db[_0xa946('0x59')][_0xa946('0x124')](db[_0xa946('0x128')],{'onDelete':_0xa946('0x117'),'as':_0xa946('0x166')});db[_0xa946('0x59')]['belongsTo'](db[_0xa946('0x57')],{'onDelete':_0xa946('0x117'),'as':_0xa946('0x17a'),'foreignKey':_0xa946('0x189')});db[_0xa946('0x59')][_0xa946('0x124')](db[_0xa946('0x53')],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x188')});db['SmsQueue'][_0xa946('0x126')](db[_0xa946('0x11')],{'as':_0xa946('0x15f'),'through':_0xa946('0x18c'),'foreignKey':_0xa946('0x18d')});db[_0xa946('0x5a')][_0xa946('0x126')](db[_0xa946('0x12b')],{'through':_0xa946('0x18e'),'as':_0xa946('0x160')});db[_0xa946('0x5c')][_0xa946('0x119')](db[_0xa946('0x83')],{'as':'Dispositions','foreignKey':_0xa946('0x18f'),'onDelete':_0xa946('0x117')});db[_0xa946('0x5c')]['hasMany'](db[_0xa946('0x81')],{'as':_0xa946('0x17f'),'foreignKey':_0xa946('0x18f')});db['OpenchannelAccount'][_0xa946('0x119')](db[_0xa946('0x60')],{'as':_0xa946('0x16c'),'foreignKey':_0xa946('0x18f')});db[_0xa946('0x5c')][_0xa946('0x119')](db['OpenchannelMessage'],{'as':_0xa946('0x181'),'foreignKey':'OpenchannelAccountId'});db[_0xa946('0x5c')]['hasMany'](db[_0xa946('0x5e')],{'as':'Applications','foreignKey':_0xa946('0x18f')});db[_0xa946('0x5c')][_0xa946('0x124')](db[_0xa946('0xfd')],{'as':'List','foreignKey':_0xa946('0x170')});db[_0xa946('0x5c')][_0xa946('0x124')](db['Pause'],{'as':_0xa946('0x15b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa946('0x5c')][_0xa946('0x126')](db['User'],{'as':_0xa946('0x15f'),'through':_0xa946('0x147')});db[_0xa946('0x5e')][_0xa946('0x124')](db['User'],{'onDelete':'restrict'});db[_0xa946('0x5e')][_0xa946('0x124')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication']['belongsTo'](db[_0xa946('0x5c')],{'onDelete':_0xa946('0x17b'),'foreignKey':_0xa946('0x18f')});db[_0xa946('0x5e')][_0xa946('0x124')](db[_0xa946('0x85')],{'onDelete':_0xa946('0x17b'),'foreignKey':_0xa946('0x15a')});db[_0xa946('0x5e')]['belongsTo'](db[_0xa946('0x8d')],{'onDelete':_0xa946('0x17b'),'foreignKey':_0xa946('0x17d')});db[_0xa946('0x60')][_0xa946('0x119')](db[_0xa946('0x61')],{'as':_0xa946('0x181'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x190')});db[_0xa946('0x60')][_0xa946('0x124')](db[_0xa946('0x5c')],{'as':_0xa946('0x175'),'foreignKey':'OpenchannelAccountId'});db[_0xa946('0x60')][_0xa946('0x124')](db[_0xa946('0x128')],{'as':_0xa946('0x166'),'foreignKey':'ContactId'});db[_0xa946('0x60')]['belongsTo'](db[_0xa946('0x11')],{'as':_0xa946('0x176'),'foreignKey':'UserId'});db['OpenchannelInteraction'][_0xa946('0x126')](db[_0xa946('0x8d')],{'through':_0xa946('0x191'),'as':_0xa946('0x184')});db[_0xa946('0x60')][_0xa946('0x126')](db[_0xa946('0x8d')],{'through':_0xa946('0x191'),'as':_0xa946('0x185')});db[_0xa946('0x60')][_0xa946('0x126')](db['User'],{'as':'Users','through':_0xa946('0x132'),'foreignKey':_0xa946('0x190')});db[_0xa946('0x61')][_0xa946('0x124')](db[_0xa946('0x11')],{'onDelete':_0xa946('0x117'),'as':_0xa946('0x11')});db[_0xa946('0x61')][_0xa946('0x124')](db[_0xa946('0x128')],{'onDelete':_0xa946('0x117'),'as':_0xa946('0x166')});db[_0xa946('0x61')][_0xa946('0x124')](db['OpenchannelInteraction'],{'onDelete':_0xa946('0x117'),'as':_0xa946('0x17a'),'foreignKey':_0xa946('0x190')});db[_0xa946('0x61')]['belongsTo'](db['Attachment'],{'as':_0xa946('0xf0'),'foreignKey':_0xa946('0x186')});db[_0xa946('0x61')][_0xa946('0x124')](db['OpenchannelAccount'],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x18f')});db['OpenchannelQueue'][_0xa946('0x126')](db['User'],{'as':_0xa946('0x15f'),'through':_0xa946('0x13e'),'foreignKey':_0xa946('0x192')});db[_0xa946('0x62')]['belongsToMany'](db[_0xa946('0x12b')],{'through':_0xa946('0x193'),'as':_0xa946('0x160')});db[_0xa946('0x64')][_0xa946('0x119')](db[_0xa946('0x83')],{'as':_0xa946('0x16b'),'foreignKey':_0xa946('0x194'),'onDelete':_0xa946('0x117')});db['ChatWebsite'][_0xa946('0x119')](db[_0xa946('0x81')],{'as':_0xa946('0x17f'),'foreignKey':_0xa946('0x194')});db[_0xa946('0x64')][_0xa946('0x119')](db[_0xa946('0x70')],{'as':'ProactiveActions'});db[_0xa946('0x64')][_0xa946('0x119')](db[_0xa946('0x69')],{'as':'Interactions'});db[_0xa946('0x64')][_0xa946('0x119')](db[_0xa946('0x195')],{'as':_0xa946('0x16e')});db[_0xa946('0x64')][_0xa946('0x119')](db['ChatMessage'],{'as':_0xa946('0x181')});db['ChatWebsite']['belongsTo'](db[_0xa946('0xfd')],{'as':_0xa946('0x16f'),'foreignKey':'ListId'});db[_0xa946('0x64')][_0xa946('0x124')](db[_0xa946('0x85')],{'as':_0xa946('0x85'),'foreignKey':'IntervalId'});db[_0xa946('0x64')][_0xa946('0x124')](db[_0xa946('0x3b')],{'as':'MailAccount','foreignKey':_0xa946('0x168')});db[_0xa946('0x64')][_0xa946('0x124')](db[_0xa946('0x172')],{'as':_0xa946('0x15b'),'foreignKey':_0xa946('0x15c')});db[_0xa946('0x64')][_0xa946('0x126')](db[_0xa946('0x11')],{'as':_0xa946('0x15f'),'through':_0xa946('0x141')});db[_0xa946('0x66')][_0xa946('0x124')](db[_0xa946('0x5c')],{});db[_0xa946('0x66')][_0xa946('0x124')](db[_0xa946('0xfd')],{'as':_0xa946('0x16f'),'foreignKey':_0xa946('0x170')});db[_0xa946('0x66')][_0xa946('0x124')](db[_0xa946('0x128')],{'as':'Contact','foreignKey':_0xa946('0x167')});db[_0xa946('0x66')][_0xa946('0x124')](db['OpenchannelInteraction'],{});db[_0xa946('0x66')][_0xa946('0x124')](db[_0xa946('0x61')],{});db[_0xa946('0x66')][_0xa946('0x124')](db['User'],{});db[_0xa946('0x66')][_0xa946('0x124')](db[_0xa946('0x62')],{});db['ChatApplication']['belongsTo'](db[_0xa946('0x11')],{'as':_0xa946('0x196'),'foreignKey':_0xa946('0x118'),'onDelete':_0xa946('0x17b')});db[_0xa946('0x195')][_0xa946('0x124')](db[_0xa946('0x197')],{'as':'Queue','foreignKey':_0xa946('0x198'),'onDelete':_0xa946('0x17b')});db[_0xa946('0x195')]['belongsTo'](db[_0xa946('0x64')],{'as':'Website','foreignKey':_0xa946('0x194'),'onDelete':_0xa946('0x17b')});db[_0xa946('0x195')][_0xa946('0x124')](db[_0xa946('0x8d')],{'onDelete':_0xa946('0x17b'),'foreignKey':_0xa946('0x17d')});db[_0xa946('0x69')][_0xa946('0x119')](db[_0xa946('0x6b')],{'as':_0xa946('0x181'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x199')});db[_0xa946('0x69')][_0xa946('0x124')](db['ChatWebsite'],{'as':_0xa946('0x175'),'foreignKey':'ChatWebsiteId'});db[_0xa946('0x69')][_0xa946('0x124')](db[_0xa946('0x128')],{'as':_0xa946('0x166'),'foreignKey':'ContactId'});db[_0xa946('0x69')]['belongsTo'](db[_0xa946('0x11')],{'as':_0xa946('0x176'),'foreignKey':_0xa946('0x118')});db['ChatInteraction']['belongsToMany'](db['Tag'],{'through':_0xa946('0x19a'),'as':'Tags'});db[_0xa946('0x69')][_0xa946('0x126')](db[_0xa946('0x8d')],{'through':_0xa946('0x19a'),'as':_0xa946('0x185')});db['ChatInteraction'][_0xa946('0x126')](db[_0xa946('0x11')],{'as':_0xa946('0x178'),'through':_0xa946('0x12e'),'foreignKey':_0xa946('0x199')});db[_0xa946('0x6b')]['belongsTo'](db[_0xa946('0x11')],{'onDelete':'cascade','as':'User'});db[_0xa946('0x6b')][_0xa946('0x124')](db[_0xa946('0x128')],{'onDelete':_0xa946('0x117'),'as':_0xa946('0x166'),'foreignKey':_0xa946('0x167')});db[_0xa946('0x6b')][_0xa946('0x124')](db[_0xa946('0x69')],{'onDelete':_0xa946('0x117'),'as':'Interaction','foreignKey':_0xa946('0x199')});db[_0xa946('0x6b')]['belongsTo'](db[_0xa946('0xf0')],{'as':_0xa946('0xf0'),'foreignKey':_0xa946('0x186')});db[_0xa946('0x6b')][_0xa946('0x124')](db[_0xa946('0x64')],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x194')});db['ChatOfflineMessage'][_0xa946('0x119')](db['Attachment'],{'as':_0xa946('0x179'),'foreignKey':_0xa946('0x19b'),'onDelete':_0xa946('0x117'),'hooks':!![]});db[_0xa946('0x6c')][_0xa946('0x124')](db[_0xa946('0x128')],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0xa946('0x6c')]['belongsTo'](db[_0xa946('0x64')],{'as':'Account','foreignKey':_0xa946('0x194')});db[_0xa946('0x197')][_0xa946('0x126')](db[_0xa946('0x11')],{'as':_0xa946('0x15f'),'through':_0xa946('0x32'),'hooks':!![]});db[_0xa946('0x197')][_0xa946('0x126')](db[_0xa946('0x12b')],{'through':_0xa946('0x19c'),'as':_0xa946('0x160')});db['ChatGroup'][_0xa946('0x119')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':_0xa946('0x19d'),'onDelete':'cascade'});db[_0xa946('0x6e')][_0xa946('0x126')](db[_0xa946('0x11')],{'as':_0xa946('0x152'),'through':'chat_group_has_users'});db[_0xa946('0x70')][_0xa946('0x124')](db['ChatWebsite'],{'as':'Website','foreignKey':_0xa946('0x194')});db[_0xa946('0x72')]['hasMany'](db[_0xa946('0x128')],{'as':'Contacts','foreignKey':_0xa946('0x19e')});db[_0xa946('0x128')][_0xa946('0x119')](db['CmHopper'],{'as':_0xa946('0x19f'),'foreignKey':_0xa946('0x167')});db[_0xa946('0x128')]['hasMany'](db[_0xa946('0x78')],{'as':_0xa946('0x11c'),'foreignKey':'ContactId'});db['CmContact'][_0xa946('0x119')](db[_0xa946('0x11d')],{'as':_0xa946('0x154'),'foreignKey':_0xa946('0x167')});db['CmContact'][_0xa946('0x119')](db['ReportAgentPreview'],{'as':_0xa946('0x7b'),'foreignKey':'ContactId'});db['CmContact'][_0xa946('0x119')](db[_0xa946('0xdd')],{'as':'JscriptySessions','foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0xa946('0x60')],{'as':_0xa946('0x11f'),'foreignKey':_0xa946('0x167'),'onDelete':'restrict'});db[_0xa946('0x128')][_0xa946('0x119')](db['ChatInteraction'],{'as':_0xa946('0x120'),'foreignKey':'ContactId','onDelete':_0xa946('0x17b')});db[_0xa946('0x128')][_0xa946('0x119')](db['SmsInteraction'],{'as':_0xa946('0x131'),'foreignKey':_0xa946('0x167'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0xa946('0x4c')],{'as':'FaxInteractions','foreignKey':_0xa946('0x167'),'onDelete':_0xa946('0x17b')});db[_0xa946('0x128')][_0xa946('0x119')](db[_0xa946('0x40')],{'as':'MailInteractions','foreignKey':_0xa946('0x167'),'onDelete':'restrict'});db['CmContact'][_0xa946('0x124')](db[_0xa946('0x72')],{'as':'Company','foreignKey':_0xa946('0x19e')});db[_0xa946('0x128')][_0xa946('0x124')](db[_0xa946('0xfd')],{'as':_0xa946('0x16f'),'foreignKey':_0xa946('0x170'),'onDelete':'cascade'});db[_0xa946('0x128')][_0xa946('0x126')](db['User'],{'as':_0xa946('0x178'),'through':'cm_user_has_contacts'});db[_0xa946('0x128')]['belongsToMany'](db[_0xa946('0x8d')],{'as':'Tags','through':_0xa946('0x1a0')});db['CmContact'][_0xa946('0x126')](db[_0xa946('0x8d')],{'through':'cm_contact_has_tags','as':_0xa946('0x185')});db[_0xa946('0x75')][_0xa946('0x124')](db[_0xa946('0x128')],{'as':'Contact','foreignKey':_0xa946('0x167'),'onDelete':'cascade'});db[_0xa946('0x75')]['belongsTo'](db[_0xa946('0xfd')],{'as':_0xa946('0x16f'),'foreignKey':'ListId','onDelete':_0xa946('0x117')});db[_0xa946('0x75')]['belongsTo'](db[_0xa946('0x11')],{'as':_0xa946('0x196'),'foreignKey':_0xa946('0x118')});db['CmHopper'][_0xa946('0x124')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0xa946('0x153'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0xa946('0x1a1')],{'as':_0xa946('0x1a1'),'foreignKey':'CampaignId','onDelete':_0xa946('0x117')});db[_0xa946('0x75')][_0xa946('0x124')](db[_0xa946('0x11')],{'as':_0xa946('0x176'),'foreignKey':'OwnerId'});db[_0xa946('0x1a2')]['belongsTo'](db['CmContact'],{'as':_0xa946('0x166'),'foreignKey':'ContactId','onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xa946('0x170'),'onDelete':_0xa946('0x117')});db[_0xa946('0x1a2')]['belongsTo'](db[_0xa946('0x1a')],{'as':_0xa946('0x1a3'),'foreignKey':_0xa946('0x153'),'onDelete':_0xa946('0x117')});db[_0xa946('0x1a2')][_0xa946('0x124')](db['Campaign'],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0xa946('0x7f')][_0xa946('0x119')](db[_0xa946('0x1a4')],{'as':{'plural':'All','singular':_0xa946('0x1a5')},'foreignKey':_0xa946('0x1a6'),'onDelete':_0xa946('0x117'),'hooks':!![]});db[_0xa946('0x7f')][_0xa946('0x119')](db[_0xa946('0x1a4')],{'as':{'plural':_0xa946('0x1a7'),'singular':_0xa946('0x1a8')},'foreignKey':_0xa946('0x1a9'),'onDelete':_0xa946('0x117'),'hooks':!![]});db['Automation']['hasMany'](db[_0xa946('0x7d')],{'as':_0xa946('0x1aa'),'foreignKey':'AutomationId','onDelete':_0xa946('0x117'),'hooks':!![]});db[_0xa946('0x83')]['hasMany'](db['Disposition'],{'as':_0xa946('0x16b'),'foreignKey':_0xa946('0x1ab'),'onDelete':_0xa946('0x117')});db[_0xa946('0x85')][_0xa946('0x119')](db['Interval'],{'as':'Intervals','foreignKey':_0xa946('0x15a'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xa946('0x85')][_0xa946('0x119')](db[_0xa946('0x17')],{'as':_0xa946('0x1ac'),'foreignKey':_0xa946('0x15a'),'onDelete':_0xa946('0x17b')});db['Interval']['hasMany'](db[_0xa946('0x16d')],{'as':_0xa946('0x1ad'),'foreignKey':_0xa946('0x15a')});db[_0xa946('0x85')][_0xa946('0x119')](db[_0xa946('0x195')],{'as':_0xa946('0x1ae'),'foreignKey':_0xa946('0x15a')});db[_0xa946('0x85')]['hasMany'](db[_0xa946('0x4a')],{'as':_0xa946('0x1af'),'foreignKey':_0xa946('0x15a')});db[_0xa946('0x85')][_0xa946('0x119')](db[_0xa946('0x55')],{'as':_0xa946('0x1b0'),'foreignKey':'IntervalId'});db[_0xa946('0x1b1')][_0xa946('0x124')](db['MailAccount'],{});db['Schedule']['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':_0xa946('0x1b2')});db[_0xa946('0x1b1')][_0xa946('0x124')](db['AnalyticCustomReport'],{'foreignKey':_0xa946('0x1b3')});db[_0xa946('0x8b')][_0xa946('0x126')](db[_0xa946('0x19')],{'as':_0xa946('0x1b4'),'through':'moh_has_sounds','onDelete':'restrict'});db[_0xa946('0x8d')][_0xa946('0x126')](db[_0xa946('0x128')],{'through':_0xa946('0x1a0')});db['Tag'][_0xa946('0x126')](db['ChatInteraction'],{'through':_0xa946('0x19a')});db['Tag'][_0xa946('0x126')](db[_0xa946('0x40')],{'through':'mail_interaction_has_tags'});db[_0xa946('0x8d')][_0xa946('0x126')](db['SmsInteraction'],{'through':_0xa946('0x18a')});db[_0xa946('0x8d')][_0xa946('0x126')](db[_0xa946('0x4c')],{'through':_0xa946('0x183')});db[_0xa946('0x8d')][_0xa946('0x126')](db[_0xa946('0x60')],{'through':_0xa946('0x191')});db[_0xa946('0x8d')]['belongsToMany'](db['WhatsappInteraction'],{'through':_0xa946('0x1b5')});db[_0xa946('0x91')][_0xa946('0x119')](db[_0xa946('0x1a4')],{'as':{'plural':_0xa946('0x1b6'),'singular':_0xa946('0x1b7')},'foreignKey':'TriggerAllId','onDelete':_0xa946('0x117'),'hooks':!![]});db[_0xa946('0x91')][_0xa946('0x119')](db[_0xa946('0x1a4')],{'as':{'plural':_0xa946('0x1b8'),'singular':'AnyCondition'},'foreignKey':_0xa946('0x1b9'),'onDelete':_0xa946('0x117'),'hooks':!![]});db[_0xa946('0x91')]['hasMany'](db['Action'],{'as':'Actions','foreignKey':_0xa946('0x1ba'),'onDelete':_0xa946('0x117'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db[_0xa946('0x9f')],{'as':_0xa946('0x1bb'),'onDelete':'cascade','foreignKey':_0xa946('0x1b3'),'hooks':!![]});db['AnalyticDefaultReport'][_0xa946('0x119')](db[_0xa946('0x9f')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xa946('0x1b2')});db['AnalyticMetric'][_0xa946('0x119')](db[_0xa946('0x9f')],{'as':_0xa946('0x1bb'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1bc')});db[_0xa946('0x9f')][_0xa946('0x124')](db[_0xa946('0x9d')],{'foreignKey':_0xa946('0x1bc')});db[_0xa946('0xa3')][_0xa946('0x119')](db[_0xa946('0xa4')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xa946('0x1bd')});db['SalesforceConfiguration'][_0xa946('0x119')](db[_0xa946('0x1be')],{'as':_0xa946('0x1bf'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1c0')});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0xa946('0x1c1'),'onDelete':'cascade','foreignKey':_0xa946('0x1c2')});db[_0xa946('0xa4')][_0xa946('0x119')](db[_0xa946('0x1be')],{'as':_0xa946('0x1bb'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1c3')});db[_0xa946('0xa4')][_0xa946('0x124')](db[_0xa946('0xa3')],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x1bd')});db['SalesforceField'][_0xa946('0x119')](db[_0xa946('0x1be')],{'as':_0xa946('0x1c4'),'foreignKey':_0xa946('0x1c0')});db['SalesforceField'][_0xa946('0x119')](db[_0xa946('0x1be')],{'as':_0xa946('0x1c5'),'foreignKey':'DescriptionId'});db[_0xa946('0x1be')][_0xa946('0x119')](db['SalesforceField'],{'as':_0xa946('0x1c6'),'foreignKey':'FieldId'});db['SalesforceField'][_0xa946('0x124')](db['Variable'],{'as':'Variable','foreignKey':_0xa946('0x1c7')});db['SugarcrmAccount'][_0xa946('0x119')](db[_0xa946('0xa8')],{'as':_0xa946('0x1c8'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1bd')});db['SugarcrmConfiguration'][_0xa946('0x119')](db[_0xa946('0xaa')],{'as':_0xa946('0x1bf'),'onDelete':'cascade','foreignKey':_0xa946('0x1c0')});db['SugarcrmConfiguration']['hasMany'](db[_0xa946('0xaa')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xa946('0xa8')][_0xa946('0x119')](db[_0xa946('0xaa')],{'as':_0xa946('0x1bb'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1c3')});db[_0xa946('0xa8')][_0xa946('0x124')](db['SugarcrmAccount'],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x1bd')});db['SugarcrmField'][_0xa946('0x119')](db['SugarcrmField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0xa946('0xaa')]['hasMany'](db['SugarcrmField'],{'as':_0xa946('0x1c5'),'foreignKey':_0xa946('0x1c2')});db[_0xa946('0xaa')][_0xa946('0x119')](db[_0xa946('0xaa')],{'as':_0xa946('0x1c6'),'foreignKey':_0xa946('0x1c3')});db['SugarcrmField'][_0xa946('0x124')](db['Variable'],{'as':_0xa946('0x93'),'foreignKey':_0xa946('0x1c7')});db['DeskAccount'][_0xa946('0x119')](db[_0xa946('0xad')],{'as':_0xa946('0x1c8'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1bd')});db[_0xa946('0xad')][_0xa946('0x119')](db[_0xa946('0xaf')],{'as':_0xa946('0x1bf'),'onDelete':_0xa946('0x117'),'foreignKey':'SubjectId'});db[_0xa946('0xad')][_0xa946('0x119')](db['DeskField'],{'as':'Descriptions','onDelete':_0xa946('0x117'),'foreignKey':'DescriptionId'});db[_0xa946('0xad')][_0xa946('0x119')](db[_0xa946('0xaf')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xa946('0x1c3')});db[_0xa946('0xad')][_0xa946('0x124')](db[_0xa946('0xab')],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x1bd')});db['DeskConfiguration'][_0xa946('0x126')](db[_0xa946('0x8d')],{'through':'int_desk_configuration_has_tags'});db[_0xa946('0xaf')]['hasMany'](db[_0xa946('0xaf')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xa946('0xaf')][_0xa946('0x119')](db['DeskField'],{'as':_0xa946('0x1c5'),'foreignKey':'DescriptionId'});db['DeskField'][_0xa946('0x119')](db['DeskField'],{'as':_0xa946('0x1c6'),'foreignKey':_0xa946('0x1c3')});db['DeskField'][_0xa946('0x124')](db[_0xa946('0x93')],{'as':_0xa946('0x93'),'foreignKey':_0xa946('0x1c7')});db[_0xa946('0xb1')]['hasMany'](db['ZohoConfiguration'],{'as':_0xa946('0x1c8'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1bd')});db[_0xa946('0xb3')][_0xa946('0x119')](db[_0xa946('0xb5')],{'as':_0xa946('0x1bf'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1c0')});db[_0xa946('0xb3')][_0xa946('0x119')](db[_0xa946('0xb5')],{'as':'Descriptions','onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1c2')});db[_0xa946('0xb3')][_0xa946('0x119')](db[_0xa946('0xb5')],{'as':_0xa946('0x1bb'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1c3')});db[_0xa946('0xb3')][_0xa946('0x124')](db[_0xa946('0xb1')],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x1bd')});db[_0xa946('0xb5')][_0xa946('0x119')](db[_0xa946('0xb5')],{'as':_0xa946('0x1c4'),'foreignKey':_0xa946('0x1c0')});db['ZohoField'][_0xa946('0x119')](db[_0xa946('0xb5')],{'as':_0xa946('0x1c5'),'foreignKey':_0xa946('0x1c2')});db['ZohoField'][_0xa946('0x119')](db['ZohoField'],{'as':'Field','foreignKey':_0xa946('0x1c3')});db['ZohoField']['belongsTo'](db[_0xa946('0x93')],{'as':_0xa946('0x93'),'foreignKey':_0xa946('0x1c7')});db[_0xa946('0xb6')][_0xa946('0x119')](db[_0xa946('0xb8')],{'as':_0xa946('0x1c8'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1bd')});db[_0xa946('0xb8')]['hasMany'](db[_0xa946('0xba')],{'as':_0xa946('0x1bf'),'foreignKey':_0xa946('0x1c0')});db['ZendeskConfiguration'][_0xa946('0x119')](db['ZendeskField'],{'as':_0xa946('0x1c1'),'foreignKey':_0xa946('0x1c2')});db['ZendeskConfiguration'][_0xa946('0x119')](db['ZendeskField'],{'as':_0xa946('0x1bb'),'foreignKey':_0xa946('0x1c3')});db[_0xa946('0xb8')]['belongsTo'](db[_0xa946('0xb6')],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x1bd')});db[_0xa946('0xb8')][_0xa946('0x126')](db[_0xa946('0x8d')],{'through':'int_zendesk_configuration_has_tags'});db[_0xa946('0xba')][_0xa946('0x119')](db[_0xa946('0xba')],{'as':'Subject','foreignKey':_0xa946('0x1c0')});db[_0xa946('0xba')][_0xa946('0x119')](db[_0xa946('0xba')],{'as':_0xa946('0x1c5'),'foreignKey':_0xa946('0x1c2')});db[_0xa946('0xba')][_0xa946('0x119')](db['ZendeskField'],{'as':'Field','foreignKey':_0xa946('0x1c3')});db['ZendeskField'][_0xa946('0x124')](db[_0xa946('0x93')],{'as':'Variable','foreignKey':_0xa946('0x1c7')});db['FreshdeskAccount'][_0xa946('0x119')](db[_0xa946('0x1c9')],{'as':_0xa946('0x1c8'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1bd')});db[_0xa946('0x1c9')][_0xa946('0x119')](db[_0xa946('0xbe')],{'as':_0xa946('0x1bf'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1c0')});db[_0xa946('0x1c9')]['hasMany'](db[_0xa946('0xbe')],{'as':_0xa946('0x1c1'),'onDelete':'cascade','foreignKey':_0xa946('0x1c2')});db[_0xa946('0x1c9')][_0xa946('0x119')](db[_0xa946('0xbe')],{'as':_0xa946('0x1bb'),'onDelete':'cascade','foreignKey':_0xa946('0x1c3')});db[_0xa946('0x1c9')][_0xa946('0x124')](db[_0xa946('0xbc')],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x1bd')});db['FreshdeskConfiguration'][_0xa946('0x126')](db[_0xa946('0x8d')],{'through':_0xa946('0x1ca')});db[_0xa946('0xbe')][_0xa946('0x119')](db[_0xa946('0xbe')],{'as':_0xa946('0x1c4'),'foreignKey':'SubjectId'});db[_0xa946('0xbe')][_0xa946('0x119')](db['FreshdeskField'],{'as':_0xa946('0x1c5'),'foreignKey':_0xa946('0x1c2')});db[_0xa946('0xbe')][_0xa946('0x119')](db[_0xa946('0xbe')],{'as':_0xa946('0x1c6'),'foreignKey':'FieldId'});db[_0xa946('0xbe')]['belongsTo'](db[_0xa946('0x93')],{'as':'Variable','foreignKey':_0xa946('0x1c7')});db[_0xa946('0xc0')][_0xa946('0x119')](db['VtigerConfiguration'],{'as':_0xa946('0x1c8'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1bd')});db[_0xa946('0xc2')][_0xa946('0x119')](db['VtigerField'],{'as':_0xa946('0x1bf'),'foreignKey':_0xa946('0x1c0')});db[_0xa946('0xc2')][_0xa946('0x119')](db['VtigerField'],{'as':_0xa946('0x1c1'),'foreignKey':'DescriptionId'});db[_0xa946('0xc2')]['hasMany'](db[_0xa946('0xc4')],{'as':'Fields','foreignKey':_0xa946('0x1c3')});db[_0xa946('0xc2')]['belongsTo'](db[_0xa946('0xc0')],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x1bd')});db['VtigerField'][_0xa946('0x119')](db[_0xa946('0xc4')],{'as':_0xa946('0x1c4'),'foreignKey':_0xa946('0x1c0')});db[_0xa946('0xc4')]['hasMany'](db[_0xa946('0xc4')],{'as':_0xa946('0x1c5'),'foreignKey':'DescriptionId'});db[_0xa946('0xc4')][_0xa946('0x119')](db[_0xa946('0xc4')],{'as':'Field','foreignKey':'FieldId'});db[_0xa946('0xc4')][_0xa946('0x124')](db[_0xa946('0x93')],{'as':_0xa946('0x93'),'foreignKey':_0xa946('0x1c7')});db['ServicenowAccount'][_0xa946('0x119')](db[_0xa946('0xc8')],{'as':_0xa946('0x1c8'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xa946('0xc8')][_0xa946('0x119')](db[_0xa946('0xc9')],{'as':_0xa946('0x1bf'),'foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0xa946('0x119')](db['ServicenowField'],{'as':_0xa946('0x1c1'),'foreignKey':_0xa946('0x1c2')});db[_0xa946('0xc8')][_0xa946('0x119')](db[_0xa946('0xc9')],{'as':'Fields','foreignKey':_0xa946('0x1c3')});db[_0xa946('0xc8')][_0xa946('0x124')](db[_0xa946('0xc6')],{'as':_0xa946('0x175'),'foreignKey':'AccountId'});db[_0xa946('0xc9')][_0xa946('0x119')](db[_0xa946('0xc9')],{'as':_0xa946('0x1c4'),'foreignKey':'SubjectId'});db[_0xa946('0xc9')]['hasMany'](db['ServicenowField'],{'as':_0xa946('0x1c5'),'foreignKey':_0xa946('0x1c2')});db[_0xa946('0xc9')][_0xa946('0x119')](db[_0xa946('0xc9')],{'as':_0xa946('0x1c6'),'foreignKey':_0xa946('0x1c3')});db['ServicenowField'][_0xa946('0x124')](db[_0xa946('0x93')],{'as':_0xa946('0x93'),'foreignKey':_0xa946('0x1c7')});db[_0xa946('0xcb')][_0xa946('0x119')](db[_0xa946('0xcd')],{'as':_0xa946('0x1c8'),'onDelete':'cascade','foreignKey':_0xa946('0x1bd')});db[_0xa946('0xcd')][_0xa946('0x119')](db[_0xa946('0x1cb')],{'as':_0xa946('0x1bf'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1c0')});db['Dynamics365Configuration'][_0xa946('0x119')](db[_0xa946('0x1cb')],{'as':_0xa946('0x1c1'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1c2')});db[_0xa946('0xcd')]['hasMany'](db[_0xa946('0x1cb')],{'as':_0xa946('0x1bb'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1c3')});db[_0xa946('0xcd')][_0xa946('0x124')](db[_0xa946('0xcb')],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x1bd')});db['Dynamics365Field'][_0xa946('0x119')](db['Dynamics365Field'],{'as':_0xa946('0x1c4'),'foreignKey':_0xa946('0x1c0')});db[_0xa946('0x1cb')][_0xa946('0x119')](db[_0xa946('0x1cb')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xa946('0x1cb')][_0xa946('0x119')](db[_0xa946('0x1cb')],{'as':_0xa946('0x1c6'),'foreignKey':_0xa946('0x1c3')});db[_0xa946('0x1cb')]['belongsTo'](db[_0xa946('0x93')],{'as':_0xa946('0x93'),'foreignKey':_0xa946('0x1c7')});db['FreshsalesAccount'][_0xa946('0x119')](db[_0xa946('0xd0')],{'as':_0xa946('0x1c8'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1bd')});db[_0xa946('0xd0')][_0xa946('0x119')](db[_0xa946('0xd2')],{'as':'Subjects','foreignKey':_0xa946('0x1c0')});db['FreshsalesConfiguration'][_0xa946('0x119')](db[_0xa946('0xd2')],{'as':'Descriptions','foreignKey':_0xa946('0x1c2')});db[_0xa946('0xd0')][_0xa946('0x119')](db[_0xa946('0xd2')],{'as':_0xa946('0x1bb'),'foreignKey':_0xa946('0x1c3')});db[_0xa946('0xd0')][_0xa946('0x124')](db[_0xa946('0x1cc')],{'as':'Account','foreignKey':_0xa946('0x1bd')});db[_0xa946('0xd2')][_0xa946('0x119')](db[_0xa946('0xd2')],{'as':_0xa946('0x1c4'),'foreignKey':_0xa946('0x1c0')});db[_0xa946('0xd2')]['hasMany'](db[_0xa946('0xd2')],{'as':_0xa946('0x1c5'),'foreignKey':_0xa946('0x1c2')});db[_0xa946('0xd2')][_0xa946('0x119')](db[_0xa946('0xd2')],{'as':_0xa946('0x1c6'),'foreignKey':_0xa946('0x1c3')});db['FreshsalesField'][_0xa946('0x124')](db['Variable'],{'as':_0xa946('0x93'),'foreignKey':_0xa946('0x1c7')});db[_0xa946('0xd5')][_0xa946('0x124')](db[_0xa946('0x64')],{});db[_0xa946('0xd5')][_0xa946('0x124')](db[_0xa946('0xfd')],{'as':'List','foreignKey':_0xa946('0x170')});db[_0xa946('0xd5')][_0xa946('0x124')](db['CmContact'],{'as':'Contact','foreignKey':_0xa946('0x167')});db['ChatQueueReport'][_0xa946('0x124')](db['ChatInteraction'],{});db[_0xa946('0xd5')][_0xa946('0x124')](db[_0xa946('0x6b')],{});db['ChatQueueReport'][_0xa946('0x124')](db[_0xa946('0x11')],{});db[_0xa946('0xd5')][_0xa946('0x124')](db[_0xa946('0x197')],{});db['ChatInternalMessage'][_0xa946('0x124')](db[_0xa946('0x11')],{'onDelete':'cascade','foreignKey':_0xa946('0x1cd')});db[_0xa946('0xd7')][_0xa946('0x124')](db[_0xa946('0x11')],{'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1ce')});db[_0xa946('0xdd')][_0xa946('0x119')](db[_0xa946('0xdb')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xa946('0xdd')][_0xa946('0x119')](db[_0xa946('0xd9')],{'foreignKey':'SessionId','onDelete':_0xa946('0x117')});db['SmsQueueReport'][_0xa946('0x124')](db[_0xa946('0x53')],{});db[_0xa946('0xdf')][_0xa946('0x124')](db[_0xa946('0xfd')],{'as':_0xa946('0x16f'),'foreignKey':_0xa946('0x170')});db[_0xa946('0xdf')][_0xa946('0x124')](db['CmContact'],{'as':'Contact','foreignKey':_0xa946('0x167')});db[_0xa946('0xdf')][_0xa946('0x124')](db[_0xa946('0x57')],{});db[_0xa946('0xdf')][_0xa946('0x124')](db[_0xa946('0x59')],{});db[_0xa946('0xdf')][_0xa946('0x124')](db['User'],{});db['SmsQueueReport'][_0xa946('0x124')](db[_0xa946('0x5a')],{});db[_0xa946('0x1cf')][_0xa946('0x119')](db[_0xa946('0xdd')],{'foreignKey':_0xa946('0x1d0')});db[_0xa946('0x1cf')][_0xa946('0x119')](db['JscriptyQuestionReport'],{'foreignKey':_0xa946('0x1d0')});db[_0xa946('0x1cf')][_0xa946('0x119')](db[_0xa946('0xd9')],{'foreignKey':_0xa946('0x1d0')});db[_0xa946('0x14a')]['belongsToMany'](db[_0xa946('0x11')],{'as':_0xa946('0x178'),'through':_0xa946('0x14c')});db[_0xa946('0x12b')][_0xa946('0x126')](db['User'],{'as':_0xa946('0x15f'),'through':_0xa946('0x12c')});db['Team'][_0xa946('0x126')](db[_0xa946('0x1a')],{'through':'TeamVoiceQueue','as':_0xa946('0x133')});db['Team'][_0xa946('0x126')](db[_0xa946('0x17c')],{'through':_0xa946('0x173'),'as':_0xa946('0x136')});db[_0xa946('0x12b')]['belongsToMany'](db[_0xa946('0x197')],{'through':_0xa946('0x19c'),'as':_0xa946('0x138')});db[_0xa946('0x12b')][_0xa946('0x126')](db[_0xa946('0x139')],{'through':'team_has_fax_queues','as':'FaxQueues'});db['Team']['belongsToMany'](db[_0xa946('0x5a')],{'through':'team_has_sms_queues','as':'SmsQueues'});db[_0xa946('0x12b')][_0xa946('0x126')](db['OpenchannelQueue'],{'through':_0xa946('0x193'),'as':'OpenchannelQueues'});db[_0xa946('0x12b')][_0xa946('0x126')](db[_0xa946('0x13f')],{'through':'team_has_whatsapp_queues','as':_0xa946('0x140')});db[_0xa946('0x12b')][_0xa946('0x126')](db[_0xa946('0x134')],{'through':_0xa946('0x113'),'as':'VoicePrefixes'});db[_0xa946('0x1a1')][_0xa946('0x119')](db['CmHopper'],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0xa946('0x1a1')][_0xa946('0x119')](db[_0xa946('0x78')],{'as':'HopperFinals','foreignKey':_0xa946('0x1d1')});db[_0xa946('0x1a1')][_0xa946('0x119')](db[_0xa946('0x11d')],{'as':_0xa946('0x154'),'foreignKey':_0xa946('0x1d1')});db[_0xa946('0x1a1')][_0xa946('0x119')](db[_0xa946('0x1a2')],{'as':_0xa946('0x155'),'foreignKey':'CampaignId'});db[_0xa946('0x1a1')]['belongsTo'](db[_0xa946('0x2b')],{'as':_0xa946('0x2b'),'foreignKey':'TrunkId'});db[_0xa946('0x1a1')][_0xa946('0x124')](db[_0xa946('0x2b')],{'as':_0xa946('0x158'),'foreignKey':_0xa946('0x159')});db[_0xa946('0x1a1')]['belongsTo'](db[_0xa946('0x85')],{'as':_0xa946('0x85'),'foreignKey':_0xa946('0x15a')});db[_0xa946('0x1a1')][_0xa946('0x124')](db[_0xa946('0x14a')],{'as':_0xa946('0x14a'),'foreignKey':'SquareProjectId'});db[_0xa946('0x1a1')][_0xa946('0x126')](db[_0xa946('0xfd')],{'as':_0xa946('0x15d'),'through':_0xa946('0x1d2')});db[_0xa946('0x1a1')]['belongsToMany'](db[_0xa946('0xfd')],{'as':_0xa946('0x161'),'through':_0xa946('0x1d3')});db[_0xa946('0xf0')][_0xa946('0x124')](db[_0xa946('0x6c')],{'as':_0xa946('0x6c'),'foreignKey':_0xa946('0x19b')});db[_0xa946('0xf4')][_0xa946('0x124')](db[_0xa946('0x42')],{});db[_0xa946('0xf4')][_0xa946('0x124')](db['MailInteraction'],{});db[_0xa946('0xf4')]['belongsTo'](db[_0xa946('0x3b')],{'foreignKey':_0xa946('0x1d4'),'as':'FromAccount'});db['MailTransferReport'][_0xa946('0x124')](db[_0xa946('0x11')],{'foreignKey':_0xa946('0x1d5'),'as':_0xa946('0x1d6')});db['MailTransferReport'][_0xa946('0x124')](db[_0xa946('0x11')],{'foreignKey':'ToUserId','as':_0xa946('0x1d7')});db[_0xa946('0xf4')][_0xa946('0x124')](db['MailQueue'],{'foreignKey':_0xa946('0x1d8'),'as':_0xa946('0x1d9')});db[_0xa946('0xf4')][_0xa946('0x124')](db[_0xa946('0x3b')],{'foreignKey':_0xa946('0x1da'),'as':_0xa946('0x1db')});db[_0xa946('0xf5')][_0xa946('0x124')](db[_0xa946('0x6b')],{});db['ChatTransferReport'][_0xa946('0x124')](db[_0xa946('0x69')],{});db[_0xa946('0xf5')][_0xa946('0x124')](db['ChatWebsite'],{'foreignKey':_0xa946('0x1dc'),'as':_0xa946('0x1dd')});db['ChatTransferReport']['belongsTo'](db[_0xa946('0x11')],{'foreignKey':_0xa946('0x1d5'),'as':'FromAgent'});db[_0xa946('0xf5')][_0xa946('0x124')](db[_0xa946('0x11')],{'foreignKey':_0xa946('0x1de'),'as':_0xa946('0x1d7')});db['ChatTransferReport']['belongsTo'](db[_0xa946('0x197')],{'foreignKey':_0xa946('0x1df'),'as':_0xa946('0x1d9')});db[_0xa946('0xf5')]['belongsTo'](db[_0xa946('0x64')],{'foreignKey':_0xa946('0x1e0'),'as':_0xa946('0x1db')});db[_0xa946('0xf7')]['belongsTo'](db[_0xa946('0x4e')],{});db[_0xa946('0xf7')][_0xa946('0x124')](db['FaxInteraction'],{});db['FaxTransferReport'][_0xa946('0x124')](db[_0xa946('0x49')],{'foreignKey':_0xa946('0x1e1'),'as':_0xa946('0x1dd')});db['FaxTransferReport'][_0xa946('0x124')](db[_0xa946('0x11')],{'foreignKey':_0xa946('0x1d5'),'as':_0xa946('0x1d6')});db[_0xa946('0xf7')][_0xa946('0x124')](db[_0xa946('0x11')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xa946('0xf7')][_0xa946('0x124')](db[_0xa946('0x139')],{'foreignKey':_0xa946('0x1e2'),'as':_0xa946('0x1d9')});db['FaxTransferReport']['belongsTo'](db[_0xa946('0x49')],{'foreignKey':_0xa946('0x1e3'),'as':'ToAccount'});db['OpenchannelTransferReport']['belongsTo'](db[_0xa946('0x61')],{});db[_0xa946('0xf9')]['belongsTo'](db[_0xa946('0x60')],{});db[_0xa946('0xf9')][_0xa946('0x124')](db[_0xa946('0x5c')],{'foreignKey':_0xa946('0x1e4'),'as':_0xa946('0x1dd')});db[_0xa946('0xf9')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xa946('0xf9')][_0xa946('0x124')](db[_0xa946('0x11')],{'foreignKey':_0xa946('0x1de'),'as':_0xa946('0x1d7')});db[_0xa946('0xf9')][_0xa946('0x124')](db[_0xa946('0x62')],{'foreignKey':'ToOpenchannelQueueId','as':_0xa946('0x1d9')});db[_0xa946('0xf9')][_0xa946('0x124')](db[_0xa946('0x5c')],{'foreignKey':_0xa946('0x1e5'),'as':_0xa946('0x1db')});db[_0xa946('0xfb')][_0xa946('0x124')](db['SmsMessage'],{});db['SmsTransferReport'][_0xa946('0x124')](db['SmsInteraction'],{});db[_0xa946('0xfb')][_0xa946('0x124')](db[_0xa946('0x53')],{'foreignKey':_0xa946('0x1e6'),'as':_0xa946('0x1dd')});db[_0xa946('0xfb')][_0xa946('0x124')](db[_0xa946('0x11')],{'foreignKey':_0xa946('0x1d5'),'as':_0xa946('0x1d6')});db[_0xa946('0xfb')]['belongsTo'](db[_0xa946('0x11')],{'foreignKey':_0xa946('0x1de'),'as':'ToAgent'});db['SmsTransferReport'][_0xa946('0x124')](db[_0xa946('0x5a')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0xa946('0xfb')][_0xa946('0x124')](db['SmsAccount'],{'foreignKey':_0xa946('0x1e7'),'as':_0xa946('0x1db')});db[_0xa946('0xfd')][_0xa946('0x119')](db[_0xa946('0x83')],{'as':_0xa946('0x16b'),'foreignKey':_0xa946('0x170'),'onDelete':_0xa946('0x117')});db[_0xa946('0xfd')][_0xa946('0x119')](db[_0xa946('0x1e8')],{'as':_0xa946('0x1e9'),'foreignKey':_0xa946('0x170')});db['CmList'][_0xa946('0x119')](db[_0xa946('0x128')],{'as':'Contacts','onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x170')});db['CmList'][_0xa946('0x119')](db[_0xa946('0x78')],{'as':_0xa946('0x11c'),'foreignKey':_0xa946('0x170')});db['CmList'][_0xa946('0x119')](db[_0xa946('0x11d')],{'as':_0xa946('0x11e'),'foreignKey':_0xa946('0x170')});db[_0xa946('0xfd')][_0xa946('0x119')](db[_0xa946('0x7b')],{'as':_0xa946('0x7b'),'foreignKey':'ListId'});db['CmList'][_0xa946('0x126')](db['VoiceQueue'],{'as':_0xa946('0x1ea'),'through':'voice_queues_has_cm_lists'});db['CmList'][_0xa946('0x126')](db[_0xa946('0x11')],{'as':_0xa946('0x15f'),'through':_0xa946('0x12a')});db[_0xa946('0x134')]['hasMany'](db[_0xa946('0x17')],{'as':'Extensions','onDelete':_0xa946('0x117')});db[_0xa946('0x134')]['belongsToMany'](db[_0xa946('0x11')],{'as':_0xa946('0x15f'),'through':'UserVoicePrefix'});db[_0xa946('0x134')][_0xa946('0x126')](db[_0xa946('0x12b')],{'through':'TeamVoicePrefix','as':'Teams'});db[_0xa946('0x125')][_0xa946('0x119')](db[_0xa946('0x11')],{'as':_0xa946('0x178'),'foreignKey':_0xa946('0x1eb')});db['UserProfile'][_0xa946('0x119')](db[_0xa946('0x100')],{'as':'UserProfileSections','foreignKey':_0xa946('0x1eb'),'onDelete':_0xa946('0x117')});db[_0xa946('0x100')][_0xa946('0x119')](db[_0xa946('0x102')],{'as':_0xa946('0x1ec'),'foreignKey':'sectionId','onDelete':'cascade'});db[_0xa946('0x149')][_0xa946('0x119')](db[_0xa946('0x83')],{'as':_0xa946('0x16b'),'foreignKey':_0xa946('0x1ed'),'onDelete':'cascade'});db['WhatsappAccount']['hasMany'](db[_0xa946('0x81')],{'as':'Answers','foreignKey':_0xa946('0x1ed')});db[_0xa946('0x149')][_0xa946('0x119')](db['WhatsappMessage'],{'as':_0xa946('0x181'),'foreignKey':_0xa946('0x1ed')});db['WhatsappAccount'][_0xa946('0x119')](db[_0xa946('0x107')],{'as':'Interactions'});db[_0xa946('0x149')][_0xa946('0x119')](db[_0xa946('0x1ee')],{'as':_0xa946('0x16e')});db[_0xa946('0x149')][_0xa946('0x124')](db[_0xa946('0xfd')],{'as':'List','foreignKey':'ListId'});db[_0xa946('0x149')][_0xa946('0x124')](db[_0xa946('0x172')],{'as':_0xa946('0x15b'),'foreignKey':_0xa946('0x15c')});db[_0xa946('0x149')][_0xa946('0x126')](db[_0xa946('0x11')],{'as':_0xa946('0x15f'),'through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0xa946('0x124')](db[_0xa946('0x11')],{'onDelete':_0xa946('0x17b')});db[_0xa946('0x1ee')][_0xa946('0x124')](db[_0xa946('0x13f')],{'onDelete':_0xa946('0x17b')});db['WhatsappApplication'][_0xa946('0x124')](db[_0xa946('0x149')],{'onDelete':_0xa946('0x17b')});db[_0xa946('0x1ee')][_0xa946('0x124')](db[_0xa946('0x85')],{'onDelete':'restrict','foreignKey':_0xa946('0x15a')});db[_0xa946('0x1ee')][_0xa946('0x124')](db[_0xa946('0x8d')],{'onDelete':_0xa946('0x17b'),'foreignKey':_0xa946('0x17d')});db['WhatsappInteraction'][_0xa946('0x119')](db[_0xa946('0x109')],{'as':_0xa946('0x181'),'onDelete':_0xa946('0x117'),'foreignKey':_0xa946('0x1ef')});db['WhatsappInteraction'][_0xa946('0x124')](db['WhatsappAccount'],{'as':_0xa946('0x175'),'foreignKey':_0xa946('0x1ed')});db['WhatsappInteraction'][_0xa946('0x124')](db[_0xa946('0x128')],{'as':'Contact','foreignKey':_0xa946('0x167')});db['WhatsappInteraction']['belongsTo'](db[_0xa946('0x11')],{'as':_0xa946('0x176'),'foreignKey':_0xa946('0x118')});db[_0xa946('0x107')]['belongsToMany'](db['Tag'],{'through':_0xa946('0x1b5'),'as':'Tags'});db[_0xa946('0x107')][_0xa946('0x126')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0xa946('0x185')});db[_0xa946('0x107')][_0xa946('0x126')](db['User'],{'as':_0xa946('0x178'),'through':_0xa946('0x1f0'),'foreignKey':_0xa946('0x1ef')});db[_0xa946('0x109')][_0xa946('0x124')](db[_0xa946('0x11')],{'as':_0xa946('0x11')});db['WhatsappMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xa946('0x117'),'as':'Contact'});db[_0xa946('0x109')][_0xa946('0x124')](db[_0xa946('0x107')],{'onDelete':_0xa946('0x117'),'as':_0xa946('0x17a'),'foreignKey':_0xa946('0x1ef')});db['WhatsappMessage'][_0xa946('0x124')](db[_0xa946('0x149')],{'as':'Account','foreignKey':_0xa946('0x1ed')});db['WhatsappQueueReport']['belongsTo'](db['WhatsappAccount'],{});db[_0xa946('0x10b')][_0xa946('0x124')](db[_0xa946('0xfd')],{'as':_0xa946('0x16f'),'foreignKey':_0xa946('0x170')});db[_0xa946('0x10b')][_0xa946('0x124')](db[_0xa946('0x128')],{'as':'Contact','foreignKey':_0xa946('0x167')});db[_0xa946('0x10b')][_0xa946('0x124')](db[_0xa946('0x107')],{});db['WhatsappQueueReport'][_0xa946('0x124')](db[_0xa946('0x13f')],{});db[_0xa946('0x10b')][_0xa946('0x124')](db['WhatsappMessage'],{});db[_0xa946('0x10b')][_0xa946('0x124')](db[_0xa946('0x11')],{});db['WhatsappTransferReport'][_0xa946('0x124')](db[_0xa946('0x109')],{});db[_0xa946('0x10d')]['belongsTo'](db[_0xa946('0x107')],{});db[_0xa946('0x10d')]['belongsTo'](db[_0xa946('0x149')],{'foreignKey':_0xa946('0x1f1'),'as':'FromAccount'});db['WhatsappTransferReport'][_0xa946('0x124')](db[_0xa946('0x149')],{'foreignKey':_0xa946('0x1f2'),'as':_0xa946('0x1db')});db[_0xa946('0x10d')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0xa946('0x1d9')});db[_0xa946('0x10d')][_0xa946('0x124')](db[_0xa946('0x11')],{'foreignKey':_0xa946('0x1d5'),'as':_0xa946('0x1d6')});db[_0xa946('0x10d')][_0xa946('0x124')](db[_0xa946('0x11')],{'foreignKey':_0xa946('0x1de'),'as':_0xa946('0x1d7')});db[_0xa946('0x13f')][_0xa946('0x126')](db[_0xa946('0x11')],{'as':_0xa946('0x15f'),'through':_0xa946('0x36'),'foreignKey':_0xa946('0x1f3')});db['WhatsappQueue'][_0xa946('0x126')](db[_0xa946('0x12b')],{'through':'team_has_whatsapp_queues','as':_0xa946('0x160')});module[_0xa946('0x1f4')]={'db':db,'dbH':dbH};
\ No newline at end of file
index aaa7d0b..7d2d415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc51c=['express','express-winston','./errors','./config/environment','api','./config/logger','auth','use','logger','body','format','method','headers','connection','remoteAddress','url','statusCode','user','role','inspect','device','agent_id','x-forwarded-for','name','other','agent_name','test','./api/user','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatMessage','./api/chatOfflineMessage','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','./api/tag','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/apidoc','static','join','root','/demo','/snippet','snippet','3.0.0','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','appPath','/index.html','newPassword','lastName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','authToken','consumerSecret','membername','calleridname','calleridnum','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','pass','accountSid','localstationid','dsn','registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','includes','lodash','path'];(function(_0x580c79,_0x5dae47){var _0x1f6577=function(_0x2f9395){while(--_0x2f9395){_0x580c79['push'](_0x580c79['shift']());}};_0x1f6577(++_0x5dae47);}(_0xc51c,0x140));var _0xcc51=function(_0x2f9ae0,_0x554af5){_0x2f9ae0=_0x2f9ae0-0x0;var _0x48c532=_0xc51c[_0x2f9ae0];return _0x48c532;};'use strict';var _=require(_0xcc51('0x0'));var path=require(_0xcc51('0x1'));var express=require(_0xcc51('0x2'));var ewinston=require(_0xcc51('0x3'));var util=require('util');var errors=require(_0xcc51('0x4'));var config=require(_0xcc51('0x5'));var logger=require('./config/logger')(_0xcc51('0x6'));var authLogger=require(_0xcc51('0x7'))(_0xcc51('0x8'));exports['default']=function(_0x329df0){_0x329df0[_0xcc51('0x9')](ewinston[_0xcc51('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x10fc19,_0x5a07cc){var _0x3e99f4='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x10fc19['body'])){_0x3e99f4+='\x20body=%s';var _0xa70a02=_0x10fc19[_0xcc51('0xb')];maskSensitiveData(_0xa70a02);}return util[_0xcc51('0xc')](_0x3e99f4,_0x10fc19[_0xcc51('0xd')],_0x10fc19[_0xcc51('0xe')]['x-forwarded-for']?_0x10fc19['headers']['x-forwarded-for']:_0x10fc19[_0xcc51('0xf')][_0xcc51('0x10')]||_0x10fc19['ip'],_0x10fc19[_0xcc51('0x11')],_0x5a07cc[_0xcc51('0x12')],_0x5a07cc['responseTime'],_0x10fc19[_0xcc51('0x13')]?_0x10fc19[_0xcc51('0x13')]['id']:null,_0x10fc19[_0xcc51('0x13')]?_0x10fc19['user']['name']:null,_0x10fc19['user']?_0x10fc19[_0xcc51('0x13')][_0xcc51('0x14')]:null,_0xa70a02?util[_0xcc51('0x15')](_0xa70a02,![],null):'');}}));_0x329df0[_0xcc51('0x9')](ewinston[_0xcc51('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2c18a0,_0x3ae8d5){var _0x333cfc='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x2c18a0[_0xcc51('0xb')]&&_0x2c18a0['body'][_0xcc51('0x16')]&&_0x2c18a0['body'][_0xcc51('0x17')]){_0x333cfc='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xcc51('0xc')](_0x333cfc,_0x2c18a0['method'],_0x2c18a0[_0xcc51('0xe')][_0xcc51('0x18')]?_0x2c18a0[_0xcc51('0xe')][_0xcc51('0x18')]:_0x2c18a0[_0xcc51('0xf')][_0xcc51('0x10')]||_0x2c18a0['ip'],_0x2c18a0[_0xcc51('0x11')],_0x3ae8d5[_0xcc51('0x12')],_0x3ae8d5['responseTime'],_0x2c18a0[_0xcc51('0x13')]?_0x2c18a0['user']['id']:null,_0x2c18a0['user']?_0x2c18a0['user'][_0xcc51('0x19')]:null,_0x2c18a0[_0xcc51('0x13')]?_0x2c18a0[_0xcc51('0x13')][_0xcc51('0x14')]:null,_0x2c18a0[_0xcc51('0xb')]&&_0x2c18a0[_0xcc51('0xb')][_0xcc51('0x16')]?_0x2c18a0['body'][_0xcc51('0x16')]:_0xcc51('0x1a'),_0x2c18a0[_0xcc51('0xb')]&&_0x2c18a0[_0xcc51('0xb')][_0xcc51('0x17')]?_0x2c18a0[_0xcc51('0xb')]['agent_id']:'',_0x2c18a0[_0xcc51('0xb')]&&_0x2c18a0[_0xcc51('0xb')]['agent_name']?_0x2c18a0[_0xcc51('0xb')][_0xcc51('0x1b')]:'');},'ignoreRoute':function(_0x3f0a67){var _0x56c486=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x56c486[_0xcc51('0x1c')](_0x3f0a67[_0xcc51('0x11')]);}}));_0x329df0[_0xcc51('0x9')]('/api/users',require(_0xcc51('0x1d')));_0x329df0[_0xcc51('0x9')]('/api/voice/chanspy',require(_0xcc51('0x1e')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x1f'),require('./api/voiceContext'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x20'),require(_0xcc51('0x21')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x22'),require(_0xcc51('0x23')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x24'),require(_0xcc51('0x25')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x26'),require(_0xcc51('0x27')));_0x329df0[_0xcc51('0x9')]('/api/screen/recordings',require('./api/screenRecording'));_0x329df0['use']('/api/voice/mails',require(_0xcc51('0x28')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x29'),require(_0xcc51('0x2a')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x2b'),require(_0xcc51('0x2c')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x2d'),require('./api/voiceDialReport'));_0x329df0['use']('/api/voice/agents/reports',require(_0xcc51('0x2e')));_0x329df0['use']('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x2f'),require(_0xcc51('0x30')));_0x329df0[_0xcc51('0x9')]('/api/trunks',require(_0xcc51('0x31')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x32'),require(_0xcc51('0x33')));_0x329df0['use']('/api/mail/out_servers',require('./api/mailServerOut'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x34'),require(_0xcc51('0x35')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x36'),require(_0xcc51('0x37')));_0x329df0[_0xcc51('0x9')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x329df0['use'](_0xcc51('0x38'),require('./api/mailInteraction'));_0x329df0[_0xcc51('0x9')]('/api/mail/messages',require(_0xcc51('0x39')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x3a'),require(_0xcc51('0x3b')));_0x329df0[_0xcc51('0x9')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x329df0['use'](_0xcc51('0x3c'),require(_0xcc51('0x3d')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x3e'),require(_0xcc51('0x3f')));_0x329df0['use']('/api/fax/accounts',require(_0xcc51('0x40')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x41'),require(_0xcc51('0x42')));_0x329df0['use'](_0xcc51('0x43'),require(_0xcc51('0x44')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x45'),require('./api/faxMessage'));_0x329df0['use'](_0xcc51('0x46'),require('./api/faxQueue'));_0x329df0['use'](_0xcc51('0x47'),require(_0xcc51('0x48')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x49'),require(_0xcc51('0x4a')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x4b'),require(_0xcc51('0x4c')));_0x329df0['use'](_0xcc51('0x4d'),require(_0xcc51('0x4e')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x4f'),require('./api/smsMessage'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x50'),require(_0xcc51('0x51')));_0x329df0[_0xcc51('0x9')]('/api/openchannel/accounts',require(_0xcc51('0x52')));_0x329df0['use'](_0xcc51('0x53'),require(_0xcc51('0x54')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x55'),require(_0xcc51('0x56')));_0x329df0[_0xcc51('0x9')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x329df0['use']('/api/openchannel/queues',require('./api/openchannelQueue'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x57'),require(_0xcc51('0x58')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x59'),require(_0xcc51('0x5a')));_0x329df0[_0xcc51('0x9')]('/api/chat/applications',require(_0xcc51('0x5b')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x5c'),require('./api/chatInteraction'));_0x329df0[_0xcc51('0x9')]('/api/chat/messages',require(_0xcc51('0x5d')));_0x329df0[_0xcc51('0x9')]('/api/chat/offline_messages',require(_0xcc51('0x5e')));_0x329df0[_0xcc51('0x9')]('/api/chat/queues',require('./api/chatQueue'));_0x329df0['use'](_0xcc51('0x5f'),require('./api/chatGroup'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x60'),require(_0xcc51('0x61')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x62'),require(_0xcc51('0x63')));_0x329df0[_0xcc51('0x9')]('/api/cm/contacts',require(_0xcc51('0x64')));_0x329df0['use'](_0xcc51('0x65'),require(_0xcc51('0x66')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x67'),require(_0xcc51('0x68')));_0x329df0['use']('/api/cm/hopper_final',require(_0xcc51('0x69')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x6a'),require(_0xcc51('0x6b')));_0x329df0[_0xcc51('0x9')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x329df0[_0xcc51('0x9')]('/api/actions',require(_0xcc51('0x6c')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x6d'),require('./api/automation'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x6e'),require(_0xcc51('0x6f')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x70'),require('./api/disposition'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x71'),require(_0xcc51('0x72')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x73'),require(_0xcc51('0x74')));_0x329df0[_0xcc51('0x9')]('/api/pauses',require(_0xcc51('0x75')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x76'),require(_0xcc51('0x77')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x78'),require(_0xcc51('0x79')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x7a'),require('./api/schedule'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x7b'),require(_0xcc51('0x7c')));_0x329df0[_0xcc51('0x9')]('/api/tags',require(_0xcc51('0x7d')));_0x329df0[_0xcc51('0x9')]('/api/templates',require('./api/template'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x7e'),require(_0xcc51('0x7f')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x80'),require(_0xcc51('0x81')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x82'),require(_0xcc51('0x83')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x84'),require(_0xcc51('0x85')));_0x329df0['use']('/api/analytics/custom_reports',require(_0xcc51('0x86')));_0x329df0[_0xcc51('0x9')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x329df0['use'](_0xcc51('0x87'),require(_0xcc51('0x88')));_0x329df0['use'](_0xcc51('0x89'),require('./api/analyticMetric'));_0x329df0['use'](_0xcc51('0x8a'),require(_0xcc51('0x8b')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x8c'),require(_0xcc51('0x8d')));_0x329df0[_0xcc51('0x9')]('/api/integrations/salesforce/accounts',require(_0xcc51('0x8e')));_0x329df0[_0xcc51('0x9')]('/api/integrations/salesforce/configurations',require(_0xcc51('0x8f')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x90'),require(_0xcc51('0x91')));_0x329df0[_0xcc51('0x9')]('/api/integrations/sugarcrm/accounts',require(_0xcc51('0x92')));_0x329df0['use'](_0xcc51('0x93'),require(_0xcc51('0x94')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x95'),require(_0xcc51('0x96')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x97'),require('./api/intDeskAccount'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x98'),require(_0xcc51('0x99')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x9a'),require(_0xcc51('0x9b')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x9c'),require(_0xcc51('0x9d')));_0x329df0['use'](_0xcc51('0x9e'),require(_0xcc51('0x9f')));_0x329df0['use']('/api/integrations/zoho/fields',require(_0xcc51('0xa0')));_0x329df0['use']('/api/integrations/zendesk/accounts',require(_0xcc51('0xa1')));_0x329df0[_0xcc51('0x9')]('/api/integrations/zendesk/configurations',require(_0xcc51('0xa2')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xa3'),require(_0xcc51('0xa4')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xa5'),require(_0xcc51('0xa6')));_0x329df0['use'](_0xcc51('0xa7'),require(_0xcc51('0xa8')));_0x329df0['use'](_0xcc51('0xa9'),require(_0xcc51('0xaa')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xab'),require(_0xcc51('0xac')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xad'),require(_0xcc51('0xae')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xaf'),require('./api/intVtigerField'));_0x329df0['use'](_0xcc51('0xb0'),require('./api/intServicenowAccount'));_0x329df0[_0xcc51('0x9')](_0xcc51('0xb1'),require(_0xcc51('0xb2')));_0x329df0['use']('/api/integrations/servicenow/fields',require(_0xcc51('0xb3')));_0x329df0['use'](_0xcc51('0xb4'),require(_0xcc51('0xb5')));_0x329df0['use'](_0xcc51('0xb6'),require(_0xcc51('0xb7')));_0x329df0['use'](_0xcc51('0xb8'),require(_0xcc51('0xb9')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xba'),require(_0xcc51('0xbb')));_0x329df0['use'](_0xcc51('0xbc'),require(_0xcc51('0xbd')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xbe'),require(_0xcc51('0xbf')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xc0'),require(_0xcc51('0xc1')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xc2'),require(_0xcc51('0xc3')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xc4'),require(_0xcc51('0xc5')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xc6'),require(_0xcc51('0xc7')));_0x329df0[_0xcc51('0x9')]('/api/jscripty/questions/reports',require(_0xcc51('0xc8')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xc9'),require(_0xcc51('0xca')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xcb'),require(_0xcc51('0xcc')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xcd'),require(_0xcc51('0xce')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xcf'),require(_0xcc51('0xd0')));_0x329df0['use'](_0xcc51('0xd1'),require(_0xcc51('0xd2')));_0x329df0[_0xcc51('0x9')]('/api/settings',require(_0xcc51('0xd3')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xd4'),require(_0xcc51('0xd5')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xd6'),require(_0xcc51('0xd7')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xd8'),require(_0xcc51('0xd9')));_0x329df0['use'](_0xcc51('0xda'),require(_0xcc51('0xdb')));_0x329df0['use'](_0xcc51('0xdc'),require(_0xcc51('0xdd')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xde'),require(_0xcc51('0xdf')));_0x329df0['use'](_0xcc51('0xe0'),require(_0xcc51('0xe1')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xe2'),require('./api/migration'));_0x329df0[_0xcc51('0x9')](_0xcc51('0xe3'),require(_0xcc51('0xe4')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xe5'),require('./api/plugin'));_0x329df0[_0xcc51('0x9')]('/api/mail/reports/transfer',require(_0xcc51('0xe6')));_0x329df0[_0xcc51('0x9')]('/api/chat/reports/transfer',require(_0xcc51('0xe7')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xe8'),require('./api/faxTransferReport'));_0x329df0[_0xcc51('0x9')]('/api/openchannel/reports/transfer',require(_0xcc51('0xe9')));_0x329df0[_0xcc51('0x9')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x329df0['use']('/api/cm/lists',require(_0xcc51('0xea')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xeb'),require(_0xcc51('0xec')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xed'),require('./api/userProfile'));_0x329df0[_0xcc51('0x9')](_0xcc51('0xee'),require(_0xcc51('0xef')));_0x329df0['use'](_0xcc51('0xf0'),require('./api/userProfileResource'));_0x329df0[_0xcc51('0x9')](_0xcc51('0xf1'),require(_0xcc51('0xf2')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xf3'),require(_0xcc51('0xf4')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xf5'),require(_0xcc51('0xf6')));_0x329df0[_0xcc51('0x9')]('/api/whatsapp/interactions',require(_0xcc51('0xf7')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xf8'),require(_0xcc51('0xf9')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xfa'),require(_0xcc51('0xfb')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xfc'),require(_0xcc51('0xfd')));_0x329df0[_0xcc51('0x9')]('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x329df0[_0xcc51('0x9')]('/api/cloudProviders',require(_0xcc51('0xfe')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xff'),require(_0xcc51('0x100')));_0x329df0['use'](_0xcc51('0x101'),require(_0xcc51('0x102')));_0x329df0['use'](_0xcc51('0x103'),require(_0xcc51('0x104')));_0x329df0[_0xcc51('0x9')]('/api/jira',require('./api/jira'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x105'),require(_0xcc51('0x106')));_0x329df0[_0xcc51('0x9')]('/api/version',require(_0xcc51('0x107')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x108'),require(_0xcc51('0x109')));_0x329df0['use'](_0xcc51('0x10a'),require(_0xcc51('0x10b')));_0x329df0['use']('/api/webbar',require(_0xcc51('0x10c')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x10d'),express[_0xcc51('0x10e')](path[_0xcc51('0x10f')](config[_0xcc51('0x110')],_0xcc51('0x10d'))));_0x329df0[_0xcc51('0x9')]('/www',express[_0xcc51('0x10e')](path[_0xcc51('0x10f')](config[_0xcc51('0x110')],'/www')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x111'),express['static'](path[_0xcc51('0x10f')](config[_0xcc51('0x110')],_0xcc51('0x111'))));_0x329df0[_0xcc51('0x9')](_0xcc51('0x112'),express[_0xcc51('0x10e')](path['join'](config['root'],_0xcc51('0x113'),_0xcc51('0x114'))));_0x329df0['use']('/plugins',express[_0xcc51('0x10e')](path[_0xcc51('0x10f')](config[_0xcc51('0x110')],_0xcc51('0x115'))));_0x329df0['route'](_0xcc51('0x116'))[_0xcc51('0x117')](errors[0x194]);_0x329df0[_0xcc51('0x118')]('/*')[_0xcc51('0x117')](function(_0x20abcb,_0x50aac1){_0x50aac1[_0xcc51('0x119')](path[_0xcc51('0x11a')](_0x329df0[_0xcc51('0x117')](_0xcc51('0x11b'))+_0xcc51('0x11c')));});};var sensitiveFields=['username','password',_0xcc51('0x11d'),'apiKey','firstName',_0xcc51('0x11e'),'street','phone',_0xcc51('0x11f'),_0xcc51('0x120'),_0xcc51('0x121'),_0xcc51('0x122'),_0xcc51('0x123'),_0xcc51('0x124'),_0xcc51('0x125'),_0xcc51('0x126'),_0xcc51('0x127'),_0xcc51('0x128'),_0xcc51('0x129'),_0xcc51('0x12a'),'accessTokenSecret',_0xcc51('0x12b'),'consumerKey',_0xcc51('0x12c'),_0xcc51('0x12d'),_0xcc51('0x12e'),_0xcc51('0x12f'),'exten',_0xcc51('0x130'),_0xcc51('0x131'),_0xcc51('0x132'),_0xcc51('0x133'),_0xcc51('0x134'),'key',_0xcc51('0x13'),_0xcc51('0x135'),_0xcc51('0x136'),_0xcc51('0x137'),_0xcc51('0x138'),'secret',_0xcc51('0x139'),_0xcc51('0x13a')];function maskSensitiveData(_0x311dd6){var _0x5c1a81=/(?!^)[\s\S](?!$)/g;if(!_[_0xcc51('0x13b')](_0x311dd6))return;for(var _0x5e8a8a in _0x311dd6){if(_['isArray'](_0x311dd6[_0x5e8a8a])){for(var _0x52aad8=0x0;_0x52aad8<_0x311dd6[_0x5e8a8a][_0xcc51('0x13c')];_0x52aad8++){maskSensitiveData(_0x311dd6[_0x5e8a8a][_0x52aad8]);}}else if(_['isPlainObject'](_0x311dd6[_0x5e8a8a])){maskSensitiveData(_0x311dd6[_0x5e8a8a]);}else if(_[_0xcc51('0x13d')](_0x311dd6[_0x5e8a8a])){_0x311dd6[_0x5e8a8a]=_0x311dd6[_0x5e8a8a][_0xcc51('0x13e')](/{{{/g,_0xcc51('0x13f'))[_0xcc51('0x13e')](/}}}/g,_0xcc51('0x140'))['replace'](/{{/g,'@{')[_0xcc51('0x13e')](/}}/g,'}@');if(_[_0xcc51('0x141')](sensitiveFields,_0x5e8a8a)){_0x311dd6[_0x5e8a8a]=_0x311dd6[_0x5e8a8a][_0xcc51('0x13e')](_0x5c1a81,'*');}}}}
\ No newline at end of file
+var _0x4d8b=['/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','./api/pm2','/api/webbar','/apidoc','static','join','/www','root','/demo','snippet','3.0.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','phone','mobile','fax','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','accountSid','localstationid','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','lodash','util','./errors','./config/environment','./config/logger','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','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','device','agent_id','format','method','headers','role','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/cdr','./api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./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/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0x4d8b,0x199));var _0xb4d8=function(_0x4de8f9,_0xde3981){_0x4de8f9=_0x4de8f9-0x0;var _0x472379=_0x4d8b[_0x4de8f9];return _0x472379;};'use strict';var _=require(_0xb4d8('0x0'));var path=require('path');var express=require('express');var ewinston=require('express-winston');var util=require(_0xb4d8('0x1'));var errors=require(_0xb4d8('0x2'));var config=require(_0xb4d8('0x3'));var logger=require(_0xb4d8('0x4'))(_0xb4d8('0x5'));var authLogger=require(_0xb4d8('0x4'))(_0xb4d8('0x6'));exports[_0xb4d8('0x7')]=function(_0x906484){_0x906484[_0xb4d8('0x8')](ewinston[_0xb4d8('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x228d42,_0x36013d){var _0x3afa45=_0xb4d8('0xa');if(!_['isEmpty'](_0x228d42[_0xb4d8('0xb')])){_0x3afa45+='\x20body=%s';var _0x26c836=_0x228d42['body'];maskSensitiveData(_0x26c836);}return util['format'](_0x3afa45,_0x228d42['method'],_0x228d42['headers'][_0xb4d8('0xc')]?_0x228d42['headers'][_0xb4d8('0xc')]:_0x228d42[_0xb4d8('0xd')][_0xb4d8('0xe')]||_0x228d42['ip'],_0x228d42[_0xb4d8('0xf')],_0x36013d[_0xb4d8('0x10')],_0x36013d[_0xb4d8('0x11')],_0x228d42['user']?_0x228d42[_0xb4d8('0x12')]['id']:null,_0x228d42[_0xb4d8('0x12')]?_0x228d42['user'][_0xb4d8('0x13')]:null,_0x228d42[_0xb4d8('0x12')]?_0x228d42[_0xb4d8('0x12')]['role']:null,_0x26c836?util[_0xb4d8('0x14')](_0x26c836,![],null):'');}}));_0x906484[_0xb4d8('0x8')](ewinston[_0xb4d8('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x50f7a5,_0x4dcf89){var _0x5cc086=_0xb4d8('0x15');if(_0x50f7a5[_0xb4d8('0xb')]&&_0x50f7a5['body'][_0xb4d8('0x16')]&&_0x50f7a5[_0xb4d8('0xb')][_0xb4d8('0x17')]){_0x5cc086='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xb4d8('0x18')](_0x5cc086,_0x50f7a5[_0xb4d8('0x19')],_0x50f7a5[_0xb4d8('0x1a')][_0xb4d8('0xc')]?_0x50f7a5[_0xb4d8('0x1a')]['x-forwarded-for']:_0x50f7a5[_0xb4d8('0xd')][_0xb4d8('0xe')]||_0x50f7a5['ip'],_0x50f7a5[_0xb4d8('0xf')],_0x4dcf89[_0xb4d8('0x10')],_0x4dcf89[_0xb4d8('0x11')],_0x50f7a5[_0xb4d8('0x12')]?_0x50f7a5[_0xb4d8('0x12')]['id']:null,_0x50f7a5['user']?_0x50f7a5[_0xb4d8('0x12')][_0xb4d8('0x13')]:null,_0x50f7a5['user']?_0x50f7a5[_0xb4d8('0x12')][_0xb4d8('0x1b')]:null,_0x50f7a5[_0xb4d8('0xb')]&&_0x50f7a5[_0xb4d8('0xb')][_0xb4d8('0x16')]?_0x50f7a5[_0xb4d8('0xb')]['device']:'other',_0x50f7a5[_0xb4d8('0xb')]&&_0x50f7a5['body'][_0xb4d8('0x17')]?_0x50f7a5[_0xb4d8('0xb')]['agent_id']:'',_0x50f7a5['body']&&_0x50f7a5[_0xb4d8('0xb')][_0xb4d8('0x1c')]?_0x50f7a5['body'][_0xb4d8('0x1c')]:'');},'ignoreRoute':function(_0xc8005f){var _0x55fbd1=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x55fbd1[_0xb4d8('0x1d')](_0xc8005f[_0xb4d8('0xf')]);}}));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x1e'),require(_0xb4d8('0x1f')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x20'),require(_0xb4d8('0x21')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x22'),require(_0xb4d8('0x23')));_0x906484[_0xb4d8('0x8')]('/api/voice/extensions',require(_0xb4d8('0x24')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x25'),require(_0xb4d8('0x26')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x27'),require(_0xb4d8('0x28')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x29'),require(_0xb4d8('0x2a')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x2b'),require(_0xb4d8('0x2c')));_0x906484['use']('/api/voice/mails',require(_0xb4d8('0x2d')));_0x906484['use'](_0xb4d8('0x2e'),require(_0xb4d8('0x2f')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x30'),require(_0xb4d8('0x31')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x32'),require(_0xb4d8('0x33')));_0x906484[_0xb4d8('0x8')]('/api/voice/agents/reports',require(_0xb4d8('0x34')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x35'),require('./api/voiceQueueReport'));_0x906484['use']('/api/members/reports',require(_0xb4d8('0x36')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x37'),require(_0xb4d8('0x38')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x39'),require(_0xb4d8('0x3a')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x3b'),require(_0xb4d8('0x3c')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x3d'),require('./api/mailAccount'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x3e'),require(_0xb4d8('0x3f')));_0x906484['use']('/api/mail/substatuses',require(_0xb4d8('0x40')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x41'),require(_0xb4d8('0x42')));_0x906484[_0xb4d8('0x8')]('/api/mail/messages',require(_0xb4d8('0x43')));_0x906484[_0xb4d8('0x8')]('/api/mail/applications',require('./api/mailApplication'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x44'),require(_0xb4d8('0x45')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x46'),require(_0xb4d8('0x47')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x48'),require(_0xb4d8('0x49')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x4a'),require('./api/faxAccount'));_0x906484[_0xb4d8('0x8')]('/api/fax/applications',require(_0xb4d8('0x4b')));_0x906484[_0xb4d8('0x8')]('/api/fax/interactions',require(_0xb4d8('0x4c')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x4d'),require('./api/faxMessage'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x4e'),require(_0xb4d8('0x4f')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x50'),require(_0xb4d8('0x51')));_0x906484[_0xb4d8('0x8')]('/api/sms/accounts',require(_0xb4d8('0x52')));_0x906484['use'](_0xb4d8('0x53'),require(_0xb4d8('0x54')));_0x906484[_0xb4d8('0x8')]('/api/sms/interactions',require(_0xb4d8('0x55')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x56'),require('./api/smsMessage'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x57'),require('./api/smsQueue'));_0x906484['use'](_0xb4d8('0x58'),require(_0xb4d8('0x59')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x5a'),require(_0xb4d8('0x5b')));_0x906484[_0xb4d8('0x8')]('/api/openchannel/interactions',require(_0xb4d8('0x5c')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x5d'),require(_0xb4d8('0x5e')));_0x906484['use']('/api/openchannel/queues',require(_0xb4d8('0x5f')));_0x906484[_0xb4d8('0x8')]('/api/chat/websites',require(_0xb4d8('0x60')));_0x906484[_0xb4d8('0x8')]('/api/openchannel/reports/queue',require(_0xb4d8('0x61')));_0x906484['use']('/api/chat/applications',require('./api/chatApplication'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x62'),require(_0xb4d8('0x63')));_0x906484[_0xb4d8('0x8')]('/api/chat/messages',require(_0xb4d8('0x64')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x65'),require('./api/chatOfflineMessage'));_0x906484[_0xb4d8('0x8')]('/api/chat/queues',require(_0xb4d8('0x66')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x67'),require(_0xb4d8('0x68')));_0x906484[_0xb4d8('0x8')]('/api/chat/proactive_actions',require(_0xb4d8('0x69')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x6a'),require(_0xb4d8('0x6b')));_0x906484['use']('/api/cm/contacts',require('./api/cmContact'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x6c'),require(_0xb4d8('0x6d')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x6e'),require(_0xb4d8('0x6f')));_0x906484['use'](_0xb4d8('0x70'),require(_0xb4d8('0x71')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x72'),require(_0xb4d8('0x73')));_0x906484[_0xb4d8('0x8')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x906484[_0xb4d8('0x8')]('/api/actions',require(_0xb4d8('0x74')));_0x906484[_0xb4d8('0x8')]('/api/automations',require(_0xb4d8('0x75')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x76'),require(_0xb4d8('0x77')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x78'),require(_0xb4d8('0x79')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x7a'),require('./api/condition'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x7b'),require(_0xb4d8('0x7c')));_0x906484[_0xb4d8('0x8')]('/api/pauses',require('./api/pause'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x7d'),require(_0xb4d8('0x7e')));_0x906484['use']('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x906484['use'](_0xb4d8('0x7f'),require(_0xb4d8('0x80')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x81'),require(_0xb4d8('0x82')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x83'),require(_0xb4d8('0x84')));_0x906484[_0xb4d8('0x8')]('/api/templates',require('./api/template'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x85'),require(_0xb4d8('0x86')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x87'),require(_0xb4d8('0x88')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x89'),require('./api/integration'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x8a'),require('./api/integrationReport'));_0x906484[_0xb4d8('0x8')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x906484[_0xb4d8('0x8')]('/api/analytics/default_reports',require(_0xb4d8('0x8b')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x8c'),require('./api/analyticExtractedReport'));_0x906484[_0xb4d8('0x8')]('/api/analytics/metrics',require(_0xb4d8('0x8d')));_0x906484['use'](_0xb4d8('0x8e'),require(_0xb4d8('0x8f')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x90'),require('./api/analyticTreeReport'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x91'),require(_0xb4d8('0x92')));_0x906484[_0xb4d8('0x8')]('/api/integrations/salesforce/configurations',require(_0xb4d8('0x93')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x94'),require(_0xb4d8('0x95')));_0x906484[_0xb4d8('0x8')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x906484['use']('/api/integrations/sugarcrm/configurations',require(_0xb4d8('0x96')));_0x906484['use'](_0xb4d8('0x97'),require(_0xb4d8('0x98')));_0x906484[_0xb4d8('0x8')]('/api/integrations/desk/accounts',require(_0xb4d8('0x99')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x9a'),require(_0xb4d8('0x9b')));_0x906484['use'](_0xb4d8('0x9c'),require('./api/intDeskField'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x9d'),require(_0xb4d8('0x9e')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x9f'),require('./api/intZohoConfiguration'));_0x906484[_0xb4d8('0x8')]('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x906484['use'](_0xb4d8('0xa0'),require(_0xb4d8('0xa1')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xa2'),require(_0xb4d8('0xa3')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xa4'),require('./api/intZendeskField'));_0x906484['use'](_0xb4d8('0xa5'),require('./api/intFreshdeskAccount'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xa6'),require(_0xb4d8('0xa7')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xa8'),require(_0xb4d8('0xa9')));_0x906484[_0xb4d8('0x8')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xaa'),require(_0xb4d8('0xab')));_0x906484[_0xb4d8('0x8')]('/api/integrations/vtiger/fields',require(_0xb4d8('0xac')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xad'),require(_0xb4d8('0xae')));_0x906484['use']('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x906484['use'](_0xb4d8('0xaf'),require(_0xb4d8('0xb0')));_0x906484[_0xb4d8('0x8')]('/api/integrations/dynamics365/accounts',require(_0xb4d8('0xb1')));_0x906484[_0xb4d8('0x8')]('/api/integrations/dynamics365/configurations',require(_0xb4d8('0xb2')));_0x906484['use'](_0xb4d8('0xb3'),require('./api/intDynamics365Field'));_0x906484['use'](_0xb4d8('0xb4'),require(_0xb4d8('0xb5')));_0x906484[_0xb4d8('0x8')]('/api/integrations/freshsales/configurations',require(_0xb4d8('0xb6')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xb7'),require(_0xb4d8('0xb8')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xb9'),require(_0xb4d8('0xba')));_0x906484[_0xb4d8('0x8')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xbb'),require(_0xb4d8('0xbc')));_0x906484['use'](_0xb4d8('0xbd'),require(_0xb4d8('0xbe')));_0x906484['use'](_0xb4d8('0xbf'),require(_0xb4d8('0xc0')));_0x906484['use'](_0xb4d8('0xc1'),require(_0xb4d8('0xc2')));_0x906484[_0xb4d8('0x8')]('/api/sms/reports/queue',require(_0xb4d8('0xc3')));_0x906484['use'](_0xb4d8('0xc4'),require(_0xb4d8('0xc5')));_0x906484['use'](_0xb4d8('0xc6'),require(_0xb4d8('0xc7')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xc8'),require('./api/jscriptyProject'));_0x906484['use'](_0xb4d8('0xc9'),require(_0xb4d8('0xca')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xcb'),require(_0xb4d8('0xcc')));_0x906484[_0xb4d8('0x8')]('/api/square/projects',require(_0xb4d8('0xcd')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xce'),require('./api/squareRecording'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xcf'),require(_0xb4d8('0xd0')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xd1'),require(_0xb4d8('0xd2')));_0x906484[_0xb4d8('0x8')]('/api/license',require(_0xb4d8('0xd3')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xd4'),require(_0xb4d8('0xd5')));_0x906484[_0xb4d8('0x8')]('/api/migrations',require(_0xb4d8('0xd6')));_0x906484['use'](_0xb4d8('0xd7'),require(_0xb4d8('0xd8')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xd9'),require('./api/plugin'));_0x906484['use'](_0xb4d8('0xda'),require(_0xb4d8('0xdb')));_0x906484['use'](_0xb4d8('0xdc'),require(_0xb4d8('0xdd')));_0x906484['use']('/api/fax/reports/transfer',require(_0xb4d8('0xde')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xdf'),require(_0xb4d8('0xe0')));_0x906484['use'](_0xb4d8('0xe1'),require(_0xb4d8('0xe2')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xe3'),require(_0xb4d8('0xe4')));_0x906484['use']('/api/voice/prefixes',require(_0xb4d8('0xe5')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xe6'),require(_0xb4d8('0xe7')));_0x906484[_0xb4d8('0x8')]('/api/userProfile/sections',require(_0xb4d8('0xe8')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xe9'),require(_0xb4d8('0xea')));_0x906484[_0xb4d8('0x8')]('/api/userNotifications',require(_0xb4d8('0xeb')));_0x906484[_0xb4d8('0x8')]('/api/whatsapp/accounts',require(_0xb4d8('0xec')));_0x906484['use'](_0xb4d8('0xed'),require('./api/whatsappApplication'));_0x906484[_0xb4d8('0x8')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xee'),require(_0xb4d8('0xef')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xf0'),require(_0xb4d8('0xf1')));_0x906484['use'](_0xb4d8('0xf2'),require(_0xb4d8('0xf3')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xf4'),require(_0xb4d8('0xf5')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xf6'),require(_0xb4d8('0xf7')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xf8'),require(_0xb4d8('0xf9')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xfa'),require('./api/authLocal'));_0x906484[_0xb4d8('0x8')]('/api/auth/google',require('./api/authGoogle'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xfb'),require('./api/jira'));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xfc'),require(_0xb4d8('0xfd')));_0x906484[_0xb4d8('0x8')](_0xb4d8('0xfe'),require(_0xb4d8('0xff')));_0x906484['use']('/api/system',require(_0xb4d8('0x100')));_0x906484[_0xb4d8('0x8')]('/api/pm2',require(_0xb4d8('0x101')));_0x906484['use'](_0xb4d8('0x102'),require('./api/webbar'));_0x906484['use'](_0xb4d8('0x103'),express[_0xb4d8('0x104')](path[_0xb4d8('0x105')](config['root'],_0xb4d8('0x103'))));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x106'),express[_0xb4d8('0x104')](path['join'](config[_0xb4d8('0x107')],_0xb4d8('0x106'))));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x108'),express['static'](path[_0xb4d8('0x105')](config[_0xb4d8('0x107')],_0xb4d8('0x108'))));_0x906484[_0xb4d8('0x8')]('/snippet',express['static'](path[_0xb4d8('0x105')](config[_0xb4d8('0x107')],_0xb4d8('0x109'),_0xb4d8('0x10a'))));_0x906484[_0xb4d8('0x8')](_0xb4d8('0x10b'),express['static'](path['join'](config[_0xb4d8('0x107')],_0xb4d8('0x10c'))));_0x906484['route'](_0xb4d8('0x10d'))[_0xb4d8('0x10e')](errors[0x194]);_0x906484['route']('/*')[_0xb4d8('0x10e')](function(_0x2d4a47,_0xdec8d0){_0xdec8d0[_0xb4d8('0x10f')](path[_0xb4d8('0x110')](_0x906484['get'](_0xb4d8('0x111'))+_0xb4d8('0x112')));});};var sensitiveFields=[_0xb4d8('0x113'),_0xb4d8('0x114'),_0xb4d8('0x115'),_0xb4d8('0x116'),_0xb4d8('0x117'),_0xb4d8('0x118'),'street',_0xb4d8('0x119'),_0xb4d8('0x11a'),_0xb4d8('0x11b'),_0xb4d8('0x11c'),_0xb4d8('0x11d'),'clientSecret','securityToken',_0xb4d8('0x11e'),_0xb4d8('0x11f'),_0xb4d8('0x120'),_0xb4d8('0x121'),_0xb4d8('0x122'),_0xb4d8('0x123'),_0xb4d8('0x124'),_0xb4d8('0x125'),_0xb4d8('0x126'),_0xb4d8('0x127'),_0xb4d8('0x128'),_0xb4d8('0x129'),_0xb4d8('0x12a'),_0xb4d8('0x12b'),_0xb4d8('0x12c'),_0xb4d8('0x12d'),'privateKey',_0xb4d8('0x12e'),_0xb4d8('0x12f'),_0xb4d8('0x130'),_0xb4d8('0x12'),'pass',_0xb4d8('0x131'),_0xb4d8('0x132'),'dsn',_0xb4d8('0x133'),_0xb4d8('0x134'),_0xb4d8('0x135')];function maskSensitiveData(_0x2170e9){var _0x57fe70=/(?!^)[\s\S](?!$)/g;if(!_[_0xb4d8('0x136')](_0x2170e9))return;for(var _0x42e6c0 in _0x2170e9){if(_[_0xb4d8('0x137')](_0x2170e9[_0x42e6c0])){for(var _0x1943c7=0x0;_0x1943c7<_0x2170e9[_0x42e6c0][_0xb4d8('0x138')];_0x1943c7++){maskSensitiveData(_0x2170e9[_0x42e6c0][_0x1943c7]);}}else if(_[_0xb4d8('0x136')](_0x2170e9[_0x42e6c0])){maskSensitiveData(_0x2170e9[_0x42e6c0]);}else if(_[_0xb4d8('0x139')](_0x2170e9[_0x42e6c0])){_0x2170e9[_0x42e6c0]=_0x2170e9[_0x42e6c0][_0xb4d8('0x13a')](/{{{/g,_0xb4d8('0x13b'))['replace'](/}}}/g,_0xb4d8('0x13c'))[_0xb4d8('0x13a')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0xb4d8('0x13d')](sensitiveFields,_0x42e6c0)){_0x2170e9[_0x42e6c0]=_0x2170e9[_0x42e6c0][_0xb4d8('0x13a')](_0x57fe70,'*');}}}}
\ No newline at end of file
index f9b87bd..ac90ffa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c84=['../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c84,0x129));var _0x42c8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2c84[_0x3947c9];return _0x2e7871;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require(_0x42c8('0x0'));var config=require('../config/environment');exports[_0x42c8('0x1')]=function(){return new BPromise(function(_0x5a9540,_0x417949){var _0x4a4952={};_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x3')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x4')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/voiceQueue/voiceQueue.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x5')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x6')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x7')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x8')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x9')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/memberReport/memberReport.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0xa')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0xb')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0xc')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0xd')));_0x4a4952=_['merge'](_0x4a4952,require('../api/mailAccount/mailAccount.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/mailQueue/mailQueue.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0xe')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0xf')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x10')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x11')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/faxAccount/faxAccount.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/faxApplication/faxApplication.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x12')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/faxMessage/faxMessage.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x13')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x14')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x15')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/smsInteraction/smsInteraction.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x16')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x17')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x18')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x19')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x1a')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x1b')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x1c')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x1d')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x1e')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x1f')));_0x4a4952=_['merge'](_0x4a4952,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x20')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x21')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x22')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x23')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x24')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x25')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x26')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x27')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x28')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x29')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x2a')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x2b')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x2c')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x2d')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x2e')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x2f')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x30')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x31')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x32')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x33')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x34')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x35')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x36')));_0x4a4952=_['merge'](_0x4a4952,require('../api/campaign/campaign.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/attachment/attachment.rpc'));_0x4a4952=_['merge'](_0x4a4952,require('../api/plugin/plugin.rpc'));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x37')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x38')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x1f2011=jayson[_0x42c8('0x39')](_0x4a4952)[_0x42c8('0x3a')]();var _0x129230=config[_0x42c8('0x3b')][_0x42c8('0x3c')]||config[_0x42c8('0x3c')]+0x1;var _0x5c6b3c=config[_0x42c8('0x3b')]['ip']||_0x42c8('0x3d');_0x1f2011['on'](_0x42c8('0x3e'),function(_0x537a31){return _0x417949(_0x537a31);});_0x1f2011[_0x42c8('0x1')](_0x129230,_0x5c6b3c,function(){console[_0x42c8('0x3f')](_0x42c8('0x40'),_0x5c6b3c,_0x129230);require(_0x42c8('0x41'))[_0x42c8('0x42')]();return _0x5a9540(_0x42c8('0x43')+_0x5c6b3c+':'+_0x129230);});});};
\ No newline at end of file
+var _0x4658=['../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.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/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x4658,0x1be));var _0x8465=function(_0x945d9d,_0x445728){_0x945d9d=_0x945d9d-0x0;var _0x126275=_0x4658[_0x945d9d];return _0x126275;};'use strict';var jayson=require(_0x8465('0x0'));var BPromise=require(_0x8465('0x1'));var _=require(_0x8465('0x2'));var config=require('../config/environment');exports[_0x8465('0x3')]=function(){return new BPromise(function(_0x40b499,_0x3f9a46){var _0x902f9f={};_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x5')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x6')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x7')));_0x902f9f=_['merge'](_0x902f9f,require('../api/voiceRecording/voiceRecording.rpc'));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x8')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x9')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0xa')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0xb')));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0xc')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0xd')));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0xe')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x902f9f=_['merge'](_0x902f9f,require('../api/mailServerIn/mailServerIn.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0xf')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x10')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/mailInteraction/mailInteraction.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x11')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x12')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x13')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/faxAccount/faxAccount.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/faxApplication/faxApplication.rpc'));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x14')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/faxMessage/faxMessage.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x15')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x16')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x17')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x18')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/smsQueue/smsQueue.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x19')));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x1a')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x1b')));_0x902f9f=_['merge'](_0x902f9f,require('../api/chatInteraction/chatInteraction.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/chatMessage/chatMessage.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x1c')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x1d')));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x1e')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x1f')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x20')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/pause/pause.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x21')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x22')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/trigger/trigger.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/variable/variable.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x23')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x24')));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x25')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x26')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x27')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x28')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x29')));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x2a')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x2b')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x2c')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x2d')));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x2e')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x2f')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x30')));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x31')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x32')));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x33')));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x34')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x35')));_0x902f9f=_['merge'](_0x902f9f,require('../api/plugin/plugin.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x36')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x37')));_0x902f9f=_['merge'](_0x902f9f,require(_0x8465('0x38')));_0x902f9f=_[_0x8465('0x4')](_0x902f9f,require(_0x8465('0x39')));var _0x1e8005=jayson[_0x8465('0x3a')](_0x902f9f)[_0x8465('0x3b')]();var _0x2f8114=config[_0x8465('0x3c')][_0x8465('0x3d')]||config[_0x8465('0x3d')]+0x1;var _0x1a5a7d=config[_0x8465('0x3c')]['ip']||_0x8465('0x3e');_0x1e8005['on'](_0x8465('0x3f'),function(_0x24c78e){return _0x3f9a46(_0x24c78e);});_0x1e8005['listen'](_0x2f8114,_0x1a5a7d,function(){console[_0x8465('0x40')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1a5a7d,_0x2f8114);require(_0x8465('0x41'))['default']();return _0x40b499(_0x8465('0x42')+_0x1a5a7d+':'+_0x2f8114);});});};
\ No newline at end of file
index 6c9e3bd..32fdd4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01db=['command','write','prototype','sync','answer','sendRequest','ANSWER','getData','beep','format','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','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','continueAt','extension','setContext','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','indexOf','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x01db,0x171));var _0xb01d=function(_0x4ee2a5,_0x143c0e){_0x4ee2a5=_0x4ee2a5-0x0;var _0x378a21=_0x01db[_0x4ee2a5];return _0x378a21;};'use strict';var util=require(_0xb01d('0x0'));var _=require('lodash');var EventEmitter=require('events')[_0xb01d('0x1')];var AGIReply=require(_0xb01d('0x2'));var AGIError=require(_0xb01d('0x3'));function AGIChannel(_0x4df2c9){var _0x13069a=this,_0x5c3864=new AGIReply(),_0x4cc905=![],_0x267f09={};EventEmitter[_0xb01d('0x4')](_0x13069a);_0x4df2c9[_0xb01d('0x5')](_0xb01d('0x6'));_0x4df2c9[_0xb01d('0x7')](0x8*0x3c*0x3c*0x3e8);_0x5c3864[_0xb01d('0x5')](_0xb01d('0x6'));_0x5c3864['on'](_0xb01d('0x8'),function(_0x518609){for(var _0x4c96d5 in _0x518609){_0x13069a[_0x4c96d5]=_0x518609[_0x4c96d5];}_0x13069a[_0xb01d('0x9')](_0xb01d('0xa'));});_0x5c3864['on'](_0xb01d('0xb'),function(_0x3b2de4){if(_0x3b2de4[_0xb01d('0xc')]()==_0xb01d('0xd')){_0x13069a['emit']('hangup');return;}if(_0x3b2de4[_0xb01d('0xe')](0x0,0xb)==_0xb01d('0xf')){_0x4cc905=!![];}if(_0x4cc905){_0x267f09['rx']+=_0x3b2de4+'\x0a';if(_0x3b2de4[_0xb01d('0x10')](_0xb01d('0x11'))!=-0x1){_0x4cc905=![];}}else{_0x267f09['rx']=_0x3b2de4;}if(_0x4cc905){return;}if(typeof _0x267f09['cb']==_0xb01d('0x12')){var _0x447479=_0x267f09['rx']['substring'](0x0,0x3),_0xbcc293=null,_0x48b905=null;_0x447479=parseInt(_0x447479);if(isNaN(_0x447479)){_0x267f09['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xb01d('0x13')});return;}if(_0x447479!=0xc8){_0x267f09['cb'](null,{'code':_0x447479,'result':-0x1,'extra':'KO'});return;}_0xbcc293=_0x267f09['rx']['substring'](0x4)[_0xb01d('0x14')](_0xb01d('0x15'),'');if(_0xbcc293['indexOf']('\x20')!=-0x1){_0xbcc293=_0xbcc293[_0xb01d('0x16')](0x0,_0xbcc293[_0xb01d('0x17')]('\x20'));}if(_[_0xb01d('0x18')](_0xbcc293,'-1')){_0xbcc293=parseInt(_0xbcc293);}_0x48b905=_0x267f09['rx'][_0xb01d('0x19')]('\x20');if(_0x48b905['length']==0x3){_0x48b905=_0x48b905[0x2][_0xb01d('0xe')](0x1,_0x48b905[0x2]['length']-0x1);}else if(_0x48b905[_0xb01d('0x1a')]>0x3){var _0x9a96e=/\((.+)\)/;var _0x15b165=_0x267f09['rx'][_0xb01d('0x1b')](_0x9a96e);if(_0x15b165){_0x48b905=_0x15b165[0x1];}else{_0x48b905=null;}}else{_0x48b905=null;}_0x267f09['cb'](null,{'code':_0x447479,'result':_0xbcc293,'extra':_0x48b905});}});_0x4df2c9['on']('error',function(_0xe47874){_0x13069a[_0xb01d('0x9')](_0xb01d('0x1c'),new AGIError('E_AGI_SOCKET_ERROR',_0xe47874[_0xb01d('0x1d')]));});_0x4df2c9['on']('close',function(){_0x13069a[_0xb01d('0x9')](_0xb01d('0x1e'),new AGIError(_0xb01d('0x1f')));});_0x4df2c9['on'](_0xb01d('0x20'),function(){_0x13069a[_0xb01d('0x9')]('timeout',new AGIError(_0xb01d('0x21')));_0x4df2c9[_0xb01d('0x22')]();});_0x4df2c9[_0xb01d('0x23')](_0x5c3864);this[_0xb01d('0x24')]=function(_0x18cc0e,_0x7de0a2){var _0x18cc0e=_0x18cc0e||'',_0x7de0a2=typeof _0x7de0a2==_0xb01d('0x12')?_0x7de0a2:new Function();_0x267f09={'tx':_0x18cc0e,'rx':'','cb':_0x7de0a2};_0x4df2c9[_0xb01d('0x25')](_0x18cc0e+'\x0a');},this[_0xb01d('0x1e')]=function(){_0x4df2c9[_0xb01d('0x22')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xb01d('0x26')]['sendRequest']=function(_0xed76c0){return this[_0xb01d('0x24')][_0xb01d('0x27')](this,_0xed76c0);};AGIChannel[_0xb01d('0x26')][_0xb01d('0x28')]=function(){return this[_0xb01d('0x29')](_0xb01d('0x2a'));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x2b')]=function(_0x1236c2,_0x1fbfe3,_0x531d37){_0x1236c2=_0x1236c2===undefined?_0xb01d('0x2c'):_0x1236c2;_0x1fbfe3=_0x1fbfe3===undefined?'5':_0x1fbfe3;_0x531d37=_0x531d37===undefined?'1':_0x531d37;return this[_0xb01d('0x29')](util[_0xb01d('0x2d')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x1236c2,_0x1fbfe3*0x3e8,_0x531d37));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x2e')]=function(_0x1659fa){_0x1659fa=_0x1659fa||'NO\x20MESSAGE';return this[_0xb01d('0x29')](util['format'](_0xb01d('0x2f'),_0x1659fa));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x30')]=function(_0x513eac,_0x2f3046){if(_[_0xb01d('0x31')](_0x2f3046)){return this[_0xb01d('0x29')](util[_0xb01d('0x2d')](_0xb01d('0x32'),_0x513eac,_0x2f3046[_0xb01d('0x33')](',')));}return this['sendRequest'](util[_0xb01d('0x2d')](_0xb01d('0x32'),_0x513eac,_0x2f3046));};AGIChannel[_0xb01d('0x26')]['setContext']=function(_0x56185c){return this['sendRequest'](util['format'](_0xb01d('0x34'),_0x56185c));};AGIChannel[_0xb01d('0x26')]['setExtension']=function(_0x5c872f){return this[_0xb01d('0x29')](util[_0xb01d('0x2d')](_0xb01d('0x35'),_0x5c872f));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x36')]=function(_0x42fd41){return this[_0xb01d('0x29')](util[_0xb01d('0x2d')](_0xb01d('0x37'),_0x42fd41));};AGIChannel['prototype'][_0xb01d('0xd')]=function(){return this[_0xb01d('0x29')](_0xb01d('0x38'));};AGIChannel[_0xb01d('0x26')]['setVariable']=function(_0x3d2380,_0x5260c5){var _0x109283=_[_0xb01d('0x39')](_0x5260c5)||_[_0xb01d('0x3a')](_0x5260c5)?_0x5260c5[_0xb01d('0x3b')]():_0x5260c5;return this['sendRequest'](util[_0xb01d('0x2d')](_0xb01d('0x3c'),_0x3d2380,_0x109283?_0x109283[_0xb01d('0x3b')]()[_0xb01d('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xb01d('0x26')]['sayNumber']=function(_0x76d421,_0x28f18b){return this[_0xb01d('0x29')](util[_0xb01d('0x2d')](_0xb01d('0x3d'),_0x76d421,_0x28f18b));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x3e')]=function(_0x5d191c,_0x4b93f0){return this[_0xb01d('0x29')](util['format'](_0xb01d('0x3f'),_0x5d191c,_0x4b93f0));};AGIChannel[_0xb01d('0x26')]['sayPhonetic']=function(_0x847853,_0x325715){return this[_0xb01d('0x29')](util[_0xb01d('0x2d')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x847853,_0x325715));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x40')]=function(_0x5c2313,_0x1fb47c,_0x4f3278){_0x1fb47c=_0x1fb47c||this[_0xb01d('0x41')];_0x4f3278=_0x4f3278||0x1;this[_0xb01d('0x42')](_0x5c2313);this[_0xb01d('0x43')](_0x1fb47c);this['setPriority'](_0x4f3278);return this[_0xb01d('0x2e')](util['format'](_0xb01d('0x44'),_0x5c2313,_0x1fb47c,_0x4f3278));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x45')]=function(_0x2f582f){return this['sendRequest'](util['format'](_0xb01d('0x46'),_0x2f582f));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x47')]=function(_0x35af3c,_0x11e5cc,_0x3e3c8a,_0x44567a,_0x11691d,_0x25ebb6){_0x11e5cc=_0x11e5cc||'wav';_0x3e3c8a=_0x3e3c8a||'';_0x44567a=_0x44567a===undefined?-0x1:_0x44567a==='-1'?-0x1:_0x44567a*0x3e8;_0x11691d=_0x11691d===undefined?'':'s='+_0x11691d;_0x25ebb6=_0x25ebb6?'BEEP':'';return this['sendRequest'](util[_0xb01d('0x2d')](_0xb01d('0x48'),_0x35af3c,_0x11e5cc,_0x3e3c8a,_0x44567a,_0x25ebb6,_0x11691d));};AGIChannel['prototype'][_0xb01d('0x49')]=function(_0x5b23a5,_0x59e85c){_0x59e85c=_0x59e85c||'';return this[_0xb01d('0x29')](util[_0xb01d('0x2d')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x5b23a5,_0x59e85c));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x4a')]=function(_0x29f3a9){return this[_0xb01d('0x30')](_0xb01d('0x4b'),_0x29f3a9);};AGIChannel[_0xb01d('0x26')][_0xb01d('0x4c')]=function(_0x50d6cc){return this['exec'](_0xb01d('0x4d'),_0x50d6cc);};AGIChannel['prototype']['error']=function(_0x2e4755,_0x75b2e7){this[_0xb01d('0x2e')](util['format'](_0xb01d('0x4e'),_0x2e4755['id'],_0x2e4755[_0xb01d('0x4f')],_0x75b2e7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xb01d('0x50')]=AGIChannel;
\ No newline at end of file
+var _0xc06e=['setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','extension','noop','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','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','lodash','events','EventEmitter','./reply','call','setEncoding','setTimeout','utf8','headers','ready','toLowerCase','hangup','520\x20End\x20of\x20proper','substring','no\x20code','replace','result=','substr','indexOf','split','length','match','error','code','close','emit','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','ANSWER','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s'];(function(_0x476211,_0x4320ed){var _0x1e531d=function(_0x42207c){while(--_0x42207c){_0x476211['push'](_0x476211['shift']());}};_0x1e531d(++_0x4320ed);}(_0xc06e,0x14a));var _0xec06=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xc06e[_0x15bc81];return _0x59440e;};'use strict';var util=require('util');var _=require(_0xec06('0x0'));var EventEmitter=require(_0xec06('0x1'))[_0xec06('0x2')];var AGIReply=require(_0xec06('0x3'));var AGIError=require('./error');function AGIChannel(_0x6be745){var _0x4220de=this,_0x5074fd=new AGIReply(),_0x4e7b89=![],_0x4ade11={};EventEmitter[_0xec06('0x4')](_0x4220de);_0x6be745[_0xec06('0x5')]('utf8');_0x6be745[_0xec06('0x6')](0x8*0x3c*0x3c*0x3e8);_0x5074fd[_0xec06('0x5')](_0xec06('0x7'));_0x5074fd['on'](_0xec06('0x8'),function(_0x1ff4b4){for(var _0x419d9b in _0x1ff4b4){_0x4220de[_0x419d9b]=_0x1ff4b4[_0x419d9b];}_0x4220de['emit'](_0xec06('0x9'));});_0x5074fd['on']('line',function(_0x1b2bb3){if(_0x1b2bb3[_0xec06('0xa')]()==_0xec06('0xb')){_0x4220de['emit']('hangup');return;}if(_0x1b2bb3['substring'](0x0,0xb)=='520-Invalid'){_0x4e7b89=!![];}if(_0x4e7b89){_0x4ade11['rx']+=_0x1b2bb3+'\x0a';if(_0x1b2bb3['search'](_0xec06('0xc'))!=-0x1){_0x4e7b89=![];}}else{_0x4ade11['rx']=_0x1b2bb3;}if(_0x4e7b89){return;}if(typeof _0x4ade11['cb']=='function'){var _0x14c04f=_0x4ade11['rx'][_0xec06('0xd')](0x0,0x3),_0x4c3ee1=null,_0x29529d=null;_0x14c04f=parseInt(_0x14c04f);if(isNaN(_0x14c04f)){_0x4ade11['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xec06('0xe')});return;}if(_0x14c04f!=0xc8){_0x4ade11['cb'](null,{'code':_0x14c04f,'result':-0x1,'extra':'KO'});return;}_0x4c3ee1=_0x4ade11['rx'][_0xec06('0xd')](0x4)[_0xec06('0xf')](_0xec06('0x10'),'');if(_0x4c3ee1['indexOf']('\x20')!=-0x1){_0x4c3ee1=_0x4c3ee1[_0xec06('0x11')](0x0,_0x4c3ee1[_0xec06('0x12')]('\x20'));}if(_['startsWith'](_0x4c3ee1,'-1')){_0x4c3ee1=parseInt(_0x4c3ee1);}_0x29529d=_0x4ade11['rx'][_0xec06('0x13')]('\x20');if(_0x29529d[_0xec06('0x14')]==0x3){_0x29529d=_0x29529d[0x2][_0xec06('0xd')](0x1,_0x29529d[0x2]['length']-0x1);}else if(_0x29529d[_0xec06('0x14')]>0x3){var _0x3eb5da=/\((.+)\)/;var _0x40f5bd=_0x4ade11['rx'][_0xec06('0x15')](_0x3eb5da);if(_0x40f5bd){_0x29529d=_0x40f5bd[0x1];}else{_0x29529d=null;}}else{_0x29529d=null;}_0x4ade11['cb'](null,{'code':_0x14c04f,'result':_0x4c3ee1,'extra':_0x29529d});}});_0x6be745['on']('error',function(_0x55280c){_0x4220de['emit'](_0xec06('0x16'),new AGIError('E_AGI_SOCKET_ERROR',_0x55280c[_0xec06('0x17')]));});_0x6be745['on'](_0xec06('0x18'),function(){_0x4220de[_0xec06('0x19')](_0xec06('0x18'),new AGIError(_0xec06('0x1a')));});_0x6be745['on'](_0xec06('0x1b'),function(){_0x4220de['emit'](_0xec06('0x1b'),new AGIError(_0xec06('0x1c')));_0x6be745[_0xec06('0x1d')]();});_0x6be745[_0xec06('0x1e')](_0x5074fd);this[_0xec06('0x1f')]=function(_0x43bfd6,_0x48c18b){var _0x43bfd6=_0x43bfd6||'',_0x48c18b=typeof _0x48c18b=='function'?_0x48c18b:new Function();_0x4ade11={'tx':_0x43bfd6,'rx':'','cb':_0x48c18b};_0x6be745[_0xec06('0x20')](_0x43bfd6+'\x0a');},this[_0xec06('0x18')]=function(){_0x6be745[_0xec06('0x1d')]();};}util[_0xec06('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xec06('0x22')][_0xec06('0x23')]=function(_0x15bb2c){return this[_0xec06('0x1f')][_0xec06('0x24')](this,_0x15bb2c);};AGIChannel[_0xec06('0x22')]['answer']=function(){return this[_0xec06('0x23')](_0xec06('0x25'));};AGIChannel[_0xec06('0x22')]['getData']=function(_0x6cf732,_0x1ca5b6,_0x37786e){_0x6cf732=_0x6cf732===undefined?_0xec06('0x26'):_0x6cf732;_0x1ca5b6=_0x1ca5b6===undefined?'5':_0x1ca5b6;_0x37786e=_0x37786e===undefined?'1':_0x37786e;return this[_0xec06('0x23')](util['format'](_0xec06('0x27'),_0x6cf732,_0x1ca5b6*0x3e8,_0x37786e));};AGIChannel['prototype']['noop']=function(_0x6f9b58){_0x6f9b58=_0x6f9b58||_0xec06('0x28');return this[_0xec06('0x23')](util[_0xec06('0x29')](_0xec06('0x2a'),_0x6f9b58));};AGIChannel['prototype'][_0xec06('0x2b')]=function(_0x418e3b,_0x176a7f){if(_['isArray'](_0x176a7f)){return this[_0xec06('0x23')](util['format'](_0xec06('0x2c'),_0x418e3b,_0x176a7f['join'](',')));}return this[_0xec06('0x23')](util[_0xec06('0x29')](_0xec06('0x2c'),_0x418e3b,_0x176a7f));};AGIChannel['prototype'][_0xec06('0x2d')]=function(_0x4efa9f){return this['sendRequest'](util['format'](_0xec06('0x2e'),_0x4efa9f));};AGIChannel[_0xec06('0x22')][_0xec06('0x2f')]=function(_0x1835d9){return this[_0xec06('0x23')](util['format'](_0xec06('0x30'),_0x1835d9));};AGIChannel[_0xec06('0x22')][_0xec06('0x31')]=function(_0x3b43d9){return this['sendRequest'](util[_0xec06('0x29')](_0xec06('0x32'),_0x3b43d9));};AGIChannel['prototype'][_0xec06('0xb')]=function(){return this[_0xec06('0x23')](_0xec06('0x33'));};AGIChannel[_0xec06('0x22')][_0xec06('0x34')]=function(_0x4e2e18,_0x59b329){var _0x58364c=_[_0xec06('0x35')](_0x59b329)||_[_0xec06('0x36')](_0x59b329)?_0x59b329['toString']():_0x59b329;return this[_0xec06('0x23')](util[_0xec06('0x29')](_0xec06('0x37'),_0x4e2e18,_0x58364c?_0x58364c[_0xec06('0x38')]()[_0xec06('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xec06('0x39')]=function(_0x86ed25,_0x2fc7b2){return this[_0xec06('0x23')](util[_0xec06('0x29')](_0xec06('0x3a'),_0x86ed25,_0x2fc7b2));};AGIChannel[_0xec06('0x22')][_0xec06('0x3b')]=function(_0x5ee600,_0x434890){return this[_0xec06('0x23')](util[_0xec06('0x29')](_0xec06('0x3c'),_0x5ee600,_0x434890));};AGIChannel[_0xec06('0x22')]['sayPhonetic']=function(_0x1d8c3c,_0xec35cb){return this[_0xec06('0x23')](util[_0xec06('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x1d8c3c,_0xec35cb));};AGIChannel[_0xec06('0x22')]['continueAt']=function(_0x55a173,_0x173411,_0x1c26f8){_0x173411=_0x173411||this[_0xec06('0x3d')];_0x1c26f8=_0x1c26f8||0x1;this['setContext'](_0x55a173);this['setExtension'](_0x173411);this[_0xec06('0x31')](_0x1c26f8);return this[_0xec06('0x3e')](util[_0xec06('0x29')](_0xec06('0x3f'),_0x55a173,_0x173411,_0x1c26f8));};AGIChannel[_0xec06('0x22')][_0xec06('0x40')]=function(_0x3ab0bc){return this[_0xec06('0x23')](util[_0xec06('0x29')]('GET\x20VARIABLE\x20\x22%s\x22',_0x3ab0bc));};AGIChannel[_0xec06('0x22')][_0xec06('0x41')]=function(_0x1bdb66,_0x354c4e,_0xb877f7,_0x3a1226,_0x3ad134,_0x3d832f){_0x354c4e=_0x354c4e||_0xec06('0x42');_0xb877f7=_0xb877f7||'';_0x3a1226=_0x3a1226===undefined?-0x1:_0x3a1226==='-1'?-0x1:_0x3a1226*0x3e8;_0x3ad134=_0x3ad134===undefined?'':'s='+_0x3ad134;_0x3d832f=_0x3d832f?_0xec06('0x43'):'';return this[_0xec06('0x23')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x1bdb66,_0x354c4e,_0xb877f7,_0x3a1226,_0x3d832f,_0x3ad134));};AGIChannel[_0xec06('0x22')][_0xec06('0x44')]=function(_0x561697,_0x6c93d0){_0x6c93d0=_0x6c93d0||'';return this[_0xec06('0x23')](util['format'](_0xec06('0x45'),_0x561697,_0x6c93d0));};AGIChannel[_0xec06('0x22')][_0xec06('0x46')]=function(_0x558c77){return this[_0xec06('0x2b')](_0xec06('0x47'),_0x558c77);};AGIChannel[_0xec06('0x22')]['wait']=function(_0x5ab004){return this[_0xec06('0x2b')](_0xec06('0x48'),_0x5ab004);};AGIChannel[_0xec06('0x22')][_0xec06('0x16')]=function(_0x11b5a1,_0x5c1a65){this['noop'](util['format'](_0xec06('0x49'),_0x11b5a1['id'],_0x11b5a1['label'],_0x5c1a65));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xec06('0x4a')]=AGIChannel;
\ No newline at end of file
index 7f82313..5da384d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20df=['util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x20df,0x7e));var _0xf20d=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0x20df[_0x5ad771];return _0x5b5dce;};'use strict';var util=require(_0xf20d('0x0'));var error={'E_AGI_UNDEFINED':_0xf20d('0x1'),'E_AGI_ARGUMENT_PORT':_0xf20d('0x2'),'E_AGI_SERVER_ERROR':_0xf20d('0x3'),'E_AGI_SERVER_CLOSE':_0xf20d('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xf20d('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xf20d('0x6'),'E_AGI_SOCKET_ERROR':_0xf20d('0x7'),'E_AGI_SOCKET_CLOSE':_0xf20d('0x8'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xf20d('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xf20d('0xa'),'E_AGI_IVR_ENTRY':_0xf20d('0xb')};function AGIError(_0x4e7aaf){var _0x4e7aaf=_0x4e7aaf||null,_0x31236e=_0x31236e||[],_0x1517ec=0x1,_0x36d2d3='';if(!error[_0x4e7aaf]){_0x4e7aaf=_0xf20d('0xc');}_0x31236e[_0xf20d('0xd')](error[_0x4e7aaf]);while(arguments[_0x1517ec]){_0x31236e[_0xf20d('0xd')](arguments[_0x1517ec]);_0x1517ec++;}_0x36d2d3=util[_0xf20d('0xe')][_0xf20d('0xf')](util,_0x31236e);this[_0xf20d('0x10')]=_0x36d2d3;this['name']=_0x4e7aaf;}module[_0xf20d('0x11')]=AGIError;
\ No newline at end of file
+var _0x3078=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x4ca17b,_0x3074fe){var _0x2ba04c=function(_0x4e87e3){while(--_0x4e87e3){_0x4ca17b['push'](_0x4ca17b['shift']());}};_0x2ba04c(++_0x3074fe);}(_0x3078,0x79));var _0x8307=function(_0x5dde91,_0x3bb66e){_0x5dde91=_0x5dde91-0x0;var _0x402888=_0x3078[_0x5dde91];return _0x402888;};'use strict';var util=require(_0x8307('0x0'));var error={'E_AGI_UNDEFINED':_0x8307('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x8307('0x2'),'E_AGI_SERVER_CLOSE':_0x8307('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x8307('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x8307('0x5'),'E_AGI_SOCKET_ERROR':_0x8307('0x6'),'E_AGI_SOCKET_CLOSE':_0x8307('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x8307('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x8307('0x9'),'E_AGI_IVR_ENTRY':_0x8307('0xa')};function AGIError(_0x554eb7){var _0x554eb7=_0x554eb7||null,_0x5cc609=_0x5cc609||[],_0x56a506=0x1,_0x209c75='';if(!error[_0x554eb7]){_0x554eb7=_0x8307('0xb');}_0x5cc609[_0x8307('0xc')](error[_0x554eb7]);while(arguments[_0x56a506]){_0x5cc609['push'](arguments[_0x56a506]);_0x56a506++;}_0x209c75=util[_0x8307('0xd')][_0x8307('0xe')](util,_0x5cc609);this[_0x8307('0xf')]=_0x209c75;this[_0x8307('0x10')]=_0x554eb7;}module[_0x8307('0x11')]=AGIError;
\ No newline at end of file
index 98282a7..a47e8dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4534=['addEdge','push','size','relations','numberOfEdges','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','default','target','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','agi','menu','getdigits','getsecretdigits','vertices','edges','prototype','addVertex'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4534,0x6c));var _0x4453=function(_0x4708d9,_0x20289d){_0x4708d9=_0x4708d9-0x0;var _0x1dd6a8=_0x4534[_0x4708d9];return _0x1dd6a8;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0x4453('0x0'));var verticesWithRetry=[_0x4453('0x1'),_0x4453('0x2'),_0x4453('0x3')];var Graph=function(){this[_0x4453('0x4')]={};this[_0x4453('0x5')]={};this['numberOfEdges']=0x0;};Graph[_0x4453('0x6')][_0x4453('0x7')]=function(_0x1bf6de){this[_0x4453('0x4')][_0x1bf6de['id']]=_0x1bf6de;this['edges'][_0x1bf6de['id']]=[];};Graph[_0x4453('0x6')][_0x4453('0x8')]=function(_0x4d70a1,_0x58799c,_0x5bc1a6){this[_0x4453('0x5')][_0x4d70a1][_0x4453('0x9')]({'target':_0x58799c,'condition':_0x5bc1a6});this['numberOfEdges']+=0x1;};Graph[_0x4453('0x6')][_0x4453('0xa')]=function(){return _['size'](this[_0x4453('0x4')]);};Graph[_0x4453('0x6')][_0x4453('0xb')]=function(){return this[_0x4453('0xc')];};Graph[_0x4453('0x6')]['getVertex']=function(_0x1d182c){return this['vertices'][_0x1d182c];};Graph[_0x4453('0x6')]['traverseBFS']=function(_0x1c406c,_0x4b1eb6){if(!this[_0x4453('0x4')][_0x1c406c]){return logger['info'](_0x4453('0xd'));}var _0x2bb0e4=_0x4b1eb6(this[_0x4453('0x4')][_0x1c406c]);if(!_0x2bb0e4){return logger[_0x4453('0xe')](_0x4453('0xf'));}if(this[_0x4453('0x5')][_0x1c406c][_0x4453('0x10')]===0x0){return logger[_0x4453('0xe')](_0x4453('0x11'));}for(var _0x22e7ee=0x0,_0x560eb5=[],_0x28503e=![];_0x22e7ee<this['edges'][_0x1c406c][_0x4453('0x10')];_0x22e7ee+=0x1){if(this[_0x4453('0x5')][_0x1c406c][_0x22e7ee]['condition']){_0x560eb5=this[_0x4453('0x5')][_0x1c406c][_0x22e7ee][_0x4453('0x12')][_0x4453('0x13')](',');for(var _0x5c82f4=0x0;_0x5c82f4<_0x560eb5[_0x4453('0x10')];_0x5c82f4+=0x1){if(this[_0x4453('0x4')][_0x1c406c][_0x4453('0x14')]===_0x4453('0x15')&&_0x560eb5[_0x5c82f4]==='-'){_0x28503e=this[_0x4453('0x5')][_0x1c406c][_0x22e7ee]['target'];logger[_0x4453('0xe')](_0x4453('0x16'),_0x560eb5[_0x5c82f4],this[_0x4453('0x5')][_0x1c406c][_0x22e7ee][_0x4453('0x17')]);}else if(this[_0x4453('0x4')][_0x1c406c][_0x4453('0x14')]===_0x4453('0x1')&&_0x560eb5[_0x5c82f4]==='i'){_0x28503e=this[_0x4453('0x5')][_0x1c406c][_0x22e7ee][_0x4453('0x17')];logger[_0x4453('0xe')]('invalid',_0x560eb5[_0x5c82f4],this[_0x4453('0x5')][_0x1c406c][_0x22e7ee][_0x4453('0x17')]);}if(_0x560eb5[_0x5c82f4]===_0x2bb0e4){return this[_0x4453('0x18')](this[_0x4453('0x5')][_0x1c406c][_0x22e7ee]['target'],_0x4b1eb6);}}}else{return this['traverseBFS'](this[_0x4453('0x5')][_0x1c406c][_0x22e7ee][_0x4453('0x17')],_0x4b1eb6);}}if(_0x560eb5['length']){if(this[_0x4453('0x4')][_0x1c406c][_0x4453('0x14')]===_0x4453('0x15')){if(_0x28503e){return this[_0x4453('0x18')](_0x28503e,_0x4b1eb6);}return logger[_0x4453('0xe')](_0x4453('0x19'));}else if(_[_0x4453('0x1a')](verticesWithRetry,this[_0x4453('0x4')][_0x1c406c][_0x4453('0x14')])){if(_0x2bb0e4==='-'){return logger[_0x4453('0xe')]('max\x20retry\x20reach');}if(_0x28503e&&_0x2bb0e4!=='t'){return this[_0x4453('0x18')](_0x28503e,_0x4b1eb6);}return this['traverseBFS'](_0x1c406c,_0x4b1eb6);}return logger[_0x4453('0xe')](_0x4453('0x1b'));}};module[_0x4453('0x1c')]=Graph;
\ No newline at end of file
+var _0x4e96=['getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addEdge','push','size','relations','traverseBFS','info','length','no\x20edge/s\x20available','condition','split','agicommand','target','default','menu','vswitch','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger','agi'];(function(_0x4a2266,_0x53e92f){var _0x1d7b9f=function(_0x3dafff){while(--_0x3dafff){_0x4a2266['push'](_0x4a2266['shift']());}};_0x1d7b9f(++_0x53e92f);}(_0x4e96,0x1a1));var _0x64e9=function(_0x4adeea,_0x18759b){_0x4adeea=_0x4adeea-0x0;var _0x2e36f4=_0x4e96[_0x4adeea];return _0x2e36f4;};'use strict';var _=require(_0x64e9('0x0'));var logger=require(_0x64e9('0x1'))(_0x64e9('0x2'));var verticesWithRetry=['menu',_0x64e9('0x3'),_0x64e9('0x4')];var Graph=function(){this[_0x64e9('0x5')]={};this[_0x64e9('0x6')]={};this[_0x64e9('0x7')]=0x0;};Graph[_0x64e9('0x8')]['addVertex']=function(_0x567406){this[_0x64e9('0x5')][_0x567406['id']]=_0x567406;this[_0x64e9('0x6')][_0x567406['id']]=[];};Graph['prototype'][_0x64e9('0x9')]=function(_0x36f4f2,_0x341be7,_0x2787c4){this[_0x64e9('0x6')][_0x36f4f2][_0x64e9('0xa')]({'target':_0x341be7,'condition':_0x2787c4});this['numberOfEdges']+=0x1;};Graph[_0x64e9('0x8')][_0x64e9('0xb')]=function(){return _['size'](this[_0x64e9('0x5')]);};Graph[_0x64e9('0x8')][_0x64e9('0xc')]=function(){return this[_0x64e9('0x7')];};Graph['prototype']['getVertex']=function(_0x33f053){return this[_0x64e9('0x5')][_0x33f053];};Graph[_0x64e9('0x8')][_0x64e9('0xd')]=function(_0x39813d,_0x26407b){if(!this[_0x64e9('0x5')][_0x39813d]){return logger[_0x64e9('0xe')]('no\x20vertex\x20found');}var _0x96c47=_0x26407b(this[_0x64e9('0x5')][_0x39813d]);if(!_0x96c47){return logger[_0x64e9('0xe')]('stop\x20traverse');}if(this[_0x64e9('0x6')][_0x39813d][_0x64e9('0xf')]===0x0){return logger[_0x64e9('0xe')](_0x64e9('0x10'));}for(var _0x2afaf3=0x0,_0x5f2a95=[],_0x59ca31=![];_0x2afaf3<this['edges'][_0x39813d][_0x64e9('0xf')];_0x2afaf3+=0x1){if(this[_0x64e9('0x6')][_0x39813d][_0x2afaf3][_0x64e9('0x11')]){_0x5f2a95=this[_0x64e9('0x6')][_0x39813d][_0x2afaf3][_0x64e9('0x11')][_0x64e9('0x12')](',');for(var _0x497c36=0x0;_0x497c36<_0x5f2a95[_0x64e9('0xf')];_0x497c36+=0x1){if(this[_0x64e9('0x5')][_0x39813d][_0x64e9('0x13')]==='vswitch'&&_0x5f2a95[_0x497c36]==='-'){_0x59ca31=this[_0x64e9('0x6')][_0x39813d][_0x2afaf3][_0x64e9('0x14')];logger[_0x64e9('0xe')](_0x64e9('0x15'),_0x5f2a95[_0x497c36],this['edges'][_0x39813d][_0x2afaf3]['target']);}else if(this['vertices'][_0x39813d]['agicommand']===_0x64e9('0x16')&&_0x5f2a95[_0x497c36]==='i'){_0x59ca31=this['edges'][_0x39813d][_0x2afaf3]['target'];logger[_0x64e9('0xe')]('invalid',_0x5f2a95[_0x497c36],this[_0x64e9('0x6')][_0x39813d][_0x2afaf3][_0x64e9('0x14')]);}if(_0x5f2a95[_0x497c36]===_0x96c47){return this[_0x64e9('0xd')](this[_0x64e9('0x6')][_0x39813d][_0x2afaf3]['target'],_0x26407b);}}}else{return this[_0x64e9('0xd')](this['edges'][_0x39813d][_0x2afaf3][_0x64e9('0x14')],_0x26407b);}}if(_0x5f2a95[_0x64e9('0xf')]){if(this[_0x64e9('0x5')][_0x39813d][_0x64e9('0x13')]===_0x64e9('0x17')){if(_0x59ca31){return this[_0x64e9('0xd')](_0x59ca31,_0x26407b);}return logger['info'](_0x64e9('0x18'));}else if(_[_0x64e9('0x19')](verticesWithRetry,this[_0x64e9('0x5')][_0x39813d]['agicommand'])){if(_0x96c47==='-'){return logger[_0x64e9('0xe')](_0x64e9('0x1a'));}if(_0x59ca31&&_0x96c47!=='t'){return this[_0x64e9('0xd')](_0x59ca31,_0x26407b);}return this[_0x64e9('0xd')](_0x39813d,_0x26407b);}return logger[_0x64e9('0xe')](_0x64e9('0x1b'));}};module['exports']=Graph;
\ No newline at end of file
index 319c698..47556d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85c8=['gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','isUndefined','result','toString','agicommand\x20not\x20found','finally','clear','vertex','[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','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','./server','listening','xml2json','lodash','syncho','util','moment','../../config/logger','agi','./mailRpc','./graph','./vertices','defaults','127.0.0.1','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','[%s]\x20%s','format','[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','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','target','addEdge','source','value','getSquareProject','then','createSquareReport','catch','indexOf','agi_','variables','hangup','sync','production','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','debug','gotoc'];(function(_0x54fdbd,_0x269060){var _0x1501ab=function(_0x26db98){while(--_0x26db98){_0x54fdbd['push'](_0x54fdbd['shift']());}};_0x1501ab(++_0x269060);}(_0x85c8,0x123));var _0x885c=function(_0x55728f,_0x13fc9d){_0x55728f=_0x55728f-0x0;var _0x11d5de=_0x85c8[_0x55728f];return _0x11d5de;};'use strict';var parser=require(_0x885c('0x0'));var _=require(_0x885c('0x1'));var syncho=require(_0x885c('0x2'));var util=require(_0x885c('0x3'));var moment=require(_0x885c('0x4'));var config=require('../../config/environment');var logger=require(_0x885c('0x5'))(_0x885c('0x6'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0x885c('0x7'));var Graph=require(_0x885c('0x8'));var Vertices=require(_0x885c('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x885c('0x6')]=_[_0x885c('0xa')](config[_0x885c('0x6')],{'ip':_0x885c('0xb'),'port':0x11dd});function connectionHandler(_0x3bc8d2){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x3bc8d2);agiHandler(_0x3bc8d2);}catch(_0x33fc39){logger['error'](_0x33fc39[_0x885c('0xc')]);}});});}function listeningHandler(){console[_0x885c('0xd')](_0x885c('0xe'),config[_0x885c('0x6')][_0x885c('0xf')]);logger[_0x885c('0x10')](util['format'](_0x885c('0x11'),config['agi']['ip'],config[_0x885c('0x6')][_0x885c('0xf')]));}function errorHandler(_0x25d89c){if(_0x25d89c&&_0x25d89c[_0x885c('0x12')]&&_0x25d89c[_0x885c('0x13')]){logger[_0x885c('0x14')](util['format'](_0x885c('0x15'),_0x25d89c[_0x885c('0x12')],_0x25d89c[_0x885c('0x13')]));}else{logger[_0x885c('0x14')](util[_0x885c('0x16')]('[ERROR]\x20%s',_0x25d89c[_0x885c('0xc')]));}}function closeHandler(){logger[_0x885c('0x10')](util[_0x885c('0x16')](_0x885c('0x17'),this[_0x885c('0x18')],this[_0x885c('0x19')],this[_0x885c('0x1a')],this[_0x885c('0x1b')],this[_0x885c('0x1c')]));try{createSquareReport(this);}catch(_0x261b35){logger[_0x885c('0x14')](_0x261b35[_0x885c('0xc')]);}}function timeoutHandler(){logger[_0x885c('0x10')](util['format'](_0x885c('0x1d'),this[_0x885c('0x18')],this[_0x885c('0x19')],this[_0x885c('0x1a')],this[_0x885c('0x1b')],this['uniqueid']));}function hangupHandler(){logger[_0x885c('0x10')](util[_0x885c('0x16')](_0x885c('0x1e'),this['arg_1'],this[_0x885c('0x19')],this[_0x885c('0x1a')],this['dnid'],this[_0x885c('0x1c')]));this['evtHangup']=!![];}function getRoot(_0x3b4394){return parser[_0x885c('0x1f')](_0x3b4394,{'object':!![]})[_0x885c('0x20')][_0x885c('0x21')];}function addVertex(_0x903c0e,_0x37fc50,_0x41e086){_0x37fc50[_0x885c('0x22')]=_0x41e086;if(_0x37fc50['hasOwnProperty'](_0x885c('0x23'))){_0x37fc50[_0x885c('0x24')]=parseInt(_0x37fc50[_0x885c('0x23')],0xa);}_0x903c0e[_0x885c('0x25')](_[_0x885c('0x26')](_0x37fc50,_0x885c('0x27')));}function initGraph(_0x34d235,_0x2c7fd6){var _0x25622a=new Graph();for(var _0x940391 in _0x34d235){if(_0x34d235[_0x885c('0x28')](_0x940391)){if(_[_0x885c('0x29')](_0x34d235[_0x940391])){for(var _0x25d82f=0x0;_0x25d82f<_0x34d235[_0x940391][_0x885c('0x2a')];_0x25d82f+=0x1){addVertex(_0x25622a,_0x34d235[_0x940391][_0x25d82f],_0x940391);}}else{addVertex(_0x25622a,_0x34d235[_0x940391],_0x940391);}}}for(var _0x4c2e93=0x0;_0x4c2e93<_0x2c7fd6[_0x885c('0x2a')];_0x4c2e93+=0x1){if(_0x2c7fd6[_0x4c2e93]['source']&&_0x2c7fd6[_0x4c2e93][_0x885c('0x2b')]){_0x25622a[_0x885c('0x2c')](_0x2c7fd6[_0x4c2e93][_0x885c('0x2d')],_0x2c7fd6[_0x4c2e93][_0x885c('0x2b')],_0x2c7fd6[_0x4c2e93][_0x885c('0x2e')]);}}return _0x25622a;}function getSquareProject(_0x2fd6a7,_0x15508f){rpc[_0x885c('0x2f')](_0x2fd6a7)[_0x885c('0x30')](function(_0x27100e){_0x15508f(null,_0x27100e);})['catch'](function(_0x4341df){_0x15508f(null,_0x4341df);});}function createSquareReport(_0x5ed2b9,_0x32f8ab){rpc[_0x885c('0x31')](_0x5ed2b9)['then'](function(_0x1ddccb){if(_0x32f8ab){_0x32f8ab(null,_0x1ddccb);}})[_0x885c('0x32')](function(_0x17e4b7){if(_0x32f8ab){_0x32f8ab(null,_0x17e4b7);}});}function setChannelVariables(_0x41d509){for(var _0x39f6a2 in _0x41d509){if(_0x41d509[_0x885c('0x28')](_0x39f6a2)){if(_0x39f6a2[_0x885c('0x33')](_0x885c('0x34'))===0x0){_0x41d509[_0x39f6a2['substring'](0x4)]=_0x41d509[_0x39f6a2];delete _0x41d509[_0x39f6a2];}}}}function getLogFromObject(_0x31b49b){return util['inspect'](_0x31b49b,{'showHidden':![],'depth':null});}function agiHandler(_0x36923c){var _0x241a51,_0x46d0d7,_0x269201,_0x20f36f,_0x4bd2ae;logger['debug'](_0x885c('0x35'),JSON['stringify'](_0x36923c,null,0x2));logger[_0x885c('0x10')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x36923c[_0x885c('0x18')],_0x36923c[_0x885c('0x19')],_0x36923c[_0x885c('0x1a')],_0x36923c[_0x885c('0x1b')],_0x36923c['uniqueid']));_0x36923c['on'](_0x885c('0x14'),errorHandler);_0x36923c['on']('close',closeHandler);_0x36923c['on']('timeout',timeoutHandler);_0x36923c['evtHangup']=![];_0x36923c['on'](_0x885c('0x36'),hangupHandler);var _0x324c2c=getSquareProject[_0x885c('0x37')](null,_0x36923c[_0x885c('0x18')]);if(_0x324c2c){if(_0x324c2c[_0x885c('0x38')]){_0x241a51=getRoot(_0x324c2c[_0x885c('0x38')]);if(_0x241a51&&_0x241a51['start']){logger['debug'](_0x885c('0x21'),JSON[_0x885c('0x39')](_0x241a51,null,0x2));_0x36923c[_0x885c('0x3a')]=moment()[_0x885c('0x16')](_0x885c('0x3b'));_0x46d0d7=initGraph(_[_0x885c('0x26')](_0x241a51,_0x885c('0x27')),_0x241a51[_0x885c('0x27')]);_0x269201=new Vertices(_0x36923c,rpc,mailRpc);logger[_0x885c('0x10')](util['format'](_0x885c('0x3c'),_0x36923c[_0x885c('0x18')],_0x36923c[_0x885c('0x19')],_0x36923c[_0x885c('0x1a')],_0x36923c['dnid'],_0x36923c[_0x885c('0x1c')]));_0x46d0d7[_0x885c('0x3d')](_0x241a51[_0x885c('0x3e')]['id'],function(_0x299fc6){try{_0x299fc6=_0x269201['clear'](_0x299fc6);logger[_0x885c('0x3f')]('vertex',JSON['stringify'](_0x299fc6,null,0x2));if(_0x299fc6[_0x885c('0x22')]===_0x885c('0x40')){logger[_0x885c('0x10')](_0x885c('0x41'));_0x36923c[_0x885c('0x42')]=_0x299fc6[_0x885c('0x42')]||_0x36923c['context'];_0x36923c['extension']=_0x299fc6[_0x885c('0x43')];_0x36923c['priority']=_0x299fc6[_0x885c('0x44')]?_0x299fc6[_0x885c('0x44')]-0x1:0x1;return null;}else if(_0x299fc6&&_0x269201[_0x299fc6['agicommand']]){_0x4bd2ae=_0x269201[_0x299fc6[_0x885c('0x22')]](_0x299fc6);logger['info'](_0x885c('0x45'),JSON['stringify'](_0x4bd2ae,null,0x2));if(_0x4bd2ae&&_0x4bd2ae[_0x885c('0x46')]===AGI_CODE_SUCCESS&&_0x4bd2ae['result']!==AGI_RESULT_ERROR&&!_0x36923c[_0x885c('0x47')]){logger['debug'](_0x885c('0x45'),getLogFromObject(_0x4bd2ae));return _[_0x885c('0x48')](_0x4bd2ae[_0x885c('0x49')])?null:_0x4bd2ae['result'][_0x885c('0x4a')]();}else{logger[_0x885c('0x14')](_0x885c('0x45'),getLogFromObject(_0x4bd2ae));return null;}}else{logger[_0x885c('0x14')](_0x885c('0x4b'));return null;}}catch(_0x5b499f){logger[_0x885c('0x14')](_0x5b499f[_0x885c('0xc')]);return null;}});if(_0x241a51[_0x885c('0x4c')]){logger[_0x885c('0x10')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x36923c[_0x885c('0x18')],_0x36923c[_0x885c('0x19')],_0x36923c[_0x885c('0x1a')],_0x36923c[_0x885c('0x1b')],_0x36923c[_0x885c('0x1c')]));_0x46d0d7[_0x885c('0x3d')](_0x241a51[_0x885c('0x4c')]['id'],function(_0x433bbb){try{_0x433bbb=_0x269201[_0x885c('0x4d')](_0x433bbb);logger[_0x885c('0x3f')](_0x885c('0x4e'),JSON[_0x885c('0x39')](_0x433bbb,null,0x2));if(_0x433bbb&&_0x269201[_0x433bbb[_0x885c('0x22')]]){_0x4bd2ae=_0x269201[_0x433bbb[_0x885c('0x22')]](_0x433bbb);if(_0x4bd2ae){logger[_0x885c('0x3f')](_0x885c('0x45'),getLogFromObject(_0x4bd2ae));return _['isUndefined'](_0x4bd2ae[_0x885c('0x49')])?null:_0x4bd2ae[_0x885c('0x49')][_0x885c('0x4a')]();}else{logger[_0x885c('0x14')]('response',getLogFromObject(_0x4bd2ae));return null;}}else{logger['error'](_0x885c('0x4b'));return null;}}catch(_0x2d7ba3){logger[_0x885c('0x14')](_0x2d7ba3[_0x885c('0xc')]);return null;}});}logger[_0x885c('0x10')](util[_0x885c('0x16')](_0x885c('0x4f'),_0x36923c[_0x885c('0x18')],_0x36923c['calleridname'],_0x36923c['callerid'],_0x36923c[_0x885c('0x1b')],_0x36923c['uniqueid']));logger[_0x885c('0x10')](util[_0x885c('0x16')](_0x885c('0x50'),_0x36923c[_0x885c('0x42')],_0x36923c[_0x885c('0x43')],parseInt(_0x36923c[_0x885c('0x44')],0xa)+0x1));_0x36923c[_0x885c('0x51')](_0x36923c[_0x885c('0x42')],_0x36923c['extension'],parseInt(_0x36923c[_0x885c('0x44')],0xa)+0x1);_0x36923c[_0x885c('0x52')]();}}else{logger['error'](util[_0x885c('0x16')]('Project\x20%s\x20not\x20published',_0x36923c[_0x885c('0x18')]));_0x36923c[_0x885c('0x51')](_0x36923c[_0x885c('0x42')],_0x36923c[_0x885c('0x43')],parseInt(_0x36923c[_0x885c('0x44')],0xa)+0x1);_0x36923c[_0x885c('0x52')]();}}else{logger[_0x885c('0x14')](util[_0x885c('0x16')]('Project\x20%s\x20not\x20found',_0x36923c[_0x885c('0x18')]));_0x36923c[_0x885c('0x51')](_0x36923c[_0x885c('0x42')],_0x36923c['extension'],parseInt(_0x36923c[_0x885c('0x44')],0xa)+0x1);_0x36923c['close']();}}function main(){var _0x3dd221;return utilLicense[_0x885c('0x53')]()[_0x885c('0x30')](function(_0x71181e){if(_0x71181e){if(_0x71181e[_0x885c('0x54')]){if(_0x71181e[_0x885c('0x55')]&&_0x71181e[_0x885c('0x55')]>0x0){logger[_0x885c('0x10')](util[_0x885c('0x16')]('[LICENSE]\x20CHANNELS:\x20%s',_0x71181e['callysquare']));_0x3dd221=_0x71181e['callysquare'];}else{logger['info'](_0x885c('0x56'));}}else{logger[_0x885c('0x10')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x3dd221=-0x1;}}})['catch'](function(_0x1d445f){logger['error']('[LICENSE]',_0x1d445f[_0x885c('0xc')]);})[_0x885c('0x4c')](function(){var _0x143aa1=require(_0x885c('0x57'))(config[_0x885c('0x6')][_0x885c('0xf')],config['agi']['ip'],_0x3dd221);_0x143aa1['on']('error',errorHandler);_0x143aa1['on'](_0x885c('0x58'),listeningHandler);_0x143aa1['on']('connection',connectionHandler);_0x143aa1['on']('close',closeHandler);});}main();
\ No newline at end of file
+var _0xbfa8=['callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./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','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','toJson','root','agicommand','retry','maxRetry','addVertex','omit','hasOwnProperty','isArray','target','addEdge','source','value','then','catch','createSquareReport','agi_','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','close','timeout','evtHangup','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','finally','vertex','agicommand\x20not\x20found','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice'];(function(_0x2f7aa6,_0x2072e5){var _0x18d006=function(_0x21f07b){while(--_0x21f07b){_0x2f7aa6['push'](_0x2f7aa6['shift']());}};_0x18d006(++_0x2072e5);}(_0xbfa8,0xbe));var _0x8bfa=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbfa8[_0x2c91e9];return _0x13f0ff;};'use strict';var parser=require(_0x8bfa('0x0'));var _=require('lodash');var syncho=require(_0x8bfa('0x1'));var util=require('util');var moment=require('moment');var config=require(_0x8bfa('0x2'));var logger=require(_0x8bfa('0x3'))(_0x8bfa('0x4'));var utilLicense=require(_0x8bfa('0x5'));var rpc=require(_0x8bfa('0x6'));var mailRpc=require(_0x8bfa('0x7'));var Graph=require(_0x8bfa('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8bfa('0x4')]=_[_0x8bfa('0x9')](config['agi'],{'ip':_0x8bfa('0xa'),'port':0x11dd});function connectionHandler(_0x2fbe33){process[_0x8bfa('0xb')](function(){syncho(function(){try{setChannelVariables(_0x2fbe33);agiHandler(_0x2fbe33);}catch(_0x57fd87){logger[_0x8bfa('0xc')](_0x57fd87[_0x8bfa('0xd')]);}});});}function listeningHandler(){console[_0x8bfa('0xe')](_0x8bfa('0xf'),config[_0x8bfa('0x4')][_0x8bfa('0x10')]);logger[_0x8bfa('0x11')](util[_0x8bfa('0x12')](_0x8bfa('0x13'),config[_0x8bfa('0x4')]['ip'],config[_0x8bfa('0x4')][_0x8bfa('0x10')]));}function errorHandler(_0x39a0c6){if(_0x39a0c6&&_0x39a0c6[_0x8bfa('0x14')]&&_0x39a0c6[_0x8bfa('0x15')]){logger['error'](util[_0x8bfa('0x12')](_0x8bfa('0x16'),_0x39a0c6[_0x8bfa('0x14')],_0x39a0c6[_0x8bfa('0x15')]));}else{logger['error'](util[_0x8bfa('0x12')]('[ERROR]\x20%s',_0x39a0c6['stack']));}}function closeHandler(){logger[_0x8bfa('0x11')](util[_0x8bfa('0x12')](_0x8bfa('0x17'),this['arg_1'],this['calleridname'],this[_0x8bfa('0x18')],this[_0x8bfa('0x19')],this[_0x8bfa('0x1a')]));try{createSquareReport(this);}catch(_0x3350e9){logger[_0x8bfa('0xc')](_0x3350e9[_0x8bfa('0xd')]);}}function timeoutHandler(){logger[_0x8bfa('0x11')](util[_0x8bfa('0x12')](_0x8bfa('0x1b'),this['arg_1'],this['calleridname'],this[_0x8bfa('0x18')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x8bfa('0x11')](util[_0x8bfa('0x12')](_0x8bfa('0x1c'),this[_0x8bfa('0x1d')],this['calleridname'],this[_0x8bfa('0x18')],this[_0x8bfa('0x19')],this[_0x8bfa('0x1a')]));this['evtHangup']=!![];}function getRoot(_0x38d7bb){return parser[_0x8bfa('0x1e')](_0x38d7bb,{'object':!![]})['mxGraphModel'][_0x8bfa('0x1f')];}function addVertex(_0x3c651a,_0x5dd23e,_0x38be80){_0x5dd23e[_0x8bfa('0x20')]=_0x38be80;if(_0x5dd23e['hasOwnProperty'](_0x8bfa('0x21'))){_0x5dd23e[_0x8bfa('0x22')]=parseInt(_0x5dd23e[_0x8bfa('0x21')],0xa);}_0x3c651a[_0x8bfa('0x23')](_[_0x8bfa('0x24')](_0x5dd23e,'mxCell'));}function initGraph(_0x14fc61,_0x1794bb){var _0x4b7445=new Graph();for(var _0x4d5d4f in _0x14fc61){if(_0x14fc61[_0x8bfa('0x25')](_0x4d5d4f)){if(_[_0x8bfa('0x26')](_0x14fc61[_0x4d5d4f])){for(var _0x5a3914=0x0;_0x5a3914<_0x14fc61[_0x4d5d4f]['length'];_0x5a3914+=0x1){addVertex(_0x4b7445,_0x14fc61[_0x4d5d4f][_0x5a3914],_0x4d5d4f);}}else{addVertex(_0x4b7445,_0x14fc61[_0x4d5d4f],_0x4d5d4f);}}}for(var _0x6256e3=0x0;_0x6256e3<_0x1794bb['length'];_0x6256e3+=0x1){if(_0x1794bb[_0x6256e3]['source']&&_0x1794bb[_0x6256e3][_0x8bfa('0x27')]){_0x4b7445[_0x8bfa('0x28')](_0x1794bb[_0x6256e3][_0x8bfa('0x29')],_0x1794bb[_0x6256e3][_0x8bfa('0x27')],_0x1794bb[_0x6256e3][_0x8bfa('0x2a')]);}}return _0x4b7445;}function getSquareProject(_0x37aa76,_0x835cdf){rpc['getSquareProject'](_0x37aa76)[_0x8bfa('0x2b')](function(_0x3f60ce){_0x835cdf(null,_0x3f60ce);})[_0x8bfa('0x2c')](function(_0x619763){_0x835cdf(null,_0x619763);});}function createSquareReport(_0xef25da,_0x3e8b66){rpc[_0x8bfa('0x2d')](_0xef25da)['then'](function(_0x4bef3c){if(_0x3e8b66){_0x3e8b66(null,_0x4bef3c);}})[_0x8bfa('0x2c')](function(_0x34341d){if(_0x3e8b66){_0x3e8b66(null,_0x34341d);}});}function setChannelVariables(_0x1e5bc1){for(var _0x3c431f in _0x1e5bc1){if(_0x1e5bc1[_0x8bfa('0x25')](_0x3c431f)){if(_0x3c431f['indexOf'](_0x8bfa('0x2e'))===0x0){_0x1e5bc1[_0x3c431f['substring'](0x4)]=_0x1e5bc1[_0x3c431f];delete _0x1e5bc1[_0x3c431f];}}}}function getLogFromObject(_0x128b87){return util[_0x8bfa('0x2f')](_0x128b87,{'showHidden':![],'depth':null});}function agiHandler(_0x155b42){var _0x567d4c,_0x294431,_0x27d5e1,_0x1c4f2f,_0x557eec;logger[_0x8bfa('0x30')](_0x8bfa('0x31'),JSON[_0x8bfa('0x32')](_0x155b42,null,0x2));logger[_0x8bfa('0x11')](util[_0x8bfa('0x12')](_0x8bfa('0x33'),_0x155b42[_0x8bfa('0x1d')],_0x155b42[_0x8bfa('0x34')],_0x155b42[_0x8bfa('0x18')],_0x155b42[_0x8bfa('0x19')],_0x155b42['uniqueid']));_0x155b42['on'](_0x8bfa('0xc'),errorHandler);_0x155b42['on'](_0x8bfa('0x35'),closeHandler);_0x155b42['on'](_0x8bfa('0x36'),timeoutHandler);_0x155b42[_0x8bfa('0x37')]=![];_0x155b42['on']('hangup',hangupHandler);var _0x4d54b5=getSquareProject['sync'](null,_0x155b42['arg_1']);if(_0x4d54b5){if(_0x4d54b5[_0x8bfa('0x38')]){_0x567d4c=getRoot(_0x4d54b5[_0x8bfa('0x38')]);if(_0x567d4c&&_0x567d4c[_0x8bfa('0x39')]){logger[_0x8bfa('0x30')](_0x8bfa('0x1f'),JSON['stringify'](_0x567d4c,null,0x2));_0x155b42[_0x8bfa('0x3a')]=moment()[_0x8bfa('0x12')](_0x8bfa('0x3b'));_0x294431=initGraph(_[_0x8bfa('0x24')](_0x567d4c,_0x8bfa('0x3c')),_0x567d4c[_0x8bfa('0x3c')]);_0x27d5e1=new Vertices(_0x155b42,rpc,mailRpc);logger[_0x8bfa('0x11')](util[_0x8bfa('0x12')](_0x8bfa('0x3d'),_0x155b42[_0x8bfa('0x1d')],_0x155b42[_0x8bfa('0x34')],_0x155b42[_0x8bfa('0x18')],_0x155b42[_0x8bfa('0x19')],_0x155b42[_0x8bfa('0x1a')]));_0x294431[_0x8bfa('0x3e')](_0x567d4c['start']['id'],function(_0x3f6e10){try{_0x3f6e10=_0x27d5e1[_0x8bfa('0x3f')](_0x3f6e10);logger[_0x8bfa('0x30')]('vertex',JSON[_0x8bfa('0x32')](_0x3f6e10,null,0x2));if(_0x3f6e10[_0x8bfa('0x20')]===_0x8bfa('0x40')){logger[_0x8bfa('0x11')](_0x8bfa('0x41'));_0x155b42[_0x8bfa('0x42')]=_0x3f6e10[_0x8bfa('0x42')]||_0x155b42[_0x8bfa('0x42')];_0x155b42[_0x8bfa('0x43')]=_0x3f6e10['extension'];_0x155b42[_0x8bfa('0x44')]=_0x3f6e10[_0x8bfa('0x44')]?_0x3f6e10[_0x8bfa('0x44')]-0x1:0x1;return null;}else if(_0x3f6e10&&_0x27d5e1[_0x3f6e10[_0x8bfa('0x20')]]){_0x557eec=_0x27d5e1[_0x3f6e10[_0x8bfa('0x20')]](_0x3f6e10);logger[_0x8bfa('0x11')](_0x8bfa('0x45'),JSON[_0x8bfa('0x32')](_0x557eec,null,0x2));if(_0x557eec&&_0x557eec[_0x8bfa('0x46')]===AGI_CODE_SUCCESS&&_0x557eec[_0x8bfa('0x47')]!==AGI_RESULT_ERROR&&!_0x155b42[_0x8bfa('0x37')]){logger[_0x8bfa('0x30')]('response',getLogFromObject(_0x557eec));return _[_0x8bfa('0x48')](_0x557eec['result'])?null:_0x557eec[_0x8bfa('0x47')][_0x8bfa('0x49')]();}else{logger['error'](_0x8bfa('0x45'),getLogFromObject(_0x557eec));return null;}}else{logger[_0x8bfa('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0x10b75d){logger[_0x8bfa('0xc')](_0x10b75d[_0x8bfa('0xd')]);return null;}});if(_0x567d4c['finally']){logger[_0x8bfa('0x11')](util[_0x8bfa('0x12')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x155b42['arg_1'],_0x155b42['calleridname'],_0x155b42['callerid'],_0x155b42[_0x8bfa('0x19')],_0x155b42['uniqueid']));_0x294431['traverseBFS'](_0x567d4c[_0x8bfa('0x4a')]['id'],function(_0x484361){try{_0x484361=_0x27d5e1[_0x8bfa('0x3f')](_0x484361);logger[_0x8bfa('0x30')](_0x8bfa('0x4b'),JSON[_0x8bfa('0x32')](_0x484361,null,0x2));if(_0x484361&&_0x27d5e1[_0x484361[_0x8bfa('0x20')]]){_0x557eec=_0x27d5e1[_0x484361['agicommand']](_0x484361);if(_0x557eec){logger['debug'](_0x8bfa('0x45'),getLogFromObject(_0x557eec));return _[_0x8bfa('0x48')](_0x557eec[_0x8bfa('0x47')])?null:_0x557eec[_0x8bfa('0x47')][_0x8bfa('0x49')]();}else{logger['error'](_0x8bfa('0x45'),getLogFromObject(_0x557eec));return null;}}else{logger[_0x8bfa('0xc')](_0x8bfa('0x4c'));return null;}}catch(_0x339111){logger[_0x8bfa('0xc')](_0x339111[_0x8bfa('0xd')]);return null;}});}logger[_0x8bfa('0x11')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x155b42['arg_1'],_0x155b42['calleridname'],_0x155b42[_0x8bfa('0x18')],_0x155b42[_0x8bfa('0x19')],_0x155b42[_0x8bfa('0x1a')]));logger[_0x8bfa('0x11')](util[_0x8bfa('0x12')](_0x8bfa('0x4d'),_0x155b42['context'],_0x155b42[_0x8bfa('0x43')],parseInt(_0x155b42['priority'],0xa)+0x1));_0x155b42[_0x8bfa('0x4e')](_0x155b42[_0x8bfa('0x42')],_0x155b42[_0x8bfa('0x43')],parseInt(_0x155b42[_0x8bfa('0x44')],0xa)+0x1);_0x155b42[_0x8bfa('0x35')]();}}else{logger[_0x8bfa('0xc')](util['format'](_0x8bfa('0x4f'),_0x155b42[_0x8bfa('0x1d')]));_0x155b42[_0x8bfa('0x4e')](_0x155b42['context'],_0x155b42[_0x8bfa('0x43')],parseInt(_0x155b42[_0x8bfa('0x44')],0xa)+0x1);_0x155b42[_0x8bfa('0x35')]();}}else{logger[_0x8bfa('0xc')](util[_0x8bfa('0x12')](_0x8bfa('0x50'),_0x155b42['arg_1']));_0x155b42[_0x8bfa('0x4e')](_0x155b42[_0x8bfa('0x42')],_0x155b42['extension'],parseInt(_0x155b42[_0x8bfa('0x44')],0xa)+0x1);_0x155b42[_0x8bfa('0x35')]();}}function main(){var _0x4c3653;return utilLicense[_0x8bfa('0x51')]()[_0x8bfa('0x2b')](function(_0x3e1a11){if(_0x3e1a11){if(_0x3e1a11[_0x8bfa('0x52')]){if(_0x3e1a11[_0x8bfa('0x53')]&&_0x3e1a11[_0x8bfa('0x53')]>0x0){logger[_0x8bfa('0x11')](util[_0x8bfa('0x12')](_0x8bfa('0x54'),_0x3e1a11[_0x8bfa('0x53')]));_0x4c3653=_0x3e1a11[_0x8bfa('0x53')];}else{logger[_0x8bfa('0x11')](_0x8bfa('0x55'));}}else{logger[_0x8bfa('0x11')](_0x8bfa('0x56'));_0x4c3653=-0x1;}}})[_0x8bfa('0x2c')](function(_0x29a7e4){logger[_0x8bfa('0xc')](_0x8bfa('0x57'),_0x29a7e4[_0x8bfa('0xd')]);})[_0x8bfa('0x4a')](function(){var _0xc70a19=require(_0x8bfa('0x58'))(config[_0x8bfa('0x4')][_0x8bfa('0x10')],config[_0x8bfa('0x4')]['ip'],_0x4c3653);_0xc70a19['on'](_0x8bfa('0xc'),errorHandler);_0xc70a19['on'](_0x8bfa('0x59'),listeningHandler);_0xc70a19['on'](_0x8bfa('0x5a'),connectionHandler);_0xc70a19['on']('close',closeHandler);});}main();
\ No newline at end of file
index 483601d..fc13ff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddbf=['jayson/promise','client','http','then','error','result','sendMailMessage','bluebird'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0xddbf,0x12f));var _0xfddb=function(_0x276528,_0x58af5f){_0x276528=_0x276528-0x0;var _0x4cfeb9=_0xddbf[_0x276528];return _0x4cfeb9;};'use strict';var BPromise=require(_0xfddb('0x0'));var jayson=require(_0xfddb('0x1'));var client=jayson[_0xfddb('0x2')][_0xfddb('0x3')]({'port':0x232b});function request(_0x24af65,_0x46b8e2){return new BPromise(function(_0x22c26f,_0x2893f4){return client['request'](_0x24af65,_0x46b8e2)[_0xfddb('0x4')](function(_0x318b54){if(_0x318b54[_0xfddb('0x5')]){return _0x2893f4(_0x318b54[_0xfddb('0x5')]['message']);}else{return _0x22c26f(_0x318b54[_0xfddb('0x6')]);}})['catch'](function(_0x230c4a){return _0x2893f4(_0x230c4a);});});}exports[_0xfddb('0x7')]=function(_0xb72537,_0x5e0d1b){return request('SendMail',{'account':_0xb72537,'message':_0x5e0d1b});};
\ No newline at end of file
+var _0xd1ed=['result','SendMail','bluebird','client','http','request','then','error','message'];(function(_0xc1966c,_0x9183f5){var _0x39010a=function(_0x15e97d){while(--_0x15e97d){_0xc1966c['push'](_0xc1966c['shift']());}};_0x39010a(++_0x9183f5);}(_0xd1ed,0xb6));var _0xdd1e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1ed[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xdd1e('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xdd1e('0x1')][_0xdd1e('0x2')]({'port':0x232b});function request(_0x349243,_0x3bff91){return new BPromise(function(_0x31e028,_0xd58305){return client[_0xdd1e('0x3')](_0x349243,_0x3bff91)[_0xdd1e('0x4')](function(_0x164888){if(_0x164888[_0xdd1e('0x5')]){return _0xd58305(_0x164888[_0xdd1e('0x5')][_0xdd1e('0x6')]);}else{return _0x31e028(_0x164888[_0xdd1e('0x7')]);}})['catch'](function(_0x156c87){return _0xd58305(_0x156c87);});});}exports['sendMailMessage']=function(_0x5e626f,_0xf2b8e1){return request(_0xdd1e('0x8'),{'account':_0x5e626f,'message':_0xf2b8e1});};
\ No newline at end of file
index e526cba..ea52389 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b95=['emit','headers','exports','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2b95,0x159));var _0x52b9=function(_0x2d61ac,_0x18ff36){_0x2d61ac=_0x2d61ac-0x0;var _0x3f7d3c=_0x2b95[_0x2d61ac];return _0x3f7d3c;};'use strict';var util=require('util');var Transform=require('stream')[_0x52b9('0x0')];function AGIReply(_0x156c19){Transform[_0x52b9('0x1')](this,_0x156c19);this[_0x52b9('0x2')]='';this[_0x52b9('0x3')]=![];}util[_0x52b9('0x4')](AGIReply,Transform);AGIReply[_0x52b9('0x5')][_0x52b9('0x6')]=function(_0x16b0b4,_0x3df583,_0x1b62d6){var _0x49a291='\x0a',_0x5560d2=['\x0a\x0a',_0x52b9('0x7')],_0xee7714=-0x1,_0x45d484=-0x1,_0x5ea6c4='',_0x20004c=0x0,_0xb8eceb='',_0x2e4df6='';this[_0x52b9('0x2')]+=_0x16b0b4[_0x52b9('0x8')]();_0xb8eceb=this[_0x52b9('0x2')];if(!this[_0x52b9('0x3')]){_0x20004c=0x0;while(_0x5560d2[_0x20004c]){while((_0x45d484=_0xb8eceb[_0x52b9('0x9')](_0x5560d2[_0x20004c]))!=-0x1){_0x5ea6c4=_0x5560d2[_0x20004c];_0x2e4df6=_0xb8eceb['substring'](0x0,_0x45d484);_0xb8eceb=_0xb8eceb[_0x52b9('0xa')](_0x45d484+_0x5ea6c4[_0x52b9('0xb')]);var _0x5dc571=_0x2e4df6[_0x52b9('0xc')](_0x49a291),_0x3c9668=0x0,_0x239314={},_0x4f8ed8='',_0x7c39e0='',_0x5b6924=-0x1;while(_0x5dc571[_0x3c9668]){_0x5b6924=_0x5dc571[_0x3c9668]['indexOf'](':');if(_0x5b6924!=-0x1){_0x4f8ed8=_0x5dc571[_0x3c9668][_0x52b9('0xd')](0x0,_0x5b6924)[_0x52b9('0xe')]();_0x7c39e0=_0x5dc571[_0x3c9668][_0x52b9('0xd')](_0x5b6924+0x1)[_0x52b9('0xe')]();if(_0x4f8ed8[_0x52b9('0xb')]>0x0){_0x239314[_0x4f8ed8]=_0x7c39e0;}}else{}_0x3c9668++;}this[_0x52b9('0xf')](_0x52b9('0x10'),_0x239314);this[_0x52b9('0x3')]=!![];}_0x20004c++;}this[_0x52b9('0x2')]=_0xb8eceb;}else{while((_0xee7714=_0xb8eceb[_0x52b9('0x9')](_0x49a291))!=-0x1){_0x2e4df6=_0xb8eceb[_0x52b9('0xa')](0x0,_0xee7714);this[_0x52b9('0xf')]('line',_0x2e4df6);_0xb8eceb=_0xb8eceb[_0x52b9('0xa')](_0xee7714+_0x49a291['length']);}this[_0x52b9('0x2')]=_0xb8eceb;}_0x1b62d6();};module[_0x52b9('0x11')]=AGIReply;
\ No newline at end of file
+var _0xa7ef=['trim','emit','line','exports','util','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice'];(function(_0x37c2b7,_0x5e837c){var _0x3354a5=function(_0x40c407){while(--_0x40c407){_0x37c2b7['push'](_0x37c2b7['shift']());}};_0x3354a5(++_0x5e837c);}(_0xa7ef,0x70));var _0xfa7e=function(_0x134b05,_0x471a3f){_0x134b05=_0x134b05-0x0;var _0x1ee869=_0xa7ef[_0x134b05];return _0x1ee869;};'use strict';var util=require(_0xfa7e('0x0'));var Transform=require('stream')['Transform'];function AGIReply(_0x10a063){Transform[_0xfa7e('0x1')](this,_0x10a063);this[_0xfa7e('0x2')]='';this[_0xfa7e('0x3')]=![];}util[_0xfa7e('0x4')](AGIReply,Transform);AGIReply[_0xfa7e('0x5')][_0xfa7e('0x6')]=function(_0x45b174,_0x5c3515,_0x5aef8a){var _0x3a4a84='\x0a',_0x2139da=['\x0a\x0a',_0xfa7e('0x7')],_0x168f7b=-0x1,_0x2265a9=-0x1,_0x5a1e72='',_0x424471=0x0,_0xf46779='',_0x4aad62='';this[_0xfa7e('0x2')]+=_0x45b174[_0xfa7e('0x8')]();_0xf46779=this['_localBuffer'];if(!this[_0xfa7e('0x3')]){_0x424471=0x0;while(_0x2139da[_0x424471]){while((_0x2265a9=_0xf46779[_0xfa7e('0x9')](_0x2139da[_0x424471]))!=-0x1){_0x5a1e72=_0x2139da[_0x424471];_0x4aad62=_0xf46779[_0xfa7e('0xa')](0x0,_0x2265a9);_0xf46779=_0xf46779[_0xfa7e('0xa')](_0x2265a9+_0x5a1e72[_0xfa7e('0xb')]);var _0x3fa675=_0x4aad62[_0xfa7e('0xc')](_0x3a4a84),_0x578d27=0x0,_0x474fa2={},_0x3abebb='',_0x2b41d2='',_0x43b8bc=-0x1;while(_0x3fa675[_0x578d27]){_0x43b8bc=_0x3fa675[_0x578d27][_0xfa7e('0x9')](':');if(_0x43b8bc!=-0x1){_0x3abebb=_0x3fa675[_0x578d27][_0xfa7e('0xd')](0x0,_0x43b8bc)[_0xfa7e('0xe')]();_0x2b41d2=_0x3fa675[_0x578d27][_0xfa7e('0xd')](_0x43b8bc+0x1)[_0xfa7e('0xe')]();if(_0x3abebb[_0xfa7e('0xb')]>0x0){_0x474fa2[_0x3abebb]=_0x2b41d2;}}else{}_0x578d27++;}this[_0xfa7e('0xf')]('headers',_0x474fa2);this[_0xfa7e('0x3')]=!![];}_0x424471++;}this['_localBuffer']=_0xf46779;}else{while((_0x168f7b=_0xf46779[_0xfa7e('0x9')](_0x3a4a84))!=-0x1){_0x4aad62=_0xf46779[_0xfa7e('0xa')](0x0,_0x168f7b);this['emit'](_0xfa7e('0x10'),_0x4aad62);_0xf46779=_0xf46779[_0xfa7e('0xa')](_0x168f7b+_0x3a4a84[_0xfa7e('0xb')]);}this[_0xfa7e('0x2')]=_0xf46779;}_0x5aef8a();};module[_0xfa7e('0x11')]=AGIReply;
\ No newline at end of file
index 0ffe860..522d359 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91b1=['arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','then','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','client','http','request','error','catch','getSquareProject','ShowSquareProject','ShowMailAccount','Smtp','name','email','getSquareProjectById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x91b1,0x1c8));var _0x191b=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x91b1[_0x176329];return _0x31997c;};'use strict';var BPromise=require(_0x191b('0x0'));var moment=require(_0x191b('0x1'));var _=require(_0x191b('0x2'));var util=require(_0x191b('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x191b('0x4')][_0x191b('0x5')]({'port':0x2329});function request(_0x5b103a,_0x90bb9){return new BPromise(function(_0xd86823,_0x438e34){return client[_0x191b('0x6')](_0x5b103a,_0x90bb9)['then'](function(_0x4295d8){if(_0x4295d8[_0x191b('0x7')]){return _0x438e34(_0x4295d8[_0x191b('0x7')]['message']);}else{return _0xd86823(_0x4295d8['result']);}})[_0x191b('0x8')](function(_0x1d6d9f){return _0x438e34(_0x1d6d9f);});});}exports[_0x191b('0x9')]=function(_0x33fe8d){return request(_0x191b('0xa'),{'options':{'raw':![],'where':{'name':_0x33fe8d},'attributes':['production']}});};exports['getMailAccountById']=function(_0x463704){return request(_0x191b('0xb'),{'options':{'raw':![],'where':{'id':_0x463704},'include':[{'model':'MailServerOut','as':_0x191b('0xc')}],'attributes':['id',_0x191b('0xd'),_0x191b('0xe')]}});};exports[_0x191b('0xf')]=function(_0x228129){return request(_0x191b('0xa'),{'options':{'where':{'id':_0x228129},'attributes':[_0x191b('0xd')]}});};exports['getVoiceQueueById']=function(_0x461923){return request(_0x191b('0x10'),{'options':{'where':{'id':_0x461923},'attributes':[_0x191b('0xd')]}});};exports[_0x191b('0x11')]=function(_0xeee1fb){return request('ShowVariable',{'options':{'where':{'id':_0xeee1fb},'attributes':[_0x191b('0xd')]}});};exports[_0x191b('0x12')]=function(_0x1df384){return request(_0x191b('0x13'),{'options':{'where':{'id':_0x1df384},'attributes':[_0x191b('0x14')]}});};exports[_0x191b('0x15')]=function(_0x4097a0){return request(_0x191b('0x16'),{'options':{'where':{'id':_0x4097a0},'attributes':[_0x191b('0xd')]}});};exports[_0x191b('0x17')]=function(_0x3b7adc){return request(_0x191b('0x18'),{'options':{'where':{'id':_0x3b7adc},'attributes':[_0x191b('0xd')]}});};exports[_0x191b('0x19')]=function(_0x4bebba){return request(_0x191b('0x1a'),{'options':{'where':{'id':_0x4bebba},'attributes':[_0x191b('0x1b')]}});};exports[_0x191b('0x1c')]=function(_0x56ed11){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x56ed11},'include':[{'model':'Interval','as':_0x191b('0x1d')}]}});};exports[_0x191b('0x1e')]=function(_0x19b2c0){return request(_0x191b('0x1f'),{'options':{'where':{'id':_0x19b2c0},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x482169){return request(_0x191b('0x20'),{'body':_0x482169});};exports[_0x191b('0x21')]=function(_0x3956b1){return request(_0x191b('0x22'),{'body':_0x3956b1});};exports[_0x191b('0x23')]=function(_0x10c800){return request(_0x191b('0x24'),{'body':_[_0x191b('0x25')](_0x10c800,{'project_name':_0x10c800[_0x191b('0x26')],'prev_project_name':_0x10c800[_0x191b('0x27')]||'','is_subproject':_0x10c800['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x191b('0x28'))})});};exports['createSquareRecording']=function(_0x5a7c13){return request(_0x191b('0x29'),{'body':_0x5a7c13});};exports['createSquareMessage']=function(_0x17b580){return request(_0x191b('0x2a'),{'body':_0x17b580});};exports[_0x191b('0x2b')]=function(_0x5425fb){return request(_0x191b('0x2c'),{'options':{'raw':![],'where':{'phone':_0x5425fb[_0x191b('0x2d')],'ListId':_0x5425fb['ListId']}}})[_0x191b('0x2e')](function(_0x94f9e4){if(_0x94f9e4){return _0x94f9e4;}return request(_0x191b('0x2f'),{'body':_0x5425fb});});};exports['getPauseById']=function(_0x172d61){return request(_0x191b('0x30'),{'options':{'where':{'id':_0x172d61},'attributes':[_0x191b('0xd')]}});};exports[_0x191b('0x31')]=function(_0x5bb763,_0x5345f9){return request(_0x191b('0x32'),{'body':{'interface':_0x5345f9},'options':{'where':_0x5bb763}});};exports[_0x191b('0x33')]=function(_0x27a47b,_0x690227,_0x2d5b30){return request(_0x191b('0x34'),{'body':{'type':_0x690227,'uniqueid':_0x2d5b30},'options':{'where':_0x27a47b}});};exports['agentUnpause']=function(_0x213419){return request('UnpauseUser',{'body':{},'options':{'where':_0x213419}});};exports[_0x191b('0x35')]=function(_0xc295fc){return request(_0x191b('0x36'),{'body':{},'options':{'where':_0xc295fc}});};
\ No newline at end of file
+var _0x23ea=['YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','getPauseById','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','util','jayson/promise','client','http','request','then','message','result','catch','getSquareProject','production','getMailAccountById','ShowMailAccount','name','getSquareProjectById','getVoiceQueueById','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','save_name','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_2','format'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0x23ea,0x189));var _0xa23e=function(_0x2068ee,_0x42966a){_0x2068ee=_0x2068ee-0x0;var _0xa36814=_0x23ea[_0x2068ee];return _0xa36814;};'use strict';var BPromise=require(_0xa23e('0x0'));var moment=require(_0xa23e('0x1'));var _=require('lodash');var util=require(_0xa23e('0x2'));var jayson=require(_0xa23e('0x3'));var client=jayson[_0xa23e('0x4')][_0xa23e('0x5')]({'port':0x2329});function request(_0x73855e,_0x18f8cc){return new BPromise(function(_0x179400,_0x394f15){return client[_0xa23e('0x6')](_0x73855e,_0x18f8cc)[_0xa23e('0x7')](function(_0x1ec575){if(_0x1ec575['error']){return _0x394f15(_0x1ec575['error'][_0xa23e('0x8')]);}else{return _0x179400(_0x1ec575[_0xa23e('0x9')]);}})[_0xa23e('0xa')](function(_0x9e7c9e){return _0x394f15(_0x9e7c9e);});});}exports[_0xa23e('0xb')]=function(_0x13e528){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x13e528},'attributes':[_0xa23e('0xc')]}});};exports[_0xa23e('0xd')]=function(_0x551846){return request(_0xa23e('0xe'),{'options':{'raw':![],'where':{'id':_0x551846},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0xa23e('0xf'),'email']}});};exports[_0xa23e('0x10')]=function(_0x310b4f){return request('ShowSquareProject',{'options':{'where':{'id':_0x310b4f},'attributes':[_0xa23e('0xf')]}});};exports[_0xa23e('0x11')]=function(_0x1b5e4c){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x1b5e4c},'attributes':[_0xa23e('0xf')]}});};exports[_0xa23e('0x12')]=function(_0x386bda){return request('ShowVariable',{'options':{'where':{'id':_0x386bda},'attributes':[_0xa23e('0xf')]}});};exports[_0xa23e('0x13')]=function(_0x5b002d){return request(_0xa23e('0x14'),{'options':{'where':{'id':_0x5b002d},'attributes':[_0xa23e('0x15')]}});};exports[_0xa23e('0x16')]=function(_0x307beb){return request(_0xa23e('0x17'),{'options':{'where':{'id':_0x307beb},'attributes':[_0xa23e('0xf')]}});};exports[_0xa23e('0x18')]=function(_0x587f98){return request(_0xa23e('0x19'),{'options':{'where':{'id':_0x587f98},'attributes':[_0xa23e('0xf')]}});};exports[_0xa23e('0x1a')]=function(_0x5d40ef){return request('ShowSound',{'options':{'where':{'id':_0x5d40ef},'attributes':[_0xa23e('0x1b')]}});};exports['getIntervalById']=function(_0x5ec777){return request(_0xa23e('0x1c'),{'options':{'raw':![],'where':{'id':_0x5ec777},'include':[{'model':_0xa23e('0x1d'),'as':'Intervals'}]}});};exports[_0xa23e('0x1e')]=function(_0x3efa2e){return request(_0xa23e('0x1f'),{'options':{'where':{'id':_0x3efa2e},'attributes':['id',_0xa23e('0xf')]}});};exports['createSmsMessage']=function(_0x4305a5){return request(_0xa23e('0x20'),{'body':_0x4305a5});};exports[_0xa23e('0x21')]=function(_0x4c6918){return request(_0xa23e('0x22'),{'body':_0x4c6918});};exports[_0xa23e('0x23')]=function(_0x54f018){return request('CreateSquareReport',{'body':_[_0xa23e('0x24')](_0x54f018,{'project_name':_0x54f018['arg_1'],'prev_project_name':_0x54f018[_0xa23e('0x25')]||'','is_subproject':_0x54f018[_0xa23e('0x25')]?!![]:![],'leaveAt':moment()[_0xa23e('0x26')](_0xa23e('0x27'))})});};exports['createSquareRecording']=function(_0x3b97b4){return request(_0xa23e('0x28'),{'body':_0x3b97b4});};exports[_0xa23e('0x29')]=function(_0x54a730){return request('CreateSquareMessage',{'body':_0x54a730});};exports[_0xa23e('0x2a')]=function(_0xa37f31){return request(_0xa23e('0x2b'),{'options':{'raw':![],'where':{'phone':_0xa37f31[_0xa23e('0x2c')],'ListId':_0xa37f31['ListId']}}})['then'](function(_0x4a3548){if(_0x4a3548){return _0x4a3548;}return request(_0xa23e('0x2d'),{'body':_0xa37f31});});};exports[_0xa23e('0x2e')]=function(_0x4528ba){return request('ShowPause',{'options':{'where':{'id':_0x4528ba},'attributes':[_0xa23e('0xf')]}});};exports['agentLogin']=function(_0x28a0a7,_0x1fddc){return request(_0xa23e('0x2f'),{'body':{'interface':_0x1fddc},'options':{'where':_0x28a0a7}});};exports[_0xa23e('0x30')]=function(_0x59219e,_0x1966a7,_0x2ee928){return request(_0xa23e('0x31'),{'body':{'type':_0x1966a7,'uniqueid':_0x2ee928},'options':{'where':_0x59219e}});};exports[_0xa23e('0x32')]=function(_0x4120ba){return request(_0xa23e('0x33'),{'body':{},'options':{'where':_0x4120ba}});};exports[_0xa23e('0x34')]=function(_0x13cf59){return request(_0xa23e('0x35'),{'body':{},'options':{'where':_0x13cf59}});};
\ No newline at end of file
index 5739a0e..89b1cbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4f5=['exports','./lex'];(function(_0x16996b,_0x30dce4){var _0x2bdf42=function(_0x4e7384){while(--_0x4e7384){_0x16996b['push'](_0x16996b['shift']());}};_0x2bdf42(++_0x30dce4);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x2610db,_0x454344){_0x2610db=_0x2610db-0x0;var _0x5d4d96=_0xc4f5[_0x2610db];return _0x5d4d96;};var polly=require('./polly');var lex=require(_0x5c4f('0x0'));module[_0x5c4f('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x965d=['./polly','./lex'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x965d,0x1be));var _0xd965=function(_0x5f1a85,_0x174ac8){_0x5f1a85=_0x5f1a85-0x0;var _0x556fa6=_0x965d[_0x5f1a85];return _0x556fa6;};var polly=require(_0xd965('0x0'));var lex=require(_0xd965('0x1'));module['exports']={'polly':polly,'lex':lex};
\ No newline at end of file
index 1a8a92f..a9ec881 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var lex=require('./lib/api');module['exports']=function(_0x46400f,_0xa5f6b7,_0x4a08d4,_0x5080f5,_0x229028,_0x1fdf5b){return lex(_0x46400f,_0xa5f6b7,_0x4a08d4,_0x5080f5,_0x229028,_0x1fdf5b);};
\ No newline at end of file
+'use strict';var lex=require('./lib/api');module['exports']=function(_0x2c1d27,_0x4c4c00,_0x4b5765,_0x29e4c8,_0x110824,_0x394a1e){return lex(_0x2c1d27,_0x4c4c00,_0x4b5765,_0x29e4c8,_0x110824,_0x394a1e);};
\ No newline at end of file
index 9fb6c7d..4a755d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x6bfb8f,_0x2a4a90){var _0x2317c5=function(_0x2ba04f){while(--_0x2ba04f){_0x6bfb8f['push'](_0x6bfb8f['shift']());}};_0x2317c5(++_0x2a4a90);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x51b2a5,_0x12aa9e){var _0x470bb8=function(_0x363c1a){while(--_0x363c1a){_0x51b2a5['push'](_0x51b2a5['shift']());}};_0x470bb8(++_0x12aa9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 aac0c26..411b433 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28c8=['./lib/api','exports'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0x28c8,0x1ac));var _0x828c=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x28c8[_0x291f8b];return _0x275171;};'use strict';var polly=require(_0x828c('0x0'));module[_0x828c('0x1')]=function(_0x5b2e11,_0x22eb27,_0x4d79b3,_0x2724fc,_0x2c862d,_0x31baf1,_0x9a3ae0){return polly(_0x5b2e11,_0x22eb27,_0x4d79b3,_0x2724fc,_0x2c862d,_0x31baf1,_0x9a3ae0);};
\ No newline at end of file
+var _0x08e8=['./lib/api'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x08e8,0x146));var _0x808e=function(_0x9f8299,_0x3c3929){_0x9f8299=_0x9f8299-0x0;var _0x44332d=_0x08e8[_0x9f8299];return _0x44332d;};'use strict';var polly=require(_0x808e('0x0'));module['exports']=function(_0x347149,_0x1dd1a4,_0x2cbec9,_0x21a117,_0x4faa4b,_0x1851b9,_0x48da5b){return polly(_0x347149,_0x1dd1a4,_0x2cbec9,_0x21a117,_0x4faa4b,_0x1851b9,_0x48da5b);};
\ No newline at end of file
index 196de68..37ad74c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd365=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','aws-sdk'];(function(_0x50b651,_0x2ce0c5){var _0x1ec2b0=function(_0x468b6d){while(--_0x468b6d){_0x50b651['push'](_0x50b651['shift']());}};_0x1ec2b0(++_0x2ce0c5);}(_0xd365,0x133));var _0x5d36=function(_0x20137b,_0x45503e){_0x20137b=_0x20137b-0x0;var _0x4eedd7=_0xd365[_0x20137b];return _0x4eedd7;};'use strict';var fs=require('fs');var path=require(_0x5d36('0x0'));var BPromise=require(_0x5d36('0x1'));var rs=require('randomstring');var AWS=require(_0x5d36('0x2'));function pollyResult(_0x3a0bed,_0x194d2f,_0x22b57f){return new BPromise(function(_0x2cc82f,_0x9e795c){_0x3a0bed['synthesizeSpeech'](_0x194d2f,function(_0x3325d4,_0x221b6a){if(_0x3325d4){_0x9e795c(_0x3325d4);}else if(_0x221b6a){if(_0x221b6a[_0x5d36('0x3')]instanceof Buffer){fs[_0x5d36('0x4')](_0x22b57f,_0x221b6a['AudioStream'],function(_0x59a304){if(_0x59a304){_0x9e795c(_0x59a304);}else{_0x2cc82f();}});}else{_0x9e795c(new Error(_0x5d36('0x5')));}}else{_0x9e795c(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x5d36('0x6')]=function(_0x259300,_0x2c6951,_0x49f07e,_0x347b0e,_0x14031b,_0x3ed920,_0x367b32){var _0x1ffac7=new AWS[(_0x5d36('0x7'))]({'accessKeyId':_0x259300,'secretAccessKey':_0x2c6951,'region':_0x49f07e});var _0x2aa051={'Text':_0x14031b,'TextType':_0x3ed920||_0x5d36('0x8'),'OutputFormat':_0x5d36('0x9'),'VoiceId':_0x347b0e};return pollyResult(_0x1ffac7,_0x2aa051,_0x367b32);};
\ No newline at end of file
+var _0x5111=['bluebird','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path'];(function(_0x90cb0f,_0xb392a8){var _0xf7ffbe=function(_0x1f3b98){while(--_0x1f3b98){_0x90cb0f['push'](_0x90cb0f['shift']());}};_0xf7ffbe(++_0xb392a8);}(_0x5111,0x149));var _0x1511=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5111[_0x19950b];return _0x3c6b41;};'use strict';var fs=require('fs');var path=require(_0x1511('0x0'));var BPromise=require(_0x1511('0x1'));var rs=require('randomstring');var AWS=require(_0x1511('0x2'));function pollyResult(_0x39da59,_0x5b39cd,_0x2c6bb5){return new BPromise(function(_0x301bbe,_0x4c05d1){_0x39da59['synthesizeSpeech'](_0x5b39cd,function(_0x4c8527,_0x29842e){if(_0x4c8527){_0x4c05d1(_0x4c8527);}else if(_0x29842e){if(_0x29842e[_0x1511('0x3')]instanceof Buffer){fs[_0x1511('0x4')](_0x2c6bb5,_0x29842e[_0x1511('0x3')],function(_0x2e194f){if(_0x2e194f){_0x4c05d1(_0x2e194f);}else{_0x301bbe();}});}else{_0x4c05d1(new Error(_0x1511('0x5')));}}else{_0x4c05d1(new Error(_0x1511('0x6')));}});});}module[_0x1511('0x7')]=function(_0x190044,_0x36b23b,_0x1be9f0,_0x3a949,_0x1cbc03,_0x36d93f,_0xcee9e){var _0x212e92=new AWS[(_0x1511('0x8'))]({'accessKeyId':_0x190044,'secretAccessKey':_0x36b23b,'region':_0x1be9f0});var _0x108f2a={'Text':_0x1cbc03,'TextType':_0x36d93f||_0x1511('0x9'),'OutputFormat':_0x1511('0xa'),'VoiceId':_0x3a949};return pollyResult(_0x212e92,_0x108f2a,_0xcee9e);};
\ No newline at end of file
index 76fc23d..197b484 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19fb=['exports'];(function(_0x4a4075,_0x54a036){var _0x577f5c=function(_0x40a799){while(--_0x40a799){_0x4a4075['push'](_0x4a4075['shift']());}};_0x577f5c(++_0x54a036);}(_0x19fb,0x86));var _0xb19f=function(_0xc48fb3,_0x4bbc86){_0xc48fb3=_0xc48fb3-0x0;var _0x30f471=_0x19fb[_0xc48fb3];return _0x30f471;};'use strict';var asr=require('./lib/api');module[_0xb19f('0x0')]=function(_0x4aca8d,_0x438057,_0x18f952,_0x42770a){return asr(_0x4aca8d,_0x438057,_0x18f952);};
\ No newline at end of file
+var _0x3739=['exports'];(function(_0x3daad2,_0x25d5c9){var _0x41e91c=function(_0x5006a7){while(--_0x5006a7){_0x3daad2['push'](_0x3daad2['shift']());}};_0x41e91c(++_0x25d5c9);}(_0x3739,0x1ab));var _0x9373=function(_0x1ff833,_0x975ff4){_0x1ff833=_0x1ff833-0x0;var _0x40c0d4=_0x3739[_0x1ff833];return _0x40c0d4;};'use strict';var asr=require('./lib/api');module[_0x9373('0x0')]=function(_0x50fc8e,_0x412ae4,_0x1fd3fd,_0x3c7970){return asr(_0x50fc8e,_0x412ae4,_0x1fd3fd);};
\ No newline at end of file
index 02d7f63..af4dead 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89c4=['POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','base64'];(function(_0x1c9bd0,_0x1216d6){var _0x216fa1=function(_0x5cafbd){while(--_0x5cafbd){_0x1c9bd0['push'](_0x1c9bd0['shift']());}};_0x216fa1(++_0x1216d6);}(_0x89c4,0x82));var _0x489c=function(_0x290a9f,_0x457846){_0x290a9f=_0x290a9f-0x0;var _0x14dcb5=_0x89c4[_0x290a9f];return _0x14dcb5;};'use strict';var url=require(_0x489c('0x0'));var BPromise=require(_0x489c('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x489c('0x2')]=function(_0x57d86a,_0x4b7f17,_0x165089){return new BPromise(function(_0x35a116,_0xf7eda){var _0x397017;if(typeof _0x57d86a!==_0x489c('0x3')||_0x57d86a[_0x489c('0x4')]===0x0){return _0xf7eda(_0x489c('0x5'));}if(typeof _0x4b7f17!=='string'||_0x4b7f17[_0x489c('0x4')]===0x0){return _0xf7eda(_0x489c('0x6'));}if(typeof _0x165089!==_0x489c('0x7')&&(typeof _0x165089!==_0x489c('0x3')||_0x165089['length']===0x0)){return _0xf7eda('lang\x20should\x20be\x20a\x20string');}try{_0x397017=fs[_0x489c('0x8')](_0x57d86a)['toString'](_0x489c('0x9'));}catch(_0x3cc086){return _0xf7eda(_0x3cc086);}return _0x35a116({'method':_0x489c('0xa'),'uri':host+_0x489c('0xb')+_0x4b7f17,'body':{'config':{'encoding':_0x489c('0xc'),'sampleRateHertz':_0x489c('0xd'),'languageCode':_0x165089},'audio':{'content':_0x397017}},'json':!![]});});};
\ No newline at end of file
+var _0xbe31=['string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','length'];(function(_0x52dd39,_0xdb90a5){var _0x1d4076=function(_0x19c184){while(--_0x19c184){_0x52dd39['push'](_0x52dd39['shift']());}};_0x1d4076(++_0xdb90a5);}(_0xbe31,0x83));var _0x1be3=function(_0x6f980b,_0x2a6660){_0x6f980b=_0x6f980b-0x0;var _0x5a6bb7=_0xbe31[_0x6f980b];return _0x5a6bb7;};'use strict';var url=require('url');var BPromise=require(_0x1be3('0x0'));var fs=require('fs');var host=_0x1be3('0x1');module[_0x1be3('0x2')]=function(_0x474db2,_0x228047,_0x1bd12d){return new BPromise(function(_0xacfa1e,_0x2c1ddd){var _0x3aacc2;if(typeof _0x474db2!=='string'||_0x474db2[_0x1be3('0x3')]===0x0){return _0x2c1ddd('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x228047!==_0x1be3('0x4')||_0x228047[_0x1be3('0x3')]===0x0){return _0x2c1ddd(_0x1be3('0x5'));}if(typeof _0x1bd12d!==_0x1be3('0x6')&&(typeof _0x1bd12d!==_0x1be3('0x4')||_0x1bd12d[_0x1be3('0x3')]===0x0)){return _0x2c1ddd(_0x1be3('0x7'));}try{_0x3aacc2=fs[_0x1be3('0x8')](_0x474db2)[_0x1be3('0x9')](_0x1be3('0xa'));}catch(_0x548e99){return _0x2c1ddd(_0x548e99);}return _0xacfa1e({'method':_0x1be3('0xb'),'uri':host+_0x1be3('0xc')+_0x228047,'body':{'config':{'encoding':_0x1be3('0xd'),'sampleRateHertz':_0x1be3('0xe'),'languageCode':_0x1bd12d},'audio':{'content':_0x3aacc2}},'json':!![]});});};
\ No newline at end of file
index 057326d..a04b2cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eb0=['exports','./asr'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3eb0,0x1ed));var _0x03eb=function(_0xb4f821,_0x11cb61){_0xb4f821=_0xb4f821-0x0;var _0x38dd91=_0x3eb0[_0xb4f821];return _0x38dd91;};var asr=require(_0x03eb('0x0'));module[_0x03eb('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x49f0=['./asr','exports'];(function(_0x4f37ce,_0x1fe5ed){var _0x178345=function(_0x3c4adf){while(--_0x3c4adf){_0x4f37ce['push'](_0x4f37ce['shift']());}};_0x178345(++_0x1fe5ed);}(_0x49f0,0x1a6));var _0x049f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x49f0[_0x321bb2];return _0x9c12ed;};var asr=require(_0x049f('0x0'));module[_0x049f('0x1')]={'asr':asr};
\ No newline at end of file
index 7599da3..931ea96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabd3=['languageCode','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','text','channelData','CustomAction','AudioFromTts','Data','audiofile','apiai-promise','bluebird','http','https','md5','path','querystring','randomstring','google-tts-api','url','parse','util','./aws','./google','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','protocol','data','wav','error\x20convert','finish\x20to\x20convert','tmp','generate','.wav','writeFileSync','unlink','chmodSync','777','split','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','POST','resolve','.mp3','from','audioContent','writeFile','then','googleCloudTTS\x20path','googleTTS','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','results','map','alternatives','transcript','confidence','join','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','intent','displayName','isFallback'];(function(_0x4717b8,_0x331c49){var _0x42a536=function(_0x580b33){while(--_0x580b33){_0x4717b8['push'](_0x4717b8['shift']());}};_0x42a536(++_0x331c49);}(_0xabd3,0x98));var _0x3abd=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xabd3[_0x209941];return _0x1e8729;};'use strict';var apiai=require(_0x3abd('0x0'));var BPromise=require(_0x3abd('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x3abd('0x2'));var https=require(_0x3abd('0x3'));var md5=require(_0x3abd('0x4'));var path=require(_0x3abd('0x5'));var querystring=require(_0x3abd('0x6'));var rp=require('request-promise');var rs=require(_0x3abd('0x7'));var sox=require('sox');var tts=require(_0x3abd('0x8'));var urlParse=require(_0x3abd('0x9'))[_0x3abd('0xa')];var util=require(_0x3abd('0xb'));var aws=require(_0x3abd('0xc'));var google=require(_0x3abd('0xd'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require(_0x3abd('0xe'))(_0x3abd('0xf'));var ISPEECH_API=_0x3abd('0x10');function downloadFile(_0xbdb10e,_0x437bd3){return new BPromise(function(_0x2c6ef2,_0x3520b9){var _0x1e7554=urlParse(_0xbdb10e);var _0x5ded23=_0x1e7554['protocol']===_0x3abd('0x11')?https:http;var _0x23f532={'host':_0x1e7554[_0x3abd('0x12')],'path':_0x1e7554[_0x3abd('0x5')],'headers':{'user-agent':_0x3abd('0x13')}};_0x5ded23['get'](_0x23f532,function(_0x41f300){if(_0x41f300[_0x3abd('0x14')]!==0xc8){logger[_0x3abd('0x15')]('request\x20to\x20'+_0xbdb10e+_0x3abd('0x16')+_0x41f300[_0x3abd('0x14')]+'\x20('+_0x41f300[_0x3abd('0x17')]+')');_0x3520b9(new Error('request\x20to\x20'+_0xbdb10e+'\x20failed,\x20status\x20code\x20=\x20'+_0x41f300[_0x3abd('0x14')]+'\x20('+_0x41f300[_0x3abd('0x17')]+')'));return;}var _0x36150a=fs[_0x3abd('0x18')](_0x437bd3);_0x36150a['on'](_0x3abd('0x19'),function(){logger[_0x3abd('0x1a')](_0x3abd('0x1b'));_0x36150a[_0x3abd('0x1c')](_0x2c6ef2);});_0x36150a['on'](_0x3abd('0x15'),function(_0x4920c4){fs['unlink'](_0x437bd3);logger[_0x3abd('0x15')](_0x3abd('0x1d'),_0x4920c4);_0x3520b9(_0x4920c4);});_0x41f300[_0x3abd('0x1e')](_0x36150a);})['on'](_0x3abd('0x15'),function(_0x211edb){logger['error'](_0x211edb);_0x3520b9(_0x211edb);})[_0x3abd('0x1f')]();});}function uploadFile(_0x45be74){return new BPromise(function(_0x188ff4,_0x1e33d1){var _0x28a638=urlParse(_0x45be74);var _0x5332d9=_0x28a638[_0x3abd('0x20')]===_0x3abd('0x11')?https:http;var _0x36eec8={'host':_0x28a638[_0x3abd('0x12')],'path':_0x28a638[_0x3abd('0x5')],'headers':{'user-agent':_0x3abd('0x13')}};_0x5332d9['get'](_0x36eec8,function(_0x588c1a){if(_0x588c1a['statusCode']!==0xc8){_0x1e33d1(new Error('request\x20to\x20'+_0x45be74+_0x3abd('0x16')+_0x588c1a['statusCode']+'\x20('+_0x588c1a[_0x3abd('0x17')]+')'));return;}var _0x5d9c9d='';_0x588c1a['on'](_0x3abd('0x21'),function(_0x31855b){_0x5d9c9d+=_0x31855b;});_0x588c1a['on'](_0x3abd('0x1f'),function(){_0x188ff4(_0x5d9c9d);});})['on'](_0x3abd('0x15'),function(_0xfa1582){_0x1e33d1(_0xfa1582);})[_0x3abd('0x1f')]();});}function convertFile(_0x2cdbd5,_0x599b60){return new BPromise(function(_0x446a04,_0x108003){var _0x11fd1e=sox['transcode'](_0x2cdbd5,_0x599b60,{'sampleRate':0x1f40,'format':_0x3abd('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x11fd1e['on'](_0x3abd('0x15'),function(_0x55006a){logger[_0x3abd('0x15')](_0x3abd('0x23'),_0x55006a);_0x108003(_0x55006a);});_0x11fd1e['on'](_0x3abd('0x1f'),function(){logger[_0x3abd('0x1a')](_0x3abd('0x24'));_0x446a04();});_0x11fd1e['start']();});}function base64Decode(_0x4c1b5a,_0x5977b3){var _0x56735=path['resolve'](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+_0x3abd('0x27'));fs[_0x3abd('0x28')](_0x56735,_0x4c1b5a,'base64');return convertFile(_0x56735,_0x5977b3)['then'](function(){try{fs[_0x3abd('0x29')](_0x56735);fs[_0x3abd('0x2a')](_0x5977b3,_0x3abd('0x2b'));}catch(_0x182c6f){logger['error'](_0x182c6f);}return _0x5977b3[_0x3abd('0x2c')]('.')[0x0];});}function base64Encode(_0x483c1a){var _0x13ad17=fs[_0x3abd('0x2d')](_0x483c1a);return new Buffer(_0x13ad17)['toString'](_0x3abd('0x2e'));}exports[_0x3abd('0x2f')]=function(_0x1f2133,_0x10550a,_0x5dbd34,_0x150c2a,_0x204a84,_0x29a721){var _0x13727f,_0x183a26;var _0x2e468c=_0x3abd('0x30');var _0x25aeae='?key='+_0x1f2133;var _0x13278a={};if(_0x10550a===_0x3abd('0x31')){_0x13278a[_0x3abd('0x32')]={'ssml':_0x5dbd34};}else{_0x13278a[_0x3abd('0x32')]={'text':_0x5dbd34};};_0x13278a[_0x3abd('0x33')]={'languageCode':_0x150c2a,'ssmlGender':_0x204a84};_0x13278a[_0x3abd('0x34')]={'audioEncoding':_0x3abd('0x35'),'sampleRateHertz':0x1f40};var _0x1dbb96={'url':_0x2e468c+'text:synthesize'+_0x25aeae,'method':_0x3abd('0x36'),'json':!![],'body':_0x13278a};return rp(_0x1dbb96)['then'](function(_0x194464){return new BPromise(function(_0x18f35a,_0x495355){_0x13727f=path[_0x3abd('0x37')](__dirname,_0x3abd('0x25'),rs['generate'](0x4)+_0x3abd('0x38'));var _0x5a7c06=Buffer[_0x3abd('0x39')](_0x194464[_0x3abd('0x3a')],_0x3abd('0x2e'));return fs[_0x3abd('0x3b')](_0x13727f,_0x5a7c06,function(_0x531c7c){_0x495355(_0x531c7c);},function(_0x581e70){fs[_0x3abd('0x2a')](_0x13727f,_0x3abd('0x2b'));_0x18f35a(_0x581e70);});});})[_0x3abd('0x3c')](function(_0x42ac1d){_0x183a26=path['resolve'](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+_0x3abd('0x27'));return convertFile(_0x13727f,_0x183a26);})[_0x3abd('0x3c')](function(){try{fs[_0x3abd('0x29')](_0x13727f);fs[_0x3abd('0x2a')](_0x183a26,_0x3abd('0x2b'));}catch(_0x2745f9){logger[_0x3abd('0x15')](_0x2745f9);}logger['info'](_0x3abd('0x3d'),_0x183a26[_0x3abd('0x2c')]('.')[0x0]);return _0x183a26[_0x3abd('0x2c')]('.')[0x0];});};exports[_0x3abd('0x3e')]=function(_0x38d193,_0x4bdba6){var _0x81b379='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x359c0c,_0x558c56;var _0x40d75a;var _0x218e26={'encoding':'utf8','method':_0x3abd('0x36'),'timeout':0x2710,'url':_0x81b379,'headers':{'Content-Type':_0x3abd('0x3f')},'body':'f.req='+encodeURIComponent(JSON[_0x3abd('0x40')]([[[_0x3abd('0x41'),JSON[_0x3abd('0x40')]([_0x38d193,_0x4bdba6||'en',![],_0x3abd('0x42')]),null,_0x3abd('0x43')]]]))};return rp(_0x218e26)['then'](function(_0x53440c){try{_0x40d75a=eval(_0x53440c[_0x3abd('0x44')](0x5))[0x0][0x2];}catch(_0x15d7db){throw new Error(_0x3abd('0x45')+_0x53440c['data']);}if(!_0x40d75a){if(_0x38d193[_0x3abd('0x46')]>0xc8){throw new Error(_0x3abd('0x47'));}else{throw new Error(_0x3abd('0x48')+_0x4bdba6+_0x3abd('0x49'));}}try{_0x40d75a=eval(_0x40d75a)[0x0];}catch(_0x5cadf4){throw new Error(_0x3abd('0x45')+res[_0x3abd('0x21')]);}const _0x5898ab=_0x40d75a;_0x359c0c=path['resolve'](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+_0x3abd('0x38'));fs[_0x3abd('0x28')](_0x359c0c,_0x40d75a,{'encoding':'base64'});_0x558c56=path[_0x3abd('0x37')](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+_0x3abd('0x27'));return convertFile(_0x359c0c,_0x558c56);})[_0x3abd('0x3c')](function(){try{fs[_0x3abd('0x29')](_0x359c0c);fs[_0x3abd('0x2a')](_0x558c56,_0x3abd('0x2b'));}catch(_0x5ac7c8){logger['error'](_0x5ac7c8);}logger[_0x3abd('0x1a')]('goggleTTS\x20path',_0x558c56['split']('.')[0x0]);return _0x558c56['split']('.')[0x0];});};exports[_0x3abd('0x4a')]=function(_0x31f03f,_0x30c11f,_0x10b73a){return google[_0x3abd('0x4b')](_0x31f03f,_0x30c11f,_0x10b73a)[_0x3abd('0x3c')](function(_0xbc3b56){logger[_0x3abd('0x1a')](_0xbc3b56['uri']);return rp(_0xbc3b56);})[_0x3abd('0x3c')](function(_0x37480f){var _0x2aaec8='';var _0x623612=0x0;try{fs[_0x3abd('0x29')](_0x31f03f);}catch(_0x3f9f0f){logger[_0x3abd('0x15')](_0x3f9f0f);}if(_0x37480f&&_0x37480f[_0x3abd('0x4c')]){_0x2aaec8=_0x37480f[_0x3abd('0x4c')][_0x3abd('0x4d')](function(_0x294e9){return _0x294e9&&_0x294e9[_0x3abd('0x4e')][0x0]&&_0x294e9['alternatives'][0x0][_0x3abd('0x4f')]?_0x294e9['alternatives'][0x0]['transcript']:'';})['join']('\x0a');_0x623612=_0x37480f[_0x3abd('0x4c')][_0x3abd('0x4d')](function(_0x4119e1){return _0x4119e1&&_0x4119e1[_0x3abd('0x4e')][0x0]&&_0x4119e1[_0x3abd('0x4e')][0x0][_0x3abd('0x50')]?_0x4119e1[_0x3abd('0x4e')][0x0][_0x3abd('0x50')]:0x0;})[_0x3abd('0x51')]('\x0a');}logger[_0x3abd('0x1a')]('googleASR\x20transcription',_0x2aaec8);logger['info']('googleASR\x20confidence',_0x623612);return{'transcript':_0x2aaec8,'confidence':_0x623612};})['catch'](function(_0xe1c3b1){logger['error'](_0x3abd('0x52'),_0xe1c3b1[_0x3abd('0x14')],_0xe1c3b1[_0x3abd('0x53')],_0xe1c3b1[_0x3abd('0x54')]);});};exports[_0x3abd('0x55')]=function(_0x10e8f0,_0x45b141,_0x1cb8c2,_0x186a94){var _0x437e9c=apiai(_0x45b141,{'language':_0x186a94||'en'});return _0x437e9c[_0x3abd('0x56')](_0x1cb8c2,{'sessionId':md5(_0x10e8f0)})[_0x3abd('0x3c')](function(_0x49e426){logger['info'](JSON[_0x3abd('0x40')](_0x49e426));return{'source':_0x49e426[_0x3abd('0x57')]['source'],'resolvedQuery':_0x49e426[_0x3abd('0x57')][_0x3abd('0x58')],'action':_0x49e426[_0x3abd('0x57')][_0x3abd('0x59')],'actionIncomplete':_0x49e426['result'][_0x3abd('0x5a')],'speech':_0x49e426[_0x3abd('0x57')][_0x3abd('0x5b')]['speech'],'score':_0x49e426[_0x3abd('0x57')][_0x3abd('0x5c')],'statusCode':_0x49e426[_0x3abd('0x5d')][_0x3abd('0x5e')],'endConversation':_0x49e426[_0x3abd('0x57')][_0x3abd('0x5f')]['endConversation']||![],'isFallbackIntent':_0x49e426[_0x3abd('0x57')][_0x3abd('0x5f')][_0x3abd('0x60')]};});};exports[_0x3abd('0x61')]=function(_0x134709,_0x2b9e90,_0x35ea0b,_0x35c394,_0x57b25b,_0x6d9509){var _0x8e3711=_0x35c394[_0x3abd('0x62')](/\\n/g,'\x0a');var _0x2b87b2={'credentials':{'private_key':_0x8e3711,'client_email':_0x35ea0b}};var _0x1dac19=new dialogflow[(_0x3abd('0x63'))](_0x2b87b2);var _0x259472=_0x1dac19[_0x3abd('0x64')](_0x2b9e90,md5(_0x134709));var _0x1fd3e9={'session':_0x259472,'queryInput':{'text':{'text':_0x57b25b,'languageCode':_0x6d9509}}};return _0x1dac19[_0x3abd('0x65')](_0x1fd3e9)[_0x3abd('0x3c')](function(_0x5cf71e){if(_0x5cf71e&&_0x5cf71e[_0x3abd('0x46')]){logger[_0x3abd('0x1a')]('Dialogflow\x20V2\x20response:',JSON[_0x3abd('0x40')](_0x5cf71e));var _0x3f57f8=_0x5cf71e[0x0];if(_0x3f57f8){var _0x23c97c={'action':_0x3f57f8[_0x3abd('0x66')]['action'],'allRequiredParamsPresent':_0x3f57f8[_0x3abd('0x66')][_0x3abd('0x67')],'endConversation':_0x3f57f8[_0x3abd('0x66')][_0x3abd('0x68')]&&_0x3f57f8[_0x3abd('0x66')][_0x3abd('0x68')]['fields']?_0x3f57f8[_0x3abd('0x66')]['diagnosticInfo'][_0x3abd('0x69')][_0x3abd('0x6a')]['boolValue']:![],'fulfillmentText':_0x3f57f8[_0x3abd('0x66')]['fulfillmentText'],'intentName':_0x3f57f8[_0x3abd('0x66')][_0x3abd('0x6b')][_0x3abd('0x53')],'intentDisplayName':_0x3f57f8[_0x3abd('0x66')]['intent'][_0x3abd('0x6c')],'isFallbackIntent':_0x3f57f8['queryResult'][_0x3abd('0x6b')][_0x3abd('0x6d')],'languageCode':_0x3f57f8[_0x3abd('0x66')][_0x3abd('0x6e')],'queryText':_0x3f57f8['queryResult']['queryText'],'responseId':_0x3f57f8['responseId'],'score':_0x3f57f8['queryResult']['intentDetectionConfidence'],'speech':_0x3f57f8[_0x3abd('0x66')][_0x3abd('0x6f')],'providerResponse':JSON[_0x3abd('0x40')](_0x5cf71e)};return _0x23c97c;}}});};exports[_0x3abd('0x70')]=function(_0x4499d6,_0x5cdc8c,_0x32cf00,_0x454fd8){return tilde[_0x3abd('0x4b')](_0x4499d6,_0x5cdc8c,_0x32cf00,_0x454fd8)[_0x3abd('0x3c')](function(_0x17e380){try{fs[_0x3abd('0x29')](_0x4499d6);}catch(_0x1bb418){logger[_0x3abd('0x15')](_0x1bb418);}logger['info'](_0x3abd('0x71'),_0x17e380[_0x3abd('0x4f')]);logger[_0x3abd('0x1a')](_0x3abd('0x72'),_0x17e380[_0x3abd('0x50')]);return _0x17e380;});};exports[_0x3abd('0x73')]=function(_0x435ce3,_0xbfe8cc,_0x197a73,_0x174360,_0x242b3d,_0x1023fb){var _0x4ac47a=path[_0x3abd('0x37')](__dirname,'tmp',rs['generate'](0x4)+_0x3abd('0x38'));var _0x374452;return aws[_0x3abd('0x74')](_0x435ce3,_0xbfe8cc,_0x197a73,_0x174360,_0x242b3d,_0x1023fb,_0x4ac47a)[_0x3abd('0x3c')](function(){_0x374452=path[_0x3abd('0x37')](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+'.wav');return convertFile(_0x4ac47a,_0x374452);})[_0x3abd('0x3c')](function(){try{fs[_0x3abd('0x29')](_0x4ac47a);fs[_0x3abd('0x2a')](_0x374452,_0x3abd('0x2b'));}catch(_0x39aff4){logger[_0x3abd('0x15')](_0x39aff4);}return _0x374452[_0x3abd('0x2c')]('.')[0x0];});};exports[_0x3abd('0x75')]=function(_0x5a6f21,_0x29f33b,_0x5d0a38,_0x3997ce,_0x4f4635,_0x24861c){return aws['lex'](_0x5a6f21,_0x29f33b,_0x5d0a38,_0x3997ce,_0x4f4635,_0x24861c)[_0x3abd('0x3c')](function(_0x5ee0f7){logger[_0x3abd('0x1a')](JSON['stringify'](_0x5ee0f7));return _0x5ee0f7;});};exports[_0x3abd('0x76')]=function(_0x11db9a,_0x440a2d,_0x4994a4,_0x5080dc){var _0x226b73=util[_0x3abd('0x77')](_0x3abd('0x78'),ISPEECH_API,_0x11db9a,encodeURIComponent(_0x440a2d),_0x4994a4,_0x5080dc);var _0xd9cb5=path['resolve'](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+_0x3abd('0x38'));var _0x32892e;return downloadFile(_0x226b73,_0xd9cb5)[_0x3abd('0x3c')](function(){_0x32892e=path['resolve'](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+'.wav');return convertFile(_0xd9cb5,_0x32892e);})[_0x3abd('0x3c')](function(){try{fs[_0x3abd('0x29')](_0xd9cb5);fs[_0x3abd('0x2a')](_0x32892e,_0x3abd('0x2b'));}catch(_0x1f993e){logger[_0x3abd('0x15')](_0x1f993e);}return _0x32892e[_0x3abd('0x2c')]('.')[0x0];});};exports[_0x3abd('0x79')]=function(_0x4d443b,_0x3da053,_0x1a337e,_0x1697ff){var _0x579c4f=util['format'](_0x3abd('0x7a'),ISPEECH_API,_0x3da053,_0x1a337e,base64Encode(_0x4d443b),_0x1697ff?util[_0x3abd('0x77')](_0x3abd('0x7b'),encodeURIComponent(_0x1697ff)):_0x3abd('0x7c'));return uploadFile(_0x579c4f)[_0x3abd('0x3c')](function(_0x484355){return querystring['parse'](_0x484355);});};exports['sestekNDA']=function(_0x3a1d3d,_0x52e084){return sestek['nda'](_0x3a1d3d,_0x52e084)[_0x3abd('0x3c')](function(_0x4d2f05){logger[_0x3abd('0x1a')](JSON[_0x3abd('0x40')](_0x4d2f05));var _0x4dafa3={'speech':_0x4d2f05[_0x3abd('0x7d')],'action':_0x4d2f05[_0x3abd('0x7e')]?_0x4d2f05[_0x3abd('0x7e')][_0x3abd('0x7f')]:undefined,'actiondata':_0x4d2f05[_0x3abd('0x7e')]?_0x4d2f05[_0x3abd('0x7e')]['CustomActionData']:undefined};if(_0x4d2f05['channelData']&&_0x4d2f05['channelData'][_0x3abd('0x80')]){return base64Decode(_0x4d2f05[_0x3abd('0x7e')][_0x3abd('0x80')][_0x3abd('0x81')],path[_0x3abd('0x37')](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+'.wav'))[_0x3abd('0x3c')](function(_0x5ab315){_0x4dafa3[_0x3abd('0x82')]=_0x5ab315;return _0x4dafa3;});}return _0x4dafa3;});};exports['dirName']=function(){return __dirname;};
\ No newline at end of file
+var _0x704f=['wav','error\x20convert','finish\x20to\x20convert','start','resolve','generate','writeFileSync','base64','then','777','split','readFileSync','toString','googleCloudTTS','?key=','ssml','input','voice','audioConfig','text:synthesize','tmp','.mp3','from','audioContent','.wav','chmodSync','googleCloudTTS\x20path','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','parse\x20response\x20failed:\x0a','googleASR','asr','uri','results','alternatives','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','fulfillment','speech','score','status','code','metadata','endConversation','googleDialogflowV2','SessionsClient','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','transcript','awsPolly','polly','awsLex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','parse','sestekNDA','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','bluebird','dialogflow','http','path','request-promise','randomstring','sox','google-tts-api','util','./aws','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','end','WHAT_EVER'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x704f,0x65));var _0xf704=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x704f[_0xf50820];return _0x2a9b10;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xf704('0x0'));var dialogflow=require(_0xf704('0x1'));var fs=require('fs');var http=require(_0xf704('0x2'));var https=require('https');var md5=require('md5');var path=require(_0xf704('0x3'));var querystring=require('querystring');var rp=require(_0xf704('0x4'));var rs=require(_0xf704('0x5'));var sox=require(_0xf704('0x6'));var tts=require(_0xf704('0x7'));var urlParse=require('url')['parse'];var util=require(_0xf704('0x8'));var aws=require(_0xf704('0x9'));var google=require('./google');var sestek=require(_0xf704('0xa'));var tilde=require('./tilde');var logger=require(_0xf704('0xb'))(_0xf704('0xc'));var ISPEECH_API=_0xf704('0xd');function downloadFile(_0x13dbbe,_0x2493af){return new BPromise(function(_0x23296f,_0x3e5890){var _0x5146e6=urlParse(_0x13dbbe);var _0x18c386=_0x5146e6[_0xf704('0xe')]===_0xf704('0xf')?https:http;var _0x3c3819={'host':_0x5146e6[_0xf704('0x10')],'path':_0x5146e6[_0xf704('0x3')],'headers':{'user-agent':'WHAT_EVER'}};_0x18c386[_0xf704('0x11')](_0x3c3819,function(_0x585a93){if(_0x585a93[_0xf704('0x12')]!==0xc8){logger['error']('request\x20to\x20'+_0x13dbbe+_0xf704('0x13')+_0x585a93['statusCode']+'\x20('+_0x585a93[_0xf704('0x14')]+')');_0x3e5890(new Error(_0xf704('0x15')+_0x13dbbe+_0xf704('0x13')+_0x585a93[_0xf704('0x12')]+'\x20('+_0x585a93[_0xf704('0x14')]+')'));return;}var _0x146c39=fs['createWriteStream'](_0x2493af);_0x146c39['on'](_0xf704('0x16'),function(){logger[_0xf704('0x17')](_0xf704('0x18'));_0x146c39[_0xf704('0x19')](_0x23296f);});_0x146c39['on'](_0xf704('0x1a'),function(_0x5a2d1c){fs[_0xf704('0x1b')](_0x2493af);logger['error'](_0xf704('0x1c'),_0x5a2d1c);_0x3e5890(_0x5a2d1c);});_0x585a93[_0xf704('0x1d')](_0x146c39);})['on']('error',function(_0x41e739){logger['error'](_0x41e739);_0x3e5890(_0x41e739);})[_0xf704('0x1e')]();});}function uploadFile(_0x406d47){return new BPromise(function(_0x48a1fb,_0x2cf7ac){var _0x2d3372=urlParse(_0x406d47);var _0x17fb99=_0x2d3372[_0xf704('0xe')]==='https:'?https:http;var _0x4ba8da={'host':_0x2d3372['host'],'path':_0x2d3372[_0xf704('0x3')],'headers':{'user-agent':_0xf704('0x1f')}};_0x17fb99[_0xf704('0x11')](_0x4ba8da,function(_0x1cc1c1){if(_0x1cc1c1[_0xf704('0x12')]!==0xc8){_0x2cf7ac(new Error('request\x20to\x20'+_0x406d47+_0xf704('0x13')+_0x1cc1c1[_0xf704('0x12')]+'\x20('+_0x1cc1c1[_0xf704('0x14')]+')'));return;}var _0x561730='';_0x1cc1c1['on']('data',function(_0x33ad12){_0x561730+=_0x33ad12;});_0x1cc1c1['on']('end',function(){_0x48a1fb(_0x561730);});})['on'](_0xf704('0x1a'),function(_0x6d1133){_0x2cf7ac(_0x6d1133);})[_0xf704('0x1e')]();});}function convertFile(_0x2654d2,_0x311635){return new BPromise(function(_0x460ea6,_0x1aff0e){var _0x3b9efa=sox['transcode'](_0x2654d2,_0x311635,{'sampleRate':0x1f40,'format':_0xf704('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3b9efa['on'](_0xf704('0x1a'),function(_0x1b346d){logger['error'](_0xf704('0x21'),_0x1b346d);_0x1aff0e(_0x1b346d);});_0x3b9efa['on'](_0xf704('0x1e'),function(){logger[_0xf704('0x17')](_0xf704('0x22'));_0x460ea6();});_0x3b9efa[_0xf704('0x23')]();});}function base64Decode(_0x30ae58,_0x35261e){var _0x167b7f=path[_0xf704('0x24')](__dirname,'tmp',rs[_0xf704('0x25')](0x4)+'.wav');fs[_0xf704('0x26')](_0x167b7f,_0x30ae58,_0xf704('0x27'));return convertFile(_0x167b7f,_0x35261e)[_0xf704('0x28')](function(){try{fs[_0xf704('0x1b')](_0x167b7f);fs['chmodSync'](_0x35261e,_0xf704('0x29'));}catch(_0x52e9ed){logger['error'](_0x52e9ed);}return _0x35261e[_0xf704('0x2a')]('.')[0x0];});}function base64Encode(_0x4024e3){var _0x585bd0=fs[_0xf704('0x2b')](_0x4024e3);return new Buffer(_0x585bd0)[_0xf704('0x2c')]('base64');}exports[_0xf704('0x2d')]=function(_0x3d6c27,_0x4d3ee1,_0x149290,_0x41b128,_0x53949f,_0xe1f28d){var _0x3333e6,_0x2f344f;var _0xba5035='https://texttospeech.googleapis.com/v1/';var _0x1ecb40=_0xf704('0x2e')+_0x3d6c27;var _0x3d4e61={};if(_0x4d3ee1===_0xf704('0x2f')){_0x3d4e61[_0xf704('0x30')]={'ssml':_0x149290};}else{_0x3d4e61['input']={'text':_0x149290};};_0x3d4e61[_0xf704('0x31')]={'languageCode':_0x41b128,'ssmlGender':_0x53949f};_0x3d4e61[_0xf704('0x32')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x5cd42b={'url':_0xba5035+_0xf704('0x33')+_0x1ecb40,'method':'POST','json':!![],'body':_0x3d4e61};return rp(_0x5cd42b)[_0xf704('0x28')](function(_0x16d18f){return new BPromise(function(_0x493d44,_0x4cef84){_0x3333e6=path[_0xf704('0x24')](__dirname,_0xf704('0x34'),rs[_0xf704('0x25')](0x4)+_0xf704('0x35'));var _0x100b14=Buffer[_0xf704('0x36')](_0x16d18f[_0xf704('0x37')],'base64');return fs['writeFile'](_0x3333e6,_0x100b14,function(_0x3d815b){_0x4cef84(_0x3d815b);},function(_0x3134f4){fs['chmodSync'](_0x3333e6,_0xf704('0x29'));_0x493d44(_0x3134f4);});});})[_0xf704('0x28')](function(_0x4b5d9c){_0x2f344f=path[_0xf704('0x24')](__dirname,'tmp',rs[_0xf704('0x25')](0x4)+_0xf704('0x38'));return convertFile(_0x3333e6,_0x2f344f);})[_0xf704('0x28')](function(){try{fs[_0xf704('0x1b')](_0x3333e6);fs[_0xf704('0x39')](_0x2f344f,'777');}catch(_0x13c085){logger[_0xf704('0x1a')](_0x13c085);}logger[_0xf704('0x17')](_0xf704('0x3a'),_0x2f344f['split']('.')[0x0]);return _0x2f344f[_0xf704('0x2a')]('.')[0x0];});};exports[_0xf704('0x3b')]=function(_0x2fb78b,_0x152187){var _0x4bc572='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x13cfc7,_0x5a3d46;var _0x244718;var _0x57c21a={'encoding':_0xf704('0x3c'),'method':'POST','timeout':0x2710,'url':_0x4bc572,'headers':{'Content-Type':_0xf704('0x3d')},'body':_0xf704('0x3e')+encodeURIComponent(JSON[_0xf704('0x3f')]([[[_0xf704('0x40'),JSON[_0xf704('0x3f')]([_0x2fb78b,_0x152187||'en',![],_0xf704('0x41')]),null,_0xf704('0x42')]]]))};return rp(_0x57c21a)[_0xf704('0x28')](function(_0x450ef4){try{_0x244718=eval(_0x450ef4['slice'](0x5))[0x0][0x2];}catch(_0xe7d8b7){throw new Error('parse\x20response\x20failed:\x0a'+_0x450ef4[_0xf704('0x43')]);}if(!_0x244718){if(_0x2fb78b[_0xf704('0x44')]>0xc8){throw new Error(_0xf704('0x45'));}else{throw new Error(_0xf704('0x46')+_0x152187+'\x22\x20might\x20not\x20exist');}}try{_0x244718=eval(_0x244718)[0x0];}catch(_0x1204ec){throw new Error(_0xf704('0x47')+res['data']);}const _0x25f657=_0x244718;_0x13cfc7=path[_0xf704('0x24')](__dirname,_0xf704('0x34'),rs[_0xf704('0x25')](0x4)+_0xf704('0x35'));fs[_0xf704('0x26')](_0x13cfc7,_0x244718,{'encoding':_0xf704('0x27')});_0x5a3d46=path['resolve'](__dirname,_0xf704('0x34'),rs[_0xf704('0x25')](0x4)+_0xf704('0x38'));return convertFile(_0x13cfc7,_0x5a3d46);})[_0xf704('0x28')](function(){try{fs[_0xf704('0x1b')](_0x13cfc7);fs[_0xf704('0x39')](_0x5a3d46,'777');}catch(_0xe5e76d){logger['error'](_0xe5e76d);}logger[_0xf704('0x17')]('goggleTTS\x20path',_0x5a3d46['split']('.')[0x0]);return _0x5a3d46[_0xf704('0x2a')]('.')[0x0];});};exports[_0xf704('0x48')]=function(_0x4709a3,_0x43ec0a,_0x36b53a){return google[_0xf704('0x49')](_0x4709a3,_0x43ec0a,_0x36b53a)['then'](function(_0x29713f){logger[_0xf704('0x17')](_0x29713f[_0xf704('0x4a')]);return rp(_0x29713f);})[_0xf704('0x28')](function(_0x5f0076){var _0x320f1b='';var _0x14e33a=0x0;try{fs[_0xf704('0x1b')](_0x4709a3);}catch(_0x5c1c1d){logger['error'](_0x5c1c1d);}if(_0x5f0076&&_0x5f0076[_0xf704('0x4b')]){_0x320f1b=_0x5f0076['results']['map'](function(_0x16f2db){return _0x16f2db&&_0x16f2db[_0xf704('0x4c')][0x0]&&_0x16f2db[_0xf704('0x4c')][0x0]['transcript']?_0x16f2db['alternatives'][0x0]['transcript']:'';})[_0xf704('0x4d')]('\x0a');_0x14e33a=_0x5f0076[_0xf704('0x4b')][_0xf704('0x4e')](function(_0x35cf87){return _0x35cf87&&_0x35cf87[_0xf704('0x4c')][0x0]&&_0x35cf87[_0xf704('0x4c')][0x0]['confidence']?_0x35cf87[_0xf704('0x4c')][0x0][_0xf704('0x4f')]:0x0;})[_0xf704('0x4d')]('\x0a');}logger[_0xf704('0x17')](_0xf704('0x50'),_0x320f1b);logger[_0xf704('0x17')](_0xf704('0x51'),_0x14e33a);return{'transcript':_0x320f1b,'confidence':_0x14e33a};})[_0xf704('0x52')](function(_0x76472c){logger['error'](_0xf704('0x53'),_0x76472c['statusCode'],_0x76472c[_0xf704('0x54')],_0x76472c[_0xf704('0x55')]);});};exports[_0xf704('0x56')]=function(_0x2d7b4c,_0x2aa75d,_0x4fe75a,_0x370138){var _0x5b4abb=apiai(_0x2aa75d,{'language':_0x370138||'en'});return _0x5b4abb[_0xf704('0x57')](_0x4fe75a,{'sessionId':md5(_0x2d7b4c)})[_0xf704('0x28')](function(_0x3cf4a3){logger[_0xf704('0x17')](JSON[_0xf704('0x3f')](_0x3cf4a3));return{'source':_0x3cf4a3[_0xf704('0x58')]['source'],'resolvedQuery':_0x3cf4a3[_0xf704('0x58')][_0xf704('0x59')],'action':_0x3cf4a3[_0xf704('0x58')][_0xf704('0x5a')],'actionIncomplete':_0x3cf4a3[_0xf704('0x58')]['actionIncomplete'],'speech':_0x3cf4a3[_0xf704('0x58')][_0xf704('0x5b')][_0xf704('0x5c')],'score':_0x3cf4a3[_0xf704('0x58')][_0xf704('0x5d')],'statusCode':_0x3cf4a3[_0xf704('0x5e')][_0xf704('0x5f')],'endConversation':_0x3cf4a3[_0xf704('0x58')][_0xf704('0x60')][_0xf704('0x61')]||![],'isFallbackIntent':_0x3cf4a3['result'][_0xf704('0x60')]['isFallbackIntent']};});};exports[_0xf704('0x62')]=function(_0x3bec89,_0x4bf83d,_0x31cbdb,_0x25cb25,_0x1f5157,_0x58ac39){var _0x2b978f=_0x25cb25['replace'](/\\n/g,'\x0a');var _0x416e60={'credentials':{'private_key':_0x2b978f,'client_email':_0x31cbdb}};var _0x2b4e32=new dialogflow[(_0xf704('0x63'))](_0x416e60);var _0x25cba6=_0x2b4e32['sessionPath'](_0x4bf83d,md5(_0x3bec89));var _0x51b666={'session':_0x25cba6,'queryInput':{'text':{'text':_0x1f5157,'languageCode':_0x58ac39}}};return _0x2b4e32[_0xf704('0x64')](_0x51b666)['then'](function(_0x1c3750){if(_0x1c3750&&_0x1c3750[_0xf704('0x44')]){logger[_0xf704('0x17')]('Dialogflow\x20V2\x20response:',JSON[_0xf704('0x3f')](_0x1c3750));var _0x578cc7=_0x1c3750[0x0];if(_0x578cc7){var _0x2045b3={'action':_0x578cc7[_0xf704('0x65')]['action'],'allRequiredParamsPresent':_0x578cc7[_0xf704('0x65')][_0xf704('0x66')],'endConversation':_0x578cc7[_0xf704('0x65')][_0xf704('0x67')]&&_0x578cc7[_0xf704('0x65')][_0xf704('0x67')][_0xf704('0x68')]?_0x578cc7[_0xf704('0x65')][_0xf704('0x67')]['fields'][_0xf704('0x69')][_0xf704('0x6a')]:![],'fulfillmentText':_0x578cc7[_0xf704('0x65')][_0xf704('0x6b')],'intentName':_0x578cc7[_0xf704('0x65')][_0xf704('0x6c')][_0xf704('0x54')],'intentDisplayName':_0x578cc7[_0xf704('0x65')][_0xf704('0x6c')]['displayName'],'isFallbackIntent':_0x578cc7[_0xf704('0x65')][_0xf704('0x6c')]['isFallback'],'languageCode':_0x578cc7['queryResult'][_0xf704('0x6d')],'queryText':_0x578cc7['queryResult'][_0xf704('0x6e')],'responseId':_0x578cc7[_0xf704('0x6f')],'score':_0x578cc7[_0xf704('0x65')][_0xf704('0x70')],'speech':_0x578cc7[_0xf704('0x65')]['fulfillmentText'],'providerResponse':JSON[_0xf704('0x3f')](_0x1c3750)};return _0x2045b3;}}});};exports[_0xf704('0x71')]=function(_0x3096c0,_0x54c6b9,_0x361c7b,_0x300f42){return tilde[_0xf704('0x49')](_0x3096c0,_0x54c6b9,_0x361c7b,_0x300f42)['then'](function(_0x47b3c0){try{fs[_0xf704('0x1b')](_0x3096c0);}catch(_0xb7e3f2){logger[_0xf704('0x1a')](_0xb7e3f2);}logger[_0xf704('0x17')](_0xf704('0x72'),_0x47b3c0[_0xf704('0x73')]);logger['info']('Tilde\x20ASR\x20confidence',_0x47b3c0[_0xf704('0x4f')]);return _0x47b3c0;});};exports[_0xf704('0x74')]=function(_0x4eaf95,_0xf1e105,_0x2f2203,_0xebb12a,_0x3c0015,_0x3036f4){var _0x48228a=path[_0xf704('0x24')](__dirname,_0xf704('0x34'),rs['generate'](0x4)+_0xf704('0x35'));var _0x570c69;return aws[_0xf704('0x75')](_0x4eaf95,_0xf1e105,_0x2f2203,_0xebb12a,_0x3c0015,_0x3036f4,_0x48228a)[_0xf704('0x28')](function(){_0x570c69=path[_0xf704('0x24')](__dirname,_0xf704('0x34'),rs['generate'](0x4)+_0xf704('0x38'));return convertFile(_0x48228a,_0x570c69);})[_0xf704('0x28')](function(){try{fs[_0xf704('0x1b')](_0x48228a);fs[_0xf704('0x39')](_0x570c69,_0xf704('0x29'));}catch(_0x35e26b){logger[_0xf704('0x1a')](_0x35e26b);}return _0x570c69[_0xf704('0x2a')]('.')[0x0];});};exports[_0xf704('0x76')]=function(_0x550871,_0x25a739,_0x3b1c92,_0x89a30e,_0x4405b4,_0x13593c){return aws['lex'](_0x550871,_0x25a739,_0x3b1c92,_0x89a30e,_0x4405b4,_0x13593c)[_0xf704('0x28')](function(_0x353eec){logger[_0xf704('0x17')](JSON[_0xf704('0x3f')](_0x353eec));return _0x353eec;});};exports['ispeechTTS']=function(_0x55e60b,_0x89b5c,_0x2f96bb,_0x5310f4){var _0xc84e9=util[_0xf704('0x77')](_0xf704('0x78'),ISPEECH_API,_0x55e60b,encodeURIComponent(_0x89b5c),_0x2f96bb,_0x5310f4);var _0xfa17ab=path['resolve'](__dirname,_0xf704('0x34'),rs[_0xf704('0x25')](0x4)+_0xf704('0x35'));var _0x38d1f2;return downloadFile(_0xc84e9,_0xfa17ab)[_0xf704('0x28')](function(){_0x38d1f2=path[_0xf704('0x24')](__dirname,_0xf704('0x34'),rs['generate'](0x4)+_0xf704('0x38'));return convertFile(_0xfa17ab,_0x38d1f2);})[_0xf704('0x28')](function(){try{fs[_0xf704('0x1b')](_0xfa17ab);fs[_0xf704('0x39')](_0x38d1f2,_0xf704('0x29'));}catch(_0x2721fd){logger[_0xf704('0x1a')](_0x2721fd);}return _0x38d1f2[_0xf704('0x2a')]('.')[0x0];});};exports[_0xf704('0x79')]=function(_0x522bae,_0x25f760,_0x253120,_0x574931){var _0x2719f0=util['format'](_0xf704('0x7a'),ISPEECH_API,_0x25f760,_0x253120,base64Encode(_0x522bae),_0x574931?util[_0xf704('0x77')]('model=%s',encodeURIComponent(_0x574931)):_0xf704('0x7b'));return uploadFile(_0x2719f0)['then'](function(_0x45d959){return querystring[_0xf704('0x7c')](_0x45d959);});};exports[_0xf704('0x7d')]=function(_0x125c29,_0xc06c7f){return sestek['nda'](_0x125c29,_0xc06c7f)[_0xf704('0x28')](function(_0xb966ad){logger[_0xf704('0x17')](JSON['stringify'](_0xb966ad));var _0x5a0f0e={'speech':_0xb966ad[_0xf704('0x7e')],'action':_0xb966ad[_0xf704('0x7f')]?_0xb966ad[_0xf704('0x7f')][_0xf704('0x80')]:undefined,'actiondata':_0xb966ad[_0xf704('0x7f')]?_0xb966ad['channelData']['CustomActionData']:undefined};if(_0xb966ad[_0xf704('0x7f')]&&_0xb966ad[_0xf704('0x7f')][_0xf704('0x81')]){return base64Decode(_0xb966ad['channelData']['AudioFromTts'][_0xf704('0x82')],path[_0xf704('0x24')](__dirname,_0xf704('0x34'),rs[_0xf704('0x25')](0x4)+_0xf704('0x38')))[_0xf704('0x28')](function(_0x33607d){_0x5a0f0e[_0xf704('0x83')]=_0x33607d;return _0x5a0f0e;});}return _0x5a0f0e;});};exports[_0xf704('0x84')]=function(){return __dirname;};
\ No newline at end of file
index 107b12d..291c6c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22d6=['./nda','exports'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x22d6,0xc6));var _0x622d=function(_0x469a2d,_0x53bcbe){_0x469a2d=_0x469a2d-0x0;var _0x148147=_0x22d6[_0x469a2d];return _0x148147;};var nda=require(_0x622d('0x0'));module[_0x622d('0x1')]={'nda':nda};
\ No newline at end of file
+var _0xb9f1=['./nda'];(function(_0x2a778b,_0x5ee273){var _0x5b6eed=function(_0x210277){while(--_0x210277){_0x2a778b['push'](_0x2a778b['shift']());}};_0x5b6eed(++_0x5ee273);}(_0xb9f1,0x115));var _0x1b9f=function(_0x3d7931,_0x37835d){_0x3d7931=_0x3d7931-0x0;var _0x18c985=_0xb9f1[_0x3d7931];return _0x18c985;};var nda=require(_0x1b9f('0x0'));module['exports']={'nda':nda};
\ No newline at end of file
index 1006bd4..08f5f04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d2e=['POST','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','callerid','calleridname','dnid','extension','Bearer\x20','access_token','body','channelData','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','agi','exports'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0x6d2e,0x97));var _0xe6d2=function(_0x52c8e8,_0x5ee20d){_0x52c8e8=_0x52c8e8-0x0;var _0x31bb1a=_0x6d2e[_0x52c8e8];return _0x31bb1a;};'use strict';var rp=require('request-promise');var url=require(_0xe6d2('0x0'));var logger=require(_0xe6d2('0x1'))(_0xe6d2('0x2'));module[_0xe6d2('0x3')]=function(_0x412889,_0xf81df7){var _0x4dbf04={'method':_0xe6d2('0x4'),'uri':url['resolve'](_0xf81df7['ndauth_url'],_0xe6d2('0x5')),'form':{'grant_type':_0xe6d2('0x6'),'username':_0xf81df7[_0xe6d2('0x7')],'password':_0xf81df7['password']},'json':!![]};return rp(_0x4dbf04)[_0xe6d2('0x8')](function(_0x53906e){var _0x2e227e={'method':_0xe6d2('0x4'),'uri':url['resolve'](_0xf81df7[_0xe6d2('0x9')],_0xe6d2('0xa')),'body':{'type':_0xf81df7['ndaactivity_type']||_0xe6d2('0xb'),'channelId':_0xe6d2('0xc'),'conversation':{'id':_0x412889['uniqueid']},'from':{'id':_0x412889[_0xe6d2('0xd')],'name':_0x412889[_0xe6d2('0xe')]},'recipient':{'id':_0x412889[_0xe6d2('0xf')],'name':_0x412889[_0xe6d2('0x10')]},'text':_0xf81df7['text'],'channelData':{}},'headers':{'Authorization':_0xe6d2('0x11')+_0x53906e[_0xe6d2('0x12')]},'json':!![]};if(_0xf81df7['project']){_0x2e227e[_0xe6d2('0x13')][_0xe6d2('0x14')]['ProjectName']=_0xf81df7[_0xe6d2('0x15')];}if(_0xf81df7[_0xe6d2('0x16')]=='1'){_0x2e227e[_0xe6d2('0x13')][_0xe6d2('0x14')][_0xe6d2('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe6d2('0x18')};}if(_0xf81df7[_0xe6d2('0x19')]){_0x2e227e[_0xe6d2('0x13')][_0xe6d2('0x14')][_0xe6d2('0x1a')]=_0xf81df7[_0xe6d2('0x19')];if(_0xf81df7[_0xe6d2('0x1b')]){_0x2e227e[_0xe6d2('0x13')][_0xe6d2('0x14')][_0xe6d2('0x1c')]=_0xf81df7['custom_action_data'];}}logger[_0xe6d2('0x1d')](JSON[_0xe6d2('0x1e')](_0x2e227e));return rp(_0x2e227e);});};
\ No newline at end of file
+var _0x9bb4=['project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','info','request-promise','url','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','username','then','resolve','/api/NaturalDialogAssistant/v1/Run','message','Nda','callerid','extension','Bearer\x20','access_token'];(function(_0x48895e,_0x48ca83){var _0x191de3=function(_0x1d5591){while(--_0x1d5591){_0x48895e['push'](_0x48895e['shift']());}};_0x191de3(++_0x48ca83);}(_0x9bb4,0xd5));var _0x49bb=function(_0x5b3e71,_0x34e45a){_0x5b3e71=_0x5b3e71-0x0;var _0x46774c=_0x9bb4[_0x5b3e71];return _0x46774c;};'use strict';var rp=require(_0x49bb('0x0'));var url=require(_0x49bb('0x1'));var logger=require(_0x49bb('0x2'))(_0x49bb('0x3'));module[_0x49bb('0x4')]=function(_0x2d4298,_0x26cbff){var _0xa01a73={'method':_0x49bb('0x5'),'uri':url['resolve'](_0x26cbff[_0x49bb('0x6')],_0x49bb('0x7')),'form':{'grant_type':_0x49bb('0x8'),'username':_0x26cbff[_0x49bb('0x9')],'password':_0x26cbff['password']},'json':!![]};return rp(_0xa01a73)[_0x49bb('0xa')](function(_0x353853){var _0x1a4094={'method':_0x49bb('0x5'),'uri':url[_0x49bb('0xb')](_0x26cbff['ndassistant_url'],_0x49bb('0xc')),'body':{'type':_0x26cbff['ndaactivity_type']||_0x49bb('0xd'),'channelId':_0x49bb('0xe'),'conversation':{'id':_0x2d4298['uniqueid']},'from':{'id':_0x2d4298[_0x49bb('0xf')],'name':_0x2d4298['calleridname']},'recipient':{'id':_0x2d4298['dnid'],'name':_0x2d4298[_0x49bb('0x10')]},'text':_0x26cbff['text'],'channelData':{}},'headers':{'Authorization':_0x49bb('0x11')+_0x353853[_0x49bb('0x12')]},'json':!![]};if(_0x26cbff[_0x49bb('0x13')]){_0x1a4094[_0x49bb('0x14')][_0x49bb('0x15')][_0x49bb('0x16')]=_0x26cbff[_0x49bb('0x13')];}if(_0x26cbff[_0x49bb('0x17')]=='1'){_0x1a4094[_0x49bb('0x14')]['channelData'][_0x49bb('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x26cbff[_0x49bb('0x19')]){_0x1a4094[_0x49bb('0x14')][_0x49bb('0x15')][_0x49bb('0x1a')]=_0x26cbff[_0x49bb('0x19')];if(_0x26cbff[_0x49bb('0x1b')]){_0x1a4094[_0x49bb('0x14')][_0x49bb('0x15')]['CustomActionData']=_0x26cbff[_0x49bb('0x1b')];}}logger[_0x49bb('0x1c')](JSON['stringify'](_0x1a4094));return rp(_0x1a4094);});};
\ No newline at end of file
index f892914..6a33122 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe8b=['./lib/api','exports'];(function(_0x216e5a,_0x24cd58){var _0xd7ca2f=function(_0x14ae4e){while(--_0x14ae4e){_0x216e5a['push'](_0x216e5a['shift']());}};_0xd7ca2f(++_0x24cd58);}(_0xbe8b,0x128));var _0xbbe8=function(_0xff76c7,_0x25228d){_0xff76c7=_0xff76c7-0x0;var _0x16ef62=_0xbe8b[_0xff76c7];return _0x16ef62;};'use strict';var asr=require(_0xbbe8('0x0'));module[_0xbbe8('0x1')]=function(_0x1efc5f,_0x17ef21,_0x21c8e8,_0x588d85){return asr(_0x1efc5f,_0x17ef21,_0x21c8e8,_0x588d85);};
\ No newline at end of file
+var _0x3f98=['./lib/api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3f98,0xfb));var _0x83f9=function(_0x3040f4,_0xf239bc){_0x3040f4=_0x3040f4-0x0;var _0x59820b=_0x3f98[_0x3040f4];return _0x59820b;};'use strict';var asr=require(_0x83f9('0x0'));module['exports']=function(_0x112af3,_0xa25dc1,_0x5aa059,_0x22e24d){return asr(_0x112af3,_0xa25dc1,_0x5aa059,_0x22e24d);};
\ No newline at end of file
index be34d70..30186e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29bb=['Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','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','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript'];(function(_0x1c66d8,_0x16d85d){var _0xf1cc0a=function(_0x2d8ff4){while(--_0x2d8ff4){_0x1c66d8['push'](_0x1c66d8['shift']());}};_0xf1cc0a(++_0x16d85d);}(_0x29bb,0x89));var _0xb29b=function(_0x57ff51,_0x3059b2){_0x57ff51=_0x57ff51-0x0;var _0x379a36=_0x29bb[_0x57ff51];return _0x379a36;};'use strict';var BPromise=require(_0xb29b('0x0'));var _=require(_0xb29b('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb29b('0x2'));var crypto=require(_0xb29b('0x3'));var logger=require(_0xb29b('0x4'))(_0xb29b('0x5'));module[_0xb29b('0x6')]=function(_0x34ca48,_0x411b83,_0x3db863,_0xb68641){return new BPromise(function(_0xc6c3f3,_0x2baf8f){logger[_0xb29b('0x7')](_0xb29b('0x8'),_0xb68641||_0xb29b('0x9'));var _0x1ad5bb=new WebSocket(_0xb68641||_0xb29b('0x9'),{'perMessageDeflate':![]});var _0x37ae92='';var _0x576c83='0';var _0x490118='1';var _0xa059d2=_0xb29b('0xa');function _0x37404a(_0x447435){var _0x3e28a2=crypto[_0xb29b('0xb')](_0xb29b('0xc'));_0x3e28a2[_0xb29b('0xd')](_0x447435);return _0x3e28a2['digest']('hex');}function _0x159241(){try{logger[_0xb29b('0x7')](_0xb29b('0xe'));var _0x3fc188=moment()[_0xb29b('0xf')]();var _0x1d2479=_0x37404a(_0x3fc188+_0x411b83+_0x3db863);_0x1ad5bb[_0xb29b('0x10')](JSON[_0xb29b('0x11')]({'appID':_0x411b83,'timestamp':_0x3fc188,'appKey':_0x1d2479}));var _0x458457=fs['createReadStream'](_0x34ca48);_0x458457['on'](_0xb29b('0x12'),function(_0x2d1c66){_0x1ad5bb['send'](_0x2d1c66);});_0x458457['on'](_0xb29b('0x13'),function(){_0x1ad5bb[_0xb29b('0x10')](_0xb29b('0x14'));});}catch(_0x94c352){logger[_0xb29b('0x15')](_0xb29b('0x16'),JSON[_0xb29b('0x11')](_0x94c352));_0x1ad5bb[_0xb29b('0x17')]();}}function _0x2c9ae0(_0x11868f){try{if(_0x11868f){var _0x32102f=JSON[_0xb29b('0x18')](_0x11868f);switch(_0x32102f[_0xb29b('0x19')]){case 0x0:if(_0x32102f[_0xb29b('0x1a')]){if(_0x32102f[_0xb29b('0x1a')][_0xb29b('0x1b')]){logger[_0xb29b('0x7')](_0xb29b('0x1c'),JSON[_0xb29b('0x11')](_0x32102f[_0xb29b('0x1a')]['hypotheses']));_0x37ae92=_0x32102f[_0xb29b('0x1a')][_0xb29b('0x1d')][0x0][_0xb29b('0x1e')];_0x576c83=_0x32102f['result']['hypotheses'][0x0]['likelihood'];_0x490118='0';_0xa059d2=_0xb29b('0x1f');_0x1ad5bb['terminate']();}}break;case 0x1:logger[_0xb29b('0x7')](_0xb29b('0xa'));_0x490118='1';_0xa059d2=_0xb29b('0xa');break;case 0x2:logger[_0xb29b('0x7')](_0xb29b('0x20'));_0x490118='2';_0xa059d2='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xb29b('0x7')](_0xb29b('0x21'));_0x490118='9';_0xa059d2=_0xb29b('0x21');break;case 0xa:logger[_0xb29b('0x7')](_0xb29b('0x22'));_0x490118='10';_0xa059d2=_0xb29b('0x22');break;case 0xb:logger['info'](_0xb29b('0x23'));_0x490118='11';_0xa059d2=_0xb29b('0x23');}}}catch(_0x7dc9ee){logger[_0xb29b('0x15')](_0xb29b('0x24'),JSON[_0xb29b('0x11')](_0x7dc9ee));_0x1ad5bb[_0xb29b('0x17')]();}}function _0x2ae98d(){logger['info'](_0xb29b('0x25'));_0xc6c3f3({'transcript':_0x37ae92,'confidence':_0x576c83,'status':_0x490118,'status_message':_0xa059d2});}function _0x471b53(_0x5a8ad1){logger[_0xb29b('0x15')](_0xb29b('0x26'));if(!_['isNil'](_0x5a8ad1)){logger[_0xb29b('0x15')](_[_0xb29b('0x27')](_0x5a8ad1)?JSON['stringify'](_0x5a8ad1):_0x5a8ad1);}}_0x1ad5bb['on'](_0xb29b('0x28'),_0x159241);_0x1ad5bb['on'](_0xb29b('0x29'),_0x2c9ae0);_0x1ad5bb['on'](_0xb29b('0x13'),_0x2ae98d);_0x1ad5bb['on'](_0xb29b('0x15'),_0x471b53);});};
\ No newline at end of file
+var _0x2b8c=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','lodash','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE'];(function(_0x55323,_0x4e45c0){var _0x362440=function(_0x3e57fc){while(--_0x3e57fc){_0x55323['push'](_0x55323['shift']());}};_0x362440(++_0x4e45c0);}(_0x2b8c,0x162));var _0xc2b8=function(_0x461027,_0x5977d0){_0x461027=_0x461027-0x0;var _0x1c1462=_0x2b8c[_0x461027];return _0x1c1462;};'use strict';var BPromise=require('bluebird');var _=require(_0xc2b8('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0xc2b8('0x1'))(_0xc2b8('0x2'));module[_0xc2b8('0x3')]=function(_0x581388,_0x4ccfc9,_0x253e41,_0x12dd0d){return new BPromise(function(_0x5bb6dd,_0x55f3b3){logger['info'](_0xc2b8('0x4'),_0x12dd0d||_0xc2b8('0x5'));var _0x17349e=new WebSocket(_0x12dd0d||_0xc2b8('0x5'),{'perMessageDeflate':![]});var _0x275983='';var _0x48b864='0';var _0x52b9e0='1';var _0x57ae2e=_0xc2b8('0x6');function _0x541ac1(_0x11d3d8){var _0x4e0cf7=crypto['createHash'](_0xc2b8('0x7'));_0x4e0cf7[_0xc2b8('0x8')](_0x11d3d8);return _0x4e0cf7[_0xc2b8('0x9')](_0xc2b8('0xa'));}function _0x1ce9ec(){try{logger[_0xc2b8('0xb')](_0xc2b8('0xc'));var _0x4886ff=moment()['unix']();var _0x4c6ca0=_0x541ac1(_0x4886ff+_0x4ccfc9+_0x253e41);_0x17349e[_0xc2b8('0xd')](JSON[_0xc2b8('0xe')]({'appID':_0x4ccfc9,'timestamp':_0x4886ff,'appKey':_0x4c6ca0}));var _0x5dfdc2=fs[_0xc2b8('0xf')](_0x581388);_0x5dfdc2['on'](_0xc2b8('0x10'),function(_0x52d7f7){_0x17349e['send'](_0x52d7f7);});_0x5dfdc2['on'](_0xc2b8('0x11'),function(){_0x17349e[_0xc2b8('0xd')](_0xc2b8('0x12'));});}catch(_0x5b64bd){logger['error'](_0xc2b8('0x13'),JSON['stringify'](_0x5b64bd));_0x17349e[_0xc2b8('0x14')]();}}function _0x3b3ee5(_0x42ef2a){try{if(_0x42ef2a){var _0x4d8dd0=JSON['parse'](_0x42ef2a);switch(_0x4d8dd0[_0xc2b8('0x15')]){case 0x0:if(_0x4d8dd0['result']){if(_0x4d8dd0[_0xc2b8('0x16')][_0xc2b8('0x17')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0xc2b8('0xe')](_0x4d8dd0[_0xc2b8('0x16')]['hypotheses']));_0x275983=_0x4d8dd0[_0xc2b8('0x16')][_0xc2b8('0x18')][0x0][_0xc2b8('0x19')];_0x48b864=_0x4d8dd0['result'][_0xc2b8('0x18')][0x0][_0xc2b8('0x1a')];_0x52b9e0='0';_0x57ae2e='Success.';_0x17349e[_0xc2b8('0x14')]();}}break;case 0x1:logger[_0xc2b8('0xb')](_0xc2b8('0x6'));_0x52b9e0='1';_0x57ae2e=_0xc2b8('0x6');break;case 0x2:logger['info'](_0xc2b8('0x1b'));_0x52b9e0='2';_0x57ae2e=_0xc2b8('0x1b');break;case 0x9:logger['info'](_0xc2b8('0x1c'));_0x52b9e0='9';_0x57ae2e=_0xc2b8('0x1c');break;case 0xa:logger[_0xc2b8('0xb')](_0xc2b8('0x1d'));_0x52b9e0='10';_0x57ae2e=_0xc2b8('0x1d');break;case 0xb:logger[_0xc2b8('0xb')](_0xc2b8('0x1e'));_0x52b9e0='11';_0x57ae2e=_0xc2b8('0x1e');}}}catch(_0x566555){logger[_0xc2b8('0x1f')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xc2b8('0xe')](_0x566555));_0x17349e[_0xc2b8('0x14')]();}}function _0x316e6e(){logger['info'](_0xc2b8('0x20'));_0x5bb6dd({'transcript':_0x275983,'confidence':_0x48b864,'status':_0x52b9e0,'status_message':_0x57ae2e});}function _0x56904f(_0x3bc47c){logger[_0xc2b8('0x1f')](_0xc2b8('0x21'));if(!_[_0xc2b8('0x22')](_0x3bc47c)){logger['error'](_[_0xc2b8('0x23')](_0x3bc47c)?JSON[_0xc2b8('0xe')](_0x3bc47c):_0x3bc47c);}}_0x17349e['on']('open',_0x1ce9ec);_0x17349e['on']('message',_0x3b3ee5);_0x17349e['on'](_0xc2b8('0x11'),_0x316e6e);_0x17349e['on'](_0xc2b8('0x1f'),_0x56904f);});};
\ No newline at end of file
index 5f84813..59eace4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14fc=['./asr','exports'];(function(_0x11d796,_0x1069a9){var _0x322bb8=function(_0x5c6730){while(--_0x5c6730){_0x11d796['push'](_0x11d796['shift']());}};_0x322bb8(++_0x1069a9);}(_0x14fc,0x170));var _0xc14f=function(_0x20acdb,_0x210c8e){_0x20acdb=_0x20acdb-0x0;var _0x383b0d=_0x14fc[_0x20acdb];return _0x383b0d;};var asr=require(_0xc14f('0x0'));module[_0xc14f('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x42e8=['exports'];(function(_0x5dd4c6,_0x402ada){var _0xd33f0f=function(_0x5d1f9d){while(--_0x5d1f9d){_0x5dd4c6['push'](_0x5dd4c6['shift']());}};_0xd33f0f(++_0x402ada);}(_0x42e8,0xc0));var _0x842e=function(_0x175443,_0x2173cd){_0x175443=_0x175443-0x0;var _0x547fb0=_0x42e8[_0x175443];return _0x547fb0;};var asr=require('./asr');module[_0x842e('0x0')]={'asr':asr};
\ No newline at end of file
index 86177a0..b18c8e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3e8=['getConnections','emit','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','ready','close','E_AGI_SERVER_CLOSE','exports','util','net','EventEmitter','./channel','call','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection'];(function(_0x2cdd7d,_0x234261){var _0x101071=function(_0x3e7ee3){while(--_0x3e7ee3){_0x2cdd7d['push'](_0x2cdd7d['shift']());}};_0x101071(++_0x234261);}(_0xc3e8,0x1c3));var _0x8c3e=function(_0x482cce,_0x2fd9ce){_0x482cce=_0x482cce-0x0;var _0x162a9d=_0xc3e8[_0x482cce];return _0x162a9d;};'use strict';var util=require(_0x8c3e('0x0'));var net=require(_0x8c3e('0x1'));var EventEmitter=require('events')[_0x8c3e('0x2')];var AGIError=require('./error');var AGIChannel=require(_0x8c3e('0x3'));var AGIServer=function(_0x2db95a,_0x5d051d,_0x1c721d){var _0x4f4eaa=this,_0x2db95a=_0x2db95a||0x11dd,_0x5d051d=_0x5d051d||'127.0.0.1',_0x46e6ae=null,_0x24926f=0x0;EventEmitter[_0x8c3e('0x4')](_0x4f4eaa);function _0x5d1357(){if(!_0x2db95a){_0x4f4eaa['emit'](_0x8c3e('0x5'),new AGIError(_0x8c3e('0x6')));return![];}_0x46e6ae=net[_0x8c3e('0x7')]();_0x46e6ae[_0x8c3e('0x8')](_0x2db95a,_0x5d051d);_0x46e6ae['on']('listening',function(){_0x4f4eaa['emit'](_0x8c3e('0x9'));});_0x46e6ae['on'](_0x8c3e('0xa'),function(_0x24f13a){_0x46e6ae[_0x8c3e('0xb')](function(_0x1b9583,_0x1c6986){if(_0x1b9583){_0x4f4eaa[_0x8c3e('0xc')](_0x8c3e('0x5'),new AGIError(_0x8c3e('0xd'),_0x1b9583));}else if(_0x1c721d&&_0x1c721d<0x0){_0x4f4eaa[_0x8c3e('0xc')](_0x8c3e('0x5'),new AGIError(_0x8c3e('0xe')));_0x24f13a['destroy']();}else if(_0x1c721d&&_0x1c721d>0x0&&_0x1c721d<_0x1c6986){_0x24926f+=0x1;_0x4f4eaa[_0x8c3e('0xc')](_0x8c3e('0x5'),new AGIError(_0x8c3e('0xf'),_0x24926f));_0x24f13a[_0x8c3e('0x10')]();}else{var _0x549bdc=new AGIChannel(_0x24f13a);_0x549bdc['on'](_0x8c3e('0x11'),function(){_0x4f4eaa[_0x8c3e('0xc')]('connection',_0x549bdc);});}});});_0x46e6ae['on'](_0x8c3e('0x5'),function(_0x551575){_0x4f4eaa['emit'](_0x8c3e('0x5'),new AGIError('E_AGI_SERVER_ERROR',_0x551575['code']));});_0x46e6ae['on'](_0x8c3e('0x12'),function(){_0x4f4eaa['emit'](_0x8c3e('0x12'),new AGIError(_0x8c3e('0x13')));});}process['nextTick'](function(){_0x5d1357();});};util['inherits'](AGIServer,EventEmitter);module[_0x8c3e('0x14')]=function(_0x3afa03,_0x4f3c92,_0x32fbcd){return new AGIServer(_0x3afa03,_0x4f3c92,_0x32fbcd);};
\ No newline at end of file
+var _0xbbaf=['close','nextTick','exports','net','events','EventEmitter','./error','./channel','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code'];(function(_0x2dbffc,_0x4b77a9){var _0x21dad9=function(_0x2c6019){while(--_0x2c6019){_0x2dbffc['push'](_0x2dbffc['shift']());}};_0x21dad9(++_0x4b77a9);}(_0xbbaf,0x1cf));var _0xfbba=function(_0x4fcdd2,_0xa9d7bd){_0x4fcdd2=_0x4fcdd2-0x0;var _0x2b1393=_0xbbaf[_0x4fcdd2];return _0x2b1393;};'use strict';var util=require('util');var net=require(_0xfbba('0x0'));var EventEmitter=require(_0xfbba('0x1'))[_0xfbba('0x2')];var AGIError=require(_0xfbba('0x3'));var AGIChannel=require(_0xfbba('0x4'));var AGIServer=function(_0x187c2d,_0x5c42e3,_0xbcb881){var _0x4bdaba=this,_0x187c2d=_0x187c2d||0x11dd,_0x5c42e3=_0x5c42e3||'127.0.0.1',_0x5273a4=null,_0x208256=0x0;EventEmitter[_0xfbba('0x5')](_0x4bdaba);function _0x1083aa(){if(!_0x187c2d){_0x4bdaba[_0xfbba('0x6')](_0xfbba('0x7'),new AGIError(_0xfbba('0x8')));return![];}_0x5273a4=net[_0xfbba('0x9')]();_0x5273a4[_0xfbba('0xa')](_0x187c2d,_0x5c42e3);_0x5273a4['on']('listening',function(){_0x4bdaba[_0xfbba('0x6')](_0xfbba('0xb'));});_0x5273a4['on'](_0xfbba('0xc'),function(_0x283399){_0x5273a4[_0xfbba('0xd')](function(_0x529b46,_0x4c7271){if(_0x529b46){_0x4bdaba[_0xfbba('0x6')](_0xfbba('0x7'),new AGIError(_0xfbba('0xe'),_0x529b46));}else if(_0xbcb881&&_0xbcb881<0x0){_0x4bdaba['emit']('error',new AGIError(_0xfbba('0xf')));_0x283399[_0xfbba('0x10')]();}else if(_0xbcb881&&_0xbcb881>0x0&&_0xbcb881<_0x4c7271){_0x208256+=0x1;_0x4bdaba[_0xfbba('0x6')](_0xfbba('0x7'),new AGIError(_0xfbba('0x11'),_0x208256));_0x283399[_0xfbba('0x10')]();}else{var _0x2e950a=new AGIChannel(_0x283399);_0x2e950a['on'](_0xfbba('0x12'),function(){_0x4bdaba[_0xfbba('0x6')](_0xfbba('0xc'),_0x2e950a);});}});});_0x5273a4['on'](_0xfbba('0x7'),function(_0xd10725){_0x4bdaba['emit'](_0xfbba('0x7'),new AGIError(_0xfbba('0xe'),_0xd10725[_0xfbba('0x13')]));});_0x5273a4['on'](_0xfbba('0x14'),function(){_0x4bdaba['emit'](_0xfbba('0x14'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xfbba('0x15')](function(){_0x1083aa();});};util['inherits'](AGIServer,EventEmitter);module[_0xfbba('0x16')]=function(_0x49d07c,_0x41d016,_0x4be34d){return new AGIServer(_0x49d07c,_0x41d016,_0x4be34d);};
\ No newline at end of file
index 04bdef6..7449528 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75ab=['getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','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','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','exports','path','util','lodash','shelljs','odbc','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getUserById','getTrunk','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','body','rawBody','parse','headers','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','agicommand','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','length','isString','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','result','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','callback','no\x20list\x20selected','scheduledAt','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20odbc\x20database\x20found','query','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','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','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','sesteknda','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','sestekNDA','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getSound','getData','response','test','mindigit','hiddendigitsnum','generate','first','substr','getsecretdigits','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','unlink','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','message','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','recordFile','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','ispeechtts','streamFile','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\x20NOT\x20FOUND\x20BY','failure','logout','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','isArray','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','toLowerCase','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','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\x20configured','no\x20mail\x20account\x20found','email','Smtp','subject','service','host','port','secure','authentication','auth','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id'];(function(_0x344bba,_0x384a46){var _0x49cacc=function(_0x2390e8){while(--_0x2390e8){_0x344bba['push'](_0x344bba['shift']());}};_0x49cacc(++_0x384a46);}(_0x75ab,0x1eb));var _0xb75a=function(_0x1bf938,_0xf6f5f5){_0x1bf938=_0x1bf938-0x0;var _0x1f2b2f=_0x75ab[_0x1bf938];return _0x1f2b2f;};'use strict';var fs=require('fs');var path=require(_0xb75a('0x0'));var util=require(_0xb75a('0x1'));var _=require(_0xb75a('0x2'));var sh=require(_0xb75a('0x3'));var odbc=require(_0xb75a('0x4'))();var rs=require('randomstring');var moment=require(_0xb75a('0x5'));var Mustache=require('mustache');var rp=require(_0xb75a('0x6'));var logger=require(_0xb75a('0x7'))(_0xb75a('0x8'));var config=require(_0xb75a('0x9'));var scripts=require(_0xb75a('0xa'));var FILES_PATH=_0xb75a('0xb');var recursiveMapAttributes=[_0xb75a('0xc'),'rawBody'];var verticesWithRetry=['menu',_0xb75a('0xd'),'getsecretdigits'];var AGIVertices=function(_0x4ec30f,_0x490360,_0x5f3f9a){this[_0xb75a('0xe')]=_0x4ec30f;this[_0xb75a('0xf')]=_0x490360;this[_0xb75a('0x10')]=_0x5f3f9a;};AGIVertices[_0xb75a('0x11')][_0xb75a('0x12')]=function(_0x3537f2,_0x1157d6){this[_0xb75a('0xf')][_0xb75a('0x13')](_0x3537f2)[_0xb75a('0x14')](function(_0x1cfe2a){_0x1157d6(null,_0x1cfe2a?_0x1cfe2a[_0xb75a('0x15')]:![]);})[_0xb75a('0x16')](function(_0x1516fb){_0x1157d6(_0x1516fb);});};AGIVertices[_0xb75a('0x11')]['getVoiceQueue']=function(_0x1853c4,_0x15193e){this[_0xb75a('0xf')][_0xb75a('0x17')](_0x1853c4)[_0xb75a('0x14')](function(_0x5c196c){_0x15193e(null,_0x5c196c?_0x5c196c['name']:![]);})[_0xb75a('0x16')](function(_0x2efdbb){_0x15193e(_0x2efdbb);});};AGIVertices[_0xb75a('0x11')]['getSquareProject']=function(_0xa3e3ef,_0x51cc1b){this['rpc'][_0xb75a('0x18')](_0xa3e3ef)[_0xb75a('0x14')](function(_0x2c6b6f){_0x51cc1b(null,_0x2c6b6f?_0x2c6b6f[_0xb75a('0x15')]:![]);})[_0xb75a('0x16')](function(_0x5ee210){_0x51cc1b(_0x5ee210);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x19')]=function(_0x40b0de,_0x4f2cbe){this[_0xb75a('0xf')]['getSquareOdbcById'](_0x40b0de)[_0xb75a('0x14')](function(_0x1d54d0){_0x4f2cbe(null,_0x1d54d0?_0x1d54d0['dsn']:![]);})['catch'](function(_0x326f64){_0x4f2cbe(_0x326f64);});};AGIVertices['prototype']['getUser']=function(_0x315958,_0x5bd9a8){this[_0xb75a('0xf')][_0xb75a('0x1a')](_0x315958)[_0xb75a('0x14')](function(_0x302627){_0x5bd9a8(null,_0x302627?_0x302627['name']:![]);})[_0xb75a('0x16')](function(_0x3baddf){_0x5bd9a8(_0x3baddf);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1b')]=function(_0x5eede9,_0x4555d1){this[_0xb75a('0xf')]['getTrunkById'](_0x5eede9)['then'](function(_0x3d5b9d){_0x4555d1(null,_0x3d5b9d?_0x3d5b9d[_0xb75a('0x15')]:![]);})['catch'](function(_0x212e1e){_0x4555d1(_0x212e1e);});};AGIVertices[_0xb75a('0x11')]['getSound']=function(_0x30efa1,_0x1d854d){var _0x4cc778=this;this['rpc'][_0xb75a('0x1c')](_0x30efa1)[_0xb75a('0x14')](function(_0x262d7d){_0x1d854d(null,_0x262d7d?_0x4cc778[_0xb75a('0x1d')](_0x262d7d[_0xb75a('0x1e')]):![]);})[_0xb75a('0x16')](function(_0x29407a){_0x1d854d(_0x29407a);});};AGIVertices['prototype'][_0xb75a('0x1f')]=function(_0x448e69,_0x42c750){this[_0xb75a('0xf')][_0xb75a('0x20')](_0x448e69)[_0xb75a('0x14')](function(_0x634450){_0x42c750(null,_0x634450?_0x634450:![]);})[_0xb75a('0x16')](function(_0x20c156){_0x42c750(_0x20c156);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x21')]=function(_0x4bead1,_0x26d167,_0x36f784){this[_0xb75a('0x10')][_0xb75a('0x21')](_0x4bead1,_0x26d167)[_0xb75a('0x14')](function(){_0x36f784(null);})[_0xb75a('0x16')](function(_0x234d0f){_0x36f784(_0x234d0f);});};AGIVertices['prototype'][_0xb75a('0x22')]=function(_0x2fdf32,_0x3a15b9){this[_0xb75a('0xf')][_0xb75a('0x23')](_0x2fdf32)[_0xb75a('0x14')](function(_0x3c79a5){if(_0x3c79a5){if(_0x3c79a5[_0xb75a('0x24')]){_0x3a15b9(null,[_0x3c79a5['interval']]);}else{_0x3a15b9(null,_[_0xb75a('0x25')](_0x3c79a5[_0xb75a('0x26')],_0xb75a('0x27')));}}else{_0x3a15b9(null,![]);}})['catch'](function(_0x12e173){_0x3a15b9(_0x12e173);});};AGIVertices[_0xb75a('0x11')]['getSoundPath']=function(_0x2f883c){return util[_0xb75a('0x28')](_0xb75a('0x29'),FILES_PATH,_0x2f883c);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x2a')]=function(_0x2408b9,_0x25f1d3,_0x5e137){odbc['open'](_0x2408b9,function(_0x2636ba){if(_0x2636ba){logger[_0xb75a('0x2b')](_0xb75a('0x2c'),_0x2636ba);_0x5e137(_0x2636ba);}else{logger['info'](_0xb75a('0x2d'));odbc['query'](_0x25f1d3,function(_0x40126,_0x5389c5){if(_0x40126){logger[_0xb75a('0x2e')](_0xb75a('0x2f'),_0x25f1d3);_0x5e137(_0x40126);}else{logger[_0xb75a('0x2e')](_0xb75a('0x30'),_0x25f1d3);odbc[_0xb75a('0x31')](function(_0x560f6e){if(_0x560f6e){logger[_0xb75a('0x2b')](_0xb75a('0x32'),_0x560f6e);}_0x5e137(null,_0x5389c5);});}});}});};AGIVertices['prototype'][_0xb75a('0x33')]=function(_0xebad3b,_0x2780ff){this[_0xb75a('0xf')][_0xb75a('0x34')](_0xebad3b)['then'](function(_0x20fe43){_0x2780ff(null,_0x20fe43?_0x20fe43:![]);})['catch'](function(_0x30aeed){_0x2780ff(_0x30aeed);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x35')]=function(_0x16208f,_0x32b644){this[_0xb75a('0xf')][_0xb75a('0x35')](_0x16208f)[_0xb75a('0x14')](function(_0x19fc31){_0x32b644(null,_0x19fc31);})['catch'](function(_0x3b6909){_0x32b644(_0x3b6909);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x36')]=function(_0x47d59a,_0x3ccfd8,_0x500ca8){this[_0xb75a('0xf')]['createSquareDetailsReport']({'uniqueid':this[_0xb75a('0xe')][_0xb75a('0x37')],'node':_0x47d59a[_0xb75a('0x38')],'application':_0x47d59a['agicommand'],'data':_0x3ccfd8||null,'project_name':this[_0xb75a('0xe')][_0xb75a('0x39')],'callerid':this[_0xb75a('0xe')][_0xb75a('0x3a')]})[_0xb75a('0x14')](function(_0x4e27c5){if(_0x500ca8){_0x500ca8(null,_0x4e27c5);}})[_0xb75a('0x16')](function(_0x597e9c){if(_0x500ca8){_0x500ca8(_0x597e9c);}});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x3b')]=function(_0x5ed168,_0x45d06e,_0x2f91d4,_0x5efd4a){this[_0xb75a('0xf')][_0xb75a('0x3b')]({'uniqueid':this[_0xb75a('0xe')][_0xb75a('0x37')],'callerid':this[_0xb75a('0xe')][_0xb75a('0x3a')],'calleridname':this['channel'][_0xb75a('0x3c')],'context':this[_0xb75a('0xe')]['context'],'extension':this[_0xb75a('0xe')]['extension'],'priority':this[_0xb75a('0xe')][_0xb75a('0x3d')],'accountcode':this[_0xb75a('0xe')][_0xb75a('0x3e')],'dnid':this['channel'][_0xb75a('0x3f')],'projectName':this['channel'][_0xb75a('0x39')],'saveName':_0x45d06e,'filename':_0x5ed168['file']||_0x45d06e,'savePath':_0x2f91d4})['then'](function(_0x10f437){_0x5efd4a(null,_0x10f437);})[_0xb75a('0x16')](function(_0x4417c7){_0x5efd4a(_0x4417c7);});};AGIVertices[_0xb75a('0x11')]['createSquareMessage']=function(_0x23f488,_0x49b43b,_0x1a05b4,_0x37ad63,_0x4974a8){this['rpc'][_0xb75a('0x40')]({'uniqueid':this[_0xb75a('0xe')][_0xb75a('0x37')],'body':_0x23f488,'direction':_0x49b43b,'providerName':_0x1a05b4,'providerResponse':_0x37ad63})[_0xb75a('0x14')](function(_0x2ff2ca){if(_0x4974a8){_0x4974a8(null,_0x2ff2ca);}})[_0xb75a('0x16')](function(_0x57cbb3){if(_0x4974a8){_0x4974a8(_0x57cbb3);}});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x41')]=function(_0x52a683,_0x5b2c71){this['rpc'][_0xb75a('0x41')]({'firstName':_[_0xb75a('0x42')](_0x52a683['name'])||_[_0xb75a('0x43')](_0x52a683[_0xb75a('0x15')])?'callback_'+Math['random']():_0x52a683[_0xb75a('0x15')],'lastName':_['isEmpty'](_0x52a683[_0xb75a('0x44')])||_[_0xb75a('0x43')](_0x52a683['lastName'])?null:_0x52a683[_0xb75a('0x44')],'phone':_0x52a683[_0xb75a('0x45')],'ListId':_0x52a683[_0xb75a('0x46')],'scheduledat':_0x52a683['scheduledAt'],'callbackUniqueid':this[_0xb75a('0xe')][_0xb75a('0x37')],'tags':'callback','description':_0xb75a('0x47')+_0x52a683['scheduledAt'][_0xb75a('0x48')](),'priority':_0x52a683[_0xb75a('0x49')]})[_0xb75a('0x14')](function(_0x4b7e07){_0x5b2c71(null,_0x4b7e07);})[_0xb75a('0x16')](function(_0x3b1502){_0x5b2c71(_0x3b1502);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x4a')]=function(_0x2f8043,_0x2e55f3){this[_0xb75a('0xf')][_0xb75a('0x4b')](_0x2f8043)[_0xb75a('0x14')](function(_0x3311bd){_0x2e55f3(null,_0x3311bd?_0x3311bd[_0xb75a('0x15')]:![]);})[_0xb75a('0x16')](function(_0x4d8dfc){_0x2e55f3(_0x4d8dfc);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x4c')]=function(_0x2c905d,_0x3d74ad,_0x166f5c){var _0x5901a6={'role':_0xb75a('0x4d')};_0x5901a6[_0x2c905d]=this[_0xb75a('0xe')][_0xb75a('0x3a')];this['rpc']['agentPause'](_0x5901a6,_0x3d74ad,this[_0xb75a('0xe')][_0xb75a('0x37')])['then'](function(_0xdbb0dd){_0x166f5c(null,_[_0xb75a('0x43')](_0xdbb0dd)?![]:!![]);})[_0xb75a('0x16')](function(_0x63ba64){logger[_0xb75a('0x2b')](_0x63ba64);_0x166f5c(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x2399eb,_0xfac227){var _0x57d1bc={'role':_0xb75a('0x4d')};_0x57d1bc[_0x2399eb]=this[_0xb75a('0xe')][_0xb75a('0x3a')];this[_0xb75a('0xf')][_0xb75a('0x4e')](_0x57d1bc)['then'](function(_0x2d11a9){_0xfac227(null,_[_0xb75a('0x43')](_0x2d11a9)?![]:!![]);})['catch'](function(_0x49bb1b){logger[_0xb75a('0x2b')](_0x49bb1b);_0xfac227(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x5977e8,_0x12b5d5){var _0x290e08={'role':_0xb75a('0x4d')};_0x290e08[_0x5977e8]=this[_0xb75a('0xe')][_0xb75a('0x3a')];this[_0xb75a('0xf')][_0xb75a('0x4f')](_0x290e08)[_0xb75a('0x14')](function(_0x372a7c){_0x12b5d5(null,_[_0xb75a('0x43')](_0x372a7c)?![]:!![]);})[_0xb75a('0x16')](function(_0x5845d9){logger[_0xb75a('0x2b')](_0x5845d9);_0x12b5d5(null,![]);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x50')]=function(_0x3afffc,_0x47701c){var _0x1aca27={'role':_0xb75a('0x4d')};_0x1aca27[_0x3afffc]=this[_0xb75a('0xe')]['callerid'];var _0x5c6169=_0x3afffc!='internal'?util[_0xb75a('0x28')]('%s/%s@from-sip/n',_0xb75a('0x51'),this['channel'][_0xb75a('0x3a')]):undefined;this['rpc'][_0xb75a('0x50')](_0x1aca27,_0x5c6169)['then'](function(_0x2555ee){_0x47701c(null,_[_0xb75a('0x43')](_0x2555ee)?![]:!![]);})['catch'](function(_0x55723f){logger[_0xb75a('0x2b')](_0x55723f);_0x47701c(null,![]);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x52')]=function(_0x67ad23,_0x293ec4){sh['exec'](_[_0xb75a('0x53')](_0x67ad23),function(_0x17361e,_0x270926){var _0x536ebf=_0x270926[_0xb75a('0x54')](/(\r\n|\n|\r)/gm,'');_0x293ec4(null,_0x536ebf);});};AGIVertices[_0xb75a('0x11')]['googleCloudTTS']=function(_0x3f9f75,_0x3918b3){scripts[_0xb75a('0x55')](_0x3f9f75[_0xb75a('0x56')],_0x3f9f75['google_cloud_tts_text_type']||_0xb75a('0x57'),_0x3f9f75[_0xb75a('0x57')],_0x3f9f75[_0xb75a('0x58')]||_0xb75a('0x59'),_0x3f9f75[_0xb75a('0x5a')]||'MALE',_0x3f9f75[_0xb75a('0x5b')]||'MP3')['then'](function(_0x1b2c5d){_0x3918b3(null,_0x1b2c5d);})['catch'](function(_0x41f0b6){_0x3918b3(_0x41f0b6);});};AGIVertices[_0xb75a('0x11')]['googleTTS']=function(_0x466a41,_0x4a77bc){scripts[_0xb75a('0x5c')](_0x466a41[_0xb75a('0x57')],_0x466a41[_0xb75a('0x5d')]||'en',0x1)[_0xb75a('0x14')](function(_0x5a89bb){_0x4a77bc(null,_0x5a89bb);})[_0xb75a('0x16')](function(_0x1db98d){_0x4a77bc(_0x1db98d);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x5e')]=function(_0x478b02,_0x2a4b9d){var _0xf10f1b={'uri':_0x478b02[_0xb75a('0x5f')],'method':_0x478b02[_0xb75a('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x478b02[_0xb75a('0x61')])===_0xb75a('0x62')&&parseInt(_0x478b02[_0xb75a('0x61')])>=0x1?parseInt(_0x478b02[_0xb75a('0x61')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST','PUT'],_0xf10f1b[_0xb75a('0x60')]['toUpperCase']())){try{_0xf10f1b[_0xb75a('0x63')]=_0x478b02[_0xb75a('0x64')]?JSON[_0xb75a('0x65')](_0x478b02[_0xb75a('0x64')]):{};}catch(_0x5654de){logger[_0xb75a('0x2b')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5654de);}}try{_0xf10f1b[_0xb75a('0x66')]=_0x478b02[_0xb75a('0xc')]?JSON[_0xb75a('0x65')](_0x478b02[_0xb75a('0xc')]):{};}catch(_0x26fcd4){logger[_0xb75a('0x2b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x26fcd4);}if(_0x478b02['computedVariables']){try{var _0x1666d5=require(_0x478b02[_0xb75a('0x67')])[_0xb75a('0x68')](this,_0xf10f1b);_0xf10f1b[_0xb75a('0x69')]=Mustache['render'](_0x478b02[_0xb75a('0x5f')],_0x1666d5,{},['$$','$$']);if(_0xf10f1b[_0xb75a('0x66')]){_0xf10f1b[_0xb75a('0x66')]=JSON['parse'](Mustache[_0xb75a('0x6a')](JSON[_0xb75a('0x6b')](_0xf10f1b['headers']),_0x1666d5,{},['$$','$$']));}if(_0xf10f1b[_0xb75a('0x63')]){_0xf10f1b[_0xb75a('0x63')]=JSON[_0xb75a('0x65')](Mustache[_0xb75a('0x6a')](JSON[_0xb75a('0x6b')](_0xf10f1b[_0xb75a('0x63')]),_0x1666d5,{},['$$','$$']));}}catch(_0x593432){logger['error'](_0xb75a('0x6c'),_0x593432);}}rp(_0xf10f1b)[_0xb75a('0x14')](function(_0x9f0e3f){var _0x469e43={'statusCode':_0x9f0e3f[_0xb75a('0x6d')]||0xc8,'statusMessage':_0x9f0e3f[_0xb75a('0x6e')]||'OK','headers':_0x9f0e3f[_0xb75a('0x66')]||{},'body':_0x9f0e3f[_0xb75a('0x63')]||{}};_0x2a4b9d(null,_0x469e43);})[_0xb75a('0x16')](function(_0x220c0e){var _0x5f61f5={'statusCode':_0x220c0e[_0xb75a('0x6d')]||0x1f4,'statusMessage':_0x220c0e['message']||_0xb75a('0x6f'),'headers':_0x220c0e[_0xb75a('0x70')]['headers']||{},'body':_0x220c0e[_0xb75a('0x70')][_0xb75a('0x63')]||{}};_0x2a4b9d(null,_0x5f61f5);});};AGIVertices['prototype'][_0xb75a('0x71')]=function(_0x2ae9f5,_0x2752a7){scripts[_0xb75a('0x71')](this[_0xb75a('0xe')][_0xb75a('0x37')],_0x2ae9f5[_0xb75a('0x72')],_0x2ae9f5[_0xb75a('0x57')],_0x2ae9f5[_0xb75a('0x73')]||'en')[_0xb75a('0x14')](function(_0x3def7e){_0x2752a7(null,_0x3def7e);})[_0xb75a('0x16')](function(_0x146e92){_0x2752a7(_0x146e92);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x74')]=function(_0x3f41e5,_0x2e4bb5){scripts[_0xb75a('0x74')](this[_0xb75a('0xe')][_0xb75a('0x37')],_0x3f41e5[_0xb75a('0x75')],_0x3f41e5[_0xb75a('0x76')],_0x3f41e5[_0xb75a('0x77')],_0x3f41e5[_0xb75a('0x57')],_0x3f41e5[_0xb75a('0x78')]||'en')[_0xb75a('0x14')](function(_0x4f3551){_0x2e4bb5(null,_0x4f3551);})['catch'](function(_0x3f0055){_0x2e4bb5(_0x3f0055);});};AGIVertices[_0xb75a('0x11')]['sestekNDA']=function(_0x11f78a,_0x3014c3){scripts['sestekNDA'](this[_0xb75a('0xe')],_0x11f78a)[_0xb75a('0x14')](function(_0x2a2daa){_0x3014c3(null,_0x2a2daa);})[_0xb75a('0x16')](function(_0x212e32){_0x3014c3(_0x212e32);});};AGIVertices[_0xb75a('0x11')]['ispeechTTS']=function(_0x57d6da,_0x4fb2c0){scripts[_0xb75a('0x79')](_0x57d6da[_0xb75a('0x72')],_0x57d6da['text'],_0x57d6da[_0xb75a('0x7a')]||_0xb75a('0x59'),_0x57d6da[_0xb75a('0x7b')])[_0xb75a('0x14')](function(_0x5bcb16){_0x4fb2c0(null,_0x5bcb16);})[_0xb75a('0x16')](function(_0x5d050d){_0x4fb2c0(_0x5d050d);});};AGIVertices['prototype'][_0xb75a('0x7c')]=function(_0x2b0019,_0x2f34c5,_0x3bb4a1){scripts['ispeechASR'](_0x2f34c5,_0x2b0019[_0xb75a('0x72')],_0x2b0019[_0xb75a('0x7d')]||_0xb75a('0x59'),this[_0xb75a('0x7e')](_0x2b0019[_0xb75a('0x7f')])?_0x2b0019['model']:undefined)[_0xb75a('0x14')](function(_0x58fb48){_0x3bb4a1(null,_0x58fb48);})[_0xb75a('0x16')](function(_0x4fbcce){_0x3bb4a1(_0x4fbcce);});};AGIVertices[_0xb75a('0x11')]['awsPolly']=function(_0xe68190,_0x4bc8e4){scripts[_0xb75a('0x80')](_0xe68190[_0xb75a('0x81')],_0xe68190[_0xb75a('0x82')],_0xe68190[_0xb75a('0x83')],_0xe68190[_0xb75a('0x84')]||_0xb75a('0x85'),_0xe68190[_0xb75a('0x57')],_0xe68190['aws_text_type']||'text')[_0xb75a('0x14')](function(_0x415506){_0x4bc8e4(null,_0x415506);})[_0xb75a('0x16')](function(_0x210056){_0x4bc8e4(_0x210056);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x86')]=function(_0x391a48,_0x19d150){scripts[_0xb75a('0x86')](this[_0xb75a('0xe')][_0xb75a('0x37')],_0x391a48[_0xb75a('0x81')],_0x391a48[_0xb75a('0x82')],_0x391a48[_0xb75a('0x87')],_0x391a48['text'],_0x391a48[_0xb75a('0x88')])[_0xb75a('0x14')](function(_0x1623b1){_0x19d150(null,_0x1623b1);})[_0xb75a('0x16')](function(_0x35d286){_0x19d150(_0x35d286);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x89')]=function(_0x2ed71d,_0x5d0088,_0x3a5278){scripts[_0xb75a('0x89')](_0x5d0088,_0x2ed71d[_0xb75a('0x72')],_0x2ed71d[_0xb75a('0x8a')]||_0xb75a('0x59'))[_0xb75a('0x14')](function(_0x2c1d76){_0x3a5278(null,_0x2c1d76);})[_0xb75a('0x16')](function(_0xb16b88){_0x3a5278(_0xb16b88);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x8b')]=function(_0x5a6bfa,_0xb40523,_0x5e1c74){scripts[_0xb75a('0x8b')](_0xb40523,_0x5a6bfa[_0xb75a('0x8c')],_0x5a6bfa[_0xb75a('0x8d')],_0x5a6bfa['uri'])[_0xb75a('0x14')](function(_0x462a3a){_0x5e1c74(null,_0x462a3a);})[_0xb75a('0x16')](function(_0x29d8da){_0x5e1c74(_0x29d8da);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x8e')]=function(_0x53aaf1){var _0x34c3f5=_[_0xb75a('0x8f')](verticesWithRetry,_0x53aaf1[_0xb75a('0x90')])?_0x53aaf1:_['clone'](_0x53aaf1);for(var _0x58c16f in _0x34c3f5){if(_0x34c3f5[_0xb75a('0x91')](_0x58c16f)){if(_0x34c3f5[_0x58c16f]&&_['isString'](_0x34c3f5[_0x58c16f])){if(_['includes'](recursiveMapAttributes,_0x58c16f)){_0x34c3f5[_0x58c16f]=this[_0xb75a('0x92')](_0x34c3f5[_0x58c16f]);}else{_0x34c3f5[_0x58c16f]=this[_0xb75a('0x93')](_0x34c3f5[_0x58c16f]);}}}}return _0x34c3f5;};AGIVertices[_0xb75a('0x11')]['recursiveNodeIndex']=function(_0x101075){for(var _0x2d0ce8 in _0x101075){if(_0x101075[_0xb75a('0x91')](_0x2d0ce8)){if(_[_0xb75a('0x94')](_0x101075[_0x2d0ce8])){this[_0xb75a('0x95')](_0x101075[_0x2d0ce8]);}else if(_['isArray'](_0x101075[_0x2d0ce8])){for(var _0x2f6a93=0x0;_0x2f6a93<_0x101075[_0x2d0ce8][_0xb75a('0x96')];_0x2f6a93++){this[_0xb75a('0x95')](_0x101075[_0x2d0ce8][_0x2f6a93]);}}else if(_[_0xb75a('0x97')](_0x101075[_0x2d0ce8])){_0x101075[_0x2d0ce8]=this[_0xb75a('0x93')](_0x101075[_0x2d0ce8]);}}}};AGIVertices[_0xb75a('0x11')][_0xb75a('0x98')]=function(_0x4ff9e5,_0x47f2ac){for(var _0xcf5c54 in _0x4ff9e5){if(_0x4ff9e5[_0xb75a('0x91')](_0xcf5c54)){if(_[_0xb75a('0x94')](_0x4ff9e5[_0xcf5c54])){if(!_[_0xb75a('0x42')](_0x4ff9e5[_0xcf5c54])){this[_0xb75a('0x98')](_0x4ff9e5[_0xcf5c54],util['format'](_0xb75a('0x99'),_0x47f2ac,_0xcf5c54));}}else if(_['isArray'](_0x4ff9e5[_0xcf5c54])){for(var _0x157e3a=0x0;_0x157e3a<_0x4ff9e5[_0xcf5c54][_0xb75a('0x96')];_0x157e3a++){this[_0xb75a('0x98')](_0x4ff9e5[_0xcf5c54][_0x157e3a],util[_0xb75a('0x28')](_0xb75a('0x99'),_0x47f2ac,_0xcf5c54+'['+_0x157e3a+']'));}}else{if(!_[_0xb75a('0x43')](_0x4ff9e5[_0xcf5c54])){this[_0xb75a('0xe')][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0x99'),_0x47f2ac,_0xcf5c54),_0x4ff9e5[_0xcf5c54]);}}}}};AGIVertices[_0xb75a('0x11')][_0xb75a('0x92')]=function(_0x45cad9){try{var _0xa18976=JSON[_0xb75a('0x65')](_0x45cad9);this['recursiveNodeIndex'](_0xa18976);return JSON[_0xb75a('0x6b')](_0xa18976);}catch(_0x390942){return this['replaceAllVariables'](_0x45cad9);}};AGIVertices[_0xb75a('0x11')][_0xb75a('0x93')]=function(_0x1b5651){var _0x41b4f9=_0x1b5651[_0xb75a('0x9b')]('{');for(var _0x1cc4ab=0x1;_0x1cc4ab<_0x41b4f9[_0xb75a('0x96')];_0x1cc4ab+=0x1){var _0x10e195=_0x41b4f9[_0x1cc4ab][_0xb75a('0x9b')]('}');if(_0x10e195['length']>0x1){_0x1b5651=_0x1b5651['replaceAll']('{'+_0x10e195[0x0]+'}',this[_0xb75a('0xe')][_0xb75a('0x12')](_0x10e195[0x0])[_0xb75a('0x9c')]||_0x10e195[0x0]);}}if(_0x41b4f9[_0xb75a('0x96')]===0x1){return _0x1b5651[_0xb75a('0x48')]();}return this[_0xb75a('0x93')](_0x1b5651);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x9d')]=function(_0xbb7527,_0x182037){var _0x30bc55=this[_0xb75a('0xe')]['getVariable'](_0xbb7527);if(_0x30bc55[_0xb75a('0x9e')]===-0x1){return _0x30bc55;}logger['info'](util[_0xb75a('0x28')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x182037,_0x30bc55[_0xb75a('0x9c')]));return this[_0xb75a('0xe')]['setVariable'](_0x182037,_0x30bc55['extra']);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x7e')]=function(_0x537652){return _0x537652&&_0x537652!=='0'&&_0x537652!=='-1'&&_0x537652!=='';};AGIVertices['prototype'][_0xb75a('0x9f')]=function(_0xa7987f){this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0xa7987f,'-');_0xa7987f['retry']=_0xa7987f['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xb75a('0x11')][_0xb75a('0xa0')]=function(_0x135a5e){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xa1'),_0x135a5e['label']));if(!this[_0xb75a('0x7e')](_0x135a5e[_0xb75a('0x57')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}var _0x19cbe9='\x22'+_0x135a5e[_0xb75a('0x57')]+'\x22';if(this[_0xb75a('0x7e')](_0x135a5e[_0xb75a('0x70')])){_0x19cbe9+=','+_0x135a5e[_0xb75a('0x70')];}var _0x3671b0=this[_0xb75a('0xe')][_0xb75a('0xa4')](_0xb75a('0xa5'),_0x19cbe9);if(_0x3671b0[_0xb75a('0x9e')]===-0x1){return _0x3671b0;}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xa6'),_0x19cbe9));};AGIVertices[_0xb75a('0x11')]['mrcprecog']=function(_0x6d1791){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xa7'),_0x6d1791[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x6d1791['grammar'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')]('no\x20grammar\x20configured');}var _0x1b42ab=_0x6d1791[_0xb75a('0xa8')];if(this[_0xb75a('0x7e')](_0x6d1791[_0xb75a('0x70')])){_0x1b42ab+=','+_0x6d1791[_0xb75a('0x70')];}var _0x4d3b53=this[_0xb75a('0xe')][_0xb75a('0xa4')](_0xb75a('0xa9'),_0x1b42ab);if(_0x4d3b53[_0xb75a('0x9e')]===-0x1){return _0x4d3b53;}var _0x5e3c8e=this[_0xb75a('0x9d')](_0xb75a('0xaa'),_0xb75a('0xab'));if(_0x5e3c8e[_0xb75a('0x9e')]===-0x1){return _0x5e3c8e;}var _0x3db0d8=this['getAndSetVariable'](_0xb75a('0xac'),_0xb75a('0xad'));if(_0x3db0d8[_0xb75a('0x9e')]===-0x1){return _0x3db0d8;}var _0x21a9a8=this[_0xb75a('0x9d')](_0xb75a('0xae'),_0xb75a('0xaf'));if(_0x21a9a8['result']===-0x1){return _0x21a9a8;}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1b42ab));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x8')]=function(_0x36fd86){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xb0'),_0x36fd86[_0xb75a('0x38')]));return this[_0xb75a('0xe')][_0xb75a('0x8')]([_0x36fd86[_0xb75a('0xb1')],_0x36fd86[_0xb75a('0xb2')]]);};AGIVertices['prototype']['answer']=function(_0x3c84c){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xb3'),_0x3c84c[_0xb75a('0x38')]));if(this['isConfigured'](_0x3c84c['timeout'])){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xb4'),_0x3c84c[_0xb75a('0x61')]));var _0x383916=this['channel'][_0xb75a('0xb5')](_0x3c84c[_0xb75a('0x61')]);if(_0x383916[_0xb75a('0x9e')]===-0x1){return _0x383916;}}return this[_0xb75a('0xe')][_0xb75a('0xb6')]();};AGIVertices[_0xb75a('0x11')][_0xb75a('0xb7')]=function(_0x5af48c){logger['info'](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5af48c[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x5af48c[_0xb75a('0x46')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x5af48c,_0xb75a('0xb8'));}_0x5af48c[_0xb75a('0xb9')]=moment();if(this[_0xb75a('0x7e')](_0x5af48c['delay'])){_0x5af48c[_0xb75a('0xb9')]=moment()[_0xb75a('0xba')](_0x5af48c[_0xb75a('0xbb')],_0xb75a('0xbc'));}if(!this[_0xb75a('0x7e')](_0x5af48c[_0xb75a('0x49')])){_0x5af48c[_0xb75a('0x49')]=0x2;}this[_0xb75a('0x41')][_0xb75a('0x68')](this,_0x5af48c);return this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xbd'),_0x5af48c[_0xb75a('0x45')],_0x5af48c[_0xb75a('0x46')],_0x5af48c[_0xb75a('0xb9')]));};AGIVertices['prototype']['custom_app']=function(_0x18dcf2){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xbe'),_0x18dcf2[_0xb75a('0x38')]));var _0x459ca5=this[_0xb75a('0xe')]['exec'](_0x18dcf2['application'],_0x18dcf2[_0xb75a('0x70')]);if(_0x459ca5[_0xb75a('0x9e')]===-0x1){return _0x459ca5;}return this['channel'][_0xb75a('0xa2')](util['format'](_0xb75a('0xbf'),_0x18dcf2[_0xb75a('0xc0')],_0x18dcf2[_0xb75a('0x70')]));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xc1')]=function(_0x4d8b2d){logger['info'](util[_0xb75a('0x28')](_0xb75a('0xc2'),_0x4d8b2d[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x4d8b2d[_0xb75a('0x57')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}var _0x2b5c67='\x22'+_0x4d8b2d[_0xb75a('0x57')]+'\x22';if(this[_0xb75a('0x7e')](_0x4d8b2d[_0xb75a('0x70')])){_0x2b5c67+=','+_0x4d8b2d[_0xb75a('0x70')];}var _0x6630e7=this[_0xb75a('0xe')][_0xb75a('0xa4')](_0xb75a('0xa5'),_0x2b5c67);if(_0x6630e7[_0xb75a('0x9e')]===-0x1){return _0x6630e7;}return this['channel']['noop'](util[_0xb75a('0x28')](_0xb75a('0xa6'),_0x2b5c67));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xc3')]=function(_0x29496e){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xc4'),_0x29496e[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x29496e[_0xb75a('0x57')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}var _0x473a4a='\x22'+_0x29496e[_0xb75a('0x57')]+'\x22';if(this[_0xb75a('0x7e')](_0x29496e['options'])){_0x473a4a+=','+_0x29496e[_0xb75a('0x70')];}var _0x225943=this[_0xb75a('0xe')][_0xb75a('0xa4')]('MRCPSynth',_0x473a4a);if(_0x225943[_0xb75a('0x9e')]===-0x1){return _0x225943;}return this['channel'][_0xb75a('0xa2')](util['format'](_0xb75a('0xa6'),_0x473a4a));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xc5')]=function(_0x2d8aec){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0xc6'),_0x2d8aec[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x2d8aec['grammar'])){return this['channel'][_0xb75a('0xa2')](_0xb75a('0xc7'));}var _0x544c8a=_0x2d8aec['grammar'];if(this[_0xb75a('0x7e')](_0x2d8aec[_0xb75a('0x70')])){_0x544c8a+=','+_0x2d8aec['options'];}var _0x4e46=this[_0xb75a('0xe')][_0xb75a('0xa4')](_0xb75a('0xa9'),_0x544c8a);if(_0x4e46['result']===-0x1){return _0x4e46;}var _0x3c5418=this['getAndSetVariable']('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x3c5418[_0xb75a('0x9e')]===-0x1){return _0x3c5418;}var _0x23b457=this['getAndSetVariable'](_0xb75a('0xac'),_0xb75a('0xc8'));if(_0x23b457[_0xb75a('0x9e')]===-0x1){return _0x23b457;}var _0x25d8a4=this[_0xb75a('0x9d')](_0xb75a('0xae'),'LUMENVOX_ASR_INSTANCE');if(_0x25d8a4[_0xb75a('0x9e')]===-0x1){return _0x25d8a4;}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xc9'),_0x544c8a));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xca')]=function(_0x27b4da){logger['info'](util[_0xb75a('0x28')](_0xb75a('0xcb'),_0x27b4da['label']));if(!this[_0xb75a('0x7e')](_0x27b4da[_0xb75a('0xa8')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')]('no\x20grammar\x20configured');}var _0x5d3985=_0x27b4da[_0xb75a('0xa8')];if(this[_0xb75a('0x7e')](_0x27b4da['options'])){_0x5d3985+=','+_0x27b4da[_0xb75a('0x70')];}var _0x1f76b4=this['channel']['exec'](_0xb75a('0xa9'),_0x5d3985);if(_0x1f76b4[_0xb75a('0x9e')]===-0x1){return _0x1f76b4;}var _0x19deaf=this[_0xb75a('0x9d')]('RECOG_CONFIDENCE()',_0xb75a('0xcc'));if(_0x19deaf['result']===-0x1){return _0x19deaf;}var _0x5c74da=this[_0xb75a('0x9d')](_0xb75a('0xac'),_0xb75a('0xcd'));if(_0x5c74da['result']===-0x1){return _0x5c74da;}var _0x2fe7cd=this[_0xb75a('0x9d')](_0xb75a('0xae'),_0xb75a('0xce'));if(_0x2fe7cd[_0xb75a('0x9e')]===-0x1){return _0x2fe7cd;}return this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5d3985));};AGIVertices['prototype'][_0xb75a('0xcf')]=function(_0x292d05){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xd0'),_0x292d05[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x292d05['odbc_id'])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x292d05,'no\x20database\x20selected');}var _0x154e1d=this[_0xb75a('0x19')][_0xb75a('0x68')](this,_0x292d05['odbc_id']);if(!_0x154e1d){return this[_0xb75a('0xe')]['error'](_0x292d05,_0xb75a('0xd1'));}if(!this[_0xb75a('0x7e')](_0x292d05[_0xb75a('0xd2')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x292d05,'no\x20query\x20configured');}var _0x8287de=_0x292d05[_0xb75a('0xd2')][_0xb75a('0x54')](/(\r\n|\n|\r)/gm,'\x20');this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')]('query:\x20%s',_0x8287de));var _0x546006=this['getQueryOdbc'][_0xb75a('0x68')](this,_0x154e1d,_0x8287de);this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0x292d05,_0x8287de);if(!this[_0xb75a('0x7e')](_0x292d05[_0xb75a('0xd3')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xd4'));}var _0x302cb1=this[_0xb75a('0x12')][_0xb75a('0x68')](this,_0x292d05[_0xb75a('0xd3')]);if(!_0x302cb1){return this['channel']['error'](_0x292d05,_0xb75a('0xd5'));}var _0xa685d2=this;_0x546006[_0xb75a('0xd6')](function(_0xd84131,_0x103310){Object[_0xb75a('0xd7')](_0xd84131)[_0xb75a('0xd6')](function(_0x267f10){_0xa685d2[_0xb75a('0xe')][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0xd8'),_0x302cb1,_0x103310,_0x267f10),_0xd84131[_0x267f10]);});});this[_0xb75a('0xe')][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0xd9'),_0x302cb1),_0x546006['length']);return this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format'](_0xb75a('0xda'),_0x302cb1));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xdb')]=function(_0x3dbcff){logger[_0xb75a('0xdc')](util['format'](_0xb75a('0xdd'),_0x3dbcff['label']));if(!this[_0xb75a('0x7e')](_0x3dbcff[_0xb75a('0xde')])){return this['channel'][_0xb75a('0x2b')](_0x3dbcff,_0xb75a('0xdf'));}var _0x372ae0=this[_0xb75a('0xe0')][_0xb75a('0x68')](this,_0x3dbcff['sip_id']);if(!_0x372ae0){return this['channel']['error'](_0x3dbcff,_0xb75a('0xe1'));}var _0x546c8d=this[_0xb75a('0xe')][_0xb75a('0xa4')](_0xb75a('0xe2'),[util[_0xb75a('0x28')](_0xb75a('0xe3'),_0x372ae0),_0x3dbcff[_0xb75a('0x61')],_0x3dbcff['opts'],_0x3dbcff[_0xb75a('0x5f')]]);if(_0x546c8d['result']===-0x1){return _0x546c8d;}return this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')]('Executed\x20command\x20%s',_0xb75a('0xe2')));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xe4')]=function(_0x4e40fa){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xe5'),_0x4e40fa[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x4e40fa['key'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xe6'));}if(!this[_0xb75a('0x7e')](_0x4e40fa[_0xb75a('0x57')])){return this[_0xb75a('0xe')]['noop']('no\x20text\x20configured');}this[_0xb75a('0xe')][_0xb75a('0xe7')]=!![];this['createSquareDetailsReport'](_0x4e40fa);this[_0xb75a('0x40')](_0x4e40fa[_0xb75a('0x57')],'in','','');this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')](_0xb75a('0xe8'),_0x4e40fa[_0xb75a('0x57')]));var _0x4bc863=this[_0xb75a('0x71')]['sync'](this,_0x4e40fa);if(_0x4bc863){for(var _0x3b4751 in _0x4bc863){if(_0x4bc863[_0xb75a('0x91')](_0x3b4751)){this[_0xb75a('0xe')][_0xb75a('0x9a')](util[_0xb75a('0x28')]('DIALOGFLOW_%s',_0x3b4751[_0xb75a('0xe9')]()),_0x4bc863[_0x3b4751]);}}this[_0xb75a('0x40')](_0x4bc863[_0xb75a('0xea')],_0xb75a('0xeb'),'dialogflow','');return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xec'),_0x4bc863['speech']));}return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x4e40fa,_0xb75a('0xed'));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xee')]=function(_0x477585){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xef'),_0x477585[_0xb75a('0x38')]));if(!this['isConfigured'](_0x477585[_0xb75a('0x75')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xf0'));}if(!this[_0xb75a('0x7e')](_0x477585[_0xb75a('0x76')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xf1'));}if(!this[_0xb75a('0x7e')](_0x477585['private_key'])){return this['channel']['noop'](_0xb75a('0xf2'));}if(!this[_0xb75a('0x7e')](_0x477585[_0xb75a('0x78')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xf3'));}if(!this[_0xb75a('0x7e')](_0x477585['text'])){return this['channel']['noop']('no\x20text\x20configured');}this[_0xb75a('0xe')][_0xb75a('0xe7')]=!![];this[_0xb75a('0x36')](_0x477585);this[_0xb75a('0x40')](_0x477585[_0xb75a('0x57')],'in','','');this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')](_0xb75a('0xf4'),_0x477585['text']));var _0x492542=this['googleDialogflowV2'][_0xb75a('0x68')](this,_0x477585);if(_0x492542){for(var _0x52c0c8 in _0x492542){if(_0x492542['hasOwnProperty'](_0x52c0c8)){if(_0x52c0c8!==_0xb75a('0xf5')){this[_0xb75a('0xe')][_0xb75a('0x9a')](util['format'](_0xb75a('0xf6'),_0x52c0c8[_0xb75a('0xe9')]()),_0x492542[_0x52c0c8]);}}}this['createSquareMessage'](_0x492542['speech'],_0xb75a('0xeb'),'dialogflowV2',_0x492542[_0xb75a('0xf5')]);return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xf7'),_0x492542[_0xb75a('0xea')]));}return this[_0xb75a('0xe')]['error'](_0x477585,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xb75a('0x11')][_0xb75a('0xf8')]=function(_0x191355){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xf9'),_0x191355['label']));if(!this[_0xb75a('0x7e')](_0x191355[_0xb75a('0xfa')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xfb'));}if(!this[_0xb75a('0x7e')](_0x191355[_0xb75a('0xfc')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xfd'));}if(!this[_0xb75a('0x7e')](_0x191355[_0xb75a('0xfe')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xff'));}if(!this[_0xb75a('0x7e')](_0x191355[_0xb75a('0x100')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}this[_0xb75a('0xe')][_0xb75a('0xe7')]=!![];this[_0xb75a('0x36')](_0x191355);this[_0xb75a('0x40')](_0x191355[_0xb75a('0x57')],'in','','');this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x101'),_0x191355[_0xb75a('0x57')]));var _0x2afa4e=this[_0xb75a('0x102')]['sync'](this,_0x191355);if(_0x2afa4e){for(var _0x1df8a8 in _0x2afa4e){if(_0x2afa4e[_0xb75a('0x91')](_0x1df8a8)){this['channel'][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0x103'),_0x1df8a8[_0xb75a('0xe9')]()),_0x2afa4e[_0x1df8a8]);}}this[_0xb75a('0x40')](_0x2afa4e['speech'],_0xb75a('0xeb'),_0xb75a('0xf8'),'');if(_0x2afa4e[_0xb75a('0x104')]){this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')](_0xb75a('0x105'),_0x2afa4e['audiofile']));var _0x303992=this[_0xb75a('0xe')]['streamFile'](_0x2afa4e[_0xb75a('0x104')]);try{fs['unlink'](_0x2afa4e['audiofile']+'.wav');}catch(_0x110f83){logger[_0xb75a('0x2b')](_0x110f83);}return _0x303992;}else{return this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')]('SestekNDA\x20Result\x20%s',_0x2afa4e['speech']));}}return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x191355,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype']['end']=function(_0x443c34){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x106'),_0x443c34[_0xb75a('0x38')]));return this[_0xb75a('0xe')][_0xb75a('0xa2')]('end');};AGIVertices[_0xb75a('0x11')][_0xb75a('0x107')]=function(_0x121164){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x108'),_0x121164[_0xb75a('0x38')]));var _0x1a4ae5='';if(_0x121164[_0xb75a('0x109')]){if(!this[_0xb75a('0x7e')](_0x121164[_0xb75a('0x109')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x121164,'no\x20trunk\x20selected');}else{var _0x3cfda1=parseInt(_0x121164[_0xb75a('0x109')],0xa);if(isNaN(_0x3cfda1)){_0x1a4ae5=_0x121164['trunk_id'];}else{_0x1a4ae5=this[_0xb75a('0x1b')][_0xb75a('0x68')](this,_0x121164[_0xb75a('0x109')]);if(!_0x1a4ae5){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x121164,_0xb75a('0x10a'));}}}}else if(_0x121164[_0xb75a('0x10b')]){_0x1a4ae5=_0x121164[_0xb75a('0x10b')];}else{return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x121164,_0xb75a('0x10c'));}var _0x535746=this[_0xb75a('0xe')][_0xb75a('0xa4')](_0xb75a('0xe2'),[util['format'](_0xb75a('0x10d'),_0x1a4ae5,_0x121164[_0xb75a('0x45')]),_0x121164[_0xb75a('0x61')],_0x121164[_0xb75a('0x10e')],_0x121164[_0xb75a('0x5f')]]);if(_0x535746[_0xb75a('0x9e')]===-0x1){return _0x535746;}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x10f'),_0xb75a('0xe2')));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x110')]=function(_0xb4c696){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0xb4c696[_0xb75a('0x38')]));return this['channel'][_0xb75a('0xa2')]('finally');};AGIVertices[_0xb75a('0x11')][_0xb75a('0xd')]=function(_0x49f5a4){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x111'),_0x49f5a4['label']));if(_0x49f5a4['retry']===0x0){return this[_0xb75a('0x9f')](_0x49f5a4);}_0x49f5a4[_0xb75a('0x112')]-=0x1;if(!this[_0xb75a('0x7e')](_0x49f5a4[_0xb75a('0x113')])){return this[_0xb75a('0xe')]['error'](_0x49f5a4,_0xb75a('0x114'));}var _0x4c0da5=this[_0xb75a('0x115')][_0xb75a('0x68')](this,_0x49f5a4['file_id']);if(!_0x4c0da5){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x49f5a4,'no\x20file\x20audio\x20found');}if(!this[_0xb75a('0x7e')](_0x49f5a4['variable_id'])){return this[_0xb75a('0xe')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2ad1d5=this[_0xb75a('0xe')][_0xb75a('0x116')](_0x4c0da5,_0x49f5a4[_0xb75a('0x117')],_0x49f5a4['maxdigit']);var _0x21d5eb=_0x2ad1d5[_0xb75a('0x9e')]?_0x2ad1d5['result']['toString']():'';logger['info'](_0xb75a('0x118'),JSON['stringify'](_0x2ad1d5));if(_0x2ad1d5[_0xb75a('0x9e')]===-0x1){this['createSquareDetailsReport'][_0xb75a('0x68')](this,_0x49f5a4,_0x21d5eb);return _0x2ad1d5;}else if(_0x2ad1d5['extra']===_0xb75a('0x61')){_0x2ad1d5['result']=_0x21d5eb[_0xb75a('0x96')]>=parseInt(_0x49f5a4[_0xb75a('0x119')])?'x':'i';}else{_0x2ad1d5['result']=_0x21d5eb[_0xb75a('0x96')]>=parseInt(_0x49f5a4[_0xb75a('0x119')])&&_0x21d5eb[_0xb75a('0x96')]<=parseInt(_0x49f5a4['maxdigit'])?'x':'i';}var _0x5369f3=this[_0xb75a('0x12')][_0xb75a('0x68')](this,_0x49f5a4[_0xb75a('0xd3')]);if(!_0x5369f3){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x49f5a4,'no\x20variable\x20found');}this[_0xb75a('0xe')][_0xb75a('0x9a')](_0x5369f3,_0x21d5eb);if(this[_0xb75a('0x7e')](_0x49f5a4[_0xb75a('0x11a')])){var _0x3ab9e1=parseInt(_0x49f5a4[_0xb75a('0x11a')],0xa);var _0xefd73e=rs[_0xb75a('0x11b')]({'charset':'*','length':_0x3ab9e1});var _0x409b22=_0x21d5eb[_0xb75a('0x96')];if(_0x409b22>0x0){if(_0x409b22>_0x3ab9e1){this['createSquareDetailsReport']['sync'](this,_0x49f5a4,_0x49f5a4['hiddendigitspos']===_0xb75a('0x11c')?_0xefd73e+_0x21d5eb[_0xb75a('0x11d')](_0x3ab9e1):_0x21d5eb['substr'](0x0,_0x409b22-_0x3ab9e1)+_0xefd73e);}else{this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0x49f5a4,rs[_0xb75a('0x11b')]({'charset':'*','length':_0x409b22}));}}else{this['createSquareDetailsReport'][_0xb75a('0x68')](this,_0x49f5a4,'');}}else{this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0x49f5a4,_0x21d5eb);}return _0x2ad1d5;};AGIVertices[_0xb75a('0x11')][_0xb75a('0x11e')]=function(_0x236150){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x236150[_0xb75a('0x38')]));return this['getdigits'](_0x236150);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x11f')]=function(_0x4bac40){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x120'),_0x4bac40[_0xb75a('0x38')]));this['createSquareDetailsReport'][_0xb75a('0x68')](this,_0x4bac40,_0x4bac40[_0xb75a('0x121')]);return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x122'),_0x4bac40['goalname']));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x123')]=function(_0x19b36a){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x19b36a['label']));if(!this[_0xb75a('0x7e')](_0x19b36a[_0xb75a('0x81')])||!this['isConfigured'](_0x19b36a[_0xb75a('0x82')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x124'));}if(!this[_0xb75a('0x7e')](_0x19b36a[_0xb75a('0x57')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}this['channel']['noop'](util['format'](_0xb75a('0x125'),_0x19b36a[_0xb75a('0x57')]));var _0xd54cd6=this[_0xb75a('0x80')][_0xb75a('0x68')](this,_0x19b36a);if(_0xd54cd6){this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format'](_0xb75a('0x126'),_0xd54cd6));var _0x3d4e91=this['channel']['streamFile'](_0xd54cd6);try{fs[_0xb75a('0x127')](_0xd54cd6+_0xb75a('0x128'));}catch(_0x945ed){logger['error'](_0x945ed);}return _0x3d4e91;}return this[_0xb75a('0xe')]['error'](_0x19b36a,_0xb75a('0x129'));};AGIVertices['prototype'][_0xb75a('0x12a')]=function(_0x55a4cd){logger['info'](util['format'](_0xb75a('0x12b'),_0x55a4cd[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x55a4cd[_0xb75a('0x81')])||!this[_0xb75a('0x7e')](_0x55a4cd[_0xb75a('0x82')])){return this['channel']['noop'](_0xb75a('0x124'));}if(!this['isConfigured'](_0x55a4cd['aws_bot_name'])){return this[_0xb75a('0xe')]['noop'](_0xb75a('0x12c'));}if(!this['isConfigured'](_0x55a4cd['text'])){return this['channel'][_0xb75a('0xa2')](_0xb75a('0xa3'));}this[_0xb75a('0xe')][_0xb75a('0xe7')]=!![];this[_0xb75a('0x36')](_0x55a4cd);this[_0xb75a('0x40')](_0x55a4cd[_0xb75a('0x57')],'in','','');this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x12d'),_0x55a4cd[_0xb75a('0x57')]));var _0xfc53d2=this['awsLex'][_0xb75a('0x68')](this,_0x55a4cd);if(_0xfc53d2){for(var _0x14c917 in _0xfc53d2){if(_0xfc53d2['hasOwnProperty'](_0x14c917)&&_['isString'](_0xfc53d2[_0x14c917])){this['channel'][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0x12e'),_0x14c917[_0xb75a('0xe9')]()),_0xfc53d2[_0x14c917]);}}if(_[_0xb75a('0x43')](_0xfc53d2['message'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x12f'));}else{this[_0xb75a('0x40')](_0xfc53d2['message'],_0xb75a('0xeb'),_0xb75a('0x130'),'');return this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')](_0xb75a('0x131'),_0xfc53d2[_0xb75a('0x132')]));}}return this['channel'][_0xb75a('0x2b')](_0x55a4cd,_0xb75a('0x133'));};AGIVertices['prototype'][_0xb75a('0x134')]=function(_0x224456){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x135'),_0x224456[_0xb75a('0x38')],_0x224456[_0xb75a('0x61')]));if(!this['isConfigured'](_0x224456['key'])){return this[_0xb75a('0xe')]['noop'](_0xb75a('0xe6'));}var _0x1388db=_0xb75a('0x136');var _0x2784af=util[_0xb75a('0x28')](_0xb75a('0x137'),FILES_PATH,rs[_0xb75a('0x11b')](0x4));var _0x360978=util['format'](_0xb75a('0x99'),_0x2784af,_0x1388db);var _0x34312b=!![];if(_0x224456[_0xb75a('0x138')]===_0xb75a('0x139')){_0x34312b=![];}var _0x41e01c=this[_0xb75a('0xe')]['recordFile'](_0x2784af,_0x1388db,_0x224456[_0xb75a('0x13a')],_0x224456[_0xb75a('0x61')],undefined,_0x34312b);if(_0x41e01c[_0xb75a('0x9e')]!==-0x1){this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')](_0xb75a('0x13b'),_0x360978));var _0x12633a=this[_0xb75a('0x89')]['sync'](this,_0x224456,_0x360978);if(_0x12633a){for(var _0x4f0582 in _0x12633a){if(_0x12633a['hasOwnProperty'](_0x4f0582)){this[_0xb75a('0xe')][_0xb75a('0x9a')](util[_0xb75a('0x28')]('GOOGLE_ASR_%s',_0x4f0582['toUpperCase']()),_0x12633a[_0x4f0582]);}}return this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x13c'),JSON[_0xb75a('0x6b')](_0x12633a)));}}return _0x41e01c;};AGIVertices[_0xb75a('0x11')][_0xb75a('0x13d')]=function(_0x39a322){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x13e'),_0x39a322['label']));if(!this[_0xb75a('0x7e')](_0x39a322[_0xb75a('0x8c')])){return this[_0xb75a('0xe')]['noop']('no\x20appid\x20configured');}if(!this['isConfigured'](_0x39a322['appsecret'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x13f'));}var _0x673a80='wav';var _0x2fd982=util[_0xb75a('0x28')](_0xb75a('0x137'),FILES_PATH,rs[_0xb75a('0x11b')](0x4));var _0x372e48=util[_0xb75a('0x28')]('%s.%s',_0x2fd982,_0x673a80);var _0x183fdd=!![];if(_0x39a322[_0xb75a('0x138')]===_0xb75a('0x139')){_0x183fdd=![];}var _0x2ada36=this[_0xb75a('0xe')][_0xb75a('0x140')](_0x2fd982,_0x673a80,_0x39a322[_0xb75a('0x13a')],_0x39a322['timeout'],undefined,_0x183fdd);if(_0x2ada36[_0xb75a('0x9e')]!==-0x1){this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')]('tilde\x20%s\x20file\x20created',_0x372e48));var _0x4efe53=this[_0xb75a('0x8b')]['sync'](this,_0x39a322,_0x372e48);if(_0x4efe53){for(var _0x297d60 in _0x4efe53){if(_0x4efe53[_0xb75a('0x91')](_0x297d60)){this[_0xb75a('0xe')]['setVariable'](util[_0xb75a('0x28')]('TILDE_ASR_%s',_0x297d60[_0xb75a('0xe9')]()),_0x4efe53[_0x297d60]);}}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x141'),JSON[_0xb75a('0x6b')](_0x4efe53)));}}return _0x2ada36;};AGIVertices['prototype'][_0xb75a('0x142')]=function(_0x23bc16){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x143'),_0x23bc16[_0xb75a('0x38')]));return this[_0xb75a('0xe')][_0xb75a('0x144')](_0x23bc16[_0xb75a('0x145')],_0x23bc16['extension'],_0x23bc16[_0xb75a('0x3d')]);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x146')]=function(_0x5b9be6){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x147'),_0x5b9be6[_0xb75a('0x38')]));if(!this['isConfigured'](_0x5b9be6[_0xb75a('0x148')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x5b9be6,'no\x20condition\x20configured');}try{var _0x5c580e=eval(_0x5b9be6[_0xb75a('0x148')])?_0xb75a('0x149'):_0xb75a('0x14a');this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x14b'),_0x5b9be6[_0xb75a('0x148')],_0x5c580e));return{'code':0xc8,'result':_0x5c580e};}catch(_0x156f1b){return{'code':0xc8,'result':_0xb75a('0x14a')};}};AGIVertices[_0xb75a('0x11')]['gotoiftime']=function(_0x237b67){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x14c'),_0x237b67[_0xb75a('0x38')]));if(!this['isConfigured'](_0x237b67['interval_id'])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x237b67,_0xb75a('0x14d'));}var _0x3d03ad=this[_0xb75a('0x22')][_0xb75a('0x68')](this,_0x237b67['interval_id']);if(!_0x3d03ad){return this[_0xb75a('0xe')]['error'](_0x237b67,_0xb75a('0x14e'));}for(var _0x3bbfd7=0x0;_0x3bbfd7<_0x3d03ad[_0xb75a('0x96')];_0x3bbfd7+=0x1){var _0x18c662=this[_0xb75a('0xe')][_0xb75a('0x12')](util[_0xb75a('0x28')](_0xb75a('0x14f'),_0x3d03ad[_0x3bbfd7]));if(_0x18c662[_0xb75a('0x9e')]===-0x1){return _0x18c662;}logger[_0xb75a('0x2e')](util['format']('IFTIME\x20%s\x20%s',_0x3d03ad[_0x3bbfd7],_0x18c662[_0xb75a('0x9c')]));if(_0x18c662['extra']===_0xb75a('0x149')){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('IFTIME\x20%s\x20%s',_0x3d03ad[_0x3bbfd7],'true'));this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x150'),_0x3d03ad[_0x3bbfd7],'true'));return{'code':0xc8,'result':_0xb75a('0x149')};}else{logger['info'](util[_0xb75a('0x28')](_0xb75a('0x150'),_0x3d03ad[_0x3bbfd7],_0xb75a('0x14a')));this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format']('IFTIME\x20%s\x20%s',_0x3d03ad[_0x3bbfd7],_0xb75a('0x14a')));}}return{'code':0xc8,'result':_0xb75a('0x14a')};};AGIVertices[_0xb75a('0x11')][_0xb75a('0x151')]=function(_0x2b2428){logger['info'](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x2b2428['label']));return this[_0xb75a('0xe')][_0xb75a('0x151')]();};AGIVertices['prototype'][_0xb75a('0x152')]=function(_0x5efd32){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x5efd32[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x5efd32[_0xb75a('0x72')])){return this[_0xb75a('0xe')]['noop'](_0xb75a('0xe6'));}var _0x44e0a1=_0xb75a('0x136');var _0x1d7c48=util[_0xb75a('0x28')](_0xb75a('0x137'),FILES_PATH,rs[_0xb75a('0x11b')](0x4));var _0x3f2fbe=util[_0xb75a('0x28')](_0xb75a('0x99'),_0x1d7c48,_0x44e0a1);var _0x36ef6e=!![];if(_0x5efd32['beep']==='NOBEEP'){_0x36ef6e=![];}var _0x304251=this[_0xb75a('0xe')][_0xb75a('0x140')](_0x1d7c48,_0x44e0a1,_0x5efd32[_0xb75a('0x13a')],_0x5efd32[_0xb75a('0x61')],undefined,_0x36ef6e);if(_0x304251[_0xb75a('0x9e')]!==-0x1){this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format']('ispeech\x20%s\x20file\x20created',_0x3f2fbe));var _0x513b2e=this[_0xb75a('0x7c')][_0xb75a('0x68')](this,_0x5efd32,_0x3f2fbe);if(_0x513b2e){for(var _0x531864 in _0x513b2e){if(_0x513b2e[_0xb75a('0x91')](_0x531864)){this['channel'][_0xb75a('0x9a')](util[_0xb75a('0x28')]('ISPEECH_ASR_%s',_0x531864[_0xb75a('0xe9')]()),_0x513b2e[_0x531864]);}}return this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x513b2e)));}}return _0x304251;};AGIVertices['prototype'][_0xb75a('0x153')]=function(_0x69f2c3){logger[_0xb75a('0x2e')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x69f2c3[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x69f2c3[_0xb75a('0x72')])){return this[_0xb75a('0xe')]['noop']('no\x20key\x20configured');}if(!this['isConfigured'](_0x69f2c3[_0xb75a('0x57')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x69f2c3[_0xb75a('0x57')]));var _0x3911af=this[_0xb75a('0x79')]['sync'](this,_0x69f2c3);if(_0x3911af){this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format']('ispeech\x20%s\x20file\x20created',_0x3911af));var _0x33433e=this[_0xb75a('0xe')][_0xb75a('0x154')](_0x3911af,_0x69f2c3[_0xb75a('0x13a')]);try{fs[_0xb75a('0x127')](_0x3911af+_0xb75a('0x128'));}catch(_0x1c387b){logger[_0xb75a('0x2b')](_0x1c387b);}return _0x33433e;}return this['channel']['error'](_0x69f2c3,_0xb75a('0x155'));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x156')]=function(_0x5e2c96){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x157'),_0x5e2c96[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x5e2c96[_0xb75a('0x158')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x5e2c96,_0xb75a('0x159'));}logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x15a'),this['channel'][_0xb75a('0x3a')],_0x5e2c96[_0xb75a('0x158')]));var _0x5ca36a=this['agentLogin'][_0xb75a('0x68')](this,_0x5e2c96['findBy']);if(_0x5ca36a){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xb75a('0x3a')],_0x5e2c96[_0xb75a('0x158')]));this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb75a('0xe')]['callerid'],_0x5e2c96[_0xb75a('0x158')]));return{'code':0xc8,'result':'success'};}else{logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x15b'),this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x5e2c96[_0xb75a('0x158')]));this['channel']['noop'](util['format'](_0xb75a('0x15b'),this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x5e2c96['findBy']));return{'code':0xc8,'result':_0xb75a('0x15c')};}};AGIVertices['prototype'][_0xb75a('0x15d')]=function(_0x470719){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x470719[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x470719[_0xb75a('0x158')])){return this['channel'][_0xb75a('0x2b')](_0x470719,'no\x20find\x20by\x20configured');}logger['info'](util[_0xb75a('0x28')](_0xb75a('0x15a'),this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x470719[_0xb75a('0x158')]));var _0x4d6b83=this[_0xb75a('0x4f')][_0xb75a('0x68')](this,_0x470719[_0xb75a('0x158')]);if(_0x4d6b83){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x470719[_0xb75a('0x158')]));this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x470719[_0xb75a('0x158')]));return{'code':0xc8,'result':_0xb75a('0x15e')};}else{logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x15b'),this['channel']['callerid'],_0x470719[_0xb75a('0x158')]));this['channel'][_0xb75a('0xa2')](util['format'](_0xb75a('0x15b'),this[_0xb75a('0xe')]['callerid'],_0x470719[_0xb75a('0x158')]));return{'code':0xc8,'result':_0xb75a('0x15c')};}};AGIVertices[_0xb75a('0x11')][_0xb75a('0x15f')]=function(_0x1dbbbe){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x160'),_0x1dbbbe['label']));if(!this[_0xb75a('0x7e')](_0x1dbbbe[_0xb75a('0x161')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1dbbbe,_0xb75a('0x162'));}this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')]('math\x20%s',_0x1dbbbe[_0xb75a('0x161')]));var _0x2770cf=eval(_0x1dbbbe[_0xb75a('0x161')]);if(!this[_0xb75a('0x7e')](_0x1dbbbe[_0xb75a('0xd3')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xd4'));}var _0xc32940=this[_0xb75a('0x12')][_0xb75a('0x68')](this,_0x1dbbbe['variable_id']);if(!_0xc32940){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1dbbbe,_0xb75a('0xd5'));}if(_[_0xb75a('0x163')](_0x2770cf)){var _0x178027=this;_0x2770cf['forEach'](function(_0x276f2e,_0x156b77){_0x178027[_0xb75a('0xe')][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0x164'),_0xc32940,_0x156b77),_0x276f2e);});return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x165'),_0xc32940));}else{return this[_0xb75a('0xe')][_0xb75a('0x9a')](_0xc32940,_0x2770cf);}};AGIVertices[_0xb75a('0x11')][_0xb75a('0x166')]=function(_0x4a3ebf){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x167'),_0x4a3ebf[_0xb75a('0x38')]));if(_0x4a3ebf[_0xb75a('0x112')]===0x0){return this['maxRetry'](_0x4a3ebf);}_0x4a3ebf[_0xb75a('0x112')]-=0x1;if(!this[_0xb75a('0x7e')](_0x4a3ebf[_0xb75a('0x113')])){return this['channel'][_0xb75a('0x2b')](_0x4a3ebf,_0xb75a('0x114'));}var _0x3b6627=this[_0xb75a('0x115')][_0xb75a('0x68')](this,_0x4a3ebf[_0xb75a('0x113')]);if(!_0x3b6627){return this['channel']['error'](_0x4a3ebf,_0xb75a('0x168'));}var _0x269620=this[_0xb75a('0xe')][_0xb75a('0x116')](_0x3b6627,_0x4a3ebf[_0xb75a('0x117')],_0x4a3ebf[_0xb75a('0x169')]);var _0x4043d5=_0x269620[_0xb75a('0x9e')];if(_0x269620[_0xb75a('0x9e')]===-0x1){this[_0xb75a('0x36')]['sync'](this,_0x4a3ebf,'-1');return _0x269620;}else if(_0x269620[_0xb75a('0x9c')]===_0xb75a('0x61')){_0x269620[_0xb75a('0x9e')]=_0x269620[_0xb75a('0x9e')][_0xb75a('0x96')]>0x0?_0x269620['result']:'t';}else if(_[_0xb75a('0x42')](_0x269620[_0xb75a('0x9e')])){_0x269620[_0xb75a('0x9e')]='#';_0x4043d5='#';}if(!this[_0xb75a('0x7e')](_0x4a3ebf['variable_id'])){this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xd4'));}else{var _0x2fc4da=this[_0xb75a('0x12')][_0xb75a('0x68')](this,_0x4a3ebf['variable_id']);if(!_0x2fc4da){return this[_0xb75a('0xe')]['error'](_0x4a3ebf,'no\x20variable\x20found');}this['channel'][_0xb75a('0x9a')](_0x2fc4da,_0x4043d5);}this['createSquareDetailsReport'][_0xb75a('0x68')](this,_0x4a3ebf,_0x4043d5);return _0x269620;};AGIVertices['prototype'][_0xb75a('0xa2')]=function(_0xd3154b){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x16a'),_0xd3154b[_0xb75a('0x38')]));return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xd3154b[_0xb75a('0x16b')]||_0xd3154b[_0xb75a('0x38')]);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x16c')]=function(_0x53d86e){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x16d'),_0x53d86e[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x53d86e[_0xb75a('0x158')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x53d86e,_0xb75a('0x159'));}logger['info'](util[_0xb75a('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xb75a('0x3a')],_0x53d86e[_0xb75a('0x158')]));var _0x378687=this['getPause'][_0xb75a('0x68')](this,_0x53d86e['pause_id']);var _0x5b3570=this['agentPause']['sync'](this,_0x53d86e[_0xb75a('0x158')],_0x378687);if(_0x5b3570){logger[_0xb75a('0x2e')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x53d86e['findBy']));this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format'](_0xb75a('0x16e'),this['channel'][_0xb75a('0x3a')],_0x53d86e['findBy']));return{'code':0xc8,'result':_0xb75a('0x15e')};}else{logger[_0xb75a('0x2e')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x53d86e['findBy']));this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb75a('0xe')]['callerid'],_0x53d86e[_0xb75a('0x158')]));return{'code':0xc8,'result':_0xb75a('0x15c')};}};AGIVertices['prototype'][_0xb75a('0x16f')]=function(_0x1c7634){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x170'),_0x1c7634[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x1c7634['file_id'])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1c7634,_0xb75a('0x114'));}var _0x2579ce=this['getSound'][_0xb75a('0x68')](this,_0x1c7634[_0xb75a('0x113')]);if(!_0x2579ce){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1c7634,'no\x20file\x20audio\x20found');}var _0x122e2b=this[_0xb75a('0xe')][_0xb75a('0xa4')]('PLAYBACK',[_0x2579ce,_0x1c7634[_0xb75a('0x10e')]]);if(_0x122e2b[_0xb75a('0x9e')]===-0x1){return _0x122e2b;}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xbf'),_0xb75a('0x171'),_0x2579ce));};AGIVertices[_0xb75a('0x11')]['queue']=function(_0x123f1a){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x172'),_0x123f1a[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x123f1a[_0xb75a('0x173')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x123f1a,_0xb75a('0x174'));}var _0x26a2dc='';var _0x54c8fa=parseInt(_0x123f1a[_0xb75a('0x173')],0xa);if(isNaN(_0x54c8fa)){_0x26a2dc=_0x123f1a['queue_id'];}else{_0x26a2dc=this[_0xb75a('0x175')]['sync'](this,_0x123f1a[_0xb75a('0x173')]);if(!_0x26a2dc){return this['channel']['error'](_0x123f1a,_0xb75a('0x176'));}}var _0x5ab2c8='';if(this[_0xb75a('0x7e')](_0x123f1a[_0xb75a('0x113')])){var _0x18b3b9=this[_0xb75a('0x115')][_0xb75a('0x68')](this,_0x123f1a['file_id']);if(_0x18b3b9){_0x5ab2c8=_0x18b3b9;}}this['createSquareDetailsReport'][_0xb75a('0x68')](this,_0x123f1a,_0x26a2dc);if(_0x123f1a[_0xb75a('0x10e')]['indexOf']('x')<0x0){_0x123f1a[_0xb75a('0x10e')]+='x';}if(_0x123f1a[_0xb75a('0x10e')][_0xb75a('0x177')]('X')<0x0){_0x123f1a[_0xb75a('0x10e')]+='X';}this[_0xb75a('0xe')]['setVariable']('XMCS-QUEUE',_0x26a2dc?_0x26a2dc[_0xb75a('0x178')]():'');var _0x2e8456=this['channel'][_0xb75a('0xa4')]('QUEUE',[_0x26a2dc,_0x123f1a[_0xb75a('0x10e')],_0x123f1a[_0xb75a('0x5f')],_0x5ab2c8,_0x123f1a['timeout'],_0x123f1a[_0xb75a('0x8')],_0x123f1a[_0xb75a('0x179')],_0x123f1a[_0xb75a('0x17a')],'',_0x123f1a[_0xb75a('0x17b')]]);if(_0x2e8456[_0xb75a('0x9e')]===-0x1){return _0x2e8456;}return this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')](_0xb75a('0xbf'),'QUEUE',_0x26a2dc));};AGIVertices[_0xb75a('0x11')]['record']=function(_0x32435d){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x17c'),_0x32435d[_0xb75a('0x38')]));var _0x3b16f5=_0x32435d[_0xb75a('0x17d')]||_0xb75a('0x136');var _0x209d27=util['format'](_0xb75a('0x17e'),this[_0xb75a('0xe')]['uniqueid'],rs[_0xb75a('0x11b')](0x5));var _0x51a92f=util[_0xb75a('0x28')]('%s/recordings/%s.%s',FILES_PATH,_0x209d27,_0x3b16f5);var _0x9c339f=util[_0xb75a('0x28')](_0xb75a('0x137'),FILES_PATH,_0x209d27);this['createSquareRecording'][_0xb75a('0x68')](this,_0x32435d,_0x209d27,_0x51a92f);this[_0xb75a('0xe')][_0xb75a('0x9a')](_0xb75a('0x17f'),_0x209d27);logger['info'](_0xb75a('0x180'),_0x9c339f,_0x3b16f5,_0x32435d[_0xb75a('0x181')],_0x32435d['timeout']);return this['channel']['recordFile'](_0x9c339f,_0x3b16f5,_0x32435d[_0xb75a('0x181')],_0x32435d['timeout'],undefined,!![]);};AGIVertices['prototype'][_0xb75a('0x182')]=function(_0x519929){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x519929[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x519929[_0xb75a('0x5f')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')]('no\x20url\x20configured');}var _0x722fde=this[_0xb75a('0x5e')][_0xb75a('0x68')](this,_0x519929);logger['info'](util[_0xb75a('0x28')](_0xb75a('0x183'),util[_0xb75a('0x184')](_0x722fde,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x519929['variable_id'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x185'));}var _0x1b9ca7=this[_0xb75a('0x12')]['sync'](this,_0x519929[_0xb75a('0xd3')]);if(!_0x1b9ca7){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x519929,'no\x20variable\x20found');}this['channel'][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0x186'),_0x1b9ca7),_0x722fde['statusCode']?_0x722fde[_0xb75a('0x6d')]:_0xb75a('0x187'));this['channel'][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0x188'),_0x1b9ca7),_0x722fde['statusMessage']?_0x722fde[_0xb75a('0x6e')]:'OK');if(_0x722fde['body']){try{this['saveRestApiResult'](_0x722fde['body'],_0x1b9ca7);}catch(_0x54c6cd){logger[_0xb75a('0x2b')](util['format'](_0xb75a('0x189'),_0x1b9ca7));}}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format']('variable\x20%s\x20set',_0x1b9ca7));};AGIVertices[_0xb75a('0x11')]['saydigits']=function(_0x4edffb){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x18a'),_0x4edffb[_0xb75a('0x38')]));return this[_0xb75a('0xe')][_0xb75a('0x18b')](_0x4edffb['digits'][_0xb75a('0x54')](/\s+/g,''),_0x4edffb['escape_digits']);};AGIVertices['prototype']['saynumber']=function(_0x2e2f9d){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x18c'),_0x2e2f9d[_0xb75a('0x38')]));return this['channel'][_0xb75a('0x18d')](_0x2e2f9d[_0xb75a('0x62')][_0xb75a('0x54')](/\s+/g,''),_0x2e2f9d['escape_digits']);};AGIVertices['prototype']['sayphonetic']=function(_0x303b88){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x18e'),_0x303b88[_0xb75a('0x38')]));return this[_0xb75a('0xe')][_0xb75a('0x18f')](_0x303b88[_0xb75a('0x57')],_0x303b88[_0xb75a('0x181')]);};AGIVertices['prototype'][_0xb75a('0x190')]=function(_0x518419){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x191'),_0x518419['label']));if(!this['isConfigured'](_0x518419[_0xb75a('0x192')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x193'));}var _0xf9a245=this[_0xb75a('0x1f')][_0xb75a('0x68')](this,_0x518419[_0xb75a('0x192')]);if(!_0xf9a245||!_0xf9a245['Smtp']){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x518419,_0xb75a('0x194'));}var _0x2b37dd={'from':util[_0xb75a('0x28')]('\x22%s\x22\x20<%s>',_0xf9a245[_0xb75a('0x15')],_0xf9a245[_0xb75a('0x195')]||_0xf9a245[_0xb75a('0x196')]['user']),'to':_0x518419['to']||'','cc':_0x518419['cc']||'','bcc':_0x518419['bcc']||'','subject':_0x518419[_0xb75a('0x197')],'html':_0x518419[_0xb75a('0x57')],'text':_0x518419[_0xb75a('0x57')]};var _0x1377cc={'tls':{'rejectUnauthorized':![]}};if(_0xf9a245[_0xb75a('0x196')][_0xb75a('0x198')]){_0x1377cc[_0xb75a('0x198')]=_0xf9a245[_0xb75a('0x196')][_0xb75a('0x198')];}else{_0x1377cc[_0xb75a('0x199')]=_0xf9a245[_0xb75a('0x196')][_0xb75a('0x199')];_0x1377cc[_0xb75a('0x19a')]=_0xf9a245['Smtp'][_0xb75a('0x19a')];_0x1377cc[_0xb75a('0x19b')]=_0xf9a245[_0xb75a('0x196')][_0xb75a('0x19b')];}if(_0xf9a245[_0xb75a('0x196')][_0xb75a('0x19c')]){_0x1377cc[_0xb75a('0x19d')]={'user':_0xf9a245[_0xb75a('0x196')]['user'],'pass':_0xf9a245['Smtp'][_0xb75a('0x19e')]};}if(this[_0xb75a('0x7e')](_0x518419['template_id'])){}logger[_0xb75a('0xdc')](_0xb75a('0x19f'),JSON[_0xb75a('0x6b')](_0x2b37dd));this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0x518419,_0x518419['account_id']);this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1a0'),_0xf9a245['name']));this[_0xb75a('0x21')][_0xb75a('0x68')](this,_0x1377cc,_0x2b37dd);return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x1a1'));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1a2')]=function(_0x4eea93){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x4eea93[_0xb75a('0x38')]));return this['channel'][_0xb75a('0xa2')](_0xb75a('0x1a3'));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1a4')]=function(_0x29c5d2){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x1a5'),_0x29c5d2['label']));if(!this[_0xb75a('0x7e')](_0x29c5d2[_0xb75a('0x1a6')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x1a7'));}var _0x110fe1=this[_0xb75a('0x33')][_0xb75a('0x68')](this,_0x29c5d2['sms_account_id']);if(!_0x110fe1){return this[_0xb75a('0xe')]['error'](_0x29c5d2,'no\x20sms\x20account\x20found');}var _0xe8086={'body':_0x29c5d2['sms_text'],'phone':_0x29c5d2['to']||'','SmsAccountId':_0x110fe1['id']};logger['debug']('sendSMS\x20message',JSON[_0xb75a('0x6b')](_0xe8086));this['createSquareDetailsReport']['sync'](this,_0x29c5d2,_0x29c5d2[_0xb75a('0x1a6')]);this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x110fe1[_0xb75a('0x15')]));this[_0xb75a('0x35')][_0xb75a('0x68')](this,_0xe8086);return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x1a8'));};AGIVertices['prototype'][_0xb75a('0x1a9')]=function(_0x3cf618){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x3cf618['label']));if(!this[_0xb75a('0x7e')](_0x3cf618[_0xb75a('0xd3')])){return this['channel'][_0xb75a('0x2b')](_0x3cf618,'no\x20variable\x20selected');}var _0x3758f3=this['getVariable'][_0xb75a('0x68')](this,_0x3cf618['variable_id']);if(!_0x3758f3){return this['channel']['error'](_0x3cf618,_0xb75a('0xd5'));}return this['channel'][_0xb75a('0x9a')](_0x3758f3,_0x3cf618[_0xb75a('0x1aa')]);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1ab')]=function(_0x302363){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x1ac'),_0x302363[_0xb75a('0x38')]));this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x1ad'));if(_0x302363[_0xb75a('0xb6')]===_0xb75a('0x1ae')){this['channel'][_0xb75a('0xa2')]('Answer');return this['channel'][_0xb75a('0xb6')]();}return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x1af'));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1b0')]=function(_0x1bbf96){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x1b1'),_0x1bbf96[_0xb75a('0x38')]));if(!this['isConfigured'](_0x1bbf96[_0xb75a('0x1b2')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1bbf96,'no\x20subproject\x20selected');}var _0x38eead=this[_0xb75a('0x1b3')]['sync'](this,_0x1bbf96[_0xb75a('0x1b2')]);if(!this['isConfigured'](_0x38eead)){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1bbf96,util['format'](_0xb75a('0x1b4'),_0x1bbf96[_0xb75a('0x1b2')]));}if(_0x38eead===this[_0xb75a('0xe')]['arg_1']){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1bbf96,_0xb75a('0x1b5'));}this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0x1bbf96,_0x38eead);var _0xb8aace=this[_0xb75a('0xe')]['exec']('AGI',util[_0xb75a('0x28')](_0xb75a('0x1b6'),config[_0xb75a('0x8')][_0xb75a('0x199')]||'127.0.0.1',_0x38eead,this['channel'][_0xb75a('0x39')]));if(_0xb8aace[_0xb75a('0x9e')]===-0x1){return _0xb8aace;}return this['channel']['noop'](util['format'](_0xb75a('0xbf'),_0xb75a('0x1b7'),_0x38eead));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1b8')]=function(_0x31aa1d){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x1b9'),_0x31aa1d[_0xb75a('0x38')]));var _0x2a5eae=this[_0xb75a('0x52')]['sync'](this,_0x31aa1d[_0xb75a('0xb1')]);this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0x31aa1d,_0x31aa1d['command']);if(this[_0xb75a('0x7e')](_0x31aa1d['variable_id'])){var _0x148d4b=this['getVariable'][_0xb75a('0x68')](this,_0x31aa1d['variable_id']);if(_0x148d4b){this[_0xb75a('0xe')][_0xb75a('0x9a')](_0x148d4b,_0x2a5eae);return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1ba'),_0x31aa1d[_0xb75a('0xb1')],_0x148d4b));}}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1bb'),_0x31aa1d[_0xb75a('0xb1')]));};AGIVertices['prototype'][_0xb75a('0x1bc')]=function(_0x2e5fea){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x2e5fea['label']));_0x2e5fea[_0xb75a('0x57')]=_0x2e5fea['text'][_0xb75a('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2e5fea[_0xb75a('0x56')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x1bd'));}if(!this[_0xb75a('0x7e')](_0x2e5fea['text'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1be'),_0x2e5fea[_0xb75a('0x57')]));var _0x10d005=this[_0xb75a('0x55')][_0xb75a('0x68')](this,_0x2e5fea);if(_0x10d005){this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1bf'),_0x10d005));var _0x51ee77=this[_0xb75a('0xe')]['streamFile'](_0x10d005);try{fs[_0xb75a('0x127')](_0x10d005+_0xb75a('0x128'));}catch(_0x5cb591){logger['error'](_0x5cb591);}return _0x51ee77;}return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x2e5fea,_0xb75a('0x1c0'));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1c1')]=function(_0x5d12b){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x1c2'),_0x5d12b[_0xb75a('0x38')]));_0x5d12b['text']=_0x5d12b[_0xb75a('0x57')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xb75a('0x7e')](_0x5d12b['text'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1c3'),_0x5d12b[_0xb75a('0x57')]));var _0x385e12=this[_0xb75a('0x5c')][_0xb75a('0x68')](this,_0x5d12b);if(_0x385e12){this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1c4'),_0x385e12));var _0x500c17=this[_0xb75a('0xe')][_0xb75a('0x154')](_0x385e12);try{fs[_0xb75a('0x127')](_0x385e12+_0xb75a('0x128'));}catch(_0x18234d){logger['error'](_0x18234d);}return _0x500c17;}return this['channel'][_0xb75a('0x2b')](_0x5d12b,_0xb75a('0x1c5'));};AGIVertices['prototype']['unpause']=function(_0x801c7c){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x1c6'),_0x801c7c[_0xb75a('0x38')]));if(!this['isConfigured'](_0x801c7c[_0xb75a('0x158')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x801c7c,_0xb75a('0x159'));}logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x15a'),this[_0xb75a('0xe')]['callerid'],_0x801c7c[_0xb75a('0x158')]));var _0x5c4cf0=this[_0xb75a('0x4e')]['sync'](this,_0x801c7c[_0xb75a('0x158')]);if(_0x5c4cf0){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x16e'),this['channel']['callerid'],_0x801c7c[_0xb75a('0x158')]));this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb75a('0xe')]['callerid'],_0x801c7c['findBy']));return{'code':0xc8,'result':_0xb75a('0x15e')};}else{logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x15b'),this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x801c7c[_0xb75a('0x158')]));this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x15b'),this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x801c7c['findBy']));return{'code':0xc8,'result':_0xb75a('0x15c')};}};AGIVertices['prototype'][_0xb75a('0x1c7')]=function(_0x579b1f){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x1c8'),_0x579b1f[_0xb75a('0x38')]));var _0x2ebd4c=this['channel'][_0xb75a('0xa4')](_0xb75a('0x1c9'),[_0x579b1f['mailbox'],_0x579b1f[_0xb75a('0x70')]]);if(_0x2ebd4c[_0xb75a('0x9e')]===-0x1){return _0x2ebd4c;}return this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xbf'),_0xb75a('0x1c9'),_0x579b1f[_0xb75a('0x1ca')]));};AGIVertices[_0xb75a('0x11')]['vswitch']=function(_0x333cd8){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x1cb'),_0x333cd8[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x333cd8[_0xb75a('0xd3')])){return this['channel']['error'](_0x333cd8,_0xb75a('0x1cc'));}var _0x5d3ef9=this[_0xb75a('0x12')][_0xb75a('0x68')](this,_0x333cd8[_0xb75a('0xd3')]);if(!_0x5d3ef9){return this['channel'][_0xb75a('0x2b')](_0x333cd8,'no\x20variable\x20found');}var _0x531f02=this['channel'][_0xb75a('0x12')](_0x5d3ef9);return{'code':0xc8,'result':_0x531f02[_0xb75a('0x9c')]?_0x531f02[_0xb75a('0x9c')]:'-'};};String[_0xb75a('0x11')][_0xb75a('0x1cd')]=function(_0x31baec,_0x57deb9){return this['split'](_0x31baec)['join'](_0x57deb9);};module[_0xb75a('0x1ce')]=AGIVertices;
\ No newline at end of file
+var _0x8b54=['getIntervals','getIntervalById','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','headers','rawHeaders','computedVariables','sync','uri','render','stringify','statusMessage','statusCode','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_secret_access_key','aws_lex_region','googleASR','google_asr_language','tildeASR','appsecret','clear','agicommand','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','isString','saveRestApiResult','%s.%s','setVariable','replaceAll','extra','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','MRCPSynth','result','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','list_id','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','DIALOGFLOW_%s','speech','out','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sesteknda','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','retry','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','test','mindigit','maxdigit','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','no\x20find\x20by\x20configured','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','failure','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','subject','service','port','secure','auth','pass','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','split','join','path','util','shelljs','odbc','moment','mustache','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','getMailAccount','sendMailMessage','mailRpc'];(function(_0x879084,_0x342acb){var _0x1317d1=function(_0x18ce4f){while(--_0x18ce4f){_0x879084['push'](_0x879084['shift']());}};_0x1317d1(++_0x342acb);}(_0x8b54,0x1a8));var _0x48b5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b54[_0x321bb2];return _0x9c12ed;};'use strict';var fs=require('fs');var path=require(_0x48b5('0x0'));var util=require(_0x48b5('0x1'));var _=require('lodash');var sh=require(_0x48b5('0x2'));var odbc=require(_0x48b5('0x3'))();var rs=require('randomstring');var moment=require(_0x48b5('0x4'));var Mustache=require(_0x48b5('0x5'));var rp=require('request-promise');var logger=require('../../config/logger')(_0x48b5('0x6'));var config=require(_0x48b5('0x7'));var scripts=require(_0x48b5('0x8'));var FILES_PATH=_0x48b5('0x9');var recursiveMapAttributes=['rawHeaders',_0x48b5('0xa')];var verticesWithRetry=[_0x48b5('0xb'),_0x48b5('0xc'),_0x48b5('0xd')];var AGIVertices=function(_0x2de62a,_0x162644,_0x179f19){this[_0x48b5('0xe')]=_0x2de62a;this[_0x48b5('0xf')]=_0x162644;this['mailRpc']=_0x179f19;};AGIVertices[_0x48b5('0x10')][_0x48b5('0x11')]=function(_0x4cf445,_0x5ddaee){this['rpc'][_0x48b5('0x12')](_0x4cf445)['then'](function(_0x25e027){_0x5ddaee(null,_0x25e027?_0x25e027[_0x48b5('0x13')]:![]);})[_0x48b5('0x14')](function(_0x906c23){_0x5ddaee(_0x906c23);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x15')]=function(_0x59eea8,_0x4d83ab){this[_0x48b5('0xf')][_0x48b5('0x16')](_0x59eea8)[_0x48b5('0x17')](function(_0x768042){_0x4d83ab(null,_0x768042?_0x768042[_0x48b5('0x13')]:![]);})[_0x48b5('0x14')](function(_0x42b86a){_0x4d83ab(_0x42b86a);});};AGIVertices['prototype'][_0x48b5('0x18')]=function(_0x493ea1,_0xeadc27){this[_0x48b5('0xf')]['getSquareProjectById'](_0x493ea1)['then'](function(_0x2e5b82){_0xeadc27(null,_0x2e5b82?_0x2e5b82['name']:![]);})['catch'](function(_0xef28c1){_0xeadc27(_0xef28c1);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x19')]=function(_0x4938b9,_0x566432){this[_0x48b5('0xf')][_0x48b5('0x1a')](_0x4938b9)[_0x48b5('0x17')](function(_0x514784){_0x566432(null,_0x514784?_0x514784[_0x48b5('0x1b')]:![]);})['catch'](function(_0x4e5e3f){_0x566432(_0x4e5e3f);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x1c')]=function(_0x4ace9f,_0x25f298){this[_0x48b5('0xf')][_0x48b5('0x1d')](_0x4ace9f)[_0x48b5('0x17')](function(_0x5f1f3e){_0x25f298(null,_0x5f1f3e?_0x5f1f3e['name']:![]);})[_0x48b5('0x14')](function(_0x199f0b){_0x25f298(_0x199f0b);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x1e')]=function(_0x1fea8d,_0x230d22){this[_0x48b5('0xf')][_0x48b5('0x1f')](_0x1fea8d)[_0x48b5('0x17')](function(_0x43f037){_0x230d22(null,_0x43f037?_0x43f037[_0x48b5('0x13')]:![]);})['catch'](function(_0x157292){_0x230d22(_0x157292);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x20')]=function(_0xab94ca,_0x3b1ff7){var _0x5ee84d=this;this['rpc']['getSoundById'](_0xab94ca)[_0x48b5('0x17')](function(_0x45b12b){_0x3b1ff7(null,_0x45b12b?_0x5ee84d[_0x48b5('0x21')](_0x45b12b['save_name']):![]);})[_0x48b5('0x14')](function(_0xef066f){_0x3b1ff7(_0xef066f);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x22')]=function(_0x260ab2,_0x5eea86){this[_0x48b5('0xf')]['getMailAccountById'](_0x260ab2)[_0x48b5('0x17')](function(_0x142577){_0x5eea86(null,_0x142577?_0x142577:![]);})[_0x48b5('0x14')](function(_0x4963c5){_0x5eea86(_0x4963c5);});};AGIVertices['prototype'][_0x48b5('0x23')]=function(_0x1d21b3,_0x4cd5a2,_0x5afc53){this[_0x48b5('0x24')][_0x48b5('0x23')](_0x1d21b3,_0x4cd5a2)[_0x48b5('0x17')](function(){_0x5afc53(null);})[_0x48b5('0x14')](function(_0x4c9e53){_0x5afc53(_0x4c9e53);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x25')]=function(_0x1eb0fc,_0x5ce89a){this[_0x48b5('0xf')][_0x48b5('0x26')](_0x1eb0fc)[_0x48b5('0x17')](function(_0x3aecac){if(_0x3aecac){if(_0x3aecac['IntervalId']){_0x5ce89a(null,[_0x3aecac[_0x48b5('0x27')]]);}else{_0x5ce89a(null,_[_0x48b5('0x28')](_0x3aecac[_0x48b5('0x29')],_0x48b5('0x27')));}}else{_0x5ce89a(null,![]);}})[_0x48b5('0x14')](function(_0x307178){_0x5ce89a(_0x307178);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x21')]=function(_0x594f20){return util[_0x48b5('0x2a')](_0x48b5('0x2b'),FILES_PATH,_0x594f20);};AGIVertices['prototype'][_0x48b5('0x2c')]=function(_0x40e3ce,_0x3094a3,_0x450d92){odbc[_0x48b5('0x2d')](_0x40e3ce,function(_0x5a83cb){if(_0x5a83cb){logger['error'](_0x48b5('0x2e'),_0x5a83cb);_0x450d92(_0x5a83cb);}else{logger[_0x48b5('0x2f')](_0x48b5('0x30'));odbc[_0x48b5('0x31')](_0x3094a3,function(_0xba987b,_0x25a2f9){if(_0xba987b){logger[_0x48b5('0x2f')](_0x48b5('0x32'),_0x3094a3);_0x450d92(_0xba987b);}else{logger[_0x48b5('0x2f')](_0x48b5('0x33'),_0x3094a3);odbc[_0x48b5('0x34')](function(_0x1291ca){if(_0x1291ca){logger[_0x48b5('0x35')](_0x48b5('0x36'),_0x1291ca);}_0x450d92(null,_0x25a2f9);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x2442ff,_0x158939){this['rpc'][_0x48b5('0x37')](_0x2442ff)[_0x48b5('0x17')](function(_0x9bb124){_0x158939(null,_0x9bb124?_0x9bb124:![]);})[_0x48b5('0x14')](function(_0x309399){_0x158939(_0x309399);});};AGIVertices[_0x48b5('0x10')]['createSmsMessage']=function(_0x561192,_0x244468){this[_0x48b5('0xf')][_0x48b5('0x38')](_0x561192)[_0x48b5('0x17')](function(_0x18a817){_0x244468(null,_0x18a817);})[_0x48b5('0x14')](function(_0x59dcc8){_0x244468(_0x59dcc8);});};AGIVertices['prototype'][_0x48b5('0x39')]=function(_0xea20f8,_0x4aa485,_0x5e2969){this[_0x48b5('0xf')][_0x48b5('0x39')]({'uniqueid':this[_0x48b5('0xe')][_0x48b5('0x3a')],'node':_0xea20f8[_0x48b5('0x3b')],'application':_0xea20f8['agicommand'],'data':_0x4aa485||null,'project_name':this[_0x48b5('0xe')][_0x48b5('0x3c')],'callerid':this[_0x48b5('0xe')]['callerid']})[_0x48b5('0x17')](function(_0x370a48){if(_0x5e2969){_0x5e2969(null,_0x370a48);}})[_0x48b5('0x14')](function(_0x1fa823){if(_0x5e2969){_0x5e2969(_0x1fa823);}});};AGIVertices['prototype'][_0x48b5('0x3d')]=function(_0x38e955,_0x509654,_0x38b5d4,_0x5537a6){this['rpc']['createSquareRecording']({'uniqueid':this[_0x48b5('0xe')][_0x48b5('0x3a')],'callerid':this[_0x48b5('0xe')][_0x48b5('0x3e')],'calleridname':this[_0x48b5('0xe')][_0x48b5('0x3f')],'context':this[_0x48b5('0xe')][_0x48b5('0x40')],'extension':this[_0x48b5('0xe')][_0x48b5('0x41')],'priority':this[_0x48b5('0xe')][_0x48b5('0x42')],'accountcode':this['channel']['accountcode'],'dnid':this['channel'][_0x48b5('0x43')],'projectName':this['channel'][_0x48b5('0x3c')],'saveName':_0x509654,'filename':_0x38e955[_0x48b5('0x44')]||_0x509654,'savePath':_0x38b5d4})[_0x48b5('0x17')](function(_0xd7d89d){_0x5537a6(null,_0xd7d89d);})['catch'](function(_0x257c51){_0x5537a6(_0x257c51);});};AGIVertices['prototype'][_0x48b5('0x45')]=function(_0x115b58,_0x109f2c,_0x5546e8,_0x47e2ec,_0x289b23){this[_0x48b5('0xf')]['createSquareMessage']({'uniqueid':this[_0x48b5('0xe')][_0x48b5('0x3a')],'body':_0x115b58,'direction':_0x109f2c,'providerName':_0x5546e8,'providerResponse':_0x47e2ec})[_0x48b5('0x17')](function(_0x1668d7){if(_0x289b23){_0x289b23(null,_0x1668d7);}})[_0x48b5('0x14')](function(_0x5e19a6){if(_0x289b23){_0x289b23(_0x5e19a6);}});};AGIVertices['prototype']['createCmContact']=function(_0xfed8a3,_0x3eccc2){this[_0x48b5('0xf')][_0x48b5('0x46')]({'firstName':_[_0x48b5('0x47')](_0xfed8a3[_0x48b5('0x13')])||_[_0x48b5('0x48')](_0xfed8a3[_0x48b5('0x13')])?_0x48b5('0x49')+Math[_0x48b5('0x4a')]():_0xfed8a3[_0x48b5('0x13')],'lastName':_[_0x48b5('0x47')](_0xfed8a3['lastName'])||_['isNil'](_0xfed8a3[_0x48b5('0x4b')])?null:_0xfed8a3['lastName'],'phone':_0xfed8a3[_0x48b5('0x4c')],'ListId':_0xfed8a3['list_id'],'scheduledat':_0xfed8a3['scheduledAt'],'callbackUniqueid':this[_0x48b5('0xe')]['uniqueid'],'tags':_0x48b5('0x4d'),'description':_0x48b5('0x4e')+_0xfed8a3[_0x48b5('0x4f')][_0x48b5('0x50')](),'priority':_0xfed8a3[_0x48b5('0x51')]})[_0x48b5('0x17')](function(_0x54d0aa){_0x3eccc2(null,_0x54d0aa);})[_0x48b5('0x14')](function(_0x5ebc70){_0x3eccc2(_0x5ebc70);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x52')]=function(_0x15ff33,_0x20216c){this['rpc'][_0x48b5('0x53')](_0x15ff33)['then'](function(_0x25715){_0x20216c(null,_0x25715?_0x25715['name']:![]);})[_0x48b5('0x14')](function(_0x1bc3f3){_0x20216c(_0x1bc3f3);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x54')]=function(_0x6e749e,_0x5968ad,_0x3f7413){var _0x3e6c1e={'role':_0x48b5('0x55')};_0x3e6c1e[_0x6e749e]=this['channel'][_0x48b5('0x3e')];this[_0x48b5('0xf')][_0x48b5('0x54')](_0x3e6c1e,_0x5968ad,this[_0x48b5('0xe')][_0x48b5('0x3a')])[_0x48b5('0x17')](function(_0x3d8e80){_0x3f7413(null,_[_0x48b5('0x48')](_0x3d8e80)?![]:!![]);})[_0x48b5('0x14')](function(_0x512bfb){logger['error'](_0x512bfb);_0x3f7413(null,![]);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x56')]=function(_0x4f6f44,_0x4d97f2){var _0x49baa9={'role':_0x48b5('0x55')};_0x49baa9[_0x4f6f44]=this[_0x48b5('0xe')]['callerid'];this['rpc'][_0x48b5('0x56')](_0x49baa9)[_0x48b5('0x17')](function(_0x5f4c35){_0x4d97f2(null,_['isNil'](_0x5f4c35)?![]:!![]);})[_0x48b5('0x14')](function(_0x51dacd){logger[_0x48b5('0x35')](_0x51dacd);_0x4d97f2(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x4bd39,_0x5a9d24){var _0x39b278={'role':_0x48b5('0x55')};_0x39b278[_0x4bd39]=this[_0x48b5('0xe')][_0x48b5('0x3e')];this[_0x48b5('0xf')][_0x48b5('0x57')](_0x39b278)[_0x48b5('0x17')](function(_0x42a2f8){_0x5a9d24(null,_[_0x48b5('0x48')](_0x42a2f8)?![]:!![]);})[_0x48b5('0x14')](function(_0x46d9d9){logger[_0x48b5('0x35')](_0x46d9d9);_0x5a9d24(null,![]);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x58')]=function(_0x2507c0,_0x5ae931){var _0x4037cc={'role':_0x48b5('0x55')};_0x4037cc[_0x2507c0]=this[_0x48b5('0xe')][_0x48b5('0x3e')];var _0x31cc3f=_0x2507c0!=_0x48b5('0x59')?util[_0x48b5('0x2a')](_0x48b5('0x5a'),_0x48b5('0x5b'),this[_0x48b5('0xe')][_0x48b5('0x3e')]):undefined;this[_0x48b5('0xf')][_0x48b5('0x58')](_0x4037cc,_0x31cc3f)['then'](function(_0x2951fb){_0x5ae931(null,_[_0x48b5('0x48')](_0x2951fb)?![]:!![]);})[_0x48b5('0x14')](function(_0x48656a){logger[_0x48b5('0x35')](_0x48656a);_0x5ae931(null,![]);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x5c')]=function(_0x5e8fe6,_0x23b942){sh[_0x48b5('0x5d')](_[_0x48b5('0x5e')](_0x5e8fe6),function(_0x4413fa,_0x52ca70){var _0x52764d=_0x52ca70[_0x48b5('0x5f')](/(\r\n|\n|\r)/gm,'');_0x23b942(null,_0x52764d);});};AGIVertices[_0x48b5('0x10')]['googleCloudTTS']=function(_0x58f6ff,_0x5960cb){scripts[_0x48b5('0x60')](_0x58f6ff['apiKey'],_0x58f6ff[_0x48b5('0x61')]||_0x48b5('0x62'),_0x58f6ff[_0x48b5('0x62')],_0x58f6ff[_0x48b5('0x63')]||_0x48b5('0x64'),_0x58f6ff['ssmlGender']||'MALE',_0x58f6ff[_0x48b5('0x65')]||'MP3')['then'](function(_0x1b28a6){_0x5960cb(null,_0x1b28a6);})[_0x48b5('0x14')](function(_0x4cd2b0){_0x5960cb(_0x4cd2b0);});};AGIVertices['prototype'][_0x48b5('0x66')]=function(_0x5212a1,_0x255c61){scripts[_0x48b5('0x66')](_0x5212a1[_0x48b5('0x62')],_0x5212a1[_0x48b5('0x67')]||'en',0x1)['then'](function(_0x4aa0e7){_0x255c61(null,_0x4aa0e7);})['catch'](function(_0x28280b){_0x255c61(_0x28280b);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x68')]=function(_0x4a878d,_0x32c62b){var _0x2a20b1={'uri':_0x4a878d[_0x48b5('0x69')],'method':_0x4a878d[_0x48b5('0x6a')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4a878d[_0x48b5('0x6b')])===_0x48b5('0x6c')&&parseInt(_0x4a878d[_0x48b5('0x6b')])>=0x1?parseInt(_0x4a878d[_0x48b5('0x6b')])*0x3e8:0x5*0x3e8};if(_[_0x48b5('0x6d')]([_0x48b5('0x6e'),_0x48b5('0x6f')],_0x2a20b1[_0x48b5('0x6a')][_0x48b5('0x70')]())){try{_0x2a20b1[_0x48b5('0x71')]=_0x4a878d['rawBody']?JSON[_0x48b5('0x72')](_0x4a878d[_0x48b5('0xa')]):{};}catch(_0x17addc){logger[_0x48b5('0x35')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x17addc);}}try{_0x2a20b1[_0x48b5('0x73')]=_0x4a878d[_0x48b5('0x74')]?JSON['parse'](_0x4a878d[_0x48b5('0x74')]):{};}catch(_0x281c0b){logger[_0x48b5('0x35')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x281c0b);}if(_0x4a878d[_0x48b5('0x75')]){try{var _0x16b643=require(_0x4a878d['computedVariables'])[_0x48b5('0x76')](this,_0x2a20b1);_0x2a20b1[_0x48b5('0x77')]=Mustache[_0x48b5('0x78')](_0x4a878d[_0x48b5('0x69')],_0x16b643,{},['$$','$$']);if(_0x2a20b1['headers']){_0x2a20b1[_0x48b5('0x73')]=JSON[_0x48b5('0x72')](Mustache[_0x48b5('0x78')](JSON[_0x48b5('0x79')](_0x2a20b1[_0x48b5('0x73')]),_0x16b643,{},['$$','$$']));}if(_0x2a20b1['body']){_0x2a20b1['body']=JSON['parse'](Mustache[_0x48b5('0x78')](JSON[_0x48b5('0x79')](_0x2a20b1['body']),_0x16b643,{},['$$','$$']));}}catch(_0x593985){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x593985);}}rp(_0x2a20b1)[_0x48b5('0x17')](function(_0x4803a0){var _0x2b2a0f={'statusCode':_0x4803a0['statusCode']||0xc8,'statusMessage':_0x4803a0[_0x48b5('0x7a')]||'OK','headers':_0x4803a0[_0x48b5('0x73')]||{},'body':_0x4803a0[_0x48b5('0x71')]||{}};_0x32c62b(null,_0x2b2a0f);})[_0x48b5('0x14')](function(_0x513b25){var _0x5d3aae={'statusCode':_0x513b25[_0x48b5('0x7b')]||0x1f4,'statusMessage':_0x513b25['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x513b25[_0x48b5('0x7c')][_0x48b5('0x73')]||{},'body':_0x513b25['options'][_0x48b5('0x71')]||{}};_0x32c62b(null,_0x5d3aae);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x7d')]=function(_0x59f925,_0x159eb1){scripts['googleDialogflow'](this[_0x48b5('0xe')][_0x48b5('0x3a')],_0x59f925[_0x48b5('0x7e')],_0x59f925[_0x48b5('0x62')],_0x59f925['dialogflow_language']||'en')[_0x48b5('0x17')](function(_0x179a66){_0x159eb1(null,_0x179a66);})[_0x48b5('0x14')](function(_0x47616e){_0x159eb1(_0x47616e);});};AGIVertices[_0x48b5('0x10')]['googleDialogflowV2']=function(_0x13d0ea,_0x3cbf9e){scripts[_0x48b5('0x7f')](this[_0x48b5('0xe')][_0x48b5('0x3a')],_0x13d0ea[_0x48b5('0x80')],_0x13d0ea[_0x48b5('0x81')],_0x13d0ea[_0x48b5('0x82')],_0x13d0ea[_0x48b5('0x62')],_0x13d0ea[_0x48b5('0x83')]||'en')[_0x48b5('0x17')](function(_0x59219e){_0x3cbf9e(null,_0x59219e);})[_0x48b5('0x14')](function(_0x4b5083){_0x3cbf9e(_0x4b5083);});};AGIVertices[_0x48b5('0x10')]['sestekNDA']=function(_0x3aa29d,_0x71d6c7){scripts[_0x48b5('0x84')](this[_0x48b5('0xe')],_0x3aa29d)[_0x48b5('0x17')](function(_0xfa430e){_0x71d6c7(null,_0xfa430e);})[_0x48b5('0x14')](function(_0x14b927){_0x71d6c7(_0x14b927);});};AGIVertices['prototype']['ispeechTTS']=function(_0x3cb236,_0x1ed2c1){scripts[_0x48b5('0x85')](_0x3cb236[_0x48b5('0x7e')],_0x3cb236['text'],_0x3cb236['ispeech_tts_language']||_0x48b5('0x64'),_0x3cb236[_0x48b5('0x86')])['then'](function(_0x26c487){_0x1ed2c1(null,_0x26c487);})['catch'](function(_0x18b907){_0x1ed2c1(_0x18b907);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x87')]=function(_0x3aaae4,_0x38f07f,_0x18b5fb){scripts[_0x48b5('0x87')](_0x38f07f,_0x3aaae4['key'],_0x3aaae4[_0x48b5('0x88')]||_0x48b5('0x64'),this['isConfigured'](_0x3aaae4[_0x48b5('0x89')])?_0x3aaae4[_0x48b5('0x89')]:undefined)['then'](function(_0xcf17f7){_0x18b5fb(null,_0xcf17f7);})[_0x48b5('0x14')](function(_0x56813f){_0x18b5fb(_0x56813f);});};AGIVertices['prototype']['awsPolly']=function(_0x3c5b33,_0x3a50d3){scripts[_0x48b5('0x8a')](_0x3c5b33['aws_access_key_id'],_0x3c5b33['aws_secret_access_key'],_0x3c5b33[_0x48b5('0x8b')],_0x3c5b33[_0x48b5('0x8c')]||'Amy',_0x3c5b33[_0x48b5('0x62')],_0x3c5b33[_0x48b5('0x8d')]||_0x48b5('0x62'))[_0x48b5('0x17')](function(_0x1ff3ba){_0x3a50d3(null,_0x1ff3ba);})[_0x48b5('0x14')](function(_0x2e2839){_0x3a50d3(_0x2e2839);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x8e')]=function(_0x249495,_0x49fff2){scripts['awsLex'](this[_0x48b5('0xe')][_0x48b5('0x3a')],_0x249495[_0x48b5('0x8f')],_0x249495[_0x48b5('0x90')],_0x249495[_0x48b5('0x91')],_0x249495[_0x48b5('0x62')],_0x249495['aws_bot_name'])[_0x48b5('0x17')](function(_0x2469ea){_0x49fff2(null,_0x2469ea);})[_0x48b5('0x14')](function(_0x48a34f){_0x49fff2(_0x48a34f);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x92')]=function(_0x5636d4,_0x5db581,_0x59bcda){scripts['googleASR'](_0x5db581,_0x5636d4[_0x48b5('0x7e')],_0x5636d4[_0x48b5('0x93')]||_0x48b5('0x64'))[_0x48b5('0x17')](function(_0x388661){_0x59bcda(null,_0x388661);})['catch'](function(_0x21848e){_0x59bcda(_0x21848e);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x94')]=function(_0x3f4800,_0xb40394,_0x98be2c){scripts[_0x48b5('0x94')](_0xb40394,_0x3f4800['appid'],_0x3f4800[_0x48b5('0x95')],_0x3f4800['uri'])['then'](function(_0x57e80f){_0x98be2c(null,_0x57e80f);})[_0x48b5('0x14')](function(_0x3e485b){_0x98be2c(_0x3e485b);});};AGIVertices[_0x48b5('0x10')][_0x48b5('0x96')]=function(_0x2af3bb){var _0x4d5ed6=_[_0x48b5('0x6d')](verticesWithRetry,_0x2af3bb[_0x48b5('0x97')])?_0x2af3bb:_[_0x48b5('0x98')](_0x2af3bb);for(var _0x4539ce in _0x4d5ed6){if(_0x4d5ed6[_0x48b5('0x99')](_0x4539ce)){if(_0x4d5ed6[_0x4539ce]&&_['isString'](_0x4d5ed6[_0x4539ce])){if(_[_0x48b5('0x6d')](recursiveMapAttributes,_0x4539ce)){_0x4d5ed6[_0x4539ce]=this[_0x48b5('0x9a')](_0x4d5ed6[_0x4539ce]);}else{_0x4d5ed6[_0x4539ce]=this[_0x48b5('0x9b')](_0x4d5ed6[_0x4539ce]);}}}}return _0x4d5ed6;};AGIVertices['prototype'][_0x48b5('0x9c')]=function(_0x5cb63c){for(var _0x2c7efa in _0x5cb63c){if(_0x5cb63c[_0x48b5('0x99')](_0x2c7efa)){if(_[_0x48b5('0x9d')](_0x5cb63c[_0x2c7efa])){this[_0x48b5('0x9c')](_0x5cb63c[_0x2c7efa]);}else if(_['isArray'](_0x5cb63c[_0x2c7efa])){for(var _0x13a18f=0x0;_0x13a18f<_0x5cb63c[_0x2c7efa][_0x48b5('0x9e')];_0x13a18f++){this['recursiveNodeIndex'](_0x5cb63c[_0x2c7efa][_0x13a18f]);}}else if(_[_0x48b5('0x9f')](_0x5cb63c[_0x2c7efa])){_0x5cb63c[_0x2c7efa]=this[_0x48b5('0x9b')](_0x5cb63c[_0x2c7efa]);}}}};AGIVertices[_0x48b5('0x10')][_0x48b5('0xa0')]=function(_0x2d0066,_0x4f6e90){for(var _0x3bc6a3 in _0x2d0066){if(_0x2d0066[_0x48b5('0x99')](_0x3bc6a3)){if(_[_0x48b5('0x9d')](_0x2d0066[_0x3bc6a3])){if(!_['isEmpty'](_0x2d0066[_0x3bc6a3])){this[_0x48b5('0xa0')](_0x2d0066[_0x3bc6a3],util[_0x48b5('0x2a')](_0x48b5('0xa1'),_0x4f6e90,_0x3bc6a3));}}else if(_['isArray'](_0x2d0066[_0x3bc6a3])){for(var _0x5c5605=0x0;_0x5c5605<_0x2d0066[_0x3bc6a3][_0x48b5('0x9e')];_0x5c5605++){this[_0x48b5('0xa0')](_0x2d0066[_0x3bc6a3][_0x5c5605],util[_0x48b5('0x2a')](_0x48b5('0xa1'),_0x4f6e90,_0x3bc6a3+'['+_0x5c5605+']'));}}else{if(!_[_0x48b5('0x48')](_0x2d0066[_0x3bc6a3])){this[_0x48b5('0xe')][_0x48b5('0xa2')](util[_0x48b5('0x2a')](_0x48b5('0xa1'),_0x4f6e90,_0x3bc6a3),_0x2d0066[_0x3bc6a3]);}}}}};AGIVertices[_0x48b5('0x10')][_0x48b5('0x9a')]=function(_0xe0eac3){try{var _0x7c3b75=JSON[_0x48b5('0x72')](_0xe0eac3);this[_0x48b5('0x9c')](_0x7c3b75);return JSON[_0x48b5('0x79')](_0x7c3b75);}catch(_0x341423){return this['replaceAllVariables'](_0xe0eac3);}};AGIVertices[_0x48b5('0x10')][_0x48b5('0x9b')]=function(_0x45b748){var _0xc2f8f6=_0x45b748['split']('{');for(var _0x15c32d=0x1;_0x15c32d<_0xc2f8f6[_0x48b5('0x9e')];_0x15c32d+=0x1){var _0x505139=_0xc2f8f6[_0x15c32d]['split']('}');if(_0x505139['length']>0x1){_0x45b748=_0x45b748[_0x48b5('0xa3')]('{'+_0x505139[0x0]+'}',this[_0x48b5('0xe')][_0x48b5('0x11')](_0x505139[0x0])[_0x48b5('0xa4')]||_0x505139[0x0]);}}if(_0xc2f8f6['length']===0x1){return _0x45b748[_0x48b5('0x50')]();}return this[_0x48b5('0x9b')](_0x45b748);};AGIVertices[_0x48b5('0x10')]['getAndSetVariable']=function(_0x4ba68f,_0x157517){var _0x4ae59b=this['channel']['getVariable'](_0x4ba68f);if(_0x4ae59b['result']===-0x1){return _0x4ae59b;}logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0xa5'),_0x157517,_0x4ae59b[_0x48b5('0xa4')]));return this['channel']['setVariable'](_0x157517,_0x4ae59b[_0x48b5('0xa4')]);};AGIVertices['prototype'][_0x48b5('0xa6')]=function(_0x4f5f58){return _0x4f5f58&&_0x4f5f58!=='0'&&_0x4f5f58!=='-1'&&_0x4f5f58!=='';};AGIVertices[_0x48b5('0x10')][_0x48b5('0xa7')]=function(_0xabeacb){this[_0x48b5('0x39')][_0x48b5('0x76')](this,_0xabeacb,'-');_0xabeacb['retry']=_0xabeacb['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x48b5('0xa8')]=function(_0x26989d){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0xa9'),_0x26989d[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x26989d[_0x48b5('0x62')])){return this[_0x48b5('0xe')]['noop']('no\x20text\x20configured');}var _0x596a57='\x22'+_0x26989d[_0x48b5('0x62')]+'\x22';if(this[_0x48b5('0xa6')](_0x26989d[_0x48b5('0x7c')])){_0x596a57+=','+_0x26989d['options'];}var _0x4642ff=this[_0x48b5('0xe')][_0x48b5('0x5d')](_0x48b5('0xaa'),_0x596a57);if(_0x4642ff[_0x48b5('0xab')]===-0x1){return _0x4642ff;}return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0xad'),_0x596a57));};AGIVertices['prototype'][_0x48b5('0xae')]=function(_0x3eba0){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0xaf'),_0x3eba0[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x3eba0[_0x48b5('0xb0')])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0xb1'));}var _0x535d05=_0x3eba0[_0x48b5('0xb0')];if(this[_0x48b5('0xa6')](_0x3eba0[_0x48b5('0x7c')])){_0x535d05+=','+_0x3eba0[_0x48b5('0x7c')];}var _0x52b26d=this[_0x48b5('0xe')][_0x48b5('0x5d')](_0x48b5('0xb2'),_0x535d05);if(_0x52b26d[_0x48b5('0xab')]===-0x1){return _0x52b26d;}var _0xdf8a5=this[_0x48b5('0xb3')](_0x48b5('0xb4'),_0x48b5('0xb5'));if(_0xdf8a5[_0x48b5('0xab')]===-0x1){return _0xdf8a5;}var _0x495d3e=this[_0x48b5('0xb3')](_0x48b5('0xb6'),_0x48b5('0xb7'));if(_0x495d3e[_0x48b5('0xab')]===-0x1){return _0x495d3e;}var _0x58300d=this[_0x48b5('0xb3')](_0x48b5('0xb8'),_0x48b5('0xb9'));if(_0x58300d['result']===-0x1){return _0x58300d;}return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0xba'),_0x535d05));};AGIVertices[_0x48b5('0x10')][_0x48b5('0x6')]=function(_0x579a74){logger['info'](util[_0x48b5('0x2a')](_0x48b5('0xbb'),_0x579a74['label']));return this['channel'][_0x48b5('0x6')]([_0x579a74[_0x48b5('0xbc')],_0x579a74['args']]);};AGIVertices[_0x48b5('0x10')]['answer']=function(_0x5798e1){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0xbd'),_0x5798e1[_0x48b5('0x3b')]));if(this[_0x48b5('0xa6')](_0x5798e1[_0x48b5('0x6b')])){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0xbe'),_0x5798e1[_0x48b5('0x6b')]));var _0x273b2b=this['channel']['wait'](_0x5798e1[_0x48b5('0x6b')]);if(_0x273b2b['result']===-0x1){return _0x273b2b;}}return this['channel'][_0x48b5('0xbf')]();};AGIVertices[_0x48b5('0x10')]['callback']=function(_0x4f3952){logger[_0x48b5('0x2f')](util['format'](_0x48b5('0xc0'),_0x4f3952['label']));if(!this[_0x48b5('0xa6')](_0x4f3952['list_id'])){return this[_0x48b5('0xe')]['error'](_0x4f3952,'no\x20list\x20selected');}_0x4f3952[_0x48b5('0x4f')]=moment();if(this[_0x48b5('0xa6')](_0x4f3952[_0x48b5('0xc1')])){_0x4f3952[_0x48b5('0x4f')]=moment()[_0x48b5('0xc2')](_0x4f3952[_0x48b5('0xc1')],_0x48b5('0xc3'));}if(!this['isConfigured'](_0x4f3952['callback_priority'])){_0x4f3952[_0x48b5('0x51')]=0x2;}this[_0x48b5('0x46')][_0x48b5('0x76')](this,_0x4f3952);return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0xc4'),_0x4f3952[_0x48b5('0x4c')],_0x4f3952[_0x48b5('0xc5')],_0x4f3952['scheduledAt']));};AGIVertices[_0x48b5('0x10')][_0x48b5('0xc6')]=function(_0x40f591){logger['info'](util[_0x48b5('0x2a')](_0x48b5('0xc7'),_0x40f591[_0x48b5('0x3b')]));var _0x4d97c6=this[_0x48b5('0xe')][_0x48b5('0x5d')](_0x40f591[_0x48b5('0xc8')],_0x40f591['options']);if(_0x4d97c6['result']===-0x1){return _0x4d97c6;}return this['channel'][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0xc9'),_0x40f591[_0x48b5('0xc8')],_0x40f591[_0x48b5('0x7c')]));};AGIVertices[_0x48b5('0x10')][_0x48b5('0xca')]=function(_0x44dd3c){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0xcb'),_0x44dd3c['label']));if(!this[_0x48b5('0xa6')](_0x44dd3c[_0x48b5('0x62')])){return this[_0x48b5('0xe')]['noop'](_0x48b5('0xcc'));}var _0x419740='\x22'+_0x44dd3c[_0x48b5('0x62')]+'\x22';if(this[_0x48b5('0xa6')](_0x44dd3c['options'])){_0x419740+=','+_0x44dd3c[_0x48b5('0x7c')];}var _0x212ae9=this['channel'][_0x48b5('0x5d')](_0x48b5('0xaa'),_0x419740);if(_0x212ae9['result']===-0x1){return _0x212ae9;}return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0xad'),_0x419740));};AGIVertices[_0x48b5('0x10')][_0x48b5('0xcd')]=function(_0x299079){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x299079[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x299079['text'])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0xcc'));}var _0x217770='\x22'+_0x299079[_0x48b5('0x62')]+'\x22';if(this[_0x48b5('0xa6')](_0x299079[_0x48b5('0x7c')])){_0x217770+=','+_0x299079[_0x48b5('0x7c')];}var _0x4fadf4=this[_0x48b5('0xe')][_0x48b5('0x5d')](_0x48b5('0xaa'),_0x217770);if(_0x4fadf4[_0x48b5('0xab')]===-0x1){return _0x4fadf4;}return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0xad'),_0x217770));};AGIVertices[_0x48b5('0x10')]['lumenvoxasr']=function(_0x1830d2){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0xce'),_0x1830d2[_0x48b5('0x3b')]));if(!this['isConfigured'](_0x1830d2[_0x48b5('0xb0')])){return this['channel'][_0x48b5('0xac')](_0x48b5('0xb1'));}var _0x211f59=_0x1830d2[_0x48b5('0xb0')];if(this['isConfigured'](_0x1830d2[_0x48b5('0x7c')])){_0x211f59+=','+_0x1830d2[_0x48b5('0x7c')];}var _0x58eee5=this[_0x48b5('0xe')][_0x48b5('0x5d')](_0x48b5('0xb2'),_0x211f59);if(_0x58eee5[_0x48b5('0xab')]===-0x1){return _0x58eee5;}var _0xdd0d86=this[_0x48b5('0xb3')](_0x48b5('0xb4'),_0x48b5('0xcf'));if(_0xdd0d86[_0x48b5('0xab')]===-0x1){return _0xdd0d86;}var _0x54fb18=this['getAndSetVariable'](_0x48b5('0xb6'),_0x48b5('0xd0'));if(_0x54fb18[_0x48b5('0xab')]===-0x1){return _0x54fb18;}var _0x305919=this[_0x48b5('0xb3')](_0x48b5('0xb8'),_0x48b5('0xd1'));if(_0x305919[_0x48b5('0xab')]===-0x1){return _0x305919;}return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0xba'),_0x211f59));};AGIVertices[_0x48b5('0x10')][_0x48b5('0xd2')]=function(_0xa47ae4){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0xd3'),_0xa47ae4['label']));if(!this[_0x48b5('0xa6')](_0xa47ae4[_0x48b5('0xb0')])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0xb1'));}var _0x5de160=_0xa47ae4[_0x48b5('0xb0')];if(this[_0x48b5('0xa6')](_0xa47ae4[_0x48b5('0x7c')])){_0x5de160+=','+_0xa47ae4[_0x48b5('0x7c')];}var _0x26837b=this[_0x48b5('0xe')][_0x48b5('0x5d')](_0x48b5('0xb2'),_0x5de160);if(_0x26837b['result']===-0x1){return _0x26837b;}var _0x4e675f=this[_0x48b5('0xb3')](_0x48b5('0xb4'),_0x48b5('0xd4'));if(_0x4e675f[_0x48b5('0xab')]===-0x1){return _0x4e675f;}var _0x45b3bc=this[_0x48b5('0xb3')](_0x48b5('0xb6'),_0x48b5('0xd5'));if(_0x45b3bc[_0x48b5('0xab')]===-0x1){return _0x45b3bc;}var _0x5b8f0e=this[_0x48b5('0xb3')](_0x48b5('0xb8'),_0x48b5('0xd6'));if(_0x5b8f0e[_0x48b5('0xab')]===-0x1){return _0x5b8f0e;}return this[_0x48b5('0xe')]['noop'](util[_0x48b5('0x2a')](_0x48b5('0xba'),_0x5de160));};AGIVertices[_0x48b5('0x10')]['database']=function(_0x10d697){logger['info'](util[_0x48b5('0x2a')](_0x48b5('0xd7'),_0x10d697[_0x48b5('0x3b')]));if(!this['isConfigured'](_0x10d697[_0x48b5('0xd8')])){return this[_0x48b5('0xe')]['error'](_0x10d697,_0x48b5('0xd9'));}var _0x19612c=this['getSquareOdbc'][_0x48b5('0x76')](this,_0x10d697['odbc_id']);if(!_0x19612c){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x10d697,_0x48b5('0xda'));}if(!this['isConfigured'](_0x10d697[_0x48b5('0x31')])){return this[_0x48b5('0xe')]['error'](_0x10d697,'no\x20query\x20configured');}var _0x16661e=_0x10d697[_0x48b5('0x31')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x48b5('0xe')]['noop'](util[_0x48b5('0x2a')](_0x48b5('0xdb'),_0x16661e));var _0x19cebb=this[_0x48b5('0x2c')][_0x48b5('0x76')](this,_0x19612c,_0x16661e);this[_0x48b5('0x39')]['sync'](this,_0x10d697,_0x16661e);if(!this[_0x48b5('0xa6')](_0x10d697['variable_id'])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0xdc'));}var _0x2355d7=this['getVariable'][_0x48b5('0x76')](this,_0x10d697[_0x48b5('0xdd')]);if(!_0x2355d7){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x10d697,_0x48b5('0xde'));}var _0x28b233=this;_0x19cebb['forEach'](function(_0x1a1668,_0x5b37f0){Object[_0x48b5('0xdf')](_0x1a1668)[_0x48b5('0xe0')](function(_0x3f6e31){_0x28b233[_0x48b5('0xe')][_0x48b5('0xa2')](util[_0x48b5('0x2a')](_0x48b5('0xe1'),_0x2355d7,_0x5b37f0,_0x3f6e31),_0x1a1668[_0x3f6e31]);});});this[_0x48b5('0xe')][_0x48b5('0xa2')](util[_0x48b5('0x2a')](_0x48b5('0xe2'),_0x2355d7),_0x19cebb['length']);return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0xe3'),_0x2355d7));};AGIVertices['prototype'][_0x48b5('0xe4')]=function(_0x414cfb){logger['debug'](util[_0x48b5('0x2a')](_0x48b5('0xe5'),_0x414cfb[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x414cfb[_0x48b5('0xe6')])){return this['channel'][_0x48b5('0x35')](_0x414cfb,_0x48b5('0xe7'));}var _0xae7027=this[_0x48b5('0x1c')][_0x48b5('0x76')](this,_0x414cfb['sip_id']);if(!_0xae7027){return this['channel'][_0x48b5('0x35')](_0x414cfb,_0x48b5('0xe8'));}var _0x121455=this['channel'][_0x48b5('0x5d')](_0x48b5('0xe9'),[util[_0x48b5('0x2a')](_0x48b5('0xea'),_0xae7027),_0x414cfb['timeout'],_0x414cfb[_0x48b5('0xeb')],_0x414cfb[_0x48b5('0x69')]]);if(_0x121455[_0x48b5('0xab')]===-0x1){return _0x121455;}return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0xec'),_0x48b5('0xe9')));};AGIVertices[_0x48b5('0x10')][_0x48b5('0xed')]=function(_0x3318a2){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0xee'),_0x3318a2[_0x48b5('0x3b')]));if(!this['isConfigured'](_0x3318a2[_0x48b5('0x7e')])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0xef'));}if(!this[_0x48b5('0xa6')](_0x3318a2[_0x48b5('0x62')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x48b5('0xe')]['bot']=!![];this[_0x48b5('0x39')](_0x3318a2);this[_0x48b5('0x45')](_0x3318a2[_0x48b5('0x62')],'in','','');this['channel'][_0x48b5('0xac')](util[_0x48b5('0x2a')]('Trying\x20Dialogflow:\x20%s',_0x3318a2[_0x48b5('0x62')]));var _0x52772a=this['googleDialogflow'][_0x48b5('0x76')](this,_0x3318a2);if(_0x52772a){for(var _0x571866 in _0x52772a){if(_0x52772a[_0x48b5('0x99')](_0x571866)){this[_0x48b5('0xe')][_0x48b5('0xa2')](util[_0x48b5('0x2a')](_0x48b5('0xf0'),_0x571866[_0x48b5('0x70')]()),_0x52772a[_0x571866]);}}this['createSquareMessage'](_0x52772a[_0x48b5('0xf1')],_0x48b5('0xf2'),_0x48b5('0xed'),'');return this[_0x48b5('0xe')]['noop'](util['format']('Dialogflow\x20Result\x20%s',_0x52772a[_0x48b5('0xf1')]));}return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x3318a2,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x48b5('0x10')]['dialogflowV2']=function(_0x3b311b){logger['info'](util[_0x48b5('0x2a')](_0x48b5('0xf3'),_0x3b311b[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x3b311b[_0x48b5('0x80')])){return this[_0x48b5('0xe')]['noop']('no\x20project_id\x20configured');}if(!this[_0x48b5('0xa6')](_0x3b311b[_0x48b5('0x81')])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0xf4'));}if(!this[_0x48b5('0xa6')](_0x3b311b['private_key'])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0xf5'));}if(!this[_0x48b5('0xa6')](_0x3b311b['dialogflowV2_language'])){return this[_0x48b5('0xe')][_0x48b5('0xac')]('no\x20anguage\x20configured');}if(!this[_0x48b5('0xa6')](_0x3b311b[_0x48b5('0x62')])){return this[_0x48b5('0xe')][_0x48b5('0xac')]('no\x20text\x20configured');}this['channel'][_0x48b5('0xf6')]=!![];this[_0x48b5('0x39')](_0x3b311b);this[_0x48b5('0x45')](_0x3b311b[_0x48b5('0x62')],'in','','');this[_0x48b5('0xe')]['noop'](util['format'](_0x48b5('0xf7'),_0x3b311b[_0x48b5('0x62')]));var _0x38b091=this[_0x48b5('0x7f')][_0x48b5('0x76')](this,_0x3b311b);if(_0x38b091){for(var _0x386c9b in _0x38b091){if(_0x38b091[_0x48b5('0x99')](_0x386c9b)){if(_0x386c9b!==_0x48b5('0xf8')){this[_0x48b5('0xe')]['setVariable'](util['format'](_0x48b5('0xf0'),_0x386c9b[_0x48b5('0x70')]()),_0x38b091[_0x386c9b]);}}}this[_0x48b5('0x45')](_0x38b091[_0x48b5('0xf1')],_0x48b5('0xf2'),_0x48b5('0xf9'),_0x38b091[_0x48b5('0xf8')]);return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0xfa'),_0x38b091[_0x48b5('0xf1')]));}return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x3b311b,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x48b5('0x10')]['sesteknda']=function(_0x15182d){logger[_0x48b5('0x2f')](util['format'](_0x48b5('0xfb'),_0x15182d[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x15182d[_0x48b5('0xfc')])){return this[_0x48b5('0xe')]['noop'](_0x48b5('0xfd'));}if(!this[_0x48b5('0xa6')](_0x15182d['username'])){return this[_0x48b5('0xe')][_0x48b5('0xac')]('no\x20username\x20configured');}if(!this[_0x48b5('0xa6')](_0x15182d[_0x48b5('0xfe')])){return this[_0x48b5('0xe')]['noop'](_0x48b5('0xff'));}if(!this[_0x48b5('0xa6')](_0x15182d[_0x48b5('0x100')])){return this[_0x48b5('0xe')]['noop'](_0x48b5('0xcc'));}this['channel'][_0x48b5('0xf6')]=!![];this[_0x48b5('0x39')](_0x15182d);this[_0x48b5('0x45')](_0x15182d[_0x48b5('0x62')],'in','','');this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x101'),_0x15182d['text']));var _0x421564=this[_0x48b5('0x84')]['sync'](this,_0x15182d);if(_0x421564){for(var _0x58bd12 in _0x421564){if(_0x421564[_0x48b5('0x99')](_0x58bd12)){this[_0x48b5('0xe')][_0x48b5('0xa2')](util[_0x48b5('0x2a')]('SESTEK_NDA_%s',_0x58bd12['toUpperCase']()),_0x421564[_0x58bd12]);}}this['createSquareMessage'](_0x421564['speech'],_0x48b5('0xf2'),_0x48b5('0x102'),'');if(_0x421564['audiofile']){this[_0x48b5('0xe')][_0x48b5('0xac')](util['format'](_0x48b5('0x103'),_0x421564[_0x48b5('0x104')]));var _0x2d7273=this[_0x48b5('0xe')]['streamFile'](_0x421564[_0x48b5('0x104')]);try{fs['unlink'](_0x421564[_0x48b5('0x104')]+_0x48b5('0x105'));}catch(_0x3578c6){logger[_0x48b5('0x35')](_0x3578c6);}return _0x2d7273;}else{return this['channel']['noop'](util[_0x48b5('0x2a')](_0x48b5('0x106'),_0x421564['speech']));}}return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x15182d,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x48b5('0x10')][_0x48b5('0x107')]=function(_0x2d52fe){logger[_0x48b5('0x2f')](util['format'](_0x48b5('0x108'),_0x2d52fe[_0x48b5('0x3b')]));return this[_0x48b5('0xe')][_0x48b5('0xac')]('end');};AGIVertices[_0x48b5('0x10')][_0x48b5('0x109')]=function(_0x169816){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x10a'),_0x169816[_0x48b5('0x3b')]));var _0x3b5cda='';if(_0x169816[_0x48b5('0x10b')]){if(!this[_0x48b5('0xa6')](_0x169816[_0x48b5('0x10b')])){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x169816,'no\x20trunk\x20selected');}else{var _0x21723c=parseInt(_0x169816[_0x48b5('0x10b')],0xa);if(isNaN(_0x21723c)){_0x3b5cda=_0x169816['trunk_id'];}else{_0x3b5cda=this[_0x48b5('0x1e')][_0x48b5('0x76')](this,_0x169816[_0x48b5('0x10b')]);if(!_0x3b5cda){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x169816,_0x48b5('0x10c'));}}}}else if(_0x169816[_0x48b5('0x10d')]){_0x3b5cda=_0x169816[_0x48b5('0x10d')];}else{return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x169816,_0x48b5('0x10e'));}var _0x4b318a=this[_0x48b5('0xe')][_0x48b5('0x5d')](_0x48b5('0xe9'),[util[_0x48b5('0x2a')](_0x48b5('0x10f'),_0x3b5cda,_0x169816['phone']),_0x169816[_0x48b5('0x6b')],_0x169816['opts'],_0x169816['url']]);if(_0x4b318a['result']===-0x1){return _0x4b318a;}return this[_0x48b5('0xe')][_0x48b5('0xac')](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x48b5('0x10')][_0x48b5('0x110')]=function(_0x59b296){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x59b296[_0x48b5('0x3b')]));return this[_0x48b5('0xe')][_0x48b5('0xac')]('finally');};AGIVertices[_0x48b5('0x10')][_0x48b5('0xc')]=function(_0x12f2d7){logger[_0x48b5('0x2f')](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x12f2d7['label']));if(_0x12f2d7[_0x48b5('0x111')]===0x0){return this[_0x48b5('0xa7')](_0x12f2d7);}_0x12f2d7[_0x48b5('0x111')]-=0x1;if(!this[_0x48b5('0xa6')](_0x12f2d7['file_id'])){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x12f2d7,_0x48b5('0x112'));}var _0x4ee88f=this['getSound'][_0x48b5('0x76')](this,_0x12f2d7['file_id']);if(!_0x4ee88f){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x12f2d7,_0x48b5('0x113'));}if(!this[_0x48b5('0xa6')](_0x12f2d7[_0x48b5('0xdd')])){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x48b5('0xdc'));}var _0x35ae5c=this[_0x48b5('0xe')][_0x48b5('0x114')](_0x4ee88f,_0x12f2d7['response'],_0x12f2d7['maxdigit']);var _0xe95d95=_0x35ae5c[_0x48b5('0xab')]?_0x35ae5c[_0x48b5('0xab')][_0x48b5('0x50')]():'';logger[_0x48b5('0x2f')](_0x48b5('0x115'),JSON[_0x48b5('0x79')](_0x35ae5c));if(_0x35ae5c[_0x48b5('0xab')]===-0x1){this['createSquareDetailsReport'][_0x48b5('0x76')](this,_0x12f2d7,_0xe95d95);return _0x35ae5c;}else if(_0x35ae5c[_0x48b5('0xa4')]===_0x48b5('0x6b')){_0x35ae5c[_0x48b5('0xab')]=_0xe95d95[_0x48b5('0x9e')]>=parseInt(_0x12f2d7[_0x48b5('0x116')])?'x':'i';}else{_0x35ae5c[_0x48b5('0xab')]=_0xe95d95[_0x48b5('0x9e')]>=parseInt(_0x12f2d7[_0x48b5('0x116')])&&_0xe95d95[_0x48b5('0x9e')]<=parseInt(_0x12f2d7[_0x48b5('0x117')])?'x':'i';}var _0x442fdb=this[_0x48b5('0x11')][_0x48b5('0x76')](this,_0x12f2d7['variable_id']);if(!_0x442fdb){return this['channel'][_0x48b5('0x35')](_0x12f2d7,_0x48b5('0xde'));}this['channel'][_0x48b5('0xa2')](_0x442fdb,_0xe95d95);if(this[_0x48b5('0xa6')](_0x12f2d7['hiddendigitsnum'])){var _0x3daea9=parseInt(_0x12f2d7['hiddendigitsnum'],0xa);var _0x40b5d9=rs[_0x48b5('0x118')]({'charset':'*','length':_0x3daea9});var _0x4dcf1f=_0xe95d95[_0x48b5('0x9e')];if(_0x4dcf1f>0x0){if(_0x4dcf1f>_0x3daea9){this['createSquareDetailsReport'][_0x48b5('0x76')](this,_0x12f2d7,_0x12f2d7['hiddendigitspos']===_0x48b5('0x119')?_0x40b5d9+_0xe95d95[_0x48b5('0x11a')](_0x3daea9):_0xe95d95[_0x48b5('0x11a')](0x0,_0x4dcf1f-_0x3daea9)+_0x40b5d9);}else{this[_0x48b5('0x39')][_0x48b5('0x76')](this,_0x12f2d7,rs[_0x48b5('0x118')]({'charset':'*','length':_0x4dcf1f}));}}else{this[_0x48b5('0x39')]['sync'](this,_0x12f2d7,'');}}else{this[_0x48b5('0x39')][_0x48b5('0x76')](this,_0x12f2d7,_0xe95d95);}return _0x35ae5c;};AGIVertices[_0x48b5('0x10')][_0x48b5('0xd')]=function(_0x76025){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x11b'),_0x76025[_0x48b5('0x3b')]));return this[_0x48b5('0xc')](_0x76025);};AGIVertices[_0x48b5('0x10')][_0x48b5('0x11c')]=function(_0x124bcd){logger[_0x48b5('0x2f')](util['format'](_0x48b5('0x11d'),_0x124bcd[_0x48b5('0x3b')]));this[_0x48b5('0x39')]['sync'](this,_0x124bcd,_0x124bcd[_0x48b5('0x11e')]);return this[_0x48b5('0xe')][_0x48b5('0xac')](util['format'](_0x48b5('0x11f'),_0x124bcd[_0x48b5('0x11e')]));};AGIVertices[_0x48b5('0x10')][_0x48b5('0x120')]=function(_0x7ae11f){logger['info'](util[_0x48b5('0x2a')](_0x48b5('0x121'),_0x7ae11f['label']));if(!this[_0x48b5('0xa6')](_0x7ae11f['aws_access_key_id'])||!this[_0x48b5('0xa6')](_0x7ae11f[_0x48b5('0x90')])){return this[_0x48b5('0xe')]['noop'](_0x48b5('0x122'));}if(!this['isConfigured'](_0x7ae11f[_0x48b5('0x62')])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0xcc'));}this[_0x48b5('0xe')]['noop'](util[_0x48b5('0x2a')]('Trying\x20aws\x20Polly\x20%s',_0x7ae11f[_0x48b5('0x62')]));var _0x52a9dc=this[_0x48b5('0x8a')]['sync'](this,_0x7ae11f);if(_0x52a9dc){this['channel']['noop'](util[_0x48b5('0x2a')](_0x48b5('0x123'),_0x52a9dc));var _0x19e5ea=this[_0x48b5('0xe')]['streamFile'](_0x52a9dc);try{fs[_0x48b5('0x124')](_0x52a9dc+_0x48b5('0x105'));}catch(_0x5dcea9){logger['error'](_0x5dcea9);}return _0x19e5ea;}return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x7ae11f,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x48b5('0x10')][_0x48b5('0x125')]=function(_0x4e08a1){logger[_0x48b5('0x2f')](util['format'](_0x48b5('0x126'),_0x4e08a1[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x4e08a1[_0x48b5('0x8f')])||!this[_0x48b5('0xa6')](_0x4e08a1[_0x48b5('0x90')])){return this[_0x48b5('0xe')][_0x48b5('0xac')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x4e08a1[_0x48b5('0x127')])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0x128'));}if(!this[_0x48b5('0xa6')](_0x4e08a1[_0x48b5('0x62')])){return this[_0x48b5('0xe')]['noop'](_0x48b5('0xcc'));}this[_0x48b5('0xe')]['bot']=!![];this['createSquareDetailsReport'](_0x4e08a1);this[_0x48b5('0x45')](_0x4e08a1[_0x48b5('0x62')],'in','','');this['channel'][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x129'),_0x4e08a1[_0x48b5('0x62')]));var _0x1c0231=this[_0x48b5('0x8e')][_0x48b5('0x76')](this,_0x4e08a1);if(_0x1c0231){for(var _0x1ec9a9 in _0x1c0231){if(_0x1c0231[_0x48b5('0x99')](_0x1ec9a9)&&_['isString'](_0x1c0231[_0x1ec9a9])){this['channel'][_0x48b5('0xa2')](util['format'](_0x48b5('0x12a'),_0x1ec9a9['toUpperCase']()),_0x1c0231[_0x1ec9a9]);}}if(_[_0x48b5('0x48')](_0x1c0231[_0x48b5('0x12b')])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0x12c'));}else{this[_0x48b5('0x45')](_0x1c0231[_0x48b5('0x12b')],_0x48b5('0xf2'),_0x48b5('0x12d'),'');return this['channel'][_0x48b5('0xac')](util[_0x48b5('0x2a')]('Amazon\x20Lex\x20Result\x20%s',_0x1c0231[_0x48b5('0x12b')]));}}return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x4e08a1,_0x48b5('0x12e'));};AGIVertices[_0x48b5('0x10')][_0x48b5('0x12f')]=function(_0x38d49b){logger['info'](util[_0x48b5('0x2a')](_0x48b5('0x130'),_0x38d49b[_0x48b5('0x3b')],_0x38d49b[_0x48b5('0x6b')]));if(!this[_0x48b5('0xa6')](_0x38d49b[_0x48b5('0x7e')])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0xef'));}var _0x3c6238=_0x48b5('0x131');var _0x359851=util[_0x48b5('0x2a')](_0x48b5('0x132'),FILES_PATH,rs[_0x48b5('0x118')](0x4));var _0x4e8d5f=util[_0x48b5('0x2a')](_0x48b5('0xa1'),_0x359851,_0x3c6238);var _0x1360ac=!![];if(_0x38d49b[_0x48b5('0x133')]==='NOBEEP'){_0x1360ac=![];}var _0x54fd88=this['channel'][_0x48b5('0x134')](_0x359851,_0x3c6238,_0x38d49b['intKey'],_0x38d49b[_0x48b5('0x6b')],undefined,_0x1360ac);if(_0x54fd88[_0x48b5('0xab')]!==-0x1){this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')]('google\x20%s\x20file\x20created',_0x4e8d5f));var _0x413825=this[_0x48b5('0x92')][_0x48b5('0x76')](this,_0x38d49b,_0x4e8d5f);if(_0x413825){for(var _0x574d2a in _0x413825){if(_0x413825[_0x48b5('0x99')](_0x574d2a)){this[_0x48b5('0xe')][_0x48b5('0xa2')](util['format']('GOOGLE_ASR_%s',_0x574d2a[_0x48b5('0x70')]()),_0x413825[_0x574d2a]);}}return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x135'),JSON[_0x48b5('0x79')](_0x413825)));}}return _0x54fd88;};AGIVertices['prototype'][_0x48b5('0x136')]=function(_0xb9426b){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x137'),_0xb9426b[_0x48b5('0x3b')]));if(!this['isConfigured'](_0xb9426b['appid'])){return this[_0x48b5('0xe')][_0x48b5('0xac')]('no\x20appid\x20configured');}if(!this[_0x48b5('0xa6')](_0xb9426b[_0x48b5('0x95')])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0x138'));}var _0x2a586b=_0x48b5('0x131');var _0x1c376c=util[_0x48b5('0x2a')](_0x48b5('0x132'),FILES_PATH,rs[_0x48b5('0x118')](0x4));var _0x1441c9=util['format'](_0x48b5('0xa1'),_0x1c376c,_0x2a586b);var _0x5f585c=!![];if(_0xb9426b[_0x48b5('0x133')]===_0x48b5('0x139')){_0x5f585c=![];}var _0x408925=this[_0x48b5('0xe')][_0x48b5('0x134')](_0x1c376c,_0x2a586b,_0xb9426b['intKey'],_0xb9426b[_0x48b5('0x6b')],undefined,_0x5f585c);if(_0x408925['result']!==-0x1){this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x13a'),_0x1441c9));var _0x28c343=this[_0x48b5('0x94')][_0x48b5('0x76')](this,_0xb9426b,_0x1441c9);if(_0x28c343){for(var _0xa7f295 in _0x28c343){if(_0x28c343['hasOwnProperty'](_0xa7f295)){this['channel'][_0x48b5('0xa2')](util['format'](_0x48b5('0x13b'),_0xa7f295['toUpperCase']()),_0x28c343[_0xa7f295]);}}return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x13c'),JSON[_0x48b5('0x79')](_0x28c343)));}}return _0x408925;};AGIVertices[_0x48b5('0x10')][_0x48b5('0x13d')]=function(_0x54d7f2){logger['info'](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x54d7f2[_0x48b5('0x3b')]));return this['channel']['continueAt'](_0x54d7f2[_0x48b5('0x40')],_0x54d7f2[_0x48b5('0x41')],_0x54d7f2[_0x48b5('0x42')]);};AGIVertices['prototype'][_0x48b5('0x13e')]=function(_0x499b2d){logger[_0x48b5('0x2f')](util['format'](_0x48b5('0x13f'),_0x499b2d['label']));if(!this[_0x48b5('0xa6')](_0x499b2d[_0x48b5('0x140')])){return this[_0x48b5('0xe')]['error'](_0x499b2d,_0x48b5('0x141'));}try{var _0x10a249=eval(_0x499b2d[_0x48b5('0x140')])?_0x48b5('0x142'):'false';this[_0x48b5('0xe')]['noop'](util['format'](_0x48b5('0x143'),_0x499b2d[_0x48b5('0x140')],_0x10a249));return{'code':0xc8,'result':_0x10a249};}catch(_0x58f232){return{'code':0xc8,'result':_0x48b5('0x144')};}};AGIVertices[_0x48b5('0x10')]['gotoiftime']=function(_0x331596){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x145'),_0x331596[_0x48b5('0x3b')]));if(!this['isConfigured'](_0x331596[_0x48b5('0x146')])){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x331596,_0x48b5('0x147'));}var _0x21b836=this[_0x48b5('0x25')][_0x48b5('0x76')](this,_0x331596[_0x48b5('0x146')]);if(!_0x21b836){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x331596,_0x48b5('0x148'));}for(var _0x9e0597=0x0;_0x9e0597<_0x21b836[_0x48b5('0x9e')];_0x9e0597+=0x1){var _0x27254c=this[_0x48b5('0xe')]['getVariable'](util['format'](_0x48b5('0x149'),_0x21b836[_0x9e0597]));if(_0x27254c['result']===-0x1){return _0x27254c;}logger[_0x48b5('0x2f')](util['format'](_0x48b5('0x14a'),_0x21b836[_0x9e0597],_0x27254c['extra']));if(_0x27254c[_0x48b5('0xa4')]===_0x48b5('0x142')){logger['info'](util[_0x48b5('0x2a')](_0x48b5('0x14a'),_0x21b836[_0x9e0597],_0x48b5('0x142')));this['channel'][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x14a'),_0x21b836[_0x9e0597],_0x48b5('0x142')));return{'code':0xc8,'result':_0x48b5('0x142')};}else{logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')]('IFTIME\x20%s\x20%s',_0x21b836[_0x9e0597],_0x48b5('0x144')));this['channel'][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x14a'),_0x21b836[_0x9e0597],_0x48b5('0x144')));}}return{'code':0xc8,'result':_0x48b5('0x144')};};AGIVertices[_0x48b5('0x10')][_0x48b5('0x14b')]=function(_0x5158cc){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x14c'),_0x5158cc[_0x48b5('0x3b')]));return this['channel']['hangup']();};AGIVertices['prototype'][_0x48b5('0x14d')]=function(_0x572020){logger['info'](util[_0x48b5('0x2a')](_0x48b5('0x14e'),_0x572020[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x572020[_0x48b5('0x7e')])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0xef'));}var _0xeeb43c=_0x48b5('0x131');var _0x11636d=util[_0x48b5('0x2a')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x33c898=util['format'](_0x48b5('0xa1'),_0x11636d,_0xeeb43c);var _0x174e56=!![];if(_0x572020[_0x48b5('0x133')]===_0x48b5('0x139')){_0x174e56=![];}var _0x49b51d=this[_0x48b5('0xe')][_0x48b5('0x134')](_0x11636d,_0xeeb43c,_0x572020['intKey'],_0x572020['timeout'],undefined,_0x174e56);if(_0x49b51d['result']!==-0x1){this[_0x48b5('0xe')]['noop'](util['format'](_0x48b5('0x14f'),_0x33c898));var _0x6e81c6=this[_0x48b5('0x87')][_0x48b5('0x76')](this,_0x572020,_0x33c898);if(_0x6e81c6){for(var _0x34d18e in _0x6e81c6){if(_0x6e81c6[_0x48b5('0x99')](_0x34d18e)){this[_0x48b5('0xe')][_0x48b5('0xa2')](util['format']('ISPEECH_ASR_%s',_0x34d18e[_0x48b5('0x70')]()),_0x6e81c6[_0x34d18e]);}}return this['channel']['noop'](util[_0x48b5('0x2a')](_0x48b5('0x150'),JSON[_0x48b5('0x79')](_0x6e81c6)));}}return _0x49b51d;};AGIVertices[_0x48b5('0x10')][_0x48b5('0x151')]=function(_0x3ffa83){logger['info'](util[_0x48b5('0x2a')](_0x48b5('0x152'),_0x3ffa83[_0x48b5('0x3b')]));if(!this['isConfigured'](_0x3ffa83[_0x48b5('0x7e')])){return this[_0x48b5('0xe')]['noop']('no\x20key\x20configured');}if(!this[_0x48b5('0xa6')](_0x3ffa83[_0x48b5('0x62')])){return this['channel'][_0x48b5('0xac')](_0x48b5('0xcc'));}this[_0x48b5('0xe')]['noop'](util[_0x48b5('0x2a')](_0x48b5('0x153'),_0x3ffa83['text']));var _0x52f8f5=this[_0x48b5('0x85')][_0x48b5('0x76')](this,_0x3ffa83);if(_0x52f8f5){this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x14f'),_0x52f8f5));var _0xfce17d=this[_0x48b5('0xe')][_0x48b5('0x154')](_0x52f8f5,_0x3ffa83['intKey']);try{fs[_0x48b5('0x124')](_0x52f8f5+_0x48b5('0x105'));}catch(_0x5a0fe0){logger[_0x48b5('0x35')](_0x5a0fe0);}return _0xfce17d;}return this['channel'][_0x48b5('0x35')](_0x3ffa83,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x48b5('0x10')]['login']=function(_0x5e8856){logger[_0x48b5('0x2f')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x5e8856[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x5e8856['findBy'])){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x5e8856,'no\x20find\x20by\x20configured');}logger[_0x48b5('0x2f')](util['format'](_0x48b5('0x155'),this[_0x48b5('0xe')][_0x48b5('0x3e')],_0x5e8856[_0x48b5('0x156')]));var _0x175ccf=this[_0x48b5('0x58')][_0x48b5('0x76')](this,_0x5e8856[_0x48b5('0x156')]);if(_0x175ccf){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x48b5('0xe')][_0x48b5('0x3e')],_0x5e8856['findBy']));this[_0x48b5('0xe')][_0x48b5('0xac')](util['format'](_0x48b5('0x157'),this['channel'][_0x48b5('0x3e')],_0x5e8856[_0x48b5('0x156')]));return{'code':0xc8,'result':_0x48b5('0x158')};}else{logger[_0x48b5('0x2f')](util['format'](_0x48b5('0x159'),this['channel'][_0x48b5('0x3e')],_0x5e8856[_0x48b5('0x156')]));this[_0x48b5('0xe')]['noop'](util[_0x48b5('0x2a')](_0x48b5('0x159'),this[_0x48b5('0xe')]['callerid'],_0x5e8856[_0x48b5('0x156')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x48b5('0x10')][_0x48b5('0x15a')]=function(_0x132494){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x132494[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x132494[_0x48b5('0x156')])){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x132494,_0x48b5('0x15b'));}logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x155'),this['channel'][_0x48b5('0x3e')],_0x132494['findBy']));var _0x93dc30=this[_0x48b5('0x57')]['sync'](this,_0x132494[_0x48b5('0x156')]);if(_0x93dc30){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x48b5('0xe')][_0x48b5('0x3e')],_0x132494['findBy']));this['channel'][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x157'),this[_0x48b5('0xe')][_0x48b5('0x3e')],_0x132494['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x48b5('0x2a')](_0x48b5('0x159'),this[_0x48b5('0xe')][_0x48b5('0x3e')],_0x132494[_0x48b5('0x156')]));this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x48b5('0x3e')],_0x132494[_0x48b5('0x156')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['math']=function(_0x4747c5){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x15c'),_0x4747c5[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x4747c5['operation'])){return this[_0x48b5('0xe')]['error'](_0x4747c5,_0x48b5('0x15d'));}this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x15e'),_0x4747c5['operation']));var _0x2a7033=eval(_0x4747c5[_0x48b5('0x15f')]);if(!this[_0x48b5('0xa6')](_0x4747c5['variable_id'])){return this['channel'][_0x48b5('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3bcedc=this[_0x48b5('0x11')]['sync'](this,_0x4747c5['variable_id']);if(!_0x3bcedc){return this['channel'][_0x48b5('0x35')](_0x4747c5,_0x48b5('0xde'));}if(_[_0x48b5('0x160')](_0x2a7033)){var _0x5a7644=this;_0x2a7033[_0x48b5('0xe0')](function(_0x36af6d,_0x2ad98e){_0x5a7644[_0x48b5('0xe')][_0x48b5('0xa2')](util[_0x48b5('0x2a')](_0x48b5('0x161'),_0x3bcedc,_0x2ad98e),_0x36af6d);});return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x162'),_0x3bcedc));}else{return this[_0x48b5('0xe')][_0x48b5('0xa2')](_0x3bcedc,_0x2a7033);}};AGIVertices['prototype']['menu']=function(_0x1d3f67){logger[_0x48b5('0x2f')](util['format'](_0x48b5('0x163'),_0x1d3f67['label']));if(_0x1d3f67['retry']===0x0){return this[_0x48b5('0xa7')](_0x1d3f67);}_0x1d3f67[_0x48b5('0x111')]-=0x1;if(!this['isConfigured'](_0x1d3f67[_0x48b5('0x164')])){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x1d3f67,_0x48b5('0x112'));}var _0x4459fb=this[_0x48b5('0x20')][_0x48b5('0x76')](this,_0x1d3f67[_0x48b5('0x164')]);if(!_0x4459fb){return this['channel'][_0x48b5('0x35')](_0x1d3f67,_0x48b5('0x113'));}var _0x4d6301=this[_0x48b5('0xe')][_0x48b5('0x114')](_0x4459fb,_0x1d3f67[_0x48b5('0x165')],_0x1d3f67[_0x48b5('0x166')]);var _0x16184e=_0x4d6301['result'];if(_0x4d6301['result']===-0x1){this['createSquareDetailsReport'][_0x48b5('0x76')](this,_0x1d3f67,'-1');return _0x4d6301;}else if(_0x4d6301[_0x48b5('0xa4')]===_0x48b5('0x6b')){_0x4d6301[_0x48b5('0xab')]=_0x4d6301[_0x48b5('0xab')]['length']>0x0?_0x4d6301['result']:'t';}else if(_['isEmpty'](_0x4d6301['result'])){_0x4d6301['result']='#';_0x16184e='#';}if(!this[_0x48b5('0xa6')](_0x1d3f67[_0x48b5('0xdd')])){this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0xdc'));}else{var _0x38224d=this['getVariable']['sync'](this,_0x1d3f67[_0x48b5('0xdd')]);if(!_0x38224d){return this['channel'][_0x48b5('0x35')](_0x1d3f67,'no\x20variable\x20found');}this['channel'][_0x48b5('0xa2')](_0x38224d,_0x16184e);}this[_0x48b5('0x39')][_0x48b5('0x76')](this,_0x1d3f67,_0x16184e);return _0x4d6301;};AGIVertices[_0x48b5('0x10')]['noop']=function(_0x17b0a7){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x167'),_0x17b0a7['label']));return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x17b0a7[_0x48b5('0x168')]||_0x17b0a7['label']);};AGIVertices['prototype'][_0x48b5('0x169')]=function(_0x365b11){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x16a'),_0x365b11['label']));if(!this[_0x48b5('0xa6')](_0x365b11[_0x48b5('0x156')])){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x365b11,'no\x20find\x20by\x20configured');}logger['info'](util[_0x48b5('0x2a')](_0x48b5('0x155'),this['channel'][_0x48b5('0x3e')],_0x365b11[_0x48b5('0x156')]));var _0x233df7=this[_0x48b5('0x52')][_0x48b5('0x76')](this,_0x365b11[_0x48b5('0x16b')]);var _0x33787c=this['agentPause']['sync'](this,_0x365b11[_0x48b5('0x156')],_0x233df7);if(_0x33787c){logger['info'](util[_0x48b5('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x48b5('0xe')][_0x48b5('0x3e')],_0x365b11[_0x48b5('0x156')]));this[_0x48b5('0xe')]['noop'](util[_0x48b5('0x2a')](_0x48b5('0x157'),this['channel'][_0x48b5('0x3e')],_0x365b11[_0x48b5('0x156')]));return{'code':0xc8,'result':_0x48b5('0x158')};}else{logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x48b5('0x3e')],_0x365b11[_0x48b5('0x156')]));this[_0x48b5('0xe')][_0x48b5('0xac')](util['format'](_0x48b5('0x157'),this[_0x48b5('0xe')]['callerid'],_0x365b11[_0x48b5('0x156')]));return{'code':0xc8,'result':_0x48b5('0x16c')};}};AGIVertices[_0x48b5('0x10')]['playback']=function(_0x52c242){logger['info'](util[_0x48b5('0x2a')](_0x48b5('0x16d'),_0x52c242[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x52c242['file_id'])){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x52c242,_0x48b5('0x112'));}var _0xe39f84=this[_0x48b5('0x20')][_0x48b5('0x76')](this,_0x52c242[_0x48b5('0x164')]);if(!_0xe39f84){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x52c242,_0x48b5('0x113'));}var _0x33b20b=this[_0x48b5('0xe')]['exec'](_0x48b5('0x16e'),[_0xe39f84,_0x52c242['opts']]);if(_0x33b20b[_0x48b5('0xab')]===-0x1){return _0x33b20b;}return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0xc9'),_0x48b5('0x16e'),_0xe39f84));};AGIVertices[_0x48b5('0x10')]['queue']=function(_0x34e197){logger[_0x48b5('0x2f')](util['format'](_0x48b5('0x16f'),_0x34e197[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x34e197[_0x48b5('0x170')])){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x34e197,_0x48b5('0x171'));}var _0x463c19='';var _0x3cdf02=parseInt(_0x34e197[_0x48b5('0x170')],0xa);if(isNaN(_0x3cdf02)){_0x463c19=_0x34e197[_0x48b5('0x170')];}else{_0x463c19=this['getVoiceQueue'][_0x48b5('0x76')](this,_0x34e197[_0x48b5('0x170')]);if(!_0x463c19){return this['channel'][_0x48b5('0x35')](_0x34e197,_0x48b5('0x172'));}}var _0x17bf23='';if(this['isConfigured'](_0x34e197[_0x48b5('0x164')])){var _0x4a4692=this[_0x48b5('0x20')]['sync'](this,_0x34e197[_0x48b5('0x164')]);if(_0x4a4692){_0x17bf23=_0x4a4692;}}this[_0x48b5('0x39')][_0x48b5('0x76')](this,_0x34e197,_0x463c19);if(_0x34e197[_0x48b5('0xeb')][_0x48b5('0x173')]('x')<0x0){_0x34e197[_0x48b5('0xeb')]+='x';}if(_0x34e197[_0x48b5('0xeb')][_0x48b5('0x173')]('X')<0x0){_0x34e197['opts']+='X';}this[_0x48b5('0xe')][_0x48b5('0xa2')](_0x48b5('0x174'),_0x463c19?_0x463c19[_0x48b5('0x175')]():'');var _0x1f3dff=this[_0x48b5('0xe')][_0x48b5('0x5d')]('QUEUE',[_0x463c19,_0x34e197[_0x48b5('0xeb')],_0x34e197[_0x48b5('0x69')],_0x17bf23,_0x34e197['timeout'],_0x34e197[_0x48b5('0x6')],_0x34e197[_0x48b5('0x176')],_0x34e197[_0x48b5('0x177')],'',_0x34e197[_0x48b5('0x178')]]);if(_0x1f3dff['result']===-0x1){return _0x1f3dff;}return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0xc9'),_0x48b5('0x179'),_0x463c19));};AGIVertices['prototype'][_0x48b5('0x17a')]=function(_0x51b9cf){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x17b'),_0x51b9cf['label']));var _0x2e46c7=_0x51b9cf[_0x48b5('0x17c')]||_0x48b5('0x131');var _0x2fb161=util[_0x48b5('0x2a')](_0x48b5('0x17d'),this['channel']['uniqueid'],rs['generate'](0x5));var _0x5419cb=util[_0x48b5('0x2a')]('%s/recordings/%s.%s',FILES_PATH,_0x2fb161,_0x2e46c7);var _0x335241=util['format'](_0x48b5('0x132'),FILES_PATH,_0x2fb161);this[_0x48b5('0x3d')][_0x48b5('0x76')](this,_0x51b9cf,_0x2fb161,_0x5419cb);this[_0x48b5('0xe')][_0x48b5('0xa2')](_0x48b5('0x17e'),_0x2fb161);logger[_0x48b5('0x2f')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x335241,_0x2e46c7,_0x51b9cf[_0x48b5('0x17f')],_0x51b9cf[_0x48b5('0x6b')]);return this['channel'][_0x48b5('0x134')](_0x335241,_0x2e46c7,_0x51b9cf[_0x48b5('0x17f')],_0x51b9cf[_0x48b5('0x6b')],undefined,!![]);};AGIVertices[_0x48b5('0x10')]['restapi']=function(_0x1c2205){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x180'),_0x1c2205[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x1c2205['url'])){return this[_0x48b5('0xe')]['noop'](_0x48b5('0x181'));}var _0x201742=this[_0x48b5('0x68')][_0x48b5('0x76')](this,_0x1c2205);logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x182'),util[_0x48b5('0x183')](_0x201742,{'showHidden':![],'depth':null})));if(!this[_0x48b5('0xa6')](_0x1c2205[_0x48b5('0xdd')])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0x184'));}var _0x461f67=this[_0x48b5('0x11')][_0x48b5('0x76')](this,_0x1c2205[_0x48b5('0xdd')]);if(!_0x461f67){return this[_0x48b5('0xe')]['error'](_0x1c2205,'no\x20variable\x20found');}this[_0x48b5('0xe')][_0x48b5('0xa2')](util[_0x48b5('0x2a')]('%s_STATUS_CODE',_0x461f67),_0x201742['statusCode']?_0x201742['statusCode']:_0x48b5('0x185'));this[_0x48b5('0xe')][_0x48b5('0xa2')](util[_0x48b5('0x2a')](_0x48b5('0x186'),_0x461f67),_0x201742[_0x48b5('0x7a')]?_0x201742[_0x48b5('0x7a')]:'OK');if(_0x201742[_0x48b5('0x71')]){try{this[_0x48b5('0xa0')](_0x201742[_0x48b5('0x71')],_0x461f67);}catch(_0x23c186){logger[_0x48b5('0x35')](util[_0x48b5('0x2a')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x461f67));}}return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0xe3'),_0x461f67));};AGIVertices[_0x48b5('0x10')]['saydigits']=function(_0x9a42){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x187'),_0x9a42[_0x48b5('0x3b')]));return this['channel'][_0x48b5('0x188')](_0x9a42[_0x48b5('0x189')][_0x48b5('0x5f')](/\s+/g,''),_0x9a42[_0x48b5('0x17f')]);};AGIVertices[_0x48b5('0x10')]['saynumber']=function(_0x4b77e7){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x18a'),_0x4b77e7['label']));return this[_0x48b5('0xe')]['sayNumber'](_0x4b77e7[_0x48b5('0x6c')][_0x48b5('0x5f')](/\s+/g,''),_0x4b77e7['escape_digits']);};AGIVertices['prototype'][_0x48b5('0x18b')]=function(_0x4fb82f){logger[_0x48b5('0x2f')](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x4fb82f[_0x48b5('0x3b')]));return this[_0x48b5('0xe')][_0x48b5('0x18c')](_0x4fb82f[_0x48b5('0x62')],_0x4fb82f['escape_digits']);};AGIVertices['prototype'][_0x48b5('0x18d')]=function(_0x3778c4){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x18e'),_0x3778c4[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x3778c4[_0x48b5('0x18f')])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0x190'));}var _0x494b41=this[_0x48b5('0x22')][_0x48b5('0x76')](this,_0x3778c4[_0x48b5('0x18f')]);if(!_0x494b41||!_0x494b41['Smtp']){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x3778c4,_0x48b5('0x191'));}var _0x1ba19d={'from':util[_0x48b5('0x2a')](_0x48b5('0x192'),_0x494b41[_0x48b5('0x13')],_0x494b41[_0x48b5('0x193')]||_0x494b41[_0x48b5('0x194')][_0x48b5('0x195')]),'to':_0x3778c4['to']||'','cc':_0x3778c4['cc']||'','bcc':_0x3778c4['bcc']||'','subject':_0x3778c4[_0x48b5('0x196')],'html':_0x3778c4[_0x48b5('0x62')],'text':_0x3778c4[_0x48b5('0x62')]};var _0x3738a2={'tls':{'rejectUnauthorized':![]}};if(_0x494b41[_0x48b5('0x194')][_0x48b5('0x197')]){_0x3738a2[_0x48b5('0x197')]=_0x494b41['Smtp']['service'];}else{_0x3738a2['host']=_0x494b41[_0x48b5('0x194')]['host'];_0x3738a2['port']=_0x494b41[_0x48b5('0x194')][_0x48b5('0x198')];_0x3738a2[_0x48b5('0x199')]=_0x494b41[_0x48b5('0x194')][_0x48b5('0x199')];}if(_0x494b41[_0x48b5('0x194')]['authentication']){_0x3738a2[_0x48b5('0x19a')]={'user':_0x494b41[_0x48b5('0x194')]['user'],'pass':_0x494b41[_0x48b5('0x194')][_0x48b5('0x19b')]};}if(this[_0x48b5('0xa6')](_0x3778c4['template_id'])){}logger[_0x48b5('0x19c')](_0x48b5('0x19d'),JSON['stringify'](_0x1ba19d));this[_0x48b5('0x39')][_0x48b5('0x76')](this,_0x3778c4,_0x3778c4[_0x48b5('0x18f')]);this[_0x48b5('0xe')]['noop'](util[_0x48b5('0x2a')](_0x48b5('0x19e'),_0x494b41[_0x48b5('0x13')]));this[_0x48b5('0x23')][_0x48b5('0x76')](this,_0x3738a2,_0x1ba19d);return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0x19f'));};AGIVertices[_0x48b5('0x10')][_0x48b5('0x1a0')]=function(_0x35297f){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x1a1'),_0x35297f[_0x48b5('0x3b')]));return this[_0x48b5('0xe')][_0x48b5('0xac')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x48b5('0x10')][_0x48b5('0x1a2')]=function(_0x5e926f){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5e926f[_0x48b5('0x3b')]));if(!this['isConfigured'](_0x5e926f[_0x48b5('0x1a3')])){return this['channel'][_0x48b5('0xac')](_0x48b5('0x1a4'));}var _0x9477a6=this['getSmsAccount'][_0x48b5('0x76')](this,_0x5e926f[_0x48b5('0x1a3')]);if(!_0x9477a6){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x5e926f,_0x48b5('0x1a5'));}var _0x3fb66a={'body':_0x5e926f['sms_text'],'phone':_0x5e926f['to']||'','SmsAccountId':_0x9477a6['id']};logger[_0x48b5('0x19c')]('sendSMS\x20message',JSON[_0x48b5('0x79')](_0x3fb66a));this['createSquareDetailsReport'][_0x48b5('0x76')](this,_0x5e926f,_0x5e926f['sms_account_id']);this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x1a6'),_0x9477a6[_0x48b5('0x13')]));this[_0x48b5('0x38')][_0x48b5('0x76')](this,_0x3fb66a);return this['channel']['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x48b5('0x1a7')]=function(_0x1b4a08){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x1a8'),_0x1b4a08['label']));if(!this[_0x48b5('0xa6')](_0x1b4a08[_0x48b5('0xdd')])){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x1b4a08,_0x48b5('0x1a9'));}var _0x3ab0f9=this[_0x48b5('0x11')][_0x48b5('0x76')](this,_0x1b4a08[_0x48b5('0xdd')]);if(!_0x3ab0f9){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x1b4a08,_0x48b5('0xde'));}return this[_0x48b5('0xe')][_0x48b5('0xa2')](_0x3ab0f9,_0x1b4a08[_0x48b5('0x1aa')]);};AGIVertices[_0x48b5('0x10')]['start']=function(_0x44a659){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x1ab'),_0x44a659[_0x48b5('0x3b')]));this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0x1ac'));if(_0x44a659['answer']===_0x48b5('0x1ad')){this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0x1ae'));return this[_0x48b5('0xe')][_0x48b5('0xbf')]();}return this['channel'][_0x48b5('0xac')]('Skipped\x20Answer');};AGIVertices['prototype'][_0x48b5('0x1af')]=function(_0x2655b9){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x2655b9[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x2655b9[_0x48b5('0x1b0')])){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x2655b9,_0x48b5('0x1b1'));}var _0x9819e2=this[_0x48b5('0x18')]['sync'](this,_0x2655b9[_0x48b5('0x1b0')]);if(!this[_0x48b5('0xa6')](_0x9819e2)){return this['channel']['error'](_0x2655b9,util['format'](_0x48b5('0x1b2'),_0x2655b9[_0x48b5('0x1b0')]));}if(_0x9819e2===this[_0x48b5('0xe')][_0x48b5('0x3c')]){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x2655b9,_0x48b5('0x1b3'));}this[_0x48b5('0x39')][_0x48b5('0x76')](this,_0x2655b9,_0x9819e2);var _0x568056=this['channel'][_0x48b5('0x5d')](_0x48b5('0x1b4'),util[_0x48b5('0x2a')](_0x48b5('0x1b5'),config[_0x48b5('0x6')][_0x48b5('0x1b6')]||_0x48b5('0x1b7'),_0x9819e2,this[_0x48b5('0xe')]['arg_1']));if(_0x568056[_0x48b5('0xab')]===-0x1){return _0x568056;}return this['channel'][_0x48b5('0xac')](util[_0x48b5('0x2a')]('Executed\x20command\x20%s\x20%s',_0x48b5('0x1b4'),_0x9819e2));};AGIVertices['prototype'][_0x48b5('0x1b8')]=function(_0x5e6425){logger['info'](util[_0x48b5('0x2a')](_0x48b5('0x1b9'),_0x5e6425[_0x48b5('0x3b')]));var _0x18ddc7=this['shellCommand']['sync'](this,_0x5e6425[_0x48b5('0xbc')]);this[_0x48b5('0x39')]['sync'](this,_0x5e6425,_0x5e6425[_0x48b5('0xbc')]);if(this[_0x48b5('0xa6')](_0x5e6425[_0x48b5('0xdd')])){var _0x5bb33a=this[_0x48b5('0x11')][_0x48b5('0x76')](this,_0x5e6425[_0x48b5('0xdd')]);if(_0x5bb33a){this['channel'][_0x48b5('0xa2')](_0x5bb33a,_0x18ddc7);return this['channel']['noop'](util[_0x48b5('0x2a')](_0x48b5('0x1ba'),_0x5e6425[_0x48b5('0xbc')],_0x5bb33a));}}return this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x1bb'),_0x5e6425[_0x48b5('0xbc')]));};AGIVertices[_0x48b5('0x10')]['google_cloud_tts']=function(_0x189ada){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x189ada[_0x48b5('0x3b')]));_0x189ada['text']=_0x189ada[_0x48b5('0x62')][_0x48b5('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x189ada[_0x48b5('0x1bc')])){return this['channel'][_0x48b5('0xac')](_0x48b5('0x1bd'));}if(!this[_0x48b5('0xa6')](_0x189ada['text'])){return this[_0x48b5('0xe')][_0x48b5('0xac')](_0x48b5('0xcc'));}this['channel']['noop'](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x189ada['text']));var _0x17bb3c=this['googleCloudTTS'][_0x48b5('0x76')](this,_0x189ada);if(_0x17bb3c){this[_0x48b5('0xe')]['noop'](util['format'](_0x48b5('0x1be'),_0x17bb3c));var _0x54f305=this[_0x48b5('0xe')][_0x48b5('0x154')](_0x17bb3c);try{fs[_0x48b5('0x124')](_0x17bb3c+'.wav');}catch(_0xd63eec){logger[_0x48b5('0x35')](_0xd63eec);}return _0x54f305;}return this['channel'][_0x48b5('0x35')](_0x189ada,_0x48b5('0x1bf'));};AGIVertices['prototype'][_0x48b5('0x1c0')]=function(_0x4f7c0f){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x1c1'),_0x4f7c0f[_0x48b5('0x3b')]));_0x4f7c0f[_0x48b5('0x62')]=_0x4f7c0f[_0x48b5('0x62')][_0x48b5('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x48b5('0xa6')](_0x4f7c0f[_0x48b5('0x62')])){return this['channel']['noop'](_0x48b5('0xcc'));}this[_0x48b5('0xe')][_0x48b5('0xac')](util[_0x48b5('0x2a')](_0x48b5('0x1c2'),_0x4f7c0f[_0x48b5('0x62')]));var _0x1d270f=this[_0x48b5('0x66')]['sync'](this,_0x4f7c0f);if(_0x1d270f){this['channel']['noop'](util[_0x48b5('0x2a')](_0x48b5('0x1c3'),_0x1d270f));var _0xd101c4=this[_0x48b5('0xe')][_0x48b5('0x154')](_0x1d270f);try{fs['unlink'](_0x1d270f+'.wav');}catch(_0x16cd1f){logger[_0x48b5('0x35')](_0x16cd1f);}return _0xd101c4;}return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x4f7c0f,_0x48b5('0x1c4'));};AGIVertices[_0x48b5('0x10')][_0x48b5('0x1c5')]=function(_0x4d32b0){logger[_0x48b5('0x2f')](util['format'](_0x48b5('0x1c6'),_0x4d32b0[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x4d32b0[_0x48b5('0x156')])){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x4d32b0,'no\x20find\x20by\x20configured');}logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')](_0x48b5('0x155'),this[_0x48b5('0xe')][_0x48b5('0x3e')],_0x4d32b0[_0x48b5('0x156')]));var _0x2fc540=this['agentUnpause'][_0x48b5('0x76')](this,_0x4d32b0['findBy']);if(_0x2fc540){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x48b5('0xe')]['callerid'],_0x4d32b0[_0x48b5('0x156')]));this[_0x48b5('0xe')][_0x48b5('0xac')](util['format'](_0x48b5('0x157'),this[_0x48b5('0xe')][_0x48b5('0x3e')],_0x4d32b0[_0x48b5('0x156')]));return{'code':0xc8,'result':_0x48b5('0x158')};}else{logger[_0x48b5('0x2f')](util['format'](_0x48b5('0x159'),this[_0x48b5('0xe')][_0x48b5('0x3e')],_0x4d32b0[_0x48b5('0x156')]));this[_0x48b5('0xe')][_0x48b5('0xac')](util['format'](_0x48b5('0x159'),this[_0x48b5('0xe')][_0x48b5('0x3e')],_0x4d32b0['findBy']));return{'code':0xc8,'result':_0x48b5('0x16c')};}};AGIVertices[_0x48b5('0x10')][_0x48b5('0x1c7')]=function(_0x10053f){logger[_0x48b5('0x2f')](util[_0x48b5('0x2a')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x10053f['label']));var _0x59dee1=this[_0x48b5('0xe')]['exec'](_0x48b5('0x1c8'),[_0x10053f[_0x48b5('0x1c9')],_0x10053f[_0x48b5('0x7c')]]);if(_0x59dee1[_0x48b5('0xab')]===-0x1){return _0x59dee1;}return this[_0x48b5('0xe')][_0x48b5('0xac')](util['format'](_0x48b5('0xc9'),_0x48b5('0x1c8'),_0x10053f['mailbox']));};AGIVertices[_0x48b5('0x10')][_0x48b5('0x1ca')]=function(_0x8d1baa){logger[_0x48b5('0x2f')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x8d1baa[_0x48b5('0x3b')]));if(!this[_0x48b5('0xa6')](_0x8d1baa[_0x48b5('0xdd')])){return this[_0x48b5('0xe')]['error'](_0x8d1baa,_0x48b5('0x1a9'));}var _0x556fc1=this['getVariable'][_0x48b5('0x76')](this,_0x8d1baa[_0x48b5('0xdd')]);if(!_0x556fc1){return this[_0x48b5('0xe')][_0x48b5('0x35')](_0x8d1baa,_0x48b5('0xde'));}var _0x375b30=this[_0x48b5('0xe')]['getVariable'](_0x556fc1);return{'code':0xc8,'result':_0x375b30[_0x48b5('0xa4')]?_0x375b30[_0x48b5('0xa4')]:'-'};};String[_0x48b5('0x10')][_0x48b5('0xa3')]=function(_0x34b057,_0x393db2){return this[_0x48b5('0x1cb')](_0x34b057)[_0x48b5('0x1cc')](_0x393db2);};module['exports']=AGIVertices;
\ No newline at end of file
index fcc0a1b..a9c9c58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x202d=['format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','lastPauseAt','timer','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','syncAgentConnect','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','util','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','agents','timers','channels','agentconnect','bind','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','seconds','startAcw','interface','queue','voiceQueues','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x202d,0x172));var _0xd202=function(_0x553086,_0x16a0f6){_0x553086=_0x553086-0x0;var _0x3d54f8=_0x202d[_0x553086];return _0x3d54f8;};'use strict';var util=require(_0xd202('0x0'));var _=require('lodash');var moment=require(_0xd202('0x1'));var ami=require(_0xd202('0x2'));var logger=require(_0xd202('0x3'))(_0xd202('0x4'));var RpcUser=require(_0xd202('0x5'));var RpcVoiceAgentReport=require(_0xd202('0x6'));function Acw(_0x3f0575){this['voiceQueues']=_0x3f0575['voiceQueues'];this[_0xd202('0x7')]=_0x3f0575[_0xd202('0x7')];this[_0xd202('0x8')]=_0x3f0575[_0xd202('0x8')];this[_0xd202('0x9')]={};ami['on'](_0xd202('0xa'),this['syncAgentConnect'][_0xd202('0xb')](this));ami['on']('hanguprequest',this[_0xd202('0xc')][_0xd202('0xb')](this));ami['on'](_0xd202('0xd'),this['syncHangup'][_0xd202('0xb')](this));ami['on'](_0xd202('0xe'),this[_0xd202('0xf')][_0xd202('0xb')](this));ami['on'](_0xd202('0x10'),this[_0xd202('0x11')][_0xd202('0xb')](this));ami['on'](_0xd202('0x12'),this[_0xd202('0x13')][_0xd202('0xb')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xd202('0xb')](this));}function getDiff(_0x2004cf){var _0x52ba00=moment()['milliseconds'](0x0);var _0x2211cb=moment(_0x2004cf)['milliseconds'](0x0);return _0x52ba00['diff'](_0x2211cb,_0xd202('0x14'));}Acw['prototype'][_0xd202('0x15')]=function(_0x5f4114){try{var _0x23d84b=this;var _0x379855=this[_0xd202('0x9')][_0x5f4114][_0xd202('0x16')];var _0x262182=this[_0xd202('0x9')][_0x5f4114][_0xd202('0x17')];var _0x2501f7=this[_0xd202('0x18')][_0x262182];var _0x20d420=![];var _0x4a5bc5=_0xd202('0x19');if(_0x2501f7[_0xd202('0x1a')]){if(_0x2501f7['mandatoryDispositionPause'][_0xd202('0x1b')]){_0x20d420=!![];_0x4a5bc5=_0x2501f7[_0xd202('0x1c')][_0xd202('0x1b')];}}ami[_0xd202('0x1d')]({'action':_0xd202('0x1e'),'interface':_0x379855,'paused':!![],'reason':_0x4a5bc5})[_0xd202('0x1f')](function(_0x3e74f8){if(_0x23d84b[_0xd202('0x7')][_0x379855]){return RpcUser[_0xd202('0x20')](_0x23d84b[_0xd202('0x7')][_0x379855]['id'])[_0xd202('0x1f')](function(_0x5c59d3){if(_0x5c59d3&&!_0x5c59d3['voicePause']){logger[_0xd202('0x21')](_0xd202('0x22'),_0x5f4114,_0x379855,_0x262182);var _0x1109fa=_0x23d84b[_0xd202('0x9')][_0x5f4114][_0xd202('0x23')]&&_0x23d84b[_0xd202('0x9')][_0x5f4114][_0xd202('0x24')]?_0x23d84b['channels'][_0x5f4114][_0xd202('0x24')]:_0x5f4114;return RpcUser['savePause'](_0x23d84b[_0xd202('0x7')][_0x379855],_0x4a5bc5,_0x1109fa)['then'](function(_0x501e73){if(!_0x20d420){_0x23d84b[_0xd202('0x8')][_0x379855]={};logger[_0xd202('0x21')](_0xd202('0x25'),_0x5f4114,_0x23d84b[_0xd202('0x18')][_0x262182][_0xd202('0x26')],_0x379855,_0x262182);_0x23d84b[_0xd202('0x8')][_0x379855]['timer']=setTimeout(_0x23d84b[_0xd202('0x27')][_0xd202('0xb')](_0x23d84b,_0x379855),_0x23d84b[_0xd202('0x18')][_0x262182][_0xd202('0x26')]*0x3e8);_0x23d84b[_0xd202('0x8')][_0x379855]['lastPauseAt']=moment()[_0xd202('0x28')](_0xd202('0x29'));_0x23d84b['timers'][_0x379855][_0xd202('0x2a')]=_0x5f4114;_0x23d84b[_0xd202('0x8')][_0x379855]['queue']=_0x262182;_0x23d84b[_0xd202('0x8')][_0x379855]['updateAcw']=function(){var _0x18a649=getDiff(_0x23d84b[_0xd202('0x8')][_0x379855][_0xd202('0x2b')]);clearTimeout(_0x23d84b[_0xd202('0x8')][_0x379855]['timer']);_0x23d84b[_0xd202('0x8')][_0x379855][_0xd202('0x2c')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x18a649},_0x23d84b['timers'][_0x379855][_0xd202('0x2a')],_0x379855)[_0xd202('0x1f')](function(_0x578fd4){logger[_0xd202('0x21')](_0xd202('0x2d'),_0x5f4114,_0x18a649,_0x578fd4);})[_0xd202('0x2e')](function(_0x4c6ed7){logger[_0xd202('0x2f')](_0xd202('0x30'),_0x5f4114,_0x4c6ed7);});delete _0x23d84b[_0xd202('0x8')][_0x379855];};}});}else{logger[_0xd202('0x21')](_0xd202('0x31'),_0x5f4114,_0x379855,_0x262182);}});}})[_0xd202('0x2e')](function(_0x2ba820){logger[_0xd202('0x2f')](_0xd202('0x25'),_0x5f4114,_0x23d84b['voiceQueues'][_0x262182][_0xd202('0x26')],_0x379855,_0x262182);})[_0xd202('0x32')](function(){delete _0x23d84b[_0xd202('0x9')][_0x5f4114];});}catch(_0x59af07){logger[_0xd202('0x2f')](_0xd202('0x33'),_0x59af07[_0xd202('0x34')]);}};Acw[_0xd202('0x35')]['stopAcw']=function(_0x5b6ddc){try{var _0x4c6bf1=this;if(_0x4c6bf1['timers'][_0x5b6ddc]){_0x4c6bf1[_0xd202('0x8')][_0x5b6ddc][_0xd202('0x2c')]=![];var _0x461e3b=_0x4c6bf1[_0xd202('0x8')][_0x5b6ddc][_0xd202('0x2a')];var _0x4441ec=_0x4c6bf1[_0xd202('0x8')][_0x5b6ddc][_0xd202('0x17')];var _0x42c6a3=_0x4c6bf1[_0xd202('0x18')][_0x4441ec]['acwTimeout'];logger[_0xd202('0x21')](_0xd202('0x36'),_0x461e3b,_0x5b6ddc);RpcUser[_0xd202('0x37')](this[_0xd202('0x7')][_0x5b6ddc]);RpcVoiceAgentReport[_0xd202('0x38')]({'acwtime':_0x42c6a3,'agentacw':!![]},_0x461e3b,_0x5b6ddc)[_0xd202('0x1f')](function(_0x30ab77){logger[_0xd202('0x21')](_0xd202('0x2d'),_0x461e3b,_0x42c6a3,_0x30ab77);})[_0xd202('0x2e')](function(_0x3fd6cd){logger[_0xd202('0x2f')](_0xd202('0x30'),_0x461e3b,_0x3fd6cd);});}else{logger[_0xd202('0x2f')](_0xd202('0x39'),_0x5b6ddc);if(_0x4c6bf1['timers']){logger[_0xd202('0x21')]('[ACW][TIMERS]',JSON[_0xd202('0x3a')](_0x4c6bf1[_0xd202('0x8')]));}}}catch(_0x1faf3a){logger[_0xd202('0x2f')](_0xd202('0x3b'),_0x1faf3a['message']);}};Acw[_0xd202('0x35')][_0xd202('0x3c')]=function(_0x36293f){try{if(this['voiceQueues'][_0x36293f[_0xd202('0x17')]]&&(this['voiceQueues'][_0x36293f[_0xd202('0x17')]][_0xd202('0x4')]||this[_0xd202('0x18')][_0x36293f['queue']][_0xd202('0x1a')])){if(this[_0xd202('0x7')][_0x36293f['interface']]){this[_0xd202('0x9')][_0x36293f[_0xd202('0x2a')]]={'queue':_0x36293f[_0xd202('0x17')],'interface':_0x36293f['interface'],'destlinkedid':_0x36293f[_0xd202('0x24')]};}}}catch(_0x10b46c){logger[_0xd202('0x2f')]('[ACW][syncAgentConnect]\x20%s',_0x10b46c[_0xd202('0x34')]);}};Acw[_0xd202('0x35')][_0xd202('0x3d')]=function(_0x11d36f){try{if(this[_0xd202('0x18')][_0x11d36f['queue']]&&(this[_0xd202('0x18')][_0x11d36f[_0xd202('0x17')]][_0xd202('0x4')]||this['voiceQueues'][_0x11d36f[_0xd202('0x17')]][_0xd202('0x1a')])){if(this['agents'][_0x11d36f[_0xd202('0x16')]]){this['channels'][_0x11d36f[_0xd202('0x2a')]]={'queue':_0x11d36f[_0xd202('0x17')],'interface':_0x11d36f[_0xd202('0x16')]};}}}catch(_0x1a12fe){logger[_0xd202('0x2f')](_0xd202('0x3e'),_0x1a12fe['message']);}};Acw[_0xd202('0x35')]['syncHangupRequest']=function(_0x1b2625){try{if(this[_0xd202('0x9')][_0x1b2625[_0xd202('0x2a')]]&&_[_0xd202('0x3f')](this[_0xd202('0x9')][_0x1b2625[_0xd202('0x2a')]][_0xd202('0x23')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x1b2625[_0xd202('0x2a')]);this[_0xd202('0x15')](_0x1b2625[_0xd202('0x2a')]);}else if(this['channels'][_0x1b2625[_0xd202('0x40')]]&&_[_0xd202('0x3f')](this[_0xd202('0x9')][_0x1b2625[_0xd202('0x40')]][_0xd202('0x23')])){logger[_0xd202('0x21')](_0xd202('0x41'),_0x1b2625[_0xd202('0x40')]);this[_0xd202('0x15')](_0x1b2625[_0xd202('0x40')]);}}catch(_0x61ff63){logger['error'](_0xd202('0x42'),_0x61ff63[_0xd202('0x34')]);}};Acw[_0xd202('0x35')]['syncHangup']=function(_0x2424d8){try{if(this['channels'][_0x2424d8[_0xd202('0x2a')]]&&this[_0xd202('0x9')][_0x2424d8[_0xd202('0x2a')]][_0xd202('0x23')]){logger[_0xd202('0x21')](_0xd202('0x43'),_0x2424d8['uniqueid']);this['startAcw'](_0x2424d8[_0xd202('0x2a')]);}else if(this[_0xd202('0x9')][_0x2424d8[_0xd202('0x40')]]&&this[_0xd202('0x9')][_0x2424d8[_0xd202('0x40')]]['attended']){logger[_0xd202('0x21')](_0xd202('0x44'),_0x2424d8[_0xd202('0x40')]);this[_0xd202('0x15')](_0x2424d8[_0xd202('0x40')]);}}catch(_0x4db928){logger[_0xd202('0x2f')]('[ACW][syncHangup]\x20%s',_0x4db928[_0xd202('0x34')]);}};Acw[_0xd202('0x35')][_0xd202('0x11')]=function(_0x5f1177){try{if(!_[_0xd202('0x45')](this[_0xd202('0x9')][_0x5f1177[_0xd202('0x46')]])){this['startAcw'](_0x5f1177['transfereeuniqueid']);if(this[_0xd202('0x9')][_0x5f1177[_0xd202('0x47')]]){this[_0xd202('0x9')][_0x5f1177[_0xd202('0x47')]][_0xd202('0x23')]=!![];this[_0xd202('0x9')][_0x5f1177[_0xd202('0x48')]]=this[_0xd202('0x9')][_0x5f1177[_0xd202('0x47')]];delete this['channels'][_0x5f1177[_0xd202('0x47')]];}}else if(!_[_0xd202('0x45')](this['channels'][_0x5f1177[_0xd202('0x48')]])){this[_0xd202('0x15')](_0x5f1177[_0xd202('0x48')]);if(this[_0xd202('0x9')][_0x5f1177[_0xd202('0x49')]]){this['channels'][_0x5f1177['origtransfereruniqueid']][_0xd202('0x23')]=!![];this[_0xd202('0x9')][_0x5f1177[_0xd202('0x46')]]=this[_0xd202('0x9')][_0x5f1177[_0xd202('0x49')]];delete this[_0xd202('0x9')][_0x5f1177[_0xd202('0x49')]];}}}catch(_0x42540a){logger[_0xd202('0x2f')]('[ACW][syncAttendedTransfer]\x20%s',_0x42540a[_0xd202('0x34')]);}};Acw['prototype'][_0xd202('0x13')]=function(_0x5688eb){try{if(this[_0xd202('0x9')][_0x5688eb['transfereruniqueid']]){logger['info'](_0xd202('0x4a'),JSON[_0xd202('0x3a')](_0x5688eb[_0xd202('0x4b')]));this[_0xd202('0x15')](_0x5688eb[_0xd202('0x4b')]);}else if(this[_0xd202('0x9')][_0x5688eb[_0xd202('0x4c')]]){logger[_0xd202('0x21')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x5688eb[_0xd202('0x4c')]));this['startAcw'](_0x5688eb[_0xd202('0x4c')]);}}catch(_0x53eb82){logger[_0xd202('0x2f')]('[ACW][syncBlindTransfer]\x20%s',_0x53eb82[_0xd202('0x34')]);}};Acw[_0xd202('0x35')][_0xd202('0xf')]=function(_0x160e51){try{if(this[_0xd202('0x18')][_0x160e51[_0xd202('0x17')]]&&this[_0xd202('0x18')][_0x160e51['queue']][_0xd202('0x4d')]===_0xd202('0x4e')){if(this[_0xd202('0x7')][_0x160e51[_0xd202('0x16')]]){logger['info'](_0xd202('0x4f'),_0x160e51[_0xd202('0x2a')],_0x160e51[_0xd202('0x16')],_0x160e51[_0xd202('0x17')]);return RpcUser[_0xd202('0x50')](this[_0xd202('0x7')][_0x160e51[_0xd202('0x16')]],'Auto-Pause',_0x160e51[_0xd202('0x2a')]);}}}catch(_0x368b49){logger[_0xd202('0x2f')](_0xd202('0x51'),_0x368b49[_0xd202('0x34')]);}};module['exports']=Acw;
\ No newline at end of file
+var _0xe668=['uniqueid','updateAcw','timer','update','info','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','prototype','queue','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','stringify','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','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'];(function(_0x395be8,_0x285479){var _0x5ceb20=function(_0x225920){while(--_0x225920){_0x395be8['push'](_0x395be8['shift']());}};_0x5ceb20(++_0x285479);}(_0xe668,0xd8));var _0x8e66=function(_0x53f897,_0x539857){_0x53f897=_0x53f897-0x0;var _0x6879f8=_0xe668[_0x53f897];return _0x6879f8;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x8e66('0x0'));var ami=require(_0x8e66('0x1'));var logger=require('../../../config/logger')(_0x8e66('0x2'));var RpcUser=require(_0x8e66('0x3'));var RpcVoiceAgentReport=require(_0x8e66('0x4'));function Acw(_0x469be4){this[_0x8e66('0x5')]=_0x469be4[_0x8e66('0x5')];this[_0x8e66('0x6')]=_0x469be4[_0x8e66('0x6')];this[_0x8e66('0x7')]=_0x469be4['timers'];this[_0x8e66('0x8')]={};ami['on'](_0x8e66('0x9'),this['syncAgentConnect'][_0x8e66('0xa')](this));ami['on'](_0x8e66('0xb'),this[_0x8e66('0xc')][_0x8e66('0xa')](this));ami['on'](_0x8e66('0xd'),this[_0x8e66('0xe')][_0x8e66('0xa')](this));ami['on']('agentringnoanswer',this[_0x8e66('0xf')][_0x8e66('0xa')](this));ami['on'](_0x8e66('0x10'),this[_0x8e66('0x11')][_0x8e66('0xa')](this));ami['on'](_0x8e66('0x12'),this[_0x8e66('0x13')][_0x8e66('0xa')](this));ami['on'](_0x8e66('0x14'),this[_0x8e66('0x15')][_0x8e66('0xa')](this));}function getDiff(_0x383bcd){var _0x1ad3d6=moment()[_0x8e66('0x16')](0x0);var _0x389f9e=moment(_0x383bcd)['milliseconds'](0x0);return _0x1ad3d6[_0x8e66('0x17')](_0x389f9e,_0x8e66('0x18'));}Acw['prototype'][_0x8e66('0x19')]=function(_0x11e46e){try{var _0x27bf41=this;var _0x8fde34=this['channels'][_0x11e46e][_0x8e66('0x1a')];var _0x41e68b=this[_0x8e66('0x8')][_0x11e46e]['queue'];var _0x4d517b=this[_0x8e66('0x5')][_0x41e68b];var _0x34633e=![];var _0x12fb07=_0x8e66('0x1b');if(_0x4d517b[_0x8e66('0x1c')]){if(_0x4d517b['mandatoryDispositionPause']['name']){_0x34633e=!![];_0x12fb07=_0x4d517b[_0x8e66('0x1d')][_0x8e66('0x1e')];}}ami['Action']({'action':_0x8e66('0x1f'),'interface':_0x8fde34,'paused':!![],'reason':_0x12fb07})[_0x8e66('0x20')](function(_0x5dde4e){if(_0x27bf41[_0x8e66('0x6')][_0x8fde34]){return RpcUser[_0x8e66('0x21')](_0x27bf41[_0x8e66('0x6')][_0x8fde34]['id'])[_0x8e66('0x20')](function(_0xa740bd){if(_0xa740bd&&!_0xa740bd[_0x8e66('0x22')]){logger['info'](_0x8e66('0x23'),_0x11e46e,_0x8fde34,_0x41e68b);var _0x58c9ad=_0x27bf41[_0x8e66('0x8')][_0x11e46e][_0x8e66('0x24')]&&_0x27bf41[_0x8e66('0x8')][_0x11e46e][_0x8e66('0x25')]?_0x27bf41[_0x8e66('0x8')][_0x11e46e][_0x8e66('0x25')]:_0x11e46e;return RpcUser[_0x8e66('0x26')](_0x27bf41['agents'][_0x8fde34],_0x12fb07,_0x58c9ad)['then'](function(_0x3c2870){if(!_0x34633e){_0x27bf41[_0x8e66('0x7')][_0x8fde34]={};logger['info'](_0x8e66('0x27'),_0x11e46e,_0x27bf41[_0x8e66('0x5')][_0x41e68b][_0x8e66('0x28')],_0x8fde34,_0x41e68b);_0x27bf41[_0x8e66('0x7')][_0x8fde34]['timer']=setTimeout(_0x27bf41[_0x8e66('0x29')][_0x8e66('0xa')](_0x27bf41,_0x8fde34),_0x27bf41[_0x8e66('0x5')][_0x41e68b]['acwTimeout']*0x3e8);_0x27bf41[_0x8e66('0x7')][_0x8fde34][_0x8e66('0x2a')]=moment()[_0x8e66('0x2b')](_0x8e66('0x2c'));_0x27bf41[_0x8e66('0x7')][_0x8fde34][_0x8e66('0x2d')]=_0x11e46e;_0x27bf41[_0x8e66('0x7')][_0x8fde34]['queue']=_0x41e68b;_0x27bf41[_0x8e66('0x7')][_0x8fde34][_0x8e66('0x2e')]=function(){var _0x998852=getDiff(_0x27bf41[_0x8e66('0x7')][_0x8fde34][_0x8e66('0x2a')]);clearTimeout(_0x27bf41[_0x8e66('0x7')][_0x8fde34][_0x8e66('0x2f')]);_0x27bf41[_0x8e66('0x7')][_0x8fde34][_0x8e66('0x2f')]=![];RpcVoiceAgentReport[_0x8e66('0x30')]({'acwtime':_0x998852},_0x27bf41[_0x8e66('0x7')][_0x8fde34]['uniqueid'],_0x8fde34)[_0x8e66('0x20')](function(_0x571257){logger[_0x8e66('0x31')](_0x8e66('0x32'),_0x11e46e,_0x998852,_0x571257);})['catch'](function(_0x4c5637){logger[_0x8e66('0x33')](_0x8e66('0x34'),_0x11e46e,_0x4c5637);});delete _0x27bf41[_0x8e66('0x7')][_0x8fde34];};}});}else{logger[_0x8e66('0x31')](_0x8e66('0x35'),_0x11e46e,_0x8fde34,_0x41e68b);}});}})[_0x8e66('0x36')](function(_0x1b0224){logger[_0x8e66('0x33')](_0x8e66('0x27'),_0x11e46e,_0x27bf41[_0x8e66('0x5')][_0x41e68b]['acwTimeout'],_0x8fde34,_0x41e68b);})[_0x8e66('0x37')](function(){delete _0x27bf41[_0x8e66('0x8')][_0x11e46e];});}catch(_0x7e659a){logger['error'](_0x8e66('0x38'),_0x7e659a[_0x8e66('0x39')]);}};Acw[_0x8e66('0x3a')][_0x8e66('0x29')]=function(_0x47c6d0){try{var _0x24d134=this;if(_0x24d134['timers'][_0x47c6d0]){_0x24d134['timers'][_0x47c6d0][_0x8e66('0x2f')]=![];var _0x519914=_0x24d134[_0x8e66('0x7')][_0x47c6d0]['uniqueid'];var _0x2fcfca=_0x24d134[_0x8e66('0x7')][_0x47c6d0][_0x8e66('0x3b')];var _0x264a80=_0x24d134[_0x8e66('0x5')][_0x2fcfca]['acwTimeout'];logger[_0x8e66('0x31')](_0x8e66('0x3c'),_0x519914,_0x47c6d0);RpcUser[_0x8e66('0x3d')](this['agents'][_0x47c6d0]);RpcVoiceAgentReport[_0x8e66('0x30')]({'acwtime':_0x264a80,'agentacw':!![]},_0x519914,_0x47c6d0)[_0x8e66('0x20')](function(_0x5293df){logger[_0x8e66('0x31')](_0x8e66('0x32'),_0x519914,_0x264a80,_0x5293df);})['catch'](function(_0x1bee6c){logger['error'](_0x8e66('0x34'),_0x519914,_0x1bee6c);});}else{logger[_0x8e66('0x33')](_0x8e66('0x3e'),_0x47c6d0);if(_0x24d134['timers']){logger[_0x8e66('0x31')](_0x8e66('0x3f'),JSON['stringify'](_0x24d134[_0x8e66('0x7')]));}}}catch(_0x351ee2){logger[_0x8e66('0x33')](_0x8e66('0x40'),_0x351ee2[_0x8e66('0x39')]);}};Acw[_0x8e66('0x3a')]['syncAgentConnect']=function(_0x1c58f2){try{if(this['voiceQueues'][_0x1c58f2[_0x8e66('0x3b')]]&&(this['voiceQueues'][_0x1c58f2[_0x8e66('0x3b')]][_0x8e66('0x2')]||this[_0x8e66('0x5')][_0x1c58f2['queue']][_0x8e66('0x1c')])){if(this['agents'][_0x1c58f2[_0x8e66('0x1a')]]){this[_0x8e66('0x8')][_0x1c58f2[_0x8e66('0x2d')]]={'queue':_0x1c58f2[_0x8e66('0x3b')],'interface':_0x1c58f2['interface'],'destlinkedid':_0x1c58f2['destlinkedid']};}}}catch(_0x5955cf){logger[_0x8e66('0x33')](_0x8e66('0x41'),_0x5955cf[_0x8e66('0x39')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x4caeb8){try{if(this['voiceQueues'][_0x4caeb8['queue']]&&(this[_0x8e66('0x5')][_0x4caeb8[_0x8e66('0x3b')]]['acw']||this[_0x8e66('0x5')][_0x4caeb8[_0x8e66('0x3b')]][_0x8e66('0x1c')])){if(this[_0x8e66('0x6')][_0x4caeb8[_0x8e66('0x1a')]]){this['channels'][_0x4caeb8[_0x8e66('0x2d')]]={'queue':_0x4caeb8[_0x8e66('0x3b')],'interface':_0x4caeb8['interface']};}}}catch(_0x2e7197){logger[_0x8e66('0x33')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2e7197['message']);}};Acw[_0x8e66('0x3a')][_0x8e66('0xc')]=function(_0x18c8db){try{if(this[_0x8e66('0x8')][_0x18c8db[_0x8e66('0x2d')]]&&_[_0x8e66('0x42')](this[_0x8e66('0x8')][_0x18c8db[_0x8e66('0x2d')]]['attended'])){logger['info'](_0x8e66('0x43'),_0x18c8db[_0x8e66('0x2d')]);this[_0x8e66('0x19')](_0x18c8db[_0x8e66('0x2d')]);}else if(this['channels'][_0x18c8db[_0x8e66('0x44')]]&&_['isUndefined'](this[_0x8e66('0x8')][_0x18c8db['linkedid']][_0x8e66('0x24')])){logger[_0x8e66('0x31')]('[%s][HANGUP:LINKEDID]',_0x18c8db['linkedid']);this[_0x8e66('0x19')](_0x18c8db['linkedid']);}}catch(_0x2393b0){logger[_0x8e66('0x33')](_0x8e66('0x45'),_0x2393b0[_0x8e66('0x39')]);}};Acw['prototype']['syncHangup']=function(_0xb45598){try{if(this[_0x8e66('0x8')][_0xb45598[_0x8e66('0x2d')]]&&this[_0x8e66('0x8')][_0xb45598[_0x8e66('0x2d')]][_0x8e66('0x24')]){logger['info'](_0x8e66('0x46'),_0xb45598[_0x8e66('0x2d')]);this[_0x8e66('0x19')](_0xb45598[_0x8e66('0x2d')]);}else if(this['channels'][_0xb45598[_0x8e66('0x44')]]&&this[_0x8e66('0x8')][_0xb45598[_0x8e66('0x44')]][_0x8e66('0x24')]){logger[_0x8e66('0x31')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0xb45598[_0x8e66('0x44')]);this[_0x8e66('0x19')](_0xb45598['linkedid']);}}catch(_0x1b9683){logger[_0x8e66('0x33')](_0x8e66('0x47'),_0x1b9683['message']);}};Acw['prototype'][_0x8e66('0x11')]=function(_0x231ea6){try{if(!_[_0x8e66('0x48')](this[_0x8e66('0x8')][_0x231ea6[_0x8e66('0x49')]])){this[_0x8e66('0x19')](_0x231ea6[_0x8e66('0x49')]);if(this[_0x8e66('0x8')][_0x231ea6['secondtransfereruniqueid']]){this['channels'][_0x231ea6[_0x8e66('0x4a')]][_0x8e66('0x24')]=!![];this[_0x8e66('0x8')][_0x231ea6['transfertargetuniqueid']]=this[_0x8e66('0x8')][_0x231ea6[_0x8e66('0x4a')]];delete this[_0x8e66('0x8')][_0x231ea6[_0x8e66('0x4a')]];}}else if(!_[_0x8e66('0x48')](this[_0x8e66('0x8')][_0x231ea6[_0x8e66('0x4b')]])){this['startAcw'](_0x231ea6[_0x8e66('0x4b')]);if(this[_0x8e66('0x8')][_0x231ea6[_0x8e66('0x4c')]]){this[_0x8e66('0x8')][_0x231ea6[_0x8e66('0x4c')]][_0x8e66('0x24')]=!![];this[_0x8e66('0x8')][_0x231ea6[_0x8e66('0x49')]]=this[_0x8e66('0x8')][_0x231ea6[_0x8e66('0x4c')]];delete this['channels'][_0x231ea6[_0x8e66('0x4c')]];}}}catch(_0x2c2c36){logger[_0x8e66('0x33')](_0x8e66('0x4d'),_0x2c2c36[_0x8e66('0x39')]);}};Acw[_0x8e66('0x3a')][_0x8e66('0x13')]=function(_0x15d2b0){try{if(this['channels'][_0x15d2b0['transfereruniqueid']]){logger[_0x8e66('0x31')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x8e66('0x4e')](_0x15d2b0['transfereruniqueid']));this[_0x8e66('0x19')](_0x15d2b0[_0x8e66('0x4f')]);}else if(this[_0x8e66('0x8')][_0x15d2b0[_0x8e66('0x50')]]){logger[_0x8e66('0x31')](_0x8e66('0x51'),JSON[_0x8e66('0x4e')](_0x15d2b0[_0x8e66('0x50')]));this[_0x8e66('0x19')](_0x15d2b0[_0x8e66('0x50')]);}}catch(_0x28d8db){logger['error'](_0x8e66('0x52'),_0x28d8db[_0x8e66('0x39')]);}};Acw[_0x8e66('0x3a')][_0x8e66('0xf')]=function(_0x198850){try{if(this[_0x8e66('0x5')][_0x198850[_0x8e66('0x3b')]]&&this[_0x8e66('0x5')][_0x198850[_0x8e66('0x3b')]][_0x8e66('0x53')]==='all'){if(this[_0x8e66('0x6')][_0x198850[_0x8e66('0x1a')]]){logger[_0x8e66('0x31')](_0x8e66('0x54'),_0x198850[_0x8e66('0x2d')],_0x198850[_0x8e66('0x1a')],_0x198850['queue']);return RpcUser[_0x8e66('0x26')](this[_0x8e66('0x6')][_0x198850['interface']],'Auto-Pause',_0x198850['uniqueid']);}}}catch(_0x12fdbf){logger[_0x8e66('0x33')](_0x8e66('0x55'),_0x12fdbf[_0x8e66('0x39')]);}};module[_0x8e66('0x56')]=Acw;
\ No newline at end of file
index cedadb9..d729c85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2427=['port','username','password','keepConnected','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionDeviceStateList','exports','asterisk-manager','bluebird','moment','lodash','../../config/logger','../../config/environment','asterisk'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2427,0xd1));var _0x7242=function(_0x324c4e,_0x8cb7a6){_0x324c4e=_0x324c4e-0x0;var _0x3f5859=_0x2427[_0x324c4e];return _0x3f5859;};'use strict';var Manager=require(_0x7242('0x0'));var BPromise=require(_0x7242('0x1'));var moment=require(_0x7242('0x2'));var util=require('util');var _=require(_0x7242('0x3'));var logger=require(_0x7242('0x4'))('ami');var config=require(_0x7242('0x5'));var ami=new Manager(config[_0x7242('0x6')][_0x7242('0x7')],config[_0x7242('0x6')]['ip'],config['asterisk'][_0x7242('0x8')],config[_0x7242('0x6')][_0x7242('0x9')],!![]);ami[_0x7242('0xa')]();ami['Action']=BPromise['promisify'](ami['action']);function error(_0x20dddb){logger[_0x7242('0xb')](util[_0x7242('0xc')](_0x7242('0xd'),config[_0x7242('0x6')][_0x7242('0x8')],config['asterisk']['ip'],config[_0x7242('0x6')]['port'],util[_0x7242('0xe')](_0x20dddb,![],null)));}function close(){logger[_0x7242('0xb')](util[_0x7242('0xc')](_0x7242('0xf'),config[_0x7242('0x6')][_0x7242('0x8')],config['asterisk']['ip'],config[_0x7242('0x6')]['port']));}ami[_0x7242('0x10')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7242('0x11')]({'action':_0x7242('0x12')});};};ami[_0x7242('0x13')]=function(){return function(){return ami[_0x7242('0x11')]({'action':_0x7242('0x14')});};};ami[_0x7242('0x15')]=function(){return function(){return ami['Action']({'action':_0x7242('0x16')});};};ami[_0x7242('0x17')]=function(){return function(){return ami[_0x7242('0x11')]({'action':'coreshowchannels'});};};function connect(_0x3d8f4f){logger[_0x7242('0x18')](util[_0x7242('0xc')](_0x7242('0x19'),config[_0x7242('0x6')][_0x7242('0x8')],config[_0x7242('0x6')]['ip'],config[_0x7242('0x6')]['port']));ami[_0x7242('0x1a')](_0x7242('0xb'),error);ami[_0x7242('0x1a')](_0x7242('0x1b'),close);}ami['on'](_0x7242('0x1c'),connect);ami['on'](_0x7242('0x1d'),function(_0x88c6b8){logger['info'](util[_0x7242('0xc')](_0x7242('0x1e'),config['asterisk'][_0x7242('0x8')],config[_0x7242('0x6')]['ip'],config[_0x7242('0x6')][_0x7242('0x7')],util['inspect'](_0x88c6b8,![],null)));});ami['on'](_0x7242('0x1f'),function(_0x33d219){logger['info'](util[_0x7242('0xc')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x7242('0x6')][_0x7242('0x8')],config[_0x7242('0x6')]['ip'],config[_0x7242('0x6')][_0x7242('0x7')]));return BPromise[_0x7242('0x20')]()[_0x7242('0x21')](ami[_0x7242('0x10')]())['then'](ami[_0x7242('0x22')]())['then'](ami[_0x7242('0x13')]())[_0x7242('0x21')](ami[_0x7242('0x15')]())['then'](ami[_0x7242('0x17')]())['catch'](function(_0x279e0b){console['log'](_0x279e0b);});});ami[_0x7242('0x1a')](_0x7242('0xb'),error);ami[_0x7242('0x1a')]('close',close);module[_0x7242('0x23')]=ami;
\ No newline at end of file
+var _0x088f=['format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','once','connect','shutdown','info','fullybooted','resolve','then','actionDeviceStateList','catch','log','close','asterisk-manager','bluebird','moment','util','../../config/logger','ami','../../config/environment','asterisk','port','password','keepConnected','Action','promisify','error'];(function(_0x421262,_0x39cd7a){var _0x337383=function(_0x54748a){while(--_0x54748a){_0x421262['push'](_0x421262['shift']());}};_0x337383(++_0x39cd7a);}(_0x088f,0x64));var _0xf088=function(_0x2788b5,_0x3eaccf){_0x2788b5=_0x2788b5-0x0;var _0x3b132d=_0x088f[_0x2788b5];return _0x3b132d;};'use strict';var Manager=require(_0xf088('0x0'));var BPromise=require(_0xf088('0x1'));var moment=require(_0xf088('0x2'));var util=require(_0xf088('0x3'));var _=require('lodash');var logger=require(_0xf088('0x4'))(_0xf088('0x5'));var config=require(_0xf088('0x6'));var ami=new Manager(config[_0xf088('0x7')][_0xf088('0x8')],config[_0xf088('0x7')]['ip'],config[_0xf088('0x7')]['username'],config['asterisk'][_0xf088('0x9')],!![]);ami[_0xf088('0xa')]();ami[_0xf088('0xb')]=BPromise[_0xf088('0xc')](ami['action']);function error(_0x34bdf0){logger[_0xf088('0xd')](util[_0xf088('0xe')](_0xf088('0xf'),config[_0xf088('0x7')][_0xf088('0x10')],config['asterisk']['ip'],config[_0xf088('0x7')][_0xf088('0x8')],util['inspect'](_0x34bdf0,![],null)));}function close(){logger[_0xf088('0xd')](util[_0xf088('0xe')](_0xf088('0x11'),config[_0xf088('0x7')][_0xf088('0x10')],config[_0xf088('0x7')]['ip'],config[_0xf088('0x7')]['port']));}ami[_0xf088('0x12')]=function(){return function(){return ami[_0xf088('0xb')]({'action':_0xf088('0x13')});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0xf088('0x14')});};};ami[_0xf088('0x15')]=function(){return function(){return ami[_0xf088('0xb')]({'action':_0xf088('0x16')});};};ami[_0xf088('0x17')]=function(){return function(){return ami[_0xf088('0xb')]({'action':_0xf088('0x18')});};};ami[_0xf088('0x19')]=function(){return function(){return ami[_0xf088('0xb')]({'action':_0xf088('0x1a')});};};function connect(_0x47e52c){logger['info'](util[_0xf088('0xe')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xf088('0x7')]['username'],config[_0xf088('0x7')]['ip'],config[_0xf088('0x7')]['port']));ami[_0xf088('0x1b')]('error',error);ami[_0xf088('0x1b')]('close',close);}ami['on'](_0xf088('0x1c'),connect);ami['on'](_0xf088('0x1d'),function(_0x4d2f8d){logger[_0xf088('0x1e')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xf088('0x7')][_0xf088('0x10')],config[_0xf088('0x7')]['ip'],config[_0xf088('0x7')]['port'],util['inspect'](_0x4d2f8d,![],null)));});ami['on'](_0xf088('0x1f'),function(_0x3a39d7){logger[_0xf088('0x1e')](util[_0xf088('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xf088('0x7')][_0xf088('0x10')],config[_0xf088('0x7')]['ip'],config[_0xf088('0x7')][_0xf088('0x8')]));return BPromise[_0xf088('0x20')]()[_0xf088('0x21')](ami['actionSipShowRegistry']())[_0xf088('0x21')](ami[_0xf088('0x22')]())[_0xf088('0x21')](ami[_0xf088('0x15')]())[_0xf088('0x21')](ami['actionQueueSummary']())[_0xf088('0x21')](ami['actionCoreShowChannels']())[_0xf088('0x23')](function(_0x16df58){console[_0xf088('0x24')](_0x16df58);});});ami['once']('error',error);ami[_0xf088('0x1b')](_0xf088('0x25'),close);module['exports']=ami;
\ No newline at end of file
index a15c8bb..097f010 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x49c090,_0x5a6a99){var _0x12513d=function(_0x325620){while(--_0x325620){_0x49c090['push'](_0x49c090['shift']());}};_0x12513d(++_0x5a6a99);}(_0xaa88,0x137));var _0x8aa8=function(_0x3239f5,_0x50e77c){_0x3239f5=_0x3239f5-0x0;var _0x3559c8=_0xaa88[_0x3239f5];return _0x3559c8;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client;
\ No newline at end of file
+var _0xd8b0=['message','result','catch','exports','jayson/promise','bluebird','http','Request','then','debug','memberReport','error','rpc'];(function(_0x486357,_0x496eb2){var _0x3ab9af=function(_0x598722){while(--_0x598722){_0x486357['push'](_0x486357['shift']());}};_0x3ab9af(++_0x496eb2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('ami');var client=jayson['client'][_0x0d8b('0x2')]({'port':0x2329});client[_0x0d8b('0x3')]=function(_0x43bca1,_0x364286){return new BPromise(function(_0x8196ed,_0x577834){return client['request'](_0x43bca1,_0x364286)[_0x0d8b('0x4')](function(_0x227c63){logger[_0x0d8b('0x5')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x364286,_0x227c63);if(_0x227c63[_0x0d8b('0x7')]){logger['error'](_0x0d8b('0x8'),_0x0d8b('0x6'),_0x43bca1,_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')],_0x364286);return _0x577834(_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')]);}else{return _0x8196ed(_0x227c63[_0x0d8b('0xa')]);}})[_0x0d8b('0xb')](function(_0x48fa16){logger[_0x0d8b('0x7')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x48fa16,_0x364286);return _0x577834(_0x48fa16);});});};module[_0x0d8b('0xc')]=client;
\ No newline at end of file
index 8a24b3f..6246155 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf161=['format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime'];(function(_0x4fc6ff,_0x1f7862){var _0x4a417c=function(_0x1ac562){while(--_0x1ac562){_0x4fc6ff['push'](_0x4fc6ff['shift']());}};_0x4a417c(++_0x1f7862);}(_0xf161,0x89));var _0x1f16=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xf161[_0x82129b];return _0x2ae5dc;};'use strict';var util=require(_0x1f16('0x0'));var _=require(_0x1f16('0x1'));var moment=require(_0x1f16('0x2'));function checkNameSurname(_0xfc491e,_0x23fe77,_0x395036){var _0x2ac2fe='';if(!_[_0x1f16('0x3')](_0x23fe77)&&_0x1f16('0x4')===typeof _0x23fe77){_0x2ac2fe+=_0x23fe77;}if(!_[_0x1f16('0x3')](_0x395036)&&_0x1f16('0x4')===typeof _0x395036){_0x2ac2fe+='\x20'+_0x395036;}if(_0x2ac2fe!==''){return _0x2ac2fe;}return _0xfc491e;}function Action(_0x1b8741,_0x5abeb0,_0x397b24){this[_0x1f16('0x5')]=_0x1b8741;this[_0x1f16('0x6')]=_0x397b24||undefined;this[_0x1f16('0x7')]=checkNameSurname(_0x5abeb0['Contact'][_0x1f16('0x8')],_0x5abeb0[_0x1f16('0x9')]['firstName'],_0x5abeb0['Contact'][_0x1f16('0xa')]);this[_0x1f16('0xb')]=_0x5abeb0[_0x1f16('0x9')]['phone'];this[_0x1f16('0xc')]=_0x1b8741[_0x1f16('0x7')];this['active']=_0x5abeb0[_0x1f16('0xd')]||![];this[_0x1f16('0xe')]=_0x1b8741[_0x1f16('0xe')];this[_0x1f16('0xf')]=_0x1b8741[_0x1f16('0xf')]||0x3;this[_0x1f16('0x10')]=_0x5abeb0[_0x1f16('0x10')];this['countbusyretry']=_0x5abeb0['countbusyretry'];this[_0x1f16('0x11')]=_0x5abeb0[_0x1f16('0x11')];this[_0x1f16('0x12')]=_0x5abeb0['countnoanswerretry'];this[_0x1f16('0x13')]=_0x5abeb0[_0x1f16('0x13')];this[_0x1f16('0x14')]=_0x5abeb0['countdropretry'];this['countabandonedretry']=_0x5abeb0['countabandonedretry'];this[_0x1f16('0x15')]=_0x5abeb0[_0x1f16('0x15')];this[_0x1f16('0x16')]=_0x5abeb0[_0x1f16('0x16')];this[_0x1f16('0x17')]=_0x5abeb0[_0x1f16('0x17')];this[_0x1f16('0x18')]=_0x5abeb0[_0x1f16('0x18')];this[_0x1f16('0x19')]=_0x5abeb0[_0x1f16('0x19')];this[_0x1f16('0x1a')]=_0x5abeb0[_0x1f16('0x1a')];this[_0x1f16('0x1b')]=_0x5abeb0['CampaignId'];this[_0x1f16('0x1c')]=_0x5abeb0['id'];this[_0x1f16('0x1d')]=_0x5abeb0[_0x1f16('0x9')]['firstName']||'';this[_0x1f16('0x1e')]=moment()[_0x1f16('0x1f')](_0x1f16('0x20'));this[_0x1f16('0x21')]=_0x5abeb0['callback'];this[_0x1f16('0x22')]=_0x5abeb0['callbackuniqueid'];this['callbackat']=_0x5abeb0['callbackat'];this[_0x1f16('0x23')]=_0x5abeb0[_0x1f16('0x23')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x1f16('0x24')]['getCaller']=function(){return util['format'](_0x1f16('0x25'),this[_0x1f16('0x7')],this['voiceQueue'][_0x1f16('0x26')]>0x0?this['number'][_0x1f16('0x27')](this['voiceQueue'][_0x1f16('0x26')]):this[_0x1f16('0xb')]);};Action[_0x1f16('0x24')][_0x1f16('0x28')]=function(){return this[_0x1f16('0xc')];};module[_0x1f16('0x29')]=Action;
\ No newline at end of file
+var _0xf8c2=['originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','number','substring','prototype','getQueue','exports','util','lodash','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','callback','callbackuniqueid','callbackat','recallme'];(function(_0x2d344f,_0x25fa84){var _0x2e796b=function(_0x10466a){while(--_0x10466a){_0x2d344f['push'](_0x2d344f['shift']());}};_0x2e796b(++_0x25fa84);}(_0xf8c2,0x92));var _0x2f8c=function(_0x260c81,_0x96fb45){_0x260c81=_0x260c81-0x0;var _0x2e7483=_0xf8c2[_0x260c81];return _0x2e7483;};'use strict';var util=require(_0x2f8c('0x0'));var _=require(_0x2f8c('0x1'));var moment=require('moment');function checkNameSurname(_0x5cbc2d,_0x282146,_0x9a095e){var _0x4c8317='';if(!_[_0x2f8c('0x2')](_0x282146)&&_0x2f8c('0x3')===typeof _0x282146){_0x4c8317+=_0x282146;}if(!_['isNil'](_0x9a095e)&&_0x2f8c('0x3')===typeof _0x9a095e){_0x4c8317+='\x20'+_0x9a095e;}if(_0x4c8317!==''){return _0x4c8317;}return _0x5cbc2d;}function Action(_0x364847,_0x1b08b4,_0x487b96){this['voiceQueue']=_0x364847;this[_0x2f8c('0x4')]=_0x487b96||undefined;this[_0x2f8c('0x5')]=checkNameSurname(_0x1b08b4[_0x2f8c('0x6')][_0x2f8c('0x7')],_0x1b08b4[_0x2f8c('0x6')][_0x2f8c('0x8')],_0x1b08b4[_0x2f8c('0x6')][_0x2f8c('0x9')]);this['number']=_0x1b08b4[_0x2f8c('0x6')][_0x2f8c('0x7')];this[_0x2f8c('0xa')]=_0x364847['name'];this[_0x2f8c('0xb')]=_0x1b08b4[_0x2f8c('0xb')]||![];this['type']=_0x364847[_0x2f8c('0xc')];this[_0x2f8c('0xd')]=_0x364847[_0x2f8c('0xd')]||0x3;this[_0x2f8c('0xe')]=_0x1b08b4[_0x2f8c('0xe')];this['countbusyretry']=_0x1b08b4[_0x2f8c('0xf')];this['countcongestionretry']=_0x1b08b4['countcongestionretry'];this['countnoanswerretry']=_0x1b08b4[_0x2f8c('0x10')];this[_0x2f8c('0x11')]=_0x1b08b4[_0x2f8c('0x11')];this[_0x2f8c('0x12')]=_0x1b08b4[_0x2f8c('0x12')];this[_0x2f8c('0x13')]=_0x1b08b4[_0x2f8c('0x13')];this[_0x2f8c('0x14')]=_0x1b08b4['countmachineretry'];this[_0x2f8c('0x15')]=_0x1b08b4[_0x2f8c('0x15')];this[_0x2f8c('0x16')]=_0x1b08b4[_0x2f8c('0x16')];this[_0x2f8c('0x17')]=_0x1b08b4['ListId'];this[_0x2f8c('0x18')]=_0x1b08b4[_0x2f8c('0x18')];this['VoiceQueueId']=_0x1b08b4[_0x2f8c('0x19')];this[_0x2f8c('0x1a')]=_0x1b08b4[_0x2f8c('0x1a')];this[_0x2f8c('0x1b')]=_0x1b08b4['id'];this[_0x2f8c('0x1c')]=_0x1b08b4[_0x2f8c('0x6')][_0x2f8c('0x8')]||'';this['starttime']=moment()[_0x2f8c('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2f8c('0x1e')]=_0x1b08b4[_0x2f8c('0x1e')];this[_0x2f8c('0x1f')]=_0x1b08b4[_0x2f8c('0x1f')];this[_0x2f8c('0x20')]=_0x1b08b4[_0x2f8c('0x20')];this['recallme']=_0x1b08b4[_0x2f8c('0x21')];this[_0x2f8c('0x22')]='';this[_0x2f8c('0x23')]='';}Action['prototype'][_0x2f8c('0x24')]=function(){return util[_0x2f8c('0x1d')](_0x2f8c('0x25'),this[_0x2f8c('0x5')],this[_0x2f8c('0x26')][_0x2f8c('0x27')]>0x0?this[_0x2f8c('0x28')][_0x2f8c('0x29')](this[_0x2f8c('0x26')][_0x2f8c('0x27')]):this[_0x2f8c('0x28')]);};Action[_0x2f8c('0x2a')][_0x2f8c('0x2b')]=function(){return this[_0x2f8c('0xa')];};module[_0x2f8c('0x2c')]=Action;
\ No newline at end of file
index 7e0870d..e3cc776 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd96=['originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','state','statedesc','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','queue','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x1a8e5e,_0xd94f20){var _0x35e401=function(_0x46e485){while(--_0x46e485){_0x1a8e5e['push'](_0x1a8e5e['shift']());}};_0x35e401(++_0xd94f20);}(_0xdd96,0x84));var _0x6dd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd96[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x6dd9('0x0'));var _=require(_0x6dd9('0x1'));var moment=require(_0x6dd9('0x2'));function getSeconds(_0x119309,_0x404d3c){var _0xfb6331=moment(_0x119309)[_0x6dd9('0x3')](0x0);var _0x51ef54=moment(_0x404d3c)[_0x6dd9('0x3')](0x0);return _0xfb6331[_0x6dd9('0x4')](_0x51ef54,'seconds');}function AgentComplete(_0x20efd9,_0x7018ab){this[_0x6dd9('0x5')]=0x4;this[_0x6dd9('0x6')]='Answer';this[_0x6dd9('0x7')]=_0x20efd9[_0x6dd9('0x7')];this[_0x6dd9('0x8')]=_0x20efd9[_0x6dd9('0x8')];this['campaigntype']=_0x20efd9['type']===_0x6dd9('0x9')?'queue':_0x20efd9[_0x6dd9('0x8')];this[_0x6dd9('0xa')]=_0x20efd9[_0x6dd9('0xa')];this[_0x6dd9('0xb')]=_0x20efd9[_0x6dd9('0xb')];this['countnoanswerretry']=_0x20efd9[_0x6dd9('0xc')];this['countglobal']=_0x20efd9[_0x6dd9('0xa')]+_0x20efd9[_0x6dd9('0xb')]+_0x20efd9['countnoanswerretry']+_0x20efd9['countnosuchnumberretry']+_0x20efd9[_0x6dd9('0xd')]+_0x20efd9[_0x6dd9('0xe')]+_0x20efd9[_0x6dd9('0xf')]+_0x20efd9[_0x6dd9('0x10')];this[_0x6dd9('0x11')]=_0x20efd9[_0x6dd9('0x11')];this['countdropretry']=_0x20efd9[_0x6dd9('0xd')];this[_0x6dd9('0xe')]=_0x20efd9[_0x6dd9('0xe')];this[_0x6dd9('0xf')]=_0x20efd9[_0x6dd9('0xf')];this[_0x6dd9('0x10')]=_0x20efd9[_0x6dd9('0x10')];this[_0x6dd9('0x12')]=_0x7018ab[_0x6dd9('0x12')];this[_0x6dd9('0x13')]=_0x20efd9['name'];this[_0x6dd9('0x14')]=_0x20efd9[_0x6dd9('0x15')];this['starttime']=_0x20efd9[_0x6dd9('0x16')];this[_0x6dd9('0x17')]=_0x20efd9[_0x6dd9('0x17')];this[_0x6dd9('0x18')]=_0x20efd9[_0x6dd9('0x18')];this[_0x6dd9('0x19')]=moment()['format'](_0x6dd9('0x1a'));this[_0x6dd9('0x1b')]=getSeconds(_0x20efd9[_0x6dd9('0x17')],_0x20efd9[_0x6dd9('0x16')]);this['holdtime']=getSeconds(_0x20efd9['answertime'],_0x20efd9[_0x6dd9('0x17')]);this[_0x6dd9('0x1c')]=getSeconds(this[_0x6dd9('0x19')],_0x20efd9[_0x6dd9('0x18')]);this[_0x6dd9('0x1d')]=_0x7018ab[_0x6dd9('0x1d')];this[_0x6dd9('0x1e')]=_0x7018ab[_0x6dd9('0x1e')];this[_0x6dd9('0x1f')]=_0x7018ab[_0x6dd9('0x1f')];this[_0x6dd9('0x20')]=_0x20efd9[_0x6dd9('0x20')];this['callbackuniqueid']=_0x20efd9['callbackuniqueid'];this[_0x6dd9('0x21')]=_0x20efd9[_0x6dd9('0x21')];this['recallme']=_0x20efd9[_0x6dd9('0x22')];this[_0x6dd9('0x23')]=_0x20efd9['ContactId'];this['ListId']=_0x20efd9[_0x6dd9('0x24')];this[_0x6dd9('0x25')]=_0x20efd9[_0x6dd9('0x25')];this[_0x6dd9('0x26')]=_0x20efd9[_0x6dd9('0x26')];this[_0x6dd9('0x27')]=_0x20efd9[_0x6dd9('0x27')];this[_0x6dd9('0x28')]=_0x20efd9[_0x6dd9('0x28')]||'';this[_0x6dd9('0x29')]=_0x20efd9[_0x6dd9('0x29')]||'';}module[_0x6dd9('0x2a')]=AgentComplete;
\ No newline at end of file
+var _0xefdb=['uniqueid','calleridname','name','calleridnum','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','answertime','talktime','queue','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','state','statedesc','Answer','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry'];(function(_0x3a4ff5,_0x452b11){var _0x445ed2=function(_0x43416f){while(--_0x43416f){_0x3a4ff5['push'](_0x3a4ff5['shift']());}};_0x445ed2(++_0x452b11);}(_0xefdb,0x9b));var _0xbefd=function(_0xb6ab6,_0x5f2d03){_0xb6ab6=_0xb6ab6-0x0;var _0x3f936f=_0xefdb[_0xb6ab6];return _0x3f936f;};'use strict';var util=require(_0xbefd('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x134cd2,_0x4e9027){var _0x293fd6=moment(_0x134cd2)[_0xbefd('0x1')](0x0);var _0x2b91ef=moment(_0x4e9027)['milliseconds'](0x0);return _0x293fd6[_0xbefd('0x2')](_0x2b91ef,'seconds');}function AgentComplete(_0x1e7767,_0x1d8ae7){this[_0xbefd('0x3')]=0x4;this[_0xbefd('0x4')]=_0xbefd('0x5');this[_0xbefd('0x6')]=_0x1e7767['scheduledat'];this[_0xbefd('0x7')]=_0x1e7767[_0xbefd('0x7')];this['campaigntype']=_0x1e7767[_0xbefd('0x7')]==='outbound'?'queue':_0x1e7767[_0xbefd('0x7')];this[_0xbefd('0x8')]=_0x1e7767['countbusyretry'];this[_0xbefd('0x9')]=_0x1e7767['countcongestionretry'];this[_0xbefd('0xa')]=_0x1e7767['countnoanswerretry'];this[_0xbefd('0xb')]=_0x1e7767[_0xbefd('0x8')]+_0x1e7767[_0xbefd('0x9')]+_0x1e7767[_0xbefd('0xa')]+_0x1e7767['countnosuchnumberretry']+_0x1e7767[_0xbefd('0xc')]+_0x1e7767['countabandonedretry']+_0x1e7767[_0xbefd('0xd')]+_0x1e7767[_0xbefd('0xe')];this[_0xbefd('0xf')]=_0x1e7767[_0xbefd('0xf')];this[_0xbefd('0xc')]=_0x1e7767[_0xbefd('0xc')];this[_0xbefd('0x10')]=_0x1e7767[_0xbefd('0x10')];this[_0xbefd('0xd')]=_0x1e7767['countmachineretry'];this[_0xbefd('0xe')]=_0x1e7767[_0xbefd('0xe')];this[_0xbefd('0x11')]=_0x1d8ae7[_0xbefd('0x11')];this[_0xbefd('0x12')]=_0x1e7767[_0xbefd('0x13')];this[_0xbefd('0x14')]=_0x1e7767['number'];this['starttime']=_0x1e7767['starttime'];this[_0xbefd('0x15')]=_0x1e7767[_0xbefd('0x15')];this['answertime']=_0x1e7767['answertime'];this[_0xbefd('0x16')]=moment()[_0xbefd('0x17')](_0xbefd('0x18'));this[_0xbefd('0x19')]=getSeconds(_0x1e7767['responsetime'],_0x1e7767[_0xbefd('0x1a')]);this['holdtime']=getSeconds(_0x1e7767[_0xbefd('0x1b')],_0x1e7767[_0xbefd('0x15')]);this[_0xbefd('0x1c')]=getSeconds(this[_0xbefd('0x16')],_0x1e7767[_0xbefd('0x1b')]);this[_0xbefd('0x1d')]=_0x1d8ae7[_0xbefd('0x1d')];this['membername']=_0x1d8ae7[_0xbefd('0x1e')];this['reason']=_0x1d8ae7['reason'];this['callback']=_0x1e7767[_0xbefd('0x1f')];this[_0xbefd('0x20')]=_0x1e7767['callbackuniqueid'];this[_0xbefd('0x21')]=_0x1e7767[_0xbefd('0x21')];this[_0xbefd('0x22')]=_0x1e7767[_0xbefd('0x22')];this[_0xbefd('0x23')]=_0x1e7767[_0xbefd('0x23')];this[_0xbefd('0x24')]=_0x1e7767[_0xbefd('0x24')];this[_0xbefd('0x25')]=_0x1e7767['UserId'];this['VoiceQueueId']=_0x1e7767[_0xbefd('0x26')];this[_0xbefd('0x27')]=_0x1e7767['CampaignId'];this[_0xbefd('0x28')]=_0x1e7767[_0xbefd('0x28')]||'';this['originatecalleridname']=_0x1e7767[_0xbefd('0x29')]||'';}module[_0xbefd('0x2a')]=AgentComplete;
\ No newline at end of file
index b0f85de..81989cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3937=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countglobal','countcongestionretry','countnosuchnumberretry'];(function(_0x1f4608,_0x9822d6){var _0x13be13=function(_0x2b573b){while(--_0x2b573b){_0x1f4608['push'](_0x1f4608['shift']());}};_0x13be13(++_0x9822d6);}(_0x3937,0xbf));var _0x7393=function(_0x274202,_0x4100ba){_0x274202=_0x274202-0x0;var _0x495c1a=_0x3937[_0x274202];return _0x495c1a;};'use strict';var util=require(_0x7393('0x0'));var _=require('lodash');var moment=require(_0x7393('0x1'));function getSeconds(_0x182983,_0x49aa96){var _0x45cd02=moment(_0x182983)['milliseconds'](0x0);var _0x224468=moment(_0x49aa96)['milliseconds'](0x0);return _0x45cd02[_0x7393('0x2')](_0x224468,_0x7393('0x3'));}function Final(_0x20011b){this[_0x7393('0x4')]=_0x20011b[_0x7393('0x4')];this[_0x7393('0x5')]=_0x20011b[_0x7393('0x5')];this[_0x7393('0x6')]=_0x20011b[_0x7393('0x6')];this['campaigntype']=_0x20011b['type']===_0x7393('0x7')?_0x7393('0x8'):_0x20011b[_0x7393('0x6')];this['countbusyretry']=_0x20011b[_0x7393('0x9')];this['countcongestionretry']=_0x20011b['countcongestionretry'];this['countnoanswerretry']=_0x20011b['countnoanswerretry'];this[_0x7393('0xa')]=_0x20011b[_0x7393('0x9')]+_0x20011b[_0x7393('0xb')]+_0x20011b['countnoanswerretry']+_0x20011b[_0x7393('0xc')]+_0x20011b[_0x7393('0xd')]+_0x20011b[_0x7393('0xe')]+_0x20011b[_0x7393('0xf')]+_0x20011b[_0x7393('0x10')];this[_0x7393('0xc')]=_0x20011b[_0x7393('0xc')];this[_0x7393('0xd')]=_0x20011b[_0x7393('0xd')];this['countabandonedretry']=_0x20011b['countabandonedretry'];this[_0x7393('0xf')]=_0x20011b['countmachineretry'];this['countagentrejectretry']=_0x20011b['countagentrejectretry'];this[_0x7393('0x8')]=_0x20011b['queue'];this[_0x7393('0x11')]=_0x20011b[_0x7393('0x11')];this['calleridnum']=_0x20011b[_0x7393('0x12')];this['starttime']=_0x20011b['starttime'];this[_0x7393('0x13')]=_0x20011b[_0x7393('0x13')];this[_0x7393('0x14')]=_0x20011b[_0x7393('0x13')];this[_0x7393('0x15')]=_0x20011b[_0x7393('0x15')]||0x0;this[_0x7393('0x16')]=_0x20011b[_0x7393('0x16')]||0x0;this['talktime']=_0x20011b['talktime']||0x0;this[_0x7393('0x17')]=_0x20011b[_0x7393('0x17')];this[_0x7393('0x18')]=_0x20011b[_0x7393('0x18')];this[_0x7393('0x19')]=_0x20011b['callbackat'];this['recallme']=_0x20011b['recallme'];this[_0x7393('0x1a')]=_0x20011b['ContactId'];this['ListId']=_0x20011b[_0x7393('0x1b')];this[_0x7393('0x1c')]=_0x20011b['UserId'];this[_0x7393('0x1d')]=_0x20011b[_0x7393('0x1d')];this[_0x7393('0x1e')]=_0x20011b[_0x7393('0x1e')];this[_0x7393('0x1f')]=_0x20011b[_0x7393('0x1f')]||'';this[_0x7393('0x20')]=_0x20011b[_0x7393('0x20')]||'';}module[_0x7393('0x21')]=Final;
\ No newline at end of file
+var _0x24ca=['countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x24ca,0x8c));var _0xa24c=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x24ca[_0x2df507];return _0x1f7167;};'use strict';var util=require(_0xa24c('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x1f4ee1,_0x4e90b0){var _0x155c49=moment(_0x1f4ee1)[_0xa24c('0x1')](0x0);var _0xe69cdd=moment(_0x4e90b0)['milliseconds'](0x0);return _0x155c49[_0xa24c('0x2')](_0xe69cdd,_0xa24c('0x3'));}function Final(_0x4707f9){this['uniqueid']=_0x4707f9['uniqueid'];this['scheduledat']=_0x4707f9[_0xa24c('0x4')];this[_0xa24c('0x5')]=_0x4707f9[_0xa24c('0x5')];this[_0xa24c('0x6')]=_0x4707f9[_0xa24c('0x5')]===_0xa24c('0x7')?'queue':_0x4707f9[_0xa24c('0x5')];this[_0xa24c('0x8')]=_0x4707f9[_0xa24c('0x8')];this['countcongestionretry']=_0x4707f9['countcongestionretry'];this[_0xa24c('0x9')]=_0x4707f9[_0xa24c('0x9')];this[_0xa24c('0xa')]=_0x4707f9[_0xa24c('0x8')]+_0x4707f9[_0xa24c('0xb')]+_0x4707f9[_0xa24c('0x9')]+_0x4707f9['countnosuchnumberretry']+_0x4707f9['countdropretry']+_0x4707f9['countabandonedretry']+_0x4707f9[_0xa24c('0xc')]+_0x4707f9[_0xa24c('0xd')];this[_0xa24c('0xe')]=_0x4707f9[_0xa24c('0xe')];this[_0xa24c('0xf')]=_0x4707f9['countdropretry'];this[_0xa24c('0x10')]=_0x4707f9['countabandonedretry'];this['countmachineretry']=_0x4707f9['countmachineretry'];this[_0xa24c('0xd')]=_0x4707f9[_0xa24c('0xd')];this[_0xa24c('0x11')]=_0x4707f9[_0xa24c('0x11')];this[_0xa24c('0x12')]=_0x4707f9[_0xa24c('0x12')];this[_0xa24c('0x13')]=_0x4707f9[_0xa24c('0x13')];this[_0xa24c('0x14')]=_0x4707f9[_0xa24c('0x14')];this[_0xa24c('0x15')]=_0x4707f9[_0xa24c('0x15')];this[_0xa24c('0x16')]=_0x4707f9[_0xa24c('0x15')];this['ringtime']=_0x4707f9[_0xa24c('0x17')]||0x0;this['holdtime']=_0x4707f9[_0xa24c('0x18')]||0x0;this[_0xa24c('0x19')]=_0x4707f9[_0xa24c('0x19')]||0x0;this[_0xa24c('0x1a')]=_0x4707f9[_0xa24c('0x1a')];this[_0xa24c('0x1b')]=_0x4707f9[_0xa24c('0x1b')];this[_0xa24c('0x1c')]=_0x4707f9[_0xa24c('0x1c')];this[_0xa24c('0x1d')]=_0x4707f9[_0xa24c('0x1d')];this['ContactId']=_0x4707f9['ContactId'];this[_0xa24c('0x1e')]=_0x4707f9[_0xa24c('0x1e')];this[_0xa24c('0x1f')]=_0x4707f9[_0xa24c('0x1f')];this[_0xa24c('0x20')]=_0x4707f9[_0xa24c('0x20')];this[_0xa24c('0x21')]=_0x4707f9[_0xa24c('0x21')];this[_0xa24c('0x22')]=_0x4707f9['originatecalleridnum']||'';this[_0xa24c('0x23')]=_0x4707f9['originatecalleridname']||'';}module[_0xa24c('0x24')]=Final;
\ No newline at end of file
index 242eaaf..227d1ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfd6=['IVR','reason','cause-txt','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','holdtime','talktime','queue','membername'];(function(_0x33ba5a,_0x460a6c){var _0x28e057=function(_0x401cc7){while(--_0x401cc7){_0x33ba5a['push'](_0x33ba5a['shift']());}};_0x28e057(++_0x460a6c);}(_0xcfd6,0x113));var _0x6cfd=function(_0x1b2a72,_0x56612b){_0x1b2a72=_0x1b2a72-0x0;var _0x41141c=_0xcfd6[_0x1b2a72];return _0x41141c;};'use strict';var util=require(_0x6cfd('0x0'));var _=require(_0x6cfd('0x1'));var moment=require('moment');function getSeconds(_0x46b47e,_0x3baba9){var _0x40baa0=moment(_0x46b47e)['milliseconds'](0x0);var _0xda5721=moment(_0x3baba9)[_0x6cfd('0x2')](0x0);return _0x40baa0[_0x6cfd('0x3')](_0xda5721,_0x6cfd('0x4'));}function Hangup(_0x56a0a7,_0x223112){this[_0x6cfd('0x5')]=0x4;this[_0x6cfd('0x6')]=_0x6cfd('0x7');this[_0x6cfd('0x8')]=_0x56a0a7[_0x6cfd('0x8')];this[_0x6cfd('0x9')]=_0x56a0a7[_0x6cfd('0x9')];this['campaigntype']=_0x56a0a7[_0x6cfd('0x9')]===_0x6cfd('0xa')?'queue':_0x56a0a7[_0x6cfd('0x9')];this[_0x6cfd('0xb')]=_0x56a0a7['countbusyretry'];this[_0x6cfd('0xc')]=_0x56a0a7[_0x6cfd('0xc')];this[_0x6cfd('0xd')]=_0x56a0a7[_0x6cfd('0xd')];this['countglobal']=_0x56a0a7[_0x6cfd('0xb')]+_0x56a0a7[_0x6cfd('0xc')]+_0x56a0a7[_0x6cfd('0xd')]+_0x56a0a7[_0x6cfd('0xe')]+_0x56a0a7[_0x6cfd('0xf')]+_0x56a0a7[_0x6cfd('0x10')]+_0x56a0a7[_0x6cfd('0x11')]+_0x56a0a7['countagentrejectretry'];this[_0x6cfd('0xe')]=_0x56a0a7['countnosuchnumberretry'];this[_0x6cfd('0xf')]=_0x56a0a7[_0x6cfd('0xf')];this[_0x6cfd('0x10')]=_0x56a0a7[_0x6cfd('0x10')];this['countmachineretry']=_0x56a0a7[_0x6cfd('0x11')];this[_0x6cfd('0x12')]=_0x56a0a7[_0x6cfd('0x12')];this[_0x6cfd('0x13')]=_0x223112['uniqueid'];this[_0x6cfd('0x14')]=_0x56a0a7['name'];this[_0x6cfd('0x15')]=_0x56a0a7[_0x6cfd('0x16')];this['starttime']=_0x56a0a7['starttime'];this['responsetime']=_0x56a0a7[_0x6cfd('0x17')];this[_0x6cfd('0x18')]=moment()[_0x6cfd('0x19')](_0x6cfd('0x1a'));this[_0x6cfd('0x1b')]=getSeconds(_0x56a0a7[_0x6cfd('0x17')],_0x56a0a7[_0x6cfd('0x1c')]);this[_0x6cfd('0x1d')]=0x0;this[_0x6cfd('0x1e')]=getSeconds(this[_0x6cfd('0x18')],_0x56a0a7[_0x6cfd('0x17')]);this[_0x6cfd('0x1f')]=_0x56a0a7[_0x6cfd('0x1f')];this[_0x6cfd('0x20')]=_0x6cfd('0x21');this[_0x6cfd('0x22')]=_0x223112[_0x6cfd('0x23')];this['callback']=_0x56a0a7['callback'];this[_0x6cfd('0x24')]=_0x56a0a7[_0x6cfd('0x24')];this[_0x6cfd('0x25')]=_0x56a0a7[_0x6cfd('0x25')];this['recallme']=_0x56a0a7[_0x6cfd('0x26')];this[_0x6cfd('0x27')]=_0x56a0a7['ContactId'];this[_0x6cfd('0x28')]=_0x56a0a7['ListId'];this[_0x6cfd('0x29')]=_0x56a0a7[_0x6cfd('0x29')];this['VoiceQueueId']=_0x56a0a7['VoiceQueueId'];this['CampaignId']=_0x56a0a7[_0x6cfd('0x2a')];}module[_0x6cfd('0x2b')]=Hangup;
\ No newline at end of file
+var _0xdea9=['milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','name','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment'];(function(_0x2c0805,_0x44c578){var _0x2c0ce7=function(_0x588a5c){while(--_0x588a5c){_0x2c0805['push'](_0x2c0805['shift']());}};_0x2c0ce7(++_0x44c578);}(_0xdea9,0x15d));var _0x9dea=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xdea9[_0x2d7f0e];return _0x110b07;};'use strict';var util=require('util');var _=require(_0x9dea('0x0'));var moment=require(_0x9dea('0x1'));function getSeconds(_0x150e42,_0x30fe76){var _0x1a358f=moment(_0x150e42)[_0x9dea('0x2')](0x0);var _0x48bffb=moment(_0x30fe76)[_0x9dea('0x2')](0x0);return _0x1a358f['diff'](_0x48bffb,_0x9dea('0x3'));}function Hangup(_0x4419de,_0x416f28){this[_0x9dea('0x4')]=0x4;this[_0x9dea('0x5')]='Answer';this[_0x9dea('0x6')]=_0x4419de[_0x9dea('0x6')];this[_0x9dea('0x7')]=_0x4419de['type'];this[_0x9dea('0x8')]=_0x4419de['type']===_0x9dea('0x9')?_0x9dea('0xa'):_0x4419de[_0x9dea('0x7')];this[_0x9dea('0xb')]=_0x4419de[_0x9dea('0xb')];this['countcongestionretry']=_0x4419de[_0x9dea('0xc')];this[_0x9dea('0xd')]=_0x4419de[_0x9dea('0xd')];this[_0x9dea('0xe')]=_0x4419de[_0x9dea('0xb')]+_0x4419de[_0x9dea('0xc')]+_0x4419de[_0x9dea('0xd')]+_0x4419de['countnosuchnumberretry']+_0x4419de[_0x9dea('0xf')]+_0x4419de['countabandonedretry']+_0x4419de[_0x9dea('0x10')]+_0x4419de[_0x9dea('0x11')];this[_0x9dea('0x12')]=_0x4419de[_0x9dea('0x12')];this[_0x9dea('0xf')]=_0x4419de[_0x9dea('0xf')];this[_0x9dea('0x13')]=_0x4419de['countabandonedretry'];this[_0x9dea('0x10')]=_0x4419de[_0x9dea('0x10')];this['countagentrejectretry']=_0x4419de[_0x9dea('0x11')];this['uniqueid']=_0x416f28['uniqueid'];this['calleridname']=_0x4419de[_0x9dea('0x14')];this['calleridnum']=_0x4419de['number'];this[_0x9dea('0x15')]=_0x4419de[_0x9dea('0x15')];this[_0x9dea('0x16')]=_0x4419de[_0x9dea('0x16')];this['endtime']=moment()[_0x9dea('0x17')](_0x9dea('0x18'));this['ringtime']=getSeconds(_0x4419de['responsetime'],_0x4419de[_0x9dea('0x15')]);this[_0x9dea('0x19')]=0x0;this['talktime']=getSeconds(this['endtime'],_0x4419de['responsetime']);this[_0x9dea('0xa')]=_0x4419de[_0x9dea('0xa')];this[_0x9dea('0x1a')]=_0x9dea('0x1b');this['reason']=_0x416f28[_0x9dea('0x1c')];this[_0x9dea('0x1d')]=_0x4419de[_0x9dea('0x1d')];this[_0x9dea('0x1e')]=_0x4419de[_0x9dea('0x1e')];this[_0x9dea('0x1f')]=_0x4419de[_0x9dea('0x1f')];this[_0x9dea('0x20')]=_0x4419de[_0x9dea('0x20')];this[_0x9dea('0x21')]=_0x4419de[_0x9dea('0x21')];this[_0x9dea('0x22')]=_0x4419de[_0x9dea('0x22')];this[_0x9dea('0x23')]=_0x4419de[_0x9dea('0x23')];this['VoiceQueueId']=_0x4419de[_0x9dea('0x24')];this['CampaignId']=_0x4419de[_0x9dea('0x25')];}module[_0x9dea('0x26')]=Hangup;
\ No newline at end of file
index 95d085e..2469b80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38bc=['campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type'];(function(_0x2f421,_0x5144c4){var _0x27b4af=function(_0x119470){while(--_0x119470){_0x2f421['push'](_0x2f421['shift']());}};_0x27b4af(++_0x5144c4);}(_0x38bc,0x120));var _0xc38b=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x38bc[_0x51020b];return _0x371e47;};'use strict';var util=require(_0xc38b('0x0'));var _=require('lodash');var moment=require(_0xc38b('0x1'));function getSeconds(_0x438ac2,_0x5c42f7){var _0x4ef597=moment(_0x438ac2)[_0xc38b('0x2')](0x0);var _0x3d9550=moment(_0x5c42f7)[_0xc38b('0x2')](0x0);return _0x4ef597[_0xc38b('0x3')](_0x3d9550,_0xc38b('0x4'));}function History(_0x5a98e2){this[_0xc38b('0x5')]=_0x5a98e2[_0xc38b('0x5')];this[_0xc38b('0x6')]=_0x5a98e2[_0xc38b('0x6')]||undefined;this['type']=_0x5a98e2[_0xc38b('0x7')];this[_0xc38b('0x8')]=_0x5a98e2[_0xc38b('0x7')]===_0xc38b('0x9')?_0xc38b('0xa'):_0x5a98e2[_0xc38b('0x7')];this[_0xc38b('0xb')]=_0x5a98e2[_0xc38b('0xb')];this[_0xc38b('0xc')]=_0x5a98e2[_0xc38b('0xc')];this[_0xc38b('0xd')]=_0x5a98e2['countnoanswerretry'];this[_0xc38b('0xe')]=_0x5a98e2['countbusyretry']+_0x5a98e2['countcongestionretry']+_0x5a98e2[_0xc38b('0xd')]+_0x5a98e2[_0xc38b('0xf')]+_0x5a98e2['countdropretry']+_0x5a98e2[_0xc38b('0x10')]+_0x5a98e2[_0xc38b('0x11')]+_0x5a98e2[_0xc38b('0x12')];this['countnosuchnumberretry']=_0x5a98e2[_0xc38b('0xf')];this['countdropretry']=_0x5a98e2['countdropretry'];this[_0xc38b('0x10')]=_0x5a98e2[_0xc38b('0x10')];this['countmachineretry']=_0x5a98e2['countmachineretry'];this[_0xc38b('0x12')]=_0x5a98e2[_0xc38b('0x12')];this[_0xc38b('0xa')]=_0x5a98e2[_0xc38b('0xa')];this[_0xc38b('0x13')]=_0x5a98e2[_0xc38b('0x14')];this[_0xc38b('0x15')]=_0x5a98e2[_0xc38b('0x16')];this[_0xc38b('0x17')]=_0x5a98e2[_0xc38b('0x17')];this[_0xc38b('0x18')]=_0x5a98e2[_0xc38b('0x18')];this['endtime']=_0x5a98e2[_0xc38b('0x18')];this['ringtime']=getSeconds(_0x5a98e2[_0xc38b('0x18')],_0x5a98e2[_0xc38b('0x17')]);this[_0xc38b('0x19')]=0x0;this['talktime']=0x0;this[_0xc38b('0x1a')]=_0x5a98e2['callback'];this[_0xc38b('0x1b')]=_0x5a98e2[_0xc38b('0x1b')];this['callbackat']=_0x5a98e2[_0xc38b('0x1c')];this[_0xc38b('0x1d')]=_0x5a98e2[_0xc38b('0x1d')];this[_0xc38b('0x1e')]=_0x5a98e2[_0xc38b('0x1e')];this['ListId']=_0x5a98e2[_0xc38b('0x1f')];this[_0xc38b('0x20')]=_0x5a98e2[_0xc38b('0x20')];this[_0xc38b('0x21')]=_0x5a98e2['VoiceQueueId'];this[_0xc38b('0x22')]=_0x5a98e2[_0xc38b('0x22')];this[_0xc38b('0x23')]=_0x5a98e2[_0xc38b('0x23')]||'';this[_0xc38b('0x24')]=_0x5a98e2[_0xc38b('0x24')]||'';}module['exports']=History;
\ No newline at end of file
+var _0xf710=['countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','number','responsetime','endtime','starttime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry'];(function(_0x1fd437,_0x2c0b47){var _0x40d9e6=function(_0x1668a1){while(--_0x1668a1){_0x1fd437['push'](_0x1fd437['shift']());}};_0x40d9e6(++_0x2c0b47);}(_0xf710,0x176));var _0x0f71=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf710[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x0f71('0x0'));var _=require(_0x0f71('0x1'));var moment=require(_0x0f71('0x2'));function getSeconds(_0x422fae,_0x54e8cd){var _0x46f21d=moment(_0x422fae)[_0x0f71('0x3')](0x0);var _0x360b3e=moment(_0x54e8cd)[_0x0f71('0x3')](0x0);return _0x46f21d['diff'](_0x360b3e,_0x0f71('0x4'));}function History(_0x31624c){this[_0x0f71('0x5')]=_0x31624c['uniqueid'];this[_0x0f71('0x6')]=_0x31624c[_0x0f71('0x6')]||undefined;this['type']=_0x31624c['type'];this['campaigntype']=_0x31624c[_0x0f71('0x7')]===_0x0f71('0x8')?_0x0f71('0x9'):_0x31624c[_0x0f71('0x7')];this[_0x0f71('0xa')]=_0x31624c[_0x0f71('0xa')];this['countcongestionretry']=_0x31624c[_0x0f71('0xb')];this['countnoanswerretry']=_0x31624c[_0x0f71('0xc')];this['countglobal']=_0x31624c[_0x0f71('0xa')]+_0x31624c[_0x0f71('0xb')]+_0x31624c[_0x0f71('0xc')]+_0x31624c['countnosuchnumberretry']+_0x31624c[_0x0f71('0xd')]+_0x31624c[_0x0f71('0xe')]+_0x31624c[_0x0f71('0xf')]+_0x31624c[_0x0f71('0x10')];this[_0x0f71('0x11')]=_0x31624c['countnosuchnumberretry'];this[_0x0f71('0xd')]=_0x31624c['countdropretry'];this['countabandonedretry']=_0x31624c[_0x0f71('0xe')];this[_0x0f71('0xf')]=_0x31624c['countmachineretry'];this[_0x0f71('0x10')]=_0x31624c[_0x0f71('0x10')];this[_0x0f71('0x9')]=_0x31624c['queue'];this[_0x0f71('0x12')]=_0x31624c[_0x0f71('0x13')];this['calleridnum']=_0x31624c[_0x0f71('0x14')];this['starttime']=_0x31624c['starttime'];this['responsetime']=_0x31624c[_0x0f71('0x15')];this[_0x0f71('0x16')]=_0x31624c['responsetime'];this['ringtime']=getSeconds(_0x31624c['responsetime'],_0x31624c[_0x0f71('0x17')]);this[_0x0f71('0x18')]=0x0;this['talktime']=0x0;this[_0x0f71('0x19')]=_0x31624c[_0x0f71('0x19')];this[_0x0f71('0x1a')]=_0x31624c['callbackuniqueid'];this[_0x0f71('0x1b')]=_0x31624c[_0x0f71('0x1b')];this[_0x0f71('0x1c')]=_0x31624c['recallme'];this[_0x0f71('0x1d')]=_0x31624c['ContactId'];this[_0x0f71('0x1e')]=_0x31624c['ListId'];this[_0x0f71('0x1f')]=_0x31624c['UserId'];this[_0x0f71('0x20')]=_0x31624c[_0x0f71('0x20')];this[_0x0f71('0x21')]=_0x31624c['CampaignId'];this[_0x0f71('0x22')]=_0x31624c[_0x0f71('0x22')]||'';this['originatecalleridname']=_0x31624c['originatecalleridname']||'';}module['exports']=History;
\ No newline at end of file
index e5a8c3e..eb421ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b2b=['waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\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','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','inspect','error','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','undefined','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','SIP/%s','unmonitored','uniqueid','isNil','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','statedesc','HangupInAMD','buildObj','MACHINE','Machine','membername','AMD','countmachineretry','countglobal','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','rescheduleContact','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','custom:amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x2019\x20machine....','minutes','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','actionid','strategy','roundrobin','locked','paused','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','[Catch][Preview][syncQueueStatusComplete]','finally','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','checkIfTime','ifTime','checkIfTimeIntervals','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','Failure','isArray','length','command','interval','true','iftime\x20%s,%s','content','some','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialTimezone','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','OriginateError','[originate][error]','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countagentrejectretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','dialRecallInQueue','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','127.0.0.1','rrmemory','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','answered','available','loggedIn','pTalking','sumHoldTime','talking','total','unmanaged'];(function(_0x59328b,_0x3e1186){var _0x2593ea=function(_0x11ba1e){while(--_0x11ba1e){_0x59328b['push'](_0x59328b['shift']());}};_0x2593ea(++_0x3e1186);}(_0x8b2b,0x1c0));var _0xb8b2=function(_0x1ce3f5,_0x117417){_0x1ce3f5=_0x1ce3f5-0x0;var _0x175233=_0x8b2b[_0x1ce3f5];return _0x175233;};'use strict';var util=require(_0xb8b2('0x0'));var _=require(_0xb8b2('0x1'));var BPromise=require(_0xb8b2('0x2'));var uuid=require('uuid');var moment=require(_0xb8b2('0x3'));var rr=require('rr');var md5=require(_0xb8b2('0x4'));var Redis=require(_0xb8b2('0x5'));var ut=require(_0xb8b2('0x6'));var config=require(_0xb8b2('0x7'));var logger=require(_0xb8b2('0x8'))('dialer');var loggerBooked=require('../../../config/logger')(_0xb8b2('0x9'));var loggerPredictive=require(_0xb8b2('0x8'))(_0xb8b2('0xa'));var loggerPredictiveCalls=require(_0xb8b2('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0xb8b2('0xb'));var ami=require(_0xb8b2('0xc'));config[_0xb8b2('0xd')]=_[_0xb8b2('0xe')](config[_0xb8b2('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0xb8b2('0xf'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xb8b2('0x10'));var cmHopperBlack=require(_0xb8b2('0x11'));var voiceQueueRt=require(_0xb8b2('0x12'));var Action=require(_0xb8b2('0x13'));var History=require(_0xb8b2('0x14'));var Final=require(_0xb8b2('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xb8b2('0x16'));var Hangup=require('./hangup');var ipAgi=process['env']['XCALLY_IP_AGI']||_0xb8b2('0x17');var strategy={'rrmemory':_0xb8b2('0x18'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0xb8b2('0x19')][_0xb8b2('0x1a')]=function(_0x333bfb){this[_0xb8b2('0x1b')]=this[_0xb8b2('0x1b')]?this['tail']['finally'](_0x333bfb):_0x333bfb();};function Dialer(_0xda50ef,_0x7eff5){this[_0xb8b2('0x1c')]=new Sequence();this[_0xb8b2('0x1d')]=_0x7eff5;this[_0xb8b2('0x1e')]=_0xda50ef['voiceQueues'];this['campaigns']=_0xda50ef[_0xb8b2('0x1f')];this[_0xb8b2('0x20')]=_0xda50ef[_0xb8b2('0x20')];this[_0xb8b2('0x21')]=_0xda50ef['trunks'];this[_0xb8b2('0x22')]=config[_0xb8b2('0x22')]||0x2;this[_0xb8b2('0x23')]={};this[_0xb8b2('0x24')]={};this[_0xb8b2('0x25')]={};this[_0xb8b2('0x26')]={};this[_0xb8b2('0x27')]={};this['startPredictive']={};this[_0xb8b2('0x28')]={};this[_0xb8b2('0x29')]={};this[_0xb8b2('0x2a')]={};this[_0xb8b2('0x2b')]={};ami['on'](_0xb8b2('0x2c'),this['syncAgentConnect'][_0xb8b2('0x2d')](this));ami['on']('queuecallerabandon',this[_0xb8b2('0x2e')][_0xb8b2('0x2d')](this));ami['on'](_0xb8b2('0x2f'),this[_0xb8b2('0x30')]['bind'](this));ami['on'](_0xb8b2('0x31'),this[_0xb8b2('0x32')][_0xb8b2('0x2d')](this));ami['on']('custom:queuesummary',this['syncQueueSummary']['bind'](this));ami['on']('hangup',this[_0xb8b2('0x33')][_0xb8b2('0x2d')](this));ami['on'](_0xb8b2('0x34'),this[_0xb8b2('0x35')][_0xb8b2('0x2d')](this));ami['on'](_0xb8b2('0x36'),this[_0xb8b2('0x37')][_0xb8b2('0x2d')](this));ami['on'](_0xb8b2('0x38'),this[_0xb8b2('0x39')][_0xb8b2('0x2d')](this));ami['on'](_0xb8b2('0x3a'),this[_0xb8b2('0x3b')][_0xb8b2('0x2d')](this));this[_0xb8b2('0x3c')]();this[_0xb8b2('0x3d')]();}function isNotNull(_0x3f9dc8){return _0x3f9dc8!==null&&!_['isUndefined'](_0x3f9dc8);}function checkIsLoggedIn(_0x37ea31,_0x1899d9){return function(){if(_0x1899d9<=0x0){_0x37ea31[_0xb8b2('0x3e')]=_0xb8b2('0x3f');throw _0x37ea31[_0xb8b2('0x40')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x29cde1){return _0x29cde1;}function checkIsActive(_0x407864,_0x26309e){return function(){if(!isActive(_0x26309e)){_0x407864['message']=_0xb8b2('0x41');throw _0x407864[_0xb8b2('0x40')]+'\x20NOT\x20Active';}};}function checkInterval(_0xa11e1){return function(){if(!isNotNull(_0xa11e1[_0xb8b2('0x42')])){_0xa11e1[_0xb8b2('0x3e')]=_0xb8b2('0x43');throw _0xa11e1[_0xb8b2('0x40')]+_0xb8b2('0x44');}if(!isNotNull(_0xa11e1[_0xb8b2('0x42')][_0xb8b2('0x45')])){_0xa11e1[_0xb8b2('0x3e')]=_0xb8b2('0x43');throw _0xa11e1['name']+_0xb8b2('0x44');}if(!isNotNull(_[_0xb8b2('0x46')](_0xa11e1['Interval'][_0xb8b2('0x45')]))){_0xa11e1[_0xb8b2('0x3e')]=_0xb8b2('0x43');throw _0xa11e1[_0xb8b2('0x40')]+_0xb8b2('0x44');}};}function msgResponse(_0x27180e,_0x298997,_0x337c6e){return{'action':_0x27180e,'response':_0x298997,'message':_0x337c6e,'stack':_0x337c6e};}function myreject(_0x18fa6e){return function(_0x1a4fa0){return _0x18fa6e(msgResponse(_0xb8b2('0x47'),_0xb8b2('0x48'),JSON[_0xb8b2('0x49')](_0x1a4fa0)));};}function getSeconds(_0x43198d,_0x352c5f){var _0x43b71d=moment(_0x43198d)[_0xb8b2('0x4a')](0x0);var _0x9d012d=moment(_0x352c5f)[_0xb8b2('0x4a')](0x0);return _0x43b71d[_0xb8b2('0x4b')](_0x9d012d,_0xb8b2('0x4c'));}function emit(_0x433fe6,_0x22649a,_0x84bef9){io['to'](_0x433fe6)[_0xb8b2('0x4d')](_0x22649a,_0x84bef9);}function emitVoiceQueueSummary(_0x3de2e0){if(_0x3de2e0[_0xb8b2('0x4e')]==='outbound'){var _0x482d64={'id':_0x3de2e0['id'],'name':_0x3de2e0[_0xb8b2('0x40')],'strategy':_0x3de2e0['strategy'],'answered':_0x3de2e0[_0xb8b2('0x4f')],'available':_0x3de2e0[_0xb8b2('0x50')],'loggedIn':_0x3de2e0[_0xb8b2('0x51')],'pTalking':_0x3de2e0[_0xb8b2('0x52')],'sumBillable':_0x3de2e0['sumBillable'],'sumDuration':_0x3de2e0['sumDuration'],'sumHoldTime':_0x3de2e0[_0xb8b2('0x53')]||0x0,'talking':_0x3de2e0[_0xb8b2('0x54')],'total':_0x3de2e0[_0xb8b2('0x55')],'type':_0x3de2e0[_0xb8b2('0x4e')],'unmanaged':_0x3de2e0[_0xb8b2('0x56')],'abandoned':_0x3de2e0['abandoned'],'waiting':_0x3de2e0[_0xb8b2('0x57')],'loggedInDb':_0x3de2e0[_0xb8b2('0x58')],'dialActive':_0x3de2e0[_0xb8b2('0x59')],'dialMethod':_0x3de2e0[_0xb8b2('0x5a')],'dialOriginateCallerIdName':_0x3de2e0[_0xb8b2('0x5b')],'dialOriginateCallerIdNumber':_0x3de2e0['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3de2e0[_0xb8b2('0x5c')],'dialPrefix':_0x3de2e0[_0xb8b2('0x5d')],'outboundAnswerAgiCallsDay':_0x3de2e0[_0xb8b2('0x5e')],'outboundAnswerCallsDay':_0x3de2e0[_0xb8b2('0x5f')],'outboundBlacklistCallsDay':_0x3de2e0[_0xb8b2('0x60')],'outboundBusyCallsDay':_0x3de2e0[_0xb8b2('0x61')],'outboundCongestionCallsDay':_0x3de2e0[_0xb8b2('0x62')],'outboundDropCallsDayACS':_0x3de2e0[_0xb8b2('0x63')],'outboundDropCallsDayCallersExit':_0x3de2e0[_0xb8b2('0x64')],'outboundDropCallsDayTimeout':_0x3de2e0[_0xb8b2('0x65')],'outboundNoAnswerCallsDay':_0x3de2e0['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3de2e0['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x3de2e0[_0xb8b2('0x66')],'outboundReCallsDay':_0x3de2e0['outboundReCallsDay'],'outboundRejectCallsDay':_0x3de2e0[_0xb8b2('0x67')],'outboundUnknownCallsDay':_0x3de2e0[_0xb8b2('0x68')],'predictiveIntervalAnsweredCalls':_0x3de2e0[_0xb8b2('0x69')],'predictiveIntervalAvgHoldtime':_0x3de2e0[_0xb8b2('0x6a')],'predictiveIntervalAvgTalktime':_0x3de2e0[_0xb8b2('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x3de2e0['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3de2e0[_0xb8b2('0x6c')],'predictiveIntervalErlangCalls':_0x3de2e0[_0xb8b2('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x3de2e0[_0xb8b2('0x6e')],'predictiveIntervalHitRate':_0x3de2e0[_0xb8b2('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x3de2e0[_0xb8b2('0x70')],'predictiveIntervalPauses':_0x3de2e0[_0xb8b2('0x71')],'predictiveIntervalAvailable':_0x3de2e0[_0xb8b2('0x72')],'predictiveIntervalTotalCalls':_0x3de2e0[_0xb8b2('0x73')],'message':_0x3de2e0[_0xb8b2('0x3e')],'originated':_0x3de2e0[_0xb8b2('0x74')],'erlangCalls':_0x3de2e0[_0xb8b2('0x75')],'erlangCallToSecond':_0x3de2e0['erlangCallToSecond'],'erlangAbandonmentRate':_0x3de2e0[_0xb8b2('0x76')],'erlangBusyFactor':_0x3de2e0[_0xb8b2('0x77')],'startPredictive':_0x3de2e0[_0xb8b2('0x78')],'startProgressive':_0x3de2e0[_0xb8b2('0x28')]};if(_0x3de2e0[_0xb8b2('0x79')]){_0x482d64[_0xb8b2('0x79')]={'id':_0x3de2e0[_0xb8b2('0x79')]['id'],'name':_0x3de2e0[_0xb8b2('0x79')][_0xb8b2('0x40')],'active':_0x3de2e0[_0xb8b2('0x79')][_0xb8b2('0x7a')],'callerid':_0x3de2e0[_0xb8b2('0x79')][_0xb8b2('0x7b')]};}if(_0x3de2e0['Interval']){_0x482d64[_0xb8b2('0x42')]={'id':_0x3de2e0[_0xb8b2('0x42')]['id'],'name':_0x3de2e0['Interval'][_0xb8b2('0x40')]};}var _0x2b9c9a=md5(JSON[_0xb8b2('0x49')](_0x482d64));if(_0x3de2e0['md5']!==_0x2b9c9a){_0x3de2e0[_0xb8b2('0x4')]=_0x2b9c9a;emit(util[_0xb8b2('0x7c')](_0xb8b2('0x7d'),_0x482d64[_0xb8b2('0x40')]),_0xb8b2('0x7e'),_0x482d64);}}}function emitCampaignSummary(_0x174a3d){if(_0x174a3d[_0xb8b2('0x4e')]===_0xb8b2('0x7f')){emit(util[_0xb8b2('0x7c')](_0xb8b2('0x80'),_0x174a3d[_0xb8b2('0x40')]),_0xb8b2('0x81'),_0x174a3d);}}function checkGetDataPredictive(_0xc28eb9){if(isNotNull(_0xc28eb9)&&!_[_0xb8b2('0x46')](_0xc28eb9)){loggerPredictive[_0xb8b2('0x82')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0xb8b2('0x83'),_0xc28eb9[_0xb8b2('0x73')]);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x84'),_0xc28eb9[_0xb8b2('0x69')]);loggerPredictive[_0xb8b2('0x82')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xc28eb9[_0xb8b2('0x6c')]);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x85'),_0xc28eb9[_0xb8b2('0x86')]);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x87'),_0xc28eb9[_0xb8b2('0x6a')]);loggerPredictive[_0xb8b2('0x82')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xc28eb9[_0xb8b2('0x6b')]);loggerPredictive['info'](_0xb8b2('0x88'));if(_0xc28eb9[_0xb8b2('0x73')]>0x0){if(!_[_0xb8b2('0x89')](_0xc28eb9[_0xb8b2('0x6b')])&&_0xc28eb9[_0xb8b2('0x6b')]>0x0){return!![];}loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x8a'));if(!_['isUndefined'](_0xc28eb9[_0xb8b2('0x6a')])&&_0xc28eb9[_0xb8b2('0x6a')]>0x0){return!![];}loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x8b'));}else{loggerPredictive[_0xb8b2('0x82')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xb8b2('0x82')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x52598e){return function(_0x26fd29){loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x8c'));loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x8d'),_0x26fd29[_0xb8b2('0x75')]);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x8e'),_0x26fd29[_0xb8b2('0x8f')]);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x90'),_0x26fd29[_0xb8b2('0x76')]);loggerPredictive['info'](_0xb8b2('0x91'),_0x26fd29[_0xb8b2('0x77')]);loggerPredictive['info'](_0xb8b2('0x90'),_0x26fd29[_0xb8b2('0x76')]);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x88'));_[_0xb8b2('0x92')](_0x52598e,_0x26fd29);};}function getDiff(_0x5361f8){var _0x356e20=moment()['milliseconds'](0x0);var _0x28c92d=moment(_0x5361f8)[_0xb8b2('0x4a')](0x0);return _0x356e20[_0xb8b2('0x4b')](_0x28c92d,'seconds');}function ifInterval(_0x34c3c9,_0x21c7ec){if(_[_0xb8b2('0x89')](_0x21c7ec)){return![];}return getDiff(_0x21c7ec)<_0x34c3c9*0x3c;}function freeVariablesPredictive(_0x41d670){if(isNotNull(_0x41d670)){if(!_[_0xb8b2('0x89')](_0x41d670['startProgressive'])){_0x41d670['startProgressive']=undefined;loggerPredictive[_0xb8b2('0x82')](_0x41d670[_0xb8b2('0x40')],_0xb8b2('0x93'));}if(!_[_0xb8b2('0x89')](_0x41d670[_0xb8b2('0x78')])){_0x41d670[_0xb8b2('0x78')]=undefined;loggerPredictive[_0xb8b2('0x82')](_0x41d670[_0xb8b2('0x40')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xb8b2('0x89')](_0x41d670['handlePredictive'])){clearInterval(_0x41d670['handlePredictive']);_0x41d670[_0xb8b2('0x94')]=undefined;loggerPredictive[_0xb8b2('0x82')](_0x41d670[_0xb8b2('0x40')],_0xb8b2('0x95'));}}}function erlangb(_0x419710,_0x8ac34e){if(_0x8ac34e===0x0){return 0x0;}var _0x1ffea7=0x1;for(var _0xa6ffa1=0x1;_0xa6ffa1<=_0x8ac34e;_0xa6ffa1+=0x1){_0x1ffea7=0x1+_0x1ffea7*_0xa6ffa1/_0x419710;}return 0x1/_0x1ffea7;}function isVoiceQueueOutbound(_0x552719){return _0x552719===_0xb8b2('0x96');}function isNotPreview(_0x714005){return _0x714005!=='preview';}function isCampaignIvr(_0xe2c61b){return _0xe2c61b==='ivr';}function getCallerId(_0x2132b4,_0x213fe9,_0x150d69){if(!_[_0xb8b2('0x89')](_0x150d69)&&typeof _0x150d69===_0xb8b2('0x97')&&!_['isEmpty'](_0x150d69)){if(!_['isUndefined'](_0x213fe9)&&typeof _0x213fe9===_0xb8b2('0x97')&&!_[_0xb8b2('0x46')](_0x213fe9)){return util['format'](_0xb8b2('0x98'),_0x213fe9,_0x150d69);}return util[_0xb8b2('0x7c')](_0xb8b2('0x98'),_0x150d69,_0x150d69);}if(!_['isUndefined'](_0x2132b4)&&typeof _0x2132b4===_0xb8b2('0x97')&&!_[_0xb8b2('0x46')](_0x2132b4)){return _0x2132b4;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x417d6f,_0xcf1f6e){return function(_0x5b0055){freeVariablesPredictive(_0xcf1f6e);emitVoiceQueueSummary(_0xcf1f6e);emitCampaignSummary(_0xcf1f6e);loggerSyncQueueSummary['error'](_0x417d6f,util[_0xb8b2('0x99')](_0x5b0055,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1b5402,_0x2a7709){return function(_0x5f206d){loggerPredictive['error'](_0x2a7709['name'],_0x1b5402);loggerPredictive[_0xb8b2('0x9a')](_0x5f206d['stack']);freeVariablesPredictive(_0x2a7709);};}function loggerCatch(_0x411176){return function(_0x188ca6){logger[_0xb8b2('0x9a')](_0x411176,util[_0xb8b2('0x99')](_0x188ca6,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2f8ae6){return _0x2f8ae6&&!_[_0xb8b2('0x89')](_0x2f8ae6)&&_0x2f8ae6['length']>0x0;}function decremetOriginate(_0x4ddae3){if(!_[_0xb8b2('0x89')](_0x4ddae3)&&_0x4ddae3!==null){if(typeof _0x4ddae3[_0xb8b2('0x74')]!=='undefined'){if(_0x4ddae3[_0xb8b2('0x74')]>0x0){_0x4ddae3[_0xb8b2('0x74')]-=0x1;}else{logger[_0xb8b2('0x9a')](_0xb8b2('0x9b'));}}}else{logger[_0xb8b2('0x9a')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2231cc,_0x396d75,_0x472dda){if(_0x396d75>_0x472dda){for(var _0x5c03a3=0x0;_0x5c03a3<_0x396d75-_0x472dda;_0x5c03a3+=0x1){decremetOriginate(_0x2231cc);}}}function loggerGetContactDialer(_0xbdc200,_0x2de419,_0x4fd3ce){return function(_0x287001){checkContactLowerLimitOriginate(_0x2de419,_0x4fd3ce,0x0);logger[_0xb8b2('0x9a')](_0xbdc200,util[_0xb8b2('0x99')](_0x287001,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x199d6e){return function(_0x5b7a0e){if(isNotNull(_0x5b7a0e)&&isNotNull(_0x5b7a0e[0x0])){if(_0x5b7a0e[0x0][_0xb8b2('0x9c')]>0x0){_0x199d6e[_0xb8b2('0x3e')]='RESCHEDULED_CONTACTS';logger[_0xb8b2('0x82')]('[getContactDialer2][ReScheduled]'+_0x199d6e[_0xb8b2('0x40')],_0x5b7a0e[0x0][_0xb8b2('0x9c')],'contacts');}else{_0x199d6e['message']='AVAILABLE_CONTACTS_FINISHED';logger['info']('[getContactDialer2][Empty]'+_0x199d6e['name']);}}};}function notSendMessagesQueue(_0x1878ee){if(_0x1878ee[_0xb8b2('0x9d')]){freeVariablesPredictive(_0x1878ee);if(_0x1878ee[_0xb8b2('0x74')]===0x0&&_0x1878ee[_0xb8b2('0x54')]===0x0&&_0x1878ee[_0xb8b2('0x57')]===0x0&&(_0x1878ee[_0xb8b2('0x52')]||0x0)===0x0){_0x1878ee[_0xb8b2('0x9d')]=![];_0x1878ee[_0xb8b2('0x50')]=0x0;_0x1878ee[_0xb8b2('0x3e')]=_0xb8b2('0x41');loggerSyncQueueSummary[_0xb8b2('0x9a')](_0xb8b2('0x9e'),_0x1878ee['name'],'is\x20not\x20active');}else{_0x1878ee[_0xb8b2('0x3e')]=_0xb8b2('0x9f');loggerSyncQueueSummary[_0xb8b2('0x9a')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1878ee['name'],_0xb8b2('0xa0'));}emitVoiceQueueSummary(_0x1878ee);}}function notSendMessagesCampaign(_0x50f942){if(_0x50f942[_0xb8b2('0x9d')]){if(_0x50f942[_0xb8b2('0x74')]===0x0){_0x50f942[_0xb8b2('0x9d')]=![];_0x50f942[_0xb8b2('0x3e')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xb8b2('0x9a')](_0xb8b2('0xa1'),_0x50f942[_0xb8b2('0x40')],_0xb8b2('0xa2'));}else{_0x50f942[_0xb8b2('0x3e')]=_0xb8b2('0x9f');loggerSyncQueueSummary['error'](_0xb8b2('0xa1'),_0x50f942[_0xb8b2('0x40')],'is\x20disactive');}emitCampaignSummary(_0x50f942);}}function createObjHistory(_0xeedb47,_0x422293,_0x3fd1be,_0x503c71,_0x4838a4){_0xeedb47[_0xb8b2('0x3e')]=_0x3fd1be;var _0x5130a2=new Action(_0xeedb47,_0x422293);var _0x4c3c3b=new History(_0x5130a2);_0x4c3c3b[_0xb8b2('0xa3')]=_0x503c71;_0x4c3c3b['statedesc']=_0x4838a4;_0x4c3c3b[_0xb8b2('0xa4')]=_0x5130a2[_0xb8b2('0xa5')];return _0x4c3c3b;}Dialer['prototype'][_0xb8b2('0x3d')]=function(){var _0x3fa3fe=this;setInterval(function(){_0x3fa3fe[_0xb8b2('0xa6')](_0x3fa3fe['uniqueId'],_0xb8b2('0xa7'));_0x3fa3fe['clearZombieChannels'](_0x3fa3fe[_0xb8b2('0x24')],_0xb8b2('0xa8'));},0x32c8);};Dialer[_0xb8b2('0x19')][_0xb8b2('0xa6')]=function(_0x7d00d1,_0x21a9e0){var _0xe2655d=this;for(var _0x613aef in _0x7d00d1){if(typeof _0x7d00d1[_0x613aef]!==_0xb8b2('0xa9')){this['sequence'][_0xb8b2('0x1a')](function(){if(!_['isNil'](_0x7d00d1[_0x613aef])){return ami[_0xb8b2('0xaa')]({'action':_0xb8b2('0xab'),'channel':_0x7d00d1[_0x613aef][_0xb8b2('0xac')]})[_0xb8b2('0xad')](function(_0x32c03e){if(_0x32c03e['message']===_0xb8b2('0xae')){setTimeout(function(){if(_0x7d00d1[_0x613aef]&&_0x7d00d1[_0x613aef][_0xb8b2('0x4e')]!==_0xb8b2('0x7f')){_0xe2655d[_0xb8b2('0xaf')](_0xe2655d[_0xb8b2('0x1e')][_0x7d00d1[_0x613aef][_0xb8b2('0xb0')]]);logger[_0xb8b2('0x9a')]('[Dialer][checkChannel]',_0x21a9e0,_0x613aef,_0x7d00d1[_0x613aef][_0xb8b2('0xb0')]);delete _0x7d00d1[_0x613aef];}if(_0x7d00d1[_0x613aef]&&_0x7d00d1[_0x613aef]['type']==='ivr'){_0xe2655d[_0xb8b2('0xaf')](_0xe2655d['campaigns'][_0x7d00d1[_0x613aef][_0xb8b2('0xb0')]]);logger['error'](_0xb8b2('0xb1'),_0x21a9e0,_0x613aef,_0x7d00d1[_0x613aef][_0xb8b2('0xb0')]);delete _0x7d00d1[_0x613aef];}},0x2328);}});}});}}};Dialer[_0xb8b2('0x19')][_0xb8b2('0xb2')]=function(_0x4481df){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopper[_0xb8b2('0xb2')](_0x4481df))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xb5')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xb6')]=function(_0x2c6529){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopperBlack[_0xb8b2('0xb6')](_0x2c6529))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xb7')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xb8')]=function(_0x1400ee){return BPromise['resolve']()[_0xb8b2('0xb4')](cmHopperBlack[_0xb8b2('0xb8')](_0x1400ee))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xb9')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xba')]=function(_0x49449a){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopperHistory[_0xb8b2('0xbb')](_0x49449a))['catch'](loggerCatch(_0xb8b2('0xbc')));};Dialer[_0xb8b2('0x19')]['rescheduleContact']=function(_0x431a18){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopper['rescheduleContact'](_0x431a18))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xbd')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xbe')]=function(_0x160547,_0x4c2955,_0x29c842){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopper[_0xb8b2('0xbe')](_0x160547,_0x4c2955,_0x29c842))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xbf')));};Dialer['prototype'][_0xb8b2('0xc0')]=function(_0x8b15c1,_0x4844c9,_0x12e497,_0x1fd6df,_0x29e894){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopper[_0xb8b2('0xc0')](_0x8b15c1,_0x4844c9,_0x12e497,_0x1fd6df))[_0xb8b2('0xad')](function(_0x3f5b25){_0x29e894[_0xb8b2('0xc1')]-=_0x12e497;_0x29e894[_0xb8b2('0xc1')]=_0x29e894[_0xb8b2('0xc1')]>0x0?_0x29e894[_0xb8b2('0xc1')]:0x0;loggerCatch(_0xb8b2('0xc2'))(_0x3f5b25);});};Dialer['prototype'][_0xb8b2('0xc3')]=function(_0x58b66a,_0x904e81,_0x3989ee,_0x1261b2){return BPromise['resolve']()['then'](cmHopper['getContactDialerIvr'](_0x58b66a,_0x904e81,_0x3989ee))[_0xb8b2('0xad')](function(_0x55da0e){_0x1261b2[_0xb8b2('0xc1')]-=_0x904e81;_0x1261b2[_0xb8b2('0xc1')]=_0x1261b2[_0xb8b2('0xc1')]>0x0?_0x1261b2[_0xb8b2('0xc1')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x55da0e);});};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x3e955e){return BPromise[_0xb8b2('0xb3')]()['then'](voiceQueueRt[_0xb8b2('0xc4')](_0x3e955e))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xc5')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xc6')]=function(_0x10849d){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopper['moveContactManagedDialer'](_0x10849d))['catch'](loggerCatch(_0xb8b2('0xc7')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xc8')]=function(_0x1e38fa){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopperHistory[_0xb8b2('0xc8')](_0x1e38fa))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xc9')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xaf')]=function(_0x381577){if(!_['isUndefined'](_0x381577)&&_0x381577!==null){if(typeof _0x381577[_0xb8b2('0x74')]!==_0xb8b2('0xa9')){if(_0x381577[_0xb8b2('0x74')]>0x0){_0x381577['originated']-=0x1;}else{logger['error'](_0xb8b2('0xca'));}}}else{logger[_0xb8b2('0x9a')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xb8b2('0x19')][_0xb8b2('0xcb')]=function(_0x435b68,_0x172a03){var _0x4341ae=this;return function(_0x5463b0){_0x4341ae[_0xb8b2('0xaf')](_0x172a03);logger['error'](_0x435b68,util[_0xb8b2('0x99')](_0x5463b0,{'showHidden':![],'depth':null}));};};Dialer[_0xb8b2('0x19')][_0xb8b2('0xcc')]=function(_0x50a048,_0x51ac7d,_0x8cbd39){var _0x206662={'state':0x19,'statedesc':_0xb8b2('0xcd')};this[_0xb8b2('0xaf')](_0x51ac7d);this[_0xb8b2('0xce')](_[_0xb8b2('0x92')](_0x206662,_[_0xb8b2('0xcf')](_0x8cbd39,[_0xb8b2('0xd0'),_0xb8b2('0xd1'),_0xb8b2('0xd2'),_0xb8b2('0xd3'),_0xb8b2('0xd4')])),_0xb8b2('0xd5'),_0xb8b2('0xd6'));logger[_0xb8b2('0x9a')](_0x50a048);};Dialer[_0xb8b2('0x19')]['isSuccess']=function(_0x350057){return _0x350057===_0xb8b2('0xd7');};Dialer[_0xb8b2('0x19')][_0xb8b2('0xd8')]=function(_0x55c2e5){return!_[_0xb8b2('0x89')](_0x55c2e5)&&_0x55c2e5&&!_[_0xb8b2('0x89')](_0x55c2e5[_0xb8b2('0x40')])&&!_[_0xb8b2('0x89')](_0x55c2e5[_0xb8b2('0x7a')])&&_0x55c2e5['active']&&(this[_0xb8b2('0x21')][util[_0xb8b2('0x7c')]('SIP/%s',_0x55c2e5[_0xb8b2('0x40')])]['status']==='reachable'||this[_0xb8b2('0x21')][util[_0xb8b2('0x7c')](_0xb8b2('0xd9'),_0x55c2e5['name'])][_0xb8b2('0xab')]===_0xb8b2('0xda'));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xce')]=function(_0x22a803,_0x53f7d1,_0x4c77dd){this[_0xb8b2('0xc8')](_0x22a803)[_0xb8b2('0xad')](loggerCatch(_0x53f7d1));this['moveContactManagedDialer'](_0x22a803)[_0xb8b2('0xad')](loggerCatch(_0x4c77dd));};Dialer[_0xb8b2('0x19')][_0xb8b2('0x37')]=function(_0x34e4f7){var _0x1025ef=this['uniqueId'][_0x34e4f7[_0xb8b2('0xdb')]];var _0x531232;if(!_[_0xb8b2('0xdc')](_0x34e4f7)&&!_['isNil'](_0x34e4f7[_0xb8b2('0xdd')])&&!_[_0xb8b2('0xdc')](_0x34e4f7[_0xb8b2('0xdd')]['amdstatus'])&&_0x34e4f7[_0xb8b2('0xde')]===_0xb8b2('0xdf')&&_0x1025ef){if(_0x1025ef[_0xb8b2('0x4e')]!=='ivr'&&this['voiceQueues'][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0xe0')]&&_0x34e4f7[_0xb8b2('0xe1')]===_0xb8b2('0xe2')){delete this[_0xb8b2('0x26')][_0x34e4f7['uniqueid']];this[_0xb8b2('0xaf')](this['voiceQueues'][_0x1025ef[_0xb8b2('0xb0')]]);this[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0x5f')]+=0x1;this[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0x5e')]+=0x1;_0x531232=new Hangup(_0x1025ef,_0x34e4f7);_0x531232[_0xb8b2('0xa3')]=0x12;_0x531232[_0xb8b2('0xe3')]=_0xb8b2('0xe4');_0x531232['membername']='AMD';ami['emit']('custom:amd',ut[_0xb8b2('0xe5')](_0x531232,'amd'));this[_0xb8b2('0xce')](_0x531232,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x1025ef[_0xb8b2('0x4e')]!==_0xb8b2('0x7f')&&this[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0xe0')]&&_0x34e4f7[_0xb8b2('0xe1')]===_0xb8b2('0xe6')){var _0x29db0e=this;return new BPromise(function(_0x35471c,_0x28a288){delete _0x29db0e['uniqueId'][_0x34e4f7['uniqueid']];_0x29db0e[_0xb8b2('0xaf')](_0x29db0e[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]]);_0x29db0e[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0x5f')]+=0x1;_0x29db0e[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0x5e')]+=0x1;var _0x4e1327=_0x29db0e[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]];var _0x569f5a=new Hangup(_0x1025ef,_0x34e4f7);_0x569f5a[_0xb8b2('0xa3')]=0x13;_0x569f5a[_0xb8b2('0xe3')]=_0xb8b2('0xe7');_0x569f5a[_0xb8b2('0xe8')]=_0xb8b2('0xe9');_0x569f5a[_0xb8b2('0xea')]+=0x1;_0x569f5a[_0xb8b2('0xeb')]+=0x1;_0x569f5a[_0xb8b2('0xec')]=!![];ami['emit']('custom:amd',ut[_0xb8b2('0xe5')](_0x569f5a,'amd'));_0x29db0e[_0xb8b2('0xc8')](_0x569f5a)[_0xb8b2('0xad')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x569f5a[_0xb8b2('0xed')]+_0x569f5a[_0xb8b2('0xee')]+_0x569f5a[_0xb8b2('0xef')]+_0x569f5a[_0xb8b2('0xf0')]+_0x569f5a[_0xb8b2('0xf1')]+_0x569f5a[_0xb8b2('0xf2')]+_0x569f5a[_0xb8b2('0xea')]+_0x569f5a['countagentrejectretry']>=_0x4e1327[_0xb8b2('0xf3')]){_0x29db0e['stateGlobal'](_0x569f5a,_0x35471c,_0x28a288,_0xb8b2('0xf4'));}else{if(_0x569f5a[_0xb8b2('0xea')]>=_0x4e1327[_0xb8b2('0xf5')]){_0x29db0e[_0xb8b2('0xf6')](_0x569f5a,_0x35471c,_0x28a288,'reason\x2019\x20machine....');}else{_0x29db0e[_0xb8b2('0xf7')]({'active':![],'countmachineretry':_0x569f5a[_0xb8b2('0xea')],'scheduledat':moment()[_0xb8b2('0xf8')](_0x4e1327[_0xb8b2('0xf9')],'minutes')[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x569f5a[_0xb8b2('0xd0')],'ListId':_0x569f5a[_0xb8b2('0xd1')],'VoiceQueueId':_0x569f5a['VoiceQueueId']||undefined,'CampaignId':_0x569f5a[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xfb')));_0x35471c({'reschedule':0x1});}}});}if(_0x1025ef[_0xb8b2('0x4e')]===_0xb8b2('0x7f')&&this[_0xb8b2('0x1f')][_0x1025ef['queue']][_0xb8b2('0xe0')]&&_0x34e4f7[_0xb8b2('0xe1')]==='HANGUP'){delete this[_0xb8b2('0x26')][_0x34e4f7[_0xb8b2('0xdb')]];this['updateOriginated'](this['campaigns'][_0x1025ef['queue']]);_0x531232=new Hangup(_0x1025ef,_0x34e4f7);_0x531232[_0xb8b2('0xa3')]=0x12;_0x531232[_0xb8b2('0xe3')]=_0xb8b2('0xe4');_0x531232['membername']='AMD';ami[_0xb8b2('0x4d')](_0xb8b2('0xfc'),ut[_0xb8b2('0xe5')](_0x531232,_0xb8b2('0xec')));this['saveInDb'](_0x531232,_0xb8b2('0xfd'),_0xb8b2('0xfe'));}if(_0x1025ef['type']===_0xb8b2('0x7f')&&this[_0xb8b2('0x1f')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0xe0')]&&_0x34e4f7[_0xb8b2('0xe1')]==='MACHINE'){var _0x29db0e=this;return new BPromise(function(_0x2e11e1,_0x242ef8){delete _0x29db0e['uniqueId'][_0x34e4f7[_0xb8b2('0xdb')]];_0x29db0e[_0xb8b2('0xaf')](_0x29db0e[_0xb8b2('0x1f')][_0x1025ef['queue']]);_0x29db0e['campaigns'][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0x5f')]+=0x1;_0x29db0e[_0xb8b2('0x1f')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0x5e')]+=0x1;var _0x2defea=_0x29db0e['campaigns'][_0x1025ef[_0xb8b2('0xb0')]];var _0x138c00=new Hangup(_0x1025ef,_0x34e4f7);_0x138c00[_0xb8b2('0xa3')]=0x13;_0x138c00[_0xb8b2('0xe3')]=_0xb8b2('0xe7');_0x138c00[_0xb8b2('0xe8')]=_0xb8b2('0xe9');_0x138c00[_0xb8b2('0xea')]+=0x1;_0x138c00[_0xb8b2('0xeb')]+=0x1;_0x138c00[_0xb8b2('0xec')]=!![];ami[_0xb8b2('0x4d')](_0xb8b2('0xfc'),ut['buildObj'](_0x138c00,_0xb8b2('0xec')));_0x29db0e['createHistory'](_0x138c00)['catch'](loggerCatch(_0xb8b2('0xff')));if(_0x138c00[_0xb8b2('0xed')]+_0x138c00[_0xb8b2('0xee')]+_0x138c00[_0xb8b2('0xef')]+_0x138c00[_0xb8b2('0xf0')]+_0x138c00['countdropretry']+_0x138c00[_0xb8b2('0xf2')]+_0x138c00[_0xb8b2('0xea')]+_0x138c00['countagentrejectretry']>=_0x2defea[_0xb8b2('0xf3')]){_0x29db0e[_0xb8b2('0x100')](_0x138c00,_0x2e11e1,_0x242ef8,'reason19\x20machine....');}else{if(_0x138c00['countmachineretry']>=_0x2defea[_0xb8b2('0xf5')]){_0x29db0e['createStateFinal'](_0x138c00,_0x2e11e1,_0x242ef8,_0xb8b2('0x101'));}else{_0x29db0e['rescheduleContact']({'active':![],'countmachineretry':_0x138c00[_0xb8b2('0xea')],'scheduledat':moment()['add'](_0x2defea[_0xb8b2('0xf9')],_0xb8b2('0x102'))[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x138c00[_0xb8b2('0xd0')],'ListId':_0x138c00[_0xb8b2('0xd1')],'VoiceQueueId':_0x138c00['VoiceQueueId']||undefined,'CampaignId':_0x138c00[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xfb')));_0x2e11e1({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xb8b2('0x33')]=function(_0x650fe){var _0xb49f9c=this[_0xb8b2('0x26')][_0x650fe['uniqueid']];var _0x1ba7a0=this;var _0x19b6fe;if(_0xb49f9c&&_0xb49f9c['type']===_0xb8b2('0x7f')){delete this[_0xb8b2('0x26')][_0x650fe[_0xb8b2('0xdb')]];this[_0xb8b2('0xaf')](this[_0xb8b2('0x1f')][_0xb49f9c[_0xb8b2('0xb0')]]);this[_0xb8b2('0x1f')][_0xb49f9c[_0xb8b2('0xb0')]][_0xb8b2('0x103')]+=0x1;_0x19b6fe=new Hangup(_0xb49f9c,_0x650fe);this['createHistory'](_0x19b6fe)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x104')));this[_0xb8b2('0xc6')](_0x19b6fe)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x105')));}if(_0xb49f9c&&_0xb49f9c['type']!==_0xb8b2('0x7f')&&isNotNull(this['voiceQueues'][_0xb49f9c['queue']][_0xb8b2('0x106')])){delete this[_0xb8b2('0x26')][_0x650fe['uniqueid']];this[_0xb8b2('0xaf')](this['voiceQueues'][_0xb49f9c[_0xb8b2('0xb0')]]);this[_0xb8b2('0x1e')][_0xb49f9c[_0xb8b2('0xb0')]][_0xb8b2('0x5f')]+=0x1;this[_0xb8b2('0x1e')][_0xb49f9c[_0xb8b2('0xb0')]][_0xb8b2('0x5e')]+=0x1;_0x19b6fe=new Hangup(_0xb49f9c,_0x650fe);_0x19b6fe['state']=0x10;_0x19b6fe[_0xb8b2('0xe3')]='AnswerAGI';_0x19b6fe[_0xb8b2('0xe8')]=_0xb8b2('0x107');this['createHistory'](_0x19b6fe)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x104')));this[_0xb8b2('0xc6')](_0x19b6fe)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x105')));}if(_0xb49f9c&&_0xb49f9c[_0xb8b2('0x4e')]!==_0xb8b2('0x7f')&&!isNotNull(this[_0xb8b2('0x1e')][_0xb49f9c[_0xb8b2('0xb0')]][_0xb8b2('0x106')])){delete this[_0xb8b2('0x26')][_0x650fe[_0xb8b2('0xdb')]];this[_0xb8b2('0xaf')](this[_0xb8b2('0x1e')][_0xb49f9c[_0xb8b2('0xb0')]]);this['voiceQueues'][_0xb49f9c[_0xb8b2('0xb0')]][_0xb8b2('0x68')]+=0x1;_0x19b6fe=new Hangup(_0xb49f9c,_0x650fe);_0x19b6fe[_0xb8b2('0xa3')]=0xc;_0x19b6fe[_0xb8b2('0xe3')]=_0x650fe[_0xb8b2('0x108')];_0x19b6fe['membername']=_0xb8b2('0x109');this[_0xb8b2('0xc8')](_0x19b6fe)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x104')));this[_0xb8b2('0xc6')](_0x19b6fe)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x105')));}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x32')]=function(_0x2f5adb){var _0x27aadd=this[_0xb8b2('0x26')][_0x2f5adb[_0xb8b2('0xdb')]];var _0x1ee47a=this;if(this[_0xb8b2('0x1e')][_0x2f5adb['queue']]){if(_0x27aadd&&_0x27aadd[_0xb8b2('0x4e')]!==_0xb8b2('0x7f')){delete this[_0xb8b2('0x26')][_0x2f5adb['uniqueid']];this['voiceQueues'][_0x2f5adb['queue']][_0xb8b2('0x5f')]+=0x1;var _0xc111b5=new AgentComplete(_0x27aadd,_0x2f5adb);if(_0x2f5adb[_0xb8b2('0x10a')]===_0xb8b2('0x10b')){_0xc111b5[_0xb8b2('0x10c')]=this['voiceQueues'][_0x2f5adb[_0xb8b2('0xb0')]]['dialQueueProject2']&&this[_0xb8b2('0x1e')][_0x2f5adb[_0xb8b2('0xb0')]][_0xb8b2('0x10d')]?moment()['format'](_0xb8b2('0xfa')):undefined;}this[_0xb8b2('0xc8')](_0xc111b5)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xb8b2('0xc6')](_0xc111b5)['catch'](loggerCatch(_0xb8b2('0x10e')));}}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x10f')]=function(_0x212833){if(this[_0xb8b2('0x1e')][_0x212833['queue']]){if(this[_0xb8b2('0x26')][_0x212833['uniqueid']]&&this[_0xb8b2('0x26')][_0x212833[_0xb8b2('0xdb')]][_0xb8b2('0x4e')]!==_0xb8b2('0x7f')){this[_0xb8b2('0xaf')](this[_0xb8b2('0x1e')][_0x212833[_0xb8b2('0xb0')]]);this['uniqueId'][_0x212833[_0xb8b2('0xdb')]][_0xb8b2('0x110')]=moment()[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x111')]=function(_0x2113a3){this['createHistory'](_0x2113a3)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x112')));this[_0xb8b2('0xc6')](_0x2113a3)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x113')));};Dialer['prototype'][_0xb8b2('0x2e')]=function(_0x442676){var _0x5678d8=this['uniqueId'][_0x442676[_0xb8b2('0xdb')]];var _0x1ce1a1=this;if(this['voiceQueues'][_0x442676['queue']]){if(_0x5678d8&&_0x5678d8[_0xb8b2('0x4e')]!==_0xb8b2('0x7f')){delete this[_0xb8b2('0x26')][_0x442676[_0xb8b2('0xdb')]];this[_0xb8b2('0xaf')](this[_0xb8b2('0x1e')][_0x442676[_0xb8b2('0xb0')]]);_0x5678d8['droptime']=moment()[_0xb8b2('0x7c')](_0xb8b2('0xfa'));var _0x48dbce=new QueueCallerAbandon(_0x5678d8,_0x442676);if(getSeconds(_0x5678d8[_0xb8b2('0x114')],_0x5678d8['responsetime'])>=_0x5678d8[_0xb8b2('0x115')]){this[_0xb8b2('0x1e')][_0x442676['queue']][_0xb8b2('0x6c')]+=0x1;this['voiceQueues'][_0x442676[_0xb8b2('0xb0')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x442676['queue']][_0xb8b2('0x6e')]+=0x1;_0x48dbce[_0xb8b2('0xa3')]=0xa;_0x48dbce[_0xb8b2('0xe3')]='Drop';_0x48dbce[_0xb8b2('0x116')]=_0xb8b2('0x117');_0x48dbce['agiafterat']=this[_0xb8b2('0x1e')][_0x442676[_0xb8b2('0xb0')]][_0xb8b2('0x118')]?moment()[_0xb8b2('0x7c')](_0xb8b2('0xfa')):undefined;_0x48dbce['countdropretry']+=0x1;_0x48dbce[_0xb8b2('0xeb')]+=0x1;if(_0x48dbce['countdropretry']>=this['voiceQueues'][_0x442676[_0xb8b2('0xb0')]][_0xb8b2('0x119')]){this[_0xb8b2('0x111')](_0x48dbce);}else{this[_0xb8b2('0xf7')]({'active':![],'countdropretry':_0x48dbce[_0xb8b2('0xf1')],'scheduledat':moment()[_0xb8b2('0xf8')](this['voiceQueues'][_0x442676[_0xb8b2('0xb0')]][_0xb8b2('0x11a')],'minutes')['format'](_0xb8b2('0xfa')),'ContactId':_0x5678d8[_0xb8b2('0xd0')],'ListId':_0x5678d8[_0xb8b2('0xd1')],'VoiceQueueId':_0x5678d8[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x5678d8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x11b')));var _0x5e7394=new History(_0x48dbce);_0x5e7394[_0xb8b2('0xa3')]=0xa;_0x5e7394['statedesc']=_0xb8b2('0x11c');_0x5e7394[_0xb8b2('0xa5')]=moment()[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e7394[_0xb8b2('0xa4')]=_0x5e7394[_0xb8b2('0xa5')];_0x5e7394[_0xb8b2('0x11d')]=_0x48dbce['calleridname'];_0x5e7394[_0xb8b2('0x11e')]=_0x48dbce['calleridnum'];this[_0xb8b2('0xc8')](_0x5e7394)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x11f')));}}else{this['voiceQueues'][_0x442676[_0xb8b2('0xb0')]][_0xb8b2('0x86')]+=0x1;this[_0xb8b2('0x1e')][_0x442676['queue']][_0xb8b2('0x64')]+=0x1;_0x48dbce[_0xb8b2('0xa3')]=0xb;_0x48dbce['statedesc']=_0xb8b2('0x120');_0x48dbce[_0xb8b2('0x116')]=_0xb8b2('0x121');_0x48dbce[_0xb8b2('0xf2')]+=0x1;_0x48dbce[_0xb8b2('0xeb')]+=0x1;if(_0x48dbce['countabandonedretry']>=this[_0xb8b2('0x1e')][_0x442676[_0xb8b2('0xb0')]][_0xb8b2('0x122')]){this[_0xb8b2('0x111')](_0x48dbce);}else{this[_0xb8b2('0xf7')]({'active':![],'countabandonedretry':_0x48dbce[_0xb8b2('0xf2')],'scheduledat':moment()['add'](this[_0xb8b2('0x1e')][_0x442676[_0xb8b2('0xb0')]]['dialAbandonedRetryFrequency'],_0xb8b2('0x102'))[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x5678d8[_0xb8b2('0xd0')],'ListId':_0x5678d8[_0xb8b2('0xd1')],'VoiceQueueId':_0x5678d8['VoiceQueueId']||undefined,'CampaignId':_0x5678d8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x5e7394=new History(_0x48dbce);_0x5e7394[_0xb8b2('0xa3')]=0xb;_0x5e7394[_0xb8b2('0xe3')]=_0xb8b2('0x120');_0x5e7394[_0xb8b2('0xa5')]=moment()[_0xb8b2('0x7c')](_0xb8b2('0xfa'));_0x5e7394['endtime']=_0x5e7394['starttime'];_0x5e7394['calleridname']=_0x48dbce[_0xb8b2('0x11d')];_0x5e7394['calleridnum']=_0x48dbce[_0xb8b2('0x11e')];this[_0xb8b2('0xc8')](_0x5e7394)[_0xb8b2('0xad')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer['prototype'][_0xb8b2('0x35')]=function(_0x1cf0b6){if(this[_0xb8b2('0x24')][_0x1cf0b6[_0xb8b2('0xdb')]]){this[_0xb8b2('0x24')][_0x1cf0b6[_0xb8b2('0xdb')]][_0xb8b2('0xac')]=_0x1cf0b6['channel'];}if(this['uniqueId'][_0x1cf0b6[_0xb8b2('0xdb')]]){this['uniqueId'][_0x1cf0b6[_0xb8b2('0xdb')]][_0xb8b2('0xac')]=_0x1cf0b6[_0xb8b2('0xac')];}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x39')]=function(_0x549a7d){if(strategy[this[_0xb8b2('0x1e')][this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]]['queue']][_0xb8b2('0x124')]]===_0xb8b2('0x125')){if(this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]]&&_[_0xb8b2('0xdc')](this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]][_0xb8b2('0x126')])&&_0x549a7d[_0xb8b2('0xab')]==='1'&&_0x549a7d[_0xb8b2('0x127')]==='0'){if(this['agents'][_0x549a7d[_0xb8b2('0x128')]]){if(!this[_0xb8b2('0x20')][_0x549a7d[_0xb8b2('0x128')]][_0xb8b2('0x126')]){this['agents'][_0x549a7d[_0xb8b2('0x128')]]['locked']=!![];this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]]['locked']=!![];this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]][_0xb8b2('0x128')]=_0x549a7d[_0xb8b2('0x128')];}}}}else if((strategy[this[_0xb8b2('0x1e')][this[_0xb8b2('0x24')][_0x549a7d['actionid']]['queue']][_0xb8b2('0x124')]]||_0xb8b2('0x18'))===_0xb8b2('0x18')){if(this[_0xb8b2('0x24')][_0x549a7d['actionid']]){if(this[_0xb8b2('0x20')][_0x549a7d[_0xb8b2('0x128')]]){this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]][_0xb8b2('0x128')]=_0x549a7d['stateinterface'];if(_[_0xb8b2('0xdc')](this[_0xb8b2('0x2a')][this['actions'][_0x549a7d[_0xb8b2('0x123')]][_0xb8b2('0xb0')]])){this['queueBooked'][this[_0xb8b2('0x24')][_0x549a7d['actionid']][_0xb8b2('0xb0')]]=[];}this[_0xb8b2('0x2a')][this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]]['queue']][_0xb8b2('0x129')](_[_0xb8b2('0x92')](_[_0xb8b2('0xcf')](this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]],['idHopper',_0xb8b2('0x128')]),{'status':_0x549a7d['status'],'paused':_0x549a7d['paused']}));}}}};function unlockQueueStatus(_0x7fe563,_0x2d7bb4){setTimeout(function(){if(_['isUndefined'](_0x7fe563[_0xb8b2('0x12a')])){loggerBooked[_0xb8b2('0x9a')](_0xb8b2('0x12b'),_0x2d7bb4);}_0x7fe563[_0xb8b2('0x12a')]=!![];loggerBooked['info'](_0xb8b2('0x12c'),_0x2d7bb4,JSON[_0xb8b2('0x49')](_[_0xb8b2('0xcf')](_0x7fe563,[_0xb8b2('0x40'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype'][_0xb8b2('0x3b')]=function(_0x25c180){var _0xfc10b8=this;var _0x2f6a9c=_0xfc10b8[_0xb8b2('0x1e')][_0xfc10b8[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]['queue']];if(strategy[this[_0xb8b2('0x1e')][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]][_0xb8b2('0x124')]]===_0xb8b2('0x125')){if(this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]&&this[_0xb8b2('0x24')][_0x25c180['actionid']][_0xb8b2('0x128')]){this[_0xb8b2('0x1d')][_0xb8b2('0x12d')](this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0x12e')],this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0x128')])[_0xb8b2('0xad')](function(_0x1bc77c){logger[_0xb8b2('0x9a')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x1bc77c,{'showHidden':![],'depth':null}));})['finally'](function(){_0xfc10b8[_0xb8b2('0xaf')](_0xfc10b8['voiceQueues'][_0xfc10b8[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]['queue']]);_0xfc10b8['agents'][_0xfc10b8[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]['stateinterface']][_0xb8b2('0x126')]=![];delete _0xfc10b8['actions'][_0x25c180[_0xb8b2('0x123')]];unlockQueueStatus(_0x2f6a9c);});}else{this['updateOriginated'](this[_0xb8b2('0x1e')][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x25c180['actionid']][_0xb8b2('0xd0')],'ListId':this['actions'][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xd1')],'VoiceQueueId':this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xd3')]||undefined,'CampaignId':this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x12f')));delete this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]];unlockQueueStatus(_0x2f6a9c);}}else if((strategy[this[_0xb8b2('0x1e')][this['actions'][_0x25c180[_0xb8b2('0x123')]]['queue']][_0xb8b2('0x124')]]||'rrmemory')===_0xb8b2('0x18')){var _0x13b1fd;if(this[_0xb8b2('0x24')][_0x25c180['actionid']]&&!_[_0xb8b2('0x46')](this[_0xb8b2('0x2a')][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]])){if(this['queueBookedRR'][_0xfc10b8[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]]){this[_0xb8b2('0x2b')][_0xfc10b8['actions'][_0x25c180['actionid']][_0xb8b2('0xb0')]]=this['queueBookedRR'][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]]?this['queueBookedRR'][this['actions'][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]]:this[_0xb8b2('0x2a')][this[_0xb8b2('0x24')][_0x25c180['actionid']]['queue']]?this[_0xb8b2('0x2a')][this['actions'][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]][_0xb8b2('0x130')]||0x0:0x0;}this[_0xb8b2('0x2a')][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]]['_rr']=this['queueBookedRR'][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]];for(var _0x1c6ad1=0x0;_0x1c6ad1<this[_0xb8b2('0x2a')][this[_0xb8b2('0x24')][_0x25c180['actionid']][_0xb8b2('0xb0')]]['length'];_0x1c6ad1+=0x1){_0x13b1fd=rr(this['queueBooked'][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]['queue']]);this['queueBookedRR'][_0xfc10b8[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]['queue']]=this[_0xb8b2('0x2a')][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]['queue']][_0xb8b2('0x130')];if(_0x13b1fd['status']==='1'&&_0x13b1fd[_0xb8b2('0x127')]==='0'){break;}}if(!_[_0xb8b2('0xdc')](_0x13b1fd)){this[_0xb8b2('0x20')][_0x13b1fd['stateinterface']]['unlockRR']=_[_0xb8b2('0x89')](this[_0xb8b2('0x20')][_0x13b1fd['stateinterface']][_0xb8b2('0x131')])?!![]:this[_0xb8b2('0x20')][_0x13b1fd['stateinterface']][_0xb8b2('0x131')];}loggerBooked[_0xb8b2('0x82')](_0xb8b2('0x132'),_0x25c180['actionid'],_0xb8b2('0x133'),JSON['stringify'](_[_0xb8b2('0xcf')](this[_0xb8b2('0x20')][_0x13b1fd[_0xb8b2('0x128')]],['name',_0xb8b2('0x131')])),'contactAgent-idHopper:\x20',JSON[_0xb8b2('0x49')](_0x13b1fd[_0xb8b2('0x12e')]));if(!_['isNil'](_0x13b1fd)&&_0x13b1fd[_0xb8b2('0xab')]==='1'&&_0x13b1fd[_0xb8b2('0x127')]==='0'&&this[_0xb8b2('0x20')][_0x13b1fd[_0xb8b2('0x128')]][_0xb8b2('0x131')]){this[_0xb8b2('0x20')][_0x13b1fd[_0xb8b2('0x128')]][_0xb8b2('0x131')]=![];this['queueBooked'][_0xfc10b8[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]['queue']]=[];this[_0xb8b2('0x1d')]['run'](_0x13b1fd['idHopper'],_0x13b1fd[_0xb8b2('0x128')])[_0xb8b2('0xad')](function(_0x3fddd3){logger['error'](_0xb8b2('0x134'),util[_0xb8b2('0x99')](_0x3fddd3,{'showHidden':![],'depth':null}));})[_0xb8b2('0x135')](function(){_0xfc10b8[_0xb8b2('0xaf')](_0xfc10b8[_0xb8b2('0x1e')][_0xfc10b8[_0xb8b2('0x24')][_0x25c180['actionid']][_0xb8b2('0xb0')]]);setTimeout(function(){_0xfc10b8[_0xb8b2('0x20')][_0x13b1fd['stateinterface']][_0xb8b2('0x131')]=!![];loggerBooked['info'](_0xb8b2('0x136'),_0x25c180[_0xb8b2('0x123')],'Agent:\x20',JSON[_0xb8b2('0x49')](_[_0xb8b2('0xcf')](_0xfc10b8[_0xb8b2('0x20')][_0x13b1fd[_0xb8b2('0x128')]],['name',_0xb8b2('0x131')])),_0xb8b2('0x137'),JSON[_0xb8b2('0x49')](_0x13b1fd[_0xb8b2('0x12e')]));},0xc7);delete _0xfc10b8['actions'][_0x25c180[_0xb8b2('0x123')]];unlockQueueStatus(_0x2f6a9c,_0x25c180[_0xb8b2('0x123')]);});}else{loggerBooked[_0xb8b2('0x82')](_0xb8b2('0x138'));this[_0xb8b2('0xaf')](this[_0xb8b2('0x1e')][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]['ContactId'],'ListId':this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xd1')],'VoiceQueueId':this[_0xb8b2('0x24')][_0x25c180['actionid']]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]];unlockQueueStatus(_0x2f6a9c);}}else{loggerBooked['info'](_0xb8b2('0x139'));this[_0xb8b2('0xaf')](this[_0xb8b2('0x1e')][this[_0xb8b2('0x24')][_0x25c180['actionid']]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xd0')],'ListId':this[_0xb8b2('0x24')][_0x25c180['actionid']]['ListId'],'VoiceQueueId':this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xd4')]||undefined})['catch'](loggerCatch(_0xb8b2('0x13a')));delete this['actions'][_0x25c180[_0xb8b2('0x123')]];unlockQueueStatus(_0x2f6a9c);}}else{loggerBooked['info']('[booked][unlock3]');this[_0xb8b2('0xaf')](this['voiceQueues'][this[_0xb8b2('0x24')][_0x25c180['actionid']][_0xb8b2('0xb0')]]);this[_0xb8b2('0xf7')]({'active':![],'ContactId':this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xd0')],'ListId':this[_0xb8b2('0x24')][_0x25c180['actionid']][_0xb8b2('0xd1')],'VoiceQueueId':this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xd3')]||undefined,'CampaignId':this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this['actions'][_0x25c180[_0xb8b2('0x123')]];unlockQueueStatus(_0x2f6a9c);}};Dialer[_0xb8b2('0x19')]['loopCampaigns']=function(){var _0x3b1811=this;setInterval(function(){_0x3b1811[_0xb8b2('0x13b')]();},0x3e8);};Dialer[_0xb8b2('0x19')][_0xb8b2('0x13c')]=function(_0x289157){var _0x4d7bfb=this;return function(){if(!_0x4d7bfb[_0xb8b2('0xd8')](_0x289157[_0xb8b2('0x79')])){if(!_0x4d7bfb[_0xb8b2('0xd8')](_0x289157[_0xb8b2('0x13d')])){_0x289157[_0xb8b2('0x3e')]='TRUNK_IS_NOT_REACHABLE';throw _0x289157['name']+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0xb8b2('0x13e')]=function(_0x4f7540,_0x33cfe6,_0x516fa6,_0x984a9){var _0x4cbb74=this;return function(){var _0x4dd977=!![];return _0x4cbb74[_0xb8b2('0x13f')](_0x4f7540,_0x33cfe6,_0x516fa6,_0x984a9,_0x4dd977);};};Dialer[_0xb8b2('0x19')][_0xb8b2('0x140')]=function(_0x339c3b,_0x5b0a2a,_0x3e68e7,_0x13f9ef){var _0xc5bdad=this;return function(){var _0x6bded2=![];return _0xc5bdad[_0xb8b2('0x13f')](_0x339c3b[_0xb8b2('0x45')],_0x5b0a2a,_0x3e68e7,_0x13f9ef,_0x6bded2);};};Dialer[_0xb8b2('0x19')][_0xb8b2('0x13f')]=function(_0x1e9dce,_0x283739,_0x4ad8c7,_0x38f000,_0x24b2b6){var _0x3e96d4=[];return new BPromise(function(_0x2f8ba3,_0x1abf0d){if(!isNotNull(_0x1e9dce)){_0x38f000[_0xb8b2('0x3e')]='INTERVAL_IS_NULL';return _0x1abf0d(msgResponse('ifTime','Failure',_0x4ad8c7+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xb8b2('0x46')](_0x1e9dce)){_0x38f000[_0xb8b2('0x3e')]=_0xb8b2('0x141');return _0x1abf0d(msgResponse(_0xb8b2('0x13f'),'Failure',_0x4ad8c7+_0xb8b2('0x142')));}if(_0x283739&&_[_0xb8b2('0x89')](config[_0xb8b2('0x143')][_0x283739])){_0x38f000[_0xb8b2('0x3e')]=_0xb8b2('0x144');return _0x1abf0d(msgResponse('ifTime',_0xb8b2('0x145'),_0x4ad8c7+'\x20Timezone\x20unknow\x20'+_0x283739));}if(_[_0xb8b2('0x146')](_0x1e9dce)){for(var _0x346e7c=0x0;_0x346e7c<_0x1e9dce[_0xb8b2('0x147')];_0x346e7c+=0x1){_0x3e96d4[_0xb8b2('0x129')](ami[_0xb8b2('0xaa')]({'action':_0xb8b2('0x148'),'command':util['format']('iftime\x20%s,%s',_0x1e9dce[_0x346e7c][_0xb8b2('0x149')],!_[_0xb8b2('0x89')](config[_0xb8b2('0x143')][_0x283739])?_0x283739:'')})[_0xb8b2('0xb4')](function(_0x33e90b){return _0x33e90b['content']['indexOf'](_0xb8b2('0x14a'))>=0x0;})[_0xb8b2('0xad')](myreject(_0x1abf0d)));}}else{_0x3e96d4[_0xb8b2('0x129')](ami[_0xb8b2('0xaa')]({'action':'command','command':util['format'](_0xb8b2('0x14b'),_0x1e9dce,!_[_0xb8b2('0x89')](config[_0xb8b2('0x143')][_0x283739])?_0x283739:'')})[_0xb8b2('0xb4')](function(_0x25f28f){return _0x25f28f[_0xb8b2('0x14c')]['indexOf'](_0xb8b2('0x14a'))>=0x0;})[_0xb8b2('0xad')](myreject(_0x1abf0d)));}BPromise['all'](_0x3e96d4)[_0xb8b2('0xb4')](function(_0x3d8389){var _0x13b997=_[_0xb8b2('0x14d')](_0x3d8389);if(_0x13b997){return _0x2f8ba3(_0x13b997);}else{_0x38f000[_0xb8b2('0x3e')]=_0x24b2b6?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x1abf0d(msgResponse(_0xb8b2('0x14e'),_0xb8b2('0x145'),_0xb8b2('0x14f')+_0x24b2b6+'\x20'+_0x4ad8c7+_0xb8b2('0x150')+util[_0xb8b2('0x99')](_0x1e9dce,{'showHidden':![],'depth':null})+_0xb8b2('0x151')+_0x283739));}})[_0xb8b2('0xad')](function(_0x16674b){return _0x1abf0d(msgResponse(_0xb8b2('0x13f'),'Failure',JSON[_0xb8b2('0x49')](_0x16674b)));});});};Dialer[_0xb8b2('0x19')][_0xb8b2('0x152')]=function(_0x38e3c9){var _0x2f3122=this;return function(){switch(_0x38e3c9[_0xb8b2('0x5a')]){case _0xb8b2('0x153'):freeVariablesPredictive(_0x38e3c9);_0x2f3122['handlePower'](_0x38e3c9,0x1);break;case _0xb8b2('0x154'):freeVariablesPredictive(_0x38e3c9);_0x2f3122[_0xb8b2('0x155')](_0x38e3c9,_0x38e3c9[_0xb8b2('0x156')]);break;case _0xb8b2('0xa'):_0x2f3122['predictive'](_0x38e3c9);break;case _0xb8b2('0x9'):freeVariablesPredictive(_0x38e3c9);_0x2f3122[_0xb8b2('0x155')](_0x38e3c9,0x1);break;default:freeVariablesPredictive(_0x38e3c9);logger[_0xb8b2('0x9a')]('Queue',_0x38e3c9['name'],_0xb8b2('0x157'));}};};Dialer[_0xb8b2('0x19')][_0xb8b2('0x158')]=function(_0x51611e){var _0x8e62d0=this;return function(){_0x8e62d0[_0xb8b2('0x159')](_0x51611e);};};Dialer[_0xb8b2('0x19')][_0xb8b2('0xb')]=function(_0x187a20){var _0x24a57c=this;if(isNotPreview(_0x187a20[_0xb8b2('0x5a')])){if(isVoiceQueueOutbound(_0x187a20['type'])&&isActive(_0x187a20['dialActive'])){_0x187a20[_0xb8b2('0x9d')]=!![];BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](checkIsLoggedIn(_0x187a20,_0x187a20[_0xb8b2('0x51')]))[_0xb8b2('0xb4')](checkIsActive(_0x187a20,_0x187a20['dialActive']))[_0xb8b2('0xb4')](checkInterval(_0x187a20))[_0xb8b2('0xb4')](_0x24a57c['checkIsTrunkReachable'](_0x187a20))[_0xb8b2('0xb4')](_0x24a57c[_0xb8b2('0x13e')](_0x187a20['dialGlobalInterval'],_0x187a20[_0xb8b2('0x15a')],_0x187a20['name'],_0x187a20))[_0xb8b2('0xb4')](_0x24a57c[_0xb8b2('0x140')](_0x187a20[_0xb8b2('0x42')],_0x187a20[_0xb8b2('0x15a')],_0x187a20[_0xb8b2('0x40')],_0x187a20))[_0xb8b2('0xb4')](_0x24a57c[_0xb8b2('0x152')](_0x187a20))[_0xb8b2('0xad')](loggerCatchQueueSummary('[syncQueueSummary]',_0x187a20));}else{notSendMessagesQueue(_0x187a20);}}else{freeVariablesPredictive(_0x187a20);}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x13b')]=function(){var _0x1b8ce6=this;var _0x5a6269;for(var _0x1c00a6 in this[_0xb8b2('0x1f')]){if(typeof this[_0xb8b2('0x1f')][_0x1c00a6]!==_0xb8b2('0xa9')){_0x5a6269=this[_0xb8b2('0x1f')][_0x1c00a6];if(isCampaignIvr(_0x5a6269[_0xb8b2('0x4e')])&&isActive(_0x5a6269[_0xb8b2('0x7a')])){_0x5a6269[_0xb8b2('0x9d')]=!![];BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](checkIsActive(_0x5a6269,_0x5a6269['active']))[_0xb8b2('0xb4')](checkInterval(_0x5a6269))[_0xb8b2('0xb4')](_0x1b8ce6[_0xb8b2('0x13c')](_0x5a6269))[_0xb8b2('0xb4')](_0x1b8ce6['checkIfTime'](_0x5a6269[_0xb8b2('0x15b')],_0x5a6269[_0xb8b2('0x15a')],_0x5a6269[_0xb8b2('0x40')],_0x5a6269))[_0xb8b2('0xb4')](_0x1b8ce6[_0xb8b2('0x140')](_0x5a6269[_0xb8b2('0x42')],_0x5a6269[_0xb8b2('0x15a')],_0x5a6269[_0xb8b2('0x40')],_0x5a6269))[_0xb8b2('0xb4')](_0x1b8ce6[_0xb8b2('0x158')](_0x5a6269))['catch'](loggerCatchQueueSummary(_0xb8b2('0x15c'),_0x5a6269));}else{notSendMessagesCampaign(_0x5a6269);}}}};function getCallerIdRandom(_0x5b2885,_0x48ea66){var _0x4b6ef8;var _0x179d91;var _0x578bfe;if(_0x48ea66<=0x0){_0x48ea66=0x1;}_0x4b6ef8=new RegExp(_0xb8b2('0x15d')+_0x48ea66+'}$');_0x179d91=Math[_0xb8b2('0x15e')](0xa,_0x48ea66-0x1);_0x578bfe=Math[_0xb8b2('0x15e')](0xa,_0x48ea66)-0x1;return util['format']('%s',_[_0xb8b2('0x15f')](_0x5b2885,_0x4b6ef8,_[_0xb8b2('0x160')](_0x179d91,_0x578bfe)));}function extractCalleridName(_0x464993){var _0x345712=_0x464993[_0xb8b2('0x161')](/"(.*?)"/);return _0x345712?_0x345712[0x1]:_0x464993;}function extractCalleridNumber(_0xe225f4){var _0x8057d8=_0xe225f4[_0xb8b2('0x161')](/<(.*?)>/);return _0x8057d8?_0x8057d8[0x1]:_0xe225f4;}Dialer['prototype'][_0xb8b2('0x162')]=function(_0x47aa7f,_0x173099){var _0x2f06c=this;var _0x34f126=uuid['v4']();this[_0xb8b2('0x24')][_0x34f126]=new Action(_0x47aa7f,_0x173099,_0x34f126);return new BPromise(function(_0x4c6c14,_0x17449d){if(_['isUndefined'](_0x47aa7f)&&typeof _0x47aa7f!==_0xb8b2('0x163')){return _0x17449d(msgResponse(_0xb8b2('0x164'),_0xb8b2('0x145'),_0xb8b2('0x165')));}if(_[_0xb8b2('0x89')](_0x173099[_0xb8b2('0x166')][_0xb8b2('0x167')])||_0x173099['Contact']['phone']===null){return _0x17449d(msgResponse(_0xb8b2('0x164'),_0xb8b2('0x145'),_0xb8b2('0x168')));}var _0x4d79a7={'XMD-CALLERID':_0x2f06c[_0xb8b2('0x24')][_0x34f126][_0xb8b2('0x169')](),'XMD-AGI':_0x47aa7f[_0xb8b2('0x106')]?util['format'](_0xb8b2('0x16a'),ipAgi,_0x47aa7f[_0xb8b2('0x106')]):_0xb8b2('0x16b'),'XMD-AGIAFTER':_0x47aa7f[_0xb8b2('0x118')]?util[_0xb8b2('0x7c')](_0xb8b2('0x16a'),ipAgi,_0x47aa7f[_0xb8b2('0x118')]):'NONE','XMD-QUEUE':_0x47aa7f[_0xb8b2('0x4e')]===_0xb8b2('0x96')?util[_0xb8b2('0x7c')]('\x22%s,%s%s,,,%s\x22',_0x47aa7f[_0xb8b2('0x40')],_0x47aa7f['dialQueueOptions']||'',_0x47aa7f[_0xb8b2('0x10d')]?'c':'',_0x47aa7f[_0xb8b2('0x115')]||0x3):_0xb8b2('0x16b'),'XMD-CONTACTID':_0x173099[_0xb8b2('0xd0')],'XMD-CDRTYPE':_0xb8b2('0x16c'),'CALLERID(all)':_0x2f06c[_0xb8b2('0x24')][_0x34f126][_0xb8b2('0x169')](),'XMD-AMD':_0x47aa7f[_0xb8b2('0xe0')]?_0xb8b2('0x16d'):_0xb8b2('0x16b'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x47aa7f[_0xb8b2('0xe0')]){_0x4d79a7[_0xb8b2('0x16e')]=_0x47aa7f[_0xb8b2('0x16f')]||0x9c4;_0x4d79a7[_0xb8b2('0x170')]=_0x47aa7f['dialAMDGreeting']||0x5dc;_0x4d79a7['XMD-AMDAFTERGREETINGSILENCE']=_0x47aa7f[_0xb8b2('0x171')]||0x320;_0x4d79a7[_0xb8b2('0x172')]=_0x47aa7f[_0xb8b2('0x173')]||0x1388;_0x4d79a7['XMD-AMDMINWORDLENGTH']=_0x47aa7f[_0xb8b2('0x174')]||0x64;_0x4d79a7[_0xb8b2('0x175')]=_0x47aa7f['dialAMDBetweenWordsSilence']||0x32;_0x4d79a7[_0xb8b2('0x176')]=_0x47aa7f[_0xb8b2('0x177')]||0x3;_0x4d79a7['XMD-AMDSILENCETHRESHOLD']=_0x47aa7f[_0xb8b2('0x178')]||0x100;_0x4d79a7[_0xb8b2('0x179')]=_0x47aa7f[_0xb8b2('0x17a')]||0x1388;}if(_0x47aa7f[_0xb8b2('0x4e')]===_0xb8b2('0x96')){_0x4d79a7[_0xb8b2('0x17b')]=_0x173099[_0xb8b2('0xd3')];}else{_0x4d79a7[_0xb8b2('0x17c')]=_0x173099[_0xb8b2('0xd4')];}for(var _0x3bee81 in _0x173099['Contact']){if(typeof _0x173099[_0xb8b2('0x166')][_0x3bee81]!==_0xb8b2('0xa9')){if(isNotNull(_0x173099[_0xb8b2('0x166')][_0x3bee81])&&_0x3bee81!=='id'&&_0x3bee81!=='tags'&&_0x3bee81!==_0xb8b2('0x17d')&&_0x3bee81!==_0xb8b2('0x17e')){_0x4d79a7[util[_0xb8b2('0x7c')](_0xb8b2('0x17f'),_0xb8b2('0x180'),_[_0xb8b2('0x181')](_0x3bee81))]=_0x173099[_0xb8b2('0x166')][_0x3bee81];}}}var _0xe6011a=_0x2f06c[_0xb8b2('0xd8')](_0x47aa7f[_0xb8b2('0x79')])?getCallerId(_0x47aa7f[_0xb8b2('0x79')]['callerid'],_0x47aa7f['dialOriginateCallerIdName'],_0x47aa7f[_0xb8b2('0x182')]>0x0?getCallerIdRandom(_0x47aa7f[_0xb8b2('0x183')],_0x47aa7f[_0xb8b2('0x182')]):_0x47aa7f['dialOriginateCallerIdNumber']):getCallerId(_[_0xb8b2('0xdc')](_0x47aa7f[_0xb8b2('0x13d')])?_0x47aa7f[_0xb8b2('0x79')][_0xb8b2('0x7b')]:_0x47aa7f['TrunkBackup'][_0xb8b2('0x7b')],_0x47aa7f[_0xb8b2('0x5b')],_0x47aa7f['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x47aa7f[_0xb8b2('0x183')],_0x47aa7f['dialRandomLastDigitCallerIdNumber']):_0x47aa7f[_0xb8b2('0x183')]);if(_0xe6011a){_0x4d79a7[_0xb8b2('0x184')]=_0x2f06c[_0xb8b2('0x24')][_0x34f126]['originatecalleridname']=extractCalleridName(_0xe6011a);_0x4d79a7['XMD-ORIGINATECALLERIDNUM']=_0x2f06c[_0xb8b2('0x24')][_0x34f126][_0xb8b2('0x185')]=extractCalleridNumber(_0xe6011a);}return ami[_0xb8b2('0xaa')]({'actionid':_0x34f126,'action':'originate','channel':_0x2f06c[_0xb8b2('0xd8')](_0x47aa7f[_0xb8b2('0x79')])?util[_0xb8b2('0x7c')](_0xb8b2('0x186'),_0x47aa7f[_0xb8b2('0x79')][_0xb8b2('0x40')],isNotNull(_0x47aa7f[_0xb8b2('0x5d')])?_0x47aa7f[_0xb8b2('0x5d')][_0xb8b2('0x187')]()||'':'',_0x47aa7f[_0xb8b2('0x188')]>0x0?_0x173099[_0xb8b2('0x166')][_0xb8b2('0x167')][_0xb8b2('0x189')](_0x47aa7f['dialCutDigit']):_0x173099['Contact']['phone']):util['format'](_0xb8b2('0x186'),_[_0xb8b2('0xdc')](_0x47aa7f[_0xb8b2('0x13d')])?_0x47aa7f[_0xb8b2('0x79')]['name']:_0x47aa7f[_0xb8b2('0x13d')]['name'],isNotNull(_0x47aa7f[_0xb8b2('0x5d')])?_0x47aa7f[_0xb8b2('0x5d')][_0xb8b2('0x187')]()||'':'',_0x47aa7f[_0xb8b2('0x188')]>0x0?_0x173099[_0xb8b2('0x166')][_0xb8b2('0x167')][_0xb8b2('0x189')](_0x47aa7f[_0xb8b2('0x188')]):_0x173099[_0xb8b2('0x166')]['phone']),'callerid':_0xe6011a,'Exten':_0xb8b2('0xdf'),'Context':'from-sip','Priority':'1','variable':_0x4d79a7,'timeout':(_0x47aa7f[_0xb8b2('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x34f126})[_0xb8b2('0xb4')](function(_0x6d3b6e){return _0x4c6c14(_0x6d3b6e);})['catch'](function(_0x4ce30a){_0x47aa7f[_0xb8b2('0x66')]+=0x1;var _0x305349=new History(_0x2f06c['actions'][_0x34f126]);logger[_0xb8b2('0x9a')](util[_0xb8b2('0x7c')]('[originateError]:\x20%s',JSON[_0xb8b2('0x49')](_0x4ce30a)));_0x305349['state']=0xe;_0x305349['statedesc']=_0xb8b2('0x18a');_0x305349[_0xb8b2('0xa5')]=moment()[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x305349['endtime']=_0x305349[_0xb8b2('0xa5')];_0x2f06c['createHistory'](_0x305349)['catch'](loggerCatch(_0xb8b2('0x18b')));_0x2f06c[_0xb8b2('0xc6')](_0x305349)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x18b')))[_0xb8b2('0x135')](function(){delete _0x2f06c[_0xb8b2('0x24')][_0x34f126];return _0x17449d(msgResponse(_0xb8b2('0x164'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0xb8b2('0x19')]['syncOriginateResponse']=function(_0x322279){var _0x194371=this['actions'][_0x322279['actionid']];if(_0x194371){delete this[_0xb8b2('0x24')][_0x322279[_0xb8b2('0x123')]];_0x194371['responsetime']=moment()[_0xb8b2('0x7c')](_0xb8b2('0xfa'));var _0x2da6ad=_0x194371['type']===_0xb8b2('0x7f')?this['campaigns'][_0x194371[_0xb8b2('0xb0')]]:this[_0xb8b2('0x1e')][_0x194371[_0xb8b2('0x18c')]()];if(!this[_0xb8b2('0x18d')](_0x322279[_0xb8b2('0x18e')])){this['updateOriginated'](_0x2da6ad);return this[_0xb8b2('0x18f')](_0x194371,_0x2da6ad,_0x322279)['catch'](loggerCatch(_0xb8b2('0x190')));}this[_0xb8b2('0x26')][_0x322279['uniqueid']]=_0x194371;}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x191')]=function(_0x453308,_0x4a5ede,_0x8ea52f){var _0x3ff5e8=new History(_0x4a5ede);if(_0x3ff5e8[_0xb8b2('0xed')]+_0x3ff5e8[_0xb8b2('0xee')]+_0x3ff5e8[_0xb8b2('0xef')]+_0x3ff5e8[_0xb8b2('0xf0')]+_0x3ff5e8[_0xb8b2('0xf1')]+_0x3ff5e8[_0xb8b2('0xf2')]+_0x3ff5e8[_0xb8b2('0xea')]+_0x3ff5e8[_0xb8b2('0x192')]>=_0x8ea52f[_0xb8b2('0xf3')]-0x1){return!![];}switch(_0x453308){case 0x3:if(_0x3ff5e8[_0xb8b2('0xef')]>=_0x8ea52f[_0xb8b2('0x193')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x3ff5e8[_0xb8b2('0xef')]+=0x1,'scheduledat':moment()[_0xb8b2('0xf8')](_0x8ea52f[_0xb8b2('0x194')],_0xb8b2('0x102'))[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ff5e8[_0xb8b2('0xd0')],'ListId':_0x3ff5e8['ListId'],'VoiceQueueId':_0x3ff5e8[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x195')));break;case 0x5:if(_0x3ff5e8[_0xb8b2('0xed')]>=_0x8ea52f['dialBusyMaxRetry']-0x1){return!![];}this[_0xb8b2('0xf7')]({'active':![],'countbusyretry':_0x3ff5e8['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x8ea52f['dialBusyRetryFrequency'],_0xb8b2('0x102'))[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ff5e8[_0xb8b2('0xd0')],'ListId':_0x3ff5e8[_0xb8b2('0xd1')],'VoiceQueueId':_0x3ff5e8[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x3ff5e8[_0xb8b2('0xee')]>=_0x8ea52f['dialCongestionMaxRetry']-0x1){return!![];}this[_0xb8b2('0xf7')]({'active':![],'countcongestionretry':_0x3ff5e8[_0xb8b2('0xee')]+=0x1,'scheduledat':moment()[_0xb8b2('0xf8')](_0x8ea52f[_0xb8b2('0x196')],_0xb8b2('0x102'))[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x3ff5e8[_0xb8b2('0xd0')],'ListId':_0x3ff5e8[_0xb8b2('0xd1')],'VoiceQueueId':_0x3ff5e8['VoiceQueueId']||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x197')));break;case 0x0:if(_0x3ff5e8[_0xb8b2('0xf0')]>=_0x8ea52f[_0xb8b2('0x198')]-0x1){return!![];}else{this[_0xb8b2('0xf7')]({'active':![],'countnosuchnumberretry':_0x3ff5e8['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xb8b2('0xf8')](_0x8ea52f[_0xb8b2('0x199')],_0xb8b2('0x102'))[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x3ff5e8[_0xb8b2('0xd0')],'ListId':_0x3ff5e8['ListId'],'VoiceQueueId':_0x3ff5e8[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x19a')));}break;case 0xa:if(_0x3ff5e8[_0xb8b2('0xf1')]>=_0x8ea52f['dialDropMaxRetry']-0x1){return!![];}this[_0xb8b2('0xf7')]({'active':![],'countdropretry':_0x3ff5e8[_0xb8b2('0xf1')]+=0x1,'scheduledat':moment()['add'](_0x8ea52f[_0xb8b2('0x11a')],_0xb8b2('0x102'))[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ff5e8[_0xb8b2('0xd0')],'ListId':_0x3ff5e8[_0xb8b2('0xd1')],'VoiceQueueId':_0x3ff5e8['VoiceQueueId']||undefined,'CampaignId':_0x3ff5e8['CampaignId']||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x11b')));break;case 0xb:if(_0x3ff5e8['countabandonedretry']>=_0x8ea52f['dialAbandonedMaxRetry']-0x1){return!![];}this[_0xb8b2('0xf7')]({'active':![],'countabandonedretry':_0x3ff5e8[_0xb8b2('0xf2')]+=0x1,'scheduledat':moment()[_0xb8b2('0xf8')](_0x8ea52f[_0xb8b2('0x19b')],'minutes')[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ff5e8[_0xb8b2('0xd0')],'ListId':_0x3ff5e8[_0xb8b2('0xd1')],'VoiceQueueId':_0x3ff5e8[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x19c')));break;case 0x13:if(_0x3ff5e8[_0xb8b2('0xea')]>=_0x8ea52f[_0xb8b2('0xf5')]-0x1){return!![];}this[_0xb8b2('0xf7')]({'active':![],'countmachineretry':_0x3ff5e8[_0xb8b2('0xea')]+=0x1,'scheduledat':moment()[_0xb8b2('0xf8')](_0x8ea52f[_0xb8b2('0xf9')],_0xb8b2('0x102'))[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x3ff5e8['ContactId'],'ListId':_0x3ff5e8['ListId'],'VoiceQueueId':_0x3ff5e8['VoiceQueueId']||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xfb')));break;case 0x14:if(_0x3ff5e8[_0xb8b2('0x192')]>=_0x8ea52f[_0xb8b2('0x19d')]-0x1){return!![];}this[_0xb8b2('0xf7')]({'active':![],'countagentrejectretry':_0x3ff5e8['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xb8b2('0xf8')](_0x8ea52f[_0xb8b2('0x19e')],_0xb8b2('0x102'))[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x3ff5e8['ContactId'],'ListId':_0x3ff5e8[_0xb8b2('0xd1')],'VoiceQueueId':_0x3ff5e8[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x18f')]=function(_0x27bda2,_0x30b807,_0x3afca0){var _0x2c0f9c=this;var _0xc3713a=new History(_0x27bda2);return new BPromise(function(_0x257443,_0x3c3bb0){if(_[_0xb8b2('0x89')](_0x30b807)&&typeof _0x30b807!==_0xb8b2('0x163')){return _0x3c3bb0(msgResponse(_0xb8b2('0x19f'),_0xb8b2('0x145'),_0xb8b2('0x1a0')));}if(_['isUndefined'](_0x3afca0)&&typeof _0x3afca0!==_0xb8b2('0x163')){return _0x3c3bb0(msgResponse(_0xb8b2('0x19f'),_0xb8b2('0x145'),_0xb8b2('0x1a1')));}switch(_0x3afca0['reason']){case'0':_0x30b807[_0xb8b2('0x1a2')]+=0x1;_0xc3713a[_0xb8b2('0xa3')]=0x0;_0xc3713a[_0xb8b2('0xe3')]=_0xb8b2('0x1a3');_0xc3713a[_0xb8b2('0xf0')]+=0x1;_0xc3713a['countglobal']+=0x1;ami[_0xb8b2('0x4d')](_0xb8b2('0x1a4'),ut[_0xb8b2('0xe5')](_0x27bda2,_0xb8b2('0x1a5')));_0x2c0f9c[_0xb8b2('0xc8')](_0xc3713a)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2c0f9c[_0xb8b2('0x191')](0x0,_0x27bda2,_0x30b807)){if(_0xc3713a[_0xb8b2('0xf0')]>=_0x30b807[_0xb8b2('0x198')]){_0x2c0f9c[_0xb8b2('0xf6')](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1a6'));}else{_0x2c0f9c[_0xb8b2('0x100')](_0xc3713a,_0x257443,_0x3c3bb0,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x30b807[_0xb8b2('0x1a7')]+=0x1;_0xc3713a[_0xb8b2('0xa3')]=0x3;_0xc3713a[_0xb8b2('0xe3')]=_0xb8b2('0x1a8');_0xc3713a['countnoanswerretry']+=0x1;_0xc3713a['countglobal']+=0x1;ami[_0xb8b2('0x4d')]('custom:agentnoanswer',ut[_0xb8b2('0xe5')](_0x27bda2,_0xb8b2('0x1a9')));_0x2c0f9c[_0xb8b2('0xc8')](_0xc3713a)[_0xb8b2('0xad')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x2c0f9c['checkRetriveMax'](0x3,_0x27bda2,_0x30b807)){if(_0xc3713a['countnoanswerretry']>=_0x30b807['dialNoAnswerMaxRetry']){_0x2c0f9c['createStateFinal'](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1aa'));}else{_0x2c0f9c['stateGlobal'](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1aa'));}}break;case'5':_0x30b807[_0xb8b2('0x61')]+=0x1;_0xc3713a[_0xb8b2('0xa3')]=0x5;_0xc3713a[_0xb8b2('0xe3')]=_0xb8b2('0x1ab');_0xc3713a[_0xb8b2('0xed')]+=0x1;_0xc3713a['countglobal']+=0x1;ami[_0xb8b2('0x4d')](_0xb8b2('0x1ac'),ut[_0xb8b2('0xe5')](_0x27bda2,_0xb8b2('0x1ad')));_0x2c0f9c['createHistory'](_0xc3713a)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1ae')));if(_0x2c0f9c[_0xb8b2('0x191')](0x5,_0x27bda2,_0x30b807)){if(_0xc3713a[_0xb8b2('0xed')]>=_0x30b807['dialBusyMaxRetry']){_0x2c0f9c[_0xb8b2('0xf6')](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1af'));}else{_0x2c0f9c[_0xb8b2('0x100')](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1af'));}}break;case'8':_0x30b807['outboundCongestionCallsDay']+=0x1;_0xc3713a['state']=0x8;_0xc3713a[_0xb8b2('0xe3')]=_0xb8b2('0x1b0');_0xc3713a['countcongestionretry']+=0x1;_0xc3713a[_0xb8b2('0xeb')]+=0x1;ami[_0xb8b2('0x4d')](_0xb8b2('0x1b1'),ut[_0xb8b2('0xe5')](_0x27bda2,_0xb8b2('0x1b2')));_0x2c0f9c['createHistory'](_0xc3713a)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1b3')));if(_0x2c0f9c[_0xb8b2('0x191')](0x8,_0x27bda2,_0x30b807)){if(_0xc3713a['countcongestionretry']>=_0x30b807[_0xb8b2('0x1b4')]){_0x2c0f9c['createStateFinal'](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1b5'));}else{_0x2c0f9c['stateGlobal'](_0xc3713a,_0x257443,_0x3c3bb0,'reason\x208\x20congestion');}}break;case'11':_0x30b807[_0xb8b2('0x1b6')]+=0x1;_0xc3713a[_0xb8b2('0xa3')]=0xb;_0xc3713a[_0xb8b2('0xe3')]=_0xb8b2('0x120');_0xc3713a[_0xb8b2('0xf2')]+=0x1;_0xc3713a[_0xb8b2('0xeb')]+=0x1;_0x2c0f9c[_0xb8b2('0xc8')](_0xc3713a)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1b7')));if(_0x2c0f9c[_0xb8b2('0x191')](0xb,_0x27bda2,_0x30b807)){if(_0xc3713a[_0xb8b2('0xf2')]>=_0x30b807[_0xb8b2('0x122')]){_0x2c0f9c[_0xb8b2('0xf6')](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1b8'));}else{_0x2c0f9c['stateGlobal'](_0xc3713a,_0x257443,_0x3c3bb0,'reason\x2011\x20abandoned');}}break;case'20':_0x30b807[_0xb8b2('0x67')]+=0x1;_0xc3713a[_0xb8b2('0xa3')]=0x14;_0xc3713a[_0xb8b2('0xe3')]=_0xb8b2('0x1b9');_0xc3713a[_0xb8b2('0x192')]+=0x1;_0xc3713a[_0xb8b2('0xeb')]+=0x1;ami[_0xb8b2('0x4d')](_0xb8b2('0x1ba'),ut[_0xb8b2('0xe5')](_0x27bda2,_0xb8b2('0x1bb')));_0x2c0f9c[_0xb8b2('0xc8')](_0xc3713a)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1bc')));if(_0x2c0f9c[_0xb8b2('0x191')](0x14,_0x27bda2,_0x30b807)){if(_0xc3713a[_0xb8b2('0x192')]>=_0x30b807[_0xb8b2('0x19d')]){_0x2c0f9c[_0xb8b2('0xf6')](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1bd'));}else{_0x2c0f9c[_0xb8b2('0x100')](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1bd'));}}break;default:_0x30b807[_0xb8b2('0x68')]+=0x1;_0xc3713a['state']=0xc;_0xc3713a[_0xb8b2('0xe3')]=_0x3afca0[_0xb8b2('0x10a')];_0x2c0f9c[_0xb8b2('0xc8')](_0xc3713a)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1be')));if(_0x2c0f9c[_0xb8b2('0x191')](_0x3afca0[_0xb8b2('0x10a')],_0x27bda2,_0x30b807)){if(_0xc3713a[_0xb8b2('0xed')]+_0xc3713a[_0xb8b2('0xee')]+_0xc3713a[_0xb8b2('0xef')]+_0xc3713a[_0xb8b2('0xf0')]+_0xc3713a['countdropretry']+_0xc3713a[_0xb8b2('0xf2')]+_0xc3713a[_0xb8b2('0xea')]+_0xc3713a[_0xb8b2('0x192')]>=_0x30b807[_0xb8b2('0xf3')]){_0x2c0f9c[_0xb8b2('0x100')](_0xc3713a,_0x257443,_0x3c3bb0,_0x3afca0[_0xb8b2('0x10a')]);}else{_0x2c0f9c[_0xb8b2('0xf6')](_0xc3713a,_0x257443,_0x3c3bb0,_0x3afca0[_0xb8b2('0x10a')]);}}}});};Dialer[_0xb8b2('0x19')][_0xb8b2('0x100')]=function(_0x95576a,_0x4be636,_0x1db294,_0x3e14bc){var _0x5dbf56=new Final(_0x95576a);_0x5dbf56[_0xb8b2('0xa3')]=0xf;_0x5dbf56[_0xb8b2('0xe3')]=_0xb8b2('0x1bf');this[_0xb8b2('0xf6')](_0x5dbf56,_0x4be636,_0x1db294,_0x3e14bc);};Dialer['prototype']['createStateFinal']=function(_0x6cf04f,_0x14e0de,_0x190369,_0x253f87){this[_0xb8b2('0xc6')](_0x6cf04f)['then'](function(){return _0x14e0de(msgResponse(_0xb8b2('0x19f'),_0xb8b2('0xd7'),_0x253f87));})[_0xb8b2('0xad')](function(){return _0x190369(msgResponse(_0xb8b2('0x1c0'),'Failure','contact\x20not\x20moved'));});};Dialer[_0xb8b2('0x19')]['predictive']=function(_0x144c84){var _0x278d15=_0x144c84[_0xb8b2('0x1c1')]/0x64;var _0x575c68=_0x144c84[_0xb8b2('0x65')]/(_0x144c84['outboundDropCallsDayTimeout']+_0x144c84[_0xb8b2('0x5f')]);var _0x4e2158=Math['round'](_0x144c84[_0xb8b2('0x72')]*(_0x144c84[_0xb8b2('0x1c2')]/0x64));var _0x5bb127=Math[_0xb8b2('0x1c3')](_0x144c84['predictiveIntervalAvailable']*(_0x144c84[_0xb8b2('0x1c4')]/0x64));var _0x5ed469=_0x144c84['available']+_0x144c84[_0xb8b2('0x54')];var _0x5d4690=Math[_0xb8b2('0x1c5')](_0x144c84[_0xb8b2('0x75')]*_0x144c84[_0xb8b2('0x76')]*_0x144c84[_0xb8b2('0x6f')]*_0x144c84['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x144c84[_0xb8b2('0x28')])){if(!_['isUndefined'](_0x144c84['startPredictive'])){_0x144c84['startPredictive']=undefined;loggerPredictive[_0xb8b2('0x9a')]('[startMethodPredictive][StartProgressive]',_0xb8b2('0x1c6'));}if(!_[_0xb8b2('0x89')](_0x144c84[_0xb8b2('0x94')])){loggerPredictive[_0xb8b2('0x9a')](_0xb8b2('0x1c7'),_0xb8b2('0x1c8'));clearInterval(_0x144c84[_0xb8b2('0x94')]);_0x144c84['handlePredictive']=undefined;}_0x144c84[_0xb8b2('0x28')]=moment()[_0xb8b2('0x7c')](_0xb8b2('0xfa'));loggerPredictive[_0xb8b2('0x82')](_0x144c84['name'],_0xb8b2('0x1c9'),_0x144c84['startProgressive']);this[_0xb8b2('0x155')](_0x144c84,0x1);}else if(ifInterval(_0x144c84[_0xb8b2('0x1ca')],_0x144c84[_0xb8b2('0x28')])){this[_0xb8b2('0x155')](_0x144c84,0x1);loggerPredictiveCalls[_0xb8b2('0x82')](_0xb8b2('0x1cb'),_0x144c84[_0xb8b2('0x28')],_0x144c84[_0xb8b2('0x40')]);_0x144c84['erlangCalls']=0x0;_0x144c84[_0xb8b2('0x6e')]=0x0;}else if(_0x278d15<_0x575c68&&_0x144c84[_0xb8b2('0x1cc')]===_0xb8b2('0x1cd')){freeVariablesPredictive(_0x144c84);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xb8b2('0x1ce'),_0x575c68,_0xb8b2('0x28'),_0x144c84[_0xb8b2('0x40')]);}else if(_0x5d4690<_0x144c84[_0xb8b2('0x6e')]&&_0x144c84[_0xb8b2('0x1cc')]==='dropRate'){freeVariablesPredictive(_0x144c84);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x1cf'),_0xb8b2('0x1d0'),_0x5d4690,_0xb8b2('0x1d1'),_0x144c84[_0xb8b2('0x6e')],_0xb8b2('0x28'),_0x144c84['name']);}else if(!ifInterval(_0x144c84['dialPredictiveInterval'],_0x144c84[_0xb8b2('0x28')])&&_[_0xb8b2('0x89')](_0x144c84[_0xb8b2('0x78')])&&!_['isUndefined'](_0x144c84['startProgressive'])){_0x144c84[_0xb8b2('0x78')]=moment()[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xb8b2('0x82')](_0x144c84[_0xb8b2('0x40')],_0xb8b2('0x1d2'),_0x144c84[_0xb8b2('0x78')]);this[_0xb8b2('0xba')](_0x144c84['dialPredictiveInterval'])[_0xb8b2('0xb4')](this[_0xb8b2('0x1d3')](_0x144c84))[_0xb8b2('0xb4')](mergeDataErlangB(_0x144c84))[_0xb8b2('0xb4')](this[_0xb8b2('0x1d4')](_0x144c84))[_0xb8b2('0xad')](loggerCatchPredictive(_0xb8b2('0x1d5'),_0x144c84));}else if(!ifInterval(_0x144c84[_0xb8b2('0x1ca')],_0x144c84[_0xb8b2('0x78')])){_0x144c84[_0xb8b2('0x6e')]=0x0;_0x144c84[_0xb8b2('0x78')]=moment()['format'](_0xb8b2('0xfa'));loggerPredictive[_0xb8b2('0x82')](_0x144c84[_0xb8b2('0x40')],_0xb8b2('0x1d6'),_0x144c84[_0xb8b2('0x78')]);clearInterval(_0x144c84[_0xb8b2('0x94')]);_0x144c84['handlePredictive']=undefined;this[_0xb8b2('0xba')](_0x144c84['dialPredictiveInterval'])['then'](this[_0xb8b2('0x1d3')](_0x144c84))[_0xb8b2('0xb4')](mergeDataErlangB(_0x144c84))[_0xb8b2('0xb4')](this['startMethodPredictive'](_0x144c84))['catch'](loggerCatchPredictive(_0xb8b2('0x1d7'),_0x144c84));}else if(_0x144c84['predictiveIntervalAvailable']&&_0x5ed469<_0x144c84[_0xb8b2('0x72')]-_0x5bb127){freeVariablesPredictive(_0x144c84);loggerPredictive[_0xb8b2('0x82')](_0x144c84[_0xb8b2('0x40')],_0xb8b2('0x1d8'),_0x5ed469,')\x20are\x20less\x20than\x20threshold\x20(',_0x144c84[_0xb8b2('0x72')],'-',_0x5bb127,'=',_0x144c84[_0xb8b2('0x72')]-_0x5bb127,')');}else if(_0x144c84[_0xb8b2('0x72')]&&_0x5ed469>_0x144c84[_0xb8b2('0x72')]+_0x4e2158){freeVariablesPredictive(_0x144c84);loggerPredictive[_0xb8b2('0x82')](_0x144c84[_0xb8b2('0x40')],_0xb8b2('0x1d8'),_0x5ed469,_0xb8b2('0x1d9'),_0x144c84[_0xb8b2('0x72')],'+',_0x4e2158,'=',_0x144c84[_0xb8b2('0x72')]+_0x4e2158,')');}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x1d3')]=function(_0x599184){var _0x2c0c4c=this;return function(_0x55da76){return new BPromise(function(_0x148428,_0x187b80){_[_0xb8b2('0x92')](_0x599184,_0x55da76[0x0]);if(checkGetDataPredictive(_0x55da76[0x0])){var _0x221955=_0x599184[_0xb8b2('0x72')]=_0x599184[_0xb8b2('0x54')]+_0x599184[_0xb8b2('0x50')];var _0x9a91b6=_0x599184[_0xb8b2('0x1ca')]*0x3c;var _0x426117=_0x55da76[0x0][_0xb8b2('0x6b')]+_0x55da76[0x0]['predictiveIntervalAvgHoldtime'];var _0x188203=(_0x55da76[0x0][_0xb8b2('0x69')]+_0x55da76[0x0][_0xb8b2('0x6c')]+_0x55da76[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x55da76[0x0][_0xb8b2('0x73')];_0x599184['predictiveIntervalHitRate']=_0x188203>0x0?_0x188203:0x1;switch(_0x599184[_0xb8b2('0x1cc')]){case _0xb8b2('0x1cd'):var _0x1759d8=_0x599184[_0xb8b2('0x1c1')]/0x64;return _0x2c0c4c[_0xb8b2('0x1da')](_0x221955,_0x9a91b6,_0x426117,_0x188203,_0x1759d8)['then'](function(_0x3bbbbb){return _0x148428(_0x3bbbbb);});case _0xb8b2('0x1db'):var _0x40e9aa=_0x599184[_0xb8b2('0x1c1')]/0x64;return _0x2c0c4c[_0xb8b2('0x1dc')](_0x221955,_0x9a91b6,_0x426117,_0x188203,_0x40e9aa)[_0xb8b2('0xb4')](function(_0x518256){return _0x148428(_0x518256);});default:return _0x187b80(msgResponse(_0xb8b2('0x1dd'),_0xb8b2('0x145'),'Unknown\x20Predictive'));}}else{return _0x187b80(msgResponse(_0xb8b2('0x1dd'),'Failure',_0xb8b2('0x1de')));}});};};Dialer[_0xb8b2('0x19')][_0xb8b2('0x1df')]=function(_0x58a33d){var _0x37938d=this;return function(_0x1f098f){return new BPromise(function(_0x32e02a,_0x17fcf0){_[_0xb8b2('0x92')](_0x58a33d,_0x1f098f[0x0]);if(checkGetDataPredictive(_0x1f098f[0x0])){loggerPredictive['info'](JSON[_0xb8b2('0x49')](_0x1f098f[0x0]));if(_0x58a33d[_0xb8b2('0x1cc')]===_0xb8b2('0x1cd')){return _0x37938d[_0xb8b2('0xc4')](_0x58a33d['id'])[_0xb8b2('0xb4')](function(_0x3298d7){var _0x379e76=_0x58a33d[_0xb8b2('0x51')]-_0x3298d7[0x0]['outboundQueuePauses'];var _0x432587=_0x58a33d[_0xb8b2('0x1ca')]*0x3c;var _0x30d1a7=_0x1f098f[0x0]['predictiveIntervalAvgTalktime']+_0x1f098f[0x0]['predictiveIntervalAvgHoldtime'];var _0x3ef6b4=(_0x1f098f[0x0][_0xb8b2('0x69')]+_0x1f098f[0x0][_0xb8b2('0x6c')]+_0x1f098f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1f098f[0x0][_0xb8b2('0x73')];var _0x1e942e=_0x58a33d['dialPredictiveOptimizationPercentage']/0x64;_0x58a33d[_0xb8b2('0x71')]=_0x3298d7[0x0][_0xb8b2('0x1e0')]||0x0;_0x58a33d[_0xb8b2('0x6f')]=_0x3ef6b4>0x0?_0x3ef6b4:0x1;return _0x37938d[_0xb8b2('0x1da')](_0x379e76,_0x432587,_0x30d1a7,_0x3ef6b4,_0x1e942e);})[_0xb8b2('0xb4')](function(_0x373424){return _0x32e02a(_0x373424);})[_0xb8b2('0xad')](function(_0x309653){return _0x17fcf0(msgResponse(_0xb8b2('0x1e1'),_0xb8b2('0x145'),JSON[_0xb8b2('0x49')](_0x309653)));});}if(_0x58a33d['dialPredictiveOptimization']===_0xb8b2('0x1db')){return _0x37938d['getVoiceQueueRtPauses'](_0x58a33d['id'])['then'](function(_0x4f2519){var _0x4bcf98=_0x58a33d['loggedIn']-_0x4f2519[0x0]['outboundQueuePauses'];var _0x19c6a5=_0x58a33d[_0xb8b2('0x1ca')]*0x3c;var _0x51c864=_0x1f098f[0x0][_0xb8b2('0x6b')]+_0x1f098f[0x0][_0xb8b2('0x6a')];var _0x15ccba=(_0x1f098f[0x0][_0xb8b2('0x69')]+_0x1f098f[0x0][_0xb8b2('0x6c')]+_0x1f098f[0x0][_0xb8b2('0x86')])/_0x1f098f[0x0][_0xb8b2('0x73')];var _0x146a56=_0x58a33d['dialPredictiveOptimizationPercentage']/0x64;_0x58a33d[_0xb8b2('0x71')]=_0x4f2519[0x0][_0xb8b2('0x1e0')]||0x0;_0x58a33d['predictiveIntervalHitRate']=_0x15ccba>0x0?_0x15ccba:0x1;return _0x37938d['busyFactor'](_0x4bcf98,_0x19c6a5,_0x51c864,_0x15ccba,_0x146a56);})[_0xb8b2('0xb4')](function(_0x58015f){return _0x32e02a(_0x58015f);})['catch'](function(_0x156c48){return _0x17fcf0(msgResponse(_0xb8b2('0x1e1'),_0xb8b2('0x145'),JSON[_0xb8b2('0x49')](_0x156c48)));});}}else{return _0x17fcf0(msgResponse(_0xb8b2('0x1dd'),_0xb8b2('0x145'),_0xb8b2('0x1de')));}});};};Dialer[_0xb8b2('0x19')][_0xb8b2('0x1d4')]=function(_0x98d655){var _0x14ac97=this;return function(){var _0x52dfa7=0x0;var _0xb8ed7f=Math[_0xb8b2('0x1c5')](_0x98d655[_0xb8b2('0x8f')]*0x3e8);if(_0xb8ed7f>0x0){_0xb8ed7f=_0xb8ed7f<0x64?0x64:_0xb8ed7f;loggerPredictive['info'](_0x98d655[_0xb8b2('0x40')],'one\x20call\x20every:',_0xb8ed7f,'milliseconds');_0x98d655[_0xb8b2('0x94')]=setInterval(function(){_0x14ac97['handlePredictive'](_0x98d655);loggerPredictiveCalls[_0xb8b2('0x82')](_0xb8b2('0x1e2'),_0x52dfa7+=0x1);},_0xb8ed7f);}else{loggerPredictive[_0xb8b2('0x82')](_0x98d655[_0xb8b2('0x40')],_0xb8b2('0x1e3'));}};};Dialer['prototype'][_0xb8b2('0x1e4')]=function(_0x5d2631,_0x245be3){var _0x52f610=this;return function(_0x21c937){if(_[_0xb8b2('0x46')](_0x21c937)){if(_['isNil'](_0x245be3[_0xb8b2('0xd2')])||!_0x245be3[_0xb8b2('0x1e5')]){if(_0x5d2631[_0xb8b2('0x5a')]===_0xb8b2('0x9')){_0x5d2631[_0xb8b2('0x12a')]=_[_0xb8b2('0x89')](_0x5d2631[_0xb8b2('0x12a')])?!![]:_0x5d2631[_0xb8b2('0x12a')];var _0x594cdf=uuid['v4']();_0x52f610[_0xb8b2('0x24')][_0x594cdf]=new Action(_0x5d2631,_0x245be3,_0x594cdf);loggerBooked[_0xb8b2('0x82')](_0xb8b2('0x1e6'),_0x594cdf,_0xb8b2('0x1e7'),JSON['stringify'](_0x5d2631[_0xb8b2('0x12a')]),'Queue:\x20',_0x5d2631[_0xb8b2('0x40')]);if(_0x5d2631[_0xb8b2('0x12a')]){_0x5d2631[_0xb8b2('0x12a')]=![];_0x52f610[_0xb8b2('0x2a')][_0x52f610[_0xb8b2('0x24')][_0x594cdf][_0xb8b2('0xb0')]]=[];ami[_0xb8b2('0xaa')]({'actionid':_0x594cdf,'action':_0xb8b2('0x1e8'),'queue':_0x5d2631['name']})[_0xb8b2('0xad')](function(){_0x52f610[_0xb8b2('0xaf')](_0x5d2631);_0x52f610['rescheduleContact']({'active':![],'ContactId':_0x52f610[_0xb8b2('0x24')][_0x594cdf][_0xb8b2('0xd0')],'ListId':_0x52f610[_0xb8b2('0x24')][_0x594cdf]['ListId'],'VoiceQueueId':_0x52f610[_0xb8b2('0x24')][_0x594cdf][_0xb8b2('0xd3')]||undefined,'CampaignId':_0x52f610[_0xb8b2('0x24')][_0x594cdf][_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1e9')));delete _0x52f610[_0xb8b2('0x24')][_0x594cdf];});}else{loggerBooked['info'](_0xb8b2('0x1ea'),JSON[_0xb8b2('0x49')](_0x5d2631['queueStatusComplete']),_0xb8b2('0x1eb'),_0x5d2631['name']);_0x52f610[_0xb8b2('0xaf')](_0x5d2631);_0x52f610[_0xb8b2('0xf7')]({'active':![],'ContactId':_0x52f610['actions'][_0x594cdf]['ContactId'],'ListId':_0x52f610['actions'][_0x594cdf]['ListId'],'VoiceQueueId':_0x52f610[_0xb8b2('0x24')][_0x594cdf][_0xb8b2('0xd3')]||undefined,'CampaignId':_0x52f610[_0xb8b2('0x24')][_0x594cdf]['CampaignId']||undefined})[_0xb8b2('0xad')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x52f610[_0xb8b2('0x24')][_0x594cdf];}}else{return _0x52f610['actionOriginate'](_0x5d2631,_0x245be3);}}else{if(getDiff(_0x245be3[_0xb8b2('0x1ec')])<_0x5d2631[_0xb8b2('0x1ed')]*0x3c){if(_0x245be3[_0xb8b2('0x1ee')]&&!_0x245be3[_0xb8b2('0x1ee')][_0xb8b2('0x1ef')]){_0x52f610[_0xb8b2('0x1d')]['run'](_0x245be3['id'])[_0xb8b2('0x135')](function(){_0x52f610[_0xb8b2('0xaf')](_0x5d2631);});}else{_0x52f610[_0xb8b2('0xbe')]({'active':![]},_0x245be3['id'],0x1)['finally'](function(){_0x52f610[_0xb8b2('0xaf')](_0x5d2631);});}}else{_0x5d2631[_0xb8b2('0x1f0')]+=0x1;_0x52f610[_0xb8b2('0xaf')](_0x5d2631);if(_0x5d2631[_0xb8b2('0x1f1')]){_0x52f610[_0xb8b2('0xf7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x245be3[_0xb8b2('0xd0')],'ListId':_0x245be3[_0xb8b2('0xd1')],'VoiceQueueId':_0x245be3[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x245be3['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x52f610['createHistory'](createObjHistory(_0x5d2631,_0x245be3,_0xb8b2('0x1f2'),0x17,'RecallInQueue'))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1f3')));}else{_0x52f610[_0xb8b2('0xce')](createObjHistory(_0x5d2631,_0x245be3,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0xb8b2('0x1f4'),'[Originate][HistoryRecallClose]');}}}}else{_0x5d2631['outboundBlacklistCallsDay']+=0x1;_0x52f610[_0xb8b2('0xce')](createObjHistory(_0x5d2631,_0x245be3,'BLACKLIST',0xd,_0xb8b2('0x1f5')),_0xb8b2('0x1f6'),_0xb8b2('0x1f7'));throw _0xb8b2('0x1f8');}};};Dialer[_0xb8b2('0x19')][_0xb8b2('0x159')]=function(_0x1f5646){var _0x3c3d0c=this;var _0x2e4f06=_0x1f5646[_0xb8b2('0x1f9')]-_0x1f5646[_0xb8b2('0x74')]-_0x1f5646['temp'];emitCampaignSummary(_0x1f5646);if(_0x2e4f06>0x0){if(_0x2e4f06>this[_0xb8b2('0x22')]){_0x2e4f06=this[_0xb8b2('0x22')];}_0x1f5646['temp']+=_0x2e4f06;this['getContactDialerIvr'](_0x1f5646['id'],_0x2e4f06,_0x1f5646[_0xb8b2('0x1fa')],_0x1f5646)[_0xb8b2('0xb4')](function(_0x20ec8f){_0x1f5646[_0xb8b2('0xc1')]-=_0x2e4f06;_0x1f5646[_0xb8b2('0xc1')]=_0x1f5646[_0xb8b2('0xc1')]>0x0?_0x1f5646[_0xb8b2('0xc1')]:0x0;if(!checkContactEmpty(_0x20ec8f)){_0x1f5646['message']='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xb8b2('0x1fb')+_0x1f5646[_0xb8b2('0x40')]);}else{_0x1f5646[_0xb8b2('0x74')]+=_0x20ec8f[_0xb8b2('0x147')];_0x1f5646['message']=_0xb8b2('0x1fc');for(var _0x3cff33=0x0;_0x3cff33<_0x20ec8f[_0xb8b2('0x147')];_0x3cff33+=0x1){_0x1f5646[_0xb8b2('0x1fd')]+=0x1;if(_[_0xb8b2('0xdc')](_0x20ec8f[_0x3cff33])||_['isNil'](_0x20ec8f[_0x3cff33][_0xb8b2('0x166')])||_[_0xb8b2('0xdc')](_0x20ec8f[_0x3cff33]['Contact']['phone'])){_0x3c3d0c[_0xb8b2('0xcc')](_0xb8b2('0x1fe'),_0x1f5646,_0x20ec8f[_0x3cff33]);}else{_0x3c3d0c[_0xb8b2('0xb8')](_[_0xb8b2('0xcf')](_0x20ec8f[_0x3cff33],[_0xb8b2('0xd4'),_0xb8b2('0x1ff')]))[_0xb8b2('0xb4')](_0x3c3d0c[_0xb8b2('0x1e4')](_0x1f5646,_0x20ec8f[_0x3cff33]))[_0xb8b2('0xad')](_0x3c3d0c[_0xb8b2('0xcb')]('[actionOriginateIvr]\x20',_0x1f5646));}}}})['catch'](loggerGetContactDialer(_0xb8b2('0x200'),_0x1f5646,_0x2e4f06));}};Dialer['prototype'][_0xb8b2('0x155')]=function(_0xc1a924,_0x53f138){var _0x2975e5=this;var _0x41da7d=[];var _0x377af1=_0x53f138>=0x1?_0x53f138:0x1;if(_0xc1a924['dialMethod']===_0xb8b2('0x9')){_0x377af1=0x1;}var _0x39f298=Math[_0xb8b2('0x1c5')](_0xc1a924[_0xb8b2('0x50')]*_0x377af1)-_0xc1a924['originated']-_0xc1a924[_0xb8b2('0xc1')];emitVoiceQueueSummary(_0xc1a924);if(_0xc1a924['dialLimitQueue']>0x0){var _0xaa3867=_0xc1a924[_0xb8b2('0x201')]-_0xc1a924[_0xb8b2('0x74')]-_0xc1a924[_0xb8b2('0x54')]-_0xc1a924['temp']-_0xc1a924[_0xb8b2('0x52')];if(_0x39f298>_0xaa3867){_0x39f298=_0xaa3867;}}if(_0x39f298>0x0){if(_0xc1a924[_0xb8b2('0x5a')]===_0xb8b2('0x9')){_0x39f298=0x1;}if(_0x39f298>this[_0xb8b2('0x22')]){_0x39f298=this['maxNumberOriginate'];}_0xc1a924['temp']+=_0x39f298;for(var _0x21811d in this[_0xb8b2('0x20')]){if(typeof this[_0xb8b2('0x20')][_0x21811d]!==_0xb8b2('0xa9')){if(this['agents'][_0x21811d][_0xb8b2('0xa3')]===_0xb8b2('0x202')&&this[_0xb8b2('0x20')][_0x21811d][_0xb8b2('0xab')]===_0xb8b2('0x203')){_0x41da7d['push'](this[_0xb8b2('0x20')][_0x21811d]['id']);}}}this[_0xb8b2('0xc0')](_0xc1a924['id'],_0x41da7d,_0x39f298,_0xc1a924[_0xb8b2('0x1fa')],_0xc1a924)[_0xb8b2('0xb4')](function(_0x1504f5){_0xc1a924[_0xb8b2('0xc1')]-=_0x39f298;_0xc1a924[_0xb8b2('0xc1')]=_0xc1a924[_0xb8b2('0xc1')]>0x0?_0xc1a924[_0xb8b2('0xc1')]:0x0;if(!checkContactEmpty(_0x1504f5)){_0x2975e5[_0xb8b2('0xb2')](_0xc1a924)[_0xb8b2('0xb4')](sendMessageReschedule(_0xc1a924))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xb5')));}else{_0xc1a924[_0xb8b2('0x74')]+=_0x1504f5['length'];_0xc1a924[_0xb8b2('0x3e')]=_0xc1a924[_0xb8b2('0x5a')]==='booked'?_0xb8b2('0x16d'):_0xb8b2('0x1fc');for(var _0x52e24=0x0;_0x52e24<_0x1504f5[_0xb8b2('0x147')];_0x52e24+=0x1){if(_[_0xb8b2('0xdc')](_0x1504f5[_0x52e24])||_[_0xb8b2('0xdc')](_0x1504f5[_0x52e24][_0xb8b2('0x166')])||_['isNil'](_0x1504f5[_0x52e24][_0xb8b2('0x166')]['phone'])){_0x2975e5[_0xb8b2('0xcc')](_0xb8b2('0x1fe'),_0xc1a924,_0x1504f5[_0x52e24]);}else{_0x2975e5[_0xb8b2('0xb6')](_['pick'](_0x1504f5[_0x52e24],['VoiceQueueId','Contact.phone']))[_0xb8b2('0xb4')](_0x2975e5['checkContactBlack'](_0xc1a924,_0x1504f5[_0x52e24]))[_0xb8b2('0xad')](_0x2975e5[_0xb8b2('0xcb')](_0xb8b2('0x1fe'),_0xc1a924));}}}})[_0xb8b2('0xad')](loggerGetContactDialer(_0xb8b2('0x204'),_0xc1a924,_0x39f298));}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x94')]=function(_0x2369d8){if(_0x2369d8[_0xb8b2('0x201')]>0x0){var _0x5af0a3=_0x2369d8[_0xb8b2('0x201')]-_0x2369d8[_0xb8b2('0x74')]-_0x2369d8['talking'];if(_0x5af0a3>0x0){this[_0xb8b2('0x205')](_0x2369d8);}else{loggerPredictiveCalls[_0xb8b2('0x82')](_0xb8b2('0x206'));}}else{this[_0xb8b2('0x205')](_0x2369d8);}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x205')]=function(_0x3a6273){var _0x34dd41=this;var _0x7a3382=[];_0x3a6273['originated']+=0x1;for(var _0x26755e in this[_0xb8b2('0x20')]){if(typeof this[_0xb8b2('0x20')][_0x26755e]!=='undefined'){if(this[_0xb8b2('0x20')][_0x26755e][_0xb8b2('0xa3')]===_0xb8b2('0x202')&&this[_0xb8b2('0x20')][_0x26755e][_0xb8b2('0xab')]===_0xb8b2('0x203')){_0x7a3382[_0xb8b2('0x129')](this['agents'][_0x26755e]['id']);}}}this['getContactDialer'](_0x3a6273['id'],_0x7a3382,0x1,_0x3a6273['dialOrderByScheduledAt'],_0x3a6273)[_0xb8b2('0xb4')](function(_0x149653){if(!checkContactEmpty(_0x149653)){checkContactLowerLimitOriginate(_0x3a6273,0x1,0x0);_0x34dd41[_0xb8b2('0xb2')](_0x3a6273)[_0xb8b2('0xb4')](sendMessageReschedule(_0x3a6273))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xb5')));}else{_0x3a6273[_0xb8b2('0x3e')]=_0xb8b2('0x1fc');if(_['isNil'](_0x149653[0x0])||_[_0xb8b2('0xdc')](_0x149653[0x0]['Contact'])||_[_0xb8b2('0xdc')](_0x149653[0x0][_0xb8b2('0x166')]['phone'])){_0x34dd41['emptyContact']('[actionOriginate]\x20',_0x3a6273,_0x149653[0x0]);}else{_0x34dd41['checkIsBlackList'](_['pick'](_0x149653[0x0],[_0xb8b2('0xd3'),_0xb8b2('0x1ff')]))[_0xb8b2('0xb4')](_0x34dd41[_0xb8b2('0x1e4')](_0x3a6273,_0x149653[0x0]))[_0xb8b2('0xad')](_0x34dd41[_0xb8b2('0xcb')](_0xb8b2('0x207'),_0x3a6273));}}})[_0xb8b2('0xad')](loggerGetContactDialer(_0xb8b2('0x208'),_0x3a6273,0x1));emitVoiceQueueSummary(_0x3a6273);};Dialer[_0xb8b2('0x19')][_0xb8b2('0x1da')]=function(_0x454d66,_0x1336f3,_0x4b1b0c,_0x18052b,_0x5cafb5,_0x3aeca9){loggerPredictive[_0xb8b2('0x82')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xb8b2('0x82')]('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',_0x454d66);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x209'),_0x1336f3);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x20a'),_0x4b1b0c);loggerPredictive[_0xb8b2('0x82')]('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',_0x18052b);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x20b'),_0x5cafb5);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x88'));return new BPromise(function(_0x4d6099,_0x215fc2){if(_0x454d66<=0x0||isNaN(_0x454d66)){return _0x215fc2(msgResponse(_0xb8b2('0x20c'),_0xb8b2('0x48'),_0xb8b2('0x20d')+_0x454d66));}if(_0x4b1b0c<=0x0||isNaN(_0x4b1b0c)){return _0x215fc2(msgResponse('[abandonmentRate]','Error',_0xb8b2('0x20e')+_0x4b1b0c));}if(_0x18052b<=0x0||isNaN(_0x18052b)){return _0x215fc2(msgResponse(_0xb8b2('0x20c'),_0xb8b2('0x48'),'p\x20=\x20'+_0x18052b));}if(_0x1336f3<=0x0||isNaN(_0x1336f3)){return _0x215fc2(msgResponse(_0xb8b2('0x20c'),_0xb8b2('0x48'),_0xb8b2('0x20f')+_0x1336f3));}if(_0x5cafb5<=0x0||isNaN(_0x5cafb5)){return _0x215fc2(msgResponse(_0xb8b2('0x20c'),'Error',_0xb8b2('0x210')+_0x5cafb5));}_0x3aeca9=_0x3aeca9||0x0;var _0xfc876f=0x1/_0x4b1b0c;var _0x37bc7a=0x0;var _0x475b9a=0x0;var _0x374206=0x0;var _0x384999=0x0;for(var _0x4f811f=0x0;_0x374206<_0x5cafb5;_0x4f811f+=0x1){_0x475b9a=_0x4f811f/_0x1336f3;_0x37bc7a=(_0x18052b*_0x475b9a+_0x3aeca9)/_0xfc876f;_0x374206=erlangb(_0x37bc7a,_0x454d66);_0x384999=_0x37bc7a/_0x454d66*(0x1-erlangb(_0x37bc7a,_0x454d66));}return _0x4d6099({'erlangCalls':_0x4f811f,'erlangCallToSecond':_0x1336f3/_0x4f811f,'erlangAbandonmentRate':_0x374206,'erlangBusyFactor':_0x384999});});};Dialer[_0xb8b2('0x19')][_0xb8b2('0x1dc')]=function(_0x3d9293,_0x40a0fd,_0xb72c3b,_0x445b9d,_0x1564fc,_0x2b2688){loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x211'));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',_0x3d9293);loggerPredictive[_0xb8b2('0x82')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40a0fd);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x20a'),_0xb72c3b);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x212'),_0x445b9d);loggerPredictive[_0xb8b2('0x82')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1564fc);loggerPredictive['info'](_0xb8b2('0x88'));return new BPromise(function(_0x2d3da9,_0x48230d){if(_0x3d9293<=0x0||isNaN(_0x3d9293)){return _0x48230d(msgResponse('[busyFactor]',_0xb8b2('0x48'),_0xb8b2('0x20d')+_0x3d9293));}if(_0xb72c3b<=0x0||isNaN(_0xb72c3b)){return _0x48230d(msgResponse(_0xb8b2('0x213'),_0xb8b2('0x48'),_0xb8b2('0x20e')+_0xb72c3b));}if(_0x445b9d<=0x0||isNaN(_0x445b9d)){return _0x48230d(msgResponse(_0xb8b2('0x213'),_0xb8b2('0x48'),_0xb8b2('0x214')+_0x445b9d));}if(_0x40a0fd<=0x0||isNaN(_0x40a0fd)){return _0x48230d(msgResponse(_0xb8b2('0x213'),'Error','interval\x20=\x20'+_0x40a0fd));}if(_0x1564fc<=0x0||isNaN(_0x1564fc)){return _0x48230d(msgResponse(_0xb8b2('0x213'),_0xb8b2('0x48'),_0xb8b2('0x215')+_0x1564fc));}_0x2b2688=_0x2b2688||0x0;var _0x560927=0x1/_0xb72c3b;var _0xf1eebd=0x0;var _0x5d9b30=0x0;var _0x29e963=0x0;var _0x120ef0=0x0;for(var _0x4babc8=0x0;_0x120ef0<_0x1564fc;_0x4babc8+=0x1){_0x5d9b30=_0x4babc8/_0x40a0fd;_0xf1eebd=(_0x445b9d*_0x5d9b30+_0x2b2688)/_0x560927;_0x29e963=erlangb(_0xf1eebd,_0x3d9293);_0x120ef0=_0xf1eebd/_0x3d9293*(0x1-erlangb(_0xf1eebd,_0x3d9293));}return _0x2d3da9({'erlangCalls':_0x4babc8,'erlangCallToSecond':_0x40a0fd/_0x4babc8,'erlangAbandonmentRate':_0x29e963,'erlangBusyFactor':_0x120ef0});});};module[_0xb8b2('0x216')]=Dialer;
\ No newline at end of file
+var _0xd49c=['\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startProgressive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','---------------------------','merge','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','pTalking','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','clearZombieChannels','[uniqueid]','isNil','Action','status','channel','ivr','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','notFound','saveInDb','pick','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','HANGUP','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','dialAMDActive','value','MACHINE','outboundAnswerAgiCallsDay','Machine','custom:amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','countmachineretry','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr]','countglobal','countbusyretry','countnosuchnumberretry','createStateFinal','add','minutes','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','dialQueueProject','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','Drop','starttime','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','predictiveIntervalDroppedCallsCallersExit','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','Abandoned','[syncAgentComplete][createHistory][11]','roundrobin','actionid','paused','stateinterface','locked','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','true','push','content','indexOf','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','handleIvr','loggedIn','checkIfTime','dialGlobalInterval','dialTimezone','[syncQueueSummary]','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','custom:agentnosuchnumber','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','checkRetriveMax','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','busy','reason\x205\x20busy','Congestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','dialPredictiveInterval','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(','predictiveIntervalAnsweredCalls','dialPredictiveOptimizationPercentage','abandonmentRate','Unknown\x20Predictive','[getDataPredictive]','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','busyFactor','check\x20failure','floor','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Error','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','lodash','uuid','moment','ioredis','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','prototype','enqueue','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','bind','syncAgentComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xd49c,0x1d8));var _0xcd49=function(_0x5180ca,_0x570374){_0x5180ca=_0x5180ca-0x0;var _0x30c3e1=_0xd49c[_0x5180ca];return _0x30c3e1;};'use strict';var util=require('util');var _=require(_0xcd49('0x0'));var BPromise=require('bluebird');var uuid=require(_0xcd49('0x1'));var moment=require(_0xcd49('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xcd49('0x3'));var ut=require('../preview/util/util');var config=require(_0xcd49('0x4'));var logger=require('../../../config/logger')(_0xcd49('0x5'));var loggerBooked=require(_0xcd49('0x6'))(_0xcd49('0x7'));var loggerPredictive=require(_0xcd49('0x6'))(_0xcd49('0x8'));var loggerPredictiveCalls=require(_0xcd49('0x6'))(_0xcd49('0x9'));var loggerSyncQueueSummary=require(_0xcd49('0x6'))(_0xcd49('0xa'));var ami=require(_0xcd49('0xb'));config[_0xcd49('0xc')]=_['defaults'](config[_0xcd49('0xc')],{'host':_0xcd49('0xd'),'port':0x18eb});var io=require(_0xcd49('0xe'))(new Redis(config[_0xcd49('0xc')]));var cmHopper=require(_0xcd49('0xf'));var cmHopperHistory=require(_0xcd49('0x10'));var cmHopperBlack=require(_0xcd49('0x11'));var voiceQueueRt=require(_0xcd49('0x12'));var Action=require(_0xcd49('0x13'));var History=require(_0xcd49('0x14'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xcd49('0x15'));var Hangup=require(_0xcd49('0x16'));var ipAgi=process[_0xcd49('0x17')]['XCALLY_IP_AGI']||_0xcd49('0x18');var strategy={'rrmemory':_0xcd49('0x19'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0xcd49('0x1a')][_0xcd49('0x1b')]=function(_0x3d0637){this[_0xcd49('0x1c')]=this[_0xcd49('0x1c')]?this[_0xcd49('0x1c')]['finally'](_0x3d0637):_0x3d0637();};function Dialer(_0x4b090e,_0x56db62){this['sequence']=new Sequence();this[_0xcd49('0x1d')]=_0x56db62;this[_0xcd49('0x1e')]=_0x4b090e[_0xcd49('0x1e')];this['campaigns']=_0x4b090e[_0xcd49('0x1f')];this[_0xcd49('0x20')]=_0x4b090e[_0xcd49('0x20')];this['trunks']=_0x4b090e[_0xcd49('0x21')];this[_0xcd49('0x22')]=config[_0xcd49('0x22')]||0x2;this[_0xcd49('0x23')]={};this[_0xcd49('0x24')]={};this[_0xcd49('0x25')]={};this[_0xcd49('0x26')]={};this[_0xcd49('0x27')]={};this[_0xcd49('0x28')]={};this['startProgressive']={};this[_0xcd49('0x29')]={};this[_0xcd49('0x2a')]={};this[_0xcd49('0x2b')]={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0xcd49('0x2c'),this[_0xcd49('0x2d')]['bind'](this));ami['on'](_0xcd49('0x2e'),this[_0xcd49('0x2f')][_0xcd49('0x30')](this));ami['on']('agentcomplete',this[_0xcd49('0x31')][_0xcd49('0x30')](this));ami['on']('custom:queuesummary',this[_0xcd49('0xa')][_0xcd49('0x30')](this));ami['on']('hangup',this[_0xcd49('0x32')][_0xcd49('0x30')](this));ami['on'](_0xcd49('0x33'),this[_0xcd49('0x34')][_0xcd49('0x30')](this));ami['on'](_0xcd49('0x35'),this[_0xcd49('0x36')][_0xcd49('0x30')](this));ami['on'](_0xcd49('0x37'),this[_0xcd49('0x38')][_0xcd49('0x30')](this));ami['on']('queuestatuscomplete',this[_0xcd49('0x39')]['bind'](this));this[_0xcd49('0x3a')]();this[_0xcd49('0x3b')]();}function isNotNull(_0x5a43cb){return _0x5a43cb!==null&&!_[_0xcd49('0x3c')](_0x5a43cb);}function checkIsLoggedIn(_0x1c8de7,_0x5a5603){return function(){if(_0x5a5603<=0x0){_0x1c8de7[_0xcd49('0x3d')]=_0xcd49('0x3e');throw _0x1c8de7[_0xcd49('0x3f')]+_0xcd49('0x40');}};}function isActive(_0x3aa203){return _0x3aa203;}function checkIsActive(_0x431f5e,_0x497f35){return function(){if(!isActive(_0x497f35)){_0x431f5e['message']=_0xcd49('0x41');throw _0x431f5e[_0xcd49('0x3f')]+_0xcd49('0x42');}};}function checkInterval(_0xfee4a8){return function(){if(!isNotNull(_0xfee4a8[_0xcd49('0x43')])){_0xfee4a8[_0xcd49('0x3d')]=_0xcd49('0x44');throw _0xfee4a8[_0xcd49('0x3f')]+_0xcd49('0x45');}if(!isNotNull(_0xfee4a8[_0xcd49('0x43')][_0xcd49('0x46')])){_0xfee4a8[_0xcd49('0x3d')]=_0xcd49('0x44');throw _0xfee4a8['name']+_0xcd49('0x45');}if(!isNotNull(_[_0xcd49('0x47')](_0xfee4a8['Interval']['Intervals']))){_0xfee4a8[_0xcd49('0x3d')]=_0xcd49('0x44');throw _0xfee4a8['name']+_0xcd49('0x45');}};}function msgResponse(_0x32156e,_0x435d75,_0x233e66){return{'action':_0x32156e,'response':_0x435d75,'message':_0x233e66,'stack':_0x233e66};}function myreject(_0xb267b6){return function(_0x3e4611){return _0xb267b6(msgResponse(_0xcd49('0x48'),'Error',JSON[_0xcd49('0x49')](_0x3e4611)));};}function getSeconds(_0x42be87,_0x462238){var _0x2b17b0=moment(_0x42be87)[_0xcd49('0x4a')](0x0);var _0x4764b5=moment(_0x462238)['milliseconds'](0x0);return _0x2b17b0[_0xcd49('0x4b')](_0x4764b5,_0xcd49('0x4c'));}function emit(_0x2aead0,_0x592599,_0x14397b){io['to'](_0x2aead0)[_0xcd49('0x4d')](_0x592599,_0x14397b);}function emitVoiceQueueSummary(_0x1893c6){if(_0x1893c6[_0xcd49('0x4e')]===_0xcd49('0x4f')){var _0x2e4e18={'id':_0x1893c6['id'],'name':_0x1893c6[_0xcd49('0x3f')],'strategy':_0x1893c6[_0xcd49('0x50')],'answered':_0x1893c6[_0xcd49('0x51')],'available':_0x1893c6[_0xcd49('0x52')],'loggedIn':_0x1893c6['loggedIn'],'pTalking':_0x1893c6['pTalking'],'sumBillable':_0x1893c6[_0xcd49('0x53')],'sumDuration':_0x1893c6[_0xcd49('0x54')],'sumHoldTime':_0x1893c6[_0xcd49('0x55')]||0x0,'talking':_0x1893c6[_0xcd49('0x56')],'total':_0x1893c6[_0xcd49('0x57')],'type':_0x1893c6['type'],'unmanaged':_0x1893c6[_0xcd49('0x58')],'abandoned':_0x1893c6[_0xcd49('0x59')],'waiting':_0x1893c6['waiting'],'loggedInDb':_0x1893c6[_0xcd49('0x5a')],'dialActive':_0x1893c6[_0xcd49('0x5b')],'dialMethod':_0x1893c6[_0xcd49('0x5c')],'dialOriginateCallerIdName':_0x1893c6[_0xcd49('0x5d')],'dialOriginateCallerIdNumber':_0x1893c6[_0xcd49('0x5e')],'dialOriginateTimeout':_0x1893c6[_0xcd49('0x5f')],'dialPrefix':_0x1893c6[_0xcd49('0x60')],'outboundAnswerAgiCallsDay':_0x1893c6['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1893c6[_0xcd49('0x61')],'outboundBlacklistCallsDay':_0x1893c6['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x1893c6[_0xcd49('0x62')],'outboundCongestionCallsDay':_0x1893c6[_0xcd49('0x63')],'outboundDropCallsDayACS':_0x1893c6['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1893c6[_0xcd49('0x64')],'outboundDropCallsDayTimeout':_0x1893c6[_0xcd49('0x65')],'outboundNoAnswerCallsDay':_0x1893c6['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1893c6[_0xcd49('0x66')],'outboundOriginateFailureCallsDay':_0x1893c6['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1893c6[_0xcd49('0x67')],'outboundRejectCallsDay':_0x1893c6[_0xcd49('0x68')],'outboundUnknownCallsDay':_0x1893c6[_0xcd49('0x69')],'predictiveIntervalAnsweredCalls':_0x1893c6['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1893c6[_0xcd49('0x6a')],'predictiveIntervalAvgTalktime':_0x1893c6['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1893c6['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1893c6[_0xcd49('0x6b')],'predictiveIntervalErlangCalls':_0x1893c6[_0xcd49('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x1893c6['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1893c6[_0xcd49('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x1893c6[_0xcd49('0x6e')],'predictiveIntervalPauses':_0x1893c6[_0xcd49('0x6f')],'predictiveIntervalAvailable':_0x1893c6[_0xcd49('0x70')],'predictiveIntervalTotalCalls':_0x1893c6[_0xcd49('0x71')],'message':_0x1893c6['message'],'originated':_0x1893c6[_0xcd49('0x72')],'erlangCalls':_0x1893c6[_0xcd49('0x73')],'erlangCallToSecond':_0x1893c6[_0xcd49('0x74')],'erlangAbandonmentRate':_0x1893c6[_0xcd49('0x75')],'erlangBusyFactor':_0x1893c6['erlangBusyFactor'],'startPredictive':_0x1893c6[_0xcd49('0x28')],'startProgressive':_0x1893c6[_0xcd49('0x76')]};if(_0x1893c6[_0xcd49('0x77')]){_0x2e4e18[_0xcd49('0x77')]={'id':_0x1893c6[_0xcd49('0x77')]['id'],'name':_0x1893c6[_0xcd49('0x77')][_0xcd49('0x3f')],'active':_0x1893c6[_0xcd49('0x77')][_0xcd49('0x78')],'callerid':_0x1893c6['Trunk'][_0xcd49('0x79')]};}if(_0x1893c6['Interval']){_0x2e4e18[_0xcd49('0x43')]={'id':_0x1893c6[_0xcd49('0x43')]['id'],'name':_0x1893c6[_0xcd49('0x43')][_0xcd49('0x3f')]};}var _0x268cc1=md5(JSON['stringify'](_0x2e4e18));if(_0x1893c6['md5']!==_0x268cc1){_0x1893c6['md5']=_0x268cc1;emit(util[_0xcd49('0x7a')](_0xcd49('0x7b'),_0x2e4e18['name']),_0xcd49('0x7c'),_0x2e4e18);}}}function emitCampaignSummary(_0x2d109e){if(_0x2d109e[_0xcd49('0x4e')]==='ivr'){emit(util['format'](_0xcd49('0x7d'),_0x2d109e['name']),_0xcd49('0x7e'),_0x2d109e);}}function checkGetDataPredictive(_0x26da47){if(isNotNull(_0x26da47)&&!_[_0xcd49('0x47')](_0x26da47)){loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x80'));loggerPredictive['info'](_0xcd49('0x81'),_0x26da47[_0xcd49('0x71')]);loggerPredictive['info'](_0xcd49('0x82'),_0x26da47['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x83'),_0x26da47['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x84'),_0x26da47['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xcd49('0x7f')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x26da47[_0xcd49('0x6a')]);loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x85'),_0x26da47[_0xcd49('0x86')]);loggerPredictive['info']('---------------------------');if(_0x26da47[_0xcd49('0x71')]>0x0){if(!_[_0xcd49('0x3c')](_0x26da47[_0xcd49('0x86')])&&_0x26da47[_0xcd49('0x86')]>0x0){return!![];}loggerPredictive[_0xcd49('0x7f')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xcd49('0x3c')](_0x26da47['predictiveIntervalAvgHoldtime'])&&_0x26da47[_0xcd49('0x6a')]>0x0){return!![];}loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x87'));}else{loggerPredictive['info'](_0xcd49('0x88'));}}else{loggerPredictive['info'](_0xcd49('0x89'));}return![];}function mergeDataErlangB(_0x5dbcb8){return function(_0x50dc50){loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x8a'));loggerPredictive[_0xcd49('0x7f')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x50dc50[_0xcd49('0x73')]);loggerPredictive[_0xcd49('0x7f')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x50dc50['erlangCallToSecond']);loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x8b'),_0x50dc50[_0xcd49('0x75')]);loggerPredictive[_0xcd49('0x7f')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x50dc50[_0xcd49('0x8c')]);loggerPredictive[_0xcd49('0x7f')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x50dc50[_0xcd49('0x75')]);loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x8d'));_[_0xcd49('0x8e')](_0x5dbcb8,_0x50dc50);};}function getDiff(_0x14d14e){var _0x4ddff0=moment()[_0xcd49('0x4a')](0x0);var _0x107025=moment(_0x14d14e)[_0xcd49('0x4a')](0x0);return _0x4ddff0[_0xcd49('0x4b')](_0x107025,_0xcd49('0x4c'));}function ifInterval(_0x32c374,_0x4c052a){if(_[_0xcd49('0x3c')](_0x4c052a)){return![];}return getDiff(_0x4c052a)<_0x32c374*0x3c;}function freeVariablesPredictive(_0xd0b60f){if(isNotNull(_0xd0b60f)){if(!_['isUndefined'](_0xd0b60f[_0xcd49('0x76')])){_0xd0b60f['startProgressive']=undefined;loggerPredictive[_0xcd49('0x7f')](_0xd0b60f[_0xcd49('0x3f')],_0xcd49('0x8f'));}if(!_['isUndefined'](_0xd0b60f[_0xcd49('0x28')])){_0xd0b60f[_0xcd49('0x28')]=undefined;loggerPredictive['info'](_0xd0b60f[_0xcd49('0x3f')],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0xd0b60f[_0xcd49('0x90')])){clearInterval(_0xd0b60f[_0xcd49('0x90')]);_0xd0b60f[_0xcd49('0x90')]=undefined;loggerPredictive[_0xcd49('0x7f')](_0xd0b60f[_0xcd49('0x3f')],_0xcd49('0x91'));}}}function erlangb(_0x368c15,_0x506a75){if(_0x506a75===0x0){return 0x0;}var _0x39d6be=0x1;for(var _0x28836d=0x1;_0x28836d<=_0x506a75;_0x28836d+=0x1){_0x39d6be=0x1+_0x39d6be*_0x28836d/_0x368c15;}return 0x1/_0x39d6be;}function isVoiceQueueOutbound(_0x2c9584){return _0x2c9584==='outbound';}function isNotPreview(_0x474899){return _0x474899!=='preview';}function isCampaignIvr(_0x3ed8e3){return _0x3ed8e3==='ivr';}function getCallerId(_0x362386,_0x5d0be0,_0x4633ce){if(!_[_0xcd49('0x3c')](_0x4633ce)&&typeof _0x4633ce===_0xcd49('0x92')&&!_[_0xcd49('0x47')](_0x4633ce)){if(!_[_0xcd49('0x3c')](_0x5d0be0)&&typeof _0x5d0be0==='string'&&!_['isEmpty'](_0x5d0be0)){return util[_0xcd49('0x7a')](_0xcd49('0x93'),_0x5d0be0,_0x4633ce);}return util['format'](_0xcd49('0x93'),_0x4633ce,_0x4633ce);}if(!_[_0xcd49('0x3c')](_0x362386)&&typeof _0x362386==='string'&&!_[_0xcd49('0x47')](_0x362386)){return _0x362386;}return _0xcd49('0x94');}function loggerCatchQueueSummary(_0x3aec00,_0x50f8a6){return function(_0x362e13){freeVariablesPredictive(_0x50f8a6);emitVoiceQueueSummary(_0x50f8a6);emitCampaignSummary(_0x50f8a6);loggerSyncQueueSummary[_0xcd49('0x95')](_0x3aec00,util[_0xcd49('0x96')](_0x362e13,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5efe18,_0x3626a4){return function(_0x222da2){loggerPredictive[_0xcd49('0x95')](_0x3626a4[_0xcd49('0x3f')],_0x5efe18);loggerPredictive[_0xcd49('0x95')](_0x222da2[_0xcd49('0x97')]);freeVariablesPredictive(_0x3626a4);};}function loggerCatch(_0xd144ce){return function(_0x3a59fd){logger[_0xcd49('0x95')](_0xd144ce,util['inspect'](_0x3a59fd,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x448d46){return _0x448d46&&!_[_0xcd49('0x3c')](_0x448d46)&&_0x448d46[_0xcd49('0x98')]>0x0;}function decremetOriginate(_0x463209){if(!_[_0xcd49('0x3c')](_0x463209)&&_0x463209!==null){if(typeof _0x463209[_0xcd49('0x72')]!==_0xcd49('0x99')){if(_0x463209['originated']>0x0){_0x463209[_0xcd49('0x72')]-=0x1;}else{logger[_0xcd49('0x95')](_0xcd49('0x9a'));}}}else{logger['error'](_0xcd49('0x9b'));}}function checkContactLowerLimitOriginate(_0x20378d,_0x326e30,_0x535c30){if(_0x326e30>_0x535c30){for(var _0x4543df=0x0;_0x4543df<_0x326e30-_0x535c30;_0x4543df+=0x1){decremetOriginate(_0x20378d);}}}function loggerGetContactDialer(_0x403cab,_0x209e23,_0x518f38){return function(_0x5f1f98){checkContactLowerLimitOriginate(_0x209e23,_0x518f38,0x0);logger['error'](_0x403cab,util['inspect'](_0x5f1f98,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1184ca){return function(_0x3995ed){if(isNotNull(_0x3995ed)&&isNotNull(_0x3995ed[0x0])){if(_0x3995ed[0x0]['contactsRescheduled']>0x0){_0x1184ca[_0xcd49('0x3d')]=_0xcd49('0x9c');logger[_0xcd49('0x7f')](_0xcd49('0x9d')+_0x1184ca[_0xcd49('0x3f')],_0x3995ed[0x0][_0xcd49('0x9e')],'contacts');}else{_0x1184ca[_0xcd49('0x3d')]=_0xcd49('0x9f');logger[_0xcd49('0x7f')](_0xcd49('0xa0')+_0x1184ca[_0xcd49('0x3f')]);}}};}function notSendMessagesQueue(_0x3e8954){if(_0x3e8954[_0xcd49('0xa1')]){freeVariablesPredictive(_0x3e8954);if(_0x3e8954[_0xcd49('0x72')]===0x0&&_0x3e8954[_0xcd49('0x56')]===0x0&&_0x3e8954[_0xcd49('0xa2')]===0x0&&(_0x3e8954[_0xcd49('0xa3')]||0x0)===0x0){_0x3e8954[_0xcd49('0xa1')]=![];_0x3e8954[_0xcd49('0x52')]=0x0;_0x3e8954[_0xcd49('0x3d')]=_0xcd49('0x41');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x3e8954[_0xcd49('0x3f')],_0xcd49('0xa4'));}else{_0x3e8954[_0xcd49('0x3d')]=_0xcd49('0xa5');loggerSyncQueueSummary['error'](_0xcd49('0xa6'),_0x3e8954['name'],_0xcd49('0xa7'));}emitVoiceQueueSummary(_0x3e8954);}}function notSendMessagesCampaign(_0x2a03c2){if(_0x2a03c2['sendMessageOneNotActive']){if(_0x2a03c2[_0xcd49('0x72')]===0x0){_0x2a03c2['sendMessageOneNotActive']=![];_0x2a03c2[_0xcd49('0x3d')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0xcd49('0xa8'),_0x2a03c2[_0xcd49('0x3f')],_0xcd49('0xa4'));}else{_0x2a03c2[_0xcd49('0x3d')]=_0xcd49('0xa5');loggerSyncQueueSummary[_0xcd49('0x95')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2a03c2[_0xcd49('0x3f')],_0xcd49('0xa7'));}emitCampaignSummary(_0x2a03c2);}}function createObjHistory(_0x5b969b,_0x35745a,_0x9a2ccb,_0x15d6de,_0x459a5c){_0x5b969b['message']=_0x9a2ccb;var _0x507f23=new Action(_0x5b969b,_0x35745a);var _0x737c24=new History(_0x507f23);_0x737c24[_0xcd49('0xa9')]=_0x15d6de;_0x737c24[_0xcd49('0xaa')]=_0x459a5c;_0x737c24['endtime']=_0x507f23['starttime'];return _0x737c24;}Dialer[_0xcd49('0x1a')]['loopClearZombieChannels']=function(){var _0x4c19c5=this;setInterval(function(){_0x4c19c5[_0xcd49('0xab')](_0x4c19c5[_0xcd49('0x26')],_0xcd49('0xac'));_0x4c19c5[_0xcd49('0xab')](_0x4c19c5[_0xcd49('0x24')],'[actions]');},0x32c8);};Dialer[_0xcd49('0x1a')]['clearZombieChannels']=function(_0x18e590,_0x4d1aee){var _0xe3a369=this;for(var _0x14915b in _0x18e590){if(typeof _0x18e590[_0x14915b]!==_0xcd49('0x99')){this['sequence']['enqueue'](function(){if(!_[_0xcd49('0xad')](_0x18e590[_0x14915b])){return ami[_0xcd49('0xae')]({'action':_0xcd49('0xaf'),'channel':_0x18e590[_0x14915b][_0xcd49('0xb0')]})['catch'](function(_0x3e465f){if(_0x3e465f[_0xcd49('0x3d')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x18e590[_0x14915b]&&_0x18e590[_0x14915b]['type']!==_0xcd49('0xb1')){_0xe3a369[_0xcd49('0xb2')](_0xe3a369[_0xcd49('0x1e')][_0x18e590[_0x14915b][_0xcd49('0xb3')]]);logger[_0xcd49('0x95')](_0xcd49('0xb4'),_0x4d1aee,_0x14915b,_0x18e590[_0x14915b]['queue']);delete _0x18e590[_0x14915b];}if(_0x18e590[_0x14915b]&&_0x18e590[_0x14915b][_0xcd49('0x4e')]==='ivr'){_0xe3a369[_0xcd49('0xb2')](_0xe3a369['campaigns'][_0x18e590[_0x14915b][_0xcd49('0xb3')]]);logger[_0xcd49('0x95')](_0xcd49('0xb5'),_0x4d1aee,_0x14915b,_0x18e590[_0x14915b][_0xcd49('0xb3')]);delete _0x18e590[_0x14915b];}},0x2328);}});}});}}};Dialer[_0xcd49('0x1a')][_0xcd49('0xb6')]=function(_0x354997){return BPromise[_0xcd49('0xb7')]()[_0xcd49('0xb8')](cmHopper[_0xcd49('0xb6')](_0x354997))[_0xcd49('0xb9')](loggerCatch(_0xcd49('0xba')));};Dialer[_0xcd49('0x1a')][_0xcd49('0xbb')]=function(_0x415b96){return BPromise[_0xcd49('0xb7')]()[_0xcd49('0xb8')](cmHopperBlack[_0xcd49('0xbb')](_0x415b96))[_0xcd49('0xb9')](loggerCatch('[checkIsBlackList]\x20'));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x2d9fb7){return BPromise[_0xcd49('0xb7')]()[_0xcd49('0xb8')](cmHopperBlack['checkIsBlackListIvr'](_0x2d9fb7))[_0xcd49('0xb9')](loggerCatch(_0xcd49('0xbc')));};Dialer[_0xcd49('0x1a')][_0xcd49('0xbd')]=function(_0x119e5a){return BPromise[_0xcd49('0xb7')]()[_0xcd49('0xb8')](cmHopperHistory['avgHandleTime'](_0x119e5a))[_0xcd49('0xb9')](loggerCatch(_0xcd49('0xbe')));};Dialer[_0xcd49('0x1a')][_0xcd49('0xbf')]=function(_0x4f3bfc){return BPromise[_0xcd49('0xb7')]()['then'](cmHopper[_0xcd49('0xbf')](_0x4f3bfc))[_0xcd49('0xb9')](loggerCatch(_0xcd49('0xc0')));};Dialer[_0xcd49('0x1a')][_0xcd49('0xc1')]=function(_0x20e560,_0x4ee386,_0xd75d82){return BPromise[_0xcd49('0xb7')]()[_0xcd49('0xb8')](cmHopper['unlockContact'](_0x20e560,_0x4ee386,_0xd75d82))[_0xcd49('0xb9')](loggerCatch(_0xcd49('0xc2')));};Dialer[_0xcd49('0x1a')][_0xcd49('0xc3')]=function(_0x1f7085,_0x5a7461,_0x4cb928,_0x1b7a6b,_0x4583cb){return BPromise[_0xcd49('0xb7')]()['then'](cmHopper['getContactDialer'](_0x1f7085,_0x5a7461,_0x4cb928,_0x1b7a6b))[_0xcd49('0xb9')](function(_0x45497){_0x4583cb[_0xcd49('0xc4')]-=_0x4cb928;_0x4583cb['temp']=_0x4583cb[_0xcd49('0xc4')]>0x0?_0x4583cb[_0xcd49('0xc4')]:0x0;loggerCatch(_0xcd49('0xc5'))(_0x45497);});};Dialer[_0xcd49('0x1a')]['getContactDialerIvr']=function(_0x1a0665,_0x34f88e,_0x53b2fb,_0x31338d){return BPromise[_0xcd49('0xb7')]()[_0xcd49('0xb8')](cmHopper[_0xcd49('0xc6')](_0x1a0665,_0x34f88e,_0x53b2fb))[_0xcd49('0xb9')](function(_0x5e24a9){_0x31338d[_0xcd49('0xc4')]-=_0x34f88e;_0x31338d[_0xcd49('0xc4')]=_0x31338d[_0xcd49('0xc4')]>0x0?_0x31338d['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x5e24a9);});};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x1e1245){return BPromise['resolve']()['then'](voiceQueueRt[_0xcd49('0xc7')](_0x1e1245))['catch'](loggerCatch(_0xcd49('0xc8')));};Dialer[_0xcd49('0x1a')][_0xcd49('0xc9')]=function(_0xe07e84){return BPromise[_0xcd49('0xb7')]()[_0xcd49('0xb8')](cmHopper['moveContactManagedDialer'](_0xe07e84))[_0xcd49('0xb9')](loggerCatch(_0xcd49('0xca')));};Dialer['prototype'][_0xcd49('0xcb')]=function(_0x3adda1){return BPromise[_0xcd49('0xb7')]()[_0xcd49('0xb8')](cmHopperHistory['createHistory'](_0x3adda1))[_0xcd49('0xb9')](loggerCatch(_0xcd49('0xcc')));};Dialer[_0xcd49('0x1a')][_0xcd49('0xb2')]=function(_0x139dd7){if(!_[_0xcd49('0x3c')](_0x139dd7)&&_0x139dd7!==null){if(typeof _0x139dd7['originated']!=='undefined'){if(_0x139dd7['originated']>0x0){_0x139dd7[_0xcd49('0x72')]-=0x1;}else{logger[_0xcd49('0x95')](_0xcd49('0xcd'));}}}else{logger[_0xcd49('0x95')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xcd49('0x1a')][_0xcd49('0xce')]=function(_0x4753e8,_0x5430f0){var _0x3d6e58=this;return function(_0x51dd63){_0x3d6e58['updateOriginated'](_0x5430f0);logger[_0xcd49('0x95')](_0x4753e8,util[_0xcd49('0x96')](_0x51dd63,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x251357,_0x229607,_0x5e465b){var _0x28d207={'state':0x19,'statedesc':_0xcd49('0xcf')};this['updateOriginated'](_0x229607);this[_0xcd49('0xd0')](_[_0xcd49('0x8e')](_0x28d207,_[_0xcd49('0xd1')](_0x5e465b,[_0xcd49('0xd2'),_0xcd49('0xd3'),_0xcd49('0xd4'),'VoiceQueueId',_0xcd49('0xd5')])),_0xcd49('0xd6'),_0xcd49('0xd7'));logger[_0xcd49('0x95')](_0x251357);};Dialer[_0xcd49('0x1a')][_0xcd49('0xd8')]=function(_0x16f019){return _0x16f019===_0xcd49('0xd9');};Dialer['prototype'][_0xcd49('0xda')]=function(_0x20d17e){return!_[_0xcd49('0x3c')](_0x20d17e)&&_0x20d17e&&!_[_0xcd49('0x3c')](_0x20d17e['name'])&&!_[_0xcd49('0x3c')](_0x20d17e[_0xcd49('0x78')])&&_0x20d17e['active']&&(this[_0xcd49('0x21')][util[_0xcd49('0x7a')](_0xcd49('0xdb'),_0x20d17e[_0xcd49('0x3f')])][_0xcd49('0xaf')]===_0xcd49('0xdc')||this[_0xcd49('0x21')][util[_0xcd49('0x7a')]('SIP/%s',_0x20d17e[_0xcd49('0x3f')])][_0xcd49('0xaf')]===_0xcd49('0xdd'));};Dialer[_0xcd49('0x1a')]['saveInDb']=function(_0x228051,_0x379395,_0x6c2c37){this[_0xcd49('0xcb')](_0x228051)[_0xcd49('0xb9')](loggerCatch(_0x379395));this[_0xcd49('0xc9')](_0x228051)[_0xcd49('0xb9')](loggerCatch(_0x6c2c37));};Dialer[_0xcd49('0x1a')]['syncVarSet']=function(_0x8c9b0b){var _0x5b69b6=this[_0xcd49('0x26')][_0x8c9b0b[_0xcd49('0xde')]];var _0x219e60;if(!_['isNil'](_0x8c9b0b)&&!_[_0xcd49('0xad')](_0x8c9b0b[_0xcd49('0xdf')])&&!_[_0xcd49('0xad')](_0x8c9b0b['variable'][_0xcd49('0xe0')])&&_0x8c9b0b[_0xcd49('0xe1')]==='xcally-motion-dialer'&&_0x5b69b6){if(_0x5b69b6['type']!=='ivr'&&this[_0xcd49('0x1e')][_0x5b69b6[_0xcd49('0xb3')]]['dialAMDActive']&&_0x8c9b0b['value']===_0xcd49('0xe2')){delete this['uniqueId'][_0x8c9b0b['uniqueid']];this[_0xcd49('0xb2')](this['voiceQueues'][_0x5b69b6[_0xcd49('0xb3')]]);this[_0xcd49('0x1e')][_0x5b69b6[_0xcd49('0xb3')]][_0xcd49('0x61')]+=0x1;this[_0xcd49('0x1e')][_0x5b69b6['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x219e60=new Hangup(_0x5b69b6,_0x8c9b0b);_0x219e60[_0xcd49('0xa9')]=0x12;_0x219e60[_0xcd49('0xaa')]='HangupInAMD';_0x219e60[_0xcd49('0xe3')]=_0xcd49('0xe4');ami[_0xcd49('0x4d')]('custom:amd',ut[_0xcd49('0xe5')](_0x219e60,_0xcd49('0xe6')));this['saveInDb'](_0x219e60,_0xcd49('0xe7'),'[syncHangupInAMD]');}if(_0x5b69b6[_0xcd49('0x4e')]!==_0xcd49('0xb1')&&this[_0xcd49('0x1e')][_0x5b69b6[_0xcd49('0xb3')]][_0xcd49('0xe8')]&&_0x8c9b0b[_0xcd49('0xe9')]===_0xcd49('0xea')){var _0x4911b4=this;return new BPromise(function(_0x21535d,_0x24f4ad){delete _0x4911b4['uniqueId'][_0x8c9b0b[_0xcd49('0xde')]];_0x4911b4[_0xcd49('0xb2')](_0x4911b4[_0xcd49('0x1e')][_0x5b69b6[_0xcd49('0xb3')]]);_0x4911b4['voiceQueues'][_0x5b69b6['queue']][_0xcd49('0x61')]+=0x1;_0x4911b4[_0xcd49('0x1e')][_0x5b69b6[_0xcd49('0xb3')]][_0xcd49('0xeb')]+=0x1;var _0x3e7084=_0x4911b4['voiceQueues'][_0x5b69b6['queue']];var _0x404de0=new Hangup(_0x5b69b6,_0x8c9b0b);_0x404de0[_0xcd49('0xa9')]=0x13;_0x404de0[_0xcd49('0xaa')]=_0xcd49('0xec');_0x404de0[_0xcd49('0xe3')]='AMD';_0x404de0['countmachineretry']+=0x1;_0x404de0['countglobal']+=0x1;_0x404de0[_0xcd49('0xe6')]=!![];ami['emit'](_0xcd49('0xed'),ut[_0xcd49('0xe5')](_0x404de0,_0xcd49('0xe6')));_0x4911b4[_0xcd49('0xcb')](_0x404de0)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0xee')));if(_0x404de0['countbusyretry']+_0x404de0[_0xcd49('0xef')]+_0x404de0[_0xcd49('0xf0')]+_0x404de0['countnosuchnumberretry']+_0x404de0[_0xcd49('0xf1')]+_0x404de0[_0xcd49('0xf2')]+_0x404de0['countmachineretry']+_0x404de0[_0xcd49('0xf3')]>=_0x3e7084[_0xcd49('0xf4')]){_0x4911b4[_0xcd49('0xf5')](_0x404de0,_0x21535d,_0x24f4ad,_0xcd49('0xf6'));}else{if(_0x404de0[_0xcd49('0xf7')]>=_0x3e7084[_0xcd49('0xf8')]){_0x4911b4['createStateFinal'](_0x404de0,_0x21535d,_0x24f4ad,_0xcd49('0xf9'));}else{_0x4911b4[_0xcd49('0xbf')]({'active':![],'countmachineretry':_0x404de0['countmachineretry'],'scheduledat':moment()['add'](_0x3e7084[_0xcd49('0xfa')],'minutes')[_0xcd49('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x404de0[_0xcd49('0xd2')],'ListId':_0x404de0['ListId'],'VoiceQueueId':_0x404de0['VoiceQueueId']||undefined,'CampaignId':_0x404de0['CampaignId']||undefined})[_0xcd49('0xb9')](loggerCatch(_0xcd49('0xfb')));_0x21535d({'reschedule':0x1});}}});}if(_0x5b69b6[_0xcd49('0x4e')]==='ivr'&&this[_0xcd49('0x1f')][_0x5b69b6[_0xcd49('0xb3')]][_0xcd49('0xe8')]&&_0x8c9b0b[_0xcd49('0xe9')]==='HANGUP'){delete this[_0xcd49('0x26')][_0x8c9b0b[_0xcd49('0xde')]];this[_0xcd49('0xb2')](this['campaigns'][_0x5b69b6[_0xcd49('0xb3')]]);_0x219e60=new Hangup(_0x5b69b6,_0x8c9b0b);_0x219e60[_0xcd49('0xa9')]=0x12;_0x219e60[_0xcd49('0xaa')]=_0xcd49('0xfc');_0x219e60[_0xcd49('0xe3')]=_0xcd49('0xe4');ami[_0xcd49('0x4d')](_0xcd49('0xed'),ut['buildObj'](_0x219e60,_0xcd49('0xe6')));this['saveInDb'](_0x219e60,'[syncHangupInAMDIvr][createHistory]',_0xcd49('0xfd'));}if(_0x5b69b6[_0xcd49('0x4e')]==='ivr'&&this[_0xcd49('0x1f')][_0x5b69b6[_0xcd49('0xb3')]][_0xcd49('0xe8')]&&_0x8c9b0b[_0xcd49('0xe9')]===_0xcd49('0xea')){var _0x4911b4=this;return new BPromise(function(_0x5ce972,_0xca0060){delete _0x4911b4[_0xcd49('0x26')][_0x8c9b0b['uniqueid']];_0x4911b4[_0xcd49('0xb2')](_0x4911b4[_0xcd49('0x1f')][_0x5b69b6[_0xcd49('0xb3')]]);_0x4911b4[_0xcd49('0x1f')][_0x5b69b6[_0xcd49('0xb3')]][_0xcd49('0x61')]+=0x1;_0x4911b4['campaigns'][_0x5b69b6[_0xcd49('0xb3')]][_0xcd49('0xeb')]+=0x1;var _0x51e11e=_0x4911b4['campaigns'][_0x5b69b6[_0xcd49('0xb3')]];var _0x2dc7f2=new Hangup(_0x5b69b6,_0x8c9b0b);_0x2dc7f2[_0xcd49('0xa9')]=0x13;_0x2dc7f2[_0xcd49('0xaa')]='Machine';_0x2dc7f2[_0xcd49('0xe3')]=_0xcd49('0xe4');_0x2dc7f2[_0xcd49('0xf7')]+=0x1;_0x2dc7f2[_0xcd49('0xfe')]+=0x1;_0x2dc7f2[_0xcd49('0xe6')]=!![];ami['emit'](_0xcd49('0xed'),ut[_0xcd49('0xe5')](_0x2dc7f2,_0xcd49('0xe6')));_0x4911b4[_0xcd49('0xcb')](_0x2dc7f2)['catch'](loggerCatch(_0xcd49('0xee')));if(_0x2dc7f2[_0xcd49('0xff')]+_0x2dc7f2[_0xcd49('0xef')]+_0x2dc7f2[_0xcd49('0xf0')]+_0x2dc7f2[_0xcd49('0x100')]+_0x2dc7f2['countdropretry']+_0x2dc7f2[_0xcd49('0xf2')]+_0x2dc7f2[_0xcd49('0xf7')]+_0x2dc7f2[_0xcd49('0xf3')]>=_0x51e11e['dialGlobalMaxRetry']){_0x4911b4[_0xcd49('0xf5')](_0x2dc7f2,_0x5ce972,_0xca0060,_0xcd49('0xf6'));}else{if(_0x2dc7f2[_0xcd49('0xf7')]>=_0x51e11e[_0xcd49('0xf8')]){_0x4911b4[_0xcd49('0x101')](_0x2dc7f2,_0x5ce972,_0xca0060,_0xcd49('0xf9'));}else{_0x4911b4[_0xcd49('0xbf')]({'active':![],'countmachineretry':_0x2dc7f2[_0xcd49('0xf7')],'scheduledat':moment()[_0xcd49('0x102')](_0x51e11e[_0xcd49('0xfa')],_0xcd49('0x103'))[_0xcd49('0x7a')](_0xcd49('0x104')),'ContactId':_0x2dc7f2[_0xcd49('0xd2')],'ListId':_0x2dc7f2['ListId'],'VoiceQueueId':_0x2dc7f2[_0xcd49('0x105')]||undefined,'CampaignId':_0x2dc7f2['CampaignId']||undefined})['catch'](loggerCatch(_0xcd49('0xfb')));_0x5ce972({'reschedule':0x1});}}});}}};Dialer[_0xcd49('0x1a')][_0xcd49('0x32')]=function(_0x4af5d7){var _0x1cff44=this[_0xcd49('0x26')][_0x4af5d7[_0xcd49('0xde')]];var _0x3bc4d1=this;var _0x4a74f9;if(_0x1cff44&&_0x1cff44[_0xcd49('0x4e')]===_0xcd49('0xb1')){delete this[_0xcd49('0x26')][_0x4af5d7['uniqueid']];this[_0xcd49('0xb2')](this[_0xcd49('0x1f')][_0x1cff44[_0xcd49('0xb3')]]);this[_0xcd49('0x1f')][_0x1cff44[_0xcd49('0xb3')]][_0xcd49('0x106')]+=0x1;_0x4a74f9=new Hangup(_0x1cff44,_0x4af5d7);this[_0xcd49('0xcb')](_0x4a74f9)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x107')));this['moveContactManagedDialer'](_0x4a74f9)['catch'](loggerCatch(_0xcd49('0x108')));}if(_0x1cff44&&_0x1cff44['type']!=='ivr'&&isNotNull(this[_0xcd49('0x1e')][_0x1cff44[_0xcd49('0xb3')]]['dialQueueProject'])){delete this[_0xcd49('0x26')][_0x4af5d7['uniqueid']];this[_0xcd49('0xb2')](this[_0xcd49('0x1e')][_0x1cff44[_0xcd49('0xb3')]]);this[_0xcd49('0x1e')][_0x1cff44[_0xcd49('0xb3')]]['outboundAnswerCallsDay']+=0x1;this[_0xcd49('0x1e')][_0x1cff44[_0xcd49('0xb3')]][_0xcd49('0xeb')]+=0x1;_0x4a74f9=new Hangup(_0x1cff44,_0x4af5d7);_0x4a74f9[_0xcd49('0xa9')]=0x10;_0x4a74f9[_0xcd49('0xaa')]=_0xcd49('0x109');_0x4a74f9[_0xcd49('0xe3')]='AGI';this[_0xcd49('0xcb')](_0x4a74f9)[_0xcd49('0xb9')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xcd49('0xc9')](_0x4a74f9)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x108')));}if(_0x1cff44&&_0x1cff44[_0xcd49('0x4e')]!=='ivr'&&!isNotNull(this[_0xcd49('0x1e')][_0x1cff44['queue']][_0xcd49('0x10a')])){delete this[_0xcd49('0x26')][_0x4af5d7[_0xcd49('0xde')]];this[_0xcd49('0xb2')](this[_0xcd49('0x1e')][_0x1cff44[_0xcd49('0xb3')]]);this[_0xcd49('0x1e')][_0x1cff44[_0xcd49('0xb3')]][_0xcd49('0x69')]+=0x1;_0x4a74f9=new Hangup(_0x1cff44,_0x4af5d7);_0x4a74f9[_0xcd49('0xa9')]=0xc;_0x4a74f9['statedesc']=_0x4af5d7[_0xcd49('0x10b')];_0x4a74f9[_0xcd49('0xe3')]=_0xcd49('0x10c');this[_0xcd49('0xcb')](_0x4a74f9)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x107')));this['moveContactManagedDialer'](_0x4a74f9)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x108')));}};Dialer['prototype']['syncAgentComplete']=function(_0x4e7e45){var _0x15c154=this[_0xcd49('0x26')][_0x4e7e45[_0xcd49('0xde')]];var _0x20725e=this;if(this[_0xcd49('0x1e')][_0x4e7e45['queue']]){if(_0x15c154&&_0x15c154[_0xcd49('0x4e')]!==_0xcd49('0xb1')){delete this[_0xcd49('0x26')][_0x4e7e45['uniqueid']];this['voiceQueues'][_0x4e7e45[_0xcd49('0xb3')]][_0xcd49('0x61')]+=0x1;var _0x1a5005=new AgentComplete(_0x15c154,_0x4e7e45);if(_0x4e7e45[_0xcd49('0x10d')]===_0xcd49('0x10e')){_0x1a5005[_0xcd49('0x10f')]=this[_0xcd49('0x1e')][_0x4e7e45[_0xcd49('0xb3')]][_0xcd49('0x110')]&&this[_0xcd49('0x1e')][_0x4e7e45['queue']][_0xcd49('0x111')]?moment()[_0xcd49('0x7a')](_0xcd49('0x104')):undefined;}this['createHistory'](_0x1a5005)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x112')));this[_0xcd49('0xc9')](_0x1a5005)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x113')));}}};Dialer['prototype'][_0xcd49('0x114')]=function(_0x406528){if(this['voiceQueues'][_0x406528[_0xcd49('0xb3')]]){if(this['uniqueId'][_0x406528[_0xcd49('0xde')]]&&this['uniqueId'][_0x406528[_0xcd49('0xde')]]['type']!==_0xcd49('0xb1')){this[_0xcd49('0xb2')](this[_0xcd49('0x1e')][_0x406528[_0xcd49('0xb3')]]);this[_0xcd49('0x26')][_0x406528[_0xcd49('0xde')]][_0xcd49('0x115')]=moment()[_0xcd49('0x7a')](_0xcd49('0x104'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x15bd5a){this['createHistory'](_0x15bd5a)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x112')));this[_0xcd49('0xc9')](_0x15bd5a)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x266d9f){var _0x535faf=this[_0xcd49('0x26')][_0x266d9f['uniqueid']];var _0x1f7994=this;if(this[_0xcd49('0x1e')][_0x266d9f[_0xcd49('0xb3')]]){if(_0x535faf&&_0x535faf[_0xcd49('0x4e')]!==_0xcd49('0xb1')){delete this[_0xcd49('0x26')][_0x266d9f['uniqueid']];this[_0xcd49('0xb2')](this[_0xcd49('0x1e')][_0x266d9f[_0xcd49('0xb3')]]);_0x535faf['droptime']=moment()[_0xcd49('0x7a')](_0xcd49('0x104'));var _0x1be29f=new QueueCallerAbandon(_0x535faf,_0x266d9f);if(getSeconds(_0x535faf[_0xcd49('0x116')],_0x535faf[_0xcd49('0x117')])>=_0x535faf[_0xcd49('0x118')]){this['voiceQueues'][_0x266d9f[_0xcd49('0xb3')]][_0xcd49('0x6b')]+=0x1;this[_0xcd49('0x1e')][_0x266d9f[_0xcd49('0xb3')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xcd49('0x1e')][_0x266d9f['queue']][_0xcd49('0x119')]+=0x1;_0x1be29f[_0xcd49('0xa9')]=0xa;_0x1be29f[_0xcd49('0xaa')]='Drop';_0x1be29f[_0xcd49('0x11a')]=_0xcd49('0x11b');_0x1be29f[_0xcd49('0x10f')]=this[_0xcd49('0x1e')][_0x266d9f[_0xcd49('0xb3')]][_0xcd49('0x110')]?moment()[_0xcd49('0x7a')](_0xcd49('0x104')):undefined;_0x1be29f[_0xcd49('0xf1')]+=0x1;_0x1be29f['countglobal']+=0x1;if(_0x1be29f[_0xcd49('0xf1')]>=this[_0xcd49('0x1e')][_0x266d9f[_0xcd49('0xb3')]][_0xcd49('0x11c')]){this[_0xcd49('0x11d')](_0x1be29f);}else{this[_0xcd49('0xbf')]({'active':![],'countdropretry':_0x1be29f[_0xcd49('0xf1')],'scheduledat':moment()['add'](this['voiceQueues'][_0x266d9f[_0xcd49('0xb3')]][_0xcd49('0x11e')],_0xcd49('0x103'))['format'](_0xcd49('0x104')),'ContactId':_0x535faf[_0xcd49('0xd2')],'ListId':_0x535faf['ListId'],'VoiceQueueId':_0x535faf[_0xcd49('0x105')]||undefined,'CampaignId':_0x535faf[_0xcd49('0xd5')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x3c18ab=new History(_0x1be29f);_0x3c18ab[_0xcd49('0xa9')]=0xa;_0x3c18ab['statedesc']=_0xcd49('0x11f');_0x3c18ab[_0xcd49('0x120')]=moment()[_0xcd49('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c18ab[_0xcd49('0x121')]=_0x3c18ab[_0xcd49('0x120')];_0x3c18ab[_0xcd49('0x122')]=_0x1be29f[_0xcd49('0x122')];_0x3c18ab[_0xcd49('0x123')]=_0x1be29f[_0xcd49('0x123')];this['createHistory'](_0x3c18ab)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x124')));}}else{this[_0xcd49('0x1e')][_0x266d9f[_0xcd49('0xb3')]][_0xcd49('0x125')]+=0x1;this['voiceQueues'][_0x266d9f[_0xcd49('0xb3')]]['outboundDropCallsDayCallersExit']+=0x1;_0x1be29f['state']=0xb;_0x1be29f[_0xcd49('0xaa')]='Abandoned';_0x1be29f[_0xcd49('0x11a')]=_0xcd49('0x126');_0x1be29f[_0xcd49('0xf2')]+=0x1;_0x1be29f['countglobal']+=0x1;if(_0x1be29f[_0xcd49('0xf2')]>=this['voiceQueues'][_0x266d9f['queue']][_0xcd49('0x127')]){this[_0xcd49('0x11d')](_0x1be29f);}else{this[_0xcd49('0xbf')]({'active':![],'countabandonedretry':_0x1be29f['countabandonedretry'],'scheduledat':moment()[_0xcd49('0x102')](this[_0xcd49('0x1e')][_0x266d9f[_0xcd49('0xb3')]][_0xcd49('0x128')],_0xcd49('0x103'))[_0xcd49('0x7a')](_0xcd49('0x104')),'ContactId':_0x535faf[_0xcd49('0xd2')],'ListId':_0x535faf[_0xcd49('0xd3')],'VoiceQueueId':_0x535faf[_0xcd49('0x105')]||undefined,'CampaignId':_0x535faf[_0xcd49('0xd5')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x3c18ab=new History(_0x1be29f);_0x3c18ab['state']=0xb;_0x3c18ab[_0xcd49('0xaa')]=_0xcd49('0x129');_0x3c18ab['starttime']=moment()['format'](_0xcd49('0x104'));_0x3c18ab[_0xcd49('0x121')]=_0x3c18ab['starttime'];_0x3c18ab[_0xcd49('0x122')]=_0x1be29f[_0xcd49('0x122')];_0x3c18ab[_0xcd49('0x123')]=_0x1be29f[_0xcd49('0x123')];this[_0xcd49('0xcb')](_0x3c18ab)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x12a')));}}}}};Dialer[_0xcd49('0x1a')][_0xcd49('0x34')]=function(_0x5660b0){if(this['actions'][_0x5660b0['uniqueid']]){this[_0xcd49('0x24')][_0x5660b0[_0xcd49('0xde')]][_0xcd49('0xb0')]=_0x5660b0[_0xcd49('0xb0')];}if(this[_0xcd49('0x26')][_0x5660b0[_0xcd49('0xde')]]){this[_0xcd49('0x26')][_0x5660b0['uniqueid']][_0xcd49('0xb0')]=_0x5660b0[_0xcd49('0xb0')];}};Dialer[_0xcd49('0x1a')][_0xcd49('0x38')]=function(_0x11c425){if(strategy[this['voiceQueues'][this['actions'][_0x11c425['actionid']][_0xcd49('0xb3')]]['strategy']]===_0xcd49('0x12b')){if(this[_0xcd49('0x24')][_0x11c425[_0xcd49('0x12c')]]&&_['isNil'](this['actions'][_0x11c425[_0xcd49('0x12c')]]['locked'])&&_0x11c425[_0xcd49('0xaf')]==='1'&&_0x11c425[_0xcd49('0x12d')]==='0'){if(this[_0xcd49('0x20')][_0x11c425['stateinterface']]){if(!this['agents'][_0x11c425[_0xcd49('0x12e')]][_0xcd49('0x12f')]){this[_0xcd49('0x20')][_0x11c425[_0xcd49('0x12e')]][_0xcd49('0x12f')]=!![];this['actions'][_0x11c425[_0xcd49('0x12c')]][_0xcd49('0x12f')]=!![];this['actions'][_0x11c425[_0xcd49('0x12c')]][_0xcd49('0x12e')]=_0x11c425[_0xcd49('0x12e')];}}}}else if((strategy[this['voiceQueues'][this[_0xcd49('0x24')][_0x11c425[_0xcd49('0x12c')]][_0xcd49('0xb3')]][_0xcd49('0x50')]]||_0xcd49('0x19'))==='rrmemory'){if(this['actions'][_0x11c425[_0xcd49('0x12c')]]){if(this[_0xcd49('0x20')][_0x11c425[_0xcd49('0x12e')]]){this[_0xcd49('0x24')][_0x11c425['actionid']][_0xcd49('0x12e')]=_0x11c425[_0xcd49('0x12e')];if(_[_0xcd49('0xad')](this['queueBooked'][this[_0xcd49('0x24')][_0x11c425[_0xcd49('0x12c')]][_0xcd49('0xb3')]])){this[_0xcd49('0x2a')][this[_0xcd49('0x24')][_0x11c425[_0xcd49('0x12c')]][_0xcd49('0xb3')]]=[];}this[_0xcd49('0x2a')][this[_0xcd49('0x24')][_0x11c425['actionid']][_0xcd49('0xb3')]]['push'](_['merge'](_[_0xcd49('0xd1')](this['actions'][_0x11c425[_0xcd49('0x12c')]],[_0xcd49('0x130'),_0xcd49('0x12e')]),{'status':_0x11c425['status'],'paused':_0x11c425[_0xcd49('0x12d')]}));}}}};function unlockQueueStatus(_0x292c8d,_0x28d402){setTimeout(function(){if(_[_0xcd49('0x3c')](_0x292c8d['queueStatusComplete'])){loggerBooked[_0xcd49('0x95')]('[unlockQueueStatus][undefined]',_0x28d402);}_0x292c8d[_0xcd49('0x131')]=!![];loggerBooked[_0xcd49('0x7f')](_0xcd49('0x132'),_0x28d402,JSON['stringify'](_[_0xcd49('0xd1')](_0x292c8d,[_0xcd49('0x3f'),_0xcd49('0x131')])));},0x1f3);}Dialer[_0xcd49('0x1a')][_0xcd49('0x39')]=function(_0x4168b7){var _0x32f7a2=this;var _0x13a084=_0x32f7a2[_0xcd49('0x1e')][_0x32f7a2[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]];if(strategy[this[_0xcd49('0x1e')][this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]][_0xcd49('0x50')]]===_0xcd49('0x12b')){if(this['actions'][_0x4168b7[_0xcd49('0x12c')]]&&this[_0xcd49('0x24')][_0x4168b7['actionid']][_0xcd49('0x12e')]){this['preview']['run'](this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]]['idHopper'],this['actions'][_0x4168b7[_0xcd49('0x12c')]]['stateinterface'])['catch'](function(_0x310d5f){logger[_0xcd49('0x95')](_0xcd49('0x133'),util['inspect'](_0x310d5f,{'showHidden':![],'depth':null}));})[_0xcd49('0x134')](function(){_0x32f7a2[_0xcd49('0xb2')](_0x32f7a2[_0xcd49('0x1e')][_0x32f7a2[_0xcd49('0x24')][_0x4168b7['actionid']][_0xcd49('0xb3')]]);_0x32f7a2[_0xcd49('0x20')][_0x32f7a2[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0x12e')]][_0xcd49('0x12f')]=![];delete _0x32f7a2[_0xcd49('0x24')][_0x4168b7['actionid']];unlockQueueStatus(_0x13a084);});}else{this[_0xcd49('0xb2')](this[_0xcd49('0x1e')][this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]]['queue']]);this[_0xcd49('0xbf')]({'active':![],'ContactId':this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]]['ContactId'],'ListId':this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xd3')],'VoiceQueueId':this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0x105')]||undefined,'CampaignId':this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xd5')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x4168b7[_0xcd49('0x12c')]];unlockQueueStatus(_0x13a084);}}else if((strategy[this[_0xcd49('0x1e')][this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]][_0xcd49('0x50')]]||_0xcd49('0x19'))===_0xcd49('0x19')){var _0x5c89bb;if(this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]]&&!_[_0xcd49('0x47')](this[_0xcd49('0x2a')][this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]])){if(this[_0xcd49('0x2b')][_0x32f7a2['actions'][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]]){this[_0xcd49('0x2b')][_0x32f7a2[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]]=this[_0xcd49('0x2b')][this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]]?this[_0xcd49('0x2b')][this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]]:this[_0xcd49('0x2a')][this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]]?this[_0xcd49('0x2a')][this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]]['queue']][_0xcd49('0x135')]||0x0:0x0;}this[_0xcd49('0x2a')][this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]]['_rr']=this['queueBookedRR'][this[_0xcd49('0x24')][_0x4168b7['actionid']][_0xcd49('0xb3')]];for(var _0x3796ab=0x0;_0x3796ab<this[_0xcd49('0x2a')][this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]][_0xcd49('0x98')];_0x3796ab+=0x1){_0x5c89bb=rr(this['queueBooked'][this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]]);this[_0xcd49('0x2b')][_0x32f7a2[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]]['queue']]=this[_0xcd49('0x2a')][this['actions'][_0x4168b7[_0xcd49('0x12c')]]['queue']][_0xcd49('0x135')];if(_0x5c89bb[_0xcd49('0xaf')]==='1'&&_0x5c89bb[_0xcd49('0x12d')]==='0'){break;}}if(!_[_0xcd49('0xad')](_0x5c89bb)){this[_0xcd49('0x20')][_0x5c89bb[_0xcd49('0x12e')]][_0xcd49('0x136')]=_[_0xcd49('0x3c')](this[_0xcd49('0x20')][_0x5c89bb[_0xcd49('0x12e')]][_0xcd49('0x136')])?!![]:this[_0xcd49('0x20')][_0x5c89bb['stateinterface']][_0xcd49('0x136')];}loggerBooked[_0xcd49('0x7f')]('[booked][RR]',_0x4168b7['actionid'],_0xcd49('0x137'),JSON[_0xcd49('0x49')](_[_0xcd49('0xd1')](this[_0xcd49('0x20')][_0x5c89bb['stateinterface']],['name',_0xcd49('0x136')])),_0xcd49('0x138'),JSON[_0xcd49('0x49')](_0x5c89bb[_0xcd49('0x130')]));if(!_[_0xcd49('0xad')](_0x5c89bb)&&_0x5c89bb[_0xcd49('0xaf')]==='1'&&_0x5c89bb['paused']==='0'&&this[_0xcd49('0x20')][_0x5c89bb[_0xcd49('0x12e')]]['unlockRR']){this[_0xcd49('0x20')][_0x5c89bb['stateinterface']][_0xcd49('0x136')]=![];this[_0xcd49('0x2a')][_0x32f7a2[_0xcd49('0x24')][_0x4168b7['actionid']][_0xcd49('0xb3')]]=[];this[_0xcd49('0x1d')][_0xcd49('0x139')](_0x5c89bb['idHopper'],_0x5c89bb[_0xcd49('0x12e')])[_0xcd49('0xb9')](function(_0x3fb7da){logger[_0xcd49('0x95')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xcd49('0x96')](_0x3fb7da,{'showHidden':![],'depth':null}));})[_0xcd49('0x134')](function(){_0x32f7a2[_0xcd49('0xb2')](_0x32f7a2[_0xcd49('0x1e')][_0x32f7a2[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]]);setTimeout(function(){_0x32f7a2[_0xcd49('0x20')][_0x5c89bb['stateinterface']][_0xcd49('0x136')]=!![];loggerBooked[_0xcd49('0x7f')](_0xcd49('0x13a'),_0x4168b7['actionid'],_0xcd49('0x137'),JSON[_0xcd49('0x49')](_['pick'](_0x32f7a2['agents'][_0x5c89bb[_0xcd49('0x12e')]],[_0xcd49('0x3f'),_0xcd49('0x136')])),_0xcd49('0x138'),JSON[_0xcd49('0x49')](_0x5c89bb['idHopper']));},0xc7);delete _0x32f7a2[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]];unlockQueueStatus(_0x13a084,_0x4168b7[_0xcd49('0x12c')]);});}else{loggerBooked[_0xcd49('0x7f')](_0xcd49('0x13b'));this['updateOriginated'](this[_0xcd49('0x1e')][this['actions'][_0x4168b7['actionid']][_0xcd49('0xb3')]]);this[_0xcd49('0xbf')]({'active':![],'ContactId':this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]]['ContactId'],'ListId':this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xd3')],'VoiceQueueId':this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0x105')]||undefined,'CampaignId':this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xd5')]||undefined})[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x13c')));delete this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]];unlockQueueStatus(_0x13a084);}}else{loggerBooked[_0xcd49('0x7f')](_0xcd49('0x13d'));this['updateOriginated'](this[_0xcd49('0x1e')][this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]]['queue']]);this[_0xcd49('0xbf')]({'active':![],'ContactId':this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xd2')],'ListId':this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xd3')],'VoiceQueueId':this[_0xcd49('0x24')][_0x4168b7['actionid']][_0xcd49('0x105')]||undefined,'CampaignId':this['actions'][_0x4168b7[_0xcd49('0x12c')]]['CampaignId']||undefined})[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x13e')));delete this[_0xcd49('0x24')][_0x4168b7['actionid']];unlockQueueStatus(_0x13a084);}}else{loggerBooked['info'](_0xcd49('0x13f'));this['updateOriginated'](this[_0xcd49('0x1e')][this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xb3')]]);this[_0xcd49('0xbf')]({'active':![],'ContactId':this['actions'][_0x4168b7[_0xcd49('0x12c')]]['ContactId'],'ListId':this[_0xcd49('0x24')][_0x4168b7['actionid']][_0xcd49('0xd3')],'VoiceQueueId':this[_0xcd49('0x24')][_0x4168b7['actionid']][_0xcd49('0x105')]||undefined,'CampaignId':this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]][_0xcd49('0xd5')]||undefined})[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x140')));delete this[_0xcd49('0x24')][_0x4168b7[_0xcd49('0x12c')]];unlockQueueStatus(_0x13a084);}};Dialer['prototype'][_0xcd49('0x3a')]=function(){var _0x2faf75=this;setInterval(function(){_0x2faf75[_0xcd49('0x141')]();},0x3e8);};Dialer[_0xcd49('0x1a')][_0xcd49('0x142')]=function(_0x663d75){var _0xf5b7cd=this;return function(){if(!_0xf5b7cd[_0xcd49('0xda')](_0x663d75[_0xcd49('0x77')])){if(!_0xf5b7cd['isTrunkReachable'](_0x663d75[_0xcd49('0x143')])){_0x663d75[_0xcd49('0x3d')]=_0xcd49('0x144');throw _0x663d75[_0xcd49('0x3f')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0xcd49('0x1a')]['checkIfTime']=function(_0x4df3c0,_0x1f0bc7,_0x4c53aa,_0xa2bd56){var _0x2ab369=this;return function(){var _0x4aa8e0=!![];return _0x2ab369[_0xcd49('0x145')](_0x4df3c0,_0x1f0bc7,_0x4c53aa,_0xa2bd56,_0x4aa8e0);};};Dialer[_0xcd49('0x1a')][_0xcd49('0x146')]=function(_0x1897e4,_0x35628f,_0x2c511d,_0x45f95b){var _0x37a5c7=this;return function(){var _0x59556c=![];return _0x37a5c7[_0xcd49('0x145')](_0x1897e4[_0xcd49('0x46')],_0x35628f,_0x2c511d,_0x45f95b,_0x59556c);};};Dialer[_0xcd49('0x1a')][_0xcd49('0x145')]=function(_0x34ccbb,_0x253324,_0x46ba7d,_0x1e273b,_0x511dc9){var _0x4d56cd=[];return new BPromise(function(_0x12ebbd,_0x49962f){if(!isNotNull(_0x34ccbb)){_0x1e273b['message']=_0xcd49('0x44');return _0x49962f(msgResponse('ifTime',_0xcd49('0x147'),_0x46ba7d+'\x20Intervals\x20is\x20null\x20'));}if(_['isEmpty'](_0x34ccbb)){_0x1e273b['message']=_0xcd49('0x148');return _0x49962f(msgResponse(_0xcd49('0x145'),_0xcd49('0x147'),_0x46ba7d+_0xcd49('0x149')));}if(_0x253324&&_[_0xcd49('0x3c')](config[_0xcd49('0x14a')][_0x253324])){_0x1e273b[_0xcd49('0x3d')]=_0xcd49('0x14b');return _0x49962f(msgResponse(_0xcd49('0x145'),'Failure',_0x46ba7d+_0xcd49('0x14c')+_0x253324));}if(_[_0xcd49('0x14d')](_0x34ccbb)){for(var _0x2a4a06=0x0;_0x2a4a06<_0x34ccbb[_0xcd49('0x98')];_0x2a4a06+=0x1){_0x4d56cd['push'](ami[_0xcd49('0xae')]({'action':_0xcd49('0x14e'),'command':util['format'](_0xcd49('0x14f'),_0x34ccbb[_0x2a4a06][_0xcd49('0x150')],!_[_0xcd49('0x3c')](config[_0xcd49('0x14a')][_0x253324])?_0x253324:'')})[_0xcd49('0xb8')](function(_0x41908b){return _0x41908b['content']['indexOf'](_0xcd49('0x151'))>=0x0;})[_0xcd49('0xb9')](myreject(_0x49962f)));}}else{_0x4d56cd[_0xcd49('0x152')](ami[_0xcd49('0xae')]({'action':_0xcd49('0x14e'),'command':util[_0xcd49('0x7a')]('iftime\x20%s,%s',_0x34ccbb,!_[_0xcd49('0x3c')](config[_0xcd49('0x14a')][_0x253324])?_0x253324:'')})[_0xcd49('0xb8')](function(_0x4635e0){return _0x4635e0[_0xcd49('0x153')][_0xcd49('0x154')](_0xcd49('0x151'))>=0x0;})[_0xcd49('0xb9')](myreject(_0x49962f)));}BPromise['all'](_0x4d56cd)[_0xcd49('0xb8')](function(_0x3bfb42){var _0x210386=_['some'](_0x3bfb42);if(_0x210386){return _0x12ebbd(_0x210386);}else{_0x1e273b[_0xcd49('0x3d')]=_0x511dc9?_0xcd49('0x155'):'INTERVAL_IS_OVERTIME';return _0x49962f(msgResponse(_0xcd49('0x156'),_0xcd49('0x147'),_0xcd49('0x157')+_0x511dc9+'\x20'+_0x46ba7d+'\x20Interval\x20is\x20overtime:\x20'+util[_0xcd49('0x96')](_0x34ccbb,{'showHidden':![],'depth':null})+_0xcd49('0x158')+_0x253324));}})[_0xcd49('0xb9')](function(_0x333a38){return _0x49962f(msgResponse(_0xcd49('0x145'),_0xcd49('0x147'),JSON[_0xcd49('0x49')](_0x333a38)));});});};Dialer[_0xcd49('0x1a')][_0xcd49('0x159')]=function(_0xb5d4dd){var _0x1054ef=this;return function(){switch(_0xb5d4dd[_0xcd49('0x5c')]){case _0xcd49('0x15a'):freeVariablesPredictive(_0xb5d4dd);_0x1054ef[_0xcd49('0x15b')](_0xb5d4dd,0x1);break;case _0xcd49('0x15c'):freeVariablesPredictive(_0xb5d4dd);_0x1054ef[_0xcd49('0x15b')](_0xb5d4dd,_0xb5d4dd['dialPowerLevel']);break;case'predictive':_0x1054ef[_0xcd49('0x8')](_0xb5d4dd);break;case _0xcd49('0x7'):freeVariablesPredictive(_0xb5d4dd);_0x1054ef[_0xcd49('0x15b')](_0xb5d4dd,0x1);break;default:freeVariablesPredictive(_0xb5d4dd);logger['error'](_0xcd49('0x15d'),_0xb5d4dd[_0xcd49('0x3f')],_0xcd49('0x15e'));}};};Dialer[_0xcd49('0x1a')]['launchHandleIvr']=function(_0x49fd98){var _0x2a9450=this;return function(){_0x2a9450[_0xcd49('0x15f')](_0x49fd98);};};Dialer[_0xcd49('0x1a')][_0xcd49('0xa')]=function(_0x566f09){var _0xa1d46d=this;if(isNotPreview(_0x566f09[_0xcd49('0x5c')])){if(isVoiceQueueOutbound(_0x566f09[_0xcd49('0x4e')])&&isActive(_0x566f09[_0xcd49('0x5b')])){_0x566f09[_0xcd49('0xa1')]=!![];BPromise['resolve']()[_0xcd49('0xb8')](checkIsLoggedIn(_0x566f09,_0x566f09[_0xcd49('0x160')]))[_0xcd49('0xb8')](checkIsActive(_0x566f09,_0x566f09[_0xcd49('0x5b')]))['then'](checkInterval(_0x566f09))[_0xcd49('0xb8')](_0xa1d46d[_0xcd49('0x142')](_0x566f09))[_0xcd49('0xb8')](_0xa1d46d[_0xcd49('0x161')](_0x566f09[_0xcd49('0x162')],_0x566f09[_0xcd49('0x163')],_0x566f09['name'],_0x566f09))[_0xcd49('0xb8')](_0xa1d46d[_0xcd49('0x146')](_0x566f09[_0xcd49('0x43')],_0x566f09[_0xcd49('0x163')],_0x566f09[_0xcd49('0x3f')],_0x566f09))[_0xcd49('0xb8')](_0xa1d46d[_0xcd49('0x159')](_0x566f09))[_0xcd49('0xb9')](loggerCatchQueueSummary(_0xcd49('0x164'),_0x566f09));}else{notSendMessagesQueue(_0x566f09);}}else{freeVariablesPredictive(_0x566f09);}};Dialer[_0xcd49('0x1a')][_0xcd49('0x141')]=function(){var _0x75217e=this;var _0x146355;for(var _0x9c7d8d in this[_0xcd49('0x1f')]){if(typeof this[_0xcd49('0x1f')][_0x9c7d8d]!==_0xcd49('0x99')){_0x146355=this['campaigns'][_0x9c7d8d];if(isCampaignIvr(_0x146355['type'])&&isActive(_0x146355['active'])){_0x146355['sendMessageOneNotActive']=!![];BPromise[_0xcd49('0xb7')]()[_0xcd49('0xb8')](checkIsActive(_0x146355,_0x146355['active']))[_0xcd49('0xb8')](checkInterval(_0x146355))[_0xcd49('0xb8')](_0x75217e[_0xcd49('0x142')](_0x146355))['then'](_0x75217e['checkIfTime'](_0x146355[_0xcd49('0x162')],_0x146355[_0xcd49('0x163')],_0x146355[_0xcd49('0x3f')],_0x146355))[_0xcd49('0xb8')](_0x75217e[_0xcd49('0x146')](_0x146355[_0xcd49('0x43')],_0x146355[_0xcd49('0x163')],_0x146355[_0xcd49('0x3f')],_0x146355))[_0xcd49('0xb8')](_0x75217e[_0xcd49('0x165')](_0x146355))[_0xcd49('0xb9')](loggerCatchQueueSummary(_0xcd49('0x166'),_0x146355));}else{notSendMessagesCampaign(_0x146355);}}}};function getCallerIdRandom(_0x213791,_0x4f67c4){var _0x182320;var _0x5d0295;var _0x1253f2;if(_0x4f67c4<=0x0){_0x4f67c4=0x1;}_0x182320=new RegExp(_0xcd49('0x167')+_0x4f67c4+'}$');_0x5d0295=Math[_0xcd49('0x168')](0xa,_0x4f67c4-0x1);_0x1253f2=Math['pow'](0xa,_0x4f67c4)-0x1;return util[_0xcd49('0x7a')]('%s',_[_0xcd49('0x169')](_0x213791,_0x182320,_[_0xcd49('0x16a')](_0x5d0295,_0x1253f2)));}function extractCalleridName(_0x2d8236){var _0x35b456=_0x2d8236['match'](/"(.*?)"/);return _0x35b456?_0x35b456[0x1]:_0x2d8236;}function extractCalleridNumber(_0xc7137d){var _0x21c27e=_0xc7137d[_0xcd49('0x16b')](/<(.*?)>/);return _0x21c27e?_0x21c27e[0x1]:_0xc7137d;}Dialer[_0xcd49('0x1a')]['actionOriginate']=function(_0x4efe35,_0xb58c3b){var _0x5569a4=this;var _0x1aa6ea=uuid['v4']();this[_0xcd49('0x24')][_0x1aa6ea]=new Action(_0x4efe35,_0xb58c3b,_0x1aa6ea);return new BPromise(function(_0x31ed99,_0x5a3d9b){if(_[_0xcd49('0x3c')](_0x4efe35)&&typeof _0x4efe35!=='object'){return _0x5a3d9b(msgResponse(_0xcd49('0x16c'),_0xcd49('0x147'),'voiceQueue\x20is\x20undefine'));}if(_[_0xcd49('0x3c')](_0xb58c3b[_0xcd49('0x16d')][_0xcd49('0x16e')])||_0xb58c3b[_0xcd49('0x16d')]['phone']===null){return _0x5a3d9b(msgResponse(_0xcd49('0x16c'),'Failure',_0xcd49('0x16f')));}var _0x4a54eb={'XMD-CALLERID':_0x5569a4[_0xcd49('0x24')][_0x1aa6ea][_0xcd49('0x170')](),'XMD-AGI':_0x4efe35['dialQueueProject']?util['format'](_0xcd49('0x171'),ipAgi,_0x4efe35[_0xcd49('0x10a')]):'NONE','XMD-AGIAFTER':_0x4efe35[_0xcd49('0x110')]?util[_0xcd49('0x7a')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4efe35['dialQueueProject2']):_0xcd49('0x172'),'XMD-QUEUE':_0x4efe35[_0xcd49('0x4e')]===_0xcd49('0x4f')?util['format']('\x22%s,%s%s,,,%s\x22',_0x4efe35[_0xcd49('0x3f')],_0x4efe35['dialQueueOptions']||'',_0x4efe35['dialAgiAfterHangupAgent']?'c':'',_0x4efe35['dialQueueTimeout']||0x3):_0xcd49('0x172'),'XMD-CONTACTID':_0xb58c3b[_0xcd49('0xd2')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5569a4[_0xcd49('0x24')][_0x1aa6ea]['getCaller'](),'XMD-AMD':_0x4efe35[_0xcd49('0xe8')]?_0xcd49('0x173'):_0xcd49('0x172'),'XMD-DESTINATION':_0xcd49('0x174')};if(_0x4efe35[_0xcd49('0xe8')]){_0x4a54eb[_0xcd49('0x175')]=_0x4efe35[_0xcd49('0x176')]||0x9c4;_0x4a54eb[_0xcd49('0x177')]=_0x4efe35[_0xcd49('0x178')]||0x5dc;_0x4a54eb['XMD-AMDAFTERGREETINGSILENCE']=_0x4efe35[_0xcd49('0x179')]||0x320;_0x4a54eb[_0xcd49('0x17a')]=_0x4efe35[_0xcd49('0x17b')]||0x1388;_0x4a54eb[_0xcd49('0x17c')]=_0x4efe35['dialAMDMinWordLength']||0x64;_0x4a54eb[_0xcd49('0x17d')]=_0x4efe35[_0xcd49('0x17e')]||0x32;_0x4a54eb[_0xcd49('0x17f')]=_0x4efe35[_0xcd49('0x180')]||0x3;_0x4a54eb[_0xcd49('0x181')]=_0x4efe35[_0xcd49('0x182')]||0x100;_0x4a54eb[_0xcd49('0x183')]=_0x4efe35[_0xcd49('0x184')]||0x1388;}if(_0x4efe35[_0xcd49('0x4e')]==='outbound'){_0x4a54eb[_0xcd49('0x185')]=_0xb58c3b[_0xcd49('0x105')];}else{_0x4a54eb[_0xcd49('0x186')]=_0xb58c3b[_0xcd49('0xd5')];}for(var _0x59f993 in _0xb58c3b['Contact']){if(typeof _0xb58c3b[_0xcd49('0x16d')][_0x59f993]!==_0xcd49('0x99')){if(isNotNull(_0xb58c3b[_0xcd49('0x16d')][_0x59f993])&&_0x59f993!=='id'&&_0x59f993!==_0xcd49('0x187')&&_0x59f993!==_0xcd49('0x188')&&_0x59f993!==_0xcd49('0x189')){_0x4a54eb[util['format']('%s%s',_0xcd49('0x18a'),_['toUpper'](_0x59f993))]=_0xb58c3b['Contact'][_0x59f993];}}}var _0x59abe2=_0x5569a4[_0xcd49('0xda')](_0x4efe35['Trunk'])?getCallerId(_0x4efe35[_0xcd49('0x77')][_0xcd49('0x79')],_0x4efe35['dialOriginateCallerIdName'],_0x4efe35['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4efe35['dialOriginateCallerIdNumber'],_0x4efe35[_0xcd49('0x18b')]):_0x4efe35[_0xcd49('0x5e')]):getCallerId(_[_0xcd49('0xad')](_0x4efe35[_0xcd49('0x143')])?_0x4efe35[_0xcd49('0x77')][_0xcd49('0x79')]:_0x4efe35[_0xcd49('0x143')][_0xcd49('0x79')],_0x4efe35[_0xcd49('0x5d')],_0x4efe35[_0xcd49('0x18b')]>0x0?getCallerIdRandom(_0x4efe35[_0xcd49('0x5e')],_0x4efe35[_0xcd49('0x18b')]):_0x4efe35[_0xcd49('0x5e')]);if(_0x59abe2){_0x4a54eb[_0xcd49('0x18c')]=_0x5569a4['actions'][_0x1aa6ea]['originatecalleridname']=extractCalleridName(_0x59abe2);_0x4a54eb['XMD-ORIGINATECALLERIDNUM']=_0x5569a4[_0xcd49('0x24')][_0x1aa6ea][_0xcd49('0x18d')]=extractCalleridNumber(_0x59abe2);}return ami[_0xcd49('0xae')]({'actionid':_0x1aa6ea,'action':_0xcd49('0x16c'),'channel':_0x5569a4[_0xcd49('0xda')](_0x4efe35[_0xcd49('0x77')])?util[_0xcd49('0x7a')](_0xcd49('0x18e'),_0x4efe35[_0xcd49('0x77')]['name'],isNotNull(_0x4efe35[_0xcd49('0x60')])?_0x4efe35[_0xcd49('0x60')][_0xcd49('0x18f')]()||'':'',_0x4efe35[_0xcd49('0x190')]>0x0?_0xb58c3b[_0xcd49('0x16d')][_0xcd49('0x16e')][_0xcd49('0x191')](_0x4efe35[_0xcd49('0x190')]):_0xb58c3b[_0xcd49('0x16d')][_0xcd49('0x16e')]):util['format'](_0xcd49('0x18e'),_[_0xcd49('0xad')](_0x4efe35['TrunkBackup'])?_0x4efe35['Trunk'][_0xcd49('0x3f')]:_0x4efe35[_0xcd49('0x143')]['name'],isNotNull(_0x4efe35[_0xcd49('0x60')])?_0x4efe35[_0xcd49('0x60')][_0xcd49('0x18f')]()||'':'',_0x4efe35['dialCutDigit']>0x0?_0xb58c3b['Contact'][_0xcd49('0x16e')][_0xcd49('0x191')](_0x4efe35['dialCutDigit']):_0xb58c3b[_0xcd49('0x16d')][_0xcd49('0x16e')]),'callerid':_0x59abe2,'Exten':'xcally-motion-dialer','Context':_0xcd49('0x192'),'Priority':'1','variable':_0x4a54eb,'timeout':(_0x4efe35[_0xcd49('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1aa6ea})[_0xcd49('0xb8')](function(_0x5c7dbf){return _0x31ed99(_0x5c7dbf);})[_0xcd49('0xb9')](function(_0x3e50f4){_0x4efe35[_0xcd49('0x193')]+=0x1;var _0x4b2986=new History(_0x5569a4[_0xcd49('0x24')][_0x1aa6ea]);logger[_0xcd49('0x95')](util[_0xcd49('0x7a')](_0xcd49('0x194'),JSON[_0xcd49('0x49')](_0x3e50f4)));_0x4b2986[_0xcd49('0xa9')]=0xe;_0x4b2986[_0xcd49('0xaa')]=_0xcd49('0x195');_0x4b2986[_0xcd49('0x120')]=moment()[_0xcd49('0x7a')](_0xcd49('0x104'));_0x4b2986[_0xcd49('0x121')]=_0x4b2986[_0xcd49('0x120')];_0x5569a4[_0xcd49('0xcb')](_0x4b2986)['catch'](loggerCatch('[originate][error]'));_0x5569a4[_0xcd49('0xc9')](_0x4b2986)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x196')))[_0xcd49('0x134')](function(){delete _0x5569a4[_0xcd49('0x24')][_0x1aa6ea];return _0x5a3d9b(msgResponse(_0xcd49('0x16c'),'Error',_0xcd49('0x197')));});});});};Dialer[_0xcd49('0x1a')][_0xcd49('0x2f')]=function(_0x3a15c5){var _0x1ec947=this[_0xcd49('0x24')][_0x3a15c5['actionid']];if(_0x1ec947){delete this[_0xcd49('0x24')][_0x3a15c5[_0xcd49('0x12c')]];_0x1ec947[_0xcd49('0x117')]=moment()[_0xcd49('0x7a')](_0xcd49('0x104'));var _0x2d0203=_0x1ec947['type']===_0xcd49('0xb1')?this['campaigns'][_0x1ec947[_0xcd49('0xb3')]]:this[_0xcd49('0x1e')][_0x1ec947['getQueue']()];if(!this[_0xcd49('0xd8')](_0x3a15c5['response'])){this['updateOriginated'](_0x2d0203);return this[_0xcd49('0x198')](_0x1ec947,_0x2d0203,_0x3a15c5)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x199')));}this[_0xcd49('0x26')][_0x3a15c5['uniqueid']]=_0x1ec947;}};Dialer[_0xcd49('0x1a')]['checkRetriveMax']=function(_0x4b3882,_0x386725,_0x16f411){var _0x3ced34=new History(_0x386725);if(_0x3ced34[_0xcd49('0xff')]+_0x3ced34[_0xcd49('0xef')]+_0x3ced34[_0xcd49('0xf0')]+_0x3ced34[_0xcd49('0x100')]+_0x3ced34[_0xcd49('0xf1')]+_0x3ced34['countabandonedretry']+_0x3ced34[_0xcd49('0xf7')]+_0x3ced34[_0xcd49('0xf3')]>=_0x16f411[_0xcd49('0xf4')]-0x1){return!![];}switch(_0x4b3882){case 0x3:if(_0x3ced34[_0xcd49('0xf0')]>=_0x16f411['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0xcd49('0xbf')]({'active':![],'countnoanswerretry':_0x3ced34[_0xcd49('0xf0')]+=0x1,'scheduledat':moment()[_0xcd49('0x102')](_0x16f411[_0xcd49('0x19a')],'minutes')[_0xcd49('0x7a')](_0xcd49('0x104')),'ContactId':_0x3ced34[_0xcd49('0xd2')],'ListId':_0x3ced34[_0xcd49('0xd3')],'VoiceQueueId':_0x3ced34['VoiceQueueId']||undefined,'CampaignId':_0x3ced34[_0xcd49('0xd5')]||undefined})[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x19b')));break;case 0x5:if(_0x3ced34[_0xcd49('0xff')]>=_0x16f411[_0xcd49('0x19c')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x3ced34[_0xcd49('0xff')]+=0x1,'scheduledat':moment()['add'](_0x16f411[_0xcd49('0x19d')],_0xcd49('0x103'))[_0xcd49('0x7a')](_0xcd49('0x104')),'ContactId':_0x3ced34[_0xcd49('0xd2')],'ListId':_0x3ced34[_0xcd49('0xd3')],'VoiceQueueId':_0x3ced34['VoiceQueueId']||undefined,'CampaignId':_0x3ced34['CampaignId']||undefined})[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x19e')));break;case 0x8:if(_0x3ced34[_0xcd49('0xef')]>=_0x16f411[_0xcd49('0x19f')]-0x1){return!![];}this[_0xcd49('0xbf')]({'active':![],'countcongestionretry':_0x3ced34['countcongestionretry']+=0x1,'scheduledat':moment()[_0xcd49('0x102')](_0x16f411[_0xcd49('0x1a0')],'minutes')[_0xcd49('0x7a')](_0xcd49('0x104')),'ContactId':_0x3ced34[_0xcd49('0xd2')],'ListId':_0x3ced34[_0xcd49('0xd3')],'VoiceQueueId':_0x3ced34[_0xcd49('0x105')]||undefined,'CampaignId':_0x3ced34[_0xcd49('0xd5')]||undefined})[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x1a1')));break;case 0x0:if(_0x3ced34[_0xcd49('0x100')]>=_0x16f411[_0xcd49('0x1a2')]-0x1){return!![];}else{this[_0xcd49('0xbf')]({'active':![],'countnosuchnumberretry':_0x3ced34[_0xcd49('0x100')]+=0x1,'scheduledat':moment()[_0xcd49('0x102')](_0x16f411['dialNoSuchNumberRetryFrequency'],_0xcd49('0x103'))[_0xcd49('0x7a')](_0xcd49('0x104')),'ContactId':_0x3ced34['ContactId'],'ListId':_0x3ced34[_0xcd49('0xd3')],'VoiceQueueId':_0x3ced34[_0xcd49('0x105')]||undefined,'CampaignId':_0x3ced34[_0xcd49('0xd5')]||undefined})[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x1a3')));}break;case 0xa:if(_0x3ced34[_0xcd49('0xf1')]>=_0x16f411[_0xcd49('0x11c')]-0x1){return!![];}this[_0xcd49('0xbf')]({'active':![],'countdropretry':_0x3ced34[_0xcd49('0xf1')]+=0x1,'scheduledat':moment()['add'](_0x16f411[_0xcd49('0x11e')],'minutes')[_0xcd49('0x7a')](_0xcd49('0x104')),'ContactId':_0x3ced34[_0xcd49('0xd2')],'ListId':_0x3ced34[_0xcd49('0xd3')],'VoiceQueueId':_0x3ced34['VoiceQueueId']||undefined,'CampaignId':_0x3ced34[_0xcd49('0xd5')]||undefined})['catch'](loggerCatch(_0xcd49('0x1a4')));break;case 0xb:if(_0x3ced34['countabandonedretry']>=_0x16f411[_0xcd49('0x127')]-0x1){return!![];}this[_0xcd49('0xbf')]({'active':![],'countabandonedretry':_0x3ced34[_0xcd49('0xf2')]+=0x1,'scheduledat':moment()['add'](_0x16f411[_0xcd49('0x128')],_0xcd49('0x103'))[_0xcd49('0x7a')](_0xcd49('0x104')),'ContactId':_0x3ced34[_0xcd49('0xd2')],'ListId':_0x3ced34[_0xcd49('0xd3')],'VoiceQueueId':_0x3ced34[_0xcd49('0x105')]||undefined,'CampaignId':_0x3ced34[_0xcd49('0xd5')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x3ced34['countmachineretry']>=_0x16f411[_0xcd49('0xf8')]-0x1){return!![];}this[_0xcd49('0xbf')]({'active':![],'countmachineretry':_0x3ced34['countmachineretry']+=0x1,'scheduledat':moment()[_0xcd49('0x102')](_0x16f411[_0xcd49('0xfa')],_0xcd49('0x103'))[_0xcd49('0x7a')](_0xcd49('0x104')),'ContactId':_0x3ced34[_0xcd49('0xd2')],'ListId':_0x3ced34[_0xcd49('0xd3')],'VoiceQueueId':_0x3ced34['VoiceQueueId']||undefined,'CampaignId':_0x3ced34['CampaignId']||undefined})[_0xcd49('0xb9')](loggerCatch(_0xcd49('0xfb')));break;case 0x14:if(_0x3ced34[_0xcd49('0xf3')]>=_0x16f411[_0xcd49('0x1a5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x3ced34[_0xcd49('0xf3')]+=0x1,'scheduledat':moment()[_0xcd49('0x102')](_0x16f411[_0xcd49('0x1a6')],_0xcd49('0x103'))[_0xcd49('0x7a')](_0xcd49('0x104')),'ContactId':_0x3ced34[_0xcd49('0xd2')],'ListId':_0x3ced34[_0xcd49('0xd3')],'VoiceQueueId':_0x3ced34[_0xcd49('0x105')]||undefined,'CampaignId':_0x3ced34['CampaignId']||undefined})['catch'](loggerCatch(_0xcd49('0x1a7')));break;default:return!![];}};Dialer['prototype'][_0xcd49('0x198')]=function(_0x5c365f,_0x388c97,_0xd41a9d){var _0x570980=this;var _0x6f4ec4=new History(_0x5c365f);return new BPromise(function(_0x1bab17,_0x7d3fc1){if(_[_0xcd49('0x3c')](_0x388c97)&&typeof _0x388c97!==_0xcd49('0x1a8')){return _0x7d3fc1(msgResponse('[callProgressDetecting]','Failure',_0xcd49('0x1a9')));}if(_['isUndefined'](_0xd41a9d)&&typeof _0xd41a9d!==_0xcd49('0x1a8')){return _0x7d3fc1(msgResponse(_0xcd49('0x1aa'),'Failure',_0xcd49('0x1ab')));}switch(_0xd41a9d['reason']){case'0':_0x388c97[_0xcd49('0x66')]+=0x1;_0x6f4ec4[_0xcd49('0xa9')]=0x0;_0x6f4ec4[_0xcd49('0xaa')]='NoSuchNumber';_0x6f4ec4[_0xcd49('0x100')]+=0x1;_0x6f4ec4[_0xcd49('0xfe')]+=0x1;ami[_0xcd49('0x4d')](_0xcd49('0x1ac'),ut[_0xcd49('0xe5')](_0x5c365f,'nosuchnumber'));_0x570980['createHistory'](_0x6f4ec4)[_0xcd49('0xb9')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x570980['checkRetriveMax'](0x0,_0x5c365f,_0x388c97)){if(_0x6f4ec4[_0xcd49('0x100')]>=_0x388c97['dialNoSuchNumberMaxRetry']){_0x570980['createStateFinal'](_0x6f4ec4,_0x1bab17,_0x7d3fc1,'reason\x200\x20no\x20such\x20number....');}else{_0x570980[_0xcd49('0xf5')](_0x6f4ec4,_0x1bab17,_0x7d3fc1,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x388c97['outboundNoAnswerCallsDay']+=0x1;_0x6f4ec4[_0xcd49('0xa9')]=0x3;_0x6f4ec4[_0xcd49('0xaa')]=_0xcd49('0x1ad');_0x6f4ec4[_0xcd49('0xf0')]+=0x1;_0x6f4ec4[_0xcd49('0xfe')]+=0x1;ami[_0xcd49('0x4d')](_0xcd49('0x1ae'),ut['buildObj'](_0x5c365f,_0xcd49('0x1af')));_0x570980[_0xcd49('0xcb')](_0x6f4ec4)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x1b0')));if(_0x570980[_0xcd49('0x1b1')](0x3,_0x5c365f,_0x388c97)){if(_0x6f4ec4[_0xcd49('0xf0')]>=_0x388c97[_0xcd49('0x1b2')]){_0x570980[_0xcd49('0x101')](_0x6f4ec4,_0x1bab17,_0x7d3fc1,'reason\x203\x20ringing\x20no\x20answer');}else{_0x570980['stateGlobal'](_0x6f4ec4,_0x1bab17,_0x7d3fc1,_0xcd49('0x1b3'));}}break;case'5':_0x388c97[_0xcd49('0x62')]+=0x1;_0x6f4ec4[_0xcd49('0xa9')]=0x5;_0x6f4ec4[_0xcd49('0xaa')]=_0xcd49('0x1b4');_0x6f4ec4[_0xcd49('0xff')]+=0x1;_0x6f4ec4[_0xcd49('0xfe')]+=0x1;ami['emit']('custom:agentbusy',ut[_0xcd49('0xe5')](_0x5c365f,_0xcd49('0x1b5')));_0x570980[_0xcd49('0xcb')](_0x6f4ec4)[_0xcd49('0xb9')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x570980[_0xcd49('0x1b1')](0x5,_0x5c365f,_0x388c97)){if(_0x6f4ec4['countbusyretry']>=_0x388c97[_0xcd49('0x19c')]){_0x570980[_0xcd49('0x101')](_0x6f4ec4,_0x1bab17,_0x7d3fc1,'reason\x205\x20busy');}else{_0x570980[_0xcd49('0xf5')](_0x6f4ec4,_0x1bab17,_0x7d3fc1,_0xcd49('0x1b6'));}}break;case'8':_0x388c97['outboundCongestionCallsDay']+=0x1;_0x6f4ec4[_0xcd49('0xa9')]=0x8;_0x6f4ec4[_0xcd49('0xaa')]=_0xcd49('0x1b7');_0x6f4ec4['countcongestionretry']+=0x1;_0x6f4ec4[_0xcd49('0xfe')]+=0x1;ami[_0xcd49('0x4d')]('custom:agentcongestion',ut[_0xcd49('0xe5')](_0x5c365f,_0xcd49('0x1b8')));_0x570980['createHistory'](_0x6f4ec4)[_0xcd49('0xb9')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x570980[_0xcd49('0x1b1')](0x8,_0x5c365f,_0x388c97)){if(_0x6f4ec4[_0xcd49('0xef')]>=_0x388c97[_0xcd49('0x19f')]){_0x570980[_0xcd49('0x101')](_0x6f4ec4,_0x1bab17,_0x7d3fc1,_0xcd49('0x1b9'));}else{_0x570980['stateGlobal'](_0x6f4ec4,_0x1bab17,_0x7d3fc1,'reason\x208\x20congestion');}}break;case'11':_0x388c97[_0xcd49('0x1ba')]+=0x1;_0x6f4ec4['state']=0xb;_0x6f4ec4[_0xcd49('0xaa')]=_0xcd49('0x129');_0x6f4ec4[_0xcd49('0xf2')]+=0x1;_0x6f4ec4[_0xcd49('0xfe')]+=0x1;_0x570980[_0xcd49('0xcb')](_0x6f4ec4)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x12a')));if(_0x570980[_0xcd49('0x1b1')](0xb,_0x5c365f,_0x388c97)){if(_0x6f4ec4[_0xcd49('0xf2')]>=_0x388c97[_0xcd49('0x127')]){_0x570980[_0xcd49('0x101')](_0x6f4ec4,_0x1bab17,_0x7d3fc1,_0xcd49('0x1bb'));}else{_0x570980[_0xcd49('0xf5')](_0x6f4ec4,_0x1bab17,_0x7d3fc1,_0xcd49('0x1bb'));}}break;case'20':_0x388c97[_0xcd49('0x68')]+=0x1;_0x6f4ec4[_0xcd49('0xa9')]=0x14;_0x6f4ec4['statedesc']=_0xcd49('0x1bc');_0x6f4ec4[_0xcd49('0xf3')]+=0x1;_0x6f4ec4['countglobal']+=0x1;ami[_0xcd49('0x4d')](_0xcd49('0x1bd'),ut['buildObj'](_0x5c365f,_0xcd49('0x1be')));_0x570980['createHistory'](_0x6f4ec4)[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x1bf')));if(_0x570980['checkRetriveMax'](0x14,_0x5c365f,_0x388c97)){if(_0x6f4ec4[_0xcd49('0xf3')]>=_0x388c97[_0xcd49('0x1a5')]){_0x570980[_0xcd49('0x101')](_0x6f4ec4,_0x1bab17,_0x7d3fc1,_0xcd49('0x1c0'));}else{_0x570980['stateGlobal'](_0x6f4ec4,_0x1bab17,_0x7d3fc1,_0xcd49('0x1c0'));}}break;default:_0x388c97[_0xcd49('0x69')]+=0x1;_0x6f4ec4[_0xcd49('0xa9')]=0xc;_0x6f4ec4['statedesc']=_0xd41a9d[_0xcd49('0x10d')];_0x570980[_0xcd49('0xcb')](_0x6f4ec4)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x570980['checkRetriveMax'](_0xd41a9d['reason'],_0x5c365f,_0x388c97)){if(_0x6f4ec4[_0xcd49('0xff')]+_0x6f4ec4['countcongestionretry']+_0x6f4ec4[_0xcd49('0xf0')]+_0x6f4ec4[_0xcd49('0x100')]+_0x6f4ec4[_0xcd49('0xf1')]+_0x6f4ec4[_0xcd49('0xf2')]+_0x6f4ec4[_0xcd49('0xf7')]+_0x6f4ec4[_0xcd49('0xf3')]>=_0x388c97[_0xcd49('0xf4')]){_0x570980[_0xcd49('0xf5')](_0x6f4ec4,_0x1bab17,_0x7d3fc1,_0xd41a9d['reason']);}else{_0x570980['createStateFinal'](_0x6f4ec4,_0x1bab17,_0x7d3fc1,_0xd41a9d['reason']);}}}});};Dialer[_0xcd49('0x1a')][_0xcd49('0xf5')]=function(_0xdb2fb7,_0x50346c,_0x2a86c0,_0x1fbb95){var _0xfb1faa=new Final(_0xdb2fb7);_0xfb1faa[_0xcd49('0xa9')]=0xf;_0xfb1faa['statedesc']='Global';this[_0xcd49('0x101')](_0xfb1faa,_0x50346c,_0x2a86c0,_0x1fbb95);};Dialer[_0xcd49('0x1a')][_0xcd49('0x101')]=function(_0x30919c,_0x8d0bec,_0x31de6f,_0x1b0ac9){this[_0xcd49('0xc9')](_0x30919c)[_0xcd49('0xb8')](function(){return _0x8d0bec(msgResponse('[callProgressDetecting]',_0xcd49('0xd9'),_0x1b0ac9));})[_0xcd49('0xb9')](function(){return _0x31de6f(msgResponse(_0xcd49('0x1c1'),_0xcd49('0x147'),_0xcd49('0x1c2')));});};Dialer[_0xcd49('0x1a')]['predictive']=function(_0x31710b){var _0x171421=_0x31710b['dialPredictiveOptimizationPercentage']/0x64;var _0x3e697c=_0x31710b[_0xcd49('0x65')]/(_0x31710b[_0xcd49('0x65')]+_0x31710b[_0xcd49('0x61')]);var _0x164036=Math[_0xcd49('0x1c3')](_0x31710b['predictiveIntervalAvailable']*(_0x31710b[_0xcd49('0x1c4')]/0x64));var _0x51a8fe=Math[_0xcd49('0x1c3')](_0x31710b['predictiveIntervalAvailable']*(_0x31710b[_0xcd49('0x1c5')]/0x64));var _0x5efada=_0x31710b[_0xcd49('0x52')]+_0x31710b[_0xcd49('0x56')];var _0x38ac7c=Math['floor'](_0x31710b[_0xcd49('0x73')]*_0x31710b[_0xcd49('0x75')]*_0x31710b['predictiveIntervalHitRate']*_0x31710b[_0xcd49('0x6e')]);if(_['isUndefined'](_0x31710b[_0xcd49('0x76')])){if(!_['isUndefined'](_0x31710b[_0xcd49('0x28')])){_0x31710b[_0xcd49('0x28')]=undefined;loggerPredictive[_0xcd49('0x95')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xcd49('0x3c')](_0x31710b[_0xcd49('0x90')])){loggerPredictive['error'](_0xcd49('0x1c6'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x31710b[_0xcd49('0x90')]);_0x31710b[_0xcd49('0x90')]=undefined;}_0x31710b['startProgressive']=moment()['format'](_0xcd49('0x104'));loggerPredictive[_0xcd49('0x7f')](_0x31710b['name'],_0xcd49('0x1c7'),_0x31710b[_0xcd49('0x76')]);this[_0xcd49('0x15b')](_0x31710b,0x1);}else if(ifInterval(_0x31710b['dialPredictiveInterval'],_0x31710b[_0xcd49('0x76')])){this[_0xcd49('0x15b')](_0x31710b,0x1);loggerPredictiveCalls['info'](_0xcd49('0x1c8'),_0x31710b[_0xcd49('0x76')],_0x31710b[_0xcd49('0x3f')]);_0x31710b[_0xcd49('0x73')]=0x0;_0x31710b[_0xcd49('0x119')]=0x0;}else if(_0x171421<_0x3e697c&&_0x31710b['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x31710b);loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x1c9'),_0xcd49('0x1ca'),_0x3e697c,_0xcd49('0x76'),_0x31710b[_0xcd49('0x3f')]);}else if(_0x38ac7c<_0x31710b[_0xcd49('0x119')]&&_0x31710b[_0xcd49('0x1cb')]===_0xcd49('0x1cc')){freeVariablesPredictive(_0x31710b);loggerPredictive['info'](_0xcd49('0x1cd'),_0xcd49('0x1ce'),_0x38ac7c,'Drop\x20in\x20this\x20interval',_0x31710b['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x31710b[_0xcd49('0x3f')]);}else if(!ifInterval(_0x31710b['dialPredictiveInterval'],_0x31710b[_0xcd49('0x76')])&&_[_0xcd49('0x3c')](_0x31710b[_0xcd49('0x28')])&&!_[_0xcd49('0x3c')](_0x31710b[_0xcd49('0x76')])){_0x31710b[_0xcd49('0x28')]=moment()['format'](_0xcd49('0x104'));loggerPredictive[_0xcd49('0x7f')](_0x31710b[_0xcd49('0x3f')],_0xcd49('0x1cf'),_0x31710b['startPredictive']);this[_0xcd49('0xbd')](_0x31710b[_0xcd49('0x1d0')])[_0xcd49('0xb8')](this[_0xcd49('0x1d1')](_0x31710b))['then'](mergeDataErlangB(_0x31710b))[_0xcd49('0xb8')](this[_0xcd49('0x1d2')](_0x31710b))[_0xcd49('0xb9')](loggerCatchPredictive(_0xcd49('0x1d3'),_0x31710b));}else if(!ifInterval(_0x31710b[_0xcd49('0x1d0')],_0x31710b['startPredictive'])){_0x31710b[_0xcd49('0x119')]=0x0;_0x31710b['startPredictive']=moment()[_0xcd49('0x7a')](_0xcd49('0x104'));loggerPredictive[_0xcd49('0x7f')](_0x31710b[_0xcd49('0x3f')],_0xcd49('0x1d4'),_0x31710b[_0xcd49('0x28')]);clearInterval(_0x31710b['handlePredictive']);_0x31710b['handlePredictive']=undefined;this[_0xcd49('0xbd')](_0x31710b[_0xcd49('0x1d0')])['then'](this[_0xcd49('0x1d1')](_0x31710b))[_0xcd49('0xb8')](mergeDataErlangB(_0x31710b))[_0xcd49('0xb8')](this['startMethodPredictive'](_0x31710b))[_0xcd49('0xb9')](loggerCatchPredictive(_0xcd49('0x1d5'),_0x31710b));}else if(_0x31710b['predictiveIntervalAvailable']&&_0x5efada<_0x31710b['predictiveIntervalAvailable']-_0x51a8fe){freeVariablesPredictive(_0x31710b);loggerPredictive['info'](_0x31710b[_0xcd49('0x3f')],_0xcd49('0x1d6'),_0x5efada,_0xcd49('0x1d7'),_0x31710b[_0xcd49('0x70')],'-',_0x51a8fe,'=',_0x31710b[_0xcd49('0x70')]-_0x51a8fe,')');}else if(_0x31710b[_0xcd49('0x70')]&&_0x5efada>_0x31710b[_0xcd49('0x70')]+_0x164036){freeVariablesPredictive(_0x31710b);loggerPredictive[_0xcd49('0x7f')](_0x31710b['name'],_0xcd49('0x1d6'),_0x5efada,')\x20are\x20more\x20than\x20threshold\x20(',_0x31710b['predictiveIntervalAvailable'],'+',_0x164036,'=',_0x31710b[_0xcd49('0x70')]+_0x164036,')');}};Dialer[_0xcd49('0x1a')][_0xcd49('0x1d1')]=function(_0x4a85eb){var _0x194e34=this;return function(_0x1ff0b4){return new BPromise(function(_0x4c412d,_0x2abd70){_[_0xcd49('0x8e')](_0x4a85eb,_0x1ff0b4[0x0]);if(checkGetDataPredictive(_0x1ff0b4[0x0])){var _0x21f18f=_0x4a85eb['predictiveIntervalAvailable']=_0x4a85eb['talking']+_0x4a85eb['available'];var _0x467b9f=_0x4a85eb[_0xcd49('0x1d0')]*0x3c;var _0x5534af=_0x1ff0b4[0x0]['predictiveIntervalAvgTalktime']+_0x1ff0b4[0x0][_0xcd49('0x6a')];var _0x560cea=(_0x1ff0b4[0x0][_0xcd49('0x1d8')]+_0x1ff0b4[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1ff0b4[0x0][_0xcd49('0x125')])/_0x1ff0b4[0x0][_0xcd49('0x71')];_0x4a85eb['predictiveIntervalHitRate']=_0x560cea>0x0?_0x560cea:0x1;switch(_0x4a85eb[_0xcd49('0x1cb')]){case'dropRate':var _0x2a3753=_0x4a85eb[_0xcd49('0x1d9')]/0x64;return _0x194e34[_0xcd49('0x1da')](_0x21f18f,_0x467b9f,_0x5534af,_0x560cea,_0x2a3753)[_0xcd49('0xb8')](function(_0x38aacb){return _0x4c412d(_0x38aacb);});case'agentBusyFactor':var _0x1d3afb=_0x4a85eb['dialPredictiveOptimizationPercentage']/0x64;return _0x194e34['busyFactor'](_0x21f18f,_0x467b9f,_0x5534af,_0x560cea,_0x1d3afb)[_0xcd49('0xb8')](function(_0x69495d){return _0x4c412d(_0x69495d);});default:return _0x2abd70(msgResponse('[getDataPredictive]',_0xcd49('0x147'),_0xcd49('0x1db')));}}else{return _0x2abd70(msgResponse(_0xcd49('0x1dc'),_0xcd49('0x147'),'check\x20failure'));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x91b0c4){var _0x4edd32=this;return function(_0x1dfcc6){return new BPromise(function(_0x48c119,_0x4b360a){_[_0xcd49('0x8e')](_0x91b0c4,_0x1dfcc6[0x0]);if(checkGetDataPredictive(_0x1dfcc6[0x0])){loggerPredictive[_0xcd49('0x7f')](JSON[_0xcd49('0x49')](_0x1dfcc6[0x0]));if(_0x91b0c4[_0xcd49('0x1cb')]===_0xcd49('0x1cc')){return _0x4edd32[_0xcd49('0xc7')](_0x91b0c4['id'])[_0xcd49('0xb8')](function(_0x52a1a){var _0x2bb205=_0x91b0c4['loggedIn']-_0x52a1a[0x0][_0xcd49('0x1dd')];var _0x31a56d=_0x91b0c4['dialPredictiveInterval']*0x3c;var _0x2aaefd=_0x1dfcc6[0x0][_0xcd49('0x86')]+_0x1dfcc6[0x0]['predictiveIntervalAvgHoldtime'];var _0x2ee045=(_0x1dfcc6[0x0][_0xcd49('0x1d8')]+_0x1dfcc6[0x0][_0xcd49('0x6b')]+_0x1dfcc6[0x0][_0xcd49('0x125')])/_0x1dfcc6[0x0][_0xcd49('0x71')];var _0x28eb2f=_0x91b0c4['dialPredictiveOptimizationPercentage']/0x64;_0x91b0c4['predictiveIntervalPauses']=_0x52a1a[0x0]['outboundQueuePauses']||0x0;_0x91b0c4[_0xcd49('0x6d')]=_0x2ee045>0x0?_0x2ee045:0x1;return _0x4edd32[_0xcd49('0x1da')](_0x2bb205,_0x31a56d,_0x2aaefd,_0x2ee045,_0x28eb2f);})['then'](function(_0x1d1f21){return _0x48c119(_0x1d1f21);})[_0xcd49('0xb9')](function(_0x3b63ed){return _0x4b360a(msgResponse(_0xcd49('0x1de'),_0xcd49('0x147'),JSON['stringify'](_0x3b63ed)));});}if(_0x91b0c4[_0xcd49('0x1cb')]===_0xcd49('0x1df')){return _0x4edd32[_0xcd49('0xc7')](_0x91b0c4['id'])['then'](function(_0x2aaae3){var _0x46159b=_0x91b0c4[_0xcd49('0x160')]-_0x2aaae3[0x0]['outboundQueuePauses'];var _0x3702b2=_0x91b0c4[_0xcd49('0x1d0')]*0x3c;var _0x40e4b5=_0x1dfcc6[0x0][_0xcd49('0x86')]+_0x1dfcc6[0x0][_0xcd49('0x6a')];var _0x77df53=(_0x1dfcc6[0x0]['predictiveIntervalAnsweredCalls']+_0x1dfcc6[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1dfcc6[0x0][_0xcd49('0x125')])/_0x1dfcc6[0x0]['predictiveIntervalTotalCalls'];var _0x4fdacb=_0x91b0c4[_0xcd49('0x1d9')]/0x64;_0x91b0c4['predictiveIntervalPauses']=_0x2aaae3[0x0][_0xcd49('0x1dd')]||0x0;_0x91b0c4[_0xcd49('0x6d')]=_0x77df53>0x0?_0x77df53:0x1;return _0x4edd32[_0xcd49('0x1e0')](_0x46159b,_0x3702b2,_0x40e4b5,_0x77df53,_0x4fdacb);})[_0xcd49('0xb8')](function(_0x524603){return _0x48c119(_0x524603);})[_0xcd49('0xb9')](function(_0x4114d0){return _0x4b360a(msgResponse(_0xcd49('0x1de'),_0xcd49('0x147'),JSON['stringify'](_0x4114d0)));});}}else{return _0x4b360a(msgResponse('[getDataPredictive]',_0xcd49('0x147'),_0xcd49('0x1e1')));}});};};Dialer[_0xcd49('0x1a')][_0xcd49('0x1d2')]=function(_0xba84e8){var _0x226e7e=this;return function(){var _0x137440=0x0;var _0x4e9894=Math[_0xcd49('0x1e2')](_0xba84e8[_0xcd49('0x74')]*0x3e8);if(_0x4e9894>0x0){_0x4e9894=_0x4e9894<0x64?0x64:_0x4e9894;loggerPredictive[_0xcd49('0x7f')](_0xba84e8[_0xcd49('0x3f')],_0xcd49('0x1e3'),_0x4e9894,'milliseconds');_0xba84e8[_0xcd49('0x90')]=setInterval(function(){_0x226e7e[_0xcd49('0x90')](_0xba84e8);loggerPredictiveCalls['info']('[handlePredictive]',_0x137440+=0x1);},_0x4e9894);}else{loggerPredictive[_0xcd49('0x7f')](_0xba84e8[_0xcd49('0x3f')],_0xcd49('0x1e4'));}};};Dialer[_0xcd49('0x1a')][_0xcd49('0x1e5')]=function(_0x4e3535,_0x10ff14){var _0x3ae18a=this;return function(_0x17aaba){if(_[_0xcd49('0x47')](_0x17aaba)){if(_[_0xcd49('0xad')](_0x10ff14[_0xcd49('0xd4')])||!_0x10ff14[_0xcd49('0x1e6')]){if(_0x4e3535[_0xcd49('0x5c')]===_0xcd49('0x7')){_0x4e3535[_0xcd49('0x131')]=_[_0xcd49('0x3c')](_0x4e3535[_0xcd49('0x131')])?!![]:_0x4e3535[_0xcd49('0x131')];var _0x2d5eef=uuid['v4']();_0x3ae18a[_0xcd49('0x24')][_0x2d5eef]=new Action(_0x4e3535,_0x10ff14,_0x2d5eef);loggerBooked[_0xcd49('0x7f')](_0xcd49('0x1e7'),_0x2d5eef,_0xcd49('0x1e8'),JSON['stringify'](_0x4e3535[_0xcd49('0x131')]),_0xcd49('0x1e9'),_0x4e3535[_0xcd49('0x3f')]);if(_0x4e3535[_0xcd49('0x131')]){_0x4e3535['queueStatusComplete']=![];_0x3ae18a[_0xcd49('0x2a')][_0x3ae18a['actions'][_0x2d5eef]['queue']]=[];ami[_0xcd49('0xae')]({'actionid':_0x2d5eef,'action':'queuestatus','queue':_0x4e3535[_0xcd49('0x3f')]})[_0xcd49('0xb9')](function(){_0x3ae18a[_0xcd49('0xb2')](_0x4e3535);_0x3ae18a[_0xcd49('0xbf')]({'active':![],'ContactId':_0x3ae18a['actions'][_0x2d5eef][_0xcd49('0xd2')],'ListId':_0x3ae18a[_0xcd49('0x24')][_0x2d5eef]['ListId'],'VoiceQueueId':_0x3ae18a[_0xcd49('0x24')][_0x2d5eef]['VoiceQueueId']||undefined,'CampaignId':_0x3ae18a['actions'][_0x2d5eef][_0xcd49('0xd5')]||undefined})[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x1ea')));delete _0x3ae18a[_0xcd49('0x24')][_0x2d5eef];});}else{loggerBooked['info'](_0xcd49('0x1eb'),JSON[_0xcd49('0x49')](_0x4e3535[_0xcd49('0x131')]),_0xcd49('0x1e9'),_0x4e3535['name']);_0x3ae18a['updateOriginated'](_0x4e3535);_0x3ae18a['rescheduleContact']({'active':![],'ContactId':_0x3ae18a[_0xcd49('0x24')][_0x2d5eef][_0xcd49('0xd2')],'ListId':_0x3ae18a[_0xcd49('0x24')][_0x2d5eef][_0xcd49('0xd3')],'VoiceQueueId':_0x3ae18a[_0xcd49('0x24')][_0x2d5eef][_0xcd49('0x105')]||undefined,'CampaignId':_0x3ae18a[_0xcd49('0x24')][_0x2d5eef][_0xcd49('0xd5')]||undefined})[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x1ea')));delete _0x3ae18a[_0xcd49('0x24')][_0x2d5eef];}}else{return _0x3ae18a[_0xcd49('0x1ec')](_0x4e3535,_0x10ff14);}}else{if(getDiff(_0x10ff14[_0xcd49('0x1ed')])<_0x4e3535[_0xcd49('0x1ee')]*0x3c){if(_0x10ff14['Agent']&&!_0x10ff14[_0xcd49('0x1ef')][_0xcd49('0x1f0')]){_0x3ae18a[_0xcd49('0x1d')][_0xcd49('0x139')](_0x10ff14['id'])[_0xcd49('0x134')](function(){_0x3ae18a['updateOriginated'](_0x4e3535);});}else{_0x3ae18a[_0xcd49('0xc1')]({'active':![]},_0x10ff14['id'],0x1)[_0xcd49('0x134')](function(){_0x3ae18a[_0xcd49('0xb2')](_0x4e3535);});}}else{_0x4e3535[_0xcd49('0x67')]+=0x1;_0x3ae18a[_0xcd49('0xb2')](_0x4e3535);if(_0x4e3535[_0xcd49('0x1f1')]){_0x3ae18a['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x10ff14[_0xcd49('0xd2')],'ListId':_0x10ff14[_0xcd49('0xd3')],'VoiceQueueId':_0x10ff14['VoiceQueueId']||undefined,'CampaignId':_0x10ff14['CampaignId']||undefined})[_0xcd49('0xb9')](loggerCatch(_0xcd49('0x1f2')));_0x3ae18a[_0xcd49('0xcb')](createObjHistory(_0x4e3535,_0x10ff14,_0xcd49('0x1f3'),0x17,'RecallInQueue'))[_0xcd49('0xb9')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x3ae18a[_0xcd49('0xd0')](createObjHistory(_0x4e3535,_0x10ff14,_0xcd49('0x1f4'),0x16,'RecallFailedTimeout'),_0xcd49('0x1f5'),'[Originate][HistoryRecallClose]');}}}}else{_0x4e3535[_0xcd49('0x1f6')]+=0x1;_0x3ae18a[_0xcd49('0xd0')](createObjHistory(_0x4e3535,_0x10ff14,_0xcd49('0x1f7'),0xd,'Blacklist'),'[Originate][historyBlacklist]',_0xcd49('0x1f8'));throw _0xcd49('0x1f9');}};};Dialer['prototype'][_0xcd49('0x15f')]=function(_0x57ceaa){var _0x25e336=this;var _0x580feb=_0x57ceaa[_0xcd49('0x1fa')]-_0x57ceaa[_0xcd49('0x72')]-_0x57ceaa[_0xcd49('0xc4')];emitCampaignSummary(_0x57ceaa);if(_0x580feb>0x0){if(_0x580feb>this[_0xcd49('0x22')]){_0x580feb=this[_0xcd49('0x22')];}_0x57ceaa[_0xcd49('0xc4')]+=_0x580feb;this['getContactDialerIvr'](_0x57ceaa['id'],_0x580feb,_0x57ceaa[_0xcd49('0x1fb')],_0x57ceaa)[_0xcd49('0xb8')](function(_0x4133fd){_0x57ceaa['temp']-=_0x580feb;_0x57ceaa[_0xcd49('0xc4')]=_0x57ceaa[_0xcd49('0xc4')]>0x0?_0x57ceaa[_0xcd49('0xc4')]:0x0;if(!checkContactEmpty(_0x4133fd)){_0x57ceaa[_0xcd49('0x3d')]=_0xcd49('0x9f');logger[_0xcd49('0x7f')](_0xcd49('0x1fc')+_0x57ceaa[_0xcd49('0x3f')]);}else{_0x57ceaa[_0xcd49('0x72')]+=_0x4133fd[_0xcd49('0x98')];_0x57ceaa[_0xcd49('0x3d')]=_0xcd49('0x1fd');for(var _0x2e3c91=0x0;_0x2e3c91<_0x4133fd[_0xcd49('0x98')];_0x2e3c91+=0x1){_0x57ceaa[_0xcd49('0x1fe')]+=0x1;if(_['isNil'](_0x4133fd[_0x2e3c91])||_[_0xcd49('0xad')](_0x4133fd[_0x2e3c91][_0xcd49('0x16d')])||_[_0xcd49('0xad')](_0x4133fd[_0x2e3c91][_0xcd49('0x16d')]['phone'])){_0x25e336[_0xcd49('0x1ff')](_0xcd49('0x200'),_0x57ceaa,_0x4133fd[_0x2e3c91]);}else{_0x25e336[_0xcd49('0x201')](_[_0xcd49('0xd1')](_0x4133fd[_0x2e3c91],[_0xcd49('0xd5'),_0xcd49('0x202')]))['then'](_0x25e336[_0xcd49('0x1e5')](_0x57ceaa,_0x4133fd[_0x2e3c91]))[_0xcd49('0xb9')](_0x25e336[_0xcd49('0xce')](_0xcd49('0x203'),_0x57ceaa));}}}})['catch'](loggerGetContactDialer(_0xcd49('0x204'),_0x57ceaa,_0x580feb));}};Dialer[_0xcd49('0x1a')]['handlePower']=function(_0x4c8c5c,_0x130bac){var _0x32305b=this;var _0x4501bb=[];var _0x34f829=_0x130bac>=0x1?_0x130bac:0x1;if(_0x4c8c5c[_0xcd49('0x5c')]===_0xcd49('0x7')){_0x34f829=0x1;}var _0xad2eed=Math['floor'](_0x4c8c5c[_0xcd49('0x52')]*_0x34f829)-_0x4c8c5c['originated']-_0x4c8c5c[_0xcd49('0xc4')];emitVoiceQueueSummary(_0x4c8c5c);if(_0x4c8c5c[_0xcd49('0x205')]>0x0){var _0x5e94a2=_0x4c8c5c[_0xcd49('0x205')]-_0x4c8c5c['originated']-_0x4c8c5c['talking']-_0x4c8c5c[_0xcd49('0xc4')]-_0x4c8c5c[_0xcd49('0xa3')];if(_0xad2eed>_0x5e94a2){_0xad2eed=_0x5e94a2;}}if(_0xad2eed>0x0){if(_0x4c8c5c[_0xcd49('0x5c')]==='booked'){_0xad2eed=0x1;}if(_0xad2eed>this[_0xcd49('0x22')]){_0xad2eed=this[_0xcd49('0x22')];}_0x4c8c5c[_0xcd49('0xc4')]+=_0xad2eed;for(var _0x2495ba in this[_0xcd49('0x20')]){if(typeof this[_0xcd49('0x20')][_0x2495ba]!=='undefined'){if(this[_0xcd49('0x20')][_0x2495ba]['state']===_0xcd49('0x206')&&this[_0xcd49('0x20')][_0x2495ba]['status']===_0xcd49('0xdc')){_0x4501bb[_0xcd49('0x152')](this[_0xcd49('0x20')][_0x2495ba]['id']);}}}this[_0xcd49('0xc3')](_0x4c8c5c['id'],_0x4501bb,_0xad2eed,_0x4c8c5c[_0xcd49('0x1fb')],_0x4c8c5c)[_0xcd49('0xb8')](function(_0x28f51e){_0x4c8c5c['temp']-=_0xad2eed;_0x4c8c5c['temp']=_0x4c8c5c[_0xcd49('0xc4')]>0x0?_0x4c8c5c[_0xcd49('0xc4')]:0x0;if(!checkContactEmpty(_0x28f51e)){_0x32305b[_0xcd49('0xb6')](_0x4c8c5c)['then'](sendMessageReschedule(_0x4c8c5c))[_0xcd49('0xb9')](loggerCatch('[countReScheduled]\x20'));}else{_0x4c8c5c[_0xcd49('0x72')]+=_0x28f51e[_0xcd49('0x98')];_0x4c8c5c['message']=_0x4c8c5c['dialMethod']==='booked'?_0xcd49('0x173'):_0xcd49('0x1fd');for(var _0x97ef79=0x0;_0x97ef79<_0x28f51e[_0xcd49('0x98')];_0x97ef79+=0x1){if(_[_0xcd49('0xad')](_0x28f51e[_0x97ef79])||_[_0xcd49('0xad')](_0x28f51e[_0x97ef79][_0xcd49('0x16d')])||_[_0xcd49('0xad')](_0x28f51e[_0x97ef79]['Contact'][_0xcd49('0x16e')])){_0x32305b[_0xcd49('0x1ff')](_0xcd49('0x200'),_0x4c8c5c,_0x28f51e[_0x97ef79]);}else{_0x32305b[_0xcd49('0xbb')](_[_0xcd49('0xd1')](_0x28f51e[_0x97ef79],[_0xcd49('0x105'),_0xcd49('0x202')]))[_0xcd49('0xb8')](_0x32305b[_0xcd49('0x1e5')](_0x4c8c5c,_0x28f51e[_0x97ef79]))[_0xcd49('0xb9')](_0x32305b[_0xcd49('0xce')](_0xcd49('0x200'),_0x4c8c5c));}}}})[_0xcd49('0xb9')](loggerGetContactDialer(_0xcd49('0x207'),_0x4c8c5c,_0xad2eed));}};Dialer[_0xcd49('0x1a')][_0xcd49('0x90')]=function(_0x5464cc){if(_0x5464cc[_0xcd49('0x205')]>0x0){var _0x8a9648=_0x5464cc[_0xcd49('0x205')]-_0x5464cc[_0xcd49('0x72')]-_0x5464cc['talking'];if(_0x8a9648>0x0){this['tryOriginatePredictive'](_0x5464cc);}else{loggerPredictiveCalls[_0xcd49('0x7f')](_0xcd49('0x208'));}}else{this['tryOriginatePredictive'](_0x5464cc);}};Dialer[_0xcd49('0x1a')][_0xcd49('0x209')]=function(_0x545493){var _0x273cc9=this;var _0x381e13=[];_0x545493[_0xcd49('0x72')]+=0x1;for(var _0x9f8b8c in this[_0xcd49('0x20')]){if(typeof this[_0xcd49('0x20')][_0x9f8b8c]!==_0xcd49('0x99')){if(this['agents'][_0x9f8b8c][_0xcd49('0xa9')]==='not_inuse'&&this[_0xcd49('0x20')][_0x9f8b8c]['status']==='reachable'){_0x381e13[_0xcd49('0x152')](this[_0xcd49('0x20')][_0x9f8b8c]['id']);}}}this[_0xcd49('0xc3')](_0x545493['id'],_0x381e13,0x1,_0x545493[_0xcd49('0x1fb')],_0x545493)[_0xcd49('0xb8')](function(_0x384675){if(!checkContactEmpty(_0x384675)){checkContactLowerLimitOriginate(_0x545493,0x1,0x0);_0x273cc9[_0xcd49('0xb6')](_0x545493)[_0xcd49('0xb8')](sendMessageReschedule(_0x545493))['catch'](loggerCatch(_0xcd49('0xba')));}else{_0x545493[_0xcd49('0x3d')]='RUNNING';if(_[_0xcd49('0xad')](_0x384675[0x0])||_[_0xcd49('0xad')](_0x384675[0x0]['Contact'])||_[_0xcd49('0xad')](_0x384675[0x0][_0xcd49('0x16d')]['phone'])){_0x273cc9[_0xcd49('0x1ff')]('[actionOriginate]\x20',_0x545493,_0x384675[0x0]);}else{_0x273cc9[_0xcd49('0xbb')](_[_0xcd49('0xd1')](_0x384675[0x0],['VoiceQueueId',_0xcd49('0x202')]))[_0xcd49('0xb8')](_0x273cc9[_0xcd49('0x1e5')](_0x545493,_0x384675[0x0]))['catch'](_0x273cc9[_0xcd49('0xce')]('[actionOriginatePredictive]\x20',_0x545493));}}})[_0xcd49('0xb9')](loggerGetContactDialer('[getContactDialerPredictive]',_0x545493,0x1));emitVoiceQueueSummary(_0x545493);};Dialer[_0xcd49('0x1a')][_0xcd49('0x1da')]=function(_0x11fadd,_0x3031a5,_0x3a5f3c,_0x68f8ad,_0x553567,_0x32dd7c){loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x20a'));loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x20b'),_0x11fadd);loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x20c'),_0x3031a5);loggerPredictive[_0xcd49('0x7f')]('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',_0x3a5f3c);loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x20d'),_0x68f8ad);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x553567);loggerPredictive['info'](_0xcd49('0x8d'));return new BPromise(function(_0xd78c6d,_0x46aaf2){if(_0x11fadd<=0x0||isNaN(_0x11fadd)){return _0x46aaf2(msgResponse('[abandonmentRate]',_0xcd49('0x20e'),_0xcd49('0x20f')+_0x11fadd));}if(_0x3a5f3c<=0x0||isNaN(_0x3a5f3c)){return _0x46aaf2(msgResponse(_0xcd49('0x210'),_0xcd49('0x20e'),_0xcd49('0x211')+_0x3a5f3c));}if(_0x68f8ad<=0x0||isNaN(_0x68f8ad)){return _0x46aaf2(msgResponse(_0xcd49('0x210'),_0xcd49('0x20e'),_0xcd49('0x212')+_0x68f8ad));}if(_0x3031a5<=0x0||isNaN(_0x3031a5)){return _0x46aaf2(msgResponse('[abandonmentRate]',_0xcd49('0x20e'),_0xcd49('0x213')+_0x3031a5));}if(_0x553567<=0x0||isNaN(_0x553567)){return _0x46aaf2(msgResponse(_0xcd49('0x210'),_0xcd49('0x20e'),'Amax\x20=\x20'+_0x553567));}_0x32dd7c=_0x32dd7c||0x0;var _0x510068=0x1/_0x3a5f3c;var _0x429c9c=0x0;var _0x77fd89=0x0;var _0x2bae46=0x0;var _0x16948a=0x0;for(var _0x537c41=0x0;_0x2bae46<_0x553567;_0x537c41+=0x1){_0x77fd89=_0x537c41/_0x3031a5;_0x429c9c=(_0x68f8ad*_0x77fd89+_0x32dd7c)/_0x510068;_0x2bae46=erlangb(_0x429c9c,_0x11fadd);_0x16948a=_0x429c9c/_0x11fadd*(0x1-erlangb(_0x429c9c,_0x11fadd));}return _0xd78c6d({'erlangCalls':_0x537c41,'erlangCallToSecond':_0x3031a5/_0x537c41,'erlangAbandonmentRate':_0x2bae46,'erlangBusyFactor':_0x16948a});});};Dialer[_0xcd49('0x1a')][_0xcd49('0x1e0')]=function(_0x4ea2a9,_0x411f6b,_0x142ef2,_0x519dc8,_0x3121ec,_0x22b5f2){loggerPredictive['info'](_0xcd49('0x214'));loggerPredictive[_0xcd49('0x7f')]('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',_0x4ea2a9);loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x20c'),_0x411f6b);loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x215'),_0x142ef2);loggerPredictive[_0xcd49('0x7f')](_0xcd49('0x20d'),_0x519dc8);loggerPredictive['info'](_0xcd49('0x216'),_0x3121ec);loggerPredictive[_0xcd49('0x7f')]('---------------------------');return new BPromise(function(_0x25dc32,_0x259ca7){if(_0x4ea2a9<=0x0||isNaN(_0x4ea2a9)){return _0x259ca7(msgResponse(_0xcd49('0x217'),_0xcd49('0x20e'),_0xcd49('0x20f')+_0x4ea2a9));}if(_0x142ef2<=0x0||isNaN(_0x142ef2)){return _0x259ca7(msgResponse(_0xcd49('0x217'),_0xcd49('0x20e'),_0xcd49('0x211')+_0x142ef2));}if(_0x519dc8<=0x0||isNaN(_0x519dc8)){return _0x259ca7(msgResponse(_0xcd49('0x217'),_0xcd49('0x20e'),_0xcd49('0x212')+_0x519dc8));}if(_0x411f6b<=0x0||isNaN(_0x411f6b)){return _0x259ca7(msgResponse('[busyFactor]',_0xcd49('0x20e'),_0xcd49('0x213')+_0x411f6b));}if(_0x3121ec<=0x0||isNaN(_0x3121ec)){return _0x259ca7(msgResponse(_0xcd49('0x217'),_0xcd49('0x20e'),'Umin\x20=\x20'+_0x3121ec));}_0x22b5f2=_0x22b5f2||0x0;var _0x1bb20e=0x1/_0x142ef2;var _0x115f54=0x0;var _0x4a84d7=0x0;var _0x305914=0x0;var _0x1b963b=0x0;for(var _0x3249e2=0x0;_0x1b963b<_0x3121ec;_0x3249e2+=0x1){_0x4a84d7=_0x3249e2/_0x411f6b;_0x115f54=(_0x519dc8*_0x4a84d7+_0x22b5f2)/_0x1bb20e;_0x305914=erlangb(_0x115f54,_0x4ea2a9);_0x1b963b=_0x115f54/_0x4ea2a9*(0x1-erlangb(_0x115f54,_0x4ea2a9));}return _0x25dc32({'erlangCalls':_0x3249e2,'erlangCallToSecond':_0x411f6b/_0x3249e2,'erlangAbandonmentRate':_0x305914,'erlangBusyFactor':_0x1b963b});});};module['exports']=Dialer;
\ No newline at end of file
index 35eabca..1688824 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe70f=['type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','ringtime','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','moment','milliseconds','diff','seconds','scheduledat'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xe70f,0x14b));var _0xfe70=function(_0x59efd7,_0x4267df){_0x59efd7=_0x59efd7-0x0;var _0x28cd47=_0xe70f[_0x59efd7];return _0x28cd47;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xfe70('0x0'));function getSeconds(_0x16fe5a,_0xc35a72){var _0x1a0a90=moment(_0x16fe5a)[_0xfe70('0x1')](0x0);var _0x350f5d=moment(_0xc35a72)[_0xfe70('0x1')](0x0);return _0x1a0a90[_0xfe70('0x2')](_0x350f5d,_0xfe70('0x3'));}function QueueCallerAbandon(_0x3301eb,_0x343178){this['scheduledat']=_0x3301eb[_0xfe70('0x4')];this[_0xfe70('0x5')]=_0x3301eb['type'];this[_0xfe70('0x6')]=_0x3301eb['type']===_0xfe70('0x7')?'queue':_0x3301eb['type'];this['countbusyretry']=_0x3301eb['countbusyretry'];this[_0xfe70('0x8')]=_0x3301eb[_0xfe70('0x8')];this[_0xfe70('0x9')]=_0x3301eb['countnoanswerretry'];this[_0xfe70('0xa')]=_0x3301eb[_0xfe70('0xb')]+_0x3301eb['countcongestionretry']+_0x3301eb['countnoanswerretry']+_0x3301eb['countnosuchnumberretry']+_0x3301eb[_0xfe70('0xc')]+_0x3301eb[_0xfe70('0xd')]+_0x3301eb[_0xfe70('0xe')]+_0x3301eb['countagentrejectretry'];this[_0xfe70('0xf')]=_0x3301eb[_0xfe70('0xf')];this[_0xfe70('0xc')]=_0x3301eb[_0xfe70('0xc')];this['countabandonedretry']=_0x3301eb[_0xfe70('0xd')];this[_0xfe70('0xe')]=_0x3301eb[_0xfe70('0xe')];this['countagentrejectretry']=_0x3301eb[_0xfe70('0x10')];this[_0xfe70('0x11')]=_0x343178[_0xfe70('0x11')];this[_0xfe70('0x12')]=_0x3301eb[_0xfe70('0x13')];this[_0xfe70('0x14')]=_0x3301eb['number'];this[_0xfe70('0x15')]=_0x3301eb[_0xfe70('0x15')];this[_0xfe70('0x16')]=_0x3301eb[_0xfe70('0x16')];this['droptime']=_0x3301eb[_0xfe70('0x17')];this['endtime']=this[_0xfe70('0x17')];this[_0xfe70('0x18')]=getSeconds(_0x3301eb['responsetime'],_0x3301eb['starttime']);this[_0xfe70('0x19')]=getSeconds(this['droptime'],_0x3301eb[_0xfe70('0x16')]);this[_0xfe70('0x1a')]=0x0;this[_0xfe70('0x1b')]=_0x343178[_0xfe70('0x1b')];this[_0xfe70('0x1c')]=_0x343178[_0xfe70('0x1d')];this['reason']=_0x343178[_0xfe70('0x1e')];this[_0xfe70('0x1f')]=_0x3301eb[_0xfe70('0x1f')];this[_0xfe70('0x20')]=_0x3301eb[_0xfe70('0x20')];this[_0xfe70('0x21')]=_0x3301eb[_0xfe70('0x21')];this[_0xfe70('0x22')]=_0x3301eb[_0xfe70('0x22')];this[_0xfe70('0x23')]=_0x3301eb['ContactId'];this[_0xfe70('0x24')]=_0x3301eb[_0xfe70('0x24')];this[_0xfe70('0x25')]=_0x3301eb[_0xfe70('0x25')];this['VoiceQueueId']=_0x3301eb[_0xfe70('0x26')];this[_0xfe70('0x27')]=_0x3301eb[_0xfe70('0x27')];this[_0xfe70('0x28')]=_0x3301eb[_0xfe70('0x28')]||'';this['originatecalleridname']=_0x3301eb['originatecalleridname']||'';}module[_0xfe70('0x29')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x6cd1=['reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','endtime','ringtime','talktime','queue','connectedlinename'];(function(_0x1fdb54,_0x2845e8){var _0x3db65c=function(_0x316bce){while(--_0x316bce){_0x1fdb54['push'](_0x1fdb54['shift']());}};_0x3db65c(++_0x2845e8);}(_0x6cd1,0x1c4));var _0x16cd=function(_0x152b25,_0x5da2a5){_0x152b25=_0x152b25-0x0;var _0x41b54a=_0x6cd1[_0x152b25];return _0x41b54a;};'use strict';var util=require(_0x16cd('0x0'));var _=require(_0x16cd('0x1'));var moment=require(_0x16cd('0x2'));function getSeconds(_0x507e4a,_0x4d9e7a){var _0x1210c1=moment(_0x507e4a)['milliseconds'](0x0);var _0x54d346=moment(_0x4d9e7a)[_0x16cd('0x3')](0x0);return _0x1210c1[_0x16cd('0x4')](_0x54d346,_0x16cd('0x5'));}function QueueCallerAbandon(_0x1bf9b6,_0x535274){this[_0x16cd('0x6')]=_0x1bf9b6[_0x16cd('0x6')];this[_0x16cd('0x7')]=_0x1bf9b6[_0x16cd('0x7')];this['campaigntype']=_0x1bf9b6[_0x16cd('0x7')]===_0x16cd('0x8')?'queue':_0x1bf9b6['type'];this['countbusyretry']=_0x1bf9b6[_0x16cd('0x9')];this[_0x16cd('0xa')]=_0x1bf9b6[_0x16cd('0xa')];this['countnoanswerretry']=_0x1bf9b6[_0x16cd('0xb')];this[_0x16cd('0xc')]=_0x1bf9b6[_0x16cd('0x9')]+_0x1bf9b6[_0x16cd('0xa')]+_0x1bf9b6[_0x16cd('0xb')]+_0x1bf9b6[_0x16cd('0xd')]+_0x1bf9b6[_0x16cd('0xe')]+_0x1bf9b6[_0x16cd('0xf')]+_0x1bf9b6[_0x16cd('0x10')]+_0x1bf9b6[_0x16cd('0x11')];this['countnosuchnumberretry']=_0x1bf9b6['countnosuchnumberretry'];this[_0x16cd('0xe')]=_0x1bf9b6[_0x16cd('0xe')];this[_0x16cd('0xf')]=_0x1bf9b6[_0x16cd('0xf')];this['countmachineretry']=_0x1bf9b6[_0x16cd('0x10')];this['countagentrejectretry']=_0x1bf9b6[_0x16cd('0x11')];this[_0x16cd('0x12')]=_0x535274[_0x16cd('0x12')];this['calleridname']=_0x1bf9b6[_0x16cd('0x13')];this[_0x16cd('0x14')]=_0x1bf9b6['number'];this[_0x16cd('0x15')]=_0x1bf9b6['starttime'];this['responsetime']=_0x1bf9b6[_0x16cd('0x16')];this['droptime']=_0x1bf9b6['droptime'];this[_0x16cd('0x17')]=this['droptime'];this[_0x16cd('0x18')]=getSeconds(_0x1bf9b6[_0x16cd('0x16')],_0x1bf9b6['starttime']);this['holdtime']=getSeconds(this['droptime'],_0x1bf9b6[_0x16cd('0x16')]);this[_0x16cd('0x19')]=0x0;this[_0x16cd('0x1a')]=_0x535274[_0x16cd('0x1a')];this['membername']=_0x535274[_0x16cd('0x1b')];this[_0x16cd('0x1c')]=_0x535274['reason'];this[_0x16cd('0x1d')]=_0x1bf9b6[_0x16cd('0x1d')];this[_0x16cd('0x1e')]=_0x1bf9b6[_0x16cd('0x1e')];this[_0x16cd('0x1f')]=_0x1bf9b6[_0x16cd('0x1f')];this[_0x16cd('0x20')]=_0x1bf9b6[_0x16cd('0x20')];this[_0x16cd('0x21')]=_0x1bf9b6[_0x16cd('0x21')];this['ListId']=_0x1bf9b6[_0x16cd('0x22')];this[_0x16cd('0x23')]=_0x1bf9b6[_0x16cd('0x23')];this['VoiceQueueId']=_0x1bf9b6[_0x16cd('0x24')];this[_0x16cd('0x25')]=_0x1bf9b6[_0x16cd('0x25')];this[_0x16cd('0x26')]=_0x1bf9b6['originatecalleridnum']||'';this[_0x16cd('0x27')]=_0x1bf9b6[_0x16cd('0x27')]||'';}module['exports']=QueueCallerAbandon;
\ No newline at end of file
index 20b4bcb..176a005 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(_0x121fee,_0x334eb2){var _0x4957ee=function(_0x4deb95){while(--_0x4deb95){_0x121fee['push'](_0x121fee['shift']());}};_0x4957ee(++_0x334eb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x33e2e9,_0x278c01){var _0x4c2cc7=function(_0x15072b){while(--_0x15072b){_0x33e2e9['push'](_0x33e2e9['shift']());}};_0x4c2cc7(++_0x278c01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
index aaa838c..66ebc01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29c3=['varset','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','hangup','syncHangup','originateresponse','prototype','from-voip-provider','faxAccounts','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','syncVarSet','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','calleridnum','fax','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','catch','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path','Is\x20Valid','exports','lodash','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','../rpc/attachment','../rpc/faxMessage','channels','trunks','newchannel','syncNewchannel','bind'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x29c3,0x66));var _0x329c=function(_0x378f09,_0x2aa146){_0x378f09=_0x378f09-0x0;var _0x25977b=_0x29c3[_0x378f09];return _0x25977b;};'use strict';var util=require('util');var _=require(_0x329c('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x329c('0x1'));var path=require(_0x329c('0x2'));var tiff2pdf=require(_0x329c('0x3'));var gs=require(_0x329c('0x4'));var logger=require(_0x329c('0x5'))('fax');var ami=require(_0x329c('0x6'));var rpcDb=require('./rpcDb');var Channel=require(_0x329c('0x7'));var ut=require(_0x329c('0x8'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x329c('0x9'));var faxMessage=require(_0x329c('0xa'));function Fax(_0x1ac0c1){this[_0x329c('0xb')]={};this['faxAccounts']=_0x1ac0c1['faxAccounts'];this[_0x329c('0xc')]=_0x1ac0c1['trunks'];this['actions']={};ami['on'](_0x329c('0xd'),this[_0x329c('0xe')][_0x329c('0xf')](this));ami['on'](_0x329c('0x10'),this['syncVarSet'][_0x329c('0xf')](this));ami['on'](_0x329c('0x11'),this[_0x329c('0x12')][_0x329c('0xf')](this));ami['on']('newexten',this[_0x329c('0x13')]['bind'](this));ami['on'](_0x329c('0x14'),this[_0x329c('0x15')][_0x329c('0xf')](this));ami['on']('receivefax',this['syncReceiveFax'][_0x329c('0xf')](this));ami['on'](_0x329c('0x16'),this[_0x329c('0x17')]['bind'](this));ami['on'](_0x329c('0x18'),this['syncOriginateResponse'][_0x329c('0xf')](this));}Fax[_0x329c('0x19')][_0x329c('0xe')]=function(_0x360286){if(_0x360286['context']===_0x329c('0x1a')){for(var _0x20e7b5 in this['faxAccounts']){if(this[_0x329c('0x1b')][_0x329c('0x1c')](_0x20e7b5)){if(_0x360286[_0x329c('0x1d')]===this[_0x329c('0x1b')][_0x20e7b5][_0x329c('0x1e')]){this[_0x329c('0xb')][_0x360286[_0x329c('0x1f')]]={};this[_0x329c('0xb')][_0x360286[_0x329c('0x1f')]][_0x329c('0x20')]=_0x360286[_0x329c('0x20')];this['channels'][_0x360286[_0x329c('0x1f')]]['id']=this['faxAccounts'][_0x20e7b5]['id'];this['channels'][_0x360286[_0x329c('0x1f')]][_0x329c('0x21')]=this['faxAccounts'][_0x20e7b5][_0x329c('0x21')];logger[_0x329c('0x22')](_0x360286[_0x329c('0x1f')],_0x329c('0x23'));}}}}if(this[_0x329c('0x24')][_0x360286['uniqueid']]){this[_0x329c('0xb')][_0x360286['uniqueid']]={};this[_0x329c('0xb')][_0x360286[_0x329c('0x1f')]]['channel']=_0x360286['channel'];logger['info'](_0x360286[_0x329c('0x1f')],_0x329c('0x23'));}};Fax[_0x329c('0x19')][_0x329c('0x25')]=function(_0x3fb600){if(this[_0x329c('0xb')][_0x3fb600[_0x329c('0x1f')]]){for(var _0xee00b4 in _0x3fb600['variable']){if(_0x3fb600[_0x329c('0x26')]['hasOwnProperty'](_0xee00b4)){this[_0x329c('0xb')][_0x3fb600[_0x329c('0x1f')]][_0xee00b4]=_0x3fb600[_0x329c('0x27')];}}}};Fax[_0x329c('0x19')]['syncNewState']=function(_0x3ab649){if(this[_0x329c('0xb')][_0x3ab649[_0x329c('0x1f')]]){this[_0x329c('0xb')][_0x3ab649['uniqueid']][_0x329c('0x28')]=_0x3ab649[_0x329c('0x28')];this[_0x329c('0xb')][_0x3ab649[_0x329c('0x1f')]][_0x329c('0x29')]=_0x3ab649[_0x329c('0x29')];}};Fax['prototype'][_0x329c('0x13')]=function(_0x4ab24a){if(this[_0x329c('0xb')][_0x4ab24a[_0x329c('0x1f')]]){for(var _0x2d7c37 in _0x4ab24a[_0x329c('0x26')]){if(_0x4ab24a[_0x329c('0x26')][_0x329c('0x1c')](_0x2d7c37)){this['channels'][_0x4ab24a[_0x329c('0x1f')]][_0x2d7c37]=_0x4ab24a[_0x329c('0x27')];}}}};Fax[_0x329c('0x19')][_0x329c('0x15')]=function(_0x1989ab){if(this[_0x329c('0xb')][_0x1989ab[_0x329c('0x1f')]]){this['channels'][_0x1989ab['uniqueid']][_0x329c('0x2a')]=_0x1989ab[_0x329c('0x2a')];this['channels'][_0x1989ab[_0x329c('0x1f')]][_0x329c('0x2b')]=_0x1989ab['status'];this['channels'][_0x1989ab[_0x329c('0x1f')]][_0x329c('0x1e')]=_0x1989ab['localstationid'];this['channels'][_0x1989ab[_0x329c('0x1f')]][_0x329c('0x2c')]=_0x1989ab[_0x329c('0x2c')];logger[_0x329c('0x22')](_0x1989ab[_0x329c('0x1f')],_0x329c('0x2d'));}};Fax[_0x329c('0x19')][_0x329c('0x2e')]=function(_0xefab71){var _0x370f40=this;if(this['channels'][_0xefab71[_0x329c('0x1f')]]){var _0x425d0d=this[_0x329c('0xb')][_0xefab71['uniqueid']]['id'];this[_0x329c('0xb')][_0xefab71[_0x329c('0x1f')]][_0x329c('0x2f')]=_0xefab71[_0x329c('0x2f')];this[_0x329c('0xb')][_0xefab71['uniqueid']][_0x329c('0x30')]=_0xefab71[_0x329c('0x30')];this[_0x329c('0xb')][_0xefab71[_0x329c('0x1f')]][_0x329c('0x1e')]=_0xefab71['localstationid'];this[_0x329c('0xb')][_0xefab71[_0x329c('0x1f')]][_0x329c('0x31')]=_0xefab71[_0x329c('0x31')];this[_0x329c('0xb')][_0xefab71[_0x329c('0x1f')]]['transferrate']=_0xefab71['transferrate'];this[_0x329c('0xb')][_0xefab71[_0x329c('0x1f')]]['filename']=_0xefab71[_0x329c('0x2c')];this[_0x329c('0xb')][_0xefab71[_0x329c('0x1f')]]['calleridnum']=_0xefab71['calleridnum'];if(this['channels'][_0xefab71['uniqueid']][_0x329c('0x30')]>0x0){tiff2pdf(_0xefab71['filename'],_0x329c('0x32'),function(_0x1887ec){logger[_0x329c('0x22')](_0xefab71['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x1887ec[_0x329c('0x33')]);attachment[_0x329c('0x34')]({'name':path[_0x329c('0x35')](_0xefab71[_0x329c('0x2c')])['name'],'basename':path[_0x329c('0x35')](_0xefab71['filename'])[_0x329c('0x21')]+_0x329c('0x36'),'type':_0x329c('0x37')})['then'](function(_0x4786bc){faxAccount['notify'](_0x425d0d,{'from':_0xefab71[_0x329c('0x38')],'mapKey':_0x329c('0x39'),'body':path[_0x329c('0x35')](_0xefab71[_0x329c('0x2c')])['name']+_0x329c('0x36'),'AttachmentId':_0x4786bc['id']})['catch'](function(_0x17c485){logger[_0x329c('0x3a')](_0xefab71[_0x329c('0x1f')],_0x329c('0x3b'),JSON[_0x329c('0x3c')](_0x17c485));});})['catch'](function(_0x406a47){logger[_0x329c('0x3a')](_0xefab71['uniqueid'],_0x329c('0x3d'),JSON[_0x329c('0x3c')](_0x406a47));});});}logger[_0x329c('0x22')](_0xefab71[_0x329c('0x1f')],'\x20receiveFax\x20');}};Fax[_0x329c('0x19')][_0x329c('0x3e')]=function(_0x589128){if(this[_0x329c('0x24')][_0x589128[_0x329c('0x1f')]]){_[_0x329c('0x3f')](this[_0x329c('0xb')][_0x589128[_0x329c('0x1f')]],_[_0x329c('0x40')](_0x589128,[_0x329c('0x41'),_0x329c('0x42')]));}};function updateStatus(_0x1ddd34){if(_0x1ddd34[_0x329c('0x43')]){faxMessage[_0x329c('0x44')](_0x1ddd34[_0x329c('0x43')],{'failMessage':_0x329c('0x45')})[_0x329c('0x46')](function(_0x3ebe04){ut[_0x329c('0x47')](_0x329c('0x48'),_0x3ebe04);})['catch'](function(_0x51a791){ut[_0x329c('0x47')](_0x329c('0x49'),_0x51a791);});}else{ut['logger'](_0x329c('0x4a'));}}Fax[_0x329c('0x19')][_0x329c('0x4b')]=function(_0x5d50ad,_0x13e8a6,_0x41b951){var _0x1359ed=this;var _0x2fe337={};if(_0x13e8a6){_0x2fe337={'read':_0x13e8a6};}else{_0x2fe337={'failMessage':_0x41b951};}if(this[_0x329c('0x24')][_0x5d50ad][_0x329c('0x43')]){faxMessage['update'](this[_0x329c('0x24')][_0x5d50ad][_0x329c('0x43')],_0x2fe337)[_0x329c('0x46')](function(_0x519a10){ut['logger'](_0x329c('0x4c'),_0x519a10);})[_0x329c('0x4d')](function(_0x199cfa){ut['logger'](_0x329c('0x4e'),_0x199cfa);})[_0x329c('0x4f')](function(){delete _0x1359ed[_0x329c('0xb')][_0x5d50ad];delete _0x1359ed['actions'][_0x5d50ad];});}else{ut[_0x329c('0x47')]('[Fax][Message][NoUpdate2]');delete this[_0x329c('0xb')][_0x5d50ad];delete this[_0x329c('0x24')][_0x5d50ad];}};Fax['prototype'][_0x329c('0x17')]=function(_0x297fbe){var _0x4e973f=this;if(this[_0x329c('0xb')][_0x297fbe[_0x329c('0x1f')]]){if(this[_0x329c('0x24')][_0x297fbe['uniqueid']]){this[_0x329c('0xb')][_0x297fbe[_0x329c('0x1f')]]['id']=this[_0x329c('0x24')][_0x297fbe[_0x329c('0x1f')]]['id'];this[_0x329c('0xb')][_0x297fbe['uniqueid']][_0x329c('0x21')]=this[_0x329c('0x24')][_0x297fbe[_0x329c('0x1f')]][_0x329c('0x21')];}logger['info'](_0x297fbe[_0x329c('0x1f')],this[_0x329c('0x24')][_0x297fbe[_0x329c('0x1f')]]?_0x329c('0x50'):'\x20hangup\x20faxRiceive\x20',JSON[_0x329c('0x3c')](this[_0x329c('0xb')][_0x297fbe[_0x329c('0x1f')]]));if(this[_0x329c('0x24')][_0x297fbe[_0x329c('0x1f')]]){if(this['channels'][_0x297fbe[_0x329c('0x1f')]][_0x329c('0x51')]>0x0&&this[_0x329c('0xb')][_0x297fbe[_0x329c('0x1f')]][_0x329c('0x14')]===_0x329c('0x52')){this['updateStatus'](_0x297fbe[_0x329c('0x1f')],!![]);}else{this[_0x329c('0x4b')](_0x297fbe[_0x329c('0x1f')],![],this[_0x329c('0xb')][_0x297fbe[_0x329c('0x1f')]]['faxstatusstring']?_0x329c('0x53')+this[_0x329c('0xb')][_0x297fbe[_0x329c('0x1f')]][_0x329c('0x54')]:_0x329c('0x55'));}}}};Fax[_0x329c('0x19')][_0x329c('0x56')]=function(_0x3b70ee){var _0x4a5a38=this;return new BPromise(function(_0x10e3da,_0x2ad398){_0x4a5a38[_0x329c('0x57')](_0x3b70ee,_0x4a5a38[_0x329c('0x1b')][_0x3b70ee['FaxAccountId']])[_0x329c('0x46')](function(_0x211559){ut['logger'](_0x329c('0x58'),_0x211559);_0x10e3da(ut[_0x329c('0x33')]('Fax\x20received'));})[_0x329c('0x4d')](function(_0x245a51){ut[_0x329c('0x47')](_0x329c('0x59'),_0x245a51);updateStatus(_0x3b70ee);_0x2ad398(ut['message'](_0x329c('0x5a')));});});};Fax[_0x329c('0x19')][_0x329c('0x5b')]=function(_0x39467d){var _0x2fbaf3=this;return new BPromise(function(_0x5721bc,_0x267e7b){var _0xadfe84=_0x2fbaf3[_0x329c('0x5c')](_0x2fbaf3[_0x329c('0x1b')][_0x39467d[_0x329c('0x5d')]][_0x329c('0x5e')],_0x39467d);if(_0xadfe84[_0x329c('0x5f')]){_0x5721bc(ut[_0x329c('0x33')](_0x329c('0x60')));}else{_0x267e7b(ut[_0x329c('0x33')](_0xadfe84[_0x329c('0x33')]));}});};function originate(_0x5bb284,_0xc99526,_0x47d67f){return new BPromise(function(_0x293fdf,_0x21963a){if(_0x47d67f){var _0x22a8d6=util[_0x329c('0x61')]('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['parse'](_0x5bb284['path'])[_0x329c('0x21')],_0x5bb284[_0x329c('0x2')]);gs[_0x329c('0x62')](_0x22a8d6)[_0x329c('0x46')](function(){_0x5bb284[_0x329c('0x2')]=util[_0x329c('0x61')](_0x329c('0x63'),path['parse'](_0x5bb284[_0x329c('0x2')])[_0x329c('0x64')],path['parse'](_0x5bb284[_0x329c('0x2')])['name']);_0xc99526['XMF-PATH']=_0x5bb284[_0x329c('0x2')];ut['logger'](_0x329c('0x65'),'');ami['Action'](ut[_0x329c('0x66')](_0x5bb284,_0xc99526))[_0x329c('0x46')](function(_0x33aca8){_0x293fdf(_0x33aca8);})[_0x329c('0x4d')](function(_0x19822e){_0x21963a(_0x19822e);});})[_0x329c('0x4d')](function(_0x5b8c57){_0x21963a(_0x5b8c57);});}else{ami[_0x329c('0x67')](ut['variablesAction'](_0x5bb284,_0xc99526))[_0x329c('0x46')](function(_0x37edea){_0x293fdf(_0x37edea);})['catch'](function(_0x5d3113){_0x21963a(_0x5d3113);});}});}Fax['prototype'][_0x329c('0x57')]=function(_0x3e4e06,_0x4ea021){var _0x29794d=this;return new BPromise(function(_0x5793fd,_0x522283){var _0x19e635=uuid['v4']();var _0x38f4f1=ut[_0x329c('0x68')](_0x3e4e06,_0x4ea021);_0x29794d[_0x329c('0x24')][_0x19e635]=new Action(_0x19e635,_0x4ea021,_0x3e4e06);var _0x574aed=_0x29794d[_0x329c('0x24')][_0x19e635];if(path[_0x329c('0x35')](_0x3e4e06['path'])['ext']==='.pdf'){originate(_0x574aed,_0x38f4f1,!![])['then'](function(_0x193fcd){_0x5793fd(_0x193fcd);})[_0x329c('0x4d')](function(_0x4ea630){_0x522283(_0x4ea630);});}else{originate(_0x574aed,_0x38f4f1,![])[_0x329c('0x46')](function(_0x5986f7){_0x5793fd(_0x5986f7);})[_0x329c('0x4d')](function(_0x198813){_0x522283(_0x198813);});}});};Fax[_0x329c('0x19')]['isTrunkReachable']=function(_0x3e428c){return!_['isNil'](_0x3e428c)&&!_[_0x329c('0x69')](_0x3e428c[_0x329c('0x21')])&&!_['isNil'](_0x3e428c[_0x329c('0x6a')])&&_0x3e428c[_0x329c('0x6a')]&&!_[_0x329c('0x69')](this['trunks'][util[_0x329c('0x61')](_0x329c('0x6b'),_0x3e428c['name'])])&&!_[_0x329c('0x69')](this[_0x329c('0xc')][util[_0x329c('0x61')]('SIP/%s',_0x3e428c[_0x329c('0x21')])][_0x329c('0x2b')])&&(this['trunks'][util['format']('SIP/%s',_0x3e428c[_0x329c('0x21')])][_0x329c('0x2b')]===_0x329c('0x6c')||this['trunks'][util[_0x329c('0x61')](_0x329c('0x6b'),_0x3e428c[_0x329c('0x21')])][_0x329c('0x2b')]===_0x329c('0x6d'));};Fax[_0x329c('0x19')][_0x329c('0x5c')]=function(_0x172831,_0x247578){if(!this[_0x329c('0x6e')](_0x172831)){ut[_0x329c('0x47')](_0x329c('0x6f'),_[_0x329c('0x69')](_0x172831)?'':_0x172831['name']+_0x329c('0x70'));return{'isValid':![],'message':_0x329c('0x71')};}if(_[_0x329c('0x69')](_0x247578[_0x329c('0x39')])){ut['logger'](_0x329c('0x72'),JSON[_0x329c('0x3c')](_0x247578));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x247578[_0x329c('0x2')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0x329c('0x3c')](_0x247578));return{'isValid':![],'message':_0x329c('0x73')};}return{'isValid':!![],'message':_0x329c('0x74')};};module[_0x329c('0x75')]=Fax;
\ No newline at end of file
+var _0xcff3=['../../../config/logger','../ami','./rpcDb','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','varset','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','prototype','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird','path','./util/gs'];(function(_0x1bbc27,_0x2f9755){var _0x31f679=function(_0x24aeb0){while(--_0x24aeb0){_0x1bbc27['push'](_0x1bbc27['shift']());}};_0x31f679(++_0x2f9755);}(_0xcff3,0x6d));var _0x3cff=function(_0x146be0,_0x39a85e){_0x146be0=_0x146be0-0x0;var _0x1bcc25=_0xcff3[_0x146be0];return _0x1bcc25;};'use strict';var util=require(_0x3cff('0x0'));var _=require(_0x3cff('0x1'));var BPromise=require(_0x3cff('0x2'));var uuid=require('uuid');var moment=require('moment');var path=require(_0x3cff('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x3cff('0x4'));var logger=require(_0x3cff('0x5'))('fax');var ami=require(_0x3cff('0x6'));var rpcDb=require(_0x3cff('0x7'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x3cff('0x8'));var faxAccount=require(_0x3cff('0x9'));var attachment=require(_0x3cff('0xa'));var faxMessage=require(_0x3cff('0xb'));function Fax(_0x15c8b2){this[_0x3cff('0xc')]={};this[_0x3cff('0xd')]=_0x15c8b2[_0x3cff('0xd')];this[_0x3cff('0xe')]=_0x15c8b2[_0x3cff('0xe')];this[_0x3cff('0xf')]={};ami['on']('newchannel',this['syncNewchannel']['bind'](this));ami['on'](_0x3cff('0x10'),this['syncVarSet'][_0x3cff('0x11')](this));ami['on'](_0x3cff('0x12'),this[_0x3cff('0x13')][_0x3cff('0x11')](this));ami['on'](_0x3cff('0x14'),this[_0x3cff('0x15')][_0x3cff('0x11')](this));ami['on'](_0x3cff('0x16'),this[_0x3cff('0x17')][_0x3cff('0x11')](this));ami['on'](_0x3cff('0x18'),this[_0x3cff('0x19')]['bind'](this));ami['on']('hangup',this[_0x3cff('0x1a')][_0x3cff('0x11')](this));ami['on'](_0x3cff('0x1b'),this['syncOriginateResponse'][_0x3cff('0x11')](this));}Fax[_0x3cff('0x1c')]['syncNewchannel']=function(_0x5d18c5){if(_0x5d18c5['context']===_0x3cff('0x1d')){for(var _0x3231c4 in this[_0x3cff('0xd')]){if(this[_0x3cff('0xd')][_0x3cff('0x1e')](_0x3231c4)){if(_0x5d18c5['exten']===this[_0x3cff('0xd')][_0x3231c4][_0x3cff('0x1f')]){this[_0x3cff('0xc')][_0x5d18c5[_0x3cff('0x20')]]={};this[_0x3cff('0xc')][_0x5d18c5[_0x3cff('0x20')]]['channel']=_0x5d18c5[_0x3cff('0x21')];this[_0x3cff('0xc')][_0x5d18c5[_0x3cff('0x20')]]['id']=this[_0x3cff('0xd')][_0x3231c4]['id'];this[_0x3cff('0xc')][_0x5d18c5[_0x3cff('0x20')]][_0x3cff('0x22')]=this[_0x3cff('0xd')][_0x3231c4]['name'];logger[_0x3cff('0x23')](_0x5d18c5[_0x3cff('0x20')],_0x3cff('0x24'));}}}}if(this[_0x3cff('0xf')][_0x5d18c5[_0x3cff('0x20')]]){this[_0x3cff('0xc')][_0x5d18c5[_0x3cff('0x20')]]={};this['channels'][_0x5d18c5['uniqueid']][_0x3cff('0x21')]=_0x5d18c5['channel'];logger[_0x3cff('0x23')](_0x5d18c5[_0x3cff('0x20')],_0x3cff('0x24'));}};Fax[_0x3cff('0x1c')][_0x3cff('0x25')]=function(_0x36ac8e){if(this[_0x3cff('0xc')][_0x36ac8e['uniqueid']]){for(var _0x4618a7 in _0x36ac8e[_0x3cff('0x26')]){if(_0x36ac8e[_0x3cff('0x26')][_0x3cff('0x1e')](_0x4618a7)){this[_0x3cff('0xc')][_0x36ac8e[_0x3cff('0x20')]][_0x4618a7]=_0x36ac8e[_0x3cff('0x27')];}}}};Fax[_0x3cff('0x1c')][_0x3cff('0x13')]=function(_0x312fac){if(this[_0x3cff('0xc')][_0x312fac[_0x3cff('0x20')]]){this[_0x3cff('0xc')][_0x312fac[_0x3cff('0x20')]]['channelstate']=_0x312fac['channelstate'];this[_0x3cff('0xc')][_0x312fac[_0x3cff('0x20')]][_0x3cff('0x28')]=_0x312fac['channelstatedesc'];}};Fax[_0x3cff('0x1c')][_0x3cff('0x15')]=function(_0x46f20c){if(this[_0x3cff('0xc')][_0x46f20c[_0x3cff('0x20')]]){for(var _0xaf83ce in _0x46f20c['variable']){if(_0x46f20c[_0x3cff('0x26')][_0x3cff('0x1e')](_0xaf83ce)){this[_0x3cff('0xc')][_0x46f20c[_0x3cff('0x20')]][_0xaf83ce]=_0x46f20c[_0x3cff('0x27')];}}}};Fax[_0x3cff('0x1c')][_0x3cff('0x17')]=function(_0x13ee2e){if(this[_0x3cff('0xc')][_0x13ee2e[_0x3cff('0x20')]]){this[_0x3cff('0xc')][_0x13ee2e[_0x3cff('0x20')]][_0x3cff('0x29')]=_0x13ee2e[_0x3cff('0x29')];this[_0x3cff('0xc')][_0x13ee2e[_0x3cff('0x20')]][_0x3cff('0x2a')]=_0x13ee2e['status'];this[_0x3cff('0xc')][_0x13ee2e[_0x3cff('0x20')]]['localstationid']=_0x13ee2e[_0x3cff('0x1f')];this[_0x3cff('0xc')][_0x13ee2e[_0x3cff('0x20')]][_0x3cff('0x2b')]=_0x13ee2e[_0x3cff('0x2b')];logger['info'](_0x13ee2e['uniqueid'],_0x3cff('0x2c'));}};Fax[_0x3cff('0x1c')][_0x3cff('0x19')]=function(_0x35cbc8){var _0x22f671=this;if(this[_0x3cff('0xc')][_0x35cbc8[_0x3cff('0x20')]]){var _0x3a7a0b=this['channels'][_0x35cbc8[_0x3cff('0x20')]]['id'];this['channels'][_0x35cbc8[_0x3cff('0x20')]][_0x3cff('0x2d')]=_0x35cbc8['remotestationid'];this[_0x3cff('0xc')][_0x35cbc8[_0x3cff('0x20')]][_0x3cff('0x2e')]=_0x35cbc8[_0x3cff('0x2e')];this[_0x3cff('0xc')][_0x35cbc8[_0x3cff('0x20')]][_0x3cff('0x1f')]=_0x35cbc8['localstationid'];this[_0x3cff('0xc')][_0x35cbc8[_0x3cff('0x20')]]['resolution']=_0x35cbc8[_0x3cff('0x2f')];this[_0x3cff('0xc')][_0x35cbc8[_0x3cff('0x20')]]['transferrate']=_0x35cbc8[_0x3cff('0x30')];this['channels'][_0x35cbc8['uniqueid']][_0x3cff('0x2b')]=_0x35cbc8[_0x3cff('0x2b')];this['channels'][_0x35cbc8[_0x3cff('0x20')]][_0x3cff('0x31')]=_0x35cbc8[_0x3cff('0x31')];if(this[_0x3cff('0xc')][_0x35cbc8[_0x3cff('0x20')]][_0x3cff('0x2e')]>0x0){tiff2pdf(_0x35cbc8[_0x3cff('0x2b')],_0x3cff('0x32'),function(_0x46dfed){logger[_0x3cff('0x23')](_0x35cbc8[_0x3cff('0x20')],_0x3cff('0x33'),_0x46dfed[_0x3cff('0x34')]);attachment[_0x3cff('0x35')]({'name':path[_0x3cff('0x36')](_0x35cbc8[_0x3cff('0x2b')])[_0x3cff('0x22')],'basename':path['parse'](_0x35cbc8[_0x3cff('0x2b')])[_0x3cff('0x22')]+_0x3cff('0x37'),'type':_0x3cff('0x38')})[_0x3cff('0x39')](function(_0x2e924f){faxAccount[_0x3cff('0x3a')](_0x3a7a0b,{'from':_0x35cbc8[_0x3cff('0x31')],'mapKey':_0x3cff('0x3b'),'body':path[_0x3cff('0x36')](_0x35cbc8['filename'])['name']+_0x3cff('0x37'),'AttachmentId':_0x2e924f['id']})[_0x3cff('0x3c')](function(_0x43fa2f){logger[_0x3cff('0x3d')](_0x35cbc8[_0x3cff('0x20')],_0x3cff('0x3e'),JSON[_0x3cff('0x3f')](_0x43fa2f));});})['catch'](function(_0x4a4da1){logger[_0x3cff('0x3d')](_0x35cbc8[_0x3cff('0x20')],_0x3cff('0x40'),JSON[_0x3cff('0x3f')](_0x4a4da1));});});}logger['info'](_0x35cbc8[_0x3cff('0x20')],_0x3cff('0x40'));}};Fax['prototype'][_0x3cff('0x41')]=function(_0x4816bd){if(this[_0x3cff('0xf')][_0x4816bd[_0x3cff('0x20')]]){_[_0x3cff('0x42')](this['channels'][_0x4816bd['uniqueid']],_[_0x3cff('0x43')](_0x4816bd,[_0x3cff('0x44'),_0x3cff('0x45')]));}};function updateStatus(_0x3e1ce4){if(_0x3e1ce4[_0x3cff('0x46')]){faxMessage[_0x3cff('0x47')](_0x3e1ce4[_0x3cff('0x46')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x3cff('0x39')](function(_0x1a289c){ut[_0x3cff('0x48')]('[Fax][Message][Error][Updated]',_0x1a289c);})[_0x3cff('0x3c')](function(_0x3dde00){ut[_0x3cff('0x48')](_0x3cff('0x49'),_0x3dde00);});}else{ut[_0x3cff('0x48')](_0x3cff('0x4a'));}}Fax[_0x3cff('0x1c')][_0x3cff('0x4b')]=function(_0x247e51,_0x2fba7b,_0x383054){var _0x3c963f=this;var _0x3d7240={};if(_0x2fba7b){_0x3d7240={'read':_0x2fba7b};}else{_0x3d7240={'failMessage':_0x383054};}if(this[_0x3cff('0xf')][_0x247e51][_0x3cff('0x46')]){faxMessage[_0x3cff('0x47')](this[_0x3cff('0xf')][_0x247e51][_0x3cff('0x46')],_0x3d7240)[_0x3cff('0x39')](function(_0x165b8c){ut[_0x3cff('0x48')](_0x3cff('0x4c'),_0x165b8c);})[_0x3cff('0x3c')](function(_0x30828c){ut['logger'](_0x3cff('0x4d'),_0x30828c);})[_0x3cff('0x4e')](function(){delete _0x3c963f['channels'][_0x247e51];delete _0x3c963f[_0x3cff('0xf')][_0x247e51];});}else{ut[_0x3cff('0x48')]('[Fax][Message][NoUpdate2]');delete this[_0x3cff('0xc')][_0x247e51];delete this[_0x3cff('0xf')][_0x247e51];}};Fax['prototype'][_0x3cff('0x1a')]=function(_0x21b3b0){var _0x28ef88=this;if(this[_0x3cff('0xc')][_0x21b3b0[_0x3cff('0x20')]]){if(this[_0x3cff('0xf')][_0x21b3b0['uniqueid']]){this['channels'][_0x21b3b0[_0x3cff('0x20')]]['id']=this[_0x3cff('0xf')][_0x21b3b0['uniqueid']]['id'];this[_0x3cff('0xc')][_0x21b3b0['uniqueid']]['name']=this['actions'][_0x21b3b0[_0x3cff('0x20')]]['name'];}logger[_0x3cff('0x23')](_0x21b3b0['uniqueid'],this[_0x3cff('0xf')][_0x21b3b0[_0x3cff('0x20')]]?_0x3cff('0x4f'):_0x3cff('0x50'),JSON[_0x3cff('0x3f')](this[_0x3cff('0xc')][_0x21b3b0[_0x3cff('0x20')]]));if(this['actions'][_0x21b3b0[_0x3cff('0x20')]]){if(this[_0x3cff('0xc')][_0x21b3b0[_0x3cff('0x20')]][_0x3cff('0x51')]>0x0&&this['channels'][_0x21b3b0[_0x3cff('0x20')]][_0x3cff('0x16')]==='SUCCESS'){this[_0x3cff('0x4b')](_0x21b3b0[_0x3cff('0x20')],!![]);}else{this[_0x3cff('0x4b')](_0x21b3b0['uniqueid'],![],this['channels'][_0x21b3b0[_0x3cff('0x20')]][_0x3cff('0x52')]?_0x3cff('0x53')+this[_0x3cff('0xc')][_0x21b3b0[_0x3cff('0x20')]][_0x3cff('0x52')]:_0x3cff('0x54'));}}}};Fax[_0x3cff('0x1c')]['send']=function(_0x83dde7){var _0x1e05f9=this;return new BPromise(function(_0x1bb9ff,_0x735c15){_0x1e05f9[_0x3cff('0x55')](_0x83dde7,_0x1e05f9[_0x3cff('0xd')][_0x83dde7['FaxAccountId']])['then'](function(_0x1074a4){ut[_0x3cff('0x48')]('[Fax][execOriginate][success]',_0x1074a4);_0x1bb9ff(ut[_0x3cff('0x34')]('Fax\x20received'));})[_0x3cff('0x3c')](function(_0x156b47){ut['logger']('[Fax][execOriginate][failure]',_0x156b47);updateStatus(_0x83dde7);_0x735c15(ut[_0x3cff('0x34')](_0x3cff('0x56')));});});};Fax[_0x3cff('0x1c')][_0x3cff('0x57')]=function(_0x537263){var _0x2ee4ea=this;return new BPromise(function(_0x339806,_0x593cb2){var _0x2333b2=_0x2ee4ea[_0x3cff('0x58')](_0x2ee4ea['faxAccounts'][_0x537263[_0x3cff('0x59')]][_0x3cff('0x5a')],_0x537263);if(_0x2333b2[_0x3cff('0x5b')]){_0x339806(ut[_0x3cff('0x34')]('Trunk\x20Reachable'));}else{_0x593cb2(ut[_0x3cff('0x34')](_0x2333b2[_0x3cff('0x34')]));}});};function originate(_0x2c0713,_0x4a04ea,_0x4e324b){return new BPromise(function(_0x4f0e0a,_0x3bff4d){if(_0x4e324b){var _0x5b7d80=util[_0x3cff('0x5c')](_0x3cff('0x5d'),path[_0x3cff('0x36')](_0x2c0713[_0x3cff('0x3')])[_0x3cff('0x22')],_0x2c0713[_0x3cff('0x3')]);gs[_0x3cff('0x5e')](_0x5b7d80)[_0x3cff('0x39')](function(){_0x2c0713[_0x3cff('0x3')]=util[_0x3cff('0x5c')]('%s/%s.tif',path[_0x3cff('0x36')](_0x2c0713['path'])[_0x3cff('0x5f')],path[_0x3cff('0x36')](_0x2c0713['path'])[_0x3cff('0x22')]);_0x4a04ea[_0x3cff('0x60')]=_0x2c0713[_0x3cff('0x3')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x3cff('0x61')](ut['variablesAction'](_0x2c0713,_0x4a04ea))[_0x3cff('0x39')](function(_0x119d4d){_0x4f0e0a(_0x119d4d);})['catch'](function(_0x5eb486){_0x3bff4d(_0x5eb486);});})['catch'](function(_0x25a166){_0x3bff4d(_0x25a166);});}else{ami[_0x3cff('0x61')](ut[_0x3cff('0x62')](_0x2c0713,_0x4a04ea))['then'](function(_0x3a6ec1){_0x4f0e0a(_0x3a6ec1);})[_0x3cff('0x3c')](function(_0x15b590){_0x3bff4d(_0x15b590);});}});}Fax[_0x3cff('0x1c')][_0x3cff('0x55')]=function(_0x4f4eb4,_0x39fac1){var _0x4df6d4=this;return new BPromise(function(_0x11cac0,_0x3cf699){var _0x3aa772=uuid['v4']();var _0x216345=ut[_0x3cff('0x63')](_0x4f4eb4,_0x39fac1);_0x4df6d4['actions'][_0x3aa772]=new Action(_0x3aa772,_0x39fac1,_0x4f4eb4);var _0x43ffd9=_0x4df6d4[_0x3cff('0xf')][_0x3aa772];if(path[_0x3cff('0x36')](_0x4f4eb4[_0x3cff('0x3')])[_0x3cff('0x64')]===_0x3cff('0x37')){originate(_0x43ffd9,_0x216345,!![])[_0x3cff('0x39')](function(_0x22de44){_0x11cac0(_0x22de44);})[_0x3cff('0x3c')](function(_0x2903d2){_0x3cf699(_0x2903d2);});}else{originate(_0x43ffd9,_0x216345,![])['then'](function(_0xe8d37a){_0x11cac0(_0xe8d37a);})[_0x3cff('0x3c')](function(_0x220fa2){_0x3cf699(_0x220fa2);});}});};Fax[_0x3cff('0x1c')][_0x3cff('0x65')]=function(_0x1c7c3b){return!_['isNil'](_0x1c7c3b)&&!_[_0x3cff('0x66')](_0x1c7c3b[_0x3cff('0x22')])&&!_[_0x3cff('0x66')](_0x1c7c3b[_0x3cff('0x67')])&&_0x1c7c3b[_0x3cff('0x67')]&&!_[_0x3cff('0x66')](this[_0x3cff('0xe')][util[_0x3cff('0x5c')](_0x3cff('0x68'),_0x1c7c3b[_0x3cff('0x22')])])&&!_[_0x3cff('0x66')](this[_0x3cff('0xe')][util[_0x3cff('0x5c')]('SIP/%s',_0x1c7c3b[_0x3cff('0x22')])][_0x3cff('0x2a')])&&(this[_0x3cff('0xe')][util[_0x3cff('0x5c')](_0x3cff('0x68'),_0x1c7c3b[_0x3cff('0x22')])][_0x3cff('0x2a')]===_0x3cff('0x69')||this['trunks'][util[_0x3cff('0x5c')](_0x3cff('0x68'),_0x1c7c3b['name'])]['status']==='unmonitored');};Fax['prototype'][_0x3cff('0x58')]=function(_0x4230fd,_0x51079b){if(!this[_0x3cff('0x65')](_0x4230fd)){ut[_0x3cff('0x48')](_0x3cff('0x6a'),_[_0x3cff('0x66')](_0x4230fd)?'':_0x4230fd[_0x3cff('0x22')]+_0x3cff('0x6b'));return{'isValid':![],'message':_0x3cff('0x6c')};}if(_[_0x3cff('0x66')](_0x51079b['fax'])){ut[_0x3cff('0x48')](_0x3cff('0x6d'),JSON[_0x3cff('0x3f')](_0x51079b));return{'isValid':![],'message':_0x3cff('0x6e')};}if(_[_0x3cff('0x66')](_0x51079b[_0x3cff('0x3')])){ut['logger'](_0x3cff('0x6f'),JSON['stringify'](_0x51079b));return{'isValid':![],'message':_0x3cff('0x70')};}return{'isValid':!![],'message':_0x3cff('0x71')};};module['exports']=Fax;
\ No newline at end of file
index 3417e7a..1545445 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8246=['bluebird','preview','lodash','../rpc/faxAccount','error','notify','then','util'];(function(_0x19d334,_0x50f329){var _0x5dc8b6=function(_0x4d071f){while(--_0x4d071f){_0x19d334['push'](_0x19d334['shift']());}};_0x5dc8b6(++_0x50f329);}(_0x8246,0x197));var _0x6824=function(_0x4235b1,_0x53f0bb){_0x4235b1=_0x4235b1-0x0;var _0x38cbcd=_0x8246[_0x4235b1];return _0x38cbcd;};'use strict';var util=require(_0x6824('0x0'));var BPromise=require(_0x6824('0x1'));var logger=require('../../../config/logger')(_0x6824('0x2'));var _=require(_0x6824('0x3'));var faxAccount=require(_0x6824('0x4'));function loggerCatch(_0x39bbdc){return function(_0x173b7d){logger[_0x6824('0x5')](_0x39bbdc,util['inspect'](_0x173b7d,{'showHidden':![],'depth':null}));};}exports[_0x6824('0x6')]=function(_0x3ea6d8,_0x21e1ee){return BPromise['resolve']()[_0x6824('0x7')](faxAccount[_0x6824('0x6')](_0x3ea6d8,_0x21e1ee))['catch'](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
+var _0x1245=['notify','resolve','then','catch','util','bluebird','../../../config/logger','preview','lodash','error','inspect'];(function(_0x2307fa,_0x266e5e){var _0x496486=function(_0x53466e){while(--_0x53466e){_0x2307fa['push'](_0x2307fa['shift']());}};_0x496486(++_0x266e5e);}(_0x1245,0x1b1));var _0x5124=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1245[_0x17d9e3];return _0x14192d;};'use strict';var util=require(_0x5124('0x0'));var BPromise=require(_0x5124('0x1'));var logger=require(_0x5124('0x2'))(_0x5124('0x3'));var _=require(_0x5124('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x47c263){return function(_0x440f2f){logger[_0x5124('0x5')](_0x47c263,util[_0x5124('0x6')](_0x440f2f,{'showHidden':![],'depth':null}));};}exports[_0x5124('0x7')]=function(_0x13b3c7,_0xc01293){return BPromise[_0x5124('0x8')]()[_0x5124('0x9')](faxAccount['notify'](_0x13b3c7,_0xc01293))[_0x5124('0xa')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
index a3f5e06..c50cd23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x496b=['exec','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x1f4926,_0x2dc76e){var _0x5c0d7c=function(_0x35f4c4){while(--_0x35f4c4){_0x1f4926['push'](_0x1f4926['shift']());}};_0x5c0d7c(++_0x2dc76e);}(_0x496b,0xaf));var _0xb496=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x496b[_0x496738];return _0xee1381;};'use strict';var util=require(_0xb496('0x0'));var logger=require(_0xb496('0x1'))(_0xb496('0x2'));var BPromise=require(_0xb496('0x3'));var exec=require(_0xb496('0x4'))[_0xb496('0x5')];exports['execute']=function(_0x44a2e7){return new BPromise(function(_0x1bc258,_0x132370){exec(_0x44a2e7,function(_0x468ccc,_0x2babb5,_0x5ec057){logger[_0xb496('0x6')](_0xb496('0x7'),_0x2babb5);if(_0x468ccc){logger['info'](_0xb496('0x7'),_0xb496('0x8'),util[_0xb496('0x9')](_0x468ccc,{'showHidden':![],'depth':null}),_0x2babb5,_0x5ec057);_0x132370(_0x468ccc);}_0x1bc258(_0x2babb5);});});};
\ No newline at end of file
+var _0x7438=['util','../../../../config/logger','fax','bluebird','child_process','execute','Exec\x20gs','inspect'];(function(_0xd13d65,_0x244b22){var _0x272b67=function(_0x492406){while(--_0x492406){_0xd13d65['push'](_0xd13d65['shift']());}};_0x272b67(++_0x244b22);}(_0x7438,0x120));var _0x8743=function(_0x378a32,_0x3420fa){_0x378a32=_0x378a32-0x0;var _0x316076=_0x7438[_0x378a32];return _0x316076;};'use strict';var util=require(_0x8743('0x0'));var logger=require(_0x8743('0x1'))(_0x8743('0x2'));var BPromise=require(_0x8743('0x3'));var exec=require(_0x8743('0x4'))['exec'];exports[_0x8743('0x5')]=function(_0x4dd613){return new BPromise(function(_0x4c6ce9,_0x3734fd){exec(_0x4dd613,function(_0x10f708,_0x1f3507,_0x4a47a1){logger['info'](_0x8743('0x6'),_0x1f3507);if(_0x10f708){logger['info'](_0x8743('0x6'),'\x20Error\x20:',util[_0x8743('0x7')](_0x10f708,{'showHidden':![],'depth':null}),_0x1f3507,_0x4a47a1);_0x3734fd(_0x10f708);}_0x4c6ce9(_0x1f3507);});});};
\ No newline at end of file
index 5a98dcf..681d2e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x125a=['inspect','addVariables','headerinfo','minrate','format','\x22%s\x22','modem','gateway','t38timeout','localstationid','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','util','lodash','../../../../config/logger','message','logger','info'];(function(_0x159bab,_0x57b2c0){var _0x42b01c=function(_0x134cb5){while(--_0x134cb5){_0x159bab['push'](_0x159bab['shift']());}};_0x42b01c(++_0x57b2c0);}(_0x125a,0x78));var _0xa125=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x125a[_0x5959c9];return _0x4ffcbc;};'use strict';var util=require(_0xa125('0x0'));var _=require(_0xa125('0x1'));var moment=require('moment');var logger=require(_0xa125('0x2'))('fax');exports[_0xa125('0x3')]=function(_0x40872c){return{'message':_0x40872c};};exports[_0xa125('0x4')]=function(_0x5ece37,_0x215d38){logger[_0xa125('0x5')](_0x5ece37,util[_0xa125('0x6')](_0x215d38,{'showHidden':![],'depth':null}));};exports[_0xa125('0x7')]=function(_0x2918de,_0xfef7b0){var _0x41e2c7={'XMF-ECM':_0xfef7b0['ecm'],'XMF-HEADERINFO':_0xfef7b0[_0xa125('0x8')],'XMF-MINRATE':_0xfef7b0[_0xa125('0x9')],'XMF-MAXRATE':_0xfef7b0['maxrate'],'XMF-MODEM':util[_0xa125('0xa')](_0xa125('0xb'),_0xfef7b0[_0xa125('0xc')]),'XMF-GATEWAY':_0xfef7b0[_0xa125('0xd')],'XMF-FAXDETECT':_0xfef7b0['faxdetect'],'XMF-T38TIMEOUT':_0xfef7b0[_0xa125('0xe')],'XMF-LOCALSTATIONID':_0xfef7b0[_0xa125('0xf')],'XMF-PATH':_0x2918de['path']};return _0x41e2c7;};exports[_0xa125('0x10')]=function(_0x594bb6,_0x248f9d){return{'actionid':_0x594bb6[_0xa125('0x11')],'action':_0xa125('0x12'),'channel':_0x594bb6['channel'],'Exten':_0xa125('0x13'),'Context':_0xa125('0x14'),'Priority':'1','callerid':util[_0xa125('0xa')]('\x22%s\x22\x20<%s>',_0x594bb6['headerinfo']?_0x594bb6[_0xa125('0x8')]:'',_0x594bb6['localstationid']),'variable':_0x248f9d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x594bb6[_0xa125('0x11')]};};
\ No newline at end of file
+var _0x1812=['modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','message','logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22'];(function(_0x479a76,_0x5b0e34){var _0x3b3f3d=function(_0x49048b){while(--_0x49048b){_0x479a76['push'](_0x479a76['shift']());}};_0x3b3f3d(++_0x5b0e34);}(_0x1812,0x75));var _0x2181=function(_0x5f2a0d,_0x2425ed){_0x5f2a0d=_0x5f2a0d-0x0;var _0x73601a=_0x1812[_0x5f2a0d];return _0x73601a;};'use strict';var util=require(_0x2181('0x0'));var _=require(_0x2181('0x1'));var moment=require(_0x2181('0x2'));var logger=require('../../../../config/logger')('fax');exports[_0x2181('0x3')]=function(_0x400db3){return{'message':_0x400db3};};exports[_0x2181('0x4')]=function(_0x283cb4,_0xfcda71){logger['info'](_0x283cb4,util[_0x2181('0x5')](_0xfcda71,{'showHidden':![],'depth':null}));};exports[_0x2181('0x6')]=function(_0xd45964,_0x1713fe){var _0x32ae6a={'XMF-ECM':_0x1713fe[_0x2181('0x7')],'XMF-HEADERINFO':_0x1713fe[_0x2181('0x8')],'XMF-MINRATE':_0x1713fe[_0x2181('0x9')],'XMF-MAXRATE':_0x1713fe[_0x2181('0xa')],'XMF-MODEM':util[_0x2181('0xb')](_0x2181('0xc'),_0x1713fe[_0x2181('0xd')]),'XMF-GATEWAY':_0x1713fe[_0x2181('0xe')],'XMF-FAXDETECT':_0x1713fe[_0x2181('0xf')],'XMF-T38TIMEOUT':_0x1713fe[_0x2181('0x10')],'XMF-LOCALSTATIONID':_0x1713fe[_0x2181('0x11')],'XMF-PATH':_0xd45964[_0x2181('0x12')]};return _0x32ae6a;};exports[_0x2181('0x13')]=function(_0x18325e,_0x2a3ba6){return{'actionid':_0x18325e[_0x2181('0x14')],'action':_0x2181('0x15'),'channel':_0x18325e[_0x2181('0x16')],'Exten':_0x2181('0x17'),'Context':_0x2181('0x18'),'Priority':'1','callerid':util[_0x2181('0xb')](_0x2181('0x19'),_0x18325e['headerinfo']?_0x18325e[_0x2181('0x8')]:'',_0x18325e[_0x2181('0x11')]),'variable':_0x2a3ba6,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x18325e[_0x2181('0x14')]};};
\ No newline at end of file
index 373a690..415ec90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x849e=['./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./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/dynamics365','get','hour','then','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','log','listen','sync','catch','moment','./server','./realtime','./report','./acw','./trigger','./preview'];(function(_0x53914c,_0x302ac0){var _0x40decd=function(_0x4a14a0){while(--_0x4a14a0){_0x53914c['push'](_0x53914c['shift']());}};_0x40decd(++_0x302ac0);}(_0x849e,0x19d));var _0xe849=function(_0x2f6b21,_0x2f8725){_0x2f6b21=_0x2f6b21-0x0;var _0x5c74b0=_0x849e[_0x2f6b21];return _0x5c74b0;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require(_0xe849('0x0'));var server=require(_0xe849('0x1'));var Realtime=require(_0xe849('0x2'));var Report=require(_0xe849('0x3'));var Acw=require(_0xe849('0x4'));var Trigger=require(_0xe849('0x5'));var Dialer=require('./dialer');var Preview=require(_0xe849('0x6'));var Fax=require(_0xe849('0x7'));var user=require(_0xe849('0x8'));var voiceQueue=require(_0xe849('0x9'));var voiceQueueReport=require(_0xe849('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xe849('0xb'));var trigger=require(_0xe849('0xc'));var template=require(_0xe849('0xd'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xe849('0xe'));var voiceExtension=require(_0xe849('0xf'));var faxAccount=require(_0xe849('0x10'));var zendesk=require(_0xe849('0x11'));var salesforce=require(_0xe849('0x12'));var sugarcrm=require(_0xe849('0x13'));var freshdesk=require(_0xe849('0x14'));var desk=require(_0xe849('0x15'));var zoho=require(_0xe849('0x16'));var vtiger=require(_0xe849('0x17'));var freshsales=require(_0xe849('0x18'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xe849('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe849('0x1a')](_0xe849('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe849('0x1a')](_0xe849('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xe849('0x1c')](user['getAgents']())[_0xe849('0x1c')](realtime[_0xe849('0x1d')]())[_0xe849('0x1c')](user[_0xe849('0x1e')]())[_0xe849('0x1c')](realtime['initTelephones']())['then'](trunk[_0xe849('0x1f')]())['then'](realtime[_0xe849('0x20')]())['then'](voiceQueue[_0xe849('0x21')]())[_0xe849('0x1c')](realtime['initVoiceQueues']())[_0xe849('0x1c')](trigger[_0xe849('0x22')]())[_0xe849('0x1c')](realtime[_0xe849('0x23')]())[_0xe849('0x1c')](template[_0xe849('0x24')]())[_0xe849('0x1c')](realtime['initTemplates']())['then'](zendesk[_0xe849('0x25')]())[_0xe849('0x1c')](realtime[_0xe849('0x26')]())['then'](salesforce[_0xe849('0x27')]())[_0xe849('0x1c')](realtime[_0xe849('0x28')]())[_0xe849('0x1c')](sugarcrm[_0xe849('0x29')]())[_0xe849('0x1c')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xe849('0x2a')]())[_0xe849('0x1c')](realtime[_0xe849('0x2b')]())[_0xe849('0x1c')](desk[_0xe849('0x2c')]())[_0xe849('0x1c')](realtime['initDeskAccounts']())[_0xe849('0x1c')](zoho[_0xe849('0x2d')]())[_0xe849('0x1c')](realtime[_0xe849('0x2e')]())[_0xe849('0x1c')](vtiger['getVtigerAccounts']())[_0xe849('0x1c')](realtime[_0xe849('0x2f')]())[_0xe849('0x1c')](freshsales[_0xe849('0x30')]())[_0xe849('0x1c')](realtime[_0xe849('0x31')]())['then'](servicenow[_0xe849('0x32')]())[_0xe849('0x1c')](realtime[_0xe849('0x33')]())[_0xe849('0x1c')](dynamics365['getDynamics365Accounts']())[_0xe849('0x1c')](realtime[_0xe849('0x34')]())[_0xe849('0x1c')](campaign[_0xe849('0x35')]())[_0xe849('0x1c')](realtime[_0xe849('0x36')]())[_0xe849('0x1c')](voiceExtension[_0xe849('0x37')]())['then'](realtime[_0xe849('0x38')]())[_0xe849('0x1c')](faxAccount[_0xe849('0x39')]())[_0xe849('0x1c')](realtime[_0xe849('0x3a')]())[_0xe849('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0xe849('0x3b')]()['then'](voiceQueueReport[_0xe849('0x3c')]())[_0xe849('0x1c')](realtime[_0xe849('0x3d')]())[_0xe849('0x1c')](cmHopperHistory[_0xe849('0x3e')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0xe849('0x1c')](cmHopperHistory[_0xe849('0x3f')]())[_0xe849('0x1c')](realtime['initCampaignHopperHistory']())[_0xe849('0x1c')](voiceCallReport[_0xe849('0x40')]())[_0xe849('0x1c')](realtime[_0xe849('0x41')]())[_0xe849('0x1c')](function(_0x5a71d2){})['catch'](function(_0x339855){console[_0xe849('0x42')](_0x339855);});}function main(){return server[_0xe849('0x43')](realtime,preview,fax)['then'](function(_0x3cc071){return initRealtime();})[_0xe849('0x1c')](function(){return initParams();})['then'](function(){report[_0xe849('0x44')]();setInterval(initRealtime,0x1388);})[_0xe849('0x45')](function(_0x418649){console[_0xe849('0x42')](_0x418649);});}main();
\ No newline at end of file
+var _0xe7a5=['initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./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','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts'];(function(_0x29201a,_0x53338b){var _0x391538=function(_0x2af0cd){while(--_0x2af0cd){_0x29201a['push'](_0x29201a['shift']());}};_0x391538(++_0x53338b);}(_0xe7a5,0x170));var _0x5e7a=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xe7a5[_0x1b828b];return _0x98da1a;};'use strict';var BPromise=require(_0x5e7a('0x0'));var util=require(_0x5e7a('0x1'));var moment=require(_0x5e7a('0x2'));var server=require(_0x5e7a('0x3'));var Realtime=require(_0x5e7a('0x4'));var Report=require(_0x5e7a('0x5'));var Acw=require(_0x5e7a('0x6'));var Trigger=require(_0x5e7a('0x7'));var Dialer=require(_0x5e7a('0x8'));var Preview=require(_0x5e7a('0x9'));var Fax=require(_0x5e7a('0xa'));var user=require(_0x5e7a('0xb'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x5e7a('0xc'));var voiceCallReport=require(_0x5e7a('0xd'));var trunk=require('./rpc/trunk');var trigger=require(_0x5e7a('0xe'));var template=require(_0x5e7a('0xf'));var cmHopperHistory=require(_0x5e7a('0x10'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x5e7a('0x11'));var faxAccount=require(_0x5e7a('0x12'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x5e7a('0x13'));var sugarcrm=require(_0x5e7a('0x14'));var freshdesk=require(_0x5e7a('0x15'));var desk=require(_0x5e7a('0x16'));var zoho=require(_0x5e7a('0x17'));var vtiger=require(_0x5e7a('0x18'));var freshsales=require(_0x5e7a('0x19'));var servicenow=require(_0x5e7a('0x1a'));var dynamics365=require(_0x5e7a('0x1b'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x5e7a('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x5e7a('0x1d')]()[_0x5e7a('0x1e')](user['getAgents']())['then'](realtime[_0x5e7a('0x1f')]())[_0x5e7a('0x1e')](user[_0x5e7a('0x20')]())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x21')]())[_0x5e7a('0x1e')](trunk[_0x5e7a('0x22')]())[_0x5e7a('0x1e')](realtime['initTrunks']())['then'](voiceQueue[_0x5e7a('0x23')]())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x24')]())['then'](trigger[_0x5e7a('0x25')]())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x26')]())[_0x5e7a('0x1e')](template[_0x5e7a('0x27')]())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x28')]())[_0x5e7a('0x1e')](zendesk[_0x5e7a('0x29')]())[_0x5e7a('0x1e')](realtime['initZendeskAccounts']())[_0x5e7a('0x1e')](salesforce[_0x5e7a('0x2a')]())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x2b')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x2c')]())['then'](freshdesk[_0x5e7a('0x2d')]())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x2e')]())['then'](desk[_0x5e7a('0x2f')]())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x30')]())[_0x5e7a('0x1e')](zoho['getZohoAccounts']())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x31')]())[_0x5e7a('0x1e')](vtiger['getVtigerAccounts']())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x32')]())['then'](freshsales[_0x5e7a('0x33')]())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x34')]())['then'](servicenow[_0x5e7a('0x35')]())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x36')]())[_0x5e7a('0x1e')](dynamics365['getDynamics365Accounts']())['then'](realtime[_0x5e7a('0x37')]())[_0x5e7a('0x1e')](campaign[_0x5e7a('0x38')]())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x39')]())[_0x5e7a('0x1e')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0x5e7a('0x3a')]())['then'](faxAccount[_0x5e7a('0x3b')]())[_0x5e7a('0x1e')](realtime['initFaxAccounts']())[_0x5e7a('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x5e7a('0x1d')]()[_0x5e7a('0x1e')](voiceQueueReport[_0x5e7a('0x3c')]())['then'](realtime[_0x5e7a('0x3d')]())[_0x5e7a('0x1e')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x3e')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x3f')]())['then'](voiceCallReport['getVoiceCallReports']())[_0x5e7a('0x1e')](realtime[_0x5e7a('0x40')]())[_0x5e7a('0x1e')](function(_0x627527){})[_0x5e7a('0x41')](function(_0x1b32bb){console[_0x5e7a('0x42')](_0x1b32bb);});}function main(){return server[_0x5e7a('0x43')](realtime,preview,fax)[_0x5e7a('0x1e')](function(_0x3a13a8){return initRealtime();})[_0x5e7a('0x1e')](function(){return initParams();})[_0x5e7a('0x1e')](function(){report[_0x5e7a('0x44')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x1fdb97){console[_0x5e7a('0x42')](_0x1fdb97);});}main();
\ No newline at end of file
index be09ef6..8903bb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x56d74b,_0x25faac){var _0x2a5ebf=function(_0x35f2d0){while(--_0x35f2d0){_0x56d74b['push'](_0x56d74b['shift']());}};_0x2a5ebf(++_0x25faac);}(_0xe706,0xa3));var _0x6e70=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0xe706[_0x487ab4];return _0x3bef77;};'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
+var _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x497d6d,_0xff7558){var _0x4a1d9a=function(_0x2d2fdf){while(--_0x2d2fdf){_0x497d6d['push'](_0x497d6d['shift']());}};_0x4a1d9a(++_0xff7558);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent;
\ No newline at end of file
index 17d6ef8..60314ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6e0=['dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x46184c,_0x31958e){var _0x3127f2=function(_0x2e5542){while(--_0x2e5542){_0x46184c['push'](_0x46184c['shift']());}};_0x3127f2(++_0x31958e);}(_0xb6e0,0x66));var _0x0b6e=function(_0x33d3e8,_0x3f57a6){_0x33d3e8=_0x33d3e8-0x0;var _0x397d73=_0xb6e0[_0x33d3e8];return _0x397d73;};'use strict';function Campaign(_0x1051ba){this['id']=_0x1051ba['id']||0x0;this[_0x0b6e('0x0')]=_0x1051ba['name']||'';this[_0x0b6e('0x1')]=_0x1051ba[_0x0b6e('0x1')]||_0x0b6e('0x2');this[_0x0b6e('0x3')]=0x0;this[_0x0b6e('0x4')]=0x0;this[_0x0b6e('0x5')]=0x0;this[_0x0b6e('0x6')]=0x0;this[_0x0b6e('0x7')]='';this[_0x0b6e('0x8')]=!![];this[_0x0b6e('0x9')]=_0x1051ba[_0x0b6e('0x9')];this[_0x0b6e('0xa')]=_0x1051ba[_0x0b6e('0xa')];this[_0x0b6e('0xb')]=_0x1051ba[_0x0b6e('0xb')]||null;this[_0x0b6e('0xc')]=_0x1051ba['dialGlobalInterval']?_0x1051ba[_0x0b6e('0xc')]:null;this[_0x0b6e('0xd')]=_0x1051ba[_0x0b6e('0xd')];this[_0x0b6e('0xe')]=_0x1051ba[_0x0b6e('0xe')];this[_0x0b6e('0xf')]=_0x1051ba[_0x0b6e('0xf')]||0x1e;this[_0x0b6e('0x10')]=_0x1051ba[_0x0b6e('0x10')];this[_0x0b6e('0x11')]=_0x1051ba[_0x0b6e('0x11')];this[_0x0b6e('0x12')]=_0x1051ba[_0x0b6e('0x12')];this[_0x0b6e('0x13')]=_0x1051ba[_0x0b6e('0x13')];this[_0x0b6e('0x14')]=_0x1051ba[_0x0b6e('0x14')];this[_0x0b6e('0x15')]=_0x1051ba[_0x0b6e('0x15')];this['dialGlobalMaxRetry']=_0x1051ba[_0x0b6e('0x16')];this[_0x0b6e('0x17')]=_0x1051ba[_0x0b6e('0x17')]||0x3;this[_0x0b6e('0x18')]=_0x1051ba['dialNoSuchNumberRetryFrequency']||0x96;this[_0x0b6e('0x19')]=_0x1051ba[_0x0b6e('0x19')]||0x3;this[_0x0b6e('0x1a')]=_0x1051ba[_0x0b6e('0x1a')]||0x96;this[_0x0b6e('0x1b')]=_0x1051ba['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x1051ba[_0x0b6e('0x1c')]||0x96;this['dialMachineMaxRetry']=_0x1051ba['dialMachineMaxRetry']||0x3;this[_0x0b6e('0x1d')]=_0x1051ba[_0x0b6e('0x1d')]||0x96;this['dialAgentRejectMaxRetry']=_0x1051ba[_0x0b6e('0x1e')]||0x3;this[_0x0b6e('0x1f')]=_0x1051ba[_0x0b6e('0x1f')]||0x96;this[_0x0b6e('0x20')]=_0x1051ba[_0x0b6e('0x20')]||_0x0b6e('0x21');this[_0x0b6e('0x22')]=_0x1051ba[_0x0b6e('0x22')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x1051ba[_0x0b6e('0x23')]||undefined;this[_0x0b6e('0x24')]=_0x1051ba[_0x0b6e('0x24')]||undefined;this['TrunkBackup']=_0x1051ba[_0x0b6e('0x25')]?_0x1051ba[_0x0b6e('0x25')]:undefined;this[_0x0b6e('0x26')]=_0x1051ba[_0x0b6e('0x26')]?_0x1051ba['Trunk']:undefined;this[_0x0b6e('0x27')]=_0x1051ba[_0x0b6e('0x27')]?_0x1051ba[_0x0b6e('0x27')]:undefined;this['SquareProject']=_0x1051ba['SquareProject']?_0x1051ba[_0x0b6e('0x28')]:undefined;this['dialQueueProject']=_0x1051ba['SquareProject']?_0x1051ba[_0x0b6e('0x28')][_0x0b6e('0x0')]:undefined;this['dialAMDActive']=_0x1051ba[_0x0b6e('0x29')]||![];this['dialAMDInitialSilence']=_0x1051ba[_0x0b6e('0x2a')];this[_0x0b6e('0x2b')]=_0x1051ba[_0x0b6e('0x2b')];this['dialAMDAfterGreetingSilence']=_0x1051ba['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x1051ba[_0x0b6e('0x2c')];this[_0x0b6e('0x2d')]=_0x1051ba[_0x0b6e('0x2d')];this['dialAMDBetweenWordsSilence']=_0x1051ba[_0x0b6e('0x2e')];this['dialAMDMaximumNumberOfWords']=_0x1051ba[_0x0b6e('0x2f')];this['dialAMDSilenceThreshold']=_0x1051ba['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x1051ba[_0x0b6e('0x30')];}module[_0x0b6e('0x31')]=Campaign;
\ No newline at end of file
+var _0xd012=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialCutDigit','TrunkBackup','Trunk','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xd012,0xe2));var _0x2d01=function(_0x30a266,_0x313f44){_0x30a266=_0x30a266-0x0;var _0x173bb6=_0xd012[_0x30a266];return _0x173bb6;};'use strict';function Campaign(_0x4cdec5){this['id']=_0x4cdec5['id']||0x0;this[_0x2d01('0x0')]=_0x4cdec5[_0x2d01('0x0')]||'';this[_0x2d01('0x1')]=_0x4cdec5[_0x2d01('0x1')]||_0x2d01('0x2');this[_0x2d01('0x3')]=0x0;this[_0x2d01('0x4')]=0x0;this[_0x2d01('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x2d01('0x6')]='';this[_0x2d01('0x7')]=!![];this[_0x2d01('0x8')]=_0x4cdec5['active'];this[_0x2d01('0x9')]=_0x4cdec5[_0x2d01('0x9')];this[_0x2d01('0xa')]=_0x4cdec5[_0x2d01('0xa')]||null;this[_0x2d01('0xb')]=_0x4cdec5[_0x2d01('0xb')]?_0x4cdec5['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x4cdec5[_0x2d01('0xc')];this['dialOriginateCallerIdNumber']=_0x4cdec5[_0x2d01('0xd')];this[_0x2d01('0xe')]=_0x4cdec5[_0x2d01('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x4cdec5[_0x2d01('0xf')];this[_0x2d01('0x10')]=_0x4cdec5[_0x2d01('0x10')];this[_0x2d01('0x11')]=_0x4cdec5[_0x2d01('0x11')];this[_0x2d01('0x12')]=_0x4cdec5[_0x2d01('0x12')];this[_0x2d01('0x13')]=_0x4cdec5['dialNoAnswerMaxRetry'];this[_0x2d01('0x14')]=_0x4cdec5[_0x2d01('0x14')];this[_0x2d01('0x15')]=_0x4cdec5['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x4cdec5[_0x2d01('0x16')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4cdec5['dialNoSuchNumberRetryFrequency']||0x96;this[_0x2d01('0x17')]=_0x4cdec5[_0x2d01('0x17')]||0x3;this[_0x2d01('0x18')]=_0x4cdec5[_0x2d01('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x4cdec5[_0x2d01('0x19')]||0x3;this[_0x2d01('0x1a')]=_0x4cdec5['dialAbandonedRetryFrequency']||0x96;this[_0x2d01('0x1b')]=_0x4cdec5[_0x2d01('0x1b')]||0x3;this[_0x2d01('0x1c')]=_0x4cdec5[_0x2d01('0x1c')]||0x96;this[_0x2d01('0x1d')]=_0x4cdec5['dialAgentRejectMaxRetry']||0x3;this[_0x2d01('0x1e')]=_0x4cdec5[_0x2d01('0x1e')]||0x96;this[_0x2d01('0x1f')]=_0x4cdec5['dialOrderByScheduledAt']||'DESC';this[_0x2d01('0x20')]=_0x4cdec5[_0x2d01('0x20')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x4cdec5['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x2d01('0x21')]=_0x4cdec5[_0x2d01('0x21')]||undefined;this[_0x2d01('0x22')]=_0x4cdec5[_0x2d01('0x22')]?_0x4cdec5[_0x2d01('0x22')]:undefined;this[_0x2d01('0x23')]=_0x4cdec5[_0x2d01('0x23')]?_0x4cdec5[_0x2d01('0x23')]:undefined;this['Interval']=_0x4cdec5['Interval']?_0x4cdec5['Interval']:undefined;this[_0x2d01('0x24')]=_0x4cdec5[_0x2d01('0x24')]?_0x4cdec5['SquareProject']:undefined;this[_0x2d01('0x25')]=_0x4cdec5[_0x2d01('0x24')]?_0x4cdec5[_0x2d01('0x24')][_0x2d01('0x0')]:undefined;this[_0x2d01('0x26')]=_0x4cdec5[_0x2d01('0x26')]||![];this['dialAMDInitialSilence']=_0x4cdec5[_0x2d01('0x27')];this[_0x2d01('0x28')]=_0x4cdec5['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x4cdec5[_0x2d01('0x29')];this[_0x2d01('0x2a')]=_0x4cdec5[_0x2d01('0x2a')];this['dialAMDMinWordLength']=_0x4cdec5[_0x2d01('0x2b')];this[_0x2d01('0x2c')]=_0x4cdec5[_0x2d01('0x2c')];this[_0x2d01('0x2d')]=_0x4cdec5[_0x2d01('0x2d')];this[_0x2d01('0x2e')]=_0x4cdec5[_0x2d01('0x2e')];this[_0x2d01('0x2f')]=_0x4cdec5[_0x2d01('0x2f')];}module[_0x2d01('0x30')]=Campaign;
\ No newline at end of file
index 81e7b09..6a64606 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea12=['exten','answertime','endtime','abandoned','duration','billableseconds','type','tag','queue','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','context','uniqueid','linkedid'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xea12,0x1c5));var _0x2ea1=function(_0x18fdfb,_0x1bea79){_0x18fdfb=_0x18fdfb-0x0;var _0x4a0a85=_0xea12[_0x18fdfb];return _0x4a0a85;};'use strict';function Channel(){this[_0x2ea1('0x0')]=null;this[_0x2ea1('0x1')]='';this[_0x2ea1('0x2')]='';this[_0x2ea1('0x3')]=0x0;this['calleridname']='';this[_0x2ea1('0x4')]=undefined;this[_0x2ea1('0x5')]=undefined;this['accountcode']=0x0;this[_0x2ea1('0x6')]='';this[_0x2ea1('0x7')]=0x0;this[_0x2ea1('0x8')]=0x0;this[_0x2ea1('0x9')]=0x0;this['answered']=![];this[_0x2ea1('0xa')]=null;this[_0x2ea1('0xb')]=null;this['unmanaged']=![];this[_0x2ea1('0xc')]=![];this['lastapplication']='';this['lastdata']='';this[_0x2ea1('0xd')]=0x0;this[_0x2ea1('0xe')]=0x0;this['holdtime']=0x0;this[_0x2ea1('0xf')]=null;this[_0x2ea1('0x10')]=null;this['disposition']=null;this['monitor']=![];this['monitorFilename']=null;this[_0x2ea1('0x11')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x2ea1('0x12')]=undefined;this[_0x2ea1('0x13')]=0x0;}module[_0x2ea1('0x14')]=Channel;
\ No newline at end of file
+var _0xbeb6=['accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','disposition','monitor','queue','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename'];(function(_0x30f075,_0x3df97b){var _0x554f86=function(_0xa02c09){while(--_0xa02c09){_0x30f075['push'](_0x30f075['shift']());}};_0x554f86(++_0x3df97b);}(_0xbeb6,0x19e));var _0x6beb=function(_0x4ab7bb,_0x1a8418){_0x4ab7bb=_0x4ab7bb-0x0;var _0x10477a=_0xbeb6[_0x4ab7bb];return _0x10477a;};'use strict';function Channel(){this['starttime']=null;this[_0x6beb('0x0')]='';this[_0x6beb('0x1')]='';this[_0x6beb('0x2')]=0x0;this[_0x6beb('0x3')]='';this[_0x6beb('0x4')]=undefined;this[_0x6beb('0x5')]=undefined;this[_0x6beb('0x6')]=0x0;this[_0x6beb('0x7')]='';this[_0x6beb('0x8')]=0x0;this[_0x6beb('0x9')]=0x0;this[_0x6beb('0xa')]=0x0;this[_0x6beb('0xb')]=![];this[_0x6beb('0xc')]=null;this[_0x6beb('0xd')]=null;this['unmanaged']=![];this[_0x6beb('0xe')]=![];this[_0x6beb('0xf')]='';this[_0x6beb('0x10')]='';this['duration']=0x0;this[_0x6beb('0x11')]=0x0;this[_0x6beb('0x12')]=0x0;this[_0x6beb('0x13')]=null;this['tag']=null;this[_0x6beb('0x14')]=null;this[_0x6beb('0x15')]=![];this['monitorFilename']=null;this[_0x6beb('0x16')]=null;this['monitors']=[];this[_0x6beb('0x17')]=undefined;this[_0x6beb('0x18')]=undefined;this[_0x6beb('0x19')]=undefined;this[_0x6beb('0x1a')]=0x0;}module[_0x6beb('0x1b')]=Channel;
\ No newline at end of file
index 2b0960e..4106941 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca5e=['tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','consumerSecret','token'];(function(_0x574ef0,_0xbb264c){var _0x364c97=function(_0x22cf99){while(--_0x22cf99){_0x574ef0['push'](_0x574ef0['shift']());}};_0x364c97(++_0xbb264c);}(_0xca5e,0x108));var _0xeca5=function(_0x4b61d2,_0x4c9cdb){_0x4b61d2=_0x4b61d2-0x0;var _0x33fc2a=_0xca5e[_0x4b61d2];return _0x33fc2a;};'use strict';function DeskAccount(_0x57d4b7){this['id']=_0x57d4b7['id']||0x0;this[_0xeca5('0x0')]=_0x57d4b7['name']||'';this[_0xeca5('0x1')]=_0x57d4b7[_0xeca5('0x1')]||'';this[_0xeca5('0x2')]=_0x57d4b7['remoteUri']||'';this[_0xeca5('0x3')]=_0x57d4b7['authType']||'';this['password']=_0x57d4b7['password']||'';this['consumerKey']=_0x57d4b7['consumerKey']||'';this[_0xeca5('0x4')]=_0x57d4b7['consumerSecret']||'';this[_0xeca5('0x5')]=_0x57d4b7[_0xeca5('0x5')]||'';this['tokenSecret']=_0x57d4b7[_0xeca5('0x6')]||'';this[_0xeca5('0x7')]=_0x57d4b7[_0xeca5('0x7')]||'';this['serverUrl']=_0x57d4b7[_0xeca5('0x8')]||'';this[_0xeca5('0x9')]=_0x57d4b7[_0xeca5('0x9')]||{};}module['exports']=DeskAccount;
\ No newline at end of file
+var _0xe79b=['Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x2afccc,_0x443a1a){var _0x485666=function(_0x3ce6a8){while(--_0x3ce6a8){_0x2afccc['push'](_0x2afccc['shift']());}};_0x485666(++_0x443a1a);}(_0xe79b,0x18d));var _0xbe79=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0xe79b[_0x53fe97];return _0x5c49a2;};'use strict';function DeskAccount(_0x56591f){this['id']=_0x56591f['id']||0x0;this[_0xbe79('0x0')]=_0x56591f['name']||'';this[_0xbe79('0x1')]=_0x56591f[_0xbe79('0x1')]||'';this[_0xbe79('0x2')]=_0x56591f[_0xbe79('0x2')]||'';this['authType']=_0x56591f[_0xbe79('0x3')]||'';this['password']=_0x56591f[_0xbe79('0x4')]||'';this[_0xbe79('0x5')]=_0x56591f[_0xbe79('0x5')]||'';this['consumerSecret']=_0x56591f[_0xbe79('0x6')]||'';this[_0xbe79('0x7')]=_0x56591f['token']||'';this[_0xbe79('0x8')]=_0x56591f[_0xbe79('0x8')]||'';this[_0xbe79('0x9')]=_0x56591f[_0xbe79('0x9')]||'';this['serverUrl']=_0x56591f[_0xbe79('0xa')]||'';this[_0xbe79('0xb')]=_0x56591f['Configurations']||{};}module['exports']=DeskAccount;
\ No newline at end of file
index 94a3602..5ed4728 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e6c=['clientSecret','serverUrl','Configurations','name','username','remoteUri','tenantId','clientId'];(function(_0x207489,_0xad20bf){var _0x23b632=function(_0x51f8ee){while(--_0x51f8ee){_0x207489['push'](_0x207489['shift']());}};_0x23b632(++_0xad20bf);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';function Dynamics365Account(_0xc51915){this['id']=_0xc51915['id']||0x0;this[_0xc6e6('0x0')]=_0xc51915['name']||'';this[_0xc6e6('0x1')]=_0xc51915[_0xc6e6('0x1')]||'';this['password']=_0xc51915['password']||'';this[_0xc6e6('0x2')]=_0xc51915['remoteUri']||'';this[_0xc6e6('0x3')]=_0xc51915['tenantId']||'';this[_0xc6e6('0x4')]=_0xc51915[_0xc6e6('0x4')]||'';this['clientSecret']=_0xc51915[_0xc6e6('0x5')]||{};this[_0xc6e6('0x6')]=_0xc51915['serverUrl']||'';this[_0xc6e6('0x7')]=_0xc51915[_0xc6e6('0x7')]||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
+var _0x4483=['tenantId','clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x3a0ac1,_0x3acd7d){var _0x44424c=function(_0x253ce2){while(--_0x253ce2){_0x3a0ac1['push'](_0x3a0ac1['shift']());}};_0x44424c(++_0x3acd7d);}(_0x4483,0x1a3));var _0x3448=function(_0x56f854,_0x1760d0){_0x56f854=_0x56f854-0x0;var _0x582d6c=_0x4483[_0x56f854];return _0x582d6c;};'use strict';function Dynamics365Account(_0x43f30d){this['id']=_0x43f30d['id']||0x0;this[_0x3448('0x0')]=_0x43f30d[_0x3448('0x0')]||'';this['username']=_0x43f30d[_0x3448('0x1')]||'';this[_0x3448('0x2')]=_0x43f30d[_0x3448('0x2')]||'';this[_0x3448('0x3')]=_0x43f30d[_0x3448('0x3')]||'';this['tenantId']=_0x43f30d[_0x3448('0x4')]||'';this[_0x3448('0x5')]=_0x43f30d[_0x3448('0x5')]||'';this[_0x3448('0x6')]=_0x43f30d[_0x3448('0x6')]||{};this[_0x3448('0x7')]=_0x43f30d[_0x3448('0x7')]||'';this[_0x3448('0x8')]=_0x43f30d['Configurations']||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
index fa4b1b4..694a1f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4331=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','tech','SIP','Trunk'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4331,0x9c));var _0x1433=function(_0x21f27d,_0x2305ba){_0x21f27d=_0x21f27d-0x0;var _0x504a7b=_0x4331[_0x21f27d];return _0x504a7b;};'use strict';function FaxAccount(_0x9deed3){this['id']=_0x9deed3['id']||0x0;this[_0x1433('0x0')]=_0x9deed3['name']||'';this['description']=_0x9deed3[_0x1433('0x1')];this[_0x1433('0x2')]=_0x9deed3[_0x1433('0x2')];this['headerinfo']=_0x9deed3[_0x1433('0x3')];this[_0x1433('0x4')]=_0x9deed3[_0x1433('0x4')];this['minrate']=_0x9deed3[_0x1433('0x5')]||0x960;this[_0x1433('0x6')]=_0x9deed3[_0x1433('0x6')]||0x3840;this[_0x1433('0x7')]=_0x9deed3[_0x1433('0x7')]||_0x1433('0x8');this[_0x1433('0x9')]=_0x9deed3['gateway']||'no';this[_0x1433('0xa')]=_0x9deed3['faxdetect']||'no';this['t38timeout']=_0x9deed3['t38timeout']||0x1388;this[_0x1433('0xb')]=_0x9deed3[_0x1433('0xb')]||_0x1433('0xc');this[_0x1433('0xd')]=_0x9deed3[_0x1433('0xd')]?_0x9deed3[_0x1433('0xd')]:undefined;this[_0x1433('0xe')]=_0x9deed3[_0x1433('0xe')];this[_0x1433('0xf')]=_0x9deed3[_0x1433('0xf')];}module[_0x1433('0x10')]=FaxAccount;
\ No newline at end of file
+var _0x8ff3=['faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway'];(function(_0x3fd047,_0x229866){var _0x21ed13=function(_0x356cc4){while(--_0x356cc4){_0x3fd047['push'](_0x3fd047['shift']());}};_0x21ed13(++_0x229866);}(_0x8ff3,0x1b1));var _0x38ff=function(_0xcde186,_0x1d0e5b){_0xcde186=_0xcde186-0x0;var _0x1d6208=_0x8ff3[_0xcde186];return _0x1d6208;};'use strict';function FaxAccount(_0x44b1a5){this['id']=_0x44b1a5['id']||0x0;this[_0x38ff('0x0')]=_0x44b1a5[_0x38ff('0x0')]||'';this[_0x38ff('0x1')]=_0x44b1a5[_0x38ff('0x1')];this['ecm']=_0x44b1a5[_0x38ff('0x2')];this[_0x38ff('0x3')]=_0x44b1a5[_0x38ff('0x3')];this['localstationid']=_0x44b1a5[_0x38ff('0x4')];this['minrate']=_0x44b1a5[_0x38ff('0x5')]||0x960;this[_0x38ff('0x6')]=_0x44b1a5[_0x38ff('0x6')]||0x3840;this['modem']=_0x44b1a5[_0x38ff('0x7')]||'v17,v27,v29';this[_0x38ff('0x8')]=_0x44b1a5[_0x38ff('0x8')]||'no';this[_0x38ff('0x9')]=_0x44b1a5['faxdetect']||'no';this['t38timeout']=_0x44b1a5[_0x38ff('0xa')]||0x1388;this[_0x38ff('0xb')]=_0x44b1a5[_0x38ff('0xb')]||_0x38ff('0xc');this['Trunk']=_0x44b1a5[_0x38ff('0xd')]?_0x44b1a5[_0x38ff('0xd')]:undefined;this[_0x38ff('0xe')]=_0x44b1a5[_0x38ff('0xe')];this[_0x38ff('0xf')]=_0x44b1a5['key'];}module[_0x38ff('0x10')]=FaxAccount;
\ No newline at end of file
index 6582de2..23ee7ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeae9=['username','apiKey','token','serverUrl','exports','name'];(function(_0x123ada,_0x1da51a){var _0x360ae2=function(_0x2380f1){while(--_0x2380f1){_0x123ada['push'](_0x123ada['shift']());}};_0x360ae2(++_0x1da51a);}(_0xeae9,0xe9));var _0x9eae=function(_0x2c4841,_0x354e33){_0x2c4841=_0x2c4841-0x0;var _0x18ef3d=_0xeae9[_0x2c4841];return _0x18ef3d;};'use strict';function FreshdeskAccount(_0x47de21){this['id']=_0x47de21['id']||0x0;this[_0x9eae('0x0')]=_0x47de21[_0x9eae('0x0')]||'';this[_0x9eae('0x1')]=_0x47de21[_0x9eae('0x1')]||'';this[_0x9eae('0x2')]=_0x47de21[_0x9eae('0x3')]||'';this['remoteUri']=_0x47de21['remoteUri']||'';this['serverUrl']=_0x47de21[_0x9eae('0x4')]||'';this['Configurations']=_0x47de21['Configurations']||{};}module[_0x9eae('0x5')]=FreshdeskAccount;
\ No newline at end of file
+var _0x71d2=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x2614ea,_0x14d261){var _0x2f5b62=function(_0xebdc43){while(--_0xebdc43){_0x2614ea['push'](_0x2614ea['shift']());}};_0x2f5b62(++_0x14d261);}(_0x71d2,0x193));var _0x271d=function(_0x1f9f34,_0x200c59){_0x1f9f34=_0x1f9f34-0x0;var _0x2fb008=_0x71d2[_0x1f9f34];return _0x2fb008;};'use strict';function FreshdeskAccount(_0x1a7046){this['id']=_0x1a7046['id']||0x0;this[_0x271d('0x0')]=_0x1a7046['name']||'';this[_0x271d('0x1')]=_0x1a7046[_0x271d('0x1')]||'';this[_0x271d('0x2')]=_0x1a7046['token']||'';this[_0x271d('0x3')]=_0x1a7046[_0x271d('0x3')]||'';this[_0x271d('0x4')]=_0x1a7046[_0x271d('0x4')]||'';this[_0x271d('0x5')]=_0x1a7046['Configurations']||{};}module[_0x271d('0x6')]=FreshdeskAccount;
\ No newline at end of file
index 217b162..5a3611e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe260=['Configurations','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x309f89,_0x4dcee4){var _0xbbbf35=function(_0x5461c4){while(--_0x5461c4){_0x309f89['push'](_0x309f89['shift']());}};_0xbbbf35(++_0x4dcee4);}(_0xe260,0x94));var _0x0e26=function(_0xaead12,_0x49ab24){_0xaead12=_0xaead12-0x0;var _0x220193=_0xe260[_0xaead12];return _0x220193;};'use strict';function FreshsalesAccount(_0x544271){this['id']=_0x544271['id']||0x0;this['name']=_0x544271[_0x0e26('0x0')]||'';this[_0x0e26('0x1')]=_0x544271[_0x0e26('0x1')]||'';this[_0x0e26('0x2')]=_0x544271[_0x0e26('0x3')]||'';this[_0x0e26('0x4')]=_0x544271[_0x0e26('0x4')]||'';this[_0x0e26('0x5')]=_0x544271[_0x0e26('0x5')]||'';this[_0x0e26('0x6')]=_0x544271['Configurations']||{};}module['exports']=FreshsalesAccount;
\ No newline at end of file
+var _0xee14=['username','apiKey','token','remoteUri','serverUrl','Configurations','name'];(function(_0x18c47b,_0x2d867f){var _0xeb7f91=function(_0x1bf2db){while(--_0x1bf2db){_0x18c47b['push'](_0x18c47b['shift']());}};_0xeb7f91(++_0x2d867f);}(_0xee14,0x13a));var _0x4ee1=function(_0x53b028,_0x1acff3){_0x53b028=_0x53b028-0x0;var _0x50df3a=_0xee14[_0x53b028];return _0x50df3a;};'use strict';function FreshsalesAccount(_0x48008f){this['id']=_0x48008f['id']||0x0;this['name']=_0x48008f[_0x4ee1('0x0')]||'';this[_0x4ee1('0x1')]=_0x48008f[_0x4ee1('0x1')]||'';this[_0x4ee1('0x2')]=_0x48008f[_0x4ee1('0x3')]||'';this[_0x4ee1('0x4')]=_0x48008f[_0x4ee1('0x4')]||'';this[_0x4ee1('0x5')]=_0x48008f[_0x4ee1('0x5')]||'';this['Configurations']=_0x48008f[_0x4ee1('0x6')]||{};}module['exports']=FreshsalesAccount;
\ No newline at end of file
index 1806025..18d4c28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x970b=['voice','type','uniqueid','calleridname','queue','queuecallerjoinAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','motionChannel'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x970b,0x169));var _0xb970=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0x970b[_0x1809c5];return _0x5254a4;};'use strict';function QueueReport(){this[_0xb970('0x0')]='inbound';this[_0xb970('0x1')]='';this['calleridnum']='';this[_0xb970('0x2')]='';this[_0xb970('0x3')]='';this[_0xb970('0x4')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this[_0xb970('0x5')]=0x1;this[_0xb970('0x6')]=![];this[_0xb970('0x7')]=null;this[_0xb970('0x8')]=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0xb970('0x9')]='';this[_0xb970('0xa')]='';this[_0xb970('0xb')]='';this[_0xb970('0xc')]='';this[_0xb970('0xd')]='';this[_0xb970('0xe')]='';this[_0xb970('0xf')]='';this[_0xb970('0x10')]=0x0;this[_0xb970('0x11')]=![];this['lastAssignedTo']='';this[_0xb970('0x12')]=_0xb970('0x13');this['mohtime']=0x0;this['variables']={};}module['exports']=QueueReport;
\ No newline at end of file
+var _0xbf69=['priority','assigned','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinename','accountcode','context','exten'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xbf69,0x149));var _0x9bf6=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xbf69[_0x5d6456];return _0x4d66c1;};'use strict';function QueueReport(){this[_0x9bf6('0x0')]=_0x9bf6('0x1');this[_0x9bf6('0x2')]='';this['calleridnum']='';this['calleridname']='';this['queue']='';this[_0x9bf6('0x3')]=null;this[_0x9bf6('0x4')]=null;this[_0x9bf6('0x5')]=0x1;this[_0x9bf6('0x6')]=0x1;this[_0x9bf6('0x7')]=![];this['queuecallerabandonAt']=null;this[_0x9bf6('0x8')]=![];this[_0x9bf6('0x9')]=null;this[_0x9bf6('0xa')]=![];this[_0x9bf6('0xb')]=null;this['originalposition']=0x1;this['channel']='';this['connectedlinenum']='';this[_0x9bf6('0xc')]='';this[_0x9bf6('0xd')]='';this[_0x9bf6('0xe')]='';this[_0x9bf6('0xf')]='';this[_0x9bf6('0x10')]='';this['holdtime']=0x0;this[_0x9bf6('0x11')]=![];this['lastAssignedTo']='';this[_0x9bf6('0x12')]=_0x9bf6('0x13');this[_0x9bf6('0x14')]=0x0;this[_0x9bf6('0x15')]={};}module[_0x9bf6('0x16')]=QueueReport;
\ No newline at end of file
index 34b7d6e..fd6cb12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9dfc=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x316500,_0x3951d6){var _0x160664=function(_0x2b4f14){while(--_0x2b4f14){_0x316500['push'](_0x316500['shift']());}};_0x160664(++_0x3951d6);}(_0x9dfc,0x140));var _0xc9df=function(_0x13eacb,_0x4a5c19){_0x13eacb=_0x13eacb-0x0;var _0x2d64f5=_0x9dfc[_0x13eacb];return _0x2d64f5;};'use strict';function SalesforceAccount(_0x2f2321){this['id']=_0x2f2321['id']||0x0;this['name']=_0x2f2321['name']||'';this['username']=_0x2f2321[_0xc9df('0x0')]||'';this[_0xc9df('0x1')]=_0x2f2321[_0xc9df('0x1')]||'';this[_0xc9df('0x2')]=_0x2f2321[_0xc9df('0x2')]||'';this[_0xc9df('0x3')]=_0x2f2321[_0xc9df('0x3')]||'';this[_0xc9df('0x4')]=_0x2f2321[_0xc9df('0x4')]||'';this[_0xc9df('0x5')]=_0x2f2321['securityToken']||'';this[_0xc9df('0x6')]=_0x2f2321[_0xc9df('0x6')]||_0xc9df('0x7');this[_0xc9df('0x8')]=_0x2f2321[_0xc9df('0x8')]||'';this['Configurations']=_0x2f2321[_0xc9df('0x9')]||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
+var _0xdc2d=['clientSecret','securityToken','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0x5dee43,_0x35aa9b){var _0x3bcfb0=function(_0x22dad2){while(--_0x22dad2){_0x5dee43['push'](_0x5dee43['shift']());}};_0x3bcfb0(++_0x35aa9b);}(_0xdc2d,0x74));var _0xddc2=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xdc2d[_0x27af45];return _0x18df21;};'use strict';function SalesforceAccount(_0x17a0a1){this['id']=_0x17a0a1['id']||0x0;this[_0xddc2('0x0')]=_0x17a0a1['name']||'';this[_0xddc2('0x1')]=_0x17a0a1[_0xddc2('0x1')]||'';this[_0xddc2('0x2')]=_0x17a0a1[_0xddc2('0x2')]||'';this[_0xddc2('0x3')]=_0x17a0a1[_0xddc2('0x3')]||'';this[_0xddc2('0x4')]=_0x17a0a1['clientId']||'';this['clientSecret']=_0x17a0a1[_0xddc2('0x5')]||'';this[_0xddc2('0x6')]=_0x17a0a1['securityToken']||'';this['type']=_0x17a0a1['type']||_0xddc2('0x7');this[_0xddc2('0x8')]=_0x17a0a1[_0xddc2('0x8')]||'';this[_0xddc2('0x9')]=_0x17a0a1['Configurations']||{};}module[_0xddc2('0xa')]=SalesforceAccount;
\ No newline at end of file
index 642ee04..148aad4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1049=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x43cf20,_0x5ea501){var _0x34ef16=function(_0x40b2bb){while(--_0x40b2bb){_0x43cf20['push'](_0x43cf20['shift']());}};_0x34ef16(++_0x5ea501);}(_0x1049,0x173));var _0x9104=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1049[_0x3dd15e];return _0x231fd0;};'use strict';function ServicenowAccount(_0x547301){this['id']=_0x547301['id']||0x0;this[_0x9104('0x0')]=_0x547301[_0x9104('0x0')]||'';this[_0x9104('0x1')]=_0x547301[_0x9104('0x1')]||'';this[_0x9104('0x2')]=_0x547301[_0x9104('0x2')]||'';this[_0x9104('0x3')]=_0x547301[_0x9104('0x3')]||'';this[_0x9104('0x4')]=_0x547301[_0x9104('0x4')]||'';this[_0x9104('0x5')]=_0x547301[_0x9104('0x5')]||{};}module[_0x9104('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0xab7f=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xab7f,0x133));var _0xfab7=function(_0x19e74b,_0x436736){_0x19e74b=_0x19e74b-0x0;var _0x23eeaa=_0xab7f[_0x19e74b];return _0x23eeaa;};'use strict';function ServicenowAccount(_0x1df4b6){this['id']=_0x1df4b6['id']||0x0;this[_0xfab7('0x0')]=_0x1df4b6[_0xfab7('0x0')]||'';this[_0xfab7('0x1')]=_0x1df4b6['username']||'';this[_0xfab7('0x2')]=_0x1df4b6[_0xfab7('0x2')]||'';this[_0xfab7('0x3')]=_0x1df4b6['remoteUri']||'';this[_0xfab7('0x4')]=_0x1df4b6[_0xfab7('0x4')]||'';this[_0xfab7('0x5')]=_0x1df4b6[_0xfab7('0x5')]||{};}module['exports']=ServicenowAccount;
\ No newline at end of file
index 41d30ce..8e0acf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc1=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x560381,_0x1bfa8f){var _0x5f52b5=function(_0x36c011){while(--_0x36c011){_0x560381['push'](_0x560381['shift']());}};_0x5f52b5(++_0x1bfa8f);}(_0x5fc1,0x78));var _0x15fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5fc1[_0x3dd15e];return _0x231fd0;};'use strict';function SugarcrmAccount(_0x548113){this['id']=_0x548113['id']||0x0;this[_0x15fc('0x0')]=_0x548113[_0x15fc('0x0')]||'';this[_0x15fc('0x1')]=_0x548113[_0x15fc('0x1')]||'';this[_0x15fc('0x2')]=_0x548113[_0x15fc('0x2')]||'';this[_0x15fc('0x3')]=_0x548113['remoteUri']||'';this[_0x15fc('0x4')]=_0x548113[_0x15fc('0x4')]||'';this[_0x15fc('0x5')]=_0x548113['Configurations']||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
+var _0x80bf=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x285447,_0x3f2697){var _0x1391a4=function(_0x20df32){while(--_0x20df32){_0x285447['push'](_0x285447['shift']());}};_0x1391a4(++_0x3f2697);}(_0x80bf,0x148));var _0xf80b=function(_0x507ddf,_0x402356){_0x507ddf=_0x507ddf-0x0;var _0x1d179a=_0x80bf[_0x507ddf];return _0x1d179a;};'use strict';function SugarcrmAccount(_0x461c9c){this['id']=_0x461c9c['id']||0x0;this[_0xf80b('0x0')]=_0x461c9c['name']||'';this[_0xf80b('0x1')]=_0x461c9c[_0xf80b('0x1')]||'';this['password']=_0x461c9c[_0xf80b('0x2')]||'';this['remoteUri']=_0x461c9c[_0xf80b('0x3')]||'';this['serverUrl']=_0x461c9c[_0xf80b('0x4')]||'';this[_0xf80b('0x5')]=_0x461c9c['Configurations']||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
index 752be6a..b5ac41d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d79=['exports','name','state','unknown','stateTime'];(function(_0x555201,_0x4e7d9e){var _0x359681=function(_0x263a3a){while(--_0x263a3a){_0x555201['push'](_0x555201['shift']());}};_0x359681(++_0x4e7d9e);}(_0x8d79,0x10a));var _0x98d7=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8d79[_0x167cc1];return _0x10bc4b;};'use strict';function Telephone(_0x20b47d){this['id']=_0x20b47d['id']||0x0;this[_0x98d7('0x0')]=_0x20b47d[_0x98d7('0x0')]||'';this['accountcode']=_0x20b47d['accountcode']||'';this[_0x98d7('0x1')]=_0x98d7('0x2');this[_0x98d7('0x3')]=0x0;this['status']='unknown';this['address']='';}module[_0x98d7('0x4')]=Telephone;
\ No newline at end of file
+var _0xbc87=['accountcode','state','status','unknown','address','exports'];(function(_0x192563,_0x5aed35){var _0x381494=function(_0x53fa1e){while(--_0x53fa1e){_0x192563['push'](_0x192563['shift']());}};_0x381494(++_0x5aed35);}(_0xbc87,0x144));var _0x7bc8=function(_0x208eac,_0x5845be){_0x208eac=_0x208eac-0x0;var _0x1a00f2=_0xbc87[_0x208eac];return _0x1a00f2;};'use strict';function Telephone(_0x4b0a30){this['id']=_0x4b0a30['id']||0x0;this['name']=_0x4b0a30['name']||'';this[_0x7bc8('0x0')]=_0x4b0a30[_0x7bc8('0x0')]||'';this[_0x7bc8('0x1')]='unknown';this['stateTime']=0x0;this[_0x7bc8('0x2')]=_0x7bc8('0x3');this[_0x7bc8('0x4')]='';}module[_0x7bc8('0x5')]=Telephone;
\ No newline at end of file
index 88018f5..8067fc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x38dc59,_0x1bf1e8){var _0x2ff4d0=function(_0x4effec){while(--_0x4effec){_0x38dc59['push'](_0x38dc59['shift']());}};_0x2ff4d0(++_0x1bf1e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x37ab41,_0x56ec07){var _0x47bd67=function(_0x56adb2){while(--_0x56adb2){_0x37ab41['push'](_0x37ab41['shift']());}};_0x47bd67(++_0x56ec07);}(_0xb10b,0x12a));var _0xbb10=function(_0x56d78c,_0x2b65d6){_0x56d78c=_0x56d78c-0x0;var _0x9a8155=_0xb10b[_0x56d78c];return _0x9a8155;};'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 8a3199f..95cb12c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0xdae520,_0x5cb070){var _0x21f40a=function(_0x153d31){while(--_0x153d31){_0xdae520['push'](_0xdae520['shift']());}};_0x21f40a(++_0x5cb070);}(_0x4fc2,0x111));var _0x24fc=function(_0x3a607e,_0x54d530){_0x3a607e=_0x3a607e-0x0;var _0x37b106=_0x4fc2[_0x3a607e];return _0x37b106;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger;
\ No newline at end of file
+var _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x5c5b8a,_0x26a8e6){var _0x59381f=function(_0x354a93){while(--_0x354a93){_0x5c5b8a['push'](_0x5c5b8a['shift']());}};_0x59381f(++_0x26a8e6);}(_0x8603,0x190));var _0x3860=function(_0x8e02b0,_0x4d0be9){_0x8e02b0=_0x8e02b0-0x0;var _0x5e9842=_0x8603[_0x8e02b0];return _0x5e9842;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger;
\ No newline at end of file
index 155fd5e..67cba2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc30=['active','name','state','unknown','registry','indexOf','split','port','domain','domainport','refresh','registrationtime','address','defaultuser'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfc30,0x1a4));var _0x0fc3=function(_0x47066d,_0x2ea60d){_0x47066d=_0x47066d-0x0;var _0x34baa9=_0xfc30[_0x47066d];return _0x34baa9;};'use strict';function Trunk(_0x5105f3){this['id']=_0x5105f3['id']||0x0;this[_0x0fc3('0x0')]=_0x5105f3[_0x0fc3('0x0')]||![];this[_0x0fc3('0x1')]=_0x5105f3[_0x0fc3('0x1')]||'';this[_0x0fc3('0x2')]='unknown';this['stateTime']=0x0;this['status']=_0x0fc3('0x3');this[_0x0fc3('0x4')]=_0x5105f3[_0x0fc3('0x4')]&&_0x5105f3[_0x0fc3('0x4')][_0x0fc3('0x5')](':')?_0x5105f3[_0x0fc3('0x4')][_0x0fc3('0x6')](':')[0x0]:'';this['host']='';this[_0x0fc3('0x7')]='';this[_0x0fc3('0x8')]='';this[_0x0fc3('0x9')]='';this[_0x0fc3('0xa')]='';this['stateRegistry']=_0x0fc3('0x3');this[_0x0fc3('0xb')]='';this[_0x0fc3('0xc')]='';this['defaultuser']=_0x5105f3[_0x0fc3('0xd')]||'';}module['exports']=Trunk;
\ No newline at end of file
+var _0x3ded=['address','defaultuser','active','name','state','unknown','stateTime','status','registry','split','domain','domainport','refresh','stateRegistry','registrationtime'];(function(_0x11fc67,_0x1eda19){var _0x50bb19=function(_0x302214){while(--_0x302214){_0x11fc67['push'](_0x11fc67['shift']());}};_0x50bb19(++_0x1eda19);}(_0x3ded,0x1c4));var _0xd3de=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x3ded[_0xc67528];return _0x38e26d;};'use strict';function Trunk(_0x268a26){this['id']=_0x268a26['id']||0x0;this[_0xd3de('0x0')]=_0x268a26['active']||![];this[_0xd3de('0x1')]=_0x268a26[_0xd3de('0x1')]||'';this[_0xd3de('0x2')]=_0xd3de('0x3');this[_0xd3de('0x4')]=0x0;this[_0xd3de('0x5')]='unknown';this[_0xd3de('0x6')]=_0x268a26[_0xd3de('0x6')]&&_0x268a26['registry']['indexOf'](':')?_0x268a26['registry'][_0xd3de('0x7')](':')[0x0]:'';this['host']='';this['port']='';this[_0xd3de('0x8')]='';this[_0xd3de('0x9')]='';this[_0xd3de('0xa')]='';this[_0xd3de('0xb')]=_0xd3de('0x3');this[_0xd3de('0xc')]='';this[_0xd3de('0xd')]='';this[_0xd3de('0xe')]=_0x268a26[_0xd3de('0xe')]||'';}module['exports']=Trunk;
\ No newline at end of file
index 3cf1102..b66f30d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe31c=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xe31c,0x9c));var _0xce31=function(_0x2d0c58,_0x1aea21){_0x2d0c58=_0x2d0c58-0x0;var _0x520fcb=_0xe31c[_0x2d0c58];return _0x520fcb;};'use strict';function voiceExtension(_0x18b91e){this['id']=_0x18b91e['id']||0x0;this['exten']=_0x18b91e[_0xce31('0x0')]||'';this[_0xce31('0x1')]=_0x18b91e[_0xce31('0x1')]||_0xce31('0x2');this[_0xce31('0x3')]=_0x18b91e[_0xce31('0x3')]||![];}module['exports']=voiceExtension;
\ No newline at end of file
+var _0x5cdd=['mandatoryDisposition','exports','recordingFormat','none'];(function(_0x45cf29,_0x5c09ec){var _0x14e5cf=function(_0x297698){while(--_0x297698){_0x45cf29['push'](_0x45cf29['shift']());}};_0x14e5cf(++_0x5c09ec);}(_0x5cdd,0x17a));var _0xd5cd=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5cdd[_0x19950b];return _0x3c6b41;};'use strict';function voiceExtension(_0x4249a0){this['id']=_0x4249a0['id']||0x0;this['exten']=_0x4249a0['exten']||'';this['recordingFormat']=_0x4249a0[_0xd5cd('0x0')]||_0xd5cd('0x1');this[_0xd5cd('0x2')]=_0x4249a0[_0xd5cd('0x2')]||![];}module[_0xd5cd('0x3')]=voiceExtension;
\ No newline at end of file
index 80b7a93..945a922 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40d8=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','waiting','talking','total','answered','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x38bf4b,_0x3d8e9d){var _0xc29177=function(_0x52d635){while(--_0x52d635){_0x38bf4b['push'](_0x38bf4b['shift']());}};_0xc29177(++_0x3d8e9d);}(_0x40d8,0x121));var _0x840d=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0x40d8[_0xa60623];return _0x4a6487;};'use strict';var statusDesc=['unknown',_0x840d('0x0'),_0x840d('0x1'),_0x840d('0x2'),_0x840d('0x3'),_0x840d('0x4'),_0x840d('0x5'),_0x840d('0x6'),'onhold'];var monitorFormat={'wav':_0x840d('0x7'),'wav49':_0x840d('0x8'),'gsm':_0x840d('0x9')};var strategy={'rrmemory':_0x840d('0xa'),'roundrobin':'roundrobin'};function VoiceQueue(_0x4ae1a9){this['id']=_0x4ae1a9['id']||0x0;this[_0x840d('0xb')]=_0x4ae1a9[_0x840d('0xb')]||'';this['monitor_format']=_0x4ae1a9[_0x840d('0xc')]||'';this[_0x840d('0xd')]=_0x4ae1a9['type']||_0x840d('0xe');this[_0x840d('0xf')]=0x0;this[_0x840d('0x10')]=0x0;this[_0x840d('0x11')]=0x0;this[_0x840d('0x12')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x840d('0x13')]=0x0;this['unmanaged']=0x0;this[_0x840d('0x14')]=0x0;this[_0x840d('0x15')]=0x0;this[_0x840d('0x16')]=0x0;this[_0x840d('0x17')]=_0x4ae1a9['acw']||![];this[_0x840d('0x18')]=_0x4ae1a9[_0x840d('0x18')]||0xa;this[_0x840d('0x19')]=_0x4ae1a9['autopause']||'no';this[_0x840d('0x1a')]=!![];this[_0x840d('0x1b')]='';this[_0x840d('0x1c')]=0x0;this['temp']=0x0;this[_0x840d('0x1d')]=_0x4ae1a9['dialTimezone']||null;this[_0x840d('0x1e')]=_0x4ae1a9['dialGlobalInterval']?_0x4ae1a9['dialGlobalInterval']:null;this[_0x840d('0x1f')]=_0x4ae1a9['dialActive'];this[_0x840d('0x20')]=_0x4ae1a9['dialMethod']||_0x840d('0x21');this[_0x840d('0x22')]=_0x4ae1a9[_0x840d('0x22')]||0x0;this[_0x840d('0x23')]=_0x4ae1a9['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x4ae1a9[_0x840d('0x24')]||0x1;this[_0x840d('0x25')]=_0x4ae1a9[_0x840d('0x25')]||_0x840d('0x26');this['dialPredictiveOptimizationPercentage']=_0x4ae1a9[_0x840d('0x27')]||0.03;this[_0x840d('0x28')]=_0x4ae1a9[_0x840d('0x28')]||0x258;this[_0x840d('0x29')]=_0x4ae1a9[_0x840d('0x29')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x4ae1a9[_0x840d('0x2a')]||_0x840d('0x2b');this[_0x840d('0x2c')]=_0x4ae1a9['dialOriginateTimeout']||0x1e;this[_0x840d('0x2d')]=_0x4ae1a9[_0x840d('0x2d')]||'tTxX';this[_0x840d('0x2e')]=_0x4ae1a9[_0x840d('0x2e')]||0x3;this[_0x840d('0x2f')]=_0x4ae1a9[_0x840d('0x2f')]||undefined;this[_0x840d('0x30')]=_0x4ae1a9['dialCongestionMaxRetry']||0x3;this[_0x840d('0x31')]=_0x4ae1a9[_0x840d('0x31')]||0x96;this[_0x840d('0x32')]=_0x4ae1a9['dialBusyMaxRetry']||0x3;this[_0x840d('0x33')]=_0x4ae1a9[_0x840d('0x33')]||0x96;this[_0x840d('0x34')]=_0x4ae1a9[_0x840d('0x34')]||0x3;this[_0x840d('0x35')]=_0x4ae1a9['dialNoAnswerRetryFrequency']||0x96;this[_0x840d('0x36')]=_0x4ae1a9['dialNoSuchNumberMaxRetry']||0x3;this[_0x840d('0x37')]=_0x4ae1a9[_0x840d('0x37')]||0x96;this[_0x840d('0x38')]=_0x4ae1a9[_0x840d('0x38')]||0x3;this['dialDropRetryFrequency']=_0x4ae1a9[_0x840d('0x39')]||0x96;this[_0x840d('0x3a')]=_0x4ae1a9[_0x840d('0x3a')]||0x3;this[_0x840d('0x3b')]=_0x4ae1a9[_0x840d('0x3b')]||0x96;this[_0x840d('0x3c')]=_0x4ae1a9['dialMachineMaxRetry']||0x3;this[_0x840d('0x3d')]=_0x4ae1a9[_0x840d('0x3d')]||0x96;this[_0x840d('0x3e')]=_0x4ae1a9[_0x840d('0x3e')]||0x3;this[_0x840d('0x3f')]=_0x4ae1a9[_0x840d('0x3f')]||0x96;this[_0x840d('0x40')]=_0x4ae1a9[_0x840d('0x40')]||0x4;this[_0x840d('0x41')]=_0x4ae1a9[_0x840d('0x41')]?_0x4ae1a9[_0x840d('0x41')]:undefined;this[_0x840d('0x42')]=_0x4ae1a9[_0x840d('0x42')]?_0x4ae1a9[_0x840d('0x42')]:undefined;this[_0x840d('0x43')]=_0x4ae1a9[_0x840d('0x43')]||undefined;this['Interval']=_0x4ae1a9['Interval']?_0x4ae1a9['Interval']:undefined;this[_0x840d('0x44')]=_0x4ae1a9['dialOrderByScheduledAt']||_0x840d('0x45');this[_0x840d('0x46')]=_0x4ae1a9[_0x840d('0x46')]||undefined;this[_0x840d('0x47')]=_0x4ae1a9[_0x840d('0x47')]||undefined;this['strategy']=strategy[_0x4ae1a9[_0x840d('0x48')]]||_0x840d('0xa');this[_0x840d('0x49')]=!![];this[_0x840d('0x4a')]=_0x4ae1a9[_0x840d('0x4a')]||![];this[_0x840d('0x4b')]=_0x4ae1a9[_0x840d('0x4b')];this[_0x840d('0x4c')]=_0x4ae1a9['dialAMDGreeting'];this[_0x840d('0x4d')]=_0x4ae1a9[_0x840d('0x4d')];this['dialAMDTotalAnalysisTime']=_0x4ae1a9[_0x840d('0x4e')];this['dialAMDMinWordLength']=_0x4ae1a9[_0x840d('0x4f')];this['dialAMDBetweenWordsSilence']=_0x4ae1a9['dialAMDBetweenWordsSilence'];this[_0x840d('0x50')]=_0x4ae1a9[_0x840d('0x50')];this['dialAMDSilenceThreshold']=_0x4ae1a9[_0x840d('0x51')];this[_0x840d('0x52')]=_0x4ae1a9[_0x840d('0x52')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this['timeout']=_0x4ae1a9[_0x840d('0x53')];this[_0x840d('0x54')]=0x0;this[_0x840d('0x55')]=0x0;this[_0x840d('0x56')]=0x0;this[_0x840d('0x57')]=0x0;this[_0x840d('0x58')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x840d('0x59')]=0x0;this[_0x840d('0x5a')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x840d('0x5b')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0x840d('0x5c')]=undefined;this[_0x840d('0x5d')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x840d('0x5e')]=0x0;this[_0x840d('0x5f')]=0x0;this[_0x840d('0x60')]=0x0;this[_0x840d('0x61')]=0x0;this[_0x840d('0x62')]=0x0;this[_0x840d('0x63')]=0x0;this[_0x840d('0x64')]=0x0;this[_0x840d('0x65')]=0x0;this[_0x840d('0x66')]=_0x4ae1a9[_0x840d('0x67')]||0x14;this[_0x840d('0x68')]=_0x4ae1a9[_0x840d('0x67')]||0xa;this[_0x840d('0x69')]=0x0;this[_0x840d('0x6a')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x840d('0x6b')]=0x0;this[_0x840d('0x6c')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x4ae1a9[_0x840d('0x6d')]||0x1e;this['dialRecallInQueue']=_0x4ae1a9[_0x840d('0x6e')]||![];this['dialQueueProject2']=_0x4ae1a9[_0x840d('0x6f')]||undefined;this[_0x840d('0x70')]=_0x4ae1a9[_0x840d('0x70')]||![];this['dialAgiAfterHangupAgent']=_0x4ae1a9['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x4ae1a9[_0x840d('0xc')]]?monitorFormat[_0x4ae1a9[_0x840d('0xc')]]:undefined;this[_0x840d('0x71')]=_0x4ae1a9['mandatoryDisposition']||![];this[_0x840d('0x72')]=_0x4ae1a9[_0x840d('0x72')]?_0x4ae1a9['mandatoryDispositionPause']:undefined;}module[_0x840d('0x73')]=VoiceQueue;
\ No newline at end of file
+var _0x93cc=['outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','invalid','unavailable','ringing','ringinuse','onhold','rrmemory','roundrobin','name','monitor_format','type','talking','total','sumHoldTime','sumBillable','unmanaged','abandoned','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x93cc,0x90));var _0xc93c=function(_0x713fe7,_0x3893b0){_0x713fe7=_0x713fe7-0x0;var _0x2409a2=_0x93cc[_0x713fe7];return _0x2409a2;};'use strict';var statusDesc=[_0xc93c('0x0'),_0xc93c('0x1'),'inuse','busy',_0xc93c('0x2'),_0xc93c('0x3'),_0xc93c('0x4'),_0xc93c('0x5'),_0xc93c('0x6')];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':_0xc93c('0x7'),'roundrobin':_0xc93c('0x8')};function VoiceQueue(_0xed1201){this['id']=_0xed1201['id']||0x0;this[_0xc93c('0x9')]=_0xed1201[_0xc93c('0x9')]||'';this[_0xc93c('0xa')]=_0xed1201[_0xc93c('0xa')]||'';this[_0xc93c('0xb')]=_0xed1201[_0xc93c('0xb')]||'inbound';this['waiting']=0x0;this[_0xc93c('0xc')]=0x0;this[_0xc93c('0xd')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0xc93c('0xe')]=0x0;this[_0xc93c('0xf')]=0x0;this[_0xc93c('0x10')]=0x0;this[_0xc93c('0x11')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0xc93c('0x12')]=_0xed1201[_0xc93c('0x12')]||![];this[_0xc93c('0x13')]=_0xed1201['acwTimeout']||0xa;this[_0xc93c('0x14')]=_0xed1201['autopause']||'no';this[_0xc93c('0x15')]=!![];this['message']='';this[_0xc93c('0x16')]=0x0;this[_0xc93c('0x17')]=0x0;this[_0xc93c('0x18')]=_0xed1201['dialTimezone']||null;this[_0xc93c('0x19')]=_0xed1201[_0xc93c('0x19')]?_0xed1201[_0xc93c('0x19')]:null;this[_0xc93c('0x1a')]=_0xed1201[_0xc93c('0x1a')];this[_0xc93c('0x1b')]=_0xed1201[_0xc93c('0x1b')]||_0xc93c('0x1c');this[_0xc93c('0x1d')]=_0xed1201[_0xc93c('0x1d')]||0x0;this[_0xc93c('0x1e')]=_0xed1201[_0xc93c('0x1e')]||0x0;this[_0xc93c('0x1f')]=_0xed1201['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0xed1201['dialPredictiveOptimization']||_0xc93c('0x20');this[_0xc93c('0x21')]=_0xed1201[_0xc93c('0x21')]||0.03;this[_0xc93c('0x22')]=_0xed1201[_0xc93c('0x22')]||0x258;this['dialOriginateCallerIdName']=_0xed1201[_0xc93c('0x23')]||_0xc93c('0x24');this['dialOriginateCallerIdNumber']=_0xed1201[_0xc93c('0x25')]||_0xc93c('0x24');this[_0xc93c('0x26')]=_0xed1201['dialOriginateTimeout']||0x1e;this[_0xc93c('0x27')]=_0xed1201[_0xc93c('0x27')]||_0xc93c('0x28');this[_0xc93c('0x29')]=_0xed1201[_0xc93c('0x29')]||0x3;this['dialQueueProject']=_0xed1201[_0xc93c('0x2a')]||undefined;this[_0xc93c('0x2b')]=_0xed1201['dialCongestionMaxRetry']||0x3;this[_0xc93c('0x2c')]=_0xed1201['dialCongestionRetryFrequency']||0x96;this[_0xc93c('0x2d')]=_0xed1201['dialBusyMaxRetry']||0x3;this[_0xc93c('0x2e')]=_0xed1201['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0xed1201[_0xc93c('0x2f')]||0x3;this[_0xc93c('0x30')]=_0xed1201['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0xed1201[_0xc93c('0x31')]||0x3;this[_0xc93c('0x32')]=_0xed1201[_0xc93c('0x32')]||0x96;this[_0xc93c('0x33')]=_0xed1201[_0xc93c('0x33')]||0x3;this[_0xc93c('0x34')]=_0xed1201[_0xc93c('0x34')]||0x96;this['dialAbandonedMaxRetry']=_0xed1201[_0xc93c('0x35')]||0x3;this['dialAbandonedRetryFrequency']=_0xed1201['dialAbandonedRetryFrequency']||0x96;this[_0xc93c('0x36')]=_0xed1201[_0xc93c('0x36')]||0x3;this[_0xc93c('0x37')]=_0xed1201[_0xc93c('0x37')]||0x96;this[_0xc93c('0x38')]=_0xed1201['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0xed1201[_0xc93c('0x39')]||0x96;this['dialGlobalMaxRetry']=_0xed1201[_0xc93c('0x3a')]||0x4;this[_0xc93c('0x3b')]=_0xed1201['Trunk']?_0xed1201[_0xc93c('0x3b')]:undefined;this[_0xc93c('0x3c')]=_0xed1201[_0xc93c('0x3c')]?_0xed1201[_0xc93c('0x3c')]:undefined;this[_0xc93c('0x3d')]=_0xed1201[_0xc93c('0x3d')]||undefined;this[_0xc93c('0x3e')]=_0xed1201[_0xc93c('0x3e')]?_0xed1201[_0xc93c('0x3e')]:undefined;this[_0xc93c('0x3f')]=_0xed1201['dialOrderByScheduledAt']||_0xc93c('0x40');this[_0xc93c('0x41')]=_0xed1201[_0xc93c('0x41')]||undefined;this[_0xc93c('0x42')]=_0xed1201[_0xc93c('0x42')]||undefined;this['strategy']=strategy[_0xed1201['strategy']]||_0xc93c('0x7');this[_0xc93c('0x43')]=!![];this[_0xc93c('0x44')]=_0xed1201['dialAMDActive']||![];this[_0xc93c('0x45')]=_0xed1201['dialAMDInitialSilence'];this[_0xc93c('0x46')]=_0xed1201['dialAMDGreeting'];this[_0xc93c('0x47')]=_0xed1201['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0xed1201[_0xc93c('0x48')];this['dialAMDMinWordLength']=_0xed1201[_0xc93c('0x49')];this[_0xc93c('0x4a')]=_0xed1201[_0xc93c('0x4a')];this[_0xc93c('0x4b')]=_0xed1201[_0xc93c('0x4b')];this[_0xc93c('0x4c')]=_0xed1201['dialAMDSilenceThreshold'];this[_0xc93c('0x4d')]=_0xed1201[_0xc93c('0x4d')];this['outboundRejectCallsDay']=0x0;this[_0xc93c('0x4e')]=0x0;this['timeout']=_0xed1201[_0xc93c('0x4f')];this['outboundAnswerCallsDay']=0x0;this[_0xc93c('0x50')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0xc93c('0x51')]=0x0;this[_0xc93c('0x52')]=0x0;this[_0xc93c('0x53')]=0x0;this[_0xc93c('0x54')]=0x0;this[_0xc93c('0x55')]=0x0;this[_0xc93c('0x56')]=0x0;this[_0xc93c('0x57')]=0x0;this[_0xc93c('0x58')]=0x0;this[_0xc93c('0x59')]=0x0;this[_0xc93c('0x5a')]=0x0;this['startProgressive']=undefined;this[_0xc93c('0x5b')]=undefined;this[_0xc93c('0x5c')]=undefined;this[_0xc93c('0x5d')]=1.05;this[_0xc93c('0x5e')]=0x0;this[_0xc93c('0x5f')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xc93c('0x60')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xc93c('0x61')]=0x0;this[_0xc93c('0x62')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xc93c('0x63')]=_0xed1201[_0xc93c('0x64')]||0x14;this[_0xc93c('0x65')]=_0xed1201[_0xc93c('0x64')]||0xa;this[_0xc93c('0x66')]=0x0;this[_0xc93c('0x67')]=0x0;this[_0xc93c('0x68')]=0x1;this[_0xc93c('0x69')]=0x0;this[_0xc93c('0x6a')]=0x0;this[_0xc93c('0x6b')]=0x0;this[_0xc93c('0x6c')]=0x0;this[_0xc93c('0x6d')]=_0xed1201[_0xc93c('0x6d')]||0x1e;this[_0xc93c('0x6e')]=_0xed1201['dialRecallInQueue']||![];this[_0xc93c('0x6f')]=_0xed1201[_0xc93c('0x6f')]||undefined;this[_0xc93c('0x70')]=_0xed1201[_0xc93c('0x70')]||![];this[_0xc93c('0x71')]=_0xed1201[_0xc93c('0x71')]||![];this[_0xc93c('0xa')]=monitorFormat[_0xed1201[_0xc93c('0xa')]]?monitorFormat[_0xed1201['monitor_format']]:undefined;this[_0xc93c('0x72')]=_0xed1201[_0xc93c('0x72')]||![];this[_0xc93c('0x73')]=_0xed1201[_0xc93c('0x73')]?_0xed1201['mandatoryDispositionPause']:undefined;}module[_0xc93c('0x74')]=VoiceQueue;
\ No newline at end of file
index 4ef1d31..401f00c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49bb=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x49bb,0x11f));var _0xb49b=function(_0x58ca37,_0x3de8c2){_0x58ca37=_0x58ca37-0x0;var _0x4c3b06=_0x49bb[_0x58ca37];return _0x4c3b06;};'use strict';function VtigerAccount(_0x55fc62){this['id']=_0x55fc62['id']||0x0;this[_0xb49b('0x0')]=_0x55fc62['name']||'';this[_0xb49b('0x1')]=_0x55fc62[_0xb49b('0x1')]||'';this[_0xb49b('0x2')]=_0x55fc62[_0xb49b('0x2')]||'';this['remoteUri']=_0x55fc62[_0xb49b('0x3')]||'';this['serverUrl']=_0x55fc62[_0xb49b('0x4')]||'';this[_0xb49b('0x5')]=_0x55fc62['Configurations']||{};}module[_0xb49b('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0xd30f=['serverUrl','Configurations','name','username','accessKey'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xd30f,0x11a));var _0xfd30=function(_0x5b2306,_0x4af15b){_0x5b2306=_0x5b2306-0x0;var _0x3ef6f8=_0xd30f[_0x5b2306];return _0x3ef6f8;};'use strict';function VtigerAccount(_0x37a906){this['id']=_0x37a906['id']||0x0;this[_0xfd30('0x0')]=_0x37a906[_0xfd30('0x0')]||'';this[_0xfd30('0x1')]=_0x37a906[_0xfd30('0x1')]||'';this['accessKey']=_0x37a906[_0xfd30('0x2')]||'';this['remoteUri']=_0x37a906['remoteUri']||'';this[_0xfd30('0x3')]=_0x37a906[_0xfd30('0x3')]||'';this[_0xfd30('0x4')]=_0x37a906['Configurations']||{};}module['exports']=VtigerAccount;
\ No newline at end of file
index 52acfab..7d43b43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a20=['serverUrl','Configurations','exports','name','password','token','authType','type'];(function(_0xc13882,_0x1c0ce0){var _0x4eb1dc=function(_0x219672){while(--_0x219672){_0xc13882['push'](_0xc13882['shift']());}};_0x4eb1dc(++_0x1c0ce0);}(_0x5a20,0x19b));var _0x05a2=function(_0x297d6f,_0x12c8be){_0x297d6f=_0x297d6f-0x0;var _0x4e0852=_0x5a20[_0x297d6f];return _0x4e0852;};'use strict';function ZendeskAccount(_0x230c49){this['id']=_0x230c49['id']||0x0;this['name']=_0x230c49[_0x05a2('0x0')]||'';this['username']=_0x230c49['username']||'';this['password']=_0x230c49[_0x05a2('0x1')]||'';this[_0x05a2('0x2')]=_0x230c49[_0x05a2('0x2')]||'';this['remoteUri']=_0x230c49['remoteUri']||'';this[_0x05a2('0x3')]=_0x230c49[_0x05a2('0x3')]||'';this[_0x05a2('0x4')]=_0x230c49['type']||'integrationTab';this[_0x05a2('0x5')]=_0x230c49[_0x05a2('0x5')]||'';this[_0x05a2('0x6')]=_0x230c49[_0x05a2('0x6')]||{};}module[_0x05a2('0x7')]=ZendeskAccount;
\ No newline at end of file
+var _0x73bb=['remoteUri','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x3377be,_0x47d1f1){var _0x10ecc3=function(_0x29c03c){while(--_0x29c03c){_0x3377be['push'](_0x3377be['shift']());}};_0x10ecc3(++_0x47d1f1);}(_0x73bb,0x13c));var _0xb73b=function(_0x386b03,_0x5d0000){_0x386b03=_0x386b03-0x0;var _0xd3d524=_0x73bb[_0x386b03];return _0xd3d524;};'use strict';function ZendeskAccount(_0xf8db47){this['id']=_0xf8db47['id']||0x0;this[_0xb73b('0x0')]=_0xf8db47[_0xb73b('0x0')]||'';this[_0xb73b('0x1')]=_0xf8db47[_0xb73b('0x1')]||'';this[_0xb73b('0x2')]=_0xf8db47[_0xb73b('0x2')]||'';this[_0xb73b('0x3')]=_0xf8db47['token']||'';this[_0xb73b('0x4')]=_0xf8db47[_0xb73b('0x4')]||'';this['authType']=_0xf8db47['authType']||'';this[_0xb73b('0x5')]=_0xf8db47['type']||_0xb73b('0x6');this['serverUrl']=_0xf8db47[_0xb73b('0x7')]||'';this['Configurations']=_0xf8db47[_0xb73b('0x8')]||{};}module[_0xb73b('0x9')]=ZendeskAccount;
\ No newline at end of file
index 755d519..1b0695f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ba2=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x52b876,_0x294af5){var _0x1084b9=function(_0x281f38){while(--_0x281f38){_0x52b876['push'](_0x52b876['shift']());}};_0x1084b9(++_0x294af5);}(_0x7ba2,0x1cb));var _0x27ba=function(_0x276d10,_0x435d5f){_0x276d10=_0x276d10-0x0;var _0x56f291=_0x7ba2[_0x276d10];return _0x56f291;};'use strict';function ZohoAccount(_0x39e6fc){this['id']=_0x39e6fc['id']||0x0;this['name']=_0x39e6fc[_0x27ba('0x0')]||'';this[_0x27ba('0x1')]=_0x39e6fc[_0x27ba('0x1')]||'';this[_0x27ba('0x2')]=_0x39e6fc['host']||'';this['zone']=_0x39e6fc[_0x27ba('0x3')]||'';this[_0x27ba('0x4')]=_0x39e6fc[_0x27ba('0x4')]||'';this[_0x27ba('0x5')]=_0x39e6fc[_0x27ba('0x5')]||'';this[_0x27ba('0x6')]=_0x39e6fc[_0x27ba('0x6')]||'';this[_0x27ba('0x7')]=_0x39e6fc[_0x27ba('0x7')]||'';this[_0x27ba('0x8')]=_0x39e6fc[_0x27ba('0x8')]||'';this[_0x27ba('0x9')]=_0x39e6fc['Configurations']||{};}module[_0x27ba('0xa')]=ZohoAccount;
\ No newline at end of file
+var _0x6517=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x6517,0x101));var _0x7651=function(_0x12da71,_0x1ca74b){_0x12da71=_0x12da71-0x0;var _0x203f1d=_0x6517[_0x12da71];return _0x203f1d;};'use strict';function ZohoAccount(_0xa7838a){this['id']=_0xa7838a['id']||0x0;this['name']=_0xa7838a[_0x7651('0x0')]||'';this[_0x7651('0x1')]=_0xa7838a[_0x7651('0x1')]||'';this['host']=_0xa7838a[_0x7651('0x2')]||'';this['zone']=_0xa7838a['zone']||'';this[_0x7651('0x3')]=_0xa7838a[_0x7651('0x3')]||'';this[_0x7651('0x4')]=_0xa7838a['clientSecret']||'';this[_0x7651('0x5')]=_0xa7838a[_0x7651('0x5')]||'';this['code']=_0xa7838a[_0x7651('0x6')]||'';this[_0x7651('0x7')]=_0xa7838a[_0x7651('0x7')]||'';this[_0x7651('0x8')]=_0xa7838a[_0x7651('0x8')]||{};}module[_0x7651('0x9')]=ZohoAccount;
\ No newline at end of file
index 0214764..d02433e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfed6=['originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','exports','util','lodash','isNil','string','uniqueid','queue','type','Agent','name','channelAgent','membername','format','Contact','phone','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId'];(function(_0x406ea6,_0x4e2bd0){var _0x21e927=function(_0x98737c){while(--_0x98737c){_0x406ea6['push'](_0x406ea6['shift']());}};_0x21e927(++_0x4e2bd0);}(_0xfed6,0xf7));var _0x6fed=function(_0x4a6fb8,_0x1c0e0f){_0x4a6fb8=_0x4a6fb8-0x0;var _0xe92da=_0xfed6[_0x4a6fb8];return _0xe92da;};'use strict';var util=require(_0x6fed('0x0'));var _=require(_0x6fed('0x1'));var moment=require('moment');function checkNameSurname(_0x166071,_0x279926,_0x3ffb75){var _0x430830='';if(!_[_0x6fed('0x2')](_0x279926)&&_0x6fed('0x3')===typeof _0x279926){_0x430830+=_0x279926;}if(!_[_0x6fed('0x2')](_0x3ffb75)&&_0x6fed('0x3')===typeof _0x3ffb75){_0x430830+='\x20'+_0x3ffb75;}if(_0x430830!==''){return _0x430830;}return _0x166071;}function Action(_0x5d00df,_0x4bd5cd,_0x20e723,_0x3194d4,_0xc4d486){this[_0x6fed('0x4')]=_0x20e723||undefined;this['idContact']=_0x5d00df['id'];this[_0x6fed('0x5')]=_0x4bd5cd['name'];this[_0x6fed('0x6')]=_0x4bd5cd[_0x6fed('0x6')];this['campaigntype']=_0x6fed('0x5');this['dialAnswer']=![];this['membername']=_[_0x6fed('0x2')](_0x5d00df[_0x6fed('0x7')])?undefined:_0x5d00df[_0x6fed('0x7')][_0x6fed('0x8')];this[_0x6fed('0x9')]=this[_0x6fed('0xa')]?util[_0x6fed('0xb')]('SIP/%s',this[_0x6fed('0xa')]):_0x3194d4||undefined;this['calleridname']=checkNameSurname(_0x5d00df[_0x6fed('0xc')][_0x6fed('0xd')],_0x5d00df[_0x6fed('0xc')]['firstName'],_0x5d00df[_0x6fed('0xc')]['lastName']);this[_0x6fed('0xe')]=_0x5d00df[_0x6fed('0xe')]||![];this[_0x6fed('0xf')]=_0x5d00df[_0x6fed('0xc')][_0x6fed('0xd')];this[_0x6fed('0x10')]=_0x5d00df[_0x6fed('0x10')];this['countbusyretry']=_0x5d00df[_0x6fed('0x11')]||0x0;this['countcongestionretry']=_0x5d00df[_0x6fed('0x12')]||0x0;this[_0x6fed('0x13')]=_0x5d00df[_0x6fed('0x13')]||0x0;this[_0x6fed('0x14')]=(_0x5d00df[_0x6fed('0x11')]||0x0)+(_0x5d00df[_0x6fed('0x12')]||0x0)+(_0x5d00df[_0x6fed('0x13')]||0x0)+(_0x5d00df[_0x6fed('0x15')]||0x0)+(_0x5d00df[_0x6fed('0x16')]||0x0)+(_0x5d00df[_0x6fed('0x17')]||0x0)+(_0x5d00df[_0x6fed('0x18')]||0x0)+(_0x5d00df['countagentrejectretry']||0x0);this[_0x6fed('0x15')]=_0x5d00df[_0x6fed('0x15')]||0x0;this[_0x6fed('0x16')]=_0x5d00df[_0x6fed('0x16')]||0x0;this[_0x6fed('0x17')]=_0x5d00df[_0x6fed('0x17')]||0x0;this[_0x6fed('0x18')]=_0x5d00df['countmachineretry']||0x0;this[_0x6fed('0x19')]=_0x5d00df[_0x6fed('0x19')]||0x0;this['callback']=_0x5d00df[_0x6fed('0x1a')];this['callbackuniqueid']=_0x5d00df[_0x6fed('0x1b')];this[_0x6fed('0x1c')]=_0x5d00df[_0x6fed('0x1c')];this['recallme']=_0x5d00df[_0x6fed('0x1d')];this['ContactId']=_0x5d00df['ContactId'];this[_0x6fed('0x1e')]=_0x5d00df[_0x6fed('0x1e')];this[_0x6fed('0x1f')]=_[_0x6fed('0x2')](_0x5d00df[_0x6fed('0x7')])?_0x5d00df['UserId']:_0x5d00df[_0x6fed('0x7')]['id'];this[_0x6fed('0x20')]=_0x5d00df[_0x6fed('0x20')];this[_0x6fed('0x21')]='';this[_0x6fed('0x22')]='';}Action[_0x6fed('0x23')][_0x6fed('0x24')]=function(){return util[_0x6fed('0xb')](_0x6fed('0x25'),this[_0x6fed('0x26')],this['number']);};module[_0x6fed('0x27')]=Action;
\ No newline at end of file
+var _0x2833=['originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','moment','isNil','queue','name','type','campaigntype','dialAnswer','Agent','format','membername','phone','firstName','active','calleridnum','Contact','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2833,0x1cb));var _0x3283=function(_0x4a58c6,_0x143c0f){_0x4a58c6=_0x4a58c6-0x0;var _0x359968=_0x2833[_0x4a58c6];return _0x359968;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3283('0x0'));function checkNameSurname(_0x1a415b,_0x179a6a,_0x1b9860){var _0x46ffaf='';if(!_[_0x3283('0x1')](_0x179a6a)&&'string'===typeof _0x179a6a){_0x46ffaf+=_0x179a6a;}if(!_[_0x3283('0x1')](_0x1b9860)&&'string'===typeof _0x1b9860){_0x46ffaf+='\x20'+_0x1b9860;}if(_0x46ffaf!==''){return _0x46ffaf;}return _0x1a415b;}function Action(_0xcb4027,_0x4471ab,_0x3e8e22,_0x28c9b8,_0xf4ca10){this['uniqueid']=_0x3e8e22||undefined;this['idContact']=_0xcb4027['id'];this[_0x3283('0x2')]=_0x4471ab[_0x3283('0x3')];this[_0x3283('0x4')]=_0x4471ab[_0x3283('0x4')];this[_0x3283('0x5')]=_0x3283('0x2');this[_0x3283('0x6')]=![];this['membername']=_[_0x3283('0x1')](_0xcb4027[_0x3283('0x7')])?undefined:_0xcb4027[_0x3283('0x7')][_0x3283('0x3')];this['channelAgent']=this['membername']?util[_0x3283('0x8')]('SIP/%s',this[_0x3283('0x9')]):_0x28c9b8||undefined;this['calleridname']=checkNameSurname(_0xcb4027['Contact'][_0x3283('0xa')],_0xcb4027['Contact'][_0x3283('0xb')],_0xcb4027['Contact']['lastName']);this[_0x3283('0xc')]=_0xcb4027[_0x3283('0xc')]||![];this[_0x3283('0xd')]=_0xcb4027[_0x3283('0xe')]['phone'];this[_0x3283('0xf')]=_0xcb4027[_0x3283('0xf')];this['countbusyretry']=_0xcb4027[_0x3283('0x10')]||0x0;this[_0x3283('0x11')]=_0xcb4027[_0x3283('0x11')]||0x0;this[_0x3283('0x12')]=_0xcb4027[_0x3283('0x12')]||0x0;this[_0x3283('0x13')]=(_0xcb4027['countbusyretry']||0x0)+(_0xcb4027[_0x3283('0x11')]||0x0)+(_0xcb4027['countnoanswerretry']||0x0)+(_0xcb4027[_0x3283('0x14')]||0x0)+(_0xcb4027[_0x3283('0x15')]||0x0)+(_0xcb4027[_0x3283('0x16')]||0x0)+(_0xcb4027[_0x3283('0x17')]||0x0)+(_0xcb4027['countagentrejectretry']||0x0);this[_0x3283('0x14')]=_0xcb4027[_0x3283('0x14')]||0x0;this[_0x3283('0x15')]=_0xcb4027['countdropretry']||0x0;this['countabandonedretry']=_0xcb4027[_0x3283('0x16')]||0x0;this[_0x3283('0x17')]=_0xcb4027['countmachineretry']||0x0;this[_0x3283('0x18')]=_0xcb4027[_0x3283('0x18')]||0x0;this[_0x3283('0x19')]=_0xcb4027[_0x3283('0x19')];this[_0x3283('0x1a')]=_0xcb4027[_0x3283('0x1a')];this[_0x3283('0x1b')]=_0xcb4027[_0x3283('0x1b')];this[_0x3283('0x1c')]=_0xcb4027[_0x3283('0x1c')];this['ContactId']=_0xcb4027[_0x3283('0x1d')];this['ListId']=_0xcb4027[_0x3283('0x1e')];this[_0x3283('0x1f')]=_['isNil'](_0xcb4027['Agent'])?_0xcb4027[_0x3283('0x1f')]:_0xcb4027[_0x3283('0x7')]['id'];this['VoiceQueueId']=_0xcb4027[_0x3283('0x20')];this[_0x3283('0x21')]='';this[_0x3283('0x22')]='';}Action[_0x3283('0x23')][_0x3283('0x24')]=function(){return util['format'](_0x3283('0x25'),this[_0x3283('0x26')],this[_0x3283('0x27')]);};module[_0x3283('0x28')]=Action;
\ No newline at end of file
index 384e747..ada8e90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa82c=['validateContact','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','isActive','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','addVariables','merge','toLowerVariables','Action','variablesAction','destconnectedlinenum','calleridnum','user:%s','accountcode','[originated][increment]','OriginateError','syncOriginateResponse','actionid','logLookAgent','clone','responsetime','YYYY-MM-DD\x20HH:mm:ss','isFailure','response','unlockContact','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','bind','hangup','hanguprequest','dialend','syncDialEnd','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clockClearZombieChannels','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','dialAnswer','loggerError','[Dialer][checkChannel][Preview]','size','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','outboundReCallsDay','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','loggedIn','message','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','countnosuchnumberretry','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','answertime','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','sumDuration','talktime','[syncHangup][talking][decrement]','linkedid','countbusyretry','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','rescheduleContact','dialNoAnswerRetryFrequency','CONGESTION','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','\x20Queue','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','Congestion','[callProgressDetectingAgent][logCongestion]','updateOriginated','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','unlock','getContactPreview','recallme'];(function(_0x13e374,_0x9b46da){var _0x5e5d32=function(_0x5b291e){while(--_0x5b291e){_0x13e374['push'](_0x13e374['shift']());}};_0x5e5d32(++_0x9b46da);}(_0xa82c,0x197));var _0xca82=function(_0x391a65,_0x2ac56d){_0x391a65=_0x391a65-0x0;var _0x4fa17a=_0xa82c[_0x391a65];return _0x4fa17a;};'use strict';var util=require(_0xca82('0x0'));var _=require(_0xca82('0x1'));var BPromise=require(_0xca82('0x2'));var uuid=require(_0xca82('0x3'));var moment=require(_0xca82('0x4'));var md5=require(_0xca82('0x5'));var Redis=require(_0xca82('0x6'));var config=require(_0xca82('0x7'));var logger=require(_0xca82('0x8'))(_0xca82('0x9'));var loggerAction=require(_0xca82('0x8'))(_0xca82('0xa'));var ami=require('../ami');var rpcDb=require(_0xca82('0xb'));var Action=require('./action');var ut=require('./util/util');config[_0xca82('0xc')]=_[_0xca82('0xd')](config[_0xca82('0xc')],{'host':_0xca82('0xe'),'port':0x18eb});var io=require(_0xca82('0xf'))(new Redis(config[_0xca82('0xc')]));var Sequence=function(){};Sequence[_0xca82('0x10')][_0xca82('0x11')]=function(_0x48b2ea){this['tail']=this[_0xca82('0x12')]?this[_0xca82('0x12')]['finally'](_0x48b2ea):_0x48b2ea();};function Preview(_0x557ac5){this[_0xca82('0x13')]=new Sequence();this[_0xca82('0x14')]=_0x557ac5[_0xca82('0x15')];this['trunks']=_0x557ac5[_0xca82('0x16')];this[_0xca82('0x17')]={};this['agents']=_0x557ac5[_0xca82('0x18')];this['clockClearZombieChannels']=0x0;ami['on'](_0xca82('0x19'),this['syncOriginateResponse'][_0xca82('0x1a')](this));ami['on'](_0xca82('0x1b'),this['syncHangup'][_0xca82('0x1a')](this));ami['on'](_0xca82('0x1c'),this['syncHangupRequest'][_0xca82('0x1a')](this));ami['on'](_0xca82('0x1d'),this[_0xca82('0x1e')][_0xca82('0x1a')](this));ami['on']('newexten',this[_0xca82('0x1f')][_0xca82('0x1a')](this));ami['on']('varset',this[_0xca82('0x20')][_0xca82('0x1a')](this));ami['on'](_0xca82('0x21'),this[_0xca82('0x22')][_0xca82('0x1a')](this));ami['on'](_0xca82('0x23'),this['syncBlindTransfer'][_0xca82('0x1a')](this));this[_0xca82('0x24')](this[_0xca82('0x14')]);}function emit(_0x2c398e,_0x119a06,_0x49b6a5){io['to'](_0x2c398e)[_0xca82('0x25')](_0x119a06,_0x49b6a5);}function emitCampaignPreview(_0x3c6f04){if(_0x3c6f04[_0xca82('0x26')]===_0xca82('0x27')){var _0x41efd1={'id':_0x3c6f04['id'],'name':_0x3c6f04[_0xca82('0x28')],'strategy':_0x3c6f04[_0xca82('0x29')],'answered':_0x3c6f04[_0xca82('0x2a')],'available':_0x3c6f04['available'],'loggedIn':_0x3c6f04['loggedIn'],'pTalking':_0x3c6f04[_0xca82('0x2b')],'sumBillable':_0x3c6f04[_0xca82('0x2c')],'sumDuration':_0x3c6f04['sumDuration'],'sumHoldTime':_0x3c6f04[_0xca82('0x2d')]||0x0,'talking':_0x3c6f04[_0xca82('0x2e')],'total':_0x3c6f04[_0xca82('0x2f')],'type':_0x3c6f04[_0xca82('0x26')],'unmanaged':_0x3c6f04[_0xca82('0x30')],'abandoned':_0x3c6f04[_0xca82('0x31')],'waiting':_0x3c6f04['waiting'],'loggedInDb':_0x3c6f04[_0xca82('0x32')],'dialActive':_0x3c6f04[_0xca82('0x33')],'dialMethod':_0x3c6f04[_0xca82('0x34')],'dialOriginateCallerIdName':_0x3c6f04[_0xca82('0x35')],'dialOriginateCallerIdNumber':_0x3c6f04[_0xca82('0x36')],'dialOriginateTimeout':_0x3c6f04[_0xca82('0x37')],'dialPrefix':_0x3c6f04[_0xca82('0x38')],'outboundAnswerAgiCallsDay':_0x3c6f04[_0xca82('0x39')],'outboundAnswerCallsDay':_0x3c6f04[_0xca82('0x3a')],'outboundBlacklistCallsDay':_0x3c6f04[_0xca82('0x3b')],'outboundBusyCallsDay':_0x3c6f04[_0xca82('0x3c')],'outboundCongestionCallsDay':_0x3c6f04[_0xca82('0x3d')],'outboundDropCallsDayACS':_0x3c6f04[_0xca82('0x3e')],'outboundDropCallsDayCallersExit':_0x3c6f04['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3c6f04[_0xca82('0x3f')],'outboundNoAnswerCallsDay':_0x3c6f04[_0xca82('0x40')],'outboundNoSuchCallsDay':_0x3c6f04['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x3c6f04[_0xca82('0x41')],'outboundReCallsDay':_0x3c6f04['outboundReCallsDay'],'outboundRejectCallsDay':_0x3c6f04[_0xca82('0x42')],'outboundUnknownCallsDay':_0x3c6f04[_0xca82('0x43')],'outboundAbandonedCallsDay':_0x3c6f04['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x3c6f04['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3c6f04[_0xca82('0x44')],'predictiveIntervalAvgTalktime':_0x3c6f04[_0xca82('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x3c6f04[_0xca82('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x3c6f04[_0xca82('0x47')],'predictiveIntervalErlangCalls':_0x3c6f04[_0xca82('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x3c6f04[_0xca82('0x49')],'predictiveIntervalHitRate':_0x3c6f04[_0xca82('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x3c6f04[_0xca82('0x4b')],'predictiveIntervalPauses':_0x3c6f04[_0xca82('0x4c')],'predictiveIntervalAvailable':_0x3c6f04[_0xca82('0x4d')],'predictiveIntervalTotalCalls':_0x3c6f04[_0xca82('0x4e')],'message':_0x3c6f04['message'],'originated':_0x3c6f04[_0xca82('0x4f')],'erlangCalls':_0x3c6f04[_0xca82('0x50')],'erlangCallToSecond':_0x3c6f04[_0xca82('0x51')],'erlangAbandonmentRate':_0x3c6f04[_0xca82('0x52')],'erlangBusyFactor':_0x3c6f04[_0xca82('0x53')],'startPredictive':_0x3c6f04[_0xca82('0x54')],'startProgressive':_0x3c6f04[_0xca82('0x55')]};if(_0x3c6f04[_0xca82('0x56')]){_0x41efd1[_0xca82('0x56')]={'id':_0x3c6f04['Trunk']['id'],'name':_0x3c6f04[_0xca82('0x56')][_0xca82('0x28')],'active':_0x3c6f04[_0xca82('0x56')][_0xca82('0x57')],'callerid':_0x3c6f04['Trunk'][_0xca82('0x58')]};}if(_0x3c6f04[_0xca82('0x59')]){_0x41efd1['Interval']={'id':_0x3c6f04['Interval']['id'],'name':_0x3c6f04[_0xca82('0x59')][_0xca82('0x28')]};}var _0xa52b18=md5(JSON['stringify'](_0x41efd1));if(_0x3c6f04[_0xca82('0x5')]!==_0xa52b18){_0x3c6f04['md5']=_0xa52b18;emit(util[_0xca82('0x5a')](_0xca82('0x5b'),_0x41efd1[_0xca82('0x28')]),_0xca82('0x5c'),_0x41efd1);}}}function emitVoiceQueueChannelRemove(_0x39f736){logger[_0xca82('0x5d')](_0xca82('0x5e'),JSON[_0xca82('0x5f')](_0x39f736));emit(util['format']('voice:queue:%s',_0x39f736[_0xca82('0x28')]),_0xca82('0x60'),_0x39f736);io[_0xca82('0x25')]('voice_queue_presence:remove',_0x39f736);}function notSendMessagesQueue(_0x275e95){if(_0x275e95[_0xca82('0x61')]){if(_0x275e95[_0xca82('0x4f')]===0x0&&_0x275e95[_0xca82('0x2b')]===0x0){_0x275e95[_0xca82('0x61')]=![];_0x275e95[_0xca82('0x62')]=0x0;_0x275e95[_0xca82('0x63')]=0x0;_0x275e95['message']=_0xca82('0x64');ut['logger'](_0xca82('0x65'),_0x275e95[_0xca82('0x28')]+_0xca82('0x66'));}else{_0x275e95['message']=_0xca82('0x67');ut[_0xca82('0x68')](_0xca82('0x65'),_0x275e95[_0xca82('0x28')]+_0xca82('0x69'));}emitCampaignPreview(_0x275e95);}}Preview['prototype'][_0xca82('0x24')]=function(){var _0x5ecae4=this;setInterval(function(){_0x5ecae4[_0xca82('0x6a')]();},0x7cf);};Preview[_0xca82('0x10')][_0xca82('0x6a')]=function(){var _0x2108cf=this[_0xca82('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x1b356c in _0x2108cf){if(_0x2108cf[_0xca82('0x6b')](_0x1b356c)&&(_0x2108cf[_0x1b356c][_0xca82('0x34')]===_0xca82('0x9')||_0x2108cf[_0x1b356c][_0xca82('0x34')]===_0xca82('0x6c'))&&_0x2108cf[_0x1b356c]['type']===_0xca82('0x27')){if(this[_0xca82('0x6d')]>0x7){this[_0xca82('0x6d')]=0x0;this[_0xca82('0x6e')]();}}if(_0x2108cf[_0xca82('0x6b')](_0x1b356c)&&_0x2108cf[_0x1b356c][_0xca82('0x34')]===_0xca82('0x9')&&_0x2108cf[_0x1b356c][_0xca82('0x26')]==='outbound'){if(_0x2108cf[_0x1b356c][_0xca82('0x33')]){this[_0xca82('0x6f')](_0x2108cf[_0x1b356c]);this[_0xca82('0x70')](_0x2108cf[_0x1b356c]);}else{notSendMessagesQueue(_0x2108cf[_0x1b356c]);}}}};Preview[_0xca82('0x10')][_0xca82('0x71')]=function(_0x5a2736){var _0x49f0b0=this;this[_0xca82('0x13')][_0xca82('0x11')](function(){if(!_[_0xca82('0x72')](_0x49f0b0['actions'][_0x5a2736])){loggerAction[_0xca82('0x5d')](_0xca82('0x73'),_0x5a2736,_0xca82('0x74'),_0x49f0b0[_0xca82('0x17')][_0x5a2736]['queue'],_0xca82('0x75'),JSON['stringify'](_0x49f0b0['campaignsPreview'][_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x76')]][_0xca82('0x4f')]),_0xca82('0x77'),JSON[_0xca82('0x5f')](_0x49f0b0[_0xca82('0x14')][_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x76')]][_0xca82('0x2b')]),JSON[_0xca82('0x5f')](_0x49f0b0[_0xca82('0x17')][_0x5a2736]['dialAnswer']),JSON['stringify'](_[_0xca82('0x78')](_0x49f0b0['actions'][_0x5a2736],[_0xca82('0x79'),_0xca82('0x7a'),_0xca82('0x7b'),'ListId'])));return ami['Action']({'action':_0xca82('0x7c'),'channel':_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x7d')]})[_0xca82('0x7e')](function(_0xb739fa){if(_0xb739fa['message']===_0xca82('0x7f')){setTimeout(function(){if(_0x49f0b0['actions'][_0x5a2736]){ut['updateOriginated'](_0x49f0b0[_0xca82('0x14')][_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x76')]],_0xca82('0x80'));if(_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x81')]===!![]){ut['decrementTalkink'](_0x49f0b0[_0xca82('0x14')][_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x76')]],'[clearZombieChannel]');ut[_0xca82('0x82')]('[Dialer][checkChannel][pTalking][Preview]'+_0x5a2736,_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x76')]);}ut[_0xca82('0x82')](_0xca82('0x83')+_0x5a2736,_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x76')]);delete _0x49f0b0['actions'][_0x5a2736];}},0x2328);}});}});};Preview['prototype'][_0xca82('0x6e')]=function(){var _0x2c5559=this;loggerAction[_0xca82('0x5d')]('[action]',_[_0xca82('0x84')](this[_0xca82('0x17')]));for(var _0x424d1b in this[_0xca82('0x17')]){if(_0x2c5559[_0xca82('0x17')]['hasOwnProperty'](_0x424d1b)){_0x2c5559['clearZombieChannel'](_0x424d1b);}}};Preview[_0xca82('0x10')][_0xca82('0x70')]=function(_0x196f94){var _0x2d9690=this;rpcDb['getContactRecallMe'](_0x196f94['id'],ut['agentReadyId'](this[_0xca82('0x18')]))[_0xca82('0x85')](function(_0x2f2eca){if(!_['isNil'](_0x2f2eca)){for(var _0x142af=0x0;_0x142af<_0x2f2eca[_0xca82('0x86')];_0x142af+=0x1){if(ut[_0xca82('0x87')](_0x2f2eca[_0x142af][_0xca82('0x88')])<_0x196f94['dialRecallMeTimeout']*0x3c){if(_0x2f2eca[_0x142af]['Agent']&&!_0x2f2eca[_0x142af][_0xca82('0x89')][_0xca82('0x8a')]){_0x2d9690[_0xca82('0x8b')](_0x2f2eca[_0x142af]['id'])[_0xca82('0x85')](ut['logger2']('[RecallMe]'))[_0xca82('0x7e')](ut[_0xca82('0x8c')](_0xca82('0x8d')));}else{rpcDb[_0xca82('0x8e')](_0x2f2eca[_0x142af]['id']);}}else{var _0x13ac31=new Action(_0x2f2eca[_0x142af],_0x196f94);_0x13ac31[_0xca82('0x8f')]=moment()[_0xca82('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x196f94[_0xca82('0x90')]+=0x1;ut[_0xca82('0x91')](_0x13ac31,0x17,'RecallInQueue');if(_0x196f94[_0xca82('0x92')]){rpcDb[_0xca82('0x93')](ut[_0xca82('0x94')](_0x2f2eca[_0x142af]));rpcDb[_0xca82('0x95')](_0x13ac31,_0xca82('0x96'));}else{ut['logCustomer'](_0x13ac31,0x16,_0xca82('0x97'));rpcDb[_0xca82('0x95')](_0x13ac31,_0xca82('0x98'));rpcDb[_0xca82('0x99')](_0x13ac31,'[HistoryRecallClose]');}}}}})[_0xca82('0x7e')](ut[_0xca82('0x8c')](_0xca82('0x9a')));};Preview[_0xca82('0x10')]['setMessage']=function(_0x531e18){_0x531e18[_0xca82('0x61')]=!![];if(ut['IsNotLoggedIn'](_0x531e18[_0xca82('0x9b')])){_0x531e18[_0xca82('0x9c')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x531e18[_0xca82('0x33')])){_0x531e18[_0xca82('0x9c')]=_0xca82('0x64');}else if(!this[_0xca82('0x9d')](_0x531e18[_0xca82('0x56')])){if(!this[_0xca82('0x9d')](_0x531e18[_0xca82('0x9e')])){_0x531e18[_0xca82('0x9c')]=_0xca82('0x9f');}else{_0x531e18[_0xca82('0x9c')]=_0xca82('0xa0');}}else{_0x531e18[_0xca82('0x9c')]=_0xca82('0xa0');}emitCampaignPreview(_0x531e18);};Preview[_0xca82('0x10')][_0xca82('0xa1')]=function(_0x50827b,_0x429d23,_0x5ec40d){var _0x4fbec1=this;var _0x40f077=this['actions'][_0x429d23];var _0x30fa2f=this[_0xca82('0x14')][_0x40f077[_0xca82('0x76')]];var _0x278e8c;if(_0x30fa2f){switch(_0x5ec40d){case'1':_0x30fa2f[_0xca82('0xa2')]+=0x1;_0x40f077['countnosuchnumberretry']+=0x1;_0x40f077[_0xca82('0xa3')]=ut[_0xca82('0xa4')](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0x0,_0xca82('0xa5'));ami[_0xca82('0x25')](_0xca82('0xa6'),ut[_0xca82('0xa7')](_0x40f077,_0xca82('0xa8')));rpcDb[_0xca82('0x95')](_0x40f077,_0xca82('0xa9'));if(ut[_0xca82('0xa4')](_0x40f077)>=_0x30fa2f[_0xca82('0xaa')]){_0x278e8c=ut['cloneAction'](_0x40f077,0xf,_0xca82('0xab'));rpcDb[_0xca82('0x99')](_0x278e8c,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x40f077[_0xca82('0xac')]>=_0x30fa2f['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x40f077,_0xca82('0xad'));}else{rpcDb['rescheduleContact'](ut[_0xca82('0xae')](_0x40f077,'countnosuchnumberretry',_0x30fa2f[_0xca82('0xaf')]),_0x40f077[_0xca82('0xb0')],_0x40f077[_0xca82('0xb1')]);}}delete this['actions'][_0x50827b['linkedid']];break;case _0xca82('0xb2'):var _0x88d8d1=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x40f077['responsetime']=_0x88d8d1;_0x40f077[_0xca82('0xb3')]=_0x88d8d1;_0x40f077[_0xca82('0x81')]=!![];_0x30fa2f[_0xca82('0x2b')]+=0x1;logger[_0xca82('0x5d')]('[syncHangup][talking][increment]',_0x40f077[_0xca82('0xb4')],'\x20Queue',_0x30fa2f[_0xca82('0x28')],'pTalking:\x20',_0x30fa2f['pTalking']);ami[_0xca82('0x25')](_0xca82('0xb5'),ut[_0xca82('0xa7')](_0x40f077,_0xca82('0xb6'),this['campaignsPreview'][_0x40f077[_0xca82('0x76')]]));if(_0x30fa2f[_0xca82('0xb7')]){ami['emit'](_0xca82('0xb8'),ut[_0xca82('0xb9')](_0x40f077));}break;case'16':ami[_0xca82('0x25')]('custom:agentcomplete',ut[_0xca82('0xa7')](_0x40f077,_0xca82('0xba'),this[_0xca82('0x14')][_0x40f077[_0xca82('0x76')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x40f077,'complete'));_0x30fa2f[_0xca82('0x3a')]+=0x1;_0x30fa2f[_0xca82('0x2f')]+=0x1;_0x30fa2f[_0xca82('0x2a')]+=0x1;ut[_0xca82('0xbb')](_0x30fa2f,_0xca82('0xbc'));_0x40f077[_0xca82('0xa3')]=ut['totalGlobal'](_0x40f077);ut['logCustomer'](_0x40f077,0x4,_0xca82('0xbd'));rpcDb[_0xca82('0x95')](_0x40f077,_0xca82('0xbe'));rpcDb[_0xca82('0x99')](_0x40f077,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x40f077);_0x30fa2f[_0xca82('0xbf')]+=_0x40f077[_0xca82('0xc0')];_0x30fa2f['sumBillable']+=_0x40f077['talktime'];logger[_0xca82('0x5d')](_0xca82('0xc1'),_0x40f077[_0xca82('0xb4')],'\x20Queue',_0x30fa2f[_0xca82('0x28')],'pTalking:\x20',_0x30fa2f[_0xca82('0x2b')]);delete this['actions'][_0x50827b[_0xca82('0xc2')]];break;case'BUSY':_0x30fa2f[_0xca82('0x3c')]+=0x1;_0x40f077[_0xca82('0xc3')]+=0x1;_0x40f077[_0xca82('0xa3')]=ut[_0xca82('0xa4')](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0x5,'Busy');ami[_0xca82('0x25')]('custom:agentbusy',ut['buildObj'](_0x40f077,'busy'));rpcDb[_0xca82('0x95')](_0x40f077,_0xca82('0xc4'));if(ut[_0xca82('0xa4')](_0x40f077)>=_0x30fa2f[_0xca82('0xaa')]){_0x278e8c=ut[_0xca82('0xc5')](_0x40f077,0xf,_0xca82('0xab'));rpcDb[_0xca82('0x99')](_0x278e8c,_0xca82('0xc6'));}else{if(_0x40f077[_0xca82('0xc3')]>=_0x30fa2f[_0xca82('0xc7')]){rpcDb['createCustomerFinal'](_0x40f077,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut[_0xca82('0xae')](_0x40f077,_0xca82('0xc3'),_0x30fa2f['dialBusyRetryFrequency']),_0x40f077['unlockAgent'],_0x40f077[_0xca82('0xb1')]);}}break;case _0xca82('0xc8'):_0x30fa2f[_0xca82('0x40')]+=0x1;_0x40f077[_0xca82('0xc9')]+=0x1;_0x40f077[_0xca82('0xa3')]=ut['totalGlobal'](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0x3,_0xca82('0xca'));ami[_0xca82('0x25')](_0xca82('0xcb'),ut[_0xca82('0xa7')](_0x40f077,_0xca82('0xcc')));rpcDb[_0xca82('0x95')](_0x40f077,_0xca82('0xcd'));if(ut['totalGlobal'](_0x40f077)>=_0x30fa2f['dialGlobalMaxRetry']){_0x278e8c=ut['cloneAction'](_0x40f077,0xf,_0xca82('0xab'));rpcDb[_0xca82('0x99')](_0x278e8c,_0xca82('0xce'));}else{if(_0x40f077['countnoanswerretry']>=_0x30fa2f[_0xca82('0xcf')]){rpcDb[_0xca82('0x99')](_0x40f077,_0xca82('0xcd'));}else{rpcDb[_0xca82('0xd0')](ut[_0xca82('0xae')](_0x40f077,_0xca82('0xc9'),_0x30fa2f[_0xca82('0xd1')]),_0x40f077['unlockAgent'],_0x40f077[_0xca82('0xb1')]);}}break;case _0xca82('0xd2'):_0x30fa2f['outboundCongestionCallsDay']+=0x1;_0x40f077['countcongestionretry']+=0x1;_0x40f077[_0xca82('0xa3')]=ut['totalGlobal'](_0x40f077);ut['logCustomer'](_0x40f077,0x8,'Congestion');ami['emit'](_0xca82('0xd3'),ut[_0xca82('0xa7')](_0x40f077,'congestion'));rpcDb['createCustomerHistory'](_0x40f077,_0xca82('0xd4'));if(ut[_0xca82('0xa4')](_0x40f077)>=_0x30fa2f[_0xca82('0xaa')]){_0x278e8c=ut[_0xca82('0xc5')](_0x40f077,0xf,'Global');rpcDb[_0xca82('0x99')](_0x278e8c,_0xca82('0xd5'));}else{if(_0x40f077[_0xca82('0xd6')]>=_0x30fa2f[_0xca82('0xd7')]){rpcDb['createCustomerFinal'](_0x40f077,_0xca82('0xd4'));}else{rpcDb['rescheduleContact'](ut[_0xca82('0xae')](_0x40f077,_0xca82('0xd6'),_0x30fa2f[_0xca82('0xd8')]),_0x40f077['unlockAgent'],_0x40f077['activeContact']);}}break;case _0xca82('0xd9'):_0x30fa2f[_0xca82('0x42')]+=0x1;_0x40f077['countagentrejectretry']+=0x1;_0x40f077['countglobal']=ut[_0xca82('0xa4')](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0x14,_0xca82('0xda'));ami['emit']('custom:agentreject',ut[_0xca82('0xa7')](_0x40f077,'agentreject'));rpcDb[_0xca82('0x95')](_0x40f077,'[syncHangupRequest][logAgentReject]');if(ut['totalGlobal'](_0x40f077)>=_0x30fa2f['dialGlobalMaxRetry']){_0x278e8c=ut['cloneAction'](_0x40f077,0x14,'AgentReject');rpcDb[_0xca82('0x99')](_0x278e8c,_0xca82('0xdb'));}else{if(_0x40f077[_0xca82('0xdc')]>=_0x30fa2f[_0xca82('0xdd')]){rpcDb[_0xca82('0x99')](_0x40f077,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0xca82('0xae')](_0x40f077,'countagentrejectretry',_0x30fa2f[_0xca82('0xde')]),_0x40f077[_0xca82('0xb0')],_0x40f077[_0xca82('0xb1')]);}}break;case _0xca82('0xdf'):_0x30fa2f[_0xca82('0xe0')]+=0x1;_0x40f077['countabandonedretry']+=0x1;_0x40f077[_0xca82('0xa3')]=ut[_0xca82('0xa4')](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0xb,_0xca82('0xe1'));rpcDb[_0xca82('0x95')](_0x40f077,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x40f077)>=_0x30fa2f[_0xca82('0xaa')]){_0x278e8c=ut[_0xca82('0xc5')](_0x40f077,0xf,'Global');rpcDb[_0xca82('0x99')](_0x278e8c,_0xca82('0xe2'));}else{if(_0x40f077[_0xca82('0xe3')]>=_0x30fa2f[_0xca82('0xe4')]){rpcDb[_0xca82('0x99')](_0x40f077,_0xca82('0xe2'));}else{rpcDb['rescheduleContact'](ut[_0xca82('0xae')](_0x40f077,_0xca82('0xe5'),_0x30fa2f[_0xca82('0xe6')]),_0x40f077[_0xca82('0xb0')],_0x40f077[_0xca82('0xb1')]);}}break;case'18':_0x30fa2f[_0xca82('0x43')]+=0x1;_0x40f077[_0xca82('0xe7')]+=0x1;_0x40f077[_0xca82('0xa3')]=ut['totalGlobal'](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0x12,_0x50827b['cause-txt']||_0x50827b[_0xca82('0xe8')]);ami[_0xca82('0x25')](_0xca82('0xe9'),ut[_0xca82('0xa7')](_0x40f077,_0xca82('0xea')));rpcDb[_0xca82('0x95')](_0x40f077,_0xca82('0xeb'));if(ut[_0xca82('0xa4')](_0x40f077)>=_0x30fa2f[_0xca82('0xaa')]){_0x278e8c=ut[_0xca82('0xc5')](_0x40f077,0xf,'Global');rpcDb[_0xca82('0x99')](_0x278e8c,_0xca82('0xeb'));}else{rpcDb['createCustomerFinal'](_0x40f077,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xca82('0x17')][_0x50827b[_0xca82('0xc2')]];break;case'19':_0x30fa2f['outboundUnknownCallsDay']+=0x1;_0x40f077['countglobal']=ut[_0xca82('0xa4')](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0x13,_0x50827b[_0xca82('0xec')]||_0x50827b[_0xca82('0xe8')]);ami[_0xca82('0x25')]('custom:amd',ut['buildObj'](_0x40f077,_0xca82('0xea')));rpcDb[_0xca82('0x95')](_0x40f077,'[callProgressDetectingCustomer][machine]');if(ut[_0xca82('0xa4')](_0x40f077)>=_0x30fa2f['dialGlobalMaxRetry']){_0x278e8c=ut[_0xca82('0xc5')](_0x40f077,0xf,'Global');rpcDb[_0xca82('0x99')](_0x278e8c,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xca82('0x99')](_0x40f077,_0xca82('0xed'));}delete this['actions'][_0x50827b[_0xca82('0xc2')]];break;default:if(_0x40f077[_0xca82('0x81')]){ut[_0xca82('0xbb')](_0x30fa2f,_0xca82('0xee'));ut['loggerError'](_0xca82('0xef')+_0x30fa2f[_0xca82('0x28')],_0x50827b);}_0x30fa2f[_0xca82('0x43')]+=0x1;_0x40f077[_0xca82('0xa3')]=ut[_0xca82('0xa4')](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0xc,_0x50827b[_0xca82('0xec')]||_0x50827b['dialstatus']);rpcDb['createCustomerHistory'](_0x40f077,_0xca82('0xf0'));if(ut[_0xca82('0xa4')](_0x40f077)>=_0x30fa2f[_0xca82('0xaa')]){_0x278e8c=ut['cloneAction'](_0x40f077,0xf,_0xca82('0xab'));rpcDb['createCustomerFinal'](_0x278e8c,_0xca82('0xf1'));}else{rpcDb[_0xca82('0x99')](_0x40f077,_0xca82('0xf1'));}delete this[_0xca82('0x17')][_0x50827b[_0xca82('0xc2')]];}if(!(_0x40f077[_0xca82('0x81')]&&_0x5ec40d==='16')){ut['updateOriginated'](_0x30fa2f,_0xca82('0xf2'));logger[_0xca82('0x5d')](_0xca82('0xf3'),_0x40f077[_0xca82('0xb4')],_0xca82('0xf4'),_0x30fa2f[_0xca82('0x28')],'originated:\x20',_0x30fa2f[_0xca82('0x4f')]);}if(_0x5ec40d!==_0xca82('0xb2')){delete this[_0xca82('0x17')][_0x50827b[_0xca82('0xc2')]];delete this[_0xca82('0x17')][_0x50827b[_0xca82('0xf5')]];}}};Preview[_0xca82('0x10')][_0xca82('0xf6')]=function(_0x2ac06b,_0x1090f5,_0x1f1def){if(_[_0xca82('0xf7')](_0x1090f5)&&'object'!==typeof _0x1090f5){return;}if(_[_0xca82('0xf7')](_0x1f1def)&&_0xca82('0xf8')!==typeof _0x1f1def){return;}switch(_0x1f1def[_0xca82('0xf9')]){case'0':ut[_0xca82('0xfa')](_0x2ac06b,0x0,_0xca82('0xa5'));rpcDb[_0xca82('0xfb')](_0x2ac06b,_0xca82('0xfc'));break;case'3':ut[_0xca82('0xfa')](_0x2ac06b,0x3,_0xca82('0xca'));rpcDb[_0xca82('0xfb')](_0x2ac06b,_0xca82('0xfd'));break;case'5':ut['logAgent'](_0x2ac06b,0x5,_0xca82('0xfe'));rpcDb[_0xca82('0xfb')](_0x2ac06b,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x2ac06b,0x8,_0xca82('0xff'));rpcDb[_0xca82('0xfb')](_0x2ac06b,_0xca82('0x100'));break;case'22':ut[_0xca82('0xfa')](_0x2ac06b,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x2ac06b,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xca82('0xfa')](_0x2ac06b,0xc,_0x1f1def[_0xca82('0xf9')]);rpcDb['createAgentHistory'](_0x2ac06b,'[callProgressDetectingAgent][logCongestion]');}ut[_0xca82('0x101')](_0x1090f5,_0xca82('0x102'));logger[_0xca82('0x5d')](_0xca82('0x103'),_0x2ac06b[_0xca82('0xb4')],_0xca82('0xf4'),_0x1090f5[_0xca82('0x28')],_0xca82('0x75'),_0x1090f5[_0xca82('0x4f')]);delete this[_0xca82('0x17')][_0x2ac06b[_0xca82('0xb4')]];};Preview['prototype'][_0xca82('0x104')]=function(_0x24e2a9,_0x337e02,_0x74b42d,_0x361f9d,_0x537096){var _0x2d4047=this;return new BPromise(function(_0x410d7a,_0x4dc6ca){if(_[_0xca82('0x72')](_0x337e02)||_[_0xca82('0x72')](_0x337e02[_0xca82('0x105')])||_['isNil'](_0x337e02[_0xca82('0x105')][_0xca82('0x106')])||_[_0xca82('0x72')](_0x337e02[_0xca82('0x7b')])){_0x4dc6ca(ut['message'](_0xca82('0x107'),_0x361f9d,_0x537096));return;}var _0x2b2750=uuid['v4']();var _0x40c77d=_0x2d4047[_0xca82('0x14')][_0x337e02[_0xca82('0x74')][_0xca82('0x28')]];var _0x3a1849=_0x74b42d?_0x2d4047[_0xca82('0x18')][_0x74b42d]['id']:undefined;_0x2d4047[_0xca82('0x17')][_0x2b2750]=new Action(_0x337e02,_0x40c77d,_0x2b2750,_0x74b42d,_0x3a1849);var _0xf64fe4=_0x2d4047[_0xca82('0x17')][_0x2b2750];_0xf64fe4[_0xca82('0xb0')]=_0x361f9d;_0xf64fe4[_0xca82('0xb1')]=_0x537096;_0xf64fe4[_0xca82('0x108')]=_0x74b42d;if(_['isEmpty'](_0x24e2a9)){_0x2d4047[_0xca82('0x109')](_0xf64fe4,_0x40c77d,_0x337e02,_0x74b42d)['then'](function(_0xe7650c){logger['info'](_0xca82('0x10a'),'Queue:\x20'+_0xf64fe4[_0xca82('0x76')]+_0xca82('0x10b')+_0xf64fe4[_0xca82('0x10c')],JSON[_0xca82('0x5f')](_0xe7650c));ami['emit'](_0xca82('0x10d'),ut[_0xca82('0xa7')](_0xf64fe4,_0xca82('0x10e'),_0x2d4047[_0xca82('0x14')][_0xf64fe4[_0xca82('0x76')]]));_0x410d7a(ut['message'](_0xca82('0x10f')));})['catch'](function(_0x204392){ut[_0xca82('0x68')](_0xca82('0x110'),_0x204392);_0x4dc6ca(ut['message'](_0xca82('0x111'),_0x361f9d,_0x537096));});}else{_0x40c77d[_0xca82('0x3b')]+=0x1;ut[_0xca82('0x112')](_0xf64fe4);rpcDb['createHistory'](_0xf64fe4,_0xca82('0x113'));delete _0x2d4047['actions'][_0x2b2750];_0x4dc6ca(ut[_0xca82('0x9c')](_0xca82('0x114'),_0x361f9d,_0x537096));}});};Preview['prototype'][_0xca82('0x9d')]=function(_0x18b871){return!_[_0xca82('0x72')](_0x18b871)&&!_['isNil'](_0x18b871[_0xca82('0x28')])&&!_[_0xca82('0x72')](_0x18b871[_0xca82('0x57')])&&_0x18b871['active']&&!_[_0xca82('0x72')](this[_0xca82('0x16')][util['format']('SIP/%s',_0x18b871[_0xca82('0x28')])])&&!_[_0xca82('0x72')](this['trunks'][util[_0xca82('0x5a')](_0xca82('0x115'),_0x18b871[_0xca82('0x28')])][_0xca82('0x7c')])&&(this[_0xca82('0x16')][util[_0xca82('0x5a')](_0xca82('0x115'),_0x18b871[_0xca82('0x28')])]['status']==='reachable'||this[_0xca82('0x16')][util[_0xca82('0x5a')](_0xca82('0x115'),_0x18b871['name'])][_0xca82('0x7c')]===_0xca82('0x116'));};Preview[_0xca82('0x10')][_0xca82('0x8b')]=function(_0x172388,_0x4b373d){var _0x104b74=this;return new BPromise(function(_0x109769,_0x49c755){_0x104b74[_0xca82('0x117')](_0x172388,_0x4b373d)[_0xca82('0x85')](function(_0x19dff7){_0x109769(_[_0xca82('0x78')](_0x19dff7,['message']));})[_0xca82('0x7e')](function(_0x2bf1cb){if(_0x2bf1cb[_0xca82('0x118')]){rpcDb['unlockContact'](_0x172388);}if(_0x2bf1cb['active']){rpcDb[_0xca82('0x8e')](_0x172388);}_0x49c755(_[_0xca82('0x78')](_0x2bf1cb,[_0xca82('0x9c')]));});});};Preview[_0xca82('0x10')][_0xca82('0x117')]=function(_0x25739a,_0x4adfde){var _0x724f11=this;return new BPromise(function(_0x19b54a,_0x1e91cc){var _0x110a19,_0x1a29f2;rpcDb[_0xca82('0x119')](_0x25739a)[_0xca82('0x85')](function(_0x330f8e){if(!_['isNil'](_0x330f8e[0x0])){_0x1a29f2=_0x330f8e[0x0][_0xca82('0x11a')]?![]:!![];_0x110a19=_0x330f8e[0x0][_0xca82('0x11a')]?!![]:![];_0x110a19=_0x4adfde?!![]:_0x110a19;}var _0x54d86e=_0x724f11[_0xca82('0x11b')](_0x330f8e);if(_0x54d86e['isValid']){rpcDb['checkIsBlackList'](_[_0xca82('0x78')](_0x330f8e[0x0],[_0xca82('0x7b'),'Contact.phone']))['then'](function(_0x2ea06f){_0x724f11['checkInBlack'](_0x2ea06f,_0x330f8e[0x0],_0x4adfde,_0x1a29f2,_0x110a19)[_0xca82('0x85')](function(_0x512613){_0x19b54a(_0x512613);})[_0xca82('0x7e')](function(_0x94dd1b){_0x1e91cc(_0x94dd1b);});})[_0xca82('0x7e')](function(_0x349031){ut[_0xca82('0x68')]('[Preview][checkIsBlackList]',_0x349031);_0x1e91cc(ut[_0xca82('0x9c')]('Call\x20unsuccessful',_0x1a29f2,_0x110a19));});}else{_0x1e91cc(ut['message'](_0x54d86e['message'],_0x1a29f2,_0x110a19));}})['catch'](function(_0x1a8bb6){ut[_0xca82('0x68')](_0xca82('0x11c'),_0x1a8bb6);_0x1e91cc(ut[_0xca82('0x9c')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xca82('0x10')]['validateContact']=function(_0x4baeb4){if(_[_0xca82('0x72')](_0x4baeb4)||_[_0xca82('0x11d')](_0x4baeb4)||!_[_0xca82('0x72')](_0x4baeb4[0x0]['Agent'])&&_['isNil'](_0x4baeb4[0x0]['Agent'][_0xca82('0x28')])){ut[_0xca82('0x68')](_0xca82('0x11e'),_0x4baeb4);return{'isValid':![],'message':_0xca82('0x11f')};}var _0xa0d1b=this[_0xca82('0x14')][_0x4baeb4[0x0][_0xca82('0x74')][_0xca82('0x28')]];_0xa0d1b[_0xca82('0x9c')]=_0xca82('0xa0');if(_[_0xca82('0x72')](_0xa0d1b)){ut[_0xca82('0x68')](_0xca82('0x120'),_0xa0d1b);return{'isValid':![],'message':_0xca82('0x121')};}if(!this[_0xca82('0x9d')](_0xa0d1b['Trunk'])){ut[_0xca82('0x68')](_0xca82('0x122'),'campaign\x20Name:\x20'+_0xa0d1b[_0xca82('0x28')]+_0xca82('0x123'));if(!this[_0xca82('0x9d')](_0xa0d1b['TrunkBackup'])){ut[_0xca82('0x68')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xa0d1b[_0xca82('0x28')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0xca82('0x124')](_0xa0d1b[_0xca82('0x33')])){ut[_0xca82('0x68')]('[Preview][validateContact][Campaign\x20Active]',_0xa0d1b['name']+_0xca82('0x125'));return{'isValid':![],'message':_0xca82('0x126')+_0xa0d1b['name']+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xca82('0x127')};};Preview[_0xca82('0x10')]['execCall']=function(_0x3246a0,_0x45dcc1,_0x130f07,_0xc5c097){var _0x3af6d6=this;return new BPromise(function(_0x454647,_0x1d1028){var _0x13c934=_0x3246a0[_0xca82('0xb4')];var _0x542d90=_0x3af6d6[_0xca82('0x9d')](_0x45dcc1['Trunk'])?util[_0xca82('0x5a')]('SIP/%s/%s%s',_0x45dcc1['Trunk'][_0xca82('0x28')],_[_0xca82('0x72')](_0x45dcc1[_0xca82('0x38')])?'':_0x45dcc1['dialPrefix'][_0xca82('0x128')]()||'',_0x45dcc1[_0xca82('0x129')]>0x0?_0x130f07[_0xca82('0x105')]['phone'][_0xca82('0x12a')](_0x45dcc1['dialCutDigit']):_0x130f07['Contact'][_0xca82('0x106')]):util['format'](_0xca82('0x12b'),_[_0xca82('0x72')](_0x45dcc1['TrunkBackup'])?_0x45dcc1[_0xca82('0x56')][_0xca82('0x28')]:_0x45dcc1[_0xca82('0x9e')]['name'],_['isNil'](_0x45dcc1['dialPrefix'])?'':_0x45dcc1[_0xca82('0x38')][_0xca82('0x128')]()||'',_0x45dcc1[_0xca82('0x129')]>0x0?_0x130f07['Contact'][_0xca82('0x106')]['substring'](_0x45dcc1[_0xca82('0x129')]):_0x130f07['Contact'][_0xca82('0x106')]);var _0x44a673=_0x3af6d6[_0xca82('0x9d')](_0x45dcc1[_0xca82('0x56')])?ut[_0xca82('0x12c')](_0x45dcc1[_0xca82('0x56')][_0xca82('0x58')],_0x45dcc1['dialOriginateCallerIdName'],_0x45dcc1['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x45dcc1[_0xca82('0x36')],_0x45dcc1['dialRandomLastDigitCallerIdNumber']):_0x45dcc1['dialOriginateCallerIdNumber']):ut[_0xca82('0x12c')](_[_0xca82('0x72')](_0x45dcc1['TrunkBackup'])?_0x45dcc1[_0xca82('0x56')][_0xca82('0x58')]:_0x45dcc1['TrunkBackup'][_0xca82('0x58')],_0x45dcc1[_0xca82('0x35')],_0x45dcc1[_0xca82('0x12d')]>0x0?ut[_0xca82('0x12e')](_0x45dcc1[_0xca82('0x36')],_0x45dcc1['dialRandomLastDigitCallerIdNumber']):_0x45dcc1[_0xca82('0x36')]);if(_0x44a673){_0x3246a0[_0xca82('0x12f')]=ut['extractCalleridName'](_0x44a673);_0x3246a0[_0xca82('0x130')]=ut['extractCalleridNumber'](_0x44a673);}var _0x3b6da1=ut[_0xca82('0x131')](_0x45dcc1,_0x130f07,_0x542d90,_0x44a673,_0x13c934,_0x3246a0);_[_0xca82('0x132')](_0x3246a0,ut[_0xca82('0x133')](_0x3b6da1));_0x3246a0[_0xca82('0x8f')]=moment()[_0xca82('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xca82('0x134')](ut[_0xca82('0x135')](_0x3246a0,_0x45dcc1,_0x3b6da1,_0x3246a0[_0xca82('0xb1')],_0xc5c097))[_0xca82('0x85')](function(_0x3eb45a){var _0x9aa1b9=_0x3246a0['channelAgent'];if(!_[_0xca82('0x72')](_0x9aa1b9)){if(!_[_0xca82('0x72')](_0x3af6d6[_0xca82('0x18')][_0x9aa1b9])){_0x3af6d6[_0xca82('0x18')][_0x9aa1b9][_0xca82('0x136')]=_0x3246a0[_0xca82('0x137')];emit(util['format'](_0xca82('0x138'),_0x3af6d6[_0xca82('0x18')][_0x9aa1b9][_0xca82('0x28')]),'user:agentconnect',{'destaccountcode':_0x3af6d6[_0xca82('0x18')][_0x9aa1b9][_0xca82('0x139')],'destconnectedlinenum':_0x3246a0['calleridnum']});}}_0x45dcc1[_0xca82('0x4f')]+=0x1;logger['info'](_0xca82('0x13a'),_0x13c934,'\x20Queue',_0x45dcc1[_0xca82('0x28')],_0xca82('0x75'),_0x45dcc1[_0xca82('0x4f')]);_0x454647(_0x3eb45a);})[_0xca82('0x7e')](function(_0x543f52){ut[_0xca82('0xfa')](_0x3246a0,0xe,_0xca82('0x13b'));rpcDb[_0xca82('0xfb')](_0x3246a0,'[originateFailure][logOriginateFailure]');_0x1d1028(_0x543f52);});});};Preview['prototype'][_0xca82('0x1f')]=function(_0x2b0e30){if(this[_0xca82('0x17')][_0x2b0e30[_0xca82('0xc2')]]){this[_0xca82('0x17')][_0x2b0e30[_0xca82('0xc2')]][_0xca82('0x7d')]=_0x2b0e30[_0xca82('0x7d')];}};Preview['prototype'][_0xca82('0x13c')]=function(_0x50a0b5){var _0x22fa29=this;var _0x3eefe1=this['actions'][_0x50a0b5[_0xca82('0x13d')]];if(_0x3eefe1){if(_0x3eefe1['lookAgent']&&this[_0xca82('0x18')][_0x3eefe1[_0xca82('0x108')]]){ut[_0xca82('0x13e')](_0x3eefe1,this['agents'][_0x3eefe1[_0xca82('0x108')]][_0xca82('0x28')],this[_0xca82('0x18')][_0x3eefe1[_0xca82('0x108')]]['id']);}var _0x17ad07=_[_0xca82('0x13f')](_0x3eefe1);_0x17ad07[_0xca82('0x140')]=moment()[_0xca82('0x5a')](_0xca82('0x141'));var _0x22fad6=_0x22fa29['campaignsPreview'][_0x3eefe1[_0xca82('0x76')]];if(ut[_0xca82('0x142')](_0x50a0b5[_0xca82('0x143')])){if(_0x3eefe1[_0xca82('0xb0')]){rpcDb[_0xca82('0x144')](_0x3eefe1[_0xca82('0x10c')]);}if(_0x3eefe1['activeContact']){rpcDb[_0xca82('0x8e')](_0x3eefe1[_0xca82('0x10c')]);}ami[_0xca82('0x25')]('custom:agentringnoanswer',ut[_0xca82('0xa7')](_0x3eefe1,'rejected',this[_0xca82('0x14')][_0x3eefe1[_0xca82('0x76')]]));this[_0xca82('0xf6')](_0x17ad07,_0x22fad6,_0x50a0b5);}else{_0x3eefe1['starttime']=moment()[_0xca82('0x5a')](_0xca82('0x141'));ut['logAgent'](_0x17ad07,0x4,_0xca82('0xbd'));rpcDb['createAgentHistory'](_0x17ad07,_0xca82('0x145'));}}};Preview['prototype']['syncHangup']=function(_0x42981c){var _0x3ce15e=this;var _0x4c6cee=this[_0xca82('0x17')][_0x42981c[_0xca82('0xc2')]];var _0x1feb69;if(_0x4c6cee){_0x1feb69=this[_0xca82('0x14')][_0x4c6cee[_0xca82('0x76')]];logger[_0xca82('0x5d')](_0xca82('0x146'),_0x42981c[_0xca82('0xc2')],_0xca82('0xf4'),_0x1feb69[_0xca82('0x28')],_0xca82('0x77'),_0x1feb69[_0xca82('0x2b')]);}if(this['actions'][_0x42981c[_0xca82('0xc2')]]&&_0x42981c[_0xca82('0xc2')]!==_0x42981c[_0xca82('0xb4')]){if(_0x42981c[_0xca82('0x147')]==='16'&&this['actions'][_0x42981c['linkedid']][_0xca82('0x81')]){this['callProgressDetectingCustomer'](_0x42981c,_0x42981c[_0xca82('0xc2')],_0x42981c[_0xca82('0x147')]);}else if(this[_0xca82('0x17')][_0x42981c['linkedid']]['dialAnswer']){logger[_0xca82('0x5d')](_0xca82('0x148'),_0x42981c[_0xca82('0xc2')],_0x42981c['cause'],_0xca82('0xf4'),_0x1feb69[_0xca82('0x28')],_0xca82('0x77'),_0x1feb69[_0xca82('0x2b')]);this[_0xca82('0xa1')](_0x42981c,_0x42981c[_0xca82('0xc2')],_0x42981c[_0xca82('0x147')]);}}else if(_0x4c6cee&&_[_0xca82('0x72')](_0x4c6cee[_0xca82('0x149')])&&_0x1feb69[_0xca82('0x14a')]&&_0x42981c[_0xca82('0xc2')]===_0x42981c[_0xca82('0xb4')]&&_[_0xca82('0x72')](_0x42981c[_0xca82('0xf9')])&&_0x42981c[_0xca82('0x147')]==='16'&&_0x42981c['channelstate']==='6'&&_[_0xca82('0xf7')](_0x4c6cee[_0xca82('0x14b')])){if(_0x4c6cee[_0xca82('0xb0')]){rpcDb[_0xca82('0x144')](_0x4c6cee[_0xca82('0x10c')]);}if(_0x4c6cee[_0xca82('0xb1')]){rpcDb[_0xca82('0x8e')](_0x4c6cee[_0xca82('0x10c')]);}_0x42981c[_0xca82('0xf9')]='22';this[_0xca82('0xf6')](_0x4c6cee,_0x1feb69,_0x42981c);}else if(_0x4c6cee&&_0x4c6cee[_0xca82('0x14b')]){if(_0x42981c['cause']==='16'&&this['actions'][_0x42981c[_0xca82('0xc2')]][_0xca82('0x81')]){logger[_0xca82('0x5d')](_0xca82('0x14c'),_0x42981c[_0xca82('0xc2')],_0x42981c[_0xca82('0x147')],_0xca82('0xf4'),_0x1feb69[_0xca82('0x28')],_0xca82('0x77'),_0x1feb69['pTalking']);this[_0xca82('0xa1')](_0x42981c,_0x42981c[_0xca82('0xc2')],_0x42981c['cause']);}else if(this['actions'][_0x42981c['linkedid']][_0xca82('0x81')]){logger[_0xca82('0x5d')](_0xca82('0x148'),_0x42981c[_0xca82('0xc2')],_0x42981c[_0xca82('0x147')],_0xca82('0xf4'),_0x1feb69[_0xca82('0x28')],'pTalking:\x20',_0x1feb69[_0xca82('0x2b')]);this[_0xca82('0xa1')](_0x42981c,_0x42981c[_0xca82('0xc2')],_0x42981c[_0xca82('0x147')]);}}};Preview[_0xca82('0x10')][_0xca82('0x1e')]=function(_0x2f2d4c){if(this[_0xca82('0x17')][_0x2f2d4c[_0xca82('0xf5')]]&&_0x2f2d4c[_0xca82('0xf5')]!==_0x2f2d4c['destuniqueid']){this[_0xca82('0xa1')](_0x2f2d4c,_0x2f2d4c['destlinkedid'],_0x2f2d4c['dialstatus']);}};Preview[_0xca82('0x10')][_0xca82('0x14d')]=function(_0x1bf236){if(this[_0xca82('0x17')][_0x1bf236['linkedid']]&&_0x1bf236[_0xca82('0xc2')]!==_0x1bf236[_0xca82('0xb4')]&&!this[_0xca82('0x17')][_0x1bf236[_0xca82('0xc2')]][_0xca82('0x81')]){if(_0x1bf236[_0xca82('0x147')]==='1'){this[_0xca82('0xa1')](_0x1bf236,_0x1bf236[_0xca82('0xc2')],_0x1bf236[_0xca82('0x147')]);}}};Preview[_0xca82('0x10')][_0xca82('0x14e')]=function(_0x75b288,_0x596791,_0x42ef06){if(this['actions'][_0x75b288]){if(_['isNil'](this[_0xca82('0x17')][_0x75b288][_0xca82('0x14f')])){this[_0xca82('0x17')][_0x75b288][_0xca82('0x14f')]={};}this[_0xca82('0x17')][_0x75b288][_0xca82('0x14f')][_0x596791]=_0x42ef06;}};Preview[_0xca82('0x10')][_0xca82('0x20')]=function(_0x566aa4){try{if(!_['isNil'](_0x566aa4)){if(ut[_0xca82('0x150')](_[_0xca82('0x151')](_0x566aa4[_0xca82('0x152')])[0x0])){this[_0xca82('0x14e')](_0x566aa4[_0xca82('0xb4')],_[_0xca82('0x151')](_0x566aa4[_0xca82('0x152')])[0x0],_0x566aa4[_0xca82('0x153')]);}}}catch(_0x4f6859){logger[_0xca82('0x154')](_0xca82('0x155'),util['inspect'](_0x4f6859,{'showHidden':![],'depth':null}));}};Preview[_0xca82('0x10')][_0xca82('0x22')]=function(_0x17b9da){if(_0x17b9da){if(this[_0xca82('0x17')][_0x17b9da[_0xca82('0x156')]]){this[_0xca82('0x17')][_0x17b9da[_0xca82('0x156')]][_0xca82('0x14b')]=!![];}}};Preview[_0xca82('0x10')]['syncBlindTransfer']=function(_0x301fb4){if(_0x301fb4){if(this['actions'][_0x301fb4['transfererlinkedid']]){this[_0xca82('0x17')][_0x301fb4[_0xca82('0x157')]][_0xca82('0x14b')]=!![];}}};module[_0xca82('0x158')]=Preview;
\ No newline at end of file
+var _0xf5a7=['cause','statedesc','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','destuniqueid','addVariable','variables','keys','variable','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','uuid','moment','md5','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','hangup','syncHangup','bind','syncHangupRequest','dialend','syncDialEnd','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','campaignsPreview','emit','type','outbound','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','stringify','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','syncCampaigns','booked','clearZombieChannels','hasOwnProperty','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','actions','originated:\x20','queue','pTalking:\x20','pick','contactId','VoiceQueueId','ListId','Action','channel','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','catch','disableContact','starttime','format','logCustomer','RecallInQueue','rescheduleContactInQueue','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','linkedid','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','createCustomerFinal','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','\x20Queue','BUSY','countbusyretry','Busy','busy','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','activeContact','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','countcongestionretry','CANCEL','countagentrejectretry','custom:agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','countabandonedretry','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','dialAnswer','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','uniqueid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','createAgentHistory','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','status','unmonitored','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','SIP/%s/%s%s','dialCutDigit','substring','trim','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','addVariables','merge','toLowerVariables','variablesAction','channelAgent','user:%s','user:agentconnect','calleridnum','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','unlockContact','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]'];(function(_0x4271a3,_0x3cc57d){var _0x580b0b=function(_0x251db7){while(--_0x251db7){_0x4271a3['push'](_0x4271a3['shift']());}};_0x580b0b(++_0x3cc57d);}(_0xf5a7,0x163));var _0x7f5a=function(_0x562a21,_0x3abdf0){_0x562a21=_0x562a21-0x0;var _0x6175eb=_0xf5a7[_0x562a21];return _0x6175eb;};'use strict';var util=require(_0x7f5a('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x7f5a('0x1'));var moment=require(_0x7f5a('0x2'));var md5=require(_0x7f5a('0x3'));var Redis=require(_0x7f5a('0x4'));var config=require(_0x7f5a('0x5'));var logger=require('../../../config/logger')(_0x7f5a('0x6'));var loggerAction=require(_0x7f5a('0x7'))(_0x7f5a('0x8'));var ami=require(_0x7f5a('0x9'));var rpcDb=require(_0x7f5a('0xa'));var Action=require(_0x7f5a('0xb'));var ut=require(_0x7f5a('0xc'));config[_0x7f5a('0xd')]=_[_0x7f5a('0xe')](config['redis'],{'host':_0x7f5a('0xf'),'port':0x18eb});var io=require(_0x7f5a('0x10'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x7f5a('0x11')][_0x7f5a('0x12')]=function(_0x10571a){this[_0x7f5a('0x13')]=this[_0x7f5a('0x13')]?this['tail'][_0x7f5a('0x14')](_0x10571a):_0x10571a();};function Preview(_0x3b95cc){this[_0x7f5a('0x15')]=new Sequence();this['campaignsPreview']=_0x3b95cc[_0x7f5a('0x16')];this[_0x7f5a('0x17')]=_0x3b95cc[_0x7f5a('0x17')];this['actions']={};this[_0x7f5a('0x18')]=_0x3b95cc[_0x7f5a('0x18')];this[_0x7f5a('0x19')]=0x0;ami['on'](_0x7f5a('0x1a'),this['syncOriginateResponse']['bind'](this));ami['on'](_0x7f5a('0x1b'),this[_0x7f5a('0x1c')][_0x7f5a('0x1d')](this));ami['on']('hanguprequest',this[_0x7f5a('0x1e')][_0x7f5a('0x1d')](this));ami['on'](_0x7f5a('0x1f'),this[_0x7f5a('0x20')][_0x7f5a('0x1d')](this));ami['on']('newexten',this['syncNewExten'][_0x7f5a('0x1d')](this));ami['on'](_0x7f5a('0x21'),this[_0x7f5a('0x22')][_0x7f5a('0x1d')](this));ami['on'](_0x7f5a('0x23'),this[_0x7f5a('0x24')][_0x7f5a('0x1d')](this));ami['on'](_0x7f5a('0x25'),this['syncBlindTransfer'][_0x7f5a('0x1d')](this));this[_0x7f5a('0x26')](this[_0x7f5a('0x27')]);}function emit(_0x56da6b,_0x18dd1b,_0x43e320){io['to'](_0x56da6b)[_0x7f5a('0x28')](_0x18dd1b,_0x43e320);}function emitCampaignPreview(_0x5bce75){if(_0x5bce75[_0x7f5a('0x29')]===_0x7f5a('0x2a')){var _0x4302fe={'id':_0x5bce75['id'],'name':_0x5bce75['name'],'strategy':_0x5bce75['strategy'],'answered':_0x5bce75[_0x7f5a('0x2b')],'available':_0x5bce75[_0x7f5a('0x2c')],'loggedIn':_0x5bce75[_0x7f5a('0x2d')],'pTalking':_0x5bce75[_0x7f5a('0x2e')],'sumBillable':_0x5bce75['sumBillable'],'sumDuration':_0x5bce75[_0x7f5a('0x2f')],'sumHoldTime':_0x5bce75[_0x7f5a('0x30')]||0x0,'talking':_0x5bce75['talking'],'total':_0x5bce75[_0x7f5a('0x31')],'type':_0x5bce75[_0x7f5a('0x29')],'unmanaged':_0x5bce75['unmanaged'],'abandoned':_0x5bce75[_0x7f5a('0x32')],'waiting':_0x5bce75[_0x7f5a('0x33')],'loggedInDb':_0x5bce75[_0x7f5a('0x34')],'dialActive':_0x5bce75[_0x7f5a('0x35')],'dialMethod':_0x5bce75[_0x7f5a('0x36')],'dialOriginateCallerIdName':_0x5bce75['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5bce75[_0x7f5a('0x37')],'dialOriginateTimeout':_0x5bce75[_0x7f5a('0x38')],'dialPrefix':_0x5bce75[_0x7f5a('0x39')],'outboundAnswerAgiCallsDay':_0x5bce75[_0x7f5a('0x3a')],'outboundAnswerCallsDay':_0x5bce75[_0x7f5a('0x3b')],'outboundBlacklistCallsDay':_0x5bce75['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x5bce75[_0x7f5a('0x3c')],'outboundCongestionCallsDay':_0x5bce75['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x5bce75[_0x7f5a('0x3d')],'outboundDropCallsDayCallersExit':_0x5bce75[_0x7f5a('0x3e')],'outboundDropCallsDayTimeout':_0x5bce75[_0x7f5a('0x3f')],'outboundNoAnswerCallsDay':_0x5bce75[_0x7f5a('0x40')],'outboundNoSuchCallsDay':_0x5bce75[_0x7f5a('0x41')],'outboundOriginateFailureCallsDay':_0x5bce75[_0x7f5a('0x42')],'outboundReCallsDay':_0x5bce75[_0x7f5a('0x43')],'outboundRejectCallsDay':_0x5bce75[_0x7f5a('0x44')],'outboundUnknownCallsDay':_0x5bce75[_0x7f5a('0x45')],'outboundAbandonedCallsDay':_0x5bce75['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x5bce75[_0x7f5a('0x46')],'predictiveIntervalAvgHoldtime':_0x5bce75[_0x7f5a('0x47')],'predictiveIntervalAvgTalktime':_0x5bce75[_0x7f5a('0x48')],'predictiveIntervalDroppedCallsCallersExit':_0x5bce75['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x5bce75[_0x7f5a('0x49')],'predictiveIntervalErlangCalls':_0x5bce75[_0x7f5a('0x4a')],'predictiveIntervalErlangCallsDroppedCalls':_0x5bce75[_0x7f5a('0x4b')],'predictiveIntervalHitRate':_0x5bce75[_0x7f5a('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x5bce75[_0x7f5a('0x4d')],'predictiveIntervalPauses':_0x5bce75[_0x7f5a('0x4e')],'predictiveIntervalAvailable':_0x5bce75[_0x7f5a('0x4f')],'predictiveIntervalTotalCalls':_0x5bce75['predictiveIntervalTotalCalls'],'message':_0x5bce75[_0x7f5a('0x50')],'originated':_0x5bce75[_0x7f5a('0x51')],'erlangCalls':_0x5bce75['erlangCalls'],'erlangCallToSecond':_0x5bce75['erlangCallToSecond'],'erlangAbandonmentRate':_0x5bce75[_0x7f5a('0x52')],'erlangBusyFactor':_0x5bce75[_0x7f5a('0x53')],'startPredictive':_0x5bce75[_0x7f5a('0x54')],'startProgressive':_0x5bce75[_0x7f5a('0x55')]};if(_0x5bce75[_0x7f5a('0x56')]){_0x4302fe['Trunk']={'id':_0x5bce75[_0x7f5a('0x56')]['id'],'name':_0x5bce75[_0x7f5a('0x56')][_0x7f5a('0x57')],'active':_0x5bce75['Trunk'][_0x7f5a('0x58')],'callerid':_0x5bce75[_0x7f5a('0x56')][_0x7f5a('0x59')]};}if(_0x5bce75[_0x7f5a('0x5a')]){_0x4302fe[_0x7f5a('0x5a')]={'id':_0x5bce75[_0x7f5a('0x5a')]['id'],'name':_0x5bce75[_0x7f5a('0x5a')][_0x7f5a('0x57')]};}var _0x124109=md5(JSON[_0x7f5a('0x5b')](_0x4302fe));if(_0x5bce75['md5']!==_0x124109){_0x5bce75[_0x7f5a('0x3')]=_0x124109;emit(util['format']('voice:queue:%s',_0x4302fe[_0x7f5a('0x57')]),_0x7f5a('0x5c'),_0x4302fe);}}}function emitVoiceQueueChannelRemove(_0x31563a){logger[_0x7f5a('0x5d')](_0x7f5a('0x5e'),JSON[_0x7f5a('0x5b')](_0x31563a));emit(util['format'](_0x7f5a('0x5f'),_0x31563a[_0x7f5a('0x57')]),_0x7f5a('0x60'),_0x31563a);io[_0x7f5a('0x28')](_0x7f5a('0x61'),_0x31563a);}function notSendMessagesQueue(_0x1507ff){if(_0x1507ff[_0x7f5a('0x62')]){if(_0x1507ff[_0x7f5a('0x51')]===0x0&&_0x1507ff['pTalking']===0x0){_0x1507ff[_0x7f5a('0x62')]=![];_0x1507ff[_0x7f5a('0x2c')]=0x0;_0x1507ff[_0x7f5a('0x63')]=0x0;_0x1507ff[_0x7f5a('0x50')]=_0x7f5a('0x64');ut[_0x7f5a('0x65')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x1507ff[_0x7f5a('0x57')]+_0x7f5a('0x66'));}else{_0x1507ff[_0x7f5a('0x50')]=_0x7f5a('0x67');ut[_0x7f5a('0x65')](_0x7f5a('0x68'),_0x1507ff[_0x7f5a('0x57')]+'\x20is\x20disactive');}emitCampaignPreview(_0x1507ff);}}Preview[_0x7f5a('0x11')][_0x7f5a('0x26')]=function(){var _0x4ed8cb=this;setInterval(function(){_0x4ed8cb[_0x7f5a('0x69')]();},0x7cf);};Preview[_0x7f5a('0x11')][_0x7f5a('0x69')]=function(){var _0x2d0a9b=this[_0x7f5a('0x27')];this[_0x7f5a('0x19')]+=0x1;for(var _0x127099 in _0x2d0a9b){if(_0x2d0a9b['hasOwnProperty'](_0x127099)&&(_0x2d0a9b[_0x127099]['dialMethod']===_0x7f5a('0x6')||_0x2d0a9b[_0x127099][_0x7f5a('0x36')]===_0x7f5a('0x6a'))&&_0x2d0a9b[_0x127099][_0x7f5a('0x29')]==='outbound'){if(this[_0x7f5a('0x19')]>0x7){this[_0x7f5a('0x19')]=0x0;this[_0x7f5a('0x6b')]();}}if(_0x2d0a9b[_0x7f5a('0x6c')](_0x127099)&&_0x2d0a9b[_0x127099][_0x7f5a('0x36')]===_0x7f5a('0x6')&&_0x2d0a9b[_0x127099][_0x7f5a('0x29')]===_0x7f5a('0x2a')){if(_0x2d0a9b[_0x127099]['dialActive']){this[_0x7f5a('0x6d')](_0x2d0a9b[_0x127099]);this[_0x7f5a('0x6e')](_0x2d0a9b[_0x127099]);}else{notSendMessagesQueue(_0x2d0a9b[_0x127099]);}}}};Preview[_0x7f5a('0x11')][_0x7f5a('0x6f')]=function(_0x4b1b24){var _0x4589c0=this;this[_0x7f5a('0x15')][_0x7f5a('0x12')](function(){if(!_[_0x7f5a('0x70')](_0x4589c0['actions'][_0x4b1b24])){loggerAction[_0x7f5a('0x5d')](_0x7f5a('0x71'),_0x4b1b24,_0x7f5a('0x72'),_0x4589c0[_0x7f5a('0x73')][_0x4b1b24]['queue'],_0x7f5a('0x74'),JSON[_0x7f5a('0x5b')](_0x4589c0[_0x7f5a('0x27')][_0x4589c0['actions'][_0x4b1b24][_0x7f5a('0x75')]]['originated']),_0x7f5a('0x76'),JSON['stringify'](_0x4589c0[_0x7f5a('0x27')][_0x4589c0[_0x7f5a('0x73')][_0x4b1b24]['queue']][_0x7f5a('0x2e')]),JSON['stringify'](_0x4589c0[_0x7f5a('0x73')][_0x4b1b24]['dialAnswer']),JSON[_0x7f5a('0x5b')](_[_0x7f5a('0x77')](_0x4589c0[_0x7f5a('0x73')][_0x4b1b24],[_0x7f5a('0x78'),'UserId',_0x7f5a('0x79'),_0x7f5a('0x7a')])));return ami[_0x7f5a('0x7b')]({'action':'status','channel':_0x4589c0['actions'][_0x4b1b24][_0x7f5a('0x7c')]})['catch'](function(_0x59e6be){if(_0x59e6be[_0x7f5a('0x50')]===_0x7f5a('0x7d')){setTimeout(function(){if(_0x4589c0['actions'][_0x4b1b24]){ut[_0x7f5a('0x7e')](_0x4589c0[_0x7f5a('0x27')][_0x4589c0['actions'][_0x4b1b24][_0x7f5a('0x75')]],'[clearZombieChannel]');if(_0x4589c0['actions'][_0x4b1b24]['dialAnswer']===!![]){ut[_0x7f5a('0x7f')](_0x4589c0[_0x7f5a('0x27')][_0x4589c0[_0x7f5a('0x73')][_0x4b1b24][_0x7f5a('0x75')]],_0x7f5a('0x80'));ut['loggerError'](_0x7f5a('0x81')+_0x4b1b24,_0x4589c0[_0x7f5a('0x73')][_0x4b1b24][_0x7f5a('0x75')]);}ut[_0x7f5a('0x82')](_0x7f5a('0x83')+_0x4b1b24,_0x4589c0['actions'][_0x4b1b24]['queue']);delete _0x4589c0['actions'][_0x4b1b24];}},0x2328);}});}});};Preview[_0x7f5a('0x11')][_0x7f5a('0x6b')]=function(){var _0x278881=this;loggerAction[_0x7f5a('0x5d')]('[action]',_[_0x7f5a('0x84')](this[_0x7f5a('0x73')]));for(var _0x79d5eb in this[_0x7f5a('0x73')]){if(_0x278881[_0x7f5a('0x73')][_0x7f5a('0x6c')](_0x79d5eb)){_0x278881[_0x7f5a('0x6f')](_0x79d5eb);}}};Preview[_0x7f5a('0x11')]['recallMe']=function(_0x35b04a){var _0x22dbf4=this;rpcDb[_0x7f5a('0x85')](_0x35b04a['id'],ut['agentReadyId'](this[_0x7f5a('0x18')]))[_0x7f5a('0x86')](function(_0x55926d){if(!_['isNil'](_0x55926d)){for(var _0x115ad5=0x0;_0x115ad5<_0x55926d[_0x7f5a('0x87')];_0x115ad5+=0x1){if(ut[_0x7f5a('0x88')](_0x55926d[_0x115ad5][_0x7f5a('0x89')])<_0x35b04a['dialRecallMeTimeout']*0x3c){if(_0x55926d[_0x115ad5][_0x7f5a('0x8a')]&&!_0x55926d[_0x115ad5][_0x7f5a('0x8a')][_0x7f5a('0x8b')]){_0x22dbf4[_0x7f5a('0x8c')](_0x55926d[_0x115ad5]['id'])[_0x7f5a('0x86')](ut[_0x7f5a('0x8d')](_0x7f5a('0x8e')))[_0x7f5a('0x8f')](ut[_0x7f5a('0x8d')](_0x7f5a('0x8e')));}else{rpcDb[_0x7f5a('0x90')](_0x55926d[_0x115ad5]['id']);}}else{var _0x10ff9f=new Action(_0x55926d[_0x115ad5],_0x35b04a);_0x10ff9f[_0x7f5a('0x91')]=moment()[_0x7f5a('0x92')]('YYYY-MM-DD\x20HH:mm:ss');_0x35b04a[_0x7f5a('0x43')]+=0x1;ut[_0x7f5a('0x93')](_0x10ff9f,0x17,_0x7f5a('0x94'));if(_0x35b04a['dialRecallInQueue']){rpcDb[_0x7f5a('0x95')](ut['createBody'](_0x55926d[_0x115ad5]));rpcDb[_0x7f5a('0x96')](_0x10ff9f,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x10ff9f,0x16,_0x7f5a('0x97'));rpcDb['createCustomerHistory'](_0x10ff9f,_0x7f5a('0x98'));rpcDb['createCustomerFinal'](_0x10ff9f,_0x7f5a('0x98'));}}}}})[_0x7f5a('0x8f')](ut[_0x7f5a('0x8d')](_0x7f5a('0x99')));};Preview[_0x7f5a('0x11')]['setMessage']=function(_0x29f5b8){_0x29f5b8[_0x7f5a('0x62')]=!![];if(ut[_0x7f5a('0x9a')](_0x29f5b8[_0x7f5a('0x2d')])){_0x29f5b8[_0x7f5a('0x50')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x29f5b8['dialActive'])){_0x29f5b8[_0x7f5a('0x50')]=_0x7f5a('0x64');}else if(!this[_0x7f5a('0x9b')](_0x29f5b8['Trunk'])){if(!this[_0x7f5a('0x9b')](_0x29f5b8[_0x7f5a('0x9c')])){_0x29f5b8[_0x7f5a('0x50')]='TRUNK_IS_NOT_REACHABLE';}else{_0x29f5b8['message']=_0x7f5a('0x9d');}}else{_0x29f5b8['message']='ACTIVE';}emitCampaignPreview(_0x29f5b8);};Preview['prototype'][_0x7f5a('0x9e')]=function(_0x1005d4,_0x22d8e,_0xc0ef43){var _0x383d28=this;var _0x19846f=this[_0x7f5a('0x73')][_0x22d8e];var _0x3f0e41=this[_0x7f5a('0x27')][_0x19846f[_0x7f5a('0x75')]];var _0x326493;if(_0x3f0e41){switch(_0xc0ef43){case'1':_0x3f0e41[_0x7f5a('0x41')]+=0x1;_0x19846f[_0x7f5a('0x9f')]+=0x1;_0x19846f[_0x7f5a('0xa0')]=ut[_0x7f5a('0xa1')](_0x19846f);ut[_0x7f5a('0x93')](_0x19846f,0x0,_0x7f5a('0xa2'));ami['emit']('custom:agentnosuchnumber',ut[_0x7f5a('0xa3')](_0x19846f,_0x7f5a('0xa4')));rpcDb['createCustomerHistory'](_0x19846f,_0x7f5a('0xa5'));if(ut[_0x7f5a('0xa1')](_0x19846f)>=_0x3f0e41[_0x7f5a('0xa6')]){_0x326493=ut['cloneAction'](_0x19846f,0xf,_0x7f5a('0xa7'));rpcDb['createCustomerFinal'](_0x326493,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x19846f[_0x7f5a('0x9f')]>=_0x3f0e41[_0x7f5a('0xa8')]){rpcDb['createCustomerFinal'](_0x19846f,_0x7f5a('0xa9'));}else{rpcDb[_0x7f5a('0xaa')](ut[_0x7f5a('0xab')](_0x19846f,'countnosuchnumberretry',_0x3f0e41[_0x7f5a('0xac')]),_0x19846f['unlockAgent'],_0x19846f['activeContact']);}}delete this[_0x7f5a('0x73')][_0x1005d4[_0x7f5a('0xad')]];break;case'ANSWER':var _0x59687c=moment()[_0x7f5a('0x92')](_0x7f5a('0xae'));_0x19846f[_0x7f5a('0xaf')]=_0x59687c;_0x19846f[_0x7f5a('0xb0')]=_0x59687c;_0x19846f['dialAnswer']=!![];_0x3f0e41[_0x7f5a('0x2e')]+=0x1;logger['info'](_0x7f5a('0xb1'),_0x19846f['uniqueid'],'\x20Queue',_0x3f0e41[_0x7f5a('0x57')],_0x7f5a('0x76'),_0x3f0e41[_0x7f5a('0x2e')]);ami[_0x7f5a('0x28')](_0x7f5a('0xb2'),ut[_0x7f5a('0xa3')](_0x19846f,_0x7f5a('0xb3'),this[_0x7f5a('0x27')][_0x19846f['queue']]));if(_0x3f0e41[_0x7f5a('0xb4')]){ami['emit'](_0x7f5a('0xb5'),ut['buildAcw'](_0x19846f));}break;case'16':ami[_0x7f5a('0x28')](_0x7f5a('0xb6'),ut[_0x7f5a('0xa3')](_0x19846f,_0x7f5a('0xb7'),this[_0x7f5a('0x27')][_0x19846f[_0x7f5a('0x75')]]));emitVoiceQueueChannelRemove(ut[_0x7f5a('0xa3')](_0x19846f,_0x7f5a('0xb7')));_0x3f0e41[_0x7f5a('0x3b')]+=0x1;_0x3f0e41['total']+=0x1;_0x3f0e41[_0x7f5a('0x2b')]+=0x1;ut[_0x7f5a('0x7f')](_0x3f0e41,_0x7f5a('0xb8'));_0x19846f[_0x7f5a('0xa0')]=ut['totalGlobal'](_0x19846f);ut['logCustomer'](_0x19846f,0x4,_0x7f5a('0xb9'));rpcDb[_0x7f5a('0x96')](_0x19846f,_0x7f5a('0xba'));rpcDb[_0x7f5a('0xbb')](_0x19846f,_0x7f5a('0xbc'));rpcDb[_0x7f5a('0xbd')](_0x19846f);_0x3f0e41[_0x7f5a('0x2f')]+=_0x19846f[_0x7f5a('0xbe')];_0x3f0e41[_0x7f5a('0xbf')]+=_0x19846f[_0x7f5a('0xbe')];logger[_0x7f5a('0x5d')]('[syncHangup][talking][decrement]',_0x19846f['uniqueid'],_0x7f5a('0xc0'),_0x3f0e41['name'],_0x7f5a('0x76'),_0x3f0e41[_0x7f5a('0x2e')]);delete this[_0x7f5a('0x73')][_0x1005d4[_0x7f5a('0xad')]];break;case _0x7f5a('0xc1'):_0x3f0e41['outboundBusyCallsDay']+=0x1;_0x19846f[_0x7f5a('0xc2')]+=0x1;_0x19846f['countglobal']=ut[_0x7f5a('0xa1')](_0x19846f);ut['logCustomer'](_0x19846f,0x5,_0x7f5a('0xc3'));ami['emit']('custom:agentbusy',ut[_0x7f5a('0xa3')](_0x19846f,_0x7f5a('0xc4')));rpcDb[_0x7f5a('0x96')](_0x19846f,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x7f5a('0xa1')](_0x19846f)>=_0x3f0e41[_0x7f5a('0xa6')]){_0x326493=ut[_0x7f5a('0xc5')](_0x19846f,0xf,_0x7f5a('0xa7'));rpcDb[_0x7f5a('0xbb')](_0x326493,_0x7f5a('0xc6'));}else{if(_0x19846f[_0x7f5a('0xc2')]>=_0x3f0e41[_0x7f5a('0xc7')]){rpcDb['createCustomerFinal'](_0x19846f,_0x7f5a('0xc8'));}else{rpcDb[_0x7f5a('0xaa')](ut[_0x7f5a('0xab')](_0x19846f,_0x7f5a('0xc2'),_0x3f0e41[_0x7f5a('0xc9')]),_0x19846f[_0x7f5a('0xca')],_0x19846f['activeContact']);}}break;case _0x7f5a('0xcb'):_0x3f0e41[_0x7f5a('0x40')]+=0x1;_0x19846f[_0x7f5a('0xcc')]+=0x1;_0x19846f[_0x7f5a('0xa0')]=ut[_0x7f5a('0xa1')](_0x19846f);ut[_0x7f5a('0x93')](_0x19846f,0x3,_0x7f5a('0xcd'));ami[_0x7f5a('0x28')](_0x7f5a('0xce'),ut[_0x7f5a('0xa3')](_0x19846f,_0x7f5a('0xcf')));rpcDb[_0x7f5a('0x96')](_0x19846f,_0x7f5a('0xd0'));if(ut[_0x7f5a('0xa1')](_0x19846f)>=_0x3f0e41['dialGlobalMaxRetry']){_0x326493=ut['cloneAction'](_0x19846f,0xf,'Global');rpcDb[_0x7f5a('0xbb')](_0x326493,_0x7f5a('0xd1'));}else{if(_0x19846f[_0x7f5a('0xcc')]>=_0x3f0e41[_0x7f5a('0xd2')]){rpcDb[_0x7f5a('0xbb')](_0x19846f,_0x7f5a('0xd0'));}else{rpcDb[_0x7f5a('0xaa')](ut[_0x7f5a('0xab')](_0x19846f,_0x7f5a('0xcc'),_0x3f0e41['dialNoAnswerRetryFrequency']),_0x19846f['unlockAgent'],_0x19846f[_0x7f5a('0xd3')]);}}break;case'CONGESTION':_0x3f0e41[_0x7f5a('0xd4')]+=0x1;_0x19846f['countcongestionretry']+=0x1;_0x19846f[_0x7f5a('0xa0')]=ut[_0x7f5a('0xa1')](_0x19846f);ut[_0x7f5a('0x93')](_0x19846f,0x8,_0x7f5a('0xd5'));ami['emit'](_0x7f5a('0xd6'),ut['buildObj'](_0x19846f,_0x7f5a('0xd7')));rpcDb[_0x7f5a('0x96')](_0x19846f,_0x7f5a('0xd8'));if(ut[_0x7f5a('0xa1')](_0x19846f)>=_0x3f0e41[_0x7f5a('0xa6')]){_0x326493=ut[_0x7f5a('0xc5')](_0x19846f,0xf,_0x7f5a('0xa7'));rpcDb['createCustomerFinal'](_0x326493,_0x7f5a('0xd9'));}else{if(_0x19846f['countcongestionretry']>=_0x3f0e41[_0x7f5a('0xda')]){rpcDb[_0x7f5a('0xbb')](_0x19846f,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x7f5a('0xaa')](ut['scheduledAt'](_0x19846f,_0x7f5a('0xdb'),_0x3f0e41['dialBusyRetryFrequency']),_0x19846f[_0x7f5a('0xca')],_0x19846f[_0x7f5a('0xd3')]);}}break;case _0x7f5a('0xdc'):_0x3f0e41[_0x7f5a('0x44')]+=0x1;_0x19846f[_0x7f5a('0xdd')]+=0x1;_0x19846f[_0x7f5a('0xa0')]=ut[_0x7f5a('0xa1')](_0x19846f);ut[_0x7f5a('0x93')](_0x19846f,0x14,'AgentReject');ami['emit'](_0x7f5a('0xde'),ut[_0x7f5a('0xa3')](_0x19846f,'agentreject'));rpcDb[_0x7f5a('0x96')](_0x19846f,_0x7f5a('0xdf'));if(ut[_0x7f5a('0xa1')](_0x19846f)>=_0x3f0e41[_0x7f5a('0xa6')]){_0x326493=ut[_0x7f5a('0xc5')](_0x19846f,0x14,_0x7f5a('0xe0'));rpcDb[_0x7f5a('0xbb')](_0x326493,_0x7f5a('0xe1'));}else{if(_0x19846f['countagentrejectretry']>=_0x3f0e41['dialAgentRejectMaxRetry']){rpcDb[_0x7f5a('0xbb')](_0x19846f,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x7f5a('0xaa')](ut['scheduledAt'](_0x19846f,_0x7f5a('0xdd'),_0x3f0e41['dialAgentRejectRetryFrequency']),_0x19846f[_0x7f5a('0xca')],_0x19846f[_0x7f5a('0xd3')]);}}break;case _0x7f5a('0xe2'):_0x3f0e41[_0x7f5a('0xe3')]+=0x1;_0x19846f['countabandonedretry']+=0x1;_0x19846f[_0x7f5a('0xa0')]=ut[_0x7f5a('0xa1')](_0x19846f);ut[_0x7f5a('0x93')](_0x19846f,0xb,_0x7f5a('0xe4'));rpcDb[_0x7f5a('0x96')](_0x19846f,_0x7f5a('0xe5'));if(ut[_0x7f5a('0xa1')](_0x19846f)>=_0x3f0e41[_0x7f5a('0xa6')]){_0x326493=ut[_0x7f5a('0xc5')](_0x19846f,0xf,'Global');rpcDb['createCustomerFinal'](_0x326493,_0x7f5a('0xe5'));}else{if(_0x19846f[_0x7f5a('0xe6')]>=_0x3f0e41['dialAbandonedMaxRety']){rpcDb[_0x7f5a('0xbb')](_0x19846f,_0x7f5a('0xe5'));}else{rpcDb['rescheduleContact'](ut[_0x7f5a('0xab')](_0x19846f,_0x7f5a('0xe7'),_0x3f0e41['dialAbandonedRetryFrequency']),_0x19846f[_0x7f5a('0xca')],_0x19846f[_0x7f5a('0xd3')]);}}break;case'18':_0x3f0e41['outboundUnknownCallsDay']+=0x1;_0x19846f[_0x7f5a('0xe8')]+=0x1;_0x19846f['countglobal']=ut[_0x7f5a('0xa1')](_0x19846f);ut[_0x7f5a('0x93')](_0x19846f,0x12,_0x1005d4[_0x7f5a('0xe9')]||_0x1005d4[_0x7f5a('0xea')]);ami[_0x7f5a('0x28')](_0x7f5a('0xeb'),ut[_0x7f5a('0xa3')](_0x19846f,_0x7f5a('0xec')));rpcDb[_0x7f5a('0x96')](_0x19846f,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0x7f5a('0xa1')](_0x19846f)>=_0x3f0e41[_0x7f5a('0xa6')]){_0x326493=ut[_0x7f5a('0xc5')](_0x19846f,0xf,_0x7f5a('0xa7'));rpcDb[_0x7f5a('0xbb')](_0x326493,_0x7f5a('0xed'));}else{rpcDb['createCustomerFinal'](_0x19846f,_0x7f5a('0xed'));}delete this[_0x7f5a('0x73')][_0x1005d4[_0x7f5a('0xad')]];break;case'19':_0x3f0e41[_0x7f5a('0x45')]+=0x1;_0x19846f[_0x7f5a('0xa0')]=ut['totalGlobal'](_0x19846f);ut[_0x7f5a('0x93')](_0x19846f,0x13,_0x1005d4[_0x7f5a('0xe9')]||_0x1005d4['dialstatus']);ami['emit'](_0x7f5a('0xeb'),ut['buildObj'](_0x19846f,_0x7f5a('0xec')));rpcDb[_0x7f5a('0x96')](_0x19846f,_0x7f5a('0xee'));if(ut[_0x7f5a('0xa1')](_0x19846f)>=_0x3f0e41[_0x7f5a('0xa6')]){_0x326493=ut[_0x7f5a('0xc5')](_0x19846f,0xf,'Global');rpcDb['createCustomerFinal'](_0x326493,_0x7f5a('0xee'));}else{rpcDb[_0x7f5a('0xbb')](_0x19846f,_0x7f5a('0xee'));}delete this['actions'][_0x1005d4[_0x7f5a('0xad')]];break;default:if(_0x19846f[_0x7f5a('0xef')]){ut[_0x7f5a('0x7f')](_0x3f0e41,_0x7f5a('0xf0'));ut[_0x7f5a('0x82')](_0x7f5a('0xf1')+_0x3f0e41['name'],_0x1005d4);}_0x3f0e41[_0x7f5a('0x45')]+=0x1;_0x19846f[_0x7f5a('0xa0')]=ut[_0x7f5a('0xa1')](_0x19846f);ut[_0x7f5a('0x93')](_0x19846f,0xc,_0x1005d4[_0x7f5a('0xe9')]||_0x1005d4[_0x7f5a('0xea')]);rpcDb[_0x7f5a('0x96')](_0x19846f,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x7f5a('0xa1')](_0x19846f)>=_0x3f0e41[_0x7f5a('0xa6')]){_0x326493=ut[_0x7f5a('0xc5')](_0x19846f,0xf,_0x7f5a('0xa7'));rpcDb[_0x7f5a('0xbb')](_0x326493,_0x7f5a('0xf2'));}else{rpcDb[_0x7f5a('0xbb')](_0x19846f,_0x7f5a('0xf2'));}delete this[_0x7f5a('0x73')][_0x1005d4[_0x7f5a('0xad')]];}if(!(_0x19846f[_0x7f5a('0xef')]&&_0xc0ef43==='16')){ut['updateOriginated'](_0x3f0e41,'[callProgressDetectingCustomer]');logger[_0x7f5a('0x5d')]('[originated][decrement][callProgressDetectingCustomer]',_0x19846f[_0x7f5a('0xf3')],'\x20Queue',_0x3f0e41[_0x7f5a('0x57')],_0x7f5a('0x74'),_0x3f0e41[_0x7f5a('0x51')]);}if(_0xc0ef43!=='ANSWER'){delete this[_0x7f5a('0x73')][_0x1005d4[_0x7f5a('0xad')]];delete this[_0x7f5a('0x73')][_0x1005d4['destlinkedid']];}}};Preview[_0x7f5a('0x11')][_0x7f5a('0xf4')]=function(_0x1e7f81,_0x1d893d,_0x5668c0){if(_[_0x7f5a('0xf5')](_0x1d893d)&&'object'!==typeof _0x1d893d){return;}if(_[_0x7f5a('0xf5')](_0x5668c0)&&_0x7f5a('0xf6')!==typeof _0x5668c0){return;}switch(_0x5668c0[_0x7f5a('0xf7')]){case'0':ut[_0x7f5a('0xf8')](_0x1e7f81,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x1e7f81,_0x7f5a('0xf9'));break;case'3':ut['logAgent'](_0x1e7f81,0x3,_0x7f5a('0xcd'));rpcDb['createAgentHistory'](_0x1e7f81,_0x7f5a('0xfa'));break;case'5':ut['logAgent'](_0x1e7f81,0x5,_0x7f5a('0xc3'));rpcDb[_0x7f5a('0xfb')](_0x1e7f81,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x7f5a('0xf8')](_0x1e7f81,0x8,_0x7f5a('0xd5'));rpcDb[_0x7f5a('0xfb')](_0x1e7f81,_0x7f5a('0xfc'));break;case'22':ut[_0x7f5a('0xf8')](_0x1e7f81,0x16,_0x7f5a('0xfd'));rpcDb['createAgentHistory'](_0x1e7f81,_0x7f5a('0xfe'));break;default:ut['logAgent'](_0x1e7f81,0xc,_0x5668c0[_0x7f5a('0xf7')]);rpcDb['createAgentHistory'](_0x1e7f81,_0x7f5a('0xfc'));}ut[_0x7f5a('0x7e')](_0x1d893d,_0x7f5a('0xff'));logger[_0x7f5a('0x5d')](_0x7f5a('0x100'),_0x1e7f81['uniqueid'],_0x7f5a('0xc0'),_0x1d893d['name'],_0x7f5a('0x74'),_0x1d893d['originated']);delete this[_0x7f5a('0x73')][_0x1e7f81['uniqueid']];};Preview[_0x7f5a('0x11')][_0x7f5a('0x101')]=function(_0x159d73,_0xee4bab,_0x40bb06,_0x582cc9,_0x5ebb1f){var _0x1f60ca=this;return new BPromise(function(_0x5c7fbc,_0x4e1361){if(_[_0x7f5a('0x70')](_0xee4bab)||_[_0x7f5a('0x70')](_0xee4bab[_0x7f5a('0x102')])||_[_0x7f5a('0x70')](_0xee4bab[_0x7f5a('0x102')][_0x7f5a('0x103')])||_[_0x7f5a('0x70')](_0xee4bab['VoiceQueueId'])){_0x4e1361(ut[_0x7f5a('0x50')]('Contact\x20is\x20undefined',_0x582cc9,_0x5ebb1f));return;}var _0x3f0017=uuid['v4']();var _0x34a5c=_0x1f60ca['campaignsPreview'][_0xee4bab[_0x7f5a('0x72')][_0x7f5a('0x57')]];var _0x34d24e=_0x40bb06?_0x1f60ca[_0x7f5a('0x18')][_0x40bb06]['id']:undefined;_0x1f60ca[_0x7f5a('0x73')][_0x3f0017]=new Action(_0xee4bab,_0x34a5c,_0x3f0017,_0x40bb06,_0x34d24e);var _0x18506d=_0x1f60ca[_0x7f5a('0x73')][_0x3f0017];_0x18506d['unlockAgent']=_0x582cc9;_0x18506d[_0x7f5a('0xd3')]=_0x5ebb1f;_0x18506d[_0x7f5a('0x104')]=_0x40bb06;if(_[_0x7f5a('0x105')](_0x159d73)){_0x1f60ca[_0x7f5a('0x106')](_0x18506d,_0x34a5c,_0xee4bab,_0x40bb06)[_0x7f5a('0x86')](function(_0x35592c){logger[_0x7f5a('0x5d')](_0x7f5a('0x107'),_0x7f5a('0x108')+_0x18506d[_0x7f5a('0x75')]+_0x7f5a('0x109')+_0x18506d[_0x7f5a('0x10a')],JSON[_0x7f5a('0x5b')](_0x35592c));ami[_0x7f5a('0x28')](_0x7f5a('0x10b'),ut[_0x7f5a('0xa3')](_0x18506d,_0x7f5a('0x10c'),_0x1f60ca[_0x7f5a('0x27')][_0x18506d[_0x7f5a('0x75')]]));_0x5c7fbc(ut[_0x7f5a('0x50')](_0x7f5a('0x10d')));})[_0x7f5a('0x8f')](function(_0x4742d3){ut[_0x7f5a('0x65')](_0x7f5a('0x10e'),_0x4742d3);_0x4e1361(ut[_0x7f5a('0x50')](_0x7f5a('0x10f'),_0x582cc9,_0x5ebb1f));});}else{_0x34a5c[_0x7f5a('0x110')]+=0x1;ut[_0x7f5a('0x111')](_0x18506d);rpcDb[_0x7f5a('0x112')](_0x18506d,_0x7f5a('0x113'));delete _0x1f60ca[_0x7f5a('0x73')][_0x3f0017];_0x4e1361(ut[_0x7f5a('0x50')]('Contact\x20in\x20black\x20List',_0x582cc9,_0x5ebb1f));}});};Preview[_0x7f5a('0x11')][_0x7f5a('0x9b')]=function(_0xac96ba){return!_['isNil'](_0xac96ba)&&!_[_0x7f5a('0x70')](_0xac96ba['name'])&&!_['isNil'](_0xac96ba[_0x7f5a('0x58')])&&_0xac96ba['active']&&!_['isNil'](this['trunks'][util['format'](_0x7f5a('0x114'),_0xac96ba['name'])])&&!_['isNil'](this[_0x7f5a('0x17')][util['format'](_0x7f5a('0x114'),_0xac96ba['name'])]['status'])&&(this[_0x7f5a('0x17')][util[_0x7f5a('0x92')](_0x7f5a('0x114'),_0xac96ba['name'])][_0x7f5a('0x115')]==='reachable'||this[_0x7f5a('0x17')][util['format']('SIP/%s',_0xac96ba[_0x7f5a('0x57')])][_0x7f5a('0x115')]===_0x7f5a('0x116'));};Preview[_0x7f5a('0x11')][_0x7f5a('0x8c')]=function(_0x44c2ae,_0x4b5707){var _0x26a5c7=this;return new BPromise(function(_0x4ccf39,_0x5157ab){_0x26a5c7[_0x7f5a('0x117')](_0x44c2ae,_0x4b5707)[_0x7f5a('0x86')](function(_0x185f79){_0x4ccf39(_[_0x7f5a('0x77')](_0x185f79,[_0x7f5a('0x50')]));})[_0x7f5a('0x8f')](function(_0xd29aaf){if(_0xd29aaf['unlock']){rpcDb['unlockContact'](_0x44c2ae);}if(_0xd29aaf['active']){rpcDb[_0x7f5a('0x90')](_0x44c2ae);}_0x5157ab(_[_0x7f5a('0x77')](_0xd29aaf,[_0x7f5a('0x50')]));});});};Preview['prototype'][_0x7f5a('0x117')]=function(_0x1a99c0,_0x4dc511){var _0x139335=this;return new BPromise(function(_0x392ac7,_0x3748a3){var _0x411618,_0x390148;rpcDb[_0x7f5a('0x118')](_0x1a99c0)[_0x7f5a('0x86')](function(_0x360ca3){if(!_[_0x7f5a('0x70')](_0x360ca3[0x0])){_0x390148=_0x360ca3[0x0][_0x7f5a('0x119')]?![]:!![];_0x411618=_0x360ca3[0x0][_0x7f5a('0x119')]?!![]:![];_0x411618=_0x4dc511?!![]:_0x411618;}var _0x30a6f6=_0x139335[_0x7f5a('0x11a')](_0x360ca3);if(_0x30a6f6[_0x7f5a('0x11b')]){rpcDb[_0x7f5a('0x11c')](_[_0x7f5a('0x77')](_0x360ca3[0x0],[_0x7f5a('0x79'),_0x7f5a('0x11d')]))[_0x7f5a('0x86')](function(_0x2f157f){_0x139335[_0x7f5a('0x101')](_0x2f157f,_0x360ca3[0x0],_0x4dc511,_0x390148,_0x411618)['then'](function(_0x41af5d){_0x392ac7(_0x41af5d);})[_0x7f5a('0x8f')](function(_0x329d6b){_0x3748a3(_0x329d6b);});})[_0x7f5a('0x8f')](function(_0x41b20f){ut[_0x7f5a('0x65')]('[Preview][checkIsBlackList]',_0x41b20f);_0x3748a3(ut[_0x7f5a('0x50')](_0x7f5a('0x11e'),_0x390148,_0x411618));});}else{_0x3748a3(ut[_0x7f5a('0x50')](_0x30a6f6[_0x7f5a('0x50')],_0x390148,_0x411618));}})['catch'](function(_0x490035){ut[_0x7f5a('0x65')](_0x7f5a('0x11f'),_0x490035);_0x3748a3(ut[_0x7f5a('0x50')](_0x7f5a('0x11e'),![],!![]));});});};Preview['prototype'][_0x7f5a('0x11a')]=function(_0x38d16b){if(_[_0x7f5a('0x70')](_0x38d16b)||_[_0x7f5a('0x105')](_0x38d16b)||!_['isNil'](_0x38d16b[0x0]['Agent'])&&_[_0x7f5a('0x70')](_0x38d16b[0x0][_0x7f5a('0x8a')][_0x7f5a('0x57')])){ut[_0x7f5a('0x65')](_0x7f5a('0x120'),_0x38d16b);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x2c9aba=this[_0x7f5a('0x27')][_0x38d16b[0x0][_0x7f5a('0x72')][_0x7f5a('0x57')]];_0x2c9aba[_0x7f5a('0x50')]=_0x7f5a('0x9d');if(_[_0x7f5a('0x70')](_0x2c9aba)){ut[_0x7f5a('0x65')]('[Preview][validateContact][Empty\x20Campaign]',_0x2c9aba);return{'isValid':![],'message':_0x7f5a('0x121')};}if(!this[_0x7f5a('0x9b')](_0x2c9aba['Trunk'])){ut[_0x7f5a('0x65')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x7f5a('0x122')+_0x2c9aba[_0x7f5a('0x57')]+_0x7f5a('0x123'));if(!this[_0x7f5a('0x9b')](_0x2c9aba[_0x7f5a('0x9c')])){ut[_0x7f5a('0x65')](_0x7f5a('0x124'),_0x2c9aba[_0x7f5a('0x57')]+_0x7f5a('0x125'));return{'isValid':![],'message':_0x7f5a('0x126')};}}if(!ut['isActive'](_0x2c9aba[_0x7f5a('0x35')])){ut[_0x7f5a('0x65')]('[Preview][validateContact][Campaign\x20Active]',_0x2c9aba['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0x7f5a('0x122')+_0x2c9aba[_0x7f5a('0x57')]+_0x7f5a('0x127')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x7f5a('0x106')]=function(_0x97ef93,_0x1841fc,_0x2a440e,_0xc5a9eb){var _0x19d546=this;return new BPromise(function(_0x4e8e8e,_0x589784){var _0x2cbee3=_0x97ef93['uniqueid'];var _0x5f2832=_0x19d546[_0x7f5a('0x9b')](_0x1841fc[_0x7f5a('0x56')])?util[_0x7f5a('0x92')](_0x7f5a('0x128'),_0x1841fc[_0x7f5a('0x56')][_0x7f5a('0x57')],_[_0x7f5a('0x70')](_0x1841fc[_0x7f5a('0x39')])?'':_0x1841fc[_0x7f5a('0x39')]['trim']()||'',_0x1841fc[_0x7f5a('0x129')]>0x0?_0x2a440e['Contact']['phone'][_0x7f5a('0x12a')](_0x1841fc[_0x7f5a('0x129')]):_0x2a440e[_0x7f5a('0x102')]['phone']):util['format']('SIP/%s/%s%s',_[_0x7f5a('0x70')](_0x1841fc[_0x7f5a('0x9c')])?_0x1841fc[_0x7f5a('0x56')][_0x7f5a('0x57')]:_0x1841fc['TrunkBackup']['name'],_['isNil'](_0x1841fc[_0x7f5a('0x39')])?'':_0x1841fc[_0x7f5a('0x39')][_0x7f5a('0x12b')]()||'',_0x1841fc[_0x7f5a('0x129')]>0x0?_0x2a440e[_0x7f5a('0x102')][_0x7f5a('0x103')][_0x7f5a('0x12a')](_0x1841fc['dialCutDigit']):_0x2a440e[_0x7f5a('0x102')]['phone']);var _0x41c1db=_0x19d546[_0x7f5a('0x9b')](_0x1841fc['Trunk'])?ut[_0x7f5a('0x12c')](_0x1841fc[_0x7f5a('0x56')][_0x7f5a('0x59')],_0x1841fc[_0x7f5a('0x12d')],_0x1841fc['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x7f5a('0x12e')](_0x1841fc[_0x7f5a('0x37')],_0x1841fc[_0x7f5a('0x12f')]):_0x1841fc[_0x7f5a('0x37')]):ut[_0x7f5a('0x12c')](_[_0x7f5a('0x70')](_0x1841fc['TrunkBackup'])?_0x1841fc[_0x7f5a('0x56')]['callerid']:_0x1841fc[_0x7f5a('0x9c')]['callerid'],_0x1841fc[_0x7f5a('0x12d')],_0x1841fc[_0x7f5a('0x12f')]>0x0?ut[_0x7f5a('0x12e')](_0x1841fc[_0x7f5a('0x37')],_0x1841fc[_0x7f5a('0x12f')]):_0x1841fc['dialOriginateCallerIdNumber']);if(_0x41c1db){_0x97ef93[_0x7f5a('0x130')]=ut[_0x7f5a('0x131')](_0x41c1db);_0x97ef93['originatecalleridnum']=ut['extractCalleridNumber'](_0x41c1db);}var _0x257746=ut[_0x7f5a('0x132')](_0x1841fc,_0x2a440e,_0x5f2832,_0x41c1db,_0x2cbee3,_0x97ef93);_[_0x7f5a('0x133')](_0x97ef93,ut[_0x7f5a('0x134')](_0x257746));_0x97ef93[_0x7f5a('0x91')]=moment()[_0x7f5a('0x92')](_0x7f5a('0xae'));ami['Action'](ut[_0x7f5a('0x135')](_0x97ef93,_0x1841fc,_0x257746,_0x97ef93[_0x7f5a('0xd3')],_0xc5a9eb))[_0x7f5a('0x86')](function(_0x4831ae){var _0x317c64=_0x97ef93[_0x7f5a('0x136')];if(!_[_0x7f5a('0x70')](_0x317c64)){if(!_['isNil'](_0x19d546['agents'][_0x317c64])){_0x19d546[_0x7f5a('0x18')][_0x317c64]['destconnectedlinenum']=_0x97ef93['calleridnum'];emit(util[_0x7f5a('0x92')](_0x7f5a('0x137'),_0x19d546['agents'][_0x317c64][_0x7f5a('0x57')]),_0x7f5a('0x138'),{'destaccountcode':_0x19d546['agents'][_0x317c64]['accountcode'],'destconnectedlinenum':_0x97ef93[_0x7f5a('0x139')]});}}_0x1841fc[_0x7f5a('0x51')]+=0x1;logger[_0x7f5a('0x5d')](_0x7f5a('0x13a'),_0x2cbee3,'\x20Queue',_0x1841fc[_0x7f5a('0x57')],_0x7f5a('0x74'),_0x1841fc['originated']);_0x4e8e8e(_0x4831ae);})[_0x7f5a('0x8f')](function(_0x2cb779){ut[_0x7f5a('0xf8')](_0x97ef93,0xe,_0x7f5a('0x13b'));rpcDb[_0x7f5a('0xfb')](_0x97ef93,_0x7f5a('0x13c'));_0x589784(_0x2cb779);});});};Preview[_0x7f5a('0x11')][_0x7f5a('0x13d')]=function(_0x2b6a58){if(this['actions'][_0x2b6a58[_0x7f5a('0xad')]]){this['actions'][_0x2b6a58[_0x7f5a('0xad')]][_0x7f5a('0x7c')]=_0x2b6a58[_0x7f5a('0x7c')];}};Preview[_0x7f5a('0x11')]['syncOriginateResponse']=function(_0x24f545){var _0x52ceba=this;var _0x2eb2b2=this[_0x7f5a('0x73')][_0x24f545[_0x7f5a('0x13e')]];if(_0x2eb2b2){if(_0x2eb2b2[_0x7f5a('0x104')]&&this[_0x7f5a('0x18')][_0x2eb2b2[_0x7f5a('0x104')]]){ut[_0x7f5a('0x13f')](_0x2eb2b2,this['agents'][_0x2eb2b2[_0x7f5a('0x104')]]['name'],this[_0x7f5a('0x18')][_0x2eb2b2['lookAgent']]['id']);}var _0x5b5cf2=_[_0x7f5a('0x140')](_0x2eb2b2);_0x5b5cf2[_0x7f5a('0xaf')]=moment()['format'](_0x7f5a('0xae'));var _0x3b3ee9=_0x52ceba['campaignsPreview'][_0x2eb2b2[_0x7f5a('0x75')]];if(ut['isFailure'](_0x24f545['response'])){if(_0x2eb2b2['unlockAgent']){rpcDb[_0x7f5a('0x141')](_0x2eb2b2[_0x7f5a('0x10a')]);}if(_0x2eb2b2[_0x7f5a('0xd3')]){rpcDb['disableContact'](_0x2eb2b2[_0x7f5a('0x10a')]);}ami[_0x7f5a('0x28')](_0x7f5a('0x142'),ut['buildObj'](_0x2eb2b2,'rejected',this[_0x7f5a('0x27')][_0x2eb2b2[_0x7f5a('0x75')]]));this['callProgressDetectingAgent'](_0x5b5cf2,_0x3b3ee9,_0x24f545);}else{_0x2eb2b2[_0x7f5a('0x91')]=moment()[_0x7f5a('0x92')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x7f5a('0xf8')](_0x5b5cf2,0x4,_0x7f5a('0xb9'));rpcDb[_0x7f5a('0xfb')](_0x5b5cf2,_0x7f5a('0x143'));}}};Preview[_0x7f5a('0x11')]['syncHangup']=function(_0x3de117){var _0x371f7a=this;var _0x5f492c=this['actions'][_0x3de117[_0x7f5a('0xad')]];var _0x3b5e24;if(_0x5f492c){_0x3b5e24=this[_0x7f5a('0x27')][_0x5f492c['queue']];logger[_0x7f5a('0x5d')](_0x7f5a('0x144'),_0x3de117['linkedid'],_0x7f5a('0xc0'),_0x3b5e24[_0x7f5a('0x57')],_0x7f5a('0x76'),_0x3b5e24[_0x7f5a('0x2e')]);}if(this[_0x7f5a('0x73')][_0x3de117[_0x7f5a('0xad')]]&&_0x3de117[_0x7f5a('0xad')]!==_0x3de117[_0x7f5a('0xf3')]){if(_0x3de117[_0x7f5a('0x145')]==='16'&&this[_0x7f5a('0x73')][_0x3de117[_0x7f5a('0xad')]][_0x7f5a('0xef')]){this[_0x7f5a('0x9e')](_0x3de117,_0x3de117[_0x7f5a('0xad')],_0x3de117[_0x7f5a('0x145')]);}else if(this[_0x7f5a('0x73')][_0x3de117[_0x7f5a('0xad')]]['dialAnswer']){logger[_0x7f5a('0x5d')]('[syncHangup][talking][cause]',_0x3de117[_0x7f5a('0xad')],_0x3de117[_0x7f5a('0x145')],_0x7f5a('0xc0'),_0x3b5e24[_0x7f5a('0x57')],_0x7f5a('0x76'),_0x3b5e24[_0x7f5a('0x2e')]);this[_0x7f5a('0x9e')](_0x3de117,_0x3de117[_0x7f5a('0xad')],_0x3de117['cause']);}}else if(_0x5f492c&&_[_0x7f5a('0x70')](_0x5f492c[_0x7f5a('0x146')])&&_0x3b5e24['dialQueueProject']&&_0x3de117[_0x7f5a('0xad')]===_0x3de117['uniqueid']&&_[_0x7f5a('0x70')](_0x3de117['reason'])&&_0x3de117[_0x7f5a('0x145')]==='16'&&_0x3de117['channelstate']==='6'&&_[_0x7f5a('0xf5')](_0x5f492c[_0x7f5a('0x147')])){if(_0x5f492c['unlockAgent']){rpcDb[_0x7f5a('0x141')](_0x5f492c[_0x7f5a('0x10a')]);}if(_0x5f492c['activeContact']){rpcDb['disableContact'](_0x5f492c[_0x7f5a('0x10a')]);}_0x3de117[_0x7f5a('0xf7')]='22';this['callProgressDetectingAgent'](_0x5f492c,_0x3b5e24,_0x3de117);}else if(_0x5f492c&&_0x5f492c[_0x7f5a('0x147')]){if(_0x3de117[_0x7f5a('0x145')]==='16'&&this[_0x7f5a('0x73')][_0x3de117[_0x7f5a('0xad')]]['dialAnswer']){logger['info'](_0x7f5a('0x148'),_0x3de117['linkedid'],_0x3de117[_0x7f5a('0x145')],_0x7f5a('0xc0'),_0x3b5e24[_0x7f5a('0x57')],'pTalking:\x20',_0x3b5e24[_0x7f5a('0x2e')]);this[_0x7f5a('0x9e')](_0x3de117,_0x3de117[_0x7f5a('0xad')],_0x3de117['cause']);}else if(this[_0x7f5a('0x73')][_0x3de117['linkedid']]['dialAnswer']){logger[_0x7f5a('0x5d')](_0x7f5a('0x149'),_0x3de117['linkedid'],_0x3de117['cause'],_0x7f5a('0xc0'),_0x3b5e24[_0x7f5a('0x57')],_0x7f5a('0x76'),_0x3b5e24[_0x7f5a('0x2e')]);this[_0x7f5a('0x9e')](_0x3de117,_0x3de117[_0x7f5a('0xad')],_0x3de117[_0x7f5a('0x145')]);}}};Preview[_0x7f5a('0x11')]['syncDialEnd']=function(_0x3350e0){if(this[_0x7f5a('0x73')][_0x3350e0[_0x7f5a('0x14a')]]&&_0x3350e0[_0x7f5a('0x14a')]!==_0x3350e0[_0x7f5a('0x14b')]){this[_0x7f5a('0x9e')](_0x3350e0,_0x3350e0['destlinkedid'],_0x3350e0[_0x7f5a('0xea')]);}};Preview[_0x7f5a('0x11')][_0x7f5a('0x1e')]=function(_0x5da312){if(this['actions'][_0x5da312['linkedid']]&&_0x5da312[_0x7f5a('0xad')]!==_0x5da312[_0x7f5a('0xf3')]&&!this[_0x7f5a('0x73')][_0x5da312[_0x7f5a('0xad')]]['dialAnswer']){if(_0x5da312[_0x7f5a('0x145')]==='1'){this['callProgressDetectingCustomer'](_0x5da312,_0x5da312[_0x7f5a('0xad')],_0x5da312[_0x7f5a('0x145')]);}}};Preview[_0x7f5a('0x11')][_0x7f5a('0x14c')]=function(_0x3af77a,_0x4074e1,_0x21b49e){if(this[_0x7f5a('0x73')][_0x3af77a]){if(_[_0x7f5a('0x70')](this[_0x7f5a('0x73')][_0x3af77a][_0x7f5a('0x14d')])){this[_0x7f5a('0x73')][_0x3af77a][_0x7f5a('0x14d')]={};}this[_0x7f5a('0x73')][_0x3af77a][_0x7f5a('0x14d')][_0x4074e1]=_0x21b49e;}};Preview['prototype'][_0x7f5a('0x22')]=function(_0x6b0a6c){try{if(!_[_0x7f5a('0x70')](_0x6b0a6c)){if(ut['filterKey'](_[_0x7f5a('0x14e')](_0x6b0a6c[_0x7f5a('0x14f')])[0x0])){this[_0x7f5a('0x14c')](_0x6b0a6c[_0x7f5a('0xf3')],_[_0x7f5a('0x14e')](_0x6b0a6c[_0x7f5a('0x14f')])[0x0],_0x6b0a6c['value']);}}}catch(_0x5ed0bb){logger['error'](_0x7f5a('0x150'),util['inspect'](_0x5ed0bb,{'showHidden':![],'depth':null}));}};Preview[_0x7f5a('0x11')][_0x7f5a('0x24')]=function(_0x35a9c4){if(_0x35a9c4){if(this[_0x7f5a('0x73')][_0x35a9c4[_0x7f5a('0x151')]]){this[_0x7f5a('0x73')][_0x35a9c4[_0x7f5a('0x151')]][_0x7f5a('0x147')]=!![];}}};Preview[_0x7f5a('0x11')]['syncBlindTransfer']=function(_0x2a5507){if(_0x2a5507){if(this[_0x7f5a('0x73')][_0x2a5507[_0x7f5a('0x152')]]){this[_0x7f5a('0x73')][_0x2a5507[_0x7f5a('0x152')]][_0x7f5a('0x147')]=!![];}}};module[_0x7f5a('0x153')]=Preview;
\ No newline at end of file
index 593ec1a..756ebba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf62f=['preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','then','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','rescheduleContact','bluebird'];(function(_0x45641d,_0x3a874e){var _0x482481=function(_0x4bb839){while(--_0x4bb839){_0x45641d['push'](_0x45641d['shift']());}};_0x482481(++_0x3a874e);}(_0xf62f,0x67));var _0xff62=function(_0x2980c5,_0x11c0be){_0x2980c5=_0x2980c5-0x0;var _0x42578e=_0xf62f[_0x2980c5];return _0x42578e;};'use strict';var util=require('util');var BPromise=require(_0xff62('0x0'));var logger=require('../../../config/logger')(_0xff62('0x1'));var _=require('lodash');var cmHopper=require(_0xff62('0x2'));var cmHopperFinal=require(_0xff62('0x3'));var cmHopperHistory=require(_0xff62('0x4'));var cmHopperBlack=require(_0xff62('0x5'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xff62('0x6'));function loggerCatch(_0x17285b){return function(_0x2dc18d){logger[_0xff62('0x7')](_0x17285b,util[_0xff62('0x8')](_0x2dc18d,{'showHidden':![],'depth':null}));};}function create(_0x279ed9){return BPromise['resolve']()[_0xff62('0x9')](cmHopperHistory[_0xff62('0xa')](_0x279ed9))[_0xff62('0xb')](loggerCatch(_0xff62('0xc')));}function createAgent(_0x12594a){return BPromise['resolve']()['then'](agentReportPreview[_0xff62('0xa')](_0x12594a))[_0xff62('0xb')](loggerCatch(_0xff62('0xc')));}function moveContact(_0x47f60c){return BPromise[_0xff62('0xd')]()[_0xff62('0x9')](cmHopper['moveContactManagedDialer'](_0x47f60c,!![]))[_0xff62('0xb')](loggerCatch(_0xff62('0xe')));}exports[_0xff62('0xf')]=function(_0x4f4032){return BPromise['resolve']()[_0xff62('0x9')](cmHopperBlack[_0xff62('0xf')](_0x4f4032))[_0xff62('0xb')](loggerCatch(_0xff62('0x10')));};exports[_0xff62('0x11')]=function(_0x78d116){return BPromise['resolve']()[_0xff62('0x9')](cmHopper[_0xff62('0x11')](_0x78d116))[_0xff62('0xb')](loggerCatch(_0xff62('0x12')));};exports[_0xff62('0xa')]=function(_0x451f12,_0x21c3db){create(_0x451f12)['catch'](loggerCatch(_0x21c3db));moveContact(_0x451f12)['catch'](loggerCatch(_0x21c3db));};exports[_0xff62('0x13')]=function(_0x31b9fe,_0x3b4825){createAgent(_0x31b9fe)[_0xff62('0xb')](loggerCatch(_0x3b4825));};exports[_0xff62('0x14')]=function(_0x78cc54,_0xe71465){create(_0x78cc54)[_0xff62('0xb')](loggerCatch(_0xe71465));};exports['createCustomerFinal']=function(_0x4217d1,_0x4222ff){moveContact(_0x4217d1)[_0xff62('0xb')](loggerCatch(_0x4222ff));};exports['rescheduleContact']=function(_0x3329f0,_0x65a05,_0x508da3){if(_0x65a05){_0x3329f0[_0xff62('0x15')]=null;}if(_0x508da3){_0x3329f0[_0xff62('0x16')]=![];}return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0x3329f0))[_0xff62('0xb')](loggerCatch(_0xff62('0x17')));};exports[_0xff62('0x18')]=function(_0x4a1d52){return BPromise[_0xff62('0xd')]()[_0xff62('0x9')](cmHopper[_0xff62('0x18')](_0x4a1d52))[_0xff62('0xb')](loggerCatch(_0xff62('0x19')));};exports[_0xff62('0x1a')]=function(_0x3a5d23){return BPromise['resolve']()[_0xff62('0x9')](cmHopper[_0xff62('0x1a')]({'UserId':null},_0x3a5d23,0x1))[_0xff62('0xb')](loggerCatch('[unlockContact]\x20'));};exports[_0xff62('0x1b')]=function(_0x9898a9){return BPromise[_0xff62('0xd')]()[_0xff62('0x9')](cmHopper['unlockContact']({'active':![]},_0x9898a9,0x1))[_0xff62('0xb')](loggerCatch(_0xff62('0x1c')));};exports['crateCustomerReportQueue']=function(_0x32d726){var _0x3e07e1={};_0x3e07e1[_0xff62('0x1d')]=_0x32d726[_0xff62('0x1d')];_0x3e07e1['uniqueid']=_0x32d726[_0xff62('0x1e')];_0x3e07e1['calleridnum']=_0x32d726[_0xff62('0x1f')];_0x3e07e1['calleridname']=_0x32d726[_0xff62('0x20')];_0x3e07e1['queue']=_0x32d726[_0xff62('0x21')];_0x3e07e1[_0xff62('0x22')]=_0x32d726[_0xff62('0x23')];_0x3e07e1['queuecallerleaveAt']=_0x32d726['answertime'];_0x3e07e1[_0xff62('0x24')]=0x1;_0x3e07e1[_0xff62('0x25')]=_0x32d726[_0xff62('0x26')];_0x3e07e1[_0xff62('0x27')]=_0x32d726[_0xff62('0x28')];_0x3e07e1[_0xff62('0x29')]='from-sip';_0x3e07e1[_0xff62('0x2a')]=_0xff62('0x2b');_0x3e07e1['holdtime']=0x0;_0x3e07e1[_0xff62('0x2c')]=0x1;_0x3e07e1[_0xff62('0x2d')]=_0x32d726[_0xff62('0x28')];_0x3e07e1[_0xff62('0x2e')]='COMPLETED';return BPromise[_0xff62('0xd')]()['then'](voiceQueueReport[_0xff62('0x2f')](_0x3e07e1))[_0xff62('0xb')](loggerCatch(_0xff62('0x30')));};exports[_0xff62('0x31')]=function(_0x22958e,_0x20547f){return BPromise['resolve']()[_0xff62('0x9')](cmHopper[_0xff62('0x31')](_0x22958e,_0x20547f))[_0xff62('0xb')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xff62('0x32')]=function(_0x391ac0){return BPromise['resolve']()[_0xff62('0x9')](cmHopper[_0xff62('0x33')](_0x391ac0,!![],!![]))[_0xff62('0xb')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
+var _0xefcd=['util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','resolve','createHistory','catch','then','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe'];(function(_0x40536f,_0x4a414a){var _0xddb2d1=function(_0x479a44){while(--_0x479a44){_0x40536f['push'](_0x40536f['shift']());}};_0xddb2d1(++_0x4a414a);}(_0xefcd,0x11d));var _0xdefc=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xefcd[_0x46698a];return _0x356db0;};'use strict';var util=require(_0xdefc('0x0'));var BPromise=require(_0xdefc('0x1'));var logger=require(_0xdefc('0x2'))(_0xdefc('0x3'));var _=require(_0xdefc('0x4'));var cmHopper=require(_0xdefc('0x5'));var cmHopperFinal=require(_0xdefc('0x6'));var cmHopperHistory=require(_0xdefc('0x7'));var cmHopperBlack=require(_0xdefc('0x8'));var voiceQueueRt=require(_0xdefc('0x9'));var agentReportPreview=require(_0xdefc('0xa'));var voiceQueueReport=require(_0xdefc('0xb'));function loggerCatch(_0xffc8ff){return function(_0x874dc1){logger['error'](_0xffc8ff,util['inspect'](_0x874dc1,{'showHidden':![],'depth':null}));};}function create(_0x32afcb){return BPromise[_0xdefc('0xc')]()['then'](cmHopperHistory[_0xdefc('0xd')](_0x32afcb))[_0xdefc('0xe')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x563f56){return BPromise[_0xdefc('0xc')]()[_0xdefc('0xf')](agentReportPreview[_0xdefc('0xd')](_0x563f56))['catch'](loggerCatch(_0xdefc('0x10')));}function moveContact(_0x48db72){return BPromise[_0xdefc('0xc')]()[_0xdefc('0xf')](cmHopper[_0xdefc('0x11')](_0x48db72,!![]))['catch'](loggerCatch(_0xdefc('0x12')));}exports['checkIsBlackList']=function(_0x12d931){return BPromise[_0xdefc('0xc')]()[_0xdefc('0xf')](cmHopperBlack[_0xdefc('0x13')](_0x12d931))[_0xdefc('0xe')](loggerCatch(_0xdefc('0x14')));};exports['getContactPreview']=function(_0x53a024){return BPromise[_0xdefc('0xc')]()['then'](cmHopper[_0xdefc('0x15')](_0x53a024))[_0xdefc('0xe')](loggerCatch(_0xdefc('0x16')));};exports[_0xdefc('0xd')]=function(_0x393bd8,_0x3d3f71){create(_0x393bd8)['catch'](loggerCatch(_0x3d3f71));moveContact(_0x393bd8)[_0xdefc('0xe')](loggerCatch(_0x3d3f71));};exports[_0xdefc('0x17')]=function(_0x113c1c,_0x358d21){createAgent(_0x113c1c)[_0xdefc('0xe')](loggerCatch(_0x358d21));};exports[_0xdefc('0x18')]=function(_0x332b0b,_0x198079){create(_0x332b0b)[_0xdefc('0xe')](loggerCatch(_0x198079));};exports[_0xdefc('0x19')]=function(_0x2629f9,_0x411d1f){moveContact(_0x2629f9)[_0xdefc('0xe')](loggerCatch(_0x411d1f));};exports[_0xdefc('0x1a')]=function(_0x52a259,_0x5f2c78,_0x58c62a){if(_0x5f2c78){_0x52a259[_0xdefc('0x1b')]=null;}if(_0x58c62a){_0x52a259['active']=![];}return BPromise[_0xdefc('0xc')]()['then'](cmHopper['rescheduleContact'](_0x52a259))[_0xdefc('0xe')](loggerCatch(_0xdefc('0x1c')));};exports[_0xdefc('0x1d')]=function(_0x4b70d5){return BPromise[_0xdefc('0xc')]()['then'](cmHopper[_0xdefc('0x1d')](_0x4b70d5))[_0xdefc('0xe')](loggerCatch(_0xdefc('0x1e')));};exports[_0xdefc('0x1f')]=function(_0x580559){return BPromise['resolve']()['then'](cmHopper['unlockContact']({'UserId':null},_0x580559,0x1))[_0xdefc('0xe')](loggerCatch(_0xdefc('0x20')));};exports[_0xdefc('0x21')]=function(_0x7df92c){return BPromise[_0xdefc('0xc')]()[_0xdefc('0xf')](cmHopper[_0xdefc('0x1f')]({'active':![]},_0x7df92c,0x1))['catch'](loggerCatch(_0xdefc('0x22')));};exports['crateCustomerReportQueue']=function(_0x3dcb36){var _0x40951d={};_0x40951d[_0xdefc('0x23')]=_0x3dcb36[_0xdefc('0x23')];_0x40951d[_0xdefc('0x24')]=_0x3dcb36['uniqueid'];_0x40951d[_0xdefc('0x25')]=_0x3dcb36[_0xdefc('0x25')];_0x40951d[_0xdefc('0x26')]=_0x3dcb36['calleridname'];_0x40951d[_0xdefc('0x27')]=_0x3dcb36[_0xdefc('0x27')];_0x40951d[_0xdefc('0x28')]=_0x3dcb36[_0xdefc('0x29')];_0x40951d['queuecallerleaveAt']=_0x3dcb36[_0xdefc('0x29')];_0x40951d[_0xdefc('0x2a')]=0x1;_0x40951d[_0xdefc('0x2b')]=_0x3dcb36['endtime'];_0x40951d[_0xdefc('0x2c')]=_0x3dcb36[_0xdefc('0x2d')];_0x40951d[_0xdefc('0x2e')]='from-sip';_0x40951d[_0xdefc('0x2f')]=_0xdefc('0x30');_0x40951d[_0xdefc('0x31')]=0x0;_0x40951d[_0xdefc('0x32')]=0x1;_0x40951d[_0xdefc('0x33')]=_0x3dcb36[_0xdefc('0x2d')];_0x40951d[_0xdefc('0x34')]=_0xdefc('0x35');return BPromise['resolve']()['then'](voiceQueueReport[_0xdefc('0x36')](_0x40951d))[_0xdefc('0xe')](loggerCatch(_0xdefc('0x37')));};exports[_0xdefc('0x38')]=function(_0x5c9d86,_0x1c1315){return BPromise['resolve']()[_0xdefc('0xf')](cmHopper[_0xdefc('0x38')](_0x5c9d86,_0x1c1315))[_0xdefc('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x177e9e){return BPromise['resolve']()[_0xdefc('0xf')](cmHopper[_0xdefc('0x1a')](_0x177e9e,!![],!![]))[_0xdefc('0xe')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
index 108914e..9ee8a3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9daa=['logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','logLookAgent','UserId','logCustomer','endtime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','queue','interface','channelAgent','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','idContact','type','membername','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9daa,0x80));var _0xa9da=function(_0x4f80a7,_0x3ed415){_0x4f80a7=_0x4f80a7-0x0;var _0x5f2dc6=_0x9daa[_0x4f80a7];return _0x5f2dc6;};'use strict';var util=require(_0xa9da('0x0'));var _=require(_0xa9da('0x1'));var moment=require(_0xa9da('0x2'));var logger=require(_0xa9da('0x3'))(_0xa9da('0x4'));var ipAgi=process[_0xa9da('0x5')][_0xa9da('0x6')]||_0xa9da('0x7');function getSeconds(_0x374540,_0x30984d){var _0x260789=moment(_0x374540)[_0xa9da('0x8')](0x0);var _0x154ce1=moment(_0x30984d)[_0xa9da('0x8')](0x0);return _0x260789[_0xa9da('0x9')](_0x154ce1,_0xa9da('0xa'));}exports[_0xa9da('0xb')]=function(_0x157b6f){return function(_0x1e7283){logger[_0xa9da('0xc')](_0x157b6f,util[_0xa9da('0xd')](_0x1e7283,{'showHidden':![],'depth':null}));};};exports[_0xa9da('0xe')]=function(_0x1b4806,_0x1b3851){logger[_0xa9da('0xf')](_0x1b4806,util['inspect'](_0x1b3851,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x21c826,_0x25623c){logger[_0xa9da('0xc')](_0x21c826,util[_0xa9da('0xd')](_0x25623c,{'showHidden':![],'depth':null}));};exports[_0xa9da('0x10')]=function(_0xac03ca){return function(_0x23ec1c){logger[_0xa9da('0xf')](_0xac03ca,util[_0xa9da('0xd')](_0x23ec1c,{'showHidden':![],'depth':null}));};};exports[_0xa9da('0x11')]=function(_0x195987,_0x5c0d8f,_0x33b25e){return{'message':_0x195987,'unlock':_0x5c0d8f,'active':_0x33b25e};};exports[_0xa9da('0x12')]=function(_0x2415df,_0x47f3b0,_0x1c6ac3){if(!_[_0xa9da('0x13')](_0x1c6ac3)&&_0xa9da('0x14')===typeof _0x1c6ac3&&!_[_0xa9da('0x15')](_0x1c6ac3)){if(!_[_0xa9da('0x13')](_0x47f3b0)&&_0xa9da('0x14')===typeof _0x47f3b0&&!_[_0xa9da('0x15')](_0x47f3b0)){return util[_0xa9da('0x16')]('\x22%s\x22\x20<%s>',_0x47f3b0,_0x1c6ac3);}return util[_0xa9da('0x16')](_0xa9da('0x17'),_0x1c6ac3,_0x1c6ac3);}if(!_[_0xa9da('0x13')](_0x2415df)&&_0xa9da('0x14')===typeof _0x2415df&&!_[_0xa9da('0x15')](_0x2415df)){return _0x2415df;}return _0xa9da('0x18');};exports[_0xa9da('0x19')]=function(_0x1f6174){if(_[_0xa9da('0x1a')](_0x1f6174)){return![];}return _0x1f6174;};exports['addVariables']=function(_0x4e37c5,_0x51a0e6,_0x510542,_0x547548,_0x33d6e5,_0x1fcaba){var _0x5353e1={'XMD-QUEUE':_0x51a0e6['Queue']?_0x51a0e6[_0xa9da('0x1b')][_0xa9da('0x1c')]:'','XMD-CALLERID':_0x547548,'XMD-CALLERID-PREVIEW':_0x1fcaba?util[_0xa9da('0x16')](_0xa9da('0x17'),_0x1fcaba[_0xa9da('0x1d')],_0x1fcaba[_0xa9da('0x1e')]):_0x547548,'XMD-DIALID':_0x33d6e5,'XMD-CONTACTID':_0x51a0e6[_0xa9da('0x1f')],'XMD-CDRTYPE':_0xa9da('0x20'),'CALLERID(all)':_0x547548,'XMD-VOICEQUEUEID':_0x51a0e6[_0xa9da('0x21')],'XMD-DIALCHANNEL':_0x510542,'XMD-DIALTIMEOUT':_0x4e37c5[_0xa9da('0x22')]||0x1e,'XMD-DIALOPTIONS':util[_0xa9da('0x16')](_0xa9da('0x23'),_0x4e37c5[_0xa9da('0x24')]?'g':'',_['isEmpty'](_0x4e37c5[_0xa9da('0x25')])?'':_0xa9da('0x26')),'XMD-DIALURL':_0x4e37c5[_0xa9da('0x27')]||'','XMD-AGI':_0x4e37c5[_0xa9da('0x28')]?util[_0xa9da('0x16')](_0xa9da('0x29'),ipAgi,_0x4e37c5[_0xa9da('0x28')]):'NONE','XMD-AGIAFTER':_0x4e37c5[_0xa9da('0x24')]?util[_0xa9da('0x16')](_0xa9da('0x29'),ipAgi,_0x4e37c5['dialQueueProject2']):_0xa9da('0x2a'),'XMD-ORIGINATECALLERIDNUM':_0x1fcaba?_0x1fcaba[_0xa9da('0x2b')]:'','XMD-ORIGINATECALLERIDNAME':_0x1fcaba?_0x1fcaba[_0xa9da('0x2c')]:'','XMD-DESTINATION':_0xa9da('0x2d')};if(!_[_0xa9da('0x15')](_0x4e37c5[_0xa9da('0x25')])){_0x5353e1[util['format']('%s',_0xa9da('0x2e'))]=_0x4e37c5['monitor_format'];_0x5353e1[util[_0xa9da('0x16')]('%s',_0xa9da('0x2f'))]=_0x33d6e5;}if(_0x51a0e6&&_0x51a0e6['Contact']){for(var _0xc38337 in _0x51a0e6[_0xa9da('0x30')]){if(_0x51a0e6[_0xa9da('0x30')][_0xa9da('0x31')](_0xc38337)){if(!_['isNil'](_0x51a0e6[_0xa9da('0x30')][_0xc38337])&&_0xc38337!=='id'&&_0xc38337!==_0xa9da('0x32')&&_0xc38337!==_0xa9da('0x33')&&_0xc38337!==_0xa9da('0x34')){_0x5353e1[util[_0xa9da('0x16')](_0xa9da('0x35'),_0xa9da('0x36'),_['toUpper'](_0xc38337))]=_0x51a0e6[_0xa9da('0x30')][_0xc38337];}}}}return _0x5353e1;};exports['toLowerVariables']=function(_0x4c9f0c){var _0xcf510d={};for(var _0x4e1237 in _0x4c9f0c){if(_0x4c9f0c[_0xa9da('0x31')](_0x4e1237)){_0xcf510d[util[_0xa9da('0x16')]('%s',_[_0xa9da('0x37')](_0x4e1237))]=_0x4c9f0c[_0x4e1237];}}return{'variables':_0xcf510d};};exports[_0xa9da('0x38')]=function(_0x4703a4,_0x5b2042){if(!_[_0xa9da('0x1a')](_0x4703a4)){if(_0x4703a4[_0xa9da('0x31')](_0xa9da('0x39'))){if(_0x4703a4[_0xa9da('0x39')]>0x0){_0x4703a4[_0xa9da('0x39')]-=0x1;}else{logger[_0xa9da('0xc')](_0xa9da('0x3a'),_0x5b2042);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5b2042);}};exports[_0xa9da('0x3b')]=function(_0x2c6f5d){var _0x5715c8=moment()[_0xa9da('0x16')](_0xa9da('0x3c'));_0x2c6f5d[_0xa9da('0x3d')]=0xd;_0x2c6f5d[_0xa9da('0x3e')]=_0xa9da('0x3f');_0x2c6f5d[_0xa9da('0x40')]=_0x5715c8;_0x2c6f5d[_0xa9da('0x41')]=_0x5715c8;_0x2c6f5d['endtime']=_0x5715c8;};exports[_0xa9da('0x42')]=function(_0x3d79b0,_0x35c7fe,_0x215830){var _0x36523c=moment()[_0xa9da('0x16')](_0xa9da('0x3c'));_0x3d79b0[_0xa9da('0x3d')]=_0x35c7fe;_0x3d79b0[_0xa9da('0x3e')]=_0x215830;_0x3d79b0[_0xa9da('0x41')]=_0x36523c;_0x3d79b0['ringtime']=getSeconds(_0x3d79b0[_0xa9da('0x41')],_0x3d79b0['starttime']);};exports[_0xa9da('0x43')]=function(_0xb6f144,_0x56a5f0,_0x46ef5d){_0xb6f144['membername']=_0x56a5f0;_0xb6f144[_0xa9da('0x44')]=_0x46ef5d;};exports[_0xa9da('0x45')]=function(_0x170263,_0xc58b9b,_0x447f02){var _0x5998fe=moment()['format'](_0xa9da('0x3c'));_0x170263[_0xa9da('0x3d')]=_0xc58b9b;_0x170263['statedesc']=_0x447f02;_0x170263[_0xa9da('0x41')]=_0x170263[_0xa9da('0x41')]?_0x170263[_0xa9da('0x41')]:_0x5998fe;_0x170263[_0xa9da('0x46')]=_0x170263['endtime']?_0x170263['endtime']:_0x5998fe;_0x170263['ringtime']=getSeconds(_0x170263[_0xa9da('0x41')]||0x0,_0x170263[_0xa9da('0x40')]||0x0);_0x170263[_0xa9da('0x47')]=_0x170263[_0xa9da('0x48')]?getSeconds(_0x170263[_0xa9da('0x46')],_0x170263[_0xa9da('0x48')]):0x0;};exports['isFailure']=function(_0x127df8){return _0x127df8===_0xa9da('0x49');};exports[_0xa9da('0x4a')]=function(_0xe6da21,_0x276390,_0x5e95cb,_0x23ae8b,_0x48f919){var _0x5d9c2c=_0x23ae8b?_0xa9da('0x4b'):_0xe6da21[_0xa9da('0x1d')];_0x5d9c2c=_0x48f919?_0xa9da('0x4c'):_0x5d9c2c;return{'actionid':_0xe6da21[_0xa9da('0x4d')],'action':'originate','channel':_0xe6da21['channelAgent'],'callerid':util[_0xa9da('0x16')](_0xa9da('0x17'),_0x5d9c2c,_0xe6da21[_0xa9da('0x1e')]),'Exten':_0xa9da('0x2d'),'Context':_0xa9da('0x4e'),'Priority':'1','variable':_0x5e95cb,'timeout':(_0x276390[_0xa9da('0x4f')]||0x1e)*0x3e8,'async':!![],'channelid':_0xe6da21[_0xa9da('0x4d')]};};exports['totalGlobal']=function(_0x261272){return _0x261272[_0xa9da('0x50')]+_0x261272[_0xa9da('0x51')]+_0x261272[_0xa9da('0x52')]+_0x261272['countagentrejectretry']+_0x261272[_0xa9da('0x53')];};exports[_0xa9da('0x54')]=function(_0x511a33){var _0xf83e1b=_[_0xa9da('0x55')](_0x511a33);_0xf83e1b[_0xa9da('0x3d')]=0xf;_0xf83e1b[_0xa9da('0x3e')]='Global';return _0xf83e1b;};exports[_0xa9da('0x56')]=function(_0x36c5a4,_0x3d1b0e,_0x4bf6c2){var _0x41d045={};_0x41d045[_0x3d1b0e]=_0x36c5a4[_0x3d1b0e];_0x41d045[_0xa9da('0x57')]=![];_0x41d045[_0xa9da('0x58')]=moment()['add'](_0x4bf6c2,_0xa9da('0x59'))[_0xa9da('0x16')](_0xa9da('0x3c'));_0x41d045['ContactId']=_0x36c5a4[_0xa9da('0x1f')];_0x41d045['ListId']=_0x36c5a4[_0xa9da('0x5a')];_0x41d045[_0xa9da('0x21')]=_0x36c5a4[_0xa9da('0x21')]||undefined;return _0x41d045;};exports[_0xa9da('0x5b')]=function(_0x200ae5,_0xa4ff88){if(!_[_0xa9da('0x1a')](_0x200ae5)){if(_0x200ae5[_0xa9da('0x5c')]>0x0){_0x200ae5[_0xa9da('0x5c')]-=0x1;}else{logger[_0xa9da('0xc')](_0xa4ff88,_0xa9da('0x5d'));}}else{logger[_0xa9da('0xc')](_0xa4ff88,_0xa9da('0x5e'));}};exports['IsNotLoggedIn']=function(_0x3f3ebb){if(_0x3f3ebb<=0x0){return!![];}return![];};exports[_0xa9da('0x5f')]=function(_0x40ea70,_0x1e8bf8,_0x2a979b){_0x40ea70['lastevent']=_0x1e8bf8;_0x40ea70[_0xa9da('0x1c')]=_0x40ea70[_0xa9da('0x60')];_0x40ea70[_0xa9da('0x61')]=_0x40ea70[_0xa9da('0x62')];_0x40ea70[_0xa9da('0x63')]=_0xa9da('0x64');if(_0x2a979b){_0x40ea70['mandatoryDisposition']=_0x2a979b[_0xa9da('0x65')];}return _0x40ea70;};exports[_0xa9da('0x66')]=function(_0x48ad7c){var _0x3aeffc={};_0x3aeffc[_0xa9da('0x60')]=_0x48ad7c[_0xa9da('0x60')];_0x3aeffc[_0xa9da('0x61')]=_0x48ad7c['channelAgent'];_0x3aeffc[_0xa9da('0x4d')]=_0x48ad7c[_0xa9da('0x4d')];return _0x3aeffc;};exports[_0xa9da('0x67')]=function(_0x3d0c65){var _0x281eae=[];for(var _0x4b5498 in _0x3d0c65){if(_0x3d0c65['hasOwnProperty'](_0x4b5498)){if(!_['isNil'](_0x3d0c65[_0x4b5498])&&_0x3d0c65[_0x4b5498][_0xa9da('0x3d')]===_0xa9da('0x68')&&_0x3d0c65[_0x4b5498][_0xa9da('0x69')]===_0xa9da('0x6a')){_0x281eae[_0xa9da('0x6b')](_0x3d0c65[_0x4b5498]['id']);}}}return _0x281eae;};exports[_0xa9da('0x6c')]=function(_0x674507){var _0x2b4845=moment()[_0xa9da('0x8')](0x0);var _0x4dd359=moment(_0x674507)[_0xa9da('0x8')](0x0);return _0x2b4845[_0xa9da('0x9')](_0x4dd359,'seconds');};exports[_0xa9da('0x6d')]=function(_0x3f5813){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3f5813[_0xa9da('0x1f')],'ListId':_0x3f5813[_0xa9da('0x5a')],'VoiceQueueId':_0x3f5813[_0xa9da('0x21')]||undefined,'CampaignId':_0x3f5813['CampaignId']||undefined};};exports['filterKey']=function(_0x3481c7){if(_0x3481c7==='uniqueid'||_0x3481c7===_0xa9da('0x6e')||_0x3481c7==='queue'||_0x3481c7===_0xa9da('0x6f')||_0x3481c7==='campaigntype'||_0x3481c7==='dialAnswer'||_0x3481c7===_0xa9da('0x70')||_0x3481c7===_0xa9da('0x62')||_0x3481c7==='calleridname'||_0x3481c7===_0xa9da('0x57')||_0x3481c7===_0xa9da('0x1e')||_0x3481c7===_0xa9da('0x58')||_0x3481c7==='countbusyretry'||_0x3481c7===_0xa9da('0x51')||_0x3481c7===_0xa9da('0x52')||_0x3481c7===_0xa9da('0x71')||_0x3481c7===_0xa9da('0x72')||_0x3481c7===_0xa9da('0x73')||_0x3481c7==='callbackat'||_0x3481c7===_0xa9da('0x74')||_0x3481c7==='ContactId'||_0x3481c7===_0xa9da('0x5a')||_0x3481c7==='UserId'||_0x3481c7==='VoiceQueueId'||_0x3481c7===_0xa9da('0x75')||_0x3481c7===_0xa9da('0x76')||_0x3481c7==='xmd-queue'||_0x3481c7==='xmd-phone'||_0x3481c7===_0xa9da('0x77')||_0x3481c7===_0xa9da('0x78')||_0x3481c7===_0xa9da('0x79')||_0x3481c7===_0xa9da('0x7a')||_0x3481c7===_0xa9da('0x7b')||_0x3481c7===_0xa9da('0x7c')||_0x3481c7==='xmd-contactid'||_0x3481c7===_0xa9da('0x7d')||_0x3481c7==='xmd-callerid'||_0x3481c7==='xmd-agiafter'||_0x3481c7===_0xa9da('0x7e')||_0x3481c7==='rtpaudioqos'||_0x3481c7===_0xa9da('0x7f')||_0x3481c7===_0xa9da('0x80')||_0x3481c7===_0xa9da('0x81')||_0x3481c7===_0xa9da('0x82')||_0x3481c7===_0xa9da('0x83')||_0x3481c7===_0xa9da('0x84')||_0x3481c7===_0xa9da('0x85')||_0x3481c7===_0xa9da('0x86')||_0x3481c7===_0xa9da('0x7f')||_0x3481c7===_0xa9da('0x80')||_0x3481c7==='rtpaudioqosjitterbridged'||_0x3481c7==='rtpaudioqosloss'||_0x3481c7==='rtpaudioqoslossbridged'||_0x3481c7===_0xa9da('0x84')||_0x3481c7===_0xa9da('0x85')||_0x3481c7===_0xa9da('0x87')||_0x3481c7===_0xa9da('0x88')||_0x3481c7==='state'||_0x3481c7==='statedesc'){return![];}return!![];};exports[_0xa9da('0x89')]=function(_0x3a2acd,_0xf72b14){var _0xfd38a,_0x363e36,_0x31b0d7;if(_0xf72b14<=0x0){_0xf72b14=0x1;}_0xfd38a=new RegExp('\x5cw{0,'+_0xf72b14+'}$');_0x363e36=Math['pow'](0xa,_0xf72b14-0x1);_0x31b0d7=Math[_0xa9da('0x8a')](0xa,_0xf72b14)-0x1;return util[_0xa9da('0x16')]('%s',_[_0xa9da('0x8b')](_0x3a2acd,_0xfd38a,_[_0xa9da('0x8c')](_0x363e36,_0x31b0d7)));};exports[_0xa9da('0x8d')]=function(_0x5a9f7b){var _0x13c1ad=_0x5a9f7b[_0xa9da('0x8e')](/"(.*?)"/);return _0x13c1ad?_0x13c1ad[0x1]:_0x5a9f7b;};exports[_0xa9da('0x8f')]=function(_0x977f41){var _0x192323=_0x977f41[_0xa9da('0x8e')](/<(.*?)>/);return _0x192323?_0x192323[0x1]:_0x977f41;};
\ No newline at end of file
+var _0x4433=['add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','buildObj','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildAcw','interface','not_inuse','status','reachable','push','getDiff','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','membername','calleridnum','countbusyretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','UserId','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','match','util','lodash','moment','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','inspect','info','loggerError','error','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','dialQueueProject2','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','toLowerVariables','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countagentrejectretry','cloneAction','Global','scheduledAt','active','scheduledat'];(function(_0x5d6f05,_0x7790aa){var _0x49fac1=function(_0x48c87e){while(--_0x48c87e){_0x5d6f05['push'](_0x5d6f05['shift']());}};_0x49fac1(++_0x7790aa);}(_0x4433,0xcb));var _0x3443=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4433[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x3443('0x0'));var _=require(_0x3443('0x1'));var moment=require(_0x3443('0x2'));var logger=require('../../../../config/logger')(_0x3443('0x3'));var ipAgi=process['env'][_0x3443('0x4')]||_0x3443('0x5');function getSeconds(_0x405057,_0x3c3276){var _0x1b4224=moment(_0x405057)['milliseconds'](0x0);var _0x5264da=moment(_0x3c3276)[_0x3443('0x6')](0x0);return _0x1b4224[_0x3443('0x7')](_0x5264da,'seconds');}exports['loggerCatch']=function(_0x249d55){return function(_0x1ea3fb){logger['error'](_0x249d55,util[_0x3443('0x8')](_0x1ea3fb,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x71e306,_0x137a6a){logger[_0x3443('0x9')](_0x71e306,util['inspect'](_0x137a6a,{'showHidden':![],'depth':null}));};exports[_0x3443('0xa')]=function(_0x1d82ae,_0x44618a){logger[_0x3443('0xb')](_0x1d82ae,util['inspect'](_0x44618a,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x22d8d2){return function(_0xc885fe){logger[_0x3443('0x9')](_0x22d8d2,util['inspect'](_0xc885fe,{'showHidden':![],'depth':null}));};};exports[_0x3443('0xc')]=function(_0x4ea2f5,_0x5e2088,_0x439f82){return{'message':_0x4ea2f5,'unlock':_0x5e2088,'active':_0x439f82};};exports['getCallerId']=function(_0x29dbdf,_0xba5ff8,_0x5ba27f){if(!_[_0x3443('0xd')](_0x5ba27f)&&_0x3443('0xe')===typeof _0x5ba27f&&!_[_0x3443('0xf')](_0x5ba27f)){if(!_[_0x3443('0xd')](_0xba5ff8)&&_0x3443('0xe')===typeof _0xba5ff8&&!_['isEmpty'](_0xba5ff8)){return util[_0x3443('0x10')](_0x3443('0x11'),_0xba5ff8,_0x5ba27f);}return util[_0x3443('0x10')](_0x3443('0x11'),_0x5ba27f,_0x5ba27f);}if(!_[_0x3443('0xd')](_0x29dbdf)&&_0x3443('0xe')===typeof _0x29dbdf&&!_[_0x3443('0xf')](_0x29dbdf)){return _0x29dbdf;}return _0x3443('0x12');};exports[_0x3443('0x13')]=function(_0x53dfba){if(_['isNil'](_0x53dfba)){return![];}return _0x53dfba;};exports[_0x3443('0x14')]=function(_0x3fa5a7,_0x16a9b8,_0x1b470c,_0x25e90c,_0x4f3da7,_0x37079a){var _0x323dc4={'XMD-QUEUE':_0x16a9b8[_0x3443('0x15')]?_0x16a9b8[_0x3443('0x15')][_0x3443('0x16')]:'','XMD-CALLERID':_0x25e90c,'XMD-CALLERID-PREVIEW':_0x37079a?util[_0x3443('0x10')](_0x3443('0x11'),_0x37079a['calleridname'],_0x37079a['calleridnum']):_0x25e90c,'XMD-DIALID':_0x4f3da7,'XMD-CONTACTID':_0x16a9b8['ContactId'],'XMD-CDRTYPE':_0x3443('0x17'),'CALLERID(all)':_0x25e90c,'XMD-VOICEQUEUEID':_0x16a9b8[_0x3443('0x18')],'XMD-DIALCHANNEL':_0x1b470c,'XMD-DIALTIMEOUT':_0x3fa5a7[_0x3443('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0x3443('0x10')](_0x3443('0x1a'),_0x3fa5a7['dialQueueProject2']?'g':'',_[_0x3443('0xf')](_0x3fa5a7[_0x3443('0x1b')])?'':_0x3443('0x1c')),'XMD-DIALURL':_0x3fa5a7['dialPreviewUrl']||'','XMD-AGI':_0x3fa5a7['dialQueueProject']?util[_0x3443('0x10')](_0x3443('0x1d'),ipAgi,_0x3fa5a7[_0x3443('0x1e')]):_0x3443('0x1f'),'XMD-AGIAFTER':_0x3fa5a7[_0x3443('0x20')]?util[_0x3443('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3fa5a7[_0x3443('0x20')]):_0x3443('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x37079a?_0x37079a['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x37079a?_0x37079a[_0x3443('0x21')]:'','XMD-DESTINATION':_0x3443('0x22')};if(!_[_0x3443('0xf')](_0x3fa5a7[_0x3443('0x1b')])){_0x323dc4[util['format']('%s',_0x3443('0x23'))]=_0x3fa5a7[_0x3443('0x1b')];_0x323dc4[util[_0x3443('0x10')]('%s',_0x3443('0x24'))]=_0x4f3da7;}if(_0x16a9b8&&_0x16a9b8[_0x3443('0x25')]){for(var _0x57fed6 in _0x16a9b8['Contact']){if(_0x16a9b8['Contact'][_0x3443('0x26')](_0x57fed6)){if(!_['isNil'](_0x16a9b8[_0x3443('0x25')][_0x57fed6])&&_0x57fed6!=='id'&&_0x57fed6!==_0x3443('0x27')&&_0x57fed6!=='createdAt'&&_0x57fed6!=='updatedAt'){_0x323dc4[util['format']('%s%s','XMD-',_['toUpper'](_0x57fed6))]=_0x16a9b8[_0x3443('0x25')][_0x57fed6];}}}}return _0x323dc4;};exports[_0x3443('0x28')]=function(_0x59378d){var _0x5ac1a7={};for(var _0x282f2b in _0x59378d){if(_0x59378d['hasOwnProperty'](_0x282f2b)){_0x5ac1a7[util['format']('%s',_['toLower'](_0x282f2b))]=_0x59378d[_0x282f2b];}}return{'variables':_0x5ac1a7};};exports['updateOriginated']=function(_0x2fa3bb,_0x4624d6){if(!_[_0x3443('0x29')](_0x2fa3bb)){if(_0x2fa3bb[_0x3443('0x26')]('originated')){if(_0x2fa3bb['originated']>0x0){_0x2fa3bb[_0x3443('0x2a')]-=0x1;}else{logger[_0x3443('0xb')](_0x3443('0x2b'),_0x4624d6);}}}else{logger[_0x3443('0xb')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x4624d6);}};exports[_0x3443('0x2c')]=function(_0x3ca0a4){var _0x5d0d18=moment()[_0x3443('0x10')](_0x3443('0x2d'));_0x3ca0a4[_0x3443('0x2e')]=0xd;_0x3ca0a4[_0x3443('0x2f')]=_0x3443('0x30');_0x3ca0a4[_0x3443('0x31')]=_0x5d0d18;_0x3ca0a4[_0x3443('0x32')]=_0x5d0d18;_0x3ca0a4[_0x3443('0x33')]=_0x5d0d18;};exports[_0x3443('0x34')]=function(_0x1ddf84,_0x47aefc,_0x920734){var _0x80835c=moment()[_0x3443('0x10')](_0x3443('0x2d'));_0x1ddf84[_0x3443('0x2e')]=_0x47aefc;_0x1ddf84[_0x3443('0x2f')]=_0x920734;_0x1ddf84[_0x3443('0x32')]=_0x80835c;_0x1ddf84[_0x3443('0x35')]=getSeconds(_0x1ddf84[_0x3443('0x32')],_0x1ddf84[_0x3443('0x31')]);};exports['logLookAgent']=function(_0x4921fc,_0x57ce12,_0x253c16){_0x4921fc['membername']=_0x57ce12;_0x4921fc['UserId']=_0x253c16;};exports[_0x3443('0x36')]=function(_0x3d9857,_0x1977bb,_0x5f50c8){var _0x50565f=moment()[_0x3443('0x10')](_0x3443('0x2d'));_0x3d9857[_0x3443('0x2e')]=_0x1977bb;_0x3d9857[_0x3443('0x2f')]=_0x5f50c8;_0x3d9857[_0x3443('0x32')]=_0x3d9857[_0x3443('0x32')]?_0x3d9857[_0x3443('0x32')]:_0x50565f;_0x3d9857['endtime']=_0x3d9857['endtime']?_0x3d9857[_0x3443('0x33')]:_0x50565f;_0x3d9857[_0x3443('0x35')]=getSeconds(_0x3d9857['responsetime']||0x0,_0x3d9857['starttime']||0x0);_0x3d9857[_0x3443('0x37')]=_0x3d9857['answertime']?getSeconds(_0x3d9857['endtime'],_0x3d9857[_0x3443('0x38')]):0x0;};exports[_0x3443('0x39')]=function(_0x4ad64c){return _0x4ad64c===_0x3443('0x3a');};exports[_0x3443('0x3b')]=function(_0x176793,_0x40a010,_0x17eef9,_0x9f4ca5,_0x4ce61f){var _0x3b883a=_0x9f4ca5?'RECALL':_0x176793[_0x3443('0x3c')];_0x3b883a=_0x4ce61f?_0x3443('0x3d'):_0x3b883a;return{'actionid':_0x176793[_0x3443('0x3e')],'action':_0x3443('0x3f'),'channel':_0x176793[_0x3443('0x40')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x3b883a,_0x176793['calleridnum']),'Exten':_0x3443('0x22'),'Context':_0x3443('0x41'),'Priority':'1','variable':_0x17eef9,'timeout':(_0x40a010[_0x3443('0x42')]||0x1e)*0x3e8,'async':!![],'channelid':_0x176793[_0x3443('0x3e')]};};exports[_0x3443('0x43')]=function(_0x38cf2c){return _0x38cf2c['countbusyretry']+_0x38cf2c[_0x3443('0x44')]+_0x38cf2c['countnoanswerretry']+_0x38cf2c[_0x3443('0x45')]+_0x38cf2c['countnosuchnumberretry'];};exports[_0x3443('0x46')]=function(_0x346c09){var _0x196b97=_['clone'](_0x346c09);_0x196b97[_0x3443('0x2e')]=0xf;_0x196b97[_0x3443('0x2f')]=_0x3443('0x47');return _0x196b97;};exports[_0x3443('0x48')]=function(_0x4eb88b,_0x40b41e,_0x4af2b4){var _0x537afd={};_0x537afd[_0x40b41e]=_0x4eb88b[_0x40b41e];_0x537afd[_0x3443('0x49')]=![];_0x537afd[_0x3443('0x4a')]=moment()[_0x3443('0x4b')](_0x4af2b4,_0x3443('0x4c'))[_0x3443('0x10')](_0x3443('0x2d'));_0x537afd[_0x3443('0x4d')]=_0x4eb88b[_0x3443('0x4d')];_0x537afd[_0x3443('0x4e')]=_0x4eb88b['ListId'];_0x537afd['VoiceQueueId']=_0x4eb88b[_0x3443('0x18')]||undefined;return _0x537afd;};exports[_0x3443('0x4f')]=function(_0x2a2c9d,_0x4c2c04){if(!_[_0x3443('0x29')](_0x2a2c9d)){if(_0x2a2c9d[_0x3443('0x50')]>0x0){_0x2a2c9d[_0x3443('0x50')]-=0x1;}else{logger[_0x3443('0xb')](_0x4c2c04,_0x3443('0x51'));}}else{logger[_0x3443('0xb')](_0x4c2c04,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x115538){if(_0x115538<=0x0){return!![];}return![];};exports[_0x3443('0x52')]=function(_0x3fcece,_0x68fa32,_0xffdb9f){_0x3fcece[_0x3443('0x53')]=_0x68fa32;_0x3fcece[_0x3443('0x16')]=_0x3fcece[_0x3443('0x54')];_0x3fcece['interface']=_0x3fcece[_0x3443('0x40')];_0x3fcece[_0x3443('0x55')]=_0x3443('0x56');if(_0xffdb9f){_0x3fcece[_0x3443('0x57')]=_0xffdb9f[_0x3443('0x57')];}return _0x3fcece;};exports[_0x3443('0x58')]=function(_0x4045e8){var _0x5ddc0f={};_0x5ddc0f[_0x3443('0x54')]=_0x4045e8[_0x3443('0x54')];_0x5ddc0f[_0x3443('0x59')]=_0x4045e8[_0x3443('0x40')];_0x5ddc0f[_0x3443('0x3e')]=_0x4045e8[_0x3443('0x3e')];return _0x5ddc0f;};exports['agentReadyId']=function(_0x126594){var _0x465f4d=[];for(var _0x361292 in _0x126594){if(_0x126594[_0x3443('0x26')](_0x361292)){if(!_[_0x3443('0x29')](_0x126594[_0x361292])&&_0x126594[_0x361292][_0x3443('0x2e')]===_0x3443('0x5a')&&_0x126594[_0x361292][_0x3443('0x5b')]===_0x3443('0x5c')){_0x465f4d[_0x3443('0x5d')](_0x126594[_0x361292]['id']);}}}return _0x465f4d;};exports[_0x3443('0x5e')]=function(_0x317d45){var _0x3914df=moment()[_0x3443('0x6')](0x0);var _0x283818=moment(_0x317d45)[_0x3443('0x6')](0x0);return _0x3914df[_0x3443('0x7')](_0x283818,'seconds');};exports['createBody']=function(_0x27aedc){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x27aedc['ContactId'],'ListId':_0x27aedc[_0x3443('0x4e')],'VoiceQueueId':_0x27aedc['VoiceQueueId']||undefined,'CampaignId':_0x27aedc[_0x3443('0x5f')]||undefined};};exports[_0x3443('0x60')]=function(_0x1accfe){if(_0x1accfe===_0x3443('0x3e')||_0x1accfe===_0x3443('0x61')||_0x1accfe===_0x3443('0x54')||_0x1accfe===_0x3443('0x62')||_0x1accfe===_0x3443('0x63')||_0x1accfe===_0x3443('0x64')||_0x1accfe===_0x3443('0x65')||_0x1accfe==='channelAgent'||_0x1accfe===_0x3443('0x3c')||_0x1accfe===_0x3443('0x49')||_0x1accfe===_0x3443('0x66')||_0x1accfe===_0x3443('0x4a')||_0x1accfe===_0x3443('0x67')||_0x1accfe===_0x3443('0x44')||_0x1accfe===_0x3443('0x68')||_0x1accfe===_0x3443('0x69')||_0x1accfe===_0x3443('0x6a')||_0x1accfe===_0x3443('0x6b')||_0x1accfe===_0x3443('0x6c')||_0x1accfe==='recallme'||_0x1accfe==='ContactId'||_0x1accfe===_0x3443('0x4e')||_0x1accfe===_0x3443('0x6d')||_0x1accfe===_0x3443('0x18')||_0x1accfe===_0x3443('0x6e')||_0x1accfe===_0x3443('0x6f')||_0x1accfe==='xmd-queue'||_0x1accfe===_0x3443('0x70')||_0x1accfe===_0x3443('0x71')||_0x1accfe===_0x3443('0x72')||_0x1accfe===_0x3443('0x73')||_0x1accfe===_0x3443('0x74')||_0x1accfe===_0x3443('0x75')||_0x1accfe===_0x3443('0x76')||_0x1accfe===_0x3443('0x77')||_0x1accfe===_0x3443('0x78')||_0x1accfe===_0x3443('0x79')||_0x1accfe===_0x3443('0x7a')||_0x1accfe===_0x3443('0x7b')||_0x1accfe==='rtpaudioqos'||_0x1accfe===_0x3443('0x7c')||_0x1accfe==='rtpaudioqosjitter'||_0x1accfe==='rtpaudioqosjitterbridged'||_0x1accfe===_0x3443('0x7d')||_0x1accfe===_0x3443('0x7e')||_0x1accfe===_0x3443('0x7f')||_0x1accfe===_0x3443('0x80')||_0x1accfe===_0x3443('0x81')||_0x1accfe===_0x3443('0x7c')||_0x1accfe===_0x3443('0x82')||_0x1accfe===_0x3443('0x83')||_0x1accfe===_0x3443('0x7d')||_0x1accfe===_0x3443('0x7e')||_0x1accfe===_0x3443('0x7f')||_0x1accfe==='rtpaudioqosrttbridged'||_0x1accfe===_0x3443('0x84')||_0x1accfe===_0x3443('0x85')||_0x1accfe===_0x3443('0x2e')||_0x1accfe===_0x3443('0x2f')){return![];}return!![];};exports[_0x3443('0x86')]=function(_0xacb3f5,_0x3461cb){var _0x2fe916,_0x35d430,_0x216871;if(_0x3461cb<=0x0){_0x3461cb=0x1;}_0x2fe916=new RegExp(_0x3443('0x87')+_0x3461cb+'}$');_0x35d430=Math[_0x3443('0x88')](0xa,_0x3461cb-0x1);_0x216871=Math[_0x3443('0x88')](0xa,_0x3461cb)-0x1;return util[_0x3443('0x10')]('%s',_[_0x3443('0x89')](_0xacb3f5,_0x2fe916,_['random'](_0x35d430,_0x216871)));};exports['extractCalleridName']=function(_0x540b00){var _0x1e001b=_0x540b00[_0x3443('0x8a')](/"(.*?)"/);return _0x1e001b?_0x1e001b[0x1]:_0x540b00;};exports['extractCalleridNumber']=function(_0x3aa5ae){var _0x261200=_0x3aa5ae['match'](/<(.*?)>/);return _0x261200?_0x261200[0x1]:_0x3aa5ae;};
\ No newline at end of file
index 2b8d12d..c44fb75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd91a=['reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','string','number','boolean','queuepause'];(function(_0x25c044,_0xbd05f8){var _0x558ee5=function(_0x5de5d2){while(--_0x5de5d2){_0x25c044['push'](_0x25c044['shift']());}};_0x558ee5(++_0xbd05f8);}(_0xd91a,0x1b4));var _0xad91=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd91a[_0x20a584];return _0x4b41a8;};'use strict';exports['queueadd']={'queue':{'type':_0xad91('0x0'),'required':!![]},'interface':{'type':_0xad91('0x0'),'required':!![]},'membername':{'type':_0xad91('0x0'),'required':!![]},'penalty':{'type':_0xad91('0x1'),'required':![]},'paused':{'type':_0xad91('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0xad91('0x0'),'required':!![]},'interface':{'type':_0xad91('0x0'),'required':!![]}};exports[_0xad91('0x3')]={'interface':{'type':_0xad91('0x0'),'required':!![]},'paused':{'type':_0xad91('0x2')},'reason':{'type':_0xad91('0x0'),'required':![]}};exports[_0xad91('0x4')]={'module':{'type':_0xad91('0x0'),'required':![]}};exports[_0xad91('0x5')]={'uniqueid':{'type':_0xad91('0x0'),'required':!![]}};exports[_0xad91('0x6')]={'uniqueid':{'type':_0xad91('0x0'),'required':!![]},'filename':{'type':_0xad91('0x0')},'format':{'type':_0xad91('0x0')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xad91('0x0'),'required':!![]}};exports[_0xad91('0x7')]={'uniqueid':{'type':_0xad91('0x0'),'required':!![]},'exten':{'type':_0xad91('0x0'),'required':!![]},'context':{'type':_0xad91('0x0')}};
\ No newline at end of file
+var _0x0478=['boolean','queueremove','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number'];(function(_0xcbaea4,_0x3877d1){var _0x24d0b4=function(_0x2f61e7){while(--_0x2f61e7){_0xcbaea4['push'](_0xcbaea4['shift']());}};_0x24d0b4(++_0x3877d1);}(_0x0478,0x1c6));var _0x8047=function(_0x35d5a7,_0x1a5842){_0x35d5a7=_0x35d5a7-0x0;var _0x3dd4de=_0x0478[_0x35d5a7];return _0x3dd4de;};'use strict';exports['queueadd']={'queue':{'type':_0x8047('0x0'),'required':!![]},'interface':{'type':_0x8047('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x8047('0x1'),'required':![]},'paused':{'type':_0x8047('0x2'),'required':![]}};exports[_0x8047('0x3')]={'queue':{'type':_0x8047('0x0'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0x8047('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x8047('0x0'),'required':![]}};exports['reload']={'module':{'type':_0x8047('0x0'),'required':![]}};exports[_0x8047('0x4')]={'uniqueid':{'type':_0x8047('0x0'),'required':!![]}};exports[_0x8047('0x5')]={'uniqueid':{'type':_0x8047('0x0'),'required':!![]},'filename':{'type':_0x8047('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0x8047('0x0')}};exports[_0x8047('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x8047('0x7')]={'uniqueid':{'type':_0x8047('0x0'),'required':!![]},'exten':{'type':_0x8047('0x0'),'required':!![]},'context':{'type':_0x8047('0x0')}};
\ No newline at end of file
index ec5a090..5984b47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4444=['sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','isUndefined','initTelephones','telephones','length','initTrunks','voiceQueues','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallerleaveAt','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','trunks','campaigns','outbound','voiceExtensions','channels','queueChannels','settings','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','answered','sumHoldTime'];(function(_0x132610,_0x521f72){var _0x4a9b42=function(_0x4ac8e5){while(--_0x4ac8e5){_0x132610['push'](_0x132610['shift']());}};_0x4a9b42(++_0x521f72);}(_0x4444,0x102));var _0x4444=function(_0x144b16,_0x528837){_0x144b16=_0x144b16-0x0;var _0x50369d=_0x4444[_0x144b16];return _0x50369d;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var moment=require(_0x4444('0x0'));var Agent=require(_0x4444('0x1'));var Telephone=require(_0x4444('0x2'));var Trunk=require(_0x4444('0x3'));var VoiceQueue=require(_0x4444('0x4'));var Trigger=require(_0x4444('0x5'));var Template=require('../model/template');var Campaign=require(_0x4444('0x6'));var VoiceExtension=require(_0x4444('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x4444('0x8'));var FreshdeskAccount=require(_0x4444('0x9'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x4444('0xa'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x4444('0xb'));var Dynamics365Account=require(_0x4444('0xc'));var FreshsalesAccount=require(_0x4444('0xd'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x4444('0xe')]={};this['telephones']={};this[_0x4444('0xf')]={};this['voiceQueues']={};this['triggers']={};this[_0x4444('0x10')]={};this['templates']={};this[_0x4444('0x11')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x4444('0x12')]={};this[_0x4444('0x13')]={};this[_0x4444('0x14')]={};this['outboundChannels']={};this['timers']={};this[_0x4444('0x15')]={};this['zendeskAccounts']={};this[_0x4444('0x16')]={};this['sugarcrmAccounts']={};this[_0x4444('0x17')]={};this[_0x4444('0x18')]={};this[_0x4444('0x19')]={};this[_0x4444('0x1a')]={};this['servicenowAccounts']={};this[_0x4444('0x1b')]={};this[_0x4444('0x1c')]={};this[_0x4444('0x1d')]={};};function freeIsNotKey(_0x53ea15,_0x141235,_0x3f9b3a){var _0x280489=_[_0x4444('0x1e')](_0x53ea15,function(_0x20d801,_0x43fd1e){return _0x20d801[_0x3f9b3a];});for(var _0x387a6f in _0x141235){if(_0x141235['hasOwnProperty'](_0x387a6f)){if(!_0x280489[_0x387a6f]){delete _0x141235[_0x387a6f];}}}}function freeIsNotKeySip(_0x30f7b7,_0x1ccc31){var _0x519a17=_['mapKeys'](_0x30f7b7,function(_0x2ee6c4,_0x5c9866){return util[_0x4444('0x1f')](_0x4444('0x20'),_0x2ee6c4[_0x4444('0x21')]);});for(var _0x1ad8f6 in _0x1ccc31){if(_0x1ccc31[_0x4444('0x22')](_0x1ad8f6)){if(!_0x519a17[_0x1ad8f6]){delete _0x1ccc31[_0x1ad8f6];}}}}function freeIsNotKeyAgent(_0x183575,_0x5690db){var _0x4f0218=_[_0x4444('0x1e')](_0x183575,function(_0x4ba7fb,_0x447db9){var _0x20b858=_[_0x4444('0x23')](_0x4ba7fb[_0x4444('0x24')])?util[_0x4444('0x1f')]('SIP/%s',_0x4ba7fb[_0x4444('0x21')]):_0x4ba7fb[_0x4444('0x24')];return _0x20b858;});for(var _0x3458e9 in _0x5690db){if(_0x5690db[_0x4444('0x22')](_0x3458e9)){if(!_0x4f0218[_0x3458e9]){delete _0x5690db[_0x3458e9];}}}}function clearVoiceCallReports(_0xeb26a2){_0xeb26a2['total']=0x0;_0xeb26a2[_0x4444('0x25')]=0x0;_0xeb26a2[_0x4444('0x26')]=0x0;_0xeb26a2[_0x4444('0x27')]=0x0;_0xeb26a2[_0x4444('0x28')]=0x0;}function clearCampaigns(_0x12eed6){if(!_[_0x4444('0x29')](_0x12eed6)){for(var _0x4dd34a in _0x12eed6){if(_0x12eed6[_0x4444('0x22')](_0x4dd34a)){_0x12eed6[_0x4dd34a][_0x4444('0x2a')]=0x0;_0x12eed6[_0x4dd34a][_0x4444('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x2ea862){if(!_[_0x4444('0x29')](_0x2ea862)){for(var _0x4331fe in _0x2ea862){if(_0x2ea862['hasOwnProperty'](_0x4331fe)){_0x2ea862[_0x4331fe][_0x4444('0x2c')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x25')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x2d')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x2e')]=0x0;_0x2ea862[_0x4331fe]['sumHoldTime']=0x0;_0x2ea862[_0x4331fe]['sumDuration']=0x0;_0x2ea862[_0x4331fe][_0x4444('0x28')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x2f')]=0x0;_0x2ea862[_0x4331fe]['outboundNoAnswerCallsDay']=0x0;_0x2ea862[_0x4331fe][_0x4444('0x30')]=0x0;_0x2ea862[_0x4331fe]['outboundCongestionCallsDay']=0x0;_0x2ea862[_0x4331fe]['outboundNoSuchCallsDay']=0x0;_0x2ea862[_0x4331fe]['outboundUnknownCallsDay']=0x0;_0x2ea862[_0x4331fe][_0x4444('0x31')]=0x0;_0x2ea862[_0x4331fe]['outboundDropCallsDayCallersExit']=0x0;_0x2ea862[_0x4331fe][_0x4444('0x32')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x33')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x34')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x35')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x2f')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x36')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x37')]=!![];}}}}Realtime[_0x4444('0x38')][_0x4444('0x39')]=function(_0x381680,_0x204dd7){for(var _0x398c6e in _0x204dd7){if(_0x381680[_0x4444('0x22')](_0x398c6e)){_0x381680[_0x398c6e]=_0x204dd7[_0x398c6e];}}};Realtime['prototype']['initAgents']=function(){var _0x49c522=this;return function(_0x2b0ce8){if(_0x2b0ce8){freeIsNotKeyAgent(_0x2b0ce8,_0x49c522[_0x4444('0xe')]);for(var _0x5dc3a3=0x0,_0x170e1f={},_0x57f5cd={};_0x5dc3a3<_0x2b0ce8['length'];_0x5dc3a3+=0x1){_0x170e1f=_0x2b0ce8[_0x5dc3a3];var _0x46d781=_[_0x4444('0x23')](_0x170e1f[_0x4444('0x24')])?util[_0x4444('0x1f')](_0x4444('0x20'),_0x170e1f[_0x4444('0x21')]):_0x170e1f[_0x4444('0x24')];if(_[_0x4444('0x3a')](_0x49c522[_0x4444('0xe')][_0x46d781])){_0x49c522['agents'][_0x46d781]=new Agent(_0x170e1f);}else{_0x49c522['mergeFromDatabase'](_0x49c522[_0x4444('0xe')][_0x46d781],_0x170e1f);}}}return _0x49c522[_0x4444('0xe')];};};Realtime[_0x4444('0x38')][_0x4444('0x3b')]=function(){var _0x39626b=this;return function(_0x5ca9aa){if(_0x5ca9aa){freeIsNotKeySip(_0x5ca9aa,_0x39626b[_0x4444('0x3c')]);for(var _0x37abd8=0x0,_0x3d0050={},_0x21218d={};_0x37abd8<_0x5ca9aa[_0x4444('0x3d')];_0x37abd8+=0x1){_0x3d0050=_0x5ca9aa[_0x37abd8];if(_[_0x4444('0x3a')](_0x39626b['telephones'][util['format']('SIP/%s',_0x3d0050['name'])])){_0x39626b['telephones'][util[_0x4444('0x1f')](_0x4444('0x20'),_0x3d0050[_0x4444('0x21')])]=new Telephone(_0x3d0050);}else{_0x39626b[_0x4444('0x39')](_0x39626b['telephones'][util[_0x4444('0x1f')]('SIP/%s',_0x3d0050[_0x4444('0x21')])],_0x3d0050);}}}return _0x39626b[_0x4444('0x3c')];};};Realtime[_0x4444('0x38')][_0x4444('0x3e')]=function(){var _0x46a563=this;return function(_0x50f59e){if(_0x50f59e){freeIsNotKeySip(_0x50f59e,_0x46a563['trunks']);for(var _0xcbf297=0x0,_0x5e0037={},_0x8ab30={};_0xcbf297<_0x50f59e['length'];_0xcbf297+=0x1){_0x5e0037=_0x50f59e[_0xcbf297];if(_[_0x4444('0x3a')](_0x46a563[_0x4444('0xf')][util[_0x4444('0x1f')](_0x4444('0x20'),_0x5e0037['name'])])){_0x46a563[_0x4444('0xf')][util[_0x4444('0x1f')]('SIP/%s',_0x5e0037[_0x4444('0x21')])]=new Trunk(_0x5e0037);}else{_0x46a563[_0x4444('0x39')](_0x46a563[_0x4444('0xf')][util[_0x4444('0x1f')](_0x4444('0x20'),_0x5e0037['name'])],_0x5e0037);}}}return _0x46a563[_0x4444('0xf')];};};Realtime[_0x4444('0x38')]['initVoiceQueues']=function(){var _0x3a2adb=this;return function(_0x5d9d20){if(_0x5d9d20){freeIsNotKey(_0x5d9d20,_0x3a2adb[_0x4444('0x3f')],_0x4444('0x21'));for(var _0x1061d8=0x0,_0x31383e={},_0x3bf921={};_0x1061d8<_0x5d9d20['length'];_0x1061d8+=0x1){_0x31383e=_0x5d9d20[_0x1061d8];if(_[_0x4444('0x3a')](_0x3a2adb['voiceQueues'][_0x31383e['name']])){_0x3a2adb['voiceQueues'][_0x31383e[_0x4444('0x21')]]=new VoiceQueue(_0x31383e);}else{_0x3a2adb[_0x4444('0x39')](_0x3a2adb['voiceQueues'][_0x31383e[_0x4444('0x21')]],_0x31383e);}}}return _0x3a2adb[_0x4444('0x3f')];};};Realtime['prototype'][_0x4444('0x40')]=function(){var _0x1c4a59=this;return function(_0x1a8cce){if(_0x1a8cce){freeIsNotKey(_0x1a8cce,_0x1c4a59[_0x4444('0x41')],'id');for(var _0x91af12=0x0,_0x5a008b={},_0x46ada5={};_0x91af12<_0x1a8cce[_0x4444('0x3d')];_0x91af12+=0x1){_0x5a008b=_0x1a8cce[_0x91af12];if(_['isUndefined'](_0x1c4a59[_0x4444('0x41')][_0x5a008b['id']])){_0x1c4a59[_0x4444('0x41')][_0x5a008b['id']]=new Trigger(_0x5a008b);}else{_0x1c4a59[_0x4444('0x39')](_0x1c4a59[_0x4444('0x41')][_0x5a008b['id']],_0x5a008b);}}}return _0x1c4a59['triggers'];};};Realtime[_0x4444('0x38')][_0x4444('0x42')]=function(){var _0x387672=this;return function(_0x343def){if(_0x343def){freeIsNotKey(_0x343def,_0x387672[_0x4444('0x43')],'id');for(var _0x3463e0=0x0,_0x49348c={},_0x423aa5={};_0x3463e0<_0x343def[_0x4444('0x3d')];_0x3463e0+=0x1){_0x49348c=_0x343def[_0x3463e0];if(_[_0x4444('0x3a')](_0x387672[_0x4444('0x43')][_0x49348c['id']])){_0x387672[_0x4444('0x43')][_0x49348c['id']]=new Template(_0x49348c);}else{_0x387672[_0x4444('0x39')](_0x387672[_0x4444('0x43')][_0x49348c['id']],_0x49348c);}}}return _0x387672['templates'];};};Realtime['prototype'][_0x4444('0x44')]=function(){var _0xc0ab84=this;return function(_0x35b58d){if(_0x35b58d){freeIsNotKey(_0x35b58d,_0xc0ab84[_0x4444('0x45')],'id');for(var _0x398577=0x0,_0x2dbe94={},_0x179d35={};_0x398577<_0x35b58d[_0x4444('0x3d')];_0x398577+=0x1){_0x2dbe94=_0x35b58d[_0x398577];if(_[_0x4444('0x3a')](_0xc0ab84[_0x4444('0x45')][_0x2dbe94['id']])){_0xc0ab84[_0x4444('0x45')][_0x2dbe94['id']]=new ZendeskAccount(_0x2dbe94);}else{_0xc0ab84['mergeFromDatabase'](_0xc0ab84[_0x4444('0x45')][_0x2dbe94['id']],_0x2dbe94);}}}return _0xc0ab84[_0x4444('0x45')];};};Realtime[_0x4444('0x38')][_0x4444('0x46')]=function(){var _0x3b8999=this;return function(_0x446fdf){if(_0x446fdf){freeIsNotKey(_0x446fdf,_0x3b8999[_0x4444('0x16')],'id');for(var _0x465625=0x0,_0x545c48={},_0x5bd8de={};_0x465625<_0x446fdf[_0x4444('0x3d')];_0x465625+=0x1){_0x545c48=_0x446fdf[_0x465625];if(_[_0x4444('0x3a')](_0x3b8999[_0x4444('0x16')][_0x545c48['id']])){_0x3b8999['salesforceAccounts'][_0x545c48['id']]=new SalesforceAccount(_0x545c48);}else{_0x3b8999['mergeFromDatabase'](_0x3b8999[_0x4444('0x16')][_0x545c48['id']],_0x545c48);}}}return _0x3b8999[_0x4444('0x16')];};};Realtime[_0x4444('0x38')][_0x4444('0x47')]=function(){var _0x33fbf9=this;return function(_0x57e359){if(_0x57e359){freeIsNotKey(_0x57e359,_0x33fbf9[_0x4444('0x17')],'id');for(var _0x3abf09=0x0,_0x4b1b63={},_0x40ee00={};_0x3abf09<_0x57e359[_0x4444('0x3d')];_0x3abf09+=0x1){_0x4b1b63=_0x57e359[_0x3abf09];if(_[_0x4444('0x3a')](_0x33fbf9[_0x4444('0x17')][_0x4b1b63['id']])){_0x33fbf9[_0x4444('0x17')][_0x4b1b63['id']]=new FreshdeskAccount(_0x4b1b63);}else{_0x33fbf9[_0x4444('0x39')](_0x33fbf9[_0x4444('0x17')][_0x4b1b63['id']],_0x4b1b63);}}}return _0x33fbf9['freshdeskAccounts'];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x5e689d=this;return function(_0x4dc34b){if(_0x4dc34b){freeIsNotKey(_0x4dc34b,_0x5e689d[_0x4444('0x18')],'id');for(var _0x11e01e=0x0,_0x426385={},_0x4545c2={};_0x11e01e<_0x4dc34b[_0x4444('0x3d')];_0x11e01e+=0x1){_0x426385=_0x4dc34b[_0x11e01e];if(_[_0x4444('0x3a')](_0x5e689d[_0x4444('0x18')][_0x426385['id']])){_0x5e689d[_0x4444('0x18')][_0x426385['id']]=new ZohoAccount(_0x426385);}else{_0x5e689d[_0x4444('0x39')](_0x5e689d[_0x4444('0x18')][_0x426385['id']],_0x426385);}}}return _0x5e689d[_0x4444('0x18')];};};Realtime['prototype'][_0x4444('0x48')]=function(){var _0x1447b6=this;return function(_0x45f59f){if(_0x45f59f){freeIsNotKey(_0x45f59f,_0x1447b6['deskAccounts'],'id');for(var _0x17d1b2=0x0,_0x213910={},_0x495635={};_0x17d1b2<_0x45f59f['length'];_0x17d1b2+=0x1){_0x213910=_0x45f59f[_0x17d1b2];if(_[_0x4444('0x3a')](_0x1447b6[_0x4444('0x19')][_0x213910['id']])){_0x1447b6[_0x4444('0x19')][_0x213910['id']]=new DeskAccount(_0x213910);}else{_0x1447b6[_0x4444('0x39')](_0x1447b6['deskAccounts'][_0x213910['id']],_0x213910);}}}return _0x1447b6[_0x4444('0x19')];};};Realtime[_0x4444('0x38')][_0x4444('0x49')]=function(){var _0x1f1864=this;return function(_0x18094b){if(_0x18094b){freeIsNotKey(_0x18094b,_0x1f1864[_0x4444('0x4a')],'id');for(var _0x2178c3=0x0,_0x52b15c={},_0x370176={};_0x2178c3<_0x18094b[_0x4444('0x3d')];_0x2178c3+=0x1){_0x52b15c=_0x18094b[_0x2178c3];if(_['isUndefined'](_0x1f1864[_0x4444('0x4a')][_0x52b15c['id']])){_0x1f1864[_0x4444('0x4a')][_0x52b15c['id']]=new SugarcrmAccount(_0x52b15c);}else{_0x1f1864[_0x4444('0x39')](_0x1f1864['sugarcrmAccounts'][_0x52b15c['id']],_0x52b15c);}}}return _0x1f1864[_0x4444('0x4a')];};};Realtime[_0x4444('0x38')]['initVtigerAccounts']=function(){var _0x27da2f=this;return function(_0x2cc359){if(_0x2cc359){freeIsNotKey(_0x2cc359,_0x27da2f[_0x4444('0x1a')],'id');for(var _0x363496=0x0,_0x5f01ad={},_0x5c43fd={};_0x363496<_0x2cc359[_0x4444('0x3d')];_0x363496+=0x1){_0x5f01ad=_0x2cc359[_0x363496];if(_[_0x4444('0x3a')](_0x27da2f[_0x4444('0x1a')][_0x5f01ad['id']])){_0x27da2f['vtigerAccounts'][_0x5f01ad['id']]=new VtigerAccount(_0x5f01ad);}else{_0x27da2f[_0x4444('0x39')](_0x27da2f[_0x4444('0x1a')][_0x5f01ad['id']],_0x5f01ad);}}}return _0x27da2f[_0x4444('0x1a')];};};Realtime[_0x4444('0x38')][_0x4444('0x4b')]=function(){var _0x2aa1f4=this;return function(_0x19a157){if(_0x19a157){freeIsNotKey(_0x19a157,_0x2aa1f4[_0x4444('0x4c')],'id');for(var _0x43db3f=0x0,_0x2a0468={},_0x311360={};_0x43db3f<_0x19a157[_0x4444('0x3d')];_0x43db3f+=0x1){_0x2a0468=_0x19a157[_0x43db3f];if(_[_0x4444('0x3a')](_0x2aa1f4['servicenowAccounts'][_0x2a0468['id']])){_0x2aa1f4[_0x4444('0x4c')][_0x2a0468['id']]=new ServicenowAccount(_0x2a0468);}else{_0x2aa1f4[_0x4444('0x39')](_0x2aa1f4['servicenowAccounts'][_0x2a0468['id']],_0x2a0468);}}}return _0x2aa1f4[_0x4444('0x4c')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x100c76=this;return function(_0x4bb53e){if(_0x4bb53e){freeIsNotKey(_0x4bb53e,_0x100c76[_0x4444('0x1b')],'id');for(var _0x33341f=0x0,_0x28e6a5={},_0x311184={};_0x33341f<_0x4bb53e['length'];_0x33341f+=0x1){_0x28e6a5=_0x4bb53e[_0x33341f];if(_['isUndefined'](_0x100c76['dynamics365Accounts'][_0x28e6a5['id']])){_0x100c76[_0x4444('0x1b')][_0x28e6a5['id']]=new Dynamics365Account(_0x28e6a5);}else{_0x100c76[_0x4444('0x39')](_0x100c76[_0x4444('0x1b')][_0x28e6a5['id']],_0x28e6a5);}}}return _0x100c76['dynamics365Accounts'];};};Realtime['prototype'][_0x4444('0x4d')]=function(){var _0x365bd8=this;return function(_0x449a24){if(_0x449a24){freeIsNotKey(_0x449a24,_0x365bd8[_0x4444('0x1c')],'id');for(var _0xfdf06f=0x0,_0x130820={},_0x337de5={};_0xfdf06f<_0x449a24[_0x4444('0x3d')];_0xfdf06f+=0x1){_0x130820=_0x449a24[_0xfdf06f];if(_[_0x4444('0x3a')](_0x365bd8['freshsalesAccounts'][_0x130820['id']])){_0x365bd8[_0x4444('0x1c')][_0x130820['id']]=new FreshsalesAccount(_0x130820);}else{_0x365bd8[_0x4444('0x39')](_0x365bd8['freshsalesAccounts'][_0x130820['id']],_0x130820);}}}return _0x365bd8[_0x4444('0x1c')];};};Realtime[_0x4444('0x38')][_0x4444('0x4e')]=function(){var _0x4ec209=this;return function(_0x4b3873){for(var _0x223ee1=0x0;_0x223ee1<_0x4b3873['length'];_0x223ee1+=0x1){_[_0x4444('0x4f')](_0x4ec209[_0x4444('0x3f')][_0x4b3873[_0x223ee1][_0x4444('0x21')]],_0x4b3873[_0x223ee1]);}return _0x4ec209['voiceQueues'];};};Realtime[_0x4444('0x38')][_0x4444('0x50')]=function(){var _0x2e355b=this;return function(_0x4bed1f){clearVoiceQueues(_0x2e355b[_0x4444('0x3f')]);if(_0x4bed1f){_0x4bed1f=_[_0x4444('0x51')](_0x4bed1f,'uniqueid');for(var _0xcaf58e in _0x4bed1f){if(_0x4bed1f[_0x4444('0x22')](_0xcaf58e)){var _0x2447b8={};for(var _0x27f88f=0x0;_0x27f88f<_0x4bed1f[_0xcaf58e]['length'];_0x27f88f+=0x1){var _0x2f7e5a=_0x4bed1f[_0xcaf58e][_0x27f88f]['queue'];if(_0x2e355b[_0x4444('0x3f')][_0x2f7e5a]){if(_0x4bed1f[_0xcaf58e][_0x27f88f]['queuecallerexit']){_0x2e355b[_0x4444('0x3f')][_0x2f7e5a][_0x4444('0x2d')]+=0x1;}if(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x52')]){_0x2e355b[_0x4444('0x3f')][_0x2f7e5a][_0x4444('0x2e')]+=0x1;}_0x2e355b['voiceQueues'][_0x2f7e5a][_0x4444('0x26')]+=moment(_0x4bed1f[_0xcaf58e][_0x27f88f]['queuecallerleaveAt'])[_0x4444('0x53')](moment(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x54')]),_0x4444('0x55'))||0x0;if(_0x27f88f===_0x4bed1f[_0xcaf58e]['length']-0x1){_0x2e355b[_0x4444('0x3f')][_0x2f7e5a][_0x4444('0x27')]+=moment(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x56')]||_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x57')]||_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x58')])[_0x4444('0x53')](moment(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x54')]),'seconds')||0x0;_0x2e355b[_0x4444('0x3f')][_0x2f7e5a][_0x4444('0x2c')]+=0x1;if(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x59')]){_0x2e355b[_0x4444('0x3f')][_0x2f7e5a]['answered']+=0x1;_0x2e355b[_0x4444('0x3f')][_0x2f7e5a]['sumBillable']+=moment(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x56')])[_0x4444('0x53')](moment(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x5a')]),_0x4444('0x55'))||0x0;}}else{_0x2e355b[_0x4444('0x3f')][_0x2f7e5a][_0x4444('0x27')]+=_0x2e355b[_0x4444('0x3f')][_0x2f7e5a]['sumHoldTime']||0x0;}}}}}}return _0x2e355b[_0x4444('0x3f')];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x57cc55=this;return function(_0x457ce1){clearVoiceCallReports(_0x57cc55['outbound']);if(_0x457ce1){for(var _0x1248fa=0x0;_0x1248fa<_0x457ce1['length'];_0x1248fa+=0x1){_0x57cc55[_0x4444('0x11')][_0x4444('0x2c')]+=0x1;_0x57cc55[_0x4444('0x11')]['sumDuration']+=_0x457ce1[_0x1248fa][_0x4444('0x5b')];if(_0x457ce1[_0x1248fa][_0x4444('0x5c')]===_0x4444('0x5d')){_0x57cc55['outbound'][_0x4444('0x25')]+=0x1;_0x57cc55[_0x4444('0x11')][_0x4444('0x26')]+=_0x457ce1[_0x1248fa][_0x4444('0x5b')]-_0x457ce1[_0x1248fa][_0x4444('0x5e')]||0x0;_0x57cc55[_0x4444('0x11')]['sumBillable']+=_0x457ce1[_0x1248fa][_0x4444('0x5e')];}}}return _0x57cc55['outbound'];};};Realtime['prototype'][_0x4444('0x5f')]=function(){var _0x56e457=this;return function(_0x4e95df){if(_0x4e95df){freeIsNotKey(_0x4e95df,_0x56e457['campaigns'],_0x4444('0x21'));for(var _0x580035=0x0,_0x5e5951={};_0x580035<_0x4e95df[_0x4444('0x3d')];_0x580035+=0x1){_0x5e5951=_0x4e95df[_0x580035];if(_['isUndefined'](_0x56e457[_0x4444('0x10')][_0x5e5951['name']])){_0x56e457[_0x4444('0x10')][_0x5e5951[_0x4444('0x21')]]=new Campaign(_0x5e5951);}else{_0x56e457[_0x4444('0x39')](_0x56e457[_0x4444('0x10')][_0x5e5951['name']],_0x5e5951);_0x56e457[_0x4444('0x10')][_0x5e5951[_0x4444('0x21')]][_0x4444('0x60')]=_0x5e5951[_0x4444('0x61')]?_0x5e5951[_0x4444('0x61')][_0x4444('0x21')]:undefined;}}}return _0x56e457[_0x4444('0x10')];};};Realtime[_0x4444('0x38')]['initVoiceExtensions']=function(){var _0x3cdb37=this;return function(_0x57b2cd){if(_0x57b2cd){freeIsNotKey(_0x57b2cd,_0x3cdb37[_0x4444('0x12')],'id');for(var _0x34abd0=0x0,_0x54398d={};_0x34abd0<_0x57b2cd[_0x4444('0x3d')];_0x34abd0+=0x1){_0x54398d=_0x57b2cd[_0x34abd0];if(_[_0x4444('0x3a')](_0x3cdb37['voiceExtensions'][_0x54398d['id']])){_0x3cdb37['voiceExtensions'][_0x54398d['id']]=new VoiceExtension(_0x54398d);}else{_0x3cdb37['mergeFromDatabase'](_0x3cdb37['voiceExtensions'][_0x54398d['id']],_0x54398d);}}}return _0x3cdb37[_0x4444('0x12')];};};Realtime[_0x4444('0x38')][_0x4444('0x62')]=function(){var _0x4d1e4d=this;return function(_0x54a913){clearCampaigns(_0x4d1e4d[_0x4444('0x10')]);for(var _0x19fa98=0x0;_0x19fa98<_0x54a913[_0x4444('0x3d')];_0x19fa98+=0x1){_[_0x4444('0x4f')](_0x4d1e4d['campaigns'][_0x54a913[_0x19fa98][_0x4444('0x21')]],_0x54a913[_0x19fa98]);}return _0x4d1e4d[_0x4444('0x10')];};};Realtime[_0x4444('0x38')]['initFaxAccounts']=function(){var _0x2c5ba=this;return function(_0x2bf09a){if(_0x2bf09a){freeIsNotKey(_0x2bf09a,_0x2c5ba[_0x4444('0x1d')],'id');for(var _0x2d0401=0x0,_0x314634={},_0x4e01c9={};_0x2d0401<_0x2bf09a[_0x4444('0x3d')];_0x2d0401+=0x1){_0x314634=_0x2bf09a[_0x2d0401];if(_[_0x4444('0x3a')](_0x2c5ba[_0x4444('0x1d')][_0x314634['id']])){_0x2c5ba[_0x4444('0x1d')][_0x314634['id']]=new FaxAccount(_0x314634);}else{_0x2c5ba['mergeFromDatabase'](_0x2c5ba[_0x4444('0x1d')][_0x314634['id']],_0x314634);}}}return _0x2c5ba[_0x4444('0x1d')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0x8677=['mergeFromDatabase','initAgents','length','isUndefined','initTrunks','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','initVoiceCallReports','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','bluebird','util','moment','../model/telephone','../model/trunk','../model/trigger','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype'];(function(_0x4f503b,_0x20f7ee){var _0x11b97f=function(_0x2bbe69){while(--_0x2bbe69){_0x4f503b['push'](_0x4f503b['shift']());}};_0x11b97f(++_0x20f7ee);}(_0x8677,0x1e2));var _0x7867=function(_0x3526b8,_0x54f4f1){_0x3526b8=_0x3526b8-0x0;var _0x5b3022=_0x8677[_0x3526b8];return _0x5b3022;};'use strict';var BPromise=require(_0x7867('0x0'));var util=require(_0x7867('0x1'));var _=require('lodash');var moment=require(_0x7867('0x2'));var Agent=require('../model/agent');var Telephone=require(_0x7867('0x3'));var Trunk=require(_0x7867('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x7867('0x5'));var Template=require('../model/template');var Campaign=require(_0x7867('0x6'));var VoiceExtension=require(_0x7867('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x7867('0x8'));var FreshdeskAccount=require(_0x7867('0x9'));var SugarcrmAccount=require(_0x7867('0xa'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x7867('0xb'));var VtigerAccount=require(_0x7867('0xc'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x7867('0xd'));var FreshsalesAccount=require(_0x7867('0xe'));var FaxAccount=require(_0x7867('0xf'));var Realtime=function(){this[_0x7867('0x10')]={};this[_0x7867('0x11')]={};this[_0x7867('0x12')]={};this['voiceQueues']={};this[_0x7867('0x13')]={};this[_0x7867('0x14')]={};this[_0x7867('0x15')]={};this[_0x7867('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x7867('0x17')]={};this[_0x7867('0x18')]={};this[_0x7867('0x19')]={};this['outboundChannels']={};this[_0x7867('0x1a')]={};this[_0x7867('0x1b')]={};this[_0x7867('0x1c')]={};this['salesforceAccounts']={};this[_0x7867('0x1d')]={};this['freshdeskAccounts']={};this[_0x7867('0x1e')]={};this[_0x7867('0x1f')]={};this[_0x7867('0x20')]={};this['servicenowAccounts']={};this[_0x7867('0x21')]={};this[_0x7867('0x22')]={};this[_0x7867('0x23')]={};};function freeIsNotKey(_0x52f307,_0x5419b5,_0x26b35e){var _0x5db6ca=_['mapKeys'](_0x52f307,function(_0x1f4f39,_0x1d41fd){return _0x1f4f39[_0x26b35e];});for(var _0x2525e0 in _0x5419b5){if(_0x5419b5[_0x7867('0x24')](_0x2525e0)){if(!_0x5db6ca[_0x2525e0]){delete _0x5419b5[_0x2525e0];}}}}function freeIsNotKeySip(_0x199e6c,_0x5c8b66){var _0x25471a=_[_0x7867('0x25')](_0x199e6c,function(_0x120b52,_0x104936){return util[_0x7867('0x26')](_0x7867('0x27'),_0x120b52[_0x7867('0x28')]);});for(var _0x41004a in _0x5c8b66){if(_0x5c8b66[_0x7867('0x24')](_0x41004a)){if(!_0x25471a[_0x41004a]){delete _0x5c8b66[_0x41004a];}}}}function freeIsNotKeyAgent(_0xa8e14a,_0x1eca9c){var _0x5e02ad=_['mapKeys'](_0xa8e14a,function(_0x311c47,_0x483ccc){var _0x22bbb6=_[_0x7867('0x29')](_0x311c47[_0x7867('0x2a')])?util[_0x7867('0x26')](_0x7867('0x27'),_0x311c47[_0x7867('0x28')]):_0x311c47[_0x7867('0x2a')];return _0x22bbb6;});for(var _0x54fec4 in _0x1eca9c){if(_0x1eca9c[_0x7867('0x24')](_0x54fec4)){if(!_0x5e02ad[_0x54fec4]){delete _0x1eca9c[_0x54fec4];}}}}function clearVoiceCallReports(_0x254558){_0x254558[_0x7867('0x2b')]=0x0;_0x254558[_0x7867('0x2c')]=0x0;_0x254558[_0x7867('0x2d')]=0x0;_0x254558[_0x7867('0x2e')]=0x0;_0x254558[_0x7867('0x2f')]=0x0;}function clearCampaigns(_0x22ff2f){if(!_['isEmpty'](_0x22ff2f)){for(var _0x518f01 in _0x22ff2f){if(_0x22ff2f[_0x7867('0x24')](_0x518f01)){_0x22ff2f[_0x518f01][_0x7867('0x30')]=0x0;_0x22ff2f[_0x518f01][_0x7867('0x31')]=0x0;}}}}function clearVoiceQueues(_0x3547d9){if(!_[_0x7867('0x32')](_0x3547d9)){for(var _0x7f9902 in _0x3547d9){if(_0x3547d9[_0x7867('0x24')](_0x7f9902)){_0x3547d9[_0x7f9902][_0x7867('0x2b')]=0x0;_0x3547d9[_0x7f9902]['answered']=0x0;_0x3547d9[_0x7f9902][_0x7867('0x33')]=0x0;_0x3547d9[_0x7f9902]['abandoned']=0x0;_0x3547d9[_0x7f9902][_0x7867('0x2d')]=0x0;_0x3547d9[_0x7f9902]['sumDuration']=0x0;_0x3547d9[_0x7f9902][_0x7867('0x2f')]=0x0;_0x3547d9[_0x7f9902][_0x7867('0x34')]=0x0;_0x3547d9[_0x7f9902][_0x7867('0x35')]=0x0;_0x3547d9[_0x7f9902][_0x7867('0x36')]=0x0;_0x3547d9[_0x7f9902][_0x7867('0x37')]=0x0;_0x3547d9[_0x7f9902]['outboundNoSuchCallsDay']=0x0;_0x3547d9[_0x7f9902]['outboundUnknownCallsDay']=0x0;_0x3547d9[_0x7f9902][_0x7867('0x38')]=0x0;_0x3547d9[_0x7f9902][_0x7867('0x39')]=0x0;_0x3547d9[_0x7f9902]['outboundBlacklistCallsDay']=0x0;_0x3547d9[_0x7f9902][_0x7867('0x3a')]=0x0;_0x3547d9[_0x7f9902][_0x7867('0x3b')]=0x0;_0x3547d9[_0x7f9902][_0x7867('0x3c')]=0x0;_0x3547d9[_0x7f9902][_0x7867('0x34')]=0x0;_0x3547d9[_0x7f9902]['outboundAnswerCallsDay']=0x0;_0x3547d9[_0x7f9902][_0x7867('0x3d')]=!![];}}}}Realtime[_0x7867('0x3e')][_0x7867('0x3f')]=function(_0x137400,_0x37ff67){for(var _0x4eb9e1 in _0x37ff67){if(_0x137400['hasOwnProperty'](_0x4eb9e1)){_0x137400[_0x4eb9e1]=_0x37ff67[_0x4eb9e1];}}};Realtime['prototype'][_0x7867('0x40')]=function(){var _0x596f7a=this;return function(_0x96a6ca){if(_0x96a6ca){freeIsNotKeyAgent(_0x96a6ca,_0x596f7a[_0x7867('0x10')]);for(var _0x472e9d=0x0,_0x2616e5={},_0x4fa47e={};_0x472e9d<_0x96a6ca[_0x7867('0x41')];_0x472e9d+=0x1){_0x2616e5=_0x96a6ca[_0x472e9d];var _0xbef1cb=_[_0x7867('0x29')](_0x2616e5[_0x7867('0x2a')])?util[_0x7867('0x26')]('SIP/%s',_0x2616e5[_0x7867('0x28')]):_0x2616e5[_0x7867('0x2a')];if(_[_0x7867('0x42')](_0x596f7a[_0x7867('0x10')][_0xbef1cb])){_0x596f7a[_0x7867('0x10')][_0xbef1cb]=new Agent(_0x2616e5);}else{_0x596f7a['mergeFromDatabase'](_0x596f7a[_0x7867('0x10')][_0xbef1cb],_0x2616e5);}}}return _0x596f7a['agents'];};};Realtime['prototype']['initTelephones']=function(){var _0x3d966a=this;return function(_0x31aee2){if(_0x31aee2){freeIsNotKeySip(_0x31aee2,_0x3d966a[_0x7867('0x11')]);for(var _0x4e1117=0x0,_0x4e2513={},_0x5730fc={};_0x4e1117<_0x31aee2[_0x7867('0x41')];_0x4e1117+=0x1){_0x4e2513=_0x31aee2[_0x4e1117];if(_[_0x7867('0x42')](_0x3d966a[_0x7867('0x11')][util[_0x7867('0x26')](_0x7867('0x27'),_0x4e2513[_0x7867('0x28')])])){_0x3d966a[_0x7867('0x11')][util[_0x7867('0x26')](_0x7867('0x27'),_0x4e2513[_0x7867('0x28')])]=new Telephone(_0x4e2513);}else{_0x3d966a['mergeFromDatabase'](_0x3d966a[_0x7867('0x11')][util[_0x7867('0x26')](_0x7867('0x27'),_0x4e2513['name'])],_0x4e2513);}}}return _0x3d966a[_0x7867('0x11')];};};Realtime[_0x7867('0x3e')][_0x7867('0x43')]=function(){var _0x13680a=this;return function(_0x3fdaee){if(_0x3fdaee){freeIsNotKeySip(_0x3fdaee,_0x13680a[_0x7867('0x12')]);for(var _0x68b9bf=0x0,_0x2c04b6={},_0x352ff5={};_0x68b9bf<_0x3fdaee['length'];_0x68b9bf+=0x1){_0x2c04b6=_0x3fdaee[_0x68b9bf];if(_[_0x7867('0x42')](_0x13680a[_0x7867('0x12')][util['format'](_0x7867('0x27'),_0x2c04b6[_0x7867('0x28')])])){_0x13680a['trunks'][util[_0x7867('0x26')](_0x7867('0x27'),_0x2c04b6[_0x7867('0x28')])]=new Trunk(_0x2c04b6);}else{_0x13680a[_0x7867('0x3f')](_0x13680a['trunks'][util[_0x7867('0x26')](_0x7867('0x27'),_0x2c04b6[_0x7867('0x28')])],_0x2c04b6);}}}return _0x13680a[_0x7867('0x12')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x10dd60=this;return function(_0x354bf9){if(_0x354bf9){freeIsNotKey(_0x354bf9,_0x10dd60[_0x7867('0x44')],_0x7867('0x28'));for(var _0x39ca3e=0x0,_0x28624b={},_0x2d703f={};_0x39ca3e<_0x354bf9['length'];_0x39ca3e+=0x1){_0x28624b=_0x354bf9[_0x39ca3e];if(_[_0x7867('0x42')](_0x10dd60[_0x7867('0x44')][_0x28624b[_0x7867('0x28')]])){_0x10dd60[_0x7867('0x44')][_0x28624b[_0x7867('0x28')]]=new VoiceQueue(_0x28624b);}else{_0x10dd60[_0x7867('0x3f')](_0x10dd60['voiceQueues'][_0x28624b[_0x7867('0x28')]],_0x28624b);}}}return _0x10dd60[_0x7867('0x44')];};};Realtime[_0x7867('0x3e')][_0x7867('0x45')]=function(){var _0x274cfd=this;return function(_0x4ab1cc){if(_0x4ab1cc){freeIsNotKey(_0x4ab1cc,_0x274cfd['triggers'],'id');for(var _0x4173bd=0x0,_0x519411={},_0x14371d={};_0x4173bd<_0x4ab1cc[_0x7867('0x41')];_0x4173bd+=0x1){_0x519411=_0x4ab1cc[_0x4173bd];if(_[_0x7867('0x42')](_0x274cfd[_0x7867('0x13')][_0x519411['id']])){_0x274cfd[_0x7867('0x13')][_0x519411['id']]=new Trigger(_0x519411);}else{_0x274cfd[_0x7867('0x3f')](_0x274cfd[_0x7867('0x13')][_0x519411['id']],_0x519411);}}}return _0x274cfd[_0x7867('0x13')];};};Realtime[_0x7867('0x3e')][_0x7867('0x46')]=function(){var _0x51bc7a=this;return function(_0x3947e6){if(_0x3947e6){freeIsNotKey(_0x3947e6,_0x51bc7a['templates'],'id');for(var _0x4d6c20=0x0,_0x5dd295={},_0x41fc3e={};_0x4d6c20<_0x3947e6['length'];_0x4d6c20+=0x1){_0x5dd295=_0x3947e6[_0x4d6c20];if(_[_0x7867('0x42')](_0x51bc7a[_0x7867('0x15')][_0x5dd295['id']])){_0x51bc7a[_0x7867('0x15')][_0x5dd295['id']]=new Template(_0x5dd295);}else{_0x51bc7a[_0x7867('0x3f')](_0x51bc7a[_0x7867('0x15')][_0x5dd295['id']],_0x5dd295);}}}return _0x51bc7a[_0x7867('0x15')];};};Realtime[_0x7867('0x3e')][_0x7867('0x47')]=function(){var _0x502052=this;return function(_0xd7c1ad){if(_0xd7c1ad){freeIsNotKey(_0xd7c1ad,_0x502052[_0x7867('0x1c')],'id');for(var _0x5ed0c6=0x0,_0x14f211={},_0x75df01={};_0x5ed0c6<_0xd7c1ad[_0x7867('0x41')];_0x5ed0c6+=0x1){_0x14f211=_0xd7c1ad[_0x5ed0c6];if(_['isUndefined'](_0x502052[_0x7867('0x1c')][_0x14f211['id']])){_0x502052[_0x7867('0x1c')][_0x14f211['id']]=new ZendeskAccount(_0x14f211);}else{_0x502052[_0x7867('0x3f')](_0x502052['zendeskAccounts'][_0x14f211['id']],_0x14f211);}}}return _0x502052['zendeskAccounts'];};};Realtime['prototype'][_0x7867('0x48')]=function(){var _0x4019fc=this;return function(_0x53b520){if(_0x53b520){freeIsNotKey(_0x53b520,_0x4019fc[_0x7867('0x49')],'id');for(var _0x4907e1=0x0,_0x112ba1={},_0x5b4d68={};_0x4907e1<_0x53b520['length'];_0x4907e1+=0x1){_0x112ba1=_0x53b520[_0x4907e1];if(_[_0x7867('0x42')](_0x4019fc[_0x7867('0x49')][_0x112ba1['id']])){_0x4019fc['salesforceAccounts'][_0x112ba1['id']]=new SalesforceAccount(_0x112ba1);}else{_0x4019fc['mergeFromDatabase'](_0x4019fc[_0x7867('0x49')][_0x112ba1['id']],_0x112ba1);}}}return _0x4019fc[_0x7867('0x49')];};};Realtime['prototype'][_0x7867('0x4a')]=function(){var _0x1f8ec5=this;return function(_0x3de4e7){if(_0x3de4e7){freeIsNotKey(_0x3de4e7,_0x1f8ec5[_0x7867('0x4b')],'id');for(var _0x138909=0x0,_0x51fafa={},_0x2f7d0e={};_0x138909<_0x3de4e7[_0x7867('0x41')];_0x138909+=0x1){_0x51fafa=_0x3de4e7[_0x138909];if(_[_0x7867('0x42')](_0x1f8ec5['freshdeskAccounts'][_0x51fafa['id']])){_0x1f8ec5[_0x7867('0x4b')][_0x51fafa['id']]=new FreshdeskAccount(_0x51fafa);}else{_0x1f8ec5[_0x7867('0x3f')](_0x1f8ec5[_0x7867('0x4b')][_0x51fafa['id']],_0x51fafa);}}}return _0x1f8ec5[_0x7867('0x4b')];};};Realtime['prototype'][_0x7867('0x4c')]=function(){var _0x44be26=this;return function(_0x238b67){if(_0x238b67){freeIsNotKey(_0x238b67,_0x44be26['zohoAccounts'],'id');for(var _0x3d45c0=0x0,_0x1605f4={},_0x1b5fe6={};_0x3d45c0<_0x238b67[_0x7867('0x41')];_0x3d45c0+=0x1){_0x1605f4=_0x238b67[_0x3d45c0];if(_[_0x7867('0x42')](_0x44be26[_0x7867('0x1e')][_0x1605f4['id']])){_0x44be26[_0x7867('0x1e')][_0x1605f4['id']]=new ZohoAccount(_0x1605f4);}else{_0x44be26[_0x7867('0x3f')](_0x44be26['zohoAccounts'][_0x1605f4['id']],_0x1605f4);}}}return _0x44be26[_0x7867('0x1e')];};};Realtime[_0x7867('0x3e')][_0x7867('0x4d')]=function(){var _0x17bc10=this;return function(_0x3b1424){if(_0x3b1424){freeIsNotKey(_0x3b1424,_0x17bc10['deskAccounts'],'id');for(var _0x4458f7=0x0,_0x16f51d={},_0x8bb070={};_0x4458f7<_0x3b1424['length'];_0x4458f7+=0x1){_0x16f51d=_0x3b1424[_0x4458f7];if(_[_0x7867('0x42')](_0x17bc10['deskAccounts'][_0x16f51d['id']])){_0x17bc10[_0x7867('0x1f')][_0x16f51d['id']]=new DeskAccount(_0x16f51d);}else{_0x17bc10[_0x7867('0x3f')](_0x17bc10[_0x7867('0x1f')][_0x16f51d['id']],_0x16f51d);}}}return _0x17bc10[_0x7867('0x1f')];};};Realtime[_0x7867('0x3e')][_0x7867('0x4e')]=function(){var _0x569ed0=this;return function(_0x432d58){if(_0x432d58){freeIsNotKey(_0x432d58,_0x569ed0['sugarcrmAccounts'],'id');for(var _0x3bcc9e=0x0,_0x57822c={},_0x1c50cd={};_0x3bcc9e<_0x432d58[_0x7867('0x41')];_0x3bcc9e+=0x1){_0x57822c=_0x432d58[_0x3bcc9e];if(_['isUndefined'](_0x569ed0['sugarcrmAccounts'][_0x57822c['id']])){_0x569ed0[_0x7867('0x1d')][_0x57822c['id']]=new SugarcrmAccount(_0x57822c);}else{_0x569ed0[_0x7867('0x3f')](_0x569ed0[_0x7867('0x1d')][_0x57822c['id']],_0x57822c);}}}return _0x569ed0[_0x7867('0x1d')];};};Realtime[_0x7867('0x3e')][_0x7867('0x4f')]=function(){var _0x4d6f80=this;return function(_0x346393){if(_0x346393){freeIsNotKey(_0x346393,_0x4d6f80[_0x7867('0x20')],'id');for(var _0x462544=0x0,_0x242996={},_0xa4dd0b={};_0x462544<_0x346393['length'];_0x462544+=0x1){_0x242996=_0x346393[_0x462544];if(_['isUndefined'](_0x4d6f80['vtigerAccounts'][_0x242996['id']])){_0x4d6f80[_0x7867('0x20')][_0x242996['id']]=new VtigerAccount(_0x242996);}else{_0x4d6f80[_0x7867('0x3f')](_0x4d6f80[_0x7867('0x20')][_0x242996['id']],_0x242996);}}}return _0x4d6f80['vtigerAccounts'];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x3830ec=this;return function(_0x1d49b4){if(_0x1d49b4){freeIsNotKey(_0x1d49b4,_0x3830ec[_0x7867('0x50')],'id');for(var _0x13970c=0x0,_0x36ac0d={},_0x363d88={};_0x13970c<_0x1d49b4[_0x7867('0x41')];_0x13970c+=0x1){_0x36ac0d=_0x1d49b4[_0x13970c];if(_[_0x7867('0x42')](_0x3830ec[_0x7867('0x50')][_0x36ac0d['id']])){_0x3830ec[_0x7867('0x50')][_0x36ac0d['id']]=new ServicenowAccount(_0x36ac0d);}else{_0x3830ec[_0x7867('0x3f')](_0x3830ec[_0x7867('0x50')][_0x36ac0d['id']],_0x36ac0d);}}}return _0x3830ec[_0x7867('0x50')];};};Realtime[_0x7867('0x3e')][_0x7867('0x51')]=function(){var _0x35c743=this;return function(_0x5a0644){if(_0x5a0644){freeIsNotKey(_0x5a0644,_0x35c743[_0x7867('0x21')],'id');for(var _0x15c115=0x0,_0x1d3ebf={},_0x4f3753={};_0x15c115<_0x5a0644[_0x7867('0x41')];_0x15c115+=0x1){_0x1d3ebf=_0x5a0644[_0x15c115];if(_['isUndefined'](_0x35c743[_0x7867('0x21')][_0x1d3ebf['id']])){_0x35c743['dynamics365Accounts'][_0x1d3ebf['id']]=new Dynamics365Account(_0x1d3ebf);}else{_0x35c743[_0x7867('0x3f')](_0x35c743['dynamics365Accounts'][_0x1d3ebf['id']],_0x1d3ebf);}}}return _0x35c743[_0x7867('0x21')];};};Realtime[_0x7867('0x3e')][_0x7867('0x52')]=function(){var _0x1487b9=this;return function(_0x2953c0){if(_0x2953c0){freeIsNotKey(_0x2953c0,_0x1487b9[_0x7867('0x22')],'id');for(var _0x31229f=0x0,_0x2871d1={},_0x586311={};_0x31229f<_0x2953c0['length'];_0x31229f+=0x1){_0x2871d1=_0x2953c0[_0x31229f];if(_[_0x7867('0x42')](_0x1487b9['freshsalesAccounts'][_0x2871d1['id']])){_0x1487b9['freshsalesAccounts'][_0x2871d1['id']]=new FreshsalesAccount(_0x2871d1);}else{_0x1487b9[_0x7867('0x3f')](_0x1487b9[_0x7867('0x22')][_0x2871d1['id']],_0x2871d1);}}}return _0x1487b9['freshsalesAccounts'];};};Realtime[_0x7867('0x3e')][_0x7867('0x53')]=function(){var _0x43e1b1=this;return function(_0x3d2d8d){for(var _0x43719b=0x0;_0x43719b<_0x3d2d8d[_0x7867('0x41')];_0x43719b+=0x1){_['merge'](_0x43e1b1[_0x7867('0x44')][_0x3d2d8d[_0x43719b][_0x7867('0x28')]],_0x3d2d8d[_0x43719b]);}return _0x43e1b1[_0x7867('0x44')];};};Realtime['prototype'][_0x7867('0x54')]=function(){var _0x2e28ee=this;return function(_0x136ae1){clearVoiceQueues(_0x2e28ee[_0x7867('0x44')]);if(_0x136ae1){_0x136ae1=_[_0x7867('0x55')](_0x136ae1,_0x7867('0x56'));for(var _0x551a71 in _0x136ae1){if(_0x136ae1['hasOwnProperty'](_0x551a71)){var _0x45a873={};for(var _0x15fd2a=0x0;_0x15fd2a<_0x136ae1[_0x551a71][_0x7867('0x41')];_0x15fd2a+=0x1){var _0x250894=_0x136ae1[_0x551a71][_0x15fd2a][_0x7867('0x57')];if(_0x2e28ee[_0x7867('0x44')][_0x250894]){if(_0x136ae1[_0x551a71][_0x15fd2a][_0x7867('0x58')]){_0x2e28ee[_0x7867('0x44')][_0x250894][_0x7867('0x33')]+=0x1;}if(_0x136ae1[_0x551a71][_0x15fd2a]['queuecallerabandon']){_0x2e28ee[_0x7867('0x44')][_0x250894][_0x7867('0x59')]+=0x1;}_0x2e28ee[_0x7867('0x44')][_0x250894][_0x7867('0x2d')]+=moment(_0x136ae1[_0x551a71][_0x15fd2a][_0x7867('0x5a')])['diff'](moment(_0x136ae1[_0x551a71][_0x15fd2a][_0x7867('0x5b')]),_0x7867('0x5c'))||0x0;if(_0x15fd2a===_0x136ae1[_0x551a71][_0x7867('0x41')]-0x1){_0x2e28ee[_0x7867('0x44')][_0x250894][_0x7867('0x2e')]+=moment(_0x136ae1[_0x551a71][_0x15fd2a][_0x7867('0x5d')]||_0x136ae1[_0x551a71][_0x15fd2a][_0x7867('0x5e')]||_0x136ae1[_0x551a71][_0x15fd2a][_0x7867('0x5f')])[_0x7867('0x60')](moment(_0x136ae1[_0x551a71][_0x15fd2a][_0x7867('0x5b')]),_0x7867('0x5c'))||0x0;_0x2e28ee[_0x7867('0x44')][_0x250894][_0x7867('0x2b')]+=0x1;if(_0x136ae1[_0x551a71][_0x15fd2a][_0x7867('0x61')]){_0x2e28ee[_0x7867('0x44')][_0x250894]['answered']+=0x1;_0x2e28ee[_0x7867('0x44')][_0x250894][_0x7867('0x2f')]+=moment(_0x136ae1[_0x551a71][_0x15fd2a]['queuecallercompleteAt'])[_0x7867('0x60')](moment(_0x136ae1[_0x551a71][_0x15fd2a][_0x7867('0x5a')]),_0x7867('0x5c'))||0x0;}}else{_0x2e28ee[_0x7867('0x44')][_0x250894][_0x7867('0x2e')]+=_0x2e28ee[_0x7867('0x44')][_0x250894]['sumHoldTime']||0x0;}}}}}}return _0x2e28ee[_0x7867('0x44')];};};Realtime[_0x7867('0x3e')][_0x7867('0x62')]=function(){var _0x8f4b59=this;return function(_0x5510c0){clearVoiceCallReports(_0x8f4b59[_0x7867('0x16')]);if(_0x5510c0){for(var _0x39a494=0x0;_0x39a494<_0x5510c0[_0x7867('0x41')];_0x39a494+=0x1){_0x8f4b59[_0x7867('0x16')]['total']+=0x1;_0x8f4b59['outbound'][_0x7867('0x2e')]+=_0x5510c0[_0x39a494]['duration'];if(_0x5510c0[_0x39a494][_0x7867('0x63')]==='ANSWERED'){_0x8f4b59[_0x7867('0x16')]['answered']+=0x1;_0x8f4b59[_0x7867('0x16')]['sumHoldTime']+=_0x5510c0[_0x39a494]['duration']-_0x5510c0[_0x39a494][_0x7867('0x64')]||0x0;_0x8f4b59['outbound']['sumBillable']+=_0x5510c0[_0x39a494][_0x7867('0x64')];}}}return _0x8f4b59[_0x7867('0x16')];};};Realtime[_0x7867('0x3e')][_0x7867('0x65')]=function(){var _0x5ce962=this;return function(_0xc52031){if(_0xc52031){freeIsNotKey(_0xc52031,_0x5ce962['campaigns'],_0x7867('0x28'));for(var _0x56ce50=0x0,_0x19240d={};_0x56ce50<_0xc52031[_0x7867('0x41')];_0x56ce50+=0x1){_0x19240d=_0xc52031[_0x56ce50];if(_[_0x7867('0x42')](_0x5ce962[_0x7867('0x14')][_0x19240d[_0x7867('0x28')]])){_0x5ce962[_0x7867('0x14')][_0x19240d[_0x7867('0x28')]]=new Campaign(_0x19240d);}else{_0x5ce962[_0x7867('0x3f')](_0x5ce962[_0x7867('0x14')][_0x19240d[_0x7867('0x28')]],_0x19240d);_0x5ce962[_0x7867('0x14')][_0x19240d['name']][_0x7867('0x66')]=_0x19240d['SquareProject']?_0x19240d[_0x7867('0x67')][_0x7867('0x28')]:undefined;}}}return _0x5ce962[_0x7867('0x14')];};};Realtime[_0x7867('0x3e')][_0x7867('0x68')]=function(){var _0x453a8f=this;return function(_0x48bba3){if(_0x48bba3){freeIsNotKey(_0x48bba3,_0x453a8f['voiceExtensions'],'id');for(var _0x1db82e=0x0,_0x26734c={};_0x1db82e<_0x48bba3['length'];_0x1db82e+=0x1){_0x26734c=_0x48bba3[_0x1db82e];if(_[_0x7867('0x42')](_0x453a8f['voiceExtensions'][_0x26734c['id']])){_0x453a8f[_0x7867('0x17')][_0x26734c['id']]=new VoiceExtension(_0x26734c);}else{_0x453a8f[_0x7867('0x3f')](_0x453a8f[_0x7867('0x17')][_0x26734c['id']],_0x26734c);}}}return _0x453a8f[_0x7867('0x17')];};};Realtime[_0x7867('0x3e')][_0x7867('0x69')]=function(){var _0x59538d=this;return function(_0x3f6df3){clearCampaigns(_0x59538d[_0x7867('0x14')]);for(var _0x196634=0x0;_0x196634<_0x3f6df3[_0x7867('0x41')];_0x196634+=0x1){_[_0x7867('0x6a')](_0x59538d[_0x7867('0x14')][_0x3f6df3[_0x196634][_0x7867('0x28')]],_0x3f6df3[_0x196634]);}return _0x59538d['campaigns'];};};Realtime[_0x7867('0x3e')][_0x7867('0x6b')]=function(){var _0x46efed=this;return function(_0x5d7862){if(_0x5d7862){freeIsNotKey(_0x5d7862,_0x46efed['faxAccounts'],'id');for(var _0x21e51d=0x0,_0x132949={},_0x5031c6={};_0x21e51d<_0x5d7862[_0x7867('0x41')];_0x21e51d+=0x1){_0x132949=_0x5d7862[_0x21e51d];if(_['isUndefined'](_0x46efed[_0x7867('0x23')][_0x132949['id']])){_0x46efed[_0x7867('0x23')][_0x132949['id']]=new FaxAccount(_0x132949);}else{_0x46efed['mergeFromDatabase'](_0x46efed[_0x7867('0x23')][_0x132949['id']],_0x132949);}}}return _0x46efed[_0x7867('0x23')];};};module[_0x7867('0x6c')]=Realtime;
\ No newline at end of file
index f3541a1..d13934f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd779=['exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','isArray','forEach','substring','indexOf','mobile','phone','lastIndexOf','attendedTransfer','exports','moment','../../../config/environment','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','agents','telephones','prototype','sync','realtime','xdr','disabled','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','findAgent','find','accountcode','name','isNil','interface','format','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','destination'];(function(_0x9077a3,_0x4d77c3){var _0x157afb=function(_0x49ba86){while(--_0x49ba86){_0x9077a3['push'](_0x9077a3['shift']());}};_0x157afb(++_0x4d77c3);}(_0xd779,0x1bf));var _0x9d77=function(_0x39aff2,_0x1f06c3){_0x39aff2=_0x39aff2-0x0;var _0x4b986c=_0xd779[_0x39aff2];return _0x4b986c;};'use strict';var _=require('lodash');var moment=require(_0x9d77('0x0'));var util=require('util');var config=require(_0x9d77('0x1'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x9d77('0x2'));var RpcMemberReport=require(_0x9d77('0x3'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x9d77('0x4'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x9d77('0x5'));var VoiceCallReport=require(_0x9d77('0x6'));var VoiceAgentReport=require(_0x9d77('0x7'));var VoiceDialReport=require(_0x9d77('0x8'));var UserReport=require('./userReport');function Report(_0x2de85c){this['realtime']=_0x2de85c;this[_0x9d77('0x9')]=_0x2de85c['agents'];this[_0x9d77('0xa')]=_0x2de85c[_0x9d77('0xa')];}Report[_0x9d77('0xb')][_0x9d77('0xc')]=function(_0x4927e5){var _0x2f1e1b=new VoiceQueueReport(this[_0x9d77('0xd')]);var _0x4c8be6=new VoiceAgentReport(this[_0x9d77('0xd')]);var _0x38c176=new VoiceDialReport(this[_0x9d77('0xd')]);var _0x565470=new VoiceCallReport(this[_0x9d77('0xd')]);var _0x4de709=new UserReport(this[_0x9d77('0xd')]);if(config[_0x9d77('0xe')]&&config[_0x9d77('0xe')][_0x9d77('0xf')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0x9d77('0x10')](this));ami['on'](_0x9d77('0x11'),this[_0x9d77('0x12')]['bind'](this));ami['on'](_0x9d77('0x13'),this[_0x9d77('0x14')][_0x9d77('0x10')](this));ami['on'](_0x9d77('0x15'),this[_0x9d77('0x16')][_0x9d77('0x10')](this));ami['on'](_0x9d77('0x17'),this[_0x9d77('0x18')][_0x9d77('0x10')](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x9d77('0x10')](this));}};Report[_0x9d77('0xb')][_0x9d77('0x19')]=function(_0x19835d){var _0x510902;_0x510902=_[_0x9d77('0x1a')](this['agents'],function(_0x1cefef){return _0x1cefef[_0x9d77('0x1b')]==_0x19835d||_0x1cefef[_0x9d77('0x1c')]==_0x19835d;});if(_[_0x9d77('0x1d')](_0x510902)){var _0x3979a3=_['find'](this[_0x9d77('0xa')],function(_0x3379ff){return _0x3379ff[_0x9d77('0x1b')]==_0x19835d||_0x3379ff[_0x9d77('0x1c')]==_0x19835d;});if(_0x3979a3){_0x510902=_[_0x9d77('0x1a')](this[_0x9d77('0x9')],function(_0x257e2e){return _0x257e2e[_0x9d77('0x1e')]==util[_0x9d77('0x1f')]('SIP/%s',_0x3979a3[_0x9d77('0x1c')]);});}}return _0x510902;};Report[_0x9d77('0xb')][_0x9d77('0x20')]=function(_0x59bb44){for(var _0x444b13=0x0;_0x444b13<_0x59bb44[_0x9d77('0x21')];_0x444b13+=0x1){var _0x40b8fa=this[_0x9d77('0x19')](_0x59bb44[_0x444b13][_0x9d77('0x22')]);if(_0x40b8fa){_0x59bb44[_0x444b13][_0x9d77('0x1b')]=_0x40b8fa[_0x9d77('0x1b')];_0x59bb44[_0x444b13][_0x9d77('0x23')]=!![];_0x59bb44[_0x444b13][_0x9d77('0x24')]=_0x40b8fa[_0x9d77('0x1c')];_0x59bb44[_0x444b13][_0x9d77('0x1e')]=_[_0x9d77('0x1d')](_0x40b8fa['interface'])?util[_0x9d77('0x1f')](_0x9d77('0x25'),_0x40b8fa['name']):_0x40b8fa[_0x9d77('0x1e')];if(_0x59bb44[_0x444b13][_0x9d77('0x26')]){_0x59bb44[_0x444b13][_0x9d77('0x27')]=moment()[_0x9d77('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x59bb44[_0x444b13][_0x9d77('0x28')]){_0x59bb44[_0x444b13][_0x9d77('0x29')]=moment()[_0x9d77('0x1f')](_0x9d77('0x2a'));}RpcMemberReport[_0x9d77('0x20')](_0x59bb44[_0x444b13]);}RpcVoiceQueueReport[_0x9d77('0x2b')](_0x59bb44[_0x444b13]);}};function extractCalleridNumber(_0x3082a0){var _0x209296=_0x3082a0['match'](/<(.*?)>/);return _0x209296?_0x209296[0x1]:_0x3082a0;}Report['prototype'][_0x9d77('0x12')]=function(_0x56ace6){_0x56ace6[_0x9d77('0x2c')]=_0x56ace6[_0x9d77('0x2c')]||_0x56ace6[_0x9d77('0x2d')];if(_0x56ace6[_0x9d77('0x2e')]==_0x9d77('0x2f')){_0x56ace6[_0x9d77('0x30')]=_0x9d77('0x31');_0x56ace6[_0x9d77('0x32')]=_0x56ace6[_0x9d77('0x31')];if(_0x56ace6[_0x9d77('0x33')]==_0x9d77('0x34')){_0x56ace6[_0x9d77('0x1b')]='';_0x56ace6[_0x9d77('0x2c')]=extractCalleridNumber(_0x56ace6[_0x9d77('0x35')]);}else if(_0x56ace6[_0x9d77('0x33')]=='from-sip'){if(_0x56ace6[_0x9d77('0x2c')]==_0x9d77('0x36')){_0x56ace6[_0x9d77('0x2c')]=extractCalleridNumber(_0x56ace6[_0x9d77('0x37')]);_0x56ace6[_0x9d77('0x38')]=_0x56ace6[_0x9d77('0x39')];_0x56ace6[_0x9d77('0x3a')]=[_0x56ace6[_0x9d77('0x3b')],_0x56ace6['channel']=_0x56ace6[_0x9d77('0x3a')]][0x0];_0x56ace6[_0x9d77('0x35')]=_0x56ace6[_0x9d77('0x37')];}else{_0x56ace6[_0x9d77('0x2c')]=_0x56ace6['calleridnum'];_0x56ace6[_0x9d77('0x38')]=_0x56ace6[_0x9d77('0x39')];if(_0x56ace6[_0x9d77('0x3c')]==_0x9d77('0x3d')){_0x56ace6['accountcode']=_0x56ace6[_0x9d77('0x22')];}else{_0x56ace6[_0x9d77('0x1b')]='';}}}}else{_0x56ace6[_0x9d77('0x35')]=util[_0x9d77('0x1f')]('\x22%s\x22\x20<%s>',_0x56ace6[_0x9d77('0x3e')],_0x56ace6[_0x9d77('0x38')]);}if(RpcVoiceTransferReport[_0x9d77('0x3f')][_0x56ace6['linkedid']]){var _0x540bfa=RpcVoiceTransferReport[_0x9d77('0x3f')][_0x56ace6[_0x9d77('0x40')]];_0x540bfa[_0x9d77('0x41')]=_0x56ace6[_0x9d77('0x42')];RpcVoiceTransferReport[_0x9d77('0x18')](_0x540bfa);delete RpcVoiceTransferReport[_0x9d77('0x3f')][_0x56ace6['linkedid']];}RpcVoiceCallReport[_0x9d77('0x2b')](_0x56ace6);if(_0x56ace6['monitor']){for(var _0x457f88=0x0;_0x457f88<_0x56ace6[_0x9d77('0x43')]['length'];_0x457f88+=0x1){_0x56ace6[_0x9d77('0x44')]=_0x56ace6[_0x9d77('0x43')][_0x457f88][_0x9d77('0x45')];_0x56ace6[_0x9d77('0x46')]=_0x56ace6['monitors'][_0x457f88][_0x9d77('0x46')];if(_0x56ace6[_0x9d77('0x2d')]==_0x9d77('0x36')){_0x56ace6['calleridnum']=_0x56ace6['connectedlinenum'];_0x56ace6[_0x9d77('0x3e')]=_0x56ace6[_0x9d77('0x47')];_0x56ace6[_0x9d77('0x22')]=_0x56ace6[_0x9d77('0x1b')];_0x56ace6[_0x9d77('0x47')]=_0x56ace6[_0x9d77('0x48')];_0x56ace6[_0x9d77('0x2d')]=_0x56ace6[_0x9d77('0x39')];}else if(_0x56ace6[_0x9d77('0x2d')]=='xcally-motion-dialer'){_0x56ace6['calleridnum']=_0x56ace6[_0x9d77('0x2c')];_0x56ace6[_0x9d77('0x2d')]=_0x56ace6[_0x9d77('0x39')];}RpcVoiceRecording[_0x9d77('0x2b')](_0x56ace6);}}};Report[_0x9d77('0xb')][_0x9d77('0x14')]=function(_0x354d87){if(_[_0x9d77('0x49')](_0x354d87)){_0x354d87[_0x9d77('0x4a')](function(_0x3b139c){RpcVoiceAgentReport[_0x9d77('0x2b')](_0x3b139c);});}else{RpcVoiceAgentReport[_0x9d77('0x2b')](_0x354d87);}};Report[_0x9d77('0xb')][_0x9d77('0x16')]=function(_0x511991){RpcVoiceDialReport[_0x9d77('0x2b')](_0x511991);var _0x2e40ba;var _0x56a5a2;var _0x37bcc1=_0x511991[_0x9d77('0x3b')];if(_['startsWith'](_0x37bcc1,'Local')){_0x56a5a2=_0x37bcc1[_0x9d77('0x4b')](_0x37bcc1[_0x9d77('0x4c')]('/')+0x1,_0x37bcc1[_0x9d77('0x4c')]('@'));_0x2e40ba=_[_0x9d77('0x1a')](this[_0x9d77('0x9')],function(_0x59371c){return _0x59371c[_0x9d77('0x4d')]==_0x56a5a2||_0x59371c[_0x9d77('0x4e')]==_0x56a5a2||_0x59371c[_0x9d77('0x1b')]==_0x56a5a2;});}else{_0x56a5a2=_0x37bcc1['substring'](_0x37bcc1[_0x9d77('0x4c')]('/')+0x1,_0x37bcc1[_0x9d77('0x4f')]('-'));_0x2e40ba=this['findAgent'](_0x56a5a2);}if(_0x2e40ba){_0x511991[_0x9d77('0x1e')]=_['isNil'](_0x2e40ba[_0x9d77('0x1e')])?util[_0x9d77('0x1f')](_0x9d77('0x25'),_0x2e40ba[_0x9d77('0x1c')]):_0x2e40ba[_0x9d77('0x1e')];_0x511991[_0x9d77('0x48')]=_0x2e40ba[_0x9d77('0x1c')];_0x511991['accountcode']=_0x2e40ba[_0x9d77('0x1b')];RpcMemberReport[_0x9d77('0x16')](_0x511991);}};Report[_0x9d77('0xb')][_0x9d77('0x18')]=function(_0x4acda2){RpcVoiceTransferReport[_0x9d77('0x3f')][_0x4acda2['transfererlinkedid']]=_0x4acda2;};Report['prototype'][_0x9d77('0x50')]=function(_0x291263){RpcVoiceTransferReport[_0x9d77('0x50')](_0x291263);};module[_0x9d77('0x51')]=Report;
\ No newline at end of file
+var _0xcb60=['blindtransfer','blindTransfer','accountcode','name','isNil','find','interface','SIP/%s','voiceQueueReport','length','findAgent','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','destination','exten','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','monitor','monitorFilename','filename','createdAt','calleridname','connectedlinename','xcally-motion-dialer','isArray','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','membername','transfererlinkedid','lodash','moment','util','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb60,0xe6));var _0x0cb6=function(_0x17bb31,_0x2fc6f8){_0x17bb31=_0x17bb31-0x0;var _0x505c71=_0xcb60[_0x17bb31];return _0x505c71;};'use strict';var _=require(_0x0cb6('0x0'));var moment=require(_0x0cb6('0x1'));var util=require(_0x0cb6('0x2'));var config=require('../../../config/environment');var ami=require(_0x0cb6('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x0cb6('0x4'));var RpcVoiceDialReport=require(_0x0cb6('0x5'));var RpcMemberReport=require(_0x0cb6('0x6'));var RpcVoiceQueueReport=require(_0x0cb6('0x7'));var RpcVoiceRecording=require(_0x0cb6('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x0cb6('0x9'));var VoiceCallReport=require(_0x0cb6('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x0cb6('0xb'));function Report(_0x2d943a){this[_0x0cb6('0xc')]=_0x2d943a;this[_0x0cb6('0xd')]=_0x2d943a[_0x0cb6('0xd')];this[_0x0cb6('0xe')]=_0x2d943a[_0x0cb6('0xe')];}Report[_0x0cb6('0xf')][_0x0cb6('0x10')]=function(_0xa8d70d){var _0x5bd8d4=new VoiceQueueReport(this['realtime']);var _0x426e71=new VoiceAgentReport(this['realtime']);var _0x54a868=new VoiceDialReport(this[_0x0cb6('0xc')]);var _0x3853b0=new VoiceCallReport(this[_0x0cb6('0xc')]);var _0x26e576=new UserReport(this['realtime']);if(config[_0x0cb6('0x11')]&&config[_0x0cb6('0x11')]['disabled']){ami['on']('custom:voiceQueueReport',this['voiceQueueReport']['bind'](this));ami['on'](_0x0cb6('0x12'),this[_0x0cb6('0x13')][_0x0cb6('0x14')](this));ami['on'](_0x0cb6('0x15'),this[_0x0cb6('0x16')][_0x0cb6('0x14')](this));ami['on'](_0x0cb6('0x17'),this[_0x0cb6('0x18')][_0x0cb6('0x14')](this));ami['on'](_0x0cb6('0x19'),this[_0x0cb6('0x1a')]['bind'](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x0cb6('0x14')](this));}};Report[_0x0cb6('0xf')]['findAgent']=function(_0x123112){var _0x3f52a6;_0x3f52a6=_['find'](this[_0x0cb6('0xd')],function(_0x76386f){return _0x76386f[_0x0cb6('0x1b')]==_0x123112||_0x76386f[_0x0cb6('0x1c')]==_0x123112;});if(_[_0x0cb6('0x1d')](_0x3f52a6)){var _0x326ade=_[_0x0cb6('0x1e')](this[_0x0cb6('0xe')],function(_0x729f71){return _0x729f71[_0x0cb6('0x1b')]==_0x123112||_0x729f71['name']==_0x123112;});if(_0x326ade){_0x3f52a6=_[_0x0cb6('0x1e')](this[_0x0cb6('0xd')],function(_0x267f8b){return _0x267f8b[_0x0cb6('0x1f')]==util['format'](_0x0cb6('0x20'),_0x326ade[_0x0cb6('0x1c')]);});}}return _0x3f52a6;};Report[_0x0cb6('0xf')][_0x0cb6('0x21')]=function(_0x1a6034){for(var _0x32d75d=0x0;_0x32d75d<_0x1a6034[_0x0cb6('0x22')];_0x32d75d+=0x1){var _0x261187=this[_0x0cb6('0x23')](_0x1a6034[_0x32d75d][_0x0cb6('0x24')]);if(_0x261187){_0x1a6034[_0x32d75d][_0x0cb6('0x1b')]=_0x261187[_0x0cb6('0x1b')];_0x1a6034[_0x32d75d][_0x0cb6('0x25')]=!![];_0x1a6034[_0x32d75d][_0x0cb6('0x26')]=_0x261187[_0x0cb6('0x1c')];_0x1a6034[_0x32d75d][_0x0cb6('0x1f')]=_['isNil'](_0x261187['interface'])?util['format']('SIP/%s',_0x261187[_0x0cb6('0x1c')]):_0x261187['interface'];if(_0x1a6034[_0x32d75d][_0x0cb6('0x27')]){_0x1a6034[_0x32d75d][_0x0cb6('0x28')]=moment()[_0x0cb6('0x29')](_0x0cb6('0x2a'));}if(_0x1a6034[_0x32d75d][_0x0cb6('0x2b')]){_0x1a6034[_0x32d75d]['queuecallerexitAt']=moment()[_0x0cb6('0x29')](_0x0cb6('0x2a'));}RpcMemberReport['voiceQueueReport'](_0x1a6034[_0x32d75d]);}RpcVoiceQueueReport[_0x0cb6('0x2c')](_0x1a6034[_0x32d75d]);}};function extractCalleridNumber(_0x10b3fc){var _0x53cfb4=_0x10b3fc[_0x0cb6('0x2d')](/<(.*?)>/);return _0x53cfb4?_0x53cfb4[0x1]:_0x10b3fc;}Report['prototype']['voiceCallReport']=function(_0x53efa1){_0x53efa1[_0x0cb6('0x2e')]=_0x53efa1[_0x0cb6('0x2e')]||_0x53efa1[_0x0cb6('0x2f')];if(_0x53efa1['type']==_0x0cb6('0x30')){_0x53efa1[_0x0cb6('0x31')]=_0x0cb6('0x32');_0x53efa1[_0x0cb6('0x33')]=_0x53efa1['queue'];if(_0x53efa1[_0x0cb6('0x34')]==_0x0cb6('0x35')){_0x53efa1['accountcode']='';_0x53efa1[_0x0cb6('0x2e')]=extractCalleridNumber(_0x53efa1[_0x0cb6('0x36')]);}else if(_0x53efa1['context']==_0x0cb6('0x37')){if(_0x53efa1['destination']==_0x0cb6('0x38')){_0x53efa1[_0x0cb6('0x2e')]=extractCalleridNumber(_0x53efa1[_0x0cb6('0x39')]);_0x53efa1[_0x0cb6('0x3a')]=_0x53efa1[_0x0cb6('0x3b')];_0x53efa1[_0x0cb6('0x3c')]=[_0x53efa1[_0x0cb6('0x3d')],_0x53efa1[_0x0cb6('0x3d')]=_0x53efa1[_0x0cb6('0x3c')]][0x0];_0x53efa1[_0x0cb6('0x36')]=_0x53efa1[_0x0cb6('0x39')];}else{_0x53efa1[_0x0cb6('0x2e')]=_0x53efa1[_0x0cb6('0x3a')];_0x53efa1[_0x0cb6('0x3a')]=_0x53efa1[_0x0cb6('0x3b')];if(_0x53efa1['disposition']==_0x0cb6('0x3e')){_0x53efa1[_0x0cb6('0x1b')]=_0x53efa1[_0x0cb6('0x24')];}else{_0x53efa1[_0x0cb6('0x1b')]='';}}}}else{_0x53efa1[_0x0cb6('0x36')]=util[_0x0cb6('0x29')](_0x0cb6('0x3f'),_0x53efa1['calleridname'],_0x53efa1[_0x0cb6('0x3a')]);}if(RpcVoiceTransferReport[_0x0cb6('0x40')][_0x53efa1[_0x0cb6('0x41')]]){var _0xf34364=RpcVoiceTransferReport[_0x0cb6('0x40')][_0x53efa1['linkedid']];_0xf34364[_0x0cb6('0x42')]=_0x53efa1[_0x0cb6('0x43')];RpcVoiceTransferReport[_0x0cb6('0x1a')](_0xf34364);delete RpcVoiceTransferReport[_0x0cb6('0x40')][_0x53efa1[_0x0cb6('0x41')]];}RpcVoiceCallReport['create'](_0x53efa1);if(_0x53efa1[_0x0cb6('0x44')]){for(var _0x1579e3=0x0;_0x1579e3<_0x53efa1['monitors'][_0x0cb6('0x22')];_0x1579e3+=0x1){_0x53efa1[_0x0cb6('0x45')]=_0x53efa1['monitors'][_0x1579e3][_0x0cb6('0x46')];_0x53efa1[_0x0cb6('0x47')]=_0x53efa1['monitors'][_0x1579e3][_0x0cb6('0x47')];if(_0x53efa1[_0x0cb6('0x2f')]==_0x0cb6('0x38')){_0x53efa1[_0x0cb6('0x3a')]=_0x53efa1['connectedlinenum'];_0x53efa1[_0x0cb6('0x48')]=_0x53efa1[_0x0cb6('0x49')];_0x53efa1[_0x0cb6('0x24')]=_0x53efa1[_0x0cb6('0x1b')];_0x53efa1['connectedlinename']=_0x53efa1['membername'];_0x53efa1[_0x0cb6('0x2f')]=_0x53efa1['originatecalleridnum'];}else if(_0x53efa1['exten']==_0x0cb6('0x4a')){_0x53efa1[_0x0cb6('0x3a')]=_0x53efa1[_0x0cb6('0x2e')];_0x53efa1[_0x0cb6('0x2f')]=_0x53efa1[_0x0cb6('0x3b')];}RpcVoiceRecording['create'](_0x53efa1);}}};Report['prototype']['voiceAgentReport']=function(_0x190027){if(_[_0x0cb6('0x4b')](_0x190027)){_0x190027['forEach'](function(_0x255b80){RpcVoiceAgentReport[_0x0cb6('0x2c')](_0x255b80);});}else{RpcVoiceAgentReport[_0x0cb6('0x2c')](_0x190027);}};Report[_0x0cb6('0xf')][_0x0cb6('0x18')]=function(_0x1cc488){RpcVoiceDialReport[_0x0cb6('0x2c')](_0x1cc488);var _0xa9c919;var _0x402e4f;var _0x471165=_0x1cc488['channel'];if(_[_0x0cb6('0x4c')](_0x471165,_0x0cb6('0x4d'))){_0x402e4f=_0x471165[_0x0cb6('0x4e')](_0x471165[_0x0cb6('0x4f')]('/')+0x1,_0x471165[_0x0cb6('0x4f')]('@'));_0xa9c919=_[_0x0cb6('0x1e')](this[_0x0cb6('0xd')],function(_0x24aadf){return _0x24aadf[_0x0cb6('0x50')]==_0x402e4f||_0x24aadf[_0x0cb6('0x51')]==_0x402e4f||_0x24aadf[_0x0cb6('0x1b')]==_0x402e4f;});}else{_0x402e4f=_0x471165['substring'](_0x471165[_0x0cb6('0x4f')]('/')+0x1,_0x471165[_0x0cb6('0x52')]('-'));_0xa9c919=this[_0x0cb6('0x23')](_0x402e4f);}if(_0xa9c919){_0x1cc488[_0x0cb6('0x1f')]=_[_0x0cb6('0x1d')](_0xa9c919[_0x0cb6('0x1f')])?util[_0x0cb6('0x29')]('SIP/%s',_0xa9c919[_0x0cb6('0x1c')]):_0xa9c919['interface'];_0x1cc488[_0x0cb6('0x53')]=_0xa9c919[_0x0cb6('0x1c')];_0x1cc488[_0x0cb6('0x1b')]=_0xa9c919['accountcode'];RpcMemberReport[_0x0cb6('0x18')](_0x1cc488);}};Report[_0x0cb6('0xf')][_0x0cb6('0x1a')]=function(_0x422016){RpcVoiceTransferReport[_0x0cb6('0x40')][_0x422016[_0x0cb6('0x54')]]=_0x422016;};Report[_0x0cb6('0xf')]['attendedTransfer']=function(_0x4c775c){RpcVoiceTransferReport['attendedTransfer'](_0x4c775c);};module['exports']=Report;
\ No newline at end of file
index 7235699..fef3296 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b66=['name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','toLowerCase','stateTime','toNumber','format','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','phone','accountcode','updateStatusRealtime','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','moment','util','ioredis','bluebird','../../../config/environment','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','inspect','find','stateRegistry','omit','event','actionid','state','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4b66,0x6a));var _0x64b6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4b66[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var moment=require(_0x64b6('0x0'));var util=require(_0x64b6('0x1'));var Redis=require(_0x64b6('0x2'));var BPromise=require(_0x64b6('0x3'));var config=require(_0x64b6('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x64b6('0x5'));config[_0x64b6('0x6')]=_['defaults'](config[_0x64b6('0x6')],{'host':_0x64b6('0x7'),'port':0x18eb});var io=require(_0x64b6('0x8'))(new Redis(config[_0x64b6('0x6')]));function UserReport(_0x58eeb9){this[_0x64b6('0x9')]=_0x58eeb9['trunks'];this['agents']=_0x58eeb9[_0x64b6('0xa')];this[_0x64b6('0xb')]=_0x58eeb9['telephones'];ami['on'](_0x64b6('0xc'),this[_0x64b6('0xd')][_0x64b6('0xe')](this));ami['on']('registry',this['syncRegistry'][_0x64b6('0xe')](this));ami['on'](_0x64b6('0xf'),this[_0x64b6('0x10')][_0x64b6('0xe')](this));ami['on'](_0x64b6('0x11'),this['syncPeerStatus'][_0x64b6('0xe')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x64b6('0x12')]()[_0x64b6('0x13')](ami[_0x64b6('0x14')]())[_0x64b6('0x15')](function(_0x533644){logger[_0x64b6('0x16')](_0x64b6('0x17'),util['inspect'](_0x533644,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x64b6('0x12')]()[_0x64b6('0x13')](ami['actionDeviceStateList']())['catch'](function(_0x53aa36){logger[_0x64b6('0x16')](_0x64b6('0x18'),util['inspect'](_0x53aa36,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x64b6('0x12')]()[_0x64b6('0x13')](ami[_0x64b6('0x19')]())[_0x64b6('0x15')](function(_0x1616ac){logger[_0x64b6('0x16')](_0x64b6('0x1a'),util['inspect'](_0x1616ac,{'showHidden':![],'depth':null}));});}UserReport[_0x64b6('0x1b')][_0x64b6('0x1c')]=function(){setInterval(function(){BPromise[_0x64b6('0x12')]()['then'](showSipRegistrations())['then'](listDeviceStates())[_0x64b6('0x13')](showPeersStatus());},0x32c8);};UserReport[_0x64b6('0x1b')][_0x64b6('0x1d')]=function(_0x4daa67){return _0x4daa67!==null&&!_[_0x64b6('0x1e')](_0x4daa67);};UserReport[_0x64b6('0x1b')]['emit']=function(_0x1b8ab6,_0x41197d,_0x46b2e0){io['to'](_0x1b8ab6)[_0x64b6('0x1f')](_0x41197d,_0x46b2e0);};UserReport[_0x64b6('0x1b')][_0x64b6('0xd')]=function(_0xd01e4){try{if(this[_0x64b6('0x1d')](_0xd01e4)){logger[_0x64b6('0x20')](_0x64b6('0x21'),_0xd01e4[_0x64b6('0x22')],_0xd01e4['state']);logger[_0x64b6('0x23')](_0x64b6('0x24'),util[_0x64b6('0x25')](_0xd01e4,{'showHidden':![],'depth':null}));var _0x26b8ae=_[_0x64b6('0x26')](this[_0x64b6('0x9')],{'defaultuser':_0xd01e4[_0x64b6('0x22')]});if(_0x26b8ae){_0xd01e4[_0x64b6('0x27')]=_0xd01e4['state'];_['merge'](_0x26b8ae,_[_0x64b6('0x28')](_0xd01e4,[_0x64b6('0x29'),_0x64b6('0x2a'),_0x64b6('0x22'),_0x64b6('0x2b')]));logger['debug'](_0x64b6('0x2c'),util['inspect'](_0x26b8ae,{'showHidden':![],'depth':null}));this[_0x64b6('0x1f')](util['format'](_0x64b6('0x2d'),_0x26b8ae[_0x64b6('0x2e')]),_0x64b6('0x2f'),_0x26b8ae);}}}catch(_0x40115a){logger['error']('[userReport][registry]',util[_0x64b6('0x25')](_0x40115a,{'showHidden':![],'depth':null}));}};UserReport[_0x64b6('0x1b')][_0x64b6('0x10')]=function(_0x2b0428){try{if(this[_0x64b6('0x1d')](_0x2b0428)){logger[_0x64b6('0x20')](_0x64b6('0x30'),_0x2b0428['device'],_0x2b0428['state']);logger[_0x64b6('0x23')](_0x64b6('0x31'),util[_0x64b6('0x25')](_0x2b0428,{'showHidden':![],'depth':null}));if(this[_0x64b6('0xa')][_0x2b0428[_0x64b6('0x32')]]){if(!this[_0x64b6('0xa')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x33')]||_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]()=='inuse'){this[_0x64b6('0xa')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x33')]=![];if(this[_0x64b6('0xa')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x2b')]!==_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]()){this[_0x64b6('0xa')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x35')]=_[_0x64b6('0x36')](moment()[_0x64b6('0x37')]('x'));}this['agents'][_0x2b0428[_0x64b6('0x32')]]['state']=_0x2b0428['state'][_0x64b6('0x34')]();this['agents'][_0x2b0428[_0x64b6('0x32')]]['updateStatusRealtime'](_0x2b0428);}}else if(this[_0x64b6('0xb')][_0x2b0428[_0x64b6('0x32')]]){if(this['telephones'][_0x2b0428['device']][_0x64b6('0x2b')]!==_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]()){this['telephones'][_0x2b0428[_0x64b6('0x32')]]['stateTime']=_[_0x64b6('0x36')](moment()[_0x64b6('0x37')]('x'));}this[_0x64b6('0xb')][_0x2b0428[_0x64b6('0x32')]]['state']=_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x64b6('0x25')](this['telephones'][_0x2b0428[_0x64b6('0x32')]],{'showHidden':![],'depth':null}));this[_0x64b6('0x1f')](util[_0x64b6('0x37')](_0x64b6('0x38'),this[_0x64b6('0xb')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x2e')]),_0x64b6('0x39'),this[_0x64b6('0xb')][_0x2b0428[_0x64b6('0x32')]]);}else if(this[_0x64b6('0x9')][_0x2b0428[_0x64b6('0x32')]]){if(this[_0x64b6('0x9')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x2b')]!==_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]()){this[_0x64b6('0x9')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x35')]=_[_0x64b6('0x36')](moment()['format']('x'));}this[_0x64b6('0x9')][_0x2b0428[_0x64b6('0x32')]]['state']=_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]();logger[_0x64b6('0x23')](_0x64b6('0x3a'),util[_0x64b6('0x25')](this[_0x64b6('0x9')][_0x2b0428[_0x64b6('0x32')]],{'showHidden':![],'depth':null}));this[_0x64b6('0x1f')](util[_0x64b6('0x37')](_0x64b6('0x2d'),this[_0x64b6('0x9')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x2e')]),_0x64b6('0x2f'),this[_0x64b6('0x9')][_0x2b0428['device']]);}else if(_[_0x64b6('0x3b')](_0x2b0428[_0x64b6('0x32')],_0x64b6('0x3c'))){var _0x4d7cb8=_0x2b0428[_0x64b6('0x32')];var _0x1f87a0=_0x4d7cb8[_0x64b6('0x3d')](_0x4d7cb8[_0x64b6('0x3e')]('/')+0x1,_0x4d7cb8['indexOf']('@'));var _0x4854ca=_[_0x64b6('0x26')](this['agents'],function(_0x4c7b8b){return _0x4c7b8b[_0x64b6('0x3f')]==_0x1f87a0||_0x4c7b8b[_0x64b6('0x40')]==_0x1f87a0||_0x4c7b8b[_0x64b6('0x41')]==_0x1f87a0;});if(_0x4854ca){if(_0x4854ca[_0x64b6('0x2b')]!==_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]()){_0x4854ca[_0x64b6('0x35')]=_['toNumber'](moment()[_0x64b6('0x37')]('x'));}_0x4854ca[_0x64b6('0x2b')]=_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]();_0x4854ca[_0x64b6('0x33')]=!![];_0x4854ca[_0x64b6('0x42')](_0x2b0428);}}}}catch(_0x1f599d){logger[_0x64b6('0x16')](_0x64b6('0x31'),util[_0x64b6('0x25')](_0x1f599d,{'showHidden':![],'depth':null}));}};UserReport[_0x64b6('0x1b')][_0x64b6('0x43')]=function(_0xbf806f){try{if(this[_0x64b6('0x1d')](_0xbf806f)&&this['isNotNull'](_0xbf806f['peerstatus'])){logger[_0x64b6('0x20')](_0x64b6('0x44'),_0xbf806f[_0x64b6('0x45')],_0xbf806f[_0x64b6('0x46')],_0xbf806f[_0x64b6('0x11')]);logger[_0x64b6('0x23')](_0x64b6('0x47'),util[_0x64b6('0x25')](_0xbf806f,{'showHidden':![],'depth':null}));if(this[_0x64b6('0xa')][_0xbf806f[_0x64b6('0x45')]]){if(!this[_0x64b6('0xa')][_0xbf806f[_0x64b6('0x45')]]['local']||_0xbf806f[_0x64b6('0x11')][_0x64b6('0x34')]()==_0x64b6('0x48')){this[_0x64b6('0xa')][_0xbf806f['peer']][_0x64b6('0x33')]=![];this[_0x64b6('0xa')][_0xbf806f[_0x64b6('0x45')]][_0x64b6('0x49')]=_0xbf806f[_0x64b6('0x11')][_0x64b6('0x34')]();this['agents'][_0xbf806f[_0x64b6('0x45')]][_0x64b6('0x46')]=_0xbf806f[_0x64b6('0x46')];this[_0x64b6('0xa')][_0xbf806f[_0x64b6('0x45')]][_0x64b6('0x42')](_0xbf806f);}}else if(this[_0x64b6('0xb')][_0xbf806f[_0x64b6('0x45')]]){this[_0x64b6('0xb')][_0xbf806f[_0x64b6('0x45')]][_0x64b6('0x49')]=_0xbf806f[_0x64b6('0x11')][_0x64b6('0x34')]();this[_0x64b6('0xb')][_0xbf806f[_0x64b6('0x45')]][_0x64b6('0x46')]=_0xbf806f[_0x64b6('0x46')];logger[_0x64b6('0x23')](_0x64b6('0x4a'),util[_0x64b6('0x25')](this[_0x64b6('0xb')][_0xbf806f[_0x64b6('0x45')]],{'showHidden':![],'depth':null}));this[_0x64b6('0x1f')](util['format']('telephone:%s',this['telephones'][_0xbf806f['peer']][_0x64b6('0x2e')]),_0x64b6('0x39'),this[_0x64b6('0xb')][_0xbf806f[_0x64b6('0x45')]]);}else if(this[_0x64b6('0x9')][_0xbf806f[_0x64b6('0x45')]]){this[_0x64b6('0x9')][_0xbf806f['peer']]['status']=_0xbf806f['peerstatus']['toLowerCase']();this[_0x64b6('0x9')][_0xbf806f['peer']][_0x64b6('0x46')]=_0xbf806f[_0x64b6('0x46')];logger[_0x64b6('0x23')](_0x64b6('0x4b'),util['inspect'](this[_0x64b6('0x9')][_0xbf806f['peer']],{'showHidden':![],'depth':null}));this[_0x64b6('0x1f')](util[_0x64b6('0x37')](_0x64b6('0x2d'),this[_0x64b6('0x9')][_0xbf806f[_0x64b6('0x45')]][_0x64b6('0x2e')]),_0x64b6('0x2f'),this['trunks'][_0xbf806f[_0x64b6('0x45')]]);}}}catch(_0x2d460c){logger[_0x64b6('0x16')](_0x64b6('0x47'),util['inspect'](_0x2d460c,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
+var _0x6de7=['startsWith','Local','substring','indexOf','mobile','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','moment','util','ioredis','bluebird','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','then','actionSipShowRegistry','error','[userReport][sipshowregistry]','inspect','resolve','catch','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isUndefined','emit','username','state','[userReport][registry]','find','stateRegistry','merge','omit','event','debug','format','trunk:%s','name','trunk:save','isNotNull','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','toLowerCase','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','stateTime','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:'];(function(_0x41fc24,_0x58f4bb){var _0x332f27=function(_0x449549){while(--_0x449549){_0x41fc24['push'](_0x41fc24['shift']());}};_0x332f27(++_0x58f4bb);}(_0x6de7,0x195));var _0x76de=function(_0x2b729a,_0x21945a){_0x2b729a=_0x2b729a-0x0;var _0x4a398d=_0x6de7[_0x2b729a];return _0x4a398d;};'use strict';var _=require(_0x76de('0x0'));var moment=require(_0x76de('0x1'));var util=require(_0x76de('0x2'));var Redis=require(_0x76de('0x3'));var BPromise=require(_0x76de('0x4'));var config=require(_0x76de('0x5'));var logger=require('../../../config/logger')(_0x76de('0x6'));var ami=require(_0x76de('0x7'));config[_0x76de('0x8')]=_[_0x76de('0x9')](config[_0x76de('0x8')],{'host':_0x76de('0xa'),'port':0x18eb});var io=require(_0x76de('0xb'))(new Redis(config[_0x76de('0x8')]));function UserReport(_0x83f291){this[_0x76de('0xc')]=_0x83f291[_0x76de('0xc')];this[_0x76de('0xd')]=_0x83f291[_0x76de('0xd')];this[_0x76de('0xe')]=_0x83f291['telephones'];ami['on'](_0x76de('0xf'),this[_0x76de('0x10')]['bind'](this));ami['on'](_0x76de('0x11'),this[_0x76de('0x10')][_0x76de('0x12')](this));ami['on'](_0x76de('0x13'),this[_0x76de('0x14')][_0x76de('0x12')](this));ami['on'](_0x76de('0x15'),this[_0x76de('0x16')][_0x76de('0x12')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise['resolve']()[_0x76de('0x17')](ami[_0x76de('0x18')]())['catch'](function(_0x19b93c){logger[_0x76de('0x19')](_0x76de('0x1a'),util[_0x76de('0x1b')](_0x19b93c,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x76de('0x1c')]()[_0x76de('0x17')](ami['actionDeviceStateList']())[_0x76de('0x1d')](function(_0x9eebb0){logger[_0x76de('0x19')](_0x76de('0x1e'),util['inspect'](_0x9eebb0,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x76de('0x17')](ami[_0x76de('0x1f')]())[_0x76de('0x1d')](function(_0x3936f4){logger[_0x76de('0x19')](_0x76de('0x20'),util[_0x76de('0x1b')](_0x3936f4,{'showHidden':![],'depth':null}));});}UserReport[_0x76de('0x21')][_0x76de('0x22')]=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())['then'](listDeviceStates())[_0x76de('0x17')](showPeersStatus());},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x3521d3){return _0x3521d3!==null&&!_[_0x76de('0x23')](_0x3521d3);};UserReport[_0x76de('0x21')]['emit']=function(_0x5438e0,_0x1badcd,_0x5ac52f){io['to'](_0x5438e0)[_0x76de('0x24')](_0x1badcd,_0x5ac52f);};UserReport[_0x76de('0x21')][_0x76de('0x10')]=function(_0x587c60){try{if(this['isNotNull'](_0x587c60)){logger['info']('[userReport][registry]\x20registry:%s\x20state:%s',_0x587c60[_0x76de('0x25')],_0x587c60[_0x76de('0x26')]);logger['debug'](_0x76de('0x27'),util[_0x76de('0x1b')](_0x587c60,{'showHidden':![],'depth':null}));var _0x279977=_[_0x76de('0x28')](this[_0x76de('0xc')],{'defaultuser':_0x587c60[_0x76de('0x25')]});if(_0x279977){_0x587c60[_0x76de('0x29')]=_0x587c60[_0x76de('0x26')];_[_0x76de('0x2a')](_0x279977,_[_0x76de('0x2b')](_0x587c60,[_0x76de('0x2c'),'actionid',_0x76de('0x25'),_0x76de('0x26')]));logger[_0x76de('0x2d')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x76de('0x1b')](_0x279977,{'showHidden':![],'depth':null}));this[_0x76de('0x24')](util[_0x76de('0x2e')](_0x76de('0x2f'),_0x279977[_0x76de('0x30')]),_0x76de('0x31'),_0x279977);}}}catch(_0x55c949){logger[_0x76de('0x19')]('[userReport][registry]',util[_0x76de('0x1b')](_0x55c949,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x76de('0x14')]=function(_0x5afa87){try{if(this[_0x76de('0x32')](_0x5afa87)){logger[_0x76de('0x33')](_0x76de('0x34'),_0x5afa87['device'],_0x5afa87[_0x76de('0x26')]);logger[_0x76de('0x2d')](_0x76de('0x35'),util[_0x76de('0x1b')](_0x5afa87,{'showHidden':![],'depth':null}));if(this[_0x76de('0xd')][_0x5afa87[_0x76de('0x36')]]){if(!this[_0x76de('0xd')][_0x5afa87[_0x76de('0x36')]][_0x76de('0x37')]||_0x5afa87[_0x76de('0x26')][_0x76de('0x38')]()=='inuse'){this['agents'][_0x5afa87[_0x76de('0x36')]][_0x76de('0x37')]=![];if(this[_0x76de('0xd')][_0x5afa87[_0x76de('0x36')]][_0x76de('0x26')]!==_0x5afa87[_0x76de('0x26')][_0x76de('0x38')]()){this[_0x76de('0xd')][_0x5afa87[_0x76de('0x36')]]['stateTime']=_[_0x76de('0x39')](moment()[_0x76de('0x2e')]('x'));}this[_0x76de('0xd')][_0x5afa87[_0x76de('0x36')]]['state']=_0x5afa87[_0x76de('0x26')][_0x76de('0x38')]();this[_0x76de('0xd')][_0x5afa87['device']][_0x76de('0x3a')](_0x5afa87);}}else if(this['telephones'][_0x5afa87[_0x76de('0x36')]]){if(this[_0x76de('0xe')][_0x5afa87[_0x76de('0x36')]][_0x76de('0x26')]!==_0x5afa87[_0x76de('0x26')][_0x76de('0x38')]()){this[_0x76de('0xe')][_0x5afa87[_0x76de('0x36')]]['stateTime']=_[_0x76de('0x39')](moment()['format']('x'));}this[_0x76de('0xe')][_0x5afa87[_0x76de('0x36')]][_0x76de('0x26')]=_0x5afa87[_0x76de('0x26')]['toLowerCase']();logger[_0x76de('0x2d')](_0x76de('0x3b'),util['inspect'](this['telephones'][_0x5afa87[_0x76de('0x36')]],{'showHidden':![],'depth':null}));this[_0x76de('0x24')](util[_0x76de('0x2e')]('telephone:%s',this['telephones'][_0x5afa87['device']][_0x76de('0x30')]),_0x76de('0x3c'),this[_0x76de('0xe')][_0x5afa87[_0x76de('0x36')]]);}else if(this[_0x76de('0xc')][_0x5afa87[_0x76de('0x36')]]){if(this[_0x76de('0xc')][_0x5afa87['device']][_0x76de('0x26')]!==_0x5afa87[_0x76de('0x26')]['toLowerCase']()){this['trunks'][_0x5afa87[_0x76de('0x36')]][_0x76de('0x3d')]=_[_0x76de('0x39')](moment()[_0x76de('0x2e')]('x'));}this[_0x76de('0xc')][_0x5afa87[_0x76de('0x36')]][_0x76de('0x26')]=_0x5afa87['state'][_0x76de('0x38')]();logger[_0x76de('0x2d')](_0x76de('0x3e'),util['inspect'](this[_0x76de('0xc')][_0x5afa87['device']],{'showHidden':![],'depth':null}));this[_0x76de('0x24')](util[_0x76de('0x2e')](_0x76de('0x2f'),this[_0x76de('0xc')][_0x5afa87[_0x76de('0x36')]][_0x76de('0x30')]),_0x76de('0x31'),this[_0x76de('0xc')][_0x5afa87['device']]);}else if(_[_0x76de('0x3f')](_0x5afa87['device'],_0x76de('0x40'))){var _0x4d9b09=_0x5afa87[_0x76de('0x36')];var _0x216023=_0x4d9b09[_0x76de('0x41')](_0x4d9b09['indexOf']('/')+0x1,_0x4d9b09[_0x76de('0x42')]('@'));var _0x284a00=_[_0x76de('0x28')](this[_0x76de('0xd')],function(_0x3d9729){return _0x3d9729[_0x76de('0x43')]==_0x216023||_0x3d9729['phone']==_0x216023||_0x3d9729[_0x76de('0x44')]==_0x216023;});if(_0x284a00){if(_0x284a00[_0x76de('0x26')]!==_0x5afa87[_0x76de('0x26')][_0x76de('0x38')]()){_0x284a00['stateTime']=_[_0x76de('0x39')](moment()['format']('x'));}_0x284a00[_0x76de('0x26')]=_0x5afa87[_0x76de('0x26')][_0x76de('0x38')]();_0x284a00[_0x76de('0x37')]=!![];_0x284a00[_0x76de('0x3a')](_0x5afa87);}}}}catch(_0x2df688){logger[_0x76de('0x19')]('[userReport][devicestatechange]',util[_0x76de('0x1b')](_0x2df688,{'showHidden':![],'depth':null}));}};UserReport[_0x76de('0x21')][_0x76de('0x16')]=function(_0x253817){try{if(this[_0x76de('0x32')](_0x253817)&&this['isNotNull'](_0x253817['peerstatus'])){logger['info'](_0x76de('0x45'),_0x253817[_0x76de('0x46')],_0x253817[_0x76de('0x47')],_0x253817['peerstatus']);logger[_0x76de('0x2d')](_0x76de('0x48'),util[_0x76de('0x1b')](_0x253817,{'showHidden':![],'depth':null}));if(this[_0x76de('0xd')][_0x253817[_0x76de('0x46')]]){if(!this[_0x76de('0xd')][_0x253817[_0x76de('0x46')]][_0x76de('0x37')]||_0x253817[_0x76de('0x15')]['toLowerCase']()==_0x76de('0x49')){this[_0x76de('0xd')][_0x253817[_0x76de('0x46')]][_0x76de('0x37')]=![];this['agents'][_0x253817['peer']][_0x76de('0x4a')]=_0x253817[_0x76de('0x15')][_0x76de('0x38')]();this[_0x76de('0xd')][_0x253817[_0x76de('0x46')]][_0x76de('0x47')]=_0x253817['address'];this[_0x76de('0xd')][_0x253817['peer']]['updateStatusRealtime'](_0x253817);}}else if(this[_0x76de('0xe')][_0x253817[_0x76de('0x46')]]){this[_0x76de('0xe')][_0x253817[_0x76de('0x46')]]['status']=_0x253817['peerstatus'][_0x76de('0x38')]();this[_0x76de('0xe')][_0x253817['peer']][_0x76de('0x47')]=_0x253817[_0x76de('0x47')];logger[_0x76de('0x2d')](_0x76de('0x4b'),util[_0x76de('0x1b')](this['telephones'][_0x253817[_0x76de('0x46')]],{'showHidden':![],'depth':null}));this[_0x76de('0x24')](util['format'](_0x76de('0x4c'),this[_0x76de('0xe')][_0x253817[_0x76de('0x46')]][_0x76de('0x30')]),_0x76de('0x3c'),this[_0x76de('0xe')][_0x253817['peer']]);}else if(this[_0x76de('0xc')][_0x253817[_0x76de('0x46')]]){this[_0x76de('0xc')][_0x253817[_0x76de('0x46')]][_0x76de('0x4a')]=_0x253817['peerstatus'][_0x76de('0x38')]();this[_0x76de('0xc')][_0x253817[_0x76de('0x46')]][_0x76de('0x47')]=_0x253817[_0x76de('0x47')];logger[_0x76de('0x2d')](_0x76de('0x4d'),util[_0x76de('0x1b')](this[_0x76de('0xc')][_0x253817['peer']],{'showHidden':![],'depth':null}));this[_0x76de('0x24')](util[_0x76de('0x2e')](_0x76de('0x2f'),this[_0x76de('0xc')][_0x253817['peer']][_0x76de('0x30')]),'trunk:save',this['trunks'][_0x253817[_0x76de('0x46')]]);}}}catch(_0x5d5109){logger[_0x76de('0x19')](_0x76de('0x48'),util[_0x76de('0x1b')](_0x5d5109,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
index 0e0e693..62b1606 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5ea=['voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','syncHangup','musiconholdstart','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','uniqueid','isUndefined','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','merge','omit','privilege','inspect','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','error','[%s][voiceAgentReport][agentcalled]','debug','hasOwnProperty','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstatedesc','holdtime','lastevent','connect','routealias','interface','pick','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','agentconnectAt','agentcompleteAt','complete','transfer','talktime','acw','acwtime','acwTimeout','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','custom:voiceAgentReport','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','lodash','moment','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','voiceChannels','channels'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5ea,0x87));var _0xaa5e=function(_0x35b197,_0x3057b0){_0x35b197=_0x35b197-0x0;var _0x33c291=_0xa5ea[_0x35b197];return _0x33c291;};'use strict';var _=require(_0xaa5e('0x0'));var moment=require(_0xaa5e('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xaa5e('0x2'));var logger=require(_0xaa5e('0x3'))(_0xaa5e('0x4'));var ami=require('../ami');config[_0xaa5e('0x5')]=_[_0xaa5e('0x6')](config[_0xaa5e('0x5')],{'host':_0xaa5e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xaa5e('0x5')]));function VoiceAgentReport(_0x221230){this['channels']={};this[_0xaa5e('0x8')]=_0x221230[_0xaa5e('0x9')];this[_0xaa5e('0xa')]=_0x221230[_0xaa5e('0xa')];this['agents']=_0x221230[_0xaa5e('0xb')];this[_0xaa5e('0xc')]={};ami['on']('agentcalled',this[_0xaa5e('0xd')][_0xaa5e('0xe')](this));ami['on'](_0xaa5e('0xf'),this[_0xaa5e('0x10')][_0xaa5e('0xe')](this));ami['on'](_0xaa5e('0x11'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xaa5e('0x12'),this[_0xaa5e('0x13')][_0xaa5e('0xe')](this));ami['on']('agentcomplete',this[_0xaa5e('0x14')][_0xaa5e('0xe')](this));ami['on'](_0xaa5e('0x15'),this[_0xaa5e('0x16')]['bind'](this));ami['on']('hangup',this[_0xaa5e('0x17')][_0xaa5e('0xe')](this));ami['on'](_0xaa5e('0x18'),this['syncMusicOnHoldStart']['bind'](this));ami['on']('musiconholdstop',this[_0xaa5e('0x19')]['bind'](this));ami['on']('attendedtransfer',this[_0xaa5e('0x1a')][_0xaa5e('0xe')](this));ami['on'](_0xaa5e('0x1b'),this[_0xaa5e('0x1c')][_0xaa5e('0xe')](this));}VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x1e')]=function(_0x58ad01,_0x5a4588,_0x28b28c){io['to'](_0x58ad01)[_0xaa5e('0x1e')](_0x5a4588,_0x28b28c);};VoiceAgentReport['prototype'][_0xaa5e('0x1f')]=function(_0x1bb3b7){return _0x1bb3b7!==null&&!_['isUndefined'](_0x1bb3b7);};VoiceAgentReport['prototype'][_0xaa5e('0xd')]=function(_0x10d9c4){try{if(this['isNotNull'](_0x10d9c4)){logger['info'](_0xaa5e('0x20'),_0x10d9c4['uniqueid'],_0x10d9c4[_0xaa5e('0x21')],_0x10d9c4['destuniqueid']);logger['debug']('[%s][voiceAgentReport][agentcalled]\x20event:',_0x10d9c4[_0xaa5e('0x22')],util['inspect'](_0x10d9c4,{'showHidden':![],'depth':null}));if(_[_0xaa5e('0x23')](this[_0xaa5e('0x9')][_0x10d9c4[_0xaa5e('0x22')]])){this['channels'][_0x10d9c4[_0xaa5e('0x22')]]={};}if(_[_0xaa5e('0x23')](this[_0xaa5e('0x9')][_0x10d9c4[_0xaa5e('0x22')]][_0x10d9c4['destuniqueid']])){this[_0xaa5e('0x9')][_0x10d9c4[_0xaa5e('0x22')]][_0x10d9c4[_0xaa5e('0x24')]]={'agentcalledAt':moment()[_0xaa5e('0x25')](_0xaa5e('0x26')),'lastevent':'called','mandatoryDisposition':this[_0xaa5e('0xa')][_0x10d9c4['queue']]?this[_0xaa5e('0xa')][_0x10d9c4[_0xaa5e('0x27')]][_0xaa5e('0x28')]||![]:![],'type':this[_0xaa5e('0xa')][_0x10d9c4[_0xaa5e('0x27')]]?this[_0xaa5e('0xa')][_0x10d9c4[_0xaa5e('0x27')]][_0xaa5e('0x29')]||_0xaa5e('0x2a'):_0xaa5e('0x2a'),'variables':this[_0xaa5e('0xc')][_0x10d9c4[_0xaa5e('0x22')]],'motionChannel':_0xaa5e('0x2b')};}_[_0xaa5e('0x2c')](this[_0xaa5e('0x9')][_0x10d9c4[_0xaa5e('0x22')]][_0x10d9c4[_0xaa5e('0x24')]],_[_0xaa5e('0x2d')](_0x10d9c4,['event',_0xaa5e('0x2e')]));logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x10d9c4[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](this['channels'][_0x10d9c4['uniqueid']][_0x10d9c4[_0xaa5e('0x24')]],{'showHidden':![],'depth':null}));ami[_0xaa5e('0x1e')](_0xaa5e('0x30'),this[_0xaa5e('0x9')][_0x10d9c4['uniqueid']][_0x10d9c4[_0xaa5e('0x24')]]);logger['debug'](_0xaa5e('0x31'),_0x10d9c4[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](this[_0xaa5e('0x9')][_0x10d9c4[_0xaa5e('0x22')]][_0x10d9c4[_0xaa5e('0x24')]],{'showHidden':![],'depth':null}));this[_0xaa5e('0x1e')](util['format'](_0xaa5e('0x32'),_0x10d9c4[_0xaa5e('0x21')]),'user:called',this[_0xaa5e('0x9')][_0x10d9c4[_0xaa5e('0x22')]][_0x10d9c4['destuniqueid']]);}}catch(_0x1dd152){logger[_0xaa5e('0x33')](_0xaa5e('0x34'),_0x10d9c4[_0xaa5e('0x22')],util['inspect'](_0x1dd152,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x10')]=function(_0x50e5b9){try{if(this[_0xaa5e('0x1f')](_0x50e5b9)){if(this[_0xaa5e('0x9')][_0x50e5b9['uniqueid']]){logger[_0xaa5e('0x35')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x50e5b9['uniqueid'],util[_0xaa5e('0x2f')](_0x50e5b9,{'showHidden':![],'depth':null}));for(var _0x21bd9a in this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]]){if(this['channels'][_0x50e5b9[_0xaa5e('0x22')]][_0xaa5e('0x36')](_0x21bd9a)){if(_0x50e5b9[_0xaa5e('0x24')]===_0x21bd9a){logger[_0xaa5e('0x37')](_0xaa5e('0x38'),_0x50e5b9['uniqueid'],_0x50e5b9['membername'],_0x50e5b9['destuniqueid']);this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]['agentconnectAt']=moment()[_0xaa5e('0x25')](_0xaa5e('0x26'));this[_0xaa5e('0x9')][_0x50e5b9['uniqueid']][_0x21bd9a][_0xaa5e('0x39')]=_0x50e5b9[_0xaa5e('0x39')];this['channels'][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x3a')]=_0x50e5b9[_0xaa5e('0x3a')];this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]['destchannelstate']=_0x50e5b9['destchannelstate'];this['channels'][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x3b')]=_0x50e5b9[_0xaa5e('0x3b')];this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]['holdtime']=_0x50e5b9[_0xaa5e('0x3c')];this[_0xaa5e('0x9')][_0x50e5b9['uniqueid']][_0x21bd9a][_0xaa5e('0x3d')]=_0xaa5e('0x3e');if(this[_0xaa5e('0x8')][this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x22')]]){var _0x597960=this[_0xaa5e('0x8')][this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]['uniqueid']]['routealias'];this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x3f')]=_0x597960;_0x50e5b9[_0xaa5e('0x3f')]=_0x597960;}_[_0xaa5e('0x2c')](this[_0xaa5e('0xb')][_0x50e5b9[_0xaa5e('0x40')]],_[_0xaa5e('0x41')](_0x50e5b9,[_0xaa5e('0x27'),'destconnectedlinenum',_0xaa5e('0x3f')]));logger[_0xaa5e('0x35')](_0xaa5e('0x42'),_0x50e5b9['uniqueid'],util[_0xaa5e('0x2f')](this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x50e5b9[_0xaa5e('0x24')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentconnect',this['channels'][_0x50e5b9[_0xaa5e('0x22')]][_0x50e5b9[_0xaa5e('0x24')]]);logger['debug'](_0xaa5e('0x43'),_0x50e5b9[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](this['channels'][_0x50e5b9[_0xaa5e('0x22')]][_0x50e5b9['destuniqueid']],{'showHidden':![],'depth':null}));this[_0xaa5e('0x1e')](util[_0xaa5e('0x25')](_0xaa5e('0x32'),_0x50e5b9[_0xaa5e('0x21')]),_0xaa5e('0x44'),this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x50e5b9[_0xaa5e('0x24')]]);}else if(!this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x11')]&&!this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x45')]){logger['info'](_0xaa5e('0x46'),_0x50e5b9[_0xaa5e('0x22')],this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x21')],_0x21bd9a);this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]['agentringnoanswer']=!![];this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x47')]=moment()[_0xaa5e('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xaa5e('0x9')][_0x50e5b9['uniqueid']][_0x21bd9a][_0xaa5e('0x48')]=_0x50e5b9[_0xaa5e('0x24')];this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]['answeredelsewheremembername']=_0x50e5b9[_0xaa5e('0x21')];this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x3d')]=_0xaa5e('0x49');this['channels'][_0x50e5b9['uniqueid']][_0x21bd9a][_0xaa5e('0x4a')]=_0xaa5e('0x49');logger[_0xaa5e('0x35')](_0xaa5e('0x4b'),_0x50e5b9[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](this[_0xaa5e('0x9')][_0x50e5b9['uniqueid']][_0x21bd9a],{'showHidden':![],'depth':null}));ami['emit']('custom:agentansweredelsewhere',this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]);}}}}}}catch(_0x4512d6){logger['error']('[%s][voiceAgentReport][agentconnect]',_0x50e5b9[_0xaa5e('0x22')],util['inspect'](_0x4512d6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x4c')]=function(_0x92142c){try{if(this[_0xaa5e('0x1f')](_0x92142c)){logger['debug'](_0xaa5e('0x4d'),_0x92142c[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x92142c,{'showHidden':![],'depth':null}));if(this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]]&&this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c[_0xaa5e('0x24')]]){logger[_0xaa5e('0x37')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x92142c[_0xaa5e('0x22')],_0x92142c[_0xaa5e('0x21')],_0x92142c[_0xaa5e('0x24')]);this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c[_0xaa5e('0x24')]][_0xaa5e('0x11')]=!![];this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c[_0xaa5e('0x24')]][_0xaa5e('0x47')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c[_0xaa5e('0x24')]][_0xaa5e('0x3d')]='rejected';this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c[_0xaa5e('0x24')]]['reason']=_0xaa5e('0x4e');logger['debug'](_0xaa5e('0x4f'),_0x92142c['uniqueid'],util['inspect'](this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c[_0xaa5e('0x24')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentringnoanswer',this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c['destuniqueid']]);}}}catch(_0x50502b){logger[_0xaa5e('0x33')](_0xaa5e('0x50'),_0x92142c[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x50502b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x13')]=function(_0x4ea18f){try{if(this[_0xaa5e('0x1f')](_0x4ea18f)){logger[_0xaa5e('0x35')](_0xaa5e('0x51'),_0x4ea18f['uniqueid'],util[_0xaa5e('0x2f')](_0x4ea18f,{'showHidden':![],'depth':null}));if(this['channels'][_0x4ea18f['uniqueid']]){for(var _0x4c1849 in this[_0xaa5e('0x9')][_0x4ea18f[_0xaa5e('0x22')]]){if(this[_0xaa5e('0x9')][_0x4ea18f['uniqueid']][_0xaa5e('0x36')](_0x4c1849)&&!this[_0xaa5e('0x9')][_0x4ea18f[_0xaa5e('0x22')]][_0x4c1849]['agentringnoanswer']&&!this[_0xaa5e('0x9')][_0x4ea18f['uniqueid']][_0x4c1849][_0xaa5e('0x45')]){logger[_0xaa5e('0x37')](_0xaa5e('0x52'),_0x4ea18f[_0xaa5e('0x22')],this[_0xaa5e('0x9')][_0x4ea18f[_0xaa5e('0x22')]][_0x4c1849][_0xaa5e('0x21')],_0x4c1849);this['channels'][_0x4ea18f[_0xaa5e('0x22')]][_0x4c1849][_0xaa5e('0x11')]=!![];this[_0xaa5e('0x9')][_0x4ea18f[_0xaa5e('0x22')]][_0x4c1849]['agentringnoanswerAt']=moment()[_0xaa5e('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xaa5e('0x9')][_0x4ea18f['uniqueid']][_0x4c1849][_0xaa5e('0x3d')]=_0xaa5e('0x53');this[_0xaa5e('0x9')][_0x4ea18f[_0xaa5e('0x22')]][_0x4c1849][_0xaa5e('0x4a')]='abandoned';logger[_0xaa5e('0x35')](_0xaa5e('0x54'),_0x4ea18f[_0xaa5e('0x22')],util['inspect'](this[_0xaa5e('0x9')][_0x4ea18f['uniqueid']][_0x4c1849],{'showHidden':![],'depth':null}));ami[_0xaa5e('0x1e')](_0xaa5e('0x55'),this[_0xaa5e('0x9')][_0x4ea18f[_0xaa5e('0x22')]][_0x4c1849]);}}}}}catch(_0x363e0f){logger['error'](_0xaa5e('0x56'),_0x4ea18f[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x363e0f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')]['syncAgentComplete']=function(_0x291a57){try{if(this[_0xaa5e('0x1f')](_0x291a57)){logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x291a57[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x291a57,{'showHidden':![],'depth':null}));if(this['channels'][_0x291a57[_0xaa5e('0x22')]]){for(var _0x4fdcf6 in this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]]){if(this['channels'][_0x291a57[_0xaa5e('0x22')]][_0xaa5e('0x36')](_0x4fdcf6)){if(this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x57')]&&!this['channels'][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x45')]){logger[_0xaa5e('0x37')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x291a57[_0xaa5e('0x22')],this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x21')],_0x4fdcf6);this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x45')]=!![];this['channels'][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x58')]=moment()[_0xaa5e('0x25')](_0xaa5e('0x26'));this['channels'][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6]['lastevent']=_0xaa5e('0x59');this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x4a')]=_0x291a57[_0xaa5e('0x4a')]==_0xaa5e('0x5a')?'agent':_0x291a57[_0xaa5e('0x4a')];this['channels'][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x5b')]=_0x291a57[_0xaa5e('0x5b')];if(this[_0xaa5e('0xa')][_0x291a57['queue']]&&this[_0xaa5e('0xa')][_0x291a57['queue']][_0xaa5e('0x5c')]){this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x5d')]=this['voiceQueues'][_0x291a57[_0xaa5e('0x27')]][_0xaa5e('0x5e')];this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6]['agentacw']=!![];}this['agents'][_0x291a57[_0xaa5e('0x40')]]=_[_0xaa5e('0x2d')](this['agents'][_0x291a57[_0xaa5e('0x40')]],[_0xaa5e('0x27'),_0xaa5e('0x5f')]);logger[_0xaa5e('0x35')](_0xaa5e('0x60'),_0x291a57['uniqueid'],util['inspect'](this['channels'][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6],{'showHidden':![],'depth':null}));ami[_0xaa5e('0x1e')](_0xaa5e('0x61'),this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6]);logger[_0xaa5e('0x35')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x291a57[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6],{'showHidden':![],'depth':null}));this[_0xaa5e('0x1e')](util[_0xaa5e('0x25')](_0xaa5e('0x32'),_0x291a57['membername']),_0xaa5e('0x62'),this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6]);}}}}}}catch(_0x5ae240){logger[_0xaa5e('0x33')](_0xaa5e('0x63'),_0x291a57[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x5ae240,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x16')]=function(_0x596c07){try{if(this[_0xaa5e('0x1f')](_0x596c07)){logger[_0xaa5e('0x35')](_0xaa5e('0x64'),_0x596c07[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x596c07,{'showHidden':![],'depth':null}));this['addVariable'](_0x596c07[_0xaa5e('0x22')],_[_0xaa5e('0x65')](_0x596c07[_0xaa5e('0x66')])[0x0],_0x596c07[_0xaa5e('0x67')]);if(this['channels'][_0x596c07[_0xaa5e('0x22')]]){for(var _0x14f6ae in this['channels'][_0x596c07[_0xaa5e('0x22')]]){if(this['channels'][_0x596c07[_0xaa5e('0x22')]][_0xaa5e('0x36')](_0x14f6ae)){logger['info'](_0xaa5e('0x68'),_0x596c07[_0xaa5e('0x22')],_0x14f6ae,_['keys'](_0x596c07[_0xaa5e('0x66')])[0x0],_0x596c07['value']);if(_['isUndefined'](this[_0xaa5e('0x9')][_0x596c07[_0xaa5e('0x22')]][_0x14f6ae]['variables'])){this['channels'][_0x596c07[_0xaa5e('0x22')]][_0x14f6ae][_0xaa5e('0xc')]={};}this[_0xaa5e('0x9')][_0x596c07[_0xaa5e('0x22')]][_0x14f6ae][_0xaa5e('0xc')]=this['variables'][_0x596c07['uniqueid']];}}}}}catch(_0x51fa7e){logger['error'](_0xaa5e('0x69'),_0x596c07[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x51fa7e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x6a')]=function(_0x50e43d,_0x190347,_0x24cc05){var _0xd37a43=[_0xaa5e('0x6b'),_0xaa5e('0x6c'),_0xaa5e('0x6d'),_0xaa5e('0x6e'),_0xaa5e('0x6f'),_0xaa5e('0x70'),_0xaa5e('0x71'),_0xaa5e('0x72'),_0xaa5e('0x73'),_0xaa5e('0x74'),_0xaa5e('0x75'),'bridgepvtcallid',_0xaa5e('0x76'),_0xaa5e('0x77'),_0xaa5e('0x78'),'memberlastcall',_0xaa5e('0x21'),_0xaa5e('0x79'),_0xaa5e('0x7a')];if(!_[_0xaa5e('0x7b')](_0x190347)&&!_[_0xaa5e('0x7c')](_0xd37a43,_0x190347)){if(_[_0xaa5e('0x23')](this[_0xaa5e('0xc')][_0x50e43d])){this[_0xaa5e('0xc')][_0x50e43d]={};}this[_0xaa5e('0xc')][_0x50e43d][_0x190347]=_0x24cc05;}};VoiceAgentReport[_0xaa5e('0x1d')]['syncHangup']=function(_0x42ffae){try{if(this[_0xaa5e('0x1f')](_0x42ffae)){logger[_0xaa5e('0x35')]('[%s][voiceAgentReport][hangup]\x20event:',_0x42ffae['uniqueid'],util[_0xaa5e('0x2f')](_0x42ffae,{'showHidden':![],'depth':null}));if(this[_0xaa5e('0x9')][_0x42ffae[_0xaa5e('0x22')]]){for(var _0x29e5c0 in this['channels'][_0x42ffae[_0xaa5e('0x22')]]){if(this[_0xaa5e('0x9')][_0x42ffae[_0xaa5e('0x22')]]['hasOwnProperty'](_0x29e5c0)){if(this['channels'][_0x42ffae[_0xaa5e('0x22')]][_0x29e5c0][_0xaa5e('0x4a')]=='transfer'&&this[_0xaa5e('0x9')][_0x42ffae[_0xaa5e('0x22')]][_0x29e5c0][_0xaa5e('0x45')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x42ffae[_0xaa5e('0x22')],_0x29e5c0);this[_0xaa5e('0x9')][_0x42ffae[_0xaa5e('0x22')]][_0x29e5c0][_0xaa5e('0x58')]=moment()[_0xaa5e('0x25')](_0xaa5e('0x26'));}}}logger[_0xaa5e('0x35')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x42ffae[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_['values'](this[_0xaa5e('0x9')][_0x42ffae['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0xaa5e('0x1e')](_0xaa5e('0x7d'),_[_0xaa5e('0x7e')](this[_0xaa5e('0x9')][_0x42ffae[_0xaa5e('0x22')]]));delete this['channels'][_0x42ffae[_0xaa5e('0x22')]];}if(this['variables'][_0x42ffae['uniqueid']]){delete this[_0xaa5e('0xc')][_0x42ffae['uniqueid']];}}}catch(_0x2b67b0){logger[_0xaa5e('0x33')](_0xaa5e('0x7f'),_0x42ffae[_0xaa5e('0x22')],util['inspect'](_0x2b67b0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x1a')]=function(_0x10cbcc){try{if(this[_0xaa5e('0x1f')](_0x10cbcc)){logger[_0xaa5e('0x35')](_0xaa5e('0x80'),_0x10cbcc['uniqueid'],util[_0xaa5e('0x2f')](_0x10cbcc,{'showHidden':![],'depth':null}));if(this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x81')]]){for(var _0x23a0e6 in this['channels'][_0x10cbcc['transfereeuniqueid']]){if(this[_0xaa5e('0x9')][_0x10cbcc['transfereeuniqueid']][_0xaa5e('0x36')](_0x23a0e6)){if(_0x10cbcc['origtransfereruniqueid']===_0x23a0e6){logger[_0xaa5e('0x37')](_0xaa5e('0x82'),_0x10cbcc[_0xaa5e('0x22')],this['channels'][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x21')],_0x23a0e6);var _0xc00497=moment();this['channels'][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x45')]=!![];this['channels'][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x58')]=moment()[_0xaa5e('0x25')](_0xaa5e('0x26'));this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x3d')]=_0xaa5e('0x59');this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x4a')]=_0xaa5e('0x5a');this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x5b')]=_0xc00497[_0xaa5e('0x83')](this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x57')],_0xaa5e('0x84'));}}}}if(this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x85')]]){var _0x2ebeed=this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x85')]];this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x85')]]=this[_0xaa5e('0x9')][_0x10cbcc['transfereeuniqueid']];this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x81')]]=_0x2ebeed;}}}catch(_0x539864){logger[_0xaa5e('0x33')]('[%s][voiceAgentReport][attendedtransfer]',_0x10cbcc[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x539864,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')]['syncBlindTransfer']=function(_0x378313){try{if(this[_0xaa5e('0x1f')](_0x378313)){logger[_0xaa5e('0x35')](_0xaa5e('0x86'),_0x378313[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x378313,{'showHidden':![],'depth':null}));if(this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]]){for(var _0x31f844 in this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]]){if(this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]][_0xaa5e('0x36')](_0x31f844)){if(_0x378313['transfereruniqueid']===_0x31f844){logger['info'](_0xaa5e('0x87'),_0x378313[_0xaa5e('0x22')],this['channels'][_0x378313[_0xaa5e('0x81')]][_0x31f844]['membername'],_0x31f844);var _0x1d5e33=moment();this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]][_0x31f844][_0xaa5e('0x45')]=!![];this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]][_0x31f844][_0xaa5e('0x58')]=_0x1d5e33;this['channels'][_0x378313[_0xaa5e('0x81')]][_0x31f844][_0xaa5e('0x3d')]=_0xaa5e('0x59');this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]][_0x31f844][_0xaa5e('0x4a')]=_0xaa5e('0x5a');this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]][_0x31f844]['talktime']=_0x1d5e33[_0xaa5e('0x83')](this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]][_0x31f844][_0xaa5e('0x57')],_0xaa5e('0x84'));}}}}}}catch(_0x3c1d0b){logger[_0xaa5e('0x33')](_0xaa5e('0x88'),_0x378313[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x3c1d0b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x89')]=function(_0x15dae5){var _0x28413a='';try{if(this[_0xaa5e('0x1f')](_0x15dae5)){logger[_0xaa5e('0x35')](_0xaa5e('0x8a'),_0x15dae5['uniqueid'],util['inspect'](_0x15dae5,{'showHidden':![],'depth':null}));if(_0x15dae5[_0xaa5e('0x8b')]){_0x28413a=_0x15dae5['channel'][_0xaa5e('0x8c')](0x0,_0x15dae5['channel'][_0xaa5e('0x8d')]('-'));if(this['agents'][_0x28413a]){logger['info'](_0xaa5e('0x8e'),_0x15dae5[_0xaa5e('0x22')],_0x28413a);this[_0xaa5e('0xb')][_0x28413a][_0xaa5e('0x8f')]=!![];}}}}catch(_0x5d7200){logger['error']('[%s][voiceAgentReport][musiconholdstart]',_0x15dae5[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x5d7200,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xaa5e('0x19')]=function(_0xe2bb29){var _0x22bf86='';try{if(this[_0xaa5e('0x1f')](_0xe2bb29)){logger[_0xaa5e('0x35')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0xe2bb29['uniqueid'],util[_0xaa5e('0x2f')](_0xe2bb29,{'showHidden':![],'depth':null}));if(_0xe2bb29[_0xaa5e('0x8b')]){_0x22bf86=_0xe2bb29['channel'][_0xaa5e('0x8c')](0x0,_0xe2bb29[_0xaa5e('0x8b')][_0xaa5e('0x8d')]('-'));if(this[_0xaa5e('0xb')][_0x22bf86]){logger[_0xaa5e('0x37')](_0xaa5e('0x90'),_0xe2bb29[_0xaa5e('0x22')],_0x22bf86);this[_0xaa5e('0xb')][_0x22bf86]['onhold']=![];}}}}catch(_0x15455f){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0xe2bb29['uniqueid'],util[_0xaa5e('0x2f')](_0x15455f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
+var _0x5a2a=['[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','ioredis','../ami','redis','localhost','socket.io-emitter','voiceChannels','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','syncHangup','syncMusicOnHoldStart','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','merge','omit','event','custom:agentcalled','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','routealias','pick','destconnectedlinenum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','agentcomplete','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][agentcomplete]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','transfer','agent','talktime','acwtime','acwTimeout','agentacw','interface','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user: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','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','includes','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','agentcompleteAt','values','custom:voiceAgentReport','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s'];(function(_0x3c9cec,_0x3a38ee){var _0xc3eab5=function(_0x9f9b08){while(--_0x9f9b08){_0x3c9cec['push'](_0x3c9cec['shift']());}};_0xc3eab5(++_0x3a38ee);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x519f3a,_0x8b14cb){_0x519f3a=_0x519f3a-0x0;var _0x417d9a=_0x5a2a[_0x519f3a];return _0x417d9a;};'use strict';var _=require(_0xa5a2('0x0'));var moment=require(_0xa5a2('0x1'));var util=require(_0xa5a2('0x2'));var Redis=require(_0xa5a2('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0xa5a2('0x4'));config[_0xa5a2('0x5')]=_['defaults'](config[_0xa5a2('0x5')],{'host':_0xa5a2('0x6'),'port':0x18eb});var io=require(_0xa5a2('0x7'))(new Redis(config['redis']));function VoiceAgentReport(_0x179722){this['channels']={};this[_0xa5a2('0x8')]=_0x179722[_0xa5a2('0x9')];this[_0xa5a2('0xa')]=_0x179722['voiceQueues'];this['agents']=_0x179722[_0xa5a2('0xb')];this[_0xa5a2('0xc')]={};ami['on'](_0xa5a2('0xd'),this[_0xa5a2('0xe')][_0xa5a2('0xf')](this));ami['on']('agentconnect',this[_0xa5a2('0x10')][_0xa5a2('0xf')](this));ami['on'](_0xa5a2('0x11'),this[_0xa5a2('0x12')][_0xa5a2('0xf')](this));ami['on'](_0xa5a2('0x13'),this[_0xa5a2('0x14')]['bind'](this));ami['on']('agentcomplete',this[_0xa5a2('0x15')][_0xa5a2('0xf')](this));ami['on'](_0xa5a2('0x16'),this[_0xa5a2('0x17')][_0xa5a2('0xf')](this));ami['on']('hangup',this[_0xa5a2('0x18')][_0xa5a2('0xf')](this));ami['on']('musiconholdstart',this[_0xa5a2('0x19')][_0xa5a2('0xf')](this));ami['on']('musiconholdstop',this[_0xa5a2('0x1a')][_0xa5a2('0xf')](this));ami['on']('attendedtransfer',this[_0xa5a2('0x1b')][_0xa5a2('0xf')](this));ami['on'](_0xa5a2('0x1c'),this[_0xa5a2('0x1d')][_0xa5a2('0xf')](this));}VoiceAgentReport[_0xa5a2('0x1e')]['emit']=function(_0x1f4de7,_0x195363,_0x21712b){io['to'](_0x1f4de7)[_0xa5a2('0x1f')](_0x195363,_0x21712b);};VoiceAgentReport[_0xa5a2('0x1e')][_0xa5a2('0x20')]=function(_0x5c600d){return _0x5c600d!==null&&!_[_0xa5a2('0x21')](_0x5c600d);};VoiceAgentReport[_0xa5a2('0x1e')][_0xa5a2('0xe')]=function(_0x1116f8){try{if(this[_0xa5a2('0x20')](_0x1116f8)){logger[_0xa5a2('0x22')](_0xa5a2('0x23'),_0x1116f8[_0xa5a2('0x24')],_0x1116f8[_0xa5a2('0x25')],_0x1116f8[_0xa5a2('0x26')]);logger[_0xa5a2('0x27')](_0xa5a2('0x28'),_0x1116f8[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x1116f8,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['channels'][_0x1116f8['uniqueid']])){this[_0xa5a2('0x9')][_0x1116f8[_0xa5a2('0x24')]]={};}if(_[_0xa5a2('0x21')](this[_0xa5a2('0x9')][_0x1116f8[_0xa5a2('0x24')]][_0x1116f8[_0xa5a2('0x26')]])){this[_0xa5a2('0x9')][_0x1116f8[_0xa5a2('0x24')]][_0x1116f8['destuniqueid']]={'agentcalledAt':moment()[_0xa5a2('0x2a')](_0xa5a2('0x2b')),'lastevent':'called','mandatoryDisposition':this[_0xa5a2('0xa')][_0x1116f8[_0xa5a2('0x2c')]]?this['voiceQueues'][_0x1116f8[_0xa5a2('0x2c')]][_0xa5a2('0x2d')]||![]:![],'type':this[_0xa5a2('0xa')][_0x1116f8[_0xa5a2('0x2c')]]?this['voiceQueues'][_0x1116f8[_0xa5a2('0x2c')]][_0xa5a2('0x2e')]||_0xa5a2('0x2f'):_0xa5a2('0x2f'),'variables':this[_0xa5a2('0xc')][_0x1116f8[_0xa5a2('0x24')]],'motionChannel':_0xa5a2('0x30')};}_[_0xa5a2('0x31')](this[_0xa5a2('0x9')][_0x1116f8[_0xa5a2('0x24')]][_0x1116f8[_0xa5a2('0x26')]],_[_0xa5a2('0x32')](_0x1116f8,[_0xa5a2('0x33'),'privilege']));logger[_0xa5a2('0x27')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x1116f8[_0xa5a2('0x24')],util[_0xa5a2('0x29')](this[_0xa5a2('0x9')][_0x1116f8[_0xa5a2('0x24')]][_0x1116f8['destuniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xa5a2('0x34'),this['channels'][_0x1116f8['uniqueid']][_0x1116f8[_0xa5a2('0x26')]]);logger[_0xa5a2('0x27')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x1116f8[_0xa5a2('0x24')],util[_0xa5a2('0x29')](this[_0xa5a2('0x9')][_0x1116f8['uniqueid']][_0x1116f8['destuniqueid']],{'showHidden':![],'depth':null}));this[_0xa5a2('0x1f')](util[_0xa5a2('0x2a')](_0xa5a2('0x35'),_0x1116f8[_0xa5a2('0x25')]),_0xa5a2('0x36'),this[_0xa5a2('0x9')][_0x1116f8[_0xa5a2('0x24')]][_0x1116f8['destuniqueid']]);}}catch(_0x31e52d){logger[_0xa5a2('0x37')](_0xa5a2('0x38'),_0x1116f8[_0xa5a2('0x24')],util['inspect'](_0x31e52d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa5a2('0x1e')][_0xa5a2('0x10')]=function(_0x47be80){try{if(this[_0xa5a2('0x20')](_0x47be80)){if(this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]]){logger[_0xa5a2('0x27')](_0xa5a2('0x39'),_0x47be80[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x47be80,{'showHidden':![],'depth':null}));for(var _0x2e31c1 in this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]]){if(this[_0xa5a2('0x9')][_0x47be80['uniqueid']]['hasOwnProperty'](_0x2e31c1)){if(_0x47be80['destuniqueid']===_0x2e31c1){logger[_0xa5a2('0x22')](_0xa5a2('0x3a'),_0x47be80[_0xa5a2('0x24')],_0x47be80[_0xa5a2('0x25')],_0x47be80[_0xa5a2('0x26')]);this[_0xa5a2('0x9')][_0x47be80['uniqueid']][_0x2e31c1][_0xa5a2('0x3b')]=moment()[_0xa5a2('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1]['connectedlinename']=_0x47be80[_0xa5a2('0x3c')];this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1][_0xa5a2('0x3d')]=_0x47be80[_0xa5a2('0x3d')];this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1]['destchannelstate']=_0x47be80[_0xa5a2('0x3e')];this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1][_0xa5a2('0x3f')]=_0x47be80['destchannelstatedesc'];this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1]['holdtime']=_0x47be80[_0xa5a2('0x40')];this[_0xa5a2('0x9')][_0x47be80['uniqueid']][_0x2e31c1]['lastevent']='connect';if(this[_0xa5a2('0x8')][this['channels'][_0x47be80['uniqueid']][_0x2e31c1]['uniqueid']]){var _0x4feb11=this['voiceChannels'][this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1]['uniqueid']][_0xa5a2('0x41')];this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1][_0xa5a2('0x41')]=_0x4feb11;_0x47be80[_0xa5a2('0x41')]=_0x4feb11;}_[_0xa5a2('0x31')](this[_0xa5a2('0xb')][_0x47be80['interface']],_[_0xa5a2('0x42')](_0x47be80,[_0xa5a2('0x2c'),_0xa5a2('0x43'),_0xa5a2('0x41')]));logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x47be80[_0xa5a2('0x24')],util['inspect'](this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x47be80[_0xa5a2('0x26')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentconnect',this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x47be80['destuniqueid']]);logger[_0xa5a2('0x27')](_0xa5a2('0x44'),_0x47be80[_0xa5a2('0x24')],util[_0xa5a2('0x29')](this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x47be80[_0xa5a2('0x26')]],{'showHidden':![],'depth':null}));this[_0xa5a2('0x1f')](util[_0xa5a2('0x2a')]('user:%s',_0x47be80['membername']),'user:agentconnect',this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x47be80[_0xa5a2('0x26')]]);}else if(!this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1][_0xa5a2('0x11')]&&!this[_0xa5a2('0x9')][_0x47be80['uniqueid']][_0x2e31c1]['agentcomplete']){logger[_0xa5a2('0x22')](_0xa5a2('0x45'),_0x47be80[_0xa5a2('0x24')],this['channels'][_0x47be80['uniqueid']][_0x2e31c1][_0xa5a2('0x25')],_0x2e31c1);this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1][_0xa5a2('0x11')]=!![];this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1]['agentringnoanswerAt']=moment()[_0xa5a2('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1][_0xa5a2('0x46')]=_0x47be80[_0xa5a2('0x26')];this[_0xa5a2('0x9')][_0x47be80['uniqueid']][_0x2e31c1][_0xa5a2('0x47')]=_0x47be80[_0xa5a2('0x25')];this['channels'][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1][_0xa5a2('0x48')]='answered_elsewhere';this[_0xa5a2('0x9')][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1]['reason']='answered_elsewhere';logger[_0xa5a2('0x27')](_0xa5a2('0x49'),_0x47be80[_0xa5a2('0x24')],util['inspect'](this['channels'][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1],{'showHidden':![],'depth':null}));ami[_0xa5a2('0x1f')](_0xa5a2('0x4a'),this['channels'][_0x47be80[_0xa5a2('0x24')]][_0x2e31c1]);}}}}}}catch(_0x215777){logger[_0xa5a2('0x37')](_0xa5a2('0x4b'),_0x47be80[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x215777,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa5a2('0x1e')][_0xa5a2('0x12')]=function(_0x547981){try{if(this[_0xa5a2('0x20')](_0x547981)){logger['debug'](_0xa5a2('0x4c'),_0x547981[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x547981,{'showHidden':![],'depth':null}));if(this[_0xa5a2('0x9')][_0x547981['uniqueid']]&&this[_0xa5a2('0x9')][_0x547981[_0xa5a2('0x24')]][_0x547981[_0xa5a2('0x26')]]){logger[_0xa5a2('0x22')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x547981[_0xa5a2('0x24')],_0x547981[_0xa5a2('0x25')],_0x547981['destuniqueid']);this[_0xa5a2('0x9')][_0x547981[_0xa5a2('0x24')]][_0x547981[_0xa5a2('0x26')]][_0xa5a2('0x11')]=!![];this['channels'][_0x547981[_0xa5a2('0x24')]][_0x547981[_0xa5a2('0x26')]]['agentringnoanswerAt']=moment()[_0xa5a2('0x2a')](_0xa5a2('0x2b'));this['channels'][_0x547981[_0xa5a2('0x24')]][_0x547981['destuniqueid']][_0xa5a2('0x48')]=_0xa5a2('0x4d');this[_0xa5a2('0x9')][_0x547981[_0xa5a2('0x24')]][_0x547981[_0xa5a2('0x26')]][_0xa5a2('0x4e')]=_0xa5a2('0x4d');logger[_0xa5a2('0x27')](_0xa5a2('0x4f'),_0x547981['uniqueid'],util[_0xa5a2('0x29')](this[_0xa5a2('0x9')][_0x547981[_0xa5a2('0x24')]][_0x547981['destuniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xa5a2('0x50'),this[_0xa5a2('0x9')][_0x547981[_0xa5a2('0x24')]][_0x547981[_0xa5a2('0x26')]]);}}}catch(_0x38b11f){logger[_0xa5a2('0x37')]('[%s][voiceAgentReport][agentringnoanswer]',_0x547981[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x38b11f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa5a2('0x1e')][_0xa5a2('0x14')]=function(_0x3a6160){try{if(this['isNotNull'](_0x3a6160)){logger[_0xa5a2('0x27')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x3a6160[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x3a6160,{'showHidden':![],'depth':null}));if(this['channels'][_0x3a6160[_0xa5a2('0x24')]]){for(var _0x51e33c in this[_0xa5a2('0x9')][_0x3a6160[_0xa5a2('0x24')]]){if(this[_0xa5a2('0x9')][_0x3a6160[_0xa5a2('0x24')]]['hasOwnProperty'](_0x51e33c)&&!this[_0xa5a2('0x9')][_0x3a6160['uniqueid']][_0x51e33c][_0xa5a2('0x11')]&&!this['channels'][_0x3a6160[_0xa5a2('0x24')]][_0x51e33c][_0xa5a2('0x51')]){logger[_0xa5a2('0x22')](_0xa5a2('0x52'),_0x3a6160[_0xa5a2('0x24')],this[_0xa5a2('0x9')][_0x3a6160[_0xa5a2('0x24')]][_0x51e33c]['membername'],_0x51e33c);this['channels'][_0x3a6160[_0xa5a2('0x24')]][_0x51e33c]['agentringnoanswer']=!![];this[_0xa5a2('0x9')][_0x3a6160[_0xa5a2('0x24')]][_0x51e33c][_0xa5a2('0x53')]=moment()[_0xa5a2('0x2a')](_0xa5a2('0x2b'));this[_0xa5a2('0x9')][_0x3a6160['uniqueid']][_0x51e33c][_0xa5a2('0x48')]=_0xa5a2('0x54');this[_0xa5a2('0x9')][_0x3a6160[_0xa5a2('0x24')]][_0x51e33c]['reason']=_0xa5a2('0x54');logger[_0xa5a2('0x27')](_0xa5a2('0x55'),_0x3a6160[_0xa5a2('0x24')],util[_0xa5a2('0x29')](this[_0xa5a2('0x9')][_0x3a6160[_0xa5a2('0x24')]][_0x51e33c],{'showHidden':![],'depth':null}));ami[_0xa5a2('0x1f')]('custom:agentqueuecallerabandon',this[_0xa5a2('0x9')][_0x3a6160['uniqueid']][_0x51e33c]);}}}}}catch(_0x288794){logger['error']('[%s][voiceAgentReport][queuecallerabandon]',_0x3a6160[_0xa5a2('0x24')],util['inspect'](_0x288794,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa5a2('0x1e')][_0xa5a2('0x15')]=function(_0x25bd11){try{if(this[_0xa5a2('0x20')](_0x25bd11)){logger[_0xa5a2('0x27')](_0xa5a2('0x56'),_0x25bd11['uniqueid'],util[_0xa5a2('0x29')](_0x25bd11,{'showHidden':![],'depth':null}));if(this[_0xa5a2('0x9')][_0x25bd11[_0xa5a2('0x24')]]){for(var _0x45f8e9 in this[_0xa5a2('0x9')][_0x25bd11[_0xa5a2('0x24')]]){if(this[_0xa5a2('0x9')][_0x25bd11[_0xa5a2('0x24')]][_0xa5a2('0x57')](_0x45f8e9)){if(this[_0xa5a2('0x9')][_0x25bd11['uniqueid']][_0x45f8e9][_0xa5a2('0x3b')]&&!this[_0xa5a2('0x9')][_0x25bd11[_0xa5a2('0x24')]][_0x45f8e9]['agentcomplete']){logger[_0xa5a2('0x22')](_0xa5a2('0x58'),_0x25bd11[_0xa5a2('0x24')],this[_0xa5a2('0x9')][_0x25bd11[_0xa5a2('0x24')]][_0x45f8e9]['membername'],_0x45f8e9);this[_0xa5a2('0x9')][_0x25bd11[_0xa5a2('0x24')]][_0x45f8e9][_0xa5a2('0x51')]=!![];this[_0xa5a2('0x9')][_0x25bd11['uniqueid']][_0x45f8e9]['agentcompleteAt']=moment()['format'](_0xa5a2('0x2b'));this[_0xa5a2('0x9')][_0x25bd11[_0xa5a2('0x24')]][_0x45f8e9][_0xa5a2('0x48')]=_0xa5a2('0x59');this[_0xa5a2('0x9')][_0x25bd11[_0xa5a2('0x24')]][_0x45f8e9][_0xa5a2('0x4e')]=_0x25bd11[_0xa5a2('0x4e')]==_0xa5a2('0x5a')?_0xa5a2('0x5b'):_0x25bd11[_0xa5a2('0x4e')];this['channels'][_0x25bd11['uniqueid']][_0x45f8e9]['talktime']=_0x25bd11[_0xa5a2('0x5c')];if(this[_0xa5a2('0xa')][_0x25bd11['queue']]&&this['voiceQueues'][_0x25bd11[_0xa5a2('0x2c')]]['acw']){this[_0xa5a2('0x9')][_0x25bd11['uniqueid']][_0x45f8e9][_0xa5a2('0x5d')]=this[_0xa5a2('0xa')][_0x25bd11['queue']][_0xa5a2('0x5e')];this[_0xa5a2('0x9')][_0x25bd11['uniqueid']][_0x45f8e9][_0xa5a2('0x5f')]=!![];}this[_0xa5a2('0xb')][_0x25bd11[_0xa5a2('0x60')]]=_['omit'](this[_0xa5a2('0xb')][_0x25bd11[_0xa5a2('0x60')]],[_0xa5a2('0x2c'),_0xa5a2('0x43')]);logger[_0xa5a2('0x27')](_0xa5a2('0x61'),_0x25bd11[_0xa5a2('0x24')],util[_0xa5a2('0x29')](this[_0xa5a2('0x9')][_0x25bd11[_0xa5a2('0x24')]][_0x45f8e9],{'showHidden':![],'depth':null}));ami[_0xa5a2('0x1f')](_0xa5a2('0x62'),this[_0xa5a2('0x9')][_0x25bd11['uniqueid']][_0x45f8e9]);logger['debug'](_0xa5a2('0x63'),_0x25bd11['uniqueid'],util[_0xa5a2('0x29')](this['channels'][_0x25bd11[_0xa5a2('0x24')]][_0x45f8e9],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xa5a2('0x35'),_0x25bd11['membername']),_0xa5a2('0x64'),this['channels'][_0x25bd11[_0xa5a2('0x24')]][_0x45f8e9]);}}}}}}catch(_0x2ea0ec){logger['error']('[%s][voiceAgentReport][agentcomplete]',_0x25bd11[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x2ea0ec,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa5a2('0x1e')][_0xa5a2('0x17')]=function(_0x471574){try{if(this[_0xa5a2('0x20')](_0x471574)){logger[_0xa5a2('0x27')](_0xa5a2('0x65'),_0x471574[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x471574,{'showHidden':![],'depth':null}));this[_0xa5a2('0x66')](_0x471574['uniqueid'],_[_0xa5a2('0x67')](_0x471574[_0xa5a2('0x68')])[0x0],_0x471574[_0xa5a2('0x69')]);if(this[_0xa5a2('0x9')][_0x471574[_0xa5a2('0x24')]]){for(var _0x2f66d6 in this['channels'][_0x471574[_0xa5a2('0x24')]]){if(this[_0xa5a2('0x9')][_0x471574[_0xa5a2('0x24')]][_0xa5a2('0x57')](_0x2f66d6)){logger[_0xa5a2('0x22')](_0xa5a2('0x6a'),_0x471574[_0xa5a2('0x24')],_0x2f66d6,_[_0xa5a2('0x67')](_0x471574[_0xa5a2('0x68')])[0x0],_0x471574[_0xa5a2('0x69')]);if(_[_0xa5a2('0x21')](this[_0xa5a2('0x9')][_0x471574['uniqueid']][_0x2f66d6][_0xa5a2('0xc')])){this[_0xa5a2('0x9')][_0x471574['uniqueid']][_0x2f66d6][_0xa5a2('0xc')]={};}this['channels'][_0x471574[_0xa5a2('0x24')]][_0x2f66d6][_0xa5a2('0xc')]=this[_0xa5a2('0xc')][_0x471574[_0xa5a2('0x24')]];}}}}}catch(_0x513193){logger['error'](_0xa5a2('0x6b'),_0x471574[_0xa5a2('0x24')],util['inspect'](_0x513193,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa5a2('0x1e')][_0xa5a2('0x66')]=function(_0x5ab82a,_0x1c6517,_0x3004a8){var _0x3a8ee9=[_0xa5a2('0x6c'),_0xa5a2('0x6d'),_0xa5a2('0x6e'),_0xa5a2('0x6f'),_0xa5a2('0x70'),_0xa5a2('0x71'),_0xa5a2('0x72'),_0xa5a2('0x73'),_0xa5a2('0x74'),_0xa5a2('0x75'),'bridgepeer',_0xa5a2('0x76'),_0xa5a2('0x77'),_0xa5a2('0x78'),_0xa5a2('0x79'),_0xa5a2('0x7a'),_0xa5a2('0x25'),_0xa5a2('0x7b'),'memberrealtime'];if(!_['isNil'](_0x1c6517)&&!_[_0xa5a2('0x7c')](_0x3a8ee9,_0x1c6517)){if(_[_0xa5a2('0x21')](this['variables'][_0x5ab82a])){this['variables'][_0x5ab82a]={};}this['variables'][_0x5ab82a][_0x1c6517]=_0x3004a8;}};VoiceAgentReport[_0xa5a2('0x1e')]['syncHangup']=function(_0x41f4cc){try{if(this[_0xa5a2('0x20')](_0x41f4cc)){logger[_0xa5a2('0x27')]('[%s][voiceAgentReport][hangup]\x20event:',_0x41f4cc[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x41f4cc,{'showHidden':![],'depth':null}));if(this[_0xa5a2('0x9')][_0x41f4cc[_0xa5a2('0x24')]]){for(var _0x352706 in this[_0xa5a2('0x9')][_0x41f4cc[_0xa5a2('0x24')]]){if(this[_0xa5a2('0x9')][_0x41f4cc[_0xa5a2('0x24')]][_0xa5a2('0x57')](_0x352706)){if(this['channels'][_0x41f4cc[_0xa5a2('0x24')]][_0x352706][_0xa5a2('0x4e')]=='transfer'&&this[_0xa5a2('0x9')][_0x41f4cc['uniqueid']][_0x352706][_0xa5a2('0x51')]){logger[_0xa5a2('0x22')](_0xa5a2('0x7d'),_0x41f4cc['uniqueid'],_0x352706);this[_0xa5a2('0x9')][_0x41f4cc['uniqueid']][_0x352706][_0xa5a2('0x7e')]=moment()[_0xa5a2('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0xa5a2('0x27')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x41f4cc[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_[_0xa5a2('0x7f')](this[_0xa5a2('0x9')][_0x41f4cc[_0xa5a2('0x24')]]),{'showHidden':![],'depth':null}));ami[_0xa5a2('0x1f')](_0xa5a2('0x80'),_['values'](this[_0xa5a2('0x9')][_0x41f4cc['uniqueid']]));delete this[_0xa5a2('0x9')][_0x41f4cc[_0xa5a2('0x24')]];}if(this[_0xa5a2('0xc')][_0x41f4cc[_0xa5a2('0x24')]]){delete this[_0xa5a2('0xc')][_0x41f4cc['uniqueid']];}}}catch(_0x3b4066){logger[_0xa5a2('0x37')]('[%s][voiceAgentReport][hangup]',_0x41f4cc[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x3b4066,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAttendedTransfer']=function(_0xf1d712){try{if(this['isNotNull'](_0xf1d712)){logger[_0xa5a2('0x27')](_0xa5a2('0x81'),_0xf1d712[_0xa5a2('0x24')],util['inspect'](_0xf1d712,{'showHidden':![],'depth':null}));if(this[_0xa5a2('0x9')][_0xf1d712[_0xa5a2('0x82')]]){for(var _0x31a99b in this[_0xa5a2('0x9')][_0xf1d712[_0xa5a2('0x82')]]){if(this[_0xa5a2('0x9')][_0xf1d712['transfereeuniqueid']][_0xa5a2('0x57')](_0x31a99b)){if(_0xf1d712[_0xa5a2('0x83')]===_0x31a99b){logger['info'](_0xa5a2('0x84'),_0xf1d712[_0xa5a2('0x24')],this['channels'][_0xf1d712[_0xa5a2('0x82')]][_0x31a99b][_0xa5a2('0x25')],_0x31a99b);var _0x4126d5=moment();this[_0xa5a2('0x9')][_0xf1d712[_0xa5a2('0x82')]][_0x31a99b][_0xa5a2('0x51')]=!![];this['channels'][_0xf1d712[_0xa5a2('0x82')]][_0x31a99b][_0xa5a2('0x7e')]=moment()[_0xa5a2('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa5a2('0x9')][_0xf1d712[_0xa5a2('0x82')]][_0x31a99b][_0xa5a2('0x48')]='complete';this['channels'][_0xf1d712[_0xa5a2('0x82')]][_0x31a99b][_0xa5a2('0x4e')]=_0xa5a2('0x5a');this[_0xa5a2('0x9')][_0xf1d712['transfereeuniqueid']][_0x31a99b][_0xa5a2('0x5c')]=_0x4126d5['diff'](this[_0xa5a2('0x9')][_0xf1d712['transfereeuniqueid']][_0x31a99b][_0xa5a2('0x3b')],'seconds');}}}}if(this['channels'][_0xf1d712[_0xa5a2('0x85')]]){var _0x5c26d8=this[_0xa5a2('0x9')][_0xf1d712['secondtransfereruniqueid']];this[_0xa5a2('0x9')][_0xf1d712[_0xa5a2('0x85')]]=this[_0xa5a2('0x9')][_0xf1d712[_0xa5a2('0x82')]];this[_0xa5a2('0x9')][_0xf1d712[_0xa5a2('0x82')]]=_0x5c26d8;}}}catch(_0x2d3320){logger[_0xa5a2('0x37')]('[%s][voiceAgentReport][attendedtransfer]',_0xf1d712[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x2d3320,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa5a2('0x1e')][_0xa5a2('0x1d')]=function(_0x5a2abb){try{if(this[_0xa5a2('0x20')](_0x5a2abb)){logger[_0xa5a2('0x27')](_0xa5a2('0x86'),_0x5a2abb[_0xa5a2('0x24')],util['inspect'](_0x5a2abb,{'showHidden':![],'depth':null}));if(this[_0xa5a2('0x9')][_0x5a2abb[_0xa5a2('0x82')]]){for(var _0x2f1fbc in this[_0xa5a2('0x9')][_0x5a2abb[_0xa5a2('0x82')]]){if(this[_0xa5a2('0x9')][_0x5a2abb[_0xa5a2('0x82')]][_0xa5a2('0x57')](_0x2f1fbc)){if(_0x5a2abb[_0xa5a2('0x87')]===_0x2f1fbc){logger['info'](_0xa5a2('0x88'),_0x5a2abb[_0xa5a2('0x24')],this[_0xa5a2('0x9')][_0x5a2abb['transfereeuniqueid']][_0x2f1fbc][_0xa5a2('0x25')],_0x2f1fbc);var _0x6c3775=moment();this[_0xa5a2('0x9')][_0x5a2abb[_0xa5a2('0x82')]][_0x2f1fbc][_0xa5a2('0x51')]=!![];this[_0xa5a2('0x9')][_0x5a2abb['transfereeuniqueid']][_0x2f1fbc][_0xa5a2('0x7e')]=_0x6c3775;this['channels'][_0x5a2abb[_0xa5a2('0x82')]][_0x2f1fbc][_0xa5a2('0x48')]=_0xa5a2('0x59');this[_0xa5a2('0x9')][_0x5a2abb[_0xa5a2('0x82')]][_0x2f1fbc][_0xa5a2('0x4e')]=_0xa5a2('0x5a');this[_0xa5a2('0x9')][_0x5a2abb[_0xa5a2('0x82')]][_0x2f1fbc][_0xa5a2('0x5c')]=_0x6c3775[_0xa5a2('0x89')](this[_0xa5a2('0x9')][_0x5a2abb[_0xa5a2('0x82')]][_0x2f1fbc][_0xa5a2('0x3b')],_0xa5a2('0x8a'));}}}}}}catch(_0x144473){logger[_0xa5a2('0x37')](_0xa5a2('0x8b'),_0x5a2abb['uniqueid'],util[_0xa5a2('0x29')](_0x144473,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa5a2('0x1e')][_0xa5a2('0x19')]=function(_0x30dd7c){var _0x1b15d2='';try{if(this['isNotNull'](_0x30dd7c)){logger[_0xa5a2('0x27')](_0xa5a2('0x8c'),_0x30dd7c[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x30dd7c,{'showHidden':![],'depth':null}));if(_0x30dd7c[_0xa5a2('0x8d')]){_0x1b15d2=_0x30dd7c[_0xa5a2('0x8d')][_0xa5a2('0x8e')](0x0,_0x30dd7c[_0xa5a2('0x8d')][_0xa5a2('0x8f')]('-'));if(this[_0xa5a2('0xb')][_0x1b15d2]){logger[_0xa5a2('0x22')](_0xa5a2('0x90'),_0x30dd7c['uniqueid'],_0x1b15d2);this[_0xa5a2('0xb')][_0x1b15d2]['onhold']=!![];}}}}catch(_0x49efdc){logger[_0xa5a2('0x37')](_0xa5a2('0x91'),_0x30dd7c[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x49efdc,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa5a2('0x1a')]=function(_0x158523){var _0x4a2111='';try{if(this[_0xa5a2('0x20')](_0x158523)){logger[_0xa5a2('0x27')](_0xa5a2('0x92'),_0x158523['uniqueid'],util['inspect'](_0x158523,{'showHidden':![],'depth':null}));if(_0x158523[_0xa5a2('0x8d')]){_0x4a2111=_0x158523[_0xa5a2('0x8d')][_0xa5a2('0x8e')](0x0,_0x158523['channel'][_0xa5a2('0x8f')]('-'));if(this[_0xa5a2('0xb')][_0x4a2111]){logger[_0xa5a2('0x22')](_0xa5a2('0x93'),_0x158523[_0xa5a2('0x24')],_0x4a2111);this[_0xa5a2('0xb')][_0x4a2111]['onhold']=![];}}}}catch(_0x1455ce){logger[_0xa5a2('0x37')](_0xa5a2('0x94'),_0x158523[_0xa5a2('0x24')],util[_0xa5a2('0x29')](_0x1455ce,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
index f8ca839..a4547cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bfc=['coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncNewState','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','emit','isNotNull','uniqueid','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','isUndefined','starttime','disposition','toNumber','pick','keys','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','applicationdata','duration','subtract','seconds','includes','lastapplication','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','YYYY-MM-DD\x20HH:mm:ss','holdtime','connectedlinename','destinationchannel','membername','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','diff','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','then','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','webbar:stopmonitors','event','BlindTransfer','outbound','blindTransfers','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','extension','BLIND','syncHangup','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','moment','util','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','defaults','redis','localhost','socket.io-emitter','channels','agents'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2bfc,0x187));var _0xc2bf=function(_0x63454a,_0x4ae4c1){_0x63454a=_0x63454a-0x0;var _0x3b79be=_0x2bfc[_0x63454a];return _0x3b79be;};'use strict';var BPromise=require(_0xc2bf('0x0'));var _=require(_0xc2bf('0x1'));var moment=require(_0xc2bf('0x2'));var util=require(_0xc2bf('0x3'));var path=require(_0xc2bf('0x4'));var Redis=require('ioredis');var config=require(_0xc2bf('0x5'));var logger=require(_0xc2bf('0x6'))(_0xc2bf('0x7'));var ami=require(_0xc2bf('0x8'));var Channel=require(_0xc2bf('0x9'));var RpcSetting=require(_0xc2bf('0xa'));var statusDesc=[_0xc2bf('0xb'),_0xc2bf('0xc'),_0xc2bf('0xd'),_0xc2bf('0xe'),_0xc2bf('0xf'),_0xc2bf('0x10'),_0xc2bf('0x11'),_0xc2bf('0x12'),_0xc2bf('0x13')];var applications=[_0xc2bf('0x14'),_0xc2bf('0x15'),_0xc2bf('0x16'),_0xc2bf('0x17'),'playback',_0xc2bf('0x18')];var dispositions=[_0xc2bf('0x19'),_0xc2bf('0x1a'),_0xc2bf('0x1a'),'NO\x20ANSWER','NO\x20ANSWER','NO\x20ANSWER',_0xc2bf('0x1b'),_0xc2bf('0x1c'),_0xc2bf('0x1a'),_0xc2bf('0x1a'),_0xc2bf('0x1a')];var actions={};config['redis']=_[_0xc2bf('0x1d')](config[_0xc2bf('0x1e')],{'host':_0xc2bf('0x1f'),'port':0x18eb});var io=require(_0xc2bf('0x20'))(new Redis(config['redis']));function VoiceCallReport(_0x332b20){this[_0xc2bf('0x21')]=_0x332b20['channels'];this['agents']=_0x332b20[_0xc2bf('0x22')];this['blindTransfers']={};ami['on'](_0xc2bf('0x23'),this[_0xc2bf('0x24')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x26'),this[_0xc2bf('0x24')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x27'),this[_0xc2bf('0x28')][_0xc2bf('0x25')](this));ami['on']('newstate',this[_0xc2bf('0x29')]['bind'](this));ami['on'](_0xc2bf('0x2a'),this[_0xc2bf('0x2b')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x2c'),this['syncHangup'][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x2d'),this[_0xc2bf('0x2e')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x2f'),this[_0xc2bf('0x30')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x31'),this[_0xc2bf('0x32')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x33'),this[_0xc2bf('0x34')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x35'),this[_0xc2bf('0x36')][_0xc2bf('0x25')](this));try{logger[_0xc2bf('0x37')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xc2bf('0x38')]();}catch(_0x203599){logger[_0xc2bf('0x39')](_0xc2bf('0x3a'),util[_0xc2bf('0x3b')](_0x203599,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xc2bf('0x3c')]['isNotNull']=function(_0x20a091){return _0x20a091!==null&&!_['isUndefined'](_0x20a091);};VoiceCallReport['prototype']['emit']=function(_0x5025e1,_0x2dca53,_0x103bf9){io['to'](_0x5025e1)[_0xc2bf('0x3d')](_0x2dca53,_0x103bf9);};VoiceCallReport[_0xc2bf('0x3c')][_0xc2bf('0x2e')]=function(_0x37da22){try{if(this[_0xc2bf('0x3e')](_0x37da22)){logger[_0xc2bf('0x37')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x37da22[_0xc2bf('0x3f')],_0x37da22['calleridname'],_0x37da22['calleridnum']);logger[_0xc2bf('0x40')](_0xc2bf('0x41'),_0x37da22[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x37da22,{'showHidden':![],'depth':null}));if(_0x37da22[_0xc2bf('0x3f')]===_0x37da22[_0xc2bf('0x42')]){if(!_['isUndefined'](this[_0xc2bf('0x21')][_0x37da22[_0xc2bf('0x3f')]])){_[_0xc2bf('0x43')](this[_0xc2bf('0x21')][_0x37da22[_0xc2bf('0x3f')]],_['pick'](_0x37da22,_['keys'](this[_0xc2bf('0x21')][_0x37da22[_0xc2bf('0x3f')]])));}}if(_0x37da22[_0xc2bf('0x44')]===_0xc2bf('0x45')){if(this[_0xc2bf('0x22')][_0x37da22[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]){if(_0x37da22[_0xc2bf('0x48')]==_0xc2bf('0x49')){this[_0xc2bf('0x22')][_0x37da22[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x4a')]=_0x37da22[_0xc2bf('0x4b')];this[_0xc2bf('0x3d')](util[_0xc2bf('0x4c')](_0xc2bf('0x4d'),this['agents'][_0x37da22['channel'][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x4e')]),_0xc2bf('0x4f'),{'destaccountcode':this[_0xc2bf('0x22')][_0x37da22[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x50')],'destconnectedlinenum':_0x37da22[_0xc2bf('0x4b')]});}}}}}catch(_0x151a82){logger[_0xc2bf('0x39')](_0xc2bf('0x51'),_0x37da22[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x151a82,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc2bf('0x28')]=function(_0x308b28){try{if(this[_0xc2bf('0x3e')](_0x308b28)){logger[_0xc2bf('0x40')](_0xc2bf('0x52'),_0x308b28[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x308b28,{'showHidden':![],'depth':null}));if(_0x308b28[_0xc2bf('0x3f')]===_0x308b28[_0xc2bf('0x42')]&&_0x308b28[_0xc2bf('0x46')]!=_0xc2bf('0x53')){if(_[_0xc2bf('0x54')](this[_0xc2bf('0x21')][_0x308b28[_0xc2bf('0x3f')]])){logger['info']('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x308b28['uniqueid'],_0x308b28[_0xc2bf('0x44')],_0x308b28['exten']);this[_0xc2bf('0x21')][_0x308b28[_0xc2bf('0x3f')]]=new Channel();this['channels'][_0x308b28[_0xc2bf('0x3f')]][_0xc2bf('0x55')]=moment()[_0xc2bf('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x308b28[_0xc2bf('0x3f')]][_0xc2bf('0x56')]=dispositions[_[_0xc2bf('0x57')](_0x308b28['channelstate'])];_[_0xc2bf('0x43')](this[_0xc2bf('0x21')][_0x308b28[_0xc2bf('0x3f')]],_[_0xc2bf('0x58')](_0x308b28,_[_0xc2bf('0x59')](this['channels'][_0x308b28['uniqueid']])));if(_0x308b28[_0xc2bf('0x44')]==='from-sip'){if(this['agents'][_0x308b28[_0xc2bf('0x46')]['split']('-')[0x0]]){if(_[_0xc2bf('0x54')](this['agents'][_0x308b28['channel']['split']('-')[0x0]][_0xc2bf('0x4a')])){this[_0xc2bf('0x22')][_0x308b28['channel'][_0xc2bf('0x47')]('-')[0x0]]['destconnectedlinenum']=_0x308b28['exten'];logger['debug']('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x308b28['uniqueid'],util[_0xc2bf('0x3b')]({'destaccountcode':this['agents'][_0x308b28[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x50')],'destconnectedlinenum':_0x308b28['exten']},{'showHidden':![],'depth':null}));this[_0xc2bf('0x3d')](util[_0xc2bf('0x4c')](_0xc2bf('0x4d'),this[_0xc2bf('0x22')][_0x308b28[_0xc2bf('0x46')]['split']('-')[0x0]]['name']),_0xc2bf('0x4f'),{'destaccountcode':this['agents'][_0x308b28['channel'][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x50')],'destconnectedlinenum':_0x308b28[_0xc2bf('0x48')]});}}}}}}}catch(_0x529cdf){logger[_0xc2bf('0x39')](_0xc2bf('0x5a'),_0x308b28[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x529cdf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')]['syncNewExten']=function(_0x2761bd){try{if(this['isNotNull'](_0x2761bd)){logger['debug'](_0xc2bf('0x5b'),_0x2761bd['uniqueid'],util[_0xc2bf('0x3b')](_0x2761bd,{'showHidden':![],'depth':null}));if(_0x2761bd[_0xc2bf('0x3f')]===_0x2761bd[_0xc2bf('0x42')]&&_0x2761bd[_0xc2bf('0x48')]!='h'&&_0x2761bd[_0xc2bf('0x46')]!=_0xc2bf('0x53')){_0x2761bd[_0xc2bf('0x5c')]=_0x2761bd[_0xc2bf('0x5c')][_0xc2bf('0x5d')]();_0x2761bd['applicationdata']=_0x2761bd[_0xc2bf('0x5e')]&&_0x2761bd[_0xc2bf('0x5e')][_0xc2bf('0x5f')](_0xc2bf('0x60'))?_0x2761bd['appdata']:(_0x2761bd[_0xc2bf('0x5e')]||_0x2761bd['applicationdata'])['toLowerCase']();logger[_0xc2bf('0x37')](_0xc2bf('0x61'),_0x2761bd[_0xc2bf('0x3f')],_0x2761bd[_0xc2bf('0x5c')],_0x2761bd[_0xc2bf('0x62')]);if(_['isUndefined'](this['channels'][_0x2761bd[_0xc2bf('0x3f')]])){this[_0xc2bf('0x21')][_0x2761bd[_0xc2bf('0x3f')]]=new Channel();this[_0xc2bf('0x21')][_0x2761bd[_0xc2bf('0x3f')]][_0xc2bf('0x55')]=_0x2761bd[_0xc2bf('0x63')]?moment()[_0xc2bf('0x64')](moment[_0xc2bf('0x63')](_0x2761bd[_0xc2bf('0x63')])[_0xc2bf('0x65')](),'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2761bd[_0xc2bf('0x3f')]]['disposition']=_0xc2bf('0x19');}_['merge'](this[_0xc2bf('0x21')][_0x2761bd[_0xc2bf('0x3f')]],_[_0xc2bf('0x58')](_0x2761bd,_[_0xc2bf('0x59')](this[_0xc2bf('0x21')][_0x2761bd[_0xc2bf('0x3f')]])));if(_[_0xc2bf('0x66')](applications,_0x2761bd[_0xc2bf('0x5c')])){this[_0xc2bf('0x21')][_0x2761bd['uniqueid']][_0xc2bf('0x67')]=_0x2761bd[_0xc2bf('0x5c')];this[_0xc2bf('0x21')][_0x2761bd[_0xc2bf('0x3f')]]['lastdata']=_0x2761bd[_0xc2bf('0x62')];if(_0x2761bd['application']===_0xc2bf('0x14')&&_[_0xc2bf('0x5f')](_0x2761bd['applicationdata'][_0xc2bf('0x5d')](),_0xc2bf('0x68'))){var _0x2fc199=_0x2761bd[_0xc2bf('0x62')][_0xc2bf('0x47')]('=');var _0x45f381=_0x2fc199[0x0][_0xc2bf('0x5d')]()[_0xc2bf('0x69')](/cdr\((.*)\)/);if(_0x45f381){this['channels'][_0x2761bd[_0xc2bf('0x3f')]][_0x45f381[0x1]]=_0x2fc199[0x1];}}else if(_0x2761bd[_0xc2bf('0x5c')]===_0xc2bf('0x15')){this[_0xc2bf('0x21')][_0x2761bd[_0xc2bf('0x3f')]][_0xc2bf('0x15')]=_0x2761bd[_0xc2bf('0x62')][_0xc2bf('0x47')](',')[0x0];}}}}}catch(_0x13885c){logger['error'](_0xc2bf('0x6a'),_0x2761bd['uniqueid'],util[_0xc2bf('0x3b')](_0x13885c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')][_0xc2bf('0x29')]=function(_0x37a7f0){try{if(this['isNotNull'](_0x37a7f0)){logger['info'](_0xc2bf('0x6b'),_0x37a7f0[_0xc2bf('0x3f')],_0x37a7f0[_0xc2bf('0x42')],_0x37a7f0[_0xc2bf('0x6c')],_0x37a7f0[_0xc2bf('0x6d')]);logger[_0xc2bf('0x40')](_0xc2bf('0x6e'),_0x37a7f0['uniqueid'],util['inspect'](_0x37a7f0,{'showHidden':![],'depth':null}));if(_0x37a7f0[_0xc2bf('0x3f')]!==_0x37a7f0[_0xc2bf('0x42')]){if(this['channels'][_0x37a7f0[_0xc2bf('0x42')]]){if(_0x37a7f0[_0xc2bf('0x6f')]==='6'){if(!this['channels'][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x70')]){var _0x5a88ee=moment();this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x70')]=!![];this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x71')]=_0x5a88ee[_0xc2bf('0x4c')](_0xc2bf('0x72'));if(this[_0xc2bf('0x21')][_0x37a7f0['linkedid']][_0xc2bf('0x55')]){this['channels'][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x73')]=_0x5a88ee['diff'](this['channels'][_0x37a7f0['linkedid']][_0xc2bf('0x55')],'seconds');}}this[_0xc2bf('0x21')][_0x37a7f0['linkedid']][_0xc2bf('0x42')]=_0x37a7f0['uniqueid'];if(_0x37a7f0[_0xc2bf('0x6d')]!=='xcally-motion-preview'){this[_0xc2bf('0x21')][_0x37a7f0['linkedid']][_0xc2bf('0x4b')]=_0x37a7f0[_0xc2bf('0x6d')];}this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x74')]=_0x37a7f0['calleridname'];this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x75')]=_0x37a7f0[_0xc2bf('0x46')];this['channels'][_0x37a7f0[_0xc2bf('0x42')]]['disposition']=dispositions[_[_0xc2bf('0x57')](_0x37a7f0[_0xc2bf('0x6f')])];if(this['agents'][_0x37a7f0[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]){this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]]['UserId']=this[_0xc2bf('0x22')][_0x37a7f0['channel']['split']('-')[0x0]]['id'];this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x76')]=this['agents'][_0x37a7f0[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x4e')];}}}}else{if(this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x3f')]]){if(_0x37a7f0[_0xc2bf('0x6f')]==='6'){if(this[_0xc2bf('0x22')][_0x37a7f0[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]){this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x3f')]]['UserId']=this[_0xc2bf('0x22')][_0x37a7f0['channel']['split']('-')[0x0]]['id'];this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x3f')]][_0xc2bf('0x76')]=this['agents'][_0x37a7f0['channel']['split']('-')[0x0]][_0xc2bf('0x4e')];}}}}if(_0x37a7f0[_0xc2bf('0x6f')]==='6'&&_0x37a7f0[_0xc2bf('0x44')]===_0xc2bf('0x45')){if(this[_0xc2bf('0x22')][_0x37a7f0[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]){this[_0xc2bf('0x22')][_0x37a7f0[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x4a')]=_0x37a7f0[_0xc2bf('0x48')];var _0x1244a7;if(this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x3f')]])_0x1244a7=this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x3f')]]['routealias'];else if(this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]])_0x1244a7=this['channels'][_0x37a7f0[_0xc2bf('0x42')]]['routealias'];logger[_0xc2bf('0x40')](_0xc2bf('0x77'),_0x37a7f0['uniqueid'],util['inspect']({'destaccountcode':this['agents'][_0x37a7f0['channel']['split']('-')[0x0]][_0xc2bf('0x50')],'destconnectedlinenum':_0x37a7f0[_0xc2bf('0x48')],'routealias':_0x1244a7},{'showHidden':![],'depth':null}));this[_0xc2bf('0x3d')](util[_0xc2bf('0x4c')]('user:%s',this[_0xc2bf('0x22')][_0x37a7f0[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]['name']),_0xc2bf('0x4f'),{'destaccountcode':this[_0xc2bf('0x22')][_0x37a7f0[_0xc2bf('0x46')]['split']('-')[0x0]][_0xc2bf('0x50')],'destconnectedlinenum':_0x37a7f0[_0xc2bf('0x48')],'routealias':_0x1244a7});}}}}catch(_0x576257){logger['error'](_0xc2bf('0x78'),_0x37a7f0[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x576257,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')][_0xc2bf('0x79')]=function(_0xd20998,_0x27e11b){try{if(this[_0xc2bf('0x21')][_0xd20998]){logger['info'](_0xc2bf('0x7a'),_0xd20998,_0x27e11b);this[_0xc2bf('0x21')][_0xd20998][_0xc2bf('0x7b')]=!![];if(_[_0xc2bf('0x7c')](_0x27e11b,_0xc2bf('0x7d'))){_0x27e11b=_0x27e11b[_0xc2bf('0x7e')]('.wav49',_0xc2bf('0x7f'));}this[_0xc2bf('0x21')][_0xd20998][_0xc2bf('0x80')]=_0x27e11b;var _0x4772fd=_[_0xc2bf('0x81')](this[_0xc2bf('0x21')][_0xd20998][_0xc2bf('0x82')],{'filename':_0x27e11b});if(_[_0xc2bf('0x83')](_0x4772fd)){this['channels'][_0xd20998][_0xc2bf('0x82')][_0xc2bf('0x84')]({'filename':_0x27e11b,'createdAt':moment()[_0xc2bf('0x4c')](_0xc2bf('0x72')),'mixmonitorid':'','status':'rec'});}}}catch(_0x1cc8de){logger[_0xc2bf('0x39')](_0xc2bf('0x85'),_0xd20998,util[_0xc2bf('0x3b')](_0x1cc8de,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')]['syncVarSet']=function(_0x26d8ad){try{if(this['isNotNull'](_0x26d8ad)){logger[_0xc2bf('0x40')](_0xc2bf('0x86'),_0x26d8ad['uniqueid'],util[_0xc2bf('0x3b')](_0x26d8ad,{'showHidden':![],'depth':null}));if(this['channels'][_0x26d8ad[_0xc2bf('0x3f')]]&&_0x26d8ad[_0xc2bf('0x46')]!=_0xc2bf('0x53')){if(this[_0xc2bf('0x3e')](_0x26d8ad['variable'])){if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')]['mixmonitor_filename'])){logger['info'](_0xc2bf('0x88'),_0x26d8ad['uniqueid'],_0x26d8ad[_0xc2bf('0x89')]);this[_0xc2bf('0x79')](_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad[_0xc2bf('0x89')]);}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x8a')])){logger[_0xc2bf('0x37')](_0xc2bf('0x8b'),_0x26d8ad['uniqueid'],_0x26d8ad['value']);this['channels'][_0x26d8ad['uniqueid']][_0xc2bf('0x6d')]=_0x26d8ad[_0xc2bf('0x89')];}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x8c')])){logger[_0xc2bf('0x37')](_0xc2bf('0x8d'),_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad['value']);this[_0xc2bf('0x21')][_0x26d8ad['uniqueid']]['callerid']=_0x26d8ad['value'];}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x8e')])){logger[_0xc2bf('0x37')](_0xc2bf('0x8f'),_0x26d8ad['uniqueid'],_0x26d8ad['value']);this[_0xc2bf('0x21')][_0x26d8ad[_0xc2bf('0x3f')]][_0xc2bf('0x90')]=_0x26d8ad[_0xc2bf('0x89')];}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x91')])){logger[_0xc2bf('0x37')](_0xc2bf('0x92'),_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad['value'][_0xc2bf('0x47')](',')[0x0]);this[_0xc2bf('0x21')][_0x26d8ad['uniqueid']][_0xc2bf('0x15')]=_0x26d8ad[_0xc2bf('0x89')][_0xc2bf('0x47')](',')[0x0];}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')]['xmd-originatecalleridnum'])){logger[_0xc2bf('0x37')](_0xc2bf('0x93'),_0x26d8ad['uniqueid'],_0x26d8ad['value']);this['channels'][_0x26d8ad[_0xc2bf('0x3f')]]['originatecalleridnum']=_0x26d8ad[_0xc2bf('0x89')];}else if(this['isNotNull'](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x94')])){logger[_0xc2bf('0x37')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad['value']);this[_0xc2bf('0x21')][_0x26d8ad[_0xc2bf('0x3f')]][_0xc2bf('0x95')]=_0x26d8ad[_0xc2bf('0x89')];}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')]['xmd-callerid-preview'])){logger[_0xc2bf('0x37')](_0xc2bf('0x96'),_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad[_0xc2bf('0x89')]);this[_0xc2bf('0x21')][_0x26d8ad[_0xc2bf('0x3f')]][_0xc2bf('0x97')]=_0x26d8ad[_0xc2bf('0x89')];}else if(this['isNotNull'](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x98')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad['value']);this[_0xc2bf('0x21')][_0x26d8ad[_0xc2bf('0x3f')]]['queue']=_0x26d8ad['value'];}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x99')])){logger[_0xc2bf('0x37')](_0xc2bf('0x9a'),_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad[_0xc2bf('0x89')]);this[_0xc2bf('0x21')][_0x26d8ad[_0xc2bf('0x3f')]][_0xc2bf('0x9b')]=_0x26d8ad[_0xc2bf('0x89')];}}}else if(this['isNotNull'](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x9c')])){if(_0x26d8ad[_0xc2bf('0x89')]){var _0x79c9b=path[_0xc2bf('0x9d')](_0x26d8ad['value'])[_0xc2bf('0x4e')];logger[_0xc2bf('0x37')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x79c9b,_0x26d8ad[_0xc2bf('0x89')]);this['syncMixMonitorFilename'](_0x79c9b,_0x26d8ad['value']);}}else if(this[_0xc2bf('0x21')][_0x26d8ad['linkedid']]){if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')])){if(this['isNotNull'](_0x26d8ad[_0xc2bf('0x87')]['sipcallid'])){logger[_0xc2bf('0x37')](_0xc2bf('0x9a'),_0x26d8ad[_0xc2bf('0x42')],_0x26d8ad[_0xc2bf('0x89')]);this['channels'][_0x26d8ad['linkedid']][_0xc2bf('0x9e')]=_0x26d8ad[_0xc2bf('0x89')];}}}}}catch(_0x1fa2b4){logger['error'](_0xc2bf('0x9f'),_0x26d8ad[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x1fa2b4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')]['syncHangup']=function(_0x3ab326){try{if(this[_0xc2bf('0x3e')](_0x3ab326)){logger[_0xc2bf('0x40')]('[%s][voiceCallReport][hangup]\x20event:',_0x3ab326['uniqueid'],util[_0xc2bf('0x3b')](_0x3ab326,{'showHidden':![],'depth':null}));if(this[_0xc2bf('0x21')][_0x3ab326['uniqueid']]){logger[_0xc2bf('0x37')](_0xc2bf('0xa0'),_0x3ab326[_0xc2bf('0x3f')],_0x3ab326[_0xc2bf('0xa1')]);var _0x5cfa8d=moment();this[_0xc2bf('0x21')][_0x3ab326['uniqueid']]['endtime']=_0x5cfa8d[_0xc2bf('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc2bf('0x21')][_0x3ab326['uniqueid']]['duration']=_0x5cfa8d['diff'](this[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x55')],_0xc2bf('0x65'));if(this[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x70')]){this[_0xc2bf('0x21')][_0x3ab326['uniqueid']][_0xc2bf('0xa2')]=_0x5cfa8d[_0xc2bf('0xa3')](this[_0xc2bf('0x21')][_0x3ab326['uniqueid']][_0xc2bf('0x71')],_0xc2bf('0x65'));this[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x73')]=this[_0xc2bf('0x21')][_0x3ab326['uniqueid']][_0xc2bf('0x63')]-this['channels'][_0x3ab326['uniqueid']]['billableseconds'];}if(_0x3ab326[_0xc2bf('0x44')]===_0xc2bf('0x45')){if(this[_0xc2bf('0x22')][_0x3ab326[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]){this[_0xc2bf('0x22')][_0x3ab326['channel'][_0xc2bf('0x47')]('-')[0x0]]=_['omit'](this[_0xc2bf('0x22')][_0x3ab326[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]],[_0xc2bf('0x4a')]);logger[_0xc2bf('0x40')](_0xc2bf('0xa4'),_0x3ab326[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')]({'id':this[_0xc2bf('0x22')][_0x3ab326[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]['id'],'destaccountcode':this[_0xc2bf('0x22')][_0x3ab326['channel']['split']('-')[0x0]][_0xc2bf('0x50')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xc2bf('0x4c')]('user:%s',this[_0xc2bf('0x22')][_0x3ab326[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]['name']),_0xc2bf('0xa5'),{'id':this['agents'][_0x3ab326[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x3ab326['channel']['split']('-')[0x0]][_0xc2bf('0x50')]});}}var _0x4ede36=this;Promise['resolve']()[_0xc2bf('0xa6')](function(){var _0x294b2d=_0x4ede36[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]];if(typeof _0x294b2d['transferType']===_0xc2bf('0xa7'))return;if(_[_0xc2bf('0xa8')](_0x294b2d['monitors']))return;return RpcSetting[_0xc2bf('0xa9')]()[_0xc2bf('0xa6')](function(_0xd05dd0){if(!_0xd05dd0[_0xc2bf('0xaa')])return;return Promise['resolve']()[_0xc2bf('0xa6')](function(){return ami[_0xc2bf('0xab')]({'action':'StopMixMonitor','channel':_0x294b2d[_0xc2bf('0x46')]})['catch'](function(){});})[_0xc2bf('0xa6')](function(){return ami[_0xc2bf('0xab')]({'action':_0xc2bf('0xac'),'channel':_0x294b2d[_0xc2bf('0x75')]})['catch'](function(){})['finally'](function(){var _0x575efe=_0x4ede36[_0xc2bf('0x22')][_0x294b2d[_0xc2bf('0x75')]['split']('-')[0x0]];if(!_0x575efe)return;io[_0xc2bf('0x3d')](_0xc2bf('0xad'),{'agentId':_0x575efe['id'],'uniqueid':_0x294b2d['uniqueid']});});});});})[_0xc2bf('0xa6')](function(){if(_0x3ab326[_0xc2bf('0xae')]===_0xc2bf('0xaf')){_0x4ede36['blindTransfers'][_0x3ab326['uniqueid']]=_0x4ede36[_0xc2bf('0x21')][_0x3ab326['uniqueid']];}else{if(_0x4ede36[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x90')]===_0xc2bf('0xb0')&&_0x4ede36[_0xc2bf('0xb1')][_0x3ab326[_0xc2bf('0x3f')]]){_0x4ede36[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x3f')]=[_0x4ede36[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x42')],_0x4ede36['channels'][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x42')]=_0x4ede36['channels'][_0x3ab326[_0xc2bf('0x3f')]]['uniqueid']][0x0];delete _0x4ede36[_0xc2bf('0xb1')][_0x3ab326[_0xc2bf('0x3f')]];}}logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x3ab326[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x4ede36[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]],{'showHidden':![],'depth':null}));ami[_0xc2bf('0x3d')](_0xc2bf('0xb2'),_0x4ede36[_0xc2bf('0x21')][_0x3ab326['uniqueid']]);delete _0x4ede36[_0xc2bf('0x21')][_0x3ab326['uniqueid']];});}}}catch(_0x348682){logger[_0xc2bf('0x39')](_0xc2bf('0xb3'),_0x3ab326[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x348682,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')]['syncAttendedTransfer']=function(_0x1a42d8){try{if(this[_0xc2bf('0x3e')](_0x1a42d8)){logger['info'](_0xc2bf('0xb4'),_0x1a42d8[_0xc2bf('0x3f')],_0x1a42d8['origtransferercalleridnum'],_0x1a42d8['transfertargetcalleridnum']);logger[_0xc2bf('0x40')](_0xc2bf('0xb5'),_0x1a42d8[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x1a42d8,{'showHidden':![],'depth':null}));if(this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xb6')]]){this['channels'][_0x1a42d8[_0xc2bf('0xb6')]][_0xc2bf('0xb7')]=_0x1a42d8[_0xc2bf('0xb8')];this['channels'][_0x1a42d8[_0xc2bf('0xb6')]][_0xc2bf('0xb9')]=_0x1a42d8[_0xc2bf('0xba')];if(this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbb')]]){var _0x268ea4=this['channels'][_0x1a42d8[_0xc2bf('0xbb')]];this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbb')]]=this['channels'][_0x1a42d8[_0xc2bf('0xb6')]];this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xb6')]]=_0x268ea4;}}else if(this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbc')]]){this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbc')]][_0xc2bf('0xb7')]=_0x1a42d8[_0xc2bf('0xb8')];this[_0xc2bf('0x21')][_0x1a42d8['transfertargetuniqueid']][_0xc2bf('0xb9')]=_0x1a42d8['transfertargetcalleridnum'];if(this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbd')]]){var _0x268ea4=this['channels'][_0x1a42d8['origtransfereruniqueid']];this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbd')]]=this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbc')]];this[_0xc2bf('0x21')][_0x1a42d8['transfertargetuniqueid']]=_0x268ea4;}}if((this['channels'][_0x1a42d8[_0xc2bf('0xbd')]]||this['channels'][_0x1a42d8[_0xc2bf('0xbe')]])&&this['channels'][_0x1a42d8[_0xc2bf('0xbb')]]){var _0x4a4401=_[_0xc2bf('0xbf')]([this['channels'][_0x1a42d8['origtransfereruniqueid']],this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbe')]],this[_0xc2bf('0x21')][_0x1a42d8['secondtransfereruniqueid']]],function(_0x579278){return _0x579278&&_0x579278[_0xc2bf('0x90')]===_0xc2bf('0xb0')&&_0x579278['routeid'];});if(_0x4a4401){if(this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbd')]])this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbd')]][_0xc2bf('0xc0')]=_0xc2bf('0xc1');if(this[_0xc2bf('0x21')][_0x1a42d8['origtransfererlinkedid']])this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbe')]]['transferType']=_0xc2bf('0xc1');this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbb')]]['transferType']='ATTENDED';}}}}catch(_0xd3a3db){logger['error'](_0xc2bf('0xc2'),_0x1a42d8[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0xd3a3db,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc2bf('0x32')]=function(_0x56d14c){try{if(this[_0xc2bf('0x3e')](_0x56d14c)){logger['info'](_0xc2bf('0xc3'),_0x56d14c[_0xc2bf('0x3f')],_0x56d14c['transfereecalleridnum'],_0x56d14c['extension']);logger[_0xc2bf('0x40')](_0xc2bf('0xc4'),_0x56d14c[_0xc2bf('0x3f')],util['inspect'](_0x56d14c,{'showHidden':![],'depth':null}));if(this[_0xc2bf('0x21')][_0x56d14c[_0xc2bf('0xb6')]]){this[_0xc2bf('0x21')][_0x56d14c['transfereeuniqueid']][_0xc2bf('0xb7')]=_0x56d14c[_0xc2bf('0xc5')];this['channels'][_0x56d14c[_0xc2bf('0xb6')]][_0xc2bf('0xb9')]=_0x56d14c[_0xc2bf('0xc6')];this[_0xc2bf('0x21')][_0x56d14c['transfereeuniqueid']]['transferType']=_0xc2bf('0xc7');this[_0xc2bf('0xc8')]({'event':_0xc2bf('0xaf'),'uniqueid':_0x56d14c[_0xc2bf('0xb6')],'context':_0x56d14c[_0xc2bf('0x44')],'channel':_0x56d14c[_0xc2bf('0xc9')]});}else{this[_0xc2bf('0x21')][_0x56d14c[_0xc2bf('0xca')]][_0xc2bf('0xc0')]=_0xc2bf('0xc7');}}}catch(_0x334622){logger[_0xc2bf('0x39')](_0xc2bf('0xcb'),_0x56d14c[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x334622,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc2bf('0x34')]=function(_0x4d62a9){try{if(this['isNotNull'](_0x4d62a9)){logger['debug'](_0xc2bf('0xcc'),_0x4d62a9[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x4d62a9,{'showHidden':![],'depth':null}));if(this[_0xc2bf('0x21')][_0x4d62a9['uniqueid']]){if(!_[_0xc2bf('0x83')](this[_0xc2bf('0x21')][_0x4d62a9[_0xc2bf('0x3f')]][_0xc2bf('0x71')])){this[_0xc2bf('0x21')][_0x4d62a9[_0xc2bf('0x3f')]][_0xc2bf('0xcd')]=moment()[_0xc2bf('0x4c')](_0xc2bf('0x72'));logger[_0xc2bf('0x37')](_0xc2bf('0xce'),_0x4d62a9[_0xc2bf('0x3f')],this[_0xc2bf('0x21')][_0x4d62a9[_0xc2bf('0x3f')]]['mohstarttime']);}}}}catch(_0x3612f5){logger[_0xc2bf('0x39')](_0xc2bf('0xcf'),_0x4d62a9[_0xc2bf('0x3f')],util['inspect'](_0x3612f5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')]['syncMusicOnHoldStop']=function(_0x54b46b){try{if(this['isNotNull'](_0x54b46b)){logger['debug'](_0xc2bf('0xd0'),_0x54b46b['uniqueid'],util['inspect'](_0x54b46b,{'showHidden':![],'depth':null}));if(this['channels'][_0x54b46b[_0xc2bf('0x3f')]]){if(!_['isNil'](this[_0xc2bf('0x21')][_0x54b46b[_0xc2bf('0x3f')]][_0xc2bf('0xcd')])){this['channels'][_0x54b46b['uniqueid']][_0xc2bf('0xd1')]+=moment()['milliseconds'](0x0)[_0xc2bf('0xa3')](this[_0xc2bf('0x21')][_0x54b46b[_0xc2bf('0x3f')]]['mohstarttime'],_0xc2bf('0x65'));logger[_0xc2bf('0x37')](_0xc2bf('0xd2'),_0x54b46b['uniqueid'],this[_0xc2bf('0x21')][_0x54b46b[_0xc2bf('0x3f')]]['mohtime']);delete this[_0xc2bf('0x21')][_0x54b46b['uniqueid']]['mohstarttime'];}}}}catch(_0x4990c1){logger['error'](_0xc2bf('0xd3'),_0x54b46b[_0xc2bf('0x3f')],util['inspect'](_0x4990c1,{'showHidden':![],'depth':null}));}};module[_0xc2bf('0xd4')]=VoiceCallReport;
\ No newline at end of file
+var _0xbe0c=['from-sip','channel','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','split','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','linkedid','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','keys','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','emit','application','applicationdata','appdata','CDR(routeAlias)','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','disposition','includes','lastapplication','startsWith','cdr(','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','holdtime','diff','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','endsWith','.wav49','replace','.WAV','monitorFilename','find','isNil','rec','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcalluniqueid','parse','syncMixMonitorFilename','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','billableseconds','user:agentcomplete','resolve','then','isEmpty','getSettings','Action','catch','finally','destinationchannel','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','routeid','ATTENDED','transferType','syncBlindTransfer','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfercalleridnum','transfereecalleridnum','transferconnectedlinenum','BLIND','syncHangup','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','exports','bluebird','lodash','moment','util','ioredis','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','syncNewExten','newexten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','attendedtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isUndefined','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','merge','pick','context'];(function(_0x200923,_0x5e6ebd){var _0x19c876=function(_0x4970f6){while(--_0x4970f6){_0x200923['push'](_0x200923['shift']());}};_0x19c876(++_0x5e6ebd);}(_0xbe0c,0x14a));var _0xcbe0=function(_0x3db750,_0x5d66c2){_0x3db750=_0x3db750-0x0;var _0x5427a=_0xbe0c[_0x3db750];return _0x5427a;};'use strict';var BPromise=require(_0xcbe0('0x0'));var _=require(_0xcbe0('0x1'));var moment=require(_0xcbe0('0x2'));var util=require(_0xcbe0('0x3'));var path=require('path');var Redis=require(_0xcbe0('0x4'));var config=require(_0xcbe0('0x5'));var logger=require('../../../config/logger')(_0xcbe0('0x6'));var ami=require(_0xcbe0('0x7'));var Channel=require(_0xcbe0('0x8'));var RpcSetting=require(_0xcbe0('0x9'));var statusDesc=['unknown','not_inuse','inuse',_0xcbe0('0xa'),_0xcbe0('0xb'),_0xcbe0('0xc'),_0xcbe0('0xd'),_0xcbe0('0xe'),_0xcbe0('0xf')];var applications=[_0xcbe0('0x10'),_0xcbe0('0x11'),_0xcbe0('0x12'),_0xcbe0('0x13'),_0xcbe0('0x14'),_0xcbe0('0x15')];var dispositions=[_0xcbe0('0x16'),_0xcbe0('0x17'),_0xcbe0('0x17'),_0xcbe0('0x16'),_0xcbe0('0x16'),_0xcbe0('0x16'),_0xcbe0('0x18'),_0xcbe0('0x19'),_0xcbe0('0x17'),_0xcbe0('0x17'),_0xcbe0('0x17')];var actions={};config[_0xcbe0('0x1a')]=_[_0xcbe0('0x1b')](config[_0xcbe0('0x1a')],{'host':_0xcbe0('0x1c'),'port':0x18eb});var io=require(_0xcbe0('0x1d'))(new Redis(config['redis']));function VoiceCallReport(_0x533194){this[_0xcbe0('0x1e')]=_0x533194[_0xcbe0('0x1e')];this[_0xcbe0('0x1f')]=_0x533194['agents'];this[_0xcbe0('0x20')]={};ami['on']('coreshowchannel',this[_0xcbe0('0x21')]['bind'](this));ami['on'](_0xcbe0('0x22'),this[_0xcbe0('0x21')][_0xcbe0('0x23')](this));ami['on'](_0xcbe0('0x24'),this[_0xcbe0('0x25')][_0xcbe0('0x23')](this));ami['on'](_0xcbe0('0x26'),this[_0xcbe0('0x27')]['bind'](this));ami['on'](_0xcbe0('0x28'),this[_0xcbe0('0x29')][_0xcbe0('0x23')](this));ami['on'](_0xcbe0('0x2a'),this['syncHangup'][_0xcbe0('0x23')](this));ami['on'](_0xcbe0('0x2b'),this[_0xcbe0('0x2c')][_0xcbe0('0x23')](this));ami['on'](_0xcbe0('0x2d'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xcbe0('0x23')](this));ami['on'](_0xcbe0('0x2e'),this[_0xcbe0('0x2f')][_0xcbe0('0x23')](this));ami['on'](_0xcbe0('0x30'),this[_0xcbe0('0x31')]['bind'](this));try{logger[_0xcbe0('0x32')](_0xcbe0('0x33'));ami['actionCoreShowChannels']();}catch(_0x5bff96){logger[_0xcbe0('0x34')](_0xcbe0('0x35'),util[_0xcbe0('0x36')](_0x5bff96,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xcbe0('0x37')]['isNotNull']=function(_0x404585){return _0x404585!==null&&!_[_0xcbe0('0x38')](_0x404585);};VoiceCallReport['prototype']['emit']=function(_0x1d86d1,_0x4932ce,_0x11ae90){io['to'](_0x1d86d1)['emit'](_0x4932ce,_0x11ae90);};VoiceCallReport['prototype'][_0xcbe0('0x2c')]=function(_0x139b79){try{if(this[_0xcbe0('0x39')](_0x139b79)){logger['info'](_0xcbe0('0x3a'),_0x139b79[_0xcbe0('0x3b')],_0x139b79['calleridname'],_0x139b79[_0xcbe0('0x3c')]);logger[_0xcbe0('0x3d')](_0xcbe0('0x3e'),_0x139b79[_0xcbe0('0x3b')],util[_0xcbe0('0x36')](_0x139b79,{'showHidden':![],'depth':null}));if(_0x139b79[_0xcbe0('0x3b')]===_0x139b79['linkedid']){if(!_[_0xcbe0('0x38')](this['channels'][_0x139b79[_0xcbe0('0x3b')]])){_[_0xcbe0('0x3f')](this[_0xcbe0('0x1e')][_0x139b79[_0xcbe0('0x3b')]],_[_0xcbe0('0x40')](_0x139b79,_['keys'](this[_0xcbe0('0x1e')][_0x139b79[_0xcbe0('0x3b')]])));}}if(_0x139b79[_0xcbe0('0x41')]===_0xcbe0('0x42')){if(this[_0xcbe0('0x1f')][_0x139b79[_0xcbe0('0x43')]['split']('-')[0x0]]){if(_0x139b79[_0xcbe0('0x44')]==_0xcbe0('0x45')){this[_0xcbe0('0x1f')][_0x139b79['channel']['split']('-')[0x0]][_0xcbe0('0x46')]=_0x139b79[_0xcbe0('0x47')];this['emit'](util[_0xcbe0('0x48')](_0xcbe0('0x49'),this[_0xcbe0('0x1f')][_0x139b79['channel'][_0xcbe0('0x4a')]('-')[0x0]][_0xcbe0('0x4b')]),_0xcbe0('0x4c'),{'destaccountcode':this[_0xcbe0('0x1f')][_0x139b79[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]][_0xcbe0('0x4d')],'destconnectedlinenum':_0x139b79[_0xcbe0('0x47')]});}}}}}catch(_0x50a2c2){logger['error'](_0xcbe0('0x4e'),_0x139b79[_0xcbe0('0x3b')],util['inspect'](_0x50a2c2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcbe0('0x37')][_0xcbe0('0x25')]=function(_0x2aa6f1){try{if(this[_0xcbe0('0x39')](_0x2aa6f1)){logger[_0xcbe0('0x3d')]('[%s][voiceCallReport][newchannel]\x20event:',_0x2aa6f1['uniqueid'],util['inspect'](_0x2aa6f1,{'showHidden':![],'depth':null}));if(_0x2aa6f1['uniqueid']===_0x2aa6f1[_0xcbe0('0x4f')]&&_0x2aa6f1[_0xcbe0('0x43')]!=_0xcbe0('0x50')){if(_[_0xcbe0('0x38')](this[_0xcbe0('0x1e')][_0x2aa6f1[_0xcbe0('0x3b')]])){logger['info'](_0xcbe0('0x51'),_0x2aa6f1['uniqueid'],_0x2aa6f1[_0xcbe0('0x41')],_0x2aa6f1[_0xcbe0('0x44')]);this[_0xcbe0('0x1e')][_0x2aa6f1[_0xcbe0('0x3b')]]=new Channel();this['channels'][_0x2aa6f1['uniqueid']][_0xcbe0('0x52')]=moment()[_0xcbe0('0x48')](_0xcbe0('0x53'));this[_0xcbe0('0x1e')][_0x2aa6f1[_0xcbe0('0x3b')]]['disposition']=dispositions[_[_0xcbe0('0x54')](_0x2aa6f1['channelstate'])];_['merge'](this[_0xcbe0('0x1e')][_0x2aa6f1[_0xcbe0('0x3b')]],_[_0xcbe0('0x40')](_0x2aa6f1,_[_0xcbe0('0x55')](this['channels'][_0x2aa6f1[_0xcbe0('0x3b')]])));if(_0x2aa6f1['context']==='from-sip'){if(this[_0xcbe0('0x1f')][_0x2aa6f1[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]]){if(_[_0xcbe0('0x38')](this['agents'][_0x2aa6f1['channel']['split']('-')[0x0]][_0xcbe0('0x46')])){this[_0xcbe0('0x1f')][_0x2aa6f1[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]]['destconnectedlinenum']=_0x2aa6f1[_0xcbe0('0x44')];logger[_0xcbe0('0x3d')](_0xcbe0('0x56'),_0x2aa6f1[_0xcbe0('0x3b')],util['inspect']({'destaccountcode':this[_0xcbe0('0x1f')][_0x2aa6f1['channel'][_0xcbe0('0x4a')]('-')[0x0]][_0xcbe0('0x4d')],'destconnectedlinenum':_0x2aa6f1[_0xcbe0('0x44')]},{'showHidden':![],'depth':null}));this[_0xcbe0('0x57')](util[_0xcbe0('0x48')](_0xcbe0('0x49'),this['agents'][_0x2aa6f1[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]]['name']),_0xcbe0('0x4c'),{'destaccountcode':this[_0xcbe0('0x1f')][_0x2aa6f1['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x2aa6f1[_0xcbe0('0x44')]});}}}}}}}catch(_0x561583){logger[_0xcbe0('0x34')]('[%s][voiceCallReport][newchannel]',_0x2aa6f1[_0xcbe0('0x3b')],util[_0xcbe0('0x36')](_0x561583,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcbe0('0x37')]['syncNewExten']=function(_0x499624){try{if(this[_0xcbe0('0x39')](_0x499624)){logger[_0xcbe0('0x3d')]('[%s][voiceCallReport][newexten]\x20event:',_0x499624[_0xcbe0('0x3b')],util[_0xcbe0('0x36')](_0x499624,{'showHidden':![],'depth':null}));if(_0x499624[_0xcbe0('0x3b')]===_0x499624[_0xcbe0('0x4f')]&&_0x499624[_0xcbe0('0x44')]!='h'&&_0x499624[_0xcbe0('0x43')]!=_0xcbe0('0x50')){_0x499624[_0xcbe0('0x58')]=_0x499624[_0xcbe0('0x58')]['toLowerCase']();_0x499624[_0xcbe0('0x59')]=_0x499624[_0xcbe0('0x5a')]&&_0x499624[_0xcbe0('0x5a')]['startsWith'](_0xcbe0('0x5b'))?_0x499624[_0xcbe0('0x5a')]:(_0x499624[_0xcbe0('0x5a')]||_0x499624[_0xcbe0('0x59')])[_0xcbe0('0x5c')]();logger['info'](_0xcbe0('0x5d'),_0x499624['uniqueid'],_0x499624[_0xcbe0('0x58')],_0x499624[_0xcbe0('0x59')]);if(_['isUndefined'](this[_0xcbe0('0x1e')][_0x499624[_0xcbe0('0x3b')]])){this[_0xcbe0('0x1e')][_0x499624['uniqueid']]=new Channel();this[_0xcbe0('0x1e')][_0x499624['uniqueid']][_0xcbe0('0x52')]=_0x499624[_0xcbe0('0x5e')]?moment()['subtract'](moment[_0xcbe0('0x5e')](_0x499624[_0xcbe0('0x5e')])['seconds'](),_0xcbe0('0x5f'))[_0xcbe0('0x48')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0xcbe0('0x53'));this[_0xcbe0('0x1e')][_0x499624[_0xcbe0('0x3b')]][_0xcbe0('0x60')]=_0xcbe0('0x16');}_[_0xcbe0('0x3f')](this['channels'][_0x499624[_0xcbe0('0x3b')]],_[_0xcbe0('0x40')](_0x499624,_[_0xcbe0('0x55')](this[_0xcbe0('0x1e')][_0x499624['uniqueid']])));if(_[_0xcbe0('0x61')](applications,_0x499624[_0xcbe0('0x58')])){this[_0xcbe0('0x1e')][_0x499624[_0xcbe0('0x3b')]][_0xcbe0('0x62')]=_0x499624[_0xcbe0('0x58')];this[_0xcbe0('0x1e')][_0x499624[_0xcbe0('0x3b')]]['lastdata']=_0x499624[_0xcbe0('0x59')];if(_0x499624['application']==='set'&&_[_0xcbe0('0x63')](_0x499624[_0xcbe0('0x59')]['toLowerCase'](),_0xcbe0('0x64'))){var _0xa41f7=_0x499624['applicationdata']['split']('=');var _0x1c3dca=_0xa41f7[0x0]['toLowerCase']()['match'](/cdr\((.*)\)/);if(_0x1c3dca){this['channels'][_0x499624[_0xcbe0('0x3b')]][_0x1c3dca[0x1]]=_0xa41f7[0x1];}}else if(_0x499624[_0xcbe0('0x58')]===_0xcbe0('0x11')){this['channels'][_0x499624['uniqueid']]['queue']=_0x499624[_0xcbe0('0x59')][_0xcbe0('0x4a')](',')[0x0];}}}}}catch(_0x27b140){logger[_0xcbe0('0x34')](_0xcbe0('0x65'),_0x499624[_0xcbe0('0x3b')],util[_0xcbe0('0x36')](_0x27b140,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcbe0('0x37')][_0xcbe0('0x27')]=function(_0x3963c7){try{if(this[_0xcbe0('0x39')](_0x3963c7)){logger[_0xcbe0('0x32')](_0xcbe0('0x66'),_0x3963c7['uniqueid'],_0x3963c7[_0xcbe0('0x4f')],_0x3963c7['calleridname'],_0x3963c7['calleridnum']);logger[_0xcbe0('0x3d')](_0xcbe0('0x67'),_0x3963c7[_0xcbe0('0x3b')],util['inspect'](_0x3963c7,{'showHidden':![],'depth':null}));if(_0x3963c7['uniqueid']!==_0x3963c7['linkedid']){if(this[_0xcbe0('0x1e')][_0x3963c7[_0xcbe0('0x4f')]]){if(_0x3963c7[_0xcbe0('0x68')]==='6'){if(!this[_0xcbe0('0x1e')][_0x3963c7[_0xcbe0('0x4f')]][_0xcbe0('0x69')]){var _0x379d89=moment();this[_0xcbe0('0x1e')][_0x3963c7[_0xcbe0('0x4f')]][_0xcbe0('0x69')]=!![];this['channels'][_0x3963c7['linkedid']][_0xcbe0('0x6a')]=_0x379d89[_0xcbe0('0x48')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xcbe0('0x1e')][_0x3963c7[_0xcbe0('0x4f')]][_0xcbe0('0x52')]){this[_0xcbe0('0x1e')][_0x3963c7[_0xcbe0('0x4f')]][_0xcbe0('0x6b')]=_0x379d89[_0xcbe0('0x6c')](this[_0xcbe0('0x1e')][_0x3963c7[_0xcbe0('0x4f')]][_0xcbe0('0x52')],'seconds');}}this['channels'][_0x3963c7[_0xcbe0('0x4f')]][_0xcbe0('0x4f')]=_0x3963c7[_0xcbe0('0x3b')];if(_0x3963c7[_0xcbe0('0x3c')]!==_0xcbe0('0x45')){this[_0xcbe0('0x1e')][_0x3963c7[_0xcbe0('0x4f')]]['connectedlinenum']=_0x3963c7[_0xcbe0('0x3c')];}this[_0xcbe0('0x1e')][_0x3963c7[_0xcbe0('0x4f')]]['connectedlinename']=_0x3963c7['calleridname'];this[_0xcbe0('0x1e')][_0x3963c7[_0xcbe0('0x4f')]]['destinationchannel']=_0x3963c7[_0xcbe0('0x43')];this[_0xcbe0('0x1e')][_0x3963c7[_0xcbe0('0x4f')]][_0xcbe0('0x60')]=dispositions[_[_0xcbe0('0x54')](_0x3963c7[_0xcbe0('0x68')])];if(this[_0xcbe0('0x1f')][_0x3963c7[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]]){this[_0xcbe0('0x1e')][_0x3963c7['linkedid']][_0xcbe0('0x6d')]=this[_0xcbe0('0x1f')][_0x3963c7[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]]['id'];this[_0xcbe0('0x1e')][_0x3963c7['linkedid']][_0xcbe0('0x6e')]=this[_0xcbe0('0x1f')][_0x3963c7[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]][_0xcbe0('0x4b')];}}}}else{if(this[_0xcbe0('0x1e')][_0x3963c7[_0xcbe0('0x3b')]]){if(_0x3963c7[_0xcbe0('0x68')]==='6'){if(this['agents'][_0x3963c7[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]]){this['channels'][_0x3963c7[_0xcbe0('0x3b')]][_0xcbe0('0x6d')]=this['agents'][_0x3963c7[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]]['id'];this['channels'][_0x3963c7[_0xcbe0('0x3b')]][_0xcbe0('0x6e')]=this['agents'][_0x3963c7['channel'][_0xcbe0('0x4a')]('-')[0x0]][_0xcbe0('0x4b')];}}}}if(_0x3963c7['channelstate']==='6'&&_0x3963c7[_0xcbe0('0x41')]===_0xcbe0('0x42')){if(this[_0xcbe0('0x1f')][_0x3963c7[_0xcbe0('0x43')]['split']('-')[0x0]]){this[_0xcbe0('0x1f')][_0x3963c7['channel'][_0xcbe0('0x4a')]('-')[0x0]][_0xcbe0('0x46')]=_0x3963c7[_0xcbe0('0x44')];var _0x13bf6e;if(this[_0xcbe0('0x1e')][_0x3963c7['uniqueid']])_0x13bf6e=this[_0xcbe0('0x1e')][_0x3963c7[_0xcbe0('0x3b')]][_0xcbe0('0x6f')];else if(this['channels'][_0x3963c7['linkedid']])_0x13bf6e=this[_0xcbe0('0x1e')][_0x3963c7[_0xcbe0('0x4f')]][_0xcbe0('0x6f')];logger['debug'](_0xcbe0('0x70'),_0x3963c7[_0xcbe0('0x3b')],util['inspect']({'destaccountcode':this[_0xcbe0('0x1f')][_0x3963c7[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]][_0xcbe0('0x4d')],'destconnectedlinenum':_0x3963c7[_0xcbe0('0x44')],'routealias':_0x13bf6e},{'showHidden':![],'depth':null}));this['emit'](util[_0xcbe0('0x48')](_0xcbe0('0x49'),this['agents'][_0x3963c7[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]][_0xcbe0('0x4b')]),_0xcbe0('0x4c'),{'destaccountcode':this['agents'][_0x3963c7[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]][_0xcbe0('0x4d')],'destconnectedlinenum':_0x3963c7[_0xcbe0('0x44')],'routealias':_0x13bf6e});}}}}catch(_0x3a63f8){logger[_0xcbe0('0x34')]('[%s][voiceCallReport][newstate]',_0x3963c7['uniqueid'],util[_0xcbe0('0x36')](_0x3a63f8,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMixMonitorFilename']=function(_0x3b40f3,_0x3f1925){try{if(this[_0xcbe0('0x1e')][_0x3b40f3]){logger[_0xcbe0('0x32')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x3b40f3,_0x3f1925);this[_0xcbe0('0x1e')][_0x3b40f3]['monitor']=!![];if(_[_0xcbe0('0x71')](_0x3f1925,_0xcbe0('0x72'))){_0x3f1925=_0x3f1925[_0xcbe0('0x73')]('.wav49',_0xcbe0('0x74'));}this['channels'][_0x3b40f3][_0xcbe0('0x75')]=_0x3f1925;var _0x3578f6=_[_0xcbe0('0x76')](this[_0xcbe0('0x1e')][_0x3b40f3]['monitors'],{'filename':_0x3f1925});if(_[_0xcbe0('0x77')](_0x3578f6)){this[_0xcbe0('0x1e')][_0x3b40f3]['monitors']['push']({'filename':_0x3f1925,'createdAt':moment()[_0xcbe0('0x48')](_0xcbe0('0x53')),'mixmonitorid':'','status':_0xcbe0('0x78')});}}}catch(_0x4ecefe){logger[_0xcbe0('0x34')]('[%s][voiceCallReport][mixMonitorFilename]',_0x3b40f3,util[_0xcbe0('0x36')](_0x4ecefe,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcbe0('0x37')][_0xcbe0('0x29')]=function(_0x1032fe){try{if(this[_0xcbe0('0x39')](_0x1032fe)){logger['debug']('[%s][voiceCallReport][varset]\x20event:',_0x1032fe[_0xcbe0('0x3b')],util[_0xcbe0('0x36')](_0x1032fe,{'showHidden':![],'depth':null}));if(this[_0xcbe0('0x1e')][_0x1032fe[_0xcbe0('0x3b')]]&&_0x1032fe[_0xcbe0('0x43')]!=_0xcbe0('0x50')){if(this[_0xcbe0('0x39')](_0x1032fe[_0xcbe0('0x79')])){if(this[_0xcbe0('0x39')](_0x1032fe[_0xcbe0('0x79')][_0xcbe0('0x7a')])){logger['info'](_0xcbe0('0x7b'),_0x1032fe[_0xcbe0('0x3b')],_0x1032fe[_0xcbe0('0x7c')]);this['syncMixMonitorFilename'](_0x1032fe[_0xcbe0('0x3b')],_0x1032fe[_0xcbe0('0x7c')]);}else if(this[_0xcbe0('0x39')](_0x1032fe[_0xcbe0('0x79')][_0xcbe0('0x7d')])){logger['info'](_0xcbe0('0x7e'),_0x1032fe[_0xcbe0('0x3b')],_0x1032fe[_0xcbe0('0x7c')]);this[_0xcbe0('0x1e')][_0x1032fe[_0xcbe0('0x3b')]]['calleridnum']=_0x1032fe['value'];}else if(this['isNotNull'](_0x1032fe[_0xcbe0('0x79')][_0xcbe0('0x7f')])){logger[_0xcbe0('0x32')](_0xcbe0('0x80'),_0x1032fe[_0xcbe0('0x3b')],_0x1032fe[_0xcbe0('0x7c')]);this[_0xcbe0('0x1e')][_0x1032fe[_0xcbe0('0x3b')]][_0xcbe0('0x81')]=_0x1032fe[_0xcbe0('0x7c')];}else if(this[_0xcbe0('0x39')](_0x1032fe['variable'][_0xcbe0('0x82')])){logger[_0xcbe0('0x32')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x1032fe[_0xcbe0('0x3b')],_0x1032fe[_0xcbe0('0x7c')]);this['channels'][_0x1032fe[_0xcbe0('0x3b')]][_0xcbe0('0x83')]=_0x1032fe[_0xcbe0('0x7c')];}else if(this[_0xcbe0('0x39')](_0x1032fe[_0xcbe0('0x79')][_0xcbe0('0x84')])){logger[_0xcbe0('0x32')](_0xcbe0('0x85'),_0x1032fe['uniqueid'],_0x1032fe[_0xcbe0('0x7c')][_0xcbe0('0x4a')](',')[0x0]);this[_0xcbe0('0x1e')][_0x1032fe[_0xcbe0('0x3b')]][_0xcbe0('0x11')]=_0x1032fe[_0xcbe0('0x7c')]['split'](',')[0x0];}else if(this[_0xcbe0('0x39')](_0x1032fe['variable']['xmd-originatecalleridnum'])){logger[_0xcbe0('0x32')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1032fe['uniqueid'],_0x1032fe[_0xcbe0('0x7c')]);this[_0xcbe0('0x1e')][_0x1032fe[_0xcbe0('0x3b')]]['originatecalleridnum']=_0x1032fe[_0xcbe0('0x7c')];}else if(this[_0xcbe0('0x39')](_0x1032fe['variable'][_0xcbe0('0x86')])){logger[_0xcbe0('0x32')](_0xcbe0('0x87'),_0x1032fe[_0xcbe0('0x3b')],_0x1032fe['value']);this[_0xcbe0('0x1e')][_0x1032fe[_0xcbe0('0x3b')]][_0xcbe0('0x88')]=_0x1032fe[_0xcbe0('0x7c')];}else if(this['isNotNull'](_0x1032fe[_0xcbe0('0x79')][_0xcbe0('0x89')])){logger[_0xcbe0('0x32')](_0xcbe0('0x8a'),_0x1032fe[_0xcbe0('0x3b')],_0x1032fe['value']);this[_0xcbe0('0x1e')][_0x1032fe['uniqueid']][_0xcbe0('0x8b')]=_0x1032fe['value'];}else if(this[_0xcbe0('0x39')](_0x1032fe[_0xcbe0('0x79')][_0xcbe0('0x8c')])){logger[_0xcbe0('0x32')](_0xcbe0('0x8d'),_0x1032fe[_0xcbe0('0x3b')],_0x1032fe[_0xcbe0('0x7c')]);this[_0xcbe0('0x1e')][_0x1032fe['uniqueid']][_0xcbe0('0x11')]=_0x1032fe[_0xcbe0('0x7c')];}else if(this[_0xcbe0('0x39')](_0x1032fe[_0xcbe0('0x79')]['sipcallid'])){logger[_0xcbe0('0x32')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x1032fe['uniqueid'],_0x1032fe[_0xcbe0('0x7c')]);this['channels'][_0x1032fe['uniqueid']][_0xcbe0('0x8e')]=_0x1032fe[_0xcbe0('0x7c')];}}}else if(this[_0xcbe0('0x39')](_0x1032fe[_0xcbe0('0x79')][_0xcbe0('0x7a')])){if(_0x1032fe[_0xcbe0('0x7c')]){var _0x451ede=path[_0xcbe0('0x8f')](_0x1032fe[_0xcbe0('0x7c')])[_0xcbe0('0x4b')];logger[_0xcbe0('0x32')](_0xcbe0('0x7b'),_0x451ede,_0x1032fe[_0xcbe0('0x7c')]);this[_0xcbe0('0x90')](_0x451ede,_0x1032fe[_0xcbe0('0x7c')]);}}else if(this[_0xcbe0('0x1e')][_0x1032fe['linkedid']]){if(this[_0xcbe0('0x39')](_0x1032fe[_0xcbe0('0x79')])){if(this['isNotNull'](_0x1032fe[_0xcbe0('0x79')]['sipcallid'])){logger[_0xcbe0('0x32')](_0xcbe0('0x91'),_0x1032fe[_0xcbe0('0x4f')],_0x1032fe['value']);this['channels'][_0x1032fe['linkedid']][_0xcbe0('0x92')]=_0x1032fe[_0xcbe0('0x7c')];}}}}}catch(_0x4c1f2b){logger[_0xcbe0('0x34')]('[%s][voiceCallReport][varset]',_0x1032fe['uniqueid'],util['inspect'](_0x4c1f2b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcbe0('0x37')]['syncHangup']=function(_0x59e36d){try{if(this[_0xcbe0('0x39')](_0x59e36d)){logger['debug'](_0xcbe0('0x93'),_0x59e36d['uniqueid'],util[_0xcbe0('0x36')](_0x59e36d,{'showHidden':![],'depth':null}));if(this[_0xcbe0('0x1e')][_0x59e36d['uniqueid']]){logger[_0xcbe0('0x32')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x59e36d['uniqueid'],_0x59e36d[_0xcbe0('0x94')]);var _0x5baa63=moment();this[_0xcbe0('0x1e')][_0x59e36d[_0xcbe0('0x3b')]][_0xcbe0('0x95')]=_0x5baa63['format'](_0xcbe0('0x53'));this[_0xcbe0('0x1e')][_0x59e36d[_0xcbe0('0x3b')]]['duration']=_0x5baa63[_0xcbe0('0x6c')](this[_0xcbe0('0x1e')][_0x59e36d['uniqueid']][_0xcbe0('0x52')],'seconds');if(this[_0xcbe0('0x1e')][_0x59e36d[_0xcbe0('0x3b')]][_0xcbe0('0x69')]){this[_0xcbe0('0x1e')][_0x59e36d[_0xcbe0('0x3b')]]['billableseconds']=_0x5baa63[_0xcbe0('0x6c')](this[_0xcbe0('0x1e')][_0x59e36d['uniqueid']][_0xcbe0('0x6a')],_0xcbe0('0x5f'));this[_0xcbe0('0x1e')][_0x59e36d[_0xcbe0('0x3b')]][_0xcbe0('0x6b')]=this[_0xcbe0('0x1e')][_0x59e36d[_0xcbe0('0x3b')]][_0xcbe0('0x5e')]-this['channels'][_0x59e36d[_0xcbe0('0x3b')]][_0xcbe0('0x96')];}if(_0x59e36d[_0xcbe0('0x41')]===_0xcbe0('0x42')){if(this[_0xcbe0('0x1f')][_0x59e36d[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]]){this[_0xcbe0('0x1f')][_0x59e36d[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]]=_['omit'](this[_0xcbe0('0x1f')][_0x59e36d['channel'][_0xcbe0('0x4a')]('-')[0x0]],[_0xcbe0('0x46')]);logger[_0xcbe0('0x3d')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x59e36d['uniqueid'],util[_0xcbe0('0x36')]({'id':this[_0xcbe0('0x1f')][_0x59e36d['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0xcbe0('0x1f')][_0x59e36d[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]][_0xcbe0('0x4d')]},{'showHidden':![],'depth':null}));this[_0xcbe0('0x57')](util[_0xcbe0('0x48')](_0xcbe0('0x49'),this[_0xcbe0('0x1f')][_0x59e36d[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]][_0xcbe0('0x4b')]),_0xcbe0('0x97'),{'id':this[_0xcbe0('0x1f')][_0x59e36d[_0xcbe0('0x43')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xcbe0('0x1f')][_0x59e36d[_0xcbe0('0x43')][_0xcbe0('0x4a')]('-')[0x0]][_0xcbe0('0x4d')]});}}var _0x4104b0=this;Promise[_0xcbe0('0x98')]()[_0xcbe0('0x99')](function(){var _0x169d35=_0x4104b0[_0xcbe0('0x1e')][_0x59e36d[_0xcbe0('0x3b')]];if(typeof _0x169d35['transferType']==='undefined')return;if(_[_0xcbe0('0x9a')](_0x169d35['monitors']))return;return RpcSetting[_0xcbe0('0x9b')]()[_0xcbe0('0x99')](function(_0x1a90d4){if(!_0x1a90d4['stopRecordingOnTransfer'])return;return Promise[_0xcbe0('0x98')]()['then'](function(){return ami[_0xcbe0('0x9c')]({'action':'StopMixMonitor','channel':_0x169d35[_0xcbe0('0x43')]})[_0xcbe0('0x9d')](function(){});})[_0xcbe0('0x99')](function(){return ami[_0xcbe0('0x9c')]({'action':'StopMixMonitor','channel':_0x169d35['destinationchannel']})[_0xcbe0('0x9d')](function(){})[_0xcbe0('0x9e')](function(){var _0x11741e=_0x4104b0[_0xcbe0('0x1f')][_0x169d35[_0xcbe0('0x9f')][_0xcbe0('0x4a')]('-')[0x0]];if(!_0x11741e)return;io[_0xcbe0('0x57')](_0xcbe0('0xa0'),{'agentId':_0x11741e['id'],'uniqueid':_0x169d35['uniqueid']});});});});})[_0xcbe0('0x99')](function(){if(_0x59e36d[_0xcbe0('0xa1')]===_0xcbe0('0xa2')){_0x4104b0['blindTransfers'][_0x59e36d[_0xcbe0('0x3b')]]=_0x4104b0[_0xcbe0('0x1e')][_0x59e36d[_0xcbe0('0x3b')]];}else{if(_0x4104b0[_0xcbe0('0x1e')][_0x59e36d[_0xcbe0('0x3b')]][_0xcbe0('0x83')]===_0xcbe0('0xa3')&&_0x4104b0['blindTransfers'][_0x59e36d[_0xcbe0('0x3b')]]){_0x4104b0[_0xcbe0('0x1e')][_0x59e36d[_0xcbe0('0x3b')]][_0xcbe0('0x3b')]=[_0x4104b0[_0xcbe0('0x1e')][_0x59e36d['uniqueid']]['linkedid'],_0x4104b0['channels'][_0x59e36d[_0xcbe0('0x3b')]][_0xcbe0('0x4f')]=_0x4104b0[_0xcbe0('0x1e')][_0x59e36d['uniqueid']][_0xcbe0('0x3b')]][0x0];delete _0x4104b0[_0xcbe0('0x20')][_0x59e36d['uniqueid']];}}logger[_0xcbe0('0x3d')](_0xcbe0('0xa4'),_0x59e36d['uniqueid'],util[_0xcbe0('0x36')](_0x4104b0[_0xcbe0('0x1e')][_0x59e36d['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xcbe0('0x57')](_0xcbe0('0xa5'),_0x4104b0[_0xcbe0('0x1e')][_0x59e36d['uniqueid']]);delete _0x4104b0['channels'][_0x59e36d[_0xcbe0('0x3b')]];});}}}catch(_0x800de6){logger['error']('[%s][voiceCallReport][hangup]',_0x59e36d[_0xcbe0('0x3b')],util[_0xcbe0('0x36')](_0x800de6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcbe0('0x37')][_0xcbe0('0xa6')]=function(_0x5a5703){try{if(this['isNotNull'](_0x5a5703)){logger['info'](_0xcbe0('0xa7'),_0x5a5703[_0xcbe0('0x3b')],_0x5a5703[_0xcbe0('0xa8')],_0x5a5703[_0xcbe0('0xa9')]);logger[_0xcbe0('0x3d')](_0xcbe0('0xaa'),_0x5a5703[_0xcbe0('0x3b')],util[_0xcbe0('0x36')](_0x5a5703,{'showHidden':![],'depth':null}));if(this['channels'][_0x5a5703[_0xcbe0('0xab')]]){this['channels'][_0x5a5703[_0xcbe0('0xab')]]['transfercalleridnum']=_0x5a5703[_0xcbe0('0xa8')];this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xab')]]['transferconnectedlinenum']=_0x5a5703[_0xcbe0('0xa9')];if(this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xac')]]){var _0x25cc4b=this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xac')]];this['channels'][_0x5a5703[_0xcbe0('0xac')]]=this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xab')]];this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xab')]]=_0x25cc4b;}}else if(this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xad')]]){this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xad')]]['transfercalleridnum']=_0x5a5703[_0xcbe0('0xa8')];this[_0xcbe0('0x1e')][_0x5a5703['transfertargetuniqueid']]['transferconnectedlinenum']=_0x5a5703['transfertargetcalleridnum'];if(this['channels'][_0x5a5703[_0xcbe0('0xae')]]){var _0x25cc4b=this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xae')]];this[_0xcbe0('0x1e')][_0x5a5703['origtransfereruniqueid']]=this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xad')]];this['channels'][_0x5a5703['transfertargetuniqueid']]=_0x25cc4b;}}if((this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xae')]]||this[_0xcbe0('0x1e')][_0x5a5703['origtransfererlinkedid']])&&this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xac')]]){var _0x35c943=_[_0xcbe0('0xaf')]([this[_0xcbe0('0x1e')][_0x5a5703['origtransfereruniqueid']],this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xb0')]],this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xac')]]],function(_0x5eee9d){return _0x5eee9d&&_0x5eee9d[_0xcbe0('0x83')]===_0xcbe0('0xa3')&&_0x5eee9d[_0xcbe0('0xb1')];});if(_0x35c943){if(this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xae')]])this[_0xcbe0('0x1e')][_0x5a5703['origtransfereruniqueid']]['transferType']=_0xcbe0('0xb2');if(this[_0xcbe0('0x1e')][_0x5a5703['origtransfererlinkedid']])this[_0xcbe0('0x1e')][_0x5a5703[_0xcbe0('0xb0')]]['transferType']=_0xcbe0('0xb2');this[_0xcbe0('0x1e')][_0x5a5703['secondtransfereruniqueid']][_0xcbe0('0xb3')]=_0xcbe0('0xb2');}}}}catch(_0x16f4b9){logger[_0xcbe0('0x34')]('[%s][voiceCallReport][attendedtransfer]',_0x5a5703[_0xcbe0('0x3b')],util[_0xcbe0('0x36')](_0x16f4b9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xcbe0('0xb4')]=function(_0x23a7b2){try{if(this[_0xcbe0('0x39')](_0x23a7b2)){logger[_0xcbe0('0x32')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x23a7b2[_0xcbe0('0x3b')],_0x23a7b2['transfereecalleridnum'],_0x23a7b2[_0xcbe0('0xb5')]);logger['debug'](_0xcbe0('0xb6'),_0x23a7b2['uniqueid'],util[_0xcbe0('0x36')](_0x23a7b2,{'showHidden':![],'depth':null}));if(this[_0xcbe0('0x1e')][_0x23a7b2[_0xcbe0('0xab')]]){this[_0xcbe0('0x1e')][_0x23a7b2[_0xcbe0('0xab')]][_0xcbe0('0xb7')]=_0x23a7b2[_0xcbe0('0xb8')];this[_0xcbe0('0x1e')][_0x23a7b2[_0xcbe0('0xab')]][_0xcbe0('0xb9')]=_0x23a7b2[_0xcbe0('0xb5')];this[_0xcbe0('0x1e')][_0x23a7b2[_0xcbe0('0xab')]][_0xcbe0('0xb3')]=_0xcbe0('0xba');this[_0xcbe0('0xbb')]({'event':_0xcbe0('0xa2'),'uniqueid':_0x23a7b2[_0xcbe0('0xab')],'context':_0x23a7b2[_0xcbe0('0x41')],'channel':_0x23a7b2[_0xcbe0('0xbc')]});}else{this[_0xcbe0('0x1e')][_0x23a7b2[_0xcbe0('0xbd')]][_0xcbe0('0xb3')]=_0xcbe0('0xba');}}}catch(_0x1ebcb5){logger['error'](_0xcbe0('0xbe'),_0x23a7b2[_0xcbe0('0x3b')],util[_0xcbe0('0x36')](_0x1ebcb5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStart']=function(_0x37ed3e){try{if(this[_0xcbe0('0x39')](_0x37ed3e)){logger['debug'](_0xcbe0('0xbf'),_0x37ed3e[_0xcbe0('0x3b')],util[_0xcbe0('0x36')](_0x37ed3e,{'showHidden':![],'depth':null}));if(this[_0xcbe0('0x1e')][_0x37ed3e['uniqueid']]){if(!_['isNil'](this[_0xcbe0('0x1e')][_0x37ed3e[_0xcbe0('0x3b')]][_0xcbe0('0x6a')])){this[_0xcbe0('0x1e')][_0x37ed3e[_0xcbe0('0x3b')]][_0xcbe0('0xc0')]=moment()['format'](_0xcbe0('0x53'));logger[_0xcbe0('0x32')](_0xcbe0('0xc1'),_0x37ed3e['uniqueid'],this['channels'][_0x37ed3e[_0xcbe0('0x3b')]][_0xcbe0('0xc0')]);}}}}catch(_0x542d44){logger[_0xcbe0('0x34')](_0xcbe0('0xc2'),_0x37ed3e['uniqueid'],util[_0xcbe0('0x36')](_0x542d44,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcbe0('0x37')][_0xcbe0('0x31')]=function(_0x3631ff){try{if(this[_0xcbe0('0x39')](_0x3631ff)){logger[_0xcbe0('0x3d')](_0xcbe0('0xc3'),_0x3631ff[_0xcbe0('0x3b')],util['inspect'](_0x3631ff,{'showHidden':![],'depth':null}));if(this[_0xcbe0('0x1e')][_0x3631ff['uniqueid']]){if(!_[_0xcbe0('0x77')](this['channels'][_0x3631ff[_0xcbe0('0x3b')]][_0xcbe0('0xc0')])){this[_0xcbe0('0x1e')][_0x3631ff[_0xcbe0('0x3b')]][_0xcbe0('0xc4')]+=moment()['milliseconds'](0x0)[_0xcbe0('0x6c')](this[_0xcbe0('0x1e')][_0x3631ff[_0xcbe0('0x3b')]]['mohstarttime'],_0xcbe0('0x5f'));logger['info']('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x3631ff['uniqueid'],this[_0xcbe0('0x1e')][_0x3631ff[_0xcbe0('0x3b')]][_0xcbe0('0xc4')]);delete this[_0xcbe0('0x1e')][_0x3631ff[_0xcbe0('0x3b')]][_0xcbe0('0xc0')];}}}}catch(_0x25d7ce){logger[_0xcbe0('0x34')]('[%s][voiceCallReport][musiconholdstop]',_0x3631ff[_0xcbe0('0x3b')],util['inspect'](_0x25d7ce,{'showHidden':![],'depth':null}));}};module[_0xcbe0('0xc5')]=VoiceCallReport;
\ No newline at end of file
index 9751d93..1717162 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfaf7=['rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','includes','duration','endtime','diff','starttime','lastevent','complete','total','answered','holdtime','billableseconds','seconds','sumBillable','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','toLowerCase','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','syncHangup','prototype','isNotNull','emit','debug','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','addVariable','keys','value','variable','outboundrouteid','isUndefined','voice','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][varset]'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfaf7,0x18f));var _0x7faf=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xfaf7[_0x307d86];return _0x361745;};'use strict';var _=require(_0x7faf('0x0'));var moment=require(_0x7faf('0x1'));var util=require(_0x7faf('0x2'));var Redis=require(_0x7faf('0x3'));var config=require(_0x7faf('0x4'));var logger=require(_0x7faf('0x5'))(_0x7faf('0x6'));var ami=require(_0x7faf('0x7'));config[_0x7faf('0x8')]=_['defaults'](config[_0x7faf('0x8')],{'host':_0x7faf('0x9'),'port':0x18eb});var io=require(_0x7faf('0xa'))(new Redis(config[_0x7faf('0x8')]));function VoiceDialReport(_0x25eb5c){this[_0x7faf('0xb')]=_0x25eb5c[_0x7faf('0xc')];this[_0x7faf('0xd')]=_0x25eb5c[_0x7faf('0xd')];this[_0x7faf('0xe')]={};this[_0x7faf('0xf')]={};ami['on'](_0x7faf('0x10'),this[_0x7faf('0x11')][_0x7faf('0x12')](this));ami['on'](_0x7faf('0x13'),this[_0x7faf('0x14')][_0x7faf('0x12')](this));ami['on'](_0x7faf('0x15'),this[_0x7faf('0x16')][_0x7faf('0x12')](this));ami['on']('newexten',this['syncNewExten'][_0x7faf('0x12')](this));ami['on']('hangup',this[_0x7faf('0x17')]['bind'](this));}VoiceDialReport[_0x7faf('0x18')][_0x7faf('0x19')]=function(_0x52d1a1){return _0x52d1a1!==null&&!_['isUndefined'](_0x52d1a1);};VoiceDialReport[_0x7faf('0x18')][_0x7faf('0x1a')]=function(_0x36d522,_0xa29522,_0x508aa2){io['to'](_0x36d522)[_0x7faf('0x1a')](_0xa29522,_0x508aa2);};VoiceDialReport[_0x7faf('0x18')]['syncDialBegin']=function(_0x49dee7){try{if(this[_0x7faf('0x19')](_0x49dee7)){logger[_0x7faf('0x1b')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x49dee7[_0x7faf('0x1c')],util[_0x7faf('0x1d')](_0x49dee7,{'showHidden':![],'depth':null}));if(this['channels'][_0x49dee7[_0x7faf('0x1c')]]){_[_0x7faf('0x1e')](this[_0x7faf('0xb')][_0x49dee7[_0x7faf('0x1c')]],{'starttime':moment()[_0x7faf('0x1f')](_0x7faf('0x20')),'lastevent':_0x7faf('0x21'),'interface':_0x49dee7['channel'][_0x7faf('0x22')](0x0,_0x49dee7[_0x7faf('0x23')][_0x7faf('0x24')]('-')),'membername':_0x49dee7[_0x7faf('0x23')][_0x7faf('0x22')](_0x49dee7['channel']['lastIndexOf']('/')+0x1,_0x49dee7['channel']['lastIndexOf']('-'))},_[_0x7faf('0x25')](_0x49dee7,['event','privilege']));logger[_0x7faf('0x26')](_0x7faf('0x27'),_0x49dee7[_0x7faf('0x1c')],this[_0x7faf('0xb')][_0x49dee7['uniqueid']]['membername'],this[_0x7faf('0xb')][_0x49dee7[_0x7faf('0x1c')]]['interface']);logger[_0x7faf('0x1b')](_0x7faf('0x28'),_0x49dee7[_0x7faf('0x1c')],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0x49dee7[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));if(this[_0x7faf('0xe')][_0x49dee7[_0x7faf('0x1c')]])_['merge'](this[_0x7faf('0xb')][_0x49dee7[_0x7faf('0x1c')]],this[_0x7faf('0xe')][_0x49dee7['uniqueid']]);this[_0x7faf('0x1a')]('voice:outbound',_0x7faf('0x29'),this[_0x7faf('0xb')][_0x49dee7[_0x7faf('0x1c')]]);logger[_0x7faf('0x1b')](_0x7faf('0x2a'),_0x49dee7['uniqueid'],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0x49dee7[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x7faf('0x1a')](_0x7faf('0x2b'),this['channels'][_0x49dee7[_0x7faf('0x1c')]]);}}}catch(_0x403f9d){logger[_0x7faf('0x2c')]('[%s][voiceDialReport][dialbegin]',_0x49dee7[_0x7faf('0x1c')],util['inspect'](_0x403f9d,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x7faf('0x14')]=function(_0xe3c9f3){try{if(this[_0x7faf('0x19')](_0xe3c9f3)){logger[_0x7faf('0x1b')]('[%s][voiceDialReport][dialend]\x20event:',_0xe3c9f3[_0x7faf('0x1c')],util[_0x7faf('0x1d')](_0xe3c9f3,{'showHidden':![],'depth':null}));if(this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]]){this['channels'][_0xe3c9f3[_0x7faf('0x1c')]][_0x7faf('0x2d')]=_0xe3c9f3['dialstatus'];if(_0xe3c9f3['dialstatus']===_0x7faf('0x2e')){this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]][_0x7faf('0x2f')]=_0xe3c9f3[_0x7faf('0x2f')];this[_0x7faf('0xb')][_0xe3c9f3['uniqueid']][_0x7faf('0x30')]=_0xe3c9f3['connectedlinename'];this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]][_0x7faf('0x31')]=moment()[_0x7faf('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]]['lastevent']=_0x7faf('0x32');logger[_0x7faf('0x26')](_0x7faf('0x33'),_0xe3c9f3[_0x7faf('0x1c')],_0xe3c9f3[_0x7faf('0x23')][_0x7faf('0x22')](_0xe3c9f3['channel'][_0x7faf('0x24')]('/')+0x1,_0xe3c9f3['channel'][_0x7faf('0x24')]('-')));logger[_0x7faf('0x1b')](_0x7faf('0x34'),_0xe3c9f3[_0x7faf('0x1c')],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0x7faf('0x35'),this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]]);}logger[_0x7faf('0x1b')](_0x7faf('0x36'),_0xe3c9f3[_0x7faf('0x1c')],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));this[_0x7faf('0x1a')]('voice:outbound','voice_outbound_channel:save',this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]]);}}}catch(_0x30459e){logger[_0x7faf('0x2c')]('[%s][voiceDialReport][dialend]',_0xe3c9f3[_0x7faf('0x1c')],util['inspect'](_0x30459e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7faf('0x18')][_0x7faf('0x16')]=function(_0x2296ce){try{if(this[_0x7faf('0x19')](_0x2296ce)){logger[_0x7faf('0x1b')]('[%s][voiceDialReport][varset]\x20event:',_0x2296ce[_0x7faf('0x1c')],util['inspect'](_0x2296ce,{'showHidden':![],'depth':null}));this[_0x7faf('0x37')](_0x2296ce['uniqueid'],_[_0x7faf('0x38')](_0x2296ce['variable'])[0x0],_0x2296ce[_0x7faf('0x39')]);if(this[_0x7faf('0x19')](_0x2296ce[_0x7faf('0x3a')])&&this[_0x7faf('0x19')](_0x2296ce['variable'][_0x7faf('0x3b')])){if(_[_0x7faf('0x3c')](this[_0x7faf('0xb')][_0x2296ce[_0x7faf('0x1c')]])){this[_0x7faf('0xb')][_0x2296ce[_0x7faf('0x1c')]]={'routeId':_0x2296ce[_0x7faf('0x39')],'variables':this['variables'][_0x2296ce[_0x7faf('0x1c')]],'motionChannel':_0x7faf('0x3d')};logger[_0x7faf('0x26')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x2296ce[_0x7faf('0x1c')],_0x2296ce[_0x7faf('0x3a')][_0x7faf('0x3b')],_['keys'](_0x2296ce[_0x7faf('0x3a')])[0x0],_0x2296ce[_0x7faf('0x39')]);logger['debug'](_0x7faf('0x3e'),_0x2296ce[_0x7faf('0x1c')],util['inspect'](this[_0x7faf('0xb')][_0x2296ce[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));this[_0x7faf('0x1a')](_0x7faf('0x3f'),'voice_outbound_channel:save',this['channels'][_0x2296ce[_0x7faf('0x1c')]]);}}}}catch(_0xc1dd64){logger['error'](_0x7faf('0x40'),_0x2296ce['uniqueid'],util[_0x7faf('0x1d')](_0xc1dd64,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7faf('0x18')][_0x7faf('0x37')]=function(_0x12dd57,_0x30485a,_0x3293f3){var _0x1c0ee9=[_0x7faf('0x41'),'rtpaudioqosbridged',_0x7faf('0x42'),'rtpaudioqosjitterbridged',_0x7faf('0x43'),_0x7faf('0x44'),'rtpaudioqosrtt',_0x7faf('0x45'),_0x7faf('0x46'),_0x7faf('0x47'),'bridgepeer',_0x7faf('0x48'),'membercalls',_0x7faf('0x49'),_0x7faf('0x4a'),_0x7faf('0x4b'),_0x7faf('0x4c'),_0x7faf('0x4d'),_0x7faf('0x4e')];if(!_['isNil'](_0x30485a)&&!_[_0x7faf('0x4f')](_0x1c0ee9,_0x30485a)){if(_[_0x7faf('0x3c')](this['variables'][_0x12dd57])){this[_0x7faf('0xf')][_0x12dd57]={};}this[_0x7faf('0xf')][_0x12dd57][_0x30485a]=_0x3293f3;}};VoiceDialReport['prototype'][_0x7faf('0x17')]=function(_0x43ad60){try{if(this[_0x7faf('0x19')](_0x43ad60)){logger[_0x7faf('0x1b')]('[%s][voiceDialReport][hangup]\x20event:',_0x43ad60[_0x7faf('0x1c')],util[_0x7faf('0x1d')](_0x43ad60,{'showHidden':![],'depth':null}));if(this['channels'][_0x43ad60[_0x7faf('0x1c')]]){logger['info']('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x43ad60['uniqueid'],_0x43ad60['cause-txt']);this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]['endtime']=moment()[_0x7faf('0x1f')](_0x7faf('0x20'));this[_0x7faf('0xb')][_0x43ad60['uniqueid']][_0x7faf('0x50')]=moment(this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x51')])[_0x7faf('0x52')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x53')],'seconds');this[_0x7faf('0xb')][_0x43ad60['uniqueid']][_0x7faf('0x54')]=_0x7faf('0x55');this[_0x7faf('0xd')][_0x7faf('0x56')]+=0x1;if(this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x31')]){this[_0x7faf('0xd')][_0x7faf('0x57')]+=0x1;this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x58')]=moment(this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x31')])[_0x7faf('0x52')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x53')],'seconds');this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x59')]=moment(this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]['endtime'])[_0x7faf('0x52')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x31')],_0x7faf('0x5a'));this[_0x7faf('0xd')]['sumHoldTime']+=this['channels'][_0x43ad60[_0x7faf('0x1c')]]['holdtime']||0x0;this[_0x7faf('0xd')][_0x7faf('0x5b')]+=this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]['billableseconds'];}this[_0x7faf('0xd')]['sumDuration']+=this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]['duration'];logger[_0x7faf('0x1b')](_0x7faf('0x5c'),_0x43ad60[_0x7faf('0x1c')],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x7faf('0x1a')](_0x7faf('0x5d'),this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]);logger[_0x7faf('0x1b')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x43ad60[_0x7faf('0x1c')],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0x7faf('0x5e'),this[_0x7faf('0xb')][_0x43ad60['uniqueid']]);logger['debug'](_0x7faf('0x5f'),_0x43ad60[_0x7faf('0x1c')],util['inspect'](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));this[_0x7faf('0x1a')](_0x7faf('0x3f'),_0x7faf('0x60'),this[_0x7faf('0xd')]);logger[_0x7faf('0x26')](_0x7faf('0x61'),JSON[_0x7faf('0x62')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]));logger[_0x7faf('0x1b')](_0x7faf('0x63'),_0x43ad60[_0x7faf('0x1c')],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));this[_0x7faf('0x1a')]('voice:outbound',_0x7faf('0x64'),this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]);delete this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]];}else if(this[_0x7faf('0xb')][_0x43ad60['linkedid']]){this['channels'][_0x43ad60[_0x7faf('0x65')]][_0x7faf('0x1c')]=this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x65')]][_0x7faf('0x66')];}if(this[_0x7faf('0xf')][_0x43ad60[_0x7faf('0x1c')]]){delete this['variables'][_0x43ad60[_0x7faf('0x1c')]];}}}catch(_0x2d3aa3){logger[_0x7faf('0x2c')](_0x7faf('0x67'),_0x43ad60[_0x7faf('0x1c')],util[_0x7faf('0x1d')](_0x2d3aa3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7faf('0x18')]['syncNewExten']=function(_0x40ef14){try{if(this['isNotNull'](_0x40ef14)){logger[_0x7faf('0x1b')](_0x7faf('0x68'),_0x40ef14['uniqueid'],util['inspect'](_0x40ef14,{'showHidden':![],'depth':null}));if(_0x40ef14[_0x7faf('0x69')]['toLowerCase']()===_0x7faf('0x6a')){_0x40ef14[_0x7faf('0x6b')]=(_0x40ef14['appdata']||_0x40ef14['applicationdata'])[_0x7faf('0x6c')]();if(_[_0x7faf('0x6d')](_0x40ef14[_0x7faf('0x6b')],_0x7faf('0x6e'))){if(_[_0x7faf('0x3c')](this['applications'][_0x40ef14['uniqueid']]))this[_0x7faf('0xe')][_0x40ef14[_0x7faf('0x1c')]]={};logger[_0x7faf('0x26')](_0x7faf('0x6f'),_0x40ef14[_0x7faf('0x1c')],_0x40ef14[_0x7faf('0x69')],_0x40ef14[_0x7faf('0x6b')]);var _0x3e82ac=_0x40ef14['applicationdata'][_0x7faf('0x70')]('=');var _0x4f9ab3=_0x3e82ac[0x0][_0x7faf('0x71')](/cdr\((.*)\)/);if(_0x4f9ab3)this['applications'][_0x40ef14['uniqueid']][_0x4f9ab3[0x1]]=_0x3e82ac[0x1];}}}}catch(_0x595aca){logger['error'](_0x7faf('0x72'),_0x40ef14['uniqueid'],util[_0x7faf('0x1d')](_0x595aca,{'showHidden':![],'depth':null}));}};module[_0x7faf('0x73')]=VoiceDialReport;
\ No newline at end of file
+var _0x5398=['[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','dialbegin','bind','dialend','syncDialEnd','varset','syncVarSet','syncNewExten','hangup','prototype','emit','syncDialBegin','isNotNull','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','value','variable','isUndefined','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','keys','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','variables','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','complete','total','answered','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','toLowerCase','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match'];(function(_0x26c6c7,_0x301f02){var _0x3895b7=function(_0x296461){while(--_0x296461){_0x26c6c7['push'](_0x26c6c7['shift']());}};_0x3895b7(++_0x301f02);}(_0x5398,0x100));var _0x8539=function(_0x50d4fc,_0x71e9f4){_0x50d4fc=_0x50d4fc-0x0;var _0x3080b6=_0x5398[_0x50d4fc];return _0x3080b6;};'use strict';var _=require(_0x8539('0x0'));var moment=require(_0x8539('0x1'));var util=require(_0x8539('0x2'));var Redis=require(_0x8539('0x3'));var config=require(_0x8539('0x4'));var logger=require('../../../config/logger')(_0x8539('0x5'));var ami=require(_0x8539('0x6'));config[_0x8539('0x7')]=_[_0x8539('0x8')](config[_0x8539('0x7')],{'host':_0x8539('0x9'),'port':0x18eb});var io=require(_0x8539('0xa'))(new Redis(config[_0x8539('0x7')]));function VoiceDialReport(_0x4b2426){this[_0x8539('0xb')]=_0x4b2426[_0x8539('0xc')];this['outbound']=_0x4b2426[_0x8539('0xd')];this[_0x8539('0xe')]={};this['variables']={};ami['on'](_0x8539('0xf'),this['syncDialBegin'][_0x8539('0x10')](this));ami['on'](_0x8539('0x11'),this[_0x8539('0x12')][_0x8539('0x10')](this));ami['on'](_0x8539('0x13'),this[_0x8539('0x14')][_0x8539('0x10')](this));ami['on']('newexten',this[_0x8539('0x15')][_0x8539('0x10')](this));ami['on'](_0x8539('0x16'),this['syncHangup'][_0x8539('0x10')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x5e7375){return _0x5e7375!==null&&!_['isUndefined'](_0x5e7375);};VoiceDialReport[_0x8539('0x17')][_0x8539('0x18')]=function(_0x2e227d,_0x102608,_0x28a960){io['to'](_0x2e227d)[_0x8539('0x18')](_0x102608,_0x28a960);};VoiceDialReport[_0x8539('0x17')][_0x8539('0x19')]=function(_0x24a9ad){try{if(this[_0x8539('0x1a')](_0x24a9ad)){logger[_0x8539('0x1b')](_0x8539('0x1c'),_0x24a9ad[_0x8539('0x1d')],util[_0x8539('0x1e')](_0x24a9ad,{'showHidden':![],'depth':null}));if(this[_0x8539('0xb')][_0x24a9ad[_0x8539('0x1d')]]){_[_0x8539('0x1f')](this['channels'][_0x24a9ad[_0x8539('0x1d')]],{'starttime':moment()[_0x8539('0x20')](_0x8539('0x21')),'lastevent':_0x8539('0x22'),'interface':_0x24a9ad[_0x8539('0x23')][_0x8539('0x24')](0x0,_0x24a9ad[_0x8539('0x23')][_0x8539('0x25')]('-')),'membername':_0x24a9ad[_0x8539('0x23')][_0x8539('0x24')](_0x24a9ad[_0x8539('0x23')]['lastIndexOf']('/')+0x1,_0x24a9ad[_0x8539('0x23')][_0x8539('0x25')]('-'))},_[_0x8539('0x26')](_0x24a9ad,[_0x8539('0x27'),_0x8539('0x28')]));logger[_0x8539('0x29')](_0x8539('0x2a'),_0x24a9ad[_0x8539('0x1d')],this[_0x8539('0xb')][_0x24a9ad[_0x8539('0x1d')]][_0x8539('0x2b')],this['channels'][_0x24a9ad[_0x8539('0x1d')]][_0x8539('0x2c')]);logger[_0x8539('0x1b')](_0x8539('0x2d'),_0x24a9ad[_0x8539('0x1d')],util[_0x8539('0x1e')](this[_0x8539('0xb')][_0x24a9ad[_0x8539('0x1d')]],{'showHidden':![],'depth':null}));if(this['applications'][_0x24a9ad[_0x8539('0x1d')]])_[_0x8539('0x1f')](this[_0x8539('0xb')][_0x24a9ad[_0x8539('0x1d')]],this[_0x8539('0xe')][_0x24a9ad[_0x8539('0x1d')]]);this['emit'](_0x8539('0x2e'),_0x8539('0x2f'),this[_0x8539('0xb')][_0x24a9ad['uniqueid']]);logger[_0x8539('0x1b')](_0x8539('0x30'),_0x24a9ad[_0x8539('0x1d')],util[_0x8539('0x1e')](this[_0x8539('0xb')][_0x24a9ad['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x8539('0x18')](_0x8539('0x31'),this[_0x8539('0xb')][_0x24a9ad[_0x8539('0x1d')]]);}}}catch(_0x1467b5){logger[_0x8539('0x32')](_0x8539('0x33'),_0x24a9ad[_0x8539('0x1d')],util[_0x8539('0x1e')](_0x1467b5,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncDialEnd']=function(_0x50b2f4){try{if(this[_0x8539('0x1a')](_0x50b2f4)){logger[_0x8539('0x1b')](_0x8539('0x34'),_0x50b2f4['uniqueid'],util[_0x8539('0x1e')](_0x50b2f4,{'showHidden':![],'depth':null}));if(this['channels'][_0x50b2f4[_0x8539('0x1d')]]){this[_0x8539('0xb')][_0x50b2f4[_0x8539('0x1d')]]['dialstatus']=_0x50b2f4['dialstatus'];if(_0x50b2f4[_0x8539('0x35')]===_0x8539('0x36')){this[_0x8539('0xb')][_0x50b2f4[_0x8539('0x1d')]][_0x8539('0x37')]=_0x50b2f4[_0x8539('0x37')];this[_0x8539('0xb')][_0x50b2f4[_0x8539('0x1d')]][_0x8539('0x38')]=_0x50b2f4[_0x8539('0x38')];this[_0x8539('0xb')][_0x50b2f4['uniqueid']][_0x8539('0x39')]=moment()[_0x8539('0x20')](_0x8539('0x21'));this[_0x8539('0xb')][_0x50b2f4[_0x8539('0x1d')]][_0x8539('0x3a')]=_0x8539('0x3b');logger[_0x8539('0x29')](_0x8539('0x3c'),_0x50b2f4[_0x8539('0x1d')],_0x50b2f4[_0x8539('0x23')][_0x8539('0x24')](_0x50b2f4[_0x8539('0x23')]['lastIndexOf']('/')+0x1,_0x50b2f4[_0x8539('0x23')][_0x8539('0x25')]('-')));logger[_0x8539('0x1b')](_0x8539('0x3d'),_0x50b2f4['uniqueid'],util[_0x8539('0x1e')](this[_0x8539('0xb')][_0x50b2f4[_0x8539('0x1d')]],{'showHidden':![],'depth':null}));ami[_0x8539('0x18')](_0x8539('0x3e'),this[_0x8539('0xb')][_0x50b2f4[_0x8539('0x1d')]]);}logger[_0x8539('0x1b')](_0x8539('0x3f'),_0x50b2f4[_0x8539('0x1d')],util[_0x8539('0x1e')](this['channels'][_0x50b2f4[_0x8539('0x1d')]],{'showHidden':![],'depth':null}));this[_0x8539('0x18')](_0x8539('0x2e'),_0x8539('0x2f'),this['channels'][_0x50b2f4['uniqueid']]);}}}catch(_0x167b5d){logger[_0x8539('0x32')](_0x8539('0x40'),_0x50b2f4[_0x8539('0x1d')],util['inspect'](_0x167b5d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x8539('0x17')][_0x8539('0x14')]=function(_0x7c3594){try{if(this['isNotNull'](_0x7c3594)){logger[_0x8539('0x1b')](_0x8539('0x41'),_0x7c3594[_0x8539('0x1d')],util['inspect'](_0x7c3594,{'showHidden':![],'depth':null}));this[_0x8539('0x42')](_0x7c3594[_0x8539('0x1d')],_['keys'](_0x7c3594['variable'])[0x0],_0x7c3594[_0x8539('0x43')]);if(this[_0x8539('0x1a')](_0x7c3594[_0x8539('0x44')])&&this['isNotNull'](_0x7c3594[_0x8539('0x44')]['outboundrouteid'])){if(_[_0x8539('0x45')](this['channels'][_0x7c3594[_0x8539('0x1d')]])){this[_0x8539('0xb')][_0x7c3594['uniqueid']]={'routeId':_0x7c3594[_0x8539('0x43')],'variables':this['variables'][_0x7c3594['uniqueid']],'motionChannel':_0x8539('0x46')};logger[_0x8539('0x29')](_0x8539('0x47'),_0x7c3594[_0x8539('0x1d')],_0x7c3594[_0x8539('0x44')]['outboundrouteid'],_[_0x8539('0x48')](_0x7c3594[_0x8539('0x44')])[0x0],_0x7c3594[_0x8539('0x43')]);logger['debug']('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x7c3594['uniqueid'],util[_0x8539('0x1e')](this[_0x8539('0xb')][_0x7c3594[_0x8539('0x1d')]],{'showHidden':![],'depth':null}));this[_0x8539('0x18')](_0x8539('0x2e'),_0x8539('0x2f'),this[_0x8539('0xb')][_0x7c3594[_0x8539('0x1d')]]);}}}}catch(_0x12e8e7){logger[_0x8539('0x32')]('[%s][voiceDialReport][varset]',_0x7c3594[_0x8539('0x1d')],util[_0x8539('0x1e')](_0x12e8e7,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x3a4528,_0x2838eb,_0x1a12b5){var _0x4cdb4f=['rtpaudioqos',_0x8539('0x49'),_0x8539('0x4a'),_0x8539('0x4b'),_0x8539('0x4c'),_0x8539('0x4d'),_0x8539('0x4e'),'rtpaudioqosrttbridged',_0x8539('0x4f'),_0x8539('0x50'),'bridgepeer',_0x8539('0x51'),_0x8539('0x52'),_0x8539('0x53'),_0x8539('0x54'),'memberlastcall',_0x8539('0x2b'),_0x8539('0x55'),_0x8539('0x56')];if(!_['isNil'](_0x2838eb)&&!_[_0x8539('0x57')](_0x4cdb4f,_0x2838eb)){if(_[_0x8539('0x45')](this['variables'][_0x3a4528])){this[_0x8539('0x58')][_0x3a4528]={};}this[_0x8539('0x58')][_0x3a4528][_0x2838eb]=_0x1a12b5;}};VoiceDialReport[_0x8539('0x17')]['syncHangup']=function(_0x1654ab){try{if(this['isNotNull'](_0x1654ab)){logger[_0x8539('0x1b')]('[%s][voiceDialReport][hangup]\x20event:',_0x1654ab[_0x8539('0x1d')],util[_0x8539('0x1e')](_0x1654ab,{'showHidden':![],'depth':null}));if(this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]]){logger[_0x8539('0x29')](_0x8539('0x59'),_0x1654ab['uniqueid'],_0x1654ab[_0x8539('0x5a')]);this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]][_0x8539('0x5b')]=moment()[_0x8539('0x20')](_0x8539('0x21'));this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]][_0x8539('0x5c')]=moment(this['channels'][_0x1654ab[_0x8539('0x1d')]][_0x8539('0x5b')])[_0x8539('0x5d')](this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]][_0x8539('0x5e')],_0x8539('0x5f'));this['channels'][_0x1654ab[_0x8539('0x1d')]][_0x8539('0x3a')]=_0x8539('0x60');this[_0x8539('0xd')][_0x8539('0x61')]+=0x1;if(this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]]['answertime']){this[_0x8539('0xd')][_0x8539('0x62')]+=0x1;this['channels'][_0x1654ab[_0x8539('0x1d')]]['holdtime']=moment(this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]][_0x8539('0x39')])[_0x8539('0x5d')](this['channels'][_0x1654ab[_0x8539('0x1d')]]['starttime'],'seconds');this['channels'][_0x1654ab[_0x8539('0x1d')]][_0x8539('0x63')]=moment(this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]][_0x8539('0x5b')])['diff'](this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]]['answertime'],_0x8539('0x5f'));this[_0x8539('0xd')][_0x8539('0x64')]+=this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]]['holdtime']||0x0;this['outbound'][_0x8539('0x65')]+=this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]][_0x8539('0x63')];}this[_0x8539('0xd')][_0x8539('0x66')]+=this['channels'][_0x1654ab[_0x8539('0x1d')]]['duration'];logger[_0x8539('0x1b')](_0x8539('0x67'),_0x1654ab[_0x8539('0x1d')],util[_0x8539('0x1e')](this['channels'][_0x1654ab[_0x8539('0x1d')]],{'showHidden':![],'depth':null}));ami[_0x8539('0x18')](_0x8539('0x68'),this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]]);logger[_0x8539('0x1b')](_0x8539('0x69'),_0x1654ab[_0x8539('0x1d')],util[_0x8539('0x1e')](this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]],{'showHidden':![],'depth':null}));ami['emit'](_0x8539('0x6a'),this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]]);logger[_0x8539('0x1b')](_0x8539('0x6b'),_0x1654ab['uniqueid'],util['inspect'](this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]],{'showHidden':![],'depth':null}));this['emit'](_0x8539('0x2e'),_0x8539('0x6c'),this[_0x8539('0xd')]);logger['info'](_0x8539('0x6d'),JSON[_0x8539('0x6e')](this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]]));logger[_0x8539('0x1b')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x1654ab[_0x8539('0x1d')],util[_0x8539('0x1e')](this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]],{'showHidden':![],'depth':null}));this[_0x8539('0x18')](_0x8539('0x2e'),_0x8539('0x6f'),this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]]);delete this[_0x8539('0xb')][_0x1654ab[_0x8539('0x1d')]];}else if(this[_0x8539('0xb')][_0x1654ab[_0x8539('0x70')]]){this[_0x8539('0xb')][_0x1654ab['linkedid']][_0x8539('0x1d')]=this[_0x8539('0xb')][_0x1654ab[_0x8539('0x70')]][_0x8539('0x71')];}if(this[_0x8539('0x58')][_0x1654ab[_0x8539('0x1d')]]){delete this[_0x8539('0x58')][_0x1654ab[_0x8539('0x1d')]];}}}catch(_0x3d8c5f){logger[_0x8539('0x32')](_0x8539('0x72'),_0x1654ab[_0x8539('0x1d')],util[_0x8539('0x1e')](_0x3d8c5f,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x8539('0x15')]=function(_0x24e831){try{if(this[_0x8539('0x1a')](_0x24e831)){logger[_0x8539('0x1b')](_0x8539('0x73'),_0x24e831[_0x8539('0x1d')],util[_0x8539('0x1e')](_0x24e831,{'showHidden':![],'depth':null}));if(_0x24e831[_0x8539('0x74')]['toLowerCase']()===_0x8539('0x75')){_0x24e831[_0x8539('0x76')]=(_0x24e831['appdata']||_0x24e831[_0x8539('0x76')])[_0x8539('0x77')]();if(_[_0x8539('0x78')](_0x24e831[_0x8539('0x76')],_0x8539('0x79'))){if(_[_0x8539('0x45')](this[_0x8539('0xe')][_0x24e831[_0x8539('0x1d')]]))this[_0x8539('0xe')][_0x24e831[_0x8539('0x1d')]]={};logger[_0x8539('0x29')](_0x8539('0x7a'),_0x24e831[_0x8539('0x1d')],_0x24e831[_0x8539('0x74')],_0x24e831[_0x8539('0x76')]);var _0x1af263=_0x24e831[_0x8539('0x76')][_0x8539('0x7b')]('=');var _0x2c079b=_0x1af263[0x0][_0x8539('0x7c')](/cdr\((.*)\)/);if(_0x2c079b)this[_0x8539('0xe')][_0x24e831[_0x8539('0x1d')]][_0x2c079b[0x1]]=_0x1af263[0x1];}}}}catch(_0x5a64d6){logger[_0x8539('0x32')](_0x8539('0x7d'),_0x24e831['uniqueid'],util[_0x8539('0x1e')](_0x5a64d6,{'showHidden':![],'depth':null}));}};module[_0x8539('0x7e')]=VoiceDialReport;
\ No newline at end of file
index 9e36132..a6249ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf82=['util','ioredis','../../../config/environment','../../../config/logger','../model/queueReport','redis','defaults','localhost','prototype','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','syncHangup','fullybooted','syncFullyBooted','newexten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','clearZombieChannels','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','variables','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','debug',']\x20sending\x20voice_queue_channel:save\x20event:','format','voice:queue:%s','name','voice_queue_presence:save','[%s][voiceQueueReport][','uniqueid','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','answered','available','loggedIn','sumBillable','sumDuration','unmanaged','abandoned','Trunk','active','Interval','stringify','md5','[voiceQueueReport][','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','loopQueueSummary','syncQueueSummary','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','toNumber','loggedin','callers','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','originalposition','queuecallerabandon','queuecallerexitreason','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','assigned','lastAssignedTo','membername','queuecallerexit','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','local/','linkedid','queuecallerjoinAt','add','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','value','variable','queuestatus','lastevent','timeout','custom:timeout','queuecallerabandonAt','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','length','sumHoldTime','diff','seconds','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','[%s][voiceQueueReport][hangup]','transfereeuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','origtransfererexten','origtransfereruniqueid','transfertargetuniqueid','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','[%s][voiceQueueReport][newexten]','exports','lodash'];(function(_0x4d181c,_0x5ae0a7){var _0xb3a0ad=function(_0x9d8a44){while(--_0x9d8a44){_0x4d181c['push'](_0x4d181c['shift']());}};_0xb3a0ad(++_0x5ae0a7);}(_0xbf82,0x1cb));var _0x2bf8=function(_0x37f9e8,_0x15064e){_0x37f9e8=_0x37f9e8-0x0;var _0x294a2=_0xbf82[_0x37f9e8];return _0x294a2;};'use strict';var _=require(_0x2bf8('0x0'));var moment=require('moment');var util=require(_0x2bf8('0x1'));var md5=require('md5');var Redis=require(_0x2bf8('0x2'));var config=require(_0x2bf8('0x3'));var logger=require(_0x2bf8('0x4'))('ami');var ami=require('../ami');var QueueReport=require(_0x2bf8('0x5'));config[_0x2bf8('0x6')]=_[_0x2bf8('0x7')](config[_0x2bf8('0x6')],{'host':_0x2bf8('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x2bf8('0x9')]['enqueue']=function(_0x130e6d){this[_0x2bf8('0xa')]=this[_0x2bf8('0xa')]?this['tail'][_0x2bf8('0xb')](_0x130e6d):_0x130e6d();};function VoiceQueueReport(_0x415db1){this[_0x2bf8('0xc')]=new Sequence();this[_0x2bf8('0xd')]={};this[_0x2bf8('0xe')]=_0x415db1[_0x2bf8('0xe')];this[_0x2bf8('0xf')]=_0x415db1[_0x2bf8('0x10')];this[_0x2bf8('0x11')]=_0x415db1[_0x2bf8('0x11')];this[_0x2bf8('0x12')]=!![];this['campaigns']=_0x415db1[_0x2bf8('0x13')];this['variables']={};ami['on'](_0x2bf8('0x14'),this['syncQueueSummary']['bind'](this));ami['on'](_0x2bf8('0x15'),this[_0x2bf8('0x16')][_0x2bf8('0x17')](this));ami['on'](_0x2bf8('0x18'),this[_0x2bf8('0x19')]['bind'](this));ami['on']('queuecallerabandon',this[_0x2bf8('0x1a')][_0x2bf8('0x17')](this));ami['on'](_0x2bf8('0x1b'),this['syncQueueCallerLeave'][_0x2bf8('0x17')](this));ami['on'](_0x2bf8('0x1c'),this[_0x2bf8('0x1d')][_0x2bf8('0x17')](this));ami['on']('agentconnect',this[_0x2bf8('0x1e')][_0x2bf8('0x17')](this));ami['on'](_0x2bf8('0x1f'),this[_0x2bf8('0x20')][_0x2bf8('0x17')](this));ami['on']('hangup',this[_0x2bf8('0x21')][_0x2bf8('0x17')](this));ami['on'](_0x2bf8('0x22'),this[_0x2bf8('0x23')][_0x2bf8('0x17')](this));ami['on'](_0x2bf8('0x24'),this['syncNewExten']['bind'](this));ami['on'](_0x2bf8('0x25'),this[_0x2bf8('0x26')][_0x2bf8('0x17')](this));ami['on'](_0x2bf8('0x27'),this[_0x2bf8('0x28')][_0x2bf8('0x17')](this));ami['on'](_0x2bf8('0x29'),this['syncAttendedTransfer'][_0x2bf8('0x17')](this));ami['on'](_0x2bf8('0x2a'),this[_0x2bf8('0x2b')][_0x2bf8('0x17')](this));this['loopQueueSummary']();this[_0x2bf8('0x2c')]();}function clearChannels(_0x3f1b2a){if(!_[_0x2bf8('0x2d')](_0x3f1b2a)){for(var _0x1c7560 in _0x3f1b2a){if(_0x3f1b2a['hasOwnProperty'](_0x1c7560)){delete _0x3f1b2a[_0x1c7560];}}}}function clearCampaigns(_0x48f31a){if(!_[_0x2bf8('0x2d')](_0x48f31a)){for(var _0x35c8c4 in _0x48f31a){if(_0x48f31a[_0x2bf8('0x2e')](_0x35c8c4)){_0x48f31a[_0x35c8c4][_0x2bf8('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x342942){if(!_[_0x2bf8('0x2d')](_0x342942)){for(var _0x2ea1d6 in _0x342942){if(_0x342942[_0x2bf8('0x2e')](_0x2ea1d6)){_0x342942[_0x2ea1d6][_0x2bf8('0x2f')]=0x0;_0x342942[_0x2ea1d6][_0x2bf8('0x30')]=0x0;_0x342942[_0x2ea1d6][_0x2bf8('0x31')]=0x0;_0x342942[_0x2ea1d6][_0x2bf8('0x32')]=0x0;_0x342942[_0x2ea1d6][_0x2bf8('0x33')]=!![];}}}}function clearAgentBooked(_0x5b5b50){if(!_['isEmpty'](_0x5b5b50)){for(var _0x41ffb2 in _0x5b5b50){if(_0x5b5b50[_0x2bf8('0x2e')](_0x41ffb2)){_0x5b5b50[_0x41ffb2]['unlockRR']=!![];}}}}VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x34')]=function(){var _0x36cd07=this;for(var _0x245caa in this[_0x2bf8('0xf')]){if(this[_0x2bf8('0xf')][_0x2bf8('0x2e')](_0x245caa)&&!this[_0x2bf8('0xf')][_0x245caa]['switch']){this[_0x2bf8('0xc')][_0x2bf8('0x35')](function(){if(!_[_0x2bf8('0x36')](_0x36cd07[_0x2bf8('0xf')][_0x245caa])){return ami[_0x2bf8('0x37')]({'action':_0x2bf8('0x38'),'channel':_0x36cd07[_0x2bf8('0xf')][_0x245caa][_0x2bf8('0x39')]})[_0x2bf8('0x3a')](function(_0x4fc930){if(_0x4fc930['message']===_0x2bf8('0x3b')){setTimeout(function(){if(_0x36cd07['channels'][_0x245caa]){delete _0x36cd07[_0x2bf8('0xf')][_0x245caa];logger[_0x2bf8('0x3c')](_0x2bf8('0x3d'),_0x245caa,util[_0x2bf8('0x3e')](_0x4fc930,{'showHidden':![],'depth':null}));}if(_0x36cd07[_0x2bf8('0xd')][_0x245caa]){delete _0x36cd07[_0x2bf8('0xd')][_0x245caa];logger[_0x2bf8('0x3c')](_0x2bf8('0x3f'),_0x245caa,util[_0x2bf8('0x3e')](_0x4fc930,{'showHidden':![],'depth':null}));}if(_0x36cd07[_0x2bf8('0x40')][_0x245caa]){delete _0x36cd07[_0x2bf8('0x40')][_0x245caa];logger['error'](_0x2bf8('0x41'),_0x245caa,util[_0x2bf8('0x3e')](_0x4fc930,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x2bf8('0x9')]['syncFullyBooted']=function(){logger[_0x2bf8('0x3c')](_0x2bf8('0x42'));clearChannels(this[_0x2bf8('0xf')]);this[_0x2bf8('0x43')](this[_0x2bf8('0xd')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x2bf8('0x11')]);clearCampaigns(this[_0x2bf8('0x13')]);};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x43')]=function(_0x16592e){var _0x5ba2a0=this;if(!_[_0x2bf8('0x2d')](_0x16592e)){for(var _0x860ca8 in _0x16592e){if(_0x16592e[_0x2bf8('0x2e')](_0x860ca8)){_0x5ba2a0[_0x2bf8('0x44')](_0x16592e[_0x860ca8],'clearqueuereport');delete _0x16592e[_0x860ca8];}}}};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x45')]=function(_0xa0f758,_0x70f8d7,_0x395fa8){io['to'](_0xa0f758)['emit'](_0x70f8d7,_0x395fa8);};VoiceQueueReport[_0x2bf8('0x9')]['emitVoiceQueueChannelSave']=function(_0x23cc10,_0x44e30c){logger[_0x2bf8('0x46')]('[%s][voiceQueueReport]['+_0x44e30c+_0x2bf8('0x47'),_0x23cc10['uniqueid'],util[_0x2bf8('0x3e')](_0x23cc10,{'showHidden':![],'depth':null}));this[_0x2bf8('0x45')](util[_0x2bf8('0x48')](_0x2bf8('0x49'),_0x23cc10[_0x2bf8('0x4a')]),'voice_queue_channel:save',_0x23cc10);io[_0x2bf8('0x45')](_0x2bf8('0x4b'),_0x23cc10);};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x44')]=function(_0x2931a6,_0x13dc5a){logger[_0x2bf8('0x46')](_0x2bf8('0x4c')+_0x13dc5a+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x2931a6[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x2931a6,{'showHidden':![],'depth':null}));this[_0x2bf8('0x45')](util[_0x2bf8('0x48')](_0x2bf8('0x49'),_0x2931a6[_0x2bf8('0x4a')]),_0x2bf8('0x4e'),_0x2931a6);io[_0x2bf8('0x45')](_0x2bf8('0x4f'),_0x2931a6);};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x50')]=function(_0x1578da,_0x41dd50){if(_0x1578da[_0x2bf8('0x51')]===_0x2bf8('0x52')){var _0xc5675e={'id':_0x1578da['id'],'name':_0x1578da[_0x2bf8('0x4a')],'strategy':_0x1578da['strategy'],'answered':_0x1578da[_0x2bf8('0x53')],'available':_0x1578da[_0x2bf8('0x54')],'loggedIn':_0x1578da[_0x2bf8('0x55')],'pTalking':_0x1578da[_0x2bf8('0x31')],'sumBillable':_0x1578da[_0x2bf8('0x56')],'sumDuration':_0x1578da[_0x2bf8('0x57')],'sumHoldTime':_0x1578da['sumHoldTime']||0x0,'talking':_0x1578da['talking'],'total':_0x1578da['total'],'type':_0x1578da['type'],'unmanaged':_0x1578da[_0x2bf8('0x58')],'abandoned':_0x1578da[_0x2bf8('0x59')],'waiting':_0x1578da[_0x2bf8('0x32')]};if(_0x1578da['Trunk']){_0xc5675e[_0x2bf8('0x5a')]={'id':_0x1578da[_0x2bf8('0x5a')]['id'],'name':_0x1578da['Trunk'][_0x2bf8('0x4a')],'active':_0x1578da[_0x2bf8('0x5a')][_0x2bf8('0x5b')],'callerid':_0x1578da[_0x2bf8('0x5a')]['callerid']};}if(_0x1578da[_0x2bf8('0x5c')]){_0xc5675e['Interval']={'id':_0x1578da[_0x2bf8('0x5c')]['id'],'name':_0x1578da['Interval'][_0x2bf8('0x4a')]};}var _0x1a7e9d=md5(JSON[_0x2bf8('0x5d')](_0xc5675e));if(_0x1578da[_0x2bf8('0x5e')]!==_0x1a7e9d){_0x1578da[_0x2bf8('0x5e')]=_0x1a7e9d;logger[_0x2bf8('0x46')](_0x2bf8('0x5f')+_0x41dd50+']\x20sending\x20voice_queue:save\x20event:',util[_0x2bf8('0x3e')](_0xc5675e,{'showHidden':![],'depth':null}));this[_0x2bf8('0x45')](util[_0x2bf8('0x48')]('voice:queue:%s',_0xc5675e[_0x2bf8('0x4a')]),_0x2bf8('0x60'),_0xc5675e);}}};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x61')]=function(_0x12e615){return _0x12e615!==null&&!_[_0x2bf8('0x62')](_0x12e615);};VoiceQueueReport[_0x2bf8('0x9')]['loopQueueShow']=function(){var _0x567f08=this;setInterval(function(){_0x567f08[_0x2bf8('0x34')]();ami[_0x2bf8('0x37')]({'action':_0x2bf8('0x63')})[_0x2bf8('0x3a')](function(_0x4ac6b8){logger['error'](_0x2bf8('0x64'),util[_0x2bf8('0x3e')](_0x4ac6b8,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x65')]=function(){var _0x5e512c=this;setInterval(function(){if(_0x5e512c[_0x2bf8('0x12')]){return ami[_0x2bf8('0x37')]({'action':_0x2bf8('0x14')})['then'](function(_0x2a3668){_0x5e512c[_0x2bf8('0x12')]=![];})[_0x2bf8('0x3a')](function(_0x392eb7){logger[_0x2bf8('0x3c')]('[voiceQueueReport][queuesummary]',util[_0x2bf8('0x3e')](_0x392eb7,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x66')]=function(_0x11f767){try{if(this[_0x2bf8('0x61')](_0x11f767)&&this[_0x2bf8('0x61')](_0x11f767[_0x2bf8('0x67')])){logger[_0x2bf8('0x46')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x2bf8('0x3e')](_0x11f767,{'showHidden':![],'depth':null}));if(this[_0x2bf8('0x11')][_0x11f767[_0x2bf8('0x67')]]){logger[_0x2bf8('0x68')](_0x2bf8('0x69'),_0x11f767[_0x2bf8('0x67')]);var _0x45e675=_['countBy'](this[_0x2bf8('0xf')],'queue')[_0x11f767[_0x2bf8('0x67')]]||0x0;var _0xfcb446=_0x45e675-_0x11f767['callers'];if(this[_0x2bf8('0x11')][_0x11f767[_0x2bf8('0x67')]][_0x2bf8('0x32')]!==_['toNumber'](_0x11f767['callers'])||this['voiceQueues'][_0x11f767[_0x2bf8('0x67')]]['loggedIn']!==_[_0x2bf8('0x6a')](_0x11f767[_0x2bf8('0x6b')])||this[_0x2bf8('0x11')][_0x11f767['queue']][_0x2bf8('0x54')]!==_[_0x2bf8('0x6a')](_0x11f767[_0x2bf8('0x54')])||this[_0x2bf8('0x11')][_0x11f767[_0x2bf8('0x67')]][_0x2bf8('0x30')]!==_0xfcb446){this[_0x2bf8('0x11')][_0x11f767['queue']][_0x2bf8('0x32')]=_[_0x2bf8('0x6a')](_0x11f767[_0x2bf8('0x6c')]);this['voiceQueues'][_0x11f767[_0x2bf8('0x67')]][_0x2bf8('0x55')]=_['toNumber'](_0x11f767['loggedin']);this[_0x2bf8('0x11')][_0x11f767['queue']][_0x2bf8('0x54')]=_['toNumber'](_0x11f767[_0x2bf8('0x54')]);this[_0x2bf8('0x11')][_0x11f767['queue']][_0x2bf8('0x30')]=_0xfcb446>0x0?_0xfcb446:0x0;this[_0x2bf8('0x11')][_0x11f767['queue']][_0x2bf8('0x30')]=this[_0x2bf8('0x11')][_0x11f767[_0x2bf8('0x67')]][_0x2bf8('0x30')]>_['toNumber'](_0x11f767[_0x2bf8('0x6b')])?_[_0x2bf8('0x6a')](_0x11f767['loggedin']):this[_0x2bf8('0x11')][_0x11f767[_0x2bf8('0x67')]][_0x2bf8('0x30')];this[_0x2bf8('0x50')](this[_0x2bf8('0x11')][_0x11f767[_0x2bf8('0x67')]],'queuesummary');}logger[_0x2bf8('0x46')](_0x2bf8('0x6d'),util[_0x2bf8('0x3e')](this[_0x2bf8('0x11')][_0x11f767[_0x2bf8('0x67')]],{'showHidden':![],'depth':null}));ami[_0x2bf8('0x45')](_0x2bf8('0x6e'),this[_0x2bf8('0x11')][_0x11f767['queue']]);}}}catch(_0x102ffc){logger[_0x2bf8('0x3c')]('[voiceQueueReport][queuesummary]',util[_0x2bf8('0x3e')](_0x102ffc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')]['syncQueueSummaryComplete']=function(_0x2f2484){logger['debug'](_0x2bf8('0x6f'),util['inspect'](_0x2f2484,{'showHidden':![],'depth':null}));this[_0x2bf8('0x12')]=!![];};VoiceQueueReport[_0x2bf8('0x9')]['syncQueueCallerJoin']=function(_0x4034e9){try{if(this[_0x2bf8('0x61')](_0x4034e9)){logger[_0x2bf8('0x46')](_0x2bf8('0x70'),_0x4034e9[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x4034e9,{'showHidden':![],'depth':null}));if(_[_0x2bf8('0x62')](this[_0x2bf8('0xd')][_0x4034e9[_0x2bf8('0x4d')]]))this['queueReports'][_0x4034e9[_0x2bf8('0x4d')]]=[];if(_[_0x2bf8('0x62')](this[_0x2bf8('0xf')][_0x4034e9[_0x2bf8('0x4d')]]))this[_0x2bf8('0xf')][_0x4034e9['uniqueid']]={};var _0x118e87=new QueueReport();_0x118e87[_0x2bf8('0x4a')]=_0x4034e9['queue'];_0x118e87[_0x2bf8('0x51')]=this[_0x2bf8('0x11')][_0x118e87[_0x2bf8('0x4a')]]&&this[_0x2bf8('0x11')][_0x118e87[_0x2bf8('0x4a')]]['type']?this[_0x2bf8('0x11')][_0x118e87[_0x2bf8('0x4a')]][_0x2bf8('0x51')]||_0x2bf8('0x52'):_0x2bf8('0x52');_0x118e87[_0x2bf8('0x67')]=_0x4034e9[_0x2bf8('0x67')];_0x118e87['queuecallerjoinAt']=moment()[_0x2bf8('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x118e87[_0x2bf8('0x71')]=_0x4034e9[_0x2bf8('0x71')];_0x118e87['count']=_0x4034e9[_0x2bf8('0x72')];_0x118e87[_0x2bf8('0x4d')]=_0x4034e9[_0x2bf8('0x4d')];_0x118e87[_0x2bf8('0x73')]=this[_0x2bf8('0xf')][_0x4034e9[_0x2bf8('0x4d')]][_0x2bf8('0x73')];logger[_0x2bf8('0x68')](_0x2bf8('0x74'),_0x118e87['name'],_0x118e87[_0x2bf8('0x51')]);_[_0x2bf8('0x75')](_0x118e87,_[_0x2bf8('0x76')](_0x4034e9,_[_0x2bf8('0x77')](_0x118e87)));this[_0x2bf8('0xd')][_0x4034e9[_0x2bf8('0x4d')]]['push'](_0x118e87);this[_0x2bf8('0xf')][_0x4034e9[_0x2bf8('0x4d')]]=_0x118e87;this[_0x2bf8('0x78')](_0x118e87,_0x2bf8('0x18'));}}catch(_0x3a1e15){logger['error'](_0x2bf8('0x70'),_0x4034e9['uniqueid'],util[_0x2bf8('0x3e')](_0x3a1e15,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x1a')]=function(_0x427799){try{if(this['isNotNull'](_0x427799)){logger[_0x2bf8('0x46')](_0x2bf8('0x79'),_0x427799['uniqueid'],util[_0x2bf8('0x3e')](_0x427799,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x427799['uniqueid']]){var _0x578f1c=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x427799[_0x2bf8('0x4d')]]);_0x578f1c[_0x2bf8('0x7b')]=![];_0x578f1c['queuecallercompleteAt']=null;_0x578f1c[_0x2bf8('0x7c')]=_0x427799[_0x2bf8('0x7c')];_0x578f1c[_0x2bf8('0x7d')]=_0x427799[_0x2bf8('0x7d')];_0x578f1c[_0x2bf8('0x7e')]=!![];_0x578f1c['queuecallerabandonAt']=moment()[_0x2bf8('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x578f1c[_0x2bf8('0x7f')]=_0x2bf8('0x80');_0x578f1c['lastAssignedTo']=null;logger[_0x2bf8('0x68')](_0x2bf8('0x81'),_0x578f1c[_0x2bf8('0x4a')],_0x578f1c['type']);this[_0x2bf8('0xf')][_0x427799[_0x2bf8('0x4d')]]=_0x578f1c;this[_0x2bf8('0x44')](_0x578f1c,_0x2bf8('0x7e'));}}}catch(_0x26cae1){logger[_0x2bf8('0x3c')](_0x2bf8('0x79'),_0x427799[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x26cae1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x82')]=function(_0x117e6d){try{if(this[_0x2bf8('0x61')](_0x117e6d)){logger['debug'](_0x2bf8('0x83'),_0x117e6d[_0x2bf8('0x4d')],util['inspect'](_0x117e6d,{'showHidden':![],'depth':null}));if(this[_0x2bf8('0xd')][_0x117e6d[_0x2bf8('0x4d')]]){var _0x1263df=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x117e6d[_0x2bf8('0x4d')]]);_0x1263df[_0x2bf8('0x84')]=moment()[_0x2bf8('0x48')](_0x2bf8('0x85'));_0x1263df[_0x2bf8('0x86')]=_0x117e6d[_0x2bf8('0x86')];_0x1263df[_0x2bf8('0x87')]=_0x117e6d[_0x2bf8('0x87')];logger[_0x2bf8('0x68')](_0x2bf8('0x88'),_0x1263df[_0x2bf8('0x4a')],_0x1263df[_0x2bf8('0x51')],_0x117e6d['connectedlinenum'],_0x117e6d[_0x2bf8('0x87')]);this[_0x2bf8('0xf')][_0x117e6d['uniqueid']]=_0x1263df;this['emitVoiceQueueChannelSave'](_0x1263df,_0x2bf8('0x1b'));}}}catch(_0x342128){logger[_0x2bf8('0x3c')](_0x2bf8('0x83'),_0x117e6d[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x342128,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2bf8('0x1e')]=function(_0x4b7e5c){try{if(this['isNotNull'](_0x4b7e5c)){logger[_0x2bf8('0x46')](_0x2bf8('0x89'),_0x4b7e5c[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x4b7e5c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4b7e5c[_0x2bf8('0x4d')]]){var _0x220048=_[_0x2bf8('0x7a')](this['queueReports'][_0x4b7e5c[_0x2bf8('0x4d')]]);_0x220048[_0x2bf8('0x7b')]=!![];_0x220048[_0x2bf8('0x7f')]='COMPLETEDBYAGENT';logger[_0x2bf8('0x68')](_0x2bf8('0x8a'),_0x220048['name'],_0x220048['type']);}}}catch(_0x1c44d8){logger[_0x2bf8('0x3c')](_0x2bf8('0x89'),_0x4b7e5c[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x1c44d8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')]['syncAgentComplete']=function(_0x2b7af0){try{if(this[_0x2bf8('0x61')](_0x2b7af0)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x2b7af0[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x2b7af0,{'showHidden':![],'depth':null}));if(this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x4d')]]){var _0x351256=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x4d')]]);_0x351256[_0x2bf8('0x7e')]=![];_0x351256['queuecallerabandonAt']=null;_0x351256[_0x2bf8('0x8b')]=!![];_0x351256[_0x2bf8('0x8c')]=_0x2b7af0[_0x2bf8('0x8d')];_0x351256[_0x2bf8('0x7c')]=_0x2b7af0[_0x2bf8('0x7c')];_0x351256[_0x2bf8('0x7b')]=!![];_0x351256[_0x2bf8('0x8e')]=![];_0x351256[_0x2bf8('0x8f')]=null;if(!_0x351256[_0x2bf8('0x90')]){if(_0x2b7af0[_0x2bf8('0x91')]==_0x2bf8('0x90')){_0x351256['queuecallerexitreason']='COMPLETED';logger['info'](_0x2bf8('0x92'),_0x351256[_0x2bf8('0x4a')],_0x351256[_0x2bf8('0x51')]);}else{if(_[_0x2bf8('0x93')](_0x2b7af0[_0x2bf8('0x39')]['toLowerCase'](),_0x2bf8('0x94'))){if(this[_0x2bf8('0xd')][_0x2b7af0['linkedid']]){var _0x5903dd=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x95')]]);_0x5903dd[_0x2bf8('0x7b')]=![];_0x5903dd[_0x2bf8('0x8e')]=!![];_0x5903dd[_0x2bf8('0x8f')]=moment(_0x351256[_0x2bf8('0x96')])[_0x2bf8('0x97')](_0x2b7af0['holdtime'],'seconds')[_0x2bf8('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x5903dd[_0x2bf8('0x7f')]='FORWARDTRANSFER';_0x5903dd['transfer']=!![];_0x5903dd[_0x2bf8('0x98')]=_0x2bf8('0x99');_0x5903dd[_0x2bf8('0x9a')]=_0x2b7af0[_0x2bf8('0x9b')];_0x5903dd[_0x2bf8('0x9c')]=_0x2b7af0[_0x2bf8('0x4d')];logger[_0x2bf8('0x68')](_0x2bf8('0x9d'),_0x5903dd['name'],_0x5903dd[_0x2bf8('0x51')]);var _0x2d1430=this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x95')]];this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x95')]]=this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x4d')]];this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x4d')]]=_0x2d1430;}}else{_0x351256['queuecallerexitreason']=_0x2bf8('0x9e')+_0x2b7af0[_0x2bf8('0x91')]['toUpperCase']();logger[_0x2bf8('0x68')](_0x2bf8('0x9f'),_0x351256['name'],_0x351256[_0x2bf8('0x51')],_0x351256[_0x2bf8('0x7f')]);}}}this[_0x2bf8('0xf')][_0x2b7af0[_0x2bf8('0x4d')]]=_0x351256;this[_0x2bf8('0x44')](_0x351256,'agentcomplete');}}}catch(_0x5d003e){logger[_0x2bf8('0x3c')]('[%s][voiceQueueReport][agentcomplete]',_0x2b7af0[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x5d003e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x20')]=function(_0x2ac673){try{if(this['isNotNull'](_0x2ac673)){logger[_0x2bf8('0x46')](_0x2bf8('0xa0'),_0x2ac673[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x2ac673,{'showHidden':![],'depth':null}));this[_0x2bf8('0xa1')](_0x2ac673['uniqueid'],_[_0x2bf8('0x77')](_0x2ac673['variable'])[0x0],_0x2ac673[_0x2bf8('0xa2')]);if(this['queueReports'][_0x2ac673[_0x2bf8('0x4d')]]){var _0xf5fdfa=_['last'](this[_0x2bf8('0xd')][_0x2ac673['uniqueid']]);if(_0xf5fdfa){if(this[_0x2bf8('0x61')](_0x2ac673[_0x2bf8('0xa3')])&&this[_0x2bf8('0x61')](_0x2ac673[_0x2bf8('0xa3')][_0x2bf8('0xa4')])){switch(_0x2ac673['value']){case'CONTINUE':_0xf5fdfa[_0x2bf8('0x8e')]=![];_0xf5fdfa[_0x2bf8('0x8f')]=null;break;case'TIMEOUT':_0xf5fdfa[_0x2bf8('0xa5')]=_0x2bf8('0xa6');_0xf5fdfa[_0x2bf8('0x8e')]=!![];_0xf5fdfa[_0x2bf8('0x8f')]=moment()[_0x2bf8('0x48')](_0x2bf8('0x85'));_0xf5fdfa['queuecallerleaveAt']=moment()[_0x2bf8('0x48')](_0x2bf8('0x85'));logger[_0x2bf8('0x46')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x2ac673[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0xf5fdfa,{'showHidden':![],'depth':null}));ami[_0x2bf8('0x45')](_0x2bf8('0xa7'),_0xf5fdfa);break;default:_0xf5fdfa[_0x2bf8('0x8e')]=!![];_0xf5fdfa[_0x2bf8('0x8f')]=moment()[_0x2bf8('0x48')](_0x2bf8('0x85'));_0xf5fdfa[_0x2bf8('0x84')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0xf5fdfa[_0x2bf8('0x7e')]=![];_0xf5fdfa[_0x2bf8('0xa8')]=null;_0xf5fdfa['queuecallerexitreason']=_0x2ac673[_0x2bf8('0xa2')];this[_0x2bf8('0xf')][_0x2ac673[_0x2bf8('0x4d')]]=_0xf5fdfa;this[_0x2bf8('0x44')](_0xf5fdfa,'varset');}else if(this[_0x2bf8('0x61')](_0x2ac673[_0x2bf8('0xa3')])&&this[_0x2bf8('0x61')](_0x2ac673['variable'][_0x2bf8('0xa9')])){if(!_0xf5fdfa[_0x2bf8('0x7e')]){_0xf5fdfa[_0x2bf8('0x8e')]=!![];_0xf5fdfa[_0x2bf8('0x8f')]=moment()[_0x2bf8('0x48')](_0x2bf8('0x85'));_0xf5fdfa['queuecallerexitreason']=_0x2bf8('0xaa');_0xf5fdfa['queuecallerleaveAt']=moment()['format'](_0x2bf8('0x85'));this['channels'][_0x2ac673[_0x2bf8('0x4d')]]=_0xf5fdfa;}}logger[_0x2bf8('0x68')](_0x2bf8('0xab'),_0x2ac673['uniqueid'],_0xf5fdfa[_0x2bf8('0x4a')],_0xf5fdfa[_0x2bf8('0x51')],_['keys'](_0x2ac673[_0x2bf8('0xa3')])[0x0],_0x2ac673[_0x2bf8('0xa2')]);_0xf5fdfa[_0x2bf8('0x40')]=this['variables'][_0x2ac673[_0x2bf8('0x4d')]];}}}}catch(_0x4ad2b9){logger[_0x2bf8('0x3c')]('[%s][voiceQueueReport][varset]',_0x2ac673['uniqueid'],util[_0x2bf8('0x3e')](_0x4ad2b9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')]['addVariable']=function(_0x5cd920,_0xc36cae,_0x23d8a7){var _0x4dd424=['rtpaudioqos',_0x2bf8('0xac'),_0x2bf8('0xad'),_0x2bf8('0xae'),_0x2bf8('0xaf'),_0x2bf8('0xb0'),'rtpaudioqosrtt',_0x2bf8('0xb1'),'sipcallid',_0x2bf8('0xb2'),_0x2bf8('0xb3'),'bridgepvtcallid',_0x2bf8('0xb4'),'memberdynamic',_0x2bf8('0xb5'),_0x2bf8('0xb6'),_0x2bf8('0x8d'),_0x2bf8('0xb7'),_0x2bf8('0xb8')];if(!_[_0x2bf8('0x36')](_0xc36cae)&&!_['includes'](_0x4dd424,_0xc36cae)){if(_[_0x2bf8('0x62')](this['variables'][_0x5cd920])){this[_0x2bf8('0x40')][_0x5cd920]={};}this[_0x2bf8('0x40')][_0x5cd920][_0xc36cae]=_0x23d8a7;}};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x21')]=function(_0x390c33){try{if(this[_0x2bf8('0x61')](_0x390c33)){logger[_0x2bf8('0x46')]('[%s][voiceQueueReport][hangup]',_0x390c33[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x390c33,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x390c33[_0x2bf8('0x4d')]]){for(var _0x5ab625=0x0,_0x1dd323={};_0x5ab625<this['queueReports'][_0x390c33['uniqueid']][_0x2bf8('0xb9')];_0x5ab625+=0x1){_0x1dd323=this[_0x2bf8('0xd')][_0x390c33['uniqueid']][_0x5ab625];if(this[_0x2bf8('0x11')][_0x1dd323[_0x2bf8('0x67')]]){if(_0x1dd323[_0x2bf8('0x8e')]&&_0x1dd323[_0x2bf8('0x90')]!=!![]){this['voiceQueues'][_0x1dd323['queue']][_0x2bf8('0x58')]+=0x1;}if(_0x1dd323[_0x2bf8('0x7e')]){this[_0x2bf8('0x11')][_0x1dd323[_0x2bf8('0x67')]][_0x2bf8('0x59')]+=0x1;}this[_0x2bf8('0x11')][_0x1dd323[_0x2bf8('0x67')]][_0x2bf8('0xba')]+=moment(_0x1dd323[_0x2bf8('0x84')])[_0x2bf8('0xbb')](_0x1dd323['queuecallerjoinAt'],_0x2bf8('0xbc'))||0x0;if(_0x5ab625===this[_0x2bf8('0xd')][_0x390c33[_0x2bf8('0x4d')]][_0x2bf8('0xb9')]-0x1){this['voiceQueues'][_0x1dd323[_0x2bf8('0x67')]][_0x2bf8('0x57')]+=moment()[_0x2bf8('0xbd')](0x0)[_0x2bf8('0xbb')](_0x1dd323[_0x2bf8('0x96')],_0x2bf8('0xbc'));this[_0x2bf8('0x11')][_0x1dd323['queue']]['total']+=0x1;if(_0x1dd323[_0x2bf8('0x7b')]){this[_0x2bf8('0x11')][_0x1dd323[_0x2bf8('0x67')]]['answered']+=0x1;this[_0x2bf8('0x11')][_0x1dd323[_0x2bf8('0x67')]]['sumBillable']+=moment()[_0x2bf8('0xbd')](0x0)['diff'](_0x1dd323['queuecallerleaveAt'],'seconds');_0x1dd323['queuecallercompleteAt']=moment()['format'](_0x2bf8('0x85'));_0x1dd323[_0x2bf8('0x8e')]=![];_0x1dd323[_0x2bf8('0x8f')]=null;}if(_0x1dd323[_0x2bf8('0x8e')]&&_0x1dd323[_0x2bf8('0x90')]!=!![]){_0x1dd323[_0x2bf8('0xa5')]=_0x2bf8('0x58');logger[_0x2bf8('0x46')](_0x2bf8('0xbe'),_0x390c33[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x1dd323,{'showHidden':![],'depth':null}));ami[_0x2bf8('0x45')]('custom:queuecallerunmanaged',_0x1dd323);}if(_0x1dd323[_0x2bf8('0x7e')]){_0x1dd323['lastevent']=_0x2bf8('0x59');logger[_0x2bf8('0x46')](_0x2bf8('0xbf'),_0x390c33[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x1dd323,{'showHidden':![],'depth':null}));ami[_0x2bf8('0x45')]('custom:queuecallerabandon',_0x1dd323);}}else{this['voiceQueues'][_0x1dd323[_0x2bf8('0x67')]][_0x2bf8('0x57')]+=this[_0x2bf8('0x11')][_0x1dd323[_0x2bf8('0x67')]][_0x2bf8('0xba')];}logger[_0x2bf8('0x68')](_0x2bf8('0xc0'),_0x390c33[_0x2bf8('0x4d')],_0x1dd323[_0x2bf8('0x4a')],_0x1dd323[_0x2bf8('0x51')],_0x390c33[_0x2bf8('0xc1')]);this['channels'][_0x390c33[_0x2bf8('0x4d')]]=_0x1dd323;this['emitVoiceQueueChannelRemove'](_0x1dd323,_0x2bf8('0xc2'));this[_0x2bf8('0x50')](this[_0x2bf8('0x11')][_0x1dd323['queue']],_0x2bf8('0xc2'));}}logger[_0x2bf8('0x46')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x390c33[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](this['queueReports'][_0x390c33[_0x2bf8('0x4d')]],{'showHidden':![],'depth':null}));ami[_0x2bf8('0x45')]('custom:voiceQueueReport',this['queueReports'][_0x390c33[_0x2bf8('0x4d')]]);delete this['queueReports'][_0x390c33[_0x2bf8('0x4d')]];delete this['channels'][_0x390c33[_0x2bf8('0x4d')]];}if(this[_0x2bf8('0x40')][_0x390c33[_0x2bf8('0x4d')]]){delete this[_0x2bf8('0x40')][_0x390c33[_0x2bf8('0x4d')]];}}}catch(_0x42e741){logger[_0x2bf8('0x3c')](_0x2bf8('0xc3'),_0x390c33['uniqueid'],util[_0x2bf8('0x3e')](_0x42e741,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')]['syncAttendedTransfer']=function(_0x559e1a){try{if(this[_0x2bf8('0x61')](_0x559e1a)){logger[_0x2bf8('0x46')]('[%s][voiceQueueReport][attendedtransfer]',_0x559e1a[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x559e1a,{'showHidden':![],'depth':null}));var _0x4ae45b;if(this['queueReports'][_0x559e1a[_0x2bf8('0xc4')]]){_0x4ae45b=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x559e1a[_0x2bf8('0xc4')]]);_0x4ae45b[_0x2bf8('0x9a')]=_0x559e1a['secondtransfererexten'];_0x4ae45b[_0x2bf8('0x9c')]=_0x559e1a[_0x2bf8('0xc5')];_0x4ae45b[_0x2bf8('0x7f')]=_0x2bf8('0xc6');_0x4ae45b[_0x2bf8('0x90')]=!![];_0x4ae45b[_0x2bf8('0x98')]=_0x2bf8('0xc7');if(this[_0x2bf8('0xd')][_0x559e1a[_0x2bf8('0xc5')]]){var _0x250922=this[_0x2bf8('0xd')][_0x559e1a[_0x2bf8('0xc5')]];this['queueReports'][_0x559e1a[_0x2bf8('0xc5')]]=this[_0x2bf8('0xd')][_0x559e1a[_0x2bf8('0xc4')]];this['queueReports'][_0x559e1a[_0x2bf8('0xc4')]]=_0x250922;var _0x5eca2b=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x559e1a[_0x2bf8('0xc4')]]);_0x5eca2b[_0x2bf8('0xc8')]=!![];}logger['info'](_0x2bf8('0xc9'),_0x559e1a[_0x2bf8('0x4d')],_0x4ae45b[_0x2bf8('0x4a')],_0x4ae45b[_0x2bf8('0x51')],_0x4ae45b[_0x2bf8('0x9a')],_0x4ae45b[_0x2bf8('0x9c')]);}else if(this[_0x2bf8('0xd')][_0x559e1a['transfertargetuniqueid']]){_0x4ae45b=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x559e1a['transfertargetuniqueid']]);_0x4ae45b[_0x2bf8('0x9a')]=_0x559e1a[_0x2bf8('0xca')];_0x4ae45b['transferuniqueid']=_0x559e1a[_0x2bf8('0xcb')];_0x4ae45b['queuecallerexitreason']='ATTENDEDTRANSFER';_0x4ae45b[_0x2bf8('0x90')]=!![];_0x4ae45b[_0x2bf8('0x98')]=_0x2bf8('0xc7');if(this[_0x2bf8('0xd')][_0x559e1a['origtransfereruniqueid']]){var _0x250922=this[_0x2bf8('0xd')][_0x559e1a[_0x2bf8('0xcb')]];this[_0x2bf8('0xd')][_0x559e1a['origtransfereruniqueid']]=this[_0x2bf8('0xd')][_0x559e1a['transfertargetuniqueid']];this['queueReports'][_0x559e1a[_0x2bf8('0xcc')]]=_0x250922;var _0x5eca2b=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x559e1a[_0x2bf8('0xcc')]]);_0x5eca2b[_0x2bf8('0xc8')]=!![];}logger['info'](_0x2bf8('0xc9'),_0x559e1a[_0x2bf8('0x4d')],_0x4ae45b[_0x2bf8('0x4a')],_0x4ae45b['type'],_0x4ae45b[_0x2bf8('0x9a')],_0x4ae45b[_0x2bf8('0x9c')]);}}}catch(_0x260b55){logger['error'](_0x2bf8('0xcd'),_0x559e1a[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x260b55,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x2b')]=function(_0x266791){try{if(this[_0x2bf8('0x61')](_0x266791)){logger['debug'](_0x2bf8('0xce'),_0x266791[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x266791,{'showHidden':![],'depth':null}));if(this[_0x2bf8('0xd')][_0x266791[_0x2bf8('0xc4')]]){var _0x52dea3=_['last'](this[_0x2bf8('0xd')][_0x266791['transfereeuniqueid']]);_0x52dea3['queuecallerexitreason']='BLINDTRANSFER';_0x52dea3[_0x2bf8('0x90')]=!![];_0x52dea3[_0x2bf8('0x98')]=_0x2bf8('0xcf');_0x52dea3[_0x2bf8('0x9a')]=_0x266791[_0x2bf8('0xd0')];_0x52dea3[_0x2bf8('0x9c')]=_0x266791[_0x2bf8('0xc4')];logger[_0x2bf8('0x68')](_0x2bf8('0xd1'),_0x266791[_0x2bf8('0x4d')],_0x52dea3[_0x2bf8('0x4a')],_0x52dea3['type'],_0x52dea3['transferexten'],_0x52dea3['transferuniqueid']);this[_0x2bf8('0x21')]({'event':_0x2bf8('0xd2'),'uniqueid':_0x266791['transfereeuniqueid'],'context':_0x266791[_0x2bf8('0xd3')],'channel':_0x266791[_0x2bf8('0xd4')]});}}}catch(_0x5acb85){logger[_0x2bf8('0x3c')](_0x2bf8('0xce'),_0x266791[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x5acb85,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')]['syncMusicOnHoldStart']=function(_0x1126d8){try{if(this[_0x2bf8('0x61')](_0x1126d8)){logger[_0x2bf8('0x46')](_0x2bf8('0xd5'),_0x1126d8['uniqueid'],util[_0x2bf8('0x3e')](_0x1126d8,{'showHidden':![],'depth':null}));if(this[_0x2bf8('0xd')][_0x1126d8['uniqueid']]){var _0x230cdc=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x1126d8[_0x2bf8('0x4d')]]);if(!_['isNil'](_0x230cdc[_0x2bf8('0x84')])){_0x230cdc[_0x2bf8('0xd6')]=moment()[_0x2bf8('0x48')](_0x2bf8('0x85'));logger[_0x2bf8('0x68')](_0x2bf8('0xd7'),_0x1126d8[_0x2bf8('0x4d')],_0x230cdc[_0x2bf8('0xd6')]);}}}}catch(_0x5c85e2){logger[_0x2bf8('0x3c')](_0x2bf8('0xd5'),_0x1126d8[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x5c85e2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x28')]=function(_0x59cbd1){try{if(this[_0x2bf8('0x61')](_0x59cbd1)){logger[_0x2bf8('0x46')](_0x2bf8('0xd8'),_0x59cbd1[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x59cbd1,{'showHidden':![],'depth':null}));if(this[_0x2bf8('0xd')][_0x59cbd1['uniqueid']]){var _0x1ad249=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x59cbd1[_0x2bf8('0x4d')]]);if(!_[_0x2bf8('0x36')](_0x1ad249[_0x2bf8('0xd6')])){_0x1ad249[_0x2bf8('0xd9')]+=moment()[_0x2bf8('0xbd')](0x0)[_0x2bf8('0xbb')](_0x1ad249[_0x2bf8('0xd6')],_0x2bf8('0xbc'));logger[_0x2bf8('0x68')](_0x2bf8('0xda'),_0x59cbd1[_0x2bf8('0x4d')],_0x1ad249[_0x2bf8('0xd9')]);delete _0x1ad249[_0x2bf8('0xd6')];}}}}catch(_0x46d4f9){logger[_0x2bf8('0x3c')](_0x2bf8('0xd8'),_0x59cbd1[_0x2bf8('0x4d')],util['inspect'](_0x46d4f9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')]['syncNewExten']=function(_0x5bf5f4){try{if(this[_0x2bf8('0x61')](_0x5bf5f4)){logger[_0x2bf8('0x46')](_0x2bf8('0xdb'),_0x5bf5f4[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x5bf5f4,{'showHidden':![],'depth':null}));if(_0x5bf5f4[_0x2bf8('0xdc')][_0x2bf8('0xdd')]()===_0x2bf8('0xde')){_0x5bf5f4[_0x2bf8('0xdf')]=_0x5bf5f4[_0x2bf8('0xe0')]&&_0x5bf5f4[_0x2bf8('0xe0')]['startsWith'](_0x2bf8('0xe1'))?_0x5bf5f4[_0x2bf8('0xe0')]:(_0x5bf5f4['appdata']||_0x5bf5f4[_0x2bf8('0xdf')])[_0x2bf8('0xdd')]();if(_[_0x2bf8('0x93')](_0x5bf5f4[_0x2bf8('0xdf')][_0x2bf8('0xdd')](),_0x2bf8('0xe2'))){logger[_0x2bf8('0x68')](_0x2bf8('0xe3'),_0x5bf5f4['uniqueid'],_0x5bf5f4[_0x2bf8('0xdc')],_0x5bf5f4[_0x2bf8('0xdf')]);if(_[_0x2bf8('0x62')](this[_0x2bf8('0xf')][_0x5bf5f4[_0x2bf8('0x4d')]]))this[_0x2bf8('0xf')][_0x5bf5f4['uniqueid']]={};var _0x2174f5=_0x5bf5f4[_0x2bf8('0xdf')]['split']('=');var _0x5c1d1e=_0x2174f5[0x0]['toLowerCase']()['match'](/cdr\((.*)\)/);if(_0x5c1d1e)this[_0x2bf8('0xf')][_0x5bf5f4[_0x2bf8('0x4d')]][_0x5c1d1e[0x1]]=_0x2174f5[0x1];}}}}catch(_0x11fc3a){logger[_0x2bf8('0x3c')](_0x2bf8('0xe4'),_0x5bf5f4[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x11fc3a,{'showHidden':![],'depth':null}));}};module[_0x2bf8('0xe5')]=VoiceQueueReport;
\ No newline at end of file
+var _0xf2a6=['[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','bridgepeer','membercalls','memberlastcall','memberpenalty','[%s][voiceQueueReport][hangup]','unmanaged','diff','length','sumDuration','total','answered','milliseconds','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceQueueReport][newexten]','exports','lodash','ioredis','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','queueReports','agents','channels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','isNil','status','channel','No\x20such\x20channel','error','inspect','variables','[%s][voiceQueueReport][checkVariables]','prototype','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][','uniqueid','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','format','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','loggedIn','sumBillable','sumHoldTime','abandoned','Trunk','active','callerid','Interval','stringify','md5',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','Action','queues','catch','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummary]\x20event:','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','available','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','keys','last','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','assigned','membername','queuecallercomplete','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid'];(function(_0x2eebec,_0x57f170){var _0x55b028=function(_0x47a527){while(--_0x47a527){_0x2eebec['push'](_0x2eebec['shift']());}};_0x55b028(++_0x57f170);}(_0xf2a6,0x13d));var _0x6f2a=function(_0x1a4f99,_0x2b023c){_0x1a4f99=_0x1a4f99-0x0;var _0x4c4412=_0xf2a6[_0x1a4f99];return _0x4c4412;};'use strict';var _=require(_0x6f2a('0x0'));var moment=require('moment');var util=require('util');var md5=require('md5');var Redis=require(_0x6f2a('0x1'));var config=require('../../../config/environment');var logger=require(_0x6f2a('0x2'))(_0x6f2a('0x3'));var ami=require(_0x6f2a('0x4'));var QueueReport=require(_0x6f2a('0x5'));config[_0x6f2a('0x6')]=_[_0x6f2a('0x7')](config[_0x6f2a('0x6')],{'host':_0x6f2a('0x8'),'port':0x18eb});var io=require(_0x6f2a('0x9'))(new Redis(config[_0x6f2a('0x6')]));var Sequence=function(){};Sequence['prototype'][_0x6f2a('0xa')]=function(_0xda4179){this[_0x6f2a('0xb')]=this[_0x6f2a('0xb')]?this['tail'][_0x6f2a('0xc')](_0xda4179):_0xda4179();};function VoiceQueueReport(_0x5663e2){this[_0x6f2a('0xd')]=new Sequence();this[_0x6f2a('0xe')]={};this[_0x6f2a('0xf')]=_0x5663e2['agents'];this[_0x6f2a('0x10')]=_0x5663e2['queueChannels'];this[_0x6f2a('0x11')]=_0x5663e2[_0x6f2a('0x11')];this[_0x6f2a('0x12')]=!![];this['campaigns']=_0x5663e2[_0x6f2a('0x13')];this['variables']={};ami['on'](_0x6f2a('0x14'),this[_0x6f2a('0x15')][_0x6f2a('0x16')](this));ami['on'](_0x6f2a('0x17'),this[_0x6f2a('0x18')]['bind'](this));ami['on'](_0x6f2a('0x19'),this[_0x6f2a('0x1a')][_0x6f2a('0x16')](this));ami['on'](_0x6f2a('0x1b'),this[_0x6f2a('0x1c')][_0x6f2a('0x16')](this));ami['on'](_0x6f2a('0x1d'),this[_0x6f2a('0x1e')][_0x6f2a('0x16')](this));ami['on'](_0x6f2a('0x1f'),this[_0x6f2a('0x20')][_0x6f2a('0x16')](this));ami['on']('agentconnect',this[_0x6f2a('0x21')][_0x6f2a('0x16')](this));ami['on'](_0x6f2a('0x22'),this[_0x6f2a('0x23')][_0x6f2a('0x16')](this));ami['on'](_0x6f2a('0x24'),this[_0x6f2a('0x25')][_0x6f2a('0x16')](this));ami['on'](_0x6f2a('0x26'),this[_0x6f2a('0x27')][_0x6f2a('0x16')](this));ami['on']('newexten',this[_0x6f2a('0x28')][_0x6f2a('0x16')](this));ami['on'](_0x6f2a('0x29'),this[_0x6f2a('0x2a')][_0x6f2a('0x16')](this));ami['on'](_0x6f2a('0x2b'),this[_0x6f2a('0x2c')]['bind'](this));ami['on'](_0x6f2a('0x2d'),this['syncAttendedTransfer'][_0x6f2a('0x16')](this));ami['on'](_0x6f2a('0x2e'),this[_0x6f2a('0x2f')]['bind'](this));this[_0x6f2a('0x30')]();this[_0x6f2a('0x31')]();}function clearChannels(_0x559606){if(!_['isEmpty'](_0x559606)){for(var _0x1dabde in _0x559606){if(_0x559606[_0x6f2a('0x32')](_0x1dabde)){delete _0x559606[_0x1dabde];}}}}function clearCampaigns(_0x3e48dd){if(!_[_0x6f2a('0x33')](_0x3e48dd)){for(var _0x6b781b in _0x3e48dd){if(_0x3e48dd['hasOwnProperty'](_0x6b781b)){_0x3e48dd[_0x6b781b][_0x6f2a('0x34')]=0x0;}}}}function clearVoiceQueues(_0x549dd7){if(!_[_0x6f2a('0x33')](_0x549dd7)){for(var _0xd64d6 in _0x549dd7){if(_0x549dd7['hasOwnProperty'](_0xd64d6)){_0x549dd7[_0xd64d6][_0x6f2a('0x34')]=0x0;_0x549dd7[_0xd64d6][_0x6f2a('0x35')]=0x0;_0x549dd7[_0xd64d6]['pTalking']=0x0;_0x549dd7[_0xd64d6][_0x6f2a('0x36')]=0x0;_0x549dd7[_0xd64d6][_0x6f2a('0x37')]=!![];}}}}function clearAgentBooked(_0x28d546){if(!_[_0x6f2a('0x33')](_0x28d546)){for(var _0x347767 in _0x28d546){if(_0x28d546[_0x6f2a('0x32')](_0x347767)){_0x28d546[_0x347767][_0x6f2a('0x38')]=!![];}}}}VoiceQueueReport['prototype'][_0x6f2a('0x39')]=function(){var _0x5a0a3c=this;for(var _0x34acb0 in this['channels']){if(this[_0x6f2a('0x10')][_0x6f2a('0x32')](_0x34acb0)&&!this[_0x6f2a('0x10')][_0x34acb0]['switch']){this[_0x6f2a('0xd')]['enqueue'](function(){if(!_[_0x6f2a('0x3a')](_0x5a0a3c[_0x6f2a('0x10')][_0x34acb0])){return ami['Action']({'action':_0x6f2a('0x3b'),'channel':_0x5a0a3c[_0x6f2a('0x10')][_0x34acb0][_0x6f2a('0x3c')]})['catch'](function(_0x5e6bdb){if(_0x5e6bdb['message']===_0x6f2a('0x3d')){setTimeout(function(){if(_0x5a0a3c['channels'][_0x34acb0]){delete _0x5a0a3c[_0x6f2a('0x10')][_0x34acb0];logger[_0x6f2a('0x3e')]('[%s][voiceQueueReport][checkChannel]',_0x34acb0,util[_0x6f2a('0x3f')](_0x5e6bdb,{'showHidden':![],'depth':null}));}if(_0x5a0a3c[_0x6f2a('0xe')][_0x34acb0]){delete _0x5a0a3c[_0x6f2a('0xe')][_0x34acb0];logger[_0x6f2a('0x3e')]('[%s][voiceQueueReport][checkQueueReport]',_0x34acb0,util[_0x6f2a('0x3f')](_0x5e6bdb,{'showHidden':![],'depth':null}));}if(_0x5a0a3c['variables'][_0x34acb0]){delete _0x5a0a3c[_0x6f2a('0x40')][_0x34acb0];logger[_0x6f2a('0x3e')](_0x6f2a('0x41'),_0x34acb0,util[_0x6f2a('0x3f')](_0x5e6bdb,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x27')]=function(){logger[_0x6f2a('0x3e')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x6f2a('0x10')]);this[_0x6f2a('0x43')](this[_0x6f2a('0xe')]);clearAgentBooked(this[_0x6f2a('0xf')]);clearVoiceQueues(this[_0x6f2a('0x11')]);clearCampaigns(this[_0x6f2a('0x13')]);};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x43')]=function(_0x212c17){var _0x28ebc2=this;if(!_[_0x6f2a('0x33')](_0x212c17)){for(var _0x533cde in _0x212c17){if(_0x212c17[_0x6f2a('0x32')](_0x533cde)){_0x28ebc2[_0x6f2a('0x44')](_0x212c17[_0x533cde],_0x6f2a('0x45'));delete _0x212c17[_0x533cde];}}}};VoiceQueueReport['prototype'][_0x6f2a('0x46')]=function(_0xdbc281,_0xeede7f,_0x3a4214){io['to'](_0xdbc281)[_0x6f2a('0x46')](_0xeede7f,_0x3a4214);};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x47')]=function(_0x44c61d,_0xb39009){logger[_0x6f2a('0x48')](_0x6f2a('0x49')+_0xb39009+']\x20sending\x20voice_queue_channel:save\x20event:',_0x44c61d[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x44c61d,{'showHidden':![],'depth':null}));this[_0x6f2a('0x46')](util['format'](_0x6f2a('0x4b'),_0x44c61d[_0x6f2a('0x4c')]),_0x6f2a('0x4d'),_0x44c61d);io[_0x6f2a('0x46')](_0x6f2a('0x4e'),_0x44c61d);};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x44')]=function(_0x2c9381,_0x4accaf){logger[_0x6f2a('0x48')]('[%s][voiceQueueReport]['+_0x4accaf+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x2c9381[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x2c9381,{'showHidden':![],'depth':null}));this[_0x6f2a('0x46')](util[_0x6f2a('0x4f')]('voice:queue:%s',_0x2c9381[_0x6f2a('0x4c')]),_0x6f2a('0x50'),_0x2c9381);io[_0x6f2a('0x46')](_0x6f2a('0x51'),_0x2c9381);};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x52')]=function(_0x47d221,_0x45a37a){if(_0x47d221[_0x6f2a('0x53')]===_0x6f2a('0x54')){var _0x40febf={'id':_0x47d221['id'],'name':_0x47d221[_0x6f2a('0x4c')],'strategy':_0x47d221[_0x6f2a('0x55')],'answered':_0x47d221['answered'],'available':_0x47d221['available'],'loggedIn':_0x47d221[_0x6f2a('0x56')],'pTalking':_0x47d221['pTalking'],'sumBillable':_0x47d221[_0x6f2a('0x57')],'sumDuration':_0x47d221['sumDuration'],'sumHoldTime':_0x47d221[_0x6f2a('0x58')]||0x0,'talking':_0x47d221[_0x6f2a('0x35')],'total':_0x47d221['total'],'type':_0x47d221['type'],'unmanaged':_0x47d221['unmanaged'],'abandoned':_0x47d221[_0x6f2a('0x59')],'waiting':_0x47d221['waiting']};if(_0x47d221['Trunk']){_0x40febf[_0x6f2a('0x5a')]={'id':_0x47d221[_0x6f2a('0x5a')]['id'],'name':_0x47d221[_0x6f2a('0x5a')][_0x6f2a('0x4c')],'active':_0x47d221['Trunk'][_0x6f2a('0x5b')],'callerid':_0x47d221[_0x6f2a('0x5a')][_0x6f2a('0x5c')]};}if(_0x47d221[_0x6f2a('0x5d')]){_0x40febf[_0x6f2a('0x5d')]={'id':_0x47d221[_0x6f2a('0x5d')]['id'],'name':_0x47d221['Interval'][_0x6f2a('0x4c')]};}var _0xb76ada=md5(JSON[_0x6f2a('0x5e')](_0x40febf));if(_0x47d221[_0x6f2a('0x5f')]!==_0xb76ada){_0x47d221[_0x6f2a('0x5f')]=_0xb76ada;logger[_0x6f2a('0x48')]('[voiceQueueReport]['+_0x45a37a+_0x6f2a('0x60'),util[_0x6f2a('0x3f')](_0x40febf,{'showHidden':![],'depth':null}));this[_0x6f2a('0x46')](util['format']('voice:queue:%s',_0x40febf[_0x6f2a('0x4c')]),_0x6f2a('0x61'),_0x40febf);}}};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x62')]=function(_0x3952f8){return _0x3952f8!==null&&!_[_0x6f2a('0x63')](_0x3952f8);};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x31')]=function(){var _0x39f0c4=this;setInterval(function(){_0x39f0c4[_0x6f2a('0x39')]();ami[_0x6f2a('0x64')]({'action':_0x6f2a('0x65')})[_0x6f2a('0x66')](function(_0x4ab619){logger[_0x6f2a('0x3e')]('[voiceQueueReport][queues]',util[_0x6f2a('0x3f')](_0x4ab619,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x6f2a('0x30')]=function(){var _0x53f83c=this;setInterval(function(){if(_0x53f83c[_0x6f2a('0x12')]){return ami[_0x6f2a('0x64')]({'action':_0x6f2a('0x14')})['then'](function(_0x45cb40){_0x53f83c['flagQueueSummary']=![];})[_0x6f2a('0x66')](function(_0x4b1505){logger['error'](_0x6f2a('0x67'),util[_0x6f2a('0x3f')](_0x4b1505,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x15')]=function(_0x429acf){try{if(this[_0x6f2a('0x62')](_0x429acf)&&this[_0x6f2a('0x62')](_0x429acf['queue'])){logger[_0x6f2a('0x48')](_0x6f2a('0x68'),util[_0x6f2a('0x3f')](_0x429acf,{'showHidden':![],'depth':null}));if(this[_0x6f2a('0x11')][_0x429acf[_0x6f2a('0x69')]]){logger[_0x6f2a('0x6a')](_0x6f2a('0x6b'),_0x429acf[_0x6f2a('0x69')]);var _0x32e177=_[_0x6f2a('0x6c')](this[_0x6f2a('0x10')],_0x6f2a('0x69'))[_0x429acf[_0x6f2a('0x69')]]||0x0;var _0x58a304=_0x32e177-_0x429acf[_0x6f2a('0x6d')];if(this[_0x6f2a('0x11')][_0x429acf[_0x6f2a('0x69')]][_0x6f2a('0x36')]!==_[_0x6f2a('0x6e')](_0x429acf[_0x6f2a('0x6d')])||this[_0x6f2a('0x11')][_0x429acf[_0x6f2a('0x69')]][_0x6f2a('0x56')]!==_['toNumber'](_0x429acf[_0x6f2a('0x6f')])||this[_0x6f2a('0x11')][_0x429acf[_0x6f2a('0x69')]][_0x6f2a('0x70')]!==_[_0x6f2a('0x6e')](_0x429acf[_0x6f2a('0x70')])||this[_0x6f2a('0x11')][_0x429acf[_0x6f2a('0x69')]][_0x6f2a('0x35')]!==_0x58a304){this[_0x6f2a('0x11')][_0x429acf['queue']][_0x6f2a('0x36')]=_[_0x6f2a('0x6e')](_0x429acf['callers']);this[_0x6f2a('0x11')][_0x429acf[_0x6f2a('0x69')]][_0x6f2a('0x56')]=_[_0x6f2a('0x6e')](_0x429acf['loggedin']);this['voiceQueues'][_0x429acf[_0x6f2a('0x69')]][_0x6f2a('0x70')]=_['toNumber'](_0x429acf[_0x6f2a('0x70')]);this[_0x6f2a('0x11')][_0x429acf[_0x6f2a('0x69')]][_0x6f2a('0x35')]=_0x58a304>0x0?_0x58a304:0x0;this['voiceQueues'][_0x429acf[_0x6f2a('0x69')]][_0x6f2a('0x35')]=this[_0x6f2a('0x11')][_0x429acf[_0x6f2a('0x69')]][_0x6f2a('0x35')]>_[_0x6f2a('0x6e')](_0x429acf[_0x6f2a('0x6f')])?_[_0x6f2a('0x6e')](_0x429acf[_0x6f2a('0x6f')]):this['voiceQueues'][_0x429acf[_0x6f2a('0x69')]][_0x6f2a('0x35')];this[_0x6f2a('0x52')](this[_0x6f2a('0x11')][_0x429acf[_0x6f2a('0x69')]],_0x6f2a('0x14'));}logger[_0x6f2a('0x48')](_0x6f2a('0x71'),util[_0x6f2a('0x3f')](this[_0x6f2a('0x11')][_0x429acf[_0x6f2a('0x69')]],{'showHidden':![],'depth':null}));ami[_0x6f2a('0x46')](_0x6f2a('0x72'),this[_0x6f2a('0x11')][_0x429acf[_0x6f2a('0x69')]]);}}}catch(_0x3d8e98){logger[_0x6f2a('0x3e')](_0x6f2a('0x67'),util[_0x6f2a('0x3f')](_0x3d8e98,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x18')]=function(_0x4fe9c4){logger[_0x6f2a('0x48')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x6f2a('0x3f')](_0x4fe9c4,{'showHidden':![],'depth':null}));this[_0x6f2a('0x12')]=!![];};VoiceQueueReport['prototype'][_0x6f2a('0x1a')]=function(_0x16bca1){try{if(this[_0x6f2a('0x62')](_0x16bca1)){logger[_0x6f2a('0x48')](_0x6f2a('0x73'),_0x16bca1['uniqueid'],util[_0x6f2a('0x3f')](_0x16bca1,{'showHidden':![],'depth':null}));if(_[_0x6f2a('0x63')](this['queueReports'][_0x16bca1[_0x6f2a('0x4a')]]))this['queueReports'][_0x16bca1[_0x6f2a('0x4a')]]=[];if(_[_0x6f2a('0x63')](this['channels'][_0x16bca1[_0x6f2a('0x4a')]]))this[_0x6f2a('0x10')][_0x16bca1['uniqueid']]={};var _0x495ecd=new QueueReport();_0x495ecd['name']=_0x16bca1['queue'];_0x495ecd['type']=this[_0x6f2a('0x11')][_0x495ecd['name']]&&this[_0x6f2a('0x11')][_0x495ecd[_0x6f2a('0x4c')]]['type']?this[_0x6f2a('0x11')][_0x495ecd[_0x6f2a('0x4c')]][_0x6f2a('0x53')]||_0x6f2a('0x54'):'inbound';_0x495ecd[_0x6f2a('0x69')]=_0x16bca1[_0x6f2a('0x69')];_0x495ecd[_0x6f2a('0x74')]=moment()[_0x6f2a('0x4f')](_0x6f2a('0x75'));_0x495ecd[_0x6f2a('0x76')]=_0x16bca1['position'];_0x495ecd[_0x6f2a('0x77')]=_0x16bca1[_0x6f2a('0x77')];_0x495ecd[_0x6f2a('0x4a')]=_0x16bca1['uniqueid'];_0x495ecd['routealias']=this[_0x6f2a('0x10')][_0x16bca1[_0x6f2a('0x4a')]][_0x6f2a('0x78')];logger[_0x6f2a('0x6a')](_0x6f2a('0x79'),_0x495ecd['name'],_0x495ecd[_0x6f2a('0x53')]);_['merge'](_0x495ecd,_[_0x6f2a('0x7a')](_0x16bca1,_[_0x6f2a('0x7b')](_0x495ecd)));this[_0x6f2a('0xe')][_0x16bca1['uniqueid']]['push'](_0x495ecd);this[_0x6f2a('0x10')][_0x16bca1[_0x6f2a('0x4a')]]=_0x495ecd;this['emitVoiceQueueChannelSave'](_0x495ecd,_0x6f2a('0x19'));}}catch(_0x16adb6){logger[_0x6f2a('0x3e')](_0x6f2a('0x73'),_0x16bca1[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x16adb6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x1c')]=function(_0x5e8dfd){try{if(this[_0x6f2a('0x62')](_0x5e8dfd)){logger[_0x6f2a('0x48')]('[%s][voiceQueueReport][queuecallerabandon]',_0x5e8dfd[_0x6f2a('0x4a')],util['inspect'](_0x5e8dfd,{'showHidden':![],'depth':null}));if(this[_0x6f2a('0xe')][_0x5e8dfd[_0x6f2a('0x4a')]]){var _0x172487=_[_0x6f2a('0x7c')](this[_0x6f2a('0xe')][_0x5e8dfd['uniqueid']]);_0x172487['queuecallercomplete']=![];_0x172487[_0x6f2a('0x7d')]=null;_0x172487[_0x6f2a('0x7e')]=_0x5e8dfd[_0x6f2a('0x7e')];_0x172487[_0x6f2a('0x7f')]=_0x5e8dfd[_0x6f2a('0x7f')];_0x172487['queuecallerabandon']=!![];_0x172487['queuecallerabandonAt']=moment()[_0x6f2a('0x4f')](_0x6f2a('0x75'));_0x172487[_0x6f2a('0x80')]=_0x6f2a('0x81');_0x172487[_0x6f2a('0x82')]=null;logger[_0x6f2a('0x6a')](_0x6f2a('0x83'),_0x172487[_0x6f2a('0x4c')],_0x172487['type']);this[_0x6f2a('0x10')][_0x5e8dfd[_0x6f2a('0x4a')]]=_0x172487;this[_0x6f2a('0x44')](_0x172487,_0x6f2a('0x1b'));}}}catch(_0xaa3321){logger[_0x6f2a('0x3e')](_0x6f2a('0x84'),_0x5e8dfd[_0x6f2a('0x4a')],util['inspect'](_0xaa3321,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6f2a('0x1e')]=function(_0xc6e067){try{if(this[_0x6f2a('0x62')](_0xc6e067)){logger[_0x6f2a('0x48')](_0x6f2a('0x85'),_0xc6e067[_0x6f2a('0x4a')],util['inspect'](_0xc6e067,{'showHidden':![],'depth':null}));if(this[_0x6f2a('0xe')][_0xc6e067[_0x6f2a('0x4a')]]){var _0x510bd0=_[_0x6f2a('0x7c')](this[_0x6f2a('0xe')][_0xc6e067[_0x6f2a('0x4a')]]);_0x510bd0['queuecallerleaveAt']=moment()[_0x6f2a('0x4f')](_0x6f2a('0x75'));_0x510bd0['connectedlinenum']=_0xc6e067[_0x6f2a('0x86')];_0x510bd0[_0x6f2a('0x87')]=_0xc6e067[_0x6f2a('0x87')];logger[_0x6f2a('0x6a')](_0x6f2a('0x88'),_0x510bd0[_0x6f2a('0x4c')],_0x510bd0[_0x6f2a('0x53')],_0xc6e067[_0x6f2a('0x86')],_0xc6e067[_0x6f2a('0x87')]);this['channels'][_0xc6e067[_0x6f2a('0x4a')]]=_0x510bd0;this[_0x6f2a('0x47')](_0x510bd0,_0x6f2a('0x1d'));}}}catch(_0x53b9c){logger[_0x6f2a('0x3e')]('[%s][voiceQueueReport][queuecallerleave]',_0xc6e067['uniqueid'],util[_0x6f2a('0x3f')](_0x53b9c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x21')]=function(_0x531fdb){try{if(this['isNotNull'](_0x531fdb)){logger[_0x6f2a('0x48')](_0x6f2a('0x89'),_0x531fdb[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x531fdb,{'showHidden':![],'depth':null}));if(this[_0x6f2a('0xe')][_0x531fdb[_0x6f2a('0x4a')]]){var _0x5c9c70=_[_0x6f2a('0x7c')](this[_0x6f2a('0xe')][_0x531fdb['uniqueid']]);_0x5c9c70['queuecallercomplete']=!![];_0x5c9c70[_0x6f2a('0x80')]=_0x6f2a('0x8a');logger[_0x6f2a('0x6a')](_0x6f2a('0x8b'),_0x5c9c70['name'],_0x5c9c70[_0x6f2a('0x53')]);}}}catch(_0x5330dc){logger[_0x6f2a('0x3e')](_0x6f2a('0x89'),_0x531fdb[_0x6f2a('0x4a')],util['inspect'](_0x5330dc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x20')]=function(_0x5aa38a){try{if(this[_0x6f2a('0x62')](_0x5aa38a)){logger[_0x6f2a('0x48')](_0x6f2a('0x8c'),_0x5aa38a[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x5aa38a,{'showHidden':![],'depth':null}));if(this[_0x6f2a('0xe')][_0x5aa38a['uniqueid']]){var _0x3adf64=_[_0x6f2a('0x7c')](this[_0x6f2a('0xe')][_0x5aa38a[_0x6f2a('0x4a')]]);_0x3adf64[_0x6f2a('0x1b')]=![];_0x3adf64[_0x6f2a('0x8d')]=null;_0x3adf64[_0x6f2a('0x8e')]=!![];_0x3adf64[_0x6f2a('0x82')]=_0x5aa38a[_0x6f2a('0x8f')];_0x3adf64[_0x6f2a('0x7e')]=_0x5aa38a['holdtime'];_0x3adf64[_0x6f2a('0x90')]=!![];_0x3adf64[_0x6f2a('0x91')]=![];_0x3adf64[_0x6f2a('0x92')]=null;if(!_0x3adf64[_0x6f2a('0x93')]){if(_0x5aa38a[_0x6f2a('0x94')]==_0x6f2a('0x93')){_0x3adf64['queuecallerexitreason']=_0x6f2a('0x95');logger['info'](_0x6f2a('0x96'),_0x3adf64[_0x6f2a('0x4c')],_0x3adf64[_0x6f2a('0x53')]);}else{if(_[_0x6f2a('0x97')](_0x5aa38a['channel'][_0x6f2a('0x98')](),_0x6f2a('0x99'))){if(this['queueReports'][_0x5aa38a[_0x6f2a('0x9a')]]){var _0x475ebb=_[_0x6f2a('0x7c')](this['queueReports'][_0x5aa38a[_0x6f2a('0x9a')]]);_0x475ebb[_0x6f2a('0x90')]=![];_0x475ebb[_0x6f2a('0x91')]=!![];_0x475ebb[_0x6f2a('0x92')]=moment(_0x3adf64[_0x6f2a('0x74')])[_0x6f2a('0x9b')](_0x5aa38a[_0x6f2a('0x7e')],_0x6f2a('0x9c'))['format'](_0x6f2a('0x75'));_0x475ebb[_0x6f2a('0x80')]=_0x6f2a('0x9d');_0x475ebb[_0x6f2a('0x93')]=!![];_0x475ebb[_0x6f2a('0x9e')]=_0x6f2a('0x9f');_0x475ebb[_0x6f2a('0xa0')]=_0x5aa38a[_0x6f2a('0xa1')];_0x475ebb[_0x6f2a('0xa2')]=_0x5aa38a[_0x6f2a('0x4a')];logger['info'](_0x6f2a('0xa3'),_0x475ebb['name'],_0x475ebb[_0x6f2a('0x53')]);var _0x23ff60=this['queueReports'][_0x5aa38a[_0x6f2a('0x9a')]];this['queueReports'][_0x5aa38a[_0x6f2a('0x9a')]]=this[_0x6f2a('0xe')][_0x5aa38a[_0x6f2a('0x4a')]];this[_0x6f2a('0xe')][_0x5aa38a[_0x6f2a('0x4a')]]=_0x23ff60;}}else{_0x3adf64[_0x6f2a('0x80')]=_0x6f2a('0xa4')+_0x5aa38a['reason'][_0x6f2a('0xa5')]();logger[_0x6f2a('0x6a')](_0x6f2a('0xa6'),_0x3adf64[_0x6f2a('0x4c')],_0x3adf64['type'],_0x3adf64[_0x6f2a('0x80')]);}}}this[_0x6f2a('0x10')][_0x5aa38a[_0x6f2a('0x4a')]]=_0x3adf64;this[_0x6f2a('0x44')](_0x3adf64,_0x6f2a('0x1f'));}}}catch(_0x5eeca6){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x5aa38a[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x5eeca6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6f2a('0x42')]['syncVarSet']=function(_0x25b8f8){try{if(this['isNotNull'](_0x25b8f8)){logger[_0x6f2a('0x48')](_0x6f2a('0xa7'),_0x25b8f8[_0x6f2a('0x4a')],util['inspect'](_0x25b8f8,{'showHidden':![],'depth':null}));this[_0x6f2a('0xa8')](_0x25b8f8[_0x6f2a('0x4a')],_[_0x6f2a('0x7b')](_0x25b8f8[_0x6f2a('0xa9')])[0x0],_0x25b8f8[_0x6f2a('0xaa')]);if(this[_0x6f2a('0xe')][_0x25b8f8['uniqueid']]){var _0x1aceec=_[_0x6f2a('0x7c')](this[_0x6f2a('0xe')][_0x25b8f8['uniqueid']]);if(_0x1aceec){if(this[_0x6f2a('0x62')](_0x25b8f8[_0x6f2a('0xa9')])&&this['isNotNull'](_0x25b8f8[_0x6f2a('0xa9')][_0x6f2a('0xab')])){switch(_0x25b8f8[_0x6f2a('0xaa')]){case _0x6f2a('0xac'):_0x1aceec[_0x6f2a('0x91')]=![];_0x1aceec[_0x6f2a('0x92')]=null;break;case _0x6f2a('0xad'):_0x1aceec['lastevent']=_0x6f2a('0xae');_0x1aceec['queuecallerexit']=!![];_0x1aceec['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1aceec[_0x6f2a('0xaf')]=moment()[_0x6f2a('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0x6f2a('0xb0'),_0x25b8f8[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x1aceec,{'showHidden':![],'depth':null}));ami[_0x6f2a('0x46')](_0x6f2a('0xb1'),_0x1aceec);break;default:_0x1aceec[_0x6f2a('0x91')]=!![];_0x1aceec[_0x6f2a('0x92')]=moment()[_0x6f2a('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x1aceec[_0x6f2a('0xaf')]=moment()[_0x6f2a('0x4f')](_0x6f2a('0x75'));}_0x1aceec[_0x6f2a('0x1b')]=![];_0x1aceec[_0x6f2a('0x8d')]=null;_0x1aceec[_0x6f2a('0x80')]=_0x25b8f8[_0x6f2a('0xaa')];this[_0x6f2a('0x10')][_0x25b8f8[_0x6f2a('0x4a')]]=_0x1aceec;this[_0x6f2a('0x44')](_0x1aceec,_0x6f2a('0x22'));}else if(this[_0x6f2a('0x62')](_0x25b8f8[_0x6f2a('0xa9')])&&this[_0x6f2a('0x62')](_0x25b8f8['variable'][_0x6f2a('0xb2')])){if(!_0x1aceec[_0x6f2a('0x1b')]){_0x1aceec['queuecallerexit']=!![];_0x1aceec[_0x6f2a('0x92')]=moment()[_0x6f2a('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x1aceec['queuecallerexitreason']='EXITWITHKEY';_0x1aceec['queuecallerleaveAt']=moment()[_0x6f2a('0x4f')](_0x6f2a('0x75'));this[_0x6f2a('0x10')][_0x25b8f8[_0x6f2a('0x4a')]]=_0x1aceec;}}logger[_0x6f2a('0x6a')](_0x6f2a('0xb3'),_0x25b8f8[_0x6f2a('0x4a')],_0x1aceec[_0x6f2a('0x4c')],_0x1aceec[_0x6f2a('0x53')],_[_0x6f2a('0x7b')](_0x25b8f8['variable'])[0x0],_0x25b8f8['value']);_0x1aceec[_0x6f2a('0x40')]=this[_0x6f2a('0x40')][_0x25b8f8['uniqueid']];}}}}catch(_0x446792){logger['error'](_0x6f2a('0xa7'),_0x25b8f8[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x446792,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6f2a('0x42')]['addVariable']=function(_0x24ae61,_0x8f7e2d,_0x399ed2){var _0x2349eb=[_0x6f2a('0xb4'),_0x6f2a('0xb5'),_0x6f2a('0xb6'),_0x6f2a('0xb7'),_0x6f2a('0xb8'),'rtpaudioqoslossbridged',_0x6f2a('0xb9'),'rtpaudioqosrttbridged',_0x6f2a('0xba'),'sipuri',_0x6f2a('0xbb'),'bridgepvtcallid',_0x6f2a('0xbc'),'memberdynamic','memberinterface',_0x6f2a('0xbd'),_0x6f2a('0x8f'),_0x6f2a('0xbe'),'memberrealtime'];if(!_['isNil'](_0x8f7e2d)&&!_['includes'](_0x2349eb,_0x8f7e2d)){if(_[_0x6f2a('0x63')](this['variables'][_0x24ae61])){this['variables'][_0x24ae61]={};}this[_0x6f2a('0x40')][_0x24ae61][_0x8f7e2d]=_0x399ed2;}};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x25')]=function(_0x1ef2ea){try{if(this[_0x6f2a('0x62')](_0x1ef2ea)){logger[_0x6f2a('0x48')](_0x6f2a('0xbf'),_0x1ef2ea[_0x6f2a('0x4a')],util['inspect'](_0x1ef2ea,{'showHidden':![],'depth':null}));if(this[_0x6f2a('0xe')][_0x1ef2ea[_0x6f2a('0x4a')]]){for(var _0x22ef96=0x0,_0x7f2ab6={};_0x22ef96<this[_0x6f2a('0xe')][_0x1ef2ea[_0x6f2a('0x4a')]]['length'];_0x22ef96+=0x1){_0x7f2ab6=this['queueReports'][_0x1ef2ea[_0x6f2a('0x4a')]][_0x22ef96];if(this[_0x6f2a('0x11')][_0x7f2ab6[_0x6f2a('0x69')]]){if(_0x7f2ab6[_0x6f2a('0x91')]&&_0x7f2ab6['transfer']!=!![]){this['voiceQueues'][_0x7f2ab6[_0x6f2a('0x69')]][_0x6f2a('0xc0')]+=0x1;}if(_0x7f2ab6[_0x6f2a('0x1b')]){this[_0x6f2a('0x11')][_0x7f2ab6[_0x6f2a('0x69')]][_0x6f2a('0x59')]+=0x1;}this['voiceQueues'][_0x7f2ab6[_0x6f2a('0x69')]][_0x6f2a('0x58')]+=moment(_0x7f2ab6[_0x6f2a('0xaf')])[_0x6f2a('0xc1')](_0x7f2ab6[_0x6f2a('0x74')],_0x6f2a('0x9c'))||0x0;if(_0x22ef96===this[_0x6f2a('0xe')][_0x1ef2ea[_0x6f2a('0x4a')]][_0x6f2a('0xc2')]-0x1){this[_0x6f2a('0x11')][_0x7f2ab6[_0x6f2a('0x69')]][_0x6f2a('0xc3')]+=moment()['milliseconds'](0x0)[_0x6f2a('0xc1')](_0x7f2ab6[_0x6f2a('0x74')],_0x6f2a('0x9c'));this['voiceQueues'][_0x7f2ab6[_0x6f2a('0x69')]][_0x6f2a('0xc4')]+=0x1;if(_0x7f2ab6['queuecallercomplete']){this[_0x6f2a('0x11')][_0x7f2ab6['queue']][_0x6f2a('0xc5')]+=0x1;this[_0x6f2a('0x11')][_0x7f2ab6[_0x6f2a('0x69')]]['sumBillable']+=moment()[_0x6f2a('0xc6')](0x0)['diff'](_0x7f2ab6[_0x6f2a('0xaf')],_0x6f2a('0x9c'));_0x7f2ab6['queuecallercompleteAt']=moment()[_0x6f2a('0x4f')](_0x6f2a('0x75'));_0x7f2ab6[_0x6f2a('0x91')]=![];_0x7f2ab6['queuecallerexitAt']=null;}if(_0x7f2ab6[_0x6f2a('0x91')]&&_0x7f2ab6[_0x6f2a('0x93')]!=!![]){_0x7f2ab6[_0x6f2a('0xc7')]='unmanaged';logger[_0x6f2a('0x48')](_0x6f2a('0xc8'),_0x1ef2ea['uniqueid'],util[_0x6f2a('0x3f')](_0x7f2ab6,{'showHidden':![],'depth':null}));ami[_0x6f2a('0x46')]('custom:queuecallerunmanaged',_0x7f2ab6);}if(_0x7f2ab6[_0x6f2a('0x1b')]){_0x7f2ab6[_0x6f2a('0xc7')]=_0x6f2a('0x59');logger['debug'](_0x6f2a('0xc9'),_0x1ef2ea[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x7f2ab6,{'showHidden':![],'depth':null}));ami[_0x6f2a('0x46')](_0x6f2a('0xca'),_0x7f2ab6);}}else{this[_0x6f2a('0x11')][_0x7f2ab6[_0x6f2a('0x69')]][_0x6f2a('0xc3')]+=this[_0x6f2a('0x11')][_0x7f2ab6[_0x6f2a('0x69')]][_0x6f2a('0x58')];}logger['info']('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x1ef2ea[_0x6f2a('0x4a')],_0x7f2ab6['name'],_0x7f2ab6['type'],_0x1ef2ea[_0x6f2a('0xcb')]);this[_0x6f2a('0x10')][_0x1ef2ea['uniqueid']]=_0x7f2ab6;this[_0x6f2a('0x44')](_0x7f2ab6,'hangup');this[_0x6f2a('0x52')](this[_0x6f2a('0x11')][_0x7f2ab6[_0x6f2a('0x69')]],'hangup');}}logger[_0x6f2a('0x48')](_0x6f2a('0xcc'),_0x1ef2ea[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](this[_0x6f2a('0xe')][_0x1ef2ea[_0x6f2a('0x4a')]],{'showHidden':![],'depth':null}));ami[_0x6f2a('0x46')](_0x6f2a('0xcd'),this['queueReports'][_0x1ef2ea[_0x6f2a('0x4a')]]);delete this[_0x6f2a('0xe')][_0x1ef2ea[_0x6f2a('0x4a')]];delete this['channels'][_0x1ef2ea[_0x6f2a('0x4a')]];}if(this['variables'][_0x1ef2ea[_0x6f2a('0x4a')]]){delete this[_0x6f2a('0x40')][_0x1ef2ea[_0x6f2a('0x4a')]];}}}catch(_0x53d006){logger[_0x6f2a('0x3e')](_0x6f2a('0xbf'),_0x1ef2ea[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x53d006,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0xce')]=function(_0x4801d3){try{if(this[_0x6f2a('0x62')](_0x4801d3)){logger[_0x6f2a('0x48')](_0x6f2a('0xcf'),_0x4801d3[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x4801d3,{'showHidden':![],'depth':null}));var _0x543be2;if(this[_0x6f2a('0xe')][_0x4801d3['transfereeuniqueid']]){_0x543be2=_[_0x6f2a('0x7c')](this['queueReports'][_0x4801d3[_0x6f2a('0xd0')]]);_0x543be2['transferexten']=_0x4801d3['secondtransfererexten'];_0x543be2[_0x6f2a('0xa2')]=_0x4801d3[_0x6f2a('0xd1')];_0x543be2[_0x6f2a('0x80')]=_0x6f2a('0xd2');_0x543be2['transfer']=!![];_0x543be2[_0x6f2a('0x9e')]=_0x6f2a('0xd3');if(this[_0x6f2a('0xe')][_0x4801d3[_0x6f2a('0xd1')]]){var _0x1d4b00=this['queueReports'][_0x4801d3[_0x6f2a('0xd1')]];this['queueReports'][_0x4801d3[_0x6f2a('0xd1')]]=this[_0x6f2a('0xe')][_0x4801d3['transfereeuniqueid']];this[_0x6f2a('0xe')][_0x4801d3[_0x6f2a('0xd0')]]=_0x1d4b00;var _0x5d39e9=_['last'](this['queueReports'][_0x4801d3[_0x6f2a('0xd0')]]);_0x5d39e9[_0x6f2a('0xd4')]=!![];}logger['info'](_0x6f2a('0xd5'),_0x4801d3[_0x6f2a('0x4a')],_0x543be2[_0x6f2a('0x4c')],_0x543be2[_0x6f2a('0x53')],_0x543be2['transferexten'],_0x543be2[_0x6f2a('0xa2')]);}else if(this[_0x6f2a('0xe')][_0x4801d3[_0x6f2a('0xd6')]]){_0x543be2=_[_0x6f2a('0x7c')](this[_0x6f2a('0xe')][_0x4801d3[_0x6f2a('0xd6')]]);_0x543be2['transferexten']=_0x4801d3['origtransfererexten'];_0x543be2[_0x6f2a('0xa2')]=_0x4801d3[_0x6f2a('0xd7')];_0x543be2[_0x6f2a('0x80')]=_0x6f2a('0xd2');_0x543be2[_0x6f2a('0x93')]=!![];_0x543be2[_0x6f2a('0x9e')]=_0x6f2a('0xd3');if(this[_0x6f2a('0xe')][_0x4801d3[_0x6f2a('0xd7')]]){var _0x1d4b00=this[_0x6f2a('0xe')][_0x4801d3[_0x6f2a('0xd7')]];this['queueReports'][_0x4801d3[_0x6f2a('0xd7')]]=this[_0x6f2a('0xe')][_0x4801d3[_0x6f2a('0xd6')]];this['queueReports'][_0x4801d3[_0x6f2a('0xd6')]]=_0x1d4b00;var _0x5d39e9=_['last'](this['queueReports'][_0x4801d3[_0x6f2a('0xd6')]]);_0x5d39e9[_0x6f2a('0xd4')]=!![];}logger['info'](_0x6f2a('0xd5'),_0x4801d3[_0x6f2a('0x4a')],_0x543be2[_0x6f2a('0x4c')],_0x543be2['type'],_0x543be2[_0x6f2a('0xa0')],_0x543be2['transferuniqueid']);}}}catch(_0x9ded13){logger[_0x6f2a('0x3e')]('[%s][voiceQueueReport][attendedtransfer]',_0x4801d3[_0x6f2a('0x4a')],util['inspect'](_0x9ded13,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x2f')]=function(_0x230be3){try{if(this[_0x6f2a('0x62')](_0x230be3)){logger['debug'](_0x6f2a('0xd8'),_0x230be3['uniqueid'],util[_0x6f2a('0x3f')](_0x230be3,{'showHidden':![],'depth':null}));if(this[_0x6f2a('0xe')][_0x230be3[_0x6f2a('0xd0')]]){var _0x12e830=_[_0x6f2a('0x7c')](this[_0x6f2a('0xe')][_0x230be3[_0x6f2a('0xd0')]]);_0x12e830[_0x6f2a('0x80')]=_0x6f2a('0xd9');_0x12e830[_0x6f2a('0x93')]=!![];_0x12e830['transfertype']=_0x6f2a('0xda');_0x12e830[_0x6f2a('0xa0')]=_0x230be3[_0x6f2a('0xdb')];_0x12e830['transferuniqueid']=_0x230be3[_0x6f2a('0xd0')];logger[_0x6f2a('0x6a')](_0x6f2a('0xdc'),_0x230be3[_0x6f2a('0x4a')],_0x12e830[_0x6f2a('0x4c')],_0x12e830[_0x6f2a('0x53')],_0x12e830[_0x6f2a('0xa0')],_0x12e830[_0x6f2a('0xa2')]);this[_0x6f2a('0x25')]({'event':'BlindTransfer','uniqueid':_0x230be3[_0x6f2a('0xd0')],'context':_0x230be3[_0x6f2a('0xdd')],'channel':_0x230be3[_0x6f2a('0xde')]});}}}catch(_0x5e4c4c){logger[_0x6f2a('0x3e')](_0x6f2a('0xd8'),_0x230be3['uniqueid'],util['inspect'](_0x5e4c4c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x2a')]=function(_0x63ae94){try{if(this[_0x6f2a('0x62')](_0x63ae94)){logger[_0x6f2a('0x48')](_0x6f2a('0xdf'),_0x63ae94[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x63ae94,{'showHidden':![],'depth':null}));if(this[_0x6f2a('0xe')][_0x63ae94[_0x6f2a('0x4a')]]){var _0x56cfa7=_['last'](this[_0x6f2a('0xe')][_0x63ae94['uniqueid']]);if(!_['isNil'](_0x56cfa7['queuecallerleaveAt'])){_0x56cfa7[_0x6f2a('0xe0')]=moment()[_0x6f2a('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');logger['info'](_0x6f2a('0xe1'),_0x63ae94[_0x6f2a('0x4a')],_0x56cfa7[_0x6f2a('0xe0')]);}}}}catch(_0x261f25){logger[_0x6f2a('0x3e')](_0x6f2a('0xdf'),_0x63ae94[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x261f25,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6f2a('0x42')][_0x6f2a('0x2c')]=function(_0x3b759f){try{if(this['isNotNull'](_0x3b759f)){logger['debug'](_0x6f2a('0xe2'),_0x3b759f[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x3b759f,{'showHidden':![],'depth':null}));if(this[_0x6f2a('0xe')][_0x3b759f[_0x6f2a('0x4a')]]){var _0xcc3c3e=_['last'](this['queueReports'][_0x3b759f[_0x6f2a('0x4a')]]);if(!_[_0x6f2a('0x3a')](_0xcc3c3e[_0x6f2a('0xe0')])){_0xcc3c3e[_0x6f2a('0xe3')]+=moment()[_0x6f2a('0xc6')](0x0)['diff'](_0xcc3c3e[_0x6f2a('0xe0')],_0x6f2a('0x9c'));logger[_0x6f2a('0x6a')](_0x6f2a('0xe4'),_0x3b759f[_0x6f2a('0x4a')],_0xcc3c3e[_0x6f2a('0xe3')]);delete _0xcc3c3e[_0x6f2a('0xe0')];}}}}catch(_0x58668b){logger[_0x6f2a('0x3e')](_0x6f2a('0xe2'),_0x3b759f[_0x6f2a('0x4a')],util[_0x6f2a('0x3f')](_0x58668b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6f2a('0x42')]['syncNewExten']=function(_0x2e4528){try{if(this[_0x6f2a('0x62')](_0x2e4528)){logger[_0x6f2a('0x48')](_0x6f2a('0xe5'),_0x2e4528['uniqueid'],util[_0x6f2a('0x3f')](_0x2e4528,{'showHidden':![],'depth':null}));if(_0x2e4528[_0x6f2a('0xe6')][_0x6f2a('0x98')]()===_0x6f2a('0xe7')){_0x2e4528[_0x6f2a('0xe8')]=_0x2e4528[_0x6f2a('0xe9')]&&_0x2e4528[_0x6f2a('0xe9')][_0x6f2a('0x97')](_0x6f2a('0xea'))?_0x2e4528[_0x6f2a('0xe9')]:(_0x2e4528[_0x6f2a('0xe9')]||_0x2e4528[_0x6f2a('0xe8')])[_0x6f2a('0x98')]();if(_['startsWith'](_0x2e4528[_0x6f2a('0xe8')]['toLowerCase'](),_0x6f2a('0xeb'))){logger[_0x6f2a('0x6a')](_0x6f2a('0xec'),_0x2e4528[_0x6f2a('0x4a')],_0x2e4528[_0x6f2a('0xe6')],_0x2e4528['applicationdata']);if(_[_0x6f2a('0x63')](this[_0x6f2a('0x10')][_0x2e4528['uniqueid']]))this[_0x6f2a('0x10')][_0x2e4528[_0x6f2a('0x4a')]]={};var _0x1b90b7=_0x2e4528[_0x6f2a('0xe8')]['split']('=');var _0x4af11d=_0x1b90b7[0x0]['toLowerCase']()[_0x6f2a('0xed')](/cdr\((.*)\)/);if(_0x4af11d)this[_0x6f2a('0x10')][_0x2e4528[_0x6f2a('0x4a')]][_0x4af11d[0x1]]=_0x1b90b7[0x1];}}}}catch(_0x304e83){logger['error'](_0x6f2a('0xee'),_0x2e4528['uniqueid'],util[_0x6f2a('0x3f')](_0x304e83,{'showHidden':![],'depth':null}));}};module[_0x6f2a('0xef')]=VoiceQueueReport;
\ No newline at end of file
index ea3c93d..3b86ed1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21c1=['../client','createHistory','campaign','CreateReportAgentPreview'];(function(_0x2d4269,_0x13625d){var _0x27ee8d=function(_0x54738a){while(--_0x54738a){_0x2d4269['push'](_0x2d4269['shift']());}};_0x27ee8d(++_0x13625d);}(_0x21c1,0x78));var _0x121c=function(_0x5897f0,_0x4b93b4){_0x5897f0=_0x5897f0-0x0;var _0x155fb1=_0x21c1[_0x5897f0];return _0x155fb1;};'use strict';var client=require(_0x121c('0x0'));exports[_0x121c('0x1')]=function(_0x63285f){return function(){_0x63285f[_0x121c('0x2')]=_0x63285f['queue'];return client['Request'](_0x121c('0x3'),{'body':_0x63285f,'log':_0x121c('0x3')});};};
\ No newline at end of file
+var _0xba5b=['CreateReportAgentPreview','../client','createHistory','campaign','queue','Request'];(function(_0x46acf1,_0xbacac0){var _0x5196dc=function(_0x2ba269){while(--_0x2ba269){_0x46acf1['push'](_0x46acf1['shift']());}};_0x5196dc(++_0xbacac0);}(_0xba5b,0x121));var _0xbba5=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xba5b[_0x21a9d9];return _0x46adce;};'use strict';var client=require(_0xbba5('0x0'));exports[_0xbba5('0x1')]=function(_0x331807){return function(){_0x331807[_0xbba5('0x2')]=_0x331807[_0xbba5('0x3')];return client[_0xbba5('0x4')]('CreateReportAgentPreview',{'body':_0x331807,'log':_0xbba5('0x5')});};};
\ No newline at end of file
index da08d95..a6ac9da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3d3=['Request'];(function(_0x3d61c6,_0x4571e6){var _0x47e0df=function(_0x25adfd){while(--_0x25adfd){_0x3d61c6['push'](_0x3d61c6['shift']());}};_0x47e0df(++_0x4571e6);}(_0xd3d3,0x19a));var _0x3d3d=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xd3d3[_0x2aa0e7];return _0x1472c0;};'use strict';var client=require('../client');exports['create']=function(_0x12ce2a){return client[_0x3d3d('0x0')]('CreateAttachment',{'body':_0x12ce2a,'log':'CreateAttachment'});};
\ No newline at end of file
+var _0x753e=['CreateAttachment','../client','create','Request'];(function(_0x29d27a,_0x1829f1){var _0x4f4bdc=function(_0x599391){while(--_0x599391){_0x29d27a['push'](_0x29d27a['shift']());}};_0x4f4bdc(++_0x1829f1);}(_0x753e,0x99));var _0xe753=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x753e[_0x24f31b];return _0x488401;};'use strict';var client=require(_0xe753('0x0'));exports[_0xe753('0x1')]=function(_0x44a9a7){return client[_0xe753('0x2')](_0xe753('0x3'),{'body':_0x44a9a7,'log':_0xe753('0x3')});};
\ No newline at end of file
index 73caed4..b8489ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x55c1b6,_0x3bdf78){var _0x3f0a58=function(_0x287562){while(--_0x287562){_0x55c1b6['push'](_0x55c1b6['shift']());}};_0x3f0a58(++_0x3bdf78);}(_0x1261,0x144));var _0x1126=function(_0x55677b,_0x3e5655){_0x55677b=_0x55677b-0x0;var _0x104b88=_0x1261[_0x55677b];return _0x104b88;};'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
+var _0x2ef3=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','active','TrunkBackup','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0x2ef3,0xba));var _0x32ef=function(_0x50a21a,_0xae53e7){_0x50a21a=_0x50a21a-0x0;var _0x441a8e=_0x2ef3[_0x50a21a];return _0x441a8e;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(){return function(){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x32ef('0x4'),_0x32ef('0x5'),'active',_0x32ef('0x6'),_0x32ef('0x7'),'dialOriginateCallerIdNumber',_0x32ef('0x8'),_0x32ef('0x9'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'dialAMDActive',_0x32ef('0x18'),'dialAMDGreeting',_0x32ef('0x19'),'dialAMDTotalAnalysisTime',_0x32ef('0x1a'),_0x32ef('0x1b'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x32ef('0x1c'),'dialOrderByScheduledAt',_0x32ef('0x1d'),_0x32ef('0x1e'),_0x32ef('0x1f')],'include':[{'model':_0x32ef('0x20'),'as':'Trunk','attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x20'),'as':_0x32ef('0x22'),'attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x23'),'as':_0x32ef('0x23'),'attributes':['id','name'],'include':[{'model':_0x32ef('0x23'),'as':_0x32ef('0x24'),'attributes':['id','name',_0x32ef('0x25')]}]},{'model':_0x32ef('0x26'),'as':_0x32ef('0x26'),'attributes':['id',_0x32ef('0x4')]}]},'log':_0x32ef('0x27')});};};
\ No newline at end of file
index 270ecb0..7b91d94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1c3=['CreateCmContact','getContacts','GetCmContact','createContact','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf1c3,0x1c0));var _0x3f1c=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0xf1c3[_0x5538d5];return _0x323b1a;};'use strict';var client=require('../client');exports[_0x3f1c('0x0')]=function(_0x30f218){return function(){return client[_0x3f1c('0x1')]('CreateCmContact',{'body':_0x30f218,'log':_0x3f1c('0x2')});};};exports[_0x3f1c('0x3')]=function(_0x437b01){return function(){return client['Request'](_0x3f1c('0x4'),{'options':_0x437b01,'log':_0x3f1c('0x4')});};};
\ No newline at end of file
+var _0x466d=['GetCmContact','../client','createContact','Request','CreateCmContact','getContacts'];(function(_0xd93b26,_0x12bbf2){var _0x25f668=function(_0x133ff7){while(--_0x133ff7){_0xd93b26['push'](_0xd93b26['shift']());}};_0x25f668(++_0x12bbf2);}(_0x466d,0x19f));var _0xd466=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x466d[_0x11946c];return _0x383935;};'use strict';var client=require(_0xd466('0x0'));exports[_0xd466('0x1')]=function(_0x350999){return function(){return client[_0xd466('0x2')](_0xd466('0x3'),{'body':_0x350999,'log':'CreateCmContact'});};};exports[_0xd466('0x4')]=function(_0x374fbc){return function(){return client[_0xd466('0x2')](_0xd466('0x5'),{'options':_0x374fbc,'log':_0xd466('0x5')});};};
\ No newline at end of file
index 581e526..735b6c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4962=['MoveContactManagedDialer','ListId','countReScheduled','getContactPreview','GetCmHopperPreview','name','VoiceQueue','Queue','getContactRecallMe','GetContactRecallMe','User','voicePause','../client','moment','lodash','getContacts','Request','GetCmHopper','CmContact','Contact','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','priority','DESC','ASC','getContactDialerIvr','scheduledat','campaign','queue'];(function(_0xbcd7b9,_0x144282){var _0x48f8b4=function(_0x5040c3){while(--_0x5040c3){_0xbcd7b9['push'](_0xbcd7b9['shift']());}};_0x48f8b4(++_0x144282);}(_0x4962,0x81));var _0x2496=function(_0x4aedc6,_0x2ab56a){_0x4aedc6=_0x4aedc6-0x0;var _0x48ff9d=_0x4962[_0x4aedc6];return _0x48ff9d;};'use strict';var client=require(_0x2496('0x0'));var moment=require(_0x2496('0x1'));var _=require(_0x2496('0x2'));exports[_0x2496('0x3')]=function(_0x2d77e0,_0x72337c){return function(){return client[_0x2496('0x4')](_0x2496('0x5'),{'options':{'where':{'VoiceQueueId':_0x2d77e0},'include':[{'model':_0x2496('0x6'),'as':_0x2496('0x7')}],'limit':_0x72337c,'raw':![]},'log':'getCmHopper'});};};exports[_0x2496('0x8')]=function(_0x3a56fe,_0x136b26,_0x40581a){return function(){return client[_0x2496('0x4')](_0x2496('0x9'),{'body':_0x3a56fe,'options':{'where':{'VoiceQueueId':_0x136b26,'scheduledat':{'$lte':moment()[_0x2496('0xa')](_0x2496('0xb'))}},'limit':_0x40581a},'log':'UpdateCmHopper'});};};exports[_0x2496('0xc')]=function(_0x494a34){return function(){return client['Request'](_0x2496('0x9'),{'body':_0x494a34,'options':{'where':{'ContactId':_0x494a34[_0x2496('0xd')],'ListId':_0x494a34['ListId'],'VoiceQueueId':_0x494a34[_0x2496('0xe')],'CampaignId':_0x494a34[_0x2496('0xf')]}},'log':_0x2496('0xc')});};};exports[_0x2496('0x10')]=function(_0x3de14b,_0x1c50df,_0x2a0376){return function(){return client['Request'](_0x2496('0x11'),{'options':{'where':{'VoiceQueueId':_0x3de14b,'ListId':_0x1c50df,'ContactId':_0x2a0376}},'log':'DestroyCmHopper'});};};exports[_0x2496('0x12')]=function(_0x4e1de5,_0xbae982,_0x4362a3,_0xb2c0a3){return function(){return client['Request'](_0x2496('0x13'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x4e1de5,'active':![],'scheduledat':{'$lte':moment()[_0x2496('0xa')](_0x2496('0xb'))},'$or':[{'UserId':null},{'UserId':{'$in':_0xbae982}}]},'order':[[_0x2496('0x14'),_0x2496('0x15')],['scheduledat',_0xb2c0a3],['id',_0x2496('0x16')]],'raw':!![],'limit':_0x4362a3},'log':_0x2496('0x13')});};};exports[_0x2496('0x17')]=function(_0x53b680,_0x5d2315,_0x28862f){return function(){return client[_0x2496('0x4')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x53b680,'active':![],'scheduledat':{'$lte':moment()[_0x2496('0xa')](_0x2496('0xb'))}},'include':[{'model':_0x2496('0x6'),'as':_0x2496('0x7')}],'order':[['priority','DESC'],[_0x2496('0x18'),_0x28862f],['id',_0x2496('0x16')]],'raw':!![],'limit':_0x5d2315},'log':'GetContactDialerIvr'});};};exports['moveContactManagedDialer']=function(_0x326e1f,_0x429c06){return function(){_0x326e1f[_0x2496('0x19')]=_0x326e1f[_0x2496('0x1a')];return client[_0x2496('0x4')](_0x2496('0x1b'),{'body':_0x326e1f,'options':{'where':{'ContactId':_0x326e1f[_0x2496('0xd')],'ListId':_0x326e1f[_0x2496('0x1c')],'VoiceQueueId':_0x326e1f[_0x2496('0xe')],'CampaignId':_0x326e1f['CampaignId'],'active':_0x429c06?undefined:!![]}},'log':_0x2496('0x1b')});};};exports['countReScheduled']=function(_0x5705a7){return function(){return client['Request']('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x5705a7['id']?_0x5705a7['id']||null:null}},'log':_0x2496('0x1d')});};};exports[_0x2496('0x1e')]=function(_0x5c83bb){return function(){return client['Request'](_0x2496('0x1f'),{'options':{'where':{'id':_0x5c83bb},'include':[{'model':'CmContact','as':_0x2496('0x7')},{'model':'User','as':'Agent','attributes':['id',_0x2496('0x20')]},{'model':_0x2496('0x21'),'as':_0x2496('0x22'),'attributes':['id','name']}],'raw':!![]},'log':'getCmHopper'});};};exports['unlockContact']=function(_0x4a40f8,_0x5cdd0c,_0xe27fe8){return function(){return client[_0x2496('0x4')]('UpdateCmHopper',{'body':_0x4a40f8,'options':{'where':{'id':_0x5cdd0c},'limit':_0xe27fe8},'log':_0x2496('0x9')});};};exports[_0x2496('0x23')]=function(_0x45a29f,_0x5a1057){return function(){return client[_0x2496('0x4')](_0x2496('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x45a29f,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format'](_0x2496('0xb'))},'UserId':{'$in':_0x5a1057}},'order':[[_0x2496('0x14'),_0x2496('0x15')],[_0x2496('0x18'),_0x2496('0x15')],['id',_0x2496('0x16')]],'include':[{'model':_0x2496('0x6'),'as':_0x2496('0x7')},{'model':_0x2496('0x25'),'as':'Agent','attributes':['id','name',_0x2496('0x26')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0x2496('0x13')});};};
\ No newline at end of file
+var _0x93ff=['campaign','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name','VoiceQueue','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','voicePause','db.CmHopper.UserId','../client','moment','getContacts','Request','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','DestroyCmHopper','GetContactDialer','priority','DESC','scheduledat','getContactDialerIvr','ASC','moveContactManagedDialer'];(function(_0x35335f,_0x4861ff){var _0x4a9103=function(_0x23980e){while(--_0x23980e){_0x35335f['push'](_0x35335f['shift']());}};_0x4a9103(++_0x4861ff);}(_0x93ff,0x1ab));var _0xf93f=function(_0x517456,_0x18c8d2){_0x517456=_0x517456-0x0;var _0x239445=_0x93ff[_0x517456];return _0x239445;};'use strict';var client=require(_0xf93f('0x0'));var moment=require(_0xf93f('0x1'));var _=require('lodash');exports[_0xf93f('0x2')]=function(_0x21de48,_0x32899e){return function(){return client[_0xf93f('0x3')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x21de48},'include':[{'model':_0xf93f('0x4'),'as':_0xf93f('0x5')}],'limit':_0x32899e,'raw':![]},'log':_0xf93f('0x6')});};};exports[_0xf93f('0x7')]=function(_0x3406d7,_0x5e50b4,_0x4c2a66){return function(){return client[_0xf93f('0x3')](_0xf93f('0x8'),{'body':_0x3406d7,'options':{'where':{'VoiceQueueId':_0x5e50b4,'scheduledat':{'$lte':moment()[_0xf93f('0x9')](_0xf93f('0xa'))}},'limit':_0x4c2a66},'log':'UpdateCmHopper'});};};exports[_0xf93f('0xb')]=function(_0x26d33c){return function(){return client[_0xf93f('0x3')](_0xf93f('0x8'),{'body':_0x26d33c,'options':{'where':{'ContactId':_0x26d33c[_0xf93f('0xc')],'ListId':_0x26d33c[_0xf93f('0xd')],'VoiceQueueId':_0x26d33c[_0xf93f('0xe')],'CampaignId':_0x26d33c[_0xf93f('0xf')]}},'log':_0xf93f('0xb')});};};exports['destroyContact']=function(_0x5f4c84,_0x52cab8,_0x1b827d){return function(){return client[_0xf93f('0x3')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x5f4c84,'ListId':_0x52cab8,'ContactId':_0x1b827d}},'log':_0xf93f('0x10')});};};exports['getContactDialer']=function(_0x146432,_0x5bb1ce,_0x2b101a,_0x3657b2){return function(){return client[_0xf93f('0x3')](_0xf93f('0x11'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x146432,'active':![],'scheduledat':{'$lte':moment()['format'](_0xf93f('0xa'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x5bb1ce}}]},'order':[[_0xf93f('0x12'),_0xf93f('0x13')],[_0xf93f('0x14'),_0x3657b2],['id','ASC']],'raw':!![],'limit':_0x2b101a},'log':_0xf93f('0x11')});};};exports[_0xf93f('0x15')]=function(_0x45f1e4,_0x3ec458,_0x22afd3){return function(){return client[_0xf93f('0x3')](_0xf93f('0x11'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x45f1e4,'active':![],'scheduledat':{'$lte':moment()[_0xf93f('0x9')](_0xf93f('0xa'))}},'include':[{'model':_0xf93f('0x4'),'as':'Contact'}],'order':[[_0xf93f('0x12'),_0xf93f('0x13')],[_0xf93f('0x14'),_0x22afd3],['id',_0xf93f('0x16')]],'raw':!![],'limit':_0x3ec458},'log':'GetContactDialerIvr'});};};exports[_0xf93f('0x17')]=function(_0xde9d0,_0x5f1d93){return function(){_0xde9d0[_0xf93f('0x18')]=_0xde9d0[_0xf93f('0x19')];return client['Request'](_0xf93f('0x1a'),{'body':_0xde9d0,'options':{'where':{'ContactId':_0xde9d0['ContactId'],'ListId':_0xde9d0[_0xf93f('0xd')],'VoiceQueueId':_0xde9d0[_0xf93f('0xe')],'CampaignId':_0xde9d0[_0xf93f('0xf')],'active':_0x5f1d93?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports[_0xf93f('0x1b')]=function(_0x5021fb){return function(){return client['Request'](_0xf93f('0x1c'),{'options':{'where':{'VoiceQueueId':_0x5021fb['id']?_0x5021fb['id']||null:null}},'log':'countReScheduled'});};};exports[_0xf93f('0x1d')]=function(_0x4deba8){return function(){return client['Request'](_0xf93f('0x1e'),{'options':{'where':{'id':_0x4deba8},'include':[{'model':'CmContact','as':'Contact'},{'model':_0xf93f('0x1f'),'as':_0xf93f('0x20'),'attributes':['id',_0xf93f('0x21')]},{'model':_0xf93f('0x22'),'as':_0xf93f('0x23'),'attributes':['id',_0xf93f('0x21')]}],'raw':!![]},'log':_0xf93f('0x6')});};};exports[_0xf93f('0x24')]=function(_0x3aa21f,_0x23f01c,_0x3e946c){return function(){return client['Request'](_0xf93f('0x8'),{'body':_0x3aa21f,'options':{'where':{'id':_0x23f01c},'limit':_0x3e946c},'log':_0xf93f('0x8')});};};exports[_0xf93f('0x25')]=function(_0x37e383,_0x1b3a0d){return function(){return client[_0xf93f('0x3')](_0xf93f('0x26'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x37e383,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xf93f('0x9')](_0xf93f('0xa'))},'UserId':{'$in':_0x1b3a0d}},'order':[[_0xf93f('0x12'),'DESC'],['scheduledat',_0xf93f('0x13')],['id',_0xf93f('0x16')]],'include':[{'model':'CmContact','as':_0xf93f('0x5')},{'model':_0xf93f('0x1f'),'as':_0xf93f('0x20'),'attributes':['id',_0xf93f('0x21'),_0xf93f('0x27')]}],'group':_0xf93f('0x28'),'raw':!![]},'log':_0xf93f('0x11')});};};
\ No newline at end of file
index be61d6c..529617f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea28=['phone','checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','Request','GetCmHopperBlack','VoiceQueueId','Contact'];(function(_0x1f0f91,_0x3231ae){var _0x305a39=function(_0x5f466e){while(--_0x5f466e){_0x1f0f91['push'](_0x1f0f91['shift']());}};_0x305a39(++_0x3231ae);}(_0xea28,0x13a));var _0x8ea2=function(_0x46812a,_0x3689dc){_0x46812a=_0x46812a-0x0;var _0x2f8b1e=_0xea28[_0x46812a];return _0x2f8b1e;};'use strict';var client=require(_0x8ea2('0x0'));exports[_0x8ea2('0x1')]=function(_0x389e8f){return function(){return client[_0x8ea2('0x2')](_0x8ea2('0x3'),{'options':{'where':{'VoiceQueueId':_0x389e8f[_0x8ea2('0x4')],'phone':_0x389e8f[_0x8ea2('0x5')][_0x8ea2('0x6')]},'raw':![]},'log':'GetCmHopperBlack'});};};exports[_0x8ea2('0x7')]=function(_0x23aaf1){return function(){return client[_0x8ea2('0x2')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x23aaf1[_0x8ea2('0x8')],'phone':_0x23aaf1[_0x8ea2('0x5')][_0x8ea2('0x6')]},'raw':![]},'log':_0x8ea2('0x9')});};};
\ No newline at end of file
+var _0x5c00=['checkIsBlackListIvr','Request','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','GetCmHopperBlack','Contact','phone'];(function(_0x2bca41,_0x58b996){var _0xe5f38=function(_0x3b5d1f){while(--_0x3b5d1f){_0x2bca41['push'](_0x2bca41['shift']());}};_0xe5f38(++_0x58b996);}(_0x5c00,0x17e));var _0x05c0=function(_0xf351f3,_0x4a90f4){_0xf351f3=_0xf351f3-0x0;var _0x21d574=_0x5c00[_0xf351f3];return _0x21d574;};'use strict';var client=require(_0x05c0('0x0'));exports[_0x05c0('0x1')]=function(_0x1c3b79){return function(){return client['Request'](_0x05c0('0x2'),{'options':{'where':{'VoiceQueueId':_0x1c3b79['VoiceQueueId'],'phone':_0x1c3b79[_0x05c0('0x3')][_0x05c0('0x4')]},'raw':![]},'log':_0x05c0('0x2')});};};exports[_0x05c0('0x5')]=function(_0x565efc){return function(){return client[_0x05c0('0x6')](_0x05c0('0x2'),{'options':{'where':{'CampaignId':_0x565efc[_0x05c0('0x7')],'phone':_0x565efc[_0x05c0('0x3')]['phone']},'raw':![]},'log':_0x05c0('0x8')});};};
\ No newline at end of file
index ea0c0e9..85ffbbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80ca=['createContact','campaign','queue','Request','CreateCmHopperFinal'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0x80ca,0x14f));var _0xa80c=function(_0x3e738d,_0x2c71dd){_0x3e738d=_0x3e738d-0x0;var _0xa4840a=_0x80ca[_0x3e738d];return _0xa4840a;};'use strict';var client=require('../client');exports[_0xa80c('0x0')]=function(_0x51e8f5){return function(){_0x51e8f5[_0xa80c('0x1')]=_0x51e8f5[_0xa80c('0x2')];return client[_0xa80c('0x3')](_0xa80c('0x4'),{'body':_0x51e8f5,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
+var _0xc424=['Request','CreateCmHopperFinal','../client','createContact','campaign'];(function(_0x74ffd2,_0x5558fb){var _0x886b4b=function(_0x48ed00){while(--_0x48ed00){_0x74ffd2['push'](_0x74ffd2['shift']());}};_0x886b4b(++_0x5558fb);}(_0xc424,0x115));var _0x4c42=function(_0x3c2cd1,_0xfa42cc){_0x3c2cd1=_0x3c2cd1-0x0;var _0x2c9a1e=_0xc424[_0x3c2cd1];return _0x2c9a1e;};'use strict';var client=require(_0x4c42('0x0'));exports[_0x4c42('0x1')]=function(_0x316382){return function(){_0x316382[_0x4c42('0x2')]=_0x316382['queue'];return client[_0x4c42('0x3')](_0x4c42('0x4'),{'body':_0x316382,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
index 2c11ce2..3941b0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cc4=['format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','subtract','minutes'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x0cc4,0x1ea));var _0x40cc=function(_0x2d00d4,_0x3e7d3d){_0x2d00d4=_0x2d00d4-0x0;var _0x45f2b6=_0x0cc4[_0x2d00d4];return _0x45f2b6;};'use strict';var client=require('../client');var moment=require(_0x40cc('0x0'));exports[_0x40cc('0x1')]=function(_0x42a0b6){return function(){_0x42a0b6[_0x40cc('0x2')]=_0x42a0b6[_0x40cc('0x3')];return client[_0x40cc('0x4')]('CreateCmHopperHistory',{'body':_0x42a0b6,'log':_0x40cc('0x5')});};};exports[_0x40cc('0x6')]=function(_0x5669b3){return function(){return client[_0x40cc('0x4')](_0x40cc('0x7'),{'options':{'where':{'endtime':{'$between':[moment()[_0x40cc('0x8')](_0x5669b3,_0x40cc('0x9'))[_0x40cc('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x40cc('0xa')](_0x40cc('0xb'))]}},'raw':![]},'log':_0x40cc('0xc')});};};exports['getVoiceQueueHopperHistory']=function(_0x1d59d0){return function(){return client[_0x40cc('0x4')](_0x40cc('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x40cc('0xe')](_0x40cc('0xf'))[_0x40cc('0xa')](_0x40cc('0xb')),moment()[_0x40cc('0x10')](_0x40cc('0xf'))[_0x40cc('0xa')](_0x40cc('0xb'))]},'campaigntype':_0x40cc('0x3')},'raw':![]},'log':_0x40cc('0xd')});};};exports[_0x40cc('0x11')]=function(_0x3fb21c){return function(){return client['Request'](_0x40cc('0x12'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x40cc('0xe')]('day')['format'](_0x40cc('0xb')),moment()[_0x40cc('0x10')](_0x40cc('0xf'))[_0x40cc('0xa')](_0x40cc('0xb'))]},'campaigntype':_0x40cc('0x13')},'raw':![]},'log':_0x40cc('0x12')});};};
\ No newline at end of file
+var _0x755a=['subtract','YYYY-MM-DD\x20HH:mm:ss','format','GetCmHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','../client','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0x755a,0xf9));var _0xa755=function(_0x1028da,_0x156979){_0x1028da=_0x1028da-0x0;var _0x38ec71=_0x755a[_0x1028da];return _0x38ec71;};'use strict';var client=require(_0xa755('0x0'));var moment=require('moment');exports['createHistory']=function(_0x52d7cc){return function(){_0x52d7cc[_0xa755('0x1')]=_0x52d7cc[_0xa755('0x2')];return client[_0xa755('0x3')](_0xa755('0x4'),{'body':_0x52d7cc,'log':'CreateCmHopperHistory'});};};exports[_0xa755('0x5')]=function(_0x4c1694){return function(){return client['Request']('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0xa755('0x6')](_0x4c1694,'minutes')['format'](_0xa755('0x7')),moment()[_0xa755('0x8')](_0xa755('0x7'))]}},'raw':![]},'log':_0xa755('0x9')});};};exports['getVoiceQueueHopperHistory']=function(_0x1dffee){return function(){return client[_0xa755('0x3')](_0xa755('0xa'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xa755('0xb')](_0xa755('0xc'))[_0xa755('0x8')](_0xa755('0x7')),moment()[_0xa755('0xd')](_0xa755('0xc'))[_0xa755('0x8')](_0xa755('0x7'))]},'campaigntype':_0xa755('0x2')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports[_0xa755('0xe')]=function(_0x24fe30){return function(){return client[_0xa755('0x3')](_0xa755('0xf'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xa755('0xb')](_0xa755('0xc'))[_0xa755('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xa755('0xc'))[_0xa755('0x8')](_0xa755('0x7'))]},'campaigntype':_0xa755('0x10')},'raw':![]},'log':_0xa755('0xf')});};};
\ No newline at end of file
index 3310c10..f556b08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa702=['Request','GetFaxAccount','name','ecm','minrate','modem','gateway','tech','TrunkId','key','Trunk','callerid','active','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa702,0x1ae));var _0x2a70=function(_0xdde4ee,_0x6508dc){_0xdde4ee=_0xdde4ee-0x0;var _0x994da=_0xa702[_0xdde4ee];return _0x994da;};'use strict';var client=require(_0x2a70('0x0'));exports[_0x2a70('0x1')]=function(){return function(){return client[_0x2a70('0x2')](_0x2a70('0x3'),{'options':{'raw':![],'attributes':['id',_0x2a70('0x4'),'description',_0x2a70('0x5'),'headerinfo','localstationid',_0x2a70('0x6'),'maxrate',_0x2a70('0x7'),_0x2a70('0x8'),'faxdetect','t38timeout',_0x2a70('0x9'),_0x2a70('0xa'),'ListId',_0x2a70('0xb')],'include':[{'model':'Trunk','as':_0x2a70('0xc'),'attributes':['id',_0x2a70('0x4'),_0x2a70('0xd'),_0x2a70('0xe')]}]},'log':_0x2a70('0xf')});};};exports[_0x2a70('0x10')]=function(_0x2fcb36,_0x109086){return client[_0x2a70('0x2')](_0x2a70('0x11'),{'account':{'id':_0x2fcb36},'body':_0x109086,'log':_0x2a70('0x11')});};
\ No newline at end of file
+var _0xf3a8=['TrunkId','ListId','key','Trunk','active','getFaxAccount','notify','NotifyFaxAccount','getFaxAccounts','Request','name','headerinfo','minrate','modem','gateway','faxdetect','t38timeout','tech'];(function(_0x3695be,_0x166ede){var _0x558e89=function(_0x1a3ecb){while(--_0x1a3ecb){_0x3695be['push'](_0x3695be['shift']());}};_0x558e89(++_0x166ede);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x49ebbb,_0x396f93){_0x49ebbb=_0x49ebbb-0x0;var _0x458257=_0xf3a8[_0x49ebbb];return _0x458257;};'use strict';var client=require('../client');exports[_0x8f3a('0x0')]=function(){return function(){return client[_0x8f3a('0x1')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id',_0x8f3a('0x2'),'description','ecm',_0x8f3a('0x3'),'localstationid',_0x8f3a('0x4'),'maxrate',_0x8f3a('0x5'),_0x8f3a('0x6'),_0x8f3a('0x7'),_0x8f3a('0x8'),_0x8f3a('0x9'),_0x8f3a('0xa'),_0x8f3a('0xb'),_0x8f3a('0xc')],'include':[{'model':_0x8f3a('0xd'),'as':'Trunk','attributes':['id',_0x8f3a('0x2'),'callerid',_0x8f3a('0xe')]}]},'log':_0x8f3a('0xf')});};};exports[_0x8f3a('0x10')]=function(_0x27e224,_0x1d3385){return client['Request'](_0x8f3a('0x11'),{'account':{'id':_0x27e224},'body':_0x1d3385,'log':_0x8f3a('0x11')});};
\ No newline at end of file
index fa88b35..ac3a36b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c7e=['../client','update','Request','UpdateFaxMessage'];(function(_0x27b423,_0x312583){var _0x5c11b8=function(_0x22a3b9){while(--_0x22a3b9){_0x27b423['push'](_0x27b423['shift']());}};_0x5c11b8(++_0x312583);}(_0x7c7e,0x80));var _0xe7c7=function(_0x2a4c87,_0x6a425e){_0x2a4c87=_0x2a4c87-0x0;var _0x2933f2=_0x7c7e[_0x2a4c87];return _0x2933f2;};'use strict';var client=require(_0xe7c7('0x0'));exports[_0xe7c7('0x1')]=function(_0x18033f,_0x1c3ee2){return client[_0xe7c7('0x2')](_0xe7c7('0x3'),{'body':_0x1c3ee2,'options':{'where':{'AttachmentId':_0x18033f}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
+var _0x6c33=['UpdateFaxMessage','update','Request'];(function(_0x4f3c39,_0x14567e){var _0x122d49=function(_0x2067af){while(--_0x2067af){_0x4f3c39['push'](_0x4f3c39['shift']());}};_0x122d49(++_0x14567e);}(_0x6c33,0x1ab));var _0x36c3=function(_0x567e55,_0x4968d9){_0x567e55=_0x567e55-0x0;var _0x316288=_0x6c33[_0x567e55];return _0x316288;};'use strict';var client=require('../client');exports[_0x36c3('0x0')]=function(_0x315c3e,_0x19cbf9){return client[_0x36c3('0x1')]('UpdateFaxMessage',{'body':_0x19cbf9,'options':{'where':{'AttachmentId':_0x315c3e}},'log':_0x36c3('0x2')});};
\ No newline at end of file
index f24b822..e2df464 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa172=['DeskField','Subjects','content','variableName','Variable','Descriptions','Fields','nameField','Tag','../../client','getDeskAccounts','Request','GetDeskAccount','name','description','username','password','remoteUri','type','serverUrl','Configurations'];(function(_0x2aee2f,_0xad9887){var _0x19337f=function(_0x2e62d){while(--_0x2e62d){_0x2aee2f['push'](_0x2aee2f['shift']());}};_0x19337f(++_0xad9887);}(_0xa172,0x1ec));var _0x2a17=function(_0x3c91b8,_0x4fa664){_0x3c91b8=_0x3c91b8-0x0;var _0x575fe7=_0xa172[_0x3c91b8];return _0x575fe7;};'use strict';var client=require(_0x2a17('0x0'));exports[_0x2a17('0x1')]=function(){return function(_0x3bb7e6){return client[_0x2a17('0x2')](_0x2a17('0x3'),{'options':{'raw':![],'attributes':['id',_0x2a17('0x4'),_0x2a17('0x5'),_0x2a17('0x6'),_0x2a17('0x7'),_0x2a17('0x8'),'authType',_0x2a17('0x9'),_0x2a17('0xa')],'include':[{'model':'DeskConfiguration','as':_0x2a17('0xb'),'attributes':['id',_0x2a17('0x4')],'include':[{'model':_0x2a17('0xc'),'as':_0x2a17('0xd'),'attributes':['id','type',_0x2a17('0xe'),_0x2a17('0xf')],'include':[{'model':_0x2a17('0x10'),'as':_0x2a17('0x10'),'attributes':['id',_0x2a17('0x4')]}]},{'model':_0x2a17('0xc'),'as':_0x2a17('0x11'),'attributes':['id',_0x2a17('0x9'),'content','key','keyType','keyContent',_0x2a17('0xf')],'include':[{'model':_0x2a17('0x10'),'as':_0x2a17('0x10'),'attributes':['id',_0x2a17('0x4')]}]},{'model':_0x2a17('0xc'),'as':_0x2a17('0x12'),'attributes':['id','type',_0x2a17('0xe'),'idField',_0x2a17('0x13'),'customField',_0x2a17('0xf')],'include':[{'model':'Variable','as':_0x2a17('0x10'),'attributes':['id',_0x2a17('0x4')]}]},{'model':_0x2a17('0x14'),'as':'Tags','attributes':['id','name']}]}]},'log':_0x2a17('0x3')});};};
\ No newline at end of file
+var _0xb2fa=['content','variableName','Variable','Descriptions','key','keyContent','Fields','idField','nameField','customField','Tag','Tags','../../client','getDeskAccounts','Request','GetDeskAccount','description','password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','name','DeskField','Subjects'];(function(_0x53d07a,_0x177c74){var _0x4a486b=function(_0x57acee){while(--_0x57acee){_0x53d07a['push'](_0x53d07a['shift']());}};_0x4a486b(++_0x177c74);}(_0xb2fa,0xff));var _0xab2f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb2fa[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xab2f('0x0'));exports[_0xab2f('0x1')]=function(){return function(_0x2992f4){return client[_0xab2f('0x2')](_0xab2f('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xab2f('0x4'),'username',_0xab2f('0x5'),_0xab2f('0x6'),_0xab2f('0x7'),_0xab2f('0x8'),_0xab2f('0x9')],'include':[{'model':_0xab2f('0xa'),'as':_0xab2f('0xb'),'attributes':['id',_0xab2f('0xc')],'include':[{'model':_0xab2f('0xd'),'as':_0xab2f('0xe'),'attributes':['id','type',_0xab2f('0xf'),_0xab2f('0x10')],'include':[{'model':_0xab2f('0x11'),'as':_0xab2f('0x11'),'attributes':['id',_0xab2f('0xc')]}]},{'model':_0xab2f('0xd'),'as':_0xab2f('0x12'),'attributes':['id',_0xab2f('0x8'),_0xab2f('0xf'),_0xab2f('0x13'),'keyType',_0xab2f('0x14'),_0xab2f('0x10')],'include':[{'model':_0xab2f('0x11'),'as':_0xab2f('0x11'),'attributes':['id','name']}]},{'model':'DeskField','as':_0xab2f('0x15'),'attributes':['id',_0xab2f('0x8'),_0xab2f('0xf'),_0xab2f('0x16'),_0xab2f('0x17'),_0xab2f('0x18'),_0xab2f('0x10')],'include':[{'model':_0xab2f('0x11'),'as':_0xab2f('0x11'),'attributes':['id',_0xab2f('0xc')]}]},{'model':_0xab2f('0x19'),'as':_0xab2f('0x1a'),'attributes':['id','name']}]}]},'log':_0xab2f('0x3')});};};
\ No newline at end of file
index c438a50..a5562ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb082=['name','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','description','type','content','variableName','Variable','Dynamics365Field','Descriptions','keyType','keyContent','Fields','idField','nameField','customField','GetDynamics365Account','getDynamics365Accounts','Request'];(function(_0x4a3d5b,_0x2d4c74){var _0x5ed5a5=function(_0x57a28b){while(--_0x57a28b){_0x4a3d5b['push'](_0x4a3d5b['shift']());}};_0x5ed5a5(++_0x2d4c74);}(_0xb082,0xb6));var _0x2b08=function(_0x5a5680,_0x5afb88){_0x5a5680=_0x5a5680-0x0;var _0x4665b5=_0xb082[_0x5a5680];return _0x4665b5;};'use strict';var client=require('../../client');exports[_0x2b08('0x0')]=function(){return function(_0x1898b6){return client[_0x2b08('0x1')]('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0x2b08('0x2'),'username',_0x2b08('0x3'),_0x2b08('0x4'),_0x2b08('0x5'),_0x2b08('0x6'),_0x2b08('0x7'),_0x2b08('0x8'),_0x2b08('0x9')],'include':[{'model':'Dynamics365Configuration','as':'Configurations','attributes':['id',_0x2b08('0x2'),'ticketType'],'include':[{'model':'Dynamics365Field','as':'Subjects','attributes':['id',_0x2b08('0xa'),_0x2b08('0xb'),_0x2b08('0xc')],'include':[{'model':_0x2b08('0xd'),'as':_0x2b08('0xd'),'attributes':['id',_0x2b08('0x2')]}]},{'model':_0x2b08('0xe'),'as':_0x2b08('0xf'),'attributes':['id','type',_0x2b08('0xb'),'key',_0x2b08('0x10'),_0x2b08('0x11'),_0x2b08('0xc')],'include':[{'model':_0x2b08('0xd'),'as':_0x2b08('0xd'),'attributes':['id',_0x2b08('0x2')]}]},{'model':'Dynamics365Field','as':_0x2b08('0x12'),'attributes':['id','type',_0x2b08('0xb'),_0x2b08('0x13'),_0x2b08('0x14'),_0x2b08('0x15'),_0x2b08('0xc')],'include':[{'model':_0x2b08('0xd'),'as':_0x2b08('0xd'),'attributes':['id',_0x2b08('0x2')]}]}]}]},'log':_0x2b08('0x16')});};};
\ No newline at end of file
+var _0x6602=['Configurations','ticketType','Subjects','type','content','Variable','Dynamics365Field','Descriptions','key','keyContent','variableName','idField','nameField','getDynamics365Accounts','Request','GetDynamics365Account','name','username','password','remoteUri','clientId','clientSecret','description'];(function(_0x1b4e05,_0x4f07b9){var _0x165b0b=function(_0x3f86e2){while(--_0x3f86e2){_0x1b4e05['push'](_0x1b4e05['shift']());}};_0x165b0b(++_0x4f07b9);}(_0x6602,0x1f0));var _0x2660=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x6602[_0x5627e1];return _0x2f013f;};'use strict';var client=require('../../client');exports[_0x2660('0x0')]=function(){return function(_0x7b0b72){return client[_0x2660('0x1')](_0x2660('0x2'),{'options':{'raw':![],'attributes':['id',_0x2660('0x3'),_0x2660('0x4'),_0x2660('0x5'),_0x2660('0x6'),'tenantId',_0x2660('0x7'),_0x2660('0x8'),'serverUrl',_0x2660('0x9')],'include':[{'model':'Dynamics365Configuration','as':_0x2660('0xa'),'attributes':['id',_0x2660('0x3'),_0x2660('0xb')],'include':[{'model':'Dynamics365Field','as':_0x2660('0xc'),'attributes':['id',_0x2660('0xd'),_0x2660('0xe'),'variableName'],'include':[{'model':'Variable','as':_0x2660('0xf'),'attributes':['id',_0x2660('0x3')]}]},{'model':_0x2660('0x10'),'as':_0x2660('0x11'),'attributes':['id',_0x2660('0xd'),_0x2660('0xe'),_0x2660('0x12'),'keyType',_0x2660('0x13'),_0x2660('0x14')],'include':[{'model':'Variable','as':_0x2660('0xf'),'attributes':['id','name']}]},{'model':_0x2660('0x10'),'as':'Fields','attributes':['id',_0x2660('0xd'),_0x2660('0xe'),_0x2660('0x15'),_0x2660('0x16'),'customField',_0x2660('0x14')],'include':[{'model':_0x2660('0xf'),'as':_0x2660('0xf'),'attributes':['id','name']}]}]}]},'log':_0x2660('0x2')});};};
\ No newline at end of file
index cafbee4..f550064 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94e6=['Variable','Fields','idField','nameField','customField','../../client','Request','GetFreshdeskAccount','name','username','apiKey','serverUrl','FreshdeskConfiguration','Tag','FreshdeskField','content','Descriptions','type','key','keyType','variableName'];(function(_0x5febb0,_0x3c46df){var _0x2baab7=function(_0x393ef9){while(--_0x393ef9){_0x5febb0['push'](_0x5febb0['shift']());}};_0x2baab7(++_0x3c46df);}(_0x94e6,0x194));var _0x694e=function(_0x255151,_0x1e8f46){_0x255151=_0x255151-0x0;var _0x28e2b9=_0x94e6[_0x255151];return _0x28e2b9;};'use strict';var client=require(_0x694e('0x0'));exports['getFreshdeskAccounts']=function(){return function(_0x32423f){return client[_0x694e('0x1')](_0x694e('0x2'),{'options':{'raw':![],'attributes':['id',_0x694e('0x3'),_0x694e('0x4'),_0x694e('0x5'),'remoteUri',_0x694e('0x6')],'include':[{'model':_0x694e('0x7'),'as':'Configurations','attributes':['id','name'],'include':[{'model':_0x694e('0x8'),'attributes':['id',_0x694e('0x3')]},{'model':_0x694e('0x9'),'as':'Subjects','attributes':['id','type',_0x694e('0xa'),'variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x694e('0x3')]}]},{'model':_0x694e('0x9'),'as':_0x694e('0xb'),'attributes':['id',_0x694e('0xc'),'content',_0x694e('0xd'),_0x694e('0xe'),'keyContent',_0x694e('0xf')],'include':[{'model':_0x694e('0x10'),'as':_0x694e('0x10'),'attributes':['id',_0x694e('0x3')]}]},{'model':'FreshdeskField','as':_0x694e('0x11'),'attributes':['id','type',_0x694e('0xa'),_0x694e('0x12'),_0x694e('0x13'),_0x694e('0x14'),_0x694e('0xf')],'include':[{'model':_0x694e('0x10'),'as':_0x694e('0x10'),'attributes':['id',_0x694e('0x3')]}]}]}]},'log':_0x694e('0x2')});};};
\ No newline at end of file
+var _0x8e44=['variableName','Variable','key','Fields','idField','nameField','customField','GetFreshdeskAccount','../../client','getFreshdeskAccounts','name','username','apiKey','remoteUri','FreshdeskConfiguration','Configurations','FreshdeskField','Subjects','type','content'];(function(_0x1e2bda,_0x432fdf){var _0x5b7278=function(_0x5ca2ab){while(--_0x5ca2ab){_0x1e2bda['push'](_0x1e2bda['shift']());}};_0x5b7278(++_0x432fdf);}(_0x8e44,0x1ac));var _0x48e4=function(_0x4642e0,_0x1e350c){_0x4642e0=_0x4642e0-0x0;var _0x1f4f11=_0x8e44[_0x4642e0];return _0x1f4f11;};'use strict';var client=require(_0x48e4('0x0'));exports[_0x48e4('0x1')]=function(){return function(_0xb82c83){return client['Request']('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id',_0x48e4('0x2'),_0x48e4('0x3'),_0x48e4('0x4'),_0x48e4('0x5'),'serverUrl'],'include':[{'model':_0x48e4('0x6'),'as':_0x48e4('0x7'),'attributes':['id',_0x48e4('0x2')],'include':[{'model':'Tag','attributes':['id','name']},{'model':_0x48e4('0x8'),'as':_0x48e4('0x9'),'attributes':['id',_0x48e4('0xa'),_0x48e4('0xb'),_0x48e4('0xc')],'include':[{'model':_0x48e4('0xd'),'as':_0x48e4('0xd'),'attributes':['id',_0x48e4('0x2')]}]},{'model':_0x48e4('0x8'),'as':'Descriptions','attributes':['id',_0x48e4('0xa'),_0x48e4('0xb'),_0x48e4('0xe'),'keyType','keyContent',_0x48e4('0xc')],'include':[{'model':_0x48e4('0xd'),'as':_0x48e4('0xd'),'attributes':['id',_0x48e4('0x2')]}]},{'model':'FreshdeskField','as':_0x48e4('0xf'),'attributes':['id','type',_0x48e4('0xb'),_0x48e4('0x10'),_0x48e4('0x11'),_0x48e4('0x12'),_0x48e4('0xc')],'include':[{'model':_0x48e4('0xd'),'as':_0x48e4('0xd'),'attributes':['id','name']}]}]}]},'log':_0x48e4('0x13')});};};
\ No newline at end of file
index c6d08a9..80364b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce68=['GetFreshsalesAccount','name','username','remoteUri','serverUrl','FreshsalesConfiguration','FreshsalesField','content','variableName','Variable','Descriptions','type','key','keyType','keyContent','GetFreshsalesccount','../../client','Request'];(function(_0x27c118,_0x494e9b){var _0x46c208=function(_0x1e31d6){while(--_0x1e31d6){_0x27c118['push'](_0x27c118['shift']());}};_0x46c208(++_0x494e9b);}(_0xce68,0x10c));var _0x8ce6=function(_0x455bf1,_0x8383e5){_0x455bf1=_0x455bf1-0x0;var _0x454b5e=_0xce68[_0x455bf1];return _0x454b5e;};'use strict';var client=require(_0x8ce6('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x30b0c9){return client[_0x8ce6('0x1')](_0x8ce6('0x2'),{'options':{'raw':![],'attributes':['id',_0x8ce6('0x3'),_0x8ce6('0x4'),'apiKey',_0x8ce6('0x5'),_0x8ce6('0x6')],'include':[{'model':_0x8ce6('0x7'),'as':'Configurations','attributes':['id',_0x8ce6('0x3')],'include':[{'model':_0x8ce6('0x8'),'as':'Subjects','attributes':['id','type',_0x8ce6('0x9'),_0x8ce6('0xa')],'include':[{'model':_0x8ce6('0xb'),'as':_0x8ce6('0xb'),'attributes':['id','name']}]},{'model':_0x8ce6('0x8'),'as':_0x8ce6('0xc'),'attributes':['id',_0x8ce6('0xd'),_0x8ce6('0x9'),_0x8ce6('0xe'),_0x8ce6('0xf'),_0x8ce6('0x10'),_0x8ce6('0xa')],'include':[{'model':_0x8ce6('0xb'),'as':_0x8ce6('0xb'),'attributes':['id',_0x8ce6('0x3')]}]}]}]},'log':_0x8ce6('0x11')});};};
\ No newline at end of file
+var _0xc359=['variableName','Variable','FreshsalesField','type','GetFreshsalesccount','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','apiKey','serverUrl','Configurations','content'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xc359,0x1d9));var _0x9c35=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0xc359[_0x2de0a7];return _0x429437;};'use strict';var client=require('../../client');exports[_0x9c35('0x0')]=function(){return function(_0x562438){return client[_0x9c35('0x1')](_0x9c35('0x2'),{'options':{'raw':![],'attributes':['id',_0x9c35('0x3'),'username',_0x9c35('0x4'),'remoteUri',_0x9c35('0x5')],'include':[{'model':'FreshsalesConfiguration','as':_0x9c35('0x6'),'attributes':['id','name'],'include':[{'model':'FreshsalesField','as':'Subjects','attributes':['id','type',_0x9c35('0x7'),_0x9c35('0x8')],'include':[{'model':_0x9c35('0x9'),'as':_0x9c35('0x9'),'attributes':['id',_0x9c35('0x3')]}]},{'model':_0x9c35('0xa'),'as':'Descriptions','attributes':['id',_0x9c35('0xb'),_0x9c35('0x7'),'key','keyType','keyContent',_0x9c35('0x8')],'include':[{'model':'Variable','as':_0x9c35('0x9'),'attributes':['id',_0x9c35('0x3')]}]}]}]},'log':_0x9c35('0xc')});};};
\ No newline at end of file
index 1d77dba..9ba5ab7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x199c=['name','username','clientId','clientSecret','securityToken','serverUrl','type','SalesforceConfiguration','leadId','additionalSearchAccount','additionalSearchContact','SalesforceField','Subjects','Variable','Fields','../../client','getSalesforceAccounts','GetSalesforceAccount'];(function(_0x351c9a,_0xd89685){var _0x35075b=function(_0x582bb0){while(--_0x582bb0){_0x351c9a['push'](_0x351c9a['shift']());}};_0x35075b(++_0xd89685);}(_0x199c,0x7b));var _0xc199=function(_0x3f25d5,_0x31d352){_0x3f25d5=_0x3f25d5-0x0;var _0xd9b7c5=_0x199c[_0x3f25d5];return _0xd9b7c5;};'use strict';var client=require(_0xc199('0x0'));exports[_0xc199('0x1')]=function(){return function(_0x348792){return client['Request'](_0xc199('0x2'),{'options':{'raw':![],'attributes':['id',_0xc199('0x3'),_0xc199('0x4'),'password','remoteUri',_0xc199('0x5'),_0xc199('0x6'),_0xc199('0x7'),_0xc199('0x8'),_0xc199('0x9')],'include':[{'model':_0xc199('0xa'),'as':'Configurations','attributes':['id',_0xc199('0x3'),'moduleSearch','moduleCreate','ticketType',_0xc199('0xb'),_0xc199('0xc'),_0xc199('0xd'),'additionalSearchLead'],'include':[{'model':_0xc199('0xe'),'as':_0xc199('0xf'),'include':[{'model':'Variable','as':_0xc199('0x10'),'attributes':['id',_0xc199('0x3')]}]},{'model':_0xc199('0xe'),'as':'Descriptions','include':[{'model':'Variable','as':'Variable','attributes':['id',_0xc199('0x3')]}]},{'model':_0xc199('0xe'),'as':_0xc199('0x11'),'include':[{'model':_0xc199('0x10'),'as':_0xc199('0x10'),'attributes':['id',_0xc199('0x3')]}]}]}]},'log':_0xc199('0x2')});};};
\ No newline at end of file
+var _0x5b6e=['username','password','clientSecret','securityToken','serverUrl','type','Configurations','moduleSearch','ticketType','additionalSearchAccount','additionalSearchContact','SalesforceField','Subjects','Variable','Descriptions','Fields','GetSalesforceAccount','../../client','getSalesforceAccounts','Request','name'];(function(_0x575b72,_0x1a7eb1){var _0x561c57=function(_0x10e401){while(--_0x10e401){_0x575b72['push'](_0x575b72['shift']());}};_0x561c57(++_0x1a7eb1);}(_0x5b6e,0x14c));var _0xe5b6=function(_0x3bd0e7,_0x3682fd){_0x3bd0e7=_0x3bd0e7-0x0;var _0x3ca298=_0x5b6e[_0x3bd0e7];return _0x3ca298;};'use strict';var client=require(_0xe5b6('0x0'));exports[_0xe5b6('0x1')]=function(){return function(_0x52831c){return client[_0xe5b6('0x2')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id',_0xe5b6('0x3'),_0xe5b6('0x4'),_0xe5b6('0x5'),'remoteUri','clientId',_0xe5b6('0x6'),_0xe5b6('0x7'),_0xe5b6('0x8'),_0xe5b6('0x9')],'include':[{'model':'SalesforceConfiguration','as':_0xe5b6('0xa'),'attributes':['id',_0xe5b6('0x3'),_0xe5b6('0xb'),'moduleCreate',_0xe5b6('0xc'),'leadId',_0xe5b6('0xd'),_0xe5b6('0xe'),'additionalSearchLead'],'include':[{'model':_0xe5b6('0xf'),'as':_0xe5b6('0x10'),'include':[{'model':'Variable','as':_0xe5b6('0x11'),'attributes':['id',_0xe5b6('0x3')]}]},{'model':'SalesforceField','as':_0xe5b6('0x12'),'include':[{'model':_0xe5b6('0x11'),'as':'Variable','attributes':['id',_0xe5b6('0x3')]}]},{'model':_0xe5b6('0xf'),'as':_0xe5b6('0x13'),'include':[{'model':_0xe5b6('0x11'),'as':_0xe5b6('0x11'),'attributes':['id','name']}]}]}]},'log':_0xe5b6('0x14')});};};
\ No newline at end of file
index 3c3fe2a..fa6f5b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['password','email','ServicenowConfiguration','name','Subjects','type','content','Variable','ServicenowField','Descriptions','key','keyType','keyContent','variableName','Fields','idField','nameField','../../client','getServicenowAccounts','Request','GetServicenowAccount','username'];(function(_0x446736,_0x1eaedb){var _0x5548e2=function(_0x201c66){while(--_0x201c66){_0x446736['push'](_0x446736['shift']());}};_0x5548e2(++_0x1eaedb);}(_0xabce,0x103));var _0xeabc=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xabce[_0x54d4fe];return _0x1ab5bb;};'use strict';var client=require(_0xeabc('0x0'));exports[_0xeabc('0x1')]=function(){return function(_0x357cda){return client[_0xeabc('0x2')](_0xeabc('0x3'),{'options':{'raw':![],'attributes':['id','name','description',_0xeabc('0x4'),_0xeabc('0x5'),_0xeabc('0x6'),'remoteUri','serverUrl'],'include':[{'model':_0xeabc('0x7'),'as':'Configurations','attributes':['id',_0xeabc('0x8')],'include':[{'model':'ServicenowField','as':_0xeabc('0x9'),'attributes':['id',_0xeabc('0xa'),_0xeabc('0xb'),'variableName'],'include':[{'model':_0xeabc('0xc'),'as':_0xeabc('0xc'),'attributes':['id',_0xeabc('0x8')]}]},{'model':_0xeabc('0xd'),'as':_0xeabc('0xe'),'attributes':['id',_0xeabc('0xa'),_0xeabc('0xb'),_0xeabc('0xf'),_0xeabc('0x10'),_0xeabc('0x11'),_0xeabc('0x12')],'include':[{'model':_0xeabc('0xc'),'as':_0xeabc('0xc'),'attributes':['id',_0xeabc('0x8')]}]},{'model':_0xeabc('0xd'),'as':_0xeabc('0x13'),'attributes':['id','type',_0xeabc('0xb'),_0xeabc('0x14'),_0xeabc('0x15'),'customField','variableName'],'include':[{'model':_0xeabc('0xc'),'as':_0xeabc('0xc'),'attributes':['id',_0xeabc('0x8')]}]}]}]},'log':'GetServicenowkAccount'});};};
\ No newline at end of file
+var _0xda19=['ServicenowConfiguration','Configurations','name','ServicenowField','Subjects','type','Variable','Descriptions','content','key','keyType','keyContent','Fields','nameField','GetServicenowkAccount','getServicenowAccounts','GetServicenowAccount','description','password','email','remoteUri','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda19,0xd5));var _0x9da1=function(_0x2c25e6,_0x2d1bc8){_0x2c25e6=_0x2c25e6-0x0;var _0x567d83=_0xda19[_0x2c25e6];return _0x567d83;};'use strict';var client=require('../../client');exports[_0x9da1('0x0')]=function(){return function(_0x430d39){return client['Request'](_0x9da1('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x9da1('0x2'),'username',_0x9da1('0x3'),_0x9da1('0x4'),_0x9da1('0x5'),_0x9da1('0x6')],'include':[{'model':_0x9da1('0x7'),'as':_0x9da1('0x8'),'attributes':['id',_0x9da1('0x9')],'include':[{'model':_0x9da1('0xa'),'as':_0x9da1('0xb'),'attributes':['id',_0x9da1('0xc'),'content','variableName'],'include':[{'model':'Variable','as':_0x9da1('0xd'),'attributes':['id','name']}]},{'model':_0x9da1('0xa'),'as':_0x9da1('0xe'),'attributes':['id',_0x9da1('0xc'),_0x9da1('0xf'),_0x9da1('0x10'),_0x9da1('0x11'),_0x9da1('0x12'),'variableName'],'include':[{'model':'Variable','as':_0x9da1('0xd'),'attributes':['id','name']}]},{'model':_0x9da1('0xa'),'as':_0x9da1('0x13'),'attributes':['id',_0x9da1('0xc'),_0x9da1('0xf'),'idField',_0x9da1('0x14'),'customField','variableName'],'include':[{'model':_0x9da1('0xd'),'as':'Variable','attributes':['id',_0x9da1('0x9')]}]}]}]},'log':_0x9da1('0x15')});};};
\ No newline at end of file
index 8cf10ae..ace6afe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['GetSugarcrmAccount','getSugarcrmAccounts','Request','name','username','remoteUri','serverUrl','SugarcrmConfiguration','Configurations','SugarcrmField','Subjects','type','content','variableName','Variable','key','keyContent','customField'];(function(_0x32ae5f,_0x3f3e2c){var _0x2bf144=function(_0x397146){while(--_0x397146){_0x32ae5f['push'](_0x32ae5f['shift']());}};_0x2bf144(++_0x3f3e2c);}(_0x2032,0xd9));var _0x2203=function(_0x2d9de5,_0x150cb4){_0x2d9de5=_0x2d9de5-0x0;var _0xa63587=_0x2032[_0x2d9de5];return _0xa63587;};'use strict';var client=require('../../client');exports[_0x2203('0x0')]=function(){return function(_0x1e103d){return client[_0x2203('0x1')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id',_0x2203('0x2'),_0x2203('0x3'),'password',_0x2203('0x4'),_0x2203('0x5')],'include':[{'model':_0x2203('0x6'),'as':_0x2203('0x7'),'attributes':['id',_0x2203('0x2')],'include':[{'model':_0x2203('0x8'),'as':_0x2203('0x9'),'attributes':['id',_0x2203('0xa'),_0x2203('0xb'),_0x2203('0xc')],'include':[{'model':_0x2203('0xd'),'as':'Variable','attributes':['id','name']}]},{'model':_0x2203('0x8'),'as':'Descriptions','attributes':['id',_0x2203('0xa'),_0x2203('0xb'),_0x2203('0xe'),'keyType',_0x2203('0xf'),'variableName'],'include':[{'model':_0x2203('0xd'),'as':'Variable','attributes':['id',_0x2203('0x2')]}]},{'model':_0x2203('0x8'),'as':'Fields','attributes':['id','type','content','idField','nameField',_0x2203('0x10'),'variableName'],'include':[{'model':'Variable','as':_0x2203('0xd'),'attributes':['id',_0x2203('0x2')]}]}]}]},'log':_0x2203('0x11')});};};
\ 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(_0x3f51b3,_0x44776c){var _0x80e74e=function(_0x52c585){while(--_0x52c585){_0x3f51b3['push'](_0x3f51b3['shift']());}};_0x80e74e(++_0x44776c);}(_0x0295,0x1f0));var _0x5029=function(_0x1a1d4a,_0x48ef2b){_0x1a1d4a=_0x1a1d4a-0x0;var _0x44fda1=_0x0295[_0x1a1d4a];return _0x44fda1;};'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 6712a3e..d5d31e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814a=['variableName','Variable','VtigerField','Descriptions','keyType','keyContent','Fields','idField','nameField','customField','../../client','getVtigerAccounts','Request','GetVtigerAccount','name','description','username','accessKey','remoteUri','VtigerConfiguration','Configurations','Subjects','type','content'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x814a,0x6a));var _0xa814=function(_0x1d0af4,_0x2b9dcb){_0x1d0af4=_0x1d0af4-0x0;var _0x4f5926=_0x814a[_0x1d0af4];return _0x4f5926;};'use strict';var client=require(_0xa814('0x0'));exports[_0xa814('0x1')]=function(){return function(_0x54be19){return client[_0xa814('0x2')](_0xa814('0x3'),{'options':{'raw':![],'attributes':['id',_0xa814('0x4'),_0xa814('0x5'),_0xa814('0x6'),_0xa814('0x7'),_0xa814('0x8'),'serverUrl'],'include':[{'model':_0xa814('0x9'),'as':_0xa814('0xa'),'attributes':['id',_0xa814('0x4')],'include':[{'model':'VtigerField','as':_0xa814('0xb'),'attributes':['id',_0xa814('0xc'),_0xa814('0xd'),_0xa814('0xe')],'include':[{'model':_0xa814('0xf'),'as':'Variable','attributes':['id',_0xa814('0x4')]}]},{'model':_0xa814('0x10'),'as':_0xa814('0x11'),'attributes':['id','type',_0xa814('0xd'),'key',_0xa814('0x12'),_0xa814('0x13'),_0xa814('0xe')],'include':[{'model':_0xa814('0xf'),'as':_0xa814('0xf'),'attributes':['id',_0xa814('0x4')]}]},{'model':_0xa814('0x10'),'as':_0xa814('0x14'),'attributes':['id',_0xa814('0xc'),_0xa814('0xd'),_0xa814('0x15'),_0xa814('0x16'),_0xa814('0x17'),_0xa814('0xe')],'include':[{'model':_0xa814('0xf'),'as':_0xa814('0xf'),'attributes':['id',_0xa814('0x4')]}]}]}]},'log':_0xa814('0x3')});};};
\ No newline at end of file
+var _0x068f=['serverUrl','VtigerConfiguration','name','VtigerField','Subjects','content','variableName','Variable','Descriptions','type','key','keyType','keyContent','Fields','idField','nameField','customField','../../client','GetVtigerAccount','description','username','remoteUri'];(function(_0x5240b7,_0x9b32db){var _0x54bc2a=function(_0x5bafae){while(--_0x5bafae){_0x5240b7['push'](_0x5240b7['shift']());}};_0x54bc2a(++_0x9b32db);}(_0x068f,0x1df));var _0xf068=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x068f[_0x49b207];return _0x2dc8fa;};'use strict';var client=require(_0xf068('0x0'));exports['getVtigerAccounts']=function(){return function(_0x57ca4c){return client['Request'](_0xf068('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xf068('0x2'),_0xf068('0x3'),'accessKey',_0xf068('0x4'),_0xf068('0x5')],'include':[{'model':_0xf068('0x6'),'as':'Configurations','attributes':['id',_0xf068('0x7')],'include':[{'model':_0xf068('0x8'),'as':_0xf068('0x9'),'attributes':['id','type',_0xf068('0xa'),_0xf068('0xb')],'include':[{'model':'Variable','as':_0xf068('0xc'),'attributes':['id','name']}]},{'model':_0xf068('0x8'),'as':_0xf068('0xd'),'attributes':['id',_0xf068('0xe'),_0xf068('0xa'),_0xf068('0xf'),_0xf068('0x10'),_0xf068('0x11'),_0xf068('0xb')],'include':[{'model':_0xf068('0xc'),'as':_0xf068('0xc'),'attributes':['id',_0xf068('0x7')]}]},{'model':'VtigerField','as':_0xf068('0x12'),'attributes':['id',_0xf068('0xe'),_0xf068('0xa'),_0xf068('0x13'),_0xf068('0x14'),_0xf068('0x15'),_0xf068('0xb')],'include':[{'model':_0xf068('0xc'),'as':_0xf068('0xc'),'attributes':['id',_0xf068('0x7')]}]}]}]},'log':_0xf068('0x1')});};};
\ No newline at end of file
index f5bfa1e..d382601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1da=['variableName','Variable','Descriptions','key','keyType','keyContent','Fields','idField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','username','password','token','authType','type','ZendeskConfiguration','Configurations','name','Tag','ZendeskField','Subjects','content'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xf1da,0x9f));var _0xaf1d=function(_0x106369,_0x12dcc7){_0x106369=_0x106369-0x0;var _0x54c5d7=_0xf1da[_0x106369];return _0x54c5d7;};'use strict';var client=require(_0xaf1d('0x0'));exports[_0xaf1d('0x1')]=function(){return function(_0xecda3d){return client[_0xaf1d('0x2')](_0xaf1d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xaf1d('0x4'),_0xaf1d('0x5'),_0xaf1d('0x6'),'remoteUri',_0xaf1d('0x7'),'serverUrl',_0xaf1d('0x8')],'include':[{'model':_0xaf1d('0x9'),'as':_0xaf1d('0xa'),'attributes':['id',_0xaf1d('0xb')],'include':[{'model':_0xaf1d('0xc'),'attributes':['id',_0xaf1d('0xb')]},{'model':_0xaf1d('0xd'),'as':_0xaf1d('0xe'),'attributes':['id',_0xaf1d('0x8'),_0xaf1d('0xf'),_0xaf1d('0x10')],'include':[{'model':'Variable','as':_0xaf1d('0x11'),'attributes':['id',_0xaf1d('0xb')]}]},{'model':_0xaf1d('0xd'),'as':_0xaf1d('0x12'),'attributes':['id','type',_0xaf1d('0xf'),_0xaf1d('0x13'),_0xaf1d('0x14'),_0xaf1d('0x15'),_0xaf1d('0x10')],'include':[{'model':_0xaf1d('0x11'),'as':'Variable','attributes':['id',_0xaf1d('0xb')]}]},{'model':_0xaf1d('0xd'),'as':_0xaf1d('0x16'),'attributes':['id',_0xaf1d('0x8'),_0xaf1d('0xf'),_0xaf1d('0x17'),'nameField',_0xaf1d('0x18'),_0xaf1d('0x10')],'include':[{'model':_0xaf1d('0x11'),'as':_0xaf1d('0x11'),'attributes':['id',_0xaf1d('0xb')]}]}]}]},'log':_0xaf1d('0x3')});};};
\ No newline at end of file
+var _0xc1b2=['token','remoteUri','authType','serverUrl','type','ZendeskConfiguration','Configurations','Subjects','content','Variable','ZendeskField','Descriptions','key','keyType','variableName','Fields','idField','nameField','customField','getZendeskAccounts','Request','GetZendeskAccount','name','username'];(function(_0x383158,_0x415e43){var _0x507985=function(_0x1e498e){while(--_0x1e498e){_0x383158['push'](_0x383158['shift']());}};_0x507985(++_0x415e43);}(_0xc1b2,0x1f3));var _0x2c1b=function(_0x4ef8b9,_0xbd4391){_0x4ef8b9=_0x4ef8b9-0x0;var _0x782ee7=_0xc1b2[_0x4ef8b9];return _0x782ee7;};'use strict';var client=require('../../client');exports[_0x2c1b('0x0')]=function(){return function(_0x569398){return client[_0x2c1b('0x1')](_0x2c1b('0x2'),{'options':{'raw':![],'attributes':['id',_0x2c1b('0x3'),_0x2c1b('0x4'),'password',_0x2c1b('0x5'),_0x2c1b('0x6'),_0x2c1b('0x7'),_0x2c1b('0x8'),_0x2c1b('0x9')],'include':[{'model':_0x2c1b('0xa'),'as':_0x2c1b('0xb'),'attributes':['id','name'],'include':[{'model':'Tag','attributes':['id',_0x2c1b('0x3')]},{'model':'ZendeskField','as':_0x2c1b('0xc'),'attributes':['id',_0x2c1b('0x9'),_0x2c1b('0xd'),'variableName'],'include':[{'model':_0x2c1b('0xe'),'as':_0x2c1b('0xe'),'attributes':['id',_0x2c1b('0x3')]}]},{'model':_0x2c1b('0xf'),'as':_0x2c1b('0x10'),'attributes':['id',_0x2c1b('0x9'),_0x2c1b('0xd'),_0x2c1b('0x11'),_0x2c1b('0x12'),'keyContent',_0x2c1b('0x13')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x2c1b('0x3')]}]},{'model':_0x2c1b('0xf'),'as':_0x2c1b('0x14'),'attributes':['id',_0x2c1b('0x9'),_0x2c1b('0xd'),_0x2c1b('0x15'),_0x2c1b('0x16'),_0x2c1b('0x17'),_0x2c1b('0x13')],'include':[{'model':'Variable','as':_0x2c1b('0xe'),'attributes':['id',_0x2c1b('0x3')]}]}]}]},'log':_0x2c1b('0x2')});};};
\ No newline at end of file
index 9459d69..66a858b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c1a=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','moduleCreate','moduleSearch','ZohoField','Subjects','type','content','Variable','Descriptions','keyType','keyContent','variableName','Fields','nameField','customField','../../client','Request','GetZohoAccount','name','description','host'];(function(_0x33836c,_0x5b01db){var _0x31a404=function(_0x5416ed){while(--_0x5416ed){_0x33836c['push'](_0x33836c['shift']());}};_0x31a404(++_0x5b01db);}(_0x0c1a,0xd2));var _0xa0c1=function(_0x34be63,_0x5d4ae7){_0x34be63=_0x34be63-0x0;var _0x577124=_0x0c1a[_0x34be63];return _0x577124;};'use strict';var client=require(_0xa0c1('0x0'));exports['getZohoAccounts']=function(){return function(_0x58a339){return client[_0xa0c1('0x1')](_0xa0c1('0x2'),{'options':{'raw':![],'attributes':['id',_0xa0c1('0x3'),_0xa0c1('0x4'),_0xa0c1('0x5'),_0xa0c1('0x6'),_0xa0c1('0x7'),_0xa0c1('0x8'),_0xa0c1('0x9'),_0xa0c1('0xa'),_0xa0c1('0xb')],'include':[{'model':'ZohoConfiguration','as':_0xa0c1('0xc'),'attributes':['id',_0xa0c1('0x3'),_0xa0c1('0xd'),_0xa0c1('0xe'),_0xa0c1('0x4')],'include':[{'model':_0xa0c1('0xf'),'as':_0xa0c1('0x10'),'attributes':['id',_0xa0c1('0x11'),_0xa0c1('0x12'),'variableName'],'include':[{'model':_0xa0c1('0x13'),'as':_0xa0c1('0x13'),'attributes':['id','name']}]},{'model':'ZohoField','as':_0xa0c1('0x14'),'attributes':['id',_0xa0c1('0x11'),_0xa0c1('0x12'),'key',_0xa0c1('0x15'),_0xa0c1('0x16'),_0xa0c1('0x17')],'include':[{'model':_0xa0c1('0x13'),'as':_0xa0c1('0x13'),'attributes':['id','name']}]},{'model':'ZohoField','as':_0xa0c1('0x18'),'attributes':['id',_0xa0c1('0x11'),'content','idField',_0xa0c1('0x19'),_0xa0c1('0x1a'),_0xa0c1('0x17')],'include':[{'model':_0xa0c1('0x13'),'as':'Variable','attributes':['id',_0xa0c1('0x3')]}]}]}]},'log':'GetZohoAccount'});};};
\ No newline at end of file
+var _0x30d1=['Variable','Descriptions','keyType','keyContent','variableName','Fields','customField','../../client','getZohoAccounts','Request','GetZohoAccount','name','description','host','zone','clientId','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleCreate','ZohoField','Subjects','type','content'];(function(_0x10d1fd,_0xcfe652){var _0x2699e2=function(_0x5a039d){while(--_0x5a039d){_0x10d1fd['push'](_0x10d1fd['shift']());}};_0x2699e2(++_0xcfe652);}(_0x30d1,0x13f));var _0x130d=function(_0x4d6bfd,_0x8d79ff){_0x4d6bfd=_0x4d6bfd-0x0;var _0x243a46=_0x30d1[_0x4d6bfd];return _0x243a46;};'use strict';var client=require(_0x130d('0x0'));exports[_0x130d('0x1')]=function(){return function(_0x3816dd){return client[_0x130d('0x2')](_0x130d('0x3'),{'options':{'raw':![],'attributes':['id',_0x130d('0x4'),_0x130d('0x5'),_0x130d('0x6'),_0x130d('0x7'),_0x130d('0x8'),'clientSecret',_0x130d('0x9'),_0x130d('0xa'),_0x130d('0xb')],'include':[{'model':_0x130d('0xc'),'as':_0x130d('0xd'),'attributes':['id','name',_0x130d('0xe'),'moduleSearch',_0x130d('0x5')],'include':[{'model':_0x130d('0xf'),'as':_0x130d('0x10'),'attributes':['id',_0x130d('0x11'),_0x130d('0x12'),'variableName'],'include':[{'model':_0x130d('0x13'),'as':_0x130d('0x13'),'attributes':['id',_0x130d('0x4')]}]},{'model':_0x130d('0xf'),'as':_0x130d('0x14'),'attributes':['id',_0x130d('0x11'),_0x130d('0x12'),'key',_0x130d('0x15'),_0x130d('0x16'),_0x130d('0x17')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x130d('0x4')]}]},{'model':'ZohoField','as':_0x130d('0x18'),'attributes':['id',_0x130d('0x11'),'content','idField','nameField',_0x130d('0x19'),_0x130d('0x17')],'include':[{'model':'Variable','as':_0x130d('0x13'),'attributes':['id',_0x130d('0x4')]}]}]}]},'log':_0x130d('0x3')});};};
\ No newline at end of file
index e009328..42df838 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e38=['lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','queue','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','Request','voice','membername','starttime','endtime','outbound','dialstring','agent','lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt'];(function(_0x13b744,_0x3beea3){var _0x39f909=function(_0x298cdc){while(--_0x298cdc){_0x13b744['push'](_0x13b744['shift']());}};_0x39f909(++_0x3beea3);}(_0x2e38,0x19f));var _0x82e3=function(_0x37c585,_0xf210ac){_0x37c585=_0x37c585-0x0;var _0x13cba5=_0x2e38[_0x37c585];return _0x13cba5;};'use strict';var moment=require('moment');var _=require(_0x82e3('0x0'));var util=require('util');var client=require(_0x82e3('0x1'));exports[_0x82e3('0x2')]=function(_0x74d6d1){var _0x77e773=_0x74d6d1[_0x82e3('0x3')]||_0x74d6d1[_0x82e3('0x4')];return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0x74d6d1[_0x82e3('0x5')],'interface':_[_0x82e3('0x6')](_0x74d6d1[_0x82e3('0x7')])?util[_0x82e3('0x8')](_0x82e3('0x9'),_0x74d6d1['lastAssignedTo']):_0x74d6d1[_0x82e3('0x7')],'type':_0x82e3('0xa'),'enterAt':_0x74d6d1[_0x82e3('0xb')],'exitAt':_0x77e773,'duration':moment(_0x77e773)[_0x82e3('0xc')](_0x74d6d1[_0x82e3('0xb')],_0x82e3('0xd')),'data1':_0x82e3('0xe'),'data2':_0x74d6d1['calleridnum'],'data3':_0x74d6d1[_0x82e3('0xf')],'data4':null,'data5':_0x74d6d1[_0x82e3('0x10')],'role':'agent','internal':_0x74d6d1[_0x82e3('0x11')]?_[_0x82e3('0x12')](_0x74d6d1['accountcode']):undefined,'uniqueid':_0x74d6d1[_0x82e3('0x13')]},'log':_0x82e3('0x14')});};exports[_0x82e3('0x15')]=function(_0x1b3642){return client[_0x82e3('0x16')](_0x82e3('0x14'),{'body':{'channel':_0x82e3('0x17'),'membername':_0x1b3642[_0x82e3('0x18')],'interface':_0x1b3642[_0x82e3('0x7')],'type':_0x82e3('0xa'),'enterAt':_0x1b3642[_0x82e3('0x19')],'exitAt':_0x1b3642[_0x82e3('0x1a')],'duration':moment(_0x1b3642[_0x82e3('0x1a')])[_0x82e3('0xc')](_0x1b3642[_0x82e3('0x19')],_0x82e3('0xd'))>=0x0?moment(_0x1b3642[_0x82e3('0x1a')])['diff'](_0x1b3642[_0x82e3('0x19')],_0x82e3('0xd')):null,'data1':_0x82e3('0x1b'),'data2':_0x1b3642[_0x82e3('0x11')],'data3':_0x1b3642[_0x82e3('0xf')],'data4':_0x1b3642[_0x82e3('0x1c')]||null,'role':_0x82e3('0x1d'),'internal':_0x1b3642['accountcode']?_[_0x82e3('0x12')](_0x1b3642[_0x82e3('0x11')]):undefined,'uniqueid':_0x1b3642['uniqueid']},'log':_0x82e3('0x14')});};
\ No newline at end of file
+var _0xee8b=['diff','seconds','calleridnum','exten','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','Request','voice','membername','starttime','endtime','outbound','dialstring','agent','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','lastAssignedTo','interface','format','SIP/%s','queuecallerleaveAt'];(function(_0x43d701,_0x4bb2e9){var _0x2ec4c6=function(_0x4d9765){while(--_0x4d9765){_0x43d701['push'](_0x43d701['shift']());}};_0x2ec4c6(++_0x4bb2e9);}(_0xee8b,0xce));var _0xbee8=function(_0x16da59,_0x1ea77b){_0x16da59=_0x16da59-0x0;var _0x1c0c11=_0xee8b[_0x16da59];return _0x1c0c11;};'use strict';var moment=require('moment');var _=require(_0xbee8('0x0'));var util=require(_0xbee8('0x1'));var client=require(_0xbee8('0x2'));exports[_0xbee8('0x3')]=function(_0x37b9e4){var _0x1400da=_0x37b9e4[_0xbee8('0x4')]||_0x37b9e4['queuecallerexitAt'];return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0x37b9e4[_0xbee8('0x5')],'interface':_['isNil'](_0x37b9e4[_0xbee8('0x6')])?util[_0xbee8('0x7')](_0xbee8('0x8'),_0x37b9e4['lastAssignedTo']):_0x37b9e4[_0xbee8('0x6')],'type':'TALKING','enterAt':_0x37b9e4[_0xbee8('0x9')],'exitAt':_0x1400da,'duration':moment(_0x1400da)[_0xbee8('0xa')](_0x37b9e4[_0xbee8('0x9')],_0xbee8('0xb')),'data1':'inbound','data2':_0x37b9e4[_0xbee8('0xc')],'data3':_0x37b9e4[_0xbee8('0xd')],'data4':null,'data5':_0x37b9e4['queue'],'role':'agent','internal':_0x37b9e4[_0xbee8('0xe')]?_[_0xbee8('0xf')](_0x37b9e4[_0xbee8('0xe')]):undefined,'uniqueid':_0x37b9e4[_0xbee8('0x10')]},'log':_0xbee8('0x11')});};exports[_0xbee8('0x12')]=function(_0x44b4cf){return client[_0xbee8('0x13')](_0xbee8('0x11'),{'body':{'channel':_0xbee8('0x14'),'membername':_0x44b4cf[_0xbee8('0x15')],'interface':_0x44b4cf['interface'],'type':'TALKING','enterAt':_0x44b4cf[_0xbee8('0x16')],'exitAt':_0x44b4cf[_0xbee8('0x17')],'duration':moment(_0x44b4cf[_0xbee8('0x17')])['diff'](_0x44b4cf['starttime'],_0xbee8('0xb'))>=0x0?moment(_0x44b4cf[_0xbee8('0x17')])[_0xbee8('0xa')](_0x44b4cf[_0xbee8('0x16')],'seconds'):null,'data1':_0xbee8('0x18'),'data2':_0x44b4cf[_0xbee8('0xe')],'data3':_0x44b4cf[_0xbee8('0xd')],'data4':_0x44b4cf[_0xbee8('0x19')]||null,'role':_0xbee8('0x1a'),'internal':_0x44b4cf[_0xbee8('0xe')]?_[_0xbee8('0xf')](_0x44b4cf['accountcode']):undefined,'uniqueid':_0x44b4cf[_0xbee8('0x10')]},'log':_0xbee8('0x11')});};
\ No newline at end of file
index 6c5a171..ce9da70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca5a=['stopRecordingOnTransfer','GetSettings','getSettings','ShowSetting'];(function(_0x4eaa4c,_0x2f7422){var _0x15aec6=function(_0x23efc9){while(--_0x23efc9){_0x4eaa4c['push'](_0x4eaa4c['shift']());}};_0x15aec6(++_0x2f7422);}(_0xca5a,0x82));var _0xaca5=function(_0x400e6d,_0x240555){_0x400e6d=_0x400e6d-0x0;var _0x1d3517=_0xca5a[_0x400e6d];return _0x1d3517;};'use strict';var client=require('../client');exports[_0xaca5('0x0')]=function(){return client['Request'](_0xaca5('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xaca5('0x2')]},'log':_0xaca5('0x3')});};
\ No newline at end of file
+var _0xbdd7=['stopRecordingOnTransfer','../client','getSettings','Request'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xbdd7,0xed));var _0x7bdd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbdd7[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x7bdd('0x0'));exports[_0x7bdd('0x1')]=function(){return client[_0x7bdd('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7bdd('0x3')]},'log':'GetSettings'});};
\ No newline at end of file
index deb30d8..566c061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddb5=['getTemplates','GetTemplate','name'];(function(_0x4fd75e,_0x219e4a){var _0x5b6338=function(_0xf2969c){while(--_0xf2969c){_0x4fd75e['push'](_0x4fd75e['shift']());}};_0x5b6338(++_0x219e4a);}(_0xddb5,0x120));var _0x5ddb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xddb5[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0x5ddb('0x0')]=function(_0x146963){return function(_0xe58d5){return client['Request'](_0x5ddb('0x1'),{'options':{'raw':!![],'attributes':['id',_0x5ddb('0x2'),'html']},'log':_0x5ddb('0x1')});};};
\ No newline at end of file
+var _0x98d4=['Request','GetTemplate','name','../client','getTemplates'];(function(_0x4ac8ec,_0x69a838){var _0x10e36b=function(_0x2e79cd){while(--_0x2e79cd){_0x4ac8ec['push'](_0x4ac8ec['shift']());}};_0x10e36b(++_0x69a838);}(_0x98d4,0xa3));var _0x498d=function(_0x3f7dcf,_0x3440c5){_0x3f7dcf=_0x3f7dcf-0x0;var _0x56efd4=_0x98d4[_0x3f7dcf];return _0x56efd4;};'use strict';var client=require(_0x498d('0x0'));exports[_0x498d('0x1')]=function(_0x2fa630){return function(_0x211df2){return client[_0x498d('0x2')](_0x498d('0x3'),{'options':{'raw':!![],'attributes':['id',_0x498d('0x4'),'html']},'log':_0x498d('0x3')});};};
\ No newline at end of file
index 6143105..ecf88b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8838=['data2','data3','data5','data6','data7','getTriggers','Request','GetTrigger','name','channel','status','Condition','field','operator','value','Action','Actions','action','data1'];(function(_0x4fbbaf,_0x2fc638){var _0x8796c5=function(_0x238003){while(--_0x238003){_0x4fbbaf['push'](_0x4fbbaf['shift']());}};_0x8796c5(++_0x2fc638);}(_0x8838,0x148));var _0x8883=function(_0x3e4b8d,_0x3a4e42){_0x3e4b8d=_0x3e4b8d-0x0;var _0x41d9e0=_0x8838[_0x3e4b8d];return _0x41d9e0;};'use strict';var client=require('../client');exports[_0x8883('0x0')]=function(_0x2be000){return function(_0x21b5c8){return client[_0x8883('0x1')](_0x8883('0x2'),{'options':{'raw':![],'attributes':['id',_0x8883('0x3'),_0x8883('0x4'),_0x8883('0x5')],'include':[{'model':_0x8883('0x6'),'as':'AllConditions','attributes':['id',_0x8883('0x7'),_0x8883('0x8'),_0x8883('0x9')]},{'model':_0x8883('0x6'),'as':'AnyConditions','attributes':['id',_0x8883('0x7'),_0x8883('0x8'),_0x8883('0x9')]},{'model':_0x8883('0xa'),'as':_0x8883('0xb'),'attributes':['id',_0x8883('0xc'),_0x8883('0xd'),_0x8883('0xe'),_0x8883('0xf'),'data4',_0x8883('0x10'),_0x8883('0x11'),_0x8883('0x12')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0xe875=['data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','Condition','AllConditions','operator','value','field','Action','Actions','action','data1','data2','data3'];(function(_0x37b529,_0x6724e7){var _0x116152=function(_0x36d367){while(--_0x36d367){_0x37b529['push'](_0x37b529['shift']());}};_0x116152(++_0x6724e7);}(_0xe875,0x1d0));var _0x5e87=function(_0x1faea9,_0x47b85d){_0x1faea9=_0x1faea9-0x0;var _0xa1f8fb=_0xe875[_0x1faea9];return _0xa1f8fb;};'use strict';var client=require(_0x5e87('0x0'));exports[_0x5e87('0x1')]=function(_0x113f2a){return function(_0x22dfce){return client[_0x5e87('0x2')](_0x5e87('0x3'),{'options':{'raw':![],'attributes':['id',_0x5e87('0x4'),'channel','status'],'include':[{'model':_0x5e87('0x5'),'as':_0x5e87('0x6'),'attributes':['id','field',_0x5e87('0x7'),_0x5e87('0x8')]},{'model':'Condition','as':'AnyConditions','attributes':['id',_0x5e87('0x9'),'operator',_0x5e87('0x8')]},{'model':_0x5e87('0xa'),'as':_0x5e87('0xb'),'attributes':['id',_0x5e87('0xc'),_0x5e87('0xd'),_0x5e87('0xe'),_0x5e87('0xf'),_0x5e87('0x10'),_0x5e87('0x11'),_0x5e87('0x12'),_0x5e87('0x13')]}]},'log':_0x5e87('0x3')});};};
\ No newline at end of file
index d3a7d88..0c9f496 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x858e=['defaultuser','../client','Request','GetTrunk','registry'];(function(_0x563939,_0x35c59e){var _0xf0f55f=function(_0x4378d5){while(--_0x4378d5){_0x563939['push'](_0x563939['shift']());}};_0xf0f55f(++_0x35c59e);}(_0x858e,0x178));var _0xe858=function(_0x49ff3f,_0x531e8f){_0x49ff3f=_0x49ff3f-0x0;var _0x4f9703=_0x858e[_0x49ff3f];return _0x4f9703;};'use strict';var client=require(_0xe858('0x0'));exports['getTrunks']=function(_0x4fae34){return function(_0x20f8c7){return client[_0xe858('0x1')](_0xe858('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xe858('0x3'),_0xe858('0x4')]},'log':_0xe858('0x2')});};};
\ No newline at end of file
+var _0xac4e=['getTrunks','Request','registry','defaultuser','GetTrunk','../client'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0xac4e,0x1d9));var _0xeac4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xac4e[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0xeac4('0x0'));exports[_0xeac4('0x1')]=function(_0xdbb5d4){return function(_0x1e139a){return client[_0xeac4('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xeac4('0x3'),_0xeac4('0x4')]},'log':_0xeac4('0x5')});};};
\ No newline at end of file
index 1ed58fc..750e7df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x5820b7,_0x5d5a4c){var _0x58d2d8=function(_0x583372){while(--_0x583372){_0x5820b7['push'](_0x5820b7['shift']());}};_0x58d2d8(++_0x5d5a4c);}(_0x70e0,0x17b));var _0x070e=function(_0x93cddc,_0x19d44a){_0x93cddc=_0x93cddc-0x0;var _0x3dad23=_0x70e0[_0x93cddc];return _0x3dad23;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});};
\ No newline at end of file
+var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x59ca62,_0x30e03a){var _0x32f376=function(_0x1e3f47){while(--_0x1e3f47){_0x59ca62['push'](_0x59ca62['shift']());}};_0x32f376(++_0x30e03a);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});};
\ No newline at end of file
index c61fe2c..8b0d7d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa15e=['create','CreateVoiceAgentReport','Request','UpdateVoiceAgentReport'];(function(_0x5ccab3,_0x5c7df5){var _0x8a5eb3=function(_0x13156f){while(--_0x13156f){_0x5ccab3['push'](_0x5ccab3['shift']());}};_0x8a5eb3(++_0x5c7df5);}(_0xa15e,0x140));var _0xea15=function(_0x38e1de,_0xea0531){_0x38e1de=_0x38e1de-0x0;var _0x3372ae=_0xa15e[_0x38e1de];return _0x3372ae;};'use strict';var client=require('../client');exports[_0xea15('0x0')]=function(_0x25e400){return client['Request'](_0xea15('0x1'),{'body':_0x25e400,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x2773e3,_0x395e20,_0xb78a78){return client[_0xea15('0x2')]('UpdateVoiceAgentReport',{'body':_0x2773e3,'options':{'where':{'uniqueid':_0x395e20,'interface':_0xb78a78,'agentcomplete':!![]}},'log':_0xea15('0x3')});};
\ No newline at end of file
+var _0x060c=['Request','update','UpdateVoiceAgentReport','../client'];(function(_0x19f538,_0x1c9b95){var _0x206baa=function(_0x5e97b8){while(--_0x5e97b8){_0x19f538['push'](_0x19f538['shift']());}};_0x206baa(++_0x1c9b95);}(_0x060c,0x16b));var _0xc060=function(_0x42c6b3,_0x3133b3){_0x42c6b3=_0x42c6b3-0x0;var _0x5361f7=_0x060c[_0x42c6b3];return _0x5361f7;};'use strict';var client=require(_0xc060('0x0'));exports['create']=function(_0x5ccc69){return client[_0xc060('0x1')]('CreateVoiceAgentReport',{'body':_0x5ccc69,'log':'CreateVoiceAgentReport'});};exports[_0xc060('0x2')]=function(_0x42de35,_0x28f2ed,_0x446bd4){return client[_0xc060('0x1')]('UpdateVoiceAgentReport',{'body':_0x42de35,'options':{'where':{'uniqueid':_0x28f2ed,'interface':_0x446bd4,'agentcomplete':!![]}},'log':_0xc060('0x3')});};
\ No newline at end of file
index ad947d1..e2eda4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e4f=['day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf'];(function(_0x667d6,_0x2b1924){var _0x4882ac=function(_0x47a6ad){while(--_0x47a6ad){_0x667d6['push'](_0x667d6['shift']());}};_0x4882ac(++_0x2b1924);}(_0x6e4f,0x1ec));var _0xf6e4=function(_0x6b4a02,_0x1e23b0){_0x6b4a02=_0x6b4a02-0x0;var _0x51cf3e=_0x6e4f[_0x6b4a02];return _0x51cf3e;};'use strict';var moment=require(_0xf6e4('0x0'));var util=require('util');var _=require(_0xf6e4('0x1'));var client=require(_0xf6e4('0x2'));exports[_0xf6e4('0x3')]=function(_0x538b40){return client[_0xf6e4('0x4')](_0xf6e4('0x5'),{'body':_[_0xf6e4('0x6')](_0x538b40,{'source':_0x538b40[_0xf6e4('0x7')],'destinationcontext':_0x538b40[_0xf6e4('0x8')],'callerid':_0x538b40[_0xf6e4('0x9')],'amaflags':_0xf6e4('0xa')}),'log':_0xf6e4('0x5')});};exports[_0xf6e4('0xb')]=function(){return function(){return client[_0xf6e4('0x4')](_0xf6e4('0xc'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xf6e4('0xd')](_0xf6e4('0xe'))[_0xf6e4('0xf')](_0xf6e4('0x10')),moment()[_0xf6e4('0x11')](_0xf6e4('0xe'))['format'](_0xf6e4('0x10'))]}},'attributes':[_0xf6e4('0x12'),_0xf6e4('0x13'),_0xf6e4('0x14'),'billableseconds']},'log':_0xf6e4('0x15')});};};
\ No newline at end of file
+var _0x6c15=['Request','CreateVoiceCallReport','merge','context','getVoiceCallReports','outbound','day','YYYY-MM-DD\x20HH:mm:ss','format','type','duration','billableseconds','lodash','../client','create'];(function(_0x49a3bf,_0x3b5e65){var _0x2a4b89=function(_0x4412bc){while(--_0x4412bc){_0x49a3bf['push'](_0x49a3bf['shift']());}};_0x2a4b89(++_0x3b5e65);}(_0x6c15,0xcf));var _0x56c1=function(_0x5201a0,_0x388ee9){_0x5201a0=_0x5201a0-0x0;var _0x3926e2=_0x6c15[_0x5201a0];return _0x3926e2;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x56c1('0x0'));var client=require(_0x56c1('0x1'));exports[_0x56c1('0x2')]=function(_0x5a3502){return client[_0x56c1('0x3')](_0x56c1('0x4'),{'body':_[_0x56c1('0x5')](_0x5a3502,{'source':_0x5a3502['calleridnum'],'destinationcontext':_0x5a3502[_0x56c1('0x6')],'callerid':_0x5a3502['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x56c1('0x4')});};exports[_0x56c1('0x7')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x56c1('0x8')],'createdAt':{'$between':[moment()['startOf'](_0x56c1('0x9'))['format'](_0x56c1('0xa')),moment()['endOf'](_0x56c1('0x9'))[_0x56c1('0xb')](_0x56c1('0xa'))]}},'attributes':[_0x56c1('0xc'),'disposition',_0x56c1('0xd'),_0x56c1('0xe')]},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
index 0fcc2e5..2486a9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x787d=['Request','CreateVoiceDialReport','../client'];(function(_0x1f0794,_0x1e5fc4){var _0x243a0b=function(_0x3a8475){while(--_0x3a8475){_0x1f0794['push'](_0x1f0794['shift']());}};_0x243a0b(++_0x1e5fc4);}(_0x787d,0x125));var _0xd787=function(_0x29d2d2,_0x3344){_0x29d2d2=_0x29d2d2-0x0;var _0x3f6476=_0x787d[_0x29d2d2];return _0x3f6476;};'use strict';var client=require(_0xd787('0x0'));exports['create']=function(_0x461510){return client[_0xd787('0x1')](_0xd787('0x2'),{'body':_0x461510,'log':_0xd787('0x2')});};
\ No newline at end of file
+var _0x1577=['../client','create','Request','CreateVoiceDialReport'];(function(_0x20fdc1,_0xde1296){var _0x25397c=function(_0x814b51){while(--_0x814b51){_0x20fdc1['push'](_0x20fdc1['shift']());}};_0x25397c(++_0xde1296);}(_0x1577,0x1ec));var _0x7157=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1577[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x7157('0x0'));exports[_0x7157('0x1')]=function(_0x4cfbc2){return client[_0x7157('0x2')]('CreateVoiceDialReport',{'body':_0x4cfbc2,'log':_0x7157('0x3')});};
\ No newline at end of file
index a6b6cf6..52bfc74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e21=['Request','exten','../client','getVoiceExtensions'];(function(_0x49fda7,_0x1d84db){var _0x4c6f1f=function(_0x4c94f2){while(--_0x4c94f2){_0x49fda7['push'](_0x49fda7['shift']());}};_0x4c6f1f(++_0x1d84db);}(_0x2e21,0xba));var _0x12e2=function(_0x4d61b0,_0x31cf29){_0x4d61b0=_0x4d61b0-0x0;var _0x56a492=_0x2e21[_0x4d61b0];return _0x56a492;};'use strict';var client=require(_0x12e2('0x0'));exports[_0x12e2('0x1')]=function(){return function(){return client[_0x12e2('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x12e2('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x12e2('0x1')});};};
\ No newline at end of file
+var _0xd66c=['exten','recordingFormat','../client','Request','GetVoiceExtension'];(function(_0x5736aa,_0x4b9a16){var _0x338878=function(_0x3a92da){while(--_0x3a92da){_0x5736aa['push'](_0x5736aa['shift']());}};_0x338878(++_0x4b9a16);}(_0xd66c,0x106));var _0xcd66=function(_0x5c4763,_0x5cad80){_0x5c4763=_0x5c4763-0x0;var _0x1f40ea=_0xd66c[_0x5c4763];return _0x1f40ea;};'use strict';var client=require(_0xcd66('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xcd66('0x1')](_0xcd66('0x2'),{'options':{'raw':!![],'attributes':['id',_0xcd66('0x3'),_0xcd66('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
index b1341fe..644c8ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fce=['mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0x5fce,0x1ce));var _0xe5fc=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5fce[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0xe5fc('0x0'));exports[_0xe5fc('0x1')]=function(){return function(){return client[_0xe5fc('0x2')](_0xe5fc('0x3'),{'options':{'raw':![],'attributes':['id',_0xe5fc('0x4'),_0xe5fc('0x5'),_0xe5fc('0x6'),_0xe5fc('0x7'),'monitor_format',_0xe5fc('0x8'),_0xe5fc('0x9'),_0xe5fc('0xa'),'dialLimitChannel',_0xe5fc('0xb'),'dialPowerLevel',_0xe5fc('0xc'),'dialPredictiveOptimizationPercentage',_0xe5fc('0xd'),_0xe5fc('0xe'),'dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout',_0xe5fc('0xf'),_0xe5fc('0x10'),_0xe5fc('0x11'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0xe5fc('0x12'),_0xe5fc('0x13'),_0xe5fc('0x14'),'dialTimezone',_0xe5fc('0x15'),_0xe5fc('0x16'),'dialCheckDuplicateType',_0xe5fc('0x17'),_0xe5fc('0x18'),_0xe5fc('0x19'),_0xe5fc('0x1a'),_0xe5fc('0x1b'),_0xe5fc('0x1c'),_0xe5fc('0x1d'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0xe5fc('0x1e'),_0xe5fc('0x1f'),'dialRecallMeTimeout',_0xe5fc('0x20'),_0xe5fc('0x21'),'dialAgiAfterHangupAgent',_0xe5fc('0x22'),_0xe5fc('0x23'),_0xe5fc('0x24'),_0xe5fc('0x25'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0xe5fc('0x26'),'dialNoSuchNumberRetryFrequency',_0xe5fc('0x27'),_0xe5fc('0x28'),_0xe5fc('0x29'),_0xe5fc('0x2a'),_0xe5fc('0x2b'),_0xe5fc('0x2c'),'dialAgentRejectMaxRetry',_0xe5fc('0x2d'),_0xe5fc('0x2e'),_0xe5fc('0x2f'),_0xe5fc('0x30')],'include':[{'model':'Trunk','as':_0xe5fc('0x31'),'attributes':['id',_0xe5fc('0x4'),'callerid',_0xe5fc('0x32')]},{'model':'Pause','as':_0xe5fc('0x33'),'attributes':['id',_0xe5fc('0x4')]},{'model':_0xe5fc('0x31'),'as':_0xe5fc('0x34'),'attributes':['id',_0xe5fc('0x4'),_0xe5fc('0x35'),_0xe5fc('0x32')]},{'model':'Interval','as':_0xe5fc('0x36'),'attributes':['id','name'],'include':[{'model':_0xe5fc('0x36'),'as':_0xe5fc('0x37'),'attributes':['id','name',_0xe5fc('0x38')]}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
+var _0x6bfd=['TrunkBackup','callerid','Interval','interval','../client','Request','GetVoiceQueue','name','acwTimeout','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause'];(function(_0x573b26,_0x749145){var _0x1d050c=function(_0x8511d1){while(--_0x8511d1){_0x573b26['push'](_0x573b26['shift']());}};_0x1d050c(++_0x749145);}(_0x6bfd,0x1bd));var _0xd6bf=function(_0x2503dc,_0x24d155){_0x2503dc=_0x2503dc-0x0;var _0x317eb8=_0x6bfd[_0x2503dc];return _0x317eb8;};'use strict';var client=require(_0xd6bf('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xd6bf('0x1')](_0xd6bf('0x2'),{'options':{'raw':![],'attributes':['id',_0xd6bf('0x3'),'acw',_0xd6bf('0x4'),'autopause',_0xd6bf('0x5'),_0xd6bf('0x6'),_0xd6bf('0x7'),'dialMethod',_0xd6bf('0x8'),_0xd6bf('0x9'),_0xd6bf('0xa'),_0xd6bf('0xb'),_0xd6bf('0xc'),_0xd6bf('0xd'),'dialOriginateCallerIdName',_0xd6bf('0xe'),'dialOriginateTimeout',_0xd6bf('0xf'),_0xd6bf('0x10'),_0xd6bf('0x11'),_0xd6bf('0x12'),_0xd6bf('0x13'),_0xd6bf('0x14'),_0xd6bf('0x15'),_0xd6bf('0x16'),_0xd6bf('0x17'),_0xd6bf('0x18'),_0xd6bf('0x19'),_0xd6bf('0x1a'),'dialPrefix',_0xd6bf('0x1b'),'dialAMDActive',_0xd6bf('0x1c'),_0xd6bf('0x1d'),_0xd6bf('0x1e'),_0xd6bf('0x1f'),'dialAMDMinWordLength',_0xd6bf('0x20'),_0xd6bf('0x21'),_0xd6bf('0x22'),_0xd6bf('0x23'),_0xd6bf('0x24'),_0xd6bf('0x25'),_0xd6bf('0x26'),_0xd6bf('0x27'),_0xd6bf('0x28'),_0xd6bf('0x29'),_0xd6bf('0x2a'),_0xd6bf('0x5'),_0xd6bf('0x2b'),_0xd6bf('0x2c'),'dialCutDigit',_0xd6bf('0x2d'),_0xd6bf('0x2e'),_0xd6bf('0x2f'),_0xd6bf('0x30'),'dialAbandonedMaxRetry',_0xd6bf('0x31'),_0xd6bf('0x32'),_0xd6bf('0x33'),'dialAgentRejectMaxRetry',_0xd6bf('0x34'),'mandatoryDisposition',_0xd6bf('0x35'),_0xd6bf('0x36')],'include':[{'model':_0xd6bf('0x37'),'as':'Trunk','attributes':['id',_0xd6bf('0x3'),'callerid',_0xd6bf('0x38')]},{'model':_0xd6bf('0x39'),'as':_0xd6bf('0x3a'),'attributes':['id',_0xd6bf('0x3')]},{'model':_0xd6bf('0x37'),'as':_0xd6bf('0x3b'),'attributes':['id',_0xd6bf('0x3'),_0xd6bf('0x3c'),_0xd6bf('0x38')]},{'model':_0xd6bf('0x3d'),'as':_0xd6bf('0x3d'),'attributes':['id',_0xd6bf('0x3')],'include':[{'model':_0xd6bf('0x3d'),'as':'Intervals','attributes':['id','name',_0xd6bf('0x3e')]}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
index 798d4af..b91ca8c 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(_0x1a62aa,_0x27f866){var _0x913e84=function(_0x47d5c5){while(--_0x47d5c5){_0x1a62aa['push'](_0x1a62aa['shift']());}};_0x913e84(++_0x27f866);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x237293,_0x1c81f0){var _0x1c01af=function(_0x2d4384){while(--_0x2d4384){_0x237293['push'](_0x237293['shift']());}};_0x1c01af(++_0x1c81f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 ea87319..81c3cae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fed=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x61953a,_0x385ac6){var _0x4004b2=function(_0x10f073){while(--_0x10f073){_0x61953a['push'](_0x61953a['shift']());}};_0x4004b2(++_0x385ac6);}(_0x7fed,0x71));var _0xd7fe=function(_0x5a29b5,_0x3e106a){_0x5a29b5=_0x5a29b5-0x0;var _0x38babe=_0x7fed[_0x5a29b5];return _0x38babe;};'use strict';var client=require(_0xd7fe('0x0'));exports[_0xd7fe('0x1')]=function(_0x5f4754){return function(){return client['Request'](_0xd7fe('0x2'),{'options':{'where':{'VoiceQueueId':_0x5f4754,'paused':!![]},'raw':!![]},'log':_0xd7fe('0x1')});};};
\ No newline at end of file
+var _0xbf55=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbf55,0xd9));var _0x5bf5=function(_0x1f85f7,_0x59d6c2){_0x1f85f7=_0x1f85f7-0x0;var _0x596d20=_0xbf55[_0x1f85f7];return _0x596d20;};'use strict';var client=require(_0x5bf5('0x0'));exports[_0x5bf5('0x1')]=function(_0x4be0bb){return function(){return client[_0x5bf5('0x2')](_0x5bf5('0x3'),{'options':{'where':{'VoiceQueueId':_0x4be0bb,'paused':!![]},'raw':!![]},'log':_0x5bf5('0x1')});};};
\ No newline at end of file
index 15fbf64..9f376ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0xed09d9,_0x193b6f){var _0x492860=function(_0x1b01f1){while(--_0x1b01f1){_0xed09d9['push'](_0xed09d9['shift']());}};_0x492860(++_0x193b6f);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x5725d7,_0x3625b7){var _0x4b8424=function(_0x52da11){while(--_0x52da11){_0x5725d7['push'](_0x5725d7['shift']());}};_0x4b8424(++_0x3625b7);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
index ff81029..fad147c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd442=['transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','extension','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetlinkedid','isexternal','origtransferercontext','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result'];(function(_0x53da0e,_0x2c4eb0){var _0x3a6ae7=function(_0xbcafb3){while(--_0xbcafb3){_0x53da0e['push'](_0x53da0e['shift']());}};_0x3a6ae7(++_0x2c4eb0);}(_0xd442,0x163));var _0x2d44=function(_0xa5f8e4,_0x4eacfe){_0xa5f8e4=_0xa5f8e4-0x0;var _0x3ac236=_0xd442[_0xa5f8e4];return _0x3ac236;};'use strict';var client=require(_0x2d44('0x0'));exports['transfers']={};exports[_0x2d44('0x1')]=function(_0x334d0d){return client[_0x2d44('0x2')](_0x2d44('0x3'),{'body':{'result':_0x334d0d[_0x2d44('0x4')],'transfererchannel':_0x334d0d[_0x2d44('0x5')],'transferercalleridnum':_0x334d0d[_0x2d44('0x6')],'transferercalleridname':_0x334d0d[_0x2d44('0x7')],'transfererconnectedlinenum':_0x334d0d['transfererconnectedlinenum'],'transfererconnectedlinename':_0x334d0d[_0x2d44('0x8')],'transfereraccountcode':_0x334d0d[_0x2d44('0x9')],'transferercontext':_0x334d0d['transferercontext'],'transfererexten':_0x334d0d['transfererexten'],'transfererlinkedid':_0x334d0d[_0x2d44('0xa')],'transfereechannel':_0x334d0d[_0x2d44('0xb')],'transfereecalleridnum':_0x334d0d[_0x2d44('0xc')],'transfereecalleridname':_0x334d0d[_0x2d44('0xd')],'transfereeconnectedlinenum':_0x334d0d[_0x2d44('0xe')],'transfereeconnectedlinename':_0x334d0d[_0x2d44('0xf')],'transfereeaccountcode':_0x334d0d[_0x2d44('0x10')],'transfereecontext':_0x334d0d[_0x2d44('0x11')],'transfereeexten':_0x334d0d['transfereeexten'],'transfereelinkedid':_0x334d0d[_0x2d44('0x12')],'isexternal':_0x334d0d['isexternal'],'context':_0x334d0d['context'],'extension':_0x334d0d[_0x2d44('0x13')],'type':'blind'},'log':_0x2d44('0x3')});};exports[_0x2d44('0x14')]=function(_0x44a64c){return client[_0x2d44('0x2')](_0x2d44('0x3'),{'body':{'result':_0x44a64c[_0x2d44('0x4')],'transfererchannel':_0x44a64c[_0x2d44('0x15')],'transferercalleridnum':_0x44a64c[_0x2d44('0x16')],'transferercalleridname':_0x44a64c[_0x2d44('0x17')],'transfererconnectedlinenum':_0x44a64c[_0x2d44('0x18')],'transfererconnectedlinename':_0x44a64c['secondtransfererconnectedlinename'],'transfereraccountcode':_0x44a64c[_0x2d44('0x19')],'transferercontext':_0x44a64c[_0x2d44('0x1a')],'transfererexten':_0x44a64c['secondtransfererexten'],'transfererlinkedid':_0x44a64c[_0x2d44('0x1b')],'transfereechannel':_0x44a64c[_0x2d44('0x1c')],'transfereecalleridnum':_0x44a64c[_0x2d44('0x1d')],'transfereecalleridname':_0x44a64c[_0x2d44('0x1e')],'transfereeconnectedlinenum':_0x44a64c['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x44a64c[_0x2d44('0x1f')],'transfereeaccountcode':_0x44a64c['transfertargetaccountcode'],'transfereecontext':_0x44a64c['transfertargetcontext'],'transfereeexten':_0x44a64c['transfertargetexten'],'transfereelinkedid':_0x44a64c[_0x2d44('0x20')],'isexternal':_0x44a64c[_0x2d44('0x21')],'context':_0x44a64c[_0x2d44('0x22')],'extension':_0x44a64c['origtransfererexten'],'type':_0x2d44('0x23')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
+var _0xf522=['extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal'];(function(_0x2ca454,_0x285eb5){var _0xaa0037=function(_0x2eaef1){while(--_0x2eaef1){_0x2ca454['push'](_0x2ca454['shift']());}};_0xaa0037(++_0x285eb5);}(_0xf522,0x178));var _0x2f52=function(_0x2819be,_0x4d32c5){_0x2819be=_0x2819be-0x0;var _0x35b0b2=_0xf522[_0x2819be];return _0x35b0b2;};'use strict';var client=require(_0x2f52('0x0'));exports['transfers']={};exports[_0x2f52('0x1')]=function(_0x433ec5){return client[_0x2f52('0x2')](_0x2f52('0x3'),{'body':{'result':_0x433ec5[_0x2f52('0x4')],'transfererchannel':_0x433ec5[_0x2f52('0x5')],'transferercalleridnum':_0x433ec5[_0x2f52('0x6')],'transferercalleridname':_0x433ec5[_0x2f52('0x7')],'transfererconnectedlinenum':_0x433ec5[_0x2f52('0x8')],'transfererconnectedlinename':_0x433ec5['transfererconnectedlinename'],'transfereraccountcode':_0x433ec5['transfereraccountcode'],'transferercontext':_0x433ec5[_0x2f52('0x9')],'transfererexten':_0x433ec5[_0x2f52('0xa')],'transfererlinkedid':_0x433ec5[_0x2f52('0xb')],'transfereechannel':_0x433ec5[_0x2f52('0xc')],'transfereecalleridnum':_0x433ec5[_0x2f52('0xd')],'transfereecalleridname':_0x433ec5['transfereecalleridname'],'transfereeconnectedlinenum':_0x433ec5[_0x2f52('0xe')],'transfereeconnectedlinename':_0x433ec5[_0x2f52('0xf')],'transfereeaccountcode':_0x433ec5['transfereeaccountcode'],'transfereecontext':_0x433ec5[_0x2f52('0x10')],'transfereeexten':_0x433ec5[_0x2f52('0x11')],'transfereelinkedid':_0x433ec5[_0x2f52('0x12')],'isexternal':_0x433ec5[_0x2f52('0x13')],'context':_0x433ec5['context'],'extension':_0x433ec5[_0x2f52('0x14')],'type':_0x2f52('0x15')},'log':_0x2f52('0x3')});};exports[_0x2f52('0x16')]=function(_0x1cf669){return client[_0x2f52('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x1cf669[_0x2f52('0x4')],'transfererchannel':_0x1cf669[_0x2f52('0x17')],'transferercalleridnum':_0x1cf669[_0x2f52('0x18')],'transferercalleridname':_0x1cf669[_0x2f52('0x19')],'transfererconnectedlinenum':_0x1cf669[_0x2f52('0x1a')],'transfererconnectedlinename':_0x1cf669[_0x2f52('0x1b')],'transfereraccountcode':_0x1cf669[_0x2f52('0x1c')],'transferercontext':_0x1cf669[_0x2f52('0x1d')],'transfererexten':_0x1cf669[_0x2f52('0x1e')],'transfererlinkedid':_0x1cf669[_0x2f52('0x1f')],'transfereechannel':_0x1cf669[_0x2f52('0x20')],'transfereecalleridnum':_0x1cf669[_0x2f52('0x21')],'transfereecalleridname':_0x1cf669[_0x2f52('0x22')],'transfereeconnectedlinenum':_0x1cf669[_0x2f52('0x23')],'transfereeconnectedlinename':_0x1cf669[_0x2f52('0x24')],'transfereeaccountcode':_0x1cf669[_0x2f52('0x25')],'transfereecontext':_0x1cf669[_0x2f52('0x26')],'transfereeexten':_0x1cf669[_0x2f52('0x27')],'transfereelinkedid':_0x1cf669[_0x2f52('0x28')],'isexternal':_0x1cf669[_0x2f52('0x13')],'context':_0x1cf669[_0x2f52('0x29')],'extension':_0x1cf669[_0x2f52('0x2a')],'type':_0x2f52('0x2b')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
index 91354d3..6665137 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b1b=['join','Command','content','catch','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','ai(mixmonitorid)','find','monitors','toLowerCase','/var/spool/asterisk/monitor/','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','StopMixMonitor','stop','wav','Hangup','queueChannels','exten','context','telephones','trunks','outboundChannels','campaigns','event','emit','custom:','send','server','http','127.0.0.1','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','SIP','timer','timers','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','action','Reload','Action','then','message'];(function(_0x3e2c1e,_0x1e8d40){var _0x1c6666=function(_0x190b73){while(--_0x190b73){_0x3e2c1e['push'](_0x3e2c1e['shift']());}};_0x1c6666(++_0x1e8d40);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x6b1b[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require('lodash');var util=require(_0xb6b1('0x0'));var jayson=require(_0xb6b1('0x1'));var schema=require(_0xb6b1('0x2'));var BPromise=require('bluebird');var moment=require(_0xb6b1('0x3'));var config=require(_0xb6b1('0x4'));var properties=require(_0xb6b1('0x5'));var ami=require(_0xb6b1('0x6'));exports[_0xb6b1('0x7')]=function(_0x345886,_0x41bf3e,_0x113a39){return new BPromise(function(_0x1ff716,_0x13334e){var _0x1a4cd0={'QueuePause':function(_0x5b440a){return new Promise(function(_0x2734cc,_0x52aa76){var _0x4da7d3=util[_0xb6b1('0x8')]('%s/%s',_0xb6b1('0x9'),_0x5b440a['name']);if(_0x345886['timers']&&_0x345886['timers'][_0x4da7d3]&&_0x345886['timers'][_0x4da7d3][_0xb6b1('0xa')]){_0x345886[_0xb6b1('0xb')][_0x4da7d3]['updateAcw']();}if(_0x345886[_0xb6b1('0xc')][_0x4da7d3]){_0x345886['agents'][_0x4da7d3]['updateStatusRealtime']({'statePause':_0x5b440a[_0xb6b1('0xd')]?!![]:![]});}_0x2734cc({'code':0xc8,'message':_0xb6b1('0xe')});});},'Reload':function(_0x12f3ff){var _0x327eee=this;return new Promise(function(_0x23881d,_0x18f6b5){if(ami[_0xb6b1('0xf')]()==![]){return _0x18f6b5(_0x327eee[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')]['join']('\x20')));}_0x12f3ff=_['pick'](_0x12f3ff,_['keys'](properties['module']));_0x12f3ff[_0xb6b1('0x14')]=_0xb6b1('0x15');return ami[_0xb6b1('0x16')](_0x12f3ff)[_0xb6b1('0x17')](function(_0x32e395){_0x23881d({'code':0xc8,'message':_0x32e395[_0xb6b1('0x18')]});})['catch'](function(_0x581e28){_0x18f6b5(_0x327eee[_0xb6b1('0x10')](0x1f5,_0x581e28[_0xb6b1('0x18')]));});});},'Command':function(_0x16d969){var _0x11e8ae=this;return new Promise(function(_0x45d9e6,_0x3fc9b1){if(ami['isConnected']()==![]){return _0x3fc9b1(_0x11e8ae['error'](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')]['username'],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}_0x16d969=_['pick'](_0x16d969,'command');_0x16d969[_0xb6b1('0x14')]=_0xb6b1('0x1a');return ami[_0xb6b1('0x16')](_0x16d969)[_0xb6b1('0x17')](function(_0x164952){_0x45d9e6({'code':0xc8,'message':_0x164952[_0xb6b1('0x1b')]});})[_0xb6b1('0x1c')](function(_0x3b1ff7){_0x3fc9b1(_0x11e8ae[_0xb6b1('0x10')](0x1f5,_0x3b1ff7[_0xb6b1('0x18')]));});});},'VoiceQueues':function(_0x5069cd){return new Promise(function(_0x214cd0,_0x4f1e2e){var _0xd8e094=[];for(var _0x5864d6 in _0x345886[_0xb6b1('0x1d')]){if(_0x345886['voiceQueues'][_0xb6b1('0x1e')](_0x5864d6)){var _0x387603=_0x345886[_0xb6b1('0x1d')][_0x5864d6];var _0x178401={'id':_0x387603['id'],'name':_0x387603[_0xb6b1('0x1f')],'strategy':_0x387603[_0xb6b1('0x20')],'answered':_0x387603[_0xb6b1('0x21')],'available':_0x387603[_0xb6b1('0x22')],'loggedIn':_0x387603[_0xb6b1('0x23')],'pTalking':_0x387603['pTalking'],'sumBillable':_0x387603[_0xb6b1('0x24')],'sumDuration':_0x387603['sumDuration'],'sumHoldTime':_0x387603[_0xb6b1('0x25')]||0x0,'talking':_0x387603[_0xb6b1('0x26')],'total':_0x387603[_0xb6b1('0x27')],'type':_0x387603[_0xb6b1('0x28')],'unmanaged':_0x387603[_0xb6b1('0x29')],'abandoned':_0x387603[_0xb6b1('0x2a')],'waiting':_0x387603[_0xb6b1('0x2b')],'loggedInDb':_0x387603['loggedInDb']};if(_0x387603[_0xb6b1('0x28')]===_0xb6b1('0x2c')){_0x178401[_0xb6b1('0x2d')]=_0x387603['dialActive'];_0x178401[_0xb6b1('0x2e')]=_0x387603[_0xb6b1('0x2e')];_0x178401['dialOriginateCallerIdName']=_0x387603[_0xb6b1('0x2f')];_0x178401[_0xb6b1('0x30')]=_0x387603[_0xb6b1('0x30')];_0x178401[_0xb6b1('0x31')]=_0x387603[_0xb6b1('0x31')];_0x178401[_0xb6b1('0x32')]=_0x387603['dialPrefix'];_0x178401[_0xb6b1('0x33')]=_0x387603[_0xb6b1('0x33')];_0x178401['outboundAnswerAgiCallsDay']=_0x387603[_0xb6b1('0x34')];_0x178401['outboundAnswerCallsDay']=_0x387603[_0xb6b1('0x35')];_0x178401[_0xb6b1('0x36')]=_0x387603[_0xb6b1('0x36')];_0x178401[_0xb6b1('0x37')]=_0x387603[_0xb6b1('0x37')];_0x178401[_0xb6b1('0x38')]=_0x387603['outboundCongestionCallsDay'];_0x178401[_0xb6b1('0x39')]=_0x387603[_0xb6b1('0x39')];_0x178401[_0xb6b1('0x3a')]=_0x387603[_0xb6b1('0x3a')];_0x178401['outboundDropCallsDayTimeout']=_0x387603['outboundDropCallsDayTimeout'];_0x178401['outboundNoAnswerCallsDay']=_0x387603[_0xb6b1('0x3b')];_0x178401[_0xb6b1('0x3c')]=_0x387603[_0xb6b1('0x3c')];_0x178401[_0xb6b1('0x3d')]=_0x387603[_0xb6b1('0x3d')];_0x178401[_0xb6b1('0x3e')]=_0x387603[_0xb6b1('0x3e')];_0x178401[_0xb6b1('0x3f')]=_0x387603[_0xb6b1('0x3f')];_0x178401[_0xb6b1('0x40')]=_0x387603[_0xb6b1('0x40')];_0x178401[_0xb6b1('0x41')]=_0x387603['predictiveIntervalAnsweredCalls'];_0x178401[_0xb6b1('0x42')]=_0x387603[_0xb6b1('0x42')];_0x178401[_0xb6b1('0x43')]=_0x387603[_0xb6b1('0x43')];_0x178401[_0xb6b1('0x44')]=_0x387603[_0xb6b1('0x44')];_0x178401[_0xb6b1('0x45')]=_0x387603[_0xb6b1('0x45')];_0x178401[_0xb6b1('0x46')]=_0x387603[_0xb6b1('0x46')];_0x178401[_0xb6b1('0x47')]=_0x387603['predictiveIntervalErlangCallsDroppedCalls'];_0x178401[_0xb6b1('0x48')]=_0x387603[_0xb6b1('0x48')];_0x178401[_0xb6b1('0x49')]=_0x387603[_0xb6b1('0x49')];_0x178401[_0xb6b1('0x4a')]=_0x387603[_0xb6b1('0x4a')];_0x178401[_0xb6b1('0x4b')]=_0x387603[_0xb6b1('0x4b')];_0x178401['predictiveIntervalTotalCalls']=_0x387603['predictiveIntervalTotalCalls'];_0x178401[_0xb6b1('0x18')]=_0x387603[_0xb6b1('0x18')];_0x178401[_0xb6b1('0x4c')]=_0x387603['originated'];_0x178401[_0xb6b1('0x4d')]=_0x387603[_0xb6b1('0x4d')];_0x178401[_0xb6b1('0x4e')]=_0x387603[_0xb6b1('0x4e')];_0x178401[_0xb6b1('0x4f')]=_0x387603[_0xb6b1('0x4f')];_0x178401[_0xb6b1('0x50')]=_0x387603[_0xb6b1('0x50')];_0x178401['startPredictive']=_0x387603[_0xb6b1('0x51')];_0x178401['startProgressive']=_0x387603[_0xb6b1('0x52')];}if(_0x387603[_0xb6b1('0x53')]){_0x178401[_0xb6b1('0x53')]={'id':_0x387603[_0xb6b1('0x53')]['id'],'name':_0x387603[_0xb6b1('0x53')][_0xb6b1('0x1f')],'active':_0x387603['Trunk'][_0xb6b1('0x54')],'callerid':_0x387603[_0xb6b1('0x53')]['callerid']};}if(_0x387603[_0xb6b1('0x55')]){_0x178401['Interval']={'id':_0x387603[_0xb6b1('0x55')]['id'],'name':_0x387603[_0xb6b1('0x55')][_0xb6b1('0x1f')]};}_0xd8e094[_0xb6b1('0x56')](_0x178401);}}_0x214cd0({'count':_0xd8e094[_0xb6b1('0x57')],'rows':_0xd8e094});});},'UpdateVoiceQueue':function(_0x20489a){return new Promise(function(_0x19cc0f,_0x31a6c7){var _0x1d5b09=_['find'](_0x345886['voiceQueues'],{'id':parseInt(_0x20489a['id'])});var _0x3826bd=_[_0xb6b1('0x58')](_0x20489a,['id']);if(_0x1d5b09){for(var _0x5959ca in _0x3826bd){if(typeof _0x3826bd[_0x5959ca]!==_0xb6b1('0x59')&&typeof _0x1d5b09[_0x5959ca]!==_0xb6b1('0x59')){_0x1d5b09[_0x5959ca]=_0x3826bd[_0x5959ca];}}_0x19cc0f(_0x1d5b09);}else{_0x31a6c7();}});},'VoiceChannels':function(_0x6f7b41){return new Promise(function(_0x1a95cf,_0x7cebdc){var _0x505a80=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x5b')]);_0x1a95cf({'count':_0x505a80[_0xb6b1('0x57')],'rows':_0x505a80});});},'VoiceChannelMixMonitor':function(_0x3f02bc){var _0x4da826=this;return new Promise(function(_0x5bfd0e,_0x20e93b){if(ami['isConnected']()==![]){return _0x20e93b(_0x4da826[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config['asterisk'][_0xb6b1('0x12')],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}var _0x7d4763=schema(properties[_0xb6b1('0x5c')])[_0xb6b1('0x2')](_0x3f02bc);if(_0x7d4763[_0xb6b1('0x57')]>0x0){return _0x20e93b(_0x4da826[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x7d4763,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x2700ed=_['find'](_0x345886[_0xb6b1('0x5b')],{'uniqueid':_0x3f02bc[_0xb6b1('0x5e')]});if(_0x2700ed&&_0x2700ed[_0xb6b1('0x5f')]){var _0x39c0d9=util[_0xb6b1('0x8')](_0xb6b1('0x60'),_0x3f02bc[_0xb6b1('0x61')]||_0x3f02bc[_0xb6b1('0x5e')],_0x3f02bc[_0xb6b1('0x8')]||'wav');return ami[_0xb6b1('0x16')]({'action':'MixMonitor','channel':_0x2700ed['channel'],'file':_0x39c0d9,'options':_0xb6b1('0x62')})[_0xb6b1('0x17')](function(_0x5be7bf){var _0x3b482b=_[_0xb6b1('0x63')](_0x2700ed[_0xb6b1('0x64')],{'filename':'/var/spool/asterisk/monitor/'+_0x39c0d9[_0xb6b1('0x65')]()});if(_['isNil'](_0x3b482b)){_0x2700ed['monitors'][_0xb6b1('0x56')]({'filename':_0xb6b1('0x66')+_0x39c0d9['toLowerCase'](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5be7bf[_0xb6b1('0x67')],'status':'rec'});}else{_0x3b482b['mixmonitorid']=_0x5be7bf['mixmonitorid'];_0x3b482b[_0xb6b1('0x68')]=_0xb6b1('0x69');}_0x5bfd0e({'code':0xc8,'message':[_0x3f02bc[_0xb6b1('0x5e')],_0xb6b1('0x6a'),_0x5be7bf[_0xb6b1('0x67')]][_0xb6b1('0x19')]('\x20'),'mixmonitorid':_0x5be7bf['mixmonitorid']});})[_0xb6b1('0x1c')](function(_0x322e35){_0x20e93b(_0x4da826['error'](0x1f5,[_0x3f02bc['uniqueid'],_0x322e35[_0xb6b1('0x18')][_0xb6b1('0x65')]()]['join']('\x20')));});}else{return _0x20e93b(_0x4da826['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x484afc){var _0x463482=this;return new Promise(function(_0x1ce8a2,_0x4a07ed){if(ami[_0xb6b1('0xf')]()==![]){return _0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')][_0xb6b1('0x19')]('\x20')));}var _0x35aae0=schema(properties[_0xb6b1('0x5c')])[_0xb6b1('0x2')](_0x484afc);if(_0x35aae0['length']>0x0){return _0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x35aae0,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x4a7796=_[_0xb6b1('0x63')](_0x345886[_0xb6b1('0x5b')],{'uniqueid':_0x484afc[_0xb6b1('0x5e')]});if(_0x4a7796){return BPromise[_0xb6b1('0x6c')]()[_0xb6b1('0x17')](function(){if(_0x4a7796[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':'StopMixMonitor','channel':_0x4a7796['channel'],'mixmonitorid':_0x484afc[_0xb6b1('0x67')]})['catch'](function(_0x2e91fa){});}})[_0xb6b1('0x17')](function(){if(_0x4a7796[_0xb6b1('0x6d')]){return ami['Action']({'action':_0xb6b1('0x6e'),'channel':_0x4a7796[_0xb6b1('0x6d')],'mixmonitorid':_0x484afc[_0xb6b1('0x67')]})[_0xb6b1('0x1c')](function(_0x463112){});}})['then'](function(_0x4ddcf3){var _0x11e94e=_[_0xb6b1('0x63')](_0x4a7796[_0xb6b1('0x64')],{'mixmonitorid':_0x484afc[_0xb6b1('0x67')]});if(_0x11e94e){_0x11e94e[_0xb6b1('0x68')]=_0xb6b1('0x6f');}})[_0xb6b1('0x17')](function(){var _0x3d6edf=util[_0xb6b1('0x8')](_0xb6b1('0x60'),_0x484afc[_0xb6b1('0x61')]||_0x484afc[_0xb6b1('0x5e')],_0x484afc['format']||_0xb6b1('0x70'));var _0x49ace7=_[_0xb6b1('0x63')](_0x4a7796[_0xb6b1('0x64')],{'filename':_0xb6b1('0x66')+_0x3d6edf['toLowerCase']()});if(_0x49ace7){_0x49ace7[_0xb6b1('0x68')]='stop';}})['then'](function(){_0x1ce8a2({'code':0xc8,'message':[_0x484afc[_0xb6b1('0x5e')],'StopMixMonitor\x20Success'][_0xb6b1('0x19')]('\x20')});})[_0xb6b1('0x1c')](function(_0x509667){_0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f5,[_0x484afc['uniqueid'],_0x509667[_0xb6b1('0x18')][_0xb6b1('0x65')]()][_0xb6b1('0x19')]('\x20')));});}else{return _0x4a07ed(_0x463482['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceQueuesChannels':function(_0x4ef26a){return new Promise(function(_0x20f2f2,_0x469f7f){var _0x3e1695=_[_0xb6b1('0x5a')](_0x345886['queueChannels']);_0x20f2f2({'count':_0x3e1695[_0xb6b1('0x57')],'rows':_0x3e1695});});},'VoiceQueuesChannel':function(_0x410fe6){var _0x3e663d=this;return new Promise(function(_0xb611fa,_0x381793){var _0x2aa294=schema(properties['voicequeuechannel'])[_0xb6b1('0x2')](_0x410fe6);if(_0x2aa294[_0xb6b1('0x57')]>0x0){return _0x381793(_0x3e663d[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x2aa294,'message')[_0xb6b1('0x19')](',\x20')));}var _0x1c4bde=_['find'](_0x345886['queueChannels'],{'uniqueid':_0x410fe6['uniqueid']});if(_0x1c4bde){_0xb611fa(_0x1c4bde);}else{return _0x381793(_0x3e663d['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x439b23){var _0x17ce08=this;return new Promise(function(_0xc203ce,_0x1d039a){if(ami[_0xb6b1('0xf')]()==![]){return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xb6b1('0x11')]['username'],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}var _0x28213e=schema(properties['voicequeuechannelhangup'])[_0xb6b1('0x2')](_0x439b23);if(_0x28213e[_0xb6b1('0x57')]>0x0){return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x28213e,_0xb6b1('0x18'))['join'](',\x20')));}var _0x3d96c6=_[_0xb6b1('0x63')](_0x345886['queueChannels'],{'uniqueid':_0x439b23['uniqueid']});if(_0x3d96c6&&_0x3d96c6[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':_0xb6b1('0x71'),'channel':_0x3d96c6[_0xb6b1('0x5f')]})[_0xb6b1('0x17')](function(_0x28860e){_0xc203ce({'code':0xc8,'message':[_0x439b23[_0xb6b1('0x5e')],_0x28860e[_0xb6b1('0x18')][_0xb6b1('0x65')]()]['join']('\x20')});})[_0xb6b1('0x1c')](function(_0x57fd39){_0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f5,[_0x439b23[_0xb6b1('0x5e')],_0x57fd39[_0xb6b1('0x18')]['toLowerCase']()][_0xb6b1('0x19')]('\x20')));});}else{return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x37c3e6){var _0x588390=this;return new Promise(function(_0x4c79dc,_0x955b9b){if(ami['isConnected']()==![]){return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')][_0xb6b1('0x19')]('\x20')));}var _0x3765ca=schema(properties['voicequeuechannelredirect'])[_0xb6b1('0x2')](_0x37c3e6);if(_0x3765ca[_0xb6b1('0x57')]>0x0){return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x3765ca,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x19415a=_[_0xb6b1('0x63')](_0x345886[_0xb6b1('0x72')],{'uniqueid':_0x37c3e6[_0xb6b1('0x5e')]});if(_0x19415a&&_0x19415a[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':'Redirect','channel':_0x19415a[_0xb6b1('0x5f')],'exten':_0x37c3e6[_0xb6b1('0x73')],'context':_0x37c3e6['context']||_0x19415a[_0xb6b1('0x74')],'priority':0x1})[_0xb6b1('0x17')](function(_0x5b02b7){_0x4c79dc({'code':0xc8,'message':[_0x37c3e6[_0xb6b1('0x5e')],_0x5b02b7['message'][_0xb6b1('0x65')]()]['join']('\x20')});})[_0xb6b1('0x1c')](function(_0x5e1d5c){_0x955b9b(_0x588390['error'](0x1f5,[_0x37c3e6[_0xb6b1('0x5e')],_0x5e1d5c[_0xb6b1('0x18')]['toLowerCase']()][_0xb6b1('0x19')]('\x20')));});}else{return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f5,_0xb6b1('0x6b')));}});},'Agents':function(_0xac8b8a){return new Promise(function(_0x292dbe,_0x6b6d3){var _0x3e7949=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0xc')]);_0x292dbe({'count':_0x3e7949[_0xb6b1('0x57')],'rows':_0x3e7949});});},'Telephones':function(_0x28231c){return new Promise(function(_0x18a71f,_0x521366){var _0x1d1e49=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x75')]);_0x18a71f({'count':_0x1d1e49[_0xb6b1('0x57')],'rows':_0x1d1e49});});},'Trunks':function(_0x489898){return new Promise(function(_0x1ee829,_0x2be41a){var _0x15818e=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x76')]);_0x1ee829({'count':_0x15818e[_0xb6b1('0x57')],'rows':_0x15818e});});},'OutboundChannels':function(_0x4872c7){return new Promise(function(_0x3954dd,_0x2c0509){var _0xe96200=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x77')]);_0x3954dd({'count':_0xe96200[_0xb6b1('0x57')],'rows':_0xe96200});});},'Outbound':function(_0x137c52){return new Promise(function(_0x433ce8,_0x400819){_0x433ce8(_0x345886[_0xb6b1('0x2c')]);});},'Campaigns':function(_0x3b9eb2){return new Promise(function(_0x54fa89,_0x5d3d77){var _0x2046e5=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x78')]);_0x54fa89({'count':_0x2046e5[_0xb6b1('0x57')],'rows':_0x2046e5});});},'VoiceQueuesPreview':function(_0x36d30b){var _0x32b89e=this;return new Promise(function(_0x43d32a,_0x3fbff1){_0x41bf3e['run'](_0x36d30b['id'])[_0xb6b1('0x17')](function(_0x1fa035){_0x43d32a({'code':0xc8,'message':_0x1fa035[_0xb6b1('0x18')]});})['catch'](function(_0x8f27ea){_0x3fbff1(_0x32b89e['error'](0x1f4,_0x8f27ea['message']));});});},'EventManager':function(_0x13f438){var _0x320c96=this;return new Promise(function(_0xa7b8d2,_0xf5dbf9){if(!_0x13f438[_0xb6b1('0x79')]){return _0xf5dbf9(_0x320c96[_0xb6b1('0x10')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xb6b1('0x7a')](_0xb6b1('0x7b')+_0x13f438[_0xb6b1('0x79')],_0x13f438[_0xb6b1('0x18')]);_0xa7b8d2({'code':0xc8,'message':_0x13f438});});},'FaxAccounts':function(_0x5712df){return new Promise(function(_0x4ea394,_0xdeaa28){var _0x5c8321=_[_0xb6b1('0x5a')](_0x345886['faxAccounts']);_0x4ea394({'count':_0x5c8321[_0xb6b1('0x57')],'rows':_0x5c8321});});},'SendFax':function(_0x516f87){var _0x58b209=this;return new Promise(function(_0x384595,_0x349feb){_0x113a39[_0xb6b1('0x7c')](_0x516f87)[_0xb6b1('0x17')](function(_0x3929e1){_0x384595({'code':0xc8,'message':_0x3929e1['message']});})[_0xb6b1('0x1c')](function(_0x170d5c){_0x349feb(_0x58b209[_0xb6b1('0x10')](0x1f4,_0x170d5c[_0xb6b1('0x18')]));});});},'CheckAfterSend':function(_0x523037){var _0xb668af=this;return new Promise(function(_0x5248c7,_0x3158cd){_0x113a39['checkAfterSend'](_0x523037)[_0xb6b1('0x17')](function(_0x554155){_0x5248c7({'code':0xc8,'message':_0x554155['message']});})['catch'](function(_0x4908ab){_0x3158cd(_0xb668af[_0xb6b1('0x10')](0x1f4,_0x4908ab['message']));});});}};var _0x25dbd6=jayson[_0xb6b1('0x7d')](_0x1a4cd0)[_0xb6b1('0x7e')]();_0x25dbd6['on'](_0xb6b1('0x10'),function(_0x5d1c1d){return _0x13334e(_0x5d1c1d);});_0x25dbd6[_0xb6b1('0x7')](0x232a,_0xb6b1('0x7f'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1ff716('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
+var _0xabce=['name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','pick','keys','Reload','then','message','catch','error','join','action','Command','Action','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','omit','undefined','channels','voicechannel','find','uniqueid','%s.%s','filename','wav','MixMonitor','channel','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','map','resolve','destinationchannel','StopMixMonitor','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Redirect','exten','context','values','telephones','trunks','outboundChannels','outbound','campaigns','Event\x20name\x20mandatory','custom:','event','faxAccounts','checkAfterSend','server','http','127.0.0.1','log','lodash','util','jayson/promise','validate','bluebird','../properties','../ami','listen','format','%s/%s','SIP'];(function(_0x42701f,_0x3d2f90){var _0x36aafb=function(_0x1bb284){while(--_0x1bb284){_0x42701f['push'](_0x42701f['shift']());}};_0x36aafb(++_0x3d2f90);}(_0xabce,0x103));var _0xeabc=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xabce[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var jayson=require(_0xeabc('0x2'));var schema=require(_0xeabc('0x3'));var BPromise=require(_0xeabc('0x4'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0xeabc('0x5'));var ami=require(_0xeabc('0x6'));exports[_0xeabc('0x7')]=function(_0x5e9e2d,_0x54e4a8,_0x1b07a8){return new BPromise(function(_0x52a4d7,_0x229ba4){var _0x52ede8={'QueuePause':function(_0x3bdc29){return new Promise(function(_0x9417af,_0x8434c5){var _0x5d59d5=util[_0xeabc('0x8')](_0xeabc('0x9'),_0xeabc('0xa'),_0x3bdc29[_0xeabc('0xb')]);if(_0x5e9e2d[_0xeabc('0xc')]&&_0x5e9e2d[_0xeabc('0xc')][_0x5d59d5]&&_0x5e9e2d[_0xeabc('0xc')][_0x5d59d5][_0xeabc('0xd')]){_0x5e9e2d[_0xeabc('0xc')][_0x5d59d5][_0xeabc('0xe')]();}if(_0x5e9e2d[_0xeabc('0xf')][_0x5d59d5]){_0x5e9e2d[_0xeabc('0xf')][_0x5d59d5][_0xeabc('0x10')]({'statePause':_0x3bdc29[_0xeabc('0x11')]?!![]:![]});}_0x9417af({'code':0xc8,'message':_0xeabc('0x12')});});},'Reload':function(_0xcfbf06){var _0x53df9c=this;return new Promise(function(_0x235c2d,_0x1319f3){if(ami[_0xeabc('0x13')]()==![]){return _0x1319f3(_0x53df9c['error'](0x1f4,[config['asterisk']['ip'],config[_0xeabc('0x14')][_0xeabc('0x15')],_0xeabc('0x16')]['join']('\x20')));}_0xcfbf06=_[_0xeabc('0x17')](_0xcfbf06,_[_0xeabc('0x18')](properties['module']));_0xcfbf06['action']=_0xeabc('0x19');return ami['Action'](_0xcfbf06)[_0xeabc('0x1a')](function(_0x1b64b9){_0x235c2d({'code':0xc8,'message':_0x1b64b9[_0xeabc('0x1b')]});})[_0xeabc('0x1c')](function(_0x31dd53){_0x1319f3(_0x53df9c[_0xeabc('0x1d')](0x1f5,_0x31dd53[_0xeabc('0x1b')]));});});},'Command':function(_0x5e30ee){var _0x5d92e5=this;return new Promise(function(_0x1253e4,_0x4d68ea){if(ami[_0xeabc('0x13')]()==![]){return _0x4d68ea(_0x5d92e5[_0xeabc('0x1d')](0x1f4,[config['asterisk']['ip'],config[_0xeabc('0x14')][_0xeabc('0x15')],_0xeabc('0x16')][_0xeabc('0x1e')]('\x20')));}_0x5e30ee=_[_0xeabc('0x17')](_0x5e30ee,'command');_0x5e30ee[_0xeabc('0x1f')]=_0xeabc('0x20');return ami[_0xeabc('0x21')](_0x5e30ee)['then'](function(_0x457f27){_0x1253e4({'code':0xc8,'message':_0x457f27[_0xeabc('0x22')]});})[_0xeabc('0x1c')](function(_0x319119){_0x4d68ea(_0x5d92e5['error'](0x1f5,_0x319119[_0xeabc('0x1b')]));});});},'VoiceQueues':function(_0x480440){return new Promise(function(_0x27dbaf,_0x4d4e29){var _0x811f0d=[];for(var _0x12acbd in _0x5e9e2d[_0xeabc('0x23')]){if(_0x5e9e2d[_0xeabc('0x23')][_0xeabc('0x24')](_0x12acbd)){var _0x137293=_0x5e9e2d[_0xeabc('0x23')][_0x12acbd];var _0x4c2693={'id':_0x137293['id'],'name':_0x137293['name'],'strategy':_0x137293[_0xeabc('0x25')],'answered':_0x137293['answered'],'available':_0x137293[_0xeabc('0x26')],'loggedIn':_0x137293[_0xeabc('0x27')],'pTalking':_0x137293['pTalking'],'sumBillable':_0x137293[_0xeabc('0x28')],'sumDuration':_0x137293[_0xeabc('0x29')],'sumHoldTime':_0x137293[_0xeabc('0x2a')]||0x0,'talking':_0x137293[_0xeabc('0x2b')],'total':_0x137293[_0xeabc('0x2c')],'type':_0x137293[_0xeabc('0x2d')],'unmanaged':_0x137293[_0xeabc('0x2e')],'abandoned':_0x137293[_0xeabc('0x2f')],'waiting':_0x137293[_0xeabc('0x30')],'loggedInDb':_0x137293['loggedInDb']};if(_0x137293[_0xeabc('0x2d')]==='outbound'){_0x4c2693[_0xeabc('0x31')]=_0x137293[_0xeabc('0x31')];_0x4c2693[_0xeabc('0x32')]=_0x137293[_0xeabc('0x32')];_0x4c2693[_0xeabc('0x33')]=_0x137293[_0xeabc('0x33')];_0x4c2693[_0xeabc('0x34')]=_0x137293['dialOriginateCallerIdNumber'];_0x4c2693[_0xeabc('0x35')]=_0x137293[_0xeabc('0x35')];_0x4c2693[_0xeabc('0x36')]=_0x137293['dialPrefix'];_0x4c2693[_0xeabc('0x37')]=_0x137293[_0xeabc('0x37')];_0x4c2693[_0xeabc('0x38')]=_0x137293['outboundAnswerAgiCallsDay'];_0x4c2693[_0xeabc('0x39')]=_0x137293[_0xeabc('0x39')];_0x4c2693[_0xeabc('0x3a')]=_0x137293['outboundBlacklistCallsDay'];_0x4c2693[_0xeabc('0x3b')]=_0x137293[_0xeabc('0x3b')];_0x4c2693['outboundCongestionCallsDay']=_0x137293['outboundCongestionCallsDay'];_0x4c2693[_0xeabc('0x3c')]=_0x137293[_0xeabc('0x3c')];_0x4c2693['outboundDropCallsDayCallersExit']=_0x137293[_0xeabc('0x3d')];_0x4c2693[_0xeabc('0x3e')]=_0x137293[_0xeabc('0x3e')];_0x4c2693[_0xeabc('0x3f')]=_0x137293[_0xeabc('0x3f')];_0x4c2693['outboundNoSuchCallsDay']=_0x137293[_0xeabc('0x40')];_0x4c2693['outboundOriginateFailureCallsDay']=_0x137293[_0xeabc('0x41')];_0x4c2693[_0xeabc('0x42')]=_0x137293[_0xeabc('0x42')];_0x4c2693['outboundRejectCallsDay']=_0x137293['outboundRejectCallsDay'];_0x4c2693[_0xeabc('0x43')]=_0x137293['outboundUnknownCallsDay'];_0x4c2693[_0xeabc('0x44')]=_0x137293['predictiveIntervalAnsweredCalls'];_0x4c2693['predictiveIntervalAvgHoldtime']=_0x137293['predictiveIntervalAvgHoldtime'];_0x4c2693['predictiveIntervalAvgTalktime']=_0x137293[_0xeabc('0x45')];_0x4c2693['predictiveIntervalDroppedCallsCallersExit']=_0x137293[_0xeabc('0x46')];_0x4c2693[_0xeabc('0x47')]=_0x137293['predictiveIntervalDroppedCallsTimeout'];_0x4c2693[_0xeabc('0x48')]=_0x137293['predictiveIntervalErlangCalls'];_0x4c2693[_0xeabc('0x49')]=_0x137293['predictiveIntervalErlangCallsDroppedCalls'];_0x4c2693[_0xeabc('0x4a')]=_0x137293[_0xeabc('0x4a')];_0x4c2693[_0xeabc('0x4b')]=_0x137293['predictiveIntervalMultiplicativeFactor'];_0x4c2693['predictiveIntervalPauses']=_0x137293['predictiveIntervalPauses'];_0x4c2693[_0xeabc('0x4c')]=_0x137293[_0xeabc('0x4c')];_0x4c2693[_0xeabc('0x4d')]=_0x137293['predictiveIntervalTotalCalls'];_0x4c2693['message']=_0x137293[_0xeabc('0x1b')];_0x4c2693[_0xeabc('0x4e')]=_0x137293['originated'];_0x4c2693[_0xeabc('0x4f')]=_0x137293['erlangCalls'];_0x4c2693[_0xeabc('0x50')]=_0x137293['erlangCallToSecond'];_0x4c2693['erlangAbandonmentRate']=_0x137293['erlangAbandonmentRate'];_0x4c2693[_0xeabc('0x51')]=_0x137293[_0xeabc('0x51')];_0x4c2693[_0xeabc('0x52')]=_0x137293[_0xeabc('0x52')];_0x4c2693['startProgressive']=_0x137293[_0xeabc('0x53')];}if(_0x137293['Trunk']){_0x4c2693[_0xeabc('0x54')]={'id':_0x137293[_0xeabc('0x54')]['id'],'name':_0x137293[_0xeabc('0x54')][_0xeabc('0xb')],'active':_0x137293[_0xeabc('0x54')]['active'],'callerid':_0x137293['Trunk'][_0xeabc('0x55')]};}if(_0x137293['Interval']){_0x4c2693[_0xeabc('0x56')]={'id':_0x137293[_0xeabc('0x56')]['id'],'name':_0x137293['Interval'][_0xeabc('0xb')]};}_0x811f0d[_0xeabc('0x57')](_0x4c2693);}}_0x27dbaf({'count':_0x811f0d[_0xeabc('0x58')],'rows':_0x811f0d});});},'UpdateVoiceQueue':function(_0x353038){return new Promise(function(_0x4360d7,_0xcaa5b9){var _0x2003a7=_['find'](_0x5e9e2d[_0xeabc('0x23')],{'id':parseInt(_0x353038['id'])});var _0x2c85f0=_[_0xeabc('0x59')](_0x353038,['id']);if(_0x2003a7){for(var _0x1b41c8 in _0x2c85f0){if(typeof _0x2c85f0[_0x1b41c8]!==_0xeabc('0x5a')&&typeof _0x2003a7[_0x1b41c8]!==_0xeabc('0x5a')){_0x2003a7[_0x1b41c8]=_0x2c85f0[_0x1b41c8];}}_0x4360d7(_0x2003a7);}else{_0xcaa5b9();}});},'VoiceChannels':function(_0x2107d5){return new Promise(function(_0x20f004,_0x10d938){var _0x44e714=_['values'](_0x5e9e2d[_0xeabc('0x5b')]);_0x20f004({'count':_0x44e714[_0xeabc('0x58')],'rows':_0x44e714});});},'VoiceChannelMixMonitor':function(_0x41f5d7){var _0xec22ef=this;return new Promise(function(_0x34abdf,_0x26f829){if(ami[_0xeabc('0x13')]()==![]){return _0x26f829(_0xec22ef['error'](0x1f4,[config[_0xeabc('0x14')]['ip'],config[_0xeabc('0x14')][_0xeabc('0x15')],_0xeabc('0x16')][_0xeabc('0x1e')]('\x20')));}var _0x58e2c1=schema(properties[_0xeabc('0x5c')])[_0xeabc('0x3')](_0x41f5d7);if(_0x58e2c1[_0xeabc('0x58')]>0x0){return _0x26f829(_0xec22ef[_0xeabc('0x1d')](0x1f4,_['map'](_0x58e2c1,_0xeabc('0x1b'))[_0xeabc('0x1e')](',\x20')));}var _0x568847=_[_0xeabc('0x5d')](_0x5e9e2d['channels'],{'uniqueid':_0x41f5d7[_0xeabc('0x5e')]});if(_0x568847&&_0x568847['channel']){var _0x16ce77=util[_0xeabc('0x8')](_0xeabc('0x5f'),_0x41f5d7[_0xeabc('0x60')]||_0x41f5d7[_0xeabc('0x5e')],_0x41f5d7[_0xeabc('0x8')]||_0xeabc('0x61'));return ami[_0xeabc('0x21')]({'action':_0xeabc('0x62'),'channel':_0x568847[_0xeabc('0x63')],'file':_0x16ce77,'options':'ai(mixmonitorid)'})[_0xeabc('0x1a')](function(_0x2537ab){var _0x4072cb=_[_0xeabc('0x5d')](_0x568847['monitors'],{'filename':_0xeabc('0x64')+_0x16ce77[_0xeabc('0x65')]()});if(_[_0xeabc('0x66')](_0x4072cb)){_0x568847[_0xeabc('0x67')]['push']({'filename':_0xeabc('0x64')+_0x16ce77[_0xeabc('0x65')](),'createdAt':moment()[_0xeabc('0x8')](_0xeabc('0x68')),'mixmonitorid':_0x2537ab[_0xeabc('0x69')],'status':_0xeabc('0x6a')});}else{_0x4072cb[_0xeabc('0x69')]=_0x2537ab[_0xeabc('0x69')];_0x4072cb[_0xeabc('0x6b')]='rec';}_0x34abdf({'code':0xc8,'message':[_0x41f5d7[_0xeabc('0x5e')],'MixMonitor\x20Success',_0x2537ab['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x2537ab[_0xeabc('0x69')]});})[_0xeabc('0x1c')](function(_0x219ca8){_0x26f829(_0xec22ef[_0xeabc('0x1d')](0x1f5,[_0x41f5d7[_0xeabc('0x5e')],_0x219ca8[_0xeabc('0x1b')]['toLowerCase']()][_0xeabc('0x1e')]('\x20')));});}else{return _0x26f829(_0xec22ef[_0xeabc('0x1d')](0x1f5,_0xeabc('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x104c1e){var _0x2ddc53=this;return new Promise(function(_0x2c7b4e,_0x1750e9){if(ami[_0xeabc('0x13')]()==![]){return _0x1750e9(_0x2ddc53['error'](0x1f4,[config['asterisk']['ip'],config[_0xeabc('0x14')][_0xeabc('0x15')],_0xeabc('0x16')]['join']('\x20')));}var _0x287f88=schema(properties['voicechannel'])['validate'](_0x104c1e);if(_0x287f88[_0xeabc('0x58')]>0x0){return _0x1750e9(_0x2ddc53[_0xeabc('0x1d')](0x1f4,_[_0xeabc('0x6d')](_0x287f88,_0xeabc('0x1b'))[_0xeabc('0x1e')](',\x20')));}var _0xc2ef0c=_['find'](_0x5e9e2d[_0xeabc('0x5b')],{'uniqueid':_0x104c1e[_0xeabc('0x5e')]});if(_0xc2ef0c){return BPromise[_0xeabc('0x6e')]()[_0xeabc('0x1a')](function(){if(_0xc2ef0c[_0xeabc('0x63')]){return ami[_0xeabc('0x21')]({'action':'StopMixMonitor','channel':_0xc2ef0c[_0xeabc('0x63')],'mixmonitorid':_0x104c1e[_0xeabc('0x69')]})[_0xeabc('0x1c')](function(_0x165899){});}})[_0xeabc('0x1a')](function(){if(_0xc2ef0c[_0xeabc('0x6f')]){return ami[_0xeabc('0x21')]({'action':_0xeabc('0x70'),'channel':_0xc2ef0c[_0xeabc('0x6f')],'mixmonitorid':_0x104c1e['mixmonitorid']})[_0xeabc('0x1c')](function(_0x590439){});}})[_0xeabc('0x1a')](function(_0x2c389d){var _0x3fea99=_[_0xeabc('0x5d')](_0xc2ef0c[_0xeabc('0x67')],{'mixmonitorid':_0x104c1e[_0xeabc('0x69')]});if(_0x3fea99){_0x3fea99[_0xeabc('0x6b')]=_0xeabc('0x71');}})[_0xeabc('0x1a')](function(){var _0x24d0e5=util['format'](_0xeabc('0x5f'),_0x104c1e[_0xeabc('0x60')]||_0x104c1e[_0xeabc('0x5e')],_0x104c1e[_0xeabc('0x8')]||'wav');var _0x12fd48=_['find'](_0xc2ef0c['monitors'],{'filename':_0xeabc('0x64')+_0x24d0e5[_0xeabc('0x65')]()});if(_0x12fd48){_0x12fd48[_0xeabc('0x6b')]=_0xeabc('0x71');}})['then'](function(){_0x2c7b4e({'code':0xc8,'message':[_0x104c1e['uniqueid'],_0xeabc('0x72')]['join']('\x20')});})['catch'](function(_0x44c0a6){_0x1750e9(_0x2ddc53['error'](0x1f5,[_0x104c1e['uniqueid'],_0x44c0a6[_0xeabc('0x1b')][_0xeabc('0x65')]()]['join']('\x20')));});}else{return _0x1750e9(_0x2ddc53['error'](0x1f5,_0xeabc('0x6c')));}});},'VoiceQueuesChannels':function(_0x5d183a){return new Promise(function(_0x238e2d,_0x15ca17){var _0x4c84a9=_['values'](_0x5e9e2d[_0xeabc('0x73')]);_0x238e2d({'count':_0x4c84a9[_0xeabc('0x58')],'rows':_0x4c84a9});});},'VoiceQueuesChannel':function(_0xd86ea7){var _0x471cb6=this;return new Promise(function(_0x1debaa,_0x511b33){var _0x53f578=schema(properties[_0xeabc('0x74')])['validate'](_0xd86ea7);if(_0x53f578[_0xeabc('0x58')]>0x0){return _0x511b33(_0x471cb6['error'](0x1f4,_[_0xeabc('0x6d')](_0x53f578,'message')[_0xeabc('0x1e')](',\x20')));}var _0x53ac31=_[_0xeabc('0x5d')](_0x5e9e2d[_0xeabc('0x73')],{'uniqueid':_0xd86ea7[_0xeabc('0x5e')]});if(_0x53ac31){_0x1debaa(_0x53ac31);}else{return _0x511b33(_0x471cb6[_0xeabc('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x6ee7cf){var _0x4fa682=this;return new Promise(function(_0x26ff38,_0x3e87c3){if(ami[_0xeabc('0x13')]()==![]){return _0x3e87c3(_0x4fa682[_0xeabc('0x1d')](0x1f4,[config[_0xeabc('0x14')]['ip'],config['asterisk'][_0xeabc('0x15')],_0xeabc('0x16')][_0xeabc('0x1e')]('\x20')));}var _0x2509a4=schema(properties['voicequeuechannelhangup'])[_0xeabc('0x3')](_0x6ee7cf);if(_0x2509a4[_0xeabc('0x58')]>0x0){return _0x3e87c3(_0x4fa682[_0xeabc('0x1d')](0x1f4,_[_0xeabc('0x6d')](_0x2509a4,'message')[_0xeabc('0x1e')](',\x20')));}var _0x368cd4=_[_0xeabc('0x5d')](_0x5e9e2d[_0xeabc('0x73')],{'uniqueid':_0x6ee7cf['uniqueid']});if(_0x368cd4&&_0x368cd4['channel']){return ami[_0xeabc('0x21')]({'action':'Hangup','channel':_0x368cd4['channel']})[_0xeabc('0x1a')](function(_0x460f07){_0x26ff38({'code':0xc8,'message':[_0x6ee7cf[_0xeabc('0x5e')],_0x460f07['message'][_0xeabc('0x65')]()][_0xeabc('0x1e')]('\x20')});})['catch'](function(_0x3d1d12){_0x3e87c3(_0x4fa682[_0xeabc('0x1d')](0x1f5,[_0x6ee7cf[_0xeabc('0x5e')],_0x3d1d12[_0xeabc('0x1b')][_0xeabc('0x65')]()]['join']('\x20')));});}else{return _0x3e87c3(_0x4fa682[_0xeabc('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x480c66){var _0x4c4b1e=this;return new Promise(function(_0x953553,_0x1c8a51){if(ami[_0xeabc('0x13')]()==![]){return _0x1c8a51(_0x4c4b1e[_0xeabc('0x1d')](0x1f4,[config[_0xeabc('0x14')]['ip'],config['asterisk'][_0xeabc('0x15')],'ami\x20disconnected'][_0xeabc('0x1e')]('\x20')));}var _0x2f95c7=schema(properties['voicequeuechannelredirect'])[_0xeabc('0x3')](_0x480c66);if(_0x2f95c7['length']>0x0){return _0x1c8a51(_0x4c4b1e['error'](0x1f4,_[_0xeabc('0x6d')](_0x2f95c7,_0xeabc('0x1b'))[_0xeabc('0x1e')](',\x20')));}var _0x3acb88=_[_0xeabc('0x5d')](_0x5e9e2d['queueChannels'],{'uniqueid':_0x480c66[_0xeabc('0x5e')]});if(_0x3acb88&&_0x3acb88[_0xeabc('0x63')]){return ami[_0xeabc('0x21')]({'action':_0xeabc('0x75'),'channel':_0x3acb88[_0xeabc('0x63')],'exten':_0x480c66[_0xeabc('0x76')],'context':_0x480c66[_0xeabc('0x77')]||_0x3acb88[_0xeabc('0x77')],'priority':0x1})[_0xeabc('0x1a')](function(_0x1921d5){_0x953553({'code':0xc8,'message':[_0x480c66['uniqueid'],_0x1921d5[_0xeabc('0x1b')][_0xeabc('0x65')]()][_0xeabc('0x1e')]('\x20')});})['catch'](function(_0x4bccf7){_0x1c8a51(_0x4c4b1e[_0xeabc('0x1d')](0x1f5,[_0x480c66[_0xeabc('0x5e')],_0x4bccf7[_0xeabc('0x1b')][_0xeabc('0x65')]()][_0xeabc('0x1e')]('\x20')));});}else{return _0x1c8a51(_0x4c4b1e['error'](0x1f5,_0xeabc('0x6c')));}});},'Agents':function(_0x538190){return new Promise(function(_0x5f39ef,_0x16ff81){var _0x302e94=_['values'](_0x5e9e2d[_0xeabc('0xf')]);_0x5f39ef({'count':_0x302e94[_0xeabc('0x58')],'rows':_0x302e94});});},'Telephones':function(_0x49a70a){return new Promise(function(_0x5963f7,_0xfaef39){var _0xb04677=_[_0xeabc('0x78')](_0x5e9e2d[_0xeabc('0x79')]);_0x5963f7({'count':_0xb04677[_0xeabc('0x58')],'rows':_0xb04677});});},'Trunks':function(_0x1b0995){return new Promise(function(_0x1f8197,_0x485c13){var _0xb54c35=_['values'](_0x5e9e2d[_0xeabc('0x7a')]);_0x1f8197({'count':_0xb54c35[_0xeabc('0x58')],'rows':_0xb54c35});});},'OutboundChannels':function(_0x204e39){return new Promise(function(_0x2d1441,_0x62cb8e){var _0x20c003=_[_0xeabc('0x78')](_0x5e9e2d[_0xeabc('0x7b')]);_0x2d1441({'count':_0x20c003[_0xeabc('0x58')],'rows':_0x20c003});});},'Outbound':function(_0x156e20){return new Promise(function(_0x42e92b,_0x5d471f){_0x42e92b(_0x5e9e2d[_0xeabc('0x7c')]);});},'Campaigns':function(_0x274ddc){return new Promise(function(_0x3a3967,_0x1e880e){var _0x5b00d6=_[_0xeabc('0x78')](_0x5e9e2d[_0xeabc('0x7d')]);_0x3a3967({'count':_0x5b00d6['length'],'rows':_0x5b00d6});});},'VoiceQueuesPreview':function(_0x3de927){var _0x22ef88=this;return new Promise(function(_0x5086e7,_0x507ac0){_0x54e4a8['run'](_0x3de927['id'])['then'](function(_0x2959e9){_0x5086e7({'code':0xc8,'message':_0x2959e9[_0xeabc('0x1b')]});})[_0xeabc('0x1c')](function(_0xe18bf1){_0x507ac0(_0x22ef88[_0xeabc('0x1d')](0x1f4,_0xe18bf1[_0xeabc('0x1b')]));});});},'EventManager':function(_0x3abe69){var _0x385ecf=this;return new Promise(function(_0x18c27f,_0x3eb795){if(!_0x3abe69['event']){return _0x3eb795(_0x385ecf[_0xeabc('0x1d')](0x1f4,_0xeabc('0x7e')));}ami['emit'](_0xeabc('0x7f')+_0x3abe69[_0xeabc('0x80')],_0x3abe69[_0xeabc('0x1b')]);_0x18c27f({'code':0xc8,'message':_0x3abe69});});},'FaxAccounts':function(_0x4c4ee3){return new Promise(function(_0x1f3198,_0x488120){var _0x425e5c=_[_0xeabc('0x78')](_0x5e9e2d[_0xeabc('0x81')]);_0x1f3198({'count':_0x425e5c[_0xeabc('0x58')],'rows':_0x425e5c});});},'SendFax':function(_0x1c52f7){var _0x5e7e00=this;return new Promise(function(_0x53a5bc,_0x5e9079){_0x1b07a8['send'](_0x1c52f7)[_0xeabc('0x1a')](function(_0x3c2725){_0x53a5bc({'code':0xc8,'message':_0x3c2725[_0xeabc('0x1b')]});})['catch'](function(_0x12f83f){_0x5e9079(_0x5e7e00[_0xeabc('0x1d')](0x1f4,_0x12f83f[_0xeabc('0x1b')]));});});},'CheckAfterSend':function(_0x36cc30){var _0x39964d=this;return new Promise(function(_0x646353,_0xdd956){_0x1b07a8[_0xeabc('0x82')](_0x36cc30)[_0xeabc('0x1a')](function(_0x391e67){_0x646353({'code':0xc8,'message':_0x391e67[_0xeabc('0x1b')]});})[_0xeabc('0x1c')](function(_0x5a1422){_0xdd956(_0x39964d['error'](0x1f4,_0x5a1422[_0xeabc('0x1b')]));});});}};var _0x50a5d5=jayson[_0xeabc('0x83')](_0x52ede8)[_0xeabc('0x84')]();_0x50a5d5['on'](_0xeabc('0x1d'),function(_0x56f622){return _0x229ba4(_0x56f622);});_0x50a5d5[_0xeabc('0x7')](0x232a,_0xeabc('0x85'),function(){console[_0xeabc('0x86')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x52a4d7('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
index ae3adeb..5cdc2eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57b2=['toLowerCase','merge','lodash','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','mobile','updatedAt','getContacts','then','isEmpty','length','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','<unknown>','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','isNil','format','user:%s','name','trigger:%s','action'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x57b2,0x6e));var _0x257b=function(_0x38695b,_0x8d9af2){_0x38695b=_0x38695b-0x0;var _0x372ad6=_0x57b2[_0x38695b];return _0x372ad6;};'use strict';var _=require(_0x257b('0x0'));var BPromise=require('bluebird');var Redis=require(_0x257b('0x1'));var util=require(_0x257b('0x2'));var config=require(_0x257b('0x3'));var logger=require(_0x257b('0x4'))('trigger');var cmContactRpc=require(_0x257b('0x5'));config[_0x257b('0x6')]=_[_0x257b('0x7')](config[_0x257b('0x6')],{'host':_0x257b('0x8'),'port':0x18eb});var io=require(_0x257b('0x9'))(new Redis(config[_0x257b('0x6')]));function emit(_0x2cfe17,_0x248069,_0x18dc90,_0x5b9152,_0x5e0c39){logger[_0x257b('0xa')](_0x257b('0xb'),_0x2cfe17,_0x248069['id'],_0x18dc90,_0x5b9152,JSON[_0x257b('0xc')](_0x5e0c39));io['to'](_0x18dc90)[_0x257b('0xd')](_0x5b9152,_0x5e0c39);}exports[_0x257b('0xe')]=function(_0x17012f,_0x2a1768,_0x5a7ab8,_0x47bd9a){var _0x533fe6,_0xc6201a;var _0x5f4092={};var _0x3852af=Number(_0x5a7ab8['data1']);var _0x23aa92=_0x5a7ab8['data2']?Boolean(Number(_0x5a7ab8[_0x257b('0xf')])):![];var _0x339494;if(_0x47bd9a[_0x257b('0x10')]){_0x5f4092['id']=_0x47bd9a[_0x257b('0x10')];}if(!_0x5f4092['id']){_0x5f4092[_0x257b('0x11')]=_0x3852af;_0x339494=_0x5a7ab8['data3']&&_0x5a7ab8['data3']!=='0'?_0x5a7ab8[_0x257b('0x12')][_0x257b('0x13')](','):[_0x257b('0x14')];_0x5f4092[_0x257b('0x15')]=_[_0x257b('0x16')](_0x339494,function(_0x53c8a5){var _0x59dfb4={};_0x59dfb4[_0x53c8a5]=_0x47bd9a[_0x257b('0x17')]?_0x47bd9a[_0x257b('0x18')]:_0x47bd9a[_0x257b('0x19')];return _0x59dfb4;});}var _0x40f48a=['id',_0x257b('0x1a'),'lastName',_0x257b('0x14'),_0x257b('0x1b'),'fax',_0x257b('0x11'),'createdAt','scheduledAt',_0x257b('0x1c')];var _0x58b59c=_['union'](_0x40f48a,_0x339494);BPromise['resolve']()['then'](cmContactRpc[_0x257b('0x1d')]({'attributes':_0x58b59c,'where':_0x5f4092}))[_0x257b('0x1e')](function(_0x38a490){_0xc6201a=_0x38a490;if(!_[_0x257b('0x1f')](_0xc6201a)){if(_0xc6201a[_0x257b('0x20')]===0x1){_0x533fe6=_0xc6201a[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0x47bd9a[_0x257b('0x21')],_0x2a1768['id'],_0x533fe6['id']);}else{logger[_0x257b('0xa')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x47bd9a[_0x257b('0x21')],_0x2a1768['id'],_['map'](_0xc6201a,'id')[_0x257b('0x22')](','));}return;}else{logger['info'](_0x257b('0x23'),_0x47bd9a[_0x257b('0x21')],_0x2a1768['id']);var _0x3009f4={'ListId':_0x3852af};var _0x367f32=_0x5a7ab8[_0x257b('0x24')]&&_0x5a7ab8[_0x257b('0x24')]!=='0'?_0x5a7ab8['data4']:'phone';if(_0x23aa92){logger[_0x257b('0xa')](_0x257b('0x25'),_0x47bd9a[_0x257b('0x21')],_0x2a1768['id']);_0x3009f4[_0x367f32]=_['isNil'](_0x47bd9a[_0x257b('0x17')])?_0x47bd9a[_0x257b('0x19')]:_0x47bd9a[_0x257b('0x18')];if(_['isNil'](_0x47bd9a['routeId'])){_0x3009f4['firstName']=_0x47bd9a['calleridname']&&_0x47bd9a[_0x257b('0x26')]!==_0x257b('0x27')?_0x47bd9a[_0x257b('0x26')]:_0x257b('0x28');}else{_0x3009f4['firstName']=_0x47bd9a[_0x257b('0x29')]&&_0x47bd9a['destcalleridname']!=='<unknown>'?_0x47bd9a[_0x257b('0x29')]:_0x257b('0x28');}return BPromise['resolve']()[_0x257b('0x1e')](cmContactRpc[_0x257b('0x2a')](_0x3009f4))[_0x257b('0x1e')](function(_0x5c9309){_0x533fe6=_0x5c9309;_0xc6201a[_0x257b('0x2b')](_0x5c9309);if(_0x533fe6){logger[_0x257b('0xa')](_0x257b('0x2c'),_0x47bd9a[_0x257b('0x21')],_0x2a1768['id'],_0x533fe6['id']);}return;});}else{logger[_0x257b('0xa')](_0x257b('0x2d'),_0x47bd9a[_0x257b('0x21')],_0x2a1768['id']);_0x3009f4[_0x367f32]=_[_0x257b('0x2e')](_0x47bd9a[_0x257b('0x17')])?_0x47bd9a[_0x257b('0x19')]:_0x47bd9a['destcalleridnum'];if(_['isNil'](_0x47bd9a[_0x257b('0x17')])){_0x3009f4['firstName']=_0x47bd9a['calleridname']&&_0x47bd9a['calleridname']!==_0x257b('0x27')?_0x47bd9a[_0x257b('0x26')]:_0x257b('0x28');}else{_0x3009f4['firstName']=_0x47bd9a[_0x257b('0x29')]&&_0x47bd9a['destcalleridname']!==_0x257b('0x27')?_0x47bd9a[_0x257b('0x29')]:'Unknown';}_0x533fe6=_0x3009f4;_0xc6201a['push'](_0x3009f4);return;}}})[_0x257b('0x1e')](function(){if(_0x17012f){emit(_0x47bd9a['uniqueid'],_0x2a1768,util[_0x257b('0x2f')](_0x257b('0x30'),_0x17012f[_0x257b('0x31')]),util[_0x257b('0x2f')](_0x257b('0x32'),_0x5a7ab8[_0x257b('0x33')][_0x257b('0x34')]()),{'evt':_[_0x257b('0x35')](_0x47bd9a,{'autoCreate':_0x23aa92}),'contact':_0x533fe6===undefined?{}:_0x533fe6,'contacts':_0xc6201a[_0x257b('0x20')]===0x0?undefined:_0xc6201a});}});};
\ No newline at end of file
+var _0xcd43=['calleridnum','calleridname','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','[CM][%s][%s]','stringify','exec','data2','xmd-contactid','ListId','data3','map','routeId','destcalleridnum','firstName','phone','mobile','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','<unknown>','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xcd43,0x14d));var _0x3cd4=function(_0x7603b0,_0x193e4b){_0x7603b0=_0x7603b0-0x0;var _0x1b9518=_0xcd43[_0x7603b0];return _0x1b9518;};'use strict';var _=require(_0x3cd4('0x0'));var BPromise=require('bluebird');var Redis=require(_0x3cd4('0x1'));var util=require(_0x3cd4('0x2'));var config=require(_0x3cd4('0x3'));var logger=require('../../../../config/logger')(_0x3cd4('0x4'));var cmContactRpc=require(_0x3cd4('0x5'));config['redis']=_[_0x3cd4('0x6')](config[_0x3cd4('0x7')],{'host':_0x3cd4('0x8'),'port':0x18eb});var io=require(_0x3cd4('0x9'))(new Redis(config[_0x3cd4('0x7')]));function emit(_0x1e00bb,_0xc15dda,_0x580ad9,_0x2ba46a,_0x537477){logger['info'](_0x3cd4('0xa'),_0x1e00bb,_0xc15dda['id'],_0x580ad9,_0x2ba46a,JSON[_0x3cd4('0xb')](_0x537477));io['to'](_0x580ad9)['emit'](_0x2ba46a,_0x537477);}exports[_0x3cd4('0xc')]=function(_0x9e10fc,_0x5ba2a1,_0xc1c70a,_0x456cc3){var _0x560401,_0x28d73c;var _0x149f04={};var _0x1ebb0e=Number(_0xc1c70a['data1']);var _0x181071=_0xc1c70a[_0x3cd4('0xd')]?Boolean(Number(_0xc1c70a[_0x3cd4('0xd')])):![];var _0x540836;if(_0x456cc3['xmd-contactid']){_0x149f04['id']=_0x456cc3[_0x3cd4('0xe')];}if(!_0x149f04['id']){_0x149f04[_0x3cd4('0xf')]=_0x1ebb0e;_0x540836=_0xc1c70a[_0x3cd4('0x10')]&&_0xc1c70a['data3']!=='0'?_0xc1c70a[_0x3cd4('0x10')]['split'](','):['phone'];_0x149f04['$or']=_[_0x3cd4('0x11')](_0x540836,function(_0x3364a1){var _0x4f5716={};_0x4f5716[_0x3364a1]=_0x456cc3[_0x3cd4('0x12')]?_0x456cc3[_0x3cd4('0x13')]:_0x456cc3['calleridnum'];return _0x4f5716;});}var _0x4fb3f1=['id',_0x3cd4('0x14'),'lastName',_0x3cd4('0x15'),_0x3cd4('0x16'),'fax',_0x3cd4('0xf'),_0x3cd4('0x17'),_0x3cd4('0x18'),_0x3cd4('0x19')];var _0x1f3b80=_['union'](_0x4fb3f1,_0x540836);BPromise[_0x3cd4('0x1a')]()[_0x3cd4('0x1b')](cmContactRpc[_0x3cd4('0x1c')]({'attributes':_0x1f3b80,'where':_0x149f04}))[_0x3cd4('0x1b')](function(_0x47b848){_0x28d73c=_0x47b848;if(!_['isEmpty'](_0x28d73c)){if(_0x28d73c[_0x3cd4('0x1d')]===0x1){_0x560401=_0x28d73c[0x0];logger[_0x3cd4('0x1e')](_0x3cd4('0x1f'),_0x456cc3[_0x3cd4('0x20')],_0x5ba2a1['id'],_0x560401['id']);}else{logger[_0x3cd4('0x1e')](_0x3cd4('0x21'),_0x456cc3['uniqueid'],_0x5ba2a1['id'],_[_0x3cd4('0x11')](_0x28d73c,'id')[_0x3cd4('0x22')](','));}return;}else{logger[_0x3cd4('0x1e')](_0x3cd4('0x23'),_0x456cc3[_0x3cd4('0x20')],_0x5ba2a1['id']);var _0x26f2a0={'ListId':_0x1ebb0e};var _0x1ed471=_0xc1c70a[_0x3cd4('0x24')]&&_0xc1c70a['data4']!=='0'?_0xc1c70a[_0x3cd4('0x24')]:_0x3cd4('0x15');if(_0x181071){logger['info'](_0x3cd4('0x25'),_0x456cc3[_0x3cd4('0x20')],_0x5ba2a1['id']);_0x26f2a0[_0x1ed471]=_[_0x3cd4('0x26')](_0x456cc3[_0x3cd4('0x12')])?_0x456cc3['calleridnum']:_0x456cc3[_0x3cd4('0x13')];if(_[_0x3cd4('0x26')](_0x456cc3[_0x3cd4('0x12')])){_0x26f2a0[_0x3cd4('0x14')]=_0x456cc3['calleridname']&&_0x456cc3['calleridname']!==_0x3cd4('0x27')?_0x456cc3['calleridname']:_0x3cd4('0x28');}else{_0x26f2a0[_0x3cd4('0x14')]=_0x456cc3[_0x3cd4('0x29')]&&_0x456cc3[_0x3cd4('0x29')]!==_0x3cd4('0x27')?_0x456cc3[_0x3cd4('0x29')]:_0x3cd4('0x28');}return BPromise[_0x3cd4('0x1a')]()['then'](cmContactRpc[_0x3cd4('0x2a')](_0x26f2a0))['then'](function(_0x41f8f5){_0x560401=_0x41f8f5;_0x28d73c[_0x3cd4('0x2b')](_0x41f8f5);if(_0x560401){logger[_0x3cd4('0x1e')](_0x3cd4('0x2c'),_0x456cc3[_0x3cd4('0x20')],_0x5ba2a1['id'],_0x560401['id']);}return;});}else{logger[_0x3cd4('0x1e')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x456cc3[_0x3cd4('0x20')],_0x5ba2a1['id']);_0x26f2a0[_0x1ed471]=_['isNil'](_0x456cc3[_0x3cd4('0x12')])?_0x456cc3[_0x3cd4('0x2d')]:_0x456cc3[_0x3cd4('0x13')];if(_['isNil'](_0x456cc3[_0x3cd4('0x12')])){_0x26f2a0[_0x3cd4('0x14')]=_0x456cc3['calleridname']&&_0x456cc3[_0x3cd4('0x2e')]!==_0x3cd4('0x27')?_0x456cc3['calleridname']:'Unknown';}else{_0x26f2a0['firstName']=_0x456cc3[_0x3cd4('0x29')]&&_0x456cc3[_0x3cd4('0x29')]!==_0x3cd4('0x27')?_0x456cc3[_0x3cd4('0x29')]:'Unknown';}_0x560401=_0x26f2a0;_0x28d73c[_0x3cd4('0x2b')](_0x26f2a0);return;}}})[_0x3cd4('0x1b')](function(){if(_0x9e10fc){emit(_0x456cc3[_0x3cd4('0x20')],_0x5ba2a1,util[_0x3cd4('0x2f')](_0x3cd4('0x30'),_0x9e10fc[_0x3cd4('0x31')]),util[_0x3cd4('0x2f')](_0x3cd4('0x32'),_0xc1c70a[_0x3cd4('0x33')][_0x3cd4('0x34')]()),{'evt':_[_0x3cd4('0x35')](_0x456cc3,{'autoCreate':_0x181071}),'contact':_0x560401===undefined?{}:_0x560401,'contacts':_0x28d73c[_0x3cd4('0x1d')]===0x0?undefined:_0x28d73c});}});};
\ No newline at end of file
index 805a76b..98a713a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9be1=['redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','clone','undefined','motionChannel','voice','checkTriggers','agents','interface','status','merge','Actions','length','action','toLowerCase','contactmanager','data1','TemplateId','html','data2','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','data6','600','render','winArguments','format','user:%s','name','jscripty','trigger:%s','exec','integration','queue','script','parse','query','search','replace','channel','every','AllConditions','checkConditions','some','AnyConditions','field','account','operator','value','ChatWebsiteId','upperFirst','AccountId','message','event','agent','lastevent','routeId','mailSubstatus','substatus','exports','util','lodash','url','ioredis','./urlforward','./integration','./cmContact','../../../config/logger','../ami'];(function(_0x49c550,_0xa9cdcd){var _0x39da96=function(_0x1dc6d8){while(--_0x1dc6d8){_0x49c550['push'](_0x49c550['shift']());}};_0x39da96(++_0xa9cdcd);}(_0x9be1,0x6d));var _0x19be=function(_0x248ad2,_0x8b03ec){_0x248ad2=_0x248ad2-0x0;var _0x57ad08=_0x9be1[_0x248ad2];return _0x57ad08;};'use strict';var util=require(_0x19be('0x0'));var _=require(_0x19be('0x1'));var url=require(_0x19be('0x2'));var Mustache=require('mustache');var Redis=require(_0x19be('0x3'));var urlforward=require(_0x19be('0x4'));var integration=require(_0x19be('0x5'));var cmContact=require(_0x19be('0x6'));var script=require('./script');var config=require('../../../config/environment');var logger=require(_0x19be('0x7'))('trigger');var ami=require(_0x19be('0x8'));config[_0x19be('0x9')]=_[_0x19be('0xa')](config[_0x19be('0x9')],{'host':_0x19be('0xb'),'port':0x18eb});var io=require(_0x19be('0xc'))(new Redis(config['redis']));var operators={'equals':function(_0x4e3749,_0x53c6b8){return _0x4e3749==_0x53c6b8;},'not_equals':function(_0x19ddfe,_0x27c99e){return _0x19ddfe!=_0x27c99e;}};var barAndWebActions=[_0x19be('0xd'),_0x19be('0x2'),_0x19be('0xe')];function Trigger(_0x5a46d3){this['triggers']=_0x5a46d3[_0x19be('0xf')];this['agents']=_0x5a46d3['agents'];this[_0x19be('0x10')]=_0x5a46d3[_0x19be('0x10')];this[_0x19be('0x11')]=_0x5a46d3[_0x19be('0x11')];this[_0x19be('0x12')]=_0x5a46d3[_0x19be('0x12')];this[_0x19be('0x13')]=_0x5a46d3[_0x19be('0x13')];this['freshdeskAccounts']=_0x5a46d3[_0x19be('0x14')];this[_0x19be('0x15')]=_0x5a46d3[_0x19be('0x15')];this[_0x19be('0x16')]=_0x5a46d3[_0x19be('0x16')];this[_0x19be('0x17')]=_0x5a46d3['zohoAccounts'];this[_0x19be('0x18')]=_0x5a46d3[_0x19be('0x18')];this[_0x19be('0x19')]=_0x5a46d3[_0x19be('0x19')];this[_0x19be('0x1a')]=_0x5a46d3[_0x19be('0x1a')];this[_0x19be('0x1b')]=_0x5a46d3[_0x19be('0x1b')];this[_0x19be('0x1c')]=_0x5a46d3[_0x19be('0x1c')];this[_0x19be('0x1d')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x19be('0x15')],'freshdesk':this[_0x19be('0x14')],'sugarcrm':this[_0x19be('0x16')],'zoho':this[_0x19be('0x17')],'desk':this['deskAccounts'],'vtiger':this[_0x19be('0x19')],'dynamics365':this[_0x19be('0x1b')],'freshsales':this[_0x19be('0x1c')],'servicenow':this[_0x19be('0x1a')]};ami['on'](_0x19be('0x1e'),this[_0x19be('0x1f')][_0x19be('0x20')](this));ami['on'](_0x19be('0x21'),this['syncCustomEvent'][_0x19be('0x20')](this));ami['on'](_0x19be('0x22'),this[_0x19be('0x1f')][_0x19be('0x20')](this));ami['on'](_0x19be('0x23'),this[_0x19be('0x1f')][_0x19be('0x20')](this));ami['on'](_0x19be('0x24'),this[_0x19be('0x1f')][_0x19be('0x20')](this));ami['on']('custom:agentnoanswer',this[_0x19be('0x1f')][_0x19be('0x20')](this));ami['on']('custom:agentbusy',this[_0x19be('0x1f')][_0x19be('0x20')](this));ami['on']('custom:agentcongestion',this[_0x19be('0x1f')]['bind'](this));ami['on'](_0x19be('0x25'),this[_0x19be('0x1f')][_0x19be('0x20')](this));ami['on'](_0x19be('0x26'),this['syncCustomEvent'][_0x19be('0x20')](this));ami['on'](_0x19be('0x27'),this[_0x19be('0x1f')]['bind'](this));ami['on'](_0x19be('0x28'),this[_0x19be('0x1f')][_0x19be('0x20')](this));ami['on'](_0x19be('0x29'),this[_0x19be('0x2a')]['bind'](this));ami['on'](_0x19be('0x2b'),this[_0x19be('0x2a')][_0x19be('0x20')](this));ami['on'](_0x19be('0x2c'),this[_0x19be('0x2a')][_0x19be('0x20')](this));ami['on'](_0x19be('0x2d'),this['syncCustomEvent'][_0x19be('0x20')](this));ami['on'](_0x19be('0x2e'),this[_0x19be('0x1f')][_0x19be('0x20')](this));ami['on']('custom:incomingmessage',this[_0x19be('0x1f')][_0x19be('0x20')](this));ami['on'](_0x19be('0x2f'),this[_0x19be('0x1f')]['bind'](this));ami['on'](_0x19be('0x30'),this['syncCustomEvent']['bind'](this));ami['on'](_0x19be('0x31'),this['syncCustomEvent'][_0x19be('0x20')](this));}Trigger[_0x19be('0x32')][_0x19be('0x33')]=function(_0x2a0ae1,_0x8ce6,_0x5f0b0a){logger[_0x19be('0x34')](_0x2a0ae1,_0x8ce6,JSON['stringify'](_0x5f0b0a));io['to'](_0x2a0ae1)['emit'](_0x8ce6,_0x5f0b0a);};Trigger[_0x19be('0x32')][_0x19be('0x1f')]=function(_0x419ab5){var _0x10c967=_[_0x19be('0x35')](_0x419ab5);if(typeof _0x10c967['motionChannel']===_0x19be('0x36')){_0x10c967[_0x19be('0x37')]=_0x19be('0x38');}this[_0x19be('0x39')](_0x10c967);};Trigger[_0x19be('0x32')][_0x19be('0x2a')]=function(_0x580f4d){if(this[_0x19be('0x3a')][_0x580f4d[_0x19be('0x3b')]]){this[_0x19be('0x1f')](_0x580f4d);}};Trigger[_0x19be('0x32')][_0x19be('0x39')]=function(_0x56241e){var _0x31a12c;for(var _0x57cef2 in this[_0x19be('0xf')]){if(this[_0x19be('0xf')]['hasOwnProperty'](_0x57cef2)){if(this[_0x19be('0xf')][_0x57cef2][_0x19be('0x3c')]){_0x31a12c=this['checkTrigger'](this[_0x19be('0xf')][_0x57cef2],_0x56241e);if(_0x31a12c){_[_0x19be('0x3d')](_0x56241e,_0x56241e['variables']);for(var _0x649d9e=0x0,_0x5876a7,_0x8d9d4f,_0x2f8bca;_0x649d9e<this[_0x19be('0xf')][_0x57cef2][_0x19be('0x3e')][_0x19be('0x3f')];_0x649d9e+=0x1){_0x5876a7=this[_0x19be('0xf')][_0x57cef2][_0x19be('0x3e')][_0x649d9e];if(this[_0x19be('0x3a')][_0x56241e[_0x19be('0x3b')]]){switch(_0x5876a7[_0x19be('0x40')][_0x19be('0x41')]()){case _0x19be('0x42'):break;case'motionbar':case'browser':var _0x19c0ee={};switch(barAndWebActions[_0x5876a7[_0x19be('0x43')]]){case _0x19be('0xd'):_0x19c0ee[_0x19be('0x44')]=_0x5876a7['data2'];_0x19c0ee[_0x19be('0x45')]=this[_0x19be('0x11')][_0x5876a7['data2']]?Mustache['render'](this[_0x19be('0x11')][_0x5876a7[_0x19be('0x46')]]['html'],_0x56241e):'template\x20not\x20found';break;case _0x19be('0x2'):_0x19c0ee[_0x19be('0x47')]=this[_0x19be('0x48')](_0x5876a7[_0x19be('0x46')],_0x56241e,_[_0x19be('0x49')](_0x5876a7['data3'])?!![]:parseInt(_0x5876a7[_0x19be('0x4a')],0xa));if(_[_0x19be('0x49')](_0x5876a7[_0x19be('0x4b')])){_0x19c0ee[_0x19be('0x4c')]='0';}else{_0x19c0ee[_0x19be('0x4d')]=_0x5876a7[_0x19be('0x4b')];_0x19c0ee[_0x19be('0x4e')]=_[_0x19be('0x49')](_0x5876a7[_0x19be('0x4f')])?'800':_0x5876a7[_0x19be('0x4f')];_0x19c0ee['windowHeight']=_['isNil'](_0x5876a7[_0x19be('0x50')])?_0x19be('0x51'):_0x5876a7[_0x19be('0x50')];}break;case _0x19be('0xe'):_0x19c0ee['winApplication']=_0x5876a7['data2']?Mustache[_0x19be('0x52')](_0x5876a7[_0x19be('0x46')],_0x56241e):'';_0x19c0ee[_0x19be('0x53')]=_0x5876a7[_0x19be('0x4a')]?Mustache['render'](_0x5876a7['data3'],_0x56241e):'';break;}this[_0x19be('0x33')](util[_0x19be('0x54')](_0x19be('0x55'),this[_0x19be('0x3a')][_0x56241e[_0x19be('0x3b')]][_0x19be('0x56')]),util['format']('trigger:%s:%s',_0x5876a7[_0x19be('0x40')]['toLowerCase'](),barAndWebActions[_0x5876a7[_0x19be('0x43')]]),_['merge'](_0x19c0ee,_0x56241e));break;case _0x19be('0x57'):this[_0x19be('0x33')](util[_0x19be('0x54')]('user:%s',this[_0x19be('0x3a')][_0x56241e[_0x19be('0x3b')]][_0x19be('0x56')]),util[_0x19be('0x54')](_0x19be('0x58'),_0x5876a7[_0x19be('0x40')][_0x19be('0x41')]()),_[_0x19be('0x3d')]({'ProjectId':parseInt(_0x5876a7[_0x19be('0x43')],0xa)},_0x56241e));break;default:this[_0x19be('0x33')](util[_0x19be('0x54')](_0x19be('0x55'),this[_0x19be('0x3a')][_0x56241e[_0x19be('0x3b')]][_0x19be('0x56')]),util[_0x19be('0x54')](_0x19be('0x58'),_0x5876a7[_0x19be('0x40')][_0x19be('0x41')]()),_[_0x19be('0x3d')]({},_0x5876a7,_0x56241e));}}switch(_0x5876a7[_0x19be('0x40')][_0x19be('0x41')]()){case _0x19be('0x42'):cmContact[_0x19be('0x59')](this[_0x19be('0x3a')][_0x56241e[_0x19be('0x3b')]],this[_0x19be('0xf')][_0x57cef2],_0x5876a7,_0x56241e);break;case _0x19be('0x5a'):integration[_0x19be('0x59')](_0x5876a7,_0x56241e,this[_0x19be('0x1d')],this[_0x19be('0x3a')][_0x56241e[_0x19be('0x3b')]],this[_0x19be('0x10')][_0x56241e[_0x19be('0x5b')]],this[_0x19be('0x12')][_0x56241e['routeId']]);break;case'urlforward':urlforward[_0x19be('0x59')](_0x5876a7,_0x56241e);break;case _0x19be('0x5c'):script['exec'](_0x5876a7,_0x56241e);break;}}}}}}};Trigger[_0x19be('0x32')]['buildUri']=function(_0x178fa7,_0x17780c,_0x37e616){var _0x447615=url[_0x19be('0x5d')](Mustache[_0x19be('0x52')](_0x178fa7,_0x17780c),!![]);if(_0x37e616){_['merge'](_0x447615[_0x19be('0x5e')],_0x17780c);}delete _0x447615[_0x19be('0x5f')];var _0xa64369=url[_0x19be('0x54')](_0x447615);_0xa64369=_0xa64369[_0x19be('0x60')](/\/\?/g,'?');return _0xa64369;};Trigger[_0x19be('0x32')]['checkTrigger']=function(_0x22d61b,_0x5ba302){var _0x43b639=!![];var _0x578292=!![];var _0x568642=![];if(_0x22d61b[_0x19be('0x61')]===_0x5ba302[_0x19be('0x37')]){_0x568642=!![];}if(_0x22d61b['AllConditions']['length']){_0x43b639=_[_0x19be('0x62')](_0x22d61b[_0x19be('0x63')],this[_0x19be('0x64')](_0x5ba302,_0x22d61b[_0x19be('0x61')]));}if(_0x22d61b['AnyConditions'][_0x19be('0x3f')]){_0x578292=_[_0x19be('0x65')](_0x22d61b[_0x19be('0x66')],this[_0x19be('0x64')](_0x5ba302,_0x22d61b[_0x19be('0x61')]));}return _0x568642&&_0x43b639&&_0x578292;};Trigger[_0x19be('0x32')]['checkConditions']=function(_0x2eb825,_0xfe8694){return function(_0x5912b9){switch(_0x5912b9[_0x19be('0x67')]){case _0x19be('0x68'):if(_0x2eb825[_0x19be('0x61')]===_0xfe8694){if(_0xfe8694==='chat'){return _0x2eb825['ChatWebsiteId']?operators[_0x5912b9[_0x19be('0x69')]](Number(_0x5912b9[_0x19be('0x6a')]),_0x2eb825[_0x19be('0x6b')]):![];}else{return _0x2eb825[_[_0x19be('0x6c')](_0xfe8694)+_0x19be('0x6d')]?operators[_0x5912b9['operator']](Number(_0x5912b9[_0x19be('0x6a')]),_0x2eb825[_[_0x19be('0x6c')](_0xfe8694)+_0x19be('0x6d')]):![];}}break;case'interaction':case _0x19be('0x6e'):if(_0x2eb825[_0x19be('0x61')]===_0xfe8694){return _0x2eb825['event']?operators[_0x5912b9[_0x19be('0x69')]](_0x5912b9[_0x19be('0x6a')],_0x2eb825[_0x19be('0x6f')]):![];}break;case _0x19be('0x5b'):return _0x2eb825[_0x19be('0x5b')]?operators[_0x5912b9['operator']](_0x5912b9[_0x19be('0x6a')],_0x2eb825['queue']):![];case _0x19be('0x70'):return _0x2eb825['membername']?operators[_0x5912b9[_0x19be('0x69')]](_0x5912b9[_0x19be('0x6a')],_0x2eb825['membername']):![];case _0x19be('0x71'):return _0x2eb825[_0x19be('0x71')]?operators[_0x5912b9[_0x19be('0x69')]](_0x5912b9[_0x19be('0x6a')],_0x2eb825[_0x19be('0x71')]):![];case'routeId':return _0x2eb825[_0x19be('0x72')]?operators[_0x5912b9[_0x19be('0x69')]](_0x5912b9[_0x19be('0x6a')],_0x2eb825[_0x19be('0x72')]):![];case _0x19be('0x73'):return _0x2eb825[_0x19be('0x74')]?operators[_0x5912b9[_0x19be('0x69')]](_0x5912b9[_0x19be('0x6a')],_0x2eb825['substatus']):![];}return![];};};module[_0x19be('0x75')]=Trigger;
\ No newline at end of file
+var _0x455a=['voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','emit','info','stringify','prototype','clone','motionChannel','voice','checkTriggers','agents','interface','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','uriLocation','windowWidth','data5','800','windowHeight','600','winApplication','winArguments','name','format','trigger:%s:%s','jscripty','user:%s','trigger:%s','exec','integration','routeId','urlforward','query','channel','AllConditions','every','some','AnyConditions','checkConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','interaction','message','event','queue','agent','membername','lastevent','mailSubstatus','substatus','util','lodash','url','mustache','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','popup','winapp','triggers'];(function(_0x30acca,_0x37944c){var _0x39febe=function(_0x331b6c){while(--_0x331b6c){_0x30acca['push'](_0x30acca['shift']());}};_0x39febe(++_0x37944c);}(_0x455a,0xe3));var _0xa455=function(_0x561bd8,_0x2458de){_0x561bd8=_0x561bd8-0x0;var _0x355db5=_0x455a[_0x561bd8];return _0x355db5;};'use strict';var util=require(_0xa455('0x0'));var _=require(_0xa455('0x1'));var url=require(_0xa455('0x2'));var Mustache=require(_0xa455('0x3'));var Redis=require('ioredis');var urlforward=require(_0xa455('0x4'));var integration=require('./integration');var cmContact=require(_0xa455('0x5'));var script=require(_0xa455('0x6'));var config=require(_0xa455('0x7'));var logger=require(_0xa455('0x8'))(_0xa455('0x9'));var ami=require(_0xa455('0xa'));config[_0xa455('0xb')]=_['defaults'](config[_0xa455('0xb')],{'host':_0xa455('0xc'),'port':0x18eb});var io=require(_0xa455('0xd'))(new Redis(config[_0xa455('0xb')]));var operators={'equals':function(_0x3c0e6d,_0xb1d057){return _0x3c0e6d==_0xb1d057;},'not_equals':function(_0x6782fc,_0x102ba2){return _0x6782fc!=_0x102ba2;}};var barAndWebActions=[_0xa455('0xe'),_0xa455('0x2'),_0xa455('0xf')];function Trigger(_0x308925){this[_0xa455('0x10')]=_0x308925['triggers'];this['agents']=_0x308925['agents'];this[_0xa455('0x11')]=_0x308925[_0xa455('0x11')];this['templates']=_0x308925[_0xa455('0x12')];this['voiceExtensions']=_0x308925[_0xa455('0x13')];this[_0xa455('0x14')]=_0x308925[_0xa455('0x14')];this[_0xa455('0x15')]=_0x308925[_0xa455('0x15')];this['salesforceAccounts']=_0x308925[_0xa455('0x16')];this['sugarcrmAccounts']=_0x308925[_0xa455('0x17')];this[_0xa455('0x18')]=_0x308925[_0xa455('0x18')];this[_0xa455('0x19')]=_0x308925[_0xa455('0x19')];this['vtigerAccounts']=_0x308925['vtigerAccounts'];this['servicenowAccounts']=_0x308925[_0xa455('0x1a')];this[_0xa455('0x1b')]=_0x308925['dynamics365Accounts'];this['freshsalesAccounts']=_0x308925[_0xa455('0x1c')];this[_0xa455('0x1d')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xa455('0x16')],'freshdesk':this[_0xa455('0x15')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xa455('0x18')],'desk':this[_0xa455('0x19')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xa455('0x1b')],'freshsales':this[_0xa455('0x1c')],'servicenow':this[_0xa455('0x1a')]};ami['on'](_0xa455('0x1e'),this[_0xa455('0x1f')][_0xa455('0x20')](this));ami['on']('custom:agentconnect',this[_0xa455('0x1f')][_0xa455('0x20')](this));ami['on'](_0xa455('0x21'),this[_0xa455('0x1f')][_0xa455('0x20')](this));ami['on'](_0xa455('0x22'),this[_0xa455('0x1f')][_0xa455('0x20')](this));ami['on'](_0xa455('0x23'),this[_0xa455('0x1f')]['bind'](this));ami['on'](_0xa455('0x24'),this[_0xa455('0x1f')][_0xa455('0x20')](this));ami['on']('custom:agentbusy',this[_0xa455('0x1f')][_0xa455('0x20')](this));ami['on'](_0xa455('0x25'),this[_0xa455('0x1f')]['bind'](this));ami['on']('custom:agentreject',this[_0xa455('0x1f')][_0xa455('0x20')](this));ami['on'](_0xa455('0x26'),this[_0xa455('0x1f')]['bind'](this));ami['on'](_0xa455('0x27'),this[_0xa455('0x1f')][_0xa455('0x20')](this));ami['on'](_0xa455('0x28'),this['syncCustomEvent']['bind'](this));ami['on'](_0xa455('0x29'),this[_0xa455('0x2a')][_0xa455('0x20')](this));ami['on'](_0xa455('0x2b'),this[_0xa455('0x2a')]['bind'](this));ami['on']('custom:dialend',this['syncAgentDial'][_0xa455('0x20')](this));ami['on'](_0xa455('0x2c'),this[_0xa455('0x1f')]['bind'](this));ami['on'](_0xa455('0x2d'),this['syncCustomEvent']['bind'](this));ami['on'](_0xa455('0x2e'),this[_0xa455('0x1f')]['bind'](this));ami['on'](_0xa455('0x2f'),this['syncCustomEvent'][_0xa455('0x20')](this));ami['on'](_0xa455('0x30'),this[_0xa455('0x1f')][_0xa455('0x20')](this));ami['on']('custom:rejectmessage',this[_0xa455('0x1f')]['bind'](this));}Trigger['prototype'][_0xa455('0x31')]=function(_0x4de4f4,_0x560b1d,_0x187ee5){logger[_0xa455('0x32')](_0x4de4f4,_0x560b1d,JSON[_0xa455('0x33')](_0x187ee5));io['to'](_0x4de4f4)[_0xa455('0x31')](_0x560b1d,_0x187ee5);};Trigger[_0xa455('0x34')][_0xa455('0x1f')]=function(_0x20449b){var _0x25e5a8=_[_0xa455('0x35')](_0x20449b);if(typeof _0x25e5a8[_0xa455('0x36')]==='undefined'){_0x25e5a8[_0xa455('0x36')]=_0xa455('0x37');}this[_0xa455('0x38')](_0x25e5a8);};Trigger[_0xa455('0x34')][_0xa455('0x2a')]=function(_0x431bd9){if(this[_0xa455('0x39')][_0x431bd9[_0xa455('0x3a')]]){this[_0xa455('0x1f')](_0x431bd9);}};Trigger[_0xa455('0x34')]['checkTriggers']=function(_0x57bdad){var _0x41f23f;for(var _0xdf287f in this['triggers']){if(this['triggers']['hasOwnProperty'](_0xdf287f)){if(this[_0xa455('0x10')][_0xdf287f][_0xa455('0x3b')]){_0x41f23f=this[_0xa455('0x3c')](this[_0xa455('0x10')][_0xdf287f],_0x57bdad);if(_0x41f23f){_[_0xa455('0x3d')](_0x57bdad,_0x57bdad[_0xa455('0x3e')]);for(var _0x4a1f3b=0x0,_0x5a5a76,_0x2a52b6,_0x527535;_0x4a1f3b<this[_0xa455('0x10')][_0xdf287f][_0xa455('0x3f')][_0xa455('0x40')];_0x4a1f3b+=0x1){_0x5a5a76=this['triggers'][_0xdf287f][_0xa455('0x3f')][_0x4a1f3b];if(this[_0xa455('0x39')][_0x57bdad[_0xa455('0x3a')]]){switch(_0x5a5a76[_0xa455('0x41')][_0xa455('0x42')]()){case _0xa455('0x43'):break;case _0xa455('0x44'):case _0xa455('0x45'):var _0x5bd93c={};switch(barAndWebActions[_0x5a5a76[_0xa455('0x46')]]){case _0xa455('0xe'):_0x5bd93c[_0xa455('0x47')]=_0x5a5a76[_0xa455('0x48')];_0x5bd93c[_0xa455('0x49')]=this[_0xa455('0x12')][_0x5a5a76[_0xa455('0x48')]]?Mustache[_0xa455('0x4a')](this[_0xa455('0x12')][_0x5a5a76[_0xa455('0x48')]][_0xa455('0x49')],_0x57bdad):_0xa455('0x4b');break;case'url':_0x5bd93c[_0xa455('0x4c')]=this[_0xa455('0x4d')](_0x5a5a76[_0xa455('0x48')],_0x57bdad,_[_0xa455('0x4e')](_0x5a5a76[_0xa455('0x4f')])?!![]:parseInt(_0x5a5a76[_0xa455('0x4f')],0xa));if(_[_0xa455('0x4e')](_0x5a5a76[_0xa455('0x50')])){_0x5bd93c['location']='0';}else{_0x5bd93c[_0xa455('0x51')]=_0x5a5a76[_0xa455('0x50')];_0x5bd93c[_0xa455('0x52')]=_[_0xa455('0x4e')](_0x5a5a76[_0xa455('0x53')])?_0xa455('0x54'):_0x5a5a76[_0xa455('0x53')];_0x5bd93c[_0xa455('0x55')]=_[_0xa455('0x4e')](_0x5a5a76['data6'])?_0xa455('0x56'):_0x5a5a76['data6'];}break;case _0xa455('0xf'):_0x5bd93c[_0xa455('0x57')]=_0x5a5a76[_0xa455('0x48')]?Mustache[_0xa455('0x4a')](_0x5a5a76[_0xa455('0x48')],_0x57bdad):'';_0x5bd93c[_0xa455('0x58')]=_0x5a5a76['data3']?Mustache[_0xa455('0x4a')](_0x5a5a76[_0xa455('0x4f')],_0x57bdad):'';break;}this[_0xa455('0x31')](util['format']('user:%s',this[_0xa455('0x39')][_0x57bdad[_0xa455('0x3a')]][_0xa455('0x59')]),util[_0xa455('0x5a')](_0xa455('0x5b'),_0x5a5a76['action'][_0xa455('0x42')](),barAndWebActions[_0x5a5a76[_0xa455('0x46')]]),_[_0xa455('0x3d')](_0x5bd93c,_0x57bdad));break;case _0xa455('0x5c'):this[_0xa455('0x31')](util[_0xa455('0x5a')](_0xa455('0x5d'),this[_0xa455('0x39')][_0x57bdad['interface']][_0xa455('0x59')]),util[_0xa455('0x5a')](_0xa455('0x5e'),_0x5a5a76[_0xa455('0x41')]['toLowerCase']()),_[_0xa455('0x3d')]({'ProjectId':parseInt(_0x5a5a76[_0xa455('0x46')],0xa)},_0x57bdad));break;default:this['emit'](util[_0xa455('0x5a')](_0xa455('0x5d'),this['agents'][_0x57bdad[_0xa455('0x3a')]][_0xa455('0x59')]),util[_0xa455('0x5a')](_0xa455('0x5e'),_0x5a5a76[_0xa455('0x41')][_0xa455('0x42')]()),_[_0xa455('0x3d')]({},_0x5a5a76,_0x57bdad));}}switch(_0x5a5a76[_0xa455('0x41')][_0xa455('0x42')]()){case _0xa455('0x43'):cmContact[_0xa455('0x5f')](this[_0xa455('0x39')][_0x57bdad[_0xa455('0x3a')]],this['triggers'][_0xdf287f],_0x5a5a76,_0x57bdad);break;case _0xa455('0x60'):integration[_0xa455('0x5f')](_0x5a5a76,_0x57bdad,this['accounts'],this[_0xa455('0x39')][_0x57bdad[_0xa455('0x3a')]],this['voiceQueues'][_0x57bdad['queue']],this[_0xa455('0x13')][_0x57bdad[_0xa455('0x61')]]);break;case _0xa455('0x62'):urlforward[_0xa455('0x5f')](_0x5a5a76,_0x57bdad);break;case'script':script['exec'](_0x5a5a76,_0x57bdad);break;}}}}}}};Trigger[_0xa455('0x34')][_0xa455('0x4d')]=function(_0x452a58,_0x56dd7a,_0x5ebccd){var _0x203cff=url['parse'](Mustache[_0xa455('0x4a')](_0x452a58,_0x56dd7a),!![]);if(_0x5ebccd){_['merge'](_0x203cff[_0xa455('0x63')],_0x56dd7a);}delete _0x203cff['search'];var _0x5b6a3a=url[_0xa455('0x5a')](_0x203cff);_0x5b6a3a=_0x5b6a3a['replace'](/\/\?/g,'?');return _0x5b6a3a;};Trigger[_0xa455('0x34')][_0xa455('0x3c')]=function(_0x2b4919,_0x284022){var _0x463574=!![];var _0x5af771=!![];var _0x189424=![];if(_0x2b4919[_0xa455('0x64')]===_0x284022[_0xa455('0x36')]){_0x189424=!![];}if(_0x2b4919[_0xa455('0x65')][_0xa455('0x40')]){_0x463574=_[_0xa455('0x66')](_0x2b4919[_0xa455('0x65')],this['checkConditions'](_0x284022,_0x2b4919[_0xa455('0x64')]));}if(_0x2b4919['AnyConditions'][_0xa455('0x40')]){_0x5af771=_[_0xa455('0x67')](_0x2b4919[_0xa455('0x68')],this[_0xa455('0x69')](_0x284022,_0x2b4919[_0xa455('0x64')]));}return _0x189424&&_0x463574&&_0x5af771;};Trigger['prototype'][_0xa455('0x69')]=function(_0x268734,_0x20fe02){return function(_0x7b69e3){switch(_0x7b69e3[_0xa455('0x6a')]){case _0xa455('0x6b'):if(_0x268734[_0xa455('0x64')]===_0x20fe02){if(_0x20fe02===_0xa455('0x6c')){return _0x268734[_0xa455('0x6d')]?operators[_0x7b69e3[_0xa455('0x6e')]](Number(_0x7b69e3[_0xa455('0x6f')]),_0x268734[_0xa455('0x6d')]):![];}else{return _0x268734[_[_0xa455('0x70')](_0x20fe02)+'AccountId']?operators[_0x7b69e3[_0xa455('0x6e')]](Number(_0x7b69e3['value']),_0x268734[_['upperFirst'](_0x20fe02)+'AccountId']):![];}}break;case _0xa455('0x71'):case _0xa455('0x72'):if(_0x268734[_0xa455('0x64')]===_0x20fe02){return _0x268734[_0xa455('0x73')]?operators[_0x7b69e3['operator']](_0x7b69e3[_0xa455('0x6f')],_0x268734['event']):![];}break;case'queue':return _0x268734[_0xa455('0x74')]?operators[_0x7b69e3[_0xa455('0x6e')]](_0x7b69e3[_0xa455('0x6f')],_0x268734['queue']):![];case _0xa455('0x75'):return _0x268734[_0xa455('0x76')]?operators[_0x7b69e3['operator']](_0x7b69e3[_0xa455('0x6f')],_0x268734['membername']):![];case'lastevent':return _0x268734[_0xa455('0x77')]?operators[_0x7b69e3['operator']](_0x7b69e3[_0xa455('0x6f')],_0x268734[_0xa455('0x77')]):![];case'routeId':return _0x268734[_0xa455('0x61')]?operators[_0x7b69e3[_0xa455('0x6e')]](_0x7b69e3['value'],_0x268734[_0xa455('0x61')]):![];case _0xa455('0x78'):return _0x268734[_0xa455('0x79')]?operators[_0x7b69e3[_0xa455('0x6e')]](_0x7b69e3[_0xa455('0x6f')],_0x268734[_0xa455('0x79')]):![];}return![];};};module['exports']=Trigger;
\ No newline at end of file
index 9ebee7b..80a7ed2 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(_0x51bb0b,_0x256820){var _0x5cec97=function(_0x2a39b7){while(--_0x2a39b7){_0x51bb0b['push'](_0x51bb0b['shift']());}};_0x5cec97(++_0x256820);}(_0x814b,0x1a2));var _0xb814=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0x814b[_0x51d129];return _0x44c377;};'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 _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x1ef53d,_0x517baa){var _0x596dc4=function(_0x5a7979){while(--_0x5a7979){_0x1ef53d['push'](_0x1ef53d['shift']());}};_0x596dc4(++_0x517baa);}(_0x3e74,0x175));var _0x43e7=function(_0x4f19aa,_0x4795ac){_0x4f19aa=_0x4f19aa-0x0;var _0x3711e4=_0x3e74[_0x4f19aa];return _0x3711e4;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});};
\ No newline at end of file
index 3f7baf5..b79d8e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61f6=[']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','name','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','userEmail','email','length','isdisabled','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','%2b','contactid',']\x20Enduser\x20created!','forEach','includes','string','nameField','customField','indexOf','content','ticketType','incident','assign','getString','Subjects','/contacts(','Fields','phonecall','phonecalls','Descriptions','queue','callDirection','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','remoteUri','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:'];(function(_0x234e1a,_0x500d79){var _0x55aad2=function(_0x272396){while(--_0x272396){_0x234e1a['push'](_0x234e1a['shift']());}};_0x55aad2(++_0x500d79);}(_0x61f6,0x128));var _0x661f=function(_0x4a80f6,_0x3d43ad){_0x4a80f6=_0x4a80f6-0x0;var _0x5bc762=_0x61f6[_0x4a80f6];return _0x5bc762;};'use strict';var _=require(_0x661f('0x0'));var BPromise=require(_0x661f('0x1'));var rp=require(_0x661f('0x2'));var util=require(_0x661f('0x3'));var intUtil=require(_0x661f('0x4'));var md5=require(_0x661f('0x5'));var Redis=require(_0x661f('0x6'));var logger=require(_0x661f('0x7'))(_0x661f('0x8'));var config=require(_0x661f('0x9'));config['redis']=_[_0x661f('0xa')](config[_0x661f('0xb')],{'host':_0x661f('0xc'),'port':0x18eb});var io=require(_0x661f('0xd'))(new Redis(config[_0x661f('0xb')]));function getAuthToken(_0xb54801,_0x210e1d,_0x239efd){var _0x3d6342={'method':'POST','uri':_0x210e1d,'form':{'client_id':_0xb54801['clientId'],'resource':_0xb54801['remoteUri'],'username':_0xb54801['username'],'password':_0xb54801[_0x661f('0xe')],'grant_type':'password','client_secret':_0xb54801[_0x661f('0xf')]},'json':!![]};return rp(_0x3d6342)[_0x661f('0x10')](function(_0x28e122){return _0x28e122['access_token'];})[_0x661f('0x11')](function(_0x3f6d1c){logger[_0x661f('0x12')]('['+[_0x239efd[_0x661f('0x13')]()]+_0x661f('0x14'));return _0x3f6d1c[_0x661f('0x15')];});}function getUser(_0x9a2d63,_0x1850f8,_0x10c392,_0x5c8589,_0xfe4232,_0x1332dd){return new BPromise(function(_0x3afc24,_0x447287){return getAuthToken(_0x1850f8,_0x5c8589,_0x1332dd)[_0x661f('0x10')](function(_0x21dab2){var _0x2a5135={'method':_0x661f('0x16'),'uri':_0xfe4232+_0x661f('0x17'),'headers':{'Authorization':_0x661f('0x18')+_0x21dab2,'OData-Version':_0x661f('0x19')},'json':!![]};return rp(_0x2a5135);})[_0x661f('0x10')](function(_0x1134e7){var _0x23eb26=_0x1134e7[_0x661f('0x1a')];var _0x307121=![];var _0x362fc1=null;if(!_[_0x661f('0x1b')](_0x10c392)){if(intUtil['validateEmail'](_0x10c392['email'])){_0x9a2d63[_0x661f('0x1c')]=_0x10c392[_0x661f('0x1d')];for(_0x362fc1=0x0;_0x362fc1<_0x23eb26[_0x661f('0x1e')];_0x362fc1++){if(_0x23eb26[_0x362fc1]['internalemailaddress']===_0x10c392[_0x661f('0x1d')]&&!_0x23eb26[_0x362fc1][_0x661f('0x1f')]){_0x307121=!![];logger['info']('['+[_0x1332dd[_0x661f('0x13')]()]+']\x20Agent\x20found\x20'+_0x23eb26[_0x362fc1][_0x661f('0x20')]+'!');_0x9a2d63[_0x661f('0x21')]=_0x23eb26[_0x362fc1]['systemuserid'];}}}}if(!_0x307121){logger[_0x661f('0x22')]('['+[_0x1332dd[_0x661f('0x13')]()]+_0x661f('0x23'));_0x9a2d63['userEmail']=_0x1850f8[_0x661f('0x24')];for(_0x362fc1=0x0;_0x362fc1<_0x23eb26['length'];_0x362fc1++){if(_0x23eb26[_0x362fc1]['internalemailaddress']===_0x1850f8[_0x661f('0x24')]){_0x9a2d63[_0x661f('0x21')]=_0x23eb26[_0x362fc1][_0x661f('0x20')];}}}_0x3afc24(_0x9a2d63);})[_0x661f('0x11')](function(_0x1d47a0){_0x447287(_0x1d47a0[_0x661f('0x15')]);});});}function createEndUser(_0x51d4a5,_0x4e2229,_0x127d4b,_0x12fd1b,_0x3c31c9,_0x5bc28a){return new BPromise(function(_0x54cc0d,_0x1f4c12){return getAuthToken(_0x4e2229,_0x127d4b,_0x5bc28a)[_0x661f('0x10')](function(_0x728587){var _0x40a52f=_0x5bc28a[_0x661f('0x25')]()===_0x661f('0x26')?_0x3c31c9[_0x661f('0x27')]:_0x3c31c9[_0x661f('0x28')];var _0x49bc06={'method':_0x661f('0x29'),'uri':_0x12fd1b+_0x661f('0x2a'),'body':{'telephone1':_0x40a52f,'fullname':_0x40a52f,'firstname':_0x40a52f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x661f('0x2b')+_0x51d4a5[_0x661f('0x21')]+')'},'headers':{'Authorization':_0x661f('0x18')+_0x728587,'OData-Version':_0x661f('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x49bc06);})[_0x661f('0x10')](function(_0x2e6e0f){var _0x4fe61e=_0x2e6e0f[_0x661f('0x2c')]['odata-entityid'];var _0x2df724=_0x4fe61e[_0x661f('0x2d')](_0x4fe61e['lastIndexOf']('(')+0x1,_0x4fe61e[_0x661f('0x2e')](')'));_0x51d4a5[_0x661f('0x2f')]=_0x2df724;_0x54cc0d(_0x51d4a5);})[_0x661f('0x11')](function(_0x565bc2){_0x1f4c12(_0x565bc2['message']);});});}function getEndUser(_0x499513,_0x57977e,_0x4ea922,_0x36a30c,_0x190207,_0x9c58ea){return new BPromise(function(_0x3fc80d,_0x3ac8eb){var _0x46268d=_0x9c58ea[_0x661f('0x25')]()===_0x661f('0x26')?_0x190207[_0x661f('0x27')]:_0x190207[_0x661f('0x28')];return getAuthToken(_0x57977e,_0x4ea922,_0x9c58ea)[_0x661f('0x10')](function(_0x340d91){var _0x15f232={'method':'GET','uri':_0x36a30c+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x46268d['replace']('+',_0x661f('0x30'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x340d91,'If-None-Match':null,'OData-Version':_0x661f('0x19')},'json':!![]};return rp(_0x15f232);})[_0x661f('0x10')](function(_0x44fec0){var _0x28940a=null;if(_0x44fec0){var _0x37e22b=_0x44fec0['value'];var _0x27abfe=![];for(_0x28940a=0x0;_0x28940a<_0x37e22b[_0x661f('0x1e')];_0x28940a++){if(_0x37e22b[_0x28940a]['telephone1']===_0x46268d){_0x27abfe=!![];_0x499513[_0x661f('0x2f')]=_0x37e22b[_0x28940a][_0x661f('0x31')];}}if(_0x27abfe){_0x3fc80d(_0x499513);}else{return createEndUser(_0x499513,_0x57977e,_0x4ea922,_0x36a30c,_0x190207,_0x9c58ea)[_0x661f('0x10')](function(_0x46ba4d){logger[_0x661f('0x22')]('['+[_0x9c58ea['toUpperCase']()]+_0x661f('0x32'),_0x46ba4d['enduserId']);_0x3fc80d(_0x46ba4d);});}}else{return createEndUser(_0x499513,_0x57977e,_0x4ea922,_0x36a30c,_0x190207,_0x9c58ea)[_0x661f('0x10')](function(_0x837607){logger[_0x661f('0x22')]('['+[_0x9c58ea[_0x661f('0x13')]()]+']\x20Enduser\x20Created!',_0x837607[_0x661f('0x2f')]);_0x3fc80d(_0x837607);});}});});}function getCustomFields(_0x123853,_0x1f4594,_0xe284c2){var _0xcc374e={};if(_0x123853[_0x661f('0x1e')]>0x0){_[_0x661f('0x33')](_0x123853,function(_0x24ee33){if(_[_0x661f('0x34')]([_0x661f('0x35'),'picklist'],_0x24ee33['type'])&&_0x24ee33[_0x661f('0x36')]&&!_0x24ee33[_0x661f('0x37')]){var _0x1ecefc=_0x24ee33['idField'][_0x661f('0x25')]();var _0x1ecc74=_0x1ecefc[_0x661f('0x2d')](0x0,_0x1ecefc[_0x661f('0x38')]('_'));var _0x6534ea=_0x1ecefc[_0x661f('0x2d')](_0x1ecefc['indexOf']('_')+0x1);if(_0x1ecc74===_0xe284c2){_0xcc374e[_0x6534ea]=_0x24ee33[_0x661f('0x39')];}}});}return _0xcc374e;}function getTicket(_0x4a6e41,_0x146394,_0x59fef1,_0x455172,_0x5cac7f,_0x590953,_0x1f2ba7){return new BPromise(function(_0x5163ef,_0x5f4bd1){var _0x1ac99c;return getAuthToken(_0x146394,_0x59fef1,_0x1f2ba7)['then'](function(_0x5eb97b){if(_0x590953[_0x661f('0x3a')]===_0x661f('0x3b')){_0x1ac99c={'method':_0x661f('0x29'),'uri':_0x455172+'incidents','body':Object[_0x661f('0x3c')]({},{'title':intUtil[_0x661f('0x3d')](_0x590953[_0x661f('0x3e')],_0x5cac7f,'\x20'),'description':intUtil['getString'](_0x590953['Descriptions'],_0x5cac7f,'\x0a'),'customerid_contact@odata.bind':_0x661f('0x3f')+_0x4a6e41['enduserId']+')','ownerid@odata.bind':_0x661f('0x2b')+_0x4a6e41[_0x661f('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x590953[_0x661f('0x40')],_0x5cac7f,_0x590953[_0x661f('0x3a')])),'headers':{'Authorization':_0x661f('0x18')+_0x5eb97b,'OData-Version':_0x661f('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x590953[_0x661f('0x3a')]===_0x661f('0x41')){_0x1ac99c={'method':'POST','uri':_0x455172+_0x661f('0x42'),'body':Object[_0x661f('0x3c')]({},{'subject':intUtil[_0x661f('0x3d')](_0x590953[_0x661f('0x3e')],_0x5cac7f,'\x20'),'phonenumber':String(_0x5cac7f[_0x661f('0x28')]),'description':intUtil[_0x661f('0x3d')](_0x590953[_0x661f('0x43')],_0x5cac7f,'\x0a'),'regardingobjectid_contact@odata.bind':_0x661f('0x3f')+_0x4a6e41['enduserId']+')','ownerid@odata.bind':_0x661f('0x2b')+_0x4a6e41[_0x661f('0x21')]+')','directioncode':_0x4a6e41['callDirection']===_0x661f('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x661f('0x2b')+_0x4a6e41[_0x661f('0x21')]+')','participationtypemask':_0x4a6e41['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x661f('0x3f')+_0x4a6e41[_0x661f('0x2f')]+')','participationtypemask':_0x4a6e41[_0x661f('0x45')]==='queue'?0x1:0x2}]},getCustomFields(_0x590953[_0x661f('0x40')],_0x5cac7f,_0x590953[_0x661f('0x3a')])),'headers':{'Authorization':'Bearer\x20'+_0x5eb97b,'OData-Version':_0x661f('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1ac99c);})['then'](function(_0x4b22de){var _0x16d872=_0x4b22de[_0x661f('0x2c')][_0x661f('0x46')];var _0x1419bd=_0x16d872[_0x661f('0x2d')](_0x16d872[_0x661f('0x2e')]('(')+0x1,_0x16d872['lastIndexOf'](')'));_0x4a6e41['ticketId']=_0x1419bd;_0x5163ef(_0x4a6e41);})[_0x661f('0x11')](function(_0x6a5bff){_0x5f4bd1(_0x6a5bff[_0x661f('0x15')]);});});}function emit(_0x148c48,_0x2b44e8,_0x5cb68e,_0x2f1f41){var _0x48539e={'uri':util[_0x661f('0x47')](_0x661f('0x48'),_0x148c48,_0x5cb68e,_0x2f1f41)};io['to'](util[_0x661f('0x47')]('user:%s',_0x2b44e8))[_0x661f('0x49')](_0x661f('0x4a'),_0x48539e);}exports['cs']=function(_0x443080,_0x1d724b,_0x221608,_0x4f815d,_0x18655b,_0x28c530,_0x33122e,_0x2c19ea){var _0x277c34={};_0x28c530['remoteUri']=intUtil[_0x661f('0x4b')](_0x28c530[_0x661f('0x4c')]);_0x28c530[_0x661f('0x4d')]=intUtil[_0x661f('0x4b')](_0x28c530[_0x661f('0x4d')]);_0x277c34[_0x661f('0x45')]=_0x2c19ea===_0x661f('0x44')||_0x2c19ea===_0x661f('0x4e')?_0x661f('0x44'):_0x661f('0x26');var _0x16a5a4=util[_0x661f('0x47')](_0x661f('0x4f'),_0x28c530[_0x661f('0x4c')]);var _0x23ec63=util[_0x661f('0x47')](_0x661f('0x50'),_0x28c530[_0x661f('0x51')]);var _0x231d20=util[_0x661f('0x47')](_0x661f('0x52'),_0x28c530['serverUrl'],_0x1d724b[_0x661f('0x53')],md5(_0x1d724b[_0x661f('0x53')]));if(_0x18655b&&_0x18655b[_0x661f('0x54')]){logger[_0x661f('0x22')]('[QUEUE]','Recording\x20is\x20enabled!');_0x1d724b['recordingURL']=_0x231d20;}else if(_0x33122e&&_0x33122e['recordingFormat']&&_0x33122e['recordingFormat']!==_0x661f('0x55')){logger[_0x661f('0x22')](_0x661f('0x56'),_0x661f('0x57'));_0x1d724b[_0x661f('0x58')]=_0x231d20;}else{_0x1d724b[_0x661f('0x58')]='';}return getUser(_0x277c34,_0x28c530,_0x4f815d,_0x23ec63,_0x16a5a4,_0x2c19ea)[_0x661f('0x10')](function(_0x497e40){logger[_0x661f('0x22')]('['+_0x2c19ea[_0x661f('0x13')]()+_0x661f('0x59'),_0x497e40[_0x661f('0x21')]);logger[_0x661f('0x22')]('['+_0x2c19ea[_0x661f('0x13')]()+']\x20The\x20User\x20email\x20is:',_0x497e40[_0x661f('0x1c')]);return getEndUser(_0x497e40,_0x28c530,_0x23ec63,_0x16a5a4,_0x1d724b,_0x2c19ea);})[_0x661f('0x10')](function(_0x5d62dd){logger[_0x661f('0x22')]('['+_0x2c19ea['toUpperCase']()+_0x661f('0x5a'),_0x5d62dd[_0x661f('0x2f')]);logger[_0x661f('0x22')]('['+_0x2c19ea[_0x661f('0x13')]()+_0x661f('0x5b'),_0x1d724b[_0x661f('0x28')]);return getTicket(_0x5d62dd,_0x28c530,_0x23ec63,_0x16a5a4,_0x1d724b,_0x221608,_0x2c19ea);})[_0x661f('0x10')](function(_0x33e2de){logger[_0x661f('0x22')](util[_0x661f('0x47')]('['+_0x2c19ea[_0x661f('0x13')]()+_0x661f('0x5c'),_0x221608[_0x661f('0x3a')],_0x33e2de[_0x661f('0x5d')]));logger[_0x661f('0x22')](util[_0x661f('0x47')]('['+_0x2c19ea['toUpperCase']()+_0x661f('0x5e'),_0x2c19ea));if(_0x2c19ea!==_0x661f('0x4e')){logger['info']('['+_0x2c19ea['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x28c530[_0x661f('0x4c')],_0x4f815d[_0x661f('0x5f')],_0x221608[_0x661f('0x3a')],_0x33e2de[_0x661f('0x5d')]);}})[_0x661f('0x11')](function(_0x3ab411){logger[_0x661f('0x12')]('['+_0x2c19ea['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x661f('0x60')](_0x3ab411,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x5d8d=['telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','Subjects','getString','Descriptions','/systemusers(','Fields','phonecall','phonecalls','callDirection','queue','/contacts(','format','user:%s','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise','util','./util','md5','dynamics365','redis','localhost','socket.io-emitter','POST','clientId','username','password','clientSecret','then','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId','userEmail','length','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace'];(function(_0x4b2b5a,_0x3f7555){var _0x47f812=function(_0x4de6ef){while(--_0x4de6ef){_0x4b2b5a['push'](_0x4b2b5a['shift']());}};_0x47f812(++_0x3f7555);}(_0x5d8d,0x99));var _0xd5d8=function(_0x1c6787,_0x1c71bd){_0x1c6787=_0x1c6787-0x0;var _0x3af30c=_0x5d8d[_0x1c6787];return _0x3af30c;};'use strict';var _=require(_0xd5d8('0x0'));var BPromise=require(_0xd5d8('0x1'));var rp=require(_0xd5d8('0x2'));var util=require(_0xd5d8('0x3'));var intUtil=require(_0xd5d8('0x4'));var md5=require(_0xd5d8('0x5'));var Redis=require('ioredis');var logger=require('../../../../config/logger')(_0xd5d8('0x6'));var config=require('../../../../config/environment');config[_0xd5d8('0x7')]=_['defaults'](config['redis'],{'host':_0xd5d8('0x8'),'port':0x18eb});var io=require(_0xd5d8('0x9'))(new Redis(config[_0xd5d8('0x7')]));function getAuthToken(_0xd0fbad,_0x188462,_0x32e1f7){var _0x324888={'method':_0xd5d8('0xa'),'uri':_0x188462,'form':{'client_id':_0xd0fbad[_0xd5d8('0xb')],'resource':_0xd0fbad['remoteUri'],'username':_0xd0fbad[_0xd5d8('0xc')],'password':_0xd0fbad[_0xd5d8('0xd')],'grant_type':'password','client_secret':_0xd0fbad[_0xd5d8('0xe')]},'json':!![]};return rp(_0x324888)[_0xd5d8('0xf')](function(_0x2ccdc3){return _0x2ccdc3['access_token'];})[_0xd5d8('0x10')](function(_0x3fe1b4){logger[_0xd5d8('0x11')]('['+[_0x32e1f7['toUpperCase']()]+_0xd5d8('0x12'));return _0x3fe1b4[_0xd5d8('0x13')];});}function getUser(_0x4b671e,_0x1bb98a,_0xdbe468,_0xbb14e9,_0x3a9c33,_0x575644){return new BPromise(function(_0x58cfc4,_0x3a4b90){return getAuthToken(_0x1bb98a,_0xbb14e9,_0x575644)['then'](function(_0x4c7fac){var _0x35c32f={'method':_0xd5d8('0x14'),'uri':_0x3a9c33+_0xd5d8('0x15'),'headers':{'Authorization':_0xd5d8('0x16')+_0x4c7fac,'OData-Version':_0xd5d8('0x17')},'json':!![]};return rp(_0x35c32f);})[_0xd5d8('0xf')](function(_0x5adf78){var _0x1f9dee=_0x5adf78[_0xd5d8('0x18')];var _0x2415c7=![];var _0x52a196=null;if(!_[_0xd5d8('0x19')](_0xdbe468)){if(intUtil[_0xd5d8('0x1a')](_0xdbe468['email'])){_0x4b671e['userEmail']=_0xdbe468[_0xd5d8('0x1b')];for(_0x52a196=0x0;_0x52a196<_0x1f9dee['length'];_0x52a196++){if(_0x1f9dee[_0x52a196][_0xd5d8('0x1c')]===_0xdbe468[_0xd5d8('0x1b')]&&!_0x1f9dee[_0x52a196][_0xd5d8('0x1d')]){_0x2415c7=!![];logger[_0xd5d8('0x1e')]('['+[_0x575644[_0xd5d8('0x1f')]()]+_0xd5d8('0x20')+_0x1f9dee[_0x52a196][_0xd5d8('0x21')]+'!');_0x4b671e[_0xd5d8('0x22')]=_0x1f9dee[_0x52a196][_0xd5d8('0x21')];}}}}if(!_0x2415c7){logger[_0xd5d8('0x1e')]('['+[_0x575644['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4b671e[_0xd5d8('0x23')]=_0x1bb98a['username'];for(_0x52a196=0x0;_0x52a196<_0x1f9dee[_0xd5d8('0x24')];_0x52a196++){if(_0x1f9dee[_0x52a196][_0xd5d8('0x1c')]===_0x1bb98a[_0xd5d8('0xc')]){_0x4b671e['userId']=_0x1f9dee[_0x52a196]['systemuserid'];}}}_0x58cfc4(_0x4b671e);})[_0xd5d8('0x10')](function(_0x472887){_0x3a4b90(_0x472887['message']);});});}function createEndUser(_0x42fd85,_0x2fcdcc,_0x2fb63b,_0x51cecc,_0x15d423,_0x3b2509){return new BPromise(function(_0x5aedc0,_0x23da1d){return getAuthToken(_0x2fcdcc,_0x2fb63b,_0x3b2509)['then'](function(_0x420123){var _0x24780c=_0x3b2509[_0xd5d8('0x25')]()===_0xd5d8('0x26')?_0x15d423[_0xd5d8('0x27')]:_0x15d423[_0xd5d8('0x28')];var _0x4f881d={'method':_0xd5d8('0xa'),'uri':_0x51cecc+_0xd5d8('0x29'),'body':{'telephone1':_0x24780c,'fullname':_0x24780c,'firstname':_0x24780c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x42fd85[_0xd5d8('0x22')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x420123,'OData-Version':_0xd5d8('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4f881d);})[_0xd5d8('0xf')](function(_0x296fd4){var _0x19c69d=_0x296fd4[_0xd5d8('0x2a')][_0xd5d8('0x2b')];var _0x5149d1=_0x19c69d[_0xd5d8('0x2c')](_0x19c69d[_0xd5d8('0x2d')]('(')+0x1,_0x19c69d[_0xd5d8('0x2d')](')'));_0x42fd85[_0xd5d8('0x2e')]=_0x5149d1;_0x5aedc0(_0x42fd85);})['catch'](function(_0x370143){_0x23da1d(_0x370143['message']);});});}function getEndUser(_0xa260e1,_0x458f5c,_0x5a0783,_0x409397,_0x1beadd,_0x43f3fc){return new BPromise(function(_0x208f01,_0x50439e){var _0x59991f=_0x43f3fc[_0xd5d8('0x25')]()===_0xd5d8('0x26')?_0x1beadd[_0xd5d8('0x27')]:_0x1beadd[_0xd5d8('0x28')];return getAuthToken(_0x458f5c,_0x5a0783,_0x43f3fc)['then'](function(_0x1da6d0){var _0x2714af={'method':'GET','uri':_0x409397+_0xd5d8('0x2f')+_0x59991f[_0xd5d8('0x30')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1da6d0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2714af);})[_0xd5d8('0xf')](function(_0x213ed3){var _0x4b7d49=null;if(_0x213ed3){var _0x195bc9=_0x213ed3[_0xd5d8('0x18')];var _0x6e8bad=![];for(_0x4b7d49=0x0;_0x4b7d49<_0x195bc9[_0xd5d8('0x24')];_0x4b7d49++){if(_0x195bc9[_0x4b7d49][_0xd5d8('0x31')]===_0x59991f){_0x6e8bad=!![];_0xa260e1['enduserId']=_0x195bc9[_0x4b7d49][_0xd5d8('0x32')];}}if(_0x6e8bad){_0x208f01(_0xa260e1);}else{return createEndUser(_0xa260e1,_0x458f5c,_0x5a0783,_0x409397,_0x1beadd,_0x43f3fc)[_0xd5d8('0xf')](function(_0x440592){logger[_0xd5d8('0x1e')]('['+[_0x43f3fc[_0xd5d8('0x1f')]()]+_0xd5d8('0x33'),_0x440592[_0xd5d8('0x2e')]);_0x208f01(_0x440592);});}}else{return createEndUser(_0xa260e1,_0x458f5c,_0x5a0783,_0x409397,_0x1beadd,_0x43f3fc)[_0xd5d8('0xf')](function(_0x1ca64c){logger[_0xd5d8('0x1e')]('['+[_0x43f3fc[_0xd5d8('0x1f')]()]+_0xd5d8('0x34'),_0x1ca64c[_0xd5d8('0x2e')]);_0x208f01(_0x1ca64c);});}});});}function getCustomFields(_0x61565a,_0x19cc6b,_0x588cc7){var _0x30c98c={};if(_0x61565a[_0xd5d8('0x24')]>0x0){_[_0xd5d8('0x35')](_0x61565a,function(_0x12ebf6){if(_['includes']([_0xd5d8('0x36'),_0xd5d8('0x37')],_0x12ebf6[_0xd5d8('0x38')])&&_0x12ebf6[_0xd5d8('0x39')]&&!_0x12ebf6[_0xd5d8('0x3a')]){var _0x5d08ef=_0x12ebf6[_0xd5d8('0x3b')][_0xd5d8('0x25')]();var _0x5b273d=_0x5d08ef['substring'](0x0,_0x5d08ef[_0xd5d8('0x3c')]('_'));var _0x2928e0=_0x5d08ef['substring'](_0x5d08ef[_0xd5d8('0x3c')]('_')+0x1);if(_0x5b273d===_0x588cc7){_0x30c98c[_0x2928e0]=_0x12ebf6[_0xd5d8('0x3d')];}}});}return _0x30c98c;}function getTicket(_0x2ab1a4,_0x208ac6,_0x4dd851,_0x1c0191,_0x54f283,_0x1cbe36,_0x272473){return new BPromise(function(_0x2ac0cf,_0x1edeb2){var _0x566b9c;return getAuthToken(_0x208ac6,_0x4dd851,_0x272473)[_0xd5d8('0xf')](function(_0x3ba243){if(_0x1cbe36[_0xd5d8('0x3e')]===_0xd5d8('0x3f')){_0x566b9c={'method':_0xd5d8('0xa'),'uri':_0x1c0191+_0xd5d8('0x40'),'body':Object[_0xd5d8('0x41')]({},{'title':intUtil['getString'](_0x1cbe36[_0xd5d8('0x42')],_0x54f283,'\x20'),'description':intUtil[_0xd5d8('0x43')](_0x1cbe36[_0xd5d8('0x44')],_0x54f283,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x2ab1a4[_0xd5d8('0x2e')]+')','ownerid@odata.bind':_0xd5d8('0x45')+_0x2ab1a4[_0xd5d8('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x1cbe36[_0xd5d8('0x46')],_0x54f283,_0x1cbe36[_0xd5d8('0x3e')])),'headers':{'Authorization':_0xd5d8('0x16')+_0x3ba243,'OData-Version':_0xd5d8('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1cbe36[_0xd5d8('0x3e')]===_0xd5d8('0x47')){_0x566b9c={'method':_0xd5d8('0xa'),'uri':_0x1c0191+_0xd5d8('0x48'),'body':Object[_0xd5d8('0x41')]({},{'subject':intUtil[_0xd5d8('0x43')](_0x1cbe36['Subjects'],_0x54f283,'\x20'),'phonenumber':String(_0x54f283[_0xd5d8('0x28')]),'description':intUtil[_0xd5d8('0x43')](_0x1cbe36[_0xd5d8('0x44')],_0x54f283,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x2ab1a4[_0xd5d8('0x2e')]+')','ownerid@odata.bind':_0xd5d8('0x45')+_0x2ab1a4[_0xd5d8('0x22')]+')','directioncode':_0x2ab1a4[_0xd5d8('0x49')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xd5d8('0x45')+_0x2ab1a4[_0xd5d8('0x22')]+')','participationtypemask':_0x2ab1a4['callDirection']===_0xd5d8('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':_0xd5d8('0x4b')+_0x2ab1a4[_0xd5d8('0x2e')]+')','participationtypemask':_0x2ab1a4[_0xd5d8('0x49')]==='queue'?0x1:0x2}]},getCustomFields(_0x1cbe36[_0xd5d8('0x46')],_0x54f283,_0x1cbe36[_0xd5d8('0x3e')])),'headers':{'Authorization':_0xd5d8('0x16')+_0x3ba243,'OData-Version':_0xd5d8('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x566b9c);})[_0xd5d8('0xf')](function(_0xfe6b5){var _0x2e0b47=_0xfe6b5['headers'][_0xd5d8('0x2b')];var _0x35520b=_0x2e0b47[_0xd5d8('0x2c')](_0x2e0b47[_0xd5d8('0x2d')]('(')+0x1,_0x2e0b47['lastIndexOf'](')'));_0x2ab1a4['ticketId']=_0x35520b;_0x2ac0cf(_0x2ab1a4);})[_0xd5d8('0x10')](function(_0x2d1924){_0x1edeb2(_0x2d1924[_0xd5d8('0x13')]);});});}function emit(_0x3dada6,_0x17fe29,_0x43e7d8,_0x54443b){var _0x1b7180={'uri':util[_0xd5d8('0x4c')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x3dada6,_0x43e7d8,_0x54443b)};io['to'](util[_0xd5d8('0x4c')](_0xd5d8('0x4d'),_0x17fe29))['emit'](_0xd5d8('0x4e'),_0x1b7180);}exports['cs']=function(_0x4b3079,_0x166205,_0x12906c,_0x36aaf6,_0x21ee6d,_0x69817d,_0x3971df,_0x235f2f){var _0x48b507={};_0x69817d[_0xd5d8('0x4f')]=intUtil[_0xd5d8('0x50')](_0x69817d[_0xd5d8('0x4f')]);_0x69817d[_0xd5d8('0x51')]=intUtil[_0xd5d8('0x50')](_0x69817d[_0xd5d8('0x51')]);_0x48b507[_0xd5d8('0x49')]=_0x235f2f===_0xd5d8('0x4a')||_0x235f2f===_0xd5d8('0x52')?_0xd5d8('0x4a'):_0xd5d8('0x26');var _0x466809=util[_0xd5d8('0x4c')](_0xd5d8('0x53'),_0x69817d[_0xd5d8('0x4f')]);var _0x587bb8=util[_0xd5d8('0x4c')](_0xd5d8('0x54'),_0x69817d[_0xd5d8('0x55')]);var _0x2cfb14=util[_0xd5d8('0x4c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x69817d[_0xd5d8('0x51')],_0x166205[_0xd5d8('0x56')],md5(_0x166205[_0xd5d8('0x56')]));if(_0x21ee6d&&_0x21ee6d[_0xd5d8('0x57')]){logger[_0xd5d8('0x1e')](_0xd5d8('0x58'),_0xd5d8('0x59'));_0x166205[_0xd5d8('0x5a')]=_0x2cfb14;}else if(_0x3971df&&_0x3971df[_0xd5d8('0x5b')]&&_0x3971df[_0xd5d8('0x5b')]!==_0xd5d8('0x5c')){logger[_0xd5d8('0x1e')]('[OUTBOUND]',_0xd5d8('0x59'));_0x166205[_0xd5d8('0x5a')]=_0x2cfb14;}else{_0x166205[_0xd5d8('0x5a')]='';}return getUser(_0x48b507,_0x69817d,_0x36aaf6,_0x587bb8,_0x466809,_0x235f2f)['then'](function(_0x54498e){logger[_0xd5d8('0x1e')]('['+_0x235f2f[_0xd5d8('0x1f')]()+_0xd5d8('0x5d'),_0x54498e[_0xd5d8('0x22')]);logger[_0xd5d8('0x1e')]('['+_0x235f2f['toUpperCase']()+_0xd5d8('0x5e'),_0x54498e[_0xd5d8('0x23')]);return getEndUser(_0x54498e,_0x69817d,_0x587bb8,_0x466809,_0x166205,_0x235f2f);})[_0xd5d8('0xf')](function(_0x570e53){logger[_0xd5d8('0x1e')]('['+_0x235f2f[_0xd5d8('0x1f')]()+_0xd5d8('0x5f'),_0x570e53[_0xd5d8('0x2e')]);logger[_0xd5d8('0x1e')]('['+_0x235f2f['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x166205['calleridnum']);return getTicket(_0x570e53,_0x69817d,_0x587bb8,_0x466809,_0x166205,_0x12906c,_0x235f2f);})[_0xd5d8('0xf')](function(_0x428a05){logger['info'](util[_0xd5d8('0x4c')]('['+_0x235f2f[_0xd5d8('0x1f')]()+_0xd5d8('0x60'),_0x12906c['ticketType'],_0x428a05['ticketId']));logger['info'](util[_0xd5d8('0x4c')]('['+_0x235f2f['toUpperCase']()+_0xd5d8('0x61'),_0x235f2f));if(_0x235f2f!==_0xd5d8('0x52')){logger[_0xd5d8('0x1e')]('['+_0x235f2f[_0xd5d8('0x1f')]()+']',_0xd5d8('0x62'));emit(_0x69817d[_0xd5d8('0x4f')],_0x36aaf6['name'],_0x12906c[_0xd5d8('0x3e')],_0x428a05[_0xd5d8('0x63')]);}})[_0xd5d8('0x10')](function(_0x43cf78){logger['error']('['+_0x235f2f['toUpperCase']()+_0xd5d8('0x64'),util['inspect'](_0x43cf78,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 0ec446c..df62257 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x839e=['[OUTBOUND]','destcalleridname','destcalleridnum','unmanaged','lastevent','toUpperCase','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','<br>','name','Fields','custom_fields','mapValues','keyBy','value','format','remoteUri','info','Ticket\x20created!','%s/api/v2/agents','then','Agent\x20found!','find','contact','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','stringify','GET','forEach','includes','picklist','type','nameField','toLowerCase','content','string','idField','customField','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none'];(function(_0x1acb2a,_0x259dd4){var _0x1d991c=function(_0x2f504c){while(--_0x2f504c){_0x1acb2a['push'](_0x1acb2a['shift']());}};_0x1d991c(++_0x259dd4);}(_0x839e,0xba));var _0xe839=function(_0x185334,_0x4630ac){_0x185334=_0x185334-0x0;var _0xf2e59a=_0x839e[_0x185334];return _0xf2e59a;};'use strict';var _=require(_0xe839('0x0'));var rp=require(_0xe839('0x1'));var md5=require('md5');var util=require(_0xe839('0x2'));var Redis=require('ioredis');var intUtil=require(_0xe839('0x3'));var config=require(_0xe839('0x4'));var logger=require(_0xe839('0x5'))(_0xe839('0x6'));config[_0xe839('0x7')]=_[_0xe839('0x8')](config[_0xe839('0x7')],{'host':_0xe839('0x9'),'port':0x18eb});var io=require(_0xe839('0xa'))(new Redis(config[_0xe839('0x7')]));var headers={'Content-Type':_0xe839('0xb'),'Accept':'application/json'};function emit(_0x3c081b,_0x46c691,_0x24717d){io['to'](_0x3c081b)['emit'](_0x46c691,_0x24717d);}function getTicket(_0x22c3e1,_0x2249ba,_0x2d1e12,_0x4f0385,_0x414153){logger['info']('Creating\x20new\x20ticket...');var _0x4c738c=_['merge']({'responder_id':_0x2249ba['id'],'requester_id':_0x2d1e12['id'],'name':util['format'](_0xe839('0xc'),_0x414153[_0xe839('0xd')]),'phone':_0x414153[_0xe839('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe839('0xf')](_0x4f0385['Subjects'],_0x414153,'\x20'),'description':intUtil[_0xe839('0xf')](_0x4f0385[_0xe839('0x10')],_0x414153,_0xe839('0x11')),'tags':getTags(_0x4f0385['Tags'],_0xe839('0x12'))},getCustomFields(_0x4f0385[_0xe839('0x13')],_0x414153));_0x4c738c[_0xe839('0x14')]=_[_0xe839('0x15')](_[_0xe839('0x16')](_0x4c738c[_0xe839('0x14')],'id'),_0xe839('0x17'));return request({'uri':util[_0xe839('0x18')]('%s/api/v2/tickets',_0x22c3e1[_0xe839('0x19')]),'method':'POST','body':_0x4c738c})['then'](function(_0x22047a){logger[_0xe839('0x1a')](_0xe839('0x1b'));return _0x22047a;});}function getUser(_0x3345b6,_0x46130b){if(intUtil['validateEmail'](_0x46130b)){return request({'uri':util[_0xe839('0x18')](_0xe839('0x1c'),_0x3345b6[_0xe839('0x19')]),'qs':{'email':_0x46130b}})[_0xe839('0x1d')](function(_0x570cf1){if(_0x570cf1['length']){logger[_0xe839('0x1a')](_0xe839('0x1e'));return _[_0xe839('0x1f')](_0x570cf1,function(_0x4fdccb){return _0x4fdccb[_0xe839('0x20')]['email']===_0x46130b;});}else{logger[_0xe839('0x1a')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xe839('0x21'),_0x3345b6[_0xe839('0x19')])})[_0xe839('0x1d')](function(_0x15ed0c){logger[_0xe839('0x1a')](_0xe839('0x22'));return _0x15ed0c;});}});}else{logger['info'](_0xe839('0x23'));return request({'uri':util[_0xe839('0x18')]('%s/api/v2/agents/me',_0x3345b6['remoteUri'])})[_0xe839('0x1d')](function(_0x30c843){logger[_0xe839('0x1a')](_0xe839('0x22'));return _0x30c843;});}}function getEndUser(_0x1eb55d,_0x356d2f,_0x5261b9){logger['info'](_0xe839('0x24'),_0x5261b9);return request({'uri':util[_0xe839('0x18')](_0xe839('0x25'),_0x1eb55d[_0xe839('0x19')]),'qs':{'phone':_0x5261b9}})[_0xe839('0x1d')](function(_0x571ba1){if(_0x571ba1[_0xe839('0x26')]){logger[_0xe839('0x1a')](_0xe839('0x27'));return _[_0xe839('0x1f')](_0x571ba1,{'phone':_0x5261b9});}else{logger[_0xe839('0x1a')](_0xe839('0x28'));return request({'uri':util[_0xe839('0x18')](_0xe839('0x25'),_0x1eb55d[_0xe839('0x19')]),'method':'POST','body':{'name':_0x356d2f,'phone':_0x5261b9}})[_0xe839('0x1d')](function(_0x228b7a){logger[_0xe839('0x1a')](_0xe839('0x29'));return _0x228b7a;});}});}function getAuth(_0x1dbfd9){return util[_0xe839('0x18')]('Basic\x20%s',new Buffer(_0x1dbfd9[_0xe839('0x2a')]+':X')[_0xe839('0x2b')](_0xe839('0x2c')));}function request(_0x45f358){logger[_0xe839('0x2d')]('[HTTP]',JSON[_0xe839('0x2e')](_0x45f358));return rp(_[_0xe839('0x8')](_0x45f358,{'method':_0xe839('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x14c076,_0x1880f9){var _0x5765bf=[];if(_0x14c076&&_0x14c076[_0xe839('0x26')]>0x0){_0x5765bf=_['map'](_0x14c076,_0x1880f9);}return _0x5765bf;}function getCustomFields(_0x2504e5,_0x4f10f9){var _0x5ccd3f=[];var _0x6cded1={'custom_fields':[]};if(_0x2504e5[_0xe839('0x26')]>0x0){_[_0xe839('0x30')](_0x2504e5,function(_0x9d0b31){if(_[_0xe839('0x31')](['string',_0xe839('0x32')],_0x9d0b31[_0xe839('0x33')])&&_0x9d0b31[_0xe839('0x34')]&&!_0x9d0b31['customField']){_0x6cded1[_0x9d0b31[_0xe839('0x34')][_0xe839('0x35')]()]=_0x9d0b31[_0xe839('0x36')][_0xe839('0x2b')]();}else if(_[_0xe839('0x31')]([_0xe839('0x37'),_0xe839('0x32')],_0x9d0b31[_0xe839('0x33')])&&_0x9d0b31[_0xe839('0x38')]&&_0x9d0b31[_0xe839('0x39')]){_0x6cded1[_0xe839('0x14')][_0xe839('0x3a')]({'id':_0x9d0b31[_0xe839('0x38')],'value':_0x9d0b31[_0xe839('0x36')][_0xe839('0x2b')]()});}else if(_0x9d0b31[_0xe839('0x33')]===_0xe839('0x3b')&&_0x9d0b31['variableName']&&_0x9d0b31['idField']&&_0x9d0b31['customField']){_0x4f10f9[_0x9d0b31['variableName']]&&_0x6cded1[_0xe839('0x14')][_0xe839('0x3a')]({'id':_0x9d0b31[_0xe839('0x38')],'value':_0x4f10f9[_0x9d0b31[_0xe839('0x3c')]][_0xe839('0x2b')]()});}else if(_0x9d0b31[_0xe839('0x33')]==='customVariable'&&_0x9d0b31['Variable']&&_0x9d0b31['Variable']['name']&&_0x9d0b31['idField']&&_0x9d0b31['customField']){_0x4f10f9[_0x9d0b31[_0xe839('0x3d')][_0xe839('0x12')][_0xe839('0x35')]()]&&_0x6cded1[_0xe839('0x14')][_0xe839('0x3a')]({'id':_0x9d0b31['idField'],'value':_0x4f10f9[_0x9d0b31[_0xe839('0x3d')][_0xe839('0x12')]['toLowerCase']()][_0xe839('0x2b')]()});}});}return _0x6cded1;}exports[_0xe839('0x3e')]=function(_0x527056,_0x57fb5b,_0x25bd02,_0x344f14,_0x434a79,_0x45a449){var _0x4f7258,_0x57de4a;_0x45a449[_0xe839('0x19')]=intUtil[_0xe839('0x3f')](_0x45a449[_0xe839('0x19')]);_0x45a449[_0xe839('0x40')]=intUtil[_0xe839('0x3f')](_0x45a449[_0xe839('0x40')]);if(_0x434a79&&_0x434a79[_0xe839('0x41')]){logger[_0xe839('0x1a')](_0xe839('0x42'),_0xe839('0x43'));_0x57fb5b[_0xe839('0x44')]=util[_0xe839('0x18')](_0xe839('0x45'),_0x45a449[_0xe839('0x40')],_0x57fb5b[_0xe839('0x46')],md5(_0x57fb5b[_0xe839('0x46')]));}else{_0x57fb5b['recordingURL']='';}headers[_0xe839('0x47')]=getAuth(_0x45a449);return getUser(_0x45a449,_0x344f14[_0xe839('0x48')])['then'](function(_0x1d76e9){_0x4f7258=_0x1d76e9;logger['info'](_0xe839('0x49'),_0x4f7258['id']);return getEndUser(_0x45a449,_0x57fb5b[_0xe839('0xd')],_0x57fb5b[_0xe839('0xe')]);})['then'](function(_0x3ab907){_0x57de4a=_0x3ab907;logger[_0xe839('0x1a')](_0xe839('0x4a'),_0x57de4a['id']);return getTicket(_0x45a449,_0x4f7258,_0x57de4a,_0x25bd02,_0x57fb5b);})[_0xe839('0x1d')](function(_0x271d1b){if(_0x271d1b&&_0x271d1b['id']){logger[_0xe839('0x1a')](_0xe839('0x1b'));logger[_0xe839('0x1a')](_0xe839('0x4b'),_0x271d1b['id']);logger[_0xe839('0x1a')](_0xe839('0x42'),_0xe839('0x4c'));emit(util[_0xe839('0x18')](_0xe839('0x4d'),_0x344f14[_0xe839('0x12')]),_0xe839('0x4e'),{'uri':util[_0xe839('0x18')](_0xe839('0x4f'),_0x45a449['remoteUri'],_0x271d1b['id'])});}})['catch'](function(_0xbf53e2){logger[_0xe839('0x50')](_0xe839('0x42'),JSON[_0xe839('0x2e')](_0xbf53e2));});};exports[_0xe839('0x51')]=function(_0x4b4acf,_0x16068a,_0x187956,_0x27b79a,_0x94d3cb,_0x18ce26,_0x3023df){var _0x251174,_0x19d1fe;_0x18ce26[_0xe839('0x19')]=intUtil[_0xe839('0x3f')](_0x18ce26[_0xe839('0x19')]);_0x18ce26[_0xe839('0x40')]=intUtil[_0xe839('0x3f')](_0x18ce26['serverUrl']);if(_0x3023df&&_0x3023df[_0xe839('0x52')]&&_0x3023df[_0xe839('0x52')]!==_0xe839('0x53')){logger['info'](_0xe839('0x54'),'Recording\x20is\x20enabled!');_0x16068a['recordingURL']=util[_0xe839('0x18')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x18ce26['serverUrl'],_0x16068a[_0xe839('0x46')],md5(_0x16068a[_0xe839('0x46')]));}headers[_0xe839('0x47')]=getAuth(_0x18ce26);return getUser(_0x18ce26,_0x27b79a[_0xe839('0x48')])[_0xe839('0x1d')](function(_0x48b55f){_0x251174=_0x48b55f;logger[_0xe839('0x1a')](_0xe839('0x49'),_0x251174['id']);return getEndUser(_0x18ce26,_0x16068a[_0xe839('0x55')],_0x16068a[_0xe839('0x56')]);})[_0xe839('0x1d')](function(_0x1daca3){_0x19d1fe=_0x1daca3;logger[_0xe839('0x1a')](_0xe839('0x4a'),_0x19d1fe['id']);return getTicket(_0x18ce26,_0x251174,_0x19d1fe,_0x187956,_0x16068a);})['then'](function(_0x46d819){if(_0x46d819&&_0x46d819['id']){logger['info'](_0xe839('0x1b'));logger['info'](_0xe839('0x4b'),_0x46d819['id']);logger['info'](_0xe839('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe839('0x18')](_0xe839('0x4d'),_0x27b79a[_0xe839('0x12')]),_0xe839('0x4e'),{'uri':util[_0xe839('0x18')](_0xe839('0x4f'),_0x18ce26['remoteUri'],_0x46d819['id'])});}})['catch'](function(_0x448aa8){logger[_0xe839('0x50')](_0xe839('0x54'),JSON[_0xe839('0x2e')](_0x448aa8));});};exports[_0xe839('0x57')]=function(_0x2e5e51,_0x3968ee,_0x1282e6,_0x194b29,_0x1560bf,_0x3e0a8e){var _0x4d3749,_0x35d97d;_0x3e0a8e['remoteUri']=intUtil[_0xe839('0x3f')](_0x3e0a8e[_0xe839('0x19')]);_0x3e0a8e[_0xe839('0x40')]=intUtil['stripTrailingSlash'](_0x3e0a8e[_0xe839('0x40')]);if(_0x1560bf&&_0x1560bf[_0xe839('0x41')]){logger[_0xe839('0x1a')]('['+_0x3968ee[_0xe839('0x58')][_0xe839('0x59')]()+']',_0xe839('0x43'));_0x3968ee[_0xe839('0x44')]=util[_0xe839('0x18')](_0xe839('0x45'),_0x3e0a8e[_0xe839('0x40')],_0x3968ee[_0xe839('0x46')],md5(_0x3968ee['uniqueid']));}else{_0x3968ee['recordingURL']='';}headers['Authorization']=getAuth(_0x3e0a8e);return getUser(_0x3e0a8e,'')['then'](function(_0x4ccdcb){_0x4d3749=_0x4ccdcb;logger[_0xe839('0x1a')]('The\x20User\x20ID\x20is:',_0x4d3749['id']);return getEndUser(_0x3e0a8e,_0x3968ee['calleridname'],_0x3968ee[_0xe839('0xe')]);})[_0xe839('0x1d')](function(_0x2bd5dc){_0x35d97d=_0x2bd5dc;logger[_0xe839('0x1a')](_0xe839('0x4a'),_0x35d97d['id']);return getTicket(_0x3e0a8e,_0x4d3749,_0x35d97d,_0x1282e6,_0x3968ee);})[_0xe839('0x1d')](function(_0x59418f){if(_0x59418f){logger[_0xe839('0x1a')](_0xe839('0x1b'));logger[_0xe839('0x1a')](_0xe839('0x4b'),_0x59418f['id']);}})['catch'](function(_0x1d52d1){logger['error']('['+_0x3968ee[_0xe839('0x58')][_0xe839('0x59')]()+']',JSON[_0xe839('0x2e')](_0x1d52d1));});};
\ No newline at end of file
+var _0x6142=['error','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Ticket\x20created!','trigger:browser:url','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','stringify','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','<br>','name','keyBy','custom_fields','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/agents/me','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','base64','debug','[HTTP]','GET','map','includes','string','type','nameField','customField','content','toString','picklist','idField','variable','variableName','customVariable','Variable','toLowerCase','push','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0x6142,0x11f));var _0x2614=function(_0x33bae0,_0x248c77){_0x33bae0=_0x33bae0-0x0;var _0x100e0f=_0x6142[_0x33bae0];return _0x100e0f;};'use strict';var _=require(_0x2614('0x0'));var rp=require(_0x2614('0x1'));var md5=require(_0x2614('0x2'));var util=require(_0x2614('0x3'));var Redis=require(_0x2614('0x4'));var intUtil=require(_0x2614('0x5'));var config=require('../../../../config/environment');var logger=require(_0x2614('0x6'))(_0x2614('0x7'));config[_0x2614('0x8')]=_[_0x2614('0x9')](config[_0x2614('0x8')],{'host':_0x2614('0xa'),'port':0x18eb});var io=require(_0x2614('0xb'))(new Redis(config['redis']));var headers={'Content-Type':_0x2614('0xc'),'Accept':_0x2614('0xc')};function emit(_0x2bcda1,_0x5f454a,_0x2ac624){io['to'](_0x2bcda1)[_0x2614('0xd')](_0x5f454a,_0x2ac624);}function getTicket(_0xc82043,_0x449bf9,_0x1f149f,_0x524a0a,_0x1b8d61){logger[_0x2614('0xe')]('Creating\x20new\x20ticket...');var _0xb74369=_['merge']({'responder_id':_0x449bf9['id'],'requester_id':_0x1f149f['id'],'name':util[_0x2614('0xf')](_0x2614('0x10'),_0x1b8d61[_0x2614('0x11')]),'phone':_0x1b8d61[_0x2614('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x2614('0x13')](_0x524a0a[_0x2614('0x14')],_0x1b8d61,'\x20'),'description':intUtil['getString'](_0x524a0a['Descriptions'],_0x1b8d61,_0x2614('0x15')),'tags':getTags(_0x524a0a['Tags'],_0x2614('0x16'))},getCustomFields(_0x524a0a['Fields'],_0x1b8d61));_0xb74369['custom_fields']=_['mapValues'](_[_0x2614('0x17')](_0xb74369[_0x2614('0x18')],'id'),'value');return request({'uri':util['format'](_0x2614('0x19'),_0xc82043[_0x2614('0x1a')]),'method':_0x2614('0x1b'),'body':_0xb74369})[_0x2614('0x1c')](function(_0x2a9754){logger[_0x2614('0xe')]('Ticket\x20created!');return _0x2a9754;});}function getUser(_0x4b3b4d,_0x1ad420){if(intUtil[_0x2614('0x1d')](_0x1ad420)){return request({'uri':util[_0x2614('0xf')](_0x2614('0x1e'),_0x4b3b4d[_0x2614('0x1a')]),'qs':{'email':_0x1ad420}})[_0x2614('0x1c')](function(_0x135d16){if(_0x135d16[_0x2614('0x1f')]){logger[_0x2614('0xe')](_0x2614('0x20'));return _[_0x2614('0x21')](_0x135d16,function(_0x21bb89){return _0x21bb89[_0x2614('0x22')][_0x2614('0x23')]===_0x1ad420;});}else{logger[_0x2614('0xe')](_0x2614('0x24'));return request({'uri':util[_0x2614('0xf')]('%s/api/v2/agents/me',_0x4b3b4d[_0x2614('0x1a')])})[_0x2614('0x1c')](function(_0x308122){logger[_0x2614('0xe')](_0x2614('0x25'));return _0x308122;});}});}else{logger[_0x2614('0xe')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x2614('0xf')](_0x2614('0x26'),_0x4b3b4d['remoteUri'])})[_0x2614('0x1c')](function(_0x4fb8b0){logger[_0x2614('0xe')]('Admin\x20account\x20selected.');return _0x4fb8b0;});}}function getEndUser(_0x2029c7,_0x4c0d83,_0x553aef){logger[_0x2614('0xe')]('Searching\x20enduser\x20with\x20phone',_0x553aef);return request({'uri':util['format'](_0x2614('0x27'),_0x2029c7[_0x2614('0x1a')]),'qs':{'phone':_0x553aef}})[_0x2614('0x1c')](function(_0xab6060){if(_0xab6060[_0x2614('0x1f')]){logger[_0x2614('0xe')](_0x2614('0x28'));return _[_0x2614('0x21')](_0xab6060,{'phone':_0x553aef});}else{logger[_0x2614('0xe')](_0x2614('0x29'));return request({'uri':util[_0x2614('0xf')](_0x2614('0x27'),_0x2029c7[_0x2614('0x1a')]),'method':'POST','body':{'name':_0x4c0d83,'phone':_0x553aef}})[_0x2614('0x1c')](function(_0x136c94){logger[_0x2614('0xe')](_0x2614('0x2a'));return _0x136c94;});}});}function getAuth(_0x271186){return util[_0x2614('0xf')](_0x2614('0x2b'),new Buffer(_0x271186['apiKey']+':X')['toString'](_0x2614('0x2c')));}function request(_0x5c6039){logger[_0x2614('0x2d')](_0x2614('0x2e'),JSON['stringify'](_0x5c6039));return rp(_[_0x2614('0x9')](_0x5c6039,{'method':_0x2614('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x1f2d17,_0x569ec5){var _0x4ebbf6=[];if(_0x1f2d17&&_0x1f2d17[_0x2614('0x1f')]>0x0){_0x4ebbf6=_[_0x2614('0x30')](_0x1f2d17,_0x569ec5);}return _0x4ebbf6;}function getCustomFields(_0x279493,_0x134e7e){var _0x3181ae=[];var _0x3861c0={'custom_fields':[]};if(_0x279493[_0x2614('0x1f')]>0x0){_['forEach'](_0x279493,function(_0x3ab8b6){if(_[_0x2614('0x31')]([_0x2614('0x32'),'picklist'],_0x3ab8b6[_0x2614('0x33')])&&_0x3ab8b6[_0x2614('0x34')]&&!_0x3ab8b6[_0x2614('0x35')]){_0x3861c0[_0x3ab8b6[_0x2614('0x34')]['toLowerCase']()]=_0x3ab8b6[_0x2614('0x36')][_0x2614('0x37')]();}else if(_[_0x2614('0x31')]([_0x2614('0x32'),_0x2614('0x38')],_0x3ab8b6[_0x2614('0x33')])&&_0x3ab8b6['idField']&&_0x3ab8b6[_0x2614('0x35')]){_0x3861c0[_0x2614('0x18')]['push']({'id':_0x3ab8b6[_0x2614('0x39')],'value':_0x3ab8b6['content']['toString']()});}else if(_0x3ab8b6[_0x2614('0x33')]===_0x2614('0x3a')&&_0x3ab8b6[_0x2614('0x3b')]&&_0x3ab8b6[_0x2614('0x39')]&&_0x3ab8b6['customField']){_0x134e7e[_0x3ab8b6[_0x2614('0x3b')]]&&_0x3861c0[_0x2614('0x18')]['push']({'id':_0x3ab8b6[_0x2614('0x39')],'value':_0x134e7e[_0x3ab8b6[_0x2614('0x3b')]]['toString']()});}else if(_0x3ab8b6[_0x2614('0x33')]===_0x2614('0x3c')&&_0x3ab8b6[_0x2614('0x3d')]&&_0x3ab8b6['Variable'][_0x2614('0x16')]&&_0x3ab8b6[_0x2614('0x39')]&&_0x3ab8b6[_0x2614('0x35')]){_0x134e7e[_0x3ab8b6[_0x2614('0x3d')][_0x2614('0x16')][_0x2614('0x3e')]()]&&_0x3861c0[_0x2614('0x18')][_0x2614('0x3f')]({'id':_0x3ab8b6[_0x2614('0x39')],'value':_0x134e7e[_0x3ab8b6['Variable'][_0x2614('0x16')][_0x2614('0x3e')]()]['toString']()});}});}return _0x3861c0;}exports['queue']=function(_0x193ddc,_0x5b4ae5,_0x2ed350,_0x224ef9,_0x1b1bf6,_0x4273a9){var _0x4f9079,_0x3c6eb7;_0x4273a9['remoteUri']=intUtil[_0x2614('0x40')](_0x4273a9[_0x2614('0x1a')]);_0x4273a9[_0x2614('0x41')]=intUtil[_0x2614('0x40')](_0x4273a9[_0x2614('0x41')]);if(_0x1b1bf6&&_0x1b1bf6[_0x2614('0x42')]){logger[_0x2614('0xe')]('[QUEUE]',_0x2614('0x43'));_0x5b4ae5[_0x2614('0x44')]=util['format'](_0x2614('0x45'),_0x4273a9[_0x2614('0x41')],_0x5b4ae5[_0x2614('0x46')],md5(_0x5b4ae5[_0x2614('0x46')]));}else{_0x5b4ae5[_0x2614('0x44')]='';}headers[_0x2614('0x47')]=getAuth(_0x4273a9);return getUser(_0x4273a9,_0x224ef9[_0x2614('0x23')])[_0x2614('0x1c')](function(_0x13153d){_0x4f9079=_0x13153d;logger[_0x2614('0xe')]('The\x20User\x20ID\x20is:',_0x4f9079['id']);return getEndUser(_0x4273a9,_0x5b4ae5[_0x2614('0x11')],_0x5b4ae5[_0x2614('0x12')]);})[_0x2614('0x1c')](function(_0x4643f8){_0x3c6eb7=_0x4643f8;logger['info'](_0x2614('0x48'),_0x3c6eb7['id']);return getTicket(_0x4273a9,_0x4f9079,_0x3c6eb7,_0x2ed350,_0x5b4ae5);})[_0x2614('0x1c')](function(_0x3a52d3){if(_0x3a52d3&&_0x3a52d3['id']){logger[_0x2614('0xe')]('Ticket\x20created!');logger[_0x2614('0xe')]('The\x20Ticket\x20ID\x20is:',_0x3a52d3['id']);logger[_0x2614('0xe')]('[QUEUE]',_0x2614('0x49'));emit(util[_0x2614('0xf')](_0x2614('0x4a'),_0x224ef9[_0x2614('0x16')]),'trigger:browser:url',{'uri':util[_0x2614('0xf')](_0x2614('0x4b'),_0x4273a9[_0x2614('0x1a')],_0x3a52d3['id'])});}})[_0x2614('0x4c')](function(_0x226088){logger[_0x2614('0x4d')](_0x2614('0x4e'),JSON['stringify'](_0x226088));});};exports[_0x2614('0x4f')]=function(_0x33076f,_0x37e2d0,_0x5e3016,_0xb27b63,_0x2d1805,_0xe7528b,_0x54151d){var _0x271bbf,_0x1e6b12;_0xe7528b['remoteUri']=intUtil[_0x2614('0x40')](_0xe7528b[_0x2614('0x1a')]);_0xe7528b[_0x2614('0x41')]=intUtil[_0x2614('0x40')](_0xe7528b[_0x2614('0x41')]);if(_0x54151d&&_0x54151d[_0x2614('0x50')]&&_0x54151d[_0x2614('0x50')]!==_0x2614('0x51')){logger[_0x2614('0xe')](_0x2614('0x52'),_0x2614('0x43'));_0x37e2d0[_0x2614('0x44')]=util[_0x2614('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe7528b[_0x2614('0x41')],_0x37e2d0[_0x2614('0x46')],md5(_0x37e2d0[_0x2614('0x46')]));}headers['Authorization']=getAuth(_0xe7528b);return getUser(_0xe7528b,_0xb27b63[_0x2614('0x23')])[_0x2614('0x1c')](function(_0x23654d){_0x271bbf=_0x23654d;logger[_0x2614('0xe')]('The\x20User\x20ID\x20is:',_0x271bbf['id']);return getEndUser(_0xe7528b,_0x37e2d0[_0x2614('0x53')],_0x37e2d0[_0x2614('0x54')]);})[_0x2614('0x1c')](function(_0x31372a){_0x1e6b12=_0x31372a;logger['info']('The\x20Enduser\x20ID\x20is:',_0x1e6b12['id']);return getTicket(_0xe7528b,_0x271bbf,_0x1e6b12,_0x5e3016,_0x37e2d0);})['then'](function(_0x9cb757){if(_0x9cb757&&_0x9cb757['id']){logger['info'](_0x2614('0x55'));logger[_0x2614('0xe')]('The\x20Ticket\x20ID\x20is:',_0x9cb757['id']);logger[_0x2614('0xe')](_0x2614('0x52'),_0x2614('0x49'));emit(util[_0x2614('0xf')](_0x2614('0x4a'),_0xb27b63[_0x2614('0x16')]),_0x2614('0x56'),{'uri':util['format'](_0x2614('0x4b'),_0xe7528b['remoteUri'],_0x9cb757['id'])});}})[_0x2614('0x4c')](function(_0x4db747){logger[_0x2614('0x4d')](_0x2614('0x52'),JSON['stringify'](_0x4db747));});};exports['unmanaged']=function(_0x3a7f91,_0x1613e4,_0x21a3e5,_0x297001,_0x1aa72c,_0xbf58d5){var _0x1cd383,_0x1f0234;_0xbf58d5['remoteUri']=intUtil[_0x2614('0x40')](_0xbf58d5['remoteUri']);_0xbf58d5[_0x2614('0x41')]=intUtil[_0x2614('0x40')](_0xbf58d5[_0x2614('0x41')]);if(_0x1aa72c&&_0x1aa72c[_0x2614('0x42')]){logger[_0x2614('0xe')]('['+_0x1613e4[_0x2614('0x57')][_0x2614('0x58')]()+']',_0x2614('0x43'));_0x1613e4['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xbf58d5['serverUrl'],_0x1613e4[_0x2614('0x46')],md5(_0x1613e4[_0x2614('0x46')]));}else{_0x1613e4[_0x2614('0x44')]='';}headers['Authorization']=getAuth(_0xbf58d5);return getUser(_0xbf58d5,'')[_0x2614('0x1c')](function(_0x44a619){_0x1cd383=_0x44a619;logger[_0x2614('0xe')]('The\x20User\x20ID\x20is:',_0x1cd383['id']);return getEndUser(_0xbf58d5,_0x1613e4[_0x2614('0x11')],_0x1613e4[_0x2614('0x12')]);})[_0x2614('0x1c')](function(_0x589155){_0x1f0234=_0x589155;logger['info'](_0x2614('0x48'),_0x1f0234['id']);return getTicket(_0xbf58d5,_0x1cd383,_0x1f0234,_0x21a3e5,_0x1613e4);})['then'](function(_0x14e47d){if(_0x14e47d){logger[_0x2614('0xe')](_0x2614('0x55'));logger['info'](_0x2614('0x59'),_0x14e47d['id']);}})[_0x2614('0x4c')](function(_0x58d0d6){logger['error']('['+_0x1613e4[_0x2614('0x57')][_0x2614('0x58')]()+']',JSON[_0x2614('0x5a')](_0x58d0d6));});};
\ No newline at end of file
index 9a90a82..44c9133 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0b4=['YYYY-MM-DDTHH:mm:ss','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','add','task','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','email','%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','ticketId','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','ioredis','redis','defaults','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','GET','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','Admin\x20selected','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts'];(function(_0x50e5a8,_0x71505d){var _0x1eb65b=function(_0x2daaea){while(--_0x2daaea){_0x50e5a8['push'](_0x50e5a8['shift']());}};_0x1eb65b(++_0x71505d);}(_0xf0b4,0x1e0));var _0x4f0b=function(_0x34eac3,_0x6c473d){_0x34eac3=_0x34eac3-0x0;var _0x150ad0=_0xf0b4[_0x34eac3];return _0x150ad0;};'use strict';var _=require(_0x4f0b('0x0'));var rp=require(_0x4f0b('0x1'));var md5=require(_0x4f0b('0x2'));var util=require(_0x4f0b('0x3'));var moment=require(_0x4f0b('0x4'));var Promise=require('bluebird');var Redis=require(_0x4f0b('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('freshsales');config[_0x4f0b('0x6')]=_[_0x4f0b('0x7')](config[_0x4f0b('0x6')],{'host':_0x4f0b('0x8'),'port':0x18eb});var io=require(_0x4f0b('0x9'))(new Redis(config[_0x4f0b('0x6')]));function getAdminId(_0x5f3e4d,_0x2d96e9,_0x5871b0,_0x50a8cb){return new Promise(function(_0x8095f7,_0x38ca14){var _0x13950a=![];var _0x1c7ca6={'method':'GET','uri':_0x50a8cb+_0x4f0b('0xa'),'json':!![]};_0x1c7ca6[_0x4f0b('0xb')]=_0x5871b0;logger[_0x4f0b('0xc')](_0x4f0b('0xd'));return rp(_0x1c7ca6)[_0x4f0b('0xe')](function(_0x182466){if(_0x182466){var _0x3b9b82=_0x182466[_0x4f0b('0xf')];var _0x759e05=null;for(_0x759e05=0x0;_0x759e05<_0x3b9b82['length'];_0x759e05++){if(_0x3b9b82[_0x759e05]['email']===_0x5f3e4d[_0x4f0b('0x10')]){_0x5f3e4d[_0x4f0b('0x11')]=_0x3b9b82[_0x759e05]['id'];_0x13950a=!![];}}if(_0x13950a){logger[_0x4f0b('0xc')](_0x4f0b('0x12'),_0x5f3e4d[_0x4f0b('0x11')]);_0x8095f7(_0x5f3e4d);}else{_0x38ca14({'statusCode':0x194,'message':_0x4f0b('0x13')});}}else{_0x38ca14({'statusCode':0x194,'message':_0x4f0b('0x13')});}})[_0x4f0b('0x14')](function(_0x45b317){logger['error']('['+[_0x2d96e9[_0x4f0b('0x15')]()]+']',_0x45b317[_0x4f0b('0x16')]);_0x38ca14(_0x45b317);});});}function getUser(_0x2e53fd,_0x56feb3,_0x46aa9a){return function(_0x1a6a23){return new Promise(function(_0x5cfff1,_0x5b9160){var _0x283a62={'method':_0x4f0b('0x17'),'uri':_0x46aa9a+'/api/selector/owners','json':!![]};_0x283a62[_0x4f0b('0xb')]=_0x56feb3;logger['info'](_0x4f0b('0x18'));return rp(_0x283a62)[_0x4f0b('0xe')](function(_0x4c69fe){if(_0x4c69fe){var _0x533bc8=_0x4c69fe['users'];var _0x5c1778=![];var _0x154bce=null;if(_0x1a6a23[_0x4f0b('0x19')]!==null){logger[_0x4f0b('0xc')](_0x4f0b('0x1a'),_0x1a6a23[_0x4f0b('0x19')]);_0x1a6a23[_0x4f0b('0x1b')]=_0x1a6a23[_0x4f0b('0x19')];for(_0x154bce=0x0;_0x154bce<_0x533bc8[_0x4f0b('0x1c')];_0x154bce++){if(_0x533bc8[_0x154bce]['email']===_0x1a6a23['agentEmail']){_0x5c1778=!![];_0x1a6a23[_0x4f0b('0x1d')]=_0x533bc8[_0x154bce]['id'];logger[_0x4f0b('0xc')]('User\x20found:',_0x1a6a23[_0x4f0b('0x1d')]);}}}if(!_0x5c1778){logger[_0x4f0b('0xc')](_0x4f0b('0x1e'));_0x1a6a23[_0x4f0b('0x1b')]=_0x1a6a23[_0x4f0b('0x10')];_0x1a6a23[_0x4f0b('0x1d')]=_0x1a6a23['adminId'];_0x5c1778=!![];}if(_0x5c1778){_0x5cfff1(_0x1a6a23);}else{_0x5b9160({'statusCode':0x194,'message':_0x4f0b('0x13')});}}else{_0x5b9160({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x3c3883){logger[_0x4f0b('0x1f')]('['+[_0x2e53fd[_0x4f0b('0x15')]()]+']',_0x3c3883[_0x4f0b('0x16')]);_0x5b9160(_0x3c3883);});});};}function searchContact(_0x1a08d6,_0x41bdf0,_0x4bc475,_0x50c1eb){return new Promise(function(_0x45c3d5,_0x4c1c50){var _0x1fb193={'method':_0x4f0b('0x17'),'headers':_0x41bdf0,'uri':_0x1a08d6+_0x4f0b('0x20')+_0x50c1eb+_0x4f0b('0x21')+_0x4bc475+_0x4f0b('0x22'),'json':!![]};rp(_0x1fb193)[_0x4f0b('0xe')](function(_0x240f5c){var _0x37c145=_[_0x4f0b('0x23')](_0x240f5c[_0x4f0b('0x24')][_0x4f0b('0x24')],[_0x4bc475,_0x50c1eb]);_0x45c3d5(_0x37c145);})[_0x4f0b('0x14')](function(_0x1e100d){_0x4c1c50(_0x1e100d);});});}function getEndUser(_0x5c54e4,_0x29851d,_0xbbf189){return function(_0xd0b393){return new Promise(function(_0x5e82aa,_0x55ea81){logger[_0x4f0b('0xc')](util[_0x4f0b('0x25')](_0x4f0b('0x26'),_0xd0b393[_0x4f0b('0x27')]));searchContact(_0xbbf189,_0x29851d,_0x4f0b('0x28'),_0xd0b393[_0x4f0b('0x27')])[_0x4f0b('0xe')](function(_0x55ad4e){if(_0x55ad4e){_0xd0b393[_0x4f0b('0x29')]=_0x55ad4e['id'];logger['info'](_0x4f0b('0x2a'),_0xd0b393[_0x4f0b('0x29')]);return _0x5e82aa(_0xd0b393);}searchContact(_0xbbf189,_0x29851d,_0x4f0b('0x2b'),_0xd0b393[_0x4f0b('0x27')])[_0x4f0b('0xe')](function(_0x40b024){if(_0x40b024){_0xd0b393[_0x4f0b('0x29')]=_0x40b024['id'];logger['info'](_0x4f0b('0x2c'),_0xd0b393[_0x4f0b('0x29')]);return _0x5e82aa(_0xd0b393);}createEndUser(_0xd0b393,_0x5c54e4,_0x29851d,_0xbbf189)[_0x4f0b('0xe')](function(_0xd575e7){logger[_0x4f0b('0xc')](_0x4f0b('0x2d'),_0xd575e7[_0x4f0b('0x29')]);return _0x5e82aa(_0xd575e7);});});})['catch'](function(_0x44b07d){_0x55ea81(_0x44b07d);});});};}function createEndUser(_0x4826c1,_0x202974,_0x50beb5,_0x430317){return new Promise(function(_0x5bcc11,_0x5697a3){var _0x11570d=moment();var _0x44e30c={'method':_0x4f0b('0x2e'),'uri':_0x430317+_0x4f0b('0x2f'),'body':{'contact':{'last_name':_0x4826c1[_0x4f0b('0x27')],'work_number':_0x4826c1[_0x4f0b('0x27')],'mobile_number':_0x4826c1[_0x4f0b('0x27')],'owner_id':_0x4826c1[_0x4f0b('0x1d')],'created_at':_0x11570d['format'](_0x4f0b('0x30'))}},'json':!![]};_0x44e30c[_0x4f0b('0xb')]=_0x50beb5;logger[_0x4f0b('0xc')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x44e30c)[_0x4f0b('0xe')](function(_0x376245){_0x4826c1[_0x4f0b('0x29')]=_0x376245['contact']['id'];_0x5bcc11(_0x4826c1);})[_0x4f0b('0x14')](function(_0x3650a0){logger[_0x4f0b('0x1f')]('['+[_0x202974['toUpperCase']()]+']',_0x3650a0[_0x4f0b('0x16')]);_0x5697a3(_0x3650a0[_0x4f0b('0x16')]);});});}function getTicket(_0x4278e4,_0x3a51fe,_0x3055fb,_0x3093e1,_0x517450){return function(_0x17eb92){logger[_0x4f0b('0xc')](_0x4f0b('0x31'));return new Promise(function(_0x43e4b9,_0x11e18a){var _0x5981f8=moment();var _0x16015={'method':_0x4f0b('0x2e'),'uri':_0x3055fb+_0x4f0b('0x32'),'body':{'title':intUtil[_0x4f0b('0x33')](_0x3093e1[_0x4f0b('0x34')],_0x517450,'\x20'),'description':intUtil[_0x4f0b('0x33')](_0x3093e1['Descriptions'],_0x517450,'\x0a'),'owner_id':_0x17eb92[_0x4f0b('0x1d')],'creater_id':_0x17eb92[_0x4f0b('0x11')],'targetable_id':_0x17eb92[_0x4f0b('0x29')],'targetable_type':_0x4f0b('0x35'),'created_at':_0x5981f8[_0x4f0b('0x25')](_0x4f0b('0x30')),'due_date':_0x5981f8[_0x4f0b('0x36')](0x1e,'m')[_0x4f0b('0x25')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x16015[_0x4f0b('0xb')]=_0x3a51fe;return rp(_0x16015)['then'](function(_0x3fe69e){_0x17eb92['ticketId']=_0x3fe69e[_0x4f0b('0x37')]['id'];logger['info']('Task\x20created:',_0x17eb92['ticketId']);_0x43e4b9(_0x17eb92);})[_0x4f0b('0x14')](function(_0xf83c16){logger['error']('['+[_0x4278e4[_0x4f0b('0x15')]()]+']',_0xf83c16['message']);_0x11e18a(_0xf83c16[_0x4f0b('0x16')]);});});};}function emit(_0x26e2a0,_0x451df0,_0x1a171b){var _0x317546={'uri':_0x26e2a0+_0x4f0b('0x38')+_0x1a171b};io['to'](util[_0x4f0b('0x25')](_0x4f0b('0x39'),_0x451df0))[_0x4f0b('0x3a')](_0x4f0b('0x3b'),_0x317546);}exports['cs']=function(_0x56e5d0,_0x426790,_0x38233f,_0x5da904,_0x5378b5,_0x46681d,_0x31a219,_0x472628){var _0x191360={};var _0x1434e5={'Authorization':_0x4f0b('0x3c')+_0x46681d[_0x4f0b('0x3d')]};_0x46681d[_0x4f0b('0x3e')]=intUtil['stripTrailingSlash'](_0x46681d[_0x4f0b('0x3e')]);_0x46681d['serverUrl']=intUtil[_0x4f0b('0x3f')](_0x46681d[_0x4f0b('0x40')]);var _0x4b855f=_0x46681d[_0x4f0b('0x3e')];_0x191360[_0x4f0b('0x10')]=_0x46681d[_0x4f0b('0x41')];_0x191360[_0x4f0b('0x27')]=_0x472628['toLowerCase']()===_0x4f0b('0x42')?_0x426790[_0x4f0b('0x43')]:_0x426790[_0x4f0b('0x44')];_0x191360[_0x4f0b('0x45')]=_0x472628==='queue'||_0x472628===_0x4f0b('0x46')?_0x4f0b('0x47'):_0x4f0b('0x42');if(_0x5da904){_0x191360[_0x4f0b('0x19')]=_0x5da904[_0x4f0b('0x48')];}var _0x220fc9=util[_0x4f0b('0x25')](_0x4f0b('0x49'),_0x46681d[_0x4f0b('0x40')],_0x426790['uniqueid'],md5(_0x426790[_0x4f0b('0x4a')]));if(_0x5378b5&&_0x5378b5[_0x4f0b('0x4b')]){logger[_0x4f0b('0xc')](_0x4f0b('0x4c'),_0x4f0b('0x4d'));_0x426790[_0x4f0b('0x4e')]=_0x220fc9;}else if(_0x31a219&&_0x31a219['recordingFormat']&&_0x31a219[_0x4f0b('0x4f')]!==_0x4f0b('0x50')){logger[_0x4f0b('0xc')](_0x4f0b('0x51'),'Recording\x20is\x20enabled!');_0x426790[_0x4f0b('0x4e')]=_0x220fc9;}else{_0x426790[_0x4f0b('0x4e')]='';}return getAdminId(_0x191360,_0x472628,_0x1434e5,_0x4b855f)[_0x4f0b('0xe')](getUser(_0x472628,_0x1434e5,_0x4b855f))[_0x4f0b('0xe')](getEndUser(_0x472628,_0x1434e5,_0x4b855f))[_0x4f0b('0xe')](getTicket(_0x472628,_0x1434e5,_0x4b855f,_0x38233f,_0x426790))[_0x4f0b('0xe')](function(_0x1053b4){logger[_0x4f0b('0xc')](util[_0x4f0b('0x25')](_0x4f0b('0x52'),_0x1053b4[_0x4f0b('0x53')]));if(_0x472628!==_0x4f0b('0x46')){logger[_0x4f0b('0xc')]('['+[_0x472628[_0x4f0b('0x15')]()]+']',_0x4f0b('0x54'));emit(_0x4b855f,_0x5da904[_0x4f0b('0x55')],_0x1053b4[_0x4f0b('0x29')]);}})[_0x4f0b('0x14')](function(_0xdeb67b){logger[_0x4f0b('0x1f')]('['+[_0x472628['toUpperCase']()]+_0x4f0b('0x56'),util[_0x4f0b('0x57')](_0xdeb67b,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x1063=['Contact','ticketId','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','bluebird','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','find','contacts','format','contactNumber','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1063,0xb7));var _0x3106=function(_0x9897bf,_0x5c059b){_0x9897bf=_0x9897bf-0x0;var _0x56cfc9=_0x1063[_0x9897bf];return _0x56cfc9;};'use strict';var _=require(_0x3106('0x0'));var rp=require(_0x3106('0x1'));var md5=require(_0x3106('0x2'));var util=require('util');var moment=require('moment');var Promise=require(_0x3106('0x3'));var Redis=require('ioredis');var intUtil=require(_0x3106('0x4'));var config=require('../../../../config/environment');var logger=require(_0x3106('0x5'))('freshsales');config[_0x3106('0x6')]=_[_0x3106('0x7')](config[_0x3106('0x6')],{'host':_0x3106('0x8'),'port':0x18eb});var io=require(_0x3106('0x9'))(new Redis(config[_0x3106('0x6')]));function getAdminId(_0x17378d,_0x4c3870,_0x3943e4,_0x4cc321){return new Promise(function(_0x57f29a,_0x2595fc){var _0x7a4ae6=![];var _0x9ec78f={'method':_0x3106('0xa'),'uri':_0x4cc321+'/api/selector/owners','json':!![]};_0x9ec78f[_0x3106('0xb')]=_0x3943e4;logger[_0x3106('0xc')](_0x3106('0xd'));return rp(_0x9ec78f)[_0x3106('0xe')](function(_0x14884f){if(_0x14884f){var _0x1a3b02=_0x14884f['users'];var _0x18954d=null;for(_0x18954d=0x0;_0x18954d<_0x1a3b02[_0x3106('0xf')];_0x18954d++){if(_0x1a3b02[_0x18954d][_0x3106('0x10')]===_0x17378d[_0x3106('0x11')]){_0x17378d['adminId']=_0x1a3b02[_0x18954d]['id'];_0x7a4ae6=!![];}}if(_0x7a4ae6){logger[_0x3106('0xc')](_0x3106('0x12'),_0x17378d[_0x3106('0x13')]);_0x57f29a(_0x17378d);}else{_0x2595fc({'statusCode':0x194,'message':_0x3106('0x14')});}}else{_0x2595fc({'statusCode':0x194,'message':_0x3106('0x14')});}})[_0x3106('0x15')](function(_0x36c019){logger[_0x3106('0x16')]('['+[_0x4c3870[_0x3106('0x17')]()]+']',_0x36c019[_0x3106('0x18')]);_0x2595fc(_0x36c019);});});}function getUser(_0x3f1ced,_0xbabc04,_0x567755){return function(_0x47fc69){return new Promise(function(_0x4e48da,_0x2b923d){var _0x27fa87={'method':_0x3106('0xa'),'uri':_0x567755+_0x3106('0x19'),'json':!![]};_0x27fa87[_0x3106('0xb')]=_0xbabc04;logger[_0x3106('0xc')](_0x3106('0x1a'));return rp(_0x27fa87)[_0x3106('0xe')](function(_0x4cf912){if(_0x4cf912){var _0x325b55=_0x4cf912['users'];var _0x19b18e=![];var _0x2bef1f=null;if(_0x47fc69['agentEmail']!==null){logger[_0x3106('0xc')](_0x3106('0x1b'),_0x47fc69[_0x3106('0x1c')]);_0x47fc69[_0x3106('0x1d')]=_0x47fc69['agentEmail'];for(_0x2bef1f=0x0;_0x2bef1f<_0x325b55[_0x3106('0xf')];_0x2bef1f++){if(_0x325b55[_0x2bef1f]['email']===_0x47fc69[_0x3106('0x1c')]){_0x19b18e=!![];_0x47fc69[_0x3106('0x1e')]=_0x325b55[_0x2bef1f]['id'];logger[_0x3106('0xc')](_0x3106('0x1f'),_0x47fc69[_0x3106('0x1e')]);}}}if(!_0x19b18e){logger[_0x3106('0xc')](_0x3106('0x20'));_0x47fc69[_0x3106('0x1d')]=_0x47fc69[_0x3106('0x11')];_0x47fc69[_0x3106('0x1e')]=_0x47fc69['adminId'];_0x19b18e=!![];}if(_0x19b18e){_0x4e48da(_0x47fc69);}else{_0x2b923d({'statusCode':0x194,'message':_0x3106('0x14')});}}else{_0x2b923d({'statusCode':0x194,'message':_0x3106('0x14')});}})['catch'](function(_0x22336a){logger[_0x3106('0x16')]('['+[_0x3f1ced[_0x3106('0x17')]()]+']',_0x22336a[_0x3106('0x18')]);_0x2b923d(_0x22336a);});});};}function searchContact(_0x478753,_0x2a832d,_0x95fc97,_0x4b14f0){return new Promise(function(_0x4d432d,_0x57fe3c){var _0x57ec18={'method':_0x3106('0xa'),'headers':_0x2a832d,'uri':_0x478753+'/api/lookup?q='+_0x4b14f0+'&f='+_0x95fc97+'&entities=contact','json':!![]};rp(_0x57ec18)[_0x3106('0xe')](function(_0x37c620){var _0x5cc395=_[_0x3106('0x21')](_0x37c620['contacts'][_0x3106('0x22')],[_0x95fc97,_0x4b14f0]);_0x4d432d(_0x5cc395);})[_0x3106('0x15')](function(_0x40bfc4){_0x57fe3c(_0x40bfc4);});});}function getEndUser(_0x1159b6,_0x42864e,_0x43d569){return function(_0x2f4fed){return new Promise(function(_0x23a9df,_0xbe1d97){logger[_0x3106('0xc')](util[_0x3106('0x23')]('Searching\x20contact\x20with\x20phone\x20%s',_0x2f4fed[_0x3106('0x24')]));searchContact(_0x43d569,_0x42864e,'mobile_number',_0x2f4fed[_0x3106('0x24')])[_0x3106('0xe')](function(_0x3bc0ce){if(_0x3bc0ce){_0x2f4fed[_0x3106('0x25')]=_0x3bc0ce['id'];logger['info'](_0x3106('0x26'),_0x2f4fed[_0x3106('0x25')]);return _0x23a9df(_0x2f4fed);}searchContact(_0x43d569,_0x42864e,'work_number',_0x2f4fed[_0x3106('0x24')])[_0x3106('0xe')](function(_0x31677b){if(_0x31677b){_0x2f4fed[_0x3106('0x25')]=_0x31677b['id'];logger['info'](_0x3106('0x27'),_0x2f4fed[_0x3106('0x25')]);return _0x23a9df(_0x2f4fed);}createEndUser(_0x2f4fed,_0x1159b6,_0x42864e,_0x43d569)[_0x3106('0xe')](function(_0x6c22cd){logger[_0x3106('0xc')](_0x3106('0x28'),_0x6c22cd[_0x3106('0x25')]);return _0x23a9df(_0x6c22cd);});});})[_0x3106('0x15')](function(_0x1f4679){_0xbe1d97(_0x1f4679);});});};}function createEndUser(_0x3ff7ac,_0x1d8986,_0x4e9c01,_0xf9cfc8){return new Promise(function(_0x1ed91e,_0x3d21a9){var _0x3c8a87=moment();var _0x22e01d={'method':_0x3106('0x29'),'uri':_0xf9cfc8+_0x3106('0x2a'),'body':{'contact':{'last_name':_0x3ff7ac['contactNumber'],'work_number':_0x3ff7ac[_0x3106('0x24')],'mobile_number':_0x3ff7ac[_0x3106('0x24')],'owner_id':_0x3ff7ac[_0x3106('0x1e')],'created_at':_0x3c8a87[_0x3106('0x23')](_0x3106('0x2b'))}},'json':!![]};_0x22e01d[_0x3106('0xb')]=_0x4e9c01;logger[_0x3106('0xc')](_0x3106('0x2c'));return rp(_0x22e01d)[_0x3106('0xe')](function(_0x343172){_0x3ff7ac[_0x3106('0x25')]=_0x343172[_0x3106('0x2d')]['id'];_0x1ed91e(_0x3ff7ac);})[_0x3106('0x15')](function(_0x2274f0){logger[_0x3106('0x16')]('['+[_0x1d8986[_0x3106('0x17')]()]+']',_0x2274f0[_0x3106('0x18')]);_0x3d21a9(_0x2274f0[_0x3106('0x18')]);});});}function getTicket(_0x2f96cb,_0x10e260,_0x1e93ff,_0x455d08,_0x44c11f){return function(_0x5211ca){logger[_0x3106('0xc')](_0x3106('0x2e'));return new Promise(function(_0x5bee97,_0x42902b){var _0x17cdde=moment();var _0x847419={'method':'POST','uri':_0x1e93ff+_0x3106('0x2f'),'body':{'title':intUtil[_0x3106('0x30')](_0x455d08[_0x3106('0x31')],_0x44c11f,'\x20'),'description':intUtil[_0x3106('0x30')](_0x455d08[_0x3106('0x32')],_0x44c11f,'\x0a'),'owner_id':_0x5211ca[_0x3106('0x1e')],'creater_id':_0x5211ca[_0x3106('0x13')],'targetable_id':_0x5211ca['endUserId'],'targetable_type':_0x3106('0x33'),'created_at':_0x17cdde['format'](_0x3106('0x2b')),'due_date':_0x17cdde['add'](0x1e,'m')['format'](_0x3106('0x2b'))},'json':!![]};_0x847419[_0x3106('0xb')]=_0x10e260;return rp(_0x847419)['then'](function(_0x47dec3){_0x5211ca[_0x3106('0x34')]=_0x47dec3['task']['id'];logger[_0x3106('0xc')](_0x3106('0x35'),_0x5211ca[_0x3106('0x34')]);_0x5bee97(_0x5211ca);})[_0x3106('0x15')](function(_0x2a0745){logger[_0x3106('0x16')]('['+[_0x2f96cb['toUpperCase']()]+']',_0x2a0745[_0x3106('0x18')]);_0x42902b(_0x2a0745[_0x3106('0x18')]);});});};}function emit(_0x550a69,_0x57587c,_0x306eb1){var _0x561f1c={'uri':_0x550a69+'/contacts/'+_0x306eb1};io['to'](util['format'](_0x3106('0x36'),_0x57587c))[_0x3106('0x37')](_0x3106('0x38'),_0x561f1c);}exports['cs']=function(_0x295c16,_0x3849f2,_0x17e0be,_0x18838e,_0x293b55,_0x132c79,_0x4ff76b,_0x4cc1f2){var _0x1fe8f9={};var _0x154a52={'Authorization':_0x3106('0x39')+_0x132c79[_0x3106('0x3a')]};_0x132c79[_0x3106('0x3b')]=intUtil[_0x3106('0x3c')](_0x132c79[_0x3106('0x3b')]);_0x132c79['serverUrl']=intUtil[_0x3106('0x3c')](_0x132c79[_0x3106('0x3d')]);var _0x1d25e9=_0x132c79[_0x3106('0x3b')];_0x1fe8f9[_0x3106('0x11')]=_0x132c79[_0x3106('0x3e')];_0x1fe8f9['contactNumber']=_0x4cc1f2[_0x3106('0x3f')]()==='outbound'?_0x3849f2[_0x3106('0x40')]:_0x3849f2[_0x3106('0x41')];_0x1fe8f9[_0x3106('0x42')]=_0x4cc1f2===_0x3106('0x43')||_0x4cc1f2===_0x3106('0x44')?_0x3106('0x43'):'outbound';if(_0x18838e){_0x1fe8f9[_0x3106('0x1c')]=_0x18838e[_0x3106('0x10')];}var _0x3b730b=util[_0x3106('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x132c79[_0x3106('0x3d')],_0x3849f2[_0x3106('0x45')],md5(_0x3849f2['uniqueid']));if(_0x293b55&&_0x293b55['monitor_format']){logger[_0x3106('0xc')](_0x3106('0x46'),_0x3106('0x47'));_0x3849f2[_0x3106('0x48')]=_0x3b730b;}else if(_0x4ff76b&&_0x4ff76b[_0x3106('0x49')]&&_0x4ff76b['recordingFormat']!==_0x3106('0x4a')){logger[_0x3106('0xc')](_0x3106('0x4b'),'Recording\x20is\x20enabled!');_0x3849f2[_0x3106('0x48')]=_0x3b730b;}else{_0x3849f2['recordingURL']='';}return getAdminId(_0x1fe8f9,_0x4cc1f2,_0x154a52,_0x1d25e9)['then'](getUser(_0x4cc1f2,_0x154a52,_0x1d25e9))[_0x3106('0xe')](getEndUser(_0x4cc1f2,_0x154a52,_0x1d25e9))[_0x3106('0xe')](getTicket(_0x4cc1f2,_0x154a52,_0x1d25e9,_0x17e0be,_0x3849f2))[_0x3106('0xe')](function(_0x68dee4){logger[_0x3106('0xc')](util[_0x3106('0x23')]('The\x20ticket\x20ID\x20is:\x20%s',_0x68dee4[_0x3106('0x34')]));if(_0x4cc1f2!==_0x3106('0x44')){logger['info']('['+[_0x4cc1f2['toUpperCase']()]+']',_0x3106('0x4c'));emit(_0x1d25e9,_0x18838e['name'],_0x68dee4[_0x3106('0x25')]);}})[_0x3106('0x15')](function(_0x355ff8){logger['error']('['+[_0x4cc1f2[_0x3106('0x17')]()]+_0x3106('0x4d'),util['inspect'](_0x355ff8,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index ea6f893..286b7cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc04=['vtiger','dynamics365','freshsales','servicenow','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','desk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xbc04,0xba));var _0x4bc0=function(_0x500efe,_0x126ff4){_0x500efe=_0x500efe-0x0;var _0x476d44=_0xbc04[_0x500efe];return _0x476d44;};'use strict';var _=require(_0x4bc0('0x0'));var util=require(_0x4bc0('0x1'));var zendesk=require(_0x4bc0('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x4bc0('0x3'));var freshdesk=require(_0x4bc0('0x4'));var zoho=require('./zoho');var desk=require(_0x4bc0('0x5'));var vtiger=require(_0x4bc0('0x6'));var servicenow=require(_0x4bc0('0x7'));var dynamics365=require(_0x4bc0('0x8'));var freshsales=require(_0x4bc0('0x9'));var integrations=['zendesk',_0x4bc0('0xa'),_0x4bc0('0xb'),_0x4bc0('0xc'),_0x4bc0('0xd'),'desk',_0x4bc0('0xe'),_0x4bc0('0xf'),_0x4bc0('0x10'),_0x4bc0('0x11')];exports['exec']=function(_0x50a0d1,_0x13bff0,_0x397db2,_0x2a84d8,_0x3e6866,_0x3a81a0){if(_0x397db2){if(_[_0x4bc0('0x12')](integrations,_0x50a0d1[_0x4bc0('0x13')][_0x4bc0('0x14')]())){try{var _0x188b39=null;var _0x4c4f85='';var _0x24f41f=_0x397db2[_0x50a0d1[_0x4bc0('0x13')][_0x4bc0('0x14')]()];if(_0x24f41f){var _0x247134=_0x24f41f[_0x50a0d1[_0x4bc0('0x15')]];if(_0x247134){var _0x5e8de7=_[_0x4bc0('0x16')](_0x247134[_0x4bc0('0x17')],{'id':parseInt(_0x50a0d1['data3'],0xa)});if(_0x5e8de7){if(_0x2a84d8){if(_0x3e6866&&_0x13bff0[_0x4bc0('0x18')]){_0x4c4f85=_0x4bc0('0x18');}else if(_0x13bff0[_0x4bc0('0x19')]){_0x4c4f85=_0x4bc0('0x1a');}else{console[_0x4bc0('0x1b')](_0x4bc0('0x1c'),_0x13bff0);}}else{_0x4c4f85=_0x4bc0('0x1d');}switch(_0x50a0d1[_0x4bc0('0x13')][_0x4bc0('0x14')]()){case _0x4bc0('0x1e'):zendesk[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case'salesforce':salesforce[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case _0x4bc0('0xb'):sugarcrm[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case _0x4bc0('0xc'):freshdesk[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case _0x4bc0('0xd'):zoho[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case _0x4bc0('0x1f'):desk[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case _0x4bc0('0xe'):vtiger[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case _0x4bc0('0x10'):freshsales['cs'](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0,_0x4c4f85);break;case'servicenow':servicenow['cs'](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0,_0x4c4f85);break;case _0x4bc0('0xf'):dynamics365['cs'](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0,_0x4c4f85);break;default:console['log'](_0x4bc0('0x20'));}}else{_0x188b39=require(_0x4bc0('0x21'))(_0x50a0d1[_0x4bc0('0x13')][_0x4bc0('0x14')]());_0x188b39[_0x4bc0('0x22')](_0x4bc0('0x23'),util[_0x4bc0('0x24')](_0x4bc0('0x25'),_0x50a0d1[_0x4bc0('0x13')][_0x4bc0('0x14')](),_0x50a0d1[_0x4bc0('0x26')]));}}else{_0x188b39=require(_0x4bc0('0x21'))(_0x50a0d1[_0x4bc0('0x13')]['toLowerCase']());_0x188b39[_0x4bc0('0x22')](_0x4bc0('0x23'),util[_0x4bc0('0x24')](_0x4bc0('0x27'),_0x50a0d1[_0x4bc0('0x13')]['toLowerCase'](),_0x50a0d1[_0x4bc0('0x15')]));}}else{}}catch(_0x2c746c){console[_0x4bc0('0x22')](_0x2c746c);}}}};
\ No newline at end of file
+var _0xb288=['freshdesk','zoho','desk','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','data2','Configurations','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','log','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','data3','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm'];(function(_0x74892f,_0x1e981b){var _0x10ee61=function(_0x3c480a){while(--_0x3c480a){_0x74892f['push'](_0x74892f['shift']());}};_0x10ee61(++_0x1e981b);}(_0xb288,0x1b1));var _0x8b28=function(_0x33cf0a,_0x553307){_0x33cf0a=_0x33cf0a-0x0;var _0x145ed8=_0xb288[_0x33cf0a];return _0x145ed8;};'use strict';var _=require(_0x8b28('0x0'));var util=require('util');var zendesk=require(_0x8b28('0x1'));var salesforce=require(_0x8b28('0x2'));var sugarcrm=require(_0x8b28('0x3'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0x8b28('0x4'));var vtiger=require(_0x8b28('0x5'));var servicenow=require(_0x8b28('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0x8b28('0x7'));var integrations=[_0x8b28('0x8'),_0x8b28('0x9'),_0x8b28('0xa'),_0x8b28('0xb'),_0x8b28('0xc'),_0x8b28('0xd'),_0x8b28('0xe'),_0x8b28('0xf'),'freshsales',_0x8b28('0x10')];exports[_0x8b28('0x11')]=function(_0x269001,_0x37f64b,_0x15ad27,_0x421ce8,_0x31fcea,_0x112ea5){if(_0x15ad27){if(_[_0x8b28('0x12')](integrations,_0x269001[_0x8b28('0x13')][_0x8b28('0x14')]())){try{var _0x2bf326=null;var _0x5052ab='';var _0x53cff3=_0x15ad27[_0x269001['data1']['toLowerCase']()];if(_0x53cff3){var _0x7dfcf8=_0x53cff3[_0x269001[_0x8b28('0x15')]];if(_0x7dfcf8){var _0x10485a=_['find'](_0x7dfcf8[_0x8b28('0x16')],{'id':parseInt(_0x269001['data3'],0xa)});if(_0x10485a){if(_0x421ce8){if(_0x31fcea&&_0x37f64b[_0x8b28('0x17')]){_0x5052ab=_0x8b28('0x17');}else if(_0x37f64b[_0x8b28('0x18')]){_0x5052ab=_0x8b28('0x19');}else{console['log'](_0x8b28('0x1a'),_0x37f64b);}}else{_0x5052ab=_0x8b28('0x1b');}switch(_0x269001['data1'][_0x8b28('0x14')]()){case'zendesk':zendesk[_0x5052ab](_0x269001,_0x37f64b,_0x10485a,_0x421ce8,_0x31fcea,_0x7dfcf8,_0x112ea5);break;case'salesforce':salesforce[_0x5052ab](_0x269001,_0x37f64b,_0x10485a,_0x421ce8,_0x31fcea,_0x7dfcf8,_0x112ea5);break;case _0x8b28('0xa'):sugarcrm[_0x5052ab](_0x269001,_0x37f64b,_0x10485a,_0x421ce8,_0x31fcea,_0x7dfcf8,_0x112ea5);break;case _0x8b28('0xb'):freshdesk[_0x5052ab](_0x269001,_0x37f64b,_0x10485a,_0x421ce8,_0x31fcea,_0x7dfcf8,_0x112ea5);break;case _0x8b28('0xc'):zoho[_0x5052ab](_0x269001,_0x37f64b,_0x10485a,_0x421ce8,_0x31fcea,_0x7dfcf8,_0x112ea5);break;case'desk':desk[_0x5052ab](_0x269001,_0x37f64b,_0x10485a,_0x421ce8,_0x31fcea,_0x7dfcf8,_0x112ea5);break;case _0x8b28('0xe'):vtiger[_0x5052ab](_0x269001,_0x37f64b,_0x10485a,_0x421ce8,_0x31fcea,_0x7dfcf8,_0x112ea5);break;case'freshsales':freshsales['cs'](_0x269001,_0x37f64b,_0x10485a,_0x421ce8,_0x31fcea,_0x7dfcf8,_0x112ea5,_0x5052ab);break;case _0x8b28('0x10'):servicenow['cs'](_0x269001,_0x37f64b,_0x10485a,_0x421ce8,_0x31fcea,_0x7dfcf8,_0x112ea5,_0x5052ab);break;case _0x8b28('0xf'):dynamics365['cs'](_0x269001,_0x37f64b,_0x10485a,_0x421ce8,_0x31fcea,_0x7dfcf8,_0x112ea5,_0x5052ab);break;default:console[_0x8b28('0x1c')](_0x8b28('0x1d'));}}else{_0x2bf326=require(_0x8b28('0x1e'))(_0x269001['data1'][_0x8b28('0x14')]());_0x2bf326[_0x8b28('0x1f')]('[EXEC]',util[_0x8b28('0x20')](_0x8b28('0x21'),_0x269001[_0x8b28('0x13')]['toLowerCase'](),_0x269001[_0x8b28('0x22')]));}}else{_0x2bf326=require(_0x8b28('0x1e'))(_0x269001[_0x8b28('0x13')]['toLowerCase']());_0x2bf326[_0x8b28('0x1f')](_0x8b28('0x23'),util[_0x8b28('0x20')](_0x8b28('0x24'),_0x269001[_0x8b28('0x13')][_0x8b28('0x14')](),_0x269001['data2']));}}else{}}catch(_0x301c96){console[_0x8b28('0x1f')](_0x301c96);}}}};
\ No newline at end of file
index 1f9f4ab..ef53c42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4db7=['identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','sobject','Contact','execute','additionalSearchLead','Lead','account_contact_lead','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','recordingURL',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','emit','assign','getString','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','account','WhatId','Case','contact','ContactId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','User','find','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.'];(function(_0x32f97a,_0x1b5fba){var _0x17d7b2=function(_0x5358d6){while(--_0x5358d6){_0x32f97a['push'](_0x32f97a['shift']());}};_0x17d7b2(++_0x1b5fba);}(_0x4db7,0x1da));var _0x74db=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4db7[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x74db('0x0'));var rp=require('request-promise');var moment=require(_0x74db('0x1'));var BPromise=require(_0x74db('0x2'));var md5=require(_0x74db('0x3'));var jsforce=require('jsforce');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x74db('0x4'));var config=require(_0x74db('0x5'));var logger=require(_0x74db('0x6'))(_0x74db('0x7'));config[_0x74db('0x8')]=_[_0x74db('0x9')](config[_0x74db('0x8')],{'host':_0x74db('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x1eb9d8,_0x27aa6f,_0xf6d3b2){io['to'](_0x1eb9d8)[_0x74db('0xb')](_0x27aa6f,_0xf6d3b2);}function getTicket(_0x9bcd96,_0x27a55c,_0x6678b,_0x150ab2,_0x3b91fb,_0x339f3a,_0x29087b,_0x149437){var _0x5a74fd=Object[_0x74db('0xc')]({},{'OwnerId':_0x27a55c['id'],'Subject':intUtil[_0x74db('0xd')](_0x150ab2['Subjects'],_0x3b91fb,'\x20'),'Description':intUtil[_0x74db('0xd')](_0x150ab2[_0x74db('0xe')],_0x3b91fb,'\x0a')},getCustomFields(_0x339f3a,_0x3b91fb));if(_0x6678b){if(_0x150ab2[_0x74db('0xf')]==='Task'){_0x5a74fd[_0x74db('0x10')]=moment[_0x74db('0x11')]();_0x5a74fd[_0x74db('0x12')]=![];_0x5a74fd[_0x74db('0x13')]=![];if(_0x6678b[_0x74db('0x14')]==='contact'||_0x6678b['endUserType']==='lead'){_0x5a74fd['WhoId']=_0x6678b['id'];}else if(_0x6678b['endUserType']===_0x74db('0x15')){_0x5a74fd[_0x74db('0x16')]=_0x6678b['id'];}}else if(_0x150ab2[_0x74db('0xf')]===_0x74db('0x17')){if(_0x6678b[_0x74db('0x14')]===_0x74db('0x18')){_0x5a74fd[_0x74db('0x19')]=_0x6678b['id'];}else if(_0x6678b[_0x74db('0x14')]===_0x74db('0x15')){_0x5a74fd['AccountId']=_0x6678b['id'];}else if(_0x6678b[_0x74db('0x14')]===_0x74db('0x1a')&&_0x150ab2[_0x74db('0x1b')]){_0x5a74fd[_0x150ab2['leadId']]=_0x6678b['id'];}else{logger[_0x74db('0x1c')](_0x74db('0x1d'));}}}return _0x29087b['sobject'](_0x150ab2[_0x74db('0xf')])[_0x74db('0x1e')](_0x5a74fd);}function getUser(_0x40ad97,_0x5a24c1,_0x242102){if(!_[_0x74db('0x1f')](_0x5a24c1)&&intUtil[_0x74db('0x20')](_0x5a24c1)){var _0x36c5f1={'Email':_0x5a24c1};var _0x3bd384={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x242102['sobject'](_0x74db('0x21'))[_0x74db('0x22')](_0x36c5f1,_0x3bd384)['execute']()[_0x74db('0x23')](function(_0x4e45eb){if(_0x4e45eb[_0x74db('0x24')]){var _0x211eb0=_[_0x74db('0x22')](_0x4e45eb,function(_0x2d3b0d){return _0x2d3b0d[_0x74db('0x25')]===_0x5a24c1;});if(_0x211eb0){logger[_0x74db('0x1c')](_0x74db('0x26'),_0x5a24c1);return BPromise[_0x74db('0x27')]({'id':_0x211eb0['Id'],'name':_0x211eb0[_0x74db('0x28')]});}}else{logger['info'](_0x74db('0x29'),_0x5a24c1);return _0x242102[_0x74db('0x2a')]()[_0x74db('0x23')](function(_0x277dc1){return BPromise['resolve']({'id':_0x277dc1[_0x74db('0x2b')],'name':_0x277dc1[_0x74db('0x2c')]});});}});}else{logger[_0x74db('0x1c')](_0x74db('0x29'),_0x5a24c1);return _0x242102[_0x74db('0x2a')]()[_0x74db('0x23')](function(_0x480fea){return BPromise[_0x74db('0x27')]({'id':_0x480fea['user_id'],'name':_0x480fea[_0x74db('0x2c')]});});}}function getEndUser(_0x39038a,_0x582e10,_0x22cbe7,_0x3110b6,_0x3a2cee){var _0x4d5a04={'$or':{'Phone':_0x3110b6}};var _0x4d87f2={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x74db('0x27')]()[_0x74db('0x23')](function(){logger[_0x74db('0x1c')](_0x74db('0x2d'),_0x3110b6,_0x582e10[_0x74db('0x2e')]);switch(_0x582e10[_0x74db('0x2e')]){case'contact_lead':var _0x1001af=_[_0x74db('0x2f')](_0x4d5a04);if(_0x582e10[_0x74db('0x30')]){var _0xbc68da={};_0xbc68da[_0x582e10[_0x74db('0x30')]]=_0x3110b6;_[_0x74db('0x31')](_0x1001af[_0x74db('0x32')],_0xbc68da);}return _0x3a2cee[_0x74db('0x33')](_0x74db('0x34'))[_0x74db('0x22')](_0x1001af,_0x4d87f2)[_0x74db('0x35')]()[_0x74db('0x23')](function(_0x5ec88a){if(_0x5ec88a&&_0x5ec88a[_0x74db('0x24')]){return _0x5ec88a;}else{var _0x1d71b2=_[_0x74db('0x2f')](_0x4d5a04);if(_0x582e10['additionalSearchLead']){var _0x5dae9e={};_0x5dae9e[_0x582e10[_0x74db('0x36')]]=_0x3110b6;_[_0x74db('0x31')](_0x1d71b2[_0x74db('0x32')],_0x5dae9e);}return _0x3a2cee[_0x74db('0x33')](_0x74db('0x37'))[_0x74db('0x22')](_0x1d71b2,_0x4d87f2);}});case _0x74db('0x38'):var _0x52a990=_['cloneDeep'](_0x4d5a04);if(_0x582e10['additionalSearchAccount']){var _0xbc68da={};_0xbc68da[_0x582e10['additionalSearchAccount']]=_0x3110b6;_[_0x74db('0x31')](_0x52a990[_0x74db('0x32')],_0xbc68da);}return _0x3a2cee[_0x74db('0x33')](_0x74db('0x39'))[_0x74db('0x22')](_0x52a990,_0x4d87f2)['execute']()[_0x74db('0x23')](function(_0x22f751){if(_0x22f751&&_0x22f751['length']){return _0x22f751;}else{var _0x3aa2b7=_[_0x74db('0x2f')](_0x4d5a04);if(_0x582e10[_0x74db('0x30')]){var _0x4dd824={};_0x4dd824[_0x582e10['additionalSearchContact']]=_0x3110b6;_[_0x74db('0x31')](_0x3aa2b7['$or'],_0x4dd824);}return _0x3a2cee['sobject'](_0x74db('0x34'))[_0x74db('0x22')](_0x3aa2b7,_0x4d87f2)[_0x74db('0x23')](function(_0xf7207e){if(_0xf7207e&&_0xf7207e[_0x74db('0x24')]){return _0xf7207e;}else{var _0x603c=_['cloneDeep'](_0x4d5a04);if(_0x582e10[_0x74db('0x36')]){var _0x2d26c9={};_0x2d26c9[_0x582e10['additionalSearchLead']]=_0x3110b6;_[_0x74db('0x31')](_0x603c['$or'],_0x2d26c9);}return _0x3a2cee[_0x74db('0x33')](_0x74db('0x37'))[_0x74db('0x22')](_0x603c,_0x4d87f2);}});}});case'contact':var _0x1001af=_[_0x74db('0x2f')](_0x4d5a04);if(_0x582e10[_0x74db('0x30')]){var _0xbc68da={};_0xbc68da[_0x582e10[_0x74db('0x30')]]=_0x3110b6;_[_0x74db('0x31')](_0x1001af[_0x74db('0x32')],_0xbc68da);}return _0x3a2cee[_0x74db('0x33')](_0x74db('0x34'))['find'](_0x1001af,_0x4d87f2)[_0x74db('0x35')]();case _0x74db('0x1a'):var _0x4f6cb6=_['cloneDeep'](_0x4d5a04);if(_0x582e10[_0x74db('0x36')]){var _0xbc68da={};_0xbc68da[_0x582e10[_0x74db('0x36')]]=_0x3110b6;_['merge'](_0x4f6cb6['$or'],_0xbc68da);}return _0x3a2cee[_0x74db('0x33')](_0x74db('0x37'))[_0x74db('0x22')](_0x4f6cb6,_0x4d87f2);case _0x74db('0x15'):var _0x52a990=_[_0x74db('0x2f')](_0x4d5a04);if(_0x582e10['additionalSearchAccount']){var _0xbc68da={};_0xbc68da[_0x582e10['additionalSearchAccount']]=_0x3110b6;_['merge'](_0x52a990[_0x74db('0x32')],_0xbc68da);}return _0x3a2cee['sobject']('Account')[_0x74db('0x22')](_0x52a990,_0x4d87f2);default:return null;}})[_0x74db('0x23')](function(_0x446092){if(_0x446092&&_0x446092[_0x74db('0x24')]){var _0x31c8e8=_[_0x74db('0x3a')](_0x446092);if(_0x31c8e8){return BPromise['resolve']({'id':_0x31c8e8['Id'],'name':_0x31c8e8[_0x74db('0x28')],'phone':_0x31c8e8[_0x74db('0x3b')],'endUserType':_0x31c8e8[_0x74db('0x3c')][_0x74db('0x3d')][_0x74db('0x3e')]()});}}})[_0x74db('0x23')](function(_0x24001b){if(_0x24001b){logger[_0x74db('0x1c')](_0x74db('0x3f'),_0x24001b[_0x74db('0x14')],_0x3110b6);return BPromise[_0x74db('0x27')](_0x24001b);}else{logger[_0x74db('0x1c')](_0x74db('0x40'),_0x3110b6);var _0x2fa734={'Phone':_0x3110b6};if(_0x582e10[_0x74db('0x41')]){if(_0x582e10[_0x74db('0x41')]===_0x74db('0x18')){logger[_0x74db('0x1c')](_0x74db('0x42'),_0x3110b6,_0x582e10[_0x74db('0x41')]);_0x2fa734[_0x74db('0x43')]=_0x22cbe7!==_0x74db('0x44')?_0x22cbe7:util[_0x74db('0x45')](_0x74db('0x46'),_0x3110b6);}else if(_0x582e10[_0x74db('0x41')]===_0x74db('0x1a')){logger[_0x74db('0x1c')](_0x74db('0x42'),_0x3110b6,_0x582e10[_0x74db('0x41')]);_0x2fa734['LastName']=_0x22cbe7!==_0x74db('0x44')?_0x22cbe7:util[_0x74db('0x45')](_0x74db('0x46'),_0x3110b6);_0x2fa734[_0x74db('0x47')]=_0x74db('0x48');}else if(_0x582e10[_0x74db('0x41')]===_0x74db('0x15')){logger[_0x74db('0x1c')](_0x74db('0x42'),_0x3110b6,_0x582e10[_0x74db('0x41')]);_0x2fa734[_0x74db('0x28')]=_0x22cbe7!==_0x74db('0x44')?_0x22cbe7:util['format'](_0x74db('0x46'),_0x3110b6);}else{return null;}}return _0x3a2cee[_0x74db('0x33')](_[_0x74db('0x49')](_0x582e10['moduleCreate']))[_0x74db('0x1e')](_0x2fa734)[_0x74db('0x23')](function(_0x3bd953){return BPromise['resolve']({'id':_0x3bd953['id'],'endUserType':_0x582e10[_0x74db('0x41')]});});}});}function getCustomFields(_0x2baa2b,_0x42ead0){var _0x1c4e40={};if(_0x2baa2b[_0x74db('0x24')]>0x0){_[_0x74db('0x4a')](_0x2baa2b,function(_0x2758cd){if(_[_0x74db('0x4b')]([_0x74db('0x4c'),'picklist'],_0x2758cd[_0x74db('0x3d')])&&_0x2758cd[_0x74db('0x4d')]){_0x1c4e40[_0x2758cd[_0x74db('0x4d')]]=_0x2758cd['content'][_0x74db('0x4e')]();}else if(_0x2758cd[_0x74db('0x3d')]===_0x74db('0x4f')&&_0x2758cd[_0x74db('0x50')]&&_0x2758cd[_0x74db('0x4d')]){_0x42ead0[_0x2758cd[_0x74db('0x50')]]&&(_0x1c4e40[_0x2758cd[_0x74db('0x4d')]]=_0x42ead0[_0x2758cd[_0x74db('0x50')]]['toString']());}else if(_0x2758cd['type']===_0x74db('0x51')&&_0x2758cd['Variable']&&_0x2758cd[_0x74db('0x52')][_0x74db('0x53')]&&_0x2758cd[_0x74db('0x4d')]){_0x42ead0[_0x2758cd[_0x74db('0x52')][_0x74db('0x53')]['toLowerCase']()]&&(_0x1c4e40[_0x2758cd[_0x74db('0x4d')]]=_0x42ead0[_0x2758cd[_0x74db('0x52')]['name'][_0x74db('0x3e')]()]['toString']());}});}return _0x1c4e40;}function getConnection(_0x247102){var _0x47a36d=_0x247102[_0x74db('0x54')][_0x74db('0x55')](_0x247102['securityToken']);var _0x52d712=new jsforce['Connection']({'oauth2':{'loginUrl':_0x247102[_0x74db('0x56')]||_0x74db('0x57'),'clientId':_0x247102[_0x74db('0x58')],'clientSecret':_0x247102[_0x74db('0x59')]}});return _0x52d712[_0x74db('0x5a')](_0x247102[_0x74db('0x5b')],_0x47a36d)[_0x74db('0x23')](function(){logger[_0x74db('0x1c')](_0x74db('0x5c'));return _0x52d712;});}exports[_0x74db('0x5d')]=function(_0xbe004,_0x521af,_0x203655,_0x225d5f,_0x2ca1b1,_0x27d141){var _0xa02172,_0x3d586b,_0x24a166,_0x49425b;_0x27d141[_0x74db('0x5e')]=intUtil[_0x74db('0x5f')](_0x27d141[_0x74db('0x5e')]);_0x27d141['remoteUri']=intUtil['stripTrailingSlash'](_0x27d141[_0x74db('0x56')]);if(_0x2ca1b1&&_0x2ca1b1[_0x74db('0x60')]){logger['info']('[QUEUE]',_0x74db('0x61'));_0x521af['recordingURL']=util[_0x74db('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x27d141['serverUrl'],_0x521af[_0x74db('0x62')],md5(_0x521af[_0x74db('0x62')]));}else{_0x521af['recordingURL']='';}return getConnection(_0x27d141)[_0x74db('0x23')](function(_0x1159f7){_0x49425b=_0x1159f7;return getUser(_0x27d141,_0x225d5f['email'],_0x49425b);})['then'](function(_0x2dcf81){_0xa02172=_0x2dcf81;return getEndUser(_0x27d141,_0x203655,_0x521af[_0x74db('0x63')],_0x521af[_0x74db('0x64')],_0x49425b);})[_0x74db('0x23')](function(_0x4e53f6){_0x3d586b=_0x4e53f6;return getTicket(_0x27d141,_0xa02172,_0x3d586b,_0x203655,_0x521af,_0x203655[_0x74db('0x65')],_0x49425b,_0x74db('0x5d'));})[_0x74db('0x23')](function(_0xf3012b){_0x24a166=_0xf3012b;logger[_0x74db('0x1c')](_0x74db('0x66'),_0x24a166['id']);logger['info'](_0x74db('0x67'),_0x24a166['id'],_0x225d5f[_0x74db('0x53')],_0x27d141[_0x74db('0x3d')]);switch(_0x27d141[_0x74db('0x3d')]){case'integrationTab':emit(util['format']('user:%s',_0x225d5f[_0x74db('0x53')]),_0x74db('0x68'),{'recordId':_0x24a166['id']});break;case _0x74db('0x69'):emit(util[_0x74db('0x45')]('user:%s',_0x225d5f[_0x74db('0x53')]),_0x74db('0x6a'),{'uri':util[_0x74db('0x45')](_0x74db('0x6b'),_0x49425b[_0x74db('0x6c')],_0x24a166['id'])});break;default:logger[_0x74db('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x74db('0x6e')](function(_0x18ae61){logger[_0x74db('0x6d')](_0x74db('0x6f'),_0x18ae61);});};exports[_0x74db('0x70')]=function(_0x283fdf,_0x31f59b,_0x154d72,_0x17b8fd,_0x1791f1,_0x5d1f9a,_0x1ca3b6){var _0x1b863c,_0x4ac0e3,_0xada48f,_0x2471d0;_0x5d1f9a[_0x74db('0x5e')]=intUtil[_0x74db('0x5f')](_0x5d1f9a[_0x74db('0x5e')]);_0x5d1f9a[_0x74db('0x56')]=intUtil[_0x74db('0x5f')](_0x5d1f9a['remoteUri']);if(_0x1ca3b6&&_0x1ca3b6[_0x74db('0x71')]&&_0x1ca3b6[_0x74db('0x71')]!==_0x74db('0x72')){logger[_0x74db('0x1c')](_0x74db('0x73'),_0x74db('0x61'));_0x31f59b['recordingURL']=util[_0x74db('0x45')](_0x74db('0x74'),_0x5d1f9a[_0x74db('0x5e')],_0x31f59b[_0x74db('0x62')],md5(_0x31f59b[_0x74db('0x62')]));}return getConnection(_0x5d1f9a)[_0x74db('0x23')](function(_0x403ddc){_0x2471d0=_0x403ddc;return getUser(_0x5d1f9a,_0x17b8fd['email'],_0x2471d0);})['then'](function(_0x180d14){_0x1b863c=_0x180d14;return getEndUser(_0x5d1f9a,_0x154d72,_0x31f59b[_0x74db('0x75')],_0x31f59b['destcalleridnum'],_0x2471d0);})[_0x74db('0x23')](function(_0x5c2a62){_0x4ac0e3=_0x5c2a62;return getTicket(_0x5d1f9a,_0x1b863c,_0x4ac0e3,_0x154d72,_0x31f59b,_0x154d72['Fields'],_0x2471d0,_0x74db('0x70'));})[_0x74db('0x23')](function(_0x200c2e){_0xada48f=_0x200c2e;logger[_0x74db('0x1c')](_0x74db('0x76'),_0xada48f['id']);logger[_0x74db('0x1c')](_0x74db('0x77'),_0xada48f['id'],_0x17b8fd[_0x74db('0x53')],_0x5d1f9a[_0x74db('0x3d')]);switch(_0x5d1f9a[_0x74db('0x3d')]){case _0x74db('0x78'):emit(util[_0x74db('0x45')](_0x74db('0x79'),_0x17b8fd[_0x74db('0x53')]),'trigger:salesforce:display',{'recordId':_0xada48f['id']});break;case'newTab':emit(util[_0x74db('0x45')](_0x74db('0x79'),_0x17b8fd[_0x74db('0x53')]),_0x74db('0x6a'),{'uri':util[_0x74db('0x45')](_0x74db('0x6b'),_0x2471d0[_0x74db('0x6c')],_0xada48f['id'])});break;default:logger[_0x74db('0x6d')](_0x74db('0x73'),_0x74db('0x7a'));}})[_0x74db('0x6e')](function(_0x3e100b){logger[_0x74db('0x6d')](_0x74db('0x73'),_0x3e100b);});};exports[_0x74db('0x7b')]=function(_0x2ffc45,_0x354b90,_0x3ff462,_0x50fd13,_0x3d32b3,_0x2f6085){var _0x2ecaaf,_0x1167b4,_0x1f742d,_0x12cb60;_0x2f6085['serverUrl']=intUtil['stripTrailingSlash'](_0x2f6085[_0x74db('0x5e')]);_0x2f6085['remoteUri']=intUtil['stripTrailingSlash'](_0x2f6085['remoteUri']);if(_0x3d32b3&&_0x3d32b3[_0x74db('0x60')]){logger['info']('['+_0x354b90[_0x74db('0x7c')][_0x74db('0x7d')]()+']',_0x74db('0x61'));_0x354b90[_0x74db('0x7e')]=util[_0x74db('0x45')](_0x74db('0x74'),_0x2f6085['serverUrl'],_0x354b90[_0x74db('0x62')],md5(_0x354b90[_0x74db('0x62')]));}else{_0x354b90[_0x74db('0x7e')]='';}return getConnection(_0x2f6085)[_0x74db('0x23')](function(_0x529a1a){_0x12cb60=_0x529a1a;if(!_[_0x74db('0x1f')](_0x50fd13)){return getUser(_0x2f6085,_0x50fd13[_0x74db('0x53')],_0x12cb60);}else{return getUser(_0x2f6085,null,_0x12cb60);}})[_0x74db('0x23')](function(_0x2b0bb7){_0x2ecaaf=_0x2b0bb7;return getEndUser(_0x2f6085,_0x3ff462,_0x354b90[_0x74db('0x63')],_0x354b90[_0x74db('0x64')],_0x12cb60);})['then'](function(_0xeb0be6){_0x1167b4=_0xeb0be6;return getTicket(_0x2f6085,_0x2ecaaf,_0x1167b4,_0x3ff462,_0x354b90,_0x3ff462[_0x74db('0x65')],_0x12cb60);})[_0x74db('0x23')](function(_0x1e0380){_0x1f742d=_0x1e0380;logger[_0x74db('0x1c')]('['+_0x354b90[_0x74db('0x7c')][_0x74db('0x7d')]()+_0x74db('0x7f'),_0x1f742d['id']);logger[_0x74db('0x1c')]('['+_0x354b90[_0x74db('0x7c')][_0x74db('0x7d')]()+_0x74db('0x80'),_0x2f6085['type']);})['catch'](function(_0x2d48c2){logger['error']('['+_0x354b90[_0x74db('0x7c')][_0x74db('0x7d')]()+']',_0x2d48c2);});};
\ No newline at end of file
+var _0x1bf2=['WhatId','Case','AccountId','leadId','info','isNil','sobject','User','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','cloneDeep','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Lead','first','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','format','Company','No\x20Company','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','name','Variable','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','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','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','jsforce','util','ioredis','./util','defaults','redis','socket.io-emitter','emit','assign','Subjects','getString','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','account'];(function(_0x54f7c0,_0x27af83){var _0x245d03=function(_0x1ad6c4){while(--_0x1ad6c4){_0x54f7c0['push'](_0x54f7c0['shift']());}};_0x245d03(++_0x27af83);}(_0x1bf2,0x165));var _0x21bf=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x1bf2[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x21bf('0x0'));var rp=require(_0x21bf('0x1'));var moment=require(_0x21bf('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x21bf('0x3'));var util=require(_0x21bf('0x4'));var Redis=require(_0x21bf('0x5'));var intUtil=require(_0x21bf('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('salesforce');config['redis']=_[_0x21bf('0x7')](config[_0x21bf('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x21bf('0x9'))(new Redis(config[_0x21bf('0x8')]));function emit(_0x6c402b,_0x4c077c,_0x1408a2){io['to'](_0x6c402b)[_0x21bf('0xa')](_0x4c077c,_0x1408a2);}function getTicket(_0x4fdd89,_0x10cb5b,_0x35f709,_0x18c613,_0x3c0630,_0x3d31b2,_0x3d0bd1,_0x1f1128){var _0x4470d5=Object[_0x21bf('0xb')]({},{'OwnerId':_0x10cb5b['id'],'Subject':intUtil['getString'](_0x18c613[_0x21bf('0xc')],_0x3c0630,'\x20'),'Description':intUtil[_0x21bf('0xd')](_0x18c613['Descriptions'],_0x3c0630,'\x0a')},getCustomFields(_0x3d31b2,_0x3c0630));if(_0x35f709){if(_0x18c613[_0x21bf('0xe')]===_0x21bf('0xf')){_0x4470d5[_0x21bf('0x10')]=moment[_0x21bf('0x11')]();_0x4470d5[_0x21bf('0x12')]=![];_0x4470d5[_0x21bf('0x13')]=![];if(_0x35f709[_0x21bf('0x14')]===_0x21bf('0x15')||_0x35f709[_0x21bf('0x14')]===_0x21bf('0x16')){_0x4470d5['WhoId']=_0x35f709['id'];}else if(_0x35f709[_0x21bf('0x14')]===_0x21bf('0x17')){_0x4470d5[_0x21bf('0x18')]=_0x35f709['id'];}}else if(_0x18c613[_0x21bf('0xe')]===_0x21bf('0x19')){if(_0x35f709['endUserType']==='contact'){_0x4470d5['ContactId']=_0x35f709['id'];}else if(_0x35f709[_0x21bf('0x14')]===_0x21bf('0x17')){_0x4470d5[_0x21bf('0x1a')]=_0x35f709['id'];}else if(_0x35f709[_0x21bf('0x14')]==='lead'&&_0x18c613[_0x21bf('0x1b')]){_0x4470d5[_0x18c613['leadId']]=_0x35f709['id'];}else{logger[_0x21bf('0x1c')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x3d0bd1['sobject'](_0x18c613['ticketType'])['create'](_0x4470d5);}function getUser(_0x51163a,_0x2e633d,_0x4e8743){if(!_[_0x21bf('0x1d')](_0x2e633d)&&intUtil['validateEmail'](_0x2e633d)){var _0x15443a={'Email':_0x2e633d};var _0xa18de3={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4e8743[_0x21bf('0x1e')](_0x21bf('0x1f'))[_0x21bf('0x20')](_0x15443a,_0xa18de3)[_0x21bf('0x21')]()[_0x21bf('0x22')](function(_0x53803f){if(_0x53803f[_0x21bf('0x23')]){var _0x29b51f=_['find'](_0x53803f,function(_0x31dbe1){return _0x31dbe1['Email']===_0x2e633d;});if(_0x29b51f){logger[_0x21bf('0x1c')](_0x21bf('0x24'),_0x2e633d);return BPromise[_0x21bf('0x25')]({'id':_0x29b51f['Id'],'name':_0x29b51f[_0x21bf('0x26')]});}}else{logger[_0x21bf('0x1c')](_0x21bf('0x27'),_0x2e633d);return _0x4e8743[_0x21bf('0x28')]()['then'](function(_0x4a5c02){return BPromise[_0x21bf('0x25')]({'id':_0x4a5c02[_0x21bf('0x29')],'name':_0x4a5c02['display_name']});});}});}else{logger[_0x21bf('0x1c')](_0x21bf('0x27'),_0x2e633d);return _0x4e8743['identity']()[_0x21bf('0x22')](function(_0x300f1e){return BPromise[_0x21bf('0x25')]({'id':_0x300f1e[_0x21bf('0x29')],'name':_0x300f1e[_0x21bf('0x2a')]});});}}function getEndUser(_0x2bc426,_0x204ed5,_0x1d0695,_0x36a1c0,_0x3348c6){var _0x2d136c={'$or':{'Phone':_0x36a1c0}};var _0x7af720={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x21bf('0x25')]()['then'](function(){logger['info'](_0x21bf('0x2b'),_0x36a1c0,_0x204ed5[_0x21bf('0x2c')]);switch(_0x204ed5[_0x21bf('0x2c')]){case _0x21bf('0x2d'):var _0x5ef792=_['cloneDeep'](_0x2d136c);if(_0x204ed5[_0x21bf('0x2e')]){var _0x253f61={};_0x253f61[_0x204ed5[_0x21bf('0x2e')]]=_0x36a1c0;_[_0x21bf('0x2f')](_0x5ef792[_0x21bf('0x30')],_0x253f61);}return _0x3348c6[_0x21bf('0x1e')](_0x21bf('0x31'))[_0x21bf('0x20')](_0x5ef792,_0x7af720)[_0x21bf('0x21')]()[_0x21bf('0x22')](function(_0x58aa30){if(_0x58aa30&&_0x58aa30['length']){return _0x58aa30;}else{var _0x4b1ee6=_[_0x21bf('0x32')](_0x2d136c);if(_0x204ed5[_0x21bf('0x33')]){var _0x5526ac={};_0x5526ac[_0x204ed5[_0x21bf('0x33')]]=_0x36a1c0;_['merge'](_0x4b1ee6['$or'],_0x5526ac);}return _0x3348c6[_0x21bf('0x1e')]('Lead')['find'](_0x4b1ee6,_0x7af720);}});case _0x21bf('0x34'):var _0x5b0cea=_['cloneDeep'](_0x2d136c);if(_0x204ed5[_0x21bf('0x35')]){var _0x253f61={};_0x253f61[_0x204ed5['additionalSearchAccount']]=_0x36a1c0;_[_0x21bf('0x2f')](_0x5b0cea[_0x21bf('0x30')],_0x253f61);}return _0x3348c6[_0x21bf('0x1e')](_0x21bf('0x36'))[_0x21bf('0x20')](_0x5b0cea,_0x7af720)[_0x21bf('0x21')]()[_0x21bf('0x22')](function(_0x18d383){if(_0x18d383&&_0x18d383[_0x21bf('0x23')]){return _0x18d383;}else{var _0x8eb56=_[_0x21bf('0x32')](_0x2d136c);if(_0x204ed5[_0x21bf('0x2e')]){var _0x3262c8={};_0x3262c8[_0x204ed5['additionalSearchContact']]=_0x36a1c0;_[_0x21bf('0x2f')](_0x8eb56[_0x21bf('0x30')],_0x3262c8);}return _0x3348c6['sobject'](_0x21bf('0x31'))['find'](_0x8eb56,_0x7af720)['then'](function(_0x34bcf5){if(_0x34bcf5&&_0x34bcf5[_0x21bf('0x23')]){return _0x34bcf5;}else{var _0x56067f=_[_0x21bf('0x32')](_0x2d136c);if(_0x204ed5[_0x21bf('0x33')]){var _0x78950e={};_0x78950e[_0x204ed5[_0x21bf('0x33')]]=_0x36a1c0;_[_0x21bf('0x2f')](_0x56067f[_0x21bf('0x30')],_0x78950e);}return _0x3348c6[_0x21bf('0x1e')](_0x21bf('0x37'))[_0x21bf('0x20')](_0x56067f,_0x7af720);}});}});case _0x21bf('0x15'):var _0x5ef792=_[_0x21bf('0x32')](_0x2d136c);if(_0x204ed5[_0x21bf('0x2e')]){var _0x253f61={};_0x253f61[_0x204ed5['additionalSearchContact']]=_0x36a1c0;_['merge'](_0x5ef792[_0x21bf('0x30')],_0x253f61);}return _0x3348c6[_0x21bf('0x1e')](_0x21bf('0x31'))[_0x21bf('0x20')](_0x5ef792,_0x7af720)[_0x21bf('0x21')]();case _0x21bf('0x16'):var _0xc9a68f=_[_0x21bf('0x32')](_0x2d136c);if(_0x204ed5[_0x21bf('0x33')]){var _0x253f61={};_0x253f61[_0x204ed5[_0x21bf('0x33')]]=_0x36a1c0;_[_0x21bf('0x2f')](_0xc9a68f[_0x21bf('0x30')],_0x253f61);}return _0x3348c6[_0x21bf('0x1e')](_0x21bf('0x37'))['find'](_0xc9a68f,_0x7af720);case _0x21bf('0x17'):var _0x5b0cea=_[_0x21bf('0x32')](_0x2d136c);if(_0x204ed5[_0x21bf('0x35')]){var _0x253f61={};_0x253f61[_0x204ed5[_0x21bf('0x35')]]=_0x36a1c0;_[_0x21bf('0x2f')](_0x5b0cea[_0x21bf('0x30')],_0x253f61);}return _0x3348c6[_0x21bf('0x1e')](_0x21bf('0x36'))[_0x21bf('0x20')](_0x5b0cea,_0x7af720);default:return null;}})[_0x21bf('0x22')](function(_0x441499){if(_0x441499&&_0x441499['length']){var _0x5c6d10=_[_0x21bf('0x38')](_0x441499);if(_0x5c6d10){return BPromise[_0x21bf('0x25')]({'id':_0x5c6d10['Id'],'name':_0x5c6d10[_0x21bf('0x26')],'phone':_0x5c6d10[_0x21bf('0x39')],'endUserType':_0x5c6d10[_0x21bf('0x3a')]['type'][_0x21bf('0x3b')]()});}}})[_0x21bf('0x22')](function(_0x2c0bc5){if(_0x2c0bc5){logger[_0x21bf('0x1c')](_0x21bf('0x3c'),_0x2c0bc5[_0x21bf('0x14')],_0x36a1c0);return BPromise[_0x21bf('0x25')](_0x2c0bc5);}else{logger[_0x21bf('0x1c')](_0x21bf('0x3d'),_0x36a1c0);var _0x21a761={'Phone':_0x36a1c0};if(_0x204ed5[_0x21bf('0x3e')]){if(_0x204ed5[_0x21bf('0x3e')]===_0x21bf('0x15')){logger[_0x21bf('0x1c')](_0x21bf('0x3f'),_0x36a1c0,_0x204ed5[_0x21bf('0x3e')]);_0x21a761[_0x21bf('0x40')]=_0x1d0695!==_0x21bf('0x41')?_0x1d0695:util[_0x21bf('0x42')]('Caller\x20-\x20%s',_0x36a1c0);}else if(_0x204ed5[_0x21bf('0x3e')]===_0x21bf('0x16')){logger[_0x21bf('0x1c')](_0x21bf('0x3f'),_0x36a1c0,_0x204ed5[_0x21bf('0x3e')]);_0x21a761[_0x21bf('0x40')]=_0x1d0695!==_0x21bf('0x41')?_0x1d0695:util[_0x21bf('0x42')]('Caller\x20-\x20%s',_0x36a1c0);_0x21a761[_0x21bf('0x43')]=_0x21bf('0x44');}else if(_0x204ed5[_0x21bf('0x3e')]===_0x21bf('0x17')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x36a1c0,_0x204ed5[_0x21bf('0x3e')]);_0x21a761['Name']=_0x1d0695!=='<unknown>'?_0x1d0695:util[_0x21bf('0x42')]('Caller\x20-\x20%s',_0x36a1c0);}else{return null;}}return _0x3348c6[_0x21bf('0x1e')](_['upperFirst'](_0x204ed5[_0x21bf('0x3e')]))['create'](_0x21a761)[_0x21bf('0x22')](function(_0x53f282){return BPromise[_0x21bf('0x25')]({'id':_0x53f282['id'],'endUserType':_0x204ed5['moduleCreate']});});}});}function getCustomFields(_0x5ef126,_0x36ac33){var _0x5db2b0={};if(_0x5ef126[_0x21bf('0x23')]>0x0){_[_0x21bf('0x45')](_0x5ef126,function(_0x406454){if(_[_0x21bf('0x46')]([_0x21bf('0x47'),_0x21bf('0x48')],_0x406454[_0x21bf('0x49')])&&_0x406454[_0x21bf('0x4a')]){_0x5db2b0[_0x406454[_0x21bf('0x4a')]]=_0x406454[_0x21bf('0x4b')][_0x21bf('0x4c')]();}else if(_0x406454['type']===_0x21bf('0x4d')&&_0x406454['variableName']&&_0x406454['idField']){_0x36ac33[_0x406454[_0x21bf('0x4e')]]&&(_0x5db2b0[_0x406454[_0x21bf('0x4a')]]=_0x36ac33[_0x406454['variableName']][_0x21bf('0x4c')]());}else if(_0x406454[_0x21bf('0x49')]===_0x21bf('0x4f')&&_0x406454['Variable']&&_0x406454['Variable'][_0x21bf('0x50')]&&_0x406454[_0x21bf('0x4a')]){_0x36ac33[_0x406454[_0x21bf('0x51')]['name']['toLowerCase']()]&&(_0x5db2b0[_0x406454[_0x21bf('0x4a')]]=_0x36ac33[_0x406454[_0x21bf('0x51')][_0x21bf('0x50')]['toLowerCase']()][_0x21bf('0x4c')]());}});}return _0x5db2b0;}function getConnection(_0x254aca){var _0x141d22=_0x254aca[_0x21bf('0x52')][_0x21bf('0x53')](_0x254aca[_0x21bf('0x54')]);var _0x80bb46=new jsforce['Connection']({'oauth2':{'loginUrl':_0x254aca[_0x21bf('0x55')]||_0x21bf('0x56'),'clientId':_0x254aca['clientId'],'clientSecret':_0x254aca[_0x21bf('0x57')]}});return _0x80bb46[_0x21bf('0x58')](_0x254aca[_0x21bf('0x59')],_0x141d22)[_0x21bf('0x22')](function(){logger['info'](_0x21bf('0x5a'));return _0x80bb46;});}exports[_0x21bf('0x5b')]=function(_0x292479,_0x3a1e04,_0x35a780,_0x11f084,_0x91e8d4,_0xcbce89){var _0x1053da,_0x378cbe,_0x5901ed,_0xb8ad09;_0xcbce89['serverUrl']=intUtil[_0x21bf('0x5c')](_0xcbce89[_0x21bf('0x5d')]);_0xcbce89[_0x21bf('0x55')]=intUtil[_0x21bf('0x5c')](_0xcbce89['remoteUri']);if(_0x91e8d4&&_0x91e8d4[_0x21bf('0x5e')]){logger[_0x21bf('0x1c')](_0x21bf('0x5f'),'Recording\x20is\x20enabled!');_0x3a1e04[_0x21bf('0x60')]=util['format'](_0x21bf('0x61'),_0xcbce89[_0x21bf('0x5d')],_0x3a1e04['uniqueid'],md5(_0x3a1e04[_0x21bf('0x62')]));}else{_0x3a1e04[_0x21bf('0x60')]='';}return getConnection(_0xcbce89)['then'](function(_0x331c44){_0xb8ad09=_0x331c44;return getUser(_0xcbce89,_0x11f084[_0x21bf('0x63')],_0xb8ad09);})[_0x21bf('0x22')](function(_0x1dbacd){_0x1053da=_0x1dbacd;return getEndUser(_0xcbce89,_0x35a780,_0x3a1e04['calleridname'],_0x3a1e04[_0x21bf('0x64')],_0xb8ad09);})[_0x21bf('0x22')](function(_0x4b57df){_0x378cbe=_0x4b57df;return getTicket(_0xcbce89,_0x1053da,_0x378cbe,_0x35a780,_0x3a1e04,_0x35a780['Fields'],_0xb8ad09,'queue');})[_0x21bf('0x22')](function(_0x4994ba){_0x5901ed=_0x4994ba;logger[_0x21bf('0x1c')](_0x21bf('0x65'),_0x5901ed['id']);logger[_0x21bf('0x1c')](_0x21bf('0x66'),_0x5901ed['id'],_0x11f084[_0x21bf('0x50')],_0xcbce89['type']);switch(_0xcbce89[_0x21bf('0x49')]){case _0x21bf('0x67'):emit(util['format'](_0x21bf('0x68'),_0x11f084[_0x21bf('0x50')]),_0x21bf('0x69'),{'recordId':_0x5901ed['id']});break;case _0x21bf('0x6a'):emit(util[_0x21bf('0x42')]('user:%s',_0x11f084['name']),'trigger:browser:url',{'uri':util[_0x21bf('0x42')](_0x21bf('0x6b'),_0xb8ad09[_0x21bf('0x6c')],_0x5901ed['id'])});break;default:logger[_0x21bf('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x21bf('0x6e')](function(_0x844f9b){logger[_0x21bf('0x6d')](_0x21bf('0x5f'),_0x844f9b);});};exports[_0x21bf('0x6f')]=function(_0x4e7904,_0x867102,_0x4c9a44,_0x31ceef,_0x7f2d27,_0xf8800a,_0x23d021){var _0x1c805f,_0x49906f,_0xecb78e,_0x2bf0ab;_0xf8800a[_0x21bf('0x5d')]=intUtil[_0x21bf('0x5c')](_0xf8800a['serverUrl']);_0xf8800a[_0x21bf('0x55')]=intUtil[_0x21bf('0x5c')](_0xf8800a[_0x21bf('0x55')]);if(_0x23d021&&_0x23d021[_0x21bf('0x70')]&&_0x23d021[_0x21bf('0x70')]!==_0x21bf('0x71')){logger[_0x21bf('0x1c')](_0x21bf('0x72'),_0x21bf('0x73'));_0x867102['recordingURL']=util['format'](_0x21bf('0x61'),_0xf8800a[_0x21bf('0x5d')],_0x867102[_0x21bf('0x62')],md5(_0x867102[_0x21bf('0x62')]));}return getConnection(_0xf8800a)[_0x21bf('0x22')](function(_0x9ecf2e){_0x2bf0ab=_0x9ecf2e;return getUser(_0xf8800a,_0x31ceef['email'],_0x2bf0ab);})[_0x21bf('0x22')](function(_0xc48dcf){_0x1c805f=_0xc48dcf;return getEndUser(_0xf8800a,_0x4c9a44,_0x867102[_0x21bf('0x74')],_0x867102[_0x21bf('0x75')],_0x2bf0ab);})[_0x21bf('0x22')](function(_0x52ba0e){_0x49906f=_0x52ba0e;return getTicket(_0xf8800a,_0x1c805f,_0x49906f,_0x4c9a44,_0x867102,_0x4c9a44[_0x21bf('0x76')],_0x2bf0ab,_0x21bf('0x6f'));})['then'](function(_0x36743f){_0xecb78e=_0x36743f;logger[_0x21bf('0x1c')](_0x21bf('0x77'),_0xecb78e['id']);logger[_0x21bf('0x1c')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0xecb78e['id'],_0x31ceef[_0x21bf('0x50')],_0xf8800a[_0x21bf('0x49')]);switch(_0xf8800a[_0x21bf('0x49')]){case _0x21bf('0x67'):emit(util[_0x21bf('0x42')](_0x21bf('0x68'),_0x31ceef[_0x21bf('0x50')]),_0x21bf('0x69'),{'recordId':_0xecb78e['id']});break;case _0x21bf('0x6a'):emit(util[_0x21bf('0x42')](_0x21bf('0x68'),_0x31ceef[_0x21bf('0x50')]),_0x21bf('0x78'),{'uri':util[_0x21bf('0x42')](_0x21bf('0x6b'),_0x2bf0ab['instanceUrl'],_0xecb78e['id'])});break;default:logger['error']('[OUTBOUND]',_0x21bf('0x79'));}})[_0x21bf('0x6e')](function(_0x3e0709){logger[_0x21bf('0x6d')](_0x21bf('0x72'),_0x3e0709);});};exports[_0x21bf('0x7a')]=function(_0x14c06c,_0x193de7,_0x586e97,_0x1091f6,_0x135037,_0x143da6){var _0x4a261f,_0x22c3d6,_0x4e19e2,_0x3d7456;_0x143da6[_0x21bf('0x5d')]=intUtil[_0x21bf('0x5c')](_0x143da6[_0x21bf('0x5d')]);_0x143da6[_0x21bf('0x55')]=intUtil[_0x21bf('0x5c')](_0x143da6[_0x21bf('0x55')]);if(_0x135037&&_0x135037['monitor_format']){logger[_0x21bf('0x1c')]('['+_0x193de7['lastevent'][_0x21bf('0x7b')]()+']',_0x21bf('0x73'));_0x193de7[_0x21bf('0x60')]=util[_0x21bf('0x42')](_0x21bf('0x61'),_0x143da6[_0x21bf('0x5d')],_0x193de7[_0x21bf('0x62')],md5(_0x193de7[_0x21bf('0x62')]));}else{_0x193de7[_0x21bf('0x60')]='';}return getConnection(_0x143da6)['then'](function(_0x57acd0){_0x3d7456=_0x57acd0;if(!_[_0x21bf('0x1d')](_0x1091f6)){return getUser(_0x143da6,_0x1091f6[_0x21bf('0x50')],_0x3d7456);}else{return getUser(_0x143da6,null,_0x3d7456);}})[_0x21bf('0x22')](function(_0x4e8f08){_0x4a261f=_0x4e8f08;return getEndUser(_0x143da6,_0x586e97,_0x193de7[_0x21bf('0x7c')],_0x193de7[_0x21bf('0x64')],_0x3d7456);})[_0x21bf('0x22')](function(_0x461964){_0x22c3d6=_0x461964;return getTicket(_0x143da6,_0x4a261f,_0x22c3d6,_0x586e97,_0x193de7,_0x586e97[_0x21bf('0x76')],_0x3d7456);})[_0x21bf('0x22')](function(_0x2fda73){_0x4e19e2=_0x2fda73;logger[_0x21bf('0x1c')]('['+_0x193de7['lastevent']['toUpperCase']()+_0x21bf('0x7d'),_0x4e19e2['id']);logger[_0x21bf('0x1c')]('['+_0x193de7['lastevent'][_0x21bf('0x7b')]()+_0x21bf('0x7e'),_0x143da6[_0x21bf('0x49')]);})['catch'](function(_0x5375db){logger[_0x21bf('0x6d')]('['+_0x193de7['lastevent'][_0x21bf('0x7b')]()+']',_0x5375db);});};
\ No newline at end of file
index 0d7e0be..0231954 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3c1=['sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','userId','adminId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20getEndUser\x20input\x20crm','GET','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','toString','variable','variableName','customVariable','Variable','name','outbound','assign','true','getString','Subjects','Descriptions','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','incident','Incident','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','inspect','lodash','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail'];(function(_0x55518a,_0x15c3bc){var _0x2afeee=function(_0x24a30e){while(--_0x24a30e){_0x55518a['push'](_0x55518a['shift']());}};_0x2afeee(++_0x15c3bc);}(_0xa3c1,0x12a));var _0x1a3c=function(_0x3cca3a,_0x256a78){_0x3cca3a=_0x3cca3a-0x0;var _0xcbd284=_0xa3c1[_0x3cca3a];return _0xcbd284;};'use strict';var _=require(_0x1a3c('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0x1a3c('0x1'));var md5=require(_0x1a3c('0x2'));var Redis=require(_0x1a3c('0x3'));var intUtil=require(_0x1a3c('0x4'));var config=require(_0x1a3c('0x5'));var logger=require(_0x1a3c('0x6'))(_0x1a3c('0x7'));config[_0x1a3c('0x8')]=_['defaults'](config['redis'],{'host':_0x1a3c('0x9'),'port':0x18eb});var io=require(_0x1a3c('0xa'))(new Redis(config['redis']));function getAdminUser(_0x36f01f,_0x21f927,_0x3ea357,_0x33435d,_0x1726ec,_0x3a05e3){return new Promise(function(_0x3be96e,_0x38c1e3){var _0x319fa9={'method':'GET','uri':_0x33435d+_0x1a3c('0xb')+'&'+_0x1726ec+'&'+_0x3a05e3,'auth':_0x21f927,'json':!![]};return rp(_0x319fa9)['then'](function(_0x380be1){if(_0x380be1[_0x1a3c('0xc')][_0x1a3c('0xd')]>0x0){_0x3ea357['adminId']=_0x380be1['result'][0x0][_0x1a3c('0xe')];}logger[_0x1a3c('0xf')]('['+[_0x36f01f[_0x1a3c('0x10')]()]+_0x1a3c('0x11'),_0x3ea357);_0x3be96e(_0x3ea357);})[_0x1a3c('0x12')](function(_0x14a089){logger[_0x1a3c('0x13')]('['+[_0x36f01f[_0x1a3c('0x10')]()]+']',_0x14a089[_0x1a3c('0x14')]);_0x38c1e3(_0x14a089['message']);});});}function getUser(_0x1d9b12,_0xae5bab,_0x49abf6,_0x36ce09,_0x2ce397){return function(_0x176006){logger[_0x1a3c('0xf')]('['+[_0x1d9b12[_0x1a3c('0x10')]()]+'],\x20getUser\x20input\x20crm',_0x176006);return new Promise(function(_0x4d0750,_0x1632b3){if(intUtil[_0x1a3c('0x15')](_0x176006[_0x1a3c('0x16')])){var _0x59d1d8={'method':'GET','uri':_0x49abf6+_0x1a3c('0x17')+_0x176006[_0x1a3c('0x16')]+'&'+_0x36ce09+'&'+_0x2ce397,'auth':_0xae5bab,'json':!![]};logger[_0x1a3c('0xf')]('['+[_0x1d9b12[_0x1a3c('0x10')]()]+_0x1a3c('0x18'),_0x59d1d8);return rp(_0x59d1d8)[_0x1a3c('0x19')](function(_0x366a55){logger[_0x1a3c('0xf')]('['+[_0x1d9b12[_0x1a3c('0x10')]()]+_0x1a3c('0x1a'),_0x366a55);if(_0x366a55[_0x1a3c('0xc')]['length']>0x0&&String(_0x366a55[_0x1a3c('0xc')][0x0][_0x1a3c('0x1b')])==='true'){_0x176006[_0x1a3c('0x1c')]=_0x366a55[_0x1a3c('0xc')][0x0][_0x1a3c('0xe')];}else{_0x176006[_0x1a3c('0x1c')]=_0x176006[_0x1a3c('0x1d')];_0x176006['userEmail']=_0x176006['adminEmail'];}logger[_0x1a3c('0xf')]('['+[_0x1d9b12[_0x1a3c('0x10')]()]+'],\x20getUser\x20crm',_0x176006);_0x4d0750(_0x176006);})[_0x1a3c('0x12')](function(_0x1d78d4){logger[_0x1a3c('0x13')]('['+[_0x1d9b12[_0x1a3c('0x10')]()]+']',_0x1d78d4[_0x1a3c('0x14')]);_0x1632b3(_0x1d78d4[_0x1a3c('0x14')]);});}else{logger[_0x1a3c('0xf')]('['+[_0x1d9b12['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x176006['userId']=_0x176006[_0x1a3c('0x1d')];_0x176006['userEmail']=_0x176006[_0x1a3c('0x1e')];_0x4d0750(_0x176006);}});};}function createEndUser(_0x19f2ba,_0x15aa8c,_0x3c168d,_0x10facb,_0x55148e){logger[_0x1a3c('0xf')]('['+[_0x19f2ba['toUpperCase']()]+_0x1a3c('0x1f'),_0x3c168d);return new Promise(function(_0x4fecc4,_0x27afff){var _0x369ce8={'method':_0x1a3c('0x20'),'uri':_0x10facb+_0x1a3c('0x21')+_0x55148e,'body':{'user_name':_0x3c168d[_0x1a3c('0x22')],'roles':_0x1a3c('0x23'),'first_name':_0x3c168d[_0x1a3c('0x22')],'active':'true','date_format':_0x1a3c('0x24'),'phone':_0x3c168d['endUserNumber']},'auth':_0x15aa8c,'json':!![]};return rp(_0x369ce8)[_0x1a3c('0x19')](function(_0x25e237){logger[_0x1a3c('0xf')]('['+[_0x19f2ba[_0x1a3c('0x10')]()]+'],\x20EndUser\x20schema',_0x25e237[_0x1a3c('0xc')]);_0x3c168d['endUserId']=_0x25e237[_0x1a3c('0xc')][_0x1a3c('0xe')];_0x4fecc4(_0x3c168d);})[_0x1a3c('0x12')](function(_0x151c2a){logger[_0x1a3c('0x13')]('['+[_0x19f2ba[_0x1a3c('0x10')]()]+']',_0x151c2a[_0x1a3c('0x14')]);_0x27afff(_0x151c2a[_0x1a3c('0x14')]);});});}function getEndUser(_0x1abb98,_0x152e74,_0x5ce545,_0x367c34,_0x12a482){return function(_0x241eeb){logger[_0x1a3c('0xf')]('['+[_0x1abb98[_0x1a3c('0x10')]()]+_0x1a3c('0x25'),_0x241eeb);return new Promise(function(_0x10ce95,_0x323b65){var _0x176768={'method':_0x1a3c('0x26'),'uri':_0x5ce545+_0x1a3c('0x27')+_0x241eeb[_0x1a3c('0x22')]+'&'+_0x367c34+'&'+_0x12a482,'auth':_0x152e74,'json':!![]};return rp(_0x176768)[_0x1a3c('0x19')](function(_0x1a9508){if(_0x1a9508[_0x1a3c('0xc')][_0x1a3c('0xd')]>0x0){_0x241eeb[_0x1a3c('0x28')]=_0x1a9508['result'][0x0]['sys_id'];logger[_0x1a3c('0xf')]('['+[_0x1abb98[_0x1a3c('0x10')]()]+_0x1a3c('0x29'),_0x241eeb);_0x10ce95(_0x241eeb);}else{return createEndUser(_0x1abb98,_0x152e74,_0x241eeb,_0x5ce545,_0x367c34)[_0x1a3c('0x19')](function(_0x3cacd2){logger[_0x1a3c('0xf')]('['+[_0x1abb98['toUpperCase']()]+_0x1a3c('0x2a'),_0x3cacd2);_0x10ce95(_0x3cacd2);});}})['catch'](function(_0x118b31){logger[_0x1a3c('0x13')]('['+[_0x1abb98[_0x1a3c('0x10')]()]+']',_0x118b31['message']);_0x323b65(_0x118b31[_0x1a3c('0x14')]);});});};}function getCustomFields(_0x1aeec4,_0x51a611){var _0xe0da3f={};if(_0x1aeec4[_0x1a3c('0xd')]>0x0){_[_0x1a3c('0x2b')](_0x1aeec4,function(_0x3d4411){if(_[_0x1a3c('0x2c')]([_0x1a3c('0x2d'),_0x1a3c('0x2e')],_0x3d4411[_0x1a3c('0x2f')])&&_0x3d4411['nameField']&&!_0x3d4411[_0x1a3c('0x30')]){_0xe0da3f[_0x3d4411[_0x1a3c('0x31')][_0x1a3c('0x32')]()]=_0x3d4411[_0x1a3c('0x33')]['toString']();}else if(_['includes']([_0x1a3c('0x2d'),_0x1a3c('0x2e')],_0x3d4411[_0x1a3c('0x2f')])&&_0x3d4411[_0x1a3c('0x34')]&&_0x3d4411[_0x1a3c('0x30')]){_0xe0da3f[_0x3d4411[_0x1a3c('0x34')][_0x1a3c('0x32')]()]=_0x3d4411[_0x1a3c('0x33')][_0x1a3c('0x35')]();}else if(_0x3d4411['type']===_0x1a3c('0x36')&&_0x3d4411[_0x1a3c('0x37')]&&_0x3d4411[_0x1a3c('0x34')]&&_0x3d4411[_0x1a3c('0x30')]){_0xe0da3f[_0x3d4411[_0x1a3c('0x34')][_0x1a3c('0x32')]()]=_0x51a611[_0x3d4411[_0x1a3c('0x37')]][_0x1a3c('0x35')]();}else if(_0x3d4411[_0x1a3c('0x2f')]===_0x1a3c('0x38')&&_0x3d4411[_0x1a3c('0x39')]&&_0x3d4411[_0x1a3c('0x39')][_0x1a3c('0x3a')]&&_0x3d4411[_0x1a3c('0x34')]&&_0x3d4411[_0x1a3c('0x30')]){_0xe0da3f[_0x3d4411['idField']['toLowerCase']()]=_0x51a611[_0x3d4411[_0x1a3c('0x39')][_0x1a3c('0x3a')][_0x1a3c('0x32')]()][_0x1a3c('0x35')]();}});}return _0xe0da3f;}function getTicket(_0x21d514,_0x2d8c2c,_0x57e8ce,_0x725dfb,_0x484449,_0x356ef3){return function(_0x58fe52){logger[_0x1a3c('0xf')]('['+[_0x21d514[_0x1a3c('0x10')]()]+']\x20getTicket\x20input\x20crm',_0x58fe52);return new Promise(function(_0x1c6bdb,_0x1d8a64){var _0x15a50b=_0x21d514['toLowerCase']()===_0x1a3c('0x3b')?_0x58fe52['userId']:_0x58fe52[_0x1a3c('0x28')];var _0x1ba253={'method':_0x1a3c('0x20'),'uri':_0x57e8ce+'incident'+'?'+_0x356ef3,'body':Object[_0x1a3c('0x3c')]({},{'active':_0x1a3c('0x3d'),'caller_id':_0x15a50b,'assigned_to':_0x58fe52['userId'],'short_description':intUtil[_0x1a3c('0x3e')](_0x725dfb[_0x1a3c('0x3f')],_0x484449,'\x20'),'description':intUtil['getString'](_0x725dfb[_0x1a3c('0x40')],_0x484449,'\x0a')},getCustomFields(_0x725dfb['Fields'],_0x484449)),'auth':_0x2d8c2c,'json':!![]};return rp(_0x1ba253)['then'](function(_0x3ca0ee){logger[_0x1a3c('0xf')]('['+[_0x21d514['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x3ca0ee['result']);_0x58fe52[_0x1a3c('0x41')]=_0x3ca0ee[_0x1a3c('0xc')]['sys_id'];_0x58fe52[_0x1a3c('0x42')]=_0x3ca0ee['result'][_0x1a3c('0x43')];logger[_0x1a3c('0xf')]('['+[_0x21d514[_0x1a3c('0x10')]()]+_0x1a3c('0x44'),_0x58fe52);_0x1c6bdb(_0x58fe52);})[_0x1a3c('0x12')](function(_0x301158){logger[_0x1a3c('0x13')]('['+[_0x21d514['toUpperCase']()]+']',_0x301158[_0x1a3c('0x14')]);_0x1d8a64(_0x301158[_0x1a3c('0x14')]);});});};}function createRemoteTag(_0x4eb78a,_0x39d597,_0x1a4351,_0x3d57aa){return new Promise(function(_0x35b8e6,_0x284e9d){var _0x5eb0f4={'method':_0x1a3c('0x20'),'uri':_0x1a4351+_0x1a3c('0x45')+'?'+_0x3d57aa,'body':{'short_description':_0x4eb78a,'global':!![],'active':!![],'name':_0x4eb78a},'auth':_0x39d597,'json':!![]};return rp(_0x5eb0f4)['then'](function(_0x20e74a){var _0x34501c=_0x20e74a['result'][_0x1a3c('0xe')];_0x35b8e6(_0x34501c);});});}function getRemoteTag(_0x12b0fd,_0x25e77d,_0x10d146,_0x5d2305,_0x813145){return new Promise(function(_0x48fabb,_0x48fe69){var _0x173dd0={'method':_0x1a3c('0x26'),'uri':_0x10d146+_0x1a3c('0x45')+_0x1a3c('0x46')+_0x12b0fd+'&'+_0x5d2305,'auth':_0x25e77d,'json':!![]};return rp(_0x173dd0)[_0x1a3c('0x19')](function(_0x15aafd){if(_0x15aafd[_0x1a3c('0xc')][_0x1a3c('0xd')]>0x0){var _0x395a60=_0x15aafd[_0x1a3c('0xc')][0x0][_0x1a3c('0xe')];_0x48fabb(_0x395a60);}else{return createRemoteTag(_0x12b0fd,_0x25e77d,_0x10d146,_0x5d2305)[_0x1a3c('0x19')](function(_0x20dbe2){_0x48fabb(_0x20dbe2);});}});});}function assignTagToIncident(_0x2aef1d,_0x1ae60b,_0x2c8403,_0x4be3e0,_0x39fe60){return new Promise(function(_0x1bfb2b,_0xa646d2){var _0x2923b1={'method':_0x1a3c('0x20'),'uri':_0x2c8403+'label_entry'+'?'+_0x39fe60,'body':{'label':_0x2aef1d,'table':_0x1a3c('0x47'),'id_type':_0x1a3c('0x48'),'table_key':_0x4be3e0['ticketId'],'title':'Incident\x20-\x20'+_0x4be3e0[_0x1a3c('0x42')],'id_display':_0x4be3e0[_0x1a3c('0x42')]},'auth':_0x1ae60b,'json':!![]};return rp(_0x2923b1)['then'](function(_0xf02819){_0x1bfb2b();})[_0x1a3c('0x12')](function(){_0x1bfb2b();});});}function manageTags(_0x1618a5,_0x14120d,_0x435b4c,_0x49f8ad,_0xc21c16,_0x15866d,_0x235d3c){return new Promise(function(_0x20c7bf,_0x2eb4d4){var _0x4b3d6b=[];_0x14120d[_0x1a3c('0x2b')](function(_0x5067a3){_0x4b3d6b[_0x1a3c('0x49')](getRemoteTag(_0x5067a3,_0x435b4c,_0x49f8ad,_0x15866d,_0x235d3c));});return Promise[_0x1a3c('0x4a')](_0x4b3d6b)[_0x1a3c('0x19')](function(_0x3defb7){if(_0x3defb7[_0x1a3c('0xd')]){logger['info']('['+[_0x1618a5[_0x1a3c('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x3defb7);var _0x3eaae5=[];_0x3defb7['forEach'](function(_0x4371ab){_0x3eaae5[_0x1a3c('0x49')](assignTagToIncident(_0x4371ab,_0x435b4c,_0x49f8ad,_0xc21c16,_0x15866d));});return Promise[_0x1a3c('0x4a')](_0x3eaae5)[_0x1a3c('0x19')](function(){_0x20c7bf();})[_0x1a3c('0x12')](function(){_0x20c7bf();});}else{_0x20c7bf();}});});}function getTags(_0x2ca0fd,_0x55a8de,_0x1edbeb,_0x13874a,_0x455a1a,_0x3ce355){return function(_0x5a62a8){return new Promise(function(_0xff0713,_0x4c127a){var _0x22e55f=[];var _0x590f60=_0x13874a[_0x1a3c('0x4b')];if(_0x590f60&&_0x590f60[_0x1a3c('0xd')]>0x0){_0x22e55f=_[_0x1a3c('0x4c')](_0x590f60,_0x1a3c('0x3a'));}if(_0x22e55f[_0x1a3c('0xd')]>0x0){return manageTags(_0x2ca0fd,_0x22e55f,_0x55a8de,_0x1edbeb,_0x5a62a8,_0x455a1a,_0x3ce355)['then'](function(){_0xff0713(_0x5a62a8);});}else{_0xff0713(_0x5a62a8);}});};}function emit(_0x44917d,_0x1cd9e1,_0x2dff22){var _0x1ab15d=_0x1a3c('0x4d')+_0x1a3c('0x4e')+_0x1a3c('0x4f')+'%255EORDERBYDESCnumber';var _0xd07c35={'uri':_0x44917d+_0x1a3c('0x50')+_0x2dff22+_0x1ab15d};io['to'](util[_0x1a3c('0x51')](_0x1a3c('0x52'),_0x1cd9e1))[_0x1a3c('0x53')](_0x1a3c('0x54'),_0xd07c35);}exports['cs']=function(_0x1da55e,_0x5898ab,_0x49a88f,_0x425374,_0x167427,_0x4a690e,_0x51d52a,_0x53b34e){var _0x48e1e7={};var _0xdaef04={'user':_0x4a690e[_0x1a3c('0x55')],'pass':_0x4a690e[_0x1a3c('0x56')]};var _0x1eac87='sysparm_limit=1';var _0x5b244f=_0x1a3c('0x57');_0x4a690e[_0x1a3c('0x58')]=intUtil[_0x1a3c('0x59')](_0x4a690e[_0x1a3c('0x58')]);_0x4a690e[_0x1a3c('0x5a')]=intUtil['stripTrailingSlash'](_0x4a690e['serverUrl']);var _0x45d2f0=util[_0x1a3c('0x51')](_0x1a3c('0x5b'),_0x4a690e[_0x1a3c('0x58')]);_0x48e1e7[_0x1a3c('0x16')]=!_['isNil'](_0x425374)?_0x425374[_0x1a3c('0x5c')]:null;_0x48e1e7['adminEmail']=_0x4a690e[_0x1a3c('0x5c')];_0x48e1e7[_0x1a3c('0x22')]=_0x53b34e[_0x1a3c('0x32')]()==='outbound'?_0x5898ab[_0x1a3c('0x5d')]:_0x5898ab['calleridnum'];_0x48e1e7[_0x1a3c('0x5e')]=_0x53b34e===_0x1a3c('0x5f')||_0x53b34e===_0x1a3c('0x60')?_0x1a3c('0x5f'):'outbound';var _0x3c5c81=util[_0x1a3c('0x51')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a690e[_0x1a3c('0x5a')],_0x5898ab['uniqueid'],md5(_0x5898ab[_0x1a3c('0x61')]));if(_0x167427&&_0x167427['monitor_format']){logger[_0x1a3c('0xf')](_0x1a3c('0x62'),_0x1a3c('0x63'));_0x5898ab[_0x1a3c('0x64')]=_0x3c5c81;}else if(_0x51d52a&&_0x51d52a['recordingFormat']&&_0x51d52a[_0x1a3c('0x65')]!==_0x1a3c('0x66')){logger[_0x1a3c('0xf')](_0x1a3c('0x67'),_0x1a3c('0x63'));_0x5898ab[_0x1a3c('0x64')]=_0x3c5c81;}else{_0x5898ab[_0x1a3c('0x64')]='';}return getAdminUser(_0x53b34e,_0xdaef04,_0x48e1e7,_0x45d2f0,_0x5b244f,_0x1eac87)[_0x1a3c('0x19')](getUser(_0x53b34e,_0xdaef04,_0x45d2f0,_0x5b244f,_0x1eac87))[_0x1a3c('0x19')](getEndUser(_0x53b34e,_0xdaef04,_0x45d2f0,_0x5b244f,_0x1eac87))[_0x1a3c('0x19')](getTicket(_0x53b34e,_0xdaef04,_0x45d2f0,_0x49a88f,_0x5898ab,_0x5b244f))[_0x1a3c('0x19')](function(_0xa815cf){logger['info'](util[_0x1a3c('0x51')](_0x1a3c('0x68'),_0xa815cf[_0x1a3c('0x41')]));logger[_0x1a3c('0xf')](util['format'](_0x1a3c('0x69'),_0x53b34e));if(_0x53b34e!=='unmanaged'){logger[_0x1a3c('0xf')]('['+[_0x53b34e['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x4a690e['remoteUri'],_0x425374[_0x1a3c('0x3a')],_0xa815cf['ticketId']);}})['catch'](function(_0x41db7a){logger[_0x1a3c('0x13')]('['+[_0x53b34e[_0x1a3c('0x10')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x1a3c('0x6a')](_0x41db7a,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x770e=['then','active','true','userId','adminId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','nameField','customField','toString','type','idField','toLowerCase','variable','variableName','customVariable','Variable','name','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','format','%s/api/now/table/','isNil','email','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','md5','./util','../../../../config/logger','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj'];(function(_0x52275d,_0x20c084){var _0x5a5b81=function(_0x3978bd){while(--_0x3978bd){_0x52275d['push'](_0x52275d['shift']());}};_0x5a5b81(++_0x20c084);}(_0x770e,0x194));var _0xe770=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x770e[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xe770('0x0'));var Promise=require('bluebird');var rp=require(_0xe770('0x1'));var util=require(_0xe770('0x2'));var md5=require(_0xe770('0x3'));var Redis=require('ioredis');var intUtil=require(_0xe770('0x4'));var config=require('../../../../config/environment');var logger=require(_0xe770('0x5'))('servicenow');config[_0xe770('0x6')]=_[_0xe770('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xe770('0x8'))(new Redis(config[_0xe770('0x6')]));function getAdminUser(_0x788bf,_0x5db9ed,_0x1934ef,_0x22694e,_0x1068d8,_0x36ab7b){return new Promise(function(_0x1a1d4f,_0x301f6b){var _0x47b9f5={'method':_0xe770('0x9'),'uri':_0x22694e+_0xe770('0xa')+'&'+_0x1068d8+'&'+_0x36ab7b,'auth':_0x5db9ed,'json':!![]};return rp(_0x47b9f5)['then'](function(_0x2ab395){if(_0x2ab395[_0xe770('0xb')][_0xe770('0xc')]>0x0){_0x1934ef['adminId']=_0x2ab395[_0xe770('0xb')][0x0][_0xe770('0xd')];}logger[_0xe770('0xe')]('['+[_0x788bf[_0xe770('0xf')]()]+_0xe770('0x10'),_0x1934ef);_0x1a1d4f(_0x1934ef);})[_0xe770('0x11')](function(_0x3d705e){logger[_0xe770('0x12')]('['+[_0x788bf['toUpperCase']()]+']',_0x3d705e[_0xe770('0x13')]);_0x301f6b(_0x3d705e['message']);});});}function getUser(_0x5d65f9,_0x31a0e2,_0x46d42f,_0xc0cddf,_0x1d660b){return function(_0x2a407c){logger[_0xe770('0xe')]('['+[_0x5d65f9[_0xe770('0xf')]()]+'],\x20getUser\x20input\x20crm',_0x2a407c);return new Promise(function(_0x6d15bd,_0x324222){if(intUtil[_0xe770('0x14')](_0x2a407c[_0xe770('0x15')])){var _0x22e626={'method':_0xe770('0x9'),'uri':_0x46d42f+_0xe770('0x16')+_0x2a407c[_0xe770('0x15')]+'&'+_0xc0cddf+'&'+_0x1d660b,'auth':_0x31a0e2,'json':!![]};logger[_0xe770('0xe')]('['+[_0x5d65f9[_0xe770('0xf')]()]+_0xe770('0x17'),_0x22e626);return rp(_0x22e626)[_0xe770('0x18')](function(_0x192bb0){logger[_0xe770('0xe')]('['+[_0x5d65f9[_0xe770('0xf')]()]+'],\x20getUser\x20entity',_0x192bb0);if(_0x192bb0[_0xe770('0xb')][_0xe770('0xc')]>0x0&&String(_0x192bb0['result'][0x0][_0xe770('0x19')])===_0xe770('0x1a')){_0x2a407c[_0xe770('0x1b')]=_0x192bb0[_0xe770('0xb')][0x0]['sys_id'];}else{_0x2a407c[_0xe770('0x1b')]=_0x2a407c[_0xe770('0x1c')];_0x2a407c[_0xe770('0x15')]=_0x2a407c['adminEmail'];}logger[_0xe770('0xe')]('['+[_0x5d65f9[_0xe770('0xf')]()]+_0xe770('0x1d'),_0x2a407c);_0x6d15bd(_0x2a407c);})[_0xe770('0x11')](function(_0x3a2d19){logger['error']('['+[_0x5d65f9[_0xe770('0xf')]()]+']',_0x3a2d19[_0xe770('0x13')]);_0x324222(_0x3a2d19[_0xe770('0x13')]);});}else{logger[_0xe770('0xe')]('['+[_0x5d65f9['toUpperCase']()]+_0xe770('0x1e'));_0x2a407c[_0xe770('0x1b')]=_0x2a407c[_0xe770('0x1c')];_0x2a407c[_0xe770('0x15')]=_0x2a407c[_0xe770('0x1f')];_0x6d15bd(_0x2a407c);}});};}function createEndUser(_0x131829,_0x5582e5,_0x1b754d,_0xa36b9f,_0x591018){logger[_0xe770('0xe')]('['+[_0x131829[_0xe770('0xf')]()]+_0xe770('0x20'),_0x1b754d);return new Promise(function(_0x2e0ebb,_0x5bcad5){var _0x1dfead={'method':_0xe770('0x21'),'uri':_0xa36b9f+_0xe770('0x22')+_0x591018,'body':{'user_name':_0x1b754d[_0xe770('0x23')],'roles':'user','first_name':_0x1b754d[_0xe770('0x23')],'active':'true','date_format':'System','phone':_0x1b754d[_0xe770('0x23')]},'auth':_0x5582e5,'json':!![]};return rp(_0x1dfead)[_0xe770('0x18')](function(_0x328893){logger[_0xe770('0xe')]('['+[_0x131829[_0xe770('0xf')]()]+_0xe770('0x24'),_0x328893['result']);_0x1b754d['endUserId']=_0x328893[_0xe770('0xb')]['sys_id'];_0x2e0ebb(_0x1b754d);})[_0xe770('0x11')](function(_0x28f76c){logger[_0xe770('0x12')]('['+[_0x131829[_0xe770('0xf')]()]+']',_0x28f76c[_0xe770('0x13')]);_0x5bcad5(_0x28f76c[_0xe770('0x13')]);});});}function getEndUser(_0x5d7bd1,_0x5114a3,_0x5eb3ba,_0x143a57,_0x25943a){return function(_0x3a0a14){logger[_0xe770('0xe')]('['+[_0x5d7bd1['toUpperCase']()]+_0xe770('0x25'),_0x3a0a14);return new Promise(function(_0xf9c031,_0x5015f8){var _0x3ec19f={'method':_0xe770('0x9'),'uri':_0x5eb3ba+_0xe770('0x26')+_0x3a0a14[_0xe770('0x23')]+'&'+_0x143a57+'&'+_0x25943a,'auth':_0x5114a3,'json':!![]};return rp(_0x3ec19f)[_0xe770('0x18')](function(_0x425715){if(_0x425715['result']['length']>0x0){_0x3a0a14[_0xe770('0x27')]=_0x425715[_0xe770('0xb')][0x0][_0xe770('0xd')];logger[_0xe770('0xe')]('['+[_0x5d7bd1[_0xe770('0xf')]()]+_0xe770('0x28'),_0x3a0a14);_0xf9c031(_0x3a0a14);}else{return createEndUser(_0x5d7bd1,_0x5114a3,_0x3a0a14,_0x5eb3ba,_0x143a57)['then'](function(_0x3c9248){logger[_0xe770('0xe')]('['+[_0x5d7bd1[_0xe770('0xf')]()]+_0xe770('0x29'),_0x3c9248);_0xf9c031(_0x3c9248);});}})['catch'](function(_0x53f6b7){logger[_0xe770('0x12')]('['+[_0x5d7bd1['toUpperCase']()]+']',_0x53f6b7[_0xe770('0x13')]);_0x5015f8(_0x53f6b7[_0xe770('0x13')]);});});};}function getCustomFields(_0x2265c4,_0x180b60){var _0x2158f5={};if(_0x2265c4[_0xe770('0xc')]>0x0){_[_0xe770('0x2a')](_0x2265c4,function(_0x2448bd){if(_[_0xe770('0x2b')](['string',_0xe770('0x2c')],_0x2448bd['type'])&&_0x2448bd[_0xe770('0x2d')]&&!_0x2448bd[_0xe770('0x2e')]){_0x2158f5[_0x2448bd[_0xe770('0x2d')]['toLowerCase']()]=_0x2448bd['content'][_0xe770('0x2f')]();}else if(_[_0xe770('0x2b')](['string','picklist'],_0x2448bd[_0xe770('0x30')])&&_0x2448bd[_0xe770('0x31')]&&_0x2448bd[_0xe770('0x2e')]){_0x2158f5[_0x2448bd[_0xe770('0x31')][_0xe770('0x32')]()]=_0x2448bd['content'][_0xe770('0x2f')]();}else if(_0x2448bd[_0xe770('0x30')]===_0xe770('0x33')&&_0x2448bd[_0xe770('0x34')]&&_0x2448bd['idField']&&_0x2448bd[_0xe770('0x2e')]){_0x2158f5[_0x2448bd[_0xe770('0x31')][_0xe770('0x32')]()]=_0x180b60[_0x2448bd[_0xe770('0x34')]]['toString']();}else if(_0x2448bd[_0xe770('0x30')]===_0xe770('0x35')&&_0x2448bd['Variable']&&_0x2448bd[_0xe770('0x36')][_0xe770('0x37')]&&_0x2448bd['idField']&&_0x2448bd['customField']){_0x2158f5[_0x2448bd[_0xe770('0x31')][_0xe770('0x32')]()]=_0x180b60[_0x2448bd[_0xe770('0x36')]['name'][_0xe770('0x32')]()][_0xe770('0x2f')]();}});}return _0x2158f5;}function getTicket(_0x598182,_0x4c361a,_0x421e75,_0x13e581,_0x5844cb,_0x4df4de){return function(_0x34c94a){logger[_0xe770('0xe')]('['+[_0x598182[_0xe770('0xf')]()]+']\x20getTicket\x20input\x20crm',_0x34c94a);return new Promise(function(_0x3d81da,_0x3b7d16){var _0x129024=_0x598182[_0xe770('0x32')]()===_0xe770('0x38')?_0x34c94a['userId']:_0x34c94a['endUserId'];var _0x323a6f={'method':_0xe770('0x21'),'uri':_0x421e75+_0xe770('0x39')+'?'+_0x4df4de,'body':Object[_0xe770('0x3a')]({},{'active':_0xe770('0x1a'),'caller_id':_0x129024,'assigned_to':_0x34c94a[_0xe770('0x1b')],'short_description':intUtil[_0xe770('0x3b')](_0x13e581[_0xe770('0x3c')],_0x5844cb,'\x20'),'description':intUtil['getString'](_0x13e581[_0xe770('0x3d')],_0x5844cb,'\x0a')},getCustomFields(_0x13e581['Fields'],_0x5844cb)),'auth':_0x4c361a,'json':!![]};return rp(_0x323a6f)[_0xe770('0x18')](function(_0x346bc1){logger['info']('['+[_0x598182[_0xe770('0xf')]()]+_0xe770('0x3e'),_0x346bc1[_0xe770('0xb')]);_0x34c94a[_0xe770('0x3f')]=_0x346bc1['result'][_0xe770('0xd')];_0x34c94a[_0xe770('0x40')]=_0x346bc1[_0xe770('0xb')][_0xe770('0x41')];logger['info']('['+[_0x598182[_0xe770('0xf')]()]+_0xe770('0x42'),_0x34c94a);_0x3d81da(_0x34c94a);})[_0xe770('0x11')](function(_0x12e596){logger[_0xe770('0x12')]('['+[_0x598182['toUpperCase']()]+']',_0x12e596[_0xe770('0x13')]);_0x3b7d16(_0x12e596[_0xe770('0x13')]);});});};}function createRemoteTag(_0xe27ebd,_0x43ea81,_0x1dd992,_0x3432b7){return new Promise(function(_0x41f731,_0x105fcc){var _0x1160e3={'method':_0xe770('0x21'),'uri':_0x1dd992+_0xe770('0x43')+'?'+_0x3432b7,'body':{'short_description':_0xe27ebd,'global':!![],'active':!![],'name':_0xe27ebd},'auth':_0x43ea81,'json':!![]};return rp(_0x1160e3)[_0xe770('0x18')](function(_0x4dd65b){var _0x50d409=_0x4dd65b[_0xe770('0xb')][_0xe770('0xd')];_0x41f731(_0x50d409);});});}function getRemoteTag(_0x4b839e,_0x5e8dba,_0x27eca8,_0x26a475,_0x2c4dbe){return new Promise(function(_0x3862ff,_0x272ba7){var _0x4f9870={'method':'GET','uri':_0x27eca8+_0xe770('0x43')+_0xe770('0x44')+_0x4b839e+'&'+_0x26a475,'auth':_0x5e8dba,'json':!![]};return rp(_0x4f9870)[_0xe770('0x18')](function(_0x5bb3e2){if(_0x5bb3e2['result'][_0xe770('0xc')]>0x0){var _0x489620=_0x5bb3e2['result'][0x0][_0xe770('0xd')];_0x3862ff(_0x489620);}else{return createRemoteTag(_0x4b839e,_0x5e8dba,_0x27eca8,_0x26a475)[_0xe770('0x18')](function(_0x4e5cfa){_0x3862ff(_0x4e5cfa);});}});});}function assignTagToIncident(_0x1ab4ce,_0x348fad,_0x109bea,_0x4e3182,_0x1dfa0a){return new Promise(function(_0x32b0cc,_0x4910e7){var _0x317d87={'method':'POST','uri':_0x109bea+_0xe770('0x45')+'?'+_0x1dfa0a,'body':{'label':_0x1ab4ce,'table':_0xe770('0x39'),'id_type':_0xe770('0x46'),'table_key':_0x4e3182[_0xe770('0x3f')],'title':_0xe770('0x47')+_0x4e3182[_0xe770('0x40')],'id_display':_0x4e3182[_0xe770('0x40')]},'auth':_0x348fad,'json':!![]};return rp(_0x317d87)[_0xe770('0x18')](function(_0x5097ae){_0x32b0cc();})[_0xe770('0x11')](function(){_0x32b0cc();});});}function manageTags(_0x2d9134,_0x164412,_0x3f22b2,_0x313a2f,_0x619c5c,_0xa6184e,_0x594490){return new Promise(function(_0x3f52b9,_0x137643){var _0x4ae327=[];_0x164412['forEach'](function(_0x12fd28){_0x4ae327[_0xe770('0x48')](getRemoteTag(_0x12fd28,_0x3f22b2,_0x313a2f,_0xa6184e,_0x594490));});return Promise[_0xe770('0x49')](_0x4ae327)[_0xe770('0x18')](function(_0x48a523){if(_0x48a523[_0xe770('0xc')]){logger['info']('['+[_0x2d9134[_0xe770('0xf')]()]+_0xe770('0x4a'),_0x48a523);var _0xa449b=[];_0x48a523[_0xe770('0x2a')](function(_0x663081){_0xa449b['push'](assignTagToIncident(_0x663081,_0x3f22b2,_0x313a2f,_0x619c5c,_0xa6184e));});return Promise['all'](_0xa449b)['then'](function(){_0x3f52b9();})[_0xe770('0x11')](function(){_0x3f52b9();});}else{_0x3f52b9();}});});}function getTags(_0x2f2fd0,_0x3feec3,_0x250633,_0x1c9d82,_0x4aad8d,_0x4461b4){return function(_0x2f79c3){return new Promise(function(_0x353eb9,_0x1ea920){var _0x10219b=[];var _0x218e82=_0x1c9d82[_0xe770('0x4b')];if(_0x218e82&&_0x218e82[_0xe770('0xc')]>0x0){_0x10219b=_[_0xe770('0x4c')](_0x218e82,'name');}if(_0x10219b[_0xe770('0xc')]>0x0){return manageTags(_0x2f2fd0,_0x10219b,_0x3feec3,_0x250633,_0x2f79c3,_0x4aad8d,_0x4461b4)['then'](function(){_0x353eb9(_0x2f79c3);});}else{_0x353eb9(_0x2f79c3);}});};}function emit(_0x5d4b27,_0x35a122,_0x2deb51){var _0x452e15='%26sysparm_record_target%3Dincident'+_0xe770('0x4d')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xe770('0x4e');var _0x10c42f={'uri':_0x5d4b27+_0xe770('0x4f')+_0x2deb51+_0x452e15};io['to'](util['format'](_0xe770('0x50'),_0x35a122))['emit'](_0xe770('0x51'),_0x10c42f);}exports['cs']=function(_0x2443d9,_0x20e45e,_0x3a2676,_0x5b66b7,_0x404000,_0x12bd8b,_0x5681ea,_0xdb8d2e){var _0x1b4d80={};var _0x4c2ae8={'user':_0x12bd8b[_0xe770('0x52')],'pass':_0x12bd8b['password']};var _0x30e05c=_0xe770('0x53');var _0x274824=_0xe770('0x54');_0x12bd8b[_0xe770('0x55')]=intUtil[_0xe770('0x56')](_0x12bd8b[_0xe770('0x55')]);_0x12bd8b['serverUrl']=intUtil[_0xe770('0x56')](_0x12bd8b['serverUrl']);var _0x5b8d80=util[_0xe770('0x57')](_0xe770('0x58'),_0x12bd8b['remoteUri']);_0x1b4d80[_0xe770('0x15')]=!_[_0xe770('0x59')](_0x5b66b7)?_0x5b66b7[_0xe770('0x5a')]:null;_0x1b4d80[_0xe770('0x1f')]=_0x12bd8b[_0xe770('0x5a')];_0x1b4d80[_0xe770('0x23')]=_0xdb8d2e['toLowerCase']()==='outbound'?_0x20e45e['destcalleridnum']:_0x20e45e[_0xe770('0x5b')];_0x1b4d80[_0xe770('0x5c')]=_0xdb8d2e===_0xe770('0x5d')||_0xdb8d2e===_0xe770('0x5e')?_0xe770('0x5d'):_0xe770('0x38');var _0x43b35c=util[_0xe770('0x57')](_0xe770('0x5f'),_0x12bd8b[_0xe770('0x60')],_0x20e45e[_0xe770('0x61')],md5(_0x20e45e[_0xe770('0x61')]));if(_0x404000&&_0x404000[_0xe770('0x62')]){logger[_0xe770('0xe')]('[QUEUE]',_0xe770('0x63'));_0x20e45e[_0xe770('0x64')]=_0x43b35c;}else if(_0x5681ea&&_0x5681ea[_0xe770('0x65')]&&_0x5681ea['recordingFormat']!==_0xe770('0x66')){logger['info'](_0xe770('0x67'),_0xe770('0x63'));_0x20e45e[_0xe770('0x64')]=_0x43b35c;}else{_0x20e45e[_0xe770('0x64')]='';}return getAdminUser(_0xdb8d2e,_0x4c2ae8,_0x1b4d80,_0x5b8d80,_0x274824,_0x30e05c)['then'](getUser(_0xdb8d2e,_0x4c2ae8,_0x5b8d80,_0x274824,_0x30e05c))[_0xe770('0x18')](getEndUser(_0xdb8d2e,_0x4c2ae8,_0x5b8d80,_0x274824,_0x30e05c))[_0xe770('0x18')](getTicket(_0xdb8d2e,_0x4c2ae8,_0x5b8d80,_0x3a2676,_0x20e45e,_0x274824))[_0xe770('0x18')](function(_0x2b0e0c){logger[_0xe770('0xe')](util[_0xe770('0x57')](_0xe770('0x68'),_0x2b0e0c['ticketId']));logger[_0xe770('0xe')](util[_0xe770('0x57')]('call\x20direction:\x20%s',_0xdb8d2e));if(_0xdb8d2e!==_0xe770('0x5e')){logger['info']('['+[_0xdb8d2e[_0xe770('0xf')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x12bd8b[_0xe770('0x55')],_0x5b66b7[_0xe770('0x37')],_0x2b0e0c[_0xe770('0x3f')]);}})[_0xe770('0x11')](function(_0x2ae540){logger[_0xe770('0x12')]('['+[_0xdb8d2e[_0xe770('0xf')]()]+_0xe770('0x69'),util[_0xe770('0x6a')](_0x2ae540,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index f6465cb..ea432f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe30f=['then','find','entry_list','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Searching\x20enduser\x20with\x20phone','stringify','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','debug','[HTTP]','merge','map','string','nameField','customField','toLowerCase','type','idField','custom_fields','content','variable','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','stripTrailingSlash','remoteUri','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','[OUTBOUND]','destcalleridnum','Fields','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','POST','emit','info','Creating\x20new\x20ticket...','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_type','parent_name','name','direction','length','forEach','variableName','push','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name'];(function(_0x18a257,_0x12d221){var _0x35ec40=function(_0x3b74a0){while(--_0x3b74a0){_0x18a257['push'](_0x18a257['shift']());}};_0x35ec40(++_0x12d221);}(_0xe30f,0x1b1));var _0xfe30=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe30f[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xfe30('0x0'));var rp=require(_0xfe30('0x1'));var BPromise=require(_0xfe30('0x2'));var md5=require(_0xfe30('0x3'));var util=require(_0xfe30('0x4'));var Redis=require(_0xfe30('0x5'));var intUtil=require(_0xfe30('0x6'));var config=require(_0xfe30('0x7'));var logger=require(_0xfe30('0x8'))('sugarcrm');config['redis']=_[_0xfe30('0x9')](config[_0xfe30('0xa')],{'host':_0xfe30('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfe30('0xa')]));var def={'method':_0xfe30('0xc'),'json':!![]};function emit(_0x5c6148,_0x2b24a3,_0x41046a){io['to'](_0x5c6148)[_0xfe30('0xd')](_0x2b24a3,_0x41046a);}function getTicket(_0x284b7d,_0x16c0f3,_0x3650bd,_0x52e4f8,_0x9e75,_0x2580ff,_0x2b2ada,_0x5c9118){logger[_0xfe30('0xe')](_0xfe30('0xf'));var _0x109785=new Date();var _0x474f2d=[{'name':'name','value':intUtil[_0xfe30('0x10')](_0x52e4f8['Subjects'],_0x9e75,'\x20')},{'name':'assigned_user_id','value':_0x16c0f3['id']},{'name':'created_by','value':_0x16c0f3['id']},{'name':'description','value':intUtil[_0xfe30('0x10')](_0x52e4f8[_0xfe30('0x11')],_0x9e75,'\x0a')},{'name':_0xfe30('0x12'),'value':_0x109785[_0xfe30('0x13')]()[_0xfe30('0x14')](0x0,0x13)[_0xfe30('0x15')]('T','\x20')},{'name':_0xfe30('0x16'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xfe30('0x17'),'value':_0x3650bd['id']},{'name':_0xfe30('0x18'),'value':'Contacts'},{'name':_0xfe30('0x19'),'value':_0x3650bd[_0xfe30('0x1a')]},{'name':_0xfe30('0x1b'),'value':_0x5c9118}];if(_0x2580ff[_0xfe30('0x1c')]){_[_0xfe30('0x1d')](_0x2580ff,function(_0x3f2c65){if(_0x9e75[_0x3f2c65[_0xfe30('0x1e')]]){_0x474f2d[_0xfe30('0x1f')]({'name':_0x3f2c65['idField'],'value':_0x9e75[_0x3f2c65[_0xfe30('0x1e')]]});}});}return request({'form':{'method':_0xfe30('0x20'),'input_type':_0xfe30('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2b2ada['id'],'module_name':_0xfe30('0x22'),'name_value_list':_0x474f2d})}});}function getAuth(_0x6b3d4c){return util[_0xfe30('0x23')](_0xfe30('0x24'),new Buffer(_0x6b3d4c[_0xfe30('0x25')]+':X')[_0xfe30('0x26')](_0xfe30('0x27')));}function getServerInfo(_0x1bc361){return request({'form':{'method':_0xfe30('0x28'),'input_type':_0xfe30('0x21'),'response_type':_0xfe30('0x21'),'rest_data':JSON['stringify']({'session':_0x1bc361['id']})}});}function getUser(_0x409a31,_0x31717b,_0x583c51){if(!_[_0xfe30('0x29')](_0x31717b)){logger[_0xfe30('0xe')](_0xfe30('0x2a'),_0x31717b);return request({'form':{'method':_0xfe30('0x2b'),'input_type':_0xfe30('0x21'),'response_type':_0xfe30('0x21'),'rest_data':JSON['stringify']({'session':_0x583c51['id'],'module_name':_0xfe30('0x2c'),'query':util[_0xfe30('0x23')](_0xfe30('0x2d'),_0x31717b),'order_by':'','offset':'0','select_fields':['id',_0xfe30('0x1a'),_0xfe30('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xfe30('0x2f')](function(_0x448339){if(_0x448339['entry_list'][_0xfe30('0x1c')]){var _0xa2ed31=_[_0xfe30('0x30')](_0x448339[_0xfe30('0x31')],function(_0x32cc0b){return _0x32cc0b[_0xfe30('0x32')][_0xfe30('0x2e')][_0xfe30('0x33')]===_0x31717b;});if(_0xa2ed31){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0xa2ed31['name_value_list']['id'][_0xfe30('0x33')],'name':_0xa2ed31['name_value_list'][_0xfe30('0x1a')]['value']});}}logger[_0xfe30('0xe')](_0xfe30('0x34'));return BPromise[_0xfe30('0x35')]({'id':_0x583c51[_0xfe30('0x32')][_0xfe30('0x36')][_0xfe30('0x33')],'name':_0x583c51[_0xfe30('0x32')][_0xfe30('0x2e')][_0xfe30('0x33')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xfe30('0x35')]({'id':_0x583c51[_0xfe30('0x32')][_0xfe30('0x36')][_0xfe30('0x33')],'name':_0x583c51[_0xfe30('0x32')][_0xfe30('0x2e')][_0xfe30('0x33')]});}}function getEndUser(_0x3bb3db,_0x269580,_0x142f65,_0x3d8909){logger[_0xfe30('0xe')](_0xfe30('0x37'),_0x142f65);return request({'form':{'method':'get_entry_list','input_type':_0xfe30('0x21'),'response_type':_0xfe30('0x21'),'rest_data':JSON[_0xfe30('0x38')]({'session':_0x3d8909['id'],'module_name':'Contacts','query':util[_0xfe30('0x23')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x142f65),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xfe30('0x2f')](function(_0x4fd92e){if(_0x4fd92e[_0xfe30('0x31')][_0xfe30('0x1c')]){var _0x3ed646=_[_0xfe30('0x30')](_0x4fd92e['entry_list'],function(_0x115f30){return _0x115f30[_0xfe30('0x32')]['phone_home'][_0xfe30('0x33')]===_0x142f65;});if(_0x3ed646){logger[_0xfe30('0xe')](_0xfe30('0x39'));return BPromise[_0xfe30('0x35')]({'id':_0x3ed646[_0xfe30('0x32')]['id'][_0xfe30('0x33')],'name':_0x3ed646[_0xfe30('0x32')]['name'][_0xfe30('0x33')],'phone':_0x3ed646[_0xfe30('0x32')][_0xfe30('0x3a')][_0xfe30('0x33')]});}}else{logger[_0xfe30('0xe')](_0xfe30('0x3b'));return request({'form':{'method':_0xfe30('0x20'),'input_type':_0xfe30('0x21'),'response_type':_0xfe30('0x21'),'rest_data':JSON[_0xfe30('0x38')]({'session':_0x3d8909['id'],'module_name':'Contacts','name_value_list':[{'name':_0xfe30('0x3c'),'value':_0x269580!==_0xfe30('0x3d')?_0x269580:util[_0xfe30('0x23')](_0xfe30('0x3e'),_0x142f65)},{'name':'phone_home','value':_0x142f65}]})}})[_0xfe30('0x2f')](function(_0x580a08){logger[_0xfe30('0xe')]('Enduser\x20created.');return BPromise[_0xfe30('0x35')]({'id':_0x580a08['id'],'name':_0x580a08[_0xfe30('0x31')]['first_name']['value'],'phone':_0x580a08[_0xfe30('0x31')][_0xfe30('0x3a')][_0xfe30('0x33')]});});}});}function request(_0x550ef5){logger[_0xfe30('0x3f')](_0xfe30('0x40'),JSON[_0xfe30('0x38')](_0x550ef5));return rp(_[_0xfe30('0x41')](def,_0x550ef5));}function getTags(_0x2915f3,_0x204816){var _0x314e02=[];if(_0x2915f3&&_0x2915f3['length']>0x0){_0x314e02=_[_0xfe30('0x42')](_0x2915f3,_0x204816);}return _0x314e02;}function getCustomFields(_0x7149b1,_0x26633d){var _0x12eae8=[];var _0x3d3a67={'custom_fields':[]};if(_0x7149b1[_0xfe30('0x1c')]>0x0){_['forEach'](_0x7149b1,function(_0x27ae56){if(_0x27ae56['type']===_0xfe30('0x43')&&_0x27ae56[_0xfe30('0x44')]&&!_0x27ae56[_0xfe30('0x45')]){_0x3d3a67[_0x27ae56['nameField'][_0xfe30('0x46')]()]=_0x27ae56['content'][_0xfe30('0x26')]();}else if(_0x27ae56[_0xfe30('0x47')]==='string'&&_0x27ae56[_0xfe30('0x48')]&&_0x27ae56[_0xfe30('0x45')]){_0x3d3a67[_0xfe30('0x49')][_0xfe30('0x1f')]({'id':_0x27ae56[_0xfe30('0x48')],'value':_0x27ae56[_0xfe30('0x4a')][_0xfe30('0x26')]()});}else if(_0x27ae56[_0xfe30('0x47')]===_0xfe30('0x4b')&&_0x27ae56['variableName']&&_0x27ae56[_0xfe30('0x48')]&&_0x27ae56[_0xfe30('0x45')]){_0x26633d[_0x27ae56[_0xfe30('0x1e')]]&&_0x3d3a67['custom_fields'][_0xfe30('0x1f')]({'id':_0x27ae56[_0xfe30('0x48')],'value':_0x26633d[_0x27ae56[_0xfe30('0x1e')]]['toString']()});}else if(_0x27ae56[_0xfe30('0x47')]===_0xfe30('0x4c')&&_0x27ae56[_0xfe30('0x4d')]&&_0x27ae56[_0xfe30('0x4d')][_0xfe30('0x1a')]&&_0x27ae56['idField']&&_0x27ae56[_0xfe30('0x45')]){_0x26633d[_0x27ae56['Variable'][_0xfe30('0x1a')][_0xfe30('0x46')]()]&&_0x3d3a67[_0xfe30('0x49')]['push']({'id':_0x27ae56[_0xfe30('0x48')],'value':_0x26633d[_0x27ae56['Variable'][_0xfe30('0x1a')][_0xfe30('0x46')]()]['toString']()});}});}return _0x3d3a67;}function getConnection(_0x574134){return request({'method':_0xfe30('0xc'),'form':{'method':_0xfe30('0x4e'),'input_type':_0xfe30('0x21'),'response_type':_0xfe30('0x21'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x574134[_0xfe30('0x4f')],'password':_0x574134['password'],'encryption':_0xfe30('0x50')},'application':_0xfe30('0x51')})}})[_0xfe30('0x2f')](function(_0x2d7c29){var _0x52809c=_0x2d7c29;if(_0x52809c['id']){def[_0xfe30('0x52')]=_0x52809c['id'];return BPromise[_0xfe30('0x35')](_0x52809c);}else{throw new Error(util[_0xfe30('0x23')]('Account\x20%d\x20is\x20not\x20valid',_0x574134['id']));}});}function setRelationship(_0x2e79cd,_0x2e5514,_0x397f87,_0x501f1a){return request({'form':{'method':_0xfe30('0x53'),'input_type':'JSON','response_type':_0xfe30('0x21'),'rest_data':JSON['stringify']({'session':_0x2e79cd['id'],'module_name':_0xfe30('0x22'),'module_id':_0x397f87['id'],'link_field_name':_0x501f1a,'related_ids':[_0x2e5514['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x4a490e,_0x1dbdf2,_0x5e5ee1,_0x6f8d5c,_0x404218,_0x477fbc){var _0x487fd2,_0x2c397f,_0x869e0b,_0x95cb3e;_0x477fbc['remoteUri']=intUtil[_0xfe30('0x54')](_0x477fbc[_0xfe30('0x55')]);_0x477fbc['serverUrl']=intUtil[_0xfe30('0x54')](_0x477fbc['serverUrl']);def[_0xfe30('0x56')]=util[_0xfe30('0x23')](_0xfe30('0x57'),_0x477fbc[_0xfe30('0x55')]);if(_0x404218&&_0x404218[_0xfe30('0x58')]){logger[_0xfe30('0xe')](_0xfe30('0x59'),_0xfe30('0x5a'));_0x1dbdf2[_0xfe30('0x5b')]=util['format'](_0xfe30('0x5c'),_0x477fbc[_0xfe30('0x5d')],_0x1dbdf2[_0xfe30('0x5e')],md5(_0x1dbdf2['uniqueid']));}else{_0x1dbdf2['recordingURL']='';}return getConnection(_0x477fbc)['then'](function(_0x44dc12){_0x95cb3e=_0x44dc12;return getUser(_0x477fbc,_0x6f8d5c[_0xfe30('0x1a')],_0x95cb3e);})[_0xfe30('0x2f')](function(_0x421cff){_0x487fd2=_0x421cff;logger[_0xfe30('0xe')](_0xfe30('0x5f'),_0x487fd2['id']);return getEndUser(_0x477fbc,_0x1dbdf2[_0xfe30('0x60')],_0x1dbdf2[_0xfe30('0x61')],_0x95cb3e);})[_0xfe30('0x2f')](function(_0xd12601){_0x2c397f=_0xd12601;logger[_0xfe30('0xe')](_0xfe30('0x62'),_0x2c397f['id']);return getTicket(_0x477fbc,_0x487fd2,_0x2c397f,_0x5e5ee1,_0x1dbdf2,_0x5e5ee1['Fields'],_0x95cb3e,_0xfe30('0x63'));})['then'](function(_0x52ccdd){_0x869e0b=_0x52ccdd;logger['info'](_0xfe30('0x64'));logger[_0xfe30('0xe')](_0xfe30('0x65'),_0x869e0b['id']);return setRelationship(_0x95cb3e,_0x487fd2,_0x869e0b,_0xfe30('0x66'));})[_0xfe30('0x2f')](function(){return setRelationship(_0x95cb3e,_0x2c397f,_0x869e0b,_0xfe30('0x67'));})['then'](function(){return getServerInfo(_0x95cb3e);})['then'](function(_0x120fad){var _0x177d6a=parseInt(_0x120fad[_0xfe30('0x68')][_0xfe30('0x69')](0x0));var _0x2bdab3=util['format'](_0xfe30('0x6a'),_0x477fbc[_0xfe30('0x55')],_0x869e0b['id']);if(_0x177d6a>0x6){_0x2bdab3=util[_0xfe30('0x23')](_0xfe30('0x6b'),_0x477fbc[_0xfe30('0x55')],_0x869e0b['id']);}logger[_0xfe30('0xe')](_0xfe30('0x59'),_0xfe30('0x6c'));emit(util[_0xfe30('0x23')](_0xfe30('0x6d'),_0x6f8d5c[_0xfe30('0x1a')]),_0xfe30('0x6e'),{'uri':_0x2bdab3});})[_0xfe30('0x6f')](function(_0x5953df){logger[_0xfe30('0x70')](_0xfe30('0x59'),JSON[_0xfe30('0x38')](_0x5953df));});};exports['outbound']=function(_0x3bb2ad,_0x255080,_0x8aa74c,_0x276423,_0x3d747e,_0x2b85d6,_0x198b50){var _0x30b87b,_0x5d2f2c,_0x2a39ed,_0x531c8b;_0x2b85d6[_0xfe30('0x55')]=intUtil[_0xfe30('0x54')](_0x2b85d6[_0xfe30('0x55')]);_0x2b85d6[_0xfe30('0x5d')]=intUtil[_0xfe30('0x54')](_0x2b85d6['serverUrl']);def[_0xfe30('0x56')]=util[_0xfe30('0x23')](_0xfe30('0x57'),_0x2b85d6[_0xfe30('0x55')]);if(_0x198b50&&_0x198b50[_0xfe30('0x71')]&&_0x198b50[_0xfe30('0x71')]!=='none'){logger[_0xfe30('0xe')](_0xfe30('0x72'),_0xfe30('0x5a'));_0x255080[_0xfe30('0x5b')]=util[_0xfe30('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b85d6['serverUrl'],_0x255080[_0xfe30('0x5e')],md5(_0x255080[_0xfe30('0x5e')]));}return getConnection(_0x2b85d6)[_0xfe30('0x2f')](function(_0x11bc7a){_0x531c8b=_0x11bc7a;return getUser(_0x2b85d6,_0x276423[_0xfe30('0x1a')],_0x531c8b);})[_0xfe30('0x2f')](function(_0x2e3c0b){_0x30b87b=_0x2e3c0b;logger[_0xfe30('0xe')]('The\x20User\x20ID\x20is:',_0x30b87b['id']);return getEndUser(_0x2b85d6,_0x255080['destcalleridname'],_0x255080[_0xfe30('0x73')],_0x531c8b);})['then'](function(_0x576082){_0x5d2f2c=_0x576082;logger[_0xfe30('0xe')](_0xfe30('0x62'),_0x5d2f2c['id']);return getTicket(_0x2b85d6,_0x30b87b,_0x5d2f2c,_0x8aa74c,_0x255080,_0x8aa74c[_0xfe30('0x74')],_0x531c8b,'Outbound');})['then'](function(_0x46885){_0x2a39ed=_0x46885;logger[_0xfe30('0xe')]('Ticket\x20created!');logger[_0xfe30('0xe')]('The\x20Ticket\x20ID\x20is:',_0x2a39ed['id']);return setRelationship(_0x531c8b,_0x30b87b,_0x2a39ed,'users');})[_0xfe30('0x2f')](function(){return setRelationship(_0x531c8b,_0x5d2f2c,_0x2a39ed,'contacts');})['then'](function(){return getServerInfo(_0x531c8b);})[_0xfe30('0x2f')](function(_0x196a95){var _0x267564=parseInt(_0x196a95['version'][_0xfe30('0x69')](0x0));var _0x151547=util[_0xfe30('0x23')](_0xfe30('0x6a'),_0x2b85d6[_0xfe30('0x55')],_0x2a39ed['id']);if(_0x267564>0x6){_0x151547=util[_0xfe30('0x23')](_0xfe30('0x6b'),_0x2b85d6['remoteUri'],_0x2a39ed['id']);}logger[_0xfe30('0xe')](_0xfe30('0x72'),_0xfe30('0x6c'));emit(util[_0xfe30('0x23')](_0xfe30('0x6d'),_0x276423[_0xfe30('0x1a')]),_0xfe30('0x6e'),{'uri':_0x151547});})[_0xfe30('0x6f')](function(_0x232c5f){logger[_0xfe30('0x70')](_0xfe30('0x72'),JSON['stringify'](_0x232c5f));});};exports[_0xfe30('0x75')]=function(_0x20c06f,_0x407399,_0x2d5e25,_0x18ec19,_0x3ac17e,_0x681b8){var _0x380475,_0x2e1c24,_0x378612,_0x263a60;_0x681b8['remoteUri']=intUtil[_0xfe30('0x54')](_0x681b8['remoteUri']);_0x681b8['serverUrl']=intUtil[_0xfe30('0x54')](_0x681b8['serverUrl']);def[_0xfe30('0x56')]=util[_0xfe30('0x23')](_0xfe30('0x57'),_0x681b8[_0xfe30('0x55')]);if(_0x3ac17e&&_0x3ac17e[_0xfe30('0x58')]){logger[_0xfe30('0xe')]('['+_0x407399[_0xfe30('0x76')]['toUpperCase']()+']',_0xfe30('0x5a'));_0x407399[_0xfe30('0x5b')]=util[_0xfe30('0x23')](_0xfe30('0x5c'),_0x681b8[_0xfe30('0x5d')],_0x407399[_0xfe30('0x5e')],md5(_0x407399[_0xfe30('0x5e')]));}else{_0x407399[_0xfe30('0x5b')]='';}return getConnection(_0x681b8)[_0xfe30('0x2f')](function(_0x1137cb){_0x263a60=_0x1137cb;if(!_['isNil'](_0x18ec19)){return getUser(_0x681b8,_0x18ec19[_0xfe30('0x1a')],_0x263a60);}else{return getUser(_0x681b8,null,_0x263a60);}})[_0xfe30('0x2f')](function(_0x1a35d2){_0x380475=_0x1a35d2;logger[_0xfe30('0xe')](_0xfe30('0x5f'),_0x380475['id']);return getEndUser(_0x681b8,_0x407399[_0xfe30('0x60')],_0x407399[_0xfe30('0x61')],_0x263a60);})[_0xfe30('0x2f')](function(_0x1bc3d8){_0x2e1c24=_0x1bc3d8;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2e1c24['id']);return getTicket(_0x681b8,_0x380475,_0x2e1c24,_0x2d5e25,_0x407399,_0x2d5e25[_0xfe30('0x74')],_0x263a60,_0xfe30('0x63'));})[_0xfe30('0x2f')](function(_0x497c57){_0x378612=_0x497c57;logger['info'](_0xfe30('0x64'));logger[_0xfe30('0xe')](_0xfe30('0x65'),_0x378612['id']);return setRelationship(_0x263a60,_0x380475,_0x378612,'users');})[_0xfe30('0x2f')](function(){return setRelationship(_0x263a60,_0x2e1c24,_0x378612,'contacts');})[_0xfe30('0x2f')](function(){return getServerInfo(_0x263a60);})['catch'](function(_0x347551){logger[_0xfe30('0x70')]('['+_0x407399['lastevent'][_0xfe30('0x77')]()+']',JSON[_0xfe30('0x38')](_0x347551));});};
\ No newline at end of file
+var _0x8c35=['%s/service/v4_1/rest.php','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','users','[OUTBOUND]','unmanaged','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','info','Creating\x20new\x20ticket...','getString','assigned_user_id','created_by','description','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','debug','merge','map','type','string','customField','nameField','content','idField','custom_fields','variable','customVariable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','monitor_format','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound'];(function(_0x4e54ca,_0x1f1dd2){var _0x9f0a72=function(_0x588558){while(--_0x588558){_0x4e54ca['push'](_0x4e54ca['shift']());}};_0x9f0a72(++_0x1f1dd2);}(_0x8c35,0x188));var _0x58c3=function(_0x909335,_0x3d2b66){_0x909335=_0x909335-0x0;var _0x167010=_0x8c35[_0x909335];return _0x167010;};'use strict';var _=require(_0x58c3('0x0'));var rp=require(_0x58c3('0x1'));var BPromise=require(_0x58c3('0x2'));var md5=require(_0x58c3('0x3'));var util=require(_0x58c3('0x4'));var Redis=require(_0x58c3('0x5'));var intUtil=require(_0x58c3('0x6'));var config=require(_0x58c3('0x7'));var logger=require(_0x58c3('0x8'))(_0x58c3('0x9'));config[_0x58c3('0xa')]=_[_0x58c3('0xb')](config['redis'],{'host':_0x58c3('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x58c3('0xa')]));var def={'method':_0x58c3('0xd'),'json':!![]};function emit(_0x3ed66f,_0x32f118,_0x343102){io['to'](_0x3ed66f)['emit'](_0x32f118,_0x343102);}function getTicket(_0x2a4b56,_0x2de541,_0x22f54d,_0x3d12df,_0x56584a,_0x17718c,_0x34ef8a,_0x1cc0b4){logger[_0x58c3('0xe')](_0x58c3('0xf'));var _0x34e13c=new Date();var _0x43d770=[{'name':'name','value':intUtil[_0x58c3('0x10')](_0x3d12df['Subjects'],_0x56584a,'\x20')},{'name':_0x58c3('0x11'),'value':_0x2de541['id']},{'name':_0x58c3('0x12'),'value':_0x2de541['id']},{'name':_0x58c3('0x13'),'value':intUtil[_0x58c3('0x10')](_0x3d12df['Descriptions'],_0x56584a,'\x0a')},{'name':_0x58c3('0x14'),'value':_0x34e13c[_0x58c3('0x15')]()[_0x58c3('0x16')](0x0,0x13)[_0x58c3('0x17')]('T','\x20')},{'name':_0x58c3('0x18'),'value':'0'},{'name':_0x58c3('0x19'),'value':'15'},{'name':_0x58c3('0x1a'),'value':_0x22f54d['id']},{'name':_0x58c3('0x1b'),'value':_0x58c3('0x1c')},{'name':_0x58c3('0x1d'),'value':_0x22f54d['name']},{'name':_0x58c3('0x1e'),'value':_0x1cc0b4}];if(_0x17718c[_0x58c3('0x1f')]){_[_0x58c3('0x20')](_0x17718c,function(_0x25b5aa){if(_0x56584a[_0x25b5aa[_0x58c3('0x21')]]){_0x43d770[_0x58c3('0x22')]({'name':_0x25b5aa['idField'],'value':_0x56584a[_0x25b5aa['variableName']]});}});}return request({'form':{'method':_0x58c3('0x23'),'input_type':_0x58c3('0x24'),'response_type':_0x58c3('0x24'),'rest_data':JSON[_0x58c3('0x25')]({'session':_0x34ef8a['id'],'module_name':_0x58c3('0x26'),'name_value_list':_0x43d770})}});}function getAuth(_0x4f48c1){return util[_0x58c3('0x27')]('Basic\x20%s',new Buffer(_0x4f48c1[_0x58c3('0x28')]+':X')[_0x58c3('0x29')](_0x58c3('0x2a')));}function getServerInfo(_0x162e1f){return request({'form':{'method':'get_server_info','input_type':_0x58c3('0x24'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x162e1f['id']})}});}function getUser(_0x483678,_0x283cb8,_0x58fdb9){if(!_[_0x58c3('0x2b')](_0x283cb8)){logger[_0x58c3('0xe')](_0x58c3('0x2c'),_0x283cb8);return request({'form':{'method':_0x58c3('0x2d'),'input_type':_0x58c3('0x24'),'response_type':_0x58c3('0x24'),'rest_data':JSON[_0x58c3('0x25')]({'session':_0x58fdb9['id'],'module_name':_0x58c3('0x2e'),'query':util[_0x58c3('0x27')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x283cb8),'order_by':'','offset':'0','select_fields':['id','name',_0x58c3('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x58c3('0x30')](function(_0x24c1dc){if(_0x24c1dc['entry_list'][_0x58c3('0x1f')]){var _0x2c08f9=_[_0x58c3('0x31')](_0x24c1dc[_0x58c3('0x32')],function(_0x1c7d5d){return _0x1c7d5d[_0x58c3('0x33')]['user_name'][_0x58c3('0x34')]===_0x283cb8;});if(_0x2c08f9){logger[_0x58c3('0xe')](_0x58c3('0x35'));return BPromise[_0x58c3('0x36')]({'id':_0x2c08f9[_0x58c3('0x33')]['id'][_0x58c3('0x34')],'name':_0x2c08f9['name_value_list'][_0x58c3('0x37')][_0x58c3('0x34')]});}}logger[_0x58c3('0xe')](_0x58c3('0x38'));return BPromise['resolve']({'id':_0x58fdb9[_0x58c3('0x33')][_0x58c3('0x39')]['value'],'name':_0x58fdb9[_0x58c3('0x33')][_0x58c3('0x2f')]['value']});});}else{logger[_0x58c3('0xe')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x58c3('0x36')]({'id':_0x58fdb9[_0x58c3('0x33')][_0x58c3('0x39')][_0x58c3('0x34')],'name':_0x58fdb9[_0x58c3('0x33')]['user_name']['value']});}}function getEndUser(_0x5278a9,_0x2e7f03,_0x3393f8,_0x4757c6){logger[_0x58c3('0xe')](_0x58c3('0x3a'),_0x3393f8);return request({'form':{'method':_0x58c3('0x2d'),'input_type':'JSON','response_type':_0x58c3('0x24'),'rest_data':JSON[_0x58c3('0x25')]({'session':_0x4757c6['id'],'module_name':_0x58c3('0x1c'),'query':util[_0x58c3('0x27')](_0x58c3('0x3b'),_0x3393f8),'order_by':'','offset':'0','select_fields':['id',_0x58c3('0x37'),_0x58c3('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x58c3('0x30')](function(_0x4f63c9){if(_0x4f63c9[_0x58c3('0x32')][_0x58c3('0x1f')]){var _0x47b159=_['find'](_0x4f63c9['entry_list'],function(_0x304ccf){return _0x304ccf[_0x58c3('0x33')]['phone_home']['value']===_0x3393f8;});if(_0x47b159){logger['info'](_0x58c3('0x3d'));return BPromise[_0x58c3('0x36')]({'id':_0x47b159['name_value_list']['id'][_0x58c3('0x34')],'name':_0x47b159['name_value_list']['name'][_0x58c3('0x34')],'phone':_0x47b159[_0x58c3('0x33')][_0x58c3('0x3c')][_0x58c3('0x34')]});}}else{logger[_0x58c3('0xe')](_0x58c3('0x3e'));return request({'form':{'method':_0x58c3('0x23'),'input_type':_0x58c3('0x24'),'response_type':_0x58c3('0x24'),'rest_data':JSON[_0x58c3('0x25')]({'session':_0x4757c6['id'],'module_name':_0x58c3('0x1c'),'name_value_list':[{'name':_0x58c3('0x3f'),'value':_0x2e7f03!==_0x58c3('0x40')?_0x2e7f03:util[_0x58c3('0x27')]('Caller\x20-\x20%s',_0x3393f8)},{'name':_0x58c3('0x3c'),'value':_0x3393f8}]})}})['then'](function(_0x1b80e8){logger[_0x58c3('0xe')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x1b80e8['id'],'name':_0x1b80e8['entry_list'][_0x58c3('0x3f')][_0x58c3('0x34')],'phone':_0x1b80e8[_0x58c3('0x32')]['phone_home'][_0x58c3('0x34')]});});}});}function request(_0x137d6c){logger[_0x58c3('0x41')]('[HTTP]',JSON['stringify'](_0x137d6c));return rp(_[_0x58c3('0x42')](def,_0x137d6c));}function getTags(_0x5d7fb0,_0x1008a6){var _0x5a45f2=[];if(_0x5d7fb0&&_0x5d7fb0[_0x58c3('0x1f')]>0x0){_0x5a45f2=_[_0x58c3('0x43')](_0x5d7fb0,_0x1008a6);}return _0x5a45f2;}function getCustomFields(_0x39c68c,_0x19152b){var _0xba97c5=[];var _0x4dc4df={'custom_fields':[]};if(_0x39c68c[_0x58c3('0x1f')]>0x0){_[_0x58c3('0x20')](_0x39c68c,function(_0x22779c){if(_0x22779c[_0x58c3('0x44')]===_0x58c3('0x45')&&_0x22779c['nameField']&&!_0x22779c[_0x58c3('0x46')]){_0x4dc4df[_0x22779c[_0x58c3('0x47')]['toLowerCase']()]=_0x22779c[_0x58c3('0x48')][_0x58c3('0x29')]();}else if(_0x22779c[_0x58c3('0x44')]==='string'&&_0x22779c[_0x58c3('0x49')]&&_0x22779c[_0x58c3('0x46')]){_0x4dc4df[_0x58c3('0x4a')]['push']({'id':_0x22779c[_0x58c3('0x49')],'value':_0x22779c[_0x58c3('0x48')][_0x58c3('0x29')]()});}else if(_0x22779c['type']===_0x58c3('0x4b')&&_0x22779c[_0x58c3('0x21')]&&_0x22779c['idField']&&_0x22779c[_0x58c3('0x46')]){_0x19152b[_0x22779c['variableName']]&&_0x4dc4df[_0x58c3('0x4a')][_0x58c3('0x22')]({'id':_0x22779c['idField'],'value':_0x19152b[_0x22779c[_0x58c3('0x21')]][_0x58c3('0x29')]()});}else if(_0x22779c[_0x58c3('0x44')]===_0x58c3('0x4c')&&_0x22779c[_0x58c3('0x4d')]&&_0x22779c[_0x58c3('0x4d')][_0x58c3('0x37')]&&_0x22779c[_0x58c3('0x49')]&&_0x22779c['customField']){_0x19152b[_0x22779c[_0x58c3('0x4d')][_0x58c3('0x37')][_0x58c3('0x4e')]()]&&_0x4dc4df['custom_fields']['push']({'id':_0x22779c[_0x58c3('0x49')],'value':_0x19152b[_0x22779c[_0x58c3('0x4d')][_0x58c3('0x37')][_0x58c3('0x4e')]()][_0x58c3('0x29')]()});}});}return _0x4dc4df;}function getConnection(_0x55cadb){return request({'method':_0x58c3('0xd'),'form':{'method':_0x58c3('0x4f'),'input_type':'JSON','response_type':_0x58c3('0x24'),'rest_data':JSON[_0x58c3('0x25')]({'user_auth':{'user_name':_0x55cadb[_0x58c3('0x50')],'password':_0x55cadb[_0x58c3('0x51')],'encryption':_0x58c3('0x52')},'application':_0x58c3('0x53')})}})[_0x58c3('0x30')](function(_0xd5eda2){var _0x2c04d1=_0xd5eda2;if(_0x2c04d1['id']){def['sessionID']=_0x2c04d1['id'];return BPromise[_0x58c3('0x36')](_0x2c04d1);}else{throw new Error(util[_0x58c3('0x27')](_0x58c3('0x54'),_0x55cadb['id']));}});}function setRelationship(_0x1955a9,_0x1a8ef7,_0x351a0c,_0x3d23f9){return request({'form':{'method':_0x58c3('0x55'),'input_type':_0x58c3('0x24'),'response_type':_0x58c3('0x24'),'rest_data':JSON[_0x58c3('0x25')]({'session':_0x1955a9['id'],'module_name':'Calls','module_id':_0x351a0c['id'],'link_field_name':_0x3d23f9,'related_ids':[_0x1a8ef7['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x58c3('0x56')]=function(_0x3484f7,_0x15f94,_0x2c692f,_0x841e1a,_0x5c6e55,_0x5999c9){var _0x78fe62,_0xabfbc7,_0xc9cb8b,_0x7ec433;_0x5999c9['remoteUri']=intUtil['stripTrailingSlash'](_0x5999c9[_0x58c3('0x57')]);_0x5999c9[_0x58c3('0x58')]=intUtil[_0x58c3('0x59')](_0x5999c9[_0x58c3('0x58')]);def[_0x58c3('0x5a')]=util[_0x58c3('0x27')]('%s/service/v4_1/rest.php',_0x5999c9[_0x58c3('0x57')]);if(_0x5c6e55&&_0x5c6e55[_0x58c3('0x5b')]){logger[_0x58c3('0xe')]('[QUEUE]','Recording\x20is\x20enabled!');_0x15f94[_0x58c3('0x5c')]=util[_0x58c3('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5999c9[_0x58c3('0x58')],_0x15f94[_0x58c3('0x5d')],md5(_0x15f94[_0x58c3('0x5d')]));}else{_0x15f94['recordingURL']='';}return getConnection(_0x5999c9)[_0x58c3('0x30')](function(_0x271ebd){_0x7ec433=_0x271ebd;return getUser(_0x5999c9,_0x841e1a['name'],_0x7ec433);})[_0x58c3('0x30')](function(_0x1ca1cb){_0x78fe62=_0x1ca1cb;logger[_0x58c3('0xe')](_0x58c3('0x5e'),_0x78fe62['id']);return getEndUser(_0x5999c9,_0x15f94[_0x58c3('0x5f')],_0x15f94[_0x58c3('0x60')],_0x7ec433);})['then'](function(_0x5bdf86){_0xabfbc7=_0x5bdf86;logger[_0x58c3('0xe')](_0x58c3('0x61'),_0xabfbc7['id']);return getTicket(_0x5999c9,_0x78fe62,_0xabfbc7,_0x2c692f,_0x15f94,_0x2c692f[_0x58c3('0x62')],_0x7ec433,_0x58c3('0x63'));})[_0x58c3('0x30')](function(_0x5ac977){_0xc9cb8b=_0x5ac977;logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0xc9cb8b['id']);return setRelationship(_0x7ec433,_0x78fe62,_0xc9cb8b,'users');})['then'](function(){return setRelationship(_0x7ec433,_0xabfbc7,_0xc9cb8b,_0x58c3('0x64'));})[_0x58c3('0x30')](function(){return getServerInfo(_0x7ec433);})[_0x58c3('0x30')](function(_0x37bcb2){var _0x505cf0=parseInt(_0x37bcb2[_0x58c3('0x65')][_0x58c3('0x66')](0x0));var _0x340321=util['format'](_0x58c3('0x67'),_0x5999c9['remoteUri'],_0xc9cb8b['id']);if(_0x505cf0>0x6){_0x340321=util[_0x58c3('0x27')](_0x58c3('0x68'),_0x5999c9[_0x58c3('0x57')],_0xc9cb8b['id']);}logger[_0x58c3('0xe')](_0x58c3('0x69'),_0x58c3('0x6a'));emit(util['format'](_0x58c3('0x6b'),_0x841e1a['name']),_0x58c3('0x6c'),{'uri':_0x340321});})[_0x58c3('0x6d')](function(_0x4199ce){logger[_0x58c3('0x6e')]('[QUEUE]',JSON[_0x58c3('0x25')](_0x4199ce));});};exports[_0x58c3('0x6f')]=function(_0x151d60,_0x4a4505,_0x531740,_0x3b81f6,_0x8efe76,_0x4a9972,_0x1d0ce9){var _0x325183,_0x18c03d,_0x3aac89,_0x4a72ef;_0x4a9972[_0x58c3('0x57')]=intUtil[_0x58c3('0x59')](_0x4a9972[_0x58c3('0x57')]);_0x4a9972[_0x58c3('0x58')]=intUtil['stripTrailingSlash'](_0x4a9972['serverUrl']);def['uri']=util[_0x58c3('0x27')](_0x58c3('0x70'),_0x4a9972[_0x58c3('0x57')]);if(_0x1d0ce9&&_0x1d0ce9[_0x58c3('0x71')]&&_0x1d0ce9['recordingFormat']!==_0x58c3('0x72')){logger[_0x58c3('0xe')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4505[_0x58c3('0x5c')]=util[_0x58c3('0x27')](_0x58c3('0x73'),_0x4a9972['serverUrl'],_0x4a4505[_0x58c3('0x5d')],md5(_0x4a4505[_0x58c3('0x5d')]));}return getConnection(_0x4a9972)[_0x58c3('0x30')](function(_0x3526f6){_0x4a72ef=_0x3526f6;return getUser(_0x4a9972,_0x3b81f6[_0x58c3('0x37')],_0x4a72ef);})[_0x58c3('0x30')](function(_0x3711e4){_0x325183=_0x3711e4;logger[_0x58c3('0xe')]('The\x20User\x20ID\x20is:',_0x325183['id']);return getEndUser(_0x4a9972,_0x4a4505[_0x58c3('0x74')],_0x4a4505[_0x58c3('0x75')],_0x4a72ef);})[_0x58c3('0x30')](function(_0x405153){_0x18c03d=_0x405153;logger[_0x58c3('0xe')](_0x58c3('0x61'),_0x18c03d['id']);return getTicket(_0x4a9972,_0x325183,_0x18c03d,_0x531740,_0x4a4505,_0x531740[_0x58c3('0x62')],_0x4a72ef,_0x58c3('0x76'));})[_0x58c3('0x30')](function(_0x3aa917){_0x3aac89=_0x3aa917;logger[_0x58c3('0xe')](_0x58c3('0x77'));logger[_0x58c3('0xe')]('The\x20Ticket\x20ID\x20is:',_0x3aac89['id']);return setRelationship(_0x4a72ef,_0x325183,_0x3aac89,_0x58c3('0x78'));})[_0x58c3('0x30')](function(){return setRelationship(_0x4a72ef,_0x18c03d,_0x3aac89,'contacts');})[_0x58c3('0x30')](function(){return getServerInfo(_0x4a72ef);})[_0x58c3('0x30')](function(_0x200af8){var _0x2c7376=parseInt(_0x200af8[_0x58c3('0x65')]['charAt'](0x0));var _0x1d123c=util[_0x58c3('0x27')](_0x58c3('0x67'),_0x4a9972[_0x58c3('0x57')],_0x3aac89['id']);if(_0x2c7376>0x6){_0x1d123c=util[_0x58c3('0x27')](_0x58c3('0x68'),_0x4a9972[_0x58c3('0x57')],_0x3aac89['id']);}logger['info'](_0x58c3('0x79'),_0x58c3('0x6a'));emit(util[_0x58c3('0x27')](_0x58c3('0x6b'),_0x3b81f6[_0x58c3('0x37')]),'trigger:browser:url',{'uri':_0x1d123c});})[_0x58c3('0x6d')](function(_0x1a7feb){logger['error'](_0x58c3('0x79'),JSON[_0x58c3('0x25')](_0x1a7feb));});};exports[_0x58c3('0x7a')]=function(_0x2f2460,_0x7b2e2,_0x582241,_0x2cd01e,_0x2d7504,_0x2a3292){var _0x5f36c7,_0x23b832,_0x515572,_0x30ed1f;_0x2a3292[_0x58c3('0x57')]=intUtil[_0x58c3('0x59')](_0x2a3292[_0x58c3('0x57')]);_0x2a3292[_0x58c3('0x58')]=intUtil[_0x58c3('0x59')](_0x2a3292[_0x58c3('0x58')]);def[_0x58c3('0x5a')]=util[_0x58c3('0x27')]('%s/service/v4_1/rest.php',_0x2a3292[_0x58c3('0x57')]);if(_0x2d7504&&_0x2d7504['monitor_format']){logger[_0x58c3('0xe')]('['+_0x7b2e2[_0x58c3('0x7b')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x7b2e2['recordingURL']=util[_0x58c3('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a3292[_0x58c3('0x58')],_0x7b2e2[_0x58c3('0x5d')],md5(_0x7b2e2[_0x58c3('0x5d')]));}else{_0x7b2e2[_0x58c3('0x5c')]='';}return getConnection(_0x2a3292)[_0x58c3('0x30')](function(_0x279c07){_0x30ed1f=_0x279c07;if(!_[_0x58c3('0x2b')](_0x2cd01e)){return getUser(_0x2a3292,_0x2cd01e[_0x58c3('0x37')],_0x30ed1f);}else{return getUser(_0x2a3292,null,_0x30ed1f);}})[_0x58c3('0x30')](function(_0x50c6d2){_0x5f36c7=_0x50c6d2;logger[_0x58c3('0xe')](_0x58c3('0x5e'),_0x5f36c7['id']);return getEndUser(_0x2a3292,_0x7b2e2[_0x58c3('0x5f')],_0x7b2e2[_0x58c3('0x60')],_0x30ed1f);})['then'](function(_0x5191a1){_0x23b832=_0x5191a1;logger[_0x58c3('0xe')]('The\x20Enduser\x20ID\x20is:',_0x23b832['id']);return getTicket(_0x2a3292,_0x5f36c7,_0x23b832,_0x582241,_0x7b2e2,_0x582241['Fields'],_0x30ed1f,'Inbound');})[_0x58c3('0x30')](function(_0x5c4226){_0x515572=_0x5c4226;logger[_0x58c3('0xe')](_0x58c3('0x77'));logger[_0x58c3('0xe')](_0x58c3('0x7c'),_0x515572['id']);return setRelationship(_0x30ed1f,_0x5f36c7,_0x515572,'users');})[_0x58c3('0x30')](function(){return setRelationship(_0x30ed1f,_0x23b832,_0x515572,'contacts');})['then'](function(){return getServerInfo(_0x30ed1f);})[_0x58c3('0x6d')](function(_0x3d665f){logger[_0x58c3('0x6e')]('['+_0x7b2e2[_0x58c3('0x7b')][_0x58c3('0x7d')]()+']',JSON[_0x58c3('0x25')](_0x3d665f));});};
\ No newline at end of file
index ba01312..5fb47f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64d6=['variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','customVariable','join','stripTrailingSlash','substring','lastIndexOf','isNil','test','lodash','util','getString','type','push'];(function(_0x19c883,_0x2098c7){var _0x202144=function(_0x5b1523){while(--_0x5b1523){_0x19c883['push'](_0x19c883['shift']());}};_0x202144(++_0x2098c7);}(_0x64d6,0x1b0));var _0x664d=function(_0x11ab1f,_0xdc3026){_0x11ab1f=_0x11ab1f-0x0;var _0x39009c=_0x64d6[_0x11ab1f];return _0x39009c;};'use strict';var _=require(_0x664d('0x0'));var util=require(_0x664d('0x1'));exports[_0x664d('0x2')]=function(_0x37cf62,_0x3398da,_0x35fb23){var _0x4f0f3e=[];if(_0x37cf62['length']>0x0){var _0xcd4f11=_['sortBy'](_0x37cf62,['id']);for(var _0x4a8628=0x0;_0x4a8628<_0xcd4f11['length'];_0x4a8628++){var _0x655976=_0xcd4f11[_0x4a8628];if(_0x655976[_0x664d('0x3')]==='string'){_0x4f0f3e[_0x664d('0x4')](_0x655976['content']);}else if(_0x655976['type']===_0x664d('0x5')&&_0x655976[_0x664d('0x6')]){_0x3398da[_0x655976['variableName']]&&_0x4f0f3e[_0x664d('0x4')](_0x3398da[_0x655976[_0x664d('0x6')]][_0x664d('0x7')]());}else if(_0x655976['type']==='customVariable'&&_0x655976[_0x664d('0x8')]&&_0x655976[_0x664d('0x8')][_0x664d('0x9')]){_0x3398da[_0x655976[_0x664d('0x8')][_0x664d('0x9')][_0x664d('0xa')]()]&&_0x4f0f3e[_0x664d('0x4')](_0x3398da[_0x655976[_0x664d('0x8')]['name']['toLowerCase']()]['toString']());}else if(_0x655976['type']===_0x664d('0xb')){if(_0x655976[_0x664d('0xc')]==='string'&&_0x655976[_0x664d('0xd')]){_0x4f0f3e[_0x664d('0x4')](util[_0x664d('0xe')](_0x664d('0xf'),_0x655976[_0x664d('0xd')],_0x655976['keyContent']));}else if(_0x655976[_0x664d('0xc')]===_0x664d('0x5')&&_0x655976['variableName']&&_0x655976[_0x664d('0xd')]){_0x3398da[_0x655976['variableName']]&&_0x4f0f3e[_0x664d('0x4')](util[_0x664d('0xe')](_0x664d('0xf'),_0x655976[_0x664d('0xd')],_0x3398da[_0x655976[_0x664d('0x6')]]));}else if(_0x655976[_0x664d('0xc')]===_0x664d('0x10')&&_0x655976[_0x664d('0x8')]&&_0x655976[_0x664d('0x8')][_0x664d('0x9')]&&_0x655976[_0x664d('0xd')]){_0x3398da[_0x655976[_0x664d('0x8')]['name']['toLowerCase']()]&&_0x4f0f3e[_0x664d('0x4')](util['format'](_0x664d('0xf'),_0x655976[_0x664d('0xd')],_0x3398da[_0x655976[_0x664d('0x8')][_0x664d('0x9')][_0x664d('0xa')]()]));}}}}return _0x4f0f3e[_0x664d('0x11')](_0x35fb23);};exports[_0x664d('0x12')]=function(_0x3b9054){var _0x4a12bb=_0x3b9054['slice'](-0x1);if(_0x4a12bb==='/'){_0x3b9054=_0x3b9054[_0x664d('0x13')](0x0,_0x3b9054[_0x664d('0x14')](_0x4a12bb));}return _0x3b9054;};exports['validateEmail']=function(_0x1e47be){if(!_[_0x664d('0x15')](_0x1e47be)&&_0x1e47be!==''){var _0xfdb825=/^(([^<>()\[\]\\.,;:\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 _0xfdb825[_0x664d('0x16')](String(_0x1e47be)[_0x664d('0xa')]());}else{return![];}};
\ No newline at end of file
+var _0xc8f5=['variable','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','sortBy','type','string','content','variableName','push','toString','Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','key','keyContent'];(function(_0x528575,_0x2e067d){var _0x3063b7=function(_0x1ee183){while(--_0x1ee183){_0x528575['push'](_0x528575['shift']());}};_0x3063b7(++_0x2e067d);}(_0xc8f5,0x1b8));var _0x5c8f=function(_0x425b19,_0x2dcf14){_0x425b19=_0x425b19-0x0;var _0x15ecab=_0xc8f5[_0x425b19];return _0x15ecab;};'use strict';var _=require(_0x5c8f('0x0'));var util=require(_0x5c8f('0x1'));exports['getString']=function(_0x5de041,_0x332ff7,_0x531153){var _0x4a5547=[];if(_0x5de041[_0x5c8f('0x2')]>0x0){var _0x305071=_[_0x5c8f('0x3')](_0x5de041,['id']);for(var _0x42668a=0x0;_0x42668a<_0x305071[_0x5c8f('0x2')];_0x42668a++){var _0x56b7e0=_0x305071[_0x42668a];if(_0x56b7e0[_0x5c8f('0x4')]===_0x5c8f('0x5')){_0x4a5547['push'](_0x56b7e0[_0x5c8f('0x6')]);}else if(_0x56b7e0[_0x5c8f('0x4')]==='variable'&&_0x56b7e0[_0x5c8f('0x7')]){_0x332ff7[_0x56b7e0[_0x5c8f('0x7')]]&&_0x4a5547[_0x5c8f('0x8')](_0x332ff7[_0x56b7e0[_0x5c8f('0x7')]][_0x5c8f('0x9')]());}else if(_0x56b7e0['type']==='customVariable'&&_0x56b7e0[_0x5c8f('0xa')]&&_0x56b7e0[_0x5c8f('0xa')][_0x5c8f('0xb')]){_0x332ff7[_0x56b7e0[_0x5c8f('0xa')][_0x5c8f('0xb')][_0x5c8f('0xc')]()]&&_0x4a5547['push'](_0x332ff7[_0x56b7e0[_0x5c8f('0xa')][_0x5c8f('0xb')][_0x5c8f('0xc')]()][_0x5c8f('0x9')]());}else if(_0x56b7e0['type']===_0x5c8f('0xd')){if(_0x56b7e0[_0x5c8f('0xe')]==='string'&&_0x56b7e0['key']){_0x4a5547[_0x5c8f('0x8')](util[_0x5c8f('0xf')](_0x5c8f('0x10'),_0x56b7e0[_0x5c8f('0x11')],_0x56b7e0[_0x5c8f('0x12')]));}else if(_0x56b7e0[_0x5c8f('0xe')]===_0x5c8f('0x13')&&_0x56b7e0[_0x5c8f('0x7')]&&_0x56b7e0[_0x5c8f('0x11')]){_0x332ff7[_0x56b7e0[_0x5c8f('0x7')]]&&_0x4a5547[_0x5c8f('0x8')](util[_0x5c8f('0xf')]('%s:\x20%s',_0x56b7e0[_0x5c8f('0x11')],_0x332ff7[_0x56b7e0[_0x5c8f('0x7')]]));}else if(_0x56b7e0[_0x5c8f('0xe')]==='customVariable'&&_0x56b7e0['Variable']&&_0x56b7e0['Variable'][_0x5c8f('0xb')]&&_0x56b7e0[_0x5c8f('0x11')]){_0x332ff7[_0x56b7e0['Variable'][_0x5c8f('0xb')][_0x5c8f('0xc')]()]&&_0x4a5547[_0x5c8f('0x8')](util['format'](_0x5c8f('0x10'),_0x56b7e0[_0x5c8f('0x11')],_0x332ff7[_0x56b7e0[_0x5c8f('0xa')][_0x5c8f('0xb')]['toLowerCase']()]));}}}}return _0x4a5547[_0x5c8f('0x14')](_0x531153);};exports['stripTrailingSlash']=function(_0xcfc715){var _0x155f24=_0xcfc715[_0x5c8f('0x15')](-0x1);if(_0x155f24==='/'){_0xcfc715=_0xcfc715[_0x5c8f('0x16')](0x0,_0xcfc715[_0x5c8f('0x17')](_0x155f24));}return _0xcfc715;};exports[_0x5c8f('0x18')]=function(_0x674ca1){if(!_[_0x5c8f('0x19')](_0x674ca1)&&_0x674ca1!==''){var _0x1264fe=/^(([^<>()\[\]\\.,;:\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 _0x1264fe[_0x5c8f('0x1a')](String(_0x674ca1)[_0x5c8f('0xc')]());}else{return![];}};
\ No newline at end of file
index 709f25f..1933393 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(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x158e2a,_0x269716){var _0x514c14=function(_0x2bbc6d){while(--_0x2bbc6d){_0x158e2a['push'](_0x158e2a['shift']());}};_0x514c14(++_0x269716);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});};
\ No newline at end of file
index 769deda..127f742 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cab=['toLowerCase','content','picklist','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','replace','unmanaged','monitor_format','lastevent','toUpperCase','Authorization','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','map','forEach','includes','string','type','nameField','customField'];(function(_0x2e3d60,_0x1f83f9){var _0x4a2d3c=function(_0x374054){while(--_0x374054){_0x2e3d60['push'](_0x2e3d60['shift']());}};_0x4a2d3c(++_0x1f83f9);}(_0x9cab,0x11b));var _0xb9ca=function(_0x25357a,_0x37a02c){_0x25357a=_0x25357a-0x0;var _0x257fc1=_0x9cab[_0x25357a];return _0x257fc1;};'use strict';var _=require(_0xb9ca('0x0'));var rp=require(_0xb9ca('0x1'));var md5=require(_0xb9ca('0x2'));var util=require(_0xb9ca('0x3'));var Redis=require(_0xb9ca('0x4'));var intUtil=require(_0xb9ca('0x5'));var config=require(_0xb9ca('0x6'));var logger=require(_0xb9ca('0x7'))(_0xb9ca('0x8'));config[_0xb9ca('0x9')]=_[_0xb9ca('0xa')](config[_0xb9ca('0x9')],{'host':_0xb9ca('0xb'),'port':0x18eb});var io=require(_0xb9ca('0xc'))(new Redis(config[_0xb9ca('0x9')]));function emit(_0xc3e321,_0x167fec,_0x553aab){io['to'](_0xc3e321)[_0xb9ca('0xd')](_0x167fec,_0x553aab);}var headers={'Content-Type':_0xb9ca('0xe'),'Accept':'application/json'};function getTicket(_0x4c77b4,_0x1f1c04,_0x357df1,_0x2625cb,_0x424a80){logger['info'](_0xb9ca('0xf'));return request({'uri':util[_0xb9ca('0x10')](_0xb9ca('0x11'),_0x4c77b4[_0xb9ca('0x12')]),'method':_0xb9ca('0x13'),'body':{'ticket':_[_0xb9ca('0x14')]({'requester_id':_0x357df1['id'],'submitter_id':_0x1f1c04?_0x1f1c04['id']:undefined,'assignee_id':_0x1f1c04?_0x1f1c04['id']:undefined,'tags':getTags(_0x2625cb[_0xb9ca('0x15')],_0xb9ca('0x16')),'subject':intUtil[_0xb9ca('0x17')](_0x2625cb[_0xb9ca('0x18')],_0x424a80,'\x20'),'description':intUtil[_0xb9ca('0x17')](_0x2625cb[_0xb9ca('0x19')],_0x424a80,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb9ca('0x17')](_0x2625cb[_0xb9ca('0x19')],_0x424a80,'\x0a')}},getCustomFields(_0x2625cb[_0xb9ca('0x1a')],_0x424a80))}})[_0xb9ca('0x1b')](function(_0x1d2ec9){logger[_0xb9ca('0x1c')](_0xb9ca('0x1d'));return _0x1d2ec9[_0xb9ca('0x1e')];});}function getUser(_0x3f0799,_0x67aa6d){if(intUtil[_0xb9ca('0x1f')](_0x67aa6d)){logger[_0xb9ca('0x1c')]('Getting\x20agent\x20with\x20email',_0x67aa6d);return request({'uri':util[_0xb9ca('0x10')](_0xb9ca('0x20'),_0x3f0799[_0xb9ca('0x12')]),'qs':{'query':util[_0xb9ca('0x10')](_0xb9ca('0x21'),_0x67aa6d)}})['then'](function(_0x13e566){if(_0x13e566[_0xb9ca('0x22')]){logger[_0xb9ca('0x1c')](_0xb9ca('0x23'));return _['find'](_0x13e566[_0xb9ca('0x24')],{'email':_0x67aa6d,'role':'agent'});}else{logger['info'](_0xb9ca('0x25'));return request({'uri':util[_0xb9ca('0x10')]('%s/users/me.json',_0x3f0799['remoteUri'])})[_0xb9ca('0x1b')](function(_0x41772c){logger['info'](_0xb9ca('0x26'));return _0x41772c[_0xb9ca('0x27')];});}});}else{logger['info'](_0xb9ca('0x25'));return request({'uri':util[_0xb9ca('0x10')](_0xb9ca('0x28'),_0x3f0799['remoteUri'])})[_0xb9ca('0x1b')](function(_0x3212ae){logger[_0xb9ca('0x1c')](_0xb9ca('0x26'));return _0x3212ae[_0xb9ca('0x27')];});}}function getEndUser(_0x539bf7,_0x49cfa2,_0x500ece){logger[_0xb9ca('0x1c')](_0xb9ca('0x29'),_0x500ece);return request({'uri':util[_0xb9ca('0x10')](_0xb9ca('0x20'),_0x539bf7[_0xb9ca('0x12')]),'qs':{'query':util[_0xb9ca('0x10')](_0xb9ca('0x2a'),_0x500ece)}})[_0xb9ca('0x1b')](function(_0x3d4d8f){var _0x334bc3;if(_0x3d4d8f[_0xb9ca('0x24')][_0xb9ca('0x2b')]){_0x3d4d8f[_0xb9ca('0x24')]=_[_0xb9ca('0x2c')](_0x3d4d8f['results'],{'suspended':![],'role':_0xb9ca('0x2d')});if(_0x3d4d8f[_0xb9ca('0x24')][_0xb9ca('0x2b')]){_0x334bc3=_[_0xb9ca('0x2e')](_0x3d4d8f[_0xb9ca('0x24')]);}}if(_0x334bc3){logger[_0xb9ca('0x1c')](_0xb9ca('0x2f'));return _0x334bc3;}else{logger[_0xb9ca('0x1c')](_0xb9ca('0x30'));return request({'uri':util[_0xb9ca('0x10')](_0xb9ca('0x31'),_0x539bf7[_0xb9ca('0x12')]),'method':_0xb9ca('0x13'),'body':{'user':{'role':'end-user','name':util['format'](_0xb9ca('0x32'),_0x49cfa2||_0x500ece),'phone':_0x500ece}}})[_0xb9ca('0x1b')](function(_0xa0fcef){logger['info']('Enduser\x20created.');return _0xa0fcef[_0xb9ca('0x27')];});}});}function getAuth(_0x2be910){var _0x55856a;if(_0x2be910[_0xb9ca('0x33')]==='password'){_0x55856a=util[_0xb9ca('0x10')](_0xb9ca('0x34'),_0x2be910[_0xb9ca('0x35')],_0x2be910['password']);}else if(_0x2be910[_0xb9ca('0x33')]===_0xb9ca('0x36')){_0x55856a=util[_0xb9ca('0x10')](_0xb9ca('0x37'),_0x2be910[_0xb9ca('0x35')],_0x2be910['token']);}return util[_0xb9ca('0x10')](_0xb9ca('0x38'),new Buffer(_0x55856a)[_0xb9ca('0x39')](_0xb9ca('0x3a')));}function request(_0x448acc){logger['debug'](_0xb9ca('0x3b'),JSON[_0xb9ca('0x3c')](_0x448acc));return rp(_[_0xb9ca('0xa')](_0x448acc,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5504f6,_0x4f5768){var _0x232098=[];if(_0x5504f6&&_0x5504f6[_0xb9ca('0x2b')]>0x0){_0x232098=_[_0xb9ca('0x3d')](_0x5504f6,_0x4f5768);}return _0x232098;}function getCustomFields(_0x5ea8ba,_0x24dd4d){var _0x79ddc1=[];var _0x5dcaaf={'custom_fields':[]};if(_0x5ea8ba[_0xb9ca('0x2b')]>0x0){_[_0xb9ca('0x3e')](_0x5ea8ba,function(_0x5c11e5){if(_[_0xb9ca('0x3f')]([_0xb9ca('0x40'),'picklist'],_0x5c11e5[_0xb9ca('0x41')])&&_0x5c11e5[_0xb9ca('0x42')]&&!_0x5c11e5[_0xb9ca('0x43')]){_0x5dcaaf[_0x5c11e5[_0xb9ca('0x42')][_0xb9ca('0x44')]()]=_0x5c11e5[_0xb9ca('0x45')][_0xb9ca('0x39')]();}else if(_['includes']([_0xb9ca('0x40'),_0xb9ca('0x46')],_0x5c11e5['type'])&&_0x5c11e5[_0xb9ca('0x47')]&&_0x5c11e5[_0xb9ca('0x43')]){_0x5dcaaf[_0xb9ca('0x48')][_0xb9ca('0x49')]({'id':_0x5c11e5[_0xb9ca('0x47')],'value':_0x5c11e5[_0xb9ca('0x45')][_0xb9ca('0x39')]()});}else if(_0x5c11e5[_0xb9ca('0x41')]===_0xb9ca('0x4a')&&_0x5c11e5[_0xb9ca('0x4b')]&&_0x5c11e5['idField']&&_0x5c11e5[_0xb9ca('0x43')]){_0x24dd4d[_0x5c11e5[_0xb9ca('0x4b')]]&&_0x5dcaaf[_0xb9ca('0x48')][_0xb9ca('0x49')]({'id':_0x5c11e5['idField'],'value':_0x24dd4d[_0x5c11e5[_0xb9ca('0x4b')]][_0xb9ca('0x39')]()});}else if(_0x5c11e5[_0xb9ca('0x41')]===_0xb9ca('0x4c')&&_0x5c11e5['Variable']&&_0x5c11e5[_0xb9ca('0x4d')][_0xb9ca('0x16')]&&_0x5c11e5[_0xb9ca('0x47')]&&_0x5c11e5[_0xb9ca('0x43')]){_0x24dd4d[_0x5c11e5[_0xb9ca('0x4d')][_0xb9ca('0x16')][_0xb9ca('0x44')]()]&&_0x5dcaaf[_0xb9ca('0x48')][_0xb9ca('0x49')]({'id':_0x5c11e5[_0xb9ca('0x47')],'value':_0x24dd4d[_0x5c11e5['Variable'][_0xb9ca('0x16')][_0xb9ca('0x44')]()][_0xb9ca('0x39')]()});}});}return _0x5dcaaf;}exports[_0xb9ca('0x4e')]=function(_0x38a99f,_0x51d162,_0x56fa58,_0x50a221,_0x26df0f,_0x49edb4){var _0x288dea,_0x40d497;_0x49edb4[_0xb9ca('0x12')]=intUtil['stripTrailingSlash'](_0x49edb4[_0xb9ca('0x12')]);_0x49edb4[_0xb9ca('0x4f')]=intUtil[_0xb9ca('0x50')](_0x49edb4[_0xb9ca('0x4f')]);if(_0x26df0f&&_0x26df0f['monitor_format']){logger['info'](_0xb9ca('0x51'),'Recording\x20is\x20enabled!');_0x51d162[_0xb9ca('0x52')]=util['format'](_0xb9ca('0x53'),_0x49edb4['serverUrl'],_0x51d162[_0xb9ca('0x54')],md5(_0x51d162[_0xb9ca('0x54')]));}else{_0x51d162['recordingURL']='';}headers['Authorization']=getAuth(_0x49edb4);return getUser(_0x49edb4,_0x50a221['email'])[_0xb9ca('0x1b')](function(_0x1d7834){_0x288dea=_0x1d7834;logger[_0xb9ca('0x1c')]('The\x20User\x20ID\x20is:',_0x288dea['id']);return getEndUser(_0x49edb4,_0x51d162['calleridname'],_0x51d162[_0xb9ca('0x55')]);})['then'](function(_0x48a05d){_0x40d497=_0x48a05d;logger[_0xb9ca('0x1c')](_0xb9ca('0x56'),_0x40d497['id']);return getTicket(_0x49edb4,_0x288dea,_0x40d497,_0x56fa58,_0x51d162);})[_0xb9ca('0x1b')](function(_0x446a3f){if(_0x446a3f){logger['info'](_0xb9ca('0x57'),_0x446a3f['id']);switch(_0x49edb4[_0xb9ca('0x41')]){case'integrationTab':logger[_0xb9ca('0x1c')](_0xb9ca('0x51'),_0xb9ca('0x58'));return request({'uri':util[_0xb9ca('0x10')](_0xb9ca('0x59'),_0x49edb4['remoteUri'],_0x288dea['id'],_0x446a3f['id']),'method':_0xb9ca('0x13')});case _0xb9ca('0x5a'):logger['info'](_0xb9ca('0x51'),_0xb9ca('0x5b'));emit(util['format'](_0xb9ca('0x5c'),_0x50a221['name']),_0xb9ca('0x5d'),{'uri':util['format'](_0xb9ca('0x5e'),_0x49edb4['remoteUri']['replace'](_0xb9ca('0x5f'),''),_0x446a3f['id'])});break;default:logger[_0xb9ca('0x60')]('[QUEUE]',_0xb9ca('0x61'));}}})[_0xb9ca('0x62')](function(_0x2a147a){logger[_0xb9ca('0x60')](_0xb9ca('0x63'),util[_0xb9ca('0x64')](_0x2a147a,{'showHidden':!![],'depth':null}));});};exports[_0xb9ca('0x65')]=function(_0x1e2ed7,_0x343d47,_0x305863,_0x232426,_0x41d6cb,_0x42efad,_0x183b72){var _0x1bbd21,_0x343301;_0x42efad[_0xb9ca('0x12')]=intUtil[_0xb9ca('0x50')](_0x42efad['remoteUri']);_0x42efad[_0xb9ca('0x4f')]=intUtil[_0xb9ca('0x50')](_0x42efad['serverUrl']);if(_0x183b72&&_0x183b72[_0xb9ca('0x66')]&&_0x183b72[_0xb9ca('0x66')]!=='none'){logger[_0xb9ca('0x1c')](_0xb9ca('0x67'),_0xb9ca('0x68'));_0x343d47['recordingURL']=util[_0xb9ca('0x10')](_0xb9ca('0x53'),_0x42efad['serverUrl'],_0x343d47[_0xb9ca('0x54')],md5(_0x343d47['uniqueid']));}headers['Authorization']=getAuth(_0x42efad);return getUser(_0x42efad,_0x232426[_0xb9ca('0x69')])[_0xb9ca('0x1b')](function(_0x3f104b){_0x1bbd21=_0x3f104b;logger[_0xb9ca('0x1c')](_0xb9ca('0x6a'),_0x1bbd21['id']);return getEndUser(_0x42efad,_0x343d47[_0xb9ca('0x6b')],_0x343d47[_0xb9ca('0x6c')]);})[_0xb9ca('0x1b')](function(_0x2ad791){_0x343301=_0x2ad791;logger[_0xb9ca('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x343301['id']);return getTicket(_0x42efad,_0x1bbd21,_0x343301,_0x305863,_0x343d47);})['then'](function(_0x4e37b6){if(_0x4e37b6){logger[_0xb9ca('0x1c')](_0xb9ca('0x57'),_0x4e37b6['id']);switch(_0x42efad[_0xb9ca('0x41')]){case'integrationTab':logger['info'](_0xb9ca('0x67'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xb9ca('0x59'),_0x42efad['remoteUri'],_0x1bbd21['id'],_0x4e37b6['id']),'method':'POST'});case _0xb9ca('0x5a'):logger['info'](_0xb9ca('0x67'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb9ca('0x5c'),_0x232426['name']),_0xb9ca('0x5d'),{'uri':util['format'](_0xb9ca('0x5e'),_0x42efad[_0xb9ca('0x12')][_0xb9ca('0x6d')]('/api/v2',''),_0x4e37b6['id'])});break;default:logger['error'](_0xb9ca('0x67'),_0xb9ca('0x61'));}}})[_0xb9ca('0x62')](function(_0x1b2995){logger[_0xb9ca('0x60')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xb9ca('0x64')](_0x1b2995,{'showHidden':!![],'depth':null}));});};exports[_0xb9ca('0x6e')]=function(_0x1abb59,_0x253589,_0x341c95,_0x1416ce,_0x4ac3ad,_0x2e0efb){var _0x489fe3,_0x24dc9f;_0x2e0efb['remoteUri']=intUtil[_0xb9ca('0x50')](_0x2e0efb[_0xb9ca('0x12')]);_0x2e0efb['serverUrl']=intUtil[_0xb9ca('0x50')](_0x2e0efb[_0xb9ca('0x4f')]);if(_0x4ac3ad&&_0x4ac3ad[_0xb9ca('0x6f')]){logger[_0xb9ca('0x1c')]('['+_0x253589[_0xb9ca('0x70')][_0xb9ca('0x71')]()+']',_0xb9ca('0x68'));_0x253589[_0xb9ca('0x52')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e0efb[_0xb9ca('0x4f')],_0x253589[_0xb9ca('0x54')],md5(_0x253589['uniqueid']));}else{_0x253589[_0xb9ca('0x52')]='';}headers[_0xb9ca('0x72')]=getAuth(_0x2e0efb);return getUser(_0x2e0efb)[_0xb9ca('0x1b')](function(_0x41aa5){_0x489fe3=_0x41aa5;logger[_0xb9ca('0x1c')](_0xb9ca('0x6a'),_0x489fe3['id']);return getEndUser(_0x2e0efb,_0x253589[_0xb9ca('0x73')],_0x253589['calleridnum']);})[_0xb9ca('0x1b')](function(_0x198d2e){_0x24dc9f=_0x198d2e;logger[_0xb9ca('0x1c')](_0xb9ca('0x56'),_0x24dc9f['id']);return getTicket(_0x2e0efb,_0x489fe3,_0x24dc9f,_0x341c95,_0x253589);})[_0xb9ca('0x1b')](function(_0x316bab){if(_0x316bab){logger[_0xb9ca('0x1c')](_0xb9ca('0x57'),_0x316bab['id']);}})[_0xb9ca('0x62')](function(_0x1c14aa){logger[_0xb9ca('0x60')]('['+_0x253589[_0xb9ca('0x70')][_0xb9ca('0x71')]()+']'+_0xb9ca('0x74'),util['inspect'](_0x1c14aa,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xcc4a=['toUpperCase','calleridnum','The\x20Ticket\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','merge','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','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','%s/token:%s','base64','debug','[HTTP]','stringify','GET','includes','string','picklist','nameField','customField','toLowerCase','content','toString','type','idField','custom_fields','push','variableName','Variable','name','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:','calleridname','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','POST','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent'];(function(_0x33de65,_0x8d6924){var _0x36141e=function(_0x5c6f74){while(--_0x5c6f74){_0x33de65['push'](_0x33de65['shift']());}};_0x36141e(++_0x8d6924);}(_0xcc4a,0x74));var _0xacc4=function(_0x27f40c,_0x39b33e){_0x27f40c=_0x27f40c-0x0;var _0x33b083=_0xcc4a[_0x27f40c];return _0x33b083;};'use strict';var _=require(_0xacc4('0x0'));var rp=require(_0xacc4('0x1'));var md5=require(_0xacc4('0x2'));var util=require(_0xacc4('0x3'));var Redis=require(_0xacc4('0x4'));var intUtil=require(_0xacc4('0x5'));var config=require(_0xacc4('0x6'));var logger=require(_0xacc4('0x7'))(_0xacc4('0x8'));config[_0xacc4('0x9')]=_[_0xacc4('0xa')](config[_0xacc4('0x9')],{'host':_0xacc4('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xacc4('0x9')]));function emit(_0x4fc010,_0x25beef,_0xeb570d){io['to'](_0x4fc010)[_0xacc4('0xc')](_0x25beef,_0xeb570d);}var headers={'Content-Type':_0xacc4('0xd'),'Accept':_0xacc4('0xd')};function getTicket(_0x2aa865,_0x15588a,_0x4aaf1f,_0x4f75b0,_0x168738){logger[_0xacc4('0xe')](_0xacc4('0xf'));return request({'uri':util[_0xacc4('0x10')]('%s/tickets.json',_0x2aa865[_0xacc4('0x11')]),'method':'POST','body':{'ticket':_[_0xacc4('0x12')]({'requester_id':_0x4aaf1f['id'],'submitter_id':_0x15588a?_0x15588a['id']:undefined,'assignee_id':_0x15588a?_0x15588a['id']:undefined,'tags':getTags(_0x4f75b0['Tags'],'name'),'subject':intUtil[_0xacc4('0x13')](_0x4f75b0[_0xacc4('0x14')],_0x168738,'\x20'),'description':intUtil[_0xacc4('0x13')](_0x4f75b0[_0xacc4('0x15')],_0x168738,'\x0a'),'comment':{'public':![],'body':intUtil[_0xacc4('0x13')](_0x4f75b0[_0xacc4('0x15')],_0x168738,'\x0a')}},getCustomFields(_0x4f75b0[_0xacc4('0x16')],_0x168738))}})[_0xacc4('0x17')](function(_0x1087ea){logger[_0xacc4('0xe')](_0xacc4('0x18'));return _0x1087ea['ticket'];});}function getUser(_0x3a6841,_0x5e6566){if(intUtil[_0xacc4('0x19')](_0x5e6566)){logger[_0xacc4('0xe')](_0xacc4('0x1a'),_0x5e6566);return request({'uri':util[_0xacc4('0x10')](_0xacc4('0x1b'),_0x3a6841[_0xacc4('0x11')]),'qs':{'query':util[_0xacc4('0x10')](_0xacc4('0x1c'),_0x5e6566)}})['then'](function(_0x421aef){if(_0x421aef[_0xacc4('0x1d')]){logger[_0xacc4('0xe')](_0xacc4('0x1e'));return _['find'](_0x421aef[_0xacc4('0x1f')],{'email':_0x5e6566,'role':_0xacc4('0x20')});}else{logger['info'](_0xacc4('0x21'));return request({'uri':util[_0xacc4('0x10')](_0xacc4('0x22'),_0x3a6841[_0xacc4('0x11')])})['then'](function(_0x2f4b27){logger[_0xacc4('0xe')](_0xacc4('0x23'));return _0x2f4b27[_0xacc4('0x24')];});}});}else{logger[_0xacc4('0xe')](_0xacc4('0x21'));return request({'uri':util[_0xacc4('0x10')](_0xacc4('0x22'),_0x3a6841[_0xacc4('0x11')])})['then'](function(_0x68497b){logger[_0xacc4('0xe')](_0xacc4('0x23'));return _0x68497b['user'];});}}function getEndUser(_0x7ba429,_0x1ecc1b,_0x895cb8){logger[_0xacc4('0xe')](_0xacc4('0x25'),_0x895cb8);return request({'uri':util['format'](_0xacc4('0x1b'),_0x7ba429[_0xacc4('0x11')]),'qs':{'query':util[_0xacc4('0x10')](_0xacc4('0x26'),_0x895cb8)}})[_0xacc4('0x17')](function(_0x363005){var _0x9233ab;if(_0x363005[_0xacc4('0x1f')][_0xacc4('0x27')]){_0x363005[_0xacc4('0x1f')]=_[_0xacc4('0x28')](_0x363005[_0xacc4('0x1f')],{'suspended':![],'role':'end-user'});if(_0x363005[_0xacc4('0x1f')]['length']){_0x9233ab=_[_0xacc4('0x29')](_0x363005[_0xacc4('0x1f')]);}}if(_0x9233ab){logger[_0xacc4('0xe')]('Enduser\x20found!');return _0x9233ab;}else{logger[_0xacc4('0xe')](_0xacc4('0x2a'));return request({'uri':util[_0xacc4('0x10')](_0xacc4('0x2b'),_0x7ba429[_0xacc4('0x11')]),'method':'POST','body':{'user':{'role':_0xacc4('0x2c'),'name':util[_0xacc4('0x10')](_0xacc4('0x2d'),_0x1ecc1b||_0x895cb8),'phone':_0x895cb8}}})[_0xacc4('0x17')](function(_0x1a8746){logger['info'](_0xacc4('0x2e'));return _0x1a8746[_0xacc4('0x24')];});}});}function getAuth(_0x201232){var _0x5d7654;if(_0x201232[_0xacc4('0x2f')]===_0xacc4('0x30')){_0x5d7654=util[_0xacc4('0x10')](_0xacc4('0x31'),_0x201232[_0xacc4('0x32')],_0x201232[_0xacc4('0x30')]);}else if(_0x201232['authType']===_0xacc4('0x33')){_0x5d7654=util[_0xacc4('0x10')](_0xacc4('0x34'),_0x201232[_0xacc4('0x32')],_0x201232['token']);}return util[_0xacc4('0x10')]('Basic\x20%s',new Buffer(_0x5d7654)['toString'](_0xacc4('0x35')));}function request(_0x2879e6){logger[_0xacc4('0x36')](_0xacc4('0x37'),JSON[_0xacc4('0x38')](_0x2879e6));return rp(_[_0xacc4('0xa')](_0x2879e6,{'method':_0xacc4('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x2a0fe6,_0x43b7ba){var _0x41acbc=[];if(_0x2a0fe6&&_0x2a0fe6[_0xacc4('0x27')]>0x0){_0x41acbc=_['map'](_0x2a0fe6,_0x43b7ba);}return _0x41acbc;}function getCustomFields(_0x4ceea3,_0x4ff218){var _0x2e5b26=[];var _0x181692={'custom_fields':[]};if(_0x4ceea3[_0xacc4('0x27')]>0x0){_['forEach'](_0x4ceea3,function(_0x29dd7b){if(_[_0xacc4('0x3a')]([_0xacc4('0x3b'),_0xacc4('0x3c')],_0x29dd7b['type'])&&_0x29dd7b[_0xacc4('0x3d')]&&!_0x29dd7b[_0xacc4('0x3e')]){_0x181692[_0x29dd7b[_0xacc4('0x3d')][_0xacc4('0x3f')]()]=_0x29dd7b[_0xacc4('0x40')][_0xacc4('0x41')]();}else if(_[_0xacc4('0x3a')]([_0xacc4('0x3b'),'picklist'],_0x29dd7b[_0xacc4('0x42')])&&_0x29dd7b[_0xacc4('0x43')]&&_0x29dd7b['customField']){_0x181692[_0xacc4('0x44')][_0xacc4('0x45')]({'id':_0x29dd7b[_0xacc4('0x43')],'value':_0x29dd7b['content'][_0xacc4('0x41')]()});}else if(_0x29dd7b['type']==='variable'&&_0x29dd7b[_0xacc4('0x46')]&&_0x29dd7b['idField']&&_0x29dd7b[_0xacc4('0x3e')]){_0x4ff218[_0x29dd7b[_0xacc4('0x46')]]&&_0x181692[_0xacc4('0x44')][_0xacc4('0x45')]({'id':_0x29dd7b[_0xacc4('0x43')],'value':_0x4ff218[_0x29dd7b[_0xacc4('0x46')]]['toString']()});}else if(_0x29dd7b[_0xacc4('0x42')]==='customVariable'&&_0x29dd7b['Variable']&&_0x29dd7b['Variable']['name']&&_0x29dd7b[_0xacc4('0x43')]&&_0x29dd7b['customField']){_0x4ff218[_0x29dd7b[_0xacc4('0x47')][_0xacc4('0x48')][_0xacc4('0x3f')]()]&&_0x181692[_0xacc4('0x44')]['push']({'id':_0x29dd7b[_0xacc4('0x43')],'value':_0x4ff218[_0x29dd7b[_0xacc4('0x47')][_0xacc4('0x48')][_0xacc4('0x3f')]()][_0xacc4('0x41')]()});}});}return _0x181692;}exports[_0xacc4('0x49')]=function(_0x324bf3,_0x14f248,_0x3703e9,_0x4ef999,_0x50b368,_0x2a2d41){var _0x59bef3,_0x1c4f21;_0x2a2d41['remoteUri']=intUtil[_0xacc4('0x4a')](_0x2a2d41[_0xacc4('0x11')]);_0x2a2d41[_0xacc4('0x4b')]=intUtil['stripTrailingSlash'](_0x2a2d41[_0xacc4('0x4b')]);if(_0x50b368&&_0x50b368[_0xacc4('0x4c')]){logger['info'](_0xacc4('0x4d'),_0xacc4('0x4e'));_0x14f248['recordingURL']=util[_0xacc4('0x10')](_0xacc4('0x4f'),_0x2a2d41['serverUrl'],_0x14f248[_0xacc4('0x50')],md5(_0x14f248[_0xacc4('0x50')]));}else{_0x14f248[_0xacc4('0x51')]='';}headers[_0xacc4('0x52')]=getAuth(_0x2a2d41);return getUser(_0x2a2d41,_0x4ef999[_0xacc4('0x53')])[_0xacc4('0x17')](function(_0x46b647){_0x59bef3=_0x46b647;logger[_0xacc4('0xe')](_0xacc4('0x54'),_0x59bef3['id']);return getEndUser(_0x2a2d41,_0x14f248[_0xacc4('0x55')],_0x14f248['calleridnum']);})[_0xacc4('0x17')](function(_0x256323){_0x1c4f21=_0x256323;logger[_0xacc4('0xe')](_0xacc4('0x56'),_0x1c4f21['id']);return getTicket(_0x2a2d41,_0x59bef3,_0x1c4f21,_0x3703e9,_0x14f248);})['then'](function(_0x3a497b){if(_0x3a497b){logger['info']('The\x20Ticket\x20ID\x20is:',_0x3a497b['id']);switch(_0x2a2d41['type']){case _0xacc4('0x57'):logger[_0xacc4('0xe')](_0xacc4('0x4d'),_0xacc4('0x58'));return request({'uri':util[_0xacc4('0x10')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2a2d41[_0xacc4('0x11')],_0x59bef3['id'],_0x3a497b['id']),'method':_0xacc4('0x59')});case _0xacc4('0x5a'):logger[_0xacc4('0xe')](_0xacc4('0x4d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xacc4('0x10')](_0xacc4('0x5b'),_0x4ef999['name']),_0xacc4('0x5c'),{'uri':util['format'](_0xacc4('0x5d'),_0x2a2d41[_0xacc4('0x11')][_0xacc4('0x5e')](_0xacc4('0x5f'),''),_0x3a497b['id'])});break;default:logger[_0xacc4('0x60')](_0xacc4('0x4d'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xacc4('0x61')](function(_0x3948fa){logger['error'](_0xacc4('0x62'),util[_0xacc4('0x63')](_0x3948fa,{'showHidden':!![],'depth':null}));});};exports[_0xacc4('0x64')]=function(_0x307504,_0x24a64f,_0x4dd58a,_0x27f366,_0x4537d1,_0xa60fd6,_0x1b364c){var _0x169cd2,_0x45510d;_0xa60fd6[_0xacc4('0x11')]=intUtil[_0xacc4('0x4a')](_0xa60fd6[_0xacc4('0x11')]);_0xa60fd6[_0xacc4('0x4b')]=intUtil['stripTrailingSlash'](_0xa60fd6[_0xacc4('0x4b')]);if(_0x1b364c&&_0x1b364c[_0xacc4('0x65')]&&_0x1b364c[_0xacc4('0x65')]!=='none'){logger[_0xacc4('0xe')](_0xacc4('0x66'),_0xacc4('0x4e'));_0x24a64f['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xa60fd6[_0xacc4('0x4b')],_0x24a64f['uniqueid'],md5(_0x24a64f[_0xacc4('0x50')]));}headers[_0xacc4('0x52')]=getAuth(_0xa60fd6);return getUser(_0xa60fd6,_0x27f366['email'])[_0xacc4('0x17')](function(_0x443e1c){_0x169cd2=_0x443e1c;logger[_0xacc4('0xe')](_0xacc4('0x54'),_0x169cd2['id']);return getEndUser(_0xa60fd6,_0x24a64f['destcalleridname'],_0x24a64f['destcalleridnum']);})['then'](function(_0x318c67){_0x45510d=_0x318c67;logger[_0xacc4('0xe')](_0xacc4('0x56'),_0x45510d['id']);return getTicket(_0xa60fd6,_0x169cd2,_0x45510d,_0x4dd58a,_0x24a64f);})[_0xacc4('0x17')](function(_0x1f0376){if(_0x1f0376){logger[_0xacc4('0xe')]('The\x20Ticket\x20ID\x20is:',_0x1f0376['id']);switch(_0xa60fd6[_0xacc4('0x42')]){case'integrationTab':logger[_0xacc4('0xe')]('[OUTBOUND]',_0xacc4('0x58'));return request({'uri':util[_0xacc4('0x10')](_0xacc4('0x67'),_0xa60fd6[_0xacc4('0x11')],_0x169cd2['id'],_0x1f0376['id']),'method':_0xacc4('0x59')});case'newTab':logger[_0xacc4('0xe')](_0xacc4('0x66'),_0xacc4('0x68'));emit(util[_0xacc4('0x10')](_0xacc4('0x5b'),_0x27f366[_0xacc4('0x48')]),_0xacc4('0x5c'),{'uri':util[_0xacc4('0x10')](_0xacc4('0x5d'),_0xa60fd6[_0xacc4('0x11')][_0xacc4('0x5e')]('/api/v2',''),_0x1f0376['id'])});break;default:logger[_0xacc4('0x60')](_0xacc4('0x66'),_0xacc4('0x69'));}}})[_0xacc4('0x61')](function(_0x4c4471){logger['error'](_0xacc4('0x6a'),util['inspect'](_0x4c4471,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0xe14732,_0x3c30cd,_0x5383d1,_0x425451,_0x3ad9cd,_0x698091){var _0x33a180,_0x1da99e;_0x698091[_0xacc4('0x11')]=intUtil[_0xacc4('0x4a')](_0x698091['remoteUri']);_0x698091[_0xacc4('0x4b')]=intUtil['stripTrailingSlash'](_0x698091['serverUrl']);if(_0x3ad9cd&&_0x3ad9cd[_0xacc4('0x4c')]){logger['info']('['+_0x3c30cd[_0xacc4('0x6b')][_0xacc4('0x6c')]()+']','Recording\x20is\x20enabled!');_0x3c30cd[_0xacc4('0x51')]=util[_0xacc4('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x698091[_0xacc4('0x4b')],_0x3c30cd[_0xacc4('0x50')],md5(_0x3c30cd[_0xacc4('0x50')]));}else{_0x3c30cd[_0xacc4('0x51')]='';}headers[_0xacc4('0x52')]=getAuth(_0x698091);return getUser(_0x698091)['then'](function(_0x2d9d1f){_0x33a180=_0x2d9d1f;logger[_0xacc4('0xe')]('The\x20User\x20ID\x20is:',_0x33a180['id']);return getEndUser(_0x698091,_0x3c30cd[_0xacc4('0x55')],_0x3c30cd[_0xacc4('0x6d')]);})[_0xacc4('0x17')](function(_0x4af5dc){_0x1da99e=_0x4af5dc;logger[_0xacc4('0xe')](_0xacc4('0x56'),_0x1da99e['id']);return getTicket(_0x698091,_0x33a180,_0x1da99e,_0x5383d1,_0x3c30cd);})['then'](function(_0x14e06f){if(_0x14e06f){logger[_0xacc4('0xe')](_0xacc4('0x6e'),_0x14e06f['id']);}})[_0xacc4('0x61')](function(_0x4a352f){logger['error']('['+_0x3c30cd[_0xacc4('0x6b')][_0xacc4('0x6c')]()+']'+_0xacc4('0x6f'),util['inspect'](_0x4a352f,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 824dbcc..b6c104a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebff=['Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','enduserType','POST','https://www.zohoapis.','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','startCase','log','CREATE\x20ERROR','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','nothing','contact','lead','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','First_Name','What_Id','Full_Name','Last_Name','$se_module','utc','talktime','mm:ss','Call_Duration','endtime','YYYY-MM-DDTHH:mm:ss','starttime','complete','connect','Answered','rejected','abandoned','Call_Result','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','recordingFormat','recordingURL','uniqueid','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','lastevent','toUpperCase','lodash','md5','./util','moment','ioredis','bluebird','../../../../config/logger','zoho','localhost','redis','debug','[HTTP]','stringify','forEach','includes','string','picklist','idField','toString','type','variable','variableName','customVariable','Variable','name','indexOf','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','then','seconds'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xebff,0xf8));var _0xfebf=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xebff[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0xfebf('0x0'));var rp=require('request-promise');var md5=require(_0xfebf('0x1'));var util=require('util');var intUtil=require(_0xfebf('0x2'));var moment=require(_0xfebf('0x3'));var Redis=require(_0xfebf('0x4'));var BPromise=require(_0xfebf('0x5'));var config=require('../../../../config/environment');var logger=require(_0xfebf('0x6'))(_0xfebf('0x7'));config['redis']=_['defaults'](config['redis'],{'host':_0xfebf('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfebf('0x9')]));function emit(_0x86e9c,_0x5da9e1,_0x5a011c){io['to'](_0x86e9c)['emit'](_0x5da9e1,_0x5a011c);}function request(_0x2d9a6c){logger[_0xfebf('0xa')](_0xfebf('0xb'),JSON[_0xfebf('0xc')](_0x2d9a6c));return rp(_0x2d9a6c);}function getCustomFields(_0x39eb48,_0x1b2ccb){var _0x2b0176={};if(_0x39eb48['length']>0x0){_[_0xfebf('0xd')](_0x39eb48,function(_0x43d5e3){if(_[_0xfebf('0xe')]([_0xfebf('0xf'),_0xfebf('0x10')],_0x43d5e3['type'])&&_0x43d5e3[_0xfebf('0x11')]){_0x2b0176[_0x43d5e3['idField']]=_0x43d5e3['content'][_0xfebf('0x12')]();}else if(_0x43d5e3[_0xfebf('0x13')]===_0xfebf('0x14')&&_0x43d5e3['variableName']&&_0x43d5e3[_0xfebf('0x11')]&&_0x1b2ccb[_0x43d5e3[_0xfebf('0x15')]]){_0x2b0176[_0x43d5e3[_0xfebf('0x11')]]=_0x1b2ccb[_0x43d5e3['variableName']][_0xfebf('0x12')]();}else if(_0x43d5e3[_0xfebf('0x13')]===_0xfebf('0x16')&&_0x43d5e3['Variable']&&_0x43d5e3[_0xfebf('0x17')][_0xfebf('0x18')]&&_0x43d5e3['idField']&&_0x1b2ccb[_0x43d5e3[_0xfebf('0x17')][_0xfebf('0x18')]['toLowerCase']()]){_0x2b0176[_0x43d5e3[_0xfebf('0x11')]]=_0x1b2ccb[_0x43d5e3[_0xfebf('0x17')][_0xfebf('0x18')]['toLowerCase']()][_0xfebf('0x12')]();}});}return _0x2b0176;}function getName(_0xfe4c49){if(_0xfe4c49[_0xfebf('0x19')]('\x20')>0x0){var _0x2a430b=_0xfe4c49['split'](/ (.+)/);if(_0x2a430b[0x1]){return _0x2a430b;}}return[_0xfe4c49,_0xfe4c49];}var accountsTokens={};function getAccessToken(_0x20adc6){return new Promise(function(_0x4105d5,_0x583814){if(!_[_0xfebf('0x1a')](accountsTokens[_0x20adc6['id']])&&!_['isNil'](accountsTokens[_0x20adc6['id']][_0xfebf('0x1b')])){if(moment()[_0xfebf('0x1c')](accountsTokens[_0x20adc6['id']][_0xfebf('0x1d')])){_0x4105d5(accountsTokens[_0x20adc6['id']][_0xfebf('0x1b')]);}}var _0x1429b1;switch(_0x20adc6['zone']){case'US':_0x1429b1=_0xfebf('0x1e');break;case'AU':_0x1429b1=_0xfebf('0x1f');break;case'EU':_0x1429b1=_0xfebf('0x20');break;case'IN':_0x1429b1='https://accounts.zoho.in';break;case'CN':_0x1429b1=_0xfebf('0x21');break;default:_0x1429b1=_0xfebf('0x20');break;}var _0x43fcc6={'method':'POST','uri':_0x1429b1+_0xfebf('0x22'),'qs':{'refresh_token':_0x20adc6[_0xfebf('0x23')],'client_id':_0x20adc6[_0xfebf('0x24')],'client_secret':_0x20adc6[_0xfebf('0x25')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x43fcc6)[_0xfebf('0x26')](function(_0x29ef2f){accountsTokens[_0x20adc6['id']]={'access_token':_0x29ef2f[_0xfebf('0x1b')],'expires_in':moment()['add'](_0x29ef2f[_0xfebf('0x1d')],_0xfebf('0x27'))};_0x4105d5(_0x29ef2f[_0xfebf('0x1b')]);})['catch'](function(_0x11ce09){logger['error']('Failing\x20creating\x20the\x20access_token',_0x11ce09['stack']);_0x583814(_0x11ce09);});});}function getUser(_0x4089f9,_0x597332,_0x5e46de,_0x5d57df){logger['info'](_0xfebf('0x28'));return request({'method':_0xfebf('0x29'),'uri':util[_0xfebf('0x2a')]('https://www.zohoapis.%s/crm/v2/users',_0x597332),'qs':{'type':_0xfebf('0x2b')},'headers':{'Authorization':_0xfebf('0x2c')+_0x4089f9},'json':!![]})[_0xfebf('0x26')](function(_0x156bc1){if(_0x156bc1[_0xfebf('0x2d')]){var _0x395cf4=-0x1;if(_[_0xfebf('0x2e')](_0x156bc1[_0xfebf('0x2d')])){if(!_['isNil'](_0x5d57df)){_0x395cf4=_[_0xfebf('0x2f')](_0x156bc1[_0xfebf('0x2d')],function(_0x9a205a){return _0x9a205a[_0xfebf('0x30')]===_0x5d57df;});}if(_0x395cf4>=0x0){logger[_0xfebf('0x31')]('Agent\x20found!');}else{logger[_0xfebf('0x31')](_0xfebf('0x32'));_0x395cf4=_['findIndex'](_0x156bc1[_0xfebf('0x2d')],function(_0x782491){return _0x782491[_0xfebf('0x33')][_0xfebf('0x18')]===_0xfebf('0x34');});}return _0x156bc1[_0xfebf('0x2d')][_0x395cf4];}else{if(_0x156bc1[_0xfebf('0x35')][_0xfebf('0x33')][_0xfebf('0x18')]==='Administrator'){logger[_0xfebf('0x31')](_0xfebf('0x32'));user=_0x156bc1[_0xfebf('0x35')];return user;}else{logger[_0xfebf('0x36')](_0xfebf('0x37'),JSON[_0xfebf('0xc')](_0x156bc1));throw new Error(_0xfebf('0x38')+JSON[_0xfebf('0xc')](_0x156bc1));}}}else{logger[_0xfebf('0x36')](_0xfebf('0x37'),JSON[_0xfebf('0xc')](_0x156bc1));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xfebf('0xc')](_0x156bc1));}})[_0xfebf('0x39')](function(_0x122f9d){console[_0xfebf('0x36')](_0x122f9d);});}function getZohoUser(_0x2906b7,_0x36c24a){return new BPromise(function(_0x4adc4c,_0x27bf4){request(_0x2906b7)[_0xfebf('0x26')](function(_0x45de53){var _0x4aa9a4=null;if(_0x45de53){_0x4aa9a4=_0x45de53['data'][0x0];_0x4aa9a4[_0xfebf('0x3a')]=_0x36c24a;}_0x4adc4c(_0x4aa9a4);})[_0xfebf('0x39')](function(_0x14b2cf){_0x27bf4(_0x14b2cf);});});}function createEndUser(_0xba1069,_0x74739c,_0x161ee6,_0x494143,_0x5ea4c1,_0x52b86b){var _0x161ee6=getName(_0x161ee6);return request({'method':_0xfebf('0x3b'),'uri':_0xfebf('0x3c')+_0x74739c+'/crm/v2/'+_['startCase'](_0x52b86b[_0xfebf('0x3d')])+'s','body':{'data':[{'Last_Name':_0x161ee6[0x1],'First_Name':_0x161ee6[0x0],'Phone':_0x494143,'Owner':{'name':!_[_0xfebf('0x1a')](_0x5ea4c1['role'][_0xfebf('0x18')])?_0x5ea4c1[_0xfebf('0x3e')][_0xfebf('0x18')]:!_[_0xfebf('0x1a')](_0x5ea4c1['first_name'])?_0x5ea4c1[_0xfebf('0x3f')]+'\x20'+_0x5ea4c1[_0xfebf('0x40')]:_0x5ea4c1[_0xfebf('0x40')],'id':_0x5ea4c1['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xba1069},'json':!![]})[_0xfebf('0x26')](function(_0x421ef4){if(_0x421ef4&&_0x421ef4[_0xfebf('0x41')][0x0][_0xfebf('0x42')]===_0xfebf('0x43')){var _0x15ddef=_0x421ef4['data'][0x0][_0xfebf('0x44')];_0x15ddef[_0xfebf('0x3a')]=_[_0xfebf('0x45')](_0x52b86b[_0xfebf('0x3d')])+'s';return _0x15ddef;}logger[_0xfebf('0x36')](_0xfebf('0x37'),JSON[_0xfebf('0xc')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})['catch'](function(_0x3be436){console[_0xfebf('0x46')](_0xfebf('0x47'),_0x3be436);});}function getEndUser(_0x385f42,_0x5dc523,_0x185579,_0x224ba5,_0x7886b3,_0xc72ea5,_0x20c155){var _0x7e47c9={'method':_0xfebf('0x29'),'uri':'','headers':{'Authorization':_0xfebf('0x2c')+_0x385f42},'json':!![]};switch(_0x20c155['moduleSearch']){case _0xfebf('0x48'):_0x7e47c9['uri']=_0xfebf('0x3c')+_0x5dc523+_0xfebf('0x49')+_0x7886b3+'))';return getZohoUser(_0x7e47c9,_0xfebf('0x4a'))[_0xfebf('0x26')](function(_0x33a64c){if(_0x33a64c)return _0x33a64c;_0x7e47c9[_0xfebf('0x4b')]='https://www.zohoapis.'+_0x5dc523+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x7886b3+'))';return getZohoUser(_0x7e47c9,'Leads')['then'](function(_0x11e77b){if(_0x11e77b)return _0x11e77b;if(_0x20c155['moduleCreate']!=_0xfebf('0x4c')){return createEndUser(_0x385f42,_0x5dc523,_0x224ba5,_0x7886b3,_0xc72ea5,_0x20c155);}else{return{};}});});break;case _0xfebf('0x4d'):_0x7e47c9[_0xfebf('0x4b')]='https://www.zohoapis.'+_0x5dc523+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x7886b3+'))';return getZohoUser(_0x7e47c9,_0xfebf('0x4a'))['then'](function(_0xd47d4){if(_0xd47d4)return _0xd47d4;if(_0x20c155['moduleCreate']!=_0xfebf('0x4c')){return createEndUser(_0x385f42,_0x5dc523,_0x224ba5,_0x7886b3,_0xc72ea5,_0x20c155);}else{return{};}});break;case _0xfebf('0x4e'):_0x7e47c9[_0xfebf('0x4b')]='https://www.zohoapis.'+_0x5dc523+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x7886b3+'))';return getZohoUser(_0x7e47c9,_0xfebf('0x4f'))[_0xfebf('0x26')](function(_0x3ed3e0){if(_0x3ed3e0)return _0x3ed3e0;if(_0x20c155[_0xfebf('0x3d')]!=_0xfebf('0x4c')){return createEndUser(_0x385f42,_0x5dc523,_0x224ba5,_0x7886b3,_0xc72ea5,_0x20c155);}else{return{};}});break;}}function getCall(_0xe46619,_0x241fca,_0x2b95c6,_0x30cec1,_0x47a479,_0x236224,_0x276025,_0x2dc481){logger[_0xfebf('0x31')](_0xfebf('0x50'));var _0x4797de={};_0x4797de[_0xfebf('0x51')]={'name':!_[_0xfebf('0x1a')](_0x30cec1[_0xfebf('0x3e')]['name'])&&!_[_0xfebf('0x1a')](_0x30cec1[_0xfebf('0x33')][_0xfebf('0x18')])&&_0x30cec1[_0xfebf('0x33')][_0xfebf('0x18')]===_0xfebf('0x52')?_0x30cec1['role'][_0xfebf('0x18')]:!_[_0xfebf('0x1a')](_0x30cec1[_0xfebf('0x3f')])?_0x30cec1['first_name']+'\x20'+_0x30cec1['last_name']:_0x30cec1[_0xfebf('0x40')],'id':_0x30cec1['id']};_0x4797de[_0xfebf('0x53')]=intUtil[_0xfebf('0x54')](_0x236224['Subjects'],_0x276025,'\x20');_0x4797de[_0xfebf('0x55')]=intUtil[_0xfebf('0x54')](_0x236224['Descriptions'],_0x276025,'\x0a');if(_0x47a479[_0xfebf('0x3a')]===_0xfebf('0x4a')){_0x4797de['Who_Id']={'name':!_['isNil'](_0x47a479['Full_Name'])?_0x47a479['Full_Name']:!_[_0xfebf('0x1a')](_0x47a479[_0xfebf('0x56')])?_0x47a479['First_Name']+'\x20'+_0x47a479['Last_Name']:_0x47a479['Last_Name'],'id':_0x47a479['id']};}if(_0x47a479[_0xfebf('0x3a')]==='Leads'){_0x4797de[_0xfebf('0x57')]={'name':!_[_0xfebf('0x1a')](_0x47a479[_0xfebf('0x58')])?_0x47a479[_0xfebf('0x58')]:!_[_0xfebf('0x1a')](_0x47a479[_0xfebf('0x56')])?_0x47a479['First_Name']+'\x20'+_0x47a479[_0xfebf('0x59')]:_0x47a479[_0xfebf('0x59')],'id':_0x47a479['id']};_0x4797de[_0xfebf('0x5a')]=_['startCase'](_0x47a479['enduserType']);}if(_0x276025['talktime']){_0x4797de['Call_Duration']=moment[_0xfebf('0x5b')](parseInt(_0x276025[_0xfebf('0x5c')])*0x3e8)[_0xfebf('0x2a')](_0xfebf('0x5d'));}else if(_0x276025['answertime']&&_0x276025['endtime']){_0x4797de[_0xfebf('0x5e')]=moment[_0xfebf('0x5b')](moment(_0x276025[_0xfebf('0x5f')],_0xfebf('0x60'))['diff'](moment(_0x276025[_0xfebf('0x61')],_0xfebf('0x60'))))[_0xfebf('0x2a')](_0xfebf('0x5d'));}switch(_0x276025['lastevent']){case'called':_0x4797de['Call_Result']='Called';break;case _0xfebf('0x62'):case _0xfebf('0x63'):_0x4797de['Call_Result']=_0xfebf('0x64');break;case _0xfebf('0x65'):_0x4797de['Call_Result']='Rejected';break;case _0xfebf('0x66'):_0x4797de[_0xfebf('0x67')]='Abandoned';break;case _0xfebf('0x68'):_0x4797de['Call_Result']='Timeout';default:}_0x4797de[_0xfebf('0x69')]=(_0x2dc481===_0xfebf('0x6a')?moment(_0x276025[_0xfebf('0x61')])[_0xfebf('0x2a')](_0xfebf('0x60')):moment(_0x276025[_0xfebf('0x6b')])[_0xfebf('0x2a')](_0xfebf('0x60')))||moment()[_0xfebf('0x2a')]('YYYY-MM-DDTHH:mm:ss');_0x4797de[_0xfebf('0x6c')]=_0x2dc481||_0xfebf('0x6d');_0x4797de=_[_0xfebf('0x6e')](_0x4797de,getCustomFields(_0x236224[_0xfebf('0x6f')],_0x276025));return request({'method':_0xfebf('0x3b'),'uri':_0xfebf('0x3c')+_0x241fca+_0xfebf('0x70'),'headers':{'Authorization':_0xfebf('0x2c')+_0xe46619},'body':{'data':[_0x4797de]},'json':!![]})['then'](function(_0x4812b7){if(_0x4812b7&&_0x4812b7[_0xfebf('0x41')][0x0][_0xfebf('0x42')]===_0xfebf('0x43')){logger[_0xfebf('0x31')]('Call\x20created!');return{'id':_0x4812b7['data'][0x0][_0xfebf('0x44')]['id']};}})[_0xfebf('0x39')](function(_0x3ea99a){logger[_0xfebf('0x31')](_0xfebf('0x71'),_0x3ea99a['stack']);console['log']('err',_0x3ea99a);});}exports[_0xfebf('0x72')]=function(_0x430a51,_0x386713,_0x2c1f88,_0x2c0eee,_0x184913,_0x536519){var _0x20489c,_0x83badd,_0x2dc8c8;_0x536519[_0xfebf('0x73')]=intUtil[_0xfebf('0x74')](_0x536519[_0xfebf('0x73')]);_0x536519['serverUrl']=intUtil[_0xfebf('0x74')](_0x536519[_0xfebf('0x75')]);if(_0x184913&&_0x184913[_0xfebf('0x76')]){logger['info'](_0xfebf('0x77'),_0xfebf('0x78'));_0x386713['recordingURL']=_0x536519[_0xfebf('0x75')]+_0xfebf('0x79')+_0x386713['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x386713['uniqueid']);}else{_0x386713['recordingURL']='';}var _0x515eb0=_0x536519[_0xfebf('0x73')]===_0xfebf('0x7a')?'eu':_0xfebf('0x7b');return getAccessToken(_0x536519)[_0xfebf('0x26')](function(_0x1cca87){_0x2dc8c8=_0x1cca87;return getUser(_0x2dc8c8,_0x515eb0,_0x536519,_0x2c0eee[_0xfebf('0x30')]);})['then'](function(_0x5485d5){_0x20489c=_0x5485d5;logger[_0xfebf('0x31')](_0xfebf('0x7c'),_0x20489c['id']);return getEndUser(_0x2dc8c8,_0x515eb0,_0x536519,_0x386713[_0xfebf('0x7d')],_0x386713[_0xfebf('0x7e')],_0x20489c,_0x2c1f88);})[_0xfebf('0x26')](function(_0x1c1989){_0x83badd=_0x1c1989;return getCall(_0x2dc8c8,_0x515eb0,_0x536519,_0x20489c,_0x83badd,_0x2c1f88,_0x386713,_0xfebf('0x6d'));})[_0xfebf('0x26')](function(_0x52f1b7){if(_0x52f1b7){logger['info'](_0xfebf('0x7f'),_0x52f1b7['id']);logger['info']('[QUEUE]',_0xfebf('0x80'));emit(util[_0xfebf('0x2a')]('user:%s',_0x2c0eee['name']),_0xfebf('0x81'),{'uri':_0xfebf('0x82')+_0x536519[_0xfebf('0x73')]+'/crm/EntityInfo.do?module=Calls&id='+_0x52f1b7['id']});}})[_0xfebf('0x39')](function(_0x28bc10){logger[_0xfebf('0x36')](_0xfebf('0x77'),JSON['stringify'](_0x28bc10));});};exports['outbound']=function(_0x2fd5ea,_0x5abb63,_0x57c416,_0x14d01b,_0x3fab04,_0x59f6f1,_0x3d32a8){var _0x4cbe8f,_0x3c24c9,_0x912ca6;_0x59f6f1[_0xfebf('0x73')]=intUtil['stripTrailingSlash'](_0x59f6f1[_0xfebf('0x73')]);_0x59f6f1['serverUrl']=intUtil[_0xfebf('0x74')](_0x59f6f1['serverUrl']);if(_0x3d32a8&&_0x3d32a8[_0xfebf('0x83')]&&_0x3d32a8[_0xfebf('0x83')]!=='none'){logger[_0xfebf('0x31')]('[OUTBOUND]',_0xfebf('0x78'));_0x5abb63[_0xfebf('0x84')]=_0x59f6f1[_0xfebf('0x75')]+'/api/voice/recordings/'+_0x5abb63[_0xfebf('0x85')]+_0xfebf('0x86')+md5(_0x5abb63[_0xfebf('0x85')]);}var _0x5c5e05=_0x59f6f1['host']===_0xfebf('0x7a')?'eu':_0xfebf('0x7b');return getAccessToken(_0x59f6f1)[_0xfebf('0x26')](function(_0x39f5bc){_0x912ca6=_0x39f5bc;return getUser(_0x912ca6,_0x5c5e05,_0x59f6f1,_0x14d01b['email']);})[_0xfebf('0x26')](function(_0x26be77){_0x4cbe8f=_0x26be77;logger[_0xfebf('0x31')](_0xfebf('0x7c'),_0x4cbe8f['id']);return getEndUser(_0x912ca6,_0x5c5e05,_0x59f6f1,_0x5abb63[_0xfebf('0x87')],_0x5abb63[_0xfebf('0x88')],_0x4cbe8f,_0x57c416);})[_0xfebf('0x26')](function(_0x10e5c1){_0x3c24c9=_0x10e5c1;return getCall(_0x912ca6,_0x5c5e05,_0x59f6f1,_0x4cbe8f,_0x3c24c9,_0x57c416,_0x5abb63,_0xfebf('0x89'));})['then'](function(_0x42ef5c){if(_0x42ef5c){logger[_0xfebf('0x31')](_0xfebf('0x7f'),_0x42ef5c['id']);logger[_0xfebf('0x31')](_0xfebf('0x8a'),_0xfebf('0x80'));emit(util[_0xfebf('0x2a')](_0xfebf('0x8b'),_0x14d01b['name']),_0xfebf('0x81'),{'uri':_0xfebf('0x82')+_0x59f6f1[_0xfebf('0x73')]+_0xfebf('0x8c')+_0x42ef5c['id']});}})['catch'](function(_0x11cd11){logger[_0xfebf('0x36')](_0xfebf('0x8a'),JSON[_0xfebf('0xc')](_0x11cd11));});};exports[_0xfebf('0x8d')]=function(_0x5b298f,_0x420632,_0x59e4c4,_0x4bd26e,_0x56eb9d,_0x5e0953){var _0x30c99b,_0x57b431,_0x39847b;_0x5e0953[_0xfebf('0x73')]=intUtil['stripTrailingSlash'](_0x5e0953[_0xfebf('0x73')]);_0x5e0953['serverUrl']=intUtil['stripTrailingSlash'](_0x5e0953[_0xfebf('0x75')]);if(_0x56eb9d&&_0x56eb9d[_0xfebf('0x76')]){logger['info']('['+_0x420632[_0xfebf('0x8e')][_0xfebf('0x8f')]()+']','Recording\x20is\x20enabled!');_0x420632[_0xfebf('0x84')]=_0x5e0953[_0xfebf('0x75')]+_0xfebf('0x79')+_0x420632[_0xfebf('0x85')]+'/downloads?type=uniqueid&token='+md5(_0x420632['uniqueid']);}else{_0x420632['recordingURL']='';}var _0x50a13a=_0x5e0953[_0xfebf('0x73')]==='zoho.eu'?'eu':_0xfebf('0x7b');return getAccessToken(_0x5e0953)['then'](function(_0x26528c){_0x39847b=_0x26528c;return getUser(_0x39847b,_0x50a13a,_0x5e0953);})[_0xfebf('0x26')](function(_0xd3f1b0){_0x30c99b=_0xd3f1b0;logger[_0xfebf('0x31')]('The\x20User\x20ID\x20is:',_0x30c99b['id']);return getEndUser(_0x39847b,_0x50a13a,_0x5e0953,_0x420632[_0xfebf('0x7d')],_0x420632[_0xfebf('0x7e')],_0x30c99b,_0x59e4c4);})[_0xfebf('0x26')](function(_0x4d9042){_0x57b431=_0x4d9042;return getCall(_0x39847b,_0x50a13a,_0x5e0953,_0x30c99b,_0x57b431,_0x59e4c4,_0x420632,_0xfebf('0x6d'));})[_0xfebf('0x26')](function(_0x3a13ca){if(_0x3a13ca){logger[_0xfebf('0x31')](_0xfebf('0x7f'),_0x3a13ca['id']);}})[_0xfebf('0x39')](function(_0x26ff83){logger[_0xfebf('0x36')]('['+_0x420632['lastevent'][_0xfebf('0x8f')]()+']',JSON[_0xfebf('0xc')](_0x26ff83));});};
\ No newline at end of file
+var _0xbd60=['Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','Timeout','Call_Start_Time','Inbound','merge','Fields','/crm/v2/Calls','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','Outbound','trigger:browser:url','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','idField','toString','type','variable','variableName','customVariable','Variable','name','indexOf','split','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','then','isArrayLikeObject','users','isNil','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','POST','https://www.zohoapis.','startCase','role','first_name','last_name','code','SUCCESS','details','enduserType','moduleCreate','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','Creating\x20new\x20call...','administrator','Subject','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime'];(function(_0x562df0,_0x2d3cc4){var _0x46e5d1=function(_0x5d0df7){while(--_0x5d0df7){_0x562df0['push'](_0x562df0['shift']());}};_0x46e5d1(++_0x2d3cc4);}(_0xbd60,0x162));var _0x0bd6=function(_0x13891e,_0x4977fc){_0x13891e=_0x13891e-0x0;var _0x3d679a=_0xbd60[_0x13891e];return _0x3d679a;};'use strict';var _=require(_0x0bd6('0x0'));var rp=require(_0x0bd6('0x1'));var md5=require(_0x0bd6('0x2'));var util=require(_0x0bd6('0x3'));var intUtil=require(_0x0bd6('0x4'));var moment=require(_0x0bd6('0x5'));var Redis=require(_0x0bd6('0x6'));var BPromise=require(_0x0bd6('0x7'));var config=require('../../../../config/environment');var logger=require(_0x0bd6('0x8'))(_0x0bd6('0x9'));config[_0x0bd6('0xa')]=_['defaults'](config[_0x0bd6('0xa')],{'host':_0x0bd6('0xb'),'port':0x18eb});var io=require(_0x0bd6('0xc'))(new Redis(config[_0x0bd6('0xa')]));function emit(_0x5eb4a0,_0x3da6df,_0x22560b){io['to'](_0x5eb4a0)[_0x0bd6('0xd')](_0x3da6df,_0x22560b);}function request(_0x255bf9){logger['debug'](_0x0bd6('0xe'),JSON[_0x0bd6('0xf')](_0x255bf9));return rp(_0x255bf9);}function getCustomFields(_0x406016,_0x21dcfe){var _0x5846bf={};if(_0x406016[_0x0bd6('0x10')]>0x0){_[_0x0bd6('0x11')](_0x406016,function(_0x5d2e87){if(_['includes'](['string','picklist'],_0x5d2e87['type'])&&_0x5d2e87[_0x0bd6('0x12')]){_0x5846bf[_0x5d2e87[_0x0bd6('0x12')]]=_0x5d2e87['content'][_0x0bd6('0x13')]();}else if(_0x5d2e87[_0x0bd6('0x14')]===_0x0bd6('0x15')&&_0x5d2e87[_0x0bd6('0x16')]&&_0x5d2e87['idField']&&_0x21dcfe[_0x5d2e87['variableName']]){_0x5846bf[_0x5d2e87[_0x0bd6('0x12')]]=_0x21dcfe[_0x5d2e87['variableName']][_0x0bd6('0x13')]();}else if(_0x5d2e87[_0x0bd6('0x14')]===_0x0bd6('0x17')&&_0x5d2e87[_0x0bd6('0x18')]&&_0x5d2e87[_0x0bd6('0x18')]['name']&&_0x5d2e87[_0x0bd6('0x12')]&&_0x21dcfe[_0x5d2e87['Variable'][_0x0bd6('0x19')]['toLowerCase']()]){_0x5846bf[_0x5d2e87[_0x0bd6('0x12')]]=_0x21dcfe[_0x5d2e87['Variable'][_0x0bd6('0x19')]['toLowerCase']()][_0x0bd6('0x13')]();}});}return _0x5846bf;}function getName(_0x27dc9a){if(_0x27dc9a[_0x0bd6('0x1a')]('\x20')>0x0){var _0x3a7218=_0x27dc9a[_0x0bd6('0x1b')](/ (.+)/);if(_0x3a7218[0x1]){return _0x3a7218;}}return[_0x27dc9a,_0x27dc9a];}var accountsTokens={};function getAccessToken(_0x5efeeb){return new Promise(function(_0x147f7e,_0x219128){if(!_['isNil'](accountsTokens[_0x5efeeb['id']])&&!_['isNil'](accountsTokens[_0x5efeeb['id']][_0x0bd6('0x1c')])){if(moment()[_0x0bd6('0x1d')](accountsTokens[_0x5efeeb['id']][_0x0bd6('0x1e')])){_0x147f7e(accountsTokens[_0x5efeeb['id']][_0x0bd6('0x1c')]);}}var _0x13f563;switch(_0x5efeeb[_0x0bd6('0x1f')]){case'US':_0x13f563=_0x0bd6('0x20');break;case'AU':_0x13f563=_0x0bd6('0x21');break;case'EU':_0x13f563='https://accounts.zoho.eu';break;case'IN':_0x13f563=_0x0bd6('0x22');break;case'CN':_0x13f563=_0x0bd6('0x23');break;default:_0x13f563=_0x0bd6('0x24');break;}var _0x34de22={'method':'POST','uri':_0x13f563+_0x0bd6('0x25'),'qs':{'refresh_token':_0x5efeeb[_0x0bd6('0x26')],'client_id':_0x5efeeb[_0x0bd6('0x27')],'client_secret':_0x5efeeb[_0x0bd6('0x28')],'grant_type':_0x0bd6('0x29')},'json':!![]};return rp(_0x34de22)['then'](function(_0x5a3bf8){accountsTokens[_0x5efeeb['id']]={'access_token':_0x5a3bf8[_0x0bd6('0x1c')],'expires_in':moment()['add'](_0x5a3bf8['expires_in'],'seconds')};_0x147f7e(_0x5a3bf8['access_token']);})[_0x0bd6('0x2a')](function(_0x534407){logger[_0x0bd6('0x2b')](_0x0bd6('0x2c'),_0x534407[_0x0bd6('0x2d')]);_0x219128(_0x534407);});});}function getUser(_0x13a0bd,_0x26d488,_0x2c06c9,_0x3d2a1c){logger[_0x0bd6('0x2e')](_0x0bd6('0x2f'));return request({'method':_0x0bd6('0x30'),'uri':util[_0x0bd6('0x31')]('https://www.zohoapis.%s/crm/v2/users',_0x26d488),'qs':{'type':_0x0bd6('0x32')},'headers':{'Authorization':_0x0bd6('0x33')+_0x13a0bd},'json':!![]})[_0x0bd6('0x34')](function(_0xa06544){if(_0xa06544['users']){var _0xda84d5=-0x1;if(_[_0x0bd6('0x35')](_0xa06544[_0x0bd6('0x36')])){if(!_[_0x0bd6('0x37')](_0x3d2a1c)){_0xda84d5=_[_0x0bd6('0x38')](_0xa06544['users'],function(_0x4b36d7){return _0x4b36d7[_0x0bd6('0x39')]===_0x3d2a1c;});}if(_0xda84d5>=0x0){logger[_0x0bd6('0x2e')]('Agent\x20found!');}else{logger[_0x0bd6('0x2e')](_0x0bd6('0x3a'));_0xda84d5=_[_0x0bd6('0x38')](_0xa06544[_0x0bd6('0x36')],function(_0x16fda5){return _0x16fda5[_0x0bd6('0x3b')][_0x0bd6('0x19')]===_0x0bd6('0x3c');});}return _0xa06544[_0x0bd6('0x36')][_0xda84d5];}else{if(_0xa06544[_0x0bd6('0x3d')][_0x0bd6('0x3b')][_0x0bd6('0x19')]==='Administrator'){logger[_0x0bd6('0x2e')]('Using\x20the\x20admin\x20account!');user=_0xa06544[_0x0bd6('0x3d')];return user;}else{logger[_0x0bd6('0x2b')](_0x0bd6('0x3e'),JSON[_0x0bd6('0xf')](_0xa06544));throw new Error(_0x0bd6('0x3f')+JSON[_0x0bd6('0xf')](_0xa06544));}}}else{logger[_0x0bd6('0x2b')](_0x0bd6('0x3e'),JSON[_0x0bd6('0xf')](_0xa06544));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x0bd6('0xf')](_0xa06544));}})['catch'](function(_0xdf5a01){console[_0x0bd6('0x2b')](_0xdf5a01);});}function getZohoUser(_0x62eb2d,_0x18ab54){return new BPromise(function(_0x3248a9,_0x368b70){request(_0x62eb2d)['then'](function(_0x2631bf){var _0x229aa9=null;if(_0x2631bf){_0x229aa9=_0x2631bf[_0x0bd6('0x40')][0x0];_0x229aa9['enduserType']=_0x18ab54;}_0x3248a9(_0x229aa9);})[_0x0bd6('0x2a')](function(_0x5c3802){_0x368b70(_0x5c3802);});});}function createEndUser(_0x1214e9,_0x3a6e87,_0x4511a5,_0x2f6d8c,_0x2dc495,_0xa2a88b){var _0x4511a5=getName(_0x4511a5);return request({'method':_0x0bd6('0x41'),'uri':_0x0bd6('0x42')+_0x3a6e87+'/crm/v2/'+_[_0x0bd6('0x43')](_0xa2a88b['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x4511a5[0x1],'First_Name':_0x4511a5[0x0],'Phone':_0x2f6d8c,'Owner':{'name':!_['isNil'](_0x2dc495[_0x0bd6('0x44')][_0x0bd6('0x19')])?_0x2dc495['role'][_0x0bd6('0x19')]:!_[_0x0bd6('0x37')](_0x2dc495[_0x0bd6('0x45')])?_0x2dc495[_0x0bd6('0x45')]+'\x20'+_0x2dc495[_0x0bd6('0x46')]:_0x2dc495['last_name'],'id':_0x2dc495['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1214e9},'json':!![]})['then'](function(_0x23f757){if(_0x23f757&&_0x23f757[_0x0bd6('0x40')][0x0][_0x0bd6('0x47')]===_0x0bd6('0x48')){var _0x30165f=_0x23f757[_0x0bd6('0x40')][0x0][_0x0bd6('0x49')];_0x30165f[_0x0bd6('0x4a')]=_['startCase'](_0xa2a88b[_0x0bd6('0x4b')])+'s';return _0x30165f;}logger[_0x0bd6('0x2b')](_0x0bd6('0x3e'),JSON[_0x0bd6('0xf')](data));throw new Error(_0x0bd6('0x4c')+JSON[_0x0bd6('0xf')](data));})[_0x0bd6('0x2a')](function(_0xeeb892){console[_0x0bd6('0x4d')](_0x0bd6('0x4e'),_0xeeb892);});}function getEndUser(_0x35ddba,_0x304f8b,_0xac44d7,_0x5bc3b7,_0x3c4127,_0x1cff6e,_0x586bb5){var _0x2258a9={'method':_0x0bd6('0x30'),'uri':'','headers':{'Authorization':_0x0bd6('0x33')+_0x35ddba},'json':!![]};switch(_0x586bb5['moduleSearch']){case _0x0bd6('0x4f'):_0x2258a9[_0x0bd6('0x50')]=_0x0bd6('0x42')+_0x304f8b+_0x0bd6('0x51')+_0x3c4127+'))';return getZohoUser(_0x2258a9,_0x0bd6('0x52'))[_0x0bd6('0x34')](function(_0x3828bd){if(_0x3828bd)return _0x3828bd;_0x2258a9['uri']=_0x0bd6('0x42')+_0x304f8b+_0x0bd6('0x53')+_0x3c4127+'))';return getZohoUser(_0x2258a9,_0x0bd6('0x54'))['then'](function(_0x19a033){if(_0x19a033)return _0x19a033;if(_0x586bb5[_0x0bd6('0x4b')]!=_0x0bd6('0x55')){return createEndUser(_0x35ddba,_0x304f8b,_0x5bc3b7,_0x3c4127,_0x1cff6e,_0x586bb5);}else{return{};}});});break;case'contact':_0x2258a9[_0x0bd6('0x50')]=_0x0bd6('0x42')+_0x304f8b+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3c4127+'))';return getZohoUser(_0x2258a9,_0x0bd6('0x52'))[_0x0bd6('0x34')](function(_0x224ad7){if(_0x224ad7)return _0x224ad7;if(_0x586bb5['moduleCreate']!=_0x0bd6('0x55')){return createEndUser(_0x35ddba,_0x304f8b,_0x5bc3b7,_0x3c4127,_0x1cff6e,_0x586bb5);}else{return{};}});break;case'lead':_0x2258a9['uri']=_0x0bd6('0x42')+_0x304f8b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3c4127+'))';return getZohoUser(_0x2258a9,'Leads')[_0x0bd6('0x34')](function(_0x285311){if(_0x285311)return _0x285311;if(_0x586bb5[_0x0bd6('0x4b')]!=_0x0bd6('0x55')){return createEndUser(_0x35ddba,_0x304f8b,_0x5bc3b7,_0x3c4127,_0x1cff6e,_0x586bb5);}else{return{};}});break;}}function getCall(_0x3d259b,_0x3f3d83,_0x18d824,_0x548f3d,_0x1366f7,_0x2a8f88,_0x1f56ad,_0x21a3b5){logger[_0x0bd6('0x2e')](_0x0bd6('0x56'));var _0xcd63ec={};_0xcd63ec['Owner']={'name':!_['isNil'](_0x548f3d[_0x0bd6('0x44')][_0x0bd6('0x19')])&&!_[_0x0bd6('0x37')](_0x548f3d['profile'][_0x0bd6('0x19')])&&_0x548f3d['profile'][_0x0bd6('0x19')]===_0x0bd6('0x57')?_0x548f3d[_0x0bd6('0x44')][_0x0bd6('0x19')]:!_['isNil'](_0x548f3d[_0x0bd6('0x45')])?_0x548f3d['first_name']+'\x20'+_0x548f3d[_0x0bd6('0x46')]:_0x548f3d[_0x0bd6('0x46')],'id':_0x548f3d['id']};_0xcd63ec[_0x0bd6('0x58')]=intUtil[_0x0bd6('0x59')](_0x2a8f88[_0x0bd6('0x5a')],_0x1f56ad,'\x20');_0xcd63ec[_0x0bd6('0x5b')]=intUtil[_0x0bd6('0x59')](_0x2a8f88[_0x0bd6('0x5c')],_0x1f56ad,'\x0a');if(_0x1366f7[_0x0bd6('0x4a')]==='Contacts'){_0xcd63ec['Who_Id']={'name':!_['isNil'](_0x1366f7[_0x0bd6('0x5d')])?_0x1366f7[_0x0bd6('0x5d')]:!_[_0x0bd6('0x37')](_0x1366f7[_0x0bd6('0x5e')])?_0x1366f7[_0x0bd6('0x5e')]+'\x20'+_0x1366f7[_0x0bd6('0x5f')]:_0x1366f7[_0x0bd6('0x5f')],'id':_0x1366f7['id']};}if(_0x1366f7['enduserType']===_0x0bd6('0x54')){_0xcd63ec[_0x0bd6('0x60')]={'name':!_['isNil'](_0x1366f7[_0x0bd6('0x5d')])?_0x1366f7[_0x0bd6('0x5d')]:!_[_0x0bd6('0x37')](_0x1366f7[_0x0bd6('0x5e')])?_0x1366f7[_0x0bd6('0x5e')]+'\x20'+_0x1366f7[_0x0bd6('0x5f')]:_0x1366f7[_0x0bd6('0x5f')],'id':_0x1366f7['id']};_0xcd63ec[_0x0bd6('0x61')]=_[_0x0bd6('0x43')](_0x1366f7[_0x0bd6('0x4a')]);}if(_0x1f56ad[_0x0bd6('0x62')]){_0xcd63ec[_0x0bd6('0x63')]=moment[_0x0bd6('0x64')](parseInt(_0x1f56ad[_0x0bd6('0x62')])*0x3e8)[_0x0bd6('0x31')](_0x0bd6('0x65'));}else if(_0x1f56ad[_0x0bd6('0x66')]&&_0x1f56ad[_0x0bd6('0x67')]){_0xcd63ec[_0x0bd6('0x63')]=moment[_0x0bd6('0x64')](moment(_0x1f56ad[_0x0bd6('0x67')],_0x0bd6('0x68'))['diff'](moment(_0x1f56ad[_0x0bd6('0x69')],_0x0bd6('0x68'))))[_0x0bd6('0x31')](_0x0bd6('0x65'));}switch(_0x1f56ad[_0x0bd6('0x6a')]){case _0x0bd6('0x6b'):_0xcd63ec[_0x0bd6('0x6c')]='Called';break;case _0x0bd6('0x6d'):case _0x0bd6('0x6e'):_0xcd63ec[_0x0bd6('0x6c')]=_0x0bd6('0x6f');break;case _0x0bd6('0x70'):_0xcd63ec[_0x0bd6('0x6c')]=_0x0bd6('0x71');break;case _0x0bd6('0x72'):_0xcd63ec[_0x0bd6('0x6c')]='Abandoned';break;case'timeout':_0xcd63ec[_0x0bd6('0x6c')]=_0x0bd6('0x73');default:}_0xcd63ec[_0x0bd6('0x74')]=(_0x21a3b5==='outbound'?moment(_0x1f56ad['starttime'])['format'](_0x0bd6('0x68')):moment(_0x1f56ad['agentcalledAt'])[_0x0bd6('0x31')](_0x0bd6('0x68')))||moment()[_0x0bd6('0x31')]('YYYY-MM-DDTHH:mm:ss');_0xcd63ec['Call_Type']=_0x21a3b5||_0x0bd6('0x75');_0xcd63ec=_[_0x0bd6('0x76')](_0xcd63ec,getCustomFields(_0x2a8f88[_0x0bd6('0x77')],_0x1f56ad));return request({'method':_0x0bd6('0x41'),'uri':_0x0bd6('0x42')+_0x3f3d83+_0x0bd6('0x78'),'headers':{'Authorization':_0x0bd6('0x33')+_0x3d259b},'body':{'data':[_0xcd63ec]},'json':!![]})['then'](function(_0x1610ec){if(_0x1610ec&&_0x1610ec[_0x0bd6('0x40')][0x0][_0x0bd6('0x47')]===_0x0bd6('0x48')){logger[_0x0bd6('0x2e')]('Call\x20created!');return{'id':_0x1610ec[_0x0bd6('0x40')][0x0][_0x0bd6('0x49')]['id']};}})['catch'](function(_0x50cd9d){logger[_0x0bd6('0x2e')](_0x0bd6('0x79'),_0x50cd9d[_0x0bd6('0x2d')]);console[_0x0bd6('0x4d')](_0x0bd6('0x79'),_0x50cd9d);});}exports[_0x0bd6('0x7a')]=function(_0x100716,_0x7a3ec0,_0x456773,_0x572146,_0x197c8a,_0x26d695){var _0x44d472,_0x2645c8,_0x56cc87;_0x26d695['host']=intUtil[_0x0bd6('0x7b')](_0x26d695[_0x0bd6('0x7c')]);_0x26d695['serverUrl']=intUtil['stripTrailingSlash'](_0x26d695[_0x0bd6('0x7d')]);if(_0x197c8a&&_0x197c8a[_0x0bd6('0x7e')]){logger[_0x0bd6('0x2e')]('[QUEUE]',_0x0bd6('0x7f'));_0x7a3ec0['recordingURL']=_0x26d695[_0x0bd6('0x7d')]+_0x0bd6('0x80')+_0x7a3ec0[_0x0bd6('0x81')]+_0x0bd6('0x82')+md5(_0x7a3ec0[_0x0bd6('0x81')]);}else{_0x7a3ec0['recordingURL']='';}var _0x23395f=_0x26d695['host']===_0x0bd6('0x83')?'eu':_0x0bd6('0x84');return getAccessToken(_0x26d695)['then'](function(_0x4c8fc7){_0x56cc87=_0x4c8fc7;return getUser(_0x56cc87,_0x23395f,_0x26d695,_0x572146[_0x0bd6('0x39')]);})[_0x0bd6('0x34')](function(_0x48a357){_0x44d472=_0x48a357;logger[_0x0bd6('0x2e')](_0x0bd6('0x85'),_0x44d472['id']);return getEndUser(_0x56cc87,_0x23395f,_0x26d695,_0x7a3ec0[_0x0bd6('0x86')],_0x7a3ec0['calleridnum'],_0x44d472,_0x456773);})['then'](function(_0x105825){_0x2645c8=_0x105825;return getCall(_0x56cc87,_0x23395f,_0x26d695,_0x44d472,_0x2645c8,_0x456773,_0x7a3ec0,_0x0bd6('0x75'));})['then'](function(_0x2ce11d){if(_0x2ce11d){logger[_0x0bd6('0x2e')](_0x0bd6('0x87'),_0x2ce11d['id']);logger['info']('[QUEUE]',_0x0bd6('0x88'));emit(util[_0x0bd6('0x31')](_0x0bd6('0x89'),_0x572146[_0x0bd6('0x19')]),'trigger:browser:url',{'uri':_0x0bd6('0x8a')+_0x26d695[_0x0bd6('0x7c')]+_0x0bd6('0x8b')+_0x2ce11d['id']});}})[_0x0bd6('0x2a')](function(_0xfab104){logger[_0x0bd6('0x2b')](_0x0bd6('0x8c'),JSON[_0x0bd6('0xf')](_0xfab104));});};exports[_0x0bd6('0x8d')]=function(_0x1d6356,_0x47924b,_0x14a9fa,_0x325f64,_0xf8429,_0xcb55e7,_0x1685ea){var _0x25f656,_0x23a149,_0x3aeb1c;_0xcb55e7[_0x0bd6('0x7c')]=intUtil[_0x0bd6('0x7b')](_0xcb55e7[_0x0bd6('0x7c')]);_0xcb55e7[_0x0bd6('0x7d')]=intUtil[_0x0bd6('0x7b')](_0xcb55e7['serverUrl']);if(_0x1685ea&&_0x1685ea[_0x0bd6('0x8e')]&&_0x1685ea[_0x0bd6('0x8e')]!==_0x0bd6('0x8f')){logger[_0x0bd6('0x2e')](_0x0bd6('0x90'),_0x0bd6('0x7f'));_0x47924b[_0x0bd6('0x91')]=_0xcb55e7['serverUrl']+_0x0bd6('0x80')+_0x47924b['uniqueid']+_0x0bd6('0x82')+md5(_0x47924b['uniqueid']);}var _0x2d2e19=_0xcb55e7['host']===_0x0bd6('0x83')?'eu':'com';return getAccessToken(_0xcb55e7)[_0x0bd6('0x34')](function(_0xb38500){_0x3aeb1c=_0xb38500;return getUser(_0x3aeb1c,_0x2d2e19,_0xcb55e7,_0x325f64['email']);})[_0x0bd6('0x34')](function(_0x49f2be){_0x25f656=_0x49f2be;logger['info'](_0x0bd6('0x85'),_0x25f656['id']);return getEndUser(_0x3aeb1c,_0x2d2e19,_0xcb55e7,_0x47924b[_0x0bd6('0x92')],_0x47924b['destcalleridnum'],_0x25f656,_0x14a9fa);})['then'](function(_0x1fd143){_0x23a149=_0x1fd143;return getCall(_0x3aeb1c,_0x2d2e19,_0xcb55e7,_0x25f656,_0x23a149,_0x14a9fa,_0x47924b,_0x0bd6('0x93'));})['then'](function(_0x2bed50){if(_0x2bed50){logger[_0x0bd6('0x2e')](_0x0bd6('0x87'),_0x2bed50['id']);logger[_0x0bd6('0x2e')](_0x0bd6('0x90'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0bd6('0x31')](_0x0bd6('0x89'),_0x325f64[_0x0bd6('0x19')]),_0x0bd6('0x94'),{'uri':_0x0bd6('0x8a')+_0xcb55e7[_0x0bd6('0x7c')]+_0x0bd6('0x8b')+_0x2bed50['id']});}})[_0x0bd6('0x2a')](function(_0x2462e9){logger[_0x0bd6('0x2b')](_0x0bd6('0x90'),JSON[_0x0bd6('0xf')](_0x2462e9));});};exports[_0x0bd6('0x95')]=function(_0xd8aa82,_0x26f440,_0x617987,_0x229963,_0x621bf6,_0x51f956){var _0x44a96f,_0x13138e,_0x51d25a;_0x51f956[_0x0bd6('0x7c')]=intUtil[_0x0bd6('0x7b')](_0x51f956[_0x0bd6('0x7c')]);_0x51f956[_0x0bd6('0x7d')]=intUtil[_0x0bd6('0x7b')](_0x51f956[_0x0bd6('0x7d')]);if(_0x621bf6&&_0x621bf6[_0x0bd6('0x7e')]){logger['info']('['+_0x26f440[_0x0bd6('0x6a')][_0x0bd6('0x96')]()+']',_0x0bd6('0x7f'));_0x26f440[_0x0bd6('0x91')]=_0x51f956['serverUrl']+_0x0bd6('0x80')+_0x26f440[_0x0bd6('0x81')]+_0x0bd6('0x82')+md5(_0x26f440[_0x0bd6('0x81')]);}else{_0x26f440[_0x0bd6('0x91')]='';}var _0x2550e6=_0x51f956[_0x0bd6('0x7c')]===_0x0bd6('0x83')?'eu':'com';return getAccessToken(_0x51f956)['then'](function(_0x10870b){_0x51d25a=_0x10870b;return getUser(_0x51d25a,_0x2550e6,_0x51f956);})[_0x0bd6('0x34')](function(_0x2548ee){_0x44a96f=_0x2548ee;logger[_0x0bd6('0x2e')]('The\x20User\x20ID\x20is:',_0x44a96f['id']);return getEndUser(_0x51d25a,_0x2550e6,_0x51f956,_0x26f440[_0x0bd6('0x86')],_0x26f440['calleridnum'],_0x44a96f,_0x617987);})[_0x0bd6('0x34')](function(_0x21ccb7){_0x13138e=_0x21ccb7;return getCall(_0x51d25a,_0x2550e6,_0x51f956,_0x44a96f,_0x13138e,_0x617987,_0x26f440,'Inbound');})[_0x0bd6('0x34')](function(_0x3d161e){if(_0x3d161e){logger[_0x0bd6('0x2e')](_0x0bd6('0x87'),_0x3d161e['id']);}})[_0x0bd6('0x2a')](function(_0x14fcb6){logger[_0x0bd6('0x2b')]('['+_0x26f440['lastevent'][_0x0bd6('0x96')]()+']',JSON[_0x0bd6('0xf')](_0x14fcb6));});};
\ No newline at end of file
index f70a2b1..39a3075 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3695=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','../../../../config/logger','trigger','exec','data2','data3','render','error','format','info'];(function(_0x5772ae,_0x4d7475){var _0x38e851=function(_0x68b6c1){while(--_0x68b6c1){_0x5772ae['push'](_0x5772ae['shift']());}};_0x38e851(++_0x4d7475);}(_0x3695,0x7a));var _0x5369=function(_0x3373d6,_0x469c11){_0x3373d6=_0x3373d6-0x0;var _0xe84b65=_0x3695[_0x3373d6];return _0xe84b65;};'use strict';var util=require('util');var sh=require(_0x5369('0x0'));var Mustache=require('mustache');var logger=require(_0x5369('0x1'))(_0x5369('0x2'));exports[_0x5369('0x3')]=function(_0xc1f152,_0x2f0d29){var _0x1bb232=_0xc1f152[_0x5369('0x4')]?_0xc1f152[_0x5369('0x4')]:'Script';var _0x345485=_0xc1f152[_0x5369('0x5')]?Mustache[_0x5369('0x6')](_0xc1f152[_0x5369('0x5')],_0x2f0d29):_0x2f0d29;sh[_0x5369('0x3')](_0x345485,function(_0x548f96,_0x4b73d5,_0x4134b7){if(_0x548f96!==0x0){logger[_0x5369('0x7')](util[_0x5369('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x1bb232,_0x345485,_0x548f96,_0x4134b7));}else{logger[_0x5369('0x9')](util[_0x5369('0x8')](_0x5369('0xa'),_0x1bb232,_0x345485,_0x4b73d5));}});};
\ No newline at end of file
+var _0xe838=['Script','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger','exec','data2'];(function(_0x1e06f1,_0x59d7e1){var _0x34f77e=function(_0x4f9f26){while(--_0x4f9f26){_0x1e06f1['push'](_0x1e06f1['shift']());}};_0x34f77e(++_0x59d7e1);}(_0xe838,0x13f));var _0x8e83=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe838[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x8e83('0x0'));var sh=require(_0x8e83('0x1'));var Mustache=require('mustache');var logger=require(_0x8e83('0x2'))(_0x8e83('0x3'));exports[_0x8e83('0x4')]=function(_0x3ec1af,_0x52c23c){var _0xd55a4e=_0x3ec1af[_0x8e83('0x5')]?_0x3ec1af[_0x8e83('0x5')]:_0x8e83('0x6');var _0x24d6fb=_0x3ec1af['data3']?Mustache[_0x8e83('0x7')](_0x3ec1af['data3'],_0x52c23c):_0x52c23c;sh[_0x8e83('0x4')](_0x24d6fb,function(_0x2f2749,_0x15d30,_0x8d0fa2){if(_0x2f2749!==0x0){logger[_0x8e83('0x8')](util[_0x8e83('0x9')](_0x8e83('0xa'),_0xd55a4e,_0x24d6fb,_0x2f2749,_0x8d0fa2));}else{logger[_0x8e83('0xb')](util[_0x8e83('0x9')](_0x8e83('0xc'),_0xd55a4e,_0x24d6fb,_0x15d30));}});};
\ No newline at end of file
index 0bb4b34..c01981b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82a0=['mustache','../../../../config/logger','trigger','exec','data5','number','data6','parse','render','error','stack','data1','toUpperCase','GET','POST','PUT','data7','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','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0x82a0,0xca));var _0x082a=function(_0x5224ba,_0x3fb4e1){_0x5224ba=_0x5224ba-0x0;var _0x459bd2=_0x82a0[_0x5224ba];return _0x459bd2;};'use strict';var rp=require(_0x082a('0x0'));var util=require(_0x082a('0x1'));var _=require('lodash');var Mustache=require(_0x082a('0x2'));var logger=require(_0x082a('0x3'))(_0x082a('0x4'));exports[_0x082a('0x5')]=function(_0x57dc54,_0x27fe0c){var _0x19aa3a,_0x32069a;var _0x3060b={'method':_0x57dc54['data1']['toUpperCase'](),'uri':Mustache['render'](_0x57dc54['data2'],_0x27fe0c),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x57dc54[_0x082a('0x6')])===_0x082a('0x7')&&parseInt(_0x57dc54[_0x082a('0x6')])>=0x1&&parseInt(_0x57dc54[_0x082a('0x6')])<=0xa?parseInt(_0x57dc54[_0x082a('0x6')])*0x3e8:0x5*0x3e8};try{_0x3060b['headers']=_0x57dc54[_0x082a('0x8')]?JSON[_0x082a('0x9')](Mustache[_0x082a('0xa')](_0x57dc54[_0x082a('0x8')],_0x27fe0c)):{};}catch(_0x38aaf2){logger[_0x082a('0xb')](_0x38aaf2[_0x082a('0xc')]);}switch(_0x57dc54[_0x082a('0xd')][_0x082a('0xe')]()){case _0x082a('0xf'):case'DELETE':_0x19aa3a=null;_0x3060b['qs']=_0x27fe0c;break;case _0x082a('0x10'):case _0x082a('0x11'):if(_0x57dc54[_0x082a('0x12')]){try{_0x19aa3a=JSON[_0x082a('0x9')](Mustache[_0x082a('0xa')](_0x57dc54[_0x082a('0x12')],_0x27fe0c));_0x3060b[_0x082a('0x13')]=_0x19aa3a;}catch(_0xfa8295){logger[_0x082a('0xb')](_0xfa8295['stack']);logger[_0x082a('0xb')](_0x082a('0x14'));}}else{_0x19aa3a=_0x27fe0c;_0x3060b[_0x082a('0x13')]=_0x19aa3a;}break;}logger[_0x082a('0x15')](util[_0x082a('0x16')](_0x082a('0x17'),_0x57dc54[_0x082a('0xd')],_0x57dc54['data2'],JSON[_0x082a('0x18')](_0x3060b)));rp(_0x3060b)[_0x082a('0x19')](function(_0x7e4cb9){_0x19aa3a=!_[_0x082a('0x1a')](_0x19aa3a)?_0x082a('0x1b')+_0x19aa3a:'';_0x32069a=typeof _0x7e4cb9['body']==='object'?JSON[_0x082a('0x18')](_0x7e4cb9['body']):_0x7e4cb9['body'];logger['info'](util[_0x082a('0x16')](_0x082a('0x1c'),_0x57dc54['data1'],_0x57dc54[_0x082a('0x1d')],_0x7e4cb9[_0x082a('0x1e')],_0x32069a));})[_0x082a('0x1f')](function(_0x481ae0){logger[_0x082a('0xb')](util[_0x082a('0x16')](_0x082a('0x20'),_0x57dc54[_0x082a('0xd')],_0x57dc54['data2'],_0x481ae0[_0x082a('0x1e')],_0x481ae0['name'],_0x481ae0[_0x082a('0x21')]));});};
\ No newline at end of file
+var _0x6723=['error','toUpperCase','GET','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','stringify','then','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','lodash','mustache','../../../../config/logger','trigger','data1','render','data2','data5','headers','parse','data6'];(function(_0x41bbd7,_0x3041f8){var _0x116b13=function(_0x411319){while(--_0x411319){_0x41bbd7['push'](_0x41bbd7['shift']());}};_0x116b13(++_0x3041f8);}(_0x6723,0xb9));var _0x3672=function(_0x19ad27,_0x19f8fa){_0x19ad27=_0x19ad27-0x0;var _0x4de87d=_0x6723[_0x19ad27];return _0x4de87d;};'use strict';var rp=require(_0x3672('0x0'));var util=require(_0x3672('0x1'));var _=require(_0x3672('0x2'));var Mustache=require(_0x3672('0x3'));var logger=require(_0x3672('0x4'))(_0x3672('0x5'));exports['exec']=function(_0xb7b9ef,_0x5eb5d4){var _0x9e8cec,_0x222152;var _0x2ff7df={'method':_0xb7b9ef[_0x3672('0x6')]['toUpperCase'](),'uri':Mustache[_0x3672('0x7')](_0xb7b9ef[_0x3672('0x8')],_0x5eb5d4),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xb7b9ef[_0x3672('0x9')])==='number'&&parseInt(_0xb7b9ef['data5'])>=0x1&&parseInt(_0xb7b9ef[_0x3672('0x9')])<=0xa?parseInt(_0xb7b9ef[_0x3672('0x9')])*0x3e8:0x5*0x3e8};try{_0x2ff7df[_0x3672('0xa')]=_0xb7b9ef['data6']?JSON[_0x3672('0xb')](Mustache[_0x3672('0x7')](_0xb7b9ef[_0x3672('0xc')],_0x5eb5d4)):{};}catch(_0x132664){logger[_0x3672('0xd')](_0x132664['stack']);}switch(_0xb7b9ef[_0x3672('0x6')][_0x3672('0xe')]()){case _0x3672('0xf'):case _0x3672('0x10'):_0x9e8cec=null;_0x2ff7df['qs']=_0x5eb5d4;break;case _0x3672('0x11'):case _0x3672('0x12'):if(_0xb7b9ef[_0x3672('0x13')]){try{_0x9e8cec=JSON[_0x3672('0xb')](Mustache[_0x3672('0x7')](_0xb7b9ef[_0x3672('0x13')],_0x5eb5d4));_0x2ff7df['body']=_0x9e8cec;}catch(_0x2c8d60){logger[_0x3672('0xd')](_0x2c8d60['stack']);logger[_0x3672('0xd')](_0x3672('0x14'));}}else{_0x9e8cec=_0x5eb5d4;_0x2ff7df[_0x3672('0x15')]=_0x9e8cec;}break;}logger[_0x3672('0x16')](util[_0x3672('0x17')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0xb7b9ef['data1'],_0xb7b9ef[_0x3672('0x8')],JSON[_0x3672('0x18')](_0x2ff7df)));rp(_0x2ff7df)[_0x3672('0x19')](function(_0x3ffc6b){_0x9e8cec=!_[_0x3672('0x1a')](_0x9e8cec)?_0x3672('0x1b')+_0x9e8cec:'';_0x222152=typeof _0x3ffc6b[_0x3672('0x15')]==='object'?JSON[_0x3672('0x18')](_0x3ffc6b[_0x3672('0x15')]):_0x3ffc6b['body'];logger[_0x3672('0x16')](util['format'](_0x3672('0x1c'),_0xb7b9ef[_0x3672('0x6')],_0xb7b9ef['data2'],_0x3ffc6b[_0x3672('0x1d')],_0x222152));})[_0x3672('0x1e')](function(_0xd3ed13){logger[_0x3672('0xd')](util[_0x3672('0x17')](_0x3672('0x1f'),_0xb7b9ef['data1'],_0xb7b9ef[_0x3672('0x8')],_0xd3ed13['statusCode'],_0xd3ed13[_0x3672('0x20')],_0xd3ed13['message']));});};
\ No newline at end of file
index ece05f1..9be2ef6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98d2=['routing','client','http','request','then','debug','rpc','error','message','result','exports','bluebird'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x98d2,0x6b));var _0x298d=function(_0x19aa84,_0x549537){_0x19aa84=_0x19aa84-0x0;var _0x536146=_0x98d2[_0x19aa84];return _0x536146;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x298d('0x0'));var logger=require('../../config/logger')(_0x298d('0x1'));var client=jayson[_0x298d('0x2')][_0x298d('0x3')]({'port':0x2329});client['Request']=function(_0x10b7b1,_0x176e81){return new BPromise(function(_0x10c1a4,_0x6ad218){return client[_0x298d('0x4')](_0x10b7b1,_0x176e81)[_0x298d('0x5')](function(_0x47ddb7){logger[_0x298d('0x6')](_0x298d('0x7'),_0x298d('0x1'),_0x10b7b1,_0x176e81,_0x47ddb7);if(_0x47ddb7['error']){logger[_0x298d('0x8')]('rpc',_0x298d('0x1'),_0x10b7b1,_0x47ddb7[_0x298d('0x8')][_0x298d('0x9')],_0x176e81);return _0x6ad218(_0x47ddb7['error'][_0x298d('0x9')]);}else{return _0x10c1a4(_0x47ddb7[_0x298d('0xa')]);}})['catch'](function(_0x3bb987){logger[_0x298d('0x8')]('rpc',_0x298d('0x1'),_0x10b7b1,_0x3bb987,_0x176e81);return _0x6ad218(_0x3bb987);});});};module[_0x298d('0xb')]=client;
\ No newline at end of file
+var _0x895a=['catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','then','error','rpc','message'];(function(_0x594e39,_0x3687f3){var _0x454737=function(_0x123f4f){while(--_0x123f4f){_0x594e39['push'](_0x594e39['shift']());}};_0x454737(++_0x3687f3);}(_0x895a,0x1d6));var _0xa895=function(_0x41aacf,_0xace403){_0x41aacf=_0x41aacf-0x0;var _0x4fe53a=_0x895a[_0x41aacf];return _0x4fe53a;};'use strict';var jayson=require(_0xa895('0x0'));var BPromise=require(_0xa895('0x1'));var logger=require(_0xa895('0x2'))(_0xa895('0x3'));var client=jayson[_0xa895('0x4')]['http']({'port':0x2329});client[_0xa895('0x5')]=function(_0x102cba,_0xe2282d){return new BPromise(function(_0x5ded8f,_0x5655c1){return client['request'](_0x102cba,_0xe2282d)[_0xa895('0x6')](function(_0xdaec3c){logger['debug']('rpc',_0xa895('0x3'),_0x102cba,_0xe2282d,_0xdaec3c);if(_0xdaec3c[_0xa895('0x7')]){logger[_0xa895('0x7')](_0xa895('0x8'),_0xa895('0x3'),_0x102cba,_0xdaec3c[_0xa895('0x7')][_0xa895('0x9')],_0xe2282d);return _0x5655c1(_0xdaec3c[_0xa895('0x7')][_0xa895('0x9')]);}else{return _0x5ded8f(_0xdaec3c['result']);}})[_0xa895('0xa')](function(_0x18e199){logger[_0xa895('0x7')](_0xa895('0x8'),_0xa895('0x3'),_0x102cba,_0x18e199,_0xe2282d);return _0x5655c1(_0x18e199);});});};module[_0xa895('0xb')]=client;
\ No newline at end of file
index ea294ff..02fe3ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0b3=['./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','catch','bluebird','./server','./realtime','./lib/email'];(function(_0x10d03a,_0x453026){var _0x4663bf=function(_0x5296f3){while(--_0x5296f3){_0x10d03a['push'](_0x10d03a['shift']());}};_0x4663bf(++_0x453026);}(_0xe0b3,0x1e6));var _0x3e0b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0b3[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x3e0b('0x0'));var server=require(_0x3e0b('0x1'));var Realtime=require(_0x3e0b('0x2'));var EmailChannel=require(_0x3e0b('0x3'));var mailAccount=require(_0x3e0b('0x4'));var setting=require(_0x3e0b('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x3e0b('0x6')]()[_0x3e0b('0x7')](mailAccount[_0x3e0b('0x8')]())[_0x3e0b('0x7')](realtime[_0x3e0b('0x9')]())[_0x3e0b('0x7')](function(){email['refresh'](realtime[_0x3e0b('0xa')]);return realtime;});}function main(){return server[_0x3e0b('0xb')](realtime,email)[_0x3e0b('0x7')](function(){return initRealtime();})[_0x3e0b('0x7')](function(){return setting[_0x3e0b('0xc')]();})['then'](function(_0x4e3800){return setInterval(initRealtime,_0x4e3800['loginMailFrequency']*0x3e8);})[_0x3e0b('0xd')](function(_0x5b313b){console['log'](_0x5b313b);});}main();
\ No newline at end of file
+var _0x1373=['bluebird','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','log'];(function(_0x3ed53c,_0x4ba8b2){var _0x4fef1e=function(_0x57d1a3){while(--_0x57d1a3){_0x3ed53c['push'](_0x3ed53c['shift']());}};_0x4fef1e(++_0x4ba8b2);}(_0x1373,0x1e1));var _0x3137=function(_0x1b4d7c,_0x139e05){_0x1b4d7c=_0x1b4d7c-0x0;var _0x3076b7=_0x1373[_0x1b4d7c];return _0x3076b7;};'use strict';var BPromise=require(_0x3137('0x0'));var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0x3137('0x1'));var mailAccount=require(_0x3137('0x2'));var setting=require(_0x3137('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x3137('0x4')]()[_0x3137('0x5')](mailAccount[_0x3137('0x6')]())['then'](realtime[_0x3137('0x7')]())['then'](function(){email[_0x3137('0x8')](realtime[_0x3137('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x3137('0x5')](function(){return initRealtime();})['then'](function(){return setting[_0x3137('0xa')]();})[_0x3137('0x5')](function(_0x5ee544){return setInterval(initRealtime,_0x5ee544[_0x3137('0xb')]*0x3e8);})['catch'](function(_0x4581ed){console[_0x3137('0xc')](_0x4581ed);});}main();
\ No newline at end of file
index 8e0756b..e28ecd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f9c=['verify','then','verified','lodash','moment','md5','ioredis','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','../rpc/mailAccount','info','mailAccounts','prototype','name','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','imapAccounts','box','bind','end','error','handleImapError','disabled','emit','handleImapBox','connected','messages','handleImapEmail','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','sendMail','smtp','send','verifySmtp','Smtp','lastSync'];(function(_0x604173,_0x455db3){var _0x5bf51a=function(_0x50745c){while(--_0x50745c){_0x604173['push'](_0x604173['shift']());}};_0x5bf51a(++_0x455db3);}(_0x6f9c,0x147));var _0xc6f9=function(_0x4746b5,_0x3a9d28){_0x4746b5=_0x4746b5-0x0;var _0x23a130=_0x6f9c[_0x4746b5];return _0x23a130;};'use strict';var _=require(_0xc6f9('0x0'));var moment=require(_0xc6f9('0x1'));var BPromise=require('bluebird');var md5=require(_0xc6f9('0x2'));var Redis=require(_0xc6f9('0x3'));var config=require('../../../config/environment');var logger=require(_0xc6f9('0x4'))(_0xc6f9('0x5'));config[_0xc6f9('0x6')]=_[_0xc6f9('0x7')](config[_0xc6f9('0x6')],{'host':_0xc6f9('0x8'),'port':0x18eb});var io=require(_0xc6f9('0x9'))(new Redis(config[_0xc6f9('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0xc6f9('0xa'));var md5Accounts={};function EmailChannel(_0x115c6b){logger[_0xc6f9('0xb')]('start\x20email\x20channel');this[_0xc6f9('0xc')]=_0x115c6b[_0xc6f9('0xc')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0xc6f9('0xd')]['emit']=function(_0x2c8246){var _0x38ab17=this[_0xc6f9('0xc')][_0x2c8246];var _0x841001={'id':_0x38ab17['id'],'name':_0x38ab17[_0xc6f9('0xe')],'key':_0x38ab17[_0xc6f9('0xf')],'active':_0x38ab17[_0xc6f9('0x10')],'Imap':{'status':_0x38ab17[_0xc6f9('0x11')][_0xc6f9('0x12')],'messageStatus':_0x38ab17[_0xc6f9('0x11')][_0xc6f9('0x13')],'total':_0x38ab17[_0xc6f9('0x11')][_0xc6f9('0x14')]}};if(_[_0xc6f9('0x15')](md5Accounts[_0x2c8246])){md5Accounts[_0x2c8246]={};}var _0xf8acd8=md5(JSON[_0xc6f9('0x16')](_0x841001));if(md5Accounts[_0x2c8246][_0xc6f9('0x2')]!==_0xf8acd8){md5Accounts[_0x2c8246][_0xc6f9('0x2')]=_0xf8acd8;io['emit'](_0xc6f9('0x17'),_0x841001);}};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x18')]=function(_0x51da2a){for(var _0x416f03 in _0x51da2a){if(_0x51da2a[_0xc6f9('0x19')](_0x416f03)){if(_0x51da2a[_0x416f03]['Imap']&&_0x51da2a[_0x416f03]['active']){var _0x36dc35=_0x51da2a[_0x416f03][_0xc6f9('0x11')];if(!this[_0xc6f9('0x1a')][_0xc6f9('0x19')](_0x36dc35['id'])){this[_0xc6f9('0x1a')][_0x36dc35['id']]=new EmailImap(_0x36dc35,_0x51da2a[_0x416f03]['email']);this[_0xc6f9('0x1a')][_0x36dc35['id']]['on'](_0xc6f9('0x1b'),this['handleImapBox'][_0xc6f9('0x1c')](this,_0x416f03));this['imapAccounts'][_0x36dc35['id']]['on'](_0xc6f9('0x5'),this['handleImapEmail'][_0xc6f9('0x1c')](this,_0x416f03));this[_0xc6f9('0x1a')][_0x36dc35['id']]['on'](_0xc6f9('0x1d'),this['handleImapEnd'][_0xc6f9('0x1c')](this,_0x416f03));this[_0xc6f9('0x1a')][_0x36dc35['id']]['on'](_0xc6f9('0x1e'),this[_0xc6f9('0x1f')][_0xc6f9('0x1c')](this,_0x416f03));}}else{if(_[_0xc6f9('0x15')](this[_0xc6f9('0xc')][_0x416f03][_0xc6f9('0x11')])){this[_0xc6f9('0xc')][_0x416f03][_0xc6f9('0x11')]={};}this[_0xc6f9('0xc')][_0x416f03][_0xc6f9('0x11')][_0xc6f9('0x12')]=_0xc6f9('0x20');this['mailAccounts'][_0x416f03][_0xc6f9('0x11')]['messageStatus']='';this[_0xc6f9('0x21')](_0x416f03);}}}};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x22')]=function(_0x6029e0,_0x3dd28b){if(this[_0xc6f9('0xc')][_0x6029e0]){this[_0xc6f9('0xc')][_0x6029e0]['Imap'][_0xc6f9('0x12')]=_0xc6f9('0x23');this[_0xc6f9('0xc')][_0x6029e0]['Imap'][_0xc6f9('0x13')]=_0x3dd28b[_0xc6f9('0xe')];if(_0x3dd28b[_0xc6f9('0x24')]){this['mailAccounts'][_0x6029e0][_0xc6f9('0x11')][_0xc6f9('0x14')]=_0x3dd28b[_0xc6f9('0x24')]['total'];}return this[_0xc6f9('0x21')](_0x6029e0);}};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x25')]=function(_0x5a37b5,_0x1790f8){logger[_0xc6f9('0xb')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x1790f8['firstName'],_0x1790f8[_0xc6f9('0x26')],_0x1790f8[_0xc6f9('0x27')],_0x5a37b5);if(this[_0xc6f9('0xc')][_0x5a37b5]){return mailAccount[_0xc6f9('0x28')](_0x5a37b5,_0x1790f8)['then'](function(_0x19a8cd){if(_0x19a8cd){logger[_0xc6f9('0xb')](_0xc6f9('0x29'));}})[_0xc6f9('0x2a')](function(_0xe0f75d){logger[_0xc6f9('0x1e')](_0xc6f9('0x2b'),JSON[_0xc6f9('0x16')](_0xe0f75d));});}};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x2c')]=function(_0x29d1c5){if(this[_0xc6f9('0xc')][_0x29d1c5]&&this[_0xc6f9('0xc')][_0x29d1c5]['Imap']){if(this[_0xc6f9('0x1a')][this[_0xc6f9('0xc')][_0x29d1c5]['Imap']['id']]){delete this['imapAccounts'][this[_0xc6f9('0xc')][_0x29d1c5]['Imap']['id']];}this['mailAccounts'][_0x29d1c5][_0xc6f9('0x11')]['lastSync']=moment();this[_0xc6f9('0x21')](_0x29d1c5);}};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x1f')]=function(_0x5f2e23,_0x508995){if(this[_0xc6f9('0xc')][_0x5f2e23]){this['mailAccounts'][_0x5f2e23][_0xc6f9('0x11')]['status']=_0xc6f9('0x1e');this[_0xc6f9('0xc')][_0x5f2e23]['Imap'][_0xc6f9('0x13')]=_0x508995;return this['emit'](_0x5f2e23);}};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x2d')]=function(_0x18bd43,_0x2ddd21){return this[_0xc6f9('0x2e')][_0xc6f9('0x2f')](_0x18bd43,_0x2ddd21);};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x30')]=function(_0x2a3c13){var _0x3b55e=this;if(this['mailAccounts'][_0x2a3c13['id']]){if(_[_0xc6f9('0x15')](this[_0xc6f9('0xc')][_0x2a3c13['id']][_0xc6f9('0x31')])){this[_0xc6f9('0xc')][_0x2a3c13['id']][_0xc6f9('0x31')]={};}this[_0xc6f9('0xc')][_0x2a3c13['id']][_0xc6f9('0x31')][_0xc6f9('0x32')]=moment();return new BPromise(function(_0x2c0f2e,_0xdbc2c9){return _0x3b55e['smtp'][_0xc6f9('0x33')](_0x2a3c13)[_0xc6f9('0x34')](function(_0x36645a){_0x3b55e[_0xc6f9('0xc')][_0x2a3c13['id']][_0xc6f9('0x31')][_0xc6f9('0x12')]=_0xc6f9('0x35');_0x3b55e['mailAccounts'][_0x2a3c13['id']][_0xc6f9('0x31')][_0xc6f9('0x13')]='';_0x3b55e[_0xc6f9('0x21')](_0x2a3c13['id']);_0x2c0f2e(_0x36645a);})[_0xc6f9('0x2a')](function(_0x386e86){_0x3b55e[_0xc6f9('0xc')][_0x2a3c13['id']][_0xc6f9('0x31')][_0xc6f9('0x12')]=_0xc6f9('0x1e');_0x3b55e[_0xc6f9('0xc')][_0x2a3c13['id']][_0xc6f9('0x31')][_0xc6f9('0x13')]=_0x386e86;_0x3b55e['emit'](_0x2a3c13['id']);_0xdbc2c9(_0x386e86);});});}return this['smtp'][_0xc6f9('0x33')](_0x2a3c13);};module['exports']=EmailChannel;
\ No newline at end of file
+var _0xc4f3=['hasOwnProperty','active','email','bind','handleImapEmail','end','handleImapEnd','error','handleImapBox','messages','firstName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','Smtp','verify','verified','exports','moment','md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update'];(function(_0x96e6a0,_0x57dafa){var _0x173557=function(_0x19f57d){while(--_0x19f57d){_0x96e6a0['push'](_0x96e6a0['shift']());}};_0x173557(++_0x57dafa);}(_0xc4f3,0x1e3));var _0x3c4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4f3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0x3c4f('0x0'));var BPromise=require('bluebird');var md5=require(_0x3c4f('0x1'));var Redis=require(_0x3c4f('0x2'));var config=require(_0x3c4f('0x3'));var logger=require(_0x3c4f('0x4'))('email');config[_0x3c4f('0x5')]=_[_0x3c4f('0x6')](config[_0x3c4f('0x5')],{'host':_0x3c4f('0x7'),'port':0x18eb});var io=require(_0x3c4f('0x8'))(new Redis(config[_0x3c4f('0x5')]));var EmailImap=require(_0x3c4f('0x9'));var EmailSmtp=require(_0x3c4f('0xa'));var mailAccount=require(_0x3c4f('0xb'));var md5Accounts={};function EmailChannel(_0x35c867){logger[_0x3c4f('0xc')](_0x3c4f('0xd'));this[_0x3c4f('0xe')]=_0x35c867[_0x3c4f('0xe')];this[_0x3c4f('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x3c4f('0x10')][_0x3c4f('0x11')]=function(_0x448854){var _0x15098c=this[_0x3c4f('0xe')][_0x448854];var _0x702b4b={'id':_0x15098c['id'],'name':_0x15098c[_0x3c4f('0x12')],'key':_0x15098c[_0x3c4f('0x13')],'active':_0x15098c['active'],'Imap':{'status':_0x15098c[_0x3c4f('0x14')][_0x3c4f('0x15')],'messageStatus':_0x15098c['Imap'][_0x3c4f('0x16')],'total':_0x15098c[_0x3c4f('0x14')][_0x3c4f('0x17')]}};if(_[_0x3c4f('0x18')](md5Accounts[_0x448854])){md5Accounts[_0x448854]={};}var _0x1448dd=md5(JSON[_0x3c4f('0x19')](_0x702b4b));if(md5Accounts[_0x448854]['md5']!==_0x1448dd){md5Accounts[_0x448854][_0x3c4f('0x1')]=_0x1448dd;io[_0x3c4f('0x11')](_0x3c4f('0x1a'),_0x702b4b);}};EmailChannel[_0x3c4f('0x10')]['refresh']=function(_0x11aa2f){for(var _0x27e07b in _0x11aa2f){if(_0x11aa2f[_0x3c4f('0x1b')](_0x27e07b)){if(_0x11aa2f[_0x27e07b][_0x3c4f('0x14')]&&_0x11aa2f[_0x27e07b][_0x3c4f('0x1c')]){var _0x4113d7=_0x11aa2f[_0x27e07b]['Imap'];if(!this[_0x3c4f('0xf')]['hasOwnProperty'](_0x4113d7['id'])){this[_0x3c4f('0xf')][_0x4113d7['id']]=new EmailImap(_0x4113d7,_0x11aa2f[_0x27e07b][_0x3c4f('0x1d')]);this['imapAccounts'][_0x4113d7['id']]['on']('box',this['handleImapBox'][_0x3c4f('0x1e')](this,_0x27e07b));this[_0x3c4f('0xf')][_0x4113d7['id']]['on'](_0x3c4f('0x1d'),this[_0x3c4f('0x1f')][_0x3c4f('0x1e')](this,_0x27e07b));this['imapAccounts'][_0x4113d7['id']]['on'](_0x3c4f('0x20'),this[_0x3c4f('0x21')][_0x3c4f('0x1e')](this,_0x27e07b));this[_0x3c4f('0xf')][_0x4113d7['id']]['on'](_0x3c4f('0x22'),this['handleImapError'][_0x3c4f('0x1e')](this,_0x27e07b));}}else{if(_[_0x3c4f('0x18')](this[_0x3c4f('0xe')][_0x27e07b]['Imap'])){this['mailAccounts'][_0x27e07b][_0x3c4f('0x14')]={};}this['mailAccounts'][_0x27e07b]['Imap'][_0x3c4f('0x15')]='disabled';this[_0x3c4f('0xe')][_0x27e07b][_0x3c4f('0x14')][_0x3c4f('0x16')]='';this[_0x3c4f('0x11')](_0x27e07b);}}}};EmailChannel[_0x3c4f('0x10')][_0x3c4f('0x23')]=function(_0xe2f43a,_0x522f83){if(this[_0x3c4f('0xe')][_0xe2f43a]){this[_0x3c4f('0xe')][_0xe2f43a][_0x3c4f('0x14')]['status']='connected';this[_0x3c4f('0xe')][_0xe2f43a][_0x3c4f('0x14')][_0x3c4f('0x16')]=_0x522f83[_0x3c4f('0x12')];if(_0x522f83[_0x3c4f('0x24')]){this[_0x3c4f('0xe')][_0xe2f43a][_0x3c4f('0x14')]['total']=_0x522f83[_0x3c4f('0x24')][_0x3c4f('0x17')];}return this[_0x3c4f('0x11')](_0xe2f43a);}};EmailChannel[_0x3c4f('0x10')]['handleImapEmail']=function(_0x277e38,_0x175141){logger[_0x3c4f('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x175141[_0x3c4f('0x25')],_0x175141['lastName'],_0x175141[_0x3c4f('0x26')],_0x277e38);if(this[_0x3c4f('0xe')][_0x277e38]){return mailAccount[_0x3c4f('0x27')](_0x277e38,_0x175141)['then'](function(_0x2a2611){if(_0x2a2611){logger[_0x3c4f('0xc')](_0x3c4f('0x28'));}})[_0x3c4f('0x29')](function(_0x5ec866){logger['error'](_0x3c4f('0x2a'),JSON[_0x3c4f('0x19')](_0x5ec866));});}};EmailChannel[_0x3c4f('0x10')][_0x3c4f('0x21')]=function(_0x241e61){if(this[_0x3c4f('0xe')][_0x241e61]&&this[_0x3c4f('0xe')][_0x241e61][_0x3c4f('0x14')]){if(this[_0x3c4f('0xf')][this['mailAccounts'][_0x241e61][_0x3c4f('0x14')]['id']]){delete this[_0x3c4f('0xf')][this[_0x3c4f('0xe')][_0x241e61][_0x3c4f('0x14')]['id']];}this[_0x3c4f('0xe')][_0x241e61][_0x3c4f('0x14')][_0x3c4f('0x2b')]=moment();this[_0x3c4f('0x11')](_0x241e61);}};EmailChannel[_0x3c4f('0x10')]['handleImapError']=function(_0x235791,_0x4f9b99){if(this['mailAccounts'][_0x235791]){this['mailAccounts'][_0x235791][_0x3c4f('0x14')][_0x3c4f('0x15')]=_0x3c4f('0x22');this[_0x3c4f('0xe')][_0x235791]['Imap'][_0x3c4f('0x16')]=_0x4f9b99;return this[_0x3c4f('0x11')](_0x235791);}};EmailChannel['prototype'][_0x3c4f('0x2c')]=function(_0x4790f0,_0x3c0993){return this[_0x3c4f('0x2d')][_0x3c4f('0x2e')](_0x4790f0,_0x3c0993);};EmailChannel['prototype']['verifySmtp']=function(_0x38dcc7){var _0xabe694=this;if(this[_0x3c4f('0xe')][_0x38dcc7['id']]){if(_[_0x3c4f('0x18')](this[_0x3c4f('0xe')][_0x38dcc7['id']][_0x3c4f('0x2f')])){this[_0x3c4f('0xe')][_0x38dcc7['id']][_0x3c4f('0x2f')]={};}this[_0x3c4f('0xe')][_0x38dcc7['id']][_0x3c4f('0x2f')][_0x3c4f('0x2b')]=moment();return new BPromise(function(_0x408a78,_0x3b9e6a){return _0xabe694[_0x3c4f('0x2d')][_0x3c4f('0x30')](_0x38dcc7)['then'](function(_0x65dc7d){_0xabe694[_0x3c4f('0xe')][_0x38dcc7['id']]['Smtp'][_0x3c4f('0x15')]=_0x3c4f('0x31');_0xabe694['mailAccounts'][_0x38dcc7['id']]['Smtp']['messageStatus']='';_0xabe694[_0x3c4f('0x11')](_0x38dcc7['id']);_0x408a78(_0x65dc7d);})[_0x3c4f('0x29')](function(_0x1dd0d7){_0xabe694[_0x3c4f('0xe')][_0x38dcc7['id']]['Smtp']['status']=_0x3c4f('0x22');_0xabe694['mailAccounts'][_0x38dcc7['id']][_0x3c4f('0x2f')][_0x3c4f('0x16')]=_0x1dd0d7;_0xabe694['emit'](_0x38dcc7['id']);_0x3b9e6a(_0x1dd0d7);});});}return this[_0x3c4f('0x2d')][_0x3c4f('0x30')](_0x38dcc7);};module[_0x3c4f('0x32')]=EmailChannel;
\ No newline at end of file
index 85dcec9..a47fbfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77f4=['stringify','textCode','hasOwnProperty','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','events','./utils','mailbox','INBOX','account','getAccount','once','handleReady','bind','end','handleEnd','error','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','email','openBox','handleOpenBox','emit','readUnseen','search','UNSEEN','handleReadUnseen','handleError','length','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x77f4,0x1a1));var _0x477f=function(_0x545c72,_0x250789){_0x545c72=_0x545c72-0x0;var _0x75fb2e=_0x77f4[_0x545c72];return _0x75fb2e;};'use strict';var fs=require('fs');var path=require(_0x477f('0x0'));var util=require(_0x477f('0x1'));var Imap=require(_0x477f('0x2'));var _=require(_0x477f('0x3'));var rs=require(_0x477f('0x4'));var simpleParser=require(_0x477f('0x5'))[_0x477f('0x6')];var Iconv=require(_0x477f('0x7'))['Iconv'];var EventEmitter=require(_0x477f('0x8'))['EventEmitter'];var utils=require(_0x477f('0x9'));var logger=require('../../../config/logger')('email');function EmailImap(_0x16eb7d,_0x56912c){this[_0x477f('0xa')]=_0x477f('0xb');this[_0x477f('0xc')]=this[_0x477f('0xd')](_0x16eb7d,_0x56912c);this['imap']=new Imap(this['account']);this[_0x477f('0x2')][_0x477f('0xe')]('ready',this[_0x477f('0xf')][_0x477f('0x10')](this));this[_0x477f('0x2')][_0x477f('0xe')](_0x477f('0x11'),this[_0x477f('0x12')]['bind'](this));this[_0x477f('0x2')]['on'](_0x477f('0x13'),this['handleError'][_0x477f('0x10')](this));this['imap']['connect']();}util[_0x477f('0x14')](EmailImap,EventEmitter);EmailImap[_0x477f('0x15')][_0x477f('0xd')]=function(_0x3d184c,_0x30cab5){var _0x337525={'connTimeout':_0x3d184c['connTimeout']?_0x3d184c[_0x477f('0x16')]*0x3e8:0x2710,'authTimeout':_0x3d184c[_0x477f('0x17')]?_0x3d184c['authTimeout']*0x3e8:0x1388};if(_[_0x477f('0x18')](_0x3d184c[_0x477f('0x19')])){if(_0x3d184c[_0x477f('0x1a')]){_0x337525['user']=_0x3d184c[_0x477f('0x1b')];_0x337525[_0x477f('0x1c')]=_0x3d184c[_0x477f('0x1c')];}_0x337525[_0x477f('0x1d')]=_0x3d184c['host'];_0x337525[_0x477f('0x1e')]=_0x3d184c[_0x477f('0x1e')]||0x3e1;if(_0x3d184c[_0x477f('0x1f')]){_0x337525[_0x477f('0x1f')]=!![];}else{_0x337525[_0x477f('0x1f')]=![];_0x337525[_0x477f('0x20')]=_0x477f('0x21');}}else{_0x337525[_0x477f('0x1b')]=_0x3d184c[_0x477f('0x1b')];_0x337525[_0x477f('0x1c')]=_0x3d184c['password'];_0x337525[_0x477f('0x1d')]=utils['getHost'](_0x3d184c['service']);_0x337525['port']=0x3e1;_0x337525[_0x477f('0x1f')]=!![];}_0x337525[_0x477f('0x22')]=_0x30cab5||_0x3d184c['user']||'anonymous@xcally.com';return _0x337525;};EmailImap[_0x477f('0x15')]['handleReady']=function(){this[_0x477f('0x2')][_0x477f('0x23')](this[_0x477f('0xa')],![],this['handleOpenBox'][_0x477f('0x10')](this));};EmailImap[_0x477f('0x15')][_0x477f('0x24')]=function(_0x2d5ddc,_0xf0406d){if(_0x2d5ddc){this['handleError'](_0x2d5ddc,!![]);}else{this[_0x477f('0x25')]('box',_0xf0406d);this['readUnseen']();}};EmailImap[_0x477f('0x15')]['handleCloseBox']=function(_0x4a86a0){if(_0x4a86a0){this['handleError'](_0x4a86a0,!![]);}else{this[_0x477f('0x2')][_0x477f('0x11')]();}};EmailImap[_0x477f('0x15')][_0x477f('0x26')]=function(){this[_0x477f('0x2')][_0x477f('0x27')]([_0x477f('0x28')],this[_0x477f('0x29')][_0x477f('0x10')](this));};EmailImap[_0x477f('0x15')][_0x477f('0x29')]=function(_0x2a58b7,_0x4d65f2){if(_0x2a58b7){this[_0x477f('0x2a')](_0x2a58b7,!![]);}else{if(_0x4d65f2[_0x477f('0x2b')]){try{var _0x47b20a=this['imap']['fetch'](_0x4d65f2,{'bodies':'','markSeen':!![]});_0x47b20a['on']('message',this[_0x477f('0x2c')][_0x477f('0x10')](this));_0x47b20a[_0x477f('0xe')]('error',this[_0x477f('0x2d')]['bind'](this));_0x47b20a[_0x477f('0xe')]('end',this[_0x477f('0x2e')][_0x477f('0x10')](this));}catch(_0x1c714d){logger['error'](_0x1c714d);}}else{this['imap'][_0x477f('0x2f')](!![],this[_0x477f('0x30')][_0x477f('0x10')](this));}}};EmailImap[_0x477f('0x15')][_0x477f('0x2c')]=function(_0x49de0f,_0x2fb0db){_0x49de0f['on'](_0x477f('0x31'),this[_0x477f('0x32')][_0x477f('0x10')](this));_0x49de0f[_0x477f('0xe')](_0x477f('0x33'),this[_0x477f('0x34')][_0x477f('0x10')](this));_0x49de0f[_0x477f('0xe')](_0x477f('0x11'),this['handleMessageEnd'][_0x477f('0x10')](this));};EmailImap[_0x477f('0x15')][_0x477f('0x32')]=function(_0x1d14cf,_0x1e8d34){simpleParser(_0x1d14cf,{'Iconv':Iconv},this[_0x477f('0x35')][_0x477f('0x10')](this));};EmailImap[_0x477f('0x15')]['handleMessageAttributes']=function(_0x14c994){};EmailImap['prototype'][_0x477f('0x36')]=function(){};EmailImap[_0x477f('0x15')][_0x477f('0x35')]=function(_0x4a8c71,_0x13ec77){if(_0x4a8c71){logger['error'](_0x4a8c71);}else{var _0x34de03=this;utils['parser'](this[_0x477f('0xc')],_0x13ec77,function(_0x2d839e){_0x34de03[_0x477f('0x25')](_0x477f('0x22'),_0x2d839e);});}};EmailImap[_0x477f('0x15')][_0x477f('0x2e')]=function(){this[_0x477f('0x2')][_0x477f('0x2f')](!![],this[_0x477f('0x30')][_0x477f('0x10')](this));};EmailImap['prototype'][_0x477f('0x2d')]=function(_0x1c9760){this['handleError'](_0x1c9760);this[_0x477f('0x2')][_0x477f('0x2f')](!![],this[_0x477f('0x30')][_0x477f('0x10')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x477f('0x25')](_0x477f('0x11'));};EmailImap[_0x477f('0x15')]['handleError']=function(_0x7e3d02,_0x9dadc0){logger['error'](_0x477f('0x2a'),this['account'][_0x477f('0x22')],JSON[_0x477f('0x37')](_0x7e3d02));var _0x1db340='';if(_0x7e3d02){if(_0x7e3d02['textCode']){_0x1db340=_0x7e3d02[_0x477f('0x38')];}else{for(var _0x408d34 in _0x7e3d02){if(_0x7e3d02[_0x477f('0x39')](_0x408d34)){_0x1db340+=_['upperFirst'](_0x408d34)+':\x20'+_0x7e3d02[_0x408d34]+'\x0a';}}}}if(_0x9dadc0){this[_0x477f('0x2')][_0x477f('0x11')]();}else{this[_0x477f('0x25')](_0x477f('0x13'),_0x1db340);this['emit']('end');}};module[_0x477f('0x3a')]=EmailImap;
\ No newline at end of file
+var _0x863e=['getAccount','ready','handleReady','bind','once','end','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','getHost','openBox','mailbox','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','error','handleFetchError','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','handleFetchEnd','handleEnd','stringify','textCode','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','account'];(function(_0x5deb2d,_0x16ea89){var _0x45b63a=function(_0x5476be){while(--_0x5476be){_0x5deb2d['push'](_0x5deb2d['shift']());}};_0x45b63a(++_0x16ea89);}(_0x863e,0x1f1));var _0xe863=function(_0x4e07d9,_0x479fff){_0x4e07d9=_0x4e07d9-0x0;var _0x31eeea=_0x863e[_0x4e07d9];return _0x31eeea;};'use strict';var fs=require('fs');var path=require(_0xe863('0x0'));var util=require(_0xe863('0x1'));var Imap=require(_0xe863('0x2'));var _=require(_0xe863('0x3'));var rs=require(_0xe863('0x4'));var simpleParser=require(_0xe863('0x5'))[_0xe863('0x6')];var Iconv=require('iconv')[_0xe863('0x7')];var EventEmitter=require(_0xe863('0x8'))[_0xe863('0x9')];var utils=require(_0xe863('0xa'));var logger=require(_0xe863('0xb'))(_0xe863('0xc'));function EmailImap(_0x42031b,_0x9d183c){this['mailbox']=_0xe863('0xd');this[_0xe863('0xe')]=this[_0xe863('0xf')](_0x42031b,_0x9d183c);this[_0xe863('0x2')]=new Imap(this[_0xe863('0xe')]);this[_0xe863('0x2')]['once'](_0xe863('0x10'),this[_0xe863('0x11')][_0xe863('0x12')](this));this[_0xe863('0x2')][_0xe863('0x13')](_0xe863('0x14'),this['handleEnd']['bind'](this));this[_0xe863('0x2')]['on']('error',this[_0xe863('0x15')][_0xe863('0x12')](this));this[_0xe863('0x2')][_0xe863('0x16')]();}util[_0xe863('0x17')](EmailImap,EventEmitter);EmailImap[_0xe863('0x18')]['getAccount']=function(_0x1e4b68,_0x47b3cc){var _0x273af8={'connTimeout':_0x1e4b68['connTimeout']?_0x1e4b68[_0xe863('0x19')]*0x3e8:0x2710,'authTimeout':_0x1e4b68[_0xe863('0x1a')]?_0x1e4b68[_0xe863('0x1a')]*0x3e8:0x1388};if(_[_0xe863('0x1b')](_0x1e4b68[_0xe863('0x1c')])){if(_0x1e4b68['authentication']){_0x273af8[_0xe863('0x1d')]=_0x1e4b68[_0xe863('0x1d')];_0x273af8[_0xe863('0x1e')]=_0x1e4b68['password'];}_0x273af8[_0xe863('0x1f')]=_0x1e4b68[_0xe863('0x1f')];_0x273af8[_0xe863('0x20')]=_0x1e4b68[_0xe863('0x20')]||0x3e1;if(_0x1e4b68[_0xe863('0x21')]){_0x273af8[_0xe863('0x21')]=!![];}else{_0x273af8[_0xe863('0x21')]=![];_0x273af8['autotls']='required';}}else{_0x273af8[_0xe863('0x1d')]=_0x1e4b68[_0xe863('0x1d')];_0x273af8[_0xe863('0x1e')]=_0x1e4b68[_0xe863('0x1e')];_0x273af8[_0xe863('0x1f')]=utils[_0xe863('0x22')](_0x1e4b68[_0xe863('0x1c')]);_0x273af8[_0xe863('0x20')]=0x3e1;_0x273af8[_0xe863('0x21')]=!![];}_0x273af8['email']=_0x47b3cc||_0x1e4b68[_0xe863('0x1d')]||'anonymous@xcally.com';return _0x273af8;};EmailImap[_0xe863('0x18')][_0xe863('0x11')]=function(){this[_0xe863('0x2')][_0xe863('0x23')](this[_0xe863('0x24')],![],this[_0xe863('0x25')][_0xe863('0x12')](this));};EmailImap[_0xe863('0x18')][_0xe863('0x25')]=function(_0x54117e,_0x36a4f8){if(_0x54117e){this[_0xe863('0x15')](_0x54117e,!![]);}else{this[_0xe863('0x26')](_0xe863('0x27'),_0x36a4f8);this[_0xe863('0x28')]();}};EmailImap[_0xe863('0x18')]['handleCloseBox']=function(_0x4a06b3){if(_0x4a06b3){this[_0xe863('0x15')](_0x4a06b3,!![]);}else{this[_0xe863('0x2')][_0xe863('0x14')]();}};EmailImap[_0xe863('0x18')]['readUnseen']=function(){this[_0xe863('0x2')][_0xe863('0x29')]([_0xe863('0x2a')],this[_0xe863('0x2b')][_0xe863('0x12')](this));};EmailImap['prototype'][_0xe863('0x2b')]=function(_0x415198,_0x385e23){if(_0x415198){this[_0xe863('0x15')](_0x415198,!![]);}else{if(_0x385e23[_0xe863('0x2c')]){try{var _0x26eb22=this['imap']['fetch'](_0x385e23,{'bodies':'','markSeen':!![]});_0x26eb22['on'](_0xe863('0x2d'),this[_0xe863('0x2e')][_0xe863('0x12')](this));_0x26eb22[_0xe863('0x13')](_0xe863('0x2f'),this[_0xe863('0x30')][_0xe863('0x12')](this));_0x26eb22['once'](_0xe863('0x14'),this['handleFetchEnd'][_0xe863('0x12')](this));}catch(_0x1b79a0){logger[_0xe863('0x2f')](_0x1b79a0);}}else{this[_0xe863('0x2')][_0xe863('0x31')](!![],this[_0xe863('0x32')][_0xe863('0x12')](this));}}};EmailImap[_0xe863('0x18')][_0xe863('0x2e')]=function(_0x555d03,_0x4fd695){_0x555d03['on'](_0xe863('0x33'),this[_0xe863('0x34')]['bind'](this));_0x555d03[_0xe863('0x13')](_0xe863('0x35'),this[_0xe863('0x36')][_0xe863('0x12')](this));_0x555d03[_0xe863('0x13')](_0xe863('0x14'),this['handleMessageEnd'][_0xe863('0x12')](this));};EmailImap[_0xe863('0x18')][_0xe863('0x34')]=function(_0xa40d1d,_0x40e18d){simpleParser(_0xa40d1d,{'Iconv':Iconv},this[_0xe863('0x37')][_0xe863('0x12')](this));};EmailImap[_0xe863('0x18')][_0xe863('0x36')]=function(_0x1939a3){};EmailImap[_0xe863('0x18')][_0xe863('0x38')]=function(){};EmailImap[_0xe863('0x18')][_0xe863('0x37')]=function(_0x51d783,_0x46bcea){if(_0x51d783){logger[_0xe863('0x2f')](_0x51d783);}else{var _0x503773=this;utils[_0xe863('0x39')](this['account'],_0x46bcea,function(_0x35bc21){_0x503773[_0xe863('0x26')](_0xe863('0xc'),_0x35bc21);});}};EmailImap['prototype'][_0xe863('0x3a')]=function(){this[_0xe863('0x2')][_0xe863('0x31')](!![],this[_0xe863('0x32')][_0xe863('0x12')](this));};EmailImap[_0xe863('0x18')][_0xe863('0x30')]=function(_0x149442){this[_0xe863('0x15')](_0x149442);this[_0xe863('0x2')][_0xe863('0x31')](!![],this[_0xe863('0x32')][_0xe863('0x12')](this));};EmailImap[_0xe863('0x18')][_0xe863('0x3b')]=function(){this[_0xe863('0x26')](_0xe863('0x14'));};EmailImap['prototype']['handleError']=function(_0xb3feef,_0x334f3d){logger[_0xe863('0x2f')](_0xe863('0x15'),this[_0xe863('0xe')][_0xe863('0xc')],JSON[_0xe863('0x3c')](_0xb3feef));var _0x1413d9='';if(_0xb3feef){if(_0xb3feef[_0xe863('0x3d')]){_0x1413d9=_0xb3feef[_0xe863('0x3d')];}else{for(var _0x10a68e in _0xb3feef){if(_0xb3feef['hasOwnProperty'](_0x10a68e)){_0x1413d9+=_[_0xe863('0x3e')](_0x10a68e)+':\x20'+_0xb3feef[_0x10a68e]+'\x0a';}}}}if(_0x334f3d){this[_0xe863('0x2')][_0xe863('0x14')]();}else{this['emit'](_0xe863('0x2f'),_0x1413d9);this['emit']('end');}};module[_0xe863('0x3f')]=EmailImap;
\ No newline at end of file
index 3653508..c9385b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40bd=['use','sendMail','prototype','verify','toString','exports','nodemailer','bluebird','send','createTransport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x40bd,0x1d2));var _0xd40b=function(_0x522a0e,_0x5252c9){_0x522a0e=_0x522a0e-0x0;var _0x285044=_0x40bd[_0x522a0e];return _0x285044;};'use strict';var nodemailer=require(_0xd40b('0x0'));var BPromise=require(_0xd40b('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xd40b('0x2')]=function(_0x347a41,_0x3572c8){return new BPromise(function(_0x394260,_0x877390){var _0x386c53=nodemailer[_0xd40b('0x3')](_0x347a41);_0x386c53[_0xd40b('0x4')]('compile',inlineBase64());_0x386c53[_0xd40b('0x5')](_0x3572c8,function(_0x118b34,_0x19c798){if(_0x118b34){_0x877390(_0x118b34['toString']());}else{_0x394260(_0x19c798);}});});};EmailSmtp[_0xd40b('0x6')]['verify']=function(_0x74d181){return new BPromise(function(_0x5bcb1b,_0x117d08){var _0x5cb338=nodemailer[_0xd40b('0x3')](_0x74d181);_0x5cb338[_0xd40b('0x7')](function(_0x2ea678,_0x58570a){if(_0x2ea678){_0x117d08(_0x2ea678[_0xd40b('0x8')]());}else{if(_0x58570a){_0x5bcb1b(_0x58570a);}else{_0x117d08('Not\x20verifired');}}});});};module[_0xd40b('0x9')]=EmailSmtp;
\ No newline at end of file
+var _0x5791=['verify','toString','exports','nodemailer','prototype','send','createTransport','use','compile','sendMail'];(function(_0x12f513,_0x4d00c0){var _0x2582fa=function(_0x14304a){while(--_0x14304a){_0x12f513['push'](_0x12f513['shift']());}};_0x2582fa(++_0x4d00c0);}(_0x5791,0x71));var _0x1579=function(_0x21aefc,_0x1177eb){_0x21aefc=_0x21aefc-0x0;var _0x53ffe7=_0x5791[_0x21aefc];return _0x53ffe7;};'use strict';var nodemailer=require(_0x1579('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x1579('0x1')][_0x1579('0x2')]=function(_0x101190,_0x4fd82e){return new BPromise(function(_0x5b9532,_0x349289){var _0x5d907b=nodemailer[_0x1579('0x3')](_0x101190);_0x5d907b[_0x1579('0x4')](_0x1579('0x5'),inlineBase64());_0x5d907b[_0x1579('0x6')](_0x4fd82e,function(_0x49a9cd,_0x5ce1db){if(_0x49a9cd){_0x349289(_0x49a9cd['toString']());}else{_0x5b9532(_0x5ce1db);}});});};EmailSmtp['prototype'][_0x1579('0x7')]=function(_0x513d46){return new BPromise(function(_0xe9e870,_0x4a9402){var _0x2af003=nodemailer['createTransport'](_0x513d46);_0x2af003[_0x1579('0x7')](function(_0xc5c619,_0x232c59){if(_0xc5c619){_0x4a9402(_0xc5c619[_0x1579('0x8')]());}else{if(_0x232c59){_0xe9e870(_0x232c59);}else{_0x4a9402('Not\x20verifired');}}});});};module[_0x1579('0x9')]=EmailSmtp;
\ No newline at end of file
index 3403e10..f0888f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fa9=['outlook.office365.com','127.0.0.1','lodash','randomstring','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','name','indexOf','split','length','slice','pop','isEmpty','generate','@xcally.com','html','test','includes','<img','attachments','forEach','push','filename','replace','_SRC','_IMG','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','email','message','originCc','attach','attachment','attachment-','format','now','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','parser','from','messageId','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','first','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365'];(function(_0x5df50a,_0x409b04){var _0x1ba526=function(_0x488fd1){while(--_0x488fd1){_0x5df50a['push'](_0x5df50a['shift']());}};_0x1ba526(++_0x409b04);}(_0x1fa9,0x136));var _0x91fa=function(_0x17520d,_0x20f4bc){_0x17520d=_0x17520d-0x0;var _0x135827=_0x1fa9[_0x17520d];return _0x135827;};'use strict';var _=require(_0x91fa('0x0'));var moment=require('moment');var random=require(_0x91fa('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x91fa('0x2'));var tnef=require(_0x91fa('0x3'));var logger=require(_0x91fa('0x4'))('email');var config=require(_0x91fa('0x5'));function getAddress(_0x33b35a){var _0x4779be=_[_0x91fa('0x6')](_0x33b35a[_0x91fa('0x7')]);return _0x4779be&&_0x4779be['address']?_0x4779be[_0x91fa('0x8')]:_0x91fa('0x9')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0xb4a51f){var _0x7ad4dd=_[_0x91fa('0x6')](_0xb4a51f[_0x91fa('0x7')]);if(_0x7ad4dd&&_0x7ad4dd[_0x91fa('0xa')]){if(_0x7ad4dd[_0x91fa('0xa')]==_0x7ad4dd[_0x91fa('0x8')]){return _0x7ad4dd['name']['substring'](0x0,_0x7ad4dd[_0x91fa('0xa')][_0x91fa('0xb')]('@'));}var _0x17fc65=_0x7ad4dd[_0x91fa('0xa')][_0x91fa('0xc')](/\s+/);return _0x17fc65[_0x91fa('0xd')]>0x1?_0x17fc65[_0x91fa('0xe')](0x0,-0x1)['join']('\x20'):_0x7ad4dd['name'];}return'Anonymous';}function getLastName(_0xc0b7bf){var _0x4ebf24=_[_0x91fa('0x6')](_0xc0b7bf[_0x91fa('0x7')]);if(_0x4ebf24&&_0x4ebf24[_0x91fa('0xa')]){var _0x2797d2=_0x4ebf24['name'][_0x91fa('0xc')](/\s+/);return _0x2797d2[_0x91fa('0xd')]>0x1?_0x2797d2[_0x91fa('0xf')]():'';}return'';}function getMails(_0x2667da,_0xe9e249){var _0x1f43fa='';for(var _0x5172d8=0x0;_0x5172d8<_0xe9e249[_0x91fa('0x7')][_0x91fa('0xd')];_0x5172d8+=0x1){if(_0xe9e249[_0x91fa('0x7')][_0x5172d8][_0x91fa('0x8')]!==_0x2667da){if(!_[_0x91fa('0x10')](_0x1f43fa)){_0x1f43fa+=',';}_0x1f43fa+=_0xe9e249['value'][_0x5172d8][_0x91fa('0xa')]||_0xe9e249[_0x91fa('0x7')][_0x5172d8][_0x91fa('0x8')]||'';_0x1f43fa+='\x20<';_0x1f43fa+=_0xe9e249[_0x91fa('0x7')][_0x5172d8][_0x91fa('0x8')]?_0xe9e249[_0x91fa('0x7')][_0x5172d8][_0x91fa('0x8')]:_0x91fa('0x9')+random[_0x91fa('0x11')](0x6)+_0x91fa('0x12');_0x1f43fa+='>';}}return _0x1f43fa;}function parseEmail(_0x279288,_0x4a8f08,_0x46433d){if(_0x4a8f08[_0x91fa('0x13')]){var _0x4ac68d=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x4ac68d[_0x91fa('0x14')](_0x4a8f08['html'])){_0x4a8f08[_0x91fa('0x13')]=_0x4a8f08['html']['replace'](_0x4ac68d,'');}if(_0x4a8f08['html'][_0x91fa('0x15')](_0x91fa('0x16'))){var _0x3dd307=[];_0x4a8f08[_0x91fa('0x17')][_0x91fa('0x18')](_0x5df647=>{_0x3dd307[_0x91fa('0x19')](_0x5df647[_0x91fa('0x1a')]);});var _0x252c71=/<img.*? _SRC(.*?)[^>]+>/g;var _0x1d2019=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4b0090=_0x4a8f08['html'][_0x91fa('0x1b')](_0x1d2019,_0x91fa('0x1c'));var _0x26a9b3=_0x4b0090[_0x91fa('0x1b')](_0x252c71,_0x91fa('0x1d'));for(let _0x50b4fa=0x0;_0x50b4fa<_0x3dd307[_0x91fa('0xd')];_0x50b4fa++){var _0x404bbc=_0x26a9b3[_0x91fa('0x1b')]('_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20'+_0x3dd307[_0x50b4fa]+_0x91fa('0x1e'));_0x26a9b3=_0x404bbc;}_0x4a8f08[_0x91fa('0x13')]=_0x26a9b3;}_0x46433d[_0x91fa('0x1f')]=_0x4a8f08[_0x91fa('0x13')];}else{_0x46433d[_0x91fa('0x1f')]=_0x4a8f08[_0x91fa('0x20')];}if(_0x46433d[_0x91fa('0x1f')]){_0x46433d[_0x91fa('0x1f')]=_0x46433d[_0x91fa('0x1f')][_0x91fa('0x1b')](/<a\s+/gi,_0x91fa('0x21'));}if(_0x4a8f08['to']){_0x46433d['message']['originTo']=getMails(null,_0x4a8f08['to']);var _0x291ff2=getMails(_0x279288[_0x91fa('0x22')],_0x4a8f08['to']);if(!_[_0x91fa('0x10')](_0x291ff2)){_0x46433d[_0x91fa('0x23')]['cc']+=_0x291ff2;}}if(_0x4a8f08['cc']){_0x46433d[_0x91fa('0x23')][_0x91fa('0x24')]=getMails(null,_0x4a8f08['cc']);var _0x5bcc62=getMails(_0x279288[_0x91fa('0x22')],_0x4a8f08['cc']);if(!_[_0x91fa('0x10')](_0x5bcc62)){if(!_[_0x91fa('0x10')](_0x46433d[_0x91fa('0x23')]['cc'])){_0x46433d[_0x91fa('0x23')]['cc']+=',';}_0x46433d[_0x91fa('0x23')]['cc']+=_0x5bcc62;}}if(!_[_0x91fa('0x15')](_0x46433d[_0x91fa('0x23')]['originTo'],_0x279288['email'])&&!_[_0x91fa('0x15')](_0x46433d[_0x91fa('0x23')]['originCc'],_0x279288[_0x91fa('0x22')])){_0x46433d['message']['bcc']=_0x279288[_0x91fa('0x22')];}if(_0x4a8f08[_0x91fa('0x17')]&&_0x4a8f08[_0x91fa('0x17')]['length']){_0x46433d[_0x91fa('0x23')][_0x91fa('0x25')]=_0x4a8f08[_0x91fa('0x17')][_0x91fa('0xd')];for(var _0x9ffbfd=0x0,_0x421aaf,_0x2ccf5b,_0x4d4df0;_0x9ffbfd<_0x4a8f08[_0x91fa('0x17')][_0x91fa('0xd')];_0x9ffbfd+=0x1){if(_0x4a8f08['attachments'][_0x9ffbfd]['type']===_0x91fa('0x26')){_0x4d4df0=_0x4a8f08[_0x91fa('0x17')][_0x9ffbfd]['filename']||_0x91fa('0x27')+_0x9ffbfd;_0x421aaf=util[_0x91fa('0x28')]('%s-%s',Date[_0x91fa('0x29')](),_0x4d4df0);_0x2ccf5b=path['join'](config['root'],_0x91fa('0x2a'),_0x421aaf);fs[_0x91fa('0x2b')](_0x2ccf5b,_0x4a8f08['attachments'][_0x9ffbfd][_0x91fa('0x2c')]);_0x46433d[_0x91fa('0x23')]['attachments'][_0x91fa('0x19')]({'name':_0x4d4df0,'basename':_0x421aaf,'type':_0x4a8f08['attachments'][_0x9ffbfd][_0x91fa('0x2d')],'filepath':_0x2ccf5b});}}}if(_0x4a8f08['headerLines']&&_0x4a8f08[_0x91fa('0x2e')]['length']>0x0){var _0x8987ad=[_0x91fa('0x2f'),_0x91fa('0x30'),_0x91fa('0x31')];for(var _0x55417b=0x0;_0x55417b<_0x4a8f08[_0x91fa('0x2e')][_0x91fa('0xd')];_0x55417b++){var _0x284134=_[_0x91fa('0xb')](_0x8987ad,_0x4a8f08[_0x91fa('0x2e')][_0x55417b][_0x91fa('0x32')]);if(_0x284134>=0x0){_0x46433d['isAutoreply']=!![];}}}return _0x46433d;}exports[_0x91fa('0x33')]=function(_0x47bd8a,_0x4cdd67,_0x293198){var _0x1a2585={'from':getAddress(_0x4cdd67[_0x91fa('0x34')]),'firstName':getFirstName(_0x4cdd67[_0x91fa('0x34')]),'lastName':getLastName(_0x4cdd67[_0x91fa('0x34')]),'mapKey':_0x91fa('0x22'),'message':{'from':getMails(_0x47bd8a[_0x91fa('0x22')],_0x4cdd67['from']),'to':_0x47bd8a[_0x91fa('0x22')],'cc':'','subject':_0x4cdd67['subject']||'','messageId':_0x4cdd67[_0x91fa('0x35')],'inReplyTo':_0x4cdd67[_0x91fa('0x36')],'sentAt':moment(_0x4cdd67[_0x91fa('0x37')])[_0x91fa('0x28')](_0x91fa('0x38')),'attach':![],'attachments':[]}};if(!_0x4cdd67[_0x91fa('0x13')]&&!_0x4cdd67[_0x91fa('0x20')]){var _0x210657=_[_0x91fa('0x39')](_0x4cdd67[_0x91fa('0x17')],{'contentType':_0x91fa('0x3a')});if(_0x210657[_0x91fa('0xd')]){logger[_0x91fa('0x3b')](util[_0x91fa('0x28')](_0x91fa('0x3c'),_0x4cdd67['messageId']));tnef[_0x91fa('0x3d')](_[_0x91fa('0x3e')](_0x210657)[_0x91fa('0x2c')],function(_0x2b9ba9,_0x3bc598){if(_0x3bc598){_0x4cdd67[_0x91fa('0x13')]=_0x3bc598[_0x91fa('0x3f')]||_0x91fa('0x40');if(_0x3bc598[_0x91fa('0x41')]){for(var _0x3c554c=0x0;_0x3c554c<_0x3bc598[_0x91fa('0x41')][_0x91fa('0xd')];_0x3c554c++){var _0x3e3157=_0x3bc598['Attachments'][_0x3c554c];_0x1a2585[_0x91fa('0x23')][_0x91fa('0x17')][_0x91fa('0x19')]({'filename':_0x3e3157[_0x91fa('0x42')],'content':Buffer[_0x91fa('0x34')](_0x3e3157['Data'])});}}}_0x293198(parseEmail(_0x47bd8a,_0x4cdd67,_0x1a2585));});}else{_0x4cdd67[_0x91fa('0x13')]='<p>Empty\x20message</p>';_0x293198(parseEmail(_0x47bd8a,_0x4cdd67,_0x1a2585));}}else{_0x293198(parseEmail(_0x47bd8a,_0x4cdd67,_0x1a2585));}};exports[_0x91fa('0x43')]=function(_0x389ea9){switch(_0x389ea9){case _0x91fa('0x44'):return _0x91fa('0x45');case _0x91fa('0x46'):return _0x91fa('0x47');case _0x91fa('0x48'):return _0x91fa('0x49');case _0x91fa('0x4a'):return _0x91fa('0x4b');}return _0x91fa('0x4c');};
\ No newline at end of file
+var _0xc6a2=['now','root','writeFileSync','content','contentType','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','headerLines','line','isAutoreply','from','messageId','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','parseBuffer','first','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','getHost','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','name','indexOf','split','join','Anonymous','length','pop','@xcally.com','test','html','includes','<img','attachments','forEach','push','replace','_SRC','_IMG','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','originCc','isEmpty','filename','attachment-'];(function(_0x5bc158,_0x20ba90){var _0x288d43=function(_0x4e1c7f){while(--_0x4e1c7f){_0x5bc158['push'](_0x5bc158['shift']());}};_0x288d43(++_0x20ba90);}(_0xc6a2,0x69));var _0x2c6a=function(_0x32181f,_0x3c9834){_0x32181f=_0x32181f-0x0;var _0x5e7b58=_0xc6a2[_0x32181f];return _0x5e7b58;};'use strict';var _=require(_0x2c6a('0x0'));var moment=require(_0x2c6a('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x2c6a('0x2'));var util=require(_0x2c6a('0x3'));var tnef=require(_0x2c6a('0x4'));var logger=require(_0x2c6a('0x5'))(_0x2c6a('0x6'));var config=require(_0x2c6a('0x7'));function getAddress(_0x3b1269){var _0x1d2cfd=_[_0x2c6a('0x8')](_0x3b1269[_0x2c6a('0x9')]);return _0x1d2cfd&&_0x1d2cfd[_0x2c6a('0xa')]?_0x1d2cfd[_0x2c6a('0xa')]:_0x2c6a('0xb')+random[_0x2c6a('0xc')](0x6)+'@xcally.com';}function getFirstName(_0x36f800){var _0x3f4b72=_[_0x2c6a('0x8')](_0x36f800[_0x2c6a('0x9')]);if(_0x3f4b72&&_0x3f4b72[_0x2c6a('0xd')]){if(_0x3f4b72[_0x2c6a('0xd')]==_0x3f4b72[_0x2c6a('0xa')]){return _0x3f4b72[_0x2c6a('0xd')]['substring'](0x0,_0x3f4b72['name'][_0x2c6a('0xe')]('@'));}var _0x46531e=_0x3f4b72[_0x2c6a('0xd')][_0x2c6a('0xf')](/\s+/);return _0x46531e['length']>0x1?_0x46531e['slice'](0x0,-0x1)[_0x2c6a('0x10')]('\x20'):_0x3f4b72[_0x2c6a('0xd')];}return _0x2c6a('0x11');}function getLastName(_0x5aeeb9){var _0x5e965d=_['head'](_0x5aeeb9[_0x2c6a('0x9')]);if(_0x5e965d&&_0x5e965d[_0x2c6a('0xd')]){var _0x79616=_0x5e965d[_0x2c6a('0xd')][_0x2c6a('0xf')](/\s+/);return _0x79616[_0x2c6a('0x12')]>0x1?_0x79616[_0x2c6a('0x13')]():'';}return'';}function getMails(_0x22206c,_0x1a0afe){var _0x54412d='';for(var _0x41f830=0x0;_0x41f830<_0x1a0afe[_0x2c6a('0x9')]['length'];_0x41f830+=0x1){if(_0x1a0afe[_0x2c6a('0x9')][_0x41f830]['address']!==_0x22206c){if(!_['isEmpty'](_0x54412d)){_0x54412d+=',';}_0x54412d+=_0x1a0afe[_0x2c6a('0x9')][_0x41f830][_0x2c6a('0xd')]||_0x1a0afe[_0x2c6a('0x9')][_0x41f830][_0x2c6a('0xa')]||'';_0x54412d+='\x20<';_0x54412d+=_0x1a0afe[_0x2c6a('0x9')][_0x41f830][_0x2c6a('0xa')]?_0x1a0afe[_0x2c6a('0x9')][_0x41f830]['address']:_0x2c6a('0xb')+random[_0x2c6a('0xc')](0x6)+_0x2c6a('0x14');_0x54412d+='>';}}return _0x54412d;}function parseEmail(_0x3622f7,_0x10edaa,_0x49c5b7){if(_0x10edaa['html']){var _0x3652ac=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x3652ac[_0x2c6a('0x15')](_0x10edaa[_0x2c6a('0x16')])){_0x10edaa[_0x2c6a('0x16')]=_0x10edaa['html']['replace'](_0x3652ac,'');}if(_0x10edaa['html'][_0x2c6a('0x17')](_0x2c6a('0x18'))){var _0x401471=[];_0x10edaa[_0x2c6a('0x19')][_0x2c6a('0x1a')](_0x3e9439=>{_0x401471[_0x2c6a('0x1b')](_0x3e9439['filename']);});var _0xaa05c9=/<img.*? _SRC(.*?)[^>]+>/g;var _0x48c35a=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x37c1f4=_0x10edaa['html'][_0x2c6a('0x1c')](_0x48c35a,_0x2c6a('0x1d'));var _0xd41674=_0x37c1f4[_0x2c6a('0x1c')](_0xaa05c9,_0x2c6a('0x1e'));for(let _0x5af6e5=0x0;_0x5af6e5<_0x401471[_0x2c6a('0x12')];_0x5af6e5++){var _0x14c9e2=_0xd41674[_0x2c6a('0x1c')](_0x2c6a('0x1e'),'<span\x20style=font-weight:bold>\x20[Attachment:\x20'+_0x401471[_0x5af6e5]+_0x2c6a('0x1f'));_0xd41674=_0x14c9e2;}_0x10edaa[_0x2c6a('0x16')]=_0xd41674;}_0x49c5b7[_0x2c6a('0x20')]=_0x10edaa[_0x2c6a('0x16')];}else{_0x49c5b7['body']=_0x10edaa[_0x2c6a('0x21')];}if(_0x49c5b7['body']){_0x49c5b7['body']=_0x49c5b7['body'][_0x2c6a('0x1c')](/<a\s+/gi,_0x2c6a('0x22'));}if(_0x10edaa['to']){_0x49c5b7[_0x2c6a('0x23')][_0x2c6a('0x24')]=getMails(null,_0x10edaa['to']);var _0x4e4714=getMails(_0x3622f7[_0x2c6a('0x6')],_0x10edaa['to']);if(!_['isEmpty'](_0x4e4714)){_0x49c5b7[_0x2c6a('0x23')]['cc']+=_0x4e4714;}}if(_0x10edaa['cc']){_0x49c5b7[_0x2c6a('0x23')][_0x2c6a('0x25')]=getMails(null,_0x10edaa['cc']);var _0x5645c0=getMails(_0x3622f7[_0x2c6a('0x6')],_0x10edaa['cc']);if(!_[_0x2c6a('0x26')](_0x5645c0)){if(!_[_0x2c6a('0x26')](_0x49c5b7[_0x2c6a('0x23')]['cc'])){_0x49c5b7[_0x2c6a('0x23')]['cc']+=',';}_0x49c5b7[_0x2c6a('0x23')]['cc']+=_0x5645c0;}}if(!_[_0x2c6a('0x17')](_0x49c5b7[_0x2c6a('0x23')]['originTo'],_0x3622f7[_0x2c6a('0x6')])&&!_[_0x2c6a('0x17')](_0x49c5b7[_0x2c6a('0x23')]['originCc'],_0x3622f7['email'])){_0x49c5b7[_0x2c6a('0x23')]['bcc']=_0x3622f7[_0x2c6a('0x6')];}if(_0x10edaa['attachments']&&_0x10edaa[_0x2c6a('0x19')][_0x2c6a('0x12')]){_0x49c5b7[_0x2c6a('0x23')]['attach']=_0x10edaa[_0x2c6a('0x19')][_0x2c6a('0x12')];for(var _0x585954=0x0,_0xeb28f,_0x1b01c3,_0x3ab39d;_0x585954<_0x10edaa[_0x2c6a('0x19')][_0x2c6a('0x12')];_0x585954+=0x1){if(_0x10edaa['attachments'][_0x585954]['type']==='attachment'){_0x3ab39d=_0x10edaa[_0x2c6a('0x19')][_0x585954][_0x2c6a('0x27')]||_0x2c6a('0x28')+_0x585954;_0xeb28f=util['format']('%s-%s',Date[_0x2c6a('0x29')](),_0x3ab39d);_0x1b01c3=path['join'](config[_0x2c6a('0x2a')],'server/files/attachments/',_0xeb28f);fs[_0x2c6a('0x2b')](_0x1b01c3,_0x10edaa[_0x2c6a('0x19')][_0x585954][_0x2c6a('0x2c')]);_0x49c5b7[_0x2c6a('0x23')]['attachments']['push']({'name':_0x3ab39d,'basename':_0xeb28f,'type':_0x10edaa[_0x2c6a('0x19')][_0x585954][_0x2c6a('0x2d')],'filepath':_0x1b01c3});}}}if(_0x10edaa['headerLines']&&_0x10edaa['headerLines'][_0x2c6a('0x12')]>0x0){var _0x4860b4=[_0x2c6a('0x2e'),_0x2c6a('0x2f'),'Precedence:\x20auto_reply'];for(var _0x477e6a=0x0;_0x477e6a<_0x10edaa[_0x2c6a('0x30')]['length'];_0x477e6a++){var _0x5049f5=_[_0x2c6a('0xe')](_0x4860b4,_0x10edaa[_0x2c6a('0x30')][_0x477e6a][_0x2c6a('0x31')]);if(_0x5049f5>=0x0){_0x49c5b7[_0x2c6a('0x32')]=!![];}}}return _0x49c5b7;}exports['parser']=function(_0x4de9ca,_0x3640f6,_0x3440b0){var _0x2b8403={'from':getAddress(_0x3640f6[_0x2c6a('0x33')]),'firstName':getFirstName(_0x3640f6['from']),'lastName':getLastName(_0x3640f6[_0x2c6a('0x33')]),'mapKey':_0x2c6a('0x6'),'message':{'from':getMails(_0x4de9ca[_0x2c6a('0x6')],_0x3640f6[_0x2c6a('0x33')]),'to':_0x4de9ca[_0x2c6a('0x6')],'cc':'','subject':_0x3640f6['subject']||'','messageId':_0x3640f6[_0x2c6a('0x34')],'inReplyTo':_0x3640f6['inReplyTo'],'sentAt':moment(_0x3640f6[_0x2c6a('0x35')])[_0x2c6a('0x36')](_0x2c6a('0x37')),'attach':![],'attachments':[]}};if(!_0x3640f6[_0x2c6a('0x16')]&&!_0x3640f6['textAsHtml']){var _0x20e24d=_[_0x2c6a('0x38')](_0x3640f6[_0x2c6a('0x19')],{'contentType':_0x2c6a('0x39')});if(_0x20e24d['length']){logger['info'](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x3640f6['messageId']));tnef[_0x2c6a('0x3a')](_[_0x2c6a('0x3b')](_0x20e24d)[_0x2c6a('0x2c')],function(_0x38ce05,_0x1007d0){if(_0x1007d0){_0x3640f6[_0x2c6a('0x16')]=_0x1007d0[_0x2c6a('0x3c')]||_0x2c6a('0x3d');if(_0x1007d0[_0x2c6a('0x3e')]){for(var _0x4ff01b=0x0;_0x4ff01b<_0x1007d0[_0x2c6a('0x3e')]['length'];_0x4ff01b++){var _0x5ae3e6=_0x1007d0[_0x2c6a('0x3e')][_0x4ff01b];_0x2b8403['message'][_0x2c6a('0x19')][_0x2c6a('0x1b')]({'filename':_0x5ae3e6[_0x2c6a('0x3f')],'content':Buffer['from'](_0x5ae3e6[_0x2c6a('0x40')])});}}}_0x3440b0(parseEmail(_0x4de9ca,_0x3640f6,_0x2b8403));});}else{_0x3640f6[_0x2c6a('0x16')]='<p>Empty\x20message</p>';_0x3440b0(parseEmail(_0x4de9ca,_0x3640f6,_0x2b8403));}}else{_0x3440b0(parseEmail(_0x4de9ca,_0x3640f6,_0x2b8403));}};exports[_0x2c6a('0x41')]=function(_0x4c5c1e){switch(_0x4c5c1e){case'gmail':return'imap.gmail.com';case _0x2c6a('0x42'):return _0x2c6a('0x43');case _0x2c6a('0x44'):return _0x2c6a('0x45');case _0x2c6a('0x46'):return _0x2c6a('0x47');}return _0x2c6a('0x48');};
\ No newline at end of file
index cafb5a4..b33b80d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x765e=['key','SERV','active','Imap','Smtp','exports','name','Service'];(function(_0xed9dd,_0x184eb5){var _0x2b0faf=function(_0x437e21){while(--_0x437e21){_0xed9dd['push'](_0xed9dd['shift']());}};_0x2b0faf(++_0x184eb5);}(_0x765e,0x116));var _0xe765=function(_0x5c4d7d,_0x5a6995){_0x5c4d7d=_0x5c4d7d-0x0;var _0x4f18d3=_0x765e[_0x5c4d7d];return _0x4f18d3;};'use strict';var _=require('lodash');function MailAccount(_0x5cacdb){this['id']=_0x5cacdb['id']||0x0;this[_0xe765('0x0')]=_0x5cacdb['name']||_0xe765('0x1');this['key']=_0x5cacdb[_0xe765('0x2')]||_0xe765('0x3');this[_0xe765('0x4')]=_0x5cacdb[_0xe765('0x4')]||![];this[_0xe765('0x5')]=_0x5cacdb[_0xe765('0x5')]||[];this[_0xe765('0x6')]=_0x5cacdb[_0xe765('0x6')]||[];}module[_0xe765('0x7')]=MailAccount;
\ No newline at end of file
+var _0x08d0=['Imap','Smtp','exports','lodash','name','Service','key','SERV','active'];(function(_0xcefff0,_0x127ca2){var _0x4b55ad=function(_0x5cdd96){while(--_0x5cdd96){_0xcefff0['push'](_0xcefff0['shift']());}};_0x4b55ad(++_0x127ca2);}(_0x08d0,0x1c5));var _0x008d=function(_0x215e40,_0x24bc67){_0x215e40=_0x215e40-0x0;var _0x13248e=_0x08d0[_0x215e40];return _0x13248e;};'use strict';var _=require(_0x008d('0x0'));function MailAccount(_0xa25b27){this['id']=_0xa25b27['id']||0x0;this[_0x008d('0x1')]=_0xa25b27['name']||_0x008d('0x2');this[_0x008d('0x3')]=_0xa25b27[_0x008d('0x3')]||_0x008d('0x4');this[_0x008d('0x5')]=_0xa25b27['active']||![];this[_0x008d('0x6')]=_0xa25b27['Imap']||[];this[_0x008d('0x7')]=_0xa25b27[_0x008d('0x7')]||[];}module[_0x008d('0x8')]=MailAccount;
\ No newline at end of file
index d9a360a..cb497b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ba4=['merge','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','isUndefined'];(function(_0x49c816,_0x198631){var _0x23bcac=function(_0x401cf0){while(--_0x401cf0){_0x49c816['push'](_0x49c816['shift']());}};_0x23bcac(++_0x198631);}(_0x3ba4,0xe2));var _0x43ba=function(_0x312a9d,_0x3f1830){_0x312a9d=_0x312a9d-0x0;var _0x28ab49=_0x3ba4[_0x312a9d];return _0x28ab49;};'use strict';var _=require('lodash');var MailAccount=require(_0x43ba('0x0'));var Realtime=function(){this[_0x43ba('0x1')]={};};function freeIsNotKey(_0x26d450,_0x44d364,_0x52a87b){var _0x400f12=_[_0x43ba('0x2')](_0x26d450,function(_0x3cac61,_0x200e31){return _0x3cac61[_0x52a87b];});for(var _0x73c270 in _0x44d364){if(_0x44d364['hasOwnProperty'](_0x73c270)){if(!_0x400f12[_0x73c270]){delete _0x44d364[_0x73c270];}}}}Realtime[_0x43ba('0x3')][_0x43ba('0x4')]=function(_0x524b8f,_0x1d0de3){for(var _0x2fd5aa in _0x1d0de3){if(_0x524b8f[_0x43ba('0x5')](_0x2fd5aa)){_0x524b8f[_0x2fd5aa]=_0x1d0de3[_0x2fd5aa];}}};Realtime[_0x43ba('0x3')][_0x43ba('0x6')]=function(){var _0x2eda56=this;return function(_0x3871dd){if(_0x3871dd){freeIsNotKey(_0x3871dd,_0x2eda56[_0x43ba('0x1')],'id');for(var _0x51a691=0x0,_0x384cba={},_0x489283={};_0x51a691<_0x3871dd['length'];_0x51a691+=0x1){_0x384cba=_0x3871dd[_0x51a691];if(_[_0x43ba('0x7')](_0x2eda56[_0x43ba('0x1')][_0x384cba['id']])){_0x2eda56['mailAccounts'][_0x384cba['id']]=new MailAccount(_0x384cba);}else{_[_0x43ba('0x8')](_0x2eda56['mailAccounts'][_0x384cba['id']],_0x384cba);}}}return _0x2eda56[_0x43ba('0x1')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0xb06d=['isUndefined','mailAccounts','merge','exports','lodash','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','length'];(function(_0x58b255,_0x20fcfa){var _0x5071d1=function(_0x4e4b6a){while(--_0x4e4b6a){_0x58b255['push'](_0x58b255['shift']());}};_0x5071d1(++_0x20fcfa);}(_0xb06d,0x122));var _0xdb06=function(_0x27891e,_0x11708d){_0x27891e=_0x27891e-0x0;var _0x18c60a=_0xb06d[_0x27891e];return _0x18c60a;};'use strict';var _=require(_0xdb06('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x1da148,_0x10f1aa,_0x378a18){var _0x498bcd=_[_0xdb06('0x1')](_0x1da148,function(_0x4d2d61,_0x5d5cd6){return _0x4d2d61[_0x378a18];});for(var _0x42c556 in _0x10f1aa){if(_0x10f1aa['hasOwnProperty'](_0x42c556)){if(!_0x498bcd[_0x42c556]){delete _0x10f1aa[_0x42c556];}}}}Realtime[_0xdb06('0x2')][_0xdb06('0x3')]=function(_0x2e3a5c,_0x19869e){for(var _0x130670 in _0x19869e){if(_0x2e3a5c[_0xdb06('0x4')](_0x130670)){_0x2e3a5c[_0x130670]=_0x19869e[_0x130670];}}};Realtime[_0xdb06('0x2')][_0xdb06('0x5')]=function(){var _0x1b6124=this;return function(_0x1b2d3a){if(_0x1b2d3a){freeIsNotKey(_0x1b2d3a,_0x1b6124['mailAccounts'],'id');for(var _0x19822e=0x0,_0x2ae424={},_0x4b080e={};_0x19822e<_0x1b2d3a[_0xdb06('0x6')];_0x19822e+=0x1){_0x2ae424=_0x1b2d3a[_0x19822e];if(_[_0xdb06('0x7')](_0x1b6124['mailAccounts'][_0x2ae424['id']])){_0x1b6124[_0xdb06('0x8')][_0x2ae424['id']]=new MailAccount(_0x2ae424);}else{_[_0xdb06('0x9')](_0x1b6124[_0xdb06('0x8')][_0x2ae424['id']],_0x2ae424);}}}return _0x1b6124[_0xdb06('0x8')];};};module[_0xdb06('0xa')]=Realtime;
\ No newline at end of file
index 7792158..c78f389 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa775=['TemplateId','MailServerIn','Imap','MailServerOut','Smtp','NotifyMailAccount','../client','Request','service','email','active','key'];(function(_0x3abc15,_0x37a371){var _0x1bd739=function(_0xb04a58){while(--_0xb04a58){_0x3abc15['push'](_0x3abc15['shift']());}};_0x1bd739(++_0x37a371);}(_0xa775,0xf6));var _0x5a77=function(_0x57eb8c,_0xf522d2){_0x57eb8c=_0x57eb8c-0x0;var _0x995479=_0xa775[_0x57eb8c];return _0x995479;};'use strict';var client=require(_0x5a77('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x5a77('0x1')]('GetMailAccount',{'options':{'attributes':['id','name',_0x5a77('0x2'),_0x5a77('0x3'),_0x5a77('0x4'),_0x5a77('0x5'),'ListId',_0x5a77('0x6')],'raw':![],'include':[{'model':_0x5a77('0x7'),'as':_0x5a77('0x8')},{'model':_0x5a77('0x9'),'as':_0x5a77('0xa')}]},'log':'getMailAccount'});};};exports['notify']=function(_0x5605a3,_0x5ab155){return client[_0x5a77('0x1')](_0x5a77('0xb'),{'account':{'id':_0x5605a3},'body':_0x5ab155,'log':_0x5a77('0xb')});};
\ No newline at end of file
+var _0x6eaa=['name','service','email','active','ListId','TemplateId','MailServerIn','Imap','Smtp','getMailAccount','notify','NotifyMailAccount','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6eaa,0x1ed));var _0xa6ea=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x6eaa[_0x421196];return _0x2738af;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0xa6ea('0x0')]('GetMailAccount',{'options':{'attributes':['id',_0xa6ea('0x1'),_0xa6ea('0x2'),_0xa6ea('0x3'),_0xa6ea('0x4'),'key',_0xa6ea('0x5'),_0xa6ea('0x6')],'raw':![],'include':[{'model':_0xa6ea('0x7'),'as':_0xa6ea('0x8')},{'model':'MailServerOut','as':_0xa6ea('0x9')}]},'log':_0xa6ea('0xa')});};};exports[_0xa6ea('0xb')]=function(_0x558e1a,_0x3ced09){return client[_0xa6ea('0x0')](_0xa6ea('0xc'),{'account':{'id':_0x558e1a},'body':_0x3ced09,'log':'NotifyMailAccount'});};
\ No newline at end of file
index 934977e..cfa95d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4656=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x12bb38,_0x3ddf67){var _0xb5de55=function(_0x4569f7){while(--_0x4569f7){_0x12bb38['push'](_0x12bb38['shift']());}};_0xb5de55(++_0x3ddf67);}(_0x4656,0x1d7));var _0x6465=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0x4656[_0x553150];return _0x18193d;};'use strict';var client=require(_0x6465('0x0'));exports[_0x6465('0x1')]=function(){return client[_0x6465('0x2')](_0x6465('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x6465('0x4')});};
\ No newline at end of file
+var _0x7080=['Request','ShowSetting','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x231577,_0x378742){var _0x49eab3=function(_0x1b5df8){while(--_0x1b5df8){_0x231577['push'](_0x231577['shift']());}};_0x49eab3(++_0x378742);}(_0x7080,0x136));var _0x0708=function(_0x167914,_0x87b5a){_0x167914=_0x167914-0x0;var _0x5e5d79=_0x7080[_0x167914];return _0x5e5d79;};'use strict';var client=require(_0x0708('0x0'));exports[_0x0708('0x1')]=function(){return client[_0x0708('0x2')](_0x0708('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0708('0x4')]},'log':_0x0708('0x5')});};
\ No newline at end of file
index 874d9ac..05a3a46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_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
index fd43ebc..0027c7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb88e=['socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','polling','defaults','redis','localhost','adapter'];(function(_0x1c8ba6,_0x3bff95){var _0x40831d=function(_0x134025){while(--_0x134025){_0x1c8ba6['push'](_0x1c8ba6['shift']());}};_0x40831d(++_0x3bff95);}(_0xb88e,0x177));var _0xeb88=function(_0x1fedb9,_0x1102f1){_0x1fedb9=_0x1fedb9-0x0;var _0x5a538d=_0xb88e[_0x1fedb9];return _0x5a538d;};'use strict';var _=require(_0xeb88('0x0'));var http=require(_0xeb88('0x1'));var express=require(_0xeb88('0x2'));var sticky=require(_0xeb88('0x3'));var Redis=require(_0xeb88('0x4'));var config=require(_0xeb88('0x5'));var app=express();var server=http[_0xeb88('0x6')](app);server[_0xeb88('0x7')]=0xdbba0;if(sticky[_0xeb88('0x8')](server,config[_0xeb88('0x9')])){var socketio=require(_0xeb88('0xa'))(server,{'transports':['websocket',_0xeb88('0xb')]});config['redis']=_[_0xeb88('0xc')](config[_0xeb88('0xd')],{'host':_0xeb88('0xe'),'port':0x18eb});socketio[_0xeb88('0xf')](require(_0xeb88('0x10'))({'pubClient':new Redis(config[_0xeb88('0xd')]),'subClient':new Redis(config[_0xeb88('0xd')])}));require(_0xeb88('0x11'))[_0xeb88('0x12')]();require(_0xeb88('0x13'))['default'](socketio);require(_0xeb88('0x14'))[_0xeb88('0x12')](app);require(_0xeb88('0x15'))[_0xeb88('0x12')](app);}else{server['once']('listening',function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0xeb88('0x16')]=app;
\ No newline at end of file
+var _0x1ecb=['socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','express','createServer'];(function(_0x5bd98b,_0x22bf1c){var _0x49efe7=function(_0x2223e8){while(--_0x2223e8){_0x5bd98b['push'](_0x5bd98b['shift']());}};_0x49efe7(++_0x22bf1c);}(_0x1ecb,0x1a1));var _0xb1ec=function(_0x3bca82,_0x199c6b){_0x3bca82=_0x3bca82-0x0;var _0x29fe7b=_0x1ecb[_0x3bca82];return _0x29fe7b;};'use strict';var _=require(_0xb1ec('0x0'));var http=require('http');var express=require(_0xb1ec('0x1'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0xb1ec('0x2')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0xb1ec('0x3'))(server,{'transports':[_0xb1ec('0x4'),_0xb1ec('0x5')]});config[_0xb1ec('0x6')]=_[_0xb1ec('0x7')](config[_0xb1ec('0x6')],{'host':_0xb1ec('0x8'),'port':0x18eb});socketio[_0xb1ec('0x9')](require(_0xb1ec('0xa'))({'pubClient':new Redis(config[_0xb1ec('0x6')]),'subClient':new Redis(config[_0xb1ec('0x6')])}));require(_0xb1ec('0xb'))['default']();require(_0xb1ec('0xc'))[_0xb1ec('0xd')](socketio);require(_0xb1ec('0xe'))['default'](app);require('../../routes')[_0xb1ec('0xd')](app);}else{server[_0xb1ec('0xf')](_0xb1ec('0x10'),function(){console['log'](_0xb1ec('0x11'),config[_0xb1ec('0x12')]);});}exports=module[_0xb1ec('0x13')]=app;
\ No newline at end of file
index 6ee0684..1972684 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff95=['routing','client','Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xff95,0x84));var _0x5ff9=function(_0x321277,_0x5bf550){_0x321277=_0x321277-0x0;var _0x108f9a=_0xff95[_0x321277];return _0x108f9a;};'use strict';var jayson=require(_0x5ff9('0x0'));var BPromise=require(_0x5ff9('0x1'));var logger=require(_0x5ff9('0x2'))(_0x5ff9('0x3'));var client=jayson[_0x5ff9('0x4')]['http']({'port':0x2329});client[_0x5ff9('0x5')]=function(_0x15b435,_0x1312ed){return new BPromise(function(_0x370de9,_0x9612b3){return client[_0x5ff9('0x6')](_0x15b435,_0x1312ed)[_0x5ff9('0x7')](function(_0x3ea034){logger[_0x5ff9('0x8')](_0x5ff9('0x9'),_0x5ff9('0x3'),_0x15b435,_0x1312ed,_0x3ea034);if(_0x3ea034[_0x5ff9('0xa')]){logger['error'](_0x5ff9('0x9'),_0x5ff9('0x3'),_0x15b435,_0x3ea034[_0x5ff9('0xa')]['message'],_0x1312ed);return _0x9612b3(_0x3ea034['error'][_0x5ff9('0xb')]);}else{return _0x370de9(_0x3ea034[_0x5ff9('0xc')]);}})[_0x5ff9('0xd')](function(_0x988bc9){logger[_0x5ff9('0xa')]('rpc','routing',_0x15b435,_0x988bc9,_0x1312ed);return _0x9612b3(_0x988bc9);});});};module[_0x5ff9('0xe')]=client;
\ No newline at end of file
+var _0x154c=['then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','request'];(function(_0x3572b3,_0x593ffe){var _0x55e4aa=function(_0x5a6b53){while(--_0x5a6b53){_0x3572b3['push'](_0x3572b3['shift']());}};_0x55e4aa(++_0x593ffe);}(_0x154c,0xa2));var _0xc154=function(_0x1deba9,_0x42ec49){_0x1deba9=_0x1deba9-0x0;var _0xda60c2=_0x154c[_0x1deba9];return _0xda60c2;};'use strict';var jayson=require(_0xc154('0x0'));var BPromise=require(_0xc154('0x1'));var logger=require(_0xc154('0x2'))(_0xc154('0x3'));var client=jayson[_0xc154('0x4')]['http']({'port':0x2329});client['Request']=function(_0xac8fc0,_0x49179c){return new BPromise(function(_0x308b63,_0x366ae0){return client[_0xc154('0x5')](_0xac8fc0,_0x49179c)[_0xc154('0x6')](function(_0x43adc8){logger[_0xc154('0x7')](_0xc154('0x8'),_0xc154('0x3'),_0xac8fc0,_0x49179c,_0x43adc8);if(_0x43adc8['error']){logger[_0xc154('0x9')](_0xc154('0x8'),_0xc154('0x3'),_0xac8fc0,_0x43adc8[_0xc154('0x9')][_0xc154('0xa')],_0x49179c);return _0x366ae0(_0x43adc8[_0xc154('0x9')][_0xc154('0xa')]);}else{return _0x308b63(_0x43adc8[_0xc154('0xb')]);}})[_0xc154('0xc')](function(_0x4dda7a){logger['error'](_0xc154('0x8'),'routing',_0xac8fc0,_0x4dda7a,_0x49179c);return _0x366ae0(_0x4dda7a);});});};module[_0xc154('0xd')]=client;
\ No newline at end of file
index 2064cef..e6316a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0204=['initAgents','getIntervals','getOpenchannelQueues','initChatQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x0204,0x198));var _0x4020=function(_0x2788fd,_0x460cd4){_0x2788fd=_0x2788fd-0x0;var _0xc86410=_0x0204[_0x2788fd];return _0xc86410;};'use strict';var BPromise=require(_0x4020('0x0'));var server=require('./server');var Realtime=require(_0x4020('0x1'));var user=require(_0x4020('0x2'));var interval=require(_0x4020('0x3'));var openchannelQueue=require(_0x4020('0x4'));var chatQueue=require(_0x4020('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x4020('0x6'));var whatsappQueue=require(_0x4020('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x4020('0x8')](user[_0x4020('0x9')]())['then'](realtime[_0x4020('0xa')]())[_0x4020('0x8')](interval[_0x4020('0xb')]())[_0x4020('0x8')](realtime['initIntervals']())[_0x4020('0x8')](openchannelQueue[_0x4020('0xc')]())[_0x4020('0x8')](realtime['initOpenchannelQueues']())[_0x4020('0x8')](chatQueue['getChatQueues']())['then'](realtime[_0x4020('0xd')]())[_0x4020('0x8')](smsQueue['getSmsQueues']())[_0x4020('0x8')](realtime[_0x4020('0xe')]())[_0x4020('0x8')](mailQueue[_0x4020('0xf')]())[_0x4020('0x8')](realtime['initMailQueues']())[_0x4020('0x8')](faxQueue[_0x4020('0x10')]())[_0x4020('0x8')](realtime[_0x4020('0x11')]())[_0x4020('0x8')](whatsappQueue[_0x4020('0x12')]())[_0x4020('0x8')](realtime['initWhatsappQueues']())[_0x4020('0x8')](function(){return realtime;});}function main(){return server[_0x4020('0x13')](realtime)[_0x4020('0x8')](function(_0x37e2e5){return initRealtime();})['then'](function(_0x510780){return setInterval(initRealtime,0x1388);})[_0x4020('0x14')](function(_0x383c0e){console[_0x4020('0x15')](_0x383c0e);});}main();
\ No newline at end of file
+var _0xbb93=['initFaxQueues','initWhatsappQueues','listen','catch','log','bluebird','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues'];(function(_0x44e861,_0x165d8c){var _0x5cfbb9=function(_0x2b75de){while(--_0x2b75de){_0x44e861['push'](_0x44e861['shift']());}};_0x5cfbb9(++_0x165d8c);}(_0xbb93,0xd5));var _0x3bb9=function(_0x5ccf98,_0x16d903){_0x5ccf98=_0x5ccf98-0x0;var _0x26379f=_0xbb93[_0x5ccf98];return _0x26379f;};'use strict';var BPromise=require(_0x3bb9('0x0'));var server=require('./server');var Realtime=require('./realtime');var user=require(_0x3bb9('0x1'));var interval=require(_0x3bb9('0x2'));var openchannelQueue=require(_0x3bb9('0x3'));var chatQueue=require(_0x3bb9('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x3bb9('0x5'));var faxQueue=require(_0x3bb9('0x6'));var whatsappQueue=require(_0x3bb9('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x3bb9('0x8')]()[_0x3bb9('0x9')](user[_0x3bb9('0xa')]())[_0x3bb9('0x9')](realtime['initAgents']())[_0x3bb9('0x9')](interval['getIntervals']())[_0x3bb9('0x9')](realtime[_0x3bb9('0xb')]())[_0x3bb9('0x9')](openchannelQueue[_0x3bb9('0xc')]())['then'](realtime[_0x3bb9('0xd')]())['then'](chatQueue[_0x3bb9('0xe')]())[_0x3bb9('0x9')](realtime[_0x3bb9('0xf')]())[_0x3bb9('0x9')](smsQueue[_0x3bb9('0x10')]())[_0x3bb9('0x9')](realtime[_0x3bb9('0x11')]())[_0x3bb9('0x9')](mailQueue[_0x3bb9('0x12')]())['then'](realtime[_0x3bb9('0x13')]())['then'](faxQueue[_0x3bb9('0x14')]())['then'](realtime[_0x3bb9('0x15')]())[_0x3bb9('0x9')](whatsappQueue['getWhatsappQueues']())[_0x3bb9('0x9')](realtime[_0x3bb9('0x16')]())[_0x3bb9('0x9')](function(){return realtime;});}function main(){return server[_0x3bb9('0x17')](realtime)[_0x3bb9('0x9')](function(_0x51c55b){return initRealtime();})[_0x3bb9('0x9')](function(_0xf3f159){return setInterval(initRealtime,0x1388);})[_0x3bb9('0x18')](function(_0x1e0199){console[_0x3bb9('0x19')](_0x1e0199);});}main();
\ No newline at end of file
index 0432c4d..767cf90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x355ced,_0x409173){var _0x5ba67a=function(_0x3fe3bb){while(--_0x3fe3bb){_0x355ced['push'](_0x355ced['shift']());}};_0x5ba67a(++_0x409173);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc4aa[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine;
\ No newline at end of file
+var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x7ef709,_0x12cdce){var _0x502b71=function(_0x4fc301){while(--_0x4fc301){_0x7ef709['push'](_0x7ef709['shift']());}};_0x502b71(++_0x12cdce);}(_0x5fc3,0xa8));var _0x35fc=function(_0x11dc39,_0x491115){_0x11dc39=_0x11dc39-0x0;var _0x457277=_0x5fc3[_0x11dc39];return _0x457277;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine;
\ No newline at end of file
index ddc4131..4caab9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a4d=['catch','sendMailMessage','SendMail','client','http','request','then','error','message','result'];(function(_0x2e36a7,_0x4f0cf6){var _0x1b1645=function(_0x13dc0f){while(--_0x13dc0f){_0x2e36a7['push'](_0x2e36a7['shift']());}};_0x1b1645(++_0x4f0cf6);}(_0x5a4d,0x19d));var _0xd5a4=function(_0x4a9af0,_0x5916bf){_0x4a9af0=_0x4a9af0-0x0;var _0xeeb194=_0x5a4d[_0x4a9af0];return _0xeeb194;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0xd5a4('0x0')][_0xd5a4('0x1')]({'port':0x232b});function request(_0x194fb2,_0x5096c8){return new BPromise(function(_0xbf7754,_0x3e0e5d){return client[_0xd5a4('0x2')](_0x194fb2,_0x5096c8)[_0xd5a4('0x3')](function(_0x37e6fa){if(_0x37e6fa[_0xd5a4('0x4')]){return _0x3e0e5d(_0x37e6fa[_0xd5a4('0x4')][_0xd5a4('0x5')]);}else{return _0xbf7754(_0x37e6fa[_0xd5a4('0x6')]);}})[_0xd5a4('0x7')](function(_0x1f9775){return _0x3e0e5d(_0x1f9775);});});}exports[_0xd5a4('0x8')]=function(_0x22bb79,_0x50a400){return request(_0xd5a4('0x9'),{'account':_0x22bb79,'message':_0x50a400});};
\ No newline at end of file
+var _0x39b3=['sendMailMessage','bluebird','client','http','request','then','error','message','catch'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x39b3,0xb5));var _0x339b=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x39b3[_0x376b45];return _0x2341b3;};'use strict';var BPromise=require(_0x339b('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x339b('0x1')][_0x339b('0x2')]({'port':0x232b});function request(_0x25306a,_0x1507e2){return new BPromise(function(_0x1cf827,_0xafd755){return client[_0x339b('0x3')](_0x25306a,_0x1507e2)[_0x339b('0x4')](function(_0x2d4c8f){if(_0x2d4c8f[_0x339b('0x5')]){return _0xafd755(_0x2d4c8f['error'][_0x339b('0x6')]);}else{return _0x1cf827(_0x2d4c8f['result']);}})[_0x339b('0x7')](function(_0x3714b3){return _0xafd755(_0x3714b3);});});}exports[_0x339b('0x8')]=function(_0x45b14c,_0x33e496){return request('SendMail',{'account':_0x45b14c,'message':_0x33e496});};
\ No newline at end of file
index a61dfee..85d068a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6de8=['openchannelCurrentCapacity','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','updateRealtime','chat','fax','whatsapp','length','StatusTime','toNumber','format','mailCurrentCapacity','faxStatus','faxCurrentCapacity','smsStatusTime','openchannelCapacity','busy','busyQueue','stringify','emit','user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x6de8,0x183));var _0x86de=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0x6de8[_0x21de89];return _0x290b7e;};'use strict';var _=require(_0x86de('0x0'));var moment=require('moment');var md5=require(_0x86de('0x1'));var Redis=require(_0x86de('0x2'));var config=require(_0x86de('0x3'));config['redis']=_['defaults'](config[_0x86de('0x4')],{'host':_0x86de('0x5'),'port':0x18eb});var io=require(_0x86de('0x6'))(new Redis(config[_0x86de('0x4')]));function Agent(_0x13d0dd){this['id']=_0x13d0dd['id']||0x0;this[_0x86de('0x7')]=_0x13d0dd[_0x86de('0x7')]||'';this[_0x86de('0x8')]=_0x13d0dd['online']||!![];this[_0x86de('0x9')]=_0x13d0dd[_0x86de('0x9')]||![];this[_0x86de('0xa')]=_0x13d0dd[_0x86de('0xa')]||![];this[_0x86de('0xb')]=_0x13d0dd[_0x86de('0xb')]||![];this['faxPause']=_0x13d0dd[_0x86de('0xc')]||![];this[_0x86de('0xd')]=_0x13d0dd[_0x86de('0xd')]||![];this[_0x86de('0xe')]=_0x13d0dd[_0x86de('0xe')]||![];this[_0x86de('0xf')]=_0x86de('0x10');this[_0x86de('0x11')]=0x0;this['chatCapacity']=_0x13d0dd[_0x86de('0x12')]||0x0;this[_0x86de('0x13')]=0x0;this[_0x86de('0x14')]=_0x86de('0x10');this[_0x86de('0x15')]=0x0;this['mailCapacity']=_0x13d0dd[_0x86de('0x16')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0x86de('0x10');this['faxStatusTime']=0x0;this[_0x86de('0x17')]=_0x13d0dd['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0x86de('0x18')]='unknown';this['smsStatusTime']=0x0;this[_0x86de('0x19')]=_0x13d0dd[_0x86de('0x19')]||0x0;this[_0x86de('0x1a')]=0x0;this[_0x86de('0x1b')]=_0x86de('0x10');this[_0x86de('0x1c')]=0x0;this[_0x86de('0x1d')]=_0x13d0dd[_0x86de('0x1d')]||0x0;this[_0x86de('0x1e')]=0x0;this[_0x86de('0x1f')]='unknown';this[_0x86de('0x20')]=0x0;this['openchannelCapacity']=_0x13d0dd['openchannelCapacity']||0x0;this[_0x86de('0x21')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x86de('0x1')]='';this['updateRealtime']();}Agent[_0x86de('0x22')][_0x86de('0x23')]=function(_0x7afea6){if(this[_0x7afea6+'CurrentCapacity']>0x0){if(this[_0x7afea6+_0x86de('0x24')]>0x0&&this[_0x7afea6+_0x86de('0x25')]>=this[_0x7afea6+'Capacity']){return _0x86de('0x26');}else{return _0x86de('0x27');}}else{return _0x86de('0x28');}};Agent['prototype'][_0x86de('0x29')]=function(){var _0x31c941=['mail',_0x86de('0x2a'),'openchannel',_0x86de('0x2b'),'sms',_0x86de('0x2c')];for(var _0x2d10a4=0x0;_0x2d10a4<_0x31c941[_0x86de('0x2d')];_0x2d10a4+=0x1){var _0x239e5b=this[_0x86de('0x23')](_0x31c941[_0x2d10a4]);if(this[_0x31c941[_0x2d10a4]+'Status']!==_0x239e5b){this[_0x31c941[_0x2d10a4]+_0x86de('0x2e')]=_[_0x86de('0x2f')](moment()[_0x86de('0x30')]('x'));}this[_0x31c941[_0x2d10a4]+'Status']=_0x239e5b;}var _0x5404a3={'id':this['id'],'name':this[_0x86de('0x7')],'online':this['online'],'voicePause':this[_0x86de('0x9')],'chatPause':this[_0x86de('0xa')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0x86de('0xc')],'openchannelPause':this[_0x86de('0xe')],'chatStatus':this[_0x86de('0xf')],'chatStatusTime':this[_0x86de('0x11')],'chatCapacity':this[_0x86de('0x12')],'chatCurrentCapacity':this[_0x86de('0x13')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x86de('0x15')],'mailCapacity':this[_0x86de('0x16')],'mailCurrentCapacity':this[_0x86de('0x31')],'faxStatus':this[_0x86de('0x32')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x86de('0x17')],'faxCurrentCapacity':this[_0x86de('0x33')],'smsStatus':this[_0x86de('0x18')],'smsStatusTime':this[_0x86de('0x34')],'smsCapacity':this[_0x86de('0x19')],'smsCurrentCapacity':this[_0x86de('0x1a')],'whatsappStatus':this[_0x86de('0x1b')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x86de('0x1d')],'whatsappCurrentCapacity':this[_0x86de('0x1e')],'openchannelStatus':this[_0x86de('0x1f')],'openchannelStatusTime':this[_0x86de('0x20')],'openchannelCapacity':this[_0x86de('0x35')],'openchannelCurrentCapacity':this[_0x86de('0x21')],'busy':this[_0x86de('0x36')],'busyQueue':this[_0x86de('0x37')]};var _0xb7d063=md5(JSON[_0x86de('0x38')](_0x5404a3));if(this[_0x86de('0x1')]!==_0xb7d063){this[_0x86de('0x1')]=_0xb7d063;io[_0x86de('0x39')](_0x86de('0x3a'),_0x5404a3);}};module[_0x86de('0x3b')]=Agent;
\ No newline at end of file
+var _0xf3aa=['ioredis','redis','localhost','socket.io-emitter','name','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','chat','openchannel','fax','sms','whatsapp','length','toNumber','Status','chatStatus','faxStatus','whatsappStatus','whatsappCapacity','openchannelStatus','busy','stringify','emit','user:save','exports','lodash','moment','md5'];(function(_0x21986c,_0x2884f7){var _0x1bc41c=function(_0x3a3264){while(--_0x3a3264){_0x21986c['push'](_0x21986c['shift']());}};_0x1bc41c(++_0x2884f7);}(_0xf3aa,0xf1));var _0xaf3a=function(_0x382bdd,_0x4e0534){_0x382bdd=_0x382bdd-0x0;var _0x1f29d8=_0xf3aa[_0x382bdd];return _0x1f29d8;};'use strict';var _=require(_0xaf3a('0x0'));var moment=require(_0xaf3a('0x1'));var md5=require(_0xaf3a('0x2'));var Redis=require(_0xaf3a('0x3'));var config=require('../../../config/environment');config[_0xaf3a('0x4')]=_['defaults'](config['redis'],{'host':_0xaf3a('0x5'),'port':0x18eb});var io=require(_0xaf3a('0x6'))(new Redis(config[_0xaf3a('0x4')]));function Agent(_0x41395c){this['id']=_0x41395c['id']||0x0;this[_0xaf3a('0x7')]=_0x41395c[_0xaf3a('0x7')]||'';this[_0xaf3a('0x8')]=_0x41395c[_0xaf3a('0x8')]||!![];this['voicePause']=_0x41395c['voicePause']||![];this[_0xaf3a('0x9')]=_0x41395c[_0xaf3a('0x9')]||![];this[_0xaf3a('0xa')]=_0x41395c['mailPause']||![];this['faxPause']=_0x41395c[_0xaf3a('0xb')]||![];this[_0xaf3a('0xc')]=_0x41395c[_0xaf3a('0xc')]||![];this[_0xaf3a('0xd')]=_0x41395c[_0xaf3a('0xd')]||![];this['chatStatus']=_0xaf3a('0xe');this[_0xaf3a('0xf')]=0x0;this['chatCapacity']=_0x41395c[_0xaf3a('0x10')]||0x0;this[_0xaf3a('0x11')]=0x0;this[_0xaf3a('0x12')]='unknown';this[_0xaf3a('0x13')]=0x0;this[_0xaf3a('0x14')]=_0x41395c['mailCapacity']||0x0;this[_0xaf3a('0x15')]=0x0;this['faxStatus']='unknown';this[_0xaf3a('0x16')]=0x0;this[_0xaf3a('0x17')]=_0x41395c['faxCapacity']||0x0;this[_0xaf3a('0x18')]=0x0;this[_0xaf3a('0x19')]='unknown';this[_0xaf3a('0x1a')]=0x0;this[_0xaf3a('0x1b')]=_0x41395c[_0xaf3a('0x1b')]||0x0;this[_0xaf3a('0x1c')]=0x0;this['whatsappStatus']=_0xaf3a('0xe');this[_0xaf3a('0x1d')]=0x0;this['whatsappCapacity']=_0x41395c['whatsappCapacity']||0x0;this[_0xaf3a('0x1e')]=0x0;this['openchannelStatus']=_0xaf3a('0xe');this[_0xaf3a('0x1f')]=0x0;this[_0xaf3a('0x20')]=_0x41395c[_0xaf3a('0x20')]||0x0;this[_0xaf3a('0x21')]=0x0;this['busy']=![];this[_0xaf3a('0x22')]=undefined;this[_0xaf3a('0x2')]='';this[_0xaf3a('0x23')]();}Agent[_0xaf3a('0x24')][_0xaf3a('0x25')]=function(_0x34d189){if(this[_0x34d189+_0xaf3a('0x26')]>0x0){if(this[_0x34d189+_0xaf3a('0x27')]>0x0&&this[_0x34d189+'CurrentCapacity']>=this[_0x34d189+'Capacity']){return _0xaf3a('0x28');}else{return _0xaf3a('0x29');}}else{return _0xaf3a('0x2a');}};Agent['prototype'][_0xaf3a('0x23')]=function(){var _0x1610e6=['mail',_0xaf3a('0x2b'),_0xaf3a('0x2c'),_0xaf3a('0x2d'),_0xaf3a('0x2e'),_0xaf3a('0x2f')];for(var _0x409a27=0x0;_0x409a27<_0x1610e6[_0xaf3a('0x30')];_0x409a27+=0x1){var _0x2a895d=this['getChannelStatus'](_0x1610e6[_0x409a27]);if(this[_0x1610e6[_0x409a27]+'Status']!==_0x2a895d){this[_0x1610e6[_0x409a27]+'StatusTime']=_[_0xaf3a('0x31')](moment()['format']('x'));}this[_0x1610e6[_0x409a27]+_0xaf3a('0x32')]=_0x2a895d;}var _0x2c703f={'id':this['id'],'name':this[_0xaf3a('0x7')],'online':this[_0xaf3a('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0xaf3a('0x9')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0xaf3a('0xb')],'openchannelPause':this[_0xaf3a('0xd')],'chatStatus':this[_0xaf3a('0x33')],'chatStatusTime':this[_0xaf3a('0xf')],'chatCapacity':this[_0xaf3a('0x10')],'chatCurrentCapacity':this[_0xaf3a('0x11')],'mailStatus':this[_0xaf3a('0x12')],'mailStatusTime':this[_0xaf3a('0x13')],'mailCapacity':this[_0xaf3a('0x14')],'mailCurrentCapacity':this[_0xaf3a('0x15')],'faxStatus':this[_0xaf3a('0x34')],'faxStatusTime':this[_0xaf3a('0x16')],'faxCapacity':this[_0xaf3a('0x17')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xaf3a('0x19')],'smsStatusTime':this[_0xaf3a('0x1a')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xaf3a('0x1c')],'whatsappStatus':this[_0xaf3a('0x35')],'whatsappStatusTime':this[_0xaf3a('0x1d')],'whatsappCapacity':this[_0xaf3a('0x36')],'whatsappCurrentCapacity':this[_0xaf3a('0x1e')],'openchannelStatus':this[_0xaf3a('0x37')],'openchannelStatusTime':this[_0xaf3a('0x1f')],'openchannelCapacity':this[_0xaf3a('0x20')],'openchannelCurrentCapacity':this[_0xaf3a('0x21')],'busy':this[_0xaf3a('0x38')],'busyQueue':this['busyQueue']};var _0x21dda7=md5(JSON[_0xaf3a('0x39')](_0x2c703f));if(this[_0xaf3a('0x2')]!==_0x21dda7){this[_0xaf3a('0x2')]=_0x21dda7;io[_0xaf3a('0x3a')](_0xaf3a('0x3b'),_0x2c703f);}};module[_0xaf3a('0x3c')]=Agent;
\ No newline at end of file
index 86ef8ef..bfbe371 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83c2=['chatPause','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','_rr','map','prototype','loggedIn'];(function(_0xd9c21f,_0x1de51c){var _0x667032=function(_0x340b16){while(--_0x340b16){_0xd9c21f['push'](_0xd9c21f['shift']());}};_0x667032(++_0x1de51c);}(_0x83c2,0xe1));var _0x283c=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x83c2[_0x16db8b];return _0x5ba017;};'use strict';var _=require(_0x283c('0x0'));var md5=require(_0x283c('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x283c('0x2')]=_[_0x283c('0x3')](config[_0x283c('0x2')],{'host':_0x283c('0x4'),'port':0x18eb});var io=require(_0x283c('0x5'))(new Redis(config[_0x283c('0x2')]));function ChatQueue(_0x125f5d){this['id']=_0x125f5d['id']||0x0;this[_0x283c('0x6')]=_0x125f5d[_0x283c('0x6')]||'';this[_0x283c('0x7')]=_0x125f5d[_0x283c('0x7')]||0xa;this[_0x283c('0x8')]=_0x125f5d[_0x283c('0x8')]||_0x283c('0x9');this[_0x283c('0xa')]=_0x125f5d[_0x283c('0xa')];this[_0x283c('0xb')]={};this[_0x283c('0xc')]=0x0;this[_0x283c('0x1')]='';this['updateRouting']();this[_0x283c('0xd')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x176f6e=this[_0x283c('0xb')][_0x283c('0xe')];this['mapAgentsId']=_[_0x283c('0xf')](this[_0x283c('0xa')],'id');this['mapAgentsId'][_0x283c('0xe')]=_0x176f6e;};ChatQueue[_0x283c('0x10')][_0x283c('0xd')]=function(){this[_0x283c('0x11')]=0x0;this['paused']=0x0;for(var _0x24ab1b=0x0;_0x24ab1b<this[_0x283c('0xa')]['length'];_0x24ab1b+=0x1){if(this['Agents'][_0x24ab1b]['online']){this[_0x283c('0x11')]+=0x1;}if(this[_0x283c('0xa')][_0x24ab1b][_0x283c('0x12')]){this['paused']+=0x1;}}this['available']=this[_0x283c('0x11')]-this[_0x283c('0x13')];this['available']=this[_0x283c('0x14')]>=0x0?this[_0x283c('0x14')]:0x0;var _0x3221f4={'id':this['id'],'available':this[_0x283c('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x283c('0x6')],'paused':this[_0x283c('0x13')],'waiting':this[_0x283c('0xc')]};var _0x391036=md5(JSON[_0x283c('0x15')](_0x3221f4));if(this[_0x283c('0x1')]!==_0x391036){this['md5']=_0x391036;io['to'](util[_0x283c('0x16')](_0x283c('0x17'),_0x3221f4[_0x283c('0x6')]))[_0x283c('0x18')](_0x283c('0x19'),_0x3221f4);}};module[_0x283c('0x1a')]=ChatQueue;
\ No newline at end of file
+var _0xe8f8=['updateRouting','updateRealtime','_rr','map','prototype','paused','length','online','loggedIn','available','chat:queue:%s','emit','chat_queue:save','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x1b5fff,_0x21d5e5){var _0x1536a4=function(_0x1f5acb){while(--_0x1f5acb){_0x1b5fff['push'](_0x1b5fff['shift']());}};_0x1536a4(++_0x21d5e5);}(_0xe8f8,0x1a2));var _0x8e8f=function(_0x3f89bd,_0x43dd0e){_0x3f89bd=_0x3f89bd-0x0;var _0x2eb2d8=_0xe8f8[_0x3f89bd];return _0x2eb2d8;};'use strict';var _=require(_0x8e8f('0x0'));var md5=require(_0x8e8f('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x8e8f('0x2'));config[_0x8e8f('0x3')]=_[_0x8e8f('0x4')](config[_0x8e8f('0x3')],{'host':_0x8e8f('0x5'),'port':0x18eb});var io=require(_0x8e8f('0x6'))(new Redis(config[_0x8e8f('0x3')]));function ChatQueue(_0x58ff3c){this['id']=_0x58ff3c['id']||0x0;this[_0x8e8f('0x7')]=_0x58ff3c[_0x8e8f('0x7')]||'';this['timeout']=_0x58ff3c[_0x8e8f('0x8')]||0xa;this[_0x8e8f('0x9')]=_0x58ff3c[_0x8e8f('0x9')]||_0x8e8f('0xa');this['Agents']=_0x58ff3c[_0x8e8f('0xb')];this[_0x8e8f('0xc')]={};this[_0x8e8f('0xd')]=0x0;this[_0x8e8f('0x1')]='';this[_0x8e8f('0xe')]();this[_0x8e8f('0xf')]();}ChatQueue['prototype'][_0x8e8f('0xe')]=function(){var _0x1ef383=this[_0x8e8f('0xc')][_0x8e8f('0x10')];this[_0x8e8f('0xc')]=_[_0x8e8f('0x11')](this[_0x8e8f('0xb')],'id');this[_0x8e8f('0xc')][_0x8e8f('0x10')]=_0x1ef383;};ChatQueue[_0x8e8f('0x12')][_0x8e8f('0xf')]=function(){this['loggedIn']=0x0;this[_0x8e8f('0x13')]=0x0;for(var _0x4aadd1=0x0;_0x4aadd1<this['Agents'][_0x8e8f('0x14')];_0x4aadd1+=0x1){if(this[_0x8e8f('0xb')][_0x4aadd1][_0x8e8f('0x15')]){this[_0x8e8f('0x16')]+=0x1;}if(this[_0x8e8f('0xb')][_0x4aadd1]['chatPause']){this['paused']+=0x1;}}this[_0x8e8f('0x17')]=this[_0x8e8f('0x16')]-this[_0x8e8f('0x13')];this[_0x8e8f('0x17')]=this[_0x8e8f('0x17')]>=0x0?this[_0x8e8f('0x17')]:0x0;var _0x5ec7b1={'id':this['id'],'available':this[_0x8e8f('0x17')],'loggedIn':this[_0x8e8f('0x16')],'name':this[_0x8e8f('0x7')],'paused':this['paused'],'waiting':this[_0x8e8f('0xd')]};var _0x1b72a4=md5(JSON['stringify'](_0x5ec7b1));if(this[_0x8e8f('0x1')]!==_0x1b72a4){this[_0x8e8f('0x1')]=_0x1b72a4;io['to'](util['format'](_0x8e8f('0x18'),_0x5ec7b1['name']))[_0x8e8f('0x19')](_0x8e8f('0x1a'),_0x5ec7b1);}};module['exports']=ChatQueue;
\ No newline at end of file
index 18f9a46..bfefe2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9ed=['strategy','beepall','Agents','updateRouting','mapAgentsId','_rr','map','prototype','updateRealtime','loggedIn','paused','length','available','waiting','stringify','format','emit','fax_queue:save','exports','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x1abf3a,_0x30a018){var _0x46ac24=function(_0x4a7320){while(--_0x4a7320){_0x1abf3a['push'](_0x1abf3a['shift']());}};_0x46ac24(++_0x30a018);}(_0xb9ed,0x13c));var _0xdb9e=function(_0xf87884,_0xe57ae){_0xf87884=_0xf87884-0x0;var _0x3ae85a=_0xb9ed[_0xf87884];return _0x3ae85a;};'use strict';var _=require('lodash');var md5=require(_0xdb9e('0x0'));var util=require('util');var Redis=require(_0xdb9e('0x1'));var config=require(_0xdb9e('0x2'));config[_0xdb9e('0x3')]=_['defaults'](config['redis'],{'host':_0xdb9e('0x4'),'port':0x18eb});var io=require(_0xdb9e('0x5'))(new Redis(config[_0xdb9e('0x3')]));function FaxQueue(_0x8da5cc){this['id']=_0x8da5cc['id']||0x0;this['name']=_0x8da5cc[_0xdb9e('0x6')]||'';this[_0xdb9e('0x7')]=_0x8da5cc['timeout']||0xa;this[_0xdb9e('0x8')]=_0x8da5cc[_0xdb9e('0x8')]||_0xdb9e('0x9');this[_0xdb9e('0xa')]=_0x8da5cc[_0xdb9e('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xdb9e('0x0')]='';this[_0xdb9e('0xb')]();this['updateRealtime']();}FaxQueue['prototype']['updateRouting']=function(){var _0x5b0965=this[_0xdb9e('0xc')][_0xdb9e('0xd')];this[_0xdb9e('0xc')]=_[_0xdb9e('0xe')](this[_0xdb9e('0xa')],'id');this[_0xdb9e('0xc')]['_rr']=_0x5b0965;};FaxQueue[_0xdb9e('0xf')][_0xdb9e('0x10')]=function(){this[_0xdb9e('0x11')]=0x0;this[_0xdb9e('0x12')]=0x0;for(var _0x4e9bc4=0x0;_0x4e9bc4<this[_0xdb9e('0xa')][_0xdb9e('0x13')];_0x4e9bc4+=0x1){if(this[_0xdb9e('0xa')][_0x4e9bc4]['online']){this[_0xdb9e('0x11')]+=0x1;}if(this[_0xdb9e('0xa')][_0x4e9bc4]['faxPause']){this[_0xdb9e('0x12')]+=0x1;}}this[_0xdb9e('0x14')]=this[_0xdb9e('0x11')]-this[_0xdb9e('0x12')];this[_0xdb9e('0x14')]=this['available']>=0x0?this[_0xdb9e('0x14')]:0x0;var _0xda2596={'id':this['id'],'available':this[_0xdb9e('0x14')],'loggedIn':this[_0xdb9e('0x11')],'name':this['name'],'paused':this[_0xdb9e('0x12')],'waiting':this[_0xdb9e('0x15')]};var _0x5ed8e9=md5(JSON[_0xdb9e('0x16')](_0xda2596));if(this[_0xdb9e('0x0')]!==_0x5ed8e9){this[_0xdb9e('0x0')]=_0x5ed8e9;io['to'](util[_0xdb9e('0x17')]('fax:queue:%s',_0xda2596[_0xdb9e('0x6')]))[_0xdb9e('0x18')](_0xdb9e('0x19'),_0xda2596);}};module[_0xdb9e('0x1a')]=FaxQueue;
\ No newline at end of file
+var _0xcb9f=['waiting','emit','fax_queue:save','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','map','_rr','prototype','updateRealtime','loggedIn','length','online','faxPause','paused','available'];(function(_0x13aa7b,_0xc6f965){var _0x5c0e12=function(_0xd1d9af){while(--_0xd1d9af){_0x13aa7b['push'](_0x13aa7b['shift']());}};_0x5c0e12(++_0xc6f965);}(_0xcb9f,0x1d7));var _0xfcb9=function(_0x441ffa,_0x3614ac){_0x441ffa=_0x441ffa-0x0;var _0x3acdb9=_0xcb9f[_0x441ffa];return _0x3acdb9;};'use strict';var _=require('lodash');var md5=require(_0xfcb9('0x0'));var util=require('util');var Redis=require(_0xfcb9('0x1'));var config=require(_0xfcb9('0x2'));config[_0xfcb9('0x3')]=_[_0xfcb9('0x4')](config[_0xfcb9('0x3')],{'host':_0xfcb9('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x1097f2){this['id']=_0x1097f2['id']||0x0;this[_0xfcb9('0x6')]=_0x1097f2['name']||'';this[_0xfcb9('0x7')]=_0x1097f2[_0xfcb9('0x7')]||0xa;this[_0xfcb9('0x8')]=_0x1097f2[_0xfcb9('0x8')]||_0xfcb9('0x9');this[_0xfcb9('0xa')]=_0x1097f2['Agents'];this[_0xfcb9('0xb')]={};this['waiting']=0x0;this[_0xfcb9('0x0')]='';this[_0xfcb9('0xc')]();this['updateRealtime']();}FaxQueue['prototype'][_0xfcb9('0xc')]=function(){var _0x5466a9=this['mapAgentsId']['_rr'];this[_0xfcb9('0xb')]=_[_0xfcb9('0xd')](this['Agents'],'id');this[_0xfcb9('0xb')][_0xfcb9('0xe')]=_0x5466a9;};FaxQueue[_0xfcb9('0xf')][_0xfcb9('0x10')]=function(){this[_0xfcb9('0x11')]=0x0;this['paused']=0x0;for(var _0x11adb9=0x0;_0x11adb9<this[_0xfcb9('0xa')][_0xfcb9('0x12')];_0x11adb9+=0x1){if(this[_0xfcb9('0xa')][_0x11adb9][_0xfcb9('0x13')]){this[_0xfcb9('0x11')]+=0x1;}if(this[_0xfcb9('0xa')][_0x11adb9][_0xfcb9('0x14')]){this['paused']+=0x1;}}this['available']=this[_0xfcb9('0x11')]-this[_0xfcb9('0x15')];this['available']=this['available']>=0x0?this[_0xfcb9('0x16')]:0x0;var _0x31dff6={'id':this['id'],'available':this[_0xfcb9('0x16')],'loggedIn':this[_0xfcb9('0x11')],'name':this[_0xfcb9('0x6')],'paused':this[_0xfcb9('0x15')],'waiting':this[_0xfcb9('0x17')]};var _0x5bb318=md5(JSON['stringify'](_0x31dff6));if(this[_0xfcb9('0x0')]!==_0x5bb318){this[_0xfcb9('0x0')]=_0x5bb318;io['to'](util['format']('fax:queue:%s',_0x31dff6['name']))[_0xfcb9('0x18')](_0xfcb9('0x19'),_0x31dff6);}};module['exports']=FaxQueue;
\ No newline at end of file
index 0b07bf0..c2abf12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6320=['Intervals','exports','name'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6320,0x77));var _0x0632=function(_0x271b70,_0x50c8e5){_0x271b70=_0x271b70-0x0;var _0xf0aa7a=_0x6320[_0x271b70];return _0xf0aa7a;};'use strict';function Interval(_0x4b4391){this['id']=_0x4b4391['id']||0x0;this[_0x0632('0x0')]=_0x4b4391[_0x0632('0x0')]||'';this[_0x0632('0x1')]=_0x4b4391[_0x0632('0x1')]||{};}module[_0x0632('0x2')]=Interval;
\ No newline at end of file
+var _0x806c=['name','Intervals','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x806c,0x1cb));var _0xc806=function(_0x39a2d6,_0x477459){_0x39a2d6=_0x39a2d6-0x0;var _0x23af66=_0x806c[_0x39a2d6];return _0x23af66;};'use strict';function Interval(_0x3aced8){this['id']=_0x3aced8['id']||0x0;this[_0xc806('0x0')]=_0x3aced8[_0xc806('0x0')]||'';this[_0xc806('0x1')]=_0x3aced8[_0xc806('0x1')]||{};}module[_0xc806('0x2')]=Interval;
\ No newline at end of file
index ffd19b6..a5b39db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ea7=['md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','map','_rr','prototype','loggedIn','length','mailPause','paused','available','stringify','mail:queue:%s','exports'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x8ea7,0x15e));var _0x78ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require(_0x78ea('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x78ea('0x1'));config[_0x78ea('0x2')]=_['defaults'](config[_0x78ea('0x2')],{'host':_0x78ea('0x3'),'port':0x18eb});var io=require(_0x78ea('0x4'))(new Redis(config[_0x78ea('0x2')]));function MailQueue(_0x383e23){this['id']=_0x383e23['id']||0x0;this[_0x78ea('0x5')]=_0x383e23['name']||'';this[_0x78ea('0x6')]=_0x383e23[_0x78ea('0x6')]||0xa;this[_0x78ea('0x7')]=_0x383e23[_0x78ea('0x7')]||_0x78ea('0x8');this[_0x78ea('0x9')]=_0x383e23[_0x78ea('0x9')];this['mapAgentsId']={};this[_0x78ea('0xa')]=0x0;this[_0x78ea('0x0')]='';this[_0x78ea('0xb')]();this[_0x78ea('0xc')]();}MailQueue['prototype'][_0x78ea('0xb')]=function(){var _0x2ba837=this[_0x78ea('0xd')]['_rr'];this[_0x78ea('0xd')]=_[_0x78ea('0xe')](this[_0x78ea('0x9')],'id');this[_0x78ea('0xd')][_0x78ea('0xf')]=_0x2ba837;};MailQueue[_0x78ea('0x10')][_0x78ea('0xc')]=function(){this[_0x78ea('0x11')]=0x0;this['paused']=0x0;for(var _0x255550=0x0;_0x255550<this['Agents'][_0x78ea('0x12')];_0x255550+=0x1){if(this[_0x78ea('0x9')][_0x255550]['online']){this[_0x78ea('0x11')]+=0x1;}if(this['Agents'][_0x255550][_0x78ea('0x13')]){this[_0x78ea('0x14')]+=0x1;}}this['available']=this['loggedIn']-this[_0x78ea('0x14')];this[_0x78ea('0x15')]=this[_0x78ea('0x15')]>=0x0?this[_0x78ea('0x15')]:0x0;var _0x9f48c9={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x78ea('0x5')],'paused':this[_0x78ea('0x14')],'waiting':this[_0x78ea('0xa')]};var _0x59538b=md5(JSON[_0x78ea('0x16')](_0x9f48c9));if(this[_0x78ea('0x0')]!==_0x59538b){this[_0x78ea('0x0')]=_0x59538b;io['to'](util['format'](_0x78ea('0x17'),_0x9f48c9[_0x78ea('0x5')]))['emit']('mail_queue:save',_0x9f48c9);}};module[_0x78ea('0x18')]=MailQueue;
\ No newline at end of file
+var _0xec3e=['prototype','mapAgentsId','_rr','updateRealtime','loggedIn','paused','length','online','mailPause','available','name','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','waiting','updateRouting'];(function(_0x4ffa64,_0x271035){var _0x5da001=function(_0x7d1940){while(--_0x7d1940){_0x4ffa64['push'](_0x4ffa64['shift']());}};_0x5da001(++_0x271035);}(_0xec3e,0x115));var _0xeec3=function(_0x4c80e9,_0x2cd4a2){_0x4c80e9=_0x4c80e9-0x0;var _0x28bf72=_0xec3e[_0x4c80e9];return _0x28bf72;};'use strict';var _=require(_0xeec3('0x0'));var md5=require(_0xeec3('0x1'));var util=require(_0xeec3('0x2'));var Redis=require(_0xeec3('0x3'));var config=require('../../../config/environment');config[_0xeec3('0x4')]=_['defaults'](config['redis'],{'host':_0xeec3('0x5'),'port':0x18eb});var io=require(_0xeec3('0x6'))(new Redis(config[_0xeec3('0x4')]));function MailQueue(_0x162b79){this['id']=_0x162b79['id']||0x0;this['name']=_0x162b79['name']||'';this['timeout']=_0x162b79[_0xeec3('0x7')]||0xa;this[_0xeec3('0x8')]=_0x162b79[_0xeec3('0x8')]||_0xeec3('0x9');this[_0xeec3('0xa')]=_0x162b79['Agents'];this['mapAgentsId']={};this[_0xeec3('0xb')]=0x0;this[_0xeec3('0x1')]='';this[_0xeec3('0xc')]();this['updateRealtime']();}MailQueue[_0xeec3('0xd')]['updateRouting']=function(){var _0x12588e=this[_0xeec3('0xe')][_0xeec3('0xf')];this[_0xeec3('0xe')]=_['map'](this[_0xeec3('0xa')],'id');this[_0xeec3('0xe')][_0xeec3('0xf')]=_0x12588e;};MailQueue[_0xeec3('0xd')][_0xeec3('0x10')]=function(){this[_0xeec3('0x11')]=0x0;this[_0xeec3('0x12')]=0x0;for(var _0x5385df=0x0;_0x5385df<this['Agents'][_0xeec3('0x13')];_0x5385df+=0x1){if(this[_0xeec3('0xa')][_0x5385df][_0xeec3('0x14')]){this[_0xeec3('0x11')]+=0x1;}if(this[_0xeec3('0xa')][_0x5385df][_0xeec3('0x15')]){this[_0xeec3('0x12')]+=0x1;}}this[_0xeec3('0x16')]=this[_0xeec3('0x11')]-this['paused'];this[_0xeec3('0x16')]=this[_0xeec3('0x16')]>=0x0?this[_0xeec3('0x16')]:0x0;var _0x3eda06={'id':this['id'],'available':this[_0xeec3('0x16')],'loggedIn':this[_0xeec3('0x11')],'name':this[_0xeec3('0x17')],'paused':this[_0xeec3('0x12')],'waiting':this[_0xeec3('0xb')]};var _0x15dd4d=md5(JSON[_0xeec3('0x18')](_0x3eda06));if(this[_0xeec3('0x1')]!==_0x15dd4d){this['md5']=_0x15dd4d;io['to'](util[_0xeec3('0x19')](_0xeec3('0x1a'),_0x3eda06['name']))['emit'](_0xeec3('0x1b'),_0x3eda06);}};module[_0xeec3('0x1c')]=MailQueue;
\ No newline at end of file
index d188a97..6e55778 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x1261,0x144));var _0x1126=function(_0x5024c7,_0xd560bd){_0x5024c7=_0x5024c7-0x0;var _0xf2f316=_0x1261[_0x5024c7];return _0xf2f316;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0<this['Agents'][_0x1126('0x16')];_0x53a8f0+=0x1){if(this[_0x1126('0xc')][_0x53a8f0][_0x1126('0x17')]){this['loggedIn']+=0x1;}if(this[_0x1126('0xc')][_0x53a8f0]['openchannelPause']){this[_0x1126('0x15')]+=0x1;}}this[_0x1126('0x18')]=this[_0x1126('0x14')]-this['paused'];this[_0x1126('0x18')]=this[_0x1126('0x18')]>=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue;
\ No newline at end of file
+var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x546201,_0x49ee3e){var _0x57e598=function(_0x54403f){while(--_0x54403f){_0x546201['push'](_0x546201['shift']());}};_0x57e598(++_0x49ee3e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x219d87,_0x1cb6f7){_0x219d87=_0x219d87-0x0;var _0x22823d=_0x5fc3[_0x219d87];return _0x22823d;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2<this['Agents']['length'];_0x38d9f2+=0x1){if(this['Agents'][_0x38d9f2]['online']){this[_0x35fc('0x11')]+=0x1;}if(this[_0x35fc('0xa')][_0x38d9f2][_0x35fc('0x13')]){this[_0x35fc('0x12')]+=0x1;}}this[_0x35fc('0x14')]=this[_0x35fc('0x11')]-this['paused'];this[_0x35fc('0x14')]=this[_0x35fc('0x14')]>=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue;
\ No newline at end of file
index fb1b90e..fc1d61a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ddd=['beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','smsPause','available','sms:queue:%s','emit','exports','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy'];(function(_0x9d903a,_0x84611f){var _0x5153e2=function(_0xb4689d){while(--_0xb4689d){_0x9d903a['push'](_0x9d903a['shift']());}};_0x5153e2(++_0x84611f);}(_0x6ddd,0xae));var _0xd6dd=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x6ddd[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xd6dd('0x0'));var Redis=require(_0xd6dd('0x1'));var config=require(_0xd6dd('0x2'));config[_0xd6dd('0x3')]=_['defaults'](config[_0xd6dd('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xd6dd('0x4'))(new Redis(config['redis']));function SmsQueue(_0x43c57e){this['id']=_0x43c57e['id']||0x0;this[_0xd6dd('0x5')]=_0x43c57e[_0xd6dd('0x5')]||'';this['timeout']=_0x43c57e[_0xd6dd('0x6')]||0xa;this[_0xd6dd('0x7')]=_0x43c57e[_0xd6dd('0x7')]||_0xd6dd('0x8');this['Agents']=_0x43c57e[_0xd6dd('0x9')];this[_0xd6dd('0xa')]={};this[_0xd6dd('0xb')]=0x0;this[_0xd6dd('0xc')]='';this[_0xd6dd('0xd')]();this[_0xd6dd('0xe')]();}SmsQueue[_0xd6dd('0xf')][_0xd6dd('0xd')]=function(){var _0x1c52dc=this[_0xd6dd('0xa')][_0xd6dd('0x10')];this[_0xd6dd('0xa')]=_['map'](this[_0xd6dd('0x9')],'id');this[_0xd6dd('0xa')][_0xd6dd('0x10')]=_0x1c52dc;};SmsQueue[_0xd6dd('0xf')][_0xd6dd('0xe')]=function(){this[_0xd6dd('0x11')]=0x0;this[_0xd6dd('0x12')]=0x0;for(var _0x550953=0x0;_0x550953<this[_0xd6dd('0x9')][_0xd6dd('0x13')];_0x550953+=0x1){if(this[_0xd6dd('0x9')][_0x550953][_0xd6dd('0x14')]){this[_0xd6dd('0x11')]+=0x1;}if(this[_0xd6dd('0x9')][_0x550953][_0xd6dd('0x15')]){this[_0xd6dd('0x12')]+=0x1;}}this[_0xd6dd('0x16')]=this[_0xd6dd('0x11')]-this[_0xd6dd('0x12')];this[_0xd6dd('0x16')]=this['available']>=0x0?this[_0xd6dd('0x16')]:0x0;var _0x365abc={'id':this['id'],'available':this[_0xd6dd('0x16')],'loggedIn':this[_0xd6dd('0x11')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xd6dd('0xb')]};var _0x6945de=md5(JSON['stringify'](_0x365abc));if(this[_0xd6dd('0xc')]!==_0x6945de){this[_0xd6dd('0xc')]=_0x6945de;io['to'](util['format'](_0xd6dd('0x17'),_0x365abc[_0xd6dd('0x5')]))[_0xd6dd('0x18')]('sms_queue:save',_0x365abc);}};module[_0xd6dd('0x19')]=SmsQueue;
\ No newline at end of file
+var _0x5044=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','smsPause','available','format','sms:queue:%s','emit','exports','md5','ioredis','../../../config/environment'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x5044,0xc8));var _0x4504=function(_0x596716,_0x5a52db){_0x596716=_0x596716-0x0;var _0x202aec=_0x5044[_0x596716];return _0x202aec;};'use strict';var _=require('lodash');var md5=require(_0x4504('0x0'));var util=require('util');var Redis=require(_0x4504('0x1'));var config=require(_0x4504('0x2'));config[_0x4504('0x3')]=_[_0x4504('0x4')](config[_0x4504('0x3')],{'host':_0x4504('0x5'),'port':0x18eb});var io=require(_0x4504('0x6'))(new Redis(config[_0x4504('0x3')]));function SmsQueue(_0x4d5c5a){this['id']=_0x4d5c5a['id']||0x0;this[_0x4504('0x7')]=_0x4d5c5a[_0x4504('0x7')]||'';this[_0x4504('0x8')]=_0x4d5c5a[_0x4504('0x8')]||0xa;this[_0x4504('0x9')]=_0x4d5c5a[_0x4504('0x9')]||_0x4504('0xa');this[_0x4504('0xb')]=_0x4d5c5a[_0x4504('0xb')];this['mapAgentsId']={};this[_0x4504('0xc')]=0x0;this['md5']='';this[_0x4504('0xd')]();this[_0x4504('0xe')]();}SmsQueue[_0x4504('0xf')][_0x4504('0xd')]=function(){var _0x2498c3=this[_0x4504('0x10')][_0x4504('0x11')];this[_0x4504('0x10')]=_[_0x4504('0x12')](this[_0x4504('0xb')],'id');this[_0x4504('0x10')][_0x4504('0x11')]=_0x2498c3;};SmsQueue[_0x4504('0xf')]['updateRealtime']=function(){this[_0x4504('0x13')]=0x0;this[_0x4504('0x14')]=0x0;for(var _0x564bc5=0x0;_0x564bc5<this[_0x4504('0xb')][_0x4504('0x15')];_0x564bc5+=0x1){if(this[_0x4504('0xb')][_0x564bc5][_0x4504('0x16')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x564bc5][_0x4504('0x17')]){this['paused']+=0x1;}}this[_0x4504('0x18')]=this['loggedIn']-this[_0x4504('0x14')];this[_0x4504('0x18')]=this[_0x4504('0x18')]>=0x0?this['available']:0x0;var _0x35a355={'id':this['id'],'available':this[_0x4504('0x18')],'loggedIn':this[_0x4504('0x13')],'name':this[_0x4504('0x7')],'paused':this[_0x4504('0x14')],'waiting':this[_0x4504('0xc')]};var _0x5c9164=md5(JSON['stringify'](_0x35a355));if(this['md5']!==_0x5c9164){this[_0x4504('0x0')]=_0x5c9164;io['to'](util[_0x4504('0x19')](_0x4504('0x1a'),_0x35a355[_0x4504('0x7')]))[_0x4504('0x1b')]('sms_queue:save',_0x35a355);}};module[_0x4504('0x1c')]=SmsQueue;
\ No newline at end of file
index 4da5309..e18fef5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93a6=['strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','loggedIn','paused','length','online','whatsappPause','available','waiting','format','emit','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x93a6,0x10e));var _0x693a=function(_0x62c286,_0x8afc5f){_0x62c286=_0x62c286-0x0;var _0x446c09=_0x93a6[_0x62c286];return _0x446c09;};'use strict';var _=require(_0x693a('0x0'));var md5=require(_0x693a('0x1'));var util=require(_0x693a('0x2'));var Redis=require(_0x693a('0x3'));var config=require(_0x693a('0x4'));config['redis']=_[_0x693a('0x5')](config[_0x693a('0x6')],{'host':_0x693a('0x7'),'port':0x18eb});var io=require(_0x693a('0x8'))(new Redis(config['redis']));function WhatsappQueue(_0x3eb698){this['id']=_0x3eb698['id']||0x0;this[_0x693a('0x9')]=_0x3eb698[_0x693a('0x9')]||'';this['timeout']=_0x3eb698['timeout']||0xa;this[_0x693a('0xa')]=_0x3eb698[_0x693a('0xa')]||_0x693a('0xb');this[_0x693a('0xc')]=_0x3eb698['Agents'];this[_0x693a('0xd')]={};this['waiting']=0x0;this[_0x693a('0x1')]='';this[_0x693a('0xe')]();this['updateRealtime']();}WhatsappQueue[_0x693a('0xf')][_0x693a('0xe')]=function(){var _0x253d6e=this[_0x693a('0xd')][_0x693a('0x10')];this[_0x693a('0xd')]=_[_0x693a('0x11')](this[_0x693a('0xc')],'id');this[_0x693a('0xd')][_0x693a('0x10')]=_0x253d6e;};WhatsappQueue[_0x693a('0xf')]['updateRealtime']=function(){this[_0x693a('0x12')]=0x0;this[_0x693a('0x13')]=0x0;for(var _0x6c0d96=0x0;_0x6c0d96<this[_0x693a('0xc')][_0x693a('0x14')];_0x6c0d96+=0x1){if(this[_0x693a('0xc')][_0x6c0d96][_0x693a('0x15')]){this['loggedIn']+=0x1;}if(this[_0x693a('0xc')][_0x6c0d96][_0x693a('0x16')]){this[_0x693a('0x13')]+=0x1;}}this['available']=this[_0x693a('0x12')]-this['paused'];this[_0x693a('0x17')]=this[_0x693a('0x17')]>=0x0?this['available']:0x0;var _0x6e8ad9={'id':this['id'],'available':this[_0x693a('0x17')],'loggedIn':this[_0x693a('0x12')],'name':this[_0x693a('0x9')],'paused':this[_0x693a('0x13')],'waiting':this[_0x693a('0x18')]};var _0x43a84c=md5(JSON['stringify'](_0x6e8ad9));if(this[_0x693a('0x1')]!==_0x43a84c){this[_0x693a('0x1')]=_0x43a84c;io['to'](util[_0x693a('0x19')]('whatsapp:queue:%s',_0x6e8ad9[_0x693a('0x9')]))[_0x693a('0x1a')](_0x693a('0x1b'),_0x6e8ad9);}};module['exports']=WhatsappQueue;
\ No newline at end of file
+var _0xadb2=['paused','length','online','loggedIn','available','waiting','stringify','md5','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime'];(function(_0x4f29a6,_0x5c6512){var _0x17ae27=function(_0x5cdacb){while(--_0x5cdacb){_0x4f29a6['push'](_0x4f29a6['shift']());}};_0x17ae27(++_0x5c6512);}(_0xadb2,0xbb));var _0x2adb=function(_0x56844e,_0x2024af){_0x56844e=_0x56844e-0x0;var _0x4b7b0a=_0xadb2[_0x56844e];return _0x4b7b0a;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x2adb('0x0'));var Redis=require('ioredis');var config=require(_0x2adb('0x1'));config[_0x2adb('0x2')]=_['defaults'](config[_0x2adb('0x2')],{'host':_0x2adb('0x3'),'port':0x18eb});var io=require(_0x2adb('0x4'))(new Redis(config[_0x2adb('0x2')]));function WhatsappQueue(_0x3d25fa){this['id']=_0x3d25fa['id']||0x0;this[_0x2adb('0x5')]=_0x3d25fa[_0x2adb('0x5')]||'';this[_0x2adb('0x6')]=_0x3d25fa[_0x2adb('0x6')]||0xa;this[_0x2adb('0x7')]=_0x3d25fa[_0x2adb('0x7')]||_0x2adb('0x8');this[_0x2adb('0x9')]=_0x3d25fa[_0x2adb('0x9')];this[_0x2adb('0xa')]={};this['waiting']=0x0;this['md5']='';this[_0x2adb('0xb')]();this['updateRealtime']();}WhatsappQueue[_0x2adb('0xc')]['updateRouting']=function(){var _0x4592ce=this[_0x2adb('0xa')][_0x2adb('0xd')];this[_0x2adb('0xa')]=_[_0x2adb('0xe')](this[_0x2adb('0x9')],'id');this[_0x2adb('0xa')][_0x2adb('0xd')]=_0x4592ce;};WhatsappQueue[_0x2adb('0xc')][_0x2adb('0xf')]=function(){this['loggedIn']=0x0;this[_0x2adb('0x10')]=0x0;for(var _0x549166=0x0;_0x549166<this[_0x2adb('0x9')][_0x2adb('0x11')];_0x549166+=0x1){if(this[_0x2adb('0x9')][_0x549166][_0x2adb('0x12')]){this['loggedIn']+=0x1;}if(this[_0x2adb('0x9')][_0x549166]['whatsappPause']){this[_0x2adb('0x10')]+=0x1;}}this['available']=this[_0x2adb('0x13')]-this[_0x2adb('0x10')];this[_0x2adb('0x14')]=this['available']>=0x0?this[_0x2adb('0x14')]:0x0;var _0x51cfa1={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2adb('0x13')],'name':this[_0x2adb('0x5')],'paused':this[_0x2adb('0x10')],'waiting':this[_0x2adb('0x15')]};var _0x82ae58=md5(JSON[_0x2adb('0x16')](_0x51cfa1));if(this[_0x2adb('0x17')]!==_0x82ae58){this[_0x2adb('0x17')]=_0x82ae58;io['to'](util[_0x2adb('0x18')](_0x2adb('0x19'),_0x51cfa1[_0x2adb('0x5')]))[_0x2adb('0x1a')](_0x2adb('0x1b'),_0x51cfa1);}};module[_0x2adb('0x1c')]=WhatsappQueue;
\ No newline at end of file
index 2f1f068..7cd8965 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
+var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
index 86565ee..6ccb0fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf979=['UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0xf979,0xeb));var _0x9f97=function(_0x1e30c5,_0x2ea654){_0x1e30c5=_0x1e30c5-0x0;var _0x580e8c=_0xf979[_0x1e30c5];return _0x580e8c;};'use strict';var client=require(_0x9f97('0x0'));exports[_0x9f97('0x1')]=function(_0x485970,_0x4cef0a){return client[_0x9f97('0x2')](_0x9f97('0x3'),{'body':_0x4cef0a,'options':{'where':{'id':_0x485970}},'log':_0x9f97('0x4')});};exports['addTags']=function(_0x2f36d2,_0x3c41b7){return client[_0x9f97('0x2')](_0x9f97('0x5'),{'body':_0x3c41b7,'options':{'where':{'id':_0x2f36d2}},'log':_0x9f97('0x6')});};
\ No newline at end of file
+var _0x3724=['updateChatInteraction','addTags','Request','AddTagsToChatInteraction','../client','UpdateChatInteraction'];(function(_0x1a2b08,_0x45e2c7){var _0x57d0ce=function(_0x531628){while(--_0x531628){_0x1a2b08['push'](_0x1a2b08['shift']());}};_0x57d0ce(++_0x45e2c7);}(_0x3724,0xe8));var _0x4372=function(_0x3ff235,_0x428b4d){_0x3ff235=_0x3ff235-0x0;var _0x409302=_0x3724[_0x3ff235];return _0x409302;};'use strict';var client=require(_0x4372('0x0'));exports['update']=function(_0x12e36a,_0x2baf48){return client['Request'](_0x4372('0x1'),{'body':_0x2baf48,'options':{'where':{'id':_0x12e36a}},'log':_0x4372('0x2')});};exports[_0x4372('0x3')]=function(_0x3eda76,_0x328bae){return client[_0x4372('0x4')](_0x4372('0x5'),{'body':_0x328bae,'options':{'where':{'id':_0x3eda76}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index 29c17cd..31e7684 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b06=['createChatMessage','create','Request'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x4b06,0x118));var _0x64b0=function(_0x35be95,_0x3b7d3f){_0x35be95=_0x35be95-0x0;var _0xf88959=_0x4b06[_0x35be95];return _0xf88959;};'use strict';var client=require('../client');exports[_0x64b0('0x0')]=function(_0x35e3ef){return client[_0x64b0('0x1')]('CreateChatMessage',{'body':_0x35e3ef,'log':_0x64b0('0x2')});};
\ No newline at end of file
+var _0x238d=['create','createChatMessage','../client'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x238d,0xd7));var _0xd238=function(_0x3cf6d9,_0x5aa508){_0x3cf6d9=_0x3cf6d9-0x0;var _0x58980e=_0x238d[_0x3cf6d9];return _0x58980e;};'use strict';var client=require(_0xd238('0x0'));exports[_0xd238('0x1')]=function(_0x140fff){return client['Request']('CreateChatMessage',{'body':_0x140fff,'log':_0xd238('0x2')});};
\ No newline at end of file
index 40125e8..33ff1e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc090=['getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','Agents','online','chatPause','../client'];(function(_0x4234bd,_0x64b8a){var _0x2386aa=function(_0x48b853){while(--_0x48b853){_0x4234bd['push'](_0x4234bd['shift']());}};_0x2386aa(++_0x64b8a);}(_0xc090,0x112));var _0x0c09=function(_0x317502,_0x4272a3){_0x317502=_0x317502-0x0;var _0x2225f0=_0xc090[_0x317502];return _0x2225f0;};'use strict';var client=require(_0x0c09('0x0'));exports[_0x0c09('0x1')]=function(){return function(){return client[_0x0c09('0x2')](_0x0c09('0x3'),{'options':{'raw':![],'attributes':['id',_0x0c09('0x4'),_0x0c09('0x5'),_0x0c09('0x6')],'include':[{'model':_0x0c09('0x7'),'as':_0x0c09('0x8'),'attributes':['id','name',_0x0c09('0x9'),_0x0c09('0xa')]}]},'log':'getChatQueues'});};};
\ No newline at end of file
+var _0xbeea=['name','strategy','Agents','online','chatPause','getChatQueues','../client','Request','GetChatQueue'];(function(_0x65b85c,_0x933253){var _0x139fd8=function(_0x139c7c){while(--_0x139c7c){_0x65b85c['push'](_0x65b85c['shift']());}};_0x139fd8(++_0x933253);}(_0xbeea,0xb1));var _0xabee=function(_0x240ffa,_0x22a602){_0x240ffa=_0x240ffa-0x0;var _0x26f192=_0xbeea[_0x240ffa];return _0x26f192;};'use strict';var client=require(_0xabee('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xabee('0x1')](_0xabee('0x2'),{'options':{'raw':![],'attributes':['id',_0xabee('0x3'),'timeout',_0xabee('0x4')],'include':[{'model':'User','as':_0xabee('0x5'),'attributes':['id',_0xabee('0x3'),_0xabee('0x6'),_0xabee('0x7')]}]},'log':_0xabee('0x8')});};};
\ No newline at end of file
index ec68c95..4a9a794 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f3e=['UpdateChatQueueReport','DESC','../client','create','Request','CreateChatQueueReport'];(function(_0x3f8edd,_0x4bb532){var _0x3063f6=function(_0x1bf865){while(--_0x1bf865){_0x3f8edd['push'](_0x3f8edd['shift']());}};_0x3063f6(++_0x4bb532);}(_0x9f3e,0x1c4));var _0xe9f3=function(_0x5dc0ed,_0x5c98b4){_0x5dc0ed=_0x5dc0ed-0x0;var _0x54eeab=_0x9f3e[_0x5dc0ed];return _0x54eeab;};'use strict';var client=require(_0xe9f3('0x0'));exports[_0xe9f3('0x1')]=function(_0x28c509){return client[_0xe9f3('0x2')](_0xe9f3('0x3'),{'body':_0x28c509,'log':'CreateChatQueueReport'});};exports['update']=function(_0x4c3a39,_0x1ea33c){return client['Request'](_0xe9f3('0x4'),{'body':_0x1ea33c,'options':{'where':{'uniqueid':_0x4c3a39},'order':[['id',_0xe9f3('0x5')]],'limit':0x1},'log':_0xe9f3('0x4')});};
\ No newline at end of file
+var _0x295f=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x295f,0x168));var _0xf295=function(_0x4436c9,_0x2010c4){_0x4436c9=_0x4436c9-0x0;var _0x5e92a1=_0x295f[_0x4436c9];return _0x5e92a1;};'use strict';var client=require('../client');exports[_0xf295('0x0')]=function(_0x2a126a){return client[_0xf295('0x1')]('CreateChatQueueReport',{'body':_0x2a126a,'log':_0xf295('0x2')});};exports[_0xf295('0x3')]=function(_0x59a1c5,_0x511ab5){return client[_0xf295('0x1')](_0xf295('0x4'),{'body':_0x511ab5,'options':{'where':{'uniqueid':_0x59a1c5},'order':[['id',_0xf295('0x5')]],'limit':0x1},'log':_0xf295('0x4')});};
\ No newline at end of file
index 54f6233..f3c07cc 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(_0x5a2b2d,_0x3e29eb){var _0x104a4f=function(_0x429b87){while(--_0x429b87){_0x5a2b2d['push'](_0x5a2b2d['shift']());}};_0x104a4f(++_0x3e29eb);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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(_0x47d3bf,_0x34af4c){var _0x428df1=function(_0x32b81f){while(--_0x32b81f){_0x47d3bf['push'](_0x47d3bf['shift']());}};_0x428df1(++_0x34af4c);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 8ea2e5e..4cdb388 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb13=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x4c496d,_0x16ce2b){var _0x2190c9=function(_0x30556e){while(--_0x30556e){_0x4c496d['push'](_0x4c496d['shift']());}};_0x2190c9(++_0x16ce2b);}(_0xcb13,0xa6));var _0x3cb1=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xcb13[_0x27af45];return _0x18df21;};'use strict';var client=require(_0x3cb1('0x0'));exports[_0x3cb1('0x1')]=function(_0x7e8620){return client[_0x3cb1('0x2')](_0x3cb1('0x3'),{'body':_0x7e8620,'log':_0x3cb1('0x4')});};
\ No newline at end of file
+var _0xb22a=['../client','Request','createFaxMessage'];(function(_0x25f5bc,_0x3852ce){var _0x1ca166=function(_0x1d3ab5){while(--_0x1d3ab5){_0x25f5bc['push'](_0x25f5bc['shift']());}};_0x1ca166(++_0x3852ce);}(_0xb22a,0xa8));var _0xab22=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xb22a[_0xaa1b3e];return _0x454d7d;};'use strict';var client=require(_0xab22('0x0'));exports['create']=function(_0x1c9e8b){return client[_0xab22('0x1')]('CreateFaxMessage',{'body':_0x1c9e8b,'log':_0xab22('0x2')});};
\ No newline at end of file
index 3566150..19f4283 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6252=['online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','name'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x6252,0x7a));var _0x2625=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x6252[_0x172747];return _0x509692;};'use strict';var client=require(_0x2625('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x2625('0x1')](_0x2625('0x2'),{'options':{'raw':![],'attributes':['id',_0x2625('0x3'),'timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x2625('0x4'),_0x2625('0x5')]}]},'log':_0x2625('0x6')});};};
\ No newline at end of file
+var _0xbaf4=['online','getFaxQueues','Request','GetFaxQueue','name','strategy','User','Agents'];(function(_0x10d0a6,_0x32bbd8){var _0x45b7c9=function(_0x3b3397){while(--_0x3b3397){_0x10d0a6['push'](_0x10d0a6['shift']());}};_0x45b7c9(++_0x32bbd8);}(_0xbaf4,0x81));var _0x4baf=function(_0x25a3dc,_0x3b4327){_0x25a3dc=_0x25a3dc-0x0;var _0x206e0e=_0xbaf4[_0x25a3dc];return _0x206e0e;};'use strict';var client=require('../client');exports[_0x4baf('0x0')]=function(){return function(){return client[_0x4baf('0x1')](_0x4baf('0x2'),{'options':{'raw':![],'attributes':['id',_0x4baf('0x3'),'timeout',_0x4baf('0x4')],'include':[{'model':_0x4baf('0x5'),'as':_0x4baf('0x6'),'attributes':['id',_0x4baf('0x3'),_0x4baf('0x7'),'faxPause']}]},'log':_0x4baf('0x0')});};};
\ No newline at end of file
index 8d147dd..be4371a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4cc=['create','Request','CreateFaxQueueReport','update','DESC'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa4cc,0xc8));var _0xca4c=function(_0x7ce0de,_0x53c4da){_0x7ce0de=_0x7ce0de-0x0;var _0x34c074=_0xa4cc[_0x7ce0de];return _0x34c074;};'use strict';var client=require('../client');exports[_0xca4c('0x0')]=function(_0x48a94d){return client[_0xca4c('0x1')]('CreateFaxQueueReport',{'body':_0x48a94d,'log':_0xca4c('0x2')});};exports[_0xca4c('0x3')]=function(_0x2cfdf8,_0x292f13){return client[_0xca4c('0x1')]('UpdateFaxQueueReport',{'body':_0x292f13,'options':{'where':{'uniqueid':_0x2cfdf8},'order':[['id',_0xca4c('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
+var _0x9686=['Request','UpdateFaxQueueReport','../client','create','CreateFaxQueueReport','update'];(function(_0x7d4bf7,_0x94c995){var _0x4c1214=function(_0x171afd){while(--_0x171afd){_0x7d4bf7['push'](_0x7d4bf7['shift']());}};_0x4c1214(++_0x94c995);}(_0x9686,0xbc));var _0x6968=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9686[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x6968('0x0'));exports[_0x6968('0x1')]=function(_0x30f601){return client['Request'](_0x6968('0x2'),{'body':_0x30f601,'log':_0x6968('0x2')});};exports[_0x6968('0x3')]=function(_0x557f81,_0x59a723){return client[_0x6968('0x4')](_0x6968('0x5'),{'body':_0x59a723,'options':{'where':{'uniqueid':_0x557f81},'order':[['id','DESC']],'limit':0x1},'log':_0x6968('0x5')});};
\ No newline at end of file
index fcf4bd5..3c44d93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x096c=['Interval','Intervals','../client','getIntervals','Request','GetInterval','name'];(function(_0x264b61,_0x4a5017){var _0x8fff4f=function(_0x25c21e){while(--_0x25c21e){_0x264b61['push'](_0x264b61['shift']());}};_0x8fff4f(++_0x4a5017);}(_0x096c,0x1b4));var _0xc096=function(_0xf81e7c,_0x232e70){_0xf81e7c=_0xf81e7c-0x0;var _0x5547ed=_0x096c[_0xf81e7c];return _0x5547ed;};'use strict';var client=require(_0xc096('0x0'));exports[_0xc096('0x1')]=function(){return function(){return client[_0xc096('0x2')](_0xc096('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xc096('0x4')],'include':[{'model':_0xc096('0x5'),'as':_0xc096('0x6'),'attributes':['id','name','interval']}]},'log':_0xc096('0x1')});};};
\ No newline at end of file
+var _0xbd95=['Interval','Intervals','name','../client','getIntervals','Request'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0xbd95,0x1d7));var _0x5bd9=function(_0x4e5db9,_0x385b3f){_0x4e5db9=_0x4e5db9-0x0;var _0x484987=_0xbd95[_0x4e5db9];return _0x484987;};'use strict';var client=require(_0x5bd9('0x0'));exports[_0x5bd9('0x1')]=function(){return function(){return client[_0x5bd9('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x5bd9('0x3'),'as':_0x5bd9('0x4'),'attributes':['id',_0x5bd9('0x5'),'interval']}]},'log':_0x5bd9('0x1')});};};
\ No newline at end of file
index 0a8c885..228e5ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x3264ec,_0x44154c){var _0x300cd2=function(_0x286b83){while(--_0x286b83){_0x3264ec['push'](_0x3264ec['shift']());}};_0x300cd2(++_0x44154c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x44330c,_0x22f9b5){_0x44330c=_0x44330c-0x0;var _0x5b3cd9=_0x5f2f[_0x44330c];return _0x5b3cd9;};'use strict';var client=require(_0xf5f2('0x0'));exports[_0xf5f2('0x1')]=function(_0x2dcf60,_0x1a7be1){return client[_0xf5f2('0x2')](_0xf5f2('0x3'),{'body':_0x1a7be1,'options':{'where':{'id':_0x2dcf60}},'log':_0xf5f2('0x4')});};exports[_0xf5f2('0x5')]=function(_0x501fbd,_0x4854b6){return client[_0xf5f2('0x2')](_0xf5f2('0x6'),{'body':_0x4854b6,'options':{'where':{'id':_0x501fbd}},'log':_0xf5f2('0x7')});};
\ No newline at end of file
+var _0x6a55=['Request','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x279852,_0xd6073c){var _0xd5f9e6=function(_0x2e71fd){while(--_0x2e71fd){_0x279852['push'](_0x279852['shift']());}};_0xd5f9e6(++_0xd6073c);}(_0x6a55,0xdb));var _0x56a5=function(_0x5e6d65,_0x5db89c){_0x5e6d65=_0x5e6d65-0x0;var _0x5e1f75=_0x6a55[_0x5e6d65];return _0x5e1f75;};'use strict';var client=require(_0x56a5('0x0'));exports['update']=function(_0x5d894b,_0x4ec858){return client[_0x56a5('0x1')]('UpdateMailInteraction',{'body':_0x4ec858,'options':{'where':{'id':_0x5d894b}},'log':'updateMailInteraction'});};exports[_0x56a5('0x2')]=function(_0x5e5a32,_0x3ff76a){return client['Request'](_0x56a5('0x3'),{'body':_0x3ff76a,'options':{'where':{'id':_0x5e5a32}},'log':_0x56a5('0x4')});};
\ No newline at end of file
index 7647428..b90a742 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4edf=['create','Request','createMailMessage'];(function(_0xee46a1,_0x217c6a){var _0xb32f68=function(_0x1fe952){while(--_0x1fe952){_0xee46a1['push'](_0xee46a1['shift']());}};_0xb32f68(++_0x217c6a);}(_0x4edf,0x189));var _0xf4ed=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0x4edf[_0x210718];return _0x541bfc;};'use strict';var client=require('../client');exports[_0xf4ed('0x0')]=function(_0xc3aba4){return client[_0xf4ed('0x1')]('CreateMailMessage',{'body':_0xc3aba4,'log':_0xf4ed('0x2')});};
\ No newline at end of file
+var _0x4a6b=['Request','CreateMailMessage','createMailMessage','../client'];(function(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0x4a6b,0xfb));var _0xb4a6=function(_0x168f14,_0x56cc0c){_0x168f14=_0x168f14-0x0;var _0x552f20=_0x4a6b[_0x168f14];return _0x552f20;};'use strict';var client=require(_0xb4a6('0x0'));exports['create']=function(_0x30a11b){return client[_0xb4a6('0x1')](_0xb4a6('0x2'),{'body':_0x30a11b,'log':_0xb4a6('0x3')});};
\ No newline at end of file
index c87a0c1..9a623a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47c7=['timeout','strategy','User','Agents','name','online','mailPause','getMailQueues','../client','Request','GetMailQueue'];(function(_0x1ddc76,_0x2111fa){var _0x318ccc=function(_0x11f7fc){while(--_0x11f7fc){_0x1ddc76['push'](_0x1ddc76['shift']());}};_0x318ccc(++_0x2111fa);}(_0x47c7,0x131));var _0x747c=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x47c7[_0x4e7d25];return _0x526fe6;};'use strict';var client=require(_0x747c('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x747c('0x1')](_0x747c('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x747c('0x3'),_0x747c('0x4')],'include':[{'model':_0x747c('0x5'),'as':_0x747c('0x6'),'attributes':['id',_0x747c('0x7'),_0x747c('0x8'),_0x747c('0x9')]}]},'log':_0x747c('0xa')});};};
\ No newline at end of file
+var _0x4fcf=['name','strategy','User','online','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x5111e8,_0x454afc){var _0x5ea361=function(_0x2b526b){while(--_0x2b526b){_0x5111e8['push'](_0x5111e8['shift']());}};_0x5ea361(++_0x454afc);}(_0x4fcf,0x83));var _0xf4fc=function(_0x4b1475,_0x41bf4c){_0x4b1475=_0x4b1475-0x0;var _0x3153e6=_0x4fcf[_0x4b1475];return _0x3153e6;};'use strict';var client=require(_0xf4fc('0x0'));exports[_0xf4fc('0x1')]=function(){return function(){return client[_0xf4fc('0x2')](_0xf4fc('0x3'),{'options':{'raw':![],'attributes':['id',_0xf4fc('0x4'),'timeout',_0xf4fc('0x5')],'include':[{'model':_0xf4fc('0x6'),'as':'Agents','attributes':['id',_0xf4fc('0x4'),_0xf4fc('0x7'),_0xf4fc('0x8')]}]},'log':'getMailQueues'});};};
\ No newline at end of file
index cd2b119..b751a0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5266=['UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport','update'];(function(_0x1ecd44,_0xa8284){var _0x8432ac=function(_0x279b18){while(--_0x279b18){_0x1ecd44['push'](_0x1ecd44['shift']());}};_0x8432ac(++_0xa8284);}(_0x5266,0xd9));var _0x6526=function(_0x305bbf,_0x5647b3){_0x305bbf=_0x305bbf-0x0;var _0x4ed772=_0x5266[_0x305bbf];return _0x4ed772;};'use strict';var client=require(_0x6526('0x0'));exports[_0x6526('0x1')]=function(_0xb0b7ee){return client[_0x6526('0x2')]('CreateMailQueueReport',{'body':_0xb0b7ee,'log':_0x6526('0x3')});};exports[_0x6526('0x4')]=function(_0x20345d,_0x18c32a){return client['Request'](_0x6526('0x5'),{'body':_0x18c32a,'options':{'where':{'uniqueid':_0x20345d},'order':[['id','DESC']],'limit':0x1},'log':_0x6526('0x5')});};
\ No newline at end of file
+var _0x4e8e=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x21cf80,_0x1fb0a1){var _0x5c6bed=function(_0x3492c3){while(--_0x3492c3){_0x21cf80['push'](_0x21cf80['shift']());}};_0x5c6bed(++_0x1fb0a1);}(_0x4e8e,0xca));var _0xe4e8=function(_0x565a37,_0xe27d96){_0x565a37=_0x565a37-0x0;var _0x20df51=_0x4e8e[_0x565a37];return _0x20df51;};'use strict';var client=require(_0xe4e8('0x0'));exports[_0xe4e8('0x1')]=function(_0x3f3f68){return client[_0xe4e8('0x2')](_0xe4e8('0x3'),{'body':_0x3f3f68,'log':'CreateMailQueueReport'});};exports[_0xe4e8('0x4')]=function(_0x28fdbb,_0x11bcc7){return client[_0xe4e8('0x2')](_0xe4e8('0x5'),{'body':_0x11bcc7,'options':{'where':{'uniqueid':_0x28fdbb},'order':[['id',_0xe4e8('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
index f8cc881..eccef33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6a4=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe6a4,0xa0));var _0x4e6a=function(_0x1e1042,_0x319546){_0x1e1042=_0x1e1042-0x0;var _0x5606bf=_0xe6a4[_0x1e1042];return _0x5606bf;};'use strict';var client=require('../client');exports[_0x4e6a('0x0')]=function(_0x6d97f7,_0x441408){return client[_0x4e6a('0x1')](_0x4e6a('0x2'),{'body':_0x441408,'options':{'where':{'id':_0x6d97f7}},'log':_0x4e6a('0x3')});};exports[_0x4e6a('0x4')]=function(_0xb93002,_0x5efc05){return client[_0x4e6a('0x1')](_0x4e6a('0x5'),{'body':_0x5efc05,'options':{'where':{'id':_0xb93002}},'log':_0x4e6a('0x6')});};
\ No newline at end of file
+var _0xfab9=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction'];(function(_0x2fa7d7,_0x7e8b89){var _0x57692a=function(_0x282eda){while(--_0x282eda){_0x2fa7d7['push'](_0x2fa7d7['shift']());}};_0x57692a(++_0x7e8b89);}(_0xfab9,0x1e2));var _0x9fab=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfab9[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x9fab('0x0'));exports[_0x9fab('0x1')]=function(_0x5e2bc5,_0x55986d){return client[_0x9fab('0x2')]('UpdateOpenchannelInteraction',{'body':_0x55986d,'options':{'where':{'id':_0x5e2bc5}},'log':_0x9fab('0x3')});};exports['addTags']=function(_0x2caf13,_0x4ce024){return client[_0x9fab('0x2')](_0x9fab('0x4'),{'body':_0x4ce024,'options':{'where':{'id':_0x2caf13}},'log':_0x9fab('0x5')});};
\ No newline at end of file
index 7730d8b..0e82c74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe599=['Request','CreateOpenchannelMessage','../client','create'];(function(_0x2b7c03,_0x166134){var _0x2bc83f=function(_0x408580){while(--_0x408580){_0x2b7c03['push'](_0x2b7c03['shift']());}};_0x2bc83f(++_0x166134);}(_0xe599,0x12e));var _0x9e59=function(_0x1687f2,_0x5502b3){_0x1687f2=_0x1687f2-0x0;var _0x375c3a=_0xe599[_0x1687f2];return _0x375c3a;};'use strict';var client=require(_0x9e59('0x0'));exports[_0x9e59('0x1')]=function(_0x3f2b40){return client[_0x9e59('0x2')](_0x9e59('0x3'),{'body':_0x3f2b40,'log':'createOpenchannelMessage'});};
\ No newline at end of file
+var _0x8a75=['../client','create','Request','createOpenchannelMessage'];(function(_0x127885,_0xd399dc){var _0xd42e45=function(_0x44521f){while(--_0x44521f){_0x127885['push'](_0x127885['shift']());}};_0xd42e45(++_0xd399dc);}(_0x8a75,0x1ec));var _0x58a7=function(_0x2d2295,_0x1342b7){_0x2d2295=_0x2d2295-0x0;var _0x2624d1=_0x8a75[_0x2d2295];return _0x2624d1;};'use strict';var client=require(_0x58a7('0x0'));exports[_0x58a7('0x1')]=function(_0x3dca22){return client[_0x58a7('0x2')]('CreateOpenchannelMessage',{'body':_0x3dca22,'log':_0x58a7('0x3')});};
\ No newline at end of file
index 462727b..5c2bfe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec1d=['User','Agents','name','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','strategy'];(function(_0x5b0387,_0xabd94b){var _0x51e767=function(_0x3717e3){while(--_0x3717e3){_0x5b0387['push'](_0x5b0387['shift']());}};_0x51e767(++_0xabd94b);}(_0xec1d,0x7c));var _0xdec1=function(_0x34fda0,_0x3f8f09){_0x34fda0=_0x34fda0-0x0;var _0x333cda=_0xec1d[_0x34fda0];return _0x333cda;};'use strict';var client=require(_0xdec1('0x0'));exports[_0xdec1('0x1')]=function(){return function(){return client[_0xdec1('0x2')](_0xdec1('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xdec1('0x4'),_0xdec1('0x5')],'include':[{'model':_0xdec1('0x6'),'as':_0xdec1('0x7'),'attributes':['id',_0xdec1('0x8'),'online',_0xdec1('0x9')]}]},'log':_0xdec1('0x1')});};};
\ No newline at end of file
+var _0xe165=['../client','getOpenchannelQueues','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online','openchannelPause'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xe165,0x190));var _0x5e16=function(_0x6c7fc1,_0x39c9f1){_0x6c7fc1=_0x6c7fc1-0x0;var _0x4da5c2=_0xe165[_0x6c7fc1];return _0x4da5c2;};'use strict';var client=require(_0x5e16('0x0'));exports[_0x5e16('0x1')]=function(){return function(){return client['Request'](_0x5e16('0x2'),{'options':{'raw':![],'attributes':['id',_0x5e16('0x3'),_0x5e16('0x4'),_0x5e16('0x5')],'include':[{'model':_0x5e16('0x6'),'as':_0x5e16('0x7'),'attributes':['id',_0x5e16('0x3'),_0x5e16('0x8'),_0x5e16('0x9')]}]},'log':_0x5e16('0x1')});};};
\ No newline at end of file
index dc368c1..74dd251 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4170=['DESC','../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x435d04,_0x13410b){var _0x23a5bb=function(_0x259d4a){while(--_0x259d4a){_0x435d04['push'](_0x435d04['shift']());}};_0x23a5bb(++_0x13410b);}(_0x4170,0x166));var _0x0417=function(_0x489730,_0x5226b9){_0x489730=_0x489730-0x0;var _0x7855d1=_0x4170[_0x489730];return _0x7855d1;};'use strict';var client=require(_0x0417('0x0'));exports[_0x0417('0x1')]=function(_0x470666){return client[_0x0417('0x2')]('CreateOpenchannelQueueReport',{'body':_0x470666,'log':_0x0417('0x3')});};exports[_0x0417('0x4')]=function(_0x174055,_0x56aff7){return client['Request'](_0x0417('0x5'),{'body':_0x56aff7,'options':{'where':{'uniqueid':_0x174055},'order':[['id',_0x0417('0x6')]],'limit':0x1},'log':_0x0417('0x5')});};
\ No newline at end of file
+var _0xcde4=['UpdateOpenchannelQueueReport','DESC','../client','create','Request','update'];(function(_0x16c01f,_0x107de4){var _0x452051=function(_0xcaee63){while(--_0xcaee63){_0x16c01f['push'](_0x16c01f['shift']());}};_0x452051(++_0x107de4);}(_0xcde4,0x13a));var _0x4cde=function(_0x5c72ee,_0x5a8bf8){_0x5c72ee=_0x5c72ee-0x0;var _0x231876=_0xcde4[_0x5c72ee];return _0x231876;};'use strict';var client=require(_0x4cde('0x0'));exports[_0x4cde('0x1')]=function(_0x4e9cc5){return client[_0x4cde('0x2')]('CreateOpenchannelQueueReport',{'body':_0x4e9cc5,'log':'CreateOpenchannelQueueReport'});};exports[_0x4cde('0x3')]=function(_0x27b033,_0x5a2928){return client['Request'](_0x4cde('0x4'),{'body':_0x5a2928,'options':{'where':{'uniqueid':_0x27b033},'order':[['id',_0x4cde('0x5')]],'limit':0x1},'log':_0x4cde('0x4')});};
\ No newline at end of file
index 566ca16..75d36f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefbf=['Request','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x4db1bd,_0x832a4b){var _0x50eacf=function(_0xd457b9){while(--_0xd457b9){_0x4db1bd['push'](_0x4db1bd['shift']());}};_0x50eacf(++_0x832a4b);}(_0xefbf,0xa3));var _0xfefb=function(_0x10afad,_0x17244e){_0x10afad=_0x10afad-0x0;var _0x3aa3ef=_0xefbf[_0x10afad];return _0x3aa3ef;};'use strict';var client=require(_0xfefb('0x0'));exports[_0xfefb('0x1')]=function(_0x491b8b,_0x537bf7){return client['Request'](_0xfefb('0x2'),{'body':_0x537bf7,'options':{'where':{'id':_0x491b8b}},'log':_0xfefb('0x3')});};exports[_0xfefb('0x4')]=function(_0x36eb23,_0x79ca1d){return client[_0xfefb('0x5')]('AddTagsToSmsInteraction',{'body':_0x79ca1d,'options':{'where':{'id':_0x36eb23}},'log':_0xfefb('0x6')});};
\ No newline at end of file
+var _0xf14b=['UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request'];(function(_0x1da42f,_0x23dc53){var _0x458c83=function(_0x16eb14){while(--_0x16eb14){_0x1da42f['push'](_0x1da42f['shift']());}};_0x458c83(++_0x23dc53);}(_0xf14b,0xdd));var _0xbf14=function(_0x2c9f5b,_0x4b03e1){_0x2c9f5b=_0x2c9f5b-0x0;var _0xeb79f1=_0xf14b[_0x2c9f5b];return _0xeb79f1;};'use strict';var client=require(_0xbf14('0x0'));exports[_0xbf14('0x1')]=function(_0x331ed9,_0x1d0b20){return client[_0xbf14('0x2')](_0xbf14('0x3'),{'body':_0x1d0b20,'options':{'where':{'id':_0x331ed9}},'log':_0xbf14('0x4')});};exports[_0xbf14('0x5')]=function(_0x1c9f49,_0x3afb15){return client['Request'](_0xbf14('0x6'),{'body':_0x3afb15,'options':{'where':{'id':_0x1c9f49}},'log':_0xbf14('0x7')});};
\ No newline at end of file
index dcddb93..a517e1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x497b=['Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x287c3d,_0xdedb20){var _0x126315=function(_0x2325b0){while(--_0x2325b0){_0x287c3d['push'](_0x287c3d['shift']());}};_0x126315(++_0xdedb20);}(_0x497b,0x18b));var _0xb497=function(_0x2bd377,_0x4873b8){_0x2bd377=_0x2bd377-0x0;var _0x16448f=_0x497b[_0x2bd377];return _0x16448f;};'use strict';var client=require(_0xb497('0x0'));exports['create']=function(_0x328a4f){return client[_0xb497('0x1')](_0xb497('0x2'),{'body':_0x328a4f,'log':_0xb497('0x3')});};
\ No newline at end of file
+var _0x3d8a=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d8a,0x7f));var _0xa3d8=function(_0x57bc47,_0x2d5e09){_0x57bc47=_0x57bc47-0x0;var _0x29d9e1=_0x3d8a[_0x57bc47];return _0x29d9e1;};'use strict';var client=require(_0xa3d8('0x0'));exports[_0xa3d8('0x1')]=function(_0x2718d0){return client[_0xa3d8('0x2')](_0xa3d8('0x3'),{'body':_0x2718d0,'log':_0xa3d8('0x4')});};
\ No newline at end of file
index c408041..be0a075 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x4a2508,_0x512289){var _0x40cda4=function(_0x7c39d7){while(--_0x7c39d7){_0x4a2508['push'](_0x4a2508['shift']());}};_0x40cda4(++_0x512289);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xb7e7[_0x3305de];return _0x3b5a84;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x57b17d,_0x427ec1){var _0x1a3af5=function(_0x58edea){while(--_0x58edea){_0x57b17d['push'](_0x57b17d['shift']());}};_0x1a3af5(++_0x427ec1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};};
\ No newline at end of file
index 8219363..2da3482 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x579055,_0x3ff8e7){var _0x4e1980=function(_0x45150e){while(--_0x45150e){_0x579055['push'](_0x579055['shift']());}};_0x4e1980(++_0x3ff8e7);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});};
\ No newline at end of file
+var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0xfde9fc,_0x409171){var _0x5f065d=function(_0x1a1fa0){while(--_0x1a1fa0){_0xfde9fc['push'](_0xfde9fc['shift']());}};_0x5f065d(++_0x409171);}(_0x34e8,0x12c));var _0x834e=function(_0x142103,_0x5473ad){_0x142103=_0x142103-0x0;var _0x185e03=_0x34e8[_0x142103];return _0x185e03;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});};
\ No newline at end of file
index fb0612e..116c24f 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(_0x270e18,_0x512fc3){var _0xf0137a=function(_0x37e002){while(--_0x37e002){_0x270e18['push'](_0x270e18['shift']());}};_0xf0137a(++_0x512fc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x2dd85f,_0x4e9c01){var _0x31ca7f=function(_0x498a36){while(--_0x498a36){_0x2dd85f['push'](_0x2dd85f['shift']());}};_0x31ca7f(++_0x4e9c01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 423a5ac..ecb951b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41fe=['addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x10daa1,_0x499fdc){var _0x5f1fa5=function(_0x107e29){while(--_0x107e29){_0x10daa1['push'](_0x10daa1['shift']());}};_0x5f1fa5(++_0x499fdc);}(_0x41fe,0xd1));var _0xe41f=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x41fe[_0x2f1762];return _0x8ab21;};'use strict';var client=require(_0xe41f('0x0'));exports[_0xe41f('0x1')]=function(_0x38cf9f,_0x2c527f){return client[_0xe41f('0x2')](_0xe41f('0x3'),{'body':_0x2c527f,'options':{'where':{'id':_0x38cf9f}},'log':_0xe41f('0x4')});};exports[_0xe41f('0x5')]=function(_0x2e580b,_0x1c9625){return client[_0xe41f('0x2')](_0xe41f('0x6'),{'body':_0x1c9625,'options':{'where':{'id':_0x2e580b}},'log':_0xe41f('0x7')});};
\ No newline at end of file
+var _0x565f=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags'];(function(_0x2fb24e,_0x36c15b){var _0x22bd5b=function(_0x5c5fca){while(--_0x5c5fca){_0x2fb24e['push'](_0x2fb24e['shift']());}};_0x22bd5b(++_0x36c15b);}(_0x565f,0x68));var _0xf565=function(_0x35c8b5,_0x3da1c0){_0x35c8b5=_0x35c8b5-0x0;var _0x50f73b=_0x565f[_0x35c8b5];return _0x50f73b;};'use strict';var client=require('../client');exports[_0xf565('0x0')]=function(_0x645987,_0x1d8f31){return client['Request'](_0xf565('0x1'),{'body':_0x1d8f31,'options':{'where':{'id':_0x645987}},'log':_0xf565('0x2')});};exports[_0xf565('0x3')]=function(_0x44400f,_0x35e885){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x35e885,'options':{'where':{'id':_0x44400f}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
index 34625d9..6aa227b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f60=['CreateWhatsappMessage','createWhatsappMessage','Request'];(function(_0x14d382,_0x54b6bd){var _0x31c6a7=function(_0xc9bb74){while(--_0xc9bb74){_0x14d382['push'](_0x14d382['shift']());}};_0x31c6a7(++_0x54b6bd);}(_0x8f60,0xaa));var _0x08f6=function(_0x6c0123,_0x4c8d3b){_0x6c0123=_0x6c0123-0x0;var _0x5a87d2=_0x8f60[_0x6c0123];return _0x5a87d2;};'use strict';var client=require('../client');exports['create']=function(_0x185335){return client[_0x08f6('0x0')](_0x08f6('0x1'),{'body':_0x185335,'log':_0x08f6('0x2')});};
\ No newline at end of file
+var _0xb211=['CreateWhatsappMessage','../client','Request'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0xb211,0x16c));var _0x1b21=function(_0x49064a,_0x3fdc5c){_0x49064a=_0x49064a-0x0;var _0x582a0e=_0xb211[_0x49064a];return _0x582a0e;};'use strict';var client=require(_0x1b21('0x0'));exports['create']=function(_0x254452){return client[_0x1b21('0x1')](_0x1b21('0x2'),{'body':_0x254452,'log':'createWhatsappMessage'});};
\ No newline at end of file
index 540611d..63c1792 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32a6=['name','timeout','strategy','User','Agents','online','../client','getWhatsappQueues','GetWhatsappQueue'];(function(_0x4907e9,_0x522042){var _0x59e793=function(_0x1de9b7){while(--_0x1de9b7){_0x4907e9['push'](_0x4907e9['shift']());}};_0x59e793(++_0x522042);}(_0x32a6,0xf9));var _0x632a=function(_0x3855a4,_0x195847){_0x3855a4=_0x3855a4-0x0;var _0x320e84=_0x32a6[_0x3855a4];return _0x320e84;};'use strict';var client=require(_0x632a('0x0'));exports[_0x632a('0x1')]=function(){return function(){return client['Request'](_0x632a('0x2'),{'options':{'raw':![],'attributes':['id',_0x632a('0x3'),_0x632a('0x4'),_0x632a('0x5')],'include':[{'model':_0x632a('0x6'),'as':_0x632a('0x7'),'attributes':['id',_0x632a('0x3'),_0x632a('0x8'),'whatsappPause']}]},'log':'getWhatsappQueues'});};};
\ No newline at end of file
+var _0x51e1=['name','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','timeout','strategy','User'];(function(_0x10bf48,_0x5957a3){var _0x49edb4=function(_0x18debc){while(--_0x18debc){_0x10bf48['push'](_0x10bf48['shift']());}};_0x49edb4(++_0x5957a3);}(_0x51e1,0x12c));var _0x151e=function(_0x5e2751,_0x518a55){_0x5e2751=_0x5e2751-0x0;var _0x139a39=_0x51e1[_0x5e2751];return _0x139a39;};'use strict';var client=require(_0x151e('0x0'));exports[_0x151e('0x1')]=function(){return function(){return client['Request'](_0x151e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x151e('0x3'),_0x151e('0x4')],'include':[{'model':_0x151e('0x5'),'as':'Agents','attributes':['id',_0x151e('0x6'),_0x151e('0x7'),_0x151e('0x8')]}]},'log':_0x151e('0x1')});};};
\ No newline at end of file
index 1e779a7..940aa68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ba7=['UpdateWhatsappQueueReport','../client','create','CreateWhatsappQueueReport','update','Request'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x4ba7,0x139));var _0x74ba=function(_0x22a177,_0x5dccc4){_0x22a177=_0x22a177-0x0;var _0x58d22e=_0x4ba7[_0x22a177];return _0x58d22e;};'use strict';var client=require(_0x74ba('0x0'));exports[_0x74ba('0x1')]=function(_0x44c578){return client['Request']('CreateWhatsappQueueReport',{'body':_0x44c578,'log':_0x74ba('0x2')});};exports[_0x74ba('0x3')]=function(_0x336e8a,_0x3f8f6d){return client[_0x74ba('0x4')]('UpdateWhatsappQueueReport',{'body':_0x3f8f6d,'options':{'where':{'uniqueid':_0x336e8a},'order':[['id','DESC']],'limit':0x1},'log':_0x74ba('0x5')});};
\ No newline at end of file
+var _0x0570=['DESC','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x974a56,_0x5c6430){var _0x168944=function(_0xfa9e8a){while(--_0xfa9e8a){_0x974a56['push'](_0x974a56['shift']());}};_0x168944(++_0x5c6430);}(_0x0570,0x139));var _0x0057=function(_0x375d84,_0x398f38){_0x375d84=_0x375d84-0x0;var _0x525571=_0x0570[_0x375d84];return _0x525571;};'use strict';var client=require('../client');exports[_0x0057('0x0')]=function(_0x1ac054){return client[_0x0057('0x1')](_0x0057('0x2'),{'body':_0x1ac054,'log':_0x0057('0x2')});};exports[_0x0057('0x3')]=function(_0x1369c3,_0x561250){return client[_0x0057('0x1')](_0x0057('0x4'),{'body':_0x561250,'options':{'where':{'uniqueid':_0x1369c3},'order':[['id',_0x0057('0x5')]],'limit':0x1},'log':_0x0057('0x4')});};
\ No newline at end of file
index 850db84..5d13358 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x407b=['consequence','length','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','name','timeout','createQueue','atimeout','channel','format','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','error','[%s][QUEUE]\x20%s','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','toLowerCase'];(function(_0x58c2ac,_0x58c01b){var _0x10cb51=function(_0x57d85d){while(--_0x57d85d){_0x58c2ac['push'](_0x58c2ac['shift']());}};_0x10cb51(++_0x58c01b);}(_0x407b,0x1a2));var _0xb407=function(_0x4e8dc4,_0x4d4dbc){_0x4e8dc4=_0x4e8dc4-0x0;var _0x259d3b=_0x407b[_0x4e8dc4];return _0x259d3b;};'use strict';var schema=require(_0xb407('0x0'));var _=require(_0xb407('0x1'));var util=require('util');var seqqueue=require(_0xb407('0x2'));var logger=require(_0xb407('0x3'))(_0xb407('0x4'));var strategy=require(_0xb407('0x5'));var queue=schema({'name':{'type':_0xb407('0x6'),'required':!![],'message':_0xb407('0x7')},'timeout':{'type':_0xb407('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x40e50d,_0x1a678e,_0x24c7f8){return logger[_0xb407('0x9')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x40e50d,_0x1a678e['name'],_0x24c7f8));}function handleFindAgent(_0x46bea0){return function(_0x32a2e1){return _0x32a2e1['name'][_0xb407('0xa')]()===_0x46bea0['toLowerCase']();};}exports[_0xb407('0xb')]=function(_0xd65be7,_0x3d8d8e,_0x35ea8f,_0x222683){return function(_0x31b4b0){try{var _0x501d35={'name':_0x3d8d8e[0x0],'timeout':_0x3d8d8e[0x1]};var _0x38b762=queue['validate'](_0x501d35,{'typecast':!![]});if(_0x38b762[_0xb407('0xc')]){logger['error'](_0xb407('0xd'),_0xd65be7,_[_0xb407('0xe')](_0x38b762,_0xb407('0xf'))[_0xb407('0x10')](',\x20'));_0x31b4b0[_0xb407('0x11')]();}else{var _0x132571=_[_0xb407('0x12')](_0x35ea8f[_0xb407('0x13')],handleFindAgent(_0x501d35[_0xb407('0x14')]));if(_0x132571){var _0x304348=(_0x501d35[_0xb407('0x15')]||0xa)*0x3e8;var _0x44ce0a,_0x5b8013;var _0x1f70c1=seqqueue[_0xb407('0x16')](_0x304348);_0x1f70c1['id']=_0xd65be7;_0x1f70c1[_0xb407('0x17')]=_0x304348;_0x1f70c1[_0xb407('0x18')]=_0x222683[_0xb407('0x18')];writeLog(_0xd65be7,_0x132571,util[_0xb407('0x19')](_0xb407('0x1a'),_0x304348));_0x35ea8f['rules'][_0xd65be7]['on'](_0xb407('0x1b'),function(){logger[_0xb407('0x9')](_0xb407('0x1c'),_0xd65be7);clearTimeout(_0x5b8013);_0x5b8013=undefined;_0x1f70c1[_0xb407('0x1d')]();if(_0x35ea8f[_0xb407('0x1e')][_0xd65be7]){delete _0x35ea8f[_0xb407('0x1e')][_0xd65be7];}_0x31b4b0[_0xb407('0x11')]();});_0x35ea8f[_0xb407('0x1e')][_0xd65be7]['on'](_0xb407('0x1f'),function(){if(_0x35ea8f[_0xb407('0x1e')][_0xd65be7]){delete _0x35ea8f[_0xb407('0x1e')][_0xd65be7];}});_0x5b8013=setTimeout(function(){logger[_0xb407('0x9')](_0xb407('0x20'),_0xd65be7);clearTimeout(_0x5b8013);_0x1f70c1['close']();_0x31b4b0[_0xb407('0x21')]();},_0x304348);strategy[_0xb407('0x22')](_0x1f70c1,_0x132571,_0x35ea8f,_0x222683);}else{logger['error'](_0xb407('0x23'),_0xd65be7,_0x501d35[_0xb407('0x14')]);_0x31b4b0[_0xb407('0x11')]();}}}catch(_0x1e3ce0){console[_0xb407('0x24')](_0x1e3ce0);logger[_0xb407('0x25')](_0xb407('0x26'),_0xd65be7,_0x1e3ce0['stack']);_0x31b4b0['stop']();}};};
\ No newline at end of file
+var _0x70a0=['stop','find','timeout','createQueue','atimeout','channel','format','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','info','[%s][AGENT]\x20ROUTING\x20END','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join'];(function(_0x329905,_0x13c144){var _0x3aa42=function(_0x2fac43){while(--_0x2fac43){_0x329905['push'](_0x329905['shift']());}};_0x3aa42(++_0x13c144);}(_0x70a0,0x7a));var _0x070a=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x70a0[_0x47fd36];return _0x21a0fc;};'use strict';var schema=require(_0x070a('0x0'));var _=require('lodash');var util=require(_0x070a('0x1'));var seqqueue=require(_0x070a('0x2'));var logger=require(_0x070a('0x3'))(_0x070a('0x4'));var strategy=require(_0x070a('0x5'));var queue=schema({'name':{'type':_0x070a('0x6'),'required':!![],'message':_0x070a('0x7')},'timeout':{'type':_0x070a('0x8'),'message':_0x070a('0x9')}});function writeLog(_0x46fe4f,_0x4dcbda,_0x3cc31b){return logger['info'](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x46fe4f,_0x4dcbda['name'],_0x3cc31b));}function handleFindAgent(_0x238d26){return function(_0x35bd55){return _0x35bd55[_0x070a('0xa')]['toLowerCase']()===_0x238d26[_0x070a('0xb')]();};}exports[_0x070a('0xc')]=function(_0x176207,_0x28b0fe,_0x3990d0,_0x3d6789){return function(_0xd40877){try{var _0x328698={'name':_0x28b0fe[0x0],'timeout':_0x28b0fe[0x1]};var _0x10afb4=queue['validate'](_0x328698,{'typecast':!![]});if(_0x10afb4[_0x070a('0xd')]){logger[_0x070a('0xe')](_0x070a('0xf'),_0x176207,_['map'](_0x10afb4,_0x070a('0x10'))[_0x070a('0x11')](',\x20'));_0xd40877[_0x070a('0x12')]();}else{var _0x15a79c=_[_0x070a('0x13')](_0x3990d0['agents'],handleFindAgent(_0x328698[_0x070a('0xa')]));if(_0x15a79c){var _0x381f1c=(_0x328698[_0x070a('0x14')]||0xa)*0x3e8;var _0xe41933,_0xafec56;var _0x2a6b8d=seqqueue[_0x070a('0x15')](_0x381f1c);_0x2a6b8d['id']=_0x176207;_0x2a6b8d[_0x070a('0x16')]=_0x381f1c;_0x2a6b8d[_0x070a('0x17')]=_0x3d6789['channel'];writeLog(_0x176207,_0x15a79c,util[_0x070a('0x18')]('START:%s',_0x381f1c));_0x3990d0[_0x070a('0x19')][_0x176207]['on'](_0x070a('0x1a'),function(){logger['info'](_0x070a('0x1b'),_0x176207);clearTimeout(_0xafec56);_0xafec56=undefined;_0x2a6b8d[_0x070a('0x1c')]();if(_0x3990d0[_0x070a('0x19')][_0x176207]){delete _0x3990d0['rules'][_0x176207];}_0xd40877[_0x070a('0x12')]();});_0x3990d0[_0x070a('0x19')][_0x176207]['on']('complete',function(){if(_0x3990d0[_0x070a('0x19')][_0x176207]){delete _0x3990d0[_0x070a('0x19')][_0x176207];}});_0xafec56=setTimeout(function(){logger[_0x070a('0x1d')](_0x070a('0x1e'),_0x176207);clearTimeout(_0xafec56);_0x2a6b8d['close']();_0xd40877['next']();},_0x381f1c);strategy['agent'](_0x2a6b8d,_0x15a79c,_0x3990d0,_0x3d6789);}else{logger[_0x070a('0xe')](_0x070a('0x1f'),_0x176207,_0x328698['name']);_0xd40877[_0x070a('0x12')]();}}}catch(_0x4cae36){console[_0x070a('0x20')](_0x4cae36);logger['error'](_0x070a('0x21'),_0x176207,_0x4cae36[_0x070a('0x22')]);_0xd40877[_0x070a('0x12')]();}};};
\ No newline at end of file
index e0e10da..a7d2d27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ee7=['providerName','providerResponse','stringify','dialogState','Failed','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','then','catch','error','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','amazonlex'];(function(_0x20cbc6,_0x91d8b6){var _0x78bb59=function(_0x209f73){while(--_0x209f73){_0x20cbc6['push'](_0x20cbc6['shift']());}};_0x78bb59(++_0x91d8b6);}(_0x6ee7,0x69));var _0x76ee=function(_0x535a4d,_0x58636c){_0x535a4d=_0x535a4d-0x0;var _0x25b653=_0x6ee7[_0x535a4d];return _0x25b653;};'use strict';var _=require('lodash');var moment=require(_0x76ee('0x0'));var AWS=require('aws-sdk');var utils=require(_0x76ee('0x1'));var logger=require(_0x76ee('0x2'))(_0x76ee('0x3'));var rpc={'chatMessage':require(_0x76ee('0x4')),'openchannelMessage':require(_0x76ee('0x5')),'mailMessage':require(_0x76ee('0x6')),'smsMessage':require(_0x76ee('0x7')),'faxMessage':require(_0x76ee('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x76ee('0x9')]=function(_0x23607a,_0x115311){return function(_0x3e7195){try{if(!_[_0x76ee('0xa')](this['interaction'][_0x76ee('0xb')])){logger['info'](_0x76ee('0xc'),_0x23607a,_0x76ee('0xd'));return _0x3e7195[_0x76ee('0xe')]();}var _0xc2b4d8={'ContactId':this['contact']['id'],'sentAt':moment()[_0x76ee('0xf')](_0x76ee('0x10')),'direction':_0x76ee('0x11')};if(this['channel']===_0x76ee('0x12')||this[_0x76ee('0x13')]===_0x76ee('0x14')){_0xc2b4d8[_0x76ee('0x15')]=this[_0x76ee('0x16')][_0x76ee('0x15')];}var _0x372d62=this[_0x76ee('0x13')];if(_0x372d62===_0x76ee('0x17')){_0xc2b4d8[_0x76ee('0x18')]=this[_0x76ee('0x19')]['id'];}else{_0xc2b4d8[_[_0x76ee('0x1a')](_0x372d62)+_0x76ee('0x1b')]=this[_0x76ee('0x19')]['id'];}_0xc2b4d8[_['upperFirst'](_0x372d62)+_0x76ee('0x1c')]=this[_0x76ee('0x16')]['id'];if(this['interaction'][_0x76ee('0x1d')]){var _0x45915d=_0x115311[0x4];if(!_['isEmpty'](_0x45915d)){_0xc2b4d8[_0x76ee('0x1e')]=utils[_0x76ee('0x1f')](_0x45915d,this);return rpc[_0x372d62+_0x76ee('0x20')][_0x76ee('0x21')](_0xc2b4d8)[_0x76ee('0x22')](function(_0x1d7554){logger['info'](_0x76ee('0xc'),_0x23607a,_0xc2b4d8[_0x76ee('0x1e')]);})[_0x76ee('0x23')](function(_0xcd619){logger[_0x76ee('0x24')](_0x76ee('0xc'),_0x23607a,JSON['stringify'](_0xcd619));})['finally'](function(){logger[_0x76ee('0x25')](_0x76ee('0x26'),_0x23607a);_0x3e7195[_0x76ee('0x27')]();});}else{logger[_0x76ee('0x25')](_0x76ee('0x28'),_0x23607a);_0x3e7195[_0x76ee('0x27')]();}}else{var _0x2cdffa=this;var _0x56d79a=new AWS[(_0x76ee('0x29'))]({'accessKeyId':_0x115311[0x0],'secretAccessKey':_0x115311[0x1],'region':_0x115311[0x2]});var _0x26e3c3={'botAlias':_0x76ee('0x2a'),'botName':_0x115311[0x3],'inputText':this[_0x76ee('0x2b')][_0x76ee('0x1e')],'userId':this['channel']+':'+this[_0x76ee('0x16')]['id']['toString']()};_0x56d79a['postText'](_0x26e3c3,function(_0x818d4b,_0x1a83ed){if(_0x818d4b){logger[_0x76ee('0x24')](_0x76ee('0xc'),_0x23607a,_0x818d4b[_0x76ee('0x2b')]);_0x3e7195[_0x76ee('0xe')]();}else if(_0x1a83ed&&_0x1a83ed[_0x76ee('0x2b')]){_0x2cdffa[_0x76ee('0x1e')][_0x76ee('0x2c')]=_0x1a83ed;_0xc2b4d8[_0x76ee('0x1e')]=_0x1a83ed[_0x76ee('0x2b')];_0xc2b4d8[_0x76ee('0x2d')]='amazonlex';_0xc2b4d8[_0x76ee('0x2e')]=JSON[_0x76ee('0x2f')](_0x1a83ed);return rpc[_0x372d62+'Message']['create'](_0xc2b4d8)[_0x76ee('0x22')](function(_0x284081){logger['info'](_0x76ee('0xc'),_0x23607a,_0xc2b4d8[_0x76ee('0x1e')]);if(_0x1a83ed[_0x76ee('0x30')]==_0x76ee('0x31')){_0x3e7195[_0x76ee('0xe')]();}else{_0x3e7195['stop']();}})[_0x76ee('0x23')](function(_0x2ba786){logger[_0x76ee('0x24')](_0x76ee('0xc'),_0x23607a,JSON[_0x76ee('0x2f')](_0x2ba786));_0x3e7195[_0x76ee('0xe')]();});}else{_0x3e7195[_0x76ee('0xe')]();}});}}catch(_0x1de818){logger[_0x76ee('0x24')]('[%s][AMAZONLEX]\x20%s',_0x23607a,JSON['stringify'](_0x1de818));_0x3e7195[_0x76ee('0x27')]();}};};
\ No newline at end of file
+var _0x8633=['finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','next','amazonlex','providerName','then','dialogState','Failed','lodash','moment','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','contact','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','body','getMustacheRender','Message','create','catch','error','stringify'];(function(_0x36b8da,_0x4162ce){var _0x4c95d5=function(_0x47c093){while(--_0x47c093){_0x36b8da['push'](_0x36b8da['shift']());}};_0x4c95d5(++_0x4162ce);}(_0x8633,0x1c5));var _0x3863=function(_0x160102,_0x4915de){_0x160102=_0x160102-0x0;var _0x302324=_0x8633[_0x160102];return _0x302324;};'use strict';var _=require(_0x3863('0x0'));var moment=require(_0x3863('0x1'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x3863('0x2'));var rpc={'chatMessage':require(_0x3863('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x3863('0x4')),'faxMessage':require(_0x3863('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x3863('0x6')]=function(_0x3dcab9,_0x302e22){return function(_0x2157b9){try{if(!_[_0x3863('0x7')](this[_0x3863('0x8')]['UserId'])){logger[_0x3863('0x9')](_0x3863('0xa'),_0x3dcab9,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2157b9['next']();}var _0x47931e={'ContactId':this[_0x3863('0xb')]['id'],'sentAt':moment()[_0x3863('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x3863('0xd')};if(this[_0x3863('0xe')]===_0x3863('0xf')||this['channel']===_0x3863('0x10')){_0x47931e[_0x3863('0x11')]=this[_0x3863('0x8')]['phone'];}var _0x53094e=this[_0x3863('0xe')];if(_0x53094e===_0x3863('0x12')){_0x47931e[_0x3863('0x13')]=this[_0x3863('0x14')]['id'];}else{_0x47931e[_['upperFirst'](_0x53094e)+'AccountId']=this[_0x3863('0x14')]['id'];}_0x47931e[_[_0x3863('0x15')](_0x53094e)+'InteractionId']=this[_0x3863('0x8')]['id'];if(this[_0x3863('0x8')][_0x3863('0x16')]){var _0x1758f8=_0x302e22[0x4];if(!_[_0x3863('0x17')](_0x1758f8)){_0x47931e[_0x3863('0x18')]=utils[_0x3863('0x19')](_0x1758f8,this);return rpc[_0x53094e+_0x3863('0x1a')][_0x3863('0x1b')](_0x47931e)['then'](function(_0x1af02d){logger['info'](_0x3863('0xa'),_0x3dcab9,_0x47931e[_0x3863('0x18')]);})[_0x3863('0x1c')](function(_0x409c48){logger[_0x3863('0x1d')](_0x3863('0xa'),_0x3dcab9,JSON[_0x3863('0x1e')](_0x409c48));})[_0x3863('0x1f')](function(){logger[_0x3863('0x9')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3dcab9);_0x2157b9[_0x3863('0x20')]();});}else{logger[_0x3863('0x9')](_0x3863('0x21'),_0x3dcab9);_0x2157b9[_0x3863('0x20')]();}}else{var _0x44bf03=this;var _0x50add2=new AWS[(_0x3863('0x22'))]({'accessKeyId':_0x302e22[0x0],'secretAccessKey':_0x302e22[0x1],'region':_0x302e22[0x2]});var _0x24e7ec={'botAlias':'$LATEST','botName':_0x302e22[0x3],'inputText':this[_0x3863('0x23')]['body'],'userId':this[_0x3863('0xe')]+':'+this['interaction']['id'][_0x3863('0x24')]()};_0x50add2[_0x3863('0x25')](_0x24e7ec,function(_0x1e0e90,_0x2262f7){if(_0x1e0e90){logger['error'](_0x3863('0xa'),_0x3dcab9,_0x1e0e90['message']);_0x2157b9[_0x3863('0x26')]();}else if(_0x2262f7&&_0x2262f7[_0x3863('0x23')]){_0x44bf03[_0x3863('0x18')][_0x3863('0x27')]=_0x2262f7;_0x47931e[_0x3863('0x18')]=_0x2262f7[_0x3863('0x23')];_0x47931e[_0x3863('0x28')]='amazonlex';_0x47931e['providerResponse']=JSON[_0x3863('0x1e')](_0x2262f7);return rpc[_0x53094e+_0x3863('0x1a')]['create'](_0x47931e)[_0x3863('0x29')](function(_0xa83c51){logger[_0x3863('0x9')](_0x3863('0xa'),_0x3dcab9,_0x47931e[_0x3863('0x18')]);if(_0x2262f7[_0x3863('0x2a')]==_0x3863('0x2b')){_0x2157b9[_0x3863('0x26')]();}else{_0x2157b9['stop']();}})[_0x3863('0x1c')](function(_0x3ec79e){logger[_0x3863('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x3dcab9,JSON[_0x3863('0x1e')](_0x3ec79e));_0x2157b9['next']();});}else{_0x2157b9[_0x3863('0x26')]();}});}}catch(_0x3246ec){logger[_0x3863('0x1d')](_0x3863('0xa'),_0x3dcab9,JSON[_0x3863('0x1e')](_0x3246ec));_0x2157b9[_0x3863('0x20')]();}};};
\ No newline at end of file
index 296b4d6..954c33b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95b2=['then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','autoreplyExecuted','Interaction','update','finally','resolve','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','Re:','chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','service','Smtp','port','secure','auth','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div','headers','auto-replied','All','auto_reply'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x95b2,0x1b7));var _0x295b=function(_0xef8ee3,_0x57af51){_0xef8ee3=_0xef8ee3-0x0;var _0x14d14c=_0x95b2[_0xef8ee3];return _0x14d14c;};'use strict';var _=require(_0x295b('0x0'));var moment=require(_0x295b('0x1'));var utils=require(_0x295b('0x2'));var logger=require('../../../../config/logger')(_0x295b('0x3'));var rpc={'chatMessage':require(_0x295b('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x295b('0x5')),'smsMessage':require(_0x295b('0x6')),'faxMessage':require(_0x295b('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x295b('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x295b('0x9')),'smsInteraction':require(_0x295b('0xa')),'faxInteraction':require(_0x295b('0xb')),'whatsappInteraction':require(_0x295b('0xc'))};var mailRpc=require(_0x295b('0xd'));exports[_0x295b('0xe')]=function(_0x54fad5,_0x1c7cd2,_0x484bd6,_0x1a5b38){return function(_0x336f8b){try{var _0x2bcf0e=this[_0x295b('0xf')];if(_0x2bcf0e===_0x295b('0x10')&&_0x1a5b38[_0x295b('0x11')]['isAutoreply']){logger[_0x295b('0x12')](_0x295b('0x13'),_0x54fad5,_0x295b('0x14'));return _0x336f8b[_0x295b('0x15')]();}if(_0x1c7cd2[0x0]==='1'&&(_[_0x295b('0x16')](this[_0x295b('0x17')][_0x295b('0x18')])||!this[_0x295b('0x17')][_0x295b('0x18')])){logger[_0x295b('0x12')](_0x295b('0x13'),_0x54fad5,_0x295b('0x19'));return _0x336f8b[_0x295b('0x15')]();}if(_0x1c7cd2[0x0]==='2'&&this[_0x295b('0x17')]['autoreplyExecuted']){logger['info'](_0x295b('0x1a'),_0x54fad5,'One\x20Time\x20already\x20sent');return _0x336f8b[_0x295b('0x15')]();}var _0x4a4881={'ContactId':this['contact']['id'],'sentAt':moment()[_0x295b('0x1b')](_0x295b('0x1c')),'direction':_0x295b('0x1d')};if(this[_0x295b('0xf')]===_0x295b('0x10')){_0x4a4881['body']=utils[_0x295b('0x1e')](_0x1c7cd2[0x2],this);}else{_0x4a4881[_0x295b('0x11')]=utils[_0x295b('0x1e')](_0x1c7cd2[0x1],this);}if(this[_0x295b('0x1f')]){_0x4a4881['to']=this['message']['from']||'';if(this[_0x295b('0xf')]===_0x295b('0x10')&&_0x1c7cd2[0x1]==='1'){_0x4a4881['cc']=this[_0x295b('0x1f')]['cc']||'';}_0x4a4881[_0x295b('0x20')]=this[_0x295b('0x1f')]['to']||'';_0x4a4881[_0x295b('0x21')]=this[_0x295b('0x1f')]['phone']||'';_0x4a4881[_0x295b('0x22')]=!![];if(this[_0x295b('0x1f')][_0x295b('0x23')]){_0x4a4881['subject']='';_0x4a4881['subject']+=_['startsWith'](this['message'][_0x295b('0x23')],_0x295b('0x24'))?'':'Re:\x20';_0x4a4881[_0x295b('0x23')]+=this[_0x295b('0x1f')][_0x295b('0x23')];}}if(this[_0x295b('0xf')]===_0x295b('0x25')){_0x4a4881[_0x295b('0x26')]=this['account']['id'];}else{_0x4a4881[_['upperFirst'](this[_0x295b('0xf')])+'AccountId']=this[_0x295b('0x27')]['id'];}_0x4a4881[_[_0x295b('0x28')](this[_0x295b('0xf')])+_0x295b('0x29')]=this[_0x295b('0x17')]['id'];var _0x2460fb=this[_0x295b('0x17')];if(rpc[this[_0x295b('0xf')]+_0x295b('0x2a')]){if(this['channel']==='mail'){var _0x5b87e7={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp'][_0x295b('0x2b')]){_0x5b87e7[_0x295b('0x2b')]=this['account']['Smtp'][_0x295b('0x2b')];}else{_0x5b87e7['host']=this[_0x295b('0x27')][_0x295b('0x2c')]['host'];_0x5b87e7['port']=this['account']['Smtp'][_0x295b('0x2d')];_0x5b87e7[_0x295b('0x2e')]=this['account'][_0x295b('0x2c')][_0x295b('0x2e')];}if(this['account'][_0x295b('0x2c')]['authentication']){_0x5b87e7[_0x295b('0x2f')]={'user':this['account'][_0x295b('0x2c')]['user'],'pass':this[_0x295b('0x27')][_0x295b('0x2c')]['pass']};}_0x4a4881[_0x295b('0x30')]=this[_0x295b('0x1f')][_0x295b('0x31')];_0x4a4881[_0x295b('0x32')]=_0x295b('0x33')+_[_0x295b('0x34')](_0x4a4881['body'],'<div\x20id=\x22xm-mail-content\x22',_0x295b('0x35'))+'</div>';_0x4a4881[_0x295b('0x36')]={'Auto-Submitted':_0x295b('0x37'),'X-Auto-Response-Suppress':_0x295b('0x38'),'Precedence':_0x295b('0x39')};return mailRpc['sendMailMessage'](_0x5b87e7,_0x4a4881)[_0x295b('0x3a')](function(_0x5c83d7){logger[_0x295b('0x12')](_0x295b('0x3b'),_0x54fad5);_0x4a4881['messageId']=_0x5c83d7[_0x295b('0x1f')][_0x295b('0x31')];return rpc[_0x2bcf0e+'Message'][_0x295b('0x3c')](_0x4a4881);})[_0x295b('0x3a')](function(_0x20dc88){logger['info'](_0x295b('0x13'),_0x54fad5,JSON[_0x295b('0x3d')](_0x20dc88));})[_0x295b('0x3e')](function(_0x23fccb){logger[_0x295b('0x3f')](_0x295b('0x40'),_0x54fad5,JSON[_0x295b('0x3d')](_0x23fccb));})['finally'](function(){Promise['resolve']()[_0x295b('0x3a')](function(){if(_0x1c7cd2[0x0]!=='2'||_0x2460fb[_0x295b('0x41')])return;return rpc[_0x2bcf0e+_0x295b('0x42')][_0x295b('0x43')](_0x2460fb['id'],{'autoreplyExecuted':!![]})[_0x295b('0x3a')](function(_0x41493b){logger[_0x295b('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x54fad5,JSON[_0x295b('0x3d')](_0x41493b));})[_0x295b('0x3e')](function(_0x5f215d){logger[_0x295b('0x3f')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x54fad5,JSON[_0x295b('0x3d')](_0x5f215d));});})[_0x295b('0x3a')](function(){_0x336f8b[_0x295b('0x15')]();});});}else{return rpc[this[_0x295b('0xf')]+'Message'][_0x295b('0x3c')](_0x4a4881)[_0x295b('0x3a')](function(_0x267e57){logger[_0x295b('0x12')]('[%s][AUTOREPLY]\x20%s',_0x54fad5,_0x4a4881['body']);})[_0x295b('0x3e')](function(_0x354848){logger[_0x295b('0x3f')](_0x295b('0x13'),_0x54fad5,JSON[_0x295b('0x3d')](_0x354848));})[_0x295b('0x44')](function(){Promise[_0x295b('0x45')]()[_0x295b('0x3a')](function(){if(_0x1c7cd2[0x0]!=='2'||_0x2460fb[_0x295b('0x41')])return;return rpc[_0x2bcf0e+_0x295b('0x42')][_0x295b('0x43')](_0x2460fb['id'],{'autoreplyExecuted':!![]})['then'](function(_0x47da9f){logger[_0x295b('0x12')](_0x295b('0x1a'),_0x54fad5,JSON[_0x295b('0x3d')](_0x47da9f));})[_0x295b('0x3e')](function(_0x466d21){logger[_0x295b('0x3f')](_0x295b('0x46'),_0x54fad5,JSON[_0x295b('0x3d')](_0x466d21));});})['then'](function(){_0x336f8b['next']();});});}}}catch(_0x294613){logger[_0x295b('0x3f')]('[%s][AUTOREPLY]\x20%s',_0x54fad5,JSON['stringify'](_0x294613));_0x336f8b['stop']();}};};
\ No newline at end of file
+var _0xa6ff=['pass','messageId','html','replace','<div\x20id=\x22xm-mail-content\x22','</div>','auto-replied','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','then','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','Interaction','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../mailRpc','consequence','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','info','Autoreply\x20already\x20sent','interaction','autoreplyExecuted','One\x20Time\x20already\x20sent','mail','getMustacheRender','message','from','phone','subject','Re:\x20','channel','ChatWebsiteId','account','upperFirst','InteractionId','Message','service','Smtp','host','port','authentication','auth','user'];(function(_0x175405,_0x5e1c1a){var _0x385ff9=function(_0x1a4645){while(--_0x1a4645){_0x175405['push'](_0x175405['shift']());}};_0x385ff9(++_0x5e1c1a);}(_0xa6ff,0xe6));var _0xfa6f=function(_0x2c9023,_0x3a94e1){_0x2c9023=_0x2c9023-0x0;var _0x358f5a=_0xa6ff[_0x2c9023];return _0x358f5a;};'use strict';var _=require(_0xfa6f('0x0'));var moment=require('moment');var utils=require(_0xfa6f('0x1'));var logger=require(_0xfa6f('0x2'))(_0xfa6f('0x3'));var rpc={'chatMessage':require(_0xfa6f('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xfa6f('0x5')),'smsMessage':require(_0xfa6f('0x6')),'faxMessage':require(_0xfa6f('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xfa6f('0x8')),'openchannelInteraction':require(_0xfa6f('0x9')),'mailInteraction':require(_0xfa6f('0xa')),'smsInteraction':require(_0xfa6f('0xb')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xfa6f('0xc'));exports[_0xfa6f('0xd')]=function(_0x3bb099,_0x101504,_0x4f72dd,_0x369e75){return function(_0x262e14){try{var _0x5944b8=this['channel'];if(_0x5944b8==='mail'&&_0x369e75[_0xfa6f('0xe')][_0xfa6f('0xf')]){logger['info'](_0xfa6f('0x10'),_0x3bb099,_0xfa6f('0x11'));return _0x262e14[_0xfa6f('0x12')]();}if(_0x101504[0x0]==='1'&&(_[_0xfa6f('0x13')](this['interaction'][_0xfa6f('0x14')])||!this['interaction'][_0xfa6f('0x14')])){logger[_0xfa6f('0x15')](_0xfa6f('0x10'),_0x3bb099,_0xfa6f('0x16'));return _0x262e14[_0xfa6f('0x12')]();}if(_0x101504[0x0]==='2'&&this[_0xfa6f('0x17')][_0xfa6f('0x18')]){logger[_0xfa6f('0x15')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3bb099,_0xfa6f('0x19'));return _0x262e14[_0xfa6f('0x12')]();}var _0x14495c={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0xfa6f('0x1a')){_0x14495c['body']=utils[_0xfa6f('0x1b')](_0x101504[0x2],this);}else{_0x14495c[_0xfa6f('0xe')]=utils[_0xfa6f('0x1b')](_0x101504[0x1],this);}if(this[_0xfa6f('0x1c')]){_0x14495c['to']=this[_0xfa6f('0x1c')]['from']||'';if(this['channel']===_0xfa6f('0x1a')&&_0x101504[0x1]==='1'){_0x14495c['cc']=this[_0xfa6f('0x1c')]['cc']||'';}_0x14495c[_0xfa6f('0x1d')]=this[_0xfa6f('0x1c')]['to']||'';_0x14495c[_0xfa6f('0x1e')]=this[_0xfa6f('0x1c')][_0xfa6f('0x1e')]||'';_0x14495c['read']=!![];if(this[_0xfa6f('0x1c')][_0xfa6f('0x1f')]){_0x14495c[_0xfa6f('0x1f')]='';_0x14495c['subject']+=_['startsWith'](this['message'][_0xfa6f('0x1f')],'Re:')?'':_0xfa6f('0x20');_0x14495c[_0xfa6f('0x1f')]+=this[_0xfa6f('0x1c')][_0xfa6f('0x1f')];}}if(this[_0xfa6f('0x21')]==='chat'){_0x14495c[_0xfa6f('0x22')]=this[_0xfa6f('0x23')]['id'];}else{_0x14495c[_[_0xfa6f('0x24')](this[_0xfa6f('0x21')])+'AccountId']=this[_0xfa6f('0x23')]['id'];}_0x14495c[_[_0xfa6f('0x24')](this[_0xfa6f('0x21')])+_0xfa6f('0x25')]=this['interaction']['id'];var _0xdf76aa=this[_0xfa6f('0x17')];if(rpc[this[_0xfa6f('0x21')]+_0xfa6f('0x26')]){if(this[_0xfa6f('0x21')]===_0xfa6f('0x1a')){var _0x37ca21={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp'][_0xfa6f('0x27')]){_0x37ca21[_0xfa6f('0x27')]=this[_0xfa6f('0x23')][_0xfa6f('0x28')][_0xfa6f('0x27')];}else{_0x37ca21['host']=this[_0xfa6f('0x23')]['Smtp'][_0xfa6f('0x29')];_0x37ca21[_0xfa6f('0x2a')]=this[_0xfa6f('0x23')][_0xfa6f('0x28')]['port'];_0x37ca21['secure']=this[_0xfa6f('0x23')][_0xfa6f('0x28')]['secure'];}if(this[_0xfa6f('0x23')][_0xfa6f('0x28')][_0xfa6f('0x2b')]){_0x37ca21[_0xfa6f('0x2c')]={'user':this['account'][_0xfa6f('0x28')][_0xfa6f('0x2d')],'pass':this[_0xfa6f('0x23')][_0xfa6f('0x28')][_0xfa6f('0x2e')]};}_0x14495c['inReplyTo']=this['message'][_0xfa6f('0x2f')];_0x14495c[_0xfa6f('0x30')]='<div\x20id=\x22xm-mail-content\x22>'+_[_0xfa6f('0x31')](_0x14495c[_0xfa6f('0xe')],_0xfa6f('0x32'),'<div')+_0xfa6f('0x33');_0x14495c['headers']={'Auto-Submitted':_0xfa6f('0x34'),'X-Auto-Response-Suppress':'All','Precedence':_0xfa6f('0x35')};return mailRpc[_0xfa6f('0x36')](_0x37ca21,_0x14495c)['then'](function(_0x2533d9){logger['info'](_0xfa6f('0x37'),_0x3bb099);_0x14495c[_0xfa6f('0x2f')]=_0x2533d9[_0xfa6f('0x1c')][_0xfa6f('0x2f')];return rpc[_0x5944b8+_0xfa6f('0x26')][_0xfa6f('0x38')](_0x14495c);})['then'](function(_0x58975b){logger[_0xfa6f('0x15')](_0xfa6f('0x10'),_0x3bb099,JSON[_0xfa6f('0x39')](_0x58975b));})[_0xfa6f('0x3a')](function(_0x1a42f0){logger[_0xfa6f('0x3b')](_0xfa6f('0x3c'),_0x3bb099,JSON[_0xfa6f('0x39')](_0x1a42f0));})[_0xfa6f('0x3d')](function(){Promise['resolve']()[_0xfa6f('0x3e')](function(){if(_0x101504[0x0]!=='2'||_0xdf76aa[_0xfa6f('0x18')])return;return rpc[_0x5944b8+'Interaction'][_0xfa6f('0x3f')](_0xdf76aa['id'],{'autoreplyExecuted':!![]})[_0xfa6f('0x3e')](function(_0x57d0fc){logger['info'](_0xfa6f('0x40'),_0x3bb099,JSON[_0xfa6f('0x39')](_0x57d0fc));})[_0xfa6f('0x3a')](function(_0x3f2d7c){logger[_0xfa6f('0x3b')](_0xfa6f('0x41'),_0x3bb099,JSON[_0xfa6f('0x39')](_0x3f2d7c));});})[_0xfa6f('0x3e')](function(){_0x262e14[_0xfa6f('0x12')]();});});}else{return rpc[this['channel']+'Message'][_0xfa6f('0x38')](_0x14495c)[_0xfa6f('0x3e')](function(_0x2883b6){logger[_0xfa6f('0x15')](_0xfa6f('0x10'),_0x3bb099,_0x14495c['body']);})['catch'](function(_0x2c8e89){logger[_0xfa6f('0x3b')]('[%s][AUTOREPLY]\x20%s',_0x3bb099,JSON[_0xfa6f('0x39')](_0x2c8e89));})['finally'](function(){Promise[_0xfa6f('0x42')]()['then'](function(){if(_0x101504[0x0]!=='2'||_0xdf76aa['autoreplyExecuted'])return;return rpc[_0x5944b8+_0xfa6f('0x43')]['update'](_0xdf76aa['id'],{'autoreplyExecuted':!![]})['then'](function(_0x46eca0){logger[_0xfa6f('0x15')](_0xfa6f('0x40'),_0x3bb099,JSON['stringify'](_0x46eca0));})[_0xfa6f('0x3a')](function(_0x10f3d1){logger[_0xfa6f('0x3b')](_0xfa6f('0x41'),_0x3bb099,JSON[_0xfa6f('0x39')](_0x10f3d1));});})['then'](function(){_0x262e14['next']();});});}}}catch(_0x1e0b6b){logger[_0xfa6f('0x3b')](_0xfa6f('0x10'),_0x3bb099,JSON[_0xfa6f('0x39')](_0x1e0b6b));_0x262e14[_0xfa6f('0x44')]();}};};
\ No newline at end of file
index 22480e2..b4d4f70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc77c=['routing','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stop','moment'];(function(_0x2a7ac2,_0x3f92f7){var _0x34f3ca=function(_0x2069e5){while(--_0x2069e5){_0x2a7ac2['push'](_0x2a7ac2['shift']());}};_0x34f3ca(++_0x3f92f7);}(_0xc77c,0x1df));var _0xcc77=function(_0x186ce7,_0x2acc42){_0x186ce7=_0x186ce7-0x0;var _0x1fc00a=_0xc77c[_0x186ce7];return _0x1fc00a;};'use strict';var moment=require(_0xcc77('0x0'));var logger=require('../../../../config/logger')(_0xcc77('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xcc77('0x2')),'faxInteraction':require(_0xcc77('0x3')),'whatsappInteraction':require(_0xcc77('0x4'))};exports[_0xcc77('0x5')]=function(_0x5e8215,_0x39cd18,_0x3588f8,_0x38e262){return function(_0x603f0){try{logger[_0xcc77('0x6')](_0xcc77('0x7'),_0x5e8215,_0x39cd18[0x0]);var _0x410bcf={'closed':0x1,'closedAt':moment()['format'](_0xcc77('0x8')),'closeReason':_0xcc77('0x9'),'disposition':_0x39cd18[0x0]};if(rpc[_0x38e262['channel']+_0xcc77('0xa')]){rpc[_0x38e262[_0xcc77('0xb')]+_0xcc77('0xa')][_0xcc77('0xc')](_0x38e262[_0xcc77('0xd')]['id'],_0x410bcf)[_0xcc77('0xe')](function(_0x327cdd){logger[_0xcc77('0x6')](_0xcc77('0xf'),_0x5e8215,_0x38e262['interaction']['id']);})[_0xcc77('0x10')](function(_0x5bec9c){logger[_0xcc77('0x11')](_0xcc77('0x12'),_0x5e8215,JSON['stringify'](_0x5bec9c));})['finally'](function(){_0x603f0[_0xcc77('0x13')]();});}}catch(_0xf298ce){logger[_0xcc77('0x11')](_0xcc77('0x12'),_0x5e8215,JSON['stringify'](_0xf298ce));_0x603f0['stop']();}};};
\ No newline at end of file
+var _0x27ad=['moment','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','stringify','finally','stop','[%s][CLOSE]\x20%s'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x27ad,0x69));var _0xd27a=function(_0x30233d,_0x34514d){_0x30233d=_0x30233d-0x0;var _0x338612=_0x27ad[_0x30233d];return _0x338612;};'use strict';var moment=require(_0xd27a('0x0'));var logger=require(_0xd27a('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xd27a('0x2')),'smsInteraction':require(_0xd27a('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xd27a('0x4')),'whatsappInteraction':require(_0xd27a('0x5'))};exports['consequence']=function(_0x3a48b2,_0x5159bb,_0x175867,_0x5eb51a){return function(_0x185a14){try{logger[_0xd27a('0x6')](_0xd27a('0x7'),_0x3a48b2,_0x5159bb[0x0]);var _0x396c20={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xd27a('0x8'),'disposition':_0x5159bb[0x0]};if(rpc[_0x5eb51a[_0xd27a('0x9')]+_0xd27a('0xa')]){rpc[_0x5eb51a[_0xd27a('0x9')]+_0xd27a('0xa')][_0xd27a('0xb')](_0x5eb51a[_0xd27a('0xc')]['id'],_0x396c20)[_0xd27a('0xd')](function(_0x34ce61){logger[_0xd27a('0x6')](_0xd27a('0xe'),_0x3a48b2,_0x5eb51a[_0xd27a('0xc')]['id']);})[_0xd27a('0xf')](function(_0x41bb3d){logger[_0xd27a('0x10')]('[%s][CLOSE]\x20%s',_0x3a48b2,JSON[_0xd27a('0x11')](_0x41bb3d));})[_0xd27a('0x12')](function(){_0x185a14[_0xd27a('0x13')]();});}}catch(_0x56e011){logger[_0xd27a('0x10')](_0xd27a('0x14'),_0x3a48b2,JSON[_0xd27a('0x11')](_0x56e011));_0x185a14[_0xd27a('0x13')]();}};};
\ No newline at end of file
index 58c623b..a91554f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef17=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','channel','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','create','catch','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','body','then','dialogflow','speech','providerName','providerResponse','result','endConversation','error','lodash','moment','apiai-promise','md5','./utils'];(function(_0x33389b,_0x31bce2){var _0x48cf42=function(_0x4f6cb6){while(--_0x4f6cb6){_0x33389b['push'](_0x33389b['shift']());}};_0x48cf42(++_0x31bce2);}(_0xef17,0x136));var _0x7ef1=function(_0x275618,_0x27407e){_0x275618=_0x275618-0x0;var _0x5b1a03=_0xef17[_0x275618];return _0x5b1a03;};'use strict';var _=require(_0x7ef1('0x0'));var moment=require(_0x7ef1('0x1'));var apiai=require(_0x7ef1('0x2'));var md5=require(_0x7ef1('0x3'));var utils=require(_0x7ef1('0x4'));var logger=require(_0x7ef1('0x5'))(_0x7ef1('0x6'));var rpc={'chatMessage':require(_0x7ef1('0x7')),'openchannelMessage':require(_0x7ef1('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x7ef1('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x7ef1('0xa'))};exports['consequence']=function(_0x34a040,_0x4ba2f0){return function(_0x5aec63){try{if(!_[_0x7ef1('0xb')](this[_0x7ef1('0xc')]['UserId'])){logger[_0x7ef1('0xd')](_0x7ef1('0xe'),_0x34a040,_0x7ef1('0xf'));return _0x5aec63[_0x7ef1('0x10')]();}var _0x2cb9b0={'ContactId':this[_0x7ef1('0x11')]['id'],'sentAt':moment()[_0x7ef1('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x7ef1('0x13')]==='sms'||this['channel']==='whatsapp'){_0x2cb9b0[_0x7ef1('0x14')]=this['interaction'][_0x7ef1('0x14')];}var _0x29c920=this[_0x7ef1('0x13')];if(_0x29c920===_0x7ef1('0x15')){_0x2cb9b0[_0x7ef1('0x16')]=this[_0x7ef1('0x17')]['id'];}else{_0x2cb9b0[_[_0x7ef1('0x18')](_0x29c920)+_0x7ef1('0x19')]=this['account']['id'];}_0x2cb9b0[_['upperFirst'](_0x29c920)+_0x7ef1('0x1a')]=this['interaction']['id'];if(this[_0x7ef1('0xc')][_0x7ef1('0x1b')]){var _0x55e84e=_0x4ba2f0[0x2];if(!_['isEmpty'](_0x55e84e)){_0x2cb9b0['body']=utils[_0x7ef1('0x1c')](_0x55e84e,this);return rpc[_0x29c920+'Message'][_0x7ef1('0x1d')](_0x2cb9b0)['then'](function(_0x5a7b2b){logger['info'](_0x7ef1('0xe'),_0x34a040,_0x2cb9b0['body']);})[_0x7ef1('0x1e')](function(_0x2a8fab){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x34a040,JSON[_0x7ef1('0x1f')](_0x2a8fab));})['finally'](function(){logger[_0x7ef1('0xd')](_0x7ef1('0x20'),_0x34a040);_0x5aec63[_0x7ef1('0x21')]();});}else{logger[_0x7ef1('0xd')](_0x7ef1('0x22'),_0x34a040);_0x5aec63[_0x7ef1('0x21')]();}}else{var _0x20887b=this;var _0xd71594=apiai(_0x4ba2f0[0x0],{'language':_0x4ba2f0[0x1]||'en'});return _0xd71594['textRequest'](this[_0x7ef1('0x23')][_0x7ef1('0x24')],{'sessionId':md5(this[_0x7ef1('0xc')]['id'])})[_0x7ef1('0x25')](function(_0x31b5bf){_0x20887b[_0x7ef1('0x24')][_0x7ef1('0x26')]=_0x31b5bf;_0x2cb9b0[_0x7ef1('0x24')]=_0x31b5bf['result']['fulfillment'][_0x7ef1('0x27')];_0x2cb9b0[_0x7ef1('0x28')]=_0x7ef1('0x26');_0x2cb9b0[_0x7ef1('0x29')]=JSON[_0x7ef1('0x1f')](_0x31b5bf);return rpc[_0x29c920+'Message'][_0x7ef1('0x1d')](_0x2cb9b0)[_0x7ef1('0x25')](function(_0x445902){logger[_0x7ef1('0xd')](_0x7ef1('0xe'),_0x34a040,_0x2cb9b0[_0x7ef1('0x24')]);if(_0x31b5bf[_0x7ef1('0x2a')]['metadata'][_0x7ef1('0x2b')]){_0x5aec63['next']();}else{_0x5aec63[_0x7ef1('0x21')]();}})[_0x7ef1('0x1e')](function(_0x4b5fde){logger['error'](_0x7ef1('0xe'),_0x34a040,JSON[_0x7ef1('0x1f')](_0x4b5fde));_0x5aec63['next']();});})[_0x7ef1('0x1e')](function(_0x56fe40){logger[_0x7ef1('0x2c')]('[%s][DIALOGFLOW]\x20%s',_0x34a040,_0x56fe40[_0x7ef1('0x23')]);_0x5aec63[_0x7ef1('0x10')]();});}}catch(_0x585238){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x34a040,JSON['stringify'](_0x585238));_0x5aec63[_0x7ef1('0x21')]();}};};
\ No newline at end of file
+var _0x0686=['info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','isEmpty','body','getMustacheRender','then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','result','fulfillment','speech','providerName','create','metadata','endConversation','catch','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x0686,0x123));var _0x6068=function(_0x137e8a,_0xba6029){_0x137e8a=_0x137e8a-0x0;var _0x26c8db=_0x0686[_0x137e8a];return _0x26c8db;};'use strict';var _=require(_0x6068('0x0'));var moment=require(_0x6068('0x1'));var apiai=require(_0x6068('0x2'));var md5=require(_0x6068('0x3'));var utils=require(_0x6068('0x4'));var logger=require(_0x6068('0x5'))(_0x6068('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6068('0x7')),'mailMessage':require(_0x6068('0x8')),'smsMessage':require(_0x6068('0x9')),'faxMessage':require(_0x6068('0xa')),'whatsappMessage':require(_0x6068('0xb'))};exports[_0x6068('0xc')]=function(_0x37489b,_0x171e21){return function(_0x3eb140){try{if(!_[_0x6068('0xd')](this['interaction'][_0x6068('0xe')])){logger[_0x6068('0xf')](_0x6068('0x10'),_0x37489b,_0x6068('0x11'));return _0x3eb140[_0x6068('0x12')]();}var _0x3d27cf={'ContactId':this[_0x6068('0x13')]['id'],'sentAt':moment()['format'](_0x6068('0x14')),'direction':_0x6068('0x15')};if(this[_0x6068('0x16')]===_0x6068('0x17')||this[_0x6068('0x16')]==='whatsapp'){_0x3d27cf[_0x6068('0x18')]=this[_0x6068('0x19')]['phone'];}var _0x406cab=this[_0x6068('0x16')];if(_0x406cab===_0x6068('0x1a')){_0x3d27cf[_0x6068('0x1b')]=this[_0x6068('0x1c')]['id'];}else{_0x3d27cf[_[_0x6068('0x1d')](_0x406cab)+_0x6068('0x1e')]=this[_0x6068('0x1c')]['id'];}_0x3d27cf[_[_0x6068('0x1d')](_0x406cab)+'InteractionId']=this[_0x6068('0x19')]['id'];if(this[_0x6068('0x19')]['created']){var _0x456dbb=_0x171e21[0x2];if(!_[_0x6068('0x1f')](_0x456dbb)){_0x3d27cf[_0x6068('0x20')]=utils[_0x6068('0x21')](_0x456dbb,this);return rpc[_0x406cab+'Message']['create'](_0x3d27cf)[_0x6068('0x22')](function(_0x1f0e7e){logger[_0x6068('0xf')](_0x6068('0x10'),_0x37489b,_0x3d27cf['body']);})['catch'](function(_0x1703ba){logger[_0x6068('0x23')](_0x6068('0x10'),_0x37489b,JSON[_0x6068('0x24')](_0x1703ba));})[_0x6068('0x25')](function(){logger[_0x6068('0xf')](_0x6068('0x26'),_0x37489b);_0x3eb140['stop']();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x37489b);_0x3eb140[_0x6068('0x27')]();}}else{var _0x138946=this;var _0x1b4f91=apiai(_0x171e21[0x0],{'language':_0x171e21[0x1]||'en'});return _0x1b4f91[_0x6068('0x28')](this[_0x6068('0x29')][_0x6068('0x20')],{'sessionId':md5(this[_0x6068('0x19')]['id'])})[_0x6068('0x22')](function(_0x5cf58c){_0x138946[_0x6068('0x20')][_0x6068('0x2a')]=_0x5cf58c;_0x3d27cf['body']=_0x5cf58c[_0x6068('0x2b')][_0x6068('0x2c')][_0x6068('0x2d')];_0x3d27cf[_0x6068('0x2e')]=_0x6068('0x2a');_0x3d27cf['providerResponse']=JSON[_0x6068('0x24')](_0x5cf58c);return rpc[_0x406cab+'Message'][_0x6068('0x2f')](_0x3d27cf)[_0x6068('0x22')](function(_0x256aaf){logger[_0x6068('0xf')](_0x6068('0x10'),_0x37489b,_0x3d27cf[_0x6068('0x20')]);if(_0x5cf58c[_0x6068('0x2b')][_0x6068('0x30')][_0x6068('0x31')]){_0x3eb140[_0x6068('0x12')]();}else{_0x3eb140['stop']();}})[_0x6068('0x32')](function(_0x2e6324){logger[_0x6068('0x23')](_0x6068('0x10'),_0x37489b,JSON[_0x6068('0x24')](_0x2e6324));_0x3eb140[_0x6068('0x12')]();});})[_0x6068('0x32')](function(_0x109829){logger['error'](_0x6068('0x10'),_0x37489b,_0x109829[_0x6068('0x29')]);_0x3eb140[_0x6068('0x12')]();});}}catch(_0x1ecf5d){logger[_0x6068('0x23')](_0x6068('0x10'),_0x37489b,JSON[_0x6068('0x24')](_0x1ecf5d));_0x3eb140[_0x6068('0x27')]();}};};
\ No newline at end of file
index 8365fe0..deabc51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f09=['DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','fulfillmentText','push','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/faxMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','UserId','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','interaction','chat','ChatWebsiteId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue'];(function(_0x13e6e1,_0x22c6f9){var _0xab9bd6=function(_0x52475e){while(--_0x52475e){_0x13e6e1['push'](_0x13e6e1['shift']());}};_0xab9bd6(++_0x22c6f9);}(_0x0f09,0x1a5));var _0x90f0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0f09[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var dialogflow=require(_0x90f0('0x0'));var md5=require(_0x90f0('0x1'));var moment=require(_0x90f0('0x2'));var Promise=require(_0x90f0('0x3'));var logger=require(_0x90f0('0x4'))(_0x90f0('0x5'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x90f0('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x90f0('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x4741a3,_0x17e4ba,_0x2d3559,_0x51edf1){return new Promise(function(_0x2fa7fc,_0x34e28c){var _0x2b4f6d=_[_0x90f0('0x8')](_0x2d3559);_0x2b4f6d[_0x90f0('0x9')]=_0x51edf1;return rpc[_0x17e4ba+_0x90f0('0xa')][_0x90f0('0xb')](_0x2b4f6d)[_0x90f0('0xc')](function(){logger[_0x90f0('0xd')](_0x90f0('0xe'),_0x4741a3,_0x2b4f6d['body']);_0x2fa7fc();})[_0x90f0('0xf')](function(_0x3ebb20){logger[_0x90f0('0x10')](_0x90f0('0xe'),_0x4741a3,JSON[_0x90f0('0x11')](_0x3ebb20));_0x34e28c(_0x3ebb20);});});}exports[_0x90f0('0x12')]=function(_0x5ea8f4,_0xfdf712){return function(_0x3995a5){try{if(!_[_0x90f0('0x13')](this['interaction'][_0x90f0('0x14')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x5ea8f4,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3995a5[_0x90f0('0x15')]();}var _0x48414f={'ContactId':this[_0x90f0('0x16')]['id'],'sentAt':moment()['format'](_0x90f0('0x17')),'direction':_0x90f0('0x18')};if(this['channel']==='sms'||this[_0x90f0('0x19')]==='whatsapp'){_0x48414f[_0x90f0('0x1a')]=this[_0x90f0('0x1b')][_0x90f0('0x1a')];}var _0x47d627=this['channel'];if(_0x47d627===_0x90f0('0x1c')){_0x48414f[_0x90f0('0x1d')]=this['account']['id'];}else{_0x48414f[_['upperFirst'](_0x47d627)+'AccountId']=this['account']['id'];}_0x48414f[_[_0x90f0('0x1e')](_0x47d627)+_0x90f0('0x1f')]=this['interaction']['id'];if(this['interaction'][_0x90f0('0x20')]){var _0x4e2993=_0xfdf712[0x4];if(!_[_0x90f0('0x21')](_0x4e2993)){_0x48414f[_0x90f0('0x9')]=utils[_0x90f0('0x22')](_0x4e2993,this);return rpc[_0x47d627+'Message'][_0x90f0('0xb')](_0x48414f)['then'](function(_0x7993b9){logger[_0x90f0('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x5ea8f4,_0x48414f[_0x90f0('0x9')]);})[_0x90f0('0xf')](function(_0x2e26ee){logger['error'](_0x90f0('0xe'),_0x5ea8f4,JSON[_0x90f0('0x11')](_0x2e26ee));})[_0x90f0('0x23')](function(){logger[_0x90f0('0xd')](_0x90f0('0x24'),_0x5ea8f4);_0x3995a5[_0x90f0('0x25')]();});}else{logger[_0x90f0('0xd')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5ea8f4);_0x3995a5[_0x90f0('0x25')]();}}else{var _0x141e7b=this;var _0x1735f6=_0xfdf712[0x2]['replace'](/\\n/g,'\x0a');var _0x49067c={'credentials':{'private_key':_0x1735f6,'client_email':_0xfdf712[0x1]}};var _0x17baaa=new dialogflow['SessionsClient'](_0x49067c);var _0x555c75=_0x17baaa[_0x90f0('0x26')](_0xfdf712[0x0],md5(_0x141e7b[_0x90f0('0x1b')]['id']));var _0x2c6b70={'session':_0x555c75,'queryInput':{'text':{'text':_0x141e7b[_0x90f0('0x27')][_0x90f0('0x9')],'languageCode':_0xfdf712[0x3]||'en'}}};return _0x17baaa[_0x90f0('0x28')](_0x2c6b70)['then'](function(_0x3e8484){if(_0x3e8484&&_0x3e8484[_0x90f0('0x29')]){_0x141e7b[_0x90f0('0x9')][_0x90f0('0x2a')]=_0x3e8484;var _0x3fd89f=_0x3e8484[0x0];var _0x3ba925=_0x3fd89f[_0x90f0('0x2b')]['diagnosticInfo']&&_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x2c')][_0x90f0('0x2d')]?_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x2c')]['fields'][_0x90f0('0x2e')][_0x90f0('0x2f')]:![];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x30')]=_0x3fd89f[_0x90f0('0x2b')]['action'];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x31')]=_0x3fd89f['queryResult'][_0x90f0('0x32')];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x33')]=_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x2c')]&&_0x3fd89f[_0x90f0('0x2b')]['diagnosticInfo'][_0x90f0('0x2d')]?_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x2c')]['fields'][_0x90f0('0x2e')][_0x90f0('0x2f')]:![];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x34')]=_0x3fd89f['queryResult'][_0x90f0('0x35')][_0x90f0('0x36')];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x37')]=_0x3fd89f[_0x90f0('0x2b')]['intent'][_0x90f0('0x38')];_0x141e7b[_0x90f0('0x9')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x3fd89f['queryResult'][_0x90f0('0x35')][_0x90f0('0x39')];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x3a')]=_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x3b')];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x3c')]=_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x3d')];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x3e')]=_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x3f')];_0x48414f['providerName']=_0x90f0('0x2a');_0x48414f[_0x90f0('0x40')]=JSON[_0x90f0('0x11')](_0x3e8484);var _0x3f29ef=[];for(var _0x20e19a=0x0;_0x20e19a<_0x3e8484[_0x90f0('0x29')];_0x20e19a++){var _0x1ab5b1=_0x3e8484[_0x20e19a];if(_0x1ab5b1&&_0x1ab5b1[_0x90f0('0x2b')]&&_0x1ab5b1[_0x90f0('0x2b')][_0x90f0('0x41')]){_0x3f29ef[_0x90f0('0x42')](createMessage(_0x5ea8f4,_0x47d627,_0x48414f,_0x1ab5b1[_0x90f0('0x2b')][_0x90f0('0x41')]));}}return Promise['all'](_0x3f29ef)[_0x90f0('0xc')](function(){if(_0x3ba925){_0x3995a5[_0x90f0('0x15')]();}else{_0x3995a5['stop']();}})[_0x90f0('0xf')](function(_0x599d86){logger['error'](_0x90f0('0xe'),_0x5ea8f4,JSON['stringify'](_0x599d86));_0x3995a5['next']();});}})[_0x90f0('0xf')](function(_0x5f2c37){logger[_0x90f0('0x10')](_0x90f0('0xe'),_0x5ea8f4,_0x5f2c37[_0x90f0('0x27')]);_0x3995a5[_0x90f0('0x15')]();});}}catch(_0x5c36da){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x5ea8f4,JSON[_0x90f0('0x11')](_0x5c36da));_0x3995a5[_0x90f0('0x25')]();}};};
\ No newline at end of file
+var _0xd983=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','created','isEmpty','Message','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','all','lodash','dialogflow','md5','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','UserId'];(function(_0x11d437,_0x5e4d10){var _0x16afe3=function(_0x5e825e){while(--_0x5e825e){_0x11d437['push'](_0x11d437['shift']());}};_0x16afe3(++_0x5e4d10);}(_0xd983,0x7d));var _0x3d98=function(_0x1bd244,_0xb344c1){_0x1bd244=_0x1bd244-0x0;var _0x45b3cb=_0xd983[_0x1bd244];return _0x45b3cb;};'use strict';var _=require(_0x3d98('0x0'));var dialogflow=require(_0x3d98('0x1'));var md5=require(_0x3d98('0x2'));var moment=require('moment');var Promise=require(_0x3d98('0x3'));var logger=require(_0x3d98('0x4'))(_0x3d98('0x5'));var utils=require(_0x3d98('0x6'));var rpc={'chatMessage':require(_0x3d98('0x7')),'openchannelMessage':require(_0x3d98('0x8')),'mailMessage':require(_0x3d98('0x9')),'smsMessage':require(_0x3d98('0xa')),'faxMessage':require(_0x3d98('0xb')),'whatsappMessage':require(_0x3d98('0xc'))};function createMessage(_0x27df6e,_0x199aba,_0x2ee957,_0x5b4af0){return new Promise(function(_0x395656,_0x29ead6){var _0x55781e=_[_0x3d98('0xd')](_0x2ee957);_0x55781e[_0x3d98('0xe')]=_0x5b4af0;return rpc[_0x199aba+'Message'][_0x3d98('0xf')](_0x55781e)[_0x3d98('0x10')](function(){logger[_0x3d98('0x11')](_0x3d98('0x12'),_0x27df6e,_0x55781e[_0x3d98('0xe')]);_0x395656();})[_0x3d98('0x13')](function(_0x4d5ce4){logger[_0x3d98('0x14')]('[%s][DIALOGFLOWV2]\x20%s',_0x27df6e,JSON[_0x3d98('0x15')](_0x4d5ce4));_0x29ead6(_0x4d5ce4);});});}exports[_0x3d98('0x16')]=function(_0x930427,_0xcf4025){return function(_0x5a4e7f){try{if(!_[_0x3d98('0x17')](this['interaction'][_0x3d98('0x18')])){logger['info'](_0x3d98('0x12'),_0x930427,_0x3d98('0x19'));return _0x5a4e7f[_0x3d98('0x1a')]();}var _0xd9bea7={'ContactId':this[_0x3d98('0x1b')]['id'],'sentAt':moment()[_0x3d98('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x3d98('0x1d')};if(this[_0x3d98('0x1e')]===_0x3d98('0x1f')||this['channel']===_0x3d98('0x20')){_0xd9bea7[_0x3d98('0x21')]=this['interaction']['phone'];}var _0xc001ce=this['channel'];if(_0xc001ce===_0x3d98('0x22')){_0xd9bea7[_0x3d98('0x23')]=this[_0x3d98('0x24')]['id'];}else{_0xd9bea7[_[_0x3d98('0x25')](_0xc001ce)+_0x3d98('0x26')]=this['account']['id'];}_0xd9bea7[_[_0x3d98('0x25')](_0xc001ce)+_0x3d98('0x27')]=this[_0x3d98('0x28')]['id'];if(this['interaction'][_0x3d98('0x29')]){var _0x4f6e64=_0xcf4025[0x4];if(!_[_0x3d98('0x2a')](_0x4f6e64)){_0xd9bea7[_0x3d98('0xe')]=utils['getMustacheRender'](_0x4f6e64,this);return rpc[_0xc001ce+_0x3d98('0x2b')][_0x3d98('0xf')](_0xd9bea7)['then'](function(_0x84fc59){logger[_0x3d98('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x930427,_0xd9bea7[_0x3d98('0xe')]);})['catch'](function(_0x324690){logger[_0x3d98('0x14')](_0x3d98('0x12'),_0x930427,JSON['stringify'](_0x324690));})[_0x3d98('0x2c')](function(){logger[_0x3d98('0x11')](_0x3d98('0x2d'),_0x930427);_0x5a4e7f[_0x3d98('0x2e')]();});}else{logger[_0x3d98('0x11')](_0x3d98('0x2f'),_0x930427);_0x5a4e7f['stop']();}}else{var _0x306400=this;var _0x3dc524=_0xcf4025[0x2][_0x3d98('0x30')](/\\n/g,'\x0a');var _0x32ac39={'credentials':{'private_key':_0x3dc524,'client_email':_0xcf4025[0x1]}};var _0x20ee0a=new dialogflow[(_0x3d98('0x31'))](_0x32ac39);var _0x5469be=_0x20ee0a[_0x3d98('0x32')](_0xcf4025[0x0],md5(_0x306400[_0x3d98('0x28')]['id']));var _0x10d116={'session':_0x5469be,'queryInput':{'text':{'text':_0x306400[_0x3d98('0x33')][_0x3d98('0xe')],'languageCode':_0xcf4025[0x3]||'en'}}};return _0x20ee0a[_0x3d98('0x34')](_0x10d116)[_0x3d98('0x10')](function(_0x5f3969){if(_0x5f3969&&_0x5f3969[_0x3d98('0x35')]){_0x306400['body'][_0x3d98('0x36')]=_0x5f3969;var _0xc16247=_0x5f3969[0x0];var _0xcec8df=_0xc16247[_0x3d98('0x37')][_0x3d98('0x38')]&&_0xc16247[_0x3d98('0x37')][_0x3d98('0x38')][_0x3d98('0x39')]?_0xc16247[_0x3d98('0x37')][_0x3d98('0x38')][_0x3d98('0x39')][_0x3d98('0x3a')][_0x3d98('0x3b')]:![];_0x306400[_0x3d98('0xe')]['DIALOGFLOWV2_ACTION']=_0xc16247[_0x3d98('0x37')]['action'];_0x306400[_0x3d98('0xe')][_0x3d98('0x3c')]=_0xc16247[_0x3d98('0x37')][_0x3d98('0x3d')];_0x306400[_0x3d98('0xe')][_0x3d98('0x3e')]=_0xc16247[_0x3d98('0x37')]['diagnosticInfo']&&_0xc16247[_0x3d98('0x37')][_0x3d98('0x38')][_0x3d98('0x39')]?_0xc16247['queryResult'][_0x3d98('0x38')][_0x3d98('0x39')][_0x3d98('0x3a')][_0x3d98('0x3b')]:![];_0x306400[_0x3d98('0xe')][_0x3d98('0x3f')]=_0xc16247[_0x3d98('0x37')][_0x3d98('0x40')][_0x3d98('0x41')];_0x306400['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0xc16247[_0x3d98('0x37')][_0x3d98('0x40')]['displayName'];_0x306400[_0x3d98('0xe')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0xc16247[_0x3d98('0x37')][_0x3d98('0x40')][_0x3d98('0x42')];_0x306400['body'][_0x3d98('0x43')]=_0xc16247['queryResult'][_0x3d98('0x44')];_0x306400['body'][_0x3d98('0x45')]=_0xc16247[_0x3d98('0x37')]['queryText'];_0x306400['body'][_0x3d98('0x46')]=_0xc16247[_0x3d98('0x37')][_0x3d98('0x47')];_0xd9bea7[_0x3d98('0x48')]=_0x3d98('0x36');_0xd9bea7[_0x3d98('0x49')]=JSON[_0x3d98('0x15')](_0x5f3969);var _0x3ea62e=[];for(var _0x2ce389=0x0;_0x2ce389<_0x5f3969[_0x3d98('0x35')];_0x2ce389++){var _0x4214c1=_0x5f3969[_0x2ce389];if(_0x4214c1&&_0x4214c1[_0x3d98('0x37')]&&_0x4214c1['queryResult']['fulfillmentText']){_0x3ea62e['push'](createMessage(_0x930427,_0xc001ce,_0xd9bea7,_0x4214c1['queryResult']['fulfillmentText']));}}return Promise[_0x3d98('0x4a')](_0x3ea62e)[_0x3d98('0x10')](function(){if(_0xcec8df){_0x5a4e7f[_0x3d98('0x1a')]();}else{_0x5a4e7f['stop']();}})[_0x3d98('0x13')](function(_0x3dfc91){logger[_0x3d98('0x14')]('[%s][DIALOGFLOWV2]\x20%s',_0x930427,JSON[_0x3d98('0x15')](_0x3dfc91));_0x5a4e7f[_0x3d98('0x1a')]();});}})['catch'](function(_0x5d8bed){logger[_0x3d98('0x14')](_0x3d98('0x12'),_0x930427,_0x5d8bed[_0x3d98('0x33')]);_0x5a4e7f['next']();});}}catch(_0x4deadd){logger[_0x3d98('0x14')](_0x3d98('0x12'),_0x930427,JSON[_0x3d98('0x15')](_0x4deadd));_0x5a4e7f[_0x3d98('0x2e')]();}};};
\ No newline at end of file
index 4962756..c9475f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe493=['error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','html-to-text','./utils','../../../../config/logger','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','validate','length'];(function(_0xc75e69,_0x19ac94){var _0x447f25=function(_0x25125c){while(--_0x25125c){_0xc75e69['push'](_0xc75e69['shift']());}};_0x447f25(++_0x19ac94);}(_0xe493,0x134));var _0x3e49=function(_0xd44879,_0x300a44){_0xd44879=_0xd44879-0x0;var _0x303677=_0xe493[_0xd44879];return _0x303677;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0x3e49('0x0'));var utils=require(_0x3e49('0x1'));var logger=require(_0x3e49('0x2'))('routing');var gotoif=schema({'condition':{'type':_0x3e49('0x3'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x3e49('0x4'),'message':_0x3e49('0x5')},'priorityFalse':{'type':'number','message':_0x3e49('0x6')}});exports[_0x3e49('0x7')]=function(_0x308f0c,_0x3c54e7){return function(_0x5d0e4d){try{var _0x54fe69={'condition':htmlToText[_0x3e49('0x8')](utils['getMustacheRender'](_0x3c54e7[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3c54e7[0x1],'priorityFalse':_0x3c54e7[0x2]};var _0x26d81b=gotoif[_0x3e49('0x9')](_0x54fe69,{'typecast':!![]});if(_0x26d81b[_0x3e49('0xa')]){logger[_0x3e49('0xb')](_0x3e49('0xc'),_0x308f0c,_[_0x3e49('0xd')](_0x26d81b,_0x3e49('0xe'))[_0x3e49('0xf')](',\x20'));_0x5d0e4d[_0x3e49('0x10')]();}else{try{var _0x24f89e=eval('('+_0x54fe69[_0x3e49('0x11')]+')');var _0x130811=_0x24f89e?_0x54fe69[_0x3e49('0x12')]:_0x54fe69[_0x3e49('0x13')];logger[_0x3e49('0x14')](_0x3e49('0x15'),_0x308f0c,_0x54fe69[_0x3e49('0x11')],_0x24f89e,_0x130811||_0x3e49('0x16'));if(_0x130811){var _0x2e02a3=_[_0x3e49('0x17')](_0x5d0e4d[_0x3e49('0x18')](),{'p':_0x130811});if(_0x2e02a3>=0x0){logger[_0x3e49('0x14')](_0x3e49('0x19'),_0x308f0c,_0x130811||'next',_0x2e02a3);_0x5d0e4d[_0x3e49('0x16')](_0x2e02a3);}else{logger[_0x3e49('0x14')](_0x3e49('0x1a'),_0x308f0c,_0x130811||_0x3e49('0x16'));_0x5d0e4d[_0x3e49('0x10')]();}}else{_0x5d0e4d[_0x3e49('0x16')]();}}catch(_0x2c938c){logger[_0x3e49('0xb')](_0x3e49('0x1b'),_0x308f0c,_0x2c938c[_0x3e49('0xe')]);_0x5d0e4d['stop']();}}}catch(_0x2347f8){logger['error'](_0x3e49('0xc'),_0x308f0c,JSON[_0x3e49('0x1c')](_0x2347f8));_0x5d0e4d[_0x3e49('0x10')]();}};};
\ No newline at end of file
+var _0xbe0a=['message','stop','condition','priorityTrue','priorityFalse','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','validate','length','error','[%s][GOTOIF]\x20%s','map'];(function(_0x43f433,_0x589de1){var _0x19f2f4=function(_0x26dda7){while(--_0x26dda7){_0x43f433['push'](_0x43f433['shift']());}};_0x19f2f4(++_0x589de1);}(_0xbe0a,0xb3));var _0xabe0=function(_0x100d40,_0x134226){_0x100d40=_0x100d40-0x0;var _0xeb96f2=_0xbe0a[_0x100d40];return _0xeb96f2;};'use strict';var schema=require('validate');var _=require(_0xabe0('0x0'));var htmlToText=require(_0xabe0('0x1'));var utils=require(_0xabe0('0x2'));var logger=require(_0xabe0('0x3'))(_0xabe0('0x4'));var gotoif=schema({'condition':{'type':_0xabe0('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xabe0('0x6'),'message':_0xabe0('0x7')},'priorityFalse':{'type':_0xabe0('0x6'),'message':_0xabe0('0x8')}});exports[_0xabe0('0x9')]=function(_0x95e7b4,_0x5f1380){return function(_0x3330a7){try{var _0x21a982={'condition':htmlToText['fromString'](utils[_0xabe0('0xa')](_0x5f1380[0x0],this),{'wordwrap':![]})[_0xabe0('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5f1380[0x1],'priorityFalse':_0x5f1380[0x2]};var _0x5ad901=gotoif[_0xabe0('0xc')](_0x21a982,{'typecast':!![]});if(_0x5ad901[_0xabe0('0xd')]){logger[_0xabe0('0xe')](_0xabe0('0xf'),_0x95e7b4,_[_0xabe0('0x10')](_0x5ad901,_0xabe0('0x11'))['join'](',\x20'));_0x3330a7[_0xabe0('0x12')]();}else{try{var _0xd60ef9=eval('('+_0x21a982[_0xabe0('0x13')]+')');var _0xed6f74=_0xd60ef9?_0x21a982[_0xabe0('0x14')]:_0x21a982[_0xabe0('0x15')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x95e7b4,_0x21a982[_0xabe0('0x13')],_0xd60ef9,_0xed6f74||_0xabe0('0x16'));if(_0xed6f74){var _0x49040a=_[_0xabe0('0x17')](_0x3330a7[_0xabe0('0x18')](),{'p':_0xed6f74});if(_0x49040a>=0x0){logger[_0xabe0('0x19')](_0xabe0('0x1a'),_0x95e7b4,_0xed6f74||_0xabe0('0x16'),_0x49040a);_0x3330a7[_0xabe0('0x16')](_0x49040a);}else{logger[_0xabe0('0x19')](_0xabe0('0x1b'),_0x95e7b4,_0xed6f74||'next');_0x3330a7['stop']();}}else{_0x3330a7[_0xabe0('0x16')]();}}catch(_0x3db1d1){logger[_0xabe0('0xe')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x95e7b4,_0x3db1d1[_0xabe0('0x11')]);_0x3330a7['stop']();}}}catch(_0x3ace4){logger['error']('[%s][GOTOIF]\x20%s',_0x95e7b4,JSON['stringify'](_0x3ace4));_0x3330a7[_0xabe0('0x12')]();}};};
\ No newline at end of file
index 712af76..b8e927e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e6a=['length','error','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence'];(function(_0x58341d,_0x214345){var _0x5bc3e1=function(_0x2e50ed){while(--_0x2e50ed){_0x58341d['push'](_0x58341d['shift']());}};_0x5bc3e1(++_0x214345);}(_0x9e6a,0xa2));var _0xa9e6=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0x9e6a[_0x26b5ff];return _0x58603e;};'use strict';var schema=require(_0xa9e6('0x0'));var _=require('lodash');var logger=require(_0xa9e6('0x1'))(_0xa9e6('0x2'));var gotop=schema({'priority':{'type':_0xa9e6('0x3'),'required':!![],'message':_0xa9e6('0x4')}});exports[_0xa9e6('0x5')]=function(_0x54a856,_0x2e86a6){return function(_0x35a3d1){try{var _0xf94a6={'priority':_0x2e86a6[0x0]};var _0xca1a67=gotop[_0xa9e6('0x0')](_0xf94a6,{'typecast':!![]});if(_0xca1a67[_0xa9e6('0x6')]){logger[_0xa9e6('0x7')]('[%s][GOTOP]\x20%s',_0x54a856,_[_0xa9e6('0x8')](_0xca1a67,_0xa9e6('0x9'))['join'](',\x20'));_0x35a3d1[_0xa9e6('0xa')]();}else{logger[_0xa9e6('0xb')](_0xa9e6('0xc'),_0x54a856,_0xf94a6[_0xa9e6('0xd')]);if(_0xf94a6[_0xa9e6('0xd')]){var _0x2e7419=_[_0xa9e6('0xe')](_0x35a3d1[_0xa9e6('0xf')](),{'p':_0xf94a6[_0xa9e6('0xd')]});if(_0x2e7419>=0x0){logger[_0xa9e6('0xb')](_0xa9e6('0x10'),_0x54a856,_0xf94a6['priority']||_0xa9e6('0x11'),_0x2e7419);_0x35a3d1[_0xa9e6('0x11')](_0x2e7419);}else{logger[_0xa9e6('0xb')](_0xa9e6('0x12'),_0x54a856,_0xf94a6[_0xa9e6('0xd')]||_0xa9e6('0x11'));_0x35a3d1['stop']();}}else{_0x35a3d1[_0xa9e6('0x11')]();}}}catch(_0x3e36cc){logger[_0xa9e6('0x7')](_0xa9e6('0x13'),_0x54a856,JSON[_0xa9e6('0x14')](_0x3e36cc));_0x35a3d1[_0xa9e6('0xa')]();}};};
\ No newline at end of file
+var _0x86bb=['priority','findIndex','next','info','stringify','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','message','stop','[%s][GOTOP]\x20priority\x20%s'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x86bb,0x175));var _0xb86b=function(_0x5d672b,_0x28f0e4){_0x5d672b=_0x5d672b-0x0;var _0x3268fc=_0x86bb[_0x5d672b];return _0x3268fc;};'use strict';var schema=require(_0xb86b('0x0'));var _=require(_0xb86b('0x1'));var logger=require(_0xb86b('0x2'))(_0xb86b('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xb86b('0x4')}});exports['consequence']=function(_0x5a9a8d,_0x37a636){return function(_0x177b69){try{var _0x1b5612={'priority':_0x37a636[0x0]};var _0x19006f=gotop[_0xb86b('0x0')](_0x1b5612,{'typecast':!![]});if(_0x19006f[_0xb86b('0x5')]){logger[_0xb86b('0x6')](_0xb86b('0x7'),_0x5a9a8d,_['map'](_0x19006f,_0xb86b('0x8'))['join'](',\x20'));_0x177b69[_0xb86b('0x9')]();}else{logger['info'](_0xb86b('0xa'),_0x5a9a8d,_0x1b5612[_0xb86b('0xb')]);if(_0x1b5612[_0xb86b('0xb')]){var _0xfd9f21=_[_0xb86b('0xc')](_0x177b69['rules'](),{'p':_0x1b5612[_0xb86b('0xb')]});if(_0xfd9f21>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x5a9a8d,_0x1b5612[_0xb86b('0xb')]||_0xb86b('0xd'),_0xfd9f21);_0x177b69[_0xb86b('0xd')](_0xfd9f21);}else{logger[_0xb86b('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x5a9a8d,_0x1b5612[_0xb86b('0xb')]||_0xb86b('0xd'));_0x177b69[_0xb86b('0x9')]();}}else{_0x177b69[_0xb86b('0xd')]();}}}catch(_0x134b1f){logger['error'](_0xb86b('0x7'),_0x5a9a8d,JSON[_0xb86b('0xf')](_0x134b1f));_0x177b69['stop']();}};};
\ No newline at end of file
index 3b0bde7..8a4a64d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49a1=['lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','contact','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x49a1,0x190));var _0x149a=function(_0x46dc08,_0x398f4b){_0x46dc08=_0x46dc08-0x0;var _0x3f067e=_0x49a1[_0x46dc08];return _0x3f067e;};'use strict';var _=require(_0x149a('0x0'));var utils=require(_0x149a('0x1'));var logger=require(_0x149a('0x2'))(_0x149a('0x3'));var rpc={'chatMessage':require(_0x149a('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x149a('0x5')),'whatsappMessage':require(_0x149a('0x6'))};exports['consequence']=function(_0x14a0a0,_0x25e18e){return function(_0x5b4b37){try{var _0x872ee2={'body':utils['getMustacheRender'](_0x25e18e[0x0],this),'ContactId':this[_0x149a('0x7')]['id']};if(this[_0x149a('0x8')]==='chat'){_0x872ee2[_0x149a('0x9')]=this[_0x149a('0xa')]['id'];}else{_0x872ee2[_[_0x149a('0xb')](this[_0x149a('0x8')])+_0x149a('0xc')]=this[_0x149a('0xa')]['id'];}_0x872ee2[_['upperFirst'](this['channel'])+_0x149a('0xd')]=this[_0x149a('0xe')]['id'];if(rpc[this[_0x149a('0x8')]+_0x149a('0xf')]){return rpc[this[_0x149a('0x8')]+_0x149a('0xf')][_0x149a('0x10')](_0x872ee2)['then'](function(_0x5ddccb){logger[_0x149a('0x11')]('[%s][MESSAGE]\x20%s',_0x14a0a0,_0x872ee2[_0x149a('0x12')]);_0x5b4b37[_0x149a('0x13')]();})[_0x149a('0x14')](function(_0x3a9b6b){logger[_0x149a('0x15')](_0x149a('0x16'),_0x14a0a0,JSON[_0x149a('0x17')](_0x3a9b6b));_0x5b4b37[_0x149a('0x18')]();});}}catch(_0x2b84ae){logger[_0x149a('0x15')]('[%s][MESSAGE]\x20%s',_0x14a0a0,JSON[_0x149a('0x17')](_0x2b84ae));_0x5b4b37[_0x149a('0x18')]();}};};
\ No newline at end of file
+var _0x263f=['then','info','[%s][MESSAGE]\x20%s','body','next','stringify','stop','error','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','account','upperFirst','AccountId','interaction','Message','create'];(function(_0x29d303,_0x33a088){var _0x3c6e70=function(_0x300a42){while(--_0x300a42){_0x29d303['push'](_0x29d303['shift']());}};_0x3c6e70(++_0x33a088);}(_0x263f,0x182));var _0xf263=function(_0x4a0b2f,_0x1ad799){_0x4a0b2f=_0x4a0b2f-0x0;var _0x2839e3=_0x263f[_0x4a0b2f];return _0x2839e3;};'use strict';var _=require(_0xf263('0x0'));var utils=require(_0xf263('0x1'));var logger=require(_0xf263('0x2'))(_0xf263('0x3'));var rpc={'chatMessage':require(_0xf263('0x4')),'openchannelMessage':require(_0xf263('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xf263('0x6')),'faxMessage':require(_0xf263('0x7')),'whatsappMessage':require(_0xf263('0x8'))};exports['consequence']=function(_0xbd1369,_0xdb2fc1){return function(_0x4c7ab2){try{var _0x4fded6={'body':utils[_0xf263('0x9')](_0xdb2fc1[0x0],this),'ContactId':this[_0xf263('0xa')]['id']};if(this[_0xf263('0xb')]===_0xf263('0xc')){_0x4fded6['ChatWebsiteId']=this[_0xf263('0xd')]['id'];}else{_0x4fded6[_[_0xf263('0xe')](this[_0xf263('0xb')])+_0xf263('0xf')]=this[_0xf263('0xd')]['id'];}_0x4fded6[_[_0xf263('0xe')](this[_0xf263('0xb')])+'InteractionId']=this[_0xf263('0x10')]['id'];if(rpc[this['channel']+_0xf263('0x11')]){return rpc[this['channel']+'Message'][_0xf263('0x12')](_0x4fded6)[_0xf263('0x13')](function(_0x17471d){logger[_0xf263('0x14')](_0xf263('0x15'),_0xbd1369,_0x4fded6[_0xf263('0x16')]);_0x4c7ab2[_0xf263('0x17')]();})['catch'](function(_0x2f40d8){logger['error'](_0xf263('0x15'),_0xbd1369,JSON[_0xf263('0x18')](_0x2f40d8));_0x4c7ab2[_0xf263('0x19')]();});}}catch(_0x402739){logger[_0xf263('0x1a')](_0xf263('0x15'),_0xbd1369,JSON[_0xf263('0x18')](_0x402739));_0x4c7ab2['stop']();}};};
\ No newline at end of file
index 71b2b72..3959f7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcb4=['error','stringify','./utils','../../../../config/logger','routing','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x4f7384,_0x5e157c){var _0x41c281=function(_0x276147){while(--_0x276147){_0x4f7384['push'](_0x4f7384['shift']());}};_0x41c281(++_0x5e157c);}(_0xbcb4,0x92));var _0x4bcb=function(_0x41ecb8,_0x16f1e4){_0x41ecb8=_0x41ecb8-0x0;var _0xfd0d1c=_0xbcb4[_0x41ecb8];return _0xfd0d1c;};'use strict';var utils=require(_0x4bcb('0x0'));var logger=require(_0x4bcb('0x1'))(_0x4bcb('0x2'));exports['consequence']=function(_0x36c418,_0x2bfb01){return function(_0x56e951){try{logger[_0x4bcb('0x3')](_0x4bcb('0x4'),_0x36c418,utils[_0x4bcb('0x5')](_0x2bfb01[0x0],this));_0x56e951[_0x4bcb('0x6')]();}catch(_0x5f362e){logger[_0x4bcb('0x7')](_0x4bcb('0x4'),_0x36c418,JSON[_0x4bcb('0x8')](_0x5f362e));_0x56e951['stop']();}};};
\ No newline at end of file
+var _0xbcd3=['info','next','error','[%s][NOOP]\x20%s','stringify','stop','./utils','routing','consequence'];(function(_0xfd49ed,_0x1272e1){var _0x355f54=function(_0x3fc70f){while(--_0x3fc70f){_0xfd49ed['push'](_0xfd49ed['shift']());}};_0x355f54(++_0x1272e1);}(_0xbcd3,0x138));var _0x3bcd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbcd3[_0x19e35c];return _0x3e1fe8;};'use strict';var utils=require(_0x3bcd('0x0'));var logger=require('../../../../config/logger')(_0x3bcd('0x1'));exports[_0x3bcd('0x2')]=function(_0x20473b,_0x50095c){return function(_0xc47344){try{logger[_0x3bcd('0x3')]('[%s][NOOP]\x20%s',_0x20473b,utils['getMustacheRender'](_0x50095c[0x0],this));_0xc47344[_0x3bcd('0x4')]();}catch(_0x22db2a){logger[_0x3bcd('0x5')](_0x3bcd('0x6'),_0x20473b,JSON[_0x3bcd('0x7')](_0x22db2a));_0xc47344[_0x3bcd('0x8')]();}};};
\ No newline at end of file
index fb3bc96..a7e9b1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5b9=['create','catch','error','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','toLowerCase','map','join','find','Queues','timeout','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport'];(function(_0x51268d,_0x153281){var _0xc1ff18=function(_0x27a9c5){while(--_0x27a9c5){_0x51268d['push'](_0x51268d['shift']());}};_0xc1ff18(++_0x153281);}(_0xb5b9,0x153));var _0x9b5b=function(_0x107dfe,_0x38a569){_0x107dfe=_0x107dfe-0x0;var _0x2e2d99=_0xb5b9[_0x107dfe];return _0x2e2d99;};'use strict';var schema=require(_0x9b5b('0x0'));var _=require(_0x9b5b('0x1'));var util=require(_0x9b5b('0x2'));var seqqueue=require(_0x9b5b('0x3'));var moment=require(_0x9b5b('0x4'));var Redis=require(_0x9b5b('0x5'));var config=require(_0x9b5b('0x6'));var logger=require(_0x9b5b('0x7'))(_0x9b5b('0x8'));var strategy=require(_0x9b5b('0x9'));config[_0x9b5b('0xa')]=_['defaults'](config[_0x9b5b('0xa')],{'host':_0x9b5b('0xb'),'port':0x18eb});var io=require(_0x9b5b('0xc'))(new Redis(config[_0x9b5b('0xa')]));var attributes=['id',_0x9b5b('0xd'),_0x9b5b('0xe'),_0x9b5b('0xf'),_0x9b5b('0x10'),_0x9b5b('0x11')];function emit(_0x130417,_0x2f9b5c,_0x42f633){io['to'](_0x130417)[_0x9b5b('0x12')](_0x2f9b5c,_0x42f633);}function emitChannelQueueInteraction(_0x28223b,_0x25d0c7,_0x1ddbcf,_0x4b0b93,_0x42a79a,_0x53ceee,_0x42da21,_0x9f106c){var _0xc60df4=_[_0x9b5b('0x13')](_0x1ddbcf);_0xc60df4['queue_id']=_0x9f106c;_0xc60df4['queue']=_0x25d0c7;_0xc60df4[_0x9b5b('0xe')]=_0x4b0b93;_0xc60df4['id']=_0x42a79a;if(_0x53ceee){_0x42da21[util[_0x9b5b('0x14')](_0x9b5b('0x15'),_0x28223b)][_0x42a79a]=_['pick'](_0xc60df4,attributes);}else{delete _0x42da21[util['format'](_0x9b5b('0x15'),_0x28223b)][_0x42a79a];}emit(util[_0x9b5b('0x14')](_0x9b5b('0x16'),_0x28223b,_0x25d0c7),util[_0x9b5b('0x14')](_0x9b5b('0x17'),_0x28223b,_0x53ceee?_0x9b5b('0x18'):_0x9b5b('0x19')),_['pick'](_0xc60df4,attributes));}var rpc={'openchannelQueueReport':require(_0x9b5b('0x1a')),'mailQueueReport':require(_0x9b5b('0x1b')),'chatQueueReport':require(_0x9b5b('0x1c')),'smsQueueReport':require(_0x9b5b('0x1d')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x9b5b('0x1e'),'required':!![],'message':_0x9b5b('0x1f')},'timeout':{'type':_0x9b5b('0x20'),'message':_0x9b5b('0x21')}});function startRouting(_0x13ff97,_0x1dbd77,_0x374c21,_0x226f2d){if(_0x13ff97&&_0x1dbd77&&_0x374c21){_0x1dbd77[_0x9b5b('0x22')]+=0x1;var _0x47288a={'uniqueid':_0x13ff97,'from':_0x374c21['body']?_0x374c21[_0x9b5b('0x23')][_0x9b5b('0x10')]:'','joinAt':moment()[_0x9b5b('0x14')](_0x9b5b('0x24')),'ContactId':_0x374c21[_0x9b5b('0x25')]?_0x374c21[_0x9b5b('0x25')]['id']:null,'ListId':_0x374c21[_0x9b5b('0x26')]?_0x374c21[_0x9b5b('0x26')]['id']:null};_0x47288a[_[_0x9b5b('0x27')](_0x374c21['channel'])+_0x9b5b('0x28')]=_0x1dbd77['id']||null;_0x47288a[_[_0x9b5b('0x27')](_0x374c21['channel'])+'InteractionId']=_0x374c21['interaction']?_0x374c21['interaction']['id']:null;_0x47288a[_[_0x9b5b('0x27')](_0x374c21[_0x9b5b('0x29')])+_0x9b5b('0x2a')]=_0x374c21[_0x9b5b('0x2b')]?_0x374c21['message']['id']:null;_0x47288a[_['upperFirst'](_0x374c21['channel'])+(_0x374c21[_0x9b5b('0x29')]!==_0x9b5b('0x2c')?_0x9b5b('0x2d'):_0x9b5b('0x2e'))]=_0x374c21['account']?_0x374c21[_0x9b5b('0xe')]['id']:null;logger[_0x9b5b('0x2f')](util[_0x9b5b('0x14')](_0x9b5b('0x30'),_0x13ff97,_0x1dbd77[_0x9b5b('0x31')]));emitChannelQueueInteraction(_0x374c21[_0x9b5b('0x29')],_0x1dbd77[_0x9b5b('0x31')],_0x47288a,_0x374c21['account'][_0x9b5b('0x31')],_0x374c21[_0x9b5b('0x2b')]['id'],!![],_0x226f2d,_0x1dbd77['id']);if(rpc[_0x374c21[_0x9b5b('0x29')]+_0x9b5b('0x32')]){return rpc[_0x374c21[_0x9b5b('0x29')]+_0x9b5b('0x32')][_0x9b5b('0x33')](_0x47288a)[_0x9b5b('0x34')](function(_0x18a8d6){logger[_0x9b5b('0x35')]('create\x20queue\x20report');});}}}function stopRouting(_0x2b8999,_0x177514,_0x8a1e7,_0x49e4d1){if(_0x2b8999&&_0x177514){_0x177514[_0x9b5b('0x22')]-=0x1;var _0x1001a0={'leaveAt':moment()['format'](_0x9b5b('0x24')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x9b5b('0x2f')](util[_0x9b5b('0x14')](_0x9b5b('0x36'),_0x2b8999,_0x177514[_0x9b5b('0x31')]));emitChannelQueueInteraction(_0x8a1e7['channel'],_0x177514['name'],_0x8a1e7[_0x9b5b('0x23')],_0x8a1e7['account'][_0x9b5b('0x31')],_0x8a1e7['message']['id'],![],_0x49e4d1,_0x177514['id']);if(rpc[_0x8a1e7[_0x9b5b('0x29')]+'QueueReport']){return rpc[_0x8a1e7[_0x9b5b('0x29')]+_0x9b5b('0x32')][_0x9b5b('0x37')](_0x2b8999,_0x1001a0)['catch'](function(_0x1be474){logger[_0x9b5b('0x35')]('update\x20queue\x20report');});}}}function endRouting(_0xf4fa4e,_0x411e19,_0x4a8bee,_0xe946bf){if(_0xf4fa4e&&_0x411e19){_0x411e19[_0x9b5b('0x22')]-=0x1;var _0x2f44d0={'leaveAt':moment()['format'](_0x9b5b('0x24')),'exitAt':moment()[_0x9b5b('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x9b5b('0x2f')](util[_0x9b5b('0x14')]('[%s][END:QUEUE][NAME:%s]',_0xf4fa4e,_0x411e19[_0x9b5b('0x31')]));emitChannelQueueInteraction(_0x4a8bee[_0x9b5b('0x29')],_0x411e19[_0x9b5b('0x31')],_0x4a8bee[_0x9b5b('0x23')],_0x4a8bee[_0x9b5b('0xe')][_0x9b5b('0x31')],_0x4a8bee['message']['id'],![],_0xe946bf);if(rpc[_0x4a8bee[_0x9b5b('0x29')]+'QueueReport']){return rpc[_0x4a8bee[_0x9b5b('0x29')]+_0x9b5b('0x32')]['update'](_0xf4fa4e,_0x2f44d0)[_0x9b5b('0x34')](function(_0x361111){logger[_0x9b5b('0x35')](_0x9b5b('0x38'));});}}}function handleFindQueue(_0x57052f){return function(_0x60383){return _0x60383[_0x9b5b('0x31')]['toLowerCase']()===_0x57052f[_0x9b5b('0x39')]();};}exports['consequence']=function(_0x58aea,_0x15505b,_0x2e4171,_0x28dce9){return function(_0x128bb3){try{var _0xb3d838={'name':_0x15505b[0x0],'timeout':_0x15505b[0x1]};var _0xcee9e7=queue[_0x9b5b('0x0')](_0xb3d838,{'typecast':!![]});if(_0xcee9e7['length']){logger[_0x9b5b('0x35')]('[%s][QUEUE]\x20%s',_0x58aea,_[_0x9b5b('0x3a')](_0xcee9e7,'message')[_0x9b5b('0x3b')](',\x20'));_0x128bb3['stop']();}else{var _0x35785a=_[_0x9b5b('0x3c')](_0x2e4171[_0x28dce9['channel']+_0x9b5b('0x3d')],handleFindQueue(_0xb3d838[_0x9b5b('0x31')]));if(_0x35785a){startRouting(_0x58aea,_0x35785a,_0x28dce9,_0x2e4171);var _0x12e265=(_0x35785a[_0x9b5b('0x3e')]||0xa)*0x3e8;var _0x9e7119=(_0xb3d838[_0x9b5b('0x3e')]||0x14)*0x3e8;var _0xf9ead,_0x1b15f7;if(_0x12e265>_0x9e7119){_0x9e7119=_0x12e265;}var _0x13bc91=seqqueue[_0x9b5b('0x3f')](_0x12e265);_0x13bc91['id']=_0x58aea;_0x13bc91['atimeout']=_0x12e265;_0x13bc91[_0x9b5b('0x40')]=_0x9e7119;_0x13bc91[_0x9b5b('0x29')]=_0x28dce9[_0x9b5b('0x29')];_0x2e4171[_0x9b5b('0x41')][_0x58aea]['on'](_0x9b5b('0x42'),function(){logger[_0x9b5b('0x2f')](_0x9b5b('0x43'),_0x58aea);stopRouting(_0x58aea,_0x35785a,_0x28dce9,_0x2e4171);clearTimeout(_0xf9ead);_0xf9ead=undefined;_0x13bc91[_0x9b5b('0x44')](!![]);if(_0x2e4171['rules'][_0x58aea]){delete _0x2e4171['rules'][_0x58aea];}_0x128bb3[_0x9b5b('0x45')]();});_0x2e4171[_0x9b5b('0x41')][_0x58aea]['on'](_0x9b5b('0x46'),function(){if(_0x2e4171[_0x9b5b('0x41')][_0x58aea]){delete _0x2e4171['rules'][_0x58aea];}});_0xf9ead=setTimeout(function(){logger['info'](_0x9b5b('0x47'),_0x58aea);endRouting(_0x58aea,_0x35785a,_0x28dce9,_0x2e4171);clearTimeout(_0xf9ead);_0x13bc91['close'](!![]);_0x128bb3['next']();},_0x9e7119);switch(_0x35785a[_0x9b5b('0x48')]){case _0x9b5b('0x49'):strategy[_0x9b5b('0x49')](_0x13bc91,_0x35785a,_0x2e4171,_0x28dce9);break;default:strategy[_0x9b5b('0x4a')](_0x13bc91,_0x35785a,_0x2e4171,_0x28dce9);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x58aea,_0xb3d838[_0x9b5b('0x31')]);_0x128bb3[_0x9b5b('0x45')]();}}}catch(_0x53c6ab){console[_0x9b5b('0x4b')](_0x53c6ab);logger['error'](_0x9b5b('0x4c'),_0x58aea,_0x53c6ab[_0x9b5b('0x4d')]);_0x128bb3[_0x9b5b('0x45')]();}};};
\ No newline at end of file
+var _0xe63f=['queue','clone','queue_id','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','number','timeout\x20is\x20a\x20number','waiting','body','from','contact','list','upperFirst','channel','interaction','MessageId','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','message','QueueReport','create','catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','createQueue','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','log','stack','validate','lodash','util','seq-queue','moment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','account'];(function(_0x5d43b5,_0x3d1c74){var _0x2c5fba=function(_0x3532a8){while(--_0x3532a8){_0x5d43b5['push'](_0x5d43b5['shift']());}};_0x2c5fba(++_0x3d1c74);}(_0xe63f,0x16a));var _0xfe63=function(_0x533aaf,_0x37d6f3){_0x533aaf=_0x533aaf-0x0;var _0x586428=_0xe63f[_0x533aaf];return _0x586428;};'use strict';var schema=require(_0xfe63('0x0'));var _=require(_0xfe63('0x1'));var util=require(_0xfe63('0x2'));var seqqueue=require(_0xfe63('0x3'));var moment=require(_0xfe63('0x4'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0xfe63('0x5'))(_0xfe63('0x6'));var strategy=require(_0xfe63('0x7'));config[_0xfe63('0x8')]=_[_0xfe63('0x9')](config[_0xfe63('0x8')],{'host':_0xfe63('0xa'),'port':0x18eb});var io=require(_0xfe63('0xb'))(new Redis(config[_0xfe63('0x8')]));var attributes=['id','queue_id',_0xfe63('0xc'),_0xfe63('0xd'),'from','joinAt'];function emit(_0x242307,_0x4b0dec,_0x4e6de8){io['to'](_0x242307)['emit'](_0x4b0dec,_0x4e6de8);}function emitChannelQueueInteraction(_0x51584f,_0x200b2c,_0x29d02b,_0x6797e1,_0x2e715c,_0x467391,_0x2acc6a,_0x4b9dbc){var _0xdea627=_[_0xfe63('0xe')](_0x29d02b);_0xdea627[_0xfe63('0xf')]=_0x4b9dbc;_0xdea627[_0xfe63('0xd')]=_0x200b2c;_0xdea627[_0xfe63('0xc')]=_0x6797e1;_0xdea627['id']=_0x2e715c;if(_0x467391){_0x2acc6a[util[_0xfe63('0x10')]('%sQueuesWaitingInteractions',_0x51584f)][_0x2e715c]=_[_0xfe63('0x11')](_0xdea627,attributes);}else{delete _0x2acc6a[util[_0xfe63('0x10')](_0xfe63('0x12'),_0x51584f)][_0x2e715c];}emit(util[_0xfe63('0x10')](_0xfe63('0x13'),_0x51584f,_0x200b2c),util[_0xfe63('0x10')](_0xfe63('0x14'),_0x51584f,_0x467391?_0xfe63('0x15'):_0xfe63('0x16')),_[_0xfe63('0x11')](_0xdea627,attributes));}var rpc={'openchannelQueueReport':require(_0xfe63('0x17')),'mailQueueReport':require(_0xfe63('0x18')),'chatQueueReport':require(_0xfe63('0x19')),'smsQueueReport':require(_0xfe63('0x1a')),'faxQueueReport':require(_0xfe63('0x1b')),'whatsappQueueReport':require(_0xfe63('0x1c'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xfe63('0x1d'),'message':_0xfe63('0x1e')}});function startRouting(_0x39ec3e,_0x5980ad,_0xdb2bbe,_0x455840){if(_0x39ec3e&&_0x5980ad&&_0xdb2bbe){_0x5980ad[_0xfe63('0x1f')]+=0x1;var _0x3ceab9={'uniqueid':_0x39ec3e,'from':_0xdb2bbe[_0xfe63('0x20')]?_0xdb2bbe['body'][_0xfe63('0x21')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xdb2bbe[_0xfe63('0x22')]?_0xdb2bbe['contact']['id']:null,'ListId':_0xdb2bbe[_0xfe63('0x23')]?_0xdb2bbe[_0xfe63('0x23')]['id']:null};_0x3ceab9[_[_0xfe63('0x24')](_0xdb2bbe['channel'])+'QueueId']=_0x5980ad['id']||null;_0x3ceab9[_[_0xfe63('0x24')](_0xdb2bbe[_0xfe63('0x25')])+'InteractionId']=_0xdb2bbe[_0xfe63('0x26')]?_0xdb2bbe[_0xfe63('0x26')]['id']:null;_0x3ceab9[_[_0xfe63('0x24')](_0xdb2bbe[_0xfe63('0x25')])+_0xfe63('0x27')]=_0xdb2bbe['message']?_0xdb2bbe['message']['id']:null;_0x3ceab9[_['upperFirst'](_0xdb2bbe[_0xfe63('0x25')])+(_0xdb2bbe['channel']!==_0xfe63('0x28')?_0xfe63('0x29'):_0xfe63('0x2a'))]=_0xdb2bbe[_0xfe63('0xc')]?_0xdb2bbe[_0xfe63('0xc')]['id']:null;logger[_0xfe63('0x2b')](util[_0xfe63('0x10')](_0xfe63('0x2c'),_0x39ec3e,_0x5980ad[_0xfe63('0x2d')]));emitChannelQueueInteraction(_0xdb2bbe['channel'],_0x5980ad['name'],_0x3ceab9,_0xdb2bbe[_0xfe63('0xc')]['name'],_0xdb2bbe[_0xfe63('0x2e')]['id'],!![],_0x455840,_0x5980ad['id']);if(rpc[_0xdb2bbe['channel']+'QueueReport']){return rpc[_0xdb2bbe[_0xfe63('0x25')]+_0xfe63('0x2f')][_0xfe63('0x30')](_0x3ceab9)[_0xfe63('0x31')](function(_0x24576b){logger[_0xfe63('0x32')]('create\x20queue\x20report');});}}}function stopRouting(_0x5a812d,_0x516351,_0x37b0fa,_0x247048){if(_0x5a812d&&_0x516351){_0x516351[_0xfe63('0x1f')]-=0x1;var _0x2dd40a={'leaveAt':moment()[_0xfe63('0x10')](_0xfe63('0x33')),'acceptAt':moment()[_0xfe63('0x10')](_0xfe63('0x33')),'reason':_0xfe63('0x34')};logger['info'](util[_0xfe63('0x10')]('[%s][STOP:QUEUE][NAME:%s]',_0x5a812d,_0x516351[_0xfe63('0x2d')]));emitChannelQueueInteraction(_0x37b0fa[_0xfe63('0x25')],_0x516351[_0xfe63('0x2d')],_0x37b0fa['body'],_0x37b0fa['account'][_0xfe63('0x2d')],_0x37b0fa['message']['id'],![],_0x247048,_0x516351['id']);if(rpc[_0x37b0fa[_0xfe63('0x25')]+_0xfe63('0x2f')]){return rpc[_0x37b0fa[_0xfe63('0x25')]+_0xfe63('0x2f')]['update'](_0x5a812d,_0x2dd40a)[_0xfe63('0x31')](function(_0x4de034){logger['error'](_0xfe63('0x35'));});}}}function endRouting(_0x386584,_0x581a11,_0x719340,_0x1ed96b){if(_0x386584&&_0x581a11){_0x581a11[_0xfe63('0x1f')]-=0x1;var _0x63d50={'leaveAt':moment()['format'](_0xfe63('0x33')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xfe63('0x36')};logger[_0xfe63('0x2b')](util[_0xfe63('0x10')](_0xfe63('0x37'),_0x386584,_0x581a11[_0xfe63('0x2d')]));emitChannelQueueInteraction(_0x719340[_0xfe63('0x25')],_0x581a11['name'],_0x719340[_0xfe63('0x20')],_0x719340[_0xfe63('0xc')][_0xfe63('0x2d')],_0x719340['message']['id'],![],_0x1ed96b);if(rpc[_0x719340[_0xfe63('0x25')]+_0xfe63('0x2f')]){return rpc[_0x719340[_0xfe63('0x25')]+'QueueReport'][_0xfe63('0x38')](_0x386584,_0x63d50)[_0xfe63('0x31')](function(_0x44edb2){logger[_0xfe63('0x32')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x2c14dc){return function(_0x4c65d1){return _0x4c65d1['name'][_0xfe63('0x39')]()===_0x2c14dc[_0xfe63('0x39')]();};}exports[_0xfe63('0x3a')]=function(_0x1c95f1,_0xbbf2a5,_0x4a0582,_0x115178){return function(_0x4c26f6){try{var _0x4326f6={'name':_0xbbf2a5[0x0],'timeout':_0xbbf2a5[0x1]};var _0x369c46=queue['validate'](_0x4326f6,{'typecast':!![]});if(_0x369c46[_0xfe63('0x3b')]){logger[_0xfe63('0x32')](_0xfe63('0x3c'),_0x1c95f1,_[_0xfe63('0x3d')](_0x369c46,_0xfe63('0x2e'))[_0xfe63('0x3e')](',\x20'));_0x4c26f6[_0xfe63('0x3f')]();}else{var _0x585081=_['find'](_0x4a0582[_0x115178[_0xfe63('0x25')]+'Queues'],handleFindQueue(_0x4326f6[_0xfe63('0x2d')]));if(_0x585081){startRouting(_0x1c95f1,_0x585081,_0x115178,_0x4a0582);var _0x1d0ca1=(_0x585081[_0xfe63('0x36')]||0xa)*0x3e8;var _0x4212a7=(_0x4326f6['timeout']||0x14)*0x3e8;var _0x405852,_0x10546b;if(_0x1d0ca1>_0x4212a7){_0x4212a7=_0x1d0ca1;}var _0x2e05e7=seqqueue[_0xfe63('0x40')](_0x1d0ca1);_0x2e05e7['id']=_0x1c95f1;_0x2e05e7[_0xfe63('0x41')]=_0x1d0ca1;_0x2e05e7['qtimeout']=_0x4212a7;_0x2e05e7[_0xfe63('0x25')]=_0x115178[_0xfe63('0x25')];_0x4a0582[_0xfe63('0x42')][_0x1c95f1]['on'](_0xfe63('0x43'),function(){logger[_0xfe63('0x2b')](_0xfe63('0x44'),_0x1c95f1);stopRouting(_0x1c95f1,_0x585081,_0x115178,_0x4a0582);clearTimeout(_0x405852);_0x405852=undefined;_0x2e05e7[_0xfe63('0x45')](!![]);if(_0x4a0582[_0xfe63('0x42')][_0x1c95f1]){delete _0x4a0582['rules'][_0x1c95f1];}_0x4c26f6[_0xfe63('0x3f')]();});_0x4a0582['rules'][_0x1c95f1]['on']('complete',function(){if(_0x4a0582[_0xfe63('0x42')][_0x1c95f1]){delete _0x4a0582[_0xfe63('0x42')][_0x1c95f1];}});_0x405852=setTimeout(function(){logger['info'](_0xfe63('0x46'),_0x1c95f1);endRouting(_0x1c95f1,_0x585081,_0x115178,_0x4a0582);clearTimeout(_0x405852);_0x2e05e7[_0xfe63('0x45')](!![]);_0x4c26f6[_0xfe63('0x47')]();},_0x4212a7);switch(_0x585081[_0xfe63('0x48')]){case'rrmemory':strategy['rrmemory'](_0x2e05e7,_0x585081,_0x4a0582,_0x115178);break;default:strategy['beepall'](_0x2e05e7,_0x585081,_0x4a0582,_0x115178);}}else{logger[_0xfe63('0x32')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x1c95f1,_0x4326f6['name']);_0x4c26f6[_0xfe63('0x3f')]();}}}catch(_0x34fb7e){console[_0xfe63('0x49')](_0x34fb7e);logger[_0xfe63('0x32')](_0xfe63('0x3c'),_0x1c95f1,_0x34fb7e[_0xfe63('0x4a')]);_0x4c26f6[_0xfe63('0x3f')]();}};};
\ No newline at end of file
index f33bb79..158a84b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebf1=['realtime','push','bind','squeue','timeout','handleTimeout','drained','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','agent'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xebf1,0x170));var _0x1ebf=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xebf1[_0x1762b4];return _0x29beda;};'use strict';var _=require('lodash');var uuid=require(_0x1ebf('0x0'));var util=require(_0x1ebf('0x1'));var logger=require(_0x1ebf('0x2'))(_0x1ebf('0x3'));var Agent=function(_0x48b397,_0x238376,_0x432ecf,_0x64ec81){this[_0x1ebf('0x4')]=uuid['v4']();this['squeue']=_0x48b397;this[_0x1ebf('0x5')]=_0x238376;this[_0x1ebf('0x6')]=_0x432ecf;this[_0x1ebf('0x3')]=_0x64ec81;this['squeue'][_0x1ebf('0x7')](this['handleRun'][_0x1ebf('0x8')](this),this['handleTimeout']['bind'](this));this[_0x1ebf('0x9')]['on'](_0x1ebf('0xa'),this[_0x1ebf('0xb')][_0x1ebf('0x8')](this));this['squeue']['on'](_0x1ebf('0xc'),this[_0x1ebf('0xd')][_0x1ebf('0x8')](this));};Agent[_0x1ebf('0xe')][_0x1ebf('0x7')]=function(){this['squeue']['push'](this[_0x1ebf('0xf')]['bind'](this),this[_0x1ebf('0xb')][_0x1ebf('0x8')](this));};Agent['prototype'][_0x1ebf('0xd')]=function(){this[_0x1ebf('0xb')](!![]);};Agent[_0x1ebf('0xe')]['handleRun']=function(_0x4ea871){logger[_0x1ebf('0x10')](_0x1ebf('0x11'),this[_0x1ebf('0x9')]['id'],this[_0x1ebf('0x5')]['id']);if(_['isNil'](this[_0x1ebf('0x6')]['agents'][this[_0x1ebf('0x5')]['id']])){logger['info'](_0x1ebf('0x12'),this[_0x1ebf('0x9')]['id'],this['agent']['id']);setTimeout(this[_0x1ebf('0x7')]['bind'](this),0x3e8);}else{if(this[_0x1ebf('0x3')][_0x1ebf('0x13')]||util[_0x1ebf('0x14')](this[_0x1ebf('0x9')]['id'],this['realtime'][_0x1ebf('0x15')][this[_0x1ebf('0x5')]['id']],this['squeue']['channel'],![])){this[_0x1ebf('0x6')][_0x1ebf('0x15')][this[_0x1ebf('0x5')]['id']][_0x1ebf('0x16')]=!![];this[_0x1ebf('0x6')][_0x1ebf('0x15')][this[_0x1ebf('0x5')]['id']][_0x1ebf('0x17')]=undefined;util[_0x1ebf('0x18')](this['notificationId'],this['squeue']['id'],this[_0x1ebf('0x6')]['agents'][this['agent']['id']],null,this[_0x1ebf('0x3')]);util[_0x1ebf('0x19')](this['squeue']['id'],this[_0x1ebf('0x6')]['agents'][this['agent']['id']],_0x1ebf('0x1a')+(this[_0x1ebf('0x3')][_0x1ebf('0x13')]?_0x1ebf('0x1b'):''));}else{logger[_0x1ebf('0x10')](_0x1ebf('0x1c'),this['squeue']['id'],this[_0x1ebf('0x5')]['id']);setTimeout(this[_0x1ebf('0x7')][_0x1ebf('0x8')](this),0x3e8);}}};Agent[_0x1ebf('0xe')]['handleTimeout']=function(_0x257b3c){if(_[_0x1ebf('0x1d')](this[_0x1ebf('0x6')][_0x1ebf('0x15')][this[_0x1ebf('0x5')]['id']])){return logger[_0x1ebf('0x10')](_0x1ebf('0x12'),this['squeue']['id'],this[_0x1ebf('0x5')]['id']);}else{logger[_0x1ebf('0x10')](_0x1ebf('0x1e'),this[_0x1ebf('0x9')]['id'],this[_0x1ebf('0x5')]['id']);util['hideNotification'](this[_0x1ebf('0x4')],this['squeue']['id'],this[_0x1ebf('0x6')][_0x1ebf('0x15')][this[_0x1ebf('0x5')]['id']],null,this[_0x1ebf('0x3')]);this[_0x1ebf('0x6')]['agents'][this[_0x1ebf('0x5')]['id']][_0x1ebf('0x16')]=![];this[_0x1ebf('0x6')][_0x1ebf('0x15')][this[_0x1ebf('0x5')]['id']][_0x1ebf('0x17')]=undefined;util[_0x1ebf('0x19')](this['squeue']['id'],this[_0x1ebf('0x6')][_0x1ebf('0x15')][this['agent']['id']],_0x257b3c?_0x1ebf('0x1f'):_0x1ebf('0x20'));}if(!_0x257b3c){setTimeout(this[_0x1ebf('0x7')][_0x1ebf('0x8')](this),0x3e8);}};function agent(_0x3f31f2,_0x3949b5,_0x293f3a,_0x44c25d){return new Agent(_0x3f31f2,_0x3949b5,_0x293f3a,_0x44c25d);}module[_0x1ebf('0x21')]=agent;
\ No newline at end of file
+var _0x31d1=['isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','routing','push','handleRun','handleTimeout','bind','squeue','timeout','drained','handleDrained','prototype','info','agent'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x31d1,0xc7));var _0x131d=function(_0x2b3e08,_0x5e0581){_0x2b3e08=_0x2b3e08-0x0;var _0x54ef27=_0x31d1[_0x2b3e08];return _0x54ef27;};'use strict';var _=require(_0x131d('0x0'));var uuid=require(_0x131d('0x1'));var util=require(_0x131d('0x2'));var logger=require(_0x131d('0x3'))('routing');var Agent=function(_0x2935b2,_0x19ca28,_0x4a138e,_0x2fa61e){this[_0x131d('0x4')]=uuid['v4']();this['squeue']=_0x2935b2;this['agent']=_0x19ca28;this['realtime']=_0x4a138e;this[_0x131d('0x5')]=_0x2fa61e;this['squeue'][_0x131d('0x6')](this[_0x131d('0x7')]['bind'](this),this[_0x131d('0x8')][_0x131d('0x9')](this));this[_0x131d('0xa')]['on'](_0x131d('0xb'),this[_0x131d('0x8')][_0x131d('0x9')](this));this[_0x131d('0xa')]['on'](_0x131d('0xc'),this[_0x131d('0xd')][_0x131d('0x9')](this));};Agent[_0x131d('0xe')]['push']=function(){this[_0x131d('0xa')][_0x131d('0x6')](this[_0x131d('0x7')][_0x131d('0x9')](this),this[_0x131d('0x8')][_0x131d('0x9')](this));};Agent[_0x131d('0xe')][_0x131d('0xd')]=function(){this['handleTimeout'](!![]);};Agent[_0x131d('0xe')][_0x131d('0x7')]=function(_0xad75bc){logger[_0x131d('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x131d('0xa')]['id'],this[_0x131d('0x10')]['id']);if(_[_0x131d('0x11')](this[_0x131d('0x12')][_0x131d('0x13')][this[_0x131d('0x10')]['id']])){logger[_0x131d('0xf')](_0x131d('0x14'),this[_0x131d('0xa')]['id'],this['agent']['id']);setTimeout(this[_0x131d('0x6')][_0x131d('0x9')](this),0x3e8);}else{if(this[_0x131d('0x5')]['forcedOwnership']||util[_0x131d('0x15')](this['squeue']['id'],this[_0x131d('0x12')][_0x131d('0x13')][this[_0x131d('0x10')]['id']],this[_0x131d('0xa')][_0x131d('0x16')],![])){this[_0x131d('0x12')]['agents'][this[_0x131d('0x10')]['id']][_0x131d('0x17')]=!![];this[_0x131d('0x12')][_0x131d('0x13')][this[_0x131d('0x10')]['id']][_0x131d('0x18')]=undefined;util[_0x131d('0x19')](this[_0x131d('0x4')],this[_0x131d('0xa')]['id'],this['realtime']['agents'][this[_0x131d('0x10')]['id']],null,this[_0x131d('0x5')]);util[_0x131d('0x1a')](this[_0x131d('0xa')]['id'],this[_0x131d('0x12')][_0x131d('0x13')][this[_0x131d('0x10')]['id']],_0x131d('0x1b')+(this['routing'][_0x131d('0x1c')]?_0x131d('0x1d'):''));}else{logger[_0x131d('0xf')](_0x131d('0x1e'),this[_0x131d('0xa')]['id'],this[_0x131d('0x10')]['id']);setTimeout(this[_0x131d('0x6')][_0x131d('0x9')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x4a86f4){if(_['isNil'](this[_0x131d('0x12')]['agents'][this[_0x131d('0x10')]['id']])){return logger['info'](_0x131d('0x14'),this[_0x131d('0xa')]['id'],this['agent']['id']);}else{logger[_0x131d('0xf')](_0x131d('0x1f'),this['squeue']['id'],this[_0x131d('0x10')]['id']);util[_0x131d('0x20')](this[_0x131d('0x4')],this[_0x131d('0xa')]['id'],this[_0x131d('0x12')]['agents'][this[_0x131d('0x10')]['id']],null,this[_0x131d('0x5')]);this[_0x131d('0x12')][_0x131d('0x13')][this['agent']['id']][_0x131d('0x17')]=![];this[_0x131d('0x12')][_0x131d('0x13')][this[_0x131d('0x10')]['id']]['busyQueue']=undefined;util[_0x131d('0x1a')](this[_0x131d('0xa')]['id'],this[_0x131d('0x12')][_0x131d('0x13')][this[_0x131d('0x10')]['id']],_0x4a86f4?_0x131d('0x21'):_0x131d('0x22'));}if(!_0x4a86f4){setTimeout(this[_0x131d('0x6')][_0x131d('0x9')](this),0x3e8);}};function agent(_0xed10f8,_0x3eef62,_0x15b017,_0x3c0abd){return new Agent(_0xed10f8,_0x3eef62,_0x15b017,_0x3c0abd);}module[_0x131d('0x23')]=agent;
\ No newline at end of file
index 55088b9..6588332 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0a1=['Agents','realtime','agents','info','isAgentAvailable','writeLog','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','notificationId','STOP','exports','lodash','./util','../../../../../config/logger','routing','squeue','queue','push','handleRun','bind','timeout','drained','handleDrained','handleTimeout','prototype','isNil','length'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x16562b,_0x1edf5a){_0x16562b=_0x16562b-0x0;var _0x3b8556=_0xa0a1[_0x16562b];return _0x3b8556;};'use strict';var _=require(_0x1a0a('0x0'));var uuid=require('uuid');var util=require(_0x1a0a('0x1'));var logger=require(_0x1a0a('0x2'))(_0x1a0a('0x3'));var Beepall=function(_0x5bdfc1,_0x54b3a4,_0xeaff7a,_0x22f069){this['notificationId']=uuid['v4']();this[_0x1a0a('0x4')]=_0x5bdfc1;this[_0x1a0a('0x5')]=_0x54b3a4;this['realtime']=_0xeaff7a;this[_0x1a0a('0x3')]=_0x22f069;this[_0x1a0a('0x4')][_0x1a0a('0x6')](this[_0x1a0a('0x7')][_0x1a0a('0x8')](this),this['handleTimeout'][_0x1a0a('0x8')](this));this[_0x1a0a('0x4')]['on'](_0x1a0a('0x9'),this['handleTimeout']['bind'](this));this['squeue']['on'](_0x1a0a('0xa'),this[_0x1a0a('0xb')][_0x1a0a('0x8')](this));};Beepall['prototype'][_0x1a0a('0x6')]=function(){this['squeue'][_0x1a0a('0x6')](this[_0x1a0a('0x7')][_0x1a0a('0x8')](this),this[_0x1a0a('0xc')][_0x1a0a('0x8')](this));};Beepall[_0x1a0a('0xd')][_0x1a0a('0xb')]=function(_0x4f2b35){this[_0x1a0a('0xc')](!![]);};Beepall[_0x1a0a('0xd')][_0x1a0a('0x7')]=function(_0x26c1df){var _0xe1fd03=!![];if(!_['isNil'](this[_0x1a0a('0x5')])&&!_[_0x1a0a('0xe')](this[_0x1a0a('0x5')]['Agents'])&&this[_0x1a0a('0x5')]['Agents'][_0x1a0a('0xf')]>0x0){for(var _0x57f65d=0x0,_0x54bfbe;_0x57f65d<this[_0x1a0a('0x5')][_0x1a0a('0x10')][_0x1a0a('0xf')];_0x57f65d+=0x1){_0x54bfbe=this[_0x1a0a('0x5')]['Agents'][_0x57f65d]['id'];if(_['isNil'](this[_0x1a0a('0x11')][_0x1a0a('0x12')][_0x54bfbe])){logger[_0x1a0a('0x13')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x1a0a('0x4')]['id'],_0x54bfbe);}else{if(util[_0x1a0a('0x14')](this['squeue']['id'],this[_0x1a0a('0x11')][_0x1a0a('0x12')][_0x54bfbe],this[_0x1a0a('0x4')]['channel'],!![])){_0xe1fd03=![];util[_0x1a0a('0x15')](this[_0x1a0a('0x4')]['id'],this[_0x1a0a('0x11')]['agents'][_0x54bfbe],_0x1a0a('0x16'));this['realtime'][_0x1a0a('0x12')][_0x54bfbe][_0x1a0a('0x17')]=!![];this[_0x1a0a('0x11')][_0x1a0a('0x12')][_0x54bfbe][_0x1a0a('0x18')]=this['queue'][_0x1a0a('0x19')];util[_0x1a0a('0x1a')](this['notificationId'],this['squeue']['id'],this[_0x1a0a('0x11')][_0x1a0a('0x12')][_0x54bfbe],this[_0x1a0a('0x5')],this[_0x1a0a('0x3')]);}}}if(_0xe1fd03){logger[_0x1a0a('0x13')](_0x1a0a('0x1b'),this[_0x1a0a('0x4')]['id']);setTimeout(this[_0x1a0a('0x6')][_0x1a0a('0x8')](this),0x3e8);}}else{logger[_0x1a0a('0x13')](_0x1a0a('0x1c'),this[_0x1a0a('0x4')]['id']);setTimeout(this[_0x1a0a('0x6')][_0x1a0a('0x8')](this),0x3e8);}};Beepall[_0x1a0a('0xd')][_0x1a0a('0xc')]=function(_0x297b12){if(!_['isNil'](this[_0x1a0a('0x5')])&&!_[_0x1a0a('0xe')](this[_0x1a0a('0x5')][_0x1a0a('0x10')])){for(var _0x133bb8=0x0,_0x28ad86;_0x133bb8<this[_0x1a0a('0x5')][_0x1a0a('0x10')][_0x1a0a('0xf')];_0x133bb8+=0x1){_0x28ad86=this[_0x1a0a('0x5')]['Agents'][_0x133bb8]['id'];if(_[_0x1a0a('0xe')](this[_0x1a0a('0x11')]['agents'][_0x28ad86])){logger[_0x1a0a('0x13')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],_0x28ad86);}else{util[_0x1a0a('0x1d')](this[_0x1a0a('0x1e')],this['squeue']['id'],this[_0x1a0a('0x11')][_0x1a0a('0x12')][_0x28ad86],this[_0x1a0a('0x5')],this['routing']);util[_0x1a0a('0x15')](this[_0x1a0a('0x4')]['id'],this['realtime'][_0x1a0a('0x12')][_0x28ad86],_0x297b12?_0x1a0a('0x1f'):'TIMEOUT');this[_0x1a0a('0x11')][_0x1a0a('0x12')][_0x28ad86][_0x1a0a('0x17')]=![];this[_0x1a0a('0x11')]['agents'][_0x28ad86][_0x1a0a('0x18')]=undefined;}}}if(!_0x297b12){setTimeout(this[_0x1a0a('0x6')][_0x1a0a('0x8')](this),0x3e8);}};function beepall(_0xc2949d,_0x2c3368,_0x383ebe,_0x1a991e){return new Beepall(_0xc2949d,_0x2c3368,_0x383ebe,_0x1a991e);}module[_0x1a0a('0x20')]=beepall;
\ No newline at end of file
+var _0x3645=['./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','busy','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','STOP','busyQueue','exports','uuid'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x3645,0x154));var _0x5364=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0x3645[_0x507403];return _0x1327c;};'use strict';var _=require('lodash');var uuid=require(_0x5364('0x0'));var util=require(_0x5364('0x1'));var logger=require(_0x5364('0x2'))(_0x5364('0x3'));var Beepall=function(_0x2d71d7,_0x2f629b,_0x3c0f77,_0x5a63bf){this[_0x5364('0x4')]=uuid['v4']();this[_0x5364('0x5')]=_0x2d71d7;this[_0x5364('0x6')]=_0x2f629b;this[_0x5364('0x7')]=_0x3c0f77;this[_0x5364('0x3')]=_0x5a63bf;this[_0x5364('0x5')][_0x5364('0x8')](this[_0x5364('0x9')][_0x5364('0xa')](this),this['handleTimeout'][_0x5364('0xa')](this));this[_0x5364('0x5')]['on'](_0x5364('0xb'),this[_0x5364('0xc')][_0x5364('0xa')](this));this[_0x5364('0x5')]['on'](_0x5364('0xd'),this[_0x5364('0xe')][_0x5364('0xa')](this));};Beepall[_0x5364('0xf')][_0x5364('0x8')]=function(){this[_0x5364('0x5')][_0x5364('0x8')](this['handleRun'][_0x5364('0xa')](this),this[_0x5364('0xc')][_0x5364('0xa')](this));};Beepall[_0x5364('0xf')]['handleDrained']=function(_0x3eb7f3){this['handleTimeout'](!![]);};Beepall[_0x5364('0xf')]['handleRun']=function(_0x3ffd5d){var _0x13c7d1=!![];if(!_[_0x5364('0x10')](this[_0x5364('0x6')])&&!_[_0x5364('0x10')](this['queue']['Agents'])&&this[_0x5364('0x6')][_0x5364('0x11')][_0x5364('0x12')]>0x0){for(var _0x663326=0x0,_0x3c0958;_0x663326<this[_0x5364('0x6')][_0x5364('0x11')][_0x5364('0x12')];_0x663326+=0x1){_0x3c0958=this[_0x5364('0x6')]['Agents'][_0x663326]['id'];if(_[_0x5364('0x10')](this[_0x5364('0x7')][_0x5364('0x13')][_0x3c0958])){logger[_0x5364('0x14')](_0x5364('0x15'),this[_0x5364('0x5')]['id'],_0x3c0958);}else{if(util[_0x5364('0x16')](this[_0x5364('0x5')]['id'],this[_0x5364('0x7')][_0x5364('0x13')][_0x3c0958],this[_0x5364('0x5')]['channel'],!![])){_0x13c7d1=![];util[_0x5364('0x17')](this['squeue']['id'],this['realtime'][_0x5364('0x13')][_0x3c0958],'RINGING');this[_0x5364('0x7')][_0x5364('0x13')][_0x3c0958][_0x5364('0x18')]=!![];this[_0x5364('0x7')][_0x5364('0x13')][_0x3c0958]['busyQueue']=this[_0x5364('0x6')]['name'];util[_0x5364('0x19')](this[_0x5364('0x4')],this['squeue']['id'],this[_0x5364('0x7')][_0x5364('0x13')][_0x3c0958],this['queue'],this[_0x5364('0x3')]);}}}if(_0x13c7d1){logger[_0x5364('0x14')](_0x5364('0x1a'),this[_0x5364('0x5')]['id']);setTimeout(this['push'][_0x5364('0xa')](this),0x3e8);}}else{logger[_0x5364('0x14')](_0x5364('0x1b'),this[_0x5364('0x5')]['id']);setTimeout(this[_0x5364('0x8')][_0x5364('0xa')](this),0x3e8);}};Beepall['prototype']['handleTimeout']=function(_0x10bc5f){if(!_['isNil'](this[_0x5364('0x6')])&&!_[_0x5364('0x10')](this[_0x5364('0x6')][_0x5364('0x11')])){for(var _0xef474d=0x0,_0x5cd5d8;_0xef474d<this[_0x5364('0x6')][_0x5364('0x11')][_0x5364('0x12')];_0xef474d+=0x1){_0x5cd5d8=this[_0x5364('0x6')][_0x5364('0x11')][_0xef474d]['id'];if(_[_0x5364('0x10')](this[_0x5364('0x7')][_0x5364('0x13')][_0x5cd5d8])){logger[_0x5364('0x14')](_0x5364('0x15'),this[_0x5364('0x5')]['id'],_0x5cd5d8);}else{util['hideNotification'](this['notificationId'],this[_0x5364('0x5')]['id'],this[_0x5364('0x7')][_0x5364('0x13')][_0x5cd5d8],this['queue'],this['routing']);util[_0x5364('0x17')](this[_0x5364('0x5')]['id'],this[_0x5364('0x7')]['agents'][_0x5cd5d8],_0x10bc5f?_0x5364('0x1c'):'TIMEOUT');this[_0x5364('0x7')]['agents'][_0x5cd5d8]['busy']=![];this[_0x5364('0x7')][_0x5364('0x13')][_0x5cd5d8][_0x5364('0x1d')]=undefined;}}}if(!_0x10bc5f){setTimeout(this[_0x5364('0x8')][_0x5364('0xa')](this),0x3e8);}};function beepall(_0x5918a2,_0x5db982,_0x26e412,_0x1da4a1){return new Beepall(_0x5918a2,_0x5db982,_0x26e412,_0x1da4a1);}module[_0x5364('0x1e')]=beepall;
\ No newline at end of file
index 373c645..b2a649e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb7a=['./agent','./rrmemory'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xfb7a,0x1ed));var _0xafb7=function(_0x248bf0,_0x29a685){_0x248bf0=_0x248bf0-0x0;var _0x455c00=_0xfb7a[_0x248bf0];return _0x455c00;};'use strict';module['exports']={'rrmemory':require(_0xafb7('0x0')),'beepall':require('./beepall'),'agent':require(_0xafb7('0x1'))};
\ No newline at end of file
+var _0xff31=['./beepall','exports','./rrmemory'];(function(_0x4695ba,_0x5a7f2a){var _0x524b7d=function(_0xfc9707){while(--_0xfc9707){_0x4695ba['push'](_0x4695ba['shift']());}};_0x524b7d(++_0x5a7f2a);}(_0xff31,0x133));var _0x1ff3=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xff31[_0x1d9aa0];return _0x226868;};'use strict';module[_0x1ff3('0x0')]={'rrmemory':require(_0x1ff3('0x1')),'beepall':require(_0x1ff3('0x2')),'agent':require('./agent')};
\ No newline at end of file
index a24a7ab..e7182e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99cb=['routing','notificationId','squeue','queue','push','handleRun','handleTimeout','module','timeout','bind','drained','prototype','realtime','agents','agentId','channel','intervals','done','mapAgentsId','info','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','busy','busyQueue','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','./util'];(function(_0x4a107f,_0x53d583){var _0x58cda7=function(_0x307766){while(--_0x307766){_0x4a107f['push'](_0x4a107f['shift']());}};_0x58cda7(++_0x53d583);}(_0x99cb,0x1bd));var _0xb99c=function(_0x2bcf46,_0x3e0065){_0x2bcf46=_0x2bcf46-0x0;var _0x12fa13=_0x99cb[_0x2bcf46];return _0x12fa13;};'use strict';var rr=require('rr');var _=require(_0xb99c('0x0'));var uuid=require(_0xb99c('0x1'));var util=require(_0xb99c('0x2'));var logger=require('../../../../../config/logger')(_0xb99c('0x3'));var RRMemory=function(_0x5020ec,_0x1b9ee8,_0x266cb3,_0x5a5876){this[_0xb99c('0x4')]=uuid['v4']();this[_0xb99c('0x5')]=_0x5020ec;this[_0xb99c('0x6')]=_0x1b9ee8;this['realtime']=_0x266cb3;this['routing']=_0x5a5876;this['intervals']={};this[_0xb99c('0x5')][_0xb99c('0x7')](this[_0xb99c('0x8')]['bind'](this),this[_0xb99c('0x9')]['bind'](this),this[_0xb99c('0xa')]);this[_0xb99c('0x5')]['on'](_0xb99c('0xb'),this[_0xb99c('0x9')][_0xb99c('0xc')](this));this[_0xb99c('0x5')]['on'](_0xb99c('0xd'),this['handleDrained']['bind'](this));};RRMemory[_0xb99c('0xe')]['push']=function(){this['squeue'][_0xb99c('0x7')](this[_0xb99c('0x8')][_0xb99c('0xc')](this),this[_0xb99c('0x9')]['bind'](this));};RRMemory[_0xb99c('0xe')]['handleDrained']=function(_0x1f8ff7){this[_0xb99c('0x9')](!![]);};RRMemory[_0xb99c('0xe')]['handleCheckReject']=function(_0x513e6f){if(util['isAgentAvailable'](this[_0xb99c('0x5')]['id'],this[_0xb99c('0xf')][_0xb99c('0x10')][this[_0xb99c('0x11')]],this[_0xb99c('0x5')][_0xb99c('0x12')],!![])){logger['info']('[%s][QUEUE]\x20available\x20again\x20%s',this[_0xb99c('0x5')]['id'],this['agentId']);clearInterval(this[_0xb99c('0x13')][this[_0xb99c('0x11')]]);_0x513e6f[_0xb99c('0x14')]();setTimeout(this['push'][_0xb99c('0xc')](this),0x3e8);}};RRMemory['prototype'][_0xb99c('0x8')]=function(_0x2a7f98){this['agentId']=rr(this[_0xb99c('0x6')][_0xb99c('0x15')]);logger[_0xb99c('0x16')]('[%s][QUEUE]\x20try\x20with\x20%s',this[_0xb99c('0x5')]['id'],this[_0xb99c('0x11')]);if(_[_0xb99c('0x17')](this[_0xb99c('0xf')]['agents'][this[_0xb99c('0x11')]])){logger[_0xb99c('0x16')](_0xb99c('0x18'),this[_0xb99c('0x5')]['id'],this[_0xb99c('0x11')]);_0x2a7f98[_0xb99c('0x14')]();setTimeout(this['push'][_0xb99c('0xc')](this),0x3e8);}else{if(util[_0xb99c('0x19')](this[_0xb99c('0x5')]['id'],this[_0xb99c('0xf')][_0xb99c('0x10')][this['agentId']],this['squeue'][_0xb99c('0x12')],!![])){this[_0xb99c('0xf')]['agents'][this['agentId']][_0xb99c('0x1a')]=!![];this[_0xb99c('0xf')][_0xb99c('0x10')][this[_0xb99c('0x11')]][_0xb99c('0x1b')]=this[_0xb99c('0x6')]['name'];util['showNotification'](this[_0xb99c('0x4')],this[_0xb99c('0x5')]['id'],this['realtime'][_0xb99c('0x10')][this[_0xb99c('0x11')]],this[_0xb99c('0x6')],this[_0xb99c('0x3')]);util['writeLog'](this[_0xb99c('0x5')]['id'],this[_0xb99c('0xf')]['agents'][this[_0xb99c('0x11')]],'RINGING');this['intervals'][this[_0xb99c('0x11')]]=setInterval(this['handleCheckReject']['bind'](this,_0x2a7f98),0x3e8);}else{logger[_0xb99c('0x16')]('[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s',this[_0xb99c('0x5')]['id'],this['agentId']);_0x2a7f98[_0xb99c('0x14')]();setTimeout(this['push'][_0xb99c('0xc')](this),0x3e8);}}};RRMemory[_0xb99c('0xe')][_0xb99c('0x9')]=function(_0x479723){logger['info'](_0xb99c('0x1c'),this[_0xb99c('0x5')]['id'],this[_0xb99c('0x11')]);if(_['isNil'](this[_0xb99c('0xf')]['agents'][this[_0xb99c('0x11')]])){logger['info']('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xb99c('0x5')]['id'],this[_0xb99c('0x11')]);}else{clearInterval(this[_0xb99c('0x13')][this[_0xb99c('0x11')]]);util[_0xb99c('0x1d')](this[_0xb99c('0x4')],this[_0xb99c('0x5')]['id'],this['realtime'][_0xb99c('0x10')][this[_0xb99c('0x11')]],this[_0xb99c('0x6')],this['routing']);util['writeLog'](this['squeue']['id'],this[_0xb99c('0xf')]['agents'][this[_0xb99c('0x11')]],_0xb99c('0x1e'));this[_0xb99c('0xf')]['agents'][this[_0xb99c('0x11')]][_0xb99c('0x1a')]=![];this[_0xb99c('0xf')]['agents'][this['agentId']][_0xb99c('0x1b')]=undefined;}if(!_0x479723){setTimeout(this[_0xb99c('0x7')][_0xb99c('0xc')](this),0x3e8);}};function rrmemory(_0x339e45,_0x24718d,_0x57e3fd,_0x17c8b6){return new RRMemory(_0x339e45,_0x24718d,_0x57e3fd,_0x17c8b6);}module[_0xb99c('0x1f')]=rrmemory;
\ No newline at end of file
+var _0xf2a2=['drained','handleDrained','push','handleCheckReject','agents','info','[%s][QUEUE]\x20available\x20again\x20%s','agentId','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busyQueue','name','showNotification','writeLog','RINGING','prototype','hideNotification','TIMEOUT','uuid','./util','routing','notificationId','squeue','queue','realtime','intervals','handleRun','handleTimeout','bind','module','timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2a2,0x83));var _0x2f2a=function(_0x403265,_0x568c8a){_0x403265=_0x403265-0x0;var _0x646722=_0xf2a2[_0x403265];return _0x646722;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require(_0x2f2a('0x0'));var util=require(_0x2f2a('0x1'));var logger=require('../../../../../config/logger')(_0x2f2a('0x2'));var RRMemory=function(_0x499a85,_0x15bcac,_0x4cdaf0,_0x477e14){this[_0x2f2a('0x3')]=uuid['v4']();this[_0x2f2a('0x4')]=_0x499a85;this[_0x2f2a('0x5')]=_0x15bcac;this[_0x2f2a('0x6')]=_0x4cdaf0;this[_0x2f2a('0x2')]=_0x477e14;this[_0x2f2a('0x7')]={};this[_0x2f2a('0x4')]['push'](this[_0x2f2a('0x8')]['bind'](this),this[_0x2f2a('0x9')][_0x2f2a('0xa')](this),this[_0x2f2a('0xb')]);this['squeue']['on'](_0x2f2a('0xc'),this[_0x2f2a('0x9')][_0x2f2a('0xa')](this));this[_0x2f2a('0x4')]['on'](_0x2f2a('0xd'),this[_0x2f2a('0xe')][_0x2f2a('0xa')](this));};RRMemory['prototype'][_0x2f2a('0xf')]=function(){this['squeue'][_0x2f2a('0xf')](this['handleRun'][_0x2f2a('0xa')](this),this['handleTimeout'][_0x2f2a('0xa')](this));};RRMemory['prototype'][_0x2f2a('0xe')]=function(_0x30c71d){this[_0x2f2a('0x9')](!![]);};RRMemory['prototype'][_0x2f2a('0x10')]=function(_0x5a93f7){if(util['isAgentAvailable'](this[_0x2f2a('0x4')]['id'],this[_0x2f2a('0x6')][_0x2f2a('0x11')][this['agentId']],this[_0x2f2a('0x4')]['channel'],!![])){logger[_0x2f2a('0x12')](_0x2f2a('0x13'),this['squeue']['id'],this[_0x2f2a('0x14')]);clearInterval(this['intervals'][this['agentId']]);_0x5a93f7[_0x2f2a('0x15')]();setTimeout(this[_0x2f2a('0xf')][_0x2f2a('0xa')](this),0x3e8);}};RRMemory['prototype'][_0x2f2a('0x8')]=function(_0x5022cd){this['agentId']=rr(this[_0x2f2a('0x5')][_0x2f2a('0x16')]);logger[_0x2f2a('0x12')](_0x2f2a('0x17'),this[_0x2f2a('0x4')]['id'],this['agentId']);if(_[_0x2f2a('0x18')](this['realtime'][_0x2f2a('0x11')][this[_0x2f2a('0x14')]])){logger[_0x2f2a('0x12')](_0x2f2a('0x19'),this[_0x2f2a('0x4')]['id'],this['agentId']);_0x5022cd[_0x2f2a('0x15')]();setTimeout(this[_0x2f2a('0xf')][_0x2f2a('0xa')](this),0x3e8);}else{if(util[_0x2f2a('0x1a')](this[_0x2f2a('0x4')]['id'],this[_0x2f2a('0x6')][_0x2f2a('0x11')][this[_0x2f2a('0x14')]],this[_0x2f2a('0x4')][_0x2f2a('0x1b')],!![])){this[_0x2f2a('0x6')][_0x2f2a('0x11')][this[_0x2f2a('0x14')]]['busy']=!![];this[_0x2f2a('0x6')][_0x2f2a('0x11')][this[_0x2f2a('0x14')]][_0x2f2a('0x1c')]=this[_0x2f2a('0x5')][_0x2f2a('0x1d')];util[_0x2f2a('0x1e')](this[_0x2f2a('0x3')],this[_0x2f2a('0x4')]['id'],this[_0x2f2a('0x6')][_0x2f2a('0x11')][this['agentId']],this[_0x2f2a('0x5')],this['routing']);util[_0x2f2a('0x1f')](this[_0x2f2a('0x4')]['id'],this[_0x2f2a('0x6')][_0x2f2a('0x11')][this['agentId']],_0x2f2a('0x20'));this[_0x2f2a('0x7')][this[_0x2f2a('0x14')]]=setInterval(this[_0x2f2a('0x10')][_0x2f2a('0xa')](this,_0x5022cd),0x3e8);}else{logger[_0x2f2a('0x12')]('[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s',this[_0x2f2a('0x4')]['id'],this[_0x2f2a('0x14')]);_0x5022cd['done']();setTimeout(this[_0x2f2a('0xf')][_0x2f2a('0xa')](this),0x3e8);}}};RRMemory[_0x2f2a('0x21')][_0x2f2a('0x9')]=function(_0xd338a2){logger[_0x2f2a('0x12')]('[%s][QUEUE]\x20timeout\x20with\x20%s',this[_0x2f2a('0x4')]['id'],this[_0x2f2a('0x14')]);if(_[_0x2f2a('0x18')](this[_0x2f2a('0x6')][_0x2f2a('0x11')][this[_0x2f2a('0x14')]])){logger['info'](_0x2f2a('0x19'),this['squeue']['id'],this[_0x2f2a('0x14')]);}else{clearInterval(this[_0x2f2a('0x7')][this[_0x2f2a('0x14')]]);util[_0x2f2a('0x22')](this['notificationId'],this[_0x2f2a('0x4')]['id'],this['realtime'][_0x2f2a('0x11')][this['agentId']],this['queue'],this[_0x2f2a('0x2')]);util[_0x2f2a('0x1f')](this['squeue']['id'],this[_0x2f2a('0x6')][_0x2f2a('0x11')][this[_0x2f2a('0x14')]],_0x2f2a('0x23'));this['realtime'][_0x2f2a('0x11')][this[_0x2f2a('0x14')]]['busy']=![];this[_0x2f2a('0x6')][_0x2f2a('0x11')][this[_0x2f2a('0x14')]][_0x2f2a('0x1c')]=undefined;}if(!_0xd338a2){setTimeout(this[_0x2f2a('0xf')][_0x2f2a('0xa')](this),0x3e8);}};function rrmemory(_0x38d238,_0x1924d3,_0x3898c2,_0x7a67af){return new RRMemory(_0x38d238,_0x1924d3,_0x3898c2,_0x7a67af);}module['exports']=rrmemory;
\ No newline at end of file
index 647ed1d..fcb1c8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x583c=['BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash','util','../utils','mustache','../../../../../config/environment','../../../../../config/logger','defaults','redis','socket.io-emitter','emit','format','name','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]'];(function(_0x4f15c6,_0x3eb56a){var _0x5cd110=function(_0x8bd15e){while(--_0x8bd15e){_0x4f15c6['push'](_0x4f15c6['shift']());}};_0x5cd110(++_0x3eb56a);}(_0x583c,0x12b));var _0xc583=function(_0x41c381,_0x1176bd){_0x41c381=_0x41c381-0x0;var _0x427981=_0x583c[_0x41c381];return _0x427981;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var utils=require(_0xc583('0x2'));var Mustache=require(_0xc583('0x3'));var Redis=require('ioredis');var config=require(_0xc583('0x4'));var logger=require(_0xc583('0x5'))('routing');config['redis']=_[_0xc583('0x6')](config[_0xc583('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xc583('0x8'))(new Redis(config[_0xc583('0x7')]));function emit(_0x2719df,_0x1dd37c,_0x48a8d4){io['to'](_0x2719df)[_0xc583('0x9')](_0x1dd37c,_0x48a8d4);}function sendNotification(_0x26cec0,_0x5b456e,_0x163ab2,_0x24ab4f,_0x25f8d3,_0xb23f07){io['to'](util[_0xc583('0xa')]('user:%s',_0x24ab4f[_0xc583('0xb')]))[_0xc583('0x9')]('user:save',_0x24ab4f);var _0x23c51a=_0xb23f07||{};var _0x2994c5=_0x163ab2['split']('.');var _0x2c2424={'uniqueid':_0x5b456e,'channel':_0x2994c5[0x0],'id':_0x2994c5[0x1],'title':_0x2994c5[0x0]+_0xc583('0xc'),'interactionId':_0x2994c5[0x2],'queue':_0x25f8d3?_0x25f8d3[_0xc583('0xb')]:null,'sound':_0x23c51a[_0xc583('0xd')][_0xc583('0xe')],'shake':_0x23c51a[_0xc583('0xd')][_0xc583('0xf')]};try{if(!_0x23c51a[_0xc583('0x10')]){_0x23c51a[_0xc583('0x10')]={};}if(_0x25f8d3){_0x23c51a['body'][_0xc583('0x11')]=_0x25f8d3;}else if(_0x23c51a['body'][_0xc583('0x11')]){delete _0x23c51a[_0xc583('0x10')]['queue'];}_0x2c2424[_0xc583('0x12')]=utils[_0xc583('0x13')](_0x23c51a['account'][_0xc583('0x14')],_0x23c51a);}catch(_0x4ca776){_0x2c2424['msg']=_0xc583('0x15');logger[_0xc583('0x16')](util[_0xc583('0xa')](_0xc583('0x17'),_0x5b456e,_0x4ca776['message']));}io['to'](util[_0xc583('0xa')]('user:%s',_0x24ab4f[_0xc583('0xb')]))[_0xc583('0x9')](util[_0xc583('0xa')](_0xc583('0x18'),_0x26cec0?_0xc583('0x19'):_0xc583('0x1a')),_0x2c2424);}function writeLog(_0x3ce81b,_0x26756c,_0x37fcd4){return logger[_0xc583('0x1b')](util[_0xc583('0xa')](_0xc583('0x1c'),_0x3ce81b,_0x26756c[_0xc583('0xb')],_0x37fcd4));}exports['isAgentAvailable']=function(_0x542256,_0x34b353,_0x3e075c,_0x8443dc){if(_0x34b353['busy']){writeLog(_0x542256,_0x34b353,_0xc583('0x1d'));return![];}if(!_0x34b353[_0xc583('0x1e')]){writeLog(_0x542256,_0x34b353,_0xc583('0x1f'));return![];}if(_0x34b353[_0x3e075c+_0xc583('0x20')]){writeLog(_0x542256,_0x34b353,_0xc583('0x21'));return![];}if(_0x8443dc&&_0x34b353['hasOwnProperty'](_0x3e075c+'Capacity')&&_0x34b353[_0xc583('0x22')](_0x3e075c+'CurrentCapacity')){if(_0x34b353[_0x3e075c+_0xc583('0x23')]>0x0&&_0x34b353[_0x3e075c+_0xc583('0x24')]>=_0x34b353[_0x3e075c+_0xc583('0x23')]){writeLog(_0x542256,_0x34b353,_0x3e075c[_0xc583('0x25')]()+_0xc583('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x2dafb4,_0x44f76a,_0x4adde3,_0x162c85,_0x483357){return sendNotification(!![],_0x2dafb4,_0x44f76a,_0x4adde3,_0x162c85,_0x483357);};exports[_0xc583('0x27')]=function(_0x8d4ecb,_0x1c80b1,_0x3ed083,_0x1b2b49,_0x19079b){return sendNotification(![],_0x8d4ecb,_0x1c80b1,_0x3ed083,_0x1b2b49,_0x19079b);};exports[_0xc583('0x28')]=writeLog;
\ No newline at end of file
+var _0xaa3f=['redis','localhost','emit','user:%s','name','user:save','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','message','format','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing'];(function(_0x4fb271,_0x391f13){var _0x3b6ccb=function(_0x4df02b){while(--_0x4df02b){_0x4fb271['push'](_0x4fb271['shift']());}};_0x3b6ccb(++_0x391f13);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x565e02,_0x2b323a){_0x565e02=_0x565e02-0x0;var _0x51f528=_0xaa3f[_0x565e02];return _0x51f528;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var utils=require(_0xfaa3('0x2'));var Mustache=require(_0xfaa3('0x3'));var Redis=require(_0xfaa3('0x4'));var config=require(_0xfaa3('0x5'));var logger=require(_0xfaa3('0x6'))(_0xfaa3('0x7'));config[_0xfaa3('0x8')]=_['defaults'](config['redis'],{'host':_0xfaa3('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfaa3('0x8')]));function emit(_0xeecce5,_0x352958,_0xbf270c){io['to'](_0xeecce5)[_0xfaa3('0xa')](_0x352958,_0xbf270c);}function sendNotification(_0x2e422d,_0xf420ec,_0x54fb06,_0x37bcd5,_0x28de66,_0x49380c){io['to'](util['format'](_0xfaa3('0xb'),_0x37bcd5[_0xfaa3('0xc')]))[_0xfaa3('0xa')](_0xfaa3('0xd'),_0x37bcd5);var _0x23e4b6=_0x49380c||{};var _0x32866b=_0x54fb06['split']('.');var _0x10ea75={'uniqueid':_0xf420ec,'channel':_0x32866b[0x0],'id':_0x32866b[0x1],'title':_0x32866b[0x0]+'\x20interaction','interactionId':_0x32866b[0x2],'queue':_0x28de66?_0x28de66[_0xfaa3('0xc')]:null,'sound':_0x23e4b6[_0xfaa3('0xe')][_0xfaa3('0xf')],'shake':_0x23e4b6['account'][_0xfaa3('0x10')]};try{if(!_0x23e4b6['body']){_0x23e4b6[_0xfaa3('0x11')]={};}if(_0x28de66){_0x23e4b6[_0xfaa3('0x11')][_0xfaa3('0x12')]=_0x28de66;}else if(_0x23e4b6[_0xfaa3('0x11')][_0xfaa3('0x12')]){delete _0x23e4b6[_0xfaa3('0x11')]['queue'];}_0x10ea75['msg']=utils[_0xfaa3('0x13')](_0x23e4b6[_0xfaa3('0xe')][_0xfaa3('0x14')],_0x23e4b6);}catch(_0xdc069d){_0x10ea75['msg']='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util['format']('[%s][QUEUE]\x20%s',_0xf420ec,_0xdc069d[_0xfaa3('0x15')]));}io['to'](util['format'](_0xfaa3('0xb'),_0x37bcd5[_0xfaa3('0xc')]))[_0xfaa3('0xa')](util[_0xfaa3('0x16')](_0xfaa3('0x17'),_0x2e422d?_0xfaa3('0x18'):_0xfaa3('0x19')),_0x10ea75);}function writeLog(_0x1ab9cc,_0x220c9e,_0x39e91e){return logger['info'](util[_0xfaa3('0x16')](_0xfaa3('0x1a'),_0x1ab9cc,_0x220c9e[_0xfaa3('0xc')],_0x39e91e));}exports[_0xfaa3('0x1b')]=function(_0x50dc4a,_0x1f7324,_0x2d4087,_0x2f077c){if(_0x1f7324[_0xfaa3('0x1c')]){writeLog(_0x50dc4a,_0x1f7324,_0xfaa3('0x1d'));return![];}if(!_0x1f7324[_0xfaa3('0x1e')]){writeLog(_0x50dc4a,_0x1f7324,_0xfaa3('0x1f'));return![];}if(_0x1f7324[_0x2d4087+_0xfaa3('0x20')]){writeLog(_0x50dc4a,_0x1f7324,'PAUSE');return![];}if(_0x2f077c&&_0x1f7324[_0xfaa3('0x21')](_0x2d4087+_0xfaa3('0x22'))&&_0x1f7324[_0xfaa3('0x21')](_0x2d4087+_0xfaa3('0x23'))){if(_0x1f7324[_0x2d4087+_0xfaa3('0x22')]>0x0&&_0x1f7324[_0x2d4087+_0xfaa3('0x23')]>=_0x1f7324[_0x2d4087+_0xfaa3('0x22')]){writeLog(_0x50dc4a,_0x1f7324,_0x2d4087[_0xfaa3('0x24')]()+_0xfaa3('0x25'));return![];}}return!![];};exports[_0xfaa3('0x26')]=function(_0x36714d,_0x7df1f3,_0x18bd3e,_0x1bc202,_0x2d7c43){return sendNotification(!![],_0x36714d,_0x7df1f3,_0x18bd3e,_0x1bc202,_0x2d7c43);};exports['hideNotification']=function(_0x230430,_0x104343,_0xc2e71,_0x54bc09,_0x289f13){return sendNotification(![],_0x230430,_0x104343,_0xc2e71,_0x54bc09,_0x289f13);};exports['writeLog']=writeLog;
\ No newline at end of file
index 7a1d0d5..1f0cb22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57af=['getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','stringify','validate','lodash','./utils','string','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','next'];(function(_0x5ec98d,_0x3e50d5){var _0x5367f5=function(_0x36db9f){while(--_0x36db9f){_0x5ec98d['push'](_0x5ec98d['shift']());}};_0x5367f5(++_0x3e50d5);}(_0x57af,0xcb));var _0xf57a=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x57af[_0x49ca18];return _0x145d54;};'use strict';var schema=require(_0xf57a('0x0'));var sh=require('shelljs');var _=require(_0xf57a('0x1'));var utils=require(_0xf57a('0x2'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0xf57a('0x3'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xf57a('0x4')]=function(_0x613cb1,_0x36d42c){return function(_0x45e8ee){try{var _0x5b9f62={'command':_0x36d42c[0x0]};var _0x4e3799=system[_0xf57a('0x0')](_0x5b9f62,{'typecast':!![]});if(_0x4e3799[_0xf57a('0x5')]){logger[_0xf57a('0x6')](_0xf57a('0x7'),_0x613cb1,_[_0xf57a('0x8')](_0x4e3799,_0xf57a('0x9'))[_0xf57a('0xa')](',\x20'));logger[_0xf57a('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x613cb1);_0x45e8ee[_0xf57a('0xc')]();}else{var _0x56b25c=this;var _0x4639dc=utils[_0xf57a('0xd')](_0x36d42c[0x0],this);logger[_0xf57a('0xb')](_0xf57a('0xe'),_0x613cb1,_0x4639dc);sh[_0xf57a('0xf')](_[_0xf57a('0x10')](_0x4639dc),function(_0x39e38f,_0x4cea16){logger[_0xf57a('0xb')](_0xf57a('0x11'),_0x613cb1,_0x39e38f);if(_0x39e38f==0x0){var _0x32ab3f=_0x4cea16[_0xf57a('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xf57a('0x13')](_0x36d42c[0x1])||_[_0xf57a('0x14')](_0x36d42c[0x1])){logger[_0xf57a('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x613cb1);_0x56b25c['body'][_0x36d42c[0x1]]=_0x32ab3f;}else{logger[_0xf57a('0xb')](_0xf57a('0x15'),_0x613cb1,_0x36d42c[0x1],_0x32ab3f);_0x56b25c[_0xf57a('0x16')][_0x36d42c[0x1]]=_0x32ab3f;}}_0x45e8ee[_0xf57a('0xc')]();});}}catch(_0x194d25){logger[_0xf57a('0x6')](_0xf57a('0x7'),_0x613cb1,_['isObject'](_0x194d25)?JSON[_0xf57a('0x17')](_0x194d25):_0x194d25);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x613cb1);_0x45e8ee['next']();}};};
\ No newline at end of file
+var _0x40dd=['body','error','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','message','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0x3d3029,_0x924e07){var _0x28a675=function(_0x39e71f){while(--_0x39e71f){_0x3d3029['push'](_0x3d3029['shift']());}};_0x28a675(++_0x924e07);}(_0x40dd,0x18d));var _0xd40d=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x40dd[_0x134c2e];return _0x2825db;};'use strict';var schema=require(_0xd40d('0x0'));var sh=require(_0xd40d('0x1'));var _=require('lodash');var utils=require(_0xd40d('0x2'));var logger=require(_0xd40d('0x3'))(_0xd40d('0x4'));var system=schema({'command':{'type':_0xd40d('0x5'),'required':!![],'message':_0xd40d('0x6')}});exports[_0xd40d('0x7')]=function(_0x2f951b,_0x2f0ba9){return function(_0x1de720){try{var _0xa8ee90={'command':_0x2f0ba9[0x0]};var _0x510923=system['validate'](_0xa8ee90,{'typecast':!![]});if(_0x510923[_0xd40d('0x8')]){logger['error'](_0xd40d('0x9'),_0x2f951b,_[_0xd40d('0xa')](_0x510923,_0xd40d('0xb'))['join'](',\x20'));logger[_0xd40d('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2f951b);_0x1de720[_0xd40d('0xd')]();}else{var _0x293609=this;var _0x35c2dd=utils[_0xd40d('0xe')](_0x2f0ba9[0x0],this);logger['info'](_0xd40d('0xf'),_0x2f951b,_0x35c2dd);sh[_0xd40d('0x10')](_[_0xd40d('0x11')](_0x35c2dd),function(_0x5314ce,_0xb9bff4){logger[_0xd40d('0xc')](_0xd40d('0x12'),_0x2f951b,_0x5314ce);if(_0x5314ce==0x0){var _0x1fd09f=_0xb9bff4['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xd40d('0x13')](_0x2f0ba9[0x1])||_[_0xd40d('0x14')](_0x2f0ba9[0x1])){logger[_0xd40d('0xc')](_0xd40d('0x15'),_0x2f951b);_0x293609['body'][_0x2f0ba9[0x1]]=_0x1fd09f;}else{logger['info'](_0xd40d('0x16'),_0x2f951b,_0x2f0ba9[0x1],_0x1fd09f);_0x293609[_0xd40d('0x17')][_0x2f0ba9[0x1]]=_0x1fd09f;}}_0x1de720['next']();});}}catch(_0xca0b48){logger[_0xd40d('0x18')]('[%s][SYSTEM]\x20%s',_0x2f951b,_[_0xd40d('0x19')](_0xca0b48)?JSON[_0xd40d('0x1a')](_0xca0b48):_0xca0b48);logger[_0xd40d('0xc')](_0xd40d('0x1b'),_0x2f951b);_0x1de720[_0xd40d('0xd')]();}};};
\ No newline at end of file
index 28f3ad6..ede3580 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x819d=['[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','message','join','info','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x819d,0x6f));var _0xd819=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x819d[_0x422905];return _0x33dc6c;};'use strict';var schema=require(_0xd819('0x0'));var _=require(_0xd819('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xd819('0x2')),'smsInteraction':require(_0xd819('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xd819('0x4')),'whatsappInteraction':require(_0xd819('0x5'))};var logger=require('../../../../config/logger')(_0xd819('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xd819('0x7')}});exports[_0xd819('0x8')]=function(_0x468400,_0x25c7f9,_0x6c1a31,_0x48f998){return function(_0x177db4){try{var _0x28baa7={'tag':_0x25c7f9[0x0]};var _0x41f01d=tag[_0xd819('0x0')](_0x28baa7,{'typecast':!![]});if(_0x41f01d[_0xd819('0x9')]){logger['error'](_0xd819('0xa'),_0x468400,_[_0xd819('0xb')](_0x41f01d,_0xd819('0xc'))[_0xd819('0xd')](',\x20'));logger[_0xd819('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x468400);_0x177db4[_0xd819('0xf')]();}else{var _0xe5f8c9={'ids':[_0x25c7f9[0x0]]};if(rpc[_0x48f998[_0xd819('0x10')]+_0xd819('0x11')]){rpc[_0x48f998[_0xd819('0x10')]+_0xd819('0x11')]['addTags'](_0x48f998[_0xd819('0x12')]['id'],_0xe5f8c9)[_0xd819('0x13')](function(_0x4d7419){logger['info'](_0xd819('0x14'),_0x468400,_0x25c7f9[0x1],_0x48f998[_0xd819('0x10')],_0x48f998['interaction']['id']);})[_0xd819('0x15')](function(_0xec5c3c){logger[_0xd819('0x16')](_0xd819('0xa'),_0x468400,JSON[_0xd819('0x17')](_0xec5c3c));logger[_0xd819('0xe')](_0xd819('0x18'),_0x468400);})[_0xd819('0x19')](function(){_0x177db4[_0xd819('0xf')]();});}}}catch(_0x4cd081){logger[_0xd819('0x16')](_0xd819('0xa'),_0x468400,_[_0xd819('0x1a')](_0x4cd081)?JSON[_0xd819('0x17')](_0x4cd081):_0x4cd081);logger['info'](_0xd819('0x18'),_0x468400);_0x177db4[_0xd819('0xf')]();}};};
\ No newline at end of file
+var _0xf98e=['lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','consequence','length','error','[%s][TAG]\x20%s','map','join','info','next','channel','addTags','interaction','then','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','validate'];(function(_0x4d0c64,_0x2d729f){var _0x132d6f=function(_0x1a3380){while(--_0x1a3380){_0x4d0c64['push'](_0x4d0c64['shift']());}};_0x132d6f(++_0x2d729f);}(_0xf98e,0x1e2));var _0xef98=function(_0x3c3b57,_0x5c6241){_0x3c3b57=_0x3c3b57-0x0;var _0x630592=_0xf98e[_0x3c3b57];return _0x630592;};'use strict';var schema=require(_0xef98('0x0'));var _=require(_0xef98('0x1'));var rpc={'chatInteraction':require(_0xef98('0x2')),'openchannelInteraction':require(_0xef98('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xef98('0x4')),'whatsappInteraction':require(_0xef98('0x5'))};var logger=require('../../../../config/logger')(_0xef98('0x6'));var tag=schema({'tag':{'type':_0xef98('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xef98('0x8')]=function(_0x528a43,_0xedc084,_0x25a1dc,_0x3f7e8e){return function(_0x24e375){try{var _0x531aa={'tag':_0xedc084[0x0]};var _0x51bf7b=tag[_0xef98('0x0')](_0x531aa,{'typecast':!![]});if(_0x51bf7b[_0xef98('0x9')]){logger[_0xef98('0xa')](_0xef98('0xb'),_0x528a43,_[_0xef98('0xc')](_0x51bf7b,'message')[_0xef98('0xd')](',\x20'));logger[_0xef98('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x528a43);_0x24e375[_0xef98('0xf')]();}else{var _0x665728={'ids':[_0xedc084[0x0]]};if(rpc[_0x3f7e8e[_0xef98('0x10')]+'Interaction']){rpc[_0x3f7e8e['channel']+'Interaction'][_0xef98('0x11')](_0x3f7e8e[_0xef98('0x12')]['id'],_0x665728)[_0xef98('0x13')](function(_0x4564a3){logger[_0xef98('0xe')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x528a43,_0xedc084[0x1],_0x3f7e8e[_0xef98('0x10')],_0x3f7e8e['interaction']['id']);})[_0xef98('0x14')](function(_0x45b727){logger[_0xef98('0xa')](_0xef98('0xb'),_0x528a43,JSON[_0xef98('0x15')](_0x45b727));logger[_0xef98('0xe')](_0xef98('0x16'),_0x528a43);})['finally'](function(){_0x24e375['next']();});}}}catch(_0x39c0e0){logger[_0xef98('0xa')](_0xef98('0xb'),_0x528a43,_['isObject'](_0x39c0e0)?JSON[_0xef98('0x15')](_0x39c0e0):_0x39c0e0);logger[_0xef98('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x528a43);_0x24e375[_0xef98('0xf')]();}};};
\ No newline at end of file
index 6291dcb..48edd56 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(_0x5b0c07,_0x59fe92){var _0x35caa9=function(_0x3e3080){while(--_0x3e3080){_0x5b0c07['push'](_0x5b0c07['shift']());}};_0x35caa9(++_0x59fe92);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x530f3f,_0x203e5d){var _0x4336d9=function(_0x37a52b){while(--_0x37a52b){_0x530f3f['push'](_0x530f3f['shift']());}};_0x4336d9(++_0x203e5d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}};
\ No newline at end of file
index 2102035..a780f20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9086=['CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','path','jayson/promise','bluebird','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','channel','interaction','isArray','applications','length','join','app','.js','autoreply','appdata','mail','push','slice','split','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','condition','./applications/','consequence','Push\x20new\x20rule','\x20|\x20','error','rules','execute','info','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','message','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','capacity'];(function(_0x473dd0,_0x2994e0){var _0x24fe79=function(_0x789251){while(--_0x789251){_0x473dd0['push'](_0x473dd0['shift']());}};_0x24fe79(++_0x2994e0);}(_0x9086,0x72));var _0x6908=function(_0x2fb87e,_0x483324){_0x2fb87e=_0x2fb87e-0x0;var _0x5de4c1=_0x9086[_0x2fb87e];return _0x5de4c1;};'use strict';var _=require('lodash');var util=require(_0x6908('0x0'));var path=require(_0x6908('0x1'));var fs=require('fs');var jayson=require(_0x6908('0x2'));var BPromise=require(_0x6908('0x3'));var uuid=require('uuid');var config=require(_0x6908('0x4'));var logger=require('../../../config/logger')(_0x6908('0x5'));var rpc={'openchannelQueueReport':require(_0x6908('0x6')),'mailQueueReport':require(_0x6908('0x7')),'chatQueueReport':require(_0x6908('0x8')),'smsQueueReport':require(_0x6908('0x9')),'faxQueueReport':require(_0x6908('0xa')),'whatsappQueueReport':require(_0x6908('0xb'))};var RuleEngine=require(_0x6908('0xc'));function getId(_0x39f77d,_0x3165b8,_0x5e9651){return util[_0x6908('0xd')](_0x6908('0xe'),_0x39f77d,_0x3165b8||0x0,_0x5e9651||0x0);}function getIntervals(_0x418ea8,_0x38fe11){var _0x38be1a=[];if(!_[_0x6908('0xf')](_0x38fe11[_0x6908('0x10')])&&!_['isNil'](_0x418ea8[_0x38fe11[_0x6908('0x10')]])&&!_['isNil'](_0x418ea8[_0x38fe11[_0x6908('0x10')]][_0x6908('0x11')])){_0x38be1a=_['map'](_0x418ea8[_0x38fe11[_0x6908('0x10')]][_0x6908('0x11')],'interval');}else if(!_[_0x6908('0xf')](_0x38fe11['interval'])){_0x38be1a=[_0x38fe11[_0x6908('0x12')]];}return _0x38be1a;}exports[_0x6908('0x13')]=function(_0x55b1ef){_0x55b1ef['rules']={};return new BPromise(function(_0x5c3c0d,_0x3889bf){var _0x165cc8={'Start':function(_0x402596){var _0x38ee58=this;return new Promise(function(_0x45322c,_0x13d243){if(_0x402596){try{var _0x155cda=[];var _0x383dea=getId(_0x402596[_0x6908('0x14')],_0x402596['message']?_0x402596['message']['id']:0x0,_0x402596[_0x6908('0x15')]?_0x402596[_0x6908('0x15')]['id']:0x0);if(_0x402596['applications']&&_[_0x6908('0x16')](_0x402596[_0x6908('0x17')])&&_0x402596[_0x6908('0x17')][_0x6908('0x18')]){for(var _0x540b75=0x0;_0x540b75<_0x402596[_0x6908('0x17')][_0x6908('0x18')];_0x540b75+=0x1){var _0x2b4e7e=_0x402596[_0x6908('0x17')][_0x540b75];if(fs['existsSync'](path[_0x6908('0x19')](__dirname,_0x6908('0x17'),_0x2b4e7e[_0x6908('0x1a')]+_0x6908('0x1b')))){var _0x465c8b=[];switch(_0x2b4e7e['app']['toLowerCase']()){case _0x6908('0x1c'):var _0x11e256=_0x2b4e7e[_0x6908('0x1d')]['split'](',');if(_0x402596[_0x6908('0x14')]===_0x6908('0x1e')){_0x465c8b[_0x6908('0x1f')](_0x11e256[0x0]);_0x465c8b['push'](_0x11e256[0x1]);_0x465c8b[_0x6908('0x1f')](_0x11e256['slice'](0x2,_0x11e256['length'])['join'](','));}else{_0x465c8b[_0x6908('0x1f')](_0x11e256[0x0]);_0x465c8b['push'](_0x11e256[_0x6908('0x20')](0x1,_0x11e256[_0x6908('0x18')])[_0x6908('0x19')](','));}break;case'dialogflow':var _0x59d4e5=_0x2b4e7e[_0x6908('0x1d')][_0x6908('0x21')](',');_0x465c8b[_0x6908('0x1f')](_0x59d4e5[0x0]);_0x465c8b[_0x6908('0x1f')](_0x59d4e5[0x1]);_0x465c8b[_0x6908('0x1f')](_0x59d4e5[_0x6908('0x20')](0x2,_0x59d4e5[_0x6908('0x18')])['join'](','));break;case _0x6908('0x22'):var _0x2d0b3d=_0x2b4e7e[_0x6908('0x1d')][_0x6908('0x21')](',');_0x465c8b[_0x6908('0x1f')](_0x2d0b3d[0x0]);_0x465c8b[_0x6908('0x1f')](_0x2d0b3d[0x1]);_0x465c8b[_0x6908('0x1f')](_0x2d0b3d[0x2]);_0x465c8b[_0x6908('0x1f')](_0x2d0b3d[0x3]);_0x465c8b[_0x6908('0x1f')](_0x2d0b3d[_0x6908('0x20')](0x4,_0x2d0b3d[_0x6908('0x18')])['join'](','));break;case _0x6908('0x23'):var _0x4296d4=_0x2b4e7e['appdata'][_0x6908('0x21')](',');_0x465c8b[_0x6908('0x1f')](_0x4296d4[0x0]);_0x465c8b['push'](_0x4296d4[0x1]);_0x465c8b['push'](_0x4296d4[0x2]);_0x465c8b[_0x6908('0x1f')](_0x4296d4[0x3]);_0x465c8b[_0x6908('0x1f')](_0x4296d4[_0x6908('0x20')](0x4,_0x4296d4[_0x6908('0x18')])[_0x6908('0x19')](','));break;case'message':_0x465c8b['push'](_0x2b4e7e['appdata']);break;case _0x6908('0x24'):_0x465c8b[_0x6908('0x1f')](_0x2b4e7e[_0x6908('0x25')]);_0x465c8b['push'](_0x2b4e7e[_0x6908('0x1d')]);break;default:_0x465c8b=_[_0x6908('0xf')](_0x2b4e7e[_0x6908('0x1d')])?[]:_0x2b4e7e['appdata'][_0x6908('0x21')](',');}var _0x2affd5={'id':util[_0x6908('0xd')](_0x6908('0x26'),_0x383dea,_0x2b4e7e['id'],_0x2b4e7e[_0x6908('0x1a')]),'condition':require('./interval')[_0x6908('0x27')](_0x383dea,getIntervals(_0x55b1ef['intervals'],_0x2b4e7e),_0x55b1ef),'consequence':require(_0x6908('0x28')+_0x2b4e7e[_0x6908('0x1a')])[_0x6908('0x29')](_0x383dea,_0x465c8b,_0x55b1ef,_0x402596),'p':_0x2b4e7e['priority']||0x0};logger['info'](_0x6908('0x2a'),_0x2affd5['id'],'on\x20interval',getIntervals(_0x55b1ef['intervals'],_0x2b4e7e)[_0x6908('0x19')](_0x6908('0x2b')));_0x155cda['push'](_0x2affd5);}else{logger[_0x6908('0x2c')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0x6908('0x17'),_0x2b4e7e[_0x6908('0x1a')]+_0x6908('0x1b')));}}_0x55b1ef[_0x6908('0x2d')][_0x383dea]=new RuleEngine(_0x155cda);_0x55b1ef[_0x6908('0x2d')][_0x383dea][_0x6908('0x2e')](_0x402596,function(_0x5b924f){logger[_0x6908('0x2f')]('Applications\x20executed',JSON[_0x6908('0x30')](_0x5b924f[_0x6908('0x31')]));if(_0x55b1ef['rules'][_0x383dea]){_0x55b1ef['rules'][_0x383dea][_0x6908('0x32')](_0x6908('0x33'));}});return _0x45322c({'code':0xc8,'message':_0x402596});}else{logger[_0x6908('0x2f')](_0x6908('0x34'));return _0x45322c({'code':0xc8,'message':_0x402596});}}catch(_0x488a13){logger[_0x6908('0x2c')](_0x488a13[_0x6908('0x35')]);return _0x13d243(_0x38ee58['error'](0x1f4,_0x488a13));}}return _0x13d243(_0x6908('0x36'));});},'AcceptMessage':function(_0x506770){var _0x15dda2=this;return new Promise(function(_0x1c74d6,_0x1829b9){if(_0x506770[_0x6908('0x37')]&&_0x506770[_0x6908('0x37')]['id']){if(_0x55b1ef['agents'][_0x506770['agent']['id']]){_0x55b1ef['agents'][_0x506770[_0x6908('0x37')]['id']]['busy']=![];_0x55b1ef[_0x6908('0x38')][_0x506770['agent']['id']][_0x6908('0x39')]=undefined;}}if(_0x506770[_0x6908('0x3a')]&&_0x506770[_0x6908('0x3a')]['id']){try{var _0x52cdd0=getId(_0x506770['channel'],_0x506770[_0x6908('0x3a')]?_0x506770[_0x6908('0x3a')]['id']:0x0,_0x506770[_0x6908('0x15')]?_0x506770[_0x6908('0x15')]['id']:0x0);if(_0x55b1ef['rules'][_0x52cdd0]){_0x55b1ef[_0x6908('0x2d')][_0x52cdd0][_0x6908('0x32')](_0x6908('0x3b'));if(rpc[_0x506770[_0x6908('0x14')]+_0x6908('0x3c')]){rpc[_0x506770['channel']+_0x6908('0x3c')][_0x6908('0x3d')](_0x52cdd0,{'UserId':_0x506770[_0x6908('0x3a')]['UserId']})[_0x6908('0x3e')](function(_0x473b88){logger[_0x6908('0x2c')](_0x6908('0x3f'));});}}return _0x1c74d6({'code':0xc8,'message':_0x506770});}catch(_0x100e82){logger[_0x6908('0x2c')](_0x100e82[_0x6908('0x35')]);return _0x1829b9(_0x15dda2[_0x6908('0x2c')](0x1f4,_0x100e82));}}logger[_0x6908('0x2c')](_0x6908('0x40'));return _0x1829b9(_0x15dda2[_0x6908('0x2c')](0x1f4,_0x6908('0x40')));});},'RejectMessage':function(_0x4a9a80){var _0x7e8584=this;return new Promise(function(_0x203a97,_0x5628ed){if(_0x4a9a80[_0x6908('0x37')]&&_0x4a9a80[_0x6908('0x37')]['id']){try{if(_0x55b1ef[_0x6908('0x38')][_0x4a9a80[_0x6908('0x37')]['id']]){_0x55b1ef[_0x6908('0x38')][_0x4a9a80['agent']['id']][_0x6908('0x41')]=![];_0x55b1ef[_0x6908('0x38')][_0x4a9a80[_0x6908('0x37')]['id']][_0x6908('0x39')]=undefined;}return _0x203a97({'code':0xc8,'message':_0x4a9a80});}catch(_0x5eaef2){logger['error'](_0x5eaef2['stack']);return _0x5628ed(_0x7e8584[_0x6908('0x2c')](0x1f4,_0x5eaef2));}}logger[_0x6908('0x2c')](_0x6908('0x40'));return _0x5628ed(_0x7e8584['error'](0x1f4,_0x6908('0x40')));});},'AbandonInteraction':function(_0x54fc84){var _0x33f7aa=this;return new Promise(function(_0x4953d6,_0x46f9ae){if(_0x54fc84[_0x6908('0x14')]&&_0x54fc84[_0x6908('0x15')]&&_0x54fc84['interaction']['id']){try{var _0x3a0b4c=getId(_0x54fc84['channel'],_0x54fc84['message']?_0x54fc84[_0x6908('0x3a')]['id']:0x0,_0x54fc84[_0x6908('0x15')]?_0x54fc84[_0x6908('0x15')]['id']:0x0);if(_0x55b1ef[_0x6908('0x2d')][_0x3a0b4c]){_0x55b1ef[_0x6908('0x2d')][_0x3a0b4c][_0x6908('0x32')](_0x6908('0x3b'));}return _0x4953d6({'code':0xc8,'message':_0x54fc84});}catch(_0x2a9a23){logger[_0x6908('0x2c')](_0x2a9a23[_0x6908('0x35')]);return _0x46f9ae(_0x33f7aa['error'](0x1f4,_0x2a9a23));}}logger['error'](_0x6908('0x40'));return _0x46f9ae(_0x33f7aa[_0x6908('0x2c')](0x1f4,_0x6908('0x40')));});},'AgentCapacity':function(_0x38ec6d){var _0x4cfbc2=this;return new Promise(function(_0x1ecd76,_0x4a9cd4){if(_0x55b1ef[_0x6908('0x38')][_0x6908('0x42')](_0x38ec6d['id'])){for(var _0x3209bc in _0x38ec6d[_0x6908('0x43')]){if(_0x38ec6d[_0x6908('0x43')][_0x6908('0x42')](_0x3209bc)){if(_0x55b1ef['agents'][_0x38ec6d['id']]['hasOwnProperty'](_0x3209bc+_0x6908('0x44'))){_0x55b1ef['agents'][_0x38ec6d['id']][_0x3209bc+_0x6908('0x44')]=parseInt(_0x38ec6d[_0x6908('0x43')][_0x3209bc],0xa);}}}_0x55b1ef[_0x6908('0x38')][_0x38ec6d['id']][_0x6908('0x45')]();return _0x1ecd76({'code':0xc8,'message':_0x55b1ef[_0x6908('0x38')][_0x38ec6d['id']]});}else{return _0x4a9cd4(_0x4cfbc2[_0x6908('0x2c')](0x1f4,_0x6908('0x46')));}});},'Agents':function(_0x55e151){return new Promise(function(_0x3899e5,_0x6d1825){var _0x3435ab=_[_0x6908('0x47')](_0x55b1ef[_0x6908('0x38')]);_0x3899e5({'count':_0x3435ab[_0x6908('0x18')],'rows':_0x3435ab});});},'ChatQueues':function(_0x40af3f){return new Promise(function(_0x2dd6ff,_0x4043de){var _0x593bea=[];for(var _0x1c6c7d in _0x55b1ef[_0x6908('0x48')]){if(_0x55b1ef[_0x6908('0x48')][_0x6908('0x42')](_0x1c6c7d)){var _0x4406a2=_0x55b1ef[_0x6908('0x48')][_0x1c6c7d];var _0x39be8f={'id':_0x4406a2['id'],'available':_0x4406a2[_0x6908('0x49')],'loggedIn':_0x4406a2[_0x6908('0x4a')],'name':_0x4406a2[_0x6908('0x4b')],'paused':_0x4406a2['paused'],'waiting':_0x4406a2[_0x6908('0x4c')]};_0x593bea[_0x6908('0x1f')](_0x39be8f);}}_0x2dd6ff({'count':_0x593bea[_0x6908('0x18')],'rows':_0x593bea});});},'MailQueues':function(_0x20ec46){return new Promise(function(_0x30de78,_0x545bf9){var _0x1f9a17=[];for(var _0x33bcab in _0x55b1ef['mailQueues']){if(_0x55b1ef[_0x6908('0x4d')]['hasOwnProperty'](_0x33bcab)){var _0xe68346=_0x55b1ef['mailQueues'][_0x33bcab];var _0x48879e={'id':_0xe68346['id'],'available':_0xe68346['available'],'loggedIn':_0xe68346[_0x6908('0x4a')],'name':_0xe68346['name'],'paused':_0xe68346[_0x6908('0x4e')],'waiting':_0xe68346[_0x6908('0x4c')]};_0x1f9a17['push'](_0x48879e);}}_0x30de78({'count':_0x1f9a17[_0x6908('0x18')],'rows':_0x1f9a17});});},'OpenchannelQueues':function(_0x553eb1){return new Promise(function(_0x1eb2f1,_0xd2aeaf){var _0x543194=[];for(var _0x5358de in _0x55b1ef[_0x6908('0x4f')]){if(_0x55b1ef[_0x6908('0x4f')]['hasOwnProperty'](_0x5358de)){var _0x1e6bf7=_0x55b1ef[_0x6908('0x4f')][_0x5358de];var _0x3b6da4={'id':_0x1e6bf7['id'],'available':_0x1e6bf7[_0x6908('0x49')],'loggedIn':_0x1e6bf7[_0x6908('0x4a')],'name':_0x1e6bf7[_0x6908('0x4b')],'paused':_0x1e6bf7[_0x6908('0x4e')],'waiting':_0x1e6bf7[_0x6908('0x4c')]};_0x543194[_0x6908('0x1f')](_0x3b6da4);}}_0x1eb2f1({'count':_0x543194[_0x6908('0x18')],'rows':_0x543194});});},'SmsQueues':function(_0x5e2aa7){return new Promise(function(_0x1c70f8,_0xd30b1d){var _0x27b1b7=[];for(var _0x5debb1 in _0x55b1ef[_0x6908('0x50')]){if(_0x55b1ef[_0x6908('0x50')][_0x6908('0x42')](_0x5debb1)){var _0x21aa29=_0x55b1ef['smsQueues'][_0x5debb1];var _0x35f462={'id':_0x21aa29['id'],'available':_0x21aa29[_0x6908('0x49')],'loggedIn':_0x21aa29[_0x6908('0x4a')],'name':_0x21aa29[_0x6908('0x4b')],'paused':_0x21aa29[_0x6908('0x4e')],'waiting':_0x21aa29[_0x6908('0x4c')]};_0x27b1b7[_0x6908('0x1f')](_0x35f462);}}_0x1c70f8({'count':_0x27b1b7[_0x6908('0x18')],'rows':_0x27b1b7});});},'FaxQueues':function(_0xabaf48){return new Promise(function(_0x45f1a6,_0x155c48){var _0x2ca8ba=[];for(var _0x12ea14 in _0x55b1ef[_0x6908('0x51')]){if(_0x55b1ef['faxQueues'][_0x6908('0x42')](_0x12ea14)){var _0x57ce30=_0x55b1ef[_0x6908('0x51')][_0x12ea14];var _0x486bd9={'id':_0x57ce30['id'],'available':_0x57ce30[_0x6908('0x49')],'loggedIn':_0x57ce30['loggedIn'],'name':_0x57ce30[_0x6908('0x4b')],'paused':_0x57ce30['paused'],'waiting':_0x57ce30[_0x6908('0x4c')]};_0x2ca8ba[_0x6908('0x1f')](_0x486bd9);}}_0x45f1a6({'count':_0x2ca8ba['length'],'rows':_0x2ca8ba});});},'WhatsappQueues':function(_0x386426){return new Promise(function(_0x367411,_0x5ea5b1){var _0x4db5e3=[];for(var _0xa4aea4 in _0x55b1ef[_0x6908('0x52')]){if(_0x55b1ef[_0x6908('0x52')][_0x6908('0x42')](_0xa4aea4)){var _0x1cdcdf=_0x55b1ef[_0x6908('0x52')][_0xa4aea4];var _0x1ef43d={'id':_0x1cdcdf['id'],'available':_0x1cdcdf[_0x6908('0x49')],'loggedIn':_0x1cdcdf[_0x6908('0x4a')],'name':_0x1cdcdf[_0x6908('0x4b')],'paused':_0x1cdcdf['paused'],'waiting':_0x1cdcdf[_0x6908('0x4c')]};_0x4db5e3[_0x6908('0x1f')](_0x1ef43d);}}_0x367411({'count':_0x4db5e3[_0x6908('0x18')],'rows':_0x4db5e3});});},'ChatQueuesWaitingInteractions':function(_0x10db31){return new Promise(function(_0x26b964,_0x1c1b9c){var _0x3f5860=_[_0x6908('0x47')](_0x55b1ef[_0x6908('0x53')]);_0x26b964({'count':_0x3f5860[_0x6908('0x18')],'rows':_0x3f5860});});},'MailQueuesWaitingInteractions':function(_0x1fb02e){return new Promise(function(_0x1cbf00,_0x1daa20){var _0x9a2a79=_[_0x6908('0x47')](_0x55b1ef['mailQueuesWaitingInteractions']);_0x1cbf00({'count':_0x9a2a79[_0x6908('0x18')],'rows':_0x9a2a79});});},'OpenchannelQueuesWaitingInteractions':function(_0x20ce87){return new Promise(function(_0x4f1ada,_0x4214cc){var _0x4a0b11=_[_0x6908('0x47')](_0x55b1ef['openchannelQueuesWaitingInteractions']);_0x4f1ada({'count':_0x4a0b11[_0x6908('0x18')],'rows':_0x4a0b11});});},'SmsQueuesWaitingInteractions':function(_0x2e722b){return new Promise(function(_0x352a53,_0x581f5a){var _0x5864af=_[_0x6908('0x47')](_0x55b1ef[_0x6908('0x54')]);_0x352a53({'count':_0x5864af[_0x6908('0x18')],'rows':_0x5864af});});},'FaxQueuesWaitingInteractions':function(_0x1b39d5){return new Promise(function(_0x25c59b,_0x2f0e5c){var _0x1b4152=_['values'](_0x55b1ef[_0x6908('0x55')]);_0x25c59b({'count':_0x1b4152[_0x6908('0x18')],'rows':_0x1b4152});});},'WhatsappQueuesWaitingInteractions':function(_0x5f15ab){return new Promise(function(_0x3a10c0,_0x3c4812){var _0x1b4299=_[_0x6908('0x47')](_0x55b1ef[_0x6908('0x56')]);_0x3a10c0({'count':_0x1b4299[_0x6908('0x18')],'rows':_0x1b4299});});}};var _0xfbe1f0=jayson[_0x6908('0x57')](_0x165cc8)['http']();_0xfbe1f0['on'](_0x6908('0x2c'),function(_0x150f97){logger['error'](JSON[_0x6908('0x30')](_0x150f97));return _0x3889bf(_0x150f97);});_0xfbe1f0['listen'](0x232c,_0x6908('0x58'),function(){console[_0x6908('0x59')](_0x6908('0x5a'),0x232c);return _0x5c3c0d('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
+var _0xd8c4=['busy','busyQueue','emit','QueueReport','update','UserId','catch','message\x20is\x20empty','end','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','chatQueues','available','name','paused','mailQueues','loggedIn','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','values','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','join','app','toLowerCase','autoreply','appdata','split','mail','slice','push','dialogflow','amazonlex','TagId','%s:%s:%s','./interval','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','error','.js','execute','Applications\x20executed','stringify','matchPath','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents'];(function(_0x14e844,_0x903f4c){var _0x3327cb=function(_0x38335e){while(--_0x38335e){_0x14e844['push'](_0x14e844['shift']());}};_0x3327cb(++_0x903f4c);}(_0xd8c4,0xd1));var _0x4d8c=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xd8c4[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x4d8c('0x0'));var util=require(_0x4d8c('0x1'));var path=require(_0x4d8c('0x2'));var fs=require('fs');var jayson=require(_0x4d8c('0x3'));var BPromise=require(_0x4d8c('0x4'));var uuid=require(_0x4d8c('0x5'));var config=require('../../../config/environment');var logger=require(_0x4d8c('0x6'))(_0x4d8c('0x7'));var rpc={'openchannelQueueReport':require(_0x4d8c('0x8')),'mailQueueReport':require(_0x4d8c('0x9')),'chatQueueReport':require(_0x4d8c('0xa')),'smsQueueReport':require(_0x4d8c('0xb')),'faxQueueReport':require(_0x4d8c('0xc')),'whatsappQueueReport':require(_0x4d8c('0xd'))};var RuleEngine=require(_0x4d8c('0xe'));function getId(_0x3d14d0,_0x5e2750,_0x1e3f43){return util[_0x4d8c('0xf')](_0x4d8c('0x10'),_0x3d14d0,_0x5e2750||0x0,_0x1e3f43||0x0);}function getIntervals(_0x525fc7,_0x41917b){var _0x47d136=[];if(!_[_0x4d8c('0x11')](_0x41917b['IntervalId'])&&!_[_0x4d8c('0x11')](_0x525fc7[_0x41917b[_0x4d8c('0x12')]])&&!_[_0x4d8c('0x11')](_0x525fc7[_0x41917b[_0x4d8c('0x12')]][_0x4d8c('0x13')])){_0x47d136=_[_0x4d8c('0x14')](_0x525fc7[_0x41917b[_0x4d8c('0x12')]][_0x4d8c('0x13')],_0x4d8c('0x15'));}else if(!_[_0x4d8c('0x11')](_0x41917b[_0x4d8c('0x15')])){_0x47d136=[_0x41917b[_0x4d8c('0x15')]];}return _0x47d136;}exports[_0x4d8c('0x16')]=function(_0x3a9ec8){_0x3a9ec8[_0x4d8c('0x17')]={};return new BPromise(function(_0xcd74ea,_0x54f893){var _0x5b4c9e={'Start':function(_0x207dc0){var _0x502331=this;return new Promise(function(_0x311dbe,_0x5a4001){if(_0x207dc0){try{var _0x153aca=[];var _0x3648e3=getId(_0x207dc0[_0x4d8c('0x18')],_0x207dc0['message']?_0x207dc0[_0x4d8c('0x19')]['id']:0x0,_0x207dc0['interaction']?_0x207dc0[_0x4d8c('0x1a')]['id']:0x0);if(_0x207dc0['applications']&&_['isArray'](_0x207dc0[_0x4d8c('0x1b')])&&_0x207dc0[_0x4d8c('0x1b')][_0x4d8c('0x1c')]){for(var _0x338168=0x0;_0x338168<_0x207dc0[_0x4d8c('0x1b')][_0x4d8c('0x1c')];_0x338168+=0x1){var _0x1b8303=_0x207dc0[_0x4d8c('0x1b')][_0x338168];if(fs['existsSync'](path[_0x4d8c('0x1d')](__dirname,_0x4d8c('0x1b'),_0x1b8303[_0x4d8c('0x1e')]+'.js'))){var _0x2c41df=[];switch(_0x1b8303['app'][_0x4d8c('0x1f')]()){case _0x4d8c('0x20'):var _0x8259c6=_0x1b8303[_0x4d8c('0x21')][_0x4d8c('0x22')](',');if(_0x207dc0[_0x4d8c('0x18')]===_0x4d8c('0x23')){_0x2c41df['push'](_0x8259c6[0x0]);_0x2c41df['push'](_0x8259c6[0x1]);_0x2c41df['push'](_0x8259c6[_0x4d8c('0x24')](0x2,_0x8259c6[_0x4d8c('0x1c')])[_0x4d8c('0x1d')](','));}else{_0x2c41df[_0x4d8c('0x25')](_0x8259c6[0x0]);_0x2c41df[_0x4d8c('0x25')](_0x8259c6[_0x4d8c('0x24')](0x1,_0x8259c6[_0x4d8c('0x1c')])[_0x4d8c('0x1d')](','));}break;case _0x4d8c('0x26'):var _0x3f58cd=_0x1b8303['appdata'][_0x4d8c('0x22')](',');_0x2c41df['push'](_0x3f58cd[0x0]);_0x2c41df[_0x4d8c('0x25')](_0x3f58cd[0x1]);_0x2c41df['push'](_0x3f58cd[_0x4d8c('0x24')](0x2,_0x3f58cd[_0x4d8c('0x1c')])[_0x4d8c('0x1d')](','));break;case'dialogflowv2':var _0x446c7e=_0x1b8303[_0x4d8c('0x21')][_0x4d8c('0x22')](',');_0x2c41df[_0x4d8c('0x25')](_0x446c7e[0x0]);_0x2c41df[_0x4d8c('0x25')](_0x446c7e[0x1]);_0x2c41df['push'](_0x446c7e[0x2]);_0x2c41df[_0x4d8c('0x25')](_0x446c7e[0x3]);_0x2c41df[_0x4d8c('0x25')](_0x446c7e[_0x4d8c('0x24')](0x4,_0x446c7e[_0x4d8c('0x1c')])[_0x4d8c('0x1d')](','));break;case _0x4d8c('0x27'):var _0x37a951=_0x1b8303[_0x4d8c('0x21')][_0x4d8c('0x22')](',');_0x2c41df[_0x4d8c('0x25')](_0x37a951[0x0]);_0x2c41df['push'](_0x37a951[0x1]);_0x2c41df[_0x4d8c('0x25')](_0x37a951[0x2]);_0x2c41df['push'](_0x37a951[0x3]);_0x2c41df['push'](_0x37a951[_0x4d8c('0x24')](0x4,_0x37a951['length'])[_0x4d8c('0x1d')](','));break;case _0x4d8c('0x19'):_0x2c41df[_0x4d8c('0x25')](_0x1b8303[_0x4d8c('0x21')]);break;case'tag':_0x2c41df[_0x4d8c('0x25')](_0x1b8303[_0x4d8c('0x28')]);_0x2c41df[_0x4d8c('0x25')](_0x1b8303['appdata']);break;default:_0x2c41df=_[_0x4d8c('0x11')](_0x1b8303['appdata'])?[]:_0x1b8303['appdata']['split'](',');}var _0x755386={'id':util[_0x4d8c('0xf')](_0x4d8c('0x29'),_0x3648e3,_0x1b8303['id'],_0x1b8303[_0x4d8c('0x1e')]),'condition':require(_0x4d8c('0x2a'))['condition'](_0x3648e3,getIntervals(_0x3a9ec8[_0x4d8c('0x2b')],_0x1b8303),_0x3a9ec8),'consequence':require(_0x4d8c('0x2c')+_0x1b8303[_0x4d8c('0x1e')])['consequence'](_0x3648e3,_0x2c41df,_0x3a9ec8,_0x207dc0),'p':_0x1b8303[_0x4d8c('0x2d')]||0x0};logger[_0x4d8c('0x2e')](_0x4d8c('0x2f'),_0x755386['id'],_0x4d8c('0x30'),getIntervals(_0x3a9ec8[_0x4d8c('0x2b')],_0x1b8303)[_0x4d8c('0x1d')]('\x20|\x20'));_0x153aca[_0x4d8c('0x25')](_0x755386);}else{logger[_0x4d8c('0x31')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0x4d8c('0x1b'),_0x1b8303['app']+_0x4d8c('0x32')));}}_0x3a9ec8[_0x4d8c('0x17')][_0x3648e3]=new RuleEngine(_0x153aca);_0x3a9ec8[_0x4d8c('0x17')][_0x3648e3][_0x4d8c('0x33')](_0x207dc0,function(_0x2207c4){logger[_0x4d8c('0x2e')](_0x4d8c('0x34'),JSON[_0x4d8c('0x35')](_0x2207c4[_0x4d8c('0x36')]));if(_0x3a9ec8[_0x4d8c('0x17')][_0x3648e3]){_0x3a9ec8[_0x4d8c('0x17')][_0x3648e3]['emit'](_0x4d8c('0x37'));}});return _0x311dbe({'code':0xc8,'message':_0x207dc0});}else{logger[_0x4d8c('0x2e')](_0x4d8c('0x38'));return _0x311dbe({'code':0xc8,'message':_0x207dc0});}}catch(_0x180453){logger['error'](_0x180453[_0x4d8c('0x39')]);return _0x5a4001(_0x502331['error'](0x1f4,_0x180453));}}return _0x5a4001(_0x4d8c('0x3a'));});},'AcceptMessage':function(_0x54aa58){var _0x5eb34e=this;return new Promise(function(_0x11a9dc,_0x9f2e15){if(_0x54aa58[_0x4d8c('0x3b')]&&_0x54aa58[_0x4d8c('0x3b')]['id']){if(_0x3a9ec8[_0x4d8c('0x3c')][_0x54aa58[_0x4d8c('0x3b')]['id']]){_0x3a9ec8[_0x4d8c('0x3c')][_0x54aa58[_0x4d8c('0x3b')]['id']][_0x4d8c('0x3d')]=![];_0x3a9ec8[_0x4d8c('0x3c')][_0x54aa58[_0x4d8c('0x3b')]['id']][_0x4d8c('0x3e')]=undefined;}}if(_0x54aa58[_0x4d8c('0x19')]&&_0x54aa58['message']['id']){try{var _0x98921a=getId(_0x54aa58[_0x4d8c('0x18')],_0x54aa58[_0x4d8c('0x19')]?_0x54aa58[_0x4d8c('0x19')]['id']:0x0,_0x54aa58[_0x4d8c('0x1a')]?_0x54aa58[_0x4d8c('0x1a')]['id']:0x0);if(_0x3a9ec8[_0x4d8c('0x17')][_0x98921a]){_0x3a9ec8[_0x4d8c('0x17')][_0x98921a][_0x4d8c('0x3f')]('end');if(rpc[_0x54aa58[_0x4d8c('0x18')]+_0x4d8c('0x40')]){rpc[_0x54aa58[_0x4d8c('0x18')]+_0x4d8c('0x40')][_0x4d8c('0x41')](_0x98921a,{'UserId':_0x54aa58['message'][_0x4d8c('0x42')]})[_0x4d8c('0x43')](function(_0x5cdf0b){logger['error']('error\x20update\x20queue\x20report');});}}return _0x11a9dc({'code':0xc8,'message':_0x54aa58});}catch(_0x3c0096){logger[_0x4d8c('0x31')](_0x3c0096[_0x4d8c('0x39')]);return _0x9f2e15(_0x5eb34e[_0x4d8c('0x31')](0x1f4,_0x3c0096));}}logger[_0x4d8c('0x31')](_0x4d8c('0x44'));return _0x9f2e15(_0x5eb34e['error'](0x1f4,_0x4d8c('0x44')));});},'RejectMessage':function(_0x3427ae){var _0x1f3334=this;return new Promise(function(_0x283407,_0x3756d3){if(_0x3427ae['agent']&&_0x3427ae[_0x4d8c('0x3b')]['id']){try{if(_0x3a9ec8['agents'][_0x3427ae['agent']['id']]){_0x3a9ec8['agents'][_0x3427ae[_0x4d8c('0x3b')]['id']][_0x4d8c('0x3d')]=![];_0x3a9ec8[_0x4d8c('0x3c')][_0x3427ae['agent']['id']]['busyQueue']=undefined;}return _0x283407({'code':0xc8,'message':_0x3427ae});}catch(_0x40b1c0){logger[_0x4d8c('0x31')](_0x40b1c0[_0x4d8c('0x39')]);return _0x3756d3(_0x1f3334['error'](0x1f4,_0x40b1c0));}}logger['error'](_0x4d8c('0x44'));return _0x3756d3(_0x1f3334['error'](0x1f4,_0x4d8c('0x44')));});},'AbandonInteraction':function(_0x230082){var _0x152572=this;return new Promise(function(_0x441c2a,_0x1afd6d){if(_0x230082['channel']&&_0x230082[_0x4d8c('0x1a')]&&_0x230082[_0x4d8c('0x1a')]['id']){try{var _0x42a020=getId(_0x230082[_0x4d8c('0x18')],_0x230082[_0x4d8c('0x19')]?_0x230082[_0x4d8c('0x19')]['id']:0x0,_0x230082[_0x4d8c('0x1a')]?_0x230082[_0x4d8c('0x1a')]['id']:0x0);if(_0x3a9ec8[_0x4d8c('0x17')][_0x42a020]){_0x3a9ec8[_0x4d8c('0x17')][_0x42a020][_0x4d8c('0x3f')](_0x4d8c('0x45'));}return _0x441c2a({'code':0xc8,'message':_0x230082});}catch(_0x439be8){logger[_0x4d8c('0x31')](_0x439be8[_0x4d8c('0x39')]);return _0x1afd6d(_0x152572[_0x4d8c('0x31')](0x1f4,_0x439be8));}}logger[_0x4d8c('0x31')]('message\x20is\x20empty');return _0x1afd6d(_0x152572[_0x4d8c('0x31')](0x1f4,_0x4d8c('0x44')));});},'AgentCapacity':function(_0x2a4d65){var _0x294c36=this;return new Promise(function(_0x297fb2,_0x44719b){if(_0x3a9ec8[_0x4d8c('0x3c')]['hasOwnProperty'](_0x2a4d65['id'])){for(var _0x1ddcf1 in _0x2a4d65['capacity']){if(_0x2a4d65[_0x4d8c('0x46')][_0x4d8c('0x47')](_0x1ddcf1)){if(_0x3a9ec8['agents'][_0x2a4d65['id']][_0x4d8c('0x47')](_0x1ddcf1+_0x4d8c('0x48'))){_0x3a9ec8[_0x4d8c('0x3c')][_0x2a4d65['id']][_0x1ddcf1+_0x4d8c('0x48')]=parseInt(_0x2a4d65[_0x4d8c('0x46')][_0x1ddcf1],0xa);}}}_0x3a9ec8['agents'][_0x2a4d65['id']]['updateRealtime']();return _0x297fb2({'code':0xc8,'message':_0x3a9ec8[_0x4d8c('0x3c')][_0x2a4d65['id']]});}else{return _0x44719b(_0x294c36[_0x4d8c('0x31')](0x1f4,_0x4d8c('0x49')));}});},'Agents':function(_0x3dff46){return new Promise(function(_0x421c20,_0x4dabea){var _0xc117a8=_['values'](_0x3a9ec8[_0x4d8c('0x3c')]);_0x421c20({'count':_0xc117a8[_0x4d8c('0x1c')],'rows':_0xc117a8});});},'ChatQueues':function(_0x56f8a3){return new Promise(function(_0xbb0835,_0x1a273d){var _0x322337=[];for(var _0x42aa87 in _0x3a9ec8[_0x4d8c('0x4a')]){if(_0x3a9ec8[_0x4d8c('0x4a')][_0x4d8c('0x47')](_0x42aa87)){var _0x5e921b=_0x3a9ec8[_0x4d8c('0x4a')][_0x42aa87];var _0x2dc645={'id':_0x5e921b['id'],'available':_0x5e921b[_0x4d8c('0x4b')],'loggedIn':_0x5e921b['loggedIn'],'name':_0x5e921b[_0x4d8c('0x4c')],'paused':_0x5e921b[_0x4d8c('0x4d')],'waiting':_0x5e921b['waiting']};_0x322337[_0x4d8c('0x25')](_0x2dc645);}}_0xbb0835({'count':_0x322337[_0x4d8c('0x1c')],'rows':_0x322337});});},'MailQueues':function(_0x450a5e){return new Promise(function(_0xc121b9,_0x2eb9e1){var _0x3868ff=[];for(var _0x7434b6 in _0x3a9ec8['mailQueues']){if(_0x3a9ec8[_0x4d8c('0x4e')][_0x4d8c('0x47')](_0x7434b6)){var _0x8a8dd3=_0x3a9ec8['mailQueues'][_0x7434b6];var _0x5924fb={'id':_0x8a8dd3['id'],'available':_0x8a8dd3[_0x4d8c('0x4b')],'loggedIn':_0x8a8dd3[_0x4d8c('0x4f')],'name':_0x8a8dd3[_0x4d8c('0x4c')],'paused':_0x8a8dd3['paused'],'waiting':_0x8a8dd3['waiting']};_0x3868ff[_0x4d8c('0x25')](_0x5924fb);}}_0xc121b9({'count':_0x3868ff[_0x4d8c('0x1c')],'rows':_0x3868ff});});},'OpenchannelQueues':function(_0x53c71e){return new Promise(function(_0x5a3fee,_0x69d06b){var _0x4a416e=[];for(var _0x52b121 in _0x3a9ec8[_0x4d8c('0x50')]){if(_0x3a9ec8[_0x4d8c('0x50')][_0x4d8c('0x47')](_0x52b121)){var _0x41520b=_0x3a9ec8[_0x4d8c('0x50')][_0x52b121];var _0x50b434={'id':_0x41520b['id'],'available':_0x41520b['available'],'loggedIn':_0x41520b[_0x4d8c('0x4f')],'name':_0x41520b[_0x4d8c('0x4c')],'paused':_0x41520b[_0x4d8c('0x4d')],'waiting':_0x41520b[_0x4d8c('0x51')]};_0x4a416e[_0x4d8c('0x25')](_0x50b434);}}_0x5a3fee({'count':_0x4a416e[_0x4d8c('0x1c')],'rows':_0x4a416e});});},'SmsQueues':function(_0xd66a9e){return new Promise(function(_0x631a7b,_0x4cecae){var _0xad9813=[];for(var _0x380445 in _0x3a9ec8[_0x4d8c('0x52')]){if(_0x3a9ec8[_0x4d8c('0x52')][_0x4d8c('0x47')](_0x380445)){var _0x433233=_0x3a9ec8[_0x4d8c('0x52')][_0x380445];var _0x5c532f={'id':_0x433233['id'],'available':_0x433233[_0x4d8c('0x4b')],'loggedIn':_0x433233[_0x4d8c('0x4f')],'name':_0x433233['name'],'paused':_0x433233['paused'],'waiting':_0x433233['waiting']};_0xad9813['push'](_0x5c532f);}}_0x631a7b({'count':_0xad9813[_0x4d8c('0x1c')],'rows':_0xad9813});});},'FaxQueues':function(_0x48421a){return new Promise(function(_0x55f8d2,_0x11e636){var _0x984df1=[];for(var _0x1417a2 in _0x3a9ec8[_0x4d8c('0x53')]){if(_0x3a9ec8['faxQueues'][_0x4d8c('0x47')](_0x1417a2)){var _0x5a686d=_0x3a9ec8['faxQueues'][_0x1417a2];var _0x155b63={'id':_0x5a686d['id'],'available':_0x5a686d['available'],'loggedIn':_0x5a686d[_0x4d8c('0x4f')],'name':_0x5a686d[_0x4d8c('0x4c')],'paused':_0x5a686d['paused'],'waiting':_0x5a686d[_0x4d8c('0x51')]};_0x984df1[_0x4d8c('0x25')](_0x155b63);}}_0x55f8d2({'count':_0x984df1[_0x4d8c('0x1c')],'rows':_0x984df1});});},'WhatsappQueues':function(_0x4391f7){return new Promise(function(_0x19c766,_0x5578d4){var _0x153d79=[];for(var _0x158ff7 in _0x3a9ec8[_0x4d8c('0x54')]){if(_0x3a9ec8[_0x4d8c('0x54')][_0x4d8c('0x47')](_0x158ff7)){var _0x39b045=_0x3a9ec8[_0x4d8c('0x54')][_0x158ff7];var _0x2ca790={'id':_0x39b045['id'],'available':_0x39b045[_0x4d8c('0x4b')],'loggedIn':_0x39b045[_0x4d8c('0x4f')],'name':_0x39b045[_0x4d8c('0x4c')],'paused':_0x39b045[_0x4d8c('0x4d')],'waiting':_0x39b045[_0x4d8c('0x51')]};_0x153d79[_0x4d8c('0x25')](_0x2ca790);}}_0x19c766({'count':_0x153d79[_0x4d8c('0x1c')],'rows':_0x153d79});});},'ChatQueuesWaitingInteractions':function(_0x2951a2){return new Promise(function(_0x28c713,_0x21eba3){var _0x4c50d0=_['values'](_0x3a9ec8[_0x4d8c('0x55')]);_0x28c713({'count':_0x4c50d0[_0x4d8c('0x1c')],'rows':_0x4c50d0});});},'MailQueuesWaitingInteractions':function(_0x3453c6){return new Promise(function(_0x1af7c1,_0x24624d){var _0x20d3bb=_['values'](_0x3a9ec8['mailQueuesWaitingInteractions']);_0x1af7c1({'count':_0x20d3bb[_0x4d8c('0x1c')],'rows':_0x20d3bb});});},'OpenchannelQueuesWaitingInteractions':function(_0x58a21e){return new Promise(function(_0x50f977,_0x443da7){var _0x4f9c62=_[_0x4d8c('0x56')](_0x3a9ec8['openchannelQueuesWaitingInteractions']);_0x50f977({'count':_0x4f9c62[_0x4d8c('0x1c')],'rows':_0x4f9c62});});},'SmsQueuesWaitingInteractions':function(_0xc1713a){return new Promise(function(_0x5afd0f,_0x2c0bb6){var _0x383d06=_[_0x4d8c('0x56')](_0x3a9ec8['smsQueuesWaitingInteractions']);_0x5afd0f({'count':_0x383d06[_0x4d8c('0x1c')],'rows':_0x383d06});});},'FaxQueuesWaitingInteractions':function(_0x92910a){return new Promise(function(_0x46a3fa,_0x131f17){var _0x42ca79=_[_0x4d8c('0x56')](_0x3a9ec8['faxQueuesWaitingInteractions']);_0x46a3fa({'count':_0x42ca79['length'],'rows':_0x42ca79});});},'WhatsappQueuesWaitingInteractions':function(_0x5f16ae){return new Promise(function(_0x1d6f18,_0x4a263f){var _0x24e989=_['values'](_0x3a9ec8['whatsappQueuesWaitingInteractions']);_0x1d6f18({'count':_0x24e989[_0x4d8c('0x1c')],'rows':_0x24e989});});}};var _0x2d3303=jayson['server'](_0x5b4c9e)['http']();_0x2d3303['on']('error',function(_0x15fd0b){logger[_0x4d8c('0x31')](JSON[_0x4d8c('0x35')](_0x15fd0b));return _0x54f893(_0x15fd0b);});_0x2d3303[_0x4d8c('0x16')](0x232c,_0x4d8c('0x57'),function(){console[_0x4d8c('0x58')](_0x4d8c('0x59'),0x232c);return _0xcd74ea('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
index c1115c8..e25ad98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1707=['lodash','../../../config/logger','routing','client','http','request','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','format','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','stack','stop','bluebird','jayson/promise'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x1707,0x1be));var _0x7170=function(_0x528a67,_0x2fcf70){_0x528a67=_0x528a67-0x0;var _0x3c1fdc=_0x1707[_0x528a67];return _0x3c1fdc;};'use strict';var util=require('util');var BPromise=require(_0x7170('0x0'));var jayson=require(_0x7170('0x1'));var _=require(_0x7170('0x2'));var logger=require(_0x7170('0x3'))(_0x7170('0x4'));var client=jayson[_0x7170('0x5')][_0x7170('0x6')]({'port':0x232a});function request(_0x363711,_0x1f648e){return new BPromise(function(_0x1c6d18,_0x578157){return client[_0x7170('0x7')](_0x363711,_0x1f648e)['then'](function(_0x350e88){if(_0x350e88[_0x7170('0x8')]){return _0x578157(_0x350e88[_0x7170('0x8')][_0x7170('0x9')]);}else{return _0x1c6d18(_0x350e88[_0x7170('0xa')]);}})[_0x7170('0xb')](function(_0x40c54e){return _0x578157(_0x40c54e);});});}exports[_0x7170('0xc')]=function(_0x32d387,_0x3a9004,_0x555a95){return function(_0xade886){if(_0x555a95[_0x7170('0xd')]&&!_0x555a95[_0x7170('0xd')][_0x32d387]){logger[_0x7170('0xe')](_0x7170('0xf'),_0x32d387);return _0xade886['stop']();}var _0x5f73fa=[];for(var _0x2f14ab=0x0;_0x2f14ab<_0x3a9004[_0x7170('0x10')];_0x2f14ab+=0x1){_0x5f73fa['push'](request(_0x7170('0x11'),{'command':util[_0x7170('0x12')](_0x7170('0x13'),_0x3a9004[_0x2f14ab])})[_0x7170('0x14')](function(_0x1ddda6){return _0x1ddda6&&_0x1ddda6[_0x7170('0x9')]&&_0x1ddda6[_0x7170('0x9')][_0x7170('0x15')](_0x7170('0x16'))>=0x0?!![]:![];})[_0x7170('0xb')](function(_0x2f18c6){logger['error'](_0x7170('0x17'),_0x32d387,_0x3a9004[_0x2f14ab]);}));}BPromise[_0x7170('0x18')](_0x5f73fa)['then'](function(_0x388909){var _0x2b6cc2=_[_0x7170('0x19')](_0x388909);logger['info'](_0x7170('0x1a'),_0x32d387,_0x3a9004['join'](_0x7170('0x1b')),_0x2b6cc2);_0xade886[_0x7170('0x1c')](_0x2b6cc2);})['catch'](function(_0x3958e3){console[_0x7170('0x1d')](_0x3958e3);logger['error'](_0x7170('0x1a'),_0x32d387,_0x3a9004['join'](_0x7170('0x1b')),_0x3958e3[_0x7170('0x1e')]);_0xade886[_0x7170('0x1f')]();});};};
\ No newline at end of file
+var _0xcc3e=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','then','[%s][INTERVAL]\x20%s\x20%s','log','join','stack','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','error','message','result','catch','rules'];(function(_0x4acbfe,_0xc731a3){var _0x192c2a=function(_0x53d386){while(--_0x53d386){_0x4acbfe['push'](_0x4acbfe['shift']());}};_0x192c2a(++_0xc731a3);}(_0xcc3e,0x120));var _0xecc3=function(_0x2b8d2b,_0x4bd5a4){_0x2b8d2b=_0x2b8d2b-0x0;var _0x41c85f=_0xcc3e[_0x2b8d2b];return _0x41c85f;};'use strict';var util=require('util');var BPromise=require(_0xecc3('0x0'));var jayson=require(_0xecc3('0x1'));var _=require(_0xecc3('0x2'));var logger=require(_0xecc3('0x3'))(_0xecc3('0x4'));var client=jayson['client'][_0xecc3('0x5')]({'port':0x232a});function request(_0x99177,_0x10cf7e){return new BPromise(function(_0x5c0b03,_0x524d91){return client[_0xecc3('0x6')](_0x99177,_0x10cf7e)['then'](function(_0x106585){if(_0x106585[_0xecc3('0x7')]){return _0x524d91(_0x106585[_0xecc3('0x7')][_0xecc3('0x8')]);}else{return _0x5c0b03(_0x106585[_0xecc3('0x9')]);}})[_0xecc3('0xa')](function(_0x1f00e6){return _0x524d91(_0x1f00e6);});});}exports['condition']=function(_0x1cfd25,_0x5074ca,_0x1d3193){return function(_0x3be8e0){if(_0x1d3193[_0xecc3('0xb')]&&!_0x1d3193[_0xecc3('0xb')][_0x1cfd25]){logger['info'](_0xecc3('0xc'),_0x1cfd25);return _0x3be8e0[_0xecc3('0xd')]();}var _0xd78ebf=[];for(var _0x30e2b7=0x0;_0x30e2b7<_0x5074ca[_0xecc3('0xe')];_0x30e2b7+=0x1){_0xd78ebf[_0xecc3('0xf')](request('Command',{'command':util['format'](_0xecc3('0x10'),_0x5074ca[_0x30e2b7])})['then'](function(_0x24a35f){return _0x24a35f&&_0x24a35f['message']&&_0x24a35f['message'][_0xecc3('0x11')]('true')>=0x0?!![]:![];})[_0xecc3('0xa')](function(_0x29082d){logger[_0xecc3('0x7')](_0xecc3('0x12'),_0x1cfd25,_0x5074ca[_0x30e2b7]);}));}BPromise[_0xecc3('0x13')](_0xd78ebf)[_0xecc3('0x14')](function(_0x1d90a0){var _0x49096a=_['some'](_0x1d90a0);logger['info'](_0xecc3('0x15'),_0x1cfd25,_0x5074ca['join']('\x20|\x20'),_0x49096a);_0x3be8e0['when'](_0x49096a);})[_0xecc3('0xa')](function(_0x197a68){console[_0xecc3('0x16')](_0x197a68);logger['error'](_0xecc3('0x15'),_0x1cfd25,_0x5074ca[_0xecc3('0x17')]('\x20|\x20'),_0x197a68[_0xecc3('0x18')]);_0x3be8e0[_0xecc3('0xd')]();});};};
\ No newline at end of file
index 05b01c4..73f56fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe205=['interface','calleridnum','then','type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','lastevent','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','debug','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','transfertargetuniqueid','clone','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe205,0xa7));var _0x5e20=function(_0x4a450a,_0x54d42f){_0x4a450a=_0x4a450a-0x0;var _0x28baf9=_0xe205[_0x4a450a];return _0x28baf9;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var utils=require(_0x5e20('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3cdbb0,_0x6c1585){utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x5'),_0x3cdbb0[_0x5e20('0x6')],_0x3cdbb0['channel'],_0x3cdbb0[_0x5e20('0x7')],_0x3cdbb0[_0x5e20('0x8')],_0x3cdbb0[_0x5e20('0x9')],_0x3cdbb0[_0x5e20('0xa')],_0x3cdbb0['connectedlinenum'],_0x3cdbb0['lastevent']));if(_0x3cdbb0[_0x5e20('0x7')]){utils['getVoiceQueueByName'](_0x3cdbb0['queue'])[_0x5e20('0xb')](function(_0x28c142){if(_0x28c142){_0x3cdbb0['type']=_0x28c142[_0x5e20('0xc')];_0x3cdbb0[_0x5e20('0xd')]=_0x3cdbb0[_0x5e20('0xe')]?_0x28c142[_0x5e20('0xf')]:![];_0x3cdbb0['acwtime']=_0x3cdbb0[_0x5e20('0xd')]?_0x28c142[_0x5e20('0x10')]:0x0;}utils[_0x5e20('0x11')](_0x5e20('0x12'),_0x3cdbb0);});}else{utils[_0x5e20('0x11')](_0x5e20('0x12'),_0x3cdbb0);}if(_0x6c1585){delete transfers[_0x3cdbb0['uniqueid']];}else{delete agents[_0x3cdbb0[_0x5e20('0x13')]];}}exports[_0x5e20('0x14')]=function(_0x22540d){try{utils['debug'](util[_0x5e20('0x4')]('[%s][agents][agentcalled]',_0x22540d[_0x5e20('0x6')]),_0x22540d);agents[_0x22540d['destuniqueid']]=_0x22540d;agents[_0x22540d[_0x5e20('0x13')]][_0x5e20('0x15')]=utils[_0x5e20('0x16')]();agents[_0x22540d[_0x5e20('0x13')]][_0x5e20('0x17')]='called';agents[_0x22540d[_0x5e20('0x13')]][_0x5e20('0x18')]=null;agents[_0x22540d[_0x5e20('0x13')]][_0x5e20('0x19')]=null;utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x1a'),_0x22540d[_0x5e20('0x6')],agents[_0x22540d['destuniqueid']][_0x5e20('0x8')],_0x22540d[_0x5e20('0x13')]));}catch(_0x4f900b){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x1c'),_0x22540d[_0x5e20('0x6')]),_0x4f900b);}};exports['agentringnoanswer']=function(_0x2954fc){try{if(!_['isNil'](agents[_0x2954fc['destuniqueid']])){utils['debug'](util['format'](_0x5e20('0x1d'),_0x2954fc['uniqueid']),_0x2954fc);utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x1e'),_0x2954fc[_0x5e20('0x6')],agents[_0x2954fc[_0x5e20('0x13')]][_0x5e20('0x8')],_0x2954fc['destuniqueid']));agents[_0x2954fc[_0x5e20('0x13')]]['agentringnoanswer']=!![];agents[_0x2954fc['destuniqueid']][_0x5e20('0x1f')]=utils[_0x5e20('0x16')]();agents[_0x2954fc[_0x5e20('0x13')]][_0x5e20('0x17')]=_0x5e20('0x20');agents[_0x2954fc[_0x5e20('0x13')]][_0x5e20('0x21')]='timeout';agents[_0x2954fc[_0x5e20('0x13')]][_0x5e20('0x22')]=_0x2954fc[_0x5e20('0x23')]?parseInt(_0x2954fc[_0x5e20('0x23')])/0x3e8:0x0;agents[_0x2954fc['destuniqueid']][_0x5e20('0x24')]=0x0;unanswered[_0x5e20('0x25')](_0x2954fc[_0x5e20('0x13')]);}}catch(_0x222e7a){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')]('[%s][agents][agentringnoanswer]',_0x2954fc[_0x5e20('0x6')]),_0x222e7a);}};exports[_0x5e20('0x26')]=function(_0x543c29){try{_[_0x5e20('0x27')](agents,function(_0x21d1d8,_0x335f1e){if(_0x21d1d8[_0x5e20('0x6')]==_0x543c29[_0x5e20('0x6')]&&!_[_0x5e20('0x28')](unanswered,_0x21d1d8['destuniqueid'])){utils[_0x5e20('0x29')](util[_0x5e20('0x4')](_0x5e20('0x2a'),_0x543c29[_0x5e20('0x6')]),_0x543c29);utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x2b'),_0x543c29[_0x5e20('0x6')],_0x21d1d8[_0x5e20('0x8')],_0x21d1d8[_0x5e20('0x13')]));_0x21d1d8[_0x5e20('0x2c')]=!![];_0x21d1d8['agentringnoanswerAt']=utils[_0x5e20('0x16')]();_0x21d1d8[_0x5e20('0x17')]=_0x5e20('0x2d');_0x21d1d8['reason']=_0x5e20('0x2d');_0x21d1d8[_0x5e20('0x22')]=_0x543c29[_0x5e20('0x22')];_0x21d1d8[_0x5e20('0x24')]=0x0;writeDB(_0x21d1d8);}});}catch(_0x244209){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x2a'),_0x543c29[_0x5e20('0x6')]),_0x244209);}};exports[_0x5e20('0x2e')]=function(_0x36e825){try{if(agents[_0x36e825[_0x5e20('0x13')]]){utils[_0x5e20('0x29')](util[_0x5e20('0x4')]('[%s][agents][agentconnect]',_0x36e825[_0x5e20('0x6')]),_0x36e825);utils['info'](util['format'](_0x5e20('0x2f'),_0x36e825[_0x5e20('0x6')],agents[_0x36e825['destuniqueid']][_0x5e20('0x8')],_0x36e825[_0x5e20('0x13')]));agents[_0x36e825['destuniqueid']][_0x5e20('0x30')]=utils[_0x5e20('0x16')]();agents[_0x36e825[_0x5e20('0x13')]][_0x5e20('0x18')]=_0x36e825[_0x5e20('0x18')];agents[_0x36e825[_0x5e20('0x13')]][_0x5e20('0x19')]=_0x36e825[_0x5e20('0x19')];agents[_0x36e825[_0x5e20('0x13')]][_0x5e20('0x22')]=_0x36e825[_0x5e20('0x23')];agents[_0x36e825[_0x5e20('0x13')]][_0x5e20('0x17')]=_0x5e20('0x31');_[_0x5e20('0x27')](agents,function(_0x3d618c,_0x20e83d){if(_0x3d618c[_0x5e20('0x13')]!=_0x36e825['destuniqueid']&&_0x3d618c[_0x5e20('0x6')]==_0x36e825[_0x5e20('0x6')]){_0x3d618c[_0x5e20('0x24')]=0x0;_0x3d618c[_0x5e20('0x22')]=_0x36e825[_0x5e20('0x23')];_0x3d618c['agentringnoanswer']=!![];_0x3d618c[_0x5e20('0x1f')]=utils[_0x5e20('0x16')]();_0x3d618c[_0x5e20('0x17')]=_0x5e20('0x32');_0x3d618c[_0x5e20('0x21')]=_0x5e20('0x32');_0x3d618c['answeredelsewheredestinationuniqueid']=_0x36e825[_0x5e20('0x13')];_0x3d618c[_0x5e20('0x33')]=_0x36e825[_0x5e20('0x8')];writeDB(_0x3d618c);}});}}catch(_0x5a21f0){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x34'),_0x36e825[_0x5e20('0x6')]),_0x5a21f0);}};exports[_0x5e20('0xe')]=function(_0x336d61){try{if(!_[_0x5e20('0x35')](agents[_0x336d61[_0x5e20('0x13')]])){utils['debug'](util[_0x5e20('0x4')](_0x5e20('0x36'),_0x336d61[_0x5e20('0x6')]),_0x336d61);utils['info'](util[_0x5e20('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x336d61[_0x5e20('0x6')],agents[_0x336d61[_0x5e20('0x13')]][_0x5e20('0x8')],_0x336d61[_0x5e20('0x13')]));agents[_0x336d61[_0x5e20('0x13')]]['agentcomplete']=!![];agents[_0x336d61[_0x5e20('0x13')]]['agentcompleteAt']=utils['now']();agents[_0x336d61[_0x5e20('0x13')]][_0x5e20('0x24')]=utils[_0x5e20('0x37')](agents[_0x336d61[_0x5e20('0x13')]][_0x5e20('0x38')],agents[_0x336d61[_0x5e20('0x13')]][_0x5e20('0x30')]);agents[_0x336d61['destuniqueid']]['reason']=_0x336d61[_0x5e20('0x21')];agents[_0x336d61[_0x5e20('0x13')]]['lastevent']=_0x5e20('0x39');writeDB(agents[_0x336d61[_0x5e20('0x13')]]);}}catch(_0xf1e97c){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')]('[%s][agents][agentcomplete]',_0x336d61[_0x5e20('0x6')]),_0xf1e97c);}};exports[_0x5e20('0x3a')]=function(_0x25491e){try{if(!_[_0x5e20('0x35')](agents[_0x25491e[_0x5e20('0x3b')]])){utils[_0x5e20('0x29')](util[_0x5e20('0x4')](_0x5e20('0x3c'),_0x25491e['uniqueid']),_0x25491e);utils['info'](util['format'](_0x5e20('0x3d'),_0x25491e[_0x5e20('0x6')],agents[_0x25491e['transfereruniqueid']][_0x5e20('0x8')],agents[_0x25491e['transfereruniqueid']][_0x5e20('0x6')]));agents[_0x25491e['transfereruniqueid']][_0x5e20('0x3e')]=!![];agents[_0x25491e['transfereruniqueid']][_0x5e20('0x3f')]=_0x5e20('0x40');agents[_0x25491e[_0x5e20('0x3b')]][_0x5e20('0x41')]=_0x25491e[_0x5e20('0x42')];agents[_0x25491e[_0x5e20('0x3b')]][_0x5e20('0x43')]=agents[_0x25491e[_0x5e20('0x3b')]][_0x5e20('0x6')];}}catch(_0x43e890){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x3c'),_0x25491e[_0x5e20('0x6')]),_0x43e890);}};exports[_0x5e20('0x44')]=function(_0xe7759c){try{utils[_0x5e20('0x29')](util[_0x5e20('0x4')]('[%s][agents][attendedtransfer]',_0xe7759c['origtransfereruniqueid']),_0xe7759c);if(_0xe7759c[_0x5e20('0x45')]==_0xe7759c['origtransfererlinkedid']){if(!_[_0x5e20('0x35')](agents[_0xe7759c[_0x5e20('0x46')]])){utils[_0x5e20('0x3')](util['format'](_0x5e20('0x47'),_0xe7759c[_0x5e20('0x45')],agents[_0xe7759c[_0x5e20('0x46')]]['membername']));agents[_0xe7759c['secondtransfereruniqueid']]['transfer']=!![];agents[_0xe7759c[_0x5e20('0x46')]][_0x5e20('0x3f')]=_0x5e20('0x48');agents[_0xe7759c[_0x5e20('0x46')]][_0x5e20('0x41')]=_0xe7759c[_0x5e20('0x49')];agents[_0xe7759c['secondtransfereruniqueid']][_0x5e20('0x43')]=_0xe7759c['origtransfereruniqueid'];}if(_0xe7759c[_0x5e20('0x4a')]&&agents[_0xe7759c['transfereeuniqueid']]){agents[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0x4b')]=0x1;transfers[_0xe7759c[_0x5e20('0x4a')]]=_['clone'](agents[_0xe7759c[_0x5e20('0x4a')]]);transfers[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0xa')]=agents[_0xe7759c[_0x5e20('0x46')]][_0x5e20('0xa')];transfers[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0x4c')]=agents[_0xe7759c['secondtransfereruniqueid']][_0x5e20('0x4c')];transfers[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0x15')]=utils[_0x5e20('0x16')]();transfers[_0xe7759c['transfereeuniqueid']][_0x5e20('0x30')]=utils[_0x5e20('0x16')]();transfers[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0x22')]=0x0;transfers[_0xe7759c['transfereeuniqueid']][_0x5e20('0x4b')]=0x2;}}else if(_0xe7759c[_0x5e20('0x46')]==_0xe7759c[_0x5e20('0x4d')]){if(!_['isNil'](agents[_0xe7759c['origtransfereruniqueid']])){utils['info'](util[_0x5e20('0x4')](_0x5e20('0x47'),_0xe7759c['origtransfereruniqueid'],agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x8')]));agents[_0xe7759c[_0x5e20('0x45')]]['transfer']=!![];agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x3f')]='ATTENDED';agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x41')]=_0xe7759c['secondtransfererexten'];agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x43')]=_0xe7759c[_0x5e20('0x46')];}if(_0xe7759c[_0x5e20('0x4e')]&&agents[_0xe7759c['transfertargetuniqueid']]){agents[_0xe7759c[_0x5e20('0x4e')]]['agententerreason']=0x1;transfers[_0xe7759c['transfertargetuniqueid']]=_[_0x5e20('0x4f')](agents[_0xe7759c[_0x5e20('0x4e')]]);transfers[_0xe7759c[_0x5e20('0x4e')]][_0x5e20('0xa')]=agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0xa')];transfers[_0xe7759c['transfertargetuniqueid']]['calleridname']=agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x4c')];transfers[_0xe7759c[_0x5e20('0x4e')]]['agentcalledAt']=utils[_0x5e20('0x16')]();transfers[_0xe7759c[_0x5e20('0x4e')]]['agentconnectAt']=utils[_0x5e20('0x16')]();transfers[_0xe7759c['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0xe7759c[_0x5e20('0x4e')]]['agententerreason']=0x2;}}}catch(_0x3e4500){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')]('[%s][agents][attendedtransfer]',_0xe7759c[_0x5e20('0x45')]),_0x3e4500);}};exports[_0x5e20('0x50')]=function(_0xd10013){try{utils[_0x5e20('0x29')](util[_0x5e20('0x4')]('[%s][agents][hangup]',_0xd10013[_0x5e20('0x6')]),_0xd10013);if(agents[_0xd10013[_0x5e20('0x6')]]&&agents[_0xd10013['uniqueid']][_0x5e20('0x21')]===_0x5e20('0x20')){if(_0xd10013[_0x5e20('0x51')]==='21'){agents[_0xd10013['uniqueid']][_0x5e20('0x21')]=_0x5e20('0x52');agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]=_0x5e20('0x52');}utils['info'](util[_0x5e20('0x4')](_0x5e20('0x53'),_0xd10013[_0x5e20('0x6')],agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x8')],agents[_0xd10013['uniqueid']][_0x5e20('0x21')],agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]));writeDB(agents[_0xd10013[_0x5e20('0x6')]]);var _0x1e7cf8=unanswered[_0x5e20('0x54')](_0xd10013[_0x5e20('0x6')]);if(_0x1e7cf8>-0x1){unanswered[_0x5e20('0x55')](_0x1e7cf8,0x1);}}if(transfers[_0xd10013['uniqueid']]){transfers[_0xd10013[_0x5e20('0x6')]]['agentcomplete']=!![];transfers[_0xd10013['uniqueid']][_0x5e20('0x38')]=utils[_0x5e20('0x16')]();transfers[_0xd10013['uniqueid']][_0x5e20('0x24')]=utils[_0x5e20('0x37')](transfers[_0xd10013['uniqueid']][_0x5e20('0x38')],transfers[_0xd10013['uniqueid']][_0x5e20('0x30')]);transfers[_0xd10013['uniqueid']][_0x5e20('0x21')]=_0x5e20('0x56');transfers[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]=_0x5e20('0x39');utils['info'](util[_0x5e20('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xd10013[_0x5e20('0x6')],transfers[_0xd10013['uniqueid']][_0x5e20('0x8')],transfers[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x21')],transfers[_0xd10013[_0x5e20('0x6')]]['lastevent']));writeDB(transfers[_0xd10013[_0x5e20('0x6')]],!![]);}if(agents[_0xd10013[_0x5e20('0x6')]]&&agents[_0xd10013['uniqueid']]['agentconnectAt']){agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0xe')]=!![];agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x38')]=utils[_0x5e20('0x16')]();agents[_0xd10013['uniqueid']][_0x5e20('0x24')]=utils['diffTime'](agents[_0xd10013['uniqueid']][_0x5e20('0x38')],agents[_0xd10013['uniqueid']]['agentconnectAt']);agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x21')]=agents[_0xd10013['uniqueid']][_0x5e20('0x3e')]?_0x5e20('0x3e'):_0x5e20('0x56');agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]='complete';utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x53'),_0xd10013[_0x5e20('0x6')],agents[_0xd10013['uniqueid']]['membername'],agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x21')],agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]));writeDB(agents[_0xd10013[_0x5e20('0x6')]]);}}catch(_0xdc9ff4){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x57'),_0xd10013[_0x5e20('0x6')]),_0xdc9ff4);}};
\ No newline at end of file
+var _0x5ec6=['connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agentcompleteAt','agent','lodash','util','./utils','format','uniqueid','queue','interface','calleridnum','lastevent','then','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinenum','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]'];(function(_0x193949,_0xbea581){var _0x489422=function(_0x51a80a){while(--_0x51a80a){_0x193949['push'](_0x193949['shift']());}};_0x489422(++_0xbea581);}(_0x5ec6,0x7f));var _0x65ec=function(_0x16425b,_0x496d2e){_0x16425b=_0x16425b-0x0;var _0x5dd378=_0x5ec6[_0x16425b];return _0x5dd378;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var utils=require(_0x65ec('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5c0775,_0x1b924d){utils['info'](util[_0x65ec('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x5c0775[_0x65ec('0x4')],_0x5c0775['channel'],_0x5c0775[_0x65ec('0x5')],_0x5c0775['membername'],_0x5c0775[_0x65ec('0x6')],_0x5c0775[_0x65ec('0x7')],_0x5c0775['connectedlinenum'],_0x5c0775[_0x65ec('0x8')]));if(_0x5c0775[_0x65ec('0x5')]){utils['getVoiceQueueByName'](_0x5c0775[_0x65ec('0x5')])[_0x65ec('0x9')](function(_0x300f83){if(_0x300f83){_0x5c0775['type']=_0x300f83['type'];_0x5c0775[_0x65ec('0xa')]=_0x5c0775['agentcomplete']?_0x300f83[_0x65ec('0xb')]:![];_0x5c0775[_0x65ec('0xc')]=_0x5c0775['agentacw']?_0x300f83[_0x65ec('0xd')]:0x0;}utils[_0x65ec('0xe')]('CreateVoiceAgentReport',_0x5c0775);});}else{utils[_0x65ec('0xe')](_0x65ec('0xf'),_0x5c0775);}if(_0x1b924d){delete transfers[_0x5c0775['uniqueid']];}else{delete agents[_0x5c0775[_0x65ec('0x10')]];}}exports[_0x65ec('0x11')]=function(_0x411a7b){try{utils[_0x65ec('0x12')](util[_0x65ec('0x3')](_0x65ec('0x13'),_0x411a7b[_0x65ec('0x4')]),_0x411a7b);agents[_0x411a7b[_0x65ec('0x10')]]=_0x411a7b;agents[_0x411a7b['destuniqueid']][_0x65ec('0x14')]=utils[_0x65ec('0x15')]();agents[_0x411a7b[_0x65ec('0x10')]]['lastevent']='called';agents[_0x411a7b[_0x65ec('0x10')]][_0x65ec('0x16')]=null;agents[_0x411a7b[_0x65ec('0x10')]]['connectedlinename']=null;utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x18'),_0x411a7b[_0x65ec('0x4')],agents[_0x411a7b[_0x65ec('0x10')]][_0x65ec('0x19')],_0x411a7b[_0x65ec('0x10')]));}catch(_0x3ef058){utils[_0x65ec('0x1a')](util[_0x65ec('0x3')](_0x65ec('0x13'),_0x411a7b[_0x65ec('0x4')]),_0x3ef058);}};exports[_0x65ec('0x1b')]=function(_0x1467ac){try{if(!_[_0x65ec('0x1c')](agents[_0x1467ac[_0x65ec('0x10')]])){utils[_0x65ec('0x12')](util[_0x65ec('0x3')](_0x65ec('0x1d'),_0x1467ac['uniqueid']),_0x1467ac);utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x1e'),_0x1467ac[_0x65ec('0x4')],agents[_0x1467ac[_0x65ec('0x10')]][_0x65ec('0x19')],_0x1467ac[_0x65ec('0x10')]));agents[_0x1467ac['destuniqueid']][_0x65ec('0x1b')]=!![];agents[_0x1467ac[_0x65ec('0x10')]][_0x65ec('0x1f')]=utils[_0x65ec('0x15')]();agents[_0x1467ac[_0x65ec('0x10')]][_0x65ec('0x8')]=_0x65ec('0x20');agents[_0x1467ac[_0x65ec('0x10')]][_0x65ec('0x21')]='timeout';agents[_0x1467ac[_0x65ec('0x10')]][_0x65ec('0x22')]=_0x1467ac[_0x65ec('0x23')]?parseInt(_0x1467ac[_0x65ec('0x23')])/0x3e8:0x0;agents[_0x1467ac['destuniqueid']][_0x65ec('0x24')]=0x0;unanswered['push'](_0x1467ac[_0x65ec('0x10')]);}}catch(_0x1ada47){utils[_0x65ec('0x1a')](util[_0x65ec('0x3')](_0x65ec('0x1d'),_0x1467ac[_0x65ec('0x4')]),_0x1ada47);}};exports[_0x65ec('0x25')]=function(_0x39410f){try{_[_0x65ec('0x26')](agents,function(_0xeec5d4,_0x3c97e2){if(_0xeec5d4['uniqueid']==_0x39410f['uniqueid']&&!_[_0x65ec('0x27')](unanswered,_0xeec5d4['destuniqueid'])){utils[_0x65ec('0x12')](util[_0x65ec('0x3')]('[%s][agents][queuecallerabandon]',_0x39410f[_0x65ec('0x4')]),_0x39410f);utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x28'),_0x39410f['uniqueid'],_0xeec5d4[_0x65ec('0x19')],_0xeec5d4[_0x65ec('0x10')]));_0xeec5d4[_0x65ec('0x1b')]=!![];_0xeec5d4[_0x65ec('0x1f')]=utils[_0x65ec('0x15')]();_0xeec5d4[_0x65ec('0x8')]=_0x65ec('0x29');_0xeec5d4[_0x65ec('0x21')]=_0x65ec('0x29');_0xeec5d4[_0x65ec('0x22')]=_0x39410f['holdtime'];_0xeec5d4[_0x65ec('0x24')]=0x0;writeDB(_0xeec5d4);}});}catch(_0x1e20c4){utils['error'](util[_0x65ec('0x3')](_0x65ec('0x2a'),_0x39410f[_0x65ec('0x4')]),_0x1e20c4);}};exports[_0x65ec('0x2b')]=function(_0x134cce){try{if(agents[_0x134cce[_0x65ec('0x10')]]){utils[_0x65ec('0x12')](util['format'](_0x65ec('0x2c'),_0x134cce[_0x65ec('0x4')]),_0x134cce);utils[_0x65ec('0x17')](util[_0x65ec('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x134cce[_0x65ec('0x4')],agents[_0x134cce[_0x65ec('0x10')]][_0x65ec('0x19')],_0x134cce[_0x65ec('0x10')]));agents[_0x134cce['destuniqueid']]['agentconnectAt']=utils[_0x65ec('0x15')]();agents[_0x134cce['destuniqueid']][_0x65ec('0x16')]=_0x134cce[_0x65ec('0x16')];agents[_0x134cce['destuniqueid']][_0x65ec('0x2d')]=_0x134cce[_0x65ec('0x2d')];agents[_0x134cce[_0x65ec('0x10')]][_0x65ec('0x22')]=_0x134cce[_0x65ec('0x23')];agents[_0x134cce[_0x65ec('0x10')]][_0x65ec('0x8')]=_0x65ec('0x2e');_[_0x65ec('0x26')](agents,function(_0x2ce56f,_0x3561ef){if(_0x2ce56f['destuniqueid']!=_0x134cce[_0x65ec('0x10')]&&_0x2ce56f['uniqueid']==_0x134cce[_0x65ec('0x4')]){_0x2ce56f[_0x65ec('0x24')]=0x0;_0x2ce56f[_0x65ec('0x22')]=_0x134cce[_0x65ec('0x23')];_0x2ce56f[_0x65ec('0x1b')]=!![];_0x2ce56f[_0x65ec('0x1f')]=utils['now']();_0x2ce56f[_0x65ec('0x8')]='answered_elsewhere';_0x2ce56f['reason']=_0x65ec('0x2f');_0x2ce56f[_0x65ec('0x30')]=_0x134cce[_0x65ec('0x10')];_0x2ce56f[_0x65ec('0x31')]=_0x134cce[_0x65ec('0x19')];writeDB(_0x2ce56f);}});}}catch(_0x524235){utils['error'](util[_0x65ec('0x3')](_0x65ec('0x2c'),_0x134cce[_0x65ec('0x4')]),_0x524235);}};exports[_0x65ec('0x32')]=function(_0x11edd1){try{if(!_['isNil'](agents[_0x11edd1['destuniqueid']])){utils[_0x65ec('0x12')](util[_0x65ec('0x3')](_0x65ec('0x33'),_0x11edd1[_0x65ec('0x4')]),_0x11edd1);utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x34'),_0x11edd1['uniqueid'],agents[_0x11edd1[_0x65ec('0x10')]][_0x65ec('0x19')],_0x11edd1[_0x65ec('0x10')]));agents[_0x11edd1['destuniqueid']][_0x65ec('0x32')]=!![];agents[_0x11edd1[_0x65ec('0x10')]]['agentcompleteAt']=utils[_0x65ec('0x15')]();agents[_0x11edd1[_0x65ec('0x10')]][_0x65ec('0x24')]=utils[_0x65ec('0x35')](agents[_0x11edd1[_0x65ec('0x10')]]['agentcompleteAt'],agents[_0x11edd1[_0x65ec('0x10')]][_0x65ec('0x36')]);agents[_0x11edd1[_0x65ec('0x10')]][_0x65ec('0x21')]=_0x11edd1['reason'];agents[_0x11edd1[_0x65ec('0x10')]]['lastevent']=_0x65ec('0x37');writeDB(agents[_0x11edd1[_0x65ec('0x10')]]);}}catch(_0x3095f5){utils['error'](util['format'](_0x65ec('0x33'),_0x11edd1[_0x65ec('0x4')]),_0x3095f5);}};exports[_0x65ec('0x38')]=function(_0x2111af){try{if(!_[_0x65ec('0x1c')](agents[_0x2111af[_0x65ec('0x39')]])){utils[_0x65ec('0x12')](util[_0x65ec('0x3')](_0x65ec('0x3a'),_0x2111af[_0x65ec('0x4')]),_0x2111af);utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x3b'),_0x2111af[_0x65ec('0x4')],agents[_0x2111af[_0x65ec('0x39')]][_0x65ec('0x19')],agents[_0x2111af[_0x65ec('0x39')]]['uniqueid']));agents[_0x2111af[_0x65ec('0x39')]][_0x65ec('0x3c')]=!![];agents[_0x2111af['transfereruniqueid']][_0x65ec('0x3d')]=_0x65ec('0x3e');agents[_0x2111af[_0x65ec('0x39')]]['transferexten']=_0x2111af[_0x65ec('0x3f')];agents[_0x2111af[_0x65ec('0x39')]][_0x65ec('0x40')]=agents[_0x2111af['transfereruniqueid']][_0x65ec('0x4')];}}catch(_0x5e5e48){utils['error'](util[_0x65ec('0x3')](_0x65ec('0x3a'),_0x2111af[_0x65ec('0x4')]),_0x5e5e48);}};exports['attendedtransfer']=function(_0x2df855){try{utils[_0x65ec('0x12')](util[_0x65ec('0x3')](_0x65ec('0x41'),_0x2df855[_0x65ec('0x42')]),_0x2df855);if(_0x2df855[_0x65ec('0x42')]==_0x2df855[_0x65ec('0x43')]){if(!_[_0x65ec('0x1c')](agents[_0x2df855[_0x65ec('0x44')]])){utils['info'](util['format'](_0x65ec('0x45'),_0x2df855['origtransfereruniqueid'],agents[_0x2df855[_0x65ec('0x44')]]['membername']));agents[_0x2df855[_0x65ec('0x44')]][_0x65ec('0x3c')]=!![];agents[_0x2df855[_0x65ec('0x44')]][_0x65ec('0x3d')]=_0x65ec('0x46');agents[_0x2df855[_0x65ec('0x44')]][_0x65ec('0x47')]=_0x2df855['origtransfererexten'];agents[_0x2df855[_0x65ec('0x44')]][_0x65ec('0x40')]=_0x2df855[_0x65ec('0x42')];}if(_0x2df855[_0x65ec('0x48')]&&agents[_0x2df855[_0x65ec('0x48')]]){agents[_0x2df855['transfereeuniqueid']][_0x65ec('0x49')]=0x1;transfers[_0x2df855[_0x65ec('0x48')]]=_[_0x65ec('0x4a')](agents[_0x2df855[_0x65ec('0x48')]]);transfers[_0x2df855[_0x65ec('0x48')]][_0x65ec('0x7')]=agents[_0x2df855[_0x65ec('0x44')]][_0x65ec('0x7')];transfers[_0x2df855['transfereeuniqueid']][_0x65ec('0x4b')]=agents[_0x2df855[_0x65ec('0x44')]][_0x65ec('0x4b')];transfers[_0x2df855[_0x65ec('0x48')]][_0x65ec('0x14')]=utils[_0x65ec('0x15')]();transfers[_0x2df855[_0x65ec('0x48')]]['agentconnectAt']=utils['now']();transfers[_0x2df855[_0x65ec('0x48')]]['holdtime']=0x0;transfers[_0x2df855[_0x65ec('0x48')]][_0x65ec('0x49')]=0x2;}}else if(_0x2df855['secondtransfereruniqueid']==_0x2df855[_0x65ec('0x4c')]){if(!_[_0x65ec('0x1c')](agents[_0x2df855[_0x65ec('0x42')]])){utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x45'),_0x2df855[_0x65ec('0x42')],agents[_0x2df855['origtransfereruniqueid']]['membername']));agents[_0x2df855[_0x65ec('0x42')]][_0x65ec('0x3c')]=!![];agents[_0x2df855[_0x65ec('0x42')]]['transfertype']=_0x65ec('0x46');agents[_0x2df855[_0x65ec('0x42')]][_0x65ec('0x47')]=_0x2df855[_0x65ec('0x4d')];agents[_0x2df855[_0x65ec('0x42')]][_0x65ec('0x40')]=_0x2df855[_0x65ec('0x44')];}if(_0x2df855['transfertargetuniqueid']&&agents[_0x2df855[_0x65ec('0x4e')]]){agents[_0x2df855[_0x65ec('0x4e')]][_0x65ec('0x49')]=0x1;transfers[_0x2df855[_0x65ec('0x4e')]]=_[_0x65ec('0x4a')](agents[_0x2df855[_0x65ec('0x4e')]]);transfers[_0x2df855[_0x65ec('0x4e')]][_0x65ec('0x7')]=agents[_0x2df855[_0x65ec('0x42')]]['calleridnum'];transfers[_0x2df855['transfertargetuniqueid']][_0x65ec('0x4b')]=agents[_0x2df855['origtransfereruniqueid']]['calleridname'];transfers[_0x2df855[_0x65ec('0x4e')]][_0x65ec('0x14')]=utils[_0x65ec('0x15')]();transfers[_0x2df855['transfertargetuniqueid']]['agentconnectAt']=utils[_0x65ec('0x15')]();transfers[_0x2df855['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x2df855['transfertargetuniqueid']][_0x65ec('0x49')]=0x2;}}}catch(_0x4f52ed){utils[_0x65ec('0x1a')](util[_0x65ec('0x3')](_0x65ec('0x41'),_0x2df855['origtransfereruniqueid']),_0x4f52ed);}};exports['hangup']=function(_0x258e14){try{utils['debug'](util[_0x65ec('0x3')](_0x65ec('0x4f'),_0x258e14[_0x65ec('0x4')]),_0x258e14);if(agents[_0x258e14[_0x65ec('0x4')]]&&agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x21')]===_0x65ec('0x20')){if(_0x258e14[_0x65ec('0x50')]==='21'){agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x21')]='rejected';agents[_0x258e14[_0x65ec('0x4')]]['lastevent']=_0x65ec('0x51');}utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x52'),_0x258e14['uniqueid'],agents[_0x258e14[_0x65ec('0x4')]]['membername'],agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x21')],agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x8')]));writeDB(agents[_0x258e14['uniqueid']]);var _0x5307ac=unanswered['indexOf'](_0x258e14[_0x65ec('0x4')]);if(_0x5307ac>-0x1){unanswered[_0x65ec('0x53')](_0x5307ac,0x1);}}if(transfers[_0x258e14[_0x65ec('0x4')]]){transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x32')]=!![];transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x54')]=utils[_0x65ec('0x15')]();transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x24')]=utils[_0x65ec('0x35')](transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x54')],transfers[_0x258e14['uniqueid']][_0x65ec('0x36')]);transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x21')]=_0x65ec('0x55');transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x8')]=_0x65ec('0x37');utils[_0x65ec('0x17')](util[_0x65ec('0x3')](_0x65ec('0x52'),_0x258e14['uniqueid'],transfers[_0x258e14[_0x65ec('0x4')]]['membername'],transfers[_0x258e14['uniqueid']][_0x65ec('0x21')],transfers[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x8')]));writeDB(transfers[_0x258e14[_0x65ec('0x4')]],!![]);}if(agents[_0x258e14[_0x65ec('0x4')]]&&agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x36')]){agents[_0x258e14[_0x65ec('0x4')]]['agentcomplete']=!![];agents[_0x258e14[_0x65ec('0x4')]]['agentcompleteAt']=utils[_0x65ec('0x15')]();agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x24')]=utils['diffTime'](agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x54')],agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x36')]);agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x21')]=agents[_0x258e14[_0x65ec('0x4')]]['transfer']?_0x65ec('0x3c'):_0x65ec('0x55');agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x8')]='complete';utils['info'](util[_0x65ec('0x3')](_0x65ec('0x52'),_0x258e14[_0x65ec('0x4')],agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x19')],agents[_0x258e14[_0x65ec('0x4')]]['reason'],agents[_0x258e14[_0x65ec('0x4')]][_0x65ec('0x8')]));writeDB(agents[_0x258e14[_0x65ec('0x4')]]);}}catch(_0x127e67){utils[_0x65ec('0x1a')](util[_0x65ec('0x3')](_0x65ec('0x4f'),_0x258e14[_0x65ec('0x4')]),_0x127e67);}};
\ No newline at end of file
index dc5ef97..f07a6fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ba7=['toNumber','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','diffTime','billableseconds','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','split','lastIndexOf','includes','noop','execif','gotoif','lastdata','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','systemanswertime','linkedid','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition'];(function(_0x287076,_0x4a2432){var _0x45c6ce=function(_0x5cd1dc){while(--_0x5cd1dc){_0x287076['push'](_0x287076['shift']());}};_0x45c6ce(++_0x4a2432);}(_0x2ba7,0xad));var _0x72ba=function(_0x31ae4e,_0x7e14fc){_0x31ae4e=_0x31ae4e-0x0;var _0x30c85d=_0x2ba7[_0x31ae4e];return _0x30c85d;};'use strict';var _=require(_0x72ba('0x0'));var util=require(_0x72ba('0x1'));var utils=require('./utils');var transfers=require(_0x72ba('0x2'));var dispositions=[_0x72ba('0x3'),_0x72ba('0x4'),_0x72ba('0x4'),'NO\x20ANSWER',_0x72ba('0x3'),_0x72ba('0x3'),_0x72ba('0x5'),_0x72ba('0x6'),_0x72ba('0x4'),'FAILED',_0x72ba('0x4')];var channels={};function writeDB(_0x38fe52){var _0x401164;if(transfers[_0x72ba('0x7')][_0x38fe52[_0x72ba('0x8')]]){_0x401164=_0x38fe52[_0x72ba('0x8')];_0x38fe52[_0x72ba('0x8')]=transfers[_0x72ba('0x7')][_0x38fe52['uniqueid']][_0x72ba('0x9')];}utils['info'](util[_0x72ba('0xa')](_0x72ba('0xb'),_0x38fe52[_0x72ba('0x8')],_0x38fe52[_0x72ba('0xc')],_0x38fe52[_0x72ba('0xd')],_0x38fe52[_0x72ba('0xe')],_0x38fe52[_0x72ba('0xf')],_0x38fe52[_0x72ba('0x10')],_0x38fe52['connectedlinenum'],_0x38fe52['lastevent']));if(_0x38fe52[_0x72ba('0x11')]){utils[_0x72ba('0x12')](_0x38fe52[_0x72ba('0x11')])[_0x72ba('0x13')](function(_0x13f9d8){if(_0x13f9d8){_0x38fe52[_0x72ba('0x14')]=_0x13f9d8['id'];}utils['request'](_0x72ba('0x15'),_0x38fe52);});}else{utils[_0x72ba('0x16')](_0x72ba('0x15'),_0x38fe52);}if(channels[_0x38fe52[_0x72ba('0x8')]]){delete channels[_0x38fe52[_0x72ba('0x8')]];}else if(_0x401164&&channels[_0x401164]){delete transfers['blinds'][_0x401164];delete channels[_0x401164];}}exports[_0x72ba('0x17')]=function(_0x235b71){try{utils[_0x72ba('0x18')](util[_0x72ba('0xa')](_0x72ba('0x19'),_0x235b71[_0x72ba('0x8')]),_0x235b71);if(_0x235b71[_0x72ba('0x8')]==_0x235b71['linkedid']&&_0x235b71['channel']!=_0x72ba('0x1a')){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')](_0x72ba('0x1c'),_0x235b71['uniqueid'],_0x235b71['context'],_0x235b71[_0x72ba('0x1d')]));channels[_0x235b71[_0x72ba('0x8')]]={'uniqueid':_0x235b71[_0x72ba('0x8')],'accountcode':_0x235b71[_0x72ba('0x11')],'source':_0x235b71['calleridnum'],'destination':_0x235b71[_0x72ba('0x1d')],'destinationcontext':_0x235b71[_0x72ba('0x1e')],'channel':_0x235b71[_0x72ba('0xc')],'starttime':utils[_0x72ba('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x72ba('0x20')};}}catch(_0x37193d){utils[_0x72ba('0x21')](util[_0x72ba('0xa')](_0x72ba('0x19'),_0x235b71[_0x72ba('0x8')]),_0x37193d);}};exports['newstate']=function(_0x16946c){try{utils['debug'](util[_0x72ba('0xa')](_0x72ba('0x22'),_0x16946c[_0x72ba('0x8')]),_0x16946c);if(!_[_0x72ba('0x23')](channels[_0x16946c['uniqueid']])&&_0x16946c[_0x72ba('0x24')]==0x6){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x16946c[_0x72ba('0x8')],_0x16946c[_0x72ba('0x1e')],_0x16946c[_0x72ba('0xc')]));if(_['isNil'](channels[_0x16946c[_0x72ba('0x8')]][_0x72ba('0x25')])){channels[_0x16946c[_0x72ba('0x8')]]['systemanswertime']=utils[_0x72ba('0x1f')]();}}else if(!_['isNil'](channels[_0x16946c[_0x72ba('0x26')]])&&_0x16946c[_0x72ba('0x24')]==0x6&&_0x16946c['context']!='transfer'){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')](_0x72ba('0x27'),_0x16946c[_0x72ba('0x8')],_0x16946c[_0x72ba('0x26')],_0x16946c[_0x72ba('0x1e')],_0x16946c[_0x72ba('0xc')]));channels[_0x16946c[_0x72ba('0x26')]]['accountcode']=_0x16946c[_0x72ba('0x11')];channels[_0x16946c[_0x72ba('0x26')]][_0x72ba('0x28')]=_0x16946c['channel'];if(_['isNil'](channels[_0x16946c[_0x72ba('0x26')]][_0x72ba('0x29')])){channels[_0x16946c['linkedid']][_0x72ba('0x29')]=utils[_0x72ba('0x1f')]();}channels[_0x16946c['linkedid']][_0x72ba('0x2a')]=dispositions[_[_0x72ba('0x2b')](_0x16946c['channelstate'])]||_0x72ba('0x5');}}catch(_0x3e9b7c){utils['error'](util[_0x72ba('0xa')](_0x72ba('0x22'),_0x16946c[_0x72ba('0x8')]),_0x3e9b7c);}};exports[_0x72ba('0x2c')]=function(_0x2676de){try{if(!_['isNil'](channels[_0x2676de['uniqueid']])){utils[_0x72ba('0x18')](util[_0x72ba('0xa')](_0x72ba('0x2d'),_0x2676de[_0x72ba('0x8')]),_0x2676de);if(_[_0x72ba('0x23')](channels[_0x2676de['uniqueid']][_0x72ba('0x2e')])){channels[_0x2676de[_0x72ba('0x8')]][_0x72ba('0x2e')]=_0x2676de['calleridname']+'\x20<'+_0x2676de['calleridnum']+'>';}utils[_0x72ba('0x1b')](util['format'](_0x72ba('0x2f'),_0x2676de[_0x72ba('0x8')],channels[_0x2676de[_0x72ba('0x8')]][_0x72ba('0x2e')],_0x2676de[_0x72ba('0x30')]));channels[_0x2676de[_0x72ba('0x8')]][_0x72ba('0x31')]=utils['now']();channels[_0x2676de[_0x72ba('0x8')]]['duration']=utils[_0x72ba('0x32')](channels[_0x2676de[_0x72ba('0x8')]][_0x72ba('0x31')],channels[_0x2676de['uniqueid']]['starttime']);channels[_0x2676de['uniqueid']][_0x72ba('0x33')]=channels[_0x2676de[_0x72ba('0x8')]]['answertime']?utils[_0x72ba('0x32')](channels[_0x2676de[_0x72ba('0x8')]][_0x72ba('0x31')],channels[_0x2676de['uniqueid']][_0x72ba('0x29')]):0x0;writeDB(channels[_0x2676de['uniqueid']]);}}catch(_0x5eef51){utils['error'](util[_0x72ba('0xa')](_0x72ba('0x2d'),_0x2676de['uniqueid']),_0x5eef51);}};exports['attendedtransfer']=function(_0x17f312){try{if(!_[_0x72ba('0x23')](channels[_0x17f312[_0x72ba('0x34')]])){utils[_0x72ba('0x18')](util['format']('[%s][calls][attendedtransfer]',_0x17f312[_0x72ba('0x35')]),_0x17f312);if(channels[_0x17f312[_0x72ba('0x34')]]['channel']==_0x17f312[_0x72ba('0x36')]){utils['info'](util[_0x72ba('0xa')](_0x72ba('0x37'),_0x17f312[_0x72ba('0x35')],_0x17f312['localtwolinkedid'],_0x17f312[_0x72ba('0x38')]));channels[_0x17f312[_0x72ba('0x34')]]['destinationchannel']=_0x17f312[_0x72ba('0x38')];channels[_0x17f312[_0x72ba('0x34')]][_0x72ba('0x39')]='_attended';}else if(channels[_0x17f312['localtwolinkedid']][_0x72ba('0xc')]=_0x17f312[_0x72ba('0x3a')]){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')](_0x72ba('0x37'),_0x17f312[_0x72ba('0x35')],_0x17f312['localtwolinkedid'],_0x17f312[_0x72ba('0x3b')]));channels[_0x17f312[_0x72ba('0x34')]]['destinationchannel']=_0x17f312[_0x72ba('0x3b')];channels[_0x17f312[_0x72ba('0x34')]][_0x72ba('0x39')]=_0x72ba('0x3c');}}}catch(_0x35c68c){utils[_0x72ba('0x21')](util[_0x72ba('0xa')](_0x72ba('0x3d'),_0x17f312[_0x72ba('0x35')]),_0x35c68c);}};exports['musiconholdstart']=function(_0x45b155){try{if(!_[_0x72ba('0x23')](channels[_0x45b155[_0x72ba('0x8')]])){utils[_0x72ba('0x18')](util[_0x72ba('0xa')](_0x72ba('0x3e'),_0x45b155[_0x72ba('0x8')]),_0x45b155);channels[_0x45b155[_0x72ba('0x8')]]['musiconholdstartAt']=utils[_0x72ba('0x1f')]();utils[_0x72ba('0x1b')](util[_0x72ba('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x45b155[_0x72ba('0x8')],channels[_0x45b155[_0x72ba('0x8')]][_0x72ba('0x3f')]));}}catch(_0x4c7c79){utils[_0x72ba('0x21')](util['format'](_0x72ba('0x3e'),_0x45b155['uniqueid']),_0x4c7c79);}};exports[_0x72ba('0x40')]=function(_0x32c988){try{if(!_[_0x72ba('0x23')](channels[_0x32c988[_0x72ba('0x8')]])){utils[_0x72ba('0x18')](util[_0x72ba('0xa')](_0x72ba('0x41'),_0x32c988['uniqueid']),_0x32c988);if(!_['isNil'](channels[_0x32c988[_0x72ba('0x8')]][_0x72ba('0x3f')])){channels[_0x32c988[_0x72ba('0x8')]][_0x72ba('0x42')]+=utils[_0x72ba('0x32')](utils[_0x72ba('0x1f')](),channels[_0x32c988[_0x72ba('0x8')]][_0x72ba('0x3f')]);utils['info'](util[_0x72ba('0xa')](_0x72ba('0x43'),_0x32c988[_0x72ba('0x8')],channels[_0x32c988[_0x72ba('0x8')]]['mohtime']));delete channels[_0x32c988['uniqueid']][_0x72ba('0x3f')];}}}catch(_0x600e85){utils[_0x72ba('0x21')](util['format'](_0x72ba('0x41'),_0x32c988[_0x72ba('0x8')]),_0x600e85);}};exports[_0x72ba('0x44')]=function(_0x334186){try{if(!_[_0x72ba('0x23')](channels[_0x334186[_0x72ba('0x8')]])){utils[_0x72ba('0x18')](util[_0x72ba('0xa')](_0x72ba('0x45'),_0x334186[_0x72ba('0x8')]),_0x334186);if(!_[_0x72ba('0x23')](_0x334186[_0x72ba('0x46')][_0x72ba('0x47')])){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')](_0x72ba('0x48'),_0x334186[_0x72ba('0x8')],_0x334186[_0x72ba('0x49')]));channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x4a')]=_0x334186[_0x72ba('0x49')];}if(!_[_0x72ba('0x23')](_0x334186[_0x72ba('0x46')][_0x72ba('0x4b')])){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')](_0x72ba('0x4c'),_0x334186['uniqueid'],_0x334186['value']));channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x4d')]=_0x334186['value'];channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x2e')]='\x22'+_0x334186[_0x72ba('0x49')]+_0x72ba('0x4e')+_0x334186[_0x72ba('0x49')]+'>';}if(!_[_0x72ba('0x23')](_0x334186['variable'][_0x72ba('0x4f')])||!_['isNil'](_0x334186['variable'][_0x72ba('0x50')])){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x334186['uniqueid'],!_[_0x72ba('0x23')](_0x334186[_0x72ba('0x46')][_0x72ba('0x4f')])?_0x72ba('0x4f'):_0x72ba('0x50'),_0x334186[_0x72ba('0x49')]));channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x2e')]=_0x334186[_0x72ba('0x49')];}if(!_[_0x72ba('0x23')](_0x334186['variable']['xmd-queue'])||!_['isNil'](_0x334186[_0x72ba('0x46')][_0x72ba('0x51')])){utils['info'](util[_0x72ba('0xa')](_0x72ba('0x52'),_0x334186[_0x72ba('0x8')],!_[_0x72ba('0x23')](_0x334186['variable'][_0x72ba('0x53')])?_0x72ba('0x53'):_0x72ba('0x51'),_0x334186[_0x72ba('0x49')]));channels[_0x334186['uniqueid']][_0x72ba('0x54')]='Queue';channels[_0x334186[_0x72ba('0x8')]]['lastdata']=_0x334186[_0x72ba('0x49')];channels[_0x334186['uniqueid']][_0x72ba('0xd')]=!![];}if(!_['isNil'](_0x334186[_0x72ba('0x46')][_0x72ba('0x55')])){utils['info'](util[_0x72ba('0xa')](_0x72ba('0x56'),_0x334186[_0x72ba('0x8')],_0x334186['value']));channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x57')]=_0x334186[_0x72ba('0x49')];}if(!_[_0x72ba('0x23')](_0x334186[_0x72ba('0x46')][_0x72ba('0x58')])){utils['info'](util[_0x72ba('0xa')](_0x72ba('0x59'),_0x334186[_0x72ba('0x8')],_0x334186[_0x72ba('0x49')]));channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x5a')]=_0x334186[_0x72ba('0x49')];}if(!_['isNil'](_0x334186[_0x72ba('0x46')][_0x72ba('0x5b')])){utils[_0x72ba('0x1b')](util['format'](_0x72ba('0x5c'),_0x334186[_0x72ba('0x8')],_0x334186[_0x72ba('0x49')]));channels[_0x334186['uniqueid']][_0x72ba('0x5d')]=_0x334186[_0x72ba('0x49')];}if(!_['isNil'](_0x334186[_0x72ba('0x46')][_0x72ba('0x5e')])){utils[_0x72ba('0x1b')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x334186['uniqueid'],_0x334186[_0x72ba('0x49')]));channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x5e')]=_0x334186[_0x72ba('0x49')];}}}catch(_0x5ae216){utils[_0x72ba('0x21')](util[_0x72ba('0xa')](_0x72ba('0x45'),_0x334186[_0x72ba('0x8')]),_0x5ae216);}};exports['newexten']=function(_0x4aed0e){try{if(!_['isNil'](channels[_0x4aed0e[_0x72ba('0x8')]])){utils[_0x72ba('0x18')](util[_0x72ba('0xa')](_0x72ba('0x5f'),_0x4aed0e['uniqueid']),_0x4aed0e);utils[_0x72ba('0x1b')](util[_0x72ba('0xa')](_0x72ba('0x60'),_0x4aed0e[_0x72ba('0x8')],_0x4aed0e[_0x72ba('0x61')],_0x4aed0e[_0x72ba('0x62')]));if(_0x4aed0e['application'][_0x72ba('0x63')]()=='set'&&_['startsWith'](_0x4aed0e[_0x72ba('0x62')]['toLowerCase'](),_0x72ba('0x64'))){var _0xa12f9e=_0x4aed0e[_0x72ba('0x62')][_0x72ba('0x65')]('=');var _0x1b6063=_0xa12f9e[0x0]['substring'](_0xa12f9e[0x0][_0x72ba('0x66')]('(')+0x1,_0xa12f9e[0x0][_0x72ba('0x66')](')'));var _0x3166cd=_0xa12f9e[0x1];channels[_0x4aed0e[_0x72ba('0x8')]][_0x1b6063]=_0x3166cd;}if(!_[_0x72ba('0x67')]([_0x72ba('0x2c'),_0x72ba('0x68'),_0x72ba('0x69'),'set',_0x72ba('0x6a')],_0x4aed0e[_0x72ba('0x61')][_0x72ba('0x63')]())){channels[_0x4aed0e['uniqueid']][_0x72ba('0x54')]=_0x4aed0e[_0x72ba('0x61')];channels[_0x4aed0e[_0x72ba('0x8')]][_0x72ba('0x6b')]=_0x4aed0e[_0x72ba('0x62')];}}}catch(_0x39f5ba){utils[_0x72ba('0x21')](util[_0x72ba('0xa')](_0x72ba('0x5f'),_0x4aed0e[_0x72ba('0x8')]),_0x39f5ba);}};
\ No newline at end of file
+var _0x5aeb=['Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','application','appdata','set','toLowerCase','cdr','substring','lastIndexOf','includes','noop','execif','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','disposition','toNumber','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','cause-txt','endtime','diffTime','starttime','billableseconds','answertime','error','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','destinationchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','[%s][calls][varset]','variable','xmd-originatecalleridnum','source','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication'];(function(_0x463e98,_0x4bdb36){var _0x4fc02c=function(_0x46f513){while(--_0x46f513){_0x463e98['push'](_0x463e98['shift']());}};_0x4fc02c(++_0x4bdb36);}(_0x5aeb,0xe8));var _0xb5ae=function(_0x57b49d,_0x40dbee){_0x57b49d=_0x57b49d-0x0;var _0x3f6b3b=_0x5aeb[_0x57b49d];return _0x3f6b3b;};'use strict';var _=require(_0xb5ae('0x0'));var util=require(_0xb5ae('0x1'));var utils=require(_0xb5ae('0x2'));var transfers=require('./transfers.controller');var dispositions=['NO\x20ANSWER','FAILED',_0xb5ae('0x3'),_0xb5ae('0x4'),_0xb5ae('0x4'),_0xb5ae('0x4'),_0xb5ae('0x5'),_0xb5ae('0x6'),_0xb5ae('0x3'),'FAILED',_0xb5ae('0x3')];var channels={};function writeDB(_0x28794e){var _0x3560e;if(transfers[_0xb5ae('0x7')][_0x28794e['uniqueid']]){_0x3560e=_0x28794e['uniqueid'];_0x28794e[_0xb5ae('0x8')]=transfers[_0xb5ae('0x7')][_0x28794e[_0xb5ae('0x8')]][_0xb5ae('0x9')];}utils[_0xb5ae('0xa')](util['format'](_0xb5ae('0xb'),_0x28794e[_0xb5ae('0x8')],_0x28794e[_0xb5ae('0xc')],_0x28794e[_0xb5ae('0xd')],_0x28794e['membername'],_0x28794e[_0xb5ae('0xe')],_0x28794e[_0xb5ae('0xf')],_0x28794e[_0xb5ae('0x10')],_0x28794e[_0xb5ae('0x11')]));if(_0x28794e[_0xb5ae('0x12')]){utils[_0xb5ae('0x13')](_0x28794e[_0xb5ae('0x12')])['then'](function(_0x47dbbc){if(_0x47dbbc){_0x28794e[_0xb5ae('0x14')]=_0x47dbbc['id'];}utils[_0xb5ae('0x15')](_0xb5ae('0x16'),_0x28794e);});}else{utils[_0xb5ae('0x15')](_0xb5ae('0x16'),_0x28794e);}if(channels[_0x28794e['uniqueid']]){delete channels[_0x28794e[_0xb5ae('0x8')]];}else if(_0x3560e&&channels[_0x3560e]){delete transfers[_0xb5ae('0x7')][_0x3560e];delete channels[_0x3560e];}}exports[_0xb5ae('0x17')]=function(_0x59a23a){try{utils[_0xb5ae('0x18')](util[_0xb5ae('0x19')](_0xb5ae('0x1a'),_0x59a23a[_0xb5ae('0x8')]),_0x59a23a);if(_0x59a23a[_0xb5ae('0x8')]==_0x59a23a[_0xb5ae('0x1b')]&&_0x59a23a[_0xb5ae('0xc')]!=_0xb5ae('0x1c')){utils[_0xb5ae('0xa')](util[_0xb5ae('0x19')](_0xb5ae('0x1d'),_0x59a23a[_0xb5ae('0x8')],_0x59a23a['context'],_0x59a23a[_0xb5ae('0x1e')]));channels[_0x59a23a[_0xb5ae('0x8')]]={'uniqueid':_0x59a23a['uniqueid'],'accountcode':_0x59a23a[_0xb5ae('0x12')],'source':_0x59a23a[_0xb5ae('0xf')],'destination':_0x59a23a[_0xb5ae('0x1e')],'destinationcontext':_0x59a23a[_0xb5ae('0x1f')],'channel':_0x59a23a[_0xb5ae('0xc')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xb5ae('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x55c186){utils['error'](util[_0xb5ae('0x19')](_0xb5ae('0x1a'),_0x59a23a[_0xb5ae('0x8')]),_0x55c186);}};exports[_0xb5ae('0x20')]=function(_0x2523f2){try{utils['debug'](util[_0xb5ae('0x19')]('[%s][calls][newstate]',_0x2523f2[_0xb5ae('0x8')]),_0x2523f2);if(!_[_0xb5ae('0x21')](channels[_0x2523f2[_0xb5ae('0x8')]])&&_0x2523f2[_0xb5ae('0x22')]==0x6){utils[_0xb5ae('0xa')](util['format'](_0xb5ae('0x23'),_0x2523f2[_0xb5ae('0x8')],_0x2523f2[_0xb5ae('0x1f')],_0x2523f2[_0xb5ae('0xc')]));if(_['isNil'](channels[_0x2523f2[_0xb5ae('0x8')]][_0xb5ae('0x24')])){channels[_0x2523f2[_0xb5ae('0x8')]][_0xb5ae('0x24')]=utils[_0xb5ae('0x25')]();}}else if(!_[_0xb5ae('0x21')](channels[_0x2523f2['linkedid']])&&_0x2523f2[_0xb5ae('0x22')]==0x6&&_0x2523f2['context']!=_0xb5ae('0x26')){utils['info'](util[_0xb5ae('0x19')](_0xb5ae('0x27'),_0x2523f2[_0xb5ae('0x8')],_0x2523f2[_0xb5ae('0x1b')],_0x2523f2[_0xb5ae('0x1f')],_0x2523f2['channel']));channels[_0x2523f2['linkedid']][_0xb5ae('0x12')]=_0x2523f2[_0xb5ae('0x12')];channels[_0x2523f2[_0xb5ae('0x1b')]]['destinationchannel']=_0x2523f2['channel'];if(_[_0xb5ae('0x21')](channels[_0x2523f2[_0xb5ae('0x1b')]]['answertime'])){channels[_0x2523f2['linkedid']]['answertime']=utils[_0xb5ae('0x25')]();}channels[_0x2523f2['linkedid']][_0xb5ae('0x28')]=dispositions[_[_0xb5ae('0x29')](_0x2523f2[_0xb5ae('0x22')])]||_0xb5ae('0x5');}}catch(_0x431c56){utils['error'](util[_0xb5ae('0x19')](_0xb5ae('0x2a'),_0x2523f2['uniqueid']),_0x431c56);}};exports[_0xb5ae('0x2b')]=function(_0xab6047){try{if(!_[_0xb5ae('0x21')](channels[_0xab6047[_0xb5ae('0x8')]])){utils[_0xb5ae('0x18')](util[_0xb5ae('0x19')](_0xb5ae('0x2c'),_0xab6047[_0xb5ae('0x8')]),_0xab6047);if(_[_0xb5ae('0x21')](channels[_0xab6047['uniqueid']][_0xb5ae('0x2d')])){channels[_0xab6047['uniqueid']][_0xb5ae('0x2d')]=_0xab6047['calleridname']+'\x20<'+_0xab6047[_0xb5ae('0xf')]+'>';}utils['info'](util[_0xb5ae('0x19')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0xab6047['uniqueid'],channels[_0xab6047[_0xb5ae('0x8')]][_0xb5ae('0x2d')],_0xab6047[_0xb5ae('0x2e')]));channels[_0xab6047[_0xb5ae('0x8')]][_0xb5ae('0x2f')]=utils[_0xb5ae('0x25')]();channels[_0xab6047[_0xb5ae('0x8')]]['duration']=utils[_0xb5ae('0x30')](channels[_0xab6047[_0xb5ae('0x8')]][_0xb5ae('0x2f')],channels[_0xab6047['uniqueid']][_0xb5ae('0x31')]);channels[_0xab6047[_0xb5ae('0x8')]][_0xb5ae('0x32')]=channels[_0xab6047[_0xb5ae('0x8')]][_0xb5ae('0x33')]?utils['diffTime'](channels[_0xab6047[_0xb5ae('0x8')]][_0xb5ae('0x2f')],channels[_0xab6047[_0xb5ae('0x8')]]['answertime']):0x0;writeDB(channels[_0xab6047['uniqueid']]);}}catch(_0x18fe5c){utils[_0xb5ae('0x34')](util[_0xb5ae('0x19')](_0xb5ae('0x2c'),_0xab6047[_0xb5ae('0x8')]),_0x18fe5c);}};exports[_0xb5ae('0x35')]=function(_0x2af4fa){try{if(!_[_0xb5ae('0x21')](channels[_0x2af4fa[_0xb5ae('0x36')]])){utils[_0xb5ae('0x18')](util[_0xb5ae('0x19')](_0xb5ae('0x37'),_0x2af4fa['origtransfereruniqueid']),_0x2af4fa);if(channels[_0x2af4fa[_0xb5ae('0x36')]][_0xb5ae('0xc')]==_0x2af4fa['transfereechannel']){utils[_0xb5ae('0xa')](util[_0xb5ae('0x19')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2af4fa[_0xb5ae('0x38')],_0x2af4fa['localtwolinkedid'],_0x2af4fa['secondtransfererchannel']));channels[_0x2af4fa['localtwolinkedid']]['destinationchannel']=_0x2af4fa[_0xb5ae('0x39')];channels[_0x2af4fa[_0xb5ae('0x36')]][_0xb5ae('0x3a')]=_0xb5ae('0x3b');}else if(channels[_0x2af4fa['localtwolinkedid']]['channel']=_0x2af4fa[_0xb5ae('0x3c')]){utils['info'](util[_0xb5ae('0x19')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2af4fa[_0xb5ae('0x38')],_0x2af4fa[_0xb5ae('0x36')],_0x2af4fa[_0xb5ae('0x3d')]));channels[_0x2af4fa[_0xb5ae('0x36')]][_0xb5ae('0x3e')]=_0x2af4fa['origtransfererchannel'];channels[_0x2af4fa['localtwolinkedid']][_0xb5ae('0x3a')]=_0xb5ae('0x3b');}}}catch(_0x47a505){utils[_0xb5ae('0x34')](util[_0xb5ae('0x19')](_0xb5ae('0x37'),_0x2af4fa['origtransfereruniqueid']),_0x47a505);}};exports['musiconholdstart']=function(_0x491c76){try{if(!_[_0xb5ae('0x21')](channels[_0x491c76[_0xb5ae('0x8')]])){utils[_0xb5ae('0x18')](util[_0xb5ae('0x19')](_0xb5ae('0x3f'),_0x491c76[_0xb5ae('0x8')]),_0x491c76);channels[_0x491c76[_0xb5ae('0x8')]][_0xb5ae('0x40')]=utils[_0xb5ae('0x25')]();utils[_0xb5ae('0xa')](util[_0xb5ae('0x19')](_0xb5ae('0x41'),_0x491c76['uniqueid'],channels[_0x491c76[_0xb5ae('0x8')]][_0xb5ae('0x40')]));}}catch(_0xa9e100){utils['error'](util[_0xb5ae('0x19')](_0xb5ae('0x3f'),_0x491c76['uniqueid']),_0xa9e100);}};exports[_0xb5ae('0x42')]=function(_0x2e6bed){try{if(!_[_0xb5ae('0x21')](channels[_0x2e6bed[_0xb5ae('0x8')]])){utils[_0xb5ae('0x18')](util[_0xb5ae('0x19')]('[%s][calls][musiconholdstop]',_0x2e6bed['uniqueid']),_0x2e6bed);if(!_[_0xb5ae('0x21')](channels[_0x2e6bed['uniqueid']]['musiconholdstartAt'])){channels[_0x2e6bed['uniqueid']][_0xb5ae('0x43')]+=utils[_0xb5ae('0x30')](utils[_0xb5ae('0x25')](),channels[_0x2e6bed[_0xb5ae('0x8')]][_0xb5ae('0x40')]);utils['info'](util[_0xb5ae('0x19')](_0xb5ae('0x44'),_0x2e6bed['uniqueid'],channels[_0x2e6bed[_0xb5ae('0x8')]]['mohtime']));delete channels[_0x2e6bed['uniqueid']][_0xb5ae('0x40')];}}}catch(_0x3f8796){utils['error'](util[_0xb5ae('0x19')](_0xb5ae('0x45'),_0x2e6bed[_0xb5ae('0x8')]),_0x3f8796);}};exports['varset']=function(_0x45e974){try{if(!_['isNil'](channels[_0x45e974[_0xb5ae('0x8')]])){utils[_0xb5ae('0x18')](util['format'](_0xb5ae('0x46'),_0x45e974[_0xb5ae('0x8')]),_0x45e974);if(!_[_0xb5ae('0x21')](_0x45e974[_0xb5ae('0x47')][_0xb5ae('0x48')])){utils[_0xb5ae('0xa')](util[_0xb5ae('0x19')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x45e974[_0xb5ae('0x8')],_0x45e974['value']));channels[_0x45e974['uniqueid']][_0xb5ae('0x49')]=_0x45e974[_0xb5ae('0x4a')];}if(!_[_0xb5ae('0x21')](_0x45e974[_0xb5ae('0x47')]['xmd-phone'])){utils[_0xb5ae('0xa')](util[_0xb5ae('0x19')](_0xb5ae('0x4b'),_0x45e974[_0xb5ae('0x8')],_0x45e974[_0xb5ae('0x4a')]));channels[_0x45e974[_0xb5ae('0x8')]][_0xb5ae('0x4c')]=_0x45e974[_0xb5ae('0x4a')];channels[_0x45e974['uniqueid']][_0xb5ae('0x2d')]='\x22'+_0x45e974[_0xb5ae('0x4a')]+_0xb5ae('0x4d')+_0x45e974[_0xb5ae('0x4a')]+'>';}if(!_[_0xb5ae('0x21')](_0x45e974[_0xb5ae('0x47')]['xmd-callerid-preview'])||!_[_0xb5ae('0x21')](_0x45e974['variable']['xmd-callerid'])){utils[_0xb5ae('0xa')](util[_0xb5ae('0x19')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x45e974[_0xb5ae('0x8')],!_[_0xb5ae('0x21')](_0x45e974[_0xb5ae('0x47')]['xmd-callerid-preview'])?'xmd-callerid-preview':_0xb5ae('0x4e'),_0x45e974['value']));channels[_0x45e974[_0xb5ae('0x8')]][_0xb5ae('0x2d')]=_0x45e974[_0xb5ae('0x4a')];}if(!_[_0xb5ae('0x21')](_0x45e974[_0xb5ae('0x47')][_0xb5ae('0x4f')])||!_[_0xb5ae('0x21')](_0x45e974[_0xb5ae('0x47')][_0xb5ae('0x50')])){utils['info'](util['format'](_0xb5ae('0x51'),_0x45e974[_0xb5ae('0x8')],!_[_0xb5ae('0x21')](_0x45e974[_0xb5ae('0x47')]['xmd-queue'])?'xmd-queue':_0xb5ae('0x50'),_0x45e974[_0xb5ae('0x4a')]));channels[_0x45e974[_0xb5ae('0x8')]][_0xb5ae('0x52')]=_0xb5ae('0x53');channels[_0x45e974[_0xb5ae('0x8')]][_0xb5ae('0x54')]=_0x45e974['value'];channels[_0x45e974[_0xb5ae('0x8')]][_0xb5ae('0xd')]=!![];}if(!_['isNil'](_0x45e974[_0xb5ae('0x47')]['xmd-contactid'])){utils[_0xb5ae('0xa')](util[_0xb5ae('0x19')](_0xb5ae('0x55'),_0x45e974[_0xb5ae('0x8')],_0x45e974[_0xb5ae('0x4a')]));channels[_0x45e974['uniqueid']][_0xb5ae('0x56')]=_0x45e974['value'];}if(!_[_0xb5ae('0x21')](_0x45e974[_0xb5ae('0x47')][_0xb5ae('0x57')])){utils[_0xb5ae('0xa')](util[_0xb5ae('0x19')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x45e974[_0xb5ae('0x8')],_0x45e974[_0xb5ae('0x4a')]));channels[_0x45e974[_0xb5ae('0x8')]][_0xb5ae('0x58')]=_0x45e974[_0xb5ae('0x4a')];}if(!_[_0xb5ae('0x21')](_0x45e974['variable'][_0xb5ae('0x59')])){utils[_0xb5ae('0xa')](util['format'](_0xb5ae('0x5a'),_0x45e974[_0xb5ae('0x8')],_0x45e974[_0xb5ae('0x4a')]));channels[_0x45e974[_0xb5ae('0x8')]][_0xb5ae('0x5b')]=_0x45e974[_0xb5ae('0x4a')];}if(!_[_0xb5ae('0x21')](_0x45e974['variable'][_0xb5ae('0x5c')])){utils['info'](util[_0xb5ae('0x19')](_0xb5ae('0x5d'),_0x45e974[_0xb5ae('0x8')],_0x45e974[_0xb5ae('0x4a')]));channels[_0x45e974[_0xb5ae('0x8')]][_0xb5ae('0x5c')]=_0x45e974[_0xb5ae('0x4a')];}}}catch(_0x232a47){utils[_0xb5ae('0x34')](util[_0xb5ae('0x19')](_0xb5ae('0x46'),_0x45e974[_0xb5ae('0x8')]),_0x232a47);}};exports['newexten']=function(_0x57595d){try{if(!_['isNil'](channels[_0x57595d[_0xb5ae('0x8')]])){utils[_0xb5ae('0x18')](util['format'](_0xb5ae('0x5e'),_0x57595d[_0xb5ae('0x8')]),_0x57595d);utils[_0xb5ae('0xa')](util[_0xb5ae('0x19')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x57595d[_0xb5ae('0x8')],_0x57595d[_0xb5ae('0x5f')],_0x57595d[_0xb5ae('0x60')]));if(_0x57595d['application']['toLowerCase']()==_0xb5ae('0x61')&&_['startsWith'](_0x57595d[_0xb5ae('0x60')][_0xb5ae('0x62')](),_0xb5ae('0x63'))){var _0x54040b=_0x57595d[_0xb5ae('0x60')]['split']('=');var _0x4b1f01=_0x54040b[0x0][_0xb5ae('0x64')](_0x54040b[0x0][_0xb5ae('0x65')]('(')+0x1,_0x54040b[0x0]['lastIndexOf'](')'));var _0x18116a=_0x54040b[0x1];channels[_0x57595d[_0xb5ae('0x8')]][_0x4b1f01]=_0x18116a;}if(!_[_0xb5ae('0x66')](['hangup',_0xb5ae('0x67'),_0xb5ae('0x68'),_0xb5ae('0x61'),'gotoif'],_0x57595d[_0xb5ae('0x5f')]['toLowerCase']())){channels[_0x57595d[_0xb5ae('0x8')]][_0xb5ae('0x52')]=_0x57595d[_0xb5ae('0x5f')];channels[_0x57595d[_0xb5ae('0x8')]][_0xb5ae('0x54')]=_0x57595d['appdata'];}}}catch(_0x151e7a){utils[_0xb5ae('0x34')](util[_0xb5ae('0x19')](_0xb5ae('0x5e'),_0x57595d[_0xb5ae('0x8')]),_0x151e7a);}};
\ No newline at end of file
index 0a3d214..b04a60c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eba=['fullybooted','[core]\x20fullybooted','error','managerevent','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown'];(function(_0x20118a,_0x3dbdf3){var _0x538b5f=function(_0x31c5b4){while(--_0x31c5b4){_0x20118a['push'](_0x20118a['shift']());}};_0x538b5f(++_0x3dbdf3);}(_0x3eba,0x70));var _0xa3eb=function(_0x55ae2b,_0xf5da91){_0x55ae2b=_0x55ae2b-0x0;var _0x23d940=_0x3eba[_0x55ae2b];return _0x23d940;};'use strict';var utils=require('./utils');exports[_0xa3eb('0x0')]=function(){utils[_0xa3eb('0x1')](_0xa3eb('0x2'));};exports[_0xa3eb('0x3')]=function(){utils[_0xa3eb('0x1')](_0xa3eb('0x4'));};exports[_0xa3eb('0x5')]=function(){utils['info'](_0xa3eb('0x6'));};exports[_0xa3eb('0x7')]=function(_0x39c600){utils[_0xa3eb('0x7')]('[core]\x20error',_0x39c600);};exports['close']=function(){utils['info']('[core]\x20close');};exports[_0xa3eb('0x8')]=function(_0x4c9858){};
\ No newline at end of file
+var _0xd638=['shutdown','info','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','managerevent','./utils'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0xd638,0x143));var _0x8d63=function(_0x58fa29,_0x1135f2){_0x58fa29=_0x58fa29-0x0;var _0x59044e=_0xd638[_0x58fa29];return _0x59044e;};'use strict';var utils=require(_0x8d63('0x0'));exports['connect']=function(){utils['info']('[core]\x20connected');};exports[_0x8d63('0x1')]=function(){utils[_0x8d63('0x2')]('[core]\x20shutdown');};exports[_0x8d63('0x3')]=function(){utils[_0x8d63('0x2')](_0x8d63('0x4'));};exports[_0x8d63('0x5')]=function(_0x24b88a){utils[_0x8d63('0x5')](_0x8d63('0x6'),_0x24b88a);};exports[_0x8d63('0x7')]=function(){utils[_0x8d63('0x2')]('[core]\x20close');};exports[_0x8d63('0x8')]=function(_0x562041){};
\ No newline at end of file
index 00b1b29..24ebf4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a4c=['diffTime','endtime','holdtime','billableseconds','lodash','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','info','application','appdata','set','startsWith','cdr(routeid)','split','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','cause-txt','complete'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x6a4c,0x94));var _0xc6a4=function(_0x41ca7c,_0xdd8d75){_0x41ca7c=_0x41ca7c-0x0;var _0x291695=_0x6a4c[_0x41ca7c];return _0x291695;};'use strict';var _=require(_0xc6a4('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0xcaafc5){utils['info'](util['format'](_0xc6a4('0x1'),_0xcaafc5[_0xc6a4('0x2')],_0xcaafc5[_0xc6a4('0x3')],_0xcaafc5['dialstring'],_0xcaafc5[_0xc6a4('0x4')],_0xcaafc5[_0xc6a4('0x5')],_0xcaafc5['dialstatus']));utils['request'](_0xc6a4('0x6'),_0xcaafc5);delete dials[_0xcaafc5[_0xc6a4('0x2')]];}exports[_0xc6a4('0x7')]=function(_0x33e1b5){try{utils[_0xc6a4('0x8')](util[_0xc6a4('0x9')](_0xc6a4('0xa'),_0x33e1b5[_0xc6a4('0x2')]),_0x33e1b5);utils[_0xc6a4('0xb')](util[_0xc6a4('0x9')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x33e1b5[_0xc6a4('0x2')],_0x33e1b5[_0xc6a4('0xc')],_0x33e1b5[_0xc6a4('0xd')]));if(_0x33e1b5[_0xc6a4('0xc')]['toLowerCase']()==_0xc6a4('0xe')&&_[_0xc6a4('0xf')](_0x33e1b5[_0xc6a4('0xd')]['toLowerCase'](),_0xc6a4('0x10'))){var _0x1eec5e=_0x33e1b5[_0xc6a4('0xd')][_0xc6a4('0x11')]('=');dials[_0x33e1b5[_0xc6a4('0x2')]]={'routeId':_0x1eec5e[0x1]};}}catch(_0x3aff43){utils['error'](util['format'](_0xc6a4('0xa'),_0x33e1b5[_0xc6a4('0x2')]),_0x3aff43);}};exports['varset']=function(_0x2fe7a0){try{utils['debug'](util[_0xc6a4('0x9')](_0xc6a4('0x12'),_0x2fe7a0[_0xc6a4('0x2')]),_0x2fe7a0);if(!_[_0xc6a4('0x13')](_0x2fe7a0[_0xc6a4('0x14')][_0xc6a4('0x15')])){utils['info'](util[_0xc6a4('0x9')](_0xc6a4('0x16'),_0x2fe7a0[_0xc6a4('0x2')],_0x2fe7a0[_0xc6a4('0x17')]));dials[_0x2fe7a0['uniqueid']]={'routeId':_0x2fe7a0['value']};}}catch(_0x3fad59){utils[_0xc6a4('0x18')](util[_0xc6a4('0x9')](_0xc6a4('0x12'),_0x2fe7a0[_0xc6a4('0x2')]),_0x3fad59);}};exports[_0xc6a4('0x19')]=function(_0x4a7f5b){try{if(!_[_0xc6a4('0x13')](dials[_0x4a7f5b[_0xc6a4('0x2')]])){utils[_0xc6a4('0x8')](util[_0xc6a4('0x9')]('[%s][dials][dialbegin]',_0x4a7f5b[_0xc6a4('0x2')]),_0x4a7f5b);dials[_0x4a7f5b['uniqueid']]=_[_0xc6a4('0x1a')](dials[_0x4a7f5b[_0xc6a4('0x2')]],_0x4a7f5b);dials[_0x4a7f5b[_0xc6a4('0x2')]][_0xc6a4('0x1b')]=utils[_0xc6a4('0x1c')]();dials[_0x4a7f5b[_0xc6a4('0x2')]][_0xc6a4('0x1d')]=_0xc6a4('0x1e');utils[_0xc6a4('0xb')](util[_0xc6a4('0x9')](_0xc6a4('0x1f'),_0x4a7f5b['uniqueid'],dials[_0x4a7f5b['uniqueid']]['starttime']));}}catch(_0x242d0a){utils[_0xc6a4('0x18')](util[_0xc6a4('0x9')](_0xc6a4('0x20'),_0x4a7f5b[_0xc6a4('0x2')]),_0x242d0a);}};exports[_0xc6a4('0x21')]=function(_0xd82a95){try{if(!_['isNil'](dials[_0xd82a95[_0xc6a4('0x2')]])){utils[_0xc6a4('0x8')](util[_0xc6a4('0x9')](_0xc6a4('0x22'),_0xd82a95['uniqueid']),_0xd82a95);dials[_0xd82a95['uniqueid']][_0xc6a4('0x23')]=_0xd82a95['dialstatus'];if(_0xd82a95[_0xc6a4('0x23')]==_0xc6a4('0x24')){dials[_0xd82a95[_0xc6a4('0x2')]]=_['assign'](dials[_0xd82a95[_0xc6a4('0x2')]],_0xd82a95);dials[_0xd82a95['uniqueid']][_0xc6a4('0x25')]=utils[_0xc6a4('0x1c')]();dials[_0xd82a95[_0xc6a4('0x2')]][_0xc6a4('0x1d')]=_0xc6a4('0x26');utils['info'](util[_0xc6a4('0x9')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0xd82a95[_0xc6a4('0x2')],_0xd82a95['dialstatus'],dials[_0xd82a95[_0xc6a4('0x2')]][_0xc6a4('0x25')]));}else{utils['info'](util[_0xc6a4('0x9')](_0xc6a4('0x27'),_0xd82a95['uniqueid'],_0xd82a95[_0xc6a4('0x23')]));}}}catch(_0x1eaeea){utils[_0xc6a4('0x18')](util[_0xc6a4('0x9')](_0xc6a4('0x22'),_0xd82a95[_0xc6a4('0x2')]),_0x1eaeea);}};exports[_0xc6a4('0x28')]=function(_0xe3e6ac){try{if(!_[_0xc6a4('0x13')](dials[_0xe3e6ac['uniqueid']])){utils[_0xc6a4('0x8')](util[_0xc6a4('0x9')](_0xc6a4('0x29'),_0xe3e6ac[_0xc6a4('0x2')]),_0xe3e6ac);utils['info'](util[_0xc6a4('0x9')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0xe3e6ac[_0xc6a4('0x2')],_0xe3e6ac['calleridnum'],_0xe3e6ac['calleridname'],_0xe3e6ac[_0xc6a4('0x2a')]));dials[_0xe3e6ac['uniqueid']]=_[_0xc6a4('0x1a')](dials[_0xe3e6ac[_0xc6a4('0x2')]],{'endtime':utils[_0xc6a4('0x1c')](),'lastevent':_0xc6a4('0x2b')});dials[_0xe3e6ac[_0xc6a4('0x2')]]['duration']=utils[_0xc6a4('0x2c')](dials[_0xe3e6ac[_0xc6a4('0x2')]][_0xc6a4('0x2d')],dials[_0xe3e6ac[_0xc6a4('0x2')]][_0xc6a4('0x1b')]);dials[_0xe3e6ac[_0xc6a4('0x2')]][_0xc6a4('0x2e')]=utils['diffTime'](dials[_0xe3e6ac[_0xc6a4('0x2')]][_0xc6a4('0x25')]||dials[_0xe3e6ac['uniqueid']]['endtime'],dials[_0xe3e6ac['uniqueid']][_0xc6a4('0x1b')]);dials[_0xe3e6ac[_0xc6a4('0x2')]][_0xc6a4('0x2f')]=dials[_0xe3e6ac[_0xc6a4('0x2')]]['answertime']?utils[_0xc6a4('0x2c')](dials[_0xe3e6ac[_0xc6a4('0x2')]]['endtime'],dials[_0xe3e6ac[_0xc6a4('0x2')]]['answertime']):0x0;writeDB(dials[_0xe3e6ac[_0xc6a4('0x2')]]);}}catch(_0x2e74ad){utils[_0xc6a4('0x18')](util[_0xc6a4('0x9')](_0xc6a4('0x29'),_0xe3e6ac[_0xc6a4('0x2')]),_0x2e74ad);}};
\ No newline at end of file
+var _0xdc6f=['called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','now','complete','endtime','holdtime','diffTime','billableseconds','[%s][dials][hangup]','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','dialstatus','newexten','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr(routeid)','split','error','debug','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','lastevent'];(function(_0x11a650,_0xeca04c){var _0x5c076b=function(_0x333f3a){while(--_0x333f3a){_0x11a650['push'](_0x11a650['shift']());}};_0x5c076b(++_0xeca04c);}(_0xdc6f,0x171));var _0xfdc6=function(_0x21abf1,_0xcd06d){_0x21abf1=_0x21abf1-0x0;var _0x8f3ba=_0xdc6f[_0x21abf1];return _0x8f3ba;};'use strict';var _=require(_0xfdc6('0x0'));var util=require(_0xfdc6('0x1'));var utils=require(_0xfdc6('0x2'));var dials={};function writeDB(_0x599fa9){utils[_0xfdc6('0x3')](util['format'](_0xfdc6('0x4'),_0x599fa9[_0xfdc6('0x5')],_0x599fa9['channel'],_0x599fa9[_0xfdc6('0x6')],_0x599fa9[_0xfdc6('0x7')],_0x599fa9['connectedlinenum'],_0x599fa9[_0xfdc6('0x8')]));utils['request']('CreateVoiceDialReport',_0x599fa9);delete dials[_0x599fa9[_0xfdc6('0x5')]];}exports[_0xfdc6('0x9')]=function(_0x4c638b){try{utils['debug'](util[_0xfdc6('0xa')](_0xfdc6('0xb'),_0x4c638b[_0xfdc6('0x5')]),_0x4c638b);utils[_0xfdc6('0x3')](util[_0xfdc6('0xa')](_0xfdc6('0xc'),_0x4c638b[_0xfdc6('0x5')],_0x4c638b['application'],_0x4c638b['appdata']));if(_0x4c638b[_0xfdc6('0xd')][_0xfdc6('0xe')]()==_0xfdc6('0xf')&&_[_0xfdc6('0x10')](_0x4c638b['appdata'][_0xfdc6('0xe')](),_0xfdc6('0x11'))){var _0x34db8b=_0x4c638b['appdata'][_0xfdc6('0x12')]('=');dials[_0x4c638b[_0xfdc6('0x5')]]={'routeId':_0x34db8b[0x1]};}}catch(_0x5b1587){utils[_0xfdc6('0x13')](util[_0xfdc6('0xa')](_0xfdc6('0xb'),_0x4c638b[_0xfdc6('0x5')]),_0x5b1587);}};exports['varset']=function(_0x3ae49c){try{utils[_0xfdc6('0x14')](util[_0xfdc6('0xa')](_0xfdc6('0x15'),_0x3ae49c[_0xfdc6('0x5')]),_0x3ae49c);if(!_[_0xfdc6('0x16')](_0x3ae49c[_0xfdc6('0x17')][_0xfdc6('0x18')])){utils[_0xfdc6('0x3')](util['format'](_0xfdc6('0x19'),_0x3ae49c['uniqueid'],_0x3ae49c[_0xfdc6('0x1a')]));dials[_0x3ae49c['uniqueid']]={'routeId':_0x3ae49c[_0xfdc6('0x1a')]};}}catch(_0x233fc8){utils[_0xfdc6('0x13')](util[_0xfdc6('0xa')](_0xfdc6('0x15'),_0x3ae49c['uniqueid']),_0x233fc8);}};exports[_0xfdc6('0x1b')]=function(_0x200ce7){try{if(!_['isNil'](dials[_0x200ce7[_0xfdc6('0x5')]])){utils[_0xfdc6('0x14')](util['format']('[%s][dials][dialbegin]',_0x200ce7[_0xfdc6('0x5')]),_0x200ce7);dials[_0x200ce7['uniqueid']]=_[_0xfdc6('0x1c')](dials[_0x200ce7[_0xfdc6('0x5')]],_0x200ce7);dials[_0x200ce7['uniqueid']][_0xfdc6('0x1d')]=utils['now']();dials[_0x200ce7[_0xfdc6('0x5')]][_0xfdc6('0x1e')]=_0xfdc6('0x1f');utils['info'](util['format'](_0xfdc6('0x20'),_0x200ce7[_0xfdc6('0x5')],dials[_0x200ce7['uniqueid']][_0xfdc6('0x1d')]));}}catch(_0x1c1ac4){utils[_0xfdc6('0x13')](util[_0xfdc6('0xa')](_0xfdc6('0x21'),_0x200ce7[_0xfdc6('0x5')]),_0x1c1ac4);}};exports[_0xfdc6('0x22')]=function(_0x1de8d3){try{if(!_[_0xfdc6('0x16')](dials[_0x1de8d3['uniqueid']])){utils[_0xfdc6('0x14')](util[_0xfdc6('0xa')](_0xfdc6('0x23'),_0x1de8d3[_0xfdc6('0x5')]),_0x1de8d3);dials[_0x1de8d3['uniqueid']]['dialstatus']=_0x1de8d3[_0xfdc6('0x8')];if(_0x1de8d3['dialstatus']==_0xfdc6('0x24')){dials[_0x1de8d3[_0xfdc6('0x5')]]=_[_0xfdc6('0x1c')](dials[_0x1de8d3[_0xfdc6('0x5')]],_0x1de8d3);dials[_0x1de8d3[_0xfdc6('0x5')]][_0xfdc6('0x25')]=utils['now']();dials[_0x1de8d3[_0xfdc6('0x5')]]['lastevent']=_0xfdc6('0x26');utils['info'](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x1de8d3[_0xfdc6('0x5')],_0x1de8d3[_0xfdc6('0x8')],dials[_0x1de8d3[_0xfdc6('0x5')]]['answertime']));}else{utils[_0xfdc6('0x3')](util['format'](_0xfdc6('0x27'),_0x1de8d3[_0xfdc6('0x5')],_0x1de8d3[_0xfdc6('0x8')]));}}}catch(_0x195db7){utils[_0xfdc6('0x13')](util[_0xfdc6('0xa')](_0xfdc6('0x23'),_0x1de8d3[_0xfdc6('0x5')]),_0x195db7);}};exports['hangup']=function(_0xc75b83){try{if(!_['isNil'](dials[_0xc75b83[_0xfdc6('0x5')]])){utils[_0xfdc6('0x14')](util[_0xfdc6('0xa')]('[%s][dials][hangup]',_0xc75b83[_0xfdc6('0x5')]),_0xc75b83);utils[_0xfdc6('0x3')](util[_0xfdc6('0xa')](_0xfdc6('0x28'),_0xc75b83[_0xfdc6('0x5')],_0xc75b83[_0xfdc6('0x7')],_0xc75b83[_0xfdc6('0x29')],_0xc75b83[_0xfdc6('0x2a')]));dials[_0xc75b83[_0xfdc6('0x5')]]=_['assign'](dials[_0xc75b83[_0xfdc6('0x5')]],{'endtime':utils[_0xfdc6('0x2b')](),'lastevent':_0xfdc6('0x2c')});dials[_0xc75b83[_0xfdc6('0x5')]]['duration']=utils['diffTime'](dials[_0xc75b83[_0xfdc6('0x5')]][_0xfdc6('0x2d')],dials[_0xc75b83[_0xfdc6('0x5')]][_0xfdc6('0x1d')]);dials[_0xc75b83['uniqueid']][_0xfdc6('0x2e')]=utils[_0xfdc6('0x2f')](dials[_0xc75b83['uniqueid']]['answertime']||dials[_0xc75b83[_0xfdc6('0x5')]][_0xfdc6('0x2d')],dials[_0xc75b83[_0xfdc6('0x5')]][_0xfdc6('0x1d')]);dials[_0xc75b83[_0xfdc6('0x5')]][_0xfdc6('0x30')]=dials[_0xc75b83[_0xfdc6('0x5')]][_0xfdc6('0x25')]?utils[_0xfdc6('0x2f')](dials[_0xc75b83[_0xfdc6('0x5')]]['endtime'],dials[_0xc75b83['uniqueid']]['answertime']):0x0;writeDB(dials[_0xc75b83['uniqueid']]);}}catch(_0x42fbf2){utils[_0xfdc6('0x13')](util[_0xfdc6('0xa')](_0xfdc6('0x31'),_0xc75b83[_0xfdc6('0x5')]),_0x42fbf2);}};
\ No newline at end of file
index 9d82652..6a5df49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79d9=['close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','./utils','util','asterisk','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x79d9,0xb3));var _0x979d=function(_0x1a16fc,_0x7524be){_0x1a16fc=_0x1a16fc-0x0;var _0x25ce8f=_0x79d9[_0x1a16fc];return _0x25ce8f;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x979d('0x0'));var util=require(_0x979d('0x1'));var ami=new AsteriskManager(config[_0x979d('0x2')]['port'],config[_0x979d('0x2')]['ip'],config['asterisk'][_0x979d('0x3')],config['asterisk'][_0x979d('0x4')],!![]);ami[_0x979d('0x5')]();if(config['xdr']&&config[_0x979d('0x6')]['disabled']){utils[_0x979d('0x7')](_0x979d('0x8'));}else{var agents=require('./agents.controller');var calls=require(_0x979d('0x9'));var queues=require(_0x979d('0xa'));var recordings=require(_0x979d('0xb'));var members=require(_0x979d('0xc'));var dials=require(_0x979d('0xd'));var transfers=require('./transfers.controller');var core=require(_0x979d('0xe'));ami['on'](_0x979d('0xf'),core[_0x979d('0xf')]);ami['on'](_0x979d('0x10'),core['shutdown']);ami['on']('fullybooted',core[_0x979d('0x11')]);ami['on'](_0x979d('0x12'),core[_0x979d('0x12')]);ami['on']('close',core[_0x979d('0x13')]);ami['on'](_0x979d('0x14'),core[_0x979d('0x14')]);ami['on'](_0x979d('0x15'),function(_0x2927ae){try{utils[_0x979d('0x16')](util[_0x979d('0x17')]('[%s][index][devicestatechange]',_0x2927ae[_0x979d('0x18')]),_0x2927ae);members[_0x979d('0x15')](_0x2927ae);}catch(_0x3c06d2){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x19'),_0x2927ae[_0x979d('0x18')]),_0x3c06d2);}});ami['on'](_0x979d('0x1a'),function(_0x3d3a65){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x1b'),_0x3d3a65[_0x979d('0x1c')]),_0x3d3a65);agents[_0x979d('0x1a')](_0x3d3a65);}catch(_0x459eaf){utils['error'](util[_0x979d('0x17')](_0x979d('0x1b'),_0x3d3a65[_0x979d('0x1c')]),_0x459eaf);}});ami['on'](_0x979d('0x1d'),function(_0x2cff2f){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x1e'),_0x2cff2f[_0x979d('0x1c')]),_0x2cff2f);agents[_0x979d('0x1d')](_0x2cff2f);}catch(_0x193648){utils['error'](util[_0x979d('0x17')](_0x979d('0x1e'),_0x2cff2f[_0x979d('0x1c')]),_0x193648);}});ami['on'](_0x979d('0x1f'),function(_0x5d0463){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x20'),_0x5d0463[_0x979d('0x1c')]),_0x5d0463);agents[_0x979d('0x1f')](_0x5d0463);queues[_0x979d('0x1f')](_0x5d0463);}catch(_0x30ce83){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x20'),_0x5d0463[_0x979d('0x1c')]),_0x30ce83);}});ami['on'](_0x979d('0x21'),function(_0x33a494){try{utils[_0x979d('0x16')](util[_0x979d('0x17')]('[%s][index][agentcomplete]',_0x33a494[_0x979d('0x1c')]),_0x33a494);agents[_0x979d('0x21')](_0x33a494);queues[_0x979d('0x21')](_0x33a494);members[_0x979d('0x21')](_0x33a494);}catch(_0x26d4c5){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x22'),_0x33a494[_0x979d('0x1c')]),_0x26d4c5);}});ami['on']('queuecallerabandon',function(_0x2f4757){try{utils[_0x979d('0x16')](util['format'](_0x979d('0x23'),_0x2f4757[_0x979d('0x1c')]),_0x2f4757);agents[_0x979d('0x24')](_0x2f4757);queues[_0x979d('0x24')](_0x2f4757);}catch(_0x3bdc15){utils[_0x979d('0x12')](util['format']('[%s][index][queuecallerabandon]',_0x2f4757[_0x979d('0x1c')]),_0x3bdc15);}});ami['on'](_0x979d('0x25'),function(_0x4964c6){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x26'),_0x4964c6[_0x979d('0x1c')]),_0x4964c6);queues[_0x979d('0x25')](_0x4964c6);recordings[_0x979d('0x25')](_0x4964c6);}catch(_0x42d031){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x26'),_0x4964c6[_0x979d('0x1c')]),_0x42d031);}});ami['on'](_0x979d('0x27'),function(_0x16ef5e){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x28'),_0x16ef5e[_0x979d('0x1c')]),_0x16ef5e);queues[_0x979d('0x27')](_0x16ef5e);}catch(_0x627c96){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x28'),_0x16ef5e[_0x979d('0x1c')]),_0x627c96);}});ami['on'](_0x979d('0x29'),function(_0x4b6137){try{utils['debug'](util[_0x979d('0x17')](_0x979d('0x2a'),_0x4b6137['uniqueid']),_0x4b6137);queues[_0x979d('0x29')](_0x4b6137);calls['musiconholdstart'](_0x4b6137);}catch(_0x144774){utils['error'](util[_0x979d('0x17')](_0x979d('0x2a'),_0x4b6137[_0x979d('0x1c')]),_0x144774);}});ami['on'](_0x979d('0x2b'),function(_0x16ea85){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x2c'),_0x16ea85[_0x979d('0x1c')]),_0x16ea85);queues[_0x979d('0x2b')](_0x16ea85);calls[_0x979d('0x2b')](_0x16ea85);}catch(_0x4fda67){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x2c'),_0x16ea85[_0x979d('0x1c')]),_0x4fda67);}});ami['on'](_0x979d('0x2d'),function(_0x415a6a){try{utils[_0x979d('0x16')](util['format']('[%s][index][newstate]',_0x415a6a[_0x979d('0x1c')]),_0x415a6a);calls['newstate'](_0x415a6a);recordings[_0x979d('0x2d')](_0x415a6a);}catch(_0x1d82f7){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x2e'),_0x415a6a[_0x979d('0x1c')]),_0x1d82f7);}});ami['on']('hangup',function(_0x39be84){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x2f'),_0x39be84[_0x979d('0x1c')]),_0x39be84);calls['hangup'](_0x39be84);recordings[_0x979d('0x30')](_0x39be84);dials[_0x979d('0x30')](_0x39be84);agents[_0x979d('0x30')](_0x39be84);queues[_0x979d('0x30')](_0x39be84);}catch(_0x5a7298){utils['error'](util[_0x979d('0x17')]('[%s][index][hangup]',_0x39be84[_0x979d('0x1c')]),_0x5a7298);}});ami['on'](_0x979d('0x31'),function(_0x27795e){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x32'),_0x27795e[_0x979d('0x1c')]),_0x27795e);members[_0x979d('0x31')](_0x27795e);}catch(_0x47f52c){utils[_0x979d('0x12')](util[_0x979d('0x17')]('[%s][index][cdr]',_0x27795e[_0x979d('0x1c')]),_0x47f52c);}});ami['on'](_0x979d('0x33'),function(_0x4d265b){try{utils['debug'](util[_0x979d('0x17')](_0x979d('0x34'),_0x4d265b[_0x979d('0x1c')]),_0x4d265b);queues['blindtransfer'](_0x4d265b);agents[_0x979d('0x33')](_0x4d265b);transfers[_0x979d('0x33')](_0x4d265b);}catch(_0x1903c0){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x34'),_0x4d265b[_0x979d('0x1c')]),_0x1903c0);}});ami['on']('attendedtransfer',function(_0x5cf897){try{utils[_0x979d('0x16')](util['format'](_0x979d('0x35'),_0x5cf897[_0x979d('0x36')]),_0x5cf897);queues[_0x979d('0x37')](_0x5cf897);transfers[_0x979d('0x37')](_0x5cf897);agents[_0x979d('0x37')](_0x5cf897);calls[_0x979d('0x37')](_0x5cf897);}catch(_0x5414b1){utils[_0x979d('0x12')](util[_0x979d('0x17')]('[%s][index][attendedtransfer]',_0x5cf897[_0x979d('0x36')]),_0x5414b1);}});ami['on'](_0x979d('0x38'),function(_0x428595){try{utils['debug'](util[_0x979d('0x17')](_0x979d('0x39'),_0x428595[_0x979d('0x1c')]),_0x428595);queues[_0x979d('0x38')](_0x428595);recordings['varset'](_0x428595);calls['varset'](_0x428595);dials['varset'](_0x428595);}catch(_0x26d861){utils[_0x979d('0x12')](util['format'](_0x979d('0x39'),_0x428595['uniqueid']),_0x26d861);}});ami['on']('newexten',function(_0x5b4096){try{utils[_0x979d('0x16')](util['format']('[%s][index][newexten]',_0x5b4096['uniqueid']),_0x5b4096);calls[_0x979d('0x3a')](_0x5b4096);recordings[_0x979d('0x3a')](_0x5b4096);dials[_0x979d('0x3a')](_0x5b4096);}catch(_0x3c92f8){utils[_0x979d('0x12')](util['format']('[%s][index][newexten]',_0x5b4096[_0x979d('0x1c')]),_0x3c92f8);}});ami['on'](_0x979d('0x3b'),function(_0x569469){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x3c'),_0x569469['uniqueid']),_0x569469);calls[_0x979d('0x3b')](_0x569469);recordings[_0x979d('0x3b')](_0x569469);}catch(_0x9cd6){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x3c'),_0x569469['uniqueid']),_0x9cd6);}});ami['on'](_0x979d('0x3d'),function(_0x5d04ef){try{utils['debug'](util['format'](_0x979d('0x3e'),_0x5d04ef['uniqueid']),_0x5d04ef);dials[_0x979d('0x3d')](_0x5d04ef);}catch(_0x10fb7a){utils['error'](util['format'](_0x979d('0x3f'),_0x5d04ef[_0x979d('0x1c')]),_0x10fb7a);}});ami['on']('dialend',function(_0x34c23f){try{utils['debug'](util[_0x979d('0x17')]('[%s][index][dialend]',_0x34c23f['uniqueid']),_0x34c23f);dials[_0x979d('0x40')](_0x34c23f);}catch(_0x368ea7){utils['error'](util[_0x979d('0x17')](_0x979d('0x41'),_0x34c23f[_0x979d('0x1c')]),_0x368ea7);}});}
\ No newline at end of file
+var _0x2adf=['XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','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]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','username','password','xdr','info'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0x2adf,0x1b1));var _0xf2ad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2adf[_0x3dd15e];return _0x231fd0;};var AsteriskManager=require(_0xf2ad('0x0'));var config=require(_0xf2ad('0x1'));var utils=require('./utils');var util=require(_0xf2ad('0x2'));var ami=new AsteriskManager(config['asterisk']['port'],config[_0xf2ad('0x3')]['ip'],config['asterisk'][_0xf2ad('0x4')],config[_0xf2ad('0x3')][_0xf2ad('0x5')],!![]);ami['keepConnected']();if(config[_0xf2ad('0x6')]&&config[_0xf2ad('0x6')]['disabled']){utils[_0xf2ad('0x7')](_0xf2ad('0x8'));}else{var agents=require(_0xf2ad('0x9'));var calls=require(_0xf2ad('0xa'));var queues=require('./queues.controller');var recordings=require(_0xf2ad('0xb'));var members=require(_0xf2ad('0xc'));var dials=require(_0xf2ad('0xd'));var transfers=require(_0xf2ad('0xe'));var core=require('./core.controller');ami['on'](_0xf2ad('0xf'),core['connect']);ami['on']('shutdown',core[_0xf2ad('0x10')]);ami['on'](_0xf2ad('0x11'),core[_0xf2ad('0x11')]);ami['on'](_0xf2ad('0x12'),core[_0xf2ad('0x12')]);ami['on'](_0xf2ad('0x13'),core[_0xf2ad('0x13')]);ami['on'](_0xf2ad('0x14'),core[_0xf2ad('0x14')]);ami['on'](_0xf2ad('0x15'),function(_0xa57df0){try{utils[_0xf2ad('0x16')](util[_0xf2ad('0x17')](_0xf2ad('0x18'),_0xa57df0[_0xf2ad('0x19')]),_0xa57df0);members['devicestatechange'](_0xa57df0);}catch(_0x124c09){utils[_0xf2ad('0x12')](util['format'](_0xf2ad('0x18'),_0xa57df0[_0xf2ad('0x19')]),_0x124c09);}});ami['on'](_0xf2ad('0x1a'),function(_0x4a8537){try{utils[_0xf2ad('0x16')](util['format'](_0xf2ad('0x1b'),_0x4a8537['uniqueid']),_0x4a8537);agents[_0xf2ad('0x1a')](_0x4a8537);}catch(_0x4d231d){utils['error'](util[_0xf2ad('0x17')]('[%s][index][agentcalled]',_0x4a8537[_0xf2ad('0x1c')]),_0x4d231d);}});ami['on'](_0xf2ad('0x1d'),function(_0x32a3ab){try{utils['debug'](util[_0xf2ad('0x17')]('[%s][index][agentringnoanswer]',_0x32a3ab[_0xf2ad('0x1c')]),_0x32a3ab);agents[_0xf2ad('0x1d')](_0x32a3ab);}catch(_0x346fe2){utils[_0xf2ad('0x12')](util['format'](_0xf2ad('0x1e'),_0x32a3ab[_0xf2ad('0x1c')]),_0x346fe2);}});ami['on'](_0xf2ad('0x1f'),function(_0x33d771){try{utils[_0xf2ad('0x16')](util[_0xf2ad('0x17')]('[%s][index][agentconnect]',_0x33d771[_0xf2ad('0x1c')]),_0x33d771);agents[_0xf2ad('0x1f')](_0x33d771);queues['agentconnect'](_0x33d771);}catch(_0x5ee9b0){utils['error'](util[_0xf2ad('0x17')]('[%s][index][agentconnect]',_0x33d771[_0xf2ad('0x1c')]),_0x5ee9b0);}});ami['on'](_0xf2ad('0x20'),function(_0x168cf5){try{utils[_0xf2ad('0x16')](util[_0xf2ad('0x17')](_0xf2ad('0x21'),_0x168cf5['uniqueid']),_0x168cf5);agents[_0xf2ad('0x20')](_0x168cf5);queues['agentcomplete'](_0x168cf5);members[_0xf2ad('0x20')](_0x168cf5);}catch(_0x582f50){utils['error'](util['format'](_0xf2ad('0x21'),_0x168cf5[_0xf2ad('0x1c')]),_0x582f50);}});ami['on'](_0xf2ad('0x22'),function(_0x46dc0e){try{utils[_0xf2ad('0x16')](util[_0xf2ad('0x17')](_0xf2ad('0x23'),_0x46dc0e['uniqueid']),_0x46dc0e);agents['queuecallerabandon'](_0x46dc0e);queues[_0xf2ad('0x22')](_0x46dc0e);}catch(_0x4c8cb6){utils[_0xf2ad('0x12')](util['format']('[%s][index][queuecallerabandon]',_0x46dc0e[_0xf2ad('0x1c')]),_0x4c8cb6);}});ami['on'](_0xf2ad('0x24'),function(_0x4fc124){try{utils[_0xf2ad('0x16')](util[_0xf2ad('0x17')](_0xf2ad('0x25'),_0x4fc124[_0xf2ad('0x1c')]),_0x4fc124);queues[_0xf2ad('0x24')](_0x4fc124);recordings['queuecallerjoin'](_0x4fc124);}catch(_0x30070f){utils[_0xf2ad('0x12')](util['format']('[%s][index][queuecallerjoin]',_0x4fc124[_0xf2ad('0x1c')]),_0x30070f);}});ami['on'](_0xf2ad('0x26'),function(_0xdd2e86){try{utils[_0xf2ad('0x16')](util[_0xf2ad('0x17')](_0xf2ad('0x27'),_0xdd2e86['uniqueid']),_0xdd2e86);queues['queuecallerleave'](_0xdd2e86);}catch(_0x4fd440){utils[_0xf2ad('0x12')](util[_0xf2ad('0x17')](_0xf2ad('0x27'),_0xdd2e86[_0xf2ad('0x1c')]),_0x4fd440);}});ami['on']('musiconholdstart',function(_0x4aa764){try{utils[_0xf2ad('0x16')](util[_0xf2ad('0x17')]('[%s][index][musiconholdstart]',_0x4aa764[_0xf2ad('0x1c')]),_0x4aa764);queues[_0xf2ad('0x28')](_0x4aa764);calls[_0xf2ad('0x28')](_0x4aa764);}catch(_0x555b94){utils['error'](util[_0xf2ad('0x17')]('[%s][index][musiconholdstart]',_0x4aa764['uniqueid']),_0x555b94);}});ami['on'](_0xf2ad('0x29'),function(_0x5d43f1){try{utils['debug'](util[_0xf2ad('0x17')](_0xf2ad('0x2a'),_0x5d43f1[_0xf2ad('0x1c')]),_0x5d43f1);queues[_0xf2ad('0x29')](_0x5d43f1);calls[_0xf2ad('0x29')](_0x5d43f1);}catch(_0x4667a6){utils[_0xf2ad('0x12')](util[_0xf2ad('0x17')](_0xf2ad('0x2a'),_0x5d43f1['uniqueid']),_0x4667a6);}});ami['on'](_0xf2ad('0x2b'),function(_0x45bd24){try{utils[_0xf2ad('0x16')](util[_0xf2ad('0x17')](_0xf2ad('0x2c'),_0x45bd24['uniqueid']),_0x45bd24);calls['newstate'](_0x45bd24);recordings[_0xf2ad('0x2b')](_0x45bd24);}catch(_0x55aacd){utils[_0xf2ad('0x12')](util[_0xf2ad('0x17')]('[%s][index][newstate]',_0x45bd24[_0xf2ad('0x1c')]),_0x55aacd);}});ami['on'](_0xf2ad('0x2d'),function(_0x1be2e4){try{utils['debug'](util[_0xf2ad('0x17')](_0xf2ad('0x2e'),_0x1be2e4[_0xf2ad('0x1c')]),_0x1be2e4);calls[_0xf2ad('0x2d')](_0x1be2e4);recordings[_0xf2ad('0x2d')](_0x1be2e4);dials[_0xf2ad('0x2d')](_0x1be2e4);agents[_0xf2ad('0x2d')](_0x1be2e4);queues[_0xf2ad('0x2d')](_0x1be2e4);}catch(_0x5a9981){utils[_0xf2ad('0x12')](util['format'](_0xf2ad('0x2e'),_0x1be2e4[_0xf2ad('0x1c')]),_0x5a9981);}});ami['on'](_0xf2ad('0x2f'),function(_0x28f84c){try{utils[_0xf2ad('0x16')](util['format']('[%s][index][cdr]',_0x28f84c[_0xf2ad('0x1c')]),_0x28f84c);members[_0xf2ad('0x2f')](_0x28f84c);}catch(_0x5f5190){utils[_0xf2ad('0x12')](util[_0xf2ad('0x17')](_0xf2ad('0x30'),_0x28f84c['uniqueid']),_0x5f5190);}});ami['on'](_0xf2ad('0x31'),function(_0x251003){try{utils[_0xf2ad('0x16')](util[_0xf2ad('0x17')](_0xf2ad('0x32'),_0x251003['uniqueid']),_0x251003);queues['blindtransfer'](_0x251003);agents['blindtransfer'](_0x251003);transfers[_0xf2ad('0x31')](_0x251003);}catch(_0xb6c3ca){utils['error'](util['format'](_0xf2ad('0x32'),_0x251003['uniqueid']),_0xb6c3ca);}});ami['on'](_0xf2ad('0x33'),function(_0x5d371c){try{utils[_0xf2ad('0x16')](util[_0xf2ad('0x17')](_0xf2ad('0x34'),_0x5d371c[_0xf2ad('0x35')]),_0x5d371c);queues[_0xf2ad('0x33')](_0x5d371c);transfers[_0xf2ad('0x33')](_0x5d371c);agents[_0xf2ad('0x33')](_0x5d371c);calls[_0xf2ad('0x33')](_0x5d371c);}catch(_0xf91f5b){utils[_0xf2ad('0x12')](util[_0xf2ad('0x17')](_0xf2ad('0x34'),_0x5d371c[_0xf2ad('0x35')]),_0xf91f5b);}});ami['on']('varset',function(_0x16071a){try{utils[_0xf2ad('0x16')](util[_0xf2ad('0x17')](_0xf2ad('0x36'),_0x16071a[_0xf2ad('0x1c')]),_0x16071a);queues['varset'](_0x16071a);recordings[_0xf2ad('0x37')](_0x16071a);calls[_0xf2ad('0x37')](_0x16071a);dials['varset'](_0x16071a);}catch(_0x25a309){utils[_0xf2ad('0x12')](util[_0xf2ad('0x17')]('[%s][index][varset]',_0x16071a[_0xf2ad('0x1c')]),_0x25a309);}});ami['on'](_0xf2ad('0x38'),function(_0xd39b32){try{utils[_0xf2ad('0x16')](util[_0xf2ad('0x17')](_0xf2ad('0x39'),_0xd39b32[_0xf2ad('0x1c')]),_0xd39b32);calls['newexten'](_0xd39b32);recordings['newexten'](_0xd39b32);dials[_0xf2ad('0x38')](_0xd39b32);}catch(_0x217941){utils['error'](util[_0xf2ad('0x17')](_0xf2ad('0x39'),_0xd39b32['uniqueid']),_0x217941);}});ami['on'](_0xf2ad('0x3a'),function(_0x4b346b){try{utils[_0xf2ad('0x16')](util[_0xf2ad('0x17')](_0xf2ad('0x3b'),_0x4b346b[_0xf2ad('0x1c')]),_0x4b346b);calls['newchannel'](_0x4b346b);recordings[_0xf2ad('0x3a')](_0x4b346b);}catch(_0x14695f){utils[_0xf2ad('0x12')](util[_0xf2ad('0x17')](_0xf2ad('0x3b'),_0x4b346b['uniqueid']),_0x14695f);}});ami['on']('dialbegin',function(_0x2165f3){try{utils['debug'](util[_0xf2ad('0x17')]('[%s][index][dialbegin]',_0x2165f3[_0xf2ad('0x1c')]),_0x2165f3);dials[_0xf2ad('0x3c')](_0x2165f3);}catch(_0x323659){utils[_0xf2ad('0x12')](util[_0xf2ad('0x17')]('[%s]dialbegin',_0x2165f3[_0xf2ad('0x1c')]),_0x323659);}});ami['on'](_0xf2ad('0x3d'),function(_0x47449f){try{utils[_0xf2ad('0x16')](util['format']('[%s][index][dialend]',_0x47449f[_0xf2ad('0x1c')]),_0x47449f);dials['dialend'](_0x47449f);}catch(_0x352b1c){utils[_0xf2ad('0x12')](util[_0xf2ad('0x17')](_0xf2ad('0x3e'),_0x47449f[_0xf2ad('0x1c')]),_0x352b1c);}});}
\ No newline at end of file
index be5925d..4cdb969 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb620=['BUSY','voice','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','channel','data1','type','source','data3','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','getUserByInterface','then','internal','request','CreateMemberReport','split','name','error','[%s][members][writeDB]','some','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state'];(function(_0x1d8d99,_0x293016){var _0xea1158=function(_0x26e3a7){while(--_0x26e3a7){_0x1d8d99['push'](_0x1d8d99['shift']());}};_0xea1158(++_0x293016);}(_0xb620,0x1a0));var _0x0b62=function(_0x378e0c,_0x1fe71b){_0x378e0c=_0x378e0c-0x0;var _0x29b7dc=_0xb620[_0x378e0c];return _0x29b7dc;};'use strict';var _=require(_0x0b62('0x0'));var util=require('util');var utils=require(_0x0b62('0x1'));var members={};var exclude=[_0x0b62('0x2'),'Queue:'];function writeDB(_0x305370){utils[_0x0b62('0x3')](util[_0x0b62('0x4')](_0x0b62('0x5'),_0x305370[_0x0b62('0x6')],_0x305370[_0x0b62('0x7')],_0x305370['channel'],_0x305370[_0x0b62('0x8')],_0x305370[_0x0b62('0x9')],_0x305370['type']));if(_0x305370['interface']){utils[_0x0b62('0xa')](_0x305370[_0x0b62('0x7')])[_0x0b62('0xb')](function(_0x278c97){if(_0x278c97){_0x305370[_0x0b62('0x9')]=_0x278c97['name'];_0x305370[_0x0b62('0xc')]=_0x278c97[_0x0b62('0xc')];utils[_0x0b62('0xd')](_0x0b62('0xe'),_0x305370);}else{utils['getUserByName'](_0x305370[_0x0b62('0x7')][_0x0b62('0xf')]('/')[0x1])[_0x0b62('0xb')](function(_0x364b15){if(_0x364b15){_0x305370[_0x0b62('0x9')]=_0x364b15[_0x0b62('0x10')];_0x305370[_0x0b62('0xc')]=_0x364b15[_0x0b62('0xc')];utils[_0x0b62('0xd')](_0x0b62('0xe'),_0x305370);}});}})['catch'](function(_0x29b567){utils[_0x0b62('0x11')](util['format'](_0x0b62('0x12'),_0x305370[_0x0b62('0x6')]),_0x29b567);});}delete members[_0x305370['interface']];}function startsWith(_0x5e4dfc,_0x4a8df6){return _[_0x0b62('0x13')](_0x5e4dfc,function(_0x297915){return _['startsWith'](_0x4a8df6,_0x297915);});}exports[_0x0b62('0x14')]=function(_0x58c82a){try{utils['debug'](util[_0x0b62('0x4')](_0x0b62('0x15'),members[_0x58c82a['device']]?members[_0x58c82a[_0x0b62('0x16')]][_0x0b62('0x6')]:_0x58c82a['device']),_0x58c82a);utils['info'](util[_0x0b62('0x4')](_0x0b62('0x17'),members[_0x58c82a['device']]?members[_0x58c82a[_0x0b62('0x16')]]['uniqueid']:_0x58c82a[_0x0b62('0x16')],_0x58c82a[_0x0b62('0x18')],_0x58c82a[_0x0b62('0x16')]));switch(_0x58c82a[_0x0b62('0x18')]){case'INUSE':case _0x0b62('0x19'):if(!startsWith(exclude,_0x58c82a[_0x0b62('0x16')])){members[_0x58c82a['device']]={'channel':_0x0b62('0x1a'),'interface':_0x58c82a['device'],'type':'TALKING','enterAt':utils[_0x0b62('0x1b')](),'role':_0x0b62('0x1c')};}break;case _0x0b62('0x1d'):if(!_[_0x0b62('0x1e')](members[_0x58c82a[_0x0b62('0x16')]])){members[_0x58c82a[_0x0b62('0x16')]]['exitAt']=utils[_0x0b62('0x1b')]();members[_0x58c82a[_0x0b62('0x16')]][_0x0b62('0x1f')]=utils[_0x0b62('0x20')](members[_0x58c82a[_0x0b62('0x16')]][_0x0b62('0x21')],members[_0x58c82a[_0x0b62('0x16')]]['enterAt']);if(members[_0x58c82a[_0x0b62('0x16')]][_0x0b62('0x6')]){writeDB(members[_0x58c82a[_0x0b62('0x16')]]);}}break;default:break;}}catch(_0x5576c4){utils['error'](util[_0x0b62('0x4')](_0x0b62('0x15'),members[_0x58c82a[_0x0b62('0x16')]]?members[_0x58c82a['device']][_0x0b62('0x6')]:_0x58c82a[_0x0b62('0x16')]),_0x5576c4);}};exports[_0x0b62('0x22')]=function(_0xb34d04){try{if(!_['isNil'](members[_0xb34d04[_0x0b62('0x7')]])){utils[_0x0b62('0x23')](util['format'](_0x0b62('0x24'),_0xb34d04[_0x0b62('0x6')]),_0xb34d04);utils[_0x0b62('0x3')](util[_0x0b62('0x4')](_0x0b62('0x25'),_0xb34d04[_0x0b62('0x6')],_0xb34d04[_0x0b62('0x7')],_0xb34d04[_0x0b62('0x26')]));members[_0xb34d04[_0x0b62('0x7')]]=_[_0x0b62('0x27')](members[_0xb34d04['interface']],{'data4':_0xb34d04[_0x0b62('0x26')],'uniqueid':_0xb34d04[_0x0b62('0x6')]});}}catch(_0x1ab358){utils['error'](util['format']('[%s][members][agentcomplete]',_0xb34d04[_0x0b62('0x6')]),_0x1ab358);}};exports[_0x0b62('0x28')]=function(_0x362c45){try{utils[_0x0b62('0x23')](util[_0x0b62('0x4')](_0x0b62('0x29'),_0x362c45[_0x0b62('0x6')]),_0x362c45);if(_0x362c45[_0x0b62('0x2a')]){var _0x22cedb=_0x362c45[_0x0b62('0x2a')][_0x0b62('0xf')]('-')[0x0];if(!_['isNil'](members[_0x22cedb])){members[_0x22cedb]=_[_0x0b62('0x27')](members[_0x22cedb],{'data1':members[_0x22cedb][_0x0b62('0x2b')]||_0x362c45[_0x0b62('0x2c')],'data2':members[_0x22cedb]['data2']||_0x362c45[_0x0b62('0x2d')],'data3':members[_0x22cedb][_0x0b62('0x2e')]||_0x362c45['destination'],'uniqueid':members[_0x22cedb][_0x0b62('0x6')]||_0x362c45['uniqueid']});utils['info'](util[_0x0b62('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x362c45[_0x0b62('0x6')],members[_0x22cedb]['data1'],members[_0x22cedb][_0x0b62('0x8')],members[_0x22cedb][_0x0b62('0x2e')]));if(members[_0x22cedb][_0x0b62('0x21')]){writeDB(members[_0x22cedb]);}}}if(_0x362c45[_0x0b62('0x2f')]){var _0x327e12=_0x362c45[_0x0b62('0x2f')]['split']('-')[0x0];if(!_[_0x0b62('0x1e')](members[_0x327e12])){members[_0x327e12]=_['assign'](members[_0x327e12],{'data1':members[_0x327e12][_0x0b62('0x2b')]||_0x362c45['type'],'data2':members[_0x327e12][_0x0b62('0x8')]||_0x362c45[_0x0b62('0x2d')],'data3':members[_0x327e12][_0x0b62('0x2e')]||_0x362c45['destination'],'uniqueid':members[_0x327e12][_0x0b62('0x6')]||_0x362c45[_0x0b62('0x6')]});utils[_0x0b62('0x3')](util[_0x0b62('0x4')](_0x0b62('0x30'),_0x362c45[_0x0b62('0x6')],members[_0x327e12][_0x0b62('0x2b')],members[_0x327e12]['data2'],members[_0x327e12]['data3']));if(members[_0x327e12][_0x0b62('0x21')]){writeDB(members[_0x327e12]);}}}}catch(_0x1a889e){utils[_0x0b62('0x11')](util[_0x0b62('0x4')](_0x0b62('0x29'),_0x362c45[_0x0b62('0x6')]),_0x1a889e);}};
\ No newline at end of file
+var _0x117c=['Local/_attended@transfer','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','data2','getUserByInterface','then','membername','name','internal','request','CreateMemberReport','split','catch','uniqueid','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','info','state','INUSE','BUSY','voice','TALKING','agent','NOT_INUSE','exitAt','diffTime','enterAt','error','debug','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','channel','isNil','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','type','data3','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x117c,0x8f));var _0xc117=function(_0x54b892,_0x2a3009){_0x54b892=_0x54b892-0x0;var _0x1256e1=_0x117c[_0x54b892];return _0x1256e1;};'use strict';var _=require('lodash');var util=require(_0xc117('0x0'));var utils=require('./utils');var members={};var exclude=[_0xc117('0x1'),'Queue:'];function writeDB(_0x1ae4cc){utils['info'](util[_0xc117('0x2')](_0xc117('0x3'),_0x1ae4cc['uniqueid'],_0x1ae4cc[_0xc117('0x4')],_0x1ae4cc['channel'],_0x1ae4cc[_0xc117('0x5')],_0x1ae4cc['membername'],_0x1ae4cc['type']));if(_0x1ae4cc[_0xc117('0x4')]){utils[_0xc117('0x6')](_0x1ae4cc[_0xc117('0x4')])[_0xc117('0x7')](function(_0x2cbef0){if(_0x2cbef0){_0x1ae4cc[_0xc117('0x8')]=_0x2cbef0[_0xc117('0x9')];_0x1ae4cc[_0xc117('0xa')]=_0x2cbef0[_0xc117('0xa')];utils[_0xc117('0xb')](_0xc117('0xc'),_0x1ae4cc);}else{utils['getUserByName'](_0x1ae4cc[_0xc117('0x4')][_0xc117('0xd')]('/')[0x1])[_0xc117('0x7')](function(_0x5b76aa){if(_0x5b76aa){_0x1ae4cc[_0xc117('0x8')]=_0x5b76aa[_0xc117('0x9')];_0x1ae4cc[_0xc117('0xa')]=_0x5b76aa[_0xc117('0xa')];utils['request'](_0xc117('0xc'),_0x1ae4cc);}});}})[_0xc117('0xe')](function(_0x5baff4){utils['error'](util[_0xc117('0x2')]('[%s][members][writeDB]',_0x1ae4cc[_0xc117('0xf')]),_0x5baff4);});}delete members[_0x1ae4cc[_0xc117('0x4')]];}function startsWith(_0x3d3edd,_0x329c07){return _[_0xc117('0x10')](_0x3d3edd,function(_0xd579fe){return _[_0xc117('0x11')](_0x329c07,_0xd579fe);});}exports[_0xc117('0x12')]=function(_0x410929){try{utils['debug'](util[_0xc117('0x2')](_0xc117('0x13'),members[_0x410929['device']]?members[_0x410929[_0xc117('0x14')]][_0xc117('0xf')]:_0x410929[_0xc117('0x14')]),_0x410929);utils[_0xc117('0x15')](util[_0xc117('0x2')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x410929['device']]?members[_0x410929[_0xc117('0x14')]][_0xc117('0xf')]:_0x410929[_0xc117('0x14')],_0x410929[_0xc117('0x16')],_0x410929['device']));switch(_0x410929[_0xc117('0x16')]){case _0xc117('0x17'):case _0xc117('0x18'):if(!startsWith(exclude,_0x410929[_0xc117('0x14')])){members[_0x410929[_0xc117('0x14')]]={'channel':_0xc117('0x19'),'interface':_0x410929['device'],'type':_0xc117('0x1a'),'enterAt':utils['now'](),'role':_0xc117('0x1b')};}break;case _0xc117('0x1c'):if(!_['isNil'](members[_0x410929['device']])){members[_0x410929[_0xc117('0x14')]][_0xc117('0x1d')]=utils['now']();members[_0x410929[_0xc117('0x14')]]['duration']=utils[_0xc117('0x1e')](members[_0x410929[_0xc117('0x14')]]['exitAt'],members[_0x410929[_0xc117('0x14')]][_0xc117('0x1f')]);if(members[_0x410929[_0xc117('0x14')]][_0xc117('0xf')]){writeDB(members[_0x410929['device']]);}}break;default:break;}}catch(_0x232321){utils[_0xc117('0x20')](util[_0xc117('0x2')]('[%s][members][devicestatechange]',members[_0x410929[_0xc117('0x14')]]?members[_0x410929['device']][_0xc117('0xf')]:_0x410929[_0xc117('0x14')]),_0x232321);}};exports['agentcomplete']=function(_0x2bf05a){try{if(!_['isNil'](members[_0x2bf05a['interface']])){utils[_0xc117('0x21')](util[_0xc117('0x2')]('[%s][members][agentcomplete]',_0x2bf05a[_0xc117('0xf')]),_0x2bf05a);utils[_0xc117('0x15')](util[_0xc117('0x2')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x2bf05a[_0xc117('0xf')],_0x2bf05a[_0xc117('0x4')],_0x2bf05a[_0xc117('0x22')]));members[_0x2bf05a[_0xc117('0x4')]]=_[_0xc117('0x23')](members[_0x2bf05a[_0xc117('0x4')]],{'data4':_0x2bf05a[_0xc117('0x22')],'uniqueid':_0x2bf05a[_0xc117('0xf')]});}}catch(_0x1eb188){utils[_0xc117('0x20')](util['format'](_0xc117('0x24'),_0x2bf05a[_0xc117('0xf')]),_0x1eb188);}};exports[_0xc117('0x25')]=function(_0x32dcb1){try{utils[_0xc117('0x21')](util[_0xc117('0x2')](_0xc117('0x26'),_0x32dcb1['uniqueid']),_0x32dcb1);if(_0x32dcb1[_0xc117('0x27')]){var _0x2725ec=_0x32dcb1[_0xc117('0x27')][_0xc117('0xd')]('-')[0x0];if(!_[_0xc117('0x28')](members[_0x2725ec])){members[_0x2725ec]=_['assign'](members[_0x2725ec],{'data1':members[_0x2725ec][_0xc117('0x29')]||_0x32dcb1['type'],'data2':members[_0x2725ec][_0xc117('0x5')]||_0x32dcb1[_0xc117('0x2a')],'data3':members[_0x2725ec]['data3']||_0x32dcb1[_0xc117('0x2b')],'uniqueid':members[_0x2725ec]['uniqueid']||_0x32dcb1[_0xc117('0xf')]});utils[_0xc117('0x15')](util['format'](_0xc117('0x2c'),_0x32dcb1[_0xc117('0xf')],members[_0x2725ec][_0xc117('0x29')],members[_0x2725ec][_0xc117('0x5')],members[_0x2725ec]['data3']));if(members[_0x2725ec][_0xc117('0x1d')]){writeDB(members[_0x2725ec]);}}}if(_0x32dcb1[_0xc117('0x2d')]){var _0x55c9c1=_0x32dcb1[_0xc117('0x2d')]['split']('-')[0x0];if(!_[_0xc117('0x28')](members[_0x55c9c1])){members[_0x55c9c1]=_[_0xc117('0x23')](members[_0x55c9c1],{'data1':members[_0x55c9c1]['data1']||_0x32dcb1[_0xc117('0x2e')],'data2':members[_0x55c9c1]['data2']||_0x32dcb1[_0xc117('0x2a')],'data3':members[_0x55c9c1][_0xc117('0x2f')]||_0x32dcb1[_0xc117('0x2b')],'uniqueid':members[_0x55c9c1][_0xc117('0xf')]||_0x32dcb1[_0xc117('0xf')]});utils['info'](util['format'](_0xc117('0x2c'),_0x32dcb1[_0xc117('0xf')],members[_0x55c9c1][_0xc117('0x29')],members[_0x55c9c1]['data2'],members[_0x55c9c1][_0xc117('0x2f')]));if(members[_0x55c9c1]['exitAt']){writeDB(members[_0x55c9c1]);}}}}catch(_0x40a51b){utils[_0xc117('0x20')](util['format'](_0xc117('0x26'),_0x32dcb1['uniqueid']),_0x40a51b);}};
\ No newline at end of file
index 00868db..041aa6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8184=['origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','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','getVoiceQueueByName','then','type','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','assign','error','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','now','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','isNil','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','queuecallercompleteAt','transfer','TRANSFER','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid'];(function(_0x375584,_0x4286bf){var _0x2b7838=function(_0x5abd5c){while(--_0x5abd5c){_0x375584['push'](_0x375584['shift']());}};_0x2b7838(++_0x4286bf);}(_0x8184,0x7a));var _0x4818=function(_0x3bbc6a,_0x2b9f4b){_0x3bbc6a=_0x3bbc6a-0x0;var _0x5b9766=_0x8184[_0x3bbc6a];return _0x5b9766;};'use strict';var _=require(_0x4818('0x0'));var util=require('util');var utils=require(_0x4818('0x1'));var queues={};function writeDB(_0x169791){utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x4'),_0x169791[_0x4818('0x5')],_0x169791[_0x4818('0x6')],_0x169791[_0x4818('0x7')],_0x169791[_0x4818('0x8')],_0x169791[_0x4818('0x9')],_0x169791[_0x4818('0xa')],_0x169791['queuecallerexitreason']));if(_0x169791[_0x4818('0x7')]){utils[_0x4818('0xb')](_0x169791['queue'])[_0x4818('0xc')](function(_0x2ce246){if(_0x2ce246){_0x169791['type']=_0x2ce246[_0x4818('0xd')];}utils[_0x4818('0xe')]('CreateVoiceQueueReport',_0x169791);});}else{utils[_0x4818('0xe')]('CreateVoiceQueueReport',_0x169791);}if(_0x169791[_0x4818('0xf')]){delete queues[_0x169791[_0x4818('0xf')]];}else{delete queues[_0x169791[_0x4818('0x5')]];}}exports[_0x4818('0x10')]=function(_0x4329cd){try{utils[_0x4818('0x11')](util['format'](_0x4818('0x12'),_0x4329cd[_0x4818('0x5')]),_0x4329cd);utils[_0x4818('0x2')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x4329cd[_0x4818('0x5')],_0x4329cd['queue'],_0x4329cd[_0x4818('0x13')]));queues[_0x4329cd[_0x4818('0x5')]]=_[_0x4818('0x14')](_0x4329cd,{'originalposition':_0x4329cd['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x294137){utils[_0x4818('0x15')](util['format'](_0x4818('0x12'),_0x4329cd[_0x4818('0x5')]),_0x294137);}};exports['hangup']=function(_0x50b59d){try{if(!_['isNil'](queues[_0x50b59d[_0x4818('0x5')]])){utils[_0x4818('0x11')](util[_0x4818('0x3')](_0x4818('0x16'),_0x50b59d[_0x4818('0x5')]),_0x50b59d);if(queues[_0x50b59d[_0x4818('0x5')]][_0x4818('0x17')]){if(!queues[_0x50b59d[_0x4818('0x5')]][_0x4818('0x18')]&&!queues[_0x50b59d['uniqueid']][_0x4818('0x19')]){queues[_0x50b59d['uniqueid']][_0x4818('0x1a')]=!![];queues[_0x50b59d['uniqueid']]['queuecallercompleteAt']=utils[_0x4818('0x1b')]();queues[_0x50b59d[_0x4818('0x5')]][_0x4818('0x1c')]=_0x4818('0x1d');}utils['info'](util[_0x4818('0x3')](_0x4818('0x1e'),_0x50b59d[_0x4818('0x5')],queues[_0x50b59d['uniqueid']][_0x4818('0x1f')],queues[_0x50b59d[_0x4818('0x5')]][_0x4818('0x1c')]));writeDB(queues[_0x50b59d[_0x4818('0x5')]]);}else if(queues[_0x50b59d['uniqueid']][_0x4818('0xf')]){utils['info'](util[_0x4818('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x50b59d[_0x4818('0x5')],queues[_0x50b59d[_0x4818('0x5')]][_0x4818('0x1f')],queues[_0x50b59d[_0x4818('0x5')]]['transfereduniqueid']));queues[queues[_0x50b59d['uniqueid']]['transfereduniqueid']]=queues[_0x50b59d[_0x4818('0x5')]];queues[queues[_0x50b59d[_0x4818('0x5')]][_0x4818('0xf')]][_0x4818('0x20')]=0x2;delete queues[_0x50b59d[_0x4818('0x5')]];}}}catch(_0x32bf92){utils[_0x4818('0x15')](util[_0x4818('0x3')](_0x4818('0x16'),_0x50b59d[_0x4818('0x5')]),_0x32bf92);}};exports[_0x4818('0x21')]=function(_0x1cbe26){try{utils['debug'](util[_0x4818('0x3')](_0x4818('0x22'),_0x1cbe26[_0x4818('0x5')]),_0x1cbe26);if(!_['isNil'](_0x1cbe26[_0x4818('0x23')]['queuestatus'])&&_0x1cbe26[_0x4818('0x24')]['toUpperCase']()!=='CONTINUE'){if(!_[_0x4818('0x25')](queues[_0x1cbe26[_0x4818('0x5')]])){queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x18')]=![];queues[_0x1cbe26['uniqueid']][_0x4818('0x26')]=null;queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x19')]=!![];queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x27')]=utils[_0x4818('0x1b')]();queues[_0x1cbe26['uniqueid']][_0x4818('0x1c')]=_0x1cbe26[_0x4818('0x24')][_0x4818('0x28')]();utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x29'),_0x1cbe26['uniqueid'],queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x1f')],_0x1cbe26[_0x4818('0x24')],queues[_0x1cbe26[_0x4818('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x1cbe26[_0x4818('0x5')]]);}}else if(!_[_0x4818('0x25')](_0x1cbe26[_0x4818('0x23')][_0x4818('0x2a')])){if(!_[_0x4818('0x25')](queues[_0x1cbe26[_0x4818('0x5')]])&&!queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x18')]){queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x18')]=![];queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x26')]=null;queues[_0x1cbe26[_0x4818('0x5')]]['queuecallerexit']=!![];queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x27')]=utils['now']();queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x1c')]=_0x4818('0x2b');utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x2c'),_0x1cbe26[_0x4818('0x5')],queues[_0x1cbe26[_0x4818('0x5')]]['name'],_0x1cbe26[_0x4818('0x24')],queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x1c')]));}}}catch(_0x4f8af6){utils[_0x4818('0x15')](util[_0x4818('0x3')](_0x4818('0x22'),_0x1cbe26['uniqueid']),_0x4f8af6);}};exports[_0x4818('0x18')]=function(_0xa6df57){try{if(!_[_0x4818('0x25')](queues[_0xa6df57[_0x4818('0x5')]])){utils['debug'](util[_0x4818('0x3')]('[%s][queues][queuecallerabandon]',_0xa6df57['uniqueid']),_0xa6df57);queues[_0xa6df57['uniqueid']][_0x4818('0x19')]=![];queues[_0xa6df57[_0x4818('0x5')]][_0x4818('0x27')]=null;queues[_0xa6df57[_0x4818('0x5')]]['queuecallerabandon']=!![];queues[_0xa6df57[_0x4818('0x5')]]['queuecallerabandonAt']=utils['now']();queues[_0xa6df57['uniqueid']][_0x4818('0x1c')]=_0x4818('0x2d');utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x2e'),_0xa6df57[_0x4818('0x5')],queues[_0xa6df57[_0x4818('0x5')]]['name'],queues[_0xa6df57[_0x4818('0x5')]][_0x4818('0x1c')]));}}catch(_0x52a448){utils[_0x4818('0x15')](util['format']('[%s][queues][queuecallerabandon]',_0xa6df57[_0x4818('0x5')]),_0x52a448);}};exports[_0x4818('0x2f')]=function(_0x310029){try{if(!_['isNil'](queues[_0x310029[_0x4818('0x5')]])){utils[_0x4818('0x11')](util[_0x4818('0x3')](_0x4818('0x30'),_0x310029['uniqueid']),_0x310029);utils['info'](util[_0x4818('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x310029['uniqueid'],queues[_0x310029[_0x4818('0x5')]][_0x4818('0x1f')],_0x310029[_0x4818('0x31')],_0x310029[_0x4818('0x32')]));queues[_0x310029['uniqueid']][_0x4818('0x2f')]=!![];queues[_0x310029[_0x4818('0x5')]]['queuecallerleaveAt']=utils[_0x4818('0x1b')]();queues[_0x310029[_0x4818('0x5')]]['holdtime']=utils[_0x4818('0x33')](queues[_0x310029['uniqueid']][_0x4818('0x17')],queues[_0x310029[_0x4818('0x5')]][_0x4818('0x34')]);queues[_0x310029[_0x4818('0x5')]][_0x4818('0x13')]=_0x310029[_0x4818('0x13')];queues[_0x310029[_0x4818('0x5')]][_0x4818('0x35')]=_0x310029[_0x4818('0x35')];queues[_0x310029[_0x4818('0x5')]][_0x4818('0x31')]=_0x310029['connectedlinenum'];queues[_0x310029[_0x4818('0x5')]][_0x4818('0x32')]=_0x310029[_0x4818('0x32')];}}catch(_0x1f4ded){utils[_0x4818('0x15')](util[_0x4818('0x3')](_0x4818('0x30'),_0x310029[_0x4818('0x5')]),_0x1f4ded);}};exports[_0x4818('0x36')]=function(_0x1d5a9b){try{if(!_[_0x4818('0x25')](queues[_0x1d5a9b['uniqueid']])){utils['debug'](util[_0x4818('0x3')](_0x4818('0x37'),_0x1d5a9b['uniqueid']),_0x1d5a9b);utils['info'](util[_0x4818('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x1d5a9b[_0x4818('0x5')],queues[_0x1d5a9b[_0x4818('0x5')]][_0x4818('0x1f')],_0x1d5a9b[_0x4818('0x38')],_0x1d5a9b['destaccountcode']));queues[_0x1d5a9b[_0x4818('0x5')]]['queuecallerabandon']=![];queues[_0x1d5a9b[_0x4818('0x5')]][_0x4818('0x18')]=![];queues[_0x1d5a9b[_0x4818('0x5')]]['queuecallerabandonAt']=null;queues[_0x1d5a9b[_0x4818('0x5')]][_0x4818('0x19')]=![];queues[_0x1d5a9b['uniqueid']][_0x4818('0x1c')]=null;queues[_0x1d5a9b['uniqueid']][_0x4818('0x27')]=null;queues[_0x1d5a9b[_0x4818('0x5')]]['assigned']=!![];queues[_0x1d5a9b[_0x4818('0x5')]]['accountcode']=_0x1d5a9b[_0x4818('0x39')];queues[_0x1d5a9b[_0x4818('0x5')]][_0x4818('0x8')]=_0x1d5a9b[_0x4818('0x38')];}}catch(_0x36f288){utils[_0x4818('0x15')](util['format'](_0x4818('0x37'),_0x1d5a9b[_0x4818('0x5')]),_0x36f288);}};exports[_0x4818('0x3a')]=function(_0x8db903){try{if(!_[_0x4818('0x25')](queues[_0x8db903[_0x4818('0x5')]])){if(queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x17')]){utils[_0x4818('0x11')](util['format'](_0x4818('0x3b'),_0x8db903[_0x4818('0x5')]),_0x8db903);queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x18')]=![];queues[_0x8db903[_0x4818('0x5')]]['queuecallerabandon']=![];queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x26')]=null;queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x19')]=![];queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x27')]=null;queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x3c')]=!![];queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x8')]=_0x8db903[_0x4818('0x38')];queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x1a')]=!![];queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x3d')]=utils['now']();if(_0x8db903['reason']==_0x4818('0x3e')){if(!queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x3e')]){queues[_0x8db903['uniqueid']][_0x4818('0x1c')]=_0x4818('0x3f');}}else{queues[_0x8db903[_0x4818('0x5')]]['queuecallerexitreason']='COMPLETEDBY'+_0x8db903[_0x4818('0x40')][_0x4818('0x28')]();}utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x41'),_0x8db903[_0x4818('0x5')],queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x1f')],_0x8db903[_0x4818('0x38')],queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x1c')]));writeDB(queues[_0x8db903[_0x4818('0x5')]]);}}}catch(_0x1a9588){utils[_0x4818('0x15')](util['format']('[%s][queues][agentcomplete]',_0x8db903[_0x4818('0x5')]),_0x1a9588);}};exports[_0x4818('0x42')]=function(_0xa8466b){try{if(!_[_0x4818('0x25')](queues[_0xa8466b[_0x4818('0x43')]])){utils[_0x4818('0x11')](util[_0x4818('0x3')]('[%s][queues][blindtransfer]',_0xa8466b[_0x4818('0x5')]),_0xa8466b);queues[_0xa8466b[_0x4818('0x43')]]['transfer']=!![];queues[_0xa8466b[_0x4818('0x43')]][_0x4818('0x44')]=_0x4818('0x45');queues[_0xa8466b[_0x4818('0x43')]][_0x4818('0x46')]=_0xa8466b[_0x4818('0x47')];queues[_0xa8466b[_0x4818('0x43')]][_0x4818('0x48')]=_0xa8466b[_0x4818('0x43')];queues[_0xa8466b[_0x4818('0x43')]]['queuecallerexitreason']='BLINDTRANSFER';utils['info'](util['format'](_0x4818('0x49'),_0xa8466b[_0x4818('0x5')],queues[_0xa8466b[_0x4818('0x43')]]['name'],_0xa8466b[_0x4818('0x43')],_0xa8466b[_0x4818('0x47')]));}}catch(_0x5e1fe0){utils[_0x4818('0x15')](util[_0x4818('0x3')](_0x4818('0x4a'),_0xa8466b[_0x4818('0x5')]),_0x5e1fe0);}};exports[_0x4818('0x4b')]=function(_0x13e9e3){try{utils[_0x4818('0x11')](util[_0x4818('0x3')](_0x4818('0x4c'),_0x13e9e3[_0x4818('0x4d')]),_0x13e9e3);if(_0x13e9e3[_0x4818('0x4d')]==_0x13e9e3[_0x4818('0x4e')]){if(!_[_0x4818('0x25')](queues[_0x13e9e3[_0x4818('0x4f')]])){utils['info'](util[_0x4818('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x13e9e3[_0x4818('0x4d')],queues[_0x13e9e3[_0x4818('0x4f')]][_0x4818('0x1f')],_0x13e9e3[_0x4818('0x50')]));queues[_0x13e9e3[_0x4818('0x4f')]]['transfer']=!![];queues[_0x13e9e3[_0x4818('0x4f')]]['transfertype']=_0x4818('0x51');queues[_0x13e9e3['secondtransfererlinkedid']]['transferexten']=_0x13e9e3['origtransfererexten'];queues[_0x13e9e3['secondtransfererlinkedid']][_0x4818('0x48')]=_0x13e9e3[_0x4818('0x4d')];queues[_0x13e9e3[_0x4818('0x4f')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x4818('0x25')](queues[_0x13e9e3[_0x4818('0x4e')]])){if(_0x13e9e3[_0x4818('0x52')]&&queues[_0x13e9e3[_0x4818('0x52')]]){queues[_0x13e9e3[_0x4818('0x52')]][_0x4818('0x20')]=0x1;queues[_0x13e9e3[_0x4818('0x43')]]=_[_0x4818('0x53')](queues[_0x13e9e3['transfereelinkedid']]);queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0xf')]=_0x13e9e3['transfertargetuniqueid'];queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0x20')]=0x2;queues[_0x13e9e3['transfereeuniqueid']][_0x4818('0x9')]=queues[_0x13e9e3[_0x4818('0x4f')]][_0x4818('0x9')];queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0x54')]=queues[_0x13e9e3[_0x4818('0x4f')]][_0x4818('0x54')];queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0x34')]=utils[_0x4818('0x1b')]();queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0x17')]=utils['now']();queues[_0x13e9e3[_0x4818('0x43')]]['holdtime']=0x0;queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0x55')]=0x0;utils[_0x4818('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x13e9e3['origtransfereruniqueid'],queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0x1f')],queues[_0x13e9e3[_0x4818('0x43')]]['calleridnum'],queues[_0x13e9e3['transfereeuniqueid']]['calleridname']));}else{utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x56'),_0x13e9e3[_0x4818('0x4d')],queues[_0x13e9e3['origtransfererlinkedid']]['name'],_0x13e9e3[_0x4818('0x4f')]));queues[_0x13e9e3[_0x4818('0x4e')]][_0x4818('0xf')]=_0x13e9e3[_0x4818('0x4f')];}}}else if(_0x13e9e3[_0x4818('0x57')]==_0x13e9e3[_0x4818('0x4f')]){if(!_[_0x4818('0x25')](queues[_0x13e9e3[_0x4818('0x4e')]])){utils['info'](util[_0x4818('0x3')](_0x4818('0x58'),_0x13e9e3['origtransfereruniqueid'],queues[_0x13e9e3['origtransfererlinkedid']][_0x4818('0x1f')],_0x13e9e3['secondtransfereruniqueid'],_0x13e9e3[_0x4818('0x59')]));queues[_0x13e9e3['origtransfererlinkedid']][_0x4818('0x3e')]=!![];queues[_0x13e9e3[_0x4818('0x4e')]][_0x4818('0x44')]=_0x4818('0x51');queues[_0x13e9e3[_0x4818('0x4e')]]['transferexten']=_0x13e9e3[_0x4818('0x59')];queues[_0x13e9e3[_0x4818('0x4e')]][_0x4818('0x48')]=_0x13e9e3[_0x4818('0x57')];queues[_0x13e9e3[_0x4818('0x4e')]][_0x4818('0x1c')]='ATTENDEDTRANSFER';}if(!_[_0x4818('0x25')](queues[_0x13e9e3[_0x4818('0x4f')]])){if(_0x13e9e3[_0x4818('0x5a')]&&queues[_0x13e9e3[_0x4818('0x5a')]]){queues[_0x13e9e3[_0x4818('0x5a')]][_0x4818('0x20')]=0x1;queues[_0x13e9e3[_0x4818('0x5b')]]=_[_0x4818('0x53')](queues[_0x13e9e3[_0x4818('0x5a')]]);queues[_0x13e9e3[_0x4818('0x5b')]]['transfereduniqueid']=_0x13e9e3['transfertargetuniqueid'];queues[_0x13e9e3[_0x4818('0x5b')]]['queuecallerenterreason']=0x2;queues[_0x13e9e3[_0x4818('0x5b')]]['calleridnum']=queues[_0x13e9e3[_0x4818('0x4e')]][_0x4818('0x9')];queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x54')]=queues[_0x13e9e3['origtransfererlinkedid']][_0x4818('0x54')];queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x34')]=utils[_0x4818('0x1b')]();queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x17')]=utils[_0x4818('0x1b')]();queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x5c')]=0x0;queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x55')]=0x0;utils[_0x4818('0x2')](util['format'](_0x4818('0x5d'),_0x13e9e3[_0x4818('0x4d')],queues[_0x13e9e3['transfertargetuniqueid']][_0x4818('0x1f')],queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0xf')],queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x9')],queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x54')]));}else{utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x13e9e3[_0x4818('0x4d')],queues[_0x13e9e3['secondtransfererlinkedid']][_0x4818('0x1f')],_0x13e9e3['origtransfererlinkedid']));queues[_0x13e9e3[_0x4818('0x4f')]]['transfereduniqueid']=_0x13e9e3[_0x4818('0x4e')];}}}}catch(_0x4147e5){utils[_0x4818('0x15')](util['format'](_0x4818('0x4c'),_0x13e9e3[_0x4818('0x4d')]),_0x4147e5);}};exports[_0x4818('0x5e')]=function(_0x544778){try{if(!_[_0x4818('0x25')](queues[_0x544778[_0x4818('0x5')]])){utils[_0x4818('0x11')](util['format']('[%s][queues][musiconholdstart]',_0x544778[_0x4818('0x5')]),_0x544778);queues[_0x544778[_0x4818('0x5')]][_0x4818('0x5f')]=utils[_0x4818('0x1b')]();utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x60'),_0x544778[_0x4818('0x5')],queues[_0x544778[_0x4818('0x5')]][_0x4818('0x1f')],queues[_0x544778[_0x4818('0x5')]][_0x4818('0x5f')]));}}catch(_0x3a8de2){utils[_0x4818('0x15')](util[_0x4818('0x3')](_0x4818('0x61'),_0x544778['uniqueid']),_0x3a8de2);}};exports[_0x4818('0x62')]=function(_0x394d62){try{if(!_[_0x4818('0x25')](queues[_0x394d62[_0x4818('0x5')]])){if(!_[_0x4818('0x25')](queues[_0x394d62['uniqueid']][_0x4818('0x5f')])){utils['debug'](util['format'](_0x4818('0x63'),_0x394d62[_0x4818('0x5')]),_0x394d62);queues[_0x394d62[_0x4818('0x5')]][_0x4818('0x55')]+=utils[_0x4818('0x33')](utils[_0x4818('0x1b')](),queues[_0x394d62['uniqueid']][_0x4818('0x5f')]);utils['info'](util[_0x4818('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x394d62['uniqueid'],queues[_0x394d62[_0x4818('0x5')]][_0x4818('0x1f')],queues[_0x394d62[_0x4818('0x5')]][_0x4818('0x55')]));delete queues[_0x394d62['uniqueid']]['musiconholdstartAt'];}}}catch(_0x1ffa39){utils['error'](util[_0x4818('0x3')](_0x4818('0x63'),_0x394d62[_0x4818('0x5')]),_0x1ffa39);}};
\ No newline at end of file
+var _0xdbf5=['queuecallerexit','queuecallerexitAt','value','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','queuecallerleaveAt','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transferuniqueid','transfereelinkedid','clone','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','type','CreateVoiceQueueReport','request','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','hangup','isNil','[%s][queues][hangup]','queuecallercomplete','COMPLETEDBYAGENT','name','queuecallerenterreason','[%s][queues][varset]','variable','queuestatus','CONTINUE','queuecallerabandon','queuecallerabandonAt'];(function(_0x3f236d,_0x4072bb){var _0x4b62f9=function(_0xf21375){while(--_0xf21375){_0x3f236d['push'](_0x3f236d['shift']());}};_0x4b62f9(++_0x4072bb);}(_0xdbf5,0xab));var _0x5dbf=function(_0xcdbcb,_0x530db7){_0xcdbcb=_0xcdbcb-0x0;var _0x259be4=_0xdbf5[_0xcdbcb];return _0x259be4;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var utils=require(_0x5dbf('0x1'));var queues={};function writeDB(_0x567e20){utils[_0x5dbf('0x2')](util[_0x5dbf('0x3')](_0x5dbf('0x4'),_0x567e20[_0x5dbf('0x5')],_0x567e20[_0x5dbf('0x6')],_0x567e20[_0x5dbf('0x7')],_0x567e20[_0x5dbf('0x8')],_0x567e20[_0x5dbf('0x9')],_0x567e20[_0x5dbf('0xa')],_0x567e20[_0x5dbf('0xb')]));if(_0x567e20[_0x5dbf('0x7')]){utils['getVoiceQueueByName'](_0x567e20[_0x5dbf('0x7')])['then'](function(_0x1e22fd){if(_0x1e22fd){_0x567e20[_0x5dbf('0xc')]=_0x1e22fd['type'];}utils['request'](_0x5dbf('0xd'),_0x567e20);});}else{utils[_0x5dbf('0xe')](_0x5dbf('0xd'),_0x567e20);}if(_0x567e20[_0x5dbf('0xf')]){delete queues[_0x567e20[_0x5dbf('0xf')]];}else{delete queues[_0x567e20[_0x5dbf('0x5')]];}}exports['queuecallerjoin']=function(_0x11af9b){try{utils[_0x5dbf('0x10')](util[_0x5dbf('0x3')](_0x5dbf('0x11'),_0x11af9b[_0x5dbf('0x5')]),_0x11af9b);utils[_0x5dbf('0x2')](util[_0x5dbf('0x3')](_0x5dbf('0x12'),_0x11af9b[_0x5dbf('0x5')],_0x11af9b[_0x5dbf('0x7')],_0x11af9b[_0x5dbf('0x13')]));queues[_0x11af9b[_0x5dbf('0x5')]]=_['assign'](_0x11af9b,{'originalposition':_0x11af9b[_0x5dbf('0x13')],'queuecallerjoinAt':utils[_0x5dbf('0x14')](),'mohtime':0x0});}catch(_0x2f9cfb){utils[_0x5dbf('0x15')](util[_0x5dbf('0x3')]('[%s][queues][queuecallerjoin]',_0x11af9b[_0x5dbf('0x5')]),_0x2f9cfb);}};exports[_0x5dbf('0x16')]=function(_0x4da759){try{if(!_[_0x5dbf('0x17')](queues[_0x4da759[_0x5dbf('0x5')]])){utils['debug'](util['format'](_0x5dbf('0x18'),_0x4da759['uniqueid']),_0x4da759);if(queues[_0x4da759[_0x5dbf('0x5')]]['queuecallerleaveAt']){if(!queues[_0x4da759[_0x5dbf('0x5')]]['queuecallerabandon']&&!queues[_0x4da759[_0x5dbf('0x5')]]['queuecallerexit']){queues[_0x4da759['uniqueid']][_0x5dbf('0x19')]=!![];queues[_0x4da759[_0x5dbf('0x5')]]['queuecallercompleteAt']=utils['now']();queues[_0x4da759[_0x5dbf('0x5')]][_0x5dbf('0xb')]=_0x5dbf('0x1a');}utils[_0x5dbf('0x2')](util[_0x5dbf('0x3')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x4da759[_0x5dbf('0x5')],queues[_0x4da759[_0x5dbf('0x5')]]['name'],queues[_0x4da759[_0x5dbf('0x5')]][_0x5dbf('0xb')]));writeDB(queues[_0x4da759[_0x5dbf('0x5')]]);}else if(queues[_0x4da759[_0x5dbf('0x5')]][_0x5dbf('0xf')]){utils[_0x5dbf('0x2')](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x4da759[_0x5dbf('0x5')],queues[_0x4da759[_0x5dbf('0x5')]][_0x5dbf('0x1b')],queues[_0x4da759['uniqueid']][_0x5dbf('0xf')]));queues[queues[_0x4da759[_0x5dbf('0x5')]][_0x5dbf('0xf')]]=queues[_0x4da759['uniqueid']];queues[queues[_0x4da759[_0x5dbf('0x5')]][_0x5dbf('0xf')]][_0x5dbf('0x1c')]=0x2;delete queues[_0x4da759[_0x5dbf('0x5')]];}}}catch(_0x101fa6){utils[_0x5dbf('0x15')](util['format'](_0x5dbf('0x18'),_0x4da759[_0x5dbf('0x5')]),_0x101fa6);}};exports['varset']=function(_0x572a2a){try{utils[_0x5dbf('0x10')](util[_0x5dbf('0x3')](_0x5dbf('0x1d'),_0x572a2a[_0x5dbf('0x5')]),_0x572a2a);if(!_[_0x5dbf('0x17')](_0x572a2a[_0x5dbf('0x1e')][_0x5dbf('0x1f')])&&_0x572a2a['value']['toUpperCase']()!==_0x5dbf('0x20')){if(!_['isNil'](queues[_0x572a2a[_0x5dbf('0x5')]])){queues[_0x572a2a['uniqueid']][_0x5dbf('0x21')]=![];queues[_0x572a2a[_0x5dbf('0x5')]][_0x5dbf('0x22')]=null;queues[_0x572a2a[_0x5dbf('0x5')]][_0x5dbf('0x23')]=!![];queues[_0x572a2a[_0x5dbf('0x5')]][_0x5dbf('0x24')]=utils[_0x5dbf('0x14')]();queues[_0x572a2a[_0x5dbf('0x5')]]['queuecallerexitreason']=_0x572a2a[_0x5dbf('0x25')][_0x5dbf('0x26')]();utils[_0x5dbf('0x2')](util['format'](_0x5dbf('0x27'),_0x572a2a[_0x5dbf('0x5')],queues[_0x572a2a[_0x5dbf('0x5')]][_0x5dbf('0x1b')],_0x572a2a[_0x5dbf('0x25')],queues[_0x572a2a['uniqueid']][_0x5dbf('0xb')]));writeDB(queues[_0x572a2a[_0x5dbf('0x5')]]);}}else if(!_[_0x5dbf('0x17')](_0x572a2a[_0x5dbf('0x1e')]['queueposition'])){if(!_[_0x5dbf('0x17')](queues[_0x572a2a[_0x5dbf('0x5')]])&&!queues[_0x572a2a[_0x5dbf('0x5')]][_0x5dbf('0x21')]){queues[_0x572a2a[_0x5dbf('0x5')]]['queuecallerabandon']=![];queues[_0x572a2a[_0x5dbf('0x5')]][_0x5dbf('0x22')]=null;queues[_0x572a2a[_0x5dbf('0x5')]][_0x5dbf('0x23')]=!![];queues[_0x572a2a['uniqueid']]['queuecallerexitAt']=utils['now']();queues[_0x572a2a[_0x5dbf('0x5')]][_0x5dbf('0xb')]=_0x5dbf('0x28');utils[_0x5dbf('0x2')](util['format'](_0x5dbf('0x29'),_0x572a2a[_0x5dbf('0x5')],queues[_0x572a2a[_0x5dbf('0x5')]][_0x5dbf('0x1b')],_0x572a2a[_0x5dbf('0x25')],queues[_0x572a2a[_0x5dbf('0x5')]][_0x5dbf('0xb')]));}}}catch(_0x531a18){utils['error'](util['format'](_0x5dbf('0x1d'),_0x572a2a['uniqueid']),_0x531a18);}};exports[_0x5dbf('0x21')]=function(_0x1705b3){try{if(!_['isNil'](queues[_0x1705b3[_0x5dbf('0x5')]])){utils['debug'](util['format'](_0x5dbf('0x2a'),_0x1705b3[_0x5dbf('0x5')]),_0x1705b3);queues[_0x1705b3['uniqueid']][_0x5dbf('0x23')]=![];queues[_0x1705b3['uniqueid']][_0x5dbf('0x24')]=null;queues[_0x1705b3[_0x5dbf('0x5')]]['queuecallerabandon']=!![];queues[_0x1705b3[_0x5dbf('0x5')]][_0x5dbf('0x22')]=utils[_0x5dbf('0x14')]();queues[_0x1705b3[_0x5dbf('0x5')]][_0x5dbf('0xb')]=_0x5dbf('0x2b');utils[_0x5dbf('0x2')](util[_0x5dbf('0x3')](_0x5dbf('0x2c'),_0x1705b3[_0x5dbf('0x5')],queues[_0x1705b3[_0x5dbf('0x5')]]['name'],queues[_0x1705b3['uniqueid']]['queuecallerexitreason']));}}catch(_0x38f57f){utils['error'](util[_0x5dbf('0x3')](_0x5dbf('0x2a'),_0x1705b3[_0x5dbf('0x5')]),_0x38f57f);}};exports[_0x5dbf('0x2d')]=function(_0x32441a){try{if(!_['isNil'](queues[_0x32441a[_0x5dbf('0x5')]])){utils[_0x5dbf('0x10')](util['format'](_0x5dbf('0x2e'),_0x32441a[_0x5dbf('0x5')]),_0x32441a);utils[_0x5dbf('0x2')](util[_0x5dbf('0x3')](_0x5dbf('0x2f'),_0x32441a['uniqueid'],queues[_0x32441a[_0x5dbf('0x5')]][_0x5dbf('0x1b')],_0x32441a[_0x5dbf('0x30')],_0x32441a['connectedlinename']));queues[_0x32441a[_0x5dbf('0x5')]][_0x5dbf('0x2d')]=!![];queues[_0x32441a['uniqueid']]['queuecallerleaveAt']=utils[_0x5dbf('0x14')]();queues[_0x32441a[_0x5dbf('0x5')]][_0x5dbf('0x31')]=utils[_0x5dbf('0x32')](queues[_0x32441a[_0x5dbf('0x5')]]['queuecallerleaveAt'],queues[_0x32441a[_0x5dbf('0x5')]]['queuecallerjoinAt']);queues[_0x32441a[_0x5dbf('0x5')]][_0x5dbf('0x13')]=_0x32441a[_0x5dbf('0x13')];queues[_0x32441a[_0x5dbf('0x5')]][_0x5dbf('0x33')]=_0x32441a['count'];queues[_0x32441a[_0x5dbf('0x5')]][_0x5dbf('0x30')]=_0x32441a[_0x5dbf('0x30')];queues[_0x32441a[_0x5dbf('0x5')]][_0x5dbf('0x34')]=_0x32441a[_0x5dbf('0x34')];}}catch(_0xa4d8d8){utils['error'](util['format'](_0x5dbf('0x2e'),_0x32441a['uniqueid']),_0xa4d8d8);}};exports[_0x5dbf('0x35')]=function(_0x2e3206){try{if(!_[_0x5dbf('0x17')](queues[_0x2e3206[_0x5dbf('0x5')]])){utils[_0x5dbf('0x10')](util[_0x5dbf('0x3')](_0x5dbf('0x36'),_0x2e3206[_0x5dbf('0x5')]),_0x2e3206);utils[_0x5dbf('0x2')](util[_0x5dbf('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x2e3206[_0x5dbf('0x5')],queues[_0x2e3206[_0x5dbf('0x5')]]['name'],_0x2e3206[_0x5dbf('0x37')],_0x2e3206[_0x5dbf('0x38')]));queues[_0x2e3206['uniqueid']]['queuecallerabandon']=![];queues[_0x2e3206[_0x5dbf('0x5')]]['queuecallerabandon']=![];queues[_0x2e3206[_0x5dbf('0x5')]]['queuecallerabandonAt']=null;queues[_0x2e3206[_0x5dbf('0x5')]][_0x5dbf('0x23')]=![];queues[_0x2e3206[_0x5dbf('0x5')]][_0x5dbf('0xb')]=null;queues[_0x2e3206['uniqueid']]['queuecallerexitAt']=null;queues[_0x2e3206[_0x5dbf('0x5')]][_0x5dbf('0x39')]=!![];queues[_0x2e3206['uniqueid']]['accountcode']=_0x2e3206[_0x5dbf('0x38')];queues[_0x2e3206['uniqueid']][_0x5dbf('0x8')]=_0x2e3206[_0x5dbf('0x37')];}}catch(_0x5019e7){utils[_0x5dbf('0x15')](util[_0x5dbf('0x3')]('[%s][queues][agentconnect]',_0x2e3206[_0x5dbf('0x5')]),_0x5019e7);}};exports['agentcomplete']=function(_0x5bd5f9){try{if(!_['isNil'](queues[_0x5bd5f9[_0x5dbf('0x5')]])){if(queues[_0x5bd5f9[_0x5dbf('0x5')]][_0x5dbf('0x3a')]){utils['debug'](util['format'](_0x5dbf('0x3b'),_0x5bd5f9[_0x5dbf('0x5')]),_0x5bd5f9);queues[_0x5bd5f9[_0x5dbf('0x5')]]['queuecallerabandon']=![];queues[_0x5bd5f9[_0x5dbf('0x5')]]['queuecallerabandon']=![];queues[_0x5bd5f9[_0x5dbf('0x5')]][_0x5dbf('0x22')]=null;queues[_0x5bd5f9[_0x5dbf('0x5')]][_0x5dbf('0x23')]=![];queues[_0x5bd5f9[_0x5dbf('0x5')]][_0x5dbf('0x24')]=null;queues[_0x5bd5f9[_0x5dbf('0x5')]]['assigned']=!![];queues[_0x5bd5f9[_0x5dbf('0x5')]][_0x5dbf('0x8')]=_0x5bd5f9[_0x5dbf('0x37')];queues[_0x5bd5f9[_0x5dbf('0x5')]][_0x5dbf('0x19')]=!![];queues[_0x5bd5f9[_0x5dbf('0x5')]][_0x5dbf('0x3c')]=utils['now']();if(_0x5bd5f9[_0x5dbf('0x3d')]=='transfer'){if(!queues[_0x5bd5f9[_0x5dbf('0x5')]][_0x5dbf('0x3e')]){queues[_0x5bd5f9[_0x5dbf('0x5')]]['queuecallerexitreason']=_0x5dbf('0x3f');}}else{queues[_0x5bd5f9[_0x5dbf('0x5')]]['queuecallerexitreason']=_0x5dbf('0x40')+_0x5bd5f9[_0x5dbf('0x3d')][_0x5dbf('0x26')]();}utils['info'](util['format'](_0x5dbf('0x41'),_0x5bd5f9[_0x5dbf('0x5')],queues[_0x5bd5f9[_0x5dbf('0x5')]][_0x5dbf('0x1b')],_0x5bd5f9[_0x5dbf('0x37')],queues[_0x5bd5f9[_0x5dbf('0x5')]][_0x5dbf('0xb')]));writeDB(queues[_0x5bd5f9['uniqueid']]);}}}catch(_0x497c78){utils['error'](util[_0x5dbf('0x3')](_0x5dbf('0x3b'),_0x5bd5f9[_0x5dbf('0x5')]),_0x497c78);}};exports[_0x5dbf('0x42')]=function(_0x55e598){try{if(!_['isNil'](queues[_0x55e598[_0x5dbf('0x43')]])){utils[_0x5dbf('0x10')](util[_0x5dbf('0x3')](_0x5dbf('0x44'),_0x55e598[_0x5dbf('0x5')]),_0x55e598);queues[_0x55e598[_0x5dbf('0x43')]][_0x5dbf('0x3e')]=!![];queues[_0x55e598[_0x5dbf('0x43')]][_0x5dbf('0x45')]=_0x5dbf('0x46');queues[_0x55e598[_0x5dbf('0x43')]][_0x5dbf('0x47')]=_0x55e598[_0x5dbf('0x48')];queues[_0x55e598[_0x5dbf('0x43')]]['transferuniqueid']=_0x55e598['transfereeuniqueid'];queues[_0x55e598[_0x5dbf('0x43')]]['queuecallerexitreason']=_0x5dbf('0x49');utils[_0x5dbf('0x2')](util[_0x5dbf('0x3')](_0x5dbf('0x4a'),_0x55e598[_0x5dbf('0x5')],queues[_0x55e598[_0x5dbf('0x43')]]['name'],_0x55e598[_0x5dbf('0x43')],_0x55e598[_0x5dbf('0x48')]));}}catch(_0x5afb0d){utils[_0x5dbf('0x15')](util[_0x5dbf('0x3')](_0x5dbf('0x44'),_0x55e598['uniqueid']),_0x5afb0d);}};exports[_0x5dbf('0x4b')]=function(_0x419c02){try{utils['debug'](util[_0x5dbf('0x3')]('[%s][queues][attendedtransfer]',_0x419c02['origtransfereruniqueid']),_0x419c02);if(_0x419c02[_0x5dbf('0x4c')]==_0x419c02[_0x5dbf('0x4d')]){if(!_[_0x5dbf('0x17')](queues[_0x419c02[_0x5dbf('0x4e')]])){utils[_0x5dbf('0x2')](util[_0x5dbf('0x3')](_0x5dbf('0x4f'),_0x419c02[_0x5dbf('0x4c')],queues[_0x419c02['secondtransfererlinkedid']]['name'],_0x419c02[_0x5dbf('0x50')]));queues[_0x419c02[_0x5dbf('0x4e')]][_0x5dbf('0x3e')]=!![];queues[_0x419c02[_0x5dbf('0x4e')]][_0x5dbf('0x45')]='ATTENDED';queues[_0x419c02[_0x5dbf('0x4e')]][_0x5dbf('0x47')]=_0x419c02[_0x5dbf('0x50')];queues[_0x419c02[_0x5dbf('0x4e')]][_0x5dbf('0x51')]=_0x419c02[_0x5dbf('0x4c')];queues[_0x419c02[_0x5dbf('0x4e')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x5dbf('0x17')](queues[_0x419c02[_0x5dbf('0x4d')]])){if(_0x419c02[_0x5dbf('0x52')]&&queues[_0x419c02[_0x5dbf('0x52')]]){queues[_0x419c02[_0x5dbf('0x52')]]['queuecallerenterreason']=0x1;queues[_0x419c02['transfereeuniqueid']]=_[_0x5dbf('0x53')](queues[_0x419c02[_0x5dbf('0x52')]]);queues[_0x419c02[_0x5dbf('0x43')]][_0x5dbf('0xf')]=_0x419c02['transfertargetuniqueid'];queues[_0x419c02[_0x5dbf('0x43')]][_0x5dbf('0x1c')]=0x2;queues[_0x419c02[_0x5dbf('0x43')]][_0x5dbf('0x9')]=queues[_0x419c02[_0x5dbf('0x4e')]][_0x5dbf('0x9')];queues[_0x419c02[_0x5dbf('0x43')]][_0x5dbf('0x54')]=queues[_0x419c02['secondtransfererlinkedid']][_0x5dbf('0x54')];queues[_0x419c02[_0x5dbf('0x43')]][_0x5dbf('0x55')]=utils[_0x5dbf('0x14')]();queues[_0x419c02[_0x5dbf('0x43')]][_0x5dbf('0x3a')]=utils[_0x5dbf('0x14')]();queues[_0x419c02[_0x5dbf('0x43')]]['holdtime']=0x0;queues[_0x419c02[_0x5dbf('0x43')]][_0x5dbf('0x56')]=0x0;utils[_0x5dbf('0x2')](util[_0x5dbf('0x3')](_0x5dbf('0x57'),_0x419c02[_0x5dbf('0x4c')],queues[_0x419c02[_0x5dbf('0x43')]][_0x5dbf('0x1b')],queues[_0x419c02[_0x5dbf('0x43')]][_0x5dbf('0x9')],queues[_0x419c02['transfereeuniqueid']]['calleridname']));}else{utils[_0x5dbf('0x2')](util['format'](_0x5dbf('0x58'),_0x419c02['origtransfereruniqueid'],queues[_0x419c02[_0x5dbf('0x4d')]][_0x5dbf('0x1b')],_0x419c02[_0x5dbf('0x4e')]));queues[_0x419c02[_0x5dbf('0x4d')]][_0x5dbf('0xf')]=_0x419c02[_0x5dbf('0x4e')];}}}else if(_0x419c02[_0x5dbf('0x59')]==_0x419c02[_0x5dbf('0x4e')]){if(!_['isNil'](queues[_0x419c02[_0x5dbf('0x4d')]])){utils[_0x5dbf('0x2')](util[_0x5dbf('0x3')](_0x5dbf('0x5a'),_0x419c02['origtransfereruniqueid'],queues[_0x419c02[_0x5dbf('0x4d')]][_0x5dbf('0x1b')],_0x419c02[_0x5dbf('0x59')],_0x419c02[_0x5dbf('0x5b')]));queues[_0x419c02[_0x5dbf('0x4d')]]['transfer']=!![];queues[_0x419c02['origtransfererlinkedid']][_0x5dbf('0x45')]='ATTENDED';queues[_0x419c02[_0x5dbf('0x4d')]][_0x5dbf('0x47')]=_0x419c02[_0x5dbf('0x5b')];queues[_0x419c02['origtransfererlinkedid']][_0x5dbf('0x51')]=_0x419c02[_0x5dbf('0x59')];queues[_0x419c02['origtransfererlinkedid']]['queuecallerexitreason']=_0x5dbf('0x5c');}if(!_['isNil'](queues[_0x419c02[_0x5dbf('0x4e')]])){if(_0x419c02['transfertargetlinkedid']&&queues[_0x419c02[_0x5dbf('0x5d')]]){queues[_0x419c02[_0x5dbf('0x5d')]][_0x5dbf('0x1c')]=0x1;queues[_0x419c02[_0x5dbf('0x5e')]]=_['clone'](queues[_0x419c02['transfertargetlinkedid']]);queues[_0x419c02[_0x5dbf('0x5e')]][_0x5dbf('0xf')]=_0x419c02[_0x5dbf('0x5e')];queues[_0x419c02[_0x5dbf('0x5e')]]['queuecallerenterreason']=0x2;queues[_0x419c02['transfertargetuniqueid']][_0x5dbf('0x9')]=queues[_0x419c02[_0x5dbf('0x4d')]][_0x5dbf('0x9')];queues[_0x419c02[_0x5dbf('0x5e')]][_0x5dbf('0x54')]=queues[_0x419c02[_0x5dbf('0x4d')]][_0x5dbf('0x54')];queues[_0x419c02[_0x5dbf('0x5e')]]['queuecallerjoinAt']=utils[_0x5dbf('0x14')]();queues[_0x419c02[_0x5dbf('0x5e')]][_0x5dbf('0x3a')]=utils[_0x5dbf('0x14')]();queues[_0x419c02['transfertargetuniqueid']][_0x5dbf('0x31')]=0x0;queues[_0x419c02[_0x5dbf('0x5e')]][_0x5dbf('0x56')]=0x0;utils['info'](util[_0x5dbf('0x3')](_0x5dbf('0x5f'),_0x419c02[_0x5dbf('0x4c')],queues[_0x419c02[_0x5dbf('0x5e')]][_0x5dbf('0x1b')],queues[_0x419c02[_0x5dbf('0x5e')]][_0x5dbf('0xf')],queues[_0x419c02[_0x5dbf('0x5e')]][_0x5dbf('0x9')],queues[_0x419c02[_0x5dbf('0x5e')]][_0x5dbf('0x54')]));}else{utils[_0x5dbf('0x2')](util[_0x5dbf('0x3')](_0x5dbf('0x58'),_0x419c02['origtransfereruniqueid'],queues[_0x419c02['secondtransfererlinkedid']]['name'],_0x419c02['origtransfererlinkedid']));queues[_0x419c02[_0x5dbf('0x4e')]]['transfereduniqueid']=_0x419c02[_0x5dbf('0x4d')];}}}}catch(_0x309c09){utils[_0x5dbf('0x15')](util[_0x5dbf('0x3')]('[%s][queues][attendedtransfer]',_0x419c02[_0x5dbf('0x4c')]),_0x309c09);}};exports[_0x5dbf('0x60')]=function(_0x2bb4d1){try{if(!_[_0x5dbf('0x17')](queues[_0x2bb4d1[_0x5dbf('0x5')]])){utils['debug'](util['format'](_0x5dbf('0x61'),_0x2bb4d1[_0x5dbf('0x5')]),_0x2bb4d1);queues[_0x2bb4d1[_0x5dbf('0x5')]][_0x5dbf('0x62')]=utils[_0x5dbf('0x14')]();utils[_0x5dbf('0x2')](util['format'](_0x5dbf('0x63'),_0x2bb4d1[_0x5dbf('0x5')],queues[_0x2bb4d1[_0x5dbf('0x5')]][_0x5dbf('0x1b')],queues[_0x2bb4d1[_0x5dbf('0x5')]][_0x5dbf('0x62')]));}}catch(_0x2f0859){utils[_0x5dbf('0x15')](util[_0x5dbf('0x3')](_0x5dbf('0x61'),_0x2bb4d1[_0x5dbf('0x5')]),_0x2f0859);}};exports[_0x5dbf('0x64')]=function(_0x1ccfae){try{if(!_['isNil'](queues[_0x1ccfae[_0x5dbf('0x5')]])){if(!_[_0x5dbf('0x17')](queues[_0x1ccfae[_0x5dbf('0x5')]][_0x5dbf('0x62')])){utils[_0x5dbf('0x10')](util[_0x5dbf('0x3')](_0x5dbf('0x65'),_0x1ccfae['uniqueid']),_0x1ccfae);queues[_0x1ccfae[_0x5dbf('0x5')]][_0x5dbf('0x56')]+=utils[_0x5dbf('0x32')](utils[_0x5dbf('0x14')](),queues[_0x1ccfae[_0x5dbf('0x5')]][_0x5dbf('0x62')]);utils[_0x5dbf('0x2')](util[_0x5dbf('0x3')](_0x5dbf('0x66'),_0x1ccfae[_0x5dbf('0x5')],queues[_0x1ccfae[_0x5dbf('0x5')]][_0x5dbf('0x1b')],queues[_0x1ccfae['uniqueid']]['mohtime']));delete queues[_0x1ccfae['uniqueid']][_0x5dbf('0x62')];}}}catch(_0x4ea4de){utils[_0x5dbf('0x15')](util[_0x5dbf('0x3')](_0x5dbf('0x65'),_0x1ccfae[_0x5dbf('0x5')]),_0x4ea4de);}};
\ No newline at end of file
index 9285687..b7e46ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2771=['exten','channel','[%s][recordings][newstate]','isNil','channelstate','transfer','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','find','monitors','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','startsWith','split','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context'];(function(_0x54b324,_0xeb5725){var _0x4db43a=function(_0x3b926e){while(--_0x3b926e){_0x54b324['push'](_0x54b324['shift']());}};_0x4db43a(++_0xeb5725);}(_0x2771,0xd6));var _0x1277=function(_0x4d90ac,_0x2985ae){_0x4d90ac=_0x4d90ac-0x0;var _0x5a1d5a=_0x2771[_0x4d90ac];return _0x5a1d5a;};'use strict';var _=require(_0x1277('0x0'));var util=require('util');var utils=require(_0x1277('0x1'));var recordings={};function writeDB(_0x17bfb5){utils[_0x1277('0x2')](util[_0x1277('0x3')](_0x1277('0x4'),_0x17bfb5[_0x1277('0x5')]));if(_0x17bfb5['accountcode']){utils['getUserByInternal'](_0x17bfb5[_0x1277('0x6')])[_0x1277('0x7')](function(_0xdc4089){if(_0xdc4089){_0x17bfb5[_0x1277('0x8')]=_0xdc4089[_0x1277('0x9')];_0x17bfb5[_0x1277('0xa')]=_0xdc4089['id'];}utils[_0x1277('0xb')]('CreateVoiceRecording',_0x17bfb5);});}else{utils[_0x1277('0xb')](_0x1277('0xc'),_0x17bfb5);}}exports['newchannel']=function(_0xbbffdd){try{utils[_0x1277('0xd')](util[_0x1277('0x3')](_0x1277('0xe'),_0xbbffdd[_0x1277('0x5')]),_0xbbffdd);if(_0xbbffdd[_0x1277('0x5')]==_0xbbffdd[_0x1277('0xf')]){utils[_0x1277('0x2')](util[_0x1277('0x3')](_0x1277('0x10'),_0xbbffdd[_0x1277('0x5')],_0xbbffdd[_0x1277('0x11')],_0xbbffdd[_0x1277('0x12')]));recordings[_0xbbffdd[_0x1277('0x5')]]={'uniqueid':_0xbbffdd[_0x1277('0x5')],'accountcode':_0xbbffdd[_0x1277('0x6')],'exten':_0xbbffdd['exten'],'context':_0xbbffdd[_0x1277('0x11')],'channel':_0xbbffdd[_0x1277('0x13')],'monitors':[]};}}catch(_0x4a31ac){utils['error'](util[_0x1277('0x3')]('[%s][recordings][newchannel]',_0xbbffdd[_0x1277('0x5')]),_0x4a31ac);}};exports['newstate']=function(_0x277981){try{utils['debug'](util[_0x1277('0x3')](_0x1277('0x14'),_0x277981[_0x1277('0x5')]),_0x277981);if(!_[_0x1277('0x15')](recordings[_0x277981[_0x1277('0x5')]])&&_0x277981[_0x1277('0x16')]==0x6){utils[_0x1277('0x2')](util[_0x1277('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x277981['uniqueid'],_0x277981[_0x1277('0x11')],_0x277981[_0x1277('0x13')]));}else if(!_['isNil'](recordings[_0x277981[_0x1277('0xf')]])&&_0x277981[_0x1277('0x16')]==0x6&&_0x277981['context']!=_0x1277('0x17')){utils['info'](util[_0x1277('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x277981[_0x1277('0x5')],_0x277981['linkedid'],_0x277981['context'],_0x277981[_0x1277('0x13')]));recordings[_0x277981[_0x1277('0xf')]][_0x1277('0x6')]=_0x277981['accountcode'];}}catch(_0x52bdc3){utils[_0x1277('0x18')](util[_0x1277('0x3')]('[%s][recordings][newstate]',_0x277981['uniqueid']),_0x52bdc3);}};exports[_0x1277('0x19')]=function(_0x5f0bf0){try{if(!_[_0x1277('0x15')](_0x5f0bf0[_0x1277('0x1a')])&&!_[_0x1277('0x15')](_0x5f0bf0[_0x1277('0x1a')][_0x1277('0x1b')])){utils[_0x1277('0xd')](util[_0x1277('0x3')](_0x1277('0x1c'),_0x5f0bf0['uniqueid']),_0x5f0bf0);utils[_0x1277('0x2')](util[_0x1277('0x3')](_0x1277('0x1d'),_0x5f0bf0[_0x1277('0x5')],_0x5f0bf0[_0x1277('0x1a')],_0x5f0bf0[_0x1277('0x1e')]));if(_[_0x1277('0x1f')](_0x5f0bf0[_0x1277('0x1e')],'.wav49')){_0x5f0bf0[_0x1277('0x1e')]=_0x5f0bf0['value'][_0x1277('0x20')](_0x1277('0x21'),'.WAV');}if(recordings[_0x5f0bf0['linkedid']]){var _0x57422c=_[_0x1277('0x22')](recordings[_0x5f0bf0[_0x1277('0xf')]][_0x1277('0x23')],{'value':_0x5f0bf0[_0x1277('0x1e')]});if(_[_0x1277('0x15')](_0x57422c)){recordings[_0x5f0bf0[_0x1277('0xf')]]['monitors']['push']({'value':_0x5f0bf0['value']});}}}}catch(_0x3eaa2f){utils['error'](util[_0x1277('0x3')]('[%s][recordings][varset]',_0x5f0bf0['uniqueid']),_0x3eaa2f);}};exports['hangup']=function(_0x3ed33e){try{if(!_[_0x1277('0x15')](recordings[_0x3ed33e[_0x1277('0x5')]])){utils[_0x1277('0xd')](util[_0x1277('0x3')](_0x1277('0x24'),_0x3ed33e[_0x1277('0x5')]),_0x3ed33e);utils[_0x1277('0x2')](util[_0x1277('0x3')](_0x1277('0x25'),_0x3ed33e[_0x1277('0x5')],_0x3ed33e['calleridnum'],_0x3ed33e[_0x1277('0x26')],_0x3ed33e[_0x1277('0x27')]));recordings[_0x3ed33e['uniqueid']][_0x1277('0x28')]=_0x3ed33e[_0x1277('0x28')];recordings[_0x3ed33e[_0x1277('0x5')]][_0x1277('0x26')]=_0x3ed33e[_0x1277('0x26')];recordings[_0x3ed33e[_0x1277('0x5')]]['connectedlinenum']=_0x3ed33e[_0x1277('0x29')];recordings[_0x3ed33e['uniqueid']]['connectedlinename']=_0x3ed33e[_0x1277('0x2a')];if(recordings[_0x3ed33e['uniqueid']]['type']==_0x1277('0x2b')&&recordings[_0x3ed33e[_0x1277('0x5')]][_0x1277('0x6')]){recordings[_0x3ed33e['uniqueid']]['connectedlinenum']=recordings[_0x3ed33e[_0x1277('0x5')]][_0x1277('0x6')];recordings[_0x3ed33e['uniqueid']][_0x1277('0x2a')]='';}recordings[_0x3ed33e[_0x1277('0x5')]][_0x1277('0x23')][_0x1277('0x2c')](function(_0x27ce67){var _0x4b5771=_[_0x1277('0x2d')](recordings[_0x3ed33e[_0x1277('0x5')]]);_0x4b5771[_0x1277('0x1e')]=_0x27ce67[_0x1277('0x1e')];writeDB(_0x4b5771);});delete recordings[_0x3ed33e[_0x1277('0x5')]];}}catch(_0x134147){utils[_0x1277('0x18')](util[_0x1277('0x3')](_0x1277('0x24'),_0x3ed33e[_0x1277('0x5')]),_0x134147);}};exports[_0x1277('0x2e')]=function(_0x30f0b8){try{if(!_[_0x1277('0x15')](recordings[_0x30f0b8[_0x1277('0x5')]])){utils[_0x1277('0xd')](util[_0x1277('0x3')](_0x1277('0x2f'),_0x30f0b8[_0x1277('0x5')]),_0x30f0b8);utils['info'](util[_0x1277('0x3')](_0x1277('0x30'),_0x30f0b8[_0x1277('0x5')],_0x30f0b8['application'],_0x30f0b8[_0x1277('0x31')]));if(_0x30f0b8['application'][_0x1277('0x32')]()==_0x1277('0x33')&&_[_0x1277('0x34')](_0x30f0b8[_0x1277('0x31')][_0x1277('0x32')](),'cdr')){var _0x2ccb58=_0x30f0b8['appdata'][_0x1277('0x35')]('=');var _0x14e4b2=_0x2ccb58[0x0]['substring'](_0x2ccb58[0x0]['lastIndexOf']('(')+0x1,_0x2ccb58[0x0][_0x1277('0x36')](')'));var _0x316d48=_0x2ccb58[0x1];recordings[_0x30f0b8[_0x1277('0x5')]][_0x14e4b2]=_0x316d48;}}}catch(_0x160fb1){utils[_0x1277('0x18')](util[_0x1277('0x3')](_0x1277('0x2f'),_0x30f0b8['uniqueid']),_0x160fb1);}};exports['queuecallerjoin']=function(_0x5d213b){try{if(!_['isNil'](recordings[_0x5d213b['uniqueid']])){utils[_0x1277('0xd')](util['format'](_0x1277('0x37'),_0x5d213b[_0x1277('0x5')]),_0x5d213b);utils['info'](util[_0x1277('0x3')](_0x1277('0x38'),_0x5d213b[_0x1277('0x5')],_0x5d213b[_0x1277('0x39')]));recordings[_0x5d213b[_0x1277('0x5')]][_0x1277('0x39')]=_0x5d213b[_0x1277('0x39')];}}catch(_0x5e3945){utils['error'](util[_0x1277('0x3')]('[%s][recordings][queuecallerjoin]',_0x5d213b[_0x1277('0x5')]),_0x5e3945);}};
\ No newline at end of file
+var _0x7cac=['[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','.wav49','value','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]'];(function(_0x1e6f93,_0x21ffb4){var _0x296147=function(_0x470cc0){while(--_0x470cc0){_0x1e6f93['push'](_0x1e6f93['shift']());}};_0x296147(++_0x21ffb4);}(_0x7cac,0x94));var _0xc7ca=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x7cac[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xc7ca('0x0'));var util=require(_0xc7ca('0x1'));var utils=require(_0xc7ca('0x2'));var recordings={};function writeDB(_0x12ca3a){utils[_0xc7ca('0x3')](util[_0xc7ca('0x4')](_0xc7ca('0x5'),_0x12ca3a[_0xc7ca('0x6')]));if(_0x12ca3a[_0xc7ca('0x7')]){utils[_0xc7ca('0x8')](_0x12ca3a[_0xc7ca('0x7')])[_0xc7ca('0x9')](function(_0x1d47cb){if(_0x1d47cb){_0x12ca3a[_0xc7ca('0xa')]=_0x1d47cb['name'];_0x12ca3a[_0xc7ca('0xb')]=_0x1d47cb['id'];}utils['request']('CreateVoiceRecording',_0x12ca3a);});}else{utils[_0xc7ca('0xc')](_0xc7ca('0xd'),_0x12ca3a);}}exports['newchannel']=function(_0x2207ea){try{utils[_0xc7ca('0xe')](util[_0xc7ca('0x4')](_0xc7ca('0xf'),_0x2207ea[_0xc7ca('0x6')]),_0x2207ea);if(_0x2207ea[_0xc7ca('0x6')]==_0x2207ea[_0xc7ca('0x10')]){utils[_0xc7ca('0x3')](util[_0xc7ca('0x4')](_0xc7ca('0x11'),_0x2207ea[_0xc7ca('0x6')],_0x2207ea['context'],_0x2207ea[_0xc7ca('0x12')]));recordings[_0x2207ea['uniqueid']]={'uniqueid':_0x2207ea[_0xc7ca('0x6')],'accountcode':_0x2207ea[_0xc7ca('0x7')],'exten':_0x2207ea['exten'],'context':_0x2207ea[_0xc7ca('0x13')],'channel':_0x2207ea[_0xc7ca('0x14')],'monitors':[]};}}catch(_0x2ea905){utils[_0xc7ca('0x15')](util['format'](_0xc7ca('0xf'),_0x2207ea['uniqueid']),_0x2ea905);}};exports[_0xc7ca('0x16')]=function(_0x2ca5c8){try{utils[_0xc7ca('0xe')](util[_0xc7ca('0x4')]('[%s][recordings][newstate]',_0x2ca5c8[_0xc7ca('0x6')]),_0x2ca5c8);if(!_[_0xc7ca('0x17')](recordings[_0x2ca5c8[_0xc7ca('0x6')]])&&_0x2ca5c8[_0xc7ca('0x18')]==0x6){utils[_0xc7ca('0x3')](util[_0xc7ca('0x4')](_0xc7ca('0x19'),_0x2ca5c8[_0xc7ca('0x6')],_0x2ca5c8[_0xc7ca('0x13')],_0x2ca5c8['channel']));}else if(!_[_0xc7ca('0x17')](recordings[_0x2ca5c8['linkedid']])&&_0x2ca5c8[_0xc7ca('0x18')]==0x6&&_0x2ca5c8[_0xc7ca('0x13')]!=_0xc7ca('0x1a')){utils[_0xc7ca('0x3')](util[_0xc7ca('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2ca5c8[_0xc7ca('0x6')],_0x2ca5c8[_0xc7ca('0x10')],_0x2ca5c8[_0xc7ca('0x13')],_0x2ca5c8[_0xc7ca('0x14')]));recordings[_0x2ca5c8['linkedid']]['accountcode']=_0x2ca5c8[_0xc7ca('0x7')];}}catch(_0x31c066){utils[_0xc7ca('0x15')](util[_0xc7ca('0x4')](_0xc7ca('0x1b'),_0x2ca5c8['uniqueid']),_0x31c066);}};exports[_0xc7ca('0x1c')]=function(_0x12e237){try{if(!_[_0xc7ca('0x17')](_0x12e237[_0xc7ca('0x1d')])&&!_[_0xc7ca('0x17')](_0x12e237['variable'][_0xc7ca('0x1e')])){utils[_0xc7ca('0xe')](util[_0xc7ca('0x4')](_0xc7ca('0x1f'),_0x12e237[_0xc7ca('0x6')]),_0x12e237);utils[_0xc7ca('0x3')](util['format'](_0xc7ca('0x20'),_0x12e237['uniqueid'],_0x12e237['variable'],_0x12e237['value']));if(_['endsWith'](_0x12e237['value'],_0xc7ca('0x21'))){_0x12e237[_0xc7ca('0x22')]=_0x12e237['value'][_0xc7ca('0x23')](_0xc7ca('0x21'),_0xc7ca('0x24'));}if(recordings[_0x12e237['linkedid']]){var _0x3c54ab=_[_0xc7ca('0x25')](recordings[_0x12e237[_0xc7ca('0x10')]][_0xc7ca('0x26')],{'value':_0x12e237[_0xc7ca('0x22')]});if(_[_0xc7ca('0x17')](_0x3c54ab)){recordings[_0x12e237[_0xc7ca('0x10')]][_0xc7ca('0x26')][_0xc7ca('0x27')]({'value':_0x12e237[_0xc7ca('0x22')]});}}}}catch(_0x40c644){utils['error'](util[_0xc7ca('0x4')](_0xc7ca('0x1f'),_0x12e237['uniqueid']),_0x40c644);}};exports[_0xc7ca('0x28')]=function(_0xd30e89){try{if(!_[_0xc7ca('0x17')](recordings[_0xd30e89['uniqueid']])){utils['debug'](util[_0xc7ca('0x4')](_0xc7ca('0x29'),_0xd30e89[_0xc7ca('0x6')]),_0xd30e89);utils['info'](util[_0xc7ca('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0xd30e89[_0xc7ca('0x6')],_0xd30e89[_0xc7ca('0x2a')],_0xd30e89[_0xc7ca('0x2b')],_0xd30e89[_0xc7ca('0x2c')]));recordings[_0xd30e89['uniqueid']]['calleridnum']=_0xd30e89['calleridnum'];recordings[_0xd30e89[_0xc7ca('0x6')]][_0xc7ca('0x2b')]=_0xd30e89[_0xc7ca('0x2b')];recordings[_0xd30e89[_0xc7ca('0x6')]]['connectedlinenum']=_0xd30e89[_0xc7ca('0x2d')];recordings[_0xd30e89[_0xc7ca('0x6')]]['connectedlinename']=_0xd30e89[_0xc7ca('0x2e')];if(recordings[_0xd30e89[_0xc7ca('0x6')]][_0xc7ca('0x2f')]==_0xc7ca('0x30')&&recordings[_0xd30e89['uniqueid']]['accountcode']){recordings[_0xd30e89[_0xc7ca('0x6')]]['connectedlinenum']=recordings[_0xd30e89['uniqueid']][_0xc7ca('0x7')];recordings[_0xd30e89['uniqueid']][_0xc7ca('0x2e')]='';}recordings[_0xd30e89[_0xc7ca('0x6')]][_0xc7ca('0x26')][_0xc7ca('0x31')](function(_0x2038ab){var _0x3e0162=_[_0xc7ca('0x32')](recordings[_0xd30e89[_0xc7ca('0x6')]]);_0x3e0162[_0xc7ca('0x22')]=_0x2038ab[_0xc7ca('0x22')];writeDB(_0x3e0162);});delete recordings[_0xd30e89[_0xc7ca('0x6')]];}}catch(_0x5936cf){utils['error'](util[_0xc7ca('0x4')]('[%s][recordings][hangup]',_0xd30e89[_0xc7ca('0x6')]),_0x5936cf);}};exports[_0xc7ca('0x33')]=function(_0x380ede){try{if(!_[_0xc7ca('0x17')](recordings[_0x380ede[_0xc7ca('0x6')]])){utils[_0xc7ca('0xe')](util[_0xc7ca('0x4')](_0xc7ca('0x34'),_0x380ede[_0xc7ca('0x6')]),_0x380ede);utils[_0xc7ca('0x3')](util[_0xc7ca('0x4')](_0xc7ca('0x35'),_0x380ede[_0xc7ca('0x6')],_0x380ede[_0xc7ca('0x36')],_0x380ede[_0xc7ca('0x37')]));if(_0x380ede[_0xc7ca('0x36')][_0xc7ca('0x38')]()==_0xc7ca('0x39')&&_[_0xc7ca('0x3a')](_0x380ede[_0xc7ca('0x37')][_0xc7ca('0x38')](),_0xc7ca('0x3b'))){var _0x1c1372=_0x380ede[_0xc7ca('0x37')][_0xc7ca('0x3c')]('=');var _0x2fa499=_0x1c1372[0x0][_0xc7ca('0x3d')](_0x1c1372[0x0]['lastIndexOf']('(')+0x1,_0x1c1372[0x0][_0xc7ca('0x3e')](')'));var _0x36db9c=_0x1c1372[0x1];recordings[_0x380ede['uniqueid']][_0x2fa499]=_0x36db9c;}}}catch(_0x32b86a){utils[_0xc7ca('0x15')](util[_0xc7ca('0x4')]('[%s][recordings][newexten]',_0x380ede[_0xc7ca('0x6')]),_0x32b86a);}};exports[_0xc7ca('0x3f')]=function(_0x14614c){try{if(!_['isNil'](recordings[_0x14614c[_0xc7ca('0x6')]])){utils['debug'](util[_0xc7ca('0x4')](_0xc7ca('0x40'),_0x14614c[_0xc7ca('0x6')]),_0x14614c);utils['info'](util[_0xc7ca('0x4')](_0xc7ca('0x41'),_0x14614c[_0xc7ca('0x6')],_0x14614c['queue']));recordings[_0x14614c[_0xc7ca('0x6')]][_0xc7ca('0x42')]=_0x14614c[_0xc7ca('0x42')];}}catch(_0x203396){utils['error'](util[_0xc7ca('0x4')](_0xc7ca('0x40'),_0x14614c[_0xc7ca('0x6')]),_0x203396);}};
\ No newline at end of file
index 2cb0ea2..5706908 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a97=['transfereecalleridname','blind','blinds','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','util','info','type','attended','origtransfereruniqueid','request','debug','format','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum'];(function(_0x412514,_0x2682f8){var _0x4d9f5c=function(_0x449938){while(--_0x449938){_0x412514['push'](_0x412514['shift']());}};_0x4d9f5c(++_0x2682f8);}(_0x5a97,0x134));var _0x75a9=function(_0x30c6fb,_0x2b15bd){_0x30c6fb=_0x30c6fb-0x0;var _0x5d0b3e=_0x5a97[_0x30c6fb];return _0x5d0b3e;};'use strict';var _=require('lodash');var util=require(_0x75a9('0x0'));var utils=require('./utils');function writeDB(_0x35b6d1){utils[_0x75a9('0x1')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x35b6d1[_0x75a9('0x2')]===_0x75a9('0x3')?_0x35b6d1[_0x75a9('0x4')]:_0x35b6d1['uniqueid'],_0x35b6d1[_0x75a9('0x2')]));utils[_0x75a9('0x5')]('CreateVoiceTransferReport',_0x35b6d1);}exports['blinds']={};exports['blindtransfer']=function(_0x44f462){try{utils[_0x75a9('0x6')](util[_0x75a9('0x7')]('[%s][transfers][blindtransfer]',_0x44f462['uniqueid']),_0x44f462);utils[_0x75a9('0x1')](util[_0x75a9('0x7')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x44f462[_0x75a9('0x8')],_0x44f462[_0x75a9('0x9')],_0x44f462[_0x75a9('0xa')],_0x44f462[_0x75a9('0xb')],_0x44f462[_0x75a9('0xc')]));_0x44f462[_0x75a9('0x2')]=_0x75a9('0xd');exports[_0x75a9('0xe')][_0x44f462['transfereruniqueid']]=_0x44f462;writeDB(_0x44f462);}catch(_0x7e3780){utils['error'](util[_0x75a9('0x7')](_0x75a9('0xf'),_0x44f462['uniqueid']),_0x7e3780);}};exports[_0x75a9('0x10')]=function(_0x3703d6){try{utils[_0x75a9('0x6')](util[_0x75a9('0x7')](_0x75a9('0x11'),_0x3703d6[_0x75a9('0x4')]),_0x3703d6);utils['info'](util['format'](_0x75a9('0x12'),_0x3703d6[_0x75a9('0x4')],_0x3703d6[_0x75a9('0x13')],_0x3703d6[_0x75a9('0x14')],_0x3703d6[_0x75a9('0x15')],_0x3703d6[_0x75a9('0x16')]));_0x3703d6=_[_0x75a9('0x17')](_0x3703d6,{'transfererchannel':_0x3703d6[_0x75a9('0x18')],'transferercalleridnum':_0x3703d6['origtransferercalleridnum'],'transferercalleridname':_0x3703d6[_0x75a9('0x14')],'transfererconnectedlinenum':_0x3703d6[_0x75a9('0x19')],'transfererconnectedlinename':_0x3703d6[_0x75a9('0x1a')],'transfereraccountcode':_0x3703d6[_0x75a9('0x1b')],'transferercontext':_0x3703d6[_0x75a9('0x1c')],'transfererexten':_0x3703d6[_0x75a9('0x1d')],'transfererlinkedid':_0x3703d6[_0x75a9('0x1e')],'context':_0x3703d6[_0x75a9('0x1f')],'extension':_0x3703d6[_0x75a9('0x20')],'type':_0x75a9('0x3')});if(_['isNil'](_0x3703d6[_0x75a9('0x21')])){_0x3703d6=_[_0x75a9('0x17')](_0x3703d6,{'transfereechannel':_0x3703d6['transfertargetchannel'],'transfereecalleridnum':_0x3703d6[_0x75a9('0x15')],'transfereecalleridname':_0x3703d6[_0x75a9('0x16')],'transfereeconnectedlinenum':_0x3703d6[_0x75a9('0x22')],'transfereeconnectedlinename':_0x3703d6[_0x75a9('0x23')],'transfereeaccountcode':_0x3703d6['transfertargetaccountcode'],'transfereecontext':_0x3703d6[_0x75a9('0x24')],'transfereeexten':_0x3703d6[_0x75a9('0x25')],'transfereelinkedid':_0x3703d6[_0x75a9('0x26')]});}writeDB(_0x3703d6);}catch(_0x230f18){utils[_0x75a9('0x27')](util['format'](_0x75a9('0x11'),_0x3703d6[_0x75a9('0x4')]),_0x230f18);}};
\ No newline at end of file
+var _0x42d2=['type','request','CreateVoiceTransferReport','blindtransfer','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','error','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid'];(function(_0x563d77,_0x305794){var _0x24cfdf=function(_0x2ed7bc){while(--_0x2ed7bc){_0x563d77['push'](_0x563d77['shift']());}};_0x24cfdf(++_0x305794);}(_0x42d2,0x12e));var _0x242d=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0x42d2[_0x55c1f0];return _0x1530fa;};'use strict';var _=require(_0x242d('0x0'));var util=require(_0x242d('0x1'));var utils=require(_0x242d('0x2'));function writeDB(_0x38cf74){utils[_0x242d('0x3')](util['format'](_0x242d('0x4'),_0x38cf74['type']==='attended'?_0x38cf74[_0x242d('0x5')]:_0x38cf74['uniqueid'],_0x38cf74[_0x242d('0x6')]));utils[_0x242d('0x7')](_0x242d('0x8'),_0x38cf74);}exports['blinds']={};exports[_0x242d('0x9')]=function(_0x497c40){try{utils['debug'](util[_0x242d('0xa')](_0x242d('0xb'),_0x497c40['uniqueid']),_0x497c40);utils[_0x242d('0x3')](util[_0x242d('0xa')](_0x242d('0xc'),_0x497c40[_0x242d('0xd')],_0x497c40[_0x242d('0xe')],_0x497c40[_0x242d('0xf')],_0x497c40[_0x242d('0x10')],_0x497c40[_0x242d('0x11')]));_0x497c40[_0x242d('0x6')]=_0x242d('0x12');exports[_0x242d('0x13')][_0x497c40['transfereruniqueid']]=_0x497c40;writeDB(_0x497c40);}catch(_0x7f4d12){utils[_0x242d('0x14')](util['format']('[%s][transfers][blindtransfer]',_0x497c40[_0x242d('0xd')]),_0x7f4d12);}};exports['attendedtransfer']=function(_0xe6d73f){try{utils[_0x242d('0x15')](util[_0x242d('0xa')](_0x242d('0x16'),_0xe6d73f['origtransfereruniqueid']),_0xe6d73f);utils[_0x242d('0x3')](util['format'](_0x242d('0x17'),_0xe6d73f[_0x242d('0x5')],_0xe6d73f[_0x242d('0x18')],_0xe6d73f[_0x242d('0x19')],_0xe6d73f[_0x242d('0x1a')],_0xe6d73f['transfertargetcalleridname']));_0xe6d73f=_['assign'](_0xe6d73f,{'transfererchannel':_0xe6d73f[_0x242d('0x1b')],'transferercalleridnum':_0xe6d73f[_0x242d('0x18')],'transferercalleridname':_0xe6d73f[_0x242d('0x19')],'transfererconnectedlinenum':_0xe6d73f[_0x242d('0x1c')],'transfererconnectedlinename':_0xe6d73f[_0x242d('0x1d')],'transfereraccountcode':_0xe6d73f['origtransfereraccountcode'],'transferercontext':_0xe6d73f[_0x242d('0x1e')],'transfererexten':_0xe6d73f['secondtransfererexten'],'transfererlinkedid':_0xe6d73f['origtransfererlinkedid'],'context':_0xe6d73f[_0x242d('0x1f')],'extension':_0xe6d73f[_0x242d('0x20')],'type':_0x242d('0x21')});if(_[_0x242d('0x22')](_0xe6d73f[_0x242d('0x23')])){_0xe6d73f=_[_0x242d('0x24')](_0xe6d73f,{'transfereechannel':_0xe6d73f[_0x242d('0x25')],'transfereecalleridnum':_0xe6d73f[_0x242d('0x1a')],'transfereecalleridname':_0xe6d73f[_0x242d('0x26')],'transfereeconnectedlinenum':_0xe6d73f[_0x242d('0x27')],'transfereeconnectedlinename':_0xe6d73f[_0x242d('0x28')],'transfereeaccountcode':_0xe6d73f[_0x242d('0x29')],'transfereecontext':_0xe6d73f['transfertargetcontext'],'transfereeexten':_0xe6d73f[_0x242d('0x2a')],'transfereelinkedid':_0xe6d73f[_0x242d('0x2b')]});}writeDB(_0xe6d73f);}catch(_0x3be14e){utils[_0x242d('0x14')](util[_0x242d('0xa')](_0x242d('0x16'),_0xe6d73f[_0x242d('0x5')]),_0x3be14e);}};
\ No newline at end of file
index 54cf072..229fdf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3766=['add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','../../config/logger','xdr','info','inspect','debug','error','request','catch','[utils][request]\x20name:%s','GetUser','internal','name','interface','then','[utils][getUser]\x20where:%s','stringify','length','getUserByInternal','found','notfound','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','result','addTime'];(function(_0x1915a8,_0x581c9a){var _0x5e3c96=function(_0x4b8be5){while(--_0x4b8be5){_0x1915a8['push'](_0x1915a8['shift']());}};_0x5e3c96(++_0x581c9a);}(_0x3766,0xc0));var _0x6376=function(_0x37e21b,_0x50b31e){_0x37e21b=_0x37e21b-0x0;var _0x411f61=_0x3766[_0x37e21b];return _0x411f61;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x6376('0x0'));var moment=require(_0x6376('0x1'));var util=require(_0x6376('0x2'));var client=jayson[_0x6376('0x3')]['http']({'port':0x2329});var logger=require(_0x6376('0x4'))(_0x6376('0x5'));exports[_0x6376('0x6')]=function(_0x3f0e5b,_0x241ba3){logger[_0x6376('0x6')](_0x3f0e5b,_0x241ba3?util[_0x6376('0x7')](_0x241ba3,{'showHidden':![],'depth':null}):'');};exports[_0x6376('0x8')]=function(_0x2561e7,_0x4b0a0b){logger[_0x6376('0x8')](_0x2561e7,_0x4b0a0b?util[_0x6376('0x7')](_0x4b0a0b,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x11de79,_0x263881){logger[_0x6376('0x9')](_0x11de79,_0x263881?util['inspect'](_0x263881,{'showHidden':![],'depth':null}):'');};exports[_0x6376('0xa')]=function(_0x16a4e8,_0x89bbbd){return client[_0x6376('0xa')](_0x16a4e8,{'body':_0x89bbbd})['then'](function(_0x5c5e13){logger[_0x6376('0x8')]('[utils][request]\x20name:%s',_0x16a4e8,_0x5c5e13?util[_0x6376('0x7')](_0x5c5e13,{'showHidden':![],'depth':null}):'');})[_0x6376('0xb')](function(_0x1d6f6c){logger[_0x6376('0x9')](_0x6376('0xc'),_0x16a4e8,_0x1d6f6c?util[_0x6376('0x7')](_0x1d6f6c,{'showHidden':![],'depth':null}):'');});};function getUser(_0x13194d){return client[_0x6376('0xa')](_0x6376('0xd'),{'options':{'raw':!![],'attributes':['id',_0x6376('0xe'),_0x6376('0xf'),_0x6376('0x10')],'where':_0x13194d,'limit':0x1}})[_0x6376('0x11')](function(_0x11d69d){logger[_0x6376('0x8')](_0x6376('0x12'),JSON[_0x6376('0x13')](_0x13194d),_0x11d69d?util[_0x6376('0x7')](_0x11d69d,{'showHidden':![],'depth':null}):'');return _0x11d69d['result'][_0x6376('0x14')]?_0x11d69d['result'][0x0]:null;});}exports[_0x6376('0x15')]=function(_0x47d03d){return new BPromise(function(_0x307847,_0x290296){if(_0x47d03d){return getUser({'internal':_0x47d03d})[_0x6376('0x11')](function(_0x4125f7){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x47d03d,_0x4125f7?_0x6376('0x16'):_0x6376('0x17'));return _0x307847(_0x4125f7);})['catch'](function(_0x541ea6){logger[_0x6376('0x9')]('[utils][getUserByInternal]',_0x541ea6?util[_0x6376('0x7')](_0x541ea6,{'showHidden':![],'depth':null}):'');return _0x307847(null);});}return _0x307847(null);});};exports['getUserByInterface']=function(_0x32d6bd){return new BPromise(function(_0x3bec0e,_0x4ba8d4){if(_0x32d6bd){return getUser({'interface':_0x32d6bd})[_0x6376('0x11')](function(_0x48e9c0){logger[_0x6376('0x6')](_0x6376('0x18'),_0x32d6bd,_0x48e9c0?'found':'notfound');return _0x3bec0e(_0x48e9c0);})[_0x6376('0xb')](function(_0x43c884){logger[_0x6376('0x9')]('[utils][getUserByInterface]',_0x43c884?util[_0x6376('0x7')](_0x43c884,{'showHidden':![],'depth':null}):'');return _0x3bec0e(null);});}return _0x3bec0e(null);});};exports[_0x6376('0x19')]=function(_0x43f143){return new BPromise(function(_0x55cf3c,_0x1cc4cd){if(_0x43f143){return getUser({'name':_0x43f143})[_0x6376('0x11')](function(_0x14a5fb){logger[_0x6376('0x6')](_0x6376('0x1a'),_0x43f143,_0x14a5fb?_0x6376('0x16'):_0x6376('0x17'));return _0x55cf3c(_0x14a5fb);})['catch'](function(_0xc0945a){logger[_0x6376('0x9')]('[utils][getUserByName]',_0xc0945a?util['inspect'](_0xc0945a,{'showHidden':![],'depth':null}):'');return _0x55cf3c(null);});}return _0x55cf3c(null);});};exports['getVoiceQueueByName']=function(_0x1b9e77){return new BPromise(function(_0x3a3025,_0x726f2b){if(_0x1b9e77){return client[_0x6376('0xa')](_0x6376('0x1b'),{'options':{'raw':!![],'attributes':['id',_0x6376('0xf'),_0x6376('0x1c'),'acw','acwTimeout'],'where':{'name':_0x1b9e77},'limit':0x1}})[_0x6376('0x11')](function(_0x11811b){logger[_0x6376('0x8')](_0x6376('0x1d'),_0x1b9e77,_0x11811b?util[_0x6376('0x7')](_0x11811b,{'showHidden':![],'depth':null}):'');logger[_0x6376('0x6')](_0x6376('0x1e'),_0x1b9e77,_0x11811b?_0x6376('0x16'):_0x6376('0x17'));return _0x3a3025(_0x11811b[_0x6376('0x1f')][_0x6376('0x14')]?_0x11811b['result'][0x0]:null);})[_0x6376('0xb')](function(_0xc07912){logger['error']('[utils][getVoiceQueueByName]',_0xc07912?util[_0x6376('0x7')](_0xc07912,{'showHidden':![],'depth':null}):'');return _0x3a3025(null);});}return _0x3a3025(null);});};exports[_0x6376('0x20')]=function(_0x18e2de,_0x420e9a){return moment(_0x18e2de)[_0x6376('0x21')](_0x420e9a,_0x6376('0x22'))[_0x6376('0x23')](_0x6376('0x24'));};exports[_0x6376('0x25')]=function(_0x18ebc7,_0x8dd866){return moment(_0x18ebc7)[_0x6376('0x26')](_0x8dd866,_0x6376('0x22'))['format'](_0x6376('0x24'));};exports[_0x6376('0x27')]=function(_0x184970,_0x106ca8){return moment(_0x184970)[_0x6376('0x28')](moment(_0x106ca8),'seconds');};exports[_0x6376('0x29')]=function(_0x27ea25,_0x38c541){return parseInt(_0x27ea25,0xa)+parseInt(_0x38c541,0xa);};exports[_0x6376('0x2a')]=function(){return moment()[_0x6376('0x23')](_0x6376('0x24'));};exports[_0x6376('0x2b')]=function(_0x5b3895,_0x96cbfa){if(_0x96cbfa){return moment(_0x5b3895)['isAfter'](_0x96cbfa);}return!![];};exports[_0x6376('0x2c')]=function(_0x3d366d,_0x435df5){if(_0x435df5){return moment(_0x3d366d)[_0x6376('0x2c')](_0x435df5);}else if(_0x3d366d){return!![];}return![];};
\ No newline at end of file
+var _0x5434=['getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','GetVoiceQueue','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','isAfter','isBefore','jayson/promise','moment','util','http','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length'];(function(_0xc7f23c,_0x2be758){var _0x4b4def=function(_0x1b3aab){while(--_0x1b3aab){_0xc7f23c['push'](_0xc7f23c['shift']());}};_0x4b4def(++_0x2be758);}(_0x5434,0x105));var _0x4543=function(_0x4a9565,_0x30a59e){_0x4a9565=_0x4a9565-0x0;var _0x300173=_0x5434[_0x4a9565];return _0x300173;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x4543('0x0'));var moment=require(_0x4543('0x1'));var util=require(_0x4543('0x2'));var client=jayson['client'][_0x4543('0x3')]({'port':0x2329});var logger=require(_0x4543('0x4'))(_0x4543('0x5'));exports[_0x4543('0x6')]=function(_0x39e181,_0x3d50cb){logger[_0x4543('0x6')](_0x39e181,_0x3d50cb?util['inspect'](_0x3d50cb,{'showHidden':![],'depth':null}):'');};exports[_0x4543('0x7')]=function(_0x101db0,_0x44a653){logger[_0x4543('0x7')](_0x101db0,_0x44a653?util[_0x4543('0x8')](_0x44a653,{'showHidden':![],'depth':null}):'');};exports[_0x4543('0x9')]=function(_0x4a3adf,_0x3ce7d7){logger['error'](_0x4a3adf,_0x3ce7d7?util['inspect'](_0x3ce7d7,{'showHidden':![],'depth':null}):'');};exports[_0x4543('0xa')]=function(_0x54e80a,_0x389c20){return client[_0x4543('0xa')](_0x54e80a,{'body':_0x389c20})[_0x4543('0xb')](function(_0x12c36e){logger['debug'](_0x4543('0xc'),_0x54e80a,_0x12c36e?util['inspect'](_0x12c36e,{'showHidden':![],'depth':null}):'');})[_0x4543('0xd')](function(_0x7de426){logger['error'](_0x4543('0xc'),_0x54e80a,_0x7de426?util[_0x4543('0x8')](_0x7de426,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2e951d){return client[_0x4543('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x4543('0xe'),_0x4543('0xf'),_0x4543('0x10')],'where':_0x2e951d,'limit':0x1}})[_0x4543('0xb')](function(_0x8cfba5){logger[_0x4543('0x7')](_0x4543('0x11'),JSON[_0x4543('0x12')](_0x2e951d),_0x8cfba5?util[_0x4543('0x8')](_0x8cfba5,{'showHidden':![],'depth':null}):'');return _0x8cfba5[_0x4543('0x13')][_0x4543('0x14')]?_0x8cfba5['result'][0x0]:null;});}exports[_0x4543('0x15')]=function(_0x4e439b){return new BPromise(function(_0x224432,_0x4fe332){if(_0x4e439b){return getUser({'internal':_0x4e439b})[_0x4543('0xb')](function(_0x3ed0e4){logger[_0x4543('0x6')](_0x4543('0x16'),_0x4e439b,_0x3ed0e4?_0x4543('0x17'):_0x4543('0x18'));return _0x224432(_0x3ed0e4);})['catch'](function(_0x46e16f){logger[_0x4543('0x9')](_0x4543('0x19'),_0x46e16f?util[_0x4543('0x8')](_0x46e16f,{'showHidden':![],'depth':null}):'');return _0x224432(null);});}return _0x224432(null);});};exports['getUserByInterface']=function(_0xc36fb6){return new BPromise(function(_0x26d2a0,_0x9335fb){if(_0xc36fb6){return getUser({'interface':_0xc36fb6})['then'](function(_0x5d9829){logger['info'](_0x4543('0x1a'),_0xc36fb6,_0x5d9829?_0x4543('0x17'):_0x4543('0x18'));return _0x26d2a0(_0x5d9829);})[_0x4543('0xd')](function(_0x2b638a){logger[_0x4543('0x9')](_0x4543('0x1b'),_0x2b638a?util[_0x4543('0x8')](_0x2b638a,{'showHidden':![],'depth':null}):'');return _0x26d2a0(null);});}return _0x26d2a0(null);});};exports[_0x4543('0x1c')]=function(_0x72327e){return new BPromise(function(_0x25c907,_0x553b33){if(_0x72327e){return getUser({'name':_0x72327e})['then'](function(_0x852a9a){logger[_0x4543('0x6')](_0x4543('0x1d'),_0x72327e,_0x852a9a?_0x4543('0x17'):_0x4543('0x18'));return _0x25c907(_0x852a9a);})[_0x4543('0xd')](function(_0x31265c){logger[_0x4543('0x9')]('[utils][getUserByName]',_0x31265c?util['inspect'](_0x31265c,{'showHidden':![],'depth':null}):'');return _0x25c907(null);});}return _0x25c907(null);});};exports['getVoiceQueueByName']=function(_0x481860){return new BPromise(function(_0x327c4a,_0x90cce5){if(_0x481860){return client[_0x4543('0xa')](_0x4543('0x1e'),{'options':{'raw':!![],'attributes':['id','name','type',_0x4543('0x1f'),'acwTimeout'],'where':{'name':_0x481860},'limit':0x1}})['then'](function(_0x16d13d){logger[_0x4543('0x7')](_0x4543('0x20'),_0x481860,_0x16d13d?util[_0x4543('0x8')](_0x16d13d,{'showHidden':![],'depth':null}):'');logger[_0x4543('0x6')](_0x4543('0x21'),_0x481860,_0x16d13d?'found':'notfound');return _0x327c4a(_0x16d13d[_0x4543('0x13')][_0x4543('0x14')]?_0x16d13d['result'][0x0]:null);})[_0x4543('0xd')](function(_0x51f616){logger[_0x4543('0x9')](_0x4543('0x22'),_0x51f616?util[_0x4543('0x8')](_0x51f616,{'showHidden':![],'depth':null}):'');return _0x327c4a(null);});}return _0x327c4a(null);});};exports[_0x4543('0x23')]=function(_0x57bb8a,_0x4efa0f){return moment(_0x57bb8a)[_0x4543('0x24')](_0x4efa0f,_0x4543('0x25'))[_0x4543('0x26')](_0x4543('0x27'));};exports[_0x4543('0x28')]=function(_0x20e24e,_0x48bb08){return moment(_0x20e24e)[_0x4543('0x29')](_0x48bb08,'seconds')[_0x4543('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x4543('0x2a')]=function(_0x58c8b0,_0x4e4cc3){return moment(_0x58c8b0)[_0x4543('0x2b')](moment(_0x4e4cc3),_0x4543('0x25'));};exports[_0x4543('0x2c')]=function(_0x28b658,_0x5826f4){return parseInt(_0x28b658,0xa)+parseInt(_0x5826f4,0xa);};exports['now']=function(){return moment()[_0x4543('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x1b7b09,_0xcbeccc){if(_0xcbeccc){return moment(_0x1b7b09)[_0x4543('0x2d')](_0xcbeccc);}return!![];};exports[_0x4543('0x2e')]=function(_0x4fe029,_0xf8f46e){if(_0xf8f46e){return moment(_0x4fe029)[_0x4543('0x2e')](_0xf8f46e);}else if(_0x4fe029){return!![];}return![];};
\ No newline at end of file